diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 421fa30a1e52..aff975642a72 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: '1.21.3' + go-version: '>=1.20.0' - uses: actions/checkout@v2 with: diff --git a/.gitignore b/.gitignore index 185747405898..12000ad44f2a 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,4 @@ cluster-autoscaler/dev [._]s[a-w][a-z] *.un~ Session.vim -.netrwhist - -# Binary files -bin/ +.netrwhist \ No newline at end of file diff --git a/addon-resizer/OWNERS b/addon-resizer/OWNERS index 69418fadfaaa..eac0e8aa4634 100644 --- a/addon-resizer/OWNERS +++ b/addon-resizer/OWNERS @@ -1,8 +1,6 @@ approvers: -- kwiesmueller - jbartosik reviewers: -- kwiesmueller - jbartosik emeritus_approvers: - bskiba # 2022-09-30 diff --git a/addon-resizer/enhancements/5546-scaling-based-on-container-count/README.md b/addon-resizer/enhancements/5546-scaling-based-on-container-count/README.md deleted file mode 100644 index d2de8c89f70a..000000000000 --- a/addon-resizer/enhancements/5546-scaling-based-on-container-count/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# KEP-5546: Scaling based on container count - - -- [Summary](#summary) - - [Goals](#goals) - - [Non-Goals](#non-goals) -- [Proposal](#proposal) - - [Notes](#notes) - - [Risks and Mitigations](#risks-and-mitigations) -- [Design Details](#design-details) - - [Test Plan](#test-plan) - - -## Summary - -Currently Addon Resizer supports scaling based on the number of nodes. Some workloads use resources proportionally to -the number of containers in the cluster. Since number of containers per node is very different in different clusters -it's more resource-efficient to scale such workloads based directly on the container count. - -### Goals - -- Allow scaling workloads based on count of containers in a cluster. -- Allow this for Addon Resizer 1.8 ([used by metrics server]). - -### Non-Goals - -- Using both node and container count to scale workloads. -- Bringing this change to the `master` branch of Addon Resizer. - -## Proposal - -Add flag `--scaling-mode` to Addon Resizer on the [`addon-resizer-release-1.8`] branch. Flag will -have two valid values: - -- `node-proportional` - default, current behavior. -- `container-proportional` - addon resizer will set resources, using the same algorithm it's using now but using number - of containers where it's currently using number of nodes. - -### Notes - -Addon Resizer 1.8 assumes in multiple places that it's scaling based on the number of nodes: - -- [Flag descriptions] that directly reference node counts (`--extra-cpu`, `--extra-memory`, `--extra-storage`, and - `--minClusterSize`) will need to be updated to instead refer to cluster size. -- [README] will need to be updated to reference cluster size instead of node count and explain that cluster size refers - to either node count or container count, depending on the value of the `--scaling-mode` flag. -- Many variable names in code which now refer to node count will refer to cluster size and should be renamed accordingly. - -In addition to implementing the feature we should also clean up the code and documentation. - -### Risks and Mitigations - -One potential risk is that Addon resizer can obtain cluster size (node count or container count): -- from metrics or -- by querying Cluster Api Server to list all objects of the appropriate type - -depending on the configuration. There can be many times more containers in a cluster that there are nodes. So listing -all containers could result in higher load on the Cluster API server. Since Addon Resizer is requesting very few fields -I don't expect this effect to be noticeable. - -Also I expect metrics-server to test for this before using the feature and any other users of Addon Resizer are likely -better off using metrics (which don't have this problem). - -## Design Details - -- Implement function `kubernetesClient.CountContainers()`. It will be analogous to the existing - [`kubernetesClient.CountNodes()`] function. - - If using metrics to determine number of containers in the cluster: - - Fetch pod metrics (similar to [fetching node metrics] but use `/pods` URI instead of `/nodes`). - - For each pod obtain number of containers (length of the `containers` field). - - Sum container counts for all pods. - - If using API server: - - Fetch list pods (similar to [listing nodes]) - - Fetch only [`Spec.InitContainers`], [`Spec.Containers`], and [`Spec.EphemeralContainers`] fields. - - Exclude pods in terminal states ([selector excluding pods in terminal states in VPA]) - - Sum container count over pods. -- Add the `--scaling-mode` flag, with two valid values: - - `node-proportional` - default, current behavior, scaling based on clusters node count and - - `container-proportional` - new behavior, scaling based on clusters container count -- Pass value indicating if we should use node count or container count to the [`updateResources()`] function. -- In `updateResources()` use node count or container count, depending on the value. - -Check that listing containers directly works - -Coinsider listing pods, getting containers only for working pods - -### Test Plan - -In addition to unit tests we will run manual e2e test: - -- Create config based on [`example.yaml`] but scaling the deployment based on the number of containers in the cluster. -- Create config starting deployment with 100 `pause` containers. - -Test the feature by: - -- Starting the deployment scaled by Addon Resizer, based on node count. -- Observe size of the deployment and that it's stable. -- Start deployment with 100 `pause` containers. -- Observe the scaled deployment change resources appropriately. - -Test the node-based scaling: - -- Apply [`example.yaml`]. -- Observe amount and stability assigned resources. -- Resize cluster. -- Observe change in assigned resources. - -Both tests should be performed with metrics- and API- based scaling. - -[used by metrics server]: https://github.com/kubernetes-sigs/metrics-server/blob/0c47555e9b49cfe0719db1a0b7fb6c8dcdff3d38/charts/metrics-server/values.yaml#L121 -[`addon-resizer-release-1.8`]: https://github.com/kubernetes/autoscaler/tree/addon-resizer-release-1.8 -[Flag descriptions]: https://github.com/kubernetes/autoscaler/blob/da500188188d275a382be578ad3d0a758c3a170f/addon-resizer/nanny/main/pod_nanny.go#L47 -[README]: https://github.com/kubernetes/autoscaler/blob/da500188188d275a382be578ad3d0a758c3a170f/addon-resizer/README.md?plain=1#L1 -[`kubernetesClient.CountNodes()`]: https://github.com/kubernetes/autoscaler/blob/da500188188d275a382be578ad3d0a758c3a170f/addon-resizer/nanny/kubernetes_client.go#L58 -[fetching node metrics]: https://github.com/kubernetes/autoscaler/blob/da500188188d275a382be578ad3d0a758c3a170f/addon-resizer/nanny/kubernetes_client.go#L150 -[listing nodes]: https://github.com/kubernetes/autoscaler/blob/da500188188d275a382be578ad3d0a758c3a170f/addon-resizer/nanny/kubernetes_client.go#L71 -[`Spec.InitContainers`]: https://github.com/kubernetes/api/blob/1528256abbdf8ff2510112b28a6aacd239789a36/core/v1/types.go#L3143 -[`Spec.Containers`]: https://github.com/kubernetes/api/blob/1528256abbdf8ff2510112b28a6aacd239789a36/core/v1/types.go#L3150 -[`Spec.EphemeralContainers`]: https://github.com/kubernetes/api/blob/1528256abbdf8ff2510112b28a6aacd239789a36/core/v1/types.go#L3158 -[`Status.Phase`]: https://github.com/kubernetes/api/blob/1528256abbdf8ff2510112b28a6aacd239789a36/core/v1/types.go#L4011 -[selector excluding pods in terminal states in VPA]: https://github.com/kubernetes/autoscaler/blob/04e5bfc88363b4af9fdeb9dfd06c362ec5831f51/vertical-pod-autoscaler/e2e/v1beta2/common.go#L195 -[`updateResources()`]: https://github.com/kubernetes/autoscaler/blob/da500188188d275a382be578ad3d0a758c3a170f/addon-resizer/nanny/nanny_lib.go#L126 -[`example.yaml`]: https://github.com/kubernetes/autoscaler/blob/c8d612725c4f186d5de205ed0114f21540a8ed39/addon-resizer/deploy/example.yaml \ No newline at end of file diff --git a/addon-resizer/enhancements/5700-nanny-configuration-reload/README.md b/addon-resizer/enhancements/5700-nanny-configuration-reload/README.md deleted file mode 100644 index c661c57f36a1..000000000000 --- a/addon-resizer/enhancements/5700-nanny-configuration-reload/README.md +++ /dev/null @@ -1,61 +0,0 @@ -# KEP-5546: Automatic reload of nanny configuration when updated - - -- [Summary](#summary) - - [Goals](#goals) - - [Non-Goals](#non-goals) -- [Proposal](#proposal) - - [Notes](#notes) - - [Risks and Mitigations](#risks-and-mitigations) -- [Design Details](#design-details) - - [Test Plan](#test-plan) - - -Sure, here's the enhancement proposal in the requested format: - -## Summary -- **Goals:** The goal of this enhancement is to improve the user experience for applying nanny configuration changes in the addon-resizer 1.8 when used with the metrics server. The proposed solution involves automatically reloading the nanny configuration whenever changes occur, eliminating the need for manual intervention and sidecar containers. -- **Non-Goals:** This proposal does not aim to update the functional behavior of the addon-resizer. - -## Proposal -The proposed solution involves updating the addon-resizer with the following steps: -- Create a file system watcher using `fsnotify` under `utils/fswatcher` to watch nanny configurations' changes. It should run as a goroutine in the background. -- Detect changes of the nanny configurations' file using the created `fswatcher` trigger the reloading process when configuration changes are detected. Events should be sent in a channel. -- Re-execute the method responsible for building the NannyConfiguration `loadNannyConfiguration` to apply the updated configuration to the addon-resizer. -- Proper error handling should be implemented to manage scenarios where the configuration file is temporarily inaccessible or if there are parsing errors in the configuration file. - -### Risks and Mitigations -- There is a potential risk of filesystem-related issues causing the file watcher to malfunction. Proper testing and error handling should be implemented to handle such scenarios gracefully. -- Errors in the configuration file could lead to unexpected behavior or crashes. The addon-resizer should handle parsing errors and fall back to the previous working configuration if necessary. - -## Design Details -- Create a new package for the `fswatcher` under `utils/fswatcher`. It would contain the `fswatcher` struct and methods and unit-tests. - - `FsWatcher` struct would look similar to this: - ```go - type FsWatcher struct { - *fsnotify.Watcher - - Events chan struct{} - ratelimit time.Duration - names []string - paths map[string]struct{} - } - ``` - - Implement the following functions: - - `CreateFsWatcher`: Instantiates a new `FsWatcher` and start watching on file system. - - `initWatcher`: Initializes the `fsnotify` watcher and initialize the `paths` that would be watched. - - `add`: Adds a new file to watch. - - `reset`: Re-initializes the `FsWatcher`. - - `watch`: watches for the configured files. -- In the main function, we create a new `FsWatcher` and then we wait in an infinite loop to receive events indicating -filesystem changes. Based on these changes, we re-execute `loadNannyConfiguration` function. - -> **Note:** The expected configuration file format is YAML. It has the same structure as the NannyConfiguration CRD. - -### Test Plan -To ensure the proper functioning of the enhanced addon-resizer, the following test plan should be executed: -1. **Unit Tests:** Write unit tests to validate the file watcher's functionality and ensure it triggers events when the configuration file changes. -2. **Manual e2e Tests:** Deploy the addon-resizer with `BaseMemory` of `300Mi` and then we change the `BaseMemory` to `100Mi`. We should observer changes in the behavior of watched pod. - - -[fsnotify]: https://github.com/fsnotify/fsnotify diff --git a/balancer/deploy/controller.yaml b/balancer/deploy/controller.yaml index a6a8bd4db6ff..9dfc079ee0fe 100644 --- a/balancer/deploy/controller.yaml +++ b/balancer/deploy/controller.yaml @@ -20,12 +20,6 @@ rules: - watch - patch - update - - apiGroups: - - balancer.x-k8s.io - resources: - - balancers/status - verbs: - - update - apiGroups: - "" resources: diff --git a/balancer/proposals/balancer.md b/balancer/proposals/balancer.md index 534eaa59f64f..5e2fc004efc0 100644 --- a/balancer/proposals/balancer.md +++ b/balancer/proposals/balancer.md @@ -10,7 +10,7 @@ These domains may include: * Cloud provider zones inside a single region, to ensure that the application is still up and running, even if one of the zones has issues. * Different types of Kubernetes nodes. These may involve nodes that are spot/preemptible, or of different machine families. -A single Kubernetes deployment may either leave the placement entirely up to the scheduler +A single Kuberentes deployment may either leave the placement entirely up to the scheduler (most likely leading to something not entirely desired, like all pods going to a single domain) or focus on a single domain (thus not achieving the goal of being in two or more domains). @@ -179,4 +179,4 @@ type BalancerStatus struct { // +patchStrategy=merge Conditions []metav1.Condition } -``` +``` \ No newline at end of file diff --git a/builder/Dockerfile b/builder/Dockerfile index d4ef0b423f3b..cb5802480182 100644 --- a/builder/Dockerfile +++ b/builder/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.21.4 +FROM golang:1.20 LABEL maintainer="Marcin Wielgus " ENV GOPATH /gopath/ diff --git a/charts/cluster-autoscaler/Chart.yaml b/charts/cluster-autoscaler/Chart.yaml index f4c4704de284..fd11b4490beb 100644 --- a/charts/cluster-autoscaler/Chart.yaml +++ b/charts/cluster-autoscaler/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.28.2 +appVersion: 1.26.2 description: Scales Kubernetes worker nodes within autoscaling groups. engine: gotpl home: https://github.com/kubernetes/autoscaler @@ -11,4 +11,4 @@ name: cluster-autoscaler sources: - https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler type: application -version: 9.34.0 +version: 9.28.0 diff --git a/charts/cluster-autoscaler/README.md b/charts/cluster-autoscaler/README.md index 2a3bba3fad9e..6580cff5d378 100644 --- a/charts/cluster-autoscaler/README.md +++ b/charts/cluster-autoscaler/README.md @@ -70,13 +70,8 @@ To create a valid configuration, follow instructions for your cloud provider: - [AWS](#aws---using-auto-discovery-of-tagged-instance-groups) - [GCE](#gce) -- [Azure](#azure) +- [Azure AKS](#azure-aks) - [OpenStack Magnum](#openstack-magnum) -- [Cluster API](#cluster-api) - -### Templating the autoDiscovery.clusterName - -The cluster name can be templated in the `autoDiscovery.clusterName` variable. This is useful when the cluster name is dynamically generated based on other values coming from external systems like Argo CD or Flux. This also allows you to use global Helm values to set the cluster name, e.g., `autoDiscovery.clusterName=\{\{ .Values.global.clusterName }}`, so that you don't need to set it in more than 1 location in the values file. ### AWS - Using auto-discovery of tagged instance groups @@ -187,18 +182,20 @@ In the event you want to explicitly specify MIGs instead of using auto-discovery --set autoscalingGroups[n].name=https://content.googleapis.com/compute/v1/projects/$PROJECTID/zones/$ZONENAME/instanceGroupManagers/$FULL-MIG-NAME,autoscalingGroups[n].maxSize=$MAXSIZE,autoscalingGroups[n].minSize=$MINSIZE ``` -### Azure +### Azure AKS The following parameters are required: - `cloudProvider=azure` -- `autoscalingGroups[0].name=your-vmss,autoscalingGroups[0].maxSize=10,autoscalingGroups[0].minSize=1` +- `autoscalingGroups[0].name=your-agent-pool,autoscalingGroups[0].maxSize=10,autoscalingGroups[0].minSize=1` - `azureClientID: "your-service-principal-app-id"` - `azureClientSecret: "your-service-principal-client-secret"` - `azureSubscriptionID: "your-azure-subscription-id"` - `azureTenantID: "your-azure-tenant-id"` +- `azureClusterName: "your-aks-cluster-name"` - `azureResourceGroup: "your-aks-cluster-resource-group-name"` -- `azureVMType: "vmss"` +- `azureVMType: "AKS"` +- `azureNodeResourceGroup: "your-aks-cluster-node-resource-group"` ### OpenStack Magnum @@ -233,32 +230,6 @@ Additional config parameters available, see the `values.yaml` for more details - `clusterAPIWorkloadKubeconfigPath` - `clusterAPICloudConfigPath` -### Exoscale - -The following parameters are required: - -- `cloudProvider=exoscale` -- `autoDiscovery.clusterName=` - -Create an Exoscale API key with appropriate permissions as described in [cluster-autoscaler/cloudprovider/exoscale/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/exoscale/README.md). -A secret of name `-exoscale-cluster-autoscaler` needs to be created, containing the api key and secret, as well as the zone. - -```console -$ kubectl create secret generic my-release-exoscale-cluster-autoscaler \ - --from-literal=api-key="EXOxxxxxxxxxxxxxxxxxxxxxxxx" \ - --from-literal=api-secret="xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --from-literal=api-zone="ch-gva-2" -``` - -After creating the secret, the chart may be installed: - -```console -$ helm install my-release autoscaler/cluster-autoscaler \ - --set cloudProvider=exoscale \ - --set autoDiscovery.clusterName= -``` - -Read [cluster-autoscaler/cloudprovider/exoscale/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/exoscale/README.md) for further information on the setup without helm. - ## Uninstalling the Chart To uninstall `my-release`: @@ -349,10 +320,7 @@ Though enough for the majority of installations, the default PodSecurityPolicy _ ### VerticalPodAutoscaler -The CA Helm Chart can install a [`VerticalPodAutoscaler`](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) object from Chart version `9.27.0` -onwards for the Cluster Autoscaler Deployment to scale the CA as appropriate, but for that, we -need to install the VPA to the cluster separately. A VPA can help minimize wasted resources -when usage spikes periodically or remediate containers that are being OOMKilled. +The chart can install a [`VerticalPodAutoscaler`](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) for the Deployment if needed. A VPA can help minimize wasted resources when usage spikes periodically or remediate containers that are being OOMKilled. The following example snippet can be used to install VPA that allows scaling down from the default recommendations of the deployment template: @@ -382,6 +350,8 @@ vpa: | awsSecretAccessKey | string | `""` | AWS access secret key ([if AWS user keys used](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#using-aws-credentials)) | | azureClientID | string | `""` | Service Principal ClientID with contributor permission to Cluster and Node ResourceGroup. Required if `cloudProvider=azure` | | azureClientSecret | string | `""` | Service Principal ClientSecret with contributor permission to Cluster and Node ResourceGroup. Required if `cloudProvider=azure` | +| azureClusterName | string | `""` | Azure AKS cluster name. Required if `cloudProvider=azure` | +| azureNodeResourceGroup | string | `""` | Azure resource group where the cluster's nodes are located, typically set as `MC___`. Required if `cloudProvider=azure` | | azureResourceGroup | string | `""` | Azure resource group that the cluster is located. Required if `cloudProvider=azure` | | azureSubscriptionID | string | `""` | Azure subscription where the resources are located. Required if `cloudProvider=azure` | | azureTenantID | string | `""` | Azure tenant where the resources are located. Required if `cloudProvider=azure` | @@ -413,9 +383,8 @@ vpa: | image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | image.pullSecrets | list | `[]` | Image pull secrets | | image.repository | string | `"registry.k8s.io/autoscaling/cluster-autoscaler"` | Image repository | -| image.tag | string | `"v1.28.2"` | Image tag | +| image.tag | string | `"v1.26.2"` | Image tag | | kubeTargetVersionOverride | string | `""` | Allow overriding the `.Capabilities.KubeVersion.GitVersion` check. Useful for `helm template` commands. | -| kwokConfigMapName | string | `"kwok-provider-config"` | configmap for configuring kwok provider | | magnumCABundlePath | string | `"/etc/kubernetes/ca-bundle.crt"` | Path to the host's CA bundle, from `ca-file` in the cloud-config file. | | magnumClusterName | string | `""` | Cluster name or ID in Magnum. Required if `cloudProvider=magnum` and not setting `autoDiscovery.clusterName`. | | nameOverride | string | `""` | String to partially override `cluster-autoscaler.fullname` template (will maintain the release name) | @@ -439,8 +408,6 @@ vpa: | rbac.serviceAccount.name | string | `""` | The name of the ServiceAccount to use. If not set and create is `true`, a name is generated using the fullname template. | | replicaCount | int | `1` | Desired number of pods | | resources | object | `{}` | Pod resource requests and limits. | -| revisionHistoryLimit | int | `10` | The number of revisions to keep. | -| secretKeyRefNameOverride | string | `""` | Overrides the name of the Secret to use when loading the secretKeyRef for AWS and Azure env variables | | securityContext | object | `{}` | [Security context for pod](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) | | service.annotations | object | `{}` | Annotations to add to service | | service.create | bool | `true` | If `true`, a Service will be created. | diff --git a/charts/cluster-autoscaler/README.md.gotmpl b/charts/cluster-autoscaler/README.md.gotmpl index c91d0d572447..b3a042b0de82 100644 --- a/charts/cluster-autoscaler/README.md.gotmpl +++ b/charts/cluster-autoscaler/README.md.gotmpl @@ -70,13 +70,8 @@ To create a valid configuration, follow instructions for your cloud provider: - [AWS](#aws---using-auto-discovery-of-tagged-instance-groups) - [GCE](#gce) -- [Azure](#azure) +- [Azure AKS](#azure-aks) - [OpenStack Magnum](#openstack-magnum) -- [Cluster API](#cluster-api) - -### Templating the autoDiscovery.clusterName - -The cluster name can be templated in the `autoDiscovery.clusterName` variable. This is useful when the cluster name is dynamically generated based on other values coming from external systems like Argo CD or Flux. This also allows you to use global Helm values to set the cluster name, e.g., `autoDiscovery.clusterName=\{\{ .Values.global.clusterName }}`, so that you don't need to set it in more than 1 location in the values file. ### AWS - Using auto-discovery of tagged instance groups @@ -187,18 +182,20 @@ In the event you want to explicitly specify MIGs instead of using auto-discovery --set autoscalingGroups[n].name=https://content.googleapis.com/compute/v1/projects/$PROJECTID/zones/$ZONENAME/instanceGroupManagers/$FULL-MIG-NAME,autoscalingGroups[n].maxSize=$MAXSIZE,autoscalingGroups[n].minSize=$MINSIZE ``` -### Azure +### Azure AKS The following parameters are required: - `cloudProvider=azure` -- `autoscalingGroups[0].name=your-vmss,autoscalingGroups[0].maxSize=10,autoscalingGroups[0].minSize=1` +- `autoscalingGroups[0].name=your-agent-pool,autoscalingGroups[0].maxSize=10,autoscalingGroups[0].minSize=1` - `azureClientID: "your-service-principal-app-id"` - `azureClientSecret: "your-service-principal-client-secret"` - `azureSubscriptionID: "your-azure-subscription-id"` - `azureTenantID: "your-azure-tenant-id"` +- `azureClusterName: "your-aks-cluster-name"` - `azureResourceGroup: "your-aks-cluster-resource-group-name"` -- `azureVMType: "vmss"` +- `azureVMType: "AKS"` +- `azureNodeResourceGroup: "your-aks-cluster-node-resource-group"` ### OpenStack Magnum @@ -233,32 +230,6 @@ Additional config parameters available, see the `values.yaml` for more details - `clusterAPIWorkloadKubeconfigPath` - `clusterAPICloudConfigPath` -### Exoscale - -The following parameters are required: - -- `cloudProvider=exoscale` -- `autoDiscovery.clusterName=` - -Create an Exoscale API key with appropriate permissions as described in [cluster-autoscaler/cloudprovider/exoscale/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/exoscale/README.md). -A secret of name `-exoscale-cluster-autoscaler` needs to be created, containing the api key and secret, as well as the zone. - -```console -$ kubectl create secret generic my-release-exoscale-cluster-autoscaler \ - --from-literal=api-key="EXOxxxxxxxxxxxxxxxxxxxxxxxx" \ - --from-literal=api-secret="xxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" --from-literal=api-zone="ch-gva-2" -``` - -After creating the secret, the chart may be installed: - -```console -$ helm install my-release autoscaler/cluster-autoscaler \ - --set cloudProvider=exoscale \ - --set autoDiscovery.clusterName= -``` - -Read [cluster-autoscaler/cloudprovider/exoscale/README.md](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/exoscale/README.md) for further information on the setup without helm. - ## Uninstalling the Chart To uninstall `my-release`: @@ -349,10 +320,7 @@ Though enough for the majority of installations, the default PodSecurityPolicy _ ### VerticalPodAutoscaler -The CA Helm Chart can install a [`VerticalPodAutoscaler`](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) object from Chart version `9.27.0` -onwards for the Cluster Autoscaler Deployment to scale the CA as appropriate, but for that, we -need to install the VPA to the cluster separately. A VPA can help minimize wasted resources -when usage spikes periodically or remediate containers that are being OOMKilled. +The chart can install a [`VerticalPodAutoscaler`](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) for the Deployment if needed. A VPA can help minimize wasted resources when usage spikes periodically or remediate containers that are being OOMKilled. The following example snippet can be used to install VPA that allows scaling down from the default recommendations of the deployment template: diff --git a/charts/cluster-autoscaler/templates/_helpers.tpl b/charts/cluster-autoscaler/templates/_helpers.tpl index b0aee4fc080d..944fd1cf6f24 100644 --- a/charts/cluster-autoscaler/templates/_helpers.tpl +++ b/charts/cluster-autoscaler/templates/_helpers.tpl @@ -40,14 +40,11 @@ app.kubernetes.io/name: {{ include "cluster-autoscaler.name" . | quote }} {{/* -Return labels, including instance, name and version. +Return labels, including instance and name. */}} {{- define "cluster-autoscaler.labels" -}} {{ include "cluster-autoscaler.instance-name" . }} app.kubernetes.io/managed-by: {{ .Release.Service | quote }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} helm.sh/chart: {{ include "cluster-autoscaler.chart" . | quote }} {{- if .Values.additionalLabels }} {{ toYaml .Values.additionalLabels }} @@ -116,7 +113,7 @@ Return the autodiscoveryparameters for clusterapi. */}} {{- define "cluster-autoscaler.capiAutodiscoveryConfig" -}} {{- if .Values.autoDiscovery.clusterName -}} -{{- print "clusterName=" -}}{{ tpl (.Values.autoDiscovery.clusterName) . }} +{{- print "clusterName=" -}}{{ .Values.autoDiscovery.clusterName }} {{- end -}} {{- if and .Values.autoDiscovery.clusterName .Values.autoDiscovery.labels -}} {{- print "," -}} diff --git a/charts/cluster-autoscaler/templates/clusterrole.yaml b/charts/cluster-autoscaler/templates/clusterrole.yaml index 356b9c08d716..e3d36557ffd4 100644 --- a/charts/cluster-autoscaler/templates/clusterrole.yaml +++ b/charts/cluster-autoscaler/templates/clusterrole.yaml @@ -42,8 +42,6 @@ rules: verbs: - watch - list - - create - - delete - get - update - apiGroups: @@ -122,7 +120,6 @@ rules: verbs: - list - watch - - get - apiGroups: - coordination.k8s.io resources: @@ -154,7 +151,7 @@ rules: - cluster.x-k8s.io resources: - machinedeployments - - machinepools + - machinedeployments/scale - machines - machinesets verbs: @@ -162,14 +159,5 @@ rules: - list - update - watch - - apiGroups: - - cluster.x-k8s.io - resources: - - machinedeployments/scale - - machinepools/scale - verbs: - - get - - patch - - update {{- end }} {{- end -}} diff --git a/charts/cluster-autoscaler/templates/configmap.yaml b/charts/cluster-autoscaler/templates/configmap.yaml deleted file mode 100644 index 6cd0c4064bfa..000000000000 --- a/charts/cluster-autoscaler/templates/configmap.yaml +++ /dev/null @@ -1,416 +0,0 @@ -{{- if or (eq .Values.cloudProvider "kwok") }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Values.kwokConfigMapName | default "kwok-provider-config" }} - namespace: {{ .Release.Namespace }} -data: - config: |- - # if you see '\n' everywhere, remove all the trailing spaces - apiVersion: v1alpha1 - readNodesFrom: configmap # possible values: [cluster,configmap] - nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "kwok-nodegroup" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" - nodes: - # gpuConfig: - # # to tell kwok provider what label should be considered as GPU label - # gpuLabelKey: "k8s.amazonaws.com/accelerator" - # availableGPUTypes: - # "nvidia-tesla-k80": {} - # "nvidia-tesla-p100": {} - configmap: - name: kwok-provider-templates - kwok: {} # default: fetch latest release of kwok from github and install it - # # you can also manually specify which kwok release you want to install - # # for example: - # kwok: - # release: v0.3.0 - # # you can also disable installing kwok in CA code (and install your own kwok release) - # kwok: - # install: false (true if not specified) ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: kwok-provider-templates - namespace: {{ .Release.Namespace }} -data: - templates: |- - # if you see '\n' everywhere, remove all the trailing spaces - apiVersion: v1 - items: - - apiVersion: v1 - kind: Node - metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:16Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-control-plane - kwok-nodegroup: control-plane - kubernetes.io/os: linux - node-role.kubernetes.io/control-plane: "" - node.kubernetes.io/exclude-from-external-load-balancers: "" - name: kind-control-plane - resourceVersion: "506" - uid: 86716ec7-3071-4091-b055-77b4361d1dca - spec: - podCIDR: 10.244.0.0/24 - podCIDRs: - - 10.244.0.0/24 - providerID: kind://docker/kind/kind-control-plane - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/control-plane - status: - addresses: - - address: 172.18.0.2 - type: InternalIP - - address: kind-control-plane - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:39:58Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:39:58Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:39:58Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:39:58Z" - lastTransitionTime: "2023-05-31T04:39:46Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: 96f8c8b8c8ae4600a3654341f207586e - operatingSystem: linux - osImage: Ubuntu 22.04.2 LTS - systemUUID: 111aa932-7f99-4bef-aaf7-36aa7fb9b012 - - apiVersion: v1 - kind: Node - metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:57Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-worker - kwok-nodegroup: kind-worker - kubernetes.io/os: linux - name: kind-worker - resourceVersion: "577" - uid: 2ac0eb71-e5cf-4708-bbbf-476e8f19842b - spec: - podCIDR: 10.244.2.0/24 - podCIDRs: - - 10.244.2.0/24 - providerID: kind://docker/kind/kind-worker - status: - addresses: - - address: 172.18.0.3 - type: InternalIP - - address: kind-worker - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:40:05Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: a98a13ff474d476294935341f1ba9816 - operatingSystem: linux - osImage: Ubuntu 22.04.2 LTS - systemUUID: 5f3c1af8-a385-4776-85e4-73d7f4252b44 - - apiVersion: v1 - kind: Node - metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:57Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-worker2 - kwok-nodegroup: kind-worker2 - kubernetes.io/os: linux - name: kind-worker2 - resourceVersion: "578" - uid: edc7df38-feb2-4089-9955-780562bdd21e - spec: - podCIDR: 10.244.1.0/24 - podCIDRs: - - 10.244.1.0/24 - providerID: kind://docker/kind/kind-worker2 - status: - addresses: - - address: 172.18.0.4 - type: InternalIP - - address: kind-worker2 - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:40:08Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: fa9f4cd3b3a743bc867b04e44941dcb2 - operatingSystem: linux - osImage: Ubuntu 22.04.2 LTS - systemUUID: f36c0f00-8ba5-4c8c-88bc-2981c8d377b9 - kind: List - metadata: - resourceVersion: "" - - -{{- end }} diff --git a/charts/cluster-autoscaler/templates/deployment.yaml b/charts/cluster-autoscaler/templates/deployment.yaml index 113d92971d2a..ea5ba5c41d50 100644 --- a/charts/cluster-autoscaler/templates/deployment.yaml +++ b/charts/cluster-autoscaler/templates/deployment.yaml @@ -11,7 +11,6 @@ metadata: namespace: {{ .Release.Namespace }} spec: replicas: {{ .Values.replicaCount }} - revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} selector: matchLabels: {{ include "cluster-autoscaler.instance-name" . | indent 6 }} @@ -81,7 +80,7 @@ spec: - --node-group-auto-discovery=mig:namePrefix={{ .name }},min={{ .minSize }},max={{ .maxSize }} {{- end }} {{- end }} - {{- if eq .Values.cloudProvider "oci" }} + {{- if eq .Values.cloudProvider "oci-oke" }} {{- if .Values.cloudConfigPath }} - --nodes={{ .minSize }}:{{ .maxSize }}:{{ .name }} - --balance-similar-node-groups @@ -89,10 +88,10 @@ spec: {{- end }} {{- else if eq .Values.cloudProvider "magnum" }} {{- if .Values.autoDiscovery.clusterName }} - - --cluster-name={{ tpl (.Values.autoDiscovery.clusterName) . }} + - --cluster-name={{ .Values.autoDiscovery.clusterName }} - --node-group-auto-discovery=magnum:role={{ tpl (join "," .Values.autoDiscovery.roles) . }} {{- else }} - - --cluster-name={{ tpl (.Values.magnumClusterName) . }} + - --cluster-name={{ .Values.magnumClusterName }} {{- end }} {{- else if eq .Values.cloudProvider "clusterapi" }} {{- if or .Values.autoDiscovery.clusterName .Values.autoDiscovery.labels }} @@ -111,7 +110,7 @@ spec: {{- end }} {{- else if eq .Values.cloudProvider "azure" }} {{- if .Values.autoDiscovery.clusterName }} - - --node-group-auto-discovery=label:cluster-autoscaler-enabled=true,cluster-autoscaler-name={{ tpl (.Values.autoDiscovery.clusterName) . }} + - --node-group-auto-discovery=label:cluster-autoscaler-enabled=true,cluster-autoscaler-name={{ .Values.autoDiscovery.clusterName }} {{- end }} {{- end }} {{- if eq .Values.cloudProvider "magnum" }} @@ -125,14 +124,6 @@ spec: {{- end }} {{- end }} env: - - name: POD_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: SERVICE_ACCOUNT - valueFrom: - fieldRef: - fieldPath: spec.serviceAccountName {{- if and (eq .Values.cloudProvider "aws") (ne .Values.awsRegion "") }} - name: AWS_REGION value: "{{ .Values.awsRegion }}" @@ -141,36 +132,36 @@ spec: valueFrom: secretKeyRef: key: AwsAccessKeyId - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} {{- end }} {{- if .Values.awsSecretAccessKey }} - name: AWS_SECRET_ACCESS_KEY valueFrom: secretKeyRef: key: AwsSecretAccessKey - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} {{- end }} {{- else if eq .Values.cloudProvider "azure" }} - name: ARM_SUBSCRIPTION_ID valueFrom: secretKeyRef: key: SubscriptionID - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} - name: ARM_RESOURCE_GROUP valueFrom: secretKeyRef: key: ResourceGroup - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} - name: ARM_VM_TYPE valueFrom: secretKeyRef: key: VMType - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} - name: AZURE_CLUSTER_NAME valueFrom: secretKeyRef: key: ClusterName - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} {{- if .Values.azureUseWorkloadIdentityExtension }} - name: ARM_USE_WORKLOAD_IDENTITY_EXTENSION value: "true" @@ -182,42 +173,23 @@ spec: valueFrom: secretKeyRef: key: TenantID - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} - name: ARM_CLIENT_ID valueFrom: secretKeyRef: key: ClientID - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} - name: ARM_CLIENT_SECRET valueFrom: secretKeyRef: key: ClientSecret - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} - name: AZURE_NODE_RESOURCE_GROUP valueFrom: secretKeyRef: key: NodeResourceGroup - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} + name: {{ template "cluster-autoscaler.fullname" . }} {{- end }} - {{- else if eq .Values.cloudProvider "exoscale" }} - - name: EXOSCALE_API_KEY - valueFrom: - secretKeyRef: - key: api-key - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} - - name: EXOSCALE_API_SECRET - valueFrom: - secretKeyRef: - key: api-secret - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} - - name: EXOSCALE_ZONE - valueFrom: - secretKeyRef: - key: api-zone - name: {{ default (include "cluster-autoscaler.fullname" .) .Values.secretKeyRefNameOverride }} - {{- else if eq .Values.cloudProvider "kwok" }} - - name: KWOK_PROVIDER_CONFIGMAP - value: "{{.Values.kwokConfigMapName | default "kwok-provider-config"}}" {{- end }} {{- range $key, $value := .Values.extraEnv }} - name: {{ $key }} diff --git a/charts/cluster-autoscaler/templates/role.yaml b/charts/cluster-autoscaler/templates/role.yaml index 44b1678af4d8..b22fb58be8a4 100644 --- a/charts/cluster-autoscaler/templates/role.yaml +++ b/charts/cluster-autoscaler/templates/role.yaml @@ -49,7 +49,7 @@ rules: - cluster.x-k8s.io resources: - machinedeployments - - machinepools + - machinedeployments/scale - machines - machinesets verbs: @@ -57,15 +57,6 @@ rules: - list - update - watch - - apiGroups: - - cluster.x-k8s.io - resources: - - machinedeployments/scale - - machinepools/scale - verbs: - - get - - patch - - update {{- end }} {{- if ( not .Values.rbac.clusterScoped ) }} - apiGroups: diff --git a/charts/cluster-autoscaler/templates/secret.yaml b/charts/cluster-autoscaler/templates/secret.yaml index 4890230090c1..9c58d0feb1a6 100644 --- a/charts/cluster-autoscaler/templates/secret.yaml +++ b/charts/cluster-autoscaler/templates/secret.yaml @@ -1,25 +1,21 @@ -{{- if not .Values.secretKeyRefNameOverride }} -{{- $isAzure := eq .Values.cloudProvider "azure" }} -{{- $isAws := eq .Values.cloudProvider "aws" }} -{{- $awsCredentialsProvided := and .Values.awsAccessKeyID .Values.awsSecretAccessKey }} - -{{- if or $isAzure (and $isAws $awsCredentialsProvided) }} +{{- if or (eq .Values.cloudProvider "azure") (and (eq .Values.cloudProvider "aws") (not (has "" (list .Values.awsAccessKeyID .Values.awsSecretAccessKey)))) }} apiVersion: v1 kind: Secret metadata: name: {{ template "cluster-autoscaler.fullname" . }} namespace: {{ .Release.Namespace }} data: -{{- if $isAzure }} +{{- if eq .Values.cloudProvider "azure" }} ClientID: "{{ .Values.azureClientID | b64enc }}" ClientSecret: "{{ .Values.azureClientSecret | b64enc }}" ResourceGroup: "{{ .Values.azureResourceGroup | b64enc }}" SubscriptionID: "{{ .Values.azureSubscriptionID | b64enc }}" TenantID: "{{ .Values.azureTenantID | b64enc }}" VMType: "{{ .Values.azureVMType | b64enc }}" -{{- else if $isAws }} + ClusterName: "{{ .Values.azureClusterName | b64enc }}" + NodeResourceGroup: "{{ .Values.azureNodeResourceGroup | b64enc }}" +{{- else if eq .Values.cloudProvider "aws" }} AwsAccessKeyId: "{{ .Values.awsAccessKeyID | b64enc }}" AwsSecretAccessKey: "{{ .Values.awsSecretAccessKey | b64enc }}" {{- end }} {{- end }} -{{- end }} diff --git a/charts/cluster-autoscaler/values.yaml b/charts/cluster-autoscaler/values.yaml index 4a2e6fb212c3..2f3e5cf609e3 100644 --- a/charts/cluster-autoscaler/values.yaml +++ b/charts/cluster-autoscaler/values.yaml @@ -6,7 +6,7 @@ affinity: {} additionalLabels: {} autoDiscovery: - # cloudProviders `aws`, `gce`, `azure`, `magnum`, `clusterapi` and `oci` are supported by auto-discovery at this time + # cloudProviders `aws`, `gce`, `azure`, `magnum` and `clusterapi` `oci-oke` are supported by auto-discovery at this time # AWS: Set tags as described in https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#auto-discovery-setup # autoDiscovery.clusterName -- Enable autodiscovery for `cloudProvider=aws`, for groups matching `autoDiscovery.tags`. @@ -230,7 +230,7 @@ image: # image.repository -- Image repository repository: registry.k8s.io/autoscaling/cluster-autoscaler # image.tag -- Image tag - tag: v1.28.2 + tag: v1.26.2 # image.pullPolicy -- Image pull policy pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. @@ -244,9 +244,6 @@ image: # kubeTargetVersionOverride -- Allow overriding the `.Capabilities.KubeVersion.GitVersion` check. Useful for `helm template` commands. kubeTargetVersionOverride: "" -# kwokConfigMapName -- configmap for configuring kwok provider -kwokConfigMapName: "kwok-provider-config" - # magnumCABundlePath -- Path to the host's CA bundle, from `ca-file` in the cloud-config file. magnumCABundlePath: "/etc/kubernetes/ca-bundle.crt" @@ -324,9 +321,6 @@ resources: {} # cpu: 100m # memory: 300Mi -# revisionHistoryLimit -- The number of revisions to keep. -revisionHistoryLimit: 10 - # securityContext -- [Security context for pod](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) securityContext: {} # runAsNonRoot: true @@ -402,6 +396,3 @@ vpa: updateMode: "Auto" # vpa.containerPolicy -- [ContainerResourcePolicy](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler/v0.13.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L159). The containerName is always et to the deployment's container name. This value is required if VPA is enabled. containerPolicy: {} - -# secretKeyRefNameOverride -- Overrides the name of the Secret to use when loading the secretKeyRef for AWS and Azure env variables -secretKeyRefNameOverride: "" diff --git a/cluster-autoscaler/Dockerfile.s390x b/cluster-autoscaler/Dockerfile.s390x deleted file mode 100644 index 07ed8daf9ded..000000000000 --- a/cluster-autoscaler/Dockerfile.s390x +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. All rights reserved -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -ARG BASEIMAGE=gcr.io/distroless/static:nonroot-s390x -FROM $BASEIMAGE -LABEL maintainer="Marcin Wielgus " - -COPY cluster-autoscaler-s390x /cluster-autoscaler -WORKDIR / -CMD ["/cluster-autoscaler"] diff --git a/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/auth/credentials/oidc_credential.go b/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/auth/credentials/oidc_credential.go deleted file mode 100644 index 2d23de3cd98b..000000000000 --- a/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/auth/credentials/oidc_credential.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 credentials - -// OIDCCredential is a kind of credentials -type OIDCCredential struct { - RoleArn string - OIDCProviderArn string - OIDCTokenFilePath string - RoleSessionName string - RoleSessionExpiration int -} - -// NewOIDCRoleArnCredential returns OIDCCredential -func NewOIDCRoleArnCredential(roleArn, OIDCProviderArn, OIDCTokenFilePath, RoleSessionName string, RoleSessionExpiration int) *OIDCCredential { - return &OIDCCredential{ - RoleArn: roleArn, - OIDCProviderArn: OIDCProviderArn, - OIDCTokenFilePath: OIDCTokenFilePath, - RoleSessionName: RoleSessionName, - RoleSessionExpiration: RoleSessionExpiration, - } -} diff --git a/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/auth/signers/signer_oidc.go b/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/auth/signers/signer_oidc.go deleted file mode 100644 index 930e9612e4dc..000000000000 --- a/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/auth/signers/signer_oidc.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 signers - -import ( - "encoding/json" - "fmt" - "github.com/jmespath/go-jmespath" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/auth/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/errors" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/requests" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/responses" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/utils" - "k8s.io/klog/v2" - "net/http" - "os" - "runtime" - "strconv" - "strings" - "time" -) - -const ( - defaultOIDCDurationSeconds = 3600 -) - -// OIDCSigner is kind of signer -type OIDCSigner struct { - *credentialUpdater - roleSessionName string - sessionCredential *SessionCredential - credential *credentials.OIDCCredential -} - -// NewOIDCSigner returns OIDCSigner -func NewOIDCSigner(credential *credentials.OIDCCredential) (signer *OIDCSigner, err error) { - signer = &OIDCSigner{ - credential: credential, - } - - signer.credentialUpdater = &credentialUpdater{ - credentialExpiration: credential.RoleSessionExpiration, - buildRequestMethod: signer.buildCommonRequest, - responseCallBack: signer.refreshCredential, - refreshApi: signer.refreshApi, - } - - if len(credential.RoleSessionName) > 0 { - signer.roleSessionName = credential.RoleSessionName - } else { - signer.roleSessionName = "kubernetes-cluster-autoscaler-" + strconv.FormatInt(time.Now().UnixNano()/1000, 10) - } - if credential.RoleSessionExpiration > 0 { - if credential.RoleSessionExpiration >= 900 && credential.RoleSessionExpiration <= 3600 { - signer.credentialExpiration = credential.RoleSessionExpiration - } else { - err = errors.NewClientError(errors.InvalidParamErrorCode, "Assume Role session duration should be in the range of 15min - 1Hr", nil) - } - } else { - signer.credentialExpiration = defaultOIDCDurationSeconds - } - return -} - -// GetName returns "HMAC-SHA1" -func (*OIDCSigner) GetName() string { - return "HMAC-SHA1" -} - -// GetType returns "" -func (*OIDCSigner) GetType() string { - return "" -} - -// GetVersion returns "1.0" -func (*OIDCSigner) GetVersion() string { - return "1.0" -} - -// GetAccessKeyId returns accessKeyId -func (signer *OIDCSigner) GetAccessKeyId() (accessKeyId string, err error) { - if signer.sessionCredential == nil || signer.needUpdateCredential() { - err = signer.updateCredential() - } - if err != nil && (signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0) { - return "", err - } - - return signer.sessionCredential.AccessKeyId, nil -} - -// GetExtraParam returns params -func (signer *OIDCSigner) GetExtraParam() map[string]string { - if signer.sessionCredential == nil || signer.needUpdateCredential() { - signer.updateCredential() - } - if signer.sessionCredential == nil || len(signer.sessionCredential.StsToken) <= 0 { - return make(map[string]string) - } - - return map[string]string{"SecurityToken": signer.sessionCredential.StsToken} -} - -// Sign create signer -func (signer *OIDCSigner) Sign(stringToSign, secretSuffix string) string { - secret := signer.sessionCredential.AccessKeySecret + secretSuffix - return ShaHmac1(stringToSign, secret) -} - -func (signer *OIDCSigner) buildCommonRequest() (request *requests.CommonRequest, err error) { - const endpoint = "sts.aliyuncs.com" - const stsApiVersion = "2015-04-01" - const action = "AssumeRoleWithOIDC" - request = requests.NewCommonRequest() - request.Scheme = requests.HTTPS - request.Domain = endpoint - request.Method = requests.POST - request.QueryParams["Action"] = action - request.QueryParams["Version"] = stsApiVersion - request.QueryParams["Format"] = "JSON" - request.QueryParams["Timestamp"] = utils.GetTimeInFormatISO8601() - request.QueryParams["SignatureNonce"] = utils.GetUUIDV4() - request.FormParams["RoleArn"] = signer.credential.RoleArn - request.FormParams["OIDCProviderArn"] = signer.credential.OIDCProviderArn - request.FormParams["OIDCToken"] = signer.getOIDCToken(signer.credential.OIDCTokenFilePath) - request.QueryParams["RoleSessionName"] = signer.credential.RoleSessionName - request.Headers["host"] = endpoint - request.Headers["Accept-Encoding"] = "identity" - request.Headers["content-type"] = "application/x-www-form-urlencoded" - request.Headers["user-agent"] = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s TeaDSL/1 kubernetes-cluster-autoscaler", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), "0.01") - return -} - -func (signer *OIDCSigner) getOIDCToken(OIDCTokenFilePath string) string { - tokenPath := OIDCTokenFilePath - _, err := os.Stat(tokenPath) - if os.IsNotExist(err) { - tokenPath = os.Getenv("ALIBABA_CLOUD_OIDC_TOKEN_FILE") - if tokenPath == "" { - klog.Error("oidc token file path is missing") - return "" - } - } - - token, err := os.ReadFile(tokenPath) - if err != nil { - klog.Errorf("get oidc token from file %s failed: %s", tokenPath, err) - return "" - } - return string(token) -} - -func (signer *OIDCSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { - body := utils.GetUrlFormedMap(request.FormParams) - httpRequest, err := http.NewRequest(request.Method, fmt.Sprintf("%s://%s/?%s", strings.ToLower(request.Scheme), request.Domain, utils.GetUrlFormedMap(request.QueryParams)), strings.NewReader(body)) - if err != nil { - klog.Errorf("refresh RRSA token failed: %s", err) - return - } - - httpRequest.Proto = "HTTP/1.1" - httpRequest.Host = request.Domain - for k, v := range request.Headers { - httpRequest.Header.Add(k, v) - } - - httpClient := &http.Client{} - httpResponse, err := httpClient.Do(httpRequest) - if err != nil { - klog.Errorf("refresh RRSA token failed: %s", err) - return - } - - response = responses.NewCommonResponse() - err = responses.Unmarshal(response, httpResponse, "") - - return -} - -func (signer *OIDCSigner) refreshCredential(response *responses.CommonResponse) (err error) { - if response.GetHttpStatus() != http.StatusOK { - message := "refresh RRSA failed" - err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message) - return - } - - var data interface{} - err = json.Unmarshal(response.GetHttpContentBytes(), &data) - if err != nil { - klog.Errorf("refresh RRSA token err, json.Unmarshal fail: %s", err) - return - } - accessKeyId, err := jmespath.Search("Credentials.AccessKeyId", data) - if err != nil { - klog.Errorf("refresh RRSA token err, fail to get AccessKeyId: %s", err) - return - } - accessKeySecret, err := jmespath.Search("Credentials.AccessKeySecret", data) - if err != nil { - klog.Errorf("refresh RRSA token err, fail to get AccessKeySecret: %s", err) - return - } - securityToken, err := jmespath.Search("Credentials.SecurityToken", data) - if err != nil { - klog.Errorf("refresh RRSA token err, fail to get SecurityToken: %s", err) - return - } - expiration, err := jmespath.Search("Credentials.Expiration", data) - if err != nil { - klog.Errorf("refresh RRSA token err, fail to get Expiration: %s", err) - return - } - - if accessKeyId == nil || accessKeySecret == nil || securityToken == nil { - return - } - - expirationTime, err := time.Parse("2006-01-02T15:04:05Z", expiration.(string)) - signer.credentialExpiration = int(expirationTime.Unix() - time.Now().Unix()) - signer.sessionCredential = &SessionCredential{ - AccessKeyId: accessKeyId.(string), - AccessKeySecret: accessKeySecret.(string), - StsToken: securityToken.(string), - } - - return -} - -// GetSessionCredential returns SessionCredential -func (signer *OIDCSigner) GetSessionCredential() *SessionCredential { - return signer.sessionCredential -} - -// Shutdown doesn't implement -func (signer *OIDCSigner) Shutdown() {} diff --git a/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/client_test.go b/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/client_test.go deleted file mode 100644 index 5b1ca237b5c1..000000000000 --- a/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 sdk - -import ( - "github.com/stretchr/testify/assert" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/sdk/auth/signers" - "testing" -) - -func TestRRSAClientInit(t *testing.T) { - oidcProviderARN := "acs:ram::12345:oidc-provider/ack-rrsa-cb123" - oidcTokenFilePath := "/var/run/secrets/tokens/oidc-token" - roleARN := "acs:ram::12345:role/autoscaler-role" - roleSessionName := "session" - regionId := "cn-hangzhou" - - client, err := NewClientWithRRSA(regionId, roleARN, oidcProviderARN, oidcTokenFilePath, roleSessionName) - assert.NoError(t, err) - assert.IsType(t, &signers.OIDCSigner{}, client.signer) -} diff --git a/cluster-autoscaler/cloudprovider/alicloud/alicloud_auto_scaling_test.go b/cluster-autoscaler/cloudprovider/alicloud/alicloud_auto_scaling_test.go deleted file mode 100644 index cb682676c723..000000000000 --- a/cluster-autoscaler/cloudprovider/alicloud/alicloud_auto_scaling_test.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 alicloud - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/alicloud/alibaba-cloud-sdk-go/services/ess" -) - -var instancesOfPageOne = []ess.ScalingInstance{ - {InstanceId: "instance-1"}, - {InstanceId: "instance-2"}, - {InstanceId: "instance-3"}, - {InstanceId: "instance-4"}, - {InstanceId: "instance-5"}, - {InstanceId: "instance-6"}, - {InstanceId: "instance-7"}, - {InstanceId: "instance-8"}, - {InstanceId: "instance-9"}, - {InstanceId: "instance-10"}, -} - -var instancesOfPageTwo = []ess.ScalingInstance{ - {InstanceId: "instance-11"}, - {InstanceId: "instance-12"}, - {InstanceId: "instance-13"}, - {InstanceId: "instance-14"}, - {InstanceId: "instance-15"}, -} - -type mockAutoScaling struct { - mock.Mock -} - -func (as *mockAutoScaling) DescribeScalingGroups(req *ess.DescribeScalingGroupsRequest) (*ess.DescribeScalingGroupsResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) DescribeScalingConfigurations(req *ess.DescribeScalingConfigurationsRequest) (*ess.DescribeScalingConfigurationsResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) DescribeScalingRules(req *ess.DescribeScalingRulesRequest) (*ess.DescribeScalingRulesResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) CreateScalingRule(req *ess.CreateScalingRuleRequest) (*ess.CreateScalingRuleResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) ModifyScalingGroup(req *ess.ModifyScalingGroupRequest) (*ess.ModifyScalingGroupResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) RemoveInstances(req *ess.RemoveInstancesRequest) (*ess.RemoveInstancesResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) ExecuteScalingRule(req *ess.ExecuteScalingRuleRequest) (*ess.ExecuteScalingRuleResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) ModifyScalingRule(req *ess.ModifyScalingRuleRequest) (*ess.ModifyScalingRuleResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) DeleteScalingRule(req *ess.DeleteScalingRuleRequest) (*ess.DeleteScalingRuleResponse, error) { - return nil, nil -} - -func (as *mockAutoScaling) DescribeScalingInstances(req *ess.DescribeScalingInstancesRequest) (*ess.DescribeScalingInstancesResponse, error) { - instances := make([]ess.ScalingInstance, 0) - - pageNumber, err := req.PageNumber.GetValue() - if err != nil { - return nil, fmt.Errorf("invalid page number") - } - if pageNumber == 1 { - instances = instancesOfPageOne - } else if pageNumber == 2 { - instances = instancesOfPageTwo - } else { - return nil, fmt.Errorf("exceed total num") - } - - return &ess.DescribeScalingInstancesResponse{ - ScalingInstances: ess.ScalingInstances{ScalingInstance: instances}, - TotalCount: len(instancesOfPageOne) + len(instancesOfPageTwo), - }, nil -} - -func newMockAutoScalingWrapper() *autoScalingWrapper { - return &autoScalingWrapper{ - autoScaling: &mockAutoScaling{}, - cfg: &cloudConfig{}, - } -} - -func TestRRSACloudConfigEssClientCreation(t *testing.T) { - t.Setenv(oidcProviderARN, "acs:ram::12345:oidc-provider/ack-rrsa-cb123") - t.Setenv(oidcTokenFilePath, "/var/run/secrets/tokens/oidc-token") - t.Setenv(roleARN, "acs:ram::12345:role/autoscaler-role") - t.Setenv(roleSessionName, "session") - t.Setenv(regionId, "cn-hangzhou") - - cfg := &cloudConfig{} - assert.True(t, cfg.isValid()) - assert.True(t, cfg.RRSAEnabled) - - client, err := getEssClient(cfg) - assert.NoError(t, err) - assert.NotNil(t, client) -} - -func TestGetScalingInstancesByGroup(t *testing.T) { - wrapper := newMockAutoScalingWrapper() - instances, err := wrapper.getScalingInstancesByGroup("asg-123") - assert.NoError(t, err) - assert.Equal(t, len(instancesOfPageOne)+len(instancesOfPageTwo), len(instances)) -} diff --git a/cluster-autoscaler/cloudprovider/alicloud/alicloud_cloud_config_test.go b/cluster-autoscaler/cloudprovider/alicloud/alicloud_cloud_config_test.go deleted file mode 100644 index 4c828367c5f0..000000000000 --- a/cluster-autoscaler/cloudprovider/alicloud/alicloud_cloud_config_test.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 alicloud - -import ( - "github.com/stretchr/testify/assert" - "testing" -) - -func TestAccessKeyCloudConfigIsValid(t *testing.T) { - t.Setenv(accessKeyId, "id") - t.Setenv(accessKeySecret, "secret") - t.Setenv(regionId, "cn-hangzhou") - - cfg := &cloudConfig{} - assert.True(t, cfg.isValid()) - assert.False(t, cfg.RRSAEnabled) -} - -func TestRRSACloudConfigIsValid(t *testing.T) { - t.Setenv(oidcProviderARN, "acs:ram::12345:oidc-provider/ack-rrsa-cb123") - t.Setenv(oidcTokenFilePath, "/var/run/secrets/tokens/oidc-token") - t.Setenv(roleARN, "acs:ram::12345:role/autoscaler-role") - t.Setenv(roleSessionName, "session") - t.Setenv(regionId, "cn-hangzhou") - - cfg := &cloudConfig{} - assert.True(t, cfg.isValid()) - assert.True(t, cfg.RRSAEnabled) -} diff --git a/cluster-autoscaler/cloudprovider/alicloud/alicloud_instance_types_test.go b/cluster-autoscaler/cloudprovider/alicloud/alicloud_instance_types_test.go deleted file mode 100644 index eaf5cdeec516..000000000000 --- a/cluster-autoscaler/cloudprovider/alicloud/alicloud_instance_types_test.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 alicloud - -import ( - "github.com/stretchr/testify/assert" - "testing" -) - -func TestRRSACloudConfigEcsClientCreation(t *testing.T) { - t.Setenv(oidcProviderARN, "acs:ram::12345:oidc-provider/ack-rrsa-cb123") - t.Setenv(oidcTokenFilePath, "/var/run/secrets/tokens/oidc-token") - t.Setenv(roleARN, "acs:ram::12345:role/autoscaler-role") - t.Setenv(roleSessionName, "session") - t.Setenv(regionId, "cn-hangzhou") - - cfg := &cloudConfig{} - assert.True(t, cfg.isValid()) - assert.True(t, cfg.RRSAEnabled) - - client, err := getEcsClient(cfg) - assert.NoError(t, err) - assert.NotNil(t, client) -} diff --git a/cluster-autoscaler/cloudprovider/alicloud/examples/cluster-autoscaler-rrsa-standard.yaml b/cluster-autoscaler/cloudprovider/alicloud/examples/cluster-autoscaler-rrsa-standard.yaml deleted file mode 100644 index bd7d3220ad4c..000000000000 --- a/cluster-autoscaler/cloudprovider/alicloud/examples/cluster-autoscaler-rrsa-standard.yaml +++ /dev/null @@ -1,203 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler - name: cluster-autoscaler - namespace: kube-system ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: cluster-autoscaler - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -rules: - - apiGroups: [""] - resources: ["events", "endpoints"] - verbs: ["create", "patch"] - - apiGroups: [""] - resources: ["pods/eviction"] - verbs: ["create"] - - apiGroups: [""] - resources: ["pods/status"] - verbs: ["update"] - - apiGroups: [""] - resources: ["endpoints"] - resourceNames: ["cluster-autoscaler"] - verbs: ["get", "update"] - - apiGroups: [""] - resources: ["nodes"] - verbs: ["watch", "list", "get", "update"] - - apiGroups: [""] - resources: - - "namespaces" - - "pods" - - "services" - - "replicationcontrollers" - - "persistentvolumeclaims" - - "persistentvolumes" - verbs: ["watch", "list", "get"] - - apiGroups: ["extensions"] - resources: ["replicasets", "daemonsets"] - verbs: ["watch", "list", "get"] - - apiGroups: ["policy"] - resources: ["poddisruptionbudgets"] - verbs: ["watch", "list"] - - apiGroups: ["apps"] - resources: ["statefulsets", "replicasets", "daemonsets"] - verbs: ["watch", "list", "get"] - - apiGroups: ["storage.k8s.io"] - resources: ["storageclasses", "csinodes", "csistoragecapacities", "csidrivers"] - verbs: ["watch", "list", "get"] - - apiGroups: ["batch", "extensions"] - resources: ["jobs"] - verbs: ["get", "list", "watch", "patch"] - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["*"] - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -rules: -- apiGroups: [""] - resources: ["configmaps"] - verbs: ["create","list","watch"] -- apiGroups: [""] - resources: ["configmaps"] - resourceNames: ["cluster-autoscaler-status", "cluster-autoscaler-priority-expander"] - verbs: ["delete","get","update","watch"] - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: cluster-autoscaler - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-autoscaler -subjects: - - kind: ServiceAccount - name: cluster-autoscaler - namespace: kube-system - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: cluster-autoscaler -subjects: - - kind: ServiceAccount - name: cluster-autoscaler - namespace: kube-system - ---- -apiVersion: v1 -kind: Secret -metadata: - name: cloud-config - namespace: kube-system -type: Opaque -data: - oidc-provider-arn: [YOUR_BASE64_OIDC_PROVIDER_ARN] - oidc-token-file-path: [YOUR_BASE64_OIDC_TOKEN_FILE_PATH] - role-arn: [YOUR_BASE64_ROLE_ARN] - session-name: [YOUR_BASE64_SESSION_NAME] - region-id: [YOUR_BASE64_REGION_ID] - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - app: cluster-autoscaler -spec: - replicas: 1 - selector: - matchLabels: - app: cluster-autoscaler - template: - metadata: - labels: - app: cluster-autoscaler - spec: - priorityClassName: system-cluster-critical - serviceAccountName: cluster-autoscaler - containers: - - image: registry.cn-hangzhou.aliyuncs.com/acs/autoscaler:v1.3.1 - name: cluster-autoscaler - resources: - limits: - cpu: 100m - memory: 300Mi - requests: - cpu: 100m - memory: 300Mi - command: - - ./cluster-autoscaler - - --v=4 - - --stderrthreshold=info - - --cloud-provider=alicloud - - --nodes=[min]:[max]:[ASG_ID] - imagePullPolicy: "Always" - env: - - name: ALICLOUD_OIDC_PROVIDER_ARN - valueFrom: - secretKeyRef: - name: cloud-config - key: oidc-provider-arn - - name: ALICLOUD_OIDC_TOKEN_FILE_PATH - valueFrom: - secretKeyRef: - name: cloud-config - key: oidc-token-file-path - - name: ALICLOUD_ROLE_ARN - valueFrom: - secretKeyRef: - name: cloud-config - key: role-arn - - name: ALICLOUD_SESSION_NAME - valueFrom: - secretKeyRef: - name: cloud-config - key: session-name - - name: REGION_ID - valueFrom: - secretKeyRef: - name: cloud-config - key: region-id - volumeMounts: - - name: oidc-token - mountPath: /var/run/secrets/tokens - volumes: - - name: oidc-token - projected: - sources: - - serviceAccountToken: - path: oidc-token - expirationSeconds: 7200 # The validity period of the OIDC token in seconds. - audience: "sts.aliyuncs.com" diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/6b25cc1a38cf4e229728e8e169b9152b.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/6b25cc1a38cf4e229728e8e169b9152b.json deleted file mode 100644 index d8558a439b65..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/6b25cc1a38cf4e229728e8e169b9152b.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "6b25cc1a-38cf-4e22-9728-e8e169b9152b", - "type": "feature", - "description": "Add awsQueryCompatible error code translation support", - "modules": [ - "." - ] -} \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/6eb0ebebe73b422a969ea440174c3e83.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/6eb0ebebe73b422a969ea440174c3e83.json deleted file mode 100644 index c0f0c60729e3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/6eb0ebebe73b422a969ea440174c3e83.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "6eb0ebeb-e73b-422a-969e-a440174c3e83", - "type": "bugfix", - "description": "Removes old model file for ssm sap and uses the new model file to regenerate client", - "modules": [ - "." - ] -} \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/74c9af99629e453b97a0af6251efd414.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/74c9af99629e453b97a0af6251efd414.json deleted file mode 100644 index a682727302aa..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.changelog/74c9af99629e453b97a0af6251efd414.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "74c9af99-629e-453b-97a0-af6251efd414", - "type": "bugfix", - "description": "endpoints were incorrect for kendra-ranking. this fixes that", - "modules": [ - "." - ] -} \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.gitignore b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.gitignore deleted file mode 100644 index fb11ceca0111..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -dist -/doc -/doc-staging -.yardoc -Gemfile.lock -awstesting/integration/smoke/**/importmarker__.go -awstesting/integration/smoke/_test/ -/vendor/bin/ -/vendor/pkg/ -/vendor/src/ -/private/model/cli/gen-api/gen-api diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.godoc_config b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.godoc_config deleted file mode 100644 index 425885f5efa1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.godoc_config +++ /dev/null @@ -1,14 +0,0 @@ -{ - "PkgHandler": { - "Pattern": "/sdk-for-go/api/", - "StripPrefix": "/sdk-for-go/api", - "Include": ["/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws", "/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service"], - "Exclude": ["/src/cmd", "/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/awstesting", "/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/awsmigrate", "/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private"], - "IgnoredSuffixes": ["iface"] - }, - "Github": { - "Tag": "master", - "Repo": "/aws/aws-sdk-go", - "UseGithub": true - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/auth/bearer/token.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/auth/bearer/token.go deleted file mode 100644 index 3a4e37344c08..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/auth/bearer/token.go +++ /dev/null @@ -1,50 +0,0 @@ -package bearer - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "time" -) - -// Token provides a type wrapping a bearer token and expiration metadata. -type Token struct { - Value string - - CanExpire bool - Expires time.Time -} - -// Expired returns if the token's Expires time is before or equal to the time -// provided. If CanExpire is false, Expired will always return false. -func (t Token) Expired(now time.Time) bool { - if !t.CanExpire { - return false - } - now = now.Round(0) - return now.Equal(t.Expires) || now.After(t.Expires) -} - -// TokenProvider provides interface for retrieving bearer tokens. -type TokenProvider interface { - RetrieveBearerToken(aws.Context) (Token, error) -} - -// TokenProviderFunc provides a helper utility to wrap a function as a type -// that implements the TokenProvider interface. -type TokenProviderFunc func(aws.Context) (Token, error) - -// RetrieveBearerToken calls the wrapped function, returning the Token or -// error. -func (fn TokenProviderFunc) RetrieveBearerToken(ctx aws.Context) (Token, error) { - return fn(ctx) -} - -// StaticTokenProvider provides a utility for wrapping a static bearer token -// value within an implementation of a token provider. -type StaticTokenProvider struct { - Token Token -} - -// RetrieveBearerToken returns the static token specified. -func (s StaticTokenProvider) RetrieveBearerToken(aws.Context) (Token, error) { - return s.Token, nil -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/corehandlers/awsinternal.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/corehandlers/awsinternal.go deleted file mode 100644 index 140242dd1b8d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/corehandlers/awsinternal.go +++ /dev/null @@ -1,4 +0,0 @@ -// DO NOT EDIT -package corehandlers - -const isAwsInternal = "" \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/sso_cached_token.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/sso_cached_token.go deleted file mode 100644 index 54e59f0a2f81..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/sso_cached_token.go +++ /dev/null @@ -1,237 +0,0 @@ -package ssocreds - -import ( - "crypto/sha1" - "encoding/hex" - "encoding/json" - "fmt" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/shareddefaults" - "io/ioutil" - "os" - "path/filepath" - "strconv" - "strings" - "time" -) - -var resolvedOsUserHomeDir = shareddefaults.UserHomeDir - -// StandardCachedTokenFilepath returns the filepath for the cached SSO token file, or -// error if unable get derive the path. Key that will be used to compute a SHA1 -// value that is hex encoded. -// -// Derives the filepath using the Key as: -// -// ~/.aws/sso/cache/.json -func StandardCachedTokenFilepath(key string) (string, error) { - homeDir := resolvedOsUserHomeDir() - if len(homeDir) == 0 { - return "", fmt.Errorf("unable to get USER's home directory for cached token") - } - hash := sha1.New() - if _, err := hash.Write([]byte(key)); err != nil { - return "", fmt.Errorf("unable to compute cached token filepath key SHA1 hash, %v", err) - } - - cacheFilename := strings.ToLower(hex.EncodeToString(hash.Sum(nil))) + ".json" - - return filepath.Join(homeDir, ".aws", "sso", "cache", cacheFilename), nil -} - -type tokenKnownFields struct { - AccessToken string `json:"accessToken,omitempty"` - ExpiresAt *rfc3339 `json:"expiresAt,omitempty"` - - RefreshToken string `json:"refreshToken,omitempty"` - ClientID string `json:"clientId,omitempty"` - ClientSecret string `json:"clientSecret,omitempty"` -} - -type cachedToken struct { - tokenKnownFields - UnknownFields map[string]interface{} `json:"-"` -} - -// MarshalJSON provides custom marshalling because the standard library Go marshaller ignores unknown/unspecified fields -// when marshalling from a struct: https://pkg.go.dev/encoding/json#Marshal -// This function adds some extra validation to the known fields and captures unknown fields. -func (t cachedToken) MarshalJSON() ([]byte, error) { - fields := map[string]interface{}{} - - setTokenFieldString(fields, "accessToken", t.AccessToken) - setTokenFieldRFC3339(fields, "expiresAt", t.ExpiresAt) - - setTokenFieldString(fields, "refreshToken", t.RefreshToken) - setTokenFieldString(fields, "clientId", t.ClientID) - setTokenFieldString(fields, "clientSecret", t.ClientSecret) - - for k, v := range t.UnknownFields { - if _, ok := fields[k]; ok { - return nil, fmt.Errorf("unknown token field %v, duplicates known field", k) - } - fields[k] = v - } - - return json.Marshal(fields) -} - -func setTokenFieldString(fields map[string]interface{}, key, value string) { - if value == "" { - return - } - fields[key] = value -} -func setTokenFieldRFC3339(fields map[string]interface{}, key string, value *rfc3339) { - if value == nil { - return - } - fields[key] = value -} - -// UnmarshalJSON provides custom unmarshalling because the standard library Go unmarshaller ignores unknown/unspecified -// fields when unmarshalling from a struct: https://pkg.go.dev/encoding/json#Unmarshal -// This function adds some extra validation to the known fields and captures unknown fields. -func (t *cachedToken) UnmarshalJSON(b []byte) error { - var fields map[string]interface{} - if err := json.Unmarshal(b, &fields); err != nil { - return nil - } - - t.UnknownFields = map[string]interface{}{} - - for k, v := range fields { - var err error - switch k { - case "accessToken": - err = getTokenFieldString(v, &t.AccessToken) - case "expiresAt": - err = getTokenFieldRFC3339(v, &t.ExpiresAt) - case "refreshToken": - err = getTokenFieldString(v, &t.RefreshToken) - case "clientId": - err = getTokenFieldString(v, &t.ClientID) - case "clientSecret": - err = getTokenFieldString(v, &t.ClientSecret) - default: - t.UnknownFields[k] = v - } - - if err != nil { - return fmt.Errorf("field %q, %v", k, err) - } - } - - return nil -} - -func getTokenFieldString(v interface{}, value *string) error { - var ok bool - *value, ok = v.(string) - if !ok { - return fmt.Errorf("expect value to be string, got %T", v) - } - return nil -} - -func getTokenFieldRFC3339(v interface{}, value **rfc3339) error { - var stringValue string - if err := getTokenFieldString(v, &stringValue); err != nil { - return err - } - - timeValue, err := parseRFC3339(stringValue) - if err != nil { - return err - } - - *value = &timeValue - return nil -} - -func loadCachedToken(filename string) (cachedToken, error) { - fileBytes, err := ioutil.ReadFile(filename) - if err != nil { - return cachedToken{}, fmt.Errorf("failed to read cached SSO token file, %v", err) - } - - var t cachedToken - if err := json.Unmarshal(fileBytes, &t); err != nil { - return cachedToken{}, fmt.Errorf("failed to parse cached SSO token file, %v", err) - } - - if len(t.AccessToken) == 0 || t.ExpiresAt == nil || time.Time(*t.ExpiresAt).IsZero() { - return cachedToken{}, fmt.Errorf( - "cached SSO token must contain accessToken and expiresAt fields") - } - - return t, nil -} - -func storeCachedToken(filename string, t cachedToken, fileMode os.FileMode) (err error) { - tmpFilename := filename + ".tmp-" + strconv.FormatInt(nowTime().UnixNano(), 10) - if err := writeCacheFile(tmpFilename, fileMode, t); err != nil { - return err - } - - if err := os.Rename(tmpFilename, filename); err != nil { - return fmt.Errorf("failed to replace old cached SSO token file, %v", err) - } - - return nil -} - -func writeCacheFile(filename string, fileMode os.FileMode, t cachedToken) (err error) { - var f *os.File - f, err = os.OpenFile(filename, os.O_CREATE|os.O_TRUNC|os.O_RDWR, fileMode) - if err != nil { - return fmt.Errorf("failed to create cached SSO token file %v", err) - } - - defer func() { - closeErr := f.Close() - if err == nil && closeErr != nil { - err = fmt.Errorf("failed to close cached SSO token file, %v", closeErr) - } - }() - - encoder := json.NewEncoder(f) - - if err = encoder.Encode(t); err != nil { - return fmt.Errorf("failed to serialize cached SSO token, %v", err) - } - - return nil -} - -type rfc3339 time.Time - -// UnmarshalJSON decode rfc3339 from JSON format -func (r *rfc3339) UnmarshalJSON(bytes []byte) error { - var value string - var err error - - if err = json.Unmarshal(bytes, &value); err != nil { - return err - } - - *r, err = parseRFC3339(value) - return err -} - -func parseRFC3339(v string) (rfc3339, error) { - parsed, err := time.Parse(time.RFC3339, v) - if err != nil { - return rfc3339{}, fmt.Errorf("expected RFC3339 timestamp: %v", err) - } - - return rfc3339(parsed), nil -} - -// MarshalJSON encode rfc3339 to JSON format time -func (r *rfc3339) MarshalJSON() ([]byte, error) { - value := time.Time(*r).Format(time.RFC3339) - - // Use JSON unmarshal to unescape the quoted value making use of JSON's - // quoting rules. - return json.Marshal(value) -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/custom_cached_token.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/custom_cached_token.json deleted file mode 100644 index 4b83e28fdc92..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/custom_cached_token.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "accessToken": "ZhbHVldGhpcyBpcyBub3QgYSByZWFsIH", - "expiresAt": "2021-01-19T23:00:00Z" -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/expired_token.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/expired_token.json deleted file mode 100644 index 7e6486055717..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/expired_token.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "accessToken": "expired access token", - "expiresAt": "2021-12-21T12:21:00Z", - "clientId": "client id", - "clientSecret": "client secret", - "refreshToken": "refresh token", - "unknownField": "some value" -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/invalid_json.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/invalid_json.json deleted file mode 100644 index 98232c64fce9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/invalid_json.json +++ /dev/null @@ -1 +0,0 @@ -{ diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_accessToken.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_accessToken.json deleted file mode 100644 index dba6cace2ad3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_accessToken.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "clientId": "client id", - "clientSecret": "client secret", - "refreshToken": "refresh token", - "missing_accessToken": "access token", - "expiresAt": "2044-04-04T07:00:01Z" -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_clientId.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_clientId.json deleted file mode 100644 index 76dadfcfe42c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_clientId.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "missing_clientId": "client id", - "clientSecret": "client secret", - "refreshToken": "refresh token", - "accessToken": "access token", - "expiresAt": "2021-12-21T12:21:00Z" -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_clientSecret.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_clientSecret.json deleted file mode 100644 index aa28fc9f0464..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_clientSecret.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "clientId": "client id", - "missing_clientSecret": "client secret", - "refreshToken": "refresh token", - "accessToken": "access token", - "expiresAt": "2021-12-21T12:21:00Z" -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_expiresAt.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_expiresAt.json deleted file mode 100644 index cd5788912731..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_expiresAt.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "clientId": "client id", - "clientSecret": "client secret", - "refreshToken": "refresh token", - "accessToken": "access token", - "missing_expiresAt": "2044-04-04T07:00:01Z" -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_refreshToken.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_refreshToken.json deleted file mode 100644 index 9afcff7465d8..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/missing_refreshToken.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "clientId": "client id", - "clientSecret": "client secret", - "missing_refreshToken": "refresh token", - "accessToken": "access token", - "expiresAt": "2021-12-21T12:21:00Z" -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/valid_token.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/valid_token.json deleted file mode 100644 index 528d11c4f106..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/testdata/valid_token.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "accessToken": "dGhpcyBpcyBub3QgYSByZWFsIHZhbHVl", - "expiresAt": "2044-04-04T07:00:01Z", - - "refreshToken": "refresh token", - "clientId": "client id", - "clientSecret": "client secret", - - "unknownField": "some value", - "region": "region", - "registrationExpiresAt": "2044-04-04T07:00:01Z", - "startURL": "start URL" -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/token_provider.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/token_provider.go deleted file mode 100644 index 6f0aa70067dd..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/credentials/ssocreds/token_provider.go +++ /dev/null @@ -1,148 +0,0 @@ -package ssocreds - -import ( - "fmt" - "os" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/auth/bearer" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssooidc" -) - -// CreateTokenAPIClient provides the interface for the SSOTokenProvider's API -// client for calling CreateToken operation to refresh the SSO token. -type CreateTokenAPIClient interface { - CreateToken(input *ssooidc.CreateTokenInput) (*ssooidc.CreateTokenOutput, error) -} - -// SSOTokenProviderOptions provides the options for configuring the -// SSOTokenProvider. -type SSOTokenProviderOptions struct { - // Client that can be overridden - Client CreateTokenAPIClient - - // The path the file containing the cached SSO token will be read from. - // Initialized the NewSSOTokenProvider's cachedTokenFilepath parameter. - CachedTokenFilepath string -} - -// SSOTokenProvider provides a utility for refreshing SSO AccessTokens for -// Bearer Authentication. The SSOTokenProvider can only be used to refresh -// already cached SSO Tokens. This utility cannot perform the initial SSO -// create token. -// -// The initial SSO create token should be preformed with the AWS CLI before the -// Go application using the SSOTokenProvider will need to retrieve the SSO -// token. If the AWS CLI has not created the token cache file, this provider -// will return an error when attempting to retrieve the cached token. -// -// This provider will attempt to refresh the cached SSO token periodically if -// needed when RetrieveBearerToken is called. -// -// A utility such as the AWS CLI must be used to initially create the SSO -// session and cached token file. -// https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html -type SSOTokenProvider struct { - options SSOTokenProviderOptions -} - -// NewSSOTokenProvider returns an initialized SSOTokenProvider that will -// periodically refresh the SSO token cached stored in the cachedTokenFilepath. -// The cachedTokenFilepath file's content will be rewritten by the token -// provider when the token is refreshed. -// -// The client must be configured for the AWS region the SSO token was created for. -func NewSSOTokenProvider(client CreateTokenAPIClient, cachedTokenFilepath string, optFns ...func(o *SSOTokenProviderOptions)) *SSOTokenProvider { - options := SSOTokenProviderOptions{ - Client: client, - CachedTokenFilepath: cachedTokenFilepath, - } - for _, fn := range optFns { - fn(&options) - } - - provider := &SSOTokenProvider{ - options: options, - } - - return provider -} - -// RetrieveBearerToken returns the SSO token stored in the cachedTokenFilepath -// the SSOTokenProvider was created with. If the token has expired -// RetrieveBearerToken will attempt to refresh it. If the token cannot be -// refreshed or is not present an error will be returned. -// -// A utility such as the AWS CLI must be used to initially create the SSO -// session and cached token file. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html -func (p *SSOTokenProvider) RetrieveBearerToken(ctx aws.Context) (bearer.Token, error) { - cachedToken, err := loadCachedToken(p.options.CachedTokenFilepath) - if err != nil { - return bearer.Token{}, err - } - - if cachedToken.ExpiresAt != nil && nowTime().After(time.Time(*cachedToken.ExpiresAt)) { - cachedToken, err = p.refreshToken(cachedToken) - if err != nil { - return bearer.Token{}, fmt.Errorf("refresh cached SSO token failed, %v", err) - } - } - - expiresAt := toTime((*time.Time)(cachedToken.ExpiresAt)) - return bearer.Token{ - Value: cachedToken.AccessToken, - CanExpire: !expiresAt.IsZero(), - Expires: expiresAt, - }, nil -} - -func (p *SSOTokenProvider) refreshToken(token cachedToken) (cachedToken, error) { - if token.ClientSecret == "" || token.ClientID == "" || token.RefreshToken == "" { - return cachedToken{}, fmt.Errorf("cached SSO token is expired, or not present, and cannot be refreshed") - } - - createResult, err := p.options.Client.CreateToken(&ssooidc.CreateTokenInput{ - ClientId: &token.ClientID, - ClientSecret: &token.ClientSecret, - RefreshToken: &token.RefreshToken, - GrantType: aws.String("refresh_token"), - }) - if err != nil { - return cachedToken{}, fmt.Errorf("unable to refresh SSO token, %v", err) - } - if createResult.ExpiresIn == nil { - return cachedToken{}, fmt.Errorf("missing required field ExpiresIn") - } - if createResult.AccessToken == nil { - return cachedToken{}, fmt.Errorf("missing required field AccessToken") - } - if createResult.RefreshToken == nil { - return cachedToken{}, fmt.Errorf("missing required field RefreshToken") - } - - expiresAt := nowTime().Add(time.Duration(*createResult.ExpiresIn) * time.Second) - - token.AccessToken = *createResult.AccessToken - token.ExpiresAt = (*rfc3339)(&expiresAt) - token.RefreshToken = *createResult.RefreshToken - - fileInfo, err := os.Stat(p.options.CachedTokenFilepath) - if err != nil { - return cachedToken{}, fmt.Errorf("failed to stat cached SSO token file %v", err) - } - - if err = storeCachedToken(p.options.CachedTokenFilepath, token, fileInfo.Mode()); err != nil { - return cachedToken{}, fmt.Errorf("unable to cache refreshed SSO token, %v", err) - } - - return token, nil -} - -func toTime(p *time.Time) (v time.Time) { - if p == nil { - return v - } - - return *p -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/awstesting/sandbox/Dockerfile.test.go1.19 b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/awstesting/sandbox/Dockerfile.test.go1.19 deleted file mode 100644 index cb896f243f6e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/awstesting/sandbox/Dockerfile.test.go1.19 +++ /dev/null @@ -1,12 +0,0 @@ -FROM golang:1.19 - -ENV GOPROXY=direct - -ADD . /go/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go - -RUN apt-get update && apt-get install -y --no-install-recommends \ - vim \ - && rm -rf /var/list/apt/lists/* - -WORKDIR /go/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go -CMD ["make", "get-deps-verify", "unit"] diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/encoding/gzip/handler.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/encoding/gzip/handler.go deleted file mode 100644 index 0ed254cb8d0f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/encoding/gzip/handler.go +++ /dev/null @@ -1,59 +0,0 @@ -package gzip - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "strconv" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" -) - -// NewGzipRequestHandler provides a named request handler that compresses the -// request payload. Add this to enable GZIP compression for a client. -// -// Known to work with Amazon CloudWatch's PutMetricData operation. -// https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html -func NewGzipRequestHandler() request.NamedHandler { - return request.NamedHandler{ - Name: "GzipRequestHandler", - Fn: gzipRequestHandler, - } -} - -func gzipRequestHandler(req *request.Request) { - compressedBytes, err := compress(req.Body) - if err != nil { - req.Error = fmt.Errorf("failed to compress request payload, %v", err) - return - } - - req.HTTPRequest.Header.Set("Content-Encoding", "gzip") - req.HTTPRequest.Header.Set("Content-Length", strconv.Itoa(len(compressedBytes))) - - req.SetBufferBody(compressedBytes) -} - -func compress(input io.Reader) ([]byte, error) { - var b bytes.Buffer - w, err := gzip.NewWriterLevel(&b, gzip.BestCompression) - if err != nil { - return nil, fmt.Errorf("failed to create gzip writer, %v", err) - } - - inBytes, err := ioutil.ReadAll(input) - if err != nil { - return nil, fmt.Errorf("failed read payload to compress, %v", err) - } - - if _, err = w.Write(inBytes); err != nil { - return nil, fmt.Errorf("failed to write payload to be compressed, %v", err) - } - if err = w.Close(); err != nil { - return nil, fmt.Errorf("failed to flush payload being compressed, %v", err) - } - - return b.Bytes(), nil -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/shareddefaults/shared_config_resolve_home.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/shareddefaults/shared_config_resolve_home.go deleted file mode 100644 index eb298ae0fc1a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/shareddefaults/shared_config_resolve_home.go +++ /dev/null @@ -1,18 +0,0 @@ -//go:build !go1.12 -// +build !go1.12 - -package shareddefaults - -import ( - "os" - "runtime" -) - -func userHomeDir() string { - if runtime.GOOS == "windows" { // Windows - return os.Getenv("USERPROFILE") - } - - // *nix - return os.Getenv("HOME") -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/shareddefaults/shared_config_resolve_home_go1.12.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/shareddefaults/shared_config_resolve_home_go1.12.go deleted file mode 100644 index 51541b508766..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/shareddefaults/shared_config_resolve_home_go1.12.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build go1.12 -// +build go1.12 - -package shareddefaults - -import ( - "os" -) - -func userHomeDir() string { - home, _ := os.UserHomeDir() - return home -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/models/awsquerycompatible/api-2.json b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/models/awsquerycompatible/api-2.json deleted file mode 100644 index eaca1fb20bf5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/models/awsquerycompatible/api-2.json +++ /dev/null @@ -1,75 +0,0 @@ - - { - "version":"2.0", - "metadata":{ - "apiVersion":"2012-11-05", - "awsQueryCompatible": { - - }, - "endpointPrefix":"awsqc-exampleendpoint", - "jsonVersion":"1.1", - "protocol":"json", - "serviceAbbreviation":"AwsQueryCompatible", - "serviceFullName":"AWSQuery Compatible Service", - "serviceId":"AWSQueryCompatible", - "signatureVersion":"v4", - "uid":"awsquerycompatible-2012-11-05", - "xmlNamespace":"http://queue.amazonaws.com/doc/2012-11-05/" - }, - "operations":{ - "CreateQueue":{ - "name":"CreateQueue", - "http":{ - "method":"POST", - "requestUri":"/" - }, - "input":{"shape":"CreateQueueRequest"}, - "output":{ - "shape":"CreateQueueResult", - "resultWrapper":"CreateQueueResult" - }, - "errors":[ - {"shape":"QueueDeletedRecently"}, - {"shape":"QueueNameExists"} - ] - } - }, - "shapes":{ - "CreateQueueRequest":{ - "type":"structure", - "required":["QueueName"], - "members":{ - "QueueName":{"shape":"String"} - } - }, - "CreateQueueResult":{ - "type":"structure", - "members":{ - "QueueUrl":{"shape":"String"} - } - }, - "QueueDeletedRecently":{ - "type":"structure", - "members":{ - }, - "error":{ - "code":"AWS.SimpleQueueService.QueueDeletedRecently", - "httpStatusCode":400, - "senderFault":true - }, - "exception":true - }, - "QueueNameExists":{ - "type":"structure", - "members":{ - }, - "error":{ - "code":"QueueAlreadyExists", - "httpStatusCode":400, - "senderFault":true - }, - "exception":true - }, - "String":{"type":"string"} - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/api.go deleted file mode 100644 index 98a630b6b5ee..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/api.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package awsquerycompatible - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opCreateQueue = "CreateQueue" - -// CreateQueueRequest generates a "aws/request.Request" representing the -// client's request for the CreateQueue 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 CreateQueue for more information on using the CreateQueue -// 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 CreateQueueRequest method. -// req, resp := client.CreateQueueRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/awsquerycompatible-2012-11-05/CreateQueue -func (c *AwsQueryCompatible) CreateQueueRequest(input *CreateQueueInput) (req *request.Request, output *CreateQueueOutput) { - op := &request.Operation{ - Name: opCreateQueue, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateQueueInput{} - } - - output = &CreateQueueOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateQueue API operation for AWSQuery Compatible 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 AWSQuery Compatible Service's -// API operation CreateQueue for usage and error information. -// -// Returned Error Types: -// -// - QueueDeletedRecently -// -// - QueueNameExists -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/awsquerycompatible-2012-11-05/CreateQueue -func (c *AwsQueryCompatible) CreateQueue(input *CreateQueueInput) (*CreateQueueOutput, error) { - req, out := c.CreateQueueRequest(input) - return out, req.Send() -} - -// CreateQueueWithContext is the same as CreateQueue with the addition of -// the ability to pass a context and additional request options. -// -// See CreateQueue 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 *AwsQueryCompatible) CreateQueueWithContext(ctx aws.Context, input *CreateQueueInput, opts ...request.Option) (*CreateQueueOutput, error) { - req, out := c.CreateQueueRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CreateQueueInput struct { - _ struct{} `type:"structure"` - - // QueueName is a required field - QueueName *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 CreateQueueInput) 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 CreateQueueInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateQueueInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateQueueInput"} - if s.QueueName == nil { - invalidParams.Add(request.NewErrParamRequired("QueueName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueueName sets the QueueName field's value. -func (s *CreateQueueInput) SetQueueName(v string) *CreateQueueInput { - s.QueueName = &v - return s -} - -type CreateQueueOutput struct { - _ struct{} `type:"structure"` - - QueueUrl *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 CreateQueueOutput) 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 CreateQueueOutput) GoString() string { - return s.String() -} - -// SetQueueUrl sets the QueueUrl field's value. -func (s *CreateQueueOutput) SetQueueUrl(v string) *CreateQueueOutput { - s.QueueUrl = &v - return s -} - -type QueueDeletedRecently struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - Code_ *string - - Message_ *string `locationName:"message" 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 QueueDeletedRecently) 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 QueueDeletedRecently) GoString() string { - return s.String() -} - -func newErrorQueueDeletedRecently(v protocol.ResponseMetadata) error { - return &QueueDeletedRecently{ - RespMetadata: v, - } -} -func newQueryCompatibleErrorQueueDeletedRecently(v protocol.ResponseMetadata, code string) error { - return &QueueDeletedRecently{ - RespMetadata: v, - Code_: &code, - } -} - -// Code returns the exception type name. -func (s *QueueDeletedRecently) Code() string { - if s.Code_ != nil { - return *s.Code_ - } - return "QueueDeletedRecently" -} - -// Message returns the exception's message. -func (s *QueueDeletedRecently) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *QueueDeletedRecently) OrigErr() error { - return nil -} - -func (s *QueueDeletedRecently) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *QueueDeletedRecently) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *QueueDeletedRecently) RequestID() string { - return s.RespMetadata.RequestID -} - -type QueueNameExists struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - Code_ *string - - Message_ *string `locationName:"message" 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 QueueNameExists) 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 QueueNameExists) GoString() string { - return s.String() -} - -func newErrorQueueNameExists(v protocol.ResponseMetadata) error { - return &QueueNameExists{ - RespMetadata: v, - } -} -func newQueryCompatibleErrorQueueNameExists(v protocol.ResponseMetadata, code string) error { - return &QueueNameExists{ - RespMetadata: v, - Code_: &code, - } -} - -// Code returns the exception type name. -func (s *QueueNameExists) Code() string { - if s.Code_ != nil { - return *s.Code_ - } - return "QueueNameExists" -} - -// Message returns the exception's message. -func (s *QueueNameExists) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *QueueNameExists) OrigErr() error { - return nil -} - -func (s *QueueNameExists) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *QueueNameExists) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *QueueNameExists) RequestID() string { - return s.RespMetadata.RequestID -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/awsquerycompatibleiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/awsquerycompatibleiface/interface.go deleted file mode 100644 index b8a68393add1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/awsquerycompatibleiface/interface.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package awsquerycompatibleiface provides an interface to enable mocking the AWSQuery Compatible Service service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package awsquerycompatibleiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible" -) - -// AwsQueryCompatibleAPI provides an interface to enable mocking the -// awsquerycompatible.AwsQueryCompatible service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWSQuery Compatible Service. -// func myFunc(svc awsquerycompatibleiface.AwsQueryCompatibleAPI) bool { -// // Make svc.CreateQueue request -// } -// -// func main() { -// sess := session.New() -// svc := awsquerycompatible.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockAwsQueryCompatibleClient struct { -// awsquerycompatibleiface.AwsQueryCompatibleAPI -// } -// func (m *mockAwsQueryCompatibleClient) CreateQueue(input *awsquerycompatible.CreateQueueInput) (*awsquerycompatible.CreateQueueOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockAwsQueryCompatibleClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type AwsQueryCompatibleAPI interface { - CreateQueue(*awsquerycompatible.CreateQueueInput) (*awsquerycompatible.CreateQueueOutput, error) - CreateQueueWithContext(aws.Context, *awsquerycompatible.CreateQueueInput, ...request.Option) (*awsquerycompatible.CreateQueueOutput, error) - CreateQueueRequest(*awsquerycompatible.CreateQueueInput) (*request.Request, *awsquerycompatible.CreateQueueOutput) -} - -var _ AwsQueryCompatibleAPI = (*awsquerycompatible.AwsQueryCompatible)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/doc.go deleted file mode 100644 index e11ee0d5e62e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package awsquerycompatible provides the client and types for making API -// requests to AWSQuery Compatible Service. -// -// See https://docs.aws.amazon.com/goto/WebAPI/awsquerycompatible-2012-11-05 for more information on this service. -// -// See awsquerycompatible package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/awsquerycompatible/ -// -// # Using the Client -// -// To contact AWSQuery Compatible Service with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWSQuery Compatible Service client AwsQueryCompatible for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/awsquerycompatible/#New -package awsquerycompatible diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/errors.go deleted file mode 100644 index dc9fc50001c1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/errors.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package awsquerycompatible - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeQueueDeletedRecently for service response error code - // "QueueDeletedRecently". - ErrCodeQueueDeletedRecently = "QueueDeletedRecently" - - // ErrCodeQueueNameExists for service response error code - // "QueueNameExists". - ErrCodeQueueNameExists = "QueueNameExists" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "QueueDeletedRecently": newErrorQueueDeletedRecently, - "QueueNameExists": newErrorQueueNameExists, -} -var queryExceptionFromCode = map[string]func(protocol.ResponseMetadata, string) error{ - "QueueDeletedRecently": newQueryCompatibleErrorQueueDeletedRecently, - "QueueNameExists": newQueryCompatibleErrorQueueNameExists, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/service.go deleted file mode 100644 index 218f8d14ba48..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/codegentest/service/awsquerycompatible/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package awsquerycompatible - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// AwsQueryCompatible provides the API operation methods for making requests to -// AWSQuery Compatible Service. See this package's package overview docs -// for details on the service. -// -// AwsQueryCompatible methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type AwsQueryCompatible struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "AWSQueryCompatible" // Name of service. - EndpointsID = "awsqc-exampleendpoint" // ID to lookup a service endpoint with. - ServiceID = "AWSQueryCompatible" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the AwsQueryCompatible client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a AwsQueryCompatible client from just a session. -// svc := awsquerycompatible.New(mySession) -// -// // Create a AwsQueryCompatible client with additional configuration -// svc := awsquerycompatible.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *AwsQueryCompatible { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = EndpointsID - // No Fallback - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *AwsQueryCompatible { - svc := &AwsQueryCompatible{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2012-11-05", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.1", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedErrorWithOptions(exceptionFromCode, jsonrpc.WithQueryCompatibility(queryExceptionFromCode))).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a AwsQueryCompatible operation and runs any -// custom request initialization. -func (c *AwsQueryCompatible) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/legacy_struct_names.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/legacy_struct_names.go deleted file mode 100644 index a9c25c783dbb..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/model/api/legacy_struct_names.go +++ /dev/null @@ -1,312 +0,0 @@ -package api - -var legacyStructNames = map[string]string{ - "accessanalyzer": "Access Analyzer", - "account": "AWS Account", - "acm": "ACM", - "acm pca": "ACM-PCA", - "alexa for business": "Alexa For Business", - "amp": "Amazon Prometheus Service", - "amplify": "Amplify", - "amplifybackend": "AmplifyBackend", - "amplifyuibuilder": "AWS Amplify UI Builder", - "api gateway": "Amazon API Gateway", - "apigatewaymanagementapi": "AmazonApiGatewayManagementApi", - "apigatewayv2": "AmazonApiGatewayV2", - "app mesh": "AWS App Mesh", - "appconfig": "AppConfig", - "appconfigdata": "AWS AppConfig Data", - "appflow": "Amazon Appflow", - "appintegrations": "Amazon AppIntegrations Service", - "application auto scaling": "Application Auto Scaling", - "application discovery service": "AWS Application Discovery Service", - "application insights": "Application Insights", - "applicationcostprofiler": "AWS Application Cost Profiler", - "apprunner": "AWS App Runner", - "appstream": "Amazon AppStream", - "appsync": "AWSAppSync", - "athena": "Amazon Athena", - "auditmanager": "AWS Audit Manager", - "auto scaling": "Auto Scaling", - "auto scaling plans": "AWS Auto Scaling Plans", - "backup": "AWS Backup", - "backup gateway": "AWS Backup Gateway", - "batch": "AWS Batch", - "billingconductor": "AWSBillingConductor", - "braket": "Braket", - "budgets": "AWSBudgets", - "chime": "Amazon Chime", - "chime sdk identity": "Amazon Chime SDK Identity", - "chime sdk media pipelines": "Amazon Chime SDK Media Pipelines", - "chime sdk meetings": "Amazon Chime SDK Meetings", - "chime sdk messaging": "Amazon Chime SDK Messaging", - "cloud9": "AWS Cloud9", - "cloudcontrol": "CloudControlApi", - "clouddirectory": "Amazon CloudDirectory", - "cloudformation": "AWS CloudFormation", - "cloudfront": "CloudFront", - "cloudhsm": "CloudHSM", - "cloudhsm v2": "CloudHSM V2", - "cloudsearch": "Amazon CloudSearch", - "cloudsearch domain": "Amazon CloudSearch Domain", - "cloudtrail": "CloudTrail", - "cloudwatch": "CloudWatch", - "cloudwatch events": "Amazon CloudWatch Events", - "cloudwatch logs": "Amazon CloudWatch Logs", - "codeartifact": "CodeArtifact", - "codebuild": "AWS CodeBuild", - "codecommit": "CodeCommit", - "codedeploy": "CodeDeploy", - "codeguru reviewer": "CodeGuruReviewer", - "codeguruprofiler": "Amazon CodeGuru Profiler", - "codepipeline": "CodePipeline", - "codestar": "CodeStar", - "codestar connections": "AWS CodeStar connections", - "codestar notifications": "AWS CodeStar Notifications", - "cognito identity": "Amazon Cognito Identity", - "cognito identity provider": "Amazon Cognito Identity Provider", - "cognito sync": "Amazon Cognito Sync", - "comprehend": "Amazon Comprehend", - "comprehendmedical": "ComprehendMedical", - "compute optimizer": "AWS Compute Optimizer", - "config service": "Config Service", - "connect": "Amazon Connect", - "connect contact lens": "Amazon Connect Contact Lens", - "connectparticipant": "Amazon Connect Participant", - "cost and usage report service": "AWS Cost and Usage Report Service", - "cost explorer": "AWS Cost Explorer", - "customer profiles": "Customer Profiles", - "data pipeline": "AWS Data Pipeline", - "database migration service": "AWS Database Migration Service", - "databrew": "AWS Glue DataBrew", - "dataexchange": "AWS Data Exchange", - "datasync": "DataSync", - "dax": "Amazon DAX", - "detective": "Amazon Detective", - "device farm": "AWS Device Farm", - "devops guru": "Amazon DevOps Guru", - "direct connect": "AWS Direct Connect", - "directory service": "Directory Service", - "dlm": "Amazon DLM", - "docdb": "Amazon DocDB", - "drs": "drs", - "dynamodb": "DynamoDB", - "dynamodb streams": "Amazon DynamoDB Streams", - "ebs": "Amazon EBS", - "ec2": "Amazon EC2", - "ec2 instance connect": "EC2 Instance Connect", - "ecr": "Amazon ECR", - "ecr public": "Amazon ECR Public", - "ecs": "Amazon ECS", - "efs": "EFS", - "eks": "Amazon EKS", - "elastic beanstalk": "Elastic Beanstalk", - "elastic inference": "Amazon Elastic Inference", - "elastic load balancing": "Elastic Load Balancing", - "elastic load balancing v2": "Elastic Load Balancing v2", - "elastic transcoder": "Amazon Elastic Transcoder", - "elasticache": "Amazon ElastiCache", - "elasticsearch service": "Amazon Elasticsearch Service", - "emr": "Amazon EMR", - "emr containers": "Amazon EMR Containers", - "emr serverless": "EMR Serverless", - "eventbridge": "Amazon EventBridge", - "evidently": "Amazon CloudWatch Evidently", - "finspace": "finspace", - "finspace data": "FinSpace Data", - "firehose": "Firehose", - "fis": "FIS", - "fms": "FMS", - "forecast": "Amazon Forecast Service", - "forecastquery": "Amazon Forecast Query Service", - "frauddetector": "Amazon Fraud Detector", - "fsx": "Amazon FSx", - "gamelift": "Amazon GameLift", - "gamesparks": "GameSparks", - "glacier": "Amazon Glacier", - "global accelerator": "AWS Global Accelerator", - "glue": "AWS Glue", - "grafana": "Amazon Managed Grafana", - "greengrass": "AWS Greengrass", - "greengrassv2": "AWS GreengrassV2", - "groundstation": "AWS Ground Station", - "guardduty": "Amazon GuardDuty", - "health": "AWSHealth", - "healthlake": "HealthLake", - "honeycode": "Honeycode", - "iam": "IAM", - "identitystore": "IdentityStore", - "imagebuilder": "imagebuilder", - "import export": "AWS Import/Export", - "inspector": "Amazon Inspector", - "inspector2": "Inspector2", - "iot": "AWS IoT", - "iot 1click devices service": "AWS IoT 1-Click Devices Service", - "iot 1click projects": "AWS IoT 1-Click Projects", - "iot data plane": "AWS IoT Data Plane", - "iot events": "AWS IoT Events", - "iot events data": "AWS IoT Events Data", - "iot jobs data plane": "AWS IoT Jobs Data Plane", - "iot wireless": "AWS IoT Wireless", - "iotanalytics": "AWS IoT Analytics", - "iotdeviceadvisor": "AWSIoTDeviceAdvisor", - "iotfleethub": "AWS IoT Fleet Hub", - "iotsecuretunneling": "AWS IoT Secure Tunneling", - "iotsitewise": "AWS IoT SiteWise", - "iotthingsgraph": "AWS IoT Things Graph", - "iottwinmaker": "AWS IoT TwinMaker", - "ivs": "Amazon IVS", - "ivschat": "ivschat", - "kafka": "Kafka", - "kafkaconnect": "Kafka Connect", - "kendra": "kendra", - "keyspaces": "Amazon Keyspaces", - "kinesis": "Kinesis", - "kinesis analytics": "Kinesis Analytics", - "kinesis analytics v2": "Kinesis Analytics V2", - "kinesis video": "Kinesis Video", - "kinesis video archived media": "Kinesis Video Archived Media", - "kinesis video media": "Kinesis Video Media", - "kinesis video signaling": "Amazon Kinesis Video Signaling Channels", - "kms": "KMS", - "lakeformation": "AWS Lake Formation", - "lambda": "AWS Lambda", - "lex model building service": "Amazon Lex Model Building Service", - "lex models v2": "Lex Models V2", - "lex runtime service": "Amazon Lex Runtime Service", - "lex runtime v2": "Lex Runtime V2", - "license manager": "AWS License Manager", - "lightsail": "Amazon Lightsail", - "location": "Amazon Location Service", - "lookoutequipment": "LookoutEquipment", - "lookoutmetrics": "LookoutMetrics", - "lookoutvision": "Amazon Lookout for Vision", - "machine learning": "Amazon Machine Learning", - "macie": "Amazon Macie", - "macie2": "Amazon Macie 2", - "managedblockchain": "ManagedBlockchain", - "marketplace catalog": "AWS Marketplace Catalog", - "marketplace commerce analytics": "AWS Marketplace Commerce Analytics", - "marketplace entitlement service": "AWS Marketplace Entitlement Service", - "marketplace metering": "AWSMarketplace Metering", - "mediaconnect": "AWS MediaConnect", - "mediaconvert": "MediaConvert", - "medialive": "MediaLive", - "mediapackage": "MediaPackage", - "mediapackage vod": "MediaPackage Vod", - "mediastore": "MediaStore", - "mediastore data": "MediaStore Data", - "mediatailor": "MediaTailor", - "memorydb": "Amazon MemoryDB", - "mgn": "mgn", - "migration hub": "AWS Migration Hub", - "migration hub refactor spaces": "AWS Migration Hub Refactor Spaces", - "migrationhub config": "AWS Migration Hub Config", - "migrationhubstrategy": "Migration Hub Strategy Recommendations", - "mobile": "AWS Mobile", - "mobile analytics": "Amazon Mobile Analytics", - "mq": "AmazonMQ", - "mturk": "Amazon MTurk", - "mwaa": "AmazonMWAA", - "neptune": "Amazon Neptune", - "network firewall": "Network Firewall", - "networkmanager": "NetworkManager", - "nimble": "AmazonNimbleStudio", - "opensearch": "Amazon OpenSearch Service", - "opsworks": "AWS OpsWorks", - "opsworkscm": "OpsWorksCM", - "organizations": "Organizations", - "outposts": "Outposts", - "panorama": "Panorama", - "personalize": "Amazon Personalize", - "personalize events": "Amazon Personalize Events", - "personalize runtime": "Amazon Personalize Runtime", - "pi": "AWS PI", - "pinpoint": "Amazon Pinpoint", - "pinpoint email": "Pinpoint Email", - "pinpoint sms voice": "Pinpoint SMS Voice", - "pinpoint sms voice v2": "Amazon Pinpoint SMS Voice V2", - "polly": "Amazon Polly", - "pricing": "AWS Pricing", - "proton": "AWS Proton", - "qldb": "QLDB", - "qldb session": "QLDB Session", - "quicksight": "Amazon QuickSight", - "ram": "RAM", - "rbin": "Amazon Recycle Bin", - "rds": "Amazon RDS", - "rds data": "AWS RDS DataService", - "redshift": "Amazon Redshift", - "redshift data": "Redshift Data API Service", - "rekognition": "Amazon Rekognition", - "resiliencehub": "AWS Resilience Hub", - "resource groups": "Resource Groups", - "resource groups tagging api": "AWS Resource Groups Tagging API", - "robomaker": "RoboMaker", - "route 53": "Route 53", - "route 53 domains": "Amazon Route 53 Domains", - "route53 recovery cluster": "Route53 Recovery Cluster", - "route53 recovery control config": "AWS Route53 Recovery Control Config", - "route53 recovery readiness": "AWS Route53 Recovery Readiness", - "route53resolver": "Route53Resolver", - "rum": "CloudWatch RUM", - "s3": "Amazon S3", - "s3 control": "AWS S3 Control", - "s3outposts": "Amazon S3 Outposts", - "sagemaker": "SageMaker", - "sagemaker a2i runtime": "Amazon Augmented AI Runtime", - "sagemaker edge": "Amazon Sagemaker Edge Manager", - "sagemaker featurestore runtime": "Amazon SageMaker Feature Store Runtime", - "sagemaker runtime": "Amazon SageMaker Runtime", - "savingsplans": "AWSSavingsPlans", - "schemas": "Schemas", - "secrets manager": "AWS Secrets Manager", - "securityhub": "AWS SecurityHub", - "serverlessapplicationrepository": "AWSServerlessApplicationRepository", - "service catalog": "AWS Service Catalog", - "service catalog appregistry": "AppRegistry", - "service quotas": "Service Quotas", - "servicediscovery": "ServiceDiscovery", - "ses": "Amazon SES", - "sesv2": "Amazon SES V2", - "sfn": "AWS SFN", - "shield": "AWS Shield", - "signer": "signer", - "simpledb": "Amazon SimpleDB", - "sms": "SMS", - "snow device management": "AWS Snow Device Management", - "snowball": "Amazon Snowball", - "sns": "Amazon SNS", - "sqs": "Amazon SQS", - "ssm": "Amazon SSM", - "ssm contacts": "SSM Contacts", - "ssm incidents": "SSM Incidents", - "sso": "SSO", - "sso admin": "SSO Admin", - "sso oidc": "SSO OIDC", - "storage gateway": "AWS Storage Gateway", - "sts": "AWS STS", - "support": "AWS Support", - "swf": "Amazon SWF", - "synthetics": "Synthetics", - "textract": "Amazon Textract", - "timestream query": "Timestream Query", - "timestream write": "Timestream Write", - "transcribe": "Amazon Transcribe Service", - "transcribe streaming": "Amazon Transcribe Streaming Service", - "transfer": "AWS Transfer", - "translate": "Amazon Translate", - "voice id": "Amazon Voice ID", - "waf": "WAF", - "waf regional": "WAF Regional", - "wafv2": "WAFV2", - "wellarchitected": "Well-Architected", - "wisdom": "Amazon Connect Wisdom Service", - "workdocs": "Amazon WorkDocs", - "worklink": "WorkLink", - "workmail": "Amazon WorkMail", - "workmailmessageflow": "Amazon WorkMail Message Flow", - "workspaces": "Amazon WorkSpaces", - "workspaces web": "Amazon WorkSpaces Web", - "xray": "AWS X-Ray", -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/api.go deleted file mode 100644 index bb2eb4320a3d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/api.go +++ /dev/null @@ -1,8141 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package appfabric - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opBatchGetUserAccessTasks = "BatchGetUserAccessTasks" - -// BatchGetUserAccessTasksRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetUserAccessTasks 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 BatchGetUserAccessTasks for more information on using the BatchGetUserAccessTasks -// 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 BatchGetUserAccessTasksRequest method. -// req, resp := client.BatchGetUserAccessTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/BatchGetUserAccessTasks -func (c *AppFabric) BatchGetUserAccessTasksRequest(input *BatchGetUserAccessTasksInput) (req *request.Request, output *BatchGetUserAccessTasksOutput) { - op := &request.Operation{ - Name: opBatchGetUserAccessTasks, - HTTPMethod: "POST", - HTTPPath: "/useraccess/batchget", - } - - if input == nil { - input = &BatchGetUserAccessTasksInput{} - } - - output = &BatchGetUserAccessTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetUserAccessTasks API operation for AppFabric. -// -// Gets user access details in a batch request. -// -// This action polls data from the tasks that are kicked off by the StartUserAccessTasks -// action. -// -// 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 AppFabric's -// API operation BatchGetUserAccessTasks for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/BatchGetUserAccessTasks -func (c *AppFabric) BatchGetUserAccessTasks(input *BatchGetUserAccessTasksInput) (*BatchGetUserAccessTasksOutput, error) { - req, out := c.BatchGetUserAccessTasksRequest(input) - return out, req.Send() -} - -// BatchGetUserAccessTasksWithContext is the same as BatchGetUserAccessTasks with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetUserAccessTasks 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 *AppFabric) BatchGetUserAccessTasksWithContext(ctx aws.Context, input *BatchGetUserAccessTasksInput, opts ...request.Option) (*BatchGetUserAccessTasksOutput, error) { - req, out := c.BatchGetUserAccessTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opConnectAppAuthorization = "ConnectAppAuthorization" - -// ConnectAppAuthorizationRequest generates a "aws/request.Request" representing the -// client's request for the ConnectAppAuthorization 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 ConnectAppAuthorization for more information on using the ConnectAppAuthorization -// 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 ConnectAppAuthorizationRequest method. -// req, resp := client.ConnectAppAuthorizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ConnectAppAuthorization -func (c *AppFabric) ConnectAppAuthorizationRequest(input *ConnectAppAuthorizationInput) (req *request.Request, output *ConnectAppAuthorizationOutput) { - op := &request.Operation{ - Name: opConnectAppAuthorization, - HTTPMethod: "POST", - HTTPPath: "/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}/connect", - } - - if input == nil { - input = &ConnectAppAuthorizationInput{} - } - - output = &ConnectAppAuthorizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ConnectAppAuthorization API operation for AppFabric. -// -// Establishes a connection between Amazon Web Services AppFabric and an application, -// which allows AppFabric to call the APIs of the application. -// -// 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 AppFabric's -// API operation ConnectAppAuthorization for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ConnectAppAuthorization -func (c *AppFabric) ConnectAppAuthorization(input *ConnectAppAuthorizationInput) (*ConnectAppAuthorizationOutput, error) { - req, out := c.ConnectAppAuthorizationRequest(input) - return out, req.Send() -} - -// ConnectAppAuthorizationWithContext is the same as ConnectAppAuthorization with the addition of -// the ability to pass a context and additional request options. -// -// See ConnectAppAuthorization 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 *AppFabric) ConnectAppAuthorizationWithContext(ctx aws.Context, input *ConnectAppAuthorizationInput, opts ...request.Option) (*ConnectAppAuthorizationOutput, error) { - req, out := c.ConnectAppAuthorizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAppAuthorization = "CreateAppAuthorization" - -// CreateAppAuthorizationRequest generates a "aws/request.Request" representing the -// client's request for the CreateAppAuthorization 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 CreateAppAuthorization for more information on using the CreateAppAuthorization -// 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 CreateAppAuthorizationRequest method. -// req, resp := client.CreateAppAuthorizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/CreateAppAuthorization -func (c *AppFabric) CreateAppAuthorizationRequest(input *CreateAppAuthorizationInput) (req *request.Request, output *CreateAppAuthorizationOutput) { - op := &request.Operation{ - Name: opCreateAppAuthorization, - HTTPMethod: "POST", - HTTPPath: "/appbundles/{appBundleIdentifier}/appauthorizations", - } - - if input == nil { - input = &CreateAppAuthorizationInput{} - } - - output = &CreateAppAuthorizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAppAuthorization API operation for AppFabric. -// -// Creates an app authorization within an app bundle, which allows AppFabric -// to connect to an application. -// -// 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 AppFabric's -// API operation CreateAppAuthorization for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ConflictException -// The request has created a conflict. Check the request parameters and try -// again. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/CreateAppAuthorization -func (c *AppFabric) CreateAppAuthorization(input *CreateAppAuthorizationInput) (*CreateAppAuthorizationOutput, error) { - req, out := c.CreateAppAuthorizationRequest(input) - return out, req.Send() -} - -// CreateAppAuthorizationWithContext is the same as CreateAppAuthorization with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAppAuthorization 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 *AppFabric) CreateAppAuthorizationWithContext(ctx aws.Context, input *CreateAppAuthorizationInput, opts ...request.Option) (*CreateAppAuthorizationOutput, error) { - req, out := c.CreateAppAuthorizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAppBundle = "CreateAppBundle" - -// CreateAppBundleRequest generates a "aws/request.Request" representing the -// client's request for the CreateAppBundle 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 CreateAppBundle for more information on using the CreateAppBundle -// 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 CreateAppBundleRequest method. -// req, resp := client.CreateAppBundleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/CreateAppBundle -func (c *AppFabric) CreateAppBundleRequest(input *CreateAppBundleInput) (req *request.Request, output *CreateAppBundleOutput) { - op := &request.Operation{ - Name: opCreateAppBundle, - HTTPMethod: "POST", - HTTPPath: "/appbundles", - } - - if input == nil { - input = &CreateAppBundleInput{} - } - - output = &CreateAppBundleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAppBundle API operation for AppFabric. -// -// Creates an app bundle to collect data from an application using AppFabric. -// -// 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 AppFabric's -// API operation CreateAppBundle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ConflictException -// The request has created a conflict. Check the request parameters and try -// again. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/CreateAppBundle -func (c *AppFabric) CreateAppBundle(input *CreateAppBundleInput) (*CreateAppBundleOutput, error) { - req, out := c.CreateAppBundleRequest(input) - return out, req.Send() -} - -// CreateAppBundleWithContext is the same as CreateAppBundle with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAppBundle 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 *AppFabric) CreateAppBundleWithContext(ctx aws.Context, input *CreateAppBundleInput, opts ...request.Option) (*CreateAppBundleOutput, error) { - req, out := c.CreateAppBundleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateIngestion = "CreateIngestion" - -// CreateIngestionRequest generates a "aws/request.Request" representing the -// client's request for the CreateIngestion 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 CreateIngestion for more information on using the CreateIngestion -// 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 CreateIngestionRequest method. -// req, resp := client.CreateIngestionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/CreateIngestion -func (c *AppFabric) CreateIngestionRequest(input *CreateIngestionInput) (req *request.Request, output *CreateIngestionOutput) { - op := &request.Operation{ - Name: opCreateIngestion, - HTTPMethod: "POST", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions", - } - - if input == nil { - input = &CreateIngestionInput{} - } - - output = &CreateIngestionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateIngestion API operation for AppFabric. -// -// Creates a data ingestion for an application. -// -// 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 AppFabric's -// API operation CreateIngestion for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ConflictException -// The request has created a conflict. Check the request parameters and try -// again. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/CreateIngestion -func (c *AppFabric) CreateIngestion(input *CreateIngestionInput) (*CreateIngestionOutput, error) { - req, out := c.CreateIngestionRequest(input) - return out, req.Send() -} - -// CreateIngestionWithContext is the same as CreateIngestion with the addition of -// the ability to pass a context and additional request options. -// -// See CreateIngestion 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 *AppFabric) CreateIngestionWithContext(ctx aws.Context, input *CreateIngestionInput, opts ...request.Option) (*CreateIngestionOutput, error) { - req, out := c.CreateIngestionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateIngestionDestination = "CreateIngestionDestination" - -// CreateIngestionDestinationRequest generates a "aws/request.Request" representing the -// client's request for the CreateIngestionDestination 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 CreateIngestionDestination for more information on using the CreateIngestionDestination -// 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 CreateIngestionDestinationRequest method. -// req, resp := client.CreateIngestionDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/CreateIngestionDestination -func (c *AppFabric) CreateIngestionDestinationRequest(input *CreateIngestionDestinationInput) (req *request.Request, output *CreateIngestionDestinationOutput) { - op := &request.Operation{ - Name: opCreateIngestionDestination, - HTTPMethod: "POST", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations", - } - - if input == nil { - input = &CreateIngestionDestinationInput{} - } - - output = &CreateIngestionDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateIngestionDestination API operation for AppFabric. -// -// Creates an ingestion destination, which specifies how an application's ingested -// data is processed by Amazon Web Services AppFabric and where it's delivered. -// -// 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 AppFabric's -// API operation CreateIngestionDestination for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ConflictException -// The request has created a conflict. Check the request parameters and try -// again. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/CreateIngestionDestination -func (c *AppFabric) CreateIngestionDestination(input *CreateIngestionDestinationInput) (*CreateIngestionDestinationOutput, error) { - req, out := c.CreateIngestionDestinationRequest(input) - return out, req.Send() -} - -// CreateIngestionDestinationWithContext is the same as CreateIngestionDestination with the addition of -// the ability to pass a context and additional request options. -// -// See CreateIngestionDestination 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 *AppFabric) CreateIngestionDestinationWithContext(ctx aws.Context, input *CreateIngestionDestinationInput, opts ...request.Option) (*CreateIngestionDestinationOutput, error) { - req, out := c.CreateIngestionDestinationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAppAuthorization = "DeleteAppAuthorization" - -// DeleteAppAuthorizationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAppAuthorization 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 DeleteAppAuthorization for more information on using the DeleteAppAuthorization -// 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 DeleteAppAuthorizationRequest method. -// req, resp := client.DeleteAppAuthorizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/DeleteAppAuthorization -func (c *AppFabric) DeleteAppAuthorizationRequest(input *DeleteAppAuthorizationInput) (req *request.Request, output *DeleteAppAuthorizationOutput) { - op := &request.Operation{ - Name: opDeleteAppAuthorization, - HTTPMethod: "DELETE", - HTTPPath: "/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}", - } - - if input == nil { - input = &DeleteAppAuthorizationInput{} - } - - output = &DeleteAppAuthorizationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAppAuthorization API operation for AppFabric. -// -// Deletes an app authorization. You must delete the associated ingestion before -// you can delete an app authorization. -// -// 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 AppFabric's -// API operation DeleteAppAuthorization for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/DeleteAppAuthorization -func (c *AppFabric) DeleteAppAuthorization(input *DeleteAppAuthorizationInput) (*DeleteAppAuthorizationOutput, error) { - req, out := c.DeleteAppAuthorizationRequest(input) - return out, req.Send() -} - -// DeleteAppAuthorizationWithContext is the same as DeleteAppAuthorization with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAppAuthorization 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 *AppFabric) DeleteAppAuthorizationWithContext(ctx aws.Context, input *DeleteAppAuthorizationInput, opts ...request.Option) (*DeleteAppAuthorizationOutput, error) { - req, out := c.DeleteAppAuthorizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAppBundle = "DeleteAppBundle" - -// DeleteAppBundleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAppBundle 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 DeleteAppBundle for more information on using the DeleteAppBundle -// 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 DeleteAppBundleRequest method. -// req, resp := client.DeleteAppBundleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/DeleteAppBundle -func (c *AppFabric) DeleteAppBundleRequest(input *DeleteAppBundleInput) (req *request.Request, output *DeleteAppBundleOutput) { - op := &request.Operation{ - Name: opDeleteAppBundle, - HTTPMethod: "DELETE", - HTTPPath: "/appbundles/{appBundleIdentifier}", - } - - if input == nil { - input = &DeleteAppBundleInput{} - } - - output = &DeleteAppBundleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAppBundle API operation for AppFabric. -// -// Deletes an app bundle. You must delete all associated app authorizations -// before you can delete an app bundle. -// -// 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 AppFabric's -// API operation DeleteAppBundle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ConflictException -// The request has created a conflict. Check the request parameters and try -// again. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/DeleteAppBundle -func (c *AppFabric) DeleteAppBundle(input *DeleteAppBundleInput) (*DeleteAppBundleOutput, error) { - req, out := c.DeleteAppBundleRequest(input) - return out, req.Send() -} - -// DeleteAppBundleWithContext is the same as DeleteAppBundle with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAppBundle 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 *AppFabric) DeleteAppBundleWithContext(ctx aws.Context, input *DeleteAppBundleInput, opts ...request.Option) (*DeleteAppBundleOutput, error) { - req, out := c.DeleteAppBundleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteIngestion = "DeleteIngestion" - -// DeleteIngestionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIngestion 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 DeleteIngestion for more information on using the DeleteIngestion -// 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 DeleteIngestionRequest method. -// req, resp := client.DeleteIngestionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/DeleteIngestion -func (c *AppFabric) DeleteIngestionRequest(input *DeleteIngestionInput) (req *request.Request, output *DeleteIngestionOutput) { - op := &request.Operation{ - Name: opDeleteIngestion, - HTTPMethod: "DELETE", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}", - } - - if input == nil { - input = &DeleteIngestionInput{} - } - - output = &DeleteIngestionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteIngestion API operation for AppFabric. -// -// Deletes an ingestion. You must stop (disable) the ingestion and you must -// delete all associated ingestion destinations before you can delete an app -// ingestion. -// -// 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 AppFabric's -// API operation DeleteIngestion for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/DeleteIngestion -func (c *AppFabric) DeleteIngestion(input *DeleteIngestionInput) (*DeleteIngestionOutput, error) { - req, out := c.DeleteIngestionRequest(input) - return out, req.Send() -} - -// DeleteIngestionWithContext is the same as DeleteIngestion with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteIngestion 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 *AppFabric) DeleteIngestionWithContext(ctx aws.Context, input *DeleteIngestionInput, opts ...request.Option) (*DeleteIngestionOutput, error) { - req, out := c.DeleteIngestionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteIngestionDestination = "DeleteIngestionDestination" - -// DeleteIngestionDestinationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIngestionDestination 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 DeleteIngestionDestination for more information on using the DeleteIngestionDestination -// 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 DeleteIngestionDestinationRequest method. -// req, resp := client.DeleteIngestionDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/DeleteIngestionDestination -func (c *AppFabric) DeleteIngestionDestinationRequest(input *DeleteIngestionDestinationInput) (req *request.Request, output *DeleteIngestionDestinationOutput) { - op := &request.Operation{ - Name: opDeleteIngestionDestination, - HTTPMethod: "DELETE", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}", - } - - if input == nil { - input = &DeleteIngestionDestinationInput{} - } - - output = &DeleteIngestionDestinationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteIngestionDestination API operation for AppFabric. -// -// Deletes an ingestion destination. -// -// This deletes the association between an ingestion and it's destination. It -// doesn't delete previously ingested data or the storage destination, such -// as the Amazon S3 bucket where the data is delivered. If the ingestion destination -// is deleted while the associated ingestion is enabled, the ingestion will -// fail and is eventually disabled. -// -// 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 AppFabric's -// API operation DeleteIngestionDestination for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/DeleteIngestionDestination -func (c *AppFabric) DeleteIngestionDestination(input *DeleteIngestionDestinationInput) (*DeleteIngestionDestinationOutput, error) { - req, out := c.DeleteIngestionDestinationRequest(input) - return out, req.Send() -} - -// DeleteIngestionDestinationWithContext is the same as DeleteIngestionDestination with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteIngestionDestination 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 *AppFabric) DeleteIngestionDestinationWithContext(ctx aws.Context, input *DeleteIngestionDestinationInput, opts ...request.Option) (*DeleteIngestionDestinationOutput, error) { - req, out := c.DeleteIngestionDestinationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAppAuthorization = "GetAppAuthorization" - -// GetAppAuthorizationRequest generates a "aws/request.Request" representing the -// client's request for the GetAppAuthorization 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 GetAppAuthorization for more information on using the GetAppAuthorization -// 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 GetAppAuthorizationRequest method. -// req, resp := client.GetAppAuthorizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/GetAppAuthorization -func (c *AppFabric) GetAppAuthorizationRequest(input *GetAppAuthorizationInput) (req *request.Request, output *GetAppAuthorizationOutput) { - op := &request.Operation{ - Name: opGetAppAuthorization, - HTTPMethod: "GET", - HTTPPath: "/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}", - } - - if input == nil { - input = &GetAppAuthorizationInput{} - } - - output = &GetAppAuthorizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAppAuthorization API operation for AppFabric. -// -// Returns information about an app authorization. -// -// 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 AppFabric's -// API operation GetAppAuthorization for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/GetAppAuthorization -func (c *AppFabric) GetAppAuthorization(input *GetAppAuthorizationInput) (*GetAppAuthorizationOutput, error) { - req, out := c.GetAppAuthorizationRequest(input) - return out, req.Send() -} - -// GetAppAuthorizationWithContext is the same as GetAppAuthorization with the addition of -// the ability to pass a context and additional request options. -// -// See GetAppAuthorization 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 *AppFabric) GetAppAuthorizationWithContext(ctx aws.Context, input *GetAppAuthorizationInput, opts ...request.Option) (*GetAppAuthorizationOutput, error) { - req, out := c.GetAppAuthorizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAppBundle = "GetAppBundle" - -// GetAppBundleRequest generates a "aws/request.Request" representing the -// client's request for the GetAppBundle 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 GetAppBundle for more information on using the GetAppBundle -// 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 GetAppBundleRequest method. -// req, resp := client.GetAppBundleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/GetAppBundle -func (c *AppFabric) GetAppBundleRequest(input *GetAppBundleInput) (req *request.Request, output *GetAppBundleOutput) { - op := &request.Operation{ - Name: opGetAppBundle, - HTTPMethod: "GET", - HTTPPath: "/appbundles/{appBundleIdentifier}", - } - - if input == nil { - input = &GetAppBundleInput{} - } - - output = &GetAppBundleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAppBundle API operation for AppFabric. -// -// Returns information about an app bundle. -// -// 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 AppFabric's -// API operation GetAppBundle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/GetAppBundle -func (c *AppFabric) GetAppBundle(input *GetAppBundleInput) (*GetAppBundleOutput, error) { - req, out := c.GetAppBundleRequest(input) - return out, req.Send() -} - -// GetAppBundleWithContext is the same as GetAppBundle with the addition of -// the ability to pass a context and additional request options. -// -// See GetAppBundle 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 *AppFabric) GetAppBundleWithContext(ctx aws.Context, input *GetAppBundleInput, opts ...request.Option) (*GetAppBundleOutput, error) { - req, out := c.GetAppBundleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIngestion = "GetIngestion" - -// GetIngestionRequest generates a "aws/request.Request" representing the -// client's request for the GetIngestion 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 GetIngestion for more information on using the GetIngestion -// 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 GetIngestionRequest method. -// req, resp := client.GetIngestionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/GetIngestion -func (c *AppFabric) GetIngestionRequest(input *GetIngestionInput) (req *request.Request, output *GetIngestionOutput) { - op := &request.Operation{ - Name: opGetIngestion, - HTTPMethod: "GET", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}", - } - - if input == nil { - input = &GetIngestionInput{} - } - - output = &GetIngestionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIngestion API operation for AppFabric. -// -// Returns information about an ingestion. -// -// 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 AppFabric's -// API operation GetIngestion for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/GetIngestion -func (c *AppFabric) GetIngestion(input *GetIngestionInput) (*GetIngestionOutput, error) { - req, out := c.GetIngestionRequest(input) - return out, req.Send() -} - -// GetIngestionWithContext is the same as GetIngestion with the addition of -// the ability to pass a context and additional request options. -// -// See GetIngestion 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 *AppFabric) GetIngestionWithContext(ctx aws.Context, input *GetIngestionInput, opts ...request.Option) (*GetIngestionOutput, error) { - req, out := c.GetIngestionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIngestionDestination = "GetIngestionDestination" - -// GetIngestionDestinationRequest generates a "aws/request.Request" representing the -// client's request for the GetIngestionDestination 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 GetIngestionDestination for more information on using the GetIngestionDestination -// 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 GetIngestionDestinationRequest method. -// req, resp := client.GetIngestionDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/GetIngestionDestination -func (c *AppFabric) GetIngestionDestinationRequest(input *GetIngestionDestinationInput) (req *request.Request, output *GetIngestionDestinationOutput) { - op := &request.Operation{ - Name: opGetIngestionDestination, - HTTPMethod: "GET", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}", - } - - if input == nil { - input = &GetIngestionDestinationInput{} - } - - output = &GetIngestionDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIngestionDestination API operation for AppFabric. -// -// Returns information about an ingestion destination. -// -// 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 AppFabric's -// API operation GetIngestionDestination for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/GetIngestionDestination -func (c *AppFabric) GetIngestionDestination(input *GetIngestionDestinationInput) (*GetIngestionDestinationOutput, error) { - req, out := c.GetIngestionDestinationRequest(input) - return out, req.Send() -} - -// GetIngestionDestinationWithContext is the same as GetIngestionDestination with the addition of -// the ability to pass a context and additional request options. -// -// See GetIngestionDestination 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 *AppFabric) GetIngestionDestinationWithContext(ctx aws.Context, input *GetIngestionDestinationInput, opts ...request.Option) (*GetIngestionDestinationOutput, error) { - req, out := c.GetIngestionDestinationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAppAuthorizations = "ListAppAuthorizations" - -// ListAppAuthorizationsRequest generates a "aws/request.Request" representing the -// client's request for the ListAppAuthorizations 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 ListAppAuthorizations for more information on using the ListAppAuthorizations -// 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 ListAppAuthorizationsRequest method. -// req, resp := client.ListAppAuthorizationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListAppAuthorizations -func (c *AppFabric) ListAppAuthorizationsRequest(input *ListAppAuthorizationsInput) (req *request.Request, output *ListAppAuthorizationsOutput) { - op := &request.Operation{ - Name: opListAppAuthorizations, - HTTPMethod: "GET", - HTTPPath: "/appbundles/{appBundleIdentifier}/appauthorizations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAppAuthorizationsInput{} - } - - output = &ListAppAuthorizationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAppAuthorizations API operation for AppFabric. -// -// Returns a list of all app authorizations configured for an app bundle. -// -// 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 AppFabric's -// API operation ListAppAuthorizations for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListAppAuthorizations -func (c *AppFabric) ListAppAuthorizations(input *ListAppAuthorizationsInput) (*ListAppAuthorizationsOutput, error) { - req, out := c.ListAppAuthorizationsRequest(input) - return out, req.Send() -} - -// ListAppAuthorizationsWithContext is the same as ListAppAuthorizations with the addition of -// the ability to pass a context and additional request options. -// -// See ListAppAuthorizations 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 *AppFabric) ListAppAuthorizationsWithContext(ctx aws.Context, input *ListAppAuthorizationsInput, opts ...request.Option) (*ListAppAuthorizationsOutput, error) { - req, out := c.ListAppAuthorizationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAppAuthorizationsPages iterates over the pages of a ListAppAuthorizations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAppAuthorizations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAppAuthorizations operation. -// pageNum := 0 -// err := client.ListAppAuthorizationsPages(params, -// func(page *appfabric.ListAppAuthorizationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *AppFabric) ListAppAuthorizationsPages(input *ListAppAuthorizationsInput, fn func(*ListAppAuthorizationsOutput, bool) bool) error { - return c.ListAppAuthorizationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAppAuthorizationsPagesWithContext same as ListAppAuthorizationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *AppFabric) ListAppAuthorizationsPagesWithContext(ctx aws.Context, input *ListAppAuthorizationsInput, fn func(*ListAppAuthorizationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAppAuthorizationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAppAuthorizationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAppAuthorizationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAppBundles = "ListAppBundles" - -// ListAppBundlesRequest generates a "aws/request.Request" representing the -// client's request for the ListAppBundles 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 ListAppBundles for more information on using the ListAppBundles -// 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 ListAppBundlesRequest method. -// req, resp := client.ListAppBundlesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListAppBundles -func (c *AppFabric) ListAppBundlesRequest(input *ListAppBundlesInput) (req *request.Request, output *ListAppBundlesOutput) { - op := &request.Operation{ - Name: opListAppBundles, - HTTPMethod: "GET", - HTTPPath: "/appbundles", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAppBundlesInput{} - } - - output = &ListAppBundlesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAppBundles API operation for AppFabric. -// -// Returns a list of app bundles. -// -// 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 AppFabric's -// API operation ListAppBundles for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListAppBundles -func (c *AppFabric) ListAppBundles(input *ListAppBundlesInput) (*ListAppBundlesOutput, error) { - req, out := c.ListAppBundlesRequest(input) - return out, req.Send() -} - -// ListAppBundlesWithContext is the same as ListAppBundles with the addition of -// the ability to pass a context and additional request options. -// -// See ListAppBundles 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 *AppFabric) ListAppBundlesWithContext(ctx aws.Context, input *ListAppBundlesInput, opts ...request.Option) (*ListAppBundlesOutput, error) { - req, out := c.ListAppBundlesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAppBundlesPages iterates over the pages of a ListAppBundles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAppBundles method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAppBundles operation. -// pageNum := 0 -// err := client.ListAppBundlesPages(params, -// func(page *appfabric.ListAppBundlesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *AppFabric) ListAppBundlesPages(input *ListAppBundlesInput, fn func(*ListAppBundlesOutput, bool) bool) error { - return c.ListAppBundlesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAppBundlesPagesWithContext same as ListAppBundlesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *AppFabric) ListAppBundlesPagesWithContext(ctx aws.Context, input *ListAppBundlesInput, fn func(*ListAppBundlesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAppBundlesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAppBundlesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAppBundlesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListIngestionDestinations = "ListIngestionDestinations" - -// ListIngestionDestinationsRequest generates a "aws/request.Request" representing the -// client's request for the ListIngestionDestinations 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 ListIngestionDestinations for more information on using the ListIngestionDestinations -// 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 ListIngestionDestinationsRequest method. -// req, resp := client.ListIngestionDestinationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListIngestionDestinations -func (c *AppFabric) ListIngestionDestinationsRequest(input *ListIngestionDestinationsInput) (req *request.Request, output *ListIngestionDestinationsOutput) { - op := &request.Operation{ - Name: opListIngestionDestinations, - HTTPMethod: "GET", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIngestionDestinationsInput{} - } - - output = &ListIngestionDestinationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIngestionDestinations API operation for AppFabric. -// -// Returns a list of all ingestion destinations configured for an ingestion. -// -// 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 AppFabric's -// API operation ListIngestionDestinations for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListIngestionDestinations -func (c *AppFabric) ListIngestionDestinations(input *ListIngestionDestinationsInput) (*ListIngestionDestinationsOutput, error) { - req, out := c.ListIngestionDestinationsRequest(input) - return out, req.Send() -} - -// ListIngestionDestinationsWithContext is the same as ListIngestionDestinations with the addition of -// the ability to pass a context and additional request options. -// -// See ListIngestionDestinations 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 *AppFabric) ListIngestionDestinationsWithContext(ctx aws.Context, input *ListIngestionDestinationsInput, opts ...request.Option) (*ListIngestionDestinationsOutput, error) { - req, out := c.ListIngestionDestinationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIngestionDestinationsPages iterates over the pages of a ListIngestionDestinations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIngestionDestinations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIngestionDestinations operation. -// pageNum := 0 -// err := client.ListIngestionDestinationsPages(params, -// func(page *appfabric.ListIngestionDestinationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *AppFabric) ListIngestionDestinationsPages(input *ListIngestionDestinationsInput, fn func(*ListIngestionDestinationsOutput, bool) bool) error { - return c.ListIngestionDestinationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIngestionDestinationsPagesWithContext same as ListIngestionDestinationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *AppFabric) ListIngestionDestinationsPagesWithContext(ctx aws.Context, input *ListIngestionDestinationsInput, fn func(*ListIngestionDestinationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIngestionDestinationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIngestionDestinationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIngestionDestinationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListIngestions = "ListIngestions" - -// ListIngestionsRequest generates a "aws/request.Request" representing the -// client's request for the ListIngestions 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 ListIngestions for more information on using the ListIngestions -// 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 ListIngestionsRequest method. -// req, resp := client.ListIngestionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListIngestions -func (c *AppFabric) ListIngestionsRequest(input *ListIngestionsInput) (req *request.Request, output *ListIngestionsOutput) { - op := &request.Operation{ - Name: opListIngestions, - HTTPMethod: "GET", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIngestionsInput{} - } - - output = &ListIngestionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIngestions API operation for AppFabric. -// -// Returns a list of all ingestions configured for an app bundle. -// -// 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 AppFabric's -// API operation ListIngestions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListIngestions -func (c *AppFabric) ListIngestions(input *ListIngestionsInput) (*ListIngestionsOutput, error) { - req, out := c.ListIngestionsRequest(input) - return out, req.Send() -} - -// ListIngestionsWithContext is the same as ListIngestions with the addition of -// the ability to pass a context and additional request options. -// -// See ListIngestions 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 *AppFabric) ListIngestionsWithContext(ctx aws.Context, input *ListIngestionsInput, opts ...request.Option) (*ListIngestionsOutput, error) { - req, out := c.ListIngestionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIngestionsPages iterates over the pages of a ListIngestions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIngestions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIngestions operation. -// pageNum := 0 -// err := client.ListIngestionsPages(params, -// func(page *appfabric.ListIngestionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *AppFabric) ListIngestionsPages(input *ListIngestionsInput, fn func(*ListIngestionsOutput, bool) bool) error { - return c.ListIngestionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIngestionsPagesWithContext same as ListIngestionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *AppFabric) ListIngestionsPagesWithContext(ctx aws.Context, input *ListIngestionsInput, fn func(*ListIngestionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIngestionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIngestionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIngestionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListTagsForResource -func (c *AppFabric) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AppFabric. -// -// Returns a list of tags for a resource. -// -// 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 AppFabric's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/ListTagsForResource -func (c *AppFabric) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *AppFabric) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartIngestion = "StartIngestion" - -// StartIngestionRequest generates a "aws/request.Request" representing the -// client's request for the StartIngestion 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 StartIngestion for more information on using the StartIngestion -// 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 StartIngestionRequest method. -// req, resp := client.StartIngestionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/StartIngestion -func (c *AppFabric) StartIngestionRequest(input *StartIngestionInput) (req *request.Request, output *StartIngestionOutput) { - op := &request.Operation{ - Name: opStartIngestion, - HTTPMethod: "POST", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/start", - } - - if input == nil { - input = &StartIngestionInput{} - } - - output = &StartIngestionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartIngestion API operation for AppFabric. -// -// Starts (enables) an ingestion, which collects data from an application. -// -// 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 AppFabric's -// API operation StartIngestion for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ConflictException -// The request has created a conflict. Check the request parameters and try -// again. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/StartIngestion -func (c *AppFabric) StartIngestion(input *StartIngestionInput) (*StartIngestionOutput, error) { - req, out := c.StartIngestionRequest(input) - return out, req.Send() -} - -// StartIngestionWithContext is the same as StartIngestion with the addition of -// the ability to pass a context and additional request options. -// -// See StartIngestion 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 *AppFabric) StartIngestionWithContext(ctx aws.Context, input *StartIngestionInput, opts ...request.Option) (*StartIngestionOutput, error) { - req, out := c.StartIngestionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartUserAccessTasks = "StartUserAccessTasks" - -// StartUserAccessTasksRequest generates a "aws/request.Request" representing the -// client's request for the StartUserAccessTasks 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 StartUserAccessTasks for more information on using the StartUserAccessTasks -// 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 StartUserAccessTasksRequest method. -// req, resp := client.StartUserAccessTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/StartUserAccessTasks -func (c *AppFabric) StartUserAccessTasksRequest(input *StartUserAccessTasksInput) (req *request.Request, output *StartUserAccessTasksOutput) { - op := &request.Operation{ - Name: opStartUserAccessTasks, - HTTPMethod: "POST", - HTTPPath: "/useraccess/start", - } - - if input == nil { - input = &StartUserAccessTasksInput{} - } - - output = &StartUserAccessTasksOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartUserAccessTasks API operation for AppFabric. -// -// Starts the tasks to search user access status for a specific email address. -// -// The tasks are stopped when the user access status data is found. The tasks -// are terminated when the API calls to the application time out. -// -// 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 AppFabric's -// API operation StartUserAccessTasks for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/StartUserAccessTasks -func (c *AppFabric) StartUserAccessTasks(input *StartUserAccessTasksInput) (*StartUserAccessTasksOutput, error) { - req, out := c.StartUserAccessTasksRequest(input) - return out, req.Send() -} - -// StartUserAccessTasksWithContext is the same as StartUserAccessTasks with the addition of -// the ability to pass a context and additional request options. -// -// See StartUserAccessTasks 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 *AppFabric) StartUserAccessTasksWithContext(ctx aws.Context, input *StartUserAccessTasksInput, opts ...request.Option) (*StartUserAccessTasksOutput, error) { - req, out := c.StartUserAccessTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopIngestion = "StopIngestion" - -// StopIngestionRequest generates a "aws/request.Request" representing the -// client's request for the StopIngestion 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 StopIngestion for more information on using the StopIngestion -// 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 StopIngestionRequest method. -// req, resp := client.StopIngestionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/StopIngestion -func (c *AppFabric) StopIngestionRequest(input *StopIngestionInput) (req *request.Request, output *StopIngestionOutput) { - op := &request.Operation{ - Name: opStopIngestion, - HTTPMethod: "POST", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/stop", - } - - if input == nil { - input = &StopIngestionInput{} - } - - output = &StopIngestionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopIngestion API operation for AppFabric. -// -// Stops (disables) an ingestion. -// -// 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 AppFabric's -// API operation StopIngestion for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ConflictException -// The request has created a conflict. Check the request parameters and try -// again. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/StopIngestion -func (c *AppFabric) StopIngestion(input *StopIngestionInput) (*StopIngestionOutput, error) { - req, out := c.StopIngestionRequest(input) - return out, req.Send() -} - -// StopIngestionWithContext is the same as StopIngestion with the addition of -// the ability to pass a context and additional request options. -// -// See StopIngestion 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 *AppFabric) StopIngestionWithContext(ctx aws.Context, input *StopIngestionInput, opts ...request.Option) (*StopIngestionOutput, error) { - req, out := c.StopIngestionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/TagResource -func (c *AppFabric) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AppFabric. -// -// Assigns one or more tags (key-value pairs) to the specified resource. -// -// 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 AppFabric's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/TagResource -func (c *AppFabric) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *AppFabric) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/UntagResource -func (c *AppFabric) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AppFabric. -// -// Removes a tag or tags from a resource. -// -// 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 AppFabric's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/UntagResource -func (c *AppFabric) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *AppFabric) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAppAuthorization = "UpdateAppAuthorization" - -// UpdateAppAuthorizationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAppAuthorization 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 UpdateAppAuthorization for more information on using the UpdateAppAuthorization -// 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 UpdateAppAuthorizationRequest method. -// req, resp := client.UpdateAppAuthorizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/UpdateAppAuthorization -func (c *AppFabric) UpdateAppAuthorizationRequest(input *UpdateAppAuthorizationInput) (req *request.Request, output *UpdateAppAuthorizationOutput) { - op := &request.Operation{ - Name: opUpdateAppAuthorization, - HTTPMethod: "PATCH", - HTTPPath: "/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}", - } - - if input == nil { - input = &UpdateAppAuthorizationInput{} - } - - output = &UpdateAppAuthorizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAppAuthorization API operation for AppFabric. -// -// Updates an app authorization within an app bundle, which allows AppFabric -// to connect to an application. -// -// If the app authorization was in a connected state, updating the app authorization -// will set it back to a PendingConnect state. -// -// 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 AppFabric's -// API operation UpdateAppAuthorization for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/UpdateAppAuthorization -func (c *AppFabric) UpdateAppAuthorization(input *UpdateAppAuthorizationInput) (*UpdateAppAuthorizationOutput, error) { - req, out := c.UpdateAppAuthorizationRequest(input) - return out, req.Send() -} - -// UpdateAppAuthorizationWithContext is the same as UpdateAppAuthorization with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAppAuthorization 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 *AppFabric) UpdateAppAuthorizationWithContext(ctx aws.Context, input *UpdateAppAuthorizationInput, opts ...request.Option) (*UpdateAppAuthorizationOutput, error) { - req, out := c.UpdateAppAuthorizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateIngestionDestination = "UpdateIngestionDestination" - -// UpdateIngestionDestinationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIngestionDestination 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 UpdateIngestionDestination for more information on using the UpdateIngestionDestination -// 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 UpdateIngestionDestinationRequest method. -// req, resp := client.UpdateIngestionDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/UpdateIngestionDestination -func (c *AppFabric) UpdateIngestionDestinationRequest(input *UpdateIngestionDestinationInput) (req *request.Request, output *UpdateIngestionDestinationOutput) { - op := &request.Operation{ - Name: opUpdateIngestionDestination, - HTTPMethod: "PATCH", - HTTPPath: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}", - } - - if input == nil { - input = &UpdateIngestionDestinationInput{} - } - - output = &UpdateIngestionDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIngestionDestination API operation for AppFabric. -// -// Updates an ingestion destination, which specifies how an application's ingested -// data is processed by Amazon Web Services AppFabric and where it's delivered. -// -// 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 AppFabric's -// API operation UpdateIngestionDestination for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request rate exceeds the limit. -// -// - ConflictException -// The request has created a conflict. Check the request parameters and try -// again. -// -// - ValidationException -// The request has invalid or missing parameters. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// - AccessDeniedException -// You are not authorized to perform this operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19/UpdateIngestionDestination -func (c *AppFabric) UpdateIngestionDestination(input *UpdateIngestionDestinationInput) (*UpdateIngestionDestinationOutput, error) { - req, out := c.UpdateIngestionDestinationRequest(input) - return out, req.Send() -} - -// UpdateIngestionDestinationWithContext is the same as UpdateIngestionDestination with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateIngestionDestination 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 *AppFabric) UpdateIngestionDestinationWithContext(ctx aws.Context, input *UpdateIngestionDestinationInput, opts ...request.Option) (*UpdateIngestionDestinationOutput, error) { - req, out := c.UpdateIngestionDestinationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You are not authorized to perform this operation. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains API key credential information. -type ApiKeyCredential struct { - _ struct{} `type:"structure"` - - // An API key for an application. - // - // ApiKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ApiKeyCredential's - // String and GoString methods. - // - // ApiKey is a required field - ApiKey *string `locationName:"apiKey" min:"1" type:"string" required:"true" sensitive:"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 ApiKeyCredential) 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 ApiKeyCredential) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApiKeyCredential) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApiKeyCredential"} - if s.ApiKey == nil { - invalidParams.Add(request.NewErrParamRequired("ApiKey")) - } - if s.ApiKey != nil && len(*s.ApiKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApiKey", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApiKey sets the ApiKey field's value. -func (s *ApiKeyCredential) SetApiKey(v string) *ApiKeyCredential { - s.ApiKey = &v - return s -} - -// Contains information about an app authorization. -type AppAuthorization struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // App is a required field - App *string `locationName:"app" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the app authorization. - // - // AppAuthorizationArn is a required field - AppAuthorizationArn *string `locationName:"appAuthorizationArn" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the app bundle for the app authorization. - // - // AppBundleArn is a required field - AppBundleArn *string `locationName:"appBundleArn" min:"1" type:"string" required:"true"` - - // The authorization type. - // - // AuthType is a required field - AuthType *string `locationName:"authType" type:"string" required:"true" enum:"AuthType"` - - // The application URL for the OAuth flow. - AuthUrl *string `locationName:"authUrl" type:"string"` - - // The timestamp of when the app authorization was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The user persona of the app authorization. - // - // This field should always be admin. - Persona *string `locationName:"persona" type:"string" enum:"Persona"` - - // The state of the app authorization. - // - // The following states are possible: - // - // * PendingConnect: The initial state of the app authorization. The app - // authorization is created but not yet connected. - // - // * Connected: The app authorization is connected to the application, and - // is ready to be used. - // - // * ConnectionValidationFailed: The app authorization received a validation - // exception when trying to connect to the application. If the app authorization - // is in this state, you should verify the configured credentials and try - // to connect the app authorization again. - // - // * TokenAutoRotationFailed: AppFabric failed to refresh the access token. - // If the app authorization is in this state, you should try to reconnect - // the app authorization. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"AppAuthorizationStatus"` - - // Contains information about an application tenant, such as the application - // display name and identifier. - // - // Tenant is a required field - Tenant *Tenant `locationName:"tenant" type:"structure" required:"true"` - - // The timestamp of when the app authorization was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AppAuthorization) 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 AppAuthorization) GoString() string { - return s.String() -} - -// SetApp sets the App field's value. -func (s *AppAuthorization) SetApp(v string) *AppAuthorization { - s.App = &v - return s -} - -// SetAppAuthorizationArn sets the AppAuthorizationArn field's value. -func (s *AppAuthorization) SetAppAuthorizationArn(v string) *AppAuthorization { - s.AppAuthorizationArn = &v - return s -} - -// SetAppBundleArn sets the AppBundleArn field's value. -func (s *AppAuthorization) SetAppBundleArn(v string) *AppAuthorization { - s.AppBundleArn = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *AppAuthorization) SetAuthType(v string) *AppAuthorization { - s.AuthType = &v - return s -} - -// SetAuthUrl sets the AuthUrl field's value. -func (s *AppAuthorization) SetAuthUrl(v string) *AppAuthorization { - s.AuthUrl = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AppAuthorization) SetCreatedAt(v time.Time) *AppAuthorization { - s.CreatedAt = &v - return s -} - -// SetPersona sets the Persona field's value. -func (s *AppAuthorization) SetPersona(v string) *AppAuthorization { - s.Persona = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AppAuthorization) SetStatus(v string) *AppAuthorization { - s.Status = &v - return s -} - -// SetTenant sets the Tenant field's value. -func (s *AppAuthorization) SetTenant(v *Tenant) *AppAuthorization { - s.Tenant = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AppAuthorization) SetUpdatedAt(v time.Time) *AppAuthorization { - s.UpdatedAt = &v - return s -} - -// Contains a summary of an app authorization. -type AppAuthorizationSummary struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // App is a required field - App *string `locationName:"app" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the app authorization. - // - // AppAuthorizationArn is a required field - AppAuthorizationArn *string `locationName:"appAuthorizationArn" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the app bundle for the app authorization. - // - // AppBundleArn is a required field - AppBundleArn *string `locationName:"appBundleArn" min:"1" type:"string" required:"true"` - - // The state of the app authorization. - // - // The following states are possible: - // - // * PendingConnect: The initial state of the app authorization. The app - // authorization is created but not yet connected. - // - // * Connected: The app authorization is connected to the application, and - // is ready to be used. - // - // * ConnectionValidationFailed: The app authorization received a validation - // exception when trying to connect to the application. If the app authorization - // is in this state, you should verify the configured credentials and try - // to connect the app authorization again. - // - // * TokenAutoRotationFailed: AppFabric failed to refresh the access token. - // If the app authorization is in this state, you should try to reconnect - // the app authorization. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"AppAuthorizationStatus"` - - // Contains information about an application tenant, such as the application - // display name and identifier. - // - // Tenant is a required field - Tenant *Tenant `locationName:"tenant" type:"structure" required:"true"` - - // Timestamp for when the app authorization was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AppAuthorizationSummary) 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 AppAuthorizationSummary) GoString() string { - return s.String() -} - -// SetApp sets the App field's value. -func (s *AppAuthorizationSummary) SetApp(v string) *AppAuthorizationSummary { - s.App = &v - return s -} - -// SetAppAuthorizationArn sets the AppAuthorizationArn field's value. -func (s *AppAuthorizationSummary) SetAppAuthorizationArn(v string) *AppAuthorizationSummary { - s.AppAuthorizationArn = &v - return s -} - -// SetAppBundleArn sets the AppBundleArn field's value. -func (s *AppAuthorizationSummary) SetAppBundleArn(v string) *AppAuthorizationSummary { - s.AppBundleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AppAuthorizationSummary) SetStatus(v string) *AppAuthorizationSummary { - s.Status = &v - return s -} - -// SetTenant sets the Tenant field's value. -func (s *AppAuthorizationSummary) SetTenant(v *Tenant) *AppAuthorizationSummary { - s.Tenant = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AppAuthorizationSummary) SetUpdatedAt(v time.Time) *AppAuthorizationSummary { - s.UpdatedAt = &v - return s -} - -// Contains information about an app bundle. -type AppBundle struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the app bundle. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used - // to encrypt the application data. - CustomerManagedKeyArn *string `locationName:"customerManagedKeyArn" min:"1" 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 AppBundle) 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 AppBundle) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AppBundle) SetArn(v string) *AppBundle { - s.Arn = &v - return s -} - -// SetCustomerManagedKeyArn sets the CustomerManagedKeyArn field's value. -func (s *AppBundle) SetCustomerManagedKeyArn(v string) *AppBundle { - s.CustomerManagedKeyArn = &v - return s -} - -// Contains a summary of an app bundle. -type AppBundleSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the app bundle. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 AppBundleSummary) 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 AppBundleSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AppBundleSummary) SetArn(v string) *AppBundleSummary { - s.Arn = &v - return s -} - -// Contains information about an audit log destination configuration. -type AuditLogDestinationConfiguration struct { - _ struct{} `type:"structure"` - - // Contains information about an audit log destination. - // - // Destination is a required field - Destination *Destination `locationName:"destination" type:"structure" 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 AuditLogDestinationConfiguration) 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 AuditLogDestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuditLogDestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuditLogDestinationConfiguration"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.Destination != nil { - if err := s.Destination.Validate(); err != nil { - invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *AuditLogDestinationConfiguration) SetDestination(v *Destination) *AuditLogDestinationConfiguration { - s.Destination = v - return s -} - -// Contains information about an audit log processing configuration. -type AuditLogProcessingConfiguration struct { - _ struct{} `type:"structure"` - - // The format in which the audit logs need to be formatted. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true" enum:"Format"` - - // The event schema in which the audit logs need to be formatted. - // - // Schema is a required field - Schema *string `locationName:"schema" type:"string" required:"true" enum:"Schema"` -} - -// 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 AuditLogProcessingConfiguration) 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 AuditLogProcessingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuditLogProcessingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuditLogProcessingConfiguration"} - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.Schema == nil { - invalidParams.Add(request.NewErrParamRequired("Schema")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFormat sets the Format field's value. -func (s *AuditLogProcessingConfiguration) SetFormat(v string) *AuditLogProcessingConfiguration { - s.Format = &v - return s -} - -// SetSchema sets the Schema field's value. -func (s *AuditLogProcessingConfiguration) SetSchema(v string) *AuditLogProcessingConfiguration { - s.Schema = &v - return s -} - -// Contains authorization request information, which is required for Amazon -// Web Services AppFabric to get the OAuth2 access token for an application. -type AuthRequest struct { - _ struct{} `type:"structure"` - - // The authorization code returned by the application after permission is granted - // in the application OAuth page (after clicking on the AuthURL). - // - // Code is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AuthRequest's - // String and GoString methods. - // - // Code is a required field - Code *string `locationName:"code" min:"1" type:"string" required:"true" sensitive:"true"` - - // The redirect URL that is specified in the AuthURL and the application client. - // - // RedirectUri is a required field - RedirectUri *string `locationName:"redirectUri" 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 AuthRequest) 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 AuthRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuthRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthRequest"} - if s.Code == nil { - invalidParams.Add(request.NewErrParamRequired("Code")) - } - if s.Code != nil && len(*s.Code) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Code", 1)) - } - if s.RedirectUri == nil { - invalidParams.Add(request.NewErrParamRequired("RedirectUri")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCode sets the Code field's value. -func (s *AuthRequest) SetCode(v string) *AuthRequest { - s.Code = &v - return s -} - -// SetRedirectUri sets the RedirectUri field's value. -func (s *AuthRequest) SetRedirectUri(v string) *AuthRequest { - s.RedirectUri = &v - return s -} - -type BatchGetUserAccessTasksInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The tasks IDs to use for the request. - // - // TaskIdList is a required field - TaskIdList []*string `locationName:"taskIdList" min:"1" type:"list" 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 BatchGetUserAccessTasksInput) 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 BatchGetUserAccessTasksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetUserAccessTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetUserAccessTasksInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.TaskIdList == nil { - invalidParams.Add(request.NewErrParamRequired("TaskIdList")) - } - if s.TaskIdList != nil && len(s.TaskIdList) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskIdList", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *BatchGetUserAccessTasksInput) SetAppBundleIdentifier(v string) *BatchGetUserAccessTasksInput { - s.AppBundleIdentifier = &v - return s -} - -// SetTaskIdList sets the TaskIdList field's value. -func (s *BatchGetUserAccessTasksInput) SetTaskIdList(v []*string) *BatchGetUserAccessTasksInput { - s.TaskIdList = v - return s -} - -type BatchGetUserAccessTasksOutput struct { - _ struct{} `type:"structure"` - - // Contains a list of user access results. - UserAccessResultsList []*UserAccessResultItem `locationName:"userAccessResultsList" type:"list"` -} - -// 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 BatchGetUserAccessTasksOutput) 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 BatchGetUserAccessTasksOutput) GoString() string { - return s.String() -} - -// SetUserAccessResultsList sets the UserAccessResultsList field's value. -func (s *BatchGetUserAccessTasksOutput) SetUserAccessResultsList(v []*UserAccessResultItem) *BatchGetUserAccessTasksOutput { - s.UserAccessResultsList = v - return s -} - -// The request has created a conflict. Check the request parameters and try -// again. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The resource ID. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resource type. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ConnectAppAuthorizationInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app authorization to use for the request. - // - // AppAuthorizationIdentifier is a required field - AppAuthorizationIdentifier *string `location:"uri" locationName:"appAuthorizationIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle that contains the app authorization to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // Contains OAuth2 authorization information. - // - // This is required if the app authorization for the request is configured with - // an OAuth2 (oauth2) authorization type. - AuthRequest *AuthRequest `locationName:"authRequest" 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 ConnectAppAuthorizationInput) 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 ConnectAppAuthorizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConnectAppAuthorizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConnectAppAuthorizationInput"} - if s.AppAuthorizationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppAuthorizationIdentifier")) - } - if s.AppAuthorizationIdentifier != nil && len(*s.AppAuthorizationIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppAuthorizationIdentifier", 1)) - } - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.AuthRequest != nil { - if err := s.AuthRequest.Validate(); err != nil { - invalidParams.AddNested("AuthRequest", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppAuthorizationIdentifier sets the AppAuthorizationIdentifier field's value. -func (s *ConnectAppAuthorizationInput) SetAppAuthorizationIdentifier(v string) *ConnectAppAuthorizationInput { - s.AppAuthorizationIdentifier = &v - return s -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *ConnectAppAuthorizationInput) SetAppBundleIdentifier(v string) *ConnectAppAuthorizationInput { - s.AppBundleIdentifier = &v - return s -} - -// SetAuthRequest sets the AuthRequest field's value. -func (s *ConnectAppAuthorizationInput) SetAuthRequest(v *AuthRequest) *ConnectAppAuthorizationInput { - s.AuthRequest = v - return s -} - -type ConnectAppAuthorizationOutput struct { - _ struct{} `type:"structure"` - - // Contains a summary of the app authorization. - // - // AppAuthorizationSummary is a required field - AppAuthorizationSummary *AppAuthorizationSummary `locationName:"appAuthorizationSummary" type:"structure" 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 ConnectAppAuthorizationOutput) 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 ConnectAppAuthorizationOutput) GoString() string { - return s.String() -} - -// SetAppAuthorizationSummary sets the AppAuthorizationSummary field's value. -func (s *ConnectAppAuthorizationOutput) SetAppAuthorizationSummary(v *AppAuthorizationSummary) *ConnectAppAuthorizationOutput { - s.AppAuthorizationSummary = v - return s -} - -type CreateAppAuthorizationInput struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // Valid values are: - // - // * SLACK - // - // * ASANA - // - // * JIRA - // - // * M365 - // - // * M365AUDITLOGS - // - // * ZOOM - // - // * ZENDESK - // - // * OKTA - // - // * GOOGLE - // - // * DROPBOX - // - // * SMARTSHEET - // - // * CISCO - // - // App is a required field - App *string `locationName:"app" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The authorization type for the app authorization. - // - // AuthType is a required field - AuthType *string `locationName:"authType" type:"string" required:"true" enum:"AuthType"` - - // Specifies a unique, case-sensitive identifier that you provide to ensure - // the idempotency of the request. This lets you safely retry the request without - // accidentally performing the same operation a second time. Passing the same - // value to a later call to an operation requires that you also pass the same - // value for all other parameters. We recommend that you use a UUID type of - // value (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // Contains credentials for the application, such as an API key or OAuth2 client - // ID and secret. - // - // Specify credentials that match the authorization type for your request. For - // example, if the authorization type for your request is OAuth2 (oauth2), then - // you should provide only the OAuth2 credentials. - // - // Credential is a required field - Credential *Credential `locationName:"credential" type:"structure" required:"true"` - - // A map of the key-value pairs of the tag or tags to assign to the resource. - Tags []*Tag `locationName:"tags" type:"list"` - - // Contains information about an application tenant, such as the application - // display name and identifier. - // - // Tenant is a required field - Tenant *Tenant `locationName:"tenant" type:"structure" 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 CreateAppAuthorizationInput) 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 CreateAppAuthorizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAppAuthorizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAppAuthorizationInput"} - if s.App == nil { - invalidParams.Add(request.NewErrParamRequired("App")) - } - if s.App != nil && len(*s.App) < 1 { - invalidParams.Add(request.NewErrParamMinLen("App", 1)) - } - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.AuthType == nil { - invalidParams.Add(request.NewErrParamRequired("AuthType")) - } - if s.Credential == nil { - invalidParams.Add(request.NewErrParamRequired("Credential")) - } - if s.Tenant == nil { - invalidParams.Add(request.NewErrParamRequired("Tenant")) - } - if s.Credential != nil { - if err := s.Credential.Validate(); err != nil { - invalidParams.AddNested("Credential", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tenant != nil { - if err := s.Tenant.Validate(); err != nil { - invalidParams.AddNested("Tenant", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApp sets the App field's value. -func (s *CreateAppAuthorizationInput) SetApp(v string) *CreateAppAuthorizationInput { - s.App = &v - return s -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *CreateAppAuthorizationInput) SetAppBundleIdentifier(v string) *CreateAppAuthorizationInput { - s.AppBundleIdentifier = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *CreateAppAuthorizationInput) SetAuthType(v string) *CreateAppAuthorizationInput { - s.AuthType = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAppAuthorizationInput) SetClientToken(v string) *CreateAppAuthorizationInput { - s.ClientToken = &v - return s -} - -// SetCredential sets the Credential field's value. -func (s *CreateAppAuthorizationInput) SetCredential(v *Credential) *CreateAppAuthorizationInput { - s.Credential = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAppAuthorizationInput) SetTags(v []*Tag) *CreateAppAuthorizationInput { - s.Tags = v - return s -} - -// SetTenant sets the Tenant field's value. -func (s *CreateAppAuthorizationInput) SetTenant(v *Tenant) *CreateAppAuthorizationInput { - s.Tenant = v - return s -} - -type CreateAppAuthorizationOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an app authorization. - // - // AppAuthorization is a required field - AppAuthorization *AppAuthorization `locationName:"appAuthorization" type:"structure" 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 CreateAppAuthorizationOutput) 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 CreateAppAuthorizationOutput) GoString() string { - return s.String() -} - -// SetAppAuthorization sets the AppAuthorization field's value. -func (s *CreateAppAuthorizationOutput) SetAppAuthorization(v *AppAuthorization) *CreateAppAuthorizationOutput { - s.AppAuthorization = v - return s -} - -type CreateAppBundleInput struct { - _ struct{} `type:"structure"` - - // Specifies a unique, case-sensitive identifier that you provide to ensure - // the idempotency of the request. This lets you safely retry the request without - // accidentally performing the same operation a second time. Passing the same - // value to a later call to an operation requires that you also pass the same - // value for all other parameters. We recommend that you use a UUID type of - // value (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) of the Key Management Service (KMS) key to - // use to encrypt the application data. If this is not specified, an Amazon - // Web Services owned key is used for encryption. - CustomerManagedKeyIdentifier *string `locationName:"customerManagedKeyIdentifier" min:"1" type:"string"` - - // A map of the key-value pairs of the tag or tags to assign to the resource. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateAppBundleInput) 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 CreateAppBundleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAppBundleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAppBundleInput"} - if s.CustomerManagedKeyIdentifier != nil && len(*s.CustomerManagedKeyIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomerManagedKeyIdentifier", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAppBundleInput) SetClientToken(v string) *CreateAppBundleInput { - s.ClientToken = &v - return s -} - -// SetCustomerManagedKeyIdentifier sets the CustomerManagedKeyIdentifier field's value. -func (s *CreateAppBundleInput) SetCustomerManagedKeyIdentifier(v string) *CreateAppBundleInput { - s.CustomerManagedKeyIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAppBundleInput) SetTags(v []*Tag) *CreateAppBundleInput { - s.Tags = v - return s -} - -type CreateAppBundleOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an app bundle. - // - // AppBundle is a required field - AppBundle *AppBundle `locationName:"appBundle" type:"structure" 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 CreateAppBundleOutput) 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 CreateAppBundleOutput) GoString() string { - return s.String() -} - -// SetAppBundle sets the AppBundle field's value. -func (s *CreateAppBundleOutput) SetAppBundle(v *AppBundle) *CreateAppBundleOutput { - s.AppBundle = v - return s -} - -type CreateIngestionDestinationInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // Specifies a unique, case-sensitive identifier that you provide to ensure - // the idempotency of the request. This lets you safely retry the request without - // accidentally performing the same operation a second time. Passing the same - // value to a later call to an operation requires that you also pass the same - // value for all other parameters. We recommend that you use a UUID type of - // value (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // Contains information about the destination of ingested data. - // - // DestinationConfiguration is a required field - DestinationConfiguration *DestinationConfiguration `locationName:"destinationConfiguration" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" type:"string" required:"true"` - - // Contains information about how ingested data is processed. - // - // ProcessingConfiguration is a required field - ProcessingConfiguration *ProcessingConfiguration `locationName:"processingConfiguration" type:"structure" required:"true"` - - // A map of the key-value pairs of the tag or tags to assign to the resource. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateIngestionDestinationInput) 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 CreateIngestionDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateIngestionDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateIngestionDestinationInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.DestinationConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationConfiguration")) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - if s.ProcessingConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("ProcessingConfiguration")) - } - if s.DestinationConfiguration != nil { - if err := s.DestinationConfiguration.Validate(); err != nil { - invalidParams.AddNested("DestinationConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ProcessingConfiguration != nil { - if err := s.ProcessingConfiguration.Validate(); err != nil { - invalidParams.AddNested("ProcessingConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *CreateIngestionDestinationInput) SetAppBundleIdentifier(v string) *CreateIngestionDestinationInput { - s.AppBundleIdentifier = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateIngestionDestinationInput) SetClientToken(v string) *CreateIngestionDestinationInput { - s.ClientToken = &v - return s -} - -// SetDestinationConfiguration sets the DestinationConfiguration field's value. -func (s *CreateIngestionDestinationInput) SetDestinationConfiguration(v *DestinationConfiguration) *CreateIngestionDestinationInput { - s.DestinationConfiguration = v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *CreateIngestionDestinationInput) SetIngestionIdentifier(v string) *CreateIngestionDestinationInput { - s.IngestionIdentifier = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *CreateIngestionDestinationInput) SetProcessingConfiguration(v *ProcessingConfiguration) *CreateIngestionDestinationInput { - s.ProcessingConfiguration = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateIngestionDestinationInput) SetTags(v []*Tag) *CreateIngestionDestinationInput { - s.Tags = v - return s -} - -type CreateIngestionDestinationOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an ingestion destination. - // - // IngestionDestination is a required field - IngestionDestination *IngestionDestination `locationName:"ingestionDestination" type:"structure" 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 CreateIngestionDestinationOutput) 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 CreateIngestionDestinationOutput) GoString() string { - return s.String() -} - -// SetIngestionDestination sets the IngestionDestination field's value. -func (s *CreateIngestionDestinationOutput) SetIngestionDestination(v *IngestionDestination) *CreateIngestionDestinationOutput { - s.IngestionDestination = v - return s -} - -type CreateIngestionInput struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // Valid values are: - // - // * SLACK - // - // * ASANA - // - // * JIRA - // - // * M365 - // - // * M365AUDITLOGS - // - // * ZOOM - // - // * ZENDESK - // - // * OKTA - // - // * GOOGLE - // - // * DROPBOX - // - // * SMARTSHEET - // - // * CISCO - // - // App is a required field - App *string `locationName:"app" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // Specifies a unique, case-sensitive identifier that you provide to ensure - // the idempotency of the request. This lets you safely retry the request without - // accidentally performing the same operation a second time. Passing the same - // value to a later call to an operation requires that you also pass the same - // value for all other parameters. We recommend that you use a UUID type of - // value (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The ingestion type. - // - // IngestionType is a required field - IngestionType *string `locationName:"ingestionType" type:"string" required:"true" enum:"IngestionType"` - - // A map of the key-value pairs of the tag or tags to assign to the resource. - Tags []*Tag `locationName:"tags" type:"list"` - - // The ID of the application tenant. - // - // TenantId is a required field - TenantId *string `locationName:"tenantId" min:"1" 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 CreateIngestionInput) 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 CreateIngestionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateIngestionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateIngestionInput"} - if s.App == nil { - invalidParams.Add(request.NewErrParamRequired("App")) - } - if s.App != nil && len(*s.App) < 1 { - invalidParams.Add(request.NewErrParamMinLen("App", 1)) - } - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.IngestionType == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionType")) - } - if s.TenantId == nil { - invalidParams.Add(request.NewErrParamRequired("TenantId")) - } - if s.TenantId != nil && len(*s.TenantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TenantId", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApp sets the App field's value. -func (s *CreateIngestionInput) SetApp(v string) *CreateIngestionInput { - s.App = &v - return s -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *CreateIngestionInput) SetAppBundleIdentifier(v string) *CreateIngestionInput { - s.AppBundleIdentifier = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateIngestionInput) SetClientToken(v string) *CreateIngestionInput { - s.ClientToken = &v - return s -} - -// SetIngestionType sets the IngestionType field's value. -func (s *CreateIngestionInput) SetIngestionType(v string) *CreateIngestionInput { - s.IngestionType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateIngestionInput) SetTags(v []*Tag) *CreateIngestionInput { - s.Tags = v - return s -} - -// SetTenantId sets the TenantId field's value. -func (s *CreateIngestionInput) SetTenantId(v string) *CreateIngestionInput { - s.TenantId = &v - return s -} - -type CreateIngestionOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an ingestion. - // - // Ingestion is a required field - Ingestion *Ingestion `locationName:"ingestion" type:"structure" 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 CreateIngestionOutput) 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 CreateIngestionOutput) GoString() string { - return s.String() -} - -// SetIngestion sets the Ingestion field's value. -func (s *CreateIngestionOutput) SetIngestion(v *Ingestion) *CreateIngestionOutput { - s.Ingestion = v - return s -} - -// Contains credential information for an application. -type Credential struct { - _ struct{} `type:"structure"` - - // Contains API key credential information. - ApiKeyCredential *ApiKeyCredential `locationName:"apiKeyCredential" type:"structure"` - - // Contains OAuth2 client credential information. - Oauth2Credential *Oauth2Credential `locationName:"oauth2Credential" 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 Credential) 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 Credential) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Credential) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Credential"} - if s.ApiKeyCredential != nil { - if err := s.ApiKeyCredential.Validate(); err != nil { - invalidParams.AddNested("ApiKeyCredential", err.(request.ErrInvalidParams)) - } - } - if s.Oauth2Credential != nil { - if err := s.Oauth2Credential.Validate(); err != nil { - invalidParams.AddNested("Oauth2Credential", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApiKeyCredential sets the ApiKeyCredential field's value. -func (s *Credential) SetApiKeyCredential(v *ApiKeyCredential) *Credential { - s.ApiKeyCredential = v - return s -} - -// SetOauth2Credential sets the Oauth2Credential field's value. -func (s *Credential) SetOauth2Credential(v *Oauth2Credential) *Credential { - s.Oauth2Credential = v - return s -} - -type DeleteAppAuthorizationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app authorization to use for the request. - // - // AppAuthorizationIdentifier is a required field - AppAuthorizationIdentifier *string `location:"uri" locationName:"appAuthorizationIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" 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 DeleteAppAuthorizationInput) 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 DeleteAppAuthorizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAppAuthorizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAppAuthorizationInput"} - if s.AppAuthorizationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppAuthorizationIdentifier")) - } - if s.AppAuthorizationIdentifier != nil && len(*s.AppAuthorizationIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppAuthorizationIdentifier", 1)) - } - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppAuthorizationIdentifier sets the AppAuthorizationIdentifier field's value. -func (s *DeleteAppAuthorizationInput) SetAppAuthorizationIdentifier(v string) *DeleteAppAuthorizationInput { - s.AppAuthorizationIdentifier = &v - return s -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *DeleteAppAuthorizationInput) SetAppBundleIdentifier(v string) *DeleteAppAuthorizationInput { - s.AppBundleIdentifier = &v - return s -} - -type DeleteAppAuthorizationOutput 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 DeleteAppAuthorizationOutput) 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 DeleteAppAuthorizationOutput) GoString() string { - return s.String() -} - -type DeleteAppBundleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the app bundle that needs to be deleted. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" 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 DeleteAppBundleInput) 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 DeleteAppBundleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAppBundleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAppBundleInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *DeleteAppBundleInput) SetAppBundleIdentifier(v string) *DeleteAppBundleInput { - s.AppBundleIdentifier = &v - return s -} - -type DeleteAppBundleOutput 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 DeleteAppBundleOutput) 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 DeleteAppBundleOutput) GoString() string { - return s.String() -} - -type DeleteIngestionDestinationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion destination to use for the request. - // - // IngestionDestinationIdentifier is a required field - IngestionDestinationIdentifier *string `location:"uri" locationName:"ingestionDestinationIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" 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 DeleteIngestionDestinationInput) 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 DeleteIngestionDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIngestionDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIngestionDestinationInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.IngestionDestinationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionDestinationIdentifier")) - } - if s.IngestionDestinationIdentifier != nil && len(*s.IngestionDestinationIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionDestinationIdentifier", 1)) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *DeleteIngestionDestinationInput) SetAppBundleIdentifier(v string) *DeleteIngestionDestinationInput { - s.AppBundleIdentifier = &v - return s -} - -// SetIngestionDestinationIdentifier sets the IngestionDestinationIdentifier field's value. -func (s *DeleteIngestionDestinationInput) SetIngestionDestinationIdentifier(v string) *DeleteIngestionDestinationInput { - s.IngestionDestinationIdentifier = &v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *DeleteIngestionDestinationInput) SetIngestionIdentifier(v string) *DeleteIngestionDestinationInput { - s.IngestionIdentifier = &v - return s -} - -type DeleteIngestionDestinationOutput 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 DeleteIngestionDestinationOutput) 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 DeleteIngestionDestinationOutput) GoString() string { - return s.String() -} - -type DeleteIngestionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" 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 DeleteIngestionInput) 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 DeleteIngestionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIngestionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIngestionInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *DeleteIngestionInput) SetAppBundleIdentifier(v string) *DeleteIngestionInput { - s.AppBundleIdentifier = &v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *DeleteIngestionInput) SetIngestionIdentifier(v string) *DeleteIngestionInput { - s.IngestionIdentifier = &v - return s -} - -type DeleteIngestionOutput 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 DeleteIngestionOutput) 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 DeleteIngestionOutput) GoString() string { - return s.String() -} - -// Contains information about an audit log destination. -type Destination struct { - _ struct{} `type:"structure"` - - // Contains information about an Amazon Kinesis Data Firehose delivery stream. - FirehoseStream *FirehoseStream `locationName:"firehoseStream" type:"structure"` - - // Contains information about an Amazon S3 bucket. - S3Bucket *S3Bucket `locationName:"s3Bucket" 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 Destination) 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 Destination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Destination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Destination"} - if s.FirehoseStream != nil { - if err := s.FirehoseStream.Validate(); err != nil { - invalidParams.AddNested("FirehoseStream", err.(request.ErrInvalidParams)) - } - } - if s.S3Bucket != nil { - if err := s.S3Bucket.Validate(); err != nil { - invalidParams.AddNested("S3Bucket", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFirehoseStream sets the FirehoseStream field's value. -func (s *Destination) SetFirehoseStream(v *FirehoseStream) *Destination { - s.FirehoseStream = v - return s -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *Destination) SetS3Bucket(v *S3Bucket) *Destination { - s.S3Bucket = v - return s -} - -// Contains information about the destination of ingested data. -type DestinationConfiguration struct { - _ struct{} `type:"structure"` - - // Contains information about an audit log destination configuration. - AuditLog *AuditLogDestinationConfiguration `locationName:"auditLog" 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 DestinationConfiguration) 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 DestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DestinationConfiguration"} - if s.AuditLog != nil { - if err := s.AuditLog.Validate(); err != nil { - invalidParams.AddNested("AuditLog", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuditLog sets the AuditLog field's value. -func (s *DestinationConfiguration) SetAuditLog(v *AuditLogDestinationConfiguration) *DestinationConfiguration { - s.AuditLog = v - return s -} - -// Contains information about an Amazon Kinesis Data Firehose delivery stream. -type FirehoseStream struct { - _ struct{} `type:"structure"` - - // The name of the Amazon Kinesis Data Firehose delivery stream. - // - // StreamName is a required field - StreamName *string `locationName:"streamName" min:"3" 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 FirehoseStream) 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 FirehoseStream) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FirehoseStream) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FirehoseStream"} - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) - } - if s.StreamName != nil && len(*s.StreamName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStreamName sets the StreamName field's value. -func (s *FirehoseStream) SetStreamName(v string) *FirehoseStream { - s.StreamName = &v - return s -} - -type GetAppAuthorizationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app authorization to use for the request. - // - // AppAuthorizationIdentifier is a required field - AppAuthorizationIdentifier *string `location:"uri" locationName:"appAuthorizationIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" 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 GetAppAuthorizationInput) 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 GetAppAuthorizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAppAuthorizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAppAuthorizationInput"} - if s.AppAuthorizationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppAuthorizationIdentifier")) - } - if s.AppAuthorizationIdentifier != nil && len(*s.AppAuthorizationIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppAuthorizationIdentifier", 1)) - } - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppAuthorizationIdentifier sets the AppAuthorizationIdentifier field's value. -func (s *GetAppAuthorizationInput) SetAppAuthorizationIdentifier(v string) *GetAppAuthorizationInput { - s.AppAuthorizationIdentifier = &v - return s -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *GetAppAuthorizationInput) SetAppBundleIdentifier(v string) *GetAppAuthorizationInput { - s.AppBundleIdentifier = &v - return s -} - -type GetAppAuthorizationOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an app authorization. - // - // AppAuthorization is a required field - AppAuthorization *AppAuthorization `locationName:"appAuthorization" type:"structure" 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 GetAppAuthorizationOutput) 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 GetAppAuthorizationOutput) GoString() string { - return s.String() -} - -// SetAppAuthorization sets the AppAuthorization field's value. -func (s *GetAppAuthorizationOutput) SetAppAuthorization(v *AppAuthorization) *GetAppAuthorizationOutput { - s.AppAuthorization = v - return s -} - -type GetAppBundleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" 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 GetAppBundleInput) 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 GetAppBundleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAppBundleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAppBundleInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *GetAppBundleInput) SetAppBundleIdentifier(v string) *GetAppBundleInput { - s.AppBundleIdentifier = &v - return s -} - -type GetAppBundleOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an app bundle. - // - // AppBundle is a required field - AppBundle *AppBundle `locationName:"appBundle" type:"structure" 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 GetAppBundleOutput) 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 GetAppBundleOutput) GoString() string { - return s.String() -} - -// SetAppBundle sets the AppBundle field's value. -func (s *GetAppBundleOutput) SetAppBundle(v *AppBundle) *GetAppBundleOutput { - s.AppBundle = v - return s -} - -type GetIngestionDestinationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion destination to use for the request. - // - // IngestionDestinationIdentifier is a required field - IngestionDestinationIdentifier *string `location:"uri" locationName:"ingestionDestinationIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" 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 GetIngestionDestinationInput) 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 GetIngestionDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIngestionDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIngestionDestinationInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.IngestionDestinationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionDestinationIdentifier")) - } - if s.IngestionDestinationIdentifier != nil && len(*s.IngestionDestinationIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionDestinationIdentifier", 1)) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *GetIngestionDestinationInput) SetAppBundleIdentifier(v string) *GetIngestionDestinationInput { - s.AppBundleIdentifier = &v - return s -} - -// SetIngestionDestinationIdentifier sets the IngestionDestinationIdentifier field's value. -func (s *GetIngestionDestinationInput) SetIngestionDestinationIdentifier(v string) *GetIngestionDestinationInput { - s.IngestionDestinationIdentifier = &v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *GetIngestionDestinationInput) SetIngestionIdentifier(v string) *GetIngestionDestinationInput { - s.IngestionIdentifier = &v - return s -} - -type GetIngestionDestinationOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an ingestion destination. - // - // IngestionDestination is a required field - IngestionDestination *IngestionDestination `locationName:"ingestionDestination" type:"structure" 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 GetIngestionDestinationOutput) 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 GetIngestionDestinationOutput) GoString() string { - return s.String() -} - -// SetIngestionDestination sets the IngestionDestination field's value. -func (s *GetIngestionDestinationOutput) SetIngestionDestination(v *IngestionDestination) *GetIngestionDestinationOutput { - s.IngestionDestination = v - return s -} - -type GetIngestionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" 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 GetIngestionInput) 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 GetIngestionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIngestionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIngestionInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *GetIngestionInput) SetAppBundleIdentifier(v string) *GetIngestionInput { - s.AppBundleIdentifier = &v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *GetIngestionInput) SetIngestionIdentifier(v string) *GetIngestionInput { - s.IngestionIdentifier = &v - return s -} - -type GetIngestionOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an ingestion. - // - // Ingestion is a required field - Ingestion *Ingestion `locationName:"ingestion" type:"structure" 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 GetIngestionOutput) 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 GetIngestionOutput) GoString() string { - return s.String() -} - -// SetIngestion sets the Ingestion field's value. -func (s *GetIngestionOutput) SetIngestion(v *Ingestion) *GetIngestionOutput { - s.Ingestion = v - return s -} - -// Contains information about an ingestion. -type Ingestion struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // App is a required field - App *string `locationName:"app" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the app bundle for the ingestion. - // - // AppBundleArn is a required field - AppBundleArn *string `locationName:"appBundleArn" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the ingestion. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The timestamp of when the ingestion was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The type of the ingestion. - // - // IngestionType is a required field - IngestionType *string `locationName:"ingestionType" type:"string" required:"true" enum:"IngestionType"` - - // The status of the ingestion. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"IngestionState"` - - // The ID of the application tenant. - // - // TenantId is a required field - TenantId *string `locationName:"tenantId" min:"1" type:"string" required:"true"` - - // The timestamp of when the ingestion was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 Ingestion) 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 Ingestion) GoString() string { - return s.String() -} - -// SetApp sets the App field's value. -func (s *Ingestion) SetApp(v string) *Ingestion { - s.App = &v - return s -} - -// SetAppBundleArn sets the AppBundleArn field's value. -func (s *Ingestion) SetAppBundleArn(v string) *Ingestion { - s.AppBundleArn = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Ingestion) SetArn(v string) *Ingestion { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Ingestion) SetCreatedAt(v time.Time) *Ingestion { - s.CreatedAt = &v - return s -} - -// SetIngestionType sets the IngestionType field's value. -func (s *Ingestion) SetIngestionType(v string) *Ingestion { - s.IngestionType = &v - return s -} - -// SetState sets the State field's value. -func (s *Ingestion) SetState(v string) *Ingestion { - s.State = &v - return s -} - -// SetTenantId sets the TenantId field's value. -func (s *Ingestion) SetTenantId(v string) *Ingestion { - s.TenantId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Ingestion) SetUpdatedAt(v time.Time) *Ingestion { - s.UpdatedAt = &v - return s -} - -// Contains information about an ingestion destination. -type IngestionDestination struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the ingestion destination. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The timestamp of when the ingestion destination was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // Contains information about the destination of ingested data. - // - // DestinationConfiguration is a required field - DestinationConfiguration *DestinationConfiguration `locationName:"destinationConfiguration" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) of the ingestion. - // - // IngestionArn is a required field - IngestionArn *string `locationName:"ingestionArn" min:"1" type:"string" required:"true"` - - // Contains information about how ingested data is processed. - // - // ProcessingConfiguration is a required field - ProcessingConfiguration *ProcessingConfiguration `locationName:"processingConfiguration" type:"structure" required:"true"` - - // The state of the ingestion destination. - // - // The following states are possible: - // - // * Active: The ingestion destination is active and is ready to be used. - // - // * Failed: The ingestion destination has failed. If the ingestion destination - // is in this state, you should verify the ingestion destination configuration - // and try again. - Status *string `locationName:"status" type:"string" enum:"IngestionDestinationStatus"` - - // The reason for the current status of the ingestion destination. - // - // Only present when the status of ingestion destination is Failed. - StatusReason *string `locationName:"statusReason" type:"string"` - - // The timestamp of when the ingestion destination was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 IngestionDestination) 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 IngestionDestination) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *IngestionDestination) SetArn(v string) *IngestionDestination { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *IngestionDestination) SetCreatedAt(v time.Time) *IngestionDestination { - s.CreatedAt = &v - return s -} - -// SetDestinationConfiguration sets the DestinationConfiguration field's value. -func (s *IngestionDestination) SetDestinationConfiguration(v *DestinationConfiguration) *IngestionDestination { - s.DestinationConfiguration = v - return s -} - -// SetIngestionArn sets the IngestionArn field's value. -func (s *IngestionDestination) SetIngestionArn(v string) *IngestionDestination { - s.IngestionArn = &v - return s -} - -// SetProcessingConfiguration sets the ProcessingConfiguration field's value. -func (s *IngestionDestination) SetProcessingConfiguration(v *ProcessingConfiguration) *IngestionDestination { - s.ProcessingConfiguration = v - return s -} - -// SetStatus sets the Status field's value. -func (s *IngestionDestination) SetStatus(v string) *IngestionDestination { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *IngestionDestination) SetStatusReason(v string) *IngestionDestination { - s.StatusReason = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *IngestionDestination) SetUpdatedAt(v time.Time) *IngestionDestination { - s.UpdatedAt = &v - return s -} - -// Contains a summary of an ingestion destination. -type IngestionDestinationSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the ingestion destination. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 IngestionDestinationSummary) 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 IngestionDestinationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *IngestionDestinationSummary) SetArn(v string) *IngestionDestinationSummary { - s.Arn = &v - return s -} - -// Contains a summary of an ingestion. -type IngestionSummary struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // App is a required field - App *string `locationName:"app" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the ingestion. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The status of the ingestion. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"IngestionState"` - - // The ID of the application tenant. - // - // TenantId is a required field - TenantId *string `locationName:"tenantId" min:"1" 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 IngestionSummary) 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 IngestionSummary) GoString() string { - return s.String() -} - -// SetApp sets the App field's value. -func (s *IngestionSummary) SetApp(v string) *IngestionSummary { - s.App = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *IngestionSummary) SetArn(v string) *IngestionSummary { - s.Arn = &v - return s -} - -// SetState sets the State field's value. -func (s *IngestionSummary) SetState(v string) *IngestionSummary { - s.State = &v - return s -} - -// SetTenantId sets the TenantId field's value. -func (s *IngestionSummary) SetTenantId(v string) *IngestionSummary { - s.TenantId = &v - return s -} - -// The request processing has failed because of an unknown error, exception, -// or failure with an internal server. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The period of time after which you should retry your request. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListAppAuthorizationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The maximum number of results that are returned per call. You can use nextToken - // to obtain further pages of results. - // - // This is only an upper limit. The actual number of results returned per call - // might be fewer than the specified maximum. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListAppAuthorizationsInput) 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 ListAppAuthorizationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAppAuthorizationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAppAuthorizationsInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *ListAppAuthorizationsInput) SetAppBundleIdentifier(v string) *ListAppAuthorizationsInput { - s.AppBundleIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAppAuthorizationsInput) SetMaxResults(v int64) *ListAppAuthorizationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAppAuthorizationsInput) SetNextToken(v string) *ListAppAuthorizationsInput { - s.NextToken = &v - return s -} - -type ListAppAuthorizationsOutput struct { - _ struct{} `type:"structure"` - - // Contains a list of app authorization summaries. - // - // AppAuthorizationSummaryList is a required field - AppAuthorizationSummaryList []*AppAuthorizationSummary `locationName:"appAuthorizationSummaryList" type:"list" required:"true"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAppAuthorizationsOutput) 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 ListAppAuthorizationsOutput) GoString() string { - return s.String() -} - -// SetAppAuthorizationSummaryList sets the AppAuthorizationSummaryList field's value. -func (s *ListAppAuthorizationsOutput) SetAppAuthorizationSummaryList(v []*AppAuthorizationSummary) *ListAppAuthorizationsOutput { - s.AppAuthorizationSummaryList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAppAuthorizationsOutput) SetNextToken(v string) *ListAppAuthorizationsOutput { - s.NextToken = &v - return s -} - -type ListAppBundlesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that are returned per call. You can use nextToken - // to obtain further pages of results. - // - // This is only an upper limit. The actual number of results returned per call - // might be fewer than the specified maximum. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListAppBundlesInput) 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 ListAppBundlesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAppBundlesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAppBundlesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAppBundlesInput) SetMaxResults(v int64) *ListAppBundlesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAppBundlesInput) SetNextToken(v string) *ListAppBundlesInput { - s.NextToken = &v - return s -} - -type ListAppBundlesOutput struct { - _ struct{} `type:"structure"` - - // Contains a list of app bundle summaries. - // - // AppBundleSummaryList is a required field - AppBundleSummaryList []*AppBundleSummary `locationName:"appBundleSummaryList" type:"list" required:"true"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAppBundlesOutput) 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 ListAppBundlesOutput) GoString() string { - return s.String() -} - -// SetAppBundleSummaryList sets the AppBundleSummaryList field's value. -func (s *ListAppBundlesOutput) SetAppBundleSummaryList(v []*AppBundleSummary) *ListAppBundlesOutput { - s.AppBundleSummaryList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAppBundlesOutput) SetNextToken(v string) *ListAppBundlesOutput { - s.NextToken = &v - return s -} - -type ListIngestionDestinationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" type:"string" required:"true"` - - // The maximum number of results that are returned per call. You can use nextToken - // to obtain further pages of results. - // - // This is only an upper limit. The actual number of results returned per call - // might be fewer than the specified maximum. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListIngestionDestinationsInput) 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 ListIngestionDestinationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIngestionDestinationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIngestionDestinationsInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *ListIngestionDestinationsInput) SetAppBundleIdentifier(v string) *ListIngestionDestinationsInput { - s.AppBundleIdentifier = &v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *ListIngestionDestinationsInput) SetIngestionIdentifier(v string) *ListIngestionDestinationsInput { - s.IngestionIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIngestionDestinationsInput) SetMaxResults(v int64) *ListIngestionDestinationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIngestionDestinationsInput) SetNextToken(v string) *ListIngestionDestinationsInput { - s.NextToken = &v - return s -} - -type ListIngestionDestinationsOutput struct { - _ struct{} `type:"structure"` - - // Contains a list of ingestion destination summaries. - // - // IngestionDestinations is a required field - IngestionDestinations []*IngestionDestinationSummary `locationName:"ingestionDestinations" type:"list" required:"true"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" 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 ListIngestionDestinationsOutput) 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 ListIngestionDestinationsOutput) GoString() string { - return s.String() -} - -// SetIngestionDestinations sets the IngestionDestinations field's value. -func (s *ListIngestionDestinationsOutput) SetIngestionDestinations(v []*IngestionDestinationSummary) *ListIngestionDestinationsOutput { - s.IngestionDestinations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIngestionDestinationsOutput) SetNextToken(v string) *ListIngestionDestinationsOutput { - s.NextToken = &v - return s -} - -type ListIngestionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The maximum number of results that are returned per call. You can use nextToken - // to obtain further pages of results. - // - // This is only an upper limit. The actual number of results returned per call - // might be fewer than the specified maximum. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListIngestionsInput) 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 ListIngestionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIngestionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIngestionsInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *ListIngestionsInput) SetAppBundleIdentifier(v string) *ListIngestionsInput { - s.AppBundleIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIngestionsInput) SetMaxResults(v int64) *ListIngestionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIngestionsInput) SetNextToken(v string) *ListIngestionsInput { - s.NextToken = &v - return s -} - -type ListIngestionsOutput struct { - _ struct{} `type:"structure"` - - // Contains a list of ingestion summaries. - // - // Ingestions is a required field - Ingestions []*IngestionSummary `locationName:"ingestions" type:"list" required:"true"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" 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 ListIngestionsOutput) 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 ListIngestionsOutput) GoString() string { - return s.String() -} - -// SetIngestions sets the Ingestions field's value. -func (s *ListIngestionsOutput) SetIngestions(v []*IngestionSummary) *ListIngestionsOutput { - s.Ingestions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIngestionsOutput) SetNextToken(v string) *ListIngestionsOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource for which you want to retrieve - // tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A map of the key-value pairs for the tag or tags assigned to the specified - // resource. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Contains OAuth2 client credential information. -type Oauth2Credential struct { - _ struct{} `type:"structure"` - - // The client ID of the client application. - // - // ClientId is a required field - ClientId *string `locationName:"clientId" min:"1" type:"string" required:"true"` - - // The client secret of the client application. - // - // ClientSecret is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Oauth2Credential's - // String and GoString methods. - // - // ClientSecret is a required field - ClientSecret *string `locationName:"clientSecret" min:"1" type:"string" required:"true" sensitive:"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 Oauth2Credential) 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 Oauth2Credential) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Oauth2Credential) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Oauth2Credential"} - if s.ClientId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientId")) - } - if s.ClientId != nil && len(*s.ClientId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientId", 1)) - } - if s.ClientSecret == nil { - invalidParams.Add(request.NewErrParamRequired("ClientSecret")) - } - if s.ClientSecret != nil && len(*s.ClientSecret) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientSecret", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientId sets the ClientId field's value. -func (s *Oauth2Credential) SetClientId(v string) *Oauth2Credential { - s.ClientId = &v - return s -} - -// SetClientSecret sets the ClientSecret field's value. -func (s *Oauth2Credential) SetClientSecret(v string) *Oauth2Credential { - s.ClientSecret = &v - return s -} - -// Contains information about how ingested data is processed. -type ProcessingConfiguration struct { - _ struct{} `type:"structure"` - - // Contains information about an audit log processing configuration. - AuditLog *AuditLogProcessingConfiguration `locationName:"auditLog" 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 ProcessingConfiguration) 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 ProcessingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProcessingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProcessingConfiguration"} - if s.AuditLog != nil { - if err := s.AuditLog.Validate(); err != nil { - invalidParams.AddNested("AuditLog", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuditLog sets the AuditLog field's value. -func (s *ProcessingConfiguration) SetAuditLog(v *AuditLogProcessingConfiguration) *ProcessingConfiguration { - s.AuditLog = v - return s -} - -// The specified resource does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The resource ID. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resource type. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about an Amazon S3 bucket. -type S3Bucket struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket. - // - // BucketName is a required field - BucketName *string `locationName:"bucketName" min:"3" type:"string" required:"true"` - - // The object key to use. - Prefix *string `locationName:"prefix" min:"1" 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 S3Bucket) 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 S3Bucket) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Bucket) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Bucket"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - if s.BucketName != nil && len(*s.BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BucketName", 3)) - } - if s.Prefix != nil && len(*s.Prefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Prefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3Bucket) SetBucketName(v string) *S3Bucket { - s.BucketName = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3Bucket) SetPrefix(v string) *S3Bucket { - s.Prefix = &v - return s -} - -// The request exceeds a service quota. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The code for the quota exceeded. - // - // QuotaCode is a required field - QuotaCode *string `locationName:"quotaCode" type:"string" required:"true"` - - // The resource ID. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resource type. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true"` - - // The code of the service. - // - // ServiceCode is a required field - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartIngestionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" 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 StartIngestionInput) 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 StartIngestionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartIngestionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartIngestionInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *StartIngestionInput) SetAppBundleIdentifier(v string) *StartIngestionInput { - s.AppBundleIdentifier = &v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *StartIngestionInput) SetIngestionIdentifier(v string) *StartIngestionInput { - s.IngestionIdentifier = &v - return s -} - -type StartIngestionOutput 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 StartIngestionOutput) 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 StartIngestionOutput) GoString() string { - return s.String() -} - -type StartUserAccessTasksInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The email address of the target user. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StartUserAccessTasksInput's - // String and GoString methods. - // - // Email is a required field - Email *string `locationName:"email" type:"string" required:"true" sensitive:"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 StartUserAccessTasksInput) 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 StartUserAccessTasksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartUserAccessTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartUserAccessTasksInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.Email == nil { - invalidParams.Add(request.NewErrParamRequired("Email")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *StartUserAccessTasksInput) SetAppBundleIdentifier(v string) *StartUserAccessTasksInput { - s.AppBundleIdentifier = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *StartUserAccessTasksInput) SetEmail(v string) *StartUserAccessTasksInput { - s.Email = &v - return s -} - -type StartUserAccessTasksOutput struct { - _ struct{} `type:"structure"` - - // Contains a list of user access task information. - UserAccessTasksList []*UserAccessTaskItem `locationName:"userAccessTasksList" type:"list"` -} - -// 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 StartUserAccessTasksOutput) 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 StartUserAccessTasksOutput) GoString() string { - return s.String() -} - -// SetUserAccessTasksList sets the UserAccessTasksList field's value. -func (s *StartUserAccessTasksOutput) SetUserAccessTasksList(v []*UserAccessTaskItem) *StartUserAccessTasksOutput { - s.UserAccessTasksList = v - return s -} - -type StopIngestionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" 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 StopIngestionInput) 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 StopIngestionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopIngestionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopIngestionInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *StopIngestionInput) SetAppBundleIdentifier(v string) *StopIngestionInput { - s.AppBundleIdentifier = &v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *StopIngestionInput) SetIngestionIdentifier(v string) *StopIngestionInput { - s.IngestionIdentifier = &v - return s -} - -type StopIngestionOutput 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 StopIngestionOutput) 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 StopIngestionOutput) GoString() string { - return s.String() -} - -// The key or keys of the key-value pairs for the tag or tags assigned to a -// resource. -type Tag struct { - _ struct{} `type:"structure"` - - // Tag key. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // Tag value. - // - // Value is a required field - Value *string `locationName:"value" 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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource that you want to tag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // A map of the key-value pairs of the tag or tags to assign to the resource. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Contains information about an error returned from a user access task. -type TaskError struct { - _ struct{} `type:"structure"` - - // The code of the error. - ErrorCode *string `locationName:"errorCode" type:"string"` - - // The message of the error. - ErrorMessage *string `locationName:"errorMessage" 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 TaskError) 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 TaskError) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *TaskError) SetErrorCode(v string) *TaskError { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *TaskError) SetErrorMessage(v string) *TaskError { - s.ErrorMessage = &v - return s -} - -// Contains information about an application tenant. -type Tenant struct { - _ struct{} `type:"structure"` - - // The display name of the tenant. - // - // TenantDisplayName is a required field - TenantDisplayName *string `locationName:"tenantDisplayName" min:"1" type:"string" required:"true"` - - // The ID of the application tenant. - // - // TenantIdentifier is a required field - TenantIdentifier *string `locationName:"tenantIdentifier" min:"1" 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 Tenant) 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 Tenant) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tenant) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tenant"} - if s.TenantDisplayName == nil { - invalidParams.Add(request.NewErrParamRequired("TenantDisplayName")) - } - if s.TenantDisplayName != nil && len(*s.TenantDisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TenantDisplayName", 1)) - } - if s.TenantIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TenantIdentifier")) - } - if s.TenantIdentifier != nil && len(*s.TenantIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TenantIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTenantDisplayName sets the TenantDisplayName field's value. -func (s *Tenant) SetTenantDisplayName(v string) *Tenant { - s.TenantDisplayName = &v - return s -} - -// SetTenantIdentifier sets the TenantIdentifier field's value. -func (s *Tenant) SetTenantIdentifier(v string) *Tenant { - s.TenantIdentifier = &v - return s -} - -// The request rate exceeds the limit. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The code for the quota exceeded. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The period of time after which you should retry your request. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The code of the service. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource that you want to untag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The keys of the key-value pairs for the tag or tags you want to remove from - // the specified resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateAppAuthorizationInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app authorization to use for the request. - // - // AppAuthorizationIdentifier is a required field - AppAuthorizationIdentifier *string `location:"uri" locationName:"appAuthorizationIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // Contains credentials for the application, such as an API key or OAuth2 client - // ID and secret. - // - // Specify credentials that match the authorization type of the app authorization - // to update. For example, if the authorization type of the app authorization - // is OAuth2 (oauth2), then you should provide only the OAuth2 credentials. - Credential *Credential `locationName:"credential" type:"structure"` - - // Contains information about an application tenant, such as the application - // display name and identifier. - Tenant *Tenant `locationName:"tenant" 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 UpdateAppAuthorizationInput) 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 UpdateAppAuthorizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAppAuthorizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAppAuthorizationInput"} - if s.AppAuthorizationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppAuthorizationIdentifier")) - } - if s.AppAuthorizationIdentifier != nil && len(*s.AppAuthorizationIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppAuthorizationIdentifier", 1)) - } - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.Credential != nil { - if err := s.Credential.Validate(); err != nil { - invalidParams.AddNested("Credential", err.(request.ErrInvalidParams)) - } - } - if s.Tenant != nil { - if err := s.Tenant.Validate(); err != nil { - invalidParams.AddNested("Tenant", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppAuthorizationIdentifier sets the AppAuthorizationIdentifier field's value. -func (s *UpdateAppAuthorizationInput) SetAppAuthorizationIdentifier(v string) *UpdateAppAuthorizationInput { - s.AppAuthorizationIdentifier = &v - return s -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *UpdateAppAuthorizationInput) SetAppBundleIdentifier(v string) *UpdateAppAuthorizationInput { - s.AppBundleIdentifier = &v - return s -} - -// SetCredential sets the Credential field's value. -func (s *UpdateAppAuthorizationInput) SetCredential(v *Credential) *UpdateAppAuthorizationInput { - s.Credential = v - return s -} - -// SetTenant sets the Tenant field's value. -func (s *UpdateAppAuthorizationInput) SetTenant(v *Tenant) *UpdateAppAuthorizationInput { - s.Tenant = v - return s -} - -type UpdateAppAuthorizationOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an app authorization. - // - // AppAuthorization is a required field - AppAuthorization *AppAuthorization `locationName:"appAuthorization" type:"structure" 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 UpdateAppAuthorizationOutput) 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 UpdateAppAuthorizationOutput) GoString() string { - return s.String() -} - -// SetAppAuthorization sets the AppAuthorization field's value. -func (s *UpdateAppAuthorizationOutput) SetAppAuthorization(v *AppAuthorization) *UpdateAppAuthorizationOutput { - s.AppAuthorization = v - return s -} - -type UpdateIngestionDestinationInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // app bundle to use for the request. - // - // AppBundleIdentifier is a required field - AppBundleIdentifier *string `location:"uri" locationName:"appBundleIdentifier" min:"1" type:"string" required:"true"` - - // Contains information about the destination of ingested data. - // - // DestinationConfiguration is a required field - DestinationConfiguration *DestinationConfiguration `locationName:"destinationConfiguration" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion destination to use for the request. - // - // IngestionDestinationIdentifier is a required field - IngestionDestinationIdentifier *string `location:"uri" locationName:"ingestionDestinationIdentifier" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or Universal Unique Identifier (UUID) of the - // ingestion to use for the request. - // - // IngestionIdentifier is a required field - IngestionIdentifier *string `location:"uri" locationName:"ingestionIdentifier" min:"1" 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 UpdateIngestionDestinationInput) 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 UpdateIngestionDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIngestionDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIngestionDestinationInput"} - if s.AppBundleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AppBundleIdentifier")) - } - if s.AppBundleIdentifier != nil && len(*s.AppBundleIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppBundleIdentifier", 1)) - } - if s.DestinationConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationConfiguration")) - } - if s.IngestionDestinationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionDestinationIdentifier")) - } - if s.IngestionDestinationIdentifier != nil && len(*s.IngestionDestinationIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionDestinationIdentifier", 1)) - } - if s.IngestionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionIdentifier")) - } - if s.IngestionIdentifier != nil && len(*s.IngestionIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionIdentifier", 1)) - } - if s.DestinationConfiguration != nil { - if err := s.DestinationConfiguration.Validate(); err != nil { - invalidParams.AddNested("DestinationConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppBundleIdentifier sets the AppBundleIdentifier field's value. -func (s *UpdateIngestionDestinationInput) SetAppBundleIdentifier(v string) *UpdateIngestionDestinationInput { - s.AppBundleIdentifier = &v - return s -} - -// SetDestinationConfiguration sets the DestinationConfiguration field's value. -func (s *UpdateIngestionDestinationInput) SetDestinationConfiguration(v *DestinationConfiguration) *UpdateIngestionDestinationInput { - s.DestinationConfiguration = v - return s -} - -// SetIngestionDestinationIdentifier sets the IngestionDestinationIdentifier field's value. -func (s *UpdateIngestionDestinationInput) SetIngestionDestinationIdentifier(v string) *UpdateIngestionDestinationInput { - s.IngestionDestinationIdentifier = &v - return s -} - -// SetIngestionIdentifier sets the IngestionIdentifier field's value. -func (s *UpdateIngestionDestinationInput) SetIngestionIdentifier(v string) *UpdateIngestionDestinationInput { - s.IngestionIdentifier = &v - return s -} - -type UpdateIngestionDestinationOutput struct { - _ struct{} `type:"structure"` - - // Contains information about an ingestion destination. - // - // IngestionDestination is a required field - IngestionDestination *IngestionDestination `locationName:"ingestionDestination" type:"structure" 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 UpdateIngestionDestinationOutput) 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 UpdateIngestionDestinationOutput) GoString() string { - return s.String() -} - -// SetIngestionDestination sets the IngestionDestination field's value. -func (s *UpdateIngestionDestinationOutput) SetIngestionDestination(v *IngestionDestination) *UpdateIngestionDestinationOutput { - s.IngestionDestination = v - return s -} - -// Contains information about a user's access to an application. -type UserAccessResultItem struct { - _ struct{} `type:"structure"` - - // The name of the application. - App *string `locationName:"app" min:"1" type:"string"` - - // The email address of the target user. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UserAccessResultItem's - // String and GoString methods. - Email *string `locationName:"email" type:"string" sensitive:"true"` - - // The status of the user access result item. - // - // The following states are possible: - // - // * IN_PROGRESS: The user access task is in progress. - // - // * COMPLETED: The user access task completed successfully. - // - // * FAILED: The user access task failed. - // - // * EXPIRED: The user access task expired. - ResultStatus *string `locationName:"resultStatus" type:"string" enum:"ResultStatus"` - - // Contains information about an error returned from a user access task. - TaskError *TaskError `locationName:"taskError" type:"structure"` - - // The unique ID of the task. - TaskId *string `locationName:"taskId" type:"string"` - - // The display name of the tenant. - TenantDisplayName *string `locationName:"tenantDisplayName" min:"1" type:"string"` - - // The ID of the application tenant. - TenantId *string `locationName:"tenantId" min:"1" type:"string"` - - // The first name of the user. - // - // UserFirstName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UserAccessResultItem's - // String and GoString methods. - UserFirstName *string `locationName:"userFirstName" min:"1" type:"string" sensitive:"true"` - - // The full name of the user. - // - // UserFullName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UserAccessResultItem's - // String and GoString methods. - UserFullName *string `locationName:"userFullName" min:"1" type:"string" sensitive:"true"` - - // The unique ID of user. - // - // UserId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UserAccessResultItem's - // String and GoString methods. - UserId *string `locationName:"userId" min:"1" type:"string" sensitive:"true"` - - // The last name of the user. - // - // UserLastName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UserAccessResultItem's - // String and GoString methods. - UserLastName *string `locationName:"userLastName" min:"1" type:"string" sensitive:"true"` - - // The status of the user returned by the application. - UserStatus *string `locationName:"userStatus" 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 UserAccessResultItem) 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 UserAccessResultItem) GoString() string { - return s.String() -} - -// SetApp sets the App field's value. -func (s *UserAccessResultItem) SetApp(v string) *UserAccessResultItem { - s.App = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *UserAccessResultItem) SetEmail(v string) *UserAccessResultItem { - s.Email = &v - return s -} - -// SetResultStatus sets the ResultStatus field's value. -func (s *UserAccessResultItem) SetResultStatus(v string) *UserAccessResultItem { - s.ResultStatus = &v - return s -} - -// SetTaskError sets the TaskError field's value. -func (s *UserAccessResultItem) SetTaskError(v *TaskError) *UserAccessResultItem { - s.TaskError = v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *UserAccessResultItem) SetTaskId(v string) *UserAccessResultItem { - s.TaskId = &v - return s -} - -// SetTenantDisplayName sets the TenantDisplayName field's value. -func (s *UserAccessResultItem) SetTenantDisplayName(v string) *UserAccessResultItem { - s.TenantDisplayName = &v - return s -} - -// SetTenantId sets the TenantId field's value. -func (s *UserAccessResultItem) SetTenantId(v string) *UserAccessResultItem { - s.TenantId = &v - return s -} - -// SetUserFirstName sets the UserFirstName field's value. -func (s *UserAccessResultItem) SetUserFirstName(v string) *UserAccessResultItem { - s.UserFirstName = &v - return s -} - -// SetUserFullName sets the UserFullName field's value. -func (s *UserAccessResultItem) SetUserFullName(v string) *UserAccessResultItem { - s.UserFullName = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *UserAccessResultItem) SetUserId(v string) *UserAccessResultItem { - s.UserId = &v - return s -} - -// SetUserLastName sets the UserLastName field's value. -func (s *UserAccessResultItem) SetUserLastName(v string) *UserAccessResultItem { - s.UserLastName = &v - return s -} - -// SetUserStatus sets the UserStatus field's value. -func (s *UserAccessResultItem) SetUserStatus(v string) *UserAccessResultItem { - s.UserStatus = &v - return s -} - -// Contains information about a user access task. -type UserAccessTaskItem struct { - _ struct{} `type:"structure"` - - // The name of the application. - // - // App is a required field - App *string `locationName:"app" min:"1" type:"string" required:"true"` - - // Error from the task, if any. - Error *TaskError `locationName:"error" type:"structure"` - - // The unique ID of the task. - TaskId *string `locationName:"taskId" type:"string"` - - // The ID of the application tenant. - // - // TenantId is a required field - TenantId *string `locationName:"tenantId" min:"1" 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 UserAccessTaskItem) 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 UserAccessTaskItem) GoString() string { - return s.String() -} - -// SetApp sets the App field's value. -func (s *UserAccessTaskItem) SetApp(v string) *UserAccessTaskItem { - s.App = &v - return s -} - -// SetError sets the Error field's value. -func (s *UserAccessTaskItem) SetError(v *TaskError) *UserAccessTaskItem { - s.Error = v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *UserAccessTaskItem) SetTaskId(v string) *UserAccessTaskItem { - s.TaskId = &v - return s -} - -// SetTenantId sets the TenantId field's value. -func (s *UserAccessTaskItem) SetTenantId(v string) *UserAccessTaskItem { - s.TenantId = &v - return s -} - -// The request has invalid or missing parameters. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The field list. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason for the exception. - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input failed to meet the constraints specified by the Amazon Web Services -// service in a specified field. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // A message about the validation exception. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The field name where the invalid entry was detected. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // AppAuthorizationStatusPendingConnect is a AppAuthorizationStatus enum value - AppAuthorizationStatusPendingConnect = "PendingConnect" - - // AppAuthorizationStatusConnected is a AppAuthorizationStatus enum value - AppAuthorizationStatusConnected = "Connected" - - // AppAuthorizationStatusConnectionValidationFailed is a AppAuthorizationStatus enum value - AppAuthorizationStatusConnectionValidationFailed = "ConnectionValidationFailed" - - // AppAuthorizationStatusTokenAutoRotationFailed is a AppAuthorizationStatus enum value - AppAuthorizationStatusTokenAutoRotationFailed = "TokenAutoRotationFailed" -) - -// AppAuthorizationStatus_Values returns all elements of the AppAuthorizationStatus enum -func AppAuthorizationStatus_Values() []string { - return []string{ - AppAuthorizationStatusPendingConnect, - AppAuthorizationStatusConnected, - AppAuthorizationStatusConnectionValidationFailed, - AppAuthorizationStatusTokenAutoRotationFailed, - } -} - -const ( - // AuthTypeOauth2 is a AuthType enum value - AuthTypeOauth2 = "oauth2" - - // AuthTypeApiKey is a AuthType enum value - AuthTypeApiKey = "apiKey" -) - -// AuthType_Values returns all elements of the AuthType enum -func AuthType_Values() []string { - return []string{ - AuthTypeOauth2, - AuthTypeApiKey, - } -} - -const ( - // FormatJson is a Format enum value - FormatJson = "json" - - // FormatParquet is a Format enum value - FormatParquet = "parquet" -) - -// Format_Values returns all elements of the Format enum -func Format_Values() []string { - return []string{ - FormatJson, - FormatParquet, - } -} - -const ( - // IngestionDestinationStatusActive is a IngestionDestinationStatus enum value - IngestionDestinationStatusActive = "Active" - - // IngestionDestinationStatusFailed is a IngestionDestinationStatus enum value - IngestionDestinationStatusFailed = "Failed" -) - -// IngestionDestinationStatus_Values returns all elements of the IngestionDestinationStatus enum -func IngestionDestinationStatus_Values() []string { - return []string{ - IngestionDestinationStatusActive, - IngestionDestinationStatusFailed, - } -} - -const ( - // IngestionStateEnabled is a IngestionState enum value - IngestionStateEnabled = "enabled" - - // IngestionStateDisabled is a IngestionState enum value - IngestionStateDisabled = "disabled" -) - -// IngestionState_Values returns all elements of the IngestionState enum -func IngestionState_Values() []string { - return []string{ - IngestionStateEnabled, - IngestionStateDisabled, - } -} - -const ( - // IngestionTypeAuditLog is a IngestionType enum value - IngestionTypeAuditLog = "auditLog" -) - -// IngestionType_Values returns all elements of the IngestionType enum -func IngestionType_Values() []string { - return []string{ - IngestionTypeAuditLog, - } -} - -const ( - // PersonaAdmin is a Persona enum value - PersonaAdmin = "admin" - - // PersonaEndUser is a Persona enum value - PersonaEndUser = "endUser" -) - -// Persona_Values returns all elements of the Persona enum -func Persona_Values() []string { - return []string{ - PersonaAdmin, - PersonaEndUser, - } -} - -const ( - // ResultStatusInProgress is a ResultStatus enum value - ResultStatusInProgress = "IN_PROGRESS" - - // ResultStatusCompleted is a ResultStatus enum value - ResultStatusCompleted = "COMPLETED" - - // ResultStatusFailed is a ResultStatus enum value - ResultStatusFailed = "FAILED" - - // ResultStatusExpired is a ResultStatus enum value - ResultStatusExpired = "EXPIRED" -) - -// ResultStatus_Values returns all elements of the ResultStatus enum -func ResultStatus_Values() []string { - return []string{ - ResultStatusInProgress, - ResultStatusCompleted, - ResultStatusFailed, - ResultStatusExpired, - } -} - -const ( - // SchemaOcsf is a Schema enum value - SchemaOcsf = "ocsf" - - // SchemaRaw is a Schema enum value - SchemaRaw = "raw" -) - -// Schema_Values returns all elements of the Schema enum -func Schema_Values() []string { - return []string{ - SchemaOcsf, - SchemaRaw, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/appfabriciface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/appfabriciface/interface.go deleted file mode 100644 index 285ed5a13ab2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/appfabriciface/interface.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package appfabriciface provides an interface to enable mocking the AppFabric service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package appfabriciface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric" -) - -// AppFabricAPI provides an interface to enable mocking the -// appfabric.AppFabric service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AppFabric. -// func myFunc(svc appfabriciface.AppFabricAPI) bool { -// // Make svc.BatchGetUserAccessTasks request -// } -// -// func main() { -// sess := session.New() -// svc := appfabric.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockAppFabricClient struct { -// appfabriciface.AppFabricAPI -// } -// func (m *mockAppFabricClient) BatchGetUserAccessTasks(input *appfabric.BatchGetUserAccessTasksInput) (*appfabric.BatchGetUserAccessTasksOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockAppFabricClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type AppFabricAPI interface { - BatchGetUserAccessTasks(*appfabric.BatchGetUserAccessTasksInput) (*appfabric.BatchGetUserAccessTasksOutput, error) - BatchGetUserAccessTasksWithContext(aws.Context, *appfabric.BatchGetUserAccessTasksInput, ...request.Option) (*appfabric.BatchGetUserAccessTasksOutput, error) - BatchGetUserAccessTasksRequest(*appfabric.BatchGetUserAccessTasksInput) (*request.Request, *appfabric.BatchGetUserAccessTasksOutput) - - ConnectAppAuthorization(*appfabric.ConnectAppAuthorizationInput) (*appfabric.ConnectAppAuthorizationOutput, error) - ConnectAppAuthorizationWithContext(aws.Context, *appfabric.ConnectAppAuthorizationInput, ...request.Option) (*appfabric.ConnectAppAuthorizationOutput, error) - ConnectAppAuthorizationRequest(*appfabric.ConnectAppAuthorizationInput) (*request.Request, *appfabric.ConnectAppAuthorizationOutput) - - CreateAppAuthorization(*appfabric.CreateAppAuthorizationInput) (*appfabric.CreateAppAuthorizationOutput, error) - CreateAppAuthorizationWithContext(aws.Context, *appfabric.CreateAppAuthorizationInput, ...request.Option) (*appfabric.CreateAppAuthorizationOutput, error) - CreateAppAuthorizationRequest(*appfabric.CreateAppAuthorizationInput) (*request.Request, *appfabric.CreateAppAuthorizationOutput) - - CreateAppBundle(*appfabric.CreateAppBundleInput) (*appfabric.CreateAppBundleOutput, error) - CreateAppBundleWithContext(aws.Context, *appfabric.CreateAppBundleInput, ...request.Option) (*appfabric.CreateAppBundleOutput, error) - CreateAppBundleRequest(*appfabric.CreateAppBundleInput) (*request.Request, *appfabric.CreateAppBundleOutput) - - CreateIngestion(*appfabric.CreateIngestionInput) (*appfabric.CreateIngestionOutput, error) - CreateIngestionWithContext(aws.Context, *appfabric.CreateIngestionInput, ...request.Option) (*appfabric.CreateIngestionOutput, error) - CreateIngestionRequest(*appfabric.CreateIngestionInput) (*request.Request, *appfabric.CreateIngestionOutput) - - CreateIngestionDestination(*appfabric.CreateIngestionDestinationInput) (*appfabric.CreateIngestionDestinationOutput, error) - CreateIngestionDestinationWithContext(aws.Context, *appfabric.CreateIngestionDestinationInput, ...request.Option) (*appfabric.CreateIngestionDestinationOutput, error) - CreateIngestionDestinationRequest(*appfabric.CreateIngestionDestinationInput) (*request.Request, *appfabric.CreateIngestionDestinationOutput) - - DeleteAppAuthorization(*appfabric.DeleteAppAuthorizationInput) (*appfabric.DeleteAppAuthorizationOutput, error) - DeleteAppAuthorizationWithContext(aws.Context, *appfabric.DeleteAppAuthorizationInput, ...request.Option) (*appfabric.DeleteAppAuthorizationOutput, error) - DeleteAppAuthorizationRequest(*appfabric.DeleteAppAuthorizationInput) (*request.Request, *appfabric.DeleteAppAuthorizationOutput) - - DeleteAppBundle(*appfabric.DeleteAppBundleInput) (*appfabric.DeleteAppBundleOutput, error) - DeleteAppBundleWithContext(aws.Context, *appfabric.DeleteAppBundleInput, ...request.Option) (*appfabric.DeleteAppBundleOutput, error) - DeleteAppBundleRequest(*appfabric.DeleteAppBundleInput) (*request.Request, *appfabric.DeleteAppBundleOutput) - - DeleteIngestion(*appfabric.DeleteIngestionInput) (*appfabric.DeleteIngestionOutput, error) - DeleteIngestionWithContext(aws.Context, *appfabric.DeleteIngestionInput, ...request.Option) (*appfabric.DeleteIngestionOutput, error) - DeleteIngestionRequest(*appfabric.DeleteIngestionInput) (*request.Request, *appfabric.DeleteIngestionOutput) - - DeleteIngestionDestination(*appfabric.DeleteIngestionDestinationInput) (*appfabric.DeleteIngestionDestinationOutput, error) - DeleteIngestionDestinationWithContext(aws.Context, *appfabric.DeleteIngestionDestinationInput, ...request.Option) (*appfabric.DeleteIngestionDestinationOutput, error) - DeleteIngestionDestinationRequest(*appfabric.DeleteIngestionDestinationInput) (*request.Request, *appfabric.DeleteIngestionDestinationOutput) - - GetAppAuthorization(*appfabric.GetAppAuthorizationInput) (*appfabric.GetAppAuthorizationOutput, error) - GetAppAuthorizationWithContext(aws.Context, *appfabric.GetAppAuthorizationInput, ...request.Option) (*appfabric.GetAppAuthorizationOutput, error) - GetAppAuthorizationRequest(*appfabric.GetAppAuthorizationInput) (*request.Request, *appfabric.GetAppAuthorizationOutput) - - GetAppBundle(*appfabric.GetAppBundleInput) (*appfabric.GetAppBundleOutput, error) - GetAppBundleWithContext(aws.Context, *appfabric.GetAppBundleInput, ...request.Option) (*appfabric.GetAppBundleOutput, error) - GetAppBundleRequest(*appfabric.GetAppBundleInput) (*request.Request, *appfabric.GetAppBundleOutput) - - GetIngestion(*appfabric.GetIngestionInput) (*appfabric.GetIngestionOutput, error) - GetIngestionWithContext(aws.Context, *appfabric.GetIngestionInput, ...request.Option) (*appfabric.GetIngestionOutput, error) - GetIngestionRequest(*appfabric.GetIngestionInput) (*request.Request, *appfabric.GetIngestionOutput) - - GetIngestionDestination(*appfabric.GetIngestionDestinationInput) (*appfabric.GetIngestionDestinationOutput, error) - GetIngestionDestinationWithContext(aws.Context, *appfabric.GetIngestionDestinationInput, ...request.Option) (*appfabric.GetIngestionDestinationOutput, error) - GetIngestionDestinationRequest(*appfabric.GetIngestionDestinationInput) (*request.Request, *appfabric.GetIngestionDestinationOutput) - - ListAppAuthorizations(*appfabric.ListAppAuthorizationsInput) (*appfabric.ListAppAuthorizationsOutput, error) - ListAppAuthorizationsWithContext(aws.Context, *appfabric.ListAppAuthorizationsInput, ...request.Option) (*appfabric.ListAppAuthorizationsOutput, error) - ListAppAuthorizationsRequest(*appfabric.ListAppAuthorizationsInput) (*request.Request, *appfabric.ListAppAuthorizationsOutput) - - ListAppAuthorizationsPages(*appfabric.ListAppAuthorizationsInput, func(*appfabric.ListAppAuthorizationsOutput, bool) bool) error - ListAppAuthorizationsPagesWithContext(aws.Context, *appfabric.ListAppAuthorizationsInput, func(*appfabric.ListAppAuthorizationsOutput, bool) bool, ...request.Option) error - - ListAppBundles(*appfabric.ListAppBundlesInput) (*appfabric.ListAppBundlesOutput, error) - ListAppBundlesWithContext(aws.Context, *appfabric.ListAppBundlesInput, ...request.Option) (*appfabric.ListAppBundlesOutput, error) - ListAppBundlesRequest(*appfabric.ListAppBundlesInput) (*request.Request, *appfabric.ListAppBundlesOutput) - - ListAppBundlesPages(*appfabric.ListAppBundlesInput, func(*appfabric.ListAppBundlesOutput, bool) bool) error - ListAppBundlesPagesWithContext(aws.Context, *appfabric.ListAppBundlesInput, func(*appfabric.ListAppBundlesOutput, bool) bool, ...request.Option) error - - ListIngestionDestinations(*appfabric.ListIngestionDestinationsInput) (*appfabric.ListIngestionDestinationsOutput, error) - ListIngestionDestinationsWithContext(aws.Context, *appfabric.ListIngestionDestinationsInput, ...request.Option) (*appfabric.ListIngestionDestinationsOutput, error) - ListIngestionDestinationsRequest(*appfabric.ListIngestionDestinationsInput) (*request.Request, *appfabric.ListIngestionDestinationsOutput) - - ListIngestionDestinationsPages(*appfabric.ListIngestionDestinationsInput, func(*appfabric.ListIngestionDestinationsOutput, bool) bool) error - ListIngestionDestinationsPagesWithContext(aws.Context, *appfabric.ListIngestionDestinationsInput, func(*appfabric.ListIngestionDestinationsOutput, bool) bool, ...request.Option) error - - ListIngestions(*appfabric.ListIngestionsInput) (*appfabric.ListIngestionsOutput, error) - ListIngestionsWithContext(aws.Context, *appfabric.ListIngestionsInput, ...request.Option) (*appfabric.ListIngestionsOutput, error) - ListIngestionsRequest(*appfabric.ListIngestionsInput) (*request.Request, *appfabric.ListIngestionsOutput) - - ListIngestionsPages(*appfabric.ListIngestionsInput, func(*appfabric.ListIngestionsOutput, bool) bool) error - ListIngestionsPagesWithContext(aws.Context, *appfabric.ListIngestionsInput, func(*appfabric.ListIngestionsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*appfabric.ListTagsForResourceInput) (*appfabric.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *appfabric.ListTagsForResourceInput, ...request.Option) (*appfabric.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*appfabric.ListTagsForResourceInput) (*request.Request, *appfabric.ListTagsForResourceOutput) - - StartIngestion(*appfabric.StartIngestionInput) (*appfabric.StartIngestionOutput, error) - StartIngestionWithContext(aws.Context, *appfabric.StartIngestionInput, ...request.Option) (*appfabric.StartIngestionOutput, error) - StartIngestionRequest(*appfabric.StartIngestionInput) (*request.Request, *appfabric.StartIngestionOutput) - - StartUserAccessTasks(*appfabric.StartUserAccessTasksInput) (*appfabric.StartUserAccessTasksOutput, error) - StartUserAccessTasksWithContext(aws.Context, *appfabric.StartUserAccessTasksInput, ...request.Option) (*appfabric.StartUserAccessTasksOutput, error) - StartUserAccessTasksRequest(*appfabric.StartUserAccessTasksInput) (*request.Request, *appfabric.StartUserAccessTasksOutput) - - StopIngestion(*appfabric.StopIngestionInput) (*appfabric.StopIngestionOutput, error) - StopIngestionWithContext(aws.Context, *appfabric.StopIngestionInput, ...request.Option) (*appfabric.StopIngestionOutput, error) - StopIngestionRequest(*appfabric.StopIngestionInput) (*request.Request, *appfabric.StopIngestionOutput) - - TagResource(*appfabric.TagResourceInput) (*appfabric.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *appfabric.TagResourceInput, ...request.Option) (*appfabric.TagResourceOutput, error) - TagResourceRequest(*appfabric.TagResourceInput) (*request.Request, *appfabric.TagResourceOutput) - - UntagResource(*appfabric.UntagResourceInput) (*appfabric.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *appfabric.UntagResourceInput, ...request.Option) (*appfabric.UntagResourceOutput, error) - UntagResourceRequest(*appfabric.UntagResourceInput) (*request.Request, *appfabric.UntagResourceOutput) - - UpdateAppAuthorization(*appfabric.UpdateAppAuthorizationInput) (*appfabric.UpdateAppAuthorizationOutput, error) - UpdateAppAuthorizationWithContext(aws.Context, *appfabric.UpdateAppAuthorizationInput, ...request.Option) (*appfabric.UpdateAppAuthorizationOutput, error) - UpdateAppAuthorizationRequest(*appfabric.UpdateAppAuthorizationInput) (*request.Request, *appfabric.UpdateAppAuthorizationOutput) - - UpdateIngestionDestination(*appfabric.UpdateIngestionDestinationInput) (*appfabric.UpdateIngestionDestinationOutput, error) - UpdateIngestionDestinationWithContext(aws.Context, *appfabric.UpdateIngestionDestinationInput, ...request.Option) (*appfabric.UpdateIngestionDestinationOutput, error) - UpdateIngestionDestinationRequest(*appfabric.UpdateIngestionDestinationInput) (*request.Request, *appfabric.UpdateIngestionDestinationOutput) -} - -var _ AppFabricAPI = (*appfabric.AppFabric)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/doc.go deleted file mode 100644 index 8012eb465d04..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/doc.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package appfabric provides the client and types for making API -// requests to AppFabric. -// -// Amazon Web Services AppFabric quickly connects software as a service (SaaS) -// applications across your organization. This allows IT and security teams -// to easily manage and secure applications using a standard schema, and employees -// can complete everyday tasks faster using generative artificial intelligence -// (AI). You can use these APIs to complete AppFabric tasks, such as setting -// up audit log ingestions or viewing user access. For more information about -// AppFabric, including the required permissions to use the service, see the -// Amazon Web Services AppFabric Administration Guide (https://docs.aws.amazon.com/appfabric/latest/adminguide/). -// For more information about using the Command Line Interface (CLI) to manage -// your AppFabric resources, see the AppFabric section of the CLI Reference -// (https://docs.aws.amazon.com/cli/latest/reference/appfabric/index.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/appfabric-2023-05-19 for more information on this service. -// -// See appfabric package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/appfabric/ -// -// # Using the Client -// -// To contact AppFabric with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AppFabric client AppFabric for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/appfabric/#New -package appfabric diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/errors.go deleted file mode 100644 index f95dc8b78548..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package appfabric - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You are not authorized to perform this operation. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request has created a conflict. Check the request parameters and try - // again. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request processing has failed because of an unknown error, exception, - // or failure with an internal server. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request exceeds a service quota. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request rate exceeds the limit. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The request has invalid or missing parameters. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/service.go deleted file mode 100644 index 7b28fa8ac609..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/appfabric/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package appfabric - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// AppFabric provides the API operation methods for making requests to -// AppFabric. See this package's package overview docs -// for details on the service. -// -// AppFabric methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type AppFabric struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "AppFabric" // Name of service. - EndpointsID = "appfabric" // ID to lookup a service endpoint with. - ServiceID = "AppFabric" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the AppFabric client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a AppFabric client from just a session. -// svc := appfabric.New(mySession) -// -// // Create a AppFabric client with additional configuration -// svc := appfabric.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *AppFabric { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "appfabric" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *AppFabric { - svc := &AppFabric{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-05-19", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a AppFabric operation and runs any -// custom request initialization. -func (c *AppFabric) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/api.go deleted file mode 100644 index d341610c24c7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/api.go +++ /dev/null @@ -1,2492 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package arczonalshift - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opCancelZonalShift = "CancelZonalShift" - -// CancelZonalShiftRequest generates a "aws/request.Request" representing the -// client's request for the CancelZonalShift 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 CancelZonalShift for more information on using the CancelZonalShift -// 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 CancelZonalShiftRequest method. -// req, resp := client.CancelZonalShiftRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/CancelZonalShift -func (c *ARCZonalShift) CancelZonalShiftRequest(input *CancelZonalShiftInput) (req *request.Request, output *CancelZonalShiftOutput) { - op := &request.Operation{ - Name: opCancelZonalShift, - HTTPMethod: "DELETE", - HTTPPath: "/zonalshifts/{zonalShiftId}", - } - - if input == nil { - input = &CancelZonalShiftInput{} - } - - output = &CancelZonalShiftOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelZonalShift API operation for AWS ARC - Zonal Shift. -// -// Cancel a zonal shift in Amazon Route 53 Application Recovery Controller that -// you've started for a resource in your AWS account in an AWS Region. -// -// 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 AWS ARC - Zonal Shift's -// API operation CancelZonalShift for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// There was an internal server error. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - ResourceNotFoundException -// The input requested a resource that was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/CancelZonalShift -func (c *ARCZonalShift) CancelZonalShift(input *CancelZonalShiftInput) (*CancelZonalShiftOutput, error) { - req, out := c.CancelZonalShiftRequest(input) - return out, req.Send() -} - -// CancelZonalShiftWithContext is the same as CancelZonalShift with the addition of -// the ability to pass a context and additional request options. -// -// See CancelZonalShift 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 *ARCZonalShift) CancelZonalShiftWithContext(ctx aws.Context, input *CancelZonalShiftInput, opts ...request.Option) (*CancelZonalShiftOutput, error) { - req, out := c.CancelZonalShiftRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetManagedResource = "GetManagedResource" - -// GetManagedResourceRequest generates a "aws/request.Request" representing the -// client's request for the GetManagedResource 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 GetManagedResource for more information on using the GetManagedResource -// 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 GetManagedResourceRequest method. -// req, resp := client.GetManagedResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/GetManagedResource -func (c *ARCZonalShift) GetManagedResourceRequest(input *GetManagedResourceInput) (req *request.Request, output *GetManagedResourceOutput) { - op := &request.Operation{ - Name: opGetManagedResource, - HTTPMethod: "GET", - HTTPPath: "/managedresources/{resourceIdentifier}", - } - - if input == nil { - input = &GetManagedResourceInput{} - } - - output = &GetManagedResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetManagedResource API operation for AWS ARC - Zonal Shift. -// -// Get information about a resource that's been registered for zonal shifts -// with Amazon Route 53 Application Recovery Controller in this AWS Region. -// Resources that are registered for zonal shifts are managed resources in Route -// 53 ARC. -// -// At this time, you can only start a zonal shift for Network Load Balancers -// and Application Load Balancers with cross-zone load balancing turned off. -// -// 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 AWS ARC - Zonal Shift's -// API operation GetManagedResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The input requested a resource that was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/GetManagedResource -func (c *ARCZonalShift) GetManagedResource(input *GetManagedResourceInput) (*GetManagedResourceOutput, error) { - req, out := c.GetManagedResourceRequest(input) - return out, req.Send() -} - -// GetManagedResourceWithContext is the same as GetManagedResource with the addition of -// the ability to pass a context and additional request options. -// -// See GetManagedResource 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 *ARCZonalShift) GetManagedResourceWithContext(ctx aws.Context, input *GetManagedResourceInput, opts ...request.Option) (*GetManagedResourceOutput, error) { - req, out := c.GetManagedResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListManagedResources = "ListManagedResources" - -// ListManagedResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListManagedResources 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 ListManagedResources for more information on using the ListManagedResources -// 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 ListManagedResourcesRequest method. -// req, resp := client.ListManagedResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/ListManagedResources -func (c *ARCZonalShift) ListManagedResourcesRequest(input *ListManagedResourcesInput) (req *request.Request, output *ListManagedResourcesOutput) { - op := &request.Operation{ - Name: opListManagedResources, - HTTPMethod: "GET", - HTTPPath: "/managedresources", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListManagedResourcesInput{} - } - - output = &ListManagedResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListManagedResources API operation for AWS ARC - Zonal Shift. -// -// Lists all the resources in your AWS account in this AWS Region that are managed -// for zonal shifts in Amazon Route 53 Application Recovery Controller, and -// information about them. The information includes their Amazon Resource Names -// (ARNs), the Availability Zones the resources are deployed in, and the resource -// name. -// -// 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 AWS ARC - Zonal Shift's -// API operation ListManagedResources for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// There was an internal server error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/ListManagedResources -func (c *ARCZonalShift) ListManagedResources(input *ListManagedResourcesInput) (*ListManagedResourcesOutput, error) { - req, out := c.ListManagedResourcesRequest(input) - return out, req.Send() -} - -// ListManagedResourcesWithContext is the same as ListManagedResources with the addition of -// the ability to pass a context and additional request options. -// -// See ListManagedResources 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 *ARCZonalShift) ListManagedResourcesWithContext(ctx aws.Context, input *ListManagedResourcesInput, opts ...request.Option) (*ListManagedResourcesOutput, error) { - req, out := c.ListManagedResourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListManagedResourcesPages iterates over the pages of a ListManagedResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListManagedResources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListManagedResources operation. -// pageNum := 0 -// err := client.ListManagedResourcesPages(params, -// func(page *arczonalshift.ListManagedResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ARCZonalShift) ListManagedResourcesPages(input *ListManagedResourcesInput, fn func(*ListManagedResourcesOutput, bool) bool) error { - return c.ListManagedResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListManagedResourcesPagesWithContext same as ListManagedResourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ARCZonalShift) ListManagedResourcesPagesWithContext(ctx aws.Context, input *ListManagedResourcesInput, fn func(*ListManagedResourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListManagedResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListManagedResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListManagedResourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListZonalShifts = "ListZonalShifts" - -// ListZonalShiftsRequest generates a "aws/request.Request" representing the -// client's request for the ListZonalShifts 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 ListZonalShifts for more information on using the ListZonalShifts -// 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 ListZonalShiftsRequest method. -// req, resp := client.ListZonalShiftsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/ListZonalShifts -func (c *ARCZonalShift) ListZonalShiftsRequest(input *ListZonalShiftsInput) (req *request.Request, output *ListZonalShiftsOutput) { - op := &request.Operation{ - Name: opListZonalShifts, - HTTPMethod: "GET", - HTTPPath: "/zonalshifts", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListZonalShiftsInput{} - } - - output = &ListZonalShiftsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListZonalShifts API operation for AWS ARC - Zonal Shift. -// -// Lists all the active zonal shifts in Amazon Route 53 Application Recovery -// Controller in your AWS account in this AWS Region. -// -// 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 AWS ARC - Zonal Shift's -// API operation ListZonalShifts for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// There was an internal server error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/ListZonalShifts -func (c *ARCZonalShift) ListZonalShifts(input *ListZonalShiftsInput) (*ListZonalShiftsOutput, error) { - req, out := c.ListZonalShiftsRequest(input) - return out, req.Send() -} - -// ListZonalShiftsWithContext is the same as ListZonalShifts with the addition of -// the ability to pass a context and additional request options. -// -// See ListZonalShifts 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 *ARCZonalShift) ListZonalShiftsWithContext(ctx aws.Context, input *ListZonalShiftsInput, opts ...request.Option) (*ListZonalShiftsOutput, error) { - req, out := c.ListZonalShiftsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListZonalShiftsPages iterates over the pages of a ListZonalShifts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListZonalShifts method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListZonalShifts operation. -// pageNum := 0 -// err := client.ListZonalShiftsPages(params, -// func(page *arczonalshift.ListZonalShiftsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ARCZonalShift) ListZonalShiftsPages(input *ListZonalShiftsInput, fn func(*ListZonalShiftsOutput, bool) bool) error { - return c.ListZonalShiftsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListZonalShiftsPagesWithContext same as ListZonalShiftsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ARCZonalShift) ListZonalShiftsPagesWithContext(ctx aws.Context, input *ListZonalShiftsInput, fn func(*ListZonalShiftsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListZonalShiftsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListZonalShiftsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListZonalShiftsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartZonalShift = "StartZonalShift" - -// StartZonalShiftRequest generates a "aws/request.Request" representing the -// client's request for the StartZonalShift 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 StartZonalShift for more information on using the StartZonalShift -// 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 StartZonalShiftRequest method. -// req, resp := client.StartZonalShiftRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/StartZonalShift -func (c *ARCZonalShift) StartZonalShiftRequest(input *StartZonalShiftInput) (req *request.Request, output *StartZonalShiftOutput) { - op := &request.Operation{ - Name: opStartZonalShift, - HTTPMethod: "POST", - HTTPPath: "/zonalshifts", - } - - if input == nil { - input = &StartZonalShiftInput{} - } - - output = &StartZonalShiftOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartZonalShift API operation for AWS ARC - Zonal Shift. -// -// You start a zonal shift to temporarily move load balancer traffic away from -// an Availability Zone in a AWS Region, to help your application recover immediately, -// for example, from a developer's bad code deployment or from an AWS infrastructure -// failure in a single Availability Zone. You can start a zonal shift in Route -// 53 ARC only for managed resources in your account in an AWS Region. Resources -// are automatically registered with Route 53 ARC by AWS services. -// -// At this time, you can only start a zonal shift for Network Load Balancers -// and Application Load Balancers with cross-zone load balancing turned off. -// -// When you start a zonal shift, traffic for the resource is no longer routed -// to the Availability Zone. The zonal shift is created immediately in Route -// 53 ARC. However, it can take a short time, typically up to a few minutes, -// for existing, in-progress connections in the Availability Zone to complete. -// -// For more information, see Zonal shift (https://docs.aws.amazon.com/r53recovery/latest/dg/arc-zonal-shift.html) -// in the Amazon Route 53 Application Recovery Controller Developer Guide. -// -// 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 AWS ARC - Zonal Shift's -// API operation StartZonalShift for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// There was an internal server error. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - ResourceNotFoundException -// The input requested a resource that was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/StartZonalShift -func (c *ARCZonalShift) StartZonalShift(input *StartZonalShiftInput) (*StartZonalShiftOutput, error) { - req, out := c.StartZonalShiftRequest(input) - return out, req.Send() -} - -// StartZonalShiftWithContext is the same as StartZonalShift with the addition of -// the ability to pass a context and additional request options. -// -// See StartZonalShift 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 *ARCZonalShift) StartZonalShiftWithContext(ctx aws.Context, input *StartZonalShiftInput, opts ...request.Option) (*StartZonalShiftOutput, error) { - req, out := c.StartZonalShiftRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateZonalShift = "UpdateZonalShift" - -// UpdateZonalShiftRequest generates a "aws/request.Request" representing the -// client's request for the UpdateZonalShift 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 UpdateZonalShift for more information on using the UpdateZonalShift -// 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 UpdateZonalShiftRequest method. -// req, resp := client.UpdateZonalShiftRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/UpdateZonalShift -func (c *ARCZonalShift) UpdateZonalShiftRequest(input *UpdateZonalShiftInput) (req *request.Request, output *UpdateZonalShiftOutput) { - op := &request.Operation{ - Name: opUpdateZonalShift, - HTTPMethod: "PATCH", - HTTPPath: "/zonalshifts/{zonalShiftId}", - } - - if input == nil { - input = &UpdateZonalShiftInput{} - } - - output = &UpdateZonalShiftOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateZonalShift API operation for AWS ARC - Zonal Shift. -// -// Update an active zonal shift in Amazon Route 53 Application Recovery Controller -// in your AWS account. You can update a zonal shift to set a new expiration, -// or edit or replace the comment for the zonal shift. -// -// 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 AWS ARC - Zonal Shift's -// API operation UpdateZonalShift for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// There was an internal server error. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - ResourceNotFoundException -// The input requested a resource that was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30/UpdateZonalShift -func (c *ARCZonalShift) UpdateZonalShift(input *UpdateZonalShiftInput) (*UpdateZonalShiftOutput, error) { - req, out := c.UpdateZonalShiftRequest(input) - return out, req.Send() -} - -// UpdateZonalShiftWithContext is the same as UpdateZonalShift with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateZonalShift 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 *ARCZonalShift) UpdateZonalShiftWithContext(ctx aws.Context, input *UpdateZonalShiftInput, opts ...request.Option) (*UpdateZonalShiftOutput, error) { - req, out := c.UpdateZonalShiftRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CancelZonalShiftInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The internally-generated identifier of a zonal shift. - // - // ZonalShiftId is a required field - ZonalShiftId *string `location:"uri" locationName:"zonalShiftId" min:"6" 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 CancelZonalShiftInput) 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 CancelZonalShiftInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelZonalShiftInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelZonalShiftInput"} - if s.ZonalShiftId == nil { - invalidParams.Add(request.NewErrParamRequired("ZonalShiftId")) - } - if s.ZonalShiftId != nil && len(*s.ZonalShiftId) < 6 { - invalidParams.Add(request.NewErrParamMinLen("ZonalShiftId", 6)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetZonalShiftId sets the ZonalShiftId field's value. -func (s *CancelZonalShiftInput) SetZonalShiftId(v string) *CancelZonalShiftInput { - s.ZonalShiftId = &v - return s -} - -type CancelZonalShiftOutput struct { - _ struct{} `type:"structure"` - - // The Availability Zone that traffic is moved away from for a resource when - // you start a zonal shift. Until the zonal shift expires or you cancel it, - // traffic for the resource is instead moved to other Availability Zones in - // the AWS Region. - // - // AwayFrom is a required field - AwayFrom *string `locationName:"awayFrom" type:"string" required:"true"` - - // A comment that you enter about the zonal shift. Only the latest comment is - // retained; no comment history is maintained. A new comment overwrites any - // existing comment string. - // - // Comment is a required field - Comment *string `locationName:"comment" type:"string" required:"true"` - - // The expiry time (expiration time) for the zonal shift. A zonal shift is temporary - // and must be set to expire when you start the zonal shift. You can initially - // set a zonal shift to expire in a maximum of three days (72 hours). However, - // you can update a zonal shift to set a new expiration at any time. - // - // When you start a zonal shift, you specify how long you want it to be active, - // which Route 53 ARC converts to an expiry time (expiration time). You can - // cancel a zonal shift, for example, if you're ready to restore traffic to - // the Availability Zone. Or you can update the zonal shift to specify another - // length of time to expire in. - // - // ExpiryTime is a required field - ExpiryTime *time.Time `locationName:"expiryTime" type:"timestamp" required:"true"` - - // The identifier for the resource to include in a zonal shift. The identifier - // is the Amazon Resource Name (ARN) for the resource. - // - // At this time, you can only start a zonal shift for Network Load Balancers - // and Application Load Balancers with cross-zone load balancing turned off. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `locationName:"resourceIdentifier" min:"8" type:"string" required:"true"` - - // The time (UTC) when the zonal shift is started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // A status for a zonal shift. - // - // The Status for a zonal shift can have one of the following values: - // - // * ACTIVE: The zonal shift is started and active. - // - // * EXPIRED: The zonal shift has expired (the expiry time was exceeded). - // - // * CANCELED: The zonal shift was canceled. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ZonalShiftStatus"` - - // The identifier of a zonal shift. - // - // ZonalShiftId is a required field - ZonalShiftId *string `locationName:"zonalShiftId" min:"6" 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 CancelZonalShiftOutput) 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 CancelZonalShiftOutput) GoString() string { - return s.String() -} - -// SetAwayFrom sets the AwayFrom field's value. -func (s *CancelZonalShiftOutput) SetAwayFrom(v string) *CancelZonalShiftOutput { - s.AwayFrom = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *CancelZonalShiftOutput) SetComment(v string) *CancelZonalShiftOutput { - s.Comment = &v - return s -} - -// SetExpiryTime sets the ExpiryTime field's value. -func (s *CancelZonalShiftOutput) SetExpiryTime(v time.Time) *CancelZonalShiftOutput { - s.ExpiryTime = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *CancelZonalShiftOutput) SetResourceIdentifier(v string) *CancelZonalShiftOutput { - s.ResourceIdentifier = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *CancelZonalShiftOutput) SetStartTime(v time.Time) *CancelZonalShiftOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CancelZonalShiftOutput) SetStatus(v string) *CancelZonalShiftOutput { - s.Status = &v - return s -} - -// SetZonalShiftId sets the ZonalShiftId field's value. -func (s *CancelZonalShiftOutput) SetZonalShiftId(v string) *CancelZonalShiftOutput { - s.ZonalShiftId = &v - return s -} - -// The request could not be processed because of conflict in the current state -// of the resource. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason for the conflict exception. - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ConflictExceptionReason"` - - // The zonal shift ID associated with the conflict exception. - ZonalShiftId *string `locationName:"zonalShiftId" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type GetManagedResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for the resource to include in a zonal shift. The identifier - // is the Amazon Resource Name (ARN) for the resource. - // - // At this time, you can only start a zonal shift for Network Load Balancers - // and Application Load Balancers with cross-zone load balancing turned off. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `location:"uri" locationName:"resourceIdentifier" min:"8" 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 GetManagedResourceInput) 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 GetManagedResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetManagedResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetManagedResourceInput"} - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - if s.ResourceIdentifier != nil && len(*s.ResourceIdentifier) < 8 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 8)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *GetManagedResourceInput) SetResourceIdentifier(v string) *GetManagedResourceInput { - s.ResourceIdentifier = &v - return s -} - -type GetManagedResourceOutput struct { - _ struct{} `type:"structure"` - - // A collection of key-value pairs that indicate whether resources are active - // in Availability Zones or not. The key name is the Availability Zone where - // the resource is deployed. The value is 1 or 0. - // - // AppliedWeights is a required field - AppliedWeights map[string]*float64 `locationName:"appliedWeights" type:"map" required:"true"` - - // The Amazon Resource Name (ARN) for the resource. - Arn *string `locationName:"arn" min:"8" type:"string"` - - // The name of the resource. - Name *string `locationName:"name" min:"1" type:"string"` - - // The zonal shifts that are currently active for a resource. - // - // ZonalShifts is a required field - ZonalShifts []*ZonalShiftInResource `locationName:"zonalShifts" type:"list" 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 GetManagedResourceOutput) 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 GetManagedResourceOutput) GoString() string { - return s.String() -} - -// SetAppliedWeights sets the AppliedWeights field's value. -func (s *GetManagedResourceOutput) SetAppliedWeights(v map[string]*float64) *GetManagedResourceOutput { - s.AppliedWeights = v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetManagedResourceOutput) SetArn(v string) *GetManagedResourceOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetManagedResourceOutput) SetName(v string) *GetManagedResourceOutput { - s.Name = &v - return s -} - -// SetZonalShifts sets the ZonalShifts field's value. -func (s *GetManagedResourceOutput) SetZonalShifts(v []*ZonalShiftInResource) *GetManagedResourceOutput { - s.ZonalShifts = v - return s -} - -// There was an internal server error. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListManagedResourcesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The number of objects that you want to return with this call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specifies that you want to receive the next page of results. Valid only if - // you received a NextToken response in the previous request. If you did, it - // indicates that more output is available. Set this parameter to the value - // provided by the previous call's NextToken response to request the next page - // of results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListManagedResourcesInput) 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 ListManagedResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListManagedResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListManagedResourcesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListManagedResourcesInput) SetMaxResults(v int64) *ListManagedResourcesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListManagedResourcesInput) SetNextToken(v string) *ListManagedResourcesInput { - s.NextToken = &v - return s -} - -type ListManagedResourcesOutput struct { - _ struct{} `type:"structure"` - - // The items in the response list. - // - // Items is a required field - Items []*ManagedResourceSummary `locationName:"items" type:"list" required:"true"` - - // Specifies that you want to receive the next page of results. Valid only if - // you received a NextToken response in the previous request. If you did, it - // indicates that more output is available. Set this parameter to the value - // provided by the previous call's NextToken response to request the next page - // of results. - NextToken *string `locationName:"nextToken" 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 ListManagedResourcesOutput) 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 ListManagedResourcesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListManagedResourcesOutput) SetItems(v []*ManagedResourceSummary) *ListManagedResourcesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListManagedResourcesOutput) SetNextToken(v string) *ListManagedResourcesOutput { - s.NextToken = &v - return s -} - -type ListZonalShiftsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The number of objects that you want to return with this call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specifies that you want to receive the next page of results. Valid only if - // you received a NextToken response in the previous request. If you did, it - // indicates that more output is available. Set this parameter to the value - // provided by the previous call's NextToken response to request the next page - // of results. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // A status for a zonal shift. - // - // The Status for a zonal shift can have one of the following values: - // - // * ACTIVE: The zonal shift is started and active. - // - // * EXPIRED: The zonal shift has expired (the expiry time was exceeded). - // - // * CANCELED: The zonal shift was canceled. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"ZonalShiftStatus"` -} - -// 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 ListZonalShiftsInput) 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 ListZonalShiftsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListZonalShiftsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListZonalShiftsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListZonalShiftsInput) SetMaxResults(v int64) *ListZonalShiftsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListZonalShiftsInput) SetNextToken(v string) *ListZonalShiftsInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListZonalShiftsInput) SetStatus(v string) *ListZonalShiftsInput { - s.Status = &v - return s -} - -type ListZonalShiftsOutput struct { - _ struct{} `type:"structure"` - - // The items in the response list. - Items []*ZonalShiftSummary `locationName:"items" type:"list"` - - // Specifies that you want to receive the next page of results. Valid only if - // you received a NextToken response in the previous request. If you did, it - // indicates that more output is available. Set this parameter to the value - // provided by the previous call's NextToken response to request the next page - // of results. - NextToken *string `locationName:"nextToken" 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 ListZonalShiftsOutput) 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 ListZonalShiftsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListZonalShiftsOutput) SetItems(v []*ZonalShiftSummary) *ListZonalShiftsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListZonalShiftsOutput) SetNextToken(v string) *ListZonalShiftsOutput { - s.NextToken = &v - return s -} - -// A complex structure for a managed resource in an account. -// -// A managed resource is a Network Load Balancer or Application Load Balancer -// that has been registered with Route 53 ARC by Elastic Load Balancing. You -// can start a zonal shift in Route 53 ARC for a managed resource to temporarily -// move traffic for the resource away from an Availability Zone in an AWS Region. -// -// At this time, you can only start a zonal shift for Network Load Balancers -// and Application Load Balancers with cross-zone load balancing turned off. -type ManagedResourceSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the managed resource. - Arn *string `locationName:"arn" min:"8" type:"string"` - - // The Availability Zones that a resource is deployed in. - // - // AvailabilityZones is a required field - AvailabilityZones []*string `locationName:"availabilityZones" type:"list" required:"true"` - - // The name of the managed resource. - Name *string `locationName:"name" min:"1" 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 ManagedResourceSummary) 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 ManagedResourceSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ManagedResourceSummary) SetArn(v string) *ManagedResourceSummary { - s.Arn = &v - return s -} - -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *ManagedResourceSummary) SetAvailabilityZones(v []*string) *ManagedResourceSummary { - s.AvailabilityZones = v - return s -} - -// SetName sets the Name field's value. -func (s *ManagedResourceSummary) SetName(v string) *ManagedResourceSummary { - s.Name = &v - return s -} - -// The input requested a resource that was not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartZonalShiftInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone that traffic is moved away from for a resource when - // you start a zonal shift. Until the zonal shift expires or you cancel it, - // traffic for the resource is instead moved to other Availability Zones in - // the AWS Region. - // - // AwayFrom is a required field - AwayFrom *string `locationName:"awayFrom" type:"string" required:"true"` - - // A comment that you enter about the zonal shift. Only the latest comment is - // retained; no comment history is maintained. A new comment overwrites any - // existing comment string. - // - // Comment is a required field - Comment *string `locationName:"comment" type:"string" required:"true"` - - // The length of time that you want a zonal shift to be active, which Route - // 53 ARC converts to an expiry time (expiration time). Zonal shifts are temporary. - // You can set a zonal shift to be active initially for up to three days (72 - // hours). - // - // If you want to still keep traffic away from an Availability Zone, you can - // update the zonal shift and set a new expiration. You can also cancel a zonal - // shift, before it expires, for example, if you're ready to restore traffic - // to the Availability Zone. - // - // To set a length of time for a zonal shift to be active, specify a whole number, - // and then one of the following, with no space: - // - //
  • A lowercase letter m: To specify that the value is - // in minutes.

  • A lowercase letter h: To specify - // that the value is in hours.

For example: 20h - // means the zonal shift expires in 20 hours. 120m means the - // zonal shift expires in 120 minutes (2 hours).

- // - // ExpiresIn is a required field - ExpiresIn *string `locationName:"expiresIn" min:"2" type:"string" required:"true"` - - // The identifier for the resource to include in a zonal shift. The identifier - // is the Amazon Resource Name (ARN) for the resource. - // - // At this time, you can only start a zonal shift for Network Load Balancers - // and Application Load Balancers with cross-zone load balancing turned off. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `locationName:"resourceIdentifier" min:"8" 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 StartZonalShiftInput) 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 StartZonalShiftInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartZonalShiftInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartZonalShiftInput"} - if s.AwayFrom == nil { - invalidParams.Add(request.NewErrParamRequired("AwayFrom")) - } - if s.Comment == nil { - invalidParams.Add(request.NewErrParamRequired("Comment")) - } - if s.ExpiresIn == nil { - invalidParams.Add(request.NewErrParamRequired("ExpiresIn")) - } - if s.ExpiresIn != nil && len(*s.ExpiresIn) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ExpiresIn", 2)) - } - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - if s.ResourceIdentifier != nil && len(*s.ResourceIdentifier) < 8 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 8)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwayFrom sets the AwayFrom field's value. -func (s *StartZonalShiftInput) SetAwayFrom(v string) *StartZonalShiftInput { - s.AwayFrom = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *StartZonalShiftInput) SetComment(v string) *StartZonalShiftInput { - s.Comment = &v - return s -} - -// SetExpiresIn sets the ExpiresIn field's value. -func (s *StartZonalShiftInput) SetExpiresIn(v string) *StartZonalShiftInput { - s.ExpiresIn = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *StartZonalShiftInput) SetResourceIdentifier(v string) *StartZonalShiftInput { - s.ResourceIdentifier = &v - return s -} - -type StartZonalShiftOutput struct { - _ struct{} `type:"structure"` - - // The Availability Zone that traffic is moved away from for a resource when - // you start a zonal shift. Until the zonal shift expires or you cancel it, - // traffic for the resource is instead moved to other Availability Zones in - // the AWS Region. - // - // AwayFrom is a required field - AwayFrom *string `locationName:"awayFrom" type:"string" required:"true"` - - // A comment that you enter about the zonal shift. Only the latest comment is - // retained; no comment history is maintained. A new comment overwrites any - // existing comment string. - // - // Comment is a required field - Comment *string `locationName:"comment" type:"string" required:"true"` - - // The expiry time (expiration time) for the zonal shift. A zonal shift is temporary - // and must be set to expire when you start the zonal shift. You can initially - // set a zonal shift to expire in a maximum of three days (72 hours). However, - // you can update a zonal shift to set a new expiration at any time. - // - // When you start a zonal shift, you specify how long you want it to be active, - // which Route 53 ARC converts to an expiry time (expiration time). You can - // cancel a zonal shift, for example, if you're ready to restore traffic to - // the Availability Zone. Or you can update the zonal shift to specify another - // length of time to expire in. - // - // ExpiryTime is a required field - ExpiryTime *time.Time `locationName:"expiryTime" type:"timestamp" required:"true"` - - // The identifier for the resource to include in a zonal shift. The identifier - // is the Amazon Resource Name (ARN) for the resource. - // - // At this time, you can only start a zonal shift for Network Load Balancers - // and Application Load Balancers with cross-zone load balancing turned off. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `locationName:"resourceIdentifier" min:"8" type:"string" required:"true"` - - // The time (UTC) when the zonal shift is started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // A status for a zonal shift. - // - // The Status for a zonal shift can have one of the following values: - // - // * ACTIVE: The zonal shift is started and active. - // - // * EXPIRED: The zonal shift has expired (the expiry time was exceeded). - // - // * CANCELED: The zonal shift was canceled. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ZonalShiftStatus"` - - // The identifier of a zonal shift. - // - // ZonalShiftId is a required field - ZonalShiftId *string `locationName:"zonalShiftId" min:"6" 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 StartZonalShiftOutput) 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 StartZonalShiftOutput) GoString() string { - return s.String() -} - -// SetAwayFrom sets the AwayFrom field's value. -func (s *StartZonalShiftOutput) SetAwayFrom(v string) *StartZonalShiftOutput { - s.AwayFrom = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *StartZonalShiftOutput) SetComment(v string) *StartZonalShiftOutput { - s.Comment = &v - return s -} - -// SetExpiryTime sets the ExpiryTime field's value. -func (s *StartZonalShiftOutput) SetExpiryTime(v time.Time) *StartZonalShiftOutput { - s.ExpiryTime = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *StartZonalShiftOutput) SetResourceIdentifier(v string) *StartZonalShiftOutput { - s.ResourceIdentifier = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *StartZonalShiftOutput) SetStartTime(v time.Time) *StartZonalShiftOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartZonalShiftOutput) SetStatus(v string) *StartZonalShiftOutput { - s.Status = &v - return s -} - -// SetZonalShiftId sets the ZonalShiftId field's value. -func (s *StartZonalShiftOutput) SetZonalShiftId(v string) *StartZonalShiftOutput { - s.ZonalShiftId = &v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UpdateZonalShiftInput struct { - _ struct{} `type:"structure"` - - // A comment that you enter about the zonal shift. Only the latest comment is - // retained; no comment history is maintained. A new comment overwrites any - // existing comment string. - Comment *string `locationName:"comment" type:"string"` - - // The length of time that you want a zonal shift to be active, which Route - // 53 ARC converts to an expiry time (expiration time). Zonal shifts are temporary. - // You can set a zonal shift to be active initially for up to three days (72 - // hours). - // - // If you want to still keep traffic away from an Availability Zone, you can - // update the zonal shift and set a new expiration. You can also cancel a zonal - // shift, before it expires, for example, if you're ready to restore traffic - // to the Availability Zone. - // - // To set a length of time for a zonal shift to be active, specify a whole number, - // and then one of the following, with no space: - // - // * A lowercase letter m: To specify that the value is in minutes. - // - // * A lowercase letter h: To specify that the value is in hours. - // - // For example: 20h means the zonal shift expires in 20 hours. 120m means the - // zonal shift expires in 120 minutes (2 hours). - ExpiresIn *string `locationName:"expiresIn" min:"2" type:"string"` - - // The identifier of a zonal shift. - // - // ZonalShiftId is a required field - ZonalShiftId *string `location:"uri" locationName:"zonalShiftId" min:"6" 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 UpdateZonalShiftInput) 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 UpdateZonalShiftInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateZonalShiftInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateZonalShiftInput"} - if s.ExpiresIn != nil && len(*s.ExpiresIn) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ExpiresIn", 2)) - } - if s.ZonalShiftId == nil { - invalidParams.Add(request.NewErrParamRequired("ZonalShiftId")) - } - if s.ZonalShiftId != nil && len(*s.ZonalShiftId) < 6 { - invalidParams.Add(request.NewErrParamMinLen("ZonalShiftId", 6)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *UpdateZonalShiftInput) SetComment(v string) *UpdateZonalShiftInput { - s.Comment = &v - return s -} - -// SetExpiresIn sets the ExpiresIn field's value. -func (s *UpdateZonalShiftInput) SetExpiresIn(v string) *UpdateZonalShiftInput { - s.ExpiresIn = &v - return s -} - -// SetZonalShiftId sets the ZonalShiftId field's value. -func (s *UpdateZonalShiftInput) SetZonalShiftId(v string) *UpdateZonalShiftInput { - s.ZonalShiftId = &v - return s -} - -type UpdateZonalShiftOutput struct { - _ struct{} `type:"structure"` - - // The Availability Zone that traffic is moved away from for a resource when - // you start a zonal shift. Until the zonal shift expires or you cancel it, - // traffic for the resource is instead moved to other Availability Zones in - // the AWS Region. - // - // AwayFrom is a required field - AwayFrom *string `locationName:"awayFrom" type:"string" required:"true"` - - // A comment that you enter about the zonal shift. Only the latest comment is - // retained; no comment history is maintained. A new comment overwrites any - // existing comment string. - // - // Comment is a required field - Comment *string `locationName:"comment" type:"string" required:"true"` - - // The expiry time (expiration time) for the zonal shift. A zonal shift is temporary - // and must be set to expire when you start the zonal shift. You can initially - // set a zonal shift to expire in a maximum of three days (72 hours). However, - // you can update a zonal shift to set a new expiration at any time. - // - // When you start a zonal shift, you specify how long you want it to be active, - // which Route 53 ARC converts to an expiry time (expiration time). You can - // cancel a zonal shift, for example, if you're ready to restore traffic to - // the Availability Zone. Or you can update the zonal shift to specify another - // length of time to expire in. - // - // ExpiryTime is a required field - ExpiryTime *time.Time `locationName:"expiryTime" type:"timestamp" required:"true"` - - // The identifier for the resource to include in a zonal shift. The identifier - // is the Amazon Resource Name (ARN) for the resource. - // - // At this time, you can only start a zonal shift for Network Load Balancers - // and Application Load Balancers with cross-zone load balancing turned off. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `locationName:"resourceIdentifier" min:"8" type:"string" required:"true"` - - // The time (UTC) when the zonal shift is started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // A status for a zonal shift. - // - // The Status for a zonal shift can have one of the following values: - // - // * ACTIVE: The zonal shift is started and active. - // - // * EXPIRED: The zonal shift has expired (the expiry time was exceeded). - // - // * CANCELED: The zonal shift was canceled. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ZonalShiftStatus"` - - // The identifier of a zonal shift. - // - // ZonalShiftId is a required field - ZonalShiftId *string `locationName:"zonalShiftId" min:"6" 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 UpdateZonalShiftOutput) 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 UpdateZonalShiftOutput) GoString() string { - return s.String() -} - -// SetAwayFrom sets the AwayFrom field's value. -func (s *UpdateZonalShiftOutput) SetAwayFrom(v string) *UpdateZonalShiftOutput { - s.AwayFrom = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *UpdateZonalShiftOutput) SetComment(v string) *UpdateZonalShiftOutput { - s.Comment = &v - return s -} - -// SetExpiryTime sets the ExpiryTime field's value. -func (s *UpdateZonalShiftOutput) SetExpiryTime(v time.Time) *UpdateZonalShiftOutput { - s.ExpiryTime = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *UpdateZonalShiftOutput) SetResourceIdentifier(v string) *UpdateZonalShiftOutput { - s.ResourceIdentifier = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *UpdateZonalShiftOutput) SetStartTime(v time.Time) *UpdateZonalShiftOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateZonalShiftOutput) SetStatus(v string) *UpdateZonalShiftOutput { - s.Status = &v - return s -} - -// SetZonalShiftId sets the ZonalShiftId field's value. -func (s *UpdateZonalShiftOutput) SetZonalShiftId(v string) *UpdateZonalShiftOutput { - s.ZonalShiftId = &v - return s -} - -// The input fails to satisfy the constraints specified by an AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason for the validation exception. - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A complex structure that lists the zonal shifts for a managed resource and -// their statuses for the resource. -type ZonalShiftInResource struct { - _ struct{} `type:"structure"` - - // An appliedStatus for a zonal shift for a resource can have one of two values: - // APPLIED or NOT_APPLIED. - // - // AppliedStatus is a required field - AppliedStatus *string `locationName:"appliedStatus" type:"string" required:"true" enum:"AppliedStatus"` - - // The Availability Zone that traffic is moved away from for a resource when - // you start a zonal shift. Until the zonal shift expires or you cancel it, - // traffic for the resource is instead moved to other Availability Zones in - // the AWS Region. - // - // AwayFrom is a required field - AwayFrom *string `locationName:"awayFrom" type:"string" required:"true"` - - // A comment that you enter about the zonal shift. Only the latest comment is - // retained; no comment history is maintained. That is, a new comment overwrites - // any existing comment string. - // - // Comment is a required field - Comment *string `locationName:"comment" type:"string" required:"true"` - - // The expiry time (expiration time) for the zonal shift. A zonal shift is temporary - // and must be set to expire when you start the zonal shift. You can initially - // set a zonal shift to expire in a maximum of three days (72 hours). However, - // you can update a zonal shift to set a new expiration at any time. - // - // When you start a zonal shift, you specify how long you want it to be active, - // which Route 53 ARC converts to an expiry time (expiration time). You can - // cancel a zonal shift, for example, if you're ready to restore traffic to - // the Availability Zone. Or you can update the zonal shift to specify another - // length of time to expire in. - // - // ExpiryTime is a required field - ExpiryTime *time.Time `locationName:"expiryTime" type:"timestamp" required:"true"` - - // The identifier for the resource to include in a zonal shift. The identifier - // is the Amazon Resource Name (ARN) for the resource. - // - // At this time, you can only start a zonal shift for Network Load Balancers - // and Application Load Balancers with cross-zone load balancing turned off. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `locationName:"resourceIdentifier" min:"8" type:"string" required:"true"` - - // The time (UTC) when the zonal shift is started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // The identifier of a zonal shift. - // - // ZonalShiftId is a required field - ZonalShiftId *string `locationName:"zonalShiftId" min:"6" 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 ZonalShiftInResource) 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 ZonalShiftInResource) GoString() string { - return s.String() -} - -// SetAppliedStatus sets the AppliedStatus field's value. -func (s *ZonalShiftInResource) SetAppliedStatus(v string) *ZonalShiftInResource { - s.AppliedStatus = &v - return s -} - -// SetAwayFrom sets the AwayFrom field's value. -func (s *ZonalShiftInResource) SetAwayFrom(v string) *ZonalShiftInResource { - s.AwayFrom = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *ZonalShiftInResource) SetComment(v string) *ZonalShiftInResource { - s.Comment = &v - return s -} - -// SetExpiryTime sets the ExpiryTime field's value. -func (s *ZonalShiftInResource) SetExpiryTime(v time.Time) *ZonalShiftInResource { - s.ExpiryTime = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *ZonalShiftInResource) SetResourceIdentifier(v string) *ZonalShiftInResource { - s.ResourceIdentifier = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ZonalShiftInResource) SetStartTime(v time.Time) *ZonalShiftInResource { - s.StartTime = &v - return s -} - -// SetZonalShiftId sets the ZonalShiftId field's value. -func (s *ZonalShiftInResource) SetZonalShiftId(v string) *ZonalShiftInResource { - s.ZonalShiftId = &v - return s -} - -// You start a zonal shift to temporarily move load balancer traffic away from -// an Availability Zone in a AWS Region. A zonal shift helps your application -// recover immediately, for example, from a developer's bad code deployment -// or from an AWS infrastructure failure in a single Availability Zone. You -// can start a zonal shift in Route 53 ARC only for managed resources in your -// account in an AWS Region. Supported AWS resources are automatically registered -// with Route 53 ARC. -// -// Zonal shifts are temporary. A zonal shift can be active for up to three days -// (72 hours). -// -// When you start a zonal shift, you specify how long you want it to be active, -// which Amazon Route 53 Application Recovery Controller converts to an expiry -// time (expiration time). You can cancel a zonal shift, for example, if you're -// ready to restore traffic to the Availability Zone. Or you can extend the -// zonal shift by updating the expiration so the zonal shift is active longer. -type ZonalShiftSummary struct { - _ struct{} `type:"structure"` - - // The Availability Zone that traffic is moved away from for a resource when - // you start a zonal shift. Until the zonal shift expires or you cancel it, - // traffic for the resource is instead moved to other Availability Zones in - // the AWS Region. - // - // AwayFrom is a required field - AwayFrom *string `locationName:"awayFrom" type:"string" required:"true"` - - // A comment that you enter about the zonal shift. Only the latest comment is - // retained; no comment history is maintained. That is, a new comment overwrites - // any existing comment string. - // - // Comment is a required field - Comment *string `locationName:"comment" type:"string" required:"true"` - - // The expiry time (expiration time) for the zonal shift. A zonal shift is temporary - // and must be set to expire when you start the zonal shift. You can initially - // set a zonal shift to expire in a maximum of three days (72 hours). However, - // you can update a zonal shift to set a new expiration at any time. - // - // When you start a zonal shift, you specify how long you want it to be active, - // which Route 53 ARC converts to an expiry time (expiration time). You can - // cancel a zonal shift, for example, if you're ready to restore traffic to - // the Availability Zone. Or you can update the zonal shift to specify another - // length of time to expire in. - // - // ExpiryTime is a required field - ExpiryTime *time.Time `locationName:"expiryTime" type:"timestamp" required:"true"` - - // The identifier for the resource to include in a zonal shift. The identifier - // is the Amazon Resource Name (ARN) for the resource. - // - // At this time, you can only start a zonal shift for Network Load Balancers - // and Application Load Balancers with cross-zone load balancing turned off. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `locationName:"resourceIdentifier" min:"8" type:"string" required:"true"` - - // The time (UTC) when the zonal shift is started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // A status for a zonal shift. - // - // The Status for a zonal shift can have one of the following values: - // - // * ACTIVE: The zonal shift is started and active. - // - // * EXPIRED: The zonal shift has expired (the expiry time was exceeded). - // - // * CANCELED: The zonal shift was canceled. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ZonalShiftStatus"` - - // The identifier of a zonal shift. - // - // ZonalShiftId is a required field - ZonalShiftId *string `locationName:"zonalShiftId" min:"6" 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 ZonalShiftSummary) 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 ZonalShiftSummary) GoString() string { - return s.String() -} - -// SetAwayFrom sets the AwayFrom field's value. -func (s *ZonalShiftSummary) SetAwayFrom(v string) *ZonalShiftSummary { - s.AwayFrom = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *ZonalShiftSummary) SetComment(v string) *ZonalShiftSummary { - s.Comment = &v - return s -} - -// SetExpiryTime sets the ExpiryTime field's value. -func (s *ZonalShiftSummary) SetExpiryTime(v time.Time) *ZonalShiftSummary { - s.ExpiryTime = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *ZonalShiftSummary) SetResourceIdentifier(v string) *ZonalShiftSummary { - s.ResourceIdentifier = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ZonalShiftSummary) SetStartTime(v time.Time) *ZonalShiftSummary { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ZonalShiftSummary) SetStatus(v string) *ZonalShiftSummary { - s.Status = &v - return s -} - -// SetZonalShiftId sets the ZonalShiftId field's value. -func (s *ZonalShiftSummary) SetZonalShiftId(v string) *ZonalShiftSummary { - s.ZonalShiftId = &v - return s -} - -const ( - // AppliedStatusApplied is a AppliedStatus enum value - AppliedStatusApplied = "APPLIED" - - // AppliedStatusNotApplied is a AppliedStatus enum value - AppliedStatusNotApplied = "NOT_APPLIED" -) - -// AppliedStatus_Values returns all elements of the AppliedStatus enum -func AppliedStatus_Values() []string { - return []string{ - AppliedStatusApplied, - AppliedStatusNotApplied, - } -} - -const ( - // ConflictExceptionReasonZonalShiftAlreadyExists is a ConflictExceptionReason enum value - ConflictExceptionReasonZonalShiftAlreadyExists = "ZonalShiftAlreadyExists" - - // ConflictExceptionReasonZonalShiftStatusNotActive is a ConflictExceptionReason enum value - ConflictExceptionReasonZonalShiftStatusNotActive = "ZonalShiftStatusNotActive" - - // ConflictExceptionReasonSimultaneousZonalShiftsConflict is a ConflictExceptionReason enum value - ConflictExceptionReasonSimultaneousZonalShiftsConflict = "SimultaneousZonalShiftsConflict" -) - -// ConflictExceptionReason_Values returns all elements of the ConflictExceptionReason enum -func ConflictExceptionReason_Values() []string { - return []string{ - ConflictExceptionReasonZonalShiftAlreadyExists, - ConflictExceptionReasonZonalShiftStatusNotActive, - ConflictExceptionReasonSimultaneousZonalShiftsConflict, - } -} - -const ( - // ValidationExceptionReasonInvalidExpiresIn is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidExpiresIn = "InvalidExpiresIn" - - // ValidationExceptionReasonInvalidStatus is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidStatus = "InvalidStatus" - - // ValidationExceptionReasonMissingValue is a ValidationExceptionReason enum value - ValidationExceptionReasonMissingValue = "MissingValue" - - // ValidationExceptionReasonInvalidToken is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidToken = "InvalidToken" - - // ValidationExceptionReasonInvalidResourceIdentifier is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidResourceIdentifier = "InvalidResourceIdentifier" - - // ValidationExceptionReasonInvalidAz is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidAz = "InvalidAz" - - // ValidationExceptionReasonUnsupportedAz is a ValidationExceptionReason enum value - ValidationExceptionReasonUnsupportedAz = "UnsupportedAz" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonInvalidExpiresIn, - ValidationExceptionReasonInvalidStatus, - ValidationExceptionReasonMissingValue, - ValidationExceptionReasonInvalidToken, - ValidationExceptionReasonInvalidResourceIdentifier, - ValidationExceptionReasonInvalidAz, - ValidationExceptionReasonUnsupportedAz, - } -} - -const ( - // ZonalShiftStatusActive is a ZonalShiftStatus enum value - ZonalShiftStatusActive = "ACTIVE" - - // ZonalShiftStatusExpired is a ZonalShiftStatus enum value - ZonalShiftStatusExpired = "EXPIRED" - - // ZonalShiftStatusCanceled is a ZonalShiftStatus enum value - ZonalShiftStatusCanceled = "CANCELED" -) - -// ZonalShiftStatus_Values returns all elements of the ZonalShiftStatus enum -func ZonalShiftStatus_Values() []string { - return []string{ - ZonalShiftStatusActive, - ZonalShiftStatusExpired, - ZonalShiftStatusCanceled, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/arczonalshiftiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/arczonalshiftiface/interface.go deleted file mode 100644 index 974106b5d1de..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/arczonalshiftiface/interface.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package arczonalshiftiface provides an interface to enable mocking the AWS ARC - Zonal Shift service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package arczonalshiftiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift" -) - -// ARCZonalShiftAPI provides an interface to enable mocking the -// arczonalshift.ARCZonalShift service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS ARC - Zonal Shift. -// func myFunc(svc arczonalshiftiface.ARCZonalShiftAPI) bool { -// // Make svc.CancelZonalShift request -// } -// -// func main() { -// sess := session.New() -// svc := arczonalshift.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockARCZonalShiftClient struct { -// arczonalshiftiface.ARCZonalShiftAPI -// } -// func (m *mockARCZonalShiftClient) CancelZonalShift(input *arczonalshift.CancelZonalShiftInput) (*arczonalshift.CancelZonalShiftOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockARCZonalShiftClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type ARCZonalShiftAPI interface { - CancelZonalShift(*arczonalshift.CancelZonalShiftInput) (*arczonalshift.CancelZonalShiftOutput, error) - CancelZonalShiftWithContext(aws.Context, *arczonalshift.CancelZonalShiftInput, ...request.Option) (*arczonalshift.CancelZonalShiftOutput, error) - CancelZonalShiftRequest(*arczonalshift.CancelZonalShiftInput) (*request.Request, *arczonalshift.CancelZonalShiftOutput) - - GetManagedResource(*arczonalshift.GetManagedResourceInput) (*arczonalshift.GetManagedResourceOutput, error) - GetManagedResourceWithContext(aws.Context, *arczonalshift.GetManagedResourceInput, ...request.Option) (*arczonalshift.GetManagedResourceOutput, error) - GetManagedResourceRequest(*arczonalshift.GetManagedResourceInput) (*request.Request, *arczonalshift.GetManagedResourceOutput) - - ListManagedResources(*arczonalshift.ListManagedResourcesInput) (*arczonalshift.ListManagedResourcesOutput, error) - ListManagedResourcesWithContext(aws.Context, *arczonalshift.ListManagedResourcesInput, ...request.Option) (*arczonalshift.ListManagedResourcesOutput, error) - ListManagedResourcesRequest(*arczonalshift.ListManagedResourcesInput) (*request.Request, *arczonalshift.ListManagedResourcesOutput) - - ListManagedResourcesPages(*arczonalshift.ListManagedResourcesInput, func(*arczonalshift.ListManagedResourcesOutput, bool) bool) error - ListManagedResourcesPagesWithContext(aws.Context, *arczonalshift.ListManagedResourcesInput, func(*arczonalshift.ListManagedResourcesOutput, bool) bool, ...request.Option) error - - ListZonalShifts(*arczonalshift.ListZonalShiftsInput) (*arczonalshift.ListZonalShiftsOutput, error) - ListZonalShiftsWithContext(aws.Context, *arczonalshift.ListZonalShiftsInput, ...request.Option) (*arczonalshift.ListZonalShiftsOutput, error) - ListZonalShiftsRequest(*arczonalshift.ListZonalShiftsInput) (*request.Request, *arczonalshift.ListZonalShiftsOutput) - - ListZonalShiftsPages(*arczonalshift.ListZonalShiftsInput, func(*arczonalshift.ListZonalShiftsOutput, bool) bool) error - ListZonalShiftsPagesWithContext(aws.Context, *arczonalshift.ListZonalShiftsInput, func(*arczonalshift.ListZonalShiftsOutput, bool) bool, ...request.Option) error - - StartZonalShift(*arczonalshift.StartZonalShiftInput) (*arczonalshift.StartZonalShiftOutput, error) - StartZonalShiftWithContext(aws.Context, *arczonalshift.StartZonalShiftInput, ...request.Option) (*arczonalshift.StartZonalShiftOutput, error) - StartZonalShiftRequest(*arczonalshift.StartZonalShiftInput) (*request.Request, *arczonalshift.StartZonalShiftOutput) - - UpdateZonalShift(*arczonalshift.UpdateZonalShiftInput) (*arczonalshift.UpdateZonalShiftOutput, error) - UpdateZonalShiftWithContext(aws.Context, *arczonalshift.UpdateZonalShiftInput, ...request.Option) (*arczonalshift.UpdateZonalShiftOutput, error) - UpdateZonalShiftRequest(*arczonalshift.UpdateZonalShiftInput) (*request.Request, *arczonalshift.UpdateZonalShiftOutput) -} - -var _ ARCZonalShiftAPI = (*arczonalshift.ARCZonalShift)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/doc.go deleted file mode 100644 index 49ecbbeaa420..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/doc.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package arczonalshift provides the client and types for making API -// requests to AWS ARC - Zonal Shift. -// -// This is the API Reference Guide for the zonal shift feature of Amazon Route -// 53 Application Recovery Controller. This guide is for developers who need -// detailed information about zonal shift API actions, data types, and errors. -// -// Zonal shift is in preview release for Amazon Route 53 Application Recovery -// Controller and is subject to change. -// -// Zonal shift in Route 53 ARC enables you to move traffic for a load balancer -// resource away from an Availability Zone. Starting a zonal shift helps your -// application recover immediately, for example, from a developer's bad code -// deployment or from an AWS infrastructure failure in a single Availability -// Zone, reducing the impact and time lost from an issue in one zone. -// -// Supported AWS resources are automatically registered with Route 53 ARC. Resources -// that are registered for zonal shifts in Route 53 ARC are managed resources -// in Route 53 ARC. You can start a zonal shift for any managed resource in -// your account in a Region. At this time, you can only start a zonal shift -// for Network Load Balancers and Application Load Balancers with cross-zone -// load balancing turned off. -// -// Zonal shifts are temporary. You must specify an expiration when you start -// a zonal shift, of up to three days initially. If you want to still keep traffic -// away from an Availability Zone, you can update the zonal shift and set a -// new expiration. You can also cancel a zonal shift, before it expires, for -// example, if you're ready to restore traffic to the Availability Zone. -// -// For more information about using zonal shift, see the Amazon Route 53 Application -// Recovery Controller Developer Guide (https://docs.aws.amazon.com/r53recovery/latest/dg/what-is-route53-recovery.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/arc-zonal-shift-2022-10-30 for more information on this service. -// -// See arczonalshift package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/arczonalshift/ -// -// # Using the Client -// -// To contact AWS ARC - Zonal Shift with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS ARC - Zonal Shift client ARCZonalShift for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/arczonalshift/#New -package arczonalshift diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/errors.go deleted file mode 100644 index 3a7537852de3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/errors.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package arczonalshift - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request could not be processed because of conflict in the current state - // of the resource. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // There was an internal server error. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The input requested a resource that was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/service.go deleted file mode 100644 index 366c93c58e2f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/arczonalshift/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package arczonalshift - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// ARCZonalShift provides the API operation methods for making requests to -// AWS ARC - Zonal Shift. See this package's package overview docs -// for details on the service. -// -// ARCZonalShift methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ARCZonalShift struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ARC Zonal Shift" // Name of service. - EndpointsID = "arc-zonal-shift" // ID to lookup a service endpoint with. - ServiceID = "ARC Zonal Shift" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the ARCZonalShift client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a ARCZonalShift client from just a session. -// svc := arczonalshift.New(mySession) -// -// // Create a ARCZonalShift client with additional configuration -// svc := arczonalshift.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ARCZonalShift { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "arc-zonal-shift" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ARCZonalShift { - svc := &ARCZonalShift{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-10-30", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ARCZonalShift operation and runs any -// custom request initialization. -func (c *ARCZonalShift) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/api.go deleted file mode 100644 index 30324ce5e3c9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/api.go +++ /dev/null @@ -1,8416 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package b2bi - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opCreateCapability = "CreateCapability" - -// CreateCapabilityRequest generates a "aws/request.Request" representing the -// client's request for the CreateCapability 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 CreateCapability for more information on using the CreateCapability -// 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 CreateCapabilityRequest method. -// req, resp := client.CreateCapabilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreateCapability -func (c *B2bi) CreateCapabilityRequest(input *CreateCapabilityInput) (req *request.Request, output *CreateCapabilityOutput) { - op := &request.Operation{ - Name: opCreateCapability, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCapabilityInput{} - } - - output = &CreateCapabilityOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCapability API operation for AWS B2B Data Interchange. -// -// Instantiates a capability based on the specified parameters. Capabilities -// contain the information necessary to process incoming EDI (electronic data -// interchange) documents. -// -// 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 AWS B2B Data Interchange's -// API operation CreateCapability for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - ServiceQuotaExceededException -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreateCapability -func (c *B2bi) CreateCapability(input *CreateCapabilityInput) (*CreateCapabilityOutput, error) { - req, out := c.CreateCapabilityRequest(input) - return out, req.Send() -} - -// CreateCapabilityWithContext is the same as CreateCapability with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCapability 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 *B2bi) CreateCapabilityWithContext(ctx aws.Context, input *CreateCapabilityInput, opts ...request.Option) (*CreateCapabilityOutput, error) { - req, out := c.CreateCapabilityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePartnership = "CreatePartnership" - -// CreatePartnershipRequest generates a "aws/request.Request" representing the -// client's request for the CreatePartnership 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 CreatePartnership for more information on using the CreatePartnership -// 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 CreatePartnershipRequest method. -// req, resp := client.CreatePartnershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreatePartnership -func (c *B2bi) CreatePartnershipRequest(input *CreatePartnershipInput) (req *request.Request, output *CreatePartnershipOutput) { - op := &request.Operation{ - Name: opCreatePartnership, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePartnershipInput{} - } - - output = &CreatePartnershipOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePartnership API operation for AWS B2B Data Interchange. -// -// Creates a partnership between a customer and a trading partner, based on -// the supplied parameters. Partnerships link trading partners with your profile -// and a specific transformer, so that the EDI (electronic data interchange) -// documents that they upload to Amazon S3 can be processed according to their -// specifications. -// -// 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 AWS B2B Data Interchange's -// API operation CreatePartnership for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - ServiceQuotaExceededException -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreatePartnership -func (c *B2bi) CreatePartnership(input *CreatePartnershipInput) (*CreatePartnershipOutput, error) { - req, out := c.CreatePartnershipRequest(input) - return out, req.Send() -} - -// CreatePartnershipWithContext is the same as CreatePartnership with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePartnership 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 *B2bi) CreatePartnershipWithContext(ctx aws.Context, input *CreatePartnershipInput, opts ...request.Option) (*CreatePartnershipOutput, error) { - req, out := c.CreatePartnershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateProfile = "CreateProfile" - -// CreateProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateProfile 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 CreateProfile for more information on using the CreateProfile -// 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 CreateProfileRequest method. -// req, resp := client.CreateProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreateProfile -func (c *B2bi) CreateProfileRequest(input *CreateProfileInput) (req *request.Request, output *CreateProfileOutput) { - op := &request.Operation{ - Name: opCreateProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateProfileInput{} - } - - output = &CreateProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateProfile API operation for AWS B2B Data Interchange. -// -// Creates a customer profile. You can have up to five customer profiles, each -// representing a distinct private network. Profiles contain basic information -// about you and your business. -// -// 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 AWS B2B Data Interchange's -// API operation CreateProfile for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - ServiceQuotaExceededException -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreateProfile -func (c *B2bi) CreateProfile(input *CreateProfileInput) (*CreateProfileOutput, error) { - req, out := c.CreateProfileRequest(input) - return out, req.Send() -} - -// CreateProfileWithContext is the same as CreateProfile with the addition of -// the ability to pass a context and additional request options. -// -// See CreateProfile 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 *B2bi) CreateProfileWithContext(ctx aws.Context, input *CreateProfileInput, opts ...request.Option) (*CreateProfileOutput, error) { - req, out := c.CreateProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTransformer = "CreateTransformer" - -// CreateTransformerRequest generates a "aws/request.Request" representing the -// client's request for the CreateTransformer 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 CreateTransformer for more information on using the CreateTransformer -// 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 CreateTransformerRequest method. -// req, resp := client.CreateTransformerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreateTransformer -func (c *B2bi) CreateTransformerRequest(input *CreateTransformerInput) (req *request.Request, output *CreateTransformerOutput) { - op := &request.Operation{ - Name: opCreateTransformer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTransformerInput{} - } - - output = &CreateTransformerOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTransformer API operation for AWS B2B Data Interchange. -// -// Creates a transformer. Transformers describe how to process the incoming -// EDI (electronic data interchange) documents, and extract the necessary information. -// -// 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 AWS B2B Data Interchange's -// API operation CreateTransformer for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - ServiceQuotaExceededException -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/CreateTransformer -func (c *B2bi) CreateTransformer(input *CreateTransformerInput) (*CreateTransformerOutput, error) { - req, out := c.CreateTransformerRequest(input) - return out, req.Send() -} - -// CreateTransformerWithContext is the same as CreateTransformer with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTransformer 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 *B2bi) CreateTransformerWithContext(ctx aws.Context, input *CreateTransformerInput, opts ...request.Option) (*CreateTransformerOutput, error) { - req, out := c.CreateTransformerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCapability = "DeleteCapability" - -// DeleteCapabilityRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCapability 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 DeleteCapability for more information on using the DeleteCapability -// 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 DeleteCapabilityRequest method. -// req, resp := client.DeleteCapabilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/DeleteCapability -func (c *B2bi) DeleteCapabilityRequest(input *DeleteCapabilityInput) (req *request.Request, output *DeleteCapabilityOutput) { - op := &request.Operation{ - Name: opDeleteCapability, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCapabilityInput{} - } - - output = &DeleteCapabilityOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCapability API operation for AWS B2B Data Interchange. -// -// Deletes the specified capability. Capabilities contain the information necessary -// to process incoming EDI (electronic data interchange) documents. -// -// 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 AWS B2B Data Interchange's -// API operation DeleteCapability for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/DeleteCapability -func (c *B2bi) DeleteCapability(input *DeleteCapabilityInput) (*DeleteCapabilityOutput, error) { - req, out := c.DeleteCapabilityRequest(input) - return out, req.Send() -} - -// DeleteCapabilityWithContext is the same as DeleteCapability with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCapability 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 *B2bi) DeleteCapabilityWithContext(ctx aws.Context, input *DeleteCapabilityInput, opts ...request.Option) (*DeleteCapabilityOutput, error) { - req, out := c.DeleteCapabilityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePartnership = "DeletePartnership" - -// DeletePartnershipRequest generates a "aws/request.Request" representing the -// client's request for the DeletePartnership 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 DeletePartnership for more information on using the DeletePartnership -// 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 DeletePartnershipRequest method. -// req, resp := client.DeletePartnershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/DeletePartnership -func (c *B2bi) DeletePartnershipRequest(input *DeletePartnershipInput) (req *request.Request, output *DeletePartnershipOutput) { - op := &request.Operation{ - Name: opDeletePartnership, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePartnershipInput{} - } - - output = &DeletePartnershipOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePartnership API operation for AWS B2B Data Interchange. -// -// Deletes the specified partnership. Partnerships link trading partners with -// your profile and a specific transformer, so that the EDI (electronic data -// interchange) documents that they upload to Amazon S3 can be processed according -// to their specifications. -// -// 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 AWS B2B Data Interchange's -// API operation DeletePartnership for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/DeletePartnership -func (c *B2bi) DeletePartnership(input *DeletePartnershipInput) (*DeletePartnershipOutput, error) { - req, out := c.DeletePartnershipRequest(input) - return out, req.Send() -} - -// DeletePartnershipWithContext is the same as DeletePartnership with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePartnership 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 *B2bi) DeletePartnershipWithContext(ctx aws.Context, input *DeletePartnershipInput, opts ...request.Option) (*DeletePartnershipOutput, error) { - req, out := c.DeletePartnershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteProfile = "DeleteProfile" - -// DeleteProfileRequest generates a "aws/request.Request" representing the -// client's request for the DeleteProfile 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 DeleteProfile for more information on using the DeleteProfile -// 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 DeleteProfileRequest method. -// req, resp := client.DeleteProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/DeleteProfile -func (c *B2bi) DeleteProfileRequest(input *DeleteProfileInput) (req *request.Request, output *DeleteProfileOutput) { - op := &request.Operation{ - Name: opDeleteProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteProfileInput{} - } - - output = &DeleteProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteProfile API operation for AWS B2B Data Interchange. -// -// Deletes the specified profile. Profiles contain basic information about you -// and your business. -// -// 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 AWS B2B Data Interchange's -// API operation DeleteProfile for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/DeleteProfile -func (c *B2bi) DeleteProfile(input *DeleteProfileInput) (*DeleteProfileOutput, error) { - req, out := c.DeleteProfileRequest(input) - return out, req.Send() -} - -// DeleteProfileWithContext is the same as DeleteProfile with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteProfile 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 *B2bi) DeleteProfileWithContext(ctx aws.Context, input *DeleteProfileInput, opts ...request.Option) (*DeleteProfileOutput, error) { - req, out := c.DeleteProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTransformer = "DeleteTransformer" - -// DeleteTransformerRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTransformer 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 DeleteTransformer for more information on using the DeleteTransformer -// 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 DeleteTransformerRequest method. -// req, resp := client.DeleteTransformerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/DeleteTransformer -func (c *B2bi) DeleteTransformerRequest(input *DeleteTransformerInput) (req *request.Request, output *DeleteTransformerOutput) { - op := &request.Operation{ - Name: opDeleteTransformer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTransformerInput{} - } - - output = &DeleteTransformerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTransformer API operation for AWS B2B Data Interchange. -// -// Deletes the specified transformer. Transformers describe how to process the -// incoming EDI (electronic data interchange) documents, and extract the necessary -// information. -// -// 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 AWS B2B Data Interchange's -// API operation DeleteTransformer for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/DeleteTransformer -func (c *B2bi) DeleteTransformer(input *DeleteTransformerInput) (*DeleteTransformerOutput, error) { - req, out := c.DeleteTransformerRequest(input) - return out, req.Send() -} - -// DeleteTransformerWithContext is the same as DeleteTransformer with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTransformer 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 *B2bi) DeleteTransformerWithContext(ctx aws.Context, input *DeleteTransformerInput, opts ...request.Option) (*DeleteTransformerOutput, error) { - req, out := c.DeleteTransformerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCapability = "GetCapability" - -// GetCapabilityRequest generates a "aws/request.Request" representing the -// client's request for the GetCapability 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 GetCapability for more information on using the GetCapability -// 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 GetCapabilityRequest method. -// req, resp := client.GetCapabilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetCapability -func (c *B2bi) GetCapabilityRequest(input *GetCapabilityInput) (req *request.Request, output *GetCapabilityOutput) { - op := &request.Operation{ - Name: opGetCapability, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCapabilityInput{} - } - - output = &GetCapabilityOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCapability API operation for AWS B2B Data Interchange. -// -// Retrieves the details for the specified capability. Capabilities contain -// the information necessary to process incoming EDI (electronic data interchange) -// documents. -// -// 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 AWS B2B Data Interchange's -// API operation GetCapability for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetCapability -func (c *B2bi) GetCapability(input *GetCapabilityInput) (*GetCapabilityOutput, error) { - req, out := c.GetCapabilityRequest(input) - return out, req.Send() -} - -// GetCapabilityWithContext is the same as GetCapability with the addition of -// the ability to pass a context and additional request options. -// -// See GetCapability 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 *B2bi) GetCapabilityWithContext(ctx aws.Context, input *GetCapabilityInput, opts ...request.Option) (*GetCapabilityOutput, error) { - req, out := c.GetCapabilityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPartnership = "GetPartnership" - -// GetPartnershipRequest generates a "aws/request.Request" representing the -// client's request for the GetPartnership 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 GetPartnership for more information on using the GetPartnership -// 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 GetPartnershipRequest method. -// req, resp := client.GetPartnershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetPartnership -func (c *B2bi) GetPartnershipRequest(input *GetPartnershipInput) (req *request.Request, output *GetPartnershipOutput) { - op := &request.Operation{ - Name: opGetPartnership, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPartnershipInput{} - } - - output = &GetPartnershipOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPartnership API operation for AWS B2B Data Interchange. -// -// Retrieves the details for a partnership, based on the partner and profile -// IDs specified. Partnerships link trading partners with your profile and a -// specific transformer, so that the EDI (electronic data interchange) documents -// that they upload to Amazon S3 can be processed according to their specifications. -// -// 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 AWS B2B Data Interchange's -// API operation GetPartnership for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetPartnership -func (c *B2bi) GetPartnership(input *GetPartnershipInput) (*GetPartnershipOutput, error) { - req, out := c.GetPartnershipRequest(input) - return out, req.Send() -} - -// GetPartnershipWithContext is the same as GetPartnership with the addition of -// the ability to pass a context and additional request options. -// -// See GetPartnership 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 *B2bi) GetPartnershipWithContext(ctx aws.Context, input *GetPartnershipInput, opts ...request.Option) (*GetPartnershipOutput, error) { - req, out := c.GetPartnershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetProfile = "GetProfile" - -// GetProfileRequest generates a "aws/request.Request" representing the -// client's request for the GetProfile 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 GetProfile for more information on using the GetProfile -// 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 GetProfileRequest method. -// req, resp := client.GetProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetProfile -func (c *B2bi) GetProfileRequest(input *GetProfileInput) (req *request.Request, output *GetProfileOutput) { - op := &request.Operation{ - Name: opGetProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetProfileInput{} - } - - output = &GetProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetProfile API operation for AWS B2B Data Interchange. -// -// Retrieves the details for the profile specified by the profile ID. Profiles -// contain basic information about you and your business. -// -// 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 AWS B2B Data Interchange's -// API operation GetProfile for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetProfile -func (c *B2bi) GetProfile(input *GetProfileInput) (*GetProfileOutput, error) { - req, out := c.GetProfileRequest(input) - return out, req.Send() -} - -// GetProfileWithContext is the same as GetProfile with the addition of -// the ability to pass a context and additional request options. -// -// See GetProfile 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 *B2bi) GetProfileWithContext(ctx aws.Context, input *GetProfileInput, opts ...request.Option) (*GetProfileOutput, error) { - req, out := c.GetProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTransformer = "GetTransformer" - -// GetTransformerRequest generates a "aws/request.Request" representing the -// client's request for the GetTransformer 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 GetTransformer for more information on using the GetTransformer -// 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 GetTransformerRequest method. -// req, resp := client.GetTransformerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetTransformer -func (c *B2bi) GetTransformerRequest(input *GetTransformerInput) (req *request.Request, output *GetTransformerOutput) { - op := &request.Operation{ - Name: opGetTransformer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTransformerInput{} - } - - output = &GetTransformerOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTransformer API operation for AWS B2B Data Interchange. -// -// Retrieves the details for the transformer specified by the transformer ID. -// Transformers describe how to process the incoming EDI (electronic data interchange) -// documents, and extract the necessary information. -// -// 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 AWS B2B Data Interchange's -// API operation GetTransformer for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetTransformer -func (c *B2bi) GetTransformer(input *GetTransformerInput) (*GetTransformerOutput, error) { - req, out := c.GetTransformerRequest(input) - return out, req.Send() -} - -// GetTransformerWithContext is the same as GetTransformer with the addition of -// the ability to pass a context and additional request options. -// -// See GetTransformer 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 *B2bi) GetTransformerWithContext(ctx aws.Context, input *GetTransformerInput, opts ...request.Option) (*GetTransformerOutput, error) { - req, out := c.GetTransformerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTransformerJob = "GetTransformerJob" - -// GetTransformerJobRequest generates a "aws/request.Request" representing the -// client's request for the GetTransformerJob 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 GetTransformerJob for more information on using the GetTransformerJob -// 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 GetTransformerJobRequest method. -// req, resp := client.GetTransformerJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetTransformerJob -func (c *B2bi) GetTransformerJobRequest(input *GetTransformerJobInput) (req *request.Request, output *GetTransformerJobOutput) { - op := &request.Operation{ - Name: opGetTransformerJob, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTransformerJobInput{} - } - - output = &GetTransformerJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTransformerJob API operation for AWS B2B Data Interchange. -// -// Returns the details of the transformer run, based on the Transformer job -// ID. -// -// 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 AWS B2B Data Interchange's -// API operation GetTransformerJob for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/GetTransformerJob -func (c *B2bi) GetTransformerJob(input *GetTransformerJobInput) (*GetTransformerJobOutput, error) { - req, out := c.GetTransformerJobRequest(input) - return out, req.Send() -} - -// GetTransformerJobWithContext is the same as GetTransformerJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetTransformerJob 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 *B2bi) GetTransformerJobWithContext(ctx aws.Context, input *GetTransformerJobInput, opts ...request.Option) (*GetTransformerJobOutput, error) { - req, out := c.GetTransformerJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCapabilities = "ListCapabilities" - -// ListCapabilitiesRequest generates a "aws/request.Request" representing the -// client's request for the ListCapabilities 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 ListCapabilities for more information on using the ListCapabilities -// 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 ListCapabilitiesRequest method. -// req, resp := client.ListCapabilitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListCapabilities -func (c *B2bi) ListCapabilitiesRequest(input *ListCapabilitiesInput) (req *request.Request, output *ListCapabilitiesOutput) { - op := &request.Operation{ - Name: opListCapabilities, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCapabilitiesInput{} - } - - output = &ListCapabilitiesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCapabilities API operation for AWS B2B Data Interchange. -// -// Lists the capabilities associated with your Amazon Web Services account for -// your current or specified region. Capabilities contain the information necessary -// to process incoming EDI (electronic data interchange) documents. -// -// 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 AWS B2B Data Interchange's -// API operation ListCapabilities for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListCapabilities -func (c *B2bi) ListCapabilities(input *ListCapabilitiesInput) (*ListCapabilitiesOutput, error) { - req, out := c.ListCapabilitiesRequest(input) - return out, req.Send() -} - -// ListCapabilitiesWithContext is the same as ListCapabilities with the addition of -// the ability to pass a context and additional request options. -// -// See ListCapabilities 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 *B2bi) ListCapabilitiesWithContext(ctx aws.Context, input *ListCapabilitiesInput, opts ...request.Option) (*ListCapabilitiesOutput, error) { - req, out := c.ListCapabilitiesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCapabilitiesPages iterates over the pages of a ListCapabilities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCapabilities method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCapabilities operation. -// pageNum := 0 -// err := client.ListCapabilitiesPages(params, -// func(page *b2bi.ListCapabilitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *B2bi) ListCapabilitiesPages(input *ListCapabilitiesInput, fn func(*ListCapabilitiesOutput, bool) bool) error { - return c.ListCapabilitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCapabilitiesPagesWithContext same as ListCapabilitiesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *B2bi) ListCapabilitiesPagesWithContext(ctx aws.Context, input *ListCapabilitiesInput, fn func(*ListCapabilitiesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCapabilitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCapabilitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCapabilitiesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPartnerships = "ListPartnerships" - -// ListPartnershipsRequest generates a "aws/request.Request" representing the -// client's request for the ListPartnerships 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 ListPartnerships for more information on using the ListPartnerships -// 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 ListPartnershipsRequest method. -// req, resp := client.ListPartnershipsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListPartnerships -func (c *B2bi) ListPartnershipsRequest(input *ListPartnershipsInput) (req *request.Request, output *ListPartnershipsOutput) { - op := &request.Operation{ - Name: opListPartnerships, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPartnershipsInput{} - } - - output = &ListPartnershipsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPartnerships API operation for AWS B2B Data Interchange. -// -// Lists the partnerships associated with your Amazon Web Services account for -// your current or specified region. Partnerships link trading partners with -// your profile and a specific transformer, so that the EDI (electronic data -// interchange) documents that they upload to Amazon S3 can be processed according -// to their specifications. -// -// 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 AWS B2B Data Interchange's -// API operation ListPartnerships for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListPartnerships -func (c *B2bi) ListPartnerships(input *ListPartnershipsInput) (*ListPartnershipsOutput, error) { - req, out := c.ListPartnershipsRequest(input) - return out, req.Send() -} - -// ListPartnershipsWithContext is the same as ListPartnerships with the addition of -// the ability to pass a context and additional request options. -// -// See ListPartnerships 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 *B2bi) ListPartnershipsWithContext(ctx aws.Context, input *ListPartnershipsInput, opts ...request.Option) (*ListPartnershipsOutput, error) { - req, out := c.ListPartnershipsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPartnershipsPages iterates over the pages of a ListPartnerships operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPartnerships method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPartnerships operation. -// pageNum := 0 -// err := client.ListPartnershipsPages(params, -// func(page *b2bi.ListPartnershipsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *B2bi) ListPartnershipsPages(input *ListPartnershipsInput, fn func(*ListPartnershipsOutput, bool) bool) error { - return c.ListPartnershipsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPartnershipsPagesWithContext same as ListPartnershipsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *B2bi) ListPartnershipsPagesWithContext(ctx aws.Context, input *ListPartnershipsInput, fn func(*ListPartnershipsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPartnershipsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPartnershipsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPartnershipsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProfiles = "ListProfiles" - -// ListProfilesRequest generates a "aws/request.Request" representing the -// client's request for the ListProfiles 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 ListProfiles for more information on using the ListProfiles -// 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 ListProfilesRequest method. -// req, resp := client.ListProfilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListProfiles -func (c *B2bi) ListProfilesRequest(input *ListProfilesInput) (req *request.Request, output *ListProfilesOutput) { - op := &request.Operation{ - Name: opListProfiles, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProfilesInput{} - } - - output = &ListProfilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProfiles API operation for AWS B2B Data Interchange. -// -// Lists the profiles associated with your Amazon Web Services account for your -// current or specified region. Profiles contain basic information about you -// and your business. -// -// 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 AWS B2B Data Interchange's -// API operation ListProfiles for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListProfiles -func (c *B2bi) ListProfiles(input *ListProfilesInput) (*ListProfilesOutput, error) { - req, out := c.ListProfilesRequest(input) - return out, req.Send() -} - -// ListProfilesWithContext is the same as ListProfiles with the addition of -// the ability to pass a context and additional request options. -// -// See ListProfiles 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 *B2bi) ListProfilesWithContext(ctx aws.Context, input *ListProfilesInput, opts ...request.Option) (*ListProfilesOutput, error) { - req, out := c.ListProfilesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProfilesPages iterates over the pages of a ListProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProfiles method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProfiles operation. -// pageNum := 0 -// err := client.ListProfilesPages(params, -// func(page *b2bi.ListProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *B2bi) ListProfilesPages(input *ListProfilesInput, fn func(*ListProfilesOutput, bool) bool) error { - return c.ListProfilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProfilesPagesWithContext same as ListProfilesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *B2bi) ListProfilesPagesWithContext(ctx aws.Context, input *ListProfilesInput, fn func(*ListProfilesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProfilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProfilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProfilesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListTagsForResource -func (c *B2bi) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS B2B Data Interchange. -// -// Lists all of the tags associated with the Amazon Resource Name (ARN) that -// you specify. The resource can be a capability, partnership, profile, or transformer. -// -// 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 AWS B2B Data Interchange's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListTagsForResource -func (c *B2bi) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *B2bi) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTransformers = "ListTransformers" - -// ListTransformersRequest generates a "aws/request.Request" representing the -// client's request for the ListTransformers 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 ListTransformers for more information on using the ListTransformers -// 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 ListTransformersRequest method. -// req, resp := client.ListTransformersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListTransformers -func (c *B2bi) ListTransformersRequest(input *ListTransformersInput) (req *request.Request, output *ListTransformersOutput) { - op := &request.Operation{ - Name: opListTransformers, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTransformersInput{} - } - - output = &ListTransformersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTransformers API operation for AWS B2B Data Interchange. -// -// Lists the available transformers. Transformers describe how to process the -// incoming EDI (electronic data interchange) documents, and extract the necessary -// information. -// -// 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 AWS B2B Data Interchange's -// API operation ListTransformers for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/ListTransformers -func (c *B2bi) ListTransformers(input *ListTransformersInput) (*ListTransformersOutput, error) { - req, out := c.ListTransformersRequest(input) - return out, req.Send() -} - -// ListTransformersWithContext is the same as ListTransformers with the addition of -// the ability to pass a context and additional request options. -// -// See ListTransformers 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 *B2bi) ListTransformersWithContext(ctx aws.Context, input *ListTransformersInput, opts ...request.Option) (*ListTransformersOutput, error) { - req, out := c.ListTransformersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTransformersPages iterates over the pages of a ListTransformers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTransformers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTransformers operation. -// pageNum := 0 -// err := client.ListTransformersPages(params, -// func(page *b2bi.ListTransformersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *B2bi) ListTransformersPages(input *ListTransformersInput, fn func(*ListTransformersOutput, bool) bool) error { - return c.ListTransformersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTransformersPagesWithContext same as ListTransformersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *B2bi) ListTransformersPagesWithContext(ctx aws.Context, input *ListTransformersInput, fn func(*ListTransformersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTransformersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTransformersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTransformersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartTransformerJob = "StartTransformerJob" - -// StartTransformerJobRequest generates a "aws/request.Request" representing the -// client's request for the StartTransformerJob 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 StartTransformerJob for more information on using the StartTransformerJob -// 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 StartTransformerJobRequest method. -// req, resp := client.StartTransformerJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/StartTransformerJob -func (c *B2bi) StartTransformerJobRequest(input *StartTransformerJobInput) (req *request.Request, output *StartTransformerJobOutput) { - op := &request.Operation{ - Name: opStartTransformerJob, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartTransformerJobInput{} - } - - output = &StartTransformerJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartTransformerJob API operation for AWS B2B Data Interchange. -// -// Runs a job, using a transformer, to parse input EDI (electronic data interchange) -// file into the output structures used by Amazon Web Services B2BI Data Interchange. -// -// 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 AWS B2B Data Interchange's -// API operation StartTransformerJob for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/StartTransformerJob -func (c *B2bi) StartTransformerJob(input *StartTransformerJobInput) (*StartTransformerJobOutput, error) { - req, out := c.StartTransformerJobRequest(input) - return out, req.Send() -} - -// StartTransformerJobWithContext is the same as StartTransformerJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartTransformerJob 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 *B2bi) StartTransformerJobWithContext(ctx aws.Context, input *StartTransformerJobInput, opts ...request.Option) (*StartTransformerJobOutput, error) { - req, out := c.StartTransformerJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/TagResource -func (c *B2bi) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS B2B Data Interchange. -// -// Attaches a key-value pair to a resource, as identified by its Amazon Resource -// Name (ARN). Resources are capability, partnership, profile, transformers -// and other entities. -// -// There is no response returned from this call. -// -// 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 AWS B2B Data Interchange's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/TagResource -func (c *B2bi) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *B2bi) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTestMapping = "TestMapping" - -// TestMappingRequest generates a "aws/request.Request" representing the -// client's request for the TestMapping 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 TestMapping for more information on using the TestMapping -// 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 TestMappingRequest method. -// req, resp := client.TestMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/TestMapping -func (c *B2bi) TestMappingRequest(input *TestMappingInput) (req *request.Request, output *TestMappingOutput) { - op := &request.Operation{ - Name: opTestMapping, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TestMappingInput{} - } - - output = &TestMappingOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestMapping API operation for AWS B2B Data Interchange. -// -// Maps the input file according to the provided template file. -// -// 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 AWS B2B Data Interchange's -// API operation TestMapping for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/TestMapping -func (c *B2bi) TestMapping(input *TestMappingInput) (*TestMappingOutput, error) { - req, out := c.TestMappingRequest(input) - return out, req.Send() -} - -// TestMappingWithContext is the same as TestMapping with the addition of -// the ability to pass a context and additional request options. -// -// See TestMapping 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 *B2bi) TestMappingWithContext(ctx aws.Context, input *TestMappingInput, opts ...request.Option) (*TestMappingOutput, error) { - req, out := c.TestMappingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTestParsing = "TestParsing" - -// TestParsingRequest generates a "aws/request.Request" representing the -// client's request for the TestParsing 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 TestParsing for more information on using the TestParsing -// 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 TestParsingRequest method. -// req, resp := client.TestParsingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/TestParsing -func (c *B2bi) TestParsingRequest(input *TestParsingInput) (req *request.Request, output *TestParsingOutput) { - op := &request.Operation{ - Name: opTestParsing, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TestParsingInput{} - } - - output = &TestParsingOutput{} - req = c.newRequest(op, input, output) - return -} - -// TestParsing API operation for AWS B2B Data Interchange. -// -// Parses the input EDI (electronic data interchange) file. -// -// 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 AWS B2B Data Interchange's -// API operation TestParsing for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/TestParsing -func (c *B2bi) TestParsing(input *TestParsingInput) (*TestParsingOutput, error) { - req, out := c.TestParsingRequest(input) - return out, req.Send() -} - -// TestParsingWithContext is the same as TestParsing with the addition of -// the ability to pass a context and additional request options. -// -// See TestParsing 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 *B2bi) TestParsingWithContext(ctx aws.Context, input *TestParsingInput, opts ...request.Option) (*TestParsingOutput, error) { - req, out := c.TestParsingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UntagResource -func (c *B2bi) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS B2B Data Interchange. -// -// Detaches a key-value pair from the specified resource, as identified by its -// Amazon Resource Name (ARN). Resources are capability, partnership, profile, -// transformers and other entities. -// -// 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 AWS B2B Data Interchange's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UntagResource -func (c *B2bi) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *B2bi) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCapability = "UpdateCapability" - -// UpdateCapabilityRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCapability 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 UpdateCapability for more information on using the UpdateCapability -// 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 UpdateCapabilityRequest method. -// req, resp := client.UpdateCapabilityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UpdateCapability -func (c *B2bi) UpdateCapabilityRequest(input *UpdateCapabilityInput) (req *request.Request, output *UpdateCapabilityOutput) { - op := &request.Operation{ - Name: opUpdateCapability, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateCapabilityInput{} - } - - output = &UpdateCapabilityOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateCapability API operation for AWS B2B Data Interchange. -// -// Updates some of the parameters for a capability, based on the specified parameters. -// Capabilities contain the information necessary to process incoming EDI (electronic -// data interchange) documents. -// -// 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 AWS B2B Data Interchange's -// API operation UpdateCapability for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - ServiceQuotaExceededException -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UpdateCapability -func (c *B2bi) UpdateCapability(input *UpdateCapabilityInput) (*UpdateCapabilityOutput, error) { - req, out := c.UpdateCapabilityRequest(input) - return out, req.Send() -} - -// UpdateCapabilityWithContext is the same as UpdateCapability with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCapability 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 *B2bi) UpdateCapabilityWithContext(ctx aws.Context, input *UpdateCapabilityInput, opts ...request.Option) (*UpdateCapabilityOutput, error) { - req, out := c.UpdateCapabilityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePartnership = "UpdatePartnership" - -// UpdatePartnershipRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePartnership 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 UpdatePartnership for more information on using the UpdatePartnership -// 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 UpdatePartnershipRequest method. -// req, resp := client.UpdatePartnershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UpdatePartnership -func (c *B2bi) UpdatePartnershipRequest(input *UpdatePartnershipInput) (req *request.Request, output *UpdatePartnershipOutput) { - op := &request.Operation{ - Name: opUpdatePartnership, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdatePartnershipInput{} - } - - output = &UpdatePartnershipOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePartnership API operation for AWS B2B Data Interchange. -// -// Updates some of the parameters for a partnership between a customer and trading -// partner. Partnerships link trading partners with your profile and a specific -// transformer, so that the EDI (electronic data interchange) documents that -// they upload to Amazon S3 can be processed according to their specifications. -// -// 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 AWS B2B Data Interchange's -// API operation UpdatePartnership for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - ServiceQuotaExceededException -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UpdatePartnership -func (c *B2bi) UpdatePartnership(input *UpdatePartnershipInput) (*UpdatePartnershipOutput, error) { - req, out := c.UpdatePartnershipRequest(input) - return out, req.Send() -} - -// UpdatePartnershipWithContext is the same as UpdatePartnership with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePartnership 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 *B2bi) UpdatePartnershipWithContext(ctx aws.Context, input *UpdatePartnershipInput, opts ...request.Option) (*UpdatePartnershipOutput, error) { - req, out := c.UpdatePartnershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateProfile = "UpdateProfile" - -// UpdateProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProfile 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 UpdateProfile for more information on using the UpdateProfile -// 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 UpdateProfileRequest method. -// req, resp := client.UpdateProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UpdateProfile -func (c *B2bi) UpdateProfileRequest(input *UpdateProfileInput) (req *request.Request, output *UpdateProfileOutput) { - op := &request.Operation{ - Name: opUpdateProfile, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateProfileInput{} - } - - output = &UpdateProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateProfile API operation for AWS B2B Data Interchange. -// -// Updates the specified parameters for a profile. Profiles contain basic information -// about you and your business. -// -// 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 AWS B2B Data Interchange's -// API operation UpdateProfile for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - ServiceQuotaExceededException -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UpdateProfile -func (c *B2bi) UpdateProfile(input *UpdateProfileInput) (*UpdateProfileOutput, error) { - req, out := c.UpdateProfileRequest(input) - return out, req.Send() -} - -// UpdateProfileWithContext is the same as UpdateProfile with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateProfile 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 *B2bi) UpdateProfileWithContext(ctx aws.Context, input *UpdateProfileInput, opts ...request.Option) (*UpdateProfileOutput, error) { - req, out := c.UpdateProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTransformer = "UpdateTransformer" - -// UpdateTransformerRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTransformer 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 UpdateTransformer for more information on using the UpdateTransformer -// 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 UpdateTransformerRequest method. -// req, resp := client.UpdateTransformerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UpdateTransformer -func (c *B2bi) UpdateTransformerRequest(input *UpdateTransformerInput) (req *request.Request, output *UpdateTransformerOutput) { - op := &request.Operation{ - Name: opUpdateTransformer, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateTransformerInput{} - } - - output = &UpdateTransformerOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTransformer API operation for AWS B2B Data Interchange. -// -// Updates the specified parameters for a transformer. Transformers describe -// how to process the incoming EDI (electronic data interchange) documents, -// and extract the necessary information. -// -// 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 AWS B2B Data Interchange's -// API operation UpdateTransformer for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// Occurs when a B2BI object cannot be validated against a request from another -// object. -// -// - ThrottlingException -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -// -// - ResourceNotFoundException -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -// -// - ServiceQuotaExceededException -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -// -// - InternalServerException -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23/UpdateTransformer -func (c *B2bi) UpdateTransformer(input *UpdateTransformerInput) (*UpdateTransformerOutput, error) { - req, out := c.UpdateTransformerRequest(input) - return out, req.Send() -} - -// UpdateTransformerWithContext is the same as UpdateTransformer with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTransformer 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 *B2bi) UpdateTransformerWithContext(ctx aws.Context, input *UpdateTransformerInput, opts ...request.Option) (*UpdateTransformerOutput, error) { - req, out := c.UpdateTransformerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"10" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A capability object. Currently, only EDI (electronic data interchange) capabilities -// are supported. Capabilities contain the information necessary to process -// incoming EDI (electronic data interchange) documents. -type CapabilityConfiguration struct { - _ struct{} `type:"structure"` - - // An EDI (electronic data interchange) configuration object. - Edi *EdiConfiguration `locationName:"edi" 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 CapabilityConfiguration) 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 CapabilityConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CapabilityConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CapabilityConfiguration"} - if s.Edi != nil { - if err := s.Edi.Validate(); err != nil { - invalidParams.AddNested("Edi", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEdi sets the Edi field's value. -func (s *CapabilityConfiguration) SetEdi(v *EdiConfiguration) *CapabilityConfiguration { - s.Edi = v - return s -} - -// Returns the capability summary details. Capabilities contain the information -// necessary to process incoming EDI (electronic data interchange) documents. -type CapabilitySummary struct { - _ struct{} `type:"structure"` - - // Returns a system-assigned unique identifier for the capability. - // - // CapabilityId is a required field - CapabilityId *string `locationName:"capabilityId" min:"1" type:"string" required:"true"` - - // Returns a timestamp for creation date and time of the capability. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns a timestamp that identifies the most recent date and time that the - // capability was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The display name of the capability. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns the type of the capability. Currently, only edi is supported. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"CapabilityType"` -} - -// 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 CapabilitySummary) 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 CapabilitySummary) GoString() string { - return s.String() -} - -// SetCapabilityId sets the CapabilityId field's value. -func (s *CapabilitySummary) SetCapabilityId(v string) *CapabilitySummary { - s.CapabilityId = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CapabilitySummary) SetCreatedAt(v time.Time) *CapabilitySummary { - s.CreatedAt = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *CapabilitySummary) SetModifiedAt(v time.Time) *CapabilitySummary { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *CapabilitySummary) SetName(v string) *CapabilitySummary { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *CapabilitySummary) SetType(v string) *CapabilitySummary { - s.Type = &v - return s -} - -// A conflict exception is thrown when you attempt to delete a resource (such -// as a profile or a capability) that is being used by other resources. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"10" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateCapabilityInput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // Specifies a structure that contains the details for a capability. - // - // Configuration is a required field - Configuration *CapabilityConfiguration `locationName:"configuration" type:"structure" required:"true"` - - // Specifies one or more locations in Amazon S3, each specifying an EDI document - // that can be used with this capability. Each item contains the name of the - // bucket and the key, to identify the document's location. - InstructionsDocuments []*S3Location `locationName:"instructionsDocuments" type:"list"` - - // Specifies the name of the capability, used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Specifies the key-value pairs assigned to ARNs that you can use to group - // and search for resources by type. You can attach this metadata to resources - // (capabilities, partnerships, and so on) for any purpose. - Tags []*Tag `locationName:"tags" type:"list"` - - // Specifies the type of the capability. Currently, only edi is supported. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"CapabilityType"` -} - -// 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 CreateCapabilityInput) 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 CreateCapabilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCapabilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCapabilityInput"} - if s.Configuration == nil { - invalidParams.Add(request.NewErrParamRequired("Configuration")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - if s.InstructionsDocuments != nil { - for i, v := range s.InstructionsDocuments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InstructionsDocuments", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateCapabilityInput) SetClientToken(v string) *CreateCapabilityInput { - s.ClientToken = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *CreateCapabilityInput) SetConfiguration(v *CapabilityConfiguration) *CreateCapabilityInput { - s.Configuration = v - return s -} - -// SetInstructionsDocuments sets the InstructionsDocuments field's value. -func (s *CreateCapabilityInput) SetInstructionsDocuments(v []*S3Location) *CreateCapabilityInput { - s.InstructionsDocuments = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateCapabilityInput) SetName(v string) *CreateCapabilityInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateCapabilityInput) SetTags(v []*Tag) *CreateCapabilityInput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateCapabilityInput) SetType(v string) *CreateCapabilityInput { - s.Type = &v - return s -} - -type CreateCapabilityOutput struct { - _ struct{} `type:"structure"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // CapabilityArn is a required field - CapabilityArn *string `locationName:"capabilityArn" min:"1" type:"string" required:"true"` - - // Returns a system-assigned unique identifier for the capability. - // - // CapabilityId is a required field - CapabilityId *string `locationName:"capabilityId" min:"1" type:"string" required:"true"` - - // Returns a structure that contains the details for a capability. - // - // Configuration is a required field - Configuration *CapabilityConfiguration `locationName:"configuration" type:"structure" required:"true"` - - // Returns a timestamp for creation date and time of the capability. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns one or more locations in Amazon S3, each specifying an EDI document - // that can be used with this capability. Each item contains the name of the - // bucket and the key, to identify the document's location. - InstructionsDocuments []*S3Location `locationName:"instructionsDocuments" type:"list"` - - // Returns the name of the capability used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns the type of the capability. Currently, only edi is supported. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"CapabilityType"` -} - -// 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 CreateCapabilityOutput) 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 CreateCapabilityOutput) GoString() string { - return s.String() -} - -// SetCapabilityArn sets the CapabilityArn field's value. -func (s *CreateCapabilityOutput) SetCapabilityArn(v string) *CreateCapabilityOutput { - s.CapabilityArn = &v - return s -} - -// SetCapabilityId sets the CapabilityId field's value. -func (s *CreateCapabilityOutput) SetCapabilityId(v string) *CreateCapabilityOutput { - s.CapabilityId = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *CreateCapabilityOutput) SetConfiguration(v *CapabilityConfiguration) *CreateCapabilityOutput { - s.Configuration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateCapabilityOutput) SetCreatedAt(v time.Time) *CreateCapabilityOutput { - s.CreatedAt = &v - return s -} - -// SetInstructionsDocuments sets the InstructionsDocuments field's value. -func (s *CreateCapabilityOutput) SetInstructionsDocuments(v []*S3Location) *CreateCapabilityOutput { - s.InstructionsDocuments = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateCapabilityOutput) SetName(v string) *CreateCapabilityOutput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateCapabilityOutput) SetType(v string) *CreateCapabilityOutput { - s.Type = &v - return s -} - -type CreatePartnershipInput struct { - _ struct{} `type:"structure"` - - // Specifies a list of the capabilities associated with this partnership. - Capabilities []*string `locationName:"capabilities" type:"list"` - - // Reserved for future use. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // Specifies the email address associated with this trading partner. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreatePartnershipInput's - // String and GoString methods. - // - // Email is a required field - Email *string `locationName:"email" min:"5" type:"string" required:"true" sensitive:"true"` - - // Specifies a descriptive name for the partnership. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Specifies the phone number associated with the partnership. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreatePartnershipInput's - // String and GoString methods. - Phone *string `locationName:"phone" min:"7" type:"string" sensitive:"true"` - - // Specifies the unique, system-generated identifier for the profile connected - // to this partnership. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" type:"string" required:"true"` - - // Specifies the key-value pairs assigned to ARNs that you can use to group - // and search for resources by type. You can attach this metadata to resources - // (capabilities, partnerships, and so on) for any purpose. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreatePartnershipInput) 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 CreatePartnershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePartnershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePartnershipInput"} - if s.Email == nil { - invalidParams.Add(request.NewErrParamRequired("Email")) - } - if s.Email != nil && len(*s.Email) < 5 { - invalidParams.Add(request.NewErrParamMinLen("Email", 5)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Phone != nil && len(*s.Phone) < 7 { - invalidParams.Add(request.NewErrParamMinLen("Phone", 7)) - } - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilities sets the Capabilities field's value. -func (s *CreatePartnershipInput) SetCapabilities(v []*string) *CreatePartnershipInput { - s.Capabilities = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreatePartnershipInput) SetClientToken(v string) *CreatePartnershipInput { - s.ClientToken = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *CreatePartnershipInput) SetEmail(v string) *CreatePartnershipInput { - s.Email = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePartnershipInput) SetName(v string) *CreatePartnershipInput { - s.Name = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *CreatePartnershipInput) SetPhone(v string) *CreatePartnershipInput { - s.Phone = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *CreatePartnershipInput) SetProfileId(v string) *CreatePartnershipInput { - s.ProfileId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreatePartnershipInput) SetTags(v []*Tag) *CreatePartnershipInput { - s.Tags = v - return s -} - -type CreatePartnershipOutput struct { - _ struct{} `type:"structure"` - - // Returns one or more capabilities associated with this partnership. - Capabilities []*string `locationName:"capabilities" type:"list"` - - // Returns a timestamp for creation date and time of the partnership. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the email address associated with this trading partner. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreatePartnershipOutput's - // String and GoString methods. - Email *string `locationName:"email" min:"5" type:"string" sensitive:"true"` - - // Returns a descriptive name for the partnership. - Name *string `locationName:"name" min:"1" type:"string"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // PartnershipArn is a required field - PartnershipArn *string `locationName:"partnershipArn" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for a partnership. - // - // PartnershipId is a required field - PartnershipId *string `locationName:"partnershipId" min:"1" type:"string" required:"true"` - - // Returns the phone number associated with the partnership. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreatePartnershipOutput's - // String and GoString methods. - Phone *string `locationName:"phone" min:"7" type:"string" sensitive:"true"` - - // Returns the unique, system-generated identifier for the profile connected - // to this partnership. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for a trading partner. - TradingPartnerId *string `locationName:"tradingPartnerId" min:"1" 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 CreatePartnershipOutput) 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 CreatePartnershipOutput) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *CreatePartnershipOutput) SetCapabilities(v []*string) *CreatePartnershipOutput { - s.Capabilities = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreatePartnershipOutput) SetCreatedAt(v time.Time) *CreatePartnershipOutput { - s.CreatedAt = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *CreatePartnershipOutput) SetEmail(v string) *CreatePartnershipOutput { - s.Email = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePartnershipOutput) SetName(v string) *CreatePartnershipOutput { - s.Name = &v - return s -} - -// SetPartnershipArn sets the PartnershipArn field's value. -func (s *CreatePartnershipOutput) SetPartnershipArn(v string) *CreatePartnershipOutput { - s.PartnershipArn = &v - return s -} - -// SetPartnershipId sets the PartnershipId field's value. -func (s *CreatePartnershipOutput) SetPartnershipId(v string) *CreatePartnershipOutput { - s.PartnershipId = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *CreatePartnershipOutput) SetPhone(v string) *CreatePartnershipOutput { - s.Phone = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *CreatePartnershipOutput) SetProfileId(v string) *CreatePartnershipOutput { - s.ProfileId = &v - return s -} - -// SetTradingPartnerId sets the TradingPartnerId field's value. -func (s *CreatePartnershipOutput) SetTradingPartnerId(v string) *CreatePartnershipOutput { - s.TradingPartnerId = &v - return s -} - -type CreateProfileInput struct { - _ struct{} `type:"structure"` - - // Specifies the name for the business associated with this profile. - // - // BusinessName is a required field - BusinessName *string `locationName:"businessName" min:"1" type:"string" required:"true"` - - // Reserved for future use. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // Specifies the email address associated with this customer profile. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProfileInput's - // String and GoString methods. - Email *string `locationName:"email" min:"5" type:"string" sensitive:"true"` - - // Specifies whether or not logging is enabled for this profile. - // - // Logging is a required field - Logging *string `locationName:"logging" type:"string" required:"true" enum:"Logging"` - - // Specifies the name of the profile. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Specifies the phone number associated with the profile. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProfileInput's - // String and GoString methods. - // - // Phone is a required field - Phone *string `locationName:"phone" min:"7" type:"string" required:"true" sensitive:"true"` - - // Specifies the key-value pairs assigned to ARNs that you can use to group - // and search for resources by type. You can attach this metadata to resources - // (capabilities, partnerships, and so on) for any purpose. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateProfileInput) 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 CreateProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateProfileInput"} - if s.BusinessName == nil { - invalidParams.Add(request.NewErrParamRequired("BusinessName")) - } - if s.BusinessName != nil && len(*s.BusinessName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BusinessName", 1)) - } - if s.Email != nil && len(*s.Email) < 5 { - invalidParams.Add(request.NewErrParamMinLen("Email", 5)) - } - if s.Logging == nil { - invalidParams.Add(request.NewErrParamRequired("Logging")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Phone == nil { - invalidParams.Add(request.NewErrParamRequired("Phone")) - } - if s.Phone != nil && len(*s.Phone) < 7 { - invalidParams.Add(request.NewErrParamMinLen("Phone", 7)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBusinessName sets the BusinessName field's value. -func (s *CreateProfileInput) SetBusinessName(v string) *CreateProfileInput { - s.BusinessName = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateProfileInput) SetClientToken(v string) *CreateProfileInput { - s.ClientToken = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *CreateProfileInput) SetEmail(v string) *CreateProfileInput { - s.Email = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *CreateProfileInput) SetLogging(v string) *CreateProfileInput { - s.Logging = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateProfileInput) SetName(v string) *CreateProfileInput { - s.Name = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *CreateProfileInput) SetPhone(v string) *CreateProfileInput { - s.Phone = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateProfileInput) SetTags(v []*Tag) *CreateProfileInput { - s.Tags = v - return s -} - -type CreateProfileOutput struct { - _ struct{} `type:"structure"` - - // Returns the name for the business associated with this profile. - // - // BusinessName is a required field - BusinessName *string `locationName:"businessName" min:"1" type:"string" required:"true"` - - // Returns a timestamp representing the time the profile was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the email address associated with this customer profile. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProfileOutput's - // String and GoString methods. - Email *string `locationName:"email" min:"5" type:"string" sensitive:"true"` - - // Returns the name of the logging group. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // Returns whether or not logging is turned on for this profile. - Logging *string `locationName:"logging" type:"string" enum:"Logging"` - - // Returns the name of the profile, used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns the phone number associated with the profile. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProfileOutput's - // String and GoString methods. - // - // Phone is a required field - Phone *string `locationName:"phone" min:"7" type:"string" required:"true" sensitive:"true"` - - // Returns an Amazon Resource Name (ARN) for the profile. - // - // ProfileArn is a required field - ProfileArn *string `locationName:"profileArn" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for the profile. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" 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 CreateProfileOutput) 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 CreateProfileOutput) GoString() string { - return s.String() -} - -// SetBusinessName sets the BusinessName field's value. -func (s *CreateProfileOutput) SetBusinessName(v string) *CreateProfileOutput { - s.BusinessName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateProfileOutput) SetCreatedAt(v time.Time) *CreateProfileOutput { - s.CreatedAt = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *CreateProfileOutput) SetEmail(v string) *CreateProfileOutput { - s.Email = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CreateProfileOutput) SetLogGroupName(v string) *CreateProfileOutput { - s.LogGroupName = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *CreateProfileOutput) SetLogging(v string) *CreateProfileOutput { - s.Logging = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateProfileOutput) SetName(v string) *CreateProfileOutput { - s.Name = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *CreateProfileOutput) SetPhone(v string) *CreateProfileOutput { - s.Phone = &v - return s -} - -// SetProfileArn sets the ProfileArn field's value. -func (s *CreateProfileOutput) SetProfileArn(v string) *CreateProfileOutput { - s.ProfileArn = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *CreateProfileOutput) SetProfileId(v string) *CreateProfileOutput { - s.ProfileId = &v - return s -} - -type CreateTransformerInput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // Specifies the details for the EDI standard that is being used for the transformer. - // Currently, only X12 is supported. X12 is a set of standards and corresponding - // messages that define specific business documents. - // - // EdiType is a required field - EdiType *EdiType `locationName:"ediType" type:"structure" required:"true"` - - // Specifies that the currently supported file formats for EDI transformations - // are JSON and XML. - // - // FileFormat is a required field - FileFormat *string `locationName:"fileFormat" type:"string" required:"true" enum:"FileFormat"` - - // Specifies the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. - // - // MappingTemplate is a required field - MappingTemplate *string `locationName:"mappingTemplate" type:"string" required:"true"` - - // Specifies the name of the transformer, used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Specifies a sample EDI document that is used by a transformer as a guide - // for processing the EDI data. - SampleDocument *string `locationName:"sampleDocument" type:"string"` - - // Specifies the key-value pairs assigned to ARNs that you can use to group - // and search for resources by type. You can attach this metadata to resources - // (capabilities, partnerships, and so on) for any purpose. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateTransformerInput) 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 CreateTransformerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTransformerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTransformerInput"} - if s.EdiType == nil { - invalidParams.Add(request.NewErrParamRequired("EdiType")) - } - if s.FileFormat == nil { - invalidParams.Add(request.NewErrParamRequired("FileFormat")) - } - if s.MappingTemplate == nil { - invalidParams.Add(request.NewErrParamRequired("MappingTemplate")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateTransformerInput) SetClientToken(v string) *CreateTransformerInput { - s.ClientToken = &v - return s -} - -// SetEdiType sets the EdiType field's value. -func (s *CreateTransformerInput) SetEdiType(v *EdiType) *CreateTransformerInput { - s.EdiType = v - return s -} - -// SetFileFormat sets the FileFormat field's value. -func (s *CreateTransformerInput) SetFileFormat(v string) *CreateTransformerInput { - s.FileFormat = &v - return s -} - -// SetMappingTemplate sets the MappingTemplate field's value. -func (s *CreateTransformerInput) SetMappingTemplate(v string) *CreateTransformerInput { - s.MappingTemplate = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTransformerInput) SetName(v string) *CreateTransformerInput { - s.Name = &v - return s -} - -// SetSampleDocument sets the SampleDocument field's value. -func (s *CreateTransformerInput) SetSampleDocument(v string) *CreateTransformerInput { - s.SampleDocument = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateTransformerInput) SetTags(v []*Tag) *CreateTransformerInput { - s.Tags = v - return s -} - -type CreateTransformerOutput struct { - _ struct{} `type:"structure"` - - // Returns a timestamp for creation date and time of the transformer. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the details for the EDI standard that is being used for the transformer. - // Currently, only X12 is supported. X12 is a set of standards and corresponding - // messages that define specific business documents. - // - // EdiType is a required field - EdiType *EdiType `locationName:"ediType" type:"structure" required:"true"` - - // Returns that the currently supported file formats for EDI transformations - // are JSON and XML. - // - // FileFormat is a required field - FileFormat *string `locationName:"fileFormat" type:"string" required:"true" enum:"FileFormat"` - - // Returns the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. - // - // MappingTemplate is a required field - MappingTemplate *string `locationName:"mappingTemplate" type:"string" required:"true"` - - // Returns the name of the transformer, used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns a sample EDI document that is used by a transformer as a guide for - // processing the EDI data. - SampleDocument *string `locationName:"sampleDocument" type:"string"` - - // Returns the state of the newly created transformer. The transformer can be - // either active or inactive. For the transformer to be used in a capability, - // its status must active. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"TransformerStatus"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // TransformerArn is a required field - TransformerArn *string `locationName:"transformerArn" min:"1" type:"string" required:"true"` - - // Returns the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" 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 CreateTransformerOutput) 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 CreateTransformerOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateTransformerOutput) SetCreatedAt(v time.Time) *CreateTransformerOutput { - s.CreatedAt = &v - return s -} - -// SetEdiType sets the EdiType field's value. -func (s *CreateTransformerOutput) SetEdiType(v *EdiType) *CreateTransformerOutput { - s.EdiType = v - return s -} - -// SetFileFormat sets the FileFormat field's value. -func (s *CreateTransformerOutput) SetFileFormat(v string) *CreateTransformerOutput { - s.FileFormat = &v - return s -} - -// SetMappingTemplate sets the MappingTemplate field's value. -func (s *CreateTransformerOutput) SetMappingTemplate(v string) *CreateTransformerOutput { - s.MappingTemplate = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTransformerOutput) SetName(v string) *CreateTransformerOutput { - s.Name = &v - return s -} - -// SetSampleDocument sets the SampleDocument field's value. -func (s *CreateTransformerOutput) SetSampleDocument(v string) *CreateTransformerOutput { - s.SampleDocument = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateTransformerOutput) SetStatus(v string) *CreateTransformerOutput { - s.Status = &v - return s -} - -// SetTransformerArn sets the TransformerArn field's value. -func (s *CreateTransformerOutput) SetTransformerArn(v string) *CreateTransformerOutput { - s.TransformerArn = &v - return s -} - -// SetTransformerId sets the TransformerId field's value. -func (s *CreateTransformerOutput) SetTransformerId(v string) *CreateTransformerOutput { - s.TransformerId = &v - return s -} - -type DeleteCapabilityInput struct { - _ struct{} `type:"structure"` - - // Specifies a system-assigned unique identifier for the capability. - // - // CapabilityId is a required field - CapabilityId *string `locationName:"capabilityId" min:"1" 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 DeleteCapabilityInput) 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 DeleteCapabilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCapabilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCapabilityInput"} - if s.CapabilityId == nil { - invalidParams.Add(request.NewErrParamRequired("CapabilityId")) - } - if s.CapabilityId != nil && len(*s.CapabilityId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CapabilityId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilityId sets the CapabilityId field's value. -func (s *DeleteCapabilityInput) SetCapabilityId(v string) *DeleteCapabilityInput { - s.CapabilityId = &v - return s -} - -type DeleteCapabilityOutput 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 DeleteCapabilityOutput) 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 DeleteCapabilityOutput) GoString() string { - return s.String() -} - -type DeletePartnershipInput struct { - _ struct{} `type:"structure"` - - // Specifies the unique, system-generated identifier for a partnership. - // - // PartnershipId is a required field - PartnershipId *string `locationName:"partnershipId" min:"1" 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 DeletePartnershipInput) 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 DeletePartnershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePartnershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePartnershipInput"} - if s.PartnershipId == nil { - invalidParams.Add(request.NewErrParamRequired("PartnershipId")) - } - if s.PartnershipId != nil && len(*s.PartnershipId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PartnershipId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPartnershipId sets the PartnershipId field's value. -func (s *DeletePartnershipInput) SetPartnershipId(v string) *DeletePartnershipInput { - s.PartnershipId = &v - return s -} - -type DeletePartnershipOutput 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 DeletePartnershipOutput) 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 DeletePartnershipOutput) GoString() string { - return s.String() -} - -type DeleteProfileInput struct { - _ struct{} `type:"structure"` - - // Specifies the unique, system-generated identifier for the profile. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" 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 DeleteProfileInput) 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 DeleteProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteProfileInput"} - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProfileId sets the ProfileId field's value. -func (s *DeleteProfileInput) SetProfileId(v string) *DeleteProfileInput { - s.ProfileId = &v - return s -} - -type DeleteProfileOutput 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 DeleteProfileOutput) 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 DeleteProfileOutput) GoString() string { - return s.String() -} - -type DeleteTransformerInput struct { - _ struct{} `type:"structure"` - - // Specifies the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" 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 DeleteTransformerInput) 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 DeleteTransformerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTransformerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTransformerInput"} - if s.TransformerId == nil { - invalidParams.Add(request.NewErrParamRequired("TransformerId")) - } - if s.TransformerId != nil && len(*s.TransformerId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformerId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTransformerId sets the TransformerId field's value. -func (s *DeleteTransformerInput) SetTransformerId(v string) *DeleteTransformerInput { - s.TransformerId = &v - return s -} - -type DeleteTransformerOutput 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 DeleteTransformerOutput) 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 DeleteTransformerOutput) GoString() string { - return s.String() -} - -// Specifies the details for the EDI (electronic data interchange) transformation. -type EdiConfiguration struct { - _ struct{} `type:"structure"` - - // Contains the Amazon S3 bucket and prefix for the location of the input file, - // which is contained in an S3Location object. - // - // InputLocation is a required field - InputLocation *S3Location `locationName:"inputLocation" type:"structure" required:"true"` - - // Contains the Amazon S3 bucket and prefix for the location of the output file, - // which is contained in an S3Location object. - // - // OutputLocation is a required field - OutputLocation *S3Location `locationName:"outputLocation" type:"structure" required:"true"` - - // Returns the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" type:"string" required:"true"` - - // Returns the type of the capability. Currently, only edi is supported. - // - // Type is a required field - Type *EdiType `locationName:"type" type:"structure" 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 EdiConfiguration) 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 EdiConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EdiConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EdiConfiguration"} - if s.InputLocation == nil { - invalidParams.Add(request.NewErrParamRequired("InputLocation")) - } - if s.OutputLocation == nil { - invalidParams.Add(request.NewErrParamRequired("OutputLocation")) - } - if s.TransformerId == nil { - invalidParams.Add(request.NewErrParamRequired("TransformerId")) - } - if s.TransformerId != nil && len(*s.TransformerId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformerId", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.InputLocation != nil { - if err := s.InputLocation.Validate(); err != nil { - invalidParams.AddNested("InputLocation", err.(request.ErrInvalidParams)) - } - } - if s.OutputLocation != nil { - if err := s.OutputLocation.Validate(); err != nil { - invalidParams.AddNested("OutputLocation", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInputLocation sets the InputLocation field's value. -func (s *EdiConfiguration) SetInputLocation(v *S3Location) *EdiConfiguration { - s.InputLocation = v - return s -} - -// SetOutputLocation sets the OutputLocation field's value. -func (s *EdiConfiguration) SetOutputLocation(v *S3Location) *EdiConfiguration { - s.OutputLocation = v - return s -} - -// SetTransformerId sets the TransformerId field's value. -func (s *EdiConfiguration) SetTransformerId(v string) *EdiConfiguration { - s.TransformerId = &v - return s -} - -// SetType sets the Type field's value. -func (s *EdiConfiguration) SetType(v *EdiType) *EdiConfiguration { - s.Type = v - return s -} - -// Specifies the details for the EDI standard that is being used for the transformer. -// Currently, only X12 is supported. X12 is a set of standards and corresponding -// messages that define specific business documents. -type EdiType struct { - _ struct{} `type:"structure"` - - // Returns the details for the EDI standard that is being used for the transformer. - // Currently, only X12 is supported. X12 is a set of standards and corresponding - // messages that define specific business documents. - X12Details *X12Details `locationName:"x12Details" 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 EdiType) 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 EdiType) GoString() string { - return s.String() -} - -// SetX12Details sets the X12Details field's value. -func (s *EdiType) SetX12Details(v *X12Details) *EdiType { - s.X12Details = v - return s -} - -type GetCapabilityInput struct { - _ struct{} `type:"structure"` - - // Specifies a system-assigned unique identifier for the capability. - // - // CapabilityId is a required field - CapabilityId *string `locationName:"capabilityId" min:"1" 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 GetCapabilityInput) 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 GetCapabilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCapabilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCapabilityInput"} - if s.CapabilityId == nil { - invalidParams.Add(request.NewErrParamRequired("CapabilityId")) - } - if s.CapabilityId != nil && len(*s.CapabilityId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CapabilityId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilityId sets the CapabilityId field's value. -func (s *GetCapabilityInput) SetCapabilityId(v string) *GetCapabilityInput { - s.CapabilityId = &v - return s -} - -type GetCapabilityOutput struct { - _ struct{} `type:"structure"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // CapabilityArn is a required field - CapabilityArn *string `locationName:"capabilityArn" min:"1" type:"string" required:"true"` - - // Returns a system-assigned unique identifier for the capability. - // - // CapabilityId is a required field - CapabilityId *string `locationName:"capabilityId" min:"1" type:"string" required:"true"` - - // Returns a structure that contains the details for a capability. - // - // Configuration is a required field - Configuration *CapabilityConfiguration `locationName:"configuration" type:"structure" required:"true"` - - // Returns a timestamp for creation date and time of the capability. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns one or more locations in Amazon S3, each specifying an EDI document - // that can be used with this capability. Each item contains the name of the - // bucket and the key, to identify the document's location. - InstructionsDocuments []*S3Location `locationName:"instructionsDocuments" type:"list"` - - // Returns a timestamp for last time the capability was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the name of the capability, used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns the type of the capability. Currently, only edi is supported. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"CapabilityType"` -} - -// 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 GetCapabilityOutput) 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 GetCapabilityOutput) GoString() string { - return s.String() -} - -// SetCapabilityArn sets the CapabilityArn field's value. -func (s *GetCapabilityOutput) SetCapabilityArn(v string) *GetCapabilityOutput { - s.CapabilityArn = &v - return s -} - -// SetCapabilityId sets the CapabilityId field's value. -func (s *GetCapabilityOutput) SetCapabilityId(v string) *GetCapabilityOutput { - s.CapabilityId = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *GetCapabilityOutput) SetConfiguration(v *CapabilityConfiguration) *GetCapabilityOutput { - s.Configuration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetCapabilityOutput) SetCreatedAt(v time.Time) *GetCapabilityOutput { - s.CreatedAt = &v - return s -} - -// SetInstructionsDocuments sets the InstructionsDocuments field's value. -func (s *GetCapabilityOutput) SetInstructionsDocuments(v []*S3Location) *GetCapabilityOutput { - s.InstructionsDocuments = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *GetCapabilityOutput) SetModifiedAt(v time.Time) *GetCapabilityOutput { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetCapabilityOutput) SetName(v string) *GetCapabilityOutput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetCapabilityOutput) SetType(v string) *GetCapabilityOutput { - s.Type = &v - return s -} - -type GetPartnershipInput struct { - _ struct{} `type:"structure"` - - // Specifies the unique, system-generated identifier for a partnership. - // - // PartnershipId is a required field - PartnershipId *string `locationName:"partnershipId" min:"1" 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 GetPartnershipInput) 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 GetPartnershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPartnershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPartnershipInput"} - if s.PartnershipId == nil { - invalidParams.Add(request.NewErrParamRequired("PartnershipId")) - } - if s.PartnershipId != nil && len(*s.PartnershipId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PartnershipId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPartnershipId sets the PartnershipId field's value. -func (s *GetPartnershipInput) SetPartnershipId(v string) *GetPartnershipInput { - s.PartnershipId = &v - return s -} - -type GetPartnershipOutput struct { - _ struct{} `type:"structure"` - - // Returns one or more capabilities associated with this partnership. - Capabilities []*string `locationName:"capabilities" type:"list"` - - // Returns a timestamp for creation date and time of the partnership. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the email address associated with this trading partner. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetPartnershipOutput's - // String and GoString methods. - Email *string `locationName:"email" min:"5" type:"string" sensitive:"true"` - - // Returns a timestamp that identifies the most recent date and time that the - // partnership was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the display name of the partnership - Name *string `locationName:"name" min:"1" type:"string"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // PartnershipArn is a required field - PartnershipArn *string `locationName:"partnershipArn" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for a partnership. - // - // PartnershipId is a required field - PartnershipId *string `locationName:"partnershipId" min:"1" type:"string" required:"true"` - - // Returns the phone number associated with the partnership. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetPartnershipOutput's - // String and GoString methods. - Phone *string `locationName:"phone" min:"7" type:"string" sensitive:"true"` - - // Returns the unique, system-generated identifier for the profile connected - // to this partnership. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" type:"string" required:"true"` - - // Returns the unique identifier for the partner for this partnership. - TradingPartnerId *string `locationName:"tradingPartnerId" min:"1" 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 GetPartnershipOutput) 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 GetPartnershipOutput) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *GetPartnershipOutput) SetCapabilities(v []*string) *GetPartnershipOutput { - s.Capabilities = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetPartnershipOutput) SetCreatedAt(v time.Time) *GetPartnershipOutput { - s.CreatedAt = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *GetPartnershipOutput) SetEmail(v string) *GetPartnershipOutput { - s.Email = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *GetPartnershipOutput) SetModifiedAt(v time.Time) *GetPartnershipOutput { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetPartnershipOutput) SetName(v string) *GetPartnershipOutput { - s.Name = &v - return s -} - -// SetPartnershipArn sets the PartnershipArn field's value. -func (s *GetPartnershipOutput) SetPartnershipArn(v string) *GetPartnershipOutput { - s.PartnershipArn = &v - return s -} - -// SetPartnershipId sets the PartnershipId field's value. -func (s *GetPartnershipOutput) SetPartnershipId(v string) *GetPartnershipOutput { - s.PartnershipId = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *GetPartnershipOutput) SetPhone(v string) *GetPartnershipOutput { - s.Phone = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *GetPartnershipOutput) SetProfileId(v string) *GetPartnershipOutput { - s.ProfileId = &v - return s -} - -// SetTradingPartnerId sets the TradingPartnerId field's value. -func (s *GetPartnershipOutput) SetTradingPartnerId(v string) *GetPartnershipOutput { - s.TradingPartnerId = &v - return s -} - -type GetProfileInput struct { - _ struct{} `type:"structure"` - - // Specifies the unique, system-generated identifier for the profile. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" 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 GetProfileInput) 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 GetProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetProfileInput"} - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProfileId sets the ProfileId field's value. -func (s *GetProfileInput) SetProfileId(v string) *GetProfileInput { - s.ProfileId = &v - return s -} - -type GetProfileOutput struct { - _ struct{} `type:"structure"` - - // Returns the name for the business associated with this profile. - // - // BusinessName is a required field - BusinessName *string `locationName:"businessName" min:"1" type:"string" required:"true"` - - // Returns a timestamp for creation date and time of the transformer. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the email address associated with this customer profile. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetProfileOutput's - // String and GoString methods. - Email *string `locationName:"email" min:"5" type:"string" sensitive:"true"` - - // Returns the name of the logging group. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // Returns whether or not logging is enabled for this profile. - Logging *string `locationName:"logging" type:"string" enum:"Logging"` - - // Returns a timestamp for last time the profile was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the name of the profile, used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns the phone number associated with the profile. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetProfileOutput's - // String and GoString methods. - // - // Phone is a required field - Phone *string `locationName:"phone" min:"7" type:"string" required:"true" sensitive:"true"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // ProfileArn is a required field - ProfileArn *string `locationName:"profileArn" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for the profile. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" 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 GetProfileOutput) 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 GetProfileOutput) GoString() string { - return s.String() -} - -// SetBusinessName sets the BusinessName field's value. -func (s *GetProfileOutput) SetBusinessName(v string) *GetProfileOutput { - s.BusinessName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetProfileOutput) SetCreatedAt(v time.Time) *GetProfileOutput { - s.CreatedAt = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *GetProfileOutput) SetEmail(v string) *GetProfileOutput { - s.Email = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *GetProfileOutput) SetLogGroupName(v string) *GetProfileOutput { - s.LogGroupName = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *GetProfileOutput) SetLogging(v string) *GetProfileOutput { - s.Logging = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *GetProfileOutput) SetModifiedAt(v time.Time) *GetProfileOutput { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetProfileOutput) SetName(v string) *GetProfileOutput { - s.Name = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *GetProfileOutput) SetPhone(v string) *GetProfileOutput { - s.Phone = &v - return s -} - -// SetProfileArn sets the ProfileArn field's value. -func (s *GetProfileOutput) SetProfileArn(v string) *GetProfileOutput { - s.ProfileArn = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *GetProfileOutput) SetProfileId(v string) *GetProfileOutput { - s.ProfileId = &v - return s -} - -type GetTransformerInput struct { - _ struct{} `type:"structure"` - - // Specifies the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" 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 GetTransformerInput) 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 GetTransformerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTransformerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTransformerInput"} - if s.TransformerId == nil { - invalidParams.Add(request.NewErrParamRequired("TransformerId")) - } - if s.TransformerId != nil && len(*s.TransformerId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformerId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTransformerId sets the TransformerId field's value. -func (s *GetTransformerInput) SetTransformerId(v string) *GetTransformerInput { - s.TransformerId = &v - return s -} - -type GetTransformerJobInput struct { - _ struct{} `type:"structure"` - - // Specifies the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" type:"string" required:"true"` - - // Specifies the unique, system-generated identifier for a transformer run. - // - // TransformerJobId is a required field - TransformerJobId *string `locationName:"transformerJobId" min:"25" 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 GetTransformerJobInput) 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 GetTransformerJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTransformerJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTransformerJobInput"} - if s.TransformerId == nil { - invalidParams.Add(request.NewErrParamRequired("TransformerId")) - } - if s.TransformerId != nil && len(*s.TransformerId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformerId", 1)) - } - if s.TransformerJobId == nil { - invalidParams.Add(request.NewErrParamRequired("TransformerJobId")) - } - if s.TransformerJobId != nil && len(*s.TransformerJobId) < 25 { - invalidParams.Add(request.NewErrParamMinLen("TransformerJobId", 25)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTransformerId sets the TransformerId field's value. -func (s *GetTransformerJobInput) SetTransformerId(v string) *GetTransformerJobInput { - s.TransformerId = &v - return s -} - -// SetTransformerJobId sets the TransformerJobId field's value. -func (s *GetTransformerJobInput) SetTransformerJobId(v string) *GetTransformerJobInput { - s.TransformerJobId = &v - return s -} - -type GetTransformerJobOutput struct { - _ struct{} `type:"structure"` - - // Returns an optional error message, which gets populated when the job is not - // run successfully. - Message *string `locationName:"message" type:"string"` - - // Returns the location for the output files. If the caller specified a directory - // for the output, then this contains the full path to the output file, including - // the file name generated by the service. - OutputFiles []*S3Location `locationName:"outputFiles" type:"list"` - - // Returns the current state of the transformer job, either running, succeeded, - // or failed. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"TransformerJobStatus"` -} - -// 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 GetTransformerJobOutput) 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 GetTransformerJobOutput) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *GetTransformerJobOutput) SetMessage(v string) *GetTransformerJobOutput { - s.Message = &v - return s -} - -// SetOutputFiles sets the OutputFiles field's value. -func (s *GetTransformerJobOutput) SetOutputFiles(v []*S3Location) *GetTransformerJobOutput { - s.OutputFiles = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetTransformerJobOutput) SetStatus(v string) *GetTransformerJobOutput { - s.Status = &v - return s -} - -type GetTransformerOutput struct { - _ struct{} `type:"structure"` - - // Returns a timestamp for creation date and time of the transformer. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the details for the EDI standard that is being used for the transformer. - // Currently, only X12 is supported. X12 is a set of standards and corresponding - // messages that define specific business documents. - // - // EdiType is a required field - EdiType *EdiType `locationName:"ediType" type:"structure" required:"true"` - - // Returns that the currently supported file formats for EDI transformations - // are JSON and XML. - // - // FileFormat is a required field - FileFormat *string `locationName:"fileFormat" type:"string" required:"true" enum:"FileFormat"` - - // Returns the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. - // - // MappingTemplate is a required field - MappingTemplate *string `locationName:"mappingTemplate" type:"string" required:"true"` - - // Returns a timestamp for last time the transformer was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the name of the transformer, used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns a sample EDI document that is used by a transformer as a guide for - // processing the EDI data. - SampleDocument *string `locationName:"sampleDocument" type:"string"` - - // Returns the state of the newly created transformer. The transformer can be - // either active or inactive. For the transformer to be used in a capability, - // its status must active. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"TransformerStatus"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // TransformerArn is a required field - TransformerArn *string `locationName:"transformerArn" min:"1" type:"string" required:"true"` - - // Returns the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" 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 GetTransformerOutput) 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 GetTransformerOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetTransformerOutput) SetCreatedAt(v time.Time) *GetTransformerOutput { - s.CreatedAt = &v - return s -} - -// SetEdiType sets the EdiType field's value. -func (s *GetTransformerOutput) SetEdiType(v *EdiType) *GetTransformerOutput { - s.EdiType = v - return s -} - -// SetFileFormat sets the FileFormat field's value. -func (s *GetTransformerOutput) SetFileFormat(v string) *GetTransformerOutput { - s.FileFormat = &v - return s -} - -// SetMappingTemplate sets the MappingTemplate field's value. -func (s *GetTransformerOutput) SetMappingTemplate(v string) *GetTransformerOutput { - s.MappingTemplate = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *GetTransformerOutput) SetModifiedAt(v time.Time) *GetTransformerOutput { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetTransformerOutput) SetName(v string) *GetTransformerOutput { - s.Name = &v - return s -} - -// SetSampleDocument sets the SampleDocument field's value. -func (s *GetTransformerOutput) SetSampleDocument(v string) *GetTransformerOutput { - s.SampleDocument = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetTransformerOutput) SetStatus(v string) *GetTransformerOutput { - s.Status = &v - return s -} - -// SetTransformerArn sets the TransformerArn field's value. -func (s *GetTransformerOutput) SetTransformerArn(v string) *GetTransformerOutput { - s.TransformerArn = &v - return s -} - -// SetTransformerId sets the TransformerId field's value. -func (s *GetTransformerOutput) SetTransformerId(v string) *GetTransformerOutput { - s.TransformerId = &v - return s -} - -// This exception is thrown when an error occurs in the Amazon Web Services -// B2B Data Interchange service. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"10" type:"string"` - - // The server attempts to retry a failed command. - RetryAfterSeconds *int64 `locationName:"retryAfterSeconds" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListCapabilitiesInput struct { - _ struct{} `type:"structure"` - - // Specifies the maximum number of capabilities to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When additional results are obtained from the command, a NextToken parameter - // is returned in the output. You can then pass the NextToken parameter in a - // subsequent command to continue listing additional resources. - NextToken *string `locationName:"nextToken" min:"1" 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 ListCapabilitiesInput) 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 ListCapabilitiesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCapabilitiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCapabilitiesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCapabilitiesInput) SetMaxResults(v int64) *ListCapabilitiesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCapabilitiesInput) SetNextToken(v string) *ListCapabilitiesInput { - s.NextToken = &v - return s -} - -type ListCapabilitiesOutput struct { - _ struct{} `type:"structure"` - - // Returns one or more capabilities associated with this partnership. - // - // Capabilities is a required field - Capabilities []*CapabilitySummary `locationName:"capabilities" type:"list" required:"true"` - - // When additional results are obtained from the command, a NextToken parameter - // is returned in the output. You can then pass the NextToken parameter in a - // subsequent command to continue listing additional resources. - NextToken *string `locationName:"nextToken" min:"1" 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 ListCapabilitiesOutput) 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 ListCapabilitiesOutput) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *ListCapabilitiesOutput) SetCapabilities(v []*CapabilitySummary) *ListCapabilitiesOutput { - s.Capabilities = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCapabilitiesOutput) SetNextToken(v string) *ListCapabilitiesOutput { - s.NextToken = &v - return s -} - -type ListPartnershipsInput struct { - _ struct{} `type:"structure"` - - // Specifies the maximum number of capabilities to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When additional results are obtained from the command, a NextToken parameter - // is returned in the output. You can then pass the NextToken parameter in a - // subsequent command to continue listing additional resources. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Specifies the unique, system-generated identifier for the profile connected - // to this partnership. - ProfileId *string `locationName:"profileId" min:"1" 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 ListPartnershipsInput) 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 ListPartnershipsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPartnershipsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPartnershipsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ProfileId != nil && len(*s.ProfileId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPartnershipsInput) SetMaxResults(v int64) *ListPartnershipsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPartnershipsInput) SetNextToken(v string) *ListPartnershipsInput { - s.NextToken = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *ListPartnershipsInput) SetProfileId(v string) *ListPartnershipsInput { - s.ProfileId = &v - return s -} - -type ListPartnershipsOutput struct { - _ struct{} `type:"structure"` - - // When additional results are obtained from the command, a NextToken parameter - // is returned in the output. You can then pass the NextToken parameter in a - // subsequent command to continue listing additional resources. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Specifies a list of your partnerships. - // - // Partnerships is a required field - Partnerships []*PartnershipSummary `locationName:"partnerships" type:"list" 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 ListPartnershipsOutput) 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 ListPartnershipsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPartnershipsOutput) SetNextToken(v string) *ListPartnershipsOutput { - s.NextToken = &v - return s -} - -// SetPartnerships sets the Partnerships field's value. -func (s *ListPartnershipsOutput) SetPartnerships(v []*PartnershipSummary) *ListPartnershipsOutput { - s.Partnerships = v - return s -} - -type ListProfilesInput struct { - _ struct{} `type:"structure"` - - // Specifies the maximum number of profiles to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When additional results are obtained from the command, a NextToken parameter - // is returned in the output. You can then pass the NextToken parameter in a - // subsequent command to continue listing additional resources. - NextToken *string `locationName:"nextToken" min:"1" 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 ListProfilesInput) 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 ListProfilesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProfilesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProfilesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListProfilesInput) SetMaxResults(v int64) *ListProfilesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProfilesInput) SetNextToken(v string) *ListProfilesInput { - s.NextToken = &v - return s -} - -type ListProfilesOutput struct { - _ struct{} `type:"structure"` - - // When additional results are obtained from the command, a NextToken parameter - // is returned in the output. You can then pass the NextToken parameter in a - // subsequent command to continue listing additional resources. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Returns an array of ProfileSummary objects. - // - // Profiles is a required field - Profiles []*ProfileSummary `locationName:"profiles" type:"list" 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 ListProfilesOutput) 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 ListProfilesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProfilesOutput) SetNextToken(v string) *ListProfilesOutput { - s.NextToken = &v - return s -} - -// SetProfiles sets the Profiles field's value. -func (s *ListProfilesOutput) SetProfiles(v []*ProfileSummary) *ListProfilesOutput { - s.Profiles = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // Requests the tags associated with a particular Amazon Resource Name (ARN). - // An ARN is an identifier for a specific Amazon Web Services resource, such - // as a capability, partnership, profile, or transformer. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { - s.ResourceARN = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // Returns the key-value pairs assigned to ARNs that you can use to group and - // search for resources by type. You can attach this metadata to resources (capabilities, - // partnerships, and so on) for any purpose. - Tags []*Tag `type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListTransformersInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of items to return for the API response. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When additional results are obtained from the command, a NextToken parameter - // is returned in the output. You can then pass the NextToken parameter in a - // subsequent command to continue listing additional resources. - NextToken *string `locationName:"nextToken" min:"1" 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 ListTransformersInput) 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 ListTransformersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTransformersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTransformersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTransformersInput) SetMaxResults(v int64) *ListTransformersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTransformersInput) SetNextToken(v string) *ListTransformersInput { - s.NextToken = &v - return s -} - -type ListTransformersOutput struct { - _ struct{} `type:"structure"` - - // When additional results are obtained from the command, a NextToken parameter - // is returned in the output. You can then pass the NextToken parameter in a - // subsequent command to continue listing additional resources. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Returns an array of one or more transformer objects. - // - // For each transformer, a TransformerSummary object is returned. The TransformerSummary - // contains all the details for a specific transformer. - // - // Transformers is a required field - Transformers []*TransformerSummary `locationName:"transformers" type:"list" 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 ListTransformersOutput) 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 ListTransformersOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTransformersOutput) SetNextToken(v string) *ListTransformersOutput { - s.NextToken = &v - return s -} - -// SetTransformers sets the Transformers field's value. -func (s *ListTransformersOutput) SetTransformers(v []*TransformerSummary) *ListTransformersOutput { - s.Transformers = v - return s -} - -// A structure that contains the details for a partnership. Partnerships link -// trading partners with your profile and a specific transformer, so that the -// EDI (electronic data interchange) documents that they upload to Amazon S3 -// can be processed according to their specifications. -type PartnershipSummary struct { - _ struct{} `type:"structure"` - - // Returns one or more capabilities associated with this partnership. - Capabilities []*string `locationName:"capabilities" type:"list"` - - // Returns a timestamp for creation date and time of the partnership. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns a timestamp that identifies the most recent date and time that the - // partnership was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the name of the partnership. - Name *string `locationName:"name" min:"1" type:"string"` - - // Returns the unique, system-generated identifier for a partnership. - // - // PartnershipId is a required field - PartnershipId *string `locationName:"partnershipId" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for the profile connected - // to this partnership. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for a trading partner. - TradingPartnerId *string `locationName:"tradingPartnerId" min:"1" 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 PartnershipSummary) 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 PartnershipSummary) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *PartnershipSummary) SetCapabilities(v []*string) *PartnershipSummary { - s.Capabilities = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *PartnershipSummary) SetCreatedAt(v time.Time) *PartnershipSummary { - s.CreatedAt = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *PartnershipSummary) SetModifiedAt(v time.Time) *PartnershipSummary { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *PartnershipSummary) SetName(v string) *PartnershipSummary { - s.Name = &v - return s -} - -// SetPartnershipId sets the PartnershipId field's value. -func (s *PartnershipSummary) SetPartnershipId(v string) *PartnershipSummary { - s.PartnershipId = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *PartnershipSummary) SetProfileId(v string) *PartnershipSummary { - s.ProfileId = &v - return s -} - -// SetTradingPartnerId sets the TradingPartnerId field's value. -func (s *PartnershipSummary) SetTradingPartnerId(v string) *PartnershipSummary { - s.TradingPartnerId = &v - return s -} - -// Contains the details for a profile. Profiles contain basic information about -// you and your business. -type ProfileSummary struct { - _ struct{} `type:"structure"` - - // Returns the name for the business associated with this profile. - // - // BusinessName is a required field - BusinessName *string `locationName:"businessName" min:"1" type:"string" required:"true"` - - // Returns the timestamp for creation date and time of the profile. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the name of the logging group. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // Specifies whether or not logging is enabled for this profile. - Logging *string `locationName:"logging" type:"string" enum:"Logging"` - - // Returns the timestamp that identifies the most recent date and time that - // the profile was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the display name for profile. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for the profile. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" 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 ProfileSummary) 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 ProfileSummary) GoString() string { - return s.String() -} - -// SetBusinessName sets the BusinessName field's value. -func (s *ProfileSummary) SetBusinessName(v string) *ProfileSummary { - s.BusinessName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ProfileSummary) SetCreatedAt(v time.Time) *ProfileSummary { - s.CreatedAt = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *ProfileSummary) SetLogGroupName(v string) *ProfileSummary { - s.LogGroupName = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *ProfileSummary) SetLogging(v string) *ProfileSummary { - s.Logging = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *ProfileSummary) SetModifiedAt(v time.Time) *ProfileSummary { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *ProfileSummary) SetName(v string) *ProfileSummary { - s.Name = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *ProfileSummary) SetProfileId(v string) *ProfileSummary { - s.ProfileId = &v - return s -} - -// Occurs when the requested resource does not exist, or cannot be found. In -// some cases, the resource exists in a region other than the region specified -// in the API call. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"10" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Specifies the details for the Amazon S3 file location that is being used -// with Amazon Web Services B2BI Data Interchange. File locations in Amazon -// S3 are identified using a combination of the bucket and key. -type S3Location struct { - _ struct{} `type:"structure"` - - // Specifies the name of the Amazon S3 bucket. - BucketName *string `locationName:"bucketName" min:"3" type:"string"` - - // Specifies the Amazon S3 key for the file location. - Key *string `locationName:"key" 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 S3Location) 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 S3Location) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Location) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Location"} - if s.BucketName != nil && len(*s.BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BucketName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3Location) SetBucketName(v string) *S3Location { - s.BucketName = &v - return s -} - -// SetKey sets the Key field's value. -func (s *S3Location) SetKey(v string) *S3Location { - s.Key = &v - return s -} - -// Occurs when the calling command attempts to exceed one of the service quotas, -// for example trying to create a capability when you already have the maximum -// number of capabilities allowed. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"10" type:"string"` - - // The quota that was exceeded, which caused the exception. - // - // QuotaCode is a required field - QuotaCode *string `locationName:"quotaCode" type:"string" required:"true"` - - // The ID for the resource that exceeded the quota, which caused the exception. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resource type (profile, partnership, transformer, or capability) that - // exceeded the quota, which caused the exception. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true"` - - // The code responsible for exceeding the quota, which caused the exception. - // - // ServiceCode is a required field - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartTransformerJobInput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // Specifies the location of the input file for the transformation. The location - // consists of an Amazon S3 bucket and prefix. - // - // InputFile is a required field - InputFile *S3Location `locationName:"inputFile" type:"structure" required:"true"` - - // Specifies the location of the output file for the transformation. The location - // consists of an Amazon S3 bucket and prefix. - // - // OutputLocation is a required field - OutputLocation *S3Location `locationName:"outputLocation" type:"structure" required:"true"` - - // Specifies the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" 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 StartTransformerJobInput) 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 StartTransformerJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartTransformerJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartTransformerJobInput"} - if s.InputFile == nil { - invalidParams.Add(request.NewErrParamRequired("InputFile")) - } - if s.OutputLocation == nil { - invalidParams.Add(request.NewErrParamRequired("OutputLocation")) - } - if s.TransformerId == nil { - invalidParams.Add(request.NewErrParamRequired("TransformerId")) - } - if s.TransformerId != nil && len(*s.TransformerId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformerId", 1)) - } - if s.InputFile != nil { - if err := s.InputFile.Validate(); err != nil { - invalidParams.AddNested("InputFile", err.(request.ErrInvalidParams)) - } - } - if s.OutputLocation != nil { - if err := s.OutputLocation.Validate(); err != nil { - invalidParams.AddNested("OutputLocation", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartTransformerJobInput) SetClientToken(v string) *StartTransformerJobInput { - s.ClientToken = &v - return s -} - -// SetInputFile sets the InputFile field's value. -func (s *StartTransformerJobInput) SetInputFile(v *S3Location) *StartTransformerJobInput { - s.InputFile = v - return s -} - -// SetOutputLocation sets the OutputLocation field's value. -func (s *StartTransformerJobInput) SetOutputLocation(v *S3Location) *StartTransformerJobInput { - s.OutputLocation = v - return s -} - -// SetTransformerId sets the TransformerId field's value. -func (s *StartTransformerJobInput) SetTransformerId(v string) *StartTransformerJobInput { - s.TransformerId = &v - return s -} - -type StartTransformerJobOutput struct { - _ struct{} `type:"structure"` - - // Returns the unique, system-generated identifier for a transformer run. - // - // TransformerJobId is a required field - TransformerJobId *string `locationName:"transformerJobId" min:"25" 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 StartTransformerJobOutput) 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 StartTransformerJobOutput) GoString() string { - return s.String() -} - -// SetTransformerJobId sets the TransformerJobId field's value. -func (s *StartTransformerJobOutput) SetTransformerJobId(v string) *StartTransformerJobOutput { - s.TransformerJobId = &v - return s -} - -// Creates a key-value pair for a specific resource. Tags are metadata that -// you can use to search for and group a resource for various purposes. You -// can apply tags to capabilities, partnerships, profiles and transformers. -// A tag key can take more than one value. For example, to group capabilities -// for accounting purposes, you might create a tag called Group and assign the -// values Research and Accounting to that group. -type Tag struct { - _ struct{} `type:"structure"` - - // Specifies the name assigned to the tag that you create. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // Contains one or more values that you assigned to the key name that you create. - // - // Value is a required field - Value *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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // Specifies an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true"` - - // Specifies the key-value pairs assigned to ARNs that you can use to group - // and search for resources by type. You can attach this metadata to resources - // (capabilities, partnerships, and so on) for any purpose. - // - // Tags is a required field - Tags []*Tag `type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -type TestMappingInput struct { - _ struct{} `type:"structure"` - - // Specifies that the currently supported file formats for EDI transformations - // are JSON and XML. - // - // FileFormat is a required field - FileFormat *string `locationName:"fileFormat" type:"string" required:"true" enum:"FileFormat"` - - // Specify the EDI (electronic data interchange) file that is used as input - // for the transform. - // - // InputFileContent is a required field - InputFileContent *string `locationName:"inputFileContent" type:"string" required:"true"` - - // Specifies the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. - // - // MappingTemplate is a required field - MappingTemplate *string `locationName:"mappingTemplate" 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 TestMappingInput) 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 TestMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestMappingInput"} - if s.FileFormat == nil { - invalidParams.Add(request.NewErrParamRequired("FileFormat")) - } - if s.InputFileContent == nil { - invalidParams.Add(request.NewErrParamRequired("InputFileContent")) - } - if s.MappingTemplate == nil { - invalidParams.Add(request.NewErrParamRequired("MappingTemplate")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileFormat sets the FileFormat field's value. -func (s *TestMappingInput) SetFileFormat(v string) *TestMappingInput { - s.FileFormat = &v - return s -} - -// SetInputFileContent sets the InputFileContent field's value. -func (s *TestMappingInput) SetInputFileContent(v string) *TestMappingInput { - s.InputFileContent = &v - return s -} - -// SetMappingTemplate sets the MappingTemplate field's value. -func (s *TestMappingInput) SetMappingTemplate(v string) *TestMappingInput { - s.MappingTemplate = &v - return s -} - -type TestMappingOutput struct { - _ struct{} `type:"structure"` - - // Returns a string for the mapping that can be used to identify the mapping. - // Similar to a fingerprint - // - // MappedFileContent is a required field - MappedFileContent *string `locationName:"mappedFileContent" 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 TestMappingOutput) 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 TestMappingOutput) GoString() string { - return s.String() -} - -// SetMappedFileContent sets the MappedFileContent field's value. -func (s *TestMappingOutput) SetMappedFileContent(v string) *TestMappingOutput { - s.MappedFileContent = &v - return s -} - -type TestParsingInput struct { - _ struct{} `type:"structure"` - - // Specifies the details for the EDI standard that is being used for the transformer. - // Currently, only X12 is supported. X12 is a set of standards and corresponding - // messages that define specific business documents. - // - // EdiType is a required field - EdiType *EdiType `locationName:"ediType" type:"structure" required:"true"` - - // Specifies that the currently supported file formats for EDI transformations - // are JSON and XML. - // - // FileFormat is a required field - FileFormat *string `locationName:"fileFormat" type:"string" required:"true" enum:"FileFormat"` - - // Specifies an S3Location object, which contains the Amazon S3 bucket and prefix - // for the location of the input file. - // - // InputFile is a required field - InputFile *S3Location `locationName:"inputFile" type:"structure" 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 TestParsingInput) 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 TestParsingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TestParsingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TestParsingInput"} - if s.EdiType == nil { - invalidParams.Add(request.NewErrParamRequired("EdiType")) - } - if s.FileFormat == nil { - invalidParams.Add(request.NewErrParamRequired("FileFormat")) - } - if s.InputFile == nil { - invalidParams.Add(request.NewErrParamRequired("InputFile")) - } - if s.InputFile != nil { - if err := s.InputFile.Validate(); err != nil { - invalidParams.AddNested("InputFile", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEdiType sets the EdiType field's value. -func (s *TestParsingInput) SetEdiType(v *EdiType) *TestParsingInput { - s.EdiType = v - return s -} - -// SetFileFormat sets the FileFormat field's value. -func (s *TestParsingInput) SetFileFormat(v string) *TestParsingInput { - s.FileFormat = &v - return s -} - -// SetInputFile sets the InputFile field's value. -func (s *TestParsingInput) SetInputFile(v *S3Location) *TestParsingInput { - s.InputFile = v - return s -} - -type TestParsingOutput struct { - _ struct{} `type:"structure"` - - // Returns the contents of the input file being tested, parsed according to - // the specified EDI (electronic data interchange) type. - // - // ParsedFileContent is a required field - ParsedFileContent *string `locationName:"parsedFileContent" 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 TestParsingOutput) 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 TestParsingOutput) GoString() string { - return s.String() -} - -// SetParsedFileContent sets the ParsedFileContent field's value. -func (s *TestParsingOutput) SetParsedFileContent(v string) *TestParsingOutput { - s.ParsedFileContent = &v - return s -} - -// The request was denied due to throttling: the data speed and rendering may -// be limited depending on various parameters and conditions. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"10" type:"string"` - - // The server attempts to retry a command that was throttled. - RetryAfterSeconds *int64 `locationName:"retryAfterSeconds" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains the details for a transformer object. Transformers describe how -// to process the incoming EDI (electronic data interchange) documents, and -// extract the necessary information. -type TransformerSummary struct { - _ struct{} `type:"structure"` - - // Returns a timestamp indicating when the transformer was created. For example, - // 2023-07-20T19:58:44.624Z. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the details for the EDI standard that is being used for the transformer. - // Currently, only X12 is supported. X12 is a set of standards and corresponding - // messages that define specific business documents. - // - // EdiType is a required field - EdiType *EdiType `locationName:"ediType" type:"structure" required:"true"` - - // Returns that the currently supported file formats for EDI transformations - // are JSON and XML. - // - // FileFormat is a required field - FileFormat *string `locationName:"fileFormat" type:"string" required:"true" enum:"FileFormat"` - - // Returns the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. - // - // MappingTemplate is a required field - MappingTemplate *string `locationName:"mappingTemplate" type:"string" required:"true"` - - // Returns a timestamp representing the date and time for the most recent change - // for the transformer object. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the descriptive name for the transformer. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns a sample EDI document that is used by a transformer as a guide for - // processing the EDI data. - SampleDocument *string `locationName:"sampleDocument" type:"string"` - - // Returns the state of the newly created transformer. The transformer can be - // either active or inactive. For the transformer to be used in a capability, - // its status must active. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"TransformerStatus"` - - // Returns the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" 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 TransformerSummary) 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 TransformerSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *TransformerSummary) SetCreatedAt(v time.Time) *TransformerSummary { - s.CreatedAt = &v - return s -} - -// SetEdiType sets the EdiType field's value. -func (s *TransformerSummary) SetEdiType(v *EdiType) *TransformerSummary { - s.EdiType = v - return s -} - -// SetFileFormat sets the FileFormat field's value. -func (s *TransformerSummary) SetFileFormat(v string) *TransformerSummary { - s.FileFormat = &v - return s -} - -// SetMappingTemplate sets the MappingTemplate field's value. -func (s *TransformerSummary) SetMappingTemplate(v string) *TransformerSummary { - s.MappingTemplate = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *TransformerSummary) SetModifiedAt(v time.Time) *TransformerSummary { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *TransformerSummary) SetName(v string) *TransformerSummary { - s.Name = &v - return s -} - -// SetSampleDocument sets the SampleDocument field's value. -func (s *TransformerSummary) SetSampleDocument(v string) *TransformerSummary { - s.SampleDocument = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TransformerSummary) SetStatus(v string) *TransformerSummary { - s.Status = &v - return s -} - -// SetTransformerId sets the TransformerId field's value. -func (s *TransformerSummary) SetTransformerId(v string) *TransformerSummary { - s.TransformerId = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // Specifies an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true"` - - // Specifies the key-value pairs assigned to ARNs that you can use to group - // and search for resources by type. You can attach this metadata to resources - // (capabilities, partnerships, and so on) for any purpose. - // - // TagKeys is a required field - TagKeys []*string `type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *UntagResourceInput) SetResourceARN(v string) *UntagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateCapabilityInput struct { - _ struct{} `type:"structure"` - - // Specifies a system-assigned unique identifier for the capability. - // - // CapabilityId is a required field - CapabilityId *string `locationName:"capabilityId" min:"1" type:"string" required:"true"` - - // Specifies a structure that contains the details for a capability. - Configuration *CapabilityConfiguration `locationName:"configuration" type:"structure"` - - // Specifies one or more locations in Amazon S3, each specifying an EDI document - // that can be used with this capability. Each item contains the name of the - // bucket and the key, to identify the document's location. - InstructionsDocuments []*S3Location `locationName:"instructionsDocuments" type:"list"` - - // Specifies a new name for the capability, to replace the existing name. - Name *string `locationName:"name" min:"1" 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 UpdateCapabilityInput) 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 UpdateCapabilityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCapabilityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCapabilityInput"} - if s.CapabilityId == nil { - invalidParams.Add(request.NewErrParamRequired("CapabilityId")) - } - if s.CapabilityId != nil && len(*s.CapabilityId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CapabilityId", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - if s.InstructionsDocuments != nil { - for i, v := range s.InstructionsDocuments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InstructionsDocuments", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilityId sets the CapabilityId field's value. -func (s *UpdateCapabilityInput) SetCapabilityId(v string) *UpdateCapabilityInput { - s.CapabilityId = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *UpdateCapabilityInput) SetConfiguration(v *CapabilityConfiguration) *UpdateCapabilityInput { - s.Configuration = v - return s -} - -// SetInstructionsDocuments sets the InstructionsDocuments field's value. -func (s *UpdateCapabilityInput) SetInstructionsDocuments(v []*S3Location) *UpdateCapabilityInput { - s.InstructionsDocuments = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCapabilityInput) SetName(v string) *UpdateCapabilityInput { - s.Name = &v - return s -} - -type UpdateCapabilityOutput struct { - _ struct{} `type:"structure"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // CapabilityArn is a required field - CapabilityArn *string `locationName:"capabilityArn" min:"1" type:"string" required:"true"` - - // Returns a system-assigned unique identifier for the capability. - // - // CapabilityId is a required field - CapabilityId *string `locationName:"capabilityId" min:"1" type:"string" required:"true"` - - // Returns a structure that contains the details for a capability. - // - // Configuration is a required field - Configuration *CapabilityConfiguration `locationName:"configuration" type:"structure" required:"true"` - - // Returns a timestamp for creation date and time of the capability. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns one or more locations in Amazon S3, each specifying an EDI document - // that can be used with this capability. Each item contains the name of the - // bucket and the key, to identify the document's location. - InstructionsDocuments []*S3Location `locationName:"instructionsDocuments" type:"list"` - - // Returns a timestamp for last time the capability was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the name of the capability, used to identify it. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns the type of the capability. Currently, only edi is supported. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"CapabilityType"` -} - -// 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 UpdateCapabilityOutput) 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 UpdateCapabilityOutput) GoString() string { - return s.String() -} - -// SetCapabilityArn sets the CapabilityArn field's value. -func (s *UpdateCapabilityOutput) SetCapabilityArn(v string) *UpdateCapabilityOutput { - s.CapabilityArn = &v - return s -} - -// SetCapabilityId sets the CapabilityId field's value. -func (s *UpdateCapabilityOutput) SetCapabilityId(v string) *UpdateCapabilityOutput { - s.CapabilityId = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *UpdateCapabilityOutput) SetConfiguration(v *CapabilityConfiguration) *UpdateCapabilityOutput { - s.Configuration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateCapabilityOutput) SetCreatedAt(v time.Time) *UpdateCapabilityOutput { - s.CreatedAt = &v - return s -} - -// SetInstructionsDocuments sets the InstructionsDocuments field's value. -func (s *UpdateCapabilityOutput) SetInstructionsDocuments(v []*S3Location) *UpdateCapabilityOutput { - s.InstructionsDocuments = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *UpdateCapabilityOutput) SetModifiedAt(v time.Time) *UpdateCapabilityOutput { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCapabilityOutput) SetName(v string) *UpdateCapabilityOutput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateCapabilityOutput) SetType(v string) *UpdateCapabilityOutput { - s.Type = &v - return s -} - -type UpdatePartnershipInput struct { - _ struct{} `type:"structure"` - - // List of the capabilities associated with this partnership. - Capabilities []*string `locationName:"capabilities" type:"list"` - - // The name of the partnership, used to identify it. - Name *string `locationName:"name" min:"1" type:"string"` - - // Specifies the unique, system-generated identifier for a partnership. - // - // PartnershipId is a required field - PartnershipId *string `locationName:"partnershipId" min:"1" 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 UpdatePartnershipInput) 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 UpdatePartnershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePartnershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePartnershipInput"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.PartnershipId == nil { - invalidParams.Add(request.NewErrParamRequired("PartnershipId")) - } - if s.PartnershipId != nil && len(*s.PartnershipId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PartnershipId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilities sets the Capabilities field's value. -func (s *UpdatePartnershipInput) SetCapabilities(v []*string) *UpdatePartnershipInput { - s.Capabilities = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePartnershipInput) SetName(v string) *UpdatePartnershipInput { - s.Name = &v - return s -} - -// SetPartnershipId sets the PartnershipId field's value. -func (s *UpdatePartnershipInput) SetPartnershipId(v string) *UpdatePartnershipInput { - s.PartnershipId = &v - return s -} - -type UpdatePartnershipOutput struct { - _ struct{} `type:"structure"` - - // Returns one or more capabilities associated with this partnership. - Capabilities []*string `locationName:"capabilities" type:"list"` - - // Returns a timestamp that identifies the most recent date and time that the - // partnership was modified. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the email address associated with this trading partner. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePartnershipOutput's - // String and GoString methods. - Email *string `locationName:"email" min:"5" type:"string" sensitive:"true"` - - // Returns a timestamp that identifies the most recent date and time that the - // partnership was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the partnership, used to identify it. - Name *string `locationName:"name" min:"1" type:"string"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // PartnershipArn is a required field - PartnershipArn *string `locationName:"partnershipArn" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for a partnership. - // - // PartnershipId is a required field - PartnershipId *string `locationName:"partnershipId" min:"1" type:"string" required:"true"` - - // Returns the phone number associated with the partnership. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePartnershipOutput's - // String and GoString methods. - Phone *string `locationName:"phone" min:"7" type:"string" sensitive:"true"` - - // Returns the unique, system-generated identifier for the profile connected - // to this partnership. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for a trading partner. - TradingPartnerId *string `locationName:"tradingPartnerId" min:"1" 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 UpdatePartnershipOutput) 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 UpdatePartnershipOutput) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *UpdatePartnershipOutput) SetCapabilities(v []*string) *UpdatePartnershipOutput { - s.Capabilities = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdatePartnershipOutput) SetCreatedAt(v time.Time) *UpdatePartnershipOutput { - s.CreatedAt = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *UpdatePartnershipOutput) SetEmail(v string) *UpdatePartnershipOutput { - s.Email = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *UpdatePartnershipOutput) SetModifiedAt(v time.Time) *UpdatePartnershipOutput { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePartnershipOutput) SetName(v string) *UpdatePartnershipOutput { - s.Name = &v - return s -} - -// SetPartnershipArn sets the PartnershipArn field's value. -func (s *UpdatePartnershipOutput) SetPartnershipArn(v string) *UpdatePartnershipOutput { - s.PartnershipArn = &v - return s -} - -// SetPartnershipId sets the PartnershipId field's value. -func (s *UpdatePartnershipOutput) SetPartnershipId(v string) *UpdatePartnershipOutput { - s.PartnershipId = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *UpdatePartnershipOutput) SetPhone(v string) *UpdatePartnershipOutput { - s.Phone = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *UpdatePartnershipOutput) SetProfileId(v string) *UpdatePartnershipOutput { - s.ProfileId = &v - return s -} - -// SetTradingPartnerId sets the TradingPartnerId field's value. -func (s *UpdatePartnershipOutput) SetTradingPartnerId(v string) *UpdatePartnershipOutput { - s.TradingPartnerId = &v - return s -} - -type UpdateProfileInput struct { - _ struct{} `type:"structure"` - - // Specifies the name for the business associated with this profile. - BusinessName *string `locationName:"businessName" min:"1" type:"string"` - - // Specifies the email address associated with this customer profile. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateProfileInput's - // String and GoString methods. - Email *string `locationName:"email" min:"5" type:"string" sensitive:"true"` - - // The name of the profile, used to identify it. - Name *string `locationName:"name" min:"1" type:"string"` - - // Specifies the phone number associated with the profile. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateProfileInput's - // String and GoString methods. - Phone *string `locationName:"phone" min:"7" type:"string" sensitive:"true"` - - // Specifies the unique, system-generated identifier for the profile. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" 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 UpdateProfileInput) 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 UpdateProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateProfileInput"} - if s.BusinessName != nil && len(*s.BusinessName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BusinessName", 1)) - } - if s.Email != nil && len(*s.Email) < 5 { - invalidParams.Add(request.NewErrParamMinLen("Email", 5)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Phone != nil && len(*s.Phone) < 7 { - invalidParams.Add(request.NewErrParamMinLen("Phone", 7)) - } - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBusinessName sets the BusinessName field's value. -func (s *UpdateProfileInput) SetBusinessName(v string) *UpdateProfileInput { - s.BusinessName = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *UpdateProfileInput) SetEmail(v string) *UpdateProfileInput { - s.Email = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateProfileInput) SetName(v string) *UpdateProfileInput { - s.Name = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *UpdateProfileInput) SetPhone(v string) *UpdateProfileInput { - s.Phone = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *UpdateProfileInput) SetProfileId(v string) *UpdateProfileInput { - s.ProfileId = &v - return s -} - -type UpdateProfileOutput struct { - _ struct{} `type:"structure"` - - // Returns the name for the business associated with this profile. - // - // BusinessName is a required field - BusinessName *string `locationName:"businessName" min:"1" type:"string" required:"true"` - - // Returns a timestamp for creation date and time of the profile. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the email address associated with this customer profile. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateProfileOutput's - // String and GoString methods. - Email *string `locationName:"email" min:"5" type:"string" sensitive:"true"` - - // Returns the name of the logging group. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // Specifies whether or not logging is enabled for this profile. - Logging *string `locationName:"logging" type:"string" enum:"Logging"` - - // Returns a timestamp for last time the profile was modified. - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Returns the name of the profile. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns the phone number associated with the profile. - // - // Phone is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateProfileOutput's - // String and GoString methods. - // - // Phone is a required field - Phone *string `locationName:"phone" min:"7" type:"string" required:"true" sensitive:"true"` - - // Returns an Amazon Resource Name (ARN) for the profile. - // - // ProfileArn is a required field - ProfileArn *string `locationName:"profileArn" min:"1" type:"string" required:"true"` - - // Returns the unique, system-generated identifier for the profile. - // - // ProfileId is a required field - ProfileId *string `locationName:"profileId" min:"1" 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 UpdateProfileOutput) 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 UpdateProfileOutput) GoString() string { - return s.String() -} - -// SetBusinessName sets the BusinessName field's value. -func (s *UpdateProfileOutput) SetBusinessName(v string) *UpdateProfileOutput { - s.BusinessName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateProfileOutput) SetCreatedAt(v time.Time) *UpdateProfileOutput { - s.CreatedAt = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *UpdateProfileOutput) SetEmail(v string) *UpdateProfileOutput { - s.Email = &v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *UpdateProfileOutput) SetLogGroupName(v string) *UpdateProfileOutput { - s.LogGroupName = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *UpdateProfileOutput) SetLogging(v string) *UpdateProfileOutput { - s.Logging = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *UpdateProfileOutput) SetModifiedAt(v time.Time) *UpdateProfileOutput { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateProfileOutput) SetName(v string) *UpdateProfileOutput { - s.Name = &v - return s -} - -// SetPhone sets the Phone field's value. -func (s *UpdateProfileOutput) SetPhone(v string) *UpdateProfileOutput { - s.Phone = &v - return s -} - -// SetProfileArn sets the ProfileArn field's value. -func (s *UpdateProfileOutput) SetProfileArn(v string) *UpdateProfileOutput { - s.ProfileArn = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *UpdateProfileOutput) SetProfileId(v string) *UpdateProfileOutput { - s.ProfileId = &v - return s -} - -type UpdateTransformerInput struct { - _ struct{} `type:"structure"` - - // Specifies the details for the EDI standard that is being used for the transformer. - // Currently, only X12 is supported. X12 is a set of standards and corresponding - // messages that define specific business documents. - EdiType *EdiType `locationName:"ediType" type:"structure"` - - // Specifies that the currently supported file formats for EDI transformations - // are JSON and XML. - FileFormat *string `locationName:"fileFormat" type:"string" enum:"FileFormat"` - - // Specifies the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. - MappingTemplate *string `locationName:"mappingTemplate" type:"string"` - - // Specify a new name for the transformer, if you want to update it. - Name *string `locationName:"name" min:"1" type:"string"` - - // Specifies a sample EDI document that is used by a transformer as a guide - // for processing the EDI data. - SampleDocument *string `locationName:"sampleDocument" type:"string"` - - // Specifies the transformer's status. You can update the state of the transformer, - // from active to inactive, or inactive to active. - Status *string `locationName:"status" type:"string" enum:"TransformerStatus"` - - // Specifies the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" 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 UpdateTransformerInput) 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 UpdateTransformerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTransformerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTransformerInput"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TransformerId == nil { - invalidParams.Add(request.NewErrParamRequired("TransformerId")) - } - if s.TransformerId != nil && len(*s.TransformerId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformerId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEdiType sets the EdiType field's value. -func (s *UpdateTransformerInput) SetEdiType(v *EdiType) *UpdateTransformerInput { - s.EdiType = v - return s -} - -// SetFileFormat sets the FileFormat field's value. -func (s *UpdateTransformerInput) SetFileFormat(v string) *UpdateTransformerInput { - s.FileFormat = &v - return s -} - -// SetMappingTemplate sets the MappingTemplate field's value. -func (s *UpdateTransformerInput) SetMappingTemplate(v string) *UpdateTransformerInput { - s.MappingTemplate = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateTransformerInput) SetName(v string) *UpdateTransformerInput { - s.Name = &v - return s -} - -// SetSampleDocument sets the SampleDocument field's value. -func (s *UpdateTransformerInput) SetSampleDocument(v string) *UpdateTransformerInput { - s.SampleDocument = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateTransformerInput) SetStatus(v string) *UpdateTransformerInput { - s.Status = &v - return s -} - -// SetTransformerId sets the TransformerId field's value. -func (s *UpdateTransformerInput) SetTransformerId(v string) *UpdateTransformerInput { - s.TransformerId = &v - return s -} - -type UpdateTransformerOutput struct { - _ struct{} `type:"structure"` - - // Returns a timestamp for creation date and time of the transformer. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the details for the EDI standard that is being used for the transformer. - // Currently, only X12 is supported. X12 is a set of standards and corresponding - // messages that define specific business documents. - // - // EdiType is a required field - EdiType *EdiType `locationName:"ediType" type:"structure" required:"true"` - - // Returns that the currently supported file formats for EDI transformations - // are JSON and XML. - // - // FileFormat is a required field - FileFormat *string `locationName:"fileFormat" type:"string" required:"true" enum:"FileFormat"` - - // Returns the name of the mapping template for the transformer. This template - // is used to convert the input document into the correct set of objects. - // - // MappingTemplate is a required field - MappingTemplate *string `locationName:"mappingTemplate" type:"string" required:"true"` - - // Returns a timestamp for last time the transformer was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Returns the name of the transformer. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Returns a sample EDI document that is used by a transformer as a guide for - // processing the EDI data. - SampleDocument *string `locationName:"sampleDocument" type:"string"` - - // Returns the state of the newly created transformer. The transformer can be - // either active or inactive. For the transformer to be used in a capability, - // its status must active. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"TransformerStatus"` - - // Returns an Amazon Resource Name (ARN) for a specific Amazon Web Services - // resource, such as a capability, partnership, profile, or transformer. - // - // TransformerArn is a required field - TransformerArn *string `locationName:"transformerArn" min:"1" type:"string" required:"true"` - - // Returns the system-assigned unique identifier for the transformer. - // - // TransformerId is a required field - TransformerId *string `locationName:"transformerId" min:"1" 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 UpdateTransformerOutput) 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 UpdateTransformerOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateTransformerOutput) SetCreatedAt(v time.Time) *UpdateTransformerOutput { - s.CreatedAt = &v - return s -} - -// SetEdiType sets the EdiType field's value. -func (s *UpdateTransformerOutput) SetEdiType(v *EdiType) *UpdateTransformerOutput { - s.EdiType = v - return s -} - -// SetFileFormat sets the FileFormat field's value. -func (s *UpdateTransformerOutput) SetFileFormat(v string) *UpdateTransformerOutput { - s.FileFormat = &v - return s -} - -// SetMappingTemplate sets the MappingTemplate field's value. -func (s *UpdateTransformerOutput) SetMappingTemplate(v string) *UpdateTransformerOutput { - s.MappingTemplate = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *UpdateTransformerOutput) SetModifiedAt(v time.Time) *UpdateTransformerOutput { - s.ModifiedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateTransformerOutput) SetName(v string) *UpdateTransformerOutput { - s.Name = &v - return s -} - -// SetSampleDocument sets the SampleDocument field's value. -func (s *UpdateTransformerOutput) SetSampleDocument(v string) *UpdateTransformerOutput { - s.SampleDocument = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateTransformerOutput) SetStatus(v string) *UpdateTransformerOutput { - s.Status = &v - return s -} - -// SetTransformerArn sets the TransformerArn field's value. -func (s *UpdateTransformerOutput) SetTransformerArn(v string) *UpdateTransformerOutput { - s.TransformerArn = &v - return s -} - -// SetTransformerId sets the TransformerId field's value. -func (s *UpdateTransformerOutput) SetTransformerId(v string) *UpdateTransformerOutput { - s.TransformerId = &v - return s -} - -// Occurs when a B2BI object cannot be validated against a request from another -// object. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"10" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A structure that contains the X12 transaction set and version. The X12 structure -// is used when the system transforms an EDI (electronic data interchange) file. -type X12Details struct { - _ struct{} `type:"structure"` - - // Returns an enumerated type where each value identifies an X12 transaction - // set. Transaction sets are maintained by the X12 Accredited Standards Committee. - TransactionSet *string `locationName:"transactionSet" type:"string" enum:"X12TransactionSet"` - - // Returns the version to use for the specified X12 transaction set. Supported - // versions are 4010, 4030, and 5010. - Version *string `locationName:"version" type:"string" enum:"X12Version"` -} - -// 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 X12Details) 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 X12Details) GoString() string { - return s.String() -} - -// SetTransactionSet sets the TransactionSet field's value. -func (s *X12Details) SetTransactionSet(v string) *X12Details { - s.TransactionSet = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *X12Details) SetVersion(v string) *X12Details { - s.Version = &v - return s -} - -const ( - // CapabilityTypeEdi is a CapabilityType enum value - CapabilityTypeEdi = "edi" -) - -// CapabilityType_Values returns all elements of the CapabilityType enum -func CapabilityType_Values() []string { - return []string{ - CapabilityTypeEdi, - } -} - -const ( - // FileFormatXml is a FileFormat enum value - FileFormatXml = "XML" - - // FileFormatJson is a FileFormat enum value - FileFormatJson = "JSON" -) - -// FileFormat_Values returns all elements of the FileFormat enum -func FileFormat_Values() []string { - return []string{ - FileFormatXml, - FileFormatJson, - } -} - -const ( - // LoggingEnabled is a Logging enum value - LoggingEnabled = "ENABLED" - - // LoggingDisabled is a Logging enum value - LoggingDisabled = "DISABLED" -) - -// Logging_Values returns all elements of the Logging enum -func Logging_Values() []string { - return []string{ - LoggingEnabled, - LoggingDisabled, - } -} - -const ( - // TransformerJobStatusRunning is a TransformerJobStatus enum value - TransformerJobStatusRunning = "running" - - // TransformerJobStatusSucceeded is a TransformerJobStatus enum value - TransformerJobStatusSucceeded = "succeeded" - - // TransformerJobStatusFailed is a TransformerJobStatus enum value - TransformerJobStatusFailed = "failed" -) - -// TransformerJobStatus_Values returns all elements of the TransformerJobStatus enum -func TransformerJobStatus_Values() []string { - return []string{ - TransformerJobStatusRunning, - TransformerJobStatusSucceeded, - TransformerJobStatusFailed, - } -} - -const ( - // TransformerStatusActive is a TransformerStatus enum value - TransformerStatusActive = "active" - - // TransformerStatusInactive is a TransformerStatus enum value - TransformerStatusInactive = "inactive" -) - -// TransformerStatus_Values returns all elements of the TransformerStatus enum -func TransformerStatus_Values() []string { - return []string{ - TransformerStatusActive, - TransformerStatusInactive, - } -} - -const ( - // X12TransactionSetX12110 is a X12TransactionSet enum value - X12TransactionSetX12110 = "X12_110" - - // X12TransactionSetX12180 is a X12TransactionSet enum value - X12TransactionSetX12180 = "X12_180" - - // X12TransactionSetX12204 is a X12TransactionSet enum value - X12TransactionSetX12204 = "X12_204" - - // X12TransactionSetX12210 is a X12TransactionSet enum value - X12TransactionSetX12210 = "X12_210" - - // X12TransactionSetX12214 is a X12TransactionSet enum value - X12TransactionSetX12214 = "X12_214" - - // X12TransactionSetX12215 is a X12TransactionSet enum value - X12TransactionSetX12215 = "X12_215" - - // X12TransactionSetX12310 is a X12TransactionSet enum value - X12TransactionSetX12310 = "X12_310" - - // X12TransactionSetX12315 is a X12TransactionSet enum value - X12TransactionSetX12315 = "X12_315" - - // X12TransactionSetX12322 is a X12TransactionSet enum value - X12TransactionSetX12322 = "X12_322" - - // X12TransactionSetX12404 is a X12TransactionSet enum value - X12TransactionSetX12404 = "X12_404" - - // X12TransactionSetX12410 is a X12TransactionSet enum value - X12TransactionSetX12410 = "X12_410" - - // X12TransactionSetX12820 is a X12TransactionSet enum value - X12TransactionSetX12820 = "X12_820" - - // X12TransactionSetX12824 is a X12TransactionSet enum value - X12TransactionSetX12824 = "X12_824" - - // X12TransactionSetX12830 is a X12TransactionSet enum value - X12TransactionSetX12830 = "X12_830" - - // X12TransactionSetX12846 is a X12TransactionSet enum value - X12TransactionSetX12846 = "X12_846" - - // X12TransactionSetX12850 is a X12TransactionSet enum value - X12TransactionSetX12850 = "X12_850" - - // X12TransactionSetX12852 is a X12TransactionSet enum value - X12TransactionSetX12852 = "X12_852" - - // X12TransactionSetX12855 is a X12TransactionSet enum value - X12TransactionSetX12855 = "X12_855" - - // X12TransactionSetX12856 is a X12TransactionSet enum value - X12TransactionSetX12856 = "X12_856" - - // X12TransactionSetX12860 is a X12TransactionSet enum value - X12TransactionSetX12860 = "X12_860" - - // X12TransactionSetX12861 is a X12TransactionSet enum value - X12TransactionSetX12861 = "X12_861" - - // X12TransactionSetX12864 is a X12TransactionSet enum value - X12TransactionSetX12864 = "X12_864" - - // X12TransactionSetX12940 is a X12TransactionSet enum value - X12TransactionSetX12940 = "X12_940" - - // X12TransactionSetX12990 is a X12TransactionSet enum value - X12TransactionSetX12990 = "X12_990" - - // X12TransactionSetX12997 is a X12TransactionSet enum value - X12TransactionSetX12997 = "X12_997" -) - -// X12TransactionSet_Values returns all elements of the X12TransactionSet enum -func X12TransactionSet_Values() []string { - return []string{ - X12TransactionSetX12110, - X12TransactionSetX12180, - X12TransactionSetX12204, - X12TransactionSetX12210, - X12TransactionSetX12214, - X12TransactionSetX12215, - X12TransactionSetX12310, - X12TransactionSetX12315, - X12TransactionSetX12322, - X12TransactionSetX12404, - X12TransactionSetX12410, - X12TransactionSetX12820, - X12TransactionSetX12824, - X12TransactionSetX12830, - X12TransactionSetX12846, - X12TransactionSetX12850, - X12TransactionSetX12852, - X12TransactionSetX12855, - X12TransactionSetX12856, - X12TransactionSetX12860, - X12TransactionSetX12861, - X12TransactionSetX12864, - X12TransactionSetX12940, - X12TransactionSetX12990, - X12TransactionSetX12997, - } -} - -const ( - // X12VersionVersion4010 is a X12Version enum value - X12VersionVersion4010 = "VERSION_4010" - - // X12VersionVersion4030 is a X12Version enum value - X12VersionVersion4030 = "VERSION_4030" - - // X12VersionVersion5010 is a X12Version enum value - X12VersionVersion5010 = "VERSION_5010" -) - -// X12Version_Values returns all elements of the X12Version enum -func X12Version_Values() []string { - return []string{ - X12VersionVersion4010, - X12VersionVersion4030, - X12VersionVersion5010, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/b2biiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/b2biiface/interface.go deleted file mode 100644 index f5c228634ad4..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/b2biiface/interface.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package b2biiface provides an interface to enable mocking the AWS B2B Data Interchange service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package b2biiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi" -) - -// B2biAPI provides an interface to enable mocking the -// b2bi.B2bi service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS B2B Data Interchange. -// func myFunc(svc b2biiface.B2biAPI) bool { -// // Make svc.CreateCapability request -// } -// -// func main() { -// sess := session.New() -// svc := b2bi.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockB2biClient struct { -// b2biiface.B2biAPI -// } -// func (m *mockB2biClient) CreateCapability(input *b2bi.CreateCapabilityInput) (*b2bi.CreateCapabilityOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockB2biClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type B2biAPI interface { - CreateCapability(*b2bi.CreateCapabilityInput) (*b2bi.CreateCapabilityOutput, error) - CreateCapabilityWithContext(aws.Context, *b2bi.CreateCapabilityInput, ...request.Option) (*b2bi.CreateCapabilityOutput, error) - CreateCapabilityRequest(*b2bi.CreateCapabilityInput) (*request.Request, *b2bi.CreateCapabilityOutput) - - CreatePartnership(*b2bi.CreatePartnershipInput) (*b2bi.CreatePartnershipOutput, error) - CreatePartnershipWithContext(aws.Context, *b2bi.CreatePartnershipInput, ...request.Option) (*b2bi.CreatePartnershipOutput, error) - CreatePartnershipRequest(*b2bi.CreatePartnershipInput) (*request.Request, *b2bi.CreatePartnershipOutput) - - CreateProfile(*b2bi.CreateProfileInput) (*b2bi.CreateProfileOutput, error) - CreateProfileWithContext(aws.Context, *b2bi.CreateProfileInput, ...request.Option) (*b2bi.CreateProfileOutput, error) - CreateProfileRequest(*b2bi.CreateProfileInput) (*request.Request, *b2bi.CreateProfileOutput) - - CreateTransformer(*b2bi.CreateTransformerInput) (*b2bi.CreateTransformerOutput, error) - CreateTransformerWithContext(aws.Context, *b2bi.CreateTransformerInput, ...request.Option) (*b2bi.CreateTransformerOutput, error) - CreateTransformerRequest(*b2bi.CreateTransformerInput) (*request.Request, *b2bi.CreateTransformerOutput) - - DeleteCapability(*b2bi.DeleteCapabilityInput) (*b2bi.DeleteCapabilityOutput, error) - DeleteCapabilityWithContext(aws.Context, *b2bi.DeleteCapabilityInput, ...request.Option) (*b2bi.DeleteCapabilityOutput, error) - DeleteCapabilityRequest(*b2bi.DeleteCapabilityInput) (*request.Request, *b2bi.DeleteCapabilityOutput) - - DeletePartnership(*b2bi.DeletePartnershipInput) (*b2bi.DeletePartnershipOutput, error) - DeletePartnershipWithContext(aws.Context, *b2bi.DeletePartnershipInput, ...request.Option) (*b2bi.DeletePartnershipOutput, error) - DeletePartnershipRequest(*b2bi.DeletePartnershipInput) (*request.Request, *b2bi.DeletePartnershipOutput) - - DeleteProfile(*b2bi.DeleteProfileInput) (*b2bi.DeleteProfileOutput, error) - DeleteProfileWithContext(aws.Context, *b2bi.DeleteProfileInput, ...request.Option) (*b2bi.DeleteProfileOutput, error) - DeleteProfileRequest(*b2bi.DeleteProfileInput) (*request.Request, *b2bi.DeleteProfileOutput) - - DeleteTransformer(*b2bi.DeleteTransformerInput) (*b2bi.DeleteTransformerOutput, error) - DeleteTransformerWithContext(aws.Context, *b2bi.DeleteTransformerInput, ...request.Option) (*b2bi.DeleteTransformerOutput, error) - DeleteTransformerRequest(*b2bi.DeleteTransformerInput) (*request.Request, *b2bi.DeleteTransformerOutput) - - GetCapability(*b2bi.GetCapabilityInput) (*b2bi.GetCapabilityOutput, error) - GetCapabilityWithContext(aws.Context, *b2bi.GetCapabilityInput, ...request.Option) (*b2bi.GetCapabilityOutput, error) - GetCapabilityRequest(*b2bi.GetCapabilityInput) (*request.Request, *b2bi.GetCapabilityOutput) - - GetPartnership(*b2bi.GetPartnershipInput) (*b2bi.GetPartnershipOutput, error) - GetPartnershipWithContext(aws.Context, *b2bi.GetPartnershipInput, ...request.Option) (*b2bi.GetPartnershipOutput, error) - GetPartnershipRequest(*b2bi.GetPartnershipInput) (*request.Request, *b2bi.GetPartnershipOutput) - - GetProfile(*b2bi.GetProfileInput) (*b2bi.GetProfileOutput, error) - GetProfileWithContext(aws.Context, *b2bi.GetProfileInput, ...request.Option) (*b2bi.GetProfileOutput, error) - GetProfileRequest(*b2bi.GetProfileInput) (*request.Request, *b2bi.GetProfileOutput) - - GetTransformer(*b2bi.GetTransformerInput) (*b2bi.GetTransformerOutput, error) - GetTransformerWithContext(aws.Context, *b2bi.GetTransformerInput, ...request.Option) (*b2bi.GetTransformerOutput, error) - GetTransformerRequest(*b2bi.GetTransformerInput) (*request.Request, *b2bi.GetTransformerOutput) - - GetTransformerJob(*b2bi.GetTransformerJobInput) (*b2bi.GetTransformerJobOutput, error) - GetTransformerJobWithContext(aws.Context, *b2bi.GetTransformerJobInput, ...request.Option) (*b2bi.GetTransformerJobOutput, error) - GetTransformerJobRequest(*b2bi.GetTransformerJobInput) (*request.Request, *b2bi.GetTransformerJobOutput) - - ListCapabilities(*b2bi.ListCapabilitiesInput) (*b2bi.ListCapabilitiesOutput, error) - ListCapabilitiesWithContext(aws.Context, *b2bi.ListCapabilitiesInput, ...request.Option) (*b2bi.ListCapabilitiesOutput, error) - ListCapabilitiesRequest(*b2bi.ListCapabilitiesInput) (*request.Request, *b2bi.ListCapabilitiesOutput) - - ListCapabilitiesPages(*b2bi.ListCapabilitiesInput, func(*b2bi.ListCapabilitiesOutput, bool) bool) error - ListCapabilitiesPagesWithContext(aws.Context, *b2bi.ListCapabilitiesInput, func(*b2bi.ListCapabilitiesOutput, bool) bool, ...request.Option) error - - ListPartnerships(*b2bi.ListPartnershipsInput) (*b2bi.ListPartnershipsOutput, error) - ListPartnershipsWithContext(aws.Context, *b2bi.ListPartnershipsInput, ...request.Option) (*b2bi.ListPartnershipsOutput, error) - ListPartnershipsRequest(*b2bi.ListPartnershipsInput) (*request.Request, *b2bi.ListPartnershipsOutput) - - ListPartnershipsPages(*b2bi.ListPartnershipsInput, func(*b2bi.ListPartnershipsOutput, bool) bool) error - ListPartnershipsPagesWithContext(aws.Context, *b2bi.ListPartnershipsInput, func(*b2bi.ListPartnershipsOutput, bool) bool, ...request.Option) error - - ListProfiles(*b2bi.ListProfilesInput) (*b2bi.ListProfilesOutput, error) - ListProfilesWithContext(aws.Context, *b2bi.ListProfilesInput, ...request.Option) (*b2bi.ListProfilesOutput, error) - ListProfilesRequest(*b2bi.ListProfilesInput) (*request.Request, *b2bi.ListProfilesOutput) - - ListProfilesPages(*b2bi.ListProfilesInput, func(*b2bi.ListProfilesOutput, bool) bool) error - ListProfilesPagesWithContext(aws.Context, *b2bi.ListProfilesInput, func(*b2bi.ListProfilesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*b2bi.ListTagsForResourceInput) (*b2bi.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *b2bi.ListTagsForResourceInput, ...request.Option) (*b2bi.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*b2bi.ListTagsForResourceInput) (*request.Request, *b2bi.ListTagsForResourceOutput) - - ListTransformers(*b2bi.ListTransformersInput) (*b2bi.ListTransformersOutput, error) - ListTransformersWithContext(aws.Context, *b2bi.ListTransformersInput, ...request.Option) (*b2bi.ListTransformersOutput, error) - ListTransformersRequest(*b2bi.ListTransformersInput) (*request.Request, *b2bi.ListTransformersOutput) - - ListTransformersPages(*b2bi.ListTransformersInput, func(*b2bi.ListTransformersOutput, bool) bool) error - ListTransformersPagesWithContext(aws.Context, *b2bi.ListTransformersInput, func(*b2bi.ListTransformersOutput, bool) bool, ...request.Option) error - - StartTransformerJob(*b2bi.StartTransformerJobInput) (*b2bi.StartTransformerJobOutput, error) - StartTransformerJobWithContext(aws.Context, *b2bi.StartTransformerJobInput, ...request.Option) (*b2bi.StartTransformerJobOutput, error) - StartTransformerJobRequest(*b2bi.StartTransformerJobInput) (*request.Request, *b2bi.StartTransformerJobOutput) - - TagResource(*b2bi.TagResourceInput) (*b2bi.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *b2bi.TagResourceInput, ...request.Option) (*b2bi.TagResourceOutput, error) - TagResourceRequest(*b2bi.TagResourceInput) (*request.Request, *b2bi.TagResourceOutput) - - TestMapping(*b2bi.TestMappingInput) (*b2bi.TestMappingOutput, error) - TestMappingWithContext(aws.Context, *b2bi.TestMappingInput, ...request.Option) (*b2bi.TestMappingOutput, error) - TestMappingRequest(*b2bi.TestMappingInput) (*request.Request, *b2bi.TestMappingOutput) - - TestParsing(*b2bi.TestParsingInput) (*b2bi.TestParsingOutput, error) - TestParsingWithContext(aws.Context, *b2bi.TestParsingInput, ...request.Option) (*b2bi.TestParsingOutput, error) - TestParsingRequest(*b2bi.TestParsingInput) (*request.Request, *b2bi.TestParsingOutput) - - UntagResource(*b2bi.UntagResourceInput) (*b2bi.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *b2bi.UntagResourceInput, ...request.Option) (*b2bi.UntagResourceOutput, error) - UntagResourceRequest(*b2bi.UntagResourceInput) (*request.Request, *b2bi.UntagResourceOutput) - - UpdateCapability(*b2bi.UpdateCapabilityInput) (*b2bi.UpdateCapabilityOutput, error) - UpdateCapabilityWithContext(aws.Context, *b2bi.UpdateCapabilityInput, ...request.Option) (*b2bi.UpdateCapabilityOutput, error) - UpdateCapabilityRequest(*b2bi.UpdateCapabilityInput) (*request.Request, *b2bi.UpdateCapabilityOutput) - - UpdatePartnership(*b2bi.UpdatePartnershipInput) (*b2bi.UpdatePartnershipOutput, error) - UpdatePartnershipWithContext(aws.Context, *b2bi.UpdatePartnershipInput, ...request.Option) (*b2bi.UpdatePartnershipOutput, error) - UpdatePartnershipRequest(*b2bi.UpdatePartnershipInput) (*request.Request, *b2bi.UpdatePartnershipOutput) - - UpdateProfile(*b2bi.UpdateProfileInput) (*b2bi.UpdateProfileOutput, error) - UpdateProfileWithContext(aws.Context, *b2bi.UpdateProfileInput, ...request.Option) (*b2bi.UpdateProfileOutput, error) - UpdateProfileRequest(*b2bi.UpdateProfileInput) (*request.Request, *b2bi.UpdateProfileOutput) - - UpdateTransformer(*b2bi.UpdateTransformerInput) (*b2bi.UpdateTransformerOutput, error) - UpdateTransformerWithContext(aws.Context, *b2bi.UpdateTransformerInput, ...request.Option) (*b2bi.UpdateTransformerOutput, error) - UpdateTransformerRequest(*b2bi.UpdateTransformerInput) (*request.Request, *b2bi.UpdateTransformerOutput) -} - -var _ B2biAPI = (*b2bi.B2bi)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/doc.go deleted file mode 100644 index 49e8d9e0a17d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/doc.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package b2bi provides the client and types for making API -// requests to AWS B2B Data Interchange. -// -// This is the Amazon Web Services B2B Data Interchange API Reference. It provides -// descriptions, API request parameters, and the XML response for each of the -// B2BI API actions. -// -// B2BI enables automated exchange of EDI (electronic data interchange) based -// business-critical transactions at cloud scale, with elasticity and pay-as-you-go -// pricing. Businesses use EDI documents to exchange transactional data with -// trading partners, such as suppliers and end customers, using standardized -// formats such as X12. -// -// Rather than actually running a command, you can use the --generate-cli-skeleton -// parameter with any API call to generate and display a parameter template. -// You can then use the generated template to customize and use as input on -// a later command. For details, see Generate and use a parameter skeleton file -// (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-skeleton.html#cli-usage-skeleton-generate). -// -// See https://docs.aws.amazon.com/goto/WebAPI/b2bi-2022-06-23 for more information on this service. -// -// See b2bi package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/b2bi/ -// -// # Using the Client -// -// To contact AWS B2B Data Interchange with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS B2B Data Interchange client B2bi for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/b2bi/#New -package b2bi diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/errors.go deleted file mode 100644 index 22cad6f3f736..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/errors.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package b2bi - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // A conflict exception is thrown when you attempt to delete a resource (such - // as a profile or a capability) that is being used by other resources. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // This exception is thrown when an error occurs in the Amazon Web Services - // B2B Data Interchange service. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Occurs when the requested resource does not exist, or cannot be found. In - // some cases, the resource exists in a region other than the region specified - // in the API call. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Occurs when the calling command attempts to exceed one of the service quotas, - // for example trying to create a capability when you already have the maximum - // number of capabilities allowed. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to throttling: the data speed and rendering may - // be limited depending on various parameters and conditions. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Occurs when a B2BI object cannot be validated against a request from another - // object. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/service.go deleted file mode 100644 index 3f51175bfcf7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/b2bi/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package b2bi - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// B2bi provides the API operation methods for making requests to -// AWS B2B Data Interchange. See this package's package overview docs -// for details on the service. -// -// B2bi methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type B2bi struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "b2bi" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "b2bi" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the B2bi client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a B2bi client from just a session. -// svc := b2bi.New(mySession) -// -// // Create a B2bi client with additional configuration -// svc := b2bi.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *B2bi { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "b2bi" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *B2bi { - svc := &B2bi{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-06-23", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.0", - TargetPrefix: "B2BI", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a B2bi operation and runs any -// custom request initialization. -func (c *B2bi) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/api.go deleted file mode 100644 index 46c696c55d39..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/api.go +++ /dev/null @@ -1,3216 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package backupstorage - -import ( - "fmt" - "io" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opDeleteObject = "DeleteObject" - -// DeleteObjectRequest generates a "aws/request.Request" representing the -// client's request for the DeleteObject 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 DeleteObject for more information on using the DeleteObject -// 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 DeleteObjectRequest method. -// req, resp := client.DeleteObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/DeleteObject -func (c *BackupStorage) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request, output *DeleteObjectOutput) { - op := &request.Operation{ - Name: opDeleteObject, - HTTPMethod: "DELETE", - HTTPPath: "/backup-jobs/{jobId}/object/{objectName}", - } - - if input == nil { - input = &DeleteObjectInput{} - } - - output = &DeleteObjectOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteObject API operation for AWS Backup Storage. -// -// Delete Object from the incremental base Backup. -// -// 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 AWS Backup Storage's -// API operation DeleteObject for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// Retryable exception, indicates internal server error. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - ResourceNotFoundException -// Non-retryable exception. Attempted to make an operation on non-existing or -// expired resource. -// -// - ThrottlingException -// Increased rate over throttling limits. Can be retried with exponential backoff. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/DeleteObject -func (c *BackupStorage) DeleteObject(input *DeleteObjectInput) (*DeleteObjectOutput, error) { - req, out := c.DeleteObjectRequest(input) - return out, req.Send() -} - -// DeleteObjectWithContext is the same as DeleteObject with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteObject 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 *BackupStorage) DeleteObjectWithContext(ctx aws.Context, input *DeleteObjectInput, opts ...request.Option) (*DeleteObjectOutput, error) { - req, out := c.DeleteObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetChunk = "GetChunk" - -// GetChunkRequest generates a "aws/request.Request" representing the -// client's request for the GetChunk 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 GetChunk for more information on using the GetChunk -// 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 GetChunkRequest method. -// req, resp := client.GetChunkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/GetChunk -func (c *BackupStorage) GetChunkRequest(input *GetChunkInput) (req *request.Request, output *GetChunkOutput) { - op := &request.Operation{ - Name: opGetChunk, - HTTPMethod: "GET", - HTTPPath: "/restore-jobs/{jobId}/chunk/{chunkToken}", - } - - if input == nil { - input = &GetChunkInput{} - } - - output = &GetChunkOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChunk API operation for AWS Backup Storage. -// -// Gets the specified object's chunk. -// -// 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 AWS Backup Storage's -// API operation GetChunk for usage and error information. -// -// Returned Error Types: -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - ResourceNotFoundException -// Non-retryable exception. Attempted to make an operation on non-existing or -// expired resource. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - ThrottlingException -// Increased rate over throttling limits. Can be retried with exponential backoff. -// -// - KMSInvalidKeyUsageException -// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception -// message for details. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/GetChunk -func (c *BackupStorage) GetChunk(input *GetChunkInput) (*GetChunkOutput, error) { - req, out := c.GetChunkRequest(input) - return out, req.Send() -} - -// GetChunkWithContext is the same as GetChunk with the addition of -// the ability to pass a context and additional request options. -// -// See GetChunk 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 *BackupStorage) GetChunkWithContext(ctx aws.Context, input *GetChunkInput, opts ...request.Option) (*GetChunkOutput, error) { - req, out := c.GetChunkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectMetadata = "GetObjectMetadata" - -// GetObjectMetadataRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectMetadata 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 GetObjectMetadata for more information on using the GetObjectMetadata -// 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 GetObjectMetadataRequest method. -// req, resp := client.GetObjectMetadataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/GetObjectMetadata -func (c *BackupStorage) GetObjectMetadataRequest(input *GetObjectMetadataInput) (req *request.Request, output *GetObjectMetadataOutput) { - op := &request.Operation{ - Name: opGetObjectMetadata, - HTTPMethod: "GET", - HTTPPath: "/restore-jobs/{jobId}/object/{objectToken}/metadata", - } - - if input == nil { - input = &GetObjectMetadataInput{} - } - - output = &GetObjectMetadataOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectMetadata API operation for AWS Backup Storage. -// -// Get metadata associated with an Object. -// -// 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 AWS Backup Storage's -// API operation GetObjectMetadata for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// Retryable exception, indicates internal server error. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - ResourceNotFoundException -// Non-retryable exception. Attempted to make an operation on non-existing or -// expired resource. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - ThrottlingException -// Increased rate over throttling limits. Can be retried with exponential backoff. -// -// - KMSInvalidKeyUsageException -// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception -// message for details. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/GetObjectMetadata -func (c *BackupStorage) GetObjectMetadata(input *GetObjectMetadataInput) (*GetObjectMetadataOutput, error) { - req, out := c.GetObjectMetadataRequest(input) - return out, req.Send() -} - -// GetObjectMetadataWithContext is the same as GetObjectMetadata with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectMetadata 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 *BackupStorage) GetObjectMetadataWithContext(ctx aws.Context, input *GetObjectMetadataInput, opts ...request.Option) (*GetObjectMetadataOutput, error) { - req, out := c.GetObjectMetadataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListChunks = "ListChunks" - -// ListChunksRequest generates a "aws/request.Request" representing the -// client's request for the ListChunks 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 ListChunks for more information on using the ListChunks -// 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 ListChunksRequest method. -// req, resp := client.ListChunksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/ListChunks -func (c *BackupStorage) ListChunksRequest(input *ListChunksInput) (req *request.Request, output *ListChunksOutput) { - op := &request.Operation{ - Name: opListChunks, - HTTPMethod: "GET", - HTTPPath: "/restore-jobs/{jobId}/chunks/{objectToken}/list", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListChunksInput{} - } - - output = &ListChunksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListChunks API operation for AWS Backup Storage. -// -// # List chunks in a given Object -// -// 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 AWS Backup Storage's -// API operation ListChunks for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// Retryable exception, indicates internal server error. -// -// - ResourceNotFoundException -// Non-retryable exception. Attempted to make an operation on non-existing or -// expired resource. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/ListChunks -func (c *BackupStorage) ListChunks(input *ListChunksInput) (*ListChunksOutput, error) { - req, out := c.ListChunksRequest(input) - return out, req.Send() -} - -// ListChunksWithContext is the same as ListChunks with the addition of -// the ability to pass a context and additional request options. -// -// See ListChunks 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 *BackupStorage) ListChunksWithContext(ctx aws.Context, input *ListChunksInput, opts ...request.Option) (*ListChunksOutput, error) { - req, out := c.ListChunksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListChunksPages iterates over the pages of a ListChunks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChunks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListChunks operation. -// pageNum := 0 -// err := client.ListChunksPages(params, -// func(page *backupstorage.ListChunksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BackupStorage) ListChunksPages(input *ListChunksInput, fn func(*ListChunksOutput, bool) bool) error { - return c.ListChunksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChunksPagesWithContext same as ListChunksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BackupStorage) ListChunksPagesWithContext(ctx aws.Context, input *ListChunksInput, fn func(*ListChunksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListChunksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListChunksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListChunksOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListObjects = "ListObjects" - -// ListObjectsRequest generates a "aws/request.Request" representing the -// client's request for the ListObjects 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 ListObjects for more information on using the ListObjects -// 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 ListObjectsRequest method. -// req, resp := client.ListObjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/ListObjects -func (c *BackupStorage) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, output *ListObjectsOutput) { - op := &request.Operation{ - Name: opListObjects, - HTTPMethod: "GET", - HTTPPath: "/restore-jobs/{jobId}/objects/list", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListObjectsInput{} - } - - output = &ListObjectsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListObjects API operation for AWS Backup Storage. -// -// List all Objects in a given Backup. -// -// 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 AWS Backup Storage's -// API operation ListObjects for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// Retryable exception, indicates internal server error. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - ThrottlingException -// Increased rate over throttling limits. Can be retried with exponential backoff. -// -// - ResourceNotFoundException -// Non-retryable exception. Attempted to make an operation on non-existing or -// expired resource. -// -// - KMSInvalidKeyUsageException -// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception -// message for details. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/ListObjects -func (c *BackupStorage) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error) { - req, out := c.ListObjectsRequest(input) - return out, req.Send() -} - -// ListObjectsWithContext is the same as ListObjects with the addition of -// the ability to pass a context and additional request options. -// -// See ListObjects 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 *BackupStorage) ListObjectsWithContext(ctx aws.Context, input *ListObjectsInput, opts ...request.Option) (*ListObjectsOutput, error) { - req, out := c.ListObjectsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListObjectsPages iterates over the pages of a ListObjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjects method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListObjects operation. -// pageNum := 0 -// err := client.ListObjectsPages(params, -// func(page *backupstorage.ListObjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BackupStorage) ListObjectsPages(input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool) error { - return c.ListObjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectsPagesWithContext same as ListObjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BackupStorage) ListObjectsPagesWithContext(ctx aws.Context, input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListObjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opNotifyObjectComplete = "NotifyObjectComplete" - -// NotifyObjectCompleteRequest generates a "aws/request.Request" representing the -// client's request for the NotifyObjectComplete 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 NotifyObjectComplete for more information on using the NotifyObjectComplete -// 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 NotifyObjectCompleteRequest method. -// req, resp := client.NotifyObjectCompleteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/NotifyObjectComplete -func (c *BackupStorage) NotifyObjectCompleteRequest(input *NotifyObjectCompleteInput) (req *request.Request, output *NotifyObjectCompleteOutput) { - op := &request.Operation{ - Name: opNotifyObjectComplete, - HTTPMethod: "PUT", - HTTPPath: "/backup-jobs/{jobId}/object/{uploadId}/complete", - } - - if input == nil { - input = &NotifyObjectCompleteInput{} - } - - output = &NotifyObjectCompleteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Sign.Remove(v4.SignRequestHandler) - handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) - req.Handlers.Sign.PushFrontNamed(handler) - return -} - -// NotifyObjectComplete API operation for AWS Backup Storage. -// -// # Complete upload -// -// 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 AWS Backup Storage's -// API operation NotifyObjectComplete for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// Retryable exception, indicates internal server error. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - NotReadableInputStreamException -// Retryalble exception. Indicated issues while reading an input stream due -// to the networking issues or connection drop on the client side. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - ThrottlingException -// Increased rate over throttling limits. Can be retried with exponential backoff. -// -// - KMSInvalidKeyUsageException -// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception -// message for details. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/NotifyObjectComplete -func (c *BackupStorage) NotifyObjectComplete(input *NotifyObjectCompleteInput) (*NotifyObjectCompleteOutput, error) { - req, out := c.NotifyObjectCompleteRequest(input) - return out, req.Send() -} - -// NotifyObjectCompleteWithContext is the same as NotifyObjectComplete with the addition of -// the ability to pass a context and additional request options. -// -// See NotifyObjectComplete 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 *BackupStorage) NotifyObjectCompleteWithContext(ctx aws.Context, input *NotifyObjectCompleteInput, opts ...request.Option) (*NotifyObjectCompleteOutput, error) { - req, out := c.NotifyObjectCompleteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutChunk = "PutChunk" - -// PutChunkRequest generates a "aws/request.Request" representing the -// client's request for the PutChunk 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 PutChunk for more information on using the PutChunk -// 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 PutChunkRequest method. -// req, resp := client.PutChunkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/PutChunk -func (c *BackupStorage) PutChunkRequest(input *PutChunkInput) (req *request.Request, output *PutChunkOutput) { - op := &request.Operation{ - Name: opPutChunk, - HTTPMethod: "PUT", - HTTPPath: "/backup-jobs/{jobId}/chunk/{uploadId}/{chunkIndex}", - } - - if input == nil { - input = &PutChunkInput{} - } - - output = &PutChunkOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Sign.Remove(v4.SignRequestHandler) - handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) - req.Handlers.Sign.PushFrontNamed(handler) - return -} - -// PutChunk API operation for AWS Backup Storage. -// -// Upload chunk. -// -// 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 AWS Backup Storage's -// API operation PutChunk for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// Retryable exception, indicates internal server error. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - NotReadableInputStreamException -// Retryalble exception. Indicated issues while reading an input stream due -// to the networking issues or connection drop on the client side. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - ThrottlingException -// Increased rate over throttling limits. Can be retried with exponential backoff. -// -// - KMSInvalidKeyUsageException -// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception -// message for details. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/PutChunk -func (c *BackupStorage) PutChunk(input *PutChunkInput) (*PutChunkOutput, error) { - req, out := c.PutChunkRequest(input) - return out, req.Send() -} - -// PutChunkWithContext is the same as PutChunk with the addition of -// the ability to pass a context and additional request options. -// -// See PutChunk 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 *BackupStorage) PutChunkWithContext(ctx aws.Context, input *PutChunkInput, opts ...request.Option) (*PutChunkOutput, error) { - req, out := c.PutChunkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObject = "PutObject" - -// PutObjectRequest generates a "aws/request.Request" representing the -// client's request for the PutObject 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 PutObject for more information on using the PutObject -// 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 PutObjectRequest method. -// req, resp := client.PutObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/PutObject -func (c *BackupStorage) PutObjectRequest(input *PutObjectInput) (req *request.Request, output *PutObjectOutput) { - op := &request.Operation{ - Name: opPutObject, - HTTPMethod: "PUT", - HTTPPath: "/backup-jobs/{jobId}/object/{objectName}/put-object", - } - - if input == nil { - input = &PutObjectInput{} - } - - output = &PutObjectOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Sign.Remove(v4.SignRequestHandler) - handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) - req.Handlers.Sign.PushFrontNamed(handler) - return -} - -// PutObject API operation for AWS Backup Storage. -// -// Upload object that can store object metadata String and data blob in single -// API call using inline chunk field. -// -// 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 AWS Backup Storage's -// API operation PutObject for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// Retryable exception, indicates internal server error. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - NotReadableInputStreamException -// Retryalble exception. Indicated issues while reading an input stream due -// to the networking issues or connection drop on the client side. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - ThrottlingException -// Increased rate over throttling limits. Can be retried with exponential backoff. -// -// - KMSInvalidKeyUsageException -// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception -// message for details. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/PutObject -func (c *BackupStorage) PutObject(input *PutObjectInput) (*PutObjectOutput, error) { - req, out := c.PutObjectRequest(input) - return out, req.Send() -} - -// PutObjectWithContext is the same as PutObject with the addition of -// the ability to pass a context and additional request options. -// -// See PutObject 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 *BackupStorage) PutObjectWithContext(ctx aws.Context, input *PutObjectInput, opts ...request.Option) (*PutObjectOutput, error) { - req, out := c.PutObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartObject = "StartObject" - -// StartObjectRequest generates a "aws/request.Request" representing the -// client's request for the StartObject 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 StartObject for more information on using the StartObject -// 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 StartObjectRequest method. -// req, resp := client.StartObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/StartObject -func (c *BackupStorage) StartObjectRequest(input *StartObjectInput) (req *request.Request, output *StartObjectOutput) { - op := &request.Operation{ - Name: opStartObject, - HTTPMethod: "PUT", - HTTPPath: "/backup-jobs/{jobId}/object/{objectName}", - } - - if input == nil { - input = &StartObjectInput{} - } - - output = &StartObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartObject API operation for AWS Backup Storage. -// -// Start upload containing one or many chunks. -// -// 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 AWS Backup Storage's -// API operation StartObject for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// Retryable exception, indicates internal server error. -// -// - ServiceInternalException -// Deprecated. To be removed from the model. -// -// - RetryableException -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -// -// - IllegalArgumentException -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -// -// - ResourceNotFoundException -// Non-retryable exception. Attempted to make an operation on non-existing or -// expired resource. -// -// - DataAlreadyExistsException -// Non-retryable exception. Attempted to create already existing object or chunk. -// This message contains a checksum of already presented data. -// -// - ThrottlingException -// Increased rate over throttling limits. Can be retried with exponential backoff. -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10/StartObject -func (c *BackupStorage) StartObject(input *StartObjectInput) (*StartObjectOutput, error) { - req, out := c.StartObjectRequest(input) - return out, req.Send() -} - -// StartObjectWithContext is the same as StartObject with the addition of -// the ability to pass a context and additional request options. -// -// See StartObject 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 *BackupStorage) StartObjectWithContext(ctx aws.Context, input *StartObjectInput, opts ...request.Option) (*StartObjectOutput, error) { - req, out := c.StartObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Object -type BackupObject struct { - _ struct{} `type:"structure"` - - // Number of chunks in object - ChunksCount *int64 `type:"long"` - - // Metadata string associated with the Object - MetadataString *string `type:"string"` - - // Object name - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Object checksum - // - // ObjectChecksum is a required field - ObjectChecksum *string `type:"string" required:"true"` - - // Checksum algorithm - // - // ObjectChecksumAlgorithm is a required field - ObjectChecksumAlgorithm *string `type:"string" required:"true" enum:"SummaryChecksumAlgorithm"` - - // Object token - // - // ObjectToken is a required field - ObjectToken *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 BackupObject) 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 BackupObject) GoString() string { - return s.String() -} - -// SetChunksCount sets the ChunksCount field's value. -func (s *BackupObject) SetChunksCount(v int64) *BackupObject { - s.ChunksCount = &v - return s -} - -// SetMetadataString sets the MetadataString field's value. -func (s *BackupObject) SetMetadataString(v string) *BackupObject { - s.MetadataString = &v - return s -} - -// SetName sets the Name field's value. -func (s *BackupObject) SetName(v string) *BackupObject { - s.Name = &v - return s -} - -// SetObjectChecksum sets the ObjectChecksum field's value. -func (s *BackupObject) SetObjectChecksum(v string) *BackupObject { - s.ObjectChecksum = &v - return s -} - -// SetObjectChecksumAlgorithm sets the ObjectChecksumAlgorithm field's value. -func (s *BackupObject) SetObjectChecksumAlgorithm(v string) *BackupObject { - s.ObjectChecksumAlgorithm = &v - return s -} - -// SetObjectToken sets the ObjectToken field's value. -func (s *BackupObject) SetObjectToken(v string) *BackupObject { - s.ObjectToken = &v - return s -} - -// Chunk -type Chunk struct { - _ struct{} `type:"structure"` - - // Chunk checksum - // - // Checksum is a required field - Checksum *string `type:"string" required:"true"` - - // Checksum algorithm - // - // ChecksumAlgorithm is a required field - ChecksumAlgorithm *string `type:"string" required:"true" enum:"DataChecksumAlgorithm"` - - // Chunk token - // - // ChunkToken is a required field - ChunkToken *string `type:"string" required:"true"` - - // Chunk index - // - // Index is a required field - Index *int64 `type:"long" required:"true"` - - // Chunk length - // - // Length is a required field - Length *int64 `type:"long" 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 Chunk) 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 Chunk) GoString() string { - return s.String() -} - -// SetChecksum sets the Checksum field's value. -func (s *Chunk) SetChecksum(v string) *Chunk { - s.Checksum = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *Chunk) SetChecksumAlgorithm(v string) *Chunk { - s.ChecksumAlgorithm = &v - return s -} - -// SetChunkToken sets the ChunkToken field's value. -func (s *Chunk) SetChunkToken(v string) *Chunk { - s.ChunkToken = &v - return s -} - -// SetIndex sets the Index field's value. -func (s *Chunk) SetIndex(v int64) *Chunk { - s.Index = &v - return s -} - -// SetLength sets the Length field's value. -func (s *Chunk) SetLength(v int64) *Chunk { - s.Length = &v - return s -} - -// Non-retryable exception. Attempted to create already existing object or chunk. -// This message contains a checksum of already presented data. -type DataAlreadyExistsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Data checksum used - Checksum *string `type:"string"` - - // Checksum algorithm used - ChecksumAlgorithm *string `type:"string"` - - Message_ *string `locationName:"Message" 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 DataAlreadyExistsException) 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 DataAlreadyExistsException) GoString() string { - return s.String() -} - -func newErrorDataAlreadyExistsException(v protocol.ResponseMetadata) error { - return &DataAlreadyExistsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DataAlreadyExistsException) Code() string { - return "DataAlreadyExistsException" -} - -// Message returns the exception's message. -func (s *DataAlreadyExistsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DataAlreadyExistsException) OrigErr() error { - return nil -} - -func (s *DataAlreadyExistsException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DataAlreadyExistsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DataAlreadyExistsException) RequestID() string { - return s.RespMetadata.RequestID -} - -type DeleteObjectInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Backup job Id for the in-progress backup. - // - // BackupJobId is a required field - BackupJobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // The name of the Object. - // - // ObjectName is a required field - ObjectName *string `location:"uri" locationName:"objectName" 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 DeleteObjectInput) 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 DeleteObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteObjectInput"} - if s.BackupJobId == nil { - invalidParams.Add(request.NewErrParamRequired("BackupJobId")) - } - if s.BackupJobId != nil && len(*s.BackupJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BackupJobId", 1)) - } - if s.ObjectName == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectName")) - } - if s.ObjectName != nil && len(*s.ObjectName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ObjectName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupJobId sets the BackupJobId field's value. -func (s *DeleteObjectInput) SetBackupJobId(v string) *DeleteObjectInput { - s.BackupJobId = &v - return s -} - -// SetObjectName sets the ObjectName field's value. -func (s *DeleteObjectInput) SetObjectName(v string) *DeleteObjectInput { - s.ObjectName = &v - return s -} - -type DeleteObjectOutput 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 DeleteObjectOutput) 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 DeleteObjectOutput) GoString() string { - return s.String() -} - -type GetChunkInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Chunk token - // - // ChunkToken is a required field - ChunkToken *string `location:"uri" locationName:"chunkToken" type:"string" required:"true"` - - // Storage job id - // - // StorageJobId is a required field - StorageJobId *string `location:"uri" locationName:"jobId" 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 GetChunkInput) 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 GetChunkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChunkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChunkInput"} - if s.ChunkToken == nil { - invalidParams.Add(request.NewErrParamRequired("ChunkToken")) - } - if s.ChunkToken != nil && len(*s.ChunkToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChunkToken", 1)) - } - if s.StorageJobId == nil { - invalidParams.Add(request.NewErrParamRequired("StorageJobId")) - } - if s.StorageJobId != nil && len(*s.StorageJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StorageJobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChunkToken sets the ChunkToken field's value. -func (s *GetChunkInput) SetChunkToken(v string) *GetChunkInput { - s.ChunkToken = &v - return s -} - -// SetStorageJobId sets the StorageJobId field's value. -func (s *GetChunkInput) SetStorageJobId(v string) *GetChunkInput { - s.StorageJobId = &v - return s -} - -type GetChunkOutput struct { - _ struct{} `type:"structure" payload:"Data"` - - // Data checksum - // - // Checksum is a required field - Checksum *string `location:"header" locationName:"x-amz-checksum" type:"string" required:"true"` - - // Checksum algorithm - // - // ChecksumAlgorithm is a required field - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-checksum-algorithm" type:"string" required:"true" enum:"DataChecksumAlgorithm"` - - // Chunk data - // - // Data is a required field - Data io.ReadCloser `type:"blob" required:"true"` - - // Data length - // - // Length is a required field - Length *int64 `location:"header" locationName:"x-amz-data-length" type:"long" 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 GetChunkOutput) 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 GetChunkOutput) GoString() string { - return s.String() -} - -// SetChecksum sets the Checksum field's value. -func (s *GetChunkOutput) SetChecksum(v string) *GetChunkOutput { - s.Checksum = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *GetChunkOutput) SetChecksumAlgorithm(v string) *GetChunkOutput { - s.ChecksumAlgorithm = &v - return s -} - -// SetData sets the Data field's value. -func (s *GetChunkOutput) SetData(v io.ReadCloser) *GetChunkOutput { - s.Data = v - return s -} - -// SetLength sets the Length field's value. -func (s *GetChunkOutput) SetLength(v int64) *GetChunkOutput { - s.Length = &v - return s -} - -type GetObjectMetadataInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Object token. - // - // ObjectToken is a required field - ObjectToken *string `location:"uri" locationName:"objectToken" type:"string" required:"true"` - - // Backup job id for the in-progress backup. - // - // StorageJobId is a required field - StorageJobId *string `location:"uri" locationName:"jobId" 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 GetObjectMetadataInput) 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 GetObjectMetadataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectMetadataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectMetadataInput"} - if s.ObjectToken == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectToken")) - } - if s.ObjectToken != nil && len(*s.ObjectToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ObjectToken", 1)) - } - if s.StorageJobId == nil { - invalidParams.Add(request.NewErrParamRequired("StorageJobId")) - } - if s.StorageJobId != nil && len(*s.StorageJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StorageJobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetObjectToken sets the ObjectToken field's value. -func (s *GetObjectMetadataInput) SetObjectToken(v string) *GetObjectMetadataInput { - s.ObjectToken = &v - return s -} - -// SetStorageJobId sets the StorageJobId field's value. -func (s *GetObjectMetadataInput) SetStorageJobId(v string) *GetObjectMetadataInput { - s.StorageJobId = &v - return s -} - -type GetObjectMetadataOutput struct { - _ struct{} `type:"structure" payload:"MetadataBlob"` - - // Metadata blob. - MetadataBlob io.ReadCloser `type:"blob"` - - // MetadataBlob checksum. - MetadataBlobChecksum *string `location:"header" locationName:"x-amz-checksum" type:"string"` - - // Checksum algorithm. - MetadataBlobChecksumAlgorithm *string `location:"header" locationName:"x-amz-checksum-algorithm" type:"string" enum:"DataChecksumAlgorithm"` - - // The size of MetadataBlob. - MetadataBlobLength *int64 `location:"header" locationName:"x-amz-data-length" type:"long"` - - // Metadata string. - MetadataString *string `location:"header" locationName:"x-amz-metadata-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 GetObjectMetadataOutput) 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 GetObjectMetadataOutput) GoString() string { - return s.String() -} - -// SetMetadataBlob sets the MetadataBlob field's value. -func (s *GetObjectMetadataOutput) SetMetadataBlob(v io.ReadCloser) *GetObjectMetadataOutput { - s.MetadataBlob = v - return s -} - -// SetMetadataBlobChecksum sets the MetadataBlobChecksum field's value. -func (s *GetObjectMetadataOutput) SetMetadataBlobChecksum(v string) *GetObjectMetadataOutput { - s.MetadataBlobChecksum = &v - return s -} - -// SetMetadataBlobChecksumAlgorithm sets the MetadataBlobChecksumAlgorithm field's value. -func (s *GetObjectMetadataOutput) SetMetadataBlobChecksumAlgorithm(v string) *GetObjectMetadataOutput { - s.MetadataBlobChecksumAlgorithm = &v - return s -} - -// SetMetadataBlobLength sets the MetadataBlobLength field's value. -func (s *GetObjectMetadataOutput) SetMetadataBlobLength(v int64) *GetObjectMetadataOutput { - s.MetadataBlobLength = &v - return s -} - -// SetMetadataString sets the MetadataString field's value. -func (s *GetObjectMetadataOutput) SetMetadataString(v string) *GetObjectMetadataOutput { - s.MetadataString = &v - return s -} - -// Non-retryable exception, indicates client error (wrong argument passed to -// API). See exception message for details. -type IllegalArgumentException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 IllegalArgumentException) 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 IllegalArgumentException) GoString() string { - return s.String() -} - -func newErrorIllegalArgumentException(v protocol.ResponseMetadata) error { - return &IllegalArgumentException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *IllegalArgumentException) Code() string { - return "IllegalArgumentException" -} - -// Message returns the exception's message. -func (s *IllegalArgumentException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *IllegalArgumentException) OrigErr() error { - return nil -} - -func (s *IllegalArgumentException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *IllegalArgumentException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *IllegalArgumentException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception -// message for details. -type KMSInvalidKeyUsageException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 KMSInvalidKeyUsageException) 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 KMSInvalidKeyUsageException) GoString() string { - return s.String() -} - -func newErrorKMSInvalidKeyUsageException(v protocol.ResponseMetadata) error { - return &KMSInvalidKeyUsageException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *KMSInvalidKeyUsageException) Code() string { - return "KMSInvalidKeyUsageException" -} - -// Message returns the exception's message. -func (s *KMSInvalidKeyUsageException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *KMSInvalidKeyUsageException) OrigErr() error { - return nil -} - -func (s *KMSInvalidKeyUsageException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *KMSInvalidKeyUsageException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *KMSInvalidKeyUsageException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListChunksInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Maximum number of chunks - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // Pagination token - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - // Object token - // - // ObjectToken is a required field - ObjectToken *string `location:"uri" locationName:"objectToken" type:"string" required:"true"` - - // Storage job id - // - // StorageJobId is a required field - StorageJobId *string `location:"uri" locationName:"jobId" 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 ListChunksInput) 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 ListChunksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListChunksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChunksInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ObjectToken == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectToken")) - } - if s.ObjectToken != nil && len(*s.ObjectToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ObjectToken", 1)) - } - if s.StorageJobId == nil { - invalidParams.Add(request.NewErrParamRequired("StorageJobId")) - } - if s.StorageJobId != nil && len(*s.StorageJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StorageJobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListChunksInput) SetMaxResults(v int64) *ListChunksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChunksInput) SetNextToken(v string) *ListChunksInput { - s.NextToken = &v - return s -} - -// SetObjectToken sets the ObjectToken field's value. -func (s *ListChunksInput) SetObjectToken(v string) *ListChunksInput { - s.ObjectToken = &v - return s -} - -// SetStorageJobId sets the StorageJobId field's value. -func (s *ListChunksInput) SetStorageJobId(v string) *ListChunksInput { - s.StorageJobId = &v - return s -} - -type ListChunksOutput struct { - _ struct{} `type:"structure"` - - // List of chunks - // - // ChunkList is a required field - ChunkList []*Chunk `type:"list" required:"true"` - - // Pagination token - NextToken *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 ListChunksOutput) 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 ListChunksOutput) GoString() string { - return s.String() -} - -// SetChunkList sets the ChunkList field's value. -func (s *ListChunksOutput) SetChunkList(v []*Chunk) *ListChunksOutput { - s.ChunkList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChunksOutput) SetNextToken(v string) *ListChunksOutput { - s.NextToken = &v - return s -} - -type ListObjectsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // (Optional) Created after filter - CreatedAfter *time.Time `location:"querystring" locationName:"created-after" type:"timestamp"` - - // (Optional) Created before filter - CreatedBefore *time.Time `location:"querystring" locationName:"created-before" type:"timestamp"` - - // Maximum objects count - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // Pagination token - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - // Optional, specifies the starting Object name to list from. Ignored if NextToken - // is not NULL - StartingObjectName *string `location:"querystring" locationName:"starting-object-name" type:"string"` - - // Optional, specifies the starting Object prefix to list from. Ignored if NextToken - // is not NULL - StartingObjectPrefix *string `location:"querystring" locationName:"starting-object-prefix" type:"string"` - - // Storage job id - // - // StorageJobId is a required field - StorageJobId *string `location:"uri" locationName:"jobId" 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 ListObjectsInput) 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 ListObjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListObjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListObjectsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.StorageJobId == nil { - invalidParams.Add(request.NewErrParamRequired("StorageJobId")) - } - if s.StorageJobId != nil && len(*s.StorageJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StorageJobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ListObjectsInput) SetCreatedAfter(v time.Time) *ListObjectsInput { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ListObjectsInput) SetCreatedBefore(v time.Time) *ListObjectsInput { - s.CreatedBefore = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListObjectsInput) SetMaxResults(v int64) *ListObjectsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListObjectsInput) SetNextToken(v string) *ListObjectsInput { - s.NextToken = &v - return s -} - -// SetStartingObjectName sets the StartingObjectName field's value. -func (s *ListObjectsInput) SetStartingObjectName(v string) *ListObjectsInput { - s.StartingObjectName = &v - return s -} - -// SetStartingObjectPrefix sets the StartingObjectPrefix field's value. -func (s *ListObjectsInput) SetStartingObjectPrefix(v string) *ListObjectsInput { - s.StartingObjectPrefix = &v - return s -} - -// SetStorageJobId sets the StorageJobId field's value. -func (s *ListObjectsInput) SetStorageJobId(v string) *ListObjectsInput { - s.StorageJobId = &v - return s -} - -type ListObjectsOutput struct { - _ struct{} `type:"structure"` - - // Pagination token - NextToken *string `type:"string"` - - // Object list - // - // ObjectList is a required field - ObjectList []*BackupObject `type:"list" 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 ListObjectsOutput) 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 ListObjectsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListObjectsOutput) SetNextToken(v string) *ListObjectsOutput { - s.NextToken = &v - return s -} - -// SetObjectList sets the ObjectList field's value. -func (s *ListObjectsOutput) SetObjectList(v []*BackupObject) *ListObjectsOutput { - s.ObjectList = v - return s -} - -// Retryalble exception. Indicated issues while reading an input stream due -// to the networking issues or connection drop on the client side. -type NotReadableInputStreamException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 NotReadableInputStreamException) 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 NotReadableInputStreamException) GoString() string { - return s.String() -} - -func newErrorNotReadableInputStreamException(v protocol.ResponseMetadata) error { - return &NotReadableInputStreamException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *NotReadableInputStreamException) Code() string { - return "NotReadableInputStreamException" -} - -// Message returns the exception's message. -func (s *NotReadableInputStreamException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *NotReadableInputStreamException) OrigErr() error { - return nil -} - -func (s *NotReadableInputStreamException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *NotReadableInputStreamException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *NotReadableInputStreamException) RequestID() string { - return s.RespMetadata.RequestID -} - -type NotifyObjectCompleteInput struct { - _ struct{} `type:"structure" payload:"MetadataBlob"` - - // Backup job Id for the in-progress backup - // - // BackupJobId is a required field - BackupJobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // Optional metadata associated with an Object. Maximum length is 4MB. - // - // To use an non-seekable io.Reader for this request wrap the io.Reader with - // "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable - // readers. This will allow the SDK to send the reader's payload as chunked - // transfer encoding. - MetadataBlob io.ReadSeeker `type:"blob"` - - // Checksum of MetadataBlob. - MetadataBlobChecksum *string `location:"querystring" locationName:"metadata-checksum" type:"string"` - - // Checksum algorithm. - MetadataBlobChecksumAlgorithm *string `location:"querystring" locationName:"metadata-checksum-algorithm" type:"string" enum:"DataChecksumAlgorithm"` - - // The size of MetadataBlob. - MetadataBlobLength *int64 `location:"querystring" locationName:"metadata-blob-length" type:"long"` - - // Optional metadata associated with an Object. Maximum string length is 256 - // bytes. - MetadataString *string `location:"querystring" locationName:"metadata-string" type:"string"` - - // Object checksum - // - // ObjectChecksum is a required field - ObjectChecksum *string `location:"querystring" locationName:"checksum" type:"string" required:"true"` - - // Checksum algorithm - // - // ObjectChecksumAlgorithm is a required field - ObjectChecksumAlgorithm *string `location:"querystring" locationName:"checksum-algorithm" type:"string" required:"true" enum:"SummaryChecksumAlgorithm"` - - // Upload Id for the in-progress upload - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" 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 NotifyObjectCompleteInput) 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 NotifyObjectCompleteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NotifyObjectCompleteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NotifyObjectCompleteInput"} - if s.BackupJobId == nil { - invalidParams.Add(request.NewErrParamRequired("BackupJobId")) - } - if s.BackupJobId != nil && len(*s.BackupJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BackupJobId", 1)) - } - if s.ObjectChecksum == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectChecksum")) - } - if s.ObjectChecksumAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectChecksumAlgorithm")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.UploadId != nil && len(*s.UploadId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupJobId sets the BackupJobId field's value. -func (s *NotifyObjectCompleteInput) SetBackupJobId(v string) *NotifyObjectCompleteInput { - s.BackupJobId = &v - return s -} - -// SetMetadataBlob sets the MetadataBlob field's value. -func (s *NotifyObjectCompleteInput) SetMetadataBlob(v io.ReadSeeker) *NotifyObjectCompleteInput { - s.MetadataBlob = v - return s -} - -// SetMetadataBlobChecksum sets the MetadataBlobChecksum field's value. -func (s *NotifyObjectCompleteInput) SetMetadataBlobChecksum(v string) *NotifyObjectCompleteInput { - s.MetadataBlobChecksum = &v - return s -} - -// SetMetadataBlobChecksumAlgorithm sets the MetadataBlobChecksumAlgorithm field's value. -func (s *NotifyObjectCompleteInput) SetMetadataBlobChecksumAlgorithm(v string) *NotifyObjectCompleteInput { - s.MetadataBlobChecksumAlgorithm = &v - return s -} - -// SetMetadataBlobLength sets the MetadataBlobLength field's value. -func (s *NotifyObjectCompleteInput) SetMetadataBlobLength(v int64) *NotifyObjectCompleteInput { - s.MetadataBlobLength = &v - return s -} - -// SetMetadataString sets the MetadataString field's value. -func (s *NotifyObjectCompleteInput) SetMetadataString(v string) *NotifyObjectCompleteInput { - s.MetadataString = &v - return s -} - -// SetObjectChecksum sets the ObjectChecksum field's value. -func (s *NotifyObjectCompleteInput) SetObjectChecksum(v string) *NotifyObjectCompleteInput { - s.ObjectChecksum = &v - return s -} - -// SetObjectChecksumAlgorithm sets the ObjectChecksumAlgorithm field's value. -func (s *NotifyObjectCompleteInput) SetObjectChecksumAlgorithm(v string) *NotifyObjectCompleteInput { - s.ObjectChecksumAlgorithm = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *NotifyObjectCompleteInput) SetUploadId(v string) *NotifyObjectCompleteInput { - s.UploadId = &v - return s -} - -type NotifyObjectCompleteOutput struct { - _ struct{} `type:"structure"` - - // Object checksum - // - // ObjectChecksum is a required field - ObjectChecksum *string `type:"string" required:"true"` - - // Checksum algorithm - // - // ObjectChecksumAlgorithm is a required field - ObjectChecksumAlgorithm *string `type:"string" required:"true" enum:"SummaryChecksumAlgorithm"` -} - -// 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 NotifyObjectCompleteOutput) 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 NotifyObjectCompleteOutput) GoString() string { - return s.String() -} - -// SetObjectChecksum sets the ObjectChecksum field's value. -func (s *NotifyObjectCompleteOutput) SetObjectChecksum(v string) *NotifyObjectCompleteOutput { - s.ObjectChecksum = &v - return s -} - -// SetObjectChecksumAlgorithm sets the ObjectChecksumAlgorithm field's value. -func (s *NotifyObjectCompleteOutput) SetObjectChecksumAlgorithm(v string) *NotifyObjectCompleteOutput { - s.ObjectChecksumAlgorithm = &v - return s -} - -type PutChunkInput struct { - _ struct{} `type:"structure" payload:"Data"` - - // Backup job Id for the in-progress backup. - // - // BackupJobId is a required field - BackupJobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // Data checksum - // - // Checksum is a required field - Checksum *string `location:"querystring" locationName:"checksum" type:"string" required:"true"` - - // Checksum algorithm - // - // ChecksumAlgorithm is a required field - ChecksumAlgorithm *string `location:"querystring" locationName:"checksum-algorithm" type:"string" required:"true" enum:"DataChecksumAlgorithm"` - - // Describes this chunk's position relative to the other chunks - // - // ChunkIndex is a required field - ChunkIndex *int64 `location:"uri" locationName:"chunkIndex" type:"long" required:"true"` - - // Data to be uploaded - // - // To use an non-seekable io.Reader for this request wrap the io.Reader with - // "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable - // readers. This will allow the SDK to send the reader's payload as chunked - // transfer encoding. - // - // Data is a required field - Data io.ReadSeeker `type:"blob" required:"true"` - - // Data length - // - // Length is a required field - Length *int64 `location:"querystring" locationName:"length" type:"long" required:"true"` - - // Upload Id for the in-progress upload. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" 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 PutChunkInput) 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 PutChunkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutChunkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutChunkInput"} - if s.BackupJobId == nil { - invalidParams.Add(request.NewErrParamRequired("BackupJobId")) - } - if s.BackupJobId != nil && len(*s.BackupJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BackupJobId", 1)) - } - if s.Checksum == nil { - invalidParams.Add(request.NewErrParamRequired("Checksum")) - } - if s.ChecksumAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("ChecksumAlgorithm")) - } - if s.ChunkIndex == nil { - invalidParams.Add(request.NewErrParamRequired("ChunkIndex")) - } - if s.Data == nil { - invalidParams.Add(request.NewErrParamRequired("Data")) - } - if s.Length == nil { - invalidParams.Add(request.NewErrParamRequired("Length")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.UploadId != nil && len(*s.UploadId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupJobId sets the BackupJobId field's value. -func (s *PutChunkInput) SetBackupJobId(v string) *PutChunkInput { - s.BackupJobId = &v - return s -} - -// SetChecksum sets the Checksum field's value. -func (s *PutChunkInput) SetChecksum(v string) *PutChunkInput { - s.Checksum = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutChunkInput) SetChecksumAlgorithm(v string) *PutChunkInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetChunkIndex sets the ChunkIndex field's value. -func (s *PutChunkInput) SetChunkIndex(v int64) *PutChunkInput { - s.ChunkIndex = &v - return s -} - -// SetData sets the Data field's value. -func (s *PutChunkInput) SetData(v io.ReadSeeker) *PutChunkInput { - s.Data = v - return s -} - -// SetLength sets the Length field's value. -func (s *PutChunkInput) SetLength(v int64) *PutChunkInput { - s.Length = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *PutChunkInput) SetUploadId(v string) *PutChunkInput { - s.UploadId = &v - return s -} - -type PutChunkOutput struct { - _ struct{} `type:"structure"` - - // Chunk checksum - // - // ChunkChecksum is a required field - ChunkChecksum *string `type:"string" required:"true"` - - // Checksum algorithm - // - // ChunkChecksumAlgorithm is a required field - ChunkChecksumAlgorithm *string `type:"string" required:"true" enum:"DataChecksumAlgorithm"` -} - -// 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 PutChunkOutput) 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 PutChunkOutput) GoString() string { - return s.String() -} - -// SetChunkChecksum sets the ChunkChecksum field's value. -func (s *PutChunkOutput) SetChunkChecksum(v string) *PutChunkOutput { - s.ChunkChecksum = &v - return s -} - -// SetChunkChecksumAlgorithm sets the ChunkChecksumAlgorithm field's value. -func (s *PutChunkOutput) SetChunkChecksumAlgorithm(v string) *PutChunkOutput { - s.ChunkChecksumAlgorithm = &v - return s -} - -type PutObjectInput struct { - _ struct{} `type:"structure" payload:"InlineChunk"` - - // Backup job Id for the in-progress backup. - // - // BackupJobId is a required field - BackupJobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // Inline chunk data to be uploaded. - // - // To use an non-seekable io.Reader for this request wrap the io.Reader with - // "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable - // readers. This will allow the SDK to send the reader's payload as chunked - // transfer encoding. - InlineChunk io.ReadSeeker `type:"blob"` - - // Inline chunk checksum - InlineChunkChecksum *string `location:"querystring" locationName:"checksum" type:"string"` - - // Inline chunk checksum algorithm - InlineChunkChecksumAlgorithm *string `location:"querystring" locationName:"checksum-algorithm" type:"string"` - - // Length of the inline chunk data. - InlineChunkLength *int64 `location:"querystring" locationName:"length" type:"long"` - - // Store user defined metadata like backup checksum, disk ids, restore metadata - // etc. - MetadataString *string `location:"querystring" locationName:"metadata-string" type:"string"` - - // object checksum - ObjectChecksum *string `location:"querystring" locationName:"object-checksum" type:"string"` - - // object checksum algorithm - ObjectChecksumAlgorithm *string `location:"querystring" locationName:"object-checksum-algorithm" type:"string" enum:"SummaryChecksumAlgorithm"` - - // The name of the Object to be uploaded. - // - // ObjectName is a required field - ObjectName *string `location:"uri" locationName:"objectName" type:"string" required:"true"` - - // Throw an exception if Object name is already exist. - ThrowOnDuplicate *bool `location:"querystring" locationName:"throwOnDuplicate" type:"boolean"` -} - -// 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 PutObjectInput) 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 PutObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectInput"} - if s.BackupJobId == nil { - invalidParams.Add(request.NewErrParamRequired("BackupJobId")) - } - if s.BackupJobId != nil && len(*s.BackupJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BackupJobId", 1)) - } - if s.ObjectName == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectName")) - } - if s.ObjectName != nil && len(*s.ObjectName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ObjectName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupJobId sets the BackupJobId field's value. -func (s *PutObjectInput) SetBackupJobId(v string) *PutObjectInput { - s.BackupJobId = &v - return s -} - -// SetInlineChunk sets the InlineChunk field's value. -func (s *PutObjectInput) SetInlineChunk(v io.ReadSeeker) *PutObjectInput { - s.InlineChunk = v - return s -} - -// SetInlineChunkChecksum sets the InlineChunkChecksum field's value. -func (s *PutObjectInput) SetInlineChunkChecksum(v string) *PutObjectInput { - s.InlineChunkChecksum = &v - return s -} - -// SetInlineChunkChecksumAlgorithm sets the InlineChunkChecksumAlgorithm field's value. -func (s *PutObjectInput) SetInlineChunkChecksumAlgorithm(v string) *PutObjectInput { - s.InlineChunkChecksumAlgorithm = &v - return s -} - -// SetInlineChunkLength sets the InlineChunkLength field's value. -func (s *PutObjectInput) SetInlineChunkLength(v int64) *PutObjectInput { - s.InlineChunkLength = &v - return s -} - -// SetMetadataString sets the MetadataString field's value. -func (s *PutObjectInput) SetMetadataString(v string) *PutObjectInput { - s.MetadataString = &v - return s -} - -// SetObjectChecksum sets the ObjectChecksum field's value. -func (s *PutObjectInput) SetObjectChecksum(v string) *PutObjectInput { - s.ObjectChecksum = &v - return s -} - -// SetObjectChecksumAlgorithm sets the ObjectChecksumAlgorithm field's value. -func (s *PutObjectInput) SetObjectChecksumAlgorithm(v string) *PutObjectInput { - s.ObjectChecksumAlgorithm = &v - return s -} - -// SetObjectName sets the ObjectName field's value. -func (s *PutObjectInput) SetObjectName(v string) *PutObjectInput { - s.ObjectName = &v - return s -} - -// SetThrowOnDuplicate sets the ThrowOnDuplicate field's value. -func (s *PutObjectInput) SetThrowOnDuplicate(v bool) *PutObjectInput { - s.ThrowOnDuplicate = &v - return s -} - -type PutObjectOutput struct { - _ struct{} `type:"structure"` - - // Inline chunk checksum - // - // InlineChunkChecksum is a required field - InlineChunkChecksum *string `type:"string" required:"true"` - - // Inline chunk checksum algorithm - // - // InlineChunkChecksumAlgorithm is a required field - InlineChunkChecksumAlgorithm *string `type:"string" required:"true" enum:"DataChecksumAlgorithm"` - - // object checksum - // - // ObjectChecksum is a required field - ObjectChecksum *string `type:"string" required:"true"` - - // object checksum algorithm - // - // ObjectChecksumAlgorithm is a required field - ObjectChecksumAlgorithm *string `type:"string" required:"true" enum:"SummaryChecksumAlgorithm"` -} - -// 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 PutObjectOutput) 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 PutObjectOutput) GoString() string { - return s.String() -} - -// SetInlineChunkChecksum sets the InlineChunkChecksum field's value. -func (s *PutObjectOutput) SetInlineChunkChecksum(v string) *PutObjectOutput { - s.InlineChunkChecksum = &v - return s -} - -// SetInlineChunkChecksumAlgorithm sets the InlineChunkChecksumAlgorithm field's value. -func (s *PutObjectOutput) SetInlineChunkChecksumAlgorithm(v string) *PutObjectOutput { - s.InlineChunkChecksumAlgorithm = &v - return s -} - -// SetObjectChecksum sets the ObjectChecksum field's value. -func (s *PutObjectOutput) SetObjectChecksum(v string) *PutObjectOutput { - s.ObjectChecksum = &v - return s -} - -// SetObjectChecksumAlgorithm sets the ObjectChecksumAlgorithm field's value. -func (s *PutObjectOutput) SetObjectChecksumAlgorithm(v string) *PutObjectOutput { - s.ObjectChecksumAlgorithm = &v - return s -} - -// Non-retryable exception. Attempted to make an operation on non-existing or -// expired resource. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Retryable exception. In general indicates internal failure that can be fixed -// by retry. -type RetryableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 RetryableException) 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 RetryableException) GoString() string { - return s.String() -} - -func newErrorRetryableException(v protocol.ResponseMetadata) error { - return &RetryableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *RetryableException) Code() string { - return "RetryableException" -} - -// Message returns the exception's message. -func (s *RetryableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *RetryableException) OrigErr() error { - return nil -} - -func (s *RetryableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *RetryableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *RetryableException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Deprecated. To be removed from the model. -type ServiceInternalException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ServiceInternalException) 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 ServiceInternalException) GoString() string { - return s.String() -} - -func newErrorServiceInternalException(v protocol.ResponseMetadata) error { - return &ServiceInternalException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceInternalException) Code() string { - return "ServiceInternalException" -} - -// Message returns the exception's message. -func (s *ServiceInternalException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceInternalException) OrigErr() error { - return nil -} - -func (s *ServiceInternalException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceInternalException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceInternalException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Retryable exception, indicates internal server error. -type ServiceUnavailableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ServiceUnavailableException) 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 ServiceUnavailableException) GoString() string { - return s.String() -} - -func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { - return &ServiceUnavailableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceUnavailableException) Code() string { - return "ServiceUnavailableException" -} - -// Message returns the exception's message. -func (s *ServiceUnavailableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceUnavailableException) OrigErr() error { - return nil -} - -func (s *ServiceUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceUnavailableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceUnavailableException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartObjectInput struct { - _ struct{} `type:"structure"` - - // Backup job Id for the in-progress backup - // - // BackupJobId is a required field - BackupJobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // Name for the object. - // - // ObjectName is a required field - ObjectName *string `location:"uri" locationName:"objectName" type:"string" required:"true"` - - // Throw an exception if Object name is already exist. - ThrowOnDuplicate *bool `type:"boolean"` -} - -// 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 StartObjectInput) 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 StartObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartObjectInput"} - if s.BackupJobId == nil { - invalidParams.Add(request.NewErrParamRequired("BackupJobId")) - } - if s.BackupJobId != nil && len(*s.BackupJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BackupJobId", 1)) - } - if s.ObjectName == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectName")) - } - if s.ObjectName != nil && len(*s.ObjectName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ObjectName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackupJobId sets the BackupJobId field's value. -func (s *StartObjectInput) SetBackupJobId(v string) *StartObjectInput { - s.BackupJobId = &v - return s -} - -// SetObjectName sets the ObjectName field's value. -func (s *StartObjectInput) SetObjectName(v string) *StartObjectInput { - s.ObjectName = &v - return s -} - -// SetThrowOnDuplicate sets the ThrowOnDuplicate field's value. -func (s *StartObjectInput) SetThrowOnDuplicate(v bool) *StartObjectInput { - s.ThrowOnDuplicate = &v - return s -} - -type StartObjectOutput struct { - _ struct{} `type:"structure"` - - // Upload Id for a given upload. - // - // UploadId is a required field - UploadId *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 StartObjectOutput) 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 StartObjectOutput) GoString() string { - return s.String() -} - -// SetUploadId sets the UploadId field's value. -func (s *StartObjectOutput) SetUploadId(v string) *StartObjectOutput { - s.UploadId = &v - return s -} - -// Increased rate over throttling limits. Can be retried with exponential backoff. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // DataChecksumAlgorithmSha256 is a DataChecksumAlgorithm enum value - DataChecksumAlgorithmSha256 = "SHA256" -) - -// DataChecksumAlgorithm_Values returns all elements of the DataChecksumAlgorithm enum -func DataChecksumAlgorithm_Values() []string { - return []string{ - DataChecksumAlgorithmSha256, - } -} - -const ( - // SummaryChecksumAlgorithmSummary is a SummaryChecksumAlgorithm enum value - SummaryChecksumAlgorithmSummary = "SUMMARY" -) - -// SummaryChecksumAlgorithm_Values returns all elements of the SummaryChecksumAlgorithm enum -func SummaryChecksumAlgorithm_Values() []string { - return []string{ - SummaryChecksumAlgorithmSummary, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/backupstorageiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/backupstorageiface/interface.go deleted file mode 100644 index 16d268da01e0..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/backupstorageiface/interface.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package backupstorageiface provides an interface to enable mocking the AWS Backup Storage service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package backupstorageiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage" -) - -// BackupStorageAPI provides an interface to enable mocking the -// backupstorage.BackupStorage service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Backup Storage. -// func myFunc(svc backupstorageiface.BackupStorageAPI) bool { -// // Make svc.DeleteObject request -// } -// -// func main() { -// sess := session.New() -// svc := backupstorage.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockBackupStorageClient struct { -// backupstorageiface.BackupStorageAPI -// } -// func (m *mockBackupStorageClient) DeleteObject(input *backupstorage.DeleteObjectInput) (*backupstorage.DeleteObjectOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockBackupStorageClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type BackupStorageAPI interface { - DeleteObject(*backupstorage.DeleteObjectInput) (*backupstorage.DeleteObjectOutput, error) - DeleteObjectWithContext(aws.Context, *backupstorage.DeleteObjectInput, ...request.Option) (*backupstorage.DeleteObjectOutput, error) - DeleteObjectRequest(*backupstorage.DeleteObjectInput) (*request.Request, *backupstorage.DeleteObjectOutput) - - GetChunk(*backupstorage.GetChunkInput) (*backupstorage.GetChunkOutput, error) - GetChunkWithContext(aws.Context, *backupstorage.GetChunkInput, ...request.Option) (*backupstorage.GetChunkOutput, error) - GetChunkRequest(*backupstorage.GetChunkInput) (*request.Request, *backupstorage.GetChunkOutput) - - GetObjectMetadata(*backupstorage.GetObjectMetadataInput) (*backupstorage.GetObjectMetadataOutput, error) - GetObjectMetadataWithContext(aws.Context, *backupstorage.GetObjectMetadataInput, ...request.Option) (*backupstorage.GetObjectMetadataOutput, error) - GetObjectMetadataRequest(*backupstorage.GetObjectMetadataInput) (*request.Request, *backupstorage.GetObjectMetadataOutput) - - ListChunks(*backupstorage.ListChunksInput) (*backupstorage.ListChunksOutput, error) - ListChunksWithContext(aws.Context, *backupstorage.ListChunksInput, ...request.Option) (*backupstorage.ListChunksOutput, error) - ListChunksRequest(*backupstorage.ListChunksInput) (*request.Request, *backupstorage.ListChunksOutput) - - ListChunksPages(*backupstorage.ListChunksInput, func(*backupstorage.ListChunksOutput, bool) bool) error - ListChunksPagesWithContext(aws.Context, *backupstorage.ListChunksInput, func(*backupstorage.ListChunksOutput, bool) bool, ...request.Option) error - - ListObjects(*backupstorage.ListObjectsInput) (*backupstorage.ListObjectsOutput, error) - ListObjectsWithContext(aws.Context, *backupstorage.ListObjectsInput, ...request.Option) (*backupstorage.ListObjectsOutput, error) - ListObjectsRequest(*backupstorage.ListObjectsInput) (*request.Request, *backupstorage.ListObjectsOutput) - - ListObjectsPages(*backupstorage.ListObjectsInput, func(*backupstorage.ListObjectsOutput, bool) bool) error - ListObjectsPagesWithContext(aws.Context, *backupstorage.ListObjectsInput, func(*backupstorage.ListObjectsOutput, bool) bool, ...request.Option) error - - NotifyObjectComplete(*backupstorage.NotifyObjectCompleteInput) (*backupstorage.NotifyObjectCompleteOutput, error) - NotifyObjectCompleteWithContext(aws.Context, *backupstorage.NotifyObjectCompleteInput, ...request.Option) (*backupstorage.NotifyObjectCompleteOutput, error) - NotifyObjectCompleteRequest(*backupstorage.NotifyObjectCompleteInput) (*request.Request, *backupstorage.NotifyObjectCompleteOutput) - - PutChunk(*backupstorage.PutChunkInput) (*backupstorage.PutChunkOutput, error) - PutChunkWithContext(aws.Context, *backupstorage.PutChunkInput, ...request.Option) (*backupstorage.PutChunkOutput, error) - PutChunkRequest(*backupstorage.PutChunkInput) (*request.Request, *backupstorage.PutChunkOutput) - - PutObject(*backupstorage.PutObjectInput) (*backupstorage.PutObjectOutput, error) - PutObjectWithContext(aws.Context, *backupstorage.PutObjectInput, ...request.Option) (*backupstorage.PutObjectOutput, error) - PutObjectRequest(*backupstorage.PutObjectInput) (*request.Request, *backupstorage.PutObjectOutput) - - StartObject(*backupstorage.StartObjectInput) (*backupstorage.StartObjectOutput, error) - StartObjectWithContext(aws.Context, *backupstorage.StartObjectInput, ...request.Option) (*backupstorage.StartObjectOutput, error) - StartObjectRequest(*backupstorage.StartObjectInput) (*request.Request, *backupstorage.StartObjectOutput) -} - -var _ BackupStorageAPI = (*backupstorage.BackupStorage)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/doc.go deleted file mode 100644 index a727794e94dc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package backupstorage provides the client and types for making API -// requests to AWS Backup Storage. -// -// The frontend service for Cryo Storage. -// -// See https://docs.aws.amazon.com/goto/WebAPI/backupstorage-2018-04-10 for more information on this service. -// -// See backupstorage package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/backupstorage/ -// -// # Using the Client -// -// To contact AWS Backup Storage with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Backup Storage client BackupStorage for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/backupstorage/#New -package backupstorage diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/errors.go deleted file mode 100644 index ae856ccb6e7b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/errors.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package backupstorage - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeDataAlreadyExistsException for service response error code - // "DataAlreadyExistsException". - // - // Non-retryable exception. Attempted to create already existing object or chunk. - // This message contains a checksum of already presented data. - ErrCodeDataAlreadyExistsException = "DataAlreadyExistsException" - - // ErrCodeIllegalArgumentException for service response error code - // "IllegalArgumentException". - // - // Non-retryable exception, indicates client error (wrong argument passed to - // API). See exception message for details. - ErrCodeIllegalArgumentException = "IllegalArgumentException" - - // ErrCodeKMSInvalidKeyUsageException for service response error code - // "KMSInvalidKeyUsageException". - // - // Non-retryable exception. Indicates the KMS key usage is incorrect. See exception - // message for details. - ErrCodeKMSInvalidKeyUsageException = "KMSInvalidKeyUsageException" - - // ErrCodeNotReadableInputStreamException for service response error code - // "NotReadableInputStreamException". - // - // Retryalble exception. Indicated issues while reading an input stream due - // to the networking issues or connection drop on the client side. - ErrCodeNotReadableInputStreamException = "NotReadableInputStreamException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Non-retryable exception. Attempted to make an operation on non-existing or - // expired resource. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeRetryableException for service response error code - // "RetryableException". - // - // Retryable exception. In general indicates internal failure that can be fixed - // by retry. - ErrCodeRetryableException = "RetryableException" - - // ErrCodeServiceInternalException for service response error code - // "ServiceInternalException". - // - // Deprecated. To be removed from the model. - ErrCodeServiceInternalException = "ServiceInternalException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - // - // Retryable exception, indicates internal server error. - ErrCodeServiceUnavailableException = "ServiceUnavailableException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // Increased rate over throttling limits. Can be retried with exponential backoff. - ErrCodeThrottlingException = "ThrottlingException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "DataAlreadyExistsException": newErrorDataAlreadyExistsException, - "IllegalArgumentException": newErrorIllegalArgumentException, - "KMSInvalidKeyUsageException": newErrorKMSInvalidKeyUsageException, - "NotReadableInputStreamException": newErrorNotReadableInputStreamException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "RetryableException": newErrorRetryableException, - "ServiceInternalException": newErrorServiceInternalException, - "ServiceUnavailableException": newErrorServiceUnavailableException, - "ThrottlingException": newErrorThrottlingException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/service.go deleted file mode 100644 index 1402a3bf8b5a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/backupstorage/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package backupstorage - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// BackupStorage provides the API operation methods for making requests to -// AWS Backup Storage. See this package's package overview docs -// for details on the service. -// -// BackupStorage methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type BackupStorage struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "BackupStorage" // Name of service. - EndpointsID = "backupstorage" // ID to lookup a service endpoint with. - ServiceID = "BackupStorage" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the BackupStorage client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a BackupStorage client from just a session. -// svc := backupstorage.New(mySession) -// -// // Create a BackupStorage client with additional configuration -// svc := backupstorage.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *BackupStorage { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "backup-storage" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *BackupStorage { - svc := &BackupStorage{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-04-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a BackupStorage operation and runs any -// custom request initialization. -func (c *BackupStorage) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/api.go deleted file mode 100644 index ebcc833f85b5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/api.go +++ /dev/null @@ -1,3990 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bcmdataexports - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opCreateExport = "CreateExport" - -// CreateExportRequest generates a "aws/request.Request" representing the -// client's request for the CreateExport 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 CreateExport for more information on using the CreateExport -// 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 CreateExportRequest method. -// req, resp := client.CreateExportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/CreateExport -func (c *BCMDataExports) CreateExportRequest(input *CreateExportInput) (req *request.Request, output *CreateExportOutput) { - op := &request.Operation{ - Name: opCreateExport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateExportInput{} - } - - output = &CreateExportOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateExport API operation for AWS Billing and Cost Management Data Exports. -// -// Creates a data export and specifies the data query, the delivery preference, -// and any optional resource tags. -// -// A DataQuery consists of both a QueryStatement and TableConfigurations. -// -// The QueryStatement is an SQL statement. Data Exports only supports a limited -// subset of the SQL syntax. For more information on the SQL syntax that is -// supported, see Data query (https://docs.aws.amazon.com/cur/latest/userguide/de-data-query.html). -// To view the available tables and columns, see the Data Exports table dictionary -// (https://docs.aws.amazon.com/cur/latest/userguide/de-table-dictionary.html). -// -// The TableConfigurations is a collection of specified TableProperties for -// the table being queried in the QueryStatement. TableProperties are additional -// configurations you can provide to change the data and schema of a table. -// Each table can have different TableProperties. However, tables are not required -// to have any TableProperties. Each table property has a default value that -// it assumes if not specified. For more information on table configurations, -// see Data query (https://docs.aws.amazon.com/cur/latest/userguide/de-data-query.html). -// To view the table properties available for each table, see the Data Exports -// table dictionary (https://docs.aws.amazon.com/cur/latest/userguide/de-table-dictionary.html) -// or use the ListTables API to get a response of all tables and their available -// properties. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation CreateExport for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// You've reached the limit on the number of resources you can create, or exceeded -// the size of an individual resource. -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/CreateExport -func (c *BCMDataExports) CreateExport(input *CreateExportInput) (*CreateExportOutput, error) { - req, out := c.CreateExportRequest(input) - return out, req.Send() -} - -// CreateExportWithContext is the same as CreateExport with the addition of -// the ability to pass a context and additional request options. -// -// See CreateExport 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 *BCMDataExports) CreateExportWithContext(ctx aws.Context, input *CreateExportInput, opts ...request.Option) (*CreateExportOutput, error) { - req, out := c.CreateExportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteExport = "DeleteExport" - -// DeleteExportRequest generates a "aws/request.Request" representing the -// client's request for the DeleteExport 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 DeleteExport for more information on using the DeleteExport -// 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 DeleteExportRequest method. -// req, resp := client.DeleteExportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/DeleteExport -func (c *BCMDataExports) DeleteExportRequest(input *DeleteExportInput) (req *request.Request, output *DeleteExportOutput) { - op := &request.Operation{ - Name: opDeleteExport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteExportInput{} - } - - output = &DeleteExportOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteExport API operation for AWS Billing and Cost Management Data Exports. -// -// Deletes an existing data export. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation DeleteExport for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/DeleteExport -func (c *BCMDataExports) DeleteExport(input *DeleteExportInput) (*DeleteExportOutput, error) { - req, out := c.DeleteExportRequest(input) - return out, req.Send() -} - -// DeleteExportWithContext is the same as DeleteExport with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteExport 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 *BCMDataExports) DeleteExportWithContext(ctx aws.Context, input *DeleteExportInput, opts ...request.Option) (*DeleteExportOutput, error) { - req, out := c.DeleteExportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetExecution = "GetExecution" - -// GetExecutionRequest generates a "aws/request.Request" representing the -// client's request for the GetExecution 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 GetExecution for more information on using the GetExecution -// 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 GetExecutionRequest method. -// req, resp := client.GetExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/GetExecution -func (c *BCMDataExports) GetExecutionRequest(input *GetExecutionInput) (req *request.Request, output *GetExecutionOutput) { - op := &request.Operation{ - Name: opGetExecution, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetExecutionInput{} - } - - output = &GetExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetExecution API operation for AWS Billing and Cost Management Data Exports. -// -// Exports data based on the source data update. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation GetExecution for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/GetExecution -func (c *BCMDataExports) GetExecution(input *GetExecutionInput) (*GetExecutionOutput, error) { - req, out := c.GetExecutionRequest(input) - return out, req.Send() -} - -// GetExecutionWithContext is the same as GetExecution with the addition of -// the ability to pass a context and additional request options. -// -// See GetExecution 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 *BCMDataExports) GetExecutionWithContext(ctx aws.Context, input *GetExecutionInput, opts ...request.Option) (*GetExecutionOutput, error) { - req, out := c.GetExecutionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetExport = "GetExport" - -// GetExportRequest generates a "aws/request.Request" representing the -// client's request for the GetExport 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 GetExport for more information on using the GetExport -// 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 GetExportRequest method. -// req, resp := client.GetExportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/GetExport -func (c *BCMDataExports) GetExportRequest(input *GetExportInput) (req *request.Request, output *GetExportOutput) { - op := &request.Operation{ - Name: opGetExport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetExportInput{} - } - - output = &GetExportOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetExport API operation for AWS Billing and Cost Management Data Exports. -// -// Views the definition of an existing data export. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation GetExport for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/GetExport -func (c *BCMDataExports) GetExport(input *GetExportInput) (*GetExportOutput, error) { - req, out := c.GetExportRequest(input) - return out, req.Send() -} - -// GetExportWithContext is the same as GetExport with the addition of -// the ability to pass a context and additional request options. -// -// See GetExport 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 *BCMDataExports) GetExportWithContext(ctx aws.Context, input *GetExportInput, opts ...request.Option) (*GetExportOutput, error) { - req, out := c.GetExportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTable = "GetTable" - -// GetTableRequest generates a "aws/request.Request" representing the -// client's request for the GetTable 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 GetTable for more information on using the GetTable -// 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 GetTableRequest method. -// req, resp := client.GetTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/GetTable -func (c *BCMDataExports) GetTableRequest(input *GetTableInput) (req *request.Request, output *GetTableOutput) { - op := &request.Operation{ - Name: opGetTable, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTableInput{} - } - - output = &GetTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTable API operation for AWS Billing and Cost Management Data Exports. -// -// Returns the metadata for the specified table and table properties. This includes -// the list of columns in the table schema, their data types, and column descriptions. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation GetTable for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/GetTable -func (c *BCMDataExports) GetTable(input *GetTableInput) (*GetTableOutput, error) { - req, out := c.GetTableRequest(input) - return out, req.Send() -} - -// GetTableWithContext is the same as GetTable with the addition of -// the ability to pass a context and additional request options. -// -// See GetTable 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 *BCMDataExports) GetTableWithContext(ctx aws.Context, input *GetTableInput, opts ...request.Option) (*GetTableOutput, error) { - req, out := c.GetTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListExecutions = "ListExecutions" - -// ListExecutionsRequest generates a "aws/request.Request" representing the -// client's request for the ListExecutions 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 ListExecutions for more information on using the ListExecutions -// 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 ListExecutionsRequest method. -// req, resp := client.ListExecutionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/ListExecutions -func (c *BCMDataExports) ListExecutionsRequest(input *ListExecutionsInput) (req *request.Request, output *ListExecutionsOutput) { - op := &request.Operation{ - Name: opListExecutions, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListExecutionsInput{} - } - - output = &ListExecutionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListExecutions API operation for AWS Billing and Cost Management Data Exports. -// -// Lists the historical executions for the export. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation ListExecutions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/ListExecutions -func (c *BCMDataExports) ListExecutions(input *ListExecutionsInput) (*ListExecutionsOutput, error) { - req, out := c.ListExecutionsRequest(input) - return out, req.Send() -} - -// ListExecutionsWithContext is the same as ListExecutions with the addition of -// the ability to pass a context and additional request options. -// -// See ListExecutions 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 *BCMDataExports) ListExecutionsWithContext(ctx aws.Context, input *ListExecutionsInput, opts ...request.Option) (*ListExecutionsOutput, error) { - req, out := c.ListExecutionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListExecutionsPages iterates over the pages of a ListExecutions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListExecutions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListExecutions operation. -// pageNum := 0 -// err := client.ListExecutionsPages(params, -// func(page *bcmdataexports.ListExecutionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BCMDataExports) ListExecutionsPages(input *ListExecutionsInput, fn func(*ListExecutionsOutput, bool) bool) error { - return c.ListExecutionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListExecutionsPagesWithContext same as ListExecutionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BCMDataExports) ListExecutionsPagesWithContext(ctx aws.Context, input *ListExecutionsInput, fn func(*ListExecutionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListExecutionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListExecutionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListExecutionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListExports = "ListExports" - -// ListExportsRequest generates a "aws/request.Request" representing the -// client's request for the ListExports 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 ListExports for more information on using the ListExports -// 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 ListExportsRequest method. -// req, resp := client.ListExportsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/ListExports -func (c *BCMDataExports) ListExportsRequest(input *ListExportsInput) (req *request.Request, output *ListExportsOutput) { - op := &request.Operation{ - Name: opListExports, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListExportsInput{} - } - - output = &ListExportsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListExports API operation for AWS Billing and Cost Management Data Exports. -// -// Lists all data export definitions. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation ListExports for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/ListExports -func (c *BCMDataExports) ListExports(input *ListExportsInput) (*ListExportsOutput, error) { - req, out := c.ListExportsRequest(input) - return out, req.Send() -} - -// ListExportsWithContext is the same as ListExports with the addition of -// the ability to pass a context and additional request options. -// -// See ListExports 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 *BCMDataExports) ListExportsWithContext(ctx aws.Context, input *ListExportsInput, opts ...request.Option) (*ListExportsOutput, error) { - req, out := c.ListExportsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListExportsPages iterates over the pages of a ListExports operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListExports method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListExports operation. -// pageNum := 0 -// err := client.ListExportsPages(params, -// func(page *bcmdataexports.ListExportsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BCMDataExports) ListExportsPages(input *ListExportsInput, fn func(*ListExportsOutput, bool) bool) error { - return c.ListExportsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListExportsPagesWithContext same as ListExportsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BCMDataExports) ListExportsPagesWithContext(ctx aws.Context, input *ListExportsInput, fn func(*ListExportsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListExportsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListExportsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListExportsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTables = "ListTables" - -// ListTablesRequest generates a "aws/request.Request" representing the -// client's request for the ListTables 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 ListTables for more information on using the ListTables -// 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 ListTablesRequest method. -// req, resp := client.ListTablesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/ListTables -func (c *BCMDataExports) ListTablesRequest(input *ListTablesInput) (req *request.Request, output *ListTablesOutput) { - op := &request.Operation{ - Name: opListTables, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTablesInput{} - } - - output = &ListTablesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTables API operation for AWS Billing and Cost Management Data Exports. -// -// Lists all available tables in data exports. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation ListTables for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/ListTables -func (c *BCMDataExports) ListTables(input *ListTablesInput) (*ListTablesOutput, error) { - req, out := c.ListTablesRequest(input) - return out, req.Send() -} - -// ListTablesWithContext is the same as ListTables with the addition of -// the ability to pass a context and additional request options. -// -// See ListTables 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 *BCMDataExports) ListTablesWithContext(ctx aws.Context, input *ListTablesInput, opts ...request.Option) (*ListTablesOutput, error) { - req, out := c.ListTablesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTablesPages iterates over the pages of a ListTables operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTables method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTables operation. -// pageNum := 0 -// err := client.ListTablesPages(params, -// func(page *bcmdataexports.ListTablesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BCMDataExports) ListTablesPages(input *ListTablesInput, fn func(*ListTablesOutput, bool) bool) error { - return c.ListTablesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTablesPagesWithContext same as ListTablesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BCMDataExports) ListTablesPagesWithContext(ctx aws.Context, input *ListTablesInput, fn func(*ListTablesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTablesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTablesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTablesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/ListTagsForResource -func (c *BCMDataExports) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Billing and Cost Management Data Exports. -// -// List tags associated with an existing data export. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/ListTagsForResource -func (c *BCMDataExports) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *BCMDataExports) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/TagResource -func (c *BCMDataExports) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Billing and Cost Management Data Exports. -// -// Adds tags for an existing data export definition. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/TagResource -func (c *BCMDataExports) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *BCMDataExports) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/UntagResource -func (c *BCMDataExports) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Billing and Cost Management Data Exports. -// -// Deletes tags associated with an existing data export definition. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/UntagResource -func (c *BCMDataExports) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *BCMDataExports) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateExport = "UpdateExport" - -// UpdateExportRequest generates a "aws/request.Request" representing the -// client's request for the UpdateExport 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 UpdateExport for more information on using the UpdateExport -// 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 UpdateExportRequest method. -// req, resp := client.UpdateExportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/UpdateExport -func (c *BCMDataExports) UpdateExportRequest(input *UpdateExportInput) (req *request.Request, output *UpdateExportOutput) { - op := &request.Operation{ - Name: opUpdateExport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateExportInput{} - } - - output = &UpdateExportOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateExport API operation for AWS Billing and Cost Management Data Exports. -// -// Updates an existing data export by overwriting all export parameters. All -// export parameters must be provided in the UpdateExport request. -// -// 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 AWS Billing and Cost Management Data Exports's -// API operation UpdateExport for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26/UpdateExport -func (c *BCMDataExports) UpdateExport(input *UpdateExportInput) (*UpdateExportOutput, error) { - req, out := c.UpdateExportRequest(input) - return out, req.Send() -} - -// UpdateExportWithContext is the same as UpdateExport with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateExport 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 *BCMDataExports) UpdateExportWithContext(ctx aws.Context, input *UpdateExportInput, opts ...request.Option) (*UpdateExportOutput, error) { - req, out := c.UpdateExportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Includes basic information for a data column such as its description, name, -// and type. -type Column struct { - _ struct{} `type:"structure"` - - // The description for a column. - Description *string `type:"string"` - - // The column name. - Name *string `type:"string"` - - // The kind of data a column stores. - Type *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 Column) 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 Column) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *Column) SetDescription(v string) *Column { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *Column) SetName(v string) *Column { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *Column) SetType(v string) *Column { - s.Type = &v - return s -} - -type CreateExportInput struct { - _ struct{} `type:"structure"` - - // The details of the export, including data query, name, description, and destination - // configuration. - // - // Export is a required field - Export *Export `type:"structure" required:"true"` - - // An optional list of tags to associate with the specified export. Each tag - // consists of a key and a value, and each key must be unique for the resource. - ResourceTags []*ResourceTag `type:"list"` -} - -// 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 CreateExportInput) 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 CreateExportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateExportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateExportInput"} - if s.Export == nil { - invalidParams.Add(request.NewErrParamRequired("Export")) - } - if s.Export != nil { - if err := s.Export.Validate(); err != nil { - invalidParams.AddNested("Export", err.(request.ErrInvalidParams)) - } - } - if s.ResourceTags != nil { - for i, v := range s.ResourceTags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceTags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExport sets the Export field's value. -func (s *CreateExportInput) SetExport(v *Export) *CreateExportInput { - s.Export = v - return s -} - -// SetResourceTags sets the ResourceTags field's value. -func (s *CreateExportInput) SetResourceTags(v []*ResourceTag) *CreateExportInput { - s.ResourceTags = v - return s -} - -type CreateExportOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for this export. - ExportArn *string `min:"20" 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 CreateExportOutput) 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 CreateExportOutput) GoString() string { - return s.String() -} - -// SetExportArn sets the ExportArn field's value. -func (s *CreateExportOutput) SetExportArn(v string) *CreateExportOutput { - s.ExportArn = &v - return s -} - -// The SQL query of column selections and row filters from the data table you -// want. -type DataQuery struct { - _ struct{} `type:"structure"` - - // The query statement. - // - // QueryStatement is a required field - QueryStatement *string `min:"1" type:"string" required:"true"` - - // The table configuration. - TableConfigurations map[string]map[string]*string `type:"map"` -} - -// 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 DataQuery) 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 DataQuery) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataQuery) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataQuery"} - if s.QueryStatement == nil { - invalidParams.Add(request.NewErrParamRequired("QueryStatement")) - } - if s.QueryStatement != nil && len(*s.QueryStatement) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryStatement", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueryStatement sets the QueryStatement field's value. -func (s *DataQuery) SetQueryStatement(v string) *DataQuery { - s.QueryStatement = &v - return s -} - -// SetTableConfigurations sets the TableConfigurations field's value. -func (s *DataQuery) SetTableConfigurations(v map[string]map[string]*string) *DataQuery { - s.TableConfigurations = v - return s -} - -type DeleteExportInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for this export. - // - // ExportArn is a required field - ExportArn *string `min:"20" 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 DeleteExportInput) 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 DeleteExportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteExportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteExportInput"} - if s.ExportArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExportArn")) - } - if s.ExportArn != nil && len(*s.ExportArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExportArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExportArn sets the ExportArn field's value. -func (s *DeleteExportInput) SetExportArn(v string) *DeleteExportInput { - s.ExportArn = &v - return s -} - -type DeleteExportOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for this export. - ExportArn *string `min:"20" 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 DeleteExportOutput) 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 DeleteExportOutput) GoString() string { - return s.String() -} - -// SetExportArn sets the ExportArn field's value. -func (s *DeleteExportOutput) SetExportArn(v string) *DeleteExportOutput { - s.ExportArn = &v - return s -} - -// The destinations used for data exports. -type DestinationConfigurations struct { - _ struct{} `type:"structure"` - - // An object that describes the destination of the data exports file. - // - // S3Destination is a required field - S3Destination *S3Destination `type:"structure" 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 DestinationConfigurations) 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 DestinationConfigurations) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DestinationConfigurations) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DestinationConfigurations"} - if s.S3Destination == nil { - invalidParams.Add(request.NewErrParamRequired("S3Destination")) - } - if s.S3Destination != nil { - if err := s.S3Destination.Validate(); err != nil { - invalidParams.AddNested("S3Destination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Destination sets the S3Destination field's value. -func (s *DestinationConfigurations) SetS3Destination(v *S3Destination) *DestinationConfigurations { - s.S3Destination = v - return s -} - -// The reference for the data export update. -type ExecutionReference struct { - _ struct{} `type:"structure"` - - // The ID for this specific execution. - // - // ExecutionId is a required field - ExecutionId *string `type:"string" required:"true"` - - // The status of this specific execution. - // - // ExecutionStatus is a required field - ExecutionStatus *ExecutionStatus `type:"structure" 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 ExecutionReference) 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 ExecutionReference) GoString() string { - return s.String() -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *ExecutionReference) SetExecutionId(v string) *ExecutionReference { - s.ExecutionId = &v - return s -} - -// SetExecutionStatus sets the ExecutionStatus field's value. -func (s *ExecutionReference) SetExecutionStatus(v *ExecutionStatus) *ExecutionReference { - s.ExecutionStatus = v - return s -} - -// The status of the execution. -type ExecutionStatus struct { - _ struct{} `type:"structure"` - - // The time when the execution was completed. - CompletedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time when the execution was created. - CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time when the execution was last updated. - LastUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The code for the status of the execution. - StatusCode *string `type:"string" enum:"ExecutionStatusCode"` - - // The reason for the failed status. - StatusReason *string `type:"string" enum:"ExecutionStatusReason"` -} - -// 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 ExecutionStatus) 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 ExecutionStatus) GoString() string { - return s.String() -} - -// SetCompletedAt sets the CompletedAt field's value. -func (s *ExecutionStatus) SetCompletedAt(v time.Time) *ExecutionStatus { - s.CompletedAt = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ExecutionStatus) SetCreatedAt(v time.Time) *ExecutionStatus { - s.CreatedAt = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *ExecutionStatus) SetLastUpdatedAt(v time.Time) *ExecutionStatus { - s.LastUpdatedAt = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *ExecutionStatus) SetStatusCode(v string) *ExecutionStatus { - s.StatusCode = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *ExecutionStatus) SetStatusReason(v string) *ExecutionStatus { - s.StatusReason = &v - return s -} - -// The details that are available for an export. -type Export struct { - _ struct{} `type:"structure"` - - // The data query for this specific data export. - // - // DataQuery is a required field - DataQuery *DataQuery `type:"structure" required:"true"` - - // The description for this specific data export. - Description *string `type:"string"` - - // The destination configuration for this specific data export. - // - // DestinationConfigurations is a required field - DestinationConfigurations *DestinationConfigurations `type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) for this export. - ExportArn *string `min:"20" type:"string"` - - // The name of this specific data export. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The cadence for Amazon Web Services to update the export in your S3 bucket. - // - // RefreshCadence is a required field - RefreshCadence *RefreshCadence `type:"structure" 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 Export) 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 Export) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Export) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Export"} - if s.DataQuery == nil { - invalidParams.Add(request.NewErrParamRequired("DataQuery")) - } - if s.DestinationConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationConfigurations")) - } - if s.ExportArn != nil && len(*s.ExportArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExportArn", 20)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RefreshCadence == nil { - invalidParams.Add(request.NewErrParamRequired("RefreshCadence")) - } - if s.DataQuery != nil { - if err := s.DataQuery.Validate(); err != nil { - invalidParams.AddNested("DataQuery", err.(request.ErrInvalidParams)) - } - } - if s.DestinationConfigurations != nil { - if err := s.DestinationConfigurations.Validate(); err != nil { - invalidParams.AddNested("DestinationConfigurations", err.(request.ErrInvalidParams)) - } - } - if s.RefreshCadence != nil { - if err := s.RefreshCadence.Validate(); err != nil { - invalidParams.AddNested("RefreshCadence", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataQuery sets the DataQuery field's value. -func (s *Export) SetDataQuery(v *DataQuery) *Export { - s.DataQuery = v - return s -} - -// SetDescription sets the Description field's value. -func (s *Export) SetDescription(v string) *Export { - s.Description = &v - return s -} - -// SetDestinationConfigurations sets the DestinationConfigurations field's value. -func (s *Export) SetDestinationConfigurations(v *DestinationConfigurations) *Export { - s.DestinationConfigurations = v - return s -} - -// SetExportArn sets the ExportArn field's value. -func (s *Export) SetExportArn(v string) *Export { - s.ExportArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *Export) SetName(v string) *Export { - s.Name = &v - return s -} - -// SetRefreshCadence sets the RefreshCadence field's value. -func (s *Export) SetRefreshCadence(v *RefreshCadence) *Export { - s.RefreshCadence = v - return s -} - -// The reference details for a given export. -type ExportReference struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for this export. - // - // ExportArn is a required field - ExportArn *string `min:"20" type:"string" required:"true"` - - // The name of this specific data export. - // - // ExportName is a required field - ExportName *string `min:"1" type:"string" required:"true"` - - // The status of this specific data export. - // - // ExportStatus is a required field - ExportStatus *ExportStatus `type:"structure" 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 ExportReference) 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 ExportReference) GoString() string { - return s.String() -} - -// SetExportArn sets the ExportArn field's value. -func (s *ExportReference) SetExportArn(v string) *ExportReference { - s.ExportArn = &v - return s -} - -// SetExportName sets the ExportName field's value. -func (s *ExportReference) SetExportName(v string) *ExportReference { - s.ExportName = &v - return s -} - -// SetExportStatus sets the ExportStatus field's value. -func (s *ExportReference) SetExportStatus(v *ExportStatus) *ExportReference { - s.ExportStatus = v - return s -} - -// The status of the data export. -type ExportStatus struct { - _ struct{} `type:"structure"` - - // The timestamp of when the export was created. - CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The timestamp of when the export was last generated. - LastRefreshedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The timestamp of when the export was updated. - LastUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The status code for the request. - StatusCode *string `type:"string" enum:"ExportStatusCode"` - - // The description for the status code. - StatusReason *string `type:"string" enum:"ExecutionStatusReason"` -} - -// 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 ExportStatus) 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 ExportStatus) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ExportStatus) SetCreatedAt(v time.Time) *ExportStatus { - s.CreatedAt = &v - return s -} - -// SetLastRefreshedAt sets the LastRefreshedAt field's value. -func (s *ExportStatus) SetLastRefreshedAt(v time.Time) *ExportStatus { - s.LastRefreshedAt = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *ExportStatus) SetLastUpdatedAt(v time.Time) *ExportStatus { - s.LastUpdatedAt = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *ExportStatus) SetStatusCode(v string) *ExportStatus { - s.StatusCode = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *ExportStatus) SetStatusReason(v string) *ExportStatus { - s.StatusReason = &v - return s -} - -type GetExecutionInput struct { - _ struct{} `type:"structure"` - - // The ID for this specific execution. - // - // ExecutionId is a required field - ExecutionId *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Export object that generated this specific - // execution. - // - // ExportArn is a required field - ExportArn *string `min:"20" 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 GetExecutionInput) 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 GetExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetExecutionInput"} - if s.ExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionId")) - } - if s.ExportArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExportArn")) - } - if s.ExportArn != nil && len(*s.ExportArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExportArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *GetExecutionInput) SetExecutionId(v string) *GetExecutionInput { - s.ExecutionId = &v - return s -} - -// SetExportArn sets the ExportArn field's value. -func (s *GetExecutionInput) SetExportArn(v string) *GetExecutionInput { - s.ExportArn = &v - return s -} - -type GetExecutionOutput struct { - _ struct{} `type:"structure"` - - // The ID for this specific execution. - ExecutionId *string `type:"string"` - - // The status of this specific execution. - ExecutionStatus *ExecutionStatus `type:"structure"` - - // The export data for this specific execution. This export data is a snapshot - // from when the execution was generated. The data could be different from the - // current export data if the export was updated since the execution was generated. - Export *Export `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 GetExecutionOutput) 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 GetExecutionOutput) GoString() string { - return s.String() -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *GetExecutionOutput) SetExecutionId(v string) *GetExecutionOutput { - s.ExecutionId = &v - return s -} - -// SetExecutionStatus sets the ExecutionStatus field's value. -func (s *GetExecutionOutput) SetExecutionStatus(v *ExecutionStatus) *GetExecutionOutput { - s.ExecutionStatus = v - return s -} - -// SetExport sets the Export field's value. -func (s *GetExecutionOutput) SetExport(v *Export) *GetExecutionOutput { - s.Export = v - return s -} - -type GetExportInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for this export. - // - // ExportArn is a required field - ExportArn *string `min:"20" 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 GetExportInput) 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 GetExportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetExportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetExportInput"} - if s.ExportArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExportArn")) - } - if s.ExportArn != nil && len(*s.ExportArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExportArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExportArn sets the ExportArn field's value. -func (s *GetExportInput) SetExportArn(v string) *GetExportInput { - s.ExportArn = &v - return s -} - -type GetExportOutput struct { - _ struct{} `type:"structure"` - - // The data for this specific export. - Export *Export `type:"structure"` - - // The status of this specific export. - ExportStatus *ExportStatus `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 GetExportOutput) 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 GetExportOutput) GoString() string { - return s.String() -} - -// SetExport sets the Export field's value. -func (s *GetExportOutput) SetExport(v *Export) *GetExportOutput { - s.Export = v - return s -} - -// SetExportStatus sets the ExportStatus field's value. -func (s *GetExportOutput) SetExportStatus(v *ExportStatus) *GetExportOutput { - s.ExportStatus = v - return s -} - -type GetTableInput struct { - _ struct{} `type:"structure"` - - // The name of the table. - // - // TableName is a required field - TableName *string `type:"string" required:"true"` - - // TableProperties are additional configurations you can provide to change the - // data and schema of a table. Each table can have different TableProperties. - // Tables are not required to have any TableProperties. Each table property - // has a default value that it assumes if not specified. - TableProperties map[string]*string `type:"map"` -} - -// 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 GetTableInput) 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 GetTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTableInput"} - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableName sets the TableName field's value. -func (s *GetTableInput) SetTableName(v string) *GetTableInput { - s.TableName = &v - return s -} - -// SetTableProperties sets the TableProperties field's value. -func (s *GetTableInput) SetTableProperties(v map[string]*string) *GetTableInput { - s.TableProperties = v - return s -} - -type GetTableOutput struct { - _ struct{} `type:"structure"` - - // The table description. - Description *string `type:"string"` - - // The schema of the table. - Schema []*Column `type:"list"` - - // The name of the table. - TableName *string `type:"string"` - - // TableProperties are additional configurations you can provide to change the - // data and schema of a table. Each table can have different TableProperties. - // Tables are not required to have any TableProperties. Each table property - // has a default value that it assumes if not specified. - TableProperties map[string]*string `type:"map"` -} - -// 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 GetTableOutput) 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 GetTableOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *GetTableOutput) SetDescription(v string) *GetTableOutput { - s.Description = &v - return s -} - -// SetSchema sets the Schema field's value. -func (s *GetTableOutput) SetSchema(v []*Column) *GetTableOutput { - s.Schema = v - return s -} - -// SetTableName sets the TableName field's value. -func (s *GetTableOutput) SetTableName(v string) *GetTableOutput { - s.TableName = &v - return s -} - -// SetTableProperties sets the TableProperties field's value. -func (s *GetTableOutput) SetTableProperties(v map[string]*string) *GetTableOutput { - s.TableProperties = v - return s -} - -// An error on the server occurred during the processing of your request. Try -// again later. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListExecutionsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for this export. - // - // ExportArn is a required field - ExportArn *string `min:"20" type:"string" required:"true"` - - // The maximum number of objects that are returned for the request. - MaxResults *int64 `min:"1" type:"integer"` - - // The token to retrieve the next set of results. - NextToken *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 ListExecutionsInput) 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 ListExecutionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListExecutionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListExecutionsInput"} - if s.ExportArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExportArn")) - } - if s.ExportArn != nil && len(*s.ExportArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExportArn", 20)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExportArn sets the ExportArn field's value. -func (s *ListExecutionsInput) SetExportArn(v string) *ListExecutionsInput { - s.ExportArn = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListExecutionsInput) SetMaxResults(v int64) *ListExecutionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListExecutionsInput) SetNextToken(v string) *ListExecutionsInput { - s.NextToken = &v - return s -} - -type ListExecutionsOutput struct { - _ struct{} `type:"structure"` - - // The list of executions. - Executions []*ExecutionReference `type:"list"` - - // The token to retrieve the next set of results. - NextToken *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 ListExecutionsOutput) 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 ListExecutionsOutput) GoString() string { - return s.String() -} - -// SetExecutions sets the Executions field's value. -func (s *ListExecutionsOutput) SetExecutions(v []*ExecutionReference) *ListExecutionsOutput { - s.Executions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListExecutionsOutput) SetNextToken(v string) *ListExecutionsOutput { - s.NextToken = &v - return s -} - -type ListExportsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of objects that are returned for the request. - MaxResults *int64 `min:"1" type:"integer"` - - // The token to retrieve the next set of results. - NextToken *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 ListExportsInput) 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 ListExportsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListExportsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListExportsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListExportsInput) SetMaxResults(v int64) *ListExportsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListExportsInput) SetNextToken(v string) *ListExportsInput { - s.NextToken = &v - return s -} - -type ListExportsOutput struct { - _ struct{} `type:"structure"` - - // The details of the exports, including name and export status. - Exports []*ExportReference `type:"list"` - - // The token to retrieve the next set of results. - NextToken *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 ListExportsOutput) 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 ListExportsOutput) GoString() string { - return s.String() -} - -// SetExports sets the Exports field's value. -func (s *ListExportsOutput) SetExports(v []*ExportReference) *ListExportsOutput { - s.Exports = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListExportsOutput) SetNextToken(v string) *ListExportsOutput { - s.NextToken = &v - return s -} - -type ListTablesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of objects that are returned for the request. - MaxResults *int64 `min:"1" type:"integer"` - - // The token to retrieve the next set of results. - NextToken *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 ListTablesInput) 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 ListTablesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTablesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTablesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTablesInput) SetMaxResults(v int64) *ListTablesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTablesInput) SetNextToken(v string) *ListTablesInput { - s.NextToken = &v - return s -} - -type ListTablesOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results. - NextToken *string `type:"string"` - - // The list of tables. - Tables []*Table `type:"list"` -} - -// 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 ListTablesOutput) 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 ListTablesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTablesOutput) SetNextToken(v string) *ListTablesOutput { - s.NextToken = &v - return s -} - -// SetTables sets the Tables field's value. -func (s *ListTablesOutput) SetTables(v []*Table) *ListTablesOutput { - s.Tables = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The maximum number of objects that are returned for the request. - MaxResults *int64 `min:"1" type:"integer"` - - // The token to retrieve the next set of results. - NextToken *string `type:"string"` - - // The unique identifier for the resource. - // - // ResourceArn is a required field - ResourceArn *string `min:"20" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTagsForResourceInput) SetMaxResults(v int64) *ListTagsForResourceInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { - s.NextToken = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results. - NextToken *string `type:"string"` - - // An optional list of tags to associate with the specified export. Each tag - // consists of a key and a value, and each key must be unique for the resource. - ResourceTags []*ResourceTag `type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { - s.NextToken = &v - return s -} - -// SetResourceTags sets the ResourceTags field's value. -func (s *ListTagsForResourceOutput) SetResourceTags(v []*ResourceTag) *ListTagsForResourceOutput { - s.ResourceTags = v - return s -} - -// The cadence for Amazon Web Services to update the data export in your S3 -// bucket. -type RefreshCadence struct { - _ struct{} `type:"structure"` - - // The frequency that data exports are updated. The export refreshes each time - // the source data updates, up to three times daily. - // - // Frequency is a required field - Frequency *string `type:"string" required:"true" enum:"FrequencyOption"` -} - -// 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 RefreshCadence) 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 RefreshCadence) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RefreshCadence) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RefreshCadence"} - if s.Frequency == nil { - invalidParams.Add(request.NewErrParamRequired("Frequency")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFrequency sets the Frequency field's value. -func (s *RefreshCadence) SetFrequency(v string) *RefreshCadence { - s.Frequency = &v - return s -} - -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The identifier of the resource that was not found. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // The type of the resource that was not found. - // - // ResourceType is a required field - ResourceType *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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The tag structure that contains a tag key and value. -type ResourceTag struct { - _ struct{} `type:"structure"` - - // The key that's associated with the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value that's associated with the tag. - // - // Value is a required field - Value *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 ResourceTag) 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 ResourceTag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResourceTag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResourceTag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *ResourceTag) SetKey(v string) *ResourceTag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ResourceTag) SetValue(v string) *ResourceTag { - s.Value = &v - return s -} - -// Describes the destination Amazon Simple Storage Service (Amazon S3) bucket -// name and object keys of a data exports file. -type S3Destination struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket used as the destination of a data export - // file. - // - // S3Bucket is a required field - S3Bucket *string `type:"string" required:"true"` - - // The output configuration for the data export. - // - // S3OutputConfigurations is a required field - S3OutputConfigurations *S3OutputConfigurations `type:"structure" required:"true"` - - // The S3 path prefix you want prepended to the name of your data export. - // - // S3Prefix is a required field - S3Prefix *string `type:"string" required:"true"` - - // The S3 bucket Region. - // - // S3Region is a required field - S3Region *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 S3Destination) 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 S3Destination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Destination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Destination"} - if s.S3Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("S3Bucket")) - } - if s.S3OutputConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("S3OutputConfigurations")) - } - if s.S3Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("S3Prefix")) - } - if s.S3Region == nil { - invalidParams.Add(request.NewErrParamRequired("S3Region")) - } - if s.S3OutputConfigurations != nil { - if err := s.S3OutputConfigurations.Validate(); err != nil { - invalidParams.AddNested("S3OutputConfigurations", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *S3Destination) SetS3Bucket(v string) *S3Destination { - s.S3Bucket = &v - return s -} - -// SetS3OutputConfigurations sets the S3OutputConfigurations field's value. -func (s *S3Destination) SetS3OutputConfigurations(v *S3OutputConfigurations) *S3Destination { - s.S3OutputConfigurations = v - return s -} - -// SetS3Prefix sets the S3Prefix field's value. -func (s *S3Destination) SetS3Prefix(v string) *S3Destination { - s.S3Prefix = &v - return s -} - -// SetS3Region sets the S3Region field's value. -func (s *S3Destination) SetS3Region(v string) *S3Destination { - s.S3Region = &v - return s -} - -// The compression type, file format, and overwrite preference for the data -// export. -type S3OutputConfigurations struct { - _ struct{} `type:"structure"` - - // The compression type for the data export. - // - // Compression is a required field - Compression *string `type:"string" required:"true" enum:"CompressionOption"` - - // The file format for the data export. - // - // Format is a required field - Format *string `type:"string" required:"true" enum:"FormatOption"` - - // The output type for the data export. - // - // OutputType is a required field - OutputType *string `type:"string" required:"true" enum:"S3OutputType"` - - // The rule to follow when generating a version of the data export file. You - // have the choice to overwrite the previous version or to be delivered in addition - // to the previous versions. Overwriting exports can save on Amazon S3 storage - // costs. Creating new export versions allows you to track the changes in cost - // and usage data over time. - // - // Overwrite is a required field - Overwrite *string `type:"string" required:"true" enum:"OverwriteOption"` -} - -// 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 S3OutputConfigurations) 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 S3OutputConfigurations) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3OutputConfigurations) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3OutputConfigurations"} - if s.Compression == nil { - invalidParams.Add(request.NewErrParamRequired("Compression")) - } - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.OutputType == nil { - invalidParams.Add(request.NewErrParamRequired("OutputType")) - } - if s.Overwrite == nil { - invalidParams.Add(request.NewErrParamRequired("Overwrite")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCompression sets the Compression field's value. -func (s *S3OutputConfigurations) SetCompression(v string) *S3OutputConfigurations { - s.Compression = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *S3OutputConfigurations) SetFormat(v string) *S3OutputConfigurations { - s.Format = &v - return s -} - -// SetOutputType sets the OutputType field's value. -func (s *S3OutputConfigurations) SetOutputType(v string) *S3OutputConfigurations { - s.OutputType = &v - return s -} - -// SetOverwrite sets the Overwrite field's value. -func (s *S3OutputConfigurations) SetOverwrite(v string) *S3OutputConfigurations { - s.Overwrite = &v - return s -} - -// You've reached the limit on the number of resources you can create, or exceeded -// the size of an individual resource. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The quota code that was exceeded. - // - // QuotaCode is a required field - QuotaCode *string `type:"string" required:"true"` - - // The identifier of the resource that exceeded quota. - ResourceId *string `type:"string"` - - // The type of the resource that exceeded quota. - ResourceType *string `type:"string"` - - // The service code that exceeded quota. It will always be “AWSBillingAndCostManagementDataExports”. - // - // ServiceCode is a required field - ServiceCode *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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The details for the data export table. -type Table struct { - _ struct{} `type:"structure"` - - // The description for the table. - Description *string `type:"string"` - - // The name of the table. - TableName *string `type:"string"` - - // The properties for the table. - TableProperties []*TablePropertyDescription `type:"list"` -} - -// 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 Table) 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 Table) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *Table) SetDescription(v string) *Table { - s.Description = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *Table) SetTableName(v string) *Table { - s.TableName = &v - return s -} - -// SetTableProperties sets the TableProperties field's value. -func (s *Table) SetTableProperties(v []*TablePropertyDescription) *Table { - s.TableProperties = v - return s -} - -// The properties for the data export table. -type TablePropertyDescription struct { - _ struct{} `type:"structure"` - - // The default value for the table. - DefaultValue *string `type:"string"` - - // The description for the table. - Description *string `type:"string"` - - // The name of the table. - Name *string `type:"string"` - - // The valid values for the table. - ValidValues []*string `type:"list"` -} - -// 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 TablePropertyDescription) 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 TablePropertyDescription) GoString() string { - return s.String() -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *TablePropertyDescription) SetDefaultValue(v string) *TablePropertyDescription { - s.DefaultValue = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *TablePropertyDescription) SetDescription(v string) *TablePropertyDescription { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *TablePropertyDescription) SetName(v string) *TablePropertyDescription { - s.Name = &v - return s -} - -// SetValidValues sets the ValidValues field's value. -func (s *TablePropertyDescription) SetValidValues(v []*string) *TablePropertyDescription { - s.ValidValues = v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the resource. - // - // ResourceArn is a required field - ResourceArn *string `min:"20" type:"string" required:"true"` - - // The tags to associate with the resource. Each tag consists of a key and a - // value, and each key must be unique for the resource. - // - // ResourceTags is a required field - ResourceTags []*ResourceTag `type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.ResourceTags == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceTags")) - } - if s.ResourceTags != nil { - for i, v := range s.ResourceTags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceTags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetResourceTags sets the ResourceTags field's value. -func (s *TagResourceInput) SetResourceTags(v []*ResourceTag) *TagResourceInput { - s.ResourceTags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The quota code that exceeded the throttling limit. - QuotaCode *string `type:"string"` - - // The service code that exceeded the throttling limit. It will always be “AWSBillingAndCostManagementDataExports”. - ServiceCode *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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the resource. - // - // ResourceArn is a required field - ResourceArn *string `min:"20" type:"string" required:"true"` - - // The tag keys that are associated with the resource ARN. - // - // ResourceTagKeys is a required field - ResourceTagKeys []*string `type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.ResourceTagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceTagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetResourceTagKeys sets the ResourceTagKeys field's value. -func (s *UntagResourceInput) SetResourceTagKeys(v []*string) *UntagResourceInput { - s.ResourceTagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateExportInput struct { - _ struct{} `type:"structure"` - - // The name and query details for the export. - // - // Export is a required field - Export *Export `type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) for this export. - // - // ExportArn is a required field - ExportArn *string `min:"20" 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 UpdateExportInput) 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 UpdateExportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateExportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateExportInput"} - if s.Export == nil { - invalidParams.Add(request.NewErrParamRequired("Export")) - } - if s.ExportArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExportArn")) - } - if s.ExportArn != nil && len(*s.ExportArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExportArn", 20)) - } - if s.Export != nil { - if err := s.Export.Validate(); err != nil { - invalidParams.AddNested("Export", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExport sets the Export field's value. -func (s *UpdateExportInput) SetExport(v *Export) *UpdateExportInput { - s.Export = v - return s -} - -// SetExportArn sets the ExportArn field's value. -func (s *UpdateExportInput) SetExportArn(v string) *UpdateExportInput { - s.ExportArn = &v - return s -} - -type UpdateExportOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for this export. - ExportArn *string `min:"20" 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 UpdateExportOutput) 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 UpdateExportOutput) GoString() string { - return s.String() -} - -// SetExportArn sets the ExportArn field's value. -func (s *UpdateExportOutput) SetExportArn(v string) *UpdateExportOutput { - s.ExportArn = &v - return s -} - -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The list of fields that are invalid. - Fields []*ValidationExceptionField `type:"list"` - - Message_ *string `locationName:"Message" type:"string"` - - // The reason for the validation exception. - Reason *string `type:"string" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input failed to meet the constraints specified by the Amazon Web Services -// service in a specified field. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // A message with the reason for the validation exception error. - // - // Message is a required field - Message *string `type:"string" required:"true"` - - // The field name where the invalid entry was detected. - // - // Name is a required field - Name *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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // CompressionOptionGzip is a CompressionOption enum value - CompressionOptionGzip = "GZIP" - - // CompressionOptionParquet is a CompressionOption enum value - CompressionOptionParquet = "PARQUET" -) - -// CompressionOption_Values returns all elements of the CompressionOption enum -func CompressionOption_Values() []string { - return []string{ - CompressionOptionGzip, - CompressionOptionParquet, - } -} - -const ( - // ExecutionStatusCodeInitiationInProcess is a ExecutionStatusCode enum value - ExecutionStatusCodeInitiationInProcess = "INITIATION_IN_PROCESS" - - // ExecutionStatusCodeQueryQueued is a ExecutionStatusCode enum value - ExecutionStatusCodeQueryQueued = "QUERY_QUEUED" - - // ExecutionStatusCodeQueryInProcess is a ExecutionStatusCode enum value - ExecutionStatusCodeQueryInProcess = "QUERY_IN_PROCESS" - - // ExecutionStatusCodeQueryFailure is a ExecutionStatusCode enum value - ExecutionStatusCodeQueryFailure = "QUERY_FAILURE" - - // ExecutionStatusCodeDeliveryInProcess is a ExecutionStatusCode enum value - ExecutionStatusCodeDeliveryInProcess = "DELIVERY_IN_PROCESS" - - // ExecutionStatusCodeDeliverySuccess is a ExecutionStatusCode enum value - ExecutionStatusCodeDeliverySuccess = "DELIVERY_SUCCESS" - - // ExecutionStatusCodeDeliveryFailure is a ExecutionStatusCode enum value - ExecutionStatusCodeDeliveryFailure = "DELIVERY_FAILURE" -) - -// ExecutionStatusCode_Values returns all elements of the ExecutionStatusCode enum -func ExecutionStatusCode_Values() []string { - return []string{ - ExecutionStatusCodeInitiationInProcess, - ExecutionStatusCodeQueryQueued, - ExecutionStatusCodeQueryInProcess, - ExecutionStatusCodeQueryFailure, - ExecutionStatusCodeDeliveryInProcess, - ExecutionStatusCodeDeliverySuccess, - ExecutionStatusCodeDeliveryFailure, - } -} - -const ( - // ExecutionStatusReasonInsufficientPermission is a ExecutionStatusReason enum value - ExecutionStatusReasonInsufficientPermission = "INSUFFICIENT_PERMISSION" - - // ExecutionStatusReasonBillOwnerChanged is a ExecutionStatusReason enum value - ExecutionStatusReasonBillOwnerChanged = "BILL_OWNER_CHANGED" - - // ExecutionStatusReasonInternalFailure is a ExecutionStatusReason enum value - ExecutionStatusReasonInternalFailure = "INTERNAL_FAILURE" -) - -// ExecutionStatusReason_Values returns all elements of the ExecutionStatusReason enum -func ExecutionStatusReason_Values() []string { - return []string{ - ExecutionStatusReasonInsufficientPermission, - ExecutionStatusReasonBillOwnerChanged, - ExecutionStatusReasonInternalFailure, - } -} - -const ( - // ExportStatusCodeHealthy is a ExportStatusCode enum value - ExportStatusCodeHealthy = "HEALTHY" - - // ExportStatusCodeUnhealthy is a ExportStatusCode enum value - ExportStatusCodeUnhealthy = "UNHEALTHY" -) - -// ExportStatusCode_Values returns all elements of the ExportStatusCode enum -func ExportStatusCode_Values() []string { - return []string{ - ExportStatusCodeHealthy, - ExportStatusCodeUnhealthy, - } -} - -const ( - // FormatOptionTextOrCsv is a FormatOption enum value - FormatOptionTextOrCsv = "TEXT_OR_CSV" - - // FormatOptionParquet is a FormatOption enum value - FormatOptionParquet = "PARQUET" -) - -// FormatOption_Values returns all elements of the FormatOption enum -func FormatOption_Values() []string { - return []string{ - FormatOptionTextOrCsv, - FormatOptionParquet, - } -} - -const ( - // FrequencyOptionSynchronous is a FrequencyOption enum value - FrequencyOptionSynchronous = "SYNCHRONOUS" -) - -// FrequencyOption_Values returns all elements of the FrequencyOption enum -func FrequencyOption_Values() []string { - return []string{ - FrequencyOptionSynchronous, - } -} - -const ( - // OverwriteOptionCreateNewReport is a OverwriteOption enum value - OverwriteOptionCreateNewReport = "CREATE_NEW_REPORT" - - // OverwriteOptionOverwriteReport is a OverwriteOption enum value - OverwriteOptionOverwriteReport = "OVERWRITE_REPORT" -) - -// OverwriteOption_Values returns all elements of the OverwriteOption enum -func OverwriteOption_Values() []string { - return []string{ - OverwriteOptionCreateNewReport, - OverwriteOptionOverwriteReport, - } -} - -const ( - // S3OutputTypeCustom is a S3OutputType enum value - S3OutputTypeCustom = "CUSTOM" -) - -// S3OutputType_Values returns all elements of the S3OutputType enum -func S3OutputType_Values() []string { - return []string{ - S3OutputTypeCustom, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/bcmdataexportsiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/bcmdataexportsiface/interface.go deleted file mode 100644 index 694ab08db984..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/bcmdataexportsiface/interface.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bcmdataexportsiface provides an interface to enable mocking the AWS Billing and Cost Management Data Exports service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package bcmdataexportsiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports" -) - -// BCMDataExportsAPI provides an interface to enable mocking the -// bcmdataexports.BCMDataExports service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Billing and Cost Management Data Exports. -// func myFunc(svc bcmdataexportsiface.BCMDataExportsAPI) bool { -// // Make svc.CreateExport request -// } -// -// func main() { -// sess := session.New() -// svc := bcmdataexports.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockBCMDataExportsClient struct { -// bcmdataexportsiface.BCMDataExportsAPI -// } -// func (m *mockBCMDataExportsClient) CreateExport(input *bcmdataexports.CreateExportInput) (*bcmdataexports.CreateExportOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockBCMDataExportsClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type BCMDataExportsAPI interface { - CreateExport(*bcmdataexports.CreateExportInput) (*bcmdataexports.CreateExportOutput, error) - CreateExportWithContext(aws.Context, *bcmdataexports.CreateExportInput, ...request.Option) (*bcmdataexports.CreateExportOutput, error) - CreateExportRequest(*bcmdataexports.CreateExportInput) (*request.Request, *bcmdataexports.CreateExportOutput) - - DeleteExport(*bcmdataexports.DeleteExportInput) (*bcmdataexports.DeleteExportOutput, error) - DeleteExportWithContext(aws.Context, *bcmdataexports.DeleteExportInput, ...request.Option) (*bcmdataexports.DeleteExportOutput, error) - DeleteExportRequest(*bcmdataexports.DeleteExportInput) (*request.Request, *bcmdataexports.DeleteExportOutput) - - GetExecution(*bcmdataexports.GetExecutionInput) (*bcmdataexports.GetExecutionOutput, error) - GetExecutionWithContext(aws.Context, *bcmdataexports.GetExecutionInput, ...request.Option) (*bcmdataexports.GetExecutionOutput, error) - GetExecutionRequest(*bcmdataexports.GetExecutionInput) (*request.Request, *bcmdataexports.GetExecutionOutput) - - GetExport(*bcmdataexports.GetExportInput) (*bcmdataexports.GetExportOutput, error) - GetExportWithContext(aws.Context, *bcmdataexports.GetExportInput, ...request.Option) (*bcmdataexports.GetExportOutput, error) - GetExportRequest(*bcmdataexports.GetExportInput) (*request.Request, *bcmdataexports.GetExportOutput) - - GetTable(*bcmdataexports.GetTableInput) (*bcmdataexports.GetTableOutput, error) - GetTableWithContext(aws.Context, *bcmdataexports.GetTableInput, ...request.Option) (*bcmdataexports.GetTableOutput, error) - GetTableRequest(*bcmdataexports.GetTableInput) (*request.Request, *bcmdataexports.GetTableOutput) - - ListExecutions(*bcmdataexports.ListExecutionsInput) (*bcmdataexports.ListExecutionsOutput, error) - ListExecutionsWithContext(aws.Context, *bcmdataexports.ListExecutionsInput, ...request.Option) (*bcmdataexports.ListExecutionsOutput, error) - ListExecutionsRequest(*bcmdataexports.ListExecutionsInput) (*request.Request, *bcmdataexports.ListExecutionsOutput) - - ListExecutionsPages(*bcmdataexports.ListExecutionsInput, func(*bcmdataexports.ListExecutionsOutput, bool) bool) error - ListExecutionsPagesWithContext(aws.Context, *bcmdataexports.ListExecutionsInput, func(*bcmdataexports.ListExecutionsOutput, bool) bool, ...request.Option) error - - ListExports(*bcmdataexports.ListExportsInput) (*bcmdataexports.ListExportsOutput, error) - ListExportsWithContext(aws.Context, *bcmdataexports.ListExportsInput, ...request.Option) (*bcmdataexports.ListExportsOutput, error) - ListExportsRequest(*bcmdataexports.ListExportsInput) (*request.Request, *bcmdataexports.ListExportsOutput) - - ListExportsPages(*bcmdataexports.ListExportsInput, func(*bcmdataexports.ListExportsOutput, bool) bool) error - ListExportsPagesWithContext(aws.Context, *bcmdataexports.ListExportsInput, func(*bcmdataexports.ListExportsOutput, bool) bool, ...request.Option) error - - ListTables(*bcmdataexports.ListTablesInput) (*bcmdataexports.ListTablesOutput, error) - ListTablesWithContext(aws.Context, *bcmdataexports.ListTablesInput, ...request.Option) (*bcmdataexports.ListTablesOutput, error) - ListTablesRequest(*bcmdataexports.ListTablesInput) (*request.Request, *bcmdataexports.ListTablesOutput) - - ListTablesPages(*bcmdataexports.ListTablesInput, func(*bcmdataexports.ListTablesOutput, bool) bool) error - ListTablesPagesWithContext(aws.Context, *bcmdataexports.ListTablesInput, func(*bcmdataexports.ListTablesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*bcmdataexports.ListTagsForResourceInput) (*bcmdataexports.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *bcmdataexports.ListTagsForResourceInput, ...request.Option) (*bcmdataexports.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*bcmdataexports.ListTagsForResourceInput) (*request.Request, *bcmdataexports.ListTagsForResourceOutput) - - TagResource(*bcmdataexports.TagResourceInput) (*bcmdataexports.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *bcmdataexports.TagResourceInput, ...request.Option) (*bcmdataexports.TagResourceOutput, error) - TagResourceRequest(*bcmdataexports.TagResourceInput) (*request.Request, *bcmdataexports.TagResourceOutput) - - UntagResource(*bcmdataexports.UntagResourceInput) (*bcmdataexports.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *bcmdataexports.UntagResourceInput, ...request.Option) (*bcmdataexports.UntagResourceOutput, error) - UntagResourceRequest(*bcmdataexports.UntagResourceInput) (*request.Request, *bcmdataexports.UntagResourceOutput) - - UpdateExport(*bcmdataexports.UpdateExportInput) (*bcmdataexports.UpdateExportOutput, error) - UpdateExportWithContext(aws.Context, *bcmdataexports.UpdateExportInput, ...request.Option) (*bcmdataexports.UpdateExportOutput, error) - UpdateExportRequest(*bcmdataexports.UpdateExportInput) (*request.Request, *bcmdataexports.UpdateExportOutput) -} - -var _ BCMDataExportsAPI = (*bcmdataexports.BCMDataExports)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/doc.go deleted file mode 100644 index 501de1c592fa..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/doc.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bcmdataexports provides the client and types for making API -// requests to AWS Billing and Cost Management Data Exports. -// -// You can use the Data Exports API to create customized exports from multiple -// Amazon Web Services cost management and billing datasets, such as cost and -// usage data and cost optimization recommendations. -// -// The Data Exports API provides the following endpoint: -// -// - https://bcm-data-exports.us-east-1.api.aws -// -// See https://docs.aws.amazon.com/goto/WebAPI/bcm-data-exports-2023-11-26 for more information on this service. -// -// See bcmdataexports package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bcmdataexports/ -// -// # Using the Client -// -// To contact AWS Billing and Cost Management Data Exports with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Billing and Cost Management Data Exports client BCMDataExports for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bcmdataexports/#New -package bcmdataexports diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/errors.go deleted file mode 100644 index de598e3b523f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/errors.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bcmdataexports - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An error on the server occurred during the processing of your request. Try - // again later. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified Amazon Resource Name (ARN) in the request doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // You've reached the limit on the number of resources you can create, or exceeded - // the size of an individual resource. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an Amazon Web Services - // service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/service.go deleted file mode 100644 index 1423e68b4d0c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bcmdataexports/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bcmdataexports - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// BCMDataExports provides the API operation methods for making requests to -// AWS Billing and Cost Management Data Exports. See this package's package overview docs -// for details on the service. -// -// BCMDataExports methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type BCMDataExports struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "BCM Data Exports" // Name of service. - EndpointsID = "bcm-data-exports" // ID to lookup a service endpoint with. - ServiceID = "BCM Data Exports" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the BCMDataExports client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a BCMDataExports client from just a session. -// svc := bcmdataexports.New(mySession) -// -// // Create a BCMDataExports client with additional configuration -// svc := bcmdataexports.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *BCMDataExports { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "bcm-data-exports" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *BCMDataExports { - svc := &BCMDataExports{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-11-26", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.1", - TargetPrefix: "AWSBillingAndCostManagementDataExports", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a BCMDataExports operation and runs any -// custom request initialization. -func (c *BCMDataExports) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/api.go deleted file mode 100644 index c2c686d03af2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/api.go +++ /dev/null @@ -1,6633 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrock - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateModelCustomizationJob = "CreateModelCustomizationJob" - -// CreateModelCustomizationJobRequest generates a "aws/request.Request" representing the -// client's request for the CreateModelCustomizationJob 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 CreateModelCustomizationJob for more information on using the CreateModelCustomizationJob -// 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 CreateModelCustomizationJobRequest method. -// req, resp := client.CreateModelCustomizationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/CreateModelCustomizationJob -func (c *Bedrock) CreateModelCustomizationJobRequest(input *CreateModelCustomizationJobInput) (req *request.Request, output *CreateModelCustomizationJobOutput) { - op := &request.Operation{ - Name: opCreateModelCustomizationJob, - HTTPMethod: "POST", - HTTPPath: "/model-customization-jobs", - } - - if input == nil { - input = &CreateModelCustomizationJobInput{} - } - - output = &CreateModelCustomizationJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateModelCustomizationJob API operation for Amazon Bedrock. -// -// Creates a fine-tuning job to customize a base model. -// -// You specify the base foundation model and the location of the training data. -// After the model-customization job completes successfully, your custom model -// resource will be ready to use. Training data contains input and output text -// for each record in a JSONL format. Optionally, you can specify validation -// data in the same format as the training data. Amazon Bedrock returns validation -// loss metrics and output generations after the job completes. -// -// Model-customization jobs are asynchronous and the completion time depends -// on the base model and the training/validation data size. To monitor a job, -// use the GetModelCustomizationJob operation to retrieve the job status. -// -// For more information, see Custom models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation CreateModelCustomizationJob for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - ConflictException -// Error occurred because of a conflict while performing an operation. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - TooManyTagsException -// The request contains more tags than can be associated with a resource (50 -// tags per resource). The maximum number of tags includes both existing tags -// and those included in your current request. -// -// - ServiceQuotaExceededException -// The number of requests exceeds the service quota. Resubmit your request later. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/CreateModelCustomizationJob -func (c *Bedrock) CreateModelCustomizationJob(input *CreateModelCustomizationJobInput) (*CreateModelCustomizationJobOutput, error) { - req, out := c.CreateModelCustomizationJobRequest(input) - return out, req.Send() -} - -// CreateModelCustomizationJobWithContext is the same as CreateModelCustomizationJob with the addition of -// the ability to pass a context and additional request options. -// -// See CreateModelCustomizationJob 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 *Bedrock) CreateModelCustomizationJobWithContext(ctx aws.Context, input *CreateModelCustomizationJobInput, opts ...request.Option) (*CreateModelCustomizationJobOutput, error) { - req, out := c.CreateModelCustomizationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateProvisionedModelThroughput = "CreateProvisionedModelThroughput" - -// CreateProvisionedModelThroughputRequest generates a "aws/request.Request" representing the -// client's request for the CreateProvisionedModelThroughput 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 CreateProvisionedModelThroughput for more information on using the CreateProvisionedModelThroughput -// 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 CreateProvisionedModelThroughputRequest method. -// req, resp := client.CreateProvisionedModelThroughputRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/CreateProvisionedModelThroughput -func (c *Bedrock) CreateProvisionedModelThroughputRequest(input *CreateProvisionedModelThroughputInput) (req *request.Request, output *CreateProvisionedModelThroughputOutput) { - op := &request.Operation{ - Name: opCreateProvisionedModelThroughput, - HTTPMethod: "POST", - HTTPPath: "/provisioned-model-throughput", - } - - if input == nil { - input = &CreateProvisionedModelThroughputInput{} - } - - output = &CreateProvisionedModelThroughputOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateProvisionedModelThroughput API operation for Amazon Bedrock. -// -// Creates a provisioned throughput with dedicated capacity for a foundation -// model or a fine-tuned model. -// -// For more information, see Provisioned throughput (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation CreateProvisionedModelThroughput for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - TooManyTagsException -// The request contains more tags than can be associated with a resource (50 -// tags per resource). The maximum number of tags includes both existing tags -// and those included in your current request. -// -// - ServiceQuotaExceededException -// The number of requests exceeds the service quota. Resubmit your request later. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/CreateProvisionedModelThroughput -func (c *Bedrock) CreateProvisionedModelThroughput(input *CreateProvisionedModelThroughputInput) (*CreateProvisionedModelThroughputOutput, error) { - req, out := c.CreateProvisionedModelThroughputRequest(input) - return out, req.Send() -} - -// CreateProvisionedModelThroughputWithContext is the same as CreateProvisionedModelThroughput with the addition of -// the ability to pass a context and additional request options. -// -// See CreateProvisionedModelThroughput 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 *Bedrock) CreateProvisionedModelThroughputWithContext(ctx aws.Context, input *CreateProvisionedModelThroughputInput, opts ...request.Option) (*CreateProvisionedModelThroughputOutput, error) { - req, out := c.CreateProvisionedModelThroughputRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCustomModel = "DeleteCustomModel" - -// DeleteCustomModelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCustomModel 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 DeleteCustomModel for more information on using the DeleteCustomModel -// 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 DeleteCustomModelRequest method. -// req, resp := client.DeleteCustomModelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/DeleteCustomModel -func (c *Bedrock) DeleteCustomModelRequest(input *DeleteCustomModelInput) (req *request.Request, output *DeleteCustomModelOutput) { - op := &request.Operation{ - Name: opDeleteCustomModel, - HTTPMethod: "DELETE", - HTTPPath: "/custom-models/{modelIdentifier}", - } - - if input == nil { - input = &DeleteCustomModelInput{} - } - - output = &DeleteCustomModelOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCustomModel API operation for Amazon Bedrock. -// -// Deletes a custom model that you created earlier. For more information, see -// Custom models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation DeleteCustomModel for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - ConflictException -// Error occurred because of a conflict while performing an operation. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/DeleteCustomModel -func (c *Bedrock) DeleteCustomModel(input *DeleteCustomModelInput) (*DeleteCustomModelOutput, error) { - req, out := c.DeleteCustomModelRequest(input) - return out, req.Send() -} - -// DeleteCustomModelWithContext is the same as DeleteCustomModel with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCustomModel 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 *Bedrock) DeleteCustomModelWithContext(ctx aws.Context, input *DeleteCustomModelInput, opts ...request.Option) (*DeleteCustomModelOutput, error) { - req, out := c.DeleteCustomModelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteModelInvocationLoggingConfiguration = "DeleteModelInvocationLoggingConfiguration" - -// DeleteModelInvocationLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteModelInvocationLoggingConfiguration 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 DeleteModelInvocationLoggingConfiguration for more information on using the DeleteModelInvocationLoggingConfiguration -// 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 DeleteModelInvocationLoggingConfigurationRequest method. -// req, resp := client.DeleteModelInvocationLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/DeleteModelInvocationLoggingConfiguration -func (c *Bedrock) DeleteModelInvocationLoggingConfigurationRequest(input *DeleteModelInvocationLoggingConfigurationInput) (req *request.Request, output *DeleteModelInvocationLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteModelInvocationLoggingConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/logging/modelinvocations", - } - - if input == nil { - input = &DeleteModelInvocationLoggingConfigurationInput{} - } - - output = &DeleteModelInvocationLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteModelInvocationLoggingConfiguration API operation for Amazon Bedrock. -// -// Delete the invocation logging. -// -// 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 Bedrock's -// API operation DeleteModelInvocationLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/DeleteModelInvocationLoggingConfiguration -func (c *Bedrock) DeleteModelInvocationLoggingConfiguration(input *DeleteModelInvocationLoggingConfigurationInput) (*DeleteModelInvocationLoggingConfigurationOutput, error) { - req, out := c.DeleteModelInvocationLoggingConfigurationRequest(input) - return out, req.Send() -} - -// DeleteModelInvocationLoggingConfigurationWithContext is the same as DeleteModelInvocationLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteModelInvocationLoggingConfiguration 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 *Bedrock) DeleteModelInvocationLoggingConfigurationWithContext(ctx aws.Context, input *DeleteModelInvocationLoggingConfigurationInput, opts ...request.Option) (*DeleteModelInvocationLoggingConfigurationOutput, error) { - req, out := c.DeleteModelInvocationLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteProvisionedModelThroughput = "DeleteProvisionedModelThroughput" - -// DeleteProvisionedModelThroughputRequest generates a "aws/request.Request" representing the -// client's request for the DeleteProvisionedModelThroughput 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 DeleteProvisionedModelThroughput for more information on using the DeleteProvisionedModelThroughput -// 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 DeleteProvisionedModelThroughputRequest method. -// req, resp := client.DeleteProvisionedModelThroughputRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/DeleteProvisionedModelThroughput -func (c *Bedrock) DeleteProvisionedModelThroughputRequest(input *DeleteProvisionedModelThroughputInput) (req *request.Request, output *DeleteProvisionedModelThroughputOutput) { - op := &request.Operation{ - Name: opDeleteProvisionedModelThroughput, - HTTPMethod: "DELETE", - HTTPPath: "/provisioned-model-throughput/{provisionedModelId}", - } - - if input == nil { - input = &DeleteProvisionedModelThroughputInput{} - } - - output = &DeleteProvisionedModelThroughputOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteProvisionedModelThroughput API operation for Amazon Bedrock. -// -// Deletes a provisioned throughput. For more information, see Provisioned throughput -// (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation DeleteProvisionedModelThroughput for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - ConflictException -// Error occurred because of a conflict while performing an operation. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/DeleteProvisionedModelThroughput -func (c *Bedrock) DeleteProvisionedModelThroughput(input *DeleteProvisionedModelThroughputInput) (*DeleteProvisionedModelThroughputOutput, error) { - req, out := c.DeleteProvisionedModelThroughputRequest(input) - return out, req.Send() -} - -// DeleteProvisionedModelThroughputWithContext is the same as DeleteProvisionedModelThroughput with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteProvisionedModelThroughput 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 *Bedrock) DeleteProvisionedModelThroughputWithContext(ctx aws.Context, input *DeleteProvisionedModelThroughputInput, opts ...request.Option) (*DeleteProvisionedModelThroughputOutput, error) { - req, out := c.DeleteProvisionedModelThroughputRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCustomModel = "GetCustomModel" - -// GetCustomModelRequest generates a "aws/request.Request" representing the -// client's request for the GetCustomModel 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 GetCustomModel for more information on using the GetCustomModel -// 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 GetCustomModelRequest method. -// req, resp := client.GetCustomModelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetCustomModel -func (c *Bedrock) GetCustomModelRequest(input *GetCustomModelInput) (req *request.Request, output *GetCustomModelOutput) { - op := &request.Operation{ - Name: opGetCustomModel, - HTTPMethod: "GET", - HTTPPath: "/custom-models/{modelIdentifier}", - } - - if input == nil { - input = &GetCustomModelInput{} - } - - output = &GetCustomModelOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCustomModel API operation for Amazon Bedrock. -// -// Get the properties associated with a Amazon Bedrock custom model that you -// have created.For more information, see Custom models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation GetCustomModel for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetCustomModel -func (c *Bedrock) GetCustomModel(input *GetCustomModelInput) (*GetCustomModelOutput, error) { - req, out := c.GetCustomModelRequest(input) - return out, req.Send() -} - -// GetCustomModelWithContext is the same as GetCustomModel with the addition of -// the ability to pass a context and additional request options. -// -// See GetCustomModel 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 *Bedrock) GetCustomModelWithContext(ctx aws.Context, input *GetCustomModelInput, opts ...request.Option) (*GetCustomModelOutput, error) { - req, out := c.GetCustomModelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetFoundationModel = "GetFoundationModel" - -// GetFoundationModelRequest generates a "aws/request.Request" representing the -// client's request for the GetFoundationModel 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 GetFoundationModel for more information on using the GetFoundationModel -// 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 GetFoundationModelRequest method. -// req, resp := client.GetFoundationModelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetFoundationModel -func (c *Bedrock) GetFoundationModelRequest(input *GetFoundationModelInput) (req *request.Request, output *GetFoundationModelOutput) { - op := &request.Operation{ - Name: opGetFoundationModel, - HTTPMethod: "GET", - HTTPPath: "/foundation-models/{modelIdentifier}", - } - - if input == nil { - input = &GetFoundationModelInput{} - } - - output = &GetFoundationModelOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetFoundationModel API operation for Amazon Bedrock. -// -// Get details about a Amazon Bedrock foundation model. -// -// 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 Bedrock's -// API operation GetFoundationModel for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetFoundationModel -func (c *Bedrock) GetFoundationModel(input *GetFoundationModelInput) (*GetFoundationModelOutput, error) { - req, out := c.GetFoundationModelRequest(input) - return out, req.Send() -} - -// GetFoundationModelWithContext is the same as GetFoundationModel with the addition of -// the ability to pass a context and additional request options. -// -// See GetFoundationModel 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 *Bedrock) GetFoundationModelWithContext(ctx aws.Context, input *GetFoundationModelInput, opts ...request.Option) (*GetFoundationModelOutput, error) { - req, out := c.GetFoundationModelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetModelCustomizationJob = "GetModelCustomizationJob" - -// GetModelCustomizationJobRequest generates a "aws/request.Request" representing the -// client's request for the GetModelCustomizationJob 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 GetModelCustomizationJob for more information on using the GetModelCustomizationJob -// 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 GetModelCustomizationJobRequest method. -// req, resp := client.GetModelCustomizationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetModelCustomizationJob -func (c *Bedrock) GetModelCustomizationJobRequest(input *GetModelCustomizationJobInput) (req *request.Request, output *GetModelCustomizationJobOutput) { - op := &request.Operation{ - Name: opGetModelCustomizationJob, - HTTPMethod: "GET", - HTTPPath: "/model-customization-jobs/{jobIdentifier}", - } - - if input == nil { - input = &GetModelCustomizationJobInput{} - } - - output = &GetModelCustomizationJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetModelCustomizationJob API operation for Amazon Bedrock. -// -// Retrieves the properties associated with a model-customization job, including -// the status of the job. For more information, see Custom models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation GetModelCustomizationJob for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetModelCustomizationJob -func (c *Bedrock) GetModelCustomizationJob(input *GetModelCustomizationJobInput) (*GetModelCustomizationJobOutput, error) { - req, out := c.GetModelCustomizationJobRequest(input) - return out, req.Send() -} - -// GetModelCustomizationJobWithContext is the same as GetModelCustomizationJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetModelCustomizationJob 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 *Bedrock) GetModelCustomizationJobWithContext(ctx aws.Context, input *GetModelCustomizationJobInput, opts ...request.Option) (*GetModelCustomizationJobOutput, error) { - req, out := c.GetModelCustomizationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetModelInvocationLoggingConfiguration = "GetModelInvocationLoggingConfiguration" - -// GetModelInvocationLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetModelInvocationLoggingConfiguration 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 GetModelInvocationLoggingConfiguration for more information on using the GetModelInvocationLoggingConfiguration -// 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 GetModelInvocationLoggingConfigurationRequest method. -// req, resp := client.GetModelInvocationLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetModelInvocationLoggingConfiguration -func (c *Bedrock) GetModelInvocationLoggingConfigurationRequest(input *GetModelInvocationLoggingConfigurationInput) (req *request.Request, output *GetModelInvocationLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opGetModelInvocationLoggingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/logging/modelinvocations", - } - - if input == nil { - input = &GetModelInvocationLoggingConfigurationInput{} - } - - output = &GetModelInvocationLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetModelInvocationLoggingConfiguration API operation for Amazon Bedrock. -// -// Get the current configuration values for model invocation logging. -// -// 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 Bedrock's -// API operation GetModelInvocationLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetModelInvocationLoggingConfiguration -func (c *Bedrock) GetModelInvocationLoggingConfiguration(input *GetModelInvocationLoggingConfigurationInput) (*GetModelInvocationLoggingConfigurationOutput, error) { - req, out := c.GetModelInvocationLoggingConfigurationRequest(input) - return out, req.Send() -} - -// GetModelInvocationLoggingConfigurationWithContext is the same as GetModelInvocationLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetModelInvocationLoggingConfiguration 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 *Bedrock) GetModelInvocationLoggingConfigurationWithContext(ctx aws.Context, input *GetModelInvocationLoggingConfigurationInput, opts ...request.Option) (*GetModelInvocationLoggingConfigurationOutput, error) { - req, out := c.GetModelInvocationLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetProvisionedModelThroughput = "GetProvisionedModelThroughput" - -// GetProvisionedModelThroughputRequest generates a "aws/request.Request" representing the -// client's request for the GetProvisionedModelThroughput 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 GetProvisionedModelThroughput for more information on using the GetProvisionedModelThroughput -// 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 GetProvisionedModelThroughputRequest method. -// req, resp := client.GetProvisionedModelThroughputRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetProvisionedModelThroughput -func (c *Bedrock) GetProvisionedModelThroughputRequest(input *GetProvisionedModelThroughputInput) (req *request.Request, output *GetProvisionedModelThroughputOutput) { - op := &request.Operation{ - Name: opGetProvisionedModelThroughput, - HTTPMethod: "GET", - HTTPPath: "/provisioned-model-throughput/{provisionedModelId}", - } - - if input == nil { - input = &GetProvisionedModelThroughputInput{} - } - - output = &GetProvisionedModelThroughputOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetProvisionedModelThroughput API operation for Amazon Bedrock. -// -// Get details for a provisioned throughput. For more information, see Provisioned -// throughput (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation GetProvisionedModelThroughput for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/GetProvisionedModelThroughput -func (c *Bedrock) GetProvisionedModelThroughput(input *GetProvisionedModelThroughputInput) (*GetProvisionedModelThroughputOutput, error) { - req, out := c.GetProvisionedModelThroughputRequest(input) - return out, req.Send() -} - -// GetProvisionedModelThroughputWithContext is the same as GetProvisionedModelThroughput with the addition of -// the ability to pass a context and additional request options. -// -// See GetProvisionedModelThroughput 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 *Bedrock) GetProvisionedModelThroughputWithContext(ctx aws.Context, input *GetProvisionedModelThroughputInput, opts ...request.Option) (*GetProvisionedModelThroughputOutput, error) { - req, out := c.GetProvisionedModelThroughputRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCustomModels = "ListCustomModels" - -// ListCustomModelsRequest generates a "aws/request.Request" representing the -// client's request for the ListCustomModels 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 ListCustomModels for more information on using the ListCustomModels -// 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 ListCustomModelsRequest method. -// req, resp := client.ListCustomModelsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListCustomModels -func (c *Bedrock) ListCustomModelsRequest(input *ListCustomModelsInput) (req *request.Request, output *ListCustomModelsOutput) { - op := &request.Operation{ - Name: opListCustomModels, - HTTPMethod: "GET", - HTTPPath: "/custom-models", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCustomModelsInput{} - } - - output = &ListCustomModelsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCustomModels API operation for Amazon Bedrock. -// -// Returns a list of the custom models that you have created with the CreateModelCustomizationJob -// operation. -// -// For more information, see Custom models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation ListCustomModels for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListCustomModels -func (c *Bedrock) ListCustomModels(input *ListCustomModelsInput) (*ListCustomModelsOutput, error) { - req, out := c.ListCustomModelsRequest(input) - return out, req.Send() -} - -// ListCustomModelsWithContext is the same as ListCustomModels with the addition of -// the ability to pass a context and additional request options. -// -// See ListCustomModels 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 *Bedrock) ListCustomModelsWithContext(ctx aws.Context, input *ListCustomModelsInput, opts ...request.Option) (*ListCustomModelsOutput, error) { - req, out := c.ListCustomModelsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCustomModelsPages iterates over the pages of a ListCustomModels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCustomModels method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCustomModels operation. -// pageNum := 0 -// err := client.ListCustomModelsPages(params, -// func(page *bedrock.ListCustomModelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Bedrock) ListCustomModelsPages(input *ListCustomModelsInput, fn func(*ListCustomModelsOutput, bool) bool) error { - return c.ListCustomModelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCustomModelsPagesWithContext same as ListCustomModelsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Bedrock) ListCustomModelsPagesWithContext(ctx aws.Context, input *ListCustomModelsInput, fn func(*ListCustomModelsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCustomModelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCustomModelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCustomModelsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListFoundationModels = "ListFoundationModels" - -// ListFoundationModelsRequest generates a "aws/request.Request" representing the -// client's request for the ListFoundationModels 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 ListFoundationModels for more information on using the ListFoundationModels -// 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 ListFoundationModelsRequest method. -// req, resp := client.ListFoundationModelsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListFoundationModels -func (c *Bedrock) ListFoundationModelsRequest(input *ListFoundationModelsInput) (req *request.Request, output *ListFoundationModelsOutput) { - op := &request.Operation{ - Name: opListFoundationModels, - HTTPMethod: "GET", - HTTPPath: "/foundation-models", - } - - if input == nil { - input = &ListFoundationModelsInput{} - } - - output = &ListFoundationModelsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListFoundationModels API operation for Amazon Bedrock. -// -// List of Amazon Bedrock foundation models that you can use. For more information, -// see Foundation models (https://docs.aws.amazon.com/bedrock/latest/userguide/foundation-models.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation ListFoundationModels for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListFoundationModels -func (c *Bedrock) ListFoundationModels(input *ListFoundationModelsInput) (*ListFoundationModelsOutput, error) { - req, out := c.ListFoundationModelsRequest(input) - return out, req.Send() -} - -// ListFoundationModelsWithContext is the same as ListFoundationModels with the addition of -// the ability to pass a context and additional request options. -// -// See ListFoundationModels 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 *Bedrock) ListFoundationModelsWithContext(ctx aws.Context, input *ListFoundationModelsInput, opts ...request.Option) (*ListFoundationModelsOutput, error) { - req, out := c.ListFoundationModelsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListModelCustomizationJobs = "ListModelCustomizationJobs" - -// ListModelCustomizationJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListModelCustomizationJobs 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 ListModelCustomizationJobs for more information on using the ListModelCustomizationJobs -// 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 ListModelCustomizationJobsRequest method. -// req, resp := client.ListModelCustomizationJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListModelCustomizationJobs -func (c *Bedrock) ListModelCustomizationJobsRequest(input *ListModelCustomizationJobsInput) (req *request.Request, output *ListModelCustomizationJobsOutput) { - op := &request.Operation{ - Name: opListModelCustomizationJobs, - HTTPMethod: "GET", - HTTPPath: "/model-customization-jobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListModelCustomizationJobsInput{} - } - - output = &ListModelCustomizationJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListModelCustomizationJobs API operation for Amazon Bedrock. -// -// Returns a list of model customization jobs that you have submitted. You can -// filter the jobs to return based on one or more criteria. -// -// For more information, see Custom models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation ListModelCustomizationJobs for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListModelCustomizationJobs -func (c *Bedrock) ListModelCustomizationJobs(input *ListModelCustomizationJobsInput) (*ListModelCustomizationJobsOutput, error) { - req, out := c.ListModelCustomizationJobsRequest(input) - return out, req.Send() -} - -// ListModelCustomizationJobsWithContext is the same as ListModelCustomizationJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListModelCustomizationJobs 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 *Bedrock) ListModelCustomizationJobsWithContext(ctx aws.Context, input *ListModelCustomizationJobsInput, opts ...request.Option) (*ListModelCustomizationJobsOutput, error) { - req, out := c.ListModelCustomizationJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListModelCustomizationJobsPages iterates over the pages of a ListModelCustomizationJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListModelCustomizationJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListModelCustomizationJobs operation. -// pageNum := 0 -// err := client.ListModelCustomizationJobsPages(params, -// func(page *bedrock.ListModelCustomizationJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Bedrock) ListModelCustomizationJobsPages(input *ListModelCustomizationJobsInput, fn func(*ListModelCustomizationJobsOutput, bool) bool) error { - return c.ListModelCustomizationJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListModelCustomizationJobsPagesWithContext same as ListModelCustomizationJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Bedrock) ListModelCustomizationJobsPagesWithContext(ctx aws.Context, input *ListModelCustomizationJobsInput, fn func(*ListModelCustomizationJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListModelCustomizationJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListModelCustomizationJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListModelCustomizationJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProvisionedModelThroughputs = "ListProvisionedModelThroughputs" - -// ListProvisionedModelThroughputsRequest generates a "aws/request.Request" representing the -// client's request for the ListProvisionedModelThroughputs 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 ListProvisionedModelThroughputs for more information on using the ListProvisionedModelThroughputs -// 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 ListProvisionedModelThroughputsRequest method. -// req, resp := client.ListProvisionedModelThroughputsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListProvisionedModelThroughputs -func (c *Bedrock) ListProvisionedModelThroughputsRequest(input *ListProvisionedModelThroughputsInput) (req *request.Request, output *ListProvisionedModelThroughputsOutput) { - op := &request.Operation{ - Name: opListProvisionedModelThroughputs, - HTTPMethod: "GET", - HTTPPath: "/provisioned-model-throughputs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProvisionedModelThroughputsInput{} - } - - output = &ListProvisionedModelThroughputsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProvisionedModelThroughputs API operation for Amazon Bedrock. -// -// List the provisioned capacities. For more information, see Provisioned throughput -// (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation ListProvisionedModelThroughputs for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListProvisionedModelThroughputs -func (c *Bedrock) ListProvisionedModelThroughputs(input *ListProvisionedModelThroughputsInput) (*ListProvisionedModelThroughputsOutput, error) { - req, out := c.ListProvisionedModelThroughputsRequest(input) - return out, req.Send() -} - -// ListProvisionedModelThroughputsWithContext is the same as ListProvisionedModelThroughputs with the addition of -// the ability to pass a context and additional request options. -// -// See ListProvisionedModelThroughputs 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 *Bedrock) ListProvisionedModelThroughputsWithContext(ctx aws.Context, input *ListProvisionedModelThroughputsInput, opts ...request.Option) (*ListProvisionedModelThroughputsOutput, error) { - req, out := c.ListProvisionedModelThroughputsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProvisionedModelThroughputsPages iterates over the pages of a ListProvisionedModelThroughputs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProvisionedModelThroughputs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProvisionedModelThroughputs operation. -// pageNum := 0 -// err := client.ListProvisionedModelThroughputsPages(params, -// func(page *bedrock.ListProvisionedModelThroughputsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Bedrock) ListProvisionedModelThroughputsPages(input *ListProvisionedModelThroughputsInput, fn func(*ListProvisionedModelThroughputsOutput, bool) bool) error { - return c.ListProvisionedModelThroughputsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProvisionedModelThroughputsPagesWithContext same as ListProvisionedModelThroughputsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Bedrock) ListProvisionedModelThroughputsPagesWithContext(ctx aws.Context, input *ListProvisionedModelThroughputsInput, fn func(*ListProvisionedModelThroughputsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProvisionedModelThroughputsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProvisionedModelThroughputsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProvisionedModelThroughputsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListTagsForResource -func (c *Bedrock) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/listTagsForResource", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Bedrock. -// -// List the tags associated with the specified resource. -// -// For more information, see Tagging resources (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/ListTagsForResource -func (c *Bedrock) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *Bedrock) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutModelInvocationLoggingConfiguration = "PutModelInvocationLoggingConfiguration" - -// PutModelInvocationLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutModelInvocationLoggingConfiguration 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 PutModelInvocationLoggingConfiguration for more information on using the PutModelInvocationLoggingConfiguration -// 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 PutModelInvocationLoggingConfigurationRequest method. -// req, resp := client.PutModelInvocationLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/PutModelInvocationLoggingConfiguration -func (c *Bedrock) PutModelInvocationLoggingConfigurationRequest(input *PutModelInvocationLoggingConfigurationInput) (req *request.Request, output *PutModelInvocationLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opPutModelInvocationLoggingConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/logging/modelinvocations", - } - - if input == nil { - input = &PutModelInvocationLoggingConfigurationInput{} - } - - output = &PutModelInvocationLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutModelInvocationLoggingConfiguration API operation for Amazon Bedrock. -// -// Set the configuration values for model invocation logging. -// -// 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 Bedrock's -// API operation PutModelInvocationLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/PutModelInvocationLoggingConfiguration -func (c *Bedrock) PutModelInvocationLoggingConfiguration(input *PutModelInvocationLoggingConfigurationInput) (*PutModelInvocationLoggingConfigurationOutput, error) { - req, out := c.PutModelInvocationLoggingConfigurationRequest(input) - return out, req.Send() -} - -// PutModelInvocationLoggingConfigurationWithContext is the same as PutModelInvocationLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutModelInvocationLoggingConfiguration 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 *Bedrock) PutModelInvocationLoggingConfigurationWithContext(ctx aws.Context, input *PutModelInvocationLoggingConfigurationInput, opts ...request.Option) (*PutModelInvocationLoggingConfigurationOutput, error) { - req, out := c.PutModelInvocationLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopModelCustomizationJob = "StopModelCustomizationJob" - -// StopModelCustomizationJobRequest generates a "aws/request.Request" representing the -// client's request for the StopModelCustomizationJob 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 StopModelCustomizationJob for more information on using the StopModelCustomizationJob -// 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 StopModelCustomizationJobRequest method. -// req, resp := client.StopModelCustomizationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/StopModelCustomizationJob -func (c *Bedrock) StopModelCustomizationJobRequest(input *StopModelCustomizationJobInput) (req *request.Request, output *StopModelCustomizationJobOutput) { - op := &request.Operation{ - Name: opStopModelCustomizationJob, - HTTPMethod: "POST", - HTTPPath: "/model-customization-jobs/{jobIdentifier}/stop", - } - - if input == nil { - input = &StopModelCustomizationJobInput{} - } - - output = &StopModelCustomizationJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopModelCustomizationJob API operation for Amazon Bedrock. -// -// Stops an active model customization job. For more information, see Custom -// models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation StopModelCustomizationJob for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - ConflictException -// Error occurred because of a conflict while performing an operation. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/StopModelCustomizationJob -func (c *Bedrock) StopModelCustomizationJob(input *StopModelCustomizationJobInput) (*StopModelCustomizationJobOutput, error) { - req, out := c.StopModelCustomizationJobRequest(input) - return out, req.Send() -} - -// StopModelCustomizationJobWithContext is the same as StopModelCustomizationJob with the addition of -// the ability to pass a context and additional request options. -// -// See StopModelCustomizationJob 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 *Bedrock) StopModelCustomizationJobWithContext(ctx aws.Context, input *StopModelCustomizationJobInput, opts ...request.Option) (*StopModelCustomizationJobOutput, error) { - req, out := c.StopModelCustomizationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/TagResource -func (c *Bedrock) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tagResource", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon Bedrock. -// -// Associate tags with a resource. For more information, see Tagging resources -// (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - TooManyTagsException -// The request contains more tags than can be associated with a resource (50 -// tags per resource). The maximum number of tags includes both existing tags -// and those included in your current request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/TagResource -func (c *Bedrock) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *Bedrock) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/UntagResource -func (c *Bedrock) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/untagResource", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon Bedrock. -// -// Remove one or more tags from a resource. For more information, see Tagging -// resources (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/UntagResource -func (c *Bedrock) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *Bedrock) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateProvisionedModelThroughput = "UpdateProvisionedModelThroughput" - -// UpdateProvisionedModelThroughputRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProvisionedModelThroughput 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 UpdateProvisionedModelThroughput for more information on using the UpdateProvisionedModelThroughput -// 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 UpdateProvisionedModelThroughputRequest method. -// req, resp := client.UpdateProvisionedModelThroughputRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/UpdateProvisionedModelThroughput -func (c *Bedrock) UpdateProvisionedModelThroughputRequest(input *UpdateProvisionedModelThroughputInput) (req *request.Request, output *UpdateProvisionedModelThroughputOutput) { - op := &request.Operation{ - Name: opUpdateProvisionedModelThroughput, - HTTPMethod: "PATCH", - HTTPPath: "/provisioned-model-throughput/{provisionedModelId}", - } - - if input == nil { - input = &UpdateProvisionedModelThroughputInput{} - } - - output = &UpdateProvisionedModelThroughputOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateProvisionedModelThroughput API operation for Amazon Bedrock. -// -// Update a provisioned throughput. For more information, see Provisioned throughput -// (https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) -// in the Bedrock User Guide. -// -// 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 Bedrock's -// API operation UpdateProvisionedModelThroughput for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20/UpdateProvisionedModelThroughput -func (c *Bedrock) UpdateProvisionedModelThroughput(input *UpdateProvisionedModelThroughputInput) (*UpdateProvisionedModelThroughputOutput, error) { - req, out := c.UpdateProvisionedModelThroughputRequest(input) - return out, req.Send() -} - -// UpdateProvisionedModelThroughputWithContext is the same as UpdateProvisionedModelThroughput with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateProvisionedModelThroughput 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 *Bedrock) UpdateProvisionedModelThroughputWithContext(ctx aws.Context, input *UpdateProvisionedModelThroughputInput, opts ...request.Option) (*UpdateProvisionedModelThroughputOutput, error) { - req, out := c.UpdateProvisionedModelThroughputRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// The request is denied because of missing access permissions. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// CloudWatch logging configuration. -type CloudWatchConfig struct { - _ struct{} `type:"structure"` - - // S3 configuration for delivering a large amount of data. - LargeDataDeliveryS3Config *S3Config `locationName:"largeDataDeliveryS3Config" type:"structure"` - - // The log group name. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" 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 CloudWatchConfig) 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 CloudWatchConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloudWatchConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudWatchConfig"} - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) - } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.LargeDataDeliveryS3Config != nil { - if err := s.LargeDataDeliveryS3Config.Validate(); err != nil { - invalidParams.AddNested("LargeDataDeliveryS3Config", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLargeDataDeliveryS3Config sets the LargeDataDeliveryS3Config field's value. -func (s *CloudWatchConfig) SetLargeDataDeliveryS3Config(v *S3Config) *CloudWatchConfig { - s.LargeDataDeliveryS3Config = v - return s -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CloudWatchConfig) SetLogGroupName(v string) *CloudWatchConfig { - s.LogGroupName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CloudWatchConfig) SetRoleArn(v string) *CloudWatchConfig { - s.RoleArn = &v - return s -} - -// Error occurred because of a conflict while performing an operation. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateModelCustomizationJobInput struct { - _ struct{} `type:"structure"` - - // Name of the base model. - // - // BaseModelIdentifier is a required field - BaseModelIdentifier *string `locationName:"baseModelIdentifier" min:"1" type:"string" required:"true"` - - // Unique token value that you can provide. The GetModelCustomizationJob response - // includes the same token value. - ClientRequestToken *string `locationName:"clientRequestToken" min:"1" type:"string" idempotencyToken:"true"` - - // The custom model is encrypted at rest using this key. - CustomModelKmsKeyId *string `locationName:"customModelKmsKeyId" min:"1" type:"string"` - - // Enter a name for the custom model. - // - // CustomModelName is a required field - CustomModelName *string `locationName:"customModelName" min:"1" type:"string" required:"true"` - - // Assign tags to the custom model. - CustomModelTags []*Tag `locationName:"customModelTags" type:"list"` - - // The customization type. - CustomizationType *string `locationName:"customizationType" type:"string" enum:"CustomizationType"` - - // Parameters related to tuning the model. - // - // HyperParameters is a required field - HyperParameters map[string]*string `locationName:"hyperParameters" type:"map" required:"true"` - - // Enter a unique name for the fine-tuning job. - // - // JobName is a required field - JobName *string `locationName:"jobName" min:"1" type:"string" required:"true"` - - // Assign tags to the job. - JobTags []*Tag `locationName:"jobTags" type:"list"` - - // S3 location for the output data. - // - // OutputDataConfig is a required field - OutputDataConfig *OutputDataConfig `locationName:"outputDataConfig" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) of an IAM role that Amazon Bedrock can assume - // to perform tasks on your behalf. For example, during model training, Amazon - // Bedrock needs your permission to read input data from an S3 bucket, write - // model artifacts to an S3 bucket. To pass this role to Amazon Bedrock, the - // caller of this API must have the iam:PassRole permission. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // Information about the training dataset. - // - // TrainingDataConfig is a required field - TrainingDataConfig *TrainingDataConfig `locationName:"trainingDataConfig" type:"structure" required:"true"` - - // Information about the validation dataset. - ValidationDataConfig *ValidationDataConfig `locationName:"validationDataConfig" type:"structure"` - - // VPC configuration (optional). Configuration parameters for the private Virtual - // Private Cloud (VPC) that contains the resources you are using for this job. - VpcConfig *VpcConfig `locationName:"vpcConfig" 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 CreateModelCustomizationJobInput) 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 CreateModelCustomizationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateModelCustomizationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateModelCustomizationJobInput"} - if s.BaseModelIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("BaseModelIdentifier")) - } - if s.BaseModelIdentifier != nil && len(*s.BaseModelIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BaseModelIdentifier", 1)) - } - if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) - } - if s.CustomModelKmsKeyId != nil && len(*s.CustomModelKmsKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomModelKmsKeyId", 1)) - } - if s.CustomModelName == nil { - invalidParams.Add(request.NewErrParamRequired("CustomModelName")) - } - if s.CustomModelName != nil && len(*s.CustomModelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomModelName", 1)) - } - if s.HyperParameters == nil { - invalidParams.Add(request.NewErrParamRequired("HyperParameters")) - } - if s.JobName == nil { - invalidParams.Add(request.NewErrParamRequired("JobName")) - } - if s.JobName != nil && len(*s.JobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobName", 1)) - } - if s.OutputDataConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputDataConfig")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.TrainingDataConfig == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingDataConfig")) - } - if s.CustomModelTags != nil { - for i, v := range s.CustomModelTags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CustomModelTags", i), err.(request.ErrInvalidParams)) - } - } - } - if s.JobTags != nil { - for i, v := range s.JobTags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "JobTags", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputDataConfig != nil { - if err := s.OutputDataConfig.Validate(); err != nil { - invalidParams.AddNested("OutputDataConfig", err.(request.ErrInvalidParams)) - } - } - if s.TrainingDataConfig != nil { - if err := s.TrainingDataConfig.Validate(); err != nil { - invalidParams.AddNested("TrainingDataConfig", err.(request.ErrInvalidParams)) - } - } - if s.ValidationDataConfig != nil { - if err := s.ValidationDataConfig.Validate(); err != nil { - invalidParams.AddNested("ValidationDataConfig", err.(request.ErrInvalidParams)) - } - } - if s.VpcConfig != nil { - if err := s.VpcConfig.Validate(); err != nil { - invalidParams.AddNested("VpcConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaseModelIdentifier sets the BaseModelIdentifier field's value. -func (s *CreateModelCustomizationJobInput) SetBaseModelIdentifier(v string) *CreateModelCustomizationJobInput { - s.BaseModelIdentifier = &v - return s -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreateModelCustomizationJobInput) SetClientRequestToken(v string) *CreateModelCustomizationJobInput { - s.ClientRequestToken = &v - return s -} - -// SetCustomModelKmsKeyId sets the CustomModelKmsKeyId field's value. -func (s *CreateModelCustomizationJobInput) SetCustomModelKmsKeyId(v string) *CreateModelCustomizationJobInput { - s.CustomModelKmsKeyId = &v - return s -} - -// SetCustomModelName sets the CustomModelName field's value. -func (s *CreateModelCustomizationJobInput) SetCustomModelName(v string) *CreateModelCustomizationJobInput { - s.CustomModelName = &v - return s -} - -// SetCustomModelTags sets the CustomModelTags field's value. -func (s *CreateModelCustomizationJobInput) SetCustomModelTags(v []*Tag) *CreateModelCustomizationJobInput { - s.CustomModelTags = v - return s -} - -// SetCustomizationType sets the CustomizationType field's value. -func (s *CreateModelCustomizationJobInput) SetCustomizationType(v string) *CreateModelCustomizationJobInput { - s.CustomizationType = &v - return s -} - -// SetHyperParameters sets the HyperParameters field's value. -func (s *CreateModelCustomizationJobInput) SetHyperParameters(v map[string]*string) *CreateModelCustomizationJobInput { - s.HyperParameters = v - return s -} - -// SetJobName sets the JobName field's value. -func (s *CreateModelCustomizationJobInput) SetJobName(v string) *CreateModelCustomizationJobInput { - s.JobName = &v - return s -} - -// SetJobTags sets the JobTags field's value. -func (s *CreateModelCustomizationJobInput) SetJobTags(v []*Tag) *CreateModelCustomizationJobInput { - s.JobTags = v - return s -} - -// SetOutputDataConfig sets the OutputDataConfig field's value. -func (s *CreateModelCustomizationJobInput) SetOutputDataConfig(v *OutputDataConfig) *CreateModelCustomizationJobInput { - s.OutputDataConfig = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateModelCustomizationJobInput) SetRoleArn(v string) *CreateModelCustomizationJobInput { - s.RoleArn = &v - return s -} - -// SetTrainingDataConfig sets the TrainingDataConfig field's value. -func (s *CreateModelCustomizationJobInput) SetTrainingDataConfig(v *TrainingDataConfig) *CreateModelCustomizationJobInput { - s.TrainingDataConfig = v - return s -} - -// SetValidationDataConfig sets the ValidationDataConfig field's value. -func (s *CreateModelCustomizationJobInput) SetValidationDataConfig(v *ValidationDataConfig) *CreateModelCustomizationJobInput { - s.ValidationDataConfig = v - return s -} - -// SetVpcConfig sets the VpcConfig field's value. -func (s *CreateModelCustomizationJobInput) SetVpcConfig(v *VpcConfig) *CreateModelCustomizationJobInput { - s.VpcConfig = v - return s -} - -type CreateModelCustomizationJobOutput struct { - _ struct{} `type:"structure"` - - // ARN of the fine tuning job - // - // JobArn is a required field - JobArn *string `locationName:"jobArn" 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 CreateModelCustomizationJobOutput) 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 CreateModelCustomizationJobOutput) GoString() string { - return s.String() -} - -// SetJobArn sets the JobArn field's value. -func (s *CreateModelCustomizationJobOutput) SetJobArn(v string) *CreateModelCustomizationJobOutput { - s.JobArn = &v - return s -} - -type CreateProvisionedModelThroughputInput struct { - _ struct{} `type:"structure"` - - // Unique token value that you can provide. If this token matches a previous - // request, Amazon Bedrock ignores the request, but does not return an error. - ClientRequestToken *string `locationName:"clientRequestToken" min:"1" type:"string" idempotencyToken:"true"` - - // Commitment duration requested for the provisioned throughput. - CommitmentDuration *string `locationName:"commitmentDuration" type:"string" enum:"CommitmentDuration"` - - // Name or ARN of the model to associate with this provisioned throughput. - // - // ModelId is a required field - ModelId *string `locationName:"modelId" min:"1" type:"string" required:"true"` - - // Number of model units to allocate. - // - // ModelUnits is a required field - ModelUnits *int64 `locationName:"modelUnits" min:"1" type:"integer" required:"true"` - - // Unique name for this provisioned throughput. - // - // ProvisionedModelName is a required field - ProvisionedModelName *string `locationName:"provisionedModelName" min:"1" type:"string" required:"true"` - - // Tags to associate with this provisioned throughput. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateProvisionedModelThroughputInput) 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 CreateProvisionedModelThroughputInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateProvisionedModelThroughputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateProvisionedModelThroughputInput"} - if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) - } - if s.ModelId == nil { - invalidParams.Add(request.NewErrParamRequired("ModelId")) - } - if s.ModelId != nil && len(*s.ModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) - } - if s.ModelUnits == nil { - invalidParams.Add(request.NewErrParamRequired("ModelUnits")) - } - if s.ModelUnits != nil && *s.ModelUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("ModelUnits", 1)) - } - if s.ProvisionedModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedModelName")) - } - if s.ProvisionedModelName != nil && len(*s.ProvisionedModelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProvisionedModelName", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreateProvisionedModelThroughputInput) SetClientRequestToken(v string) *CreateProvisionedModelThroughputInput { - s.ClientRequestToken = &v - return s -} - -// SetCommitmentDuration sets the CommitmentDuration field's value. -func (s *CreateProvisionedModelThroughputInput) SetCommitmentDuration(v string) *CreateProvisionedModelThroughputInput { - s.CommitmentDuration = &v - return s -} - -// SetModelId sets the ModelId field's value. -func (s *CreateProvisionedModelThroughputInput) SetModelId(v string) *CreateProvisionedModelThroughputInput { - s.ModelId = &v - return s -} - -// SetModelUnits sets the ModelUnits field's value. -func (s *CreateProvisionedModelThroughputInput) SetModelUnits(v int64) *CreateProvisionedModelThroughputInput { - s.ModelUnits = &v - return s -} - -// SetProvisionedModelName sets the ProvisionedModelName field's value. -func (s *CreateProvisionedModelThroughputInput) SetProvisionedModelName(v string) *CreateProvisionedModelThroughputInput { - s.ProvisionedModelName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateProvisionedModelThroughputInput) SetTags(v []*Tag) *CreateProvisionedModelThroughputInput { - s.Tags = v - return s -} - -type CreateProvisionedModelThroughputOutput struct { - _ struct{} `type:"structure"` - - // The ARN for this provisioned throughput. - // - // ProvisionedModelArn is a required field - ProvisionedModelArn *string `locationName:"provisionedModelArn" 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 CreateProvisionedModelThroughputOutput) 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 CreateProvisionedModelThroughputOutput) GoString() string { - return s.String() -} - -// SetProvisionedModelArn sets the ProvisionedModelArn field's value. -func (s *CreateProvisionedModelThroughputOutput) SetProvisionedModelArn(v string) *CreateProvisionedModelThroughputOutput { - s.ProvisionedModelArn = &v - return s -} - -// Summary information for a custom model. -type CustomModelSummary struct { - _ struct{} `type:"structure"` - - // The base model ARN. - // - // BaseModelArn is a required field - BaseModelArn *string `locationName:"baseModelArn" min:"20" type:"string" required:"true"` - - // The base model name. - // - // BaseModelName is a required field - BaseModelName *string `locationName:"baseModelName" min:"1" type:"string" required:"true"` - - // Creation time of the model. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Specifies whether to carry out continued pre-training of a model or whether - // to fine-tune it. For more information, see Custom models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html). - CustomizationType *string `locationName:"customizationType" type:"string" enum:"CustomizationType"` - - // The ARN of the custom model. - // - // ModelArn is a required field - ModelArn *string `locationName:"modelArn" min:"20" type:"string" required:"true"` - - // The name of the custom model. - // - // ModelName is a required field - ModelName *string `locationName:"modelName" min:"1" 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 CustomModelSummary) 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 CustomModelSummary) GoString() string { - return s.String() -} - -// SetBaseModelArn sets the BaseModelArn field's value. -func (s *CustomModelSummary) SetBaseModelArn(v string) *CustomModelSummary { - s.BaseModelArn = &v - return s -} - -// SetBaseModelName sets the BaseModelName field's value. -func (s *CustomModelSummary) SetBaseModelName(v string) *CustomModelSummary { - s.BaseModelName = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CustomModelSummary) SetCreationTime(v time.Time) *CustomModelSummary { - s.CreationTime = &v - return s -} - -// SetCustomizationType sets the CustomizationType field's value. -func (s *CustomModelSummary) SetCustomizationType(v string) *CustomModelSummary { - s.CustomizationType = &v - return s -} - -// SetModelArn sets the ModelArn field's value. -func (s *CustomModelSummary) SetModelArn(v string) *CustomModelSummary { - s.ModelArn = &v - return s -} - -// SetModelName sets the ModelName field's value. -func (s *CustomModelSummary) SetModelName(v string) *CustomModelSummary { - s.ModelName = &v - return s -} - -type DeleteCustomModelInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Name of the model to delete. - // - // ModelIdentifier is a required field - ModelIdentifier *string `location:"uri" locationName:"modelIdentifier" min:"1" 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 DeleteCustomModelInput) 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 DeleteCustomModelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCustomModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCustomModelInput"} - if s.ModelIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ModelIdentifier")) - } - if s.ModelIdentifier != nil && len(*s.ModelIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetModelIdentifier sets the ModelIdentifier field's value. -func (s *DeleteCustomModelInput) SetModelIdentifier(v string) *DeleteCustomModelInput { - s.ModelIdentifier = &v - return s -} - -type DeleteCustomModelOutput 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 DeleteCustomModelOutput) 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 DeleteCustomModelOutput) GoString() string { - return s.String() -} - -type DeleteModelInvocationLoggingConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"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 DeleteModelInvocationLoggingConfigurationInput) 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 DeleteModelInvocationLoggingConfigurationInput) GoString() string { - return s.String() -} - -type DeleteModelInvocationLoggingConfigurationOutput 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 DeleteModelInvocationLoggingConfigurationOutput) 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 DeleteModelInvocationLoggingConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteProvisionedModelThroughputInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN or name of the provisioned throughput. - // - // ProvisionedModelId is a required field - ProvisionedModelId *string `location:"uri" locationName:"provisionedModelId" 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 DeleteProvisionedModelThroughputInput) 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 DeleteProvisionedModelThroughputInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteProvisionedModelThroughputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteProvisionedModelThroughputInput"} - if s.ProvisionedModelId == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedModelId")) - } - if s.ProvisionedModelId != nil && len(*s.ProvisionedModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProvisionedModelId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProvisionedModelId sets the ProvisionedModelId field's value. -func (s *DeleteProvisionedModelThroughputInput) SetProvisionedModelId(v string) *DeleteProvisionedModelThroughputInput { - s.ProvisionedModelId = &v - return s -} - -type DeleteProvisionedModelThroughputOutput 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 DeleteProvisionedModelThroughputOutput) 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 DeleteProvisionedModelThroughputOutput) GoString() string { - return s.String() -} - -// Information about a foundation model. -type FoundationModelDetails struct { - _ struct{} `type:"structure"` - - // The customization that the model supports. - CustomizationsSupported []*string `locationName:"customizationsSupported" type:"list" enum:"ModelCustomization"` - - // The inference types that the model supports. - InferenceTypesSupported []*string `locationName:"inferenceTypesSupported" type:"list" enum:"InferenceType"` - - // The input modalities that the model supports. - InputModalities []*string `locationName:"inputModalities" type:"list" enum:"ModelModality"` - - // The model ARN. - // - // ModelArn is a required field - ModelArn *string `locationName:"modelArn" type:"string" required:"true"` - - // The model identifier. - // - // ModelId is a required field - ModelId *string `locationName:"modelId" type:"string" required:"true"` - - // Contains details about whether a model version is available or deprecated - ModelLifecycle *FoundationModelLifecycle `locationName:"modelLifecycle" type:"structure"` - - // The model name. - ModelName *string `locationName:"modelName" min:"1" type:"string"` - - // The output modalities that the model supports. - OutputModalities []*string `locationName:"outputModalities" type:"list" enum:"ModelModality"` - - // he model's provider name. - ProviderName *string `locationName:"providerName" min:"1" type:"string"` - - // Indicates whether the model supports streaming. - ResponseStreamingSupported *bool `locationName:"responseStreamingSupported" type:"boolean"` -} - -// 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 FoundationModelDetails) 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 FoundationModelDetails) GoString() string { - return s.String() -} - -// SetCustomizationsSupported sets the CustomizationsSupported field's value. -func (s *FoundationModelDetails) SetCustomizationsSupported(v []*string) *FoundationModelDetails { - s.CustomizationsSupported = v - return s -} - -// SetInferenceTypesSupported sets the InferenceTypesSupported field's value. -func (s *FoundationModelDetails) SetInferenceTypesSupported(v []*string) *FoundationModelDetails { - s.InferenceTypesSupported = v - return s -} - -// SetInputModalities sets the InputModalities field's value. -func (s *FoundationModelDetails) SetInputModalities(v []*string) *FoundationModelDetails { - s.InputModalities = v - return s -} - -// SetModelArn sets the ModelArn field's value. -func (s *FoundationModelDetails) SetModelArn(v string) *FoundationModelDetails { - s.ModelArn = &v - return s -} - -// SetModelId sets the ModelId field's value. -func (s *FoundationModelDetails) SetModelId(v string) *FoundationModelDetails { - s.ModelId = &v - return s -} - -// SetModelLifecycle sets the ModelLifecycle field's value. -func (s *FoundationModelDetails) SetModelLifecycle(v *FoundationModelLifecycle) *FoundationModelDetails { - s.ModelLifecycle = v - return s -} - -// SetModelName sets the ModelName field's value. -func (s *FoundationModelDetails) SetModelName(v string) *FoundationModelDetails { - s.ModelName = &v - return s -} - -// SetOutputModalities sets the OutputModalities field's value. -func (s *FoundationModelDetails) SetOutputModalities(v []*string) *FoundationModelDetails { - s.OutputModalities = v - return s -} - -// SetProviderName sets the ProviderName field's value. -func (s *FoundationModelDetails) SetProviderName(v string) *FoundationModelDetails { - s.ProviderName = &v - return s -} - -// SetResponseStreamingSupported sets the ResponseStreamingSupported field's value. -func (s *FoundationModelDetails) SetResponseStreamingSupported(v bool) *FoundationModelDetails { - s.ResponseStreamingSupported = &v - return s -} - -// Details about whether a model version is available or deprecated. -type FoundationModelLifecycle struct { - _ struct{} `type:"structure"` - - // Specifies whether a model version is available (ACTIVE) or deprecated (LEGACY. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"FoundationModelLifecycleStatus"` -} - -// 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 FoundationModelLifecycle) 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 FoundationModelLifecycle) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *FoundationModelLifecycle) SetStatus(v string) *FoundationModelLifecycle { - s.Status = &v - return s -} - -// Summary information for a foundation model. -type FoundationModelSummary struct { - _ struct{} `type:"structure"` - - // Whether the model supports fine-tuning or continual pre-training. - CustomizationsSupported []*string `locationName:"customizationsSupported" type:"list" enum:"ModelCustomization"` - - // The inference types that the model supports. - InferenceTypesSupported []*string `locationName:"inferenceTypesSupported" type:"list" enum:"InferenceType"` - - // The input modalities that the model supports. - InputModalities []*string `locationName:"inputModalities" type:"list" enum:"ModelModality"` - - // The ARN of the foundation model. - // - // ModelArn is a required field - ModelArn *string `locationName:"modelArn" type:"string" required:"true"` - - // The model Id of the foundation model. - // - // ModelId is a required field - ModelId *string `locationName:"modelId" type:"string" required:"true"` - - // Contains details about whether a model version is available or deprecated. - ModelLifecycle *FoundationModelLifecycle `locationName:"modelLifecycle" type:"structure"` - - // The name of the model. - ModelName *string `locationName:"modelName" min:"1" type:"string"` - - // The output modalities that the model supports. - OutputModalities []*string `locationName:"outputModalities" type:"list" enum:"ModelModality"` - - // The model's provider name. - ProviderName *string `locationName:"providerName" min:"1" type:"string"` - - // Indicates whether the model supports streaming. - ResponseStreamingSupported *bool `locationName:"responseStreamingSupported" type:"boolean"` -} - -// 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 FoundationModelSummary) 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 FoundationModelSummary) GoString() string { - return s.String() -} - -// SetCustomizationsSupported sets the CustomizationsSupported field's value. -func (s *FoundationModelSummary) SetCustomizationsSupported(v []*string) *FoundationModelSummary { - s.CustomizationsSupported = v - return s -} - -// SetInferenceTypesSupported sets the InferenceTypesSupported field's value. -func (s *FoundationModelSummary) SetInferenceTypesSupported(v []*string) *FoundationModelSummary { - s.InferenceTypesSupported = v - return s -} - -// SetInputModalities sets the InputModalities field's value. -func (s *FoundationModelSummary) SetInputModalities(v []*string) *FoundationModelSummary { - s.InputModalities = v - return s -} - -// SetModelArn sets the ModelArn field's value. -func (s *FoundationModelSummary) SetModelArn(v string) *FoundationModelSummary { - s.ModelArn = &v - return s -} - -// SetModelId sets the ModelId field's value. -func (s *FoundationModelSummary) SetModelId(v string) *FoundationModelSummary { - s.ModelId = &v - return s -} - -// SetModelLifecycle sets the ModelLifecycle field's value. -func (s *FoundationModelSummary) SetModelLifecycle(v *FoundationModelLifecycle) *FoundationModelSummary { - s.ModelLifecycle = v - return s -} - -// SetModelName sets the ModelName field's value. -func (s *FoundationModelSummary) SetModelName(v string) *FoundationModelSummary { - s.ModelName = &v - return s -} - -// SetOutputModalities sets the OutputModalities field's value. -func (s *FoundationModelSummary) SetOutputModalities(v []*string) *FoundationModelSummary { - s.OutputModalities = v - return s -} - -// SetProviderName sets the ProviderName field's value. -func (s *FoundationModelSummary) SetProviderName(v string) *FoundationModelSummary { - s.ProviderName = &v - return s -} - -// SetResponseStreamingSupported sets the ResponseStreamingSupported field's value. -func (s *FoundationModelSummary) SetResponseStreamingSupported(v bool) *FoundationModelSummary { - s.ResponseStreamingSupported = &v - return s -} - -type GetCustomModelInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Name or ARN of the custom model. - // - // ModelIdentifier is a required field - ModelIdentifier *string `location:"uri" locationName:"modelIdentifier" min:"1" 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 GetCustomModelInput) 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 GetCustomModelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCustomModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCustomModelInput"} - if s.ModelIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ModelIdentifier")) - } - if s.ModelIdentifier != nil && len(*s.ModelIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetModelIdentifier sets the ModelIdentifier field's value. -func (s *GetCustomModelInput) SetModelIdentifier(v string) *GetCustomModelInput { - s.ModelIdentifier = &v - return s -} - -type GetCustomModelOutput struct { - _ struct{} `type:"structure"` - - // ARN of the base model. - // - // BaseModelArn is a required field - BaseModelArn *string `locationName:"baseModelArn" min:"20" type:"string" required:"true"` - - // Creation time of the model. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The type of model customization. - CustomizationType *string `locationName:"customizationType" type:"string" enum:"CustomizationType"` - - // Hyperparameter values associated with this model. - HyperParameters map[string]*string `locationName:"hyperParameters" type:"map"` - - // Job ARN associated with this model. - // - // JobArn is a required field - JobArn *string `locationName:"jobArn" type:"string" required:"true"` - - // Job name associated with this model. - JobName *string `locationName:"jobName" min:"1" type:"string"` - - // ARN associated with this model. - // - // ModelArn is a required field - ModelArn *string `locationName:"modelArn" min:"20" type:"string" required:"true"` - - // The custom model is encrypted at rest using this key. - ModelKmsKeyArn *string `locationName:"modelKmsKeyArn" min:"1" type:"string"` - - // Model name associated with this model. - // - // ModelName is a required field - ModelName *string `locationName:"modelName" min:"1" type:"string" required:"true"` - - // Output data configuration associated with this custom model. - // - // OutputDataConfig is a required field - OutputDataConfig *OutputDataConfig `locationName:"outputDataConfig" type:"structure" required:"true"` - - // Information about the training dataset. - // - // TrainingDataConfig is a required field - TrainingDataConfig *TrainingDataConfig `locationName:"trainingDataConfig" type:"structure" required:"true"` - - // The training metrics from the job creation. - TrainingMetrics *TrainingMetrics `locationName:"trainingMetrics" type:"structure"` - - // Array of up to 10 validators. - ValidationDataConfig *ValidationDataConfig `locationName:"validationDataConfig" type:"structure"` - - // The validation metrics from the job creation. - ValidationMetrics []*ValidatorMetric `locationName:"validationMetrics" type:"list"` -} - -// 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 GetCustomModelOutput) 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 GetCustomModelOutput) GoString() string { - return s.String() -} - -// SetBaseModelArn sets the BaseModelArn field's value. -func (s *GetCustomModelOutput) SetBaseModelArn(v string) *GetCustomModelOutput { - s.BaseModelArn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetCustomModelOutput) SetCreationTime(v time.Time) *GetCustomModelOutput { - s.CreationTime = &v - return s -} - -// SetCustomizationType sets the CustomizationType field's value. -func (s *GetCustomModelOutput) SetCustomizationType(v string) *GetCustomModelOutput { - s.CustomizationType = &v - return s -} - -// SetHyperParameters sets the HyperParameters field's value. -func (s *GetCustomModelOutput) SetHyperParameters(v map[string]*string) *GetCustomModelOutput { - s.HyperParameters = v - return s -} - -// SetJobArn sets the JobArn field's value. -func (s *GetCustomModelOutput) SetJobArn(v string) *GetCustomModelOutput { - s.JobArn = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *GetCustomModelOutput) SetJobName(v string) *GetCustomModelOutput { - s.JobName = &v - return s -} - -// SetModelArn sets the ModelArn field's value. -func (s *GetCustomModelOutput) SetModelArn(v string) *GetCustomModelOutput { - s.ModelArn = &v - return s -} - -// SetModelKmsKeyArn sets the ModelKmsKeyArn field's value. -func (s *GetCustomModelOutput) SetModelKmsKeyArn(v string) *GetCustomModelOutput { - s.ModelKmsKeyArn = &v - return s -} - -// SetModelName sets the ModelName field's value. -func (s *GetCustomModelOutput) SetModelName(v string) *GetCustomModelOutput { - s.ModelName = &v - return s -} - -// SetOutputDataConfig sets the OutputDataConfig field's value. -func (s *GetCustomModelOutput) SetOutputDataConfig(v *OutputDataConfig) *GetCustomModelOutput { - s.OutputDataConfig = v - return s -} - -// SetTrainingDataConfig sets the TrainingDataConfig field's value. -func (s *GetCustomModelOutput) SetTrainingDataConfig(v *TrainingDataConfig) *GetCustomModelOutput { - s.TrainingDataConfig = v - return s -} - -// SetTrainingMetrics sets the TrainingMetrics field's value. -func (s *GetCustomModelOutput) SetTrainingMetrics(v *TrainingMetrics) *GetCustomModelOutput { - s.TrainingMetrics = v - return s -} - -// SetValidationDataConfig sets the ValidationDataConfig field's value. -func (s *GetCustomModelOutput) SetValidationDataConfig(v *ValidationDataConfig) *GetCustomModelOutput { - s.ValidationDataConfig = v - return s -} - -// SetValidationMetrics sets the ValidationMetrics field's value. -func (s *GetCustomModelOutput) SetValidationMetrics(v []*ValidatorMetric) *GetCustomModelOutput { - s.ValidationMetrics = v - return s -} - -type GetFoundationModelInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The model identifier. - // - // ModelIdentifier is a required field - ModelIdentifier *string `location:"uri" locationName:"modelIdentifier" min:"1" 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 GetFoundationModelInput) 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 GetFoundationModelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFoundationModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFoundationModelInput"} - if s.ModelIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ModelIdentifier")) - } - if s.ModelIdentifier != nil && len(*s.ModelIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetModelIdentifier sets the ModelIdentifier field's value. -func (s *GetFoundationModelInput) SetModelIdentifier(v string) *GetFoundationModelInput { - s.ModelIdentifier = &v - return s -} - -type GetFoundationModelOutput struct { - _ struct{} `type:"structure"` - - // Information about the foundation model. - ModelDetails *FoundationModelDetails `locationName:"modelDetails" 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 GetFoundationModelOutput) 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 GetFoundationModelOutput) GoString() string { - return s.String() -} - -// SetModelDetails sets the ModelDetails field's value. -func (s *GetFoundationModelOutput) SetModelDetails(v *FoundationModelDetails) *GetFoundationModelOutput { - s.ModelDetails = v - return s -} - -type GetModelCustomizationJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier for the customization job. - // - // JobIdentifier is a required field - JobIdentifier *string `location:"uri" locationName:"jobIdentifier" 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 GetModelCustomizationJobInput) 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 GetModelCustomizationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetModelCustomizationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetModelCustomizationJobInput"} - if s.JobIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("JobIdentifier")) - } - if s.JobIdentifier != nil && len(*s.JobIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobIdentifier sets the JobIdentifier field's value. -func (s *GetModelCustomizationJobInput) SetJobIdentifier(v string) *GetModelCustomizationJobInput { - s.JobIdentifier = &v - return s -} - -type GetModelCustomizationJobOutput struct { - _ struct{} `type:"structure"` - - // ARN of the base model. - // - // BaseModelArn is a required field - BaseModelArn *string `locationName:"baseModelArn" type:"string" required:"true"` - - // The token that you specified in the CreateCustomizationJob request. - ClientRequestToken *string `locationName:"clientRequestToken" min:"1" type:"string"` - - // Time that the resource was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The type of model customization. - CustomizationType *string `locationName:"customizationType" type:"string" enum:"CustomizationType"` - - // Time that the resource transitioned to terminal state. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // Information about why the job failed. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // The hyperparameter values for the job. For information about hyperparameters - // for specific models, see Guidelines for model customization (https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-guidelines.html). - // - // HyperParameters is a required field - HyperParameters map[string]*string `locationName:"hyperParameters" type:"map" required:"true"` - - // The ARN of the customization job. - // - // JobArn is a required field - JobArn *string `locationName:"jobArn" type:"string" required:"true"` - - // The name of the customization job. - // - // JobName is a required field - JobName *string `locationName:"jobName" min:"1" type:"string" required:"true"` - - // Time that the resource was last modified. - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"iso8601"` - - // Output data configuration - // - // OutputDataConfig is a required field - OutputDataConfig *OutputDataConfig `locationName:"outputDataConfig" type:"structure" required:"true"` - - // The ARN of the output model. - OutputModelArn *string `locationName:"outputModelArn" min:"20" type:"string"` - - // The custom model is encrypted at rest using this key. - OutputModelKmsKeyArn *string `locationName:"outputModelKmsKeyArn" min:"1" type:"string"` - - // The name of the output model. - // - // OutputModelName is a required field - OutputModelName *string `locationName:"outputModelName" min:"1" type:"string" required:"true"` - - // The ARN of the IAM role. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The status of the job. A successful job transitions from in-progress to completed - // when the output model is ready to use. If the job failed, the failure message - // contains information about why the job failed. - Status *string `locationName:"status" type:"string" enum:"ModelCustomizationJobStatus"` - - // S3 Location of the training data. - // - // TrainingDataConfig is a required field - TrainingDataConfig *TrainingDataConfig `locationName:"trainingDataConfig" type:"structure" required:"true"` - - // Metrics associated with the custom job. - TrainingMetrics *TrainingMetrics `locationName:"trainingMetrics" type:"structure"` - - // Array of up to 10 validators. - // - // ValidationDataConfig is a required field - ValidationDataConfig *ValidationDataConfig `locationName:"validationDataConfig" type:"structure" required:"true"` - - // The loss metric for each validator that you provided in the createjob request. - ValidationMetrics []*ValidatorMetric `locationName:"validationMetrics" type:"list"` - - // VPC configuration for the custom model job. - VpcConfig *VpcConfig `locationName:"vpcConfig" 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 GetModelCustomizationJobOutput) 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 GetModelCustomizationJobOutput) GoString() string { - return s.String() -} - -// SetBaseModelArn sets the BaseModelArn field's value. -func (s *GetModelCustomizationJobOutput) SetBaseModelArn(v string) *GetModelCustomizationJobOutput { - s.BaseModelArn = &v - return s -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *GetModelCustomizationJobOutput) SetClientRequestToken(v string) *GetModelCustomizationJobOutput { - s.ClientRequestToken = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetModelCustomizationJobOutput) SetCreationTime(v time.Time) *GetModelCustomizationJobOutput { - s.CreationTime = &v - return s -} - -// SetCustomizationType sets the CustomizationType field's value. -func (s *GetModelCustomizationJobOutput) SetCustomizationType(v string) *GetModelCustomizationJobOutput { - s.CustomizationType = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *GetModelCustomizationJobOutput) SetEndTime(v time.Time) *GetModelCustomizationJobOutput { - s.EndTime = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *GetModelCustomizationJobOutput) SetFailureMessage(v string) *GetModelCustomizationJobOutput { - s.FailureMessage = &v - return s -} - -// SetHyperParameters sets the HyperParameters field's value. -func (s *GetModelCustomizationJobOutput) SetHyperParameters(v map[string]*string) *GetModelCustomizationJobOutput { - s.HyperParameters = v - return s -} - -// SetJobArn sets the JobArn field's value. -func (s *GetModelCustomizationJobOutput) SetJobArn(v string) *GetModelCustomizationJobOutput { - s.JobArn = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *GetModelCustomizationJobOutput) SetJobName(v string) *GetModelCustomizationJobOutput { - s.JobName = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *GetModelCustomizationJobOutput) SetLastModifiedTime(v time.Time) *GetModelCustomizationJobOutput { - s.LastModifiedTime = &v - return s -} - -// SetOutputDataConfig sets the OutputDataConfig field's value. -func (s *GetModelCustomizationJobOutput) SetOutputDataConfig(v *OutputDataConfig) *GetModelCustomizationJobOutput { - s.OutputDataConfig = v - return s -} - -// SetOutputModelArn sets the OutputModelArn field's value. -func (s *GetModelCustomizationJobOutput) SetOutputModelArn(v string) *GetModelCustomizationJobOutput { - s.OutputModelArn = &v - return s -} - -// SetOutputModelKmsKeyArn sets the OutputModelKmsKeyArn field's value. -func (s *GetModelCustomizationJobOutput) SetOutputModelKmsKeyArn(v string) *GetModelCustomizationJobOutput { - s.OutputModelKmsKeyArn = &v - return s -} - -// SetOutputModelName sets the OutputModelName field's value. -func (s *GetModelCustomizationJobOutput) SetOutputModelName(v string) *GetModelCustomizationJobOutput { - s.OutputModelName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetModelCustomizationJobOutput) SetRoleArn(v string) *GetModelCustomizationJobOutput { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetModelCustomizationJobOutput) SetStatus(v string) *GetModelCustomizationJobOutput { - s.Status = &v - return s -} - -// SetTrainingDataConfig sets the TrainingDataConfig field's value. -func (s *GetModelCustomizationJobOutput) SetTrainingDataConfig(v *TrainingDataConfig) *GetModelCustomizationJobOutput { - s.TrainingDataConfig = v - return s -} - -// SetTrainingMetrics sets the TrainingMetrics field's value. -func (s *GetModelCustomizationJobOutput) SetTrainingMetrics(v *TrainingMetrics) *GetModelCustomizationJobOutput { - s.TrainingMetrics = v - return s -} - -// SetValidationDataConfig sets the ValidationDataConfig field's value. -func (s *GetModelCustomizationJobOutput) SetValidationDataConfig(v *ValidationDataConfig) *GetModelCustomizationJobOutput { - s.ValidationDataConfig = v - return s -} - -// SetValidationMetrics sets the ValidationMetrics field's value. -func (s *GetModelCustomizationJobOutput) SetValidationMetrics(v []*ValidatorMetric) *GetModelCustomizationJobOutput { - s.ValidationMetrics = v - return s -} - -// SetVpcConfig sets the VpcConfig field's value. -func (s *GetModelCustomizationJobOutput) SetVpcConfig(v *VpcConfig) *GetModelCustomizationJobOutput { - s.VpcConfig = v - return s -} - -type GetModelInvocationLoggingConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"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 GetModelInvocationLoggingConfigurationInput) 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 GetModelInvocationLoggingConfigurationInput) GoString() string { - return s.String() -} - -type GetModelInvocationLoggingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The current configuration values. - LoggingConfig *LoggingConfig `locationName:"loggingConfig" 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 GetModelInvocationLoggingConfigurationOutput) 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 GetModelInvocationLoggingConfigurationOutput) GoString() string { - return s.String() -} - -// SetLoggingConfig sets the LoggingConfig field's value. -func (s *GetModelInvocationLoggingConfigurationOutput) SetLoggingConfig(v *LoggingConfig) *GetModelInvocationLoggingConfigurationOutput { - s.LoggingConfig = v - return s -} - -type GetProvisionedModelThroughputInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN or name of the provisioned throughput. - // - // ProvisionedModelId is a required field - ProvisionedModelId *string `location:"uri" locationName:"provisionedModelId" 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 GetProvisionedModelThroughputInput) 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 GetProvisionedModelThroughputInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetProvisionedModelThroughputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetProvisionedModelThroughputInput"} - if s.ProvisionedModelId == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedModelId")) - } - if s.ProvisionedModelId != nil && len(*s.ProvisionedModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProvisionedModelId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProvisionedModelId sets the ProvisionedModelId field's value. -func (s *GetProvisionedModelThroughputInput) SetProvisionedModelId(v string) *GetProvisionedModelThroughputInput { - s.ProvisionedModelId = &v - return s -} - -type GetProvisionedModelThroughputOutput struct { - _ struct{} `type:"structure"` - - // Commitment duration of the provisioned throughput. - CommitmentDuration *string `locationName:"commitmentDuration" type:"string" enum:"CommitmentDuration"` - - // Commitment expiration time for the provisioned throughput. - CommitmentExpirationTime *time.Time `locationName:"commitmentExpirationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The timestamp of the creation time for this provisioned throughput. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ARN of the new model to asssociate with this provisioned throughput. - // - // DesiredModelArn is a required field - DesiredModelArn *string `locationName:"desiredModelArn" min:"20" type:"string" required:"true"` - - // The desired number of model units that was requested to be available for - // this provisioned throughput. - // - // DesiredModelUnits is a required field - DesiredModelUnits *int64 `locationName:"desiredModelUnits" min:"1" type:"integer" required:"true"` - - // Failure message for any issues that the create operation encounters. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // ARN of the foundation model. - // - // FoundationModelArn is a required field - FoundationModelArn *string `locationName:"foundationModelArn" type:"string" required:"true"` - - // The timestamp of the last modified time of this provisioned throughput. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ARN or name of the model associated with this provisioned throughput. - // - // ModelArn is a required field - ModelArn *string `locationName:"modelArn" min:"20" type:"string" required:"true"` - - // The current number of model units requested to be available for this provisioned - // throughput. - // - // ModelUnits is a required field - ModelUnits *int64 `locationName:"modelUnits" min:"1" type:"integer" required:"true"` - - // The ARN of the provisioned throughput. - // - // ProvisionedModelArn is a required field - ProvisionedModelArn *string `locationName:"provisionedModelArn" type:"string" required:"true"` - - // The name of the provisioned throughput. - // - // ProvisionedModelName is a required field - ProvisionedModelName *string `locationName:"provisionedModelName" min:"1" type:"string" required:"true"` - - // Status of the provisioned throughput. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ProvisionedModelStatus"` -} - -// 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 GetProvisionedModelThroughputOutput) 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 GetProvisionedModelThroughputOutput) GoString() string { - return s.String() -} - -// SetCommitmentDuration sets the CommitmentDuration field's value. -func (s *GetProvisionedModelThroughputOutput) SetCommitmentDuration(v string) *GetProvisionedModelThroughputOutput { - s.CommitmentDuration = &v - return s -} - -// SetCommitmentExpirationTime sets the CommitmentExpirationTime field's value. -func (s *GetProvisionedModelThroughputOutput) SetCommitmentExpirationTime(v time.Time) *GetProvisionedModelThroughputOutput { - s.CommitmentExpirationTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetProvisionedModelThroughputOutput) SetCreationTime(v time.Time) *GetProvisionedModelThroughputOutput { - s.CreationTime = &v - return s -} - -// SetDesiredModelArn sets the DesiredModelArn field's value. -func (s *GetProvisionedModelThroughputOutput) SetDesiredModelArn(v string) *GetProvisionedModelThroughputOutput { - s.DesiredModelArn = &v - return s -} - -// SetDesiredModelUnits sets the DesiredModelUnits field's value. -func (s *GetProvisionedModelThroughputOutput) SetDesiredModelUnits(v int64) *GetProvisionedModelThroughputOutput { - s.DesiredModelUnits = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *GetProvisionedModelThroughputOutput) SetFailureMessage(v string) *GetProvisionedModelThroughputOutput { - s.FailureMessage = &v - return s -} - -// SetFoundationModelArn sets the FoundationModelArn field's value. -func (s *GetProvisionedModelThroughputOutput) SetFoundationModelArn(v string) *GetProvisionedModelThroughputOutput { - s.FoundationModelArn = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *GetProvisionedModelThroughputOutput) SetLastModifiedTime(v time.Time) *GetProvisionedModelThroughputOutput { - s.LastModifiedTime = &v - return s -} - -// SetModelArn sets the ModelArn field's value. -func (s *GetProvisionedModelThroughputOutput) SetModelArn(v string) *GetProvisionedModelThroughputOutput { - s.ModelArn = &v - return s -} - -// SetModelUnits sets the ModelUnits field's value. -func (s *GetProvisionedModelThroughputOutput) SetModelUnits(v int64) *GetProvisionedModelThroughputOutput { - s.ModelUnits = &v - return s -} - -// SetProvisionedModelArn sets the ProvisionedModelArn field's value. -func (s *GetProvisionedModelThroughputOutput) SetProvisionedModelArn(v string) *GetProvisionedModelThroughputOutput { - s.ProvisionedModelArn = &v - return s -} - -// SetProvisionedModelName sets the ProvisionedModelName field's value. -func (s *GetProvisionedModelThroughputOutput) SetProvisionedModelName(v string) *GetProvisionedModelThroughputOutput { - s.ProvisionedModelName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetProvisionedModelThroughputOutput) SetStatus(v string) *GetProvisionedModelThroughputOutput { - s.Status = &v - return s -} - -// An internal server error occurred. Retry your request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListCustomModelsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Return custom models only if the base model ARN matches this parameter. - BaseModelArnEquals *string `location:"querystring" locationName:"baseModelArnEquals" min:"20" type:"string"` - - // Return custom models created after the specified time. - CreationTimeAfter *time.Time `location:"querystring" locationName:"creationTimeAfter" type:"timestamp" timestampFormat:"iso8601"` - - // Return custom models created before the specified time. - CreationTimeBefore *time.Time `location:"querystring" locationName:"creationTimeBefore" type:"timestamp" timestampFormat:"iso8601"` - - // Return custom models only if the foundation model ARN matches this parameter. - FoundationModelArnEquals *string `location:"querystring" locationName:"foundationModelArnEquals" type:"string"` - - // Maximum number of results to return in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Return custom models only if the job name contains these characters. - NameContains *string `location:"querystring" locationName:"nameContains" min:"1" type:"string"` - - // Continuation token from the previous response, for Amazon Bedrock to list - // the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The field to sort by in the returned list of models. - SortBy *string `location:"querystring" locationName:"sortBy" type:"string" enum:"SortModelsBy"` - - // The sort order of the results. - SortOrder *string `location:"querystring" locationName:"sortOrder" type:"string" enum:"SortOrder"` -} - -// 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 ListCustomModelsInput) 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 ListCustomModelsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCustomModelsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCustomModelsInput"} - if s.BaseModelArnEquals != nil && len(*s.BaseModelArnEquals) < 20 { - invalidParams.Add(request.NewErrParamMinLen("BaseModelArnEquals", 20)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NameContains != nil && len(*s.NameContains) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NameContains", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaseModelArnEquals sets the BaseModelArnEquals field's value. -func (s *ListCustomModelsInput) SetBaseModelArnEquals(v string) *ListCustomModelsInput { - s.BaseModelArnEquals = &v - return s -} - -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListCustomModelsInput) SetCreationTimeAfter(v time.Time) *ListCustomModelsInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListCustomModelsInput) SetCreationTimeBefore(v time.Time) *ListCustomModelsInput { - s.CreationTimeBefore = &v - return s -} - -// SetFoundationModelArnEquals sets the FoundationModelArnEquals field's value. -func (s *ListCustomModelsInput) SetFoundationModelArnEquals(v string) *ListCustomModelsInput { - s.FoundationModelArnEquals = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCustomModelsInput) SetMaxResults(v int64) *ListCustomModelsInput { - s.MaxResults = &v - return s -} - -// SetNameContains sets the NameContains field's value. -func (s *ListCustomModelsInput) SetNameContains(v string) *ListCustomModelsInput { - s.NameContains = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCustomModelsInput) SetNextToken(v string) *ListCustomModelsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListCustomModelsInput) SetSortBy(v string) *ListCustomModelsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListCustomModelsInput) SetSortOrder(v string) *ListCustomModelsInput { - s.SortOrder = &v - return s -} - -type ListCustomModelsOutput struct { - _ struct{} `type:"structure"` - - // Model summaries. - ModelSummaries []*CustomModelSummary `locationName:"modelSummaries" type:"list"` - - // Continuation token for the next request to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListCustomModelsOutput) 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 ListCustomModelsOutput) GoString() string { - return s.String() -} - -// SetModelSummaries sets the ModelSummaries field's value. -func (s *ListCustomModelsOutput) SetModelSummaries(v []*CustomModelSummary) *ListCustomModelsOutput { - s.ModelSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCustomModelsOutput) SetNextToken(v string) *ListCustomModelsOutput { - s.NextToken = &v - return s -} - -type ListFoundationModelsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // List by customization type. - ByCustomizationType *string `location:"querystring" locationName:"byCustomizationType" type:"string" enum:"ModelCustomization"` - - // List by inference type. - ByInferenceType *string `location:"querystring" locationName:"byInferenceType" type:"string" enum:"InferenceType"` - - // List by output modality type. - ByOutputModality *string `location:"querystring" locationName:"byOutputModality" type:"string" enum:"ModelModality"` - - // A Amazon Bedrock model provider. - ByProvider *string `location:"querystring" locationName:"byProvider" 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 ListFoundationModelsInput) 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 ListFoundationModelsInput) GoString() string { - return s.String() -} - -// SetByCustomizationType sets the ByCustomizationType field's value. -func (s *ListFoundationModelsInput) SetByCustomizationType(v string) *ListFoundationModelsInput { - s.ByCustomizationType = &v - return s -} - -// SetByInferenceType sets the ByInferenceType field's value. -func (s *ListFoundationModelsInput) SetByInferenceType(v string) *ListFoundationModelsInput { - s.ByInferenceType = &v - return s -} - -// SetByOutputModality sets the ByOutputModality field's value. -func (s *ListFoundationModelsInput) SetByOutputModality(v string) *ListFoundationModelsInput { - s.ByOutputModality = &v - return s -} - -// SetByProvider sets the ByProvider field's value. -func (s *ListFoundationModelsInput) SetByProvider(v string) *ListFoundationModelsInput { - s.ByProvider = &v - return s -} - -type ListFoundationModelsOutput struct { - _ struct{} `type:"structure"` - - // A list of Amazon Bedrock foundation models. - ModelSummaries []*FoundationModelSummary `locationName:"modelSummaries" type:"list"` -} - -// 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 ListFoundationModelsOutput) 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 ListFoundationModelsOutput) GoString() string { - return s.String() -} - -// SetModelSummaries sets the ModelSummaries field's value. -func (s *ListFoundationModelsOutput) SetModelSummaries(v []*FoundationModelSummary) *ListFoundationModelsOutput { - s.ModelSummaries = v - return s -} - -type ListModelCustomizationJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Return customization jobs created after the specified time. - CreationTimeAfter *time.Time `location:"querystring" locationName:"creationTimeAfter" type:"timestamp" timestampFormat:"iso8601"` - - // Return customization jobs created before the specified time. - CreationTimeBefore *time.Time `location:"querystring" locationName:"creationTimeBefore" type:"timestamp" timestampFormat:"iso8601"` - - // Maximum number of results to return in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Return customization jobs only if the job name contains these characters. - NameContains *string `location:"querystring" locationName:"nameContains" min:"1" type:"string"` - - // Continuation token from the previous response, for Amazon Bedrock to list - // the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The field to sort by in the returned list of jobs. - SortBy *string `location:"querystring" locationName:"sortBy" type:"string" enum:"SortJobsBy"` - - // The sort order of the results. - SortOrder *string `location:"querystring" locationName:"sortOrder" type:"string" enum:"SortOrder"` - - // Return customization jobs with the specified status. - StatusEquals *string `location:"querystring" locationName:"statusEquals" type:"string" enum:"FineTuningJobStatus"` -} - -// 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 ListModelCustomizationJobsInput) 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 ListModelCustomizationJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListModelCustomizationJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListModelCustomizationJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NameContains != nil && len(*s.NameContains) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NameContains", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListModelCustomizationJobsInput) SetCreationTimeAfter(v time.Time) *ListModelCustomizationJobsInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListModelCustomizationJobsInput) SetCreationTimeBefore(v time.Time) *ListModelCustomizationJobsInput { - s.CreationTimeBefore = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListModelCustomizationJobsInput) SetMaxResults(v int64) *ListModelCustomizationJobsInput { - s.MaxResults = &v - return s -} - -// SetNameContains sets the NameContains field's value. -func (s *ListModelCustomizationJobsInput) SetNameContains(v string) *ListModelCustomizationJobsInput { - s.NameContains = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListModelCustomizationJobsInput) SetNextToken(v string) *ListModelCustomizationJobsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListModelCustomizationJobsInput) SetSortBy(v string) *ListModelCustomizationJobsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListModelCustomizationJobsInput) SetSortOrder(v string) *ListModelCustomizationJobsInput { - s.SortOrder = &v - return s -} - -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListModelCustomizationJobsInput) SetStatusEquals(v string) *ListModelCustomizationJobsInput { - s.StatusEquals = &v - return s -} - -type ListModelCustomizationJobsOutput struct { - _ struct{} `type:"structure"` - - // Job summaries. - ModelCustomizationJobSummaries []*ModelCustomizationJobSummary `locationName:"modelCustomizationJobSummaries" type:"list"` - - // Page continuation token to use in the next request. - NextToken *string `locationName:"nextToken" min:"1" 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 ListModelCustomizationJobsOutput) 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 ListModelCustomizationJobsOutput) GoString() string { - return s.String() -} - -// SetModelCustomizationJobSummaries sets the ModelCustomizationJobSummaries field's value. -func (s *ListModelCustomizationJobsOutput) SetModelCustomizationJobSummaries(v []*ModelCustomizationJobSummary) *ListModelCustomizationJobsOutput { - s.ModelCustomizationJobSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListModelCustomizationJobsOutput) SetNextToken(v string) *ListModelCustomizationJobsOutput { - s.NextToken = &v - return s -} - -type ListProvisionedModelThroughputsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Return provisioned capacities created after the specified time. - CreationTimeAfter *time.Time `location:"querystring" locationName:"creationTimeAfter" type:"timestamp" timestampFormat:"iso8601"` - - // Return provisioned capacities created before the specified time. - CreationTimeBefore *time.Time `location:"querystring" locationName:"creationTimeBefore" type:"timestamp" timestampFormat:"iso8601"` - - // THe maximum number of results to return in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Return the list of provisioned capacities where their model ARN is equal - // to this parameter. - ModelArnEquals *string `location:"querystring" locationName:"modelArnEquals" min:"20" type:"string"` - - // Return the list of provisioned capacities if their name contains these characters. - NameContains *string `location:"querystring" locationName:"nameContains" min:"1" type:"string"` - - // Continuation token from the previous response, for Amazon Bedrock to list - // the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The field to sort by in the returned list of provisioned capacities. - SortBy *string `location:"querystring" locationName:"sortBy" type:"string" enum:"SortByProvisionedModels"` - - // The sort order of the results. - SortOrder *string `location:"querystring" locationName:"sortOrder" type:"string" enum:"SortOrder"` - - // Return the list of provisioned capacities that match the specified status. - StatusEquals *string `location:"querystring" locationName:"statusEquals" type:"string" enum:"ProvisionedModelStatus"` -} - -// 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 ListProvisionedModelThroughputsInput) 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 ListProvisionedModelThroughputsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProvisionedModelThroughputsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProvisionedModelThroughputsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ModelArnEquals != nil && len(*s.ModelArnEquals) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ModelArnEquals", 20)) - } - if s.NameContains != nil && len(*s.NameContains) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NameContains", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListProvisionedModelThroughputsInput) SetCreationTimeAfter(v time.Time) *ListProvisionedModelThroughputsInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListProvisionedModelThroughputsInput) SetCreationTimeBefore(v time.Time) *ListProvisionedModelThroughputsInput { - s.CreationTimeBefore = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListProvisionedModelThroughputsInput) SetMaxResults(v int64) *ListProvisionedModelThroughputsInput { - s.MaxResults = &v - return s -} - -// SetModelArnEquals sets the ModelArnEquals field's value. -func (s *ListProvisionedModelThroughputsInput) SetModelArnEquals(v string) *ListProvisionedModelThroughputsInput { - s.ModelArnEquals = &v - return s -} - -// SetNameContains sets the NameContains field's value. -func (s *ListProvisionedModelThroughputsInput) SetNameContains(v string) *ListProvisionedModelThroughputsInput { - s.NameContains = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProvisionedModelThroughputsInput) SetNextToken(v string) *ListProvisionedModelThroughputsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListProvisionedModelThroughputsInput) SetSortBy(v string) *ListProvisionedModelThroughputsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListProvisionedModelThroughputsInput) SetSortOrder(v string) *ListProvisionedModelThroughputsInput { - s.SortOrder = &v - return s -} - -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListProvisionedModelThroughputsInput) SetStatusEquals(v string) *ListProvisionedModelThroughputsInput { - s.StatusEquals = &v - return s -} - -type ListProvisionedModelThroughputsOutput struct { - _ struct{} `type:"structure"` - - // Continuation token for the next request to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // List of summaries, one for each provisioned throughput in the response. - ProvisionedModelSummaries []*ProvisionedModelSummary `locationName:"provisionedModelSummaries" type:"list"` -} - -// 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 ListProvisionedModelThroughputsOutput) 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 ListProvisionedModelThroughputsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProvisionedModelThroughputsOutput) SetNextToken(v string) *ListProvisionedModelThroughputsOutput { - s.NextToken = &v - return s -} - -// SetProvisionedModelSummaries sets the ProvisionedModelSummaries field's value. -func (s *ListProvisionedModelThroughputsOutput) SetProvisionedModelSummaries(v []*ProvisionedModelSummary) *ListProvisionedModelThroughputsOutput { - s.ProvisionedModelSummaries = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource. - // - // ResourceARN is a required field - ResourceARN *string `locationName:"resourceARN" min:"20" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { - s.ResourceARN = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // An array of the tags associated with this resource. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Configuration fields for invokation logging. -type LoggingConfig struct { - _ struct{} `type:"structure"` - - // CloudWatch logging configuration. - CloudWatchConfig *CloudWatchConfig `locationName:"cloudWatchConfig" type:"structure"` - - // Set to include embeddings data in the log delivery. - EmbeddingDataDeliveryEnabled *bool `locationName:"embeddingDataDeliveryEnabled" type:"boolean"` - - // Set to include image data in the log delivery. - ImageDataDeliveryEnabled *bool `locationName:"imageDataDeliveryEnabled" type:"boolean"` - - // S3 configuration for storing log data. - S3Config *S3Config `locationName:"s3Config" type:"structure"` - - // Set to include text data in the log delivery. - TextDataDeliveryEnabled *bool `locationName:"textDataDeliveryEnabled" type:"boolean"` -} - -// 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 LoggingConfig) 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 LoggingConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LoggingConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LoggingConfig"} - if s.CloudWatchConfig != nil { - if err := s.CloudWatchConfig.Validate(); err != nil { - invalidParams.AddNested("CloudWatchConfig", err.(request.ErrInvalidParams)) - } - } - if s.S3Config != nil { - if err := s.S3Config.Validate(); err != nil { - invalidParams.AddNested("S3Config", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchConfig sets the CloudWatchConfig field's value. -func (s *LoggingConfig) SetCloudWatchConfig(v *CloudWatchConfig) *LoggingConfig { - s.CloudWatchConfig = v - return s -} - -// SetEmbeddingDataDeliveryEnabled sets the EmbeddingDataDeliveryEnabled field's value. -func (s *LoggingConfig) SetEmbeddingDataDeliveryEnabled(v bool) *LoggingConfig { - s.EmbeddingDataDeliveryEnabled = &v - return s -} - -// SetImageDataDeliveryEnabled sets the ImageDataDeliveryEnabled field's value. -func (s *LoggingConfig) SetImageDataDeliveryEnabled(v bool) *LoggingConfig { - s.ImageDataDeliveryEnabled = &v - return s -} - -// SetS3Config sets the S3Config field's value. -func (s *LoggingConfig) SetS3Config(v *S3Config) *LoggingConfig { - s.S3Config = v - return s -} - -// SetTextDataDeliveryEnabled sets the TextDataDeliveryEnabled field's value. -func (s *LoggingConfig) SetTextDataDeliveryEnabled(v bool) *LoggingConfig { - s.TextDataDeliveryEnabled = &v - return s -} - -// Information about one customization job -type ModelCustomizationJobSummary struct { - _ struct{} `type:"structure"` - - // ARN of the base model. - // - // BaseModelArn is a required field - BaseModelArn *string `locationName:"baseModelArn" min:"20" type:"string" required:"true"` - - // Creation time of the custom model. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // ARN of the custom model. - CustomModelArn *string `locationName:"customModelArn" min:"20" type:"string"` - - // Name of the custom model. - CustomModelName *string `locationName:"customModelName" min:"1" type:"string"` - - // Specifies whether to carry out continued pre-training of a model or whether - // to fine-tune it. For more information, see Custom models (https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html). - CustomizationType *string `locationName:"customizationType" type:"string" enum:"CustomizationType"` - - // Time that the customization job ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // ARN of the customization job. - // - // JobArn is a required field - JobArn *string `locationName:"jobArn" type:"string" required:"true"` - - // Name of the customization job. - // - // JobName is a required field - JobName *string `locationName:"jobName" min:"1" type:"string" required:"true"` - - // Time that the customization job was last modified. - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"iso8601"` - - // Status of the customization job. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ModelCustomizationJobStatus"` -} - -// 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 ModelCustomizationJobSummary) 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 ModelCustomizationJobSummary) GoString() string { - return s.String() -} - -// SetBaseModelArn sets the BaseModelArn field's value. -func (s *ModelCustomizationJobSummary) SetBaseModelArn(v string) *ModelCustomizationJobSummary { - s.BaseModelArn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ModelCustomizationJobSummary) SetCreationTime(v time.Time) *ModelCustomizationJobSummary { - s.CreationTime = &v - return s -} - -// SetCustomModelArn sets the CustomModelArn field's value. -func (s *ModelCustomizationJobSummary) SetCustomModelArn(v string) *ModelCustomizationJobSummary { - s.CustomModelArn = &v - return s -} - -// SetCustomModelName sets the CustomModelName field's value. -func (s *ModelCustomizationJobSummary) SetCustomModelName(v string) *ModelCustomizationJobSummary { - s.CustomModelName = &v - return s -} - -// SetCustomizationType sets the CustomizationType field's value. -func (s *ModelCustomizationJobSummary) SetCustomizationType(v string) *ModelCustomizationJobSummary { - s.CustomizationType = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *ModelCustomizationJobSummary) SetEndTime(v time.Time) *ModelCustomizationJobSummary { - s.EndTime = &v - return s -} - -// SetJobArn sets the JobArn field's value. -func (s *ModelCustomizationJobSummary) SetJobArn(v string) *ModelCustomizationJobSummary { - s.JobArn = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *ModelCustomizationJobSummary) SetJobName(v string) *ModelCustomizationJobSummary { - s.JobName = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *ModelCustomizationJobSummary) SetLastModifiedTime(v time.Time) *ModelCustomizationJobSummary { - s.LastModifiedTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ModelCustomizationJobSummary) SetStatus(v string) *ModelCustomizationJobSummary { - s.Status = &v - return s -} - -// S3 Location of the output data. -type OutputDataConfig struct { - _ struct{} `type:"structure"` - - // The S3 URI where the output data is stored. - // - // S3Uri is a required field - S3Uri *string `locationName:"s3Uri" min:"1" 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 OutputDataConfig) 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 OutputDataConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutputDataConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputDataConfig"} - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) - } - if s.S3Uri != nil && len(*s.S3Uri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3Uri", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Uri sets the S3Uri field's value. -func (s *OutputDataConfig) SetS3Uri(v string) *OutputDataConfig { - s.S3Uri = &v - return s -} - -// Set of fields associated with a provisioned throughput. -type ProvisionedModelSummary struct { - _ struct{} `type:"structure"` - - // Commitment duration for the provisioned throughput. - CommitmentDuration *string `locationName:"commitmentDuration" type:"string" enum:"CommitmentDuration"` - - // Commitment expiration time for the provisioned throughput. - CommitmentExpirationTime *time.Time `locationName:"commitmentExpirationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The time that this provisioned throughput was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Desired model ARN. - // - // DesiredModelArn is a required field - DesiredModelArn *string `locationName:"desiredModelArn" min:"20" type:"string" required:"true"` - - // Desired model units. - // - // DesiredModelUnits is a required field - DesiredModelUnits *int64 `locationName:"desiredModelUnits" min:"1" type:"integer" required:"true"` - - // Foundation model ARN. - // - // FoundationModelArn is a required field - FoundationModelArn *string `locationName:"foundationModelArn" type:"string" required:"true"` - - // The time that this provisioned throughput was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ARN of the model associated with this provisioned throughput. - // - // ModelArn is a required field - ModelArn *string `locationName:"modelArn" min:"20" type:"string" required:"true"` - - // The number of model units allocated. - // - // ModelUnits is a required field - ModelUnits *int64 `locationName:"modelUnits" min:"1" type:"integer" required:"true"` - - // The ARN of the provisioned throughput. - // - // ProvisionedModelArn is a required field - ProvisionedModelArn *string `locationName:"provisionedModelArn" type:"string" required:"true"` - - // The name of the provisioned throughput. - // - // ProvisionedModelName is a required field - ProvisionedModelName *string `locationName:"provisionedModelName" min:"1" type:"string" required:"true"` - - // Status of the provisioned throughput. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ProvisionedModelStatus"` -} - -// 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 ProvisionedModelSummary) 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 ProvisionedModelSummary) GoString() string { - return s.String() -} - -// SetCommitmentDuration sets the CommitmentDuration field's value. -func (s *ProvisionedModelSummary) SetCommitmentDuration(v string) *ProvisionedModelSummary { - s.CommitmentDuration = &v - return s -} - -// SetCommitmentExpirationTime sets the CommitmentExpirationTime field's value. -func (s *ProvisionedModelSummary) SetCommitmentExpirationTime(v time.Time) *ProvisionedModelSummary { - s.CommitmentExpirationTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ProvisionedModelSummary) SetCreationTime(v time.Time) *ProvisionedModelSummary { - s.CreationTime = &v - return s -} - -// SetDesiredModelArn sets the DesiredModelArn field's value. -func (s *ProvisionedModelSummary) SetDesiredModelArn(v string) *ProvisionedModelSummary { - s.DesiredModelArn = &v - return s -} - -// SetDesiredModelUnits sets the DesiredModelUnits field's value. -func (s *ProvisionedModelSummary) SetDesiredModelUnits(v int64) *ProvisionedModelSummary { - s.DesiredModelUnits = &v - return s -} - -// SetFoundationModelArn sets the FoundationModelArn field's value. -func (s *ProvisionedModelSummary) SetFoundationModelArn(v string) *ProvisionedModelSummary { - s.FoundationModelArn = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *ProvisionedModelSummary) SetLastModifiedTime(v time.Time) *ProvisionedModelSummary { - s.LastModifiedTime = &v - return s -} - -// SetModelArn sets the ModelArn field's value. -func (s *ProvisionedModelSummary) SetModelArn(v string) *ProvisionedModelSummary { - s.ModelArn = &v - return s -} - -// SetModelUnits sets the ModelUnits field's value. -func (s *ProvisionedModelSummary) SetModelUnits(v int64) *ProvisionedModelSummary { - s.ModelUnits = &v - return s -} - -// SetProvisionedModelArn sets the ProvisionedModelArn field's value. -func (s *ProvisionedModelSummary) SetProvisionedModelArn(v string) *ProvisionedModelSummary { - s.ProvisionedModelArn = &v - return s -} - -// SetProvisionedModelName sets the ProvisionedModelName field's value. -func (s *ProvisionedModelSummary) SetProvisionedModelName(v string) *ProvisionedModelSummary { - s.ProvisionedModelName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ProvisionedModelSummary) SetStatus(v string) *ProvisionedModelSummary { - s.Status = &v - return s -} - -type PutModelInvocationLoggingConfigurationInput struct { - _ struct{} `type:"structure"` - - // The logging configuration values to set. - // - // LoggingConfig is a required field - LoggingConfig *LoggingConfig `locationName:"loggingConfig" type:"structure" 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 PutModelInvocationLoggingConfigurationInput) 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 PutModelInvocationLoggingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutModelInvocationLoggingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutModelInvocationLoggingConfigurationInput"} - if s.LoggingConfig == nil { - invalidParams.Add(request.NewErrParamRequired("LoggingConfig")) - } - if s.LoggingConfig != nil { - if err := s.LoggingConfig.Validate(); err != nil { - invalidParams.AddNested("LoggingConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoggingConfig sets the LoggingConfig field's value. -func (s *PutModelInvocationLoggingConfigurationInput) SetLoggingConfig(v *LoggingConfig) *PutModelInvocationLoggingConfigurationInput { - s.LoggingConfig = v - return s -} - -type PutModelInvocationLoggingConfigurationOutput 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 PutModelInvocationLoggingConfigurationOutput) 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 PutModelInvocationLoggingConfigurationOutput) GoString() string { - return s.String() -} - -// The specified resource ARN was not found. Check the ARN and try your request -// again. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// S3 configuration for storing log data. -type S3Config struct { - _ struct{} `type:"structure"` - - // S3 bucket name. - // - // BucketName is a required field - BucketName *string `locationName:"bucketName" min:"3" type:"string" required:"true"` - - // S3 prefix. - KeyPrefix *string `locationName:"keyPrefix" 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 S3Config) 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 S3Config) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Config) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Config"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - if s.BucketName != nil && len(*s.BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BucketName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3Config) SetBucketName(v string) *S3Config { - s.BucketName = &v - return s -} - -// SetKeyPrefix sets the KeyPrefix field's value. -func (s *S3Config) SetKeyPrefix(v string) *S3Config { - s.KeyPrefix = &v - return s -} - -// The number of requests exceeds the service quota. Resubmit your request later. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StopModelCustomizationJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Job identifier of the job to stop. - // - // JobIdentifier is a required field - JobIdentifier *string `location:"uri" locationName:"jobIdentifier" 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 StopModelCustomizationJobInput) 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 StopModelCustomizationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopModelCustomizationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopModelCustomizationJobInput"} - if s.JobIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("JobIdentifier")) - } - if s.JobIdentifier != nil && len(*s.JobIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobIdentifier sets the JobIdentifier field's value. -func (s *StopModelCustomizationJobInput) SetJobIdentifier(v string) *StopModelCustomizationJobInput { - s.JobIdentifier = &v - return s -} - -type StopModelCustomizationJobOutput 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 StopModelCustomizationJobOutput) 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 StopModelCustomizationJobOutput) GoString() string { - return s.String() -} - -// Definition of the key/value pair for a tag. -type Tag struct { - _ struct{} `type:"structure"` - - // Key for the tag. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // Value for the tag. - // - // Value is a required field - Value *string `locationName:"value" 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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource to tag. - // - // ResourceARN is a required field - ResourceARN *string `locationName:"resourceARN" min:"20" type:"string" required:"true"` - - // Tags to associate with the resource. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 20)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The number of requests exceeds the limit. Resubmit your request later. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request contains more tags than can be associated with a resource (50 -// tags per resource). The maximum number of tags includes both existing tags -// and those included in your current request. -type TooManyTagsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The name of the resource with too many tags. - ResourceName *string `locationName:"resourceName" min:"20" 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 TooManyTagsException) 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 TooManyTagsException) GoString() string { - return s.String() -} - -func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { - return &TooManyTagsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyTagsException) Code() string { - return "TooManyTagsException" -} - -// Message returns the exception's message. -func (s *TooManyTagsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyTagsException) OrigErr() error { - return nil -} - -func (s *TooManyTagsException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyTagsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyTagsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// S3 Location of the training data. -type TrainingDataConfig struct { - _ struct{} `type:"structure"` - - // The S3 URI where the training data is stored. - // - // S3Uri is a required field - S3Uri *string `locationName:"s3Uri" min:"1" 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 TrainingDataConfig) 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 TrainingDataConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TrainingDataConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TrainingDataConfig"} - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) - } - if s.S3Uri != nil && len(*s.S3Uri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3Uri", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Uri sets the S3Uri field's value. -func (s *TrainingDataConfig) SetS3Uri(v string) *TrainingDataConfig { - s.S3Uri = &v - return s -} - -// Metrics associated with the custom job. -type TrainingMetrics struct { - _ struct{} `type:"structure"` - - // Loss metric associated with the custom job. - TrainingLoss *float64 `locationName:"trainingLoss" type:"float"` -} - -// 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 TrainingMetrics) 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 TrainingMetrics) GoString() string { - return s.String() -} - -// SetTrainingLoss sets the TrainingLoss field's value. -func (s *TrainingMetrics) SetTrainingLoss(v float64) *TrainingMetrics { - s.TrainingLoss = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource to untag. - // - // ResourceARN is a required field - ResourceARN *string `locationName:"resourceARN" min:"20" type:"string" required:"true"` - - // Tag keys of the tags to remove from the resource. - // - // TagKeys is a required field - TagKeys []*string `locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 20)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *UntagResourceInput) SetResourceARN(v string) *UntagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateProvisionedModelThroughputInput struct { - _ struct{} `type:"structure"` - - // The ARN of the new model to associate with this provisioned throughput. - DesiredModelId *string `locationName:"desiredModelId" min:"1" type:"string"` - - // The new name for this provisioned throughput. - DesiredProvisionedModelName *string `locationName:"desiredProvisionedModelName" min:"1" type:"string"` - - // The ARN or name of the provisioned throughput to update. - // - // ProvisionedModelId is a required field - ProvisionedModelId *string `location:"uri" locationName:"provisionedModelId" 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 UpdateProvisionedModelThroughputInput) 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 UpdateProvisionedModelThroughputInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateProvisionedModelThroughputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateProvisionedModelThroughputInput"} - if s.DesiredModelId != nil && len(*s.DesiredModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DesiredModelId", 1)) - } - if s.DesiredProvisionedModelName != nil && len(*s.DesiredProvisionedModelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DesiredProvisionedModelName", 1)) - } - if s.ProvisionedModelId == nil { - invalidParams.Add(request.NewErrParamRequired("ProvisionedModelId")) - } - if s.ProvisionedModelId != nil && len(*s.ProvisionedModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProvisionedModelId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDesiredModelId sets the DesiredModelId field's value. -func (s *UpdateProvisionedModelThroughputInput) SetDesiredModelId(v string) *UpdateProvisionedModelThroughputInput { - s.DesiredModelId = &v - return s -} - -// SetDesiredProvisionedModelName sets the DesiredProvisionedModelName field's value. -func (s *UpdateProvisionedModelThroughputInput) SetDesiredProvisionedModelName(v string) *UpdateProvisionedModelThroughputInput { - s.DesiredProvisionedModelName = &v - return s -} - -// SetProvisionedModelId sets the ProvisionedModelId field's value. -func (s *UpdateProvisionedModelThroughputInput) SetProvisionedModelId(v string) *UpdateProvisionedModelThroughputInput { - s.ProvisionedModelId = &v - return s -} - -type UpdateProvisionedModelThroughputOutput 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 UpdateProvisionedModelThroughputOutput) 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 UpdateProvisionedModelThroughputOutput) GoString() string { - return s.String() -} - -// Array of up to 10 validators. -type ValidationDataConfig struct { - _ struct{} `type:"structure"` - - // Information about the validators. - // - // Validators is a required field - Validators []*Validator `locationName:"validators" type:"list" 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 ValidationDataConfig) 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 ValidationDataConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidationDataConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidationDataConfig"} - if s.Validators == nil { - invalidParams.Add(request.NewErrParamRequired("Validators")) - } - if s.Validators != nil { - for i, v := range s.Validators { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Validators", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetValidators sets the Validators field's value. -func (s *ValidationDataConfig) SetValidators(v []*Validator) *ValidationDataConfig { - s.Validators = v - return s -} - -// Input validation failed. Check your request parameters and retry the request. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about a validator. -type Validator struct { - _ struct{} `type:"structure"` - - // The S3 URI where the validation data is stored. - // - // S3Uri is a required field - S3Uri *string `locationName:"s3Uri" min:"1" 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 Validator) 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 Validator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Validator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Validator"} - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) - } - if s.S3Uri != nil && len(*s.S3Uri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3Uri", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Uri sets the S3Uri field's value. -func (s *Validator) SetS3Uri(v string) *Validator { - s.S3Uri = &v - return s -} - -// The metric for the validator. -type ValidatorMetric struct { - _ struct{} `type:"structure"` - - // The validation loss associated with this validator. - ValidationLoss *float64 `locationName:"validationLoss" type:"float"` -} - -// 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 ValidatorMetric) 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 ValidatorMetric) GoString() string { - return s.String() -} - -// SetValidationLoss sets the ValidationLoss field's value. -func (s *ValidatorMetric) SetValidationLoss(v float64) *ValidatorMetric { - s.ValidationLoss = &v - return s -} - -// VPC configuration. -type VpcConfig struct { - _ struct{} `type:"structure"` - - // VPC configuration security group Ids. - // - // SecurityGroupIds is a required field - SecurityGroupIds []*string `locationName:"securityGroupIds" min:"1" type:"list" required:"true"` - - // VPC configuration subnets. - // - // SubnetIds is a required field - SubnetIds []*string `locationName:"subnetIds" min:"1" type:"list" 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 VpcConfig) 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 VpcConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VpcConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VpcConfig"} - if s.SecurityGroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityGroupIds")) - } - if s.SecurityGroupIds != nil && len(s.SecurityGroupIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroupIds", 1)) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - if s.SubnetIds != nil && len(s.SubnetIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubnetIds", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *VpcConfig) SetSecurityGroupIds(v []*string) *VpcConfig { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *VpcConfig) SetSubnetIds(v []*string) *VpcConfig { - s.SubnetIds = v - return s -} - -const ( - // CommitmentDurationOneMonth is a CommitmentDuration enum value - CommitmentDurationOneMonth = "OneMonth" - - // CommitmentDurationSixMonths is a CommitmentDuration enum value - CommitmentDurationSixMonths = "SixMonths" -) - -// CommitmentDuration_Values returns all elements of the CommitmentDuration enum -func CommitmentDuration_Values() []string { - return []string{ - CommitmentDurationOneMonth, - CommitmentDurationSixMonths, - } -} - -const ( - // CustomizationTypeFineTuning is a CustomizationType enum value - CustomizationTypeFineTuning = "FINE_TUNING" - - // CustomizationTypeContinuedPreTraining is a CustomizationType enum value - CustomizationTypeContinuedPreTraining = "CONTINUED_PRE_TRAINING" -) - -// CustomizationType_Values returns all elements of the CustomizationType enum -func CustomizationType_Values() []string { - return []string{ - CustomizationTypeFineTuning, - CustomizationTypeContinuedPreTraining, - } -} - -const ( - // FineTuningJobStatusInProgress is a FineTuningJobStatus enum value - FineTuningJobStatusInProgress = "InProgress" - - // FineTuningJobStatusCompleted is a FineTuningJobStatus enum value - FineTuningJobStatusCompleted = "Completed" - - // FineTuningJobStatusFailed is a FineTuningJobStatus enum value - FineTuningJobStatusFailed = "Failed" - - // FineTuningJobStatusStopping is a FineTuningJobStatus enum value - FineTuningJobStatusStopping = "Stopping" - - // FineTuningJobStatusStopped is a FineTuningJobStatus enum value - FineTuningJobStatusStopped = "Stopped" -) - -// FineTuningJobStatus_Values returns all elements of the FineTuningJobStatus enum -func FineTuningJobStatus_Values() []string { - return []string{ - FineTuningJobStatusInProgress, - FineTuningJobStatusCompleted, - FineTuningJobStatusFailed, - FineTuningJobStatusStopping, - FineTuningJobStatusStopped, - } -} - -const ( - // FoundationModelLifecycleStatusActive is a FoundationModelLifecycleStatus enum value - FoundationModelLifecycleStatusActive = "ACTIVE" - - // FoundationModelLifecycleStatusLegacy is a FoundationModelLifecycleStatus enum value - FoundationModelLifecycleStatusLegacy = "LEGACY" -) - -// FoundationModelLifecycleStatus_Values returns all elements of the FoundationModelLifecycleStatus enum -func FoundationModelLifecycleStatus_Values() []string { - return []string{ - FoundationModelLifecycleStatusActive, - FoundationModelLifecycleStatusLegacy, - } -} - -const ( - // InferenceTypeOnDemand is a InferenceType enum value - InferenceTypeOnDemand = "ON_DEMAND" - - // InferenceTypeProvisioned is a InferenceType enum value - InferenceTypeProvisioned = "PROVISIONED" -) - -// InferenceType_Values returns all elements of the InferenceType enum -func InferenceType_Values() []string { - return []string{ - InferenceTypeOnDemand, - InferenceTypeProvisioned, - } -} - -const ( - // ModelCustomizationFineTuning is a ModelCustomization enum value - ModelCustomizationFineTuning = "FINE_TUNING" - - // ModelCustomizationContinuedPreTraining is a ModelCustomization enum value - ModelCustomizationContinuedPreTraining = "CONTINUED_PRE_TRAINING" -) - -// ModelCustomization_Values returns all elements of the ModelCustomization enum -func ModelCustomization_Values() []string { - return []string{ - ModelCustomizationFineTuning, - ModelCustomizationContinuedPreTraining, - } -} - -const ( - // ModelCustomizationJobStatusInProgress is a ModelCustomizationJobStatus enum value - ModelCustomizationJobStatusInProgress = "InProgress" - - // ModelCustomizationJobStatusCompleted is a ModelCustomizationJobStatus enum value - ModelCustomizationJobStatusCompleted = "Completed" - - // ModelCustomizationJobStatusFailed is a ModelCustomizationJobStatus enum value - ModelCustomizationJobStatusFailed = "Failed" - - // ModelCustomizationJobStatusStopping is a ModelCustomizationJobStatus enum value - ModelCustomizationJobStatusStopping = "Stopping" - - // ModelCustomizationJobStatusStopped is a ModelCustomizationJobStatus enum value - ModelCustomizationJobStatusStopped = "Stopped" -) - -// ModelCustomizationJobStatus_Values returns all elements of the ModelCustomizationJobStatus enum -func ModelCustomizationJobStatus_Values() []string { - return []string{ - ModelCustomizationJobStatusInProgress, - ModelCustomizationJobStatusCompleted, - ModelCustomizationJobStatusFailed, - ModelCustomizationJobStatusStopping, - ModelCustomizationJobStatusStopped, - } -} - -const ( - // ModelModalityText is a ModelModality enum value - ModelModalityText = "TEXT" - - // ModelModalityImage is a ModelModality enum value - ModelModalityImage = "IMAGE" - - // ModelModalityEmbedding is a ModelModality enum value - ModelModalityEmbedding = "EMBEDDING" -) - -// ModelModality_Values returns all elements of the ModelModality enum -func ModelModality_Values() []string { - return []string{ - ModelModalityText, - ModelModalityImage, - ModelModalityEmbedding, - } -} - -const ( - // ProvisionedModelStatusCreating is a ProvisionedModelStatus enum value - ProvisionedModelStatusCreating = "Creating" - - // ProvisionedModelStatusInService is a ProvisionedModelStatus enum value - ProvisionedModelStatusInService = "InService" - - // ProvisionedModelStatusUpdating is a ProvisionedModelStatus enum value - ProvisionedModelStatusUpdating = "Updating" - - // ProvisionedModelStatusFailed is a ProvisionedModelStatus enum value - ProvisionedModelStatusFailed = "Failed" -) - -// ProvisionedModelStatus_Values returns all elements of the ProvisionedModelStatus enum -func ProvisionedModelStatus_Values() []string { - return []string{ - ProvisionedModelStatusCreating, - ProvisionedModelStatusInService, - ProvisionedModelStatusUpdating, - ProvisionedModelStatusFailed, - } -} - -const ( - // SortByProvisionedModelsCreationTime is a SortByProvisionedModels enum value - SortByProvisionedModelsCreationTime = "CreationTime" -) - -// SortByProvisionedModels_Values returns all elements of the SortByProvisionedModels enum -func SortByProvisionedModels_Values() []string { - return []string{ - SortByProvisionedModelsCreationTime, - } -} - -const ( - // SortJobsByCreationTime is a SortJobsBy enum value - SortJobsByCreationTime = "CreationTime" -) - -// SortJobsBy_Values returns all elements of the SortJobsBy enum -func SortJobsBy_Values() []string { - return []string{ - SortJobsByCreationTime, - } -} - -const ( - // SortModelsByCreationTime is a SortModelsBy enum value - SortModelsByCreationTime = "CreationTime" -) - -// SortModelsBy_Values returns all elements of the SortModelsBy enum -func SortModelsBy_Values() []string { - return []string{ - SortModelsByCreationTime, - } -} - -const ( - // SortOrderAscending is a SortOrder enum value - SortOrderAscending = "Ascending" - - // SortOrderDescending is a SortOrder enum value - SortOrderDescending = "Descending" -) - -// SortOrder_Values returns all elements of the SortOrder enum -func SortOrder_Values() []string { - return []string{ - SortOrderAscending, - SortOrderDescending, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/bedrockiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/bedrockiface/interface.go deleted file mode 100644 index a0b614ac685d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/bedrockiface/interface.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bedrockiface provides an interface to enable mocking the Amazon Bedrock service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package bedrockiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock" -) - -// BedrockAPI provides an interface to enable mocking the -// bedrock.Bedrock service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Bedrock. -// func myFunc(svc bedrockiface.BedrockAPI) bool { -// // Make svc.CreateModelCustomizationJob request -// } -// -// func main() { -// sess := session.New() -// svc := bedrock.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockBedrockClient struct { -// bedrockiface.BedrockAPI -// } -// func (m *mockBedrockClient) CreateModelCustomizationJob(input *bedrock.CreateModelCustomizationJobInput) (*bedrock.CreateModelCustomizationJobOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockBedrockClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type BedrockAPI interface { - CreateModelCustomizationJob(*bedrock.CreateModelCustomizationJobInput) (*bedrock.CreateModelCustomizationJobOutput, error) - CreateModelCustomizationJobWithContext(aws.Context, *bedrock.CreateModelCustomizationJobInput, ...request.Option) (*bedrock.CreateModelCustomizationJobOutput, error) - CreateModelCustomizationJobRequest(*bedrock.CreateModelCustomizationJobInput) (*request.Request, *bedrock.CreateModelCustomizationJobOutput) - - CreateProvisionedModelThroughput(*bedrock.CreateProvisionedModelThroughputInput) (*bedrock.CreateProvisionedModelThroughputOutput, error) - CreateProvisionedModelThroughputWithContext(aws.Context, *bedrock.CreateProvisionedModelThroughputInput, ...request.Option) (*bedrock.CreateProvisionedModelThroughputOutput, error) - CreateProvisionedModelThroughputRequest(*bedrock.CreateProvisionedModelThroughputInput) (*request.Request, *bedrock.CreateProvisionedModelThroughputOutput) - - DeleteCustomModel(*bedrock.DeleteCustomModelInput) (*bedrock.DeleteCustomModelOutput, error) - DeleteCustomModelWithContext(aws.Context, *bedrock.DeleteCustomModelInput, ...request.Option) (*bedrock.DeleteCustomModelOutput, error) - DeleteCustomModelRequest(*bedrock.DeleteCustomModelInput) (*request.Request, *bedrock.DeleteCustomModelOutput) - - DeleteModelInvocationLoggingConfiguration(*bedrock.DeleteModelInvocationLoggingConfigurationInput) (*bedrock.DeleteModelInvocationLoggingConfigurationOutput, error) - DeleteModelInvocationLoggingConfigurationWithContext(aws.Context, *bedrock.DeleteModelInvocationLoggingConfigurationInput, ...request.Option) (*bedrock.DeleteModelInvocationLoggingConfigurationOutput, error) - DeleteModelInvocationLoggingConfigurationRequest(*bedrock.DeleteModelInvocationLoggingConfigurationInput) (*request.Request, *bedrock.DeleteModelInvocationLoggingConfigurationOutput) - - DeleteProvisionedModelThroughput(*bedrock.DeleteProvisionedModelThroughputInput) (*bedrock.DeleteProvisionedModelThroughputOutput, error) - DeleteProvisionedModelThroughputWithContext(aws.Context, *bedrock.DeleteProvisionedModelThroughputInput, ...request.Option) (*bedrock.DeleteProvisionedModelThroughputOutput, error) - DeleteProvisionedModelThroughputRequest(*bedrock.DeleteProvisionedModelThroughputInput) (*request.Request, *bedrock.DeleteProvisionedModelThroughputOutput) - - GetCustomModel(*bedrock.GetCustomModelInput) (*bedrock.GetCustomModelOutput, error) - GetCustomModelWithContext(aws.Context, *bedrock.GetCustomModelInput, ...request.Option) (*bedrock.GetCustomModelOutput, error) - GetCustomModelRequest(*bedrock.GetCustomModelInput) (*request.Request, *bedrock.GetCustomModelOutput) - - GetFoundationModel(*bedrock.GetFoundationModelInput) (*bedrock.GetFoundationModelOutput, error) - GetFoundationModelWithContext(aws.Context, *bedrock.GetFoundationModelInput, ...request.Option) (*bedrock.GetFoundationModelOutput, error) - GetFoundationModelRequest(*bedrock.GetFoundationModelInput) (*request.Request, *bedrock.GetFoundationModelOutput) - - GetModelCustomizationJob(*bedrock.GetModelCustomizationJobInput) (*bedrock.GetModelCustomizationJobOutput, error) - GetModelCustomizationJobWithContext(aws.Context, *bedrock.GetModelCustomizationJobInput, ...request.Option) (*bedrock.GetModelCustomizationJobOutput, error) - GetModelCustomizationJobRequest(*bedrock.GetModelCustomizationJobInput) (*request.Request, *bedrock.GetModelCustomizationJobOutput) - - GetModelInvocationLoggingConfiguration(*bedrock.GetModelInvocationLoggingConfigurationInput) (*bedrock.GetModelInvocationLoggingConfigurationOutput, error) - GetModelInvocationLoggingConfigurationWithContext(aws.Context, *bedrock.GetModelInvocationLoggingConfigurationInput, ...request.Option) (*bedrock.GetModelInvocationLoggingConfigurationOutput, error) - GetModelInvocationLoggingConfigurationRequest(*bedrock.GetModelInvocationLoggingConfigurationInput) (*request.Request, *bedrock.GetModelInvocationLoggingConfigurationOutput) - - GetProvisionedModelThroughput(*bedrock.GetProvisionedModelThroughputInput) (*bedrock.GetProvisionedModelThroughputOutput, error) - GetProvisionedModelThroughputWithContext(aws.Context, *bedrock.GetProvisionedModelThroughputInput, ...request.Option) (*bedrock.GetProvisionedModelThroughputOutput, error) - GetProvisionedModelThroughputRequest(*bedrock.GetProvisionedModelThroughputInput) (*request.Request, *bedrock.GetProvisionedModelThroughputOutput) - - ListCustomModels(*bedrock.ListCustomModelsInput) (*bedrock.ListCustomModelsOutput, error) - ListCustomModelsWithContext(aws.Context, *bedrock.ListCustomModelsInput, ...request.Option) (*bedrock.ListCustomModelsOutput, error) - ListCustomModelsRequest(*bedrock.ListCustomModelsInput) (*request.Request, *bedrock.ListCustomModelsOutput) - - ListCustomModelsPages(*bedrock.ListCustomModelsInput, func(*bedrock.ListCustomModelsOutput, bool) bool) error - ListCustomModelsPagesWithContext(aws.Context, *bedrock.ListCustomModelsInput, func(*bedrock.ListCustomModelsOutput, bool) bool, ...request.Option) error - - ListFoundationModels(*bedrock.ListFoundationModelsInput) (*bedrock.ListFoundationModelsOutput, error) - ListFoundationModelsWithContext(aws.Context, *bedrock.ListFoundationModelsInput, ...request.Option) (*bedrock.ListFoundationModelsOutput, error) - ListFoundationModelsRequest(*bedrock.ListFoundationModelsInput) (*request.Request, *bedrock.ListFoundationModelsOutput) - - ListModelCustomizationJobs(*bedrock.ListModelCustomizationJobsInput) (*bedrock.ListModelCustomizationJobsOutput, error) - ListModelCustomizationJobsWithContext(aws.Context, *bedrock.ListModelCustomizationJobsInput, ...request.Option) (*bedrock.ListModelCustomizationJobsOutput, error) - ListModelCustomizationJobsRequest(*bedrock.ListModelCustomizationJobsInput) (*request.Request, *bedrock.ListModelCustomizationJobsOutput) - - ListModelCustomizationJobsPages(*bedrock.ListModelCustomizationJobsInput, func(*bedrock.ListModelCustomizationJobsOutput, bool) bool) error - ListModelCustomizationJobsPagesWithContext(aws.Context, *bedrock.ListModelCustomizationJobsInput, func(*bedrock.ListModelCustomizationJobsOutput, bool) bool, ...request.Option) error - - ListProvisionedModelThroughputs(*bedrock.ListProvisionedModelThroughputsInput) (*bedrock.ListProvisionedModelThroughputsOutput, error) - ListProvisionedModelThroughputsWithContext(aws.Context, *bedrock.ListProvisionedModelThroughputsInput, ...request.Option) (*bedrock.ListProvisionedModelThroughputsOutput, error) - ListProvisionedModelThroughputsRequest(*bedrock.ListProvisionedModelThroughputsInput) (*request.Request, *bedrock.ListProvisionedModelThroughputsOutput) - - ListProvisionedModelThroughputsPages(*bedrock.ListProvisionedModelThroughputsInput, func(*bedrock.ListProvisionedModelThroughputsOutput, bool) bool) error - ListProvisionedModelThroughputsPagesWithContext(aws.Context, *bedrock.ListProvisionedModelThroughputsInput, func(*bedrock.ListProvisionedModelThroughputsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*bedrock.ListTagsForResourceInput) (*bedrock.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *bedrock.ListTagsForResourceInput, ...request.Option) (*bedrock.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*bedrock.ListTagsForResourceInput) (*request.Request, *bedrock.ListTagsForResourceOutput) - - PutModelInvocationLoggingConfiguration(*bedrock.PutModelInvocationLoggingConfigurationInput) (*bedrock.PutModelInvocationLoggingConfigurationOutput, error) - PutModelInvocationLoggingConfigurationWithContext(aws.Context, *bedrock.PutModelInvocationLoggingConfigurationInput, ...request.Option) (*bedrock.PutModelInvocationLoggingConfigurationOutput, error) - PutModelInvocationLoggingConfigurationRequest(*bedrock.PutModelInvocationLoggingConfigurationInput) (*request.Request, *bedrock.PutModelInvocationLoggingConfigurationOutput) - - StopModelCustomizationJob(*bedrock.StopModelCustomizationJobInput) (*bedrock.StopModelCustomizationJobOutput, error) - StopModelCustomizationJobWithContext(aws.Context, *bedrock.StopModelCustomizationJobInput, ...request.Option) (*bedrock.StopModelCustomizationJobOutput, error) - StopModelCustomizationJobRequest(*bedrock.StopModelCustomizationJobInput) (*request.Request, *bedrock.StopModelCustomizationJobOutput) - - TagResource(*bedrock.TagResourceInput) (*bedrock.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *bedrock.TagResourceInput, ...request.Option) (*bedrock.TagResourceOutput, error) - TagResourceRequest(*bedrock.TagResourceInput) (*request.Request, *bedrock.TagResourceOutput) - - UntagResource(*bedrock.UntagResourceInput) (*bedrock.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *bedrock.UntagResourceInput, ...request.Option) (*bedrock.UntagResourceOutput, error) - UntagResourceRequest(*bedrock.UntagResourceInput) (*request.Request, *bedrock.UntagResourceOutput) - - UpdateProvisionedModelThroughput(*bedrock.UpdateProvisionedModelThroughputInput) (*bedrock.UpdateProvisionedModelThroughputOutput, error) - UpdateProvisionedModelThroughputWithContext(aws.Context, *bedrock.UpdateProvisionedModelThroughputInput, ...request.Option) (*bedrock.UpdateProvisionedModelThroughputOutput, error) - UpdateProvisionedModelThroughputRequest(*bedrock.UpdateProvisionedModelThroughputInput) (*request.Request, *bedrock.UpdateProvisionedModelThroughputOutput) -} - -var _ BedrockAPI = (*bedrock.Bedrock)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/doc.go deleted file mode 100644 index af238a77d944..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bedrock provides the client and types for making API -// requests to Amazon Bedrock. -// -// Describes the API operations for creating and managing Amazon Bedrock models. -// -// See https://docs.aws.amazon.com/goto/WebAPI/bedrock-2023-04-20 for more information on this service. -// -// See bedrock package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bedrock/ -// -// # Using the Client -// -// To contact Amazon Bedrock with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Bedrock client Bedrock for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bedrock/#New -package bedrock diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/errors.go deleted file mode 100644 index ff14f40ab23c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/errors.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrock - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // The request is denied because of missing access permissions. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Error occurred because of a conflict while performing an operation. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An internal server error occurred. Retry your request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource ARN was not found. Check the ARN and try your request - // again. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The number of requests exceeds the service quota. Resubmit your request later. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The number of requests exceeds the limit. Resubmit your request later. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTagsException". - // - // The request contains more tags than can be associated with a resource (50 - // tags per resource). The maximum number of tags includes both existing tags - // and those included in your current request. - ErrCodeTooManyTagsException = "TooManyTagsException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Input validation failed. Check your request parameters and retry the request. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "TooManyTagsException": newErrorTooManyTagsException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/service.go deleted file mode 100644 index 88de77f090a3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrock/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrock - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// Bedrock provides the API operation methods for making requests to -// Amazon Bedrock. See this package's package overview docs -// for details on the service. -// -// Bedrock methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type Bedrock struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Bedrock" // Name of service. - EndpointsID = "bedrock" // ID to lookup a service endpoint with. - ServiceID = "Bedrock" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the Bedrock client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a Bedrock client from just a session. -// svc := bedrock.New(mySession) -// -// // Create a Bedrock client with additional configuration -// svc := bedrock.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Bedrock { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "bedrock" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *Bedrock { - svc := &Bedrock{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-04-20", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Bedrock operation and runs any -// custom request initialization. -func (c *Bedrock) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/api.go deleted file mode 100644 index 318af22faead..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/api.go +++ /dev/null @@ -1,13786 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockagent - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opAssociateAgentKnowledgeBase = "AssociateAgentKnowledgeBase" - -// AssociateAgentKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the AssociateAgentKnowledgeBase 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 AssociateAgentKnowledgeBase for more information on using the AssociateAgentKnowledgeBase -// 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 AssociateAgentKnowledgeBaseRequest method. -// req, resp := client.AssociateAgentKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/AssociateAgentKnowledgeBase -func (c *BedrockAgent) AssociateAgentKnowledgeBaseRequest(input *AssociateAgentKnowledgeBaseInput) (req *request.Request, output *AssociateAgentKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opAssociateAgentKnowledgeBase, - HTTPMethod: "PUT", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/", - } - - if input == nil { - input = &AssociateAgentKnowledgeBaseInput{} - } - - output = &AssociateAgentKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateAgentKnowledgeBase API operation for Agents for Amazon Bedrock. -// -// # Associate a Knowledge Base to an existing Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation AssociateAgentKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/AssociateAgentKnowledgeBase -func (c *BedrockAgent) AssociateAgentKnowledgeBase(input *AssociateAgentKnowledgeBaseInput) (*AssociateAgentKnowledgeBaseOutput, error) { - req, out := c.AssociateAgentKnowledgeBaseRequest(input) - return out, req.Send() -} - -// AssociateAgentKnowledgeBaseWithContext is the same as AssociateAgentKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateAgentKnowledgeBase 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 *BedrockAgent) AssociateAgentKnowledgeBaseWithContext(ctx aws.Context, input *AssociateAgentKnowledgeBaseInput, opts ...request.Option) (*AssociateAgentKnowledgeBaseOutput, error) { - req, out := c.AssociateAgentKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAgent = "CreateAgent" - -// CreateAgentRequest generates a "aws/request.Request" representing the -// client's request for the CreateAgent 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 CreateAgent for more information on using the CreateAgent -// 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 CreateAgentRequest method. -// req, resp := client.CreateAgentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateAgent -func (c *BedrockAgent) CreateAgentRequest(input *CreateAgentInput) (req *request.Request, output *CreateAgentOutput) { - op := &request.Operation{ - Name: opCreateAgent, - HTTPMethod: "PUT", - HTTPPath: "/agents/", - } - - if input == nil { - input = &CreateAgentInput{} - } - - output = &CreateAgentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAgent API operation for Agents for Amazon Bedrock. -// -// # Creates an Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation CreateAgent for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateAgent -func (c *BedrockAgent) CreateAgent(input *CreateAgentInput) (*CreateAgentOutput, error) { - req, out := c.CreateAgentRequest(input) - return out, req.Send() -} - -// CreateAgentWithContext is the same as CreateAgent with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAgent 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 *BedrockAgent) CreateAgentWithContext(ctx aws.Context, input *CreateAgentInput, opts ...request.Option) (*CreateAgentOutput, error) { - req, out := c.CreateAgentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAgentActionGroup = "CreateAgentActionGroup" - -// CreateAgentActionGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateAgentActionGroup 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 CreateAgentActionGroup for more information on using the CreateAgentActionGroup -// 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 CreateAgentActionGroupRequest method. -// req, resp := client.CreateAgentActionGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateAgentActionGroup -func (c *BedrockAgent) CreateAgentActionGroupRequest(input *CreateAgentActionGroupInput) (req *request.Request, output *CreateAgentActionGroupOutput) { - op := &request.Operation{ - Name: opCreateAgentActionGroup, - HTTPMethod: "PUT", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/", - } - - if input == nil { - input = &CreateAgentActionGroupInput{} - } - - output = &CreateAgentActionGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAgentActionGroup API operation for Agents for Amazon Bedrock. -// -// # Creates an Action Group for existing Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation CreateAgentActionGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateAgentActionGroup -func (c *BedrockAgent) CreateAgentActionGroup(input *CreateAgentActionGroupInput) (*CreateAgentActionGroupOutput, error) { - req, out := c.CreateAgentActionGroupRequest(input) - return out, req.Send() -} - -// CreateAgentActionGroupWithContext is the same as CreateAgentActionGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAgentActionGroup 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 *BedrockAgent) CreateAgentActionGroupWithContext(ctx aws.Context, input *CreateAgentActionGroupInput, opts ...request.Option) (*CreateAgentActionGroupOutput, error) { - req, out := c.CreateAgentActionGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAgentAlias = "CreateAgentAlias" - -// CreateAgentAliasRequest generates a "aws/request.Request" representing the -// client's request for the CreateAgentAlias 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 CreateAgentAlias for more information on using the CreateAgentAlias -// 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 CreateAgentAliasRequest method. -// req, resp := client.CreateAgentAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateAgentAlias -func (c *BedrockAgent) CreateAgentAliasRequest(input *CreateAgentAliasInput) (req *request.Request, output *CreateAgentAliasOutput) { - op := &request.Operation{ - Name: opCreateAgentAlias, - HTTPMethod: "PUT", - HTTPPath: "/agents/{agentId}/agentaliases/", - } - - if input == nil { - input = &CreateAgentAliasInput{} - } - - output = &CreateAgentAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAgentAlias API operation for Agents for Amazon Bedrock. -// -// # Creates an Alias for an existing Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation CreateAgentAlias for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateAgentAlias -func (c *BedrockAgent) CreateAgentAlias(input *CreateAgentAliasInput) (*CreateAgentAliasOutput, error) { - req, out := c.CreateAgentAliasRequest(input) - return out, req.Send() -} - -// CreateAgentAliasWithContext is the same as CreateAgentAlias with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAgentAlias 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 *BedrockAgent) CreateAgentAliasWithContext(ctx aws.Context, input *CreateAgentAliasInput, opts ...request.Option) (*CreateAgentAliasOutput, error) { - req, out := c.CreateAgentAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDataSource = "CreateDataSource" - -// CreateDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the CreateDataSource 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 CreateDataSource for more information on using the CreateDataSource -// 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 CreateDataSourceRequest method. -// req, resp := client.CreateDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateDataSource -func (c *BedrockAgent) CreateDataSourceRequest(input *CreateDataSourceInput) (req *request.Request, output *CreateDataSourceOutput) { - op := &request.Operation{ - Name: opCreateDataSource, - HTTPMethod: "PUT", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/datasources/", - } - - if input == nil { - input = &CreateDataSourceInput{} - } - - output = &CreateDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDataSource API operation for Agents for Amazon Bedrock. -// -// # Create a new data source -// -// 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 Agents for Amazon Bedrock's -// API operation CreateDataSource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateDataSource -func (c *BedrockAgent) CreateDataSource(input *CreateDataSourceInput) (*CreateDataSourceOutput, error) { - req, out := c.CreateDataSourceRequest(input) - return out, req.Send() -} - -// CreateDataSourceWithContext is the same as CreateDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDataSource 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 *BedrockAgent) CreateDataSourceWithContext(ctx aws.Context, input *CreateDataSourceInput, opts ...request.Option) (*CreateDataSourceOutput, error) { - req, out := c.CreateDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateKnowledgeBase = "CreateKnowledgeBase" - -// CreateKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the CreateKnowledgeBase 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 CreateKnowledgeBase for more information on using the CreateKnowledgeBase -// 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 CreateKnowledgeBaseRequest method. -// req, resp := client.CreateKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateKnowledgeBase -func (c *BedrockAgent) CreateKnowledgeBaseRequest(input *CreateKnowledgeBaseInput) (req *request.Request, output *CreateKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opCreateKnowledgeBase, - HTTPMethod: "PUT", - HTTPPath: "/knowledgebases/", - } - - if input == nil { - input = &CreateKnowledgeBaseInput{} - } - - output = &CreateKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateKnowledgeBase API operation for Agents for Amazon Bedrock. -// -// # Create a new knowledge base -// -// 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 Agents for Amazon Bedrock's -// API operation CreateKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/CreateKnowledgeBase -func (c *BedrockAgent) CreateKnowledgeBase(input *CreateKnowledgeBaseInput) (*CreateKnowledgeBaseOutput, error) { - req, out := c.CreateKnowledgeBaseRequest(input) - return out, req.Send() -} - -// CreateKnowledgeBaseWithContext is the same as CreateKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See CreateKnowledgeBase 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 *BedrockAgent) CreateKnowledgeBaseWithContext(ctx aws.Context, input *CreateKnowledgeBaseInput, opts ...request.Option) (*CreateKnowledgeBaseOutput, error) { - req, out := c.CreateKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAgent = "DeleteAgent" - -// DeleteAgentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAgent 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 DeleteAgent for more information on using the DeleteAgent -// 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 DeleteAgentRequest method. -// req, resp := client.DeleteAgentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteAgent -func (c *BedrockAgent) DeleteAgentRequest(input *DeleteAgentInput) (req *request.Request, output *DeleteAgentOutput) { - op := &request.Operation{ - Name: opDeleteAgent, - HTTPMethod: "DELETE", - HTTPPath: "/agents/{agentId}/", - } - - if input == nil { - input = &DeleteAgentInput{} - } - - output = &DeleteAgentOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteAgent API operation for Agents for Amazon Bedrock. -// -// # Deletes an Agent for existing Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation DeleteAgent for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteAgent -func (c *BedrockAgent) DeleteAgent(input *DeleteAgentInput) (*DeleteAgentOutput, error) { - req, out := c.DeleteAgentRequest(input) - return out, req.Send() -} - -// DeleteAgentWithContext is the same as DeleteAgent with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAgent 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 *BedrockAgent) DeleteAgentWithContext(ctx aws.Context, input *DeleteAgentInput, opts ...request.Option) (*DeleteAgentOutput, error) { - req, out := c.DeleteAgentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAgentActionGroup = "DeleteAgentActionGroup" - -// DeleteAgentActionGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAgentActionGroup 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 DeleteAgentActionGroup for more information on using the DeleteAgentActionGroup -// 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 DeleteAgentActionGroupRequest method. -// req, resp := client.DeleteAgentActionGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteAgentActionGroup -func (c *BedrockAgent) DeleteAgentActionGroupRequest(input *DeleteAgentActionGroupInput) (req *request.Request, output *DeleteAgentActionGroupOutput) { - op := &request.Operation{ - Name: opDeleteAgentActionGroup, - HTTPMethod: "DELETE", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", - } - - if input == nil { - input = &DeleteAgentActionGroupInput{} - } - - output = &DeleteAgentActionGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAgentActionGroup API operation for Agents for Amazon Bedrock. -// -// Deletes an Action Group for existing Amazon Bedrock Agent. -// -// 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 Agents for Amazon Bedrock's -// API operation DeleteAgentActionGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteAgentActionGroup -func (c *BedrockAgent) DeleteAgentActionGroup(input *DeleteAgentActionGroupInput) (*DeleteAgentActionGroupOutput, error) { - req, out := c.DeleteAgentActionGroupRequest(input) - return out, req.Send() -} - -// DeleteAgentActionGroupWithContext is the same as DeleteAgentActionGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAgentActionGroup 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 *BedrockAgent) DeleteAgentActionGroupWithContext(ctx aws.Context, input *DeleteAgentActionGroupInput, opts ...request.Option) (*DeleteAgentActionGroupOutput, error) { - req, out := c.DeleteAgentActionGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAgentAlias = "DeleteAgentAlias" - -// DeleteAgentAliasRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAgentAlias 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 DeleteAgentAlias for more information on using the DeleteAgentAlias -// 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 DeleteAgentAliasRequest method. -// req, resp := client.DeleteAgentAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteAgentAlias -func (c *BedrockAgent) DeleteAgentAliasRequest(input *DeleteAgentAliasInput) (req *request.Request, output *DeleteAgentAliasOutput) { - op := &request.Operation{ - Name: opDeleteAgentAlias, - HTTPMethod: "DELETE", - HTTPPath: "/agents/{agentId}/agentaliases/{agentAliasId}/", - } - - if input == nil { - input = &DeleteAgentAliasInput{} - } - - output = &DeleteAgentAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteAgentAlias API operation for Agents for Amazon Bedrock. -// -// # Deletes an Alias for a Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation DeleteAgentAlias for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteAgentAlias -func (c *BedrockAgent) DeleteAgentAlias(input *DeleteAgentAliasInput) (*DeleteAgentAliasOutput, error) { - req, out := c.DeleteAgentAliasRequest(input) - return out, req.Send() -} - -// DeleteAgentAliasWithContext is the same as DeleteAgentAlias with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAgentAlias 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 *BedrockAgent) DeleteAgentAliasWithContext(ctx aws.Context, input *DeleteAgentAliasInput, opts ...request.Option) (*DeleteAgentAliasOutput, error) { - req, out := c.DeleteAgentAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAgentVersion = "DeleteAgentVersion" - -// DeleteAgentVersionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAgentVersion 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 DeleteAgentVersion for more information on using the DeleteAgentVersion -// 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 DeleteAgentVersionRequest method. -// req, resp := client.DeleteAgentVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteAgentVersion -func (c *BedrockAgent) DeleteAgentVersionRequest(input *DeleteAgentVersionInput) (req *request.Request, output *DeleteAgentVersionOutput) { - op := &request.Operation{ - Name: opDeleteAgentVersion, - HTTPMethod: "DELETE", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/", - } - - if input == nil { - input = &DeleteAgentVersionInput{} - } - - output = &DeleteAgentVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteAgentVersion API operation for Agents for Amazon Bedrock. -// -// # Deletes an Agent version for existing Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation DeleteAgentVersion for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteAgentVersion -func (c *BedrockAgent) DeleteAgentVersion(input *DeleteAgentVersionInput) (*DeleteAgentVersionOutput, error) { - req, out := c.DeleteAgentVersionRequest(input) - return out, req.Send() -} - -// DeleteAgentVersionWithContext is the same as DeleteAgentVersion with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAgentVersion 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 *BedrockAgent) DeleteAgentVersionWithContext(ctx aws.Context, input *DeleteAgentVersionInput, opts ...request.Option) (*DeleteAgentVersionOutput, error) { - req, out := c.DeleteAgentVersionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDataSource = "DeleteDataSource" - -// DeleteDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDataSource 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 DeleteDataSource for more information on using the DeleteDataSource -// 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 DeleteDataSourceRequest method. -// req, resp := client.DeleteDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteDataSource -func (c *BedrockAgent) DeleteDataSourceRequest(input *DeleteDataSourceInput) (req *request.Request, output *DeleteDataSourceOutput) { - op := &request.Operation{ - Name: opDeleteDataSource, - HTTPMethod: "DELETE", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", - } - - if input == nil { - input = &DeleteDataSourceInput{} - } - - output = &DeleteDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDataSource API operation for Agents for Amazon Bedrock. -// -// # Delete an existing data source -// -// 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 Agents for Amazon Bedrock's -// API operation DeleteDataSource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteDataSource -func (c *BedrockAgent) DeleteDataSource(input *DeleteDataSourceInput) (*DeleteDataSourceOutput, error) { - req, out := c.DeleteDataSourceRequest(input) - return out, req.Send() -} - -// DeleteDataSourceWithContext is the same as DeleteDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDataSource 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 *BedrockAgent) DeleteDataSourceWithContext(ctx aws.Context, input *DeleteDataSourceInput, opts ...request.Option) (*DeleteDataSourceOutput, error) { - req, out := c.DeleteDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteKnowledgeBase = "DeleteKnowledgeBase" - -// DeleteKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the DeleteKnowledgeBase 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 DeleteKnowledgeBase for more information on using the DeleteKnowledgeBase -// 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 DeleteKnowledgeBaseRequest method. -// req, resp := client.DeleteKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteKnowledgeBase -func (c *BedrockAgent) DeleteKnowledgeBaseRequest(input *DeleteKnowledgeBaseInput) (req *request.Request, output *DeleteKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opDeleteKnowledgeBase, - HTTPMethod: "DELETE", - HTTPPath: "/knowledgebases/{knowledgeBaseId}", - } - - if input == nil { - input = &DeleteKnowledgeBaseInput{} - } - - output = &DeleteKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteKnowledgeBase API operation for Agents for Amazon Bedrock. -// -// # Delete an existing knowledge base -// -// 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 Agents for Amazon Bedrock's -// API operation DeleteKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DeleteKnowledgeBase -func (c *BedrockAgent) DeleteKnowledgeBase(input *DeleteKnowledgeBaseInput) (*DeleteKnowledgeBaseOutput, error) { - req, out := c.DeleteKnowledgeBaseRequest(input) - return out, req.Send() -} - -// DeleteKnowledgeBaseWithContext is the same as DeleteKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteKnowledgeBase 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 *BedrockAgent) DeleteKnowledgeBaseWithContext(ctx aws.Context, input *DeleteKnowledgeBaseInput, opts ...request.Option) (*DeleteKnowledgeBaseOutput, error) { - req, out := c.DeleteKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateAgentKnowledgeBase = "DisassociateAgentKnowledgeBase" - -// DisassociateAgentKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateAgentKnowledgeBase 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 DisassociateAgentKnowledgeBase for more information on using the DisassociateAgentKnowledgeBase -// 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 DisassociateAgentKnowledgeBaseRequest method. -// req, resp := client.DisassociateAgentKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DisassociateAgentKnowledgeBase -func (c *BedrockAgent) DisassociateAgentKnowledgeBaseRequest(input *DisassociateAgentKnowledgeBaseInput) (req *request.Request, output *DisassociateAgentKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opDisassociateAgentKnowledgeBase, - HTTPMethod: "DELETE", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", - } - - if input == nil { - input = &DisassociateAgentKnowledgeBaseInput{} - } - - output = &DisassociateAgentKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateAgentKnowledgeBase API operation for Agents for Amazon Bedrock. -// -// # Disassociate an existing Knowledge Base from an Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation DisassociateAgentKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/DisassociateAgentKnowledgeBase -func (c *BedrockAgent) DisassociateAgentKnowledgeBase(input *DisassociateAgentKnowledgeBaseInput) (*DisassociateAgentKnowledgeBaseOutput, error) { - req, out := c.DisassociateAgentKnowledgeBaseRequest(input) - return out, req.Send() -} - -// DisassociateAgentKnowledgeBaseWithContext is the same as DisassociateAgentKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateAgentKnowledgeBase 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 *BedrockAgent) DisassociateAgentKnowledgeBaseWithContext(ctx aws.Context, input *DisassociateAgentKnowledgeBaseInput, opts ...request.Option) (*DisassociateAgentKnowledgeBaseOutput, error) { - req, out := c.DisassociateAgentKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAgent = "GetAgent" - -// GetAgentRequest generates a "aws/request.Request" representing the -// client's request for the GetAgent 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 GetAgent for more information on using the GetAgent -// 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 GetAgentRequest method. -// req, resp := client.GetAgentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgent -func (c *BedrockAgent) GetAgentRequest(input *GetAgentInput) (req *request.Request, output *GetAgentOutput) { - op := &request.Operation{ - Name: opGetAgent, - HTTPMethod: "GET", - HTTPPath: "/agents/{agentId}/", - } - - if input == nil { - input = &GetAgentInput{} - } - - output = &GetAgentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAgent API operation for Agents for Amazon Bedrock. -// -// # Gets an Agent for existing Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation GetAgent for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgent -func (c *BedrockAgent) GetAgent(input *GetAgentInput) (*GetAgentOutput, error) { - req, out := c.GetAgentRequest(input) - return out, req.Send() -} - -// GetAgentWithContext is the same as GetAgent with the addition of -// the ability to pass a context and additional request options. -// -// See GetAgent 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 *BedrockAgent) GetAgentWithContext(ctx aws.Context, input *GetAgentInput, opts ...request.Option) (*GetAgentOutput, error) { - req, out := c.GetAgentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAgentActionGroup = "GetAgentActionGroup" - -// GetAgentActionGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetAgentActionGroup 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 GetAgentActionGroup for more information on using the GetAgentActionGroup -// 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 GetAgentActionGroupRequest method. -// req, resp := client.GetAgentActionGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgentActionGroup -func (c *BedrockAgent) GetAgentActionGroupRequest(input *GetAgentActionGroupInput) (req *request.Request, output *GetAgentActionGroupOutput) { - op := &request.Operation{ - Name: opGetAgentActionGroup, - HTTPMethod: "GET", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", - } - - if input == nil { - input = &GetAgentActionGroupInput{} - } - - output = &GetAgentActionGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAgentActionGroup API operation for Agents for Amazon Bedrock. -// -// # Gets an Action Group for existing Amazon Bedrock Agent Version -// -// 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 Agents for Amazon Bedrock's -// API operation GetAgentActionGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgentActionGroup -func (c *BedrockAgent) GetAgentActionGroup(input *GetAgentActionGroupInput) (*GetAgentActionGroupOutput, error) { - req, out := c.GetAgentActionGroupRequest(input) - return out, req.Send() -} - -// GetAgentActionGroupWithContext is the same as GetAgentActionGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetAgentActionGroup 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 *BedrockAgent) GetAgentActionGroupWithContext(ctx aws.Context, input *GetAgentActionGroupInput, opts ...request.Option) (*GetAgentActionGroupOutput, error) { - req, out := c.GetAgentActionGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAgentAlias = "GetAgentAlias" - -// GetAgentAliasRequest generates a "aws/request.Request" representing the -// client's request for the GetAgentAlias 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 GetAgentAlias for more information on using the GetAgentAlias -// 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 GetAgentAliasRequest method. -// req, resp := client.GetAgentAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgentAlias -func (c *BedrockAgent) GetAgentAliasRequest(input *GetAgentAliasInput) (req *request.Request, output *GetAgentAliasOutput) { - op := &request.Operation{ - Name: opGetAgentAlias, - HTTPMethod: "GET", - HTTPPath: "/agents/{agentId}/agentaliases/{agentAliasId}/", - } - - if input == nil { - input = &GetAgentAliasInput{} - } - - output = &GetAgentAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAgentAlias API operation for Agents for Amazon Bedrock. -// -// # Describes an Alias for a Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation GetAgentAlias for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgentAlias -func (c *BedrockAgent) GetAgentAlias(input *GetAgentAliasInput) (*GetAgentAliasOutput, error) { - req, out := c.GetAgentAliasRequest(input) - return out, req.Send() -} - -// GetAgentAliasWithContext is the same as GetAgentAlias with the addition of -// the ability to pass a context and additional request options. -// -// See GetAgentAlias 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 *BedrockAgent) GetAgentAliasWithContext(ctx aws.Context, input *GetAgentAliasInput, opts ...request.Option) (*GetAgentAliasOutput, error) { - req, out := c.GetAgentAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAgentKnowledgeBase = "GetAgentKnowledgeBase" - -// GetAgentKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the GetAgentKnowledgeBase 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 GetAgentKnowledgeBase for more information on using the GetAgentKnowledgeBase -// 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 GetAgentKnowledgeBaseRequest method. -// req, resp := client.GetAgentKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgentKnowledgeBase -func (c *BedrockAgent) GetAgentKnowledgeBaseRequest(input *GetAgentKnowledgeBaseInput) (req *request.Request, output *GetAgentKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opGetAgentKnowledgeBase, - HTTPMethod: "GET", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", - } - - if input == nil { - input = &GetAgentKnowledgeBaseInput{} - } - - output = &GetAgentKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAgentKnowledgeBase API operation for Agents for Amazon Bedrock. -// -// # Gets a knowledge base associated to an existing Amazon Bedrock Agent Version -// -// 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 Agents for Amazon Bedrock's -// API operation GetAgentKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgentKnowledgeBase -func (c *BedrockAgent) GetAgentKnowledgeBase(input *GetAgentKnowledgeBaseInput) (*GetAgentKnowledgeBaseOutput, error) { - req, out := c.GetAgentKnowledgeBaseRequest(input) - return out, req.Send() -} - -// GetAgentKnowledgeBaseWithContext is the same as GetAgentKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See GetAgentKnowledgeBase 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 *BedrockAgent) GetAgentKnowledgeBaseWithContext(ctx aws.Context, input *GetAgentKnowledgeBaseInput, opts ...request.Option) (*GetAgentKnowledgeBaseOutput, error) { - req, out := c.GetAgentKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAgentVersion = "GetAgentVersion" - -// GetAgentVersionRequest generates a "aws/request.Request" representing the -// client's request for the GetAgentVersion 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 GetAgentVersion for more information on using the GetAgentVersion -// 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 GetAgentVersionRequest method. -// req, resp := client.GetAgentVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgentVersion -func (c *BedrockAgent) GetAgentVersionRequest(input *GetAgentVersionInput) (req *request.Request, output *GetAgentVersionOutput) { - op := &request.Operation{ - Name: opGetAgentVersion, - HTTPMethod: "GET", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/", - } - - if input == nil { - input = &GetAgentVersionInput{} - } - - output = &GetAgentVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAgentVersion API operation for Agents for Amazon Bedrock. -// -// # Gets an Agent version for existing Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation GetAgentVersion for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetAgentVersion -func (c *BedrockAgent) GetAgentVersion(input *GetAgentVersionInput) (*GetAgentVersionOutput, error) { - req, out := c.GetAgentVersionRequest(input) - return out, req.Send() -} - -// GetAgentVersionWithContext is the same as GetAgentVersion with the addition of -// the ability to pass a context and additional request options. -// -// See GetAgentVersion 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 *BedrockAgent) GetAgentVersionWithContext(ctx aws.Context, input *GetAgentVersionInput, opts ...request.Option) (*GetAgentVersionOutput, error) { - req, out := c.GetAgentVersionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDataSource = "GetDataSource" - -// GetDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the GetDataSource 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 GetDataSource for more information on using the GetDataSource -// 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 GetDataSourceRequest method. -// req, resp := client.GetDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetDataSource -func (c *BedrockAgent) GetDataSourceRequest(input *GetDataSourceInput) (req *request.Request, output *GetDataSourceOutput) { - op := &request.Operation{ - Name: opGetDataSource, - HTTPMethod: "GET", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", - } - - if input == nil { - input = &GetDataSourceInput{} - } - - output = &GetDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataSource API operation for Agents for Amazon Bedrock. -// -// # Get an existing data source -// -// 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 Agents for Amazon Bedrock's -// API operation GetDataSource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetDataSource -func (c *BedrockAgent) GetDataSource(input *GetDataSourceInput) (*GetDataSourceOutput, error) { - req, out := c.GetDataSourceRequest(input) - return out, req.Send() -} - -// GetDataSourceWithContext is the same as GetDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataSource 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 *BedrockAgent) GetDataSourceWithContext(ctx aws.Context, input *GetDataSourceInput, opts ...request.Option) (*GetDataSourceOutput, error) { - req, out := c.GetDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIngestionJob = "GetIngestionJob" - -// GetIngestionJobRequest generates a "aws/request.Request" representing the -// client's request for the GetIngestionJob 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 GetIngestionJob for more information on using the GetIngestionJob -// 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 GetIngestionJobRequest method. -// req, resp := client.GetIngestionJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetIngestionJob -func (c *BedrockAgent) GetIngestionJobRequest(input *GetIngestionJobInput) (req *request.Request, output *GetIngestionJobOutput) { - op := &request.Operation{ - Name: opGetIngestionJob, - HTTPMethod: "GET", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}", - } - - if input == nil { - input = &GetIngestionJobInput{} - } - - output = &GetIngestionJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIngestionJob API operation for Agents for Amazon Bedrock. -// -// # Get an ingestion job -// -// 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 Agents for Amazon Bedrock's -// API operation GetIngestionJob for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetIngestionJob -func (c *BedrockAgent) GetIngestionJob(input *GetIngestionJobInput) (*GetIngestionJobOutput, error) { - req, out := c.GetIngestionJobRequest(input) - return out, req.Send() -} - -// GetIngestionJobWithContext is the same as GetIngestionJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetIngestionJob 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 *BedrockAgent) GetIngestionJobWithContext(ctx aws.Context, input *GetIngestionJobInput, opts ...request.Option) (*GetIngestionJobOutput, error) { - req, out := c.GetIngestionJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetKnowledgeBase = "GetKnowledgeBase" - -// GetKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the GetKnowledgeBase 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 GetKnowledgeBase for more information on using the GetKnowledgeBase -// 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 GetKnowledgeBaseRequest method. -// req, resp := client.GetKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetKnowledgeBase -func (c *BedrockAgent) GetKnowledgeBaseRequest(input *GetKnowledgeBaseInput) (req *request.Request, output *GetKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opGetKnowledgeBase, - HTTPMethod: "GET", - HTTPPath: "/knowledgebases/{knowledgeBaseId}", - } - - if input == nil { - input = &GetKnowledgeBaseInput{} - } - - output = &GetKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetKnowledgeBase API operation for Agents for Amazon Bedrock. -// -// # Get an existing knowledge base -// -// 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 Agents for Amazon Bedrock's -// API operation GetKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/GetKnowledgeBase -func (c *BedrockAgent) GetKnowledgeBase(input *GetKnowledgeBaseInput) (*GetKnowledgeBaseOutput, error) { - req, out := c.GetKnowledgeBaseRequest(input) - return out, req.Send() -} - -// GetKnowledgeBaseWithContext is the same as GetKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See GetKnowledgeBase 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 *BedrockAgent) GetKnowledgeBaseWithContext(ctx aws.Context, input *GetKnowledgeBaseInput, opts ...request.Option) (*GetKnowledgeBaseOutput, error) { - req, out := c.GetKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAgentActionGroups = "ListAgentActionGroups" - -// ListAgentActionGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListAgentActionGroups 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 ListAgentActionGroups for more information on using the ListAgentActionGroups -// 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 ListAgentActionGroupsRequest method. -// req, resp := client.ListAgentActionGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgentActionGroups -func (c *BedrockAgent) ListAgentActionGroupsRequest(input *ListAgentActionGroupsInput) (req *request.Request, output *ListAgentActionGroupsOutput) { - op := &request.Operation{ - Name: opListAgentActionGroups, - HTTPMethod: "POST", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAgentActionGroupsInput{} - } - - output = &ListAgentActionGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAgentActionGroups API operation for Agents for Amazon Bedrock. -// -// # Lists an Action Group for existing Amazon Bedrock Agent Version -// -// 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 Agents for Amazon Bedrock's -// API operation ListAgentActionGroups for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgentActionGroups -func (c *BedrockAgent) ListAgentActionGroups(input *ListAgentActionGroupsInput) (*ListAgentActionGroupsOutput, error) { - req, out := c.ListAgentActionGroupsRequest(input) - return out, req.Send() -} - -// ListAgentActionGroupsWithContext is the same as ListAgentActionGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListAgentActionGroups 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 *BedrockAgent) ListAgentActionGroupsWithContext(ctx aws.Context, input *ListAgentActionGroupsInput, opts ...request.Option) (*ListAgentActionGroupsOutput, error) { - req, out := c.ListAgentActionGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAgentActionGroupsPages iterates over the pages of a ListAgentActionGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAgentActionGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAgentActionGroups operation. -// pageNum := 0 -// err := client.ListAgentActionGroupsPages(params, -// func(page *bedrockagent.ListAgentActionGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgent) ListAgentActionGroupsPages(input *ListAgentActionGroupsInput, fn func(*ListAgentActionGroupsOutput, bool) bool) error { - return c.ListAgentActionGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAgentActionGroupsPagesWithContext same as ListAgentActionGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgent) ListAgentActionGroupsPagesWithContext(ctx aws.Context, input *ListAgentActionGroupsInput, fn func(*ListAgentActionGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAgentActionGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAgentActionGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAgentActionGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAgentAliases = "ListAgentAliases" - -// ListAgentAliasesRequest generates a "aws/request.Request" representing the -// client's request for the ListAgentAliases 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 ListAgentAliases for more information on using the ListAgentAliases -// 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 ListAgentAliasesRequest method. -// req, resp := client.ListAgentAliasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgentAliases -func (c *BedrockAgent) ListAgentAliasesRequest(input *ListAgentAliasesInput) (req *request.Request, output *ListAgentAliasesOutput) { - op := &request.Operation{ - Name: opListAgentAliases, - HTTPMethod: "POST", - HTTPPath: "/agents/{agentId}/agentaliases/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAgentAliasesInput{} - } - - output = &ListAgentAliasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAgentAliases API operation for Agents for Amazon Bedrock. -// -// # Lists all the Aliases for an Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation ListAgentAliases for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgentAliases -func (c *BedrockAgent) ListAgentAliases(input *ListAgentAliasesInput) (*ListAgentAliasesOutput, error) { - req, out := c.ListAgentAliasesRequest(input) - return out, req.Send() -} - -// ListAgentAliasesWithContext is the same as ListAgentAliases with the addition of -// the ability to pass a context and additional request options. -// -// See ListAgentAliases 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 *BedrockAgent) ListAgentAliasesWithContext(ctx aws.Context, input *ListAgentAliasesInput, opts ...request.Option) (*ListAgentAliasesOutput, error) { - req, out := c.ListAgentAliasesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAgentAliasesPages iterates over the pages of a ListAgentAliases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAgentAliases method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAgentAliases operation. -// pageNum := 0 -// err := client.ListAgentAliasesPages(params, -// func(page *bedrockagent.ListAgentAliasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgent) ListAgentAliasesPages(input *ListAgentAliasesInput, fn func(*ListAgentAliasesOutput, bool) bool) error { - return c.ListAgentAliasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAgentAliasesPagesWithContext same as ListAgentAliasesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgent) ListAgentAliasesPagesWithContext(ctx aws.Context, input *ListAgentAliasesInput, fn func(*ListAgentAliasesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAgentAliasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAgentAliasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAgentAliasesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAgentKnowledgeBases = "ListAgentKnowledgeBases" - -// ListAgentKnowledgeBasesRequest generates a "aws/request.Request" representing the -// client's request for the ListAgentKnowledgeBases 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 ListAgentKnowledgeBases for more information on using the ListAgentKnowledgeBases -// 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 ListAgentKnowledgeBasesRequest method. -// req, resp := client.ListAgentKnowledgeBasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgentKnowledgeBases -func (c *BedrockAgent) ListAgentKnowledgeBasesRequest(input *ListAgentKnowledgeBasesInput) (req *request.Request, output *ListAgentKnowledgeBasesOutput) { - op := &request.Operation{ - Name: opListAgentKnowledgeBases, - HTTPMethod: "POST", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAgentKnowledgeBasesInput{} - } - - output = &ListAgentKnowledgeBasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAgentKnowledgeBases API operation for Agents for Amazon Bedrock. -// -// # List of Knowledge Bases associated to an existing Amazon Bedrock Agent Version -// -// 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 Agents for Amazon Bedrock's -// API operation ListAgentKnowledgeBases for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgentKnowledgeBases -func (c *BedrockAgent) ListAgentKnowledgeBases(input *ListAgentKnowledgeBasesInput) (*ListAgentKnowledgeBasesOutput, error) { - req, out := c.ListAgentKnowledgeBasesRequest(input) - return out, req.Send() -} - -// ListAgentKnowledgeBasesWithContext is the same as ListAgentKnowledgeBases with the addition of -// the ability to pass a context and additional request options. -// -// See ListAgentKnowledgeBases 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 *BedrockAgent) ListAgentKnowledgeBasesWithContext(ctx aws.Context, input *ListAgentKnowledgeBasesInput, opts ...request.Option) (*ListAgentKnowledgeBasesOutput, error) { - req, out := c.ListAgentKnowledgeBasesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAgentKnowledgeBasesPages iterates over the pages of a ListAgentKnowledgeBases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAgentKnowledgeBases method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAgentKnowledgeBases operation. -// pageNum := 0 -// err := client.ListAgentKnowledgeBasesPages(params, -// func(page *bedrockagent.ListAgentKnowledgeBasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgent) ListAgentKnowledgeBasesPages(input *ListAgentKnowledgeBasesInput, fn func(*ListAgentKnowledgeBasesOutput, bool) bool) error { - return c.ListAgentKnowledgeBasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAgentKnowledgeBasesPagesWithContext same as ListAgentKnowledgeBasesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgent) ListAgentKnowledgeBasesPagesWithContext(ctx aws.Context, input *ListAgentKnowledgeBasesInput, fn func(*ListAgentKnowledgeBasesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAgentKnowledgeBasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAgentKnowledgeBasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAgentKnowledgeBasesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAgentVersions = "ListAgentVersions" - -// ListAgentVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListAgentVersions 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 ListAgentVersions for more information on using the ListAgentVersions -// 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 ListAgentVersionsRequest method. -// req, resp := client.ListAgentVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgentVersions -func (c *BedrockAgent) ListAgentVersionsRequest(input *ListAgentVersionsInput) (req *request.Request, output *ListAgentVersionsOutput) { - op := &request.Operation{ - Name: opListAgentVersions, - HTTPMethod: "POST", - HTTPPath: "/agents/{agentId}/agentversions/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAgentVersionsInput{} - } - - output = &ListAgentVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAgentVersions API operation for Agents for Amazon Bedrock. -// -// # Lists Agent Versions -// -// 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 Agents for Amazon Bedrock's -// API operation ListAgentVersions for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgentVersions -func (c *BedrockAgent) ListAgentVersions(input *ListAgentVersionsInput) (*ListAgentVersionsOutput, error) { - req, out := c.ListAgentVersionsRequest(input) - return out, req.Send() -} - -// ListAgentVersionsWithContext is the same as ListAgentVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListAgentVersions 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 *BedrockAgent) ListAgentVersionsWithContext(ctx aws.Context, input *ListAgentVersionsInput, opts ...request.Option) (*ListAgentVersionsOutput, error) { - req, out := c.ListAgentVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAgentVersionsPages iterates over the pages of a ListAgentVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAgentVersions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAgentVersions operation. -// pageNum := 0 -// err := client.ListAgentVersionsPages(params, -// func(page *bedrockagent.ListAgentVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgent) ListAgentVersionsPages(input *ListAgentVersionsInput, fn func(*ListAgentVersionsOutput, bool) bool) error { - return c.ListAgentVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAgentVersionsPagesWithContext same as ListAgentVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgent) ListAgentVersionsPagesWithContext(ctx aws.Context, input *ListAgentVersionsInput, fn func(*ListAgentVersionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAgentVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAgentVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAgentVersionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAgents = "ListAgents" - -// ListAgentsRequest generates a "aws/request.Request" representing the -// client's request for the ListAgents 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 ListAgents for more information on using the ListAgents -// 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 ListAgentsRequest method. -// req, resp := client.ListAgentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgents -func (c *BedrockAgent) ListAgentsRequest(input *ListAgentsInput) (req *request.Request, output *ListAgentsOutput) { - op := &request.Operation{ - Name: opListAgents, - HTTPMethod: "POST", - HTTPPath: "/agents/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAgentsInput{} - } - - output = &ListAgentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAgents API operation for Agents for Amazon Bedrock. -// -// # Lists Agents -// -// 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 Agents for Amazon Bedrock's -// API operation ListAgents for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListAgents -func (c *BedrockAgent) ListAgents(input *ListAgentsInput) (*ListAgentsOutput, error) { - req, out := c.ListAgentsRequest(input) - return out, req.Send() -} - -// ListAgentsWithContext is the same as ListAgents with the addition of -// the ability to pass a context and additional request options. -// -// See ListAgents 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 *BedrockAgent) ListAgentsWithContext(ctx aws.Context, input *ListAgentsInput, opts ...request.Option) (*ListAgentsOutput, error) { - req, out := c.ListAgentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAgentsPages iterates over the pages of a ListAgents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAgents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAgents operation. -// pageNum := 0 -// err := client.ListAgentsPages(params, -// func(page *bedrockagent.ListAgentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgent) ListAgentsPages(input *ListAgentsInput, fn func(*ListAgentsOutput, bool) bool) error { - return c.ListAgentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAgentsPagesWithContext same as ListAgentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgent) ListAgentsPagesWithContext(ctx aws.Context, input *ListAgentsInput, fn func(*ListAgentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAgentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAgentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAgentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataSources = "ListDataSources" - -// ListDataSourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListDataSources 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 ListDataSources for more information on using the ListDataSources -// 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 ListDataSourcesRequest method. -// req, resp := client.ListDataSourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListDataSources -func (c *BedrockAgent) ListDataSourcesRequest(input *ListDataSourcesInput) (req *request.Request, output *ListDataSourcesOutput) { - op := &request.Operation{ - Name: opListDataSources, - HTTPMethod: "POST", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/datasources/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataSourcesInput{} - } - - output = &ListDataSourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataSources API operation for Agents for Amazon Bedrock. -// -// # List data sources -// -// 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 Agents for Amazon Bedrock's -// API operation ListDataSources for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListDataSources -func (c *BedrockAgent) ListDataSources(input *ListDataSourcesInput) (*ListDataSourcesOutput, error) { - req, out := c.ListDataSourcesRequest(input) - return out, req.Send() -} - -// ListDataSourcesWithContext is the same as ListDataSources with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataSources 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 *BedrockAgent) ListDataSourcesWithContext(ctx aws.Context, input *ListDataSourcesInput, opts ...request.Option) (*ListDataSourcesOutput, error) { - req, out := c.ListDataSourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataSourcesPages iterates over the pages of a ListDataSources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataSources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataSources operation. -// pageNum := 0 -// err := client.ListDataSourcesPages(params, -// func(page *bedrockagent.ListDataSourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgent) ListDataSourcesPages(input *ListDataSourcesInput, fn func(*ListDataSourcesOutput, bool) bool) error { - return c.ListDataSourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataSourcesPagesWithContext same as ListDataSourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgent) ListDataSourcesPagesWithContext(ctx aws.Context, input *ListDataSourcesInput, fn func(*ListDataSourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataSourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataSourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataSourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListIngestionJobs = "ListIngestionJobs" - -// ListIngestionJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListIngestionJobs 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 ListIngestionJobs for more information on using the ListIngestionJobs -// 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 ListIngestionJobsRequest method. -// req, resp := client.ListIngestionJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListIngestionJobs -func (c *BedrockAgent) ListIngestionJobsRequest(input *ListIngestionJobsInput) (req *request.Request, output *ListIngestionJobsOutput) { - op := &request.Operation{ - Name: opListIngestionJobs, - HTTPMethod: "POST", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIngestionJobsInput{} - } - - output = &ListIngestionJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIngestionJobs API operation for Agents for Amazon Bedrock. -// -// # List ingestion jobs -// -// 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 Agents for Amazon Bedrock's -// API operation ListIngestionJobs for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListIngestionJobs -func (c *BedrockAgent) ListIngestionJobs(input *ListIngestionJobsInput) (*ListIngestionJobsOutput, error) { - req, out := c.ListIngestionJobsRequest(input) - return out, req.Send() -} - -// ListIngestionJobsWithContext is the same as ListIngestionJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListIngestionJobs 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 *BedrockAgent) ListIngestionJobsWithContext(ctx aws.Context, input *ListIngestionJobsInput, opts ...request.Option) (*ListIngestionJobsOutput, error) { - req, out := c.ListIngestionJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIngestionJobsPages iterates over the pages of a ListIngestionJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIngestionJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIngestionJobs operation. -// pageNum := 0 -// err := client.ListIngestionJobsPages(params, -// func(page *bedrockagent.ListIngestionJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgent) ListIngestionJobsPages(input *ListIngestionJobsInput, fn func(*ListIngestionJobsOutput, bool) bool) error { - return c.ListIngestionJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIngestionJobsPagesWithContext same as ListIngestionJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgent) ListIngestionJobsPagesWithContext(ctx aws.Context, input *ListIngestionJobsInput, fn func(*ListIngestionJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIngestionJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIngestionJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIngestionJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListKnowledgeBases = "ListKnowledgeBases" - -// ListKnowledgeBasesRequest generates a "aws/request.Request" representing the -// client's request for the ListKnowledgeBases 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 ListKnowledgeBases for more information on using the ListKnowledgeBases -// 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 ListKnowledgeBasesRequest method. -// req, resp := client.ListKnowledgeBasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListKnowledgeBases -func (c *BedrockAgent) ListKnowledgeBasesRequest(input *ListKnowledgeBasesInput) (req *request.Request, output *ListKnowledgeBasesOutput) { - op := &request.Operation{ - Name: opListKnowledgeBases, - HTTPMethod: "POST", - HTTPPath: "/knowledgebases/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListKnowledgeBasesInput{} - } - - output = &ListKnowledgeBasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListKnowledgeBases API operation for Agents for Amazon Bedrock. -// -// # List Knowledge Bases -// -// 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 Agents for Amazon Bedrock's -// API operation ListKnowledgeBases for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListKnowledgeBases -func (c *BedrockAgent) ListKnowledgeBases(input *ListKnowledgeBasesInput) (*ListKnowledgeBasesOutput, error) { - req, out := c.ListKnowledgeBasesRequest(input) - return out, req.Send() -} - -// ListKnowledgeBasesWithContext is the same as ListKnowledgeBases with the addition of -// the ability to pass a context and additional request options. -// -// See ListKnowledgeBases 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 *BedrockAgent) ListKnowledgeBasesWithContext(ctx aws.Context, input *ListKnowledgeBasesInput, opts ...request.Option) (*ListKnowledgeBasesOutput, error) { - req, out := c.ListKnowledgeBasesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListKnowledgeBasesPages iterates over the pages of a ListKnowledgeBases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListKnowledgeBases method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListKnowledgeBases operation. -// pageNum := 0 -// err := client.ListKnowledgeBasesPages(params, -// func(page *bedrockagent.ListKnowledgeBasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgent) ListKnowledgeBasesPages(input *ListKnowledgeBasesInput, fn func(*ListKnowledgeBasesOutput, bool) bool) error { - return c.ListKnowledgeBasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListKnowledgeBasesPagesWithContext same as ListKnowledgeBasesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgent) ListKnowledgeBasesPagesWithContext(ctx aws.Context, input *ListKnowledgeBasesInput, fn func(*ListKnowledgeBasesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListKnowledgeBasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListKnowledgeBasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListKnowledgeBasesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListTagsForResource -func (c *BedrockAgent) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Agents for Amazon Bedrock. -// -// # List tags for a resource -// -// 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 Agents for Amazon Bedrock's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/ListTagsForResource -func (c *BedrockAgent) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *BedrockAgent) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPrepareAgent = "PrepareAgent" - -// PrepareAgentRequest generates a "aws/request.Request" representing the -// client's request for the PrepareAgent 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 PrepareAgent for more information on using the PrepareAgent -// 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 PrepareAgentRequest method. -// req, resp := client.PrepareAgentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/PrepareAgent -func (c *BedrockAgent) PrepareAgentRequest(input *PrepareAgentInput) (req *request.Request, output *PrepareAgentOutput) { - op := &request.Operation{ - Name: opPrepareAgent, - HTTPMethod: "POST", - HTTPPath: "/agents/{agentId}/", - } - - if input == nil { - input = &PrepareAgentInput{} - } - - output = &PrepareAgentOutput{} - req = c.newRequest(op, input, output) - return -} - -// PrepareAgent API operation for Agents for Amazon Bedrock. -// -// # Prepares an existing Amazon Bedrock Agent to receive runtime requests -// -// 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 Agents for Amazon Bedrock's -// API operation PrepareAgent for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/PrepareAgent -func (c *BedrockAgent) PrepareAgent(input *PrepareAgentInput) (*PrepareAgentOutput, error) { - req, out := c.PrepareAgentRequest(input) - return out, req.Send() -} - -// PrepareAgentWithContext is the same as PrepareAgent with the addition of -// the ability to pass a context and additional request options. -// -// See PrepareAgent 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 *BedrockAgent) PrepareAgentWithContext(ctx aws.Context, input *PrepareAgentInput, opts ...request.Option) (*PrepareAgentOutput, error) { - req, out := c.PrepareAgentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartIngestionJob = "StartIngestionJob" - -// StartIngestionJobRequest generates a "aws/request.Request" representing the -// client's request for the StartIngestionJob 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 StartIngestionJob for more information on using the StartIngestionJob -// 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 StartIngestionJobRequest method. -// req, resp := client.StartIngestionJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/StartIngestionJob -func (c *BedrockAgent) StartIngestionJobRequest(input *StartIngestionJobInput) (req *request.Request, output *StartIngestionJobOutput) { - op := &request.Operation{ - Name: opStartIngestionJob, - HTTPMethod: "PUT", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/", - } - - if input == nil { - input = &StartIngestionJobInput{} - } - - output = &StartIngestionJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartIngestionJob API operation for Agents for Amazon Bedrock. -// -// # Start a new ingestion job -// -// 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 Agents for Amazon Bedrock's -// API operation StartIngestionJob for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/StartIngestionJob -func (c *BedrockAgent) StartIngestionJob(input *StartIngestionJobInput) (*StartIngestionJobOutput, error) { - req, out := c.StartIngestionJobRequest(input) - return out, req.Send() -} - -// StartIngestionJobWithContext is the same as StartIngestionJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartIngestionJob 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 *BedrockAgent) StartIngestionJobWithContext(ctx aws.Context, input *StartIngestionJobInput, opts ...request.Option) (*StartIngestionJobOutput, error) { - req, out := c.StartIngestionJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/TagResource -func (c *BedrockAgent) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Agents for Amazon Bedrock. -// -// # Tag a resource -// -// 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 Agents for Amazon Bedrock's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/TagResource -func (c *BedrockAgent) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *BedrockAgent) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UntagResource -func (c *BedrockAgent) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Agents for Amazon Bedrock. -// -// # Untag a resource -// -// 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 Agents for Amazon Bedrock's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UntagResource -func (c *BedrockAgent) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *BedrockAgent) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAgent = "UpdateAgent" - -// UpdateAgentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAgent 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 UpdateAgent for more information on using the UpdateAgent -// 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 UpdateAgentRequest method. -// req, resp := client.UpdateAgentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateAgent -func (c *BedrockAgent) UpdateAgentRequest(input *UpdateAgentInput) (req *request.Request, output *UpdateAgentOutput) { - op := &request.Operation{ - Name: opUpdateAgent, - HTTPMethod: "PUT", - HTTPPath: "/agents/{agentId}/", - } - - if input == nil { - input = &UpdateAgentInput{} - } - - output = &UpdateAgentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAgent API operation for Agents for Amazon Bedrock. -// -// # Updates an existing Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation UpdateAgent for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateAgent -func (c *BedrockAgent) UpdateAgent(input *UpdateAgentInput) (*UpdateAgentOutput, error) { - req, out := c.UpdateAgentRequest(input) - return out, req.Send() -} - -// UpdateAgentWithContext is the same as UpdateAgent with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAgent 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 *BedrockAgent) UpdateAgentWithContext(ctx aws.Context, input *UpdateAgentInput, opts ...request.Option) (*UpdateAgentOutput, error) { - req, out := c.UpdateAgentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAgentActionGroup = "UpdateAgentActionGroup" - -// UpdateAgentActionGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAgentActionGroup 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 UpdateAgentActionGroup for more information on using the UpdateAgentActionGroup -// 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 UpdateAgentActionGroupRequest method. -// req, resp := client.UpdateAgentActionGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateAgentActionGroup -func (c *BedrockAgent) UpdateAgentActionGroupRequest(input *UpdateAgentActionGroupInput) (req *request.Request, output *UpdateAgentActionGroupOutput) { - op := &request.Operation{ - Name: opUpdateAgentActionGroup, - HTTPMethod: "PUT", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", - } - - if input == nil { - input = &UpdateAgentActionGroupInput{} - } - - output = &UpdateAgentActionGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAgentActionGroup API operation for Agents for Amazon Bedrock. -// -// # Updates an existing Action Group for Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation UpdateAgentActionGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateAgentActionGroup -func (c *BedrockAgent) UpdateAgentActionGroup(input *UpdateAgentActionGroupInput) (*UpdateAgentActionGroupOutput, error) { - req, out := c.UpdateAgentActionGroupRequest(input) - return out, req.Send() -} - -// UpdateAgentActionGroupWithContext is the same as UpdateAgentActionGroup with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAgentActionGroup 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 *BedrockAgent) UpdateAgentActionGroupWithContext(ctx aws.Context, input *UpdateAgentActionGroupInput, opts ...request.Option) (*UpdateAgentActionGroupOutput, error) { - req, out := c.UpdateAgentActionGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAgentAlias = "UpdateAgentAlias" - -// UpdateAgentAliasRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAgentAlias 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 UpdateAgentAlias for more information on using the UpdateAgentAlias -// 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 UpdateAgentAliasRequest method. -// req, resp := client.UpdateAgentAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateAgentAlias -func (c *BedrockAgent) UpdateAgentAliasRequest(input *UpdateAgentAliasInput) (req *request.Request, output *UpdateAgentAliasOutput) { - op := &request.Operation{ - Name: opUpdateAgentAlias, - HTTPMethod: "PUT", - HTTPPath: "/agents/{agentId}/agentaliases/{agentAliasId}/", - } - - if input == nil { - input = &UpdateAgentAliasInput{} - } - - output = &UpdateAgentAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAgentAlias API operation for Agents for Amazon Bedrock. -// -// # Updates an existing Alias for an Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation UpdateAgentAlias for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateAgentAlias -func (c *BedrockAgent) UpdateAgentAlias(input *UpdateAgentAliasInput) (*UpdateAgentAliasOutput, error) { - req, out := c.UpdateAgentAliasRequest(input) - return out, req.Send() -} - -// UpdateAgentAliasWithContext is the same as UpdateAgentAlias with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAgentAlias 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 *BedrockAgent) UpdateAgentAliasWithContext(ctx aws.Context, input *UpdateAgentAliasInput, opts ...request.Option) (*UpdateAgentAliasOutput, error) { - req, out := c.UpdateAgentAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAgentKnowledgeBase = "UpdateAgentKnowledgeBase" - -// UpdateAgentKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAgentKnowledgeBase 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 UpdateAgentKnowledgeBase for more information on using the UpdateAgentKnowledgeBase -// 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 UpdateAgentKnowledgeBaseRequest method. -// req, resp := client.UpdateAgentKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateAgentKnowledgeBase -func (c *BedrockAgent) UpdateAgentKnowledgeBaseRequest(input *UpdateAgentKnowledgeBaseInput) (req *request.Request, output *UpdateAgentKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opUpdateAgentKnowledgeBase, - HTTPMethod: "PUT", - HTTPPath: "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", - } - - if input == nil { - input = &UpdateAgentKnowledgeBaseInput{} - } - - output = &UpdateAgentKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAgentKnowledgeBase API operation for Agents for Amazon Bedrock. -// -// # Updates an existing Knowledge Base associated to an Amazon Bedrock Agent -// -// 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 Agents for Amazon Bedrock's -// API operation UpdateAgentKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateAgentKnowledgeBase -func (c *BedrockAgent) UpdateAgentKnowledgeBase(input *UpdateAgentKnowledgeBaseInput) (*UpdateAgentKnowledgeBaseOutput, error) { - req, out := c.UpdateAgentKnowledgeBaseRequest(input) - return out, req.Send() -} - -// UpdateAgentKnowledgeBaseWithContext is the same as UpdateAgentKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAgentKnowledgeBase 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 *BedrockAgent) UpdateAgentKnowledgeBaseWithContext(ctx aws.Context, input *UpdateAgentKnowledgeBaseInput, opts ...request.Option) (*UpdateAgentKnowledgeBaseOutput, error) { - req, out := c.UpdateAgentKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDataSource = "UpdateDataSource" - -// UpdateDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDataSource 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 UpdateDataSource for more information on using the UpdateDataSource -// 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 UpdateDataSourceRequest method. -// req, resp := client.UpdateDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateDataSource -func (c *BedrockAgent) UpdateDataSourceRequest(input *UpdateDataSourceInput) (req *request.Request, output *UpdateDataSourceOutput) { - op := &request.Operation{ - Name: opUpdateDataSource, - HTTPMethod: "PUT", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", - } - - if input == nil { - input = &UpdateDataSourceInput{} - } - - output = &UpdateDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDataSource API operation for Agents for Amazon Bedrock. -// -// # Update an existing data source -// -// 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 Agents for Amazon Bedrock's -// API operation UpdateDataSource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateDataSource -func (c *BedrockAgent) UpdateDataSource(input *UpdateDataSourceInput) (*UpdateDataSourceOutput, error) { - req, out := c.UpdateDataSourceRequest(input) - return out, req.Send() -} - -// UpdateDataSourceWithContext is the same as UpdateDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDataSource 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 *BedrockAgent) UpdateDataSourceWithContext(ctx aws.Context, input *UpdateDataSourceInput, opts ...request.Option) (*UpdateDataSourceOutput, error) { - req, out := c.UpdateDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateKnowledgeBase = "UpdateKnowledgeBase" - -// UpdateKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the UpdateKnowledgeBase 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 UpdateKnowledgeBase for more information on using the UpdateKnowledgeBase -// 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 UpdateKnowledgeBaseRequest method. -// req, resp := client.UpdateKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateKnowledgeBase -func (c *BedrockAgent) UpdateKnowledgeBaseRequest(input *UpdateKnowledgeBaseInput) (req *request.Request, output *UpdateKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opUpdateKnowledgeBase, - HTTPMethod: "PUT", - HTTPPath: "/knowledgebases/{knowledgeBaseId}", - } - - if input == nil { - input = &UpdateKnowledgeBaseInput{} - } - - output = &UpdateKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateKnowledgeBase API operation for Agents for Amazon Bedrock. -// -// # Update an existing knowledge base -// -// 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 Agents for Amazon Bedrock's -// API operation UpdateKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05/UpdateKnowledgeBase -func (c *BedrockAgent) UpdateKnowledgeBase(input *UpdateKnowledgeBaseInput) (*UpdateKnowledgeBaseOutput, error) { - req, out := c.UpdateKnowledgeBaseRequest(input) - return out, req.Send() -} - -// UpdateKnowledgeBaseWithContext is the same as UpdateKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateKnowledgeBase 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 *BedrockAgent) UpdateKnowledgeBaseWithContext(ctx aws.Context, input *UpdateKnowledgeBaseInput, opts ...request.Option) (*UpdateKnowledgeBaseOutput, error) { - req, out := c.UpdateKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Contains information about the API Schema for the Action Group -type APISchema struct { - _ struct{} `type:"structure"` - - // String OpenAPI Payload - // - // Payload is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by APISchema's - // String and GoString methods. - Payload *string `locationName:"payload" type:"string" sensitive:"true"` - - // The identifier for the S3 resource. - S3 *S3Identifier `locationName:"s3" 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 APISchema) 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 APISchema) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *APISchema) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "APISchema"} - if s.S3 != nil { - if err := s.S3.Validate(); err != nil { - invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPayload sets the Payload field's value. -func (s *APISchema) SetPayload(v string) *APISchema { - s.Payload = &v - return s -} - -// SetS3 sets the S3 field's value. -func (s *APISchema) SetS3(v *S3Identifier) *APISchema { - s.S3 = v - return s -} - -// This exception is thrown when a request is denied per access permissions -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Type of Executors for an Action Group -type ActionGroupExecutor struct { - _ struct{} `type:"structure"` - - // ARN of a Lambda. - Lambda *string `locationName:"lambda" 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 ActionGroupExecutor) 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 ActionGroupExecutor) GoString() string { - return s.String() -} - -// SetLambda sets the Lambda field's value. -func (s *ActionGroupExecutor) SetLambda(v string) *ActionGroupExecutor { - s.Lambda = &v - return s -} - -// ActionGroup Summary -type ActionGroupSummary struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // ActionGroupId is a required field - ActionGroupId *string `locationName:"actionGroupId" type:"string" required:"true"` - - // Name for a resource. - // - // ActionGroupName is a required field - ActionGroupName *string `locationName:"actionGroupName" type:"string" required:"true"` - - // State of the action group - // - // ActionGroupState is a required field - ActionGroupState *string `locationName:"actionGroupState" type:"string" required:"true" enum:"ActionGroupState"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 ActionGroupSummary) 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 ActionGroupSummary) GoString() string { - return s.String() -} - -// SetActionGroupId sets the ActionGroupId field's value. -func (s *ActionGroupSummary) SetActionGroupId(v string) *ActionGroupSummary { - s.ActionGroupId = &v - return s -} - -// SetActionGroupName sets the ActionGroupName field's value. -func (s *ActionGroupSummary) SetActionGroupName(v string) *ActionGroupSummary { - s.ActionGroupName = &v - return s -} - -// SetActionGroupState sets the ActionGroupState field's value. -func (s *ActionGroupSummary) SetActionGroupState(v string) *ActionGroupSummary { - s.ActionGroupState = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ActionGroupSummary) SetDescription(v string) *ActionGroupSummary { - s.Description = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ActionGroupSummary) SetUpdatedAt(v time.Time) *ActionGroupSummary { - s.UpdatedAt = &v - return s -} - -// Contains the information of an agent -type Agent struct { - _ struct{} `type:"structure"` - - // Arn representation of the Agent. - // - // AgentArn is a required field - AgentArn *string `locationName:"agentArn" type:"string" required:"true"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Name for a resource. - // - // AgentName is a required field - AgentName *string `locationName:"agentName" type:"string" required:"true"` - - // ARN of a IAM role. - // - // AgentResourceRoleArn is a required field - AgentResourceRoleArn *string `locationName:"agentResourceRoleArn" type:"string" required:"true"` - - // Schema Type for Action APIs. - // - // AgentStatus is a required field - AgentStatus *string `locationName:"agentStatus" type:"string" required:"true" enum:"AgentStatus"` - - // Draft Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `locationName:"agentVersion" min:"5" type:"string" required:"true"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // A KMS key ARN - CustomerEncryptionKeyArn *string `locationName:"customerEncryptionKeyArn" min:"1" type:"string"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Failure Reasons for Error. - FailureReasons []*string `locationName:"failureReasons" type:"list"` - - // ARN or name of a Bedrock model. - FoundationModel *string `locationName:"foundationModel" min:"1" type:"string"` - - // Max Session Time. - // - // IdleSessionTTLInSeconds is a required field - IdleSessionTTLInSeconds *int64 `locationName:"idleSessionTTLInSeconds" min:"60" type:"integer" required:"true"` - - // Instruction for the agent. - // - // Instruction is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Agent's - // String and GoString methods. - Instruction *string `locationName:"instruction" min:"40" type:"string" sensitive:"true"` - - // Time Stamp. - PreparedAt *time.Time `locationName:"preparedAt" type:"timestamp" timestampFormat:"iso8601"` - - // Configuration for prompt override. - // - // PromptOverrideConfiguration is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Agent's - // String and GoString methods. - PromptOverrideConfiguration *PromptOverrideConfiguration `locationName:"promptOverrideConfiguration" type:"structure" sensitive:"true"` - - // The recommended actions users can take to resolve an error in failureReasons. - RecommendedActions []*string `locationName:"recommendedActions" type:"list"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 Agent) 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 Agent) GoString() string { - return s.String() -} - -// SetAgentArn sets the AgentArn field's value. -func (s *Agent) SetAgentArn(v string) *Agent { - s.AgentArn = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *Agent) SetAgentId(v string) *Agent { - s.AgentId = &v - return s -} - -// SetAgentName sets the AgentName field's value. -func (s *Agent) SetAgentName(v string) *Agent { - s.AgentName = &v - return s -} - -// SetAgentResourceRoleArn sets the AgentResourceRoleArn field's value. -func (s *Agent) SetAgentResourceRoleArn(v string) *Agent { - s.AgentResourceRoleArn = &v - return s -} - -// SetAgentStatus sets the AgentStatus field's value. -func (s *Agent) SetAgentStatus(v string) *Agent { - s.AgentStatus = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *Agent) SetAgentVersion(v string) *Agent { - s.AgentVersion = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *Agent) SetClientToken(v string) *Agent { - s.ClientToken = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Agent) SetCreatedAt(v time.Time) *Agent { - s.CreatedAt = &v - return s -} - -// SetCustomerEncryptionKeyArn sets the CustomerEncryptionKeyArn field's value. -func (s *Agent) SetCustomerEncryptionKeyArn(v string) *Agent { - s.CustomerEncryptionKeyArn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Agent) SetDescription(v string) *Agent { - s.Description = &v - return s -} - -// SetFailureReasons sets the FailureReasons field's value. -func (s *Agent) SetFailureReasons(v []*string) *Agent { - s.FailureReasons = v - return s -} - -// SetFoundationModel sets the FoundationModel field's value. -func (s *Agent) SetFoundationModel(v string) *Agent { - s.FoundationModel = &v - return s -} - -// SetIdleSessionTTLInSeconds sets the IdleSessionTTLInSeconds field's value. -func (s *Agent) SetIdleSessionTTLInSeconds(v int64) *Agent { - s.IdleSessionTTLInSeconds = &v - return s -} - -// SetInstruction sets the Instruction field's value. -func (s *Agent) SetInstruction(v string) *Agent { - s.Instruction = &v - return s -} - -// SetPreparedAt sets the PreparedAt field's value. -func (s *Agent) SetPreparedAt(v time.Time) *Agent { - s.PreparedAt = &v - return s -} - -// SetPromptOverrideConfiguration sets the PromptOverrideConfiguration field's value. -func (s *Agent) SetPromptOverrideConfiguration(v *PromptOverrideConfiguration) *Agent { - s.PromptOverrideConfiguration = v - return s -} - -// SetRecommendedActions sets the RecommendedActions field's value. -func (s *Agent) SetRecommendedActions(v []*string) *Agent { - s.RecommendedActions = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Agent) SetUpdatedAt(v time.Time) *Agent { - s.UpdatedAt = &v - return s -} - -// Contains the information of an Agent Action Group -type AgentActionGroup struct { - _ struct{} `type:"structure"` - - // Type of Executors for an Action Group - ActionGroupExecutor *ActionGroupExecutor `locationName:"actionGroupExecutor" type:"structure"` - - // Identifier for a resource. - // - // ActionGroupId is a required field - ActionGroupId *string `locationName:"actionGroupId" type:"string" required:"true"` - - // Name for a resource. - // - // ActionGroupName is a required field - ActionGroupName *string `locationName:"actionGroupName" type:"string" required:"true"` - - // State of the action group - // - // ActionGroupState is a required field - ActionGroupState *string `locationName:"actionGroupState" type:"string" required:"true" enum:"ActionGroupState"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `locationName:"agentVersion" min:"1" type:"string" required:"true"` - - // Contains information about the API Schema for the Action Group - ApiSchema *APISchema `locationName:"apiSchema" type:"structure"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Action Group Signature for a BuiltIn Action - ParentActionSignature *string `locationName:"parentActionSignature" type:"string" enum:"ActionGroupSignature"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AgentActionGroup) 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 AgentActionGroup) GoString() string { - return s.String() -} - -// SetActionGroupExecutor sets the ActionGroupExecutor field's value. -func (s *AgentActionGroup) SetActionGroupExecutor(v *ActionGroupExecutor) *AgentActionGroup { - s.ActionGroupExecutor = v - return s -} - -// SetActionGroupId sets the ActionGroupId field's value. -func (s *AgentActionGroup) SetActionGroupId(v string) *AgentActionGroup { - s.ActionGroupId = &v - return s -} - -// SetActionGroupName sets the ActionGroupName field's value. -func (s *AgentActionGroup) SetActionGroupName(v string) *AgentActionGroup { - s.ActionGroupName = &v - return s -} - -// SetActionGroupState sets the ActionGroupState field's value. -func (s *AgentActionGroup) SetActionGroupState(v string) *AgentActionGroup { - s.ActionGroupState = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *AgentActionGroup) SetAgentId(v string) *AgentActionGroup { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *AgentActionGroup) SetAgentVersion(v string) *AgentActionGroup { - s.AgentVersion = &v - return s -} - -// SetApiSchema sets the ApiSchema field's value. -func (s *AgentActionGroup) SetApiSchema(v *APISchema) *AgentActionGroup { - s.ApiSchema = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *AgentActionGroup) SetClientToken(v string) *AgentActionGroup { - s.ClientToken = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AgentActionGroup) SetCreatedAt(v time.Time) *AgentActionGroup { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AgentActionGroup) SetDescription(v string) *AgentActionGroup { - s.Description = &v - return s -} - -// SetParentActionSignature sets the ParentActionSignature field's value. -func (s *AgentActionGroup) SetParentActionSignature(v string) *AgentActionGroup { - s.ParentActionSignature = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AgentActionGroup) SetUpdatedAt(v time.Time) *AgentActionGroup { - s.UpdatedAt = &v - return s -} - -// Contains the information of an agent alias -type AgentAlias struct { - _ struct{} `type:"structure"` - - // Arn representation of the Agent Alias. - // - // AgentAliasArn is a required field - AgentAliasArn *string `locationName:"agentAliasArn" type:"string" required:"true"` - - // The list of history events for an alias for an Agent. - AgentAliasHistoryEvents []*AgentAliasHistoryEvent `locationName:"agentAliasHistoryEvents" type:"list"` - - // Id for an Agent Alias generated at the server side. - // - // AgentAliasId is a required field - AgentAliasId *string `locationName:"agentAliasId" min:"10" type:"string" required:"true"` - - // Name for a resource. - // - // AgentAliasName is a required field - AgentAliasName *string `locationName:"agentAliasName" type:"string" required:"true"` - - // The statuses an Agent Alias can be in. - // - // AgentAliasStatus is a required field - AgentAliasStatus *string `locationName:"agentAliasStatus" type:"string" required:"true" enum:"AgentAliasStatus"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Routing configuration for an Agent alias. - // - // RoutingConfiguration is a required field - RoutingConfiguration []*AgentAliasRoutingConfigurationListItem `locationName:"routingConfiguration" type:"list" required:"true"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AgentAlias) 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 AgentAlias) GoString() string { - return s.String() -} - -// SetAgentAliasArn sets the AgentAliasArn field's value. -func (s *AgentAlias) SetAgentAliasArn(v string) *AgentAlias { - s.AgentAliasArn = &v - return s -} - -// SetAgentAliasHistoryEvents sets the AgentAliasHistoryEvents field's value. -func (s *AgentAlias) SetAgentAliasHistoryEvents(v []*AgentAliasHistoryEvent) *AgentAlias { - s.AgentAliasHistoryEvents = v - return s -} - -// SetAgentAliasId sets the AgentAliasId field's value. -func (s *AgentAlias) SetAgentAliasId(v string) *AgentAlias { - s.AgentAliasId = &v - return s -} - -// SetAgentAliasName sets the AgentAliasName field's value. -func (s *AgentAlias) SetAgentAliasName(v string) *AgentAlias { - s.AgentAliasName = &v - return s -} - -// SetAgentAliasStatus sets the AgentAliasStatus field's value. -func (s *AgentAlias) SetAgentAliasStatus(v string) *AgentAlias { - s.AgentAliasStatus = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *AgentAlias) SetAgentId(v string) *AgentAlias { - s.AgentId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *AgentAlias) SetClientToken(v string) *AgentAlias { - s.ClientToken = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AgentAlias) SetCreatedAt(v time.Time) *AgentAlias { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AgentAlias) SetDescription(v string) *AgentAlias { - s.Description = &v - return s -} - -// SetRoutingConfiguration sets the RoutingConfiguration field's value. -func (s *AgentAlias) SetRoutingConfiguration(v []*AgentAliasRoutingConfigurationListItem) *AgentAlias { - s.RoutingConfiguration = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AgentAlias) SetUpdatedAt(v time.Time) *AgentAlias { - s.UpdatedAt = &v - return s -} - -// History event for an alias for an Agent. -type AgentAliasHistoryEvent struct { - _ struct{} `type:"structure"` - - // Time Stamp. - EndDate *time.Time `locationName:"endDate" type:"timestamp" timestampFormat:"iso8601"` - - // Routing configuration for an Agent alias. - RoutingConfiguration []*AgentAliasRoutingConfigurationListItem `locationName:"routingConfiguration" type:"list"` - - // Time Stamp. - StartDate *time.Time `locationName:"startDate" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 AgentAliasHistoryEvent) 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 AgentAliasHistoryEvent) GoString() string { - return s.String() -} - -// SetEndDate sets the EndDate field's value. -func (s *AgentAliasHistoryEvent) SetEndDate(v time.Time) *AgentAliasHistoryEvent { - s.EndDate = &v - return s -} - -// SetRoutingConfiguration sets the RoutingConfiguration field's value. -func (s *AgentAliasHistoryEvent) SetRoutingConfiguration(v []*AgentAliasRoutingConfigurationListItem) *AgentAliasHistoryEvent { - s.RoutingConfiguration = v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *AgentAliasHistoryEvent) SetStartDate(v time.Time) *AgentAliasHistoryEvent { - s.StartDate = &v - return s -} - -// Details about the routing configuration for an Agent alias. -type AgentAliasRoutingConfigurationListItem struct { - _ struct{} `type:"structure"` - - // Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `locationName:"agentVersion" min:"1" 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 AgentAliasRoutingConfigurationListItem) 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 AgentAliasRoutingConfigurationListItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AgentAliasRoutingConfigurationListItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AgentAliasRoutingConfigurationListItem"} - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *AgentAliasRoutingConfigurationListItem) SetAgentVersion(v string) *AgentAliasRoutingConfigurationListItem { - s.AgentVersion = &v - return s -} - -// Summary of an alias for an Agent. -type AgentAliasSummary struct { - _ struct{} `type:"structure"` - - // Id for an Agent Alias generated at the server side. - // - // AgentAliasId is a required field - AgentAliasId *string `locationName:"agentAliasId" min:"10" type:"string" required:"true"` - - // Name for a resource. - // - // AgentAliasName is a required field - AgentAliasName *string `locationName:"agentAliasName" type:"string" required:"true"` - - // The statuses an Agent Alias can be in. - // - // AgentAliasStatus is a required field - AgentAliasStatus *string `locationName:"agentAliasStatus" type:"string" required:"true" enum:"AgentAliasStatus"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Routing configuration for an Agent alias. - RoutingConfiguration []*AgentAliasRoutingConfigurationListItem `locationName:"routingConfiguration" type:"list"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AgentAliasSummary) 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 AgentAliasSummary) GoString() string { - return s.String() -} - -// SetAgentAliasId sets the AgentAliasId field's value. -func (s *AgentAliasSummary) SetAgentAliasId(v string) *AgentAliasSummary { - s.AgentAliasId = &v - return s -} - -// SetAgentAliasName sets the AgentAliasName field's value. -func (s *AgentAliasSummary) SetAgentAliasName(v string) *AgentAliasSummary { - s.AgentAliasName = &v - return s -} - -// SetAgentAliasStatus sets the AgentAliasStatus field's value. -func (s *AgentAliasSummary) SetAgentAliasStatus(v string) *AgentAliasSummary { - s.AgentAliasStatus = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AgentAliasSummary) SetCreatedAt(v time.Time) *AgentAliasSummary { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AgentAliasSummary) SetDescription(v string) *AgentAliasSummary { - s.Description = &v - return s -} - -// SetRoutingConfiguration sets the RoutingConfiguration field's value. -func (s *AgentAliasSummary) SetRoutingConfiguration(v []*AgentAliasRoutingConfigurationListItem) *AgentAliasSummary { - s.RoutingConfiguration = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AgentAliasSummary) SetUpdatedAt(v time.Time) *AgentAliasSummary { - s.UpdatedAt = &v - return s -} - -// Contains the information of an Agent Knowledge Base. -type AgentKnowledgeBase struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `locationName:"agentVersion" min:"1" type:"string" required:"true"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Description of the Resource. - // - // Description is a required field - Description *string `locationName:"description" min:"1" type:"string" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // State of the knowledge base; whether it is enabled or disabled - // - // KnowledgeBaseState is a required field - KnowledgeBaseState *string `locationName:"knowledgeBaseState" type:"string" required:"true" enum:"KnowledgeBaseState"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AgentKnowledgeBase) 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 AgentKnowledgeBase) GoString() string { - return s.String() -} - -// SetAgentId sets the AgentId field's value. -func (s *AgentKnowledgeBase) SetAgentId(v string) *AgentKnowledgeBase { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *AgentKnowledgeBase) SetAgentVersion(v string) *AgentKnowledgeBase { - s.AgentVersion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AgentKnowledgeBase) SetCreatedAt(v time.Time) *AgentKnowledgeBase { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AgentKnowledgeBase) SetDescription(v string) *AgentKnowledgeBase { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *AgentKnowledgeBase) SetKnowledgeBaseId(v string) *AgentKnowledgeBase { - s.KnowledgeBaseId = &v - return s -} - -// SetKnowledgeBaseState sets the KnowledgeBaseState field's value. -func (s *AgentKnowledgeBase) SetKnowledgeBaseState(v string) *AgentKnowledgeBase { - s.KnowledgeBaseState = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AgentKnowledgeBase) SetUpdatedAt(v time.Time) *AgentKnowledgeBase { - s.UpdatedAt = &v - return s -} - -// Agent Knowledge Base Summary -type AgentKnowledgeBaseSummary struct { - _ struct{} `type:"structure"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // State of the knowledge base; whether it is enabled or disabled - // - // KnowledgeBaseState is a required field - KnowledgeBaseState *string `locationName:"knowledgeBaseState" type:"string" required:"true" enum:"KnowledgeBaseState"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AgentKnowledgeBaseSummary) 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 AgentKnowledgeBaseSummary) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *AgentKnowledgeBaseSummary) SetDescription(v string) *AgentKnowledgeBaseSummary { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *AgentKnowledgeBaseSummary) SetKnowledgeBaseId(v string) *AgentKnowledgeBaseSummary { - s.KnowledgeBaseId = &v - return s -} - -// SetKnowledgeBaseState sets the KnowledgeBaseState field's value. -func (s *AgentKnowledgeBaseSummary) SetKnowledgeBaseState(v string) *AgentKnowledgeBaseSummary { - s.KnowledgeBaseState = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AgentKnowledgeBaseSummary) SetUpdatedAt(v time.Time) *AgentKnowledgeBaseSummary { - s.UpdatedAt = &v - return s -} - -// Summary of Agent. -type AgentSummary struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Name for a resource. - // - // AgentName is a required field - AgentName *string `locationName:"agentName" type:"string" required:"true"` - - // Schema Type for Action APIs. - // - // AgentStatus is a required field - AgentStatus *string `locationName:"agentStatus" type:"string" required:"true" enum:"AgentStatus"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Agent Version. - LatestAgentVersion *string `locationName:"latestAgentVersion" min:"1" type:"string"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AgentSummary) 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 AgentSummary) GoString() string { - return s.String() -} - -// SetAgentId sets the AgentId field's value. -func (s *AgentSummary) SetAgentId(v string) *AgentSummary { - s.AgentId = &v - return s -} - -// SetAgentName sets the AgentName field's value. -func (s *AgentSummary) SetAgentName(v string) *AgentSummary { - s.AgentName = &v - return s -} - -// SetAgentStatus sets the AgentStatus field's value. -func (s *AgentSummary) SetAgentStatus(v string) *AgentSummary { - s.AgentStatus = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AgentSummary) SetDescription(v string) *AgentSummary { - s.Description = &v - return s -} - -// SetLatestAgentVersion sets the LatestAgentVersion field's value. -func (s *AgentSummary) SetLatestAgentVersion(v string) *AgentSummary { - s.LatestAgentVersion = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AgentSummary) SetUpdatedAt(v time.Time) *AgentSummary { - s.UpdatedAt = &v - return s -} - -// Contains the information of an agent version. -type AgentVersion struct { - _ struct{} `type:"structure"` - - // Arn representation of the Agent. - // - // AgentArn is a required field - AgentArn *string `locationName:"agentArn" type:"string" required:"true"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Name for a resource. - // - // AgentName is a required field - AgentName *string `locationName:"agentName" type:"string" required:"true"` - - // ARN of a IAM role. - // - // AgentResourceRoleArn is a required field - AgentResourceRoleArn *string `locationName:"agentResourceRoleArn" type:"string" required:"true"` - - // Schema Type for Action APIs. - // - // AgentStatus is a required field - AgentStatus *string `locationName:"agentStatus" type:"string" required:"true" enum:"AgentStatus"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // A KMS key ARN - CustomerEncryptionKeyArn *string `locationName:"customerEncryptionKeyArn" min:"1" type:"string"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Failure Reasons for Error. - FailureReasons []*string `locationName:"failureReasons" type:"list"` - - // ARN or name of a Bedrock model. - FoundationModel *string `locationName:"foundationModel" min:"1" type:"string"` - - // Max Session Time. - // - // IdleSessionTTLInSeconds is a required field - IdleSessionTTLInSeconds *int64 `locationName:"idleSessionTTLInSeconds" min:"60" type:"integer" required:"true"` - - // Instruction for the agent. - // - // Instruction is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AgentVersion's - // String and GoString methods. - Instruction *string `locationName:"instruction" min:"40" type:"string" sensitive:"true"` - - // Configuration for prompt override. - // - // PromptOverrideConfiguration is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AgentVersion's - // String and GoString methods. - PromptOverrideConfiguration *PromptOverrideConfiguration `locationName:"promptOverrideConfiguration" type:"structure" sensitive:"true"` - - // The recommended actions users can take to resolve an error in failureReasons. - RecommendedActions []*string `locationName:"recommendedActions" type:"list"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Numerical Agent Version. - // - // Version is a required field - Version *string `locationName:"version" 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 AgentVersion) 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 AgentVersion) GoString() string { - return s.String() -} - -// SetAgentArn sets the AgentArn field's value. -func (s *AgentVersion) SetAgentArn(v string) *AgentVersion { - s.AgentArn = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *AgentVersion) SetAgentId(v string) *AgentVersion { - s.AgentId = &v - return s -} - -// SetAgentName sets the AgentName field's value. -func (s *AgentVersion) SetAgentName(v string) *AgentVersion { - s.AgentName = &v - return s -} - -// SetAgentResourceRoleArn sets the AgentResourceRoleArn field's value. -func (s *AgentVersion) SetAgentResourceRoleArn(v string) *AgentVersion { - s.AgentResourceRoleArn = &v - return s -} - -// SetAgentStatus sets the AgentStatus field's value. -func (s *AgentVersion) SetAgentStatus(v string) *AgentVersion { - s.AgentStatus = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AgentVersion) SetCreatedAt(v time.Time) *AgentVersion { - s.CreatedAt = &v - return s -} - -// SetCustomerEncryptionKeyArn sets the CustomerEncryptionKeyArn field's value. -func (s *AgentVersion) SetCustomerEncryptionKeyArn(v string) *AgentVersion { - s.CustomerEncryptionKeyArn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AgentVersion) SetDescription(v string) *AgentVersion { - s.Description = &v - return s -} - -// SetFailureReasons sets the FailureReasons field's value. -func (s *AgentVersion) SetFailureReasons(v []*string) *AgentVersion { - s.FailureReasons = v - return s -} - -// SetFoundationModel sets the FoundationModel field's value. -func (s *AgentVersion) SetFoundationModel(v string) *AgentVersion { - s.FoundationModel = &v - return s -} - -// SetIdleSessionTTLInSeconds sets the IdleSessionTTLInSeconds field's value. -func (s *AgentVersion) SetIdleSessionTTLInSeconds(v int64) *AgentVersion { - s.IdleSessionTTLInSeconds = &v - return s -} - -// SetInstruction sets the Instruction field's value. -func (s *AgentVersion) SetInstruction(v string) *AgentVersion { - s.Instruction = &v - return s -} - -// SetPromptOverrideConfiguration sets the PromptOverrideConfiguration field's value. -func (s *AgentVersion) SetPromptOverrideConfiguration(v *PromptOverrideConfiguration) *AgentVersion { - s.PromptOverrideConfiguration = v - return s -} - -// SetRecommendedActions sets the RecommendedActions field's value. -func (s *AgentVersion) SetRecommendedActions(v []*string) *AgentVersion { - s.RecommendedActions = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AgentVersion) SetUpdatedAt(v time.Time) *AgentVersion { - s.UpdatedAt = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *AgentVersion) SetVersion(v string) *AgentVersion { - s.Version = &v - return s -} - -// Summary of agent version. -type AgentVersionSummary struct { - _ struct{} `type:"structure"` - - // Name for a resource. - // - // AgentName is a required field - AgentName *string `locationName:"agentName" type:"string" required:"true"` - - // Schema Type for Action APIs. - // - // AgentStatus is a required field - AgentStatus *string `locationName:"agentStatus" type:"string" required:"true" enum:"AgentStatus"` - - // Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `locationName:"agentVersion" min:"1" type:"string" required:"true"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 AgentVersionSummary) 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 AgentVersionSummary) GoString() string { - return s.String() -} - -// SetAgentName sets the AgentName field's value. -func (s *AgentVersionSummary) SetAgentName(v string) *AgentVersionSummary { - s.AgentName = &v - return s -} - -// SetAgentStatus sets the AgentStatus field's value. -func (s *AgentVersionSummary) SetAgentStatus(v string) *AgentVersionSummary { - s.AgentStatus = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *AgentVersionSummary) SetAgentVersion(v string) *AgentVersionSummary { - s.AgentVersion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AgentVersionSummary) SetCreatedAt(v time.Time) *AgentVersionSummary { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AgentVersionSummary) SetDescription(v string) *AgentVersionSummary { - s.Description = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AgentVersionSummary) SetUpdatedAt(v time.Time) *AgentVersionSummary { - s.UpdatedAt = &v - return s -} - -// Associate Agent Knowledge Base Request -type AssociateAgentKnowledgeBaseInput struct { - _ struct{} `type:"structure"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Draft Version of the Agent. - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"5" type:"string" required:"true"` - - // Description of the Resource. - // - // Description is a required field - Description *string `locationName:"description" min:"1" type:"string" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // State of the knowledge base; whether it is enabled or disabled - KnowledgeBaseState *string `locationName:"knowledgeBaseState" type:"string" enum:"KnowledgeBaseState"` -} - -// 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 AssociateAgentKnowledgeBaseInput) 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 AssociateAgentKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateAgentKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateAgentKnowledgeBaseInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 5 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 5)) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *AssociateAgentKnowledgeBaseInput) SetAgentId(v string) *AssociateAgentKnowledgeBaseInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *AssociateAgentKnowledgeBaseInput) SetAgentVersion(v string) *AssociateAgentKnowledgeBaseInput { - s.AgentVersion = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AssociateAgentKnowledgeBaseInput) SetDescription(v string) *AssociateAgentKnowledgeBaseInput { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *AssociateAgentKnowledgeBaseInput) SetKnowledgeBaseId(v string) *AssociateAgentKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -// SetKnowledgeBaseState sets the KnowledgeBaseState field's value. -func (s *AssociateAgentKnowledgeBaseInput) SetKnowledgeBaseState(v string) *AssociateAgentKnowledgeBaseInput { - s.KnowledgeBaseState = &v - return s -} - -// Associate Agent Knowledge Base Response -type AssociateAgentKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an Agent Knowledge Base. - // - // AgentKnowledgeBase is a required field - AgentKnowledgeBase *AgentKnowledgeBase `locationName:"agentKnowledgeBase" type:"structure" 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 AssociateAgentKnowledgeBaseOutput) 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 AssociateAgentKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetAgentKnowledgeBase sets the AgentKnowledgeBase field's value. -func (s *AssociateAgentKnowledgeBaseOutput) SetAgentKnowledgeBase(v *AgentKnowledgeBase) *AssociateAgentKnowledgeBaseOutput { - s.AgentKnowledgeBase = v - return s -} - -// Configures chunking strategy -type ChunkingConfiguration struct { - _ struct{} `type:"structure"` - - // The type of chunking strategy - // - // ChunkingStrategy is a required field - ChunkingStrategy *string `locationName:"chunkingStrategy" type:"string" required:"true" enum:"ChunkingStrategy"` - - // Configures fixed size chunking strategy - FixedSizeChunkingConfiguration *FixedSizeChunkingConfiguration `locationName:"fixedSizeChunkingConfiguration" 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 ChunkingConfiguration) 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 ChunkingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChunkingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChunkingConfiguration"} - if s.ChunkingStrategy == nil { - invalidParams.Add(request.NewErrParamRequired("ChunkingStrategy")) - } - if s.FixedSizeChunkingConfiguration != nil { - if err := s.FixedSizeChunkingConfiguration.Validate(); err != nil { - invalidParams.AddNested("FixedSizeChunkingConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChunkingStrategy sets the ChunkingStrategy field's value. -func (s *ChunkingConfiguration) SetChunkingStrategy(v string) *ChunkingConfiguration { - s.ChunkingStrategy = &v - return s -} - -// SetFixedSizeChunkingConfiguration sets the FixedSizeChunkingConfiguration field's value. -func (s *ChunkingConfiguration) SetFixedSizeChunkingConfiguration(v *FixedSizeChunkingConfiguration) *ChunkingConfiguration { - s.FixedSizeChunkingConfiguration = v - return s -} - -// This exception is thrown when there is a conflict performing an operation -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Create Action Group Request -type CreateAgentActionGroupInput struct { - _ struct{} `type:"structure"` - - // Type of Executors for an Action Group - ActionGroupExecutor *ActionGroupExecutor `locationName:"actionGroupExecutor" type:"structure"` - - // Name for a resource. - // - // ActionGroupName is a required field - ActionGroupName *string `locationName:"actionGroupName" type:"string" required:"true"` - - // State of the action group - ActionGroupState *string `locationName:"actionGroupState" type:"string" enum:"ActionGroupState"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Draft Version of the Agent. - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"5" type:"string" required:"true"` - - // Contains information about the API Schema for the Action Group - ApiSchema *APISchema `locationName:"apiSchema" type:"structure"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string" idempotencyToken:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Action Group Signature for a BuiltIn Action - ParentActionGroupSignature *string `locationName:"parentActionGroupSignature" type:"string" enum:"ActionGroupSignature"` -} - -// 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 CreateAgentActionGroupInput) 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 CreateAgentActionGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAgentActionGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAgentActionGroupInput"} - if s.ActionGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ActionGroupName")) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 5 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 5)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 33 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 33)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.ApiSchema != nil { - if err := s.ApiSchema.Validate(); err != nil { - invalidParams.AddNested("ApiSchema", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionGroupExecutor sets the ActionGroupExecutor field's value. -func (s *CreateAgentActionGroupInput) SetActionGroupExecutor(v *ActionGroupExecutor) *CreateAgentActionGroupInput { - s.ActionGroupExecutor = v - return s -} - -// SetActionGroupName sets the ActionGroupName field's value. -func (s *CreateAgentActionGroupInput) SetActionGroupName(v string) *CreateAgentActionGroupInput { - s.ActionGroupName = &v - return s -} - -// SetActionGroupState sets the ActionGroupState field's value. -func (s *CreateAgentActionGroupInput) SetActionGroupState(v string) *CreateAgentActionGroupInput { - s.ActionGroupState = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *CreateAgentActionGroupInput) SetAgentId(v string) *CreateAgentActionGroupInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *CreateAgentActionGroupInput) SetAgentVersion(v string) *CreateAgentActionGroupInput { - s.AgentVersion = &v - return s -} - -// SetApiSchema sets the ApiSchema field's value. -func (s *CreateAgentActionGroupInput) SetApiSchema(v *APISchema) *CreateAgentActionGroupInput { - s.ApiSchema = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAgentActionGroupInput) SetClientToken(v string) *CreateAgentActionGroupInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAgentActionGroupInput) SetDescription(v string) *CreateAgentActionGroupInput { - s.Description = &v - return s -} - -// SetParentActionGroupSignature sets the ParentActionGroupSignature field's value. -func (s *CreateAgentActionGroupInput) SetParentActionGroupSignature(v string) *CreateAgentActionGroupInput { - s.ParentActionGroupSignature = &v - return s -} - -// Create Action Group Response -type CreateAgentActionGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an Agent Action Group - // - // AgentActionGroup is a required field - AgentActionGroup *AgentActionGroup `locationName:"agentActionGroup" type:"structure" 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 CreateAgentActionGroupOutput) 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 CreateAgentActionGroupOutput) GoString() string { - return s.String() -} - -// SetAgentActionGroup sets the AgentActionGroup field's value. -func (s *CreateAgentActionGroupOutput) SetAgentActionGroup(v *AgentActionGroup) *CreateAgentActionGroupOutput { - s.AgentActionGroup = v - return s -} - -// Create Agent Alias Request -type CreateAgentAliasInput struct { - _ struct{} `type:"structure"` - - // Name for a resource. - // - // AgentAliasName is a required field - AgentAliasName *string `locationName:"agentAliasName" type:"string" required:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string" idempotencyToken:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Routing configuration for an Agent alias. - RoutingConfiguration []*AgentAliasRoutingConfigurationListItem `locationName:"routingConfiguration" type:"list"` - - // A map of tag keys and values - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateAgentAliasInput) 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 CreateAgentAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAgentAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAgentAliasInput"} - if s.AgentAliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AgentAliasName")) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 33 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 33)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.RoutingConfiguration != nil { - for i, v := range s.RoutingConfiguration { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RoutingConfiguration", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentAliasName sets the AgentAliasName field's value. -func (s *CreateAgentAliasInput) SetAgentAliasName(v string) *CreateAgentAliasInput { - s.AgentAliasName = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *CreateAgentAliasInput) SetAgentId(v string) *CreateAgentAliasInput { - s.AgentId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAgentAliasInput) SetClientToken(v string) *CreateAgentAliasInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAgentAliasInput) SetDescription(v string) *CreateAgentAliasInput { - s.Description = &v - return s -} - -// SetRoutingConfiguration sets the RoutingConfiguration field's value. -func (s *CreateAgentAliasInput) SetRoutingConfiguration(v []*AgentAliasRoutingConfigurationListItem) *CreateAgentAliasInput { - s.RoutingConfiguration = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAgentAliasInput) SetTags(v map[string]*string) *CreateAgentAliasInput { - s.Tags = v - return s -} - -// Create Agent Alias Response -type CreateAgentAliasOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an agent alias - // - // AgentAlias is a required field - AgentAlias *AgentAlias `locationName:"agentAlias" type:"structure" 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 CreateAgentAliasOutput) 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 CreateAgentAliasOutput) GoString() string { - return s.String() -} - -// SetAgentAlias sets the AgentAlias field's value. -func (s *CreateAgentAliasOutput) SetAgentAlias(v *AgentAlias) *CreateAgentAliasOutput { - s.AgentAlias = v - return s -} - -// Create Agent Request -type CreateAgentInput struct { - _ struct{} `type:"structure"` - - // Name for a resource. - // - // AgentName is a required field - AgentName *string `locationName:"agentName" type:"string" required:"true"` - - // ARN of a IAM role. - // - // AgentResourceRoleArn is a required field - AgentResourceRoleArn *string `locationName:"agentResourceRoleArn" type:"string" required:"true"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string" idempotencyToken:"true"` - - // A KMS key ARN - CustomerEncryptionKeyArn *string `locationName:"customerEncryptionKeyArn" min:"1" type:"string"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // ARN or name of a Bedrock model. - FoundationModel *string `locationName:"foundationModel" min:"1" type:"string"` - - // Max Session Time. - IdleSessionTTLInSeconds *int64 `locationName:"idleSessionTTLInSeconds" min:"60" type:"integer"` - - // Instruction for the agent. - // - // Instruction is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAgentInput's - // String and GoString methods. - Instruction *string `locationName:"instruction" min:"40" type:"string" sensitive:"true"` - - // Configuration for prompt override. - // - // PromptOverrideConfiguration is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAgentInput's - // String and GoString methods. - PromptOverrideConfiguration *PromptOverrideConfiguration `locationName:"promptOverrideConfiguration" type:"structure" sensitive:"true"` - - // A map of tag keys and values - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateAgentInput) 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 CreateAgentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAgentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAgentInput"} - if s.AgentName == nil { - invalidParams.Add(request.NewErrParamRequired("AgentName")) - } - if s.AgentResourceRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("AgentResourceRoleArn")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 33 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 33)) - } - if s.CustomerEncryptionKeyArn != nil && len(*s.CustomerEncryptionKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomerEncryptionKeyArn", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FoundationModel != nil && len(*s.FoundationModel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FoundationModel", 1)) - } - if s.IdleSessionTTLInSeconds != nil && *s.IdleSessionTTLInSeconds < 60 { - invalidParams.Add(request.NewErrParamMinValue("IdleSessionTTLInSeconds", 60)) - } - if s.Instruction != nil && len(*s.Instruction) < 40 { - invalidParams.Add(request.NewErrParamMinLen("Instruction", 40)) - } - if s.PromptOverrideConfiguration != nil { - if err := s.PromptOverrideConfiguration.Validate(); err != nil { - invalidParams.AddNested("PromptOverrideConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentName sets the AgentName field's value. -func (s *CreateAgentInput) SetAgentName(v string) *CreateAgentInput { - s.AgentName = &v - return s -} - -// SetAgentResourceRoleArn sets the AgentResourceRoleArn field's value. -func (s *CreateAgentInput) SetAgentResourceRoleArn(v string) *CreateAgentInput { - s.AgentResourceRoleArn = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAgentInput) SetClientToken(v string) *CreateAgentInput { - s.ClientToken = &v - return s -} - -// SetCustomerEncryptionKeyArn sets the CustomerEncryptionKeyArn field's value. -func (s *CreateAgentInput) SetCustomerEncryptionKeyArn(v string) *CreateAgentInput { - s.CustomerEncryptionKeyArn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAgentInput) SetDescription(v string) *CreateAgentInput { - s.Description = &v - return s -} - -// SetFoundationModel sets the FoundationModel field's value. -func (s *CreateAgentInput) SetFoundationModel(v string) *CreateAgentInput { - s.FoundationModel = &v - return s -} - -// SetIdleSessionTTLInSeconds sets the IdleSessionTTLInSeconds field's value. -func (s *CreateAgentInput) SetIdleSessionTTLInSeconds(v int64) *CreateAgentInput { - s.IdleSessionTTLInSeconds = &v - return s -} - -// SetInstruction sets the Instruction field's value. -func (s *CreateAgentInput) SetInstruction(v string) *CreateAgentInput { - s.Instruction = &v - return s -} - -// SetPromptOverrideConfiguration sets the PromptOverrideConfiguration field's value. -func (s *CreateAgentInput) SetPromptOverrideConfiguration(v *PromptOverrideConfiguration) *CreateAgentInput { - s.PromptOverrideConfiguration = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAgentInput) SetTags(v map[string]*string) *CreateAgentInput { - s.Tags = v - return s -} - -// Create Agent Response -type CreateAgentOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an agent - // - // Agent is a required field - Agent *Agent `locationName:"agent" type:"structure" 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 CreateAgentOutput) 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 CreateAgentOutput) GoString() string { - return s.String() -} - -// SetAgent sets the Agent field's value. -func (s *CreateAgentOutput) SetAgent(v *Agent) *CreateAgentOutput { - s.Agent = v - return s -} - -type CreateDataSourceInput struct { - _ struct{} `type:"structure"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string" idempotencyToken:"true"` - - // Specifies a raw data source location to ingest. - // - // DataSourceConfiguration is a required field - DataSourceConfiguration *DataSourceConfiguration `locationName:"dataSourceConfiguration" type:"structure" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Name for a resource. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // Server-side encryption configuration. - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // Configures ingestion for a vector knowledge base - VectorIngestionConfiguration *VectorIngestionConfiguration `locationName:"vectorIngestionConfiguration" 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 CreateDataSourceInput) 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 CreateDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDataSourceInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 33 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 33)) - } - if s.DataSourceConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceConfiguration")) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.DataSourceConfiguration != nil { - if err := s.DataSourceConfiguration.Validate(); err != nil { - invalidParams.AddNested("DataSourceConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ServerSideEncryptionConfiguration != nil { - if err := s.ServerSideEncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.VectorIngestionConfiguration != nil { - if err := s.VectorIngestionConfiguration.Validate(); err != nil { - invalidParams.AddNested("VectorIngestionConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDataSourceInput) SetClientToken(v string) *CreateDataSourceInput { - s.ClientToken = &v - return s -} - -// SetDataSourceConfiguration sets the DataSourceConfiguration field's value. -func (s *CreateDataSourceInput) SetDataSourceConfiguration(v *DataSourceConfiguration) *CreateDataSourceInput { - s.DataSourceConfiguration = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDataSourceInput) SetDescription(v string) *CreateDataSourceInput { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *CreateDataSourceInput) SetKnowledgeBaseId(v string) *CreateDataSourceInput { - s.KnowledgeBaseId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDataSourceInput) SetName(v string) *CreateDataSourceInput { - s.Name = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *CreateDataSourceInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *CreateDataSourceInput { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetVectorIngestionConfiguration sets the VectorIngestionConfiguration field's value. -func (s *CreateDataSourceInput) SetVectorIngestionConfiguration(v *VectorIngestionConfiguration) *CreateDataSourceInput { - s.VectorIngestionConfiguration = v - return s -} - -type CreateDataSourceOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of a data source. - // - // DataSource is a required field - DataSource *DataSource `locationName:"dataSource" type:"structure" 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 CreateDataSourceOutput) 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 CreateDataSourceOutput) GoString() string { - return s.String() -} - -// SetDataSource sets the DataSource field's value. -func (s *CreateDataSourceOutput) SetDataSource(v *DataSource) *CreateDataSourceOutput { - s.DataSource = v - return s -} - -type CreateKnowledgeBaseInput struct { - _ struct{} `type:"structure"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string" idempotencyToken:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Configures a bedrock knowledge base. - // - // KnowledgeBaseConfiguration is a required field - KnowledgeBaseConfiguration *KnowledgeBaseConfiguration `locationName:"knowledgeBaseConfiguration" type:"structure" required:"true"` - - // Name for a resource. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // ARN of a IAM role. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // Configures the physical storage of ingested data in a knowledge base. - // - // StorageConfiguration is a required field - StorageConfiguration *StorageConfiguration `locationName:"storageConfiguration" type:"structure" required:"true"` - - // A map of tag keys and values - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateKnowledgeBaseInput) 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 CreateKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateKnowledgeBaseInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 33 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 33)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseConfiguration")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.StorageConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("StorageConfiguration")) - } - if s.KnowledgeBaseConfiguration != nil { - if err := s.KnowledgeBaseConfiguration.Validate(); err != nil { - invalidParams.AddNested("KnowledgeBaseConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.StorageConfiguration != nil { - if err := s.StorageConfiguration.Validate(); err != nil { - invalidParams.AddNested("StorageConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateKnowledgeBaseInput) SetClientToken(v string) *CreateKnowledgeBaseInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateKnowledgeBaseInput) SetDescription(v string) *CreateKnowledgeBaseInput { - s.Description = &v - return s -} - -// SetKnowledgeBaseConfiguration sets the KnowledgeBaseConfiguration field's value. -func (s *CreateKnowledgeBaseInput) SetKnowledgeBaseConfiguration(v *KnowledgeBaseConfiguration) *CreateKnowledgeBaseInput { - s.KnowledgeBaseConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateKnowledgeBaseInput) SetName(v string) *CreateKnowledgeBaseInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateKnowledgeBaseInput) SetRoleArn(v string) *CreateKnowledgeBaseInput { - s.RoleArn = &v - return s -} - -// SetStorageConfiguration sets the StorageConfiguration field's value. -func (s *CreateKnowledgeBaseInput) SetStorageConfiguration(v *StorageConfiguration) *CreateKnowledgeBaseInput { - s.StorageConfiguration = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateKnowledgeBaseInput) SetTags(v map[string]*string) *CreateKnowledgeBaseInput { - s.Tags = v - return s -} - -type CreateKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of a knowledge base. - // - // KnowledgeBase is a required field - KnowledgeBase *KnowledgeBase `locationName:"knowledgeBase" type:"structure" 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 CreateKnowledgeBaseOutput) 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 CreateKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBase sets the KnowledgeBase field's value. -func (s *CreateKnowledgeBaseOutput) SetKnowledgeBase(v *KnowledgeBase) *CreateKnowledgeBaseOutput { - s.KnowledgeBase = v - return s -} - -// Contains the information of a data source. -type DataSource struct { - _ struct{} `type:"structure"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Specifies a raw data source location to ingest. - // - // DataSourceConfiguration is a required field - DataSourceConfiguration *DataSourceConfiguration `locationName:"dataSourceConfiguration" type:"structure" required:"true"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Name for a resource. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // Server-side encryption configuration. - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // The status of a data source. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSourceStatus"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Configures ingestion for a vector knowledge base - VectorIngestionConfiguration *VectorIngestionConfiguration `locationName:"vectorIngestionConfiguration" 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 DataSource) 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 DataSource) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DataSource) SetCreatedAt(v time.Time) *DataSource { - s.CreatedAt = &v - return s -} - -// SetDataSourceConfiguration sets the DataSourceConfiguration field's value. -func (s *DataSource) SetDataSourceConfiguration(v *DataSourceConfiguration) *DataSource { - s.DataSourceConfiguration = v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DataSource) SetDataSourceId(v string) *DataSource { - s.DataSourceId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DataSource) SetDescription(v string) *DataSource { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DataSource) SetKnowledgeBaseId(v string) *DataSource { - s.KnowledgeBaseId = &v - return s -} - -// SetName sets the Name field's value. -func (s *DataSource) SetName(v string) *DataSource { - s.Name = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *DataSource) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *DataSource { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DataSource) SetStatus(v string) *DataSource { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DataSource) SetUpdatedAt(v time.Time) *DataSource { - s.UpdatedAt = &v - return s -} - -// SetVectorIngestionConfiguration sets the VectorIngestionConfiguration field's value. -func (s *DataSource) SetVectorIngestionConfiguration(v *VectorIngestionConfiguration) *DataSource { - s.VectorIngestionConfiguration = v - return s -} - -// Specifies a raw data source location to ingest. -type DataSourceConfiguration struct { - _ struct{} `type:"structure"` - - // Configures an S3 data source location. - S3Configuration *S3DataSourceConfiguration `locationName:"s3Configuration" type:"structure"` - - // The type of the data source location. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"DataSourceType"` -} - -// 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 DataSourceConfiguration) 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 DataSourceConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataSourceConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataSourceConfiguration"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.S3Configuration != nil { - if err := s.S3Configuration.Validate(); err != nil { - invalidParams.AddNested("S3Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Configuration sets the S3Configuration field's value. -func (s *DataSourceConfiguration) SetS3Configuration(v *S3DataSourceConfiguration) *DataSourceConfiguration { - s.S3Configuration = v - return s -} - -// SetType sets the Type field's value. -func (s *DataSourceConfiguration) SetType(v string) *DataSourceConfiguration { - s.Type = &v - return s -} - -// Summary information of a data source. -type DataSourceSummary struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Name for a resource. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The status of a data source. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSourceStatus"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 DataSourceSummary) 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 DataSourceSummary) GoString() string { - return s.String() -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DataSourceSummary) SetDataSourceId(v string) *DataSourceSummary { - s.DataSourceId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DataSourceSummary) SetDescription(v string) *DataSourceSummary { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DataSourceSummary) SetKnowledgeBaseId(v string) *DataSourceSummary { - s.KnowledgeBaseId = &v - return s -} - -// SetName sets the Name field's value. -func (s *DataSourceSummary) SetName(v string) *DataSourceSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DataSourceSummary) SetStatus(v string) *DataSourceSummary { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DataSourceSummary) SetUpdatedAt(v time.Time) *DataSourceSummary { - s.UpdatedAt = &v - return s -} - -// Delete Action Group Request -type DeleteAgentActionGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent ActionGroup is created - // - // ActionGroupId is a required field - ActionGroupId *string `location:"uri" locationName:"actionGroupId" type:"string" required:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Draft Version of the Agent. - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"5" type:"string" required:"true"` - - // Skips checking if resource is in use when set to true. Defaults to false - SkipResourceInUseCheck *bool `location:"querystring" locationName:"skipResourceInUseCheck" type:"boolean"` -} - -// 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 DeleteAgentActionGroupInput) 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 DeleteAgentActionGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAgentActionGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAgentActionGroupInput"} - if s.ActionGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("ActionGroupId")) - } - if s.ActionGroupId != nil && len(*s.ActionGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionGroupId", 1)) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 5 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionGroupId sets the ActionGroupId field's value. -func (s *DeleteAgentActionGroupInput) SetActionGroupId(v string) *DeleteAgentActionGroupInput { - s.ActionGroupId = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *DeleteAgentActionGroupInput) SetAgentId(v string) *DeleteAgentActionGroupInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *DeleteAgentActionGroupInput) SetAgentVersion(v string) *DeleteAgentActionGroupInput { - s.AgentVersion = &v - return s -} - -// SetSkipResourceInUseCheck sets the SkipResourceInUseCheck field's value. -func (s *DeleteAgentActionGroupInput) SetSkipResourceInUseCheck(v bool) *DeleteAgentActionGroupInput { - s.SkipResourceInUseCheck = &v - return s -} - -// Delete Action Group Response -type DeleteAgentActionGroupOutput 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 DeleteAgentActionGroupOutput) 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 DeleteAgentActionGroupOutput) GoString() string { - return s.String() -} - -// Delete Agent Alias Request -type DeleteAgentAliasInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent Alias is created - // - // AgentAliasId is a required field - AgentAliasId *string `location:"uri" locationName:"agentAliasId" min:"10" type:"string" required:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" 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 DeleteAgentAliasInput) 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 DeleteAgentAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAgentAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAgentAliasInput"} - if s.AgentAliasId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentAliasId")) - } - if s.AgentAliasId != nil && len(*s.AgentAliasId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("AgentAliasId", 10)) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentAliasId sets the AgentAliasId field's value. -func (s *DeleteAgentAliasInput) SetAgentAliasId(v string) *DeleteAgentAliasInput { - s.AgentAliasId = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *DeleteAgentAliasInput) SetAgentId(v string) *DeleteAgentAliasInput { - s.AgentId = &v - return s -} - -// Delete Agent Alias Response -type DeleteAgentAliasOutput struct { - _ struct{} `type:"structure"` - - // Id for an Agent Alias generated at the server side. - // - // AgentAliasId is a required field - AgentAliasId *string `locationName:"agentAliasId" min:"10" type:"string" required:"true"` - - // The statuses an Agent Alias can be in. - // - // AgentAliasStatus is a required field - AgentAliasStatus *string `locationName:"agentAliasStatus" type:"string" required:"true" enum:"AgentAliasStatus"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" 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 DeleteAgentAliasOutput) 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 DeleteAgentAliasOutput) GoString() string { - return s.String() -} - -// SetAgentAliasId sets the AgentAliasId field's value. -func (s *DeleteAgentAliasOutput) SetAgentAliasId(v string) *DeleteAgentAliasOutput { - s.AgentAliasId = &v - return s -} - -// SetAgentAliasStatus sets the AgentAliasStatus field's value. -func (s *DeleteAgentAliasOutput) SetAgentAliasStatus(v string) *DeleteAgentAliasOutput { - s.AgentAliasStatus = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *DeleteAgentAliasOutput) SetAgentId(v string) *DeleteAgentAliasOutput { - s.AgentId = &v - return s -} - -// Delete Agent Request -type DeleteAgentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Skips checking if resource is in use when set to true. Defaults to false - SkipResourceInUseCheck *bool `location:"querystring" locationName:"skipResourceInUseCheck" type:"boolean"` -} - -// 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 DeleteAgentInput) 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 DeleteAgentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAgentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAgentInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *DeleteAgentInput) SetAgentId(v string) *DeleteAgentInput { - s.AgentId = &v - return s -} - -// SetSkipResourceInUseCheck sets the SkipResourceInUseCheck field's value. -func (s *DeleteAgentInput) SetSkipResourceInUseCheck(v bool) *DeleteAgentInput { - s.SkipResourceInUseCheck = &v - return s -} - -// Delete Agent Response -type DeleteAgentOutput struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Schema Type for Action APIs. - // - // AgentStatus is a required field - AgentStatus *string `locationName:"agentStatus" type:"string" required:"true" enum:"AgentStatus"` -} - -// 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 DeleteAgentOutput) 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 DeleteAgentOutput) GoString() string { - return s.String() -} - -// SetAgentId sets the AgentId field's value. -func (s *DeleteAgentOutput) SetAgentId(v string) *DeleteAgentOutput { - s.AgentId = &v - return s -} - -// SetAgentStatus sets the AgentStatus field's value. -func (s *DeleteAgentOutput) SetAgentStatus(v string) *DeleteAgentOutput { - s.AgentStatus = &v - return s -} - -// Delete Agent Version Request -type DeleteAgentVersionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Numerical Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" type:"string" required:"true"` - - // Skips checking if resource is in use when set to true. Defaults to false - SkipResourceInUseCheck *bool `location:"querystring" locationName:"skipResourceInUseCheck" type:"boolean"` -} - -// 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 DeleteAgentVersionInput) 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 DeleteAgentVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAgentVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAgentVersionInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *DeleteAgentVersionInput) SetAgentId(v string) *DeleteAgentVersionInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *DeleteAgentVersionInput) SetAgentVersion(v string) *DeleteAgentVersionInput { - s.AgentVersion = &v - return s -} - -// SetSkipResourceInUseCheck sets the SkipResourceInUseCheck field's value. -func (s *DeleteAgentVersionInput) SetSkipResourceInUseCheck(v bool) *DeleteAgentVersionInput { - s.SkipResourceInUseCheck = &v - return s -} - -// Delete Agent Version Response -type DeleteAgentVersionOutput struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Schema Type for Action APIs. - // - // AgentStatus is a required field - AgentStatus *string `locationName:"agentStatus" type:"string" required:"true" enum:"AgentStatus"` - - // Numerical Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `locationName:"agentVersion" 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 DeleteAgentVersionOutput) 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 DeleteAgentVersionOutput) GoString() string { - return s.String() -} - -// SetAgentId sets the AgentId field's value. -func (s *DeleteAgentVersionOutput) SetAgentId(v string) *DeleteAgentVersionOutput { - s.AgentId = &v - return s -} - -// SetAgentStatus sets the AgentStatus field's value. -func (s *DeleteAgentVersionOutput) SetAgentStatus(v string) *DeleteAgentVersionOutput { - s.AgentStatus = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *DeleteAgentVersionOutput) SetAgentVersion(v string) *DeleteAgentVersionOutput { - s.AgentVersion = &v - return s -} - -type DeleteDataSourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" type:"string" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 DeleteDataSourceInput) 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 DeleteDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDataSourceInput"} - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DeleteDataSourceInput) SetDataSourceId(v string) *DeleteDataSourceInput { - s.DataSourceId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DeleteDataSourceInput) SetKnowledgeBaseId(v string) *DeleteDataSourceInput { - s.KnowledgeBaseId = &v - return s -} - -type DeleteDataSourceOutput struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The status of a data source. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSourceStatus"` -} - -// 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 DeleteDataSourceOutput) 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 DeleteDataSourceOutput) GoString() string { - return s.String() -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DeleteDataSourceOutput) SetDataSourceId(v string) *DeleteDataSourceOutput { - s.DataSourceId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DeleteDataSourceOutput) SetKnowledgeBaseId(v string) *DeleteDataSourceOutput { - s.KnowledgeBaseId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteDataSourceOutput) SetStatus(v string) *DeleteDataSourceOutput { - s.Status = &v - return s -} - -type DeleteKnowledgeBaseInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 DeleteKnowledgeBaseInput) 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 DeleteKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteKnowledgeBaseInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DeleteKnowledgeBaseInput) SetKnowledgeBaseId(v string) *DeleteKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -type DeleteKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The status of a knowledge base. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"KnowledgeBaseStatus"` -} - -// 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 DeleteKnowledgeBaseOutput) 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 DeleteKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DeleteKnowledgeBaseOutput) SetKnowledgeBaseId(v string) *DeleteKnowledgeBaseOutput { - s.KnowledgeBaseId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteKnowledgeBaseOutput) SetStatus(v string) *DeleteKnowledgeBaseOutput { - s.Status = &v - return s -} - -// Disassociate Agent Knowledge Base Request -type DisassociateAgentKnowledgeBaseInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Draft Version of the Agent. - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"5" type:"string" required:"true"` - - // Id generated at the server side when a Knowledge Base is associated to an - // Agent - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 DisassociateAgentKnowledgeBaseInput) 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 DisassociateAgentKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateAgentKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateAgentKnowledgeBaseInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 5 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 5)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *DisassociateAgentKnowledgeBaseInput) SetAgentId(v string) *DisassociateAgentKnowledgeBaseInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *DisassociateAgentKnowledgeBaseInput) SetAgentVersion(v string) *DisassociateAgentKnowledgeBaseInput { - s.AgentVersion = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DisassociateAgentKnowledgeBaseInput) SetKnowledgeBaseId(v string) *DisassociateAgentKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -// Disassociate Agent Knowledge Base Response -type DisassociateAgentKnowledgeBaseOutput 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 DisassociateAgentKnowledgeBaseOutput) 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 DisassociateAgentKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// Configures fixed size chunking strategy -type FixedSizeChunkingConfiguration struct { - _ struct{} `type:"structure"` - - // The maximum number of tokens per chunk. - // - // MaxTokens is a required field - MaxTokens *int64 `locationName:"maxTokens" min:"1" type:"integer" required:"true"` - - // The overlap percentage between adjacent chunks. - // - // OverlapPercentage is a required field - OverlapPercentage *int64 `locationName:"overlapPercentage" min:"1" type:"integer" 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 FixedSizeChunkingConfiguration) 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 FixedSizeChunkingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FixedSizeChunkingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FixedSizeChunkingConfiguration"} - if s.MaxTokens == nil { - invalidParams.Add(request.NewErrParamRequired("MaxTokens")) - } - if s.MaxTokens != nil && *s.MaxTokens < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxTokens", 1)) - } - if s.OverlapPercentage == nil { - invalidParams.Add(request.NewErrParamRequired("OverlapPercentage")) - } - if s.OverlapPercentage != nil && *s.OverlapPercentage < 1 { - invalidParams.Add(request.NewErrParamMinValue("OverlapPercentage", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxTokens sets the MaxTokens field's value. -func (s *FixedSizeChunkingConfiguration) SetMaxTokens(v int64) *FixedSizeChunkingConfiguration { - s.MaxTokens = &v - return s -} - -// SetOverlapPercentage sets the OverlapPercentage field's value. -func (s *FixedSizeChunkingConfiguration) SetOverlapPercentage(v int64) *FixedSizeChunkingConfiguration { - s.OverlapPercentage = &v - return s -} - -// Get Action Group Request -type GetAgentActionGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent Action Group is created - // - // ActionGroupId is a required field - ActionGroupId *string `location:"uri" locationName:"actionGroupId" type:"string" required:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Version number generated when a version is created - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"1" 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 GetAgentActionGroupInput) 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 GetAgentActionGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAgentActionGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAgentActionGroupInput"} - if s.ActionGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("ActionGroupId")) - } - if s.ActionGroupId != nil && len(*s.ActionGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionGroupId", 1)) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionGroupId sets the ActionGroupId field's value. -func (s *GetAgentActionGroupInput) SetActionGroupId(v string) *GetAgentActionGroupInput { - s.ActionGroupId = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *GetAgentActionGroupInput) SetAgentId(v string) *GetAgentActionGroupInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *GetAgentActionGroupInput) SetAgentVersion(v string) *GetAgentActionGroupInput { - s.AgentVersion = &v - return s -} - -// Get Action Group Response -type GetAgentActionGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an Agent Action Group - // - // AgentActionGroup is a required field - AgentActionGroup *AgentActionGroup `locationName:"agentActionGroup" type:"structure" 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 GetAgentActionGroupOutput) 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 GetAgentActionGroupOutput) GoString() string { - return s.String() -} - -// SetAgentActionGroup sets the AgentActionGroup field's value. -func (s *GetAgentActionGroupOutput) SetAgentActionGroup(v *AgentActionGroup) *GetAgentActionGroupOutput { - s.AgentActionGroup = v - return s -} - -// Get Agent Alias Request -type GetAgentAliasInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent Alias is created - // - // AgentAliasId is a required field - AgentAliasId *string `location:"uri" locationName:"agentAliasId" min:"10" type:"string" required:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" 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 GetAgentAliasInput) 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 GetAgentAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAgentAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAgentAliasInput"} - if s.AgentAliasId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentAliasId")) - } - if s.AgentAliasId != nil && len(*s.AgentAliasId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("AgentAliasId", 10)) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentAliasId sets the AgentAliasId field's value. -func (s *GetAgentAliasInput) SetAgentAliasId(v string) *GetAgentAliasInput { - s.AgentAliasId = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *GetAgentAliasInput) SetAgentId(v string) *GetAgentAliasInput { - s.AgentId = &v - return s -} - -// Get Agent Alias Response -type GetAgentAliasOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an agent alias - // - // AgentAlias is a required field - AgentAlias *AgentAlias `locationName:"agentAlias" type:"structure" 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 GetAgentAliasOutput) 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 GetAgentAliasOutput) GoString() string { - return s.String() -} - -// SetAgentAlias sets the AgentAlias field's value. -func (s *GetAgentAliasOutput) SetAgentAlias(v *AgentAlias) *GetAgentAliasOutput { - s.AgentAlias = v - return s -} - -// Get Agent Request -type GetAgentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" 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 GetAgentInput) 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 GetAgentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAgentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAgentInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *GetAgentInput) SetAgentId(v string) *GetAgentInput { - s.AgentId = &v - return s -} - -// Get Agent Knowledge Base Request -type GetAgentKnowledgeBaseInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Version number generated when a version is created - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"1" type:"string" required:"true"` - - // Id generated at the server side when a Knowledge Base is associated - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 GetAgentKnowledgeBaseInput) 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 GetAgentKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAgentKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAgentKnowledgeBaseInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *GetAgentKnowledgeBaseInput) SetAgentId(v string) *GetAgentKnowledgeBaseInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *GetAgentKnowledgeBaseInput) SetAgentVersion(v string) *GetAgentKnowledgeBaseInput { - s.AgentVersion = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetAgentKnowledgeBaseInput) SetKnowledgeBaseId(v string) *GetAgentKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -// Get Agent Knowledge Base Response -type GetAgentKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an Agent Knowledge Base. - // - // AgentKnowledgeBase is a required field - AgentKnowledgeBase *AgentKnowledgeBase `locationName:"agentKnowledgeBase" type:"structure" 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 GetAgentKnowledgeBaseOutput) 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 GetAgentKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetAgentKnowledgeBase sets the AgentKnowledgeBase field's value. -func (s *GetAgentKnowledgeBaseOutput) SetAgentKnowledgeBase(v *AgentKnowledgeBase) *GetAgentKnowledgeBaseOutput { - s.AgentKnowledgeBase = v - return s -} - -// Get Agent Response -type GetAgentOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an agent - // - // Agent is a required field - Agent *Agent `locationName:"agent" type:"structure" 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 GetAgentOutput) 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 GetAgentOutput) GoString() string { - return s.String() -} - -// SetAgent sets the Agent field's value. -func (s *GetAgentOutput) SetAgent(v *Agent) *GetAgentOutput { - s.Agent = v - return s -} - -// Get Agent Version Request -type GetAgentVersionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Numerical Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" 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 GetAgentVersionInput) 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 GetAgentVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAgentVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAgentVersionInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *GetAgentVersionInput) SetAgentId(v string) *GetAgentVersionInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *GetAgentVersionInput) SetAgentVersion(v string) *GetAgentVersionInput { - s.AgentVersion = &v - return s -} - -// Get Agent Version Response -type GetAgentVersionOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an agent version. - // - // AgentVersion is a required field - AgentVersion *AgentVersion `locationName:"agentVersion" type:"structure" 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 GetAgentVersionOutput) 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 GetAgentVersionOutput) GoString() string { - return s.String() -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *GetAgentVersionOutput) SetAgentVersion(v *AgentVersion) *GetAgentVersionOutput { - s.AgentVersion = v - return s -} - -type GetDataSourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" type:"string" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 GetDataSourceInput) 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 GetDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataSourceInput"} - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *GetDataSourceInput) SetDataSourceId(v string) *GetDataSourceInput { - s.DataSourceId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetDataSourceInput) SetKnowledgeBaseId(v string) *GetDataSourceInput { - s.KnowledgeBaseId = &v - return s -} - -type GetDataSourceOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of a data source. - // - // DataSource is a required field - DataSource *DataSource `locationName:"dataSource" type:"structure" 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 GetDataSourceOutput) 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 GetDataSourceOutput) GoString() string { - return s.String() -} - -// SetDataSource sets the DataSource field's value. -func (s *GetDataSourceOutput) SetDataSource(v *DataSource) *GetDataSourceOutput { - s.DataSource = v - return s -} - -type GetIngestionJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" type:"string" required:"true"` - - // Identifier for a resource. - // - // IngestionJobId is a required field - IngestionJobId *string `location:"uri" locationName:"ingestionJobId" type:"string" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 GetIngestionJobInput) 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 GetIngestionJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIngestionJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIngestionJobInput"} - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) - } - if s.IngestionJobId == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionJobId")) - } - if s.IngestionJobId != nil && len(*s.IngestionJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IngestionJobId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *GetIngestionJobInput) SetDataSourceId(v string) *GetIngestionJobInput { - s.DataSourceId = &v - return s -} - -// SetIngestionJobId sets the IngestionJobId field's value. -func (s *GetIngestionJobInput) SetIngestionJobId(v string) *GetIngestionJobInput { - s.IngestionJobId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetIngestionJobInput) SetKnowledgeBaseId(v string) *GetIngestionJobInput { - s.KnowledgeBaseId = &v - return s -} - -type GetIngestionJobOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an ingestion job. - // - // IngestionJob is a required field - IngestionJob *IngestionJob `locationName:"ingestionJob" type:"structure" 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 GetIngestionJobOutput) 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 GetIngestionJobOutput) GoString() string { - return s.String() -} - -// SetIngestionJob sets the IngestionJob field's value. -func (s *GetIngestionJobOutput) SetIngestionJob(v *IngestionJob) *GetIngestionJobOutput { - s.IngestionJob = v - return s -} - -type GetKnowledgeBaseInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 GetKnowledgeBaseInput) 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 GetKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetKnowledgeBaseInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetKnowledgeBaseInput) SetKnowledgeBaseId(v string) *GetKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -type GetKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of a knowledge base. - // - // KnowledgeBase is a required field - KnowledgeBase *KnowledgeBase `locationName:"knowledgeBase" type:"structure" 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 GetKnowledgeBaseOutput) 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 GetKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBase sets the KnowledgeBase field's value. -func (s *GetKnowledgeBaseOutput) SetKnowledgeBase(v *KnowledgeBase) *GetKnowledgeBaseOutput { - s.KnowledgeBase = v - return s -} - -// Configuration for inference in prompt configuration -type InferenceConfiguration struct { - _ struct{} `type:"structure"` - - // Maximum length of output - MaximumLength *int64 `locationName:"maximumLength" type:"integer"` - - // List of stop sequences - StopSequences []*string `locationName:"stopSequences" type:"list"` - - // Controls randomness, higher values increase diversity - Temperature *float64 `locationName:"temperature" type:"float"` - - // Sample from the k most likely next tokens - TopK *int64 `locationName:"topK" type:"integer"` - - // Cumulative probability cutoff for token selection - TopP *float64 `locationName:"topP" type:"float"` -} - -// 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 InferenceConfiguration) 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 InferenceConfiguration) GoString() string { - return s.String() -} - -// SetMaximumLength sets the MaximumLength field's value. -func (s *InferenceConfiguration) SetMaximumLength(v int64) *InferenceConfiguration { - s.MaximumLength = &v - return s -} - -// SetStopSequences sets the StopSequences field's value. -func (s *InferenceConfiguration) SetStopSequences(v []*string) *InferenceConfiguration { - s.StopSequences = v - return s -} - -// SetTemperature sets the Temperature field's value. -func (s *InferenceConfiguration) SetTemperature(v float64) *InferenceConfiguration { - s.Temperature = &v - return s -} - -// SetTopK sets the TopK field's value. -func (s *InferenceConfiguration) SetTopK(v int64) *InferenceConfiguration { - s.TopK = &v - return s -} - -// SetTopP sets the TopP field's value. -func (s *InferenceConfiguration) SetTopP(v float64) *InferenceConfiguration { - s.TopP = &v - return s -} - -// Contains the information of an ingestion job. -type IngestionJob struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Failure Reasons for Error. - FailureReasons []*string `locationName:"failureReasons" type:"list"` - - // Identifier for a resource. - // - // IngestionJobId is a required field - IngestionJobId *string `locationName:"ingestionJobId" type:"string" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Time Stamp. - // - // StartedAt is a required field - StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The document level statistics of an ingestion job - Statistics *IngestionJobStatistics `locationName:"statistics" type:"structure"` - - // The status of an ingestion job. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"IngestionJobStatus"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 IngestionJob) 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 IngestionJob) GoString() string { - return s.String() -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *IngestionJob) SetDataSourceId(v string) *IngestionJob { - s.DataSourceId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *IngestionJob) SetDescription(v string) *IngestionJob { - s.Description = &v - return s -} - -// SetFailureReasons sets the FailureReasons field's value. -func (s *IngestionJob) SetFailureReasons(v []*string) *IngestionJob { - s.FailureReasons = v - return s -} - -// SetIngestionJobId sets the IngestionJobId field's value. -func (s *IngestionJob) SetIngestionJobId(v string) *IngestionJob { - s.IngestionJobId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *IngestionJob) SetKnowledgeBaseId(v string) *IngestionJob { - s.KnowledgeBaseId = &v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *IngestionJob) SetStartedAt(v time.Time) *IngestionJob { - s.StartedAt = &v - return s -} - -// SetStatistics sets the Statistics field's value. -func (s *IngestionJob) SetStatistics(v *IngestionJobStatistics) *IngestionJob { - s.Statistics = v - return s -} - -// SetStatus sets the Status field's value. -func (s *IngestionJob) SetStatus(v string) *IngestionJob { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *IngestionJob) SetUpdatedAt(v time.Time) *IngestionJob { - s.UpdatedAt = &v - return s -} - -// Filters the response returned by ListIngestionJobs operation. -type IngestionJobFilter struct { - _ struct{} `type:"structure"` - - // The name of the field to filter ingestion jobs. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"IngestionJobFilterAttribute"` - - // The operator used to filter ingestion jobs. - // - // Operator is a required field - Operator *string `locationName:"operator" type:"string" required:"true" enum:"IngestionJobFilterOperator"` - - // The list of values used to filter ingestion jobs. - // - // Values is a required field - Values []*string `locationName:"values" type:"list" 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 IngestionJobFilter) 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 IngestionJobFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IngestionJobFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IngestionJobFilter"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.Operator == nil { - invalidParams.Add(request.NewErrParamRequired("Operator")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *IngestionJobFilter) SetAttribute(v string) *IngestionJobFilter { - s.Attribute = &v - return s -} - -// SetOperator sets the Operator field's value. -func (s *IngestionJobFilter) SetOperator(v string) *IngestionJobFilter { - s.Operator = &v - return s -} - -// SetValues sets the Values field's value. -func (s *IngestionJobFilter) SetValues(v []*string) *IngestionJobFilter { - s.Values = v - return s -} - -// Sorts the response returned by ListIngestionJobs operation. -type IngestionJobSortBy struct { - _ struct{} `type:"structure"` - - // The name of the field to sort ingestion jobs. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"IngestionJobSortByAttribute"` - - // Order to sort results by. - // - // Order is a required field - Order *string `locationName:"order" type:"string" required:"true" enum:"SortOrder"` -} - -// 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 IngestionJobSortBy) 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 IngestionJobSortBy) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IngestionJobSortBy) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IngestionJobSortBy"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.Order == nil { - invalidParams.Add(request.NewErrParamRequired("Order")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *IngestionJobSortBy) SetAttribute(v string) *IngestionJobSortBy { - s.Attribute = &v - return s -} - -// SetOrder sets the Order field's value. -func (s *IngestionJobSortBy) SetOrder(v string) *IngestionJobSortBy { - s.Order = &v - return s -} - -// The document level statistics of an ingestion job -type IngestionJobStatistics struct { - _ struct{} `type:"structure"` - - // Number of deleted documents - NumberOfDocumentsDeleted *int64 `locationName:"numberOfDocumentsDeleted" type:"long"` - - // Number of failed documents - NumberOfDocumentsFailed *int64 `locationName:"numberOfDocumentsFailed" type:"long"` - - // Number of scanned documents - NumberOfDocumentsScanned *int64 `locationName:"numberOfDocumentsScanned" type:"long"` - - // Number of modified documents indexed - NumberOfModifiedDocumentsIndexed *int64 `locationName:"numberOfModifiedDocumentsIndexed" type:"long"` - - // Number of indexed documents - NumberOfNewDocumentsIndexed *int64 `locationName:"numberOfNewDocumentsIndexed" type:"long"` -} - -// 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 IngestionJobStatistics) 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 IngestionJobStatistics) GoString() string { - return s.String() -} - -// SetNumberOfDocumentsDeleted sets the NumberOfDocumentsDeleted field's value. -func (s *IngestionJobStatistics) SetNumberOfDocumentsDeleted(v int64) *IngestionJobStatistics { - s.NumberOfDocumentsDeleted = &v - return s -} - -// SetNumberOfDocumentsFailed sets the NumberOfDocumentsFailed field's value. -func (s *IngestionJobStatistics) SetNumberOfDocumentsFailed(v int64) *IngestionJobStatistics { - s.NumberOfDocumentsFailed = &v - return s -} - -// SetNumberOfDocumentsScanned sets the NumberOfDocumentsScanned field's value. -func (s *IngestionJobStatistics) SetNumberOfDocumentsScanned(v int64) *IngestionJobStatistics { - s.NumberOfDocumentsScanned = &v - return s -} - -// SetNumberOfModifiedDocumentsIndexed sets the NumberOfModifiedDocumentsIndexed field's value. -func (s *IngestionJobStatistics) SetNumberOfModifiedDocumentsIndexed(v int64) *IngestionJobStatistics { - s.NumberOfModifiedDocumentsIndexed = &v - return s -} - -// SetNumberOfNewDocumentsIndexed sets the NumberOfNewDocumentsIndexed field's value. -func (s *IngestionJobStatistics) SetNumberOfNewDocumentsIndexed(v int64) *IngestionJobStatistics { - s.NumberOfNewDocumentsIndexed = &v - return s -} - -// Summary information of an ingestion job. -type IngestionJobSummary struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Identifier for a resource. - // - // IngestionJobId is a required field - IngestionJobId *string `locationName:"ingestionJobId" type:"string" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Time Stamp. - // - // StartedAt is a required field - StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The document level statistics of an ingestion job - Statistics *IngestionJobStatistics `locationName:"statistics" type:"structure"` - - // The status of an ingestion job. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"IngestionJobStatus"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 IngestionJobSummary) 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 IngestionJobSummary) GoString() string { - return s.String() -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *IngestionJobSummary) SetDataSourceId(v string) *IngestionJobSummary { - s.DataSourceId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *IngestionJobSummary) SetDescription(v string) *IngestionJobSummary { - s.Description = &v - return s -} - -// SetIngestionJobId sets the IngestionJobId field's value. -func (s *IngestionJobSummary) SetIngestionJobId(v string) *IngestionJobSummary { - s.IngestionJobId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *IngestionJobSummary) SetKnowledgeBaseId(v string) *IngestionJobSummary { - s.KnowledgeBaseId = &v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *IngestionJobSummary) SetStartedAt(v time.Time) *IngestionJobSummary { - s.StartedAt = &v - return s -} - -// SetStatistics sets the Statistics field's value. -func (s *IngestionJobSummary) SetStatistics(v *IngestionJobStatistics) *IngestionJobSummary { - s.Statistics = v - return s -} - -// SetStatus sets the Status field's value. -func (s *IngestionJobSummary) SetStatus(v string) *IngestionJobSummary { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *IngestionJobSummary) SetUpdatedAt(v time.Time) *IngestionJobSummary { - s.UpdatedAt = &v - return s -} - -// This exception is thrown if there was an unexpected error during processing -// of request -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains the information of a knowledge base. -type KnowledgeBase struct { - _ struct{} `type:"structure"` - - // Time Stamp. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Failure Reasons for Error. - FailureReasons []*string `locationName:"failureReasons" type:"list"` - - // ARN of a KnowledgeBase - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // Configures a bedrock knowledge base. - // - // KnowledgeBaseConfiguration is a required field - KnowledgeBaseConfiguration *KnowledgeBaseConfiguration `locationName:"knowledgeBaseConfiguration" type:"structure" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Name for a resource. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // ARN of a IAM role. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The status of a knowledge base. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"KnowledgeBaseStatus"` - - // Configures the physical storage of ingested data in a knowledge base. - // - // StorageConfiguration is a required field - StorageConfiguration *StorageConfiguration `locationName:"storageConfiguration" type:"structure" required:"true"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 KnowledgeBase) 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 KnowledgeBase) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *KnowledgeBase) SetCreatedAt(v time.Time) *KnowledgeBase { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *KnowledgeBase) SetDescription(v string) *KnowledgeBase { - s.Description = &v - return s -} - -// SetFailureReasons sets the FailureReasons field's value. -func (s *KnowledgeBase) SetFailureReasons(v []*string) *KnowledgeBase { - s.FailureReasons = v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *KnowledgeBase) SetKnowledgeBaseArn(v string) *KnowledgeBase { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseConfiguration sets the KnowledgeBaseConfiguration field's value. -func (s *KnowledgeBase) SetKnowledgeBaseConfiguration(v *KnowledgeBaseConfiguration) *KnowledgeBase { - s.KnowledgeBaseConfiguration = v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *KnowledgeBase) SetKnowledgeBaseId(v string) *KnowledgeBase { - s.KnowledgeBaseId = &v - return s -} - -// SetName sets the Name field's value. -func (s *KnowledgeBase) SetName(v string) *KnowledgeBase { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *KnowledgeBase) SetRoleArn(v string) *KnowledgeBase { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *KnowledgeBase) SetStatus(v string) *KnowledgeBase { - s.Status = &v - return s -} - -// SetStorageConfiguration sets the StorageConfiguration field's value. -func (s *KnowledgeBase) SetStorageConfiguration(v *StorageConfiguration) *KnowledgeBase { - s.StorageConfiguration = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *KnowledgeBase) SetUpdatedAt(v time.Time) *KnowledgeBase { - s.UpdatedAt = &v - return s -} - -// Configures a bedrock knowledge base. -type KnowledgeBaseConfiguration struct { - _ struct{} `type:"structure"` - - // The type of a knowledge base. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"KnowledgeBaseType"` - - // Configurations for a vector knowledge base. - VectorKnowledgeBaseConfiguration *VectorKnowledgeBaseConfiguration `locationName:"vectorKnowledgeBaseConfiguration" 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 KnowledgeBaseConfiguration) 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 KnowledgeBaseConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KnowledgeBaseConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KnowledgeBaseConfiguration"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.VectorKnowledgeBaseConfiguration != nil { - if err := s.VectorKnowledgeBaseConfiguration.Validate(); err != nil { - invalidParams.AddNested("VectorKnowledgeBaseConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetType sets the Type field's value. -func (s *KnowledgeBaseConfiguration) SetType(v string) *KnowledgeBaseConfiguration { - s.Type = &v - return s -} - -// SetVectorKnowledgeBaseConfiguration sets the VectorKnowledgeBaseConfiguration field's value. -func (s *KnowledgeBaseConfiguration) SetVectorKnowledgeBaseConfiguration(v *VectorKnowledgeBaseConfiguration) *KnowledgeBaseConfiguration { - s.VectorKnowledgeBaseConfiguration = v - return s -} - -// Summary information of a knowledge base. -type KnowledgeBaseSummary struct { - _ struct{} `type:"structure"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Name for a resource. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The status of a knowledge base. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"KnowledgeBaseStatus"` - - // Time Stamp. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 KnowledgeBaseSummary) 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 KnowledgeBaseSummary) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *KnowledgeBaseSummary) SetDescription(v string) *KnowledgeBaseSummary { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *KnowledgeBaseSummary) SetKnowledgeBaseId(v string) *KnowledgeBaseSummary { - s.KnowledgeBaseId = &v - return s -} - -// SetName sets the Name field's value. -func (s *KnowledgeBaseSummary) SetName(v string) *KnowledgeBaseSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *KnowledgeBaseSummary) SetStatus(v string) *KnowledgeBaseSummary { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *KnowledgeBaseSummary) SetUpdatedAt(v time.Time) *KnowledgeBaseSummary { - s.UpdatedAt = &v - return s -} - -// List Action Groups Request -type ListAgentActionGroupsInput struct { - _ struct{} `type:"structure"` - - // Id generated at the server side when an Agent is Listed - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Id generated at the server side when an Agent is Listed - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"1" type:"string" required:"true"` - - // Max Results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentActionGroupsInput) 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 ListAgentActionGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAgentActionGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAgentActionGroupsInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *ListAgentActionGroupsInput) SetAgentId(v string) *ListAgentActionGroupsInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *ListAgentActionGroupsInput) SetAgentVersion(v string) *ListAgentActionGroupsInput { - s.AgentVersion = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAgentActionGroupsInput) SetMaxResults(v int64) *ListAgentActionGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentActionGroupsInput) SetNextToken(v string) *ListAgentActionGroupsInput { - s.NextToken = &v - return s -} - -// List Action Groups Response -type ListAgentActionGroupsOutput struct { - _ struct{} `type:"structure"` - - // List of ActionGroup Summaries - // - // ActionGroupSummaries is a required field - ActionGroupSummaries []*ActionGroupSummary `locationName:"actionGroupSummaries" type:"list" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentActionGroupsOutput) 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 ListAgentActionGroupsOutput) GoString() string { - return s.String() -} - -// SetActionGroupSummaries sets the ActionGroupSummaries field's value. -func (s *ListAgentActionGroupsOutput) SetActionGroupSummaries(v []*ActionGroupSummary) *ListAgentActionGroupsOutput { - s.ActionGroupSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentActionGroupsOutput) SetNextToken(v string) *ListAgentActionGroupsOutput { - s.NextToken = &v - return s -} - -// List Agent Aliases Request -type ListAgentAliasesInput struct { - _ struct{} `type:"structure"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Max Results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentAliasesInput) 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 ListAgentAliasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAgentAliasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAgentAliasesInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *ListAgentAliasesInput) SetAgentId(v string) *ListAgentAliasesInput { - s.AgentId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAgentAliasesInput) SetMaxResults(v int64) *ListAgentAliasesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentAliasesInput) SetNextToken(v string) *ListAgentAliasesInput { - s.NextToken = &v - return s -} - -// List Agent Aliases Response -type ListAgentAliasesOutput struct { - _ struct{} `type:"structure"` - - // The list of summaries of all the aliases for an Agent. - // - // AgentAliasSummaries is a required field - AgentAliasSummaries []*AgentAliasSummary `locationName:"agentAliasSummaries" type:"list" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentAliasesOutput) 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 ListAgentAliasesOutput) GoString() string { - return s.String() -} - -// SetAgentAliasSummaries sets the AgentAliasSummaries field's value. -func (s *ListAgentAliasesOutput) SetAgentAliasSummaries(v []*AgentAliasSummary) *ListAgentAliasesOutput { - s.AgentAliasSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentAliasesOutput) SetNextToken(v string) *ListAgentAliasesOutput { - s.NextToken = &v - return s -} - -// List Agent Knowledge Bases Request -type ListAgentKnowledgeBasesInput struct { - _ struct{} `type:"structure"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Version number generated when a version is created - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"1" type:"string" required:"true"` - - // Max Results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentKnowledgeBasesInput) 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 ListAgentKnowledgeBasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAgentKnowledgeBasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAgentKnowledgeBasesInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *ListAgentKnowledgeBasesInput) SetAgentId(v string) *ListAgentKnowledgeBasesInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *ListAgentKnowledgeBasesInput) SetAgentVersion(v string) *ListAgentKnowledgeBasesInput { - s.AgentVersion = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAgentKnowledgeBasesInput) SetMaxResults(v int64) *ListAgentKnowledgeBasesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentKnowledgeBasesInput) SetNextToken(v string) *ListAgentKnowledgeBasesInput { - s.NextToken = &v - return s -} - -// List Agent Knowledge Bases Response -type ListAgentKnowledgeBasesOutput struct { - _ struct{} `type:"structure"` - - // List of Agent Knowledge Base Summaries - // - // AgentKnowledgeBaseSummaries is a required field - AgentKnowledgeBaseSummaries []*AgentKnowledgeBaseSummary `locationName:"agentKnowledgeBaseSummaries" type:"list" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentKnowledgeBasesOutput) 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 ListAgentKnowledgeBasesOutput) GoString() string { - return s.String() -} - -// SetAgentKnowledgeBaseSummaries sets the AgentKnowledgeBaseSummaries field's value. -func (s *ListAgentKnowledgeBasesOutput) SetAgentKnowledgeBaseSummaries(v []*AgentKnowledgeBaseSummary) *ListAgentKnowledgeBasesOutput { - s.AgentKnowledgeBaseSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentKnowledgeBasesOutput) SetNextToken(v string) *ListAgentKnowledgeBasesOutput { - s.NextToken = &v - return s -} - -// List Agent Versions Request -type ListAgentVersionsInput struct { - _ struct{} `type:"structure"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Max Results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentVersionsInput) 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 ListAgentVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAgentVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAgentVersionsInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *ListAgentVersionsInput) SetAgentId(v string) *ListAgentVersionsInput { - s.AgentId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAgentVersionsInput) SetMaxResults(v int64) *ListAgentVersionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentVersionsInput) SetNextToken(v string) *ListAgentVersionsInput { - s.NextToken = &v - return s -} - -// List Agent Versions Response -type ListAgentVersionsOutput struct { - _ struct{} `type:"structure"` - - // List of AgentVersionSummary. - // - // AgentVersionSummaries is a required field - AgentVersionSummaries []*AgentVersionSummary `locationName:"agentVersionSummaries" type:"list" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentVersionsOutput) 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 ListAgentVersionsOutput) GoString() string { - return s.String() -} - -// SetAgentVersionSummaries sets the AgentVersionSummaries field's value. -func (s *ListAgentVersionsOutput) SetAgentVersionSummaries(v []*AgentVersionSummary) *ListAgentVersionsOutput { - s.AgentVersionSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentVersionsOutput) SetNextToken(v string) *ListAgentVersionsOutput { - s.NextToken = &v - return s -} - -// List Agent Request -type ListAgentsInput struct { - _ struct{} `type:"structure"` - - // Max Results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentsInput) 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 ListAgentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAgentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAgentsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAgentsInput) SetMaxResults(v int64) *ListAgentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentsInput) SetNextToken(v string) *ListAgentsInput { - s.NextToken = &v - return s -} - -// List Agent Response -type ListAgentsOutput struct { - _ struct{} `type:"structure"` - - // List of AgentSummary. - // - // AgentSummaries is a required field - AgentSummaries []*AgentSummary `locationName:"agentSummaries" type:"list" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAgentsOutput) 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 ListAgentsOutput) GoString() string { - return s.String() -} - -// SetAgentSummaries sets the AgentSummaries field's value. -func (s *ListAgentsOutput) SetAgentSummaries(v []*AgentSummary) *ListAgentsOutput { - s.AgentSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAgentsOutput) SetNextToken(v string) *ListAgentsOutput { - s.NextToken = &v - return s -} - -type ListDataSourcesInput struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Max Results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDataSourcesInput) 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 ListDataSourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataSourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataSourcesInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ListDataSourcesInput) SetKnowledgeBaseId(v string) *ListDataSourcesInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataSourcesInput) SetMaxResults(v int64) *ListDataSourcesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourcesInput) SetNextToken(v string) *ListDataSourcesInput { - s.NextToken = &v - return s -} - -type ListDataSourcesOutput struct { - _ struct{} `type:"structure"` - - // list of data source summaries - // - // DataSourceSummaries is a required field - DataSourceSummaries []*DataSourceSummary `locationName:"dataSourceSummaries" type:"list" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDataSourcesOutput) 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 ListDataSourcesOutput) GoString() string { - return s.String() -} - -// SetDataSourceSummaries sets the DataSourceSummaries field's value. -func (s *ListDataSourcesOutput) SetDataSourceSummaries(v []*DataSourceSummary) *ListDataSourcesOutput { - s.DataSourceSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourcesOutput) SetNextToken(v string) *ListDataSourcesOutput { - s.NextToken = &v - return s -} - -type ListIngestionJobsInput struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" type:"string" required:"true"` - - // List of IngestionJobFilters - Filters []*IngestionJobFilter `locationName:"filters" min:"1" type:"list"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Max Results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Sorts the response returned by ListIngestionJobs operation. - SortBy *IngestionJobSortBy `locationName:"sortBy" 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 ListIngestionJobsInput) 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 ListIngestionJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIngestionJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIngestionJobsInput"} - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) - } - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SortBy != nil { - if err := s.SortBy.Validate(); err != nil { - invalidParams.AddNested("SortBy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *ListIngestionJobsInput) SetDataSourceId(v string) *ListIngestionJobsInput { - s.DataSourceId = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *ListIngestionJobsInput) SetFilters(v []*IngestionJobFilter) *ListIngestionJobsInput { - s.Filters = v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ListIngestionJobsInput) SetKnowledgeBaseId(v string) *ListIngestionJobsInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIngestionJobsInput) SetMaxResults(v int64) *ListIngestionJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIngestionJobsInput) SetNextToken(v string) *ListIngestionJobsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListIngestionJobsInput) SetSortBy(v *IngestionJobSortBy) *ListIngestionJobsInput { - s.SortBy = v - return s -} - -type ListIngestionJobsOutput struct { - _ struct{} `type:"structure"` - - // List of IngestionJobSummaries - // - // IngestionJobSummaries is a required field - IngestionJobSummaries []*IngestionJobSummary `locationName:"ingestionJobSummaries" type:"list" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListIngestionJobsOutput) 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 ListIngestionJobsOutput) GoString() string { - return s.String() -} - -// SetIngestionJobSummaries sets the IngestionJobSummaries field's value. -func (s *ListIngestionJobsOutput) SetIngestionJobSummaries(v []*IngestionJobSummary) *ListIngestionJobsOutput { - s.IngestionJobSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIngestionJobsOutput) SetNextToken(v string) *ListIngestionJobsOutput { - s.NextToken = &v - return s -} - -type ListKnowledgeBasesInput struct { - _ struct{} `type:"structure"` - - // Max Results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListKnowledgeBasesInput) 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 ListKnowledgeBasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListKnowledgeBasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListKnowledgeBasesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListKnowledgeBasesInput) SetMaxResults(v int64) *ListKnowledgeBasesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListKnowledgeBasesInput) SetNextToken(v string) *ListKnowledgeBasesInput { - s.NextToken = &v - return s -} - -type ListKnowledgeBasesOutput struct { - _ struct{} `type:"structure"` - - // List of KnowledgeBaseSummaries - // - // KnowledgeBaseSummaries is a required field - KnowledgeBaseSummaries []*KnowledgeBaseSummary `locationName:"knowledgeBaseSummaries" type:"list" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" 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 ListKnowledgeBasesOutput) 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 ListKnowledgeBasesOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBaseSummaries sets the KnowledgeBaseSummaries field's value. -func (s *ListKnowledgeBasesOutput) SetKnowledgeBaseSummaries(v []*KnowledgeBaseSummary) *ListKnowledgeBasesOutput { - s.KnowledgeBaseSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListKnowledgeBasesOutput) SetNextToken(v string) *ListKnowledgeBasesOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base] - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A map of tag keys and values - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Contains the configurations to use OpenSearch Serverless to store knowledge -// base data. -type OpenSearchServerlessConfiguration struct { - _ struct{} `type:"structure"` - - // Arn of an OpenSearch Serverless collection. - // - // CollectionArn is a required field - CollectionArn *string `locationName:"collectionArn" type:"string" required:"true"` - - // A mapping of Bedrock Knowledge Base fields to OpenSearch Serverless field - // names - // - // FieldMapping is a required field - FieldMapping *OpenSearchServerlessFieldMapping `locationName:"fieldMapping" type:"structure" required:"true"` - - // Arn of an OpenSearch Serverless index. - // - // VectorIndexName is a required field - VectorIndexName *string `locationName:"vectorIndexName" 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 OpenSearchServerlessConfiguration) 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 OpenSearchServerlessConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OpenSearchServerlessConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OpenSearchServerlessConfiguration"} - if s.CollectionArn == nil { - invalidParams.Add(request.NewErrParamRequired("CollectionArn")) - } - if s.FieldMapping == nil { - invalidParams.Add(request.NewErrParamRequired("FieldMapping")) - } - if s.VectorIndexName == nil { - invalidParams.Add(request.NewErrParamRequired("VectorIndexName")) - } - if s.FieldMapping != nil { - if err := s.FieldMapping.Validate(); err != nil { - invalidParams.AddNested("FieldMapping", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollectionArn sets the CollectionArn field's value. -func (s *OpenSearchServerlessConfiguration) SetCollectionArn(v string) *OpenSearchServerlessConfiguration { - s.CollectionArn = &v - return s -} - -// SetFieldMapping sets the FieldMapping field's value. -func (s *OpenSearchServerlessConfiguration) SetFieldMapping(v *OpenSearchServerlessFieldMapping) *OpenSearchServerlessConfiguration { - s.FieldMapping = v - return s -} - -// SetVectorIndexName sets the VectorIndexName field's value. -func (s *OpenSearchServerlessConfiguration) SetVectorIndexName(v string) *OpenSearchServerlessConfiguration { - s.VectorIndexName = &v - return s -} - -// A mapping of Bedrock Knowledge Base fields to OpenSearch Serverless field -// names -type OpenSearchServerlessFieldMapping struct { - _ struct{} `type:"structure"` - - // Name of the field - // - // MetadataField is a required field - MetadataField *string `locationName:"metadataField" type:"string" required:"true"` - - // Name of the field - // - // TextField is a required field - TextField *string `locationName:"textField" type:"string" required:"true"` - - // Name of the field - // - // VectorField is a required field - VectorField *string `locationName:"vectorField" 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 OpenSearchServerlessFieldMapping) 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 OpenSearchServerlessFieldMapping) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OpenSearchServerlessFieldMapping) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OpenSearchServerlessFieldMapping"} - if s.MetadataField == nil { - invalidParams.Add(request.NewErrParamRequired("MetadataField")) - } - if s.TextField == nil { - invalidParams.Add(request.NewErrParamRequired("TextField")) - } - if s.VectorField == nil { - invalidParams.Add(request.NewErrParamRequired("VectorField")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetadataField sets the MetadataField field's value. -func (s *OpenSearchServerlessFieldMapping) SetMetadataField(v string) *OpenSearchServerlessFieldMapping { - s.MetadataField = &v - return s -} - -// SetTextField sets the TextField field's value. -func (s *OpenSearchServerlessFieldMapping) SetTextField(v string) *OpenSearchServerlessFieldMapping { - s.TextField = &v - return s -} - -// SetVectorField sets the VectorField field's value. -func (s *OpenSearchServerlessFieldMapping) SetVectorField(v string) *OpenSearchServerlessFieldMapping { - s.VectorField = &v - return s -} - -// Contains the configurations to use Pinecone to store knowledge base data. -type PineconeConfiguration struct { - _ struct{} `type:"structure"` - - // Pinecone connection string - // - // ConnectionString is a required field - ConnectionString *string `locationName:"connectionString" type:"string" required:"true"` - - // Arn of a SecretsManager Secret. - // - // CredentialsSecretArn is a required field - CredentialsSecretArn *string `locationName:"credentialsSecretArn" type:"string" required:"true"` - - // A mapping of Bedrock Knowledge Base fields to Pinecone field names - // - // FieldMapping is a required field - FieldMapping *PineconeFieldMapping `locationName:"fieldMapping" type:"structure" required:"true"` - - // Pinecone namespace - Namespace *string `locationName:"namespace" 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 PineconeConfiguration) 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 PineconeConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PineconeConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PineconeConfiguration"} - if s.ConnectionString == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionString")) - } - if s.CredentialsSecretArn == nil { - invalidParams.Add(request.NewErrParamRequired("CredentialsSecretArn")) - } - if s.FieldMapping == nil { - invalidParams.Add(request.NewErrParamRequired("FieldMapping")) - } - if s.FieldMapping != nil { - if err := s.FieldMapping.Validate(); err != nil { - invalidParams.AddNested("FieldMapping", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectionString sets the ConnectionString field's value. -func (s *PineconeConfiguration) SetConnectionString(v string) *PineconeConfiguration { - s.ConnectionString = &v - return s -} - -// SetCredentialsSecretArn sets the CredentialsSecretArn field's value. -func (s *PineconeConfiguration) SetCredentialsSecretArn(v string) *PineconeConfiguration { - s.CredentialsSecretArn = &v - return s -} - -// SetFieldMapping sets the FieldMapping field's value. -func (s *PineconeConfiguration) SetFieldMapping(v *PineconeFieldMapping) *PineconeConfiguration { - s.FieldMapping = v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *PineconeConfiguration) SetNamespace(v string) *PineconeConfiguration { - s.Namespace = &v - return s -} - -// A mapping of Bedrock Knowledge Base fields to Pinecone field names -type PineconeFieldMapping struct { - _ struct{} `type:"structure"` - - // Name of the field - // - // MetadataField is a required field - MetadataField *string `locationName:"metadataField" type:"string" required:"true"` - - // Name of the field - // - // TextField is a required field - TextField *string `locationName:"textField" 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 PineconeFieldMapping) 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 PineconeFieldMapping) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PineconeFieldMapping) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PineconeFieldMapping"} - if s.MetadataField == nil { - invalidParams.Add(request.NewErrParamRequired("MetadataField")) - } - if s.TextField == nil { - invalidParams.Add(request.NewErrParamRequired("TextField")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetadataField sets the MetadataField field's value. -func (s *PineconeFieldMapping) SetMetadataField(v string) *PineconeFieldMapping { - s.MetadataField = &v - return s -} - -// SetTextField sets the TextField field's value. -func (s *PineconeFieldMapping) SetTextField(v string) *PineconeFieldMapping { - s.TextField = &v - return s -} - -// PrepareAgent Request -type PrepareAgentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" 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 PrepareAgentInput) 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 PrepareAgentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrepareAgentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrepareAgentInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *PrepareAgentInput) SetAgentId(v string) *PrepareAgentInput { - s.AgentId = &v - return s -} - -// PrepareAgent Response -type PrepareAgentOutput struct { - _ struct{} `type:"structure"` - - // Identifier for a resource. - // - // AgentId is a required field - AgentId *string `locationName:"agentId" type:"string" required:"true"` - - // Schema Type for Action APIs. - // - // AgentStatus is a required field - AgentStatus *string `locationName:"agentStatus" type:"string" required:"true" enum:"AgentStatus"` - - // Agent Version. - // - // AgentVersion is a required field - AgentVersion *string `locationName:"agentVersion" min:"1" type:"string" required:"true"` - - // Time Stamp. - // - // PreparedAt is a required field - PreparedAt *time.Time `locationName:"preparedAt" type:"timestamp" timestampFormat:"iso8601" 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 PrepareAgentOutput) 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 PrepareAgentOutput) GoString() string { - return s.String() -} - -// SetAgentId sets the AgentId field's value. -func (s *PrepareAgentOutput) SetAgentId(v string) *PrepareAgentOutput { - s.AgentId = &v - return s -} - -// SetAgentStatus sets the AgentStatus field's value. -func (s *PrepareAgentOutput) SetAgentStatus(v string) *PrepareAgentOutput { - s.AgentStatus = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *PrepareAgentOutput) SetAgentVersion(v string) *PrepareAgentOutput { - s.AgentVersion = &v - return s -} - -// SetPreparedAt sets the PreparedAt field's value. -func (s *PrepareAgentOutput) SetPreparedAt(v time.Time) *PrepareAgentOutput { - s.PreparedAt = &v - return s -} - -// BasePromptConfiguration per Prompt Type. -type PromptConfiguration struct { - _ struct{} `type:"structure"` - - // Base Prompt Template. - BasePromptTemplate *string `locationName:"basePromptTemplate" min:"1" type:"string"` - - // Configuration for inference in prompt configuration - InferenceConfiguration *InferenceConfiguration `locationName:"inferenceConfiguration" type:"structure"` - - // Creation Mode for Prompt Configuration. - ParserMode *string `locationName:"parserMode" type:"string" enum:"CreationMode"` - - // Creation Mode for Prompt Configuration. - PromptCreationMode *string `locationName:"promptCreationMode" type:"string" enum:"CreationMode"` - - // Prompt State. - PromptState *string `locationName:"promptState" type:"string" enum:"PromptState"` - - // Prompt Type. - PromptType *string `locationName:"promptType" type:"string" enum:"PromptType"` -} - -// 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 PromptConfiguration) 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 PromptConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PromptConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PromptConfiguration"} - if s.BasePromptTemplate != nil && len(*s.BasePromptTemplate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BasePromptTemplate", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasePromptTemplate sets the BasePromptTemplate field's value. -func (s *PromptConfiguration) SetBasePromptTemplate(v string) *PromptConfiguration { - s.BasePromptTemplate = &v - return s -} - -// SetInferenceConfiguration sets the InferenceConfiguration field's value. -func (s *PromptConfiguration) SetInferenceConfiguration(v *InferenceConfiguration) *PromptConfiguration { - s.InferenceConfiguration = v - return s -} - -// SetParserMode sets the ParserMode field's value. -func (s *PromptConfiguration) SetParserMode(v string) *PromptConfiguration { - s.ParserMode = &v - return s -} - -// SetPromptCreationMode sets the PromptCreationMode field's value. -func (s *PromptConfiguration) SetPromptCreationMode(v string) *PromptConfiguration { - s.PromptCreationMode = &v - return s -} - -// SetPromptState sets the PromptState field's value. -func (s *PromptConfiguration) SetPromptState(v string) *PromptConfiguration { - s.PromptState = &v - return s -} - -// SetPromptType sets the PromptType field's value. -func (s *PromptConfiguration) SetPromptType(v string) *PromptConfiguration { - s.PromptType = &v - return s -} - -// Configuration for prompt override. -type PromptOverrideConfiguration struct { - _ struct{} `type:"structure" sensitive:"true"` - - // ARN of a Lambda. - OverrideLambda *string `locationName:"overrideLambda" type:"string"` - - // List of BasePromptConfiguration - // - // PromptConfigurations is a required field - PromptConfigurations []*PromptConfiguration `locationName:"promptConfigurations" type:"list" 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 PromptOverrideConfiguration) 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 PromptOverrideConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PromptOverrideConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PromptOverrideConfiguration"} - if s.PromptConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("PromptConfigurations")) - } - if s.PromptConfigurations != nil { - for i, v := range s.PromptConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PromptConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOverrideLambda sets the OverrideLambda field's value. -func (s *PromptOverrideConfiguration) SetOverrideLambda(v string) *PromptOverrideConfiguration { - s.OverrideLambda = &v - return s -} - -// SetPromptConfigurations sets the PromptConfigurations field's value. -func (s *PromptOverrideConfiguration) SetPromptConfigurations(v []*PromptConfiguration) *PromptOverrideConfiguration { - s.PromptConfigurations = v - return s -} - -// Contains the configurations to use Redis Enterprise Cloud to store knowledge -// base data. -type RedisEnterpriseCloudConfiguration struct { - _ struct{} `type:"structure"` - - // Arn of a SecretsManager Secret. - // - // CredentialsSecretArn is a required field - CredentialsSecretArn *string `locationName:"credentialsSecretArn" type:"string" required:"true"` - - // Redis enterprise cloud endpoint - // - // Endpoint is a required field - Endpoint *string `locationName:"endpoint" type:"string" required:"true"` - - // A mapping of Bedrock Knowledge Base fields to Redis Cloud field names - // - // FieldMapping is a required field - FieldMapping *RedisEnterpriseCloudFieldMapping `locationName:"fieldMapping" type:"structure" required:"true"` - - // Name of a redis enterprise cloud index - // - // VectorIndexName is a required field - VectorIndexName *string `locationName:"vectorIndexName" 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 RedisEnterpriseCloudConfiguration) 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 RedisEnterpriseCloudConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedisEnterpriseCloudConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedisEnterpriseCloudConfiguration"} - if s.CredentialsSecretArn == nil { - invalidParams.Add(request.NewErrParamRequired("CredentialsSecretArn")) - } - if s.Endpoint == nil { - invalidParams.Add(request.NewErrParamRequired("Endpoint")) - } - if s.FieldMapping == nil { - invalidParams.Add(request.NewErrParamRequired("FieldMapping")) - } - if s.VectorIndexName == nil { - invalidParams.Add(request.NewErrParamRequired("VectorIndexName")) - } - if s.FieldMapping != nil { - if err := s.FieldMapping.Validate(); err != nil { - invalidParams.AddNested("FieldMapping", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCredentialsSecretArn sets the CredentialsSecretArn field's value. -func (s *RedisEnterpriseCloudConfiguration) SetCredentialsSecretArn(v string) *RedisEnterpriseCloudConfiguration { - s.CredentialsSecretArn = &v - return s -} - -// SetEndpoint sets the Endpoint field's value. -func (s *RedisEnterpriseCloudConfiguration) SetEndpoint(v string) *RedisEnterpriseCloudConfiguration { - s.Endpoint = &v - return s -} - -// SetFieldMapping sets the FieldMapping field's value. -func (s *RedisEnterpriseCloudConfiguration) SetFieldMapping(v *RedisEnterpriseCloudFieldMapping) *RedisEnterpriseCloudConfiguration { - s.FieldMapping = v - return s -} - -// SetVectorIndexName sets the VectorIndexName field's value. -func (s *RedisEnterpriseCloudConfiguration) SetVectorIndexName(v string) *RedisEnterpriseCloudConfiguration { - s.VectorIndexName = &v - return s -} - -// A mapping of Bedrock Knowledge Base fields to Redis Cloud field names -type RedisEnterpriseCloudFieldMapping struct { - _ struct{} `type:"structure"` - - // Name of the field - // - // MetadataField is a required field - MetadataField *string `locationName:"metadataField" type:"string" required:"true"` - - // Name of the field - // - // TextField is a required field - TextField *string `locationName:"textField" type:"string" required:"true"` - - // Name of the field - // - // VectorField is a required field - VectorField *string `locationName:"vectorField" 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 RedisEnterpriseCloudFieldMapping) 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 RedisEnterpriseCloudFieldMapping) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedisEnterpriseCloudFieldMapping) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedisEnterpriseCloudFieldMapping"} - if s.MetadataField == nil { - invalidParams.Add(request.NewErrParamRequired("MetadataField")) - } - if s.TextField == nil { - invalidParams.Add(request.NewErrParamRequired("TextField")) - } - if s.VectorField == nil { - invalidParams.Add(request.NewErrParamRequired("VectorField")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetadataField sets the MetadataField field's value. -func (s *RedisEnterpriseCloudFieldMapping) SetMetadataField(v string) *RedisEnterpriseCloudFieldMapping { - s.MetadataField = &v - return s -} - -// SetTextField sets the TextField field's value. -func (s *RedisEnterpriseCloudFieldMapping) SetTextField(v string) *RedisEnterpriseCloudFieldMapping { - s.TextField = &v - return s -} - -// SetVectorField sets the VectorField field's value. -func (s *RedisEnterpriseCloudFieldMapping) SetVectorField(v string) *RedisEnterpriseCloudFieldMapping { - s.VectorField = &v - return s -} - -// This exception is thrown when a resource referenced by the operation does -// not exist -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Configures an S3 data source location. -type S3DataSourceConfiguration struct { - _ struct{} `type:"structure"` - - // A S3 bucket ARN - // - // BucketArn is a required field - BucketArn *string `locationName:"bucketArn" min:"1" type:"string" required:"true"` - - // A list of S3 prefixes. - InclusionPrefixes []*string `locationName:"inclusionPrefixes" min:"1" type:"list"` -} - -// 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 S3DataSourceConfiguration) 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 S3DataSourceConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3DataSourceConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3DataSourceConfiguration"} - if s.BucketArn == nil { - invalidParams.Add(request.NewErrParamRequired("BucketArn")) - } - if s.BucketArn != nil && len(*s.BucketArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BucketArn", 1)) - } - if s.InclusionPrefixes != nil && len(s.InclusionPrefixes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InclusionPrefixes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketArn sets the BucketArn field's value. -func (s *S3DataSourceConfiguration) SetBucketArn(v string) *S3DataSourceConfiguration { - s.BucketArn = &v - return s -} - -// SetInclusionPrefixes sets the InclusionPrefixes field's value. -func (s *S3DataSourceConfiguration) SetInclusionPrefixes(v []*string) *S3DataSourceConfiguration { - s.InclusionPrefixes = v - return s -} - -// The identifier for the S3 resource. -type S3Identifier struct { - _ struct{} `type:"structure"` - - // A bucket in S3. - S3BucketName *string `locationName:"s3BucketName" min:"3" type:"string"` - - // A object key in S3. - S3ObjectKey *string `locationName:"s3ObjectKey" min:"1" 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 S3Identifier) 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 S3Identifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Identifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Identifier"} - if s.S3BucketName != nil && len(*s.S3BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("S3BucketName", 3)) - } - if s.S3ObjectKey != nil && len(*s.S3ObjectKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3ObjectKey", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *S3Identifier) SetS3BucketName(v string) *S3Identifier { - s.S3BucketName = &v - return s -} - -// SetS3ObjectKey sets the S3ObjectKey field's value. -func (s *S3Identifier) SetS3ObjectKey(v string) *S3Identifier { - s.S3ObjectKey = &v - return s -} - -// Server-side encryption configuration. -type ServerSideEncryptionConfiguration struct { - _ struct{} `type:"structure"` - - // A KMS key ARN - KmsKeyArn *string `locationName:"kmsKeyArn" min:"1" 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 ServerSideEncryptionConfiguration) 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 ServerSideEncryptionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ServerSideEncryptionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionConfiguration"} - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *ServerSideEncryptionConfiguration) SetKmsKeyArn(v string) *ServerSideEncryptionConfiguration { - s.KmsKeyArn = &v - return s -} - -// This exception is thrown when a request is made beyond the service quota -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartIngestionJobInput struct { - _ struct{} `type:"structure"` - - // Client specified token used for idempotency checks - ClientToken *string `locationName:"clientToken" min:"33" type:"string" idempotencyToken:"true"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" type:"string" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 StartIngestionJobInput) 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 StartIngestionJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartIngestionJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartIngestionJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 33 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 33)) - } - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartIngestionJobInput) SetClientToken(v string) *StartIngestionJobInput { - s.ClientToken = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *StartIngestionJobInput) SetDataSourceId(v string) *StartIngestionJobInput { - s.DataSourceId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *StartIngestionJobInput) SetDescription(v string) *StartIngestionJobInput { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *StartIngestionJobInput) SetKnowledgeBaseId(v string) *StartIngestionJobInput { - s.KnowledgeBaseId = &v - return s -} - -type StartIngestionJobOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an ingestion job. - // - // IngestionJob is a required field - IngestionJob *IngestionJob `locationName:"ingestionJob" type:"structure" 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 StartIngestionJobOutput) 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 StartIngestionJobOutput) GoString() string { - return s.String() -} - -// SetIngestionJob sets the IngestionJob field's value. -func (s *StartIngestionJobOutput) SetIngestionJob(v *IngestionJob) *StartIngestionJobOutput { - s.IngestionJob = v - return s -} - -// Configures the physical storage of ingested data in a knowledge base. -type StorageConfiguration struct { - _ struct{} `type:"structure"` - - // Contains the configurations to use OpenSearch Serverless to store knowledge - // base data. - OpensearchServerlessConfiguration *OpenSearchServerlessConfiguration `locationName:"opensearchServerlessConfiguration" type:"structure"` - - // Contains the configurations to use Pinecone to store knowledge base data. - PineconeConfiguration *PineconeConfiguration `locationName:"pineconeConfiguration" type:"structure"` - - // Contains the configurations to use Redis Enterprise Cloud to store knowledge - // base data. - RedisEnterpriseCloudConfiguration *RedisEnterpriseCloudConfiguration `locationName:"redisEnterpriseCloudConfiguration" type:"structure"` - - // The storage type of a knowledge base. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"KnowledgeBaseStorageType"` -} - -// 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 StorageConfiguration) 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 StorageConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StorageConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StorageConfiguration"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.OpensearchServerlessConfiguration != nil { - if err := s.OpensearchServerlessConfiguration.Validate(); err != nil { - invalidParams.AddNested("OpensearchServerlessConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.PineconeConfiguration != nil { - if err := s.PineconeConfiguration.Validate(); err != nil { - invalidParams.AddNested("PineconeConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.RedisEnterpriseCloudConfiguration != nil { - if err := s.RedisEnterpriseCloudConfiguration.Validate(); err != nil { - invalidParams.AddNested("RedisEnterpriseCloudConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOpensearchServerlessConfiguration sets the OpensearchServerlessConfiguration field's value. -func (s *StorageConfiguration) SetOpensearchServerlessConfiguration(v *OpenSearchServerlessConfiguration) *StorageConfiguration { - s.OpensearchServerlessConfiguration = v - return s -} - -// SetPineconeConfiguration sets the PineconeConfiguration field's value. -func (s *StorageConfiguration) SetPineconeConfiguration(v *PineconeConfiguration) *StorageConfiguration { - s.PineconeConfiguration = v - return s -} - -// SetRedisEnterpriseCloudConfiguration sets the RedisEnterpriseCloudConfiguration field's value. -func (s *StorageConfiguration) SetRedisEnterpriseCloudConfiguration(v *RedisEnterpriseCloudConfiguration) *StorageConfiguration { - s.RedisEnterpriseCloudConfiguration = v - return s -} - -// SetType sets the Type field's value. -func (s *StorageConfiguration) SetType(v string) *StorageConfiguration { - s.Type = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base] - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // A map of tag keys and values - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// This exception is thrown when the number of requests exceeds the limit -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ARN of Taggable resources: [Agent, AgentAlias, Knowledge-Base] - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // List of Tag Keys - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -// Update Action Group Request -type UpdateAgentActionGroupInput struct { - _ struct{} `type:"structure"` - - // Type of Executors for an Action Group - ActionGroupExecutor *ActionGroupExecutor `locationName:"actionGroupExecutor" type:"structure"` - - // Id generated at the server side when an Action Group is created under Agent - // - // ActionGroupId is a required field - ActionGroupId *string `location:"uri" locationName:"actionGroupId" type:"string" required:"true"` - - // Name for a resource. - // - // ActionGroupName is a required field - ActionGroupName *string `locationName:"actionGroupName" type:"string" required:"true"` - - // State of the action group - ActionGroupState *string `locationName:"actionGroupState" type:"string" enum:"ActionGroupState"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Draft Version of the Agent. - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"5" type:"string" required:"true"` - - // Contains information about the API Schema for the Action Group - ApiSchema *APISchema `locationName:"apiSchema" type:"structure"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Action Group Signature for a BuiltIn Action - ParentActionGroupSignature *string `locationName:"parentActionGroupSignature" type:"string" enum:"ActionGroupSignature"` -} - -// 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 UpdateAgentActionGroupInput) 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 UpdateAgentActionGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAgentActionGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAgentActionGroupInput"} - if s.ActionGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("ActionGroupId")) - } - if s.ActionGroupId != nil && len(*s.ActionGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionGroupId", 1)) - } - if s.ActionGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ActionGroupName")) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 5 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 5)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.ApiSchema != nil { - if err := s.ApiSchema.Validate(); err != nil { - invalidParams.AddNested("ApiSchema", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionGroupExecutor sets the ActionGroupExecutor field's value. -func (s *UpdateAgentActionGroupInput) SetActionGroupExecutor(v *ActionGroupExecutor) *UpdateAgentActionGroupInput { - s.ActionGroupExecutor = v - return s -} - -// SetActionGroupId sets the ActionGroupId field's value. -func (s *UpdateAgentActionGroupInput) SetActionGroupId(v string) *UpdateAgentActionGroupInput { - s.ActionGroupId = &v - return s -} - -// SetActionGroupName sets the ActionGroupName field's value. -func (s *UpdateAgentActionGroupInput) SetActionGroupName(v string) *UpdateAgentActionGroupInput { - s.ActionGroupName = &v - return s -} - -// SetActionGroupState sets the ActionGroupState field's value. -func (s *UpdateAgentActionGroupInput) SetActionGroupState(v string) *UpdateAgentActionGroupInput { - s.ActionGroupState = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *UpdateAgentActionGroupInput) SetAgentId(v string) *UpdateAgentActionGroupInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *UpdateAgentActionGroupInput) SetAgentVersion(v string) *UpdateAgentActionGroupInput { - s.AgentVersion = &v - return s -} - -// SetApiSchema sets the ApiSchema field's value. -func (s *UpdateAgentActionGroupInput) SetApiSchema(v *APISchema) *UpdateAgentActionGroupInput { - s.ApiSchema = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAgentActionGroupInput) SetDescription(v string) *UpdateAgentActionGroupInput { - s.Description = &v - return s -} - -// SetParentActionGroupSignature sets the ParentActionGroupSignature field's value. -func (s *UpdateAgentActionGroupInput) SetParentActionGroupSignature(v string) *UpdateAgentActionGroupInput { - s.ParentActionGroupSignature = &v - return s -} - -// Update Action Group Response -type UpdateAgentActionGroupOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an Agent Action Group - // - // AgentActionGroup is a required field - AgentActionGroup *AgentActionGroup `locationName:"agentActionGroup" type:"structure" 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 UpdateAgentActionGroupOutput) 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 UpdateAgentActionGroupOutput) GoString() string { - return s.String() -} - -// SetAgentActionGroup sets the AgentActionGroup field's value. -func (s *UpdateAgentActionGroupOutput) SetAgentActionGroup(v *AgentActionGroup) *UpdateAgentActionGroupOutput { - s.AgentActionGroup = v - return s -} - -// Update Agent Alias Request -type UpdateAgentAliasInput struct { - _ struct{} `type:"structure"` - - // Id generated at the server side when an Agent Alias is created - // - // AgentAliasId is a required field - AgentAliasId *string `location:"uri" locationName:"agentAliasId" min:"10" type:"string" required:"true"` - - // Name for a resource. - // - // AgentAliasName is a required field - AgentAliasName *string `locationName:"agentAliasName" type:"string" required:"true"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Routing configuration for an Agent alias. - RoutingConfiguration []*AgentAliasRoutingConfigurationListItem `locationName:"routingConfiguration" type:"list"` -} - -// 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 UpdateAgentAliasInput) 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 UpdateAgentAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAgentAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAgentAliasInput"} - if s.AgentAliasId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentAliasId")) - } - if s.AgentAliasId != nil && len(*s.AgentAliasId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("AgentAliasId", 10)) - } - if s.AgentAliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AgentAliasName")) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.RoutingConfiguration != nil { - for i, v := range s.RoutingConfiguration { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RoutingConfiguration", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentAliasId sets the AgentAliasId field's value. -func (s *UpdateAgentAliasInput) SetAgentAliasId(v string) *UpdateAgentAliasInput { - s.AgentAliasId = &v - return s -} - -// SetAgentAliasName sets the AgentAliasName field's value. -func (s *UpdateAgentAliasInput) SetAgentAliasName(v string) *UpdateAgentAliasInput { - s.AgentAliasName = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *UpdateAgentAliasInput) SetAgentId(v string) *UpdateAgentAliasInput { - s.AgentId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAgentAliasInput) SetDescription(v string) *UpdateAgentAliasInput { - s.Description = &v - return s -} - -// SetRoutingConfiguration sets the RoutingConfiguration field's value. -func (s *UpdateAgentAliasInput) SetRoutingConfiguration(v []*AgentAliasRoutingConfigurationListItem) *UpdateAgentAliasInput { - s.RoutingConfiguration = v - return s -} - -// Update Agent Alias Response -type UpdateAgentAliasOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an agent alias - // - // AgentAlias is a required field - AgentAlias *AgentAlias `locationName:"agentAlias" type:"structure" 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 UpdateAgentAliasOutput) 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 UpdateAgentAliasOutput) GoString() string { - return s.String() -} - -// SetAgentAlias sets the AgentAlias field's value. -func (s *UpdateAgentAliasOutput) SetAgentAlias(v *AgentAlias) *UpdateAgentAliasOutput { - s.AgentAlias = v - return s -} - -// Update Agent Request -type UpdateAgentInput struct { - _ struct{} `type:"structure"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Name for a resource. - // - // AgentName is a required field - AgentName *string `locationName:"agentName" type:"string" required:"true"` - - // ARN of a IAM role. - // - // AgentResourceRoleArn is a required field - AgentResourceRoleArn *string `locationName:"agentResourceRoleArn" type:"string" required:"true"` - - // A KMS key ARN - CustomerEncryptionKeyArn *string `locationName:"customerEncryptionKeyArn" min:"1" type:"string"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // ARN or name of a Bedrock model. - FoundationModel *string `locationName:"foundationModel" min:"1" type:"string"` - - // Max Session Time. - IdleSessionTTLInSeconds *int64 `locationName:"idleSessionTTLInSeconds" min:"60" type:"integer"` - - // Instruction for the agent. - // - // Instruction is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateAgentInput's - // String and GoString methods. - Instruction *string `locationName:"instruction" min:"40" type:"string" sensitive:"true"` - - // Configuration for prompt override. - // - // PromptOverrideConfiguration is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateAgentInput's - // String and GoString methods. - PromptOverrideConfiguration *PromptOverrideConfiguration `locationName:"promptOverrideConfiguration" type:"structure" sensitive:"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 UpdateAgentInput) 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 UpdateAgentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAgentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAgentInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentName == nil { - invalidParams.Add(request.NewErrParamRequired("AgentName")) - } - if s.AgentResourceRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("AgentResourceRoleArn")) - } - if s.CustomerEncryptionKeyArn != nil && len(*s.CustomerEncryptionKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomerEncryptionKeyArn", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FoundationModel != nil && len(*s.FoundationModel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FoundationModel", 1)) - } - if s.IdleSessionTTLInSeconds != nil && *s.IdleSessionTTLInSeconds < 60 { - invalidParams.Add(request.NewErrParamMinValue("IdleSessionTTLInSeconds", 60)) - } - if s.Instruction != nil && len(*s.Instruction) < 40 { - invalidParams.Add(request.NewErrParamMinLen("Instruction", 40)) - } - if s.PromptOverrideConfiguration != nil { - if err := s.PromptOverrideConfiguration.Validate(); err != nil { - invalidParams.AddNested("PromptOverrideConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *UpdateAgentInput) SetAgentId(v string) *UpdateAgentInput { - s.AgentId = &v - return s -} - -// SetAgentName sets the AgentName field's value. -func (s *UpdateAgentInput) SetAgentName(v string) *UpdateAgentInput { - s.AgentName = &v - return s -} - -// SetAgentResourceRoleArn sets the AgentResourceRoleArn field's value. -func (s *UpdateAgentInput) SetAgentResourceRoleArn(v string) *UpdateAgentInput { - s.AgentResourceRoleArn = &v - return s -} - -// SetCustomerEncryptionKeyArn sets the CustomerEncryptionKeyArn field's value. -func (s *UpdateAgentInput) SetCustomerEncryptionKeyArn(v string) *UpdateAgentInput { - s.CustomerEncryptionKeyArn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAgentInput) SetDescription(v string) *UpdateAgentInput { - s.Description = &v - return s -} - -// SetFoundationModel sets the FoundationModel field's value. -func (s *UpdateAgentInput) SetFoundationModel(v string) *UpdateAgentInput { - s.FoundationModel = &v - return s -} - -// SetIdleSessionTTLInSeconds sets the IdleSessionTTLInSeconds field's value. -func (s *UpdateAgentInput) SetIdleSessionTTLInSeconds(v int64) *UpdateAgentInput { - s.IdleSessionTTLInSeconds = &v - return s -} - -// SetInstruction sets the Instruction field's value. -func (s *UpdateAgentInput) SetInstruction(v string) *UpdateAgentInput { - s.Instruction = &v - return s -} - -// SetPromptOverrideConfiguration sets the PromptOverrideConfiguration field's value. -func (s *UpdateAgentInput) SetPromptOverrideConfiguration(v *PromptOverrideConfiguration) *UpdateAgentInput { - s.PromptOverrideConfiguration = v - return s -} - -// Update Agent Knowledge Base Request -type UpdateAgentKnowledgeBaseInput struct { - _ struct{} `type:"structure"` - - // Id generated at the server side when an Agent is created - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Draft Version of the Agent. - // - // AgentVersion is a required field - AgentVersion *string `location:"uri" locationName:"agentVersion" min:"5" type:"string" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Id generated at the server side when a Knowledge Base is associated to an - // Agent - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // State of the knowledge base; whether it is enabled or disabled - KnowledgeBaseState *string `locationName:"knowledgeBaseState" type:"string" enum:"KnowledgeBaseState"` -} - -// 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 UpdateAgentKnowledgeBaseInput) 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 UpdateAgentKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAgentKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAgentKnowledgeBaseInput"} - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.AgentVersion == nil { - invalidParams.Add(request.NewErrParamRequired("AgentVersion")) - } - if s.AgentVersion != nil && len(*s.AgentVersion) < 5 { - invalidParams.Add(request.NewErrParamMinLen("AgentVersion", 5)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentId sets the AgentId field's value. -func (s *UpdateAgentKnowledgeBaseInput) SetAgentId(v string) *UpdateAgentKnowledgeBaseInput { - s.AgentId = &v - return s -} - -// SetAgentVersion sets the AgentVersion field's value. -func (s *UpdateAgentKnowledgeBaseInput) SetAgentVersion(v string) *UpdateAgentKnowledgeBaseInput { - s.AgentVersion = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAgentKnowledgeBaseInput) SetDescription(v string) *UpdateAgentKnowledgeBaseInput { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *UpdateAgentKnowledgeBaseInput) SetKnowledgeBaseId(v string) *UpdateAgentKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -// SetKnowledgeBaseState sets the KnowledgeBaseState field's value. -func (s *UpdateAgentKnowledgeBaseInput) SetKnowledgeBaseState(v string) *UpdateAgentKnowledgeBaseInput { - s.KnowledgeBaseState = &v - return s -} - -// Update Agent Knowledge Base Response -type UpdateAgentKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an Agent Knowledge Base. - // - // AgentKnowledgeBase is a required field - AgentKnowledgeBase *AgentKnowledgeBase `locationName:"agentKnowledgeBase" type:"structure" 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 UpdateAgentKnowledgeBaseOutput) 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 UpdateAgentKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetAgentKnowledgeBase sets the AgentKnowledgeBase field's value. -func (s *UpdateAgentKnowledgeBaseOutput) SetAgentKnowledgeBase(v *AgentKnowledgeBase) *UpdateAgentKnowledgeBaseOutput { - s.AgentKnowledgeBase = v - return s -} - -// Update Agent Response -type UpdateAgentOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of an agent - // - // Agent is a required field - Agent *Agent `locationName:"agent" type:"structure" 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 UpdateAgentOutput) 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 UpdateAgentOutput) GoString() string { - return s.String() -} - -// SetAgent sets the Agent field's value. -func (s *UpdateAgentOutput) SetAgent(v *Agent) *UpdateAgentOutput { - s.Agent = v - return s -} - -type UpdateDataSourceInput struct { - _ struct{} `type:"structure"` - - // Specifies a raw data source location to ingest. - // - // DataSourceConfiguration is a required field - DataSourceConfiguration *DataSourceConfiguration `locationName:"dataSourceConfiguration" type:"structure" required:"true"` - - // Identifier for a resource. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" type:"string" required:"true"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Name for a resource. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // Server-side encryption configuration. - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // Configures ingestion for a vector knowledge base - VectorIngestionConfiguration *VectorIngestionConfiguration `locationName:"vectorIngestionConfiguration" 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 UpdateDataSourceInput) 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 UpdateDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDataSourceInput"} - if s.DataSourceConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceConfiguration")) - } - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.DataSourceConfiguration != nil { - if err := s.DataSourceConfiguration.Validate(); err != nil { - invalidParams.AddNested("DataSourceConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ServerSideEncryptionConfiguration != nil { - if err := s.ServerSideEncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.VectorIngestionConfiguration != nil { - if err := s.VectorIngestionConfiguration.Validate(); err != nil { - invalidParams.AddNested("VectorIngestionConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceConfiguration sets the DataSourceConfiguration field's value. -func (s *UpdateDataSourceInput) SetDataSourceConfiguration(v *DataSourceConfiguration) *UpdateDataSourceInput { - s.DataSourceConfiguration = v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *UpdateDataSourceInput) SetDataSourceId(v string) *UpdateDataSourceInput { - s.DataSourceId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateDataSourceInput) SetDescription(v string) *UpdateDataSourceInput { - s.Description = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *UpdateDataSourceInput) SetKnowledgeBaseId(v string) *UpdateDataSourceInput { - s.KnowledgeBaseId = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDataSourceInput) SetName(v string) *UpdateDataSourceInput { - s.Name = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *UpdateDataSourceInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *UpdateDataSourceInput { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetVectorIngestionConfiguration sets the VectorIngestionConfiguration field's value. -func (s *UpdateDataSourceInput) SetVectorIngestionConfiguration(v *VectorIngestionConfiguration) *UpdateDataSourceInput { - s.VectorIngestionConfiguration = v - return s -} - -type UpdateDataSourceOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of a data source. - // - // DataSource is a required field - DataSource *DataSource `locationName:"dataSource" type:"structure" 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 UpdateDataSourceOutput) 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 UpdateDataSourceOutput) GoString() string { - return s.String() -} - -// SetDataSource sets the DataSource field's value. -func (s *UpdateDataSourceOutput) SetDataSource(v *DataSource) *UpdateDataSourceOutput { - s.DataSource = v - return s -} - -type UpdateKnowledgeBaseInput struct { - _ struct{} `type:"structure"` - - // Description of the Resource. - Description *string `locationName:"description" min:"1" type:"string"` - - // Configures a bedrock knowledge base. - // - // KnowledgeBaseConfiguration is a required field - KnowledgeBaseConfiguration *KnowledgeBaseConfiguration `locationName:"knowledgeBaseConfiguration" type:"structure" required:"true"` - - // Identifier for a resource. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Name for a resource. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // ARN of a IAM role. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // Configures the physical storage of ingested data in a knowledge base. - // - // StorageConfiguration is a required field - StorageConfiguration *StorageConfiguration `locationName:"storageConfiguration" type:"structure" 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 UpdateKnowledgeBaseInput) 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 UpdateKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateKnowledgeBaseInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseConfiguration")) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.StorageConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("StorageConfiguration")) - } - if s.KnowledgeBaseConfiguration != nil { - if err := s.KnowledgeBaseConfiguration.Validate(); err != nil { - invalidParams.AddNested("KnowledgeBaseConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.StorageConfiguration != nil { - if err := s.StorageConfiguration.Validate(); err != nil { - invalidParams.AddNested("StorageConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateKnowledgeBaseInput) SetDescription(v string) *UpdateKnowledgeBaseInput { - s.Description = &v - return s -} - -// SetKnowledgeBaseConfiguration sets the KnowledgeBaseConfiguration field's value. -func (s *UpdateKnowledgeBaseInput) SetKnowledgeBaseConfiguration(v *KnowledgeBaseConfiguration) *UpdateKnowledgeBaseInput { - s.KnowledgeBaseConfiguration = v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *UpdateKnowledgeBaseInput) SetKnowledgeBaseId(v string) *UpdateKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateKnowledgeBaseInput) SetName(v string) *UpdateKnowledgeBaseInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateKnowledgeBaseInput) SetRoleArn(v string) *UpdateKnowledgeBaseInput { - s.RoleArn = &v - return s -} - -// SetStorageConfiguration sets the StorageConfiguration field's value. -func (s *UpdateKnowledgeBaseInput) SetStorageConfiguration(v *StorageConfiguration) *UpdateKnowledgeBaseInput { - s.StorageConfiguration = v - return s -} - -type UpdateKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // Contains the information of a knowledge base. - // - // KnowledgeBase is a required field - KnowledgeBase *KnowledgeBase `locationName:"knowledgeBase" type:"structure" 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 UpdateKnowledgeBaseOutput) 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 UpdateKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBase sets the KnowledgeBase field's value. -func (s *UpdateKnowledgeBaseOutput) SetKnowledgeBase(v *KnowledgeBase) *UpdateKnowledgeBaseOutput { - s.KnowledgeBase = v - return s -} - -// This exception is thrown when the request's input validation fails -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // list of ValidationExceptionField - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Stores information about a field passed inside a request that resulted in -// an exception -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // Non Blank String - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // Non Blank String - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -// Configures ingestion for a vector knowledge base -type VectorIngestionConfiguration struct { - _ struct{} `type:"structure"` - - // Configures chunking strategy - ChunkingConfiguration *ChunkingConfiguration `locationName:"chunkingConfiguration" 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 VectorIngestionConfiguration) 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 VectorIngestionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VectorIngestionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VectorIngestionConfiguration"} - if s.ChunkingConfiguration != nil { - if err := s.ChunkingConfiguration.Validate(); err != nil { - invalidParams.AddNested("ChunkingConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChunkingConfiguration sets the ChunkingConfiguration field's value. -func (s *VectorIngestionConfiguration) SetChunkingConfiguration(v *ChunkingConfiguration) *VectorIngestionConfiguration { - s.ChunkingConfiguration = v - return s -} - -// Configurations for a vector knowledge base. -type VectorKnowledgeBaseConfiguration struct { - _ struct{} `type:"structure"` - - // Arn of a Bedrock model. - // - // EmbeddingModelArn is a required field - EmbeddingModelArn *string `locationName:"embeddingModelArn" min:"20" 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 VectorKnowledgeBaseConfiguration) 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 VectorKnowledgeBaseConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VectorKnowledgeBaseConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VectorKnowledgeBaseConfiguration"} - if s.EmbeddingModelArn == nil { - invalidParams.Add(request.NewErrParamRequired("EmbeddingModelArn")) - } - if s.EmbeddingModelArn != nil && len(*s.EmbeddingModelArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("EmbeddingModelArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEmbeddingModelArn sets the EmbeddingModelArn field's value. -func (s *VectorKnowledgeBaseConfiguration) SetEmbeddingModelArn(v string) *VectorKnowledgeBaseConfiguration { - s.EmbeddingModelArn = &v - return s -} - -// Action Group Signature for a BuiltIn Action -const ( - // ActionGroupSignatureAmazonUserInput is a ActionGroupSignature enum value - ActionGroupSignatureAmazonUserInput = "AMAZON.UserInput" -) - -// ActionGroupSignature_Values returns all elements of the ActionGroupSignature enum -func ActionGroupSignature_Values() []string { - return []string{ - ActionGroupSignatureAmazonUserInput, - } -} - -// State of the action group -const ( - // ActionGroupStateEnabled is a ActionGroupState enum value - ActionGroupStateEnabled = "ENABLED" - - // ActionGroupStateDisabled is a ActionGroupState enum value - ActionGroupStateDisabled = "DISABLED" -) - -// ActionGroupState_Values returns all elements of the ActionGroupState enum -func ActionGroupState_Values() []string { - return []string{ - ActionGroupStateEnabled, - ActionGroupStateDisabled, - } -} - -// The statuses an Agent Alias can be in. -const ( - // AgentAliasStatusCreating is a AgentAliasStatus enum value - AgentAliasStatusCreating = "CREATING" - - // AgentAliasStatusPrepared is a AgentAliasStatus enum value - AgentAliasStatusPrepared = "PREPARED" - - // AgentAliasStatusFailed is a AgentAliasStatus enum value - AgentAliasStatusFailed = "FAILED" - - // AgentAliasStatusUpdating is a AgentAliasStatus enum value - AgentAliasStatusUpdating = "UPDATING" - - // AgentAliasStatusDeleting is a AgentAliasStatus enum value - AgentAliasStatusDeleting = "DELETING" -) - -// AgentAliasStatus_Values returns all elements of the AgentAliasStatus enum -func AgentAliasStatus_Values() []string { - return []string{ - AgentAliasStatusCreating, - AgentAliasStatusPrepared, - AgentAliasStatusFailed, - AgentAliasStatusUpdating, - AgentAliasStatusDeleting, - } -} - -// Schema Type for Action APIs. -const ( - // AgentStatusCreating is a AgentStatus enum value - AgentStatusCreating = "CREATING" - - // AgentStatusPreparing is a AgentStatus enum value - AgentStatusPreparing = "PREPARING" - - // AgentStatusPrepared is a AgentStatus enum value - AgentStatusPrepared = "PREPARED" - - // AgentStatusNotPrepared is a AgentStatus enum value - AgentStatusNotPrepared = "NOT_PREPARED" - - // AgentStatusDeleting is a AgentStatus enum value - AgentStatusDeleting = "DELETING" - - // AgentStatusFailed is a AgentStatus enum value - AgentStatusFailed = "FAILED" - - // AgentStatusVersioning is a AgentStatus enum value - AgentStatusVersioning = "VERSIONING" - - // AgentStatusUpdating is a AgentStatus enum value - AgentStatusUpdating = "UPDATING" -) - -// AgentStatus_Values returns all elements of the AgentStatus enum -func AgentStatus_Values() []string { - return []string{ - AgentStatusCreating, - AgentStatusPreparing, - AgentStatusPrepared, - AgentStatusNotPrepared, - AgentStatusDeleting, - AgentStatusFailed, - AgentStatusVersioning, - AgentStatusUpdating, - } -} - -// The type of chunking strategy -const ( - // ChunkingStrategyFixedSize is a ChunkingStrategy enum value - ChunkingStrategyFixedSize = "FIXED_SIZE" - - // ChunkingStrategyNone is a ChunkingStrategy enum value - ChunkingStrategyNone = "NONE" -) - -// ChunkingStrategy_Values returns all elements of the ChunkingStrategy enum -func ChunkingStrategy_Values() []string { - return []string{ - ChunkingStrategyFixedSize, - ChunkingStrategyNone, - } -} - -// Creation Mode for Prompt Configuration. -const ( - // CreationModeDefault is a CreationMode enum value - CreationModeDefault = "DEFAULT" - - // CreationModeOverridden is a CreationMode enum value - CreationModeOverridden = "OVERRIDDEN" -) - -// CreationMode_Values returns all elements of the CreationMode enum -func CreationMode_Values() []string { - return []string{ - CreationModeDefault, - CreationModeOverridden, - } -} - -// The status of a data source. -const ( - // DataSourceStatusAvailable is a DataSourceStatus enum value - DataSourceStatusAvailable = "AVAILABLE" - - // DataSourceStatusDeleting is a DataSourceStatus enum value - DataSourceStatusDeleting = "DELETING" -) - -// DataSourceStatus_Values returns all elements of the DataSourceStatus enum -func DataSourceStatus_Values() []string { - return []string{ - DataSourceStatusAvailable, - DataSourceStatusDeleting, - } -} - -// The type of the data source location. -const ( - // DataSourceTypeS3 is a DataSourceType enum value - DataSourceTypeS3 = "S3" -) - -// DataSourceType_Values returns all elements of the DataSourceType enum -func DataSourceType_Values() []string { - return []string{ - DataSourceTypeS3, - } -} - -// The name of the field to filter ingestion jobs. -const ( - // IngestionJobFilterAttributeStatus is a IngestionJobFilterAttribute enum value - IngestionJobFilterAttributeStatus = "STATUS" -) - -// IngestionJobFilterAttribute_Values returns all elements of the IngestionJobFilterAttribute enum -func IngestionJobFilterAttribute_Values() []string { - return []string{ - IngestionJobFilterAttributeStatus, - } -} - -// The operator used to filter ingestion jobs. -const ( - // IngestionJobFilterOperatorEq is a IngestionJobFilterOperator enum value - IngestionJobFilterOperatorEq = "EQ" -) - -// IngestionJobFilterOperator_Values returns all elements of the IngestionJobFilterOperator enum -func IngestionJobFilterOperator_Values() []string { - return []string{ - IngestionJobFilterOperatorEq, - } -} - -// The name of the field to sort ingestion jobs. -const ( - // IngestionJobSortByAttributeStatus is a IngestionJobSortByAttribute enum value - IngestionJobSortByAttributeStatus = "STATUS" - - // IngestionJobSortByAttributeStartedAt is a IngestionJobSortByAttribute enum value - IngestionJobSortByAttributeStartedAt = "STARTED_AT" -) - -// IngestionJobSortByAttribute_Values returns all elements of the IngestionJobSortByAttribute enum -func IngestionJobSortByAttribute_Values() []string { - return []string{ - IngestionJobSortByAttributeStatus, - IngestionJobSortByAttributeStartedAt, - } -} - -// The status of an ingestion job. -const ( - // IngestionJobStatusStarting is a IngestionJobStatus enum value - IngestionJobStatusStarting = "STARTING" - - // IngestionJobStatusInProgress is a IngestionJobStatus enum value - IngestionJobStatusInProgress = "IN_PROGRESS" - - // IngestionJobStatusComplete is a IngestionJobStatus enum value - IngestionJobStatusComplete = "COMPLETE" - - // IngestionJobStatusFailed is a IngestionJobStatus enum value - IngestionJobStatusFailed = "FAILED" -) - -// IngestionJobStatus_Values returns all elements of the IngestionJobStatus enum -func IngestionJobStatus_Values() []string { - return []string{ - IngestionJobStatusStarting, - IngestionJobStatusInProgress, - IngestionJobStatusComplete, - IngestionJobStatusFailed, - } -} - -// State of the knowledge base; whether it is enabled or disabled -const ( - // KnowledgeBaseStateEnabled is a KnowledgeBaseState enum value - KnowledgeBaseStateEnabled = "ENABLED" - - // KnowledgeBaseStateDisabled is a KnowledgeBaseState enum value - KnowledgeBaseStateDisabled = "DISABLED" -) - -// KnowledgeBaseState_Values returns all elements of the KnowledgeBaseState enum -func KnowledgeBaseState_Values() []string { - return []string{ - KnowledgeBaseStateEnabled, - KnowledgeBaseStateDisabled, - } -} - -// The status of a knowledge base. -const ( - // KnowledgeBaseStatusCreating is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusCreating = "CREATING" - - // KnowledgeBaseStatusActive is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusActive = "ACTIVE" - - // KnowledgeBaseStatusDeleting is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusDeleting = "DELETING" - - // KnowledgeBaseStatusUpdating is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusUpdating = "UPDATING" - - // KnowledgeBaseStatusFailed is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusFailed = "FAILED" -) - -// KnowledgeBaseStatus_Values returns all elements of the KnowledgeBaseStatus enum -func KnowledgeBaseStatus_Values() []string { - return []string{ - KnowledgeBaseStatusCreating, - KnowledgeBaseStatusActive, - KnowledgeBaseStatusDeleting, - KnowledgeBaseStatusUpdating, - KnowledgeBaseStatusFailed, - } -} - -// The storage type of a knowledge base. -const ( - // KnowledgeBaseStorageTypeOpensearchServerless is a KnowledgeBaseStorageType enum value - KnowledgeBaseStorageTypeOpensearchServerless = "OPENSEARCH_SERVERLESS" - - // KnowledgeBaseStorageTypePinecone is a KnowledgeBaseStorageType enum value - KnowledgeBaseStorageTypePinecone = "PINECONE" - - // KnowledgeBaseStorageTypeRedisEnterpriseCloud is a KnowledgeBaseStorageType enum value - KnowledgeBaseStorageTypeRedisEnterpriseCloud = "REDIS_ENTERPRISE_CLOUD" -) - -// KnowledgeBaseStorageType_Values returns all elements of the KnowledgeBaseStorageType enum -func KnowledgeBaseStorageType_Values() []string { - return []string{ - KnowledgeBaseStorageTypeOpensearchServerless, - KnowledgeBaseStorageTypePinecone, - KnowledgeBaseStorageTypeRedisEnterpriseCloud, - } -} - -// The type of a knowledge base. -const ( - // KnowledgeBaseTypeVector is a KnowledgeBaseType enum value - KnowledgeBaseTypeVector = "VECTOR" -) - -// KnowledgeBaseType_Values returns all elements of the KnowledgeBaseType enum -func KnowledgeBaseType_Values() []string { - return []string{ - KnowledgeBaseTypeVector, - } -} - -// Prompt State. -const ( - // PromptStateEnabled is a PromptState enum value - PromptStateEnabled = "ENABLED" - - // PromptStateDisabled is a PromptState enum value - PromptStateDisabled = "DISABLED" -) - -// PromptState_Values returns all elements of the PromptState enum -func PromptState_Values() []string { - return []string{ - PromptStateEnabled, - PromptStateDisabled, - } -} - -// Prompt Type. -const ( - // PromptTypePreProcessing is a PromptType enum value - PromptTypePreProcessing = "PRE_PROCESSING" - - // PromptTypeOrchestration is a PromptType enum value - PromptTypeOrchestration = "ORCHESTRATION" - - // PromptTypePostProcessing is a PromptType enum value - PromptTypePostProcessing = "POST_PROCESSING" - - // PromptTypeKnowledgeBaseResponseGeneration is a PromptType enum value - PromptTypeKnowledgeBaseResponseGeneration = "KNOWLEDGE_BASE_RESPONSE_GENERATION" -) - -// PromptType_Values returns all elements of the PromptType enum -func PromptType_Values() []string { - return []string{ - PromptTypePreProcessing, - PromptTypeOrchestration, - PromptTypePostProcessing, - PromptTypeKnowledgeBaseResponseGeneration, - } -} - -// Order to sort results by. -const ( - // SortOrderAscending is a SortOrder enum value - SortOrderAscending = "ASCENDING" - - // SortOrderDescending is a SortOrder enum value - SortOrderDescending = "DESCENDING" -) - -// SortOrder_Values returns all elements of the SortOrder enum -func SortOrder_Values() []string { - return []string{ - SortOrderAscending, - SortOrderDescending, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/bedrockagentiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/bedrockagentiface/interface.go deleted file mode 100644 index d99d26f1787b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/bedrockagentiface/interface.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bedrockagentiface provides an interface to enable mocking the Agents for Amazon Bedrock service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package bedrockagentiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent" -) - -// BedrockAgentAPI provides an interface to enable mocking the -// bedrockagent.BedrockAgent service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Agents for Amazon Bedrock. -// func myFunc(svc bedrockagentiface.BedrockAgentAPI) bool { -// // Make svc.AssociateAgentKnowledgeBase request -// } -// -// func main() { -// sess := session.New() -// svc := bedrockagent.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockBedrockAgentClient struct { -// bedrockagentiface.BedrockAgentAPI -// } -// func (m *mockBedrockAgentClient) AssociateAgentKnowledgeBase(input *bedrockagent.AssociateAgentKnowledgeBaseInput) (*bedrockagent.AssociateAgentKnowledgeBaseOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockBedrockAgentClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type BedrockAgentAPI interface { - AssociateAgentKnowledgeBase(*bedrockagent.AssociateAgentKnowledgeBaseInput) (*bedrockagent.AssociateAgentKnowledgeBaseOutput, error) - AssociateAgentKnowledgeBaseWithContext(aws.Context, *bedrockagent.AssociateAgentKnowledgeBaseInput, ...request.Option) (*bedrockagent.AssociateAgentKnowledgeBaseOutput, error) - AssociateAgentKnowledgeBaseRequest(*bedrockagent.AssociateAgentKnowledgeBaseInput) (*request.Request, *bedrockagent.AssociateAgentKnowledgeBaseOutput) - - CreateAgent(*bedrockagent.CreateAgentInput) (*bedrockagent.CreateAgentOutput, error) - CreateAgentWithContext(aws.Context, *bedrockagent.CreateAgentInput, ...request.Option) (*bedrockagent.CreateAgentOutput, error) - CreateAgentRequest(*bedrockagent.CreateAgentInput) (*request.Request, *bedrockagent.CreateAgentOutput) - - CreateAgentActionGroup(*bedrockagent.CreateAgentActionGroupInput) (*bedrockagent.CreateAgentActionGroupOutput, error) - CreateAgentActionGroupWithContext(aws.Context, *bedrockagent.CreateAgentActionGroupInput, ...request.Option) (*bedrockagent.CreateAgentActionGroupOutput, error) - CreateAgentActionGroupRequest(*bedrockagent.CreateAgentActionGroupInput) (*request.Request, *bedrockagent.CreateAgentActionGroupOutput) - - CreateAgentAlias(*bedrockagent.CreateAgentAliasInput) (*bedrockagent.CreateAgentAliasOutput, error) - CreateAgentAliasWithContext(aws.Context, *bedrockagent.CreateAgentAliasInput, ...request.Option) (*bedrockagent.CreateAgentAliasOutput, error) - CreateAgentAliasRequest(*bedrockagent.CreateAgentAliasInput) (*request.Request, *bedrockagent.CreateAgentAliasOutput) - - CreateDataSource(*bedrockagent.CreateDataSourceInput) (*bedrockagent.CreateDataSourceOutput, error) - CreateDataSourceWithContext(aws.Context, *bedrockagent.CreateDataSourceInput, ...request.Option) (*bedrockagent.CreateDataSourceOutput, error) - CreateDataSourceRequest(*bedrockagent.CreateDataSourceInput) (*request.Request, *bedrockagent.CreateDataSourceOutput) - - CreateKnowledgeBase(*bedrockagent.CreateKnowledgeBaseInput) (*bedrockagent.CreateKnowledgeBaseOutput, error) - CreateKnowledgeBaseWithContext(aws.Context, *bedrockagent.CreateKnowledgeBaseInput, ...request.Option) (*bedrockagent.CreateKnowledgeBaseOutput, error) - CreateKnowledgeBaseRequest(*bedrockagent.CreateKnowledgeBaseInput) (*request.Request, *bedrockagent.CreateKnowledgeBaseOutput) - - DeleteAgent(*bedrockagent.DeleteAgentInput) (*bedrockagent.DeleteAgentOutput, error) - DeleteAgentWithContext(aws.Context, *bedrockagent.DeleteAgentInput, ...request.Option) (*bedrockagent.DeleteAgentOutput, error) - DeleteAgentRequest(*bedrockagent.DeleteAgentInput) (*request.Request, *bedrockagent.DeleteAgentOutput) - - DeleteAgentActionGroup(*bedrockagent.DeleteAgentActionGroupInput) (*bedrockagent.DeleteAgentActionGroupOutput, error) - DeleteAgentActionGroupWithContext(aws.Context, *bedrockagent.DeleteAgentActionGroupInput, ...request.Option) (*bedrockagent.DeleteAgentActionGroupOutput, error) - DeleteAgentActionGroupRequest(*bedrockagent.DeleteAgentActionGroupInput) (*request.Request, *bedrockagent.DeleteAgentActionGroupOutput) - - DeleteAgentAlias(*bedrockagent.DeleteAgentAliasInput) (*bedrockagent.DeleteAgentAliasOutput, error) - DeleteAgentAliasWithContext(aws.Context, *bedrockagent.DeleteAgentAliasInput, ...request.Option) (*bedrockagent.DeleteAgentAliasOutput, error) - DeleteAgentAliasRequest(*bedrockagent.DeleteAgentAliasInput) (*request.Request, *bedrockagent.DeleteAgentAliasOutput) - - DeleteAgentVersion(*bedrockagent.DeleteAgentVersionInput) (*bedrockagent.DeleteAgentVersionOutput, error) - DeleteAgentVersionWithContext(aws.Context, *bedrockagent.DeleteAgentVersionInput, ...request.Option) (*bedrockagent.DeleteAgentVersionOutput, error) - DeleteAgentVersionRequest(*bedrockagent.DeleteAgentVersionInput) (*request.Request, *bedrockagent.DeleteAgentVersionOutput) - - DeleteDataSource(*bedrockagent.DeleteDataSourceInput) (*bedrockagent.DeleteDataSourceOutput, error) - DeleteDataSourceWithContext(aws.Context, *bedrockagent.DeleteDataSourceInput, ...request.Option) (*bedrockagent.DeleteDataSourceOutput, error) - DeleteDataSourceRequest(*bedrockagent.DeleteDataSourceInput) (*request.Request, *bedrockagent.DeleteDataSourceOutput) - - DeleteKnowledgeBase(*bedrockagent.DeleteKnowledgeBaseInput) (*bedrockagent.DeleteKnowledgeBaseOutput, error) - DeleteKnowledgeBaseWithContext(aws.Context, *bedrockagent.DeleteKnowledgeBaseInput, ...request.Option) (*bedrockagent.DeleteKnowledgeBaseOutput, error) - DeleteKnowledgeBaseRequest(*bedrockagent.DeleteKnowledgeBaseInput) (*request.Request, *bedrockagent.DeleteKnowledgeBaseOutput) - - DisassociateAgentKnowledgeBase(*bedrockagent.DisassociateAgentKnowledgeBaseInput) (*bedrockagent.DisassociateAgentKnowledgeBaseOutput, error) - DisassociateAgentKnowledgeBaseWithContext(aws.Context, *bedrockagent.DisassociateAgentKnowledgeBaseInput, ...request.Option) (*bedrockagent.DisassociateAgentKnowledgeBaseOutput, error) - DisassociateAgentKnowledgeBaseRequest(*bedrockagent.DisassociateAgentKnowledgeBaseInput) (*request.Request, *bedrockagent.DisassociateAgentKnowledgeBaseOutput) - - GetAgent(*bedrockagent.GetAgentInput) (*bedrockagent.GetAgentOutput, error) - GetAgentWithContext(aws.Context, *bedrockagent.GetAgentInput, ...request.Option) (*bedrockagent.GetAgentOutput, error) - GetAgentRequest(*bedrockagent.GetAgentInput) (*request.Request, *bedrockagent.GetAgentOutput) - - GetAgentActionGroup(*bedrockagent.GetAgentActionGroupInput) (*bedrockagent.GetAgentActionGroupOutput, error) - GetAgentActionGroupWithContext(aws.Context, *bedrockagent.GetAgentActionGroupInput, ...request.Option) (*bedrockagent.GetAgentActionGroupOutput, error) - GetAgentActionGroupRequest(*bedrockagent.GetAgentActionGroupInput) (*request.Request, *bedrockagent.GetAgentActionGroupOutput) - - GetAgentAlias(*bedrockagent.GetAgentAliasInput) (*bedrockagent.GetAgentAliasOutput, error) - GetAgentAliasWithContext(aws.Context, *bedrockagent.GetAgentAliasInput, ...request.Option) (*bedrockagent.GetAgentAliasOutput, error) - GetAgentAliasRequest(*bedrockagent.GetAgentAliasInput) (*request.Request, *bedrockagent.GetAgentAliasOutput) - - GetAgentKnowledgeBase(*bedrockagent.GetAgentKnowledgeBaseInput) (*bedrockagent.GetAgentKnowledgeBaseOutput, error) - GetAgentKnowledgeBaseWithContext(aws.Context, *bedrockagent.GetAgentKnowledgeBaseInput, ...request.Option) (*bedrockagent.GetAgentKnowledgeBaseOutput, error) - GetAgentKnowledgeBaseRequest(*bedrockagent.GetAgentKnowledgeBaseInput) (*request.Request, *bedrockagent.GetAgentKnowledgeBaseOutput) - - GetAgentVersion(*bedrockagent.GetAgentVersionInput) (*bedrockagent.GetAgentVersionOutput, error) - GetAgentVersionWithContext(aws.Context, *bedrockagent.GetAgentVersionInput, ...request.Option) (*bedrockagent.GetAgentVersionOutput, error) - GetAgentVersionRequest(*bedrockagent.GetAgentVersionInput) (*request.Request, *bedrockagent.GetAgentVersionOutput) - - GetDataSource(*bedrockagent.GetDataSourceInput) (*bedrockagent.GetDataSourceOutput, error) - GetDataSourceWithContext(aws.Context, *bedrockagent.GetDataSourceInput, ...request.Option) (*bedrockagent.GetDataSourceOutput, error) - GetDataSourceRequest(*bedrockagent.GetDataSourceInput) (*request.Request, *bedrockagent.GetDataSourceOutput) - - GetIngestionJob(*bedrockagent.GetIngestionJobInput) (*bedrockagent.GetIngestionJobOutput, error) - GetIngestionJobWithContext(aws.Context, *bedrockagent.GetIngestionJobInput, ...request.Option) (*bedrockagent.GetIngestionJobOutput, error) - GetIngestionJobRequest(*bedrockagent.GetIngestionJobInput) (*request.Request, *bedrockagent.GetIngestionJobOutput) - - GetKnowledgeBase(*bedrockagent.GetKnowledgeBaseInput) (*bedrockagent.GetKnowledgeBaseOutput, error) - GetKnowledgeBaseWithContext(aws.Context, *bedrockagent.GetKnowledgeBaseInput, ...request.Option) (*bedrockagent.GetKnowledgeBaseOutput, error) - GetKnowledgeBaseRequest(*bedrockagent.GetKnowledgeBaseInput) (*request.Request, *bedrockagent.GetKnowledgeBaseOutput) - - ListAgentActionGroups(*bedrockagent.ListAgentActionGroupsInput) (*bedrockagent.ListAgentActionGroupsOutput, error) - ListAgentActionGroupsWithContext(aws.Context, *bedrockagent.ListAgentActionGroupsInput, ...request.Option) (*bedrockagent.ListAgentActionGroupsOutput, error) - ListAgentActionGroupsRequest(*bedrockagent.ListAgentActionGroupsInput) (*request.Request, *bedrockagent.ListAgentActionGroupsOutput) - - ListAgentActionGroupsPages(*bedrockagent.ListAgentActionGroupsInput, func(*bedrockagent.ListAgentActionGroupsOutput, bool) bool) error - ListAgentActionGroupsPagesWithContext(aws.Context, *bedrockagent.ListAgentActionGroupsInput, func(*bedrockagent.ListAgentActionGroupsOutput, bool) bool, ...request.Option) error - - ListAgentAliases(*bedrockagent.ListAgentAliasesInput) (*bedrockagent.ListAgentAliasesOutput, error) - ListAgentAliasesWithContext(aws.Context, *bedrockagent.ListAgentAliasesInput, ...request.Option) (*bedrockagent.ListAgentAliasesOutput, error) - ListAgentAliasesRequest(*bedrockagent.ListAgentAliasesInput) (*request.Request, *bedrockagent.ListAgentAliasesOutput) - - ListAgentAliasesPages(*bedrockagent.ListAgentAliasesInput, func(*bedrockagent.ListAgentAliasesOutput, bool) bool) error - ListAgentAliasesPagesWithContext(aws.Context, *bedrockagent.ListAgentAliasesInput, func(*bedrockagent.ListAgentAliasesOutput, bool) bool, ...request.Option) error - - ListAgentKnowledgeBases(*bedrockagent.ListAgentKnowledgeBasesInput) (*bedrockagent.ListAgentKnowledgeBasesOutput, error) - ListAgentKnowledgeBasesWithContext(aws.Context, *bedrockagent.ListAgentKnowledgeBasesInput, ...request.Option) (*bedrockagent.ListAgentKnowledgeBasesOutput, error) - ListAgentKnowledgeBasesRequest(*bedrockagent.ListAgentKnowledgeBasesInput) (*request.Request, *bedrockagent.ListAgentKnowledgeBasesOutput) - - ListAgentKnowledgeBasesPages(*bedrockagent.ListAgentKnowledgeBasesInput, func(*bedrockagent.ListAgentKnowledgeBasesOutput, bool) bool) error - ListAgentKnowledgeBasesPagesWithContext(aws.Context, *bedrockagent.ListAgentKnowledgeBasesInput, func(*bedrockagent.ListAgentKnowledgeBasesOutput, bool) bool, ...request.Option) error - - ListAgentVersions(*bedrockagent.ListAgentVersionsInput) (*bedrockagent.ListAgentVersionsOutput, error) - ListAgentVersionsWithContext(aws.Context, *bedrockagent.ListAgentVersionsInput, ...request.Option) (*bedrockagent.ListAgentVersionsOutput, error) - ListAgentVersionsRequest(*bedrockagent.ListAgentVersionsInput) (*request.Request, *bedrockagent.ListAgentVersionsOutput) - - ListAgentVersionsPages(*bedrockagent.ListAgentVersionsInput, func(*bedrockagent.ListAgentVersionsOutput, bool) bool) error - ListAgentVersionsPagesWithContext(aws.Context, *bedrockagent.ListAgentVersionsInput, func(*bedrockagent.ListAgentVersionsOutput, bool) bool, ...request.Option) error - - ListAgents(*bedrockagent.ListAgentsInput) (*bedrockagent.ListAgentsOutput, error) - ListAgentsWithContext(aws.Context, *bedrockagent.ListAgentsInput, ...request.Option) (*bedrockagent.ListAgentsOutput, error) - ListAgentsRequest(*bedrockagent.ListAgentsInput) (*request.Request, *bedrockagent.ListAgentsOutput) - - ListAgentsPages(*bedrockagent.ListAgentsInput, func(*bedrockagent.ListAgentsOutput, bool) bool) error - ListAgentsPagesWithContext(aws.Context, *bedrockagent.ListAgentsInput, func(*bedrockagent.ListAgentsOutput, bool) bool, ...request.Option) error - - ListDataSources(*bedrockagent.ListDataSourcesInput) (*bedrockagent.ListDataSourcesOutput, error) - ListDataSourcesWithContext(aws.Context, *bedrockagent.ListDataSourcesInput, ...request.Option) (*bedrockagent.ListDataSourcesOutput, error) - ListDataSourcesRequest(*bedrockagent.ListDataSourcesInput) (*request.Request, *bedrockagent.ListDataSourcesOutput) - - ListDataSourcesPages(*bedrockagent.ListDataSourcesInput, func(*bedrockagent.ListDataSourcesOutput, bool) bool) error - ListDataSourcesPagesWithContext(aws.Context, *bedrockagent.ListDataSourcesInput, func(*bedrockagent.ListDataSourcesOutput, bool) bool, ...request.Option) error - - ListIngestionJobs(*bedrockagent.ListIngestionJobsInput) (*bedrockagent.ListIngestionJobsOutput, error) - ListIngestionJobsWithContext(aws.Context, *bedrockagent.ListIngestionJobsInput, ...request.Option) (*bedrockagent.ListIngestionJobsOutput, error) - ListIngestionJobsRequest(*bedrockagent.ListIngestionJobsInput) (*request.Request, *bedrockagent.ListIngestionJobsOutput) - - ListIngestionJobsPages(*bedrockagent.ListIngestionJobsInput, func(*bedrockagent.ListIngestionJobsOutput, bool) bool) error - ListIngestionJobsPagesWithContext(aws.Context, *bedrockagent.ListIngestionJobsInput, func(*bedrockagent.ListIngestionJobsOutput, bool) bool, ...request.Option) error - - ListKnowledgeBases(*bedrockagent.ListKnowledgeBasesInput) (*bedrockagent.ListKnowledgeBasesOutput, error) - ListKnowledgeBasesWithContext(aws.Context, *bedrockagent.ListKnowledgeBasesInput, ...request.Option) (*bedrockagent.ListKnowledgeBasesOutput, error) - ListKnowledgeBasesRequest(*bedrockagent.ListKnowledgeBasesInput) (*request.Request, *bedrockagent.ListKnowledgeBasesOutput) - - ListKnowledgeBasesPages(*bedrockagent.ListKnowledgeBasesInput, func(*bedrockagent.ListKnowledgeBasesOutput, bool) bool) error - ListKnowledgeBasesPagesWithContext(aws.Context, *bedrockagent.ListKnowledgeBasesInput, func(*bedrockagent.ListKnowledgeBasesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*bedrockagent.ListTagsForResourceInput) (*bedrockagent.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *bedrockagent.ListTagsForResourceInput, ...request.Option) (*bedrockagent.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*bedrockagent.ListTagsForResourceInput) (*request.Request, *bedrockagent.ListTagsForResourceOutput) - - PrepareAgent(*bedrockagent.PrepareAgentInput) (*bedrockagent.PrepareAgentOutput, error) - PrepareAgentWithContext(aws.Context, *bedrockagent.PrepareAgentInput, ...request.Option) (*bedrockagent.PrepareAgentOutput, error) - PrepareAgentRequest(*bedrockagent.PrepareAgentInput) (*request.Request, *bedrockagent.PrepareAgentOutput) - - StartIngestionJob(*bedrockagent.StartIngestionJobInput) (*bedrockagent.StartIngestionJobOutput, error) - StartIngestionJobWithContext(aws.Context, *bedrockagent.StartIngestionJobInput, ...request.Option) (*bedrockagent.StartIngestionJobOutput, error) - StartIngestionJobRequest(*bedrockagent.StartIngestionJobInput) (*request.Request, *bedrockagent.StartIngestionJobOutput) - - TagResource(*bedrockagent.TagResourceInput) (*bedrockagent.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *bedrockagent.TagResourceInput, ...request.Option) (*bedrockagent.TagResourceOutput, error) - TagResourceRequest(*bedrockagent.TagResourceInput) (*request.Request, *bedrockagent.TagResourceOutput) - - UntagResource(*bedrockagent.UntagResourceInput) (*bedrockagent.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *bedrockagent.UntagResourceInput, ...request.Option) (*bedrockagent.UntagResourceOutput, error) - UntagResourceRequest(*bedrockagent.UntagResourceInput) (*request.Request, *bedrockagent.UntagResourceOutput) - - UpdateAgent(*bedrockagent.UpdateAgentInput) (*bedrockagent.UpdateAgentOutput, error) - UpdateAgentWithContext(aws.Context, *bedrockagent.UpdateAgentInput, ...request.Option) (*bedrockagent.UpdateAgentOutput, error) - UpdateAgentRequest(*bedrockagent.UpdateAgentInput) (*request.Request, *bedrockagent.UpdateAgentOutput) - - UpdateAgentActionGroup(*bedrockagent.UpdateAgentActionGroupInput) (*bedrockagent.UpdateAgentActionGroupOutput, error) - UpdateAgentActionGroupWithContext(aws.Context, *bedrockagent.UpdateAgentActionGroupInput, ...request.Option) (*bedrockagent.UpdateAgentActionGroupOutput, error) - UpdateAgentActionGroupRequest(*bedrockagent.UpdateAgentActionGroupInput) (*request.Request, *bedrockagent.UpdateAgentActionGroupOutput) - - UpdateAgentAlias(*bedrockagent.UpdateAgentAliasInput) (*bedrockagent.UpdateAgentAliasOutput, error) - UpdateAgentAliasWithContext(aws.Context, *bedrockagent.UpdateAgentAliasInput, ...request.Option) (*bedrockagent.UpdateAgentAliasOutput, error) - UpdateAgentAliasRequest(*bedrockagent.UpdateAgentAliasInput) (*request.Request, *bedrockagent.UpdateAgentAliasOutput) - - UpdateAgentKnowledgeBase(*bedrockagent.UpdateAgentKnowledgeBaseInput) (*bedrockagent.UpdateAgentKnowledgeBaseOutput, error) - UpdateAgentKnowledgeBaseWithContext(aws.Context, *bedrockagent.UpdateAgentKnowledgeBaseInput, ...request.Option) (*bedrockagent.UpdateAgentKnowledgeBaseOutput, error) - UpdateAgentKnowledgeBaseRequest(*bedrockagent.UpdateAgentKnowledgeBaseInput) (*request.Request, *bedrockagent.UpdateAgentKnowledgeBaseOutput) - - UpdateDataSource(*bedrockagent.UpdateDataSourceInput) (*bedrockagent.UpdateDataSourceOutput, error) - UpdateDataSourceWithContext(aws.Context, *bedrockagent.UpdateDataSourceInput, ...request.Option) (*bedrockagent.UpdateDataSourceOutput, error) - UpdateDataSourceRequest(*bedrockagent.UpdateDataSourceInput) (*request.Request, *bedrockagent.UpdateDataSourceOutput) - - UpdateKnowledgeBase(*bedrockagent.UpdateKnowledgeBaseInput) (*bedrockagent.UpdateKnowledgeBaseOutput, error) - UpdateKnowledgeBaseWithContext(aws.Context, *bedrockagent.UpdateKnowledgeBaseInput, ...request.Option) (*bedrockagent.UpdateKnowledgeBaseOutput, error) - UpdateKnowledgeBaseRequest(*bedrockagent.UpdateKnowledgeBaseInput) (*request.Request, *bedrockagent.UpdateKnowledgeBaseOutput) -} - -var _ BedrockAgentAPI = (*bedrockagent.BedrockAgent)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/doc.go deleted file mode 100644 index c497aa38c3c9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bedrockagent provides the client and types for making API -// requests to Agents for Amazon Bedrock. -// -// An example service, deployed with the Octane Service creator, which will -// echo the string -// -// See https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-2023-06-05 for more information on this service. -// -// See bedrockagent package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bedrockagent/ -// -// # Using the Client -// -// To contact Agents for Amazon Bedrock with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Agents for Amazon Bedrock client BedrockAgent for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bedrockagent/#New -package bedrockagent diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/errors.go deleted file mode 100644 index fc7c06983013..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockagent - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // This exception is thrown when a request is denied per access permissions - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // This exception is thrown when there is a conflict performing an operation - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // This exception is thrown if there was an unexpected error during processing - // of request - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // This exception is thrown when a resource referenced by the operation does - // not exist - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // This exception is thrown when a request is made beyond the service quota - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // This exception is thrown when the number of requests exceeds the limit - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // This exception is thrown when the request's input validation fails - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/service.go deleted file mode 100644 index 393775e0bc08..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagent/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockagent - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// BedrockAgent provides the API operation methods for making requests to -// Agents for Amazon Bedrock. See this package's package overview docs -// for details on the service. -// -// BedrockAgent methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type BedrockAgent struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Bedrock Agent" // Name of service. - EndpointsID = "bedrock-agent" // ID to lookup a service endpoint with. - ServiceID = "Bedrock Agent" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the BedrockAgent client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a BedrockAgent client from just a session. -// svc := bedrockagent.New(mySession) -// -// // Create a BedrockAgent client with additional configuration -// svc := bedrockagent.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *BedrockAgent { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "bedrock" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *BedrockAgent { - svc := &BedrockAgent{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-06-05", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a BedrockAgent operation and runs any -// custom request initialization. -func (c *BedrockAgent) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/api.go deleted file mode 100644 index 79fad577e9d8..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/api.go +++ /dev/null @@ -1,4379 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockagentruntime - -import ( - "bytes" - "fmt" - "io" - "sync" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awserr" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/eventstream" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/rest" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opInvokeAgent = "InvokeAgent" - -// InvokeAgentRequest generates a "aws/request.Request" representing the -// client's request for the InvokeAgent 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 InvokeAgent for more information on using the InvokeAgent -// 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 InvokeAgentRequest method. -// req, resp := client.InvokeAgentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeAgent -func (c *BedrockAgentRuntime) InvokeAgentRequest(input *InvokeAgentInput) (req *request.Request, output *InvokeAgentOutput) { - op := &request.Operation{ - Name: opInvokeAgent, - HTTPMethod: "POST", - HTTPPath: "/agents/{agentId}/agentAliases/{agentAliasId}/sessions/{sessionId}/text", - } - - if input == nil { - input = &InvokeAgentInput{} - } - - output = &InvokeAgentOutput{} - req = c.newRequest(op, input, output) - - es := NewInvokeAgentEventStream() - output.eventStream = es - - req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, rest.UnmarshalHandler) - req.Handlers.Unmarshal.PushBack(es.runOutputStream) - req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose) - return -} - -// InvokeAgent API operation for Agents for Amazon Bedrock Runtime. -// -// Invokes the specified Bedrock model to run inference using the input provided -// in the request body. -// -// 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 Agents for Amazon Bedrock Runtime's -// API operation InvokeAgent for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - DependencyFailedException -// This exception is thrown when a request fails due to dependency like Lambda, -// Bedrock, STS resource due to a customer fault (i.e. bad configuration) -// -// - BadGatewayException -// This exception is thrown when a request fails due to dependency like Lambda, -// Bedrock, STS resource -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/InvokeAgent -func (c *BedrockAgentRuntime) InvokeAgent(input *InvokeAgentInput) (*InvokeAgentOutput, error) { - req, out := c.InvokeAgentRequest(input) - return out, req.Send() -} - -// InvokeAgentWithContext is the same as InvokeAgent with the addition of -// the ability to pass a context and additional request options. -// -// See InvokeAgent 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 *BedrockAgentRuntime) InvokeAgentWithContext(ctx aws.Context, input *InvokeAgentInput, opts ...request.Option) (*InvokeAgentOutput, error) { - req, out := c.InvokeAgentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -var _ awserr.Error -var _ time.Time - -// InvokeAgentEventStream provides the event stream handling for the InvokeAgent. -// -// For testing and mocking the event stream this type should be initialized via -// the NewInvokeAgentEventStream constructor function. Using the functional options -// to pass in nested mock behavior. -type InvokeAgentEventStream struct { - - // Reader is the EventStream reader for the ResponseStream - // events. This value is automatically set by the SDK when the API call is made - // Use this member when unit testing your code with the SDK to mock out the - // EventStream Reader. - // - // Must not be nil. - Reader ResponseStreamReader - - outputReader io.ReadCloser - - done chan struct{} - closeOnce sync.Once - err *eventstreamapi.OnceError -} - -// NewInvokeAgentEventStream initializes an InvokeAgentEventStream. -// This function should only be used for testing and mocking the InvokeAgentEventStream -// stream within your application. -// -// The Reader member must be set before reading events from the stream. -// -// es := NewInvokeAgentEventStream(func(o *InvokeAgentEventStream){ -// es.Reader = myMockStreamReader -// }) -func NewInvokeAgentEventStream(opts ...func(*InvokeAgentEventStream)) *InvokeAgentEventStream { - es := &InvokeAgentEventStream{ - done: make(chan struct{}), - err: eventstreamapi.NewOnceError(), - } - - for _, fn := range opts { - fn(es) - } - - return es -} - -func (es *InvokeAgentEventStream) runOnStreamPartClose(r *request.Request) { - if es.done == nil { - return - } - go es.waitStreamPartClose() - -} - -func (es *InvokeAgentEventStream) waitStreamPartClose() { - var outputErrCh <-chan struct{} - if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok { - outputErrCh = v.ErrorSet() - } - var outputClosedCh <-chan struct{} - if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { - outputClosedCh = v.Closed() - } - - select { - case <-es.done: - case <-outputErrCh: - es.err.SetError(es.Reader.Err()) - es.Close() - case <-outputClosedCh: - if err := es.Reader.Err(); err != nil { - es.err.SetError(es.Reader.Err()) - } - es.Close() - } -} - -// Events returns a channel to read events from. -// -// These events are: -// -// - PayloadPart -// - TracePart -// - ResponseStreamUnknownEvent -func (es *InvokeAgentEventStream) Events() <-chan ResponseStreamEvent { - return es.Reader.Events() -} - -func (es *InvokeAgentEventStream) runOutputStream(r *request.Request) { - var opts []func(*eventstream.Decoder) - if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { - opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger)) - } - - unmarshalerForEvent := unmarshalerForResponseStreamEvent{ - metadata: protocol.ResponseMetadata{ - StatusCode: r.HTTPResponse.StatusCode, - RequestID: r.RequestID, - }, - }.UnmarshalerForEventName - - decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...) - eventReader := eventstreamapi.NewEventReader(decoder, - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: r.Handlers.UnmarshalStream, - }, - unmarshalerForEvent, - ) - - es.outputReader = r.HTTPResponse.Body - es.Reader = newReadResponseStream(eventReader) -} - -// Close closes the stream. This will also cause the stream to be closed. -// Close must be called when done using the stream API. Not calling Close -// may result in resource leaks. -// -// You can use the closing of the Reader's Events channel to terminate your -// application's read from the API's stream. -func (es *InvokeAgentEventStream) Close() (err error) { - es.closeOnce.Do(es.safeClose) - return es.Err() -} - -func (es *InvokeAgentEventStream) safeClose() { - if es.done != nil { - close(es.done) - } - - es.Reader.Close() - if es.outputReader != nil { - es.outputReader.Close() - } -} - -// Err returns any error that occurred while reading or writing EventStream -// Events from the service API's response. Returns nil if there were no errors. -func (es *InvokeAgentEventStream) Err() error { - if err := es.err.Err(); err != nil { - return err - } - if err := es.Reader.Err(); err != nil { - return err - } - - return nil -} - -const opRetrieve = "Retrieve" - -// RetrieveRequest generates a "aws/request.Request" representing the -// client's request for the Retrieve 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 Retrieve for more information on using the Retrieve -// 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 RetrieveRequest method. -// req, resp := client.RetrieveRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Retrieve -func (c *BedrockAgentRuntime) RetrieveRequest(input *RetrieveInput) (req *request.Request, output *RetrieveOutput) { - op := &request.Operation{ - Name: opRetrieve, - HTTPMethod: "POST", - HTTPPath: "/knowledgebases/{knowledgeBaseId}/retrieve", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &RetrieveInput{} - } - - output = &RetrieveOutput{} - req = c.newRequest(op, input, output) - return -} - -// Retrieve API operation for Agents for Amazon Bedrock Runtime. -// -// Retrieve from knowledge base. -// -// 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 Agents for Amazon Bedrock Runtime's -// API operation Retrieve for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - DependencyFailedException -// This exception is thrown when a request fails due to dependency like Lambda, -// Bedrock, STS resource due to a customer fault (i.e. bad configuration) -// -// - BadGatewayException -// This exception is thrown when a request fails due to dependency like Lambda, -// Bedrock, STS resource -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/Retrieve -func (c *BedrockAgentRuntime) Retrieve(input *RetrieveInput) (*RetrieveOutput, error) { - req, out := c.RetrieveRequest(input) - return out, req.Send() -} - -// RetrieveWithContext is the same as Retrieve with the addition of -// the ability to pass a context and additional request options. -// -// See Retrieve 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 *BedrockAgentRuntime) RetrieveWithContext(ctx aws.Context, input *RetrieveInput, opts ...request.Option) (*RetrieveOutput, error) { - req, out := c.RetrieveRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// RetrievePages iterates over the pages of a Retrieve operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Retrieve method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a Retrieve operation. -// pageNum := 0 -// err := client.RetrievePages(params, -// func(page *bedrockagentruntime.RetrieveOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *BedrockAgentRuntime) RetrievePages(input *RetrieveInput, fn func(*RetrieveOutput, bool) bool) error { - return c.RetrievePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// RetrievePagesWithContext same as RetrievePages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *BedrockAgentRuntime) RetrievePagesWithContext(ctx aws.Context, input *RetrieveInput, fn func(*RetrieveOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *RetrieveInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.RetrieveRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*RetrieveOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opRetrieveAndGenerate = "RetrieveAndGenerate" - -// RetrieveAndGenerateRequest generates a "aws/request.Request" representing the -// client's request for the RetrieveAndGenerate 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 RetrieveAndGenerate for more information on using the RetrieveAndGenerate -// 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 RetrieveAndGenerateRequest method. -// req, resp := client.RetrieveAndGenerateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerate -func (c *BedrockAgentRuntime) RetrieveAndGenerateRequest(input *RetrieveAndGenerateInput) (req *request.Request, output *RetrieveAndGenerateOutput) { - op := &request.Operation{ - Name: opRetrieveAndGenerate, - HTTPMethod: "POST", - HTTPPath: "/retrieveAndGenerate", - } - - if input == nil { - input = &RetrieveAndGenerateInput{} - } - - output = &RetrieveAndGenerateOutput{} - req = c.newRequest(op, input, output) - return -} - -// RetrieveAndGenerate API operation for Agents for Amazon Bedrock Runtime. -// -// # RetrieveAndGenerate API -// -// 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 Agents for Amazon Bedrock Runtime's -// API operation RetrieveAndGenerate for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// This exception is thrown when there is a conflict performing an operation -// -// - ResourceNotFoundException -// This exception is thrown when a resource referenced by the operation does -// not exist -// -// - ValidationException -// This exception is thrown when the request's input validation fails -// -// - InternalServerException -// This exception is thrown if there was an unexpected error during processing -// of request -// -// - DependencyFailedException -// This exception is thrown when a request fails due to dependency like Lambda, -// Bedrock, STS resource due to a customer fault (i.e. bad configuration) -// -// - BadGatewayException -// This exception is thrown when a request fails due to dependency like Lambda, -// Bedrock, STS resource -// -// - ThrottlingException -// This exception is thrown when the number of requests exceeds the limit -// -// - AccessDeniedException -// This exception is thrown when a request is denied per access permissions -// -// - ServiceQuotaExceededException -// This exception is thrown when a request is made beyond the service quota -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26/RetrieveAndGenerate -func (c *BedrockAgentRuntime) RetrieveAndGenerate(input *RetrieveAndGenerateInput) (*RetrieveAndGenerateOutput, error) { - req, out := c.RetrieveAndGenerateRequest(input) - return out, req.Send() -} - -// RetrieveAndGenerateWithContext is the same as RetrieveAndGenerate with the addition of -// the ability to pass a context and additional request options. -// -// See RetrieveAndGenerate 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 *BedrockAgentRuntime) RetrieveAndGenerateWithContext(ctx aws.Context, input *RetrieveAndGenerateInput, opts ...request.Option) (*RetrieveAndGenerateOutput, error) { - req, out := c.RetrieveAndGenerateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// This exception is thrown when a request is denied per access permissions -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -// The AccessDeniedException is and event in the ResponseStream group of events. -func (s *AccessDeniedException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the AccessDeniedException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *AccessDeniedException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *AccessDeniedException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// input to lambda used in action group -type ActionGroupInvocationInput_ struct { - _ struct{} `type:"structure"` - - // Agent Trace Action Group Name - // - // ActionGroupName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ActionGroupInvocationInput_'s - // String and GoString methods. - ActionGroupName *string `locationName:"actionGroupName" type:"string" sensitive:"true"` - - // Agent Trace Action Group API path - // - // ApiPath is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ActionGroupInvocationInput_'s - // String and GoString methods. - ApiPath *string `locationName:"apiPath" type:"string" sensitive:"true"` - - // list of parameters included in action group invocation - Parameters []*Parameter `locationName:"parameters" type:"list"` - - // Request Body Content Map - RequestBody *RequestBody `locationName:"requestBody" type:"structure"` - - // Agent Trace Action Group Action verb - // - // Verb is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ActionGroupInvocationInput_'s - // String and GoString methods. - Verb *string `locationName:"verb" type:"string" sensitive:"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 ActionGroupInvocationInput_) 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 ActionGroupInvocationInput_) GoString() string { - return s.String() -} - -// SetActionGroupName sets the ActionGroupName field's value. -func (s *ActionGroupInvocationInput_) SetActionGroupName(v string) *ActionGroupInvocationInput_ { - s.ActionGroupName = &v - return s -} - -// SetApiPath sets the ApiPath field's value. -func (s *ActionGroupInvocationInput_) SetApiPath(v string) *ActionGroupInvocationInput_ { - s.ApiPath = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ActionGroupInvocationInput_) SetParameters(v []*Parameter) *ActionGroupInvocationInput_ { - s.Parameters = v - return s -} - -// SetRequestBody sets the RequestBody field's value. -func (s *ActionGroupInvocationInput_) SetRequestBody(v *RequestBody) *ActionGroupInvocationInput_ { - s.RequestBody = v - return s -} - -// SetVerb sets the Verb field's value. -func (s *ActionGroupInvocationInput_) SetVerb(v string) *ActionGroupInvocationInput_ { - s.Verb = &v - return s -} - -// output from lambda used in action group -type ActionGroupInvocationOutput_ struct { - _ struct{} `type:"structure"` - - // Agent Trace Action Group Lambda Invocation Output String - // - // Text is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ActionGroupInvocationOutput_'s - // String and GoString methods. - Text *string `locationName:"text" type:"string" sensitive:"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 ActionGroupInvocationOutput_) 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 ActionGroupInvocationOutput_) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *ActionGroupInvocationOutput_) SetText(v string) *ActionGroupInvocationOutput_ { - s.Text = &v - return s -} - -// Citations associated with final agent response -type Attribution struct { - _ struct{} `type:"structure"` - - // List of citations - Citations []*Citation `locationName:"citations" type:"list"` -} - -// 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 Attribution) 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 Attribution) GoString() string { - return s.String() -} - -// SetCitations sets the Citations field's value. -func (s *Attribution) SetCitations(v []*Citation) *Attribution { - s.Citations = v - return s -} - -// This exception is thrown when a request fails due to dependency like Lambda, -// Bedrock, STS resource -type BadGatewayException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" type:"string"` - - // Non Blank String - ResourceName *string `locationName:"resourceName" 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 BadGatewayException) 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 BadGatewayException) GoString() string { - return s.String() -} - -// The BadGatewayException is and event in the ResponseStream group of events. -func (s *BadGatewayException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the BadGatewayException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *BadGatewayException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *BadGatewayException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorBadGatewayException(v protocol.ResponseMetadata) error { - return &BadGatewayException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *BadGatewayException) Code() string { - return "BadGatewayException" -} - -// Message returns the exception's message. -func (s *BadGatewayException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *BadGatewayException) OrigErr() error { - return nil -} - -func (s *BadGatewayException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *BadGatewayException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *BadGatewayException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Citation associated with the agent response -type Citation struct { - _ struct{} `type:"structure"` - - // Generate response part - GeneratedResponsePart *GeneratedResponsePart `locationName:"generatedResponsePart" type:"structure"` - - // list of retrieved references - RetrievedReferences []*RetrievedReference `locationName:"retrievedReferences" type:"list"` -} - -// 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 Citation) 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 Citation) GoString() string { - return s.String() -} - -// SetGeneratedResponsePart sets the GeneratedResponsePart field's value. -func (s *Citation) SetGeneratedResponsePart(v *GeneratedResponsePart) *Citation { - s.GeneratedResponsePart = v - return s -} - -// SetRetrievedReferences sets the RetrievedReferences field's value. -func (s *Citation) SetRetrievedReferences(v []*RetrievedReference) *Citation { - s.RetrievedReferences = v - return s -} - -// This exception is thrown when there is a conflict performing an operation -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -// The ConflictException is and event in the ResponseStream group of events. -func (s *ConflictException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ConflictException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ConflictException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ConflictException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when a request fails due to dependency like Lambda, -// Bedrock, STS resource due to a customer fault (i.e. bad configuration) -type DependencyFailedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" type:"string"` - - // Non Blank String - ResourceName *string `locationName:"resourceName" 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 DependencyFailedException) 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 DependencyFailedException) GoString() string { - return s.String() -} - -// The DependencyFailedException is and event in the ResponseStream group of events. -func (s *DependencyFailedException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the DependencyFailedException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *DependencyFailedException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *DependencyFailedException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorDependencyFailedException(v protocol.ResponseMetadata) error { - return &DependencyFailedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DependencyFailedException) Code() string { - return "DependencyFailedException" -} - -// Message returns the exception's message. -func (s *DependencyFailedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DependencyFailedException) OrigErr() error { - return nil -} - -func (s *DependencyFailedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DependencyFailedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DependencyFailedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Trace Part which is emitted when agent trace could not be generated -type FailureTrace struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Agent Trace Failed Reason String - // - // FailureReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by FailureTrace's - // String and GoString methods. - FailureReason *string `locationName:"failureReason" type:"string" sensitive:"true"` - - // Identifier for trace - TraceId *string `locationName:"traceId" min:"2" 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 FailureTrace) 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 FailureTrace) GoString() string { - return s.String() -} - -// SetFailureReason sets the FailureReason field's value. -func (s *FailureTrace) SetFailureReason(v string) *FailureTrace { - s.FailureReason = &v - return s -} - -// SetTraceId sets the TraceId field's value. -func (s *FailureTrace) SetTraceId(v string) *FailureTrace { - s.TraceId = &v - return s -} - -// Agent finish output -type FinalResponse struct { - _ struct{} `type:"structure"` - - // Agent Trace Action Group Lambda Invocation Output String - // - // Text is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by FinalResponse's - // String and GoString methods. - Text *string `locationName:"text" type:"string" sensitive:"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 FinalResponse) 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 FinalResponse) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *FinalResponse) SetText(v string) *FinalResponse { - s.Text = &v - return s -} - -// Generate response part -type GeneratedResponsePart struct { - _ struct{} `type:"structure"` - - // Text response part - TextResponsePart *TextResponsePart `locationName:"textResponsePart" 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 GeneratedResponsePart) 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 GeneratedResponsePart) GoString() string { - return s.String() -} - -// SetTextResponsePart sets the TextResponsePart field's value. -func (s *GeneratedResponsePart) SetTextResponsePart(v *TextResponsePart) *GeneratedResponsePart { - s.TextResponsePart = v - return s -} - -// Configurations for controlling the inference response of an InvokeAgent API -// call -type InferenceConfiguration struct { - _ struct{} `type:"structure"` - - // Maximum length of output - MaximumLength *int64 `locationName:"maximumLength" type:"integer"` - - // List of stop sequences - StopSequences []*string `locationName:"stopSequences" type:"list"` - - // Controls randomness, higher values increase diversity - Temperature *float64 `locationName:"temperature" type:"float"` - - // Sample from the k most likely next tokens - TopK *int64 `locationName:"topK" type:"integer"` - - // Cumulative probability cutoff for token selection - TopP *float64 `locationName:"topP" type:"float"` -} - -// 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 InferenceConfiguration) 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 InferenceConfiguration) GoString() string { - return s.String() -} - -// SetMaximumLength sets the MaximumLength field's value. -func (s *InferenceConfiguration) SetMaximumLength(v int64) *InferenceConfiguration { - s.MaximumLength = &v - return s -} - -// SetStopSequences sets the StopSequences field's value. -func (s *InferenceConfiguration) SetStopSequences(v []*string) *InferenceConfiguration { - s.StopSequences = v - return s -} - -// SetTemperature sets the Temperature field's value. -func (s *InferenceConfiguration) SetTemperature(v float64) *InferenceConfiguration { - s.Temperature = &v - return s -} - -// SetTopK sets the TopK field's value. -func (s *InferenceConfiguration) SetTopK(v int64) *InferenceConfiguration { - s.TopK = &v - return s -} - -// SetTopP sets the TopP field's value. -func (s *InferenceConfiguration) SetTopP(v float64) *InferenceConfiguration { - s.TopP = &v - return s -} - -// This exception is thrown if there was an unexpected error during processing -// of request -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -// The InternalServerException is and event in the ResponseStream group of events. -func (s *InternalServerException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the InternalServerException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *InternalServerException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *InternalServerException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Trace Part which contains input details for action group or knowledge base -type InvocationInput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // input to lambda used in action group - ActionGroupInvocationInput *ActionGroupInvocationInput_ `locationName:"actionGroupInvocationInput" type:"structure"` - - // types of invocations - InvocationType *string `locationName:"invocationType" type:"string" enum:"InvocationType"` - - // Input to lambda used in action group - KnowledgeBaseLookupInput *KnowledgeBaseLookupInput_ `locationName:"knowledgeBaseLookupInput" type:"structure"` - - // Identifier for trace - TraceId *string `locationName:"traceId" min:"2" 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 InvocationInput_) 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 InvocationInput_) GoString() string { - return s.String() -} - -// SetActionGroupInvocationInput sets the ActionGroupInvocationInput field's value. -func (s *InvocationInput_) SetActionGroupInvocationInput(v *ActionGroupInvocationInput_) *InvocationInput_ { - s.ActionGroupInvocationInput = v - return s -} - -// SetInvocationType sets the InvocationType field's value. -func (s *InvocationInput_) SetInvocationType(v string) *InvocationInput_ { - s.InvocationType = &v - return s -} - -// SetKnowledgeBaseLookupInput sets the KnowledgeBaseLookupInput field's value. -func (s *InvocationInput_) SetKnowledgeBaseLookupInput(v *KnowledgeBaseLookupInput_) *InvocationInput_ { - s.KnowledgeBaseLookupInput = v - return s -} - -// SetTraceId sets the TraceId field's value. -func (s *InvocationInput_) SetTraceId(v string) *InvocationInput_ { - s.TraceId = &v - return s -} - -// InvokeAgent Request -type InvokeAgentInput struct { - _ struct{} `type:"structure"` - - // Identifier for Agent Alias - // - // AgentAliasId is a required field - AgentAliasId *string `location:"uri" locationName:"agentAliasId" type:"string" required:"true"` - - // Identifier for Agent - // - // AgentId is a required field - AgentId *string `location:"uri" locationName:"agentId" type:"string" required:"true"` - - // Enable agent trace events for improved debugging - EnableTrace *bool `locationName:"enableTrace" type:"boolean"` - - // End current session - EndSession *bool `locationName:"endSession" type:"boolean"` - - // Input data in the format specified in the Content-Type request header. - // - // InputText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InvokeAgentInput's - // String and GoString methods. - // - // InputText is a required field - InputText *string `locationName:"inputText" type:"string" required:"true" sensitive:"true"` - - // Identifier used for the current session - // - // SessionId is a required field - SessionId *string `location:"uri" locationName:"sessionId" min:"2" type:"string" required:"true"` - - // Session state passed by customer. Base64 encoded json string representation - // of SessionState. - SessionState *SessionState `locationName:"sessionState" 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 InvokeAgentInput) 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 InvokeAgentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvokeAgentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvokeAgentInput"} - if s.AgentAliasId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentAliasId")) - } - if s.AgentAliasId != nil && len(*s.AgentAliasId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentAliasId", 1)) - } - if s.AgentId == nil { - invalidParams.Add(request.NewErrParamRequired("AgentId")) - } - if s.AgentId != nil && len(*s.AgentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AgentId", 1)) - } - if s.InputText == nil { - invalidParams.Add(request.NewErrParamRequired("InputText")) - } - if s.SessionId == nil { - invalidParams.Add(request.NewErrParamRequired("SessionId")) - } - if s.SessionId != nil && len(*s.SessionId) < 2 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentAliasId sets the AgentAliasId field's value. -func (s *InvokeAgentInput) SetAgentAliasId(v string) *InvokeAgentInput { - s.AgentAliasId = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *InvokeAgentInput) SetAgentId(v string) *InvokeAgentInput { - s.AgentId = &v - return s -} - -// SetEnableTrace sets the EnableTrace field's value. -func (s *InvokeAgentInput) SetEnableTrace(v bool) *InvokeAgentInput { - s.EnableTrace = &v - return s -} - -// SetEndSession sets the EndSession field's value. -func (s *InvokeAgentInput) SetEndSession(v bool) *InvokeAgentInput { - s.EndSession = &v - return s -} - -// SetInputText sets the InputText field's value. -func (s *InvokeAgentInput) SetInputText(v string) *InvokeAgentInput { - s.InputText = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *InvokeAgentInput) SetSessionId(v string) *InvokeAgentInput { - s.SessionId = &v - return s -} - -// SetSessionState sets the SessionState field's value. -func (s *InvokeAgentInput) SetSessionState(v *SessionState) *InvokeAgentInput { - s.SessionState = v - return s -} - -// InvokeAgent Response -type InvokeAgentOutput struct { - _ struct{} `type:"structure" payload:"Completion"` - - eventStream *InvokeAgentEventStream - - // streaming response mimetype of the model - // - // ContentType is a required field - ContentType *string `location:"header" locationName:"x-amzn-bedrock-agent-content-type" type:"string" required:"true"` - - // streaming response mimetype of the model - // - // SessionId is a required field - SessionId *string `location:"header" locationName:"x-amz-bedrock-agent-session-id" min:"2" 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 InvokeAgentOutput) 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 InvokeAgentOutput) GoString() string { - return s.String() -} - -// SetContentType sets the ContentType field's value. -func (s *InvokeAgentOutput) SetContentType(v string) *InvokeAgentOutput { - s.ContentType = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *InvokeAgentOutput) SetSessionId(v string) *InvokeAgentOutput { - s.SessionId = &v - return s -} - -// GetStream returns the type to interact with the event stream. -func (s *InvokeAgentOutput) GetStream() *InvokeAgentEventStream { - return s.eventStream -} - -// Input to lambda used in action group -type KnowledgeBaseLookupInput_ struct { - _ struct{} `type:"structure"` - - // Agent Trace Action Group Knowledge Base Id - // - // KnowledgeBaseId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by KnowledgeBaseLookupInput_'s - // String and GoString methods. - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" sensitive:"true"` - - // Agent Trace Action Group Lambda Invocation Output String - // - // Text is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by KnowledgeBaseLookupInput_'s - // String and GoString methods. - Text *string `locationName:"text" type:"string" sensitive:"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 KnowledgeBaseLookupInput_) 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 KnowledgeBaseLookupInput_) GoString() string { - return s.String() -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *KnowledgeBaseLookupInput_) SetKnowledgeBaseId(v string) *KnowledgeBaseLookupInput_ { - s.KnowledgeBaseId = &v - return s -} - -// SetText sets the Text field's value. -func (s *KnowledgeBaseLookupInput_) SetText(v string) *KnowledgeBaseLookupInput_ { - s.Text = &v - return s -} - -// Input to lambda used in action group -type KnowledgeBaseLookupOutput_ struct { - _ struct{} `type:"structure"` - - // list of retrieved references - RetrievedReferences []*RetrievedReference `locationName:"retrievedReferences" type:"list"` -} - -// 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 KnowledgeBaseLookupOutput_) 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 KnowledgeBaseLookupOutput_) GoString() string { - return s.String() -} - -// SetRetrievedReferences sets the RetrievedReferences field's value. -func (s *KnowledgeBaseLookupOutput_) SetRetrievedReferences(v []*RetrievedReference) *KnowledgeBaseLookupOutput_ { - s.RetrievedReferences = v - return s -} - -// Knowledge base input query. -type KnowledgeBaseQuery struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Knowledge base input query in text - // - // Text is a required field - Text *string `locationName:"text" 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 KnowledgeBaseQuery) 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 KnowledgeBaseQuery) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KnowledgeBaseQuery) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KnowledgeBaseQuery"} - if s.Text == nil { - invalidParams.Add(request.NewErrParamRequired("Text")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetText sets the Text field's value. -func (s *KnowledgeBaseQuery) SetText(v string) *KnowledgeBaseQuery { - s.Text = &v - return s -} - -// Search parameters for retrieving from knowledge base. -type KnowledgeBaseRetrievalConfiguration struct { - _ struct{} `type:"structure"` - - // Knowledge base vector search configuration - // - // VectorSearchConfiguration is a required field - VectorSearchConfiguration *KnowledgeBaseVectorSearchConfiguration `locationName:"vectorSearchConfiguration" type:"structure" 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 KnowledgeBaseRetrievalConfiguration) 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 KnowledgeBaseRetrievalConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KnowledgeBaseRetrievalConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KnowledgeBaseRetrievalConfiguration"} - if s.VectorSearchConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("VectorSearchConfiguration")) - } - if s.VectorSearchConfiguration != nil { - if err := s.VectorSearchConfiguration.Validate(); err != nil { - invalidParams.AddNested("VectorSearchConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVectorSearchConfiguration sets the VectorSearchConfiguration field's value. -func (s *KnowledgeBaseRetrievalConfiguration) SetVectorSearchConfiguration(v *KnowledgeBaseVectorSearchConfiguration) *KnowledgeBaseRetrievalConfiguration { - s.VectorSearchConfiguration = v - return s -} - -// Result item returned from a knowledge base retrieval. -type KnowledgeBaseRetrievalResult struct { - _ struct{} `type:"structure"` - - // Content of a retrieval result. - // - // Content is a required field - Content *RetrievalResultContent `locationName:"content" type:"structure" required:"true"` - - // The source location of a retrieval result. - Location *RetrievalResultLocation `locationName:"location" type:"structure"` - - // The relevance score of a result. - Score *float64 `locationName:"score" type:"double"` -} - -// 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 KnowledgeBaseRetrievalResult) 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 KnowledgeBaseRetrievalResult) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *KnowledgeBaseRetrievalResult) SetContent(v *RetrievalResultContent) *KnowledgeBaseRetrievalResult { - s.Content = v - return s -} - -// SetLocation sets the Location field's value. -func (s *KnowledgeBaseRetrievalResult) SetLocation(v *RetrievalResultLocation) *KnowledgeBaseRetrievalResult { - s.Location = v - return s -} - -// SetScore sets the Score field's value. -func (s *KnowledgeBaseRetrievalResult) SetScore(v float64) *KnowledgeBaseRetrievalResult { - s.Score = &v - return s -} - -// Configurations for retrieval and generation for knowledge base. -type KnowledgeBaseRetrieveAndGenerateConfiguration struct { - _ struct{} `type:"structure"` - - // Identifier of the KnowledgeBase - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Arn of a Bedrock model. - // - // ModelArn is a required field - ModelArn *string `locationName:"modelArn" min:"20" 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 KnowledgeBaseRetrieveAndGenerateConfiguration) 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 KnowledgeBaseRetrieveAndGenerateConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KnowledgeBaseRetrieveAndGenerateConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KnowledgeBaseRetrieveAndGenerateConfiguration"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.ModelArn == nil { - invalidParams.Add(request.NewErrParamRequired("ModelArn")) - } - if s.ModelArn != nil && len(*s.ModelArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ModelArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *KnowledgeBaseRetrieveAndGenerateConfiguration) SetKnowledgeBaseId(v string) *KnowledgeBaseRetrieveAndGenerateConfiguration { - s.KnowledgeBaseId = &v - return s -} - -// SetModelArn sets the ModelArn field's value. -func (s *KnowledgeBaseRetrieveAndGenerateConfiguration) SetModelArn(v string) *KnowledgeBaseRetrieveAndGenerateConfiguration { - s.ModelArn = &v - return s -} - -// Knowledge base vector search configuration -type KnowledgeBaseVectorSearchConfiguration struct { - _ struct{} `type:"structure"` - - // Top-K results to retrieve from knowledge base. - // - // NumberOfResults is a required field - NumberOfResults *int64 `locationName:"numberOfResults" min:"1" type:"integer" 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 KnowledgeBaseVectorSearchConfiguration) 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 KnowledgeBaseVectorSearchConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KnowledgeBaseVectorSearchConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KnowledgeBaseVectorSearchConfiguration"} - if s.NumberOfResults == nil { - invalidParams.Add(request.NewErrParamRequired("NumberOfResults")) - } - if s.NumberOfResults != nil && *s.NumberOfResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("NumberOfResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNumberOfResults sets the NumberOfResults field's value. -func (s *KnowledgeBaseVectorSearchConfiguration) SetNumberOfResults(v int64) *KnowledgeBaseVectorSearchConfiguration { - s.NumberOfResults = &v - return s -} - -// Trace Part which contains information used to call Invoke Model -type ModelInvocationInput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Configurations for controlling the inference response of an InvokeAgent API - // call - InferenceConfiguration *InferenceConfiguration `locationName:"inferenceConfiguration" type:"structure"` - - // ARN of a Lambda. - OverrideLambda *string `locationName:"overrideLambda" type:"string"` - - // indicates if agent uses default prompt or overriden prompt - ParserMode *string `locationName:"parserMode" type:"string" enum:"CreationMode"` - - // indicates if agent uses default prompt or overriden prompt - PromptCreationMode *string `locationName:"promptCreationMode" type:"string" enum:"CreationMode"` - - // Prompt Message - // - // Text is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ModelInvocationInput_'s - // String and GoString methods. - Text *string `locationName:"text" type:"string" sensitive:"true"` - - // Identifier for trace - TraceId *string `locationName:"traceId" min:"2" type:"string"` - - // types of prompts - Type *string `locationName:"type" type:"string" enum:"PromptType"` -} - -// 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 ModelInvocationInput_) 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 ModelInvocationInput_) GoString() string { - return s.String() -} - -// SetInferenceConfiguration sets the InferenceConfiguration field's value. -func (s *ModelInvocationInput_) SetInferenceConfiguration(v *InferenceConfiguration) *ModelInvocationInput_ { - s.InferenceConfiguration = v - return s -} - -// SetOverrideLambda sets the OverrideLambda field's value. -func (s *ModelInvocationInput_) SetOverrideLambda(v string) *ModelInvocationInput_ { - s.OverrideLambda = &v - return s -} - -// SetParserMode sets the ParserMode field's value. -func (s *ModelInvocationInput_) SetParserMode(v string) *ModelInvocationInput_ { - s.ParserMode = &v - return s -} - -// SetPromptCreationMode sets the PromptCreationMode field's value. -func (s *ModelInvocationInput_) SetPromptCreationMode(v string) *ModelInvocationInput_ { - s.PromptCreationMode = &v - return s -} - -// SetText sets the Text field's value. -func (s *ModelInvocationInput_) SetText(v string) *ModelInvocationInput_ { - s.Text = &v - return s -} - -// SetTraceId sets the TraceId field's value. -func (s *ModelInvocationInput_) SetTraceId(v string) *ModelInvocationInput_ { - s.TraceId = &v - return s -} - -// SetType sets the Type field's value. -func (s *ModelInvocationInput_) SetType(v string) *ModelInvocationInput_ { - s.Type = &v - return s -} - -// Trace Part which contains output details for action group or knowledge base -// or final response -type Observation struct { - _ struct{} `type:"structure" sensitive:"true"` - - // output from lambda used in action group - ActionGroupInvocationOutput *ActionGroupInvocationOutput_ `locationName:"actionGroupInvocationOutput" type:"structure"` - - // Agent finish output - FinalResponse *FinalResponse `locationName:"finalResponse" type:"structure"` - - // Input to lambda used in action group - KnowledgeBaseLookupOutput *KnowledgeBaseLookupOutput_ `locationName:"knowledgeBaseLookupOutput" type:"structure"` - - // Observation information if there were reprompts - // - // RepromptResponse is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Observation's - // String and GoString methods. - RepromptResponse *RepromptResponse `locationName:"repromptResponse" type:"structure" sensitive:"true"` - - // Identifier for trace - TraceId *string `locationName:"traceId" min:"2" type:"string"` - - // types of observations - Type *string `locationName:"type" type:"string" enum:"Type"` -} - -// 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 Observation) 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 Observation) GoString() string { - return s.String() -} - -// SetActionGroupInvocationOutput sets the ActionGroupInvocationOutput field's value. -func (s *Observation) SetActionGroupInvocationOutput(v *ActionGroupInvocationOutput_) *Observation { - s.ActionGroupInvocationOutput = v - return s -} - -// SetFinalResponse sets the FinalResponse field's value. -func (s *Observation) SetFinalResponse(v *FinalResponse) *Observation { - s.FinalResponse = v - return s -} - -// SetKnowledgeBaseLookupOutput sets the KnowledgeBaseLookupOutput field's value. -func (s *Observation) SetKnowledgeBaseLookupOutput(v *KnowledgeBaseLookupOutput_) *Observation { - s.KnowledgeBaseLookupOutput = v - return s -} - -// SetRepromptResponse sets the RepromptResponse field's value. -func (s *Observation) SetRepromptResponse(v *RepromptResponse) *Observation { - s.RepromptResponse = v - return s -} - -// SetTraceId sets the TraceId field's value. -func (s *Observation) SetTraceId(v string) *Observation { - s.TraceId = &v - return s -} - -// SetType sets the Type field's value. -func (s *Observation) SetType(v string) *Observation { - s.Type = &v - return s -} - -// Trace contains intermidate response during orchestration -type OrchestrationTrace struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Trace Part which contains input details for action group or knowledge base - // - // InvocationInput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by OrchestrationTrace's - // String and GoString methods. - InvocationInput *InvocationInput_ `locationName:"invocationInput" type:"structure" sensitive:"true"` - - // Trace Part which contains information used to call Invoke Model - // - // ModelInvocationInput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by OrchestrationTrace's - // String and GoString methods. - ModelInvocationInput *ModelInvocationInput_ `locationName:"modelInvocationInput" type:"structure" sensitive:"true"` - - // Trace Part which contains output details for action group or knowledge base - // or final response - // - // Observation is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by OrchestrationTrace's - // String and GoString methods. - Observation *Observation `locationName:"observation" type:"structure" sensitive:"true"` - - // Trace Part which contains information related to reasoning - // - // Rationale is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by OrchestrationTrace's - // String and GoString methods. - Rationale *Rationale `locationName:"rationale" type:"structure" sensitive:"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 OrchestrationTrace) 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 OrchestrationTrace) GoString() string { - return s.String() -} - -// SetInvocationInput sets the InvocationInput field's value. -func (s *OrchestrationTrace) SetInvocationInput(v *InvocationInput_) *OrchestrationTrace { - s.InvocationInput = v - return s -} - -// SetModelInvocationInput sets the ModelInvocationInput field's value. -func (s *OrchestrationTrace) SetModelInvocationInput(v *ModelInvocationInput_) *OrchestrationTrace { - s.ModelInvocationInput = v - return s -} - -// SetObservation sets the Observation field's value. -func (s *OrchestrationTrace) SetObservation(v *Observation) *OrchestrationTrace { - s.Observation = v - return s -} - -// SetRationale sets the Rationale field's value. -func (s *OrchestrationTrace) SetRationale(v *Rationale) *OrchestrationTrace { - s.Rationale = v - return s -} - -// parameters included in action group invocation -type Parameter struct { - _ struct{} `type:"structure"` - - // Name of parameter - Name *string `locationName:"name" type:"string"` - - // Type of parameter - Type *string `locationName:"type" type:"string"` - - // Value of parameter - Value *string `locationName:"value" 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 Parameter) 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 Parameter) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Parameter) SetName(v string) *Parameter { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *Parameter) SetType(v string) *Parameter { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Parameter) SetValue(v string) *Parameter { - s.Value = &v - return s -} - -// Base 64 endoded byte response -type PayloadPart struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Citations associated with final agent response - Attribution *Attribution `locationName:"attribution" type:"structure"` - - // PartBody of the payload in bytes - // - // Bytes is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PayloadPart's - // String and GoString methods. - // - // Bytes is automatically base64 encoded/decoded by the SDK. - Bytes []byte `locationName:"bytes" type:"blob" sensitive:"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 PayloadPart) 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 PayloadPart) GoString() string { - return s.String() -} - -// SetAttribution sets the Attribution field's value. -func (s *PayloadPart) SetAttribution(v *Attribution) *PayloadPart { - s.Attribution = v - return s -} - -// SetBytes sets the Bytes field's value. -func (s *PayloadPart) SetBytes(v []byte) *PayloadPart { - s.Bytes = v - return s -} - -// The PayloadPart is and event in the ResponseStream group of events. -func (s *PayloadPart) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the PayloadPart value. -// This method is only used internally within the SDK's EventStream handling. -func (s *PayloadPart) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *PayloadPart) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -// Trace Part which contains information related to postprocessing -type PostProcessingModelInvocationOutput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Trace Part which contains information if preprocessing was successful - // - // ParsedResponse is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PostProcessingModelInvocationOutput_'s - // String and GoString methods. - ParsedResponse *PostProcessingParsedResponse `locationName:"parsedResponse" type:"structure" sensitive:"true"` - - // Identifier for trace - TraceId *string `locationName:"traceId" min:"2" 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 PostProcessingModelInvocationOutput_) 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 PostProcessingModelInvocationOutput_) GoString() string { - return s.String() -} - -// SetParsedResponse sets the ParsedResponse field's value. -func (s *PostProcessingModelInvocationOutput_) SetParsedResponse(v *PostProcessingParsedResponse) *PostProcessingModelInvocationOutput_ { - s.ParsedResponse = v - return s -} - -// SetTraceId sets the TraceId field's value. -func (s *PostProcessingModelInvocationOutput_) SetTraceId(v string) *PostProcessingModelInvocationOutput_ { - s.TraceId = &v - return s -} - -// Trace Part which contains information if preprocessing was successful -type PostProcessingParsedResponse struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Agent Trace Output String - // - // Text is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PostProcessingParsedResponse's - // String and GoString methods. - Text *string `locationName:"text" type:"string" sensitive:"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 PostProcessingParsedResponse) 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 PostProcessingParsedResponse) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *PostProcessingParsedResponse) SetText(v string) *PostProcessingParsedResponse { - s.Text = &v - return s -} - -// Trace Part which contains information related to post processing step -type PostProcessingTrace struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Trace Part which contains information used to call Invoke Model - // - // ModelInvocationInput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PostProcessingTrace's - // String and GoString methods. - ModelInvocationInput *ModelInvocationInput_ `locationName:"modelInvocationInput" type:"structure" sensitive:"true"` - - // Trace Part which contains information related to postprocessing - // - // ModelInvocationOutput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PostProcessingTrace's - // String and GoString methods. - ModelInvocationOutput *PostProcessingModelInvocationOutput_ `locationName:"modelInvocationOutput" type:"structure" sensitive:"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 PostProcessingTrace) 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 PostProcessingTrace) GoString() string { - return s.String() -} - -// SetModelInvocationInput sets the ModelInvocationInput field's value. -func (s *PostProcessingTrace) SetModelInvocationInput(v *ModelInvocationInput_) *PostProcessingTrace { - s.ModelInvocationInput = v - return s -} - -// SetModelInvocationOutput sets the ModelInvocationOutput field's value. -func (s *PostProcessingTrace) SetModelInvocationOutput(v *PostProcessingModelInvocationOutput_) *PostProcessingTrace { - s.ModelInvocationOutput = v - return s -} - -// Trace Part which contains information related to preprocessing -type PreProcessingModelInvocationOutput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Trace Part which contains information if preprocessing was successful - // - // ParsedResponse is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PreProcessingModelInvocationOutput_'s - // String and GoString methods. - ParsedResponse *PreProcessingParsedResponse `locationName:"parsedResponse" type:"structure" sensitive:"true"` - - // Identifier for trace - TraceId *string `locationName:"traceId" min:"2" 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 PreProcessingModelInvocationOutput_) 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 PreProcessingModelInvocationOutput_) GoString() string { - return s.String() -} - -// SetParsedResponse sets the ParsedResponse field's value. -func (s *PreProcessingModelInvocationOutput_) SetParsedResponse(v *PreProcessingParsedResponse) *PreProcessingModelInvocationOutput_ { - s.ParsedResponse = v - return s -} - -// SetTraceId sets the TraceId field's value. -func (s *PreProcessingModelInvocationOutput_) SetTraceId(v string) *PreProcessingModelInvocationOutput_ { - s.TraceId = &v - return s -} - -// Trace Part which contains information if preprocessing was successful -type PreProcessingParsedResponse struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Boolean value - IsValid *bool `locationName:"isValid" type:"boolean"` - - // Agent Trace Rationale String - // - // Rationale is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PreProcessingParsedResponse's - // String and GoString methods. - Rationale *string `locationName:"rationale" type:"string" sensitive:"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 PreProcessingParsedResponse) 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 PreProcessingParsedResponse) GoString() string { - return s.String() -} - -// SetIsValid sets the IsValid field's value. -func (s *PreProcessingParsedResponse) SetIsValid(v bool) *PreProcessingParsedResponse { - s.IsValid = &v - return s -} - -// SetRationale sets the Rationale field's value. -func (s *PreProcessingParsedResponse) SetRationale(v string) *PreProcessingParsedResponse { - s.Rationale = &v - return s -} - -// Trace Part which contains information related to preprocessing step -type PreProcessingTrace struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Trace Part which contains information used to call Invoke Model - // - // ModelInvocationInput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PreProcessingTrace's - // String and GoString methods. - ModelInvocationInput *ModelInvocationInput_ `locationName:"modelInvocationInput" type:"structure" sensitive:"true"` - - // Trace Part which contains information related to preprocessing - // - // ModelInvocationOutput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PreProcessingTrace's - // String and GoString methods. - ModelInvocationOutput *PreProcessingModelInvocationOutput_ `locationName:"modelInvocationOutput" type:"structure" sensitive:"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 PreProcessingTrace) 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 PreProcessingTrace) GoString() string { - return s.String() -} - -// SetModelInvocationInput sets the ModelInvocationInput field's value. -func (s *PreProcessingTrace) SetModelInvocationInput(v *ModelInvocationInput_) *PreProcessingTrace { - s.ModelInvocationInput = v - return s -} - -// SetModelInvocationOutput sets the ModelInvocationOutput field's value. -func (s *PreProcessingTrace) SetModelInvocationOutput(v *PreProcessingModelInvocationOutput_) *PreProcessingTrace { - s.ModelInvocationOutput = v - return s -} - -// Trace Part which contains information related to reasoning -type Rationale struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Agent Trace Rationale String - // - // Text is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Rationale's - // String and GoString methods. - Text *string `locationName:"text" type:"string" sensitive:"true"` - - // Identifier for trace - TraceId *string `locationName:"traceId" min:"2" 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 Rationale) 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 Rationale) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *Rationale) SetText(v string) *Rationale { - s.Text = &v - return s -} - -// SetTraceId sets the TraceId field's value. -func (s *Rationale) SetTraceId(v string) *Rationale { - s.TraceId = &v - return s -} - -// Observation information if there were reprompts -type RepromptResponse struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Parsing error source - // - // Source is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RepromptResponse's - // String and GoString methods. - Source *string `locationName:"source" type:"string" enum:"Source" sensitive:"true"` - - // Reprompt response text - Text *string `locationName:"text" 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 RepromptResponse) 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 RepromptResponse) GoString() string { - return s.String() -} - -// SetSource sets the Source field's value. -func (s *RepromptResponse) SetSource(v string) *RepromptResponse { - s.Source = &v - return s -} - -// SetText sets the Text field's value. -func (s *RepromptResponse) SetText(v string) *RepromptResponse { - s.Text = &v - return s -} - -// Request Body Content Map -type RequestBody struct { - _ struct{} `type:"structure"` - - // Content type paramter map - Content map[string][]*Parameter `locationName:"content" type:"map"` -} - -// 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 RequestBody) 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 RequestBody) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *RequestBody) SetContent(v map[string][]*Parameter) *RequestBody { - s.Content = v - return s -} - -// This exception is thrown when a resource referenced by the operation does -// not exist -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -// The ResourceNotFoundException is and event in the ResponseStream group of events. -func (s *ResourceNotFoundException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ResourceNotFoundException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ResourceNotFoundException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ResourceNotFoundException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// ResponseStreamEvent groups together all EventStream -// events writes for ResponseStream. -// -// These events are: -// -// - PayloadPart -// - TracePart -type ResponseStreamEvent interface { - eventResponseStream() - eventstreamapi.Marshaler - eventstreamapi.Unmarshaler -} - -// ResponseStreamReader provides the interface for reading to the stream. The -// default implementation for this interface will be ResponseStream. -// -// The reader's Close method must allow multiple concurrent calls. -// -// These events are: -// -// - PayloadPart -// - TracePart -// - ResponseStreamUnknownEvent -type ResponseStreamReader interface { - // Returns a channel of events as they are read from the event stream. - Events() <-chan ResponseStreamEvent - - // Close will stop the reader reading events from the stream. - Close() error - - // Returns any error that has occurred while reading from the event stream. - Err() error -} - -type readResponseStream struct { - eventReader *eventstreamapi.EventReader - stream chan ResponseStreamEvent - err *eventstreamapi.OnceError - - done chan struct{} - closeOnce sync.Once -} - -func newReadResponseStream(eventReader *eventstreamapi.EventReader) *readResponseStream { - r := &readResponseStream{ - eventReader: eventReader, - stream: make(chan ResponseStreamEvent), - done: make(chan struct{}), - err: eventstreamapi.NewOnceError(), - } - go r.readEventStream() - - return r -} - -// Close will close the underlying event stream reader. -func (r *readResponseStream) Close() error { - r.closeOnce.Do(r.safeClose) - return r.Err() -} - -func (r *readResponseStream) ErrorSet() <-chan struct{} { - return r.err.ErrorSet() -} - -func (r *readResponseStream) Closed() <-chan struct{} { - return r.done -} - -func (r *readResponseStream) safeClose() { - close(r.done) -} - -func (r *readResponseStream) Err() error { - return r.err.Err() -} - -func (r *readResponseStream) Events() <-chan ResponseStreamEvent { - return r.stream -} - -func (r *readResponseStream) readEventStream() { - defer r.Close() - defer close(r.stream) - - for { - event, err := r.eventReader.ReadEvent() - if err != nil { - if err == io.EOF { - return - } - select { - case <-r.done: - // If closed already ignore the error - return - default: - } - if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok { - continue - } - r.err.SetError(err) - return - } - - select { - case r.stream <- event.(ResponseStreamEvent): - case <-r.done: - return - } - } -} - -type unmarshalerForResponseStreamEvent struct { - metadata protocol.ResponseMetadata -} - -func (u unmarshalerForResponseStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { - switch eventType { - case "chunk": - return &PayloadPart{}, nil - case "trace": - return &TracePart{}, nil - case "accessDeniedException": - return newErrorAccessDeniedException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "badGatewayException": - return newErrorBadGatewayException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "conflictException": - return newErrorConflictException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "dependencyFailedException": - return newErrorDependencyFailedException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "internalServerException": - return newErrorInternalServerException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "resourceNotFoundException": - return newErrorResourceNotFoundException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "serviceQuotaExceededException": - return newErrorServiceQuotaExceededException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "throttlingException": - return newErrorThrottlingException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "validationException": - return newErrorValidationException(u.metadata).(eventstreamapi.Unmarshaler), nil - default: - return &ResponseStreamUnknownEvent{Type: eventType}, nil - } -} - -// ResponseStreamUnknownEvent provides a failsafe event for the -// ResponseStream group of events when an unknown event is received. -type ResponseStreamUnknownEvent struct { - Type string - Message eventstream.Message -} - -// The ResponseStreamUnknownEvent is and event in the ResponseStream -// group of events. -func (s *ResponseStreamUnknownEvent) eventResponseStream() {} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (e *ResponseStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) ( - msg eventstream.Message, err error, -) { - return e.Message.Clone(), nil -} - -// UnmarshalEvent unmarshals the EventStream Message into the ResponseStream value. -// This method is only used internally within the SDK's EventStream handling. -func (e *ResponseStreamUnknownEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - e.Message = msg.Clone() - return nil -} - -// Content of a retrieval result. -type RetrievalResultContent struct { - _ struct{} `type:"structure"` - - // Content of a retrieval result in text - // - // Text is a required field - Text *string `locationName:"text" 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 RetrievalResultContent) 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 RetrievalResultContent) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *RetrievalResultContent) SetText(v string) *RetrievalResultContent { - s.Text = &v - return s -} - -// The source location of a retrieval result. -type RetrievalResultLocation struct { - _ struct{} `type:"structure"` - - // The S3 location of a retrieval result. - S3Location *RetrievalResultS3Location `locationName:"s3Location" type:"structure"` - - // The location type of a retrieval result. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RetrievalResultLocationType"` -} - -// 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 RetrievalResultLocation) 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 RetrievalResultLocation) GoString() string { - return s.String() -} - -// SetS3Location sets the S3Location field's value. -func (s *RetrievalResultLocation) SetS3Location(v *RetrievalResultS3Location) *RetrievalResultLocation { - s.S3Location = v - return s -} - -// SetType sets the Type field's value. -func (s *RetrievalResultLocation) SetType(v string) *RetrievalResultLocation { - s.Type = &v - return s -} - -// The S3 location of a retrieval result. -type RetrievalResultS3Location struct { - _ struct{} `type:"structure"` - - // URI of S3 location - Uri *string `locationName:"uri" 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 RetrievalResultS3Location) 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 RetrievalResultS3Location) GoString() string { - return s.String() -} - -// SetUri sets the Uri field's value. -func (s *RetrievalResultS3Location) SetUri(v string) *RetrievalResultS3Location { - s.Uri = &v - return s -} - -// Configures the retrieval and generation for the session. -type RetrieveAndGenerateConfiguration struct { - _ struct{} `type:"structure"` - - // Configurations for retrieval and generation for knowledge base. - KnowledgeBaseConfiguration *KnowledgeBaseRetrieveAndGenerateConfiguration `locationName:"knowledgeBaseConfiguration" type:"structure"` - - // The type of RetrieveAndGenerate. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RetrieveAndGenerateType"` -} - -// 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 RetrieveAndGenerateConfiguration) 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 RetrieveAndGenerateConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetrieveAndGenerateConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetrieveAndGenerateConfiguration"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.KnowledgeBaseConfiguration != nil { - if err := s.KnowledgeBaseConfiguration.Validate(); err != nil { - invalidParams.AddNested("KnowledgeBaseConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseConfiguration sets the KnowledgeBaseConfiguration field's value. -func (s *RetrieveAndGenerateConfiguration) SetKnowledgeBaseConfiguration(v *KnowledgeBaseRetrieveAndGenerateConfiguration) *RetrieveAndGenerateConfiguration { - s.KnowledgeBaseConfiguration = v - return s -} - -// SetType sets the Type field's value. -func (s *RetrieveAndGenerateConfiguration) SetType(v string) *RetrieveAndGenerateConfiguration { - s.Type = &v - return s -} - -type RetrieveAndGenerateInput struct { - _ struct{} `type:"structure"` - - // Customer input of the turn - // - // Input is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RetrieveAndGenerateInput's - // String and GoString methods. - // - // Input is a required field - Input *RetrieveAndGenerateInput_ `locationName:"input" type:"structure" required:"true" sensitive:"true"` - - // Configures the retrieval and generation for the session. - RetrieveAndGenerateConfiguration *RetrieveAndGenerateConfiguration `locationName:"retrieveAndGenerateConfiguration" type:"structure"` - - // Configures common parameters of the session. - SessionConfiguration *RetrieveAndGenerateSessionConfiguration `locationName:"sessionConfiguration" type:"structure"` - - // Identifier of the session. - SessionId *string `locationName:"sessionId" min:"2" 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 RetrieveAndGenerateInput) 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 RetrieveAndGenerateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetrieveAndGenerateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetrieveAndGenerateInput"} - if s.Input == nil { - invalidParams.Add(request.NewErrParamRequired("Input")) - } - if s.SessionId != nil && len(*s.SessionId) < 2 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 2)) - } - if s.Input != nil { - if err := s.Input.Validate(); err != nil { - invalidParams.AddNested("Input", err.(request.ErrInvalidParams)) - } - } - if s.RetrieveAndGenerateConfiguration != nil { - if err := s.RetrieveAndGenerateConfiguration.Validate(); err != nil { - invalidParams.AddNested("RetrieveAndGenerateConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.SessionConfiguration != nil { - if err := s.SessionConfiguration.Validate(); err != nil { - invalidParams.AddNested("SessionConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInput sets the Input field's value. -func (s *RetrieveAndGenerateInput) SetInput(v *RetrieveAndGenerateInput_) *RetrieveAndGenerateInput { - s.Input = v - return s -} - -// SetRetrieveAndGenerateConfiguration sets the RetrieveAndGenerateConfiguration field's value. -func (s *RetrieveAndGenerateInput) SetRetrieveAndGenerateConfiguration(v *RetrieveAndGenerateConfiguration) *RetrieveAndGenerateInput { - s.RetrieveAndGenerateConfiguration = v - return s -} - -// SetSessionConfiguration sets the SessionConfiguration field's value. -func (s *RetrieveAndGenerateInput) SetSessionConfiguration(v *RetrieveAndGenerateSessionConfiguration) *RetrieveAndGenerateInput { - s.SessionConfiguration = v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *RetrieveAndGenerateInput) SetSessionId(v string) *RetrieveAndGenerateInput { - s.SessionId = &v - return s -} - -// Customer input of the turn -type RetrieveAndGenerateInput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Customer input of the turn in text - // - // Text is a required field - Text *string `locationName:"text" 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 RetrieveAndGenerateInput_) 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 RetrieveAndGenerateInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetrieveAndGenerateInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetrieveAndGenerateInput_"} - if s.Text == nil { - invalidParams.Add(request.NewErrParamRequired("Text")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetText sets the Text field's value. -func (s *RetrieveAndGenerateInput_) SetText(v string) *RetrieveAndGenerateInput_ { - s.Text = &v - return s -} - -type RetrieveAndGenerateOutput struct { - _ struct{} `type:"structure"` - - // List of citations - Citations []*Citation `locationName:"citations" type:"list"` - - // Service response of the turn - // - // Output is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RetrieveAndGenerateOutput's - // String and GoString methods. - // - // Output is a required field - Output *RetrieveAndGenerateOutput_ `locationName:"output" type:"structure" required:"true" sensitive:"true"` - - // Identifier of the session. - // - // SessionId is a required field - SessionId *string `locationName:"sessionId" min:"2" 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 RetrieveAndGenerateOutput) 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 RetrieveAndGenerateOutput) GoString() string { - return s.String() -} - -// SetCitations sets the Citations field's value. -func (s *RetrieveAndGenerateOutput) SetCitations(v []*Citation) *RetrieveAndGenerateOutput { - s.Citations = v - return s -} - -// SetOutput sets the Output field's value. -func (s *RetrieveAndGenerateOutput) SetOutput(v *RetrieveAndGenerateOutput_) *RetrieveAndGenerateOutput { - s.Output = v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *RetrieveAndGenerateOutput) SetSessionId(v string) *RetrieveAndGenerateOutput { - s.SessionId = &v - return s -} - -// Service response of the turn -type RetrieveAndGenerateOutput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Service response of the turn in text - // - // Text is a required field - Text *string `locationName:"text" 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 RetrieveAndGenerateOutput_) 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 RetrieveAndGenerateOutput_) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *RetrieveAndGenerateOutput_) SetText(v string) *RetrieveAndGenerateOutput_ { - s.Text = &v - return s -} - -// Configures common parameters of the session. -type RetrieveAndGenerateSessionConfiguration struct { - _ struct{} `type:"structure"` - - // The KMS key arn to encrypt the customer data of the session. - // - // KmsKeyArn is a required field - KmsKeyArn *string `locationName:"kmsKeyArn" min:"1" 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 RetrieveAndGenerateSessionConfiguration) 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 RetrieveAndGenerateSessionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetrieveAndGenerateSessionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetrieveAndGenerateSessionConfiguration"} - if s.KmsKeyArn == nil { - invalidParams.Add(request.NewErrParamRequired("KmsKeyArn")) - } - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *RetrieveAndGenerateSessionConfiguration) SetKmsKeyArn(v string) *RetrieveAndGenerateSessionConfiguration { - s.KmsKeyArn = &v - return s -} - -type RetrieveInput struct { - _ struct{} `type:"structure"` - - // Identifier of the KnowledgeBase - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Search parameters for retrieving from knowledge base. - RetrievalConfiguration *KnowledgeBaseRetrievalConfiguration `locationName:"retrievalConfiguration" type:"structure"` - - // Knowledge base input query. - // - // RetrievalQuery is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RetrieveInput's - // String and GoString methods. - // - // RetrievalQuery is a required field - RetrievalQuery *KnowledgeBaseQuery `locationName:"retrievalQuery" type:"structure" required:"true" sensitive:"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 RetrieveInput) 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 RetrieveInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetrieveInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetrieveInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.RetrievalQuery == nil { - invalidParams.Add(request.NewErrParamRequired("RetrievalQuery")) - } - if s.RetrievalConfiguration != nil { - if err := s.RetrievalConfiguration.Validate(); err != nil { - invalidParams.AddNested("RetrievalConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.RetrievalQuery != nil { - if err := s.RetrievalQuery.Validate(); err != nil { - invalidParams.AddNested("RetrievalQuery", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *RetrieveInput) SetKnowledgeBaseId(v string) *RetrieveInput { - s.KnowledgeBaseId = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *RetrieveInput) SetNextToken(v string) *RetrieveInput { - s.NextToken = &v - return s -} - -// SetRetrievalConfiguration sets the RetrievalConfiguration field's value. -func (s *RetrieveInput) SetRetrievalConfiguration(v *KnowledgeBaseRetrievalConfiguration) *RetrieveInput { - s.RetrievalConfiguration = v - return s -} - -// SetRetrievalQuery sets the RetrievalQuery field's value. -func (s *RetrieveInput) SetRetrievalQuery(v *KnowledgeBaseQuery) *RetrieveInput { - s.RetrievalQuery = v - return s -} - -type RetrieveOutput struct { - _ struct{} `type:"structure"` - - // Opaque continuation token of previous paginated response. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // List of knowledge base retrieval results - // - // RetrievalResults is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RetrieveOutput's - // String and GoString methods. - // - // RetrievalResults is a required field - RetrievalResults []*KnowledgeBaseRetrievalResult `locationName:"retrievalResults" type:"list" required:"true" sensitive:"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 RetrieveOutput) 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 RetrieveOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *RetrieveOutput) SetNextToken(v string) *RetrieveOutput { - s.NextToken = &v - return s -} - -// SetRetrievalResults sets the RetrievalResults field's value. -func (s *RetrieveOutput) SetRetrievalResults(v []*KnowledgeBaseRetrievalResult) *RetrieveOutput { - s.RetrievalResults = v - return s -} - -// Retrieved reference -type RetrievedReference struct { - _ struct{} `type:"structure"` - - // Content of a retrieval result. - Content *RetrievalResultContent `locationName:"content" type:"structure"` - - // The source location of a retrieval result. - Location *RetrievalResultLocation `locationName:"location" 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 RetrievedReference) 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 RetrievedReference) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *RetrievedReference) SetContent(v *RetrievalResultContent) *RetrievedReference { - s.Content = v - return s -} - -// SetLocation sets the Location field's value. -func (s *RetrievedReference) SetLocation(v *RetrievalResultLocation) *RetrievedReference { - s.Location = v - return s -} - -// This exception is thrown when a request is made beyond the service quota -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -// The ServiceQuotaExceededException is and event in the ResponseStream group of events. -func (s *ServiceQuotaExceededException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ServiceQuotaExceededException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ServiceQuotaExceededException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ServiceQuotaExceededException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Session state provided -type SessionState struct { - _ struct{} `type:"structure"` - - // Prompt Session Attributes - PromptSessionAttributes map[string]*string `locationName:"promptSessionAttributes" type:"map"` - - // Session Attributes - SessionAttributes map[string]*string `locationName:"sessionAttributes" type:"map"` -} - -// 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 SessionState) 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 SessionState) GoString() string { - return s.String() -} - -// SetPromptSessionAttributes sets the PromptSessionAttributes field's value. -func (s *SessionState) SetPromptSessionAttributes(v map[string]*string) *SessionState { - s.PromptSessionAttributes = v - return s -} - -// SetSessionAttributes sets the SessionAttributes field's value. -func (s *SessionState) SetSessionAttributes(v map[string]*string) *SessionState { - s.SessionAttributes = v - return s -} - -// Span of text -type Span struct { - _ struct{} `type:"structure"` - - // End of span - End *int64 `locationName:"end" type:"integer"` - - // Start of span - Start *int64 `locationName:"start" 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 Span) 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 Span) GoString() string { - return s.String() -} - -// SetEnd sets the End field's value. -func (s *Span) SetEnd(v int64) *Span { - s.End = &v - return s -} - -// SetStart sets the Start field's value. -func (s *Span) SetStart(v int64) *Span { - s.Start = &v - return s -} - -// Text response part -type TextResponsePart struct { - _ struct{} `type:"structure"` - - // Span of text - Span *Span `locationName:"span" type:"structure"` - - // Response part in text - Text *string `locationName:"text" 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 TextResponsePart) 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 TextResponsePart) GoString() string { - return s.String() -} - -// SetSpan sets the Span field's value. -func (s *TextResponsePart) SetSpan(v *Span) *TextResponsePart { - s.Span = v - return s -} - -// SetText sets the Text field's value. -func (s *TextResponsePart) SetText(v string) *TextResponsePart { - s.Text = &v - return s -} - -// This exception is thrown when the number of requests exceeds the limit -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -// The ThrottlingException is and event in the ResponseStream group of events. -func (s *ThrottlingException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ThrottlingException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ThrottlingException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ThrottlingException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Trace contains intermidate response for customer -type Trace struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Trace Part which is emitted when agent trace could not be generated - // - // FailureTrace is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Trace's - // String and GoString methods. - FailureTrace *FailureTrace `locationName:"failureTrace" type:"structure" sensitive:"true"` - - // Trace contains intermidate response during orchestration - // - // OrchestrationTrace is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Trace's - // String and GoString methods. - OrchestrationTrace *OrchestrationTrace `locationName:"orchestrationTrace" type:"structure" sensitive:"true"` - - // Trace Part which contains information related to post processing step - // - // PostProcessingTrace is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Trace's - // String and GoString methods. - PostProcessingTrace *PostProcessingTrace `locationName:"postProcessingTrace" type:"structure" sensitive:"true"` - - // Trace Part which contains information related to preprocessing step - // - // PreProcessingTrace is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Trace's - // String and GoString methods. - PreProcessingTrace *PreProcessingTrace `locationName:"preProcessingTrace" type:"structure" sensitive:"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 Trace) 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 Trace) GoString() string { - return s.String() -} - -// SetFailureTrace sets the FailureTrace field's value. -func (s *Trace) SetFailureTrace(v *FailureTrace) *Trace { - s.FailureTrace = v - return s -} - -// SetOrchestrationTrace sets the OrchestrationTrace field's value. -func (s *Trace) SetOrchestrationTrace(v *OrchestrationTrace) *Trace { - s.OrchestrationTrace = v - return s -} - -// SetPostProcessingTrace sets the PostProcessingTrace field's value. -func (s *Trace) SetPostProcessingTrace(v *PostProcessingTrace) *Trace { - s.PostProcessingTrace = v - return s -} - -// SetPreProcessingTrace sets the PreProcessingTrace field's value. -func (s *Trace) SetPreProcessingTrace(v *PreProcessingTrace) *Trace { - s.PreProcessingTrace = v - return s -} - -// Trace Part which contains intermidate response for customer -type TracePart struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Identifier of the agent alias. - AgentAliasId *string `locationName:"agentAliasId" type:"string"` - - // Identifier of the agent. - AgentId *string `locationName:"agentId" type:"string"` - - // Identifier of the session. - SessionId *string `locationName:"sessionId" min:"2" type:"string"` - - // Trace contains intermidate response for customer - // - // Trace is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TracePart's - // String and GoString methods. - Trace *Trace `locationName:"trace" type:"structure" sensitive:"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 TracePart) 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 TracePart) GoString() string { - return s.String() -} - -// SetAgentAliasId sets the AgentAliasId field's value. -func (s *TracePart) SetAgentAliasId(v string) *TracePart { - s.AgentAliasId = &v - return s -} - -// SetAgentId sets the AgentId field's value. -func (s *TracePart) SetAgentId(v string) *TracePart { - s.AgentId = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *TracePart) SetSessionId(v string) *TracePart { - s.SessionId = &v - return s -} - -// SetTrace sets the Trace field's value. -func (s *TracePart) SetTrace(v *Trace) *TracePart { - s.Trace = v - return s -} - -// The TracePart is and event in the ResponseStream group of events. -func (s *TracePart) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the TracePart value. -// This method is only used internally within the SDK's EventStream handling. -func (s *TracePart) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *TracePart) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -// This exception is thrown when the request's input validation fails -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Non Blank String - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -// The ValidationException is and event in the ResponseStream group of events. -func (s *ValidationException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ValidationException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ValidationException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ValidationException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// indicates if agent uses default prompt or overriden prompt -const ( - // CreationModeDefault is a CreationMode enum value - CreationModeDefault = "DEFAULT" - - // CreationModeOverridden is a CreationMode enum value - CreationModeOverridden = "OVERRIDDEN" -) - -// CreationMode_Values returns all elements of the CreationMode enum -func CreationMode_Values() []string { - return []string{ - CreationModeDefault, - CreationModeOverridden, - } -} - -// types of invocations -const ( - // InvocationTypeActionGroup is a InvocationType enum value - InvocationTypeActionGroup = "ACTION_GROUP" - - // InvocationTypeKnowledgeBase is a InvocationType enum value - InvocationTypeKnowledgeBase = "KNOWLEDGE_BASE" - - // InvocationTypeFinish is a InvocationType enum value - InvocationTypeFinish = "FINISH" -) - -// InvocationType_Values returns all elements of the InvocationType enum -func InvocationType_Values() []string { - return []string{ - InvocationTypeActionGroup, - InvocationTypeKnowledgeBase, - InvocationTypeFinish, - } -} - -// types of prompts -const ( - // PromptTypePreProcessing is a PromptType enum value - PromptTypePreProcessing = "PRE_PROCESSING" - - // PromptTypeOrchestration is a PromptType enum value - PromptTypeOrchestration = "ORCHESTRATION" - - // PromptTypeKnowledgeBaseResponseGeneration is a PromptType enum value - PromptTypeKnowledgeBaseResponseGeneration = "KNOWLEDGE_BASE_RESPONSE_GENERATION" - - // PromptTypePostProcessing is a PromptType enum value - PromptTypePostProcessing = "POST_PROCESSING" -) - -// PromptType_Values returns all elements of the PromptType enum -func PromptType_Values() []string { - return []string{ - PromptTypePreProcessing, - PromptTypeOrchestration, - PromptTypeKnowledgeBaseResponseGeneration, - PromptTypePostProcessing, - } -} - -// The location type of a retrieval result. -const ( - // RetrievalResultLocationTypeS3 is a RetrievalResultLocationType enum value - RetrievalResultLocationTypeS3 = "S3" -) - -// RetrievalResultLocationType_Values returns all elements of the RetrievalResultLocationType enum -func RetrievalResultLocationType_Values() []string { - return []string{ - RetrievalResultLocationTypeS3, - } -} - -// The type of RetrieveAndGenerate. -const ( - // RetrieveAndGenerateTypeKnowledgeBase is a RetrieveAndGenerateType enum value - RetrieveAndGenerateTypeKnowledgeBase = "KNOWLEDGE_BASE" -) - -// RetrieveAndGenerateType_Values returns all elements of the RetrieveAndGenerateType enum -func RetrieveAndGenerateType_Values() []string { - return []string{ - RetrieveAndGenerateTypeKnowledgeBase, - } -} - -// Parsing error source -const ( - // SourceActionGroup is a Source enum value - SourceActionGroup = "ACTION_GROUP" - - // SourceKnowledgeBase is a Source enum value - SourceKnowledgeBase = "KNOWLEDGE_BASE" - - // SourceParser is a Source enum value - SourceParser = "PARSER" -) - -// Source_Values returns all elements of the Source enum -func Source_Values() []string { - return []string{ - SourceActionGroup, - SourceKnowledgeBase, - SourceParser, - } -} - -// types of observations -const ( - // TypeActionGroup is a Type enum value - TypeActionGroup = "ACTION_GROUP" - - // TypeKnowledgeBase is a Type enum value - TypeKnowledgeBase = "KNOWLEDGE_BASE" - - // TypeFinish is a Type enum value - TypeFinish = "FINISH" - - // TypeAskUser is a Type enum value - TypeAskUser = "ASK_USER" - - // TypeReprompt is a Type enum value - TypeReprompt = "REPROMPT" -) - -// Type_Values returns all elements of the Type enum -func Type_Values() []string { - return []string{ - TypeActionGroup, - TypeKnowledgeBase, - TypeFinish, - TypeAskUser, - TypeReprompt, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/bedrockagentruntimeiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/bedrockagentruntimeiface/interface.go deleted file mode 100644 index ccb6349ce303..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/bedrockagentruntimeiface/interface.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bedrockagentruntimeiface provides an interface to enable mocking the Agents for Amazon Bedrock Runtime service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package bedrockagentruntimeiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime" -) - -// BedrockAgentRuntimeAPI provides an interface to enable mocking the -// bedrockagentruntime.BedrockAgentRuntime service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Agents for Amazon Bedrock Runtime. -// func myFunc(svc bedrockagentruntimeiface.BedrockAgentRuntimeAPI) bool { -// // Make svc.InvokeAgent request -// } -// -// func main() { -// sess := session.New() -// svc := bedrockagentruntime.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockBedrockAgentRuntimeClient struct { -// bedrockagentruntimeiface.BedrockAgentRuntimeAPI -// } -// func (m *mockBedrockAgentRuntimeClient) InvokeAgent(input *bedrockagentruntime.InvokeAgentInput) (*bedrockagentruntime.InvokeAgentOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockBedrockAgentRuntimeClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type BedrockAgentRuntimeAPI interface { - InvokeAgent(*bedrockagentruntime.InvokeAgentInput) (*bedrockagentruntime.InvokeAgentOutput, error) - InvokeAgentWithContext(aws.Context, *bedrockagentruntime.InvokeAgentInput, ...request.Option) (*bedrockagentruntime.InvokeAgentOutput, error) - InvokeAgentRequest(*bedrockagentruntime.InvokeAgentInput) (*request.Request, *bedrockagentruntime.InvokeAgentOutput) - - Retrieve(*bedrockagentruntime.RetrieveInput) (*bedrockagentruntime.RetrieveOutput, error) - RetrieveWithContext(aws.Context, *bedrockagentruntime.RetrieveInput, ...request.Option) (*bedrockagentruntime.RetrieveOutput, error) - RetrieveRequest(*bedrockagentruntime.RetrieveInput) (*request.Request, *bedrockagentruntime.RetrieveOutput) - - RetrievePages(*bedrockagentruntime.RetrieveInput, func(*bedrockagentruntime.RetrieveOutput, bool) bool) error - RetrievePagesWithContext(aws.Context, *bedrockagentruntime.RetrieveInput, func(*bedrockagentruntime.RetrieveOutput, bool) bool, ...request.Option) error - - RetrieveAndGenerate(*bedrockagentruntime.RetrieveAndGenerateInput) (*bedrockagentruntime.RetrieveAndGenerateOutput, error) - RetrieveAndGenerateWithContext(aws.Context, *bedrockagentruntime.RetrieveAndGenerateInput, ...request.Option) (*bedrockagentruntime.RetrieveAndGenerateOutput, error) - RetrieveAndGenerateRequest(*bedrockagentruntime.RetrieveAndGenerateInput) (*request.Request, *bedrockagentruntime.RetrieveAndGenerateOutput) -} - -var _ BedrockAgentRuntimeAPI = (*bedrockagentruntime.BedrockAgentRuntime)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/doc.go deleted file mode 100644 index 8f32afec3ddc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bedrockagentruntime provides the client and types for making API -// requests to Agents for Amazon Bedrock Runtime. -// -// # Amazon Bedrock Agent -// -// See https://docs.aws.amazon.com/goto/WebAPI/bedrock-agent-runtime-2023-07-26 for more information on this service. -// -// See bedrockagentruntime package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bedrockagentruntime/ -// -// # Using the Client -// -// To contact Agents for Amazon Bedrock Runtime with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Agents for Amazon Bedrock Runtime client BedrockAgentRuntime for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bedrockagentruntime/#New -package bedrockagentruntime diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/errors.go deleted file mode 100644 index 2c913fb11894..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/errors.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockagentruntime - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // This exception is thrown when a request is denied per access permissions - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeBadGatewayException for service response error code - // "BadGatewayException". - // - // This exception is thrown when a request fails due to dependency like Lambda, - // Bedrock, STS resource - ErrCodeBadGatewayException = "BadGatewayException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // This exception is thrown when there is a conflict performing an operation - ErrCodeConflictException = "ConflictException" - - // ErrCodeDependencyFailedException for service response error code - // "DependencyFailedException". - // - // This exception is thrown when a request fails due to dependency like Lambda, - // Bedrock, STS resource due to a customer fault (i.e. bad configuration) - ErrCodeDependencyFailedException = "DependencyFailedException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // This exception is thrown if there was an unexpected error during processing - // of request - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // This exception is thrown when a resource referenced by the operation does - // not exist - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // This exception is thrown when a request is made beyond the service quota - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // This exception is thrown when the number of requests exceeds the limit - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // This exception is thrown when the request's input validation fails - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "BadGatewayException": newErrorBadGatewayException, - "ConflictException": newErrorConflictException, - "DependencyFailedException": newErrorDependencyFailedException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/service.go deleted file mode 100644 index 3b13c937f3b7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockagentruntime/service.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockagentruntime - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// BedrockAgentRuntime provides the API operation methods for making requests to -// Agents for Amazon Bedrock Runtime. See this package's package overview docs -// for details on the service. -// -// BedrockAgentRuntime methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type BedrockAgentRuntime struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Bedrock Agent Runtime" // Name of service. - EndpointsID = "bedrock-agent-runtime" // ID to lookup a service endpoint with. - ServiceID = "Bedrock Agent Runtime" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the BedrockAgentRuntime client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a BedrockAgentRuntime client from just a session. -// svc := bedrockagentruntime.New(mySession) -// -// // Create a BedrockAgentRuntime client with additional configuration -// svc := bedrockagentruntime.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *BedrockAgentRuntime { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "bedrock" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *BedrockAgentRuntime { - svc := &BedrockAgentRuntime{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-07-26", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - svc.Handlers.BuildStream.PushBackNamed(restjson.BuildHandler) - svc.Handlers.UnmarshalStream.PushBackNamed(restjson.UnmarshalHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a BedrockAgentRuntime operation and runs any -// custom request initialization. -func (c *BedrockAgentRuntime) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/api.go deleted file mode 100644 index f8fafcf2d559..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/api.go +++ /dev/null @@ -1,1698 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockruntime - -import ( - "bytes" - "fmt" - "io" - "sync" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awserr" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/eventstream" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/rest" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opInvokeModel = "InvokeModel" - -// InvokeModelRequest generates a "aws/request.Request" representing the -// client's request for the InvokeModel 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 InvokeModel for more information on using the InvokeModel -// 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 InvokeModelRequest method. -// req, resp := client.InvokeModelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModel -func (c *BedrockRuntime) InvokeModelRequest(input *InvokeModelInput) (req *request.Request, output *InvokeModelOutput) { - op := &request.Operation{ - Name: opInvokeModel, - HTTPMethod: "POST", - HTTPPath: "/model/{modelId}/invoke", - } - - if input == nil { - input = &InvokeModelInput{} - } - - output = &InvokeModelOutput{} - req = c.newRequest(op, input, output) - return -} - -// InvokeModel API operation for Amazon Bedrock Runtime. -// -// Invokes the specified Bedrock model to run inference using the input provided -// in the request body. You use InvokeModel to run inference for text models, -// image models, and embedding models. -// -// For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) -// in the Bedrock User Guide. -// -// For example requests, see Examples (after the Errors section). -// -// 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 Bedrock Runtime's -// API operation InvokeModel for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// - ModelTimeoutException -// The request took too long to process. Processing time exceeded the model -// timeout length. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - ModelNotReadyException -// The model specified in the request is not ready to serve inference requests. -// -// - ServiceQuotaExceededException -// The number of requests exceeds the service quota. Resubmit your request later. -// -// - ModelErrorException -// The request failed due to an error while processing the model. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModel -func (c *BedrockRuntime) InvokeModel(input *InvokeModelInput) (*InvokeModelOutput, error) { - req, out := c.InvokeModelRequest(input) - return out, req.Send() -} - -// InvokeModelWithContext is the same as InvokeModel with the addition of -// the ability to pass a context and additional request options. -// -// See InvokeModel 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 *BedrockRuntime) InvokeModelWithContext(ctx aws.Context, input *InvokeModelInput, opts ...request.Option) (*InvokeModelOutput, error) { - req, out := c.InvokeModelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInvokeModelWithResponseStream = "InvokeModelWithResponseStream" - -// InvokeModelWithResponseStreamRequest generates a "aws/request.Request" representing the -// client's request for the InvokeModelWithResponseStream 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 InvokeModelWithResponseStream for more information on using the InvokeModelWithResponseStream -// 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 InvokeModelWithResponseStreamRequest method. -// req, resp := client.InvokeModelWithResponseStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream -func (c *BedrockRuntime) InvokeModelWithResponseStreamRequest(input *InvokeModelWithResponseStreamInput) (req *request.Request, output *InvokeModelWithResponseStreamOutput) { - op := &request.Operation{ - Name: opInvokeModelWithResponseStream, - HTTPMethod: "POST", - HTTPPath: "/model/{modelId}/invoke-with-response-stream", - } - - if input == nil { - input = &InvokeModelWithResponseStreamInput{} - } - - output = &InvokeModelWithResponseStreamOutput{} - req = c.newRequest(op, input, output) - - es := NewInvokeModelWithResponseStreamEventStream() - output.eventStream = es - - req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, rest.UnmarshalHandler) - req.Handlers.Unmarshal.PushBack(es.runOutputStream) - req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose) - return -} - -// InvokeModelWithResponseStream API operation for Amazon Bedrock Runtime. -// -// Invoke the specified Bedrock model to run inference using the input provided. -// Return the response in a stream. -// -// For more information, see Run inference (https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) -// in the Bedrock User Guide. -// -// For an example request and response, see Examples (after the Errors section). -// -// 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 Bedrock Runtime's -// API operation InvokeModelWithResponseStream for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// The request is denied because of missing access permissions. -// -// - ResourceNotFoundException -// The specified resource ARN was not found. Check the ARN and try your request -// again. -// -// - ThrottlingException -// The number of requests exceeds the limit. Resubmit your request later. -// -// - ModelTimeoutException -// The request took too long to process. Processing time exceeded the model -// timeout length. -// -// - InternalServerException -// An internal server error occurred. Retry your request. -// -// - ModelStreamErrorException -// An error occurred while streaming the response. -// -// - ValidationException -// Input validation failed. Check your request parameters and retry the request. -// -// - ModelNotReadyException -// The model specified in the request is not ready to serve inference requests. -// -// - ServiceQuotaExceededException -// The number of requests exceeds the service quota. Resubmit your request later. -// -// - ModelErrorException -// The request failed due to an error while processing the model. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30/InvokeModelWithResponseStream -func (c *BedrockRuntime) InvokeModelWithResponseStream(input *InvokeModelWithResponseStreamInput) (*InvokeModelWithResponseStreamOutput, error) { - req, out := c.InvokeModelWithResponseStreamRequest(input) - return out, req.Send() -} - -// InvokeModelWithResponseStreamWithContext is the same as InvokeModelWithResponseStream with the addition of -// the ability to pass a context and additional request options. -// -// See InvokeModelWithResponseStream 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 *BedrockRuntime) InvokeModelWithResponseStreamWithContext(ctx aws.Context, input *InvokeModelWithResponseStreamInput, opts ...request.Option) (*InvokeModelWithResponseStreamOutput, error) { - req, out := c.InvokeModelWithResponseStreamRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -var _ awserr.Error -var _ time.Time - -// InvokeModelWithResponseStreamEventStream provides the event stream handling for the InvokeModelWithResponseStream. -// -// For testing and mocking the event stream this type should be initialized via -// the NewInvokeModelWithResponseStreamEventStream constructor function. Using the functional options -// to pass in nested mock behavior. -type InvokeModelWithResponseStreamEventStream struct { - - // Reader is the EventStream reader for the ResponseStream - // events. This value is automatically set by the SDK when the API call is made - // Use this member when unit testing your code with the SDK to mock out the - // EventStream Reader. - // - // Must not be nil. - Reader ResponseStreamReader - - outputReader io.ReadCloser - - done chan struct{} - closeOnce sync.Once - err *eventstreamapi.OnceError -} - -// NewInvokeModelWithResponseStreamEventStream initializes an InvokeModelWithResponseStreamEventStream. -// This function should only be used for testing and mocking the InvokeModelWithResponseStreamEventStream -// stream within your application. -// -// The Reader member must be set before reading events from the stream. -// -// es := NewInvokeModelWithResponseStreamEventStream(func(o *InvokeModelWithResponseStreamEventStream){ -// es.Reader = myMockStreamReader -// }) -func NewInvokeModelWithResponseStreamEventStream(opts ...func(*InvokeModelWithResponseStreamEventStream)) *InvokeModelWithResponseStreamEventStream { - es := &InvokeModelWithResponseStreamEventStream{ - done: make(chan struct{}), - err: eventstreamapi.NewOnceError(), - } - - for _, fn := range opts { - fn(es) - } - - return es -} - -func (es *InvokeModelWithResponseStreamEventStream) runOnStreamPartClose(r *request.Request) { - if es.done == nil { - return - } - go es.waitStreamPartClose() - -} - -func (es *InvokeModelWithResponseStreamEventStream) waitStreamPartClose() { - var outputErrCh <-chan struct{} - if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok { - outputErrCh = v.ErrorSet() - } - var outputClosedCh <-chan struct{} - if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { - outputClosedCh = v.Closed() - } - - select { - case <-es.done: - case <-outputErrCh: - es.err.SetError(es.Reader.Err()) - es.Close() - case <-outputClosedCh: - if err := es.Reader.Err(); err != nil { - es.err.SetError(es.Reader.Err()) - } - es.Close() - } -} - -// Events returns a channel to read events from. -// -// These events are: -// -// - PayloadPart -// - ResponseStreamUnknownEvent -func (es *InvokeModelWithResponseStreamEventStream) Events() <-chan ResponseStreamEvent { - return es.Reader.Events() -} - -func (es *InvokeModelWithResponseStreamEventStream) runOutputStream(r *request.Request) { - var opts []func(*eventstream.Decoder) - if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { - opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger)) - } - - unmarshalerForEvent := unmarshalerForResponseStreamEvent{ - metadata: protocol.ResponseMetadata{ - StatusCode: r.HTTPResponse.StatusCode, - RequestID: r.RequestID, - }, - }.UnmarshalerForEventName - - decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...) - eventReader := eventstreamapi.NewEventReader(decoder, - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: r.Handlers.UnmarshalStream, - }, - unmarshalerForEvent, - ) - - es.outputReader = r.HTTPResponse.Body - es.Reader = newReadResponseStream(eventReader) -} - -// Close closes the stream. This will also cause the stream to be closed. -// Close must be called when done using the stream API. Not calling Close -// may result in resource leaks. -// -// You can use the closing of the Reader's Events channel to terminate your -// application's read from the API's stream. -func (es *InvokeModelWithResponseStreamEventStream) Close() (err error) { - es.closeOnce.Do(es.safeClose) - return es.Err() -} - -func (es *InvokeModelWithResponseStreamEventStream) safeClose() { - if es.done != nil { - close(es.done) - } - - es.Reader.Close() - if es.outputReader != nil { - es.outputReader.Close() - } -} - -// Err returns any error that occurred while reading or writing EventStream -// Events from the service API's response. Returns nil if there were no errors. -func (es *InvokeModelWithResponseStreamEventStream) Err() error { - if err := es.err.Err(); err != nil { - return err - } - if err := es.Reader.Err(); err != nil { - return err - } - - return nil -} - -// The request is denied because of missing access permissions. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An internal server error occurred. Retry your request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -// The InternalServerException is and event in the ResponseStream group of events. -func (s *InternalServerException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the InternalServerException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *InternalServerException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *InternalServerException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type InvokeModelInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The desired MIME type of the inference body in the response. The default - // value is application/json. - Accept *string `location:"header" locationName:"Accept" type:"string"` - - // Input data in the format specified in the content-type request header. To - // see the format and content of this field for different models, refer to Inference - // parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - // - // Body is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InvokeModelInput's - // String and GoString methods. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` - - // The MIME type of the input data in the request. The default value is application/json. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // Identifier of the model. - // - // ModelId is a required field - ModelId *string `location:"uri" locationName:"modelId" min:"1" 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 InvokeModelInput) 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 InvokeModelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvokeModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvokeModelInput"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.ModelId == nil { - invalidParams.Add(request.NewErrParamRequired("ModelId")) - } - if s.ModelId != nil && len(*s.ModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccept sets the Accept field's value. -func (s *InvokeModelInput) SetAccept(v string) *InvokeModelInput { - s.Accept = &v - return s -} - -// SetBody sets the Body field's value. -func (s *InvokeModelInput) SetBody(v []byte) *InvokeModelInput { - s.Body = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *InvokeModelInput) SetContentType(v string) *InvokeModelInput { - s.ContentType = &v - return s -} - -// SetModelId sets the ModelId field's value. -func (s *InvokeModelInput) SetModelId(v string) *InvokeModelInput { - s.ModelId = &v - return s -} - -type InvokeModelOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - // Inference response from the model in the format specified in the content-type - // header field. To see the format and content of this field for different models, - // refer to Inference parameters (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - // - // Body is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InvokeModelOutput's - // String and GoString methods. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` - - // The MIME type of the inference result. - // - // ContentType is a required field - ContentType *string `location:"header" locationName:"Content-Type" 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 InvokeModelOutput) 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 InvokeModelOutput) GoString() string { - return s.String() -} - -// SetBody sets the Body field's value. -func (s *InvokeModelOutput) SetBody(v []byte) *InvokeModelOutput { - s.Body = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *InvokeModelOutput) SetContentType(v string) *InvokeModelOutput { - s.ContentType = &v - return s -} - -type InvokeModelWithResponseStreamInput struct { - _ struct{} `type:"structure" payload:"Body"` - - // The desired MIME type of the inference body in the response. The default - // value is application/json. - Accept *string `location:"header" locationName:"X-Amzn-Bedrock-Accept" type:"string"` - - // Inference input in the format specified by the content-type. To see the format - // and content of this field for different models, refer to Inference parameters - // (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - // - // Body is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InvokeModelWithResponseStreamInput's - // String and GoString methods. - // - // Body is a required field - Body []byte `locationName:"body" type:"blob" required:"true" sensitive:"true"` - - // The MIME type of the input data in the request. The default value is application/json. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // Id of the model to invoke using the streaming request. - // - // ModelId is a required field - ModelId *string `location:"uri" locationName:"modelId" min:"1" 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 InvokeModelWithResponseStreamInput) 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 InvokeModelWithResponseStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvokeModelWithResponseStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvokeModelWithResponseStreamInput"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.ModelId == nil { - invalidParams.Add(request.NewErrParamRequired("ModelId")) - } - if s.ModelId != nil && len(*s.ModelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccept sets the Accept field's value. -func (s *InvokeModelWithResponseStreamInput) SetAccept(v string) *InvokeModelWithResponseStreamInput { - s.Accept = &v - return s -} - -// SetBody sets the Body field's value. -func (s *InvokeModelWithResponseStreamInput) SetBody(v []byte) *InvokeModelWithResponseStreamInput { - s.Body = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *InvokeModelWithResponseStreamInput) SetContentType(v string) *InvokeModelWithResponseStreamInput { - s.ContentType = &v - return s -} - -// SetModelId sets the ModelId field's value. -func (s *InvokeModelWithResponseStreamInput) SetModelId(v string) *InvokeModelWithResponseStreamInput { - s.ModelId = &v - return s -} - -type InvokeModelWithResponseStreamOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - eventStream *InvokeModelWithResponseStreamEventStream - - // The MIME type of the inference result. - // - // ContentType is a required field - ContentType *string `location:"header" locationName:"X-Amzn-Bedrock-Content-Type" 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 InvokeModelWithResponseStreamOutput) 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 InvokeModelWithResponseStreamOutput) GoString() string { - return s.String() -} - -// SetContentType sets the ContentType field's value. -func (s *InvokeModelWithResponseStreamOutput) SetContentType(v string) *InvokeModelWithResponseStreamOutput { - s.ContentType = &v - return s -} - -// GetStream returns the type to interact with the event stream. -func (s *InvokeModelWithResponseStreamOutput) GetStream() *InvokeModelWithResponseStreamEventStream { - return s.eventStream -} - -// The request failed due to an error while processing the model. -type ModelErrorException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The original status code. - OriginalStatusCode *int64 `locationName:"originalStatusCode" min:"100" type:"integer"` - - // The resource name. - ResourceName *string `locationName:"resourceName" 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 ModelErrorException) 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 ModelErrorException) GoString() string { - return s.String() -} - -func newErrorModelErrorException(v protocol.ResponseMetadata) error { - return &ModelErrorException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ModelErrorException) Code() string { - return "ModelErrorException" -} - -// Message returns the exception's message. -func (s *ModelErrorException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ModelErrorException) OrigErr() error { - return nil -} - -func (s *ModelErrorException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ModelErrorException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ModelErrorException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The model specified in the request is not ready to serve inference requests. -type ModelNotReadyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ModelNotReadyException) 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 ModelNotReadyException) GoString() string { - return s.String() -} - -func newErrorModelNotReadyException(v protocol.ResponseMetadata) error { - return &ModelNotReadyException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ModelNotReadyException) Code() string { - return "ModelNotReadyException" -} - -// Message returns the exception's message. -func (s *ModelNotReadyException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ModelNotReadyException) OrigErr() error { - return nil -} - -func (s *ModelNotReadyException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ModelNotReadyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ModelNotReadyException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An error occurred while streaming the response. -type ModelStreamErrorException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The original message. - OriginalMessage *string `locationName:"originalMessage" type:"string"` - - // The original status code. - OriginalStatusCode *int64 `locationName:"originalStatusCode" min:"100" 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 ModelStreamErrorException) 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 ModelStreamErrorException) GoString() string { - return s.String() -} - -// The ModelStreamErrorException is and event in the ResponseStream group of events. -func (s *ModelStreamErrorException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ModelStreamErrorException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ModelStreamErrorException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ModelStreamErrorException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorModelStreamErrorException(v protocol.ResponseMetadata) error { - return &ModelStreamErrorException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ModelStreamErrorException) Code() string { - return "ModelStreamErrorException" -} - -// Message returns the exception's message. -func (s *ModelStreamErrorException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ModelStreamErrorException) OrigErr() error { - return nil -} - -func (s *ModelStreamErrorException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ModelStreamErrorException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ModelStreamErrorException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request took too long to process. Processing time exceeded the model -// timeout length. -type ModelTimeoutException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ModelTimeoutException) 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 ModelTimeoutException) GoString() string { - return s.String() -} - -// The ModelTimeoutException is and event in the ResponseStream group of events. -func (s *ModelTimeoutException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ModelTimeoutException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ModelTimeoutException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ModelTimeoutException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorModelTimeoutException(v protocol.ResponseMetadata) error { - return &ModelTimeoutException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ModelTimeoutException) Code() string { - return "ModelTimeoutException" -} - -// Message returns the exception's message. -func (s *ModelTimeoutException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ModelTimeoutException) OrigErr() error { - return nil -} - -func (s *ModelTimeoutException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ModelTimeoutException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ModelTimeoutException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Payload content included in the response. -type PayloadPart struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Base64-encoded bytes of payload data. - // - // Bytes is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PayloadPart's - // String and GoString methods. - // - // Bytes is automatically base64 encoded/decoded by the SDK. - Bytes []byte `locationName:"bytes" type:"blob" sensitive:"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 PayloadPart) 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 PayloadPart) GoString() string { - return s.String() -} - -// SetBytes sets the Bytes field's value. -func (s *PayloadPart) SetBytes(v []byte) *PayloadPart { - s.Bytes = v - return s -} - -// The PayloadPart is and event in the ResponseStream group of events. -func (s *PayloadPart) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the PayloadPart value. -// This method is only used internally within the SDK's EventStream handling. -func (s *PayloadPart) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *PayloadPart) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -// The specified resource ARN was not found. Check the ARN and try your request -// again. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// ResponseStreamEvent groups together all EventStream -// events writes for ResponseStream. -// -// These events are: -// -// - PayloadPart -type ResponseStreamEvent interface { - eventResponseStream() - eventstreamapi.Marshaler - eventstreamapi.Unmarshaler -} - -// ResponseStreamReader provides the interface for reading to the stream. The -// default implementation for this interface will be ResponseStream. -// -// The reader's Close method must allow multiple concurrent calls. -// -// These events are: -// -// - PayloadPart -// - ResponseStreamUnknownEvent -type ResponseStreamReader interface { - // Returns a channel of events as they are read from the event stream. - Events() <-chan ResponseStreamEvent - - // Close will stop the reader reading events from the stream. - Close() error - - // Returns any error that has occurred while reading from the event stream. - Err() error -} - -type readResponseStream struct { - eventReader *eventstreamapi.EventReader - stream chan ResponseStreamEvent - err *eventstreamapi.OnceError - - done chan struct{} - closeOnce sync.Once -} - -func newReadResponseStream(eventReader *eventstreamapi.EventReader) *readResponseStream { - r := &readResponseStream{ - eventReader: eventReader, - stream: make(chan ResponseStreamEvent), - done: make(chan struct{}), - err: eventstreamapi.NewOnceError(), - } - go r.readEventStream() - - return r -} - -// Close will close the underlying event stream reader. -func (r *readResponseStream) Close() error { - r.closeOnce.Do(r.safeClose) - return r.Err() -} - -func (r *readResponseStream) ErrorSet() <-chan struct{} { - return r.err.ErrorSet() -} - -func (r *readResponseStream) Closed() <-chan struct{} { - return r.done -} - -func (r *readResponseStream) safeClose() { - close(r.done) -} - -func (r *readResponseStream) Err() error { - return r.err.Err() -} - -func (r *readResponseStream) Events() <-chan ResponseStreamEvent { - return r.stream -} - -func (r *readResponseStream) readEventStream() { - defer r.Close() - defer close(r.stream) - - for { - event, err := r.eventReader.ReadEvent() - if err != nil { - if err == io.EOF { - return - } - select { - case <-r.done: - // If closed already ignore the error - return - default: - } - if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok { - continue - } - r.err.SetError(err) - return - } - - select { - case r.stream <- event.(ResponseStreamEvent): - case <-r.done: - return - } - } -} - -type unmarshalerForResponseStreamEvent struct { - metadata protocol.ResponseMetadata -} - -func (u unmarshalerForResponseStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { - switch eventType { - case "chunk": - return &PayloadPart{}, nil - case "internalServerException": - return newErrorInternalServerException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "modelStreamErrorException": - return newErrorModelStreamErrorException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "modelTimeoutException": - return newErrorModelTimeoutException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "throttlingException": - return newErrorThrottlingException(u.metadata).(eventstreamapi.Unmarshaler), nil - case "validationException": - return newErrorValidationException(u.metadata).(eventstreamapi.Unmarshaler), nil - default: - return &ResponseStreamUnknownEvent{Type: eventType}, nil - } -} - -// ResponseStreamUnknownEvent provides a failsafe event for the -// ResponseStream group of events when an unknown event is received. -type ResponseStreamUnknownEvent struct { - Type string - Message eventstream.Message -} - -// The ResponseStreamUnknownEvent is and event in the ResponseStream -// group of events. -func (s *ResponseStreamUnknownEvent) eventResponseStream() {} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (e *ResponseStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) ( - msg eventstream.Message, err error, -) { - return e.Message.Clone(), nil -} - -// UnmarshalEvent unmarshals the EventStream Message into the ResponseStream value. -// This method is only used internally within the SDK's EventStream handling. -func (e *ResponseStreamUnknownEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - e.Message = msg.Clone() - return nil -} - -// The number of requests exceeds the service quota. Resubmit your request later. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The number of requests exceeds the limit. Resubmit your request later. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -// The ThrottlingException is and event in the ResponseStream group of events. -func (s *ThrottlingException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ThrottlingException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ThrottlingException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ThrottlingException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Input validation failed. Check your request parameters and retry the request. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -// The ValidationException is and event in the ResponseStream group of events. -func (s *ValidationException) eventResponseStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ValidationException value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ValidationException) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ValidationException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/bedrockruntimeiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/bedrockruntimeiface/interface.go deleted file mode 100644 index d86ab2b8c694..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/bedrockruntimeiface/interface.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bedrockruntimeiface provides an interface to enable mocking the Amazon Bedrock Runtime service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package bedrockruntimeiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime" -) - -// BedrockRuntimeAPI provides an interface to enable mocking the -// bedrockruntime.BedrockRuntime service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Bedrock Runtime. -// func myFunc(svc bedrockruntimeiface.BedrockRuntimeAPI) bool { -// // Make svc.InvokeModel request -// } -// -// func main() { -// sess := session.New() -// svc := bedrockruntime.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockBedrockRuntimeClient struct { -// bedrockruntimeiface.BedrockRuntimeAPI -// } -// func (m *mockBedrockRuntimeClient) InvokeModel(input *bedrockruntime.InvokeModelInput) (*bedrockruntime.InvokeModelOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockBedrockRuntimeClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type BedrockRuntimeAPI interface { - InvokeModel(*bedrockruntime.InvokeModelInput) (*bedrockruntime.InvokeModelOutput, error) - InvokeModelWithContext(aws.Context, *bedrockruntime.InvokeModelInput, ...request.Option) (*bedrockruntime.InvokeModelOutput, error) - InvokeModelRequest(*bedrockruntime.InvokeModelInput) (*request.Request, *bedrockruntime.InvokeModelOutput) - - InvokeModelWithResponseStream(*bedrockruntime.InvokeModelWithResponseStreamInput) (*bedrockruntime.InvokeModelWithResponseStreamOutput, error) - InvokeModelWithResponseStreamWithContext(aws.Context, *bedrockruntime.InvokeModelWithResponseStreamInput, ...request.Option) (*bedrockruntime.InvokeModelWithResponseStreamOutput, error) - InvokeModelWithResponseStreamRequest(*bedrockruntime.InvokeModelWithResponseStreamInput) (*request.Request, *bedrockruntime.InvokeModelWithResponseStreamOutput) -} - -var _ BedrockRuntimeAPI = (*bedrockruntime.BedrockRuntime)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/doc.go deleted file mode 100644 index a812ff6ad2e8..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package bedrockruntime provides the client and types for making API -// requests to Amazon Bedrock Runtime. -// -// Describes the API operations for running inference using Bedrock models. -// -// See https://docs.aws.amazon.com/goto/WebAPI/bedrock-runtime-2023-09-30 for more information on this service. -// -// See bedrockruntime package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bedrockruntime/ -// -// # Using the Client -// -// To contact Amazon Bedrock Runtime with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Bedrock Runtime client BedrockRuntime for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/bedrockruntime/#New -package bedrockruntime diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/errors.go deleted file mode 100644 index 098264f15e4d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/errors.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockruntime - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // The request is denied because of missing access permissions. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An internal server error occurred. Retry your request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeModelErrorException for service response error code - // "ModelErrorException". - // - // The request failed due to an error while processing the model. - ErrCodeModelErrorException = "ModelErrorException" - - // ErrCodeModelNotReadyException for service response error code - // "ModelNotReadyException". - // - // The model specified in the request is not ready to serve inference requests. - ErrCodeModelNotReadyException = "ModelNotReadyException" - - // ErrCodeModelStreamErrorException for service response error code - // "ModelStreamErrorException". - // - // An error occurred while streaming the response. - ErrCodeModelStreamErrorException = "ModelStreamErrorException" - - // ErrCodeModelTimeoutException for service response error code - // "ModelTimeoutException". - // - // The request took too long to process. Processing time exceeded the model - // timeout length. - ErrCodeModelTimeoutException = "ModelTimeoutException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource ARN was not found. Check the ARN and try your request - // again. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The number of requests exceeds the service quota. Resubmit your request later. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The number of requests exceeds the limit. Resubmit your request later. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Input validation failed. Check your request parameters and retry the request. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "InternalServerException": newErrorInternalServerException, - "ModelErrorException": newErrorModelErrorException, - "ModelNotReadyException": newErrorModelNotReadyException, - "ModelStreamErrorException": newErrorModelStreamErrorException, - "ModelTimeoutException": newErrorModelTimeoutException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/service.go deleted file mode 100644 index 8c5fb739114c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/bedrockruntime/service.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package bedrockruntime - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// BedrockRuntime provides the API operation methods for making requests to -// Amazon Bedrock Runtime. See this package's package overview docs -// for details on the service. -// -// BedrockRuntime methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type BedrockRuntime struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Bedrock Runtime" // Name of service. - EndpointsID = "bedrock-runtime" // ID to lookup a service endpoint with. - ServiceID = "Bedrock Runtime" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the BedrockRuntime client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a BedrockRuntime client from just a session. -// svc := bedrockruntime.New(mySession) -// -// // Create a BedrockRuntime client with additional configuration -// svc := bedrockruntime.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *BedrockRuntime { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "bedrock" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *BedrockRuntime { - svc := &BedrockRuntime{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-09-30", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - svc.Handlers.BuildStream.PushBackNamed(restjson.BuildHandler) - svc.Handlers.UnmarshalStream.PushBackNamed(restjson.UnmarshalHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a BedrockRuntime operation and runs any -// custom request initialization. -func (c *BedrockRuntime) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/api.go deleted file mode 100644 index c7f3cd2ef9b7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/api.go +++ /dev/null @@ -1,23412 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package chimesdkvoice - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opAssociatePhoneNumbersWithVoiceConnector = "AssociatePhoneNumbersWithVoiceConnector" - -// AssociatePhoneNumbersWithVoiceConnectorRequest generates a "aws/request.Request" representing the -// client's request for the AssociatePhoneNumbersWithVoiceConnector 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 AssociatePhoneNumbersWithVoiceConnector for more information on using the AssociatePhoneNumbersWithVoiceConnector -// 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 AssociatePhoneNumbersWithVoiceConnectorRequest method. -// req, resp := client.AssociatePhoneNumbersWithVoiceConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/AssociatePhoneNumbersWithVoiceConnector -func (c *ChimeSDKVoice) AssociatePhoneNumbersWithVoiceConnectorRequest(input *AssociatePhoneNumbersWithVoiceConnectorInput) (req *request.Request, output *AssociatePhoneNumbersWithVoiceConnectorOutput) { - op := &request.Operation{ - Name: opAssociatePhoneNumbersWithVoiceConnector, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{voiceConnectorId}?operation=associate-phone-numbers", - } - - if input == nil { - input = &AssociatePhoneNumbersWithVoiceConnectorInput{} - } - - output = &AssociatePhoneNumbersWithVoiceConnectorOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociatePhoneNumbersWithVoiceConnector API operation for Amazon Chime SDK Voice. -// -// Associates phone numbers with the specified Amazon Chime SDK Voice Connector. -// -// 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 Chime SDK Voice's -// API operation AssociatePhoneNumbersWithVoiceConnector for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/AssociatePhoneNumbersWithVoiceConnector -func (c *ChimeSDKVoice) AssociatePhoneNumbersWithVoiceConnector(input *AssociatePhoneNumbersWithVoiceConnectorInput) (*AssociatePhoneNumbersWithVoiceConnectorOutput, error) { - req, out := c.AssociatePhoneNumbersWithVoiceConnectorRequest(input) - return out, req.Send() -} - -// AssociatePhoneNumbersWithVoiceConnectorWithContext is the same as AssociatePhoneNumbersWithVoiceConnector with the addition of -// the ability to pass a context and additional request options. -// -// See AssociatePhoneNumbersWithVoiceConnector 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 *ChimeSDKVoice) AssociatePhoneNumbersWithVoiceConnectorWithContext(ctx aws.Context, input *AssociatePhoneNumbersWithVoiceConnectorInput, opts ...request.Option) (*AssociatePhoneNumbersWithVoiceConnectorOutput, error) { - req, out := c.AssociatePhoneNumbersWithVoiceConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociatePhoneNumbersWithVoiceConnectorGroup = "AssociatePhoneNumbersWithVoiceConnectorGroup" - -// AssociatePhoneNumbersWithVoiceConnectorGroupRequest generates a "aws/request.Request" representing the -// client's request for the AssociatePhoneNumbersWithVoiceConnectorGroup 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 AssociatePhoneNumbersWithVoiceConnectorGroup for more information on using the AssociatePhoneNumbersWithVoiceConnectorGroup -// 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 AssociatePhoneNumbersWithVoiceConnectorGroupRequest method. -// req, resp := client.AssociatePhoneNumbersWithVoiceConnectorGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/AssociatePhoneNumbersWithVoiceConnectorGroup -func (c *ChimeSDKVoice) AssociatePhoneNumbersWithVoiceConnectorGroupRequest(input *AssociatePhoneNumbersWithVoiceConnectorGroupInput) (req *request.Request, output *AssociatePhoneNumbersWithVoiceConnectorGroupOutput) { - op := &request.Operation{ - Name: opAssociatePhoneNumbersWithVoiceConnectorGroup, - HTTPMethod: "POST", - HTTPPath: "/voice-connector-groups/{voiceConnectorGroupId}?operation=associate-phone-numbers", - } - - if input == nil { - input = &AssociatePhoneNumbersWithVoiceConnectorGroupInput{} - } - - output = &AssociatePhoneNumbersWithVoiceConnectorGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociatePhoneNumbersWithVoiceConnectorGroup API operation for Amazon Chime SDK Voice. -// -// Associates phone numbers with the specified Amazon Chime SDK Voice Connector -// group. -// -// 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 Chime SDK Voice's -// API operation AssociatePhoneNumbersWithVoiceConnectorGroup for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/AssociatePhoneNumbersWithVoiceConnectorGroup -func (c *ChimeSDKVoice) AssociatePhoneNumbersWithVoiceConnectorGroup(input *AssociatePhoneNumbersWithVoiceConnectorGroupInput) (*AssociatePhoneNumbersWithVoiceConnectorGroupOutput, error) { - req, out := c.AssociatePhoneNumbersWithVoiceConnectorGroupRequest(input) - return out, req.Send() -} - -// AssociatePhoneNumbersWithVoiceConnectorGroupWithContext is the same as AssociatePhoneNumbersWithVoiceConnectorGroup with the addition of -// the ability to pass a context and additional request options. -// -// See AssociatePhoneNumbersWithVoiceConnectorGroup 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 *ChimeSDKVoice) AssociatePhoneNumbersWithVoiceConnectorGroupWithContext(ctx aws.Context, input *AssociatePhoneNumbersWithVoiceConnectorGroupInput, opts ...request.Option) (*AssociatePhoneNumbersWithVoiceConnectorGroupOutput, error) { - req, out := c.AssociatePhoneNumbersWithVoiceConnectorGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchDeletePhoneNumber = "BatchDeletePhoneNumber" - -// BatchDeletePhoneNumberRequest generates a "aws/request.Request" representing the -// client's request for the BatchDeletePhoneNumber 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 BatchDeletePhoneNumber for more information on using the BatchDeletePhoneNumber -// 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 BatchDeletePhoneNumberRequest method. -// req, resp := client.BatchDeletePhoneNumberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/BatchDeletePhoneNumber -func (c *ChimeSDKVoice) BatchDeletePhoneNumberRequest(input *BatchDeletePhoneNumberInput) (req *request.Request, output *BatchDeletePhoneNumberOutput) { - op := &request.Operation{ - Name: opBatchDeletePhoneNumber, - HTTPMethod: "POST", - HTTPPath: "/phone-numbers?operation=batch-delete", - } - - if input == nil { - input = &BatchDeletePhoneNumberInput{} - } - - output = &BatchDeletePhoneNumberOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchDeletePhoneNumber API operation for Amazon Chime SDK Voice. -// -// Moves phone numbers into the Deletion queue. Phone numbers must be disassociated -// from any users or Amazon Chime SDK Voice Connectors before they can be deleted. -// -// Phone numbers remain in the Deletion queue for 7 days before they are deleted -// permanently. -// -// 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 Chime SDK Voice's -// API operation BatchDeletePhoneNumber for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/BatchDeletePhoneNumber -func (c *ChimeSDKVoice) BatchDeletePhoneNumber(input *BatchDeletePhoneNumberInput) (*BatchDeletePhoneNumberOutput, error) { - req, out := c.BatchDeletePhoneNumberRequest(input) - return out, req.Send() -} - -// BatchDeletePhoneNumberWithContext is the same as BatchDeletePhoneNumber with the addition of -// the ability to pass a context and additional request options. -// -// See BatchDeletePhoneNumber 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 *ChimeSDKVoice) BatchDeletePhoneNumberWithContext(ctx aws.Context, input *BatchDeletePhoneNumberInput, opts ...request.Option) (*BatchDeletePhoneNumberOutput, error) { - req, out := c.BatchDeletePhoneNumberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchUpdatePhoneNumber = "BatchUpdatePhoneNumber" - -// BatchUpdatePhoneNumberRequest generates a "aws/request.Request" representing the -// client's request for the BatchUpdatePhoneNumber 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 BatchUpdatePhoneNumber for more information on using the BatchUpdatePhoneNumber -// 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 BatchUpdatePhoneNumberRequest method. -// req, resp := client.BatchUpdatePhoneNumberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/BatchUpdatePhoneNumber -func (c *ChimeSDKVoice) BatchUpdatePhoneNumberRequest(input *BatchUpdatePhoneNumberInput) (req *request.Request, output *BatchUpdatePhoneNumberOutput) { - op := &request.Operation{ - Name: opBatchUpdatePhoneNumber, - HTTPMethod: "POST", - HTTPPath: "/phone-numbers?operation=batch-update", - } - - if input == nil { - input = &BatchUpdatePhoneNumberInput{} - } - - output = &BatchUpdatePhoneNumberOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchUpdatePhoneNumber API operation for Amazon Chime SDK Voice. -// -// Updates one or more phone numbers. -// -// 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 Chime SDK Voice's -// API operation BatchUpdatePhoneNumber for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/BatchUpdatePhoneNumber -func (c *ChimeSDKVoice) BatchUpdatePhoneNumber(input *BatchUpdatePhoneNumberInput) (*BatchUpdatePhoneNumberOutput, error) { - req, out := c.BatchUpdatePhoneNumberRequest(input) - return out, req.Send() -} - -// BatchUpdatePhoneNumberWithContext is the same as BatchUpdatePhoneNumber with the addition of -// the ability to pass a context and additional request options. -// -// See BatchUpdatePhoneNumber 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 *ChimeSDKVoice) BatchUpdatePhoneNumberWithContext(ctx aws.Context, input *BatchUpdatePhoneNumberInput, opts ...request.Option) (*BatchUpdatePhoneNumberOutput, error) { - req, out := c.BatchUpdatePhoneNumberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePhoneNumberOrder = "CreatePhoneNumberOrder" - -// CreatePhoneNumberOrderRequest generates a "aws/request.Request" representing the -// client's request for the CreatePhoneNumberOrder 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 CreatePhoneNumberOrder for more information on using the CreatePhoneNumberOrder -// 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 CreatePhoneNumberOrderRequest method. -// req, resp := client.CreatePhoneNumberOrderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreatePhoneNumberOrder -func (c *ChimeSDKVoice) CreatePhoneNumberOrderRequest(input *CreatePhoneNumberOrderInput) (req *request.Request, output *CreatePhoneNumberOrderOutput) { - op := &request.Operation{ - Name: opCreatePhoneNumberOrder, - HTTPMethod: "POST", - HTTPPath: "/phone-number-orders", - } - - if input == nil { - input = &CreatePhoneNumberOrderInput{} - } - - output = &CreatePhoneNumberOrderOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePhoneNumberOrder API operation for Amazon Chime SDK Voice. -// -// Creates an order for phone numbers to be provisioned. For numbers outside -// the U.S., you must use the Amazon Chime SDK SIP media application dial-in -// product type. -// -// 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 Chime SDK Voice's -// API operation CreatePhoneNumberOrder for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreatePhoneNumberOrder -func (c *ChimeSDKVoice) CreatePhoneNumberOrder(input *CreatePhoneNumberOrderInput) (*CreatePhoneNumberOrderOutput, error) { - req, out := c.CreatePhoneNumberOrderRequest(input) - return out, req.Send() -} - -// CreatePhoneNumberOrderWithContext is the same as CreatePhoneNumberOrder with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePhoneNumberOrder 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 *ChimeSDKVoice) CreatePhoneNumberOrderWithContext(ctx aws.Context, input *CreatePhoneNumberOrderInput, opts ...request.Option) (*CreatePhoneNumberOrderOutput, error) { - req, out := c.CreatePhoneNumberOrderRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateProxySession = "CreateProxySession" - -// CreateProxySessionRequest generates a "aws/request.Request" representing the -// client's request for the CreateProxySession 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 CreateProxySession for more information on using the CreateProxySession -// 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 CreateProxySessionRequest method. -// req, resp := client.CreateProxySessionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateProxySession -func (c *ChimeSDKVoice) CreateProxySessionRequest(input *CreateProxySessionInput) (req *request.Request, output *CreateProxySessionOutput) { - op := &request.Operation{ - Name: opCreateProxySession, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{voiceConnectorId}/proxy-sessions", - } - - if input == nil { - input = &CreateProxySessionInput{} - } - - output = &CreateProxySessionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateProxySession API operation for Amazon Chime SDK Voice. -// -// Creates a proxy session for the specified Amazon Chime SDK Voice Connector -// for the specified participant phone numbers. -// -// 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 Chime SDK Voice's -// API operation CreateProxySession for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateProxySession -func (c *ChimeSDKVoice) CreateProxySession(input *CreateProxySessionInput) (*CreateProxySessionOutput, error) { - req, out := c.CreateProxySessionRequest(input) - return out, req.Send() -} - -// CreateProxySessionWithContext is the same as CreateProxySession with the addition of -// the ability to pass a context and additional request options. -// -// See CreateProxySession 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 *ChimeSDKVoice) CreateProxySessionWithContext(ctx aws.Context, input *CreateProxySessionInput, opts ...request.Option) (*CreateProxySessionOutput, error) { - req, out := c.CreateProxySessionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSipMediaApplication = "CreateSipMediaApplication" - -// CreateSipMediaApplicationRequest generates a "aws/request.Request" representing the -// client's request for the CreateSipMediaApplication 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 CreateSipMediaApplication for more information on using the CreateSipMediaApplication -// 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 CreateSipMediaApplicationRequest method. -// req, resp := client.CreateSipMediaApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateSipMediaApplication -func (c *ChimeSDKVoice) CreateSipMediaApplicationRequest(input *CreateSipMediaApplicationInput) (req *request.Request, output *CreateSipMediaApplicationOutput) { - op := &request.Operation{ - Name: opCreateSipMediaApplication, - HTTPMethod: "POST", - HTTPPath: "/sip-media-applications", - } - - if input == nil { - input = &CreateSipMediaApplicationInput{} - } - - output = &CreateSipMediaApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSipMediaApplication API operation for Amazon Chime SDK Voice. -// -// Creates a SIP media application. For more information about SIP media applications, -// see Managing SIP media applications and rules (https://docs.aws.amazon.com/chime-sdk/latest/ag/manage-sip-applications.html) -// in the Amazon Chime SDK Administrator Guide. -// -// 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 Chime SDK Voice's -// API operation CreateSipMediaApplication for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateSipMediaApplication -func (c *ChimeSDKVoice) CreateSipMediaApplication(input *CreateSipMediaApplicationInput) (*CreateSipMediaApplicationOutput, error) { - req, out := c.CreateSipMediaApplicationRequest(input) - return out, req.Send() -} - -// CreateSipMediaApplicationWithContext is the same as CreateSipMediaApplication with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSipMediaApplication 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 *ChimeSDKVoice) CreateSipMediaApplicationWithContext(ctx aws.Context, input *CreateSipMediaApplicationInput, opts ...request.Option) (*CreateSipMediaApplicationOutput, error) { - req, out := c.CreateSipMediaApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSipMediaApplicationCall = "CreateSipMediaApplicationCall" - -// CreateSipMediaApplicationCallRequest generates a "aws/request.Request" representing the -// client's request for the CreateSipMediaApplicationCall 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 CreateSipMediaApplicationCall for more information on using the CreateSipMediaApplicationCall -// 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 CreateSipMediaApplicationCallRequest method. -// req, resp := client.CreateSipMediaApplicationCallRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateSipMediaApplicationCall -func (c *ChimeSDKVoice) CreateSipMediaApplicationCallRequest(input *CreateSipMediaApplicationCallInput) (req *request.Request, output *CreateSipMediaApplicationCallOutput) { - op := &request.Operation{ - Name: opCreateSipMediaApplicationCall, - HTTPMethod: "POST", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}/calls", - } - - if input == nil { - input = &CreateSipMediaApplicationCallInput{} - } - - output = &CreateSipMediaApplicationCallOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSipMediaApplicationCall API operation for Amazon Chime SDK Voice. -// -// Creates an outbound call to a phone number from the phone number specified -// in the request, and it invokes the endpoint of the specified sipMediaApplicationId. -// -// 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 Chime SDK Voice's -// API operation CreateSipMediaApplicationCall for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateSipMediaApplicationCall -func (c *ChimeSDKVoice) CreateSipMediaApplicationCall(input *CreateSipMediaApplicationCallInput) (*CreateSipMediaApplicationCallOutput, error) { - req, out := c.CreateSipMediaApplicationCallRequest(input) - return out, req.Send() -} - -// CreateSipMediaApplicationCallWithContext is the same as CreateSipMediaApplicationCall with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSipMediaApplicationCall 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 *ChimeSDKVoice) CreateSipMediaApplicationCallWithContext(ctx aws.Context, input *CreateSipMediaApplicationCallInput, opts ...request.Option) (*CreateSipMediaApplicationCallOutput, error) { - req, out := c.CreateSipMediaApplicationCallRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSipRule = "CreateSipRule" - -// CreateSipRuleRequest generates a "aws/request.Request" representing the -// client's request for the CreateSipRule 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 CreateSipRule for more information on using the CreateSipRule -// 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 CreateSipRuleRequest method. -// req, resp := client.CreateSipRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateSipRule -func (c *ChimeSDKVoice) CreateSipRuleRequest(input *CreateSipRuleInput) (req *request.Request, output *CreateSipRuleOutput) { - op := &request.Operation{ - Name: opCreateSipRule, - HTTPMethod: "POST", - HTTPPath: "/sip-rules", - } - - if input == nil { - input = &CreateSipRuleInput{} - } - - output = &CreateSipRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSipRule API operation for Amazon Chime SDK Voice. -// -// Creates a SIP rule, which can be used to run a SIP media application as a -// target for a specific trigger type. For more information about SIP rules, -// see Managing SIP media applications and rules (https://docs.aws.amazon.com/chime-sdk/latest/ag/manage-sip-applications.html) -// in the Amazon Chime SDK Administrator Guide. -// -// 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 Chime SDK Voice's -// API operation CreateSipRule for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateSipRule -func (c *ChimeSDKVoice) CreateSipRule(input *CreateSipRuleInput) (*CreateSipRuleOutput, error) { - req, out := c.CreateSipRuleRequest(input) - return out, req.Send() -} - -// CreateSipRuleWithContext is the same as CreateSipRule with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSipRule 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 *ChimeSDKVoice) CreateSipRuleWithContext(ctx aws.Context, input *CreateSipRuleInput, opts ...request.Option) (*CreateSipRuleOutput, error) { - req, out := c.CreateSipRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVoiceConnector = "CreateVoiceConnector" - -// CreateVoiceConnectorRequest generates a "aws/request.Request" representing the -// client's request for the CreateVoiceConnector 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 CreateVoiceConnector for more information on using the CreateVoiceConnector -// 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 CreateVoiceConnectorRequest method. -// req, resp := client.CreateVoiceConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateVoiceConnector -func (c *ChimeSDKVoice) CreateVoiceConnectorRequest(input *CreateVoiceConnectorInput) (req *request.Request, output *CreateVoiceConnectorOutput) { - op := &request.Operation{ - Name: opCreateVoiceConnector, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors", - } - - if input == nil { - input = &CreateVoiceConnectorInput{} - } - - output = &CreateVoiceConnectorOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVoiceConnector API operation for Amazon Chime SDK Voice. -// -// Creates an Amazon Chime SDK Voice Connector. For more information about Voice -// Connectors, see Managing Amazon Chime SDK Voice Connector groups (https://docs.aws.amazon.com/chime-sdk/latest/ag/voice-connector-groups.html) -// in the Amazon Chime SDK Administrator Guide. -// -// 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 Chime SDK Voice's -// API operation CreateVoiceConnector for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateVoiceConnector -func (c *ChimeSDKVoice) CreateVoiceConnector(input *CreateVoiceConnectorInput) (*CreateVoiceConnectorOutput, error) { - req, out := c.CreateVoiceConnectorRequest(input) - return out, req.Send() -} - -// CreateVoiceConnectorWithContext is the same as CreateVoiceConnector with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVoiceConnector 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 *ChimeSDKVoice) CreateVoiceConnectorWithContext(ctx aws.Context, input *CreateVoiceConnectorInput, opts ...request.Option) (*CreateVoiceConnectorOutput, error) { - req, out := c.CreateVoiceConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVoiceConnectorGroup = "CreateVoiceConnectorGroup" - -// CreateVoiceConnectorGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateVoiceConnectorGroup 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 CreateVoiceConnectorGroup for more information on using the CreateVoiceConnectorGroup -// 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 CreateVoiceConnectorGroupRequest method. -// req, resp := client.CreateVoiceConnectorGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateVoiceConnectorGroup -func (c *ChimeSDKVoice) CreateVoiceConnectorGroupRequest(input *CreateVoiceConnectorGroupInput) (req *request.Request, output *CreateVoiceConnectorGroupOutput) { - op := &request.Operation{ - Name: opCreateVoiceConnectorGroup, - HTTPMethod: "POST", - HTTPPath: "/voice-connector-groups", - } - - if input == nil { - input = &CreateVoiceConnectorGroupInput{} - } - - output = &CreateVoiceConnectorGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVoiceConnectorGroup API operation for Amazon Chime SDK Voice. -// -// Creates an Amazon Chime SDK Voice Connector group under the administrator's -// AWS account. You can associate Amazon Chime SDK Voice Connectors with the -// Voice Connector group by including VoiceConnectorItems in the request. -// -// You can include Voice Connectors from different AWS Regions in your group. -// This creates a fault tolerant mechanism for fallback in case of availability -// events. -// -// 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 Chime SDK Voice's -// API operation CreateVoiceConnectorGroup for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateVoiceConnectorGroup -func (c *ChimeSDKVoice) CreateVoiceConnectorGroup(input *CreateVoiceConnectorGroupInput) (*CreateVoiceConnectorGroupOutput, error) { - req, out := c.CreateVoiceConnectorGroupRequest(input) - return out, req.Send() -} - -// CreateVoiceConnectorGroupWithContext is the same as CreateVoiceConnectorGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVoiceConnectorGroup 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 *ChimeSDKVoice) CreateVoiceConnectorGroupWithContext(ctx aws.Context, input *CreateVoiceConnectorGroupInput, opts ...request.Option) (*CreateVoiceConnectorGroupOutput, error) { - req, out := c.CreateVoiceConnectorGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVoiceProfile = "CreateVoiceProfile" - -// CreateVoiceProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateVoiceProfile 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 CreateVoiceProfile for more information on using the CreateVoiceProfile -// 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 CreateVoiceProfileRequest method. -// req, resp := client.CreateVoiceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateVoiceProfile -func (c *ChimeSDKVoice) CreateVoiceProfileRequest(input *CreateVoiceProfileInput) (req *request.Request, output *CreateVoiceProfileOutput) { - op := &request.Operation{ - Name: opCreateVoiceProfile, - HTTPMethod: "POST", - HTTPPath: "/voice-profiles", - } - - if input == nil { - input = &CreateVoiceProfileInput{} - } - - output = &CreateVoiceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVoiceProfile API operation for Amazon Chime SDK Voice. -// -// Creates a voice profile, which consists of an enrolled user and their latest -// voice print. -// -// Before creating any voice profiles, you must provide all notices and obtain -// all consents from the speaker as required under applicable privacy and biometrics -// laws, and as required under the AWS service terms (https://aws.amazon.com/service-terms/) -// for the Amazon Chime SDK. -// -// For more information about voice profiles and voice analytics, see Using -// Amazon Chime SDK Voice Analytics (https://docs.aws.amazon.com/chime-sdk/latest/dg/pstn-voice-analytics.html) -// in the Amazon Chime SDK Developer Guide. -// -// 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 Chime SDK Voice's -// API operation CreateVoiceProfile for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - GoneException -// Access to the target resource is no longer available at the origin server. -// This condition is likely to be permanent. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateVoiceProfile -func (c *ChimeSDKVoice) CreateVoiceProfile(input *CreateVoiceProfileInput) (*CreateVoiceProfileOutput, error) { - req, out := c.CreateVoiceProfileRequest(input) - return out, req.Send() -} - -// CreateVoiceProfileWithContext is the same as CreateVoiceProfile with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVoiceProfile 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 *ChimeSDKVoice) CreateVoiceProfileWithContext(ctx aws.Context, input *CreateVoiceProfileInput, opts ...request.Option) (*CreateVoiceProfileOutput, error) { - req, out := c.CreateVoiceProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVoiceProfileDomain = "CreateVoiceProfileDomain" - -// CreateVoiceProfileDomainRequest generates a "aws/request.Request" representing the -// client's request for the CreateVoiceProfileDomain 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 CreateVoiceProfileDomain for more information on using the CreateVoiceProfileDomain -// 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 CreateVoiceProfileDomainRequest method. -// req, resp := client.CreateVoiceProfileDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateVoiceProfileDomain -func (c *ChimeSDKVoice) CreateVoiceProfileDomainRequest(input *CreateVoiceProfileDomainInput) (req *request.Request, output *CreateVoiceProfileDomainOutput) { - op := &request.Operation{ - Name: opCreateVoiceProfileDomain, - HTTPMethod: "POST", - HTTPPath: "/voice-profile-domains", - } - - if input == nil { - input = &CreateVoiceProfileDomainInput{} - } - - output = &CreateVoiceProfileDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVoiceProfileDomain API operation for Amazon Chime SDK Voice. -// -// Creates a voice profile domain, a collection of voice profiles, their voice -// prints, and encrypted enrollment audio. -// -// Before creating any voice profiles, you must provide all notices and obtain -// all consents from the speaker as required under applicable privacy and biometrics -// laws, and as required under the AWS service terms (https://aws.amazon.com/service-terms/) -// for the Amazon Chime SDK. -// -// For more information about voice profile domains, see Using Amazon Chime -// SDK Voice Analytics (https://docs.aws.amazon.com/chime-sdk/latest/dg/pstn-voice-analytics.html) -// in the Amazon Chime SDK Developer Guide. -// -// 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 Chime SDK Voice's -// API operation CreateVoiceProfileDomain for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/CreateVoiceProfileDomain -func (c *ChimeSDKVoice) CreateVoiceProfileDomain(input *CreateVoiceProfileDomainInput) (*CreateVoiceProfileDomainOutput, error) { - req, out := c.CreateVoiceProfileDomainRequest(input) - return out, req.Send() -} - -// CreateVoiceProfileDomainWithContext is the same as CreateVoiceProfileDomain with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVoiceProfileDomain 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 *ChimeSDKVoice) CreateVoiceProfileDomainWithContext(ctx aws.Context, input *CreateVoiceProfileDomainInput, opts ...request.Option) (*CreateVoiceProfileDomainOutput, error) { - req, out := c.CreateVoiceProfileDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePhoneNumber = "DeletePhoneNumber" - -// DeletePhoneNumberRequest generates a "aws/request.Request" representing the -// client's request for the DeletePhoneNumber 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 DeletePhoneNumber for more information on using the DeletePhoneNumber -// 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 DeletePhoneNumberRequest method. -// req, resp := client.DeletePhoneNumberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeletePhoneNumber -func (c *ChimeSDKVoice) DeletePhoneNumberRequest(input *DeletePhoneNumberInput) (req *request.Request, output *DeletePhoneNumberOutput) { - op := &request.Operation{ - Name: opDeletePhoneNumber, - HTTPMethod: "DELETE", - HTTPPath: "/phone-numbers/{phoneNumberId}", - } - - if input == nil { - input = &DeletePhoneNumberInput{} - } - - output = &DeletePhoneNumberOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePhoneNumber API operation for Amazon Chime SDK Voice. -// -// Moves the specified phone number into the Deletion queue. A phone number -// must be disassociated from any users or Amazon Chime SDK Voice Connectors -// before it can be deleted. -// -// Deleted phone numbers remain in the Deletion queue queue for 7 days before -// they are deleted permanently. -// -// 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 Chime SDK Voice's -// API operation DeletePhoneNumber for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeletePhoneNumber -func (c *ChimeSDKVoice) DeletePhoneNumber(input *DeletePhoneNumberInput) (*DeletePhoneNumberOutput, error) { - req, out := c.DeletePhoneNumberRequest(input) - return out, req.Send() -} - -// DeletePhoneNumberWithContext is the same as DeletePhoneNumber with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePhoneNumber 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 *ChimeSDKVoice) DeletePhoneNumberWithContext(ctx aws.Context, input *DeletePhoneNumberInput, opts ...request.Option) (*DeletePhoneNumberOutput, error) { - req, out := c.DeletePhoneNumberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteProxySession = "DeleteProxySession" - -// DeleteProxySessionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteProxySession 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 DeleteProxySession for more information on using the DeleteProxySession -// 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 DeleteProxySessionRequest method. -// req, resp := client.DeleteProxySessionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteProxySession -func (c *ChimeSDKVoice) DeleteProxySessionRequest(input *DeleteProxySessionInput) (req *request.Request, output *DeleteProxySessionOutput) { - op := &request.Operation{ - Name: opDeleteProxySession, - HTTPMethod: "DELETE", - HTTPPath: "/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}", - } - - if input == nil { - input = &DeleteProxySessionInput{} - } - - output = &DeleteProxySessionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteProxySession API operation for Amazon Chime SDK Voice. -// -// Deletes the specified proxy session from the specified Amazon Chime SDK Voice -// Connector. -// -// 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 Chime SDK Voice's -// API operation DeleteProxySession for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteProxySession -func (c *ChimeSDKVoice) DeleteProxySession(input *DeleteProxySessionInput) (*DeleteProxySessionOutput, error) { - req, out := c.DeleteProxySessionRequest(input) - return out, req.Send() -} - -// DeleteProxySessionWithContext is the same as DeleteProxySession with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteProxySession 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 *ChimeSDKVoice) DeleteProxySessionWithContext(ctx aws.Context, input *DeleteProxySessionInput, opts ...request.Option) (*DeleteProxySessionOutput, error) { - req, out := c.DeleteProxySessionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSipMediaApplication = "DeleteSipMediaApplication" - -// DeleteSipMediaApplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSipMediaApplication 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 DeleteSipMediaApplication for more information on using the DeleteSipMediaApplication -// 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 DeleteSipMediaApplicationRequest method. -// req, resp := client.DeleteSipMediaApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteSipMediaApplication -func (c *ChimeSDKVoice) DeleteSipMediaApplicationRequest(input *DeleteSipMediaApplicationInput) (req *request.Request, output *DeleteSipMediaApplicationOutput) { - op := &request.Operation{ - Name: opDeleteSipMediaApplication, - HTTPMethod: "DELETE", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}", - } - - if input == nil { - input = &DeleteSipMediaApplicationInput{} - } - - output = &DeleteSipMediaApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSipMediaApplication API operation for Amazon Chime SDK Voice. -// -// Deletes a SIP media application. -// -// 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 Chime SDK Voice's -// API operation DeleteSipMediaApplication for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteSipMediaApplication -func (c *ChimeSDKVoice) DeleteSipMediaApplication(input *DeleteSipMediaApplicationInput) (*DeleteSipMediaApplicationOutput, error) { - req, out := c.DeleteSipMediaApplicationRequest(input) - return out, req.Send() -} - -// DeleteSipMediaApplicationWithContext is the same as DeleteSipMediaApplication with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSipMediaApplication 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 *ChimeSDKVoice) DeleteSipMediaApplicationWithContext(ctx aws.Context, input *DeleteSipMediaApplicationInput, opts ...request.Option) (*DeleteSipMediaApplicationOutput, error) { - req, out := c.DeleteSipMediaApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSipRule = "DeleteSipRule" - -// DeleteSipRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSipRule 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 DeleteSipRule for more information on using the DeleteSipRule -// 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 DeleteSipRuleRequest method. -// req, resp := client.DeleteSipRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteSipRule -func (c *ChimeSDKVoice) DeleteSipRuleRequest(input *DeleteSipRuleInput) (req *request.Request, output *DeleteSipRuleOutput) { - op := &request.Operation{ - Name: opDeleteSipRule, - HTTPMethod: "DELETE", - HTTPPath: "/sip-rules/{sipRuleId}", - } - - if input == nil { - input = &DeleteSipRuleInput{} - } - - output = &DeleteSipRuleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSipRule API operation for Amazon Chime SDK Voice. -// -// Deletes a SIP rule. -// -// 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 Chime SDK Voice's -// API operation DeleteSipRule for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteSipRule -func (c *ChimeSDKVoice) DeleteSipRule(input *DeleteSipRuleInput) (*DeleteSipRuleOutput, error) { - req, out := c.DeleteSipRuleRequest(input) - return out, req.Send() -} - -// DeleteSipRuleWithContext is the same as DeleteSipRule with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSipRule 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 *ChimeSDKVoice) DeleteSipRuleWithContext(ctx aws.Context, input *DeleteSipRuleInput, opts ...request.Option) (*DeleteSipRuleOutput, error) { - req, out := c.DeleteSipRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceConnector = "DeleteVoiceConnector" - -// DeleteVoiceConnectorRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceConnector 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 DeleteVoiceConnector for more information on using the DeleteVoiceConnector -// 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 DeleteVoiceConnectorRequest method. -// req, resp := client.DeleteVoiceConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnector -func (c *ChimeSDKVoice) DeleteVoiceConnectorRequest(input *DeleteVoiceConnectorInput) (req *request.Request, output *DeleteVoiceConnectorOutput) { - op := &request.Operation{ - Name: opDeleteVoiceConnector, - HTTPMethod: "DELETE", - HTTPPath: "/voice-connectors/{voiceConnectorId}", - } - - if input == nil { - input = &DeleteVoiceConnectorInput{} - } - - output = &DeleteVoiceConnectorOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceConnector API operation for Amazon Chime SDK Voice. -// -// Deletes an Amazon Chime SDK Voice Connector. Any phone numbers associated -// with the Amazon Chime SDK Voice Connector must be disassociated from it before -// it can be deleted. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceConnector for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnector -func (c *ChimeSDKVoice) DeleteVoiceConnector(input *DeleteVoiceConnectorInput) (*DeleteVoiceConnectorOutput, error) { - req, out := c.DeleteVoiceConnectorRequest(input) - return out, req.Send() -} - -// DeleteVoiceConnectorWithContext is the same as DeleteVoiceConnector with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceConnector 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 *ChimeSDKVoice) DeleteVoiceConnectorWithContext(ctx aws.Context, input *DeleteVoiceConnectorInput, opts ...request.Option) (*DeleteVoiceConnectorOutput, error) { - req, out := c.DeleteVoiceConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceConnectorEmergencyCallingConfiguration = "DeleteVoiceConnectorEmergencyCallingConfiguration" - -// DeleteVoiceConnectorEmergencyCallingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceConnectorEmergencyCallingConfiguration 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 DeleteVoiceConnectorEmergencyCallingConfiguration for more information on using the DeleteVoiceConnectorEmergencyCallingConfiguration -// 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 DeleteVoiceConnectorEmergencyCallingConfigurationRequest method. -// req, resp := client.DeleteVoiceConnectorEmergencyCallingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorEmergencyCallingConfiguration -func (c *ChimeSDKVoice) DeleteVoiceConnectorEmergencyCallingConfigurationRequest(input *DeleteVoiceConnectorEmergencyCallingConfigurationInput) (req *request.Request, output *DeleteVoiceConnectorEmergencyCallingConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteVoiceConnectorEmergencyCallingConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/voice-connectors/{voiceConnectorId}/emergency-calling-configuration", - } - - if input == nil { - input = &DeleteVoiceConnectorEmergencyCallingConfigurationInput{} - } - - output = &DeleteVoiceConnectorEmergencyCallingConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceConnectorEmergencyCallingConfiguration API operation for Amazon Chime SDK Voice. -// -// Deletes the emergency calling details from the specified Amazon Chime SDK -// Voice Connector. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceConnectorEmergencyCallingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorEmergencyCallingConfiguration -func (c *ChimeSDKVoice) DeleteVoiceConnectorEmergencyCallingConfiguration(input *DeleteVoiceConnectorEmergencyCallingConfigurationInput) (*DeleteVoiceConnectorEmergencyCallingConfigurationOutput, error) { - req, out := c.DeleteVoiceConnectorEmergencyCallingConfigurationRequest(input) - return out, req.Send() -} - -// DeleteVoiceConnectorEmergencyCallingConfigurationWithContext is the same as DeleteVoiceConnectorEmergencyCallingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceConnectorEmergencyCallingConfiguration 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 *ChimeSDKVoice) DeleteVoiceConnectorEmergencyCallingConfigurationWithContext(ctx aws.Context, input *DeleteVoiceConnectorEmergencyCallingConfigurationInput, opts ...request.Option) (*DeleteVoiceConnectorEmergencyCallingConfigurationOutput, error) { - req, out := c.DeleteVoiceConnectorEmergencyCallingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceConnectorGroup = "DeleteVoiceConnectorGroup" - -// DeleteVoiceConnectorGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceConnectorGroup 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 DeleteVoiceConnectorGroup for more information on using the DeleteVoiceConnectorGroup -// 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 DeleteVoiceConnectorGroupRequest method. -// req, resp := client.DeleteVoiceConnectorGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorGroup -func (c *ChimeSDKVoice) DeleteVoiceConnectorGroupRequest(input *DeleteVoiceConnectorGroupInput) (req *request.Request, output *DeleteVoiceConnectorGroupOutput) { - op := &request.Operation{ - Name: opDeleteVoiceConnectorGroup, - HTTPMethod: "DELETE", - HTTPPath: "/voice-connector-groups/{voiceConnectorGroupId}", - } - - if input == nil { - input = &DeleteVoiceConnectorGroupInput{} - } - - output = &DeleteVoiceConnectorGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceConnectorGroup API operation for Amazon Chime SDK Voice. -// -// Deletes an Amazon Chime SDK Voice Connector group. Any VoiceConnectorItems -// and phone numbers associated with the group must be removed before it can -// be deleted. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceConnectorGroup for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorGroup -func (c *ChimeSDKVoice) DeleteVoiceConnectorGroup(input *DeleteVoiceConnectorGroupInput) (*DeleteVoiceConnectorGroupOutput, error) { - req, out := c.DeleteVoiceConnectorGroupRequest(input) - return out, req.Send() -} - -// DeleteVoiceConnectorGroupWithContext is the same as DeleteVoiceConnectorGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceConnectorGroup 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 *ChimeSDKVoice) DeleteVoiceConnectorGroupWithContext(ctx aws.Context, input *DeleteVoiceConnectorGroupInput, opts ...request.Option) (*DeleteVoiceConnectorGroupOutput, error) { - req, out := c.DeleteVoiceConnectorGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceConnectorOrigination = "DeleteVoiceConnectorOrigination" - -// DeleteVoiceConnectorOriginationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceConnectorOrigination 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 DeleteVoiceConnectorOrigination for more information on using the DeleteVoiceConnectorOrigination -// 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 DeleteVoiceConnectorOriginationRequest method. -// req, resp := client.DeleteVoiceConnectorOriginationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorOrigination -func (c *ChimeSDKVoice) DeleteVoiceConnectorOriginationRequest(input *DeleteVoiceConnectorOriginationInput) (req *request.Request, output *DeleteVoiceConnectorOriginationOutput) { - op := &request.Operation{ - Name: opDeleteVoiceConnectorOrigination, - HTTPMethod: "DELETE", - HTTPPath: "/voice-connectors/{voiceConnectorId}/origination", - } - - if input == nil { - input = &DeleteVoiceConnectorOriginationInput{} - } - - output = &DeleteVoiceConnectorOriginationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceConnectorOrigination API operation for Amazon Chime SDK Voice. -// -// Deletes the origination settings for the specified Amazon Chime SDK Voice -// Connector. -// -// If emergency calling is configured for the Voice Connector, it must be deleted -// prior to deleting the origination settings. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceConnectorOrigination for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorOrigination -func (c *ChimeSDKVoice) DeleteVoiceConnectorOrigination(input *DeleteVoiceConnectorOriginationInput) (*DeleteVoiceConnectorOriginationOutput, error) { - req, out := c.DeleteVoiceConnectorOriginationRequest(input) - return out, req.Send() -} - -// DeleteVoiceConnectorOriginationWithContext is the same as DeleteVoiceConnectorOrigination with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceConnectorOrigination 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 *ChimeSDKVoice) DeleteVoiceConnectorOriginationWithContext(ctx aws.Context, input *DeleteVoiceConnectorOriginationInput, opts ...request.Option) (*DeleteVoiceConnectorOriginationOutput, error) { - req, out := c.DeleteVoiceConnectorOriginationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceConnectorProxy = "DeleteVoiceConnectorProxy" - -// DeleteVoiceConnectorProxyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceConnectorProxy 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 DeleteVoiceConnectorProxy for more information on using the DeleteVoiceConnectorProxy -// 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 DeleteVoiceConnectorProxyRequest method. -// req, resp := client.DeleteVoiceConnectorProxyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorProxy -func (c *ChimeSDKVoice) DeleteVoiceConnectorProxyRequest(input *DeleteVoiceConnectorProxyInput) (req *request.Request, output *DeleteVoiceConnectorProxyOutput) { - op := &request.Operation{ - Name: opDeleteVoiceConnectorProxy, - HTTPMethod: "DELETE", - HTTPPath: "/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy", - } - - if input == nil { - input = &DeleteVoiceConnectorProxyInput{} - } - - output = &DeleteVoiceConnectorProxyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceConnectorProxy API operation for Amazon Chime SDK Voice. -// -// Deletes the proxy configuration from the specified Amazon Chime SDK Voice -// Connector. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceConnectorProxy for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorProxy -func (c *ChimeSDKVoice) DeleteVoiceConnectorProxy(input *DeleteVoiceConnectorProxyInput) (*DeleteVoiceConnectorProxyOutput, error) { - req, out := c.DeleteVoiceConnectorProxyRequest(input) - return out, req.Send() -} - -// DeleteVoiceConnectorProxyWithContext is the same as DeleteVoiceConnectorProxy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceConnectorProxy 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 *ChimeSDKVoice) DeleteVoiceConnectorProxyWithContext(ctx aws.Context, input *DeleteVoiceConnectorProxyInput, opts ...request.Option) (*DeleteVoiceConnectorProxyOutput, error) { - req, out := c.DeleteVoiceConnectorProxyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceConnectorStreamingConfiguration = "DeleteVoiceConnectorStreamingConfiguration" - -// DeleteVoiceConnectorStreamingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceConnectorStreamingConfiguration 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 DeleteVoiceConnectorStreamingConfiguration for more information on using the DeleteVoiceConnectorStreamingConfiguration -// 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 DeleteVoiceConnectorStreamingConfigurationRequest method. -// req, resp := client.DeleteVoiceConnectorStreamingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorStreamingConfiguration -func (c *ChimeSDKVoice) DeleteVoiceConnectorStreamingConfigurationRequest(input *DeleteVoiceConnectorStreamingConfigurationInput) (req *request.Request, output *DeleteVoiceConnectorStreamingConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteVoiceConnectorStreamingConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/voice-connectors/{voiceConnectorId}/streaming-configuration", - } - - if input == nil { - input = &DeleteVoiceConnectorStreamingConfigurationInput{} - } - - output = &DeleteVoiceConnectorStreamingConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceConnectorStreamingConfiguration API operation for Amazon Chime SDK Voice. -// -// Deletes a Voice Connector's streaming configuration. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceConnectorStreamingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorStreamingConfiguration -func (c *ChimeSDKVoice) DeleteVoiceConnectorStreamingConfiguration(input *DeleteVoiceConnectorStreamingConfigurationInput) (*DeleteVoiceConnectorStreamingConfigurationOutput, error) { - req, out := c.DeleteVoiceConnectorStreamingConfigurationRequest(input) - return out, req.Send() -} - -// DeleteVoiceConnectorStreamingConfigurationWithContext is the same as DeleteVoiceConnectorStreamingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceConnectorStreamingConfiguration 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 *ChimeSDKVoice) DeleteVoiceConnectorStreamingConfigurationWithContext(ctx aws.Context, input *DeleteVoiceConnectorStreamingConfigurationInput, opts ...request.Option) (*DeleteVoiceConnectorStreamingConfigurationOutput, error) { - req, out := c.DeleteVoiceConnectorStreamingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceConnectorTermination = "DeleteVoiceConnectorTermination" - -// DeleteVoiceConnectorTerminationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceConnectorTermination 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 DeleteVoiceConnectorTermination for more information on using the DeleteVoiceConnectorTermination -// 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 DeleteVoiceConnectorTerminationRequest method. -// req, resp := client.DeleteVoiceConnectorTerminationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorTermination -func (c *ChimeSDKVoice) DeleteVoiceConnectorTerminationRequest(input *DeleteVoiceConnectorTerminationInput) (req *request.Request, output *DeleteVoiceConnectorTerminationOutput) { - op := &request.Operation{ - Name: opDeleteVoiceConnectorTermination, - HTTPMethod: "DELETE", - HTTPPath: "/voice-connectors/{voiceConnectorId}/termination", - } - - if input == nil { - input = &DeleteVoiceConnectorTerminationInput{} - } - - output = &DeleteVoiceConnectorTerminationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceConnectorTermination API operation for Amazon Chime SDK Voice. -// -// Deletes the termination settings for the specified Amazon Chime SDK Voice -// Connector. -// -// If emergency calling is configured for the Voice Connector, it must be deleted -// prior to deleting the termination settings. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceConnectorTermination for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorTermination -func (c *ChimeSDKVoice) DeleteVoiceConnectorTermination(input *DeleteVoiceConnectorTerminationInput) (*DeleteVoiceConnectorTerminationOutput, error) { - req, out := c.DeleteVoiceConnectorTerminationRequest(input) - return out, req.Send() -} - -// DeleteVoiceConnectorTerminationWithContext is the same as DeleteVoiceConnectorTermination with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceConnectorTermination 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 *ChimeSDKVoice) DeleteVoiceConnectorTerminationWithContext(ctx aws.Context, input *DeleteVoiceConnectorTerminationInput, opts ...request.Option) (*DeleteVoiceConnectorTerminationOutput, error) { - req, out := c.DeleteVoiceConnectorTerminationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceConnectorTerminationCredentials = "DeleteVoiceConnectorTerminationCredentials" - -// DeleteVoiceConnectorTerminationCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceConnectorTerminationCredentials 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 DeleteVoiceConnectorTerminationCredentials for more information on using the DeleteVoiceConnectorTerminationCredentials -// 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 DeleteVoiceConnectorTerminationCredentialsRequest method. -// req, resp := client.DeleteVoiceConnectorTerminationCredentialsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorTerminationCredentials -func (c *ChimeSDKVoice) DeleteVoiceConnectorTerminationCredentialsRequest(input *DeleteVoiceConnectorTerminationCredentialsInput) (req *request.Request, output *DeleteVoiceConnectorTerminationCredentialsOutput) { - op := &request.Operation{ - Name: opDeleteVoiceConnectorTerminationCredentials, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{voiceConnectorId}/termination/credentials?operation=delete", - } - - if input == nil { - input = &DeleteVoiceConnectorTerminationCredentialsInput{} - } - - output = &DeleteVoiceConnectorTerminationCredentialsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceConnectorTerminationCredentials API operation for Amazon Chime SDK Voice. -// -// Deletes the specified SIP credentials used by your equipment to authenticate -// during call termination. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceConnectorTerminationCredentials for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceConnectorTerminationCredentials -func (c *ChimeSDKVoice) DeleteVoiceConnectorTerminationCredentials(input *DeleteVoiceConnectorTerminationCredentialsInput) (*DeleteVoiceConnectorTerminationCredentialsOutput, error) { - req, out := c.DeleteVoiceConnectorTerminationCredentialsRequest(input) - return out, req.Send() -} - -// DeleteVoiceConnectorTerminationCredentialsWithContext is the same as DeleteVoiceConnectorTerminationCredentials with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceConnectorTerminationCredentials 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 *ChimeSDKVoice) DeleteVoiceConnectorTerminationCredentialsWithContext(ctx aws.Context, input *DeleteVoiceConnectorTerminationCredentialsInput, opts ...request.Option) (*DeleteVoiceConnectorTerminationCredentialsOutput, error) { - req, out := c.DeleteVoiceConnectorTerminationCredentialsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceProfile = "DeleteVoiceProfile" - -// DeleteVoiceProfileRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceProfile 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 DeleteVoiceProfile for more information on using the DeleteVoiceProfile -// 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 DeleteVoiceProfileRequest method. -// req, resp := client.DeleteVoiceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceProfile -func (c *ChimeSDKVoice) DeleteVoiceProfileRequest(input *DeleteVoiceProfileInput) (req *request.Request, output *DeleteVoiceProfileOutput) { - op := &request.Operation{ - Name: opDeleteVoiceProfile, - HTTPMethod: "DELETE", - HTTPPath: "/voice-profiles/{VoiceProfileId}", - } - - if input == nil { - input = &DeleteVoiceProfileInput{} - } - - output = &DeleteVoiceProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceProfile API operation for Amazon Chime SDK Voice. -// -// Deletes a voice profile, including its voice print and enrollment data. WARNING: -// This action is not reversible. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceProfile for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceProfile -func (c *ChimeSDKVoice) DeleteVoiceProfile(input *DeleteVoiceProfileInput) (*DeleteVoiceProfileOutput, error) { - req, out := c.DeleteVoiceProfileRequest(input) - return out, req.Send() -} - -// DeleteVoiceProfileWithContext is the same as DeleteVoiceProfile with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceProfile 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 *ChimeSDKVoice) DeleteVoiceProfileWithContext(ctx aws.Context, input *DeleteVoiceProfileInput, opts ...request.Option) (*DeleteVoiceProfileOutput, error) { - req, out := c.DeleteVoiceProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVoiceProfileDomain = "DeleteVoiceProfileDomain" - -// DeleteVoiceProfileDomainRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceProfileDomain 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 DeleteVoiceProfileDomain for more information on using the DeleteVoiceProfileDomain -// 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 DeleteVoiceProfileDomainRequest method. -// req, resp := client.DeleteVoiceProfileDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceProfileDomain -func (c *ChimeSDKVoice) DeleteVoiceProfileDomainRequest(input *DeleteVoiceProfileDomainInput) (req *request.Request, output *DeleteVoiceProfileDomainOutput) { - op := &request.Operation{ - Name: opDeleteVoiceProfileDomain, - HTTPMethod: "DELETE", - HTTPPath: "/voice-profile-domains/{VoiceProfileDomainId}", - } - - if input == nil { - input = &DeleteVoiceProfileDomainInput{} - } - - output = &DeleteVoiceProfileDomainOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVoiceProfileDomain API operation for Amazon Chime SDK Voice. -// -// Deletes all voice profiles in the domain. WARNING: This action is not reversible. -// -// 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 Chime SDK Voice's -// API operation DeleteVoiceProfileDomain for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DeleteVoiceProfileDomain -func (c *ChimeSDKVoice) DeleteVoiceProfileDomain(input *DeleteVoiceProfileDomainInput) (*DeleteVoiceProfileDomainOutput, error) { - req, out := c.DeleteVoiceProfileDomainRequest(input) - return out, req.Send() -} - -// DeleteVoiceProfileDomainWithContext is the same as DeleteVoiceProfileDomain with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVoiceProfileDomain 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 *ChimeSDKVoice) DeleteVoiceProfileDomainWithContext(ctx aws.Context, input *DeleteVoiceProfileDomainInput, opts ...request.Option) (*DeleteVoiceProfileDomainOutput, error) { - req, out := c.DeleteVoiceProfileDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociatePhoneNumbersFromVoiceConnector = "DisassociatePhoneNumbersFromVoiceConnector" - -// DisassociatePhoneNumbersFromVoiceConnectorRequest generates a "aws/request.Request" representing the -// client's request for the DisassociatePhoneNumbersFromVoiceConnector 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 DisassociatePhoneNumbersFromVoiceConnector for more information on using the DisassociatePhoneNumbersFromVoiceConnector -// 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 DisassociatePhoneNumbersFromVoiceConnectorRequest method. -// req, resp := client.DisassociatePhoneNumbersFromVoiceConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DisassociatePhoneNumbersFromVoiceConnector -func (c *ChimeSDKVoice) DisassociatePhoneNumbersFromVoiceConnectorRequest(input *DisassociatePhoneNumbersFromVoiceConnectorInput) (req *request.Request, output *DisassociatePhoneNumbersFromVoiceConnectorOutput) { - op := &request.Operation{ - Name: opDisassociatePhoneNumbersFromVoiceConnector, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{voiceConnectorId}?operation=disassociate-phone-numbers", - } - - if input == nil { - input = &DisassociatePhoneNumbersFromVoiceConnectorInput{} - } - - output = &DisassociatePhoneNumbersFromVoiceConnectorOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociatePhoneNumbersFromVoiceConnector API operation for Amazon Chime SDK Voice. -// -// Disassociates the specified phone numbers from the specified Amazon Chime -// SDK Voice Connector. -// -// 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 Chime SDK Voice's -// API operation DisassociatePhoneNumbersFromVoiceConnector for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DisassociatePhoneNumbersFromVoiceConnector -func (c *ChimeSDKVoice) DisassociatePhoneNumbersFromVoiceConnector(input *DisassociatePhoneNumbersFromVoiceConnectorInput) (*DisassociatePhoneNumbersFromVoiceConnectorOutput, error) { - req, out := c.DisassociatePhoneNumbersFromVoiceConnectorRequest(input) - return out, req.Send() -} - -// DisassociatePhoneNumbersFromVoiceConnectorWithContext is the same as DisassociatePhoneNumbersFromVoiceConnector with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociatePhoneNumbersFromVoiceConnector 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 *ChimeSDKVoice) DisassociatePhoneNumbersFromVoiceConnectorWithContext(ctx aws.Context, input *DisassociatePhoneNumbersFromVoiceConnectorInput, opts ...request.Option) (*DisassociatePhoneNumbersFromVoiceConnectorOutput, error) { - req, out := c.DisassociatePhoneNumbersFromVoiceConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociatePhoneNumbersFromVoiceConnectorGroup = "DisassociatePhoneNumbersFromVoiceConnectorGroup" - -// DisassociatePhoneNumbersFromVoiceConnectorGroupRequest generates a "aws/request.Request" representing the -// client's request for the DisassociatePhoneNumbersFromVoiceConnectorGroup 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 DisassociatePhoneNumbersFromVoiceConnectorGroup for more information on using the DisassociatePhoneNumbersFromVoiceConnectorGroup -// 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 DisassociatePhoneNumbersFromVoiceConnectorGroupRequest method. -// req, resp := client.DisassociatePhoneNumbersFromVoiceConnectorGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DisassociatePhoneNumbersFromVoiceConnectorGroup -func (c *ChimeSDKVoice) DisassociatePhoneNumbersFromVoiceConnectorGroupRequest(input *DisassociatePhoneNumbersFromVoiceConnectorGroupInput) (req *request.Request, output *DisassociatePhoneNumbersFromVoiceConnectorGroupOutput) { - op := &request.Operation{ - Name: opDisassociatePhoneNumbersFromVoiceConnectorGroup, - HTTPMethod: "POST", - HTTPPath: "/voice-connector-groups/{voiceConnectorGroupId}?operation=disassociate-phone-numbers", - } - - if input == nil { - input = &DisassociatePhoneNumbersFromVoiceConnectorGroupInput{} - } - - output = &DisassociatePhoneNumbersFromVoiceConnectorGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociatePhoneNumbersFromVoiceConnectorGroup API operation for Amazon Chime SDK Voice. -// -// Disassociates the specified phone numbers from the specified Amazon Chime -// SDK Voice Connector group. -// -// 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 Chime SDK Voice's -// API operation DisassociatePhoneNumbersFromVoiceConnectorGroup for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/DisassociatePhoneNumbersFromVoiceConnectorGroup -func (c *ChimeSDKVoice) DisassociatePhoneNumbersFromVoiceConnectorGroup(input *DisassociatePhoneNumbersFromVoiceConnectorGroupInput) (*DisassociatePhoneNumbersFromVoiceConnectorGroupOutput, error) { - req, out := c.DisassociatePhoneNumbersFromVoiceConnectorGroupRequest(input) - return out, req.Send() -} - -// DisassociatePhoneNumbersFromVoiceConnectorGroupWithContext is the same as DisassociatePhoneNumbersFromVoiceConnectorGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociatePhoneNumbersFromVoiceConnectorGroup 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 *ChimeSDKVoice) DisassociatePhoneNumbersFromVoiceConnectorGroupWithContext(ctx aws.Context, input *DisassociatePhoneNumbersFromVoiceConnectorGroupInput, opts ...request.Option) (*DisassociatePhoneNumbersFromVoiceConnectorGroupOutput, error) { - req, out := c.DisassociatePhoneNumbersFromVoiceConnectorGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetGlobalSettings = "GetGlobalSettings" - -// GetGlobalSettingsRequest generates a "aws/request.Request" representing the -// client's request for the GetGlobalSettings 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 GetGlobalSettings for more information on using the GetGlobalSettings -// 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 GetGlobalSettingsRequest method. -// req, resp := client.GetGlobalSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetGlobalSettings -func (c *ChimeSDKVoice) GetGlobalSettingsRequest(input *GetGlobalSettingsInput) (req *request.Request, output *GetGlobalSettingsOutput) { - op := &request.Operation{ - Name: opGetGlobalSettings, - HTTPMethod: "GET", - HTTPPath: "/settings", - } - - if input == nil { - input = &GetGlobalSettingsInput{} - } - - output = &GetGlobalSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGlobalSettings API operation for Amazon Chime SDK Voice. -// -// Retrieves the global settings for the Amazon Chime SDK Voice Connectors in -// an AWS account. -// -// 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 Chime SDK Voice's -// API operation GetGlobalSettings for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetGlobalSettings -func (c *ChimeSDKVoice) GetGlobalSettings(input *GetGlobalSettingsInput) (*GetGlobalSettingsOutput, error) { - req, out := c.GetGlobalSettingsRequest(input) - return out, req.Send() -} - -// GetGlobalSettingsWithContext is the same as GetGlobalSettings with the addition of -// the ability to pass a context and additional request options. -// -// See GetGlobalSettings 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 *ChimeSDKVoice) GetGlobalSettingsWithContext(ctx aws.Context, input *GetGlobalSettingsInput, opts ...request.Option) (*GetGlobalSettingsOutput, error) { - req, out := c.GetGlobalSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPhoneNumber = "GetPhoneNumber" - -// GetPhoneNumberRequest generates a "aws/request.Request" representing the -// client's request for the GetPhoneNumber 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 GetPhoneNumber for more information on using the GetPhoneNumber -// 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 GetPhoneNumberRequest method. -// req, resp := client.GetPhoneNumberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetPhoneNumber -func (c *ChimeSDKVoice) GetPhoneNumberRequest(input *GetPhoneNumberInput) (req *request.Request, output *GetPhoneNumberOutput) { - op := &request.Operation{ - Name: opGetPhoneNumber, - HTTPMethod: "GET", - HTTPPath: "/phone-numbers/{phoneNumberId}", - } - - if input == nil { - input = &GetPhoneNumberInput{} - } - - output = &GetPhoneNumberOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPhoneNumber API operation for Amazon Chime SDK Voice. -// -// Retrieves details for the specified phone number ID, such as associations, -// capabilities, and product type. -// -// 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 Chime SDK Voice's -// API operation GetPhoneNumber for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetPhoneNumber -func (c *ChimeSDKVoice) GetPhoneNumber(input *GetPhoneNumberInput) (*GetPhoneNumberOutput, error) { - req, out := c.GetPhoneNumberRequest(input) - return out, req.Send() -} - -// GetPhoneNumberWithContext is the same as GetPhoneNumber with the addition of -// the ability to pass a context and additional request options. -// -// See GetPhoneNumber 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 *ChimeSDKVoice) GetPhoneNumberWithContext(ctx aws.Context, input *GetPhoneNumberInput, opts ...request.Option) (*GetPhoneNumberOutput, error) { - req, out := c.GetPhoneNumberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPhoneNumberOrder = "GetPhoneNumberOrder" - -// GetPhoneNumberOrderRequest generates a "aws/request.Request" representing the -// client's request for the GetPhoneNumberOrder 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 GetPhoneNumberOrder for more information on using the GetPhoneNumberOrder -// 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 GetPhoneNumberOrderRequest method. -// req, resp := client.GetPhoneNumberOrderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetPhoneNumberOrder -func (c *ChimeSDKVoice) GetPhoneNumberOrderRequest(input *GetPhoneNumberOrderInput) (req *request.Request, output *GetPhoneNumberOrderOutput) { - op := &request.Operation{ - Name: opGetPhoneNumberOrder, - HTTPMethod: "GET", - HTTPPath: "/phone-number-orders/{phoneNumberOrderId}", - } - - if input == nil { - input = &GetPhoneNumberOrderInput{} - } - - output = &GetPhoneNumberOrderOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPhoneNumberOrder API operation for Amazon Chime SDK Voice. -// -// Retrieves details for the specified phone number order, such as the order -// creation timestamp, phone numbers in E.164 format, product type, and order -// status. -// -// 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 Chime SDK Voice's -// API operation GetPhoneNumberOrder for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetPhoneNumberOrder -func (c *ChimeSDKVoice) GetPhoneNumberOrder(input *GetPhoneNumberOrderInput) (*GetPhoneNumberOrderOutput, error) { - req, out := c.GetPhoneNumberOrderRequest(input) - return out, req.Send() -} - -// GetPhoneNumberOrderWithContext is the same as GetPhoneNumberOrder with the addition of -// the ability to pass a context and additional request options. -// -// See GetPhoneNumberOrder 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 *ChimeSDKVoice) GetPhoneNumberOrderWithContext(ctx aws.Context, input *GetPhoneNumberOrderInput, opts ...request.Option) (*GetPhoneNumberOrderOutput, error) { - req, out := c.GetPhoneNumberOrderRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPhoneNumberSettings = "GetPhoneNumberSettings" - -// GetPhoneNumberSettingsRequest generates a "aws/request.Request" representing the -// client's request for the GetPhoneNumberSettings 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 GetPhoneNumberSettings for more information on using the GetPhoneNumberSettings -// 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 GetPhoneNumberSettingsRequest method. -// req, resp := client.GetPhoneNumberSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetPhoneNumberSettings -func (c *ChimeSDKVoice) GetPhoneNumberSettingsRequest(input *GetPhoneNumberSettingsInput) (req *request.Request, output *GetPhoneNumberSettingsOutput) { - op := &request.Operation{ - Name: opGetPhoneNumberSettings, - HTTPMethod: "GET", - HTTPPath: "/settings/phone-number", - } - - if input == nil { - input = &GetPhoneNumberSettingsInput{} - } - - output = &GetPhoneNumberSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPhoneNumberSettings API operation for Amazon Chime SDK Voice. -// -// Retrieves the phone number settings for the administrator's AWS account, -// such as the default outbound calling name. -// -// 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 Chime SDK Voice's -// API operation GetPhoneNumberSettings for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetPhoneNumberSettings -func (c *ChimeSDKVoice) GetPhoneNumberSettings(input *GetPhoneNumberSettingsInput) (*GetPhoneNumberSettingsOutput, error) { - req, out := c.GetPhoneNumberSettingsRequest(input) - return out, req.Send() -} - -// GetPhoneNumberSettingsWithContext is the same as GetPhoneNumberSettings with the addition of -// the ability to pass a context and additional request options. -// -// See GetPhoneNumberSettings 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 *ChimeSDKVoice) GetPhoneNumberSettingsWithContext(ctx aws.Context, input *GetPhoneNumberSettingsInput, opts ...request.Option) (*GetPhoneNumberSettingsOutput, error) { - req, out := c.GetPhoneNumberSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetProxySession = "GetProxySession" - -// GetProxySessionRequest generates a "aws/request.Request" representing the -// client's request for the GetProxySession 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 GetProxySession for more information on using the GetProxySession -// 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 GetProxySessionRequest method. -// req, resp := client.GetProxySessionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetProxySession -func (c *ChimeSDKVoice) GetProxySessionRequest(input *GetProxySessionInput) (req *request.Request, output *GetProxySessionOutput) { - op := &request.Operation{ - Name: opGetProxySession, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}", - } - - if input == nil { - input = &GetProxySessionInput{} - } - - output = &GetProxySessionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetProxySession API operation for Amazon Chime SDK Voice. -// -// Retrieves the specified proxy session details for the specified Amazon Chime -// SDK Voice Connector. -// -// 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 Chime SDK Voice's -// API operation GetProxySession for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetProxySession -func (c *ChimeSDKVoice) GetProxySession(input *GetProxySessionInput) (*GetProxySessionOutput, error) { - req, out := c.GetProxySessionRequest(input) - return out, req.Send() -} - -// GetProxySessionWithContext is the same as GetProxySession with the addition of -// the ability to pass a context and additional request options. -// -// See GetProxySession 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 *ChimeSDKVoice) GetProxySessionWithContext(ctx aws.Context, input *GetProxySessionInput, opts ...request.Option) (*GetProxySessionOutput, error) { - req, out := c.GetProxySessionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSipMediaApplication = "GetSipMediaApplication" - -// GetSipMediaApplicationRequest generates a "aws/request.Request" representing the -// client's request for the GetSipMediaApplication 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 GetSipMediaApplication for more information on using the GetSipMediaApplication -// 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 GetSipMediaApplicationRequest method. -// req, resp := client.GetSipMediaApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSipMediaApplication -func (c *ChimeSDKVoice) GetSipMediaApplicationRequest(input *GetSipMediaApplicationInput) (req *request.Request, output *GetSipMediaApplicationOutput) { - op := &request.Operation{ - Name: opGetSipMediaApplication, - HTTPMethod: "GET", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}", - } - - if input == nil { - input = &GetSipMediaApplicationInput{} - } - - output = &GetSipMediaApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSipMediaApplication API operation for Amazon Chime SDK Voice. -// -// Retrieves the information for a SIP media application, including name, AWS -// Region, and endpoints. -// -// 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 Chime SDK Voice's -// API operation GetSipMediaApplication for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSipMediaApplication -func (c *ChimeSDKVoice) GetSipMediaApplication(input *GetSipMediaApplicationInput) (*GetSipMediaApplicationOutput, error) { - req, out := c.GetSipMediaApplicationRequest(input) - return out, req.Send() -} - -// GetSipMediaApplicationWithContext is the same as GetSipMediaApplication with the addition of -// the ability to pass a context and additional request options. -// -// See GetSipMediaApplication 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 *ChimeSDKVoice) GetSipMediaApplicationWithContext(ctx aws.Context, input *GetSipMediaApplicationInput, opts ...request.Option) (*GetSipMediaApplicationOutput, error) { - req, out := c.GetSipMediaApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSipMediaApplicationAlexaSkillConfiguration = "GetSipMediaApplicationAlexaSkillConfiguration" - -// GetSipMediaApplicationAlexaSkillConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetSipMediaApplicationAlexaSkillConfiguration 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 GetSipMediaApplicationAlexaSkillConfiguration for more information on using the GetSipMediaApplicationAlexaSkillConfiguration -// 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 GetSipMediaApplicationAlexaSkillConfigurationRequest method. -// req, resp := client.GetSipMediaApplicationAlexaSkillConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSipMediaApplicationAlexaSkillConfiguration -func (c *ChimeSDKVoice) GetSipMediaApplicationAlexaSkillConfigurationRequest(input *GetSipMediaApplicationAlexaSkillConfigurationInput) (req *request.Request, output *GetSipMediaApplicationAlexaSkillConfigurationOutput) { - op := &request.Operation{ - Name: opGetSipMediaApplicationAlexaSkillConfiguration, - HTTPMethod: "GET", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}/alexa-skill-configuration", - } - - if input == nil { - input = &GetSipMediaApplicationAlexaSkillConfigurationInput{} - } - - output = &GetSipMediaApplicationAlexaSkillConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSipMediaApplicationAlexaSkillConfiguration API operation for Amazon Chime SDK Voice. -// -// Gets the Alexa Skill configuration for the SIP media application. -// -// 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 Chime SDK Voice's -// API operation GetSipMediaApplicationAlexaSkillConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSipMediaApplicationAlexaSkillConfiguration -func (c *ChimeSDKVoice) GetSipMediaApplicationAlexaSkillConfiguration(input *GetSipMediaApplicationAlexaSkillConfigurationInput) (*GetSipMediaApplicationAlexaSkillConfigurationOutput, error) { - req, out := c.GetSipMediaApplicationAlexaSkillConfigurationRequest(input) - return out, req.Send() -} - -// GetSipMediaApplicationAlexaSkillConfigurationWithContext is the same as GetSipMediaApplicationAlexaSkillConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetSipMediaApplicationAlexaSkillConfiguration 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 *ChimeSDKVoice) GetSipMediaApplicationAlexaSkillConfigurationWithContext(ctx aws.Context, input *GetSipMediaApplicationAlexaSkillConfigurationInput, opts ...request.Option) (*GetSipMediaApplicationAlexaSkillConfigurationOutput, error) { - req, out := c.GetSipMediaApplicationAlexaSkillConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSipMediaApplicationLoggingConfiguration = "GetSipMediaApplicationLoggingConfiguration" - -// GetSipMediaApplicationLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetSipMediaApplicationLoggingConfiguration 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 GetSipMediaApplicationLoggingConfiguration for more information on using the GetSipMediaApplicationLoggingConfiguration -// 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 GetSipMediaApplicationLoggingConfigurationRequest method. -// req, resp := client.GetSipMediaApplicationLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSipMediaApplicationLoggingConfiguration -func (c *ChimeSDKVoice) GetSipMediaApplicationLoggingConfigurationRequest(input *GetSipMediaApplicationLoggingConfigurationInput) (req *request.Request, output *GetSipMediaApplicationLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opGetSipMediaApplicationLoggingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}/logging-configuration", - } - - if input == nil { - input = &GetSipMediaApplicationLoggingConfigurationInput{} - } - - output = &GetSipMediaApplicationLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSipMediaApplicationLoggingConfiguration API operation for Amazon Chime SDK Voice. -// -// Retrieves the logging configuration for the specified SIP media application. -// -// 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 Chime SDK Voice's -// API operation GetSipMediaApplicationLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSipMediaApplicationLoggingConfiguration -func (c *ChimeSDKVoice) GetSipMediaApplicationLoggingConfiguration(input *GetSipMediaApplicationLoggingConfigurationInput) (*GetSipMediaApplicationLoggingConfigurationOutput, error) { - req, out := c.GetSipMediaApplicationLoggingConfigurationRequest(input) - return out, req.Send() -} - -// GetSipMediaApplicationLoggingConfigurationWithContext is the same as GetSipMediaApplicationLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetSipMediaApplicationLoggingConfiguration 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 *ChimeSDKVoice) GetSipMediaApplicationLoggingConfigurationWithContext(ctx aws.Context, input *GetSipMediaApplicationLoggingConfigurationInput, opts ...request.Option) (*GetSipMediaApplicationLoggingConfigurationOutput, error) { - req, out := c.GetSipMediaApplicationLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSipRule = "GetSipRule" - -// GetSipRuleRequest generates a "aws/request.Request" representing the -// client's request for the GetSipRule 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 GetSipRule for more information on using the GetSipRule -// 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 GetSipRuleRequest method. -// req, resp := client.GetSipRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSipRule -func (c *ChimeSDKVoice) GetSipRuleRequest(input *GetSipRuleInput) (req *request.Request, output *GetSipRuleOutput) { - op := &request.Operation{ - Name: opGetSipRule, - HTTPMethod: "GET", - HTTPPath: "/sip-rules/{sipRuleId}", - } - - if input == nil { - input = &GetSipRuleInput{} - } - - output = &GetSipRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSipRule API operation for Amazon Chime SDK Voice. -// -// Retrieves the details of a SIP rule, such as the rule ID, name, triggers, -// and target endpoints. -// -// 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 Chime SDK Voice's -// API operation GetSipRule for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSipRule -func (c *ChimeSDKVoice) GetSipRule(input *GetSipRuleInput) (*GetSipRuleOutput, error) { - req, out := c.GetSipRuleRequest(input) - return out, req.Send() -} - -// GetSipRuleWithContext is the same as GetSipRule with the addition of -// the ability to pass a context and additional request options. -// -// See GetSipRule 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 *ChimeSDKVoice) GetSipRuleWithContext(ctx aws.Context, input *GetSipRuleInput, opts ...request.Option) (*GetSipRuleOutput, error) { - req, out := c.GetSipRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSpeakerSearchTask = "GetSpeakerSearchTask" - -// GetSpeakerSearchTaskRequest generates a "aws/request.Request" representing the -// client's request for the GetSpeakerSearchTask 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 GetSpeakerSearchTask for more information on using the GetSpeakerSearchTask -// 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 GetSpeakerSearchTaskRequest method. -// req, resp := client.GetSpeakerSearchTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSpeakerSearchTask -func (c *ChimeSDKVoice) GetSpeakerSearchTaskRequest(input *GetSpeakerSearchTaskInput) (req *request.Request, output *GetSpeakerSearchTaskOutput) { - op := &request.Operation{ - Name: opGetSpeakerSearchTask, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{VoiceConnectorId}/speaker-search-tasks/{SpeakerSearchTaskId}", - } - - if input == nil { - input = &GetSpeakerSearchTaskInput{} - } - - output = &GetSpeakerSearchTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSpeakerSearchTask API operation for Amazon Chime SDK Voice. -// -// Retrieves the details of the specified speaker search task. -// -// 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 Chime SDK Voice's -// API operation GetSpeakerSearchTask for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetSpeakerSearchTask -func (c *ChimeSDKVoice) GetSpeakerSearchTask(input *GetSpeakerSearchTaskInput) (*GetSpeakerSearchTaskOutput, error) { - req, out := c.GetSpeakerSearchTaskRequest(input) - return out, req.Send() -} - -// GetSpeakerSearchTaskWithContext is the same as GetSpeakerSearchTask with the addition of -// the ability to pass a context and additional request options. -// -// See GetSpeakerSearchTask 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 *ChimeSDKVoice) GetSpeakerSearchTaskWithContext(ctx aws.Context, input *GetSpeakerSearchTaskInput, opts ...request.Option) (*GetSpeakerSearchTaskOutput, error) { - req, out := c.GetSpeakerSearchTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnector = "GetVoiceConnector" - -// GetVoiceConnectorRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnector 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 GetVoiceConnector for more information on using the GetVoiceConnector -// 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 GetVoiceConnectorRequest method. -// req, resp := client.GetVoiceConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnector -func (c *ChimeSDKVoice) GetVoiceConnectorRequest(input *GetVoiceConnectorInput) (req *request.Request, output *GetVoiceConnectorOutput) { - op := &request.Operation{ - Name: opGetVoiceConnector, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}", - } - - if input == nil { - input = &GetVoiceConnectorInput{} - } - - output = &GetVoiceConnectorOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnector API operation for Amazon Chime SDK Voice. -// -// Retrieves details for the specified Amazon Chime SDK Voice Connector, such -// as timestamps,name, outbound host, and encryption requirements. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnector for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnector -func (c *ChimeSDKVoice) GetVoiceConnector(input *GetVoiceConnectorInput) (*GetVoiceConnectorOutput, error) { - req, out := c.GetVoiceConnectorRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorWithContext is the same as GetVoiceConnector with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnector 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 *ChimeSDKVoice) GetVoiceConnectorWithContext(ctx aws.Context, input *GetVoiceConnectorInput, opts ...request.Option) (*GetVoiceConnectorOutput, error) { - req, out := c.GetVoiceConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnectorEmergencyCallingConfiguration = "GetVoiceConnectorEmergencyCallingConfiguration" - -// GetVoiceConnectorEmergencyCallingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnectorEmergencyCallingConfiguration 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 GetVoiceConnectorEmergencyCallingConfiguration for more information on using the GetVoiceConnectorEmergencyCallingConfiguration -// 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 GetVoiceConnectorEmergencyCallingConfigurationRequest method. -// req, resp := client.GetVoiceConnectorEmergencyCallingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorEmergencyCallingConfiguration -func (c *ChimeSDKVoice) GetVoiceConnectorEmergencyCallingConfigurationRequest(input *GetVoiceConnectorEmergencyCallingConfigurationInput) (req *request.Request, output *GetVoiceConnectorEmergencyCallingConfigurationOutput) { - op := &request.Operation{ - Name: opGetVoiceConnectorEmergencyCallingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/emergency-calling-configuration", - } - - if input == nil { - input = &GetVoiceConnectorEmergencyCallingConfigurationInput{} - } - - output = &GetVoiceConnectorEmergencyCallingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnectorEmergencyCallingConfiguration API operation for Amazon Chime SDK Voice. -// -// Retrieves the emergency calling configuration details for the specified Voice -// Connector. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnectorEmergencyCallingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorEmergencyCallingConfiguration -func (c *ChimeSDKVoice) GetVoiceConnectorEmergencyCallingConfiguration(input *GetVoiceConnectorEmergencyCallingConfigurationInput) (*GetVoiceConnectorEmergencyCallingConfigurationOutput, error) { - req, out := c.GetVoiceConnectorEmergencyCallingConfigurationRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorEmergencyCallingConfigurationWithContext is the same as GetVoiceConnectorEmergencyCallingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnectorEmergencyCallingConfiguration 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 *ChimeSDKVoice) GetVoiceConnectorEmergencyCallingConfigurationWithContext(ctx aws.Context, input *GetVoiceConnectorEmergencyCallingConfigurationInput, opts ...request.Option) (*GetVoiceConnectorEmergencyCallingConfigurationOutput, error) { - req, out := c.GetVoiceConnectorEmergencyCallingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnectorGroup = "GetVoiceConnectorGroup" - -// GetVoiceConnectorGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnectorGroup 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 GetVoiceConnectorGroup for more information on using the GetVoiceConnectorGroup -// 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 GetVoiceConnectorGroupRequest method. -// req, resp := client.GetVoiceConnectorGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorGroup -func (c *ChimeSDKVoice) GetVoiceConnectorGroupRequest(input *GetVoiceConnectorGroupInput) (req *request.Request, output *GetVoiceConnectorGroupOutput) { - op := &request.Operation{ - Name: opGetVoiceConnectorGroup, - HTTPMethod: "GET", - HTTPPath: "/voice-connector-groups/{voiceConnectorGroupId}", - } - - if input == nil { - input = &GetVoiceConnectorGroupInput{} - } - - output = &GetVoiceConnectorGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnectorGroup API operation for Amazon Chime SDK Voice. -// -// Retrieves details for the specified Amazon Chime SDK Voice Connector group, -// such as timestamps,name, and associated VoiceConnectorItems. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnectorGroup for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorGroup -func (c *ChimeSDKVoice) GetVoiceConnectorGroup(input *GetVoiceConnectorGroupInput) (*GetVoiceConnectorGroupOutput, error) { - req, out := c.GetVoiceConnectorGroupRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorGroupWithContext is the same as GetVoiceConnectorGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnectorGroup 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 *ChimeSDKVoice) GetVoiceConnectorGroupWithContext(ctx aws.Context, input *GetVoiceConnectorGroupInput, opts ...request.Option) (*GetVoiceConnectorGroupOutput, error) { - req, out := c.GetVoiceConnectorGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnectorLoggingConfiguration = "GetVoiceConnectorLoggingConfiguration" - -// GetVoiceConnectorLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnectorLoggingConfiguration 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 GetVoiceConnectorLoggingConfiguration for more information on using the GetVoiceConnectorLoggingConfiguration -// 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 GetVoiceConnectorLoggingConfigurationRequest method. -// req, resp := client.GetVoiceConnectorLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorLoggingConfiguration -func (c *ChimeSDKVoice) GetVoiceConnectorLoggingConfigurationRequest(input *GetVoiceConnectorLoggingConfigurationInput) (req *request.Request, output *GetVoiceConnectorLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opGetVoiceConnectorLoggingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/logging-configuration", - } - - if input == nil { - input = &GetVoiceConnectorLoggingConfigurationInput{} - } - - output = &GetVoiceConnectorLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnectorLoggingConfiguration API operation for Amazon Chime SDK Voice. -// -// Retrieves the logging configuration settings for the specified Voice Connector. -// Shows whether SIP message logs are enabled for sending to Amazon CloudWatch -// Logs. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnectorLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorLoggingConfiguration -func (c *ChimeSDKVoice) GetVoiceConnectorLoggingConfiguration(input *GetVoiceConnectorLoggingConfigurationInput) (*GetVoiceConnectorLoggingConfigurationOutput, error) { - req, out := c.GetVoiceConnectorLoggingConfigurationRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorLoggingConfigurationWithContext is the same as GetVoiceConnectorLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnectorLoggingConfiguration 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 *ChimeSDKVoice) GetVoiceConnectorLoggingConfigurationWithContext(ctx aws.Context, input *GetVoiceConnectorLoggingConfigurationInput, opts ...request.Option) (*GetVoiceConnectorLoggingConfigurationOutput, error) { - req, out := c.GetVoiceConnectorLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnectorOrigination = "GetVoiceConnectorOrigination" - -// GetVoiceConnectorOriginationRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnectorOrigination 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 GetVoiceConnectorOrigination for more information on using the GetVoiceConnectorOrigination -// 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 GetVoiceConnectorOriginationRequest method. -// req, resp := client.GetVoiceConnectorOriginationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorOrigination -func (c *ChimeSDKVoice) GetVoiceConnectorOriginationRequest(input *GetVoiceConnectorOriginationInput) (req *request.Request, output *GetVoiceConnectorOriginationOutput) { - op := &request.Operation{ - Name: opGetVoiceConnectorOrigination, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/origination", - } - - if input == nil { - input = &GetVoiceConnectorOriginationInput{} - } - - output = &GetVoiceConnectorOriginationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnectorOrigination API operation for Amazon Chime SDK Voice. -// -// Retrieves the origination settings for the specified Voice Connector. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnectorOrigination for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorOrigination -func (c *ChimeSDKVoice) GetVoiceConnectorOrigination(input *GetVoiceConnectorOriginationInput) (*GetVoiceConnectorOriginationOutput, error) { - req, out := c.GetVoiceConnectorOriginationRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorOriginationWithContext is the same as GetVoiceConnectorOrigination with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnectorOrigination 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 *ChimeSDKVoice) GetVoiceConnectorOriginationWithContext(ctx aws.Context, input *GetVoiceConnectorOriginationInput, opts ...request.Option) (*GetVoiceConnectorOriginationOutput, error) { - req, out := c.GetVoiceConnectorOriginationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnectorProxy = "GetVoiceConnectorProxy" - -// GetVoiceConnectorProxyRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnectorProxy 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 GetVoiceConnectorProxy for more information on using the GetVoiceConnectorProxy -// 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 GetVoiceConnectorProxyRequest method. -// req, resp := client.GetVoiceConnectorProxyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorProxy -func (c *ChimeSDKVoice) GetVoiceConnectorProxyRequest(input *GetVoiceConnectorProxyInput) (req *request.Request, output *GetVoiceConnectorProxyOutput) { - op := &request.Operation{ - Name: opGetVoiceConnectorProxy, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy", - } - - if input == nil { - input = &GetVoiceConnectorProxyInput{} - } - - output = &GetVoiceConnectorProxyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnectorProxy API operation for Amazon Chime SDK Voice. -// -// Retrieves the proxy configuration details for the specified Amazon Chime -// SDK Voice Connector. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnectorProxy for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorProxy -func (c *ChimeSDKVoice) GetVoiceConnectorProxy(input *GetVoiceConnectorProxyInput) (*GetVoiceConnectorProxyOutput, error) { - req, out := c.GetVoiceConnectorProxyRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorProxyWithContext is the same as GetVoiceConnectorProxy with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnectorProxy 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 *ChimeSDKVoice) GetVoiceConnectorProxyWithContext(ctx aws.Context, input *GetVoiceConnectorProxyInput, opts ...request.Option) (*GetVoiceConnectorProxyOutput, error) { - req, out := c.GetVoiceConnectorProxyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnectorStreamingConfiguration = "GetVoiceConnectorStreamingConfiguration" - -// GetVoiceConnectorStreamingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnectorStreamingConfiguration 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 GetVoiceConnectorStreamingConfiguration for more information on using the GetVoiceConnectorStreamingConfiguration -// 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 GetVoiceConnectorStreamingConfigurationRequest method. -// req, resp := client.GetVoiceConnectorStreamingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorStreamingConfiguration -func (c *ChimeSDKVoice) GetVoiceConnectorStreamingConfigurationRequest(input *GetVoiceConnectorStreamingConfigurationInput) (req *request.Request, output *GetVoiceConnectorStreamingConfigurationOutput) { - op := &request.Operation{ - Name: opGetVoiceConnectorStreamingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/streaming-configuration", - } - - if input == nil { - input = &GetVoiceConnectorStreamingConfigurationInput{} - } - - output = &GetVoiceConnectorStreamingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnectorStreamingConfiguration API operation for Amazon Chime SDK Voice. -// -// Retrieves the streaming configuration details for the specified Amazon Chime -// SDK Voice Connector. Shows whether media streaming is enabled for sending -// to Amazon Kinesis. It also shows the retention period, in hours, for the -// Amazon Kinesis data. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnectorStreamingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorStreamingConfiguration -func (c *ChimeSDKVoice) GetVoiceConnectorStreamingConfiguration(input *GetVoiceConnectorStreamingConfigurationInput) (*GetVoiceConnectorStreamingConfigurationOutput, error) { - req, out := c.GetVoiceConnectorStreamingConfigurationRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorStreamingConfigurationWithContext is the same as GetVoiceConnectorStreamingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnectorStreamingConfiguration 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 *ChimeSDKVoice) GetVoiceConnectorStreamingConfigurationWithContext(ctx aws.Context, input *GetVoiceConnectorStreamingConfigurationInput, opts ...request.Option) (*GetVoiceConnectorStreamingConfigurationOutput, error) { - req, out := c.GetVoiceConnectorStreamingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnectorTermination = "GetVoiceConnectorTermination" - -// GetVoiceConnectorTerminationRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnectorTermination 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 GetVoiceConnectorTermination for more information on using the GetVoiceConnectorTermination -// 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 GetVoiceConnectorTerminationRequest method. -// req, resp := client.GetVoiceConnectorTerminationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorTermination -func (c *ChimeSDKVoice) GetVoiceConnectorTerminationRequest(input *GetVoiceConnectorTerminationInput) (req *request.Request, output *GetVoiceConnectorTerminationOutput) { - op := &request.Operation{ - Name: opGetVoiceConnectorTermination, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/termination", - } - - if input == nil { - input = &GetVoiceConnectorTerminationInput{} - } - - output = &GetVoiceConnectorTerminationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnectorTermination API operation for Amazon Chime SDK Voice. -// -// Retrieves the termination setting details for the specified Voice Connector. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnectorTermination for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorTermination -func (c *ChimeSDKVoice) GetVoiceConnectorTermination(input *GetVoiceConnectorTerminationInput) (*GetVoiceConnectorTerminationOutput, error) { - req, out := c.GetVoiceConnectorTerminationRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorTerminationWithContext is the same as GetVoiceConnectorTermination with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnectorTermination 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 *ChimeSDKVoice) GetVoiceConnectorTerminationWithContext(ctx aws.Context, input *GetVoiceConnectorTerminationInput, opts ...request.Option) (*GetVoiceConnectorTerminationOutput, error) { - req, out := c.GetVoiceConnectorTerminationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceConnectorTerminationHealth = "GetVoiceConnectorTerminationHealth" - -// GetVoiceConnectorTerminationHealthRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceConnectorTerminationHealth 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 GetVoiceConnectorTerminationHealth for more information on using the GetVoiceConnectorTerminationHealth -// 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 GetVoiceConnectorTerminationHealthRequest method. -// req, resp := client.GetVoiceConnectorTerminationHealthRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorTerminationHealth -func (c *ChimeSDKVoice) GetVoiceConnectorTerminationHealthRequest(input *GetVoiceConnectorTerminationHealthInput) (req *request.Request, output *GetVoiceConnectorTerminationHealthOutput) { - op := &request.Operation{ - Name: opGetVoiceConnectorTerminationHealth, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/termination/health", - } - - if input == nil { - input = &GetVoiceConnectorTerminationHealthInput{} - } - - output = &GetVoiceConnectorTerminationHealthOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceConnectorTerminationHealth API operation for Amazon Chime SDK Voice. -// -// Retrieves information about the last time a SIP OPTIONS ping was received -// from your SIP infrastructure for the specified Amazon Chime SDK Voice Connector. -// -// 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 Chime SDK Voice's -// API operation GetVoiceConnectorTerminationHealth for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceConnectorTerminationHealth -func (c *ChimeSDKVoice) GetVoiceConnectorTerminationHealth(input *GetVoiceConnectorTerminationHealthInput) (*GetVoiceConnectorTerminationHealthOutput, error) { - req, out := c.GetVoiceConnectorTerminationHealthRequest(input) - return out, req.Send() -} - -// GetVoiceConnectorTerminationHealthWithContext is the same as GetVoiceConnectorTerminationHealth with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceConnectorTerminationHealth 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 *ChimeSDKVoice) GetVoiceConnectorTerminationHealthWithContext(ctx aws.Context, input *GetVoiceConnectorTerminationHealthInput, opts ...request.Option) (*GetVoiceConnectorTerminationHealthOutput, error) { - req, out := c.GetVoiceConnectorTerminationHealthRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceProfile = "GetVoiceProfile" - -// GetVoiceProfileRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceProfile 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 GetVoiceProfile for more information on using the GetVoiceProfile -// 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 GetVoiceProfileRequest method. -// req, resp := client.GetVoiceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceProfile -func (c *ChimeSDKVoice) GetVoiceProfileRequest(input *GetVoiceProfileInput) (req *request.Request, output *GetVoiceProfileOutput) { - op := &request.Operation{ - Name: opGetVoiceProfile, - HTTPMethod: "GET", - HTTPPath: "/voice-profiles/{VoiceProfileId}", - } - - if input == nil { - input = &GetVoiceProfileInput{} - } - - output = &GetVoiceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceProfile API operation for Amazon Chime SDK Voice. -// -// Retrieves the details of the specified voice profile. -// -// 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 Chime SDK Voice's -// API operation GetVoiceProfile for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceProfile -func (c *ChimeSDKVoice) GetVoiceProfile(input *GetVoiceProfileInput) (*GetVoiceProfileOutput, error) { - req, out := c.GetVoiceProfileRequest(input) - return out, req.Send() -} - -// GetVoiceProfileWithContext is the same as GetVoiceProfile with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceProfile 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 *ChimeSDKVoice) GetVoiceProfileWithContext(ctx aws.Context, input *GetVoiceProfileInput, opts ...request.Option) (*GetVoiceProfileOutput, error) { - req, out := c.GetVoiceProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceProfileDomain = "GetVoiceProfileDomain" - -// GetVoiceProfileDomainRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceProfileDomain 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 GetVoiceProfileDomain for more information on using the GetVoiceProfileDomain -// 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 GetVoiceProfileDomainRequest method. -// req, resp := client.GetVoiceProfileDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceProfileDomain -func (c *ChimeSDKVoice) GetVoiceProfileDomainRequest(input *GetVoiceProfileDomainInput) (req *request.Request, output *GetVoiceProfileDomainOutput) { - op := &request.Operation{ - Name: opGetVoiceProfileDomain, - HTTPMethod: "GET", - HTTPPath: "/voice-profile-domains/{VoiceProfileDomainId}", - } - - if input == nil { - input = &GetVoiceProfileDomainInput{} - } - - output = &GetVoiceProfileDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceProfileDomain API operation for Amazon Chime SDK Voice. -// -// Retrieves the details of the specified voice profile domain. -// -// 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 Chime SDK Voice's -// API operation GetVoiceProfileDomain for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceProfileDomain -func (c *ChimeSDKVoice) GetVoiceProfileDomain(input *GetVoiceProfileDomainInput) (*GetVoiceProfileDomainOutput, error) { - req, out := c.GetVoiceProfileDomainRequest(input) - return out, req.Send() -} - -// GetVoiceProfileDomainWithContext is the same as GetVoiceProfileDomain with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceProfileDomain 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 *ChimeSDKVoice) GetVoiceProfileDomainWithContext(ctx aws.Context, input *GetVoiceProfileDomainInput, opts ...request.Option) (*GetVoiceProfileDomainOutput, error) { - req, out := c.GetVoiceProfileDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVoiceToneAnalysisTask = "GetVoiceToneAnalysisTask" - -// GetVoiceToneAnalysisTaskRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceToneAnalysisTask 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 GetVoiceToneAnalysisTask for more information on using the GetVoiceToneAnalysisTask -// 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 GetVoiceToneAnalysisTaskRequest method. -// req, resp := client.GetVoiceToneAnalysisTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceToneAnalysisTask -func (c *ChimeSDKVoice) GetVoiceToneAnalysisTaskRequest(input *GetVoiceToneAnalysisTaskInput) (req *request.Request, output *GetVoiceToneAnalysisTaskOutput) { - op := &request.Operation{ - Name: opGetVoiceToneAnalysisTask, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks/{VoiceToneAnalysisTaskId}", - } - - if input == nil { - input = &GetVoiceToneAnalysisTaskInput{} - } - - output = &GetVoiceToneAnalysisTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVoiceToneAnalysisTask API operation for Amazon Chime SDK Voice. -// -// Retrieves the details of a voice tone analysis task. -// -// 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 Chime SDK Voice's -// API operation GetVoiceToneAnalysisTask for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/GetVoiceToneAnalysisTask -func (c *ChimeSDKVoice) GetVoiceToneAnalysisTask(input *GetVoiceToneAnalysisTaskInput) (*GetVoiceToneAnalysisTaskOutput, error) { - req, out := c.GetVoiceToneAnalysisTaskRequest(input) - return out, req.Send() -} - -// GetVoiceToneAnalysisTaskWithContext is the same as GetVoiceToneAnalysisTask with the addition of -// the ability to pass a context and additional request options. -// -// See GetVoiceToneAnalysisTask 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 *ChimeSDKVoice) GetVoiceToneAnalysisTaskWithContext(ctx aws.Context, input *GetVoiceToneAnalysisTaskInput, opts ...request.Option) (*GetVoiceToneAnalysisTaskOutput, error) { - req, out := c.GetVoiceToneAnalysisTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAvailableVoiceConnectorRegions = "ListAvailableVoiceConnectorRegions" - -// ListAvailableVoiceConnectorRegionsRequest generates a "aws/request.Request" representing the -// client's request for the ListAvailableVoiceConnectorRegions 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 ListAvailableVoiceConnectorRegions for more information on using the ListAvailableVoiceConnectorRegions -// 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 ListAvailableVoiceConnectorRegionsRequest method. -// req, resp := client.ListAvailableVoiceConnectorRegionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListAvailableVoiceConnectorRegions -func (c *ChimeSDKVoice) ListAvailableVoiceConnectorRegionsRequest(input *ListAvailableVoiceConnectorRegionsInput) (req *request.Request, output *ListAvailableVoiceConnectorRegionsOutput) { - op := &request.Operation{ - Name: opListAvailableVoiceConnectorRegions, - HTTPMethod: "GET", - HTTPPath: "/voice-connector-regions", - } - - if input == nil { - input = &ListAvailableVoiceConnectorRegionsInput{} - } - - output = &ListAvailableVoiceConnectorRegionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAvailableVoiceConnectorRegions API operation for Amazon Chime SDK Voice. -// -// Lists the available AWS Regions in which you can create an Amazon Chime SDK -// Voice Connector. -// -// 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 Chime SDK Voice's -// API operation ListAvailableVoiceConnectorRegions for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListAvailableVoiceConnectorRegions -func (c *ChimeSDKVoice) ListAvailableVoiceConnectorRegions(input *ListAvailableVoiceConnectorRegionsInput) (*ListAvailableVoiceConnectorRegionsOutput, error) { - req, out := c.ListAvailableVoiceConnectorRegionsRequest(input) - return out, req.Send() -} - -// ListAvailableVoiceConnectorRegionsWithContext is the same as ListAvailableVoiceConnectorRegions with the addition of -// the ability to pass a context and additional request options. -// -// See ListAvailableVoiceConnectorRegions 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 *ChimeSDKVoice) ListAvailableVoiceConnectorRegionsWithContext(ctx aws.Context, input *ListAvailableVoiceConnectorRegionsInput, opts ...request.Option) (*ListAvailableVoiceConnectorRegionsOutput, error) { - req, out := c.ListAvailableVoiceConnectorRegionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListPhoneNumberOrders = "ListPhoneNumberOrders" - -// ListPhoneNumberOrdersRequest generates a "aws/request.Request" representing the -// client's request for the ListPhoneNumberOrders 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 ListPhoneNumberOrders for more information on using the ListPhoneNumberOrders -// 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 ListPhoneNumberOrdersRequest method. -// req, resp := client.ListPhoneNumberOrdersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListPhoneNumberOrders -func (c *ChimeSDKVoice) ListPhoneNumberOrdersRequest(input *ListPhoneNumberOrdersInput) (req *request.Request, output *ListPhoneNumberOrdersOutput) { - op := &request.Operation{ - Name: opListPhoneNumberOrders, - HTTPMethod: "GET", - HTTPPath: "/phone-number-orders", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPhoneNumberOrdersInput{} - } - - output = &ListPhoneNumberOrdersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPhoneNumberOrders API operation for Amazon Chime SDK Voice. -// -// Lists the phone numbers for an administrator's Amazon Chime SDK account. -// -// 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 Chime SDK Voice's -// API operation ListPhoneNumberOrders for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListPhoneNumberOrders -func (c *ChimeSDKVoice) ListPhoneNumberOrders(input *ListPhoneNumberOrdersInput) (*ListPhoneNumberOrdersOutput, error) { - req, out := c.ListPhoneNumberOrdersRequest(input) - return out, req.Send() -} - -// ListPhoneNumberOrdersWithContext is the same as ListPhoneNumberOrders with the addition of -// the ability to pass a context and additional request options. -// -// See ListPhoneNumberOrders 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 *ChimeSDKVoice) ListPhoneNumberOrdersWithContext(ctx aws.Context, input *ListPhoneNumberOrdersInput, opts ...request.Option) (*ListPhoneNumberOrdersOutput, error) { - req, out := c.ListPhoneNumberOrdersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPhoneNumberOrdersPages iterates over the pages of a ListPhoneNumberOrders operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPhoneNumberOrders method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPhoneNumberOrders operation. -// pageNum := 0 -// err := client.ListPhoneNumberOrdersPages(params, -// func(page *chimesdkvoice.ListPhoneNumberOrdersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListPhoneNumberOrdersPages(input *ListPhoneNumberOrdersInput, fn func(*ListPhoneNumberOrdersOutput, bool) bool) error { - return c.ListPhoneNumberOrdersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPhoneNumberOrdersPagesWithContext same as ListPhoneNumberOrdersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListPhoneNumberOrdersPagesWithContext(ctx aws.Context, input *ListPhoneNumberOrdersInput, fn func(*ListPhoneNumberOrdersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPhoneNumberOrdersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPhoneNumberOrdersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPhoneNumberOrdersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPhoneNumbers = "ListPhoneNumbers" - -// ListPhoneNumbersRequest generates a "aws/request.Request" representing the -// client's request for the ListPhoneNumbers 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 ListPhoneNumbers for more information on using the ListPhoneNumbers -// 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 ListPhoneNumbersRequest method. -// req, resp := client.ListPhoneNumbersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListPhoneNumbers -func (c *ChimeSDKVoice) ListPhoneNumbersRequest(input *ListPhoneNumbersInput) (req *request.Request, output *ListPhoneNumbersOutput) { - op := &request.Operation{ - Name: opListPhoneNumbers, - HTTPMethod: "GET", - HTTPPath: "/phone-numbers", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPhoneNumbersInput{} - } - - output = &ListPhoneNumbersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPhoneNumbers API operation for Amazon Chime SDK Voice. -// -// Lists the phone numbers for the specified Amazon Chime SDK account, Amazon -// Chime SDK user, Amazon Chime SDK Voice Connector, or Amazon Chime SDK Voice -// Connector group. -// -// 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 Chime SDK Voice's -// API operation ListPhoneNumbers for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListPhoneNumbers -func (c *ChimeSDKVoice) ListPhoneNumbers(input *ListPhoneNumbersInput) (*ListPhoneNumbersOutput, error) { - req, out := c.ListPhoneNumbersRequest(input) - return out, req.Send() -} - -// ListPhoneNumbersWithContext is the same as ListPhoneNumbers with the addition of -// the ability to pass a context and additional request options. -// -// See ListPhoneNumbers 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 *ChimeSDKVoice) ListPhoneNumbersWithContext(ctx aws.Context, input *ListPhoneNumbersInput, opts ...request.Option) (*ListPhoneNumbersOutput, error) { - req, out := c.ListPhoneNumbersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPhoneNumbersPages iterates over the pages of a ListPhoneNumbers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPhoneNumbers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPhoneNumbers operation. -// pageNum := 0 -// err := client.ListPhoneNumbersPages(params, -// func(page *chimesdkvoice.ListPhoneNumbersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListPhoneNumbersPages(input *ListPhoneNumbersInput, fn func(*ListPhoneNumbersOutput, bool) bool) error { - return c.ListPhoneNumbersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPhoneNumbersPagesWithContext same as ListPhoneNumbersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListPhoneNumbersPagesWithContext(ctx aws.Context, input *ListPhoneNumbersInput, fn func(*ListPhoneNumbersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPhoneNumbersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPhoneNumbersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPhoneNumbersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProxySessions = "ListProxySessions" - -// ListProxySessionsRequest generates a "aws/request.Request" representing the -// client's request for the ListProxySessions 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 ListProxySessions for more information on using the ListProxySessions -// 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 ListProxySessionsRequest method. -// req, resp := client.ListProxySessionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListProxySessions -func (c *ChimeSDKVoice) ListProxySessionsRequest(input *ListProxySessionsInput) (req *request.Request, output *ListProxySessionsOutput) { - op := &request.Operation{ - Name: opListProxySessions, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/proxy-sessions", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProxySessionsInput{} - } - - output = &ListProxySessionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProxySessions API operation for Amazon Chime SDK Voice. -// -// Lists the proxy sessions for the specified Amazon Chime SDK Voice Connector. -// -// 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 Chime SDK Voice's -// API operation ListProxySessions for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListProxySessions -func (c *ChimeSDKVoice) ListProxySessions(input *ListProxySessionsInput) (*ListProxySessionsOutput, error) { - req, out := c.ListProxySessionsRequest(input) - return out, req.Send() -} - -// ListProxySessionsWithContext is the same as ListProxySessions with the addition of -// the ability to pass a context and additional request options. -// -// See ListProxySessions 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 *ChimeSDKVoice) ListProxySessionsWithContext(ctx aws.Context, input *ListProxySessionsInput, opts ...request.Option) (*ListProxySessionsOutput, error) { - req, out := c.ListProxySessionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProxySessionsPages iterates over the pages of a ListProxySessions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProxySessions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProxySessions operation. -// pageNum := 0 -// err := client.ListProxySessionsPages(params, -// func(page *chimesdkvoice.ListProxySessionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListProxySessionsPages(input *ListProxySessionsInput, fn func(*ListProxySessionsOutput, bool) bool) error { - return c.ListProxySessionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProxySessionsPagesWithContext same as ListProxySessionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListProxySessionsPagesWithContext(ctx aws.Context, input *ListProxySessionsInput, fn func(*ListProxySessionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProxySessionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProxySessionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProxySessionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSipMediaApplications = "ListSipMediaApplications" - -// ListSipMediaApplicationsRequest generates a "aws/request.Request" representing the -// client's request for the ListSipMediaApplications 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 ListSipMediaApplications for more information on using the ListSipMediaApplications -// 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 ListSipMediaApplicationsRequest method. -// req, resp := client.ListSipMediaApplicationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListSipMediaApplications -func (c *ChimeSDKVoice) ListSipMediaApplicationsRequest(input *ListSipMediaApplicationsInput) (req *request.Request, output *ListSipMediaApplicationsOutput) { - op := &request.Operation{ - Name: opListSipMediaApplications, - HTTPMethod: "GET", - HTTPPath: "/sip-media-applications", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSipMediaApplicationsInput{} - } - - output = &ListSipMediaApplicationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSipMediaApplications API operation for Amazon Chime SDK Voice. -// -// Lists the SIP media applications under the administrator's AWS account. -// -// 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 Chime SDK Voice's -// API operation ListSipMediaApplications for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListSipMediaApplications -func (c *ChimeSDKVoice) ListSipMediaApplications(input *ListSipMediaApplicationsInput) (*ListSipMediaApplicationsOutput, error) { - req, out := c.ListSipMediaApplicationsRequest(input) - return out, req.Send() -} - -// ListSipMediaApplicationsWithContext is the same as ListSipMediaApplications with the addition of -// the ability to pass a context and additional request options. -// -// See ListSipMediaApplications 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 *ChimeSDKVoice) ListSipMediaApplicationsWithContext(ctx aws.Context, input *ListSipMediaApplicationsInput, opts ...request.Option) (*ListSipMediaApplicationsOutput, error) { - req, out := c.ListSipMediaApplicationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSipMediaApplicationsPages iterates over the pages of a ListSipMediaApplications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSipMediaApplications method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSipMediaApplications operation. -// pageNum := 0 -// err := client.ListSipMediaApplicationsPages(params, -// func(page *chimesdkvoice.ListSipMediaApplicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListSipMediaApplicationsPages(input *ListSipMediaApplicationsInput, fn func(*ListSipMediaApplicationsOutput, bool) bool) error { - return c.ListSipMediaApplicationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSipMediaApplicationsPagesWithContext same as ListSipMediaApplicationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListSipMediaApplicationsPagesWithContext(ctx aws.Context, input *ListSipMediaApplicationsInput, fn func(*ListSipMediaApplicationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSipMediaApplicationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSipMediaApplicationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSipMediaApplicationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSipRules = "ListSipRules" - -// ListSipRulesRequest generates a "aws/request.Request" representing the -// client's request for the ListSipRules 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 ListSipRules for more information on using the ListSipRules -// 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 ListSipRulesRequest method. -// req, resp := client.ListSipRulesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListSipRules -func (c *ChimeSDKVoice) ListSipRulesRequest(input *ListSipRulesInput) (req *request.Request, output *ListSipRulesOutput) { - op := &request.Operation{ - Name: opListSipRules, - HTTPMethod: "GET", - HTTPPath: "/sip-rules", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSipRulesInput{} - } - - output = &ListSipRulesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSipRules API operation for Amazon Chime SDK Voice. -// -// Lists the SIP rules under the administrator's AWS account. -// -// 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 Chime SDK Voice's -// API operation ListSipRules for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListSipRules -func (c *ChimeSDKVoice) ListSipRules(input *ListSipRulesInput) (*ListSipRulesOutput, error) { - req, out := c.ListSipRulesRequest(input) - return out, req.Send() -} - -// ListSipRulesWithContext is the same as ListSipRules with the addition of -// the ability to pass a context and additional request options. -// -// See ListSipRules 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 *ChimeSDKVoice) ListSipRulesWithContext(ctx aws.Context, input *ListSipRulesInput, opts ...request.Option) (*ListSipRulesOutput, error) { - req, out := c.ListSipRulesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSipRulesPages iterates over the pages of a ListSipRules operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSipRules method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSipRules operation. -// pageNum := 0 -// err := client.ListSipRulesPages(params, -// func(page *chimesdkvoice.ListSipRulesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListSipRulesPages(input *ListSipRulesInput, fn func(*ListSipRulesOutput, bool) bool) error { - return c.ListSipRulesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSipRulesPagesWithContext same as ListSipRulesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListSipRulesPagesWithContext(ctx aws.Context, input *ListSipRulesInput, fn func(*ListSipRulesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSipRulesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSipRulesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSipRulesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSupportedPhoneNumberCountries = "ListSupportedPhoneNumberCountries" - -// ListSupportedPhoneNumberCountriesRequest generates a "aws/request.Request" representing the -// client's request for the ListSupportedPhoneNumberCountries 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 ListSupportedPhoneNumberCountries for more information on using the ListSupportedPhoneNumberCountries -// 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 ListSupportedPhoneNumberCountriesRequest method. -// req, resp := client.ListSupportedPhoneNumberCountriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListSupportedPhoneNumberCountries -func (c *ChimeSDKVoice) ListSupportedPhoneNumberCountriesRequest(input *ListSupportedPhoneNumberCountriesInput) (req *request.Request, output *ListSupportedPhoneNumberCountriesOutput) { - op := &request.Operation{ - Name: opListSupportedPhoneNumberCountries, - HTTPMethod: "GET", - HTTPPath: "/phone-number-countries", - } - - if input == nil { - input = &ListSupportedPhoneNumberCountriesInput{} - } - - output = &ListSupportedPhoneNumberCountriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSupportedPhoneNumberCountries API operation for Amazon Chime SDK Voice. -// -// Lists the countries that you can order phone numbers from. -// -// 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 Chime SDK Voice's -// API operation ListSupportedPhoneNumberCountries for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListSupportedPhoneNumberCountries -func (c *ChimeSDKVoice) ListSupportedPhoneNumberCountries(input *ListSupportedPhoneNumberCountriesInput) (*ListSupportedPhoneNumberCountriesOutput, error) { - req, out := c.ListSupportedPhoneNumberCountriesRequest(input) - return out, req.Send() -} - -// ListSupportedPhoneNumberCountriesWithContext is the same as ListSupportedPhoneNumberCountries with the addition of -// the ability to pass a context and additional request options. -// -// See ListSupportedPhoneNumberCountries 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 *ChimeSDKVoice) ListSupportedPhoneNumberCountriesWithContext(ctx aws.Context, input *ListSupportedPhoneNumberCountriesInput, opts ...request.Option) (*ListSupportedPhoneNumberCountriesOutput, error) { - req, out := c.ListSupportedPhoneNumberCountriesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListTagsForResource -func (c *ChimeSDKVoice) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Chime SDK Voice. -// -// Returns a list of the tags in a given resource. -// -// 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 Chime SDK Voice's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListTagsForResource -func (c *ChimeSDKVoice) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *ChimeSDKVoice) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListVoiceConnectorGroups = "ListVoiceConnectorGroups" - -// ListVoiceConnectorGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListVoiceConnectorGroups 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 ListVoiceConnectorGroups for more information on using the ListVoiceConnectorGroups -// 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 ListVoiceConnectorGroupsRequest method. -// req, resp := client.ListVoiceConnectorGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceConnectorGroups -func (c *ChimeSDKVoice) ListVoiceConnectorGroupsRequest(input *ListVoiceConnectorGroupsInput) (req *request.Request, output *ListVoiceConnectorGroupsOutput) { - op := &request.Operation{ - Name: opListVoiceConnectorGroups, - HTTPMethod: "GET", - HTTPPath: "/voice-connector-groups", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVoiceConnectorGroupsInput{} - } - - output = &ListVoiceConnectorGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVoiceConnectorGroups API operation for Amazon Chime SDK Voice. -// -// Lists the Amazon Chime SDK Voice Connector groups in the administrator's -// AWS account. -// -// 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 Chime SDK Voice's -// API operation ListVoiceConnectorGroups for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceConnectorGroups -func (c *ChimeSDKVoice) ListVoiceConnectorGroups(input *ListVoiceConnectorGroupsInput) (*ListVoiceConnectorGroupsOutput, error) { - req, out := c.ListVoiceConnectorGroupsRequest(input) - return out, req.Send() -} - -// ListVoiceConnectorGroupsWithContext is the same as ListVoiceConnectorGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListVoiceConnectorGroups 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 *ChimeSDKVoice) ListVoiceConnectorGroupsWithContext(ctx aws.Context, input *ListVoiceConnectorGroupsInput, opts ...request.Option) (*ListVoiceConnectorGroupsOutput, error) { - req, out := c.ListVoiceConnectorGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVoiceConnectorGroupsPages iterates over the pages of a ListVoiceConnectorGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVoiceConnectorGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVoiceConnectorGroups operation. -// pageNum := 0 -// err := client.ListVoiceConnectorGroupsPages(params, -// func(page *chimesdkvoice.ListVoiceConnectorGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListVoiceConnectorGroupsPages(input *ListVoiceConnectorGroupsInput, fn func(*ListVoiceConnectorGroupsOutput, bool) bool) error { - return c.ListVoiceConnectorGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVoiceConnectorGroupsPagesWithContext same as ListVoiceConnectorGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListVoiceConnectorGroupsPagesWithContext(ctx aws.Context, input *ListVoiceConnectorGroupsInput, fn func(*ListVoiceConnectorGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVoiceConnectorGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVoiceConnectorGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVoiceConnectorGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListVoiceConnectorTerminationCredentials = "ListVoiceConnectorTerminationCredentials" - -// ListVoiceConnectorTerminationCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the ListVoiceConnectorTerminationCredentials 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 ListVoiceConnectorTerminationCredentials for more information on using the ListVoiceConnectorTerminationCredentials -// 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 ListVoiceConnectorTerminationCredentialsRequest method. -// req, resp := client.ListVoiceConnectorTerminationCredentialsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceConnectorTerminationCredentials -func (c *ChimeSDKVoice) ListVoiceConnectorTerminationCredentialsRequest(input *ListVoiceConnectorTerminationCredentialsInput) (req *request.Request, output *ListVoiceConnectorTerminationCredentialsOutput) { - op := &request.Operation{ - Name: opListVoiceConnectorTerminationCredentials, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors/{voiceConnectorId}/termination/credentials", - } - - if input == nil { - input = &ListVoiceConnectorTerminationCredentialsInput{} - } - - output = &ListVoiceConnectorTerminationCredentialsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVoiceConnectorTerminationCredentials API operation for Amazon Chime SDK Voice. -// -// Lists the SIP credentials for the specified Amazon Chime SDK Voice Connector. -// -// 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 Chime SDK Voice's -// API operation ListVoiceConnectorTerminationCredentials for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceConnectorTerminationCredentials -func (c *ChimeSDKVoice) ListVoiceConnectorTerminationCredentials(input *ListVoiceConnectorTerminationCredentialsInput) (*ListVoiceConnectorTerminationCredentialsOutput, error) { - req, out := c.ListVoiceConnectorTerminationCredentialsRequest(input) - return out, req.Send() -} - -// ListVoiceConnectorTerminationCredentialsWithContext is the same as ListVoiceConnectorTerminationCredentials with the addition of -// the ability to pass a context and additional request options. -// -// See ListVoiceConnectorTerminationCredentials 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 *ChimeSDKVoice) ListVoiceConnectorTerminationCredentialsWithContext(ctx aws.Context, input *ListVoiceConnectorTerminationCredentialsInput, opts ...request.Option) (*ListVoiceConnectorTerminationCredentialsOutput, error) { - req, out := c.ListVoiceConnectorTerminationCredentialsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListVoiceConnectors = "ListVoiceConnectors" - -// ListVoiceConnectorsRequest generates a "aws/request.Request" representing the -// client's request for the ListVoiceConnectors 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 ListVoiceConnectors for more information on using the ListVoiceConnectors -// 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 ListVoiceConnectorsRequest method. -// req, resp := client.ListVoiceConnectorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceConnectors -func (c *ChimeSDKVoice) ListVoiceConnectorsRequest(input *ListVoiceConnectorsInput) (req *request.Request, output *ListVoiceConnectorsOutput) { - op := &request.Operation{ - Name: opListVoiceConnectors, - HTTPMethod: "GET", - HTTPPath: "/voice-connectors", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVoiceConnectorsInput{} - } - - output = &ListVoiceConnectorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVoiceConnectors API operation for Amazon Chime SDK Voice. -// -// Lists the Amazon Chime SDK Voice Connectors in the administrators AWS account. -// -// 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 Chime SDK Voice's -// API operation ListVoiceConnectors for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceConnectors -func (c *ChimeSDKVoice) ListVoiceConnectors(input *ListVoiceConnectorsInput) (*ListVoiceConnectorsOutput, error) { - req, out := c.ListVoiceConnectorsRequest(input) - return out, req.Send() -} - -// ListVoiceConnectorsWithContext is the same as ListVoiceConnectors with the addition of -// the ability to pass a context and additional request options. -// -// See ListVoiceConnectors 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 *ChimeSDKVoice) ListVoiceConnectorsWithContext(ctx aws.Context, input *ListVoiceConnectorsInput, opts ...request.Option) (*ListVoiceConnectorsOutput, error) { - req, out := c.ListVoiceConnectorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVoiceConnectorsPages iterates over the pages of a ListVoiceConnectors operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVoiceConnectors method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVoiceConnectors operation. -// pageNum := 0 -// err := client.ListVoiceConnectorsPages(params, -// func(page *chimesdkvoice.ListVoiceConnectorsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListVoiceConnectorsPages(input *ListVoiceConnectorsInput, fn func(*ListVoiceConnectorsOutput, bool) bool) error { - return c.ListVoiceConnectorsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVoiceConnectorsPagesWithContext same as ListVoiceConnectorsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListVoiceConnectorsPagesWithContext(ctx aws.Context, input *ListVoiceConnectorsInput, fn func(*ListVoiceConnectorsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVoiceConnectorsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVoiceConnectorsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVoiceConnectorsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListVoiceProfileDomains = "ListVoiceProfileDomains" - -// ListVoiceProfileDomainsRequest generates a "aws/request.Request" representing the -// client's request for the ListVoiceProfileDomains 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 ListVoiceProfileDomains for more information on using the ListVoiceProfileDomains -// 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 ListVoiceProfileDomainsRequest method. -// req, resp := client.ListVoiceProfileDomainsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceProfileDomains -func (c *ChimeSDKVoice) ListVoiceProfileDomainsRequest(input *ListVoiceProfileDomainsInput) (req *request.Request, output *ListVoiceProfileDomainsOutput) { - op := &request.Operation{ - Name: opListVoiceProfileDomains, - HTTPMethod: "GET", - HTTPPath: "/voice-profile-domains", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVoiceProfileDomainsInput{} - } - - output = &ListVoiceProfileDomainsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVoiceProfileDomains API operation for Amazon Chime SDK Voice. -// -// Lists the specified voice profile domains in the administrator's AWS account. -// -// 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 Chime SDK Voice's -// API operation ListVoiceProfileDomains for usage and error information. -// -// Returned Error Types: -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceProfileDomains -func (c *ChimeSDKVoice) ListVoiceProfileDomains(input *ListVoiceProfileDomainsInput) (*ListVoiceProfileDomainsOutput, error) { - req, out := c.ListVoiceProfileDomainsRequest(input) - return out, req.Send() -} - -// ListVoiceProfileDomainsWithContext is the same as ListVoiceProfileDomains with the addition of -// the ability to pass a context and additional request options. -// -// See ListVoiceProfileDomains 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 *ChimeSDKVoice) ListVoiceProfileDomainsWithContext(ctx aws.Context, input *ListVoiceProfileDomainsInput, opts ...request.Option) (*ListVoiceProfileDomainsOutput, error) { - req, out := c.ListVoiceProfileDomainsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVoiceProfileDomainsPages iterates over the pages of a ListVoiceProfileDomains operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVoiceProfileDomains method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVoiceProfileDomains operation. -// pageNum := 0 -// err := client.ListVoiceProfileDomainsPages(params, -// func(page *chimesdkvoice.ListVoiceProfileDomainsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListVoiceProfileDomainsPages(input *ListVoiceProfileDomainsInput, fn func(*ListVoiceProfileDomainsOutput, bool) bool) error { - return c.ListVoiceProfileDomainsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVoiceProfileDomainsPagesWithContext same as ListVoiceProfileDomainsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListVoiceProfileDomainsPagesWithContext(ctx aws.Context, input *ListVoiceProfileDomainsInput, fn func(*ListVoiceProfileDomainsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVoiceProfileDomainsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVoiceProfileDomainsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVoiceProfileDomainsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListVoiceProfiles = "ListVoiceProfiles" - -// ListVoiceProfilesRequest generates a "aws/request.Request" representing the -// client's request for the ListVoiceProfiles 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 ListVoiceProfiles for more information on using the ListVoiceProfiles -// 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 ListVoiceProfilesRequest method. -// req, resp := client.ListVoiceProfilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceProfiles -func (c *ChimeSDKVoice) ListVoiceProfilesRequest(input *ListVoiceProfilesInput) (req *request.Request, output *ListVoiceProfilesOutput) { - op := &request.Operation{ - Name: opListVoiceProfiles, - HTTPMethod: "GET", - HTTPPath: "/voice-profiles", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVoiceProfilesInput{} - } - - output = &ListVoiceProfilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVoiceProfiles API operation for Amazon Chime SDK Voice. -// -// Lists the voice profiles in a voice profile domain. -// -// 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 Chime SDK Voice's -// API operation ListVoiceProfiles for usage and error information. -// -// Returned Error Types: -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ListVoiceProfiles -func (c *ChimeSDKVoice) ListVoiceProfiles(input *ListVoiceProfilesInput) (*ListVoiceProfilesOutput, error) { - req, out := c.ListVoiceProfilesRequest(input) - return out, req.Send() -} - -// ListVoiceProfilesWithContext is the same as ListVoiceProfiles with the addition of -// the ability to pass a context and additional request options. -// -// See ListVoiceProfiles 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 *ChimeSDKVoice) ListVoiceProfilesWithContext(ctx aws.Context, input *ListVoiceProfilesInput, opts ...request.Option) (*ListVoiceProfilesOutput, error) { - req, out := c.ListVoiceProfilesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVoiceProfilesPages iterates over the pages of a ListVoiceProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVoiceProfiles method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVoiceProfiles operation. -// pageNum := 0 -// err := client.ListVoiceProfilesPages(params, -// func(page *chimesdkvoice.ListVoiceProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) ListVoiceProfilesPages(input *ListVoiceProfilesInput, fn func(*ListVoiceProfilesOutput, bool) bool) error { - return c.ListVoiceProfilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVoiceProfilesPagesWithContext same as ListVoiceProfilesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) ListVoiceProfilesPagesWithContext(ctx aws.Context, input *ListVoiceProfilesInput, fn func(*ListVoiceProfilesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVoiceProfilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVoiceProfilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVoiceProfilesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutSipMediaApplicationAlexaSkillConfiguration = "PutSipMediaApplicationAlexaSkillConfiguration" - -// PutSipMediaApplicationAlexaSkillConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutSipMediaApplicationAlexaSkillConfiguration 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 PutSipMediaApplicationAlexaSkillConfiguration for more information on using the PutSipMediaApplicationAlexaSkillConfiguration -// 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 PutSipMediaApplicationAlexaSkillConfigurationRequest method. -// req, resp := client.PutSipMediaApplicationAlexaSkillConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutSipMediaApplicationAlexaSkillConfiguration -func (c *ChimeSDKVoice) PutSipMediaApplicationAlexaSkillConfigurationRequest(input *PutSipMediaApplicationAlexaSkillConfigurationInput) (req *request.Request, output *PutSipMediaApplicationAlexaSkillConfigurationOutput) { - op := &request.Operation{ - Name: opPutSipMediaApplicationAlexaSkillConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}/alexa-skill-configuration", - } - - if input == nil { - input = &PutSipMediaApplicationAlexaSkillConfigurationInput{} - } - - output = &PutSipMediaApplicationAlexaSkillConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutSipMediaApplicationAlexaSkillConfiguration API operation for Amazon Chime SDK Voice. -// -// Updates the Alexa Skill configuration for the SIP media application. -// -// 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 Chime SDK Voice's -// API operation PutSipMediaApplicationAlexaSkillConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutSipMediaApplicationAlexaSkillConfiguration -func (c *ChimeSDKVoice) PutSipMediaApplicationAlexaSkillConfiguration(input *PutSipMediaApplicationAlexaSkillConfigurationInput) (*PutSipMediaApplicationAlexaSkillConfigurationOutput, error) { - req, out := c.PutSipMediaApplicationAlexaSkillConfigurationRequest(input) - return out, req.Send() -} - -// PutSipMediaApplicationAlexaSkillConfigurationWithContext is the same as PutSipMediaApplicationAlexaSkillConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutSipMediaApplicationAlexaSkillConfiguration 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 *ChimeSDKVoice) PutSipMediaApplicationAlexaSkillConfigurationWithContext(ctx aws.Context, input *PutSipMediaApplicationAlexaSkillConfigurationInput, opts ...request.Option) (*PutSipMediaApplicationAlexaSkillConfigurationOutput, error) { - req, out := c.PutSipMediaApplicationAlexaSkillConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutSipMediaApplicationLoggingConfiguration = "PutSipMediaApplicationLoggingConfiguration" - -// PutSipMediaApplicationLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutSipMediaApplicationLoggingConfiguration 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 PutSipMediaApplicationLoggingConfiguration for more information on using the PutSipMediaApplicationLoggingConfiguration -// 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 PutSipMediaApplicationLoggingConfigurationRequest method. -// req, resp := client.PutSipMediaApplicationLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutSipMediaApplicationLoggingConfiguration -func (c *ChimeSDKVoice) PutSipMediaApplicationLoggingConfigurationRequest(input *PutSipMediaApplicationLoggingConfigurationInput) (req *request.Request, output *PutSipMediaApplicationLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opPutSipMediaApplicationLoggingConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}/logging-configuration", - } - - if input == nil { - input = &PutSipMediaApplicationLoggingConfigurationInput{} - } - - output = &PutSipMediaApplicationLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutSipMediaApplicationLoggingConfiguration API operation for Amazon Chime SDK Voice. -// -// Updates the logging configuration for the specified SIP media application. -// -// 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 Chime SDK Voice's -// API operation PutSipMediaApplicationLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutSipMediaApplicationLoggingConfiguration -func (c *ChimeSDKVoice) PutSipMediaApplicationLoggingConfiguration(input *PutSipMediaApplicationLoggingConfigurationInput) (*PutSipMediaApplicationLoggingConfigurationOutput, error) { - req, out := c.PutSipMediaApplicationLoggingConfigurationRequest(input) - return out, req.Send() -} - -// PutSipMediaApplicationLoggingConfigurationWithContext is the same as PutSipMediaApplicationLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutSipMediaApplicationLoggingConfiguration 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 *ChimeSDKVoice) PutSipMediaApplicationLoggingConfigurationWithContext(ctx aws.Context, input *PutSipMediaApplicationLoggingConfigurationInput, opts ...request.Option) (*PutSipMediaApplicationLoggingConfigurationOutput, error) { - req, out := c.PutSipMediaApplicationLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutVoiceConnectorEmergencyCallingConfiguration = "PutVoiceConnectorEmergencyCallingConfiguration" - -// PutVoiceConnectorEmergencyCallingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutVoiceConnectorEmergencyCallingConfiguration 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 PutVoiceConnectorEmergencyCallingConfiguration for more information on using the PutVoiceConnectorEmergencyCallingConfiguration -// 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 PutVoiceConnectorEmergencyCallingConfigurationRequest method. -// req, resp := client.PutVoiceConnectorEmergencyCallingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorEmergencyCallingConfiguration -func (c *ChimeSDKVoice) PutVoiceConnectorEmergencyCallingConfigurationRequest(input *PutVoiceConnectorEmergencyCallingConfigurationInput) (req *request.Request, output *PutVoiceConnectorEmergencyCallingConfigurationOutput) { - op := &request.Operation{ - Name: opPutVoiceConnectorEmergencyCallingConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/voice-connectors/{voiceConnectorId}/emergency-calling-configuration", - } - - if input == nil { - input = &PutVoiceConnectorEmergencyCallingConfigurationInput{} - } - - output = &PutVoiceConnectorEmergencyCallingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutVoiceConnectorEmergencyCallingConfiguration API operation for Amazon Chime SDK Voice. -// -// Updates a Voice Connector's emergency calling configuration. -// -// 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 Chime SDK Voice's -// API operation PutVoiceConnectorEmergencyCallingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorEmergencyCallingConfiguration -func (c *ChimeSDKVoice) PutVoiceConnectorEmergencyCallingConfiguration(input *PutVoiceConnectorEmergencyCallingConfigurationInput) (*PutVoiceConnectorEmergencyCallingConfigurationOutput, error) { - req, out := c.PutVoiceConnectorEmergencyCallingConfigurationRequest(input) - return out, req.Send() -} - -// PutVoiceConnectorEmergencyCallingConfigurationWithContext is the same as PutVoiceConnectorEmergencyCallingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutVoiceConnectorEmergencyCallingConfiguration 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 *ChimeSDKVoice) PutVoiceConnectorEmergencyCallingConfigurationWithContext(ctx aws.Context, input *PutVoiceConnectorEmergencyCallingConfigurationInput, opts ...request.Option) (*PutVoiceConnectorEmergencyCallingConfigurationOutput, error) { - req, out := c.PutVoiceConnectorEmergencyCallingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutVoiceConnectorLoggingConfiguration = "PutVoiceConnectorLoggingConfiguration" - -// PutVoiceConnectorLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutVoiceConnectorLoggingConfiguration 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 PutVoiceConnectorLoggingConfiguration for more information on using the PutVoiceConnectorLoggingConfiguration -// 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 PutVoiceConnectorLoggingConfigurationRequest method. -// req, resp := client.PutVoiceConnectorLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorLoggingConfiguration -func (c *ChimeSDKVoice) PutVoiceConnectorLoggingConfigurationRequest(input *PutVoiceConnectorLoggingConfigurationInput) (req *request.Request, output *PutVoiceConnectorLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opPutVoiceConnectorLoggingConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/voice-connectors/{voiceConnectorId}/logging-configuration", - } - - if input == nil { - input = &PutVoiceConnectorLoggingConfigurationInput{} - } - - output = &PutVoiceConnectorLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutVoiceConnectorLoggingConfiguration API operation for Amazon Chime SDK Voice. -// -// Updates a Voice Connector's logging configuration. -// -// 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 Chime SDK Voice's -// API operation PutVoiceConnectorLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorLoggingConfiguration -func (c *ChimeSDKVoice) PutVoiceConnectorLoggingConfiguration(input *PutVoiceConnectorLoggingConfigurationInput) (*PutVoiceConnectorLoggingConfigurationOutput, error) { - req, out := c.PutVoiceConnectorLoggingConfigurationRequest(input) - return out, req.Send() -} - -// PutVoiceConnectorLoggingConfigurationWithContext is the same as PutVoiceConnectorLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutVoiceConnectorLoggingConfiguration 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 *ChimeSDKVoice) PutVoiceConnectorLoggingConfigurationWithContext(ctx aws.Context, input *PutVoiceConnectorLoggingConfigurationInput, opts ...request.Option) (*PutVoiceConnectorLoggingConfigurationOutput, error) { - req, out := c.PutVoiceConnectorLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutVoiceConnectorOrigination = "PutVoiceConnectorOrigination" - -// PutVoiceConnectorOriginationRequest generates a "aws/request.Request" representing the -// client's request for the PutVoiceConnectorOrigination 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 PutVoiceConnectorOrigination for more information on using the PutVoiceConnectorOrigination -// 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 PutVoiceConnectorOriginationRequest method. -// req, resp := client.PutVoiceConnectorOriginationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorOrigination -func (c *ChimeSDKVoice) PutVoiceConnectorOriginationRequest(input *PutVoiceConnectorOriginationInput) (req *request.Request, output *PutVoiceConnectorOriginationOutput) { - op := &request.Operation{ - Name: opPutVoiceConnectorOrigination, - HTTPMethod: "PUT", - HTTPPath: "/voice-connectors/{voiceConnectorId}/origination", - } - - if input == nil { - input = &PutVoiceConnectorOriginationInput{} - } - - output = &PutVoiceConnectorOriginationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutVoiceConnectorOrigination API operation for Amazon Chime SDK Voice. -// -// Updates a Voice Connector's origination settings. -// -// 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 Chime SDK Voice's -// API operation PutVoiceConnectorOrigination for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorOrigination -func (c *ChimeSDKVoice) PutVoiceConnectorOrigination(input *PutVoiceConnectorOriginationInput) (*PutVoiceConnectorOriginationOutput, error) { - req, out := c.PutVoiceConnectorOriginationRequest(input) - return out, req.Send() -} - -// PutVoiceConnectorOriginationWithContext is the same as PutVoiceConnectorOrigination with the addition of -// the ability to pass a context and additional request options. -// -// See PutVoiceConnectorOrigination 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 *ChimeSDKVoice) PutVoiceConnectorOriginationWithContext(ctx aws.Context, input *PutVoiceConnectorOriginationInput, opts ...request.Option) (*PutVoiceConnectorOriginationOutput, error) { - req, out := c.PutVoiceConnectorOriginationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutVoiceConnectorProxy = "PutVoiceConnectorProxy" - -// PutVoiceConnectorProxyRequest generates a "aws/request.Request" representing the -// client's request for the PutVoiceConnectorProxy 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 PutVoiceConnectorProxy for more information on using the PutVoiceConnectorProxy -// 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 PutVoiceConnectorProxyRequest method. -// req, resp := client.PutVoiceConnectorProxyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorProxy -func (c *ChimeSDKVoice) PutVoiceConnectorProxyRequest(input *PutVoiceConnectorProxyInput) (req *request.Request, output *PutVoiceConnectorProxyOutput) { - op := &request.Operation{ - Name: opPutVoiceConnectorProxy, - HTTPMethod: "PUT", - HTTPPath: "/voice-connectors/{voiceConnectorId}/programmable-numbers/proxy", - } - - if input == nil { - input = &PutVoiceConnectorProxyInput{} - } - - output = &PutVoiceConnectorProxyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutVoiceConnectorProxy API operation for Amazon Chime SDK Voice. -// -// Puts the specified proxy configuration to the specified Amazon Chime SDK -// Voice Connector. -// -// 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 Chime SDK Voice's -// API operation PutVoiceConnectorProxy for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorProxy -func (c *ChimeSDKVoice) PutVoiceConnectorProxy(input *PutVoiceConnectorProxyInput) (*PutVoiceConnectorProxyOutput, error) { - req, out := c.PutVoiceConnectorProxyRequest(input) - return out, req.Send() -} - -// PutVoiceConnectorProxyWithContext is the same as PutVoiceConnectorProxy with the addition of -// the ability to pass a context and additional request options. -// -// See PutVoiceConnectorProxy 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 *ChimeSDKVoice) PutVoiceConnectorProxyWithContext(ctx aws.Context, input *PutVoiceConnectorProxyInput, opts ...request.Option) (*PutVoiceConnectorProxyOutput, error) { - req, out := c.PutVoiceConnectorProxyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutVoiceConnectorStreamingConfiguration = "PutVoiceConnectorStreamingConfiguration" - -// PutVoiceConnectorStreamingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutVoiceConnectorStreamingConfiguration 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 PutVoiceConnectorStreamingConfiguration for more information on using the PutVoiceConnectorStreamingConfiguration -// 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 PutVoiceConnectorStreamingConfigurationRequest method. -// req, resp := client.PutVoiceConnectorStreamingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorStreamingConfiguration -func (c *ChimeSDKVoice) PutVoiceConnectorStreamingConfigurationRequest(input *PutVoiceConnectorStreamingConfigurationInput) (req *request.Request, output *PutVoiceConnectorStreamingConfigurationOutput) { - op := &request.Operation{ - Name: opPutVoiceConnectorStreamingConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/voice-connectors/{voiceConnectorId}/streaming-configuration", - } - - if input == nil { - input = &PutVoiceConnectorStreamingConfigurationInput{} - } - - output = &PutVoiceConnectorStreamingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutVoiceConnectorStreamingConfiguration API operation for Amazon Chime SDK Voice. -// -// Updates a Voice Connector's streaming configuration settings. -// -// 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 Chime SDK Voice's -// API operation PutVoiceConnectorStreamingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorStreamingConfiguration -func (c *ChimeSDKVoice) PutVoiceConnectorStreamingConfiguration(input *PutVoiceConnectorStreamingConfigurationInput) (*PutVoiceConnectorStreamingConfigurationOutput, error) { - req, out := c.PutVoiceConnectorStreamingConfigurationRequest(input) - return out, req.Send() -} - -// PutVoiceConnectorStreamingConfigurationWithContext is the same as PutVoiceConnectorStreamingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutVoiceConnectorStreamingConfiguration 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 *ChimeSDKVoice) PutVoiceConnectorStreamingConfigurationWithContext(ctx aws.Context, input *PutVoiceConnectorStreamingConfigurationInput, opts ...request.Option) (*PutVoiceConnectorStreamingConfigurationOutput, error) { - req, out := c.PutVoiceConnectorStreamingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutVoiceConnectorTermination = "PutVoiceConnectorTermination" - -// PutVoiceConnectorTerminationRequest generates a "aws/request.Request" representing the -// client's request for the PutVoiceConnectorTermination 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 PutVoiceConnectorTermination for more information on using the PutVoiceConnectorTermination -// 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 PutVoiceConnectorTerminationRequest method. -// req, resp := client.PutVoiceConnectorTerminationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorTermination -func (c *ChimeSDKVoice) PutVoiceConnectorTerminationRequest(input *PutVoiceConnectorTerminationInput) (req *request.Request, output *PutVoiceConnectorTerminationOutput) { - op := &request.Operation{ - Name: opPutVoiceConnectorTermination, - HTTPMethod: "PUT", - HTTPPath: "/voice-connectors/{voiceConnectorId}/termination", - } - - if input == nil { - input = &PutVoiceConnectorTerminationInput{} - } - - output = &PutVoiceConnectorTerminationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutVoiceConnectorTermination API operation for Amazon Chime SDK Voice. -// -// Updates a Voice Connector's termination settings. -// -// 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 Chime SDK Voice's -// API operation PutVoiceConnectorTermination for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorTermination -func (c *ChimeSDKVoice) PutVoiceConnectorTermination(input *PutVoiceConnectorTerminationInput) (*PutVoiceConnectorTerminationOutput, error) { - req, out := c.PutVoiceConnectorTerminationRequest(input) - return out, req.Send() -} - -// PutVoiceConnectorTerminationWithContext is the same as PutVoiceConnectorTermination with the addition of -// the ability to pass a context and additional request options. -// -// See PutVoiceConnectorTermination 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 *ChimeSDKVoice) PutVoiceConnectorTerminationWithContext(ctx aws.Context, input *PutVoiceConnectorTerminationInput, opts ...request.Option) (*PutVoiceConnectorTerminationOutput, error) { - req, out := c.PutVoiceConnectorTerminationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutVoiceConnectorTerminationCredentials = "PutVoiceConnectorTerminationCredentials" - -// PutVoiceConnectorTerminationCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the PutVoiceConnectorTerminationCredentials 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 PutVoiceConnectorTerminationCredentials for more information on using the PutVoiceConnectorTerminationCredentials -// 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 PutVoiceConnectorTerminationCredentialsRequest method. -// req, resp := client.PutVoiceConnectorTerminationCredentialsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorTerminationCredentials -func (c *ChimeSDKVoice) PutVoiceConnectorTerminationCredentialsRequest(input *PutVoiceConnectorTerminationCredentialsInput) (req *request.Request, output *PutVoiceConnectorTerminationCredentialsOutput) { - op := &request.Operation{ - Name: opPutVoiceConnectorTerminationCredentials, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{voiceConnectorId}/termination/credentials?operation=put", - } - - if input == nil { - input = &PutVoiceConnectorTerminationCredentialsInput{} - } - - output = &PutVoiceConnectorTerminationCredentialsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutVoiceConnectorTerminationCredentials API operation for Amazon Chime SDK Voice. -// -// Updates a Voice Connector's termination credentials. -// -// 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 Chime SDK Voice's -// API operation PutVoiceConnectorTerminationCredentials for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/PutVoiceConnectorTerminationCredentials -func (c *ChimeSDKVoice) PutVoiceConnectorTerminationCredentials(input *PutVoiceConnectorTerminationCredentialsInput) (*PutVoiceConnectorTerminationCredentialsOutput, error) { - req, out := c.PutVoiceConnectorTerminationCredentialsRequest(input) - return out, req.Send() -} - -// PutVoiceConnectorTerminationCredentialsWithContext is the same as PutVoiceConnectorTerminationCredentials with the addition of -// the ability to pass a context and additional request options. -// -// See PutVoiceConnectorTerminationCredentials 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 *ChimeSDKVoice) PutVoiceConnectorTerminationCredentialsWithContext(ctx aws.Context, input *PutVoiceConnectorTerminationCredentialsInput, opts ...request.Option) (*PutVoiceConnectorTerminationCredentialsOutput, error) { - req, out := c.PutVoiceConnectorTerminationCredentialsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestorePhoneNumber = "RestorePhoneNumber" - -// RestorePhoneNumberRequest generates a "aws/request.Request" representing the -// client's request for the RestorePhoneNumber 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 RestorePhoneNumber for more information on using the RestorePhoneNumber -// 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 RestorePhoneNumberRequest method. -// req, resp := client.RestorePhoneNumberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/RestorePhoneNumber -func (c *ChimeSDKVoice) RestorePhoneNumberRequest(input *RestorePhoneNumberInput) (req *request.Request, output *RestorePhoneNumberOutput) { - op := &request.Operation{ - Name: opRestorePhoneNumber, - HTTPMethod: "POST", - HTTPPath: "/phone-numbers/{phoneNumberId}?operation=restore", - } - - if input == nil { - input = &RestorePhoneNumberInput{} - } - - output = &RestorePhoneNumberOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestorePhoneNumber API operation for Amazon Chime SDK Voice. -// -// Restores a deleted phone number. -// -// 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 Chime SDK Voice's -// API operation RestorePhoneNumber for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/RestorePhoneNumber -func (c *ChimeSDKVoice) RestorePhoneNumber(input *RestorePhoneNumberInput) (*RestorePhoneNumberOutput, error) { - req, out := c.RestorePhoneNumberRequest(input) - return out, req.Send() -} - -// RestorePhoneNumberWithContext is the same as RestorePhoneNumber with the addition of -// the ability to pass a context and additional request options. -// -// See RestorePhoneNumber 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 *ChimeSDKVoice) RestorePhoneNumberWithContext(ctx aws.Context, input *RestorePhoneNumberInput, opts ...request.Option) (*RestorePhoneNumberOutput, error) { - req, out := c.RestorePhoneNumberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSearchAvailablePhoneNumbers = "SearchAvailablePhoneNumbers" - -// SearchAvailablePhoneNumbersRequest generates a "aws/request.Request" representing the -// client's request for the SearchAvailablePhoneNumbers 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 SearchAvailablePhoneNumbers for more information on using the SearchAvailablePhoneNumbers -// 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 SearchAvailablePhoneNumbersRequest method. -// req, resp := client.SearchAvailablePhoneNumbersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/SearchAvailablePhoneNumbers -func (c *ChimeSDKVoice) SearchAvailablePhoneNumbersRequest(input *SearchAvailablePhoneNumbersInput) (req *request.Request, output *SearchAvailablePhoneNumbersOutput) { - op := &request.Operation{ - Name: opSearchAvailablePhoneNumbers, - HTTPMethod: "GET", - HTTPPath: "/search?type=phone-numbers", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchAvailablePhoneNumbersInput{} - } - - output = &SearchAvailablePhoneNumbersOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchAvailablePhoneNumbers API operation for Amazon Chime SDK Voice. -// -// Searches the provisioned phone numbers in an organization. -// -// 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 Chime SDK Voice's -// API operation SearchAvailablePhoneNumbers for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/SearchAvailablePhoneNumbers -func (c *ChimeSDKVoice) SearchAvailablePhoneNumbers(input *SearchAvailablePhoneNumbersInput) (*SearchAvailablePhoneNumbersOutput, error) { - req, out := c.SearchAvailablePhoneNumbersRequest(input) - return out, req.Send() -} - -// SearchAvailablePhoneNumbersWithContext is the same as SearchAvailablePhoneNumbers with the addition of -// the ability to pass a context and additional request options. -// -// See SearchAvailablePhoneNumbers 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 *ChimeSDKVoice) SearchAvailablePhoneNumbersWithContext(ctx aws.Context, input *SearchAvailablePhoneNumbersInput, opts ...request.Option) (*SearchAvailablePhoneNumbersOutput, error) { - req, out := c.SearchAvailablePhoneNumbersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchAvailablePhoneNumbersPages iterates over the pages of a SearchAvailablePhoneNumbers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchAvailablePhoneNumbers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchAvailablePhoneNumbers operation. -// pageNum := 0 -// err := client.SearchAvailablePhoneNumbersPages(params, -// func(page *chimesdkvoice.SearchAvailablePhoneNumbersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ChimeSDKVoice) SearchAvailablePhoneNumbersPages(input *SearchAvailablePhoneNumbersInput, fn func(*SearchAvailablePhoneNumbersOutput, bool) bool) error { - return c.SearchAvailablePhoneNumbersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchAvailablePhoneNumbersPagesWithContext same as SearchAvailablePhoneNumbersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ChimeSDKVoice) SearchAvailablePhoneNumbersPagesWithContext(ctx aws.Context, input *SearchAvailablePhoneNumbersInput, fn func(*SearchAvailablePhoneNumbersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchAvailablePhoneNumbersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchAvailablePhoneNumbersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchAvailablePhoneNumbersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartSpeakerSearchTask = "StartSpeakerSearchTask" - -// StartSpeakerSearchTaskRequest generates a "aws/request.Request" representing the -// client's request for the StartSpeakerSearchTask 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 StartSpeakerSearchTask for more information on using the StartSpeakerSearchTask -// 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 StartSpeakerSearchTaskRequest method. -// req, resp := client.StartSpeakerSearchTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/StartSpeakerSearchTask -func (c *ChimeSDKVoice) StartSpeakerSearchTaskRequest(input *StartSpeakerSearchTaskInput) (req *request.Request, output *StartSpeakerSearchTaskOutput) { - op := &request.Operation{ - Name: opStartSpeakerSearchTask, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{VoiceConnectorId}/speaker-search-tasks", - } - - if input == nil { - input = &StartSpeakerSearchTaskInput{} - } - - output = &StartSpeakerSearchTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartSpeakerSearchTask API operation for Amazon Chime SDK Voice. -// -// Starts a speaker search task. -// -// Before starting any speaker search tasks, you must provide all notices and -// obtain all consents from the speaker as required under applicable privacy -// and biometrics laws, and as required under the AWS service terms (https://aws.amazon.com/service-terms/) -// for the Amazon Chime SDK. -// -// 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 Chime SDK Voice's -// API operation StartSpeakerSearchTask for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - GoneException -// Access to the target resource is no longer available at the origin server. -// This condition is likely to be permanent. -// -// - UnprocessableEntityException -// A well-formed request couldn't be followed due to semantic errors. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/StartSpeakerSearchTask -func (c *ChimeSDKVoice) StartSpeakerSearchTask(input *StartSpeakerSearchTaskInput) (*StartSpeakerSearchTaskOutput, error) { - req, out := c.StartSpeakerSearchTaskRequest(input) - return out, req.Send() -} - -// StartSpeakerSearchTaskWithContext is the same as StartSpeakerSearchTask with the addition of -// the ability to pass a context and additional request options. -// -// See StartSpeakerSearchTask 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 *ChimeSDKVoice) StartSpeakerSearchTaskWithContext(ctx aws.Context, input *StartSpeakerSearchTaskInput, opts ...request.Option) (*StartSpeakerSearchTaskOutput, error) { - req, out := c.StartSpeakerSearchTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartVoiceToneAnalysisTask = "StartVoiceToneAnalysisTask" - -// StartVoiceToneAnalysisTaskRequest generates a "aws/request.Request" representing the -// client's request for the StartVoiceToneAnalysisTask 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 StartVoiceToneAnalysisTask for more information on using the StartVoiceToneAnalysisTask -// 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 StartVoiceToneAnalysisTaskRequest method. -// req, resp := client.StartVoiceToneAnalysisTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/StartVoiceToneAnalysisTask -func (c *ChimeSDKVoice) StartVoiceToneAnalysisTaskRequest(input *StartVoiceToneAnalysisTaskInput) (req *request.Request, output *StartVoiceToneAnalysisTaskOutput) { - op := &request.Operation{ - Name: opStartVoiceToneAnalysisTask, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks", - } - - if input == nil { - input = &StartVoiceToneAnalysisTaskInput{} - } - - output = &StartVoiceToneAnalysisTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartVoiceToneAnalysisTask API operation for Amazon Chime SDK Voice. -// -// Starts a voice tone analysis task. For more information about voice tone -// analysis, see Using Amazon Chime SDK voice analytics (https://docs.aws.amazon.com/chime-sdk/latest/dg/pstn-voice-analytics.html) -// in the Amazon Chime SDK Developer Guide. -// -// Before starting any voice tone analysis tasks, you must provide all notices -// and obtain all consents from the speaker as required under applicable privacy -// and biometrics laws, and as required under the AWS service terms (https://aws.amazon.com/service-terms/) -// for the Amazon Chime SDK. -// -// 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 Chime SDK Voice's -// API operation StartVoiceToneAnalysisTask for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - GoneException -// Access to the target resource is no longer available at the origin server. -// This condition is likely to be permanent. -// -// - UnprocessableEntityException -// A well-formed request couldn't be followed due to semantic errors. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/StartVoiceToneAnalysisTask -func (c *ChimeSDKVoice) StartVoiceToneAnalysisTask(input *StartVoiceToneAnalysisTaskInput) (*StartVoiceToneAnalysisTaskOutput, error) { - req, out := c.StartVoiceToneAnalysisTaskRequest(input) - return out, req.Send() -} - -// StartVoiceToneAnalysisTaskWithContext is the same as StartVoiceToneAnalysisTask with the addition of -// the ability to pass a context and additional request options. -// -// See StartVoiceToneAnalysisTask 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 *ChimeSDKVoice) StartVoiceToneAnalysisTaskWithContext(ctx aws.Context, input *StartVoiceToneAnalysisTaskInput, opts ...request.Option) (*StartVoiceToneAnalysisTaskOutput, error) { - req, out := c.StartVoiceToneAnalysisTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopSpeakerSearchTask = "StopSpeakerSearchTask" - -// StopSpeakerSearchTaskRequest generates a "aws/request.Request" representing the -// client's request for the StopSpeakerSearchTask 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 StopSpeakerSearchTask for more information on using the StopSpeakerSearchTask -// 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 StopSpeakerSearchTaskRequest method. -// req, resp := client.StopSpeakerSearchTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/StopSpeakerSearchTask -func (c *ChimeSDKVoice) StopSpeakerSearchTaskRequest(input *StopSpeakerSearchTaskInput) (req *request.Request, output *StopSpeakerSearchTaskOutput) { - op := &request.Operation{ - Name: opStopSpeakerSearchTask, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{VoiceConnectorId}/speaker-search-tasks/{SpeakerSearchTaskId}?operation=stop", - } - - if input == nil { - input = &StopSpeakerSearchTaskInput{} - } - - output = &StopSpeakerSearchTaskOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopSpeakerSearchTask API operation for Amazon Chime SDK Voice. -// -// Stops a speaker search task. -// -// 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 Chime SDK Voice's -// API operation StopSpeakerSearchTask for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - UnprocessableEntityException -// A well-formed request couldn't be followed due to semantic errors. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/StopSpeakerSearchTask -func (c *ChimeSDKVoice) StopSpeakerSearchTask(input *StopSpeakerSearchTaskInput) (*StopSpeakerSearchTaskOutput, error) { - req, out := c.StopSpeakerSearchTaskRequest(input) - return out, req.Send() -} - -// StopSpeakerSearchTaskWithContext is the same as StopSpeakerSearchTask with the addition of -// the ability to pass a context and additional request options. -// -// See StopSpeakerSearchTask 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 *ChimeSDKVoice) StopSpeakerSearchTaskWithContext(ctx aws.Context, input *StopSpeakerSearchTaskInput, opts ...request.Option) (*StopSpeakerSearchTaskOutput, error) { - req, out := c.StopSpeakerSearchTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopVoiceToneAnalysisTask = "StopVoiceToneAnalysisTask" - -// StopVoiceToneAnalysisTaskRequest generates a "aws/request.Request" representing the -// client's request for the StopVoiceToneAnalysisTask 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 StopVoiceToneAnalysisTask for more information on using the StopVoiceToneAnalysisTask -// 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 StopVoiceToneAnalysisTaskRequest method. -// req, resp := client.StopVoiceToneAnalysisTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/StopVoiceToneAnalysisTask -func (c *ChimeSDKVoice) StopVoiceToneAnalysisTaskRequest(input *StopVoiceToneAnalysisTaskInput) (req *request.Request, output *StopVoiceToneAnalysisTaskOutput) { - op := &request.Operation{ - Name: opStopVoiceToneAnalysisTask, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{VoiceConnectorId}/voice-tone-analysis-tasks/{VoiceToneAnalysisTaskId}?operation=stop", - } - - if input == nil { - input = &StopVoiceToneAnalysisTaskInput{} - } - - output = &StopVoiceToneAnalysisTaskOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopVoiceToneAnalysisTask API operation for Amazon Chime SDK Voice. -// -// Stops a voice tone analysis task. -// -// 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 Chime SDK Voice's -// API operation StopVoiceToneAnalysisTask for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - UnprocessableEntityException -// A well-formed request couldn't be followed due to semantic errors. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/StopVoiceToneAnalysisTask -func (c *ChimeSDKVoice) StopVoiceToneAnalysisTask(input *StopVoiceToneAnalysisTaskInput) (*StopVoiceToneAnalysisTaskOutput, error) { - req, out := c.StopVoiceToneAnalysisTaskRequest(input) - return out, req.Send() -} - -// StopVoiceToneAnalysisTaskWithContext is the same as StopVoiceToneAnalysisTask with the addition of -// the ability to pass a context and additional request options. -// -// See StopVoiceToneAnalysisTask 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 *ChimeSDKVoice) StopVoiceToneAnalysisTaskWithContext(ctx aws.Context, input *StopVoiceToneAnalysisTaskInput, opts ...request.Option) (*StopVoiceToneAnalysisTaskOutput, error) { - req, out := c.StopVoiceToneAnalysisTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/TagResource -func (c *ChimeSDKVoice) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags?operation=tag-resource", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon Chime SDK Voice. -// -// Adds a tag to the specified resource. -// -// 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 Chime SDK Voice's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/TagResource -func (c *ChimeSDKVoice) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *ChimeSDKVoice) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UntagResource -func (c *ChimeSDKVoice) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/tags?operation=untag-resource", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon Chime SDK Voice. -// -// Removes tags from a resource. -// -// 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 Chime SDK Voice's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UntagResource -func (c *ChimeSDKVoice) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *ChimeSDKVoice) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateGlobalSettings = "UpdateGlobalSettings" - -// UpdateGlobalSettingsRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGlobalSettings 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 UpdateGlobalSettings for more information on using the UpdateGlobalSettings -// 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 UpdateGlobalSettingsRequest method. -// req, resp := client.UpdateGlobalSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateGlobalSettings -func (c *ChimeSDKVoice) UpdateGlobalSettingsRequest(input *UpdateGlobalSettingsInput) (req *request.Request, output *UpdateGlobalSettingsOutput) { - op := &request.Operation{ - Name: opUpdateGlobalSettings, - HTTPMethod: "PUT", - HTTPPath: "/settings", - } - - if input == nil { - input = &UpdateGlobalSettingsInput{} - } - - output = &UpdateGlobalSettingsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateGlobalSettings API operation for Amazon Chime SDK Voice. -// -// Updates global settings for the Amazon Chime SDK Voice Connectors in an AWS -// account. -// -// 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 Chime SDK Voice's -// API operation UpdateGlobalSettings for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateGlobalSettings -func (c *ChimeSDKVoice) UpdateGlobalSettings(input *UpdateGlobalSettingsInput) (*UpdateGlobalSettingsOutput, error) { - req, out := c.UpdateGlobalSettingsRequest(input) - return out, req.Send() -} - -// UpdateGlobalSettingsWithContext is the same as UpdateGlobalSettings with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateGlobalSettings 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 *ChimeSDKVoice) UpdateGlobalSettingsWithContext(ctx aws.Context, input *UpdateGlobalSettingsInput, opts ...request.Option) (*UpdateGlobalSettingsOutput, error) { - req, out := c.UpdateGlobalSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePhoneNumber = "UpdatePhoneNumber" - -// UpdatePhoneNumberRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePhoneNumber 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 UpdatePhoneNumber for more information on using the UpdatePhoneNumber -// 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 UpdatePhoneNumberRequest method. -// req, resp := client.UpdatePhoneNumberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdatePhoneNumber -func (c *ChimeSDKVoice) UpdatePhoneNumberRequest(input *UpdatePhoneNumberInput) (req *request.Request, output *UpdatePhoneNumberOutput) { - op := &request.Operation{ - Name: opUpdatePhoneNumber, - HTTPMethod: "POST", - HTTPPath: "/phone-numbers/{phoneNumberId}", - } - - if input == nil { - input = &UpdatePhoneNumberInput{} - } - - output = &UpdatePhoneNumberOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePhoneNumber API operation for Amazon Chime SDK Voice. -// -// Updates phone number details, such as product type or calling name, for the -// specified phone number ID. You can update one phone number detail at a time. -// For example, you can update either the product type or the calling name in -// one action. -// -// For numbers outside the U.S., you must use the Amazon Chime SDK SIP Media -// Application Dial-In product type. -// -// Updates to outbound calling names can take 72 hours to complete. Pending -// updates to outbound calling names must be complete before you can request -// another update. -// -// 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 Chime SDK Voice's -// API operation UpdatePhoneNumber for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdatePhoneNumber -func (c *ChimeSDKVoice) UpdatePhoneNumber(input *UpdatePhoneNumberInput) (*UpdatePhoneNumberOutput, error) { - req, out := c.UpdatePhoneNumberRequest(input) - return out, req.Send() -} - -// UpdatePhoneNumberWithContext is the same as UpdatePhoneNumber with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePhoneNumber 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 *ChimeSDKVoice) UpdatePhoneNumberWithContext(ctx aws.Context, input *UpdatePhoneNumberInput, opts ...request.Option) (*UpdatePhoneNumberOutput, error) { - req, out := c.UpdatePhoneNumberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePhoneNumberSettings = "UpdatePhoneNumberSettings" - -// UpdatePhoneNumberSettingsRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePhoneNumberSettings 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 UpdatePhoneNumberSettings for more information on using the UpdatePhoneNumberSettings -// 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 UpdatePhoneNumberSettingsRequest method. -// req, resp := client.UpdatePhoneNumberSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdatePhoneNumberSettings -func (c *ChimeSDKVoice) UpdatePhoneNumberSettingsRequest(input *UpdatePhoneNumberSettingsInput) (req *request.Request, output *UpdatePhoneNumberSettingsOutput) { - op := &request.Operation{ - Name: opUpdatePhoneNumberSettings, - HTTPMethod: "PUT", - HTTPPath: "/settings/phone-number", - } - - if input == nil { - input = &UpdatePhoneNumberSettingsInput{} - } - - output = &UpdatePhoneNumberSettingsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdatePhoneNumberSettings API operation for Amazon Chime SDK Voice. -// -// Updates the phone number settings for the administrator's AWS account, such -// as the default outbound calling name. You can update the default outbound -// calling name once every seven days. Outbound calling names can take up to -// 72 hours to update. -// -// 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 Chime SDK Voice's -// API operation UpdatePhoneNumberSettings for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdatePhoneNumberSettings -func (c *ChimeSDKVoice) UpdatePhoneNumberSettings(input *UpdatePhoneNumberSettingsInput) (*UpdatePhoneNumberSettingsOutput, error) { - req, out := c.UpdatePhoneNumberSettingsRequest(input) - return out, req.Send() -} - -// UpdatePhoneNumberSettingsWithContext is the same as UpdatePhoneNumberSettings with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePhoneNumberSettings 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 *ChimeSDKVoice) UpdatePhoneNumberSettingsWithContext(ctx aws.Context, input *UpdatePhoneNumberSettingsInput, opts ...request.Option) (*UpdatePhoneNumberSettingsOutput, error) { - req, out := c.UpdatePhoneNumberSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateProxySession = "UpdateProxySession" - -// UpdateProxySessionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProxySession 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 UpdateProxySession for more information on using the UpdateProxySession -// 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 UpdateProxySessionRequest method. -// req, resp := client.UpdateProxySessionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateProxySession -func (c *ChimeSDKVoice) UpdateProxySessionRequest(input *UpdateProxySessionInput) (req *request.Request, output *UpdateProxySessionOutput) { - op := &request.Operation{ - Name: opUpdateProxySession, - HTTPMethod: "POST", - HTTPPath: "/voice-connectors/{voiceConnectorId}/proxy-sessions/{proxySessionId}", - } - - if input == nil { - input = &UpdateProxySessionInput{} - } - - output = &UpdateProxySessionOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateProxySession API operation for Amazon Chime SDK Voice. -// -// Updates the specified proxy session details, such as voice or SMS capabilities. -// -// 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 Chime SDK Voice's -// API operation UpdateProxySession for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateProxySession -func (c *ChimeSDKVoice) UpdateProxySession(input *UpdateProxySessionInput) (*UpdateProxySessionOutput, error) { - req, out := c.UpdateProxySessionRequest(input) - return out, req.Send() -} - -// UpdateProxySessionWithContext is the same as UpdateProxySession with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateProxySession 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 *ChimeSDKVoice) UpdateProxySessionWithContext(ctx aws.Context, input *UpdateProxySessionInput, opts ...request.Option) (*UpdateProxySessionOutput, error) { - req, out := c.UpdateProxySessionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSipMediaApplication = "UpdateSipMediaApplication" - -// UpdateSipMediaApplicationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSipMediaApplication 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 UpdateSipMediaApplication for more information on using the UpdateSipMediaApplication -// 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 UpdateSipMediaApplicationRequest method. -// req, resp := client.UpdateSipMediaApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateSipMediaApplication -func (c *ChimeSDKVoice) UpdateSipMediaApplicationRequest(input *UpdateSipMediaApplicationInput) (req *request.Request, output *UpdateSipMediaApplicationOutput) { - op := &request.Operation{ - Name: opUpdateSipMediaApplication, - HTTPMethod: "PUT", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}", - } - - if input == nil { - input = &UpdateSipMediaApplicationInput{} - } - - output = &UpdateSipMediaApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSipMediaApplication API operation for Amazon Chime SDK Voice. -// -// Updates the details of the specified SIP media application. -// -// 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 Chime SDK Voice's -// API operation UpdateSipMediaApplication for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateSipMediaApplication -func (c *ChimeSDKVoice) UpdateSipMediaApplication(input *UpdateSipMediaApplicationInput) (*UpdateSipMediaApplicationOutput, error) { - req, out := c.UpdateSipMediaApplicationRequest(input) - return out, req.Send() -} - -// UpdateSipMediaApplicationWithContext is the same as UpdateSipMediaApplication with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSipMediaApplication 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 *ChimeSDKVoice) UpdateSipMediaApplicationWithContext(ctx aws.Context, input *UpdateSipMediaApplicationInput, opts ...request.Option) (*UpdateSipMediaApplicationOutput, error) { - req, out := c.UpdateSipMediaApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSipMediaApplicationCall = "UpdateSipMediaApplicationCall" - -// UpdateSipMediaApplicationCallRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSipMediaApplicationCall 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 UpdateSipMediaApplicationCall for more information on using the UpdateSipMediaApplicationCall -// 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 UpdateSipMediaApplicationCallRequest method. -// req, resp := client.UpdateSipMediaApplicationCallRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateSipMediaApplicationCall -func (c *ChimeSDKVoice) UpdateSipMediaApplicationCallRequest(input *UpdateSipMediaApplicationCallInput) (req *request.Request, output *UpdateSipMediaApplicationCallOutput) { - op := &request.Operation{ - Name: opUpdateSipMediaApplicationCall, - HTTPMethod: "POST", - HTTPPath: "/sip-media-applications/{sipMediaApplicationId}/calls/{transactionId}", - } - - if input == nil { - input = &UpdateSipMediaApplicationCallInput{} - } - - output = &UpdateSipMediaApplicationCallOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSipMediaApplicationCall API operation for Amazon Chime SDK Voice. -// -// Invokes the AWS Lambda function associated with the SIP media application -// and transaction ID in an update request. The Lambda function can then return -// a new set of actions. -// -// 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 Chime SDK Voice's -// API operation UpdateSipMediaApplicationCall for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateSipMediaApplicationCall -func (c *ChimeSDKVoice) UpdateSipMediaApplicationCall(input *UpdateSipMediaApplicationCallInput) (*UpdateSipMediaApplicationCallOutput, error) { - req, out := c.UpdateSipMediaApplicationCallRequest(input) - return out, req.Send() -} - -// UpdateSipMediaApplicationCallWithContext is the same as UpdateSipMediaApplicationCall with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSipMediaApplicationCall 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 *ChimeSDKVoice) UpdateSipMediaApplicationCallWithContext(ctx aws.Context, input *UpdateSipMediaApplicationCallInput, opts ...request.Option) (*UpdateSipMediaApplicationCallOutput, error) { - req, out := c.UpdateSipMediaApplicationCallRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSipRule = "UpdateSipRule" - -// UpdateSipRuleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSipRule 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 UpdateSipRule for more information on using the UpdateSipRule -// 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 UpdateSipRuleRequest method. -// req, resp := client.UpdateSipRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateSipRule -func (c *ChimeSDKVoice) UpdateSipRuleRequest(input *UpdateSipRuleInput) (req *request.Request, output *UpdateSipRuleOutput) { - op := &request.Operation{ - Name: opUpdateSipRule, - HTTPMethod: "PUT", - HTTPPath: "/sip-rules/{sipRuleId}", - } - - if input == nil { - input = &UpdateSipRuleInput{} - } - - output = &UpdateSipRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSipRule API operation for Amazon Chime SDK Voice. -// -// Updates the details of the specified SIP rule. -// -// 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 Chime SDK Voice's -// API operation UpdateSipRule for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ResourceLimitExceededException -// The request exceeds the resource limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateSipRule -func (c *ChimeSDKVoice) UpdateSipRule(input *UpdateSipRuleInput) (*UpdateSipRuleOutput, error) { - req, out := c.UpdateSipRuleRequest(input) - return out, req.Send() -} - -// UpdateSipRuleWithContext is the same as UpdateSipRule with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSipRule 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 *ChimeSDKVoice) UpdateSipRuleWithContext(ctx aws.Context, input *UpdateSipRuleInput, opts ...request.Option) (*UpdateSipRuleOutput, error) { - req, out := c.UpdateSipRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateVoiceConnector = "UpdateVoiceConnector" - -// UpdateVoiceConnectorRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVoiceConnector 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 UpdateVoiceConnector for more information on using the UpdateVoiceConnector -// 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 UpdateVoiceConnectorRequest method. -// req, resp := client.UpdateVoiceConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateVoiceConnector -func (c *ChimeSDKVoice) UpdateVoiceConnectorRequest(input *UpdateVoiceConnectorInput) (req *request.Request, output *UpdateVoiceConnectorOutput) { - op := &request.Operation{ - Name: opUpdateVoiceConnector, - HTTPMethod: "PUT", - HTTPPath: "/voice-connectors/{voiceConnectorId}", - } - - if input == nil { - input = &UpdateVoiceConnectorInput{} - } - - output = &UpdateVoiceConnectorOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateVoiceConnector API operation for Amazon Chime SDK Voice. -// -// Updates the details for the specified Amazon Chime SDK Voice Connector. -// -// 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 Chime SDK Voice's -// API operation UpdateVoiceConnector for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateVoiceConnector -func (c *ChimeSDKVoice) UpdateVoiceConnector(input *UpdateVoiceConnectorInput) (*UpdateVoiceConnectorOutput, error) { - req, out := c.UpdateVoiceConnectorRequest(input) - return out, req.Send() -} - -// UpdateVoiceConnectorWithContext is the same as UpdateVoiceConnector with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateVoiceConnector 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 *ChimeSDKVoice) UpdateVoiceConnectorWithContext(ctx aws.Context, input *UpdateVoiceConnectorInput, opts ...request.Option) (*UpdateVoiceConnectorOutput, error) { - req, out := c.UpdateVoiceConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateVoiceConnectorGroup = "UpdateVoiceConnectorGroup" - -// UpdateVoiceConnectorGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVoiceConnectorGroup 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 UpdateVoiceConnectorGroup for more information on using the UpdateVoiceConnectorGroup -// 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 UpdateVoiceConnectorGroupRequest method. -// req, resp := client.UpdateVoiceConnectorGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateVoiceConnectorGroup -func (c *ChimeSDKVoice) UpdateVoiceConnectorGroupRequest(input *UpdateVoiceConnectorGroupInput) (req *request.Request, output *UpdateVoiceConnectorGroupOutput) { - op := &request.Operation{ - Name: opUpdateVoiceConnectorGroup, - HTTPMethod: "PUT", - HTTPPath: "/voice-connector-groups/{voiceConnectorGroupId}", - } - - if input == nil { - input = &UpdateVoiceConnectorGroupInput{} - } - - output = &UpdateVoiceConnectorGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateVoiceConnectorGroup API operation for Amazon Chime SDK Voice. -// -// Updates the settings for the specified Amazon Chime SDK Voice Connector group. -// -// 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 Chime SDK Voice's -// API operation UpdateVoiceConnectorGroup for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateVoiceConnectorGroup -func (c *ChimeSDKVoice) UpdateVoiceConnectorGroup(input *UpdateVoiceConnectorGroupInput) (*UpdateVoiceConnectorGroupOutput, error) { - req, out := c.UpdateVoiceConnectorGroupRequest(input) - return out, req.Send() -} - -// UpdateVoiceConnectorGroupWithContext is the same as UpdateVoiceConnectorGroup with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateVoiceConnectorGroup 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 *ChimeSDKVoice) UpdateVoiceConnectorGroupWithContext(ctx aws.Context, input *UpdateVoiceConnectorGroupInput, opts ...request.Option) (*UpdateVoiceConnectorGroupOutput, error) { - req, out := c.UpdateVoiceConnectorGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateVoiceProfile = "UpdateVoiceProfile" - -// UpdateVoiceProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVoiceProfile 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 UpdateVoiceProfile for more information on using the UpdateVoiceProfile -// 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 UpdateVoiceProfileRequest method. -// req, resp := client.UpdateVoiceProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateVoiceProfile -func (c *ChimeSDKVoice) UpdateVoiceProfileRequest(input *UpdateVoiceProfileInput) (req *request.Request, output *UpdateVoiceProfileOutput) { - op := &request.Operation{ - Name: opUpdateVoiceProfile, - HTTPMethod: "PUT", - HTTPPath: "/voice-profiles/{VoiceProfileId}", - } - - if input == nil { - input = &UpdateVoiceProfileInput{} - } - - output = &UpdateVoiceProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateVoiceProfile API operation for Amazon Chime SDK Voice. -// -// Updates the specified voice profile’s voice print and refreshes its expiration -// timestamp. -// -// As a condition of using this feature, you acknowledge that the collection, -// use, storage, and retention of your caller’s biometric identifiers and -// biometric information (“biometric data”) in the form of a digital voiceprint -// requires the caller’s informed consent via a written release. Such consent -// is required under various state laws, including biometrics laws in Illinois, -// Texas, Washington and other state privacy laws. -// -// You must provide a written release to each caller through a process that -// clearly reflects each caller’s informed consent before using Amazon Chime -// SDK Voice Insights service, as required under the terms of your agreement -// with AWS governing your use of the 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 Chime SDK Voice's -// API operation UpdateVoiceProfile for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ConflictException -// Multiple instances of the same request were made simultaneously. -// -// - GoneException -// Access to the target resource is no longer available at the origin server. -// This condition is likely to be permanent. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateVoiceProfile -func (c *ChimeSDKVoice) UpdateVoiceProfile(input *UpdateVoiceProfileInput) (*UpdateVoiceProfileOutput, error) { - req, out := c.UpdateVoiceProfileRequest(input) - return out, req.Send() -} - -// UpdateVoiceProfileWithContext is the same as UpdateVoiceProfile with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateVoiceProfile 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 *ChimeSDKVoice) UpdateVoiceProfileWithContext(ctx aws.Context, input *UpdateVoiceProfileInput, opts ...request.Option) (*UpdateVoiceProfileOutput, error) { - req, out := c.UpdateVoiceProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateVoiceProfileDomain = "UpdateVoiceProfileDomain" - -// UpdateVoiceProfileDomainRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVoiceProfileDomain 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 UpdateVoiceProfileDomain for more information on using the UpdateVoiceProfileDomain -// 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 UpdateVoiceProfileDomainRequest method. -// req, resp := client.UpdateVoiceProfileDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateVoiceProfileDomain -func (c *ChimeSDKVoice) UpdateVoiceProfileDomainRequest(input *UpdateVoiceProfileDomainInput) (req *request.Request, output *UpdateVoiceProfileDomainOutput) { - op := &request.Operation{ - Name: opUpdateVoiceProfileDomain, - HTTPMethod: "PUT", - HTTPPath: "/voice-profile-domains/{VoiceProfileDomainId}", - } - - if input == nil { - input = &UpdateVoiceProfileDomainInput{} - } - - output = &UpdateVoiceProfileDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateVoiceProfileDomain API operation for Amazon Chime SDK Voice. -// -// Updates the settings for the specified voice profile domain. -// -// 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 Chime SDK Voice's -// API operation UpdateVoiceProfileDomain for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - AccessDeniedException -// You don't have the permissions needed to run this action. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/UpdateVoiceProfileDomain -func (c *ChimeSDKVoice) UpdateVoiceProfileDomain(input *UpdateVoiceProfileDomainInput) (*UpdateVoiceProfileDomainOutput, error) { - req, out := c.UpdateVoiceProfileDomainRequest(input) - return out, req.Send() -} - -// UpdateVoiceProfileDomainWithContext is the same as UpdateVoiceProfileDomain with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateVoiceProfileDomain 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 *ChimeSDKVoice) UpdateVoiceProfileDomainWithContext(ctx aws.Context, input *UpdateVoiceProfileDomainInput, opts ...request.Option) (*UpdateVoiceProfileDomainOutput, error) { - req, out := c.UpdateVoiceProfileDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opValidateE911Address = "ValidateE911Address" - -// ValidateE911AddressRequest generates a "aws/request.Request" representing the -// client's request for the ValidateE911Address 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 ValidateE911Address for more information on using the ValidateE911Address -// 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 ValidateE911AddressRequest method. -// req, resp := client.ValidateE911AddressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ValidateE911Address -func (c *ChimeSDKVoice) ValidateE911AddressRequest(input *ValidateE911AddressInput) (req *request.Request, output *ValidateE911AddressOutput) { - op := &request.Operation{ - Name: opValidateE911Address, - HTTPMethod: "POST", - HTTPPath: "/emergency-calling/address", - } - - if input == nil { - input = &ValidateE911AddressInput{} - } - - output = &ValidateE911AddressOutput{} - req = c.newRequest(op, input, output) - return -} - -// ValidateE911Address API operation for Amazon Chime SDK Voice. -// -// Validates an address to be used for 911 calls made with Amazon Chime SDK -// Voice Connectors. You can use validated addresses in a Presence Information -// Data Format Location Object file that you include in SIP requests. That helps -// ensure that addresses are routed to the appropriate Public Safety Answering -// Point. -// -// 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 Chime SDK Voice's -// API operation ValidateE911Address for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedClientException -// The client isn't authorized to request a resource. -// -// - NotFoundException -// The requested resource couldn't be found. -// -// - ForbiddenException -// The client is permanently forbidden from making the request. -// -// - BadRequestException -// The input parameters don't match the service's restrictions. -// -// - ThrottledClientException -// The number of customer requests exceeds the request rate limit. -// -// - ServiceUnavailableException -// The service is currently unavailable. -// -// - ServiceFailureException -// The service encountered an unexpected error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/ValidateE911Address -func (c *ChimeSDKVoice) ValidateE911Address(input *ValidateE911AddressInput) (*ValidateE911AddressOutput, error) { - req, out := c.ValidateE911AddressRequest(input) - return out, req.Send() -} - -// ValidateE911AddressWithContext is the same as ValidateE911Address with the addition of -// the ability to pass a context and additional request options. -// -// See ValidateE911Address 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 *ChimeSDKVoice) ValidateE911AddressWithContext(ctx aws.Context, input *ValidateE911AddressInput, opts ...request.Option) (*ValidateE911AddressOutput, error) { - req, out := c.ValidateE911AddressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have the permissions needed to run this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A validated address. -type Address struct { - _ struct{} `type:"structure"` - - // The city of an address. - // - // City is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - City *string `locationName:"city" type:"string" sensitive:"true"` - - // The country of an address. - // - // Country is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - Country *string `locationName:"country" type:"string" sensitive:"true"` - - // An address suffix location, such as the S. Unit A in Central Park S. Unit - // A. - // - // PostDirectional is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - PostDirectional *string `locationName:"postDirectional" type:"string" sensitive:"true"` - - // The postal code of an address. - // - // PostalCode is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - PostalCode *string `locationName:"postalCode" type:"string" sensitive:"true"` - - // The zip + 4 or postal code + 4 of an address. - // - // PostalCodePlus4 is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - PostalCodePlus4 *string `locationName:"postalCodePlus4" type:"string" sensitive:"true"` - - // An address prefix location, such as the N in N. Third St. - // - // PreDirectional is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - PreDirectional *string `locationName:"preDirectional" type:"string" sensitive:"true"` - - // The state of an address. - // - // State is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - State *string `locationName:"state" type:"string" sensitive:"true"` - - // The address street, such as 8th Avenue. - // - // StreetName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - StreetName *string `locationName:"streetName" type:"string" sensitive:"true"` - - // The numeric portion of an address. - // - // StreetNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - StreetNumber *string `locationName:"streetNumber" type:"string" sensitive:"true"` - - // The address suffix, such as the N in 8th Avenue N. - // - // StreetSuffix is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - StreetSuffix *string `locationName:"streetSuffix" type:"string" sensitive:"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 Address) 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 Address) GoString() string { - return s.String() -} - -// SetCity sets the City field's value. -func (s *Address) SetCity(v string) *Address { - s.City = &v - return s -} - -// SetCountry sets the Country field's value. -func (s *Address) SetCountry(v string) *Address { - s.Country = &v - return s -} - -// SetPostDirectional sets the PostDirectional field's value. -func (s *Address) SetPostDirectional(v string) *Address { - s.PostDirectional = &v - return s -} - -// SetPostalCode sets the PostalCode field's value. -func (s *Address) SetPostalCode(v string) *Address { - s.PostalCode = &v - return s -} - -// SetPostalCodePlus4 sets the PostalCodePlus4 field's value. -func (s *Address) SetPostalCodePlus4(v string) *Address { - s.PostalCodePlus4 = &v - return s -} - -// SetPreDirectional sets the PreDirectional field's value. -func (s *Address) SetPreDirectional(v string) *Address { - s.PreDirectional = &v - return s -} - -// SetState sets the State field's value. -func (s *Address) SetState(v string) *Address { - s.State = &v - return s -} - -// SetStreetName sets the StreetName field's value. -func (s *Address) SetStreetName(v string) *Address { - s.StreetName = &v - return s -} - -// SetStreetNumber sets the StreetNumber field's value. -func (s *Address) SetStreetNumber(v string) *Address { - s.StreetNumber = &v - return s -} - -// SetStreetSuffix sets the StreetSuffix field's value. -func (s *Address) SetStreetSuffix(v string) *Address { - s.StreetSuffix = &v - return s -} - -type AssociatePhoneNumbersWithVoiceConnectorGroupInput struct { - _ struct{} `type:"structure"` - - // List of phone numbers, in E.164 format. - // - // E164PhoneNumbers is a required field - E164PhoneNumbers []*string `type:"list" required:"true"` - - // If true, associates the provided phone numbers with the provided Amazon Chime - // SDK Voice Connector Group and removes any previously existing associations. - // If false, does not associate any phone numbers that have previously existing - // associations. - ForceAssociate *bool `type:"boolean"` - - // The Amazon Chime SDK Voice Connector group ID. - // - // VoiceConnectorGroupId is a required field - VoiceConnectorGroupId *string `location:"uri" locationName:"voiceConnectorGroupId" 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 AssociatePhoneNumbersWithVoiceConnectorGroupInput) 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 AssociatePhoneNumbersWithVoiceConnectorGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociatePhoneNumbersWithVoiceConnectorGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociatePhoneNumbersWithVoiceConnectorGroupInput"} - if s.E164PhoneNumbers == nil { - invalidParams.Add(request.NewErrParamRequired("E164PhoneNumbers")) - } - if s.VoiceConnectorGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorGroupId")) - } - if s.VoiceConnectorGroupId != nil && len(*s.VoiceConnectorGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorGroupId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetE164PhoneNumbers sets the E164PhoneNumbers field's value. -func (s *AssociatePhoneNumbersWithVoiceConnectorGroupInput) SetE164PhoneNumbers(v []*string) *AssociatePhoneNumbersWithVoiceConnectorGroupInput { - s.E164PhoneNumbers = v - return s -} - -// SetForceAssociate sets the ForceAssociate field's value. -func (s *AssociatePhoneNumbersWithVoiceConnectorGroupInput) SetForceAssociate(v bool) *AssociatePhoneNumbersWithVoiceConnectorGroupInput { - s.ForceAssociate = &v - return s -} - -// SetVoiceConnectorGroupId sets the VoiceConnectorGroupId field's value. -func (s *AssociatePhoneNumbersWithVoiceConnectorGroupInput) SetVoiceConnectorGroupId(v string) *AssociatePhoneNumbersWithVoiceConnectorGroupInput { - s.VoiceConnectorGroupId = &v - return s -} - -type AssociatePhoneNumbersWithVoiceConnectorGroupOutput struct { - _ struct{} `type:"structure"` - - // If the action fails for one or more of the phone numbers in the request, - // a list of the phone numbers is returned, along with error codes and error - // messages. - PhoneNumberErrors []*PhoneNumberError `type:"list"` -} - -// 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 AssociatePhoneNumbersWithVoiceConnectorGroupOutput) 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 AssociatePhoneNumbersWithVoiceConnectorGroupOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberErrors sets the PhoneNumberErrors field's value. -func (s *AssociatePhoneNumbersWithVoiceConnectorGroupOutput) SetPhoneNumberErrors(v []*PhoneNumberError) *AssociatePhoneNumbersWithVoiceConnectorGroupOutput { - s.PhoneNumberErrors = v - return s -} - -type AssociatePhoneNumbersWithVoiceConnectorInput struct { - _ struct{} `type:"structure"` - - // List of phone numbers, in E.164 format. - // - // E164PhoneNumbers is a required field - E164PhoneNumbers []*string `type:"list" required:"true"` - - // If true, associates the provided phone numbers with the provided Amazon Chime - // SDK Voice Connector and removes any previously existing associations. If - // false, does not associate any phone numbers that have previously existing - // associations. - ForceAssociate *bool `type:"boolean"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 AssociatePhoneNumbersWithVoiceConnectorInput) 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 AssociatePhoneNumbersWithVoiceConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociatePhoneNumbersWithVoiceConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociatePhoneNumbersWithVoiceConnectorInput"} - if s.E164PhoneNumbers == nil { - invalidParams.Add(request.NewErrParamRequired("E164PhoneNumbers")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetE164PhoneNumbers sets the E164PhoneNumbers field's value. -func (s *AssociatePhoneNumbersWithVoiceConnectorInput) SetE164PhoneNumbers(v []*string) *AssociatePhoneNumbersWithVoiceConnectorInput { - s.E164PhoneNumbers = v - return s -} - -// SetForceAssociate sets the ForceAssociate field's value. -func (s *AssociatePhoneNumbersWithVoiceConnectorInput) SetForceAssociate(v bool) *AssociatePhoneNumbersWithVoiceConnectorInput { - s.ForceAssociate = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *AssociatePhoneNumbersWithVoiceConnectorInput) SetVoiceConnectorId(v string) *AssociatePhoneNumbersWithVoiceConnectorInput { - s.VoiceConnectorId = &v - return s -} - -type AssociatePhoneNumbersWithVoiceConnectorOutput struct { - _ struct{} `type:"structure"` - - // If the action fails for one or more of the phone numbers in the request, - // a list of the phone numbers is returned, along with error codes and error - // messages. - PhoneNumberErrors []*PhoneNumberError `type:"list"` -} - -// 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 AssociatePhoneNumbersWithVoiceConnectorOutput) 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 AssociatePhoneNumbersWithVoiceConnectorOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberErrors sets the PhoneNumberErrors field's value. -func (s *AssociatePhoneNumbersWithVoiceConnectorOutput) SetPhoneNumberErrors(v []*PhoneNumberError) *AssociatePhoneNumbersWithVoiceConnectorOutput { - s.PhoneNumberErrors = v - return s -} - -// The input parameters don't match the service's restrictions. -type BadRequestException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 BadRequestException) 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 BadRequestException) GoString() string { - return s.String() -} - -func newErrorBadRequestException(v protocol.ResponseMetadata) error { - return &BadRequestException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *BadRequestException) Code() string { - return "BadRequestException" -} - -// Message returns the exception's message. -func (s *BadRequestException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *BadRequestException) OrigErr() error { - return nil -} - -func (s *BadRequestException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *BadRequestException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *BadRequestException) RequestID() string { - return s.RespMetadata.RequestID -} - -type BatchDeletePhoneNumberInput struct { - _ struct{} `type:"structure"` - - // List of phone number IDs. - // - // PhoneNumberIds is a required field - PhoneNumberIds []*string `min:"1" type:"list" 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 BatchDeletePhoneNumberInput) 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 BatchDeletePhoneNumberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchDeletePhoneNumberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchDeletePhoneNumberInput"} - if s.PhoneNumberIds == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumberIds")) - } - if s.PhoneNumberIds != nil && len(s.PhoneNumberIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PhoneNumberIds", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPhoneNumberIds sets the PhoneNumberIds field's value. -func (s *BatchDeletePhoneNumberInput) SetPhoneNumberIds(v []*string) *BatchDeletePhoneNumberInput { - s.PhoneNumberIds = v - return s -} - -type BatchDeletePhoneNumberOutput struct { - _ struct{} `type:"structure"` - - // If the action fails for one or more of the phone numbers in the request, - // a list of the phone numbers is returned, along with error codes and error - // messages. - PhoneNumberErrors []*PhoneNumberError `type:"list"` -} - -// 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 BatchDeletePhoneNumberOutput) 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 BatchDeletePhoneNumberOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberErrors sets the PhoneNumberErrors field's value. -func (s *BatchDeletePhoneNumberOutput) SetPhoneNumberErrors(v []*PhoneNumberError) *BatchDeletePhoneNumberOutput { - s.PhoneNumberErrors = v - return s -} - -type BatchUpdatePhoneNumberInput struct { - _ struct{} `type:"structure"` - - // Lists the phone numbers in the update request. - // - // UpdatePhoneNumberRequestItems is a required field - UpdatePhoneNumberRequestItems []*UpdatePhoneNumberRequestItem `type:"list" 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 BatchUpdatePhoneNumberInput) 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 BatchUpdatePhoneNumberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchUpdatePhoneNumberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchUpdatePhoneNumberInput"} - if s.UpdatePhoneNumberRequestItems == nil { - invalidParams.Add(request.NewErrParamRequired("UpdatePhoneNumberRequestItems")) - } - if s.UpdatePhoneNumberRequestItems != nil { - for i, v := range s.UpdatePhoneNumberRequestItems { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UpdatePhoneNumberRequestItems", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUpdatePhoneNumberRequestItems sets the UpdatePhoneNumberRequestItems field's value. -func (s *BatchUpdatePhoneNumberInput) SetUpdatePhoneNumberRequestItems(v []*UpdatePhoneNumberRequestItem) *BatchUpdatePhoneNumberInput { - s.UpdatePhoneNumberRequestItems = v - return s -} - -type BatchUpdatePhoneNumberOutput struct { - _ struct{} `type:"structure"` - - // A list of failed phone numbers and their error messages. - PhoneNumberErrors []*PhoneNumberError `type:"list"` -} - -// 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 BatchUpdatePhoneNumberOutput) 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 BatchUpdatePhoneNumberOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberErrors sets the PhoneNumberErrors field's value. -func (s *BatchUpdatePhoneNumberOutput) SetPhoneNumberErrors(v []*PhoneNumberError) *BatchUpdatePhoneNumberOutput { - s.PhoneNumberErrors = v - return s -} - -// The details of an Amazon Chime SDK Voice Connector call. -type CallDetails struct { - _ struct{} `type:"structure"` - - // Identifies a person as the caller or the callee. - IsCaller *bool `type:"boolean"` - - // The transaction ID of a Voice Connector call. - TransactionId *string `min:"1" type:"string"` - - // The Voice Connector ID. - VoiceConnectorId *string `min:"1" 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 CallDetails) 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 CallDetails) GoString() string { - return s.String() -} - -// SetIsCaller sets the IsCaller field's value. -func (s *CallDetails) SetIsCaller(v bool) *CallDetails { - s.IsCaller = &v - return s -} - -// SetTransactionId sets the TransactionId field's value. -func (s *CallDetails) SetTransactionId(v string) *CallDetails { - s.TransactionId = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *CallDetails) SetVoiceConnectorId(v string) *CallDetails { - s.VoiceConnectorId = &v - return s -} - -// A suggested address. -type CandidateAddress struct { - _ struct{} `type:"structure"` - - // The city of the candidate address. - // - // City is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CandidateAddress's - // String and GoString methods. - City *string `locationName:"city" type:"string" sensitive:"true"` - - // The country of the candidate address. - // - // Country is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CandidateAddress's - // String and GoString methods. - Country *string `locationName:"country" type:"string" sensitive:"true"` - - // The postal code of the candidate address. - // - // PostalCode is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CandidateAddress's - // String and GoString methods. - PostalCode *string `locationName:"postalCode" type:"string" sensitive:"true"` - - // The zip + 4 or postal code +4 of the candidate address. - // - // PostalCodePlus4 is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CandidateAddress's - // String and GoString methods. - PostalCodePlus4 *string `locationName:"postalCodePlus4" type:"string" sensitive:"true"` - - // The state of the candidate address. - // - // State is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CandidateAddress's - // String and GoString methods. - State *string `locationName:"state" type:"string" sensitive:"true"` - - // The street information of the candidate address. - // - // StreetInfo is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CandidateAddress's - // String and GoString methods. - StreetInfo *string `locationName:"streetInfo" type:"string" sensitive:"true"` - - // The numeric portion of the candidate address. - // - // StreetNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CandidateAddress's - // String and GoString methods. - StreetNumber *string `locationName:"streetNumber" type:"string" sensitive:"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 CandidateAddress) 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 CandidateAddress) GoString() string { - return s.String() -} - -// SetCity sets the City field's value. -func (s *CandidateAddress) SetCity(v string) *CandidateAddress { - s.City = &v - return s -} - -// SetCountry sets the Country field's value. -func (s *CandidateAddress) SetCountry(v string) *CandidateAddress { - s.Country = &v - return s -} - -// SetPostalCode sets the PostalCode field's value. -func (s *CandidateAddress) SetPostalCode(v string) *CandidateAddress { - s.PostalCode = &v - return s -} - -// SetPostalCodePlus4 sets the PostalCodePlus4 field's value. -func (s *CandidateAddress) SetPostalCodePlus4(v string) *CandidateAddress { - s.PostalCodePlus4 = &v - return s -} - -// SetState sets the State field's value. -func (s *CandidateAddress) SetState(v string) *CandidateAddress { - s.State = &v - return s -} - -// SetStreetInfo sets the StreetInfo field's value. -func (s *CandidateAddress) SetStreetInfo(v string) *CandidateAddress { - s.StreetInfo = &v - return s -} - -// SetStreetNumber sets the StreetNumber field's value. -func (s *CandidateAddress) SetStreetNumber(v string) *CandidateAddress { - s.StreetNumber = &v - return s -} - -// Multiple instances of the same request were made simultaneously. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreatePhoneNumberOrderInput struct { - _ struct{} `type:"structure"` - - // List of phone numbers, in E.164 format. - // - // E164PhoneNumbers is a required field - E164PhoneNumbers []*string `type:"list" required:"true"` - - // Specifies the name assigned to one or more phone numbers. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreatePhoneNumberOrderInput's - // String and GoString methods. - Name *string `type:"string" sensitive:"true"` - - // The phone number product type. - // - // ProductType is a required field - ProductType *string `type:"string" required:"true" enum:"PhoneNumberProductType"` -} - -// 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 CreatePhoneNumberOrderInput) 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 CreatePhoneNumberOrderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePhoneNumberOrderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePhoneNumberOrderInput"} - if s.E164PhoneNumbers == nil { - invalidParams.Add(request.NewErrParamRequired("E164PhoneNumbers")) - } - if s.ProductType == nil { - invalidParams.Add(request.NewErrParamRequired("ProductType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetE164PhoneNumbers sets the E164PhoneNumbers field's value. -func (s *CreatePhoneNumberOrderInput) SetE164PhoneNumbers(v []*string) *CreatePhoneNumberOrderInput { - s.E164PhoneNumbers = v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePhoneNumberOrderInput) SetName(v string) *CreatePhoneNumberOrderInput { - s.Name = &v - return s -} - -// SetProductType sets the ProductType field's value. -func (s *CreatePhoneNumberOrderInput) SetProductType(v string) *CreatePhoneNumberOrderInput { - s.ProductType = &v - return s -} - -type CreatePhoneNumberOrderOutput struct { - _ struct{} `type:"structure"` - - // The phone number order details. - PhoneNumberOrder *PhoneNumberOrder `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 CreatePhoneNumberOrderOutput) 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 CreatePhoneNumberOrderOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberOrder sets the PhoneNumberOrder field's value. -func (s *CreatePhoneNumberOrderOutput) SetPhoneNumberOrder(v *PhoneNumberOrder) *CreatePhoneNumberOrderOutput { - s.PhoneNumberOrder = v - return s -} - -type CreateProxySessionInput struct { - _ struct{} `type:"structure"` - - // The proxy session's capabilities. - // - // Capabilities is a required field - Capabilities []*string `type:"list" required:"true" enum:"Capability"` - - // The number of minutes allowed for the proxy session. - ExpiryMinutes *int64 `min:"1" type:"integer"` - - // The preference for matching the country or area code of the proxy phone number - // with that of the first participant. - GeoMatchLevel *string `type:"string" enum:"GeoMatchLevel"` - - // The country and area code for the proxy phone number. - GeoMatchParams *GeoMatchParams `type:"structure"` - - // The name of the proxy session. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProxySessionInput's - // String and GoString methods. - Name *string `type:"string" sensitive:"true"` - - // The preference for proxy phone number reuse, or stickiness, between the same - // participants across sessions. - NumberSelectionBehavior *string `type:"string" enum:"NumberSelectionBehavior"` - - // The participant phone numbers. - // - // ParticipantPhoneNumbers is a required field - ParticipantPhoneNumbers []*string `min:"2" type:"list" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" min:"1" 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 CreateProxySessionInput) 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 CreateProxySessionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateProxySessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateProxySessionInput"} - if s.Capabilities == nil { - invalidParams.Add(request.NewErrParamRequired("Capabilities")) - } - if s.ExpiryMinutes != nil && *s.ExpiryMinutes < 1 { - invalidParams.Add(request.NewErrParamMinValue("ExpiryMinutes", 1)) - } - if s.ParticipantPhoneNumbers == nil { - invalidParams.Add(request.NewErrParamRequired("ParticipantPhoneNumbers")) - } - if s.ParticipantPhoneNumbers != nil && len(s.ParticipantPhoneNumbers) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ParticipantPhoneNumbers", 2)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - if s.GeoMatchParams != nil { - if err := s.GeoMatchParams.Validate(); err != nil { - invalidParams.AddNested("GeoMatchParams", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilities sets the Capabilities field's value. -func (s *CreateProxySessionInput) SetCapabilities(v []*string) *CreateProxySessionInput { - s.Capabilities = v - return s -} - -// SetExpiryMinutes sets the ExpiryMinutes field's value. -func (s *CreateProxySessionInput) SetExpiryMinutes(v int64) *CreateProxySessionInput { - s.ExpiryMinutes = &v - return s -} - -// SetGeoMatchLevel sets the GeoMatchLevel field's value. -func (s *CreateProxySessionInput) SetGeoMatchLevel(v string) *CreateProxySessionInput { - s.GeoMatchLevel = &v - return s -} - -// SetGeoMatchParams sets the GeoMatchParams field's value. -func (s *CreateProxySessionInput) SetGeoMatchParams(v *GeoMatchParams) *CreateProxySessionInput { - s.GeoMatchParams = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateProxySessionInput) SetName(v string) *CreateProxySessionInput { - s.Name = &v - return s -} - -// SetNumberSelectionBehavior sets the NumberSelectionBehavior field's value. -func (s *CreateProxySessionInput) SetNumberSelectionBehavior(v string) *CreateProxySessionInput { - s.NumberSelectionBehavior = &v - return s -} - -// SetParticipantPhoneNumbers sets the ParticipantPhoneNumbers field's value. -func (s *CreateProxySessionInput) SetParticipantPhoneNumbers(v []*string) *CreateProxySessionInput { - s.ParticipantPhoneNumbers = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *CreateProxySessionInput) SetVoiceConnectorId(v string) *CreateProxySessionInput { - s.VoiceConnectorId = &v - return s -} - -type CreateProxySessionOutput struct { - _ struct{} `type:"structure"` - - // The proxy session details. - ProxySession *ProxySession `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 CreateProxySessionOutput) 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 CreateProxySessionOutput) GoString() string { - return s.String() -} - -// SetProxySession sets the ProxySession field's value. -func (s *CreateProxySessionOutput) SetProxySession(v *ProxySession) *CreateProxySessionOutput { - s.ProxySession = v - return s -} - -type CreateSipMediaApplicationCallInput struct { - _ struct{} `type:"structure"` - - // Context passed to a CreateSipMediaApplication API call. For example, you - // could pass key-value pairs such as: "FirstName": "John", "LastName": "Doe" - ArgumentsMap map[string]*string `type:"map"` - - // The phone number that a user calls from. This is a phone number in your Amazon - // Chime SDK phone number inventory. - // - // FromPhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSipMediaApplicationCallInput's - // String and GoString methods. - // - // FromPhoneNumber is a required field - FromPhoneNumber *string `type:"string" required:"true" sensitive:"true"` - - // The SIP headers added to an outbound call leg. - SipHeaders map[string]*string `type:"map"` - - // The ID of the SIP media application. - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" type:"string" required:"true"` - - // The phone number that the service should call. - // - // ToPhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSipMediaApplicationCallInput's - // String and GoString methods. - // - // ToPhoneNumber is a required field - ToPhoneNumber *string `type:"string" required:"true" sensitive:"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 CreateSipMediaApplicationCallInput) 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 CreateSipMediaApplicationCallInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSipMediaApplicationCallInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSipMediaApplicationCallInput"} - if s.FromPhoneNumber == nil { - invalidParams.Add(request.NewErrParamRequired("FromPhoneNumber")) - } - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - if s.ToPhoneNumber == nil { - invalidParams.Add(request.NewErrParamRequired("ToPhoneNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArgumentsMap sets the ArgumentsMap field's value. -func (s *CreateSipMediaApplicationCallInput) SetArgumentsMap(v map[string]*string) *CreateSipMediaApplicationCallInput { - s.ArgumentsMap = v - return s -} - -// SetFromPhoneNumber sets the FromPhoneNumber field's value. -func (s *CreateSipMediaApplicationCallInput) SetFromPhoneNumber(v string) *CreateSipMediaApplicationCallInput { - s.FromPhoneNumber = &v - return s -} - -// SetSipHeaders sets the SipHeaders field's value. -func (s *CreateSipMediaApplicationCallInput) SetSipHeaders(v map[string]*string) *CreateSipMediaApplicationCallInput { - s.SipHeaders = v - return s -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *CreateSipMediaApplicationCallInput) SetSipMediaApplicationId(v string) *CreateSipMediaApplicationCallInput { - s.SipMediaApplicationId = &v - return s -} - -// SetToPhoneNumber sets the ToPhoneNumber field's value. -func (s *CreateSipMediaApplicationCallInput) SetToPhoneNumber(v string) *CreateSipMediaApplicationCallInput { - s.ToPhoneNumber = &v - return s -} - -type CreateSipMediaApplicationCallOutput struct { - _ struct{} `type:"structure"` - - // The actual call. - SipMediaApplicationCall *SipMediaApplicationCall `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 CreateSipMediaApplicationCallOutput) 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 CreateSipMediaApplicationCallOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplicationCall sets the SipMediaApplicationCall field's value. -func (s *CreateSipMediaApplicationCallOutput) SetSipMediaApplicationCall(v *SipMediaApplicationCall) *CreateSipMediaApplicationCallOutput { - s.SipMediaApplicationCall = v - return s -} - -type CreateSipMediaApplicationInput struct { - _ struct{} `type:"structure"` - - // The AWS Region assigned to the SIP media application. - // - // AwsRegion is a required field - AwsRegion *string `type:"string" required:"true"` - - // List of endpoints (Lambda ARNs) specified for the SIP media application. - // - // Endpoints is a required field - Endpoints []*SipMediaApplicationEndpoint `min:"1" type:"list" required:"true"` - - // The SIP media application's name. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The tags assigned to the SIP media application. - Tags []*Tag `min:"1" type:"list"` -} - -// 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 CreateSipMediaApplicationInput) 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 CreateSipMediaApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSipMediaApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSipMediaApplicationInput"} - if s.AwsRegion == nil { - invalidParams.Add(request.NewErrParamRequired("AwsRegion")) - } - if s.Endpoints == nil { - invalidParams.Add(request.NewErrParamRequired("Endpoints")) - } - if s.Endpoints != nil && len(s.Endpoints) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Endpoints", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsRegion sets the AwsRegion field's value. -func (s *CreateSipMediaApplicationInput) SetAwsRegion(v string) *CreateSipMediaApplicationInput { - s.AwsRegion = &v - return s -} - -// SetEndpoints sets the Endpoints field's value. -func (s *CreateSipMediaApplicationInput) SetEndpoints(v []*SipMediaApplicationEndpoint) *CreateSipMediaApplicationInput { - s.Endpoints = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSipMediaApplicationInput) SetName(v string) *CreateSipMediaApplicationInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSipMediaApplicationInput) SetTags(v []*Tag) *CreateSipMediaApplicationInput { - s.Tags = v - return s -} - -type CreateSipMediaApplicationOutput struct { - _ struct{} `type:"structure"` - - // The SIP media application details. - SipMediaApplication *SipMediaApplication `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 CreateSipMediaApplicationOutput) 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 CreateSipMediaApplicationOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplication sets the SipMediaApplication field's value. -func (s *CreateSipMediaApplicationOutput) SetSipMediaApplication(v *SipMediaApplication) *CreateSipMediaApplicationOutput { - s.SipMediaApplication = v - return s -} - -type CreateSipRuleInput struct { - _ struct{} `type:"structure"` - - // Disables or enables a SIP rule. You must disable SIP rules before you can - // delete them. - Disabled *bool `type:"boolean"` - - // The name of the SIP rule. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // List of SIP media applications, with priority and AWS Region. Only one SIP - // application per AWS Region can be used. - TargetApplications []*SipRuleTargetApplication `min:"1" type:"list"` - - // The type of trigger assigned to the SIP rule in TriggerValue, currently RequestUriHostname - // or ToPhoneNumber. - // - // TriggerType is a required field - TriggerType *string `type:"string" required:"true" enum:"SipRuleTriggerType"` - - // If TriggerType is RequestUriHostname, the value can be the outbound host - // name of a Voice Connector. If TriggerType is ToPhoneNumber, the value can - // be a customer-owned phone number in the E164 format. The SipMediaApplication - // specified in the SipRule is triggered if the request URI in an incoming SIP - // request matches the RequestUriHostname, or if the To header in the incoming - // SIP request matches the ToPhoneNumber value. - // - // TriggerValue is a required field - TriggerValue *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 CreateSipRuleInput) 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 CreateSipRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSipRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSipRuleInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TargetApplications != nil && len(s.TargetApplications) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetApplications", 1)) - } - if s.TriggerType == nil { - invalidParams.Add(request.NewErrParamRequired("TriggerType")) - } - if s.TriggerValue == nil { - invalidParams.Add(request.NewErrParamRequired("TriggerValue")) - } - if s.TargetApplications != nil { - for i, v := range s.TargetApplications { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetApplications", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDisabled sets the Disabled field's value. -func (s *CreateSipRuleInput) SetDisabled(v bool) *CreateSipRuleInput { - s.Disabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSipRuleInput) SetName(v string) *CreateSipRuleInput { - s.Name = &v - return s -} - -// SetTargetApplications sets the TargetApplications field's value. -func (s *CreateSipRuleInput) SetTargetApplications(v []*SipRuleTargetApplication) *CreateSipRuleInput { - s.TargetApplications = v - return s -} - -// SetTriggerType sets the TriggerType field's value. -func (s *CreateSipRuleInput) SetTriggerType(v string) *CreateSipRuleInput { - s.TriggerType = &v - return s -} - -// SetTriggerValue sets the TriggerValue field's value. -func (s *CreateSipRuleInput) SetTriggerValue(v string) *CreateSipRuleInput { - s.TriggerValue = &v - return s -} - -type CreateSipRuleOutput struct { - _ struct{} `type:"structure"` - - // The SIP rule information, including the rule ID, triggers, and target applications. - SipRule *SipRule `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 CreateSipRuleOutput) 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 CreateSipRuleOutput) GoString() string { - return s.String() -} - -// SetSipRule sets the SipRule field's value. -func (s *CreateSipRuleOutput) SetSipRule(v *SipRule) *CreateSipRuleOutput { - s.SipRule = v - return s -} - -type CreateVoiceConnectorGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the Voice Connector group. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Lists the Voice Connectors that inbound calls are routed to. - VoiceConnectorItems []*VoiceConnectorItem `type:"list"` -} - -// 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 CreateVoiceConnectorGroupInput) 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 CreateVoiceConnectorGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVoiceConnectorGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVoiceConnectorGroupInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.VoiceConnectorItems != nil { - for i, v := range s.VoiceConnectorItems { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VoiceConnectorItems", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateVoiceConnectorGroupInput) SetName(v string) *CreateVoiceConnectorGroupInput { - s.Name = &v - return s -} - -// SetVoiceConnectorItems sets the VoiceConnectorItems field's value. -func (s *CreateVoiceConnectorGroupInput) SetVoiceConnectorItems(v []*VoiceConnectorItem) *CreateVoiceConnectorGroupInput { - s.VoiceConnectorItems = v - return s -} - -type CreateVoiceConnectorGroupOutput struct { - _ struct{} `type:"structure"` - - // The details of the Voice Connector group. - VoiceConnectorGroup *VoiceConnectorGroup `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 CreateVoiceConnectorGroupOutput) 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 CreateVoiceConnectorGroupOutput) GoString() string { - return s.String() -} - -// SetVoiceConnectorGroup sets the VoiceConnectorGroup field's value. -func (s *CreateVoiceConnectorGroupOutput) SetVoiceConnectorGroup(v *VoiceConnectorGroup) *CreateVoiceConnectorGroupOutput { - s.VoiceConnectorGroup = v - return s -} - -type CreateVoiceConnectorInput struct { - _ struct{} `type:"structure"` - - // The AWS Region in which the Amazon Chime SDK Voice Connector is created. - // Default value: us-east-1 . - AwsRegion *string `type:"string" enum:"VoiceConnectorAwsRegion"` - - // The name of the Voice Connector. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Enables or disables encryption for the Voice Connector. - // - // RequireEncryption is a required field - RequireEncryption *bool `type:"boolean" required:"true"` - - // The tags assigned to the Voice Connector. - Tags []*Tag `min:"1" type:"list"` -} - -// 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 CreateVoiceConnectorInput) 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 CreateVoiceConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVoiceConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVoiceConnectorInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RequireEncryption == nil { - invalidParams.Add(request.NewErrParamRequired("RequireEncryption")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsRegion sets the AwsRegion field's value. -func (s *CreateVoiceConnectorInput) SetAwsRegion(v string) *CreateVoiceConnectorInput { - s.AwsRegion = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateVoiceConnectorInput) SetName(v string) *CreateVoiceConnectorInput { - s.Name = &v - return s -} - -// SetRequireEncryption sets the RequireEncryption field's value. -func (s *CreateVoiceConnectorInput) SetRequireEncryption(v bool) *CreateVoiceConnectorInput { - s.RequireEncryption = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateVoiceConnectorInput) SetTags(v []*Tag) *CreateVoiceConnectorInput { - s.Tags = v - return s -} - -type CreateVoiceConnectorOutput struct { - _ struct{} `type:"structure"` - - // The details of the Voice Connector. - VoiceConnector *VoiceConnector `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 CreateVoiceConnectorOutput) 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 CreateVoiceConnectorOutput) GoString() string { - return s.String() -} - -// SetVoiceConnector sets the VoiceConnector field's value. -func (s *CreateVoiceConnectorOutput) SetVoiceConnector(v *VoiceConnector) *CreateVoiceConnectorOutput { - s.VoiceConnector = v - return s -} - -type CreateVoiceProfileDomainInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the client request. Use a different token for different - // domain creation requests. - ClientRequestToken *string `type:"string"` - - // A description of the voice profile domain. - Description *string `type:"string"` - - // The name of the voice profile domain. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The server-side encryption configuration for the request. - // - // ServerSideEncryptionConfiguration is a required field - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `type:"structure" required:"true"` - - // The tags assigned to the domain. - Tags []*Tag `min:"1" type:"list"` -} - -// 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 CreateVoiceProfileDomainInput) 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 CreateVoiceProfileDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVoiceProfileDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVoiceProfileDomainInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ServerSideEncryptionConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("ServerSideEncryptionConfiguration")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.ServerSideEncryptionConfiguration != nil { - if err := s.ServerSideEncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreateVoiceProfileDomainInput) SetClientRequestToken(v string) *CreateVoiceProfileDomainInput { - s.ClientRequestToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateVoiceProfileDomainInput) SetDescription(v string) *CreateVoiceProfileDomainInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateVoiceProfileDomainInput) SetName(v string) *CreateVoiceProfileDomainInput { - s.Name = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *CreateVoiceProfileDomainInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *CreateVoiceProfileDomainInput { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateVoiceProfileDomainInput) SetTags(v []*Tag) *CreateVoiceProfileDomainInput { - s.Tags = v - return s -} - -type CreateVoiceProfileDomainOutput struct { - _ struct{} `type:"structure"` - - // The requested voice profile domain. - VoiceProfileDomain *VoiceProfileDomain `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 CreateVoiceProfileDomainOutput) 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 CreateVoiceProfileDomainOutput) GoString() string { - return s.String() -} - -// SetVoiceProfileDomain sets the VoiceProfileDomain field's value. -func (s *CreateVoiceProfileDomainOutput) SetVoiceProfileDomain(v *VoiceProfileDomain) *CreateVoiceProfileDomainOutput { - s.VoiceProfileDomain = v - return s -} - -type CreateVoiceProfileInput struct { - _ struct{} `type:"structure"` - - // The ID of the speaker search task. - // - // SpeakerSearchTaskId is a required field - SpeakerSearchTaskId *string `min:"1" 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 CreateVoiceProfileInput) 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 CreateVoiceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVoiceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVoiceProfileInput"} - if s.SpeakerSearchTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("SpeakerSearchTaskId")) - } - if s.SpeakerSearchTaskId != nil && len(*s.SpeakerSearchTaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpeakerSearchTaskId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSpeakerSearchTaskId sets the SpeakerSearchTaskId field's value. -func (s *CreateVoiceProfileInput) SetSpeakerSearchTaskId(v string) *CreateVoiceProfileInput { - s.SpeakerSearchTaskId = &v - return s -} - -type CreateVoiceProfileOutput struct { - _ struct{} `type:"structure"` - - // The requested voice profile. - VoiceProfile *VoiceProfile `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 CreateVoiceProfileOutput) 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 CreateVoiceProfileOutput) GoString() string { - return s.String() -} - -// SetVoiceProfile sets the VoiceProfile field's value. -func (s *CreateVoiceProfileOutput) SetVoiceProfile(v *VoiceProfile) *CreateVoiceProfileOutput { - s.VoiceProfile = v - return s -} - -// The SIP credentials used to authenticate requests to an Amazon Chime SDK -// Voice Connector. -type Credential struct { - _ struct{} `type:"structure"` - - // The RFC2617 compliant password associated with the SIP credentials, in US-ASCII - // format. - // - // Password is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Credential's - // String and GoString methods. - Password *string `type:"string" sensitive:"true"` - - // The RFC2617 compliant user name associated with the SIP credentials, in US-ASCII - // format. - // - // Username is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Credential's - // String and GoString methods. - Username *string `type:"string" sensitive:"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 Credential) 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 Credential) GoString() string { - return s.String() -} - -// SetPassword sets the Password field's value. -func (s *Credential) SetPassword(v string) *Credential { - s.Password = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *Credential) SetUsername(v string) *Credential { - s.Username = &v - return s -} - -// The Dialed Number Identification Service (DNIS) emergency calling configuration -// details associated with an Amazon Chime SDK Voice Connector's emergency calling -// configuration. -type DNISEmergencyCallingConfiguration struct { - _ struct{} `type:"structure"` - - // The country from which emergency calls are allowed, in ISO 3166-1 alpha-2 - // format. - // - // CallingCountry is a required field - CallingCountry *string `type:"string" required:"true"` - - // The DNIS phone number that you route emergency calls to, in E.164 format. - // - // EmergencyPhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DNISEmergencyCallingConfiguration's - // String and GoString methods. - // - // EmergencyPhoneNumber is a required field - EmergencyPhoneNumber *string `type:"string" required:"true" sensitive:"true"` - - // The DNIS phone number for routing test emergency calls to, in E.164 format. - // - // TestPhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DNISEmergencyCallingConfiguration's - // String and GoString methods. - TestPhoneNumber *string `type:"string" sensitive:"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 DNISEmergencyCallingConfiguration) 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 DNISEmergencyCallingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DNISEmergencyCallingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DNISEmergencyCallingConfiguration"} - if s.CallingCountry == nil { - invalidParams.Add(request.NewErrParamRequired("CallingCountry")) - } - if s.EmergencyPhoneNumber == nil { - invalidParams.Add(request.NewErrParamRequired("EmergencyPhoneNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallingCountry sets the CallingCountry field's value. -func (s *DNISEmergencyCallingConfiguration) SetCallingCountry(v string) *DNISEmergencyCallingConfiguration { - s.CallingCountry = &v - return s -} - -// SetEmergencyPhoneNumber sets the EmergencyPhoneNumber field's value. -func (s *DNISEmergencyCallingConfiguration) SetEmergencyPhoneNumber(v string) *DNISEmergencyCallingConfiguration { - s.EmergencyPhoneNumber = &v - return s -} - -// SetTestPhoneNumber sets the TestPhoneNumber field's value. -func (s *DNISEmergencyCallingConfiguration) SetTestPhoneNumber(v string) *DNISEmergencyCallingConfiguration { - s.TestPhoneNumber = &v - return s -} - -type DeletePhoneNumberInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The phone number ID. - // - // PhoneNumberId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DeletePhoneNumberInput's - // String and GoString methods. - // - // PhoneNumberId is a required field - PhoneNumberId *string `location:"uri" locationName:"phoneNumberId" type:"string" required:"true" sensitive:"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 DeletePhoneNumberInput) 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 DeletePhoneNumberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePhoneNumberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePhoneNumberInput"} - if s.PhoneNumberId == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumberId")) - } - if s.PhoneNumberId != nil && len(*s.PhoneNumberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PhoneNumberId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPhoneNumberId sets the PhoneNumberId field's value. -func (s *DeletePhoneNumberInput) SetPhoneNumberId(v string) *DeletePhoneNumberInput { - s.PhoneNumberId = &v - return s -} - -type DeletePhoneNumberOutput 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 DeletePhoneNumberOutput) 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 DeletePhoneNumberOutput) GoString() string { - return s.String() -} - -type DeleteProxySessionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The proxy session ID. - // - // ProxySessionId is a required field - ProxySessionId *string `location:"uri" locationName:"proxySessionId" min:"1" type:"string" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" min:"1" 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 DeleteProxySessionInput) 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 DeleteProxySessionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteProxySessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteProxySessionInput"} - if s.ProxySessionId == nil { - invalidParams.Add(request.NewErrParamRequired("ProxySessionId")) - } - if s.ProxySessionId != nil && len(*s.ProxySessionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProxySessionId", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProxySessionId sets the ProxySessionId field's value. -func (s *DeleteProxySessionInput) SetProxySessionId(v string) *DeleteProxySessionInput { - s.ProxySessionId = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DeleteProxySessionInput) SetVoiceConnectorId(v string) *DeleteProxySessionInput { - s.VoiceConnectorId = &v - return s -} - -type DeleteProxySessionOutput 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 DeleteProxySessionOutput) 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 DeleteProxySessionOutput) GoString() string { - return s.String() -} - -type DeleteSipMediaApplicationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The SIP media application ID. - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" 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 DeleteSipMediaApplicationInput) 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 DeleteSipMediaApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSipMediaApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSipMediaApplicationInput"} - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *DeleteSipMediaApplicationInput) SetSipMediaApplicationId(v string) *DeleteSipMediaApplicationInput { - s.SipMediaApplicationId = &v - return s -} - -type DeleteSipMediaApplicationOutput 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 DeleteSipMediaApplicationOutput) 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 DeleteSipMediaApplicationOutput) GoString() string { - return s.String() -} - -type DeleteSipRuleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The SIP rule ID. - // - // SipRuleId is a required field - SipRuleId *string `location:"uri" locationName:"sipRuleId" 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 DeleteSipRuleInput) 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 DeleteSipRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSipRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSipRuleInput"} - if s.SipRuleId == nil { - invalidParams.Add(request.NewErrParamRequired("SipRuleId")) - } - if s.SipRuleId != nil && len(*s.SipRuleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipRuleId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSipRuleId sets the SipRuleId field's value. -func (s *DeleteSipRuleInput) SetSipRuleId(v string) *DeleteSipRuleInput { - s.SipRuleId = &v - return s -} - -type DeleteSipRuleOutput 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 DeleteSipRuleOutput) 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 DeleteSipRuleOutput) GoString() string { - return s.String() -} - -type DeleteVoiceConnectorEmergencyCallingConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 DeleteVoiceConnectorEmergencyCallingConfigurationInput) 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 DeleteVoiceConnectorEmergencyCallingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceConnectorEmergencyCallingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceConnectorEmergencyCallingConfigurationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DeleteVoiceConnectorEmergencyCallingConfigurationInput) SetVoiceConnectorId(v string) *DeleteVoiceConnectorEmergencyCallingConfigurationInput { - s.VoiceConnectorId = &v - return s -} - -type DeleteVoiceConnectorEmergencyCallingConfigurationOutput 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 DeleteVoiceConnectorEmergencyCallingConfigurationOutput) 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 DeleteVoiceConnectorEmergencyCallingConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteVoiceConnectorGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector Group ID. - // - // VoiceConnectorGroupId is a required field - VoiceConnectorGroupId *string `location:"uri" locationName:"voiceConnectorGroupId" 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 DeleteVoiceConnectorGroupInput) 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 DeleteVoiceConnectorGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceConnectorGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceConnectorGroupInput"} - if s.VoiceConnectorGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorGroupId")) - } - if s.VoiceConnectorGroupId != nil && len(*s.VoiceConnectorGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorGroupId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorGroupId sets the VoiceConnectorGroupId field's value. -func (s *DeleteVoiceConnectorGroupInput) SetVoiceConnectorGroupId(v string) *DeleteVoiceConnectorGroupInput { - s.VoiceConnectorGroupId = &v - return s -} - -type DeleteVoiceConnectorGroupOutput 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 DeleteVoiceConnectorGroupOutput) 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 DeleteVoiceConnectorGroupOutput) GoString() string { - return s.String() -} - -type DeleteVoiceConnectorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 DeleteVoiceConnectorInput) 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 DeleteVoiceConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceConnectorInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DeleteVoiceConnectorInput) SetVoiceConnectorId(v string) *DeleteVoiceConnectorInput { - s.VoiceConnectorId = &v - return s -} - -type DeleteVoiceConnectorOriginationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 DeleteVoiceConnectorOriginationInput) 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 DeleteVoiceConnectorOriginationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceConnectorOriginationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceConnectorOriginationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DeleteVoiceConnectorOriginationInput) SetVoiceConnectorId(v string) *DeleteVoiceConnectorOriginationInput { - s.VoiceConnectorId = &v - return s -} - -type DeleteVoiceConnectorOriginationOutput 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 DeleteVoiceConnectorOriginationOutput) 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 DeleteVoiceConnectorOriginationOutput) GoString() string { - return s.String() -} - -type DeleteVoiceConnectorOutput 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 DeleteVoiceConnectorOutput) 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 DeleteVoiceConnectorOutput) GoString() string { - return s.String() -} - -type DeleteVoiceConnectorProxyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" min:"1" 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 DeleteVoiceConnectorProxyInput) 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 DeleteVoiceConnectorProxyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceConnectorProxyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceConnectorProxyInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DeleteVoiceConnectorProxyInput) SetVoiceConnectorId(v string) *DeleteVoiceConnectorProxyInput { - s.VoiceConnectorId = &v - return s -} - -type DeleteVoiceConnectorProxyOutput 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 DeleteVoiceConnectorProxyOutput) 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 DeleteVoiceConnectorProxyOutput) GoString() string { - return s.String() -} - -type DeleteVoiceConnectorStreamingConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 DeleteVoiceConnectorStreamingConfigurationInput) 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 DeleteVoiceConnectorStreamingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceConnectorStreamingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceConnectorStreamingConfigurationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DeleteVoiceConnectorStreamingConfigurationInput) SetVoiceConnectorId(v string) *DeleteVoiceConnectorStreamingConfigurationInput { - s.VoiceConnectorId = &v - return s -} - -type DeleteVoiceConnectorStreamingConfigurationOutput 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 DeleteVoiceConnectorStreamingConfigurationOutput) 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 DeleteVoiceConnectorStreamingConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteVoiceConnectorTerminationCredentialsInput struct { - _ struct{} `type:"structure"` - - // The RFC2617 compliant username associated with the SIP credentials, in US-ASCII - // format. - // - // Usernames is a required field - Usernames []*string `type:"list" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 DeleteVoiceConnectorTerminationCredentialsInput) 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 DeleteVoiceConnectorTerminationCredentialsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceConnectorTerminationCredentialsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceConnectorTerminationCredentialsInput"} - if s.Usernames == nil { - invalidParams.Add(request.NewErrParamRequired("Usernames")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUsernames sets the Usernames field's value. -func (s *DeleteVoiceConnectorTerminationCredentialsInput) SetUsernames(v []*string) *DeleteVoiceConnectorTerminationCredentialsInput { - s.Usernames = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DeleteVoiceConnectorTerminationCredentialsInput) SetVoiceConnectorId(v string) *DeleteVoiceConnectorTerminationCredentialsInput { - s.VoiceConnectorId = &v - return s -} - -type DeleteVoiceConnectorTerminationCredentialsOutput 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 DeleteVoiceConnectorTerminationCredentialsOutput) 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 DeleteVoiceConnectorTerminationCredentialsOutput) GoString() string { - return s.String() -} - -type DeleteVoiceConnectorTerminationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 DeleteVoiceConnectorTerminationInput) 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 DeleteVoiceConnectorTerminationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceConnectorTerminationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceConnectorTerminationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DeleteVoiceConnectorTerminationInput) SetVoiceConnectorId(v string) *DeleteVoiceConnectorTerminationInput { - s.VoiceConnectorId = &v - return s -} - -type DeleteVoiceConnectorTerminationOutput 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 DeleteVoiceConnectorTerminationOutput) 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 DeleteVoiceConnectorTerminationOutput) GoString() string { - return s.String() -} - -type DeleteVoiceProfileDomainInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The voice profile domain ID. - // - // VoiceProfileDomainId is a required field - VoiceProfileDomainId *string `location:"uri" locationName:"VoiceProfileDomainId" min:"1" 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 DeleteVoiceProfileDomainInput) 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 DeleteVoiceProfileDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceProfileDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceProfileDomainInput"} - if s.VoiceProfileDomainId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceProfileDomainId")) - } - if s.VoiceProfileDomainId != nil && len(*s.VoiceProfileDomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceProfileDomainId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *DeleteVoiceProfileDomainInput) SetVoiceProfileDomainId(v string) *DeleteVoiceProfileDomainInput { - s.VoiceProfileDomainId = &v - return s -} - -type DeleteVoiceProfileDomainOutput 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 DeleteVoiceProfileDomainOutput) 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 DeleteVoiceProfileDomainOutput) GoString() string { - return s.String() -} - -type DeleteVoiceProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The voice profile ID. - // - // VoiceProfileId is a required field - VoiceProfileId *string `location:"uri" locationName:"VoiceProfileId" min:"1" 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 DeleteVoiceProfileInput) 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 DeleteVoiceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceProfileInput"} - if s.VoiceProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceProfileId")) - } - if s.VoiceProfileId != nil && len(*s.VoiceProfileId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceProfileId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceProfileId sets the VoiceProfileId field's value. -func (s *DeleteVoiceProfileInput) SetVoiceProfileId(v string) *DeleteVoiceProfileInput { - s.VoiceProfileId = &v - return s -} - -type DeleteVoiceProfileOutput 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 DeleteVoiceProfileOutput) 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 DeleteVoiceProfileOutput) GoString() string { - return s.String() -} - -type DisassociatePhoneNumbersFromVoiceConnectorGroupInput struct { - _ struct{} `type:"structure"` - - // The list of phone numbers, in E.164 format. - // - // E164PhoneNumbers is a required field - E164PhoneNumbers []*string `type:"list" required:"true"` - - // The Voice Connector group ID. - // - // VoiceConnectorGroupId is a required field - VoiceConnectorGroupId *string `location:"uri" locationName:"voiceConnectorGroupId" 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 DisassociatePhoneNumbersFromVoiceConnectorGroupInput) 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 DisassociatePhoneNumbersFromVoiceConnectorGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociatePhoneNumbersFromVoiceConnectorGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociatePhoneNumbersFromVoiceConnectorGroupInput"} - if s.E164PhoneNumbers == nil { - invalidParams.Add(request.NewErrParamRequired("E164PhoneNumbers")) - } - if s.VoiceConnectorGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorGroupId")) - } - if s.VoiceConnectorGroupId != nil && len(*s.VoiceConnectorGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorGroupId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetE164PhoneNumbers sets the E164PhoneNumbers field's value. -func (s *DisassociatePhoneNumbersFromVoiceConnectorGroupInput) SetE164PhoneNumbers(v []*string) *DisassociatePhoneNumbersFromVoiceConnectorGroupInput { - s.E164PhoneNumbers = v - return s -} - -// SetVoiceConnectorGroupId sets the VoiceConnectorGroupId field's value. -func (s *DisassociatePhoneNumbersFromVoiceConnectorGroupInput) SetVoiceConnectorGroupId(v string) *DisassociatePhoneNumbersFromVoiceConnectorGroupInput { - s.VoiceConnectorGroupId = &v - return s -} - -type DisassociatePhoneNumbersFromVoiceConnectorGroupOutput struct { - _ struct{} `type:"structure"` - - // If the action fails for one or more of the phone numbers in the request, - // a list of the phone numbers is returned, along with error codes and error - // messages. - PhoneNumberErrors []*PhoneNumberError `type:"list"` -} - -// 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 DisassociatePhoneNumbersFromVoiceConnectorGroupOutput) 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 DisassociatePhoneNumbersFromVoiceConnectorGroupOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberErrors sets the PhoneNumberErrors field's value. -func (s *DisassociatePhoneNumbersFromVoiceConnectorGroupOutput) SetPhoneNumberErrors(v []*PhoneNumberError) *DisassociatePhoneNumbersFromVoiceConnectorGroupOutput { - s.PhoneNumberErrors = v - return s -} - -type DisassociatePhoneNumbersFromVoiceConnectorInput struct { - _ struct{} `type:"structure"` - - // List of phone numbers, in E.164 format. - // - // E164PhoneNumbers is a required field - E164PhoneNumbers []*string `type:"list" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 DisassociatePhoneNumbersFromVoiceConnectorInput) 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 DisassociatePhoneNumbersFromVoiceConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociatePhoneNumbersFromVoiceConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociatePhoneNumbersFromVoiceConnectorInput"} - if s.E164PhoneNumbers == nil { - invalidParams.Add(request.NewErrParamRequired("E164PhoneNumbers")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetE164PhoneNumbers sets the E164PhoneNumbers field's value. -func (s *DisassociatePhoneNumbersFromVoiceConnectorInput) SetE164PhoneNumbers(v []*string) *DisassociatePhoneNumbersFromVoiceConnectorInput { - s.E164PhoneNumbers = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *DisassociatePhoneNumbersFromVoiceConnectorInput) SetVoiceConnectorId(v string) *DisassociatePhoneNumbersFromVoiceConnectorInput { - s.VoiceConnectorId = &v - return s -} - -type DisassociatePhoneNumbersFromVoiceConnectorOutput struct { - _ struct{} `type:"structure"` - - // If the action fails for one or more of the phone numbers in the request, - // a list of the phone numbers is returned, along with error codes and error - // messages. - PhoneNumberErrors []*PhoneNumberError `type:"list"` -} - -// 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 DisassociatePhoneNumbersFromVoiceConnectorOutput) 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 DisassociatePhoneNumbersFromVoiceConnectorOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberErrors sets the PhoneNumberErrors field's value. -func (s *DisassociatePhoneNumbersFromVoiceConnectorOutput) SetPhoneNumberErrors(v []*PhoneNumberError) *DisassociatePhoneNumbersFromVoiceConnectorOutput { - s.PhoneNumberErrors = v - return s -} - -// The emergency calling configuration details associated with an Amazon Chime -// SDK Voice Connector. -type EmergencyCallingConfiguration struct { - _ struct{} `type:"structure"` - - // The Dialed Number Identification Service (DNIS) emergency calling configuration - // details. - DNIS []*DNISEmergencyCallingConfiguration `type:"list"` -} - -// 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 EmergencyCallingConfiguration) 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 EmergencyCallingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EmergencyCallingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EmergencyCallingConfiguration"} - if s.DNIS != nil { - for i, v := range s.DNIS { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DNIS", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDNIS sets the DNIS field's value. -func (s *EmergencyCallingConfiguration) SetDNIS(v []*DNISEmergencyCallingConfiguration) *EmergencyCallingConfiguration { - s.DNIS = v - return s -} - -// The client is permanently forbidden from making the request. -type ForbiddenException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ForbiddenException) 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 ForbiddenException) GoString() string { - return s.String() -} - -func newErrorForbiddenException(v protocol.ResponseMetadata) error { - return &ForbiddenException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ForbiddenException) Code() string { - return "ForbiddenException" -} - -// Message returns the exception's message. -func (s *ForbiddenException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ForbiddenException) OrigErr() error { - return nil -} - -func (s *ForbiddenException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ForbiddenException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ForbiddenException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The country and area code for a proxy phone number in a proxy phone session. -type GeoMatchParams struct { - _ struct{} `type:"structure"` - - // The area code. - // - // AreaCode is a required field - AreaCode *string `type:"string" required:"true"` - - // The country. - // - // Country is a required field - Country *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 GeoMatchParams) 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 GeoMatchParams) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GeoMatchParams) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GeoMatchParams"} - if s.AreaCode == nil { - invalidParams.Add(request.NewErrParamRequired("AreaCode")) - } - if s.Country == nil { - invalidParams.Add(request.NewErrParamRequired("Country")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAreaCode sets the AreaCode field's value. -func (s *GeoMatchParams) SetAreaCode(v string) *GeoMatchParams { - s.AreaCode = &v - return s -} - -// SetCountry sets the Country field's value. -func (s *GeoMatchParams) SetCountry(v string) *GeoMatchParams { - s.Country = &v - return s -} - -type GetGlobalSettingsInput struct { - _ struct{} `type:"structure" nopayload:"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 GetGlobalSettingsInput) 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 GetGlobalSettingsInput) GoString() string { - return s.String() -} - -type GetGlobalSettingsOutput struct { - _ struct{} `type:"structure"` - - // The Voice Connector settings. - VoiceConnector *VoiceConnectorSettings `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 GetGlobalSettingsOutput) 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 GetGlobalSettingsOutput) GoString() string { - return s.String() -} - -// SetVoiceConnector sets the VoiceConnector field's value. -func (s *GetGlobalSettingsOutput) SetVoiceConnector(v *VoiceConnectorSettings) *GetGlobalSettingsOutput { - s.VoiceConnector = v - return s -} - -type GetPhoneNumberInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The phone number ID. - // - // PhoneNumberId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetPhoneNumberInput's - // String and GoString methods. - // - // PhoneNumberId is a required field - PhoneNumberId *string `location:"uri" locationName:"phoneNumberId" type:"string" required:"true" sensitive:"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 GetPhoneNumberInput) 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 GetPhoneNumberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPhoneNumberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPhoneNumberInput"} - if s.PhoneNumberId == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumberId")) - } - if s.PhoneNumberId != nil && len(*s.PhoneNumberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PhoneNumberId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPhoneNumberId sets the PhoneNumberId field's value. -func (s *GetPhoneNumberInput) SetPhoneNumberId(v string) *GetPhoneNumberInput { - s.PhoneNumberId = &v - return s -} - -type GetPhoneNumberOrderInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the phone number order . - // - // PhoneNumberOrderId is a required field - PhoneNumberOrderId *string `location:"uri" locationName:"phoneNumberOrderId" 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 GetPhoneNumberOrderInput) 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 GetPhoneNumberOrderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPhoneNumberOrderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPhoneNumberOrderInput"} - if s.PhoneNumberOrderId == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumberOrderId")) - } - if s.PhoneNumberOrderId != nil && len(*s.PhoneNumberOrderId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PhoneNumberOrderId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPhoneNumberOrderId sets the PhoneNumberOrderId field's value. -func (s *GetPhoneNumberOrderInput) SetPhoneNumberOrderId(v string) *GetPhoneNumberOrderInput { - s.PhoneNumberOrderId = &v - return s -} - -type GetPhoneNumberOrderOutput struct { - _ struct{} `type:"structure"` - - // The phone number order details. - PhoneNumberOrder *PhoneNumberOrder `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 GetPhoneNumberOrderOutput) 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 GetPhoneNumberOrderOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberOrder sets the PhoneNumberOrder field's value. -func (s *GetPhoneNumberOrderOutput) SetPhoneNumberOrder(v *PhoneNumberOrder) *GetPhoneNumberOrderOutput { - s.PhoneNumberOrder = v - return s -} - -type GetPhoneNumberOutput struct { - _ struct{} `type:"structure"` - - // The phone number details. - PhoneNumber *PhoneNumber `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 GetPhoneNumberOutput) 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 GetPhoneNumberOutput) GoString() string { - return s.String() -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *GetPhoneNumberOutput) SetPhoneNumber(v *PhoneNumber) *GetPhoneNumberOutput { - s.PhoneNumber = v - return s -} - -type GetPhoneNumberSettingsInput struct { - _ struct{} `type:"structure" nopayload:"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 GetPhoneNumberSettingsInput) 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 GetPhoneNumberSettingsInput) GoString() string { - return s.String() -} - -type GetPhoneNumberSettingsOutput struct { - _ struct{} `type:"structure"` - - // The default outbound calling name for the account. - // - // CallingName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetPhoneNumberSettingsOutput's - // String and GoString methods. - CallingName *string `type:"string" sensitive:"true"` - - // The updated outbound calling name timestamp, in ISO 8601 format. - CallingNameUpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 GetPhoneNumberSettingsOutput) 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 GetPhoneNumberSettingsOutput) GoString() string { - return s.String() -} - -// SetCallingName sets the CallingName field's value. -func (s *GetPhoneNumberSettingsOutput) SetCallingName(v string) *GetPhoneNumberSettingsOutput { - s.CallingName = &v - return s -} - -// SetCallingNameUpdatedTimestamp sets the CallingNameUpdatedTimestamp field's value. -func (s *GetPhoneNumberSettingsOutput) SetCallingNameUpdatedTimestamp(v time.Time) *GetPhoneNumberSettingsOutput { - s.CallingNameUpdatedTimestamp = &v - return s -} - -type GetProxySessionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The proxy session ID. - // - // ProxySessionId is a required field - ProxySessionId *string `location:"uri" locationName:"proxySessionId" min:"1" type:"string" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" min:"1" 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 GetProxySessionInput) 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 GetProxySessionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetProxySessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetProxySessionInput"} - if s.ProxySessionId == nil { - invalidParams.Add(request.NewErrParamRequired("ProxySessionId")) - } - if s.ProxySessionId != nil && len(*s.ProxySessionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProxySessionId", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProxySessionId sets the ProxySessionId field's value. -func (s *GetProxySessionInput) SetProxySessionId(v string) *GetProxySessionInput { - s.ProxySessionId = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetProxySessionInput) SetVoiceConnectorId(v string) *GetProxySessionInput { - s.VoiceConnectorId = &v - return s -} - -type GetProxySessionOutput struct { - _ struct{} `type:"structure"` - - // The proxy session details. - ProxySession *ProxySession `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 GetProxySessionOutput) 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 GetProxySessionOutput) GoString() string { - return s.String() -} - -// SetProxySession sets the ProxySession field's value. -func (s *GetProxySessionOutput) SetProxySession(v *ProxySession) *GetProxySessionOutput { - s.ProxySession = v - return s -} - -type GetSipMediaApplicationAlexaSkillConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The SIP media application ID. - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" 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 GetSipMediaApplicationAlexaSkillConfigurationInput) 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 GetSipMediaApplicationAlexaSkillConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSipMediaApplicationAlexaSkillConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSipMediaApplicationAlexaSkillConfigurationInput"} - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *GetSipMediaApplicationAlexaSkillConfigurationInput) SetSipMediaApplicationId(v string) *GetSipMediaApplicationAlexaSkillConfigurationInput { - s.SipMediaApplicationId = &v - return s -} - -type GetSipMediaApplicationAlexaSkillConfigurationOutput struct { - _ struct{} `type:"structure"` - - // Returns the Alexa Skill configuration. - SipMediaApplicationAlexaSkillConfiguration *SipMediaApplicationAlexaSkillConfiguration `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 GetSipMediaApplicationAlexaSkillConfigurationOutput) 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 GetSipMediaApplicationAlexaSkillConfigurationOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplicationAlexaSkillConfiguration sets the SipMediaApplicationAlexaSkillConfiguration field's value. -func (s *GetSipMediaApplicationAlexaSkillConfigurationOutput) SetSipMediaApplicationAlexaSkillConfiguration(v *SipMediaApplicationAlexaSkillConfiguration) *GetSipMediaApplicationAlexaSkillConfigurationOutput { - s.SipMediaApplicationAlexaSkillConfiguration = v - return s -} - -type GetSipMediaApplicationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The SIP media application ID . - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" 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 GetSipMediaApplicationInput) 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 GetSipMediaApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSipMediaApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSipMediaApplicationInput"} - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *GetSipMediaApplicationInput) SetSipMediaApplicationId(v string) *GetSipMediaApplicationInput { - s.SipMediaApplicationId = &v - return s -} - -type GetSipMediaApplicationLoggingConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The SIP media application ID. - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" 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 GetSipMediaApplicationLoggingConfigurationInput) 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 GetSipMediaApplicationLoggingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSipMediaApplicationLoggingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSipMediaApplicationLoggingConfigurationInput"} - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *GetSipMediaApplicationLoggingConfigurationInput) SetSipMediaApplicationId(v string) *GetSipMediaApplicationLoggingConfigurationInput { - s.SipMediaApplicationId = &v - return s -} - -type GetSipMediaApplicationLoggingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The actual logging configuration. - SipMediaApplicationLoggingConfiguration *SipMediaApplicationLoggingConfiguration `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 GetSipMediaApplicationLoggingConfigurationOutput) 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 GetSipMediaApplicationLoggingConfigurationOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplicationLoggingConfiguration sets the SipMediaApplicationLoggingConfiguration field's value. -func (s *GetSipMediaApplicationLoggingConfigurationOutput) SetSipMediaApplicationLoggingConfiguration(v *SipMediaApplicationLoggingConfiguration) *GetSipMediaApplicationLoggingConfigurationOutput { - s.SipMediaApplicationLoggingConfiguration = v - return s -} - -type GetSipMediaApplicationOutput struct { - _ struct{} `type:"structure"` - - // The details of the SIP media application. - SipMediaApplication *SipMediaApplication `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 GetSipMediaApplicationOutput) 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 GetSipMediaApplicationOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplication sets the SipMediaApplication field's value. -func (s *GetSipMediaApplicationOutput) SetSipMediaApplication(v *SipMediaApplication) *GetSipMediaApplicationOutput { - s.SipMediaApplication = v - return s -} - -type GetSipRuleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The SIP rule ID. - // - // SipRuleId is a required field - SipRuleId *string `location:"uri" locationName:"sipRuleId" 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 GetSipRuleInput) 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 GetSipRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSipRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSipRuleInput"} - if s.SipRuleId == nil { - invalidParams.Add(request.NewErrParamRequired("SipRuleId")) - } - if s.SipRuleId != nil && len(*s.SipRuleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipRuleId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSipRuleId sets the SipRuleId field's value. -func (s *GetSipRuleInput) SetSipRuleId(v string) *GetSipRuleInput { - s.SipRuleId = &v - return s -} - -type GetSipRuleOutput struct { - _ struct{} `type:"structure"` - - // The SIP rule details. - SipRule *SipRule `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 GetSipRuleOutput) 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 GetSipRuleOutput) GoString() string { - return s.String() -} - -// SetSipRule sets the SipRule field's value. -func (s *GetSipRuleOutput) SetSipRule(v *SipRule) *GetSipRuleOutput { - s.SipRule = v - return s -} - -type GetSpeakerSearchTaskInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the speaker search task. - // - // SpeakerSearchTaskId is a required field - SpeakerSearchTaskId *string `location:"uri" locationName:"SpeakerSearchTaskId" min:"1" type:"string" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"VoiceConnectorId" min:"1" 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 GetSpeakerSearchTaskInput) 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 GetSpeakerSearchTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSpeakerSearchTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSpeakerSearchTaskInput"} - if s.SpeakerSearchTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("SpeakerSearchTaskId")) - } - if s.SpeakerSearchTaskId != nil && len(*s.SpeakerSearchTaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpeakerSearchTaskId", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSpeakerSearchTaskId sets the SpeakerSearchTaskId field's value. -func (s *GetSpeakerSearchTaskInput) SetSpeakerSearchTaskId(v string) *GetSpeakerSearchTaskInput { - s.SpeakerSearchTaskId = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetSpeakerSearchTaskInput) SetVoiceConnectorId(v string) *GetSpeakerSearchTaskInput { - s.VoiceConnectorId = &v - return s -} - -type GetSpeakerSearchTaskOutput struct { - _ struct{} `type:"structure"` - - // The details of the speaker search task. - SpeakerSearchTask *SpeakerSearchTask `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 GetSpeakerSearchTaskOutput) 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 GetSpeakerSearchTaskOutput) GoString() string { - return s.String() -} - -// SetSpeakerSearchTask sets the SpeakerSearchTask field's value. -func (s *GetSpeakerSearchTaskOutput) SetSpeakerSearchTask(v *SpeakerSearchTask) *GetSpeakerSearchTaskOutput { - s.SpeakerSearchTask = v - return s -} - -type GetVoiceConnectorEmergencyCallingConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 GetVoiceConnectorEmergencyCallingConfigurationInput) 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 GetVoiceConnectorEmergencyCallingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorEmergencyCallingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorEmergencyCallingConfigurationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceConnectorEmergencyCallingConfigurationInput) SetVoiceConnectorId(v string) *GetVoiceConnectorEmergencyCallingConfigurationInput { - s.VoiceConnectorId = &v - return s -} - -type GetVoiceConnectorEmergencyCallingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The details of the emergency calling configuration. - EmergencyCallingConfiguration *EmergencyCallingConfiguration `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 GetVoiceConnectorEmergencyCallingConfigurationOutput) 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 GetVoiceConnectorEmergencyCallingConfigurationOutput) GoString() string { - return s.String() -} - -// SetEmergencyCallingConfiguration sets the EmergencyCallingConfiguration field's value. -func (s *GetVoiceConnectorEmergencyCallingConfigurationOutput) SetEmergencyCallingConfiguration(v *EmergencyCallingConfiguration) *GetVoiceConnectorEmergencyCallingConfigurationOutput { - s.EmergencyCallingConfiguration = v - return s -} - -type GetVoiceConnectorGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector group ID. - // - // VoiceConnectorGroupId is a required field - VoiceConnectorGroupId *string `location:"uri" locationName:"voiceConnectorGroupId" 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 GetVoiceConnectorGroupInput) 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 GetVoiceConnectorGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorGroupInput"} - if s.VoiceConnectorGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorGroupId")) - } - if s.VoiceConnectorGroupId != nil && len(*s.VoiceConnectorGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorGroupId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorGroupId sets the VoiceConnectorGroupId field's value. -func (s *GetVoiceConnectorGroupInput) SetVoiceConnectorGroupId(v string) *GetVoiceConnectorGroupInput { - s.VoiceConnectorGroupId = &v - return s -} - -type GetVoiceConnectorGroupOutput struct { - _ struct{} `type:"structure"` - - // The details of the Voice Connector group. - VoiceConnectorGroup *VoiceConnectorGroup `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 GetVoiceConnectorGroupOutput) 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 GetVoiceConnectorGroupOutput) GoString() string { - return s.String() -} - -// SetVoiceConnectorGroup sets the VoiceConnectorGroup field's value. -func (s *GetVoiceConnectorGroupOutput) SetVoiceConnectorGroup(v *VoiceConnectorGroup) *GetVoiceConnectorGroupOutput { - s.VoiceConnectorGroup = v - return s -} - -type GetVoiceConnectorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 GetVoiceConnectorInput) 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 GetVoiceConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceConnectorInput) SetVoiceConnectorId(v string) *GetVoiceConnectorInput { - s.VoiceConnectorId = &v - return s -} - -type GetVoiceConnectorLoggingConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 GetVoiceConnectorLoggingConfigurationInput) 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 GetVoiceConnectorLoggingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorLoggingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorLoggingConfigurationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceConnectorLoggingConfigurationInput) SetVoiceConnectorId(v string) *GetVoiceConnectorLoggingConfigurationInput { - s.VoiceConnectorId = &v - return s -} - -type GetVoiceConnectorLoggingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The logging configuration details . - LoggingConfiguration *LoggingConfiguration `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 GetVoiceConnectorLoggingConfigurationOutput) 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 GetVoiceConnectorLoggingConfigurationOutput) GoString() string { - return s.String() -} - -// SetLoggingConfiguration sets the LoggingConfiguration field's value. -func (s *GetVoiceConnectorLoggingConfigurationOutput) SetLoggingConfiguration(v *LoggingConfiguration) *GetVoiceConnectorLoggingConfigurationOutput { - s.LoggingConfiguration = v - return s -} - -type GetVoiceConnectorOriginationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 GetVoiceConnectorOriginationInput) 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 GetVoiceConnectorOriginationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorOriginationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorOriginationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceConnectorOriginationInput) SetVoiceConnectorId(v string) *GetVoiceConnectorOriginationInput { - s.VoiceConnectorId = &v - return s -} - -type GetVoiceConnectorOriginationOutput struct { - _ struct{} `type:"structure"` - - // The origination setting details. - Origination *Origination `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 GetVoiceConnectorOriginationOutput) 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 GetVoiceConnectorOriginationOutput) GoString() string { - return s.String() -} - -// SetOrigination sets the Origination field's value. -func (s *GetVoiceConnectorOriginationOutput) SetOrigination(v *Origination) *GetVoiceConnectorOriginationOutput { - s.Origination = v - return s -} - -type GetVoiceConnectorOutput struct { - _ struct{} `type:"structure"` - - // The Voice Connector details. - VoiceConnector *VoiceConnector `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 GetVoiceConnectorOutput) 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 GetVoiceConnectorOutput) GoString() string { - return s.String() -} - -// SetVoiceConnector sets the VoiceConnector field's value. -func (s *GetVoiceConnectorOutput) SetVoiceConnector(v *VoiceConnector) *GetVoiceConnectorOutput { - s.VoiceConnector = v - return s -} - -type GetVoiceConnectorProxyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" min:"1" 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 GetVoiceConnectorProxyInput) 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 GetVoiceConnectorProxyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorProxyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorProxyInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceConnectorProxyInput) SetVoiceConnectorId(v string) *GetVoiceConnectorProxyInput { - s.VoiceConnectorId = &v - return s -} - -type GetVoiceConnectorProxyOutput struct { - _ struct{} `type:"structure"` - - // The proxy configuration details. - Proxy *Proxy `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 GetVoiceConnectorProxyOutput) 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 GetVoiceConnectorProxyOutput) GoString() string { - return s.String() -} - -// SetProxy sets the Proxy field's value. -func (s *GetVoiceConnectorProxyOutput) SetProxy(v *Proxy) *GetVoiceConnectorProxyOutput { - s.Proxy = v - return s -} - -type GetVoiceConnectorStreamingConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 GetVoiceConnectorStreamingConfigurationInput) 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 GetVoiceConnectorStreamingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorStreamingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorStreamingConfigurationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceConnectorStreamingConfigurationInput) SetVoiceConnectorId(v string) *GetVoiceConnectorStreamingConfigurationInput { - s.VoiceConnectorId = &v - return s -} - -type GetVoiceConnectorStreamingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The details of the streaming configuration. - StreamingConfiguration *StreamingConfiguration `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 GetVoiceConnectorStreamingConfigurationOutput) 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 GetVoiceConnectorStreamingConfigurationOutput) GoString() string { - return s.String() -} - -// SetStreamingConfiguration sets the StreamingConfiguration field's value. -func (s *GetVoiceConnectorStreamingConfigurationOutput) SetStreamingConfiguration(v *StreamingConfiguration) *GetVoiceConnectorStreamingConfigurationOutput { - s.StreamingConfiguration = v - return s -} - -type GetVoiceConnectorTerminationHealthInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 GetVoiceConnectorTerminationHealthInput) 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 GetVoiceConnectorTerminationHealthInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorTerminationHealthInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorTerminationHealthInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceConnectorTerminationHealthInput) SetVoiceConnectorId(v string) *GetVoiceConnectorTerminationHealthInput { - s.VoiceConnectorId = &v - return s -} - -type GetVoiceConnectorTerminationHealthOutput struct { - _ struct{} `type:"structure"` - - // The termination health details. - TerminationHealth *TerminationHealth `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 GetVoiceConnectorTerminationHealthOutput) 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 GetVoiceConnectorTerminationHealthOutput) GoString() string { - return s.String() -} - -// SetTerminationHealth sets the TerminationHealth field's value. -func (s *GetVoiceConnectorTerminationHealthOutput) SetTerminationHealth(v *TerminationHealth) *GetVoiceConnectorTerminationHealthOutput { - s.TerminationHealth = v - return s -} - -type GetVoiceConnectorTerminationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 GetVoiceConnectorTerminationInput) 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 GetVoiceConnectorTerminationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceConnectorTerminationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceConnectorTerminationInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceConnectorTerminationInput) SetVoiceConnectorId(v string) *GetVoiceConnectorTerminationInput { - s.VoiceConnectorId = &v - return s -} - -type GetVoiceConnectorTerminationOutput struct { - _ struct{} `type:"structure"` - - // The termination setting details. - Termination *Termination `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 GetVoiceConnectorTerminationOutput) 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 GetVoiceConnectorTerminationOutput) GoString() string { - return s.String() -} - -// SetTermination sets the Termination field's value. -func (s *GetVoiceConnectorTerminationOutput) SetTermination(v *Termination) *GetVoiceConnectorTerminationOutput { - s.Termination = v - return s -} - -type GetVoiceProfileDomainInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The voice profile domain ID. - // - // VoiceProfileDomainId is a required field - VoiceProfileDomainId *string `location:"uri" locationName:"VoiceProfileDomainId" min:"1" 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 GetVoiceProfileDomainInput) 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 GetVoiceProfileDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceProfileDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceProfileDomainInput"} - if s.VoiceProfileDomainId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceProfileDomainId")) - } - if s.VoiceProfileDomainId != nil && len(*s.VoiceProfileDomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceProfileDomainId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *GetVoiceProfileDomainInput) SetVoiceProfileDomainId(v string) *GetVoiceProfileDomainInput { - s.VoiceProfileDomainId = &v - return s -} - -type GetVoiceProfileDomainOutput struct { - _ struct{} `type:"structure"` - - // The details of the voice profile domain. - VoiceProfileDomain *VoiceProfileDomain `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 GetVoiceProfileDomainOutput) 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 GetVoiceProfileDomainOutput) GoString() string { - return s.String() -} - -// SetVoiceProfileDomain sets the VoiceProfileDomain field's value. -func (s *GetVoiceProfileDomainOutput) SetVoiceProfileDomain(v *VoiceProfileDomain) *GetVoiceProfileDomainOutput { - s.VoiceProfileDomain = v - return s -} - -type GetVoiceProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The voice profile ID. - // - // VoiceProfileId is a required field - VoiceProfileId *string `location:"uri" locationName:"VoiceProfileId" min:"1" 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 GetVoiceProfileInput) 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 GetVoiceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceProfileInput"} - if s.VoiceProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceProfileId")) - } - if s.VoiceProfileId != nil && len(*s.VoiceProfileId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceProfileId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceProfileId sets the VoiceProfileId field's value. -func (s *GetVoiceProfileInput) SetVoiceProfileId(v string) *GetVoiceProfileInput { - s.VoiceProfileId = &v - return s -} - -type GetVoiceProfileOutput struct { - _ struct{} `type:"structure"` - - // The voice profile details. - VoiceProfile *VoiceProfile `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 GetVoiceProfileOutput) 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 GetVoiceProfileOutput) GoString() string { - return s.String() -} - -// SetVoiceProfile sets the VoiceProfile field's value. -func (s *GetVoiceProfileOutput) SetVoiceProfile(v *VoiceProfile) *GetVoiceProfileOutput { - s.VoiceProfile = v - return s -} - -type GetVoiceToneAnalysisTaskInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Specifies whether the voice being analyzed is the caller (originator) or - // the callee (responder). - // - // IsCaller is a required field - IsCaller *bool `location:"querystring" locationName:"isCaller" type:"boolean" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"VoiceConnectorId" min:"1" type:"string" required:"true"` - - // The ID of the voice tone anlysis task. - // - // VoiceToneAnalysisTaskId is a required field - VoiceToneAnalysisTaskId *string `location:"uri" locationName:"VoiceToneAnalysisTaskId" min:"1" 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 GetVoiceToneAnalysisTaskInput) 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 GetVoiceToneAnalysisTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceToneAnalysisTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceToneAnalysisTaskInput"} - if s.IsCaller == nil { - invalidParams.Add(request.NewErrParamRequired("IsCaller")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - if s.VoiceToneAnalysisTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceToneAnalysisTaskId")) - } - if s.VoiceToneAnalysisTaskId != nil && len(*s.VoiceToneAnalysisTaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceToneAnalysisTaskId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIsCaller sets the IsCaller field's value. -func (s *GetVoiceToneAnalysisTaskInput) SetIsCaller(v bool) *GetVoiceToneAnalysisTaskInput { - s.IsCaller = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *GetVoiceToneAnalysisTaskInput) SetVoiceConnectorId(v string) *GetVoiceToneAnalysisTaskInput { - s.VoiceConnectorId = &v - return s -} - -// SetVoiceToneAnalysisTaskId sets the VoiceToneAnalysisTaskId field's value. -func (s *GetVoiceToneAnalysisTaskInput) SetVoiceToneAnalysisTaskId(v string) *GetVoiceToneAnalysisTaskInput { - s.VoiceToneAnalysisTaskId = &v - return s -} - -type GetVoiceToneAnalysisTaskOutput struct { - _ struct{} `type:"structure"` - - // The details of the voice tone analysis task. - VoiceToneAnalysisTask *VoiceToneAnalysisTask `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 GetVoiceToneAnalysisTaskOutput) 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 GetVoiceToneAnalysisTaskOutput) GoString() string { - return s.String() -} - -// SetVoiceToneAnalysisTask sets the VoiceToneAnalysisTask field's value. -func (s *GetVoiceToneAnalysisTaskOutput) SetVoiceToneAnalysisTask(v *VoiceToneAnalysisTask) *GetVoiceToneAnalysisTaskOutput { - s.VoiceToneAnalysisTask = v - return s -} - -// Access to the target resource is no longer available at the origin server. -// This condition is likely to be permanent. -type GoneException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 GoneException) 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 GoneException) GoString() string { - return s.String() -} - -func newErrorGoneException(v protocol.ResponseMetadata) error { - return &GoneException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *GoneException) Code() string { - return "GoneException" -} - -// Message returns the exception's message. -func (s *GoneException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *GoneException) OrigErr() error { - return nil -} - -func (s *GoneException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *GoneException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *GoneException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListAvailableVoiceConnectorRegionsInput struct { - _ struct{} `type:"structure" nopayload:"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 ListAvailableVoiceConnectorRegionsInput) 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 ListAvailableVoiceConnectorRegionsInput) GoString() string { - return s.String() -} - -type ListAvailableVoiceConnectorRegionsOutput struct { - _ struct{} `type:"structure"` - - // The list of AWS Regions. - VoiceConnectorRegions []*string `type:"list" enum:"VoiceConnectorAwsRegion"` -} - -// 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 ListAvailableVoiceConnectorRegionsOutput) 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 ListAvailableVoiceConnectorRegionsOutput) GoString() string { - return s.String() -} - -// SetVoiceConnectorRegions sets the VoiceConnectorRegions field's value. -func (s *ListAvailableVoiceConnectorRegionsOutput) SetVoiceConnectorRegions(v []*string) *ListAvailableVoiceConnectorRegionsOutput { - s.VoiceConnectorRegions = v - return s -} - -type ListPhoneNumberOrdersInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in a single call. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to retrieve the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" 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 ListPhoneNumberOrdersInput) 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 ListPhoneNumberOrdersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPhoneNumberOrdersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPhoneNumberOrdersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPhoneNumberOrdersInput) SetMaxResults(v int64) *ListPhoneNumberOrdersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPhoneNumberOrdersInput) SetNextToken(v string) *ListPhoneNumberOrdersInput { - s.NextToken = &v - return s -} - -type ListPhoneNumberOrdersOutput struct { - _ struct{} `type:"structure"` - - // The token used to retrieve the next page of results. - NextToken *string `type:"string"` - - // The phone number order details. - PhoneNumberOrders []*PhoneNumberOrder `type:"list"` -} - -// 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 ListPhoneNumberOrdersOutput) 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 ListPhoneNumberOrdersOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPhoneNumberOrdersOutput) SetNextToken(v string) *ListPhoneNumberOrdersOutput { - s.NextToken = &v - return s -} - -// SetPhoneNumberOrders sets the PhoneNumberOrders field's value. -func (s *ListPhoneNumberOrdersOutput) SetPhoneNumberOrders(v []*PhoneNumberOrder) *ListPhoneNumberOrdersOutput { - s.PhoneNumberOrders = v - return s -} - -type ListPhoneNumbersInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The filter to limit the number of results. - FilterName *string `location:"querystring" locationName:"filter-name" type:"string" enum:"PhoneNumberAssociationName"` - - // The filter value. - FilterValue *string `location:"querystring" locationName:"filter-value" type:"string"` - - // The maximum number of results to return in a single call. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to return the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - // The phone number product types. - ProductType *string `location:"querystring" locationName:"product-type" type:"string" enum:"PhoneNumberProductType"` - - // The status of your organization's phone numbers. - Status *string `location:"querystring" locationName:"status" 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 ListPhoneNumbersInput) 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 ListPhoneNumbersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPhoneNumbersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPhoneNumbersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterName sets the FilterName field's value. -func (s *ListPhoneNumbersInput) SetFilterName(v string) *ListPhoneNumbersInput { - s.FilterName = &v - return s -} - -// SetFilterValue sets the FilterValue field's value. -func (s *ListPhoneNumbersInput) SetFilterValue(v string) *ListPhoneNumbersInput { - s.FilterValue = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPhoneNumbersInput) SetMaxResults(v int64) *ListPhoneNumbersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPhoneNumbersInput) SetNextToken(v string) *ListPhoneNumbersInput { - s.NextToken = &v - return s -} - -// SetProductType sets the ProductType field's value. -func (s *ListPhoneNumbersInput) SetProductType(v string) *ListPhoneNumbersInput { - s.ProductType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListPhoneNumbersInput) SetStatus(v string) *ListPhoneNumbersInput { - s.Status = &v - return s -} - -type ListPhoneNumbersOutput struct { - _ struct{} `type:"structure"` - - // The token used to return the next page of results. - NextToken *string `type:"string"` - - // The phone number details. - PhoneNumbers []*PhoneNumber `type:"list"` -} - -// 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 ListPhoneNumbersOutput) 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 ListPhoneNumbersOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPhoneNumbersOutput) SetNextToken(v string) *ListPhoneNumbersOutput { - s.NextToken = &v - return s -} - -// SetPhoneNumbers sets the PhoneNumbers field's value. -func (s *ListPhoneNumbersOutput) SetPhoneNumbers(v []*PhoneNumber) *ListPhoneNumbersOutput { - s.PhoneNumbers = v - return s -} - -type ListProxySessionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in a single call. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to retrieve the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - // The proxy session status. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"ProxySessionStatus"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" min:"1" 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 ListProxySessionsInput) 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 ListProxySessionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProxySessionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProxySessionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListProxySessionsInput) SetMaxResults(v int64) *ListProxySessionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProxySessionsInput) SetNextToken(v string) *ListProxySessionsInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListProxySessionsInput) SetStatus(v string) *ListProxySessionsInput { - s.Status = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *ListProxySessionsInput) SetVoiceConnectorId(v string) *ListProxySessionsInput { - s.VoiceConnectorId = &v - return s -} - -type ListProxySessionsOutput struct { - _ struct{} `type:"structure"` - - // The token used to retrieve the next page of results. - NextToken *string `type:"string"` - - // The proxy sessions' details. - ProxySessions []*ProxySession `type:"list"` -} - -// 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 ListProxySessionsOutput) 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 ListProxySessionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProxySessionsOutput) SetNextToken(v string) *ListProxySessionsOutput { - s.NextToken = &v - return s -} - -// SetProxySessions sets the ProxySessions field's value. -func (s *ListProxySessionsOutput) SetProxySessions(v []*ProxySession) *ListProxySessionsOutput { - s.ProxySessions = v - return s -} - -type ListSipMediaApplicationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in a single call. Defaults to 100. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to return the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" 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 ListSipMediaApplicationsInput) 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 ListSipMediaApplicationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSipMediaApplicationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSipMediaApplicationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSipMediaApplicationsInput) SetMaxResults(v int64) *ListSipMediaApplicationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSipMediaApplicationsInput) SetNextToken(v string) *ListSipMediaApplicationsInput { - s.NextToken = &v - return s -} - -type ListSipMediaApplicationsOutput struct { - _ struct{} `type:"structure"` - - // The token used to return the next page of results. - NextToken *string `type:"string"` - - // The list of SIP media applications and application details. - SipMediaApplications []*SipMediaApplication `type:"list"` -} - -// 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 ListSipMediaApplicationsOutput) 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 ListSipMediaApplicationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSipMediaApplicationsOutput) SetNextToken(v string) *ListSipMediaApplicationsOutput { - s.NextToken = &v - return s -} - -// SetSipMediaApplications sets the SipMediaApplications field's value. -func (s *ListSipMediaApplicationsOutput) SetSipMediaApplications(v []*SipMediaApplication) *ListSipMediaApplicationsOutput { - s.SipMediaApplications = v - return s -} - -type ListSipRulesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in a single call. Defaults to 100. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to return the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - // The SIP media application ID. - SipMediaApplicationId *string `location:"querystring" locationName:"sip-media-application" 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 ListSipRulesInput) 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 ListSipRulesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSipRulesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSipRulesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSipRulesInput) SetMaxResults(v int64) *ListSipRulesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSipRulesInput) SetNextToken(v string) *ListSipRulesInput { - s.NextToken = &v - return s -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *ListSipRulesInput) SetSipMediaApplicationId(v string) *ListSipRulesInput { - s.SipMediaApplicationId = &v - return s -} - -type ListSipRulesOutput struct { - _ struct{} `type:"structure"` - - // The token used to return the next page of results. - NextToken *string `type:"string"` - - // The list of SIP rules and details. - SipRules []*SipRule `type:"list"` -} - -// 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 ListSipRulesOutput) 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 ListSipRulesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSipRulesOutput) SetNextToken(v string) *ListSipRulesOutput { - s.NextToken = &v - return s -} - -// SetSipRules sets the SipRules field's value. -func (s *ListSipRulesOutput) SetSipRules(v []*SipRule) *ListSipRulesOutput { - s.SipRules = v - return s -} - -type ListSupportedPhoneNumberCountriesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The phone number product type. - // - // ProductType is a required field - ProductType *string `location:"querystring" locationName:"product-type" type:"string" required:"true" enum:"PhoneNumberProductType"` -} - -// 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 ListSupportedPhoneNumberCountriesInput) 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 ListSupportedPhoneNumberCountriesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSupportedPhoneNumberCountriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSupportedPhoneNumberCountriesInput"} - if s.ProductType == nil { - invalidParams.Add(request.NewErrParamRequired("ProductType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProductType sets the ProductType field's value. -func (s *ListSupportedPhoneNumberCountriesInput) SetProductType(v string) *ListSupportedPhoneNumberCountriesInput { - s.ProductType = &v - return s -} - -type ListSupportedPhoneNumberCountriesOutput struct { - _ struct{} `type:"structure"` - - // The supported phone number countries. - PhoneNumberCountries []*PhoneNumberCountry `type:"list"` -} - -// 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 ListSupportedPhoneNumberCountriesOutput) 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 ListSupportedPhoneNumberCountriesOutput) GoString() string { - return s.String() -} - -// SetPhoneNumberCountries sets the PhoneNumberCountries field's value. -func (s *ListSupportedPhoneNumberCountriesOutput) SetPhoneNumberCountries(v []*PhoneNumberCountry) *ListSupportedPhoneNumberCountriesOutput { - s.PhoneNumberCountries = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The resource ARN. - // - // ResourceARN is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListTagsForResourceInput's - // String and GoString methods. - // - // ResourceARN is a required field - ResourceARN *string `location:"querystring" locationName:"arn" min:"1" type:"string" required:"true" sensitive:"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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { - s.ResourceARN = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags in the list. - Tags []*Tag `min:"1" type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListVoiceConnectorGroupsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in a single call. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to return the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" 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 ListVoiceConnectorGroupsInput) 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 ListVoiceConnectorGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVoiceConnectorGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVoiceConnectorGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVoiceConnectorGroupsInput) SetMaxResults(v int64) *ListVoiceConnectorGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVoiceConnectorGroupsInput) SetNextToken(v string) *ListVoiceConnectorGroupsInput { - s.NextToken = &v - return s -} - -type ListVoiceConnectorGroupsOutput struct { - _ struct{} `type:"structure"` - - // The token used to return the next page of results. - NextToken *string `type:"string"` - - // The details of the Voice Connector groups. - VoiceConnectorGroups []*VoiceConnectorGroup `type:"list"` -} - -// 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 ListVoiceConnectorGroupsOutput) 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 ListVoiceConnectorGroupsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVoiceConnectorGroupsOutput) SetNextToken(v string) *ListVoiceConnectorGroupsOutput { - s.NextToken = &v - return s -} - -// SetVoiceConnectorGroups sets the VoiceConnectorGroups field's value. -func (s *ListVoiceConnectorGroupsOutput) SetVoiceConnectorGroups(v []*VoiceConnectorGroup) *ListVoiceConnectorGroupsOutput { - s.VoiceConnectorGroups = v - return s -} - -type ListVoiceConnectorTerminationCredentialsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 ListVoiceConnectorTerminationCredentialsInput) 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 ListVoiceConnectorTerminationCredentialsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVoiceConnectorTerminationCredentialsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVoiceConnectorTerminationCredentialsInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *ListVoiceConnectorTerminationCredentialsInput) SetVoiceConnectorId(v string) *ListVoiceConnectorTerminationCredentialsInput { - s.VoiceConnectorId = &v - return s -} - -type ListVoiceConnectorTerminationCredentialsOutput struct { - _ struct{} `type:"structure"` - - // A list of user names. - Usernames []*string `type:"list"` -} - -// 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 ListVoiceConnectorTerminationCredentialsOutput) 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 ListVoiceConnectorTerminationCredentialsOutput) GoString() string { - return s.String() -} - -// SetUsernames sets the Usernames field's value. -func (s *ListVoiceConnectorTerminationCredentialsOutput) SetUsernames(v []*string) *ListVoiceConnectorTerminationCredentialsOutput { - s.Usernames = v - return s -} - -type ListVoiceConnectorsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in a single call. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to return the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" 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 ListVoiceConnectorsInput) 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 ListVoiceConnectorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVoiceConnectorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVoiceConnectorsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVoiceConnectorsInput) SetMaxResults(v int64) *ListVoiceConnectorsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVoiceConnectorsInput) SetNextToken(v string) *ListVoiceConnectorsInput { - s.NextToken = &v - return s -} - -type ListVoiceConnectorsOutput struct { - _ struct{} `type:"structure"` - - // The token used to return the next page of results. - NextToken *string `type:"string"` - - // The details of the Voice Connectors. - VoiceConnectors []*VoiceConnector `type:"list"` -} - -// 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 ListVoiceConnectorsOutput) 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 ListVoiceConnectorsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVoiceConnectorsOutput) SetNextToken(v string) *ListVoiceConnectorsOutput { - s.NextToken = &v - return s -} - -// SetVoiceConnectors sets the VoiceConnectors field's value. -func (s *ListVoiceConnectorsOutput) SetVoiceConnectors(v []*VoiceConnector) *ListVoiceConnectorsOutput { - s.VoiceConnectors = v - return s -} - -type ListVoiceProfileDomainsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in a single call. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to return the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" 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 ListVoiceProfileDomainsInput) 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 ListVoiceProfileDomainsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVoiceProfileDomainsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVoiceProfileDomainsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVoiceProfileDomainsInput) SetMaxResults(v int64) *ListVoiceProfileDomainsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVoiceProfileDomainsInput) SetNextToken(v string) *ListVoiceProfileDomainsInput { - s.NextToken = &v - return s -} - -type ListVoiceProfileDomainsOutput struct { - _ struct{} `type:"structure"` - - // The token used to return the next page of results. - NextToken *string `type:"string"` - - // The list of voice profile domains. - VoiceProfileDomains []*VoiceProfileDomainSummary `type:"list"` -} - -// 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 ListVoiceProfileDomainsOutput) 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 ListVoiceProfileDomainsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVoiceProfileDomainsOutput) SetNextToken(v string) *ListVoiceProfileDomainsOutput { - s.NextToken = &v - return s -} - -// SetVoiceProfileDomains sets the VoiceProfileDomains field's value. -func (s *ListVoiceProfileDomainsOutput) SetVoiceProfileDomains(v []*VoiceProfileDomainSummary) *ListVoiceProfileDomainsOutput { - s.VoiceProfileDomains = v - return s -} - -type ListVoiceProfilesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results in the request. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to retrieve the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - // The ID of the voice profile domain. - // - // VoiceProfileDomainId is a required field - VoiceProfileDomainId *string `location:"querystring" locationName:"voice-profile-domain-id" min:"1" 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 ListVoiceProfilesInput) 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 ListVoiceProfilesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVoiceProfilesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVoiceProfilesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.VoiceProfileDomainId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceProfileDomainId")) - } - if s.VoiceProfileDomainId != nil && len(*s.VoiceProfileDomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceProfileDomainId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVoiceProfilesInput) SetMaxResults(v int64) *ListVoiceProfilesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVoiceProfilesInput) SetNextToken(v string) *ListVoiceProfilesInput { - s.NextToken = &v - return s -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *ListVoiceProfilesInput) SetVoiceProfileDomainId(v string) *ListVoiceProfilesInput { - s.VoiceProfileDomainId = &v - return s -} - -type ListVoiceProfilesOutput struct { - _ struct{} `type:"structure"` - - // The token used to retrieve the next page of results. - NextToken *string `type:"string"` - - // The list of voice profiles. - VoiceProfiles []*VoiceProfileSummary `type:"list"` -} - -// 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 ListVoiceProfilesOutput) 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 ListVoiceProfilesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVoiceProfilesOutput) SetNextToken(v string) *ListVoiceProfilesOutput { - s.NextToken = &v - return s -} - -// SetVoiceProfiles sets the VoiceProfiles field's value. -func (s *ListVoiceProfilesOutput) SetVoiceProfiles(v []*VoiceProfileSummary) *ListVoiceProfilesOutput { - s.VoiceProfiles = v - return s -} - -// The logging configuration associated with an Amazon Chime SDK Voice Connector. -// Specifies whether SIP message logs can be sent to Amazon CloudWatch Logs. -type LoggingConfiguration struct { - _ struct{} `type:"structure"` - - // Enables or disables media metrics logging. - EnableMediaMetricLogs *bool `type:"boolean"` - - // Boolean that enables sending SIP message logs to Amazon CloudWatch. - EnableSIPLogs *bool `type:"boolean"` -} - -// 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 LoggingConfiguration) 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 LoggingConfiguration) GoString() string { - return s.String() -} - -// SetEnableMediaMetricLogs sets the EnableMediaMetricLogs field's value. -func (s *LoggingConfiguration) SetEnableMediaMetricLogs(v bool) *LoggingConfiguration { - s.EnableMediaMetricLogs = &v - return s -} - -// SetEnableSIPLogs sets the EnableSIPLogs field's value. -func (s *LoggingConfiguration) SetEnableSIPLogs(v bool) *LoggingConfiguration { - s.EnableSIPLogs = &v - return s -} - -// The configuration for a call analytics task. -type MediaInsightsConfiguration struct { - _ struct{} `type:"structure"` - - // The configuration's ARN. - // - // ConfigurationArn is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by MediaInsightsConfiguration's - // String and GoString methods. - ConfigurationArn *string `min:"1" type:"string" sensitive:"true"` - - // Denotes the configration as enabled or disabled. - Disabled *bool `type:"boolean"` -} - -// 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 MediaInsightsConfiguration) 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 MediaInsightsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MediaInsightsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MediaInsightsConfiguration"} - if s.ConfigurationArn != nil && len(*s.ConfigurationArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurationArn sets the ConfigurationArn field's value. -func (s *MediaInsightsConfiguration) SetConfigurationArn(v string) *MediaInsightsConfiguration { - s.ConfigurationArn = &v - return s -} - -// SetDisabled sets the Disabled field's value. -func (s *MediaInsightsConfiguration) SetDisabled(v bool) *MediaInsightsConfiguration { - s.Disabled = &v - return s -} - -// The requested resource couldn't be found. -type NotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 NotFoundException) 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 NotFoundException) GoString() string { - return s.String() -} - -func newErrorNotFoundException(v protocol.ResponseMetadata) error { - return &NotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *NotFoundException) Code() string { - return "NotFoundException" -} - -// Message returns the exception's message. -func (s *NotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *NotFoundException) OrigErr() error { - return nil -} - -func (s *NotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *NotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *NotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A phone number for which an order has been placed. -type OrderedPhoneNumber struct { - _ struct{} `type:"structure"` - - // The phone number, in E.164 format. - // - // E164PhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by OrderedPhoneNumber's - // String and GoString methods. - E164PhoneNumber *string `type:"string" sensitive:"true"` - - // The phone number status. - Status *string `type:"string" enum:"OrderedPhoneNumberStatus"` -} - -// 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 OrderedPhoneNumber) 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 OrderedPhoneNumber) GoString() string { - return s.String() -} - -// SetE164PhoneNumber sets the E164PhoneNumber field's value. -func (s *OrderedPhoneNumber) SetE164PhoneNumber(v string) *OrderedPhoneNumber { - s.E164PhoneNumber = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *OrderedPhoneNumber) SetStatus(v string) *OrderedPhoneNumber { - s.Status = &v - return s -} - -// Origination settings enable your SIP hosts to receive inbound calls using -// your Amazon Chime SDK Voice Connector. -// -// The parameters listed below are not required, but you must use at least one. -type Origination struct { - _ struct{} `type:"structure"` - - // When origination settings are disabled, inbound calls are not enabled for - // your Amazon Chime SDK Voice Connector. This parameter is not required, but - // you must specify this parameter or Routes. - Disabled *bool `type:"boolean"` - - // The call distribution properties defined for your SIP hosts. Valid range: - // Minimum value of 1. Maximum value of 20. This parameter is not required, - // but you must specify this parameter or Disabled. - Routes []*OriginationRoute `type:"list"` -} - -// 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 Origination) 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 Origination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Origination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Origination"} - if s.Routes != nil { - for i, v := range s.Routes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Routes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDisabled sets the Disabled field's value. -func (s *Origination) SetDisabled(v bool) *Origination { - s.Disabled = &v - return s -} - -// SetRoutes sets the Routes field's value. -func (s *Origination) SetRoutes(v []*OriginationRoute) *Origination { - s.Routes = v - return s -} - -// Origination routes define call distribution properties for your SIP hosts -// to receive inbound calls using an Amazon Chime SDK Voice Connector. Limit: -// Ten origination routes for each Voice Connector. -// -// The parameters listed below are not required, but you must use at least one. -type OriginationRoute struct { - _ struct{} `type:"structure"` - - // The FQDN or IP address to contact for origination traffic. - Host *string `type:"string"` - - // The designated origination route port. Defaults to 5060. - Port *int64 `type:"integer"` - - // The priority associated with the host, with 1 being the highest priority. - // Higher priority hosts are attempted first. - Priority *int64 `min:"1" type:"integer"` - - // The protocol to use for the origination route. Encryption-enabled Amazon - // Chime SDK Voice Connectors use TCP protocol by default. - Protocol *string `type:"string" enum:"OriginationRouteProtocol"` - - // The weight assigned to an origination route. When hosts have equal priority, - // calls are distributed between them based on their relative weights. - Weight *int64 `min:"1" 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 OriginationRoute) 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 OriginationRoute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OriginationRoute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OriginationRoute"} - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - if s.Weight != nil && *s.Weight < 1 { - invalidParams.Add(request.NewErrParamMinValue("Weight", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHost sets the Host field's value. -func (s *OriginationRoute) SetHost(v string) *OriginationRoute { - s.Host = &v - return s -} - -// SetPort sets the Port field's value. -func (s *OriginationRoute) SetPort(v int64) *OriginationRoute { - s.Port = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *OriginationRoute) SetPriority(v int64) *OriginationRoute { - s.Priority = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *OriginationRoute) SetProtocol(v string) *OriginationRoute { - s.Protocol = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *OriginationRoute) SetWeight(v int64) *OriginationRoute { - s.Weight = &v - return s -} - -// The phone number and proxy phone number for a participant in an Amazon Chime -// SDK Voice Connector proxy session. -type Participant struct { - _ struct{} `type:"structure"` - - // The participant's phone number. - // - // PhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Participant's - // String and GoString methods. - PhoneNumber *string `type:"string" sensitive:"true"` - - // The participant's proxy phone number. - // - // ProxyPhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Participant's - // String and GoString methods. - ProxyPhoneNumber *string `type:"string" sensitive:"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 Participant) 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 Participant) GoString() string { - return s.String() -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *Participant) SetPhoneNumber(v string) *Participant { - s.PhoneNumber = &v - return s -} - -// SetProxyPhoneNumber sets the ProxyPhoneNumber field's value. -func (s *Participant) SetProxyPhoneNumber(v string) *Participant { - s.ProxyPhoneNumber = &v - return s -} - -// A phone number used to call an Amazon Chime SDK Voice Connector. -type PhoneNumber struct { - _ struct{} `type:"structure"` - - // The phone number's associations. - Associations []*PhoneNumberAssociation `type:"list"` - - // The outbound calling name associated with the phone number. - // - // CallingName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PhoneNumber's - // String and GoString methods. - CallingName *string `type:"string" sensitive:"true"` - - // The outbound calling name status. - CallingNameStatus *string `type:"string" enum:"CallingNameStatus"` - - // The phone number's capabilities. - Capabilities *PhoneNumberCapabilities `type:"structure"` - - // The phone number's country. Format: ISO 3166-1 alpha-2. - Country *string `type:"string"` - - // The phone number creation timestamp, in ISO 8601 format. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The deleted phone number timestamp, in ISO 8601 format. - DeletionTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The phone number, in E.164 format. - // - // E164PhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PhoneNumber's - // String and GoString methods. - E164PhoneNumber *string `type:"string" sensitive:"true"` - - // The name of the phone number. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PhoneNumber's - // String and GoString methods. - Name *string `type:"string" sensitive:"true"` - - // The phone number's order ID. - OrderId *string `type:"string"` - - // The phone number's ID. - // - // PhoneNumberId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PhoneNumber's - // String and GoString methods. - PhoneNumberId *string `type:"string" sensitive:"true"` - - // The phone number's product type. - ProductType *string `type:"string" enum:"PhoneNumberProductType"` - - // The phone number's status. - Status *string `type:"string" enum:"PhoneNumberStatus"` - - // The phone number's type. - Type *string `type:"string" enum:"PhoneNumberType"` - - // The updated phone number timestamp, in ISO 8601 format. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 PhoneNumber) 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 PhoneNumber) GoString() string { - return s.String() -} - -// SetAssociations sets the Associations field's value. -func (s *PhoneNumber) SetAssociations(v []*PhoneNumberAssociation) *PhoneNumber { - s.Associations = v - return s -} - -// SetCallingName sets the CallingName field's value. -func (s *PhoneNumber) SetCallingName(v string) *PhoneNumber { - s.CallingName = &v - return s -} - -// SetCallingNameStatus sets the CallingNameStatus field's value. -func (s *PhoneNumber) SetCallingNameStatus(v string) *PhoneNumber { - s.CallingNameStatus = &v - return s -} - -// SetCapabilities sets the Capabilities field's value. -func (s *PhoneNumber) SetCapabilities(v *PhoneNumberCapabilities) *PhoneNumber { - s.Capabilities = v - return s -} - -// SetCountry sets the Country field's value. -func (s *PhoneNumber) SetCountry(v string) *PhoneNumber { - s.Country = &v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *PhoneNumber) SetCreatedTimestamp(v time.Time) *PhoneNumber { - s.CreatedTimestamp = &v - return s -} - -// SetDeletionTimestamp sets the DeletionTimestamp field's value. -func (s *PhoneNumber) SetDeletionTimestamp(v time.Time) *PhoneNumber { - s.DeletionTimestamp = &v - return s -} - -// SetE164PhoneNumber sets the E164PhoneNumber field's value. -func (s *PhoneNumber) SetE164PhoneNumber(v string) *PhoneNumber { - s.E164PhoneNumber = &v - return s -} - -// SetName sets the Name field's value. -func (s *PhoneNumber) SetName(v string) *PhoneNumber { - s.Name = &v - return s -} - -// SetOrderId sets the OrderId field's value. -func (s *PhoneNumber) SetOrderId(v string) *PhoneNumber { - s.OrderId = &v - return s -} - -// SetPhoneNumberId sets the PhoneNumberId field's value. -func (s *PhoneNumber) SetPhoneNumberId(v string) *PhoneNumber { - s.PhoneNumberId = &v - return s -} - -// SetProductType sets the ProductType field's value. -func (s *PhoneNumber) SetProductType(v string) *PhoneNumber { - s.ProductType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *PhoneNumber) SetStatus(v string) *PhoneNumber { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *PhoneNumber) SetType(v string) *PhoneNumber { - s.Type = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *PhoneNumber) SetUpdatedTimestamp(v time.Time) *PhoneNumber { - s.UpdatedTimestamp = &v - return s -} - -// The phone number associations, such as an Amazon Chime SDK account ID, user -// ID, Voice Connector ID, or Voice Connector group ID. -type PhoneNumberAssociation struct { - _ struct{} `type:"structure"` - - // The timestamp of the phone number association, in ISO 8601 format. - AssociatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Defines the association with an Amazon Chime SDK account ID, user ID, Voice - // Connector ID, or Voice Connector group ID. - Name *string `type:"string" enum:"PhoneNumberAssociationName"` - - // Contains the ID for the entity specified in Name. - Value *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 PhoneNumberAssociation) 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 PhoneNumberAssociation) GoString() string { - return s.String() -} - -// SetAssociatedTimestamp sets the AssociatedTimestamp field's value. -func (s *PhoneNumberAssociation) SetAssociatedTimestamp(v time.Time) *PhoneNumberAssociation { - s.AssociatedTimestamp = &v - return s -} - -// SetName sets the Name field's value. -func (s *PhoneNumberAssociation) SetName(v string) *PhoneNumberAssociation { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *PhoneNumberAssociation) SetValue(v string) *PhoneNumberAssociation { - s.Value = &v - return s -} - -// The phone number capabilities for Amazon Chime SDK phone numbers, such as -// enabled inbound and outbound calling, and text messaging. -type PhoneNumberCapabilities struct { - _ struct{} `type:"structure"` - - // Allows or denies inbound calling for the specified phone number. - InboundCall *bool `type:"boolean"` - - // Allows or denies inbound MMS messaging for the specified phone number. - InboundMMS *bool `type:"boolean"` - - // Allows or denies inbound SMS messaging for the specified phone number. - InboundSMS *bool `type:"boolean"` - - // Allows or denies outbound calling for the specified phone number. - OutboundCall *bool `type:"boolean"` - - // Allows or denies inbound MMS messaging for the specified phone number. - OutboundMMS *bool `type:"boolean"` - - // Allows or denies outbound SMS messaging for the specified phone number. - OutboundSMS *bool `type:"boolean"` -} - -// 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 PhoneNumberCapabilities) 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 PhoneNumberCapabilities) GoString() string { - return s.String() -} - -// SetInboundCall sets the InboundCall field's value. -func (s *PhoneNumberCapabilities) SetInboundCall(v bool) *PhoneNumberCapabilities { - s.InboundCall = &v - return s -} - -// SetInboundMMS sets the InboundMMS field's value. -func (s *PhoneNumberCapabilities) SetInboundMMS(v bool) *PhoneNumberCapabilities { - s.InboundMMS = &v - return s -} - -// SetInboundSMS sets the InboundSMS field's value. -func (s *PhoneNumberCapabilities) SetInboundSMS(v bool) *PhoneNumberCapabilities { - s.InboundSMS = &v - return s -} - -// SetOutboundCall sets the OutboundCall field's value. -func (s *PhoneNumberCapabilities) SetOutboundCall(v bool) *PhoneNumberCapabilities { - s.OutboundCall = &v - return s -} - -// SetOutboundMMS sets the OutboundMMS field's value. -func (s *PhoneNumberCapabilities) SetOutboundMMS(v bool) *PhoneNumberCapabilities { - s.OutboundMMS = &v - return s -} - -// SetOutboundSMS sets the OutboundSMS field's value. -func (s *PhoneNumberCapabilities) SetOutboundSMS(v bool) *PhoneNumberCapabilities { - s.OutboundSMS = &v - return s -} - -// The phone number's country. -type PhoneNumberCountry struct { - _ struct{} `type:"structure"` - - // The phone number country code. Format: ISO 3166-1 alpha-2. - CountryCode *string `type:"string"` - - // The supported phone number types. - SupportedPhoneNumberTypes []*string `type:"list" enum:"PhoneNumberType"` -} - -// 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 PhoneNumberCountry) 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 PhoneNumberCountry) GoString() string { - return s.String() -} - -// SetCountryCode sets the CountryCode field's value. -func (s *PhoneNumberCountry) SetCountryCode(v string) *PhoneNumberCountry { - s.CountryCode = &v - return s -} - -// SetSupportedPhoneNumberTypes sets the SupportedPhoneNumberTypes field's value. -func (s *PhoneNumberCountry) SetSupportedPhoneNumberTypes(v []*string) *PhoneNumberCountry { - s.SupportedPhoneNumberTypes = v - return s -} - -// If a phone number action fails for one or more of the phone numbers in a -// request, a list of the failed phone numbers is returned, along with error -// codes and error messages. -type PhoneNumberError struct { - _ struct{} `type:"structure"` - - // The error code. - ErrorCode *string `type:"string" enum:"ErrorCode"` - - // The error message. - ErrorMessage *string `type:"string"` - - // The phone number ID for which the action failed. - // - // PhoneNumberId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PhoneNumberError's - // String and GoString methods. - PhoneNumberId *string `type:"string" sensitive:"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 PhoneNumberError) 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 PhoneNumberError) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *PhoneNumberError) SetErrorCode(v string) *PhoneNumberError { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *PhoneNumberError) SetErrorMessage(v string) *PhoneNumberError { - s.ErrorMessage = &v - return s -} - -// SetPhoneNumberId sets the PhoneNumberId field's value. -func (s *PhoneNumberError) SetPhoneNumberId(v string) *PhoneNumberError { - s.PhoneNumberId = &v - return s -} - -// The details of an Amazon Chime SDK phone number order. -type PhoneNumberOrder struct { - _ struct{} `type:"structure"` - - // The phone number order creation time stamp, in ISO 8601 format. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The type of phone number being ordered, local or toll-free. - OrderType *string `type:"string" enum:"PhoneNumberOrderType"` - - // The ordered phone number details, such as the phone number in E.164 format - // and the phone number status. - OrderedPhoneNumbers []*OrderedPhoneNumber `type:"list"` - - // The ID of the phone order. - PhoneNumberOrderId *string `type:"string"` - - // The phone number order product type. - ProductType *string `type:"string" enum:"PhoneNumberProductType"` - - // The status of the phone number order. - Status *string `type:"string" enum:"PhoneNumberOrderStatus"` - - // The updated phone number order time stamp, in ISO 8601 format. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 PhoneNumberOrder) 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 PhoneNumberOrder) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *PhoneNumberOrder) SetCreatedTimestamp(v time.Time) *PhoneNumberOrder { - s.CreatedTimestamp = &v - return s -} - -// SetOrderType sets the OrderType field's value. -func (s *PhoneNumberOrder) SetOrderType(v string) *PhoneNumberOrder { - s.OrderType = &v - return s -} - -// SetOrderedPhoneNumbers sets the OrderedPhoneNumbers field's value. -func (s *PhoneNumberOrder) SetOrderedPhoneNumbers(v []*OrderedPhoneNumber) *PhoneNumberOrder { - s.OrderedPhoneNumbers = v - return s -} - -// SetPhoneNumberOrderId sets the PhoneNumberOrderId field's value. -func (s *PhoneNumberOrder) SetPhoneNumberOrderId(v string) *PhoneNumberOrder { - s.PhoneNumberOrderId = &v - return s -} - -// SetProductType sets the ProductType field's value. -func (s *PhoneNumberOrder) SetProductType(v string) *PhoneNumberOrder { - s.ProductType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *PhoneNumberOrder) SetStatus(v string) *PhoneNumberOrder { - s.Status = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *PhoneNumberOrder) SetUpdatedTimestamp(v time.Time) *PhoneNumberOrder { - s.UpdatedTimestamp = &v - return s -} - -// The proxy configuration for an Amazon Chime SDK Voice Connector. -type Proxy struct { - _ struct{} `type:"structure"` - - // The default number of minutes allowed for proxy sessions. - DefaultSessionExpiryMinutes *int64 `type:"integer"` - - // When true, stops proxy sessions from being created on the specified Amazon - // Chime SDK Voice Connector. - Disabled *bool `type:"boolean"` - - // The phone number to route calls to after a proxy session expires. - // - // FallBackPhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Proxy's - // String and GoString methods. - FallBackPhoneNumber *string `type:"string" sensitive:"true"` - - // The countries for proxy phone numbers to be selected from. - PhoneNumberCountries []*string `type:"list"` -} - -// 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 Proxy) 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 Proxy) GoString() string { - return s.String() -} - -// SetDefaultSessionExpiryMinutes sets the DefaultSessionExpiryMinutes field's value. -func (s *Proxy) SetDefaultSessionExpiryMinutes(v int64) *Proxy { - s.DefaultSessionExpiryMinutes = &v - return s -} - -// SetDisabled sets the Disabled field's value. -func (s *Proxy) SetDisabled(v bool) *Proxy { - s.Disabled = &v - return s -} - -// SetFallBackPhoneNumber sets the FallBackPhoneNumber field's value. -func (s *Proxy) SetFallBackPhoneNumber(v string) *Proxy { - s.FallBackPhoneNumber = &v - return s -} - -// SetPhoneNumberCountries sets the PhoneNumberCountries field's value. -func (s *Proxy) SetPhoneNumberCountries(v []*string) *Proxy { - s.PhoneNumberCountries = v - return s -} - -// The proxy session for an Amazon Chime SDK Voice Connector. -type ProxySession struct { - _ struct{} `type:"structure"` - - // The proxy session capabilities. - Capabilities []*string `type:"list" enum:"Capability"` - - // The created time stamp, in ISO 8601 format. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The ended time stamp, in ISO 8601 format. - EndedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The number of minutes allowed for the proxy session. - ExpiryMinutes *int64 `min:"1" type:"integer"` - - // The preference for matching the country or area code of the proxy phone number - // with that of the first participant. - GeoMatchLevel *string `type:"string" enum:"GeoMatchLevel"` - - // The country and area code for the proxy phone number. - GeoMatchParams *GeoMatchParams `type:"structure"` - - // The proxy session name. - Name *string `type:"string"` - - // The preference for proxy phone number reuse, or stickiness, between the same - // participants across sessions. - NumberSelectionBehavior *string `type:"string" enum:"NumberSelectionBehavior"` - - // The proxy session participants. - Participants []*Participant `type:"list"` - - // The proxy session ID. - ProxySessionId *string `min:"1" type:"string"` - - // The proxy session status. - Status *string `type:"string" enum:"ProxySessionStatus"` - - // The updated time stamp, in ISO 8601 format. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The Voice Connector ID. - VoiceConnectorId *string `min:"1" 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 ProxySession) 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 ProxySession) GoString() string { - return s.String() -} - -// SetCapabilities sets the Capabilities field's value. -func (s *ProxySession) SetCapabilities(v []*string) *ProxySession { - s.Capabilities = v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *ProxySession) SetCreatedTimestamp(v time.Time) *ProxySession { - s.CreatedTimestamp = &v - return s -} - -// SetEndedTimestamp sets the EndedTimestamp field's value. -func (s *ProxySession) SetEndedTimestamp(v time.Time) *ProxySession { - s.EndedTimestamp = &v - return s -} - -// SetExpiryMinutes sets the ExpiryMinutes field's value. -func (s *ProxySession) SetExpiryMinutes(v int64) *ProxySession { - s.ExpiryMinutes = &v - return s -} - -// SetGeoMatchLevel sets the GeoMatchLevel field's value. -func (s *ProxySession) SetGeoMatchLevel(v string) *ProxySession { - s.GeoMatchLevel = &v - return s -} - -// SetGeoMatchParams sets the GeoMatchParams field's value. -func (s *ProxySession) SetGeoMatchParams(v *GeoMatchParams) *ProxySession { - s.GeoMatchParams = v - return s -} - -// SetName sets the Name field's value. -func (s *ProxySession) SetName(v string) *ProxySession { - s.Name = &v - return s -} - -// SetNumberSelectionBehavior sets the NumberSelectionBehavior field's value. -func (s *ProxySession) SetNumberSelectionBehavior(v string) *ProxySession { - s.NumberSelectionBehavior = &v - return s -} - -// SetParticipants sets the Participants field's value. -func (s *ProxySession) SetParticipants(v []*Participant) *ProxySession { - s.Participants = v - return s -} - -// SetProxySessionId sets the ProxySessionId field's value. -func (s *ProxySession) SetProxySessionId(v string) *ProxySession { - s.ProxySessionId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ProxySession) SetStatus(v string) *ProxySession { - s.Status = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *ProxySession) SetUpdatedTimestamp(v time.Time) *ProxySession { - s.UpdatedTimestamp = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *ProxySession) SetVoiceConnectorId(v string) *ProxySession { - s.VoiceConnectorId = &v - return s -} - -type PutSipMediaApplicationAlexaSkillConfigurationInput struct { - _ struct{} `type:"structure"` - - // The Alexa Skill configuration. - SipMediaApplicationAlexaSkillConfiguration *SipMediaApplicationAlexaSkillConfiguration `type:"structure"` - - // The SIP media application ID. - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" 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 PutSipMediaApplicationAlexaSkillConfigurationInput) 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 PutSipMediaApplicationAlexaSkillConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutSipMediaApplicationAlexaSkillConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutSipMediaApplicationAlexaSkillConfigurationInput"} - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - if s.SipMediaApplicationAlexaSkillConfiguration != nil { - if err := s.SipMediaApplicationAlexaSkillConfiguration.Validate(); err != nil { - invalidParams.AddNested("SipMediaApplicationAlexaSkillConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSipMediaApplicationAlexaSkillConfiguration sets the SipMediaApplicationAlexaSkillConfiguration field's value. -func (s *PutSipMediaApplicationAlexaSkillConfigurationInput) SetSipMediaApplicationAlexaSkillConfiguration(v *SipMediaApplicationAlexaSkillConfiguration) *PutSipMediaApplicationAlexaSkillConfigurationInput { - s.SipMediaApplicationAlexaSkillConfiguration = v - return s -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *PutSipMediaApplicationAlexaSkillConfigurationInput) SetSipMediaApplicationId(v string) *PutSipMediaApplicationAlexaSkillConfigurationInput { - s.SipMediaApplicationId = &v - return s -} - -type PutSipMediaApplicationAlexaSkillConfigurationOutput struct { - _ struct{} `type:"structure"` - - // Returns the Alexa Skill configuration. - SipMediaApplicationAlexaSkillConfiguration *SipMediaApplicationAlexaSkillConfiguration `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 PutSipMediaApplicationAlexaSkillConfigurationOutput) 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 PutSipMediaApplicationAlexaSkillConfigurationOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplicationAlexaSkillConfiguration sets the SipMediaApplicationAlexaSkillConfiguration field's value. -func (s *PutSipMediaApplicationAlexaSkillConfigurationOutput) SetSipMediaApplicationAlexaSkillConfiguration(v *SipMediaApplicationAlexaSkillConfiguration) *PutSipMediaApplicationAlexaSkillConfigurationOutput { - s.SipMediaApplicationAlexaSkillConfiguration = v - return s -} - -type PutSipMediaApplicationLoggingConfigurationInput struct { - _ struct{} `type:"structure"` - - // The SIP media application ID. - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" type:"string" required:"true"` - - // The logging configuration for the specified SIP media application. - SipMediaApplicationLoggingConfiguration *SipMediaApplicationLoggingConfiguration `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 PutSipMediaApplicationLoggingConfigurationInput) 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 PutSipMediaApplicationLoggingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutSipMediaApplicationLoggingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutSipMediaApplicationLoggingConfigurationInput"} - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *PutSipMediaApplicationLoggingConfigurationInput) SetSipMediaApplicationId(v string) *PutSipMediaApplicationLoggingConfigurationInput { - s.SipMediaApplicationId = &v - return s -} - -// SetSipMediaApplicationLoggingConfiguration sets the SipMediaApplicationLoggingConfiguration field's value. -func (s *PutSipMediaApplicationLoggingConfigurationInput) SetSipMediaApplicationLoggingConfiguration(v *SipMediaApplicationLoggingConfiguration) *PutSipMediaApplicationLoggingConfigurationInput { - s.SipMediaApplicationLoggingConfiguration = v - return s -} - -type PutSipMediaApplicationLoggingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The updated logging configuration for the specified SIP media application. - SipMediaApplicationLoggingConfiguration *SipMediaApplicationLoggingConfiguration `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 PutSipMediaApplicationLoggingConfigurationOutput) 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 PutSipMediaApplicationLoggingConfigurationOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplicationLoggingConfiguration sets the SipMediaApplicationLoggingConfiguration field's value. -func (s *PutSipMediaApplicationLoggingConfigurationOutput) SetSipMediaApplicationLoggingConfiguration(v *SipMediaApplicationLoggingConfiguration) *PutSipMediaApplicationLoggingConfigurationOutput { - s.SipMediaApplicationLoggingConfiguration = v - return s -} - -type PutVoiceConnectorEmergencyCallingConfigurationInput struct { - _ struct{} `type:"structure"` - - // The configuration being updated. - // - // EmergencyCallingConfiguration is a required field - EmergencyCallingConfiguration *EmergencyCallingConfiguration `type:"structure" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 PutVoiceConnectorEmergencyCallingConfigurationInput) 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 PutVoiceConnectorEmergencyCallingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutVoiceConnectorEmergencyCallingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutVoiceConnectorEmergencyCallingConfigurationInput"} - if s.EmergencyCallingConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("EmergencyCallingConfiguration")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - if s.EmergencyCallingConfiguration != nil { - if err := s.EmergencyCallingConfiguration.Validate(); err != nil { - invalidParams.AddNested("EmergencyCallingConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEmergencyCallingConfiguration sets the EmergencyCallingConfiguration field's value. -func (s *PutVoiceConnectorEmergencyCallingConfigurationInput) SetEmergencyCallingConfiguration(v *EmergencyCallingConfiguration) *PutVoiceConnectorEmergencyCallingConfigurationInput { - s.EmergencyCallingConfiguration = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *PutVoiceConnectorEmergencyCallingConfigurationInput) SetVoiceConnectorId(v string) *PutVoiceConnectorEmergencyCallingConfigurationInput { - s.VoiceConnectorId = &v - return s -} - -type PutVoiceConnectorEmergencyCallingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The updated configuration. - EmergencyCallingConfiguration *EmergencyCallingConfiguration `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 PutVoiceConnectorEmergencyCallingConfigurationOutput) 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 PutVoiceConnectorEmergencyCallingConfigurationOutput) GoString() string { - return s.String() -} - -// SetEmergencyCallingConfiguration sets the EmergencyCallingConfiguration field's value. -func (s *PutVoiceConnectorEmergencyCallingConfigurationOutput) SetEmergencyCallingConfiguration(v *EmergencyCallingConfiguration) *PutVoiceConnectorEmergencyCallingConfigurationOutput { - s.EmergencyCallingConfiguration = v - return s -} - -type PutVoiceConnectorLoggingConfigurationInput struct { - _ struct{} `type:"structure"` - - // The logging configuration being updated. - // - // LoggingConfiguration is a required field - LoggingConfiguration *LoggingConfiguration `type:"structure" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 PutVoiceConnectorLoggingConfigurationInput) 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 PutVoiceConnectorLoggingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutVoiceConnectorLoggingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutVoiceConnectorLoggingConfigurationInput"} - if s.LoggingConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("LoggingConfiguration")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoggingConfiguration sets the LoggingConfiguration field's value. -func (s *PutVoiceConnectorLoggingConfigurationInput) SetLoggingConfiguration(v *LoggingConfiguration) *PutVoiceConnectorLoggingConfigurationInput { - s.LoggingConfiguration = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *PutVoiceConnectorLoggingConfigurationInput) SetVoiceConnectorId(v string) *PutVoiceConnectorLoggingConfigurationInput { - s.VoiceConnectorId = &v - return s -} - -type PutVoiceConnectorLoggingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The updated logging configuration. - LoggingConfiguration *LoggingConfiguration `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 PutVoiceConnectorLoggingConfigurationOutput) 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 PutVoiceConnectorLoggingConfigurationOutput) GoString() string { - return s.String() -} - -// SetLoggingConfiguration sets the LoggingConfiguration field's value. -func (s *PutVoiceConnectorLoggingConfigurationOutput) SetLoggingConfiguration(v *LoggingConfiguration) *PutVoiceConnectorLoggingConfigurationOutput { - s.LoggingConfiguration = v - return s -} - -type PutVoiceConnectorOriginationInput struct { - _ struct{} `type:"structure"` - - // The origination settings being updated. - // - // Origination is a required field - Origination *Origination `type:"structure" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 PutVoiceConnectorOriginationInput) 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 PutVoiceConnectorOriginationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutVoiceConnectorOriginationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutVoiceConnectorOriginationInput"} - if s.Origination == nil { - invalidParams.Add(request.NewErrParamRequired("Origination")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - if s.Origination != nil { - if err := s.Origination.Validate(); err != nil { - invalidParams.AddNested("Origination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOrigination sets the Origination field's value. -func (s *PutVoiceConnectorOriginationInput) SetOrigination(v *Origination) *PutVoiceConnectorOriginationInput { - s.Origination = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *PutVoiceConnectorOriginationInput) SetVoiceConnectorId(v string) *PutVoiceConnectorOriginationInput { - s.VoiceConnectorId = &v - return s -} - -type PutVoiceConnectorOriginationOutput struct { - _ struct{} `type:"structure"` - - // The updated origination settings. - Origination *Origination `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 PutVoiceConnectorOriginationOutput) 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 PutVoiceConnectorOriginationOutput) GoString() string { - return s.String() -} - -// SetOrigination sets the Origination field's value. -func (s *PutVoiceConnectorOriginationOutput) SetOrigination(v *Origination) *PutVoiceConnectorOriginationOutput { - s.Origination = v - return s -} - -type PutVoiceConnectorProxyInput struct { - _ struct{} `type:"structure"` - - // The default number of minutes allowed for proxy session. - // - // DefaultSessionExpiryMinutes is a required field - DefaultSessionExpiryMinutes *int64 `type:"integer" required:"true"` - - // When true, stops proxy sessions from being created on the specified Amazon - // Chime SDK Voice Connector. - Disabled *bool `type:"boolean"` - - // The phone number to route calls to after a proxy session expires. - // - // FallBackPhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PutVoiceConnectorProxyInput's - // String and GoString methods. - FallBackPhoneNumber *string `type:"string" sensitive:"true"` - - // The countries for proxy phone numbers to be selected from. - // - // PhoneNumberPoolCountries is a required field - PhoneNumberPoolCountries []*string `min:"1" type:"list" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" min:"1" 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 PutVoiceConnectorProxyInput) 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 PutVoiceConnectorProxyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutVoiceConnectorProxyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutVoiceConnectorProxyInput"} - if s.DefaultSessionExpiryMinutes == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultSessionExpiryMinutes")) - } - if s.PhoneNumberPoolCountries == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumberPoolCountries")) - } - if s.PhoneNumberPoolCountries != nil && len(s.PhoneNumberPoolCountries) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PhoneNumberPoolCountries", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultSessionExpiryMinutes sets the DefaultSessionExpiryMinutes field's value. -func (s *PutVoiceConnectorProxyInput) SetDefaultSessionExpiryMinutes(v int64) *PutVoiceConnectorProxyInput { - s.DefaultSessionExpiryMinutes = &v - return s -} - -// SetDisabled sets the Disabled field's value. -func (s *PutVoiceConnectorProxyInput) SetDisabled(v bool) *PutVoiceConnectorProxyInput { - s.Disabled = &v - return s -} - -// SetFallBackPhoneNumber sets the FallBackPhoneNumber field's value. -func (s *PutVoiceConnectorProxyInput) SetFallBackPhoneNumber(v string) *PutVoiceConnectorProxyInput { - s.FallBackPhoneNumber = &v - return s -} - -// SetPhoneNumberPoolCountries sets the PhoneNumberPoolCountries field's value. -func (s *PutVoiceConnectorProxyInput) SetPhoneNumberPoolCountries(v []*string) *PutVoiceConnectorProxyInput { - s.PhoneNumberPoolCountries = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *PutVoiceConnectorProxyInput) SetVoiceConnectorId(v string) *PutVoiceConnectorProxyInput { - s.VoiceConnectorId = &v - return s -} - -type PutVoiceConnectorProxyOutput struct { - _ struct{} `type:"structure"` - - // The proxy configuration details. - Proxy *Proxy `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 PutVoiceConnectorProxyOutput) 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 PutVoiceConnectorProxyOutput) GoString() string { - return s.String() -} - -// SetProxy sets the Proxy field's value. -func (s *PutVoiceConnectorProxyOutput) SetProxy(v *Proxy) *PutVoiceConnectorProxyOutput { - s.Proxy = v - return s -} - -type PutVoiceConnectorStreamingConfigurationInput struct { - _ struct{} `type:"structure"` - - // The streaming settings being updated. - // - // StreamingConfiguration is a required field - StreamingConfiguration *StreamingConfiguration `type:"structure" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 PutVoiceConnectorStreamingConfigurationInput) 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 PutVoiceConnectorStreamingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutVoiceConnectorStreamingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutVoiceConnectorStreamingConfigurationInput"} - if s.StreamingConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("StreamingConfiguration")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - if s.StreamingConfiguration != nil { - if err := s.StreamingConfiguration.Validate(); err != nil { - invalidParams.AddNested("StreamingConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStreamingConfiguration sets the StreamingConfiguration field's value. -func (s *PutVoiceConnectorStreamingConfigurationInput) SetStreamingConfiguration(v *StreamingConfiguration) *PutVoiceConnectorStreamingConfigurationInput { - s.StreamingConfiguration = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *PutVoiceConnectorStreamingConfigurationInput) SetVoiceConnectorId(v string) *PutVoiceConnectorStreamingConfigurationInput { - s.VoiceConnectorId = &v - return s -} - -type PutVoiceConnectorStreamingConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The updated streaming settings. - StreamingConfiguration *StreamingConfiguration `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 PutVoiceConnectorStreamingConfigurationOutput) 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 PutVoiceConnectorStreamingConfigurationOutput) GoString() string { - return s.String() -} - -// SetStreamingConfiguration sets the StreamingConfiguration field's value. -func (s *PutVoiceConnectorStreamingConfigurationOutput) SetStreamingConfiguration(v *StreamingConfiguration) *PutVoiceConnectorStreamingConfigurationOutput { - s.StreamingConfiguration = v - return s -} - -type PutVoiceConnectorTerminationCredentialsInput struct { - _ struct{} `type:"structure"` - - // The termination credentials being updated. - Credentials []*Credential `type:"list"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 PutVoiceConnectorTerminationCredentialsInput) 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 PutVoiceConnectorTerminationCredentialsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutVoiceConnectorTerminationCredentialsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutVoiceConnectorTerminationCredentialsInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCredentials sets the Credentials field's value. -func (s *PutVoiceConnectorTerminationCredentialsInput) SetCredentials(v []*Credential) *PutVoiceConnectorTerminationCredentialsInput { - s.Credentials = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *PutVoiceConnectorTerminationCredentialsInput) SetVoiceConnectorId(v string) *PutVoiceConnectorTerminationCredentialsInput { - s.VoiceConnectorId = &v - return s -} - -type PutVoiceConnectorTerminationCredentialsOutput 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 PutVoiceConnectorTerminationCredentialsOutput) 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 PutVoiceConnectorTerminationCredentialsOutput) GoString() string { - return s.String() -} - -type PutVoiceConnectorTerminationInput struct { - _ struct{} `type:"structure"` - - // The termination settings to be updated. - // - // Termination is a required field - Termination *Termination `type:"structure" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 PutVoiceConnectorTerminationInput) 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 PutVoiceConnectorTerminationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutVoiceConnectorTerminationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutVoiceConnectorTerminationInput"} - if s.Termination == nil { - invalidParams.Add(request.NewErrParamRequired("Termination")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - if s.Termination != nil { - if err := s.Termination.Validate(); err != nil { - invalidParams.AddNested("Termination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTermination sets the Termination field's value. -func (s *PutVoiceConnectorTerminationInput) SetTermination(v *Termination) *PutVoiceConnectorTerminationInput { - s.Termination = v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *PutVoiceConnectorTerminationInput) SetVoiceConnectorId(v string) *PutVoiceConnectorTerminationInput { - s.VoiceConnectorId = &v - return s -} - -type PutVoiceConnectorTerminationOutput struct { - _ struct{} `type:"structure"` - - // The updated termination settings. - Termination *Termination `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 PutVoiceConnectorTerminationOutput) 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 PutVoiceConnectorTerminationOutput) GoString() string { - return s.String() -} - -// SetTermination sets the Termination field's value. -func (s *PutVoiceConnectorTerminationOutput) SetTermination(v *Termination) *PutVoiceConnectorTerminationOutput { - s.Termination = v - return s -} - -// The request exceeds the resource limit. -type ResourceLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceLimitExceededException) 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 ResourceLimitExceededException) GoString() string { - return s.String() -} - -func newErrorResourceLimitExceededException(v protocol.ResponseMetadata) error { - return &ResourceLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceLimitExceededException) Code() string { - return "ResourceLimitExceededException" -} - -// Message returns the exception's message. -func (s *ResourceLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceLimitExceededException) OrigErr() error { - return nil -} - -func (s *ResourceLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type RestorePhoneNumberInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the phone number being restored. - // - // PhoneNumberId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RestorePhoneNumberInput's - // String and GoString methods. - // - // PhoneNumberId is a required field - PhoneNumberId *string `location:"uri" locationName:"phoneNumberId" type:"string" required:"true" sensitive:"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 RestorePhoneNumberInput) 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 RestorePhoneNumberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestorePhoneNumberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestorePhoneNumberInput"} - if s.PhoneNumberId == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumberId")) - } - if s.PhoneNumberId != nil && len(*s.PhoneNumberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PhoneNumberId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPhoneNumberId sets the PhoneNumberId field's value. -func (s *RestorePhoneNumberInput) SetPhoneNumberId(v string) *RestorePhoneNumberInput { - s.PhoneNumberId = &v - return s -} - -type RestorePhoneNumberOutput struct { - _ struct{} `type:"structure"` - - // The restored phone number. - PhoneNumber *PhoneNumber `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 RestorePhoneNumberOutput) 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 RestorePhoneNumberOutput) GoString() string { - return s.String() -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *RestorePhoneNumberOutput) SetPhoneNumber(v *PhoneNumber) *RestorePhoneNumberOutput { - s.PhoneNumber = v - return s -} - -type SearchAvailablePhoneNumbersInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Confines a search to just the phone numbers associated with the specified - // area code. - AreaCode *string `location:"querystring" locationName:"area-code" type:"string"` - - // Confines a search to just the phone numbers associated with the specified - // city. - City *string `location:"querystring" locationName:"city" type:"string"` - - // Confines a search to just the phone numbers associated with the specified - // country. - Country *string `location:"querystring" locationName:"country" type:"string"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The token used to return the next page of results. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - // Confines a search to just the phone numbers associated with the specified - // phone number type, either local or toll-free. - PhoneNumberType *string `location:"querystring" locationName:"phone-number-type" type:"string" enum:"PhoneNumberType"` - - // Confines a search to just the phone numbers associated with the specified - // state. - State *string `location:"querystring" locationName:"state" type:"string"` - - // Confines a search to just the phone numbers associated with the specified - // toll-free prefix. - TollFreePrefix *string `location:"querystring" locationName:"toll-free-prefix" min:"3" 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 SearchAvailablePhoneNumbersInput) 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 SearchAvailablePhoneNumbersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchAvailablePhoneNumbersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchAvailablePhoneNumbersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.TollFreePrefix != nil && len(*s.TollFreePrefix) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TollFreePrefix", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAreaCode sets the AreaCode field's value. -func (s *SearchAvailablePhoneNumbersInput) SetAreaCode(v string) *SearchAvailablePhoneNumbersInput { - s.AreaCode = &v - return s -} - -// SetCity sets the City field's value. -func (s *SearchAvailablePhoneNumbersInput) SetCity(v string) *SearchAvailablePhoneNumbersInput { - s.City = &v - return s -} - -// SetCountry sets the Country field's value. -func (s *SearchAvailablePhoneNumbersInput) SetCountry(v string) *SearchAvailablePhoneNumbersInput { - s.Country = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchAvailablePhoneNumbersInput) SetMaxResults(v int64) *SearchAvailablePhoneNumbersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchAvailablePhoneNumbersInput) SetNextToken(v string) *SearchAvailablePhoneNumbersInput { - s.NextToken = &v - return s -} - -// SetPhoneNumberType sets the PhoneNumberType field's value. -func (s *SearchAvailablePhoneNumbersInput) SetPhoneNumberType(v string) *SearchAvailablePhoneNumbersInput { - s.PhoneNumberType = &v - return s -} - -// SetState sets the State field's value. -func (s *SearchAvailablePhoneNumbersInput) SetState(v string) *SearchAvailablePhoneNumbersInput { - s.State = &v - return s -} - -// SetTollFreePrefix sets the TollFreePrefix field's value. -func (s *SearchAvailablePhoneNumbersInput) SetTollFreePrefix(v string) *SearchAvailablePhoneNumbersInput { - s.TollFreePrefix = &v - return s -} - -type SearchAvailablePhoneNumbersOutput struct { - _ struct{} `type:"structure"` - - // Confines a search to just the phone numbers in the E.164 format. - E164PhoneNumbers []*string `type:"list"` - - // The token used to return the next page of results. - NextToken *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 SearchAvailablePhoneNumbersOutput) 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 SearchAvailablePhoneNumbersOutput) GoString() string { - return s.String() -} - -// SetE164PhoneNumbers sets the E164PhoneNumbers field's value. -func (s *SearchAvailablePhoneNumbersOutput) SetE164PhoneNumbers(v []*string) *SearchAvailablePhoneNumbersOutput { - s.E164PhoneNumbers = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchAvailablePhoneNumbersOutput) SetNextToken(v string) *SearchAvailablePhoneNumbersOutput { - s.NextToken = &v - return s -} - -// A structure that contains the configuration settings for server-side encryption. -// -// We only support symmetric keys. Do not use asymmetric or HMAC keys, or KMS -// aliases. -type ServerSideEncryptionConfiguration struct { - _ struct{} `type:"structure"` - - // The ARN of the KMS key used to encrypt the enrollment data in a voice profile - // domain. Asymmetric customer managed keys are not supported. - // - // KmsKeyArn is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ServerSideEncryptionConfiguration's - // String and GoString methods. - // - // KmsKeyArn is a required field - KmsKeyArn *string `min:"1" type:"string" required:"true" sensitive:"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 ServerSideEncryptionConfiguration) 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 ServerSideEncryptionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ServerSideEncryptionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionConfiguration"} - if s.KmsKeyArn == nil { - invalidParams.Add(request.NewErrParamRequired("KmsKeyArn")) - } - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *ServerSideEncryptionConfiguration) SetKmsKeyArn(v string) *ServerSideEncryptionConfiguration { - s.KmsKeyArn = &v - return s -} - -// The service encountered an unexpected error. -type ServiceFailureException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceFailureException) 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 ServiceFailureException) GoString() string { - return s.String() -} - -func newErrorServiceFailureException(v protocol.ResponseMetadata) error { - return &ServiceFailureException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceFailureException) Code() string { - return "ServiceFailureException" -} - -// Message returns the exception's message. -func (s *ServiceFailureException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceFailureException) OrigErr() error { - return nil -} - -func (s *ServiceFailureException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceFailureException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceFailureException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The service is currently unavailable. -type ServiceUnavailableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceUnavailableException) 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 ServiceUnavailableException) GoString() string { - return s.String() -} - -func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { - return &ServiceUnavailableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceUnavailableException) Code() string { - return "ServiceUnavailableException" -} - -// Message returns the exception's message. -func (s *ServiceUnavailableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceUnavailableException) OrigErr() error { - return nil -} - -func (s *ServiceUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceUnavailableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceUnavailableException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The details of the SIP media application, including name and endpoints. An -// AWS account can have multiple SIP media applications. -type SipMediaApplication struct { - _ struct{} `type:"structure"` - - // The AWS Region in which the SIP media application is created. - AwsRegion *string `type:"string"` - - // The SIP media application creation timestamp, in ISO 8601 format. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // List of endpoints for a SIP media application. Currently, only one endpoint - // per SIP media application is permitted. - Endpoints []*SipMediaApplicationEndpoint `min:"1" type:"list"` - - // The SIP media application's name. - Name *string `min:"1" type:"string"` - - // The ARN of the SIP media application. - SipMediaApplicationArn *string `type:"string"` - - // A SIP media application's ID. - SipMediaApplicationId *string `type:"string"` - - // The time at which the SIP media application was updated. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 SipMediaApplication) 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 SipMediaApplication) GoString() string { - return s.String() -} - -// SetAwsRegion sets the AwsRegion field's value. -func (s *SipMediaApplication) SetAwsRegion(v string) *SipMediaApplication { - s.AwsRegion = &v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *SipMediaApplication) SetCreatedTimestamp(v time.Time) *SipMediaApplication { - s.CreatedTimestamp = &v - return s -} - -// SetEndpoints sets the Endpoints field's value. -func (s *SipMediaApplication) SetEndpoints(v []*SipMediaApplicationEndpoint) *SipMediaApplication { - s.Endpoints = v - return s -} - -// SetName sets the Name field's value. -func (s *SipMediaApplication) SetName(v string) *SipMediaApplication { - s.Name = &v - return s -} - -// SetSipMediaApplicationArn sets the SipMediaApplicationArn field's value. -func (s *SipMediaApplication) SetSipMediaApplicationArn(v string) *SipMediaApplication { - s.SipMediaApplicationArn = &v - return s -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *SipMediaApplication) SetSipMediaApplicationId(v string) *SipMediaApplication { - s.SipMediaApplicationId = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *SipMediaApplication) SetUpdatedTimestamp(v time.Time) *SipMediaApplication { - s.UpdatedTimestamp = &v - return s -} - -// The Alexa Skill configuration of a SIP media application. -type SipMediaApplicationAlexaSkillConfiguration struct { - _ struct{} `type:"structure"` - - // The ID of the Alexa Skill configuration. - // - // AlexaSkillIds is a required field - AlexaSkillIds []*string `min:"1" type:"list" required:"true"` - - // The status of the Alexa Skill configuration. - // - // AlexaSkillStatus is a required field - AlexaSkillStatus *string `type:"string" required:"true" enum:"AlexaSkillStatus"` -} - -// 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 SipMediaApplicationAlexaSkillConfiguration) 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 SipMediaApplicationAlexaSkillConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SipMediaApplicationAlexaSkillConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SipMediaApplicationAlexaSkillConfiguration"} - if s.AlexaSkillIds == nil { - invalidParams.Add(request.NewErrParamRequired("AlexaSkillIds")) - } - if s.AlexaSkillIds != nil && len(s.AlexaSkillIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlexaSkillIds", 1)) - } - if s.AlexaSkillStatus == nil { - invalidParams.Add(request.NewErrParamRequired("AlexaSkillStatus")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlexaSkillIds sets the AlexaSkillIds field's value. -func (s *SipMediaApplicationAlexaSkillConfiguration) SetAlexaSkillIds(v []*string) *SipMediaApplicationAlexaSkillConfiguration { - s.AlexaSkillIds = v - return s -} - -// SetAlexaSkillStatus sets the AlexaSkillStatus field's value. -func (s *SipMediaApplicationAlexaSkillConfiguration) SetAlexaSkillStatus(v string) *SipMediaApplicationAlexaSkillConfiguration { - s.AlexaSkillStatus = &v - return s -} - -// A Call instance for a SIP media application. -type SipMediaApplicationCall struct { - _ struct{} `type:"structure"` - - // The call's transaction ID. - TransactionId *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 SipMediaApplicationCall) 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 SipMediaApplicationCall) GoString() string { - return s.String() -} - -// SetTransactionId sets the TransactionId field's value. -func (s *SipMediaApplicationCall) SetTransactionId(v string) *SipMediaApplicationCall { - s.TransactionId = &v - return s -} - -// The endpoint assigned to a SIP media application. -type SipMediaApplicationEndpoint struct { - _ struct{} `type:"structure"` - - // Valid Amazon Resource Name (ARN) of the Lambda function, version, or alias. - // The function must be created in the same AWS Region as the SIP media application. - // - // LambdaArn is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SipMediaApplicationEndpoint's - // String and GoString methods. - LambdaArn *string `type:"string" sensitive:"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 SipMediaApplicationEndpoint) 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 SipMediaApplicationEndpoint) GoString() string { - return s.String() -} - -// SetLambdaArn sets the LambdaArn field's value. -func (s *SipMediaApplicationEndpoint) SetLambdaArn(v string) *SipMediaApplicationEndpoint { - s.LambdaArn = &v - return s -} - -// The logging configuration of a SIP media application. -type SipMediaApplicationLoggingConfiguration struct { - _ struct{} `type:"structure"` - - // Enables message logging for the specified SIP media application. - EnableSipMediaApplicationMessageLogs *bool `type:"boolean"` -} - -// 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 SipMediaApplicationLoggingConfiguration) 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 SipMediaApplicationLoggingConfiguration) GoString() string { - return s.String() -} - -// SetEnableSipMediaApplicationMessageLogs sets the EnableSipMediaApplicationMessageLogs field's value. -func (s *SipMediaApplicationLoggingConfiguration) SetEnableSipMediaApplicationMessageLogs(v bool) *SipMediaApplicationLoggingConfiguration { - s.EnableSipMediaApplicationMessageLogs = &v - return s -} - -// The details of a SIP rule, including name, triggers, and target applications. -// An AWS account can have multiple SIP rules. -type SipRule struct { - _ struct{} `type:"structure"` - - // The time at which the SIP rule was created, in ISO 8601 format. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether the SIP rule is enabled or disabled. You must disable a - // rule before you can delete it. - Disabled *bool `type:"boolean"` - - // A SIP rule's name. - Name *string `min:"1" type:"string"` - - // A SIP rule's ID. - SipRuleId *string `type:"string"` - - // The target SIP media application and other details, such as priority and - // AWS Region, to be specified in the SIP rule. Only one SIP rule per AWS Region - // can be provided. - TargetApplications []*SipRuleTargetApplication `min:"1" type:"list"` - - // The type of trigger set for a SIP rule, either a phone number or a URI request - // host name. - TriggerType *string `type:"string" enum:"SipRuleTriggerType"` - - // The value set for a SIP rule's trigger type. Either a phone number or a URI - // hostname. - TriggerValue *string `type:"string"` - - // The time at which the SIP rule was updated, in ISO 8601 format. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 SipRule) 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 SipRule) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *SipRule) SetCreatedTimestamp(v time.Time) *SipRule { - s.CreatedTimestamp = &v - return s -} - -// SetDisabled sets the Disabled field's value. -func (s *SipRule) SetDisabled(v bool) *SipRule { - s.Disabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *SipRule) SetName(v string) *SipRule { - s.Name = &v - return s -} - -// SetSipRuleId sets the SipRuleId field's value. -func (s *SipRule) SetSipRuleId(v string) *SipRule { - s.SipRuleId = &v - return s -} - -// SetTargetApplications sets the TargetApplications field's value. -func (s *SipRule) SetTargetApplications(v []*SipRuleTargetApplication) *SipRule { - s.TargetApplications = v - return s -} - -// SetTriggerType sets the TriggerType field's value. -func (s *SipRule) SetTriggerType(v string) *SipRule { - s.TriggerType = &v - return s -} - -// SetTriggerValue sets the TriggerValue field's value. -func (s *SipRule) SetTriggerValue(v string) *SipRule { - s.TriggerValue = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *SipRule) SetUpdatedTimestamp(v time.Time) *SipRule { - s.UpdatedTimestamp = &v - return s -} - -// A target SIP media application and other details, such as priority and AWS -// Region, to be specified in the SIP rule. Only one SIP rule per AWS Region -// can be provided. -type SipRuleTargetApplication struct { - _ struct{} `type:"structure"` - - // The AWS Region of a rule's target SIP media application. - AwsRegion *string `type:"string"` - - // The priority setting of a rule's target SIP media application. - Priority *int64 `min:"1" type:"integer"` - - // The ID of a rule's target SIP media application. - SipMediaApplicationId *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 SipRuleTargetApplication) 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 SipRuleTargetApplication) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SipRuleTargetApplication) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SipRuleTargetApplication"} - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsRegion sets the AwsRegion field's value. -func (s *SipRuleTargetApplication) SetAwsRegion(v string) *SipRuleTargetApplication { - s.AwsRegion = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *SipRuleTargetApplication) SetPriority(v int64) *SipRuleTargetApplication { - s.Priority = &v - return s -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *SipRuleTargetApplication) SetSipMediaApplicationId(v string) *SipRuleTargetApplication { - s.SipMediaApplicationId = &v - return s -} - -// The details of a speaker search task. -type SpeakerSearchDetails struct { - _ struct{} `type:"structure"` - - // The result value in the speaker search details. - Results []*SpeakerSearchResult `type:"list"` - - // The status of a voice print generation operation, VoiceprintGenerationSuccess - // or VoiceprintGenerationFailure.. - VoiceprintGenerationStatus *string `min:"1" 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 SpeakerSearchDetails) 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 SpeakerSearchDetails) GoString() string { - return s.String() -} - -// SetResults sets the Results field's value. -func (s *SpeakerSearchDetails) SetResults(v []*SpeakerSearchResult) *SpeakerSearchDetails { - s.Results = v - return s -} - -// SetVoiceprintGenerationStatus sets the VoiceprintGenerationStatus field's value. -func (s *SpeakerSearchDetails) SetVoiceprintGenerationStatus(v string) *SpeakerSearchDetails { - s.VoiceprintGenerationStatus = &v - return s -} - -// The result of a speaker search analysis. -type SpeakerSearchResult struct { - _ struct{} `type:"structure"` - - // The confidence score in the speaker search analysis. - ConfidenceScore *float64 `type:"float"` - - // The voice profile ID. - VoiceProfileId *string `min:"1" 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 SpeakerSearchResult) 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 SpeakerSearchResult) GoString() string { - return s.String() -} - -// SetConfidenceScore sets the ConfidenceScore field's value. -func (s *SpeakerSearchResult) SetConfidenceScore(v float64) *SpeakerSearchResult { - s.ConfidenceScore = &v - return s -} - -// SetVoiceProfileId sets the VoiceProfileId field's value. -func (s *SpeakerSearchResult) SetVoiceProfileId(v string) *SpeakerSearchResult { - s.VoiceProfileId = &v - return s -} - -// A representation of an asynchronous request to perform speaker search analysis -// on a Voice Connector call. -type SpeakerSearchTask struct { - _ struct{} `type:"structure"` - - // The call details of a speaker search task. - CallDetails *CallDetails `type:"structure"` - - // The time at which a speaker search task was created. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The details of a speaker search task. - SpeakerSearchDetails *SpeakerSearchDetails `type:"structure"` - - // The speaker search task ID. - SpeakerSearchTaskId *string `min:"1" type:"string"` - - // The status of the speaker search task, IN_QUEUE, IN_PROGRESS, PARTIAL_SUCCESS, - // SUCCEEDED, FAILED, or STOPPED. - SpeakerSearchTaskStatus *string `type:"string"` - - // The time at which the speaker search task began. - StartedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // A detailed message about the status of a speaker search. - StatusMessage *string `type:"string"` - - // The time at which a speaker search task was updated. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 SpeakerSearchTask) 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 SpeakerSearchTask) GoString() string { - return s.String() -} - -// SetCallDetails sets the CallDetails field's value. -func (s *SpeakerSearchTask) SetCallDetails(v *CallDetails) *SpeakerSearchTask { - s.CallDetails = v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *SpeakerSearchTask) SetCreatedTimestamp(v time.Time) *SpeakerSearchTask { - s.CreatedTimestamp = &v - return s -} - -// SetSpeakerSearchDetails sets the SpeakerSearchDetails field's value. -func (s *SpeakerSearchTask) SetSpeakerSearchDetails(v *SpeakerSearchDetails) *SpeakerSearchTask { - s.SpeakerSearchDetails = v - return s -} - -// SetSpeakerSearchTaskId sets the SpeakerSearchTaskId field's value. -func (s *SpeakerSearchTask) SetSpeakerSearchTaskId(v string) *SpeakerSearchTask { - s.SpeakerSearchTaskId = &v - return s -} - -// SetSpeakerSearchTaskStatus sets the SpeakerSearchTaskStatus field's value. -func (s *SpeakerSearchTask) SetSpeakerSearchTaskStatus(v string) *SpeakerSearchTask { - s.SpeakerSearchTaskStatus = &v - return s -} - -// SetStartedTimestamp sets the StartedTimestamp field's value. -func (s *SpeakerSearchTask) SetStartedTimestamp(v time.Time) *SpeakerSearchTask { - s.StartedTimestamp = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *SpeakerSearchTask) SetStatusMessage(v string) *SpeakerSearchTask { - s.StatusMessage = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *SpeakerSearchTask) SetUpdatedTimestamp(v time.Time) *SpeakerSearchTask { - s.UpdatedTimestamp = &v - return s -} - -type StartSpeakerSearchTaskInput struct { - _ struct{} `type:"structure"` - - // Specifies which call leg to stream for speaker search. - CallLeg *string `type:"string" enum:"CallLegType"` - - // The unique identifier for the client request. Use a different token for different - // speaker search tasks. - ClientRequestToken *string `type:"string"` - - // The transaction ID of the call being analyzed. - // - // TransactionId is a required field - TransactionId *string `min:"1" type:"string" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"VoiceConnectorId" min:"1" type:"string" required:"true"` - - // The ID of the voice profile domain that will store the voice profile. - // - // VoiceProfileDomainId is a required field - VoiceProfileDomainId *string `min:"1" 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 StartSpeakerSearchTaskInput) 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 StartSpeakerSearchTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartSpeakerSearchTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartSpeakerSearchTaskInput"} - if s.TransactionId == nil { - invalidParams.Add(request.NewErrParamRequired("TransactionId")) - } - if s.TransactionId != nil && len(*s.TransactionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransactionId", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - if s.VoiceProfileDomainId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceProfileDomainId")) - } - if s.VoiceProfileDomainId != nil && len(*s.VoiceProfileDomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceProfileDomainId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallLeg sets the CallLeg field's value. -func (s *StartSpeakerSearchTaskInput) SetCallLeg(v string) *StartSpeakerSearchTaskInput { - s.CallLeg = &v - return s -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *StartSpeakerSearchTaskInput) SetClientRequestToken(v string) *StartSpeakerSearchTaskInput { - s.ClientRequestToken = &v - return s -} - -// SetTransactionId sets the TransactionId field's value. -func (s *StartSpeakerSearchTaskInput) SetTransactionId(v string) *StartSpeakerSearchTaskInput { - s.TransactionId = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *StartSpeakerSearchTaskInput) SetVoiceConnectorId(v string) *StartSpeakerSearchTaskInput { - s.VoiceConnectorId = &v - return s -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *StartSpeakerSearchTaskInput) SetVoiceProfileDomainId(v string) *StartSpeakerSearchTaskInput { - s.VoiceProfileDomainId = &v - return s -} - -type StartSpeakerSearchTaskOutput struct { - _ struct{} `type:"structure"` - - // The details of the speaker search task. - SpeakerSearchTask *SpeakerSearchTask `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 StartSpeakerSearchTaskOutput) 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 StartSpeakerSearchTaskOutput) GoString() string { - return s.String() -} - -// SetSpeakerSearchTask sets the SpeakerSearchTask field's value. -func (s *StartSpeakerSearchTaskOutput) SetSpeakerSearchTask(v *SpeakerSearchTask) *StartSpeakerSearchTaskOutput { - s.SpeakerSearchTask = v - return s -} - -type StartVoiceToneAnalysisTaskInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the client request. Use a different token for different - // voice tone analysis tasks. - ClientRequestToken *string `type:"string"` - - // The language code. - // - // LanguageCode is a required field - LanguageCode *string `type:"string" required:"true" enum:"LanguageCode"` - - // The transaction ID. - // - // TransactionId is a required field - TransactionId *string `min:"1" type:"string" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"VoiceConnectorId" min:"1" 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 StartVoiceToneAnalysisTaskInput) 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 StartVoiceToneAnalysisTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartVoiceToneAnalysisTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartVoiceToneAnalysisTaskInput"} - if s.LanguageCode == nil { - invalidParams.Add(request.NewErrParamRequired("LanguageCode")) - } - if s.TransactionId == nil { - invalidParams.Add(request.NewErrParamRequired("TransactionId")) - } - if s.TransactionId != nil && len(*s.TransactionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransactionId", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *StartVoiceToneAnalysisTaskInput) SetClientRequestToken(v string) *StartVoiceToneAnalysisTaskInput { - s.ClientRequestToken = &v - return s -} - -// SetLanguageCode sets the LanguageCode field's value. -func (s *StartVoiceToneAnalysisTaskInput) SetLanguageCode(v string) *StartVoiceToneAnalysisTaskInput { - s.LanguageCode = &v - return s -} - -// SetTransactionId sets the TransactionId field's value. -func (s *StartVoiceToneAnalysisTaskInput) SetTransactionId(v string) *StartVoiceToneAnalysisTaskInput { - s.TransactionId = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *StartVoiceToneAnalysisTaskInput) SetVoiceConnectorId(v string) *StartVoiceToneAnalysisTaskInput { - s.VoiceConnectorId = &v - return s -} - -type StartVoiceToneAnalysisTaskOutput struct { - _ struct{} `type:"structure"` - - // The details of the voice tone analysis task. - VoiceToneAnalysisTask *VoiceToneAnalysisTask `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 StartVoiceToneAnalysisTaskOutput) 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 StartVoiceToneAnalysisTaskOutput) GoString() string { - return s.String() -} - -// SetVoiceToneAnalysisTask sets the VoiceToneAnalysisTask field's value. -func (s *StartVoiceToneAnalysisTaskOutput) SetVoiceToneAnalysisTask(v *VoiceToneAnalysisTask) *StartVoiceToneAnalysisTaskOutput { - s.VoiceToneAnalysisTask = v - return s -} - -type StopSpeakerSearchTaskInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The speaker search task ID. - // - // SpeakerSearchTaskId is a required field - SpeakerSearchTaskId *string `location:"uri" locationName:"SpeakerSearchTaskId" min:"1" type:"string" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"VoiceConnectorId" min:"1" 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 StopSpeakerSearchTaskInput) 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 StopSpeakerSearchTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopSpeakerSearchTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopSpeakerSearchTaskInput"} - if s.SpeakerSearchTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("SpeakerSearchTaskId")) - } - if s.SpeakerSearchTaskId != nil && len(*s.SpeakerSearchTaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpeakerSearchTaskId", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSpeakerSearchTaskId sets the SpeakerSearchTaskId field's value. -func (s *StopSpeakerSearchTaskInput) SetSpeakerSearchTaskId(v string) *StopSpeakerSearchTaskInput { - s.SpeakerSearchTaskId = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *StopSpeakerSearchTaskInput) SetVoiceConnectorId(v string) *StopSpeakerSearchTaskInput { - s.VoiceConnectorId = &v - return s -} - -type StopSpeakerSearchTaskOutput 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 StopSpeakerSearchTaskOutput) 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 StopSpeakerSearchTaskOutput) GoString() string { - return s.String() -} - -type StopVoiceToneAnalysisTaskInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"VoiceConnectorId" min:"1" type:"string" required:"true"` - - // The ID of the voice tone analysis task. - // - // VoiceToneAnalysisTaskId is a required field - VoiceToneAnalysisTaskId *string `location:"uri" locationName:"VoiceToneAnalysisTaskId" min:"1" 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 StopVoiceToneAnalysisTaskInput) 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 StopVoiceToneAnalysisTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopVoiceToneAnalysisTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopVoiceToneAnalysisTaskInput"} - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - if s.VoiceToneAnalysisTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceToneAnalysisTaskId")) - } - if s.VoiceToneAnalysisTaskId != nil && len(*s.VoiceToneAnalysisTaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceToneAnalysisTaskId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *StopVoiceToneAnalysisTaskInput) SetVoiceConnectorId(v string) *StopVoiceToneAnalysisTaskInput { - s.VoiceConnectorId = &v - return s -} - -// SetVoiceToneAnalysisTaskId sets the VoiceToneAnalysisTaskId field's value. -func (s *StopVoiceToneAnalysisTaskInput) SetVoiceToneAnalysisTaskId(v string) *StopVoiceToneAnalysisTaskInput { - s.VoiceToneAnalysisTaskId = &v - return s -} - -type StopVoiceToneAnalysisTaskOutput 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 StopVoiceToneAnalysisTaskOutput) 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 StopVoiceToneAnalysisTaskOutput) GoString() string { - return s.String() -} - -// The streaming configuration associated with an Amazon Chime SDK Voice Connector. -// Specifies whether media streaming is enabled for sending to Amazon Kinesis, -// and shows the retention period for the Amazon Kinesis data, in hours. -type StreamingConfiguration struct { - _ struct{} `type:"structure"` - - // The amount of time, in hours, to the Kinesis data. - // - // DataRetentionInHours is a required field - DataRetentionInHours *int64 `type:"integer" required:"true"` - - // When true, streaming to Kinesis is off. - // - // Disabled is a required field - Disabled *bool `type:"boolean" required:"true"` - - // The call analytics configuration. - MediaInsightsConfiguration *MediaInsightsConfiguration `type:"structure"` - - // The streaming notification targets. - StreamingNotificationTargets []*StreamingNotificationTarget `min:"1" type:"list"` -} - -// 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 StreamingConfiguration) 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 StreamingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StreamingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StreamingConfiguration"} - if s.DataRetentionInHours == nil { - invalidParams.Add(request.NewErrParamRequired("DataRetentionInHours")) - } - if s.Disabled == nil { - invalidParams.Add(request.NewErrParamRequired("Disabled")) - } - if s.StreamingNotificationTargets != nil && len(s.StreamingNotificationTargets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamingNotificationTargets", 1)) - } - if s.MediaInsightsConfiguration != nil { - if err := s.MediaInsightsConfiguration.Validate(); err != nil { - invalidParams.AddNested("MediaInsightsConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataRetentionInHours sets the DataRetentionInHours field's value. -func (s *StreamingConfiguration) SetDataRetentionInHours(v int64) *StreamingConfiguration { - s.DataRetentionInHours = &v - return s -} - -// SetDisabled sets the Disabled field's value. -func (s *StreamingConfiguration) SetDisabled(v bool) *StreamingConfiguration { - s.Disabled = &v - return s -} - -// SetMediaInsightsConfiguration sets the MediaInsightsConfiguration field's value. -func (s *StreamingConfiguration) SetMediaInsightsConfiguration(v *MediaInsightsConfiguration) *StreamingConfiguration { - s.MediaInsightsConfiguration = v - return s -} - -// SetStreamingNotificationTargets sets the StreamingNotificationTargets field's value. -func (s *StreamingConfiguration) SetStreamingNotificationTargets(v []*StreamingNotificationTarget) *StreamingConfiguration { - s.StreamingNotificationTargets = v - return s -} - -// The target recipient for a streaming configuration notification. -type StreamingNotificationTarget struct { - _ struct{} `type:"structure"` - - // The streaming notification target. - NotificationTarget *string `type:"string" enum:"NotificationTarget"` -} - -// 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 StreamingNotificationTarget) 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 StreamingNotificationTarget) GoString() string { - return s.String() -} - -// SetNotificationTarget sets the NotificationTarget field's value. -func (s *StreamingNotificationTarget) SetNotificationTarget(v string) *StreamingNotificationTarget { - s.NotificationTarget = &v - return s -} - -// Describes a tag applied to a resource. -type Tag struct { - _ struct{} `type:"structure"` - - // The tag's key. - // - // Key is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Tag's - // String and GoString methods. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The tag's value. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Tag's - // String and GoString methods. - // - // Value is a required field - Value *string `type:"string" required:"true" sensitive:"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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource being tagged. - // - // ResourceARN is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TagResourceInput's - // String and GoString methods. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // A list of the tags being added to the resource. - // - // Tags is a required field - Tags []*Tag `min:"1" type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Termination settings enable SIP hosts to make outbound calls using an Amazon -// Chime SDK Voice Connector. -type Termination struct { - _ struct{} `type:"structure"` - - // The countries to which calls are allowed, in ISO 3166-1 alpha-2 format. Required. - CallingRegions []*string `type:"list"` - - // The IP addresses allowed to make calls, in CIDR format. - CidrAllowedList []*string `type:"list"` - - // The limit on calls per second. Max value based on account service quota. - // Default value of 1. - CpsLimit *int64 `min:"1" type:"integer"` - - // The default outbound calling number. - // - // DefaultPhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Termination's - // String and GoString methods. - DefaultPhoneNumber *string `type:"string" sensitive:"true"` - - // When termination is disabled, outbound calls cannot be made. - Disabled *bool `type:"boolean"` -} - -// 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 Termination) 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 Termination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Termination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Termination"} - if s.CpsLimit != nil && *s.CpsLimit < 1 { - invalidParams.Add(request.NewErrParamMinValue("CpsLimit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallingRegions sets the CallingRegions field's value. -func (s *Termination) SetCallingRegions(v []*string) *Termination { - s.CallingRegions = v - return s -} - -// SetCidrAllowedList sets the CidrAllowedList field's value. -func (s *Termination) SetCidrAllowedList(v []*string) *Termination { - s.CidrAllowedList = v - return s -} - -// SetCpsLimit sets the CpsLimit field's value. -func (s *Termination) SetCpsLimit(v int64) *Termination { - s.CpsLimit = &v - return s -} - -// SetDefaultPhoneNumber sets the DefaultPhoneNumber field's value. -func (s *Termination) SetDefaultPhoneNumber(v string) *Termination { - s.DefaultPhoneNumber = &v - return s -} - -// SetDisabled sets the Disabled field's value. -func (s *Termination) SetDisabled(v bool) *Termination { - s.Disabled = &v - return s -} - -// The termination health details, including the source IP address and timestamp -// of the last successful SIP OPTIONS message from your SIP infrastructure. -type TerminationHealth struct { - _ struct{} `type:"structure"` - - // The source IP address. - Source *string `type:"string"` - - // The timestamp, in ISO 8601 format. - Timestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 TerminationHealth) 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 TerminationHealth) GoString() string { - return s.String() -} - -// SetSource sets the Source field's value. -func (s *TerminationHealth) SetSource(v string) *TerminationHealth { - s.Source = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *TerminationHealth) SetTimestamp(v time.Time) *TerminationHealth { - s.Timestamp = &v - return s -} - -// The number of customer requests exceeds the request rate limit. -type ThrottledClientException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottledClientException) 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 ThrottledClientException) GoString() string { - return s.String() -} - -func newErrorThrottledClientException(v protocol.ResponseMetadata) error { - return &ThrottledClientException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottledClientException) Code() string { - return "ThrottledClientException" -} - -// Message returns the exception's message. -func (s *ThrottledClientException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottledClientException) OrigErr() error { - return nil -} - -func (s *ThrottledClientException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottledClientException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottledClientException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The client isn't authorized to request a resource. -type UnauthorizedClientException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 UnauthorizedClientException) 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 UnauthorizedClientException) GoString() string { - return s.String() -} - -func newErrorUnauthorizedClientException(v protocol.ResponseMetadata) error { - return &UnauthorizedClientException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnauthorizedClientException) Code() string { - return "UnauthorizedClientException" -} - -// Message returns the exception's message. -func (s *UnauthorizedClientException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnauthorizedClientException) OrigErr() error { - return nil -} - -func (s *UnauthorizedClientException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnauthorizedClientException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnauthorizedClientException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A well-formed request couldn't be followed due to semantic errors. -type UnprocessableEntityException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 UnprocessableEntityException) 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 UnprocessableEntityException) GoString() string { - return s.String() -} - -func newErrorUnprocessableEntityException(v protocol.ResponseMetadata) error { - return &UnprocessableEntityException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnprocessableEntityException) Code() string { - return "UnprocessableEntityException" -} - -// Message returns the exception's message. -func (s *UnprocessableEntityException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnprocessableEntityException) OrigErr() error { - return nil -} - -func (s *UnprocessableEntityException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnprocessableEntityException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnprocessableEntityException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource having its tags removed. - // - // ResourceARN is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UntagResourceInput's - // String and GoString methods. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The keys of the tags being removed from the resource. - // - // TagKeys is a required field - TagKeys []*string `min:"1" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *UntagResourceInput) SetResourceARN(v string) *UntagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateGlobalSettingsInput struct { - _ struct{} `type:"structure"` - - // The Voice Connector settings. - VoiceConnector *VoiceConnectorSettings `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 UpdateGlobalSettingsInput) 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 UpdateGlobalSettingsInput) GoString() string { - return s.String() -} - -// SetVoiceConnector sets the VoiceConnector field's value. -func (s *UpdateGlobalSettingsInput) SetVoiceConnector(v *VoiceConnectorSettings) *UpdateGlobalSettingsInput { - s.VoiceConnector = v - return s -} - -type UpdateGlobalSettingsOutput 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 UpdateGlobalSettingsOutput) 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 UpdateGlobalSettingsOutput) GoString() string { - return s.String() -} - -type UpdatePhoneNumberInput struct { - _ struct{} `type:"structure"` - - // The outbound calling name associated with the phone number. - // - // CallingName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePhoneNumberInput's - // String and GoString methods. - CallingName *string `type:"string" sensitive:"true"` - - // Specifies the name assigned to one or more phone numbers. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePhoneNumberInput's - // String and GoString methods. - Name *string `type:"string" sensitive:"true"` - - // The phone number ID. - // - // PhoneNumberId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePhoneNumberInput's - // String and GoString methods. - // - // PhoneNumberId is a required field - PhoneNumberId *string `location:"uri" locationName:"phoneNumberId" type:"string" required:"true" sensitive:"true"` - - // The product type. - ProductType *string `type:"string" enum:"PhoneNumberProductType"` -} - -// 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 UpdatePhoneNumberInput) 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 UpdatePhoneNumberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePhoneNumberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePhoneNumberInput"} - if s.PhoneNumberId == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumberId")) - } - if s.PhoneNumberId != nil && len(*s.PhoneNumberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PhoneNumberId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallingName sets the CallingName field's value. -func (s *UpdatePhoneNumberInput) SetCallingName(v string) *UpdatePhoneNumberInput { - s.CallingName = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePhoneNumberInput) SetName(v string) *UpdatePhoneNumberInput { - s.Name = &v - return s -} - -// SetPhoneNumberId sets the PhoneNumberId field's value. -func (s *UpdatePhoneNumberInput) SetPhoneNumberId(v string) *UpdatePhoneNumberInput { - s.PhoneNumberId = &v - return s -} - -// SetProductType sets the ProductType field's value. -func (s *UpdatePhoneNumberInput) SetProductType(v string) *UpdatePhoneNumberInput { - s.ProductType = &v - return s -} - -type UpdatePhoneNumberOutput struct { - _ struct{} `type:"structure"` - - // The updated phone number details. - PhoneNumber *PhoneNumber `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 UpdatePhoneNumberOutput) 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 UpdatePhoneNumberOutput) GoString() string { - return s.String() -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *UpdatePhoneNumberOutput) SetPhoneNumber(v *PhoneNumber) *UpdatePhoneNumberOutput { - s.PhoneNumber = v - return s -} - -// The phone number ID, product type, or calling name fields to update, used -// with the BatchUpdatePhoneNumber and UpdatePhoneNumber actions. -type UpdatePhoneNumberRequestItem struct { - _ struct{} `type:"structure"` - - // The outbound calling name to update. - // - // CallingName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePhoneNumberRequestItem's - // String and GoString methods. - CallingName *string `type:"string" sensitive:"true"` - - // The name of the phone number. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePhoneNumberRequestItem's - // String and GoString methods. - Name *string `type:"string" sensitive:"true"` - - // The phone number ID to update. - // - // PhoneNumberId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePhoneNumberRequestItem's - // String and GoString methods. - // - // PhoneNumberId is a required field - PhoneNumberId *string `type:"string" required:"true" sensitive:"true"` - - // The product type to update. - ProductType *string `type:"string" enum:"PhoneNumberProductType"` -} - -// 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 UpdatePhoneNumberRequestItem) 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 UpdatePhoneNumberRequestItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePhoneNumberRequestItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePhoneNumberRequestItem"} - if s.PhoneNumberId == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumberId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallingName sets the CallingName field's value. -func (s *UpdatePhoneNumberRequestItem) SetCallingName(v string) *UpdatePhoneNumberRequestItem { - s.CallingName = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePhoneNumberRequestItem) SetName(v string) *UpdatePhoneNumberRequestItem { - s.Name = &v - return s -} - -// SetPhoneNumberId sets the PhoneNumberId field's value. -func (s *UpdatePhoneNumberRequestItem) SetPhoneNumberId(v string) *UpdatePhoneNumberRequestItem { - s.PhoneNumberId = &v - return s -} - -// SetProductType sets the ProductType field's value. -func (s *UpdatePhoneNumberRequestItem) SetProductType(v string) *UpdatePhoneNumberRequestItem { - s.ProductType = &v - return s -} - -type UpdatePhoneNumberSettingsInput struct { - _ struct{} `type:"structure"` - - // The default outbound calling name for the account. - // - // CallingName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePhoneNumberSettingsInput's - // String and GoString methods. - // - // CallingName is a required field - CallingName *string `type:"string" required:"true" sensitive:"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 UpdatePhoneNumberSettingsInput) 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 UpdatePhoneNumberSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePhoneNumberSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePhoneNumberSettingsInput"} - if s.CallingName == nil { - invalidParams.Add(request.NewErrParamRequired("CallingName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCallingName sets the CallingName field's value. -func (s *UpdatePhoneNumberSettingsInput) SetCallingName(v string) *UpdatePhoneNumberSettingsInput { - s.CallingName = &v - return s -} - -type UpdatePhoneNumberSettingsOutput 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 UpdatePhoneNumberSettingsOutput) 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 UpdatePhoneNumberSettingsOutput) GoString() string { - return s.String() -} - -type UpdateProxySessionInput struct { - _ struct{} `type:"structure"` - - // The proxy session capabilities. - // - // Capabilities is a required field - Capabilities []*string `type:"list" required:"true" enum:"Capability"` - - // The number of minutes allowed for the proxy session. - ExpiryMinutes *int64 `min:"1" type:"integer"` - - // The proxy session ID. - // - // ProxySessionId is a required field - ProxySessionId *string `location:"uri" locationName:"proxySessionId" min:"1" type:"string" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" min:"1" 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 UpdateProxySessionInput) 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 UpdateProxySessionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateProxySessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateProxySessionInput"} - if s.Capabilities == nil { - invalidParams.Add(request.NewErrParamRequired("Capabilities")) - } - if s.ExpiryMinutes != nil && *s.ExpiryMinutes < 1 { - invalidParams.Add(request.NewErrParamMinValue("ExpiryMinutes", 1)) - } - if s.ProxySessionId == nil { - invalidParams.Add(request.NewErrParamRequired("ProxySessionId")) - } - if s.ProxySessionId != nil && len(*s.ProxySessionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProxySessionId", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapabilities sets the Capabilities field's value. -func (s *UpdateProxySessionInput) SetCapabilities(v []*string) *UpdateProxySessionInput { - s.Capabilities = v - return s -} - -// SetExpiryMinutes sets the ExpiryMinutes field's value. -func (s *UpdateProxySessionInput) SetExpiryMinutes(v int64) *UpdateProxySessionInput { - s.ExpiryMinutes = &v - return s -} - -// SetProxySessionId sets the ProxySessionId field's value. -func (s *UpdateProxySessionInput) SetProxySessionId(v string) *UpdateProxySessionInput { - s.ProxySessionId = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *UpdateProxySessionInput) SetVoiceConnectorId(v string) *UpdateProxySessionInput { - s.VoiceConnectorId = &v - return s -} - -type UpdateProxySessionOutput struct { - _ struct{} `type:"structure"` - - // The updated proxy session details. - ProxySession *ProxySession `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 UpdateProxySessionOutput) 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 UpdateProxySessionOutput) GoString() string { - return s.String() -} - -// SetProxySession sets the ProxySession field's value. -func (s *UpdateProxySessionOutput) SetProxySession(v *ProxySession) *UpdateProxySessionOutput { - s.ProxySession = v - return s -} - -type UpdateSipMediaApplicationCallInput struct { - _ struct{} `type:"structure"` - - // Arguments made available to the Lambda function as part of the CALL_UPDATE_REQUESTED - // event. Can contain 0-20 key-value pairs. - // - // Arguments is a required field - Arguments map[string]*string `type:"map" required:"true"` - - // The ID of the SIP media application handling the call. - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" type:"string" required:"true"` - - // The ID of the call transaction. - // - // TransactionId is a required field - TransactionId *string `location:"uri" locationName:"transactionId" 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 UpdateSipMediaApplicationCallInput) 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 UpdateSipMediaApplicationCallInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSipMediaApplicationCallInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSipMediaApplicationCallInput"} - if s.Arguments == nil { - invalidParams.Add(request.NewErrParamRequired("Arguments")) - } - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - if s.TransactionId == nil { - invalidParams.Add(request.NewErrParamRequired("TransactionId")) - } - if s.TransactionId != nil && len(*s.TransactionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransactionId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArguments sets the Arguments field's value. -func (s *UpdateSipMediaApplicationCallInput) SetArguments(v map[string]*string) *UpdateSipMediaApplicationCallInput { - s.Arguments = v - return s -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *UpdateSipMediaApplicationCallInput) SetSipMediaApplicationId(v string) *UpdateSipMediaApplicationCallInput { - s.SipMediaApplicationId = &v - return s -} - -// SetTransactionId sets the TransactionId field's value. -func (s *UpdateSipMediaApplicationCallInput) SetTransactionId(v string) *UpdateSipMediaApplicationCallInput { - s.TransactionId = &v - return s -} - -type UpdateSipMediaApplicationCallOutput struct { - _ struct{} `type:"structure"` - - // A Call instance for a SIP media application. - SipMediaApplicationCall *SipMediaApplicationCall `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 UpdateSipMediaApplicationCallOutput) 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 UpdateSipMediaApplicationCallOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplicationCall sets the SipMediaApplicationCall field's value. -func (s *UpdateSipMediaApplicationCallOutput) SetSipMediaApplicationCall(v *SipMediaApplicationCall) *UpdateSipMediaApplicationCallOutput { - s.SipMediaApplicationCall = v - return s -} - -type UpdateSipMediaApplicationInput struct { - _ struct{} `type:"structure"` - - // The new set of endpoints for the specified SIP media application. - Endpoints []*SipMediaApplicationEndpoint `min:"1" type:"list"` - - // The new name for the specified SIP media application. - Name *string `min:"1" type:"string"` - - // The SIP media application ID. - // - // SipMediaApplicationId is a required field - SipMediaApplicationId *string `location:"uri" locationName:"sipMediaApplicationId" 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 UpdateSipMediaApplicationInput) 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 UpdateSipMediaApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSipMediaApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSipMediaApplicationInput"} - if s.Endpoints != nil && len(s.Endpoints) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Endpoints", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SipMediaApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("SipMediaApplicationId")) - } - if s.SipMediaApplicationId != nil && len(*s.SipMediaApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipMediaApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpoints sets the Endpoints field's value. -func (s *UpdateSipMediaApplicationInput) SetEndpoints(v []*SipMediaApplicationEndpoint) *UpdateSipMediaApplicationInput { - s.Endpoints = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSipMediaApplicationInput) SetName(v string) *UpdateSipMediaApplicationInput { - s.Name = &v - return s -} - -// SetSipMediaApplicationId sets the SipMediaApplicationId field's value. -func (s *UpdateSipMediaApplicationInput) SetSipMediaApplicationId(v string) *UpdateSipMediaApplicationInput { - s.SipMediaApplicationId = &v - return s -} - -type UpdateSipMediaApplicationOutput struct { - _ struct{} `type:"structure"` - - // The updated SIP media application’s details. - SipMediaApplication *SipMediaApplication `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 UpdateSipMediaApplicationOutput) 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 UpdateSipMediaApplicationOutput) GoString() string { - return s.String() -} - -// SetSipMediaApplication sets the SipMediaApplication field's value. -func (s *UpdateSipMediaApplicationOutput) SetSipMediaApplication(v *SipMediaApplication) *UpdateSipMediaApplicationOutput { - s.SipMediaApplication = v - return s -} - -type UpdateSipRuleInput struct { - _ struct{} `type:"structure"` - - // The new value that indicates whether the rule is disabled. - Disabled *bool `type:"boolean"` - - // The new name for the specified SIP rule. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The SIP rule ID. - // - // SipRuleId is a required field - SipRuleId *string `location:"uri" locationName:"sipRuleId" type:"string" required:"true"` - - // The new list of target applications. - TargetApplications []*SipRuleTargetApplication `min:"1" type:"list"` -} - -// 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 UpdateSipRuleInput) 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 UpdateSipRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSipRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSipRuleInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SipRuleId == nil { - invalidParams.Add(request.NewErrParamRequired("SipRuleId")) - } - if s.SipRuleId != nil && len(*s.SipRuleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SipRuleId", 1)) - } - if s.TargetApplications != nil && len(s.TargetApplications) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetApplications", 1)) - } - if s.TargetApplications != nil { - for i, v := range s.TargetApplications { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetApplications", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDisabled sets the Disabled field's value. -func (s *UpdateSipRuleInput) SetDisabled(v bool) *UpdateSipRuleInput { - s.Disabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSipRuleInput) SetName(v string) *UpdateSipRuleInput { - s.Name = &v - return s -} - -// SetSipRuleId sets the SipRuleId field's value. -func (s *UpdateSipRuleInput) SetSipRuleId(v string) *UpdateSipRuleInput { - s.SipRuleId = &v - return s -} - -// SetTargetApplications sets the TargetApplications field's value. -func (s *UpdateSipRuleInput) SetTargetApplications(v []*SipRuleTargetApplication) *UpdateSipRuleInput { - s.TargetApplications = v - return s -} - -type UpdateSipRuleOutput struct { - _ struct{} `type:"structure"` - - // The updated SIP rule details. - SipRule *SipRule `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 UpdateSipRuleOutput) 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 UpdateSipRuleOutput) GoString() string { - return s.String() -} - -// SetSipRule sets the SipRule field's value. -func (s *UpdateSipRuleOutput) SetSipRule(v *SipRule) *UpdateSipRuleOutput { - s.SipRule = v - return s -} - -type UpdateVoiceConnectorGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the Voice Connector group. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorGroupId is a required field - VoiceConnectorGroupId *string `location:"uri" locationName:"voiceConnectorGroupId" type:"string" required:"true"` - - // The VoiceConnectorItems to associate with the Voice Connector group. - // - // VoiceConnectorItems is a required field - VoiceConnectorItems []*VoiceConnectorItem `type:"list" 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 UpdateVoiceConnectorGroupInput) 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 UpdateVoiceConnectorGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVoiceConnectorGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVoiceConnectorGroupInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.VoiceConnectorGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorGroupId")) - } - if s.VoiceConnectorGroupId != nil && len(*s.VoiceConnectorGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorGroupId", 1)) - } - if s.VoiceConnectorItems == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorItems")) - } - if s.VoiceConnectorItems != nil { - for i, v := range s.VoiceConnectorItems { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VoiceConnectorItems", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *UpdateVoiceConnectorGroupInput) SetName(v string) *UpdateVoiceConnectorGroupInput { - s.Name = &v - return s -} - -// SetVoiceConnectorGroupId sets the VoiceConnectorGroupId field's value. -func (s *UpdateVoiceConnectorGroupInput) SetVoiceConnectorGroupId(v string) *UpdateVoiceConnectorGroupInput { - s.VoiceConnectorGroupId = &v - return s -} - -// SetVoiceConnectorItems sets the VoiceConnectorItems field's value. -func (s *UpdateVoiceConnectorGroupInput) SetVoiceConnectorItems(v []*VoiceConnectorItem) *UpdateVoiceConnectorGroupInput { - s.VoiceConnectorItems = v - return s -} - -type UpdateVoiceConnectorGroupOutput struct { - _ struct{} `type:"structure"` - - // The updated Voice Connector group. - VoiceConnectorGroup *VoiceConnectorGroup `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 UpdateVoiceConnectorGroupOutput) 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 UpdateVoiceConnectorGroupOutput) GoString() string { - return s.String() -} - -// SetVoiceConnectorGroup sets the VoiceConnectorGroup field's value. -func (s *UpdateVoiceConnectorGroupOutput) SetVoiceConnectorGroup(v *VoiceConnectorGroup) *UpdateVoiceConnectorGroupOutput { - s.VoiceConnectorGroup = v - return s -} - -type UpdateVoiceConnectorInput struct { - _ struct{} `type:"structure"` - - // The name of the Voice Connector. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // When enabled, requires encryption for the Voice Connector. - // - // RequireEncryption is a required field - RequireEncryption *bool `type:"boolean" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *string `location:"uri" locationName:"voiceConnectorId" 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 UpdateVoiceConnectorInput) 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 UpdateVoiceConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVoiceConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVoiceConnectorInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RequireEncryption == nil { - invalidParams.Add(request.NewErrParamRequired("RequireEncryption")) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - if s.VoiceConnectorId != nil && len(*s.VoiceConnectorId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceConnectorId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *UpdateVoiceConnectorInput) SetName(v string) *UpdateVoiceConnectorInput { - s.Name = &v - return s -} - -// SetRequireEncryption sets the RequireEncryption field's value. -func (s *UpdateVoiceConnectorInput) SetRequireEncryption(v bool) *UpdateVoiceConnectorInput { - s.RequireEncryption = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *UpdateVoiceConnectorInput) SetVoiceConnectorId(v string) *UpdateVoiceConnectorInput { - s.VoiceConnectorId = &v - return s -} - -type UpdateVoiceConnectorOutput struct { - _ struct{} `type:"structure"` - - // The updated Voice Connector details. - VoiceConnector *VoiceConnector `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 UpdateVoiceConnectorOutput) 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 UpdateVoiceConnectorOutput) GoString() string { - return s.String() -} - -// SetVoiceConnector sets the VoiceConnector field's value. -func (s *UpdateVoiceConnectorOutput) SetVoiceConnector(v *VoiceConnector) *UpdateVoiceConnectorOutput { - s.VoiceConnector = v - return s -} - -type UpdateVoiceProfileDomainInput struct { - _ struct{} `type:"structure"` - - // The description of the voice profile domain. - Description *string `type:"string"` - - // The name of the voice profile domain. - Name *string `min:"1" type:"string"` - - // The domain ID. - // - // VoiceProfileDomainId is a required field - VoiceProfileDomainId *string `location:"uri" locationName:"VoiceProfileDomainId" min:"1" 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 UpdateVoiceProfileDomainInput) 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 UpdateVoiceProfileDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVoiceProfileDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVoiceProfileDomainInput"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.VoiceProfileDomainId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceProfileDomainId")) - } - if s.VoiceProfileDomainId != nil && len(*s.VoiceProfileDomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceProfileDomainId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateVoiceProfileDomainInput) SetDescription(v string) *UpdateVoiceProfileDomainInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateVoiceProfileDomainInput) SetName(v string) *UpdateVoiceProfileDomainInput { - s.Name = &v - return s -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *UpdateVoiceProfileDomainInput) SetVoiceProfileDomainId(v string) *UpdateVoiceProfileDomainInput { - s.VoiceProfileDomainId = &v - return s -} - -type UpdateVoiceProfileDomainOutput struct { - _ struct{} `type:"structure"` - - // The updated details of the voice profile domain. - VoiceProfileDomain *VoiceProfileDomain `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 UpdateVoiceProfileDomainOutput) 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 UpdateVoiceProfileDomainOutput) GoString() string { - return s.String() -} - -// SetVoiceProfileDomain sets the VoiceProfileDomain field's value. -func (s *UpdateVoiceProfileDomainOutput) SetVoiceProfileDomain(v *VoiceProfileDomain) *UpdateVoiceProfileDomainOutput { - s.VoiceProfileDomain = v - return s -} - -type UpdateVoiceProfileInput struct { - _ struct{} `type:"structure"` - - // The ID of the speaker search task. - // - // SpeakerSearchTaskId is a required field - SpeakerSearchTaskId *string `min:"1" type:"string" required:"true"` - - // The profile ID. - // - // VoiceProfileId is a required field - VoiceProfileId *string `location:"uri" locationName:"VoiceProfileId" min:"1" 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 UpdateVoiceProfileInput) 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 UpdateVoiceProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVoiceProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVoiceProfileInput"} - if s.SpeakerSearchTaskId == nil { - invalidParams.Add(request.NewErrParamRequired("SpeakerSearchTaskId")) - } - if s.SpeakerSearchTaskId != nil && len(*s.SpeakerSearchTaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpeakerSearchTaskId", 1)) - } - if s.VoiceProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceProfileId")) - } - if s.VoiceProfileId != nil && len(*s.VoiceProfileId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VoiceProfileId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSpeakerSearchTaskId sets the SpeakerSearchTaskId field's value. -func (s *UpdateVoiceProfileInput) SetSpeakerSearchTaskId(v string) *UpdateVoiceProfileInput { - s.SpeakerSearchTaskId = &v - return s -} - -// SetVoiceProfileId sets the VoiceProfileId field's value. -func (s *UpdateVoiceProfileInput) SetVoiceProfileId(v string) *UpdateVoiceProfileInput { - s.VoiceProfileId = &v - return s -} - -type UpdateVoiceProfileOutput struct { - _ struct{} `type:"structure"` - - // The updated voice profile settings. - VoiceProfile *VoiceProfile `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 UpdateVoiceProfileOutput) 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 UpdateVoiceProfileOutput) GoString() string { - return s.String() -} - -// SetVoiceProfile sets the VoiceProfile field's value. -func (s *UpdateVoiceProfileOutput) SetVoiceProfile(v *VoiceProfile) *UpdateVoiceProfileOutput { - s.VoiceProfile = v - return s -} - -type ValidateE911AddressInput struct { - _ struct{} `type:"structure"` - - // The AWS account ID. - // - // AwsAccountId is a required field - AwsAccountId *string `type:"string" required:"true"` - - // The address city, such as Portland. - // - // City is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ValidateE911AddressInput's - // String and GoString methods. - // - // City is a required field - City *string `type:"string" required:"true" sensitive:"true"` - - // The country in the address being validated. - // - // Country is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ValidateE911AddressInput's - // String and GoString methods. - // - // Country is a required field - Country *string `type:"string" required:"true" sensitive:"true"` - - // The dress postal code, such 04352. - // - // PostalCode is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ValidateE911AddressInput's - // String and GoString methods. - // - // PostalCode is a required field - PostalCode *string `type:"string" required:"true" sensitive:"true"` - - // The address state, such as ME. - // - // State is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ValidateE911AddressInput's - // String and GoString methods. - // - // State is a required field - State *string `type:"string" required:"true" sensitive:"true"` - - // The address street information, such as 8th Avenue. - // - // StreetInfo is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ValidateE911AddressInput's - // String and GoString methods. - // - // StreetInfo is a required field - StreetInfo *string `type:"string" required:"true" sensitive:"true"` - - // The address street number, such as 200 or 2121. - // - // StreetNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ValidateE911AddressInput's - // String and GoString methods. - // - // StreetNumber is a required field - StreetNumber *string `type:"string" required:"true" sensitive:"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 ValidateE911AddressInput) 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 ValidateE911AddressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidateE911AddressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidateE911AddressInput"} - if s.AwsAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) - } - if s.City == nil { - invalidParams.Add(request.NewErrParamRequired("City")) - } - if s.Country == nil { - invalidParams.Add(request.NewErrParamRequired("Country")) - } - if s.PostalCode == nil { - invalidParams.Add(request.NewErrParamRequired("PostalCode")) - } - if s.State == nil { - invalidParams.Add(request.NewErrParamRequired("State")) - } - if s.StreetInfo == nil { - invalidParams.Add(request.NewErrParamRequired("StreetInfo")) - } - if s.StreetNumber == nil { - invalidParams.Add(request.NewErrParamRequired("StreetNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *ValidateE911AddressInput) SetAwsAccountId(v string) *ValidateE911AddressInput { - s.AwsAccountId = &v - return s -} - -// SetCity sets the City field's value. -func (s *ValidateE911AddressInput) SetCity(v string) *ValidateE911AddressInput { - s.City = &v - return s -} - -// SetCountry sets the Country field's value. -func (s *ValidateE911AddressInput) SetCountry(v string) *ValidateE911AddressInput { - s.Country = &v - return s -} - -// SetPostalCode sets the PostalCode field's value. -func (s *ValidateE911AddressInput) SetPostalCode(v string) *ValidateE911AddressInput { - s.PostalCode = &v - return s -} - -// SetState sets the State field's value. -func (s *ValidateE911AddressInput) SetState(v string) *ValidateE911AddressInput { - s.State = &v - return s -} - -// SetStreetInfo sets the StreetInfo field's value. -func (s *ValidateE911AddressInput) SetStreetInfo(v string) *ValidateE911AddressInput { - s.StreetInfo = &v - return s -} - -// SetStreetNumber sets the StreetNumber field's value. -func (s *ValidateE911AddressInput) SetStreetNumber(v string) *ValidateE911AddressInput { - s.StreetNumber = &v - return s -} - -type ValidateE911AddressOutput struct { - _ struct{} `type:"structure"` - - // The validated address. - Address *Address `type:"structure"` - - // The ID that represents the address. - AddressExternalId *string `type:"string"` - - // The list of address suggestions.. - CandidateAddressList []*CandidateAddress `type:"list"` - - // Number indicating the result of address validation. 0 means the address was - // perfect as-is and successfully validated. 1 means the address was corrected. - // 2 means the address sent was not close enough and was not validated. - ValidationResult *int64 `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 ValidateE911AddressOutput) 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 ValidateE911AddressOutput) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *ValidateE911AddressOutput) SetAddress(v *Address) *ValidateE911AddressOutput { - s.Address = v - return s -} - -// SetAddressExternalId sets the AddressExternalId field's value. -func (s *ValidateE911AddressOutput) SetAddressExternalId(v string) *ValidateE911AddressOutput { - s.AddressExternalId = &v - return s -} - -// SetCandidateAddressList sets the CandidateAddressList field's value. -func (s *ValidateE911AddressOutput) SetCandidateAddressList(v []*CandidateAddress) *ValidateE911AddressOutput { - s.CandidateAddressList = v - return s -} - -// SetValidationResult sets the ValidationResult field's value. -func (s *ValidateE911AddressOutput) SetValidationResult(v int64) *ValidateE911AddressOutput { - s.ValidationResult = &v - return s -} - -// The Amazon Chime SDK Voice Connector configuration, including outbound host -// name and encryption settings. -type VoiceConnector struct { - _ struct{} `type:"structure"` - - // The AWS Region in which the Voice Connector is created. Default: us-east-1. - AwsRegion *string `type:"string" enum:"VoiceConnectorAwsRegion"` - - // The Voice Connector's creation timestamp, in ISO 8601 format. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The Voice Connector's name. - Name *string `min:"1" type:"string"` - - // The outbound host name for the Voice Connector. - OutboundHostName *string `type:"string"` - - // Enables or disables encryption for the Voice Connector. - RequireEncryption *bool `type:"boolean"` - - // The Voice Connector's updated timestamp, in ISO 8601 format. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The ARN of the Voice Connector. - VoiceConnectorArn *string `type:"string"` - - // The Voice Connector's ID. - VoiceConnectorId *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 VoiceConnector) 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 VoiceConnector) GoString() string { - return s.String() -} - -// SetAwsRegion sets the AwsRegion field's value. -func (s *VoiceConnector) SetAwsRegion(v string) *VoiceConnector { - s.AwsRegion = &v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *VoiceConnector) SetCreatedTimestamp(v time.Time) *VoiceConnector { - s.CreatedTimestamp = &v - return s -} - -// SetName sets the Name field's value. -func (s *VoiceConnector) SetName(v string) *VoiceConnector { - s.Name = &v - return s -} - -// SetOutboundHostName sets the OutboundHostName field's value. -func (s *VoiceConnector) SetOutboundHostName(v string) *VoiceConnector { - s.OutboundHostName = &v - return s -} - -// SetRequireEncryption sets the RequireEncryption field's value. -func (s *VoiceConnector) SetRequireEncryption(v bool) *VoiceConnector { - s.RequireEncryption = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *VoiceConnector) SetUpdatedTimestamp(v time.Time) *VoiceConnector { - s.UpdatedTimestamp = &v - return s -} - -// SetVoiceConnectorArn sets the VoiceConnectorArn field's value. -func (s *VoiceConnector) SetVoiceConnectorArn(v string) *VoiceConnector { - s.VoiceConnectorArn = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *VoiceConnector) SetVoiceConnectorId(v string) *VoiceConnector { - s.VoiceConnectorId = &v - return s -} - -// The Amazon Chime SDK Voice Connector group configuration, including associated -// Voice Connectors. You can include Voice Connectors from different AWS Regions -// in a group. This creates a fault tolerant mechanism for fallback in case -// of availability events. -type VoiceConnectorGroup struct { - _ struct{} `type:"structure"` - - // The Voice Connector group's creation time stamp, in ISO 8601 format. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The name of a Voice Connector group. - Name *string `min:"1" type:"string"` - - // The Voice Connector group's creation time stamp, in ISO 8601 format. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The ARN of the Voice Connector group. - VoiceConnectorGroupArn *string `type:"string"` - - // The ID of a Voice Connector group. - VoiceConnectorGroupId *string `type:"string"` - - // The Voice Connectors to which you route inbound calls. - VoiceConnectorItems []*VoiceConnectorItem `type:"list"` -} - -// 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 VoiceConnectorGroup) 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 VoiceConnectorGroup) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *VoiceConnectorGroup) SetCreatedTimestamp(v time.Time) *VoiceConnectorGroup { - s.CreatedTimestamp = &v - return s -} - -// SetName sets the Name field's value. -func (s *VoiceConnectorGroup) SetName(v string) *VoiceConnectorGroup { - s.Name = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *VoiceConnectorGroup) SetUpdatedTimestamp(v time.Time) *VoiceConnectorGroup { - s.UpdatedTimestamp = &v - return s -} - -// SetVoiceConnectorGroupArn sets the VoiceConnectorGroupArn field's value. -func (s *VoiceConnectorGroup) SetVoiceConnectorGroupArn(v string) *VoiceConnectorGroup { - s.VoiceConnectorGroupArn = &v - return s -} - -// SetVoiceConnectorGroupId sets the VoiceConnectorGroupId field's value. -func (s *VoiceConnectorGroup) SetVoiceConnectorGroupId(v string) *VoiceConnectorGroup { - s.VoiceConnectorGroupId = &v - return s -} - -// SetVoiceConnectorItems sets the VoiceConnectorItems field's value. -func (s *VoiceConnectorGroup) SetVoiceConnectorItems(v []*VoiceConnectorItem) *VoiceConnectorGroup { - s.VoiceConnectorItems = v - return s -} - -// For Amazon Chime SDK Voice Connector groups, the Amazon Chime SDK Voice Connectors -// to which you route inbound calls. Includes priority configuration settings. -// Limit: 3 VoiceConnectorItems per Voice Connector group. -type VoiceConnectorItem struct { - _ struct{} `type:"structure"` - - // The priority setting of a Voice Connector item. Calls are routed to hosts - // in priority order, with 1 as the highest priority. When hosts have equal - // priority, the system distributes calls among them based on their relative - // weight. - // - // Priority is a required field - Priority *int64 `min:"1" type:"integer" required:"true"` - - // The Voice Connector ID. - // - // VoiceConnectorId is a required field - VoiceConnectorId *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 VoiceConnectorItem) 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 VoiceConnectorItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VoiceConnectorItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VoiceConnectorItem"} - if s.Priority == nil { - invalidParams.Add(request.NewErrParamRequired("Priority")) - } - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - if s.VoiceConnectorId == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceConnectorId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPriority sets the Priority field's value. -func (s *VoiceConnectorItem) SetPriority(v int64) *VoiceConnectorItem { - s.Priority = &v - return s -} - -// SetVoiceConnectorId sets the VoiceConnectorId field's value. -func (s *VoiceConnectorItem) SetVoiceConnectorId(v string) *VoiceConnectorItem { - s.VoiceConnectorId = &v - return s -} - -// The Amazon Chime SDK Voice Connector settings. Includes any Amazon S3 buckets -// designated for storing call detail records. -type VoiceConnectorSettings struct { - _ struct{} `type:"structure"` - - // The S3 bucket that stores the Voice Connector's call detail records. - CdrBucket *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 VoiceConnectorSettings) 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 VoiceConnectorSettings) GoString() string { - return s.String() -} - -// SetCdrBucket sets the CdrBucket field's value. -func (s *VoiceConnectorSettings) SetCdrBucket(v string) *VoiceConnectorSettings { - s.CdrBucket = &v - return s -} - -// The combination of a voice print and caller ID. -type VoiceProfile struct { - _ struct{} `type:"structure"` - - // The time at which the voice profile was created and enrolled. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time at which a voice profile expires unless you re-enroll the caller - // via the UpdateVoiceProfile API. - ExpirationTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time at which the voice profile was last updated. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The ARN of the voice profile. - // - // VoiceProfileArn is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by VoiceProfile's - // String and GoString methods. - VoiceProfileArn *string `min:"1" type:"string" sensitive:"true"` - - // The ID of the domain that contains the voice profile. - VoiceProfileDomainId *string `min:"1" type:"string"` - - // The ID of the voice profile. - VoiceProfileId *string `min:"1" 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 VoiceProfile) 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 VoiceProfile) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *VoiceProfile) SetCreatedTimestamp(v time.Time) *VoiceProfile { - s.CreatedTimestamp = &v - return s -} - -// SetExpirationTimestamp sets the ExpirationTimestamp field's value. -func (s *VoiceProfile) SetExpirationTimestamp(v time.Time) *VoiceProfile { - s.ExpirationTimestamp = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *VoiceProfile) SetUpdatedTimestamp(v time.Time) *VoiceProfile { - s.UpdatedTimestamp = &v - return s -} - -// SetVoiceProfileArn sets the VoiceProfileArn field's value. -func (s *VoiceProfile) SetVoiceProfileArn(v string) *VoiceProfile { - s.VoiceProfileArn = &v - return s -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *VoiceProfile) SetVoiceProfileDomainId(v string) *VoiceProfile { - s.VoiceProfileDomainId = &v - return s -} - -// SetVoiceProfileId sets the VoiceProfileId field's value. -func (s *VoiceProfile) SetVoiceProfileId(v string) *VoiceProfile { - s.VoiceProfileId = &v - return s -} - -// A collection of voice profiles. -type VoiceProfileDomain struct { - _ struct{} `type:"structure"` - - // The time at which the voice profile domain was created. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The description of the voice profile domain. - Description *string `type:"string"` - - // The name of the voice profile domain. - Name *string `min:"1" type:"string"` - - // A structure that contains the configuration settings for server-side encryption. - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `type:"structure"` - - // The time at which the voice profile was last updated. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The voice profile domain's Amazon Resource Number (ARN). - // - // VoiceProfileDomainArn is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by VoiceProfileDomain's - // String and GoString methods. - VoiceProfileDomainArn *string `min:"1" type:"string" sensitive:"true"` - - // The ID of the voice profile domain. - VoiceProfileDomainId *string `min:"1" 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 VoiceProfileDomain) 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 VoiceProfileDomain) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *VoiceProfileDomain) SetCreatedTimestamp(v time.Time) *VoiceProfileDomain { - s.CreatedTimestamp = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *VoiceProfileDomain) SetDescription(v string) *VoiceProfileDomain { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *VoiceProfileDomain) SetName(v string) *VoiceProfileDomain { - s.Name = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *VoiceProfileDomain) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *VoiceProfileDomain { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *VoiceProfileDomain) SetUpdatedTimestamp(v time.Time) *VoiceProfileDomain { - s.UpdatedTimestamp = &v - return s -} - -// SetVoiceProfileDomainArn sets the VoiceProfileDomainArn field's value. -func (s *VoiceProfileDomain) SetVoiceProfileDomainArn(v string) *VoiceProfileDomain { - s.VoiceProfileDomainArn = &v - return s -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *VoiceProfileDomain) SetVoiceProfileDomainId(v string) *VoiceProfileDomain { - s.VoiceProfileDomainId = &v - return s -} - -// A high-level overview of a voice profile domain. -type VoiceProfileDomainSummary struct { - _ struct{} `type:"structure"` - - // The time at which the voice profile domain summary was created. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Describes the voice profile domain summary. - Description *string `type:"string"` - - // The name of the voice profile domain summary. - Name *string `min:"1" type:"string"` - - // The time at which the voice profile domain summary was last updated. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The ARN of a voice profile in a voice profile domain summary. - // - // VoiceProfileDomainArn is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by VoiceProfileDomainSummary's - // String and GoString methods. - VoiceProfileDomainArn *string `min:"1" type:"string" sensitive:"true"` - - // The ID of the voice profile domain summary. - VoiceProfileDomainId *string `min:"1" 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 VoiceProfileDomainSummary) 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 VoiceProfileDomainSummary) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *VoiceProfileDomainSummary) SetCreatedTimestamp(v time.Time) *VoiceProfileDomainSummary { - s.CreatedTimestamp = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *VoiceProfileDomainSummary) SetDescription(v string) *VoiceProfileDomainSummary { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *VoiceProfileDomainSummary) SetName(v string) *VoiceProfileDomainSummary { - s.Name = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *VoiceProfileDomainSummary) SetUpdatedTimestamp(v time.Time) *VoiceProfileDomainSummary { - s.UpdatedTimestamp = &v - return s -} - -// SetVoiceProfileDomainArn sets the VoiceProfileDomainArn field's value. -func (s *VoiceProfileDomainSummary) SetVoiceProfileDomainArn(v string) *VoiceProfileDomainSummary { - s.VoiceProfileDomainArn = &v - return s -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *VoiceProfileDomainSummary) SetVoiceProfileDomainId(v string) *VoiceProfileDomainSummary { - s.VoiceProfileDomainId = &v - return s -} - -// A high-level summary of a voice profile. -type VoiceProfileSummary struct { - _ struct{} `type:"structure"` - - // The time at which a voice profile summary was created. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Extends the life of the voice profile. You can use UpdateVoiceProfile to - // refresh an existing voice profile's voice print and extend the life of the - // summary. - ExpirationTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time at which a voice profile summary was last updated. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The ARN of the voice profile in a voice profile summary. - // - // VoiceProfileArn is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by VoiceProfileSummary's - // String and GoString methods. - VoiceProfileArn *string `min:"1" type:"string" sensitive:"true"` - - // The ID of the voice profile domain in a voice profile summary. - VoiceProfileDomainId *string `min:"1" type:"string"` - - // The ID of the voice profile in a voice profile summary. - VoiceProfileId *string `min:"1" 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 VoiceProfileSummary) 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 VoiceProfileSummary) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *VoiceProfileSummary) SetCreatedTimestamp(v time.Time) *VoiceProfileSummary { - s.CreatedTimestamp = &v - return s -} - -// SetExpirationTimestamp sets the ExpirationTimestamp field's value. -func (s *VoiceProfileSummary) SetExpirationTimestamp(v time.Time) *VoiceProfileSummary { - s.ExpirationTimestamp = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *VoiceProfileSummary) SetUpdatedTimestamp(v time.Time) *VoiceProfileSummary { - s.UpdatedTimestamp = &v - return s -} - -// SetVoiceProfileArn sets the VoiceProfileArn field's value. -func (s *VoiceProfileSummary) SetVoiceProfileArn(v string) *VoiceProfileSummary { - s.VoiceProfileArn = &v - return s -} - -// SetVoiceProfileDomainId sets the VoiceProfileDomainId field's value. -func (s *VoiceProfileSummary) SetVoiceProfileDomainId(v string) *VoiceProfileSummary { - s.VoiceProfileDomainId = &v - return s -} - -// SetVoiceProfileId sets the VoiceProfileId field's value. -func (s *VoiceProfileSummary) SetVoiceProfileId(v string) *VoiceProfileSummary { - s.VoiceProfileId = &v - return s -} - -// A representation of an asynchronous request to perform voice tone analysis -// on a Voice Connector call. -type VoiceToneAnalysisTask struct { - _ struct{} `type:"structure"` - - // The call details of a voice tone analysis task. - CallDetails *CallDetails `type:"structure"` - - // The time at which a voice tone analysis task was created. - CreatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time at which a voice tone analysis task started. - StartedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The status of a voice tone analysis task. - StatusMessage *string `type:"string"` - - // The time at which a voice tone analysis task was updated. - UpdatedTimestamp *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the voice tone analysis task. - VoiceToneAnalysisTaskId *string `min:"1" type:"string"` - - // The status of a voice tone analysis task, IN_QUEUE, IN_PROGRESS, PARTIAL_SUCCESS, - // SUCCEEDED, FAILED, or STOPPED. - VoiceToneAnalysisTaskStatus *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 VoiceToneAnalysisTask) 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 VoiceToneAnalysisTask) GoString() string { - return s.String() -} - -// SetCallDetails sets the CallDetails field's value. -func (s *VoiceToneAnalysisTask) SetCallDetails(v *CallDetails) *VoiceToneAnalysisTask { - s.CallDetails = v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *VoiceToneAnalysisTask) SetCreatedTimestamp(v time.Time) *VoiceToneAnalysisTask { - s.CreatedTimestamp = &v - return s -} - -// SetStartedTimestamp sets the StartedTimestamp field's value. -func (s *VoiceToneAnalysisTask) SetStartedTimestamp(v time.Time) *VoiceToneAnalysisTask { - s.StartedTimestamp = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VoiceToneAnalysisTask) SetStatusMessage(v string) *VoiceToneAnalysisTask { - s.StatusMessage = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *VoiceToneAnalysisTask) SetUpdatedTimestamp(v time.Time) *VoiceToneAnalysisTask { - s.UpdatedTimestamp = &v - return s -} - -// SetVoiceToneAnalysisTaskId sets the VoiceToneAnalysisTaskId field's value. -func (s *VoiceToneAnalysisTask) SetVoiceToneAnalysisTaskId(v string) *VoiceToneAnalysisTask { - s.VoiceToneAnalysisTaskId = &v - return s -} - -// SetVoiceToneAnalysisTaskStatus sets the VoiceToneAnalysisTaskStatus field's value. -func (s *VoiceToneAnalysisTask) SetVoiceToneAnalysisTaskStatus(v string) *VoiceToneAnalysisTask { - s.VoiceToneAnalysisTaskStatus = &v - return s -} - -const ( - // AlexaSkillStatusActive is a AlexaSkillStatus enum value - AlexaSkillStatusActive = "ACTIVE" - - // AlexaSkillStatusInactive is a AlexaSkillStatus enum value - AlexaSkillStatusInactive = "INACTIVE" -) - -// AlexaSkillStatus_Values returns all elements of the AlexaSkillStatus enum -func AlexaSkillStatus_Values() []string { - return []string{ - AlexaSkillStatusActive, - AlexaSkillStatusInactive, - } -} - -const ( - // CallLegTypeCaller is a CallLegType enum value - CallLegTypeCaller = "Caller" - - // CallLegTypeCallee is a CallLegType enum value - CallLegTypeCallee = "Callee" -) - -// CallLegType_Values returns all elements of the CallLegType enum -func CallLegType_Values() []string { - return []string{ - CallLegTypeCaller, - CallLegTypeCallee, - } -} - -const ( - // CallingNameStatusUnassigned is a CallingNameStatus enum value - CallingNameStatusUnassigned = "Unassigned" - - // CallingNameStatusUpdateInProgress is a CallingNameStatus enum value - CallingNameStatusUpdateInProgress = "UpdateInProgress" - - // CallingNameStatusUpdateSucceeded is a CallingNameStatus enum value - CallingNameStatusUpdateSucceeded = "UpdateSucceeded" - - // CallingNameStatusUpdateFailed is a CallingNameStatus enum value - CallingNameStatusUpdateFailed = "UpdateFailed" -) - -// CallingNameStatus_Values returns all elements of the CallingNameStatus enum -func CallingNameStatus_Values() []string { - return []string{ - CallingNameStatusUnassigned, - CallingNameStatusUpdateInProgress, - CallingNameStatusUpdateSucceeded, - CallingNameStatusUpdateFailed, - } -} - -const ( - // CapabilityVoice is a Capability enum value - CapabilityVoice = "Voice" - - // CapabilitySms is a Capability enum value - CapabilitySms = "SMS" -) - -// Capability_Values returns all elements of the Capability enum -func Capability_Values() []string { - return []string{ - CapabilityVoice, - CapabilitySms, - } -} - -const ( - // ErrorCodeBadRequest is a ErrorCode enum value - ErrorCodeBadRequest = "BadRequest" - - // ErrorCodeConflict is a ErrorCode enum value - ErrorCodeConflict = "Conflict" - - // ErrorCodeForbidden is a ErrorCode enum value - ErrorCodeForbidden = "Forbidden" - - // ErrorCodeNotFound is a ErrorCode enum value - ErrorCodeNotFound = "NotFound" - - // ErrorCodePreconditionFailed is a ErrorCode enum value - ErrorCodePreconditionFailed = "PreconditionFailed" - - // ErrorCodeResourceLimitExceeded is a ErrorCode enum value - ErrorCodeResourceLimitExceeded = "ResourceLimitExceeded" - - // ErrorCodeServiceFailure is a ErrorCode enum value - ErrorCodeServiceFailure = "ServiceFailure" - - // ErrorCodeAccessDenied is a ErrorCode enum value - ErrorCodeAccessDenied = "AccessDenied" - - // ErrorCodeServiceUnavailable is a ErrorCode enum value - ErrorCodeServiceUnavailable = "ServiceUnavailable" - - // ErrorCodeThrottled is a ErrorCode enum value - ErrorCodeThrottled = "Throttled" - - // ErrorCodeThrottling is a ErrorCode enum value - ErrorCodeThrottling = "Throttling" - - // ErrorCodeUnauthorized is a ErrorCode enum value - ErrorCodeUnauthorized = "Unauthorized" - - // ErrorCodeUnprocessable is a ErrorCode enum value - ErrorCodeUnprocessable = "Unprocessable" - - // ErrorCodeVoiceConnectorGroupAssociationsExist is a ErrorCode enum value - ErrorCodeVoiceConnectorGroupAssociationsExist = "VoiceConnectorGroupAssociationsExist" - - // ErrorCodePhoneNumberAssociationsExist is a ErrorCode enum value - ErrorCodePhoneNumberAssociationsExist = "PhoneNumberAssociationsExist" - - // ErrorCodeGone is a ErrorCode enum value - ErrorCodeGone = "Gone" -) - -// ErrorCode_Values returns all elements of the ErrorCode enum -func ErrorCode_Values() []string { - return []string{ - ErrorCodeBadRequest, - ErrorCodeConflict, - ErrorCodeForbidden, - ErrorCodeNotFound, - ErrorCodePreconditionFailed, - ErrorCodeResourceLimitExceeded, - ErrorCodeServiceFailure, - ErrorCodeAccessDenied, - ErrorCodeServiceUnavailable, - ErrorCodeThrottled, - ErrorCodeThrottling, - ErrorCodeUnauthorized, - ErrorCodeUnprocessable, - ErrorCodeVoiceConnectorGroupAssociationsExist, - ErrorCodePhoneNumberAssociationsExist, - ErrorCodeGone, - } -} - -const ( - // GeoMatchLevelCountry is a GeoMatchLevel enum value - GeoMatchLevelCountry = "Country" - - // GeoMatchLevelAreaCode is a GeoMatchLevel enum value - GeoMatchLevelAreaCode = "AreaCode" -) - -// GeoMatchLevel_Values returns all elements of the GeoMatchLevel enum -func GeoMatchLevel_Values() []string { - return []string{ - GeoMatchLevelCountry, - GeoMatchLevelAreaCode, - } -} - -const ( - // LanguageCodeEnUs is a LanguageCode enum value - LanguageCodeEnUs = "en-US" -) - -// LanguageCode_Values returns all elements of the LanguageCode enum -func LanguageCode_Values() []string { - return []string{ - LanguageCodeEnUs, - } -} - -const ( - // NotificationTargetEventBridge is a NotificationTarget enum value - NotificationTargetEventBridge = "EventBridge" - - // NotificationTargetSns is a NotificationTarget enum value - NotificationTargetSns = "SNS" - - // NotificationTargetSqs is a NotificationTarget enum value - NotificationTargetSqs = "SQS" -) - -// NotificationTarget_Values returns all elements of the NotificationTarget enum -func NotificationTarget_Values() []string { - return []string{ - NotificationTargetEventBridge, - NotificationTargetSns, - NotificationTargetSqs, - } -} - -const ( - // NumberSelectionBehaviorPreferSticky is a NumberSelectionBehavior enum value - NumberSelectionBehaviorPreferSticky = "PreferSticky" - - // NumberSelectionBehaviorAvoidSticky is a NumberSelectionBehavior enum value - NumberSelectionBehaviorAvoidSticky = "AvoidSticky" -) - -// NumberSelectionBehavior_Values returns all elements of the NumberSelectionBehavior enum -func NumberSelectionBehavior_Values() []string { - return []string{ - NumberSelectionBehaviorPreferSticky, - NumberSelectionBehaviorAvoidSticky, - } -} - -const ( - // OrderedPhoneNumberStatusProcessing is a OrderedPhoneNumberStatus enum value - OrderedPhoneNumberStatusProcessing = "Processing" - - // OrderedPhoneNumberStatusAcquired is a OrderedPhoneNumberStatus enum value - OrderedPhoneNumberStatusAcquired = "Acquired" - - // OrderedPhoneNumberStatusFailed is a OrderedPhoneNumberStatus enum value - OrderedPhoneNumberStatusFailed = "Failed" -) - -// OrderedPhoneNumberStatus_Values returns all elements of the OrderedPhoneNumberStatus enum -func OrderedPhoneNumberStatus_Values() []string { - return []string{ - OrderedPhoneNumberStatusProcessing, - OrderedPhoneNumberStatusAcquired, - OrderedPhoneNumberStatusFailed, - } -} - -const ( - // OriginationRouteProtocolTcp is a OriginationRouteProtocol enum value - OriginationRouteProtocolTcp = "TCP" - - // OriginationRouteProtocolUdp is a OriginationRouteProtocol enum value - OriginationRouteProtocolUdp = "UDP" -) - -// OriginationRouteProtocol_Values returns all elements of the OriginationRouteProtocol enum -func OriginationRouteProtocol_Values() []string { - return []string{ - OriginationRouteProtocolTcp, - OriginationRouteProtocolUdp, - } -} - -const ( - // PhoneNumberAssociationNameVoiceConnectorId is a PhoneNumberAssociationName enum value - PhoneNumberAssociationNameVoiceConnectorId = "VoiceConnectorId" - - // PhoneNumberAssociationNameVoiceConnectorGroupId is a PhoneNumberAssociationName enum value - PhoneNumberAssociationNameVoiceConnectorGroupId = "VoiceConnectorGroupId" - - // PhoneNumberAssociationNameSipRuleId is a PhoneNumberAssociationName enum value - PhoneNumberAssociationNameSipRuleId = "SipRuleId" -) - -// PhoneNumberAssociationName_Values returns all elements of the PhoneNumberAssociationName enum -func PhoneNumberAssociationName_Values() []string { - return []string{ - PhoneNumberAssociationNameVoiceConnectorId, - PhoneNumberAssociationNameVoiceConnectorGroupId, - PhoneNumberAssociationNameSipRuleId, - } -} - -const ( - // PhoneNumberOrderStatusProcessing is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusProcessing = "Processing" - - // PhoneNumberOrderStatusSuccessful is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusSuccessful = "Successful" - - // PhoneNumberOrderStatusFailed is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusFailed = "Failed" - - // PhoneNumberOrderStatusPartial is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusPartial = "Partial" - - // PhoneNumberOrderStatusPendingDocuments is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusPendingDocuments = "PendingDocuments" - - // PhoneNumberOrderStatusSubmitted is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusSubmitted = "Submitted" - - // PhoneNumberOrderStatusFoc is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusFoc = "FOC" - - // PhoneNumberOrderStatusChangeRequested is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusChangeRequested = "ChangeRequested" - - // PhoneNumberOrderStatusException is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusException = "Exception" - - // PhoneNumberOrderStatusCancelRequested is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusCancelRequested = "CancelRequested" - - // PhoneNumberOrderStatusCancelled is a PhoneNumberOrderStatus enum value - PhoneNumberOrderStatusCancelled = "Cancelled" -) - -// PhoneNumberOrderStatus_Values returns all elements of the PhoneNumberOrderStatus enum -func PhoneNumberOrderStatus_Values() []string { - return []string{ - PhoneNumberOrderStatusProcessing, - PhoneNumberOrderStatusSuccessful, - PhoneNumberOrderStatusFailed, - PhoneNumberOrderStatusPartial, - PhoneNumberOrderStatusPendingDocuments, - PhoneNumberOrderStatusSubmitted, - PhoneNumberOrderStatusFoc, - PhoneNumberOrderStatusChangeRequested, - PhoneNumberOrderStatusException, - PhoneNumberOrderStatusCancelRequested, - PhoneNumberOrderStatusCancelled, - } -} - -const ( - // PhoneNumberOrderTypeNew is a PhoneNumberOrderType enum value - PhoneNumberOrderTypeNew = "New" - - // PhoneNumberOrderTypePorting is a PhoneNumberOrderType enum value - PhoneNumberOrderTypePorting = "Porting" -) - -// PhoneNumberOrderType_Values returns all elements of the PhoneNumberOrderType enum -func PhoneNumberOrderType_Values() []string { - return []string{ - PhoneNumberOrderTypeNew, - PhoneNumberOrderTypePorting, - } -} - -const ( - // PhoneNumberProductTypeVoiceConnector is a PhoneNumberProductType enum value - PhoneNumberProductTypeVoiceConnector = "VoiceConnector" - - // PhoneNumberProductTypeSipMediaApplicationDialIn is a PhoneNumberProductType enum value - PhoneNumberProductTypeSipMediaApplicationDialIn = "SipMediaApplicationDialIn" -) - -// PhoneNumberProductType_Values returns all elements of the PhoneNumberProductType enum -func PhoneNumberProductType_Values() []string { - return []string{ - PhoneNumberProductTypeVoiceConnector, - PhoneNumberProductTypeSipMediaApplicationDialIn, - } -} - -const ( - // PhoneNumberStatusCancelled is a PhoneNumberStatus enum value - PhoneNumberStatusCancelled = "Cancelled" - - // PhoneNumberStatusPortinCancelRequested is a PhoneNumberStatus enum value - PhoneNumberStatusPortinCancelRequested = "PortinCancelRequested" - - // PhoneNumberStatusPortinInProgress is a PhoneNumberStatus enum value - PhoneNumberStatusPortinInProgress = "PortinInProgress" - - // PhoneNumberStatusAcquireInProgress is a PhoneNumberStatus enum value - PhoneNumberStatusAcquireInProgress = "AcquireInProgress" - - // PhoneNumberStatusAcquireFailed is a PhoneNumberStatus enum value - PhoneNumberStatusAcquireFailed = "AcquireFailed" - - // PhoneNumberStatusUnassigned is a PhoneNumberStatus enum value - PhoneNumberStatusUnassigned = "Unassigned" - - // PhoneNumberStatusAssigned is a PhoneNumberStatus enum value - PhoneNumberStatusAssigned = "Assigned" - - // PhoneNumberStatusReleaseInProgress is a PhoneNumberStatus enum value - PhoneNumberStatusReleaseInProgress = "ReleaseInProgress" - - // PhoneNumberStatusDeleteInProgress is a PhoneNumberStatus enum value - PhoneNumberStatusDeleteInProgress = "DeleteInProgress" - - // PhoneNumberStatusReleaseFailed is a PhoneNumberStatus enum value - PhoneNumberStatusReleaseFailed = "ReleaseFailed" - - // PhoneNumberStatusDeleteFailed is a PhoneNumberStatus enum value - PhoneNumberStatusDeleteFailed = "DeleteFailed" -) - -// PhoneNumberStatus_Values returns all elements of the PhoneNumberStatus enum -func PhoneNumberStatus_Values() []string { - return []string{ - PhoneNumberStatusCancelled, - PhoneNumberStatusPortinCancelRequested, - PhoneNumberStatusPortinInProgress, - PhoneNumberStatusAcquireInProgress, - PhoneNumberStatusAcquireFailed, - PhoneNumberStatusUnassigned, - PhoneNumberStatusAssigned, - PhoneNumberStatusReleaseInProgress, - PhoneNumberStatusDeleteInProgress, - PhoneNumberStatusReleaseFailed, - PhoneNumberStatusDeleteFailed, - } -} - -const ( - // PhoneNumberTypeLocal is a PhoneNumberType enum value - PhoneNumberTypeLocal = "Local" - - // PhoneNumberTypeTollFree is a PhoneNumberType enum value - PhoneNumberTypeTollFree = "TollFree" -) - -// PhoneNumberType_Values returns all elements of the PhoneNumberType enum -func PhoneNumberType_Values() []string { - return []string{ - PhoneNumberTypeLocal, - PhoneNumberTypeTollFree, - } -} - -const ( - // ProxySessionStatusOpen is a ProxySessionStatus enum value - ProxySessionStatusOpen = "Open" - - // ProxySessionStatusInProgress is a ProxySessionStatus enum value - ProxySessionStatusInProgress = "InProgress" - - // ProxySessionStatusClosed is a ProxySessionStatus enum value - ProxySessionStatusClosed = "Closed" -) - -// ProxySessionStatus_Values returns all elements of the ProxySessionStatus enum -func ProxySessionStatus_Values() []string { - return []string{ - ProxySessionStatusOpen, - ProxySessionStatusInProgress, - ProxySessionStatusClosed, - } -} - -const ( - // SipRuleTriggerTypeToPhoneNumber is a SipRuleTriggerType enum value - SipRuleTriggerTypeToPhoneNumber = "ToPhoneNumber" - - // SipRuleTriggerTypeRequestUriHostname is a SipRuleTriggerType enum value - SipRuleTriggerTypeRequestUriHostname = "RequestUriHostname" -) - -// SipRuleTriggerType_Values returns all elements of the SipRuleTriggerType enum -func SipRuleTriggerType_Values() []string { - return []string{ - SipRuleTriggerTypeToPhoneNumber, - SipRuleTriggerTypeRequestUriHostname, - } -} - -const ( - // VoiceConnectorAwsRegionUsEast1 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionUsEast1 = "us-east-1" - - // VoiceConnectorAwsRegionUsWest2 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionUsWest2 = "us-west-2" - - // VoiceConnectorAwsRegionCaCentral1 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionCaCentral1 = "ca-central-1" - - // VoiceConnectorAwsRegionEuCentral1 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionEuCentral1 = "eu-central-1" - - // VoiceConnectorAwsRegionEuWest1 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionEuWest1 = "eu-west-1" - - // VoiceConnectorAwsRegionEuWest2 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionEuWest2 = "eu-west-2" - - // VoiceConnectorAwsRegionApNortheast2 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionApNortheast2 = "ap-northeast-2" - - // VoiceConnectorAwsRegionApNortheast1 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionApNortheast1 = "ap-northeast-1" - - // VoiceConnectorAwsRegionApSoutheast1 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionApSoutheast1 = "ap-southeast-1" - - // VoiceConnectorAwsRegionApSoutheast2 is a VoiceConnectorAwsRegion enum value - VoiceConnectorAwsRegionApSoutheast2 = "ap-southeast-2" -) - -// VoiceConnectorAwsRegion_Values returns all elements of the VoiceConnectorAwsRegion enum -func VoiceConnectorAwsRegion_Values() []string { - return []string{ - VoiceConnectorAwsRegionUsEast1, - VoiceConnectorAwsRegionUsWest2, - VoiceConnectorAwsRegionCaCentral1, - VoiceConnectorAwsRegionEuCentral1, - VoiceConnectorAwsRegionEuWest1, - VoiceConnectorAwsRegionEuWest2, - VoiceConnectorAwsRegionApNortheast2, - VoiceConnectorAwsRegionApNortheast1, - VoiceConnectorAwsRegionApSoutheast1, - VoiceConnectorAwsRegionApSoutheast2, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/chimesdkvoiceiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/chimesdkvoiceiface/interface.go deleted file mode 100644 index b1e192cfbf4f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/chimesdkvoiceiface/interface.go +++ /dev/null @@ -1,466 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package chimesdkvoiceiface provides an interface to enable mocking the Amazon Chime SDK Voice service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package chimesdkvoiceiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice" -) - -// ChimeSDKVoiceAPI provides an interface to enable mocking the -// chimesdkvoice.ChimeSDKVoice service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Chime SDK Voice. -// func myFunc(svc chimesdkvoiceiface.ChimeSDKVoiceAPI) bool { -// // Make svc.AssociatePhoneNumbersWithVoiceConnector request -// } -// -// func main() { -// sess := session.New() -// svc := chimesdkvoice.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockChimeSDKVoiceClient struct { -// chimesdkvoiceiface.ChimeSDKVoiceAPI -// } -// func (m *mockChimeSDKVoiceClient) AssociatePhoneNumbersWithVoiceConnector(input *chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorInput) (*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockChimeSDKVoiceClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type ChimeSDKVoiceAPI interface { - AssociatePhoneNumbersWithVoiceConnector(*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorInput) (*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorOutput, error) - AssociatePhoneNumbersWithVoiceConnectorWithContext(aws.Context, *chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorInput, ...request.Option) (*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorOutput, error) - AssociatePhoneNumbersWithVoiceConnectorRequest(*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorInput) (*request.Request, *chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorOutput) - - AssociatePhoneNumbersWithVoiceConnectorGroup(*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorGroupInput) (*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorGroupOutput, error) - AssociatePhoneNumbersWithVoiceConnectorGroupWithContext(aws.Context, *chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorGroupInput, ...request.Option) (*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorGroupOutput, error) - AssociatePhoneNumbersWithVoiceConnectorGroupRequest(*chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorGroupInput) (*request.Request, *chimesdkvoice.AssociatePhoneNumbersWithVoiceConnectorGroupOutput) - - BatchDeletePhoneNumber(*chimesdkvoice.BatchDeletePhoneNumberInput) (*chimesdkvoice.BatchDeletePhoneNumberOutput, error) - BatchDeletePhoneNumberWithContext(aws.Context, *chimesdkvoice.BatchDeletePhoneNumberInput, ...request.Option) (*chimesdkvoice.BatchDeletePhoneNumberOutput, error) - BatchDeletePhoneNumberRequest(*chimesdkvoice.BatchDeletePhoneNumberInput) (*request.Request, *chimesdkvoice.BatchDeletePhoneNumberOutput) - - BatchUpdatePhoneNumber(*chimesdkvoice.BatchUpdatePhoneNumberInput) (*chimesdkvoice.BatchUpdatePhoneNumberOutput, error) - BatchUpdatePhoneNumberWithContext(aws.Context, *chimesdkvoice.BatchUpdatePhoneNumberInput, ...request.Option) (*chimesdkvoice.BatchUpdatePhoneNumberOutput, error) - BatchUpdatePhoneNumberRequest(*chimesdkvoice.BatchUpdatePhoneNumberInput) (*request.Request, *chimesdkvoice.BatchUpdatePhoneNumberOutput) - - CreatePhoneNumberOrder(*chimesdkvoice.CreatePhoneNumberOrderInput) (*chimesdkvoice.CreatePhoneNumberOrderOutput, error) - CreatePhoneNumberOrderWithContext(aws.Context, *chimesdkvoice.CreatePhoneNumberOrderInput, ...request.Option) (*chimesdkvoice.CreatePhoneNumberOrderOutput, error) - CreatePhoneNumberOrderRequest(*chimesdkvoice.CreatePhoneNumberOrderInput) (*request.Request, *chimesdkvoice.CreatePhoneNumberOrderOutput) - - CreateProxySession(*chimesdkvoice.CreateProxySessionInput) (*chimesdkvoice.CreateProxySessionOutput, error) - CreateProxySessionWithContext(aws.Context, *chimesdkvoice.CreateProxySessionInput, ...request.Option) (*chimesdkvoice.CreateProxySessionOutput, error) - CreateProxySessionRequest(*chimesdkvoice.CreateProxySessionInput) (*request.Request, *chimesdkvoice.CreateProxySessionOutput) - - CreateSipMediaApplication(*chimesdkvoice.CreateSipMediaApplicationInput) (*chimesdkvoice.CreateSipMediaApplicationOutput, error) - CreateSipMediaApplicationWithContext(aws.Context, *chimesdkvoice.CreateSipMediaApplicationInput, ...request.Option) (*chimesdkvoice.CreateSipMediaApplicationOutput, error) - CreateSipMediaApplicationRequest(*chimesdkvoice.CreateSipMediaApplicationInput) (*request.Request, *chimesdkvoice.CreateSipMediaApplicationOutput) - - CreateSipMediaApplicationCall(*chimesdkvoice.CreateSipMediaApplicationCallInput) (*chimesdkvoice.CreateSipMediaApplicationCallOutput, error) - CreateSipMediaApplicationCallWithContext(aws.Context, *chimesdkvoice.CreateSipMediaApplicationCallInput, ...request.Option) (*chimesdkvoice.CreateSipMediaApplicationCallOutput, error) - CreateSipMediaApplicationCallRequest(*chimesdkvoice.CreateSipMediaApplicationCallInput) (*request.Request, *chimesdkvoice.CreateSipMediaApplicationCallOutput) - - CreateSipRule(*chimesdkvoice.CreateSipRuleInput) (*chimesdkvoice.CreateSipRuleOutput, error) - CreateSipRuleWithContext(aws.Context, *chimesdkvoice.CreateSipRuleInput, ...request.Option) (*chimesdkvoice.CreateSipRuleOutput, error) - CreateSipRuleRequest(*chimesdkvoice.CreateSipRuleInput) (*request.Request, *chimesdkvoice.CreateSipRuleOutput) - - CreateVoiceConnector(*chimesdkvoice.CreateVoiceConnectorInput) (*chimesdkvoice.CreateVoiceConnectorOutput, error) - CreateVoiceConnectorWithContext(aws.Context, *chimesdkvoice.CreateVoiceConnectorInput, ...request.Option) (*chimesdkvoice.CreateVoiceConnectorOutput, error) - CreateVoiceConnectorRequest(*chimesdkvoice.CreateVoiceConnectorInput) (*request.Request, *chimesdkvoice.CreateVoiceConnectorOutput) - - CreateVoiceConnectorGroup(*chimesdkvoice.CreateVoiceConnectorGroupInput) (*chimesdkvoice.CreateVoiceConnectorGroupOutput, error) - CreateVoiceConnectorGroupWithContext(aws.Context, *chimesdkvoice.CreateVoiceConnectorGroupInput, ...request.Option) (*chimesdkvoice.CreateVoiceConnectorGroupOutput, error) - CreateVoiceConnectorGroupRequest(*chimesdkvoice.CreateVoiceConnectorGroupInput) (*request.Request, *chimesdkvoice.CreateVoiceConnectorGroupOutput) - - CreateVoiceProfile(*chimesdkvoice.CreateVoiceProfileInput) (*chimesdkvoice.CreateVoiceProfileOutput, error) - CreateVoiceProfileWithContext(aws.Context, *chimesdkvoice.CreateVoiceProfileInput, ...request.Option) (*chimesdkvoice.CreateVoiceProfileOutput, error) - CreateVoiceProfileRequest(*chimesdkvoice.CreateVoiceProfileInput) (*request.Request, *chimesdkvoice.CreateVoiceProfileOutput) - - CreateVoiceProfileDomain(*chimesdkvoice.CreateVoiceProfileDomainInput) (*chimesdkvoice.CreateVoiceProfileDomainOutput, error) - CreateVoiceProfileDomainWithContext(aws.Context, *chimesdkvoice.CreateVoiceProfileDomainInput, ...request.Option) (*chimesdkvoice.CreateVoiceProfileDomainOutput, error) - CreateVoiceProfileDomainRequest(*chimesdkvoice.CreateVoiceProfileDomainInput) (*request.Request, *chimesdkvoice.CreateVoiceProfileDomainOutput) - - DeletePhoneNumber(*chimesdkvoice.DeletePhoneNumberInput) (*chimesdkvoice.DeletePhoneNumberOutput, error) - DeletePhoneNumberWithContext(aws.Context, *chimesdkvoice.DeletePhoneNumberInput, ...request.Option) (*chimesdkvoice.DeletePhoneNumberOutput, error) - DeletePhoneNumberRequest(*chimesdkvoice.DeletePhoneNumberInput) (*request.Request, *chimesdkvoice.DeletePhoneNumberOutput) - - DeleteProxySession(*chimesdkvoice.DeleteProxySessionInput) (*chimesdkvoice.DeleteProxySessionOutput, error) - DeleteProxySessionWithContext(aws.Context, *chimesdkvoice.DeleteProxySessionInput, ...request.Option) (*chimesdkvoice.DeleteProxySessionOutput, error) - DeleteProxySessionRequest(*chimesdkvoice.DeleteProxySessionInput) (*request.Request, *chimesdkvoice.DeleteProxySessionOutput) - - DeleteSipMediaApplication(*chimesdkvoice.DeleteSipMediaApplicationInput) (*chimesdkvoice.DeleteSipMediaApplicationOutput, error) - DeleteSipMediaApplicationWithContext(aws.Context, *chimesdkvoice.DeleteSipMediaApplicationInput, ...request.Option) (*chimesdkvoice.DeleteSipMediaApplicationOutput, error) - DeleteSipMediaApplicationRequest(*chimesdkvoice.DeleteSipMediaApplicationInput) (*request.Request, *chimesdkvoice.DeleteSipMediaApplicationOutput) - - DeleteSipRule(*chimesdkvoice.DeleteSipRuleInput) (*chimesdkvoice.DeleteSipRuleOutput, error) - DeleteSipRuleWithContext(aws.Context, *chimesdkvoice.DeleteSipRuleInput, ...request.Option) (*chimesdkvoice.DeleteSipRuleOutput, error) - DeleteSipRuleRequest(*chimesdkvoice.DeleteSipRuleInput) (*request.Request, *chimesdkvoice.DeleteSipRuleOutput) - - DeleteVoiceConnector(*chimesdkvoice.DeleteVoiceConnectorInput) (*chimesdkvoice.DeleteVoiceConnectorOutput, error) - DeleteVoiceConnectorWithContext(aws.Context, *chimesdkvoice.DeleteVoiceConnectorInput, ...request.Option) (*chimesdkvoice.DeleteVoiceConnectorOutput, error) - DeleteVoiceConnectorRequest(*chimesdkvoice.DeleteVoiceConnectorInput) (*request.Request, *chimesdkvoice.DeleteVoiceConnectorOutput) - - DeleteVoiceConnectorEmergencyCallingConfiguration(*chimesdkvoice.DeleteVoiceConnectorEmergencyCallingConfigurationInput) (*chimesdkvoice.DeleteVoiceConnectorEmergencyCallingConfigurationOutput, error) - DeleteVoiceConnectorEmergencyCallingConfigurationWithContext(aws.Context, *chimesdkvoice.DeleteVoiceConnectorEmergencyCallingConfigurationInput, ...request.Option) (*chimesdkvoice.DeleteVoiceConnectorEmergencyCallingConfigurationOutput, error) - DeleteVoiceConnectorEmergencyCallingConfigurationRequest(*chimesdkvoice.DeleteVoiceConnectorEmergencyCallingConfigurationInput) (*request.Request, *chimesdkvoice.DeleteVoiceConnectorEmergencyCallingConfigurationOutput) - - DeleteVoiceConnectorGroup(*chimesdkvoice.DeleteVoiceConnectorGroupInput) (*chimesdkvoice.DeleteVoiceConnectorGroupOutput, error) - DeleteVoiceConnectorGroupWithContext(aws.Context, *chimesdkvoice.DeleteVoiceConnectorGroupInput, ...request.Option) (*chimesdkvoice.DeleteVoiceConnectorGroupOutput, error) - DeleteVoiceConnectorGroupRequest(*chimesdkvoice.DeleteVoiceConnectorGroupInput) (*request.Request, *chimesdkvoice.DeleteVoiceConnectorGroupOutput) - - DeleteVoiceConnectorOrigination(*chimesdkvoice.DeleteVoiceConnectorOriginationInput) (*chimesdkvoice.DeleteVoiceConnectorOriginationOutput, error) - DeleteVoiceConnectorOriginationWithContext(aws.Context, *chimesdkvoice.DeleteVoiceConnectorOriginationInput, ...request.Option) (*chimesdkvoice.DeleteVoiceConnectorOriginationOutput, error) - DeleteVoiceConnectorOriginationRequest(*chimesdkvoice.DeleteVoiceConnectorOriginationInput) (*request.Request, *chimesdkvoice.DeleteVoiceConnectorOriginationOutput) - - DeleteVoiceConnectorProxy(*chimesdkvoice.DeleteVoiceConnectorProxyInput) (*chimesdkvoice.DeleteVoiceConnectorProxyOutput, error) - DeleteVoiceConnectorProxyWithContext(aws.Context, *chimesdkvoice.DeleteVoiceConnectorProxyInput, ...request.Option) (*chimesdkvoice.DeleteVoiceConnectorProxyOutput, error) - DeleteVoiceConnectorProxyRequest(*chimesdkvoice.DeleteVoiceConnectorProxyInput) (*request.Request, *chimesdkvoice.DeleteVoiceConnectorProxyOutput) - - DeleteVoiceConnectorStreamingConfiguration(*chimesdkvoice.DeleteVoiceConnectorStreamingConfigurationInput) (*chimesdkvoice.DeleteVoiceConnectorStreamingConfigurationOutput, error) - DeleteVoiceConnectorStreamingConfigurationWithContext(aws.Context, *chimesdkvoice.DeleteVoiceConnectorStreamingConfigurationInput, ...request.Option) (*chimesdkvoice.DeleteVoiceConnectorStreamingConfigurationOutput, error) - DeleteVoiceConnectorStreamingConfigurationRequest(*chimesdkvoice.DeleteVoiceConnectorStreamingConfigurationInput) (*request.Request, *chimesdkvoice.DeleteVoiceConnectorStreamingConfigurationOutput) - - DeleteVoiceConnectorTermination(*chimesdkvoice.DeleteVoiceConnectorTerminationInput) (*chimesdkvoice.DeleteVoiceConnectorTerminationOutput, error) - DeleteVoiceConnectorTerminationWithContext(aws.Context, *chimesdkvoice.DeleteVoiceConnectorTerminationInput, ...request.Option) (*chimesdkvoice.DeleteVoiceConnectorTerminationOutput, error) - DeleteVoiceConnectorTerminationRequest(*chimesdkvoice.DeleteVoiceConnectorTerminationInput) (*request.Request, *chimesdkvoice.DeleteVoiceConnectorTerminationOutput) - - DeleteVoiceConnectorTerminationCredentials(*chimesdkvoice.DeleteVoiceConnectorTerminationCredentialsInput) (*chimesdkvoice.DeleteVoiceConnectorTerminationCredentialsOutput, error) - DeleteVoiceConnectorTerminationCredentialsWithContext(aws.Context, *chimesdkvoice.DeleteVoiceConnectorTerminationCredentialsInput, ...request.Option) (*chimesdkvoice.DeleteVoiceConnectorTerminationCredentialsOutput, error) - DeleteVoiceConnectorTerminationCredentialsRequest(*chimesdkvoice.DeleteVoiceConnectorTerminationCredentialsInput) (*request.Request, *chimesdkvoice.DeleteVoiceConnectorTerminationCredentialsOutput) - - DeleteVoiceProfile(*chimesdkvoice.DeleteVoiceProfileInput) (*chimesdkvoice.DeleteVoiceProfileOutput, error) - DeleteVoiceProfileWithContext(aws.Context, *chimesdkvoice.DeleteVoiceProfileInput, ...request.Option) (*chimesdkvoice.DeleteVoiceProfileOutput, error) - DeleteVoiceProfileRequest(*chimesdkvoice.DeleteVoiceProfileInput) (*request.Request, *chimesdkvoice.DeleteVoiceProfileOutput) - - DeleteVoiceProfileDomain(*chimesdkvoice.DeleteVoiceProfileDomainInput) (*chimesdkvoice.DeleteVoiceProfileDomainOutput, error) - DeleteVoiceProfileDomainWithContext(aws.Context, *chimesdkvoice.DeleteVoiceProfileDomainInput, ...request.Option) (*chimesdkvoice.DeleteVoiceProfileDomainOutput, error) - DeleteVoiceProfileDomainRequest(*chimesdkvoice.DeleteVoiceProfileDomainInput) (*request.Request, *chimesdkvoice.DeleteVoiceProfileDomainOutput) - - DisassociatePhoneNumbersFromVoiceConnector(*chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorInput) (*chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorOutput, error) - DisassociatePhoneNumbersFromVoiceConnectorWithContext(aws.Context, *chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorInput, ...request.Option) (*chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorOutput, error) - DisassociatePhoneNumbersFromVoiceConnectorRequest(*chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorInput) (*request.Request, *chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorOutput) - - DisassociatePhoneNumbersFromVoiceConnectorGroup(*chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorGroupInput) (*chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorGroupOutput, error) - DisassociatePhoneNumbersFromVoiceConnectorGroupWithContext(aws.Context, *chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorGroupInput, ...request.Option) (*chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorGroupOutput, error) - DisassociatePhoneNumbersFromVoiceConnectorGroupRequest(*chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorGroupInput) (*request.Request, *chimesdkvoice.DisassociatePhoneNumbersFromVoiceConnectorGroupOutput) - - GetGlobalSettings(*chimesdkvoice.GetGlobalSettingsInput) (*chimesdkvoice.GetGlobalSettingsOutput, error) - GetGlobalSettingsWithContext(aws.Context, *chimesdkvoice.GetGlobalSettingsInput, ...request.Option) (*chimesdkvoice.GetGlobalSettingsOutput, error) - GetGlobalSettingsRequest(*chimesdkvoice.GetGlobalSettingsInput) (*request.Request, *chimesdkvoice.GetGlobalSettingsOutput) - - GetPhoneNumber(*chimesdkvoice.GetPhoneNumberInput) (*chimesdkvoice.GetPhoneNumberOutput, error) - GetPhoneNumberWithContext(aws.Context, *chimesdkvoice.GetPhoneNumberInput, ...request.Option) (*chimesdkvoice.GetPhoneNumberOutput, error) - GetPhoneNumberRequest(*chimesdkvoice.GetPhoneNumberInput) (*request.Request, *chimesdkvoice.GetPhoneNumberOutput) - - GetPhoneNumberOrder(*chimesdkvoice.GetPhoneNumberOrderInput) (*chimesdkvoice.GetPhoneNumberOrderOutput, error) - GetPhoneNumberOrderWithContext(aws.Context, *chimesdkvoice.GetPhoneNumberOrderInput, ...request.Option) (*chimesdkvoice.GetPhoneNumberOrderOutput, error) - GetPhoneNumberOrderRequest(*chimesdkvoice.GetPhoneNumberOrderInput) (*request.Request, *chimesdkvoice.GetPhoneNumberOrderOutput) - - GetPhoneNumberSettings(*chimesdkvoice.GetPhoneNumberSettingsInput) (*chimesdkvoice.GetPhoneNumberSettingsOutput, error) - GetPhoneNumberSettingsWithContext(aws.Context, *chimesdkvoice.GetPhoneNumberSettingsInput, ...request.Option) (*chimesdkvoice.GetPhoneNumberSettingsOutput, error) - GetPhoneNumberSettingsRequest(*chimesdkvoice.GetPhoneNumberSettingsInput) (*request.Request, *chimesdkvoice.GetPhoneNumberSettingsOutput) - - GetProxySession(*chimesdkvoice.GetProxySessionInput) (*chimesdkvoice.GetProxySessionOutput, error) - GetProxySessionWithContext(aws.Context, *chimesdkvoice.GetProxySessionInput, ...request.Option) (*chimesdkvoice.GetProxySessionOutput, error) - GetProxySessionRequest(*chimesdkvoice.GetProxySessionInput) (*request.Request, *chimesdkvoice.GetProxySessionOutput) - - GetSipMediaApplication(*chimesdkvoice.GetSipMediaApplicationInput) (*chimesdkvoice.GetSipMediaApplicationOutput, error) - GetSipMediaApplicationWithContext(aws.Context, *chimesdkvoice.GetSipMediaApplicationInput, ...request.Option) (*chimesdkvoice.GetSipMediaApplicationOutput, error) - GetSipMediaApplicationRequest(*chimesdkvoice.GetSipMediaApplicationInput) (*request.Request, *chimesdkvoice.GetSipMediaApplicationOutput) - - GetSipMediaApplicationAlexaSkillConfiguration(*chimesdkvoice.GetSipMediaApplicationAlexaSkillConfigurationInput) (*chimesdkvoice.GetSipMediaApplicationAlexaSkillConfigurationOutput, error) - GetSipMediaApplicationAlexaSkillConfigurationWithContext(aws.Context, *chimesdkvoice.GetSipMediaApplicationAlexaSkillConfigurationInput, ...request.Option) (*chimesdkvoice.GetSipMediaApplicationAlexaSkillConfigurationOutput, error) - GetSipMediaApplicationAlexaSkillConfigurationRequest(*chimesdkvoice.GetSipMediaApplicationAlexaSkillConfigurationInput) (*request.Request, *chimesdkvoice.GetSipMediaApplicationAlexaSkillConfigurationOutput) - - GetSipMediaApplicationLoggingConfiguration(*chimesdkvoice.GetSipMediaApplicationLoggingConfigurationInput) (*chimesdkvoice.GetSipMediaApplicationLoggingConfigurationOutput, error) - GetSipMediaApplicationLoggingConfigurationWithContext(aws.Context, *chimesdkvoice.GetSipMediaApplicationLoggingConfigurationInput, ...request.Option) (*chimesdkvoice.GetSipMediaApplicationLoggingConfigurationOutput, error) - GetSipMediaApplicationLoggingConfigurationRequest(*chimesdkvoice.GetSipMediaApplicationLoggingConfigurationInput) (*request.Request, *chimesdkvoice.GetSipMediaApplicationLoggingConfigurationOutput) - - GetSipRule(*chimesdkvoice.GetSipRuleInput) (*chimesdkvoice.GetSipRuleOutput, error) - GetSipRuleWithContext(aws.Context, *chimesdkvoice.GetSipRuleInput, ...request.Option) (*chimesdkvoice.GetSipRuleOutput, error) - GetSipRuleRequest(*chimesdkvoice.GetSipRuleInput) (*request.Request, *chimesdkvoice.GetSipRuleOutput) - - GetSpeakerSearchTask(*chimesdkvoice.GetSpeakerSearchTaskInput) (*chimesdkvoice.GetSpeakerSearchTaskOutput, error) - GetSpeakerSearchTaskWithContext(aws.Context, *chimesdkvoice.GetSpeakerSearchTaskInput, ...request.Option) (*chimesdkvoice.GetSpeakerSearchTaskOutput, error) - GetSpeakerSearchTaskRequest(*chimesdkvoice.GetSpeakerSearchTaskInput) (*request.Request, *chimesdkvoice.GetSpeakerSearchTaskOutput) - - GetVoiceConnector(*chimesdkvoice.GetVoiceConnectorInput) (*chimesdkvoice.GetVoiceConnectorOutput, error) - GetVoiceConnectorWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorOutput, error) - GetVoiceConnectorRequest(*chimesdkvoice.GetVoiceConnectorInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorOutput) - - GetVoiceConnectorEmergencyCallingConfiguration(*chimesdkvoice.GetVoiceConnectorEmergencyCallingConfigurationInput) (*chimesdkvoice.GetVoiceConnectorEmergencyCallingConfigurationOutput, error) - GetVoiceConnectorEmergencyCallingConfigurationWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorEmergencyCallingConfigurationInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorEmergencyCallingConfigurationOutput, error) - GetVoiceConnectorEmergencyCallingConfigurationRequest(*chimesdkvoice.GetVoiceConnectorEmergencyCallingConfigurationInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorEmergencyCallingConfigurationOutput) - - GetVoiceConnectorGroup(*chimesdkvoice.GetVoiceConnectorGroupInput) (*chimesdkvoice.GetVoiceConnectorGroupOutput, error) - GetVoiceConnectorGroupWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorGroupInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorGroupOutput, error) - GetVoiceConnectorGroupRequest(*chimesdkvoice.GetVoiceConnectorGroupInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorGroupOutput) - - GetVoiceConnectorLoggingConfiguration(*chimesdkvoice.GetVoiceConnectorLoggingConfigurationInput) (*chimesdkvoice.GetVoiceConnectorLoggingConfigurationOutput, error) - GetVoiceConnectorLoggingConfigurationWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorLoggingConfigurationInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorLoggingConfigurationOutput, error) - GetVoiceConnectorLoggingConfigurationRequest(*chimesdkvoice.GetVoiceConnectorLoggingConfigurationInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorLoggingConfigurationOutput) - - GetVoiceConnectorOrigination(*chimesdkvoice.GetVoiceConnectorOriginationInput) (*chimesdkvoice.GetVoiceConnectorOriginationOutput, error) - GetVoiceConnectorOriginationWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorOriginationInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorOriginationOutput, error) - GetVoiceConnectorOriginationRequest(*chimesdkvoice.GetVoiceConnectorOriginationInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorOriginationOutput) - - GetVoiceConnectorProxy(*chimesdkvoice.GetVoiceConnectorProxyInput) (*chimesdkvoice.GetVoiceConnectorProxyOutput, error) - GetVoiceConnectorProxyWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorProxyInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorProxyOutput, error) - GetVoiceConnectorProxyRequest(*chimesdkvoice.GetVoiceConnectorProxyInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorProxyOutput) - - GetVoiceConnectorStreamingConfiguration(*chimesdkvoice.GetVoiceConnectorStreamingConfigurationInput) (*chimesdkvoice.GetVoiceConnectorStreamingConfigurationOutput, error) - GetVoiceConnectorStreamingConfigurationWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorStreamingConfigurationInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorStreamingConfigurationOutput, error) - GetVoiceConnectorStreamingConfigurationRequest(*chimesdkvoice.GetVoiceConnectorStreamingConfigurationInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorStreamingConfigurationOutput) - - GetVoiceConnectorTermination(*chimesdkvoice.GetVoiceConnectorTerminationInput) (*chimesdkvoice.GetVoiceConnectorTerminationOutput, error) - GetVoiceConnectorTerminationWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorTerminationInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorTerminationOutput, error) - GetVoiceConnectorTerminationRequest(*chimesdkvoice.GetVoiceConnectorTerminationInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorTerminationOutput) - - GetVoiceConnectorTerminationHealth(*chimesdkvoice.GetVoiceConnectorTerminationHealthInput) (*chimesdkvoice.GetVoiceConnectorTerminationHealthOutput, error) - GetVoiceConnectorTerminationHealthWithContext(aws.Context, *chimesdkvoice.GetVoiceConnectorTerminationHealthInput, ...request.Option) (*chimesdkvoice.GetVoiceConnectorTerminationHealthOutput, error) - GetVoiceConnectorTerminationHealthRequest(*chimesdkvoice.GetVoiceConnectorTerminationHealthInput) (*request.Request, *chimesdkvoice.GetVoiceConnectorTerminationHealthOutput) - - GetVoiceProfile(*chimesdkvoice.GetVoiceProfileInput) (*chimesdkvoice.GetVoiceProfileOutput, error) - GetVoiceProfileWithContext(aws.Context, *chimesdkvoice.GetVoiceProfileInput, ...request.Option) (*chimesdkvoice.GetVoiceProfileOutput, error) - GetVoiceProfileRequest(*chimesdkvoice.GetVoiceProfileInput) (*request.Request, *chimesdkvoice.GetVoiceProfileOutput) - - GetVoiceProfileDomain(*chimesdkvoice.GetVoiceProfileDomainInput) (*chimesdkvoice.GetVoiceProfileDomainOutput, error) - GetVoiceProfileDomainWithContext(aws.Context, *chimesdkvoice.GetVoiceProfileDomainInput, ...request.Option) (*chimesdkvoice.GetVoiceProfileDomainOutput, error) - GetVoiceProfileDomainRequest(*chimesdkvoice.GetVoiceProfileDomainInput) (*request.Request, *chimesdkvoice.GetVoiceProfileDomainOutput) - - GetVoiceToneAnalysisTask(*chimesdkvoice.GetVoiceToneAnalysisTaskInput) (*chimesdkvoice.GetVoiceToneAnalysisTaskOutput, error) - GetVoiceToneAnalysisTaskWithContext(aws.Context, *chimesdkvoice.GetVoiceToneAnalysisTaskInput, ...request.Option) (*chimesdkvoice.GetVoiceToneAnalysisTaskOutput, error) - GetVoiceToneAnalysisTaskRequest(*chimesdkvoice.GetVoiceToneAnalysisTaskInput) (*request.Request, *chimesdkvoice.GetVoiceToneAnalysisTaskOutput) - - ListAvailableVoiceConnectorRegions(*chimesdkvoice.ListAvailableVoiceConnectorRegionsInput) (*chimesdkvoice.ListAvailableVoiceConnectorRegionsOutput, error) - ListAvailableVoiceConnectorRegionsWithContext(aws.Context, *chimesdkvoice.ListAvailableVoiceConnectorRegionsInput, ...request.Option) (*chimesdkvoice.ListAvailableVoiceConnectorRegionsOutput, error) - ListAvailableVoiceConnectorRegionsRequest(*chimesdkvoice.ListAvailableVoiceConnectorRegionsInput) (*request.Request, *chimesdkvoice.ListAvailableVoiceConnectorRegionsOutput) - - ListPhoneNumberOrders(*chimesdkvoice.ListPhoneNumberOrdersInput) (*chimesdkvoice.ListPhoneNumberOrdersOutput, error) - ListPhoneNumberOrdersWithContext(aws.Context, *chimesdkvoice.ListPhoneNumberOrdersInput, ...request.Option) (*chimesdkvoice.ListPhoneNumberOrdersOutput, error) - ListPhoneNumberOrdersRequest(*chimesdkvoice.ListPhoneNumberOrdersInput) (*request.Request, *chimesdkvoice.ListPhoneNumberOrdersOutput) - - ListPhoneNumberOrdersPages(*chimesdkvoice.ListPhoneNumberOrdersInput, func(*chimesdkvoice.ListPhoneNumberOrdersOutput, bool) bool) error - ListPhoneNumberOrdersPagesWithContext(aws.Context, *chimesdkvoice.ListPhoneNumberOrdersInput, func(*chimesdkvoice.ListPhoneNumberOrdersOutput, bool) bool, ...request.Option) error - - ListPhoneNumbers(*chimesdkvoice.ListPhoneNumbersInput) (*chimesdkvoice.ListPhoneNumbersOutput, error) - ListPhoneNumbersWithContext(aws.Context, *chimesdkvoice.ListPhoneNumbersInput, ...request.Option) (*chimesdkvoice.ListPhoneNumbersOutput, error) - ListPhoneNumbersRequest(*chimesdkvoice.ListPhoneNumbersInput) (*request.Request, *chimesdkvoice.ListPhoneNumbersOutput) - - ListPhoneNumbersPages(*chimesdkvoice.ListPhoneNumbersInput, func(*chimesdkvoice.ListPhoneNumbersOutput, bool) bool) error - ListPhoneNumbersPagesWithContext(aws.Context, *chimesdkvoice.ListPhoneNumbersInput, func(*chimesdkvoice.ListPhoneNumbersOutput, bool) bool, ...request.Option) error - - ListProxySessions(*chimesdkvoice.ListProxySessionsInput) (*chimesdkvoice.ListProxySessionsOutput, error) - ListProxySessionsWithContext(aws.Context, *chimesdkvoice.ListProxySessionsInput, ...request.Option) (*chimesdkvoice.ListProxySessionsOutput, error) - ListProxySessionsRequest(*chimesdkvoice.ListProxySessionsInput) (*request.Request, *chimesdkvoice.ListProxySessionsOutput) - - ListProxySessionsPages(*chimesdkvoice.ListProxySessionsInput, func(*chimesdkvoice.ListProxySessionsOutput, bool) bool) error - ListProxySessionsPagesWithContext(aws.Context, *chimesdkvoice.ListProxySessionsInput, func(*chimesdkvoice.ListProxySessionsOutput, bool) bool, ...request.Option) error - - ListSipMediaApplications(*chimesdkvoice.ListSipMediaApplicationsInput) (*chimesdkvoice.ListSipMediaApplicationsOutput, error) - ListSipMediaApplicationsWithContext(aws.Context, *chimesdkvoice.ListSipMediaApplicationsInput, ...request.Option) (*chimesdkvoice.ListSipMediaApplicationsOutput, error) - ListSipMediaApplicationsRequest(*chimesdkvoice.ListSipMediaApplicationsInput) (*request.Request, *chimesdkvoice.ListSipMediaApplicationsOutput) - - ListSipMediaApplicationsPages(*chimesdkvoice.ListSipMediaApplicationsInput, func(*chimesdkvoice.ListSipMediaApplicationsOutput, bool) bool) error - ListSipMediaApplicationsPagesWithContext(aws.Context, *chimesdkvoice.ListSipMediaApplicationsInput, func(*chimesdkvoice.ListSipMediaApplicationsOutput, bool) bool, ...request.Option) error - - ListSipRules(*chimesdkvoice.ListSipRulesInput) (*chimesdkvoice.ListSipRulesOutput, error) - ListSipRulesWithContext(aws.Context, *chimesdkvoice.ListSipRulesInput, ...request.Option) (*chimesdkvoice.ListSipRulesOutput, error) - ListSipRulesRequest(*chimesdkvoice.ListSipRulesInput) (*request.Request, *chimesdkvoice.ListSipRulesOutput) - - ListSipRulesPages(*chimesdkvoice.ListSipRulesInput, func(*chimesdkvoice.ListSipRulesOutput, bool) bool) error - ListSipRulesPagesWithContext(aws.Context, *chimesdkvoice.ListSipRulesInput, func(*chimesdkvoice.ListSipRulesOutput, bool) bool, ...request.Option) error - - ListSupportedPhoneNumberCountries(*chimesdkvoice.ListSupportedPhoneNumberCountriesInput) (*chimesdkvoice.ListSupportedPhoneNumberCountriesOutput, error) - ListSupportedPhoneNumberCountriesWithContext(aws.Context, *chimesdkvoice.ListSupportedPhoneNumberCountriesInput, ...request.Option) (*chimesdkvoice.ListSupportedPhoneNumberCountriesOutput, error) - ListSupportedPhoneNumberCountriesRequest(*chimesdkvoice.ListSupportedPhoneNumberCountriesInput) (*request.Request, *chimesdkvoice.ListSupportedPhoneNumberCountriesOutput) - - ListTagsForResource(*chimesdkvoice.ListTagsForResourceInput) (*chimesdkvoice.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *chimesdkvoice.ListTagsForResourceInput, ...request.Option) (*chimesdkvoice.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*chimesdkvoice.ListTagsForResourceInput) (*request.Request, *chimesdkvoice.ListTagsForResourceOutput) - - ListVoiceConnectorGroups(*chimesdkvoice.ListVoiceConnectorGroupsInput) (*chimesdkvoice.ListVoiceConnectorGroupsOutput, error) - ListVoiceConnectorGroupsWithContext(aws.Context, *chimesdkvoice.ListVoiceConnectorGroupsInput, ...request.Option) (*chimesdkvoice.ListVoiceConnectorGroupsOutput, error) - ListVoiceConnectorGroupsRequest(*chimesdkvoice.ListVoiceConnectorGroupsInput) (*request.Request, *chimesdkvoice.ListVoiceConnectorGroupsOutput) - - ListVoiceConnectorGroupsPages(*chimesdkvoice.ListVoiceConnectorGroupsInput, func(*chimesdkvoice.ListVoiceConnectorGroupsOutput, bool) bool) error - ListVoiceConnectorGroupsPagesWithContext(aws.Context, *chimesdkvoice.ListVoiceConnectorGroupsInput, func(*chimesdkvoice.ListVoiceConnectorGroupsOutput, bool) bool, ...request.Option) error - - ListVoiceConnectorTerminationCredentials(*chimesdkvoice.ListVoiceConnectorTerminationCredentialsInput) (*chimesdkvoice.ListVoiceConnectorTerminationCredentialsOutput, error) - ListVoiceConnectorTerminationCredentialsWithContext(aws.Context, *chimesdkvoice.ListVoiceConnectorTerminationCredentialsInput, ...request.Option) (*chimesdkvoice.ListVoiceConnectorTerminationCredentialsOutput, error) - ListVoiceConnectorTerminationCredentialsRequest(*chimesdkvoice.ListVoiceConnectorTerminationCredentialsInput) (*request.Request, *chimesdkvoice.ListVoiceConnectorTerminationCredentialsOutput) - - ListVoiceConnectors(*chimesdkvoice.ListVoiceConnectorsInput) (*chimesdkvoice.ListVoiceConnectorsOutput, error) - ListVoiceConnectorsWithContext(aws.Context, *chimesdkvoice.ListVoiceConnectorsInput, ...request.Option) (*chimesdkvoice.ListVoiceConnectorsOutput, error) - ListVoiceConnectorsRequest(*chimesdkvoice.ListVoiceConnectorsInput) (*request.Request, *chimesdkvoice.ListVoiceConnectorsOutput) - - ListVoiceConnectorsPages(*chimesdkvoice.ListVoiceConnectorsInput, func(*chimesdkvoice.ListVoiceConnectorsOutput, bool) bool) error - ListVoiceConnectorsPagesWithContext(aws.Context, *chimesdkvoice.ListVoiceConnectorsInput, func(*chimesdkvoice.ListVoiceConnectorsOutput, bool) bool, ...request.Option) error - - ListVoiceProfileDomains(*chimesdkvoice.ListVoiceProfileDomainsInput) (*chimesdkvoice.ListVoiceProfileDomainsOutput, error) - ListVoiceProfileDomainsWithContext(aws.Context, *chimesdkvoice.ListVoiceProfileDomainsInput, ...request.Option) (*chimesdkvoice.ListVoiceProfileDomainsOutput, error) - ListVoiceProfileDomainsRequest(*chimesdkvoice.ListVoiceProfileDomainsInput) (*request.Request, *chimesdkvoice.ListVoiceProfileDomainsOutput) - - ListVoiceProfileDomainsPages(*chimesdkvoice.ListVoiceProfileDomainsInput, func(*chimesdkvoice.ListVoiceProfileDomainsOutput, bool) bool) error - ListVoiceProfileDomainsPagesWithContext(aws.Context, *chimesdkvoice.ListVoiceProfileDomainsInput, func(*chimesdkvoice.ListVoiceProfileDomainsOutput, bool) bool, ...request.Option) error - - ListVoiceProfiles(*chimesdkvoice.ListVoiceProfilesInput) (*chimesdkvoice.ListVoiceProfilesOutput, error) - ListVoiceProfilesWithContext(aws.Context, *chimesdkvoice.ListVoiceProfilesInput, ...request.Option) (*chimesdkvoice.ListVoiceProfilesOutput, error) - ListVoiceProfilesRequest(*chimesdkvoice.ListVoiceProfilesInput) (*request.Request, *chimesdkvoice.ListVoiceProfilesOutput) - - ListVoiceProfilesPages(*chimesdkvoice.ListVoiceProfilesInput, func(*chimesdkvoice.ListVoiceProfilesOutput, bool) bool) error - ListVoiceProfilesPagesWithContext(aws.Context, *chimesdkvoice.ListVoiceProfilesInput, func(*chimesdkvoice.ListVoiceProfilesOutput, bool) bool, ...request.Option) error - - PutSipMediaApplicationAlexaSkillConfiguration(*chimesdkvoice.PutSipMediaApplicationAlexaSkillConfigurationInput) (*chimesdkvoice.PutSipMediaApplicationAlexaSkillConfigurationOutput, error) - PutSipMediaApplicationAlexaSkillConfigurationWithContext(aws.Context, *chimesdkvoice.PutSipMediaApplicationAlexaSkillConfigurationInput, ...request.Option) (*chimesdkvoice.PutSipMediaApplicationAlexaSkillConfigurationOutput, error) - PutSipMediaApplicationAlexaSkillConfigurationRequest(*chimesdkvoice.PutSipMediaApplicationAlexaSkillConfigurationInput) (*request.Request, *chimesdkvoice.PutSipMediaApplicationAlexaSkillConfigurationOutput) - - PutSipMediaApplicationLoggingConfiguration(*chimesdkvoice.PutSipMediaApplicationLoggingConfigurationInput) (*chimesdkvoice.PutSipMediaApplicationLoggingConfigurationOutput, error) - PutSipMediaApplicationLoggingConfigurationWithContext(aws.Context, *chimesdkvoice.PutSipMediaApplicationLoggingConfigurationInput, ...request.Option) (*chimesdkvoice.PutSipMediaApplicationLoggingConfigurationOutput, error) - PutSipMediaApplicationLoggingConfigurationRequest(*chimesdkvoice.PutSipMediaApplicationLoggingConfigurationInput) (*request.Request, *chimesdkvoice.PutSipMediaApplicationLoggingConfigurationOutput) - - PutVoiceConnectorEmergencyCallingConfiguration(*chimesdkvoice.PutVoiceConnectorEmergencyCallingConfigurationInput) (*chimesdkvoice.PutVoiceConnectorEmergencyCallingConfigurationOutput, error) - PutVoiceConnectorEmergencyCallingConfigurationWithContext(aws.Context, *chimesdkvoice.PutVoiceConnectorEmergencyCallingConfigurationInput, ...request.Option) (*chimesdkvoice.PutVoiceConnectorEmergencyCallingConfigurationOutput, error) - PutVoiceConnectorEmergencyCallingConfigurationRequest(*chimesdkvoice.PutVoiceConnectorEmergencyCallingConfigurationInput) (*request.Request, *chimesdkvoice.PutVoiceConnectorEmergencyCallingConfigurationOutput) - - PutVoiceConnectorLoggingConfiguration(*chimesdkvoice.PutVoiceConnectorLoggingConfigurationInput) (*chimesdkvoice.PutVoiceConnectorLoggingConfigurationOutput, error) - PutVoiceConnectorLoggingConfigurationWithContext(aws.Context, *chimesdkvoice.PutVoiceConnectorLoggingConfigurationInput, ...request.Option) (*chimesdkvoice.PutVoiceConnectorLoggingConfigurationOutput, error) - PutVoiceConnectorLoggingConfigurationRequest(*chimesdkvoice.PutVoiceConnectorLoggingConfigurationInput) (*request.Request, *chimesdkvoice.PutVoiceConnectorLoggingConfigurationOutput) - - PutVoiceConnectorOrigination(*chimesdkvoice.PutVoiceConnectorOriginationInput) (*chimesdkvoice.PutVoiceConnectorOriginationOutput, error) - PutVoiceConnectorOriginationWithContext(aws.Context, *chimesdkvoice.PutVoiceConnectorOriginationInput, ...request.Option) (*chimesdkvoice.PutVoiceConnectorOriginationOutput, error) - PutVoiceConnectorOriginationRequest(*chimesdkvoice.PutVoiceConnectorOriginationInput) (*request.Request, *chimesdkvoice.PutVoiceConnectorOriginationOutput) - - PutVoiceConnectorProxy(*chimesdkvoice.PutVoiceConnectorProxyInput) (*chimesdkvoice.PutVoiceConnectorProxyOutput, error) - PutVoiceConnectorProxyWithContext(aws.Context, *chimesdkvoice.PutVoiceConnectorProxyInput, ...request.Option) (*chimesdkvoice.PutVoiceConnectorProxyOutput, error) - PutVoiceConnectorProxyRequest(*chimesdkvoice.PutVoiceConnectorProxyInput) (*request.Request, *chimesdkvoice.PutVoiceConnectorProxyOutput) - - PutVoiceConnectorStreamingConfiguration(*chimesdkvoice.PutVoiceConnectorStreamingConfigurationInput) (*chimesdkvoice.PutVoiceConnectorStreamingConfigurationOutput, error) - PutVoiceConnectorStreamingConfigurationWithContext(aws.Context, *chimesdkvoice.PutVoiceConnectorStreamingConfigurationInput, ...request.Option) (*chimesdkvoice.PutVoiceConnectorStreamingConfigurationOutput, error) - PutVoiceConnectorStreamingConfigurationRequest(*chimesdkvoice.PutVoiceConnectorStreamingConfigurationInput) (*request.Request, *chimesdkvoice.PutVoiceConnectorStreamingConfigurationOutput) - - PutVoiceConnectorTermination(*chimesdkvoice.PutVoiceConnectorTerminationInput) (*chimesdkvoice.PutVoiceConnectorTerminationOutput, error) - PutVoiceConnectorTerminationWithContext(aws.Context, *chimesdkvoice.PutVoiceConnectorTerminationInput, ...request.Option) (*chimesdkvoice.PutVoiceConnectorTerminationOutput, error) - PutVoiceConnectorTerminationRequest(*chimesdkvoice.PutVoiceConnectorTerminationInput) (*request.Request, *chimesdkvoice.PutVoiceConnectorTerminationOutput) - - PutVoiceConnectorTerminationCredentials(*chimesdkvoice.PutVoiceConnectorTerminationCredentialsInput) (*chimesdkvoice.PutVoiceConnectorTerminationCredentialsOutput, error) - PutVoiceConnectorTerminationCredentialsWithContext(aws.Context, *chimesdkvoice.PutVoiceConnectorTerminationCredentialsInput, ...request.Option) (*chimesdkvoice.PutVoiceConnectorTerminationCredentialsOutput, error) - PutVoiceConnectorTerminationCredentialsRequest(*chimesdkvoice.PutVoiceConnectorTerminationCredentialsInput) (*request.Request, *chimesdkvoice.PutVoiceConnectorTerminationCredentialsOutput) - - RestorePhoneNumber(*chimesdkvoice.RestorePhoneNumberInput) (*chimesdkvoice.RestorePhoneNumberOutput, error) - RestorePhoneNumberWithContext(aws.Context, *chimesdkvoice.RestorePhoneNumberInput, ...request.Option) (*chimesdkvoice.RestorePhoneNumberOutput, error) - RestorePhoneNumberRequest(*chimesdkvoice.RestorePhoneNumberInput) (*request.Request, *chimesdkvoice.RestorePhoneNumberOutput) - - SearchAvailablePhoneNumbers(*chimesdkvoice.SearchAvailablePhoneNumbersInput) (*chimesdkvoice.SearchAvailablePhoneNumbersOutput, error) - SearchAvailablePhoneNumbersWithContext(aws.Context, *chimesdkvoice.SearchAvailablePhoneNumbersInput, ...request.Option) (*chimesdkvoice.SearchAvailablePhoneNumbersOutput, error) - SearchAvailablePhoneNumbersRequest(*chimesdkvoice.SearchAvailablePhoneNumbersInput) (*request.Request, *chimesdkvoice.SearchAvailablePhoneNumbersOutput) - - SearchAvailablePhoneNumbersPages(*chimesdkvoice.SearchAvailablePhoneNumbersInput, func(*chimesdkvoice.SearchAvailablePhoneNumbersOutput, bool) bool) error - SearchAvailablePhoneNumbersPagesWithContext(aws.Context, *chimesdkvoice.SearchAvailablePhoneNumbersInput, func(*chimesdkvoice.SearchAvailablePhoneNumbersOutput, bool) bool, ...request.Option) error - - StartSpeakerSearchTask(*chimesdkvoice.StartSpeakerSearchTaskInput) (*chimesdkvoice.StartSpeakerSearchTaskOutput, error) - StartSpeakerSearchTaskWithContext(aws.Context, *chimesdkvoice.StartSpeakerSearchTaskInput, ...request.Option) (*chimesdkvoice.StartSpeakerSearchTaskOutput, error) - StartSpeakerSearchTaskRequest(*chimesdkvoice.StartSpeakerSearchTaskInput) (*request.Request, *chimesdkvoice.StartSpeakerSearchTaskOutput) - - StartVoiceToneAnalysisTask(*chimesdkvoice.StartVoiceToneAnalysisTaskInput) (*chimesdkvoice.StartVoiceToneAnalysisTaskOutput, error) - StartVoiceToneAnalysisTaskWithContext(aws.Context, *chimesdkvoice.StartVoiceToneAnalysisTaskInput, ...request.Option) (*chimesdkvoice.StartVoiceToneAnalysisTaskOutput, error) - StartVoiceToneAnalysisTaskRequest(*chimesdkvoice.StartVoiceToneAnalysisTaskInput) (*request.Request, *chimesdkvoice.StartVoiceToneAnalysisTaskOutput) - - StopSpeakerSearchTask(*chimesdkvoice.StopSpeakerSearchTaskInput) (*chimesdkvoice.StopSpeakerSearchTaskOutput, error) - StopSpeakerSearchTaskWithContext(aws.Context, *chimesdkvoice.StopSpeakerSearchTaskInput, ...request.Option) (*chimesdkvoice.StopSpeakerSearchTaskOutput, error) - StopSpeakerSearchTaskRequest(*chimesdkvoice.StopSpeakerSearchTaskInput) (*request.Request, *chimesdkvoice.StopSpeakerSearchTaskOutput) - - StopVoiceToneAnalysisTask(*chimesdkvoice.StopVoiceToneAnalysisTaskInput) (*chimesdkvoice.StopVoiceToneAnalysisTaskOutput, error) - StopVoiceToneAnalysisTaskWithContext(aws.Context, *chimesdkvoice.StopVoiceToneAnalysisTaskInput, ...request.Option) (*chimesdkvoice.StopVoiceToneAnalysisTaskOutput, error) - StopVoiceToneAnalysisTaskRequest(*chimesdkvoice.StopVoiceToneAnalysisTaskInput) (*request.Request, *chimesdkvoice.StopVoiceToneAnalysisTaskOutput) - - TagResource(*chimesdkvoice.TagResourceInput) (*chimesdkvoice.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *chimesdkvoice.TagResourceInput, ...request.Option) (*chimesdkvoice.TagResourceOutput, error) - TagResourceRequest(*chimesdkvoice.TagResourceInput) (*request.Request, *chimesdkvoice.TagResourceOutput) - - UntagResource(*chimesdkvoice.UntagResourceInput) (*chimesdkvoice.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *chimesdkvoice.UntagResourceInput, ...request.Option) (*chimesdkvoice.UntagResourceOutput, error) - UntagResourceRequest(*chimesdkvoice.UntagResourceInput) (*request.Request, *chimesdkvoice.UntagResourceOutput) - - UpdateGlobalSettings(*chimesdkvoice.UpdateGlobalSettingsInput) (*chimesdkvoice.UpdateGlobalSettingsOutput, error) - UpdateGlobalSettingsWithContext(aws.Context, *chimesdkvoice.UpdateGlobalSettingsInput, ...request.Option) (*chimesdkvoice.UpdateGlobalSettingsOutput, error) - UpdateGlobalSettingsRequest(*chimesdkvoice.UpdateGlobalSettingsInput) (*request.Request, *chimesdkvoice.UpdateGlobalSettingsOutput) - - UpdatePhoneNumber(*chimesdkvoice.UpdatePhoneNumberInput) (*chimesdkvoice.UpdatePhoneNumberOutput, error) - UpdatePhoneNumberWithContext(aws.Context, *chimesdkvoice.UpdatePhoneNumberInput, ...request.Option) (*chimesdkvoice.UpdatePhoneNumberOutput, error) - UpdatePhoneNumberRequest(*chimesdkvoice.UpdatePhoneNumberInput) (*request.Request, *chimesdkvoice.UpdatePhoneNumberOutput) - - UpdatePhoneNumberSettings(*chimesdkvoice.UpdatePhoneNumberSettingsInput) (*chimesdkvoice.UpdatePhoneNumberSettingsOutput, error) - UpdatePhoneNumberSettingsWithContext(aws.Context, *chimesdkvoice.UpdatePhoneNumberSettingsInput, ...request.Option) (*chimesdkvoice.UpdatePhoneNumberSettingsOutput, error) - UpdatePhoneNumberSettingsRequest(*chimesdkvoice.UpdatePhoneNumberSettingsInput) (*request.Request, *chimesdkvoice.UpdatePhoneNumberSettingsOutput) - - UpdateProxySession(*chimesdkvoice.UpdateProxySessionInput) (*chimesdkvoice.UpdateProxySessionOutput, error) - UpdateProxySessionWithContext(aws.Context, *chimesdkvoice.UpdateProxySessionInput, ...request.Option) (*chimesdkvoice.UpdateProxySessionOutput, error) - UpdateProxySessionRequest(*chimesdkvoice.UpdateProxySessionInput) (*request.Request, *chimesdkvoice.UpdateProxySessionOutput) - - UpdateSipMediaApplication(*chimesdkvoice.UpdateSipMediaApplicationInput) (*chimesdkvoice.UpdateSipMediaApplicationOutput, error) - UpdateSipMediaApplicationWithContext(aws.Context, *chimesdkvoice.UpdateSipMediaApplicationInput, ...request.Option) (*chimesdkvoice.UpdateSipMediaApplicationOutput, error) - UpdateSipMediaApplicationRequest(*chimesdkvoice.UpdateSipMediaApplicationInput) (*request.Request, *chimesdkvoice.UpdateSipMediaApplicationOutput) - - UpdateSipMediaApplicationCall(*chimesdkvoice.UpdateSipMediaApplicationCallInput) (*chimesdkvoice.UpdateSipMediaApplicationCallOutput, error) - UpdateSipMediaApplicationCallWithContext(aws.Context, *chimesdkvoice.UpdateSipMediaApplicationCallInput, ...request.Option) (*chimesdkvoice.UpdateSipMediaApplicationCallOutput, error) - UpdateSipMediaApplicationCallRequest(*chimesdkvoice.UpdateSipMediaApplicationCallInput) (*request.Request, *chimesdkvoice.UpdateSipMediaApplicationCallOutput) - - UpdateSipRule(*chimesdkvoice.UpdateSipRuleInput) (*chimesdkvoice.UpdateSipRuleOutput, error) - UpdateSipRuleWithContext(aws.Context, *chimesdkvoice.UpdateSipRuleInput, ...request.Option) (*chimesdkvoice.UpdateSipRuleOutput, error) - UpdateSipRuleRequest(*chimesdkvoice.UpdateSipRuleInput) (*request.Request, *chimesdkvoice.UpdateSipRuleOutput) - - UpdateVoiceConnector(*chimesdkvoice.UpdateVoiceConnectorInput) (*chimesdkvoice.UpdateVoiceConnectorOutput, error) - UpdateVoiceConnectorWithContext(aws.Context, *chimesdkvoice.UpdateVoiceConnectorInput, ...request.Option) (*chimesdkvoice.UpdateVoiceConnectorOutput, error) - UpdateVoiceConnectorRequest(*chimesdkvoice.UpdateVoiceConnectorInput) (*request.Request, *chimesdkvoice.UpdateVoiceConnectorOutput) - - UpdateVoiceConnectorGroup(*chimesdkvoice.UpdateVoiceConnectorGroupInput) (*chimesdkvoice.UpdateVoiceConnectorGroupOutput, error) - UpdateVoiceConnectorGroupWithContext(aws.Context, *chimesdkvoice.UpdateVoiceConnectorGroupInput, ...request.Option) (*chimesdkvoice.UpdateVoiceConnectorGroupOutput, error) - UpdateVoiceConnectorGroupRequest(*chimesdkvoice.UpdateVoiceConnectorGroupInput) (*request.Request, *chimesdkvoice.UpdateVoiceConnectorGroupOutput) - - UpdateVoiceProfile(*chimesdkvoice.UpdateVoiceProfileInput) (*chimesdkvoice.UpdateVoiceProfileOutput, error) - UpdateVoiceProfileWithContext(aws.Context, *chimesdkvoice.UpdateVoiceProfileInput, ...request.Option) (*chimesdkvoice.UpdateVoiceProfileOutput, error) - UpdateVoiceProfileRequest(*chimesdkvoice.UpdateVoiceProfileInput) (*request.Request, *chimesdkvoice.UpdateVoiceProfileOutput) - - UpdateVoiceProfileDomain(*chimesdkvoice.UpdateVoiceProfileDomainInput) (*chimesdkvoice.UpdateVoiceProfileDomainOutput, error) - UpdateVoiceProfileDomainWithContext(aws.Context, *chimesdkvoice.UpdateVoiceProfileDomainInput, ...request.Option) (*chimesdkvoice.UpdateVoiceProfileDomainOutput, error) - UpdateVoiceProfileDomainRequest(*chimesdkvoice.UpdateVoiceProfileDomainInput) (*request.Request, *chimesdkvoice.UpdateVoiceProfileDomainOutput) - - ValidateE911Address(*chimesdkvoice.ValidateE911AddressInput) (*chimesdkvoice.ValidateE911AddressOutput, error) - ValidateE911AddressWithContext(aws.Context, *chimesdkvoice.ValidateE911AddressInput, ...request.Option) (*chimesdkvoice.ValidateE911AddressOutput, error) - ValidateE911AddressRequest(*chimesdkvoice.ValidateE911AddressInput) (*request.Request, *chimesdkvoice.ValidateE911AddressOutput) -} - -var _ ChimeSDKVoiceAPI = (*chimesdkvoice.ChimeSDKVoice)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/doc.go deleted file mode 100644 index a2f38b1592d3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package chimesdkvoice provides the client and types for making API -// requests to Amazon Chime SDK Voice. -// -// The Amazon Chime SDK telephony APIs in this section enable developers to -// create PSTN calling solutions that use Amazon Chime SDK Voice Connectors, -// and Amazon Chime SDK SIP media applications. Developers can also order and -// manage phone numbers, create and manage Voice Connectors and SIP media applications, -// and run voice analytics. -// -// See https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03 for more information on this service. -// -// See chimesdkvoice package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/chimesdkvoice/ -// -// # Using the Client -// -// To contact Amazon Chime SDK Voice with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Chime SDK Voice client ChimeSDKVoice for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/chimesdkvoice/#New -package chimesdkvoice diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/errors.go deleted file mode 100644 index de88ea7ed285..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/errors.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package chimesdkvoice - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have the permissions needed to run this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeBadRequestException for service response error code - // "BadRequestException". - // - // The input parameters don't match the service's restrictions. - ErrCodeBadRequestException = "BadRequestException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Multiple instances of the same request were made simultaneously. - ErrCodeConflictException = "ConflictException" - - // ErrCodeForbiddenException for service response error code - // "ForbiddenException". - // - // The client is permanently forbidden from making the request. - ErrCodeForbiddenException = "ForbiddenException" - - // ErrCodeGoneException for service response error code - // "GoneException". - // - // Access to the target resource is no longer available at the origin server. - // This condition is likely to be permanent. - ErrCodeGoneException = "GoneException" - - // ErrCodeNotFoundException for service response error code - // "NotFoundException". - // - // The requested resource couldn't be found. - ErrCodeNotFoundException = "NotFoundException" - - // ErrCodeResourceLimitExceededException for service response error code - // "ResourceLimitExceededException". - // - // The request exceeds the resource limit. - ErrCodeResourceLimitExceededException = "ResourceLimitExceededException" - - // ErrCodeServiceFailureException for service response error code - // "ServiceFailureException". - // - // The service encountered an unexpected error. - ErrCodeServiceFailureException = "ServiceFailureException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - // - // The service is currently unavailable. - ErrCodeServiceUnavailableException = "ServiceUnavailableException" - - // ErrCodeThrottledClientException for service response error code - // "ThrottledClientException". - // - // The number of customer requests exceeds the request rate limit. - ErrCodeThrottledClientException = "ThrottledClientException" - - // ErrCodeUnauthorizedClientException for service response error code - // "UnauthorizedClientException". - // - // The client isn't authorized to request a resource. - ErrCodeUnauthorizedClientException = "UnauthorizedClientException" - - // ErrCodeUnprocessableEntityException for service response error code - // "UnprocessableEntityException". - // - // A well-formed request couldn't be followed due to semantic errors. - ErrCodeUnprocessableEntityException = "UnprocessableEntityException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "BadRequestException": newErrorBadRequestException, - "ConflictException": newErrorConflictException, - "ForbiddenException": newErrorForbiddenException, - "GoneException": newErrorGoneException, - "NotFoundException": newErrorNotFoundException, - "ResourceLimitExceededException": newErrorResourceLimitExceededException, - "ServiceFailureException": newErrorServiceFailureException, - "ServiceUnavailableException": newErrorServiceUnavailableException, - "ThrottledClientException": newErrorThrottledClientException, - "UnauthorizedClientException": newErrorUnauthorizedClientException, - "UnprocessableEntityException": newErrorUnprocessableEntityException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/service.go deleted file mode 100644 index 4a30f484f787..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/chimesdkvoice/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package chimesdkvoice - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// ChimeSDKVoice provides the API operation methods for making requests to -// Amazon Chime SDK Voice. See this package's package overview docs -// for details on the service. -// -// ChimeSDKVoice methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ChimeSDKVoice struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Chime SDK Voice" // Name of service. - EndpointsID = "voice-chime" // ID to lookup a service endpoint with. - ServiceID = "Chime SDK Voice" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the ChimeSDKVoice client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a ChimeSDKVoice client from just a session. -// svc := chimesdkvoice.New(mySession) -// -// // Create a ChimeSDKVoice client with additional configuration -// svc := chimesdkvoice.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ChimeSDKVoice { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "chime" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ChimeSDKVoice { - svc := &ChimeSDKVoice{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-08-03", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ChimeSDKVoice operation and runs any -// custom request initialization. -func (c *ChimeSDKVoice) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/api.go deleted file mode 100644 index 4ca456bae6a7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/api.go +++ /dev/null @@ -1,15161 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cleanrooms - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opBatchGetCollaborationAnalysisTemplate = "BatchGetCollaborationAnalysisTemplate" - -// BatchGetCollaborationAnalysisTemplateRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetCollaborationAnalysisTemplate 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 BatchGetCollaborationAnalysisTemplate for more information on using the BatchGetCollaborationAnalysisTemplate -// 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 BatchGetCollaborationAnalysisTemplateRequest method. -// req, resp := client.BatchGetCollaborationAnalysisTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/BatchGetCollaborationAnalysisTemplate -func (c *CleanRooms) BatchGetCollaborationAnalysisTemplateRequest(input *BatchGetCollaborationAnalysisTemplateInput) (req *request.Request, output *BatchGetCollaborationAnalysisTemplateOutput) { - op := &request.Operation{ - Name: opBatchGetCollaborationAnalysisTemplate, - HTTPMethod: "POST", - HTTPPath: "/collaborations/{collaborationIdentifier}/batch-analysistemplates", - } - - if input == nil { - input = &BatchGetCollaborationAnalysisTemplateInput{} - } - - output = &BatchGetCollaborationAnalysisTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetCollaborationAnalysisTemplate API operation for AWS Clean Rooms Service. -// -// Retrieves multiple analysis templates within a collaboration by their Amazon -// Resource Names (ARNs). -// -// 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 AWS Clean Rooms Service's -// API operation BatchGetCollaborationAnalysisTemplate for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/BatchGetCollaborationAnalysisTemplate -func (c *CleanRooms) BatchGetCollaborationAnalysisTemplate(input *BatchGetCollaborationAnalysisTemplateInput) (*BatchGetCollaborationAnalysisTemplateOutput, error) { - req, out := c.BatchGetCollaborationAnalysisTemplateRequest(input) - return out, req.Send() -} - -// BatchGetCollaborationAnalysisTemplateWithContext is the same as BatchGetCollaborationAnalysisTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetCollaborationAnalysisTemplate 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 *CleanRooms) BatchGetCollaborationAnalysisTemplateWithContext(ctx aws.Context, input *BatchGetCollaborationAnalysisTemplateInput, opts ...request.Option) (*BatchGetCollaborationAnalysisTemplateOutput, error) { - req, out := c.BatchGetCollaborationAnalysisTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchGetSchema = "BatchGetSchema" - -// BatchGetSchemaRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetSchema 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 BatchGetSchema for more information on using the BatchGetSchema -// 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 BatchGetSchemaRequest method. -// req, resp := client.BatchGetSchemaRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/BatchGetSchema -func (c *CleanRooms) BatchGetSchemaRequest(input *BatchGetSchemaInput) (req *request.Request, output *BatchGetSchemaOutput) { - op := &request.Operation{ - Name: opBatchGetSchema, - HTTPMethod: "POST", - HTTPPath: "/collaborations/{collaborationIdentifier}/batch-schema", - } - - if input == nil { - input = &BatchGetSchemaInput{} - } - - output = &BatchGetSchemaOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetSchema API operation for AWS Clean Rooms Service. -// -// Retrieves multiple schemas by their identifiers. -// -// 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 AWS Clean Rooms Service's -// API operation BatchGetSchema for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/BatchGetSchema -func (c *CleanRooms) BatchGetSchema(input *BatchGetSchemaInput) (*BatchGetSchemaOutput, error) { - req, out := c.BatchGetSchemaRequest(input) - return out, req.Send() -} - -// BatchGetSchemaWithContext is the same as BatchGetSchema with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetSchema 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 *CleanRooms) BatchGetSchemaWithContext(ctx aws.Context, input *BatchGetSchemaInput, opts ...request.Option) (*BatchGetSchemaOutput, error) { - req, out := c.BatchGetSchemaRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAnalysisTemplate = "CreateAnalysisTemplate" - -// CreateAnalysisTemplateRequest generates a "aws/request.Request" representing the -// client's request for the CreateAnalysisTemplate 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 CreateAnalysisTemplate for more information on using the CreateAnalysisTemplate -// 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 CreateAnalysisTemplateRequest method. -// req, resp := client.CreateAnalysisTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateAnalysisTemplate -func (c *CleanRooms) CreateAnalysisTemplateRequest(input *CreateAnalysisTemplateInput) (req *request.Request, output *CreateAnalysisTemplateOutput) { - op := &request.Operation{ - Name: opCreateAnalysisTemplate, - HTTPMethod: "POST", - HTTPPath: "/memberships/{membershipIdentifier}/analysistemplates", - } - - if input == nil { - input = &CreateAnalysisTemplateInput{} - } - - output = &CreateAnalysisTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAnalysisTemplate API operation for AWS Clean Rooms Service. -// -// Creates a new analysis template. -// -// 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 AWS Clean Rooms Service's -// API operation CreateAnalysisTemplate for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// Request denied because service quota has been exceeded. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateAnalysisTemplate -func (c *CleanRooms) CreateAnalysisTemplate(input *CreateAnalysisTemplateInput) (*CreateAnalysisTemplateOutput, error) { - req, out := c.CreateAnalysisTemplateRequest(input) - return out, req.Send() -} - -// CreateAnalysisTemplateWithContext is the same as CreateAnalysisTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAnalysisTemplate 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 *CleanRooms) CreateAnalysisTemplateWithContext(ctx aws.Context, input *CreateAnalysisTemplateInput, opts ...request.Option) (*CreateAnalysisTemplateOutput, error) { - req, out := c.CreateAnalysisTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateCollaboration = "CreateCollaboration" - -// CreateCollaborationRequest generates a "aws/request.Request" representing the -// client's request for the CreateCollaboration 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 CreateCollaboration for more information on using the CreateCollaboration -// 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 CreateCollaborationRequest method. -// req, resp := client.CreateCollaborationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateCollaboration -func (c *CleanRooms) CreateCollaborationRequest(input *CreateCollaborationInput) (req *request.Request, output *CreateCollaborationOutput) { - op := &request.Operation{ - Name: opCreateCollaboration, - HTTPMethod: "POST", - HTTPPath: "/collaborations", - } - - if input == nil { - input = &CreateCollaborationInput{} - } - - output = &CreateCollaborationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCollaboration API operation for AWS Clean Rooms Service. -// -// Creates a new collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation CreateCollaboration for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// Request denied because service quota has been exceeded. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateCollaboration -func (c *CleanRooms) CreateCollaboration(input *CreateCollaborationInput) (*CreateCollaborationOutput, error) { - req, out := c.CreateCollaborationRequest(input) - return out, req.Send() -} - -// CreateCollaborationWithContext is the same as CreateCollaboration with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCollaboration 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 *CleanRooms) CreateCollaborationWithContext(ctx aws.Context, input *CreateCollaborationInput, opts ...request.Option) (*CreateCollaborationOutput, error) { - req, out := c.CreateCollaborationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateConfiguredTable = "CreateConfiguredTable" - -// CreateConfiguredTableRequest generates a "aws/request.Request" representing the -// client's request for the CreateConfiguredTable 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 CreateConfiguredTable for more information on using the CreateConfiguredTable -// 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 CreateConfiguredTableRequest method. -// req, resp := client.CreateConfiguredTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateConfiguredTable -func (c *CleanRooms) CreateConfiguredTableRequest(input *CreateConfiguredTableInput) (req *request.Request, output *CreateConfiguredTableOutput) { - op := &request.Operation{ - Name: opCreateConfiguredTable, - HTTPMethod: "POST", - HTTPPath: "/configuredTables", - } - - if input == nil { - input = &CreateConfiguredTableInput{} - } - - output = &CreateConfiguredTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateConfiguredTable API operation for AWS Clean Rooms Service. -// -// Creates a new configured table resource. -// -// 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 AWS Clean Rooms Service's -// API operation CreateConfiguredTable for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// Request denied because service quota has been exceeded. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateConfiguredTable -func (c *CleanRooms) CreateConfiguredTable(input *CreateConfiguredTableInput) (*CreateConfiguredTableOutput, error) { - req, out := c.CreateConfiguredTableRequest(input) - return out, req.Send() -} - -// CreateConfiguredTableWithContext is the same as CreateConfiguredTable with the addition of -// the ability to pass a context and additional request options. -// -// See CreateConfiguredTable 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 *CleanRooms) CreateConfiguredTableWithContext(ctx aws.Context, input *CreateConfiguredTableInput, opts ...request.Option) (*CreateConfiguredTableOutput, error) { - req, out := c.CreateConfiguredTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateConfiguredTableAnalysisRule = "CreateConfiguredTableAnalysisRule" - -// CreateConfiguredTableAnalysisRuleRequest generates a "aws/request.Request" representing the -// client's request for the CreateConfiguredTableAnalysisRule 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 CreateConfiguredTableAnalysisRule for more information on using the CreateConfiguredTableAnalysisRule -// 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 CreateConfiguredTableAnalysisRuleRequest method. -// req, resp := client.CreateConfiguredTableAnalysisRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateConfiguredTableAnalysisRule -func (c *CleanRooms) CreateConfiguredTableAnalysisRuleRequest(input *CreateConfiguredTableAnalysisRuleInput) (req *request.Request, output *CreateConfiguredTableAnalysisRuleOutput) { - op := &request.Operation{ - Name: opCreateConfiguredTableAnalysisRule, - HTTPMethod: "POST", - HTTPPath: "/configuredTables/{configuredTableIdentifier}/analysisRule", - } - - if input == nil { - input = &CreateConfiguredTableAnalysisRuleInput{} - } - - output = &CreateConfiguredTableAnalysisRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateConfiguredTableAnalysisRule API operation for AWS Clean Rooms Service. -// -// Creates a new analysis rule for a configured table. Currently, only one analysis -// rule can be created for a given configured table. -// -// 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 AWS Clean Rooms Service's -// API operation CreateConfiguredTableAnalysisRule for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateConfiguredTableAnalysisRule -func (c *CleanRooms) CreateConfiguredTableAnalysisRule(input *CreateConfiguredTableAnalysisRuleInput) (*CreateConfiguredTableAnalysisRuleOutput, error) { - req, out := c.CreateConfiguredTableAnalysisRuleRequest(input) - return out, req.Send() -} - -// CreateConfiguredTableAnalysisRuleWithContext is the same as CreateConfiguredTableAnalysisRule with the addition of -// the ability to pass a context and additional request options. -// -// See CreateConfiguredTableAnalysisRule 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 *CleanRooms) CreateConfiguredTableAnalysisRuleWithContext(ctx aws.Context, input *CreateConfiguredTableAnalysisRuleInput, opts ...request.Option) (*CreateConfiguredTableAnalysisRuleOutput, error) { - req, out := c.CreateConfiguredTableAnalysisRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateConfiguredTableAssociation = "CreateConfiguredTableAssociation" - -// CreateConfiguredTableAssociationRequest generates a "aws/request.Request" representing the -// client's request for the CreateConfiguredTableAssociation 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 CreateConfiguredTableAssociation for more information on using the CreateConfiguredTableAssociation -// 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 CreateConfiguredTableAssociationRequest method. -// req, resp := client.CreateConfiguredTableAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateConfiguredTableAssociation -func (c *CleanRooms) CreateConfiguredTableAssociationRequest(input *CreateConfiguredTableAssociationInput) (req *request.Request, output *CreateConfiguredTableAssociationOutput) { - op := &request.Operation{ - Name: opCreateConfiguredTableAssociation, - HTTPMethod: "POST", - HTTPPath: "/memberships/{membershipIdentifier}/configuredTableAssociations", - } - - if input == nil { - input = &CreateConfiguredTableAssociationInput{} - } - - output = &CreateConfiguredTableAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateConfiguredTableAssociation API operation for AWS Clean Rooms Service. -// -// Creates a configured table association. A configured table association links -// a configured table with a collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation CreateConfiguredTableAssociation for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// Request denied because service quota has been exceeded. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateConfiguredTableAssociation -func (c *CleanRooms) CreateConfiguredTableAssociation(input *CreateConfiguredTableAssociationInput) (*CreateConfiguredTableAssociationOutput, error) { - req, out := c.CreateConfiguredTableAssociationRequest(input) - return out, req.Send() -} - -// CreateConfiguredTableAssociationWithContext is the same as CreateConfiguredTableAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See CreateConfiguredTableAssociation 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 *CleanRooms) CreateConfiguredTableAssociationWithContext(ctx aws.Context, input *CreateConfiguredTableAssociationInput, opts ...request.Option) (*CreateConfiguredTableAssociationOutput, error) { - req, out := c.CreateConfiguredTableAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateMembership = "CreateMembership" - -// CreateMembershipRequest generates a "aws/request.Request" representing the -// client's request for the CreateMembership 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 CreateMembership for more information on using the CreateMembership -// 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 CreateMembershipRequest method. -// req, resp := client.CreateMembershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateMembership -func (c *CleanRooms) CreateMembershipRequest(input *CreateMembershipInput) (req *request.Request, output *CreateMembershipOutput) { - op := &request.Operation{ - Name: opCreateMembership, - HTTPMethod: "POST", - HTTPPath: "/memberships", - } - - if input == nil { - input = &CreateMembershipInput{} - } - - output = &CreateMembershipOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateMembership API operation for AWS Clean Rooms Service. -// -// Creates a membership for a specific collaboration identifier and joins the -// collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation CreateMembership for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// Request denied because service quota has been exceeded. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/CreateMembership -func (c *CleanRooms) CreateMembership(input *CreateMembershipInput) (*CreateMembershipOutput, error) { - req, out := c.CreateMembershipRequest(input) - return out, req.Send() -} - -// CreateMembershipWithContext is the same as CreateMembership with the addition of -// the ability to pass a context and additional request options. -// -// See CreateMembership 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 *CleanRooms) CreateMembershipWithContext(ctx aws.Context, input *CreateMembershipInput, opts ...request.Option) (*CreateMembershipOutput, error) { - req, out := c.CreateMembershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAnalysisTemplate = "DeleteAnalysisTemplate" - -// DeleteAnalysisTemplateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAnalysisTemplate 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 DeleteAnalysisTemplate for more information on using the DeleteAnalysisTemplate -// 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 DeleteAnalysisTemplateRequest method. -// req, resp := client.DeleteAnalysisTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteAnalysisTemplate -func (c *CleanRooms) DeleteAnalysisTemplateRequest(input *DeleteAnalysisTemplateInput) (req *request.Request, output *DeleteAnalysisTemplateOutput) { - op := &request.Operation{ - Name: opDeleteAnalysisTemplate, - HTTPMethod: "DELETE", - HTTPPath: "/memberships/{membershipIdentifier}/analysistemplates/{analysisTemplateIdentifier}", - } - - if input == nil { - input = &DeleteAnalysisTemplateInput{} - } - - output = &DeleteAnalysisTemplateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAnalysisTemplate API operation for AWS Clean Rooms Service. -// -// Deletes an analysis template. -// -// 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 AWS Clean Rooms Service's -// API operation DeleteAnalysisTemplate for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteAnalysisTemplate -func (c *CleanRooms) DeleteAnalysisTemplate(input *DeleteAnalysisTemplateInput) (*DeleteAnalysisTemplateOutput, error) { - req, out := c.DeleteAnalysisTemplateRequest(input) - return out, req.Send() -} - -// DeleteAnalysisTemplateWithContext is the same as DeleteAnalysisTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAnalysisTemplate 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 *CleanRooms) DeleteAnalysisTemplateWithContext(ctx aws.Context, input *DeleteAnalysisTemplateInput, opts ...request.Option) (*DeleteAnalysisTemplateOutput, error) { - req, out := c.DeleteAnalysisTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCollaboration = "DeleteCollaboration" - -// DeleteCollaborationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCollaboration 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 DeleteCollaboration for more information on using the DeleteCollaboration -// 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 DeleteCollaborationRequest method. -// req, resp := client.DeleteCollaborationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteCollaboration -func (c *CleanRooms) DeleteCollaborationRequest(input *DeleteCollaborationInput) (req *request.Request, output *DeleteCollaborationOutput) { - op := &request.Operation{ - Name: opDeleteCollaboration, - HTTPMethod: "DELETE", - HTTPPath: "/collaborations/{collaborationIdentifier}", - } - - if input == nil { - input = &DeleteCollaborationInput{} - } - - output = &DeleteCollaborationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCollaboration API operation for AWS Clean Rooms Service. -// -// Deletes a collaboration. It can only be called by the collaboration owner. -// -// 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 AWS Clean Rooms Service's -// API operation DeleteCollaboration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteCollaboration -func (c *CleanRooms) DeleteCollaboration(input *DeleteCollaborationInput) (*DeleteCollaborationOutput, error) { - req, out := c.DeleteCollaborationRequest(input) - return out, req.Send() -} - -// DeleteCollaborationWithContext is the same as DeleteCollaboration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCollaboration 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 *CleanRooms) DeleteCollaborationWithContext(ctx aws.Context, input *DeleteCollaborationInput, opts ...request.Option) (*DeleteCollaborationOutput, error) { - req, out := c.DeleteCollaborationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteConfiguredTable = "DeleteConfiguredTable" - -// DeleteConfiguredTableRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConfiguredTable 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 DeleteConfiguredTable for more information on using the DeleteConfiguredTable -// 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 DeleteConfiguredTableRequest method. -// req, resp := client.DeleteConfiguredTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteConfiguredTable -func (c *CleanRooms) DeleteConfiguredTableRequest(input *DeleteConfiguredTableInput) (req *request.Request, output *DeleteConfiguredTableOutput) { - op := &request.Operation{ - Name: opDeleteConfiguredTable, - HTTPMethod: "DELETE", - HTTPPath: "/configuredTables/{configuredTableIdentifier}", - } - - if input == nil { - input = &DeleteConfiguredTableInput{} - } - - output = &DeleteConfiguredTableOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConfiguredTable API operation for AWS Clean Rooms Service. -// -// Deletes a configured table. -// -// 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 AWS Clean Rooms Service's -// API operation DeleteConfiguredTable for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteConfiguredTable -func (c *CleanRooms) DeleteConfiguredTable(input *DeleteConfiguredTableInput) (*DeleteConfiguredTableOutput, error) { - req, out := c.DeleteConfiguredTableRequest(input) - return out, req.Send() -} - -// DeleteConfiguredTableWithContext is the same as DeleteConfiguredTable with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteConfiguredTable 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 *CleanRooms) DeleteConfiguredTableWithContext(ctx aws.Context, input *DeleteConfiguredTableInput, opts ...request.Option) (*DeleteConfiguredTableOutput, error) { - req, out := c.DeleteConfiguredTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteConfiguredTableAnalysisRule = "DeleteConfiguredTableAnalysisRule" - -// DeleteConfiguredTableAnalysisRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConfiguredTableAnalysisRule 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 DeleteConfiguredTableAnalysisRule for more information on using the DeleteConfiguredTableAnalysisRule -// 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 DeleteConfiguredTableAnalysisRuleRequest method. -// req, resp := client.DeleteConfiguredTableAnalysisRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteConfiguredTableAnalysisRule -func (c *CleanRooms) DeleteConfiguredTableAnalysisRuleRequest(input *DeleteConfiguredTableAnalysisRuleInput) (req *request.Request, output *DeleteConfiguredTableAnalysisRuleOutput) { - op := &request.Operation{ - Name: opDeleteConfiguredTableAnalysisRule, - HTTPMethod: "DELETE", - HTTPPath: "/configuredTables/{configuredTableIdentifier}/analysisRule/{analysisRuleType}", - } - - if input == nil { - input = &DeleteConfiguredTableAnalysisRuleInput{} - } - - output = &DeleteConfiguredTableAnalysisRuleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConfiguredTableAnalysisRule API operation for AWS Clean Rooms Service. -// -// Deletes a configured table analysis rule. -// -// 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 AWS Clean Rooms Service's -// API operation DeleteConfiguredTableAnalysisRule for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteConfiguredTableAnalysisRule -func (c *CleanRooms) DeleteConfiguredTableAnalysisRule(input *DeleteConfiguredTableAnalysisRuleInput) (*DeleteConfiguredTableAnalysisRuleOutput, error) { - req, out := c.DeleteConfiguredTableAnalysisRuleRequest(input) - return out, req.Send() -} - -// DeleteConfiguredTableAnalysisRuleWithContext is the same as DeleteConfiguredTableAnalysisRule with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteConfiguredTableAnalysisRule 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 *CleanRooms) DeleteConfiguredTableAnalysisRuleWithContext(ctx aws.Context, input *DeleteConfiguredTableAnalysisRuleInput, opts ...request.Option) (*DeleteConfiguredTableAnalysisRuleOutput, error) { - req, out := c.DeleteConfiguredTableAnalysisRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteConfiguredTableAssociation = "DeleteConfiguredTableAssociation" - -// DeleteConfiguredTableAssociationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConfiguredTableAssociation 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 DeleteConfiguredTableAssociation for more information on using the DeleteConfiguredTableAssociation -// 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 DeleteConfiguredTableAssociationRequest method. -// req, resp := client.DeleteConfiguredTableAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteConfiguredTableAssociation -func (c *CleanRooms) DeleteConfiguredTableAssociationRequest(input *DeleteConfiguredTableAssociationInput) (req *request.Request, output *DeleteConfiguredTableAssociationOutput) { - op := &request.Operation{ - Name: opDeleteConfiguredTableAssociation, - HTTPMethod: "DELETE", - HTTPPath: "/memberships/{membershipIdentifier}/configuredTableAssociations/{configuredTableAssociationIdentifier}", - } - - if input == nil { - input = &DeleteConfiguredTableAssociationInput{} - } - - output = &DeleteConfiguredTableAssociationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConfiguredTableAssociation API operation for AWS Clean Rooms Service. -// -// Deletes a configured table association. -// -// 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 AWS Clean Rooms Service's -// API operation DeleteConfiguredTableAssociation for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteConfiguredTableAssociation -func (c *CleanRooms) DeleteConfiguredTableAssociation(input *DeleteConfiguredTableAssociationInput) (*DeleteConfiguredTableAssociationOutput, error) { - req, out := c.DeleteConfiguredTableAssociationRequest(input) - return out, req.Send() -} - -// DeleteConfiguredTableAssociationWithContext is the same as DeleteConfiguredTableAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteConfiguredTableAssociation 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 *CleanRooms) DeleteConfiguredTableAssociationWithContext(ctx aws.Context, input *DeleteConfiguredTableAssociationInput, opts ...request.Option) (*DeleteConfiguredTableAssociationOutput, error) { - req, out := c.DeleteConfiguredTableAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteMember = "DeleteMember" - -// DeleteMemberRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMember 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 DeleteMember for more information on using the DeleteMember -// 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 DeleteMemberRequest method. -// req, resp := client.DeleteMemberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteMember -func (c *CleanRooms) DeleteMemberRequest(input *DeleteMemberInput) (req *request.Request, output *DeleteMemberOutput) { - op := &request.Operation{ - Name: opDeleteMember, - HTTPMethod: "DELETE", - HTTPPath: "/collaborations/{collaborationIdentifier}/member/{accountId}", - } - - if input == nil { - input = &DeleteMemberInput{} - } - - output = &DeleteMemberOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteMember API operation for AWS Clean Rooms Service. -// -// Removes the specified member from a collaboration. The removed member is -// placed in the Removed status and can't interact with the collaboration. The -// removed member's data is inaccessible to active members of the collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation DeleteMember for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteMember -func (c *CleanRooms) DeleteMember(input *DeleteMemberInput) (*DeleteMemberOutput, error) { - req, out := c.DeleteMemberRequest(input) - return out, req.Send() -} - -// DeleteMemberWithContext is the same as DeleteMember with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteMember 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 *CleanRooms) DeleteMemberWithContext(ctx aws.Context, input *DeleteMemberInput, opts ...request.Option) (*DeleteMemberOutput, error) { - req, out := c.DeleteMemberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteMembership = "DeleteMembership" - -// DeleteMembershipRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMembership 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 DeleteMembership for more information on using the DeleteMembership -// 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 DeleteMembershipRequest method. -// req, resp := client.DeleteMembershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteMembership -func (c *CleanRooms) DeleteMembershipRequest(input *DeleteMembershipInput) (req *request.Request, output *DeleteMembershipOutput) { - op := &request.Operation{ - Name: opDeleteMembership, - HTTPMethod: "DELETE", - HTTPPath: "/memberships/{membershipIdentifier}", - } - - if input == nil { - input = &DeleteMembershipInput{} - } - - output = &DeleteMembershipOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteMembership API operation for AWS Clean Rooms Service. -// -// Deletes a specified membership. All resources under a membership must be -// deleted. -// -// 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 AWS Clean Rooms Service's -// API operation DeleteMembership for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/DeleteMembership -func (c *CleanRooms) DeleteMembership(input *DeleteMembershipInput) (*DeleteMembershipOutput, error) { - req, out := c.DeleteMembershipRequest(input) - return out, req.Send() -} - -// DeleteMembershipWithContext is the same as DeleteMembership with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteMembership 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 *CleanRooms) DeleteMembershipWithContext(ctx aws.Context, input *DeleteMembershipInput, opts ...request.Option) (*DeleteMembershipOutput, error) { - req, out := c.DeleteMembershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAnalysisTemplate = "GetAnalysisTemplate" - -// GetAnalysisTemplateRequest generates a "aws/request.Request" representing the -// client's request for the GetAnalysisTemplate 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 GetAnalysisTemplate for more information on using the GetAnalysisTemplate -// 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 GetAnalysisTemplateRequest method. -// req, resp := client.GetAnalysisTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetAnalysisTemplate -func (c *CleanRooms) GetAnalysisTemplateRequest(input *GetAnalysisTemplateInput) (req *request.Request, output *GetAnalysisTemplateOutput) { - op := &request.Operation{ - Name: opGetAnalysisTemplate, - HTTPMethod: "GET", - HTTPPath: "/memberships/{membershipIdentifier}/analysistemplates/{analysisTemplateIdentifier}", - } - - if input == nil { - input = &GetAnalysisTemplateInput{} - } - - output = &GetAnalysisTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAnalysisTemplate API operation for AWS Clean Rooms Service. -// -// Retrieves an analysis template. -// -// 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 AWS Clean Rooms Service's -// API operation GetAnalysisTemplate for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetAnalysisTemplate -func (c *CleanRooms) GetAnalysisTemplate(input *GetAnalysisTemplateInput) (*GetAnalysisTemplateOutput, error) { - req, out := c.GetAnalysisTemplateRequest(input) - return out, req.Send() -} - -// GetAnalysisTemplateWithContext is the same as GetAnalysisTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See GetAnalysisTemplate 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 *CleanRooms) GetAnalysisTemplateWithContext(ctx aws.Context, input *GetAnalysisTemplateInput, opts ...request.Option) (*GetAnalysisTemplateOutput, error) { - req, out := c.GetAnalysisTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCollaboration = "GetCollaboration" - -// GetCollaborationRequest generates a "aws/request.Request" representing the -// client's request for the GetCollaboration 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 GetCollaboration for more information on using the GetCollaboration -// 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 GetCollaborationRequest method. -// req, resp := client.GetCollaborationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetCollaboration -func (c *CleanRooms) GetCollaborationRequest(input *GetCollaborationInput) (req *request.Request, output *GetCollaborationOutput) { - op := &request.Operation{ - Name: opGetCollaboration, - HTTPMethod: "GET", - HTTPPath: "/collaborations/{collaborationIdentifier}", - } - - if input == nil { - input = &GetCollaborationInput{} - } - - output = &GetCollaborationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCollaboration API operation for AWS Clean Rooms Service. -// -// Returns metadata about a collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation GetCollaboration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetCollaboration -func (c *CleanRooms) GetCollaboration(input *GetCollaborationInput) (*GetCollaborationOutput, error) { - req, out := c.GetCollaborationRequest(input) - return out, req.Send() -} - -// GetCollaborationWithContext is the same as GetCollaboration with the addition of -// the ability to pass a context and additional request options. -// -// See GetCollaboration 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 *CleanRooms) GetCollaborationWithContext(ctx aws.Context, input *GetCollaborationInput, opts ...request.Option) (*GetCollaborationOutput, error) { - req, out := c.GetCollaborationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCollaborationAnalysisTemplate = "GetCollaborationAnalysisTemplate" - -// GetCollaborationAnalysisTemplateRequest generates a "aws/request.Request" representing the -// client's request for the GetCollaborationAnalysisTemplate 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 GetCollaborationAnalysisTemplate for more information on using the GetCollaborationAnalysisTemplate -// 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 GetCollaborationAnalysisTemplateRequest method. -// req, resp := client.GetCollaborationAnalysisTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetCollaborationAnalysisTemplate -func (c *CleanRooms) GetCollaborationAnalysisTemplateRequest(input *GetCollaborationAnalysisTemplateInput) (req *request.Request, output *GetCollaborationAnalysisTemplateOutput) { - op := &request.Operation{ - Name: opGetCollaborationAnalysisTemplate, - HTTPMethod: "GET", - HTTPPath: "/collaborations/{collaborationIdentifier}/analysistemplates/{analysisTemplateArn}", - } - - if input == nil { - input = &GetCollaborationAnalysisTemplateInput{} - } - - output = &GetCollaborationAnalysisTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCollaborationAnalysisTemplate API operation for AWS Clean Rooms Service. -// -// Retrieves an analysis template within a collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation GetCollaborationAnalysisTemplate for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetCollaborationAnalysisTemplate -func (c *CleanRooms) GetCollaborationAnalysisTemplate(input *GetCollaborationAnalysisTemplateInput) (*GetCollaborationAnalysisTemplateOutput, error) { - req, out := c.GetCollaborationAnalysisTemplateRequest(input) - return out, req.Send() -} - -// GetCollaborationAnalysisTemplateWithContext is the same as GetCollaborationAnalysisTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See GetCollaborationAnalysisTemplate 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 *CleanRooms) GetCollaborationAnalysisTemplateWithContext(ctx aws.Context, input *GetCollaborationAnalysisTemplateInput, opts ...request.Option) (*GetCollaborationAnalysisTemplateOutput, error) { - req, out := c.GetCollaborationAnalysisTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConfiguredTable = "GetConfiguredTable" - -// GetConfiguredTableRequest generates a "aws/request.Request" representing the -// client's request for the GetConfiguredTable 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 GetConfiguredTable for more information on using the GetConfiguredTable -// 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 GetConfiguredTableRequest method. -// req, resp := client.GetConfiguredTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetConfiguredTable -func (c *CleanRooms) GetConfiguredTableRequest(input *GetConfiguredTableInput) (req *request.Request, output *GetConfiguredTableOutput) { - op := &request.Operation{ - Name: opGetConfiguredTable, - HTTPMethod: "GET", - HTTPPath: "/configuredTables/{configuredTableIdentifier}", - } - - if input == nil { - input = &GetConfiguredTableInput{} - } - - output = &GetConfiguredTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConfiguredTable API operation for AWS Clean Rooms Service. -// -// Retrieves a configured table. -// -// 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 AWS Clean Rooms Service's -// API operation GetConfiguredTable for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetConfiguredTable -func (c *CleanRooms) GetConfiguredTable(input *GetConfiguredTableInput) (*GetConfiguredTableOutput, error) { - req, out := c.GetConfiguredTableRequest(input) - return out, req.Send() -} - -// GetConfiguredTableWithContext is the same as GetConfiguredTable with the addition of -// the ability to pass a context and additional request options. -// -// See GetConfiguredTable 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 *CleanRooms) GetConfiguredTableWithContext(ctx aws.Context, input *GetConfiguredTableInput, opts ...request.Option) (*GetConfiguredTableOutput, error) { - req, out := c.GetConfiguredTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConfiguredTableAnalysisRule = "GetConfiguredTableAnalysisRule" - -// GetConfiguredTableAnalysisRuleRequest generates a "aws/request.Request" representing the -// client's request for the GetConfiguredTableAnalysisRule 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 GetConfiguredTableAnalysisRule for more information on using the GetConfiguredTableAnalysisRule -// 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 GetConfiguredTableAnalysisRuleRequest method. -// req, resp := client.GetConfiguredTableAnalysisRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetConfiguredTableAnalysisRule -func (c *CleanRooms) GetConfiguredTableAnalysisRuleRequest(input *GetConfiguredTableAnalysisRuleInput) (req *request.Request, output *GetConfiguredTableAnalysisRuleOutput) { - op := &request.Operation{ - Name: opGetConfiguredTableAnalysisRule, - HTTPMethod: "GET", - HTTPPath: "/configuredTables/{configuredTableIdentifier}/analysisRule/{analysisRuleType}", - } - - if input == nil { - input = &GetConfiguredTableAnalysisRuleInput{} - } - - output = &GetConfiguredTableAnalysisRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConfiguredTableAnalysisRule API operation for AWS Clean Rooms Service. -// -// Retrieves a configured table analysis rule. -// -// 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 AWS Clean Rooms Service's -// API operation GetConfiguredTableAnalysisRule for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetConfiguredTableAnalysisRule -func (c *CleanRooms) GetConfiguredTableAnalysisRule(input *GetConfiguredTableAnalysisRuleInput) (*GetConfiguredTableAnalysisRuleOutput, error) { - req, out := c.GetConfiguredTableAnalysisRuleRequest(input) - return out, req.Send() -} - -// GetConfiguredTableAnalysisRuleWithContext is the same as GetConfiguredTableAnalysisRule with the addition of -// the ability to pass a context and additional request options. -// -// See GetConfiguredTableAnalysisRule 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 *CleanRooms) GetConfiguredTableAnalysisRuleWithContext(ctx aws.Context, input *GetConfiguredTableAnalysisRuleInput, opts ...request.Option) (*GetConfiguredTableAnalysisRuleOutput, error) { - req, out := c.GetConfiguredTableAnalysisRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConfiguredTableAssociation = "GetConfiguredTableAssociation" - -// GetConfiguredTableAssociationRequest generates a "aws/request.Request" representing the -// client's request for the GetConfiguredTableAssociation 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 GetConfiguredTableAssociation for more information on using the GetConfiguredTableAssociation -// 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 GetConfiguredTableAssociationRequest method. -// req, resp := client.GetConfiguredTableAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetConfiguredTableAssociation -func (c *CleanRooms) GetConfiguredTableAssociationRequest(input *GetConfiguredTableAssociationInput) (req *request.Request, output *GetConfiguredTableAssociationOutput) { - op := &request.Operation{ - Name: opGetConfiguredTableAssociation, - HTTPMethod: "GET", - HTTPPath: "/memberships/{membershipIdentifier}/configuredTableAssociations/{configuredTableAssociationIdentifier}", - } - - if input == nil { - input = &GetConfiguredTableAssociationInput{} - } - - output = &GetConfiguredTableAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConfiguredTableAssociation API operation for AWS Clean Rooms Service. -// -// Retrieves a configured table association. -// -// 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 AWS Clean Rooms Service's -// API operation GetConfiguredTableAssociation for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetConfiguredTableAssociation -func (c *CleanRooms) GetConfiguredTableAssociation(input *GetConfiguredTableAssociationInput) (*GetConfiguredTableAssociationOutput, error) { - req, out := c.GetConfiguredTableAssociationRequest(input) - return out, req.Send() -} - -// GetConfiguredTableAssociationWithContext is the same as GetConfiguredTableAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See GetConfiguredTableAssociation 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 *CleanRooms) GetConfiguredTableAssociationWithContext(ctx aws.Context, input *GetConfiguredTableAssociationInput, opts ...request.Option) (*GetConfiguredTableAssociationOutput, error) { - req, out := c.GetConfiguredTableAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMembership = "GetMembership" - -// GetMembershipRequest generates a "aws/request.Request" representing the -// client's request for the GetMembership 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 GetMembership for more information on using the GetMembership -// 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 GetMembershipRequest method. -// req, resp := client.GetMembershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetMembership -func (c *CleanRooms) GetMembershipRequest(input *GetMembershipInput) (req *request.Request, output *GetMembershipOutput) { - op := &request.Operation{ - Name: opGetMembership, - HTTPMethod: "GET", - HTTPPath: "/memberships/{membershipIdentifier}", - } - - if input == nil { - input = &GetMembershipInput{} - } - - output = &GetMembershipOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMembership API operation for AWS Clean Rooms Service. -// -// Retrieves a specified membership for an identifier. -// -// 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 AWS Clean Rooms Service's -// API operation GetMembership for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetMembership -func (c *CleanRooms) GetMembership(input *GetMembershipInput) (*GetMembershipOutput, error) { - req, out := c.GetMembershipRequest(input) - return out, req.Send() -} - -// GetMembershipWithContext is the same as GetMembership with the addition of -// the ability to pass a context and additional request options. -// -// See GetMembership 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 *CleanRooms) GetMembershipWithContext(ctx aws.Context, input *GetMembershipInput, opts ...request.Option) (*GetMembershipOutput, error) { - req, out := c.GetMembershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetProtectedQuery = "GetProtectedQuery" - -// GetProtectedQueryRequest generates a "aws/request.Request" representing the -// client's request for the GetProtectedQuery 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 GetProtectedQuery for more information on using the GetProtectedQuery -// 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 GetProtectedQueryRequest method. -// req, resp := client.GetProtectedQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetProtectedQuery -func (c *CleanRooms) GetProtectedQueryRequest(input *GetProtectedQueryInput) (req *request.Request, output *GetProtectedQueryOutput) { - op := &request.Operation{ - Name: opGetProtectedQuery, - HTTPMethod: "GET", - HTTPPath: "/memberships/{membershipIdentifier}/protectedQueries/{protectedQueryIdentifier}", - } - - if input == nil { - input = &GetProtectedQueryInput{} - } - - output = &GetProtectedQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetProtectedQuery API operation for AWS Clean Rooms Service. -// -// Returns query processing metadata. -// -// 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 AWS Clean Rooms Service's -// API operation GetProtectedQuery for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetProtectedQuery -func (c *CleanRooms) GetProtectedQuery(input *GetProtectedQueryInput) (*GetProtectedQueryOutput, error) { - req, out := c.GetProtectedQueryRequest(input) - return out, req.Send() -} - -// GetProtectedQueryWithContext is the same as GetProtectedQuery with the addition of -// the ability to pass a context and additional request options. -// -// See GetProtectedQuery 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 *CleanRooms) GetProtectedQueryWithContext(ctx aws.Context, input *GetProtectedQueryInput, opts ...request.Option) (*GetProtectedQueryOutput, error) { - req, out := c.GetProtectedQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSchema = "GetSchema" - -// GetSchemaRequest generates a "aws/request.Request" representing the -// client's request for the GetSchema 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 GetSchema for more information on using the GetSchema -// 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 GetSchemaRequest method. -// req, resp := client.GetSchemaRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetSchema -func (c *CleanRooms) GetSchemaRequest(input *GetSchemaInput) (req *request.Request, output *GetSchemaOutput) { - op := &request.Operation{ - Name: opGetSchema, - HTTPMethod: "GET", - HTTPPath: "/collaborations/{collaborationIdentifier}/schemas/{name}", - } - - if input == nil { - input = &GetSchemaInput{} - } - - output = &GetSchemaOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSchema API operation for AWS Clean Rooms Service. -// -// Retrieves the schema for a relation within a collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation GetSchema for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetSchema -func (c *CleanRooms) GetSchema(input *GetSchemaInput) (*GetSchemaOutput, error) { - req, out := c.GetSchemaRequest(input) - return out, req.Send() -} - -// GetSchemaWithContext is the same as GetSchema with the addition of -// the ability to pass a context and additional request options. -// -// See GetSchema 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 *CleanRooms) GetSchemaWithContext(ctx aws.Context, input *GetSchemaInput, opts ...request.Option) (*GetSchemaOutput, error) { - req, out := c.GetSchemaRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSchemaAnalysisRule = "GetSchemaAnalysisRule" - -// GetSchemaAnalysisRuleRequest generates a "aws/request.Request" representing the -// client's request for the GetSchemaAnalysisRule 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 GetSchemaAnalysisRule for more information on using the GetSchemaAnalysisRule -// 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 GetSchemaAnalysisRuleRequest method. -// req, resp := client.GetSchemaAnalysisRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetSchemaAnalysisRule -func (c *CleanRooms) GetSchemaAnalysisRuleRequest(input *GetSchemaAnalysisRuleInput) (req *request.Request, output *GetSchemaAnalysisRuleOutput) { - op := &request.Operation{ - Name: opGetSchemaAnalysisRule, - HTTPMethod: "GET", - HTTPPath: "/collaborations/{collaborationIdentifier}/schemas/{name}/analysisRule/{type}", - } - - if input == nil { - input = &GetSchemaAnalysisRuleInput{} - } - - output = &GetSchemaAnalysisRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSchemaAnalysisRule API operation for AWS Clean Rooms Service. -// -// Retrieves a schema analysis rule. -// -// 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 AWS Clean Rooms Service's -// API operation GetSchemaAnalysisRule for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetSchemaAnalysisRule -func (c *CleanRooms) GetSchemaAnalysisRule(input *GetSchemaAnalysisRuleInput) (*GetSchemaAnalysisRuleOutput, error) { - req, out := c.GetSchemaAnalysisRuleRequest(input) - return out, req.Send() -} - -// GetSchemaAnalysisRuleWithContext is the same as GetSchemaAnalysisRule with the addition of -// the ability to pass a context and additional request options. -// -// See GetSchemaAnalysisRule 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 *CleanRooms) GetSchemaAnalysisRuleWithContext(ctx aws.Context, input *GetSchemaAnalysisRuleInput, opts ...request.Option) (*GetSchemaAnalysisRuleOutput, error) { - req, out := c.GetSchemaAnalysisRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAnalysisTemplates = "ListAnalysisTemplates" - -// ListAnalysisTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the ListAnalysisTemplates 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 ListAnalysisTemplates for more information on using the ListAnalysisTemplates -// 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 ListAnalysisTemplatesRequest method. -// req, resp := client.ListAnalysisTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListAnalysisTemplates -func (c *CleanRooms) ListAnalysisTemplatesRequest(input *ListAnalysisTemplatesInput) (req *request.Request, output *ListAnalysisTemplatesOutput) { - op := &request.Operation{ - Name: opListAnalysisTemplates, - HTTPMethod: "GET", - HTTPPath: "/memberships/{membershipIdentifier}/analysistemplates", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAnalysisTemplatesInput{} - } - - output = &ListAnalysisTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAnalysisTemplates API operation for AWS Clean Rooms Service. -// -// Lists analysis templates that the caller owns. -// -// 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 AWS Clean Rooms Service's -// API operation ListAnalysisTemplates for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListAnalysisTemplates -func (c *CleanRooms) ListAnalysisTemplates(input *ListAnalysisTemplatesInput) (*ListAnalysisTemplatesOutput, error) { - req, out := c.ListAnalysisTemplatesRequest(input) - return out, req.Send() -} - -// ListAnalysisTemplatesWithContext is the same as ListAnalysisTemplates with the addition of -// the ability to pass a context and additional request options. -// -// See ListAnalysisTemplates 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 *CleanRooms) ListAnalysisTemplatesWithContext(ctx aws.Context, input *ListAnalysisTemplatesInput, opts ...request.Option) (*ListAnalysisTemplatesOutput, error) { - req, out := c.ListAnalysisTemplatesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAnalysisTemplatesPages iterates over the pages of a ListAnalysisTemplates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAnalysisTemplates method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAnalysisTemplates operation. -// pageNum := 0 -// err := client.ListAnalysisTemplatesPages(params, -// func(page *cleanrooms.ListAnalysisTemplatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListAnalysisTemplatesPages(input *ListAnalysisTemplatesInput, fn func(*ListAnalysisTemplatesOutput, bool) bool) error { - return c.ListAnalysisTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAnalysisTemplatesPagesWithContext same as ListAnalysisTemplatesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListAnalysisTemplatesPagesWithContext(ctx aws.Context, input *ListAnalysisTemplatesInput, fn func(*ListAnalysisTemplatesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAnalysisTemplatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAnalysisTemplatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAnalysisTemplatesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListCollaborationAnalysisTemplates = "ListCollaborationAnalysisTemplates" - -// ListCollaborationAnalysisTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the ListCollaborationAnalysisTemplates 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 ListCollaborationAnalysisTemplates for more information on using the ListCollaborationAnalysisTemplates -// 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 ListCollaborationAnalysisTemplatesRequest method. -// req, resp := client.ListCollaborationAnalysisTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListCollaborationAnalysisTemplates -func (c *CleanRooms) ListCollaborationAnalysisTemplatesRequest(input *ListCollaborationAnalysisTemplatesInput) (req *request.Request, output *ListCollaborationAnalysisTemplatesOutput) { - op := &request.Operation{ - Name: opListCollaborationAnalysisTemplates, - HTTPMethod: "GET", - HTTPPath: "/collaborations/{collaborationIdentifier}/analysistemplates", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCollaborationAnalysisTemplatesInput{} - } - - output = &ListCollaborationAnalysisTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCollaborationAnalysisTemplates API operation for AWS Clean Rooms Service. -// -// Lists analysis templates within a collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation ListCollaborationAnalysisTemplates for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListCollaborationAnalysisTemplates -func (c *CleanRooms) ListCollaborationAnalysisTemplates(input *ListCollaborationAnalysisTemplatesInput) (*ListCollaborationAnalysisTemplatesOutput, error) { - req, out := c.ListCollaborationAnalysisTemplatesRequest(input) - return out, req.Send() -} - -// ListCollaborationAnalysisTemplatesWithContext is the same as ListCollaborationAnalysisTemplates with the addition of -// the ability to pass a context and additional request options. -// -// See ListCollaborationAnalysisTemplates 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 *CleanRooms) ListCollaborationAnalysisTemplatesWithContext(ctx aws.Context, input *ListCollaborationAnalysisTemplatesInput, opts ...request.Option) (*ListCollaborationAnalysisTemplatesOutput, error) { - req, out := c.ListCollaborationAnalysisTemplatesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCollaborationAnalysisTemplatesPages iterates over the pages of a ListCollaborationAnalysisTemplates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCollaborationAnalysisTemplates method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCollaborationAnalysisTemplates operation. -// pageNum := 0 -// err := client.ListCollaborationAnalysisTemplatesPages(params, -// func(page *cleanrooms.ListCollaborationAnalysisTemplatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListCollaborationAnalysisTemplatesPages(input *ListCollaborationAnalysisTemplatesInput, fn func(*ListCollaborationAnalysisTemplatesOutput, bool) bool) error { - return c.ListCollaborationAnalysisTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCollaborationAnalysisTemplatesPagesWithContext same as ListCollaborationAnalysisTemplatesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListCollaborationAnalysisTemplatesPagesWithContext(ctx aws.Context, input *ListCollaborationAnalysisTemplatesInput, fn func(*ListCollaborationAnalysisTemplatesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCollaborationAnalysisTemplatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCollaborationAnalysisTemplatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCollaborationAnalysisTemplatesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListCollaborations = "ListCollaborations" - -// ListCollaborationsRequest generates a "aws/request.Request" representing the -// client's request for the ListCollaborations 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 ListCollaborations for more information on using the ListCollaborations -// 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 ListCollaborationsRequest method. -// req, resp := client.ListCollaborationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListCollaborations -func (c *CleanRooms) ListCollaborationsRequest(input *ListCollaborationsInput) (req *request.Request, output *ListCollaborationsOutput) { - op := &request.Operation{ - Name: opListCollaborations, - HTTPMethod: "GET", - HTTPPath: "/collaborations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCollaborationsInput{} - } - - output = &ListCollaborationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCollaborations API operation for AWS Clean Rooms Service. -// -// Lists collaborations the caller owns, is active in, or has been invited to. -// -// 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 AWS Clean Rooms Service's -// API operation ListCollaborations for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListCollaborations -func (c *CleanRooms) ListCollaborations(input *ListCollaborationsInput) (*ListCollaborationsOutput, error) { - req, out := c.ListCollaborationsRequest(input) - return out, req.Send() -} - -// ListCollaborationsWithContext is the same as ListCollaborations with the addition of -// the ability to pass a context and additional request options. -// -// See ListCollaborations 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 *CleanRooms) ListCollaborationsWithContext(ctx aws.Context, input *ListCollaborationsInput, opts ...request.Option) (*ListCollaborationsOutput, error) { - req, out := c.ListCollaborationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCollaborationsPages iterates over the pages of a ListCollaborations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCollaborations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCollaborations operation. -// pageNum := 0 -// err := client.ListCollaborationsPages(params, -// func(page *cleanrooms.ListCollaborationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListCollaborationsPages(input *ListCollaborationsInput, fn func(*ListCollaborationsOutput, bool) bool) error { - return c.ListCollaborationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCollaborationsPagesWithContext same as ListCollaborationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListCollaborationsPagesWithContext(ctx aws.Context, input *ListCollaborationsInput, fn func(*ListCollaborationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCollaborationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCollaborationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCollaborationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListConfiguredTableAssociations = "ListConfiguredTableAssociations" - -// ListConfiguredTableAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the ListConfiguredTableAssociations 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 ListConfiguredTableAssociations for more information on using the ListConfiguredTableAssociations -// 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 ListConfiguredTableAssociationsRequest method. -// req, resp := client.ListConfiguredTableAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListConfiguredTableAssociations -func (c *CleanRooms) ListConfiguredTableAssociationsRequest(input *ListConfiguredTableAssociationsInput) (req *request.Request, output *ListConfiguredTableAssociationsOutput) { - op := &request.Operation{ - Name: opListConfiguredTableAssociations, - HTTPMethod: "GET", - HTTPPath: "/memberships/{membershipIdentifier}/configuredTableAssociations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListConfiguredTableAssociationsInput{} - } - - output = &ListConfiguredTableAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListConfiguredTableAssociations API operation for AWS Clean Rooms Service. -// -// Lists configured table associations for a membership. -// -// 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 AWS Clean Rooms Service's -// API operation ListConfiguredTableAssociations for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListConfiguredTableAssociations -func (c *CleanRooms) ListConfiguredTableAssociations(input *ListConfiguredTableAssociationsInput) (*ListConfiguredTableAssociationsOutput, error) { - req, out := c.ListConfiguredTableAssociationsRequest(input) - return out, req.Send() -} - -// ListConfiguredTableAssociationsWithContext is the same as ListConfiguredTableAssociations with the addition of -// the ability to pass a context and additional request options. -// -// See ListConfiguredTableAssociations 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 *CleanRooms) ListConfiguredTableAssociationsWithContext(ctx aws.Context, input *ListConfiguredTableAssociationsInput, opts ...request.Option) (*ListConfiguredTableAssociationsOutput, error) { - req, out := c.ListConfiguredTableAssociationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListConfiguredTableAssociationsPages iterates over the pages of a ListConfiguredTableAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListConfiguredTableAssociations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListConfiguredTableAssociations operation. -// pageNum := 0 -// err := client.ListConfiguredTableAssociationsPages(params, -// func(page *cleanrooms.ListConfiguredTableAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListConfiguredTableAssociationsPages(input *ListConfiguredTableAssociationsInput, fn func(*ListConfiguredTableAssociationsOutput, bool) bool) error { - return c.ListConfiguredTableAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListConfiguredTableAssociationsPagesWithContext same as ListConfiguredTableAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListConfiguredTableAssociationsPagesWithContext(ctx aws.Context, input *ListConfiguredTableAssociationsInput, fn func(*ListConfiguredTableAssociationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListConfiguredTableAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListConfiguredTableAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListConfiguredTableAssociationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListConfiguredTables = "ListConfiguredTables" - -// ListConfiguredTablesRequest generates a "aws/request.Request" representing the -// client's request for the ListConfiguredTables 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 ListConfiguredTables for more information on using the ListConfiguredTables -// 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 ListConfiguredTablesRequest method. -// req, resp := client.ListConfiguredTablesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListConfiguredTables -func (c *CleanRooms) ListConfiguredTablesRequest(input *ListConfiguredTablesInput) (req *request.Request, output *ListConfiguredTablesOutput) { - op := &request.Operation{ - Name: opListConfiguredTables, - HTTPMethod: "GET", - HTTPPath: "/configuredTables", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListConfiguredTablesInput{} - } - - output = &ListConfiguredTablesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListConfiguredTables API operation for AWS Clean Rooms Service. -// -// Lists configured tables. -// -// 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 AWS Clean Rooms Service's -// API operation ListConfiguredTables for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListConfiguredTables -func (c *CleanRooms) ListConfiguredTables(input *ListConfiguredTablesInput) (*ListConfiguredTablesOutput, error) { - req, out := c.ListConfiguredTablesRequest(input) - return out, req.Send() -} - -// ListConfiguredTablesWithContext is the same as ListConfiguredTables with the addition of -// the ability to pass a context and additional request options. -// -// See ListConfiguredTables 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 *CleanRooms) ListConfiguredTablesWithContext(ctx aws.Context, input *ListConfiguredTablesInput, opts ...request.Option) (*ListConfiguredTablesOutput, error) { - req, out := c.ListConfiguredTablesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListConfiguredTablesPages iterates over the pages of a ListConfiguredTables operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListConfiguredTables method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListConfiguredTables operation. -// pageNum := 0 -// err := client.ListConfiguredTablesPages(params, -// func(page *cleanrooms.ListConfiguredTablesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListConfiguredTablesPages(input *ListConfiguredTablesInput, fn func(*ListConfiguredTablesOutput, bool) bool) error { - return c.ListConfiguredTablesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListConfiguredTablesPagesWithContext same as ListConfiguredTablesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListConfiguredTablesPagesWithContext(ctx aws.Context, input *ListConfiguredTablesInput, fn func(*ListConfiguredTablesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListConfiguredTablesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListConfiguredTablesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListConfiguredTablesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListMembers = "ListMembers" - -// ListMembersRequest generates a "aws/request.Request" representing the -// client's request for the ListMembers 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 ListMembers for more information on using the ListMembers -// 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 ListMembersRequest method. -// req, resp := client.ListMembersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListMembers -func (c *CleanRooms) ListMembersRequest(input *ListMembersInput) (req *request.Request, output *ListMembersOutput) { - op := &request.Operation{ - Name: opListMembers, - HTTPMethod: "GET", - HTTPPath: "/collaborations/{collaborationIdentifier}/members", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMembersInput{} - } - - output = &ListMembersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMembers API operation for AWS Clean Rooms Service. -// -// Lists all members within a collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation ListMembers for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListMembers -func (c *CleanRooms) ListMembers(input *ListMembersInput) (*ListMembersOutput, error) { - req, out := c.ListMembersRequest(input) - return out, req.Send() -} - -// ListMembersWithContext is the same as ListMembers with the addition of -// the ability to pass a context and additional request options. -// -// See ListMembers 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 *CleanRooms) ListMembersWithContext(ctx aws.Context, input *ListMembersInput, opts ...request.Option) (*ListMembersOutput, error) { - req, out := c.ListMembersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMembersPages iterates over the pages of a ListMembers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMembers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMembers operation. -// pageNum := 0 -// err := client.ListMembersPages(params, -// func(page *cleanrooms.ListMembersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListMembersPages(input *ListMembersInput, fn func(*ListMembersOutput, bool) bool) error { - return c.ListMembersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMembersPagesWithContext same as ListMembersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListMembersPagesWithContext(ctx aws.Context, input *ListMembersInput, fn func(*ListMembersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMembersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMembersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListMembersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListMemberships = "ListMemberships" - -// ListMembershipsRequest generates a "aws/request.Request" representing the -// client's request for the ListMemberships 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 ListMemberships for more information on using the ListMemberships -// 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 ListMembershipsRequest method. -// req, resp := client.ListMembershipsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListMemberships -func (c *CleanRooms) ListMembershipsRequest(input *ListMembershipsInput) (req *request.Request, output *ListMembershipsOutput) { - op := &request.Operation{ - Name: opListMemberships, - HTTPMethod: "GET", - HTTPPath: "/memberships", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMembershipsInput{} - } - - output = &ListMembershipsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMemberships API operation for AWS Clean Rooms Service. -// -// Lists all memberships resources within the caller's account. -// -// 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 AWS Clean Rooms Service's -// API operation ListMemberships for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListMemberships -func (c *CleanRooms) ListMemberships(input *ListMembershipsInput) (*ListMembershipsOutput, error) { - req, out := c.ListMembershipsRequest(input) - return out, req.Send() -} - -// ListMembershipsWithContext is the same as ListMemberships with the addition of -// the ability to pass a context and additional request options. -// -// See ListMemberships 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 *CleanRooms) ListMembershipsWithContext(ctx aws.Context, input *ListMembershipsInput, opts ...request.Option) (*ListMembershipsOutput, error) { - req, out := c.ListMembershipsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMembershipsPages iterates over the pages of a ListMemberships operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMemberships method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMemberships operation. -// pageNum := 0 -// err := client.ListMembershipsPages(params, -// func(page *cleanrooms.ListMembershipsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListMembershipsPages(input *ListMembershipsInput, fn func(*ListMembershipsOutput, bool) bool) error { - return c.ListMembershipsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMembershipsPagesWithContext same as ListMembershipsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListMembershipsPagesWithContext(ctx aws.Context, input *ListMembershipsInput, fn func(*ListMembershipsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMembershipsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMembershipsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListMembershipsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProtectedQueries = "ListProtectedQueries" - -// ListProtectedQueriesRequest generates a "aws/request.Request" representing the -// client's request for the ListProtectedQueries 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 ListProtectedQueries for more information on using the ListProtectedQueries -// 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 ListProtectedQueriesRequest method. -// req, resp := client.ListProtectedQueriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListProtectedQueries -func (c *CleanRooms) ListProtectedQueriesRequest(input *ListProtectedQueriesInput) (req *request.Request, output *ListProtectedQueriesOutput) { - op := &request.Operation{ - Name: opListProtectedQueries, - HTTPMethod: "GET", - HTTPPath: "/memberships/{membershipIdentifier}/protectedQueries", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProtectedQueriesInput{} - } - - output = &ListProtectedQueriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProtectedQueries API operation for AWS Clean Rooms Service. -// -// Lists protected queries, sorted by the most recent query. -// -// 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 AWS Clean Rooms Service's -// API operation ListProtectedQueries for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListProtectedQueries -func (c *CleanRooms) ListProtectedQueries(input *ListProtectedQueriesInput) (*ListProtectedQueriesOutput, error) { - req, out := c.ListProtectedQueriesRequest(input) - return out, req.Send() -} - -// ListProtectedQueriesWithContext is the same as ListProtectedQueries with the addition of -// the ability to pass a context and additional request options. -// -// See ListProtectedQueries 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 *CleanRooms) ListProtectedQueriesWithContext(ctx aws.Context, input *ListProtectedQueriesInput, opts ...request.Option) (*ListProtectedQueriesOutput, error) { - req, out := c.ListProtectedQueriesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProtectedQueriesPages iterates over the pages of a ListProtectedQueries operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProtectedQueries method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProtectedQueries operation. -// pageNum := 0 -// err := client.ListProtectedQueriesPages(params, -// func(page *cleanrooms.ListProtectedQueriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListProtectedQueriesPages(input *ListProtectedQueriesInput, fn func(*ListProtectedQueriesOutput, bool) bool) error { - return c.ListProtectedQueriesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProtectedQueriesPagesWithContext same as ListProtectedQueriesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListProtectedQueriesPagesWithContext(ctx aws.Context, input *ListProtectedQueriesInput, fn func(*ListProtectedQueriesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProtectedQueriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProtectedQueriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProtectedQueriesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSchemas = "ListSchemas" - -// ListSchemasRequest generates a "aws/request.Request" representing the -// client's request for the ListSchemas 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 ListSchemas for more information on using the ListSchemas -// 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 ListSchemasRequest method. -// req, resp := client.ListSchemasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListSchemas -func (c *CleanRooms) ListSchemasRequest(input *ListSchemasInput) (req *request.Request, output *ListSchemasOutput) { - op := &request.Operation{ - Name: opListSchemas, - HTTPMethod: "GET", - HTTPPath: "/collaborations/{collaborationIdentifier}/schemas", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSchemasInput{} - } - - output = &ListSchemasOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSchemas API operation for AWS Clean Rooms Service. -// -// Lists the schemas for relations within a collaboration. -// -// 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 AWS Clean Rooms Service's -// API operation ListSchemas for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListSchemas -func (c *CleanRooms) ListSchemas(input *ListSchemasInput) (*ListSchemasOutput, error) { - req, out := c.ListSchemasRequest(input) - return out, req.Send() -} - -// ListSchemasWithContext is the same as ListSchemas with the addition of -// the ability to pass a context and additional request options. -// -// See ListSchemas 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 *CleanRooms) ListSchemasWithContext(ctx aws.Context, input *ListSchemasInput, opts ...request.Option) (*ListSchemasOutput, error) { - req, out := c.ListSchemasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSchemasPages iterates over the pages of a ListSchemas operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSchemas method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSchemas operation. -// pageNum := 0 -// err := client.ListSchemasPages(params, -// func(page *cleanrooms.ListSchemasOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CleanRooms) ListSchemasPages(input *ListSchemasInput, fn func(*ListSchemasOutput, bool) bool) error { - return c.ListSchemasPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSchemasPagesWithContext same as ListSchemasPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CleanRooms) ListSchemasPagesWithContext(ctx aws.Context, input *ListSchemasInput, fn func(*ListSchemasOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSchemasInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSchemasRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSchemasOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListTagsForResource -func (c *CleanRooms) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Clean Rooms Service. -// -// Lists all of the tags that have been added to a resource. -// -// 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 AWS Clean Rooms Service's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/ListTagsForResource -func (c *CleanRooms) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *CleanRooms) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartProtectedQuery = "StartProtectedQuery" - -// StartProtectedQueryRequest generates a "aws/request.Request" representing the -// client's request for the StartProtectedQuery 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 StartProtectedQuery for more information on using the StartProtectedQuery -// 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 StartProtectedQueryRequest method. -// req, resp := client.StartProtectedQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/StartProtectedQuery -func (c *CleanRooms) StartProtectedQueryRequest(input *StartProtectedQueryInput) (req *request.Request, output *StartProtectedQueryOutput) { - op := &request.Operation{ - Name: opStartProtectedQuery, - HTTPMethod: "POST", - HTTPPath: "/memberships/{membershipIdentifier}/protectedQueries", - } - - if input == nil { - input = &StartProtectedQueryInput{} - } - - output = &StartProtectedQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartProtectedQuery API operation for AWS Clean Rooms Service. -// -// Creates a protected query that is started by Clean Rooms. -// -// 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 AWS Clean Rooms Service's -// API operation StartProtectedQuery for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// Request denied because service quota has been exceeded. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/StartProtectedQuery -func (c *CleanRooms) StartProtectedQuery(input *StartProtectedQueryInput) (*StartProtectedQueryOutput, error) { - req, out := c.StartProtectedQueryRequest(input) - return out, req.Send() -} - -// StartProtectedQueryWithContext is the same as StartProtectedQuery with the addition of -// the ability to pass a context and additional request options. -// -// See StartProtectedQuery 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 *CleanRooms) StartProtectedQueryWithContext(ctx aws.Context, input *StartProtectedQueryInput, opts ...request.Option) (*StartProtectedQueryOutput, error) { - req, out := c.StartProtectedQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/TagResource -func (c *CleanRooms) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Clean Rooms Service. -// -// Tags a resource. -// -// 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 AWS Clean Rooms Service's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/TagResource -func (c *CleanRooms) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *CleanRooms) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UntagResource -func (c *CleanRooms) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Clean Rooms Service. -// -// Removes a tag or list of tags from a resource. -// -// 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 AWS Clean Rooms Service's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UntagResource -func (c *CleanRooms) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *CleanRooms) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAnalysisTemplate = "UpdateAnalysisTemplate" - -// UpdateAnalysisTemplateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAnalysisTemplate 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 UpdateAnalysisTemplate for more information on using the UpdateAnalysisTemplate -// 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 UpdateAnalysisTemplateRequest method. -// req, resp := client.UpdateAnalysisTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateAnalysisTemplate -func (c *CleanRooms) UpdateAnalysisTemplateRequest(input *UpdateAnalysisTemplateInput) (req *request.Request, output *UpdateAnalysisTemplateOutput) { - op := &request.Operation{ - Name: opUpdateAnalysisTemplate, - HTTPMethod: "PATCH", - HTTPPath: "/memberships/{membershipIdentifier}/analysistemplates/{analysisTemplateIdentifier}", - } - - if input == nil { - input = &UpdateAnalysisTemplateInput{} - } - - output = &UpdateAnalysisTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAnalysisTemplate API operation for AWS Clean Rooms Service. -// -// Updates the analysis template metadata. -// -// 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 AWS Clean Rooms Service's -// API operation UpdateAnalysisTemplate for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateAnalysisTemplate -func (c *CleanRooms) UpdateAnalysisTemplate(input *UpdateAnalysisTemplateInput) (*UpdateAnalysisTemplateOutput, error) { - req, out := c.UpdateAnalysisTemplateRequest(input) - return out, req.Send() -} - -// UpdateAnalysisTemplateWithContext is the same as UpdateAnalysisTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAnalysisTemplate 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 *CleanRooms) UpdateAnalysisTemplateWithContext(ctx aws.Context, input *UpdateAnalysisTemplateInput, opts ...request.Option) (*UpdateAnalysisTemplateOutput, error) { - req, out := c.UpdateAnalysisTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCollaboration = "UpdateCollaboration" - -// UpdateCollaborationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCollaboration 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 UpdateCollaboration for more information on using the UpdateCollaboration -// 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 UpdateCollaborationRequest method. -// req, resp := client.UpdateCollaborationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateCollaboration -func (c *CleanRooms) UpdateCollaborationRequest(input *UpdateCollaborationInput) (req *request.Request, output *UpdateCollaborationOutput) { - op := &request.Operation{ - Name: opUpdateCollaboration, - HTTPMethod: "PATCH", - HTTPPath: "/collaborations/{collaborationIdentifier}", - } - - if input == nil { - input = &UpdateCollaborationInput{} - } - - output = &UpdateCollaborationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateCollaboration API operation for AWS Clean Rooms Service. -// -// Updates collaboration metadata and can only be called by the collaboration -// owner. -// -// 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 AWS Clean Rooms Service's -// API operation UpdateCollaboration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateCollaboration -func (c *CleanRooms) UpdateCollaboration(input *UpdateCollaborationInput) (*UpdateCollaborationOutput, error) { - req, out := c.UpdateCollaborationRequest(input) - return out, req.Send() -} - -// UpdateCollaborationWithContext is the same as UpdateCollaboration with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCollaboration 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 *CleanRooms) UpdateCollaborationWithContext(ctx aws.Context, input *UpdateCollaborationInput, opts ...request.Option) (*UpdateCollaborationOutput, error) { - req, out := c.UpdateCollaborationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateConfiguredTable = "UpdateConfiguredTable" - -// UpdateConfiguredTableRequest generates a "aws/request.Request" representing the -// client's request for the UpdateConfiguredTable 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 UpdateConfiguredTable for more information on using the UpdateConfiguredTable -// 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 UpdateConfiguredTableRequest method. -// req, resp := client.UpdateConfiguredTableRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateConfiguredTable -func (c *CleanRooms) UpdateConfiguredTableRequest(input *UpdateConfiguredTableInput) (req *request.Request, output *UpdateConfiguredTableOutput) { - op := &request.Operation{ - Name: opUpdateConfiguredTable, - HTTPMethod: "PATCH", - HTTPPath: "/configuredTables/{configuredTableIdentifier}", - } - - if input == nil { - input = &UpdateConfiguredTableInput{} - } - - output = &UpdateConfiguredTableOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateConfiguredTable API operation for AWS Clean Rooms Service. -// -// Updates a configured table. -// -// 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 AWS Clean Rooms Service's -// API operation UpdateConfiguredTable for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateConfiguredTable -func (c *CleanRooms) UpdateConfiguredTable(input *UpdateConfiguredTableInput) (*UpdateConfiguredTableOutput, error) { - req, out := c.UpdateConfiguredTableRequest(input) - return out, req.Send() -} - -// UpdateConfiguredTableWithContext is the same as UpdateConfiguredTable with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateConfiguredTable 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 *CleanRooms) UpdateConfiguredTableWithContext(ctx aws.Context, input *UpdateConfiguredTableInput, opts ...request.Option) (*UpdateConfiguredTableOutput, error) { - req, out := c.UpdateConfiguredTableRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateConfiguredTableAnalysisRule = "UpdateConfiguredTableAnalysisRule" - -// UpdateConfiguredTableAnalysisRuleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateConfiguredTableAnalysisRule 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 UpdateConfiguredTableAnalysisRule for more information on using the UpdateConfiguredTableAnalysisRule -// 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 UpdateConfiguredTableAnalysisRuleRequest method. -// req, resp := client.UpdateConfiguredTableAnalysisRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateConfiguredTableAnalysisRule -func (c *CleanRooms) UpdateConfiguredTableAnalysisRuleRequest(input *UpdateConfiguredTableAnalysisRuleInput) (req *request.Request, output *UpdateConfiguredTableAnalysisRuleOutput) { - op := &request.Operation{ - Name: opUpdateConfiguredTableAnalysisRule, - HTTPMethod: "PATCH", - HTTPPath: "/configuredTables/{configuredTableIdentifier}/analysisRule/{analysisRuleType}", - } - - if input == nil { - input = &UpdateConfiguredTableAnalysisRuleInput{} - } - - output = &UpdateConfiguredTableAnalysisRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateConfiguredTableAnalysisRule API operation for AWS Clean Rooms Service. -// -// Updates a configured table analysis rule. -// -// 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 AWS Clean Rooms Service's -// API operation UpdateConfiguredTableAnalysisRule for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateConfiguredTableAnalysisRule -func (c *CleanRooms) UpdateConfiguredTableAnalysisRule(input *UpdateConfiguredTableAnalysisRuleInput) (*UpdateConfiguredTableAnalysisRuleOutput, error) { - req, out := c.UpdateConfiguredTableAnalysisRuleRequest(input) - return out, req.Send() -} - -// UpdateConfiguredTableAnalysisRuleWithContext is the same as UpdateConfiguredTableAnalysisRule with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateConfiguredTableAnalysisRule 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 *CleanRooms) UpdateConfiguredTableAnalysisRuleWithContext(ctx aws.Context, input *UpdateConfiguredTableAnalysisRuleInput, opts ...request.Option) (*UpdateConfiguredTableAnalysisRuleOutput, error) { - req, out := c.UpdateConfiguredTableAnalysisRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateConfiguredTableAssociation = "UpdateConfiguredTableAssociation" - -// UpdateConfiguredTableAssociationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateConfiguredTableAssociation 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 UpdateConfiguredTableAssociation for more information on using the UpdateConfiguredTableAssociation -// 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 UpdateConfiguredTableAssociationRequest method. -// req, resp := client.UpdateConfiguredTableAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateConfiguredTableAssociation -func (c *CleanRooms) UpdateConfiguredTableAssociationRequest(input *UpdateConfiguredTableAssociationInput) (req *request.Request, output *UpdateConfiguredTableAssociationOutput) { - op := &request.Operation{ - Name: opUpdateConfiguredTableAssociation, - HTTPMethod: "PATCH", - HTTPPath: "/memberships/{membershipIdentifier}/configuredTableAssociations/{configuredTableAssociationIdentifier}", - } - - if input == nil { - input = &UpdateConfiguredTableAssociationInput{} - } - - output = &UpdateConfiguredTableAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateConfiguredTableAssociation API operation for AWS Clean Rooms Service. -// -// Updates a configured table association. -// -// 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 AWS Clean Rooms Service's -// API operation UpdateConfiguredTableAssociation for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateConfiguredTableAssociation -func (c *CleanRooms) UpdateConfiguredTableAssociation(input *UpdateConfiguredTableAssociationInput) (*UpdateConfiguredTableAssociationOutput, error) { - req, out := c.UpdateConfiguredTableAssociationRequest(input) - return out, req.Send() -} - -// UpdateConfiguredTableAssociationWithContext is the same as UpdateConfiguredTableAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateConfiguredTableAssociation 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 *CleanRooms) UpdateConfiguredTableAssociationWithContext(ctx aws.Context, input *UpdateConfiguredTableAssociationInput, opts ...request.Option) (*UpdateConfiguredTableAssociationOutput, error) { - req, out := c.UpdateConfiguredTableAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateMembership = "UpdateMembership" - -// UpdateMembershipRequest generates a "aws/request.Request" representing the -// client's request for the UpdateMembership 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 UpdateMembership for more information on using the UpdateMembership -// 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 UpdateMembershipRequest method. -// req, resp := client.UpdateMembershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateMembership -func (c *CleanRooms) UpdateMembershipRequest(input *UpdateMembershipInput) (req *request.Request, output *UpdateMembershipOutput) { - op := &request.Operation{ - Name: opUpdateMembership, - HTTPMethod: "PATCH", - HTTPPath: "/memberships/{membershipIdentifier}", - } - - if input == nil { - input = &UpdateMembershipInput{} - } - - output = &UpdateMembershipOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateMembership API operation for AWS Clean Rooms Service. -// -// Updates a membership. -// -// 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 AWS Clean Rooms Service's -// API operation UpdateMembership for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateMembership -func (c *CleanRooms) UpdateMembership(input *UpdateMembershipInput) (*UpdateMembershipOutput, error) { - req, out := c.UpdateMembershipRequest(input) - return out, req.Send() -} - -// UpdateMembershipWithContext is the same as UpdateMembership with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateMembership 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 *CleanRooms) UpdateMembershipWithContext(ctx aws.Context, input *UpdateMembershipInput, opts ...request.Option) (*UpdateMembershipOutput, error) { - req, out := c.UpdateMembershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateProtectedQuery = "UpdateProtectedQuery" - -// UpdateProtectedQueryRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProtectedQuery 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 UpdateProtectedQuery for more information on using the UpdateProtectedQuery -// 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 UpdateProtectedQueryRequest method. -// req, resp := client.UpdateProtectedQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateProtectedQuery -func (c *CleanRooms) UpdateProtectedQueryRequest(input *UpdateProtectedQueryInput) (req *request.Request, output *UpdateProtectedQueryOutput) { - op := &request.Operation{ - Name: opUpdateProtectedQuery, - HTTPMethod: "PATCH", - HTTPPath: "/memberships/{membershipIdentifier}/protectedQueries/{protectedQueryIdentifier}", - } - - if input == nil { - input = &UpdateProtectedQueryInput{} - } - - output = &UpdateProtectedQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateProtectedQuery API operation for AWS Clean Rooms Service. -// -// Updates the processing of a currently running query. -// -// 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 AWS Clean Rooms Service's -// API operation UpdateProtectedQuery for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - AccessDeniedException -// Caller does not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/UpdateProtectedQuery -func (c *CleanRooms) UpdateProtectedQuery(input *UpdateProtectedQueryInput) (*UpdateProtectedQueryOutput, error) { - req, out := c.UpdateProtectedQueryRequest(input) - return out, req.Send() -} - -// UpdateProtectedQueryWithContext is the same as UpdateProtectedQuery with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateProtectedQuery 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 *CleanRooms) UpdateProtectedQueryWithContext(ctx aws.Context, input *UpdateProtectedQueryInput, opts ...request.Option) (*UpdateProtectedQueryOutput, error) { - req, out := c.UpdateProtectedQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Caller does not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A reason code for the exception. - Reason *string `locationName:"reason" type:"string" enum:"AccessDeniedExceptionReason"` -} - -// 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Column in configured table that can be used in aggregate function in query. -type AggregateColumn struct { - _ struct{} `type:"structure"` - - // Column names in configured table of aggregate columns. - // - // ColumnNames is a required field - ColumnNames []*string `locationName:"columnNames" min:"1" type:"list" required:"true"` - - // Aggregation function that can be applied to aggregate column in query. - // - // Function is a required field - Function *string `locationName:"function" type:"string" required:"true" enum:"AggregateFunctionName"` -} - -// 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 AggregateColumn) 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 AggregateColumn) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AggregateColumn) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AggregateColumn"} - if s.ColumnNames == nil { - invalidParams.Add(request.NewErrParamRequired("ColumnNames")) - } - if s.ColumnNames != nil && len(s.ColumnNames) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ColumnNames", 1)) - } - if s.Function == nil { - invalidParams.Add(request.NewErrParamRequired("Function")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetColumnNames sets the ColumnNames field's value. -func (s *AggregateColumn) SetColumnNames(v []*string) *AggregateColumn { - s.ColumnNames = v - return s -} - -// SetFunction sets the Function field's value. -func (s *AggregateColumn) SetFunction(v string) *AggregateColumn { - s.Function = &v - return s -} - -// Constraint on query output removing output rows that do not meet a minimum -// number of distinct values of a specified column. -type AggregationConstraint struct { - _ struct{} `type:"structure"` - - // Column in aggregation constraint for which there must be a minimum number - // of distinct values in an output row for it to be in the query output. - // - // ColumnName is a required field - ColumnName *string `locationName:"columnName" min:"1" type:"string" required:"true"` - - // The minimum number of distinct values that an output row must be an aggregation - // of. Minimum threshold of distinct values for a specified column that must - // exist in an output row for it to be in the query output. - // - // Minimum is a required field - Minimum *int64 `locationName:"minimum" min:"2" type:"integer" required:"true"` - - // The type of aggregation the constraint allows. The only valid value is currently - // `COUNT_DISTINCT`. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AggregationType"` -} - -// 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 AggregationConstraint) 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 AggregationConstraint) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AggregationConstraint) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AggregationConstraint"} - if s.ColumnName == nil { - invalidParams.Add(request.NewErrParamRequired("ColumnName")) - } - if s.ColumnName != nil && len(*s.ColumnName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ColumnName", 1)) - } - if s.Minimum == nil { - invalidParams.Add(request.NewErrParamRequired("Minimum")) - } - if s.Minimum != nil && *s.Minimum < 2 { - invalidParams.Add(request.NewErrParamMinValue("Minimum", 2)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetColumnName sets the ColumnName field's value. -func (s *AggregationConstraint) SetColumnName(v string) *AggregationConstraint { - s.ColumnName = &v - return s -} - -// SetMinimum sets the Minimum field's value. -func (s *AggregationConstraint) SetMinimum(v int64) *AggregationConstraint { - s.Minimum = &v - return s -} - -// SetType sets the Type field's value. -func (s *AggregationConstraint) SetType(v string) *AggregationConstraint { - s.Type = &v - return s -} - -// Optional. The member who can query can provide this placeholder for a literal -// data value in an analysis template. -type AnalysisParameter struct { - _ struct{} `type:"structure" sensitive:"true"` - - // Optional. The default value that is applied in the analysis template. The - // member who can query can override this value in the query editor. - DefaultValue *string `locationName:"defaultValue" type:"string"` - - // The name of the parameter. The name must use only alphanumeric, underscore - // (_), or hyphen (-) characters but cannot start or end with a hyphen. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The type of parameter. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"ParameterType"` -} - -// 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 AnalysisParameter) 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 AnalysisParameter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalysisParameter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalysisParameter"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *AnalysisParameter) SetDefaultValue(v string) *AnalysisParameter { - s.DefaultValue = &v - return s -} - -// SetName sets the Name field's value. -func (s *AnalysisParameter) SetName(v string) *AnalysisParameter { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *AnalysisParameter) SetType(v string) *AnalysisParameter { - s.Type = &v - return s -} - -// A specification about how data from the configured table can be used in a -// query. -type AnalysisRule struct { - _ struct{} `type:"structure"` - - // The unique ID for the associated collaboration. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The time the analysis rule was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The name for the analysis rule. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // A policy that describes the associated data usage limitations. - // - // Policy is a required field - Policy *AnalysisRulePolicy `locationName:"policy" type:"structure" required:"true"` - - // The type of analysis rule. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AnalysisRuleType"` - - // The time the analysis rule was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 AnalysisRule) 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 AnalysisRule) GoString() string { - return s.String() -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *AnalysisRule) SetCollaborationId(v string) *AnalysisRule { - s.CollaborationId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *AnalysisRule) SetCreateTime(v time.Time) *AnalysisRule { - s.CreateTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *AnalysisRule) SetName(v string) *AnalysisRule { - s.Name = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *AnalysisRule) SetPolicy(v *AnalysisRulePolicy) *AnalysisRule { - s.Policy = v - return s -} - -// SetType sets the Type field's value. -func (s *AnalysisRule) SetType(v string) *AnalysisRule { - s.Type = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *AnalysisRule) SetUpdateTime(v time.Time) *AnalysisRule { - s.UpdateTime = &v - return s -} - -// A type of analysis rule that enables query structure and specified queries -// that produce aggregate statistics. -type AnalysisRuleAggregation struct { - _ struct{} `type:"structure"` - - // The columns that query runners are allowed to use in aggregation queries. - // - // AggregateColumns is a required field - AggregateColumns []*AggregateColumn `locationName:"aggregateColumns" min:"1" type:"list" required:"true"` - - // Which logical operators (if any) are to be used in an INNER JOIN match condition. - // Default is AND. - AllowedJoinOperators []*string `locationName:"allowedJoinOperators" type:"list" enum:"JoinOperator"` - - // The columns that query runners are allowed to select, group by, or filter - // by. - // - // DimensionColumns is a required field - DimensionColumns []*string `locationName:"dimensionColumns" type:"list" required:"true"` - - // Columns in configured table that can be used in join statements and/or as - // aggregate columns. They can never be outputted directly. - // - // JoinColumns is a required field - JoinColumns []*string `locationName:"joinColumns" type:"list" required:"true"` - - // Control that requires member who runs query to do a join with their configured - // table and/or other configured table in query. - JoinRequired *string `locationName:"joinRequired" type:"string" enum:"JoinRequiredOption"` - - // Columns that must meet a specific threshold value (after an aggregation function - // is applied to it) for each output row to be returned. - // - // OutputConstraints is a required field - OutputConstraints []*AggregationConstraint `locationName:"outputConstraints" min:"1" type:"list" required:"true"` - - // Set of scalar functions that are allowed to be used on dimension columns - // and the output of aggregation of metrics. - // - // ScalarFunctions is a required field - ScalarFunctions []*string `locationName:"scalarFunctions" type:"list" required:"true" enum:"ScalarFunctions"` -} - -// 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 AnalysisRuleAggregation) 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 AnalysisRuleAggregation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalysisRuleAggregation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalysisRuleAggregation"} - if s.AggregateColumns == nil { - invalidParams.Add(request.NewErrParamRequired("AggregateColumns")) - } - if s.AggregateColumns != nil && len(s.AggregateColumns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AggregateColumns", 1)) - } - if s.DimensionColumns == nil { - invalidParams.Add(request.NewErrParamRequired("DimensionColumns")) - } - if s.JoinColumns == nil { - invalidParams.Add(request.NewErrParamRequired("JoinColumns")) - } - if s.OutputConstraints == nil { - invalidParams.Add(request.NewErrParamRequired("OutputConstraints")) - } - if s.OutputConstraints != nil && len(s.OutputConstraints) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputConstraints", 1)) - } - if s.ScalarFunctions == nil { - invalidParams.Add(request.NewErrParamRequired("ScalarFunctions")) - } - if s.AggregateColumns != nil { - for i, v := range s.AggregateColumns { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AggregateColumns", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputConstraints != nil { - for i, v := range s.OutputConstraints { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OutputConstraints", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAggregateColumns sets the AggregateColumns field's value. -func (s *AnalysisRuleAggregation) SetAggregateColumns(v []*AggregateColumn) *AnalysisRuleAggregation { - s.AggregateColumns = v - return s -} - -// SetAllowedJoinOperators sets the AllowedJoinOperators field's value. -func (s *AnalysisRuleAggregation) SetAllowedJoinOperators(v []*string) *AnalysisRuleAggregation { - s.AllowedJoinOperators = v - return s -} - -// SetDimensionColumns sets the DimensionColumns field's value. -func (s *AnalysisRuleAggregation) SetDimensionColumns(v []*string) *AnalysisRuleAggregation { - s.DimensionColumns = v - return s -} - -// SetJoinColumns sets the JoinColumns field's value. -func (s *AnalysisRuleAggregation) SetJoinColumns(v []*string) *AnalysisRuleAggregation { - s.JoinColumns = v - return s -} - -// SetJoinRequired sets the JoinRequired field's value. -func (s *AnalysisRuleAggregation) SetJoinRequired(v string) *AnalysisRuleAggregation { - s.JoinRequired = &v - return s -} - -// SetOutputConstraints sets the OutputConstraints field's value. -func (s *AnalysisRuleAggregation) SetOutputConstraints(v []*AggregationConstraint) *AnalysisRuleAggregation { - s.OutputConstraints = v - return s -} - -// SetScalarFunctions sets the ScalarFunctions field's value. -func (s *AnalysisRuleAggregation) SetScalarFunctions(v []*string) *AnalysisRuleAggregation { - s.ScalarFunctions = v - return s -} - -// A type of analysis rule that enables the table owner to approve custom SQL -// queries on their configured tables. -type AnalysisRuleCustom struct { - _ struct{} `type:"structure"` - - // The analysis templates that are allowed by the custom analysis rule. - // - // AllowedAnalyses is a required field - AllowedAnalyses []*string `locationName:"allowedAnalyses" type:"list" required:"true"` - - // The Amazon Web Services accounts that are allowed to query by the custom - // analysis rule. Required when allowedAnalyses is ANY_QUERY. - AllowedAnalysisProviders []*string `locationName:"allowedAnalysisProviders" type:"list"` -} - -// 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 AnalysisRuleCustom) 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 AnalysisRuleCustom) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalysisRuleCustom) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalysisRuleCustom"} - if s.AllowedAnalyses == nil { - invalidParams.Add(request.NewErrParamRequired("AllowedAnalyses")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedAnalyses sets the AllowedAnalyses field's value. -func (s *AnalysisRuleCustom) SetAllowedAnalyses(v []*string) *AnalysisRuleCustom { - s.AllowedAnalyses = v - return s -} - -// SetAllowedAnalysisProviders sets the AllowedAnalysisProviders field's value. -func (s *AnalysisRuleCustom) SetAllowedAnalysisProviders(v []*string) *AnalysisRuleCustom { - s.AllowedAnalysisProviders = v - return s -} - -// A type of analysis rule that enables row-level analysis. -type AnalysisRuleList struct { - _ struct{} `type:"structure"` - - // The logical operators (if any) that are to be used in an INNER JOIN match - // condition. Default is AND. - AllowedJoinOperators []*string `locationName:"allowedJoinOperators" type:"list" enum:"JoinOperator"` - - // Columns that can be used to join a configured table with the table of the - // member who can query and other members' configured tables. - // - // JoinColumns is a required field - JoinColumns []*string `locationName:"joinColumns" min:"1" type:"list" required:"true"` - - // Columns that can be listed in the output. - // - // ListColumns is a required field - ListColumns []*string `locationName:"listColumns" type:"list" 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 AnalysisRuleList) 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 AnalysisRuleList) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalysisRuleList) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalysisRuleList"} - if s.JoinColumns == nil { - invalidParams.Add(request.NewErrParamRequired("JoinColumns")) - } - if s.JoinColumns != nil && len(s.JoinColumns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JoinColumns", 1)) - } - if s.ListColumns == nil { - invalidParams.Add(request.NewErrParamRequired("ListColumns")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedJoinOperators sets the AllowedJoinOperators field's value. -func (s *AnalysisRuleList) SetAllowedJoinOperators(v []*string) *AnalysisRuleList { - s.AllowedJoinOperators = v - return s -} - -// SetJoinColumns sets the JoinColumns field's value. -func (s *AnalysisRuleList) SetJoinColumns(v []*string) *AnalysisRuleList { - s.JoinColumns = v - return s -} - -// SetListColumns sets the ListColumns field's value. -func (s *AnalysisRuleList) SetListColumns(v []*string) *AnalysisRuleList { - s.ListColumns = v - return s -} - -// Controls on the query specifications that can be run on configured table. -type AnalysisRulePolicy struct { - _ struct{} `type:"structure"` - - // Controls on the query specifications that can be run on configured table. - V1 *AnalysisRulePolicyV1 `locationName:"v1" 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 AnalysisRulePolicy) 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 AnalysisRulePolicy) GoString() string { - return s.String() -} - -// SetV1 sets the V1 field's value. -func (s *AnalysisRulePolicy) SetV1(v *AnalysisRulePolicyV1) *AnalysisRulePolicy { - s.V1 = v - return s -} - -// Controls on the query specifications that can be run on configured table. -type AnalysisRulePolicyV1 struct { - _ struct{} `type:"structure"` - - // Analysis rule type that enables only aggregation queries on a configured - // table. - Aggregation *AnalysisRuleAggregation `locationName:"aggregation" type:"structure"` - - // Analysis rule type that enables custom SQL queries on a configured table. - Custom *AnalysisRuleCustom `locationName:"custom" type:"structure"` - - // Analysis rule type that enables only list queries on a configured table. - List *AnalysisRuleList `locationName:"list" 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 AnalysisRulePolicyV1) 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 AnalysisRulePolicyV1) GoString() string { - return s.String() -} - -// SetAggregation sets the Aggregation field's value. -func (s *AnalysisRulePolicyV1) SetAggregation(v *AnalysisRuleAggregation) *AnalysisRulePolicyV1 { - s.Aggregation = v - return s -} - -// SetCustom sets the Custom field's value. -func (s *AnalysisRulePolicyV1) SetCustom(v *AnalysisRuleCustom) *AnalysisRulePolicyV1 { - s.Custom = v - return s -} - -// SetList sets the List field's value. -func (s *AnalysisRulePolicyV1) SetList(v *AnalysisRuleList) *AnalysisRulePolicyV1 { - s.List = v - return s -} - -// A relation within an analysis. -type AnalysisSchema struct { - _ struct{} `type:"structure"` - - // The tables referenced in the analysis schema. - ReferencedTables []*string `locationName:"referencedTables" type:"list"` -} - -// 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 AnalysisSchema) 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 AnalysisSchema) GoString() string { - return s.String() -} - -// SetReferencedTables sets the ReferencedTables field's value. -func (s *AnalysisSchema) SetReferencedTables(v []*string) *AnalysisSchema { - s.ReferencedTables = v - return s -} - -// The structure that defines the body of the analysis template. -type AnalysisSource struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The query text. - Text *string `locationName:"text" 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 AnalysisSource) 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 AnalysisSource) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *AnalysisSource) SetText(v string) *AnalysisSource { - s.Text = &v - return s -} - -// The analysis template. -type AnalysisTemplate struct { - _ struct{} `type:"structure"` - - // The parameters of the analysis template. - AnalysisParameters []*AnalysisParameter `locationName:"analysisParameters" type:"list"` - - // The Amazon Resource Name (ARN) of the analysis template. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The unique ARN for the analysis template’s associated collaboration. - // - // CollaborationArn is a required field - CollaborationArn *string `locationName:"collaborationArn" type:"string" required:"true"` - - // The unique ID for the associated collaboration of the analysis template. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The time that the analysis template was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The description of the analysis template. - Description *string `locationName:"description" type:"string"` - - // The format of the analysis template. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true" enum:"AnalysisFormat"` - - // The identifier for the analysis template. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the member who created the analysis template. - // - // MembershipArn is a required field - MembershipArn *string `locationName:"membershipArn" type:"string" required:"true"` - - // The identifier of a member who created the analysis template. - // - // MembershipId is a required field - MembershipId *string `locationName:"membershipId" min:"36" type:"string" required:"true"` - - // The name of the analysis template. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The entire schema object. - // - // Schema is a required field - Schema *AnalysisSchema `locationName:"schema" type:"structure" required:"true"` - - // The source of the analysis template. - // - // Source is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AnalysisTemplate's - // String and GoString methods. - // - // Source is a required field - Source *AnalysisSource `locationName:"source" type:"structure" required:"true" sensitive:"true"` - - // The time that the analysis template was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 AnalysisTemplate) 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 AnalysisTemplate) GoString() string { - return s.String() -} - -// SetAnalysisParameters sets the AnalysisParameters field's value. -func (s *AnalysisTemplate) SetAnalysisParameters(v []*AnalysisParameter) *AnalysisTemplate { - s.AnalysisParameters = v - return s -} - -// SetArn sets the Arn field's value. -func (s *AnalysisTemplate) SetArn(v string) *AnalysisTemplate { - s.Arn = &v - return s -} - -// SetCollaborationArn sets the CollaborationArn field's value. -func (s *AnalysisTemplate) SetCollaborationArn(v string) *AnalysisTemplate { - s.CollaborationArn = &v - return s -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *AnalysisTemplate) SetCollaborationId(v string) *AnalysisTemplate { - s.CollaborationId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *AnalysisTemplate) SetCreateTime(v time.Time) *AnalysisTemplate { - s.CreateTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AnalysisTemplate) SetDescription(v string) *AnalysisTemplate { - s.Description = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *AnalysisTemplate) SetFormat(v string) *AnalysisTemplate { - s.Format = &v - return s -} - -// SetId sets the Id field's value. -func (s *AnalysisTemplate) SetId(v string) *AnalysisTemplate { - s.Id = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *AnalysisTemplate) SetMembershipArn(v string) *AnalysisTemplate { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *AnalysisTemplate) SetMembershipId(v string) *AnalysisTemplate { - s.MembershipId = &v - return s -} - -// SetName sets the Name field's value. -func (s *AnalysisTemplate) SetName(v string) *AnalysisTemplate { - s.Name = &v - return s -} - -// SetSchema sets the Schema field's value. -func (s *AnalysisTemplate) SetSchema(v *AnalysisSchema) *AnalysisTemplate { - s.Schema = v - return s -} - -// SetSource sets the Source field's value. -func (s *AnalysisTemplate) SetSource(v *AnalysisSource) *AnalysisTemplate { - s.Source = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *AnalysisTemplate) SetUpdateTime(v time.Time) *AnalysisTemplate { - s.UpdateTime = &v - return s -} - -// The metadata of the analysis template. -type AnalysisTemplateSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the analysis template. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The unique ARN for the analysis template summary’s associated collaboration. - // - // CollaborationArn is a required field - CollaborationArn *string `locationName:"collaborationArn" type:"string" required:"true"` - - // A unique identifier for the collaboration that the analysis template summary - // belongs to. Currently accepts collaboration ID. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The time that the analysis template summary was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The description of the analysis template. - Description *string `locationName:"description" type:"string"` - - // The identifier of the analysis template. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the member who created the analysis template. - // - // MembershipArn is a required field - MembershipArn *string `locationName:"membershipArn" type:"string" required:"true"` - - // The identifier for a membership resource. - // - // MembershipId is a required field - MembershipId *string `locationName:"membershipId" min:"36" type:"string" required:"true"` - - // The name of the analysis template. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The time that the analysis template summary was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 AnalysisTemplateSummary) 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 AnalysisTemplateSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AnalysisTemplateSummary) SetArn(v string) *AnalysisTemplateSummary { - s.Arn = &v - return s -} - -// SetCollaborationArn sets the CollaborationArn field's value. -func (s *AnalysisTemplateSummary) SetCollaborationArn(v string) *AnalysisTemplateSummary { - s.CollaborationArn = &v - return s -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *AnalysisTemplateSummary) SetCollaborationId(v string) *AnalysisTemplateSummary { - s.CollaborationId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *AnalysisTemplateSummary) SetCreateTime(v time.Time) *AnalysisTemplateSummary { - s.CreateTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AnalysisTemplateSummary) SetDescription(v string) *AnalysisTemplateSummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *AnalysisTemplateSummary) SetId(v string) *AnalysisTemplateSummary { - s.Id = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *AnalysisTemplateSummary) SetMembershipArn(v string) *AnalysisTemplateSummary { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *AnalysisTemplateSummary) SetMembershipId(v string) *AnalysisTemplateSummary { - s.MembershipId = &v - return s -} - -// SetName sets the Name field's value. -func (s *AnalysisTemplateSummary) SetName(v string) *AnalysisTemplateSummary { - s.Name = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *AnalysisTemplateSummary) SetUpdateTime(v time.Time) *AnalysisTemplateSummary { - s.UpdateTime = &v - return s -} - -// Details of errors thrown by the call to retrieve multiple analysis templates -// within a collaboration by their identifiers. -type BatchGetCollaborationAnalysisTemplateError struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the analysis template. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // An error code for the error. - // - // Code is a required field - Code *string `locationName:"code" type:"string" required:"true"` - - // A description of why the call failed. - // - // Message is a required field - Message *string `locationName:"message" 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 BatchGetCollaborationAnalysisTemplateError) 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 BatchGetCollaborationAnalysisTemplateError) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *BatchGetCollaborationAnalysisTemplateError) SetArn(v string) *BatchGetCollaborationAnalysisTemplateError { - s.Arn = &v - return s -} - -// SetCode sets the Code field's value. -func (s *BatchGetCollaborationAnalysisTemplateError) SetCode(v string) *BatchGetCollaborationAnalysisTemplateError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *BatchGetCollaborationAnalysisTemplateError) SetMessage(v string) *BatchGetCollaborationAnalysisTemplateError { - s.Message = &v - return s -} - -type BatchGetCollaborationAnalysisTemplateInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the analysis template within - // a collaboration. - // - // AnalysisTemplateArns is a required field - AnalysisTemplateArns []*string `locationName:"analysisTemplateArns" min:"1" type:"list" required:"true"` - - // A unique identifier for the collaboration that the analysis templates belong - // to. Currently accepts collaboration ID. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" 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 BatchGetCollaborationAnalysisTemplateInput) 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 BatchGetCollaborationAnalysisTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetCollaborationAnalysisTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetCollaborationAnalysisTemplateInput"} - if s.AnalysisTemplateArns == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisTemplateArns")) - } - if s.AnalysisTemplateArns != nil && len(s.AnalysisTemplateArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AnalysisTemplateArns", 1)) - } - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisTemplateArns sets the AnalysisTemplateArns field's value. -func (s *BatchGetCollaborationAnalysisTemplateInput) SetAnalysisTemplateArns(v []*string) *BatchGetCollaborationAnalysisTemplateInput { - s.AnalysisTemplateArns = v - return s -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *BatchGetCollaborationAnalysisTemplateInput) SetCollaborationIdentifier(v string) *BatchGetCollaborationAnalysisTemplateInput { - s.CollaborationIdentifier = &v - return s -} - -type BatchGetCollaborationAnalysisTemplateOutput struct { - _ struct{} `type:"structure"` - - // The retrieved list of analysis templates within a collaboration. - // - // CollaborationAnalysisTemplates is a required field - CollaborationAnalysisTemplates []*CollaborationAnalysisTemplate `locationName:"collaborationAnalysisTemplates" type:"list" required:"true"` - - // Error reasons for collaboration analysis templates that could not be retrieved. - // One error is returned for every collaboration analysis template that could - // not be retrieved. - // - // Errors is a required field - Errors []*BatchGetCollaborationAnalysisTemplateError `locationName:"errors" type:"list" 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 BatchGetCollaborationAnalysisTemplateOutput) 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 BatchGetCollaborationAnalysisTemplateOutput) GoString() string { - return s.String() -} - -// SetCollaborationAnalysisTemplates sets the CollaborationAnalysisTemplates field's value. -func (s *BatchGetCollaborationAnalysisTemplateOutput) SetCollaborationAnalysisTemplates(v []*CollaborationAnalysisTemplate) *BatchGetCollaborationAnalysisTemplateOutput { - s.CollaborationAnalysisTemplates = v - return s -} - -// SetErrors sets the Errors field's value. -func (s *BatchGetCollaborationAnalysisTemplateOutput) SetErrors(v []*BatchGetCollaborationAnalysisTemplateError) *BatchGetCollaborationAnalysisTemplateOutput { - s.Errors = v - return s -} - -// An error describing why a schema could not be fetched. -type BatchGetSchemaError struct { - _ struct{} `type:"structure"` - - // An error code for the error. - // - // Code is a required field - Code *string `locationName:"code" type:"string" required:"true"` - - // An error message for the error. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // An error name for the error. - // - // Name is a required field - Name *string `locationName:"name" 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 BatchGetSchemaError) 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 BatchGetSchemaError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *BatchGetSchemaError) SetCode(v string) *BatchGetSchemaError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *BatchGetSchemaError) SetMessage(v string) *BatchGetSchemaError { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *BatchGetSchemaError) SetName(v string) *BatchGetSchemaError { - s.Name = &v - return s -} - -type BatchGetSchemaInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the collaboration that the schemas belong to. Currently - // accepts collaboration ID. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" type:"string" required:"true"` - - // The names for the schema objects to retrieve.> - // - // Names is a required field - Names []*string `locationName:"names" min:"1" type:"list" 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 BatchGetSchemaInput) 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 BatchGetSchemaInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetSchemaInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetSchemaInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - if s.Names == nil { - invalidParams.Add(request.NewErrParamRequired("Names")) - } - if s.Names != nil && len(s.Names) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Names", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *BatchGetSchemaInput) SetCollaborationIdentifier(v string) *BatchGetSchemaInput { - s.CollaborationIdentifier = &v - return s -} - -// SetNames sets the Names field's value. -func (s *BatchGetSchemaInput) SetNames(v []*string) *BatchGetSchemaInput { - s.Names = v - return s -} - -type BatchGetSchemaOutput struct { - _ struct{} `type:"structure"` - - // Error reasons for schemas that could not be retrieved. One error is returned - // for every schema that could not be retrieved. - // - // Errors is a required field - Errors []*BatchGetSchemaError `locationName:"errors" type:"list" required:"true"` - - // The retrieved list of schemas. - // - // Schemas is a required field - Schemas []*Schema `locationName:"schemas" type:"list" 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 BatchGetSchemaOutput) 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 BatchGetSchemaOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchGetSchemaOutput) SetErrors(v []*BatchGetSchemaError) *BatchGetSchemaOutput { - s.Errors = v - return s -} - -// SetSchemas sets the Schemas field's value. -func (s *BatchGetSchemaOutput) SetSchemas(v []*Schema) *BatchGetSchemaOutput { - s.Schemas = v - return s -} - -// The multi-party data share environment. The collaboration contains metadata -// about its purpose and participants. -type Collaboration struct { - _ struct{} `type:"structure"` - - // The unique ARN for the collaboration. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time when the collaboration was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The identifier used to reference members of the collaboration. Currently - // only supports Amazon Web Services account ID. - // - // CreatorAccountId is a required field - CreatorAccountId *string `locationName:"creatorAccountId" min:"12" type:"string" required:"true"` - - // A display name of the collaboration creator. - // - // CreatorDisplayName is a required field - CreatorDisplayName *string `locationName:"creatorDisplayName" min:"1" type:"string" required:"true"` - - // The settings for client-side encryption for cryptographic computing. - DataEncryptionMetadata *DataEncryptionMetadata `locationName:"dataEncryptionMetadata" type:"structure"` - - // A description of the collaboration provided by the collaboration owner. - Description *string `locationName:"description" min:"1" type:"string"` - - // The unique ID for the collaboration. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The status of a member in a collaboration. - // - // MemberStatus is a required field - MemberStatus *string `locationName:"memberStatus" type:"string" required:"true" enum:"MemberStatus"` - - // The unique ARN for your membership within the collaboration. - MembershipArn *string `locationName:"membershipArn" type:"string"` - - // The unique ID for your membership within the collaboration. - MembershipId *string `locationName:"membershipId" min:"36" type:"string"` - - // A human-readable identifier provided by the collaboration owner. Display - // names are not unique. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // An indicator as to whether query logging has been enabled or disabled for - // the collaboration. - // - // QueryLogStatus is a required field - QueryLogStatus *string `locationName:"queryLogStatus" type:"string" required:"true" enum:"CollaborationQueryLogStatus"` - - // The time the collaboration metadata was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 Collaboration) 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 Collaboration) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Collaboration) SetArn(v string) *Collaboration { - s.Arn = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *Collaboration) SetCreateTime(v time.Time) *Collaboration { - s.CreateTime = &v - return s -} - -// SetCreatorAccountId sets the CreatorAccountId field's value. -func (s *Collaboration) SetCreatorAccountId(v string) *Collaboration { - s.CreatorAccountId = &v - return s -} - -// SetCreatorDisplayName sets the CreatorDisplayName field's value. -func (s *Collaboration) SetCreatorDisplayName(v string) *Collaboration { - s.CreatorDisplayName = &v - return s -} - -// SetDataEncryptionMetadata sets the DataEncryptionMetadata field's value. -func (s *Collaboration) SetDataEncryptionMetadata(v *DataEncryptionMetadata) *Collaboration { - s.DataEncryptionMetadata = v - return s -} - -// SetDescription sets the Description field's value. -func (s *Collaboration) SetDescription(v string) *Collaboration { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *Collaboration) SetId(v string) *Collaboration { - s.Id = &v - return s -} - -// SetMemberStatus sets the MemberStatus field's value. -func (s *Collaboration) SetMemberStatus(v string) *Collaboration { - s.MemberStatus = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *Collaboration) SetMembershipArn(v string) *Collaboration { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *Collaboration) SetMembershipId(v string) *Collaboration { - s.MembershipId = &v - return s -} - -// SetName sets the Name field's value. -func (s *Collaboration) SetName(v string) *Collaboration { - s.Name = &v - return s -} - -// SetQueryLogStatus sets the QueryLogStatus field's value. -func (s *Collaboration) SetQueryLogStatus(v string) *Collaboration { - s.QueryLogStatus = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *Collaboration) SetUpdateTime(v time.Time) *Collaboration { - s.UpdateTime = &v - return s -} - -// The analysis template within a collaboration. -type CollaborationAnalysisTemplate struct { - _ struct{} `type:"structure"` - - // The analysis parameters that have been specified in the analysis template. - AnalysisParameters []*AnalysisParameter `locationName:"analysisParameters" type:"list"` - - // The Amazon Resource Name (ARN) of the analysis template. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The unique ARN for the analysis template’s associated collaboration. - // - // CollaborationArn is a required field - CollaborationArn *string `locationName:"collaborationArn" type:"string" required:"true"` - - // A unique identifier for the collaboration that the analysis templates belong - // to. Currently accepts collaboration ID. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The time that the analysis template within a collaboration was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The identifier used to reference members of the collaboration. Currently - // only supports Amazon Web Services account ID. - // - // CreatorAccountId is a required field - CreatorAccountId *string `locationName:"creatorAccountId" min:"12" type:"string" required:"true"` - - // The description of the analysis template. - Description *string `locationName:"description" type:"string"` - - // The format of the analysis template in the collaboration. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true" enum:"AnalysisFormat"` - - // The identifier of the analysis template. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The name of the analysis template. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The entire schema object. - // - // Schema is a required field - Schema *AnalysisSchema `locationName:"schema" type:"structure" required:"true"` - - // The source of the analysis template within a collaboration. - // - // Source is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CollaborationAnalysisTemplate's - // String and GoString methods. - // - // Source is a required field - Source *AnalysisSource `locationName:"source" type:"structure" required:"true" sensitive:"true"` - - // The time that the analysis template in the collaboration was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 CollaborationAnalysisTemplate) 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 CollaborationAnalysisTemplate) GoString() string { - return s.String() -} - -// SetAnalysisParameters sets the AnalysisParameters field's value. -func (s *CollaborationAnalysisTemplate) SetAnalysisParameters(v []*AnalysisParameter) *CollaborationAnalysisTemplate { - s.AnalysisParameters = v - return s -} - -// SetArn sets the Arn field's value. -func (s *CollaborationAnalysisTemplate) SetArn(v string) *CollaborationAnalysisTemplate { - s.Arn = &v - return s -} - -// SetCollaborationArn sets the CollaborationArn field's value. -func (s *CollaborationAnalysisTemplate) SetCollaborationArn(v string) *CollaborationAnalysisTemplate { - s.CollaborationArn = &v - return s -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *CollaborationAnalysisTemplate) SetCollaborationId(v string) *CollaborationAnalysisTemplate { - s.CollaborationId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *CollaborationAnalysisTemplate) SetCreateTime(v time.Time) *CollaborationAnalysisTemplate { - s.CreateTime = &v - return s -} - -// SetCreatorAccountId sets the CreatorAccountId field's value. -func (s *CollaborationAnalysisTemplate) SetCreatorAccountId(v string) *CollaborationAnalysisTemplate { - s.CreatorAccountId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CollaborationAnalysisTemplate) SetDescription(v string) *CollaborationAnalysisTemplate { - s.Description = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *CollaborationAnalysisTemplate) SetFormat(v string) *CollaborationAnalysisTemplate { - s.Format = &v - return s -} - -// SetId sets the Id field's value. -func (s *CollaborationAnalysisTemplate) SetId(v string) *CollaborationAnalysisTemplate { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CollaborationAnalysisTemplate) SetName(v string) *CollaborationAnalysisTemplate { - s.Name = &v - return s -} - -// SetSchema sets the Schema field's value. -func (s *CollaborationAnalysisTemplate) SetSchema(v *AnalysisSchema) *CollaborationAnalysisTemplate { - s.Schema = v - return s -} - -// SetSource sets the Source field's value. -func (s *CollaborationAnalysisTemplate) SetSource(v *AnalysisSource) *CollaborationAnalysisTemplate { - s.Source = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *CollaborationAnalysisTemplate) SetUpdateTime(v time.Time) *CollaborationAnalysisTemplate { - s.UpdateTime = &v - return s -} - -// The metadata of the analysis template within a collaboration. -type CollaborationAnalysisTemplateSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the analysis template. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The unique ARN for the analysis template’s associated collaboration. - // - // CollaborationArn is a required field - CollaborationArn *string `locationName:"collaborationArn" type:"string" required:"true"` - - // A unique identifier for the collaboration that the analysis templates belong - // to. Currently accepts collaboration ID. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The time that the summary of the analysis template in a collaboration was - // created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The identifier used to reference members of the collaboration. Currently - // only supports Amazon Web Services account ID. - // - // CreatorAccountId is a required field - CreatorAccountId *string `locationName:"creatorAccountId" min:"12" type:"string" required:"true"` - - // The description of the analysis template. - Description *string `locationName:"description" type:"string"` - - // The identifier of the analysis template. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The name of the analysis template. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The time that the summary of the analysis template in the collaboration was - // last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 CollaborationAnalysisTemplateSummary) 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 CollaborationAnalysisTemplateSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CollaborationAnalysisTemplateSummary) SetArn(v string) *CollaborationAnalysisTemplateSummary { - s.Arn = &v - return s -} - -// SetCollaborationArn sets the CollaborationArn field's value. -func (s *CollaborationAnalysisTemplateSummary) SetCollaborationArn(v string) *CollaborationAnalysisTemplateSummary { - s.CollaborationArn = &v - return s -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *CollaborationAnalysisTemplateSummary) SetCollaborationId(v string) *CollaborationAnalysisTemplateSummary { - s.CollaborationId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *CollaborationAnalysisTemplateSummary) SetCreateTime(v time.Time) *CollaborationAnalysisTemplateSummary { - s.CreateTime = &v - return s -} - -// SetCreatorAccountId sets the CreatorAccountId field's value. -func (s *CollaborationAnalysisTemplateSummary) SetCreatorAccountId(v string) *CollaborationAnalysisTemplateSummary { - s.CreatorAccountId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CollaborationAnalysisTemplateSummary) SetDescription(v string) *CollaborationAnalysisTemplateSummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *CollaborationAnalysisTemplateSummary) SetId(v string) *CollaborationAnalysisTemplateSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CollaborationAnalysisTemplateSummary) SetName(v string) *CollaborationAnalysisTemplateSummary { - s.Name = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *CollaborationAnalysisTemplateSummary) SetUpdateTime(v time.Time) *CollaborationAnalysisTemplateSummary { - s.UpdateTime = &v - return s -} - -// The metadata of the collaboration. -type CollaborationSummary struct { - _ struct{} `type:"structure"` - - // The ARN of the collaboration. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time when the collaboration was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The identifier used to reference members of the collaboration. Currently - // only supports Amazon Web Services account ID. - // - // CreatorAccountId is a required field - CreatorAccountId *string `locationName:"creatorAccountId" min:"12" type:"string" required:"true"` - - // The display name of the collaboration creator. - // - // CreatorDisplayName is a required field - CreatorDisplayName *string `locationName:"creatorDisplayName" min:"1" type:"string" required:"true"` - - // The identifier for the collaboration. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The status of a member in a collaboration. - // - // MemberStatus is a required field - MemberStatus *string `locationName:"memberStatus" type:"string" required:"true" enum:"MemberStatus"` - - // The ARN of a member in a collaboration. - MembershipArn *string `locationName:"membershipArn" type:"string"` - - // The identifier of a member in a collaboration. - MembershipId *string `locationName:"membershipId" min:"36" type:"string"` - - // A human-readable identifier provided by the collaboration owner. Display - // names are not unique. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The time the collaboration metadata was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 CollaborationSummary) 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 CollaborationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CollaborationSummary) SetArn(v string) *CollaborationSummary { - s.Arn = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *CollaborationSummary) SetCreateTime(v time.Time) *CollaborationSummary { - s.CreateTime = &v - return s -} - -// SetCreatorAccountId sets the CreatorAccountId field's value. -func (s *CollaborationSummary) SetCreatorAccountId(v string) *CollaborationSummary { - s.CreatorAccountId = &v - return s -} - -// SetCreatorDisplayName sets the CreatorDisplayName field's value. -func (s *CollaborationSummary) SetCreatorDisplayName(v string) *CollaborationSummary { - s.CreatorDisplayName = &v - return s -} - -// SetId sets the Id field's value. -func (s *CollaborationSummary) SetId(v string) *CollaborationSummary { - s.Id = &v - return s -} - -// SetMemberStatus sets the MemberStatus field's value. -func (s *CollaborationSummary) SetMemberStatus(v string) *CollaborationSummary { - s.MemberStatus = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *CollaborationSummary) SetMembershipArn(v string) *CollaborationSummary { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *CollaborationSummary) SetMembershipId(v string) *CollaborationSummary { - s.MembershipId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CollaborationSummary) SetName(v string) *CollaborationSummary { - s.Name = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *CollaborationSummary) SetUpdateTime(v time.Time) *CollaborationSummary { - s.UpdateTime = &v - return s -} - -// A column within a schema relation, derived from the underlying Glue table. -type Column struct { - _ struct{} `type:"structure"` - - // The name of the column. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The type of the column. - // - // Type is a required field - Type *string `locationName:"type" 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 Column) 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 Column) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Column) SetName(v string) *Column { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *Column) SetType(v string) *Column { - s.Type = &v - return s -} - -// A table that has been configured for use in a collaboration. -type ConfiguredTable struct { - _ struct{} `type:"structure"` - - // The columns within the underlying Glue table that can be utilized within - // collaborations. - // - // AllowedColumns is a required field - AllowedColumns []*string `locationName:"allowedColumns" min:"1" type:"list" required:"true"` - - // The analysis method for the configured table. The only valid value is currently - // `DIRECT_QUERY`. - // - // AnalysisMethod is a required field - AnalysisMethod *string `locationName:"analysisMethod" type:"string" required:"true" enum:"AnalysisMethod"` - - // The types of analysis rules associated with this configured table. Currently, - // only one analysis rule may be associated with a configured table. - // - // AnalysisRuleTypes is a required field - AnalysisRuleTypes []*string `locationName:"analysisRuleTypes" type:"list" required:"true" enum:"ConfiguredTableAnalysisRuleType"` - - // The unique ARN for the configured table. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time the configured table was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // A description for the configured table. - Description *string `locationName:"description" type:"string"` - - // The unique ID for the configured table. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // A name for the configured table. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Glue table that this configured table represents. - // - // TableReference is a required field - TableReference *TableReference `locationName:"tableReference" type:"structure" required:"true"` - - // The time the configured table was last updated - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 ConfiguredTable) 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 ConfiguredTable) GoString() string { - return s.String() -} - -// SetAllowedColumns sets the AllowedColumns field's value. -func (s *ConfiguredTable) SetAllowedColumns(v []*string) *ConfiguredTable { - s.AllowedColumns = v - return s -} - -// SetAnalysisMethod sets the AnalysisMethod field's value. -func (s *ConfiguredTable) SetAnalysisMethod(v string) *ConfiguredTable { - s.AnalysisMethod = &v - return s -} - -// SetAnalysisRuleTypes sets the AnalysisRuleTypes field's value. -func (s *ConfiguredTable) SetAnalysisRuleTypes(v []*string) *ConfiguredTable { - s.AnalysisRuleTypes = v - return s -} - -// SetArn sets the Arn field's value. -func (s *ConfiguredTable) SetArn(v string) *ConfiguredTable { - s.Arn = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *ConfiguredTable) SetCreateTime(v time.Time) *ConfiguredTable { - s.CreateTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ConfiguredTable) SetDescription(v string) *ConfiguredTable { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *ConfiguredTable) SetId(v string) *ConfiguredTable { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *ConfiguredTable) SetName(v string) *ConfiguredTable { - s.Name = &v - return s -} - -// SetTableReference sets the TableReference field's value. -func (s *ConfiguredTable) SetTableReference(v *TableReference) *ConfiguredTable { - s.TableReference = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *ConfiguredTable) SetUpdateTime(v time.Time) *ConfiguredTable { - s.UpdateTime = &v - return s -} - -// A configured table analysis rule, which limits how data for this table can -// be used. -type ConfiguredTableAnalysisRule struct { - _ struct{} `type:"structure"` - - // The unique ARN for the configured table. - // - // ConfiguredTableArn is a required field - ConfiguredTableArn *string `locationName:"configuredTableArn" type:"string" required:"true"` - - // The unique ID for the configured table. - // - // ConfiguredTableId is a required field - ConfiguredTableId *string `locationName:"configuredTableId" min:"36" type:"string" required:"true"` - - // The time the configured table analysis rule was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The policy that controls SQL query rules. - // - // Policy is a required field - Policy *ConfiguredTableAnalysisRulePolicy `locationName:"policy" type:"structure" required:"true"` - - // The type of configured table analysis rule. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"ConfiguredTableAnalysisRuleType"` - - // The time the configured table analysis rule was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 ConfiguredTableAnalysisRule) 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 ConfiguredTableAnalysisRule) GoString() string { - return s.String() -} - -// SetConfiguredTableArn sets the ConfiguredTableArn field's value. -func (s *ConfiguredTableAnalysisRule) SetConfiguredTableArn(v string) *ConfiguredTableAnalysisRule { - s.ConfiguredTableArn = &v - return s -} - -// SetConfiguredTableId sets the ConfiguredTableId field's value. -func (s *ConfiguredTableAnalysisRule) SetConfiguredTableId(v string) *ConfiguredTableAnalysisRule { - s.ConfiguredTableId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *ConfiguredTableAnalysisRule) SetCreateTime(v time.Time) *ConfiguredTableAnalysisRule { - s.CreateTime = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *ConfiguredTableAnalysisRule) SetPolicy(v *ConfiguredTableAnalysisRulePolicy) *ConfiguredTableAnalysisRule { - s.Policy = v - return s -} - -// SetType sets the Type field's value. -func (s *ConfiguredTableAnalysisRule) SetType(v string) *ConfiguredTableAnalysisRule { - s.Type = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *ConfiguredTableAnalysisRule) SetUpdateTime(v time.Time) *ConfiguredTableAnalysisRule { - s.UpdateTime = &v - return s -} - -// Controls on the query specifications that can be run on a configured table. -type ConfiguredTableAnalysisRulePolicy struct { - _ struct{} `type:"structure"` - - // Controls on the query specifications that can be run on a configured table. - V1 *ConfiguredTableAnalysisRulePolicyV1 `locationName:"v1" 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 ConfiguredTableAnalysisRulePolicy) 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 ConfiguredTableAnalysisRulePolicy) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfiguredTableAnalysisRulePolicy) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfiguredTableAnalysisRulePolicy"} - if s.V1 != nil { - if err := s.V1.Validate(); err != nil { - invalidParams.AddNested("V1", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetV1 sets the V1 field's value. -func (s *ConfiguredTableAnalysisRulePolicy) SetV1(v *ConfiguredTableAnalysisRulePolicyV1) *ConfiguredTableAnalysisRulePolicy { - s.V1 = v - return s -} - -// Controls on the query specifications that can be run on a configured table. -type ConfiguredTableAnalysisRulePolicyV1 struct { - _ struct{} `type:"structure"` - - // Analysis rule type that enables only aggregation queries on a configured - // table. - Aggregation *AnalysisRuleAggregation `locationName:"aggregation" type:"structure"` - - // A type of analysis rule that enables the table owner to approve custom SQL - // queries on their configured tables. - Custom *AnalysisRuleCustom `locationName:"custom" type:"structure"` - - // Analysis rule type that enables only list queries on a configured table. - List *AnalysisRuleList `locationName:"list" 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 ConfiguredTableAnalysisRulePolicyV1) 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 ConfiguredTableAnalysisRulePolicyV1) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfiguredTableAnalysisRulePolicyV1) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfiguredTableAnalysisRulePolicyV1"} - if s.Aggregation != nil { - if err := s.Aggregation.Validate(); err != nil { - invalidParams.AddNested("Aggregation", err.(request.ErrInvalidParams)) - } - } - if s.Custom != nil { - if err := s.Custom.Validate(); err != nil { - invalidParams.AddNested("Custom", err.(request.ErrInvalidParams)) - } - } - if s.List != nil { - if err := s.List.Validate(); err != nil { - invalidParams.AddNested("List", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAggregation sets the Aggregation field's value. -func (s *ConfiguredTableAnalysisRulePolicyV1) SetAggregation(v *AnalysisRuleAggregation) *ConfiguredTableAnalysisRulePolicyV1 { - s.Aggregation = v - return s -} - -// SetCustom sets the Custom field's value. -func (s *ConfiguredTableAnalysisRulePolicyV1) SetCustom(v *AnalysisRuleCustom) *ConfiguredTableAnalysisRulePolicyV1 { - s.Custom = v - return s -} - -// SetList sets the List field's value. -func (s *ConfiguredTableAnalysisRulePolicyV1) SetList(v *AnalysisRuleList) *ConfiguredTableAnalysisRulePolicyV1 { - s.List = v - return s -} - -// A configured table association links a configured table to a collaboration. -type ConfiguredTableAssociation struct { - _ struct{} `type:"structure"` - - // The unique ARN for the configured table association. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The unique ARN for the configured table that the association refers to. - // - // ConfiguredTableArn is a required field - ConfiguredTableArn *string `locationName:"configuredTableArn" type:"string" required:"true"` - - // The unique ID for the configured table that the association refers to. - // - // ConfiguredTableId is a required field - ConfiguredTableId *string `locationName:"configuredTableId" min:"36" type:"string" required:"true"` - - // The time the configured table association was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // A description of the configured table association. - Description *string `locationName:"description" type:"string"` - - // The unique ID for the configured table association. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The unique ARN for the membership this configured table association belongs - // to. - // - // MembershipArn is a required field - MembershipArn *string `locationName:"membershipArn" type:"string" required:"true"` - - // The unique ID for the membership this configured table association belongs - // to. - // - // MembershipId is a required field - MembershipId *string `locationName:"membershipId" min:"36" type:"string" required:"true"` - - // The name of the configured table association, in lowercase. The table is - // identified by this name when running protected queries against the underlying - // data. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The service will assume this role to access catalog metadata and query the - // table. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"32" type:"string" required:"true"` - - // The time the configured table association was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 ConfiguredTableAssociation) 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 ConfiguredTableAssociation) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ConfiguredTableAssociation) SetArn(v string) *ConfiguredTableAssociation { - s.Arn = &v - return s -} - -// SetConfiguredTableArn sets the ConfiguredTableArn field's value. -func (s *ConfiguredTableAssociation) SetConfiguredTableArn(v string) *ConfiguredTableAssociation { - s.ConfiguredTableArn = &v - return s -} - -// SetConfiguredTableId sets the ConfiguredTableId field's value. -func (s *ConfiguredTableAssociation) SetConfiguredTableId(v string) *ConfiguredTableAssociation { - s.ConfiguredTableId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *ConfiguredTableAssociation) SetCreateTime(v time.Time) *ConfiguredTableAssociation { - s.CreateTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ConfiguredTableAssociation) SetDescription(v string) *ConfiguredTableAssociation { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *ConfiguredTableAssociation) SetId(v string) *ConfiguredTableAssociation { - s.Id = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *ConfiguredTableAssociation) SetMembershipArn(v string) *ConfiguredTableAssociation { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *ConfiguredTableAssociation) SetMembershipId(v string) *ConfiguredTableAssociation { - s.MembershipId = &v - return s -} - -// SetName sets the Name field's value. -func (s *ConfiguredTableAssociation) SetName(v string) *ConfiguredTableAssociation { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *ConfiguredTableAssociation) SetRoleArn(v string) *ConfiguredTableAssociation { - s.RoleArn = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *ConfiguredTableAssociation) SetUpdateTime(v time.Time) *ConfiguredTableAssociation { - s.UpdateTime = &v - return s -} - -// The configured table association summary for the objects listed by the request. -type ConfiguredTableAssociationSummary struct { - _ struct{} `type:"structure"` - - // The unique ARN for the configured table association. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The unique configured table ID that this configured table association refers - // to. - // - // ConfiguredTableId is a required field - ConfiguredTableId *string `locationName:"configuredTableId" min:"36" type:"string" required:"true"` - - // The time the configured table association was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The unique ID for the configured table association. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The unique ARN for the membership that the configured table association belongs - // to. - // - // MembershipArn is a required field - MembershipArn *string `locationName:"membershipArn" type:"string" required:"true"` - - // The unique ID for the membership that the configured table association belongs - // to. - // - // MembershipId is a required field - MembershipId *string `locationName:"membershipId" min:"36" type:"string" required:"true"` - - // The name of the configured table association. The table is identified by - // this name when running Protected Queries against the underlying data. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The time the configured table association was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 ConfiguredTableAssociationSummary) 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 ConfiguredTableAssociationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ConfiguredTableAssociationSummary) SetArn(v string) *ConfiguredTableAssociationSummary { - s.Arn = &v - return s -} - -// SetConfiguredTableId sets the ConfiguredTableId field's value. -func (s *ConfiguredTableAssociationSummary) SetConfiguredTableId(v string) *ConfiguredTableAssociationSummary { - s.ConfiguredTableId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *ConfiguredTableAssociationSummary) SetCreateTime(v time.Time) *ConfiguredTableAssociationSummary { - s.CreateTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *ConfiguredTableAssociationSummary) SetId(v string) *ConfiguredTableAssociationSummary { - s.Id = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *ConfiguredTableAssociationSummary) SetMembershipArn(v string) *ConfiguredTableAssociationSummary { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *ConfiguredTableAssociationSummary) SetMembershipId(v string) *ConfiguredTableAssociationSummary { - s.MembershipId = &v - return s -} - -// SetName sets the Name field's value. -func (s *ConfiguredTableAssociationSummary) SetName(v string) *ConfiguredTableAssociationSummary { - s.Name = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *ConfiguredTableAssociationSummary) SetUpdateTime(v time.Time) *ConfiguredTableAssociationSummary { - s.UpdateTime = &v - return s -} - -// The configured table summary for the objects listed by the request. -type ConfiguredTableSummary struct { - _ struct{} `type:"structure"` - - // The analysis method for the configured tables. The only valid value is currently - // `DIRECT_QUERY`. - // - // AnalysisMethod is a required field - AnalysisMethod *string `locationName:"analysisMethod" type:"string" required:"true" enum:"AnalysisMethod"` - - // The types of analysis rules associated with this configured table. - // - // AnalysisRuleTypes is a required field - AnalysisRuleTypes []*string `locationName:"analysisRuleTypes" type:"list" required:"true" enum:"ConfiguredTableAnalysisRuleType"` - - // The unique ARN of the configured table. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time the configured table was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The unique ID of the configured table. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The name of the configured table. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The time the configured table was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 ConfiguredTableSummary) 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 ConfiguredTableSummary) GoString() string { - return s.String() -} - -// SetAnalysisMethod sets the AnalysisMethod field's value. -func (s *ConfiguredTableSummary) SetAnalysisMethod(v string) *ConfiguredTableSummary { - s.AnalysisMethod = &v - return s -} - -// SetAnalysisRuleTypes sets the AnalysisRuleTypes field's value. -func (s *ConfiguredTableSummary) SetAnalysisRuleTypes(v []*string) *ConfiguredTableSummary { - s.AnalysisRuleTypes = v - return s -} - -// SetArn sets the Arn field's value. -func (s *ConfiguredTableSummary) SetArn(v string) *ConfiguredTableSummary { - s.Arn = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *ConfiguredTableSummary) SetCreateTime(v time.Time) *ConfiguredTableSummary { - s.CreateTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *ConfiguredTableSummary) SetId(v string) *ConfiguredTableSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *ConfiguredTableSummary) SetName(v string) *ConfiguredTableSummary { - s.Name = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *ConfiguredTableSummary) SetUpdateTime(v time.Time) *ConfiguredTableSummary { - s.UpdateTime = &v - return s -} - -// Updating or deleting a resource can cause an inconsistent state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A reason code for the exception. - Reason *string `locationName:"reason" type:"string" enum:"ConflictExceptionReason"` - - // The ID of the conflicting resource. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of the conflicting resource. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` -} - -// 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateAnalysisTemplateInput struct { - _ struct{} `type:"structure"` - - // The parameters of the analysis template. - AnalysisParameters []*AnalysisParameter `locationName:"analysisParameters" type:"list"` - - // The description of the analysis template. - Description *string `locationName:"description" type:"string"` - - // The format of the analysis template. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true" enum:"AnalysisFormat"` - - // The identifier for a membership resource. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The name of the analysis template. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The information in the analysis template. Currently supports text, the query - // text for the analysis template. - // - // Source is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAnalysisTemplateInput's - // String and GoString methods. - // - // Source is a required field - Source *AnalysisSource `locationName:"source" type:"structure" required:"true" sensitive:"true"` - - // An optional label that you can assign to a resource when you create it. Each - // tag consists of a key and an optional value, both of which you define. When - // you use tagging, you can also use tag-based access control in IAM policies - // to control access to this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateAnalysisTemplateInput) 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 CreateAnalysisTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAnalysisTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAnalysisTemplateInput"} - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.AnalysisParameters != nil { - for i, v := range s.AnalysisParameters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AnalysisParameters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisParameters sets the AnalysisParameters field's value. -func (s *CreateAnalysisTemplateInput) SetAnalysisParameters(v []*AnalysisParameter) *CreateAnalysisTemplateInput { - s.AnalysisParameters = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAnalysisTemplateInput) SetDescription(v string) *CreateAnalysisTemplateInput { - s.Description = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *CreateAnalysisTemplateInput) SetFormat(v string) *CreateAnalysisTemplateInput { - s.Format = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *CreateAnalysisTemplateInput) SetMembershipIdentifier(v string) *CreateAnalysisTemplateInput { - s.MembershipIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAnalysisTemplateInput) SetName(v string) *CreateAnalysisTemplateInput { - s.Name = &v - return s -} - -// SetSource sets the Source field's value. -func (s *CreateAnalysisTemplateInput) SetSource(v *AnalysisSource) *CreateAnalysisTemplateInput { - s.Source = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAnalysisTemplateInput) SetTags(v map[string]*string) *CreateAnalysisTemplateInput { - s.Tags = v - return s -} - -type CreateAnalysisTemplateOutput struct { - _ struct{} `type:"structure"` - - // The analysis template. - // - // AnalysisTemplate is a required field - AnalysisTemplate *AnalysisTemplate `locationName:"analysisTemplate" type:"structure" 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 CreateAnalysisTemplateOutput) 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 CreateAnalysisTemplateOutput) GoString() string { - return s.String() -} - -// SetAnalysisTemplate sets the AnalysisTemplate field's value. -func (s *CreateAnalysisTemplateOutput) SetAnalysisTemplate(v *AnalysisTemplate) *CreateAnalysisTemplateOutput { - s.AnalysisTemplate = v - return s -} - -type CreateCollaborationInput struct { - _ struct{} `type:"structure"` - - // The display name of the collaboration creator. - // - // CreatorDisplayName is a required field - CreatorDisplayName *string `locationName:"creatorDisplayName" min:"1" type:"string" required:"true"` - - // The abilities granted to the collaboration creator. - // - // CreatorMemberAbilities is a required field - CreatorMemberAbilities []*string `locationName:"creatorMemberAbilities" type:"list" required:"true" enum:"MemberAbility"` - - // The collaboration creator's payment responsibilities set by the collaboration - // creator. - // - // If the collaboration creator hasn't specified anyone as the member paying - // for query compute costs, then the member who can query is the default payer. - CreatorPaymentConfiguration *PaymentConfiguration `locationName:"creatorPaymentConfiguration" type:"structure"` - - // The settings for client-side encryption with Cryptographic Computing for - // Clean Rooms. - DataEncryptionMetadata *DataEncryptionMetadata `locationName:"dataEncryptionMetadata" type:"structure"` - - // A description of the collaboration provided by the collaboration owner. - // - // Description is a required field - Description *string `locationName:"description" min:"1" type:"string" required:"true"` - - // A list of initial members, not including the creator. This list is immutable. - // - // Members is a required field - Members []*MemberSpecification `locationName:"members" type:"list" required:"true"` - - // The display name for a collaboration. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // An indicator as to whether query logging has been enabled or disabled for - // the collaboration. - // - // QueryLogStatus is a required field - QueryLogStatus *string `locationName:"queryLogStatus" type:"string" required:"true" enum:"CollaborationQueryLogStatus"` - - // An optional label that you can assign to a resource when you create it. Each - // tag consists of a key and an optional value, both of which you define. When - // you use tagging, you can also use tag-based access control in IAM policies - // to control access to this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateCollaborationInput) 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 CreateCollaborationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCollaborationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCollaborationInput"} - if s.CreatorDisplayName == nil { - invalidParams.Add(request.NewErrParamRequired("CreatorDisplayName")) - } - if s.CreatorDisplayName != nil && len(*s.CreatorDisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CreatorDisplayName", 1)) - } - if s.CreatorMemberAbilities == nil { - invalidParams.Add(request.NewErrParamRequired("CreatorMemberAbilities")) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Members == nil { - invalidParams.Add(request.NewErrParamRequired("Members")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.QueryLogStatus == nil { - invalidParams.Add(request.NewErrParamRequired("QueryLogStatus")) - } - if s.CreatorPaymentConfiguration != nil { - if err := s.CreatorPaymentConfiguration.Validate(); err != nil { - invalidParams.AddNested("CreatorPaymentConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.DataEncryptionMetadata != nil { - if err := s.DataEncryptionMetadata.Validate(); err != nil { - invalidParams.AddNested("DataEncryptionMetadata", err.(request.ErrInvalidParams)) - } - } - if s.Members != nil { - for i, v := range s.Members { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Members", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreatorDisplayName sets the CreatorDisplayName field's value. -func (s *CreateCollaborationInput) SetCreatorDisplayName(v string) *CreateCollaborationInput { - s.CreatorDisplayName = &v - return s -} - -// SetCreatorMemberAbilities sets the CreatorMemberAbilities field's value. -func (s *CreateCollaborationInput) SetCreatorMemberAbilities(v []*string) *CreateCollaborationInput { - s.CreatorMemberAbilities = v - return s -} - -// SetCreatorPaymentConfiguration sets the CreatorPaymentConfiguration field's value. -func (s *CreateCollaborationInput) SetCreatorPaymentConfiguration(v *PaymentConfiguration) *CreateCollaborationInput { - s.CreatorPaymentConfiguration = v - return s -} - -// SetDataEncryptionMetadata sets the DataEncryptionMetadata field's value. -func (s *CreateCollaborationInput) SetDataEncryptionMetadata(v *DataEncryptionMetadata) *CreateCollaborationInput { - s.DataEncryptionMetadata = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateCollaborationInput) SetDescription(v string) *CreateCollaborationInput { - s.Description = &v - return s -} - -// SetMembers sets the Members field's value. -func (s *CreateCollaborationInput) SetMembers(v []*MemberSpecification) *CreateCollaborationInput { - s.Members = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateCollaborationInput) SetName(v string) *CreateCollaborationInput { - s.Name = &v - return s -} - -// SetQueryLogStatus sets the QueryLogStatus field's value. -func (s *CreateCollaborationInput) SetQueryLogStatus(v string) *CreateCollaborationInput { - s.QueryLogStatus = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateCollaborationInput) SetTags(v map[string]*string) *CreateCollaborationInput { - s.Tags = v - return s -} - -type CreateCollaborationOutput struct { - _ struct{} `type:"structure"` - - // The entire created collaboration object. - // - // Collaboration is a required field - Collaboration *Collaboration `locationName:"collaboration" type:"structure" 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 CreateCollaborationOutput) 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 CreateCollaborationOutput) GoString() string { - return s.String() -} - -// SetCollaboration sets the Collaboration field's value. -func (s *CreateCollaborationOutput) SetCollaboration(v *Collaboration) *CreateCollaborationOutput { - s.Collaboration = v - return s -} - -type CreateConfiguredTableAnalysisRuleInput struct { - _ struct{} `type:"structure"` - - // The entire created configured table analysis rule object. - // - // AnalysisRulePolicy is a required field - AnalysisRulePolicy *ConfiguredTableAnalysisRulePolicy `locationName:"analysisRulePolicy" type:"structure" required:"true"` - - // The type of analysis rule. - // - // AnalysisRuleType is a required field - AnalysisRuleType *string `locationName:"analysisRuleType" type:"string" required:"true" enum:"ConfiguredTableAnalysisRuleType"` - - // The identifier for the configured table to create the analysis rule for. - // Currently accepts the configured table ID. - // - // ConfiguredTableIdentifier is a required field - ConfiguredTableIdentifier *string `location:"uri" locationName:"configuredTableIdentifier" min:"36" 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 CreateConfiguredTableAnalysisRuleInput) 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 CreateConfiguredTableAnalysisRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateConfiguredTableAnalysisRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateConfiguredTableAnalysisRuleInput"} - if s.AnalysisRulePolicy == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisRulePolicy")) - } - if s.AnalysisRuleType == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisRuleType")) - } - if s.ConfiguredTableIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableIdentifier")) - } - if s.ConfiguredTableIdentifier != nil && len(*s.ConfiguredTableIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableIdentifier", 36)) - } - if s.AnalysisRulePolicy != nil { - if err := s.AnalysisRulePolicy.Validate(); err != nil { - invalidParams.AddNested("AnalysisRulePolicy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisRulePolicy sets the AnalysisRulePolicy field's value. -func (s *CreateConfiguredTableAnalysisRuleInput) SetAnalysisRulePolicy(v *ConfiguredTableAnalysisRulePolicy) *CreateConfiguredTableAnalysisRuleInput { - s.AnalysisRulePolicy = v - return s -} - -// SetAnalysisRuleType sets the AnalysisRuleType field's value. -func (s *CreateConfiguredTableAnalysisRuleInput) SetAnalysisRuleType(v string) *CreateConfiguredTableAnalysisRuleInput { - s.AnalysisRuleType = &v - return s -} - -// SetConfiguredTableIdentifier sets the ConfiguredTableIdentifier field's value. -func (s *CreateConfiguredTableAnalysisRuleInput) SetConfiguredTableIdentifier(v string) *CreateConfiguredTableAnalysisRuleInput { - s.ConfiguredTableIdentifier = &v - return s -} - -type CreateConfiguredTableAnalysisRuleOutput struct { - _ struct{} `type:"structure"` - - // The entire created analysis rule. - // - // AnalysisRule is a required field - AnalysisRule *ConfiguredTableAnalysisRule `locationName:"analysisRule" type:"structure" 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 CreateConfiguredTableAnalysisRuleOutput) 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 CreateConfiguredTableAnalysisRuleOutput) GoString() string { - return s.String() -} - -// SetAnalysisRule sets the AnalysisRule field's value. -func (s *CreateConfiguredTableAnalysisRuleOutput) SetAnalysisRule(v *ConfiguredTableAnalysisRule) *CreateConfiguredTableAnalysisRuleOutput { - s.AnalysisRule = v - return s -} - -type CreateConfiguredTableAssociationInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the configured table to be associated to. Currently - // accepts a configured table ID. - // - // ConfiguredTableIdentifier is a required field - ConfiguredTableIdentifier *string `locationName:"configuredTableIdentifier" min:"36" type:"string" required:"true"` - - // A description for the configured table association. - Description *string `locationName:"description" type:"string"` - - // A unique identifier for one of your memberships for a collaboration. The - // configured table is associated to the collaboration that this membership - // belongs to. Currently accepts a membership ID. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The name of the configured table association. This name is used to query - // the underlying configured table. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The service will assume this role to access catalog metadata and query the - // table. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"32" type:"string" required:"true"` - - // An optional label that you can assign to a resource when you create it. Each - // tag consists of a key and an optional value, both of which you define. When - // you use tagging, you can also use tag-based access control in IAM policies - // to control access to this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateConfiguredTableAssociationInput) 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 CreateConfiguredTableAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateConfiguredTableAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateConfiguredTableAssociationInput"} - if s.ConfiguredTableIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableIdentifier")) - } - if s.ConfiguredTableIdentifier != nil && len(*s.ConfiguredTableIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableIdentifier", 36)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 32)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguredTableIdentifier sets the ConfiguredTableIdentifier field's value. -func (s *CreateConfiguredTableAssociationInput) SetConfiguredTableIdentifier(v string) *CreateConfiguredTableAssociationInput { - s.ConfiguredTableIdentifier = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateConfiguredTableAssociationInput) SetDescription(v string) *CreateConfiguredTableAssociationInput { - s.Description = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *CreateConfiguredTableAssociationInput) SetMembershipIdentifier(v string) *CreateConfiguredTableAssociationInput { - s.MembershipIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateConfiguredTableAssociationInput) SetName(v string) *CreateConfiguredTableAssociationInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateConfiguredTableAssociationInput) SetRoleArn(v string) *CreateConfiguredTableAssociationInput { - s.RoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateConfiguredTableAssociationInput) SetTags(v map[string]*string) *CreateConfiguredTableAssociationInput { - s.Tags = v - return s -} - -type CreateConfiguredTableAssociationOutput struct { - _ struct{} `type:"structure"` - - // The entire configured table association object. - // - // ConfiguredTableAssociation is a required field - ConfiguredTableAssociation *ConfiguredTableAssociation `locationName:"configuredTableAssociation" type:"structure" 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 CreateConfiguredTableAssociationOutput) 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 CreateConfiguredTableAssociationOutput) GoString() string { - return s.String() -} - -// SetConfiguredTableAssociation sets the ConfiguredTableAssociation field's value. -func (s *CreateConfiguredTableAssociationOutput) SetConfiguredTableAssociation(v *ConfiguredTableAssociation) *CreateConfiguredTableAssociationOutput { - s.ConfiguredTableAssociation = v - return s -} - -type CreateConfiguredTableInput struct { - _ struct{} `type:"structure"` - - // The columns of the underlying table that can be used by collaborations or - // analysis rules. - // - // AllowedColumns is a required field - AllowedColumns []*string `locationName:"allowedColumns" min:"1" type:"list" required:"true"` - - // The analysis method for the configured tables. The only valid value is currently - // `DIRECT_QUERY`. - // - // AnalysisMethod is a required field - AnalysisMethod *string `locationName:"analysisMethod" type:"string" required:"true" enum:"AnalysisMethod"` - - // A description for the configured table. - Description *string `locationName:"description" type:"string"` - - // The name of the configured table. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A reference to the Glue table being configured. - // - // TableReference is a required field - TableReference *TableReference `locationName:"tableReference" type:"structure" required:"true"` - - // An optional label that you can assign to a resource when you create it. Each - // tag consists of a key and an optional value, both of which you define. When - // you use tagging, you can also use tag-based access control in IAM policies - // to control access to this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateConfiguredTableInput) 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 CreateConfiguredTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateConfiguredTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateConfiguredTableInput"} - if s.AllowedColumns == nil { - invalidParams.Add(request.NewErrParamRequired("AllowedColumns")) - } - if s.AllowedColumns != nil && len(s.AllowedColumns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AllowedColumns", 1)) - } - if s.AnalysisMethod == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisMethod")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TableReference == nil { - invalidParams.Add(request.NewErrParamRequired("TableReference")) - } - if s.TableReference != nil { - if err := s.TableReference.Validate(); err != nil { - invalidParams.AddNested("TableReference", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedColumns sets the AllowedColumns field's value. -func (s *CreateConfiguredTableInput) SetAllowedColumns(v []*string) *CreateConfiguredTableInput { - s.AllowedColumns = v - return s -} - -// SetAnalysisMethod sets the AnalysisMethod field's value. -func (s *CreateConfiguredTableInput) SetAnalysisMethod(v string) *CreateConfiguredTableInput { - s.AnalysisMethod = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateConfiguredTableInput) SetDescription(v string) *CreateConfiguredTableInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateConfiguredTableInput) SetName(v string) *CreateConfiguredTableInput { - s.Name = &v - return s -} - -// SetTableReference sets the TableReference field's value. -func (s *CreateConfiguredTableInput) SetTableReference(v *TableReference) *CreateConfiguredTableInput { - s.TableReference = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateConfiguredTableInput) SetTags(v map[string]*string) *CreateConfiguredTableInput { - s.Tags = v - return s -} - -type CreateConfiguredTableOutput struct { - _ struct{} `type:"structure"` - - // The created configured table. - // - // ConfiguredTable is a required field - ConfiguredTable *ConfiguredTable `locationName:"configuredTable" type:"structure" 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 CreateConfiguredTableOutput) 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 CreateConfiguredTableOutput) GoString() string { - return s.String() -} - -// SetConfiguredTable sets the ConfiguredTable field's value. -func (s *CreateConfiguredTableOutput) SetConfiguredTable(v *ConfiguredTable) *CreateConfiguredTableOutput { - s.ConfiguredTable = v - return s -} - -type CreateMembershipInput struct { - _ struct{} `type:"structure"` - - // The unique ID for the associated collaboration. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `locationName:"collaborationIdentifier" min:"36" type:"string" required:"true"` - - // The default protected query result configuration as specified by the member - // who can receive results. - DefaultResultConfiguration *MembershipProtectedQueryResultConfiguration `locationName:"defaultResultConfiguration" type:"structure"` - - // The payment responsibilities accepted by the collaboration member. - // - // Not required if the collaboration member has the member ability to run queries. - // - // Required if the collaboration member doesn't have the member ability to run - // queries but is configured as a payer by the collaboration creator. - PaymentConfiguration *MembershipPaymentConfiguration `locationName:"paymentConfiguration" type:"structure"` - - // An indicator as to whether query logging has been enabled or disabled for - // the membership. - // - // QueryLogStatus is a required field - QueryLogStatus *string `locationName:"queryLogStatus" type:"string" required:"true" enum:"MembershipQueryLogStatus"` - - // An optional label that you can assign to a resource when you create it. Each - // tag consists of a key and an optional value, both of which you define. When - // you use tagging, you can also use tag-based access control in IAM policies - // to control access to this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateMembershipInput) 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 CreateMembershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMembershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMembershipInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - if s.QueryLogStatus == nil { - invalidParams.Add(request.NewErrParamRequired("QueryLogStatus")) - } - if s.DefaultResultConfiguration != nil { - if err := s.DefaultResultConfiguration.Validate(); err != nil { - invalidParams.AddNested("DefaultResultConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.PaymentConfiguration != nil { - if err := s.PaymentConfiguration.Validate(); err != nil { - invalidParams.AddNested("PaymentConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *CreateMembershipInput) SetCollaborationIdentifier(v string) *CreateMembershipInput { - s.CollaborationIdentifier = &v - return s -} - -// SetDefaultResultConfiguration sets the DefaultResultConfiguration field's value. -func (s *CreateMembershipInput) SetDefaultResultConfiguration(v *MembershipProtectedQueryResultConfiguration) *CreateMembershipInput { - s.DefaultResultConfiguration = v - return s -} - -// SetPaymentConfiguration sets the PaymentConfiguration field's value. -func (s *CreateMembershipInput) SetPaymentConfiguration(v *MembershipPaymentConfiguration) *CreateMembershipInput { - s.PaymentConfiguration = v - return s -} - -// SetQueryLogStatus sets the QueryLogStatus field's value. -func (s *CreateMembershipInput) SetQueryLogStatus(v string) *CreateMembershipInput { - s.QueryLogStatus = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateMembershipInput) SetTags(v map[string]*string) *CreateMembershipInput { - s.Tags = v - return s -} - -type CreateMembershipOutput struct { - _ struct{} `type:"structure"` - - // The membership that was created. - // - // Membership is a required field - Membership *Membership `locationName:"membership" type:"structure" 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 CreateMembershipOutput) 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 CreateMembershipOutput) GoString() string { - return s.String() -} - -// SetMembership sets the Membership field's value. -func (s *CreateMembershipOutput) SetMembership(v *Membership) *CreateMembershipOutput { - s.Membership = v - return s -} - -// The settings for client-side encryption for cryptographic computing. -type DataEncryptionMetadata struct { - _ struct{} `type:"structure"` - - // Indicates whether encrypted tables can contain cleartext data (TRUE) or are - // to cryptographically process every column (FALSE). - // - // AllowCleartext is a required field - AllowCleartext *bool `locationName:"allowCleartext" type:"boolean" required:"true"` - - // Indicates whether Fingerprint columns can contain duplicate entries (TRUE) - // or are to contain only non-repeated values (FALSE). - // - // AllowDuplicates is a required field - AllowDuplicates *bool `locationName:"allowDuplicates" type:"boolean" required:"true"` - - // Indicates whether Fingerprint columns can be joined on any other Fingerprint - // column with a different name (TRUE) or can only be joined on Fingerprint - // columns of the same name (FALSE). - // - // AllowJoinsOnColumnsWithDifferentNames is a required field - AllowJoinsOnColumnsWithDifferentNames *bool `locationName:"allowJoinsOnColumnsWithDifferentNames" type:"boolean" required:"true"` - - // Indicates whether NULL values are to be copied as NULL to encrypted tables - // (TRUE) or cryptographically processed (FALSE). - // - // PreserveNulls is a required field - PreserveNulls *bool `locationName:"preserveNulls" type:"boolean" 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 DataEncryptionMetadata) 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 DataEncryptionMetadata) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataEncryptionMetadata) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataEncryptionMetadata"} - if s.AllowCleartext == nil { - invalidParams.Add(request.NewErrParamRequired("AllowCleartext")) - } - if s.AllowDuplicates == nil { - invalidParams.Add(request.NewErrParamRequired("AllowDuplicates")) - } - if s.AllowJoinsOnColumnsWithDifferentNames == nil { - invalidParams.Add(request.NewErrParamRequired("AllowJoinsOnColumnsWithDifferentNames")) - } - if s.PreserveNulls == nil { - invalidParams.Add(request.NewErrParamRequired("PreserveNulls")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowCleartext sets the AllowCleartext field's value. -func (s *DataEncryptionMetadata) SetAllowCleartext(v bool) *DataEncryptionMetadata { - s.AllowCleartext = &v - return s -} - -// SetAllowDuplicates sets the AllowDuplicates field's value. -func (s *DataEncryptionMetadata) SetAllowDuplicates(v bool) *DataEncryptionMetadata { - s.AllowDuplicates = &v - return s -} - -// SetAllowJoinsOnColumnsWithDifferentNames sets the AllowJoinsOnColumnsWithDifferentNames field's value. -func (s *DataEncryptionMetadata) SetAllowJoinsOnColumnsWithDifferentNames(v bool) *DataEncryptionMetadata { - s.AllowJoinsOnColumnsWithDifferentNames = &v - return s -} - -// SetPreserveNulls sets the PreserveNulls field's value. -func (s *DataEncryptionMetadata) SetPreserveNulls(v bool) *DataEncryptionMetadata { - s.PreserveNulls = &v - return s -} - -type DeleteAnalysisTemplateInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for the analysis template resource. - // - // AnalysisTemplateIdentifier is a required field - AnalysisTemplateIdentifier *string `location:"uri" locationName:"analysisTemplateIdentifier" min:"36" type:"string" required:"true"` - - // The identifier for a membership resource. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" 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 DeleteAnalysisTemplateInput) 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 DeleteAnalysisTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAnalysisTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAnalysisTemplateInput"} - if s.AnalysisTemplateIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisTemplateIdentifier")) - } - if s.AnalysisTemplateIdentifier != nil && len(*s.AnalysisTemplateIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("AnalysisTemplateIdentifier", 36)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisTemplateIdentifier sets the AnalysisTemplateIdentifier field's value. -func (s *DeleteAnalysisTemplateInput) SetAnalysisTemplateIdentifier(v string) *DeleteAnalysisTemplateInput { - s.AnalysisTemplateIdentifier = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *DeleteAnalysisTemplateInput) SetMembershipIdentifier(v string) *DeleteAnalysisTemplateInput { - s.MembershipIdentifier = &v - return s -} - -type DeleteAnalysisTemplateOutput 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 DeleteAnalysisTemplateOutput) 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 DeleteAnalysisTemplateOutput) GoString() string { - return s.String() -} - -type DeleteCollaborationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for the collaboration. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" 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 DeleteCollaborationInput) 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 DeleteCollaborationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCollaborationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCollaborationInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *DeleteCollaborationInput) SetCollaborationIdentifier(v string) *DeleteCollaborationInput { - s.CollaborationIdentifier = &v - return s -} - -type DeleteCollaborationOutput 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 DeleteCollaborationOutput) 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 DeleteCollaborationOutput) GoString() string { - return s.String() -} - -type DeleteConfiguredTableAnalysisRuleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The analysis rule type to be deleted. Configured table analysis rules are - // uniquely identified by their configured table identifier and analysis rule - // type. - // - // AnalysisRuleType is a required field - AnalysisRuleType *string `location:"uri" locationName:"analysisRuleType" type:"string" required:"true" enum:"ConfiguredTableAnalysisRuleType"` - - // The unique identifier for the configured table that the analysis rule applies - // to. Currently accepts the configured table ID. - // - // ConfiguredTableIdentifier is a required field - ConfiguredTableIdentifier *string `location:"uri" locationName:"configuredTableIdentifier" min:"36" 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 DeleteConfiguredTableAnalysisRuleInput) 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 DeleteConfiguredTableAnalysisRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfiguredTableAnalysisRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfiguredTableAnalysisRuleInput"} - if s.AnalysisRuleType == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisRuleType")) - } - if s.AnalysisRuleType != nil && len(*s.AnalysisRuleType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AnalysisRuleType", 1)) - } - if s.ConfiguredTableIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableIdentifier")) - } - if s.ConfiguredTableIdentifier != nil && len(*s.ConfiguredTableIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisRuleType sets the AnalysisRuleType field's value. -func (s *DeleteConfiguredTableAnalysisRuleInput) SetAnalysisRuleType(v string) *DeleteConfiguredTableAnalysisRuleInput { - s.AnalysisRuleType = &v - return s -} - -// SetConfiguredTableIdentifier sets the ConfiguredTableIdentifier field's value. -func (s *DeleteConfiguredTableAnalysisRuleInput) SetConfiguredTableIdentifier(v string) *DeleteConfiguredTableAnalysisRuleInput { - s.ConfiguredTableIdentifier = &v - return s -} - -// An empty response that indicates a successful delete. -type DeleteConfiguredTableAnalysisRuleOutput 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 DeleteConfiguredTableAnalysisRuleOutput) 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 DeleteConfiguredTableAnalysisRuleOutput) GoString() string { - return s.String() -} - -type DeleteConfiguredTableAssociationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique ID for the configured table association to be deleted. Currently - // accepts the configured table ID. - // - // ConfiguredTableAssociationIdentifier is a required field - ConfiguredTableAssociationIdentifier *string `location:"uri" locationName:"configuredTableAssociationIdentifier" min:"36" type:"string" required:"true"` - - // A unique identifier for the membership that the configured table association - // belongs to. Currently accepts the membership ID. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" 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 DeleteConfiguredTableAssociationInput) 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 DeleteConfiguredTableAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfiguredTableAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfiguredTableAssociationInput"} - if s.ConfiguredTableAssociationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableAssociationIdentifier")) - } - if s.ConfiguredTableAssociationIdentifier != nil && len(*s.ConfiguredTableAssociationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableAssociationIdentifier", 36)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguredTableAssociationIdentifier sets the ConfiguredTableAssociationIdentifier field's value. -func (s *DeleteConfiguredTableAssociationInput) SetConfiguredTableAssociationIdentifier(v string) *DeleteConfiguredTableAssociationInput { - s.ConfiguredTableAssociationIdentifier = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *DeleteConfiguredTableAssociationInput) SetMembershipIdentifier(v string) *DeleteConfiguredTableAssociationInput { - s.MembershipIdentifier = &v - return s -} - -type DeleteConfiguredTableAssociationOutput 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 DeleteConfiguredTableAssociationOutput) 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 DeleteConfiguredTableAssociationOutput) GoString() string { - return s.String() -} - -type DeleteConfiguredTableInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique ID for the configured table to delete. - // - // ConfiguredTableIdentifier is a required field - ConfiguredTableIdentifier *string `location:"uri" locationName:"configuredTableIdentifier" min:"36" 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 DeleteConfiguredTableInput) 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 DeleteConfiguredTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfiguredTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfiguredTableInput"} - if s.ConfiguredTableIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableIdentifier")) - } - if s.ConfiguredTableIdentifier != nil && len(*s.ConfiguredTableIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguredTableIdentifier sets the ConfiguredTableIdentifier field's value. -func (s *DeleteConfiguredTableInput) SetConfiguredTableIdentifier(v string) *DeleteConfiguredTableInput { - s.ConfiguredTableIdentifier = &v - return s -} - -// The empty output for a successful deletion. -type DeleteConfiguredTableOutput 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 DeleteConfiguredTableOutput) 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 DeleteConfiguredTableOutput) GoString() string { - return s.String() -} - -type DeleteMemberInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The account ID of the member to remove. - // - // AccountId is a required field - AccountId *string `location:"uri" locationName:"accountId" min:"12" type:"string" required:"true"` - - // The unique identifier for the associated collaboration. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" 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 DeleteMemberInput) 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 DeleteMemberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMemberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMemberInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.AccountId != nil && len(*s.AccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("AccountId", 12)) - } - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DeleteMemberInput) SetAccountId(v string) *DeleteMemberInput { - s.AccountId = &v - return s -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *DeleteMemberInput) SetCollaborationIdentifier(v string) *DeleteMemberInput { - s.CollaborationIdentifier = &v - return s -} - -type DeleteMemberOutput 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 DeleteMemberOutput) 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 DeleteMemberOutput) GoString() string { - return s.String() -} - -type DeleteMembershipInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for a membership resource. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" 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 DeleteMembershipInput) 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 DeleteMembershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMembershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMembershipInput"} - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *DeleteMembershipInput) SetMembershipIdentifier(v string) *DeleteMembershipInput { - s.MembershipIdentifier = &v - return s -} - -type DeleteMembershipOutput 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 DeleteMembershipOutput) 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 DeleteMembershipOutput) GoString() string { - return s.String() -} - -type GetAnalysisTemplateInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for the analysis template resource. - // - // AnalysisTemplateIdentifier is a required field - AnalysisTemplateIdentifier *string `location:"uri" locationName:"analysisTemplateIdentifier" min:"36" type:"string" required:"true"` - - // The identifier for a membership resource. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" 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 GetAnalysisTemplateInput) 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 GetAnalysisTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAnalysisTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAnalysisTemplateInput"} - if s.AnalysisTemplateIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisTemplateIdentifier")) - } - if s.AnalysisTemplateIdentifier != nil && len(*s.AnalysisTemplateIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("AnalysisTemplateIdentifier", 36)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisTemplateIdentifier sets the AnalysisTemplateIdentifier field's value. -func (s *GetAnalysisTemplateInput) SetAnalysisTemplateIdentifier(v string) *GetAnalysisTemplateInput { - s.AnalysisTemplateIdentifier = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *GetAnalysisTemplateInput) SetMembershipIdentifier(v string) *GetAnalysisTemplateInput { - s.MembershipIdentifier = &v - return s -} - -type GetAnalysisTemplateOutput struct { - _ struct{} `type:"structure"` - - // The analysis template. - // - // AnalysisTemplate is a required field - AnalysisTemplate *AnalysisTemplate `locationName:"analysisTemplate" type:"structure" 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 GetAnalysisTemplateOutput) 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 GetAnalysisTemplateOutput) GoString() string { - return s.String() -} - -// SetAnalysisTemplate sets the AnalysisTemplate field's value. -func (s *GetAnalysisTemplateOutput) SetAnalysisTemplate(v *AnalysisTemplate) *GetAnalysisTemplateOutput { - s.AnalysisTemplate = v - return s -} - -type GetCollaborationAnalysisTemplateInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) associated with the analysis template within - // a collaboration. - // - // AnalysisTemplateArn is a required field - AnalysisTemplateArn *string `location:"uri" locationName:"analysisTemplateArn" type:"string" required:"true"` - - // A unique identifier for the collaboration that the analysis templates belong - // to. Currently accepts collaboration ID. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" 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 GetCollaborationAnalysisTemplateInput) 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 GetCollaborationAnalysisTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCollaborationAnalysisTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCollaborationAnalysisTemplateInput"} - if s.AnalysisTemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisTemplateArn")) - } - if s.AnalysisTemplateArn != nil && len(*s.AnalysisTemplateArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AnalysisTemplateArn", 1)) - } - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisTemplateArn sets the AnalysisTemplateArn field's value. -func (s *GetCollaborationAnalysisTemplateInput) SetAnalysisTemplateArn(v string) *GetCollaborationAnalysisTemplateInput { - s.AnalysisTemplateArn = &v - return s -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *GetCollaborationAnalysisTemplateInput) SetCollaborationIdentifier(v string) *GetCollaborationAnalysisTemplateInput { - s.CollaborationIdentifier = &v - return s -} - -type GetCollaborationAnalysisTemplateOutput struct { - _ struct{} `type:"structure"` - - // The analysis template within a collaboration. - // - // CollaborationAnalysisTemplate is a required field - CollaborationAnalysisTemplate *CollaborationAnalysisTemplate `locationName:"collaborationAnalysisTemplate" type:"structure" 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 GetCollaborationAnalysisTemplateOutput) 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 GetCollaborationAnalysisTemplateOutput) GoString() string { - return s.String() -} - -// SetCollaborationAnalysisTemplate sets the CollaborationAnalysisTemplate field's value. -func (s *GetCollaborationAnalysisTemplateOutput) SetCollaborationAnalysisTemplate(v *CollaborationAnalysisTemplate) *GetCollaborationAnalysisTemplateOutput { - s.CollaborationAnalysisTemplate = v - return s -} - -type GetCollaborationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for the collaboration. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" 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 GetCollaborationInput) 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 GetCollaborationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCollaborationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCollaborationInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *GetCollaborationInput) SetCollaborationIdentifier(v string) *GetCollaborationInput { - s.CollaborationIdentifier = &v - return s -} - -type GetCollaborationOutput struct { - _ struct{} `type:"structure"` - - // The entire collaboration for this identifier. - // - // Collaboration is a required field - Collaboration *Collaboration `locationName:"collaboration" type:"structure" 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 GetCollaborationOutput) 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 GetCollaborationOutput) GoString() string { - return s.String() -} - -// SetCollaboration sets the Collaboration field's value. -func (s *GetCollaborationOutput) SetCollaboration(v *Collaboration) *GetCollaborationOutput { - s.Collaboration = v - return s -} - -type GetConfiguredTableAnalysisRuleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The analysis rule to be retrieved. Configured table analysis rules are uniquely - // identified by their configured table identifier and analysis rule type. - // - // AnalysisRuleType is a required field - AnalysisRuleType *string `location:"uri" locationName:"analysisRuleType" type:"string" required:"true" enum:"ConfiguredTableAnalysisRuleType"` - - // The unique identifier for the configured table to retrieve. Currently accepts - // the configured table ID. - // - // ConfiguredTableIdentifier is a required field - ConfiguredTableIdentifier *string `location:"uri" locationName:"configuredTableIdentifier" min:"36" 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 GetConfiguredTableAnalysisRuleInput) 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 GetConfiguredTableAnalysisRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConfiguredTableAnalysisRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConfiguredTableAnalysisRuleInput"} - if s.AnalysisRuleType == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisRuleType")) - } - if s.AnalysisRuleType != nil && len(*s.AnalysisRuleType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AnalysisRuleType", 1)) - } - if s.ConfiguredTableIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableIdentifier")) - } - if s.ConfiguredTableIdentifier != nil && len(*s.ConfiguredTableIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisRuleType sets the AnalysisRuleType field's value. -func (s *GetConfiguredTableAnalysisRuleInput) SetAnalysisRuleType(v string) *GetConfiguredTableAnalysisRuleInput { - s.AnalysisRuleType = &v - return s -} - -// SetConfiguredTableIdentifier sets the ConfiguredTableIdentifier field's value. -func (s *GetConfiguredTableAnalysisRuleInput) SetConfiguredTableIdentifier(v string) *GetConfiguredTableAnalysisRuleInput { - s.ConfiguredTableIdentifier = &v - return s -} - -type GetConfiguredTableAnalysisRuleOutput struct { - _ struct{} `type:"structure"` - - // The entire analysis rule output. - // - // AnalysisRule is a required field - AnalysisRule *ConfiguredTableAnalysisRule `locationName:"analysisRule" type:"structure" 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 GetConfiguredTableAnalysisRuleOutput) 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 GetConfiguredTableAnalysisRuleOutput) GoString() string { - return s.String() -} - -// SetAnalysisRule sets the AnalysisRule field's value. -func (s *GetConfiguredTableAnalysisRuleOutput) SetAnalysisRule(v *ConfiguredTableAnalysisRule) *GetConfiguredTableAnalysisRuleOutput { - s.AnalysisRule = v - return s -} - -type GetConfiguredTableAssociationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique ID for the configured table association to retrieve. Currently - // accepts the configured table ID. - // - // ConfiguredTableAssociationIdentifier is a required field - ConfiguredTableAssociationIdentifier *string `location:"uri" locationName:"configuredTableAssociationIdentifier" min:"36" type:"string" required:"true"` - - // A unique identifier for the membership that the configured table association - // belongs to. Currently accepts the membership ID. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" 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 GetConfiguredTableAssociationInput) 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 GetConfiguredTableAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConfiguredTableAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConfiguredTableAssociationInput"} - if s.ConfiguredTableAssociationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableAssociationIdentifier")) - } - if s.ConfiguredTableAssociationIdentifier != nil && len(*s.ConfiguredTableAssociationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableAssociationIdentifier", 36)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguredTableAssociationIdentifier sets the ConfiguredTableAssociationIdentifier field's value. -func (s *GetConfiguredTableAssociationInput) SetConfiguredTableAssociationIdentifier(v string) *GetConfiguredTableAssociationInput { - s.ConfiguredTableAssociationIdentifier = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *GetConfiguredTableAssociationInput) SetMembershipIdentifier(v string) *GetConfiguredTableAssociationInput { - s.MembershipIdentifier = &v - return s -} - -type GetConfiguredTableAssociationOutput struct { - _ struct{} `type:"structure"` - - // The entire configured table association object. - // - // ConfiguredTableAssociation is a required field - ConfiguredTableAssociation *ConfiguredTableAssociation `locationName:"configuredTableAssociation" type:"structure" 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 GetConfiguredTableAssociationOutput) 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 GetConfiguredTableAssociationOutput) GoString() string { - return s.String() -} - -// SetConfiguredTableAssociation sets the ConfiguredTableAssociation field's value. -func (s *GetConfiguredTableAssociationOutput) SetConfiguredTableAssociation(v *ConfiguredTableAssociation) *GetConfiguredTableAssociationOutput { - s.ConfiguredTableAssociation = v - return s -} - -type GetConfiguredTableInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique ID for the configured table to retrieve. - // - // ConfiguredTableIdentifier is a required field - ConfiguredTableIdentifier *string `location:"uri" locationName:"configuredTableIdentifier" min:"36" 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 GetConfiguredTableInput) 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 GetConfiguredTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConfiguredTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConfiguredTableInput"} - if s.ConfiguredTableIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableIdentifier")) - } - if s.ConfiguredTableIdentifier != nil && len(*s.ConfiguredTableIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguredTableIdentifier sets the ConfiguredTableIdentifier field's value. -func (s *GetConfiguredTableInput) SetConfiguredTableIdentifier(v string) *GetConfiguredTableInput { - s.ConfiguredTableIdentifier = &v - return s -} - -type GetConfiguredTableOutput struct { - _ struct{} `type:"structure"` - - // The retrieved configured table. - // - // ConfiguredTable is a required field - ConfiguredTable *ConfiguredTable `locationName:"configuredTable" type:"structure" 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 GetConfiguredTableOutput) 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 GetConfiguredTableOutput) GoString() string { - return s.String() -} - -// SetConfiguredTable sets the ConfiguredTable field's value. -func (s *GetConfiguredTableOutput) SetConfiguredTable(v *ConfiguredTable) *GetConfiguredTableOutput { - s.ConfiguredTable = v - return s -} - -type GetMembershipInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for a membership resource. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" 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 GetMembershipInput) 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 GetMembershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMembershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMembershipInput"} - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *GetMembershipInput) SetMembershipIdentifier(v string) *GetMembershipInput { - s.MembershipIdentifier = &v - return s -} - -type GetMembershipOutput struct { - _ struct{} `type:"structure"` - - // The membership retrieved for the provided identifier. - // - // Membership is a required field - Membership *Membership `locationName:"membership" type:"structure" 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 GetMembershipOutput) 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 GetMembershipOutput) GoString() string { - return s.String() -} - -// SetMembership sets the Membership field's value. -func (s *GetMembershipOutput) SetMembership(v *Membership) *GetMembershipOutput { - s.Membership = v - return s -} - -type GetProtectedQueryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for a membership in a protected query instance. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The identifier for a protected query instance. - // - // ProtectedQueryIdentifier is a required field - ProtectedQueryIdentifier *string `location:"uri" locationName:"protectedQueryIdentifier" min:"36" 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 GetProtectedQueryInput) 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 GetProtectedQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetProtectedQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetProtectedQueryInput"} - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - if s.ProtectedQueryIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProtectedQueryIdentifier")) - } - if s.ProtectedQueryIdentifier != nil && len(*s.ProtectedQueryIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ProtectedQueryIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *GetProtectedQueryInput) SetMembershipIdentifier(v string) *GetProtectedQueryInput { - s.MembershipIdentifier = &v - return s -} - -// SetProtectedQueryIdentifier sets the ProtectedQueryIdentifier field's value. -func (s *GetProtectedQueryInput) SetProtectedQueryIdentifier(v string) *GetProtectedQueryInput { - s.ProtectedQueryIdentifier = &v - return s -} - -type GetProtectedQueryOutput struct { - _ struct{} `type:"structure"` - - // The query processing metadata. - // - // ProtectedQuery is a required field - ProtectedQuery *ProtectedQuery `locationName:"protectedQuery" type:"structure" 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 GetProtectedQueryOutput) 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 GetProtectedQueryOutput) GoString() string { - return s.String() -} - -// SetProtectedQuery sets the ProtectedQuery field's value. -func (s *GetProtectedQueryOutput) SetProtectedQuery(v *ProtectedQuery) *GetProtectedQueryOutput { - s.ProtectedQuery = v - return s -} - -type GetSchemaAnalysisRuleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A unique identifier for the collaboration that the schema belongs to. Currently - // accepts a collaboration ID. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" type:"string" required:"true"` - - // The name of the schema to retrieve the analysis rule for. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` - - // The type of the schema analysis rule to retrieve. Schema analysis rules are - // uniquely identified by a combination of the collaboration, the schema name, - // and their type. - // - // Type is a required field - Type *string `location:"uri" locationName:"type" type:"string" required:"true" enum:"AnalysisRuleType"` -} - -// 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 GetSchemaAnalysisRuleInput) 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 GetSchemaAnalysisRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSchemaAnalysisRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSchemaAnalysisRuleInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Type != nil && len(*s.Type) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Type", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *GetSchemaAnalysisRuleInput) SetCollaborationIdentifier(v string) *GetSchemaAnalysisRuleInput { - s.CollaborationIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetSchemaAnalysisRuleInput) SetName(v string) *GetSchemaAnalysisRuleInput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetSchemaAnalysisRuleInput) SetType(v string) *GetSchemaAnalysisRuleInput { - s.Type = &v - return s -} - -type GetSchemaAnalysisRuleOutput struct { - _ struct{} `type:"structure"` - - // A specification about how data from the configured table can be used. - // - // AnalysisRule is a required field - AnalysisRule *AnalysisRule `locationName:"analysisRule" type:"structure" 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 GetSchemaAnalysisRuleOutput) 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 GetSchemaAnalysisRuleOutput) GoString() string { - return s.String() -} - -// SetAnalysisRule sets the AnalysisRule field's value. -func (s *GetSchemaAnalysisRuleOutput) SetAnalysisRule(v *AnalysisRule) *GetSchemaAnalysisRuleOutput { - s.AnalysisRule = v - return s -} - -type GetSchemaInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A unique identifier for the collaboration that the schema belongs to. Currently - // accepts a collaboration ID. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" type:"string" required:"true"` - - // The name of the relation to retrieve the schema for. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" 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 GetSchemaInput) 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 GetSchemaInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSchemaInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSchemaInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *GetSchemaInput) SetCollaborationIdentifier(v string) *GetSchemaInput { - s.CollaborationIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetSchemaInput) SetName(v string) *GetSchemaInput { - s.Name = &v - return s -} - -type GetSchemaOutput struct { - _ struct{} `type:"structure"` - - // The entire schema object. - // - // Schema is a required field - Schema *Schema `locationName:"schema" type:"structure" 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 GetSchemaOutput) 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 GetSchemaOutput) GoString() string { - return s.String() -} - -// SetSchema sets the Schema field's value. -func (s *GetSchemaOutput) SetSchema(v *Schema) *GetSchemaOutput { - s.Schema = v - return s -} - -// A reference to a table within an Glue data catalog. -type GlueTableReference struct { - _ struct{} `type:"structure"` - - // The name of the database the Glue table belongs to. - // - // DatabaseName is a required field - DatabaseName *string `locationName:"databaseName" type:"string" required:"true"` - - // The name of the Glue table. - // - // TableName is a required field - TableName *string `locationName:"tableName" 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 GlueTableReference) 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 GlueTableReference) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlueTableReference) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlueTableReference"} - if s.DatabaseName == nil { - invalidParams.Add(request.NewErrParamRequired("DatabaseName")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *GlueTableReference) SetDatabaseName(v string) *GlueTableReference { - s.DatabaseName = &v - return s -} - -// SetTableName sets the TableName field's value. -func (s *GlueTableReference) SetTableName(v string) *GlueTableReference { - s.TableName = &v - return s -} - -// Unexpected error during processing of request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListAnalysisTemplatesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum size of the results that is returned per call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The identifier for a membership resource. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListAnalysisTemplatesInput) 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 ListAnalysisTemplatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAnalysisTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAnalysisTemplatesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAnalysisTemplatesInput) SetMaxResults(v int64) *ListAnalysisTemplatesInput { - s.MaxResults = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *ListAnalysisTemplatesInput) SetMembershipIdentifier(v string) *ListAnalysisTemplatesInput { - s.MembershipIdentifier = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAnalysisTemplatesInput) SetNextToken(v string) *ListAnalysisTemplatesInput { - s.NextToken = &v - return s -} - -type ListAnalysisTemplatesOutput struct { - _ struct{} `type:"structure"` - - // Lists analysis template metadata. - // - // AnalysisTemplateSummaries is a required field - AnalysisTemplateSummaries []*AnalysisTemplateSummary `locationName:"analysisTemplateSummaries" type:"list" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" 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 ListAnalysisTemplatesOutput) 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 ListAnalysisTemplatesOutput) GoString() string { - return s.String() -} - -// SetAnalysisTemplateSummaries sets the AnalysisTemplateSummaries field's value. -func (s *ListAnalysisTemplatesOutput) SetAnalysisTemplateSummaries(v []*AnalysisTemplateSummary) *ListAnalysisTemplatesOutput { - s.AnalysisTemplateSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAnalysisTemplatesOutput) SetNextToken(v string) *ListAnalysisTemplatesOutput { - s.NextToken = &v - return s -} - -type ListCollaborationAnalysisTemplatesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A unique identifier for the collaboration that the analysis templates belong - // to. Currently accepts collaboration ID. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" type:"string" required:"true"` - - // The maximum size of the results that is returned per call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListCollaborationAnalysisTemplatesInput) 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 ListCollaborationAnalysisTemplatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCollaborationAnalysisTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCollaborationAnalysisTemplatesInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *ListCollaborationAnalysisTemplatesInput) SetCollaborationIdentifier(v string) *ListCollaborationAnalysisTemplatesInput { - s.CollaborationIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCollaborationAnalysisTemplatesInput) SetMaxResults(v int64) *ListCollaborationAnalysisTemplatesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCollaborationAnalysisTemplatesInput) SetNextToken(v string) *ListCollaborationAnalysisTemplatesInput { - s.NextToken = &v - return s -} - -type ListCollaborationAnalysisTemplatesOutput struct { - _ struct{} `type:"structure"` - - // The metadata of the analysis template within a collaboration. - // - // CollaborationAnalysisTemplateSummaries is a required field - CollaborationAnalysisTemplateSummaries []*CollaborationAnalysisTemplateSummary `locationName:"collaborationAnalysisTemplateSummaries" type:"list" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" 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 ListCollaborationAnalysisTemplatesOutput) 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 ListCollaborationAnalysisTemplatesOutput) GoString() string { - return s.String() -} - -// SetCollaborationAnalysisTemplateSummaries sets the CollaborationAnalysisTemplateSummaries field's value. -func (s *ListCollaborationAnalysisTemplatesOutput) SetCollaborationAnalysisTemplateSummaries(v []*CollaborationAnalysisTemplateSummary) *ListCollaborationAnalysisTemplatesOutput { - s.CollaborationAnalysisTemplateSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCollaborationAnalysisTemplatesOutput) SetNextToken(v string) *ListCollaborationAnalysisTemplatesOutput { - s.NextToken = &v - return s -} - -type ListCollaborationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum size of the results that is returned per call. Service chooses - // a default if it has not been set. Service may return a nextToken even if - // the maximum results has not been met. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The caller's status in a collaboration. - MemberStatus *string `location:"querystring" locationName:"memberStatus" type:"string" enum:"FilterableMemberStatus"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListCollaborationsInput) 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 ListCollaborationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCollaborationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCollaborationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCollaborationsInput) SetMaxResults(v int64) *ListCollaborationsInput { - s.MaxResults = &v - return s -} - -// SetMemberStatus sets the MemberStatus field's value. -func (s *ListCollaborationsInput) SetMemberStatus(v string) *ListCollaborationsInput { - s.MemberStatus = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCollaborationsInput) SetNextToken(v string) *ListCollaborationsInput { - s.NextToken = &v - return s -} - -type ListCollaborationsOutput struct { - _ struct{} `type:"structure"` - - // The list of collaborations. - // - // CollaborationList is a required field - CollaborationList []*CollaborationSummary `locationName:"collaborationList" type:"list" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" 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 ListCollaborationsOutput) 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 ListCollaborationsOutput) GoString() string { - return s.String() -} - -// SetCollaborationList sets the CollaborationList field's value. -func (s *ListCollaborationsOutput) SetCollaborationList(v []*CollaborationSummary) *ListCollaborationsOutput { - s.CollaborationList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCollaborationsOutput) SetNextToken(v string) *ListCollaborationsOutput { - s.NextToken = &v - return s -} - -type ListConfiguredTableAssociationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum size of the results that is returned per call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A unique identifier for the membership to list configured table associations - // for. Currently accepts the membership ID. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListConfiguredTableAssociationsInput) 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 ListConfiguredTableAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListConfiguredTableAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListConfiguredTableAssociationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListConfiguredTableAssociationsInput) SetMaxResults(v int64) *ListConfiguredTableAssociationsInput { - s.MaxResults = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *ListConfiguredTableAssociationsInput) SetMembershipIdentifier(v string) *ListConfiguredTableAssociationsInput { - s.MembershipIdentifier = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConfiguredTableAssociationsInput) SetNextToken(v string) *ListConfiguredTableAssociationsInput { - s.NextToken = &v - return s -} - -type ListConfiguredTableAssociationsOutput struct { - _ struct{} `type:"structure"` - - // The retrieved list of configured table associations. - // - // ConfiguredTableAssociationSummaries is a required field - ConfiguredTableAssociationSummaries []*ConfiguredTableAssociationSummary `locationName:"configuredTableAssociationSummaries" type:"list" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" 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 ListConfiguredTableAssociationsOutput) 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 ListConfiguredTableAssociationsOutput) GoString() string { - return s.String() -} - -// SetConfiguredTableAssociationSummaries sets the ConfiguredTableAssociationSummaries field's value. -func (s *ListConfiguredTableAssociationsOutput) SetConfiguredTableAssociationSummaries(v []*ConfiguredTableAssociationSummary) *ListConfiguredTableAssociationsOutput { - s.ConfiguredTableAssociationSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConfiguredTableAssociationsOutput) SetNextToken(v string) *ListConfiguredTableAssociationsOutput { - s.NextToken = &v - return s -} - -type ListConfiguredTablesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum size of the results that is returned per call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListConfiguredTablesInput) 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 ListConfiguredTablesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListConfiguredTablesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListConfiguredTablesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListConfiguredTablesInput) SetMaxResults(v int64) *ListConfiguredTablesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConfiguredTablesInput) SetNextToken(v string) *ListConfiguredTablesInput { - s.NextToken = &v - return s -} - -type ListConfiguredTablesOutput struct { - _ struct{} `type:"structure"` - - // The configured tables listed by the request. - // - // ConfiguredTableSummaries is a required field - ConfiguredTableSummaries []*ConfiguredTableSummary `locationName:"configuredTableSummaries" type:"list" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" 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 ListConfiguredTablesOutput) 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 ListConfiguredTablesOutput) GoString() string { - return s.String() -} - -// SetConfiguredTableSummaries sets the ConfiguredTableSummaries field's value. -func (s *ListConfiguredTablesOutput) SetConfiguredTableSummaries(v []*ConfiguredTableSummary) *ListConfiguredTablesOutput { - s.ConfiguredTableSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConfiguredTablesOutput) SetNextToken(v string) *ListConfiguredTablesOutput { - s.NextToken = &v - return s -} - -type ListMembersInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the collaboration in which the members are listed. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" type:"string" required:"true"` - - // The maximum size of the results that is returned per call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListMembersInput) 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 ListMembersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMembersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMembersInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *ListMembersInput) SetCollaborationIdentifier(v string) *ListMembersInput { - s.CollaborationIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListMembersInput) SetMaxResults(v int64) *ListMembersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMembersInput) SetNextToken(v string) *ListMembersInput { - s.NextToken = &v - return s -} - -type ListMembersOutput struct { - _ struct{} `type:"structure"` - - // The list of members returned by the ListMembers operation. - // - // MemberSummaries is a required field - MemberSummaries []*MemberSummary `locationName:"memberSummaries" type:"list" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" 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 ListMembersOutput) 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 ListMembersOutput) GoString() string { - return s.String() -} - -// SetMemberSummaries sets the MemberSummaries field's value. -func (s *ListMembersOutput) SetMemberSummaries(v []*MemberSummary) *ListMembersOutput { - s.MemberSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMembersOutput) SetNextToken(v string) *ListMembersOutput { - s.NextToken = &v - return s -} - -type ListMembershipsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum size of the results that is returned per call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // A filter which will return only memberships in the specified status. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"MembershipStatus"` -} - -// 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 ListMembershipsInput) 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 ListMembershipsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMembershipsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMembershipsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListMembershipsInput) SetMaxResults(v int64) *ListMembershipsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMembershipsInput) SetNextToken(v string) *ListMembershipsInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListMembershipsInput) SetStatus(v string) *ListMembershipsInput { - s.Status = &v - return s -} - -type ListMembershipsOutput struct { - _ struct{} `type:"structure"` - - // The list of memberships returned from the ListMemberships operation. - // - // MembershipSummaries is a required field - MembershipSummaries []*MembershipSummary `locationName:"membershipSummaries" type:"list" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" 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 ListMembershipsOutput) 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 ListMembershipsOutput) GoString() string { - return s.String() -} - -// SetMembershipSummaries sets the MembershipSummaries field's value. -func (s *ListMembershipsOutput) SetMembershipSummaries(v []*MembershipSummary) *ListMembershipsOutput { - s.MembershipSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMembershipsOutput) SetNextToken(v string) *ListMembershipsOutput { - s.NextToken = &v - return s -} - -type ListProtectedQueriesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum size of the results that is returned per call. Service chooses - // a default if it has not been set. Service can return a nextToken even if - // the maximum results has not been met. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The identifier for the membership in the collaboration. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // A filter on the status of the protected query. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"ProtectedQueryStatus"` -} - -// 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 ListProtectedQueriesInput) 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 ListProtectedQueriesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProtectedQueriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProtectedQueriesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListProtectedQueriesInput) SetMaxResults(v int64) *ListProtectedQueriesInput { - s.MaxResults = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *ListProtectedQueriesInput) SetMembershipIdentifier(v string) *ListProtectedQueriesInput { - s.MembershipIdentifier = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProtectedQueriesInput) SetNextToken(v string) *ListProtectedQueriesInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListProtectedQueriesInput) SetStatus(v string) *ListProtectedQueriesInput { - s.Status = &v - return s -} - -type ListProtectedQueriesOutput struct { - _ struct{} `type:"structure"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of protected queries. - // - // ProtectedQueries is a required field - ProtectedQueries []*ProtectedQuerySummary `locationName:"protectedQueries" type:"list" 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 ListProtectedQueriesOutput) 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 ListProtectedQueriesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProtectedQueriesOutput) SetNextToken(v string) *ListProtectedQueriesOutput { - s.NextToken = &v - return s -} - -// SetProtectedQueries sets the ProtectedQueries field's value. -func (s *ListProtectedQueriesOutput) SetProtectedQueries(v []*ProtectedQuerySummary) *ListProtectedQueriesOutput { - s.ProtectedQueries = v - return s -} - -type ListSchemasInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A unique identifier for the collaboration that the schema belongs to. Currently - // accepts a collaboration ID. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" type:"string" required:"true"` - - // The maximum size of the results that is returned per call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // If present, filter schemas by schema type. The only valid schema type is - // currently `TABLE`. - SchemaType *string `location:"querystring" locationName:"schemaType" type:"string" enum:"SchemaType"` -} - -// 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 ListSchemasInput) 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 ListSchemasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSchemasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSchemasInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *ListSchemasInput) SetCollaborationIdentifier(v string) *ListSchemasInput { - s.CollaborationIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSchemasInput) SetMaxResults(v int64) *ListSchemasInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSchemasInput) SetNextToken(v string) *ListSchemasInput { - s.NextToken = &v - return s -} - -// SetSchemaType sets the SchemaType field's value. -func (s *ListSchemasInput) SetSchemaType(v string) *ListSchemasInput { - s.SchemaType = &v - return s -} - -type ListSchemasOutput struct { - _ struct{} `type:"structure"` - - // The token value retrieved from a previous call to access the next page of - // results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The retrieved list of schemas. - // - // SchemaSummaries is a required field - SchemaSummaries []*SchemaSummary `locationName:"schemaSummaries" type:"list" 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 ListSchemasOutput) 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 ListSchemasOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSchemasOutput) SetNextToken(v string) *ListSchemasOutput { - s.NextToken = &v - return s -} - -// SetSchemaSummaries sets the SchemaSummaries field's value. -func (s *ListSchemasOutput) SetSchemaSummaries(v []*SchemaSummary) *ListSchemasOutput { - s.SchemaSummaries = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) associated with the resource you want to list - // tags on. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A map of objects specifying each key name and value. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Basic metadata used to construct a new member. -type MemberSpecification struct { - _ struct{} `type:"structure"` - - // The identifier used to reference members of the collaboration. Currently - // only supports Amazon Web Services account ID. - // - // AccountId is a required field - AccountId *string `locationName:"accountId" min:"12" type:"string" required:"true"` - - // The member's display name. - // - // DisplayName is a required field - DisplayName *string `locationName:"displayName" min:"1" type:"string" required:"true"` - - // The abilities granted to the collaboration member. - // - // MemberAbilities is a required field - MemberAbilities []*string `locationName:"memberAbilities" type:"list" required:"true" enum:"MemberAbility"` - - // The collaboration member's payment responsibilities set by the collaboration - // creator. - // - // If the collaboration creator hasn't specified anyone as the member paying - // for query compute costs, then the member who can query is the default payer. - PaymentConfiguration *PaymentConfiguration `locationName:"paymentConfiguration" 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 MemberSpecification) 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 MemberSpecification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MemberSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MemberSpecification"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.AccountId != nil && len(*s.AccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("AccountId", 12)) - } - if s.DisplayName == nil { - invalidParams.Add(request.NewErrParamRequired("DisplayName")) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.MemberAbilities == nil { - invalidParams.Add(request.NewErrParamRequired("MemberAbilities")) - } - if s.PaymentConfiguration != nil { - if err := s.PaymentConfiguration.Validate(); err != nil { - invalidParams.AddNested("PaymentConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *MemberSpecification) SetAccountId(v string) *MemberSpecification { - s.AccountId = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *MemberSpecification) SetDisplayName(v string) *MemberSpecification { - s.DisplayName = &v - return s -} - -// SetMemberAbilities sets the MemberAbilities field's value. -func (s *MemberSpecification) SetMemberAbilities(v []*string) *MemberSpecification { - s.MemberAbilities = v - return s -} - -// SetPaymentConfiguration sets the PaymentConfiguration field's value. -func (s *MemberSpecification) SetPaymentConfiguration(v *PaymentConfiguration) *MemberSpecification { - s.PaymentConfiguration = v - return s -} - -// The member object listed by the request. -type MemberSummary struct { - _ struct{} `type:"structure"` - - // The abilities granted to the collaboration member. - // - // Abilities is a required field - Abilities []*string `locationName:"abilities" type:"list" required:"true" enum:"MemberAbility"` - - // The identifier used to reference members of the collaboration. Currently - // only supports Amazon Web Services account ID. - // - // AccountId is a required field - AccountId *string `locationName:"accountId" min:"12" type:"string" required:"true"` - - // The time when the member was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The member's display name. - // - // DisplayName is a required field - DisplayName *string `locationName:"displayName" min:"1" type:"string" required:"true"` - - // The unique ARN for the member's associated membership, if present. - MembershipArn *string `locationName:"membershipArn" type:"string"` - - // The unique ID for the member's associated membership, if present. - MembershipId *string `locationName:"membershipId" min:"36" type:"string"` - - // The collaboration member's payment responsibilities set by the collaboration - // creator. - // - // PaymentConfiguration is a required field - PaymentConfiguration *PaymentConfiguration `locationName:"paymentConfiguration" type:"structure" required:"true"` - - // The status of the member. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"MemberStatus"` - - // The time the member metadata was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 MemberSummary) 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 MemberSummary) GoString() string { - return s.String() -} - -// SetAbilities sets the Abilities field's value. -func (s *MemberSummary) SetAbilities(v []*string) *MemberSummary { - s.Abilities = v - return s -} - -// SetAccountId sets the AccountId field's value. -func (s *MemberSummary) SetAccountId(v string) *MemberSummary { - s.AccountId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *MemberSummary) SetCreateTime(v time.Time) *MemberSummary { - s.CreateTime = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *MemberSummary) SetDisplayName(v string) *MemberSummary { - s.DisplayName = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *MemberSummary) SetMembershipArn(v string) *MemberSummary { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *MemberSummary) SetMembershipId(v string) *MemberSummary { - s.MembershipId = &v - return s -} - -// SetPaymentConfiguration sets the PaymentConfiguration field's value. -func (s *MemberSummary) SetPaymentConfiguration(v *PaymentConfiguration) *MemberSummary { - s.PaymentConfiguration = v - return s -} - -// SetStatus sets the Status field's value. -func (s *MemberSummary) SetStatus(v string) *MemberSummary { - s.Status = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *MemberSummary) SetUpdateTime(v time.Time) *MemberSummary { - s.UpdateTime = &v - return s -} - -// The membership object. -type Membership struct { - _ struct{} `type:"structure"` - - // The unique ARN for the membership. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The unique ARN for the membership's associated collaboration. - // - // CollaborationArn is a required field - CollaborationArn *string `locationName:"collaborationArn" type:"string" required:"true"` - - // The identifier used to reference members of the collaboration. Currently - // only supports Amazon Web Services account ID. - // - // CollaborationCreatorAccountId is a required field - CollaborationCreatorAccountId *string `locationName:"collaborationCreatorAccountId" min:"12" type:"string" required:"true"` - - // The display name of the collaboration creator. - // - // CollaborationCreatorDisplayName is a required field - CollaborationCreatorDisplayName *string `locationName:"collaborationCreatorDisplayName" min:"1" type:"string" required:"true"` - - // The unique ID for the membership's collaboration. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The name of the membership's collaboration. - // - // CollaborationName is a required field - CollaborationName *string `locationName:"collaborationName" min:"1" type:"string" required:"true"` - - // The time when the membership was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The default protected query result configuration as specified by the member - // who can receive results. - DefaultResultConfiguration *MembershipProtectedQueryResultConfiguration `locationName:"defaultResultConfiguration" type:"structure"` - - // The unique ID of the membership. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The abilities granted to the collaboration member. - // - // MemberAbilities is a required field - MemberAbilities []*string `locationName:"memberAbilities" type:"list" required:"true" enum:"MemberAbility"` - - // The payment responsibilities accepted by the collaboration member. - // - // PaymentConfiguration is a required field - PaymentConfiguration *MembershipPaymentConfiguration `locationName:"paymentConfiguration" type:"structure" required:"true"` - - // An indicator as to whether query logging has been enabled or disabled for - // the membership. - // - // QueryLogStatus is a required field - QueryLogStatus *string `locationName:"queryLogStatus" type:"string" required:"true" enum:"MembershipQueryLogStatus"` - - // The status of the membership. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"MembershipStatus"` - - // The time the membership metadata was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 Membership) 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 Membership) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Membership) SetArn(v string) *Membership { - s.Arn = &v - return s -} - -// SetCollaborationArn sets the CollaborationArn field's value. -func (s *Membership) SetCollaborationArn(v string) *Membership { - s.CollaborationArn = &v - return s -} - -// SetCollaborationCreatorAccountId sets the CollaborationCreatorAccountId field's value. -func (s *Membership) SetCollaborationCreatorAccountId(v string) *Membership { - s.CollaborationCreatorAccountId = &v - return s -} - -// SetCollaborationCreatorDisplayName sets the CollaborationCreatorDisplayName field's value. -func (s *Membership) SetCollaborationCreatorDisplayName(v string) *Membership { - s.CollaborationCreatorDisplayName = &v - return s -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *Membership) SetCollaborationId(v string) *Membership { - s.CollaborationId = &v - return s -} - -// SetCollaborationName sets the CollaborationName field's value. -func (s *Membership) SetCollaborationName(v string) *Membership { - s.CollaborationName = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *Membership) SetCreateTime(v time.Time) *Membership { - s.CreateTime = &v - return s -} - -// SetDefaultResultConfiguration sets the DefaultResultConfiguration field's value. -func (s *Membership) SetDefaultResultConfiguration(v *MembershipProtectedQueryResultConfiguration) *Membership { - s.DefaultResultConfiguration = v - return s -} - -// SetId sets the Id field's value. -func (s *Membership) SetId(v string) *Membership { - s.Id = &v - return s -} - -// SetMemberAbilities sets the MemberAbilities field's value. -func (s *Membership) SetMemberAbilities(v []*string) *Membership { - s.MemberAbilities = v - return s -} - -// SetPaymentConfiguration sets the PaymentConfiguration field's value. -func (s *Membership) SetPaymentConfiguration(v *MembershipPaymentConfiguration) *Membership { - s.PaymentConfiguration = v - return s -} - -// SetQueryLogStatus sets the QueryLogStatus field's value. -func (s *Membership) SetQueryLogStatus(v string) *Membership { - s.QueryLogStatus = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Membership) SetStatus(v string) *Membership { - s.Status = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *Membership) SetUpdateTime(v time.Time) *Membership { - s.UpdateTime = &v - return s -} - -// An object representing the payment responsibilities accepted by the collaboration -// member. -type MembershipPaymentConfiguration struct { - _ struct{} `type:"structure"` - - // The payment responsibilities accepted by the collaboration member for query - // compute costs. - // - // QueryCompute is a required field - QueryCompute *MembershipQueryComputePaymentConfig `locationName:"queryCompute" type:"structure" 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 MembershipPaymentConfiguration) 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 MembershipPaymentConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MembershipPaymentConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MembershipPaymentConfiguration"} - if s.QueryCompute == nil { - invalidParams.Add(request.NewErrParamRequired("QueryCompute")) - } - if s.QueryCompute != nil { - if err := s.QueryCompute.Validate(); err != nil { - invalidParams.AddNested("QueryCompute", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueryCompute sets the QueryCompute field's value. -func (s *MembershipPaymentConfiguration) SetQueryCompute(v *MembershipQueryComputePaymentConfig) *MembershipPaymentConfiguration { - s.QueryCompute = v - return s -} - -// Contains configurations for protected query results. -type MembershipProtectedQueryOutputConfiguration struct { - _ struct{} `type:"structure"` - - // Contains the configuration to write the query results to S3. - S3 *ProtectedQueryS3OutputConfiguration `locationName:"s3" 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 MembershipProtectedQueryOutputConfiguration) 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 MembershipProtectedQueryOutputConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MembershipProtectedQueryOutputConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MembershipProtectedQueryOutputConfiguration"} - if s.S3 != nil { - if err := s.S3.Validate(); err != nil { - invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3 sets the S3 field's value. -func (s *MembershipProtectedQueryOutputConfiguration) SetS3(v *ProtectedQueryS3OutputConfiguration) *MembershipProtectedQueryOutputConfiguration { - s.S3 = v - return s -} - -// Contains configurations for protected query results. -type MembershipProtectedQueryResultConfiguration struct { - _ struct{} `type:"structure"` - - // Configuration for protected query results. - // - // OutputConfiguration is a required field - OutputConfiguration *MembershipProtectedQueryOutputConfiguration `locationName:"outputConfiguration" type:"structure" required:"true"` - - // The unique ARN for an IAM role that is used by Clean Rooms to write protected - // query results to the result location, given by the member who can receive - // results. - RoleArn *string `locationName:"roleArn" min:"32" 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 MembershipProtectedQueryResultConfiguration) 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 MembershipProtectedQueryResultConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MembershipProtectedQueryResultConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MembershipProtectedQueryResultConfiguration"} - if s.OutputConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("OutputConfiguration")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 32)) - } - if s.OutputConfiguration != nil { - if err := s.OutputConfiguration.Validate(); err != nil { - invalidParams.AddNested("OutputConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOutputConfiguration sets the OutputConfiguration field's value. -func (s *MembershipProtectedQueryResultConfiguration) SetOutputConfiguration(v *MembershipProtectedQueryOutputConfiguration) *MembershipProtectedQueryResultConfiguration { - s.OutputConfiguration = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *MembershipProtectedQueryResultConfiguration) SetRoleArn(v string) *MembershipProtectedQueryResultConfiguration { - s.RoleArn = &v - return s -} - -// An object representing the payment responsibilities accepted by the collaboration -// member for query compute costs. -type MembershipQueryComputePaymentConfig struct { - _ struct{} `type:"structure"` - - // Indicates whether the collaboration member has accepted to pay for query - // compute costs (TRUE) or has not accepted to pay for query compute costs (FALSE). - // - // If the collaboration creator has not specified anyone to pay for query compute - // costs, then the member who can query is the default payer. - // - // An error message is returned for the following reasons: - // - // * If you set the value to FALSE but you are responsible to pay for query - // compute costs. - // - // * If you set the value to TRUE but you are not responsible to pay for - // query compute costs. - // - // IsResponsible is a required field - IsResponsible *bool `locationName:"isResponsible" type:"boolean" 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 MembershipQueryComputePaymentConfig) 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 MembershipQueryComputePaymentConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MembershipQueryComputePaymentConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MembershipQueryComputePaymentConfig"} - if s.IsResponsible == nil { - invalidParams.Add(request.NewErrParamRequired("IsResponsible")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIsResponsible sets the IsResponsible field's value. -func (s *MembershipQueryComputePaymentConfig) SetIsResponsible(v bool) *MembershipQueryComputePaymentConfig { - s.IsResponsible = &v - return s -} - -// The membership object listed by the request. -type MembershipSummary struct { - _ struct{} `type:"structure"` - - // The unique ARN for the membership. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The unique ARN for the membership's associated collaboration. - // - // CollaborationArn is a required field - CollaborationArn *string `locationName:"collaborationArn" type:"string" required:"true"` - - // The identifier of the Amazon Web Services principal that created the collaboration. - // Currently only supports Amazon Web Services account ID. - // - // CollaborationCreatorAccountId is a required field - CollaborationCreatorAccountId *string `locationName:"collaborationCreatorAccountId" min:"12" type:"string" required:"true"` - - // The display name of the collaboration creator. - // - // CollaborationCreatorDisplayName is a required field - CollaborationCreatorDisplayName *string `locationName:"collaborationCreatorDisplayName" min:"1" type:"string" required:"true"` - - // The unique ID for the membership's collaboration. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The name for the membership's collaboration. - // - // CollaborationName is a required field - CollaborationName *string `locationName:"collaborationName" min:"1" type:"string" required:"true"` - - // The time when the membership was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The unique ID for the membership's collaboration. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The abilities granted to the collaboration member. - // - // MemberAbilities is a required field - MemberAbilities []*string `locationName:"memberAbilities" type:"list" required:"true" enum:"MemberAbility"` - - // The payment responsibilities accepted by the collaboration member. - // - // PaymentConfiguration is a required field - PaymentConfiguration *MembershipPaymentConfiguration `locationName:"paymentConfiguration" type:"structure" required:"true"` - - // The status of the membership. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"MembershipStatus"` - - // The time the membership metadata was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 MembershipSummary) 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 MembershipSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *MembershipSummary) SetArn(v string) *MembershipSummary { - s.Arn = &v - return s -} - -// SetCollaborationArn sets the CollaborationArn field's value. -func (s *MembershipSummary) SetCollaborationArn(v string) *MembershipSummary { - s.CollaborationArn = &v - return s -} - -// SetCollaborationCreatorAccountId sets the CollaborationCreatorAccountId field's value. -func (s *MembershipSummary) SetCollaborationCreatorAccountId(v string) *MembershipSummary { - s.CollaborationCreatorAccountId = &v - return s -} - -// SetCollaborationCreatorDisplayName sets the CollaborationCreatorDisplayName field's value. -func (s *MembershipSummary) SetCollaborationCreatorDisplayName(v string) *MembershipSummary { - s.CollaborationCreatorDisplayName = &v - return s -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *MembershipSummary) SetCollaborationId(v string) *MembershipSummary { - s.CollaborationId = &v - return s -} - -// SetCollaborationName sets the CollaborationName field's value. -func (s *MembershipSummary) SetCollaborationName(v string) *MembershipSummary { - s.CollaborationName = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *MembershipSummary) SetCreateTime(v time.Time) *MembershipSummary { - s.CreateTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *MembershipSummary) SetId(v string) *MembershipSummary { - s.Id = &v - return s -} - -// SetMemberAbilities sets the MemberAbilities field's value. -func (s *MembershipSummary) SetMemberAbilities(v []*string) *MembershipSummary { - s.MemberAbilities = v - return s -} - -// SetPaymentConfiguration sets the PaymentConfiguration field's value. -func (s *MembershipSummary) SetPaymentConfiguration(v *MembershipPaymentConfiguration) *MembershipSummary { - s.PaymentConfiguration = v - return s -} - -// SetStatus sets the Status field's value. -func (s *MembershipSummary) SetStatus(v string) *MembershipSummary { - s.Status = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *MembershipSummary) SetUpdateTime(v time.Time) *MembershipSummary { - s.UpdateTime = &v - return s -} - -// An object representing the collaboration member's payment responsibilities -// set by the collaboration creator. -type PaymentConfiguration struct { - _ struct{} `type:"structure"` - - // The collaboration member's payment responsibilities set by the collaboration - // creator for query compute costs. - // - // QueryCompute is a required field - QueryCompute *QueryComputePaymentConfig `locationName:"queryCompute" type:"structure" 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 PaymentConfiguration) 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 PaymentConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PaymentConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PaymentConfiguration"} - if s.QueryCompute == nil { - invalidParams.Add(request.NewErrParamRequired("QueryCompute")) - } - if s.QueryCompute != nil { - if err := s.QueryCompute.Validate(); err != nil { - invalidParams.AddNested("QueryCompute", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueryCompute sets the QueryCompute field's value. -func (s *PaymentConfiguration) SetQueryCompute(v *QueryComputePaymentConfig) *PaymentConfiguration { - s.QueryCompute = v - return s -} - -// The parameters for an Clean Rooms protected query. -type ProtectedQuery struct { - _ struct{} `type:"structure"` - - // The time at which the protected query was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // An error thrown by the protected query. - Error *ProtectedQueryError `locationName:"error" type:"structure"` - - // The identifier for a protected query instance. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The ARN of the membership. - // - // MembershipArn is a required field - MembershipArn *string `locationName:"membershipArn" type:"string" required:"true"` - - // The identifier for the membership. - // - // MembershipId is a required field - MembershipId *string `locationName:"membershipId" min:"36" type:"string" required:"true"` - - // The result of the protected query. - Result *ProtectedQueryResult `locationName:"result" type:"structure"` - - // Contains any details needed to write the query results. - ResultConfiguration *ProtectedQueryResultConfiguration `locationName:"resultConfiguration" type:"structure"` - - // The protected query SQL parameters. - // - // SqlParameters is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ProtectedQuery's - // String and GoString methods. - SqlParameters *ProtectedQuerySQLParameters `locationName:"sqlParameters" type:"structure" sensitive:"true"` - - // Statistics about protected query execution. - Statistics *ProtectedQueryStatistics `locationName:"statistics" type:"structure"` - - // The status of the query. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ProtectedQueryStatus"` -} - -// 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 ProtectedQuery) 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 ProtectedQuery) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *ProtectedQuery) SetCreateTime(v time.Time) *ProtectedQuery { - s.CreateTime = &v - return s -} - -// SetError sets the Error field's value. -func (s *ProtectedQuery) SetError(v *ProtectedQueryError) *ProtectedQuery { - s.Error = v - return s -} - -// SetId sets the Id field's value. -func (s *ProtectedQuery) SetId(v string) *ProtectedQuery { - s.Id = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *ProtectedQuery) SetMembershipArn(v string) *ProtectedQuery { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *ProtectedQuery) SetMembershipId(v string) *ProtectedQuery { - s.MembershipId = &v - return s -} - -// SetResult sets the Result field's value. -func (s *ProtectedQuery) SetResult(v *ProtectedQueryResult) *ProtectedQuery { - s.Result = v - return s -} - -// SetResultConfiguration sets the ResultConfiguration field's value. -func (s *ProtectedQuery) SetResultConfiguration(v *ProtectedQueryResultConfiguration) *ProtectedQuery { - s.ResultConfiguration = v - return s -} - -// SetSqlParameters sets the SqlParameters field's value. -func (s *ProtectedQuery) SetSqlParameters(v *ProtectedQuerySQLParameters) *ProtectedQuery { - s.SqlParameters = v - return s -} - -// SetStatistics sets the Statistics field's value. -func (s *ProtectedQuery) SetStatistics(v *ProtectedQueryStatistics) *ProtectedQuery { - s.Statistics = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ProtectedQuery) SetStatus(v string) *ProtectedQuery { - s.Status = &v - return s -} - -// Details of errors thrown by the protected query. -type ProtectedQueryError struct { - _ struct{} `type:"structure"` - - // An error code for the error. - // - // Code is a required field - Code *string `locationName:"code" type:"string" required:"true"` - - // A description of why the query failed. - // - // Message is a required field - Message *string `locationName:"message" 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 ProtectedQueryError) 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 ProtectedQueryError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ProtectedQueryError) SetCode(v string) *ProtectedQueryError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ProtectedQueryError) SetMessage(v string) *ProtectedQueryError { - s.Message = &v - return s -} - -// Contains configuration details for protected query output. -type ProtectedQueryOutputConfiguration struct { - _ struct{} `type:"structure"` - - // Required configuration for a protected query with an `S3` output type. - S3 *ProtectedQueryS3OutputConfiguration `locationName:"s3" 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 ProtectedQueryOutputConfiguration) 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 ProtectedQueryOutputConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProtectedQueryOutputConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProtectedQueryOutputConfiguration"} - if s.S3 != nil { - if err := s.S3.Validate(); err != nil { - invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3 sets the S3 field's value. -func (s *ProtectedQueryOutputConfiguration) SetS3(v *ProtectedQueryS3OutputConfiguration) *ProtectedQueryOutputConfiguration { - s.S3 = v - return s -} - -// Contains details about the protected query output. -type ProtectedQueryOutput_ struct { - _ struct{} `type:"structure"` - - // The list of member Amazon Web Services account(s) that received the results - // of the query. - MemberList []*ProtectedQuerySingleMemberOutput_ `locationName:"memberList" type:"list"` - - // If present, the output for a protected query with an `S3` output type. - S3 *ProtectedQueryS3Output_ `locationName:"s3" 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 ProtectedQueryOutput_) 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 ProtectedQueryOutput_) GoString() string { - return s.String() -} - -// SetMemberList sets the MemberList field's value. -func (s *ProtectedQueryOutput_) SetMemberList(v []*ProtectedQuerySingleMemberOutput_) *ProtectedQueryOutput_ { - s.MemberList = v - return s -} - -// SetS3 sets the S3 field's value. -func (s *ProtectedQueryOutput_) SetS3(v *ProtectedQueryS3Output_) *ProtectedQueryOutput_ { - s.S3 = v - return s -} - -// Details about the query results. -type ProtectedQueryResult struct { - _ struct{} `type:"structure"` - - // The output of the protected query. - // - // Output is a required field - Output *ProtectedQueryOutput_ `locationName:"output" type:"structure" 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 ProtectedQueryResult) 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 ProtectedQueryResult) GoString() string { - return s.String() -} - -// SetOutput sets the Output field's value. -func (s *ProtectedQueryResult) SetOutput(v *ProtectedQueryOutput_) *ProtectedQueryResult { - s.Output = v - return s -} - -// Contains configurations for protected query results. -type ProtectedQueryResultConfiguration struct { - _ struct{} `type:"structure"` - - // Configuration for protected query results. - // - // OutputConfiguration is a required field - OutputConfiguration *ProtectedQueryOutputConfiguration `locationName:"outputConfiguration" type:"structure" 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 ProtectedQueryResultConfiguration) 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 ProtectedQueryResultConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProtectedQueryResultConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProtectedQueryResultConfiguration"} - if s.OutputConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("OutputConfiguration")) - } - if s.OutputConfiguration != nil { - if err := s.OutputConfiguration.Validate(); err != nil { - invalidParams.AddNested("OutputConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOutputConfiguration sets the OutputConfiguration field's value. -func (s *ProtectedQueryResultConfiguration) SetOutputConfiguration(v *ProtectedQueryOutputConfiguration) *ProtectedQueryResultConfiguration { - s.OutputConfiguration = v - return s -} - -// Contains the configuration to write the query results to S3. -type ProtectedQueryS3OutputConfiguration struct { - _ struct{} `type:"structure"` - - // The S3 bucket to unload the protected query results. - // - // Bucket is a required field - Bucket *string `locationName:"bucket" min:"3" type:"string" required:"true"` - - // The S3 prefix to unload the protected query results. - KeyPrefix *string `locationName:"keyPrefix" type:"string"` - - // Intended file format of the result. - // - // ResultFormat is a required field - ResultFormat *string `locationName:"resultFormat" type:"string" required:"true" enum:"ResultFormat"` -} - -// 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 ProtectedQueryS3OutputConfiguration) 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 ProtectedQueryS3OutputConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProtectedQueryS3OutputConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProtectedQueryS3OutputConfiguration"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 3)) - } - if s.ResultFormat == nil { - invalidParams.Add(request.NewErrParamRequired("ResultFormat")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ProtectedQueryS3OutputConfiguration) SetBucket(v string) *ProtectedQueryS3OutputConfiguration { - s.Bucket = &v - return s -} - -// SetKeyPrefix sets the KeyPrefix field's value. -func (s *ProtectedQueryS3OutputConfiguration) SetKeyPrefix(v string) *ProtectedQueryS3OutputConfiguration { - s.KeyPrefix = &v - return s -} - -// SetResultFormat sets the ResultFormat field's value. -func (s *ProtectedQueryS3OutputConfiguration) SetResultFormat(v string) *ProtectedQueryS3OutputConfiguration { - s.ResultFormat = &v - return s -} - -// Contains output information for protected queries with an S3 output type. -type ProtectedQueryS3Output_ struct { - _ struct{} `type:"structure"` - - // The S3 location of the result. - // - // Location is a required field - Location *string `locationName:"location" 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 ProtectedQueryS3Output_) 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 ProtectedQueryS3Output_) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *ProtectedQueryS3Output_) SetLocation(v string) *ProtectedQueryS3Output_ { - s.Location = &v - return s -} - -// The parameters for the SQL type Protected Query. -type ProtectedQuerySQLParameters struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The Amazon Resource Name (ARN) associated with the analysis template within - // a collaboration. - AnalysisTemplateArn *string `locationName:"analysisTemplateArn" type:"string"` - - // The protected query SQL parameters. - Parameters map[string]*string `locationName:"parameters" type:"map"` - - // The query string to be submitted. - QueryString *string `locationName:"queryString" 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 ProtectedQuerySQLParameters) 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 ProtectedQuerySQLParameters) GoString() string { - return s.String() -} - -// SetAnalysisTemplateArn sets the AnalysisTemplateArn field's value. -func (s *ProtectedQuerySQLParameters) SetAnalysisTemplateArn(v string) *ProtectedQuerySQLParameters { - s.AnalysisTemplateArn = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ProtectedQuerySQLParameters) SetParameters(v map[string]*string) *ProtectedQuerySQLParameters { - s.Parameters = v - return s -} - -// SetQueryString sets the QueryString field's value. -func (s *ProtectedQuerySQLParameters) SetQueryString(v string) *ProtectedQuerySQLParameters { - s.QueryString = &v - return s -} - -// Details about the member who received the query result. -type ProtectedQuerySingleMemberOutput_ struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account ID of the member in the collaboration who - // can receive results for the query. - // - // AccountId is a required field - AccountId *string `locationName:"accountId" min:"12" 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 ProtectedQuerySingleMemberOutput_) 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 ProtectedQuerySingleMemberOutput_) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *ProtectedQuerySingleMemberOutput_) SetAccountId(v string) *ProtectedQuerySingleMemberOutput_ { - s.AccountId = &v - return s -} - -// Contains statistics about the execution of the protected query. -type ProtectedQueryStatistics struct { - _ struct{} `type:"structure"` - - // The duration of the Protected Query, from creation until query completion. - TotalDurationInMillis *int64 `locationName:"totalDurationInMillis" type:"long"` -} - -// 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 ProtectedQueryStatistics) 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 ProtectedQueryStatistics) GoString() string { - return s.String() -} - -// SetTotalDurationInMillis sets the TotalDurationInMillis field's value. -func (s *ProtectedQueryStatistics) SetTotalDurationInMillis(v int64) *ProtectedQueryStatistics { - s.TotalDurationInMillis = &v - return s -} - -// The protected query summary for the objects listed by the request. -type ProtectedQuerySummary struct { - _ struct{} `type:"structure"` - - // The time the protected query was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The unique ID of the protected query. - // - // Id is a required field - Id *string `locationName:"id" min:"36" type:"string" required:"true"` - - // The unique ARN for the membership that initiated the protected query. - // - // MembershipArn is a required field - MembershipArn *string `locationName:"membershipArn" type:"string" required:"true"` - - // The unique ID for the membership that initiated the protected query. - // - // MembershipId is a required field - MembershipId *string `locationName:"membershipId" min:"36" type:"string" required:"true"` - - // The status of the protected query. Value values are `SUBMITTED`, `STARTED`, - // `CANCELLED`, `CANCELLING`, `FAILED`, `SUCCESS`, `TIMED_OUT`. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ProtectedQueryStatus"` -} - -// 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 ProtectedQuerySummary) 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 ProtectedQuerySummary) GoString() string { - return s.String() -} - -// SetCreateTime sets the CreateTime field's value. -func (s *ProtectedQuerySummary) SetCreateTime(v time.Time) *ProtectedQuerySummary { - s.CreateTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *ProtectedQuerySummary) SetId(v string) *ProtectedQuerySummary { - s.Id = &v - return s -} - -// SetMembershipArn sets the MembershipArn field's value. -func (s *ProtectedQuerySummary) SetMembershipArn(v string) *ProtectedQuerySummary { - s.MembershipArn = &v - return s -} - -// SetMembershipId sets the MembershipId field's value. -func (s *ProtectedQuerySummary) SetMembershipId(v string) *ProtectedQuerySummary { - s.MembershipId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ProtectedQuerySummary) SetStatus(v string) *ProtectedQuerySummary { - s.Status = &v - return s -} - -// An object representing the collaboration member's payment responsibilities -// set by the collaboration creator for query compute costs. -type QueryComputePaymentConfig struct { - _ struct{} `type:"structure"` - - // Indicates whether the collaboration creator has configured the collaboration - // member to pay for query compute costs (TRUE) or has not configured the collaboration - // member to pay for query compute costs (FALSE). - // - // Exactly one member can be configured to pay for query compute costs. An error - // is returned if the collaboration creator sets a TRUE value for more than - // one member in the collaboration. - // - // If the collaboration creator hasn't specified anyone as the member paying - // for query compute costs, then the member who can query is the default payer. - // An error is returned if the collaboration creator sets a FALSE value for - // the member who can query. - // - // IsResponsible is a required field - IsResponsible *bool `locationName:"isResponsible" type:"boolean" 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 QueryComputePaymentConfig) 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 QueryComputePaymentConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueryComputePaymentConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueryComputePaymentConfig"} - if s.IsResponsible == nil { - invalidParams.Add(request.NewErrParamRequired("IsResponsible")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIsResponsible sets the IsResponsible field's value. -func (s *QueryComputePaymentConfig) SetIsResponsible(v bool) *QueryComputePaymentConfig { - s.IsResponsible = &v - return s -} - -// Request references a resource which does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The Id of the missing resource. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of the missing resource. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` -} - -// 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A schema is a relation within a collaboration. -type Schema struct { - _ struct{} `type:"structure"` - - // The analysis method for the schema. The only valid value is currently DIRECT_QUERY. - AnalysisMethod *string `locationName:"analysisMethod" type:"string" enum:"AnalysisMethod"` - - // The analysis rule types associated with the schema. Currently, only one entry - // is present. - // - // AnalysisRuleTypes is a required field - AnalysisRuleTypes []*string `locationName:"analysisRuleTypes" type:"list" required:"true" enum:"AnalysisRuleType"` - - // The unique ARN for the collaboration that the schema belongs to. - // - // CollaborationArn is a required field - CollaborationArn *string `locationName:"collaborationArn" type:"string" required:"true"` - - // The unique ID for the collaboration that the schema belongs to. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The columns for the relation this schema represents. - // - // Columns is a required field - Columns []*Column `locationName:"columns" type:"list" required:"true"` - - // The time the schema was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The unique account ID for the Amazon Web Services account that owns the schema. - // - // CreatorAccountId is a required field - CreatorAccountId *string `locationName:"creatorAccountId" min:"12" type:"string" required:"true"` - - // A description for the schema. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // A name for the schema. The schema relation is referred to by this name when - // queried by a protected query. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The partition keys for the dataset underlying this schema. - // - // PartitionKeys is a required field - PartitionKeys []*Column `locationName:"partitionKeys" type:"list" required:"true"` - - // The type of schema. The only valid value is currently `TABLE`. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SchemaType"` - - // The time the schema was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 Schema) 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 Schema) GoString() string { - return s.String() -} - -// SetAnalysisMethod sets the AnalysisMethod field's value. -func (s *Schema) SetAnalysisMethod(v string) *Schema { - s.AnalysisMethod = &v - return s -} - -// SetAnalysisRuleTypes sets the AnalysisRuleTypes field's value. -func (s *Schema) SetAnalysisRuleTypes(v []*string) *Schema { - s.AnalysisRuleTypes = v - return s -} - -// SetCollaborationArn sets the CollaborationArn field's value. -func (s *Schema) SetCollaborationArn(v string) *Schema { - s.CollaborationArn = &v - return s -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *Schema) SetCollaborationId(v string) *Schema { - s.CollaborationId = &v - return s -} - -// SetColumns sets the Columns field's value. -func (s *Schema) SetColumns(v []*Column) *Schema { - s.Columns = v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *Schema) SetCreateTime(v time.Time) *Schema { - s.CreateTime = &v - return s -} - -// SetCreatorAccountId sets the CreatorAccountId field's value. -func (s *Schema) SetCreatorAccountId(v string) *Schema { - s.CreatorAccountId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Schema) SetDescription(v string) *Schema { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *Schema) SetName(v string) *Schema { - s.Name = &v - return s -} - -// SetPartitionKeys sets the PartitionKeys field's value. -func (s *Schema) SetPartitionKeys(v []*Column) *Schema { - s.PartitionKeys = v - return s -} - -// SetType sets the Type field's value. -func (s *Schema) SetType(v string) *Schema { - s.Type = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *Schema) SetUpdateTime(v time.Time) *Schema { - s.UpdateTime = &v - return s -} - -// The schema summary for the objects listed by the request. -type SchemaSummary struct { - _ struct{} `type:"structure"` - - // The analysis method for the associated schema. The only valid value is currently - // `DIRECT_QUERY`. - AnalysisMethod *string `locationName:"analysisMethod" type:"string" enum:"AnalysisMethod"` - - // The types of analysis rules that are associated with this schema object. - // - // AnalysisRuleTypes is a required field - AnalysisRuleTypes []*string `locationName:"analysisRuleTypes" type:"list" required:"true" enum:"AnalysisRuleType"` - - // The unique ARN for the collaboration that the schema belongs to. - // - // CollaborationArn is a required field - CollaborationArn *string `locationName:"collaborationArn" type:"string" required:"true"` - - // The unique ID for the collaboration that the schema belongs to. - // - // CollaborationId is a required field - CollaborationId *string `locationName:"collaborationId" min:"36" type:"string" required:"true"` - - // The time the schema object was created. - // - // CreateTime is a required field - CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` - - // The unique account ID for the Amazon Web Services account that owns the schema. - // - // CreatorAccountId is a required field - CreatorAccountId *string `locationName:"creatorAccountId" min:"12" type:"string" required:"true"` - - // The name for the schema object. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The type of schema object. The only valid schema type is currently `TABLE`. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SchemaType"` - - // The time the schema object was last updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" 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 SchemaSummary) 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 SchemaSummary) GoString() string { - return s.String() -} - -// SetAnalysisMethod sets the AnalysisMethod field's value. -func (s *SchemaSummary) SetAnalysisMethod(v string) *SchemaSummary { - s.AnalysisMethod = &v - return s -} - -// SetAnalysisRuleTypes sets the AnalysisRuleTypes field's value. -func (s *SchemaSummary) SetAnalysisRuleTypes(v []*string) *SchemaSummary { - s.AnalysisRuleTypes = v - return s -} - -// SetCollaborationArn sets the CollaborationArn field's value. -func (s *SchemaSummary) SetCollaborationArn(v string) *SchemaSummary { - s.CollaborationArn = &v - return s -} - -// SetCollaborationId sets the CollaborationId field's value. -func (s *SchemaSummary) SetCollaborationId(v string) *SchemaSummary { - s.CollaborationId = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *SchemaSummary) SetCreateTime(v time.Time) *SchemaSummary { - s.CreateTime = &v - return s -} - -// SetCreatorAccountId sets the CreatorAccountId field's value. -func (s *SchemaSummary) SetCreatorAccountId(v string) *SchemaSummary { - s.CreatorAccountId = &v - return s -} - -// SetName sets the Name field's value. -func (s *SchemaSummary) SetName(v string) *SchemaSummary { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *SchemaSummary) SetType(v string) *SchemaSummary { - s.Type = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *SchemaSummary) SetUpdateTime(v time.Time) *SchemaSummary { - s.UpdateTime = &v - return s -} - -// Request denied because service quota has been exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The name of the quota. - // - // QuotaName is a required field - QuotaName *string `locationName:"quotaName" type:"string" required:"true"` - - // The value of the quota. - // - // QuotaValue is a required field - QuotaValue *float64 `locationName:"quotaValue" type:"double" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartProtectedQueryInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the membership to run this query against. Currently - // accepts a membership ID. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The details needed to write the query results. - ResultConfiguration *ProtectedQueryResultConfiguration `locationName:"resultConfiguration" type:"structure"` - - // The protected SQL query parameters. - // - // SqlParameters is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StartProtectedQueryInput's - // String and GoString methods. - // - // SqlParameters is a required field - SqlParameters *ProtectedQuerySQLParameters `locationName:"sqlParameters" type:"structure" required:"true" sensitive:"true"` - - // The type of the protected query to be started. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"ProtectedQueryType"` -} - -// 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 StartProtectedQueryInput) 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 StartProtectedQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartProtectedQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartProtectedQueryInput"} - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - if s.SqlParameters == nil { - invalidParams.Add(request.NewErrParamRequired("SqlParameters")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.ResultConfiguration != nil { - if err := s.ResultConfiguration.Validate(); err != nil { - invalidParams.AddNested("ResultConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *StartProtectedQueryInput) SetMembershipIdentifier(v string) *StartProtectedQueryInput { - s.MembershipIdentifier = &v - return s -} - -// SetResultConfiguration sets the ResultConfiguration field's value. -func (s *StartProtectedQueryInput) SetResultConfiguration(v *ProtectedQueryResultConfiguration) *StartProtectedQueryInput { - s.ResultConfiguration = v - return s -} - -// SetSqlParameters sets the SqlParameters field's value. -func (s *StartProtectedQueryInput) SetSqlParameters(v *ProtectedQuerySQLParameters) *StartProtectedQueryInput { - s.SqlParameters = v - return s -} - -// SetType sets the Type field's value. -func (s *StartProtectedQueryInput) SetType(v string) *StartProtectedQueryInput { - s.Type = &v - return s -} - -type StartProtectedQueryOutput struct { - _ struct{} `type:"structure"` - - // The protected query. - // - // ProtectedQuery is a required field - ProtectedQuery *ProtectedQuery `locationName:"protectedQuery" type:"structure" 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 StartProtectedQueryOutput) 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 StartProtectedQueryOutput) GoString() string { - return s.String() -} - -// SetProtectedQuery sets the ProtectedQuery field's value. -func (s *StartProtectedQueryOutput) SetProtectedQuery(v *ProtectedQuery) *StartProtectedQueryOutput { - s.ProtectedQuery = v - return s -} - -// A pointer to the dataset that underlies this table. Currently, this can only -// be an Glue table. -type TableReference struct { - _ struct{} `type:"structure"` - - // If present, a reference to the Glue table referred to by this table reference. - Glue *GlueTableReference `locationName:"glue" 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 TableReference) 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 TableReference) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TableReference) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TableReference"} - if s.Glue != nil { - if err := s.Glue.Validate(); err != nil { - invalidParams.AddNested("Glue", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGlue sets the Glue field's value. -func (s *TableReference) SetGlue(v *GlueTableReference) *TableReference { - s.Glue = v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource you want to tag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // A map of objects specifying each key name and value. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) associated with the resource you want to remove - // the tag from. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // A list of key names of tags to be removed. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateAnalysisTemplateInput struct { - _ struct{} `type:"structure"` - - // The identifier for the analysis template resource. - // - // AnalysisTemplateIdentifier is a required field - AnalysisTemplateIdentifier *string `location:"uri" locationName:"analysisTemplateIdentifier" min:"36" type:"string" required:"true"` - - // A new description for the analysis template. - Description *string `locationName:"description" type:"string"` - - // The identifier for a membership resource. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" 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 UpdateAnalysisTemplateInput) 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 UpdateAnalysisTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAnalysisTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAnalysisTemplateInput"} - if s.AnalysisTemplateIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisTemplateIdentifier")) - } - if s.AnalysisTemplateIdentifier != nil && len(*s.AnalysisTemplateIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("AnalysisTemplateIdentifier", 36)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisTemplateIdentifier sets the AnalysisTemplateIdentifier field's value. -func (s *UpdateAnalysisTemplateInput) SetAnalysisTemplateIdentifier(v string) *UpdateAnalysisTemplateInput { - s.AnalysisTemplateIdentifier = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAnalysisTemplateInput) SetDescription(v string) *UpdateAnalysisTemplateInput { - s.Description = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *UpdateAnalysisTemplateInput) SetMembershipIdentifier(v string) *UpdateAnalysisTemplateInput { - s.MembershipIdentifier = &v - return s -} - -type UpdateAnalysisTemplateOutput struct { - _ struct{} `type:"structure"` - - // The analysis template. - // - // AnalysisTemplate is a required field - AnalysisTemplate *AnalysisTemplate `locationName:"analysisTemplate" type:"structure" 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 UpdateAnalysisTemplateOutput) 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 UpdateAnalysisTemplateOutput) GoString() string { - return s.String() -} - -// SetAnalysisTemplate sets the AnalysisTemplate field's value. -func (s *UpdateAnalysisTemplateOutput) SetAnalysisTemplate(v *AnalysisTemplate) *UpdateAnalysisTemplateOutput { - s.AnalysisTemplate = v - return s -} - -type UpdateCollaborationInput struct { - _ struct{} `type:"structure"` - - // The identifier for the collaboration. - // - // CollaborationIdentifier is a required field - CollaborationIdentifier *string `location:"uri" locationName:"collaborationIdentifier" min:"36" type:"string" required:"true"` - - // A description of the collaboration. - Description *string `locationName:"description" min:"1" type:"string"` - - // A human-readable identifier provided by the collaboration owner. Display - // names are not unique. - Name *string `locationName:"name" min:"1" 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 UpdateCollaborationInput) 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 UpdateCollaborationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCollaborationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCollaborationInput"} - if s.CollaborationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CollaborationIdentifier")) - } - if s.CollaborationIdentifier != nil && len(*s.CollaborationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CollaborationIdentifier", 36)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollaborationIdentifier sets the CollaborationIdentifier field's value. -func (s *UpdateCollaborationInput) SetCollaborationIdentifier(v string) *UpdateCollaborationInput { - s.CollaborationIdentifier = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateCollaborationInput) SetDescription(v string) *UpdateCollaborationInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCollaborationInput) SetName(v string) *UpdateCollaborationInput { - s.Name = &v - return s -} - -type UpdateCollaborationOutput struct { - _ struct{} `type:"structure"` - - // The entire collaboration that has been updated. - // - // Collaboration is a required field - Collaboration *Collaboration `locationName:"collaboration" type:"structure" 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 UpdateCollaborationOutput) 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 UpdateCollaborationOutput) GoString() string { - return s.String() -} - -// SetCollaboration sets the Collaboration field's value. -func (s *UpdateCollaborationOutput) SetCollaboration(v *Collaboration) *UpdateCollaborationOutput { - s.Collaboration = v - return s -} - -type UpdateConfiguredTableAnalysisRuleInput struct { - _ struct{} `type:"structure"` - - // The new analysis rule policy for the configured table analysis rule. - // - // AnalysisRulePolicy is a required field - AnalysisRulePolicy *ConfiguredTableAnalysisRulePolicy `locationName:"analysisRulePolicy" type:"structure" required:"true"` - - // The analysis rule type to be updated. Configured table analysis rules are - // uniquely identified by their configured table identifier and analysis rule - // type. - // - // AnalysisRuleType is a required field - AnalysisRuleType *string `location:"uri" locationName:"analysisRuleType" type:"string" required:"true" enum:"ConfiguredTableAnalysisRuleType"` - - // The unique identifier for the configured table that the analysis rule applies - // to. Currently accepts the configured table ID. - // - // ConfiguredTableIdentifier is a required field - ConfiguredTableIdentifier *string `location:"uri" locationName:"configuredTableIdentifier" min:"36" 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 UpdateConfiguredTableAnalysisRuleInput) 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 UpdateConfiguredTableAnalysisRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateConfiguredTableAnalysisRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateConfiguredTableAnalysisRuleInput"} - if s.AnalysisRulePolicy == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisRulePolicy")) - } - if s.AnalysisRuleType == nil { - invalidParams.Add(request.NewErrParamRequired("AnalysisRuleType")) - } - if s.AnalysisRuleType != nil && len(*s.AnalysisRuleType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AnalysisRuleType", 1)) - } - if s.ConfiguredTableIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableIdentifier")) - } - if s.ConfiguredTableIdentifier != nil && len(*s.ConfiguredTableIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableIdentifier", 36)) - } - if s.AnalysisRulePolicy != nil { - if err := s.AnalysisRulePolicy.Validate(); err != nil { - invalidParams.AddNested("AnalysisRulePolicy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisRulePolicy sets the AnalysisRulePolicy field's value. -func (s *UpdateConfiguredTableAnalysisRuleInput) SetAnalysisRulePolicy(v *ConfiguredTableAnalysisRulePolicy) *UpdateConfiguredTableAnalysisRuleInput { - s.AnalysisRulePolicy = v - return s -} - -// SetAnalysisRuleType sets the AnalysisRuleType field's value. -func (s *UpdateConfiguredTableAnalysisRuleInput) SetAnalysisRuleType(v string) *UpdateConfiguredTableAnalysisRuleInput { - s.AnalysisRuleType = &v - return s -} - -// SetConfiguredTableIdentifier sets the ConfiguredTableIdentifier field's value. -func (s *UpdateConfiguredTableAnalysisRuleInput) SetConfiguredTableIdentifier(v string) *UpdateConfiguredTableAnalysisRuleInput { - s.ConfiguredTableIdentifier = &v - return s -} - -type UpdateConfiguredTableAnalysisRuleOutput struct { - _ struct{} `type:"structure"` - - // The entire updated analysis rule. - // - // AnalysisRule is a required field - AnalysisRule *ConfiguredTableAnalysisRule `locationName:"analysisRule" type:"structure" 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 UpdateConfiguredTableAnalysisRuleOutput) 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 UpdateConfiguredTableAnalysisRuleOutput) GoString() string { - return s.String() -} - -// SetAnalysisRule sets the AnalysisRule field's value. -func (s *UpdateConfiguredTableAnalysisRuleOutput) SetAnalysisRule(v *ConfiguredTableAnalysisRule) *UpdateConfiguredTableAnalysisRuleOutput { - s.AnalysisRule = v - return s -} - -type UpdateConfiguredTableAssociationInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the configured table association to update. Currently - // accepts the configured table association ID. - // - // ConfiguredTableAssociationIdentifier is a required field - ConfiguredTableAssociationIdentifier *string `location:"uri" locationName:"configuredTableAssociationIdentifier" min:"36" type:"string" required:"true"` - - // A new description for the configured table association. - Description *string `locationName:"description" type:"string"` - - // The unique ID for the membership that the configured table association belongs - // to. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The service will assume this role to access catalog metadata and query the - // table. - RoleArn *string `locationName:"roleArn" min:"32" 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 UpdateConfiguredTableAssociationInput) 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 UpdateConfiguredTableAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateConfiguredTableAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateConfiguredTableAssociationInput"} - if s.ConfiguredTableAssociationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableAssociationIdentifier")) - } - if s.ConfiguredTableAssociationIdentifier != nil && len(*s.ConfiguredTableAssociationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableAssociationIdentifier", 36)) - } - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - if s.RoleArn != nil && len(*s.RoleArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 32)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguredTableAssociationIdentifier sets the ConfiguredTableAssociationIdentifier field's value. -func (s *UpdateConfiguredTableAssociationInput) SetConfiguredTableAssociationIdentifier(v string) *UpdateConfiguredTableAssociationInput { - s.ConfiguredTableAssociationIdentifier = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateConfiguredTableAssociationInput) SetDescription(v string) *UpdateConfiguredTableAssociationInput { - s.Description = &v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *UpdateConfiguredTableAssociationInput) SetMembershipIdentifier(v string) *UpdateConfiguredTableAssociationInput { - s.MembershipIdentifier = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateConfiguredTableAssociationInput) SetRoleArn(v string) *UpdateConfiguredTableAssociationInput { - s.RoleArn = &v - return s -} - -type UpdateConfiguredTableAssociationOutput struct { - _ struct{} `type:"structure"` - - // The entire updated configured table association. - // - // ConfiguredTableAssociation is a required field - ConfiguredTableAssociation *ConfiguredTableAssociation `locationName:"configuredTableAssociation" type:"structure" 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 UpdateConfiguredTableAssociationOutput) 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 UpdateConfiguredTableAssociationOutput) GoString() string { - return s.String() -} - -// SetConfiguredTableAssociation sets the ConfiguredTableAssociation field's value. -func (s *UpdateConfiguredTableAssociationOutput) SetConfiguredTableAssociation(v *ConfiguredTableAssociation) *UpdateConfiguredTableAssociationOutput { - s.ConfiguredTableAssociation = v - return s -} - -type UpdateConfiguredTableInput struct { - _ struct{} `type:"structure"` - - // The identifier for the configured table to update. Currently accepts the - // configured table ID. - // - // ConfiguredTableIdentifier is a required field - ConfiguredTableIdentifier *string `location:"uri" locationName:"configuredTableIdentifier" min:"36" type:"string" required:"true"` - - // A new description for the configured table. - Description *string `locationName:"description" type:"string"` - - // A new name for the configured table. - Name *string `locationName:"name" min:"1" 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 UpdateConfiguredTableInput) 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 UpdateConfiguredTableInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateConfiguredTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateConfiguredTableInput"} - if s.ConfiguredTableIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ConfiguredTableIdentifier")) - } - if s.ConfiguredTableIdentifier != nil && len(*s.ConfiguredTableIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConfiguredTableIdentifier", 36)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguredTableIdentifier sets the ConfiguredTableIdentifier field's value. -func (s *UpdateConfiguredTableInput) SetConfiguredTableIdentifier(v string) *UpdateConfiguredTableInput { - s.ConfiguredTableIdentifier = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateConfiguredTableInput) SetDescription(v string) *UpdateConfiguredTableInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateConfiguredTableInput) SetName(v string) *UpdateConfiguredTableInput { - s.Name = &v - return s -} - -type UpdateConfiguredTableOutput struct { - _ struct{} `type:"structure"` - - // The updated configured table. - // - // ConfiguredTable is a required field - ConfiguredTable *ConfiguredTable `locationName:"configuredTable" type:"structure" 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 UpdateConfiguredTableOutput) 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 UpdateConfiguredTableOutput) GoString() string { - return s.String() -} - -// SetConfiguredTable sets the ConfiguredTable field's value. -func (s *UpdateConfiguredTableOutput) SetConfiguredTable(v *ConfiguredTable) *UpdateConfiguredTableOutput { - s.ConfiguredTable = v - return s -} - -type UpdateMembershipInput struct { - _ struct{} `type:"structure"` - - // The default protected query result configuration as specified by the member - // who can receive results. - DefaultResultConfiguration *MembershipProtectedQueryResultConfiguration `locationName:"defaultResultConfiguration" type:"structure"` - - // The unique identifier of the membership. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // An indicator as to whether query logging has been enabled or disabled for - // the membership. - QueryLogStatus *string `locationName:"queryLogStatus" type:"string" enum:"MembershipQueryLogStatus"` -} - -// 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 UpdateMembershipInput) 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 UpdateMembershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateMembershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateMembershipInput"} - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - if s.DefaultResultConfiguration != nil { - if err := s.DefaultResultConfiguration.Validate(); err != nil { - invalidParams.AddNested("DefaultResultConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultResultConfiguration sets the DefaultResultConfiguration field's value. -func (s *UpdateMembershipInput) SetDefaultResultConfiguration(v *MembershipProtectedQueryResultConfiguration) *UpdateMembershipInput { - s.DefaultResultConfiguration = v - return s -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *UpdateMembershipInput) SetMembershipIdentifier(v string) *UpdateMembershipInput { - s.MembershipIdentifier = &v - return s -} - -// SetQueryLogStatus sets the QueryLogStatus field's value. -func (s *UpdateMembershipInput) SetQueryLogStatus(v string) *UpdateMembershipInput { - s.QueryLogStatus = &v - return s -} - -type UpdateMembershipOutput struct { - _ struct{} `type:"structure"` - - // The membership object. - // - // Membership is a required field - Membership *Membership `locationName:"membership" type:"structure" 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 UpdateMembershipOutput) 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 UpdateMembershipOutput) GoString() string { - return s.String() -} - -// SetMembership sets the Membership field's value. -func (s *UpdateMembershipOutput) SetMembership(v *Membership) *UpdateMembershipOutput { - s.Membership = v - return s -} - -type UpdateProtectedQueryInput struct { - _ struct{} `type:"structure"` - - // The identifier for a member of a protected query instance. - // - // MembershipIdentifier is a required field - MembershipIdentifier *string `location:"uri" locationName:"membershipIdentifier" min:"36" type:"string" required:"true"` - - // The identifier for a protected query instance. - // - // ProtectedQueryIdentifier is a required field - ProtectedQueryIdentifier *string `location:"uri" locationName:"protectedQueryIdentifier" min:"36" type:"string" required:"true"` - - // The target status of a query. Used to update the execution status of a currently - // running query. - // - // TargetStatus is a required field - TargetStatus *string `locationName:"targetStatus" type:"string" required:"true" enum:"TargetProtectedQueryStatus"` -} - -// 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 UpdateProtectedQueryInput) 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 UpdateProtectedQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateProtectedQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateProtectedQueryInput"} - if s.MembershipIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("MembershipIdentifier")) - } - if s.MembershipIdentifier != nil && len(*s.MembershipIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MembershipIdentifier", 36)) - } - if s.ProtectedQueryIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProtectedQueryIdentifier")) - } - if s.ProtectedQueryIdentifier != nil && len(*s.ProtectedQueryIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ProtectedQueryIdentifier", 36)) - } - if s.TargetStatus == nil { - invalidParams.Add(request.NewErrParamRequired("TargetStatus")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMembershipIdentifier sets the MembershipIdentifier field's value. -func (s *UpdateProtectedQueryInput) SetMembershipIdentifier(v string) *UpdateProtectedQueryInput { - s.MembershipIdentifier = &v - return s -} - -// SetProtectedQueryIdentifier sets the ProtectedQueryIdentifier field's value. -func (s *UpdateProtectedQueryInput) SetProtectedQueryIdentifier(v string) *UpdateProtectedQueryInput { - s.ProtectedQueryIdentifier = &v - return s -} - -// SetTargetStatus sets the TargetStatus field's value. -func (s *UpdateProtectedQueryInput) SetTargetStatus(v string) *UpdateProtectedQueryInput { - s.TargetStatus = &v - return s -} - -type UpdateProtectedQueryOutput struct { - _ struct{} `type:"structure"` - - // The protected query output. - // - // ProtectedQuery is a required field - ProtectedQuery *ProtectedQuery `locationName:"protectedQuery" type:"structure" 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 UpdateProtectedQueryOutput) 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 UpdateProtectedQueryOutput) GoString() string { - return s.String() -} - -// SetProtectedQuery sets the ProtectedQuery field's value. -func (s *UpdateProtectedQueryOutput) SetProtectedQuery(v *ProtectedQuery) *UpdateProtectedQueryOutput { - s.ProtectedQuery = v - return s -} - -// The input fails to satisfy the specified constraints. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Validation errors for specific input parameters. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // A reason code for the exception. - Reason *string `locationName:"reason" type:"string" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Describes validation errors for specific input parameters. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // A message for the input validation error. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the input parameter. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // AccessDeniedExceptionReasonInsufficientPermissions is a AccessDeniedExceptionReason enum value - AccessDeniedExceptionReasonInsufficientPermissions = "INSUFFICIENT_PERMISSIONS" -) - -// AccessDeniedExceptionReason_Values returns all elements of the AccessDeniedExceptionReason enum -func AccessDeniedExceptionReason_Values() []string { - return []string{ - AccessDeniedExceptionReasonInsufficientPermissions, - } -} - -const ( - // AggregateFunctionNameSum is a AggregateFunctionName enum value - AggregateFunctionNameSum = "SUM" - - // AggregateFunctionNameSumDistinct is a AggregateFunctionName enum value - AggregateFunctionNameSumDistinct = "SUM_DISTINCT" - - // AggregateFunctionNameCount is a AggregateFunctionName enum value - AggregateFunctionNameCount = "COUNT" - - // AggregateFunctionNameCountDistinct is a AggregateFunctionName enum value - AggregateFunctionNameCountDistinct = "COUNT_DISTINCT" - - // AggregateFunctionNameAvg is a AggregateFunctionName enum value - AggregateFunctionNameAvg = "AVG" -) - -// AggregateFunctionName_Values returns all elements of the AggregateFunctionName enum -func AggregateFunctionName_Values() []string { - return []string{ - AggregateFunctionNameSum, - AggregateFunctionNameSumDistinct, - AggregateFunctionNameCount, - AggregateFunctionNameCountDistinct, - AggregateFunctionNameAvg, - } -} - -const ( - // AggregationTypeCountDistinct is a AggregationType enum value - AggregationTypeCountDistinct = "COUNT_DISTINCT" -) - -// AggregationType_Values returns all elements of the AggregationType enum -func AggregationType_Values() []string { - return []string{ - AggregationTypeCountDistinct, - } -} - -const ( - // AnalysisFormatSql is a AnalysisFormat enum value - AnalysisFormatSql = "SQL" -) - -// AnalysisFormat_Values returns all elements of the AnalysisFormat enum -func AnalysisFormat_Values() []string { - return []string{ - AnalysisFormatSql, - } -} - -const ( - // AnalysisMethodDirectQuery is a AnalysisMethod enum value - AnalysisMethodDirectQuery = "DIRECT_QUERY" -) - -// AnalysisMethod_Values returns all elements of the AnalysisMethod enum -func AnalysisMethod_Values() []string { - return []string{ - AnalysisMethodDirectQuery, - } -} - -const ( - // AnalysisRuleTypeAggregation is a AnalysisRuleType enum value - AnalysisRuleTypeAggregation = "AGGREGATION" - - // AnalysisRuleTypeList is a AnalysisRuleType enum value - AnalysisRuleTypeList = "LIST" - - // AnalysisRuleTypeCustom is a AnalysisRuleType enum value - AnalysisRuleTypeCustom = "CUSTOM" -) - -// AnalysisRuleType_Values returns all elements of the AnalysisRuleType enum -func AnalysisRuleType_Values() []string { - return []string{ - AnalysisRuleTypeAggregation, - AnalysisRuleTypeList, - AnalysisRuleTypeCustom, - } -} - -const ( - // CollaborationQueryLogStatusEnabled is a CollaborationQueryLogStatus enum value - CollaborationQueryLogStatusEnabled = "ENABLED" - - // CollaborationQueryLogStatusDisabled is a CollaborationQueryLogStatus enum value - CollaborationQueryLogStatusDisabled = "DISABLED" -) - -// CollaborationQueryLogStatus_Values returns all elements of the CollaborationQueryLogStatus enum -func CollaborationQueryLogStatus_Values() []string { - return []string{ - CollaborationQueryLogStatusEnabled, - CollaborationQueryLogStatusDisabled, - } -} - -const ( - // ConfiguredTableAnalysisRuleTypeAggregation is a ConfiguredTableAnalysisRuleType enum value - ConfiguredTableAnalysisRuleTypeAggregation = "AGGREGATION" - - // ConfiguredTableAnalysisRuleTypeList is a ConfiguredTableAnalysisRuleType enum value - ConfiguredTableAnalysisRuleTypeList = "LIST" - - // ConfiguredTableAnalysisRuleTypeCustom is a ConfiguredTableAnalysisRuleType enum value - ConfiguredTableAnalysisRuleTypeCustom = "CUSTOM" -) - -// ConfiguredTableAnalysisRuleType_Values returns all elements of the ConfiguredTableAnalysisRuleType enum -func ConfiguredTableAnalysisRuleType_Values() []string { - return []string{ - ConfiguredTableAnalysisRuleTypeAggregation, - ConfiguredTableAnalysisRuleTypeList, - ConfiguredTableAnalysisRuleTypeCustom, - } -} - -const ( - // ConflictExceptionReasonAlreadyExists is a ConflictExceptionReason enum value - ConflictExceptionReasonAlreadyExists = "ALREADY_EXISTS" - - // ConflictExceptionReasonSubresourcesExist is a ConflictExceptionReason enum value - ConflictExceptionReasonSubresourcesExist = "SUBRESOURCES_EXIST" - - // ConflictExceptionReasonInvalidState is a ConflictExceptionReason enum value - ConflictExceptionReasonInvalidState = "INVALID_STATE" -) - -// ConflictExceptionReason_Values returns all elements of the ConflictExceptionReason enum -func ConflictExceptionReason_Values() []string { - return []string{ - ConflictExceptionReasonAlreadyExists, - ConflictExceptionReasonSubresourcesExist, - ConflictExceptionReasonInvalidState, - } -} - -const ( - // FilterableMemberStatusInvited is a FilterableMemberStatus enum value - FilterableMemberStatusInvited = "INVITED" - - // FilterableMemberStatusActive is a FilterableMemberStatus enum value - FilterableMemberStatusActive = "ACTIVE" -) - -// FilterableMemberStatus_Values returns all elements of the FilterableMemberStatus enum -func FilterableMemberStatus_Values() []string { - return []string{ - FilterableMemberStatusInvited, - FilterableMemberStatusActive, - } -} - -const ( - // JoinOperatorOr is a JoinOperator enum value - JoinOperatorOr = "OR" - - // JoinOperatorAnd is a JoinOperator enum value - JoinOperatorAnd = "AND" -) - -// JoinOperator_Values returns all elements of the JoinOperator enum -func JoinOperator_Values() []string { - return []string{ - JoinOperatorOr, - JoinOperatorAnd, - } -} - -const ( - // JoinRequiredOptionQueryRunner is a JoinRequiredOption enum value - JoinRequiredOptionQueryRunner = "QUERY_RUNNER" -) - -// JoinRequiredOption_Values returns all elements of the JoinRequiredOption enum -func JoinRequiredOption_Values() []string { - return []string{ - JoinRequiredOptionQueryRunner, - } -} - -const ( - // MemberAbilityCanQuery is a MemberAbility enum value - MemberAbilityCanQuery = "CAN_QUERY" - - // MemberAbilityCanReceiveResults is a MemberAbility enum value - MemberAbilityCanReceiveResults = "CAN_RECEIVE_RESULTS" -) - -// MemberAbility_Values returns all elements of the MemberAbility enum -func MemberAbility_Values() []string { - return []string{ - MemberAbilityCanQuery, - MemberAbilityCanReceiveResults, - } -} - -const ( - // MemberStatusInvited is a MemberStatus enum value - MemberStatusInvited = "INVITED" - - // MemberStatusActive is a MemberStatus enum value - MemberStatusActive = "ACTIVE" - - // MemberStatusLeft is a MemberStatus enum value - MemberStatusLeft = "LEFT" - - // MemberStatusRemoved is a MemberStatus enum value - MemberStatusRemoved = "REMOVED" -) - -// MemberStatus_Values returns all elements of the MemberStatus enum -func MemberStatus_Values() []string { - return []string{ - MemberStatusInvited, - MemberStatusActive, - MemberStatusLeft, - MemberStatusRemoved, - } -} - -const ( - // MembershipQueryLogStatusEnabled is a MembershipQueryLogStatus enum value - MembershipQueryLogStatusEnabled = "ENABLED" - - // MembershipQueryLogStatusDisabled is a MembershipQueryLogStatus enum value - MembershipQueryLogStatusDisabled = "DISABLED" -) - -// MembershipQueryLogStatus_Values returns all elements of the MembershipQueryLogStatus enum -func MembershipQueryLogStatus_Values() []string { - return []string{ - MembershipQueryLogStatusEnabled, - MembershipQueryLogStatusDisabled, - } -} - -const ( - // MembershipStatusActive is a MembershipStatus enum value - MembershipStatusActive = "ACTIVE" - - // MembershipStatusRemoved is a MembershipStatus enum value - MembershipStatusRemoved = "REMOVED" - - // MembershipStatusCollaborationDeleted is a MembershipStatus enum value - MembershipStatusCollaborationDeleted = "COLLABORATION_DELETED" -) - -// MembershipStatus_Values returns all elements of the MembershipStatus enum -func MembershipStatus_Values() []string { - return []string{ - MembershipStatusActive, - MembershipStatusRemoved, - MembershipStatusCollaborationDeleted, - } -} - -const ( - // ParameterTypeSmallint is a ParameterType enum value - ParameterTypeSmallint = "SMALLINT" - - // ParameterTypeInteger is a ParameterType enum value - ParameterTypeInteger = "INTEGER" - - // ParameterTypeBigint is a ParameterType enum value - ParameterTypeBigint = "BIGINT" - - // ParameterTypeDecimal is a ParameterType enum value - ParameterTypeDecimal = "DECIMAL" - - // ParameterTypeReal is a ParameterType enum value - ParameterTypeReal = "REAL" - - // ParameterTypeDoublePrecision is a ParameterType enum value - ParameterTypeDoublePrecision = "DOUBLE_PRECISION" - - // ParameterTypeBoolean is a ParameterType enum value - ParameterTypeBoolean = "BOOLEAN" - - // ParameterTypeChar is a ParameterType enum value - ParameterTypeChar = "CHAR" - - // ParameterTypeVarchar is a ParameterType enum value - ParameterTypeVarchar = "VARCHAR" - - // ParameterTypeDate is a ParameterType enum value - ParameterTypeDate = "DATE" - - // ParameterTypeTimestamp is a ParameterType enum value - ParameterTypeTimestamp = "TIMESTAMP" - - // ParameterTypeTimestamptz is a ParameterType enum value - ParameterTypeTimestamptz = "TIMESTAMPTZ" - - // ParameterTypeTime is a ParameterType enum value - ParameterTypeTime = "TIME" - - // ParameterTypeTimetz is a ParameterType enum value - ParameterTypeTimetz = "TIMETZ" - - // ParameterTypeVarbyte is a ParameterType enum value - ParameterTypeVarbyte = "VARBYTE" -) - -// ParameterType_Values returns all elements of the ParameterType enum -func ParameterType_Values() []string { - return []string{ - ParameterTypeSmallint, - ParameterTypeInteger, - ParameterTypeBigint, - ParameterTypeDecimal, - ParameterTypeReal, - ParameterTypeDoublePrecision, - ParameterTypeBoolean, - ParameterTypeChar, - ParameterTypeVarchar, - ParameterTypeDate, - ParameterTypeTimestamp, - ParameterTypeTimestamptz, - ParameterTypeTime, - ParameterTypeTimetz, - ParameterTypeVarbyte, - } -} - -const ( - // ProtectedQueryStatusSubmitted is a ProtectedQueryStatus enum value - ProtectedQueryStatusSubmitted = "SUBMITTED" - - // ProtectedQueryStatusStarted is a ProtectedQueryStatus enum value - ProtectedQueryStatusStarted = "STARTED" - - // ProtectedQueryStatusCancelled is a ProtectedQueryStatus enum value - ProtectedQueryStatusCancelled = "CANCELLED" - - // ProtectedQueryStatusCancelling is a ProtectedQueryStatus enum value - ProtectedQueryStatusCancelling = "CANCELLING" - - // ProtectedQueryStatusFailed is a ProtectedQueryStatus enum value - ProtectedQueryStatusFailed = "FAILED" - - // ProtectedQueryStatusSuccess is a ProtectedQueryStatus enum value - ProtectedQueryStatusSuccess = "SUCCESS" - - // ProtectedQueryStatusTimedOut is a ProtectedQueryStatus enum value - ProtectedQueryStatusTimedOut = "TIMED_OUT" -) - -// ProtectedQueryStatus_Values returns all elements of the ProtectedQueryStatus enum -func ProtectedQueryStatus_Values() []string { - return []string{ - ProtectedQueryStatusSubmitted, - ProtectedQueryStatusStarted, - ProtectedQueryStatusCancelled, - ProtectedQueryStatusCancelling, - ProtectedQueryStatusFailed, - ProtectedQueryStatusSuccess, - ProtectedQueryStatusTimedOut, - } -} - -const ( - // ProtectedQueryTypeSql is a ProtectedQueryType enum value - ProtectedQueryTypeSql = "SQL" -) - -// ProtectedQueryType_Values returns all elements of the ProtectedQueryType enum -func ProtectedQueryType_Values() []string { - return []string{ - ProtectedQueryTypeSql, - } -} - -const ( - // ResourceTypeConfiguredTable is a ResourceType enum value - ResourceTypeConfiguredTable = "CONFIGURED_TABLE" - - // ResourceTypeCollaboration is a ResourceType enum value - ResourceTypeCollaboration = "COLLABORATION" - - // ResourceTypeMembership is a ResourceType enum value - ResourceTypeMembership = "MEMBERSHIP" - - // ResourceTypeConfiguredTableAssociation is a ResourceType enum value - ResourceTypeConfiguredTableAssociation = "CONFIGURED_TABLE_ASSOCIATION" -) - -// ResourceType_Values returns all elements of the ResourceType enum -func ResourceType_Values() []string { - return []string{ - ResourceTypeConfiguredTable, - ResourceTypeCollaboration, - ResourceTypeMembership, - ResourceTypeConfiguredTableAssociation, - } -} - -const ( - // ResultFormatCsv is a ResultFormat enum value - ResultFormatCsv = "CSV" - - // ResultFormatParquet is a ResultFormat enum value - ResultFormatParquet = "PARQUET" -) - -// ResultFormat_Values returns all elements of the ResultFormat enum -func ResultFormat_Values() []string { - return []string{ - ResultFormatCsv, - ResultFormatParquet, - } -} - -const ( - // ScalarFunctionsTrunc is a ScalarFunctions enum value - ScalarFunctionsTrunc = "TRUNC" - - // ScalarFunctionsAbs is a ScalarFunctions enum value - ScalarFunctionsAbs = "ABS" - - // ScalarFunctionsCeiling is a ScalarFunctions enum value - ScalarFunctionsCeiling = "CEILING" - - // ScalarFunctionsFloor is a ScalarFunctions enum value - ScalarFunctionsFloor = "FLOOR" - - // ScalarFunctionsLn is a ScalarFunctions enum value - ScalarFunctionsLn = "LN" - - // ScalarFunctionsLog is a ScalarFunctions enum value - ScalarFunctionsLog = "LOG" - - // ScalarFunctionsRound is a ScalarFunctions enum value - ScalarFunctionsRound = "ROUND" - - // ScalarFunctionsSqrt is a ScalarFunctions enum value - ScalarFunctionsSqrt = "SQRT" - - // ScalarFunctionsCast is a ScalarFunctions enum value - ScalarFunctionsCast = "CAST" - - // ScalarFunctionsLower is a ScalarFunctions enum value - ScalarFunctionsLower = "LOWER" - - // ScalarFunctionsRtrim is a ScalarFunctions enum value - ScalarFunctionsRtrim = "RTRIM" - - // ScalarFunctionsUpper is a ScalarFunctions enum value - ScalarFunctionsUpper = "UPPER" - - // ScalarFunctionsCoalesce is a ScalarFunctions enum value - ScalarFunctionsCoalesce = "COALESCE" -) - -// ScalarFunctions_Values returns all elements of the ScalarFunctions enum -func ScalarFunctions_Values() []string { - return []string{ - ScalarFunctionsTrunc, - ScalarFunctionsAbs, - ScalarFunctionsCeiling, - ScalarFunctionsFloor, - ScalarFunctionsLn, - ScalarFunctionsLog, - ScalarFunctionsRound, - ScalarFunctionsSqrt, - ScalarFunctionsCast, - ScalarFunctionsLower, - ScalarFunctionsRtrim, - ScalarFunctionsUpper, - ScalarFunctionsCoalesce, - } -} - -const ( - // SchemaTypeTable is a SchemaType enum value - SchemaTypeTable = "TABLE" -) - -// SchemaType_Values returns all elements of the SchemaType enum -func SchemaType_Values() []string { - return []string{ - SchemaTypeTable, - } -} - -const ( - // TargetProtectedQueryStatusCancelled is a TargetProtectedQueryStatus enum value - TargetProtectedQueryStatusCancelled = "CANCELLED" -) - -// TargetProtectedQueryStatus_Values returns all elements of the TargetProtectedQueryStatus enum -func TargetProtectedQueryStatus_Values() []string { - return []string{ - TargetProtectedQueryStatusCancelled, - } -} - -const ( - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "FIELD_VALIDATION_FAILED" - - // ValidationExceptionReasonInvalidConfiguration is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidConfiguration = "INVALID_CONFIGURATION" - - // ValidationExceptionReasonInvalidQuery is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidQuery = "INVALID_QUERY" - - // ValidationExceptionReasonIamSynchronizationDelay is a ValidationExceptionReason enum value - ValidationExceptionReasonIamSynchronizationDelay = "IAM_SYNCHRONIZATION_DELAY" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonInvalidConfiguration, - ValidationExceptionReasonInvalidQuery, - ValidationExceptionReasonIamSynchronizationDelay, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/cleanroomsiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/cleanroomsiface/interface.go deleted file mode 100644 index c7d72898c0a3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/cleanroomsiface/interface.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package cleanroomsiface provides an interface to enable mocking the AWS Clean Rooms Service service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package cleanroomsiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms" -) - -// CleanRoomsAPI provides an interface to enable mocking the -// cleanrooms.CleanRooms service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Clean Rooms Service. -// func myFunc(svc cleanroomsiface.CleanRoomsAPI) bool { -// // Make svc.BatchGetCollaborationAnalysisTemplate request -// } -// -// func main() { -// sess := session.New() -// svc := cleanrooms.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockCleanRoomsClient struct { -// cleanroomsiface.CleanRoomsAPI -// } -// func (m *mockCleanRoomsClient) BatchGetCollaborationAnalysisTemplate(input *cleanrooms.BatchGetCollaborationAnalysisTemplateInput) (*cleanrooms.BatchGetCollaborationAnalysisTemplateOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockCleanRoomsClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type CleanRoomsAPI interface { - BatchGetCollaborationAnalysisTemplate(*cleanrooms.BatchGetCollaborationAnalysisTemplateInput) (*cleanrooms.BatchGetCollaborationAnalysisTemplateOutput, error) - BatchGetCollaborationAnalysisTemplateWithContext(aws.Context, *cleanrooms.BatchGetCollaborationAnalysisTemplateInput, ...request.Option) (*cleanrooms.BatchGetCollaborationAnalysisTemplateOutput, error) - BatchGetCollaborationAnalysisTemplateRequest(*cleanrooms.BatchGetCollaborationAnalysisTemplateInput) (*request.Request, *cleanrooms.BatchGetCollaborationAnalysisTemplateOutput) - - BatchGetSchema(*cleanrooms.BatchGetSchemaInput) (*cleanrooms.BatchGetSchemaOutput, error) - BatchGetSchemaWithContext(aws.Context, *cleanrooms.BatchGetSchemaInput, ...request.Option) (*cleanrooms.BatchGetSchemaOutput, error) - BatchGetSchemaRequest(*cleanrooms.BatchGetSchemaInput) (*request.Request, *cleanrooms.BatchGetSchemaOutput) - - CreateAnalysisTemplate(*cleanrooms.CreateAnalysisTemplateInput) (*cleanrooms.CreateAnalysisTemplateOutput, error) - CreateAnalysisTemplateWithContext(aws.Context, *cleanrooms.CreateAnalysisTemplateInput, ...request.Option) (*cleanrooms.CreateAnalysisTemplateOutput, error) - CreateAnalysisTemplateRequest(*cleanrooms.CreateAnalysisTemplateInput) (*request.Request, *cleanrooms.CreateAnalysisTemplateOutput) - - CreateCollaboration(*cleanrooms.CreateCollaborationInput) (*cleanrooms.CreateCollaborationOutput, error) - CreateCollaborationWithContext(aws.Context, *cleanrooms.CreateCollaborationInput, ...request.Option) (*cleanrooms.CreateCollaborationOutput, error) - CreateCollaborationRequest(*cleanrooms.CreateCollaborationInput) (*request.Request, *cleanrooms.CreateCollaborationOutput) - - CreateConfiguredTable(*cleanrooms.CreateConfiguredTableInput) (*cleanrooms.CreateConfiguredTableOutput, error) - CreateConfiguredTableWithContext(aws.Context, *cleanrooms.CreateConfiguredTableInput, ...request.Option) (*cleanrooms.CreateConfiguredTableOutput, error) - CreateConfiguredTableRequest(*cleanrooms.CreateConfiguredTableInput) (*request.Request, *cleanrooms.CreateConfiguredTableOutput) - - CreateConfiguredTableAnalysisRule(*cleanrooms.CreateConfiguredTableAnalysisRuleInput) (*cleanrooms.CreateConfiguredTableAnalysisRuleOutput, error) - CreateConfiguredTableAnalysisRuleWithContext(aws.Context, *cleanrooms.CreateConfiguredTableAnalysisRuleInput, ...request.Option) (*cleanrooms.CreateConfiguredTableAnalysisRuleOutput, error) - CreateConfiguredTableAnalysisRuleRequest(*cleanrooms.CreateConfiguredTableAnalysisRuleInput) (*request.Request, *cleanrooms.CreateConfiguredTableAnalysisRuleOutput) - - CreateConfiguredTableAssociation(*cleanrooms.CreateConfiguredTableAssociationInput) (*cleanrooms.CreateConfiguredTableAssociationOutput, error) - CreateConfiguredTableAssociationWithContext(aws.Context, *cleanrooms.CreateConfiguredTableAssociationInput, ...request.Option) (*cleanrooms.CreateConfiguredTableAssociationOutput, error) - CreateConfiguredTableAssociationRequest(*cleanrooms.CreateConfiguredTableAssociationInput) (*request.Request, *cleanrooms.CreateConfiguredTableAssociationOutput) - - CreateMembership(*cleanrooms.CreateMembershipInput) (*cleanrooms.CreateMembershipOutput, error) - CreateMembershipWithContext(aws.Context, *cleanrooms.CreateMembershipInput, ...request.Option) (*cleanrooms.CreateMembershipOutput, error) - CreateMembershipRequest(*cleanrooms.CreateMembershipInput) (*request.Request, *cleanrooms.CreateMembershipOutput) - - DeleteAnalysisTemplate(*cleanrooms.DeleteAnalysisTemplateInput) (*cleanrooms.DeleteAnalysisTemplateOutput, error) - DeleteAnalysisTemplateWithContext(aws.Context, *cleanrooms.DeleteAnalysisTemplateInput, ...request.Option) (*cleanrooms.DeleteAnalysisTemplateOutput, error) - DeleteAnalysisTemplateRequest(*cleanrooms.DeleteAnalysisTemplateInput) (*request.Request, *cleanrooms.DeleteAnalysisTemplateOutput) - - DeleteCollaboration(*cleanrooms.DeleteCollaborationInput) (*cleanrooms.DeleteCollaborationOutput, error) - DeleteCollaborationWithContext(aws.Context, *cleanrooms.DeleteCollaborationInput, ...request.Option) (*cleanrooms.DeleteCollaborationOutput, error) - DeleteCollaborationRequest(*cleanrooms.DeleteCollaborationInput) (*request.Request, *cleanrooms.DeleteCollaborationOutput) - - DeleteConfiguredTable(*cleanrooms.DeleteConfiguredTableInput) (*cleanrooms.DeleteConfiguredTableOutput, error) - DeleteConfiguredTableWithContext(aws.Context, *cleanrooms.DeleteConfiguredTableInput, ...request.Option) (*cleanrooms.DeleteConfiguredTableOutput, error) - DeleteConfiguredTableRequest(*cleanrooms.DeleteConfiguredTableInput) (*request.Request, *cleanrooms.DeleteConfiguredTableOutput) - - DeleteConfiguredTableAnalysisRule(*cleanrooms.DeleteConfiguredTableAnalysisRuleInput) (*cleanrooms.DeleteConfiguredTableAnalysisRuleOutput, error) - DeleteConfiguredTableAnalysisRuleWithContext(aws.Context, *cleanrooms.DeleteConfiguredTableAnalysisRuleInput, ...request.Option) (*cleanrooms.DeleteConfiguredTableAnalysisRuleOutput, error) - DeleteConfiguredTableAnalysisRuleRequest(*cleanrooms.DeleteConfiguredTableAnalysisRuleInput) (*request.Request, *cleanrooms.DeleteConfiguredTableAnalysisRuleOutput) - - DeleteConfiguredTableAssociation(*cleanrooms.DeleteConfiguredTableAssociationInput) (*cleanrooms.DeleteConfiguredTableAssociationOutput, error) - DeleteConfiguredTableAssociationWithContext(aws.Context, *cleanrooms.DeleteConfiguredTableAssociationInput, ...request.Option) (*cleanrooms.DeleteConfiguredTableAssociationOutput, error) - DeleteConfiguredTableAssociationRequest(*cleanrooms.DeleteConfiguredTableAssociationInput) (*request.Request, *cleanrooms.DeleteConfiguredTableAssociationOutput) - - DeleteMember(*cleanrooms.DeleteMemberInput) (*cleanrooms.DeleteMemberOutput, error) - DeleteMemberWithContext(aws.Context, *cleanrooms.DeleteMemberInput, ...request.Option) (*cleanrooms.DeleteMemberOutput, error) - DeleteMemberRequest(*cleanrooms.DeleteMemberInput) (*request.Request, *cleanrooms.DeleteMemberOutput) - - DeleteMembership(*cleanrooms.DeleteMembershipInput) (*cleanrooms.DeleteMembershipOutput, error) - DeleteMembershipWithContext(aws.Context, *cleanrooms.DeleteMembershipInput, ...request.Option) (*cleanrooms.DeleteMembershipOutput, error) - DeleteMembershipRequest(*cleanrooms.DeleteMembershipInput) (*request.Request, *cleanrooms.DeleteMembershipOutput) - - GetAnalysisTemplate(*cleanrooms.GetAnalysisTemplateInput) (*cleanrooms.GetAnalysisTemplateOutput, error) - GetAnalysisTemplateWithContext(aws.Context, *cleanrooms.GetAnalysisTemplateInput, ...request.Option) (*cleanrooms.GetAnalysisTemplateOutput, error) - GetAnalysisTemplateRequest(*cleanrooms.GetAnalysisTemplateInput) (*request.Request, *cleanrooms.GetAnalysisTemplateOutput) - - GetCollaboration(*cleanrooms.GetCollaborationInput) (*cleanrooms.GetCollaborationOutput, error) - GetCollaborationWithContext(aws.Context, *cleanrooms.GetCollaborationInput, ...request.Option) (*cleanrooms.GetCollaborationOutput, error) - GetCollaborationRequest(*cleanrooms.GetCollaborationInput) (*request.Request, *cleanrooms.GetCollaborationOutput) - - GetCollaborationAnalysisTemplate(*cleanrooms.GetCollaborationAnalysisTemplateInput) (*cleanrooms.GetCollaborationAnalysisTemplateOutput, error) - GetCollaborationAnalysisTemplateWithContext(aws.Context, *cleanrooms.GetCollaborationAnalysisTemplateInput, ...request.Option) (*cleanrooms.GetCollaborationAnalysisTemplateOutput, error) - GetCollaborationAnalysisTemplateRequest(*cleanrooms.GetCollaborationAnalysisTemplateInput) (*request.Request, *cleanrooms.GetCollaborationAnalysisTemplateOutput) - - GetConfiguredTable(*cleanrooms.GetConfiguredTableInput) (*cleanrooms.GetConfiguredTableOutput, error) - GetConfiguredTableWithContext(aws.Context, *cleanrooms.GetConfiguredTableInput, ...request.Option) (*cleanrooms.GetConfiguredTableOutput, error) - GetConfiguredTableRequest(*cleanrooms.GetConfiguredTableInput) (*request.Request, *cleanrooms.GetConfiguredTableOutput) - - GetConfiguredTableAnalysisRule(*cleanrooms.GetConfiguredTableAnalysisRuleInput) (*cleanrooms.GetConfiguredTableAnalysisRuleOutput, error) - GetConfiguredTableAnalysisRuleWithContext(aws.Context, *cleanrooms.GetConfiguredTableAnalysisRuleInput, ...request.Option) (*cleanrooms.GetConfiguredTableAnalysisRuleOutput, error) - GetConfiguredTableAnalysisRuleRequest(*cleanrooms.GetConfiguredTableAnalysisRuleInput) (*request.Request, *cleanrooms.GetConfiguredTableAnalysisRuleOutput) - - GetConfiguredTableAssociation(*cleanrooms.GetConfiguredTableAssociationInput) (*cleanrooms.GetConfiguredTableAssociationOutput, error) - GetConfiguredTableAssociationWithContext(aws.Context, *cleanrooms.GetConfiguredTableAssociationInput, ...request.Option) (*cleanrooms.GetConfiguredTableAssociationOutput, error) - GetConfiguredTableAssociationRequest(*cleanrooms.GetConfiguredTableAssociationInput) (*request.Request, *cleanrooms.GetConfiguredTableAssociationOutput) - - GetMembership(*cleanrooms.GetMembershipInput) (*cleanrooms.GetMembershipOutput, error) - GetMembershipWithContext(aws.Context, *cleanrooms.GetMembershipInput, ...request.Option) (*cleanrooms.GetMembershipOutput, error) - GetMembershipRequest(*cleanrooms.GetMembershipInput) (*request.Request, *cleanrooms.GetMembershipOutput) - - GetProtectedQuery(*cleanrooms.GetProtectedQueryInput) (*cleanrooms.GetProtectedQueryOutput, error) - GetProtectedQueryWithContext(aws.Context, *cleanrooms.GetProtectedQueryInput, ...request.Option) (*cleanrooms.GetProtectedQueryOutput, error) - GetProtectedQueryRequest(*cleanrooms.GetProtectedQueryInput) (*request.Request, *cleanrooms.GetProtectedQueryOutput) - - GetSchema(*cleanrooms.GetSchemaInput) (*cleanrooms.GetSchemaOutput, error) - GetSchemaWithContext(aws.Context, *cleanrooms.GetSchemaInput, ...request.Option) (*cleanrooms.GetSchemaOutput, error) - GetSchemaRequest(*cleanrooms.GetSchemaInput) (*request.Request, *cleanrooms.GetSchemaOutput) - - GetSchemaAnalysisRule(*cleanrooms.GetSchemaAnalysisRuleInput) (*cleanrooms.GetSchemaAnalysisRuleOutput, error) - GetSchemaAnalysisRuleWithContext(aws.Context, *cleanrooms.GetSchemaAnalysisRuleInput, ...request.Option) (*cleanrooms.GetSchemaAnalysisRuleOutput, error) - GetSchemaAnalysisRuleRequest(*cleanrooms.GetSchemaAnalysisRuleInput) (*request.Request, *cleanrooms.GetSchemaAnalysisRuleOutput) - - ListAnalysisTemplates(*cleanrooms.ListAnalysisTemplatesInput) (*cleanrooms.ListAnalysisTemplatesOutput, error) - ListAnalysisTemplatesWithContext(aws.Context, *cleanrooms.ListAnalysisTemplatesInput, ...request.Option) (*cleanrooms.ListAnalysisTemplatesOutput, error) - ListAnalysisTemplatesRequest(*cleanrooms.ListAnalysisTemplatesInput) (*request.Request, *cleanrooms.ListAnalysisTemplatesOutput) - - ListAnalysisTemplatesPages(*cleanrooms.ListAnalysisTemplatesInput, func(*cleanrooms.ListAnalysisTemplatesOutput, bool) bool) error - ListAnalysisTemplatesPagesWithContext(aws.Context, *cleanrooms.ListAnalysisTemplatesInput, func(*cleanrooms.ListAnalysisTemplatesOutput, bool) bool, ...request.Option) error - - ListCollaborationAnalysisTemplates(*cleanrooms.ListCollaborationAnalysisTemplatesInput) (*cleanrooms.ListCollaborationAnalysisTemplatesOutput, error) - ListCollaborationAnalysisTemplatesWithContext(aws.Context, *cleanrooms.ListCollaborationAnalysisTemplatesInput, ...request.Option) (*cleanrooms.ListCollaborationAnalysisTemplatesOutput, error) - ListCollaborationAnalysisTemplatesRequest(*cleanrooms.ListCollaborationAnalysisTemplatesInput) (*request.Request, *cleanrooms.ListCollaborationAnalysisTemplatesOutput) - - ListCollaborationAnalysisTemplatesPages(*cleanrooms.ListCollaborationAnalysisTemplatesInput, func(*cleanrooms.ListCollaborationAnalysisTemplatesOutput, bool) bool) error - ListCollaborationAnalysisTemplatesPagesWithContext(aws.Context, *cleanrooms.ListCollaborationAnalysisTemplatesInput, func(*cleanrooms.ListCollaborationAnalysisTemplatesOutput, bool) bool, ...request.Option) error - - ListCollaborations(*cleanrooms.ListCollaborationsInput) (*cleanrooms.ListCollaborationsOutput, error) - ListCollaborationsWithContext(aws.Context, *cleanrooms.ListCollaborationsInput, ...request.Option) (*cleanrooms.ListCollaborationsOutput, error) - ListCollaborationsRequest(*cleanrooms.ListCollaborationsInput) (*request.Request, *cleanrooms.ListCollaborationsOutput) - - ListCollaborationsPages(*cleanrooms.ListCollaborationsInput, func(*cleanrooms.ListCollaborationsOutput, bool) bool) error - ListCollaborationsPagesWithContext(aws.Context, *cleanrooms.ListCollaborationsInput, func(*cleanrooms.ListCollaborationsOutput, bool) bool, ...request.Option) error - - ListConfiguredTableAssociations(*cleanrooms.ListConfiguredTableAssociationsInput) (*cleanrooms.ListConfiguredTableAssociationsOutput, error) - ListConfiguredTableAssociationsWithContext(aws.Context, *cleanrooms.ListConfiguredTableAssociationsInput, ...request.Option) (*cleanrooms.ListConfiguredTableAssociationsOutput, error) - ListConfiguredTableAssociationsRequest(*cleanrooms.ListConfiguredTableAssociationsInput) (*request.Request, *cleanrooms.ListConfiguredTableAssociationsOutput) - - ListConfiguredTableAssociationsPages(*cleanrooms.ListConfiguredTableAssociationsInput, func(*cleanrooms.ListConfiguredTableAssociationsOutput, bool) bool) error - ListConfiguredTableAssociationsPagesWithContext(aws.Context, *cleanrooms.ListConfiguredTableAssociationsInput, func(*cleanrooms.ListConfiguredTableAssociationsOutput, bool) bool, ...request.Option) error - - ListConfiguredTables(*cleanrooms.ListConfiguredTablesInput) (*cleanrooms.ListConfiguredTablesOutput, error) - ListConfiguredTablesWithContext(aws.Context, *cleanrooms.ListConfiguredTablesInput, ...request.Option) (*cleanrooms.ListConfiguredTablesOutput, error) - ListConfiguredTablesRequest(*cleanrooms.ListConfiguredTablesInput) (*request.Request, *cleanrooms.ListConfiguredTablesOutput) - - ListConfiguredTablesPages(*cleanrooms.ListConfiguredTablesInput, func(*cleanrooms.ListConfiguredTablesOutput, bool) bool) error - ListConfiguredTablesPagesWithContext(aws.Context, *cleanrooms.ListConfiguredTablesInput, func(*cleanrooms.ListConfiguredTablesOutput, bool) bool, ...request.Option) error - - ListMembers(*cleanrooms.ListMembersInput) (*cleanrooms.ListMembersOutput, error) - ListMembersWithContext(aws.Context, *cleanrooms.ListMembersInput, ...request.Option) (*cleanrooms.ListMembersOutput, error) - ListMembersRequest(*cleanrooms.ListMembersInput) (*request.Request, *cleanrooms.ListMembersOutput) - - ListMembersPages(*cleanrooms.ListMembersInput, func(*cleanrooms.ListMembersOutput, bool) bool) error - ListMembersPagesWithContext(aws.Context, *cleanrooms.ListMembersInput, func(*cleanrooms.ListMembersOutput, bool) bool, ...request.Option) error - - ListMemberships(*cleanrooms.ListMembershipsInput) (*cleanrooms.ListMembershipsOutput, error) - ListMembershipsWithContext(aws.Context, *cleanrooms.ListMembershipsInput, ...request.Option) (*cleanrooms.ListMembershipsOutput, error) - ListMembershipsRequest(*cleanrooms.ListMembershipsInput) (*request.Request, *cleanrooms.ListMembershipsOutput) - - ListMembershipsPages(*cleanrooms.ListMembershipsInput, func(*cleanrooms.ListMembershipsOutput, bool) bool) error - ListMembershipsPagesWithContext(aws.Context, *cleanrooms.ListMembershipsInput, func(*cleanrooms.ListMembershipsOutput, bool) bool, ...request.Option) error - - ListProtectedQueries(*cleanrooms.ListProtectedQueriesInput) (*cleanrooms.ListProtectedQueriesOutput, error) - ListProtectedQueriesWithContext(aws.Context, *cleanrooms.ListProtectedQueriesInput, ...request.Option) (*cleanrooms.ListProtectedQueriesOutput, error) - ListProtectedQueriesRequest(*cleanrooms.ListProtectedQueriesInput) (*request.Request, *cleanrooms.ListProtectedQueriesOutput) - - ListProtectedQueriesPages(*cleanrooms.ListProtectedQueriesInput, func(*cleanrooms.ListProtectedQueriesOutput, bool) bool) error - ListProtectedQueriesPagesWithContext(aws.Context, *cleanrooms.ListProtectedQueriesInput, func(*cleanrooms.ListProtectedQueriesOutput, bool) bool, ...request.Option) error - - ListSchemas(*cleanrooms.ListSchemasInput) (*cleanrooms.ListSchemasOutput, error) - ListSchemasWithContext(aws.Context, *cleanrooms.ListSchemasInput, ...request.Option) (*cleanrooms.ListSchemasOutput, error) - ListSchemasRequest(*cleanrooms.ListSchemasInput) (*request.Request, *cleanrooms.ListSchemasOutput) - - ListSchemasPages(*cleanrooms.ListSchemasInput, func(*cleanrooms.ListSchemasOutput, bool) bool) error - ListSchemasPagesWithContext(aws.Context, *cleanrooms.ListSchemasInput, func(*cleanrooms.ListSchemasOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*cleanrooms.ListTagsForResourceInput) (*cleanrooms.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *cleanrooms.ListTagsForResourceInput, ...request.Option) (*cleanrooms.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*cleanrooms.ListTagsForResourceInput) (*request.Request, *cleanrooms.ListTagsForResourceOutput) - - StartProtectedQuery(*cleanrooms.StartProtectedQueryInput) (*cleanrooms.StartProtectedQueryOutput, error) - StartProtectedQueryWithContext(aws.Context, *cleanrooms.StartProtectedQueryInput, ...request.Option) (*cleanrooms.StartProtectedQueryOutput, error) - StartProtectedQueryRequest(*cleanrooms.StartProtectedQueryInput) (*request.Request, *cleanrooms.StartProtectedQueryOutput) - - TagResource(*cleanrooms.TagResourceInput) (*cleanrooms.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *cleanrooms.TagResourceInput, ...request.Option) (*cleanrooms.TagResourceOutput, error) - TagResourceRequest(*cleanrooms.TagResourceInput) (*request.Request, *cleanrooms.TagResourceOutput) - - UntagResource(*cleanrooms.UntagResourceInput) (*cleanrooms.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *cleanrooms.UntagResourceInput, ...request.Option) (*cleanrooms.UntagResourceOutput, error) - UntagResourceRequest(*cleanrooms.UntagResourceInput) (*request.Request, *cleanrooms.UntagResourceOutput) - - UpdateAnalysisTemplate(*cleanrooms.UpdateAnalysisTemplateInput) (*cleanrooms.UpdateAnalysisTemplateOutput, error) - UpdateAnalysisTemplateWithContext(aws.Context, *cleanrooms.UpdateAnalysisTemplateInput, ...request.Option) (*cleanrooms.UpdateAnalysisTemplateOutput, error) - UpdateAnalysisTemplateRequest(*cleanrooms.UpdateAnalysisTemplateInput) (*request.Request, *cleanrooms.UpdateAnalysisTemplateOutput) - - UpdateCollaboration(*cleanrooms.UpdateCollaborationInput) (*cleanrooms.UpdateCollaborationOutput, error) - UpdateCollaborationWithContext(aws.Context, *cleanrooms.UpdateCollaborationInput, ...request.Option) (*cleanrooms.UpdateCollaborationOutput, error) - UpdateCollaborationRequest(*cleanrooms.UpdateCollaborationInput) (*request.Request, *cleanrooms.UpdateCollaborationOutput) - - UpdateConfiguredTable(*cleanrooms.UpdateConfiguredTableInput) (*cleanrooms.UpdateConfiguredTableOutput, error) - UpdateConfiguredTableWithContext(aws.Context, *cleanrooms.UpdateConfiguredTableInput, ...request.Option) (*cleanrooms.UpdateConfiguredTableOutput, error) - UpdateConfiguredTableRequest(*cleanrooms.UpdateConfiguredTableInput) (*request.Request, *cleanrooms.UpdateConfiguredTableOutput) - - UpdateConfiguredTableAnalysisRule(*cleanrooms.UpdateConfiguredTableAnalysisRuleInput) (*cleanrooms.UpdateConfiguredTableAnalysisRuleOutput, error) - UpdateConfiguredTableAnalysisRuleWithContext(aws.Context, *cleanrooms.UpdateConfiguredTableAnalysisRuleInput, ...request.Option) (*cleanrooms.UpdateConfiguredTableAnalysisRuleOutput, error) - UpdateConfiguredTableAnalysisRuleRequest(*cleanrooms.UpdateConfiguredTableAnalysisRuleInput) (*request.Request, *cleanrooms.UpdateConfiguredTableAnalysisRuleOutput) - - UpdateConfiguredTableAssociation(*cleanrooms.UpdateConfiguredTableAssociationInput) (*cleanrooms.UpdateConfiguredTableAssociationOutput, error) - UpdateConfiguredTableAssociationWithContext(aws.Context, *cleanrooms.UpdateConfiguredTableAssociationInput, ...request.Option) (*cleanrooms.UpdateConfiguredTableAssociationOutput, error) - UpdateConfiguredTableAssociationRequest(*cleanrooms.UpdateConfiguredTableAssociationInput) (*request.Request, *cleanrooms.UpdateConfiguredTableAssociationOutput) - - UpdateMembership(*cleanrooms.UpdateMembershipInput) (*cleanrooms.UpdateMembershipOutput, error) - UpdateMembershipWithContext(aws.Context, *cleanrooms.UpdateMembershipInput, ...request.Option) (*cleanrooms.UpdateMembershipOutput, error) - UpdateMembershipRequest(*cleanrooms.UpdateMembershipInput) (*request.Request, *cleanrooms.UpdateMembershipOutput) - - UpdateProtectedQuery(*cleanrooms.UpdateProtectedQueryInput) (*cleanrooms.UpdateProtectedQueryOutput, error) - UpdateProtectedQueryWithContext(aws.Context, *cleanrooms.UpdateProtectedQueryInput, ...request.Option) (*cleanrooms.UpdateProtectedQueryOutput, error) - UpdateProtectedQueryRequest(*cleanrooms.UpdateProtectedQueryInput) (*request.Request, *cleanrooms.UpdateProtectedQueryOutput) -} - -var _ CleanRoomsAPI = (*cleanrooms.CleanRooms)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/doc.go deleted file mode 100644 index 98064e040f04..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/doc.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package cleanrooms provides the client and types for making API -// requests to AWS Clean Rooms Service. -// -// Welcome to the Clean Rooms API Reference. -// -// Clean Rooms is an Amazon Web Services service that helps multiple parties -// to join their data together in a secure collaboration workspace. In the collaboration, -// members who can query and receive results can get insights into the collective -// datasets without either party getting access to the other party's raw data. -// -// To learn more about Clean Rooms concepts, procedures, and best practices, -// see the Clean Rooms User Guide (https://docs.aws.amazon.com/clean-rooms/latest/userguide/what-is.html). -// -// To learn more about SQL commands, functions, and conditions supported in -// Clean Rooms, see the Clean Rooms SQL Reference (https://docs.aws.amazon.com/clean-rooms/latest/sql-reference/sql-reference.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17 for more information on this service. -// -// See cleanrooms package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/cleanrooms/ -// -// # Using the Client -// -// To contact AWS Clean Rooms Service with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Clean Rooms Service client CleanRooms for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/cleanrooms/#New -package cleanrooms diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/errors.go deleted file mode 100644 index 47e42d2870c9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/errors.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cleanrooms - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // Caller does not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Updating or deleting a resource can cause an inconsistent state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Unexpected error during processing of request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Request references a resource which does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Request denied because service quota has been exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // Request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the specified constraints. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/service.go deleted file mode 100644 index 6da95ca8e67c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cleanrooms/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cleanrooms - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// CleanRooms provides the API operation methods for making requests to -// AWS Clean Rooms Service. See this package's package overview docs -// for details on the service. -// -// CleanRooms methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type CleanRooms struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "CleanRooms" // Name of service. - EndpointsID = "cleanrooms" // ID to lookup a service endpoint with. - ServiceID = "CleanRooms" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the CleanRooms client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a CleanRooms client from just a session. -// svc := cleanrooms.New(mySession) -// -// // Create a CleanRooms client with additional configuration -// svc := cleanrooms.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CleanRooms { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "cleanrooms" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *CleanRooms { - svc := &CleanRooms{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-02-17", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a CleanRooms operation and runs any -// custom request initialization. -func (c *CleanRooms) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/api.go deleted file mode 100644 index b369f47f0c0b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/api.go +++ /dev/null @@ -1,2010 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudfrontkeyvaluestore - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opDeleteKey = "DeleteKey" - -// DeleteKeyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteKey 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 DeleteKey for more information on using the DeleteKey -// 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 DeleteKeyRequest method. -// req, resp := client.DeleteKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/DeleteKey -func (c *CloudFrontKeyValueStore) DeleteKeyRequest(input *DeleteKeyInput) (req *request.Request, output *DeleteKeyOutput) { - op := &request.Operation{ - Name: opDeleteKey, - HTTPMethod: "DELETE", - HTTPPath: "/key-value-stores/{KvsARN}/keys/{Key}", - } - - if input == nil { - input = &DeleteKeyInput{} - } - - output = &DeleteKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteKey API operation for Amazon CloudFront KeyValueStore. -// -// Deletes the key value pair specified by the key. -// -// 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 CloudFront KeyValueStore's -// API operation DeleteKey for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Resource is not in expected state. -// -// - ValidationException -// Validation failed. -// -// - InternalServerException -// Internal server error. -// -// - ServiceQuotaExceededException -// Limit exceeded. -// -// - ResourceNotFoundException -// Resource was not found. -// -// - AccessDeniedException -// Access denied. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/DeleteKey -func (c *CloudFrontKeyValueStore) DeleteKey(input *DeleteKeyInput) (*DeleteKeyOutput, error) { - req, out := c.DeleteKeyRequest(input) - return out, req.Send() -} - -// DeleteKeyWithContext is the same as DeleteKey with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteKey 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 *CloudFrontKeyValueStore) DeleteKeyWithContext(ctx aws.Context, input *DeleteKeyInput, opts ...request.Option) (*DeleteKeyOutput, error) { - req, out := c.DeleteKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeKeyValueStore = "DescribeKeyValueStore" - -// DescribeKeyValueStoreRequest generates a "aws/request.Request" representing the -// client's request for the DescribeKeyValueStore 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 DescribeKeyValueStore for more information on using the DescribeKeyValueStore -// 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 DescribeKeyValueStoreRequest method. -// req, resp := client.DescribeKeyValueStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/DescribeKeyValueStore -func (c *CloudFrontKeyValueStore) DescribeKeyValueStoreRequest(input *DescribeKeyValueStoreInput) (req *request.Request, output *DescribeKeyValueStoreOutput) { - op := &request.Operation{ - Name: opDescribeKeyValueStore, - HTTPMethod: "GET", - HTTPPath: "/key-value-stores/{KvsARN}", - } - - if input == nil { - input = &DescribeKeyValueStoreInput{} - } - - output = &DescribeKeyValueStoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeKeyValueStore API operation for Amazon CloudFront KeyValueStore. -// -// Returns metadata information about Key Value Store. -// -// 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 CloudFront KeyValueStore's -// API operation DescribeKeyValueStore for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Resource is not in expected state. -// -// - InternalServerException -// Internal server error. -// -// - ResourceNotFoundException -// Resource was not found. -// -// - AccessDeniedException -// Access denied. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/DescribeKeyValueStore -func (c *CloudFrontKeyValueStore) DescribeKeyValueStore(input *DescribeKeyValueStoreInput) (*DescribeKeyValueStoreOutput, error) { - req, out := c.DescribeKeyValueStoreRequest(input) - return out, req.Send() -} - -// DescribeKeyValueStoreWithContext is the same as DescribeKeyValueStore with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeKeyValueStore 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 *CloudFrontKeyValueStore) DescribeKeyValueStoreWithContext(ctx aws.Context, input *DescribeKeyValueStoreInput, opts ...request.Option) (*DescribeKeyValueStoreOutput, error) { - req, out := c.DescribeKeyValueStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetKey = "GetKey" - -// GetKeyRequest generates a "aws/request.Request" representing the -// client's request for the GetKey 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 GetKey for more information on using the GetKey -// 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 GetKeyRequest method. -// req, resp := client.GetKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/GetKey -func (c *CloudFrontKeyValueStore) GetKeyRequest(input *GetKeyInput) (req *request.Request, output *GetKeyOutput) { - op := &request.Operation{ - Name: opGetKey, - HTTPMethod: "GET", - HTTPPath: "/key-value-stores/{KvsARN}/keys/{Key}", - } - - if input == nil { - input = &GetKeyInput{} - } - - output = &GetKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetKey API operation for Amazon CloudFront KeyValueStore. -// -// Returns a key value pair. -// -// 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 CloudFront KeyValueStore's -// API operation GetKey for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Resource is not in expected state. -// -// - InternalServerException -// Internal server error. -// -// - ResourceNotFoundException -// Resource was not found. -// -// - AccessDeniedException -// Access denied. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/GetKey -func (c *CloudFrontKeyValueStore) GetKey(input *GetKeyInput) (*GetKeyOutput, error) { - req, out := c.GetKeyRequest(input) - return out, req.Send() -} - -// GetKeyWithContext is the same as GetKey with the addition of -// the ability to pass a context and additional request options. -// -// See GetKey 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 *CloudFrontKeyValueStore) GetKeyWithContext(ctx aws.Context, input *GetKeyInput, opts ...request.Option) (*GetKeyOutput, error) { - req, out := c.GetKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListKeys = "ListKeys" - -// ListKeysRequest generates a "aws/request.Request" representing the -// client's request for the ListKeys 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 ListKeys for more information on using the ListKeys -// 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 ListKeysRequest method. -// req, resp := client.ListKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/ListKeys -func (c *CloudFrontKeyValueStore) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput) { - op := &request.Operation{ - Name: opListKeys, - HTTPMethod: "GET", - HTTPPath: "/key-value-stores/{KvsARN}/keys", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListKeysInput{} - } - - output = &ListKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListKeys API operation for Amazon CloudFront KeyValueStore. -// -// Returns a list of key value pairs. -// -// 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 CloudFront KeyValueStore's -// API operation ListKeys for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Resource is not in expected state. -// -// - ValidationException -// Validation failed. -// -// - InternalServerException -// Internal server error. -// -// - ResourceNotFoundException -// Resource was not found. -// -// - AccessDeniedException -// Access denied. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/ListKeys -func (c *CloudFrontKeyValueStore) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) { - req, out := c.ListKeysRequest(input) - return out, req.Send() -} - -// ListKeysWithContext is the same as ListKeys with the addition of -// the ability to pass a context and additional request options. -// -// See ListKeys 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 *CloudFrontKeyValueStore) ListKeysWithContext(ctx aws.Context, input *ListKeysInput, opts ...request.Option) (*ListKeysOutput, error) { - req, out := c.ListKeysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListKeysPages iterates over the pages of a ListKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListKeys method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListKeys operation. -// pageNum := 0 -// err := client.ListKeysPages(params, -// func(page *cloudfrontkeyvaluestore.ListKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudFrontKeyValueStore) ListKeysPages(input *ListKeysInput, fn func(*ListKeysOutput, bool) bool) error { - return c.ListKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListKeysPagesWithContext same as ListKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CloudFrontKeyValueStore) ListKeysPagesWithContext(ctx aws.Context, input *ListKeysInput, fn func(*ListKeysOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutKey = "PutKey" - -// PutKeyRequest generates a "aws/request.Request" representing the -// client's request for the PutKey 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 PutKey for more information on using the PutKey -// 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 PutKeyRequest method. -// req, resp := client.PutKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/PutKey -func (c *CloudFrontKeyValueStore) PutKeyRequest(input *PutKeyInput) (req *request.Request, output *PutKeyOutput) { - op := &request.Operation{ - Name: opPutKey, - HTTPMethod: "PUT", - HTTPPath: "/key-value-stores/{KvsARN}/keys/{Key}", - } - - if input == nil { - input = &PutKeyInput{} - } - - output = &PutKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutKey API operation for Amazon CloudFront KeyValueStore. -// -// Creates a new key value pair or replaces the value of an existing key. -// -// 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 CloudFront KeyValueStore's -// API operation PutKey for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Resource is not in expected state. -// -// - ValidationException -// Validation failed. -// -// - InternalServerException -// Internal server error. -// -// - ServiceQuotaExceededException -// Limit exceeded. -// -// - ResourceNotFoundException -// Resource was not found. -// -// - AccessDeniedException -// Access denied. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/PutKey -func (c *CloudFrontKeyValueStore) PutKey(input *PutKeyInput) (*PutKeyOutput, error) { - req, out := c.PutKeyRequest(input) - return out, req.Send() -} - -// PutKeyWithContext is the same as PutKey with the addition of -// the ability to pass a context and additional request options. -// -// See PutKey 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 *CloudFrontKeyValueStore) PutKeyWithContext(ctx aws.Context, input *PutKeyInput, opts ...request.Option) (*PutKeyOutput, error) { - req, out := c.PutKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateKeys = "UpdateKeys" - -// UpdateKeysRequest generates a "aws/request.Request" representing the -// client's request for the UpdateKeys 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 UpdateKeys for more information on using the UpdateKeys -// 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 UpdateKeysRequest method. -// req, resp := client.UpdateKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/UpdateKeys -func (c *CloudFrontKeyValueStore) UpdateKeysRequest(input *UpdateKeysInput) (req *request.Request, output *UpdateKeysOutput) { - op := &request.Operation{ - Name: opUpdateKeys, - HTTPMethod: "POST", - HTTPPath: "/key-value-stores/{KvsARN}/keys", - } - - if input == nil { - input = &UpdateKeysInput{} - } - - output = &UpdateKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateKeys API operation for Amazon CloudFront KeyValueStore. -// -// Puts or Deletes multiple key value pairs in a single, all-or-nothing operation. -// -// 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 CloudFront KeyValueStore's -// API operation UpdateKeys for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Resource is not in expected state. -// -// - ValidationException -// Validation failed. -// -// - InternalServerException -// Internal server error. -// -// - ServiceQuotaExceededException -// Limit exceeded. -// -// - ResourceNotFoundException -// Resource was not found. -// -// - AccessDeniedException -// Access denied. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26/UpdateKeys -func (c *CloudFrontKeyValueStore) UpdateKeys(input *UpdateKeysInput) (*UpdateKeysOutput, error) { - req, out := c.UpdateKeysRequest(input) - return out, req.Send() -} - -// UpdateKeysWithContext is the same as UpdateKeys with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateKeys 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 *CloudFrontKeyValueStore) UpdateKeysWithContext(ctx aws.Context, input *UpdateKeysInput, opts ...request.Option) (*UpdateKeysOutput, error) { - req, out := c.UpdateKeysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Access denied. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Resource is not in expected state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type DeleteKeyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The current version (ETag) of the Key Value Store that you are deleting keys - // from, which you can get using DescribeKeyValueStore. - // - // IfMatch is a required field - IfMatch *string `location:"header" locationName:"If-Match" type:"string" required:"true"` - - // The key to delete. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Key Value Store. - // - // KvsARN is a required field - KvsARN *string `location:"uri" locationName:"KvsARN" min:"1" 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 DeleteKeyInput) 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 DeleteKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteKeyInput"} - if s.IfMatch == nil { - invalidParams.Add(request.NewErrParamRequired("IfMatch")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.KvsARN == nil { - invalidParams.Add(request.NewErrParamRequired("KvsARN")) - } - if s.KvsARN != nil && len(*s.KvsARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KvsARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIfMatch sets the IfMatch field's value. -func (s *DeleteKeyInput) SetIfMatch(v string) *DeleteKeyInput { - s.IfMatch = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteKeyInput) SetKey(v string) *DeleteKeyInput { - s.Key = &v - return s -} - -// SetKvsARN sets the KvsARN field's value. -func (s *DeleteKeyInput) SetKvsARN(v string) *DeleteKeyInput { - s.KvsARN = &v - return s -} - -// Metadata information about a Key Value Store. -type DeleteKeyOutput struct { - _ struct{} `type:"structure"` - - // The current version identifier of the Key Value Store after the successful - // delete. - // - // ETag is a required field - ETag *string `location:"header" locationName:"ETag" type:"string" required:"true"` - - // Number of key value pairs in the Key Value Store after the successful delete. - // - // ItemCount is a required field - ItemCount *int64 `type:"integer" required:"true"` - - // Total size of the Key Value Store after the successful delete, in bytes. - // - // TotalSizeInBytes is a required field - TotalSizeInBytes *int64 `type:"long" 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 DeleteKeyOutput) 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 DeleteKeyOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *DeleteKeyOutput) SetETag(v string) *DeleteKeyOutput { - s.ETag = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *DeleteKeyOutput) SetItemCount(v int64) *DeleteKeyOutput { - s.ItemCount = &v - return s -} - -// SetTotalSizeInBytes sets the TotalSizeInBytes field's value. -func (s *DeleteKeyOutput) SetTotalSizeInBytes(v int64) *DeleteKeyOutput { - s.TotalSizeInBytes = &v - return s -} - -// List item for keys to delete. -type DeleteKeyRequestListItem struct { - _ struct{} `type:"structure"` - - // The key of the key value pair to be deleted. - // - // Key is a required field - Key *string `min:"1" 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 DeleteKeyRequestListItem) 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 DeleteKeyRequestListItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteKeyRequestListItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteKeyRequestListItem"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *DeleteKeyRequestListItem) SetKey(v string) *DeleteKeyRequestListItem { - s.Key = &v - return s -} - -type DescribeKeyValueStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Key Value Store. - // - // KvsARN is a required field - KvsARN *string `location:"uri" locationName:"KvsARN" min:"1" 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 DescribeKeyValueStoreInput) 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 DescribeKeyValueStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeKeyValueStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeKeyValueStoreInput"} - if s.KvsARN == nil { - invalidParams.Add(request.NewErrParamRequired("KvsARN")) - } - if s.KvsARN != nil && len(*s.KvsARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KvsARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKvsARN sets the KvsARN field's value. -func (s *DescribeKeyValueStoreInput) SetKvsARN(v string) *DescribeKeyValueStoreInput { - s.KvsARN = &v - return s -} - -// Metadata information about a Key Value Store. -type DescribeKeyValueStoreOutput struct { - _ struct{} `type:"structure"` - - // Date and time when the Key Value Store was created. - // - // Created is a required field - Created *time.Time `type:"timestamp" required:"true"` - - // The version identifier for the current version of the Key Value Store. - // - // ETag is a required field - ETag *string `location:"header" locationName:"ETag" type:"string" required:"true"` - - // Number of key value pairs in the Key Value Store. - // - // ItemCount is a required field - ItemCount *int64 `type:"integer" required:"true"` - - // The Amazon Resource Name (ARN) of the Key Value Store. - // - // KvsARN is a required field - KvsARN *string `min:"1" type:"string" required:"true"` - - // Date and time when the key value pairs in the Key Value Store was last modified. - LastModified *time.Time `type:"timestamp"` - - // Total size of the Key Value Store in bytes. - // - // TotalSizeInBytes is a required field - TotalSizeInBytes *int64 `type:"long" 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 DescribeKeyValueStoreOutput) 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 DescribeKeyValueStoreOutput) GoString() string { - return s.String() -} - -// SetCreated sets the Created field's value. -func (s *DescribeKeyValueStoreOutput) SetCreated(v time.Time) *DescribeKeyValueStoreOutput { - s.Created = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *DescribeKeyValueStoreOutput) SetETag(v string) *DescribeKeyValueStoreOutput { - s.ETag = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *DescribeKeyValueStoreOutput) SetItemCount(v int64) *DescribeKeyValueStoreOutput { - s.ItemCount = &v - return s -} - -// SetKvsARN sets the KvsARN field's value. -func (s *DescribeKeyValueStoreOutput) SetKvsARN(v string) *DescribeKeyValueStoreOutput { - s.KvsARN = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *DescribeKeyValueStoreOutput) SetLastModified(v time.Time) *DescribeKeyValueStoreOutput { - s.LastModified = &v - return s -} - -// SetTotalSizeInBytes sets the TotalSizeInBytes field's value. -func (s *DescribeKeyValueStoreOutput) SetTotalSizeInBytes(v int64) *DescribeKeyValueStoreOutput { - s.TotalSizeInBytes = &v - return s -} - -type GetKeyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The key to get. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Key Value Store. - // - // KvsARN is a required field - KvsARN *string `location:"uri" locationName:"KvsARN" min:"1" 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 GetKeyInput) 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 GetKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetKeyInput"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.KvsARN == nil { - invalidParams.Add(request.NewErrParamRequired("KvsARN")) - } - if s.KvsARN != nil && len(*s.KvsARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KvsARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *GetKeyInput) SetKey(v string) *GetKeyInput { - s.Key = &v - return s -} - -// SetKvsARN sets the KvsARN field's value. -func (s *GetKeyInput) SetKvsARN(v string) *GetKeyInput { - s.KvsARN = &v - return s -} - -// A key value pair. -type GetKeyOutput struct { - _ struct{} `type:"structure"` - - // Number of key value pairs in the Key Value Store. - // - // ItemCount is a required field - ItemCount *int64 `type:"integer" required:"true"` - - // The key of the key value pair. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // Total size of the Key Value Store in bytes. - // - // TotalSizeInBytes is a required field - TotalSizeInBytes *int64 `type:"long" required:"true"` - - // The value of the key value pair. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetKeyOutput's - // String and GoString methods. - // - // Value is a required field - Value *string `type:"string" required:"true" sensitive:"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 GetKeyOutput) 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 GetKeyOutput) GoString() string { - return s.String() -} - -// SetItemCount sets the ItemCount field's value. -func (s *GetKeyOutput) SetItemCount(v int64) *GetKeyOutput { - s.ItemCount = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetKeyOutput) SetKey(v string) *GetKeyOutput { - s.Key = &v - return s -} - -// SetTotalSizeInBytes sets the TotalSizeInBytes field's value. -func (s *GetKeyOutput) SetTotalSizeInBytes(v int64) *GetKeyOutput { - s.TotalSizeInBytes = &v - return s -} - -// SetValue sets the Value field's value. -func (s *GetKeyOutput) SetValue(v string) *GetKeyOutput { - s.Value = &v - return s -} - -// Internal server error. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListKeysInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Key Value Store. - // - // KvsARN is a required field - KvsARN *string `location:"uri" locationName:"KvsARN" min:"1" type:"string" required:"true"` - - // Maximum number of results that are returned per call. The default is 10 and - // maximum allowed page is 50. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // If nextToken is returned in the response, there are more results available. - // Make the next call using the returned token to retrieve the next page. - NextToken *string `location:"querystring" locationName:"NextToken" 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 ListKeysInput) 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 ListKeysInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListKeysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListKeysInput"} - if s.KvsARN == nil { - invalidParams.Add(request.NewErrParamRequired("KvsARN")) - } - if s.KvsARN != nil && len(*s.KvsARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KvsARN", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKvsARN sets the KvsARN field's value. -func (s *ListKeysInput) SetKvsARN(v string) *ListKeysInput { - s.KvsARN = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListKeysInput) SetMaxResults(v int64) *ListKeysInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListKeysInput) SetNextToken(v string) *ListKeysInput { - s.NextToken = &v - return s -} - -type ListKeysOutput struct { - _ struct{} `type:"structure"` - - // Key value pairs - Items []*ListKeysResponseListItem `type:"list"` - - // If nextToken is returned in the response, there are more results available. - // Make the next call using the returned token to retrieve the next page. - NextToken *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 ListKeysOutput) 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 ListKeysOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListKeysOutput) SetItems(v []*ListKeysResponseListItem) *ListKeysOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListKeysOutput) SetNextToken(v string) *ListKeysOutput { - s.NextToken = &v - return s -} - -// A key value pair. -type ListKeysResponseListItem struct { - _ struct{} `type:"structure"` - - // The key of the key value pair. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value of the key value pair. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListKeysResponseListItem's - // String and GoString methods. - // - // Value is a required field - Value *string `type:"string" required:"true" sensitive:"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 ListKeysResponseListItem) 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 ListKeysResponseListItem) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *ListKeysResponseListItem) SetKey(v string) *ListKeysResponseListItem { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ListKeysResponseListItem) SetValue(v string) *ListKeysResponseListItem { - s.Value = &v - return s -} - -// A key value pair. -type PutKeyInput struct { - _ struct{} `type:"structure"` - - // The current version (ETag) of the Key Value Store that you are putting keys - // into, which you can get using DescribeKeyValueStore. - // - // IfMatch is a required field - IfMatch *string `location:"header" locationName:"If-Match" type:"string" required:"true"` - - // The key to put. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Key Value Store. - // - // KvsARN is a required field - KvsARN *string `location:"uri" locationName:"KvsARN" min:"1" type:"string" required:"true"` - - // The value to put. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PutKeyInput's - // String and GoString methods. - // - // Value is a required field - Value *string `type:"string" required:"true" sensitive:"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 PutKeyInput) 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 PutKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutKeyInput"} - if s.IfMatch == nil { - invalidParams.Add(request.NewErrParamRequired("IfMatch")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.KvsARN == nil { - invalidParams.Add(request.NewErrParamRequired("KvsARN")) - } - if s.KvsARN != nil && len(*s.KvsARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KvsARN", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIfMatch sets the IfMatch field's value. -func (s *PutKeyInput) SetIfMatch(v string) *PutKeyInput { - s.IfMatch = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutKeyInput) SetKey(v string) *PutKeyInput { - s.Key = &v - return s -} - -// SetKvsARN sets the KvsARN field's value. -func (s *PutKeyInput) SetKvsARN(v string) *PutKeyInput { - s.KvsARN = &v - return s -} - -// SetValue sets the Value field's value. -func (s *PutKeyInput) SetValue(v string) *PutKeyInput { - s.Value = &v - return s -} - -// Metadata information about a Key Value Store. -type PutKeyOutput struct { - _ struct{} `type:"structure"` - - // The current version identifier of the Key Value Store after the successful - // put. - // - // ETag is a required field - ETag *string `location:"header" locationName:"ETag" type:"string" required:"true"` - - // Number of key value pairs in the Key Value Store after the successful put. - // - // ItemCount is a required field - ItemCount *int64 `type:"integer" required:"true"` - - // Total size of the Key Value Store after the successful put, in bytes. - // - // TotalSizeInBytes is a required field - TotalSizeInBytes *int64 `type:"long" 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 PutKeyOutput) 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 PutKeyOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *PutKeyOutput) SetETag(v string) *PutKeyOutput { - s.ETag = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *PutKeyOutput) SetItemCount(v int64) *PutKeyOutput { - s.ItemCount = &v - return s -} - -// SetTotalSizeInBytes sets the TotalSizeInBytes field's value. -func (s *PutKeyOutput) SetTotalSizeInBytes(v int64) *PutKeyOutput { - s.TotalSizeInBytes = &v - return s -} - -// List item for key value pair to put. -type PutKeyRequestListItem struct { - _ struct{} `type:"structure"` - - // The key of the key value pair list item to put. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value for the key value pair to put. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PutKeyRequestListItem's - // String and GoString methods. - // - // Value is a required field - Value *string `type:"string" required:"true" sensitive:"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 PutKeyRequestListItem) 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 PutKeyRequestListItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutKeyRequestListItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutKeyRequestListItem"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *PutKeyRequestListItem) SetKey(v string) *PutKeyRequestListItem { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *PutKeyRequestListItem) SetValue(v string) *PutKeyRequestListItem { - s.Value = &v - return s -} - -// Resource was not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Limit exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UpdateKeysInput struct { - _ struct{} `type:"structure"` - - // List of keys to delete. - Deletes []*DeleteKeyRequestListItem `type:"list"` - - // The current version (ETag) of the Key Value Store that you are updating keys - // of, which you can get using DescribeKeyValueStore. - // - // IfMatch is a required field - IfMatch *string `location:"header" locationName:"If-Match" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Key Value Store. - // - // KvsARN is a required field - KvsARN *string `location:"uri" locationName:"KvsARN" min:"1" type:"string" required:"true"` - - // List of key value pairs to put. - Puts []*PutKeyRequestListItem `type:"list"` -} - -// 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 UpdateKeysInput) 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 UpdateKeysInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateKeysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateKeysInput"} - if s.IfMatch == nil { - invalidParams.Add(request.NewErrParamRequired("IfMatch")) - } - if s.KvsARN == nil { - invalidParams.Add(request.NewErrParamRequired("KvsARN")) - } - if s.KvsARN != nil && len(*s.KvsARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KvsARN", 1)) - } - if s.Deletes != nil { - for i, v := range s.Deletes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Deletes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Puts != nil { - for i, v := range s.Puts { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Puts", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeletes sets the Deletes field's value. -func (s *UpdateKeysInput) SetDeletes(v []*DeleteKeyRequestListItem) *UpdateKeysInput { - s.Deletes = v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *UpdateKeysInput) SetIfMatch(v string) *UpdateKeysInput { - s.IfMatch = &v - return s -} - -// SetKvsARN sets the KvsARN field's value. -func (s *UpdateKeysInput) SetKvsARN(v string) *UpdateKeysInput { - s.KvsARN = &v - return s -} - -// SetPuts sets the Puts field's value. -func (s *UpdateKeysInput) SetPuts(v []*PutKeyRequestListItem) *UpdateKeysInput { - s.Puts = v - return s -} - -// Metadata information about a Key Value Store. -type UpdateKeysOutput struct { - _ struct{} `type:"structure"` - - // The current version identifier of the Key Value Store after the successful - // update. - // - // ETag is a required field - ETag *string `location:"header" locationName:"ETag" type:"string" required:"true"` - - // Number of key value pairs in the Key Value Store after the successful update. - // - // ItemCount is a required field - ItemCount *int64 `type:"integer" required:"true"` - - // Total size of the Key Value Store after the successful update, in bytes. - // - // TotalSizeInBytes is a required field - TotalSizeInBytes *int64 `type:"long" 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 UpdateKeysOutput) 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 UpdateKeysOutput) GoString() string { - return s.String() -} - -// SetETag sets the ETag field's value. -func (s *UpdateKeysOutput) SetETag(v string) *UpdateKeysOutput { - s.ETag = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *UpdateKeysOutput) SetItemCount(v int64) *UpdateKeysOutput { - s.ItemCount = &v - return s -} - -// SetTotalSizeInBytes sets the TotalSizeInBytes field's value. -func (s *UpdateKeysOutput) SetTotalSizeInBytes(v int64) *UpdateKeysOutput { - s.TotalSizeInBytes = &v - return s -} - -// Validation failed. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/cloudfrontkeyvaluestoreiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/cloudfrontkeyvaluestoreiface/interface.go deleted file mode 100644 index 3454ddcdfd3d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/cloudfrontkeyvaluestoreiface/interface.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package cloudfrontkeyvaluestoreiface provides an interface to enable mocking the Amazon CloudFront KeyValueStore service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package cloudfrontkeyvaluestoreiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore" -) - -// CloudFrontKeyValueStoreAPI provides an interface to enable mocking the -// cloudfrontkeyvaluestore.CloudFrontKeyValueStore service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon CloudFront KeyValueStore. -// func myFunc(svc cloudfrontkeyvaluestoreiface.CloudFrontKeyValueStoreAPI) bool { -// // Make svc.DeleteKey request -// } -// -// func main() { -// sess := session.New() -// svc := cloudfrontkeyvaluestore.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockCloudFrontKeyValueStoreClient struct { -// cloudfrontkeyvaluestoreiface.CloudFrontKeyValueStoreAPI -// } -// func (m *mockCloudFrontKeyValueStoreClient) DeleteKey(input *cloudfrontkeyvaluestore.DeleteKeyInput) (*cloudfrontkeyvaluestore.DeleteKeyOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockCloudFrontKeyValueStoreClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type CloudFrontKeyValueStoreAPI interface { - DeleteKey(*cloudfrontkeyvaluestore.DeleteKeyInput) (*cloudfrontkeyvaluestore.DeleteKeyOutput, error) - DeleteKeyWithContext(aws.Context, *cloudfrontkeyvaluestore.DeleteKeyInput, ...request.Option) (*cloudfrontkeyvaluestore.DeleteKeyOutput, error) - DeleteKeyRequest(*cloudfrontkeyvaluestore.DeleteKeyInput) (*request.Request, *cloudfrontkeyvaluestore.DeleteKeyOutput) - - DescribeKeyValueStore(*cloudfrontkeyvaluestore.DescribeKeyValueStoreInput) (*cloudfrontkeyvaluestore.DescribeKeyValueStoreOutput, error) - DescribeKeyValueStoreWithContext(aws.Context, *cloudfrontkeyvaluestore.DescribeKeyValueStoreInput, ...request.Option) (*cloudfrontkeyvaluestore.DescribeKeyValueStoreOutput, error) - DescribeKeyValueStoreRequest(*cloudfrontkeyvaluestore.DescribeKeyValueStoreInput) (*request.Request, *cloudfrontkeyvaluestore.DescribeKeyValueStoreOutput) - - GetKey(*cloudfrontkeyvaluestore.GetKeyInput) (*cloudfrontkeyvaluestore.GetKeyOutput, error) - GetKeyWithContext(aws.Context, *cloudfrontkeyvaluestore.GetKeyInput, ...request.Option) (*cloudfrontkeyvaluestore.GetKeyOutput, error) - GetKeyRequest(*cloudfrontkeyvaluestore.GetKeyInput) (*request.Request, *cloudfrontkeyvaluestore.GetKeyOutput) - - ListKeys(*cloudfrontkeyvaluestore.ListKeysInput) (*cloudfrontkeyvaluestore.ListKeysOutput, error) - ListKeysWithContext(aws.Context, *cloudfrontkeyvaluestore.ListKeysInput, ...request.Option) (*cloudfrontkeyvaluestore.ListKeysOutput, error) - ListKeysRequest(*cloudfrontkeyvaluestore.ListKeysInput) (*request.Request, *cloudfrontkeyvaluestore.ListKeysOutput) - - ListKeysPages(*cloudfrontkeyvaluestore.ListKeysInput, func(*cloudfrontkeyvaluestore.ListKeysOutput, bool) bool) error - ListKeysPagesWithContext(aws.Context, *cloudfrontkeyvaluestore.ListKeysInput, func(*cloudfrontkeyvaluestore.ListKeysOutput, bool) bool, ...request.Option) error - - PutKey(*cloudfrontkeyvaluestore.PutKeyInput) (*cloudfrontkeyvaluestore.PutKeyOutput, error) - PutKeyWithContext(aws.Context, *cloudfrontkeyvaluestore.PutKeyInput, ...request.Option) (*cloudfrontkeyvaluestore.PutKeyOutput, error) - PutKeyRequest(*cloudfrontkeyvaluestore.PutKeyInput) (*request.Request, *cloudfrontkeyvaluestore.PutKeyOutput) - - UpdateKeys(*cloudfrontkeyvaluestore.UpdateKeysInput) (*cloudfrontkeyvaluestore.UpdateKeysOutput, error) - UpdateKeysWithContext(aws.Context, *cloudfrontkeyvaluestore.UpdateKeysInput, ...request.Option) (*cloudfrontkeyvaluestore.UpdateKeysOutput, error) - UpdateKeysRequest(*cloudfrontkeyvaluestore.UpdateKeysInput) (*request.Request, *cloudfrontkeyvaluestore.UpdateKeysOutput) -} - -var _ CloudFrontKeyValueStoreAPI = (*cloudfrontkeyvaluestore.CloudFrontKeyValueStore)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/doc.go deleted file mode 100644 index 189c3e1bf762..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package cloudfrontkeyvaluestore provides the client and types for making API -// requests to Amazon CloudFront KeyValueStore. -// -// Amazon CloudFront KeyValueStore Service to View and Update Data in a KVS -// Resource -// -// See https://docs.aws.amazon.com/goto/WebAPI/cloudfront-keyvaluestore-2022-07-26 for more information on this service. -// -// See cloudfrontkeyvaluestore package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudfrontkeyvaluestore/ -// -// # Using the Client -// -// To contact Amazon CloudFront KeyValueStore with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon CloudFront KeyValueStore client CloudFrontKeyValueStore for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudfrontkeyvaluestore/#New -package cloudfrontkeyvaluestore diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/errors.go deleted file mode 100644 index 1d3ab723cdf1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/errors.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudfrontkeyvaluestore - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // Access denied. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Resource is not in expected state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Internal server error. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Resource was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Limit exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Validation failed. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/service.go deleted file mode 100644 index d9dec942313a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudfrontkeyvaluestore/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudfrontkeyvaluestore - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// CloudFrontKeyValueStore provides the API operation methods for making requests to -// Amazon CloudFront KeyValueStore. See this package's package overview docs -// for details on the service. -// -// CloudFrontKeyValueStore methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type CloudFrontKeyValueStore struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "CloudFront KeyValueStore" // Name of service. - EndpointsID = "cloudfront-keyvaluestore" // ID to lookup a service endpoint with. - ServiceID = "CloudFront KeyValueStore" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the CloudFrontKeyValueStore client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a CloudFrontKeyValueStore client from just a session. -// svc := cloudfrontkeyvaluestore.New(mySession) -// -// // Create a CloudFrontKeyValueStore client with additional configuration -// svc := cloudfrontkeyvaluestore.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudFrontKeyValueStore { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "cloudfront-keyvaluestore" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *CloudFrontKeyValueStore { - svc := &CloudFrontKeyValueStore{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-07-26", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a CloudFrontKeyValueStore operation and runs any -// custom request initialization. -func (c *CloudFrontKeyValueStore) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/api.go deleted file mode 100644 index 846ac73ce2f3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/api.go +++ /dev/null @@ -1,814 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudtraildata - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opPutAuditEvents = "PutAuditEvents" - -// PutAuditEventsRequest generates a "aws/request.Request" representing the -// client's request for the PutAuditEvents 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 PutAuditEvents for more information on using the PutAuditEvents -// 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 PutAuditEventsRequest method. -// req, resp := client.PutAuditEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-data-2021-08-11/PutAuditEvents -func (c *CloudTrailData) PutAuditEventsRequest(input *PutAuditEventsInput) (req *request.Request, output *PutAuditEventsOutput) { - op := &request.Operation{ - Name: opPutAuditEvents, - HTTPMethod: "POST", - HTTPPath: "/PutAuditEvents", - } - - if input == nil { - input = &PutAuditEventsInput{} - } - - output = &PutAuditEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutAuditEvents API operation for AWS CloudTrail Data Service. -// -// Ingests your application events into CloudTrail Lake. A required parameter, -// auditEvents, accepts the JSON records (also called payload) of events that -// you want CloudTrail to ingest. You can add up to 100 of these events (or -// up to 1 MB) per PutAuditEvents request. -// -// 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 AWS CloudTrail Data Service's -// API operation PutAuditEvents for usage and error information. -// -// Returned Error Types: -// -// - ChannelInsufficientPermission -// The caller's account ID must be the same as the channel owner's account ID. -// -// - ChannelNotFound -// The channel could not be found. -// -// - InvalidChannelARN -// The specified channel ARN is not a valid channel ARN. -// -// - ChannelUnsupportedSchema -// The schema type of the event is not supported. -// -// - DuplicatedAuditEventId -// Two or more entries in the request have the same event ID. -// -// - UnsupportedOperationException -// The operation requested is not supported in this region or account. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-data-2021-08-11/PutAuditEvents -func (c *CloudTrailData) PutAuditEvents(input *PutAuditEventsInput) (*PutAuditEventsOutput, error) { - req, out := c.PutAuditEventsRequest(input) - return out, req.Send() -} - -// PutAuditEventsWithContext is the same as PutAuditEvents with the addition of -// the ability to pass a context and additional request options. -// -// See PutAuditEvents 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 *CloudTrailData) PutAuditEventsWithContext(ctx aws.Context, input *PutAuditEventsInput, opts ...request.Option) (*PutAuditEventsOutput, error) { - req, out := c.PutAuditEventsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// An event from a source outside of Amazon Web Services that you want CloudTrail -// to log. -type AuditEvent struct { - _ struct{} `type:"structure"` - - // The content of an audit event that comes from the event, such as userIdentity, - // userAgent, and eventSource. - // - // EventData is a required field - EventData *string `locationName:"eventData" type:"string" required:"true"` - - // A checksum is a base64-SHA256 algorithm that helps you verify that CloudTrail - // receives the event that matches with the checksum. Calculate the checksum - // by running a command like the following: - // - // printf %s $eventdata | openssl dgst -binary -sha256 | base64 - EventDataChecksum *string `locationName:"eventDataChecksum" type:"string"` - - // The original event ID from the source event. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 AuditEvent) 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 AuditEvent) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuditEvent) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuditEvent"} - if s.EventData == nil { - invalidParams.Add(request.NewErrParamRequired("EventData")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventData sets the EventData field's value. -func (s *AuditEvent) SetEventData(v string) *AuditEvent { - s.EventData = &v - return s -} - -// SetEventDataChecksum sets the EventDataChecksum field's value. -func (s *AuditEvent) SetEventDataChecksum(v string) *AuditEvent { - s.EventDataChecksum = &v - return s -} - -// SetId sets the Id field's value. -func (s *AuditEvent) SetId(v string) *AuditEvent { - s.Id = &v - return s -} - -// A response that includes successful and failed event results. -type AuditEventResultEntry struct { - _ struct{} `type:"structure"` - - // The event ID assigned by CloudTrail. - // - // EventID is a required field - EventID *string `locationName:"eventID" min:"1" type:"string" required:"true"` - - // The original event ID from the source event. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 AuditEventResultEntry) 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 AuditEventResultEntry) GoString() string { - return s.String() -} - -// SetEventID sets the EventID field's value. -func (s *AuditEventResultEntry) SetEventID(v string) *AuditEventResultEntry { - s.EventID = &v - return s -} - -// SetId sets the Id field's value. -func (s *AuditEventResultEntry) SetId(v string) *AuditEventResultEntry { - s.Id = &v - return s -} - -// The caller's account ID must be the same as the channel owner's account ID. -type ChannelInsufficientPermission struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ChannelInsufficientPermission) 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 ChannelInsufficientPermission) GoString() string { - return s.String() -} - -func newErrorChannelInsufficientPermission(v protocol.ResponseMetadata) error { - return &ChannelInsufficientPermission{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChannelInsufficientPermission) Code() string { - return "ChannelInsufficientPermission" -} - -// Message returns the exception's message. -func (s *ChannelInsufficientPermission) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChannelInsufficientPermission) OrigErr() error { - return nil -} - -func (s *ChannelInsufficientPermission) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChannelInsufficientPermission) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChannelInsufficientPermission) RequestID() string { - return s.RespMetadata.RequestID -} - -// The channel could not be found. -type ChannelNotFound struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ChannelNotFound) 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 ChannelNotFound) GoString() string { - return s.String() -} - -func newErrorChannelNotFound(v protocol.ResponseMetadata) error { - return &ChannelNotFound{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChannelNotFound) Code() string { - return "ChannelNotFound" -} - -// Message returns the exception's message. -func (s *ChannelNotFound) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChannelNotFound) OrigErr() error { - return nil -} - -func (s *ChannelNotFound) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChannelNotFound) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChannelNotFound) RequestID() string { - return s.RespMetadata.RequestID -} - -// The schema type of the event is not supported. -type ChannelUnsupportedSchema struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ChannelUnsupportedSchema) 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 ChannelUnsupportedSchema) GoString() string { - return s.String() -} - -func newErrorChannelUnsupportedSchema(v protocol.ResponseMetadata) error { - return &ChannelUnsupportedSchema{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChannelUnsupportedSchema) Code() string { - return "ChannelUnsupportedSchema" -} - -// Message returns the exception's message. -func (s *ChannelUnsupportedSchema) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChannelUnsupportedSchema) OrigErr() error { - return nil -} - -func (s *ChannelUnsupportedSchema) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChannelUnsupportedSchema) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChannelUnsupportedSchema) RequestID() string { - return s.RespMetadata.RequestID -} - -// Two or more entries in the request have the same event ID. -type DuplicatedAuditEventId struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 DuplicatedAuditEventId) 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 DuplicatedAuditEventId) GoString() string { - return s.String() -} - -func newErrorDuplicatedAuditEventId(v protocol.ResponseMetadata) error { - return &DuplicatedAuditEventId{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DuplicatedAuditEventId) Code() string { - return "DuplicatedAuditEventId" -} - -// Message returns the exception's message. -func (s *DuplicatedAuditEventId) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DuplicatedAuditEventId) OrigErr() error { - return nil -} - -func (s *DuplicatedAuditEventId) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DuplicatedAuditEventId) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DuplicatedAuditEventId) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified channel ARN is not a valid channel ARN. -type InvalidChannelARN struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InvalidChannelARN) 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 InvalidChannelARN) GoString() string { - return s.String() -} - -func newErrorInvalidChannelARN(v protocol.ResponseMetadata) error { - return &InvalidChannelARN{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidChannelARN) Code() string { - return "InvalidChannelARN" -} - -// Message returns the exception's message. -func (s *InvalidChannelARN) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidChannelARN) OrigErr() error { - return nil -} - -func (s *InvalidChannelARN) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidChannelARN) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidChannelARN) RequestID() string { - return s.RespMetadata.RequestID -} - -type PutAuditEventsInput struct { - _ struct{} `type:"structure"` - - // The JSON payload of events that you want to ingest. You can also point to - // the JSON event payload in a file. - // - // AuditEvents is a required field - AuditEvents []*AuditEvent `locationName:"auditEvents" min:"1" type:"list" required:"true"` - - // The ARN or ID (the ARN suffix) of a channel. - // - // ChannelArn is a required field - ChannelArn *string `location:"querystring" locationName:"channelArn" type:"string" required:"true"` - - // A unique identifier that is conditionally required when the channel's resource - // policy includes an external ID. This value can be any string, such as a passphrase - // or account number. - ExternalId *string `location:"querystring" locationName:"externalId" min:"2" 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 PutAuditEventsInput) 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 PutAuditEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutAuditEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutAuditEventsInput"} - if s.AuditEvents == nil { - invalidParams.Add(request.NewErrParamRequired("AuditEvents")) - } - if s.AuditEvents != nil && len(s.AuditEvents) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AuditEvents", 1)) - } - if s.ChannelArn == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelArn")) - } - if s.ExternalId != nil && len(*s.ExternalId) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ExternalId", 2)) - } - if s.AuditEvents != nil { - for i, v := range s.AuditEvents { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AuditEvents", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuditEvents sets the AuditEvents field's value. -func (s *PutAuditEventsInput) SetAuditEvents(v []*AuditEvent) *PutAuditEventsInput { - s.AuditEvents = v - return s -} - -// SetChannelArn sets the ChannelArn field's value. -func (s *PutAuditEventsInput) SetChannelArn(v string) *PutAuditEventsInput { - s.ChannelArn = &v - return s -} - -// SetExternalId sets the ExternalId field's value. -func (s *PutAuditEventsInput) SetExternalId(v string) *PutAuditEventsInput { - s.ExternalId = &v - return s -} - -type PutAuditEventsOutput struct { - _ struct{} `type:"structure"` - - // Lists events in the provided event payload that could not be ingested into - // CloudTrail, and includes the error code and error message returned for events - // that could not be ingested. - // - // Failed is a required field - Failed []*ResultErrorEntry `locationName:"failed" type:"list" required:"true"` - - // Lists events in the provided event payload that were successfully ingested - // into CloudTrail. - // - // Successful is a required field - Successful []*AuditEventResultEntry `locationName:"successful" type:"list" 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 PutAuditEventsOutput) 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 PutAuditEventsOutput) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *PutAuditEventsOutput) SetFailed(v []*ResultErrorEntry) *PutAuditEventsOutput { - s.Failed = v - return s -} - -// SetSuccessful sets the Successful field's value. -func (s *PutAuditEventsOutput) SetSuccessful(v []*AuditEventResultEntry) *PutAuditEventsOutput { - s.Successful = v - return s -} - -// Includes the error code and error message for events that could not be ingested -// by CloudTrail. -type ResultErrorEntry struct { - _ struct{} `type:"structure"` - - // The error code for events that could not be ingested by CloudTrail. Possible - // error codes include: FieldTooLong, FieldNotFound, InvalidChecksum, InvalidData, - // InvalidRecipient, InvalidEventSource, AccountNotSubscribed, Throttling, and - // InternalFailure. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" min:"1" type:"string" required:"true"` - - // The message that describes the error for events that could not be ingested - // by CloudTrail. - // - // ErrorMessage is a required field - ErrorMessage *string `locationName:"errorMessage" min:"1" type:"string" required:"true"` - - // The original event ID from the source event that could not be ingested by - // CloudTrail. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 ResultErrorEntry) 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 ResultErrorEntry) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *ResultErrorEntry) SetErrorCode(v string) *ResultErrorEntry { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *ResultErrorEntry) SetErrorMessage(v string) *ResultErrorEntry { - s.ErrorMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *ResultErrorEntry) SetId(v string) *ResultErrorEntry { - s.Id = &v - return s -} - -// The operation requested is not supported in this region or account. -type UnsupportedOperationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 UnsupportedOperationException) 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 UnsupportedOperationException) GoString() string { - return s.String() -} - -func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { - return &UnsupportedOperationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnsupportedOperationException) Code() string { - return "UnsupportedOperationException" -} - -// Message returns the exception's message. -func (s *UnsupportedOperationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnsupportedOperationException) OrigErr() error { - return nil -} - -func (s *UnsupportedOperationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnsupportedOperationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnsupportedOperationException) RequestID() string { - return s.RespMetadata.RequestID -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/cloudtraildataiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/cloudtraildataiface/interface.go deleted file mode 100644 index aecf1e6968ca..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/cloudtraildataiface/interface.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package cloudtraildataiface provides an interface to enable mocking the AWS CloudTrail Data Service service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package cloudtraildataiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata" -) - -// CloudTrailDataAPI provides an interface to enable mocking the -// cloudtraildata.CloudTrailData service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS CloudTrail Data Service. -// func myFunc(svc cloudtraildataiface.CloudTrailDataAPI) bool { -// // Make svc.PutAuditEvents request -// } -// -// func main() { -// sess := session.New() -// svc := cloudtraildata.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockCloudTrailDataClient struct { -// cloudtraildataiface.CloudTrailDataAPI -// } -// func (m *mockCloudTrailDataClient) PutAuditEvents(input *cloudtraildata.PutAuditEventsInput) (*cloudtraildata.PutAuditEventsOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockCloudTrailDataClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type CloudTrailDataAPI interface { - PutAuditEvents(*cloudtraildata.PutAuditEventsInput) (*cloudtraildata.PutAuditEventsOutput, error) - PutAuditEventsWithContext(aws.Context, *cloudtraildata.PutAuditEventsInput, ...request.Option) (*cloudtraildata.PutAuditEventsOutput, error) - PutAuditEventsRequest(*cloudtraildata.PutAuditEventsInput) (*request.Request, *cloudtraildata.PutAuditEventsOutput) -} - -var _ CloudTrailDataAPI = (*cloudtraildata.CloudTrailData)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/doc.go deleted file mode 100644 index 7d327186d379..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/doc.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package cloudtraildata provides the client and types for making API -// requests to AWS CloudTrail Data Service. -// -// The CloudTrail Data Service lets you ingest events into CloudTrail from any -// source in your hybrid environments, such as in-house or SaaS applications -// hosted on-premises or in the cloud, virtual machines, or containers. You -// can store, access, analyze, troubleshoot and take action on this data without -// maintaining multiple log aggregators and reporting tools. After you run PutAuditEvents -// to ingest your application activity into CloudTrail, you can use CloudTrail -// Lake to search, query, and analyze the data that is logged from your applications. -// -// See https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-data-2021-08-11 for more information on this service. -// -// See cloudtraildata package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudtraildata/ -// -// # Using the Client -// -// To contact AWS CloudTrail Data Service with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS CloudTrail Data Service client CloudTrailData for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudtraildata/#New -package cloudtraildata diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/errors.go deleted file mode 100644 index 1cd47e3e6525..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/errors.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudtraildata - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeChannelInsufficientPermission for service response error code - // "ChannelInsufficientPermission". - // - // The caller's account ID must be the same as the channel owner's account ID. - ErrCodeChannelInsufficientPermission = "ChannelInsufficientPermission" - - // ErrCodeChannelNotFound for service response error code - // "ChannelNotFound". - // - // The channel could not be found. - ErrCodeChannelNotFound = "ChannelNotFound" - - // ErrCodeChannelUnsupportedSchema for service response error code - // "ChannelUnsupportedSchema". - // - // The schema type of the event is not supported. - ErrCodeChannelUnsupportedSchema = "ChannelUnsupportedSchema" - - // ErrCodeDuplicatedAuditEventId for service response error code - // "DuplicatedAuditEventId". - // - // Two or more entries in the request have the same event ID. - ErrCodeDuplicatedAuditEventId = "DuplicatedAuditEventId" - - // ErrCodeInvalidChannelARN for service response error code - // "InvalidChannelARN". - // - // The specified channel ARN is not a valid channel ARN. - ErrCodeInvalidChannelARN = "InvalidChannelARN" - - // ErrCodeUnsupportedOperationException for service response error code - // "UnsupportedOperationException". - // - // The operation requested is not supported in this region or account. - ErrCodeUnsupportedOperationException = "UnsupportedOperationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "ChannelInsufficientPermission": newErrorChannelInsufficientPermission, - "ChannelNotFound": newErrorChannelNotFound, - "ChannelUnsupportedSchema": newErrorChannelUnsupportedSchema, - "DuplicatedAuditEventId": newErrorDuplicatedAuditEventId, - "InvalidChannelARN": newErrorInvalidChannelARN, - "UnsupportedOperationException": newErrorUnsupportedOperationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/service.go deleted file mode 100644 index b16d9922d87a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudtraildata/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudtraildata - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// CloudTrailData provides the API operation methods for making requests to -// AWS CloudTrail Data Service. See this package's package overview docs -// for details on the service. -// -// CloudTrailData methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type CloudTrailData struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "CloudTrail Data" // Name of service. - EndpointsID = "cloudtrail-data" // ID to lookup a service endpoint with. - ServiceID = "CloudTrail Data" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the CloudTrailData client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a CloudTrailData client from just a session. -// svc := cloudtraildata.New(mySession) -// -// // Create a CloudTrailData client with additional configuration -// svc := cloudtraildata.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudTrailData { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "cloudtrail-data" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *CloudTrailData { - svc := &CloudTrailData{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-08-11", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a CloudTrailData operation and runs any -// custom request initialization. -func (c *CloudTrailData) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudwatch/customizations.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudwatch/customizations.go deleted file mode 100644 index f686f596f62f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/cloudwatch/customizations.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudwatch - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/internal/encoding/gzip" -) - -// WithGzipRequest is a request.Option that adds a request handler to the Build -// stage of the operation's pipeline that will content-encoding GZIP the -// request payload before sending it to the API. This will buffer the request -// payload in memory, GZIP it, and reassign the GZIP'ed payload as the new -// request payload. -// -// GZIP may not be supported by all API operations. See API's documentation for -// the operation your using to see if GZIP request payload is supported. -// https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html -func WithGzipRequest(r *request.Request) { - r.Handlers.Build.PushBackNamed(gzip.NewGzipRequestHandler()) -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/api.go deleted file mode 100644 index 1a8a581aab81..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/api.go +++ /dev/null @@ -1,4599 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package codegurusecurity - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opBatchGetFindings = "BatchGetFindings" - -// BatchGetFindingsRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetFindings 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 BatchGetFindings for more information on using the BatchGetFindings -// 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 BatchGetFindingsRequest method. -// req, resp := client.BatchGetFindingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/BatchGetFindings -func (c *CodeGuruSecurity) BatchGetFindingsRequest(input *BatchGetFindingsInput) (req *request.Request, output *BatchGetFindingsOutput) { - op := &request.Operation{ - Name: opBatchGetFindings, - HTTPMethod: "POST", - HTTPPath: "/batchGetFindings", - } - - if input == nil { - input = &BatchGetFindingsInput{} - } - - output = &BatchGetFindingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetFindings API operation for Amazon CodeGuru Security. -// -// Returns a list of all requested findings. -// -// 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 CodeGuru Security's -// API operation BatchGetFindings for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/BatchGetFindings -func (c *CodeGuruSecurity) BatchGetFindings(input *BatchGetFindingsInput) (*BatchGetFindingsOutput, error) { - req, out := c.BatchGetFindingsRequest(input) - return out, req.Send() -} - -// BatchGetFindingsWithContext is the same as BatchGetFindings with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetFindings 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 *CodeGuruSecurity) BatchGetFindingsWithContext(ctx aws.Context, input *BatchGetFindingsInput, opts ...request.Option) (*BatchGetFindingsOutput, error) { - req, out := c.BatchGetFindingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateScan = "CreateScan" - -// CreateScanRequest generates a "aws/request.Request" representing the -// client's request for the CreateScan 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 CreateScan for more information on using the CreateScan -// 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 CreateScanRequest method. -// req, resp := client.CreateScanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/CreateScan -func (c *CodeGuruSecurity) CreateScanRequest(input *CreateScanInput) (req *request.Request, output *CreateScanOutput) { - op := &request.Operation{ - Name: opCreateScan, - HTTPMethod: "POST", - HTTPPath: "/scans", - } - - if input == nil { - input = &CreateScanInput{} - } - - output = &CreateScanOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateScan API operation for Amazon CodeGuru Security. -// -// Use to create a scan using code uploaded to an S3 bucket. -// -// 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 CodeGuru Security's -// API operation CreateScan for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/CreateScan -func (c *CodeGuruSecurity) CreateScan(input *CreateScanInput) (*CreateScanOutput, error) { - req, out := c.CreateScanRequest(input) - return out, req.Send() -} - -// CreateScanWithContext is the same as CreateScan with the addition of -// the ability to pass a context and additional request options. -// -// See CreateScan 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 *CodeGuruSecurity) CreateScanWithContext(ctx aws.Context, input *CreateScanInput, opts ...request.Option) (*CreateScanOutput, error) { - req, out := c.CreateScanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateUploadUrl = "CreateUploadUrl" - -// CreateUploadUrlRequest generates a "aws/request.Request" representing the -// client's request for the CreateUploadUrl 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 CreateUploadUrl for more information on using the CreateUploadUrl -// 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 CreateUploadUrlRequest method. -// req, resp := client.CreateUploadUrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/CreateUploadUrl -func (c *CodeGuruSecurity) CreateUploadUrlRequest(input *CreateUploadUrlInput) (req *request.Request, output *CreateUploadUrlOutput) { - op := &request.Operation{ - Name: opCreateUploadUrl, - HTTPMethod: "POST", - HTTPPath: "/uploadUrl", - } - - if input == nil { - input = &CreateUploadUrlInput{} - } - - output = &CreateUploadUrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateUploadUrl API operation for Amazon CodeGuru Security. -// -// Generates a pre-signed URL and request headers used to upload a code resource. -// -// You can upload your code resource to the URL and add the request headers -// using any HTTP client. -// -// 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 CodeGuru Security's -// API operation CreateUploadUrl for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/CreateUploadUrl -func (c *CodeGuruSecurity) CreateUploadUrl(input *CreateUploadUrlInput) (*CreateUploadUrlOutput, error) { - req, out := c.CreateUploadUrlRequest(input) - return out, req.Send() -} - -// CreateUploadUrlWithContext is the same as CreateUploadUrl with the addition of -// the ability to pass a context and additional request options. -// -// See CreateUploadUrl 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 *CodeGuruSecurity) CreateUploadUrlWithContext(ctx aws.Context, input *CreateUploadUrlInput, opts ...request.Option) (*CreateUploadUrlOutput, error) { - req, out := c.CreateUploadUrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAccountConfiguration = "GetAccountConfiguration" - -// GetAccountConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetAccountConfiguration 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 GetAccountConfiguration for more information on using the GetAccountConfiguration -// 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 GetAccountConfigurationRequest method. -// req, resp := client.GetAccountConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetAccountConfiguration -func (c *CodeGuruSecurity) GetAccountConfigurationRequest(input *GetAccountConfigurationInput) (req *request.Request, output *GetAccountConfigurationOutput) { - op := &request.Operation{ - Name: opGetAccountConfiguration, - HTTPMethod: "GET", - HTTPPath: "/accountConfiguration/get", - } - - if input == nil { - input = &GetAccountConfigurationInput{} - } - - output = &GetAccountConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccountConfiguration API operation for Amazon CodeGuru Security. -// -// Use to get account level configuration. -// -// 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 CodeGuru Security's -// API operation GetAccountConfiguration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetAccountConfiguration -func (c *CodeGuruSecurity) GetAccountConfiguration(input *GetAccountConfigurationInput) (*GetAccountConfigurationOutput, error) { - req, out := c.GetAccountConfigurationRequest(input) - return out, req.Send() -} - -// GetAccountConfigurationWithContext is the same as GetAccountConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetAccountConfiguration 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 *CodeGuruSecurity) GetAccountConfigurationWithContext(ctx aws.Context, input *GetAccountConfigurationInput, opts ...request.Option) (*GetAccountConfigurationOutput, error) { - req, out := c.GetAccountConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetFindings = "GetFindings" - -// GetFindingsRequest generates a "aws/request.Request" representing the -// client's request for the GetFindings 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 GetFindings for more information on using the GetFindings -// 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 GetFindingsRequest method. -// req, resp := client.GetFindingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetFindings -func (c *CodeGuruSecurity) GetFindingsRequest(input *GetFindingsInput) (req *request.Request, output *GetFindingsOutput) { - op := &request.Operation{ - Name: opGetFindings, - HTTPMethod: "GET", - HTTPPath: "/findings/{scanName}", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetFindingsInput{} - } - - output = &GetFindingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetFindings API operation for Amazon CodeGuru Security. -// -// Returns a list of all findings generated by a particular scan. -// -// 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 CodeGuru Security's -// API operation GetFindings for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetFindings -func (c *CodeGuruSecurity) GetFindings(input *GetFindingsInput) (*GetFindingsOutput, error) { - req, out := c.GetFindingsRequest(input) - return out, req.Send() -} - -// GetFindingsWithContext is the same as GetFindings with the addition of -// the ability to pass a context and additional request options. -// -// See GetFindings 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 *CodeGuruSecurity) GetFindingsWithContext(ctx aws.Context, input *GetFindingsInput, opts ...request.Option) (*GetFindingsOutput, error) { - req, out := c.GetFindingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetFindingsPages iterates over the pages of a GetFindings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetFindings method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetFindings operation. -// pageNum := 0 -// err := client.GetFindingsPages(params, -// func(page *codegurusecurity.GetFindingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CodeGuruSecurity) GetFindingsPages(input *GetFindingsInput, fn func(*GetFindingsOutput, bool) bool) error { - return c.GetFindingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetFindingsPagesWithContext same as GetFindingsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CodeGuruSecurity) GetFindingsPagesWithContext(ctx aws.Context, input *GetFindingsInput, fn func(*GetFindingsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetFindingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetFindingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetFindingsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetMetricsSummary = "GetMetricsSummary" - -// GetMetricsSummaryRequest generates a "aws/request.Request" representing the -// client's request for the GetMetricsSummary 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 GetMetricsSummary for more information on using the GetMetricsSummary -// 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 GetMetricsSummaryRequest method. -// req, resp := client.GetMetricsSummaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetMetricsSummary -func (c *CodeGuruSecurity) GetMetricsSummaryRequest(input *GetMetricsSummaryInput) (req *request.Request, output *GetMetricsSummaryOutput) { - op := &request.Operation{ - Name: opGetMetricsSummary, - HTTPMethod: "GET", - HTTPPath: "/metrics/summary", - } - - if input == nil { - input = &GetMetricsSummaryInput{} - } - - output = &GetMetricsSummaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMetricsSummary API operation for Amazon CodeGuru Security. -// -// Returns top level metrics about an account from a specified date, including -// number of open findings, the categories with most findings, the scans with -// most open findings, and scans with most open critical findings. -// -// 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 CodeGuru Security's -// API operation GetMetricsSummary for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetMetricsSummary -func (c *CodeGuruSecurity) GetMetricsSummary(input *GetMetricsSummaryInput) (*GetMetricsSummaryOutput, error) { - req, out := c.GetMetricsSummaryRequest(input) - return out, req.Send() -} - -// GetMetricsSummaryWithContext is the same as GetMetricsSummary with the addition of -// the ability to pass a context and additional request options. -// -// See GetMetricsSummary 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 *CodeGuruSecurity) GetMetricsSummaryWithContext(ctx aws.Context, input *GetMetricsSummaryInput, opts ...request.Option) (*GetMetricsSummaryOutput, error) { - req, out := c.GetMetricsSummaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetScan = "GetScan" - -// GetScanRequest generates a "aws/request.Request" representing the -// client's request for the GetScan 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 GetScan for more information on using the GetScan -// 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 GetScanRequest method. -// req, resp := client.GetScanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetScan -func (c *CodeGuruSecurity) GetScanRequest(input *GetScanInput) (req *request.Request, output *GetScanOutput) { - op := &request.Operation{ - Name: opGetScan, - HTTPMethod: "GET", - HTTPPath: "/scans/{scanName}", - } - - if input == nil { - input = &GetScanInput{} - } - - output = &GetScanOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetScan API operation for Amazon CodeGuru Security. -// -// Returns details about a scan, including whether or not a scan has completed. -// -// 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 CodeGuru Security's -// API operation GetScan for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/GetScan -func (c *CodeGuruSecurity) GetScan(input *GetScanInput) (*GetScanOutput, error) { - req, out := c.GetScanRequest(input) - return out, req.Send() -} - -// GetScanWithContext is the same as GetScan with the addition of -// the ability to pass a context and additional request options. -// -// See GetScan 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 *CodeGuruSecurity) GetScanWithContext(ctx aws.Context, input *GetScanInput, opts ...request.Option) (*GetScanOutput, error) { - req, out := c.GetScanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListFindingsMetrics = "ListFindingsMetrics" - -// ListFindingsMetricsRequest generates a "aws/request.Request" representing the -// client's request for the ListFindingsMetrics 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 ListFindingsMetrics for more information on using the ListFindingsMetrics -// 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 ListFindingsMetricsRequest method. -// req, resp := client.ListFindingsMetricsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/ListFindingsMetrics -func (c *CodeGuruSecurity) ListFindingsMetricsRequest(input *ListFindingsMetricsInput) (req *request.Request, output *ListFindingsMetricsOutput) { - op := &request.Operation{ - Name: opListFindingsMetrics, - HTTPMethod: "GET", - HTTPPath: "/metrics/findings", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListFindingsMetricsInput{} - } - - output = &ListFindingsMetricsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListFindingsMetrics API operation for Amazon CodeGuru Security. -// -// Returns metrics about all findings in an account within a specified time -// range. -// -// 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 CodeGuru Security's -// API operation ListFindingsMetrics for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/ListFindingsMetrics -func (c *CodeGuruSecurity) ListFindingsMetrics(input *ListFindingsMetricsInput) (*ListFindingsMetricsOutput, error) { - req, out := c.ListFindingsMetricsRequest(input) - return out, req.Send() -} - -// ListFindingsMetricsWithContext is the same as ListFindingsMetrics with the addition of -// the ability to pass a context and additional request options. -// -// See ListFindingsMetrics 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 *CodeGuruSecurity) ListFindingsMetricsWithContext(ctx aws.Context, input *ListFindingsMetricsInput, opts ...request.Option) (*ListFindingsMetricsOutput, error) { - req, out := c.ListFindingsMetricsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListFindingsMetricsPages iterates over the pages of a ListFindingsMetrics operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFindingsMetrics method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListFindingsMetrics operation. -// pageNum := 0 -// err := client.ListFindingsMetricsPages(params, -// func(page *codegurusecurity.ListFindingsMetricsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CodeGuruSecurity) ListFindingsMetricsPages(input *ListFindingsMetricsInput, fn func(*ListFindingsMetricsOutput, bool) bool) error { - return c.ListFindingsMetricsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFindingsMetricsPagesWithContext same as ListFindingsMetricsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CodeGuruSecurity) ListFindingsMetricsPagesWithContext(ctx aws.Context, input *ListFindingsMetricsInput, fn func(*ListFindingsMetricsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListFindingsMetricsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListFindingsMetricsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListFindingsMetricsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListScans = "ListScans" - -// ListScansRequest generates a "aws/request.Request" representing the -// client's request for the ListScans 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 ListScans for more information on using the ListScans -// 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 ListScansRequest method. -// req, resp := client.ListScansRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/ListScans -func (c *CodeGuruSecurity) ListScansRequest(input *ListScansInput) (req *request.Request, output *ListScansOutput) { - op := &request.Operation{ - Name: opListScans, - HTTPMethod: "GET", - HTTPPath: "/scans", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListScansInput{} - } - - output = &ListScansOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListScans API operation for Amazon CodeGuru Security. -// -// Returns a list of all the standard scans in an account. Does not return express -// scans. -// -// 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 CodeGuru Security's -// API operation ListScans for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/ListScans -func (c *CodeGuruSecurity) ListScans(input *ListScansInput) (*ListScansOutput, error) { - req, out := c.ListScansRequest(input) - return out, req.Send() -} - -// ListScansWithContext is the same as ListScans with the addition of -// the ability to pass a context and additional request options. -// -// See ListScans 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 *CodeGuruSecurity) ListScansWithContext(ctx aws.Context, input *ListScansInput, opts ...request.Option) (*ListScansOutput, error) { - req, out := c.ListScansRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListScansPages iterates over the pages of a ListScans operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListScans method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListScans operation. -// pageNum := 0 -// err := client.ListScansPages(params, -// func(page *codegurusecurity.ListScansOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CodeGuruSecurity) ListScansPages(input *ListScansInput, fn func(*ListScansOutput, bool) bool) error { - return c.ListScansPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListScansPagesWithContext same as ListScansPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CodeGuruSecurity) ListScansPagesWithContext(ctx aws.Context, input *ListScansInput, fn func(*ListScansOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListScansInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListScansRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListScansOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/ListTagsForResource -func (c *CodeGuruSecurity) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon CodeGuru Security. -// -// Returns a list of all tags associated with a scan. -// -// 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 CodeGuru Security's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/ListTagsForResource -func (c *CodeGuruSecurity) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *CodeGuruSecurity) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/TagResource -func (c *CodeGuruSecurity) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon CodeGuru Security. -// -// Use to add one or more tags to an existing scan. -// -// 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 CodeGuru Security's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/TagResource -func (c *CodeGuruSecurity) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *CodeGuruSecurity) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/UntagResource -func (c *CodeGuruSecurity) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon CodeGuru Security. -// -// Use to remove one or more tags from an existing scan. -// -// 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 CodeGuru Security's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/UntagResource -func (c *CodeGuruSecurity) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *CodeGuruSecurity) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAccountConfiguration = "UpdateAccountConfiguration" - -// UpdateAccountConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAccountConfiguration 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 UpdateAccountConfiguration for more information on using the UpdateAccountConfiguration -// 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 UpdateAccountConfigurationRequest method. -// req, resp := client.UpdateAccountConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/UpdateAccountConfiguration -func (c *CodeGuruSecurity) UpdateAccountConfigurationRequest(input *UpdateAccountConfigurationInput) (req *request.Request, output *UpdateAccountConfigurationOutput) { - op := &request.Operation{ - Name: opUpdateAccountConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/updateAccountConfiguration", - } - - if input == nil { - input = &UpdateAccountConfigurationInput{} - } - - output = &UpdateAccountConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAccountConfiguration API operation for Amazon CodeGuru Security. -// -// Use to update account-level configuration with an encryption key. -// -// 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 CodeGuru Security's -// API operation UpdateAccountConfiguration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10/UpdateAccountConfiguration -func (c *CodeGuruSecurity) UpdateAccountConfiguration(input *UpdateAccountConfigurationInput) (*UpdateAccountConfigurationOutput, error) { - req, out := c.UpdateAccountConfigurationRequest(input) - return out, req.Send() -} - -// UpdateAccountConfigurationWithContext is the same as UpdateAccountConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAccountConfiguration 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 *CodeGuruSecurity) UpdateAccountConfigurationWithContext(ctx aws.Context, input *UpdateAccountConfigurationInput, opts ...request.Option) (*UpdateAccountConfigurationOutput, error) { - req, out := c.UpdateAccountConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The identifier for the error. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // The identifier for the resource you don't have access to. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of resource you don't have access to. - ResourceType *string `locationName:"resourceType" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A summary of findings metrics in an account. -type AccountFindingsMetric struct { - _ struct{} `type:"structure"` - - // The number of closed findings of each severity in an account on the specified - // date. - ClosedFindings *FindingMetricsValuePerSeverity `locationName:"closedFindings" type:"structure"` - - // The date from which the finding metrics were retrieved. - Date *time.Time `locationName:"date" type:"timestamp"` - - // The average time it takes to close findings of each severity in days. - MeanTimeToClose *FindingMetricsValuePerSeverity `locationName:"meanTimeToClose" type:"structure"` - - // The number of new findings of each severity in account on the specified date. - NewFindings *FindingMetricsValuePerSeverity `locationName:"newFindings" type:"structure"` - - // The number of open findings of each severity in an account as of the specified - // date. - OpenFindings *FindingMetricsValuePerSeverity `locationName:"openFindings" 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 AccountFindingsMetric) 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 AccountFindingsMetric) GoString() string { - return s.String() -} - -// SetClosedFindings sets the ClosedFindings field's value. -func (s *AccountFindingsMetric) SetClosedFindings(v *FindingMetricsValuePerSeverity) *AccountFindingsMetric { - s.ClosedFindings = v - return s -} - -// SetDate sets the Date field's value. -func (s *AccountFindingsMetric) SetDate(v time.Time) *AccountFindingsMetric { - s.Date = &v - return s -} - -// SetMeanTimeToClose sets the MeanTimeToClose field's value. -func (s *AccountFindingsMetric) SetMeanTimeToClose(v *FindingMetricsValuePerSeverity) *AccountFindingsMetric { - s.MeanTimeToClose = v - return s -} - -// SetNewFindings sets the NewFindings field's value. -func (s *AccountFindingsMetric) SetNewFindings(v *FindingMetricsValuePerSeverity) *AccountFindingsMetric { - s.NewFindings = v - return s -} - -// SetOpenFindings sets the OpenFindings field's value. -func (s *AccountFindingsMetric) SetOpenFindings(v *FindingMetricsValuePerSeverity) *AccountFindingsMetric { - s.OpenFindings = v - return s -} - -// Contains information about the error that caused a finding to fail to be -// retrieved. -type BatchGetFindingsError struct { - _ struct{} `type:"structure"` - - // A code associated with the type of error. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true" enum:"ErrorCode"` - - // The finding ID of the finding that was not fetched. - // - // FindingId is a required field - FindingId *string `locationName:"findingId" type:"string" required:"true"` - - // Describes the error. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the scan that generated the finding. - // - // ScanName is a required field - ScanName *string `locationName:"scanName" min:"1" 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 BatchGetFindingsError) 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 BatchGetFindingsError) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *BatchGetFindingsError) SetErrorCode(v string) *BatchGetFindingsError { - s.ErrorCode = &v - return s -} - -// SetFindingId sets the FindingId field's value. -func (s *BatchGetFindingsError) SetFindingId(v string) *BatchGetFindingsError { - s.FindingId = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *BatchGetFindingsError) SetMessage(v string) *BatchGetFindingsError { - s.Message = &v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *BatchGetFindingsError) SetScanName(v string) *BatchGetFindingsError { - s.ScanName = &v - return s -} - -type BatchGetFindingsInput struct { - _ struct{} `type:"structure"` - - // A list of finding identifiers. Each identifier consists of a scanName and - // a findingId. You retrieve the findingId when you call GetFindings. - // - // FindingIdentifiers is a required field - FindingIdentifiers []*FindingIdentifier `locationName:"findingIdentifiers" min:"1" type:"list" 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 BatchGetFindingsInput) 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 BatchGetFindingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetFindingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetFindingsInput"} - if s.FindingIdentifiers == nil { - invalidParams.Add(request.NewErrParamRequired("FindingIdentifiers")) - } - if s.FindingIdentifiers != nil && len(s.FindingIdentifiers) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FindingIdentifiers", 1)) - } - if s.FindingIdentifiers != nil { - for i, v := range s.FindingIdentifiers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "FindingIdentifiers", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFindingIdentifiers sets the FindingIdentifiers field's value. -func (s *BatchGetFindingsInput) SetFindingIdentifiers(v []*FindingIdentifier) *BatchGetFindingsInput { - s.FindingIdentifiers = v - return s -} - -type BatchGetFindingsOutput struct { - _ struct{} `type:"structure"` - - // A list of errors for individual findings which were not fetched. Each BatchGetFindingsError - // contains the scanName, findingId, errorCode and error message. - // - // FailedFindings is a required field - FailedFindings []*BatchGetFindingsError `locationName:"failedFindings" type:"list" required:"true"` - - // A list of all requested findings. - // - // Findings is a required field - Findings []*Finding `locationName:"findings" type:"list" 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 BatchGetFindingsOutput) 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 BatchGetFindingsOutput) GoString() string { - return s.String() -} - -// SetFailedFindings sets the FailedFindings field's value. -func (s *BatchGetFindingsOutput) SetFailedFindings(v []*BatchGetFindingsError) *BatchGetFindingsOutput { - s.FailedFindings = v - return s -} - -// SetFindings sets the Findings field's value. -func (s *BatchGetFindingsOutput) SetFindings(v []*Finding) *BatchGetFindingsOutput { - s.Findings = v - return s -} - -// Information about a finding category with open findings. -type CategoryWithFindingNum struct { - _ struct{} `type:"structure"` - - // The name of the finding category. A finding category is determined by the - // detector that detected the finding. - CategoryName *string `locationName:"categoryName" type:"string"` - - // The number of open findings in the category. - FindingNumber *int64 `locationName:"findingNumber" 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 CategoryWithFindingNum) 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 CategoryWithFindingNum) GoString() string { - return s.String() -} - -// SetCategoryName sets the CategoryName field's value. -func (s *CategoryWithFindingNum) SetCategoryName(v string) *CategoryWithFindingNum { - s.CategoryName = &v - return s -} - -// SetFindingNumber sets the FindingNumber field's value. -func (s *CategoryWithFindingNum) SetFindingNumber(v int64) *CategoryWithFindingNum { - s.FindingNumber = &v - return s -} - -// The line of code where a finding was detected. -type CodeLine struct { - _ struct{} `type:"structure"` - - // The code that contains a vulnerability. - Content *string `locationName:"content" type:"string"` - - // The code line number. - Number *int64 `locationName:"number" 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 CodeLine) 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 CodeLine) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *CodeLine) SetContent(v string) *CodeLine { - s.Content = &v - return s -} - -// SetNumber sets the Number field's value. -func (s *CodeLine) SetNumber(v int64) *CodeLine { - s.Number = &v - return s -} - -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The identifier for the error. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // The identifier for the service resource associated with the request. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of resource associated with the request. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateScanInput struct { - _ struct{} `type:"structure"` - - // The type of analysis you want CodeGuru Security to perform in the scan, either - // Security or All. The Security type only generates findings related to security. - // The All type generates both security findings and quality findings. Defaults - // to Security type if missing. - AnalysisType *string `locationName:"analysisType" type:"string" enum:"AnalysisType"` - - // The idempotency token for the request. Amazon CodeGuru Security uses this - // value to prevent the accidental creation of duplicate scans if there are - // failures and retries. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The identifier for an input resource used to create a scan. - // - // ResourceId is a required field - ResourceId *ResourceId `locationName:"resourceId" type:"structure" required:"true"` - - // The unique name that CodeGuru Security uses to track revisions across multiple - // scans of the same resource. Only allowed for a STANDARD scan type. If not - // specified, it will be auto generated. - // - // ScanName is a required field - ScanName *string `locationName:"scanName" min:"1" type:"string" required:"true"` - - // The type of scan, either Standard or Express. Defaults to Standard type if - // missing. - // - // Express scans run on limited resources and use a limited set of detectors - // to analyze your code in near-real time. Standard scans have standard resource - // limits and use the full set of detectors to analyze your code. - ScanType *string `locationName:"scanType" type:"string" enum:"ScanType"` - - // An array of key-value pairs used to tag a scan. A tag is a custom attribute - // label with two parts: - // - // * A tag key. For example, CostCenter, Environment, or Secret. Tag keys - // are case sensitive. - // - // * An optional tag value field. For example, 111122223333, Production, - // or a team name. Omitting the tag value is the same as using an empty string. - // Tag values are case sensitive. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateScanInput) 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 CreateScanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateScanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateScanInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ScanName == nil { - invalidParams.Add(request.NewErrParamRequired("ScanName")) - } - if s.ScanName != nil && len(*s.ScanName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScanName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalysisType sets the AnalysisType field's value. -func (s *CreateScanInput) SetAnalysisType(v string) *CreateScanInput { - s.AnalysisType = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateScanInput) SetClientToken(v string) *CreateScanInput { - s.ClientToken = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *CreateScanInput) SetResourceId(v *ResourceId) *CreateScanInput { - s.ResourceId = v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *CreateScanInput) SetScanName(v string) *CreateScanInput { - s.ScanName = &v - return s -} - -// SetScanType sets the ScanType field's value. -func (s *CreateScanInput) SetScanType(v string) *CreateScanInput { - s.ScanType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateScanInput) SetTags(v map[string]*string) *CreateScanInput { - s.Tags = v - return s -} - -type CreateScanOutput struct { - _ struct{} `type:"structure"` - - // The identifier for the resource object that contains resources that were - // scanned. - // - // ResourceId is a required field - ResourceId *ResourceId `locationName:"resourceId" type:"structure" required:"true"` - - // UUID that identifies the individual scan run. - // - // RunId is a required field - RunId *string `locationName:"runId" type:"string" required:"true"` - - // The name of the scan. - // - // ScanName is a required field - ScanName *string `locationName:"scanName" min:"1" type:"string" required:"true"` - - // The ARN for the scan name. - ScanNameArn *string `locationName:"scanNameArn" min:"1" type:"string"` - - // The current state of the scan. Returns either InProgress, Successful, or - // Failed. - // - // ScanState is a required field - ScanState *string `locationName:"scanState" type:"string" required:"true" enum:"ScanState"` -} - -// 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 CreateScanOutput) 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 CreateScanOutput) GoString() string { - return s.String() -} - -// SetResourceId sets the ResourceId field's value. -func (s *CreateScanOutput) SetResourceId(v *ResourceId) *CreateScanOutput { - s.ResourceId = v - return s -} - -// SetRunId sets the RunId field's value. -func (s *CreateScanOutput) SetRunId(v string) *CreateScanOutput { - s.RunId = &v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *CreateScanOutput) SetScanName(v string) *CreateScanOutput { - s.ScanName = &v - return s -} - -// SetScanNameArn sets the ScanNameArn field's value. -func (s *CreateScanOutput) SetScanNameArn(v string) *CreateScanOutput { - s.ScanNameArn = &v - return s -} - -// SetScanState sets the ScanState field's value. -func (s *CreateScanOutput) SetScanState(v string) *CreateScanOutput { - s.ScanState = &v - return s -} - -type CreateUploadUrlInput struct { - _ struct{} `type:"structure"` - - // The name of the scan that will use the uploaded resource. CodeGuru Security - // uses the unique scan name to track revisions across multiple scans of the - // same resource. Use this scanName when you call CreateScan on the code resource - // you upload to this URL. - // - // ScanName is a required field - ScanName *string `locationName:"scanName" min:"1" 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 CreateUploadUrlInput) 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 CreateUploadUrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUploadUrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUploadUrlInput"} - if s.ScanName == nil { - invalidParams.Add(request.NewErrParamRequired("ScanName")) - } - if s.ScanName != nil && len(*s.ScanName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScanName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetScanName sets the ScanName field's value. -func (s *CreateUploadUrlInput) SetScanName(v string) *CreateUploadUrlInput { - s.ScanName = &v - return s -} - -type CreateUploadUrlOutput struct { - _ struct{} `type:"structure"` - - // The identifier for the uploaded code resource. - // - // CodeArtifactId is a required field - CodeArtifactId *string `locationName:"codeArtifactId" type:"string" required:"true"` - - // A set of key-value pairs that contain the required headers when uploading - // your resource. - // - // RequestHeaders is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateUploadUrlOutput's - // String and GoString methods. - // - // RequestHeaders is a required field - RequestHeaders map[string]*string `locationName:"requestHeaders" type:"map" required:"true" sensitive:"true"` - - // A pre-signed S3 URL. You can upload the code file you want to scan and add - // the required requestHeaders using any HTTP client. - // - // S3Url is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateUploadUrlOutput's - // String and GoString methods. - // - // S3Url is a required field - S3Url *string `locationName:"s3Url" min:"1" type:"string" required:"true" sensitive:"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 CreateUploadUrlOutput) 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 CreateUploadUrlOutput) GoString() string { - return s.String() -} - -// SetCodeArtifactId sets the CodeArtifactId field's value. -func (s *CreateUploadUrlOutput) SetCodeArtifactId(v string) *CreateUploadUrlOutput { - s.CodeArtifactId = &v - return s -} - -// SetRequestHeaders sets the RequestHeaders field's value. -func (s *CreateUploadUrlOutput) SetRequestHeaders(v map[string]*string) *CreateUploadUrlOutput { - s.RequestHeaders = v - return s -} - -// SetS3Url sets the S3Url field's value. -func (s *CreateUploadUrlOutput) SetS3Url(v string) *CreateUploadUrlOutput { - s.S3Url = &v - return s -} - -// Information about account-level configuration. -type EncryptionConfig struct { - _ struct{} `type:"structure"` - - // The KMS key ARN to use for encryption. This must be provided as a header - // when uploading your code resource. - KmsKeyArn *string `locationName:"kmsKeyArn" min:"1" 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 EncryptionConfig) 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 EncryptionConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptionConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptionConfig"} - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *EncryptionConfig) SetKmsKeyArn(v string) *EncryptionConfig { - s.KmsKeyArn = &v - return s -} - -// Information about the location of security vulnerabilities that Amazon CodeGuru -// Security detected in your code. -type FilePath struct { - _ struct{} `type:"structure"` - - // A list of CodeLine objects that describe where the security vulnerability - // appears in your code. - CodeSnippet []*CodeLine `locationName:"codeSnippet" type:"list"` - - // The last line number of the code snippet where the security vulnerability - // appears in your code. - EndLine *int64 `locationName:"endLine" type:"integer"` - - // The name of the file. - Name *string `locationName:"name" type:"string"` - - // The path to the resource with the security vulnerability. - Path *string `locationName:"path" type:"string"` - - // The first line number of the code snippet where the security vulnerability - // appears in your code. - StartLine *int64 `locationName:"startLine" 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 FilePath) 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 FilePath) GoString() string { - return s.String() -} - -// SetCodeSnippet sets the CodeSnippet field's value. -func (s *FilePath) SetCodeSnippet(v []*CodeLine) *FilePath { - s.CodeSnippet = v - return s -} - -// SetEndLine sets the EndLine field's value. -func (s *FilePath) SetEndLine(v int64) *FilePath { - s.EndLine = &v - return s -} - -// SetName sets the Name field's value. -func (s *FilePath) SetName(v string) *FilePath { - s.Name = &v - return s -} - -// SetPath sets the Path field's value. -func (s *FilePath) SetPath(v string) *FilePath { - s.Path = &v - return s -} - -// SetStartLine sets the StartLine field's value. -func (s *FilePath) SetStartLine(v int64) *FilePath { - s.StartLine = &v - return s -} - -// Information about a finding that was detected in your code. -type Finding struct { - _ struct{} `type:"structure"` - - // The time when the finding was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // A description of the finding. - Description *string `locationName:"description" type:"string"` - - // The identifier for the detector that detected the finding in your code. A - // detector is a defined rule based on industry standards and AWS best practices. - DetectorId *string `locationName:"detectorId" type:"string"` - - // The name of the detector that identified the security vulnerability in your - // code. - DetectorName *string `locationName:"detectorName" type:"string"` - - // One or more tags or categorizations that are associated with a detector. - // These tags are defined by type, programming language, or other classification - // such as maintainability or consistency. - DetectorTags []*string `locationName:"detectorTags" type:"list"` - - // The identifier for the component that generated a finding such as AWSCodeGuruSecurity - // or AWSInspector. - GeneratorId *string `locationName:"generatorId" type:"string"` - - // The identifier for a finding. - Id *string `locationName:"id" type:"string"` - - // An object that contains the details about how to remediate a finding. - Remediation *Remediation `locationName:"remediation" type:"structure"` - - // The resource where Amazon CodeGuru Security detected a finding. - Resource *Resource `locationName:"resource" type:"structure"` - - // The identifier for the rule that generated the finding. - RuleId *string `locationName:"ruleId" type:"string"` - - // The severity of the finding. - Severity *string `locationName:"severity" type:"string" enum:"Severity"` - - // The status of the finding. A finding status can be open or closed. - Status *string `locationName:"status" type:"string" enum:"Status"` - - // The title of the finding. - Title *string `locationName:"title" type:"string"` - - // The type of finding. - Type *string `locationName:"type" type:"string"` - - // The time when the finding was last updated. Findings are updated when you - // remediate them or when the finding code location changes. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // An object that describes the detected security vulnerability. - Vulnerability *Vulnerability `locationName:"vulnerability" 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 Finding) 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 Finding) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Finding) SetCreatedAt(v time.Time) *Finding { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Finding) SetDescription(v string) *Finding { - s.Description = &v - return s -} - -// SetDetectorId sets the DetectorId field's value. -func (s *Finding) SetDetectorId(v string) *Finding { - s.DetectorId = &v - return s -} - -// SetDetectorName sets the DetectorName field's value. -func (s *Finding) SetDetectorName(v string) *Finding { - s.DetectorName = &v - return s -} - -// SetDetectorTags sets the DetectorTags field's value. -func (s *Finding) SetDetectorTags(v []*string) *Finding { - s.DetectorTags = v - return s -} - -// SetGeneratorId sets the GeneratorId field's value. -func (s *Finding) SetGeneratorId(v string) *Finding { - s.GeneratorId = &v - return s -} - -// SetId sets the Id field's value. -func (s *Finding) SetId(v string) *Finding { - s.Id = &v - return s -} - -// SetRemediation sets the Remediation field's value. -func (s *Finding) SetRemediation(v *Remediation) *Finding { - s.Remediation = v - return s -} - -// SetResource sets the Resource field's value. -func (s *Finding) SetResource(v *Resource) *Finding { - s.Resource = v - return s -} - -// SetRuleId sets the RuleId field's value. -func (s *Finding) SetRuleId(v string) *Finding { - s.RuleId = &v - return s -} - -// SetSeverity sets the Severity field's value. -func (s *Finding) SetSeverity(v string) *Finding { - s.Severity = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Finding) SetStatus(v string) *Finding { - s.Status = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *Finding) SetTitle(v string) *Finding { - s.Title = &v - return s -} - -// SetType sets the Type field's value. -func (s *Finding) SetType(v string) *Finding { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Finding) SetUpdatedAt(v time.Time) *Finding { - s.UpdatedAt = &v - return s -} - -// SetVulnerability sets the Vulnerability field's value. -func (s *Finding) SetVulnerability(v *Vulnerability) *Finding { - s.Vulnerability = v - return s -} - -// An object that contains information about a finding and the scan that generated -// it. -type FindingIdentifier struct { - _ struct{} `type:"structure"` - - // The identifier for a finding. - // - // FindingId is a required field - FindingId *string `locationName:"findingId" type:"string" required:"true"` - - // The name of the scan that generated the finding. - // - // ScanName is a required field - ScanName *string `locationName:"scanName" 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 FindingIdentifier) 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 FindingIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FindingIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FindingIdentifier"} - if s.FindingId == nil { - invalidParams.Add(request.NewErrParamRequired("FindingId")) - } - if s.ScanName == nil { - invalidParams.Add(request.NewErrParamRequired("ScanName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFindingId sets the FindingId field's value. -func (s *FindingIdentifier) SetFindingId(v string) *FindingIdentifier { - s.FindingId = &v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *FindingIdentifier) SetScanName(v string) *FindingIdentifier { - s.ScanName = &v - return s -} - -// The severity of the issue in the code that generated a finding. -type FindingMetricsValuePerSeverity struct { - _ struct{} `type:"structure"` - - // The severity of the finding is critical and should be addressed immediately. - Critical *float64 `locationName:"critical" type:"double"` - - // The severity of the finding is high and should be addressed as a near-term - // priority. - High *float64 `locationName:"high" type:"double"` - - // The finding is related to quality or readability improvements and not considered - // actionable. - Info *float64 `locationName:"info" type:"double"` - - // The severity of the finding is low and does require action on its own. - Low *float64 `locationName:"low" type:"double"` - - // The severity of the finding is medium and should be addressed as a mid-term - // priority. - Medium *float64 `locationName:"medium" type:"double"` -} - -// 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 FindingMetricsValuePerSeverity) 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 FindingMetricsValuePerSeverity) GoString() string { - return s.String() -} - -// SetCritical sets the Critical field's value. -func (s *FindingMetricsValuePerSeverity) SetCritical(v float64) *FindingMetricsValuePerSeverity { - s.Critical = &v - return s -} - -// SetHigh sets the High field's value. -func (s *FindingMetricsValuePerSeverity) SetHigh(v float64) *FindingMetricsValuePerSeverity { - s.High = &v - return s -} - -// SetInfo sets the Info field's value. -func (s *FindingMetricsValuePerSeverity) SetInfo(v float64) *FindingMetricsValuePerSeverity { - s.Info = &v - return s -} - -// SetLow sets the Low field's value. -func (s *FindingMetricsValuePerSeverity) SetLow(v float64) *FindingMetricsValuePerSeverity { - s.Low = &v - return s -} - -// SetMedium sets the Medium field's value. -func (s *FindingMetricsValuePerSeverity) SetMedium(v float64) *FindingMetricsValuePerSeverity { - s.Medium = &v - return s -} - -type GetAccountConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"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 GetAccountConfigurationInput) 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 GetAccountConfigurationInput) GoString() string { - return s.String() -} - -type GetAccountConfigurationOutput struct { - _ struct{} `type:"structure"` - - // An EncryptionConfig object that contains the KMS key ARN to use for encryption. - // By default, CodeGuru Security uses an AWS-managed key for encryption. To - // specify your own key, call UpdateAccountConfiguration. - // - // EncryptionConfig is a required field - EncryptionConfig *EncryptionConfig `locationName:"encryptionConfig" type:"structure" 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 GetAccountConfigurationOutput) 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 GetAccountConfigurationOutput) GoString() string { - return s.String() -} - -// SetEncryptionConfig sets the EncryptionConfig field's value. -func (s *GetAccountConfigurationOutput) SetEncryptionConfig(v *EncryptionConfig) *GetAccountConfigurationOutput { - s.EncryptionConfig = v - return s -} - -type GetFindingsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in the response. Use this parameter - // when paginating results. If additional results exist beyond the number you - // specify, the nextToken element is returned in the response. Use nextToken - // in a subsequent request to retrieve additional results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A token to use for paginating results that are returned in the response. - // Set the value of this parameter to null for the first request. For subsequent - // calls, use the nextToken value returned from the previous request to continue - // listing results after the first page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The name of the scan you want to retrieve findings from. - // - // ScanName is a required field - ScanName *string `location:"uri" locationName:"scanName" min:"1" type:"string" required:"true"` - - // The status of the findings you want to get. Pass either Open, Closed, or - // All. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"Status"` -} - -// 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 GetFindingsInput) 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 GetFindingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFindingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFindingsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ScanName == nil { - invalidParams.Add(request.NewErrParamRequired("ScanName")) - } - if s.ScanName != nil && len(*s.ScanName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScanName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetFindingsInput) SetMaxResults(v int64) *GetFindingsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetFindingsInput) SetNextToken(v string) *GetFindingsInput { - s.NextToken = &v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *GetFindingsInput) SetScanName(v string) *GetFindingsInput { - s.ScanName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetFindingsInput) SetStatus(v string) *GetFindingsInput { - s.Status = &v - return s -} - -type GetFindingsOutput struct { - _ struct{} `type:"structure"` - - // A list of findings generated by the specified scan. - Findings []*Finding `locationName:"findings" type:"list"` - - // A pagination token. You can use this in future calls to GetFindings to continue - // listing results after the current page. - NextToken *string `locationName:"nextToken" min:"1" 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 GetFindingsOutput) 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 GetFindingsOutput) GoString() string { - return s.String() -} - -// SetFindings sets the Findings field's value. -func (s *GetFindingsOutput) SetFindings(v []*Finding) *GetFindingsOutput { - s.Findings = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetFindingsOutput) SetNextToken(v string) *GetFindingsOutput { - s.NextToken = &v - return s -} - -type GetMetricsSummaryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The date you want to retrieve summary metrics from, rounded to the nearest - // day. The date must be within the past two years since metrics data is only - // stored for two years. If a date outside of this range is passed, the response - // will be empty. - // - // Date is a required field - Date *time.Time `location:"querystring" locationName:"date" type:"timestamp" 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 GetMetricsSummaryInput) 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 GetMetricsSummaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMetricsSummaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMetricsSummaryInput"} - if s.Date == nil { - invalidParams.Add(request.NewErrParamRequired("Date")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDate sets the Date field's value. -func (s *GetMetricsSummaryInput) SetDate(v time.Time) *GetMetricsSummaryInput { - s.Date = &v - return s -} - -type GetMetricsSummaryOutput struct { - _ struct{} `type:"structure"` - - // The summary metrics from the specified date. - MetricsSummary *MetricsSummary `locationName:"metricsSummary" 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 GetMetricsSummaryOutput) 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 GetMetricsSummaryOutput) GoString() string { - return s.String() -} - -// SetMetricsSummary sets the MetricsSummary field's value. -func (s *GetMetricsSummaryOutput) SetMetricsSummary(v *MetricsSummary) *GetMetricsSummaryOutput { - s.MetricsSummary = v - return s -} - -type GetScanInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // UUID that identifies the individual scan run you want to view details about. - // You retrieve this when you call the CreateScan operation. Defaults to the - // latest scan run if missing. - RunId *string `location:"querystring" locationName:"runId" type:"string"` - - // The name of the scan you want to view details about. - // - // ScanName is a required field - ScanName *string `location:"uri" locationName:"scanName" min:"1" 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 GetScanInput) 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 GetScanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetScanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetScanInput"} - if s.ScanName == nil { - invalidParams.Add(request.NewErrParamRequired("ScanName")) - } - if s.ScanName != nil && len(*s.ScanName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScanName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRunId sets the RunId field's value. -func (s *GetScanInput) SetRunId(v string) *GetScanInput { - s.RunId = &v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *GetScanInput) SetScanName(v string) *GetScanInput { - s.ScanName = &v - return s -} - -type GetScanOutput struct { - _ struct{} `type:"structure"` - - // The type of analysis CodeGuru Security performed in the scan, either Security - // or All. The Security type only generates findings related to security. The - // All type generates both security findings and quality findings. - // - // AnalysisType is a required field - AnalysisType *string `locationName:"analysisType" type:"string" required:"true" enum:"AnalysisType"` - - // The time the scan was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The number of times a scan has been re-run on a revised resource. - NumberOfRevisions *int64 `locationName:"numberOfRevisions" type:"long"` - - // UUID that identifies the individual scan run. - // - // RunId is a required field - RunId *string `locationName:"runId" type:"string" required:"true"` - - // The name of the scan. - // - // ScanName is a required field - ScanName *string `locationName:"scanName" min:"1" type:"string" required:"true"` - - // The ARN for the scan name. - ScanNameArn *string `locationName:"scanNameArn" min:"1" type:"string"` - - // The current state of the scan. Pass either InProgress, Successful, or Failed. - // - // ScanState is a required field - ScanState *string `locationName:"scanState" type:"string" required:"true" enum:"ScanState"` - - // The time when the scan was last updated. Only available for STANDARD scan - // types. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 GetScanOutput) 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 GetScanOutput) GoString() string { - return s.String() -} - -// SetAnalysisType sets the AnalysisType field's value. -func (s *GetScanOutput) SetAnalysisType(v string) *GetScanOutput { - s.AnalysisType = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetScanOutput) SetCreatedAt(v time.Time) *GetScanOutput { - s.CreatedAt = &v - return s -} - -// SetNumberOfRevisions sets the NumberOfRevisions field's value. -func (s *GetScanOutput) SetNumberOfRevisions(v int64) *GetScanOutput { - s.NumberOfRevisions = &v - return s -} - -// SetRunId sets the RunId field's value. -func (s *GetScanOutput) SetRunId(v string) *GetScanOutput { - s.RunId = &v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *GetScanOutput) SetScanName(v string) *GetScanOutput { - s.ScanName = &v - return s -} - -// SetScanNameArn sets the ScanNameArn field's value. -func (s *GetScanOutput) SetScanNameArn(v string) *GetScanOutput { - s.ScanNameArn = &v - return s -} - -// SetScanState sets the ScanState field's value. -func (s *GetScanOutput) SetScanState(v string) *GetScanOutput { - s.ScanState = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetScanOutput) SetUpdatedAt(v time.Time) *GetScanOutput { - s.UpdatedAt = &v - return s -} - -// The server encountered an internal error and is unable to complete the request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The internal error encountered by the server. - Error_ *string `locationName:"error" type:"string"` - - // Description of the error. - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListFindingsMetricsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The end date of the interval which you want to retrieve metrics from. - // - // EndDate is a required field - EndDate *time.Time `location:"querystring" locationName:"endDate" type:"timestamp" required:"true"` - - // The maximum number of results to return in the response. Use this parameter - // when paginating results. If additional results exist beyond the number you - // specify, the nextToken element is returned in the response. Use nextToken - // in a subsequent request to retrieve additional results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A token to use for paginating results that are returned in the response. - // Set the value of this parameter to null for the first request. For subsequent - // calls, use the nextToken value returned from the previous request to continue - // listing results after the first page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The start date of the interval which you want to retrieve metrics from. - // - // StartDate is a required field - StartDate *time.Time `location:"querystring" locationName:"startDate" type:"timestamp" 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 ListFindingsMetricsInput) 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 ListFindingsMetricsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListFindingsMetricsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListFindingsMetricsInput"} - if s.EndDate == nil { - invalidParams.Add(request.NewErrParamRequired("EndDate")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.StartDate == nil { - invalidParams.Add(request.NewErrParamRequired("StartDate")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndDate sets the EndDate field's value. -func (s *ListFindingsMetricsInput) SetEndDate(v time.Time) *ListFindingsMetricsInput { - s.EndDate = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListFindingsMetricsInput) SetMaxResults(v int64) *ListFindingsMetricsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFindingsMetricsInput) SetNextToken(v string) *ListFindingsMetricsInput { - s.NextToken = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *ListFindingsMetricsInput) SetStartDate(v time.Time) *ListFindingsMetricsInput { - s.StartDate = &v - return s -} - -type ListFindingsMetricsOutput struct { - _ struct{} `type:"structure"` - - // A list of AccountFindingsMetric objects retrieved from the specified time - // interval. - FindingsMetrics []*AccountFindingsMetric `locationName:"findingsMetrics" type:"list"` - - // A pagination token. You can use this in future calls to ListFindingMetrics - // to continue listing results after the current page. - NextToken *string `locationName:"nextToken" min:"1" 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 ListFindingsMetricsOutput) 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 ListFindingsMetricsOutput) GoString() string { - return s.String() -} - -// SetFindingsMetrics sets the FindingsMetrics field's value. -func (s *ListFindingsMetricsOutput) SetFindingsMetrics(v []*AccountFindingsMetric) *ListFindingsMetricsOutput { - s.FindingsMetrics = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFindingsMetricsOutput) SetNextToken(v string) *ListFindingsMetricsOutput { - s.NextToken = &v - return s -} - -type ListScansInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in the response. Use this parameter - // when paginating results. If additional results exist beyond the number you - // specify, the nextToken element is returned in the response. Use nextToken - // in a subsequent request to retrieve additional results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A token to use for paginating results that are returned in the response. - // Set the value of this parameter to null for the first request. For subsequent - // calls, use the nextToken value returned from the previous request to continue - // listing results after the first page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListScansInput) 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 ListScansInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListScansInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListScansInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListScansInput) SetMaxResults(v int64) *ListScansInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListScansInput) SetNextToken(v string) *ListScansInput { - s.NextToken = &v - return s -} - -type ListScansOutput struct { - _ struct{} `type:"structure"` - - // A pagination token. You can use this in future calls to ListScans to continue - // listing results after the current page. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of ScanSummary objects with information about all scans in an account. - Summaries []*ScanSummary `locationName:"summaries" type:"list"` -} - -// 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 ListScansOutput) 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 ListScansOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListScansOutput) SetNextToken(v string) *ListScansOutput { - s.NextToken = &v - return s -} - -// SetSummaries sets the Summaries field's value. -func (s *ListScansOutput) SetSummaries(v []*ScanSummary) *ListScansOutput { - s.Summaries = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the ScanName object. You can retrieve this ARN by calling ListScans - // or GetScan. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // An array of key-value pairs used to tag an existing scan. A tag is a custom - // attribute label with two parts: - // - // * A tag key. For example, CostCenter, Environment, or Secret. Tag keys - // are case sensitive. - // - // * An optional tag value field. For example, 111122223333, Production, - // or a team name. Omitting the tag value is the same as using an empty string. - // Tag values are case sensitive. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Information about summary metrics in an account. -type MetricsSummary struct { - _ struct{} `type:"structure"` - - // A list of CategoryWithFindingNum objects for the top 5 finding categories - // with the most open findings in an account. - CategoriesWithMostFindings []*CategoryWithFindingNum `locationName:"categoriesWithMostFindings" type:"list"` - - // The date from which the metrics summary information was retrieved. - Date *time.Time `locationName:"date" type:"timestamp"` - - // The number of open findings of each severity in an account. - OpenFindings *FindingMetricsValuePerSeverity `locationName:"openFindings" type:"structure"` - - // A list of ScanNameWithFindingNum objects for the top 3 scans with the most - // number of open findings in an account. - ScansWithMostOpenCriticalFindings []*ScanNameWithFindingNum `locationName:"scansWithMostOpenCriticalFindings" type:"list"` - - // A list of ScanNameWithFindingNum objects for the top 3 scans with the most - // number of open critical findings in an account. - ScansWithMostOpenFindings []*ScanNameWithFindingNum `locationName:"scansWithMostOpenFindings" type:"list"` -} - -// 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 MetricsSummary) 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 MetricsSummary) GoString() string { - return s.String() -} - -// SetCategoriesWithMostFindings sets the CategoriesWithMostFindings field's value. -func (s *MetricsSummary) SetCategoriesWithMostFindings(v []*CategoryWithFindingNum) *MetricsSummary { - s.CategoriesWithMostFindings = v - return s -} - -// SetDate sets the Date field's value. -func (s *MetricsSummary) SetDate(v time.Time) *MetricsSummary { - s.Date = &v - return s -} - -// SetOpenFindings sets the OpenFindings field's value. -func (s *MetricsSummary) SetOpenFindings(v *FindingMetricsValuePerSeverity) *MetricsSummary { - s.OpenFindings = v - return s -} - -// SetScansWithMostOpenCriticalFindings sets the ScansWithMostOpenCriticalFindings field's value. -func (s *MetricsSummary) SetScansWithMostOpenCriticalFindings(v []*ScanNameWithFindingNum) *MetricsSummary { - s.ScansWithMostOpenCriticalFindings = v - return s -} - -// SetScansWithMostOpenFindings sets the ScansWithMostOpenFindings field's value. -func (s *MetricsSummary) SetScansWithMostOpenFindings(v []*ScanNameWithFindingNum) *MetricsSummary { - s.ScansWithMostOpenFindings = v - return s -} - -// Information about the recommended course of action to remediate a finding. -type Recommendation struct { - _ struct{} `type:"structure"` - - // The recommended course of action to remediate the finding. - Text *string `locationName:"text" type:"string"` - - // The URL address to the recommendation for remediating the finding. - Url *string `locationName:"url" 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 Recommendation) 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 Recommendation) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *Recommendation) SetText(v string) *Recommendation { - s.Text = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *Recommendation) SetUrl(v string) *Recommendation { - s.Url = &v - return s -} - -// Information about how to remediate a finding. -type Remediation struct { - _ struct{} `type:"structure"` - - // An object that contains information about the recommended course of action - // to remediate a finding. - Recommendation *Recommendation `locationName:"recommendation" type:"structure"` - - // A list of SuggestedFix objects. Each object contains information about a - // suggested code fix to remediate the finding. - SuggestedFixes []*SuggestedFix `locationName:"suggestedFixes" type:"list"` -} - -// 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 Remediation) 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 Remediation) GoString() string { - return s.String() -} - -// SetRecommendation sets the Recommendation field's value. -func (s *Remediation) SetRecommendation(v *Recommendation) *Remediation { - s.Recommendation = v - return s -} - -// SetSuggestedFixes sets the SuggestedFixes field's value. -func (s *Remediation) SetSuggestedFixes(v []*SuggestedFix) *Remediation { - s.SuggestedFixes = v - return s -} - -// Information about a resource, such as an Amazon S3 bucket or AWS Lambda function, -// that contains a finding. -type Resource struct { - _ struct{} `type:"structure"` - - // The identifier for the resource. - Id *string `locationName:"id" type:"string"` - - // The identifier for a section of the resource, such as an AWS Lambda layer. - SubResourceId *string `locationName:"subResourceId" 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 Resource) 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 Resource) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *Resource) SetId(v string) *Resource { - s.Id = &v - return s -} - -// SetSubResourceId sets the SubResourceId field's value. -func (s *Resource) SetSubResourceId(v string) *Resource { - s.SubResourceId = &v - return s -} - -// The identifier for a resource object that contains resources where a finding -// was detected. -type ResourceId struct { - _ struct{} `type:"structure"` - - // The identifier for the code file uploaded to the resource where a finding - // was detected. - CodeArtifactId *string `locationName:"codeArtifactId" 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 ResourceId) 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 ResourceId) GoString() string { - return s.String() -} - -// SetCodeArtifactId sets the CodeArtifactId field's value. -func (s *ResourceId) SetCodeArtifactId(v string) *ResourceId { - s.CodeArtifactId = &v - return s -} - -// The resource specified in the request was not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The identifier for the error. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // The identifier for the resource that was not found. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of resource that was not found. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about a scan with open findings. -type ScanNameWithFindingNum struct { - _ struct{} `type:"structure"` - - // The number of open findings generated by a scan. - FindingNumber *int64 `locationName:"findingNumber" type:"integer"` - - // The name of the scan. - ScanName *string `locationName:"scanName" 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 ScanNameWithFindingNum) 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 ScanNameWithFindingNum) GoString() string { - return s.String() -} - -// SetFindingNumber sets the FindingNumber field's value. -func (s *ScanNameWithFindingNum) SetFindingNumber(v int64) *ScanNameWithFindingNum { - s.FindingNumber = &v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *ScanNameWithFindingNum) SetScanName(v string) *ScanNameWithFindingNum { - s.ScanName = &v - return s -} - -// Information about a scan. -type ScanSummary struct { - _ struct{} `type:"structure"` - - // The time when the scan was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The identifier for the scan run. - // - // RunId is a required field - RunId *string `locationName:"runId" type:"string" required:"true"` - - // The name of the scan. - // - // ScanName is a required field - ScanName *string `locationName:"scanName" min:"1" type:"string" required:"true"` - - // The ARN for the scan name. - ScanNameArn *string `locationName:"scanNameArn" min:"1" type:"string"` - - // The state of the scan. A scan can be In Progress, Complete, or Failed. - // - // ScanState is a required field - ScanState *string `locationName:"scanState" type:"string" required:"true" enum:"ScanState"` - - // The time the scan was last updated. A scan is updated when it is re-run. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 ScanSummary) 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 ScanSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ScanSummary) SetCreatedAt(v time.Time) *ScanSummary { - s.CreatedAt = &v - return s -} - -// SetRunId sets the RunId field's value. -func (s *ScanSummary) SetRunId(v string) *ScanSummary { - s.RunId = &v - return s -} - -// SetScanName sets the ScanName field's value. -func (s *ScanSummary) SetScanName(v string) *ScanSummary { - s.ScanName = &v - return s -} - -// SetScanNameArn sets the ScanNameArn field's value. -func (s *ScanSummary) SetScanNameArn(v string) *ScanSummary { - s.ScanNameArn = &v - return s -} - -// SetScanState sets the ScanState field's value. -func (s *ScanSummary) SetScanState(v string) *ScanSummary { - s.ScanState = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ScanSummary) SetUpdatedAt(v time.Time) *ScanSummary { - s.UpdatedAt = &v - return s -} - -// Information about the suggested code fix to remediate a finding. -type SuggestedFix struct { - _ struct{} `type:"structure"` - - // The suggested code to add to your file. - Code *string `locationName:"code" type:"string"` - - // A description of the suggested code fix and why it is being suggested. - Description *string `locationName:"description" 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 SuggestedFix) 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 SuggestedFix) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *SuggestedFix) SetCode(v string) *SuggestedFix { - s.Code = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *SuggestedFix) SetDescription(v string) *SuggestedFix { - s.Description = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the ScanName object. You can retrieve this ARN by calling ListScans - // or GetScan. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // An array of key-value pairs used to tag an existing scan. A tag is a custom - // attribute label with two parts: - // - // * A tag key. For example, CostCenter, Environment, or Secret. Tag keys - // are case sensitive. - // - // * An optional tag value field. For example, 111122223333, Production, - // or a team name. Omitting the tag value is the same as using an empty string. - // Tag values are case sensitive. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The identifier for the error. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // The identifier for the originating quota. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The identifier for the originating service. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the ScanName object. You can retrieve this ARN by calling ListScans - // or GetScan. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // A list of keys for each tag you want to remove from a scan. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateAccountConfigurationInput struct { - _ struct{} `type:"structure"` - - // The KMS key ARN you want to use for encryption. Defaults to service-side - // encryption if missing. - // - // EncryptionConfig is a required field - EncryptionConfig *EncryptionConfig `locationName:"encryptionConfig" type:"structure" 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 UpdateAccountConfigurationInput) 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 UpdateAccountConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAccountConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAccountConfigurationInput"} - if s.EncryptionConfig == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionConfig")) - } - if s.EncryptionConfig != nil { - if err := s.EncryptionConfig.Validate(); err != nil { - invalidParams.AddNested("EncryptionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionConfig sets the EncryptionConfig field's value. -func (s *UpdateAccountConfigurationInput) SetEncryptionConfig(v *EncryptionConfig) *UpdateAccountConfigurationInput { - s.EncryptionConfig = v - return s -} - -type UpdateAccountConfigurationOutput struct { - _ struct{} `type:"structure"` - - // An EncryptionConfig object that contains the KMS key ARN to use for encryption. - // - // EncryptionConfig is a required field - EncryptionConfig *EncryptionConfig `locationName:"encryptionConfig" type:"structure" 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 UpdateAccountConfigurationOutput) 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 UpdateAccountConfigurationOutput) GoString() string { - return s.String() -} - -// SetEncryptionConfig sets the EncryptionConfig field's value. -func (s *UpdateAccountConfigurationOutput) SetEncryptionConfig(v *EncryptionConfig) *UpdateAccountConfigurationOutput { - s.EncryptionConfig = v - return s -} - -// The input fails to satisfy the specified constraints. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The identifier for the error. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true"` - - // The field that caused the error, if applicable. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // The reason the request failed validation. - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about a validation exception. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // Describes the exception. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the exception. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -// Information about a security vulnerability that Amazon CodeGuru Security -// detected. -type Vulnerability struct { - _ struct{} `type:"structure"` - - // An object that describes the location of the detected security vulnerability - // in your code. - FilePath *FilePath `locationName:"filePath" type:"structure"` - - // The identifier for the vulnerability. - Id *string `locationName:"id" type:"string"` - - // The number of times the vulnerability appears in your code. - ItemCount *int64 `locationName:"itemCount" type:"integer"` - - // One or more URL addresses that contain details about a vulnerability. - ReferenceUrls []*string `locationName:"referenceUrls" type:"list"` - - // One or more vulnerabilities that are related to the vulnerability being described. - RelatedVulnerabilities []*string `locationName:"relatedVulnerabilities" type:"list"` -} - -// 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 Vulnerability) 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 Vulnerability) GoString() string { - return s.String() -} - -// SetFilePath sets the FilePath field's value. -func (s *Vulnerability) SetFilePath(v *FilePath) *Vulnerability { - s.FilePath = v - return s -} - -// SetId sets the Id field's value. -func (s *Vulnerability) SetId(v string) *Vulnerability { - s.Id = &v - return s -} - -// SetItemCount sets the ItemCount field's value. -func (s *Vulnerability) SetItemCount(v int64) *Vulnerability { - s.ItemCount = &v - return s -} - -// SetReferenceUrls sets the ReferenceUrls field's value. -func (s *Vulnerability) SetReferenceUrls(v []*string) *Vulnerability { - s.ReferenceUrls = v - return s -} - -// SetRelatedVulnerabilities sets the RelatedVulnerabilities field's value. -func (s *Vulnerability) SetRelatedVulnerabilities(v []*string) *Vulnerability { - s.RelatedVulnerabilities = v - return s -} - -const ( - // AnalysisTypeSecurity is a AnalysisType enum value - AnalysisTypeSecurity = "Security" - - // AnalysisTypeAll is a AnalysisType enum value - AnalysisTypeAll = "All" -) - -// AnalysisType_Values returns all elements of the AnalysisType enum -func AnalysisType_Values() []string { - return []string{ - AnalysisTypeSecurity, - AnalysisTypeAll, - } -} - -const ( - // ErrorCodeDuplicateIdentifier is a ErrorCode enum value - ErrorCodeDuplicateIdentifier = "DUPLICATE_IDENTIFIER" - - // ErrorCodeItemDoesNotExist is a ErrorCode enum value - ErrorCodeItemDoesNotExist = "ITEM_DOES_NOT_EXIST" - - // ErrorCodeInternalError is a ErrorCode enum value - ErrorCodeInternalError = "INTERNAL_ERROR" - - // ErrorCodeInvalidFindingId is a ErrorCode enum value - ErrorCodeInvalidFindingId = "INVALID_FINDING_ID" - - // ErrorCodeInvalidScanName is a ErrorCode enum value - ErrorCodeInvalidScanName = "INVALID_SCAN_NAME" -) - -// ErrorCode_Values returns all elements of the ErrorCode enum -func ErrorCode_Values() []string { - return []string{ - ErrorCodeDuplicateIdentifier, - ErrorCodeItemDoesNotExist, - ErrorCodeInternalError, - ErrorCodeInvalidFindingId, - ErrorCodeInvalidScanName, - } -} - -const ( - // ScanStateInProgress is a ScanState enum value - ScanStateInProgress = "InProgress" - - // ScanStateSuccessful is a ScanState enum value - ScanStateSuccessful = "Successful" - - // ScanStateFailed is a ScanState enum value - ScanStateFailed = "Failed" -) - -// ScanState_Values returns all elements of the ScanState enum -func ScanState_Values() []string { - return []string{ - ScanStateInProgress, - ScanStateSuccessful, - ScanStateFailed, - } -} - -const ( - // ScanTypeStandard is a ScanType enum value - ScanTypeStandard = "Standard" - - // ScanTypeExpress is a ScanType enum value - ScanTypeExpress = "Express" -) - -// ScanType_Values returns all elements of the ScanType enum -func ScanType_Values() []string { - return []string{ - ScanTypeStandard, - ScanTypeExpress, - } -} - -const ( - // SeverityCritical is a Severity enum value - SeverityCritical = "Critical" - - // SeverityHigh is a Severity enum value - SeverityHigh = "High" - - // SeverityMedium is a Severity enum value - SeverityMedium = "Medium" - - // SeverityLow is a Severity enum value - SeverityLow = "Low" - - // SeverityInfo is a Severity enum value - SeverityInfo = "Info" -) - -// Severity_Values returns all elements of the Severity enum -func Severity_Values() []string { - return []string{ - SeverityCritical, - SeverityHigh, - SeverityMedium, - SeverityLow, - SeverityInfo, - } -} - -const ( - // StatusClosed is a Status enum value - StatusClosed = "Closed" - - // StatusOpen is a Status enum value - StatusOpen = "Open" - - // StatusAll is a Status enum value - StatusAll = "All" -) - -// Status_Values returns all elements of the Status enum -func Status_Values() []string { - return []string{ - StatusClosed, - StatusOpen, - StatusAll, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" - - // ValidationExceptionReasonLambdaCodeShaMisMatch is a ValidationExceptionReason enum value - ValidationExceptionReasonLambdaCodeShaMisMatch = "lambdaCodeShaMisMatch" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - ValidationExceptionReasonLambdaCodeShaMisMatch, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/codegurusecurityiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/codegurusecurityiface/interface.go deleted file mode 100644 index 6d82f5d98782..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/codegurusecurityiface/interface.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package codegurusecurityiface provides an interface to enable mocking the Amazon CodeGuru Security service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package codegurusecurityiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity" -) - -// CodeGuruSecurityAPI provides an interface to enable mocking the -// codegurusecurity.CodeGuruSecurity service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon CodeGuru Security. -// func myFunc(svc codegurusecurityiface.CodeGuruSecurityAPI) bool { -// // Make svc.BatchGetFindings request -// } -// -// func main() { -// sess := session.New() -// svc := codegurusecurity.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockCodeGuruSecurityClient struct { -// codegurusecurityiface.CodeGuruSecurityAPI -// } -// func (m *mockCodeGuruSecurityClient) BatchGetFindings(input *codegurusecurity.BatchGetFindingsInput) (*codegurusecurity.BatchGetFindingsOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockCodeGuruSecurityClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type CodeGuruSecurityAPI interface { - BatchGetFindings(*codegurusecurity.BatchGetFindingsInput) (*codegurusecurity.BatchGetFindingsOutput, error) - BatchGetFindingsWithContext(aws.Context, *codegurusecurity.BatchGetFindingsInput, ...request.Option) (*codegurusecurity.BatchGetFindingsOutput, error) - BatchGetFindingsRequest(*codegurusecurity.BatchGetFindingsInput) (*request.Request, *codegurusecurity.BatchGetFindingsOutput) - - CreateScan(*codegurusecurity.CreateScanInput) (*codegurusecurity.CreateScanOutput, error) - CreateScanWithContext(aws.Context, *codegurusecurity.CreateScanInput, ...request.Option) (*codegurusecurity.CreateScanOutput, error) - CreateScanRequest(*codegurusecurity.CreateScanInput) (*request.Request, *codegurusecurity.CreateScanOutput) - - CreateUploadUrl(*codegurusecurity.CreateUploadUrlInput) (*codegurusecurity.CreateUploadUrlOutput, error) - CreateUploadUrlWithContext(aws.Context, *codegurusecurity.CreateUploadUrlInput, ...request.Option) (*codegurusecurity.CreateUploadUrlOutput, error) - CreateUploadUrlRequest(*codegurusecurity.CreateUploadUrlInput) (*request.Request, *codegurusecurity.CreateUploadUrlOutput) - - GetAccountConfiguration(*codegurusecurity.GetAccountConfigurationInput) (*codegurusecurity.GetAccountConfigurationOutput, error) - GetAccountConfigurationWithContext(aws.Context, *codegurusecurity.GetAccountConfigurationInput, ...request.Option) (*codegurusecurity.GetAccountConfigurationOutput, error) - GetAccountConfigurationRequest(*codegurusecurity.GetAccountConfigurationInput) (*request.Request, *codegurusecurity.GetAccountConfigurationOutput) - - GetFindings(*codegurusecurity.GetFindingsInput) (*codegurusecurity.GetFindingsOutput, error) - GetFindingsWithContext(aws.Context, *codegurusecurity.GetFindingsInput, ...request.Option) (*codegurusecurity.GetFindingsOutput, error) - GetFindingsRequest(*codegurusecurity.GetFindingsInput) (*request.Request, *codegurusecurity.GetFindingsOutput) - - GetFindingsPages(*codegurusecurity.GetFindingsInput, func(*codegurusecurity.GetFindingsOutput, bool) bool) error - GetFindingsPagesWithContext(aws.Context, *codegurusecurity.GetFindingsInput, func(*codegurusecurity.GetFindingsOutput, bool) bool, ...request.Option) error - - GetMetricsSummary(*codegurusecurity.GetMetricsSummaryInput) (*codegurusecurity.GetMetricsSummaryOutput, error) - GetMetricsSummaryWithContext(aws.Context, *codegurusecurity.GetMetricsSummaryInput, ...request.Option) (*codegurusecurity.GetMetricsSummaryOutput, error) - GetMetricsSummaryRequest(*codegurusecurity.GetMetricsSummaryInput) (*request.Request, *codegurusecurity.GetMetricsSummaryOutput) - - GetScan(*codegurusecurity.GetScanInput) (*codegurusecurity.GetScanOutput, error) - GetScanWithContext(aws.Context, *codegurusecurity.GetScanInput, ...request.Option) (*codegurusecurity.GetScanOutput, error) - GetScanRequest(*codegurusecurity.GetScanInput) (*request.Request, *codegurusecurity.GetScanOutput) - - ListFindingsMetrics(*codegurusecurity.ListFindingsMetricsInput) (*codegurusecurity.ListFindingsMetricsOutput, error) - ListFindingsMetricsWithContext(aws.Context, *codegurusecurity.ListFindingsMetricsInput, ...request.Option) (*codegurusecurity.ListFindingsMetricsOutput, error) - ListFindingsMetricsRequest(*codegurusecurity.ListFindingsMetricsInput) (*request.Request, *codegurusecurity.ListFindingsMetricsOutput) - - ListFindingsMetricsPages(*codegurusecurity.ListFindingsMetricsInput, func(*codegurusecurity.ListFindingsMetricsOutput, bool) bool) error - ListFindingsMetricsPagesWithContext(aws.Context, *codegurusecurity.ListFindingsMetricsInput, func(*codegurusecurity.ListFindingsMetricsOutput, bool) bool, ...request.Option) error - - ListScans(*codegurusecurity.ListScansInput) (*codegurusecurity.ListScansOutput, error) - ListScansWithContext(aws.Context, *codegurusecurity.ListScansInput, ...request.Option) (*codegurusecurity.ListScansOutput, error) - ListScansRequest(*codegurusecurity.ListScansInput) (*request.Request, *codegurusecurity.ListScansOutput) - - ListScansPages(*codegurusecurity.ListScansInput, func(*codegurusecurity.ListScansOutput, bool) bool) error - ListScansPagesWithContext(aws.Context, *codegurusecurity.ListScansInput, func(*codegurusecurity.ListScansOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*codegurusecurity.ListTagsForResourceInput) (*codegurusecurity.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *codegurusecurity.ListTagsForResourceInput, ...request.Option) (*codegurusecurity.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*codegurusecurity.ListTagsForResourceInput) (*request.Request, *codegurusecurity.ListTagsForResourceOutput) - - TagResource(*codegurusecurity.TagResourceInput) (*codegurusecurity.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *codegurusecurity.TagResourceInput, ...request.Option) (*codegurusecurity.TagResourceOutput, error) - TagResourceRequest(*codegurusecurity.TagResourceInput) (*request.Request, *codegurusecurity.TagResourceOutput) - - UntagResource(*codegurusecurity.UntagResourceInput) (*codegurusecurity.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *codegurusecurity.UntagResourceInput, ...request.Option) (*codegurusecurity.UntagResourceOutput, error) - UntagResourceRequest(*codegurusecurity.UntagResourceInput) (*request.Request, *codegurusecurity.UntagResourceOutput) - - UpdateAccountConfiguration(*codegurusecurity.UpdateAccountConfigurationInput) (*codegurusecurity.UpdateAccountConfigurationOutput, error) - UpdateAccountConfigurationWithContext(aws.Context, *codegurusecurity.UpdateAccountConfigurationInput, ...request.Option) (*codegurusecurity.UpdateAccountConfigurationOutput, error) - UpdateAccountConfigurationRequest(*codegurusecurity.UpdateAccountConfigurationInput) (*request.Request, *codegurusecurity.UpdateAccountConfigurationOutput) -} - -var _ CodeGuruSecurityAPI = (*codegurusecurity.CodeGuruSecurity)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/doc.go deleted file mode 100644 index 7d6114512ffc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/doc.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package codegurusecurity provides the client and types for making API -// requests to Amazon CodeGuru Security. -// -// Amazon CodeGuru Security is in preview release and is subject to change. -// -// This section provides documentation for the Amazon CodeGuru Security API -// operations. CodeGuru Security is a service that uses program analysis and -// machine learning to detect security policy violations and vulnerabilities, -// and recommends ways to address these security risks. -// -// By proactively detecting and providing recommendations for addressing security -// risks, CodeGuru Security improves the overall security of your application -// code. For more information about CodeGuru Security, see the Amazon CodeGuru -// Security User Guide (https://docs.aws.amazon.com/codeguru/latest/security-ug/what-is-codeguru-security.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/codeguru-security-2018-05-10 for more information on this service. -// -// See codegurusecurity package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/codegurusecurity/ -// -// # Using the Client -// -// To contact Amazon CodeGuru Security with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon CodeGuru Security client CodeGuruSecurity for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/codegurusecurity/#New -package codegurusecurity diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/errors.go deleted file mode 100644 index bb50b56f5091..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/errors.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package codegurusecurity - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The requested operation would cause a conflict with the current state of - // a service resource associated with the request. Resolve the conflict before - // retrying this request. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The server encountered an internal error and is unable to complete the request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource specified in the request was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the specified constraints. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/service.go deleted file mode 100644 index 16bf21de62fa..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/codegurusecurity/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package codegurusecurity - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// CodeGuruSecurity provides the API operation methods for making requests to -// Amazon CodeGuru Security. See this package's package overview docs -// for details on the service. -// -// CodeGuruSecurity methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type CodeGuruSecurity struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "CodeGuru Security" // Name of service. - EndpointsID = "codeguru-security" // ID to lookup a service endpoint with. - ServiceID = "CodeGuru Security" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the CodeGuruSecurity client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a CodeGuruSecurity client from just a session. -// svc := codegurusecurity.New(mySession) -// -// // Create a CodeGuruSecurity client with additional configuration -// svc := codegurusecurity.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeGuruSecurity { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "codeguru-security" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *CodeGuruSecurity { - svc := &CodeGuruSecurity{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a CodeGuruSecurity operation and runs any -// custom request initialization. -func (c *CodeGuruSecurity) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/api.go deleted file mode 100644 index bbf8716ea7ef..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/api.go +++ /dev/null @@ -1,5938 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package connectcampaigns - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateCampaign = "CreateCampaign" - -// CreateCampaignRequest generates a "aws/request.Request" representing the -// client's request for the CreateCampaign 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 CreateCampaign for more information on using the CreateCampaign -// 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 CreateCampaignRequest method. -// req, resp := client.CreateCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/CreateCampaign -func (c *ConnectCampaigns) CreateCampaignRequest(input *CreateCampaignInput) (req *request.Request, output *CreateCampaignOutput) { - op := &request.Operation{ - Name: opCreateCampaign, - HTTPMethod: "PUT", - HTTPPath: "/campaigns", - } - - if input == nil { - input = &CreateCampaignInput{} - } - - output = &CreateCampaignOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCampaign API operation for AmazonConnectCampaignService. -// -// Creates a campaign for the specified Amazon Connect account. This API is -// idempotent. -// -// 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 AmazonConnectCampaignService's -// API operation CreateCampaign for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ServiceQuotaExceededException -// Request would cause a service quota to be exceeded. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/CreateCampaign -func (c *ConnectCampaigns) CreateCampaign(input *CreateCampaignInput) (*CreateCampaignOutput, error) { - req, out := c.CreateCampaignRequest(input) - return out, req.Send() -} - -// CreateCampaignWithContext is the same as CreateCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCampaign 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 *ConnectCampaigns) CreateCampaignWithContext(ctx aws.Context, input *CreateCampaignInput, opts ...request.Option) (*CreateCampaignOutput, error) { - req, out := c.CreateCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCampaign = "DeleteCampaign" - -// DeleteCampaignRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCampaign 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 DeleteCampaign for more information on using the DeleteCampaign -// 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 DeleteCampaignRequest method. -// req, resp := client.DeleteCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/DeleteCampaign -func (c *ConnectCampaigns) DeleteCampaignRequest(input *DeleteCampaignInput) (req *request.Request, output *DeleteCampaignOutput) { - op := &request.Operation{ - Name: opDeleteCampaign, - HTTPMethod: "DELETE", - HTTPPath: "/campaigns/{id}", - } - - if input == nil { - input = &DeleteCampaignInput{} - } - - output = &DeleteCampaignOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCampaign API operation for AmazonConnectCampaignService. -// -// Deletes a campaign from the specified Amazon Connect account. -// -// 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 AmazonConnectCampaignService's -// API operation DeleteCampaign for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/DeleteCampaign -func (c *ConnectCampaigns) DeleteCampaign(input *DeleteCampaignInput) (*DeleteCampaignOutput, error) { - req, out := c.DeleteCampaignRequest(input) - return out, req.Send() -} - -// DeleteCampaignWithContext is the same as DeleteCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCampaign 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 *ConnectCampaigns) DeleteCampaignWithContext(ctx aws.Context, input *DeleteCampaignInput, opts ...request.Option) (*DeleteCampaignOutput, error) { - req, out := c.DeleteCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteConnectInstanceConfig = "DeleteConnectInstanceConfig" - -// DeleteConnectInstanceConfigRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConnectInstanceConfig 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 DeleteConnectInstanceConfig for more information on using the DeleteConnectInstanceConfig -// 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 DeleteConnectInstanceConfigRequest method. -// req, resp := client.DeleteConnectInstanceConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/DeleteConnectInstanceConfig -func (c *ConnectCampaigns) DeleteConnectInstanceConfigRequest(input *DeleteConnectInstanceConfigInput) (req *request.Request, output *DeleteConnectInstanceConfigOutput) { - op := &request.Operation{ - Name: opDeleteConnectInstanceConfig, - HTTPMethod: "DELETE", - HTTPPath: "/connect-instance/{connectInstanceId}/config", - } - - if input == nil { - input = &DeleteConnectInstanceConfigInput{} - } - - output = &DeleteConnectInstanceConfigOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConnectInstanceConfig API operation for AmazonConnectCampaignService. -// -// Deletes a connect instance config from the specified AWS account. -// -// 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 AmazonConnectCampaignService's -// API operation DeleteConnectInstanceConfig for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InvalidStateException -// The request could not be processed because of conflict in the current state. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/DeleteConnectInstanceConfig -func (c *ConnectCampaigns) DeleteConnectInstanceConfig(input *DeleteConnectInstanceConfigInput) (*DeleteConnectInstanceConfigOutput, error) { - req, out := c.DeleteConnectInstanceConfigRequest(input) - return out, req.Send() -} - -// DeleteConnectInstanceConfigWithContext is the same as DeleteConnectInstanceConfig with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteConnectInstanceConfig 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 *ConnectCampaigns) DeleteConnectInstanceConfigWithContext(ctx aws.Context, input *DeleteConnectInstanceConfigInput, opts ...request.Option) (*DeleteConnectInstanceConfigOutput, error) { - req, out := c.DeleteConnectInstanceConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteInstanceOnboardingJob = "DeleteInstanceOnboardingJob" - -// DeleteInstanceOnboardingJobRequest generates a "aws/request.Request" representing the -// client's request for the DeleteInstanceOnboardingJob 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 DeleteInstanceOnboardingJob for more information on using the DeleteInstanceOnboardingJob -// 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 DeleteInstanceOnboardingJobRequest method. -// req, resp := client.DeleteInstanceOnboardingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/DeleteInstanceOnboardingJob -func (c *ConnectCampaigns) DeleteInstanceOnboardingJobRequest(input *DeleteInstanceOnboardingJobInput) (req *request.Request, output *DeleteInstanceOnboardingJobOutput) { - op := &request.Operation{ - Name: opDeleteInstanceOnboardingJob, - HTTPMethod: "DELETE", - HTTPPath: "/connect-instance/{connectInstanceId}/onboarding", - } - - if input == nil { - input = &DeleteInstanceOnboardingJobInput{} - } - - output = &DeleteInstanceOnboardingJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteInstanceOnboardingJob API operation for AmazonConnectCampaignService. -// -// Delete the Connect Campaigns onboarding job for the specified Amazon Connect -// instance. -// -// 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 AmazonConnectCampaignService's -// API operation DeleteInstanceOnboardingJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InvalidStateException -// The request could not be processed because of conflict in the current state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/DeleteInstanceOnboardingJob -func (c *ConnectCampaigns) DeleteInstanceOnboardingJob(input *DeleteInstanceOnboardingJobInput) (*DeleteInstanceOnboardingJobOutput, error) { - req, out := c.DeleteInstanceOnboardingJobRequest(input) - return out, req.Send() -} - -// DeleteInstanceOnboardingJobWithContext is the same as DeleteInstanceOnboardingJob with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteInstanceOnboardingJob 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 *ConnectCampaigns) DeleteInstanceOnboardingJobWithContext(ctx aws.Context, input *DeleteInstanceOnboardingJobInput, opts ...request.Option) (*DeleteInstanceOnboardingJobOutput, error) { - req, out := c.DeleteInstanceOnboardingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeCampaign = "DescribeCampaign" - -// DescribeCampaignRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCampaign 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 DescribeCampaign for more information on using the DescribeCampaign -// 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 DescribeCampaignRequest method. -// req, resp := client.DescribeCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/DescribeCampaign -func (c *ConnectCampaigns) DescribeCampaignRequest(input *DescribeCampaignInput) (req *request.Request, output *DescribeCampaignOutput) { - op := &request.Operation{ - Name: opDescribeCampaign, - HTTPMethod: "GET", - HTTPPath: "/campaigns/{id}", - } - - if input == nil { - input = &DescribeCampaignInput{} - } - - output = &DescribeCampaignOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCampaign API operation for AmazonConnectCampaignService. -// -// Describes the specific campaign. -// -// 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 AmazonConnectCampaignService's -// API operation DescribeCampaign for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/DescribeCampaign -func (c *ConnectCampaigns) DescribeCampaign(input *DescribeCampaignInput) (*DescribeCampaignOutput, error) { - req, out := c.DescribeCampaignRequest(input) - return out, req.Send() -} - -// DescribeCampaignWithContext is the same as DescribeCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeCampaign 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 *ConnectCampaigns) DescribeCampaignWithContext(ctx aws.Context, input *DescribeCampaignInput, opts ...request.Option) (*DescribeCampaignOutput, error) { - req, out := c.DescribeCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCampaignState = "GetCampaignState" - -// GetCampaignStateRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaignState 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 GetCampaignState for more information on using the GetCampaignState -// 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 GetCampaignStateRequest method. -// req, resp := client.GetCampaignStateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/GetCampaignState -func (c *ConnectCampaigns) GetCampaignStateRequest(input *GetCampaignStateInput) (req *request.Request, output *GetCampaignStateOutput) { - op := &request.Operation{ - Name: opGetCampaignState, - HTTPMethod: "GET", - HTTPPath: "/campaigns/{id}/state", - } - - if input == nil { - input = &GetCampaignStateInput{} - } - - output = &GetCampaignStateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCampaignState API operation for AmazonConnectCampaignService. -// -// Get state of a campaign for the specified Amazon Connect account. -// -// 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 AmazonConnectCampaignService's -// API operation GetCampaignState for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/GetCampaignState -func (c *ConnectCampaigns) GetCampaignState(input *GetCampaignStateInput) (*GetCampaignStateOutput, error) { - req, out := c.GetCampaignStateRequest(input) - return out, req.Send() -} - -// GetCampaignStateWithContext is the same as GetCampaignState with the addition of -// the ability to pass a context and additional request options. -// -// See GetCampaignState 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 *ConnectCampaigns) GetCampaignStateWithContext(ctx aws.Context, input *GetCampaignStateInput, opts ...request.Option) (*GetCampaignStateOutput, error) { - req, out := c.GetCampaignStateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCampaignStateBatch = "GetCampaignStateBatch" - -// GetCampaignStateBatchRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaignStateBatch 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 GetCampaignStateBatch for more information on using the GetCampaignStateBatch -// 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 GetCampaignStateBatchRequest method. -// req, resp := client.GetCampaignStateBatchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/GetCampaignStateBatch -func (c *ConnectCampaigns) GetCampaignStateBatchRequest(input *GetCampaignStateBatchInput) (req *request.Request, output *GetCampaignStateBatchOutput) { - op := &request.Operation{ - Name: opGetCampaignStateBatch, - HTTPMethod: "POST", - HTTPPath: "/campaigns-state", - } - - if input == nil { - input = &GetCampaignStateBatchInput{} - } - - output = &GetCampaignStateBatchOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCampaignStateBatch API operation for AmazonConnectCampaignService. -// -// Get state of campaigns for the specified Amazon Connect account. -// -// 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 AmazonConnectCampaignService's -// API operation GetCampaignStateBatch for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/GetCampaignStateBatch -func (c *ConnectCampaigns) GetCampaignStateBatch(input *GetCampaignStateBatchInput) (*GetCampaignStateBatchOutput, error) { - req, out := c.GetCampaignStateBatchRequest(input) - return out, req.Send() -} - -// GetCampaignStateBatchWithContext is the same as GetCampaignStateBatch with the addition of -// the ability to pass a context and additional request options. -// -// See GetCampaignStateBatch 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 *ConnectCampaigns) GetCampaignStateBatchWithContext(ctx aws.Context, input *GetCampaignStateBatchInput, opts ...request.Option) (*GetCampaignStateBatchOutput, error) { - req, out := c.GetCampaignStateBatchRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConnectInstanceConfig = "GetConnectInstanceConfig" - -// GetConnectInstanceConfigRequest generates a "aws/request.Request" representing the -// client's request for the GetConnectInstanceConfig 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 GetConnectInstanceConfig for more information on using the GetConnectInstanceConfig -// 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 GetConnectInstanceConfigRequest method. -// req, resp := client.GetConnectInstanceConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/GetConnectInstanceConfig -func (c *ConnectCampaigns) GetConnectInstanceConfigRequest(input *GetConnectInstanceConfigInput) (req *request.Request, output *GetConnectInstanceConfigOutput) { - op := &request.Operation{ - Name: opGetConnectInstanceConfig, - HTTPMethod: "GET", - HTTPPath: "/connect-instance/{connectInstanceId}/config", - } - - if input == nil { - input = &GetConnectInstanceConfigInput{} - } - - output = &GetConnectInstanceConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConnectInstanceConfig API operation for AmazonConnectCampaignService. -// -// Get the specific Connect instance config. -// -// 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 AmazonConnectCampaignService's -// API operation GetConnectInstanceConfig for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/GetConnectInstanceConfig -func (c *ConnectCampaigns) GetConnectInstanceConfig(input *GetConnectInstanceConfigInput) (*GetConnectInstanceConfigOutput, error) { - req, out := c.GetConnectInstanceConfigRequest(input) - return out, req.Send() -} - -// GetConnectInstanceConfigWithContext is the same as GetConnectInstanceConfig with the addition of -// the ability to pass a context and additional request options. -// -// See GetConnectInstanceConfig 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 *ConnectCampaigns) GetConnectInstanceConfigWithContext(ctx aws.Context, input *GetConnectInstanceConfigInput, opts ...request.Option) (*GetConnectInstanceConfigOutput, error) { - req, out := c.GetConnectInstanceConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetInstanceOnboardingJobStatus = "GetInstanceOnboardingJobStatus" - -// GetInstanceOnboardingJobStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetInstanceOnboardingJobStatus 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 GetInstanceOnboardingJobStatus for more information on using the GetInstanceOnboardingJobStatus -// 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 GetInstanceOnboardingJobStatusRequest method. -// req, resp := client.GetInstanceOnboardingJobStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/GetInstanceOnboardingJobStatus -func (c *ConnectCampaigns) GetInstanceOnboardingJobStatusRequest(input *GetInstanceOnboardingJobStatusInput) (req *request.Request, output *GetInstanceOnboardingJobStatusOutput) { - op := &request.Operation{ - Name: opGetInstanceOnboardingJobStatus, - HTTPMethod: "GET", - HTTPPath: "/connect-instance/{connectInstanceId}/onboarding", - } - - if input == nil { - input = &GetInstanceOnboardingJobStatusInput{} - } - - output = &GetInstanceOnboardingJobStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInstanceOnboardingJobStatus API operation for AmazonConnectCampaignService. -// -// Get the specific instance onboarding job status. -// -// 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 AmazonConnectCampaignService's -// API operation GetInstanceOnboardingJobStatus for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/GetInstanceOnboardingJobStatus -func (c *ConnectCampaigns) GetInstanceOnboardingJobStatus(input *GetInstanceOnboardingJobStatusInput) (*GetInstanceOnboardingJobStatusOutput, error) { - req, out := c.GetInstanceOnboardingJobStatusRequest(input) - return out, req.Send() -} - -// GetInstanceOnboardingJobStatusWithContext is the same as GetInstanceOnboardingJobStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetInstanceOnboardingJobStatus 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 *ConnectCampaigns) GetInstanceOnboardingJobStatusWithContext(ctx aws.Context, input *GetInstanceOnboardingJobStatusInput, opts ...request.Option) (*GetInstanceOnboardingJobStatusOutput, error) { - req, out := c.GetInstanceOnboardingJobStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCampaigns = "ListCampaigns" - -// ListCampaignsRequest generates a "aws/request.Request" representing the -// client's request for the ListCampaigns 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 ListCampaigns for more information on using the ListCampaigns -// 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 ListCampaignsRequest method. -// req, resp := client.ListCampaignsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/ListCampaigns -func (c *ConnectCampaigns) ListCampaignsRequest(input *ListCampaignsInput) (req *request.Request, output *ListCampaignsOutput) { - op := &request.Operation{ - Name: opListCampaigns, - HTTPMethod: "POST", - HTTPPath: "/campaigns-summary", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCampaignsInput{} - } - - output = &ListCampaignsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCampaigns API operation for AmazonConnectCampaignService. -// -// Provides summary information about the campaigns under the specified Amazon -// Connect account. -// -// 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 AmazonConnectCampaignService's -// API operation ListCampaigns for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/ListCampaigns -func (c *ConnectCampaigns) ListCampaigns(input *ListCampaignsInput) (*ListCampaignsOutput, error) { - req, out := c.ListCampaignsRequest(input) - return out, req.Send() -} - -// ListCampaignsWithContext is the same as ListCampaigns with the addition of -// the ability to pass a context and additional request options. -// -// See ListCampaigns 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 *ConnectCampaigns) ListCampaignsWithContext(ctx aws.Context, input *ListCampaignsInput, opts ...request.Option) (*ListCampaignsOutput, error) { - req, out := c.ListCampaignsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCampaignsPages iterates over the pages of a ListCampaigns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCampaigns method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCampaigns operation. -// pageNum := 0 -// err := client.ListCampaignsPages(params, -// func(page *connectcampaigns.ListCampaignsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCampaigns) ListCampaignsPages(input *ListCampaignsInput, fn func(*ListCampaignsOutput, bool) bool) error { - return c.ListCampaignsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCampaignsPagesWithContext same as ListCampaignsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCampaigns) ListCampaignsPagesWithContext(ctx aws.Context, input *ListCampaignsInput, fn func(*ListCampaignsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCampaignsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCampaignsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCampaignsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/ListTagsForResource -func (c *ConnectCampaigns) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{arn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AmazonConnectCampaignService. -// -// List tags for a resource. -// -// 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 AmazonConnectCampaignService's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/ListTagsForResource -func (c *ConnectCampaigns) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *ConnectCampaigns) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPauseCampaign = "PauseCampaign" - -// PauseCampaignRequest generates a "aws/request.Request" representing the -// client's request for the PauseCampaign 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 PauseCampaign for more information on using the PauseCampaign -// 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 PauseCampaignRequest method. -// req, resp := client.PauseCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/PauseCampaign -func (c *ConnectCampaigns) PauseCampaignRequest(input *PauseCampaignInput) (req *request.Request, output *PauseCampaignOutput) { - op := &request.Operation{ - Name: opPauseCampaign, - HTTPMethod: "POST", - HTTPPath: "/campaigns/{id}/pause", - } - - if input == nil { - input = &PauseCampaignInput{} - } - - output = &PauseCampaignOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PauseCampaign API operation for AmazonConnectCampaignService. -// -// Pauses a campaign for the specified Amazon Connect account. -// -// 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 AmazonConnectCampaignService's -// API operation PauseCampaign for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - InvalidCampaignStateException -// The request could not be processed because of conflict in the current state -// of the campaign. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/PauseCampaign -func (c *ConnectCampaigns) PauseCampaign(input *PauseCampaignInput) (*PauseCampaignOutput, error) { - req, out := c.PauseCampaignRequest(input) - return out, req.Send() -} - -// PauseCampaignWithContext is the same as PauseCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See PauseCampaign 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 *ConnectCampaigns) PauseCampaignWithContext(ctx aws.Context, input *PauseCampaignInput, opts ...request.Option) (*PauseCampaignOutput, error) { - req, out := c.PauseCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutDialRequestBatch = "PutDialRequestBatch" - -// PutDialRequestBatchRequest generates a "aws/request.Request" representing the -// client's request for the PutDialRequestBatch 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 PutDialRequestBatch for more information on using the PutDialRequestBatch -// 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 PutDialRequestBatchRequest method. -// req, resp := client.PutDialRequestBatchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/PutDialRequestBatch -func (c *ConnectCampaigns) PutDialRequestBatchRequest(input *PutDialRequestBatchInput) (req *request.Request, output *PutDialRequestBatchOutput) { - op := &request.Operation{ - Name: opPutDialRequestBatch, - HTTPMethod: "PUT", - HTTPPath: "/campaigns/{id}/dial-requests", - } - - if input == nil { - input = &PutDialRequestBatchInput{} - } - - output = &PutDialRequestBatchOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutDialRequestBatch API operation for AmazonConnectCampaignService. -// -// Creates dials requests for the specified campaign Amazon Connect account. -// This API is idempotent. -// -// 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 AmazonConnectCampaignService's -// API operation PutDialRequestBatch for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - InvalidCampaignStateException -// The request could not be processed because of conflict in the current state -// of the campaign. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/PutDialRequestBatch -func (c *ConnectCampaigns) PutDialRequestBatch(input *PutDialRequestBatchInput) (*PutDialRequestBatchOutput, error) { - req, out := c.PutDialRequestBatchRequest(input) - return out, req.Send() -} - -// PutDialRequestBatchWithContext is the same as PutDialRequestBatch with the addition of -// the ability to pass a context and additional request options. -// -// See PutDialRequestBatch 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 *ConnectCampaigns) PutDialRequestBatchWithContext(ctx aws.Context, input *PutDialRequestBatchInput, opts ...request.Option) (*PutDialRequestBatchOutput, error) { - req, out := c.PutDialRequestBatchRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResumeCampaign = "ResumeCampaign" - -// ResumeCampaignRequest generates a "aws/request.Request" representing the -// client's request for the ResumeCampaign 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 ResumeCampaign for more information on using the ResumeCampaign -// 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 ResumeCampaignRequest method. -// req, resp := client.ResumeCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/ResumeCampaign -func (c *ConnectCampaigns) ResumeCampaignRequest(input *ResumeCampaignInput) (req *request.Request, output *ResumeCampaignOutput) { - op := &request.Operation{ - Name: opResumeCampaign, - HTTPMethod: "POST", - HTTPPath: "/campaigns/{id}/resume", - } - - if input == nil { - input = &ResumeCampaignInput{} - } - - output = &ResumeCampaignOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// ResumeCampaign API operation for AmazonConnectCampaignService. -// -// Stops a campaign for the specified Amazon Connect account. -// -// 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 AmazonConnectCampaignService's -// API operation ResumeCampaign for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - InvalidCampaignStateException -// The request could not be processed because of conflict in the current state -// of the campaign. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/ResumeCampaign -func (c *ConnectCampaigns) ResumeCampaign(input *ResumeCampaignInput) (*ResumeCampaignOutput, error) { - req, out := c.ResumeCampaignRequest(input) - return out, req.Send() -} - -// ResumeCampaignWithContext is the same as ResumeCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See ResumeCampaign 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 *ConnectCampaigns) ResumeCampaignWithContext(ctx aws.Context, input *ResumeCampaignInput, opts ...request.Option) (*ResumeCampaignOutput, error) { - req, out := c.ResumeCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartCampaign = "StartCampaign" - -// StartCampaignRequest generates a "aws/request.Request" representing the -// client's request for the StartCampaign 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 StartCampaign for more information on using the StartCampaign -// 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 StartCampaignRequest method. -// req, resp := client.StartCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/StartCampaign -func (c *ConnectCampaigns) StartCampaignRequest(input *StartCampaignInput) (req *request.Request, output *StartCampaignOutput) { - op := &request.Operation{ - Name: opStartCampaign, - HTTPMethod: "POST", - HTTPPath: "/campaigns/{id}/start", - } - - if input == nil { - input = &StartCampaignInput{} - } - - output = &StartCampaignOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartCampaign API operation for AmazonConnectCampaignService. -// -// Starts a campaign for the specified Amazon Connect account. -// -// 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 AmazonConnectCampaignService's -// API operation StartCampaign for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - InvalidCampaignStateException -// The request could not be processed because of conflict in the current state -// of the campaign. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/StartCampaign -func (c *ConnectCampaigns) StartCampaign(input *StartCampaignInput) (*StartCampaignOutput, error) { - req, out := c.StartCampaignRequest(input) - return out, req.Send() -} - -// StartCampaignWithContext is the same as StartCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See StartCampaign 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 *ConnectCampaigns) StartCampaignWithContext(ctx aws.Context, input *StartCampaignInput, opts ...request.Option) (*StartCampaignOutput, error) { - req, out := c.StartCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartInstanceOnboardingJob = "StartInstanceOnboardingJob" - -// StartInstanceOnboardingJobRequest generates a "aws/request.Request" representing the -// client's request for the StartInstanceOnboardingJob 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 StartInstanceOnboardingJob for more information on using the StartInstanceOnboardingJob -// 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 StartInstanceOnboardingJobRequest method. -// req, resp := client.StartInstanceOnboardingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/StartInstanceOnboardingJob -func (c *ConnectCampaigns) StartInstanceOnboardingJobRequest(input *StartInstanceOnboardingJobInput) (req *request.Request, output *StartInstanceOnboardingJobOutput) { - op := &request.Operation{ - Name: opStartInstanceOnboardingJob, - HTTPMethod: "PUT", - HTTPPath: "/connect-instance/{connectInstanceId}/onboarding", - } - - if input == nil { - input = &StartInstanceOnboardingJobInput{} - } - - output = &StartInstanceOnboardingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartInstanceOnboardingJob API operation for AmazonConnectCampaignService. -// -// Onboard the specific Amazon Connect instance to Connect Campaigns. -// -// 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 AmazonConnectCampaignService's -// API operation StartInstanceOnboardingJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/StartInstanceOnboardingJob -func (c *ConnectCampaigns) StartInstanceOnboardingJob(input *StartInstanceOnboardingJobInput) (*StartInstanceOnboardingJobOutput, error) { - req, out := c.StartInstanceOnboardingJobRequest(input) - return out, req.Send() -} - -// StartInstanceOnboardingJobWithContext is the same as StartInstanceOnboardingJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartInstanceOnboardingJob 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 *ConnectCampaigns) StartInstanceOnboardingJobWithContext(ctx aws.Context, input *StartInstanceOnboardingJobInput, opts ...request.Option) (*StartInstanceOnboardingJobOutput, error) { - req, out := c.StartInstanceOnboardingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopCampaign = "StopCampaign" - -// StopCampaignRequest generates a "aws/request.Request" representing the -// client's request for the StopCampaign 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 StopCampaign for more information on using the StopCampaign -// 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 StopCampaignRequest method. -// req, resp := client.StopCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/StopCampaign -func (c *ConnectCampaigns) StopCampaignRequest(input *StopCampaignInput) (req *request.Request, output *StopCampaignOutput) { - op := &request.Operation{ - Name: opStopCampaign, - HTTPMethod: "POST", - HTTPPath: "/campaigns/{id}/stop", - } - - if input == nil { - input = &StopCampaignInput{} - } - - output = &StopCampaignOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopCampaign API operation for AmazonConnectCampaignService. -// -// Stops a campaign for the specified Amazon Connect account. -// -// 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 AmazonConnectCampaignService's -// API operation StopCampaign for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - InvalidCampaignStateException -// The request could not be processed because of conflict in the current state -// of the campaign. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/StopCampaign -func (c *ConnectCampaigns) StopCampaign(input *StopCampaignInput) (*StopCampaignOutput, error) { - req, out := c.StopCampaignRequest(input) - return out, req.Send() -} - -// StopCampaignWithContext is the same as StopCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See StopCampaign 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 *ConnectCampaigns) StopCampaignWithContext(ctx aws.Context, input *StopCampaignInput, opts ...request.Option) (*StopCampaignOutput, error) { - req, out := c.StopCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/TagResource -func (c *ConnectCampaigns) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{arn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AmazonConnectCampaignService. -// -// Tag a resource. -// -// 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 AmazonConnectCampaignService's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/TagResource -func (c *ConnectCampaigns) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *ConnectCampaigns) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/UntagResource -func (c *ConnectCampaigns) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{arn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AmazonConnectCampaignService. -// -// Untag a resource. -// -// 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 AmazonConnectCampaignService's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/UntagResource -func (c *ConnectCampaigns) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *ConnectCampaigns) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCampaignDialerConfig = "UpdateCampaignDialerConfig" - -// UpdateCampaignDialerConfigRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCampaignDialerConfig 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 UpdateCampaignDialerConfig for more information on using the UpdateCampaignDialerConfig -// 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 UpdateCampaignDialerConfigRequest method. -// req, resp := client.UpdateCampaignDialerConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/UpdateCampaignDialerConfig -func (c *ConnectCampaigns) UpdateCampaignDialerConfigRequest(input *UpdateCampaignDialerConfigInput) (req *request.Request, output *UpdateCampaignDialerConfigOutput) { - op := &request.Operation{ - Name: opUpdateCampaignDialerConfig, - HTTPMethod: "POST", - HTTPPath: "/campaigns/{id}/dialer-config", - } - - if input == nil { - input = &UpdateCampaignDialerConfigInput{} - } - - output = &UpdateCampaignDialerConfigOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateCampaignDialerConfig API operation for AmazonConnectCampaignService. -// -// Updates the dialer config of a campaign. This API is idempotent. -// -// 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 AmazonConnectCampaignService's -// API operation UpdateCampaignDialerConfig for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/UpdateCampaignDialerConfig -func (c *ConnectCampaigns) UpdateCampaignDialerConfig(input *UpdateCampaignDialerConfigInput) (*UpdateCampaignDialerConfigOutput, error) { - req, out := c.UpdateCampaignDialerConfigRequest(input) - return out, req.Send() -} - -// UpdateCampaignDialerConfigWithContext is the same as UpdateCampaignDialerConfig with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCampaignDialerConfig 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 *ConnectCampaigns) UpdateCampaignDialerConfigWithContext(ctx aws.Context, input *UpdateCampaignDialerConfigInput, opts ...request.Option) (*UpdateCampaignDialerConfigOutput, error) { - req, out := c.UpdateCampaignDialerConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCampaignName = "UpdateCampaignName" - -// UpdateCampaignNameRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCampaignName 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 UpdateCampaignName for more information on using the UpdateCampaignName -// 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 UpdateCampaignNameRequest method. -// req, resp := client.UpdateCampaignNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/UpdateCampaignName -func (c *ConnectCampaigns) UpdateCampaignNameRequest(input *UpdateCampaignNameInput) (req *request.Request, output *UpdateCampaignNameOutput) { - op := &request.Operation{ - Name: opUpdateCampaignName, - HTTPMethod: "POST", - HTTPPath: "/campaigns/{id}/name", - } - - if input == nil { - input = &UpdateCampaignNameInput{} - } - - output = &UpdateCampaignNameOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateCampaignName API operation for AmazonConnectCampaignService. -// -// Updates the name of a campaign. This API is idempotent. -// -// 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 AmazonConnectCampaignService's -// API operation UpdateCampaignName for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/UpdateCampaignName -func (c *ConnectCampaigns) UpdateCampaignName(input *UpdateCampaignNameInput) (*UpdateCampaignNameOutput, error) { - req, out := c.UpdateCampaignNameRequest(input) - return out, req.Send() -} - -// UpdateCampaignNameWithContext is the same as UpdateCampaignName with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCampaignName 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 *ConnectCampaigns) UpdateCampaignNameWithContext(ctx aws.Context, input *UpdateCampaignNameInput, opts ...request.Option) (*UpdateCampaignNameOutput, error) { - req, out := c.UpdateCampaignNameRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCampaignOutboundCallConfig = "UpdateCampaignOutboundCallConfig" - -// UpdateCampaignOutboundCallConfigRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCampaignOutboundCallConfig 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 UpdateCampaignOutboundCallConfig for more information on using the UpdateCampaignOutboundCallConfig -// 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 UpdateCampaignOutboundCallConfigRequest method. -// req, resp := client.UpdateCampaignOutboundCallConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/UpdateCampaignOutboundCallConfig -func (c *ConnectCampaigns) UpdateCampaignOutboundCallConfigRequest(input *UpdateCampaignOutboundCallConfigInput) (req *request.Request, output *UpdateCampaignOutboundCallConfigOutput) { - op := &request.Operation{ - Name: opUpdateCampaignOutboundCallConfig, - HTTPMethod: "POST", - HTTPPath: "/campaigns/{id}/outbound-call-config", - } - - if input == nil { - input = &UpdateCampaignOutboundCallConfigInput{} - } - - output = &UpdateCampaignOutboundCallConfigOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateCampaignOutboundCallConfig API operation for AmazonConnectCampaignService. -// -// Updates the outbound call config of a campaign. This API is idempotent. -// -// 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 AmazonConnectCampaignService's -// API operation UpdateCampaignOutboundCallConfig for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Request processing failed because of an error or failure with the service. -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30/UpdateCampaignOutboundCallConfig -func (c *ConnectCampaigns) UpdateCampaignOutboundCallConfig(input *UpdateCampaignOutboundCallConfigInput) (*UpdateCampaignOutboundCallConfigOutput, error) { - req, out := c.UpdateCampaignOutboundCallConfigRequest(input) - return out, req.Send() -} - -// UpdateCampaignOutboundCallConfigWithContext is the same as UpdateCampaignOutboundCallConfig with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCampaignOutboundCallConfig 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 *ConnectCampaigns) UpdateCampaignOutboundCallConfigWithContext(ctx aws.Context, input *UpdateCampaignOutboundCallConfigInput, opts ...request.Option) (*UpdateCampaignOutboundCallConfigOutput, error) { - req, out := c.UpdateCampaignOutboundCallConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Agentless Dialer config -type AgentlessDialerConfig struct { - _ struct{} `type:"structure"` - - // Allocates dialing capacity for this campaign between multiple active campaigns - DialingCapacity *float64 `locationName:"dialingCapacity" min:"0.01" type:"double"` -} - -// 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 AgentlessDialerConfig) 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 AgentlessDialerConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AgentlessDialerConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AgentlessDialerConfig"} - if s.DialingCapacity != nil && *s.DialingCapacity < 0.01 { - invalidParams.Add(request.NewErrParamMinValue("DialingCapacity", 0.01)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDialingCapacity sets the DialingCapacity field's value. -func (s *AgentlessDialerConfig) SetDialingCapacity(v float64) *AgentlessDialerConfig { - s.DialingCapacity = &v - return s -} - -// Answering Machine Detection config -type AnswerMachineDetectionConfig struct { - _ struct{} `type:"structure"` - - // Enable or disable answering machine detection - // - // EnableAnswerMachineDetection is a required field - EnableAnswerMachineDetection *bool `locationName:"enableAnswerMachineDetection" type:"boolean" 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 AnswerMachineDetectionConfig) 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 AnswerMachineDetectionConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnswerMachineDetectionConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnswerMachineDetectionConfig"} - if s.EnableAnswerMachineDetection == nil { - invalidParams.Add(request.NewErrParamRequired("EnableAnswerMachineDetection")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnableAnswerMachineDetection sets the EnableAnswerMachineDetection field's value. -func (s *AnswerMachineDetectionConfig) SetEnableAnswerMachineDetection(v bool) *AnswerMachineDetectionConfig { - s.EnableAnswerMachineDetection = &v - return s -} - -// An Amazon Connect campaign. -type Campaign struct { - _ struct{} `type:"structure"` - - // The resource name of an Amazon Connect campaign. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `locationName:"connectInstanceId" type:"string" required:"true"` - - // The possible types of dialer config parameters - // - // DialerConfig is a required field - DialerConfig *DialerConfig `locationName:"dialerConfig" type:"structure" required:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of an Amazon Connect Campaign name. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The configuration used for outbound calls. - // - // OutboundCallConfig is a required field - OutboundCallConfig *OutboundCallConfig `locationName:"outboundCallConfig" type:"structure" required:"true"` - - // Tag map with key and value. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 Campaign) 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 Campaign) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Campaign) SetArn(v string) *Campaign { - s.Arn = &v - return s -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *Campaign) SetConnectInstanceId(v string) *Campaign { - s.ConnectInstanceId = &v - return s -} - -// SetDialerConfig sets the DialerConfig field's value. -func (s *Campaign) SetDialerConfig(v *DialerConfig) *Campaign { - s.DialerConfig = v - return s -} - -// SetId sets the Id field's value. -func (s *Campaign) SetId(v string) *Campaign { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *Campaign) SetName(v string) *Campaign { - s.Name = &v - return s -} - -// SetOutboundCallConfig sets the OutboundCallConfig field's value. -func (s *Campaign) SetOutboundCallConfig(v *OutboundCallConfig) *Campaign { - s.OutboundCallConfig = v - return s -} - -// SetTags sets the Tags field's value. -func (s *Campaign) SetTags(v map[string]*string) *Campaign { - s.Tags = v - return s -} - -// Filter model by type -type CampaignFilters struct { - _ struct{} `type:"structure"` - - // Connect instance identifier filter - InstanceIdFilter *InstanceIdFilter `locationName:"instanceIdFilter" 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 CampaignFilters) 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 CampaignFilters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CampaignFilters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CampaignFilters"} - if s.InstanceIdFilter != nil { - if err := s.InstanceIdFilter.Validate(); err != nil { - invalidParams.AddNested("InstanceIdFilter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceIdFilter sets the InstanceIdFilter field's value. -func (s *CampaignFilters) SetInstanceIdFilter(v *InstanceIdFilter) *CampaignFilters { - s.InstanceIdFilter = v - return s -} - -// An Amazon Connect campaign summary. -type CampaignSummary struct { - _ struct{} `type:"structure"` - - // The resource name of an Amazon Connect campaign. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `locationName:"connectInstanceId" type:"string" required:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of an Amazon Connect Campaign name. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 CampaignSummary) 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 CampaignSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CampaignSummary) SetArn(v string) *CampaignSummary { - s.Arn = &v - return s -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *CampaignSummary) SetConnectInstanceId(v string) *CampaignSummary { - s.ConnectInstanceId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CampaignSummary) SetId(v string) *CampaignSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CampaignSummary) SetName(v string) *CampaignSummary { - s.Name = &v - return s -} - -// The request could not be processed because of conflict in the current state -// of the resource. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request for Create Campaign API. -type CreateCampaignInput struct { - _ struct{} `type:"structure"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `locationName:"connectInstanceId" type:"string" required:"true"` - - // The possible types of dialer config parameters - // - // DialerConfig is a required field - DialerConfig *DialerConfig `locationName:"dialerConfig" type:"structure" required:"true"` - - // The name of an Amazon Connect Campaign name. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The configuration used for outbound calls. - // - // OutboundCallConfig is a required field - OutboundCallConfig *OutboundCallConfig `locationName:"outboundCallConfig" type:"structure" required:"true"` - - // Tag map with key and value. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateCampaignInput) 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 CreateCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCampaignInput"} - if s.ConnectInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectInstanceId")) - } - if s.DialerConfig == nil { - invalidParams.Add(request.NewErrParamRequired("DialerConfig")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.OutboundCallConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutboundCallConfig")) - } - if s.DialerConfig != nil { - if err := s.DialerConfig.Validate(); err != nil { - invalidParams.AddNested("DialerConfig", err.(request.ErrInvalidParams)) - } - } - if s.OutboundCallConfig != nil { - if err := s.OutboundCallConfig.Validate(); err != nil { - invalidParams.AddNested("OutboundCallConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *CreateCampaignInput) SetConnectInstanceId(v string) *CreateCampaignInput { - s.ConnectInstanceId = &v - return s -} - -// SetDialerConfig sets the DialerConfig field's value. -func (s *CreateCampaignInput) SetDialerConfig(v *DialerConfig) *CreateCampaignInput { - s.DialerConfig = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateCampaignInput) SetName(v string) *CreateCampaignInput { - s.Name = &v - return s -} - -// SetOutboundCallConfig sets the OutboundCallConfig field's value. -func (s *CreateCampaignInput) SetOutboundCallConfig(v *OutboundCallConfig) *CreateCampaignInput { - s.OutboundCallConfig = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateCampaignInput) SetTags(v map[string]*string) *CreateCampaignInput { - s.Tags = v - return s -} - -// The response for Create Campaign API -type CreateCampaignOutput struct { - _ struct{} `type:"structure"` - - // The resource name of an Amazon Connect campaign. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // Identifier representing a Campaign - Id *string `locationName:"id" type:"string"` - - // Tag map with key and value. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateCampaignOutput) 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 CreateCampaignOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateCampaignOutput) SetArn(v string) *CreateCampaignOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateCampaignOutput) SetId(v string) *CreateCampaignOutput { - s.Id = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateCampaignOutput) SetTags(v map[string]*string) *CreateCampaignOutput { - s.Tags = v - return s -} - -// DeleteCampaignRequest -type DeleteCampaignInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 DeleteCampaignInput) 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 DeleteCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCampaignInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteCampaignInput) SetId(v string) *DeleteCampaignInput { - s.Id = &v - return s -} - -type DeleteCampaignOutput 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 DeleteCampaignOutput) 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 DeleteCampaignOutput) GoString() string { - return s.String() -} - -// DeleteCampaignRequest -type DeleteConnectInstanceConfigInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `location:"uri" locationName:"connectInstanceId" 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 DeleteConnectInstanceConfigInput) 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 DeleteConnectInstanceConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConnectInstanceConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConnectInstanceConfigInput"} - if s.ConnectInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectInstanceId")) - } - if s.ConnectInstanceId != nil && len(*s.ConnectInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConnectInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *DeleteConnectInstanceConfigInput) SetConnectInstanceId(v string) *DeleteConnectInstanceConfigInput { - s.ConnectInstanceId = &v - return s -} - -type DeleteConnectInstanceConfigOutput 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 DeleteConnectInstanceConfigOutput) 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 DeleteConnectInstanceConfigOutput) GoString() string { - return s.String() -} - -// The request for DeleteInstanceOnboardingJob API. -type DeleteInstanceOnboardingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `location:"uri" locationName:"connectInstanceId" 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 DeleteInstanceOnboardingJobInput) 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 DeleteInstanceOnboardingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInstanceOnboardingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInstanceOnboardingJobInput"} - if s.ConnectInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectInstanceId")) - } - if s.ConnectInstanceId != nil && len(*s.ConnectInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConnectInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *DeleteInstanceOnboardingJobInput) SetConnectInstanceId(v string) *DeleteInstanceOnboardingJobInput { - s.ConnectInstanceId = &v - return s -} - -type DeleteInstanceOnboardingJobOutput 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 DeleteInstanceOnboardingJobOutput) 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 DeleteInstanceOnboardingJobOutput) GoString() string { - return s.String() -} - -// DescribeCampaignRequests -type DescribeCampaignInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 DescribeCampaignInput) 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 DescribeCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCampaignInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DescribeCampaignInput) SetId(v string) *DescribeCampaignInput { - s.Id = &v - return s -} - -// DescribeCampaignResponse -type DescribeCampaignOutput struct { - _ struct{} `type:"structure"` - - // An Amazon Connect campaign. - Campaign *Campaign `locationName:"campaign" 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 DescribeCampaignOutput) 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 DescribeCampaignOutput) GoString() string { - return s.String() -} - -// SetCampaign sets the Campaign field's value. -func (s *DescribeCampaignOutput) SetCampaign(v *Campaign) *DescribeCampaignOutput { - s.Campaign = v - return s -} - -// A dial request for a campaign. -type DialRequest struct { - _ struct{} `type:"structure"` - - // A custom key-value pair using an attribute map. The attributes are standard - // Amazon Connect attributes, and can be accessed in contact flows just like - // any other contact attributes. - // - // Attributes is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DialRequest's - // String and GoString methods. - // - // Attributes is a required field - Attributes map[string]*string `locationName:"attributes" type:"map" required:"true" sensitive:"true"` - - // Client provided parameter used for idempotency. Its value must be unique - // for each request. - // - // ClientToken is a required field - ClientToken *string `locationName:"clientToken" type:"string" required:"true"` - - // Timestamp with no UTC offset or timezone - // - // ExpirationTime is a required field - ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The phone number of the customer, in E.164 format. - // - // PhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DialRequest's - // String and GoString methods. - // - // PhoneNumber is a required field - PhoneNumber *string `locationName:"phoneNumber" type:"string" required:"true" sensitive:"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 DialRequest) 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 DialRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DialRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DialRequest"} - if s.Attributes == nil { - invalidParams.Add(request.NewErrParamRequired("Attributes")) - } - if s.ClientToken == nil { - invalidParams.Add(request.NewErrParamRequired("ClientToken")) - } - if s.ExpirationTime == nil { - invalidParams.Add(request.NewErrParamRequired("ExpirationTime")) - } - if s.PhoneNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PhoneNumber")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *DialRequest) SetAttributes(v map[string]*string) *DialRequest { - s.Attributes = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *DialRequest) SetClientToken(v string) *DialRequest { - s.ClientToken = &v - return s -} - -// SetExpirationTime sets the ExpirationTime field's value. -func (s *DialRequest) SetExpirationTime(v time.Time) *DialRequest { - s.ExpirationTime = &v - return s -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *DialRequest) SetPhoneNumber(v string) *DialRequest { - s.PhoneNumber = &v - return s -} - -// The possible types of dialer config parameters -type DialerConfig struct { - _ struct{} `type:"structure"` - - // Agentless Dialer config - AgentlessDialerConfig *AgentlessDialerConfig `locationName:"agentlessDialerConfig" type:"structure"` - - // Predictive Dialer config - PredictiveDialerConfig *PredictiveDialerConfig `locationName:"predictiveDialerConfig" type:"structure"` - - // Progressive Dialer config - ProgressiveDialerConfig *ProgressiveDialerConfig `locationName:"progressiveDialerConfig" 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 DialerConfig) 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 DialerConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DialerConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DialerConfig"} - if s.AgentlessDialerConfig != nil { - if err := s.AgentlessDialerConfig.Validate(); err != nil { - invalidParams.AddNested("AgentlessDialerConfig", err.(request.ErrInvalidParams)) - } - } - if s.PredictiveDialerConfig != nil { - if err := s.PredictiveDialerConfig.Validate(); err != nil { - invalidParams.AddNested("PredictiveDialerConfig", err.(request.ErrInvalidParams)) - } - } - if s.ProgressiveDialerConfig != nil { - if err := s.ProgressiveDialerConfig.Validate(); err != nil { - invalidParams.AddNested("ProgressiveDialerConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAgentlessDialerConfig sets the AgentlessDialerConfig field's value. -func (s *DialerConfig) SetAgentlessDialerConfig(v *AgentlessDialerConfig) *DialerConfig { - s.AgentlessDialerConfig = v - return s -} - -// SetPredictiveDialerConfig sets the PredictiveDialerConfig field's value. -func (s *DialerConfig) SetPredictiveDialerConfig(v *PredictiveDialerConfig) *DialerConfig { - s.PredictiveDialerConfig = v - return s -} - -// SetProgressiveDialerConfig sets the ProgressiveDialerConfig field's value. -func (s *DialerConfig) SetProgressiveDialerConfig(v *ProgressiveDialerConfig) *DialerConfig { - s.ProgressiveDialerConfig = v - return s -} - -// Encryption config for Connect Instance. Note that sensitive data will always -// be encrypted. If disabled, service will perform encryption with its own key. -// If enabled, a KMS key id needs to be provided and KMS charges will apply. -// KMS is only type supported -type EncryptionConfig struct { - _ struct{} `type:"structure"` - - // Boolean to indicate if custom encryption has been enabled. - // - // Enabled is a required field - Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` - - // Server-side encryption type. - EncryptionType *string `locationName:"encryptionType" type:"string" enum:"EncryptionType"` - - // KMS key id/arn for encryption config. - KeyArn *string `locationName:"keyArn" 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 EncryptionConfig) 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 EncryptionConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptionConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptionConfig"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *EncryptionConfig) SetEnabled(v bool) *EncryptionConfig { - s.Enabled = &v - return s -} - -// SetEncryptionType sets the EncryptionType field's value. -func (s *EncryptionConfig) SetEncryptionType(v string) *EncryptionConfig { - s.EncryptionType = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *EncryptionConfig) SetKeyArn(v string) *EncryptionConfig { - s.KeyArn = &v - return s -} - -// Failed response of campaign state -type FailedCampaignStateResponse struct { - _ struct{} `type:"structure"` - - // Identifier representing a Campaign - CampaignId *string `locationName:"campaignId" type:"string"` - - // A predefined code indicating the error that caused the failure in getting - // state of campaigns - FailureCode *string `locationName:"failureCode" type:"string" enum:"GetCampaignStateBatchFailureCode"` -} - -// 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 FailedCampaignStateResponse) 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 FailedCampaignStateResponse) GoString() string { - return s.String() -} - -// SetCampaignId sets the CampaignId field's value. -func (s *FailedCampaignStateResponse) SetCampaignId(v string) *FailedCampaignStateResponse { - s.CampaignId = &v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *FailedCampaignStateResponse) SetFailureCode(v string) *FailedCampaignStateResponse { - s.FailureCode = &v - return s -} - -// A failed request identified by the unique client token. -type FailedRequest struct { - _ struct{} `type:"structure"` - - // Client provided parameter used for idempotency. Its value must be unique - // for each request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // A predefined code indicating the error that caused the failure. - FailureCode *string `locationName:"failureCode" type:"string" enum:"FailureCode"` - - // Identifier representing a Dial request - Id *string `locationName:"id" 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 FailedRequest) 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 FailedRequest) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *FailedRequest) SetClientToken(v string) *FailedRequest { - s.ClientToken = &v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *FailedRequest) SetFailureCode(v string) *FailedRequest { - s.FailureCode = &v - return s -} - -// SetId sets the Id field's value. -func (s *FailedRequest) SetId(v string) *FailedRequest { - s.Id = &v - return s -} - -// GetCampaignStateBatchRequest -type GetCampaignStateBatchInput struct { - _ struct{} `type:"structure"` - - // List of CampaignId - // - // CampaignIds is a required field - CampaignIds []*string `locationName:"campaignIds" min:"1" type:"list" 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 GetCampaignStateBatchInput) 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 GetCampaignStateBatchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignStateBatchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignStateBatchInput"} - if s.CampaignIds == nil { - invalidParams.Add(request.NewErrParamRequired("CampaignIds")) - } - if s.CampaignIds != nil && len(s.CampaignIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CampaignIds", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCampaignIds sets the CampaignIds field's value. -func (s *GetCampaignStateBatchInput) SetCampaignIds(v []*string) *GetCampaignStateBatchInput { - s.CampaignIds = v - return s -} - -// GetCampaignStateBatchResponse -type GetCampaignStateBatchOutput struct { - _ struct{} `type:"structure"` - - // List of failed requests of campaign state - FailedRequests []*FailedCampaignStateResponse `locationName:"failedRequests" type:"list"` - - // List of successful response of campaign state - SuccessfulRequests []*SuccessfulCampaignStateResponse `locationName:"successfulRequests" type:"list"` -} - -// 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 GetCampaignStateBatchOutput) 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 GetCampaignStateBatchOutput) GoString() string { - return s.String() -} - -// SetFailedRequests sets the FailedRequests field's value. -func (s *GetCampaignStateBatchOutput) SetFailedRequests(v []*FailedCampaignStateResponse) *GetCampaignStateBatchOutput { - s.FailedRequests = v - return s -} - -// SetSuccessfulRequests sets the SuccessfulRequests field's value. -func (s *GetCampaignStateBatchOutput) SetSuccessfulRequests(v []*SuccessfulCampaignStateResponse) *GetCampaignStateBatchOutput { - s.SuccessfulRequests = v - return s -} - -// GetCampaignStateRequest -type GetCampaignStateInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 GetCampaignStateInput) 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 GetCampaignStateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignStateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignStateInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetCampaignStateInput) SetId(v string) *GetCampaignStateInput { - s.Id = &v - return s -} - -// GetCampaignStateResponse -type GetCampaignStateOutput struct { - _ struct{} `type:"structure"` - - // State of a campaign - State *string `locationName:"state" type:"string" enum:"CampaignState"` -} - -// 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 GetCampaignStateOutput) 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 GetCampaignStateOutput) GoString() string { - return s.String() -} - -// SetState sets the State field's value. -func (s *GetCampaignStateOutput) SetState(v string) *GetCampaignStateOutput { - s.State = &v - return s -} - -// GetConnectInstanceConfigRequest -type GetConnectInstanceConfigInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `location:"uri" locationName:"connectInstanceId" 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 GetConnectInstanceConfigInput) 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 GetConnectInstanceConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConnectInstanceConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConnectInstanceConfigInput"} - if s.ConnectInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectInstanceId")) - } - if s.ConnectInstanceId != nil && len(*s.ConnectInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConnectInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *GetConnectInstanceConfigInput) SetConnectInstanceId(v string) *GetConnectInstanceConfigInput { - s.ConnectInstanceId = &v - return s -} - -// GetConnectInstanceConfigResponse -type GetConnectInstanceConfigOutput struct { - _ struct{} `type:"structure"` - - // Instance config object - ConnectInstanceConfig *InstanceConfig `locationName:"connectInstanceConfig" 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 GetConnectInstanceConfigOutput) 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 GetConnectInstanceConfigOutput) GoString() string { - return s.String() -} - -// SetConnectInstanceConfig sets the ConnectInstanceConfig field's value. -func (s *GetConnectInstanceConfigOutput) SetConnectInstanceConfig(v *InstanceConfig) *GetConnectInstanceConfigOutput { - s.ConnectInstanceConfig = v - return s -} - -// GetInstanceOnboardingJobStatusRequest -type GetInstanceOnboardingJobStatusInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `location:"uri" locationName:"connectInstanceId" 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 GetInstanceOnboardingJobStatusInput) 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 GetInstanceOnboardingJobStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInstanceOnboardingJobStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInstanceOnboardingJobStatusInput"} - if s.ConnectInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectInstanceId")) - } - if s.ConnectInstanceId != nil && len(*s.ConnectInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConnectInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *GetInstanceOnboardingJobStatusInput) SetConnectInstanceId(v string) *GetInstanceOnboardingJobStatusInput { - s.ConnectInstanceId = &v - return s -} - -// GetInstanceOnboardingJobStatusResponse -type GetInstanceOnboardingJobStatusOutput struct { - _ struct{} `type:"structure"` - - // Instance onboarding job status object - ConnectInstanceOnboardingJobStatus *InstanceOnboardingJobStatus `locationName:"connectInstanceOnboardingJobStatus" 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 GetInstanceOnboardingJobStatusOutput) 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 GetInstanceOnboardingJobStatusOutput) GoString() string { - return s.String() -} - -// SetConnectInstanceOnboardingJobStatus sets the ConnectInstanceOnboardingJobStatus field's value. -func (s *GetInstanceOnboardingJobStatusOutput) SetConnectInstanceOnboardingJobStatus(v *InstanceOnboardingJobStatus) *GetInstanceOnboardingJobStatusOutput { - s.ConnectInstanceOnboardingJobStatus = v - return s -} - -// Instance config object -type InstanceConfig struct { - _ struct{} `type:"structure"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `locationName:"connectInstanceId" type:"string" required:"true"` - - // Encryption config for Connect Instance. Note that sensitive data will always - // be encrypted. If disabled, service will perform encryption with its own key. - // If enabled, a KMS key id needs to be provided and KMS charges will apply. - // KMS is only type supported - // - // EncryptionConfig is a required field - EncryptionConfig *EncryptionConfig `locationName:"encryptionConfig" type:"structure" required:"true"` - - // Service linked role arn - // - // ServiceLinkedRoleArn is a required field - ServiceLinkedRoleArn *string `locationName:"serviceLinkedRoleArn" 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 InstanceConfig) 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 InstanceConfig) GoString() string { - return s.String() -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *InstanceConfig) SetConnectInstanceId(v string) *InstanceConfig { - s.ConnectInstanceId = &v - return s -} - -// SetEncryptionConfig sets the EncryptionConfig field's value. -func (s *InstanceConfig) SetEncryptionConfig(v *EncryptionConfig) *InstanceConfig { - s.EncryptionConfig = v - return s -} - -// SetServiceLinkedRoleArn sets the ServiceLinkedRoleArn field's value. -func (s *InstanceConfig) SetServiceLinkedRoleArn(v string) *InstanceConfig { - s.ServiceLinkedRoleArn = &v - return s -} - -// Connect instance identifier filter -type InstanceIdFilter struct { - _ struct{} `type:"structure"` - - // Operators for Connect instance identifier filter - // - // Operator is a required field - Operator *string `locationName:"operator" type:"string" required:"true" enum:"InstanceIdFilterOperator"` - - // Amazon Connect Instance Id - // - // Value is a required field - Value *string `locationName:"value" 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 InstanceIdFilter) 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 InstanceIdFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstanceIdFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstanceIdFilter"} - if s.Operator == nil { - invalidParams.Add(request.NewErrParamRequired("Operator")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOperator sets the Operator field's value. -func (s *InstanceIdFilter) SetOperator(v string) *InstanceIdFilter { - s.Operator = &v - return s -} - -// SetValue sets the Value field's value. -func (s *InstanceIdFilter) SetValue(v string) *InstanceIdFilter { - s.Value = &v - return s -} - -// Instance onboarding job status object -type InstanceOnboardingJobStatus struct { - _ struct{} `type:"structure"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `locationName:"connectInstanceId" type:"string" required:"true"` - - // Enumeration of the possible failure codes for instance onboarding job - FailureCode *string `locationName:"failureCode" type:"string" enum:"InstanceOnboardingJobFailureCode"` - - // Enumeration of the possible states for instance onboarding job - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"InstanceOnboardingJobStatusCode"` -} - -// 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 InstanceOnboardingJobStatus) 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 InstanceOnboardingJobStatus) GoString() string { - return s.String() -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *InstanceOnboardingJobStatus) SetConnectInstanceId(v string) *InstanceOnboardingJobStatus { - s.ConnectInstanceId = &v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *InstanceOnboardingJobStatus) SetFailureCode(v string) *InstanceOnboardingJobStatus { - s.FailureCode = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceOnboardingJobStatus) SetStatus(v string) *InstanceOnboardingJobStatus { - s.Status = &v - return s -} - -// Request processing failed because of an error or failure with the service. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request could not be processed because of conflict in the current state -// of the campaign. -type InvalidCampaignStateException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // State of a campaign - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"CampaignState"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 InvalidCampaignStateException) 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 InvalidCampaignStateException) GoString() string { - return s.String() -} - -func newErrorInvalidCampaignStateException(v protocol.ResponseMetadata) error { - return &InvalidCampaignStateException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidCampaignStateException) Code() string { - return "InvalidCampaignStateException" -} - -// Message returns the exception's message. -func (s *InvalidCampaignStateException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidCampaignStateException) OrigErr() error { - return nil -} - -func (s *InvalidCampaignStateException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidCampaignStateException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidCampaignStateException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request could not be processed because of conflict in the current state. -type InvalidStateException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 InvalidStateException) 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 InvalidStateException) GoString() string { - return s.String() -} - -func newErrorInvalidStateException(v protocol.ResponseMetadata) error { - return &InvalidStateException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidStateException) Code() string { - return "InvalidStateException" -} - -// Message returns the exception's message. -func (s *InvalidStateException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidStateException) OrigErr() error { - return nil -} - -func (s *InvalidStateException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidStateException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidStateException) RequestID() string { - return s.RespMetadata.RequestID -} - -// ListCampaignsRequest -type ListCampaignsInput struct { - _ struct{} `type:"structure"` - - // Filter model by type - Filters *CampaignFilters `locationName:"filters" type:"structure"` - - // The maximum number of results to return per page. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" 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 ListCampaignsInput) 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 ListCampaignsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCampaignsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCampaignsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListCampaignsInput) SetFilters(v *CampaignFilters) *ListCampaignsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCampaignsInput) SetMaxResults(v int64) *ListCampaignsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCampaignsInput) SetNextToken(v string) *ListCampaignsInput { - s.NextToken = &v - return s -} - -// ListCampaignsResponse -type ListCampaignsOutput struct { - _ struct{} `type:"structure"` - - // A list of Amazon Connect campaigns. - CampaignSummaryList []*CampaignSummary `locationName:"campaignSummaryList" type:"list"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" 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 ListCampaignsOutput) 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 ListCampaignsOutput) GoString() string { - return s.String() -} - -// SetCampaignSummaryList sets the CampaignSummaryList field's value. -func (s *ListCampaignsOutput) SetCampaignSummaryList(v []*CampaignSummary) *ListCampaignsOutput { - s.CampaignSummaryList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCampaignsOutput) SetNextToken(v string) *ListCampaignsOutput { - s.NextToken = &v - return s -} - -// ListTagsForResource -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Arn - // - // Arn is a required field - Arn *string `location:"uri" locationName:"arn" min:"20" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *ListTagsForResourceInput) SetArn(v string) *ListTagsForResourceInput { - s.Arn = &v - return s -} - -// ListTagsForResponse -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // Tag map with key and value. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// The configuration used for outbound calls. -type OutboundCallConfig struct { - _ struct{} `type:"structure"` - - // Answering Machine Detection config - AnswerMachineDetectionConfig *AnswerMachineDetectionConfig `locationName:"answerMachineDetectionConfig" type:"structure"` - - // The identifier of the contact flow for the outbound call. - // - // ConnectContactFlowId is a required field - ConnectContactFlowId *string `locationName:"connectContactFlowId" type:"string" required:"true"` - - // The queue for the call. If you specify a queue, the phone displayed for caller - // ID is the phone number specified in the queue. If you do not specify a queue, - // the queue defined in the contact flow is used. If you do not specify a queue, - // you must specify a source phone number. - ConnectQueueId *string `locationName:"connectQueueId" type:"string"` - - // The phone number associated with the Amazon Connect instance, in E.164 format. - // If you do not specify a source phone number, you must specify a queue. - ConnectSourcePhoneNumber *string `locationName:"connectSourcePhoneNumber" 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 OutboundCallConfig) 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 OutboundCallConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutboundCallConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutboundCallConfig"} - if s.ConnectContactFlowId == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectContactFlowId")) - } - if s.AnswerMachineDetectionConfig != nil { - if err := s.AnswerMachineDetectionConfig.Validate(); err != nil { - invalidParams.AddNested("AnswerMachineDetectionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnswerMachineDetectionConfig sets the AnswerMachineDetectionConfig field's value. -func (s *OutboundCallConfig) SetAnswerMachineDetectionConfig(v *AnswerMachineDetectionConfig) *OutboundCallConfig { - s.AnswerMachineDetectionConfig = v - return s -} - -// SetConnectContactFlowId sets the ConnectContactFlowId field's value. -func (s *OutboundCallConfig) SetConnectContactFlowId(v string) *OutboundCallConfig { - s.ConnectContactFlowId = &v - return s -} - -// SetConnectQueueId sets the ConnectQueueId field's value. -func (s *OutboundCallConfig) SetConnectQueueId(v string) *OutboundCallConfig { - s.ConnectQueueId = &v - return s -} - -// SetConnectSourcePhoneNumber sets the ConnectSourcePhoneNumber field's value. -func (s *OutboundCallConfig) SetConnectSourcePhoneNumber(v string) *OutboundCallConfig { - s.ConnectSourcePhoneNumber = &v - return s -} - -// PauseCampaignRequest -type PauseCampaignInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 PauseCampaignInput) 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 PauseCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PauseCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PauseCampaignInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *PauseCampaignInput) SetId(v string) *PauseCampaignInput { - s.Id = &v - return s -} - -type PauseCampaignOutput 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 PauseCampaignOutput) 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 PauseCampaignOutput) GoString() string { - return s.String() -} - -// Predictive Dialer config -type PredictiveDialerConfig struct { - _ struct{} `type:"structure"` - - // The bandwidth allocation of a queue resource. - // - // BandwidthAllocation is a required field - BandwidthAllocation *float64 `locationName:"bandwidthAllocation" type:"double" required:"true"` - - // Allocates dialing capacity for this campaign between multiple active campaigns - DialingCapacity *float64 `locationName:"dialingCapacity" min:"0.01" type:"double"` -} - -// 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 PredictiveDialerConfig) 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 PredictiveDialerConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PredictiveDialerConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PredictiveDialerConfig"} - if s.BandwidthAllocation == nil { - invalidParams.Add(request.NewErrParamRequired("BandwidthAllocation")) - } - if s.DialingCapacity != nil && *s.DialingCapacity < 0.01 { - invalidParams.Add(request.NewErrParamMinValue("DialingCapacity", 0.01)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBandwidthAllocation sets the BandwidthAllocation field's value. -func (s *PredictiveDialerConfig) SetBandwidthAllocation(v float64) *PredictiveDialerConfig { - s.BandwidthAllocation = &v - return s -} - -// SetDialingCapacity sets the DialingCapacity field's value. -func (s *PredictiveDialerConfig) SetDialingCapacity(v float64) *PredictiveDialerConfig { - s.DialingCapacity = &v - return s -} - -// Progressive Dialer config -type ProgressiveDialerConfig struct { - _ struct{} `type:"structure"` - - // The bandwidth allocation of a queue resource. - // - // BandwidthAllocation is a required field - BandwidthAllocation *float64 `locationName:"bandwidthAllocation" type:"double" required:"true"` - - // Allocates dialing capacity for this campaign between multiple active campaigns - DialingCapacity *float64 `locationName:"dialingCapacity" min:"0.01" type:"double"` -} - -// 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 ProgressiveDialerConfig) 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 ProgressiveDialerConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProgressiveDialerConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProgressiveDialerConfig"} - if s.BandwidthAllocation == nil { - invalidParams.Add(request.NewErrParamRequired("BandwidthAllocation")) - } - if s.DialingCapacity != nil && *s.DialingCapacity < 0.01 { - invalidParams.Add(request.NewErrParamMinValue("DialingCapacity", 0.01)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBandwidthAllocation sets the BandwidthAllocation field's value. -func (s *ProgressiveDialerConfig) SetBandwidthAllocation(v float64) *ProgressiveDialerConfig { - s.BandwidthAllocation = &v - return s -} - -// SetDialingCapacity sets the DialingCapacity field's value. -func (s *ProgressiveDialerConfig) SetDialingCapacity(v float64) *ProgressiveDialerConfig { - s.DialingCapacity = &v - return s -} - -// PutDialRequestBatchRequest -type PutDialRequestBatchInput struct { - _ struct{} `type:"structure"` - - // A list of dial requests. - // - // DialRequests is a required field - DialRequests []*DialRequest `locationName:"dialRequests" min:"1" type:"list" required:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 PutDialRequestBatchInput) 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 PutDialRequestBatchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutDialRequestBatchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutDialRequestBatchInput"} - if s.DialRequests == nil { - invalidParams.Add(request.NewErrParamRequired("DialRequests")) - } - if s.DialRequests != nil && len(s.DialRequests) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DialRequests", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.DialRequests != nil { - for i, v := range s.DialRequests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DialRequests", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDialRequests sets the DialRequests field's value. -func (s *PutDialRequestBatchInput) SetDialRequests(v []*DialRequest) *PutDialRequestBatchInput { - s.DialRequests = v - return s -} - -// SetId sets the Id field's value. -func (s *PutDialRequestBatchInput) SetId(v string) *PutDialRequestBatchInput { - s.Id = &v - return s -} - -// PutDialRequestBatchResponse -type PutDialRequestBatchOutput struct { - _ struct{} `type:"structure"` - - // A list of failed requests. - FailedRequests []*FailedRequest `locationName:"failedRequests" type:"list"` - - // A list of successful requests identified by the unique client token. - SuccessfulRequests []*SuccessfulRequest `locationName:"successfulRequests" type:"list"` -} - -// 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 PutDialRequestBatchOutput) 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 PutDialRequestBatchOutput) GoString() string { - return s.String() -} - -// SetFailedRequests sets the FailedRequests field's value. -func (s *PutDialRequestBatchOutput) SetFailedRequests(v []*FailedRequest) *PutDialRequestBatchOutput { - s.FailedRequests = v - return s -} - -// SetSuccessfulRequests sets the SuccessfulRequests field's value. -func (s *PutDialRequestBatchOutput) SetSuccessfulRequests(v []*SuccessfulRequest) *PutDialRequestBatchOutput { - s.SuccessfulRequests = v - return s -} - -// The specified resource was not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// ResumeCampaignRequest -type ResumeCampaignInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 ResumeCampaignInput) 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 ResumeCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResumeCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResumeCampaignInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *ResumeCampaignInput) SetId(v string) *ResumeCampaignInput { - s.Id = &v - return s -} - -type ResumeCampaignOutput 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 ResumeCampaignOutput) 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 ResumeCampaignOutput) GoString() string { - return s.String() -} - -// Request would cause a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// StartCampaignRequest -type StartCampaignInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 StartCampaignInput) 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 StartCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartCampaignInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *StartCampaignInput) SetId(v string) *StartCampaignInput { - s.Id = &v - return s -} - -type StartCampaignOutput 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 StartCampaignOutput) 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 StartCampaignOutput) GoString() string { - return s.String() -} - -// The request for StartInstanceOnboardingJob API. -type StartInstanceOnboardingJobInput struct { - _ struct{} `type:"structure"` - - // Amazon Connect Instance Id - // - // ConnectInstanceId is a required field - ConnectInstanceId *string `location:"uri" locationName:"connectInstanceId" type:"string" required:"true"` - - // Encryption config for Connect Instance. Note that sensitive data will always - // be encrypted. If disabled, service will perform encryption with its own key. - // If enabled, a KMS key id needs to be provided and KMS charges will apply. - // KMS is only type supported - // - // EncryptionConfig is a required field - EncryptionConfig *EncryptionConfig `locationName:"encryptionConfig" type:"structure" 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 StartInstanceOnboardingJobInput) 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 StartInstanceOnboardingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartInstanceOnboardingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartInstanceOnboardingJobInput"} - if s.ConnectInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectInstanceId")) - } - if s.ConnectInstanceId != nil && len(*s.ConnectInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConnectInstanceId", 1)) - } - if s.EncryptionConfig == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionConfig")) - } - if s.EncryptionConfig != nil { - if err := s.EncryptionConfig.Validate(); err != nil { - invalidParams.AddNested("EncryptionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectInstanceId sets the ConnectInstanceId field's value. -func (s *StartInstanceOnboardingJobInput) SetConnectInstanceId(v string) *StartInstanceOnboardingJobInput { - s.ConnectInstanceId = &v - return s -} - -// SetEncryptionConfig sets the EncryptionConfig field's value. -func (s *StartInstanceOnboardingJobInput) SetEncryptionConfig(v *EncryptionConfig) *StartInstanceOnboardingJobInput { - s.EncryptionConfig = v - return s -} - -// The response for StartInstanceOnboardingJob API. -type StartInstanceOnboardingJobOutput struct { - _ struct{} `type:"structure"` - - // Instance onboarding job status object - ConnectInstanceOnboardingJobStatus *InstanceOnboardingJobStatus `locationName:"connectInstanceOnboardingJobStatus" 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 StartInstanceOnboardingJobOutput) 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 StartInstanceOnboardingJobOutput) GoString() string { - return s.String() -} - -// SetConnectInstanceOnboardingJobStatus sets the ConnectInstanceOnboardingJobStatus field's value. -func (s *StartInstanceOnboardingJobOutput) SetConnectInstanceOnboardingJobStatus(v *InstanceOnboardingJobStatus) *StartInstanceOnboardingJobOutput { - s.ConnectInstanceOnboardingJobStatus = v - return s -} - -// StopCampaignRequest -type StopCampaignInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 StopCampaignInput) 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 StopCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopCampaignInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *StopCampaignInput) SetId(v string) *StopCampaignInput { - s.Id = &v - return s -} - -type StopCampaignOutput 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 StopCampaignOutput) 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 StopCampaignOutput) GoString() string { - return s.String() -} - -// Successful response of campaign state -type SuccessfulCampaignStateResponse struct { - _ struct{} `type:"structure"` - - // Identifier representing a Campaign - CampaignId *string `locationName:"campaignId" type:"string"` - - // State of a campaign - State *string `locationName:"state" type:"string" enum:"CampaignState"` -} - -// 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 SuccessfulCampaignStateResponse) 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 SuccessfulCampaignStateResponse) GoString() string { - return s.String() -} - -// SetCampaignId sets the CampaignId field's value. -func (s *SuccessfulCampaignStateResponse) SetCampaignId(v string) *SuccessfulCampaignStateResponse { - s.CampaignId = &v - return s -} - -// SetState sets the State field's value. -func (s *SuccessfulCampaignStateResponse) SetState(v string) *SuccessfulCampaignStateResponse { - s.State = &v - return s -} - -// A successful request identified by the unique client token. -type SuccessfulRequest struct { - _ struct{} `type:"structure"` - - // Client provided parameter used for idempotency. Its value must be unique - // for each request. - ClientToken *string `locationName:"clientToken" type:"string"` - - // Identifier representing a Dial request - Id *string `locationName:"id" 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 SuccessfulRequest) 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 SuccessfulRequest) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *SuccessfulRequest) SetClientToken(v string) *SuccessfulRequest { - s.ClientToken = &v - return s -} - -// SetId sets the Id field's value. -func (s *SuccessfulRequest) SetId(v string) *SuccessfulRequest { - s.Id = &v - return s -} - -// TagResourceRequest -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // Arn - // - // Arn is a required field - Arn *string `location:"uri" locationName:"arn" min:"20" type:"string" required:"true"` - - // Tag map with key and value. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 20)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *TagResourceInput) SetArn(v string) *TagResourceInput { - s.Arn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// UntagResourceRequest -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Arn - // - // Arn is a required field - Arn *string `location:"uri" locationName:"arn" min:"20" type:"string" required:"true"` - - // List of tag keys. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 20)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *UntagResourceInput) SetArn(v string) *UntagResourceInput { - s.Arn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -// UpdateCampaignDialerConfigRequest -type UpdateCampaignDialerConfigInput struct { - _ struct{} `type:"structure"` - - // The possible types of dialer config parameters - // - // DialerConfig is a required field - DialerConfig *DialerConfig `locationName:"dialerConfig" type:"structure" required:"true"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 UpdateCampaignDialerConfigInput) 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 UpdateCampaignDialerConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCampaignDialerConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCampaignDialerConfigInput"} - if s.DialerConfig == nil { - invalidParams.Add(request.NewErrParamRequired("DialerConfig")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.DialerConfig != nil { - if err := s.DialerConfig.Validate(); err != nil { - invalidParams.AddNested("DialerConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDialerConfig sets the DialerConfig field's value. -func (s *UpdateCampaignDialerConfigInput) SetDialerConfig(v *DialerConfig) *UpdateCampaignDialerConfigInput { - s.DialerConfig = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateCampaignDialerConfigInput) SetId(v string) *UpdateCampaignDialerConfigInput { - s.Id = &v - return s -} - -type UpdateCampaignDialerConfigOutput 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 UpdateCampaignDialerConfigOutput) 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 UpdateCampaignDialerConfigOutput) GoString() string { - return s.String() -} - -// UpdateCampaignNameRequest -type UpdateCampaignNameInput struct { - _ struct{} `type:"structure"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The name of an Amazon Connect Campaign name. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 UpdateCampaignNameInput) 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 UpdateCampaignNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCampaignNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCampaignNameInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *UpdateCampaignNameInput) SetId(v string) *UpdateCampaignNameInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCampaignNameInput) SetName(v string) *UpdateCampaignNameInput { - s.Name = &v - return s -} - -type UpdateCampaignNameOutput 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 UpdateCampaignNameOutput) 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 UpdateCampaignNameOutput) GoString() string { - return s.String() -} - -// UpdateCampaignOutboundCallConfigRequest -type UpdateCampaignOutboundCallConfigInput struct { - _ struct{} `type:"structure"` - - // Answering Machine Detection config - AnswerMachineDetectionConfig *AnswerMachineDetectionConfig `locationName:"answerMachineDetectionConfig" type:"structure"` - - // The identifier of the contact flow for the outbound call. - ConnectContactFlowId *string `locationName:"connectContactFlowId" type:"string"` - - // The phone number associated with the Amazon Connect instance, in E.164 format. - // If you do not specify a source phone number, you must specify a queue. - ConnectSourcePhoneNumber *string `locationName:"connectSourcePhoneNumber" type:"string"` - - // Identifier representing a Campaign - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 UpdateCampaignOutboundCallConfigInput) 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 UpdateCampaignOutboundCallConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCampaignOutboundCallConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCampaignOutboundCallConfigInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.AnswerMachineDetectionConfig != nil { - if err := s.AnswerMachineDetectionConfig.Validate(); err != nil { - invalidParams.AddNested("AnswerMachineDetectionConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnswerMachineDetectionConfig sets the AnswerMachineDetectionConfig field's value. -func (s *UpdateCampaignOutboundCallConfigInput) SetAnswerMachineDetectionConfig(v *AnswerMachineDetectionConfig) *UpdateCampaignOutboundCallConfigInput { - s.AnswerMachineDetectionConfig = v - return s -} - -// SetConnectContactFlowId sets the ConnectContactFlowId field's value. -func (s *UpdateCampaignOutboundCallConfigInput) SetConnectContactFlowId(v string) *UpdateCampaignOutboundCallConfigInput { - s.ConnectContactFlowId = &v - return s -} - -// SetConnectSourcePhoneNumber sets the ConnectSourcePhoneNumber field's value. -func (s *UpdateCampaignOutboundCallConfigInput) SetConnectSourcePhoneNumber(v string) *UpdateCampaignOutboundCallConfigInput { - s.ConnectSourcePhoneNumber = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateCampaignOutboundCallConfigInput) SetId(v string) *UpdateCampaignOutboundCallConfigInput { - s.Id = &v - return s -} - -type UpdateCampaignOutboundCallConfigOutput 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 UpdateCampaignOutboundCallConfigOutput) 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 UpdateCampaignOutboundCallConfigOutput) GoString() string { - return s.String() -} - -// The input fails to satisfy the constraints specified by an AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // A header that defines the error encountered while processing the request. - XAmzErrorType *string `location:"header" locationName:"x-amzn-ErrorType" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// State of a campaign -const ( - // CampaignStateInitialized is a CampaignState enum value - CampaignStateInitialized = "Initialized" - - // CampaignStateRunning is a CampaignState enum value - CampaignStateRunning = "Running" - - // CampaignStatePaused is a CampaignState enum value - CampaignStatePaused = "Paused" - - // CampaignStateStopped is a CampaignState enum value - CampaignStateStopped = "Stopped" - - // CampaignStateFailed is a CampaignState enum value - CampaignStateFailed = "Failed" -) - -// CampaignState_Values returns all elements of the CampaignState enum -func CampaignState_Values() []string { - return []string{ - CampaignStateInitialized, - CampaignStateRunning, - CampaignStatePaused, - CampaignStateStopped, - CampaignStateFailed, - } -} - -// Server-side encryption type. -const ( - // EncryptionTypeKms is a EncryptionType enum value - EncryptionTypeKms = "KMS" -) - -// EncryptionType_Values returns all elements of the EncryptionType enum -func EncryptionType_Values() []string { - return []string{ - EncryptionTypeKms, - } -} - -// A predefined code indicating the error that caused the failure. -const ( - // FailureCodeInvalidInput is a FailureCode enum value - FailureCodeInvalidInput = "InvalidInput" - - // FailureCodeRequestThrottled is a FailureCode enum value - FailureCodeRequestThrottled = "RequestThrottled" - - // FailureCodeUnknownError is a FailureCode enum value - FailureCodeUnknownError = "UnknownError" -) - -// FailureCode_Values returns all elements of the FailureCode enum -func FailureCode_Values() []string { - return []string{ - FailureCodeInvalidInput, - FailureCodeRequestThrottled, - FailureCodeUnknownError, - } -} - -// A predefined code indicating the error that caused the failure in getting -// state of campaigns -const ( - // GetCampaignStateBatchFailureCodeResourceNotFound is a GetCampaignStateBatchFailureCode enum value - GetCampaignStateBatchFailureCodeResourceNotFound = "ResourceNotFound" - - // GetCampaignStateBatchFailureCodeUnknownError is a GetCampaignStateBatchFailureCode enum value - GetCampaignStateBatchFailureCodeUnknownError = "UnknownError" -) - -// GetCampaignStateBatchFailureCode_Values returns all elements of the GetCampaignStateBatchFailureCode enum -func GetCampaignStateBatchFailureCode_Values() []string { - return []string{ - GetCampaignStateBatchFailureCodeResourceNotFound, - GetCampaignStateBatchFailureCodeUnknownError, - } -} - -// Operators for Connect instance identifier filter -const ( - // InstanceIdFilterOperatorEq is a InstanceIdFilterOperator enum value - InstanceIdFilterOperatorEq = "Eq" -) - -// InstanceIdFilterOperator_Values returns all elements of the InstanceIdFilterOperator enum -func InstanceIdFilterOperator_Values() []string { - return []string{ - InstanceIdFilterOperatorEq, - } -} - -// Enumeration of the possible failure codes for instance onboarding job -const ( - // InstanceOnboardingJobFailureCodeEventBridgeAccessDenied is a InstanceOnboardingJobFailureCode enum value - InstanceOnboardingJobFailureCodeEventBridgeAccessDenied = "EVENT_BRIDGE_ACCESS_DENIED" - - // InstanceOnboardingJobFailureCodeEventBridgeManagedRuleLimitExceeded is a InstanceOnboardingJobFailureCode enum value - InstanceOnboardingJobFailureCodeEventBridgeManagedRuleLimitExceeded = "EVENT_BRIDGE_MANAGED_RULE_LIMIT_EXCEEDED" - - // InstanceOnboardingJobFailureCodeIamAccessDenied is a InstanceOnboardingJobFailureCode enum value - InstanceOnboardingJobFailureCodeIamAccessDenied = "IAM_ACCESS_DENIED" - - // InstanceOnboardingJobFailureCodeKmsAccessDenied is a InstanceOnboardingJobFailureCode enum value - InstanceOnboardingJobFailureCodeKmsAccessDenied = "KMS_ACCESS_DENIED" - - // InstanceOnboardingJobFailureCodeKmsKeyNotFound is a InstanceOnboardingJobFailureCode enum value - InstanceOnboardingJobFailureCodeKmsKeyNotFound = "KMS_KEY_NOT_FOUND" - - // InstanceOnboardingJobFailureCodeInternalFailure is a InstanceOnboardingJobFailureCode enum value - InstanceOnboardingJobFailureCodeInternalFailure = "INTERNAL_FAILURE" -) - -// InstanceOnboardingJobFailureCode_Values returns all elements of the InstanceOnboardingJobFailureCode enum -func InstanceOnboardingJobFailureCode_Values() []string { - return []string{ - InstanceOnboardingJobFailureCodeEventBridgeAccessDenied, - InstanceOnboardingJobFailureCodeEventBridgeManagedRuleLimitExceeded, - InstanceOnboardingJobFailureCodeIamAccessDenied, - InstanceOnboardingJobFailureCodeKmsAccessDenied, - InstanceOnboardingJobFailureCodeKmsKeyNotFound, - InstanceOnboardingJobFailureCodeInternalFailure, - } -} - -// Enumeration of the possible states for instance onboarding job -const ( - // InstanceOnboardingJobStatusCodeInProgress is a InstanceOnboardingJobStatusCode enum value - InstanceOnboardingJobStatusCodeInProgress = "IN_PROGRESS" - - // InstanceOnboardingJobStatusCodeSucceeded is a InstanceOnboardingJobStatusCode enum value - InstanceOnboardingJobStatusCodeSucceeded = "SUCCEEDED" - - // InstanceOnboardingJobStatusCodeFailed is a InstanceOnboardingJobStatusCode enum value - InstanceOnboardingJobStatusCodeFailed = "FAILED" -) - -// InstanceOnboardingJobStatusCode_Values returns all elements of the InstanceOnboardingJobStatusCode enum -func InstanceOnboardingJobStatusCode_Values() []string { - return []string{ - InstanceOnboardingJobStatusCodeInProgress, - InstanceOnboardingJobStatusCodeSucceeded, - InstanceOnboardingJobStatusCodeFailed, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/connectcampaignsiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/connectcampaignsiface/interface.go deleted file mode 100644 index 21d9fa20d8d9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/connectcampaignsiface/interface.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package connectcampaignsiface provides an interface to enable mocking the AmazonConnectCampaignService service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package connectcampaignsiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns" -) - -// ConnectCampaignsAPI provides an interface to enable mocking the -// connectcampaigns.ConnectCampaigns service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AmazonConnectCampaignService. -// func myFunc(svc connectcampaignsiface.ConnectCampaignsAPI) bool { -// // Make svc.CreateCampaign request -// } -// -// func main() { -// sess := session.New() -// svc := connectcampaigns.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockConnectCampaignsClient struct { -// connectcampaignsiface.ConnectCampaignsAPI -// } -// func (m *mockConnectCampaignsClient) CreateCampaign(input *connectcampaigns.CreateCampaignInput) (*connectcampaigns.CreateCampaignOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockConnectCampaignsClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type ConnectCampaignsAPI interface { - CreateCampaign(*connectcampaigns.CreateCampaignInput) (*connectcampaigns.CreateCampaignOutput, error) - CreateCampaignWithContext(aws.Context, *connectcampaigns.CreateCampaignInput, ...request.Option) (*connectcampaigns.CreateCampaignOutput, error) - CreateCampaignRequest(*connectcampaigns.CreateCampaignInput) (*request.Request, *connectcampaigns.CreateCampaignOutput) - - DeleteCampaign(*connectcampaigns.DeleteCampaignInput) (*connectcampaigns.DeleteCampaignOutput, error) - DeleteCampaignWithContext(aws.Context, *connectcampaigns.DeleteCampaignInput, ...request.Option) (*connectcampaigns.DeleteCampaignOutput, error) - DeleteCampaignRequest(*connectcampaigns.DeleteCampaignInput) (*request.Request, *connectcampaigns.DeleteCampaignOutput) - - DeleteConnectInstanceConfig(*connectcampaigns.DeleteConnectInstanceConfigInput) (*connectcampaigns.DeleteConnectInstanceConfigOutput, error) - DeleteConnectInstanceConfigWithContext(aws.Context, *connectcampaigns.DeleteConnectInstanceConfigInput, ...request.Option) (*connectcampaigns.DeleteConnectInstanceConfigOutput, error) - DeleteConnectInstanceConfigRequest(*connectcampaigns.DeleteConnectInstanceConfigInput) (*request.Request, *connectcampaigns.DeleteConnectInstanceConfigOutput) - - DeleteInstanceOnboardingJob(*connectcampaigns.DeleteInstanceOnboardingJobInput) (*connectcampaigns.DeleteInstanceOnboardingJobOutput, error) - DeleteInstanceOnboardingJobWithContext(aws.Context, *connectcampaigns.DeleteInstanceOnboardingJobInput, ...request.Option) (*connectcampaigns.DeleteInstanceOnboardingJobOutput, error) - DeleteInstanceOnboardingJobRequest(*connectcampaigns.DeleteInstanceOnboardingJobInput) (*request.Request, *connectcampaigns.DeleteInstanceOnboardingJobOutput) - - DescribeCampaign(*connectcampaigns.DescribeCampaignInput) (*connectcampaigns.DescribeCampaignOutput, error) - DescribeCampaignWithContext(aws.Context, *connectcampaigns.DescribeCampaignInput, ...request.Option) (*connectcampaigns.DescribeCampaignOutput, error) - DescribeCampaignRequest(*connectcampaigns.DescribeCampaignInput) (*request.Request, *connectcampaigns.DescribeCampaignOutput) - - GetCampaignState(*connectcampaigns.GetCampaignStateInput) (*connectcampaigns.GetCampaignStateOutput, error) - GetCampaignStateWithContext(aws.Context, *connectcampaigns.GetCampaignStateInput, ...request.Option) (*connectcampaigns.GetCampaignStateOutput, error) - GetCampaignStateRequest(*connectcampaigns.GetCampaignStateInput) (*request.Request, *connectcampaigns.GetCampaignStateOutput) - - GetCampaignStateBatch(*connectcampaigns.GetCampaignStateBatchInput) (*connectcampaigns.GetCampaignStateBatchOutput, error) - GetCampaignStateBatchWithContext(aws.Context, *connectcampaigns.GetCampaignStateBatchInput, ...request.Option) (*connectcampaigns.GetCampaignStateBatchOutput, error) - GetCampaignStateBatchRequest(*connectcampaigns.GetCampaignStateBatchInput) (*request.Request, *connectcampaigns.GetCampaignStateBatchOutput) - - GetConnectInstanceConfig(*connectcampaigns.GetConnectInstanceConfigInput) (*connectcampaigns.GetConnectInstanceConfigOutput, error) - GetConnectInstanceConfigWithContext(aws.Context, *connectcampaigns.GetConnectInstanceConfigInput, ...request.Option) (*connectcampaigns.GetConnectInstanceConfigOutput, error) - GetConnectInstanceConfigRequest(*connectcampaigns.GetConnectInstanceConfigInput) (*request.Request, *connectcampaigns.GetConnectInstanceConfigOutput) - - GetInstanceOnboardingJobStatus(*connectcampaigns.GetInstanceOnboardingJobStatusInput) (*connectcampaigns.GetInstanceOnboardingJobStatusOutput, error) - GetInstanceOnboardingJobStatusWithContext(aws.Context, *connectcampaigns.GetInstanceOnboardingJobStatusInput, ...request.Option) (*connectcampaigns.GetInstanceOnboardingJobStatusOutput, error) - GetInstanceOnboardingJobStatusRequest(*connectcampaigns.GetInstanceOnboardingJobStatusInput) (*request.Request, *connectcampaigns.GetInstanceOnboardingJobStatusOutput) - - ListCampaigns(*connectcampaigns.ListCampaignsInput) (*connectcampaigns.ListCampaignsOutput, error) - ListCampaignsWithContext(aws.Context, *connectcampaigns.ListCampaignsInput, ...request.Option) (*connectcampaigns.ListCampaignsOutput, error) - ListCampaignsRequest(*connectcampaigns.ListCampaignsInput) (*request.Request, *connectcampaigns.ListCampaignsOutput) - - ListCampaignsPages(*connectcampaigns.ListCampaignsInput, func(*connectcampaigns.ListCampaignsOutput, bool) bool) error - ListCampaignsPagesWithContext(aws.Context, *connectcampaigns.ListCampaignsInput, func(*connectcampaigns.ListCampaignsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*connectcampaigns.ListTagsForResourceInput) (*connectcampaigns.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *connectcampaigns.ListTagsForResourceInput, ...request.Option) (*connectcampaigns.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*connectcampaigns.ListTagsForResourceInput) (*request.Request, *connectcampaigns.ListTagsForResourceOutput) - - PauseCampaign(*connectcampaigns.PauseCampaignInput) (*connectcampaigns.PauseCampaignOutput, error) - PauseCampaignWithContext(aws.Context, *connectcampaigns.PauseCampaignInput, ...request.Option) (*connectcampaigns.PauseCampaignOutput, error) - PauseCampaignRequest(*connectcampaigns.PauseCampaignInput) (*request.Request, *connectcampaigns.PauseCampaignOutput) - - PutDialRequestBatch(*connectcampaigns.PutDialRequestBatchInput) (*connectcampaigns.PutDialRequestBatchOutput, error) - PutDialRequestBatchWithContext(aws.Context, *connectcampaigns.PutDialRequestBatchInput, ...request.Option) (*connectcampaigns.PutDialRequestBatchOutput, error) - PutDialRequestBatchRequest(*connectcampaigns.PutDialRequestBatchInput) (*request.Request, *connectcampaigns.PutDialRequestBatchOutput) - - ResumeCampaign(*connectcampaigns.ResumeCampaignInput) (*connectcampaigns.ResumeCampaignOutput, error) - ResumeCampaignWithContext(aws.Context, *connectcampaigns.ResumeCampaignInput, ...request.Option) (*connectcampaigns.ResumeCampaignOutput, error) - ResumeCampaignRequest(*connectcampaigns.ResumeCampaignInput) (*request.Request, *connectcampaigns.ResumeCampaignOutput) - - StartCampaign(*connectcampaigns.StartCampaignInput) (*connectcampaigns.StartCampaignOutput, error) - StartCampaignWithContext(aws.Context, *connectcampaigns.StartCampaignInput, ...request.Option) (*connectcampaigns.StartCampaignOutput, error) - StartCampaignRequest(*connectcampaigns.StartCampaignInput) (*request.Request, *connectcampaigns.StartCampaignOutput) - - StartInstanceOnboardingJob(*connectcampaigns.StartInstanceOnboardingJobInput) (*connectcampaigns.StartInstanceOnboardingJobOutput, error) - StartInstanceOnboardingJobWithContext(aws.Context, *connectcampaigns.StartInstanceOnboardingJobInput, ...request.Option) (*connectcampaigns.StartInstanceOnboardingJobOutput, error) - StartInstanceOnboardingJobRequest(*connectcampaigns.StartInstanceOnboardingJobInput) (*request.Request, *connectcampaigns.StartInstanceOnboardingJobOutput) - - StopCampaign(*connectcampaigns.StopCampaignInput) (*connectcampaigns.StopCampaignOutput, error) - StopCampaignWithContext(aws.Context, *connectcampaigns.StopCampaignInput, ...request.Option) (*connectcampaigns.StopCampaignOutput, error) - StopCampaignRequest(*connectcampaigns.StopCampaignInput) (*request.Request, *connectcampaigns.StopCampaignOutput) - - TagResource(*connectcampaigns.TagResourceInput) (*connectcampaigns.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *connectcampaigns.TagResourceInput, ...request.Option) (*connectcampaigns.TagResourceOutput, error) - TagResourceRequest(*connectcampaigns.TagResourceInput) (*request.Request, *connectcampaigns.TagResourceOutput) - - UntagResource(*connectcampaigns.UntagResourceInput) (*connectcampaigns.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *connectcampaigns.UntagResourceInput, ...request.Option) (*connectcampaigns.UntagResourceOutput, error) - UntagResourceRequest(*connectcampaigns.UntagResourceInput) (*request.Request, *connectcampaigns.UntagResourceOutput) - - UpdateCampaignDialerConfig(*connectcampaigns.UpdateCampaignDialerConfigInput) (*connectcampaigns.UpdateCampaignDialerConfigOutput, error) - UpdateCampaignDialerConfigWithContext(aws.Context, *connectcampaigns.UpdateCampaignDialerConfigInput, ...request.Option) (*connectcampaigns.UpdateCampaignDialerConfigOutput, error) - UpdateCampaignDialerConfigRequest(*connectcampaigns.UpdateCampaignDialerConfigInput) (*request.Request, *connectcampaigns.UpdateCampaignDialerConfigOutput) - - UpdateCampaignName(*connectcampaigns.UpdateCampaignNameInput) (*connectcampaigns.UpdateCampaignNameOutput, error) - UpdateCampaignNameWithContext(aws.Context, *connectcampaigns.UpdateCampaignNameInput, ...request.Option) (*connectcampaigns.UpdateCampaignNameOutput, error) - UpdateCampaignNameRequest(*connectcampaigns.UpdateCampaignNameInput) (*request.Request, *connectcampaigns.UpdateCampaignNameOutput) - - UpdateCampaignOutboundCallConfig(*connectcampaigns.UpdateCampaignOutboundCallConfigInput) (*connectcampaigns.UpdateCampaignOutboundCallConfigOutput, error) - UpdateCampaignOutboundCallConfigWithContext(aws.Context, *connectcampaigns.UpdateCampaignOutboundCallConfigInput, ...request.Option) (*connectcampaigns.UpdateCampaignOutboundCallConfigOutput, error) - UpdateCampaignOutboundCallConfigRequest(*connectcampaigns.UpdateCampaignOutboundCallConfigInput) (*request.Request, *connectcampaigns.UpdateCampaignOutboundCallConfigOutput) -} - -var _ ConnectCampaignsAPI = (*connectcampaigns.ConnectCampaigns)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/doc.go deleted file mode 100644 index 0532a026f1af..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package connectcampaigns provides the client and types for making API -// requests to AmazonConnectCampaignService. -// -// Provide APIs to create and manage Amazon Connect Campaigns. -// -// See https://docs.aws.amazon.com/goto/WebAPI/connectcampaigns-2021-01-30 for more information on this service. -// -// See connectcampaigns package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/connectcampaigns/ -// -// # Using the Client -// -// To contact AmazonConnectCampaignService with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AmazonConnectCampaignService client ConnectCampaigns for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/connectcampaigns/#New -package connectcampaigns diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/errors.go deleted file mode 100644 index feabf5144ec2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/errors.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package connectcampaigns - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request could not be processed because of conflict in the current state - // of the resource. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Request processing failed because of an error or failure with the service. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeInvalidCampaignStateException for service response error code - // "InvalidCampaignStateException". - // - // The request could not be processed because of conflict in the current state - // of the campaign. - ErrCodeInvalidCampaignStateException = "InvalidCampaignStateException" - - // ErrCodeInvalidStateException for service response error code - // "InvalidStateException". - // - // The request could not be processed because of conflict in the current state. - ErrCodeInvalidStateException = "InvalidStateException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Request would cause a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "InvalidCampaignStateException": newErrorInvalidCampaignStateException, - "InvalidStateException": newErrorInvalidStateException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/service.go deleted file mode 100644 index 23631d32654b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcampaigns/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package connectcampaigns - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// ConnectCampaigns provides the API operation methods for making requests to -// AmazonConnectCampaignService. See this package's package overview docs -// for details on the service. -// -// ConnectCampaigns methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ConnectCampaigns struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ConnectCampaigns" // Name of service. - EndpointsID = "connect-campaigns" // ID to lookup a service endpoint with. - ServiceID = "ConnectCampaigns" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the ConnectCampaigns client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a ConnectCampaigns client from just a session. -// svc := connectcampaigns.New(mySession) -// -// // Create a ConnectCampaigns client with additional configuration -// svc := connectcampaigns.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ConnectCampaigns { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "connect-campaigns" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ConnectCampaigns { - svc := &ConnectCampaigns{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-01-30", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ConnectCampaigns operation and runs any -// custom request initialization. -func (c *ConnectCampaigns) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/api.go deleted file mode 100644 index b97dda0e6bcc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/api.go +++ /dev/null @@ -1,10145 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package connectcases - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opBatchGetField = "BatchGetField" - -// BatchGetFieldRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetField 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 BatchGetField for more information on using the BatchGetField -// 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 BatchGetFieldRequest method. -// req, resp := client.BatchGetFieldRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/BatchGetField -func (c *ConnectCases) BatchGetFieldRequest(input *BatchGetFieldInput) (req *request.Request, output *BatchGetFieldOutput) { - op := &request.Operation{ - Name: opBatchGetField, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/fields-batch", - } - - if input == nil { - input = &BatchGetFieldInput{} - } - - output = &BatchGetFieldOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetField API operation for Amazon Connect Cases. -// -// Returns the description for the list of fields in the request parameters. -// -// 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 Connect Cases's -// API operation BatchGetField for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/BatchGetField -func (c *ConnectCases) BatchGetField(input *BatchGetFieldInput) (*BatchGetFieldOutput, error) { - req, out := c.BatchGetFieldRequest(input) - return out, req.Send() -} - -// BatchGetFieldWithContext is the same as BatchGetField with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetField 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 *ConnectCases) BatchGetFieldWithContext(ctx aws.Context, input *BatchGetFieldInput, opts ...request.Option) (*BatchGetFieldOutput, error) { - req, out := c.BatchGetFieldRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchPutFieldOptions = "BatchPutFieldOptions" - -// BatchPutFieldOptionsRequest generates a "aws/request.Request" representing the -// client's request for the BatchPutFieldOptions 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 BatchPutFieldOptions for more information on using the BatchPutFieldOptions -// 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 BatchPutFieldOptionsRequest method. -// req, resp := client.BatchPutFieldOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/BatchPutFieldOptions -func (c *ConnectCases) BatchPutFieldOptionsRequest(input *BatchPutFieldOptionsInput) (req *request.Request, output *BatchPutFieldOptionsOutput) { - op := &request.Operation{ - Name: opBatchPutFieldOptions, - HTTPMethod: "PUT", - HTTPPath: "/domains/{domainId}/fields/{fieldId}/options", - } - - if input == nil { - input = &BatchPutFieldOptionsInput{} - } - - output = &BatchPutFieldOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchPutFieldOptions API operation for Amazon Connect Cases. -// -// Creates and updates a set of field options for a single select field in a -// Cases domain. -// -// 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 Connect Cases's -// API operation BatchPutFieldOptions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded. For a list of service quotas, see Amazon -// Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) -// in the Amazon Connect Administrator Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/BatchPutFieldOptions -func (c *ConnectCases) BatchPutFieldOptions(input *BatchPutFieldOptionsInput) (*BatchPutFieldOptionsOutput, error) { - req, out := c.BatchPutFieldOptionsRequest(input) - return out, req.Send() -} - -// BatchPutFieldOptionsWithContext is the same as BatchPutFieldOptions with the addition of -// the ability to pass a context and additional request options. -// -// See BatchPutFieldOptions 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 *ConnectCases) BatchPutFieldOptionsWithContext(ctx aws.Context, input *BatchPutFieldOptionsInput, opts ...request.Option) (*BatchPutFieldOptionsOutput, error) { - req, out := c.BatchPutFieldOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateCase = "CreateCase" - -// CreateCaseRequest generates a "aws/request.Request" representing the -// client's request for the CreateCase 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 CreateCase for more information on using the CreateCase -// 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 CreateCaseRequest method. -// req, resp := client.CreateCaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateCase -func (c *ConnectCases) CreateCaseRequest(input *CreateCaseInput) (req *request.Request, output *CreateCaseOutput) { - op := &request.Operation{ - Name: opCreateCase, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/cases", - } - - if input == nil { - input = &CreateCaseInput{} - } - - output = &CreateCaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCase API operation for Amazon Connect Cases. -// -// Creates a case in the specified Cases domain. Case system and custom fields -// are taken as an array id/value pairs with a declared data types. -// -// The following fields are required when creating a case: -// -//
  • customer_id - You must provide the full customer -// profile ARN in this format: arn:aws:profile:your_AWS_Region:your_AWS_account -// ID:domains/your_profiles_domain_name/profiles/profile_ID

  • -//
  • title

-// -// 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 Connect Cases's -// API operation CreateCase for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateCase -func (c *ConnectCases) CreateCase(input *CreateCaseInput) (*CreateCaseOutput, error) { - req, out := c.CreateCaseRequest(input) - return out, req.Send() -} - -// CreateCaseWithContext is the same as CreateCase with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCase 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 *ConnectCases) CreateCaseWithContext(ctx aws.Context, input *CreateCaseInput, opts ...request.Option) (*CreateCaseOutput, error) { - req, out := c.CreateCaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDomain = "CreateDomain" - -// CreateDomainRequest generates a "aws/request.Request" representing the -// client's request for the CreateDomain 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 CreateDomain for more information on using the CreateDomain -// 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 CreateDomainRequest method. -// req, resp := client.CreateDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateDomain -func (c *ConnectCases) CreateDomainRequest(input *CreateDomainInput) (req *request.Request, output *CreateDomainOutput) { - op := &request.Operation{ - Name: opCreateDomain, - HTTPMethod: "POST", - HTTPPath: "/domains", - } - - if input == nil { - input = &CreateDomainInput{} - } - - output = &CreateDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDomain API operation for Amazon Connect Cases. -// -// Creates a domain, which is a container for all case data, such as cases, -// fields, templates and layouts. Each Amazon Connect instance can be associated -// with only one Cases domain. -// -// This will not associate your connect instance to Cases domain. Instead, use -// the Amazon Connect CreateIntegrationAssociation (https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateIntegrationAssociation.html) -// API. You need specific IAM permissions to successfully associate the Cases -// domain. For more information, see Onboard to Cases (https://docs.aws.amazon.com/connect/latest/adminguide/required-permissions-iam-cases.html#onboard-cases-iam). -// -// -// -// 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 Connect Cases's -// API operation CreateDomain for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded. For a list of service quotas, see Amazon -// Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) -// in the Amazon Connect Administrator Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateDomain -func (c *ConnectCases) CreateDomain(input *CreateDomainInput) (*CreateDomainOutput, error) { - req, out := c.CreateDomainRequest(input) - return out, req.Send() -} - -// CreateDomainWithContext is the same as CreateDomain with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDomain 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 *ConnectCases) CreateDomainWithContext(ctx aws.Context, input *CreateDomainInput, opts ...request.Option) (*CreateDomainOutput, error) { - req, out := c.CreateDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateField = "CreateField" - -// CreateFieldRequest generates a "aws/request.Request" representing the -// client's request for the CreateField 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 CreateField for more information on using the CreateField -// 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 CreateFieldRequest method. -// req, resp := client.CreateFieldRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateField -func (c *ConnectCases) CreateFieldRequest(input *CreateFieldInput) (req *request.Request, output *CreateFieldOutput) { - op := &request.Operation{ - Name: opCreateField, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/fields", - } - - if input == nil { - input = &CreateFieldInput{} - } - - output = &CreateFieldOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateField API operation for Amazon Connect Cases. -// -// Creates a field in the Cases domain. This field is used to define the case -// object model (that is, defines what data can be captured on cases) in a Cases -// domain. -// -// 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 Connect Cases's -// API operation CreateField for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded. For a list of service quotas, see Amazon -// Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) -// in the Amazon Connect Administrator Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateField -func (c *ConnectCases) CreateField(input *CreateFieldInput) (*CreateFieldOutput, error) { - req, out := c.CreateFieldRequest(input) - return out, req.Send() -} - -// CreateFieldWithContext is the same as CreateField with the addition of -// the ability to pass a context and additional request options. -// -// See CreateField 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 *ConnectCases) CreateFieldWithContext(ctx aws.Context, input *CreateFieldInput, opts ...request.Option) (*CreateFieldOutput, error) { - req, out := c.CreateFieldRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateLayout = "CreateLayout" - -// CreateLayoutRequest generates a "aws/request.Request" representing the -// client's request for the CreateLayout 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 CreateLayout for more information on using the CreateLayout -// 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 CreateLayoutRequest method. -// req, resp := client.CreateLayoutRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateLayout -func (c *ConnectCases) CreateLayoutRequest(input *CreateLayoutInput) (req *request.Request, output *CreateLayoutOutput) { - op := &request.Operation{ - Name: opCreateLayout, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/layouts", - } - - if input == nil { - input = &CreateLayoutInput{} - } - - output = &CreateLayoutOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLayout API operation for Amazon Connect Cases. -// -// Creates a layout in the Cases domain. Layouts define the following configuration -// in the top section and More Info tab of the Cases user interface: -// -// - Fields to display to the users -// -// - Field ordering -// -// Title and Status fields cannot be part of layouts since they are not configurable. -// -// 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 Connect Cases's -// API operation CreateLayout for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded. For a list of service quotas, see Amazon -// Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) -// in the Amazon Connect Administrator Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateLayout -func (c *ConnectCases) CreateLayout(input *CreateLayoutInput) (*CreateLayoutOutput, error) { - req, out := c.CreateLayoutRequest(input) - return out, req.Send() -} - -// CreateLayoutWithContext is the same as CreateLayout with the addition of -// the ability to pass a context and additional request options. -// -// See CreateLayout 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 *ConnectCases) CreateLayoutWithContext(ctx aws.Context, input *CreateLayoutInput, opts ...request.Option) (*CreateLayoutOutput, error) { - req, out := c.CreateLayoutRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRelatedItem = "CreateRelatedItem" - -// CreateRelatedItemRequest generates a "aws/request.Request" representing the -// client's request for the CreateRelatedItem 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 CreateRelatedItem for more information on using the CreateRelatedItem -// 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 CreateRelatedItemRequest method. -// req, resp := client.CreateRelatedItemRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateRelatedItem -func (c *ConnectCases) CreateRelatedItemRequest(input *CreateRelatedItemInput) (req *request.Request, output *CreateRelatedItemOutput) { - op := &request.Operation{ - Name: opCreateRelatedItem, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/cases/{caseId}/related-items/", - } - - if input == nil { - input = &CreateRelatedItemInput{} - } - - output = &CreateRelatedItemOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRelatedItem API operation for Amazon Connect Cases. -// -// Creates a related item (comments, tasks, and contacts) and associates it -// with a case. -// -// - A Related Item is a resource that is associated with a case. It may -// or may not have an external identifier linking it to an external resource -// (for example, a contactArn). All Related Items have their own internal -// identifier, the relatedItemArn. Examples of related items include comments -// and contacts. -// -// - If you provide a value for performedBy.userArn you must also have DescribeUser -// (https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html) -// permission on the ARN of the user that you provide. -// -// -// -// 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 Connect Cases's -// API operation CreateRelatedItem for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded. For a list of service quotas, see Amazon -// Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) -// in the Amazon Connect Administrator Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateRelatedItem -func (c *ConnectCases) CreateRelatedItem(input *CreateRelatedItemInput) (*CreateRelatedItemOutput, error) { - req, out := c.CreateRelatedItemRequest(input) - return out, req.Send() -} - -// CreateRelatedItemWithContext is the same as CreateRelatedItem with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRelatedItem 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 *ConnectCases) CreateRelatedItemWithContext(ctx aws.Context, input *CreateRelatedItemInput, opts ...request.Option) (*CreateRelatedItemOutput, error) { - req, out := c.CreateRelatedItemRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTemplate = "CreateTemplate" - -// CreateTemplateRequest generates a "aws/request.Request" representing the -// client's request for the CreateTemplate 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 CreateTemplate for more information on using the CreateTemplate -// 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 CreateTemplateRequest method. -// req, resp := client.CreateTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateTemplate -func (c *ConnectCases) CreateTemplateRequest(input *CreateTemplateInput) (req *request.Request, output *CreateTemplateOutput) { - op := &request.Operation{ - Name: opCreateTemplate, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/templates", - } - - if input == nil { - input = &CreateTemplateInput{} - } - - output = &CreateTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTemplate API operation for Amazon Connect Cases. -// -// Creates a template in the Cases domain. This template is used to define the -// case object model (that is, to define what data can be captured on cases) -// in a Cases domain. A template must have a unique name within a domain, and -// it must reference existing field IDs and layout IDs. Additionally, multiple -// fields with same IDs are not allowed within the same Template. A template -// can be either Active or Inactive, as indicated by its status. Inactive templates -// cannot be used to create cases. -// -// 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 Connect Cases's -// API operation CreateTemplate for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded. For a list of service quotas, see Amazon -// Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) -// in the Amazon Connect Administrator Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateTemplate -func (c *ConnectCases) CreateTemplate(input *CreateTemplateInput) (*CreateTemplateOutput, error) { - req, out := c.CreateTemplateRequest(input) - return out, req.Send() -} - -// CreateTemplateWithContext is the same as CreateTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTemplate 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 *ConnectCases) CreateTemplateWithContext(ctx aws.Context, input *CreateTemplateInput, opts ...request.Option) (*CreateTemplateOutput, error) { - req, out := c.CreateTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDomain = "DeleteDomain" - -// DeleteDomainRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDomain 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 DeleteDomain for more information on using the DeleteDomain -// 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 DeleteDomainRequest method. -// req, resp := client.DeleteDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/DeleteDomain -func (c *ConnectCases) DeleteDomainRequest(input *DeleteDomainInput) (req *request.Request, output *DeleteDomainOutput) { - op := &request.Operation{ - Name: opDeleteDomain, - HTTPMethod: "DELETE", - HTTPPath: "/domains/{domainId}", - } - - if input == nil { - input = &DeleteDomainInput{} - } - - output = &DeleteDomainOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDomain API operation for Amazon Connect Cases. -// -// Deletes a Cases domain. -// -//

After deleting your domain you must disassociate the deleted -// domain from your Amazon Connect instance with another API call before -// being able to use Cases again with this Amazon Connect instance. See DeleteIntegrationAssociation.

-//
-// -// 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 Connect Cases's -// API operation DeleteDomain for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/DeleteDomain -func (c *ConnectCases) DeleteDomain(input *DeleteDomainInput) (*DeleteDomainOutput, error) { - req, out := c.DeleteDomainRequest(input) - return out, req.Send() -} - -// DeleteDomainWithContext is the same as DeleteDomain with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDomain 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 *ConnectCases) DeleteDomainWithContext(ctx aws.Context, input *DeleteDomainInput, opts ...request.Option) (*DeleteDomainOutput, error) { - req, out := c.DeleteDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCase = "GetCase" - -// GetCaseRequest generates a "aws/request.Request" representing the -// client's request for the GetCase 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 GetCase for more information on using the GetCase -// 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 GetCaseRequest method. -// req, resp := client.GetCaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetCase -func (c *ConnectCases) GetCaseRequest(input *GetCaseInput) (req *request.Request, output *GetCaseOutput) { - op := &request.Operation{ - Name: opGetCase, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/cases/{caseId}", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetCaseInput{} - } - - output = &GetCaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCase API operation for Amazon Connect Cases. -// -// Returns information about a specific case if it exists. -// -// 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 Connect Cases's -// API operation GetCase for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetCase -func (c *ConnectCases) GetCase(input *GetCaseInput) (*GetCaseOutput, error) { - req, out := c.GetCaseRequest(input) - return out, req.Send() -} - -// GetCaseWithContext is the same as GetCase with the addition of -// the ability to pass a context and additional request options. -// -// See GetCase 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 *ConnectCases) GetCaseWithContext(ctx aws.Context, input *GetCaseInput, opts ...request.Option) (*GetCaseOutput, error) { - req, out := c.GetCaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetCasePages iterates over the pages of a GetCase operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetCase method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetCase operation. -// pageNum := 0 -// err := client.GetCasePages(params, -// func(page *connectcases.GetCaseOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) GetCasePages(input *GetCaseInput, fn func(*GetCaseOutput, bool) bool) error { - return c.GetCasePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetCasePagesWithContext same as GetCasePages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) GetCasePagesWithContext(ctx aws.Context, input *GetCaseInput, fn func(*GetCaseOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetCaseInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetCaseRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetCaseOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetCaseEventConfiguration = "GetCaseEventConfiguration" - -// GetCaseEventConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetCaseEventConfiguration 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 GetCaseEventConfiguration for more information on using the GetCaseEventConfiguration -// 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 GetCaseEventConfigurationRequest method. -// req, resp := client.GetCaseEventConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetCaseEventConfiguration -func (c *ConnectCases) GetCaseEventConfigurationRequest(input *GetCaseEventConfigurationInput) (req *request.Request, output *GetCaseEventConfigurationOutput) { - op := &request.Operation{ - Name: opGetCaseEventConfiguration, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/case-event-configuration", - } - - if input == nil { - input = &GetCaseEventConfigurationInput{} - } - - output = &GetCaseEventConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCaseEventConfiguration API operation for Amazon Connect Cases. -// -// Returns the case event publishing configuration. -// -// 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 Connect Cases's -// API operation GetCaseEventConfiguration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetCaseEventConfiguration -func (c *ConnectCases) GetCaseEventConfiguration(input *GetCaseEventConfigurationInput) (*GetCaseEventConfigurationOutput, error) { - req, out := c.GetCaseEventConfigurationRequest(input) - return out, req.Send() -} - -// GetCaseEventConfigurationWithContext is the same as GetCaseEventConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetCaseEventConfiguration 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 *ConnectCases) GetCaseEventConfigurationWithContext(ctx aws.Context, input *GetCaseEventConfigurationInput, opts ...request.Option) (*GetCaseEventConfigurationOutput, error) { - req, out := c.GetCaseEventConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDomain = "GetDomain" - -// GetDomainRequest generates a "aws/request.Request" representing the -// client's request for the GetDomain 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 GetDomain for more information on using the GetDomain -// 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 GetDomainRequest method. -// req, resp := client.GetDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetDomain -func (c *ConnectCases) GetDomainRequest(input *GetDomainInput) (req *request.Request, output *GetDomainOutput) { - op := &request.Operation{ - Name: opGetDomain, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}", - } - - if input == nil { - input = &GetDomainInput{} - } - - output = &GetDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDomain API operation for Amazon Connect Cases. -// -// Returns information about a specific domain if it exists. -// -// 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 Connect Cases's -// API operation GetDomain for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetDomain -func (c *ConnectCases) GetDomain(input *GetDomainInput) (*GetDomainOutput, error) { - req, out := c.GetDomainRequest(input) - return out, req.Send() -} - -// GetDomainWithContext is the same as GetDomain with the addition of -// the ability to pass a context and additional request options. -// -// See GetDomain 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 *ConnectCases) GetDomainWithContext(ctx aws.Context, input *GetDomainInput, opts ...request.Option) (*GetDomainOutput, error) { - req, out := c.GetDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetLayout = "GetLayout" - -// GetLayoutRequest generates a "aws/request.Request" representing the -// client's request for the GetLayout 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 GetLayout for more information on using the GetLayout -// 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 GetLayoutRequest method. -// req, resp := client.GetLayoutRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetLayout -func (c *ConnectCases) GetLayoutRequest(input *GetLayoutInput) (req *request.Request, output *GetLayoutOutput) { - op := &request.Operation{ - Name: opGetLayout, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/layouts/{layoutId}", - } - - if input == nil { - input = &GetLayoutInput{} - } - - output = &GetLayoutOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetLayout API operation for Amazon Connect Cases. -// -// Returns the details for the requested layout. -// -// 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 Connect Cases's -// API operation GetLayout for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetLayout -func (c *ConnectCases) GetLayout(input *GetLayoutInput) (*GetLayoutOutput, error) { - req, out := c.GetLayoutRequest(input) - return out, req.Send() -} - -// GetLayoutWithContext is the same as GetLayout with the addition of -// the ability to pass a context and additional request options. -// -// See GetLayout 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 *ConnectCases) GetLayoutWithContext(ctx aws.Context, input *GetLayoutInput, opts ...request.Option) (*GetLayoutOutput, error) { - req, out := c.GetLayoutRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTemplate = "GetTemplate" - -// GetTemplateRequest generates a "aws/request.Request" representing the -// client's request for the GetTemplate 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 GetTemplate for more information on using the GetTemplate -// 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 GetTemplateRequest method. -// req, resp := client.GetTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetTemplate -func (c *ConnectCases) GetTemplateRequest(input *GetTemplateInput) (req *request.Request, output *GetTemplateOutput) { - op := &request.Operation{ - Name: opGetTemplate, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/templates/{templateId}", - } - - if input == nil { - input = &GetTemplateInput{} - } - - output = &GetTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTemplate API operation for Amazon Connect Cases. -// -// Returns the details for the requested template. -// -// 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 Connect Cases's -// API operation GetTemplate for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/GetTemplate -func (c *ConnectCases) GetTemplate(input *GetTemplateInput) (*GetTemplateOutput, error) { - req, out := c.GetTemplateRequest(input) - return out, req.Send() -} - -// GetTemplateWithContext is the same as GetTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See GetTemplate 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 *ConnectCases) GetTemplateWithContext(ctx aws.Context, input *GetTemplateInput, opts ...request.Option) (*GetTemplateOutput, error) { - req, out := c.GetTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCasesForContact = "ListCasesForContact" - -// ListCasesForContactRequest generates a "aws/request.Request" representing the -// client's request for the ListCasesForContact 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 ListCasesForContact for more information on using the ListCasesForContact -// 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 ListCasesForContactRequest method. -// req, resp := client.ListCasesForContactRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListCasesForContact -func (c *ConnectCases) ListCasesForContactRequest(input *ListCasesForContactInput) (req *request.Request, output *ListCasesForContactOutput) { - op := &request.Operation{ - Name: opListCasesForContact, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/list-cases-for-contact", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCasesForContactInput{} - } - - output = &ListCasesForContactOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCasesForContact API operation for Amazon Connect Cases. -// -// Lists cases for a given contact. -// -// 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 Connect Cases's -// API operation ListCasesForContact for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListCasesForContact -func (c *ConnectCases) ListCasesForContact(input *ListCasesForContactInput) (*ListCasesForContactOutput, error) { - req, out := c.ListCasesForContactRequest(input) - return out, req.Send() -} - -// ListCasesForContactWithContext is the same as ListCasesForContact with the addition of -// the ability to pass a context and additional request options. -// -// See ListCasesForContact 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 *ConnectCases) ListCasesForContactWithContext(ctx aws.Context, input *ListCasesForContactInput, opts ...request.Option) (*ListCasesForContactOutput, error) { - req, out := c.ListCasesForContactRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCasesForContactPages iterates over the pages of a ListCasesForContact operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCasesForContact method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCasesForContact operation. -// pageNum := 0 -// err := client.ListCasesForContactPages(params, -// func(page *connectcases.ListCasesForContactOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) ListCasesForContactPages(input *ListCasesForContactInput, fn func(*ListCasesForContactOutput, bool) bool) error { - return c.ListCasesForContactPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCasesForContactPagesWithContext same as ListCasesForContactPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) ListCasesForContactPagesWithContext(ctx aws.Context, input *ListCasesForContactInput, fn func(*ListCasesForContactOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCasesForContactInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCasesForContactRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCasesForContactOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDomains = "ListDomains" - -// ListDomainsRequest generates a "aws/request.Request" representing the -// client's request for the ListDomains 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 ListDomains for more information on using the ListDomains -// 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 ListDomainsRequest method. -// req, resp := client.ListDomainsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListDomains -func (c *ConnectCases) ListDomainsRequest(input *ListDomainsInput) (req *request.Request, output *ListDomainsOutput) { - op := &request.Operation{ - Name: opListDomains, - HTTPMethod: "POST", - HTTPPath: "/domains-list", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDomainsInput{} - } - - output = &ListDomainsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDomains API operation for Amazon Connect Cases. -// -// Lists all cases domains in the Amazon Web Services account. Each list item -// is a condensed summary object of the domain. -// -// 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 Connect Cases's -// API operation ListDomains for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListDomains -func (c *ConnectCases) ListDomains(input *ListDomainsInput) (*ListDomainsOutput, error) { - req, out := c.ListDomainsRequest(input) - return out, req.Send() -} - -// ListDomainsWithContext is the same as ListDomains with the addition of -// the ability to pass a context and additional request options. -// -// See ListDomains 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 *ConnectCases) ListDomainsWithContext(ctx aws.Context, input *ListDomainsInput, opts ...request.Option) (*ListDomainsOutput, error) { - req, out := c.ListDomainsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDomainsPages iterates over the pages of a ListDomains operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDomains method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDomains operation. -// pageNum := 0 -// err := client.ListDomainsPages(params, -// func(page *connectcases.ListDomainsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) ListDomainsPages(input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool) error { - return c.ListDomainsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDomainsPagesWithContext same as ListDomainsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDomainsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDomainsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListFieldOptions = "ListFieldOptions" - -// ListFieldOptionsRequest generates a "aws/request.Request" representing the -// client's request for the ListFieldOptions 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 ListFieldOptions for more information on using the ListFieldOptions -// 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 ListFieldOptionsRequest method. -// req, resp := client.ListFieldOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListFieldOptions -func (c *ConnectCases) ListFieldOptionsRequest(input *ListFieldOptionsInput) (req *request.Request, output *ListFieldOptionsOutput) { - op := &request.Operation{ - Name: opListFieldOptions, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/fields/{fieldId}/options-list", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListFieldOptionsInput{} - } - - output = &ListFieldOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListFieldOptions API operation for Amazon Connect Cases. -// -// Lists all of the field options for a field identifier in the domain. -// -// 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 Connect Cases's -// API operation ListFieldOptions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListFieldOptions -func (c *ConnectCases) ListFieldOptions(input *ListFieldOptionsInput) (*ListFieldOptionsOutput, error) { - req, out := c.ListFieldOptionsRequest(input) - return out, req.Send() -} - -// ListFieldOptionsWithContext is the same as ListFieldOptions with the addition of -// the ability to pass a context and additional request options. -// -// See ListFieldOptions 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 *ConnectCases) ListFieldOptionsWithContext(ctx aws.Context, input *ListFieldOptionsInput, opts ...request.Option) (*ListFieldOptionsOutput, error) { - req, out := c.ListFieldOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListFieldOptionsPages iterates over the pages of a ListFieldOptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFieldOptions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListFieldOptions operation. -// pageNum := 0 -// err := client.ListFieldOptionsPages(params, -// func(page *connectcases.ListFieldOptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) ListFieldOptionsPages(input *ListFieldOptionsInput, fn func(*ListFieldOptionsOutput, bool) bool) error { - return c.ListFieldOptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFieldOptionsPagesWithContext same as ListFieldOptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) ListFieldOptionsPagesWithContext(ctx aws.Context, input *ListFieldOptionsInput, fn func(*ListFieldOptionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListFieldOptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListFieldOptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListFieldOptionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListFields = "ListFields" - -// ListFieldsRequest generates a "aws/request.Request" representing the -// client's request for the ListFields 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 ListFields for more information on using the ListFields -// 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 ListFieldsRequest method. -// req, resp := client.ListFieldsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListFields -func (c *ConnectCases) ListFieldsRequest(input *ListFieldsInput) (req *request.Request, output *ListFieldsOutput) { - op := &request.Operation{ - Name: opListFields, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/fields-list", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListFieldsInput{} - } - - output = &ListFieldsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListFields API operation for Amazon Connect Cases. -// -// Lists all fields in a Cases domain. -// -// 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 Connect Cases's -// API operation ListFields for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListFields -func (c *ConnectCases) ListFields(input *ListFieldsInput) (*ListFieldsOutput, error) { - req, out := c.ListFieldsRequest(input) - return out, req.Send() -} - -// ListFieldsWithContext is the same as ListFields with the addition of -// the ability to pass a context and additional request options. -// -// See ListFields 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 *ConnectCases) ListFieldsWithContext(ctx aws.Context, input *ListFieldsInput, opts ...request.Option) (*ListFieldsOutput, error) { - req, out := c.ListFieldsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListFieldsPages iterates over the pages of a ListFields operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFields method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListFields operation. -// pageNum := 0 -// err := client.ListFieldsPages(params, -// func(page *connectcases.ListFieldsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) ListFieldsPages(input *ListFieldsInput, fn func(*ListFieldsOutput, bool) bool) error { - return c.ListFieldsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFieldsPagesWithContext same as ListFieldsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) ListFieldsPagesWithContext(ctx aws.Context, input *ListFieldsInput, fn func(*ListFieldsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListFieldsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListFieldsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListFieldsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListLayouts = "ListLayouts" - -// ListLayoutsRequest generates a "aws/request.Request" representing the -// client's request for the ListLayouts 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 ListLayouts for more information on using the ListLayouts -// 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 ListLayoutsRequest method. -// req, resp := client.ListLayoutsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListLayouts -func (c *ConnectCases) ListLayoutsRequest(input *ListLayoutsInput) (req *request.Request, output *ListLayoutsOutput) { - op := &request.Operation{ - Name: opListLayouts, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/layouts-list", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListLayoutsInput{} - } - - output = &ListLayoutsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLayouts API operation for Amazon Connect Cases. -// -// Lists all layouts in the given cases domain. Each list item is a condensed -// summary object of the layout. -// -// 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 Connect Cases's -// API operation ListLayouts for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListLayouts -func (c *ConnectCases) ListLayouts(input *ListLayoutsInput) (*ListLayoutsOutput, error) { - req, out := c.ListLayoutsRequest(input) - return out, req.Send() -} - -// ListLayoutsWithContext is the same as ListLayouts with the addition of -// the ability to pass a context and additional request options. -// -// See ListLayouts 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 *ConnectCases) ListLayoutsWithContext(ctx aws.Context, input *ListLayoutsInput, opts ...request.Option) (*ListLayoutsOutput, error) { - req, out := c.ListLayoutsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListLayoutsPages iterates over the pages of a ListLayouts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLayouts method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListLayouts operation. -// pageNum := 0 -// err := client.ListLayoutsPages(params, -// func(page *connectcases.ListLayoutsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) ListLayoutsPages(input *ListLayoutsInput, fn func(*ListLayoutsOutput, bool) bool) error { - return c.ListLayoutsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLayoutsPagesWithContext same as ListLayoutsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) ListLayoutsPagesWithContext(ctx aws.Context, input *ListLayoutsInput, fn func(*ListLayoutsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLayoutsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLayoutsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListLayoutsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListTagsForResource -func (c *ConnectCases) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{arn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Connect Cases. -// -// Lists tags for a resource. -// -// 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 Connect Cases's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListTagsForResource -func (c *ConnectCases) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *ConnectCases) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTemplates = "ListTemplates" - -// ListTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the ListTemplates 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 ListTemplates for more information on using the ListTemplates -// 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 ListTemplatesRequest method. -// req, resp := client.ListTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListTemplates -func (c *ConnectCases) ListTemplatesRequest(input *ListTemplatesInput) (req *request.Request, output *ListTemplatesOutput) { - op := &request.Operation{ - Name: opListTemplates, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/templates-list", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTemplatesInput{} - } - - output = &ListTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTemplates API operation for Amazon Connect Cases. -// -// Lists all of the templates in a Cases domain. Each list item is a condensed -// summary object of the template. -// -// 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 Connect Cases's -// API operation ListTemplates for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/ListTemplates -func (c *ConnectCases) ListTemplates(input *ListTemplatesInput) (*ListTemplatesOutput, error) { - req, out := c.ListTemplatesRequest(input) - return out, req.Send() -} - -// ListTemplatesWithContext is the same as ListTemplates with the addition of -// the ability to pass a context and additional request options. -// -// See ListTemplates 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 *ConnectCases) ListTemplatesWithContext(ctx aws.Context, input *ListTemplatesInput, opts ...request.Option) (*ListTemplatesOutput, error) { - req, out := c.ListTemplatesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTemplatesPages iterates over the pages of a ListTemplates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTemplates method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTemplates operation. -// pageNum := 0 -// err := client.ListTemplatesPages(params, -// func(page *connectcases.ListTemplatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) ListTemplatesPages(input *ListTemplatesInput, fn func(*ListTemplatesOutput, bool) bool) error { - return c.ListTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTemplatesPagesWithContext same as ListTemplatesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) ListTemplatesPagesWithContext(ctx aws.Context, input *ListTemplatesInput, fn func(*ListTemplatesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTemplatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTemplatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTemplatesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutCaseEventConfiguration = "PutCaseEventConfiguration" - -// PutCaseEventConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutCaseEventConfiguration 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 PutCaseEventConfiguration for more information on using the PutCaseEventConfiguration -// 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 PutCaseEventConfigurationRequest method. -// req, resp := client.PutCaseEventConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/PutCaseEventConfiguration -func (c *ConnectCases) PutCaseEventConfigurationRequest(input *PutCaseEventConfigurationInput) (req *request.Request, output *PutCaseEventConfigurationOutput) { - op := &request.Operation{ - Name: opPutCaseEventConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/domains/{domainId}/case-event-configuration", - } - - if input == nil { - input = &PutCaseEventConfigurationInput{} - } - - output = &PutCaseEventConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutCaseEventConfiguration API operation for Amazon Connect Cases. -// -// Adds case event publishing configuration. For a complete list of fields you -// can add to the event message, see Create case fields (https://docs.aws.amazon.com/connect/latest/adminguide/case-fields.html) -// in the Amazon Connect Administrator Guide -// -// 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 Connect Cases's -// API operation PutCaseEventConfiguration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/PutCaseEventConfiguration -func (c *ConnectCases) PutCaseEventConfiguration(input *PutCaseEventConfigurationInput) (*PutCaseEventConfigurationOutput, error) { - req, out := c.PutCaseEventConfigurationRequest(input) - return out, req.Send() -} - -// PutCaseEventConfigurationWithContext is the same as PutCaseEventConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutCaseEventConfiguration 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 *ConnectCases) PutCaseEventConfigurationWithContext(ctx aws.Context, input *PutCaseEventConfigurationInput, opts ...request.Option) (*PutCaseEventConfigurationOutput, error) { - req, out := c.PutCaseEventConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSearchCases = "SearchCases" - -// SearchCasesRequest generates a "aws/request.Request" representing the -// client's request for the SearchCases 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 SearchCases for more information on using the SearchCases -// 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 SearchCasesRequest method. -// req, resp := client.SearchCasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/SearchCases -func (c *ConnectCases) SearchCasesRequest(input *SearchCasesInput) (req *request.Request, output *SearchCasesOutput) { - op := &request.Operation{ - Name: opSearchCases, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/cases-search", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchCasesInput{} - } - - output = &SearchCasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchCases API operation for Amazon Connect Cases. -// -// Searches for cases within their associated Cases domain. Search results are -// returned as a paginated list of abridged case documents. -// -// For customer_id you must provide the full customer profile ARN in this format: -// arn:aws:profile:your AWS Region:your AWS account ID:domains/profiles domain -// name/profiles/profile ID. -// -// 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 Connect Cases's -// API operation SearchCases for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/SearchCases -func (c *ConnectCases) SearchCases(input *SearchCasesInput) (*SearchCasesOutput, error) { - req, out := c.SearchCasesRequest(input) - return out, req.Send() -} - -// SearchCasesWithContext is the same as SearchCases with the addition of -// the ability to pass a context and additional request options. -// -// See SearchCases 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 *ConnectCases) SearchCasesWithContext(ctx aws.Context, input *SearchCasesInput, opts ...request.Option) (*SearchCasesOutput, error) { - req, out := c.SearchCasesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchCasesPages iterates over the pages of a SearchCases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchCases method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchCases operation. -// pageNum := 0 -// err := client.SearchCasesPages(params, -// func(page *connectcases.SearchCasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) SearchCasesPages(input *SearchCasesInput, fn func(*SearchCasesOutput, bool) bool) error { - return c.SearchCasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchCasesPagesWithContext same as SearchCasesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) SearchCasesPagesWithContext(ctx aws.Context, input *SearchCasesInput, fn func(*SearchCasesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchCasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchCasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchCasesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearchRelatedItems = "SearchRelatedItems" - -// SearchRelatedItemsRequest generates a "aws/request.Request" representing the -// client's request for the SearchRelatedItems 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 SearchRelatedItems for more information on using the SearchRelatedItems -// 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 SearchRelatedItemsRequest method. -// req, resp := client.SearchRelatedItemsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/SearchRelatedItems -func (c *ConnectCases) SearchRelatedItemsRequest(input *SearchRelatedItemsInput) (req *request.Request, output *SearchRelatedItemsOutput) { - op := &request.Operation{ - Name: opSearchRelatedItems, - HTTPMethod: "POST", - HTTPPath: "/domains/{domainId}/cases/{caseId}/related-items-search", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchRelatedItemsInput{} - } - - output = &SearchRelatedItemsOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchRelatedItems API operation for Amazon Connect Cases. -// -// Searches for related items that are associated with a case. -// -// If no filters are provided, this returns all related items associated with -// a case. -// -// 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 Connect Cases's -// API operation SearchRelatedItems for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/SearchRelatedItems -func (c *ConnectCases) SearchRelatedItems(input *SearchRelatedItemsInput) (*SearchRelatedItemsOutput, error) { - req, out := c.SearchRelatedItemsRequest(input) - return out, req.Send() -} - -// SearchRelatedItemsWithContext is the same as SearchRelatedItems with the addition of -// the ability to pass a context and additional request options. -// -// See SearchRelatedItems 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 *ConnectCases) SearchRelatedItemsWithContext(ctx aws.Context, input *SearchRelatedItemsInput, opts ...request.Option) (*SearchRelatedItemsOutput, error) { - req, out := c.SearchRelatedItemsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchRelatedItemsPages iterates over the pages of a SearchRelatedItems operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchRelatedItems method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchRelatedItems operation. -// pageNum := 0 -// err := client.SearchRelatedItemsPages(params, -// func(page *connectcases.SearchRelatedItemsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ConnectCases) SearchRelatedItemsPages(input *SearchRelatedItemsInput, fn func(*SearchRelatedItemsOutput, bool) bool) error { - return c.SearchRelatedItemsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchRelatedItemsPagesWithContext same as SearchRelatedItemsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ConnectCases) SearchRelatedItemsPagesWithContext(ctx aws.Context, input *SearchRelatedItemsInput, fn func(*SearchRelatedItemsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchRelatedItemsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchRelatedItemsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchRelatedItemsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/TagResource -func (c *ConnectCases) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{arn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon Connect Cases. -// -// Adds tags to a resource. -// -// 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 Connect Cases's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/TagResource -func (c *ConnectCases) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *ConnectCases) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UntagResource -func (c *ConnectCases) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{arn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon Connect Cases. -// -// Untags a resource. -// -// 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 Connect Cases's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UntagResource -func (c *ConnectCases) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *ConnectCases) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCase = "UpdateCase" - -// UpdateCaseRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCase 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 UpdateCase for more information on using the UpdateCase -// 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 UpdateCaseRequest method. -// req, resp := client.UpdateCaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UpdateCase -func (c *ConnectCases) UpdateCaseRequest(input *UpdateCaseInput) (req *request.Request, output *UpdateCaseOutput) { - op := &request.Operation{ - Name: opUpdateCase, - HTTPMethod: "PUT", - HTTPPath: "/domains/{domainId}/cases/{caseId}", - } - - if input == nil { - input = &UpdateCaseInput{} - } - - output = &UpdateCaseOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateCase API operation for Amazon Connect Cases. -// -// Updates the values of fields on a case. Fields to be updated are received -// as an array of id/value pairs identical to the CreateCase input . -// -// If the action is successful, the service sends back an HTTP 200 response -// with an empty HTTP body. -// -// 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 Connect Cases's -// API operation UpdateCase for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UpdateCase -func (c *ConnectCases) UpdateCase(input *UpdateCaseInput) (*UpdateCaseOutput, error) { - req, out := c.UpdateCaseRequest(input) - return out, req.Send() -} - -// UpdateCaseWithContext is the same as UpdateCase with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCase 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 *ConnectCases) UpdateCaseWithContext(ctx aws.Context, input *UpdateCaseInput, opts ...request.Option) (*UpdateCaseOutput, error) { - req, out := c.UpdateCaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateField = "UpdateField" - -// UpdateFieldRequest generates a "aws/request.Request" representing the -// client's request for the UpdateField 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 UpdateField for more information on using the UpdateField -// 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 UpdateFieldRequest method. -// req, resp := client.UpdateFieldRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UpdateField -func (c *ConnectCases) UpdateFieldRequest(input *UpdateFieldInput) (req *request.Request, output *UpdateFieldOutput) { - op := &request.Operation{ - Name: opUpdateField, - HTTPMethod: "PUT", - HTTPPath: "/domains/{domainId}/fields/{fieldId}", - } - - if input == nil { - input = &UpdateFieldInput{} - } - - output = &UpdateFieldOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateField API operation for Amazon Connect Cases. -// -// Updates the properties of an existing field. -// -// 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 Connect Cases's -// API operation UpdateField for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UpdateField -func (c *ConnectCases) UpdateField(input *UpdateFieldInput) (*UpdateFieldOutput, error) { - req, out := c.UpdateFieldRequest(input) - return out, req.Send() -} - -// UpdateFieldWithContext is the same as UpdateField with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateField 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 *ConnectCases) UpdateFieldWithContext(ctx aws.Context, input *UpdateFieldInput, opts ...request.Option) (*UpdateFieldOutput, error) { - req, out := c.UpdateFieldRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateLayout = "UpdateLayout" - -// UpdateLayoutRequest generates a "aws/request.Request" representing the -// client's request for the UpdateLayout 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 UpdateLayout for more information on using the UpdateLayout -// 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 UpdateLayoutRequest method. -// req, resp := client.UpdateLayoutRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UpdateLayout -func (c *ConnectCases) UpdateLayoutRequest(input *UpdateLayoutInput) (req *request.Request, output *UpdateLayoutOutput) { - op := &request.Operation{ - Name: opUpdateLayout, - HTTPMethod: "PUT", - HTTPPath: "/domains/{domainId}/layouts/{layoutId}", - } - - if input == nil { - input = &UpdateLayoutInput{} - } - - output = &UpdateLayoutOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateLayout API operation for Amazon Connect Cases. -// -// Updates the attributes of an existing layout. -// -// If the action is successful, the service sends back an HTTP 200 response -// with an empty HTTP body. -// -// A ValidationException is returned when you add non-existent fieldIds to a -// layout. -// -// Title and Status fields cannot be part of layouts because they are not configurable. -// -// 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 Connect Cases's -// API operation UpdateLayout for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded. For a list of service quotas, see Amazon -// Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) -// in the Amazon Connect Administrator Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UpdateLayout -func (c *ConnectCases) UpdateLayout(input *UpdateLayoutInput) (*UpdateLayoutOutput, error) { - req, out := c.UpdateLayoutRequest(input) - return out, req.Send() -} - -// UpdateLayoutWithContext is the same as UpdateLayout with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateLayout 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 *ConnectCases) UpdateLayoutWithContext(ctx aws.Context, input *UpdateLayoutInput, opts ...request.Option) (*UpdateLayoutOutput, error) { - req, out := c.UpdateLayoutRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTemplate = "UpdateTemplate" - -// UpdateTemplateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTemplate 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 UpdateTemplate for more information on using the UpdateTemplate -// 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 UpdateTemplateRequest method. -// req, resp := client.UpdateTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UpdateTemplate -func (c *ConnectCases) UpdateTemplateRequest(input *UpdateTemplateInput) (req *request.Request, output *UpdateTemplateOutput) { - op := &request.Operation{ - Name: opUpdateTemplate, - HTTPMethod: "PUT", - HTTPPath: "/domains/{domainId}/templates/{templateId}", - } - - if input == nil { - input = &UpdateTemplateInput{} - } - - output = &UpdateTemplateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateTemplate API operation for Amazon Connect Cases. -// -// Updates the attributes of an existing template. The template attributes that -// can be modified include name, description, layoutConfiguration, requiredFields, -// and status. At least one of these attributes must not be null. If a null -// value is provided for a given attribute, that attribute is ignored and its -// current value is preserved. -// -// 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 Connect Cases's -// API operation UpdateTemplate for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// We couldn't process your request because of an issue with the server. Try -// again later. -// -// - ResourceNotFoundException -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -// -// - ValidationException -// The request isn't valid. Check the syntax and try again. -// -// - ThrottlingException -// The rate has been exceeded for this API. Please try again after a few minutes. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/UpdateTemplate -func (c *ConnectCases) UpdateTemplate(input *UpdateTemplateInput) (*UpdateTemplateOutput, error) { - req, out := c.UpdateTemplateRequest(input) - return out, req.Send() -} - -// UpdateTemplateWithContext is the same as UpdateTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTemplate 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 *ConnectCases) UpdateTemplateWithContext(ctx aws.Context, input *UpdateTemplateInput, opts ...request.Option) (*UpdateTemplateOutput, error) { - req, out := c.UpdateTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Content specific to BasicLayout type. It configures fields in the top panel -// and More Info tab of agent application. -type BasicLayout struct { - _ struct{} `type:"structure"` - - // This represents sections in a tab of the page layout. - MoreInfo *LayoutSections `locationName:"moreInfo" type:"structure"` - - // This represents sections in a panel of the page layout. - TopPanel *LayoutSections `locationName:"topPanel" 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 BasicLayout) 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 BasicLayout) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BasicLayout) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BasicLayout"} - if s.MoreInfo != nil { - if err := s.MoreInfo.Validate(); err != nil { - invalidParams.AddNested("MoreInfo", err.(request.ErrInvalidParams)) - } - } - if s.TopPanel != nil { - if err := s.TopPanel.Validate(); err != nil { - invalidParams.AddNested("TopPanel", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMoreInfo sets the MoreInfo field's value. -func (s *BasicLayout) SetMoreInfo(v *LayoutSections) *BasicLayout { - s.MoreInfo = v - return s -} - -// SetTopPanel sets the TopPanel field's value. -func (s *BasicLayout) SetTopPanel(v *LayoutSections) *BasicLayout { - s.TopPanel = v - return s -} - -type BatchGetFieldInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // A list of unique field identifiers. - // - // Fields is a required field - Fields []*FieldIdentifier `locationName:"fields" min:"1" type:"list" 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 BatchGetFieldInput) 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 BatchGetFieldInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetFieldInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetFieldInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Fields == nil { - invalidParams.Add(request.NewErrParamRequired("Fields")) - } - if s.Fields != nil && len(s.Fields) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Fields", 1)) - } - if s.Fields != nil { - for i, v := range s.Fields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Fields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *BatchGetFieldInput) SetDomainId(v string) *BatchGetFieldInput { - s.DomainId = &v - return s -} - -// SetFields sets the Fields field's value. -func (s *BatchGetFieldInput) SetFields(v []*FieldIdentifier) *BatchGetFieldInput { - s.Fields = v - return s -} - -type BatchGetFieldOutput struct { - _ struct{} `type:"structure"` - - // A list of field errors. - // - // Errors is a required field - Errors []*FieldError `locationName:"errors" type:"list" required:"true"` - - // A list of detailed field information. - // - // Fields is a required field - Fields []*GetFieldResponse `locationName:"fields" type:"list" 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 BatchGetFieldOutput) 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 BatchGetFieldOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchGetFieldOutput) SetErrors(v []*FieldError) *BatchGetFieldOutput { - s.Errors = v - return s -} - -// SetFields sets the Fields field's value. -func (s *BatchGetFieldOutput) SetFields(v []*GetFieldResponse) *BatchGetFieldOutput { - s.Fields = v - return s -} - -type BatchPutFieldOptionsInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The unique identifier of a field. - // - // FieldId is a required field - FieldId *string `location:"uri" locationName:"fieldId" min:"1" type:"string" required:"true"` - - // A list of FieldOption objects. - // - // Options is a required field - Options []*FieldOption `locationName:"options" type:"list" 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 BatchPutFieldOptionsInput) 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 BatchPutFieldOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchPutFieldOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchPutFieldOptionsInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.FieldId == nil { - invalidParams.Add(request.NewErrParamRequired("FieldId")) - } - if s.FieldId != nil && len(*s.FieldId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FieldId", 1)) - } - if s.Options == nil { - invalidParams.Add(request.NewErrParamRequired("Options")) - } - if s.Options != nil { - for i, v := range s.Options { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Options", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *BatchPutFieldOptionsInput) SetDomainId(v string) *BatchPutFieldOptionsInput { - s.DomainId = &v - return s -} - -// SetFieldId sets the FieldId field's value. -func (s *BatchPutFieldOptionsInput) SetFieldId(v string) *BatchPutFieldOptionsInput { - s.FieldId = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *BatchPutFieldOptionsInput) SetOptions(v []*FieldOption) *BatchPutFieldOptionsInput { - s.Options = v - return s -} - -type BatchPutFieldOptionsOutput struct { - _ struct{} `type:"structure"` - - // A list of field errors. - Errors []*FieldOptionError `locationName:"errors" type:"list"` -} - -// 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 BatchPutFieldOptionsOutput) 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 BatchPutFieldOptionsOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchPutFieldOptionsOutput) SetErrors(v []*FieldOptionError) *BatchPutFieldOptionsOutput { - s.Errors = v - return s -} - -// Details of what case data is published through the case event stream. -type CaseEventIncludedData struct { - _ struct{} `type:"structure"` - - // List of field identifiers. - // - // Fields is a required field - Fields []*FieldIdentifier `locationName:"fields" type:"list" 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 CaseEventIncludedData) 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 CaseEventIncludedData) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CaseEventIncludedData) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaseEventIncludedData"} - if s.Fields == nil { - invalidParams.Add(request.NewErrParamRequired("Fields")) - } - if s.Fields != nil { - for i, v := range s.Fields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Fields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFields sets the Fields field's value. -func (s *CaseEventIncludedData) SetFields(v []*FieldIdentifier) *CaseEventIncludedData { - s.Fields = v - return s -} - -// A filter for cases. Only one value can be provided. -type CaseFilter struct { - _ struct{} `type:"structure"` - - // Provides "and all" filtering. - AndAll []*CaseFilter `locationName:"andAll" type:"list"` - - // A list of fields to filter on. - Field *FieldFilter `locationName:"field" type:"structure"` - - // A filter for cases. Only one value can be provided. - Not *CaseFilter `locationName:"not" type:"structure"` - - // Provides "or all" filtering. - OrAll []*CaseFilter `locationName:"orAll" type:"list"` -} - -// 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 CaseFilter) 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 CaseFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CaseFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaseFilter"} - if s.Field != nil { - if err := s.Field.Validate(); err != nil { - invalidParams.AddNested("Field", err.(request.ErrInvalidParams)) - } - } - if s.Not != nil { - if err := s.Not.Validate(); err != nil { - invalidParams.AddNested("Not", err.(request.ErrInvalidParams)) - } - } - if s.OrAll != nil { - for i, v := range s.OrAll { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OrAll", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAndAll sets the AndAll field's value. -func (s *CaseFilter) SetAndAll(v []*CaseFilter) *CaseFilter { - s.AndAll = v - return s -} - -// SetField sets the Field field's value. -func (s *CaseFilter) SetField(v *FieldFilter) *CaseFilter { - s.Field = v - return s -} - -// SetNot sets the Not field's value. -func (s *CaseFilter) SetNot(v *CaseFilter) *CaseFilter { - s.Not = v - return s -} - -// SetOrAll sets the OrAll field's value. -func (s *CaseFilter) SetOrAll(v []*CaseFilter) *CaseFilter { - s.OrAll = v - return s -} - -// Case summary information. -type CaseSummary struct { - _ struct{} `type:"structure"` - - // A unique identifier of the case. - // - // CaseId is a required field - CaseId *string `locationName:"caseId" min:"1" type:"string" required:"true"` - - // A unique identifier of a template. - // - // TemplateId is a required field - TemplateId *string `locationName:"templateId" min:"1" 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 CaseSummary) 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 CaseSummary) GoString() string { - return s.String() -} - -// SetCaseId sets the CaseId field's value. -func (s *CaseSummary) SetCaseId(v string) *CaseSummary { - s.CaseId = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *CaseSummary) SetTemplateId(v string) *CaseSummary { - s.TemplateId = &v - return s -} - -// Represents the content of a Comment to be returned to agents. -type CommentContent struct { - _ struct{} `type:"structure"` - - // Text in the body of a Comment on a case. - // - // Body is a required field - Body *string `locationName:"body" min:"1" type:"string" required:"true"` - - // Type of the text in the box of a Comment on a case. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true" enum:"CommentBodyTextType"` -} - -// 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 CommentContent) 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 CommentContent) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CommentContent) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CommentContent"} - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.Body != nil && len(*s.Body) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Body", 1)) - } - if s.ContentType == nil { - invalidParams.Add(request.NewErrParamRequired("ContentType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *CommentContent) SetBody(v string) *CommentContent { - s.Body = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *CommentContent) SetContentType(v string) *CommentContent { - s.ContentType = &v - return s -} - -// A filter for related items of type Comment. -type CommentFilter 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 CommentFilter) 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 CommentFilter) GoString() string { - return s.String() -} - -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. See the accompanying error message for details. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An object that represents an Amazon Connect contact object. -type Contact struct { - _ struct{} `type:"structure"` - - // A unique identifier of a contact in Amazon Connect. - // - // ContactArn is a required field - ContactArn *string `locationName:"contactArn" min:"1" 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 Contact) 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 Contact) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Contact) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Contact"} - if s.ContactArn == nil { - invalidParams.Add(request.NewErrParamRequired("ContactArn")) - } - if s.ContactArn != nil && len(*s.ContactArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ContactArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContactArn sets the ContactArn field's value. -func (s *Contact) SetContactArn(v string) *Contact { - s.ContactArn = &v - return s -} - -// An object that represents a content of an Amazon Connect contact object. -type ContactContent struct { - _ struct{} `type:"structure"` - - // A list of channels to filter on for related items of type Contact. - // - // Channel is a required field - Channel *string `locationName:"channel" min:"1" type:"string" required:"true"` - - // The difference between the InitiationTimestamp and the DisconnectTimestamp - // of the contact. - // - // ConnectedToSystemTime is a required field - ConnectedToSystemTime *time.Time `locationName:"connectedToSystemTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // A unique identifier of a contact in Amazon Connect. - // - // ContactArn is a required field - ContactArn *string `locationName:"contactArn" min:"1" 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 ContactContent) 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 ContactContent) GoString() string { - return s.String() -} - -// SetChannel sets the Channel field's value. -func (s *ContactContent) SetChannel(v string) *ContactContent { - s.Channel = &v - return s -} - -// SetConnectedToSystemTime sets the ConnectedToSystemTime field's value. -func (s *ContactContent) SetConnectedToSystemTime(v time.Time) *ContactContent { - s.ConnectedToSystemTime = &v - return s -} - -// SetContactArn sets the ContactArn field's value. -func (s *ContactContent) SetContactArn(v string) *ContactContent { - s.ContactArn = &v - return s -} - -// A filter for related items of type Contact. -type ContactFilter struct { - _ struct{} `type:"structure"` - - // A list of channels to filter on for related items of type Contact. - Channel []*string `locationName:"channel" type:"list"` - - // A unique identifier of a contact in Amazon Connect. - ContactArn *string `locationName:"contactArn" min:"1" 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 ContactFilter) 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 ContactFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContactFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContactFilter"} - if s.ContactArn != nil && len(*s.ContactArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ContactArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannel sets the Channel field's value. -func (s *ContactFilter) SetChannel(v []*string) *ContactFilter { - s.Channel = v - return s -} - -// SetContactArn sets the ContactArn field's value. -func (s *ContactFilter) SetContactArn(v string) *ContactFilter { - s.ContactArn = &v - return s -} - -type CreateCaseInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If not provided, the Amazon Web Services SDK populates this - // field. For more information about idempotency, see Making retries safe with - // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/). - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // An array of objects with field ID (matching ListFields/DescribeField) and - // value union data. - // - // Fields is a required field - Fields []*FieldValue `locationName:"fields" type:"list" required:"true"` - - // A unique identifier of a template. - // - // TemplateId is a required field - TemplateId *string `locationName:"templateId" min:"1" 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 CreateCaseInput) 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 CreateCaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCaseInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Fields == nil { - invalidParams.Add(request.NewErrParamRequired("Fields")) - } - if s.TemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateId")) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - if s.Fields != nil { - for i, v := range s.Fields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Fields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateCaseInput) SetClientToken(v string) *CreateCaseInput { - s.ClientToken = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateCaseInput) SetDomainId(v string) *CreateCaseInput { - s.DomainId = &v - return s -} - -// SetFields sets the Fields field's value. -func (s *CreateCaseInput) SetFields(v []*FieldValue) *CreateCaseInput { - s.Fields = v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *CreateCaseInput) SetTemplateId(v string) *CreateCaseInput { - s.TemplateId = &v - return s -} - -type CreateCaseOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the case. - // - // CaseArn is a required field - CaseArn *string `locationName:"caseArn" min:"1" type:"string" required:"true"` - - // A unique identifier of the case. - // - // CaseId is a required field - CaseId *string `locationName:"caseId" min:"1" 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 CreateCaseOutput) 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 CreateCaseOutput) GoString() string { - return s.String() -} - -// SetCaseArn sets the CaseArn field's value. -func (s *CreateCaseOutput) SetCaseArn(v string) *CreateCaseOutput { - s.CaseArn = &v - return s -} - -// SetCaseId sets the CaseId field's value. -func (s *CreateCaseOutput) SetCaseId(v string) *CreateCaseOutput { - s.CaseId = &v - return s -} - -type CreateDomainInput struct { - _ struct{} `type:"structure"` - - // The name for your Cases domain. It must be unique for your Amazon Web Services - // account. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 CreateDomainInput) 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 CreateDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDomainInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateDomainInput) SetName(v string) *CreateDomainInput { - s.Name = &v - return s -} - -type CreateDomainOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the Cases domain. - // - // DomainArn is a required field - DomainArn *string `locationName:"domainArn" min:"1" type:"string" required:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" min:"1" type:"string" required:"true"` - - // The status of the domain. - // - // DomainStatus is a required field - DomainStatus *string `locationName:"domainStatus" type:"string" required:"true" enum:"DomainStatus"` -} - -// 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 CreateDomainOutput) 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 CreateDomainOutput) GoString() string { - return s.String() -} - -// SetDomainArn sets the DomainArn field's value. -func (s *CreateDomainOutput) SetDomainArn(v string) *CreateDomainOutput { - s.DomainArn = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateDomainOutput) SetDomainId(v string) *CreateDomainOutput { - s.DomainId = &v - return s -} - -// SetDomainStatus sets the DomainStatus field's value. -func (s *CreateDomainOutput) SetDomainStatus(v string) *CreateDomainOutput { - s.DomainStatus = &v - return s -} - -type CreateFieldInput struct { - _ struct{} `type:"structure"` - - // The description of the field. - Description *string `locationName:"description" type:"string"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The name of the field. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Defines the data type, some system constraints, and default display of the - // field. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"FieldType"` -} - -// 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 CreateFieldInput) 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 CreateFieldInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFieldInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFieldInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateFieldInput) SetDescription(v string) *CreateFieldInput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateFieldInput) SetDomainId(v string) *CreateFieldInput { - s.DomainId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateFieldInput) SetName(v string) *CreateFieldInput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateFieldInput) SetType(v string) *CreateFieldInput { - s.Type = &v - return s -} - -type CreateFieldOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the field. - // - // FieldArn is a required field - FieldArn *string `locationName:"fieldArn" min:"1" type:"string" required:"true"` - - // The unique identifier of a field. - // - // FieldId is a required field - FieldId *string `locationName:"fieldId" min:"1" 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 CreateFieldOutput) 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 CreateFieldOutput) GoString() string { - return s.String() -} - -// SetFieldArn sets the FieldArn field's value. -func (s *CreateFieldOutput) SetFieldArn(v string) *CreateFieldOutput { - s.FieldArn = &v - return s -} - -// SetFieldId sets the FieldId field's value. -func (s *CreateFieldOutput) SetFieldId(v string) *CreateFieldOutput { - s.FieldId = &v - return s -} - -type CreateLayoutInput struct { - _ struct{} `type:"structure"` - - // Information about which fields will be present in the layout, and information - // about the order of the fields. - // - // Content is a required field - Content *LayoutContent `locationName:"content" type:"structure" required:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The name of the layout. It must be unique for the Cases domain. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 CreateLayoutInput) 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 CreateLayoutInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLayoutInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLayoutInput"} - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Content != nil { - if err := s.Content.Validate(); err != nil { - invalidParams.AddNested("Content", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *CreateLayoutInput) SetContent(v *LayoutContent) *CreateLayoutInput { - s.Content = v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateLayoutInput) SetDomainId(v string) *CreateLayoutInput { - s.DomainId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateLayoutInput) SetName(v string) *CreateLayoutInput { - s.Name = &v - return s -} - -type CreateLayoutOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the newly created layout. - // - // LayoutArn is a required field - LayoutArn *string `locationName:"layoutArn" min:"1" type:"string" required:"true"` - - // The unique identifier of the layout. - // - // LayoutId is a required field - LayoutId *string `locationName:"layoutId" min:"1" 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 CreateLayoutOutput) 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 CreateLayoutOutput) GoString() string { - return s.String() -} - -// SetLayoutArn sets the LayoutArn field's value. -func (s *CreateLayoutOutput) SetLayoutArn(v string) *CreateLayoutOutput { - s.LayoutArn = &v - return s -} - -// SetLayoutId sets the LayoutId field's value. -func (s *CreateLayoutOutput) SetLayoutId(v string) *CreateLayoutOutput { - s.LayoutId = &v - return s -} - -type CreateRelatedItemInput struct { - _ struct{} `type:"structure"` - - // A unique identifier of the case. - // - // CaseId is a required field - CaseId *string `location:"uri" locationName:"caseId" min:"1" type:"string" required:"true"` - - // The content of a related item to be created. - // - // Content is a required field - Content *RelatedItemInputContent `locationName:"content" type:"structure" required:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // Represents the creator of the related item. - PerformedBy *UserUnion `locationName:"performedBy" type:"structure"` - - // The type of a related item. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RelatedItemType"` -} - -// 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 CreateRelatedItemInput) 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 CreateRelatedItemInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRelatedItemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRelatedItemInput"} - if s.CaseId == nil { - invalidParams.Add(request.NewErrParamRequired("CaseId")) - } - if s.CaseId != nil && len(*s.CaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CaseId", 1)) - } - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Content != nil { - if err := s.Content.Validate(); err != nil { - invalidParams.AddNested("Content", err.(request.ErrInvalidParams)) - } - } - if s.PerformedBy != nil { - if err := s.PerformedBy.Validate(); err != nil { - invalidParams.AddNested("PerformedBy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaseId sets the CaseId field's value. -func (s *CreateRelatedItemInput) SetCaseId(v string) *CreateRelatedItemInput { - s.CaseId = &v - return s -} - -// SetContent sets the Content field's value. -func (s *CreateRelatedItemInput) SetContent(v *RelatedItemInputContent) *CreateRelatedItemInput { - s.Content = v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateRelatedItemInput) SetDomainId(v string) *CreateRelatedItemInput { - s.DomainId = &v - return s -} - -// SetPerformedBy sets the PerformedBy field's value. -func (s *CreateRelatedItemInput) SetPerformedBy(v *UserUnion) *CreateRelatedItemInput { - s.PerformedBy = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateRelatedItemInput) SetType(v string) *CreateRelatedItemInput { - s.Type = &v - return s -} - -type CreateRelatedItemOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the related item. - // - // RelatedItemArn is a required field - RelatedItemArn *string `locationName:"relatedItemArn" min:"1" type:"string" required:"true"` - - // The unique identifier of the related item. - // - // RelatedItemId is a required field - RelatedItemId *string `locationName:"relatedItemId" min:"1" 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 CreateRelatedItemOutput) 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 CreateRelatedItemOutput) GoString() string { - return s.String() -} - -// SetRelatedItemArn sets the RelatedItemArn field's value. -func (s *CreateRelatedItemOutput) SetRelatedItemArn(v string) *CreateRelatedItemOutput { - s.RelatedItemArn = &v - return s -} - -// SetRelatedItemId sets the RelatedItemId field's value. -func (s *CreateRelatedItemOutput) SetRelatedItemId(v string) *CreateRelatedItemOutput { - s.RelatedItemId = &v - return s -} - -type CreateTemplateInput struct { - _ struct{} `type:"structure"` - - // A brief description of the template. - Description *string `locationName:"description" type:"string"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // Configuration of layouts associated to the template. - LayoutConfiguration *LayoutConfiguration `locationName:"layoutConfiguration" type:"structure"` - - // A name for the template. It must be unique per domain. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of fields that must contain a value for a case to be successfully - // created with this template. - RequiredFields []*RequiredField `locationName:"requiredFields" type:"list"` - - // The status of the template. - Status *string `locationName:"status" type:"string" enum:"TemplateStatus"` -} - -// 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 CreateTemplateInput) 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 CreateTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTemplateInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.LayoutConfiguration != nil { - if err := s.LayoutConfiguration.Validate(); err != nil { - invalidParams.AddNested("LayoutConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.RequiredFields != nil { - for i, v := range s.RequiredFields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RequiredFields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateTemplateInput) SetDescription(v string) *CreateTemplateInput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateTemplateInput) SetDomainId(v string) *CreateTemplateInput { - s.DomainId = &v - return s -} - -// SetLayoutConfiguration sets the LayoutConfiguration field's value. -func (s *CreateTemplateInput) SetLayoutConfiguration(v *LayoutConfiguration) *CreateTemplateInput { - s.LayoutConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTemplateInput) SetName(v string) *CreateTemplateInput { - s.Name = &v - return s -} - -// SetRequiredFields sets the RequiredFields field's value. -func (s *CreateTemplateInput) SetRequiredFields(v []*RequiredField) *CreateTemplateInput { - s.RequiredFields = v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateTemplateInput) SetStatus(v string) *CreateTemplateInput { - s.Status = &v - return s -} - -type CreateTemplateOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the newly created template. - // - // TemplateArn is a required field - TemplateArn *string `locationName:"templateArn" min:"1" type:"string" required:"true"` - - // A unique identifier of a template. - // - // TemplateId is a required field - TemplateId *string `locationName:"templateId" min:"1" 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 CreateTemplateOutput) 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 CreateTemplateOutput) GoString() string { - return s.String() -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *CreateTemplateOutput) SetTemplateArn(v string) *CreateTemplateOutput { - s.TemplateArn = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *CreateTemplateOutput) SetTemplateId(v string) *CreateTemplateOutput { - s.TemplateId = &v - return s -} - -type DeleteDomainInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" 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 DeleteDomainInput) 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 DeleteDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDomainInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *DeleteDomainInput) SetDomainId(v string) *DeleteDomainInput { - s.DomainId = &v - return s -} - -type DeleteDomainOutput 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 DeleteDomainOutput) 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 DeleteDomainOutput) GoString() string { - return s.String() -} - -// Object for the summarized details of the domain. -type DomainSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the domain. - // - // DomainArn is a required field - DomainArn *string `locationName:"domainArn" min:"1" type:"string" required:"true"` - - // The unique identifier of the domain. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" min:"1" type:"string" required:"true"` - - // The name of the domain. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 DomainSummary) 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 DomainSummary) GoString() string { - return s.String() -} - -// SetDomainArn sets the DomainArn field's value. -func (s *DomainSummary) SetDomainArn(v string) *DomainSummary { - s.DomainArn = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *DomainSummary) SetDomainId(v string) *DomainSummary { - s.DomainId = &v - return s -} - -// SetName sets the Name field's value. -func (s *DomainSummary) SetName(v string) *DomainSummary { - s.Name = &v - return s -} - -// An empty value. You cannot set EmptyFieldValue on a field that is required -// on a case template. -// -// This structure will never have any data members. It signifies an empty value -// on a case field. -type EmptyFieldValue 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 EmptyFieldValue) 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 EmptyFieldValue) GoString() string { - return s.String() -} - -// Configuration to enable EventBridge case event delivery and determine what -// data is delivered. -type EventBridgeConfiguration struct { - _ struct{} `type:"structure"` - - // Indicates whether the to broadcast case event data to the customer. - // - // Enabled is a required field - Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` - - // Details of what case and related item data is published through the case - // event stream. - IncludedData *EventIncludedData `locationName:"includedData" 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 EventBridgeConfiguration) 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 EventBridgeConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EventBridgeConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EventBridgeConfiguration"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - if s.IncludedData != nil { - if err := s.IncludedData.Validate(); err != nil { - invalidParams.AddNested("IncludedData", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *EventBridgeConfiguration) SetEnabled(v bool) *EventBridgeConfiguration { - s.Enabled = &v - return s -} - -// SetIncludedData sets the IncludedData field's value. -func (s *EventBridgeConfiguration) SetIncludedData(v *EventIncludedData) *EventBridgeConfiguration { - s.IncludedData = v - return s -} - -// Details of what case and related item data is published through the case -// event stream. -type EventIncludedData struct { - _ struct{} `type:"structure"` - - // Details of what case data is published through the case event stream. - CaseData *CaseEventIncludedData `locationName:"caseData" type:"structure"` - - // Details of what related item data is published through the case event stream. - RelatedItemData *RelatedItemEventIncludedData `locationName:"relatedItemData" 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 EventIncludedData) 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 EventIncludedData) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EventIncludedData) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EventIncludedData"} - if s.CaseData != nil { - if err := s.CaseData.Validate(); err != nil { - invalidParams.AddNested("CaseData", err.(request.ErrInvalidParams)) - } - } - if s.RelatedItemData != nil { - if err := s.RelatedItemData.Validate(); err != nil { - invalidParams.AddNested("RelatedItemData", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaseData sets the CaseData field's value. -func (s *EventIncludedData) SetCaseData(v *CaseEventIncludedData) *EventIncludedData { - s.CaseData = v - return s -} - -// SetRelatedItemData sets the RelatedItemData field's value. -func (s *EventIncludedData) SetRelatedItemData(v *RelatedItemEventIncludedData) *EventIncludedData { - s.RelatedItemData = v - return s -} - -// Object for errors on fields. -type FieldError struct { - _ struct{} `type:"structure"` - - // The error code from getting a field. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true"` - - // The field identifier that caused the error. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // The error message from getting a field. - Message *string `locationName:"message" 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 FieldError) 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 FieldError) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *FieldError) SetErrorCode(v string) *FieldError { - s.ErrorCode = &v - return s -} - -// SetId sets the Id field's value. -func (s *FieldError) SetId(v string) *FieldError { - s.Id = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *FieldError) SetMessage(v string) *FieldError { - s.Message = &v - return s -} - -// A filter for fields. Only one value can be provided. -type FieldFilter struct { - _ struct{} `type:"structure"` - - // Object containing field identifier and value information. - Contains *FieldValue `locationName:"contains" type:"structure"` - - // Object containing field identifier and value information. - EqualTo *FieldValue `locationName:"equalTo" type:"structure"` - - // Object containing field identifier and value information. - GreaterThan *FieldValue `locationName:"greaterThan" type:"structure"` - - // Object containing field identifier and value information. - GreaterThanOrEqualTo *FieldValue `locationName:"greaterThanOrEqualTo" type:"structure"` - - // Object containing field identifier and value information. - LessThan *FieldValue `locationName:"lessThan" type:"structure"` - - // Object containing field identifier and value information. - LessThanOrEqualTo *FieldValue `locationName:"lessThanOrEqualTo" 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 FieldFilter) 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 FieldFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FieldFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FieldFilter"} - if s.Contains != nil { - if err := s.Contains.Validate(); err != nil { - invalidParams.AddNested("Contains", err.(request.ErrInvalidParams)) - } - } - if s.EqualTo != nil { - if err := s.EqualTo.Validate(); err != nil { - invalidParams.AddNested("EqualTo", err.(request.ErrInvalidParams)) - } - } - if s.GreaterThan != nil { - if err := s.GreaterThan.Validate(); err != nil { - invalidParams.AddNested("GreaterThan", err.(request.ErrInvalidParams)) - } - } - if s.GreaterThanOrEqualTo != nil { - if err := s.GreaterThanOrEqualTo.Validate(); err != nil { - invalidParams.AddNested("GreaterThanOrEqualTo", err.(request.ErrInvalidParams)) - } - } - if s.LessThan != nil { - if err := s.LessThan.Validate(); err != nil { - invalidParams.AddNested("LessThan", err.(request.ErrInvalidParams)) - } - } - if s.LessThanOrEqualTo != nil { - if err := s.LessThanOrEqualTo.Validate(); err != nil { - invalidParams.AddNested("LessThanOrEqualTo", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContains sets the Contains field's value. -func (s *FieldFilter) SetContains(v *FieldValue) *FieldFilter { - s.Contains = v - return s -} - -// SetEqualTo sets the EqualTo field's value. -func (s *FieldFilter) SetEqualTo(v *FieldValue) *FieldFilter { - s.EqualTo = v - return s -} - -// SetGreaterThan sets the GreaterThan field's value. -func (s *FieldFilter) SetGreaterThan(v *FieldValue) *FieldFilter { - s.GreaterThan = v - return s -} - -// SetGreaterThanOrEqualTo sets the GreaterThanOrEqualTo field's value. -func (s *FieldFilter) SetGreaterThanOrEqualTo(v *FieldValue) *FieldFilter { - s.GreaterThanOrEqualTo = v - return s -} - -// SetLessThan sets the LessThan field's value. -func (s *FieldFilter) SetLessThan(v *FieldValue) *FieldFilter { - s.LessThan = v - return s -} - -// SetLessThanOrEqualTo sets the LessThanOrEqualTo field's value. -func (s *FieldFilter) SetLessThanOrEqualTo(v *FieldValue) *FieldFilter { - s.LessThanOrEqualTo = v - return s -} - -// Object for a group of fields and associated properties. -type FieldGroup struct { - _ struct{} `type:"structure"` - - // Represents an ordered list containing field related information. - // - // Fields is a required field - Fields []*FieldItem `locationName:"fields" type:"list" required:"true"` - - // Name of the field group. - Name *string `locationName:"name" 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 FieldGroup) 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 FieldGroup) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FieldGroup) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FieldGroup"} - if s.Fields == nil { - invalidParams.Add(request.NewErrParamRequired("Fields")) - } - if s.Fields != nil { - for i, v := range s.Fields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Fields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFields sets the Fields field's value. -func (s *FieldGroup) SetFields(v []*FieldItem) *FieldGroup { - s.Fields = v - return s -} - -// SetName sets the Name field's value. -func (s *FieldGroup) SetName(v string) *FieldGroup { - s.Name = &v - return s -} - -// Object for unique identifier of a field. -type FieldIdentifier struct { - _ struct{} `type:"structure"` - - // Unique identifier of a field. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 FieldIdentifier) 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 FieldIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FieldIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FieldIdentifier"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *FieldIdentifier) SetId(v string) *FieldIdentifier { - s.Id = &v - return s -} - -// Object for field related information. -type FieldItem struct { - _ struct{} `type:"structure"` - - // Unique identifier of a field. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 FieldItem) 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 FieldItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FieldItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FieldItem"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *FieldItem) SetId(v string) *FieldItem { - s.Id = &v - return s -} - -// Object for field Options information. -type FieldOption struct { - _ struct{} `type:"structure"` - - // Describes whether the FieldOption is active (displayed) or inactive. - // - // Active is a required field - Active *bool `locationName:"active" type:"boolean" required:"true"` - - // FieldOptionName has max length 100 and disallows trailing spaces. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // FieldOptionValue has max length 100 and must be alphanumeric with hyphens - // and underscores. - // - // Value is a required field - Value *string `locationName:"value" min:"1" 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 FieldOption) 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 FieldOption) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FieldOption) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FieldOption"} - if s.Active == nil { - invalidParams.Add(request.NewErrParamRequired("Active")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActive sets the Active field's value. -func (s *FieldOption) SetActive(v bool) *FieldOption { - s.Active = &v - return s -} - -// SetName sets the Name field's value. -func (s *FieldOption) SetName(v string) *FieldOption { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *FieldOption) SetValue(v string) *FieldOption { - s.Value = &v - return s -} - -// Object for field Options errors. -type FieldOptionError struct { - _ struct{} `type:"structure"` - - // Error code from creating or updating field option. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true"` - - // Error message from creating or updating field option. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The field option value that caused the error. - // - // Value is a required field - Value *string `locationName:"value" min:"1" 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 FieldOptionError) 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 FieldOptionError) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *FieldOptionError) SetErrorCode(v string) *FieldOptionError { - s.ErrorCode = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *FieldOptionError) SetMessage(v string) *FieldOptionError { - s.Message = &v - return s -} - -// SetValue sets the Value field's value. -func (s *FieldOptionError) SetValue(v string) *FieldOptionError { - s.Value = &v - return s -} - -// Object for the summarized details of the field. -type FieldSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the field. - // - // FieldArn is a required field - FieldArn *string `locationName:"fieldArn" min:"1" type:"string" required:"true"` - - // The unique identifier of a field. - // - // FieldId is a required field - FieldId *string `locationName:"fieldId" min:"1" type:"string" required:"true"` - - // Name of the field. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The namespace of a field. - // - // Namespace is a required field - Namespace *string `locationName:"namespace" type:"string" required:"true" enum:"FieldNamespace"` - - // The type of a field. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"FieldType"` -} - -// 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 FieldSummary) 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 FieldSummary) GoString() string { - return s.String() -} - -// SetFieldArn sets the FieldArn field's value. -func (s *FieldSummary) SetFieldArn(v string) *FieldSummary { - s.FieldArn = &v - return s -} - -// SetFieldId sets the FieldId field's value. -func (s *FieldSummary) SetFieldId(v string) *FieldSummary { - s.FieldId = &v - return s -} - -// SetName sets the Name field's value. -func (s *FieldSummary) SetName(v string) *FieldSummary { - s.Name = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *FieldSummary) SetNamespace(v string) *FieldSummary { - s.Namespace = &v - return s -} - -// SetType sets the Type field's value. -func (s *FieldSummary) SetType(v string) *FieldSummary { - s.Type = &v - return s -} - -// Object for case field values. -type FieldValue struct { - _ struct{} `type:"structure"` - - // Unique identifier of a field. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Union of potential field value types. - // - // Value is a required field - Value *FieldValueUnion `locationName:"value" type:"structure" 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 FieldValue) 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 FieldValue) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FieldValue) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FieldValue"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *FieldValue) SetId(v string) *FieldValue { - s.Id = &v - return s -} - -// SetValue sets the Value field's value. -func (s *FieldValue) SetValue(v *FieldValueUnion) *FieldValue { - s.Value = v - return s -} - -// Object to store union of Field values. -type FieldValueUnion struct { - _ struct{} `type:"structure"` - - // Can be either null, or have a Boolean value type. Only one value can be provided. - BooleanValue *bool `locationName:"booleanValue" type:"boolean"` - - // Can be either null, or have a Double number value type. Only one value can - // be provided. - DoubleValue *float64 `locationName:"doubleValue" type:"double"` - - // An empty value. - EmptyValue *EmptyFieldValue `locationName:"emptyValue" type:"structure"` - - // String value type. - StringValue *string `locationName:"stringValue" 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 FieldValueUnion) 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 FieldValueUnion) GoString() string { - return s.String() -} - -// SetBooleanValue sets the BooleanValue field's value. -func (s *FieldValueUnion) SetBooleanValue(v bool) *FieldValueUnion { - s.BooleanValue = &v - return s -} - -// SetDoubleValue sets the DoubleValue field's value. -func (s *FieldValueUnion) SetDoubleValue(v float64) *FieldValueUnion { - s.DoubleValue = &v - return s -} - -// SetEmptyValue sets the EmptyValue field's value. -func (s *FieldValueUnion) SetEmptyValue(v *EmptyFieldValue) *FieldValueUnion { - s.EmptyValue = v - return s -} - -// SetStringValue sets the StringValue field's value. -func (s *FieldValueUnion) SetStringValue(v string) *FieldValueUnion { - s.StringValue = &v - return s -} - -type GetCaseEventConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" 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 GetCaseEventConfigurationInput) 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 GetCaseEventConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCaseEventConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCaseEventConfigurationInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *GetCaseEventConfigurationInput) SetDomainId(v string) *GetCaseEventConfigurationInput { - s.DomainId = &v - return s -} - -type GetCaseEventConfigurationOutput struct { - _ struct{} `type:"structure"` - - // Configuration to enable EventBridge case event delivery and determine what - // data is delivered. - // - // EventBridge is a required field - EventBridge *EventBridgeConfiguration `locationName:"eventBridge" type:"structure" 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 GetCaseEventConfigurationOutput) 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 GetCaseEventConfigurationOutput) GoString() string { - return s.String() -} - -// SetEventBridge sets the EventBridge field's value. -func (s *GetCaseEventConfigurationOutput) SetEventBridge(v *EventBridgeConfiguration) *GetCaseEventConfigurationOutput { - s.EventBridge = v - return s -} - -type GetCaseInput struct { - _ struct{} `type:"structure"` - - // A unique identifier of the case. - // - // CaseId is a required field - CaseId *string `location:"uri" locationName:"caseId" min:"1" type:"string" required:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // A list of unique field identifiers. - // - // Fields is a required field - Fields []*FieldIdentifier `locationName:"fields" min:"1" type:"list" required:"true"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" 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 GetCaseInput) 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 GetCaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCaseInput"} - if s.CaseId == nil { - invalidParams.Add(request.NewErrParamRequired("CaseId")) - } - if s.CaseId != nil && len(*s.CaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CaseId", 1)) - } - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Fields == nil { - invalidParams.Add(request.NewErrParamRequired("Fields")) - } - if s.Fields != nil && len(s.Fields) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Fields", 1)) - } - if s.Fields != nil { - for i, v := range s.Fields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Fields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaseId sets the CaseId field's value. -func (s *GetCaseInput) SetCaseId(v string) *GetCaseInput { - s.CaseId = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetCaseInput) SetDomainId(v string) *GetCaseInput { - s.DomainId = &v - return s -} - -// SetFields sets the Fields field's value. -func (s *GetCaseInput) SetFields(v []*FieldIdentifier) *GetCaseInput { - s.Fields = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetCaseInput) SetNextToken(v string) *GetCaseInput { - s.NextToken = &v - return s -} - -type GetCaseOutput struct { - _ struct{} `type:"structure"` - - // A list of detailed field information. - // - // Fields is a required field - Fields []*FieldValue `locationName:"fields" type:"list" required:"true"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // A unique identifier of a template. - // - // TemplateId is a required field - TemplateId *string `locationName:"templateId" min:"1" 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 GetCaseOutput) 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 GetCaseOutput) GoString() string { - return s.String() -} - -// SetFields sets the Fields field's value. -func (s *GetCaseOutput) SetFields(v []*FieldValue) *GetCaseOutput { - s.Fields = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetCaseOutput) SetNextToken(v string) *GetCaseOutput { - s.NextToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetCaseOutput) SetTags(v map[string]*string) *GetCaseOutput { - s.Tags = v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *GetCaseOutput) SetTemplateId(v string) *GetCaseOutput { - s.TemplateId = &v - return s -} - -type GetDomainInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" 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 GetDomainInput) 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 GetDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDomainInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *GetDomainInput) SetDomainId(v string) *GetDomainInput { - s.DomainId = &v - return s -} - -type GetDomainOutput struct { - _ struct{} `type:"structure"` - - // The timestamp when the Cases domain was created. - // - // CreatedTime is a required field - CreatedTime *time.Time `locationName:"createdTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Amazon Resource Name (ARN) for the Cases domain. - // - // DomainArn is a required field - DomainArn *string `locationName:"domainArn" min:"1" type:"string" required:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" min:"1" type:"string" required:"true"` - - // The status of the Cases domain. - // - // DomainStatus is a required field - DomainStatus *string `locationName:"domainStatus" type:"string" required:"true" enum:"DomainStatus"` - - // The name of the Cases domain. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 GetDomainOutput) 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 GetDomainOutput) GoString() string { - return s.String() -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *GetDomainOutput) SetCreatedTime(v time.Time) *GetDomainOutput { - s.CreatedTime = &v - return s -} - -// SetDomainArn sets the DomainArn field's value. -func (s *GetDomainOutput) SetDomainArn(v string) *GetDomainOutput { - s.DomainArn = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetDomainOutput) SetDomainId(v string) *GetDomainOutput { - s.DomainId = &v - return s -} - -// SetDomainStatus sets the DomainStatus field's value. -func (s *GetDomainOutput) SetDomainStatus(v string) *GetDomainOutput { - s.DomainStatus = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetDomainOutput) SetName(v string) *GetDomainOutput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetDomainOutput) SetTags(v map[string]*string) *GetDomainOutput { - s.Tags = v - return s -} - -// Object to store detailed field information. -type GetFieldResponse struct { - _ struct{} `type:"structure"` - - // Description of the field. - Description *string `locationName:"description" type:"string"` - - // The Amazon Resource Name (ARN) of the field. - // - // FieldArn is a required field - FieldArn *string `locationName:"fieldArn" min:"1" type:"string" required:"true"` - - // Unique identifier of the field. - // - // FieldId is a required field - FieldId *string `locationName:"fieldId" min:"1" type:"string" required:"true"` - - // Name of the field. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Namespace of the field. - // - // Namespace is a required field - Namespace *string `locationName:"namespace" type:"string" required:"true" enum:"FieldNamespace"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // Type of the field. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"FieldType"` -} - -// 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 GetFieldResponse) 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 GetFieldResponse) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *GetFieldResponse) SetDescription(v string) *GetFieldResponse { - s.Description = &v - return s -} - -// SetFieldArn sets the FieldArn field's value. -func (s *GetFieldResponse) SetFieldArn(v string) *GetFieldResponse { - s.FieldArn = &v - return s -} - -// SetFieldId sets the FieldId field's value. -func (s *GetFieldResponse) SetFieldId(v string) *GetFieldResponse { - s.FieldId = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetFieldResponse) SetName(v string) *GetFieldResponse { - s.Name = &v - return s -} - -// SetNamespace sets the Namespace field's value. -func (s *GetFieldResponse) SetNamespace(v string) *GetFieldResponse { - s.Namespace = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetFieldResponse) SetTags(v map[string]*string) *GetFieldResponse { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *GetFieldResponse) SetType(v string) *GetFieldResponse { - s.Type = &v - return s -} - -type GetLayoutInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The unique identifier of the layout. - // - // LayoutId is a required field - LayoutId *string `location:"uri" locationName:"layoutId" min:"1" 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 GetLayoutInput) 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 GetLayoutInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetLayoutInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetLayoutInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.LayoutId == nil { - invalidParams.Add(request.NewErrParamRequired("LayoutId")) - } - if s.LayoutId != nil && len(*s.LayoutId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LayoutId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *GetLayoutInput) SetDomainId(v string) *GetLayoutInput { - s.DomainId = &v - return s -} - -// SetLayoutId sets the LayoutId field's value. -func (s *GetLayoutInput) SetLayoutId(v string) *GetLayoutInput { - s.LayoutId = &v - return s -} - -type GetLayoutOutput struct { - _ struct{} `type:"structure"` - - // Information about which fields will be present in the layout, the order of - // the fields, and read-only attribute of the field. - // - // Content is a required field - Content *LayoutContent `locationName:"content" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) of the newly created layout. - // - // LayoutArn is a required field - LayoutArn *string `locationName:"layoutArn" min:"1" type:"string" required:"true"` - - // The unique identifier of the layout. - // - // LayoutId is a required field - LayoutId *string `locationName:"layoutId" min:"1" type:"string" required:"true"` - - // The name of the layout. It must be unique. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 GetLayoutOutput) 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 GetLayoutOutput) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *GetLayoutOutput) SetContent(v *LayoutContent) *GetLayoutOutput { - s.Content = v - return s -} - -// SetLayoutArn sets the LayoutArn field's value. -func (s *GetLayoutOutput) SetLayoutArn(v string) *GetLayoutOutput { - s.LayoutArn = &v - return s -} - -// SetLayoutId sets the LayoutId field's value. -func (s *GetLayoutOutput) SetLayoutId(v string) *GetLayoutOutput { - s.LayoutId = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetLayoutOutput) SetName(v string) *GetLayoutOutput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetLayoutOutput) SetTags(v map[string]*string) *GetLayoutOutput { - s.Tags = v - return s -} - -type GetTemplateInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // A unique identifier of a template. - // - // TemplateId is a required field - TemplateId *string `location:"uri" locationName:"templateId" min:"1" 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 GetTemplateInput) 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 GetTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.TemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateId")) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *GetTemplateInput) SetDomainId(v string) *GetTemplateInput { - s.DomainId = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *GetTemplateInput) SetTemplateId(v string) *GetTemplateInput { - s.TemplateId = &v - return s -} - -type GetTemplateOutput struct { - _ struct{} `type:"structure"` - - // A brief description of the template. - Description *string `locationName:"description" type:"string"` - - // Configuration of layouts associated to the template. - LayoutConfiguration *LayoutConfiguration `locationName:"layoutConfiguration" type:"structure"` - - // The name of the template. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of fields that must contain a value for a case to be successfully - // created with this template. - RequiredFields []*RequiredField `locationName:"requiredFields" type:"list"` - - // The status of the template. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"TemplateStatus"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The Amazon Resource Name (ARN) of the template. - // - // TemplateArn is a required field - TemplateArn *string `locationName:"templateArn" min:"1" type:"string" required:"true"` - - // A unique identifier of a template. - // - // TemplateId is a required field - TemplateId *string `locationName:"templateId" min:"1" 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 GetTemplateOutput) 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 GetTemplateOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *GetTemplateOutput) SetDescription(v string) *GetTemplateOutput { - s.Description = &v - return s -} - -// SetLayoutConfiguration sets the LayoutConfiguration field's value. -func (s *GetTemplateOutput) SetLayoutConfiguration(v *LayoutConfiguration) *GetTemplateOutput { - s.LayoutConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *GetTemplateOutput) SetName(v string) *GetTemplateOutput { - s.Name = &v - return s -} - -// SetRequiredFields sets the RequiredFields field's value. -func (s *GetTemplateOutput) SetRequiredFields(v []*RequiredField) *GetTemplateOutput { - s.RequiredFields = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetTemplateOutput) SetStatus(v string) *GetTemplateOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetTemplateOutput) SetTags(v map[string]*string) *GetTemplateOutput { - s.Tags = v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *GetTemplateOutput) SetTemplateArn(v string) *GetTemplateOutput { - s.TemplateArn = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *GetTemplateOutput) SetTemplateId(v string) *GetTemplateOutput { - s.TemplateId = &v - return s -} - -// We couldn't process your request because of an issue with the server. Try -// again later. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // Advice to clients on when the call can be safely retried. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Object to store configuration of layouts associated to the template. -type LayoutConfiguration struct { - _ struct{} `type:"structure"` - - // Unique identifier of a layout. - DefaultLayout *string `locationName:"defaultLayout" min:"1" 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 LayoutConfiguration) 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 LayoutConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LayoutConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LayoutConfiguration"} - if s.DefaultLayout != nil && len(*s.DefaultLayout) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DefaultLayout", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultLayout sets the DefaultLayout field's value. -func (s *LayoutConfiguration) SetDefaultLayout(v string) *LayoutConfiguration { - s.DefaultLayout = &v - return s -} - -// Object to store union of different versions of layout content. -type LayoutContent struct { - _ struct{} `type:"structure"` - - // Content specific to BasicLayout type. It configures fields in the top panel - // and More Info tab of Cases user interface. - Basic *BasicLayout `locationName:"basic" 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 LayoutContent) 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 LayoutContent) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LayoutContent) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LayoutContent"} - if s.Basic != nil { - if err := s.Basic.Validate(); err != nil { - invalidParams.AddNested("Basic", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasic sets the Basic field's value. -func (s *LayoutContent) SetBasic(v *BasicLayout) *LayoutContent { - s.Basic = v - return s -} - -// Ordered list containing different kinds of sections that can be added. A -// LayoutSections object can only contain one section. -type LayoutSections struct { - _ struct{} `type:"structure"` - - // Ordered list containing different kinds of sections that can be added. - Sections []*Section `locationName:"sections" type:"list"` -} - -// 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 LayoutSections) 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 LayoutSections) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LayoutSections) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LayoutSections"} - if s.Sections != nil { - for i, v := range s.Sections { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sections", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSections sets the Sections field's value. -func (s *LayoutSections) SetSections(v []*Section) *LayoutSections { - s.Sections = v - return s -} - -// Object for the summarized details of the layout. -type LayoutSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the layout. - // - // LayoutArn is a required field - LayoutArn *string `locationName:"layoutArn" min:"1" type:"string" required:"true"` - - // The unique identifier for of the layout. - // - // LayoutId is a required field - LayoutId *string `locationName:"layoutId" min:"1" type:"string" required:"true"` - - // The name of the layout. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 LayoutSummary) 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 LayoutSummary) GoString() string { - return s.String() -} - -// SetLayoutArn sets the LayoutArn field's value. -func (s *LayoutSummary) SetLayoutArn(v string) *LayoutSummary { - s.LayoutArn = &v - return s -} - -// SetLayoutId sets the LayoutId field's value. -func (s *LayoutSummary) SetLayoutId(v string) *LayoutSummary { - s.LayoutId = &v - return s -} - -// SetName sets the Name field's value. -func (s *LayoutSummary) SetName(v string) *LayoutSummary { - s.Name = &v - return s -} - -type ListCasesForContactInput struct { - _ struct{} `type:"structure"` - - // A unique identifier of a contact in Amazon Connect. - // - // ContactArn is a required field - ContactArn *string `locationName:"contactArn" min:"1" type:"string" required:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" 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 ListCasesForContactInput) 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 ListCasesForContactInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCasesForContactInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCasesForContactInput"} - if s.ContactArn == nil { - invalidParams.Add(request.NewErrParamRequired("ContactArn")) - } - if s.ContactArn != nil && len(*s.ContactArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ContactArn", 1)) - } - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContactArn sets the ContactArn field's value. -func (s *ListCasesForContactInput) SetContactArn(v string) *ListCasesForContactInput { - s.ContactArn = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *ListCasesForContactInput) SetDomainId(v string) *ListCasesForContactInput { - s.DomainId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCasesForContactInput) SetMaxResults(v int64) *ListCasesForContactInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCasesForContactInput) SetNextToken(v string) *ListCasesForContactInput { - s.NextToken = &v - return s -} - -type ListCasesForContactOutput struct { - _ struct{} `type:"structure"` - - // A list of Case summary information. - // - // Cases is a required field - Cases []*CaseSummary `locationName:"cases" type:"list" required:"true"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" 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 ListCasesForContactOutput) 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 ListCasesForContactOutput) GoString() string { - return s.String() -} - -// SetCases sets the Cases field's value. -func (s *ListCasesForContactOutput) SetCases(v []*CaseSummary) *ListCasesForContactOutput { - s.Cases = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCasesForContactOutput) SetNextToken(v string) *ListCasesForContactOutput { - s.NextToken = &v - return s -} - -type ListDomainsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListDomainsInput) 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 ListDomainsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDomainsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDomainsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDomainsInput) SetMaxResults(v int64) *ListDomainsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDomainsInput) SetNextToken(v string) *ListDomainsInput { - s.NextToken = &v - return s -} - -type ListDomainsOutput struct { - _ struct{} `type:"structure"` - - // The Cases domain. - // - // Domains is a required field - Domains []*DomainSummary `locationName:"domains" type:"list" required:"true"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" 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 ListDomainsOutput) 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 ListDomainsOutput) GoString() string { - return s.String() -} - -// SetDomains sets the Domains field's value. -func (s *ListDomainsOutput) SetDomains(v []*DomainSummary) *ListDomainsOutput { - s.Domains = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDomainsOutput) SetNextToken(v string) *ListDomainsOutput { - s.NextToken = &v - return s -} - -type ListFieldOptionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The unique identifier of a field. - // - // FieldId is a required field - FieldId *string `location:"uri" locationName:"fieldId" min:"1" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // A list of FieldOption values to filter on for ListFieldOptions. - Values []*string `location:"querystring" locationName:"values" type:"list"` -} - -// 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 ListFieldOptionsInput) 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 ListFieldOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListFieldOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListFieldOptionsInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.FieldId == nil { - invalidParams.Add(request.NewErrParamRequired("FieldId")) - } - if s.FieldId != nil && len(*s.FieldId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FieldId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *ListFieldOptionsInput) SetDomainId(v string) *ListFieldOptionsInput { - s.DomainId = &v - return s -} - -// SetFieldId sets the FieldId field's value. -func (s *ListFieldOptionsInput) SetFieldId(v string) *ListFieldOptionsInput { - s.FieldId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListFieldOptionsInput) SetMaxResults(v int64) *ListFieldOptionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFieldOptionsInput) SetNextToken(v string) *ListFieldOptionsInput { - s.NextToken = &v - return s -} - -// SetValues sets the Values field's value. -func (s *ListFieldOptionsInput) SetValues(v []*string) *ListFieldOptionsInput { - s.Values = v - return s -} - -type ListFieldOptionsOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of FieldOption objects. - // - // Options is a required field - Options []*FieldOption `locationName:"options" type:"list" 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 ListFieldOptionsOutput) 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 ListFieldOptionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFieldOptionsOutput) SetNextToken(v string) *ListFieldOptionsOutput { - s.NextToken = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *ListFieldOptionsOutput) SetOptions(v []*FieldOption) *ListFieldOptionsOutput { - s.Options = v - return s -} - -type ListFieldsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListFieldsInput) 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 ListFieldsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListFieldsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListFieldsInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *ListFieldsInput) SetDomainId(v string) *ListFieldsInput { - s.DomainId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListFieldsInput) SetMaxResults(v int64) *ListFieldsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFieldsInput) SetNextToken(v string) *ListFieldsInput { - s.NextToken = &v - return s -} - -type ListFieldsOutput struct { - _ struct{} `type:"structure"` - - // List of detailed field information. - // - // Fields is a required field - Fields []*FieldSummary `locationName:"fields" type:"list" required:"true"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" 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 ListFieldsOutput) 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 ListFieldsOutput) GoString() string { - return s.String() -} - -// SetFields sets the Fields field's value. -func (s *ListFieldsOutput) SetFields(v []*FieldSummary) *ListFieldsOutput { - s.Fields = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFieldsOutput) SetNextToken(v string) *ListFieldsOutput { - s.NextToken = &v - return s -} - -type ListLayoutsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListLayoutsInput) 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 ListLayoutsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListLayoutsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLayoutsInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *ListLayoutsInput) SetDomainId(v string) *ListLayoutsInput { - s.DomainId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListLayoutsInput) SetMaxResults(v int64) *ListLayoutsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLayoutsInput) SetNextToken(v string) *ListLayoutsInput { - s.NextToken = &v - return s -} - -type ListLayoutsOutput struct { - _ struct{} `type:"structure"` - - // The layouts for the domain. - // - // Layouts is a required field - Layouts []*LayoutSummary `locationName:"layouts" type:"list" required:"true"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" 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 ListLayoutsOutput) 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 ListLayoutsOutput) GoString() string { - return s.String() -} - -// SetLayouts sets the Layouts field's value. -func (s *ListLayoutsOutput) SetLayouts(v []*LayoutSummary) *ListLayoutsOutput { - s.Layouts = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLayoutsOutput) SetNextToken(v string) *ListLayoutsOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) - // - // Arn is a required field - Arn *string `location:"uri" locationName:"arn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *ListTagsForResourceInput) SetArn(v string) *ListTagsForResourceInput { - s.Arn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListTemplatesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // A list of status values to filter on. - Status []*string `location:"querystring" locationName:"status" min:"1" type:"list" enum:"TemplateStatus"` -} - -// 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 ListTemplatesInput) 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 ListTemplatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTemplatesInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Status != nil && len(s.Status) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Status", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *ListTemplatesInput) SetDomainId(v string) *ListTemplatesInput { - s.DomainId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTemplatesInput) SetMaxResults(v int64) *ListTemplatesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplatesInput) SetNextToken(v string) *ListTemplatesInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListTemplatesInput) SetStatus(v []*string) *ListTemplatesInput { - s.Status = v - return s -} - -type ListTemplatesOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // List of template summary objects. - // - // Templates is a required field - Templates []*TemplateSummary `locationName:"templates" type:"list" 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 ListTemplatesOutput) 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 ListTemplatesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplatesOutput) SetNextToken(v string) *ListTemplatesOutput { - s.NextToken = &v - return s -} - -// SetTemplates sets the Templates field's value. -func (s *ListTemplatesOutput) SetTemplates(v []*TemplateSummary) *ListTemplatesOutput { - s.Templates = v - return s -} - -type PutCaseEventConfigurationInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // Configuration to enable EventBridge case event delivery and determine what - // data is delivered. - // - // EventBridge is a required field - EventBridge *EventBridgeConfiguration `locationName:"eventBridge" type:"structure" 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 PutCaseEventConfigurationInput) 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 PutCaseEventConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutCaseEventConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutCaseEventConfigurationInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.EventBridge == nil { - invalidParams.Add(request.NewErrParamRequired("EventBridge")) - } - if s.EventBridge != nil { - if err := s.EventBridge.Validate(); err != nil { - invalidParams.AddNested("EventBridge", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *PutCaseEventConfigurationInput) SetDomainId(v string) *PutCaseEventConfigurationInput { - s.DomainId = &v - return s -} - -// SetEventBridge sets the EventBridge field's value. -func (s *PutCaseEventConfigurationInput) SetEventBridge(v *EventBridgeConfiguration) *PutCaseEventConfigurationInput { - s.EventBridge = v - return s -} - -type PutCaseEventConfigurationOutput 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 PutCaseEventConfigurationOutput) 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 PutCaseEventConfigurationOutput) GoString() string { - return s.String() -} - -// Represents the content of a particular type of related item. -type RelatedItemContent struct { - _ struct{} `type:"structure"` - - // Represents the content of a comment to be returned to agents. - Comment *CommentContent `locationName:"comment" type:"structure"` - - // Represents the content of a contact to be returned to agents. - Contact *ContactContent `locationName:"contact" 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 RelatedItemContent) 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 RelatedItemContent) GoString() string { - return s.String() -} - -// SetComment sets the Comment field's value. -func (s *RelatedItemContent) SetComment(v *CommentContent) *RelatedItemContent { - s.Comment = v - return s -} - -// SetContact sets the Contact field's value. -func (s *RelatedItemContent) SetContact(v *ContactContent) *RelatedItemContent { - s.Contact = v - return s -} - -// Details of what related item data is published through the case event stream. -type RelatedItemEventIncludedData struct { - _ struct{} `type:"structure"` - - // Details of what related item data is published through the case event stream. - // - // IncludeContent is a required field - IncludeContent *bool `locationName:"includeContent" type:"boolean" 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 RelatedItemEventIncludedData) 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 RelatedItemEventIncludedData) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RelatedItemEventIncludedData) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RelatedItemEventIncludedData"} - if s.IncludeContent == nil { - invalidParams.Add(request.NewErrParamRequired("IncludeContent")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIncludeContent sets the IncludeContent field's value. -func (s *RelatedItemEventIncludedData) SetIncludeContent(v bool) *RelatedItemEventIncludedData { - s.IncludeContent = &v - return s -} - -// Represents the content of a related item to be created. -type RelatedItemInputContent struct { - _ struct{} `type:"structure"` - - // Represents the content of a comment to be returned to agents. - Comment *CommentContent `locationName:"comment" type:"structure"` - - // Object representing a contact in Amazon Connect as an API request field. - Contact *Contact `locationName:"contact" 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 RelatedItemInputContent) 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 RelatedItemInputContent) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RelatedItemInputContent) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RelatedItemInputContent"} - if s.Comment != nil { - if err := s.Comment.Validate(); err != nil { - invalidParams.AddNested("Comment", err.(request.ErrInvalidParams)) - } - } - if s.Contact != nil { - if err := s.Contact.Validate(); err != nil { - invalidParams.AddNested("Contact", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *RelatedItemInputContent) SetComment(v *CommentContent) *RelatedItemInputContent { - s.Comment = v - return s -} - -// SetContact sets the Contact field's value. -func (s *RelatedItemInputContent) SetContact(v *Contact) *RelatedItemInputContent { - s.Contact = v - return s -} - -// The list of types of related items and their parameters to use for filtering. -type RelatedItemTypeFilter struct { - _ struct{} `type:"structure"` - - // A filter for related items of type Comment. - Comment *CommentFilter `locationName:"comment" type:"structure"` - - // A filter for related items of type Contact. - Contact *ContactFilter `locationName:"contact" 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 RelatedItemTypeFilter) 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 RelatedItemTypeFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RelatedItemTypeFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RelatedItemTypeFilter"} - if s.Contact != nil { - if err := s.Contact.Validate(); err != nil { - invalidParams.AddNested("Contact", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *RelatedItemTypeFilter) SetComment(v *CommentFilter) *RelatedItemTypeFilter { - s.Comment = v - return s -} - -// SetContact sets the Contact field's value. -func (s *RelatedItemTypeFilter) SetContact(v *ContactFilter) *RelatedItemTypeFilter { - s.Contact = v - return s -} - -// List of fields that must have a value provided to create a case. -type RequiredField struct { - _ struct{} `type:"structure"` - - // Unique identifier of a field. - // - // FieldId is a required field - FieldId *string `locationName:"fieldId" min:"1" 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 RequiredField) 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 RequiredField) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequiredField) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequiredField"} - if s.FieldId == nil { - invalidParams.Add(request.NewErrParamRequired("FieldId")) - } - if s.FieldId != nil && len(*s.FieldId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FieldId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldId sets the FieldId field's value. -func (s *RequiredField) SetFieldId(v string) *RequiredField { - s.FieldId = &v - return s -} - -// We couldn't find the requested resource. Check that your resources exists -// and were created in the same Amazon Web Services Region as your request, -// and try your request again. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // Unique identifier of the resource affected. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // Type of the resource affected. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type SearchCasesInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The list of field identifiers to be returned as part of the response. - Fields []*FieldIdentifier `locationName:"fields" type:"list"` - - // A list of filter objects. - Filter *CaseFilter `locationName:"filter" type:"structure"` - - // The maximum number of cases to return. The current maximum supported value - // is 25. This is also the default value when no other value is provided. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // A word or phrase used to perform a quick search. - SearchTerm *string `locationName:"searchTerm" type:"string"` - - // A list of sorts where each sort specifies a field and their sort order to - // be applied to the results. - Sorts []*Sort `locationName:"sorts" type:"list"` -} - -// 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 SearchCasesInput) 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 SearchCasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchCasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchCasesInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Fields != nil { - for i, v := range s.Fields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Fields", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - if s.Sorts != nil { - for i, v := range s.Sorts { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sorts", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainId sets the DomainId field's value. -func (s *SearchCasesInput) SetDomainId(v string) *SearchCasesInput { - s.DomainId = &v - return s -} - -// SetFields sets the Fields field's value. -func (s *SearchCasesInput) SetFields(v []*FieldIdentifier) *SearchCasesInput { - s.Fields = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *SearchCasesInput) SetFilter(v *CaseFilter) *SearchCasesInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchCasesInput) SetMaxResults(v int64) *SearchCasesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchCasesInput) SetNextToken(v string) *SearchCasesInput { - s.NextToken = &v - return s -} - -// SetSearchTerm sets the SearchTerm field's value. -func (s *SearchCasesInput) SetSearchTerm(v string) *SearchCasesInput { - s.SearchTerm = &v - return s -} - -// SetSorts sets the Sorts field's value. -func (s *SearchCasesInput) SetSorts(v []*Sort) *SearchCasesInput { - s.Sorts = v - return s -} - -type SearchCasesOutput struct { - _ struct{} `type:"structure"` - - // A list of case documents where each case contains the properties CaseId and - // Fields where each field is a complex union structure. - // - // Cases is a required field - Cases []*SearchCasesResponseItem `locationName:"cases" type:"list" required:"true"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" 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 SearchCasesOutput) 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 SearchCasesOutput) GoString() string { - return s.String() -} - -// SetCases sets the Cases field's value. -func (s *SearchCasesOutput) SetCases(v []*SearchCasesResponseItem) *SearchCasesOutput { - s.Cases = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchCasesOutput) SetNextToken(v string) *SearchCasesOutput { - s.NextToken = &v - return s -} - -// A list of items that represent cases. -type SearchCasesResponseItem struct { - _ struct{} `type:"structure"` - - // A unique identifier of the case. - // - // CaseId is a required field - CaseId *string `locationName:"caseId" min:"1" type:"string" required:"true"` - - // List of case field values. - // - // Fields is a required field - Fields []*FieldValue `locationName:"fields" type:"list" required:"true"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // A unique identifier of a template. - // - // TemplateId is a required field - TemplateId *string `locationName:"templateId" min:"1" 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 SearchCasesResponseItem) 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 SearchCasesResponseItem) GoString() string { - return s.String() -} - -// SetCaseId sets the CaseId field's value. -func (s *SearchCasesResponseItem) SetCaseId(v string) *SearchCasesResponseItem { - s.CaseId = &v - return s -} - -// SetFields sets the Fields field's value. -func (s *SearchCasesResponseItem) SetFields(v []*FieldValue) *SearchCasesResponseItem { - s.Fields = v - return s -} - -// SetTags sets the Tags field's value. -func (s *SearchCasesResponseItem) SetTags(v map[string]*string) *SearchCasesResponseItem { - s.Tags = v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *SearchCasesResponseItem) SetTemplateId(v string) *SearchCasesResponseItem { - s.TemplateId = &v - return s -} - -type SearchRelatedItemsInput struct { - _ struct{} `type:"structure"` - - // A unique identifier of the case. - // - // CaseId is a required field - CaseId *string `location:"uri" locationName:"caseId" min:"1" type:"string" required:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The list of types of related items and their parameters to use for filtering. - Filters []*RelatedItemTypeFilter `locationName:"filters" type:"list"` - - // The maximum number of results to return per page. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" 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 SearchRelatedItemsInput) 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 SearchRelatedItemsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchRelatedItemsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchRelatedItemsInput"} - if s.CaseId == nil { - invalidParams.Add(request.NewErrParamRequired("CaseId")) - } - if s.CaseId != nil && len(*s.CaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CaseId", 1)) - } - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaseId sets the CaseId field's value. -func (s *SearchRelatedItemsInput) SetCaseId(v string) *SearchRelatedItemsInput { - s.CaseId = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *SearchRelatedItemsInput) SetDomainId(v string) *SearchRelatedItemsInput { - s.DomainId = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *SearchRelatedItemsInput) SetFilters(v []*RelatedItemTypeFilter) *SearchRelatedItemsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchRelatedItemsInput) SetMaxResults(v int64) *SearchRelatedItemsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchRelatedItemsInput) SetNextToken(v string) *SearchRelatedItemsInput { - s.NextToken = &v - return s -} - -type SearchRelatedItemsOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. This is null if there are no more - // results to return. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of items related to a case. - // - // RelatedItems is a required field - RelatedItems []*SearchRelatedItemsResponseItem `locationName:"relatedItems" type:"list" 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 SearchRelatedItemsOutput) 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 SearchRelatedItemsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchRelatedItemsOutput) SetNextToken(v string) *SearchRelatedItemsOutput { - s.NextToken = &v - return s -} - -// SetRelatedItems sets the RelatedItems field's value. -func (s *SearchRelatedItemsOutput) SetRelatedItems(v []*SearchRelatedItemsResponseItem) *SearchRelatedItemsOutput { - s.RelatedItems = v - return s -} - -// A list of items that represent RelatedItems. -type SearchRelatedItemsResponseItem struct { - _ struct{} `type:"structure"` - - // Time at which a related item was associated with a case. - // - // AssociationTime is a required field - AssociationTime *time.Time `locationName:"associationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Represents the content of a particular type of related item. - // - // Content is a required field - Content *RelatedItemContent `locationName:"content" type:"structure" required:"true"` - - // Represents the creator of the related item. - PerformedBy *UserUnion `locationName:"performedBy" type:"structure"` - - // Unique identifier of a related item. - // - // RelatedItemId is a required field - RelatedItemId *string `locationName:"relatedItemId" min:"1" type:"string" required:"true"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // Type of a related item. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RelatedItemType"` -} - -// 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 SearchRelatedItemsResponseItem) 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 SearchRelatedItemsResponseItem) GoString() string { - return s.String() -} - -// SetAssociationTime sets the AssociationTime field's value. -func (s *SearchRelatedItemsResponseItem) SetAssociationTime(v time.Time) *SearchRelatedItemsResponseItem { - s.AssociationTime = &v - return s -} - -// SetContent sets the Content field's value. -func (s *SearchRelatedItemsResponseItem) SetContent(v *RelatedItemContent) *SearchRelatedItemsResponseItem { - s.Content = v - return s -} - -// SetPerformedBy sets the PerformedBy field's value. -func (s *SearchRelatedItemsResponseItem) SetPerformedBy(v *UserUnion) *SearchRelatedItemsResponseItem { - s.PerformedBy = v - return s -} - -// SetRelatedItemId sets the RelatedItemId field's value. -func (s *SearchRelatedItemsResponseItem) SetRelatedItemId(v string) *SearchRelatedItemsResponseItem { - s.RelatedItemId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SearchRelatedItemsResponseItem) SetTags(v map[string]*string) *SearchRelatedItemsResponseItem { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *SearchRelatedItemsResponseItem) SetType(v string) *SearchRelatedItemsResponseItem { - s.Type = &v - return s -} - -// This represents a sections within a panel or tab of the page layout. -type Section struct { - _ struct{} `type:"structure"` - - // Consists of a group of fields and associated properties. - FieldGroup *FieldGroup `locationName:"fieldGroup" 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 Section) 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 Section) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Section) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Section"} - if s.FieldGroup != nil { - if err := s.FieldGroup.Validate(); err != nil { - invalidParams.AddNested("FieldGroup", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldGroup sets the FieldGroup field's value. -func (s *Section) SetFieldGroup(v *FieldGroup) *Section { - s.FieldGroup = v - return s -} - -// The service quota has been exceeded. For a list of service quotas, see Amazon -// Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) -// in the Amazon Connect Administrator Guide. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A structured set of sort terms. -type Sort struct { - _ struct{} `type:"structure"` - - // Unique identifier of a field. - // - // FieldId is a required field - FieldId *string `locationName:"fieldId" min:"1" type:"string" required:"true"` - - // A structured set of sort terms - // - // SortOrder is a required field - SortOrder *string `locationName:"sortOrder" type:"string" required:"true" enum:"Order"` -} - -// 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 Sort) 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 Sort) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Sort) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Sort"} - if s.FieldId == nil { - invalidParams.Add(request.NewErrParamRequired("FieldId")) - } - if s.FieldId != nil && len(*s.FieldId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FieldId", 1)) - } - if s.SortOrder == nil { - invalidParams.Add(request.NewErrParamRequired("SortOrder")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldId sets the FieldId field's value. -func (s *Sort) SetFieldId(v string) *Sort { - s.FieldId = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *Sort) SetSortOrder(v string) *Sort { - s.SortOrder = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) - // - // Arn is a required field - Arn *string `location:"uri" locationName:"arn" min:"1" type:"string" required:"true"` - - // A map of of key-value pairs that represent tags on a resource. Tags are used - // to organize, track, or control access for this resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *TagResourceInput) SetArn(v string) *TagResourceInput { - s.Arn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Template summary information. -type TemplateSummary struct { - _ struct{} `type:"structure"` - - // The template name. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The status of the template. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"TemplateStatus"` - - // The Amazon Resource Name (ARN) of the template. - // - // TemplateArn is a required field - TemplateArn *string `locationName:"templateArn" min:"1" type:"string" required:"true"` - - // The unique identifier for the template. - // - // TemplateId is a required field - TemplateId *string `locationName:"templateId" min:"1" 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 TemplateSummary) 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 TemplateSummary) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *TemplateSummary) SetName(v string) *TemplateSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TemplateSummary) SetStatus(v string) *TemplateSummary { - s.Status = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *TemplateSummary) SetTemplateArn(v string) *TemplateSummary { - s.TemplateArn = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *TemplateSummary) SetTemplateId(v string) *TemplateSummary { - s.TemplateId = &v - return s -} - -// The rate has been exceeded for this API. Please try again after a few minutes. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) - // - // Arn is a required field - Arn *string `location:"uri" locationName:"arn" min:"1" type:"string" required:"true"` - - // List of tag keys. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *UntagResourceInput) SetArn(v string) *UntagResourceInput { - s.Arn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateCaseInput struct { - _ struct{} `type:"structure"` - - // A unique identifier of the case. - // - // CaseId is a required field - CaseId *string `location:"uri" locationName:"caseId" min:"1" type:"string" required:"true"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // An array of objects with fieldId (matching ListFields/DescribeField) and - // value union data, structured identical to CreateCase. - // - // Fields is a required field - Fields []*FieldValue `locationName:"fields" type:"list" 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 UpdateCaseInput) 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 UpdateCaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCaseInput"} - if s.CaseId == nil { - invalidParams.Add(request.NewErrParamRequired("CaseId")) - } - if s.CaseId != nil && len(*s.CaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CaseId", 1)) - } - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Fields == nil { - invalidParams.Add(request.NewErrParamRequired("Fields")) - } - if s.Fields != nil { - for i, v := range s.Fields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Fields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaseId sets the CaseId field's value. -func (s *UpdateCaseInput) SetCaseId(v string) *UpdateCaseInput { - s.CaseId = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateCaseInput) SetDomainId(v string) *UpdateCaseInput { - s.DomainId = &v - return s -} - -// SetFields sets the Fields field's value. -func (s *UpdateCaseInput) SetFields(v []*FieldValue) *UpdateCaseInput { - s.Fields = v - return s -} - -type UpdateCaseOutput 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 UpdateCaseOutput) 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 UpdateCaseOutput) GoString() string { - return s.String() -} - -type UpdateFieldInput struct { - _ struct{} `type:"structure"` - - // The description of a field. - Description *string `locationName:"description" type:"string"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The unique identifier of a field. - // - // FieldId is a required field - FieldId *string `location:"uri" locationName:"fieldId" min:"1" type:"string" required:"true"` - - // The name of the field. - Name *string `locationName:"name" min:"1" 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 UpdateFieldInput) 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 UpdateFieldInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateFieldInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateFieldInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.FieldId == nil { - invalidParams.Add(request.NewErrParamRequired("FieldId")) - } - if s.FieldId != nil && len(*s.FieldId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FieldId", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateFieldInput) SetDescription(v string) *UpdateFieldInput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateFieldInput) SetDomainId(v string) *UpdateFieldInput { - s.DomainId = &v - return s -} - -// SetFieldId sets the FieldId field's value. -func (s *UpdateFieldInput) SetFieldId(v string) *UpdateFieldInput { - s.FieldId = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateFieldInput) SetName(v string) *UpdateFieldInput { - s.Name = &v - return s -} - -type UpdateFieldOutput 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 UpdateFieldOutput) 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 UpdateFieldOutput) GoString() string { - return s.String() -} - -type UpdateLayoutInput struct { - _ struct{} `type:"structure"` - - // Information about which fields will be present in the layout, the order of - // the fields. - Content *LayoutContent `locationName:"content" type:"structure"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // The unique identifier of the layout. - // - // LayoutId is a required field - LayoutId *string `location:"uri" locationName:"layoutId" min:"1" type:"string" required:"true"` - - // The name of the layout. It must be unique per domain. - Name *string `locationName:"name" min:"1" 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 UpdateLayoutInput) 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 UpdateLayoutInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateLayoutInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateLayoutInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.LayoutId == nil { - invalidParams.Add(request.NewErrParamRequired("LayoutId")) - } - if s.LayoutId != nil && len(*s.LayoutId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LayoutId", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Content != nil { - if err := s.Content.Validate(); err != nil { - invalidParams.AddNested("Content", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *UpdateLayoutInput) SetContent(v *LayoutContent) *UpdateLayoutInput { - s.Content = v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateLayoutInput) SetDomainId(v string) *UpdateLayoutInput { - s.DomainId = &v - return s -} - -// SetLayoutId sets the LayoutId field's value. -func (s *UpdateLayoutInput) SetLayoutId(v string) *UpdateLayoutInput { - s.LayoutId = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateLayoutInput) SetName(v string) *UpdateLayoutInput { - s.Name = &v - return s -} - -type UpdateLayoutOutput 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 UpdateLayoutOutput) 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 UpdateLayoutOutput) GoString() string { - return s.String() -} - -type UpdateTemplateInput struct { - _ struct{} `type:"structure"` - - // A brief description of the template. - Description *string `locationName:"description" type:"string"` - - // The unique identifier of the Cases domain. - // - // DomainId is a required field - DomainId *string `location:"uri" locationName:"domainId" min:"1" type:"string" required:"true"` - - // Configuration of layouts associated to the template. - LayoutConfiguration *LayoutConfiguration `locationName:"layoutConfiguration" type:"structure"` - - // The name of the template. It must be unique per domain. - Name *string `locationName:"name" min:"1" type:"string"` - - // A list of fields that must contain a value for a case to be successfully - // created with this template. - RequiredFields []*RequiredField `locationName:"requiredFields" type:"list"` - - // The status of the template. - Status *string `locationName:"status" type:"string" enum:"TemplateStatus"` - - // A unique identifier for the template. - // - // TemplateId is a required field - TemplateId *string `location:"uri" locationName:"templateId" min:"1" 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 UpdateTemplateInput) 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 UpdateTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTemplateInput"} - if s.DomainId == nil { - invalidParams.Add(request.NewErrParamRequired("DomainId")) - } - if s.DomainId != nil && len(*s.DomainId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainId", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateId")) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - if s.LayoutConfiguration != nil { - if err := s.LayoutConfiguration.Validate(); err != nil { - invalidParams.AddNested("LayoutConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.RequiredFields != nil { - for i, v := range s.RequiredFields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RequiredFields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateTemplateInput) SetDescription(v string) *UpdateTemplateInput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateTemplateInput) SetDomainId(v string) *UpdateTemplateInput { - s.DomainId = &v - return s -} - -// SetLayoutConfiguration sets the LayoutConfiguration field's value. -func (s *UpdateTemplateInput) SetLayoutConfiguration(v *LayoutConfiguration) *UpdateTemplateInput { - s.LayoutConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateTemplateInput) SetName(v string) *UpdateTemplateInput { - s.Name = &v - return s -} - -// SetRequiredFields sets the RequiredFields field's value. -func (s *UpdateTemplateInput) SetRequiredFields(v []*RequiredField) *UpdateTemplateInput { - s.RequiredFields = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateTemplateInput) SetStatus(v string) *UpdateTemplateInput { - s.Status = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *UpdateTemplateInput) SetTemplateId(v string) *UpdateTemplateInput { - s.TemplateId = &v - return s -} - -type UpdateTemplateOutput 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 UpdateTemplateOutput) 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 UpdateTemplateOutput) GoString() string { - return s.String() -} - -// Represents the identity of the person who performed the action. -type UserUnion struct { - _ struct{} `type:"structure"` - - // Represents the Amazon Connect ARN of the user. - UserArn *string `locationName:"userArn" min:"1" 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 UserUnion) 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 UserUnion) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UserUnion) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UserUnion"} - if s.UserArn != nil && len(*s.UserArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUserArn sets the UserArn field's value. -func (s *UserUnion) SetUserArn(v string) *UserUnion { - s.UserArn = &v - return s -} - -// The request isn't valid. Check the syntax and try again. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // CommentBodyTextTypeTextPlain is a CommentBodyTextType enum value - CommentBodyTextTypeTextPlain = "Text/Plain" -) - -// CommentBodyTextType_Values returns all elements of the CommentBodyTextType enum -func CommentBodyTextType_Values() []string { - return []string{ - CommentBodyTextTypeTextPlain, - } -} - -const ( - // DomainStatusActive is a DomainStatus enum value - DomainStatusActive = "Active" - - // DomainStatusCreationInProgress is a DomainStatus enum value - DomainStatusCreationInProgress = "CreationInProgress" - - // DomainStatusCreationFailed is a DomainStatus enum value - DomainStatusCreationFailed = "CreationFailed" -) - -// DomainStatus_Values returns all elements of the DomainStatus enum -func DomainStatus_Values() []string { - return []string{ - DomainStatusActive, - DomainStatusCreationInProgress, - DomainStatusCreationFailed, - } -} - -const ( - // FieldNamespaceSystem is a FieldNamespace enum value - FieldNamespaceSystem = "System" - - // FieldNamespaceCustom is a FieldNamespace enum value - FieldNamespaceCustom = "Custom" -) - -// FieldNamespace_Values returns all elements of the FieldNamespace enum -func FieldNamespace_Values() []string { - return []string{ - FieldNamespaceSystem, - FieldNamespaceCustom, - } -} - -const ( - // FieldTypeText is a FieldType enum value - FieldTypeText = "Text" - - // FieldTypeNumber is a FieldType enum value - FieldTypeNumber = "Number" - - // FieldTypeBoolean is a FieldType enum value - FieldTypeBoolean = "Boolean" - - // FieldTypeDateTime is a FieldType enum value - FieldTypeDateTime = "DateTime" - - // FieldTypeSingleSelect is a FieldType enum value - FieldTypeSingleSelect = "SingleSelect" - - // FieldTypeUrl is a FieldType enum value - FieldTypeUrl = "Url" -) - -// FieldType_Values returns all elements of the FieldType enum -func FieldType_Values() []string { - return []string{ - FieldTypeText, - FieldTypeNumber, - FieldTypeBoolean, - FieldTypeDateTime, - FieldTypeSingleSelect, - FieldTypeUrl, - } -} - -const ( - // OrderAsc is a Order enum value - OrderAsc = "Asc" - - // OrderDesc is a Order enum value - OrderDesc = "Desc" -) - -// Order_Values returns all elements of the Order enum -func Order_Values() []string { - return []string{ - OrderAsc, - OrderDesc, - } -} - -const ( - // RelatedItemTypeContact is a RelatedItemType enum value - RelatedItemTypeContact = "Contact" - - // RelatedItemTypeComment is a RelatedItemType enum value - RelatedItemTypeComment = "Comment" -) - -// RelatedItemType_Values returns all elements of the RelatedItemType enum -func RelatedItemType_Values() []string { - return []string{ - RelatedItemTypeContact, - RelatedItemTypeComment, - } -} - -const ( - // TemplateStatusActive is a TemplateStatus enum value - TemplateStatusActive = "Active" - - // TemplateStatusInactive is a TemplateStatus enum value - TemplateStatusInactive = "Inactive" -) - -// TemplateStatus_Values returns all elements of the TemplateStatus enum -func TemplateStatus_Values() []string { - return []string{ - TemplateStatusActive, - TemplateStatusInactive, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/connectcasesiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/connectcasesiface/interface.go deleted file mode 100644 index a23dc93c0853..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/connectcasesiface/interface.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package connectcasesiface provides an interface to enable mocking the Amazon Connect Cases service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package connectcasesiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases" -) - -// ConnectCasesAPI provides an interface to enable mocking the -// connectcases.ConnectCases service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Connect Cases. -// func myFunc(svc connectcasesiface.ConnectCasesAPI) bool { -// // Make svc.BatchGetField request -// } -// -// func main() { -// sess := session.New() -// svc := connectcases.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockConnectCasesClient struct { -// connectcasesiface.ConnectCasesAPI -// } -// func (m *mockConnectCasesClient) BatchGetField(input *connectcases.BatchGetFieldInput) (*connectcases.BatchGetFieldOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockConnectCasesClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type ConnectCasesAPI interface { - BatchGetField(*connectcases.BatchGetFieldInput) (*connectcases.BatchGetFieldOutput, error) - BatchGetFieldWithContext(aws.Context, *connectcases.BatchGetFieldInput, ...request.Option) (*connectcases.BatchGetFieldOutput, error) - BatchGetFieldRequest(*connectcases.BatchGetFieldInput) (*request.Request, *connectcases.BatchGetFieldOutput) - - BatchPutFieldOptions(*connectcases.BatchPutFieldOptionsInput) (*connectcases.BatchPutFieldOptionsOutput, error) - BatchPutFieldOptionsWithContext(aws.Context, *connectcases.BatchPutFieldOptionsInput, ...request.Option) (*connectcases.BatchPutFieldOptionsOutput, error) - BatchPutFieldOptionsRequest(*connectcases.BatchPutFieldOptionsInput) (*request.Request, *connectcases.BatchPutFieldOptionsOutput) - - CreateCase(*connectcases.CreateCaseInput) (*connectcases.CreateCaseOutput, error) - CreateCaseWithContext(aws.Context, *connectcases.CreateCaseInput, ...request.Option) (*connectcases.CreateCaseOutput, error) - CreateCaseRequest(*connectcases.CreateCaseInput) (*request.Request, *connectcases.CreateCaseOutput) - - CreateDomain(*connectcases.CreateDomainInput) (*connectcases.CreateDomainOutput, error) - CreateDomainWithContext(aws.Context, *connectcases.CreateDomainInput, ...request.Option) (*connectcases.CreateDomainOutput, error) - CreateDomainRequest(*connectcases.CreateDomainInput) (*request.Request, *connectcases.CreateDomainOutput) - - CreateField(*connectcases.CreateFieldInput) (*connectcases.CreateFieldOutput, error) - CreateFieldWithContext(aws.Context, *connectcases.CreateFieldInput, ...request.Option) (*connectcases.CreateFieldOutput, error) - CreateFieldRequest(*connectcases.CreateFieldInput) (*request.Request, *connectcases.CreateFieldOutput) - - CreateLayout(*connectcases.CreateLayoutInput) (*connectcases.CreateLayoutOutput, error) - CreateLayoutWithContext(aws.Context, *connectcases.CreateLayoutInput, ...request.Option) (*connectcases.CreateLayoutOutput, error) - CreateLayoutRequest(*connectcases.CreateLayoutInput) (*request.Request, *connectcases.CreateLayoutOutput) - - CreateRelatedItem(*connectcases.CreateRelatedItemInput) (*connectcases.CreateRelatedItemOutput, error) - CreateRelatedItemWithContext(aws.Context, *connectcases.CreateRelatedItemInput, ...request.Option) (*connectcases.CreateRelatedItemOutput, error) - CreateRelatedItemRequest(*connectcases.CreateRelatedItemInput) (*request.Request, *connectcases.CreateRelatedItemOutput) - - CreateTemplate(*connectcases.CreateTemplateInput) (*connectcases.CreateTemplateOutput, error) - CreateTemplateWithContext(aws.Context, *connectcases.CreateTemplateInput, ...request.Option) (*connectcases.CreateTemplateOutput, error) - CreateTemplateRequest(*connectcases.CreateTemplateInput) (*request.Request, *connectcases.CreateTemplateOutput) - - DeleteDomain(*connectcases.DeleteDomainInput) (*connectcases.DeleteDomainOutput, error) - DeleteDomainWithContext(aws.Context, *connectcases.DeleteDomainInput, ...request.Option) (*connectcases.DeleteDomainOutput, error) - DeleteDomainRequest(*connectcases.DeleteDomainInput) (*request.Request, *connectcases.DeleteDomainOutput) - - GetCase(*connectcases.GetCaseInput) (*connectcases.GetCaseOutput, error) - GetCaseWithContext(aws.Context, *connectcases.GetCaseInput, ...request.Option) (*connectcases.GetCaseOutput, error) - GetCaseRequest(*connectcases.GetCaseInput) (*request.Request, *connectcases.GetCaseOutput) - - GetCasePages(*connectcases.GetCaseInput, func(*connectcases.GetCaseOutput, bool) bool) error - GetCasePagesWithContext(aws.Context, *connectcases.GetCaseInput, func(*connectcases.GetCaseOutput, bool) bool, ...request.Option) error - - GetCaseEventConfiguration(*connectcases.GetCaseEventConfigurationInput) (*connectcases.GetCaseEventConfigurationOutput, error) - GetCaseEventConfigurationWithContext(aws.Context, *connectcases.GetCaseEventConfigurationInput, ...request.Option) (*connectcases.GetCaseEventConfigurationOutput, error) - GetCaseEventConfigurationRequest(*connectcases.GetCaseEventConfigurationInput) (*request.Request, *connectcases.GetCaseEventConfigurationOutput) - - GetDomain(*connectcases.GetDomainInput) (*connectcases.GetDomainOutput, error) - GetDomainWithContext(aws.Context, *connectcases.GetDomainInput, ...request.Option) (*connectcases.GetDomainOutput, error) - GetDomainRequest(*connectcases.GetDomainInput) (*request.Request, *connectcases.GetDomainOutput) - - GetLayout(*connectcases.GetLayoutInput) (*connectcases.GetLayoutOutput, error) - GetLayoutWithContext(aws.Context, *connectcases.GetLayoutInput, ...request.Option) (*connectcases.GetLayoutOutput, error) - GetLayoutRequest(*connectcases.GetLayoutInput) (*request.Request, *connectcases.GetLayoutOutput) - - GetTemplate(*connectcases.GetTemplateInput) (*connectcases.GetTemplateOutput, error) - GetTemplateWithContext(aws.Context, *connectcases.GetTemplateInput, ...request.Option) (*connectcases.GetTemplateOutput, error) - GetTemplateRequest(*connectcases.GetTemplateInput) (*request.Request, *connectcases.GetTemplateOutput) - - ListCasesForContact(*connectcases.ListCasesForContactInput) (*connectcases.ListCasesForContactOutput, error) - ListCasesForContactWithContext(aws.Context, *connectcases.ListCasesForContactInput, ...request.Option) (*connectcases.ListCasesForContactOutput, error) - ListCasesForContactRequest(*connectcases.ListCasesForContactInput) (*request.Request, *connectcases.ListCasesForContactOutput) - - ListCasesForContactPages(*connectcases.ListCasesForContactInput, func(*connectcases.ListCasesForContactOutput, bool) bool) error - ListCasesForContactPagesWithContext(aws.Context, *connectcases.ListCasesForContactInput, func(*connectcases.ListCasesForContactOutput, bool) bool, ...request.Option) error - - ListDomains(*connectcases.ListDomainsInput) (*connectcases.ListDomainsOutput, error) - ListDomainsWithContext(aws.Context, *connectcases.ListDomainsInput, ...request.Option) (*connectcases.ListDomainsOutput, error) - ListDomainsRequest(*connectcases.ListDomainsInput) (*request.Request, *connectcases.ListDomainsOutput) - - ListDomainsPages(*connectcases.ListDomainsInput, func(*connectcases.ListDomainsOutput, bool) bool) error - ListDomainsPagesWithContext(aws.Context, *connectcases.ListDomainsInput, func(*connectcases.ListDomainsOutput, bool) bool, ...request.Option) error - - ListFieldOptions(*connectcases.ListFieldOptionsInput) (*connectcases.ListFieldOptionsOutput, error) - ListFieldOptionsWithContext(aws.Context, *connectcases.ListFieldOptionsInput, ...request.Option) (*connectcases.ListFieldOptionsOutput, error) - ListFieldOptionsRequest(*connectcases.ListFieldOptionsInput) (*request.Request, *connectcases.ListFieldOptionsOutput) - - ListFieldOptionsPages(*connectcases.ListFieldOptionsInput, func(*connectcases.ListFieldOptionsOutput, bool) bool) error - ListFieldOptionsPagesWithContext(aws.Context, *connectcases.ListFieldOptionsInput, func(*connectcases.ListFieldOptionsOutput, bool) bool, ...request.Option) error - - ListFields(*connectcases.ListFieldsInput) (*connectcases.ListFieldsOutput, error) - ListFieldsWithContext(aws.Context, *connectcases.ListFieldsInput, ...request.Option) (*connectcases.ListFieldsOutput, error) - ListFieldsRequest(*connectcases.ListFieldsInput) (*request.Request, *connectcases.ListFieldsOutput) - - ListFieldsPages(*connectcases.ListFieldsInput, func(*connectcases.ListFieldsOutput, bool) bool) error - ListFieldsPagesWithContext(aws.Context, *connectcases.ListFieldsInput, func(*connectcases.ListFieldsOutput, bool) bool, ...request.Option) error - - ListLayouts(*connectcases.ListLayoutsInput) (*connectcases.ListLayoutsOutput, error) - ListLayoutsWithContext(aws.Context, *connectcases.ListLayoutsInput, ...request.Option) (*connectcases.ListLayoutsOutput, error) - ListLayoutsRequest(*connectcases.ListLayoutsInput) (*request.Request, *connectcases.ListLayoutsOutput) - - ListLayoutsPages(*connectcases.ListLayoutsInput, func(*connectcases.ListLayoutsOutput, bool) bool) error - ListLayoutsPagesWithContext(aws.Context, *connectcases.ListLayoutsInput, func(*connectcases.ListLayoutsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*connectcases.ListTagsForResourceInput) (*connectcases.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *connectcases.ListTagsForResourceInput, ...request.Option) (*connectcases.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*connectcases.ListTagsForResourceInput) (*request.Request, *connectcases.ListTagsForResourceOutput) - - ListTemplates(*connectcases.ListTemplatesInput) (*connectcases.ListTemplatesOutput, error) - ListTemplatesWithContext(aws.Context, *connectcases.ListTemplatesInput, ...request.Option) (*connectcases.ListTemplatesOutput, error) - ListTemplatesRequest(*connectcases.ListTemplatesInput) (*request.Request, *connectcases.ListTemplatesOutput) - - ListTemplatesPages(*connectcases.ListTemplatesInput, func(*connectcases.ListTemplatesOutput, bool) bool) error - ListTemplatesPagesWithContext(aws.Context, *connectcases.ListTemplatesInput, func(*connectcases.ListTemplatesOutput, bool) bool, ...request.Option) error - - PutCaseEventConfiguration(*connectcases.PutCaseEventConfigurationInput) (*connectcases.PutCaseEventConfigurationOutput, error) - PutCaseEventConfigurationWithContext(aws.Context, *connectcases.PutCaseEventConfigurationInput, ...request.Option) (*connectcases.PutCaseEventConfigurationOutput, error) - PutCaseEventConfigurationRequest(*connectcases.PutCaseEventConfigurationInput) (*request.Request, *connectcases.PutCaseEventConfigurationOutput) - - SearchCases(*connectcases.SearchCasesInput) (*connectcases.SearchCasesOutput, error) - SearchCasesWithContext(aws.Context, *connectcases.SearchCasesInput, ...request.Option) (*connectcases.SearchCasesOutput, error) - SearchCasesRequest(*connectcases.SearchCasesInput) (*request.Request, *connectcases.SearchCasesOutput) - - SearchCasesPages(*connectcases.SearchCasesInput, func(*connectcases.SearchCasesOutput, bool) bool) error - SearchCasesPagesWithContext(aws.Context, *connectcases.SearchCasesInput, func(*connectcases.SearchCasesOutput, bool) bool, ...request.Option) error - - SearchRelatedItems(*connectcases.SearchRelatedItemsInput) (*connectcases.SearchRelatedItemsOutput, error) - SearchRelatedItemsWithContext(aws.Context, *connectcases.SearchRelatedItemsInput, ...request.Option) (*connectcases.SearchRelatedItemsOutput, error) - SearchRelatedItemsRequest(*connectcases.SearchRelatedItemsInput) (*request.Request, *connectcases.SearchRelatedItemsOutput) - - SearchRelatedItemsPages(*connectcases.SearchRelatedItemsInput, func(*connectcases.SearchRelatedItemsOutput, bool) bool) error - SearchRelatedItemsPagesWithContext(aws.Context, *connectcases.SearchRelatedItemsInput, func(*connectcases.SearchRelatedItemsOutput, bool) bool, ...request.Option) error - - TagResource(*connectcases.TagResourceInput) (*connectcases.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *connectcases.TagResourceInput, ...request.Option) (*connectcases.TagResourceOutput, error) - TagResourceRequest(*connectcases.TagResourceInput) (*request.Request, *connectcases.TagResourceOutput) - - UntagResource(*connectcases.UntagResourceInput) (*connectcases.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *connectcases.UntagResourceInput, ...request.Option) (*connectcases.UntagResourceOutput, error) - UntagResourceRequest(*connectcases.UntagResourceInput) (*request.Request, *connectcases.UntagResourceOutput) - - UpdateCase(*connectcases.UpdateCaseInput) (*connectcases.UpdateCaseOutput, error) - UpdateCaseWithContext(aws.Context, *connectcases.UpdateCaseInput, ...request.Option) (*connectcases.UpdateCaseOutput, error) - UpdateCaseRequest(*connectcases.UpdateCaseInput) (*request.Request, *connectcases.UpdateCaseOutput) - - UpdateField(*connectcases.UpdateFieldInput) (*connectcases.UpdateFieldOutput, error) - UpdateFieldWithContext(aws.Context, *connectcases.UpdateFieldInput, ...request.Option) (*connectcases.UpdateFieldOutput, error) - UpdateFieldRequest(*connectcases.UpdateFieldInput) (*request.Request, *connectcases.UpdateFieldOutput) - - UpdateLayout(*connectcases.UpdateLayoutInput) (*connectcases.UpdateLayoutOutput, error) - UpdateLayoutWithContext(aws.Context, *connectcases.UpdateLayoutInput, ...request.Option) (*connectcases.UpdateLayoutOutput, error) - UpdateLayoutRequest(*connectcases.UpdateLayoutInput) (*request.Request, *connectcases.UpdateLayoutOutput) - - UpdateTemplate(*connectcases.UpdateTemplateInput) (*connectcases.UpdateTemplateOutput, error) - UpdateTemplateWithContext(aws.Context, *connectcases.UpdateTemplateInput, ...request.Option) (*connectcases.UpdateTemplateOutput, error) - UpdateTemplateRequest(*connectcases.UpdateTemplateInput) (*request.Request, *connectcases.UpdateTemplateOutput) -} - -var _ ConnectCasesAPI = (*connectcases.ConnectCases)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/doc.go deleted file mode 100644 index f98ae48eda4f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/doc.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package connectcases provides the client and types for making API -// requests to Amazon Connect Cases. -// -// With Amazon Connect Cases, your agents can track and manage customer issues -// that require multiple interactions, follow-up tasks, and teams in your contact -// center. A case represents a customer issue. It records the issue, the steps -// and interactions taken to resolve the issue, and the outcome. For more information, -// see Amazon Connect Cases (https://docs.aws.amazon.com/connect/latest/adminguide/cases.html) -// in the Amazon Connect Administrator Guide. -// -// See https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03 for more information on this service. -// -// See connectcases package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/connectcases/ -// -// # Using the Client -// -// To contact Amazon Connect Cases with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Connect Cases client ConnectCases for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/connectcases/#New -package connectcases diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/errors.go deleted file mode 100644 index 22d8958887af..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/errors.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package connectcases - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The requested operation would cause a conflict with the current state of - // a service resource associated with the request. Resolve the conflict before - // retrying this request. See the accompanying error message for details. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // We couldn't process your request because of an issue with the server. Try - // again later. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // We couldn't find the requested resource. Check that your resources exists - // and were created in the same Amazon Web Services Region as your request, - // and try your request again. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The service quota has been exceeded. For a list of service quotas, see Amazon - // Connect Service Quotas (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html) - // in the Amazon Connect Administrator Guide. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The rate has been exceeded for this API. Please try again after a few minutes. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The request isn't valid. Check the syntax and try again. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/service.go deleted file mode 100644 index b86dfdf36dd3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/connectcases/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package connectcases - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// ConnectCases provides the API operation methods for making requests to -// Amazon Connect Cases. See this package's package overview docs -// for details on the service. -// -// ConnectCases methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ConnectCases struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ConnectCases" // Name of service. - EndpointsID = "cases" // ID to lookup a service endpoint with. - ServiceID = "ConnectCases" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the ConnectCases client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a ConnectCases client from just a session. -// svc := connectcases.New(mySession) -// -// // Create a ConnectCases client with additional configuration -// svc := connectcases.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ConnectCases { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "cases" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ConnectCases { - svc := &ConnectCases{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-10-03", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ConnectCases operation and runs any -// custom request initialization. -func (c *ConnectCases) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/api.go deleted file mode 100644 index d1c08a296d86..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/api.go +++ /dev/null @@ -1,3412 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package controltower - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opDeleteLandingZone = "DeleteLandingZone" - -// DeleteLandingZoneRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLandingZone 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 DeleteLandingZone for more information on using the DeleteLandingZone -// 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 DeleteLandingZoneRequest method. -// req, resp := client.DeleteLandingZoneRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/DeleteLandingZone -func (c *ControlTower) DeleteLandingZoneRequest(input *DeleteLandingZoneInput) (req *request.Request, output *DeleteLandingZoneOutput) { - op := &request.Operation{ - Name: opDeleteLandingZone, - HTTPMethod: "POST", - HTTPPath: "/delete-landingzone", - } - - if input == nil { - input = &DeleteLandingZoneInput{} - } - - output = &DeleteLandingZoneOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteLandingZone API operation for AWS Control Tower. -// -// Decommissions a landing zone. This API call starts an asynchronous operation -// that deletes Amazon Web Services Control Tower resources deployed in accounts -// managed by Amazon Web Services Control Tower. -// -// 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 AWS Control Tower's -// API operation DeleteLandingZone for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/DeleteLandingZone -func (c *ControlTower) DeleteLandingZone(input *DeleteLandingZoneInput) (*DeleteLandingZoneOutput, error) { - req, out := c.DeleteLandingZoneRequest(input) - return out, req.Send() -} - -// DeleteLandingZoneWithContext is the same as DeleteLandingZone with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteLandingZone 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 *ControlTower) DeleteLandingZoneWithContext(ctx aws.Context, input *DeleteLandingZoneInput, opts ...request.Option) (*DeleteLandingZoneOutput, error) { - req, out := c.DeleteLandingZoneRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableControl = "DisableControl" - -// DisableControlRequest generates a "aws/request.Request" representing the -// client's request for the DisableControl 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 DisableControl for more information on using the DisableControl -// 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 DisableControlRequest method. -// req, resp := client.DisableControlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/DisableControl -func (c *ControlTower) DisableControlRequest(input *DisableControlInput) (req *request.Request, output *DisableControlOutput) { - op := &request.Operation{ - Name: opDisableControl, - HTTPMethod: "POST", - HTTPPath: "/disable-control", - } - - if input == nil { - input = &DisableControlInput{} - } - - output = &DisableControlOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableControl API operation for AWS Control Tower. -// -// This API call turns off a control. It starts an asynchronous operation that -// deletes Amazon Web Services resources on the specified organizational unit -// and the accounts it contains. The resources will vary according to the control -// that you specify. For usage examples, see the Amazon Web Services Control -// Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html). -// -// 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 AWS Control Tower's -// API operation DisableControl for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. The limit is 10 concurrent -// operations. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/DisableControl -func (c *ControlTower) DisableControl(input *DisableControlInput) (*DisableControlOutput, error) { - req, out := c.DisableControlRequest(input) - return out, req.Send() -} - -// DisableControlWithContext is the same as DisableControl with the addition of -// the ability to pass a context and additional request options. -// -// See DisableControl 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 *ControlTower) DisableControlWithContext(ctx aws.Context, input *DisableControlInput, opts ...request.Option) (*DisableControlOutput, error) { - req, out := c.DisableControlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableControl = "EnableControl" - -// EnableControlRequest generates a "aws/request.Request" representing the -// client's request for the EnableControl 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 EnableControl for more information on using the EnableControl -// 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 EnableControlRequest method. -// req, resp := client.EnableControlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/EnableControl -func (c *ControlTower) EnableControlRequest(input *EnableControlInput) (req *request.Request, output *EnableControlOutput) { - op := &request.Operation{ - Name: opEnableControl, - HTTPMethod: "POST", - HTTPPath: "/enable-control", - } - - if input == nil { - input = &EnableControlInput{} - } - - output = &EnableControlOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableControl API operation for AWS Control Tower. -// -// This API call activates a control. It starts an asynchronous operation that -// creates Amazon Web Services resources on the specified organizational unit -// and the accounts it contains. The resources created will vary according to -// the control that you specify. For usage examples, see the Amazon Web Services -// Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html). -// -// 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 AWS Control Tower's -// API operation EnableControl for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. The limit is 10 concurrent -// operations. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/EnableControl -func (c *ControlTower) EnableControl(input *EnableControlInput) (*EnableControlOutput, error) { - req, out := c.EnableControlRequest(input) - return out, req.Send() -} - -// EnableControlWithContext is the same as EnableControl with the addition of -// the ability to pass a context and additional request options. -// -// See EnableControl 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 *ControlTower) EnableControlWithContext(ctx aws.Context, input *EnableControlInput, opts ...request.Option) (*EnableControlOutput, error) { - req, out := c.EnableControlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetControlOperation = "GetControlOperation" - -// GetControlOperationRequest generates a "aws/request.Request" representing the -// client's request for the GetControlOperation 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 GetControlOperation for more information on using the GetControlOperation -// 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 GetControlOperationRequest method. -// req, resp := client.GetControlOperationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/GetControlOperation -func (c *ControlTower) GetControlOperationRequest(input *GetControlOperationInput) (req *request.Request, output *GetControlOperationOutput) { - op := &request.Operation{ - Name: opGetControlOperation, - HTTPMethod: "POST", - HTTPPath: "/get-control-operation", - } - - if input == nil { - input = &GetControlOperationInput{} - } - - output = &GetControlOperationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetControlOperation API operation for AWS Control Tower. -// -// Returns the status of a particular EnableControl or DisableControl operation. -// Displays a message in case of error. Details for an operation are available -// for 90 days. For usage examples, see the Amazon Web Services Control Tower -// User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html). -// -// 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 AWS Control Tower's -// API operation GetControlOperation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/GetControlOperation -func (c *ControlTower) GetControlOperation(input *GetControlOperationInput) (*GetControlOperationOutput, error) { - req, out := c.GetControlOperationRequest(input) - return out, req.Send() -} - -// GetControlOperationWithContext is the same as GetControlOperation with the addition of -// the ability to pass a context and additional request options. -// -// See GetControlOperation 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 *ControlTower) GetControlOperationWithContext(ctx aws.Context, input *GetControlOperationInput, opts ...request.Option) (*GetControlOperationOutput, error) { - req, out := c.GetControlOperationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEnabledControl = "GetEnabledControl" - -// GetEnabledControlRequest generates a "aws/request.Request" representing the -// client's request for the GetEnabledControl 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 GetEnabledControl for more information on using the GetEnabledControl -// 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 GetEnabledControlRequest method. -// req, resp := client.GetEnabledControlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/GetEnabledControl -func (c *ControlTower) GetEnabledControlRequest(input *GetEnabledControlInput) (req *request.Request, output *GetEnabledControlOutput) { - op := &request.Operation{ - Name: opGetEnabledControl, - HTTPMethod: "POST", - HTTPPath: "/get-enabled-control", - } - - if input == nil { - input = &GetEnabledControlInput{} - } - - output = &GetEnabledControlOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEnabledControl API operation for AWS Control Tower. -// -// Retrieves details about an enabled control. For usage examples, see the Amazon -// Web Services Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html). -// -// 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 AWS Control Tower's -// API operation GetEnabledControl for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/GetEnabledControl -func (c *ControlTower) GetEnabledControl(input *GetEnabledControlInput) (*GetEnabledControlOutput, error) { - req, out := c.GetEnabledControlRequest(input) - return out, req.Send() -} - -// GetEnabledControlWithContext is the same as GetEnabledControl with the addition of -// the ability to pass a context and additional request options. -// -// See GetEnabledControl 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 *ControlTower) GetEnabledControlWithContext(ctx aws.Context, input *GetEnabledControlInput, opts ...request.Option) (*GetEnabledControlOutput, error) { - req, out := c.GetEnabledControlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetLandingZoneOperation = "GetLandingZoneOperation" - -// GetLandingZoneOperationRequest generates a "aws/request.Request" representing the -// client's request for the GetLandingZoneOperation 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 GetLandingZoneOperation for more information on using the GetLandingZoneOperation -// 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 GetLandingZoneOperationRequest method. -// req, resp := client.GetLandingZoneOperationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/GetLandingZoneOperation -func (c *ControlTower) GetLandingZoneOperationRequest(input *GetLandingZoneOperationInput) (req *request.Request, output *GetLandingZoneOperationOutput) { - op := &request.Operation{ - Name: opGetLandingZoneOperation, - HTTPMethod: "POST", - HTTPPath: "/get-landingzone-operation", - } - - if input == nil { - input = &GetLandingZoneOperationInput{} - } - - output = &GetLandingZoneOperationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetLandingZoneOperation API operation for AWS Control Tower. -// -// Returns the status of the specified landing zone operation. Details for an -// operation are available for 60 days. -// -// 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 AWS Control Tower's -// API operation GetLandingZoneOperation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/GetLandingZoneOperation -func (c *ControlTower) GetLandingZoneOperation(input *GetLandingZoneOperationInput) (*GetLandingZoneOperationOutput, error) { - req, out := c.GetLandingZoneOperationRequest(input) - return out, req.Send() -} - -// GetLandingZoneOperationWithContext is the same as GetLandingZoneOperation with the addition of -// the ability to pass a context and additional request options. -// -// See GetLandingZoneOperation 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 *ControlTower) GetLandingZoneOperationWithContext(ctx aws.Context, input *GetLandingZoneOperationInput, opts ...request.Option) (*GetLandingZoneOperationOutput, error) { - req, out := c.GetLandingZoneOperationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListEnabledControls = "ListEnabledControls" - -// ListEnabledControlsRequest generates a "aws/request.Request" representing the -// client's request for the ListEnabledControls 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 ListEnabledControls for more information on using the ListEnabledControls -// 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 ListEnabledControlsRequest method. -// req, resp := client.ListEnabledControlsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ListEnabledControls -func (c *ControlTower) ListEnabledControlsRequest(input *ListEnabledControlsInput) (req *request.Request, output *ListEnabledControlsOutput) { - op := &request.Operation{ - Name: opListEnabledControls, - HTTPMethod: "POST", - HTTPPath: "/list-enabled-controls", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEnabledControlsInput{} - } - - output = &ListEnabledControlsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEnabledControls API operation for AWS Control Tower. -// -// Lists the controls enabled by Amazon Web Services Control Tower on the specified -// organizational unit and the accounts it contains. For usage examples, see -// the Amazon Web Services Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html). -// -// 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 AWS Control Tower's -// API operation ListEnabledControls for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ListEnabledControls -func (c *ControlTower) ListEnabledControls(input *ListEnabledControlsInput) (*ListEnabledControlsOutput, error) { - req, out := c.ListEnabledControlsRequest(input) - return out, req.Send() -} - -// ListEnabledControlsWithContext is the same as ListEnabledControls with the addition of -// the ability to pass a context and additional request options. -// -// See ListEnabledControls 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 *ControlTower) ListEnabledControlsWithContext(ctx aws.Context, input *ListEnabledControlsInput, opts ...request.Option) (*ListEnabledControlsOutput, error) { - req, out := c.ListEnabledControlsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEnabledControlsPages iterates over the pages of a ListEnabledControls operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnabledControls method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEnabledControls operation. -// pageNum := 0 -// err := client.ListEnabledControlsPages(params, -// func(page *controltower.ListEnabledControlsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ControlTower) ListEnabledControlsPages(input *ListEnabledControlsInput, fn func(*ListEnabledControlsOutput, bool) bool) error { - return c.ListEnabledControlsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnabledControlsPagesWithContext same as ListEnabledControlsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ControlTower) ListEnabledControlsPagesWithContext(ctx aws.Context, input *ListEnabledControlsInput, fn func(*ListEnabledControlsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEnabledControlsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEnabledControlsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEnabledControlsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListLandingZones = "ListLandingZones" - -// ListLandingZonesRequest generates a "aws/request.Request" representing the -// client's request for the ListLandingZones 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 ListLandingZones for more information on using the ListLandingZones -// 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 ListLandingZonesRequest method. -// req, resp := client.ListLandingZonesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ListLandingZones -func (c *ControlTower) ListLandingZonesRequest(input *ListLandingZonesInput) (req *request.Request, output *ListLandingZonesOutput) { - op := &request.Operation{ - Name: opListLandingZones, - HTTPMethod: "POST", - HTTPPath: "/list-landingzones", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListLandingZonesInput{} - } - - output = &ListLandingZonesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLandingZones API operation for AWS Control Tower. -// -// Returns the landing zone ARN for the landing zone deployed in your managed -// account. This API also creates an ARN for existing accounts that do not yet -// have a landing zone ARN. -// -// Returns one landing zone ARN. -// -// 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 AWS Control Tower's -// API operation ListLandingZones for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ListLandingZones -func (c *ControlTower) ListLandingZones(input *ListLandingZonesInput) (*ListLandingZonesOutput, error) { - req, out := c.ListLandingZonesRequest(input) - return out, req.Send() -} - -// ListLandingZonesWithContext is the same as ListLandingZones with the addition of -// the ability to pass a context and additional request options. -// -// See ListLandingZones 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 *ControlTower) ListLandingZonesWithContext(ctx aws.Context, input *ListLandingZonesInput, opts ...request.Option) (*ListLandingZonesOutput, error) { - req, out := c.ListLandingZonesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListLandingZonesPages iterates over the pages of a ListLandingZones operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLandingZones method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListLandingZones operation. -// pageNum := 0 -// err := client.ListLandingZonesPages(params, -// func(page *controltower.ListLandingZonesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ControlTower) ListLandingZonesPages(input *ListLandingZonesInput, fn func(*ListLandingZonesOutput, bool) bool) error { - return c.ListLandingZonesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLandingZonesPagesWithContext same as ListLandingZonesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ControlTower) ListLandingZonesPagesWithContext(ctx aws.Context, input *ListLandingZonesInput, fn func(*ListLandingZonesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLandingZonesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLandingZonesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListLandingZonesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ListTagsForResource -func (c *ControlTower) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Control Tower. -// -// Returns a list of tags associated with the resource. For usage examples, -// see the Amazon Web Services Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html). -// -// 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 AWS Control Tower's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ListTagsForResource -func (c *ControlTower) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *ControlTower) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetLandingZone = "ResetLandingZone" - -// ResetLandingZoneRequest generates a "aws/request.Request" representing the -// client's request for the ResetLandingZone 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 ResetLandingZone for more information on using the ResetLandingZone -// 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 ResetLandingZoneRequest method. -// req, resp := client.ResetLandingZoneRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ResetLandingZone -func (c *ControlTower) ResetLandingZoneRequest(input *ResetLandingZoneInput) (req *request.Request, output *ResetLandingZoneOutput) { - op := &request.Operation{ - Name: opResetLandingZone, - HTTPMethod: "POST", - HTTPPath: "/reset-landingzone", - } - - if input == nil { - input = &ResetLandingZoneInput{} - } - - output = &ResetLandingZoneOutput{} - req = c.newRequest(op, input, output) - return -} - -// ResetLandingZone API operation for AWS Control Tower. -// -// This API call resets a landing zone. It starts an asynchronous operation -// that resets the landing zone to the parameters specified in its original -// configuration. -// -// 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 AWS Control Tower's -// API operation ResetLandingZone for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ResetLandingZone -func (c *ControlTower) ResetLandingZone(input *ResetLandingZoneInput) (*ResetLandingZoneOutput, error) { - req, out := c.ResetLandingZoneRequest(input) - return out, req.Send() -} - -// ResetLandingZoneWithContext is the same as ResetLandingZone with the addition of -// the ability to pass a context and additional request options. -// -// See ResetLandingZone 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 *ControlTower) ResetLandingZoneWithContext(ctx aws.Context, input *ResetLandingZoneInput, opts ...request.Option) (*ResetLandingZoneOutput, error) { - req, out := c.ResetLandingZoneRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/TagResource -func (c *ControlTower) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Control Tower. -// -// Applies tags to a resource. For usage examples, see the Amazon Web Services -// Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html). -// -// 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 AWS Control Tower's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/TagResource -func (c *ControlTower) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *ControlTower) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/UntagResource -func (c *ControlTower) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Control Tower. -// -// Removes tags from a resource. For usage examples, see the Amazon Web Services -// Control Tower User Guide (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html). -// -// 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 AWS Control Tower's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An unexpected error occurred during processing of a request. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/UntagResource -func (c *ControlTower) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *ControlTower) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Updating or deleting the resource can cause an inconsistent state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An operation performed by the control. -type ControlOperation struct { - _ struct{} `type:"structure"` - - // The time that the operation finished. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // One of ENABLE_CONTROL or DISABLE_CONTROL. - OperationType *string `locationName:"operationType" type:"string" enum:"ControlOperationType"` - - // The time that the operation began. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // One of IN_PROGRESS, SUCEEDED, or FAILED. - Status *string `locationName:"status" type:"string" enum:"ControlOperationStatus"` - - // If the operation result is FAILED, this string contains a message explaining - // why the operation failed. - StatusMessage *string `locationName:"statusMessage" 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 ControlOperation) 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 ControlOperation) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *ControlOperation) SetEndTime(v time.Time) *ControlOperation { - s.EndTime = &v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *ControlOperation) SetOperationType(v string) *ControlOperation { - s.OperationType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ControlOperation) SetStartTime(v time.Time) *ControlOperation { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ControlOperation) SetStatus(v string) *ControlOperation { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ControlOperation) SetStatusMessage(v string) *ControlOperation { - s.StatusMessage = &v - return s -} - -type DeleteLandingZoneInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the landing zone. - // - // LandingZoneIdentifier is a required field - LandingZoneIdentifier *string `locationName:"landingZoneIdentifier" 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 DeleteLandingZoneInput) 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 DeleteLandingZoneInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLandingZoneInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLandingZoneInput"} - if s.LandingZoneIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("LandingZoneIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLandingZoneIdentifier sets the LandingZoneIdentifier field's value. -func (s *DeleteLandingZoneInput) SetLandingZoneIdentifier(v string) *DeleteLandingZoneInput { - s.LandingZoneIdentifier = &v - return s -} - -type DeleteLandingZoneOutput struct { - _ struct{} `type:"structure"` - - // >A unique identifier assigned to a DeleteLandingZone operation. You can use - // this identifier as an input parameter of GetLandingZoneOperation to check - // the operation's status. - // - // OperationIdentifier is a required field - OperationIdentifier *string `locationName:"operationIdentifier" min:"36" 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 DeleteLandingZoneOutput) 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 DeleteLandingZoneOutput) GoString() string { - return s.String() -} - -// SetOperationIdentifier sets the OperationIdentifier field's value. -func (s *DeleteLandingZoneOutput) SetOperationIdentifier(v string) *DeleteLandingZoneOutput { - s.OperationIdentifier = &v - return s -} - -type DisableControlInput struct { - _ struct{} `type:"structure"` - - // The ARN of the control. Only Strongly recommended and Elective controls are - // permitted, with the exception of the landing zone Region deny control. For - // information on how to find the controlIdentifier, see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html). - // - // ControlIdentifier is a required field - ControlIdentifier *string `locationName:"controlIdentifier" min:"20" type:"string" required:"true"` - - // The ARN of the organizational unit. For information on how to find the targetIdentifier, - // see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html). - // - // TargetIdentifier is a required field - TargetIdentifier *string `locationName:"targetIdentifier" min:"20" 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 DisableControlInput) 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 DisableControlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableControlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableControlInput"} - if s.ControlIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ControlIdentifier")) - } - if s.ControlIdentifier != nil && len(*s.ControlIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ControlIdentifier", 20)) - } - if s.TargetIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetIdentifier")) - } - if s.TargetIdentifier != nil && len(*s.TargetIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("TargetIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetControlIdentifier sets the ControlIdentifier field's value. -func (s *DisableControlInput) SetControlIdentifier(v string) *DisableControlInput { - s.ControlIdentifier = &v - return s -} - -// SetTargetIdentifier sets the TargetIdentifier field's value. -func (s *DisableControlInput) SetTargetIdentifier(v string) *DisableControlInput { - s.TargetIdentifier = &v - return s -} - -type DisableControlOutput struct { - _ struct{} `type:"structure"` - - // The ID of the asynchronous operation, which is used to track status. The - // operation is available for 90 days. - // - // OperationIdentifier is a required field - OperationIdentifier *string `locationName:"operationIdentifier" min:"36" 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 DisableControlOutput) 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 DisableControlOutput) GoString() string { - return s.String() -} - -// SetOperationIdentifier sets the OperationIdentifier field's value. -func (s *DisableControlOutput) SetOperationIdentifier(v string) *DisableControlOutput { - s.OperationIdentifier = &v - return s -} - -// The drift summary of the enabled control. -// -// Amazon Web Services Control Tower expects the enabled control configuration -// to include all supported and governed Regions. If the enabled control differs -// from the expected configuration, it is defined to be in a state of drift. -// You can repair this drift by resetting the enabled control. -type DriftStatusSummary struct { - _ struct{} `type:"structure"` - - // The drift status of the enabled control. - // - // Valid values: - // - // * DRIFTED: The enabledControl deployed in this configuration doesn’t - // match the configuration that Amazon Web Services Control Tower expected. - // - // * IN_SYNC: The enabledControl deployed in this configuration matches the - // configuration that Amazon Web Services Control Tower expected. - // - // * NOT_CHECKING: Amazon Web Services Control Tower does not check drift - // for this enabled control. Drift is not supported for the control type. - // - // * UNKNOWN: Amazon Web Services Control Tower is not able to check the - // drift status for the enabled control. - DriftStatus *string `locationName:"driftStatus" type:"string" enum:"DriftStatus"` -} - -// 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 DriftStatusSummary) 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 DriftStatusSummary) GoString() string { - return s.String() -} - -// SetDriftStatus sets the DriftStatus field's value. -func (s *DriftStatusSummary) SetDriftStatus(v string) *DriftStatusSummary { - s.DriftStatus = &v - return s -} - -type EnableControlInput struct { - _ struct{} `type:"structure"` - - // The ARN of the control. Only Strongly recommended and Elective controls are - // permitted, with the exception of the landing zone Region deny control. For - // information on how to find the controlIdentifier, see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html). - // - // ControlIdentifier is a required field - ControlIdentifier *string `locationName:"controlIdentifier" min:"20" type:"string" required:"true"` - - // Tags to be applied to the EnabledControl resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The ARN of the organizational unit. For information on how to find the targetIdentifier, - // see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html). - // - // TargetIdentifier is a required field - TargetIdentifier *string `locationName:"targetIdentifier" min:"20" 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 EnableControlInput) 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 EnableControlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableControlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableControlInput"} - if s.ControlIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ControlIdentifier")) - } - if s.ControlIdentifier != nil && len(*s.ControlIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ControlIdentifier", 20)) - } - if s.TargetIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetIdentifier")) - } - if s.TargetIdentifier != nil && len(*s.TargetIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("TargetIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetControlIdentifier sets the ControlIdentifier field's value. -func (s *EnableControlInput) SetControlIdentifier(v string) *EnableControlInput { - s.ControlIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *EnableControlInput) SetTags(v map[string]*string) *EnableControlInput { - s.Tags = v - return s -} - -// SetTargetIdentifier sets the TargetIdentifier field's value. -func (s *EnableControlInput) SetTargetIdentifier(v string) *EnableControlInput { - s.TargetIdentifier = &v - return s -} - -type EnableControlOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the EnabledControl resource. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the asynchronous operation, which is used to track status. The - // operation is available for 90 days. - // - // OperationIdentifier is a required field - OperationIdentifier *string `locationName:"operationIdentifier" min:"36" 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 EnableControlOutput) 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 EnableControlOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *EnableControlOutput) SetArn(v string) *EnableControlOutput { - s.Arn = &v - return s -} - -// SetOperationIdentifier sets the OperationIdentifier field's value. -func (s *EnableControlOutput) SetOperationIdentifier(v string) *EnableControlOutput { - s.OperationIdentifier = &v - return s -} - -// Information about the enabled control. -type EnabledControlDetails struct { - _ struct{} `type:"structure"` - - // The ARN of the enabled control. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The control identifier of the enabled control. For information on how to - // find the controlIdentifier, see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html). - ControlIdentifier *string `locationName:"controlIdentifier" min:"20" type:"string"` - - // The drift status of the enabled control. - DriftStatusSummary *DriftStatusSummary `locationName:"driftStatusSummary" type:"structure"` - - // The deployment summary of the enabled control. - StatusSummary *EnablementStatusSummary `locationName:"statusSummary" type:"structure"` - - // The ARN of the organizational unit. For information on how to find the targetIdentifier, - // see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html). - TargetIdentifier *string `locationName:"targetIdentifier" min:"20" type:"string"` - - // Target Amazon Web Services Regions for the enabled control. - TargetRegions []*Region `locationName:"targetRegions" type:"list"` -} - -// 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 EnabledControlDetails) 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 EnabledControlDetails) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *EnabledControlDetails) SetArn(v string) *EnabledControlDetails { - s.Arn = &v - return s -} - -// SetControlIdentifier sets the ControlIdentifier field's value. -func (s *EnabledControlDetails) SetControlIdentifier(v string) *EnabledControlDetails { - s.ControlIdentifier = &v - return s -} - -// SetDriftStatusSummary sets the DriftStatusSummary field's value. -func (s *EnabledControlDetails) SetDriftStatusSummary(v *DriftStatusSummary) *EnabledControlDetails { - s.DriftStatusSummary = v - return s -} - -// SetStatusSummary sets the StatusSummary field's value. -func (s *EnabledControlDetails) SetStatusSummary(v *EnablementStatusSummary) *EnabledControlDetails { - s.StatusSummary = v - return s -} - -// SetTargetIdentifier sets the TargetIdentifier field's value. -func (s *EnabledControlDetails) SetTargetIdentifier(v string) *EnabledControlDetails { - s.TargetIdentifier = &v - return s -} - -// SetTargetRegions sets the TargetRegions field's value. -func (s *EnabledControlDetails) SetTargetRegions(v []*Region) *EnabledControlDetails { - s.TargetRegions = v - return s -} - -// Returns a summary of information about an enabled control. -type EnabledControlSummary struct { - _ struct{} `type:"structure"` - - // The ARN of the enabled control. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The controlIdentifier of the enabled control. - ControlIdentifier *string `locationName:"controlIdentifier" min:"20" type:"string"` - - // The drift status of the enabled control. - DriftStatusSummary *DriftStatusSummary `locationName:"driftStatusSummary" type:"structure"` - - // A short description of the status of the enabled control. - StatusSummary *EnablementStatusSummary `locationName:"statusSummary" type:"structure"` - - // The ARN of the organizational unit. - TargetIdentifier *string `locationName:"targetIdentifier" min:"20" 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 EnabledControlSummary) 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 EnabledControlSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *EnabledControlSummary) SetArn(v string) *EnabledControlSummary { - s.Arn = &v - return s -} - -// SetControlIdentifier sets the ControlIdentifier field's value. -func (s *EnabledControlSummary) SetControlIdentifier(v string) *EnabledControlSummary { - s.ControlIdentifier = &v - return s -} - -// SetDriftStatusSummary sets the DriftStatusSummary field's value. -func (s *EnabledControlSummary) SetDriftStatusSummary(v *DriftStatusSummary) *EnabledControlSummary { - s.DriftStatusSummary = v - return s -} - -// SetStatusSummary sets the StatusSummary field's value. -func (s *EnabledControlSummary) SetStatusSummary(v *EnablementStatusSummary) *EnabledControlSummary { - s.StatusSummary = v - return s -} - -// SetTargetIdentifier sets the TargetIdentifier field's value. -func (s *EnabledControlSummary) SetTargetIdentifier(v string) *EnabledControlSummary { - s.TargetIdentifier = &v - return s -} - -// The deployment summary of the enabled control. -type EnablementStatusSummary struct { - _ struct{} `type:"structure"` - - // The last operation identifier for the enabled control. - LastOperationIdentifier *string `locationName:"lastOperationIdentifier" min:"36" type:"string"` - - // The deployment status of the enabled control. - // - // Valid values: - // - // * SUCCEEDED: The enabledControl configuration was deployed successfully. - // - // * UNDER_CHANGE: The enabledControl configuration is changing. - // - // * FAILED: The enabledControl configuration failed to deploy. - Status *string `locationName:"status" type:"string" enum:"EnablementStatus"` -} - -// 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 EnablementStatusSummary) 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 EnablementStatusSummary) GoString() string { - return s.String() -} - -// SetLastOperationIdentifier sets the LastOperationIdentifier field's value. -func (s *EnablementStatusSummary) SetLastOperationIdentifier(v string) *EnablementStatusSummary { - s.LastOperationIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EnablementStatusSummary) SetStatus(v string) *EnablementStatusSummary { - s.Status = &v - return s -} - -type GetControlOperationInput struct { - _ struct{} `type:"structure"` - - // The ID of the asynchronous operation, which is used to track status. The - // operation is available for 90 days. - // - // OperationIdentifier is a required field - OperationIdentifier *string `locationName:"operationIdentifier" min:"36" 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 GetControlOperationInput) 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 GetControlOperationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetControlOperationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetControlOperationInput"} - if s.OperationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OperationIdentifier")) - } - if s.OperationIdentifier != nil && len(*s.OperationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("OperationIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOperationIdentifier sets the OperationIdentifier field's value. -func (s *GetControlOperationInput) SetOperationIdentifier(v string) *GetControlOperationInput { - s.OperationIdentifier = &v - return s -} - -type GetControlOperationOutput struct { - _ struct{} `type:"structure"` - - // An operation performed by the control. - // - // ControlOperation is a required field - ControlOperation *ControlOperation `locationName:"controlOperation" type:"structure" 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 GetControlOperationOutput) 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 GetControlOperationOutput) GoString() string { - return s.String() -} - -// SetControlOperation sets the ControlOperation field's value. -func (s *GetControlOperationOutput) SetControlOperation(v *ControlOperation) *GetControlOperationOutput { - s.ControlOperation = v - return s -} - -type GetEnabledControlInput struct { - _ struct{} `type:"structure"` - - // The controlIdentifier of the enabled control. - // - // EnabledControlIdentifier is a required field - EnabledControlIdentifier *string `locationName:"enabledControlIdentifier" min:"20" 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 GetEnabledControlInput) 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 GetEnabledControlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEnabledControlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEnabledControlInput"} - if s.EnabledControlIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnabledControlIdentifier")) - } - if s.EnabledControlIdentifier != nil && len(*s.EnabledControlIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("EnabledControlIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabledControlIdentifier sets the EnabledControlIdentifier field's value. -func (s *GetEnabledControlInput) SetEnabledControlIdentifier(v string) *GetEnabledControlInput { - s.EnabledControlIdentifier = &v - return s -} - -type GetEnabledControlOutput struct { - _ struct{} `type:"structure"` - - // Information about the enabled control. - // - // EnabledControlDetails is a required field - EnabledControlDetails *EnabledControlDetails `locationName:"enabledControlDetails" type:"structure" 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 GetEnabledControlOutput) 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 GetEnabledControlOutput) GoString() string { - return s.String() -} - -// SetEnabledControlDetails sets the EnabledControlDetails field's value. -func (s *GetEnabledControlOutput) SetEnabledControlDetails(v *EnabledControlDetails) *GetEnabledControlOutput { - s.EnabledControlDetails = v - return s -} - -type GetLandingZoneOperationInput struct { - _ struct{} `type:"structure"` - - // A unique identifier assigned to a landing zone operation. - // - // OperationIdentifier is a required field - OperationIdentifier *string `locationName:"operationIdentifier" min:"36" 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 GetLandingZoneOperationInput) 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 GetLandingZoneOperationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetLandingZoneOperationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetLandingZoneOperationInput"} - if s.OperationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OperationIdentifier")) - } - if s.OperationIdentifier != nil && len(*s.OperationIdentifier) < 36 { - invalidParams.Add(request.NewErrParamMinLen("OperationIdentifier", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOperationIdentifier sets the OperationIdentifier field's value. -func (s *GetLandingZoneOperationInput) SetOperationIdentifier(v string) *GetLandingZoneOperationInput { - s.OperationIdentifier = &v - return s -} - -type GetLandingZoneOperationOutput struct { - _ struct{} `type:"structure"` - - // Details about a landing zone operation. - // - // OperationDetails is a required field - OperationDetails *LandingZoneOperationDetail `locationName:"operationDetails" type:"structure" 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 GetLandingZoneOperationOutput) 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 GetLandingZoneOperationOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *GetLandingZoneOperationOutput) SetOperationDetails(v *LandingZoneOperationDetail) *GetLandingZoneOperationOutput { - s.OperationDetails = v - return s -} - -// An unexpected error occurred during processing of a request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about a landing zone operation. -type LandingZoneOperationDetail struct { - _ struct{} `type:"structure"` - - // The landing zone operation end time. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // The landing zone operation type. - // - // Valid values: - // - // * DELETE: The DeleteLandingZone operation. - // - // * CREATE: The CreateLandingZone operation. - // - // * UPDATE: The UpdateLandingZone operation. - // - // * RESET: The ResetLandingZone operation. - OperationType *string `locationName:"operationType" type:"string" enum:"LandingZoneOperationType"` - - // The landing zone operation start time. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // Valid values: - // - // * SUCCEEDED: The landing zone operation succeeded. - // - // * IN_PROGRESS: The landing zone operation is in progress. - // - // * FAILED: The landing zone operation failed. - Status *string `locationName:"status" type:"string" enum:"LandingZoneOperationStatus"` - - // If the operation result is FAILED, this string contains a message explaining - // why the operation failed. - StatusMessage *string `locationName:"statusMessage" 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 LandingZoneOperationDetail) 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 LandingZoneOperationDetail) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *LandingZoneOperationDetail) SetEndTime(v time.Time) *LandingZoneOperationDetail { - s.EndTime = &v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *LandingZoneOperationDetail) SetOperationType(v string) *LandingZoneOperationDetail { - s.OperationType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *LandingZoneOperationDetail) SetStartTime(v time.Time) *LandingZoneOperationDetail { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *LandingZoneOperationDetail) SetStatus(v string) *LandingZoneOperationDetail { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *LandingZoneOperationDetail) SetStatusMessage(v string) *LandingZoneOperationDetail { - s.StatusMessage = &v - return s -} - -// Returns a summary of information about a landing zone. -type LandingZoneSummary struct { - _ struct{} `type:"structure"` - - // The ARN of the landing zone. - Arn *string `locationName:"arn" min:"20" 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 LandingZoneSummary) 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 LandingZoneSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *LandingZoneSummary) SetArn(v string) *LandingZoneSummary { - s.Arn = &v - return s -} - -type ListEnabledControlsInput struct { - _ struct{} `type:"structure"` - - // How many results to return per API call. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token to continue the list from a previous API call with the same parameters. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ARN of the organizational unit. For information on how to find the targetIdentifier, - // see the overview page (https://docs.aws.amazon.com/controltower/latest/APIReference/Welcome.html). - // - // TargetIdentifier is a required field - TargetIdentifier *string `locationName:"targetIdentifier" min:"20" 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 ListEnabledControlsInput) 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 ListEnabledControlsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEnabledControlsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEnabledControlsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.TargetIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetIdentifier")) - } - if s.TargetIdentifier != nil && len(*s.TargetIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("TargetIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEnabledControlsInput) SetMaxResults(v int64) *ListEnabledControlsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnabledControlsInput) SetNextToken(v string) *ListEnabledControlsInput { - s.NextToken = &v - return s -} - -// SetTargetIdentifier sets the TargetIdentifier field's value. -func (s *ListEnabledControlsInput) SetTargetIdentifier(v string) *ListEnabledControlsInput { - s.TargetIdentifier = &v - return s -} - -type ListEnabledControlsOutput struct { - _ struct{} `type:"structure"` - - // Lists the controls enabled by Amazon Web Services Control Tower on the specified - // organizational unit and the accounts it contains. - // - // EnabledControls is a required field - EnabledControls []*EnabledControlSummary `locationName:"enabledControls" type:"list" required:"true"` - - // Retrieves the next page of results. If the string is empty, the response - // is the end of the results. - NextToken *string `locationName:"nextToken" 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 ListEnabledControlsOutput) 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 ListEnabledControlsOutput) GoString() string { - return s.String() -} - -// SetEnabledControls sets the EnabledControls field's value. -func (s *ListEnabledControlsOutput) SetEnabledControls(v []*EnabledControlSummary) *ListEnabledControlsOutput { - s.EnabledControls = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnabledControlsOutput) SetNextToken(v string) *ListEnabledControlsOutput { - s.NextToken = &v - return s -} - -type ListLandingZonesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of returned landing zone ARNs, which is one. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token to continue the list from a previous API call with the same parameters. - NextToken *string `locationName:"nextToken" 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 ListLandingZonesInput) 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 ListLandingZonesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListLandingZonesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLandingZonesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListLandingZonesInput) SetMaxResults(v int64) *ListLandingZonesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLandingZonesInput) SetNextToken(v string) *ListLandingZonesInput { - s.NextToken = &v - return s -} - -type ListLandingZonesOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the landing zone. - // - // LandingZones is a required field - LandingZones []*LandingZoneSummary `locationName:"landingZones" type:"list" required:"true"` - - // Retrieves the next page of results. If the string is empty, the response - // is the end of the results. - NextToken *string `locationName:"nextToken" 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 ListLandingZonesOutput) 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 ListLandingZonesOutput) GoString() string { - return s.String() -} - -// SetLandingZones sets the LandingZones field's value. -func (s *ListLandingZonesOutput) SetLandingZones(v []*LandingZoneSummary) *ListLandingZonesOutput { - s.LandingZones = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLandingZonesOutput) SetNextToken(v string) *ListLandingZonesOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of tags, as key:value strings. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// An Amazon Web Services Region in which Amazon Web Services Control Tower -// expects to find the control deployed. -// -// The expected Regions are based on the Regions that are governed by the landing -// zone. In certain cases, a control is not actually enabled in the Region as -// expected, such as during drift, or mixed governance (https://docs.aws.amazon.com/controltower/latest/userguide/region-how.html#mixed-governance). -type Region struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services Region name. - Name *string `locationName:"name" min:"1" 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 Region) 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 Region) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Region) SetName(v string) *Region { - s.Name = &v - return s -} - -type ResetLandingZoneInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the landing zone. - // - // LandingZoneIdentifier is a required field - LandingZoneIdentifier *string `locationName:"landingZoneIdentifier" 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 ResetLandingZoneInput) 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 ResetLandingZoneInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetLandingZoneInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetLandingZoneInput"} - if s.LandingZoneIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("LandingZoneIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLandingZoneIdentifier sets the LandingZoneIdentifier field's value. -func (s *ResetLandingZoneInput) SetLandingZoneIdentifier(v string) *ResetLandingZoneInput { - s.LandingZoneIdentifier = &v - return s -} - -type ResetLandingZoneOutput struct { - _ struct{} `type:"structure"` - - // A unique identifier assigned to a ResetLandingZone operation. You can use - // this identifier as an input parameter of GetLandingZoneOperation to check - // the operation's status. - // - // OperationIdentifier is a required field - OperationIdentifier *string `locationName:"operationIdentifier" min:"36" 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 ResetLandingZoneOutput) 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 ResetLandingZoneOutput) GoString() string { - return s.String() -} - -// SetOperationIdentifier sets the OperationIdentifier field's value. -func (s *ResetLandingZoneOutput) SetOperationIdentifier(v string) *ResetLandingZoneOutput { - s.OperationIdentifier = &v - return s -} - -// The request references a resource that does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request would cause a service quota to be exceeded. The limit is 10 concurrent -// operations. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource to be tagged. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // Tags to be applied to the resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the service quota that was exceeded. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The number of seconds to wait before retrying. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The ID of the service that is associated with the error. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // Tag keys to be removed from the resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // ControlOperationStatusSucceeded is a ControlOperationStatus enum value - ControlOperationStatusSucceeded = "SUCCEEDED" - - // ControlOperationStatusFailed is a ControlOperationStatus enum value - ControlOperationStatusFailed = "FAILED" - - // ControlOperationStatusInProgress is a ControlOperationStatus enum value - ControlOperationStatusInProgress = "IN_PROGRESS" -) - -// ControlOperationStatus_Values returns all elements of the ControlOperationStatus enum -func ControlOperationStatus_Values() []string { - return []string{ - ControlOperationStatusSucceeded, - ControlOperationStatusFailed, - ControlOperationStatusInProgress, - } -} - -const ( - // ControlOperationTypeEnableControl is a ControlOperationType enum value - ControlOperationTypeEnableControl = "ENABLE_CONTROL" - - // ControlOperationTypeDisableControl is a ControlOperationType enum value - ControlOperationTypeDisableControl = "DISABLE_CONTROL" - - // ControlOperationTypeUpdateEnabledControl is a ControlOperationType enum value - ControlOperationTypeUpdateEnabledControl = "UPDATE_ENABLED_CONTROL" -) - -// ControlOperationType_Values returns all elements of the ControlOperationType enum -func ControlOperationType_Values() []string { - return []string{ - ControlOperationTypeEnableControl, - ControlOperationTypeDisableControl, - ControlOperationTypeUpdateEnabledControl, - } -} - -const ( - // DriftStatusDrifted is a DriftStatus enum value - DriftStatusDrifted = "DRIFTED" - - // DriftStatusInSync is a DriftStatus enum value - DriftStatusInSync = "IN_SYNC" - - // DriftStatusNotChecking is a DriftStatus enum value - DriftStatusNotChecking = "NOT_CHECKING" - - // DriftStatusUnknown is a DriftStatus enum value - DriftStatusUnknown = "UNKNOWN" -) - -// DriftStatus_Values returns all elements of the DriftStatus enum -func DriftStatus_Values() []string { - return []string{ - DriftStatusDrifted, - DriftStatusInSync, - DriftStatusNotChecking, - DriftStatusUnknown, - } -} - -const ( - // EnablementStatusSucceeded is a EnablementStatus enum value - EnablementStatusSucceeded = "SUCCEEDED" - - // EnablementStatusFailed is a EnablementStatus enum value - EnablementStatusFailed = "FAILED" - - // EnablementStatusUnderChange is a EnablementStatus enum value - EnablementStatusUnderChange = "UNDER_CHANGE" -) - -// EnablementStatus_Values returns all elements of the EnablementStatus enum -func EnablementStatus_Values() []string { - return []string{ - EnablementStatusSucceeded, - EnablementStatusFailed, - EnablementStatusUnderChange, - } -} - -const ( - // LandingZoneOperationStatusSucceeded is a LandingZoneOperationStatus enum value - LandingZoneOperationStatusSucceeded = "SUCCEEDED" - - // LandingZoneOperationStatusFailed is a LandingZoneOperationStatus enum value - LandingZoneOperationStatusFailed = "FAILED" - - // LandingZoneOperationStatusInProgress is a LandingZoneOperationStatus enum value - LandingZoneOperationStatusInProgress = "IN_PROGRESS" -) - -// LandingZoneOperationStatus_Values returns all elements of the LandingZoneOperationStatus enum -func LandingZoneOperationStatus_Values() []string { - return []string{ - LandingZoneOperationStatusSucceeded, - LandingZoneOperationStatusFailed, - LandingZoneOperationStatusInProgress, - } -} - -const ( - // LandingZoneOperationTypeDelete is a LandingZoneOperationType enum value - LandingZoneOperationTypeDelete = "DELETE" - - // LandingZoneOperationTypeCreate is a LandingZoneOperationType enum value - LandingZoneOperationTypeCreate = "CREATE" - - // LandingZoneOperationTypeUpdate is a LandingZoneOperationType enum value - LandingZoneOperationTypeUpdate = "UPDATE" - - // LandingZoneOperationTypeReset is a LandingZoneOperationType enum value - LandingZoneOperationTypeReset = "RESET" -) - -// LandingZoneOperationType_Values returns all elements of the LandingZoneOperationType enum -func LandingZoneOperationType_Values() []string { - return []string{ - LandingZoneOperationTypeDelete, - LandingZoneOperationTypeCreate, - LandingZoneOperationTypeUpdate, - LandingZoneOperationTypeReset, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/controltoweriface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/controltoweriface/interface.go deleted file mode 100644 index 6d30042448bc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/controltoweriface/interface.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package controltoweriface provides an interface to enable mocking the AWS Control Tower service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package controltoweriface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower" -) - -// ControlTowerAPI provides an interface to enable mocking the -// controltower.ControlTower service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Control Tower. -// func myFunc(svc controltoweriface.ControlTowerAPI) bool { -// // Make svc.DeleteLandingZone request -// } -// -// func main() { -// sess := session.New() -// svc := controltower.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockControlTowerClient struct { -// controltoweriface.ControlTowerAPI -// } -// func (m *mockControlTowerClient) DeleteLandingZone(input *controltower.DeleteLandingZoneInput) (*controltower.DeleteLandingZoneOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockControlTowerClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type ControlTowerAPI interface { - DeleteLandingZone(*controltower.DeleteLandingZoneInput) (*controltower.DeleteLandingZoneOutput, error) - DeleteLandingZoneWithContext(aws.Context, *controltower.DeleteLandingZoneInput, ...request.Option) (*controltower.DeleteLandingZoneOutput, error) - DeleteLandingZoneRequest(*controltower.DeleteLandingZoneInput) (*request.Request, *controltower.DeleteLandingZoneOutput) - - DisableControl(*controltower.DisableControlInput) (*controltower.DisableControlOutput, error) - DisableControlWithContext(aws.Context, *controltower.DisableControlInput, ...request.Option) (*controltower.DisableControlOutput, error) - DisableControlRequest(*controltower.DisableControlInput) (*request.Request, *controltower.DisableControlOutput) - - EnableControl(*controltower.EnableControlInput) (*controltower.EnableControlOutput, error) - EnableControlWithContext(aws.Context, *controltower.EnableControlInput, ...request.Option) (*controltower.EnableControlOutput, error) - EnableControlRequest(*controltower.EnableControlInput) (*request.Request, *controltower.EnableControlOutput) - - GetControlOperation(*controltower.GetControlOperationInput) (*controltower.GetControlOperationOutput, error) - GetControlOperationWithContext(aws.Context, *controltower.GetControlOperationInput, ...request.Option) (*controltower.GetControlOperationOutput, error) - GetControlOperationRequest(*controltower.GetControlOperationInput) (*request.Request, *controltower.GetControlOperationOutput) - - GetEnabledControl(*controltower.GetEnabledControlInput) (*controltower.GetEnabledControlOutput, error) - GetEnabledControlWithContext(aws.Context, *controltower.GetEnabledControlInput, ...request.Option) (*controltower.GetEnabledControlOutput, error) - GetEnabledControlRequest(*controltower.GetEnabledControlInput) (*request.Request, *controltower.GetEnabledControlOutput) - - GetLandingZoneOperation(*controltower.GetLandingZoneOperationInput) (*controltower.GetLandingZoneOperationOutput, error) - GetLandingZoneOperationWithContext(aws.Context, *controltower.GetLandingZoneOperationInput, ...request.Option) (*controltower.GetLandingZoneOperationOutput, error) - GetLandingZoneOperationRequest(*controltower.GetLandingZoneOperationInput) (*request.Request, *controltower.GetLandingZoneOperationOutput) - - ListEnabledControls(*controltower.ListEnabledControlsInput) (*controltower.ListEnabledControlsOutput, error) - ListEnabledControlsWithContext(aws.Context, *controltower.ListEnabledControlsInput, ...request.Option) (*controltower.ListEnabledControlsOutput, error) - ListEnabledControlsRequest(*controltower.ListEnabledControlsInput) (*request.Request, *controltower.ListEnabledControlsOutput) - - ListEnabledControlsPages(*controltower.ListEnabledControlsInput, func(*controltower.ListEnabledControlsOutput, bool) bool) error - ListEnabledControlsPagesWithContext(aws.Context, *controltower.ListEnabledControlsInput, func(*controltower.ListEnabledControlsOutput, bool) bool, ...request.Option) error - - ListLandingZones(*controltower.ListLandingZonesInput) (*controltower.ListLandingZonesOutput, error) - ListLandingZonesWithContext(aws.Context, *controltower.ListLandingZonesInput, ...request.Option) (*controltower.ListLandingZonesOutput, error) - ListLandingZonesRequest(*controltower.ListLandingZonesInput) (*request.Request, *controltower.ListLandingZonesOutput) - - ListLandingZonesPages(*controltower.ListLandingZonesInput, func(*controltower.ListLandingZonesOutput, bool) bool) error - ListLandingZonesPagesWithContext(aws.Context, *controltower.ListLandingZonesInput, func(*controltower.ListLandingZonesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*controltower.ListTagsForResourceInput) (*controltower.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *controltower.ListTagsForResourceInput, ...request.Option) (*controltower.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*controltower.ListTagsForResourceInput) (*request.Request, *controltower.ListTagsForResourceOutput) - - ResetLandingZone(*controltower.ResetLandingZoneInput) (*controltower.ResetLandingZoneOutput, error) - ResetLandingZoneWithContext(aws.Context, *controltower.ResetLandingZoneInput, ...request.Option) (*controltower.ResetLandingZoneOutput, error) - ResetLandingZoneRequest(*controltower.ResetLandingZoneInput) (*request.Request, *controltower.ResetLandingZoneOutput) - - TagResource(*controltower.TagResourceInput) (*controltower.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *controltower.TagResourceInput, ...request.Option) (*controltower.TagResourceOutput, error) - TagResourceRequest(*controltower.TagResourceInput) (*request.Request, *controltower.TagResourceOutput) - - UntagResource(*controltower.UntagResourceInput) (*controltower.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *controltower.UntagResourceInput, ...request.Option) (*controltower.UntagResourceOutput, error) - UntagResourceRequest(*controltower.UntagResourceInput) (*request.Request, *controltower.UntagResourceOutput) -} - -var _ ControlTowerAPI = (*controltower.ControlTower)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/doc.go deleted file mode 100644 index 9775a3363a70..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/doc.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package controltower provides the client and types for making API -// requests to AWS Control Tower. -// -// These interfaces allow you to apply the Amazon Web Services library of pre-defined -// controls to your organizational units, programmatically. In Amazon Web Services -// Control Tower, the terms "control" and "guardrail" are synonyms. -// -// To call these APIs, you'll need to know: -// -// - the controlIdentifier for the control--or guardrail--you are targeting. -// -// - the ARN associated with the target organizational unit (OU), which we -// call the targetIdentifier. -// -// - the ARN associated with a resource that you wish to tag or untag. -// -// To get the controlIdentifier for your Amazon Web Services Control Tower control: -// -// The controlIdentifier is an ARN that is specified for each control. You can -// view the controlIdentifier in the console on the Control details page, as -// well as in the documentation. -// -// The controlIdentifier is unique in each Amazon Web Services Region for each -// control. You can find the controlIdentifier for each Region and control in -// the Tables of control metadata (https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html) -// in the Amazon Web Services Control Tower User Guide. -// -// A quick-reference list of control identifers for the Amazon Web Services -// Control Tower legacy Strongly recommended and Elective controls is given -// in Resource identifiers for APIs and controls (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html.html) -// in the Controls reference guide section (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html) -// of the Amazon Web Services Control Tower User Guide. Remember that Mandatory -// controls cannot be added or removed. -// -// ARN format: arn:aws:controltower:{REGION}::control/{CONTROL_NAME} -// -// Example: -// -// arn:aws:controltower:us-west-2::control/AWS-GR_AUTOSCALING_LAUNCH_CONFIG_PUBLIC_IP_DISABLED -// -// To get the targetIdentifier: -// -// The targetIdentifier is the ARN for an OU. -// -// In the Amazon Web Services Organizations console, you can find the ARN for -// the OU on the Organizational unit details page associated with that OU. -// -// OU ARN format: -// -// arn:${Partition}:organizations::${MasterAccountId}:ou/o-${OrganizationId}/ou-${OrganizationalUnitId} -// -// Details and examples -// -// - Control API input and output examples with CLI (https://docs.aws.amazon.com/controltower/latest/userguide/control-api-examples-short.html) -// -// - Enable controls with CloudFormation (https://docs.aws.amazon.com/controltower/latest/userguide/enable-controls.html) -// -// - Control metadata tables (https://docs.aws.amazon.com/controltower/latest/userguide/control-metadata-tables.html) -// -// - List of identifiers for legacy controls (https://docs.aws.amazon.com/controltower/latest/userguide/control-identifiers.html) -// -// - Controls reference guide (https://docs.aws.amazon.com/controltower/latest/userguide/controls.html) -// -// - Controls library groupings (https://docs.aws.amazon.com/controltower/latest/userguide/controls-reference.html) -// -// - Creating Amazon Web Services Control Tower resources with Amazon Web -// Services CloudFormation (https://docs.aws.amazon.com/controltower/latest/userguide/creating-resources-with-cloudformation.html) -// -// To view the open source resource repository on GitHub, see aws-cloudformation/aws-cloudformation-resource-providers-controltower -// (https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-controltower) -// -// # Recording API Requests -// -// Amazon Web Services Control Tower supports Amazon Web Services CloudTrail, -// a service that records Amazon Web Services API calls for your Amazon Web -// Services account and delivers log files to an Amazon S3 bucket. By using -// information collected by CloudTrail, you can determine which requests the -// Amazon Web Services Control Tower service received, who made the request -// and when, and so on. For more about Amazon Web Services Control Tower and -// its support for CloudTrail, see Logging Amazon Web Services Control Tower -// Actions with Amazon Web Services CloudTrail (https://docs.aws.amazon.com/controltower/latest/userguide/logging-using-cloudtrail.html) -// in the Amazon Web Services Control Tower User Guide. To learn more about -// CloudTrail, including how to turn it on and find your log files, see the -// Amazon Web Services CloudTrail User Guide. -// -// See https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10 for more information on this service. -// -// See controltower package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/controltower/ -// -// # Using the Client -// -// To contact AWS Control Tower with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Control Tower client ControlTower for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/controltower/#New -package controltower diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/errors.go deleted file mode 100644 index 5bf88f460f7a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package controltower - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Updating or deleting the resource can cause an inconsistent state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An unexpected error occurred during processing of a request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request references a resource that does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request would cause a service quota to be exceeded. The limit is 10 concurrent - // operations. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input does not satisfy the constraints specified by an Amazon Web Services - // service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/service.go deleted file mode 100644 index bfe60818d9be..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/controltower/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package controltower - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// ControlTower provides the API operation methods for making requests to -// AWS Control Tower. See this package's package overview docs -// for details on the service. -// -// ControlTower methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ControlTower struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ControlTower" // Name of service. - EndpointsID = "controltower" // ID to lookup a service endpoint with. - ServiceID = "ControlTower" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the ControlTower client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a ControlTower client from just a session. -// svc := controltower.New(mySession) -// -// // Create a ControlTower client with additional configuration -// svc := controltower.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ControlTower { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "controltower" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ControlTower { - svc := &ControlTower{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ControlTower operation and runs any -// custom request initialization. -func (c *ControlTower) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/api.go deleted file mode 100644 index 88edad41bb44..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/api.go +++ /dev/null @@ -1,5273 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package costoptimizationhub - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opGetPreferences = "GetPreferences" - -// GetPreferencesRequest generates a "aws/request.Request" representing the -// client's request for the GetPreferences 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 GetPreferences for more information on using the GetPreferences -// 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 GetPreferencesRequest method. -// req, resp := client.GetPreferencesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/GetPreferences -func (c *CostOptimizationHub) GetPreferencesRequest(input *GetPreferencesInput) (req *request.Request, output *GetPreferencesOutput) { - op := &request.Operation{ - Name: opGetPreferences, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPreferencesInput{} - } - - output = &GetPreferencesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPreferences API operation for Cost Optimization Hub. -// -// Returns a set of preferences for an account in order to add account-specific -// preferences into the service. These preferences impact how the savings associated -// with recommendations are presented—estimated savings after discounts or -// estimated savings before discounts, for example. -// -// 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 Cost Optimization Hub's -// API operation GetPreferences for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - AccessDeniedException -// You are not authorized to use this operation with the given parameters. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/GetPreferences -func (c *CostOptimizationHub) GetPreferences(input *GetPreferencesInput) (*GetPreferencesOutput, error) { - req, out := c.GetPreferencesRequest(input) - return out, req.Send() -} - -// GetPreferencesWithContext is the same as GetPreferences with the addition of -// the ability to pass a context and additional request options. -// -// See GetPreferences 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 *CostOptimizationHub) GetPreferencesWithContext(ctx aws.Context, input *GetPreferencesInput, opts ...request.Option) (*GetPreferencesOutput, error) { - req, out := c.GetPreferencesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRecommendation = "GetRecommendation" - -// GetRecommendationRequest generates a "aws/request.Request" representing the -// client's request for the GetRecommendation 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 GetRecommendation for more information on using the GetRecommendation -// 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 GetRecommendationRequest method. -// req, resp := client.GetRecommendationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/GetRecommendation -func (c *CostOptimizationHub) GetRecommendationRequest(input *GetRecommendationInput) (req *request.Request, output *GetRecommendationOutput) { - op := &request.Operation{ - Name: opGetRecommendation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRecommendationInput{} - } - - output = &GetRecommendationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRecommendation API operation for Cost Optimization Hub. -// -// Returns both the current and recommended resource configuration and the estimated -// cost impact for a recommendation. -// -// The recommendationId is only valid for up to a maximum of 24 hours as recommendations -// are refreshed daily. To retrieve the recommendationId, use the ListRecommendations -// API. -// -// 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 Cost Optimization Hub's -// API operation GetRecommendation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - AccessDeniedException -// You are not authorized to use this operation with the given parameters. -// -// - ResourceNotFoundException -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/GetRecommendation -func (c *CostOptimizationHub) GetRecommendation(input *GetRecommendationInput) (*GetRecommendationOutput, error) { - req, out := c.GetRecommendationRequest(input) - return out, req.Send() -} - -// GetRecommendationWithContext is the same as GetRecommendation with the addition of -// the ability to pass a context and additional request options. -// -// See GetRecommendation 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 *CostOptimizationHub) GetRecommendationWithContext(ctx aws.Context, input *GetRecommendationInput, opts ...request.Option) (*GetRecommendationOutput, error) { - req, out := c.GetRecommendationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListEnrollmentStatuses = "ListEnrollmentStatuses" - -// ListEnrollmentStatusesRequest generates a "aws/request.Request" representing the -// client's request for the ListEnrollmentStatuses 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 ListEnrollmentStatuses for more information on using the ListEnrollmentStatuses -// 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 ListEnrollmentStatusesRequest method. -// req, resp := client.ListEnrollmentStatusesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/ListEnrollmentStatuses -func (c *CostOptimizationHub) ListEnrollmentStatusesRequest(input *ListEnrollmentStatusesInput) (req *request.Request, output *ListEnrollmentStatusesOutput) { - op := &request.Operation{ - Name: opListEnrollmentStatuses, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEnrollmentStatusesInput{} - } - - output = &ListEnrollmentStatusesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEnrollmentStatuses API operation for Cost Optimization Hub. -// -// Retrieves the enrollment status for an account. It can also return the list -// of accounts that are enrolled under the organization. -// -// 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 Cost Optimization Hub's -// API operation ListEnrollmentStatuses for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - AccessDeniedException -// You are not authorized to use this operation with the given parameters. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/ListEnrollmentStatuses -func (c *CostOptimizationHub) ListEnrollmentStatuses(input *ListEnrollmentStatusesInput) (*ListEnrollmentStatusesOutput, error) { - req, out := c.ListEnrollmentStatusesRequest(input) - return out, req.Send() -} - -// ListEnrollmentStatusesWithContext is the same as ListEnrollmentStatuses with the addition of -// the ability to pass a context and additional request options. -// -// See ListEnrollmentStatuses 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 *CostOptimizationHub) ListEnrollmentStatusesWithContext(ctx aws.Context, input *ListEnrollmentStatusesInput, opts ...request.Option) (*ListEnrollmentStatusesOutput, error) { - req, out := c.ListEnrollmentStatusesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEnrollmentStatusesPages iterates over the pages of a ListEnrollmentStatuses operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnrollmentStatuses method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEnrollmentStatuses operation. -// pageNum := 0 -// err := client.ListEnrollmentStatusesPages(params, -// func(page *costoptimizationhub.ListEnrollmentStatusesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CostOptimizationHub) ListEnrollmentStatusesPages(input *ListEnrollmentStatusesInput, fn func(*ListEnrollmentStatusesOutput, bool) bool) error { - return c.ListEnrollmentStatusesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnrollmentStatusesPagesWithContext same as ListEnrollmentStatusesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CostOptimizationHub) ListEnrollmentStatusesPagesWithContext(ctx aws.Context, input *ListEnrollmentStatusesInput, fn func(*ListEnrollmentStatusesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEnrollmentStatusesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEnrollmentStatusesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEnrollmentStatusesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRecommendationSummaries = "ListRecommendationSummaries" - -// ListRecommendationSummariesRequest generates a "aws/request.Request" representing the -// client's request for the ListRecommendationSummaries 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 ListRecommendationSummaries for more information on using the ListRecommendationSummaries -// 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 ListRecommendationSummariesRequest method. -// req, resp := client.ListRecommendationSummariesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/ListRecommendationSummaries -func (c *CostOptimizationHub) ListRecommendationSummariesRequest(input *ListRecommendationSummariesInput) (req *request.Request, output *ListRecommendationSummariesOutput) { - op := &request.Operation{ - Name: opListRecommendationSummaries, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRecommendationSummariesInput{} - } - - output = &ListRecommendationSummariesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRecommendationSummaries API operation for Cost Optimization Hub. -// -// Returns a concise representation of savings estimates for resources. Also -// returns de-duped savings across different types of recommendations. -// -// The following filters are not supported for this API: recommendationIds, -// resourceArns, and resourceIds. -// -// 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 Cost Optimization Hub's -// API operation ListRecommendationSummaries for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - AccessDeniedException -// You are not authorized to use this operation with the given parameters. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/ListRecommendationSummaries -func (c *CostOptimizationHub) ListRecommendationSummaries(input *ListRecommendationSummariesInput) (*ListRecommendationSummariesOutput, error) { - req, out := c.ListRecommendationSummariesRequest(input) - return out, req.Send() -} - -// ListRecommendationSummariesWithContext is the same as ListRecommendationSummaries with the addition of -// the ability to pass a context and additional request options. -// -// See ListRecommendationSummaries 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 *CostOptimizationHub) ListRecommendationSummariesWithContext(ctx aws.Context, input *ListRecommendationSummariesInput, opts ...request.Option) (*ListRecommendationSummariesOutput, error) { - req, out := c.ListRecommendationSummariesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRecommendationSummariesPages iterates over the pages of a ListRecommendationSummaries operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRecommendationSummaries method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRecommendationSummaries operation. -// pageNum := 0 -// err := client.ListRecommendationSummariesPages(params, -// func(page *costoptimizationhub.ListRecommendationSummariesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CostOptimizationHub) ListRecommendationSummariesPages(input *ListRecommendationSummariesInput, fn func(*ListRecommendationSummariesOutput, bool) bool) error { - return c.ListRecommendationSummariesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRecommendationSummariesPagesWithContext same as ListRecommendationSummariesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CostOptimizationHub) ListRecommendationSummariesPagesWithContext(ctx aws.Context, input *ListRecommendationSummariesInput, fn func(*ListRecommendationSummariesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRecommendationSummariesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRecommendationSummariesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRecommendationSummariesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRecommendations = "ListRecommendations" - -// ListRecommendationsRequest generates a "aws/request.Request" representing the -// client's request for the ListRecommendations 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 ListRecommendations for more information on using the ListRecommendations -// 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 ListRecommendationsRequest method. -// req, resp := client.ListRecommendationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/ListRecommendations -func (c *CostOptimizationHub) ListRecommendationsRequest(input *ListRecommendationsInput) (req *request.Request, output *ListRecommendationsOutput) { - op := &request.Operation{ - Name: opListRecommendations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRecommendationsInput{} - } - - output = &ListRecommendationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRecommendations API operation for Cost Optimization Hub. -// -// Returns a list of recommendations. -// -// 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 Cost Optimization Hub's -// API operation ListRecommendations for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - AccessDeniedException -// You are not authorized to use this operation with the given parameters. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/ListRecommendations -func (c *CostOptimizationHub) ListRecommendations(input *ListRecommendationsInput) (*ListRecommendationsOutput, error) { - req, out := c.ListRecommendationsRequest(input) - return out, req.Send() -} - -// ListRecommendationsWithContext is the same as ListRecommendations with the addition of -// the ability to pass a context and additional request options. -// -// See ListRecommendations 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 *CostOptimizationHub) ListRecommendationsWithContext(ctx aws.Context, input *ListRecommendationsInput, opts ...request.Option) (*ListRecommendationsOutput, error) { - req, out := c.ListRecommendationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRecommendationsPages iterates over the pages of a ListRecommendations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRecommendations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRecommendations operation. -// pageNum := 0 -// err := client.ListRecommendationsPages(params, -// func(page *costoptimizationhub.ListRecommendationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CostOptimizationHub) ListRecommendationsPages(input *ListRecommendationsInput, fn func(*ListRecommendationsOutput, bool) bool) error { - return c.ListRecommendationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRecommendationsPagesWithContext same as ListRecommendationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *CostOptimizationHub) ListRecommendationsPagesWithContext(ctx aws.Context, input *ListRecommendationsInput, fn func(*ListRecommendationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRecommendationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRecommendationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRecommendationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opUpdateEnrollmentStatus = "UpdateEnrollmentStatus" - -// UpdateEnrollmentStatusRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEnrollmentStatus 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 UpdateEnrollmentStatus for more information on using the UpdateEnrollmentStatus -// 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 UpdateEnrollmentStatusRequest method. -// req, resp := client.UpdateEnrollmentStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/UpdateEnrollmentStatus -func (c *CostOptimizationHub) UpdateEnrollmentStatusRequest(input *UpdateEnrollmentStatusInput) (req *request.Request, output *UpdateEnrollmentStatusOutput) { - op := &request.Operation{ - Name: opUpdateEnrollmentStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateEnrollmentStatusInput{} - } - - output = &UpdateEnrollmentStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateEnrollmentStatus API operation for Cost Optimization Hub. -// -// Updates the enrollment (opt in and opt out) status of an account to the Cost -// Optimization Hub service. -// -// If the account is a management account of an organization, this action can -// also be used to enroll member accounts of the organization. -// -// You must have the appropriate permissions to opt in to Cost Optimization -// Hub and to view its recommendations. When you opt in, Cost Optimization Hub -// automatically creates a service-linked role in your account to access its -// data. -// -// 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 Cost Optimization Hub's -// API operation UpdateEnrollmentStatus for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - AccessDeniedException -// You are not authorized to use this operation with the given parameters. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/UpdateEnrollmentStatus -func (c *CostOptimizationHub) UpdateEnrollmentStatus(input *UpdateEnrollmentStatusInput) (*UpdateEnrollmentStatusOutput, error) { - req, out := c.UpdateEnrollmentStatusRequest(input) - return out, req.Send() -} - -// UpdateEnrollmentStatusWithContext is the same as UpdateEnrollmentStatus with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateEnrollmentStatus 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 *CostOptimizationHub) UpdateEnrollmentStatusWithContext(ctx aws.Context, input *UpdateEnrollmentStatusInput, opts ...request.Option) (*UpdateEnrollmentStatusOutput, error) { - req, out := c.UpdateEnrollmentStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePreferences = "UpdatePreferences" - -// UpdatePreferencesRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePreferences 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 UpdatePreferences for more information on using the UpdatePreferences -// 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 UpdatePreferencesRequest method. -// req, resp := client.UpdatePreferencesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/UpdatePreferences -func (c *CostOptimizationHub) UpdatePreferencesRequest(input *UpdatePreferencesInput) (req *request.Request, output *UpdatePreferencesOutput) { - op := &request.Operation{ - Name: opUpdatePreferences, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdatePreferencesInput{} - } - - output = &UpdatePreferencesOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePreferences API operation for Cost Optimization Hub. -// -// Updates a set of preferences for an account in order to add account-specific -// preferences into the service. These preferences impact how the savings associated -// with recommendations are presented. -// -// 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 Cost Optimization Hub's -// API operation UpdatePreferences for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InternalServerException -// An error on the server occurred during the processing of your request. Try -// again later. -// -// - AccessDeniedException -// You are not authorized to use this operation with the given parameters. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26/UpdatePreferences -func (c *CostOptimizationHub) UpdatePreferences(input *UpdatePreferencesInput) (*UpdatePreferencesOutput, error) { - req, out := c.UpdatePreferencesRequest(input) - return out, req.Send() -} - -// UpdatePreferencesWithContext is the same as UpdatePreferences with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePreferences 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 *CostOptimizationHub) UpdatePreferencesWithContext(ctx aws.Context, input *UpdatePreferencesInput, opts ...request.Option) (*UpdatePreferencesOutput, error) { - req, out := c.UpdatePreferencesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You are not authorized to use this operation with the given parameters. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Describes the enrollment status of an organization's member accounts in Cost -// Optimization Hub. -type AccountEnrollmentStatus struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account ID. - AccountId *string `locationName:"accountId" type:"string"` - - // The time when the account enrollment status was created. - CreatedTimestamp *time.Time `locationName:"createdTimestamp" type:"timestamp"` - - // The time when the account enrollment status was last updated. - LastUpdatedTimestamp *time.Time `locationName:"lastUpdatedTimestamp" type:"timestamp"` - - // The account enrollment status. - Status *string `locationName:"status" type:"string" enum:"EnrollmentStatus"` -} - -// 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 AccountEnrollmentStatus) 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 AccountEnrollmentStatus) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *AccountEnrollmentStatus) SetAccountId(v string) *AccountEnrollmentStatus { - s.AccountId = &v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *AccountEnrollmentStatus) SetCreatedTimestamp(v time.Time) *AccountEnrollmentStatus { - s.CreatedTimestamp = &v - return s -} - -// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. -func (s *AccountEnrollmentStatus) SetLastUpdatedTimestamp(v time.Time) *AccountEnrollmentStatus { - s.LastUpdatedTimestamp = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AccountEnrollmentStatus) SetStatus(v string) *AccountEnrollmentStatus { - s.Status = &v - return s -} - -// Describes the Amazon Elastic Block Store performance configuration of the -// current and recommended resource configuration for a recommendation. -type BlockStoragePerformanceConfiguration struct { - _ struct{} `type:"structure"` - - // The number of I/O operations per second. - Iops *float64 `locationName:"iops" type:"double"` - - // The throughput that the volume supports. - Throughput *float64 `locationName:"throughput" type:"double"` -} - -// 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 BlockStoragePerformanceConfiguration) 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 BlockStoragePerformanceConfiguration) GoString() string { - return s.String() -} - -// SetIops sets the Iops field's value. -func (s *BlockStoragePerformanceConfiguration) SetIops(v float64) *BlockStoragePerformanceConfiguration { - s.Iops = &v - return s -} - -// SetThroughput sets the Throughput field's value. -func (s *BlockStoragePerformanceConfiguration) SetThroughput(v float64) *BlockStoragePerformanceConfiguration { - s.Throughput = &v - return s -} - -// Describes the performance configuration for compute services such as Amazon -// EC2, Lambda, and ECS. -type ComputeConfiguration struct { - _ struct{} `type:"structure"` - - // The architecture of the resource. - Architecture *string `locationName:"architecture" type:"string"` - - // The memory size of the resource. - MemorySizeInMB *int64 `locationName:"memorySizeInMB" type:"integer"` - - // The platform of the resource. The platform is the specific combination of - // operating system, license model, and software on an instance. - Platform *string `locationName:"platform" type:"string"` - - // The number of vCPU cores in the resource. - VCpu *float64 `locationName:"vCpu" type:"double"` -} - -// 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 ComputeConfiguration) 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 ComputeConfiguration) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ComputeConfiguration) SetArchitecture(v string) *ComputeConfiguration { - s.Architecture = &v - return s -} - -// SetMemorySizeInMB sets the MemorySizeInMB field's value. -func (s *ComputeConfiguration) SetMemorySizeInMB(v int64) *ComputeConfiguration { - s.MemorySizeInMB = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ComputeConfiguration) SetPlatform(v string) *ComputeConfiguration { - s.Platform = &v - return s -} - -// SetVCpu sets the VCpu field's value. -func (s *ComputeConfiguration) SetVCpu(v float64) *ComputeConfiguration { - s.VCpu = &v - return s -} - -// The Compute Savings Plans recommendation details. -type ComputeSavingsPlans struct { - _ struct{} `type:"structure"` - - // Configuration details of the Compute Savings Plans to purchase. - Configuration *ComputeSavingsPlansConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the Savings Plans purchase recommendation. - CostCalculation *SavingsPlansCostCalculation `locationName:"costCalculation" 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 ComputeSavingsPlans) 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 ComputeSavingsPlans) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *ComputeSavingsPlans) SetConfiguration(v *ComputeSavingsPlansConfiguration) *ComputeSavingsPlans { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *ComputeSavingsPlans) SetCostCalculation(v *SavingsPlansCostCalculation) *ComputeSavingsPlans { - s.CostCalculation = v - return s -} - -// The Compute Savings Plans configuration used for recommendations. -type ComputeSavingsPlansConfiguration struct { - _ struct{} `type:"structure"` - - // The account scope that you want your recommendations for. Amazon Web Services - // calculates recommendations including the management account and member accounts - // if the value is set to PAYER. If the value is LINKED, recommendations are - // calculated for individual member accounts only. - AccountScope *string `locationName:"accountScope" type:"string"` - - // The hourly commitment for the Savings Plans type. - HourlyCommitment *string `locationName:"hourlyCommitment" type:"string"` - - // The payment option for the commitment. - PaymentOption *string `locationName:"paymentOption" type:"string"` - - // The Savings Plans recommendation term in years. - Term *string `locationName:"term" 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 ComputeSavingsPlansConfiguration) 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 ComputeSavingsPlansConfiguration) GoString() string { - return s.String() -} - -// SetAccountScope sets the AccountScope field's value. -func (s *ComputeSavingsPlansConfiguration) SetAccountScope(v string) *ComputeSavingsPlansConfiguration { - s.AccountScope = &v - return s -} - -// SetHourlyCommitment sets the HourlyCommitment field's value. -func (s *ComputeSavingsPlansConfiguration) SetHourlyCommitment(v string) *ComputeSavingsPlansConfiguration { - s.HourlyCommitment = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *ComputeSavingsPlansConfiguration) SetPaymentOption(v string) *ComputeSavingsPlansConfiguration { - s.PaymentOption = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *ComputeSavingsPlansConfiguration) SetTerm(v string) *ComputeSavingsPlansConfiguration { - s.Term = &v - return s -} - -// Describes the Amazon Elastic Block Store volume configuration of the current -// and recommended resource configuration for a recommendation. -type EbsVolume struct { - _ struct{} `type:"structure"` - - // The Amazon Elastic Block Store volume configuration used for recommendations. - Configuration *EbsVolumeConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the recommendation. - CostCalculation *ResourceCostCalculation `locationName:"costCalculation" 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 EbsVolume) 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 EbsVolume) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *EbsVolume) SetConfiguration(v *EbsVolumeConfiguration) *EbsVolume { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *EbsVolume) SetCostCalculation(v *ResourceCostCalculation) *EbsVolume { - s.CostCalculation = v - return s -} - -// The Amazon Elastic Block Store volume configuration used for recommendations. -type EbsVolumeConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Elastic Block Store attachment state. - AttachmentState *string `locationName:"attachmentState" type:"string"` - - // The Amazon Elastic Block Store performance configuration. - Performance *BlockStoragePerformanceConfiguration `locationName:"performance" type:"structure"` - - // The disk storage of the Amazon Elastic Block Store volume. - Storage *StorageConfiguration `locationName:"storage" 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 EbsVolumeConfiguration) 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 EbsVolumeConfiguration) GoString() string { - return s.String() -} - -// SetAttachmentState sets the AttachmentState field's value. -func (s *EbsVolumeConfiguration) SetAttachmentState(v string) *EbsVolumeConfiguration { - s.AttachmentState = &v - return s -} - -// SetPerformance sets the Performance field's value. -func (s *EbsVolumeConfiguration) SetPerformance(v *BlockStoragePerformanceConfiguration) *EbsVolumeConfiguration { - s.Performance = v - return s -} - -// SetStorage sets the Storage field's value. -func (s *EbsVolumeConfiguration) SetStorage(v *StorageConfiguration) *EbsVolumeConfiguration { - s.Storage = v - return s -} - -// The EC2 Auto Scaling group recommendation details. -type Ec2AutoScalingGroup struct { - _ struct{} `type:"structure"` - - // The EC2 Auto Scaling group configuration used for recommendations. - Configuration *Ec2AutoScalingGroupConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the recommendation. - CostCalculation *ResourceCostCalculation `locationName:"costCalculation" 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 Ec2AutoScalingGroup) 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 Ec2AutoScalingGroup) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *Ec2AutoScalingGroup) SetConfiguration(v *Ec2AutoScalingGroupConfiguration) *Ec2AutoScalingGroup { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *Ec2AutoScalingGroup) SetCostCalculation(v *ResourceCostCalculation) *Ec2AutoScalingGroup { - s.CostCalculation = v - return s -} - -// The EC2 auto scaling group configuration used for recommendations. -type Ec2AutoScalingGroupConfiguration struct { - _ struct{} `type:"structure"` - - // Details about the instance. - Instance *InstanceConfiguration `locationName:"instance" 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 Ec2AutoScalingGroupConfiguration) 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 Ec2AutoScalingGroupConfiguration) GoString() string { - return s.String() -} - -// SetInstance sets the Instance field's value. -func (s *Ec2AutoScalingGroupConfiguration) SetInstance(v *InstanceConfiguration) *Ec2AutoScalingGroupConfiguration { - s.Instance = v - return s -} - -// Describes the EC2 instance configuration of the current and recommended resource -// configuration for a recommendation. -type Ec2Instance struct { - _ struct{} `type:"structure"` - - // The EC2 instance configuration used for recommendations. - Configuration *Ec2InstanceConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the recommendation. - CostCalculation *ResourceCostCalculation `locationName:"costCalculation" 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 Ec2Instance) 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 Ec2Instance) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *Ec2Instance) SetConfiguration(v *Ec2InstanceConfiguration) *Ec2Instance { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *Ec2Instance) SetCostCalculation(v *ResourceCostCalculation) *Ec2Instance { - s.CostCalculation = v - return s -} - -// The EC2 instance configuration used for recommendations. -type Ec2InstanceConfiguration struct { - _ struct{} `type:"structure"` - - // Details about the instance. - Instance *InstanceConfiguration `locationName:"instance" 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 Ec2InstanceConfiguration) 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 Ec2InstanceConfiguration) GoString() string { - return s.String() -} - -// SetInstance sets the Instance field's value. -func (s *Ec2InstanceConfiguration) SetInstance(v *InstanceConfiguration) *Ec2InstanceConfiguration { - s.Instance = v - return s -} - -// The EC2 instance Savings Plans recommendation details. -type Ec2InstanceSavingsPlans struct { - _ struct{} `type:"structure"` - - // The EC2 instance Savings Plans configuration used for recommendations. - Configuration *Ec2InstanceSavingsPlansConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the Savings Plans purchase recommendation. - CostCalculation *SavingsPlansCostCalculation `locationName:"costCalculation" 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 Ec2InstanceSavingsPlans) 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 Ec2InstanceSavingsPlans) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *Ec2InstanceSavingsPlans) SetConfiguration(v *Ec2InstanceSavingsPlansConfiguration) *Ec2InstanceSavingsPlans { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *Ec2InstanceSavingsPlans) SetCostCalculation(v *SavingsPlansCostCalculation) *Ec2InstanceSavingsPlans { - s.CostCalculation = v - return s -} - -// The EC2 instance Savings Plans configuration used for recommendations. -type Ec2InstanceSavingsPlansConfiguration struct { - _ struct{} `type:"structure"` - - // The account scope that you want your recommendations for. - AccountScope *string `locationName:"accountScope" type:"string"` - - // The hourly commitment for the Savings Plans type. - HourlyCommitment *string `locationName:"hourlyCommitment" type:"string"` - - // The instance family of the recommended Savings Plan. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The payment option for the commitment. - PaymentOption *string `locationName:"paymentOption" type:"string"` - - // The Amazon Web Services Region of the commitment. - SavingsPlansRegion *string `locationName:"savingsPlansRegion" type:"string"` - - // The Savings Plans recommendation term in years. - Term *string `locationName:"term" 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 Ec2InstanceSavingsPlansConfiguration) 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 Ec2InstanceSavingsPlansConfiguration) GoString() string { - return s.String() -} - -// SetAccountScope sets the AccountScope field's value. -func (s *Ec2InstanceSavingsPlansConfiguration) SetAccountScope(v string) *Ec2InstanceSavingsPlansConfiguration { - s.AccountScope = &v - return s -} - -// SetHourlyCommitment sets the HourlyCommitment field's value. -func (s *Ec2InstanceSavingsPlansConfiguration) SetHourlyCommitment(v string) *Ec2InstanceSavingsPlansConfiguration { - s.HourlyCommitment = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *Ec2InstanceSavingsPlansConfiguration) SetInstanceFamily(v string) *Ec2InstanceSavingsPlansConfiguration { - s.InstanceFamily = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *Ec2InstanceSavingsPlansConfiguration) SetPaymentOption(v string) *Ec2InstanceSavingsPlansConfiguration { - s.PaymentOption = &v - return s -} - -// SetSavingsPlansRegion sets the SavingsPlansRegion field's value. -func (s *Ec2InstanceSavingsPlansConfiguration) SetSavingsPlansRegion(v string) *Ec2InstanceSavingsPlansConfiguration { - s.SavingsPlansRegion = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *Ec2InstanceSavingsPlansConfiguration) SetTerm(v string) *Ec2InstanceSavingsPlansConfiguration { - s.Term = &v - return s -} - -// The EC2 reserved instances recommendation details. -type Ec2ReservedInstances struct { - _ struct{} `type:"structure"` - - // The EC2 reserved instances configuration used for recommendations. - Configuration *Ec2ReservedInstancesConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the purchase recommendation. - CostCalculation *ReservedInstancesCostCalculation `locationName:"costCalculation" 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 Ec2ReservedInstances) 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 Ec2ReservedInstances) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *Ec2ReservedInstances) SetConfiguration(v *Ec2ReservedInstancesConfiguration) *Ec2ReservedInstances { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *Ec2ReservedInstances) SetCostCalculation(v *ReservedInstancesCostCalculation) *Ec2ReservedInstances { - s.CostCalculation = v - return s -} - -// The EC2 reserved instances configuration used for recommendations. -type Ec2ReservedInstancesConfiguration struct { - _ struct{} `type:"structure"` - - // The account scope that you want your recommendations for. - AccountScope *string `locationName:"accountScope" type:"string"` - - // Determines whether the recommendation is for a current generation instance. - CurrentGeneration *string `locationName:"currentGeneration" type:"string"` - - // The instance family of the recommended reservation. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The type of instance that Amazon Web Services recommends. - InstanceType *string `locationName:"instanceType" type:"string"` - - // How much purchasing reserved instances costs you on a monthly basis. - MonthlyRecurringCost *string `locationName:"monthlyRecurringCost" type:"string"` - - // The number of normalized units that Amazon Web Services recommends that you - // purchase. - NormalizedUnitsToPurchase *string `locationName:"normalizedUnitsToPurchase" type:"string"` - - // The number of instances that Amazon Web Services recommends that you purchase. - NumberOfInstancesToPurchase *string `locationName:"numberOfInstancesToPurchase" type:"string"` - - // Indicates whether the recommendation is for standard or convertible reservations. - OfferingClass *string `locationName:"offeringClass" type:"string"` - - // The payment option for the commitment. - PaymentOption *string `locationName:"paymentOption" type:"string"` - - // The platform of the recommended reservation. The platform is the specific - // combination of operating system, license model, and software on an instance. - Platform *string `locationName:"platform" type:"string"` - - // The Amazon Web Services Region of the commitment. - ReservedInstancesRegion *string `locationName:"reservedInstancesRegion" type:"string"` - - // The service that you want your recommendations for. - Service *string `locationName:"service" type:"string"` - - // Determines whether the recommendation is size flexible. - SizeFlexEligible *bool `locationName:"sizeFlexEligible" type:"boolean"` - - // Determines whether the recommended reservation is dedicated or shared. - Tenancy *string `locationName:"tenancy" type:"string"` - - // The reserved instances recommendation term in years. - Term *string `locationName:"term" type:"string"` - - // How much purchasing this instance costs you upfront. - UpfrontCost *string `locationName:"upfrontCost" 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 Ec2ReservedInstancesConfiguration) 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 Ec2ReservedInstancesConfiguration) GoString() string { - return s.String() -} - -// SetAccountScope sets the AccountScope field's value. -func (s *Ec2ReservedInstancesConfiguration) SetAccountScope(v string) *Ec2ReservedInstancesConfiguration { - s.AccountScope = &v - return s -} - -// SetCurrentGeneration sets the CurrentGeneration field's value. -func (s *Ec2ReservedInstancesConfiguration) SetCurrentGeneration(v string) *Ec2ReservedInstancesConfiguration { - s.CurrentGeneration = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *Ec2ReservedInstancesConfiguration) SetInstanceFamily(v string) *Ec2ReservedInstancesConfiguration { - s.InstanceFamily = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *Ec2ReservedInstancesConfiguration) SetInstanceType(v string) *Ec2ReservedInstancesConfiguration { - s.InstanceType = &v - return s -} - -// SetMonthlyRecurringCost sets the MonthlyRecurringCost field's value. -func (s *Ec2ReservedInstancesConfiguration) SetMonthlyRecurringCost(v string) *Ec2ReservedInstancesConfiguration { - s.MonthlyRecurringCost = &v - return s -} - -// SetNormalizedUnitsToPurchase sets the NormalizedUnitsToPurchase field's value. -func (s *Ec2ReservedInstancesConfiguration) SetNormalizedUnitsToPurchase(v string) *Ec2ReservedInstancesConfiguration { - s.NormalizedUnitsToPurchase = &v - return s -} - -// SetNumberOfInstancesToPurchase sets the NumberOfInstancesToPurchase field's value. -func (s *Ec2ReservedInstancesConfiguration) SetNumberOfInstancesToPurchase(v string) *Ec2ReservedInstancesConfiguration { - s.NumberOfInstancesToPurchase = &v - return s -} - -// SetOfferingClass sets the OfferingClass field's value. -func (s *Ec2ReservedInstancesConfiguration) SetOfferingClass(v string) *Ec2ReservedInstancesConfiguration { - s.OfferingClass = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *Ec2ReservedInstancesConfiguration) SetPaymentOption(v string) *Ec2ReservedInstancesConfiguration { - s.PaymentOption = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *Ec2ReservedInstancesConfiguration) SetPlatform(v string) *Ec2ReservedInstancesConfiguration { - s.Platform = &v - return s -} - -// SetReservedInstancesRegion sets the ReservedInstancesRegion field's value. -func (s *Ec2ReservedInstancesConfiguration) SetReservedInstancesRegion(v string) *Ec2ReservedInstancesConfiguration { - s.ReservedInstancesRegion = &v - return s -} - -// SetService sets the Service field's value. -func (s *Ec2ReservedInstancesConfiguration) SetService(v string) *Ec2ReservedInstancesConfiguration { - s.Service = &v - return s -} - -// SetSizeFlexEligible sets the SizeFlexEligible field's value. -func (s *Ec2ReservedInstancesConfiguration) SetSizeFlexEligible(v bool) *Ec2ReservedInstancesConfiguration { - s.SizeFlexEligible = &v - return s -} - -// SetTenancy sets the Tenancy field's value. -func (s *Ec2ReservedInstancesConfiguration) SetTenancy(v string) *Ec2ReservedInstancesConfiguration { - s.Tenancy = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *Ec2ReservedInstancesConfiguration) SetTerm(v string) *Ec2ReservedInstancesConfiguration { - s.Term = &v - return s -} - -// SetUpfrontCost sets the UpfrontCost field's value. -func (s *Ec2ReservedInstancesConfiguration) SetUpfrontCost(v string) *Ec2ReservedInstancesConfiguration { - s.UpfrontCost = &v - return s -} - -// The ECS service recommendation details. -type EcsService struct { - _ struct{} `type:"structure"` - - // The ECS service configuration used for recommendations. - Configuration *EcsServiceConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the recommendation. - CostCalculation *ResourceCostCalculation `locationName:"costCalculation" 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 EcsService) 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 EcsService) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *EcsService) SetConfiguration(v *EcsServiceConfiguration) *EcsService { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *EcsService) SetCostCalculation(v *ResourceCostCalculation) *EcsService { - s.CostCalculation = v - return s -} - -// The ECS service configuration used for recommendations. -type EcsServiceConfiguration struct { - _ struct{} `type:"structure"` - - // Details about the compute configuration. - Compute *ComputeConfiguration `locationName:"compute" 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 EcsServiceConfiguration) 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 EcsServiceConfiguration) GoString() string { - return s.String() -} - -// SetCompute sets the Compute field's value. -func (s *EcsServiceConfiguration) SetCompute(v *ComputeConfiguration) *EcsServiceConfiguration { - s.Compute = v - return s -} - -// The ElastiCache reserved instances recommendation details. -type ElastiCacheReservedInstances struct { - _ struct{} `type:"structure"` - - // The ElastiCache reserved instances configuration used for recommendations. - Configuration *ElastiCacheReservedInstancesConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the purchase recommendation. - CostCalculation *ReservedInstancesCostCalculation `locationName:"costCalculation" 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 ElastiCacheReservedInstances) 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 ElastiCacheReservedInstances) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *ElastiCacheReservedInstances) SetConfiguration(v *ElastiCacheReservedInstancesConfiguration) *ElastiCacheReservedInstances { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *ElastiCacheReservedInstances) SetCostCalculation(v *ReservedInstancesCostCalculation) *ElastiCacheReservedInstances { - s.CostCalculation = v - return s -} - -// The ElastiCache reserved instances configuration used for recommendations. -type ElastiCacheReservedInstancesConfiguration struct { - _ struct{} `type:"structure"` - - // The account scope that you want your recommendations for. - AccountScope *string `locationName:"accountScope" type:"string"` - - // Determines whether the recommendation is for a current generation instance. - CurrentGeneration *string `locationName:"currentGeneration" type:"string"` - - // The instance family of the recommended reservation. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The type of instance that Amazon Web Services recommends. - InstanceType *string `locationName:"instanceType" type:"string"` - - // How much purchasing reserved instances costs you on a monthly basis. - MonthlyRecurringCost *string `locationName:"monthlyRecurringCost" type:"string"` - - // The number of normalized units that Amazon Web Services recommends that you - // purchase. - NormalizedUnitsToPurchase *string `locationName:"normalizedUnitsToPurchase" type:"string"` - - // The number of instances that Amazon Web Services recommends that you purchase. - NumberOfInstancesToPurchase *string `locationName:"numberOfInstancesToPurchase" type:"string"` - - // The payment option for the commitment. - PaymentOption *string `locationName:"paymentOption" type:"string"` - - // The Amazon Web Services Region of the commitment. - ReservedInstancesRegion *string `locationName:"reservedInstancesRegion" type:"string"` - - // The service that you want your recommendations for. - Service *string `locationName:"service" type:"string"` - - // Determines whether the recommendation is size flexible. - SizeFlexEligible *bool `locationName:"sizeFlexEligible" type:"boolean"` - - // The reserved instances recommendation term in years. - Term *string `locationName:"term" type:"string"` - - // How much purchasing this instance costs you upfront. - UpfrontCost *string `locationName:"upfrontCost" 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 ElastiCacheReservedInstancesConfiguration) 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 ElastiCacheReservedInstancesConfiguration) GoString() string { - return s.String() -} - -// SetAccountScope sets the AccountScope field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetAccountScope(v string) *ElastiCacheReservedInstancesConfiguration { - s.AccountScope = &v - return s -} - -// SetCurrentGeneration sets the CurrentGeneration field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetCurrentGeneration(v string) *ElastiCacheReservedInstancesConfiguration { - s.CurrentGeneration = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetInstanceFamily(v string) *ElastiCacheReservedInstancesConfiguration { - s.InstanceFamily = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetInstanceType(v string) *ElastiCacheReservedInstancesConfiguration { - s.InstanceType = &v - return s -} - -// SetMonthlyRecurringCost sets the MonthlyRecurringCost field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetMonthlyRecurringCost(v string) *ElastiCacheReservedInstancesConfiguration { - s.MonthlyRecurringCost = &v - return s -} - -// SetNormalizedUnitsToPurchase sets the NormalizedUnitsToPurchase field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetNormalizedUnitsToPurchase(v string) *ElastiCacheReservedInstancesConfiguration { - s.NormalizedUnitsToPurchase = &v - return s -} - -// SetNumberOfInstancesToPurchase sets the NumberOfInstancesToPurchase field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetNumberOfInstancesToPurchase(v string) *ElastiCacheReservedInstancesConfiguration { - s.NumberOfInstancesToPurchase = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetPaymentOption(v string) *ElastiCacheReservedInstancesConfiguration { - s.PaymentOption = &v - return s -} - -// SetReservedInstancesRegion sets the ReservedInstancesRegion field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetReservedInstancesRegion(v string) *ElastiCacheReservedInstancesConfiguration { - s.ReservedInstancesRegion = &v - return s -} - -// SetService sets the Service field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetService(v string) *ElastiCacheReservedInstancesConfiguration { - s.Service = &v - return s -} - -// SetSizeFlexEligible sets the SizeFlexEligible field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetSizeFlexEligible(v bool) *ElastiCacheReservedInstancesConfiguration { - s.SizeFlexEligible = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetTerm(v string) *ElastiCacheReservedInstancesConfiguration { - s.Term = &v - return s -} - -// SetUpfrontCost sets the UpfrontCost field's value. -func (s *ElastiCacheReservedInstancesConfiguration) SetUpfrontCost(v string) *ElastiCacheReservedInstancesConfiguration { - s.UpfrontCost = &v - return s -} - -// Estimated discount details of the current and recommended resource configuration -// for a recommendation. -type EstimatedDiscounts struct { - _ struct{} `type:"structure"` - - // Estimated other discounts include all discounts that are not itemized. Itemized - // discounts include reservedInstanceDiscount and savingsPlansDiscount. - OtherDiscount *float64 `locationName:"otherDiscount" type:"double"` - - // Estimated reserved instance discounts. - ReservedInstancesDiscount *float64 `locationName:"reservedInstancesDiscount" type:"double"` - - // Estimated Savings Plans discounts. - SavingsPlansDiscount *float64 `locationName:"savingsPlansDiscount" type:"double"` -} - -// 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 EstimatedDiscounts) 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 EstimatedDiscounts) GoString() string { - return s.String() -} - -// SetOtherDiscount sets the OtherDiscount field's value. -func (s *EstimatedDiscounts) SetOtherDiscount(v float64) *EstimatedDiscounts { - s.OtherDiscount = &v - return s -} - -// SetReservedInstancesDiscount sets the ReservedInstancesDiscount field's value. -func (s *EstimatedDiscounts) SetReservedInstancesDiscount(v float64) *EstimatedDiscounts { - s.ReservedInstancesDiscount = &v - return s -} - -// SetSavingsPlansDiscount sets the SavingsPlansDiscount field's value. -func (s *EstimatedDiscounts) SetSavingsPlansDiscount(v float64) *EstimatedDiscounts { - s.SavingsPlansDiscount = &v - return s -} - -// Describes a filter that returns a more specific list of recommendations. -// Filters recommendations by different dimensions. -type Filter struct { - _ struct{} `type:"structure"` - - // The account that the recommendation is for. - AccountIds []*string `locationName:"accountIds" min:"1" type:"list"` - - // The type of action you can take by adopting the recommendation. - ActionTypes []*string `locationName:"actionTypes" min:"1" type:"list" enum:"ActionType"` - - // The effort required to implement the recommendation. - ImplementationEfforts []*string `locationName:"implementationEfforts" min:"1" type:"list" enum:"ImplementationEffort"` - - // The IDs for the recommendations. - RecommendationIds []*string `locationName:"recommendationIds" min:"1" type:"list"` - - // The Amazon Web Services Region of the resource. - Regions []*string `locationName:"regions" min:"1" type:"list"` - - // The Amazon Resource Name (ARN) of the recommendation. - ResourceArns []*string `locationName:"resourceArns" min:"1" type:"list"` - - // The resource ID of the recommendation. - ResourceIds []*string `locationName:"resourceIds" min:"1" type:"list"` - - // The resource type of the recommendation. - ResourceTypes []*string `locationName:"resourceTypes" min:"1" type:"list" enum:"ResourceType"` - - // Whether or not implementing the recommendation requires a restart. - RestartNeeded *bool `locationName:"restartNeeded" type:"boolean"` - - // Whether or not implementing the recommendation can be rolled back. - RollbackPossible *bool `locationName:"rollbackPossible" type:"boolean"` - - // A list of tags assigned to the recommendation. - Tags []*Tag `locationName:"tags" min:"1" type:"list"` -} - -// 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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Filter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Filter"} - if s.AccountIds != nil && len(s.AccountIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AccountIds", 1)) - } - if s.ActionTypes != nil && len(s.ActionTypes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionTypes", 1)) - } - if s.ImplementationEfforts != nil && len(s.ImplementationEfforts) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImplementationEfforts", 1)) - } - if s.RecommendationIds != nil && len(s.RecommendationIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RecommendationIds", 1)) - } - if s.Regions != nil && len(s.Regions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Regions", 1)) - } - if s.ResourceArns != nil && len(s.ResourceArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArns", 1)) - } - if s.ResourceIds != nil && len(s.ResourceIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIds", 1)) - } - if s.ResourceTypes != nil && len(s.ResourceTypes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceTypes", 1)) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountIds sets the AccountIds field's value. -func (s *Filter) SetAccountIds(v []*string) *Filter { - s.AccountIds = v - return s -} - -// SetActionTypes sets the ActionTypes field's value. -func (s *Filter) SetActionTypes(v []*string) *Filter { - s.ActionTypes = v - return s -} - -// SetImplementationEfforts sets the ImplementationEfforts field's value. -func (s *Filter) SetImplementationEfforts(v []*string) *Filter { - s.ImplementationEfforts = v - return s -} - -// SetRecommendationIds sets the RecommendationIds field's value. -func (s *Filter) SetRecommendationIds(v []*string) *Filter { - s.RecommendationIds = v - return s -} - -// SetRegions sets the Regions field's value. -func (s *Filter) SetRegions(v []*string) *Filter { - s.Regions = v - return s -} - -// SetResourceArns sets the ResourceArns field's value. -func (s *Filter) SetResourceArns(v []*string) *Filter { - s.ResourceArns = v - return s -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *Filter) SetResourceIds(v []*string) *Filter { - s.ResourceIds = v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *Filter) SetResourceTypes(v []*string) *Filter { - s.ResourceTypes = v - return s -} - -// SetRestartNeeded sets the RestartNeeded field's value. -func (s *Filter) SetRestartNeeded(v bool) *Filter { - s.RestartNeeded = &v - return s -} - -// SetRollbackPossible sets the RollbackPossible field's value. -func (s *Filter) SetRollbackPossible(v bool) *Filter { - s.RollbackPossible = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Filter) SetTags(v []*Tag) *Filter { - s.Tags = v - return s -} - -type GetPreferencesInput 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 GetPreferencesInput) 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 GetPreferencesInput) GoString() string { - return s.String() -} - -type GetPreferencesOutput struct { - _ struct{} `type:"structure"` - - // Retrieves the status of the "member account discount visibility" preference. - MemberAccountDiscountVisibility *string `locationName:"memberAccountDiscountVisibility" type:"string" enum:"MemberAccountDiscountVisibility"` - - // Retrieves the status of the "savings estimation mode" preference. - SavingsEstimationMode *string `locationName:"savingsEstimationMode" type:"string" enum:"SavingsEstimationMode"` -} - -// 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 GetPreferencesOutput) 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 GetPreferencesOutput) GoString() string { - return s.String() -} - -// SetMemberAccountDiscountVisibility sets the MemberAccountDiscountVisibility field's value. -func (s *GetPreferencesOutput) SetMemberAccountDiscountVisibility(v string) *GetPreferencesOutput { - s.MemberAccountDiscountVisibility = &v - return s -} - -// SetSavingsEstimationMode sets the SavingsEstimationMode field's value. -func (s *GetPreferencesOutput) SetSavingsEstimationMode(v string) *GetPreferencesOutput { - s.SavingsEstimationMode = &v - return s -} - -type GetRecommendationInput struct { - _ struct{} `type:"structure"` - - // The ID for the recommendation. - // - // RecommendationId is a required field - RecommendationId *string `locationName:"recommendationId" 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 GetRecommendationInput) 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 GetRecommendationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRecommendationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRecommendationInput"} - if s.RecommendationId == nil { - invalidParams.Add(request.NewErrParamRequired("RecommendationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRecommendationId sets the RecommendationId field's value. -func (s *GetRecommendationInput) SetRecommendationId(v string) *GetRecommendationInput { - s.RecommendationId = &v - return s -} - -type GetRecommendationOutput struct { - _ struct{} `type:"structure"` - - // The account that the recommendation is for. - AccountId *string `locationName:"accountId" type:"string"` - - // The type of action you can take by adopting the recommendation. - ActionType *string `locationName:"actionType" type:"string" enum:"ActionType"` - - // The lookback period used to calculate cost impact for a recommendation. - CostCalculationLookbackPeriodInDays *int64 `locationName:"costCalculationLookbackPeriodInDays" type:"integer"` - - // The currency code used for the recommendation. - CurrencyCode *string `locationName:"currencyCode" type:"string"` - - // The details for the resource. - CurrentResourceDetails *ResourceDetails `locationName:"currentResourceDetails" type:"structure"` - - // The type of resource. - CurrentResourceType *string `locationName:"currentResourceType" type:"string" enum:"ResourceType"` - - // The estimated monthly cost of the recommendation. - EstimatedMonthlyCost *float64 `locationName:"estimatedMonthlyCost" type:"double"` - - // The estimated monthly savings amount for the recommendation. - EstimatedMonthlySavings *float64 `locationName:"estimatedMonthlySavings" type:"double"` - - // The estimated savings amount over the lookback period used to calculate cost - // impact for a recommendation. - EstimatedSavingsOverCostCalculationLookbackPeriod *float64 `locationName:"estimatedSavingsOverCostCalculationLookbackPeriod" type:"double"` - - // The estimated savings percentage relative to the total cost over the cost - // calculation lookback period. - EstimatedSavingsPercentage *float64 `locationName:"estimatedSavingsPercentage" type:"double"` - - // The effort required to implement the recommendation. - ImplementationEffort *string `locationName:"implementationEffort" type:"string" enum:"ImplementationEffort"` - - // The time when the recommendation was last generated. - LastRefreshTimestamp *time.Time `locationName:"lastRefreshTimestamp" type:"timestamp"` - - // The ID for the recommendation. - RecommendationId *string `locationName:"recommendationId" type:"string"` - - // The lookback period that's used to generate the recommendation. - RecommendationLookbackPeriodInDays *int64 `locationName:"recommendationLookbackPeriodInDays" type:"integer"` - - // The details about the recommended resource. - RecommendedResourceDetails *ResourceDetails `locationName:"recommendedResourceDetails" type:"structure"` - - // The resource type of the recommendation. - RecommendedResourceType *string `locationName:"recommendedResourceType" type:"string" enum:"ResourceType"` - - // The Amazon Web Services Region of the resource. - Region *string `locationName:"region" type:"string"` - - // The Amazon Resource Name (ARN) of the resource. - ResourceArn *string `locationName:"resourceArn" type:"string"` - - // The unique identifier for the resource. This is the same as the Amazon Resource - // Name (ARN), if available. - ResourceId *string `locationName:"resourceId" type:"string"` - - // Whether or not implementing the recommendation requires a restart. - RestartNeeded *bool `locationName:"restartNeeded" type:"boolean"` - - // Whether or not implementing the recommendation can be rolled back. - RollbackPossible *bool `locationName:"rollbackPossible" type:"boolean"` - - // The source of the recommendation. - Source *string `locationName:"source" type:"string" enum:"Source"` - - // A list of tags associated with the resource for which the recommendation - // exists. - Tags []*Tag `locationName:"tags" min:"1" type:"list"` -} - -// 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 GetRecommendationOutput) 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 GetRecommendationOutput) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *GetRecommendationOutput) SetAccountId(v string) *GetRecommendationOutput { - s.AccountId = &v - return s -} - -// SetActionType sets the ActionType field's value. -func (s *GetRecommendationOutput) SetActionType(v string) *GetRecommendationOutput { - s.ActionType = &v - return s -} - -// SetCostCalculationLookbackPeriodInDays sets the CostCalculationLookbackPeriodInDays field's value. -func (s *GetRecommendationOutput) SetCostCalculationLookbackPeriodInDays(v int64) *GetRecommendationOutput { - s.CostCalculationLookbackPeriodInDays = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *GetRecommendationOutput) SetCurrencyCode(v string) *GetRecommendationOutput { - s.CurrencyCode = &v - return s -} - -// SetCurrentResourceDetails sets the CurrentResourceDetails field's value. -func (s *GetRecommendationOutput) SetCurrentResourceDetails(v *ResourceDetails) *GetRecommendationOutput { - s.CurrentResourceDetails = v - return s -} - -// SetCurrentResourceType sets the CurrentResourceType field's value. -func (s *GetRecommendationOutput) SetCurrentResourceType(v string) *GetRecommendationOutput { - s.CurrentResourceType = &v - return s -} - -// SetEstimatedMonthlyCost sets the EstimatedMonthlyCost field's value. -func (s *GetRecommendationOutput) SetEstimatedMonthlyCost(v float64) *GetRecommendationOutput { - s.EstimatedMonthlyCost = &v - return s -} - -// SetEstimatedMonthlySavings sets the EstimatedMonthlySavings field's value. -func (s *GetRecommendationOutput) SetEstimatedMonthlySavings(v float64) *GetRecommendationOutput { - s.EstimatedMonthlySavings = &v - return s -} - -// SetEstimatedSavingsOverCostCalculationLookbackPeriod sets the EstimatedSavingsOverCostCalculationLookbackPeriod field's value. -func (s *GetRecommendationOutput) SetEstimatedSavingsOverCostCalculationLookbackPeriod(v float64) *GetRecommendationOutput { - s.EstimatedSavingsOverCostCalculationLookbackPeriod = &v - return s -} - -// SetEstimatedSavingsPercentage sets the EstimatedSavingsPercentage field's value. -func (s *GetRecommendationOutput) SetEstimatedSavingsPercentage(v float64) *GetRecommendationOutput { - s.EstimatedSavingsPercentage = &v - return s -} - -// SetImplementationEffort sets the ImplementationEffort field's value. -func (s *GetRecommendationOutput) SetImplementationEffort(v string) *GetRecommendationOutput { - s.ImplementationEffort = &v - return s -} - -// SetLastRefreshTimestamp sets the LastRefreshTimestamp field's value. -func (s *GetRecommendationOutput) SetLastRefreshTimestamp(v time.Time) *GetRecommendationOutput { - s.LastRefreshTimestamp = &v - return s -} - -// SetRecommendationId sets the RecommendationId field's value. -func (s *GetRecommendationOutput) SetRecommendationId(v string) *GetRecommendationOutput { - s.RecommendationId = &v - return s -} - -// SetRecommendationLookbackPeriodInDays sets the RecommendationLookbackPeriodInDays field's value. -func (s *GetRecommendationOutput) SetRecommendationLookbackPeriodInDays(v int64) *GetRecommendationOutput { - s.RecommendationLookbackPeriodInDays = &v - return s -} - -// SetRecommendedResourceDetails sets the RecommendedResourceDetails field's value. -func (s *GetRecommendationOutput) SetRecommendedResourceDetails(v *ResourceDetails) *GetRecommendationOutput { - s.RecommendedResourceDetails = v - return s -} - -// SetRecommendedResourceType sets the RecommendedResourceType field's value. -func (s *GetRecommendationOutput) SetRecommendedResourceType(v string) *GetRecommendationOutput { - s.RecommendedResourceType = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *GetRecommendationOutput) SetRegion(v string) *GetRecommendationOutput { - s.Region = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *GetRecommendationOutput) SetResourceArn(v string) *GetRecommendationOutput { - s.ResourceArn = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetRecommendationOutput) SetResourceId(v string) *GetRecommendationOutput { - s.ResourceId = &v - return s -} - -// SetRestartNeeded sets the RestartNeeded field's value. -func (s *GetRecommendationOutput) SetRestartNeeded(v bool) *GetRecommendationOutput { - s.RestartNeeded = &v - return s -} - -// SetRollbackPossible sets the RollbackPossible field's value. -func (s *GetRecommendationOutput) SetRollbackPossible(v bool) *GetRecommendationOutput { - s.RollbackPossible = &v - return s -} - -// SetSource sets the Source field's value. -func (s *GetRecommendationOutput) SetSource(v string) *GetRecommendationOutput { - s.Source = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetRecommendationOutput) SetTags(v []*Tag) *GetRecommendationOutput { - s.Tags = v - return s -} - -// The Instance configuration used for recommendations. -type InstanceConfiguration struct { - _ struct{} `type:"structure"` - - // Details about the type. - Type *string `locationName:"type" 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 InstanceConfiguration) 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 InstanceConfiguration) GoString() string { - return s.String() -} - -// SetType sets the Type field's value. -func (s *InstanceConfiguration) SetType(v string) *InstanceConfiguration { - s.Type = &v - return s -} - -// An error on the server occurred during the processing of your request. Try -// again later. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The Lambda function recommendation details. -type LambdaFunction struct { - _ struct{} `type:"structure"` - - // The Lambda function configuration used for recommendations. - Configuration *LambdaFunctionConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the recommendation. - CostCalculation *ResourceCostCalculation `locationName:"costCalculation" 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 LambdaFunction) 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 LambdaFunction) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *LambdaFunction) SetConfiguration(v *LambdaFunctionConfiguration) *LambdaFunction { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *LambdaFunction) SetCostCalculation(v *ResourceCostCalculation) *LambdaFunction { - s.CostCalculation = v - return s -} - -// The Lambda function configuration used for recommendations. -type LambdaFunctionConfiguration struct { - _ struct{} `type:"structure"` - - // Details about the compute configuration. - Compute *ComputeConfiguration `locationName:"compute" 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 LambdaFunctionConfiguration) 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 LambdaFunctionConfiguration) GoString() string { - return s.String() -} - -// SetCompute sets the Compute field's value. -func (s *LambdaFunctionConfiguration) SetCompute(v *ComputeConfiguration) *LambdaFunctionConfiguration { - s.Compute = v - return s -} - -type ListEnrollmentStatusesInput struct { - _ struct{} `type:"structure"` - - // The enrollment status of a specific account ID in the organization. - AccountId *string `locationName:"accountId" type:"string"` - - // Indicates whether to return the enrollment status for the organization. - IncludeOrganizationInfo *bool `locationName:"includeOrganizationInfo" type:"boolean"` - - // The maximum number of objects that are returned for the request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next set of results. - NextToken *string `locationName:"nextToken" 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 ListEnrollmentStatusesInput) 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 ListEnrollmentStatusesInput) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *ListEnrollmentStatusesInput) SetAccountId(v string) *ListEnrollmentStatusesInput { - s.AccountId = &v - return s -} - -// SetIncludeOrganizationInfo sets the IncludeOrganizationInfo field's value. -func (s *ListEnrollmentStatusesInput) SetIncludeOrganizationInfo(v bool) *ListEnrollmentStatusesInput { - s.IncludeOrganizationInfo = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEnrollmentStatusesInput) SetMaxResults(v int64) *ListEnrollmentStatusesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnrollmentStatusesInput) SetNextToken(v string) *ListEnrollmentStatusesInput { - s.NextToken = &v - return s -} - -type ListEnrollmentStatusesOutput struct { - _ struct{} `type:"structure"` - - // The account enrollment statuses. - Items []*AccountEnrollmentStatus `locationName:"items" type:"list"` - - // The token to retrieve the next set of results. - NextToken *string `locationName:"nextToken" 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 ListEnrollmentStatusesOutput) 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 ListEnrollmentStatusesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListEnrollmentStatusesOutput) SetItems(v []*AccountEnrollmentStatus) *ListEnrollmentStatusesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnrollmentStatusesOutput) SetNextToken(v string) *ListEnrollmentStatusesOutput { - s.NextToken = &v - return s -} - -type ListRecommendationSummariesInput struct { - _ struct{} `type:"structure"` - - // Describes a filter that returns a more specific list of recommendations. - // Filters recommendations by different dimensions. - Filter *Filter `locationName:"filter" type:"structure"` - - // The grouping of recommendations by a dimension. - // - // GroupBy is a required field - GroupBy *string `locationName:"groupBy" type:"string" required:"true"` - - // The maximum number of recommendations that are returned for the request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next set of results. - NextToken *string `locationName:"nextToken" 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 ListRecommendationSummariesInput) 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 ListRecommendationSummariesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRecommendationSummariesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRecommendationSummariesInput"} - if s.GroupBy == nil { - invalidParams.Add(request.NewErrParamRequired("GroupBy")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListRecommendationSummariesInput) SetFilter(v *Filter) *ListRecommendationSummariesInput { - s.Filter = v - return s -} - -// SetGroupBy sets the GroupBy field's value. -func (s *ListRecommendationSummariesInput) SetGroupBy(v string) *ListRecommendationSummariesInput { - s.GroupBy = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRecommendationSummariesInput) SetMaxResults(v int64) *ListRecommendationSummariesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecommendationSummariesInput) SetNextToken(v string) *ListRecommendationSummariesInput { - s.NextToken = &v - return s -} - -type ListRecommendationSummariesOutput struct { - _ struct{} `type:"structure"` - - // The currency code used for the recommendation. - CurrencyCode *string `locationName:"currencyCode" type:"string"` - - // The total overall savings for the aggregated view. - EstimatedTotalDedupedSavings *float64 `locationName:"estimatedTotalDedupedSavings" type:"double"` - - // The dimension used to group the recommendations by. - GroupBy *string `locationName:"groupBy" type:"string"` - - // List of all savings recommendations. - Items []*RecommendationSummary `locationName:"items" type:"list"` - - // The token to retrieve the next set of results. - NextToken *string `locationName:"nextToken" 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 ListRecommendationSummariesOutput) 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 ListRecommendationSummariesOutput) GoString() string { - return s.String() -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *ListRecommendationSummariesOutput) SetCurrencyCode(v string) *ListRecommendationSummariesOutput { - s.CurrencyCode = &v - return s -} - -// SetEstimatedTotalDedupedSavings sets the EstimatedTotalDedupedSavings field's value. -func (s *ListRecommendationSummariesOutput) SetEstimatedTotalDedupedSavings(v float64) *ListRecommendationSummariesOutput { - s.EstimatedTotalDedupedSavings = &v - return s -} - -// SetGroupBy sets the GroupBy field's value. -func (s *ListRecommendationSummariesOutput) SetGroupBy(v string) *ListRecommendationSummariesOutput { - s.GroupBy = &v - return s -} - -// SetItems sets the Items field's value. -func (s *ListRecommendationSummariesOutput) SetItems(v []*RecommendationSummary) *ListRecommendationSummariesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecommendationSummariesOutput) SetNextToken(v string) *ListRecommendationSummariesOutput { - s.NextToken = &v - return s -} - -type ListRecommendationsInput struct { - _ struct{} `type:"structure"` - - // The constraints that you want all returned recommendations to match. - Filter *Filter `locationName:"filter" type:"structure"` - - // List of all recommendations for a resource, or a single recommendation if - // de-duped by resourceId. - IncludeAllRecommendations *bool `locationName:"includeAllRecommendations" type:"boolean"` - - // The maximum number of recommendations that are returned for the request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // The token to retrieve the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The ordering of recommendations by a dimension. - OrderBy *OrderBy `locationName:"orderBy" 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 ListRecommendationsInput) 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 ListRecommendationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRecommendationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRecommendationsInput"} - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListRecommendationsInput) SetFilter(v *Filter) *ListRecommendationsInput { - s.Filter = v - return s -} - -// SetIncludeAllRecommendations sets the IncludeAllRecommendations field's value. -func (s *ListRecommendationsInput) SetIncludeAllRecommendations(v bool) *ListRecommendationsInput { - s.IncludeAllRecommendations = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRecommendationsInput) SetMaxResults(v int64) *ListRecommendationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecommendationsInput) SetNextToken(v string) *ListRecommendationsInput { - s.NextToken = &v - return s -} - -// SetOrderBy sets the OrderBy field's value. -func (s *ListRecommendationsInput) SetOrderBy(v *OrderBy) *ListRecommendationsInput { - s.OrderBy = v - return s -} - -type ListRecommendationsOutput struct { - _ struct{} `type:"structure"` - - // List of all savings recommendations. - Items []*Recommendation `locationName:"items" type:"list"` - - // The token to retrieve the next set of results. - NextToken *string `locationName:"nextToken" 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 ListRecommendationsOutput) 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 ListRecommendationsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListRecommendationsOutput) SetItems(v []*Recommendation) *ListRecommendationsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecommendationsOutput) SetNextToken(v string) *ListRecommendationsOutput { - s.NextToken = &v - return s -} - -// The OpenSearch reserved instances recommendation details. -type OpenSearchReservedInstances struct { - _ struct{} `type:"structure"` - - // The OpenSearch reserved instances configuration used for recommendations. - Configuration *OpenSearchReservedInstancesConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the purchase recommendation. - CostCalculation *ReservedInstancesCostCalculation `locationName:"costCalculation" 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 OpenSearchReservedInstances) 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 OpenSearchReservedInstances) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *OpenSearchReservedInstances) SetConfiguration(v *OpenSearchReservedInstancesConfiguration) *OpenSearchReservedInstances { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *OpenSearchReservedInstances) SetCostCalculation(v *ReservedInstancesCostCalculation) *OpenSearchReservedInstances { - s.CostCalculation = v - return s -} - -// The OpenSearch reserved instances configuration used for recommendations. -type OpenSearchReservedInstancesConfiguration struct { - _ struct{} `type:"structure"` - - // The account scope that you want your recommendations for. - AccountScope *string `locationName:"accountScope" type:"string"` - - // Determines whether the recommendation is for a current generation instance. - CurrentGeneration *string `locationName:"currentGeneration" type:"string"` - - // The type of instance that Amazon Web Services recommends. - InstanceType *string `locationName:"instanceType" type:"string"` - - // How much purchasing reserved instances costs you on a monthly basis. - MonthlyRecurringCost *string `locationName:"monthlyRecurringCost" type:"string"` - - // The number of normalized units that Amazon Web Services recommends that you - // purchase. - NormalizedUnitsToPurchase *string `locationName:"normalizedUnitsToPurchase" type:"string"` - - // The number of instances that Amazon Web Services recommends that you purchase. - NumberOfInstancesToPurchase *string `locationName:"numberOfInstancesToPurchase" type:"string"` - - // The payment option for the commitment. - PaymentOption *string `locationName:"paymentOption" type:"string"` - - // The Amazon Web Services Region of the commitment. - ReservedInstancesRegion *string `locationName:"reservedInstancesRegion" type:"string"` - - // The service that you want your recommendations for. - Service *string `locationName:"service" type:"string"` - - // Determines whether the recommendation is size flexible. - SizeFlexEligible *bool `locationName:"sizeFlexEligible" type:"boolean"` - - // The reserved instances recommendation term in years. - Term *string `locationName:"term" type:"string"` - - // How much purchasing this instance costs you upfront. - UpfrontCost *string `locationName:"upfrontCost" 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 OpenSearchReservedInstancesConfiguration) 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 OpenSearchReservedInstancesConfiguration) GoString() string { - return s.String() -} - -// SetAccountScope sets the AccountScope field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetAccountScope(v string) *OpenSearchReservedInstancesConfiguration { - s.AccountScope = &v - return s -} - -// SetCurrentGeneration sets the CurrentGeneration field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetCurrentGeneration(v string) *OpenSearchReservedInstancesConfiguration { - s.CurrentGeneration = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetInstanceType(v string) *OpenSearchReservedInstancesConfiguration { - s.InstanceType = &v - return s -} - -// SetMonthlyRecurringCost sets the MonthlyRecurringCost field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetMonthlyRecurringCost(v string) *OpenSearchReservedInstancesConfiguration { - s.MonthlyRecurringCost = &v - return s -} - -// SetNormalizedUnitsToPurchase sets the NormalizedUnitsToPurchase field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetNormalizedUnitsToPurchase(v string) *OpenSearchReservedInstancesConfiguration { - s.NormalizedUnitsToPurchase = &v - return s -} - -// SetNumberOfInstancesToPurchase sets the NumberOfInstancesToPurchase field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetNumberOfInstancesToPurchase(v string) *OpenSearchReservedInstancesConfiguration { - s.NumberOfInstancesToPurchase = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetPaymentOption(v string) *OpenSearchReservedInstancesConfiguration { - s.PaymentOption = &v - return s -} - -// SetReservedInstancesRegion sets the ReservedInstancesRegion field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetReservedInstancesRegion(v string) *OpenSearchReservedInstancesConfiguration { - s.ReservedInstancesRegion = &v - return s -} - -// SetService sets the Service field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetService(v string) *OpenSearchReservedInstancesConfiguration { - s.Service = &v - return s -} - -// SetSizeFlexEligible sets the SizeFlexEligible field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetSizeFlexEligible(v bool) *OpenSearchReservedInstancesConfiguration { - s.SizeFlexEligible = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetTerm(v string) *OpenSearchReservedInstancesConfiguration { - s.Term = &v - return s -} - -// SetUpfrontCost sets the UpfrontCost field's value. -func (s *OpenSearchReservedInstancesConfiguration) SetUpfrontCost(v string) *OpenSearchReservedInstancesConfiguration { - s.UpfrontCost = &v - return s -} - -// Defines how rows will be sorted in the response. -type OrderBy struct { - _ struct{} `type:"structure"` - - // Sorts by dimension values. - Dimension *string `locationName:"dimension" type:"string"` - - // The order that's used to sort the data. - Order *string `locationName:"order" type:"string" enum:"Order"` -} - -// 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 OrderBy) 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 OrderBy) GoString() string { - return s.String() -} - -// SetDimension sets the Dimension field's value. -func (s *OrderBy) SetDimension(v string) *OrderBy { - s.Dimension = &v - return s -} - -// SetOrder sets the Order field's value. -func (s *OrderBy) SetOrder(v string) *OrderBy { - s.Order = &v - return s -} - -// The RDS reserved instances recommendation details. -type RdsReservedInstances struct { - _ struct{} `type:"structure"` - - // The RDS reserved instances configuration used for recommendations. - Configuration *RdsReservedInstancesConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the purchase recommendation. - CostCalculation *ReservedInstancesCostCalculation `locationName:"costCalculation" 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 RdsReservedInstances) 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 RdsReservedInstances) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *RdsReservedInstances) SetConfiguration(v *RdsReservedInstancesConfiguration) *RdsReservedInstances { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *RdsReservedInstances) SetCostCalculation(v *ReservedInstancesCostCalculation) *RdsReservedInstances { - s.CostCalculation = v - return s -} - -// The RDS reserved instances configuration used for recommendations. -type RdsReservedInstancesConfiguration struct { - _ struct{} `type:"structure"` - - // The account scope that you want your recommendations for. - AccountScope *string `locationName:"accountScope" type:"string"` - - // Determines whether the recommendation is for a current generation instance. - CurrentGeneration *string `locationName:"currentGeneration" type:"string"` - - // The database edition that the recommended reservation supports. - DatabaseEdition *string `locationName:"databaseEdition" type:"string"` - - // The database engine that the recommended reservation supports. - DatabaseEngine *string `locationName:"databaseEngine" type:"string"` - - // Determines whether the recommendation is for a reservation in a single Availability - // Zone or a reservation with a backup in a second Availability Zone. - DeploymentOption *string `locationName:"deploymentOption" type:"string"` - - // The instance family of the recommended reservation. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The type of instance that Amazon Web Services recommends. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The license model that the recommended reservation supports. - LicenseModel *string `locationName:"licenseModel" type:"string"` - - // How much purchasing this instance costs you on a monthly basis. - MonthlyRecurringCost *string `locationName:"monthlyRecurringCost" type:"string"` - - // The number of normalized units that Amazon Web Services recommends that you - // purchase. - NormalizedUnitsToPurchase *string `locationName:"normalizedUnitsToPurchase" type:"string"` - - // The number of instances that Amazon Web Services recommends that you purchase. - NumberOfInstancesToPurchase *string `locationName:"numberOfInstancesToPurchase" type:"string"` - - // The payment option for the commitment. - PaymentOption *string `locationName:"paymentOption" type:"string"` - - // The Amazon Web Services Region of the commitment. - ReservedInstancesRegion *string `locationName:"reservedInstancesRegion" type:"string"` - - // The service that you want your recommendations for. - Service *string `locationName:"service" type:"string"` - - // Determines whether the recommendation is size flexible. - SizeFlexEligible *bool `locationName:"sizeFlexEligible" type:"boolean"` - - // The reserved instances recommendation term in years. - Term *string `locationName:"term" type:"string"` - - // How much purchasing this instance costs you upfront. - UpfrontCost *string `locationName:"upfrontCost" 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 RdsReservedInstancesConfiguration) 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 RdsReservedInstancesConfiguration) GoString() string { - return s.String() -} - -// SetAccountScope sets the AccountScope field's value. -func (s *RdsReservedInstancesConfiguration) SetAccountScope(v string) *RdsReservedInstancesConfiguration { - s.AccountScope = &v - return s -} - -// SetCurrentGeneration sets the CurrentGeneration field's value. -func (s *RdsReservedInstancesConfiguration) SetCurrentGeneration(v string) *RdsReservedInstancesConfiguration { - s.CurrentGeneration = &v - return s -} - -// SetDatabaseEdition sets the DatabaseEdition field's value. -func (s *RdsReservedInstancesConfiguration) SetDatabaseEdition(v string) *RdsReservedInstancesConfiguration { - s.DatabaseEdition = &v - return s -} - -// SetDatabaseEngine sets the DatabaseEngine field's value. -func (s *RdsReservedInstancesConfiguration) SetDatabaseEngine(v string) *RdsReservedInstancesConfiguration { - s.DatabaseEngine = &v - return s -} - -// SetDeploymentOption sets the DeploymentOption field's value. -func (s *RdsReservedInstancesConfiguration) SetDeploymentOption(v string) *RdsReservedInstancesConfiguration { - s.DeploymentOption = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *RdsReservedInstancesConfiguration) SetInstanceFamily(v string) *RdsReservedInstancesConfiguration { - s.InstanceFamily = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *RdsReservedInstancesConfiguration) SetInstanceType(v string) *RdsReservedInstancesConfiguration { - s.InstanceType = &v - return s -} - -// SetLicenseModel sets the LicenseModel field's value. -func (s *RdsReservedInstancesConfiguration) SetLicenseModel(v string) *RdsReservedInstancesConfiguration { - s.LicenseModel = &v - return s -} - -// SetMonthlyRecurringCost sets the MonthlyRecurringCost field's value. -func (s *RdsReservedInstancesConfiguration) SetMonthlyRecurringCost(v string) *RdsReservedInstancesConfiguration { - s.MonthlyRecurringCost = &v - return s -} - -// SetNormalizedUnitsToPurchase sets the NormalizedUnitsToPurchase field's value. -func (s *RdsReservedInstancesConfiguration) SetNormalizedUnitsToPurchase(v string) *RdsReservedInstancesConfiguration { - s.NormalizedUnitsToPurchase = &v - return s -} - -// SetNumberOfInstancesToPurchase sets the NumberOfInstancesToPurchase field's value. -func (s *RdsReservedInstancesConfiguration) SetNumberOfInstancesToPurchase(v string) *RdsReservedInstancesConfiguration { - s.NumberOfInstancesToPurchase = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *RdsReservedInstancesConfiguration) SetPaymentOption(v string) *RdsReservedInstancesConfiguration { - s.PaymentOption = &v - return s -} - -// SetReservedInstancesRegion sets the ReservedInstancesRegion field's value. -func (s *RdsReservedInstancesConfiguration) SetReservedInstancesRegion(v string) *RdsReservedInstancesConfiguration { - s.ReservedInstancesRegion = &v - return s -} - -// SetService sets the Service field's value. -func (s *RdsReservedInstancesConfiguration) SetService(v string) *RdsReservedInstancesConfiguration { - s.Service = &v - return s -} - -// SetSizeFlexEligible sets the SizeFlexEligible field's value. -func (s *RdsReservedInstancesConfiguration) SetSizeFlexEligible(v bool) *RdsReservedInstancesConfiguration { - s.SizeFlexEligible = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *RdsReservedInstancesConfiguration) SetTerm(v string) *RdsReservedInstancesConfiguration { - s.Term = &v - return s -} - -// SetUpfrontCost sets the UpfrontCost field's value. -func (s *RdsReservedInstancesConfiguration) SetUpfrontCost(v string) *RdsReservedInstancesConfiguration { - s.UpfrontCost = &v - return s -} - -// Describes a recommendation. -type Recommendation struct { - _ struct{} `type:"structure"` - - // The account that the recommendation is for. - AccountId *string `locationName:"accountId" type:"string"` - - // The type of tasks that can be carried out by this action. - ActionType *string `locationName:"actionType" type:"string"` - - // The currency code used for the recommendation. - CurrencyCode *string `locationName:"currencyCode" type:"string"` - - // Describes the current resource. - CurrentResourceSummary *string `locationName:"currentResourceSummary" type:"string"` - - // The current resource type. - CurrentResourceType *string `locationName:"currentResourceType" type:"string"` - - // The estimated monthly cost for the recommendation. - EstimatedMonthlyCost *float64 `locationName:"estimatedMonthlyCost" type:"double"` - - // The estimated monthly savings amount for the recommendation. - EstimatedMonthlySavings *float64 `locationName:"estimatedMonthlySavings" type:"double"` - - // The estimated savings percentage relative to the total cost over the cost - // calculation lookback period. - EstimatedSavingsPercentage *float64 `locationName:"estimatedSavingsPercentage" type:"double"` - - // The effort required to implement the recommendation. - ImplementationEffort *string `locationName:"implementationEffort" type:"string"` - - // The time when the recommendation was last generated. - LastRefreshTimestamp *time.Time `locationName:"lastRefreshTimestamp" type:"timestamp"` - - // The ID for the recommendation. - RecommendationId *string `locationName:"recommendationId" type:"string"` - - // The lookback period that's used to generate the recommendation. - RecommendationLookbackPeriodInDays *int64 `locationName:"recommendationLookbackPeriodInDays" type:"integer"` - - // Describes the recommended resource. - RecommendedResourceSummary *string `locationName:"recommendedResourceSummary" type:"string"` - - // The recommended resource type. - RecommendedResourceType *string `locationName:"recommendedResourceType" type:"string"` - - // The Amazon Web Services Region of the resource. - Region *string `locationName:"region" type:"string"` - - // The Amazon Resource Name (ARN) for the recommendation. - ResourceArn *string `locationName:"resourceArn" type:"string"` - - // The resource ID for the recommendation. - ResourceId *string `locationName:"resourceId" type:"string"` - - // Whether or not implementing the recommendation requires a restart. - RestartNeeded *bool `locationName:"restartNeeded" type:"boolean"` - - // Whether or not implementing the recommendation can be rolled back. - RollbackPossible *bool `locationName:"rollbackPossible" type:"boolean"` - - // The source of the recommendation. - Source *string `locationName:"source" type:"string" enum:"Source"` - - // A list of tags assigned to the recommendation. - Tags []*Tag `locationName:"tags" min:"1" type:"list"` -} - -// 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 Recommendation) 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 Recommendation) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *Recommendation) SetAccountId(v string) *Recommendation { - s.AccountId = &v - return s -} - -// SetActionType sets the ActionType field's value. -func (s *Recommendation) SetActionType(v string) *Recommendation { - s.ActionType = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *Recommendation) SetCurrencyCode(v string) *Recommendation { - s.CurrencyCode = &v - return s -} - -// SetCurrentResourceSummary sets the CurrentResourceSummary field's value. -func (s *Recommendation) SetCurrentResourceSummary(v string) *Recommendation { - s.CurrentResourceSummary = &v - return s -} - -// SetCurrentResourceType sets the CurrentResourceType field's value. -func (s *Recommendation) SetCurrentResourceType(v string) *Recommendation { - s.CurrentResourceType = &v - return s -} - -// SetEstimatedMonthlyCost sets the EstimatedMonthlyCost field's value. -func (s *Recommendation) SetEstimatedMonthlyCost(v float64) *Recommendation { - s.EstimatedMonthlyCost = &v - return s -} - -// SetEstimatedMonthlySavings sets the EstimatedMonthlySavings field's value. -func (s *Recommendation) SetEstimatedMonthlySavings(v float64) *Recommendation { - s.EstimatedMonthlySavings = &v - return s -} - -// SetEstimatedSavingsPercentage sets the EstimatedSavingsPercentage field's value. -func (s *Recommendation) SetEstimatedSavingsPercentage(v float64) *Recommendation { - s.EstimatedSavingsPercentage = &v - return s -} - -// SetImplementationEffort sets the ImplementationEffort field's value. -func (s *Recommendation) SetImplementationEffort(v string) *Recommendation { - s.ImplementationEffort = &v - return s -} - -// SetLastRefreshTimestamp sets the LastRefreshTimestamp field's value. -func (s *Recommendation) SetLastRefreshTimestamp(v time.Time) *Recommendation { - s.LastRefreshTimestamp = &v - return s -} - -// SetRecommendationId sets the RecommendationId field's value. -func (s *Recommendation) SetRecommendationId(v string) *Recommendation { - s.RecommendationId = &v - return s -} - -// SetRecommendationLookbackPeriodInDays sets the RecommendationLookbackPeriodInDays field's value. -func (s *Recommendation) SetRecommendationLookbackPeriodInDays(v int64) *Recommendation { - s.RecommendationLookbackPeriodInDays = &v - return s -} - -// SetRecommendedResourceSummary sets the RecommendedResourceSummary field's value. -func (s *Recommendation) SetRecommendedResourceSummary(v string) *Recommendation { - s.RecommendedResourceSummary = &v - return s -} - -// SetRecommendedResourceType sets the RecommendedResourceType field's value. -func (s *Recommendation) SetRecommendedResourceType(v string) *Recommendation { - s.RecommendedResourceType = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *Recommendation) SetRegion(v string) *Recommendation { - s.Region = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *Recommendation) SetResourceArn(v string) *Recommendation { - s.ResourceArn = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *Recommendation) SetResourceId(v string) *Recommendation { - s.ResourceId = &v - return s -} - -// SetRestartNeeded sets the RestartNeeded field's value. -func (s *Recommendation) SetRestartNeeded(v bool) *Recommendation { - s.RestartNeeded = &v - return s -} - -// SetRollbackPossible sets the RollbackPossible field's value. -func (s *Recommendation) SetRollbackPossible(v bool) *Recommendation { - s.RollbackPossible = &v - return s -} - -// SetSource sets the Source field's value. -func (s *Recommendation) SetSource(v string) *Recommendation { - s.Source = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Recommendation) SetTags(v []*Tag) *Recommendation { - s.Tags = v - return s -} - -// The summary of rightsizing recommendations, including de-duped savings from -// all types of recommendations. -type RecommendationSummary struct { - _ struct{} `type:"structure"` - - // The estimated total savings resulting from modifications, on a monthly basis. - EstimatedMonthlySavings *float64 `locationName:"estimatedMonthlySavings" type:"double"` - - // The grouping of recommendations. - Group *string `locationName:"group" type:"string"` - - // The total number of instance recommendations. - RecommendationCount *int64 `locationName:"recommendationCount" 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 RecommendationSummary) 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 RecommendationSummary) GoString() string { - return s.String() -} - -// SetEstimatedMonthlySavings sets the EstimatedMonthlySavings field's value. -func (s *RecommendationSummary) SetEstimatedMonthlySavings(v float64) *RecommendationSummary { - s.EstimatedMonthlySavings = &v - return s -} - -// SetGroup sets the Group field's value. -func (s *RecommendationSummary) SetGroup(v string) *RecommendationSummary { - s.Group = &v - return s -} - -// SetRecommendationCount sets the RecommendationCount field's value. -func (s *RecommendationSummary) SetRecommendationCount(v int64) *RecommendationSummary { - s.RecommendationCount = &v - return s -} - -// The Redshift reserved instances recommendation details. -type RedshiftReservedInstances struct { - _ struct{} `type:"structure"` - - // The Redshift reserved instances configuration used for recommendations. - Configuration *RedshiftReservedInstancesConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the purchase recommendation. - CostCalculation *ReservedInstancesCostCalculation `locationName:"costCalculation" 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 RedshiftReservedInstances) 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 RedshiftReservedInstances) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *RedshiftReservedInstances) SetConfiguration(v *RedshiftReservedInstancesConfiguration) *RedshiftReservedInstances { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *RedshiftReservedInstances) SetCostCalculation(v *ReservedInstancesCostCalculation) *RedshiftReservedInstances { - s.CostCalculation = v - return s -} - -// The Redshift reserved instances configuration used for recommendations. -type RedshiftReservedInstancesConfiguration struct { - _ struct{} `type:"structure"` - - // The account scope that you want your recommendations for. - AccountScope *string `locationName:"accountScope" type:"string"` - - // Determines whether the recommendation is for a current generation instance. - CurrentGeneration *string `locationName:"currentGeneration" type:"string"` - - // The instance family of the recommended reservation. - InstanceFamily *string `locationName:"instanceFamily" type:"string"` - - // The type of instance that Amazon Web Services recommends. - InstanceType *string `locationName:"instanceType" type:"string"` - - // How much purchasing reserved instances costs you on a monthly basis. - MonthlyRecurringCost *string `locationName:"monthlyRecurringCost" type:"string"` - - // The number of normalized units that Amazon Web Services recommends that you - // purchase. - NormalizedUnitsToPurchase *string `locationName:"normalizedUnitsToPurchase" type:"string"` - - // The number of instances that Amazon Web Services recommends that you purchase. - NumberOfInstancesToPurchase *string `locationName:"numberOfInstancesToPurchase" type:"string"` - - // The payment option for the commitment. - PaymentOption *string `locationName:"paymentOption" type:"string"` - - // The Amazon Web Services Region of the commitment. - ReservedInstancesRegion *string `locationName:"reservedInstancesRegion" type:"string"` - - // The service that you want your recommendations for. - Service *string `locationName:"service" type:"string"` - - // Determines whether the recommendation is size flexible. - SizeFlexEligible *bool `locationName:"sizeFlexEligible" type:"boolean"` - - // The reserved instances recommendation term in years. - Term *string `locationName:"term" type:"string"` - - // How much purchasing this instance costs you upfront. - UpfrontCost *string `locationName:"upfrontCost" 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 RedshiftReservedInstancesConfiguration) 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 RedshiftReservedInstancesConfiguration) GoString() string { - return s.String() -} - -// SetAccountScope sets the AccountScope field's value. -func (s *RedshiftReservedInstancesConfiguration) SetAccountScope(v string) *RedshiftReservedInstancesConfiguration { - s.AccountScope = &v - return s -} - -// SetCurrentGeneration sets the CurrentGeneration field's value. -func (s *RedshiftReservedInstancesConfiguration) SetCurrentGeneration(v string) *RedshiftReservedInstancesConfiguration { - s.CurrentGeneration = &v - return s -} - -// SetInstanceFamily sets the InstanceFamily field's value. -func (s *RedshiftReservedInstancesConfiguration) SetInstanceFamily(v string) *RedshiftReservedInstancesConfiguration { - s.InstanceFamily = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *RedshiftReservedInstancesConfiguration) SetInstanceType(v string) *RedshiftReservedInstancesConfiguration { - s.InstanceType = &v - return s -} - -// SetMonthlyRecurringCost sets the MonthlyRecurringCost field's value. -func (s *RedshiftReservedInstancesConfiguration) SetMonthlyRecurringCost(v string) *RedshiftReservedInstancesConfiguration { - s.MonthlyRecurringCost = &v - return s -} - -// SetNormalizedUnitsToPurchase sets the NormalizedUnitsToPurchase field's value. -func (s *RedshiftReservedInstancesConfiguration) SetNormalizedUnitsToPurchase(v string) *RedshiftReservedInstancesConfiguration { - s.NormalizedUnitsToPurchase = &v - return s -} - -// SetNumberOfInstancesToPurchase sets the NumberOfInstancesToPurchase field's value. -func (s *RedshiftReservedInstancesConfiguration) SetNumberOfInstancesToPurchase(v string) *RedshiftReservedInstancesConfiguration { - s.NumberOfInstancesToPurchase = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *RedshiftReservedInstancesConfiguration) SetPaymentOption(v string) *RedshiftReservedInstancesConfiguration { - s.PaymentOption = &v - return s -} - -// SetReservedInstancesRegion sets the ReservedInstancesRegion field's value. -func (s *RedshiftReservedInstancesConfiguration) SetReservedInstancesRegion(v string) *RedshiftReservedInstancesConfiguration { - s.ReservedInstancesRegion = &v - return s -} - -// SetService sets the Service field's value. -func (s *RedshiftReservedInstancesConfiguration) SetService(v string) *RedshiftReservedInstancesConfiguration { - s.Service = &v - return s -} - -// SetSizeFlexEligible sets the SizeFlexEligible field's value. -func (s *RedshiftReservedInstancesConfiguration) SetSizeFlexEligible(v bool) *RedshiftReservedInstancesConfiguration { - s.SizeFlexEligible = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *RedshiftReservedInstancesConfiguration) SetTerm(v string) *RedshiftReservedInstancesConfiguration { - s.Term = &v - return s -} - -// SetUpfrontCost sets the UpfrontCost field's value. -func (s *RedshiftReservedInstancesConfiguration) SetUpfrontCost(v string) *RedshiftReservedInstancesConfiguration { - s.UpfrontCost = &v - return s -} - -// Cost impact of the purchase recommendation. -type ReservedInstancesCostCalculation struct { - _ struct{} `type:"structure"` - - // Pricing details of the purchase recommendation. - Pricing *ReservedInstancesPricing `locationName:"pricing" 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 ReservedInstancesCostCalculation) 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 ReservedInstancesCostCalculation) GoString() string { - return s.String() -} - -// SetPricing sets the Pricing field's value. -func (s *ReservedInstancesCostCalculation) SetPricing(v *ReservedInstancesPricing) *ReservedInstancesCostCalculation { - s.Pricing = v - return s -} - -// Pricing details for your recommended reserved instance. -type ReservedInstancesPricing struct { - _ struct{} `type:"structure"` - - // The estimated cost of your recurring monthly fees for the recommended reserved - // instance across the month. - EstimatedMonthlyAmortizedReservationCost *float64 `locationName:"estimatedMonthlyAmortizedReservationCost" type:"double"` - - // The remaining On-Demand cost estimated to not be covered by the recommended - // reserved instance, over the length of the lookback period. - EstimatedOnDemandCost *float64 `locationName:"estimatedOnDemandCost" type:"double"` - - // The cost of paying for the recommended reserved instance monthly. - MonthlyReservationEligibleCost *float64 `locationName:"monthlyReservationEligibleCost" type:"double"` - - // The savings percentage relative to the total On-Demand costs that are associated - // with this instance. - SavingsPercentage *float64 `locationName:"savingsPercentage" type:"double"` -} - -// 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 ReservedInstancesPricing) 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 ReservedInstancesPricing) GoString() string { - return s.String() -} - -// SetEstimatedMonthlyAmortizedReservationCost sets the EstimatedMonthlyAmortizedReservationCost field's value. -func (s *ReservedInstancesPricing) SetEstimatedMonthlyAmortizedReservationCost(v float64) *ReservedInstancesPricing { - s.EstimatedMonthlyAmortizedReservationCost = &v - return s -} - -// SetEstimatedOnDemandCost sets the EstimatedOnDemandCost field's value. -func (s *ReservedInstancesPricing) SetEstimatedOnDemandCost(v float64) *ReservedInstancesPricing { - s.EstimatedOnDemandCost = &v - return s -} - -// SetMonthlyReservationEligibleCost sets the MonthlyReservationEligibleCost field's value. -func (s *ReservedInstancesPricing) SetMonthlyReservationEligibleCost(v float64) *ReservedInstancesPricing { - s.MonthlyReservationEligibleCost = &v - return s -} - -// SetSavingsPercentage sets the SavingsPercentage field's value. -func (s *ReservedInstancesPricing) SetSavingsPercentage(v float64) *ReservedInstancesPricing { - s.SavingsPercentage = &v - return s -} - -// Cost impact of the resource recommendation. -type ResourceCostCalculation struct { - _ struct{} `type:"structure"` - - // Pricing details of the resource recommendation. - Pricing *ResourcePricing `locationName:"pricing" type:"structure"` - - // Usage details of the resource recommendation. - Usages []*Usage `locationName:"usages" type:"list"` -} - -// 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 ResourceCostCalculation) 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 ResourceCostCalculation) GoString() string { - return s.String() -} - -// SetPricing sets the Pricing field's value. -func (s *ResourceCostCalculation) SetPricing(v *ResourcePricing) *ResourceCostCalculation { - s.Pricing = v - return s -} - -// SetUsages sets the Usages field's value. -func (s *ResourceCostCalculation) SetUsages(v []*Usage) *ResourceCostCalculation { - s.Usages = v - return s -} - -// Contains detailed information about the specified resource. -type ResourceDetails struct { - _ struct{} `type:"structure"` - - // The Compute Savings Plans recommendation details. - ComputeSavingsPlans *ComputeSavingsPlans `locationName:"computeSavingsPlans" type:"structure"` - - // The Amazon Elastic Block Store volume recommendation details. - EbsVolume *EbsVolume `locationName:"ebsVolume" type:"structure"` - - // The EC2 Auto Scaling group recommendation details. - Ec2AutoScalingGroup *Ec2AutoScalingGroup `locationName:"ec2AutoScalingGroup" type:"structure"` - - // The EC2 instance recommendation details. - Ec2Instance *Ec2Instance `locationName:"ec2Instance" type:"structure"` - - // The EC2 instance Savings Plans recommendation details. - Ec2InstanceSavingsPlans *Ec2InstanceSavingsPlans `locationName:"ec2InstanceSavingsPlans" type:"structure"` - - // The EC2 reserved instances recommendation details. - Ec2ReservedInstances *Ec2ReservedInstances `locationName:"ec2ReservedInstances" type:"structure"` - - // The ECS service recommendation details. - EcsService *EcsService `locationName:"ecsService" type:"structure"` - - // The ElastiCache reserved instances recommendation details. - ElastiCacheReservedInstances *ElastiCacheReservedInstances `locationName:"elastiCacheReservedInstances" type:"structure"` - - // The Lambda function recommendation details. - LambdaFunction *LambdaFunction `locationName:"lambdaFunction" type:"structure"` - - // The OpenSearch reserved instances recommendation details. - OpenSearchReservedInstances *OpenSearchReservedInstances `locationName:"openSearchReservedInstances" type:"structure"` - - // The RDS reserved instances recommendation details. - RdsReservedInstances *RdsReservedInstances `locationName:"rdsReservedInstances" type:"structure"` - - // The Redshift reserved instances recommendation details. - RedshiftReservedInstances *RedshiftReservedInstances `locationName:"redshiftReservedInstances" type:"structure"` - - // The SageMaker Savings Plans recommendation details. - SageMakerSavingsPlans *SageMakerSavingsPlans `locationName:"sageMakerSavingsPlans" 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 ResourceDetails) 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 ResourceDetails) GoString() string { - return s.String() -} - -// SetComputeSavingsPlans sets the ComputeSavingsPlans field's value. -func (s *ResourceDetails) SetComputeSavingsPlans(v *ComputeSavingsPlans) *ResourceDetails { - s.ComputeSavingsPlans = v - return s -} - -// SetEbsVolume sets the EbsVolume field's value. -func (s *ResourceDetails) SetEbsVolume(v *EbsVolume) *ResourceDetails { - s.EbsVolume = v - return s -} - -// SetEc2AutoScalingGroup sets the Ec2AutoScalingGroup field's value. -func (s *ResourceDetails) SetEc2AutoScalingGroup(v *Ec2AutoScalingGroup) *ResourceDetails { - s.Ec2AutoScalingGroup = v - return s -} - -// SetEc2Instance sets the Ec2Instance field's value. -func (s *ResourceDetails) SetEc2Instance(v *Ec2Instance) *ResourceDetails { - s.Ec2Instance = v - return s -} - -// SetEc2InstanceSavingsPlans sets the Ec2InstanceSavingsPlans field's value. -func (s *ResourceDetails) SetEc2InstanceSavingsPlans(v *Ec2InstanceSavingsPlans) *ResourceDetails { - s.Ec2InstanceSavingsPlans = v - return s -} - -// SetEc2ReservedInstances sets the Ec2ReservedInstances field's value. -func (s *ResourceDetails) SetEc2ReservedInstances(v *Ec2ReservedInstances) *ResourceDetails { - s.Ec2ReservedInstances = v - return s -} - -// SetEcsService sets the EcsService field's value. -func (s *ResourceDetails) SetEcsService(v *EcsService) *ResourceDetails { - s.EcsService = v - return s -} - -// SetElastiCacheReservedInstances sets the ElastiCacheReservedInstances field's value. -func (s *ResourceDetails) SetElastiCacheReservedInstances(v *ElastiCacheReservedInstances) *ResourceDetails { - s.ElastiCacheReservedInstances = v - return s -} - -// SetLambdaFunction sets the LambdaFunction field's value. -func (s *ResourceDetails) SetLambdaFunction(v *LambdaFunction) *ResourceDetails { - s.LambdaFunction = v - return s -} - -// SetOpenSearchReservedInstances sets the OpenSearchReservedInstances field's value. -func (s *ResourceDetails) SetOpenSearchReservedInstances(v *OpenSearchReservedInstances) *ResourceDetails { - s.OpenSearchReservedInstances = v - return s -} - -// SetRdsReservedInstances sets the RdsReservedInstances field's value. -func (s *ResourceDetails) SetRdsReservedInstances(v *RdsReservedInstances) *ResourceDetails { - s.RdsReservedInstances = v - return s -} - -// SetRedshiftReservedInstances sets the RedshiftReservedInstances field's value. -func (s *ResourceDetails) SetRedshiftReservedInstances(v *RedshiftReservedInstances) *ResourceDetails { - s.RedshiftReservedInstances = v - return s -} - -// SetSageMakerSavingsPlans sets the SageMakerSavingsPlans field's value. -func (s *ResourceDetails) SetSageMakerSavingsPlans(v *SageMakerSavingsPlans) *ResourceDetails { - s.SageMakerSavingsPlans = v - return s -} - -// The specified Amazon Resource Name (ARN) in the request doesn't exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The identifier of the resource that was not found. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains pricing information about the specified resource. -type ResourcePricing struct { - _ struct{} `type:"structure"` - - // The savings estimate incorporating all discounts with Amazon Web Services, - // such as Reserved Instances and Savings Plans. - EstimatedCostAfterDiscounts *float64 `locationName:"estimatedCostAfterDiscounts" type:"double"` - - // The savings estimate using Amazon Web Services public pricing without incorporating - // any discounts. - EstimatedCostBeforeDiscounts *float64 `locationName:"estimatedCostBeforeDiscounts" type:"double"` - - // The estimated discounts for a recommendation. - EstimatedDiscounts *EstimatedDiscounts `locationName:"estimatedDiscounts" type:"structure"` - - // The estimated net unused amortized commitment for the recommendation. - EstimatedNetUnusedAmortizedCommitments *float64 `locationName:"estimatedNetUnusedAmortizedCommitments" type:"double"` -} - -// 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 ResourcePricing) 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 ResourcePricing) GoString() string { - return s.String() -} - -// SetEstimatedCostAfterDiscounts sets the EstimatedCostAfterDiscounts field's value. -func (s *ResourcePricing) SetEstimatedCostAfterDiscounts(v float64) *ResourcePricing { - s.EstimatedCostAfterDiscounts = &v - return s -} - -// SetEstimatedCostBeforeDiscounts sets the EstimatedCostBeforeDiscounts field's value. -func (s *ResourcePricing) SetEstimatedCostBeforeDiscounts(v float64) *ResourcePricing { - s.EstimatedCostBeforeDiscounts = &v - return s -} - -// SetEstimatedDiscounts sets the EstimatedDiscounts field's value. -func (s *ResourcePricing) SetEstimatedDiscounts(v *EstimatedDiscounts) *ResourcePricing { - s.EstimatedDiscounts = v - return s -} - -// SetEstimatedNetUnusedAmortizedCommitments sets the EstimatedNetUnusedAmortizedCommitments field's value. -func (s *ResourcePricing) SetEstimatedNetUnusedAmortizedCommitments(v float64) *ResourcePricing { - s.EstimatedNetUnusedAmortizedCommitments = &v - return s -} - -// The SageMaker Savings Plans recommendation details. -type SageMakerSavingsPlans struct { - _ struct{} `type:"structure"` - - // The SageMaker Savings Plans configuration used for recommendations. - Configuration *SageMakerSavingsPlansConfiguration `locationName:"configuration" type:"structure"` - - // Cost impact of the Savings Plans purchase recommendation. - CostCalculation *SavingsPlansCostCalculation `locationName:"costCalculation" 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 SageMakerSavingsPlans) 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 SageMakerSavingsPlans) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *SageMakerSavingsPlans) SetConfiguration(v *SageMakerSavingsPlansConfiguration) *SageMakerSavingsPlans { - s.Configuration = v - return s -} - -// SetCostCalculation sets the CostCalculation field's value. -func (s *SageMakerSavingsPlans) SetCostCalculation(v *SavingsPlansCostCalculation) *SageMakerSavingsPlans { - s.CostCalculation = v - return s -} - -// The SageMaker Savings Plans configuration used for recommendations. -type SageMakerSavingsPlansConfiguration struct { - _ struct{} `type:"structure"` - - // The account scope that you want your recommendations for. - AccountScope *string `locationName:"accountScope" type:"string"` - - // The hourly commitment for the Savings Plans type. - HourlyCommitment *string `locationName:"hourlyCommitment" type:"string"` - - // The payment option for the commitment. - PaymentOption *string `locationName:"paymentOption" type:"string"` - - // The Savings Plans recommendation term in years. - Term *string `locationName:"term" 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 SageMakerSavingsPlansConfiguration) 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 SageMakerSavingsPlansConfiguration) GoString() string { - return s.String() -} - -// SetAccountScope sets the AccountScope field's value. -func (s *SageMakerSavingsPlansConfiguration) SetAccountScope(v string) *SageMakerSavingsPlansConfiguration { - s.AccountScope = &v - return s -} - -// SetHourlyCommitment sets the HourlyCommitment field's value. -func (s *SageMakerSavingsPlansConfiguration) SetHourlyCommitment(v string) *SageMakerSavingsPlansConfiguration { - s.HourlyCommitment = &v - return s -} - -// SetPaymentOption sets the PaymentOption field's value. -func (s *SageMakerSavingsPlansConfiguration) SetPaymentOption(v string) *SageMakerSavingsPlansConfiguration { - s.PaymentOption = &v - return s -} - -// SetTerm sets the Term field's value. -func (s *SageMakerSavingsPlansConfiguration) SetTerm(v string) *SageMakerSavingsPlansConfiguration { - s.Term = &v - return s -} - -// Cost impact of the purchase recommendation. -type SavingsPlansCostCalculation struct { - _ struct{} `type:"structure"` - - // Pricing details of the purchase recommendation. - Pricing *SavingsPlansPricing `locationName:"pricing" 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 SavingsPlansCostCalculation) 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 SavingsPlansCostCalculation) GoString() string { - return s.String() -} - -// SetPricing sets the Pricing field's value. -func (s *SavingsPlansCostCalculation) SetPricing(v *SavingsPlansPricing) *SavingsPlansCostCalculation { - s.Pricing = v - return s -} - -// Pricing information about a Savings Plan. -type SavingsPlansPricing struct { - _ struct{} `type:"structure"` - - // Estimated monthly commitment for the Savings Plan. - EstimatedMonthlyCommitment *float64 `locationName:"estimatedMonthlyCommitment" type:"double"` - - // Estimated On-Demand cost you will pay after buying the Savings Plan. - EstimatedOnDemandCost *float64 `locationName:"estimatedOnDemandCost" type:"double"` - - // The cost of paying for the recommended Savings Plan monthly. - MonthlySavingsPlansEligibleCost *float64 `locationName:"monthlySavingsPlansEligibleCost" type:"double"` - - // Estimated savings as a percentage of your overall costs after buying the - // Savings Plan. - SavingsPercentage *float64 `locationName:"savingsPercentage" type:"double"` -} - -// 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 SavingsPlansPricing) 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 SavingsPlansPricing) GoString() string { - return s.String() -} - -// SetEstimatedMonthlyCommitment sets the EstimatedMonthlyCommitment field's value. -func (s *SavingsPlansPricing) SetEstimatedMonthlyCommitment(v float64) *SavingsPlansPricing { - s.EstimatedMonthlyCommitment = &v - return s -} - -// SetEstimatedOnDemandCost sets the EstimatedOnDemandCost field's value. -func (s *SavingsPlansPricing) SetEstimatedOnDemandCost(v float64) *SavingsPlansPricing { - s.EstimatedOnDemandCost = &v - return s -} - -// SetMonthlySavingsPlansEligibleCost sets the MonthlySavingsPlansEligibleCost field's value. -func (s *SavingsPlansPricing) SetMonthlySavingsPlansEligibleCost(v float64) *SavingsPlansPricing { - s.MonthlySavingsPlansEligibleCost = &v - return s -} - -// SetSavingsPercentage sets the SavingsPercentage field's value. -func (s *SavingsPlansPricing) SetSavingsPercentage(v float64) *SavingsPlansPricing { - s.SavingsPercentage = &v - return s -} - -// The storage configuration used for recommendations. -type StorageConfiguration struct { - _ struct{} `type:"structure"` - - // The storage volume. - SizeInGb *float64 `locationName:"sizeInGb" type:"double"` - - // The storage type. - Type *string `locationName:"type" 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 StorageConfiguration) 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 StorageConfiguration) GoString() string { - return s.String() -} - -// SetSizeInGb sets the SizeInGb field's value. -func (s *StorageConfiguration) SetSizeInGb(v float64) *StorageConfiguration { - s.SizeInGb = &v - return s -} - -// SetType sets the Type field's value. -func (s *StorageConfiguration) SetType(v string) *StorageConfiguration { - s.Type = &v - return s -} - -// The tag structure that contains a tag key and value. -type Tag struct { - _ struct{} `type:"structure"` - - // The key that's associated with the tag. - Key *string `locationName:"key" type:"string"` - - // The value that's associated with the tag. - Value *string `locationName:"value" 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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UpdateEnrollmentStatusInput struct { - _ struct{} `type:"structure"` - - // Indicates whether to enroll member accounts of the organization if the account - // is the management account. - IncludeMemberAccounts *bool `locationName:"includeMemberAccounts" type:"boolean"` - - // Sets the account status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"EnrollmentStatus"` -} - -// 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 UpdateEnrollmentStatusInput) 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 UpdateEnrollmentStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEnrollmentStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEnrollmentStatusInput"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIncludeMemberAccounts sets the IncludeMemberAccounts field's value. -func (s *UpdateEnrollmentStatusInput) SetIncludeMemberAccounts(v bool) *UpdateEnrollmentStatusInput { - s.IncludeMemberAccounts = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateEnrollmentStatusInput) SetStatus(v string) *UpdateEnrollmentStatusInput { - s.Status = &v - return s -} - -type UpdateEnrollmentStatusOutput struct { - _ struct{} `type:"structure"` - - // The enrollment status of the account. - Status *string `locationName:"status" 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 UpdateEnrollmentStatusOutput) 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 UpdateEnrollmentStatusOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *UpdateEnrollmentStatusOutput) SetStatus(v string) *UpdateEnrollmentStatusOutput { - s.Status = &v - return s -} - -type UpdatePreferencesInput struct { - _ struct{} `type:"structure"` - - // Sets the "member account discount visibility" preference. - MemberAccountDiscountVisibility *string `locationName:"memberAccountDiscountVisibility" type:"string" enum:"MemberAccountDiscountVisibility"` - - // Sets the "savings estimation mode" preference. - SavingsEstimationMode *string `locationName:"savingsEstimationMode" type:"string" enum:"SavingsEstimationMode"` -} - -// 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 UpdatePreferencesInput) 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 UpdatePreferencesInput) GoString() string { - return s.String() -} - -// SetMemberAccountDiscountVisibility sets the MemberAccountDiscountVisibility field's value. -func (s *UpdatePreferencesInput) SetMemberAccountDiscountVisibility(v string) *UpdatePreferencesInput { - s.MemberAccountDiscountVisibility = &v - return s -} - -// SetSavingsEstimationMode sets the SavingsEstimationMode field's value. -func (s *UpdatePreferencesInput) SetSavingsEstimationMode(v string) *UpdatePreferencesInput { - s.SavingsEstimationMode = &v - return s -} - -type UpdatePreferencesOutput struct { - _ struct{} `type:"structure"` - - // Shows the status of the "member account discount visibility" preference. - MemberAccountDiscountVisibility *string `locationName:"memberAccountDiscountVisibility" type:"string" enum:"MemberAccountDiscountVisibility"` - - // Shows the status of the "savings estimation mode" preference. - SavingsEstimationMode *string `locationName:"savingsEstimationMode" type:"string" enum:"SavingsEstimationMode"` -} - -// 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 UpdatePreferencesOutput) 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 UpdatePreferencesOutput) GoString() string { - return s.String() -} - -// SetMemberAccountDiscountVisibility sets the MemberAccountDiscountVisibility field's value. -func (s *UpdatePreferencesOutput) SetMemberAccountDiscountVisibility(v string) *UpdatePreferencesOutput { - s.MemberAccountDiscountVisibility = &v - return s -} - -// SetSavingsEstimationMode sets the SavingsEstimationMode field's value. -func (s *UpdatePreferencesOutput) SetSavingsEstimationMode(v string) *UpdatePreferencesOutput { - s.SavingsEstimationMode = &v - return s -} - -// Details about the usage. -type Usage struct { - _ struct{} `type:"structure"` - - // The operation value. - Operation *string `locationName:"operation" type:"string"` - - // The product code. - ProductCode *string `locationName:"productCode" type:"string"` - - // The usage unit. - Unit *string `locationName:"unit" type:"string"` - - // The usage amount. - UsageAmount *float64 `locationName:"usageAmount" type:"double"` - - // The usage type. - UsageType *string `locationName:"usageType" 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 Usage) 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 Usage) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *Usage) SetOperation(v string) *Usage { - s.Operation = &v - return s -} - -// SetProductCode sets the ProductCode field's value. -func (s *Usage) SetProductCode(v string) *Usage { - s.ProductCode = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *Usage) SetUnit(v string) *Usage { - s.Unit = &v - return s -} - -// SetUsageAmount sets the UsageAmount field's value. -func (s *Usage) SetUsageAmount(v float64) *Usage { - s.UsageAmount = &v - return s -} - -// SetUsageType sets the UsageType field's value. -func (s *Usage) SetUsageType(v string) *Usage { - s.UsageType = &v - return s -} - -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The list of fields that are invalid. - Fields []*ValidationExceptionDetail `locationName:"fields" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason for the validation exception. - Reason *string `locationName:"reason" type:"string" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input failed to meet the constraints specified by the Amazon Web Services -// service in a specified field. -type ValidationExceptionDetail struct { - _ struct{} `type:"structure"` - - // The field name where the invalid entry was detected. - // - // FieldName is a required field - FieldName *string `locationName:"fieldName" type:"string" required:"true"` - - // A message with the reason for the validation exception error. - // - // Message is a required field - Message *string `locationName:"message" 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 ValidationExceptionDetail) 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 ValidationExceptionDetail) GoString() string { - return s.String() -} - -// SetFieldName sets the FieldName field's value. -func (s *ValidationExceptionDetail) SetFieldName(v string) *ValidationExceptionDetail { - s.FieldName = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionDetail) SetMessage(v string) *ValidationExceptionDetail { - s.Message = &v - return s -} - -const ( - // ActionTypeRightsize is a ActionType enum value - ActionTypeRightsize = "Rightsize" - - // ActionTypeStop is a ActionType enum value - ActionTypeStop = "Stop" - - // ActionTypeUpgrade is a ActionType enum value - ActionTypeUpgrade = "Upgrade" - - // ActionTypePurchaseSavingsPlans is a ActionType enum value - ActionTypePurchaseSavingsPlans = "PurchaseSavingsPlans" - - // ActionTypePurchaseReservedInstances is a ActionType enum value - ActionTypePurchaseReservedInstances = "PurchaseReservedInstances" - - // ActionTypeMigrateToGraviton is a ActionType enum value - ActionTypeMigrateToGraviton = "MigrateToGraviton" -) - -// ActionType_Values returns all elements of the ActionType enum -func ActionType_Values() []string { - return []string{ - ActionTypeRightsize, - ActionTypeStop, - ActionTypeUpgrade, - ActionTypePurchaseSavingsPlans, - ActionTypePurchaseReservedInstances, - ActionTypeMigrateToGraviton, - } -} - -const ( - // EnrollmentStatusActive is a EnrollmentStatus enum value - EnrollmentStatusActive = "Active" - - // EnrollmentStatusInactive is a EnrollmentStatus enum value - EnrollmentStatusInactive = "Inactive" -) - -// EnrollmentStatus_Values returns all elements of the EnrollmentStatus enum -func EnrollmentStatus_Values() []string { - return []string{ - EnrollmentStatusActive, - EnrollmentStatusInactive, - } -} - -const ( - // ImplementationEffortVeryLow is a ImplementationEffort enum value - ImplementationEffortVeryLow = "VeryLow" - - // ImplementationEffortLow is a ImplementationEffort enum value - ImplementationEffortLow = "Low" - - // ImplementationEffortMedium is a ImplementationEffort enum value - ImplementationEffortMedium = "Medium" - - // ImplementationEffortHigh is a ImplementationEffort enum value - ImplementationEffortHigh = "High" - - // ImplementationEffortVeryHigh is a ImplementationEffort enum value - ImplementationEffortVeryHigh = "VeryHigh" -) - -// ImplementationEffort_Values returns all elements of the ImplementationEffort enum -func ImplementationEffort_Values() []string { - return []string{ - ImplementationEffortVeryLow, - ImplementationEffortLow, - ImplementationEffortMedium, - ImplementationEffortHigh, - ImplementationEffortVeryHigh, - } -} - -const ( - // MemberAccountDiscountVisibilityAll is a MemberAccountDiscountVisibility enum value - MemberAccountDiscountVisibilityAll = "All" - - // MemberAccountDiscountVisibilityNone is a MemberAccountDiscountVisibility enum value - MemberAccountDiscountVisibilityNone = "None" -) - -// MemberAccountDiscountVisibility_Values returns all elements of the MemberAccountDiscountVisibility enum -func MemberAccountDiscountVisibility_Values() []string { - return []string{ - MemberAccountDiscountVisibilityAll, - MemberAccountDiscountVisibilityNone, - } -} - -const ( - // OrderAsc is a Order enum value - OrderAsc = "Asc" - - // OrderDesc is a Order enum value - OrderDesc = "Desc" -) - -// Order_Values returns all elements of the Order enum -func Order_Values() []string { - return []string{ - OrderAsc, - OrderDesc, - } -} - -const ( - // ResourceTypeEc2instance is a ResourceType enum value - ResourceTypeEc2instance = "Ec2Instance" - - // ResourceTypeLambdaFunction is a ResourceType enum value - ResourceTypeLambdaFunction = "LambdaFunction" - - // ResourceTypeEbsVolume is a ResourceType enum value - ResourceTypeEbsVolume = "EbsVolume" - - // ResourceTypeEcsService is a ResourceType enum value - ResourceTypeEcsService = "EcsService" - - // ResourceTypeEc2autoScalingGroup is a ResourceType enum value - ResourceTypeEc2autoScalingGroup = "Ec2AutoScalingGroup" - - // ResourceTypeEc2instanceSavingsPlans is a ResourceType enum value - ResourceTypeEc2instanceSavingsPlans = "Ec2InstanceSavingsPlans" - - // ResourceTypeComputeSavingsPlans is a ResourceType enum value - ResourceTypeComputeSavingsPlans = "ComputeSavingsPlans" - - // ResourceTypeSageMakerSavingsPlans is a ResourceType enum value - ResourceTypeSageMakerSavingsPlans = "SageMakerSavingsPlans" - - // ResourceTypeEc2reservedInstances is a ResourceType enum value - ResourceTypeEc2reservedInstances = "Ec2ReservedInstances" - - // ResourceTypeRdsReservedInstances is a ResourceType enum value - ResourceTypeRdsReservedInstances = "RdsReservedInstances" - - // ResourceTypeOpenSearchReservedInstances is a ResourceType enum value - ResourceTypeOpenSearchReservedInstances = "OpenSearchReservedInstances" - - // ResourceTypeRedshiftReservedInstances is a ResourceType enum value - ResourceTypeRedshiftReservedInstances = "RedshiftReservedInstances" - - // ResourceTypeElastiCacheReservedInstances is a ResourceType enum value - ResourceTypeElastiCacheReservedInstances = "ElastiCacheReservedInstances" -) - -// ResourceType_Values returns all elements of the ResourceType enum -func ResourceType_Values() []string { - return []string{ - ResourceTypeEc2instance, - ResourceTypeLambdaFunction, - ResourceTypeEbsVolume, - ResourceTypeEcsService, - ResourceTypeEc2autoScalingGroup, - ResourceTypeEc2instanceSavingsPlans, - ResourceTypeComputeSavingsPlans, - ResourceTypeSageMakerSavingsPlans, - ResourceTypeEc2reservedInstances, - ResourceTypeRdsReservedInstances, - ResourceTypeOpenSearchReservedInstances, - ResourceTypeRedshiftReservedInstances, - ResourceTypeElastiCacheReservedInstances, - } -} - -const ( - // SavingsEstimationModeBeforeDiscounts is a SavingsEstimationMode enum value - SavingsEstimationModeBeforeDiscounts = "BeforeDiscounts" - - // SavingsEstimationModeAfterDiscounts is a SavingsEstimationMode enum value - SavingsEstimationModeAfterDiscounts = "AfterDiscounts" -) - -// SavingsEstimationMode_Values returns all elements of the SavingsEstimationMode enum -func SavingsEstimationMode_Values() []string { - return []string{ - SavingsEstimationModeBeforeDiscounts, - SavingsEstimationModeAfterDiscounts, - } -} - -const ( - // SourceComputeOptimizer is a Source enum value - SourceComputeOptimizer = "ComputeOptimizer" - - // SourceCostExplorer is a Source enum value - SourceCostExplorer = "CostExplorer" -) - -// Source_Values returns all elements of the Source enum -func Source_Values() []string { - return []string{ - SourceComputeOptimizer, - SourceCostExplorer, - } -} - -const ( - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "FieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "Other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/costoptimizationhubiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/costoptimizationhubiface/interface.go deleted file mode 100644 index e5bea04d381b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/costoptimizationhubiface/interface.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package costoptimizationhubiface provides an interface to enable mocking the Cost Optimization Hub service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package costoptimizationhubiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub" -) - -// CostOptimizationHubAPI provides an interface to enable mocking the -// costoptimizationhub.CostOptimizationHub service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Cost Optimization Hub. -// func myFunc(svc costoptimizationhubiface.CostOptimizationHubAPI) bool { -// // Make svc.GetPreferences request -// } -// -// func main() { -// sess := session.New() -// svc := costoptimizationhub.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockCostOptimizationHubClient struct { -// costoptimizationhubiface.CostOptimizationHubAPI -// } -// func (m *mockCostOptimizationHubClient) GetPreferences(input *costoptimizationhub.GetPreferencesInput) (*costoptimizationhub.GetPreferencesOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockCostOptimizationHubClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type CostOptimizationHubAPI interface { - GetPreferences(*costoptimizationhub.GetPreferencesInput) (*costoptimizationhub.GetPreferencesOutput, error) - GetPreferencesWithContext(aws.Context, *costoptimizationhub.GetPreferencesInput, ...request.Option) (*costoptimizationhub.GetPreferencesOutput, error) - GetPreferencesRequest(*costoptimizationhub.GetPreferencesInput) (*request.Request, *costoptimizationhub.GetPreferencesOutput) - - GetRecommendation(*costoptimizationhub.GetRecommendationInput) (*costoptimizationhub.GetRecommendationOutput, error) - GetRecommendationWithContext(aws.Context, *costoptimizationhub.GetRecommendationInput, ...request.Option) (*costoptimizationhub.GetRecommendationOutput, error) - GetRecommendationRequest(*costoptimizationhub.GetRecommendationInput) (*request.Request, *costoptimizationhub.GetRecommendationOutput) - - ListEnrollmentStatuses(*costoptimizationhub.ListEnrollmentStatusesInput) (*costoptimizationhub.ListEnrollmentStatusesOutput, error) - ListEnrollmentStatusesWithContext(aws.Context, *costoptimizationhub.ListEnrollmentStatusesInput, ...request.Option) (*costoptimizationhub.ListEnrollmentStatusesOutput, error) - ListEnrollmentStatusesRequest(*costoptimizationhub.ListEnrollmentStatusesInput) (*request.Request, *costoptimizationhub.ListEnrollmentStatusesOutput) - - ListEnrollmentStatusesPages(*costoptimizationhub.ListEnrollmentStatusesInput, func(*costoptimizationhub.ListEnrollmentStatusesOutput, bool) bool) error - ListEnrollmentStatusesPagesWithContext(aws.Context, *costoptimizationhub.ListEnrollmentStatusesInput, func(*costoptimizationhub.ListEnrollmentStatusesOutput, bool) bool, ...request.Option) error - - ListRecommendationSummaries(*costoptimizationhub.ListRecommendationSummariesInput) (*costoptimizationhub.ListRecommendationSummariesOutput, error) - ListRecommendationSummariesWithContext(aws.Context, *costoptimizationhub.ListRecommendationSummariesInput, ...request.Option) (*costoptimizationhub.ListRecommendationSummariesOutput, error) - ListRecommendationSummariesRequest(*costoptimizationhub.ListRecommendationSummariesInput) (*request.Request, *costoptimizationhub.ListRecommendationSummariesOutput) - - ListRecommendationSummariesPages(*costoptimizationhub.ListRecommendationSummariesInput, func(*costoptimizationhub.ListRecommendationSummariesOutput, bool) bool) error - ListRecommendationSummariesPagesWithContext(aws.Context, *costoptimizationhub.ListRecommendationSummariesInput, func(*costoptimizationhub.ListRecommendationSummariesOutput, bool) bool, ...request.Option) error - - ListRecommendations(*costoptimizationhub.ListRecommendationsInput) (*costoptimizationhub.ListRecommendationsOutput, error) - ListRecommendationsWithContext(aws.Context, *costoptimizationhub.ListRecommendationsInput, ...request.Option) (*costoptimizationhub.ListRecommendationsOutput, error) - ListRecommendationsRequest(*costoptimizationhub.ListRecommendationsInput) (*request.Request, *costoptimizationhub.ListRecommendationsOutput) - - ListRecommendationsPages(*costoptimizationhub.ListRecommendationsInput, func(*costoptimizationhub.ListRecommendationsOutput, bool) bool) error - ListRecommendationsPagesWithContext(aws.Context, *costoptimizationhub.ListRecommendationsInput, func(*costoptimizationhub.ListRecommendationsOutput, bool) bool, ...request.Option) error - - UpdateEnrollmentStatus(*costoptimizationhub.UpdateEnrollmentStatusInput) (*costoptimizationhub.UpdateEnrollmentStatusOutput, error) - UpdateEnrollmentStatusWithContext(aws.Context, *costoptimizationhub.UpdateEnrollmentStatusInput, ...request.Option) (*costoptimizationhub.UpdateEnrollmentStatusOutput, error) - UpdateEnrollmentStatusRequest(*costoptimizationhub.UpdateEnrollmentStatusInput) (*request.Request, *costoptimizationhub.UpdateEnrollmentStatusOutput) - - UpdatePreferences(*costoptimizationhub.UpdatePreferencesInput) (*costoptimizationhub.UpdatePreferencesOutput, error) - UpdatePreferencesWithContext(aws.Context, *costoptimizationhub.UpdatePreferencesInput, ...request.Option) (*costoptimizationhub.UpdatePreferencesOutput, error) - UpdatePreferencesRequest(*costoptimizationhub.UpdatePreferencesInput) (*request.Request, *costoptimizationhub.UpdatePreferencesOutput) -} - -var _ CostOptimizationHubAPI = (*costoptimizationhub.CostOptimizationHub)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/doc.go deleted file mode 100644 index 4e4e2c5dd290..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/doc.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package costoptimizationhub provides the client and types for making API -// requests to Cost Optimization Hub. -// -// You can use the Cost Optimization Hub API to programmatically identify, filter, -// aggregate, and quantify savings for your cost optimization recommendations -// across multiple Amazon Web Services Regions and Amazon Web Services accounts -// in your organization. -// -// The Cost Optimization Hub API provides the following endpoint: -// -// - https://cost-optimization-hub.us-east-1.amazonaws.com -// -// See https://docs.aws.amazon.com/goto/WebAPI/cost-optimization-hub-2022-07-26 for more information on this service. -// -// See costoptimizationhub package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/costoptimizationhub/ -// -// # Using the Client -// -// To contact Cost Optimization Hub with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Cost Optimization Hub client CostOptimizationHub for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/costoptimizationhub/#New -package costoptimizationhub diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/errors.go deleted file mode 100644 index 987406414cbd..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/errors.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package costoptimizationhub - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You are not authorized to use this operation with the given parameters. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An error on the server occurred during the processing of your request. Try - // again later. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified Amazon Resource Name (ARN) in the request doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an Amazon Web Services - // service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/service.go deleted file mode 100644 index f9869430fb93..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/costoptimizationhub/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package costoptimizationhub - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// CostOptimizationHub provides the API operation methods for making requests to -// Cost Optimization Hub. See this package's package overview docs -// for details on the service. -// -// CostOptimizationHub methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type CostOptimizationHub struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Cost Optimization Hub" // Name of service. - EndpointsID = "cost-optimization-hub" // ID to lookup a service endpoint with. - ServiceID = "Cost Optimization Hub" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the CostOptimizationHub client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a CostOptimizationHub client from just a session. -// svc := costoptimizationhub.New(mySession) -// -// // Create a CostOptimizationHub client with additional configuration -// svc := costoptimizationhub.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CostOptimizationHub { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "cost-optimization-hub" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *CostOptimizationHub { - svc := &CostOptimizationHub{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-07-26", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.0", - TargetPrefix: "CostOptimizationHubService", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a CostOptimizationHub operation and runs any -// custom request initialization. -func (c *CostOptimizationHub) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/api.go deleted file mode 100644 index 8ffe8ea44a03..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/api.go +++ /dev/null @@ -1,39307 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package datazone - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opAcceptPredictions = "AcceptPredictions" - -// AcceptPredictionsRequest generates a "aws/request.Request" representing the -// client's request for the AcceptPredictions 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 AcceptPredictions for more information on using the AcceptPredictions -// 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 AcceptPredictionsRequest method. -// req, resp := client.AcceptPredictionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/AcceptPredictions -func (c *DataZone) AcceptPredictionsRequest(input *AcceptPredictionsInput) (req *request.Request, output *AcceptPredictionsOutput) { - op := &request.Operation{ - Name: opAcceptPredictions, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/assets/{identifier}/accept-predictions", - } - - if input == nil { - input = &AcceptPredictionsInput{} - } - - output = &AcceptPredictionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcceptPredictions API operation for Amazon DataZone. -// -// Accepts automatically generated business-friendly metadata for your Amazon -// DataZone assets. -// -// 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 DataZone's -// API operation AcceptPredictions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/AcceptPredictions -func (c *DataZone) AcceptPredictions(input *AcceptPredictionsInput) (*AcceptPredictionsOutput, error) { - req, out := c.AcceptPredictionsRequest(input) - return out, req.Send() -} - -// AcceptPredictionsWithContext is the same as AcceptPredictions with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptPredictions 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 *DataZone) AcceptPredictionsWithContext(ctx aws.Context, input *AcceptPredictionsInput, opts ...request.Option) (*AcceptPredictionsOutput, error) { - req, out := c.AcceptPredictionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAcceptSubscriptionRequest = "AcceptSubscriptionRequest" - -// AcceptSubscriptionRequestRequest generates a "aws/request.Request" representing the -// client's request for the AcceptSubscriptionRequest 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 AcceptSubscriptionRequest for more information on using the AcceptSubscriptionRequest -// 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 AcceptSubscriptionRequestRequest method. -// req, resp := client.AcceptSubscriptionRequestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/AcceptSubscriptionRequest -func (c *DataZone) AcceptSubscriptionRequestRequest(input *AcceptSubscriptionRequestInput) (req *request.Request, output *AcceptSubscriptionRequestOutput) { - op := &request.Operation{ - Name: opAcceptSubscriptionRequest, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-requests/{identifier}/accept", - } - - if input == nil { - input = &AcceptSubscriptionRequestInput{} - } - - output = &AcceptSubscriptionRequestOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcceptSubscriptionRequest API operation for Amazon DataZone. -// -// Accepts a subscription request to a specific asset. -// -// 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 DataZone's -// API operation AcceptSubscriptionRequest for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/AcceptSubscriptionRequest -func (c *DataZone) AcceptSubscriptionRequest(input *AcceptSubscriptionRequestInput) (*AcceptSubscriptionRequestOutput, error) { - req, out := c.AcceptSubscriptionRequestRequest(input) - return out, req.Send() -} - -// AcceptSubscriptionRequestWithContext is the same as AcceptSubscriptionRequest with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptSubscriptionRequest 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 *DataZone) AcceptSubscriptionRequestWithContext(ctx aws.Context, input *AcceptSubscriptionRequestInput, opts ...request.Option) (*AcceptSubscriptionRequestOutput, error) { - req, out := c.AcceptSubscriptionRequestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelSubscription = "CancelSubscription" - -// CancelSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the CancelSubscription 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 CancelSubscription for more information on using the CancelSubscription -// 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 CancelSubscriptionRequest method. -// req, resp := client.CancelSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CancelSubscription -func (c *DataZone) CancelSubscriptionRequest(input *CancelSubscriptionInput) (req *request.Request, output *CancelSubscriptionOutput) { - op := &request.Operation{ - Name: opCancelSubscription, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/subscriptions/{identifier}/cancel", - } - - if input == nil { - input = &CancelSubscriptionInput{} - } - - output = &CancelSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelSubscription API operation for Amazon DataZone. -// -// Cancels the subscription to the specified asset. -// -// 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 DataZone's -// API operation CancelSubscription for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CancelSubscription -func (c *DataZone) CancelSubscription(input *CancelSubscriptionInput) (*CancelSubscriptionOutput, error) { - req, out := c.CancelSubscriptionRequest(input) - return out, req.Send() -} - -// CancelSubscriptionWithContext is the same as CancelSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See CancelSubscription 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 *DataZone) CancelSubscriptionWithContext(ctx aws.Context, input *CancelSubscriptionInput, opts ...request.Option) (*CancelSubscriptionOutput, error) { - req, out := c.CancelSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAsset = "CreateAsset" - -// CreateAssetRequest generates a "aws/request.Request" representing the -// client's request for the CreateAsset 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 CreateAsset for more information on using the CreateAsset -// 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 CreateAssetRequest method. -// req, resp := client.CreateAssetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateAsset -func (c *DataZone) CreateAssetRequest(input *CreateAssetInput) (req *request.Request, output *CreateAssetOutput) { - op := &request.Operation{ - Name: opCreateAsset, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/assets", - } - - if input == nil { - input = &CreateAssetInput{} - } - - output = &CreateAssetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAsset API operation for Amazon DataZone. -// -// Creates an asset in Amazon DataZone catalog. -// -// 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 DataZone's -// API operation CreateAsset for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateAsset -func (c *DataZone) CreateAsset(input *CreateAssetInput) (*CreateAssetOutput, error) { - req, out := c.CreateAssetRequest(input) - return out, req.Send() -} - -// CreateAssetWithContext is the same as CreateAsset with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAsset 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 *DataZone) CreateAssetWithContext(ctx aws.Context, input *CreateAssetInput, opts ...request.Option) (*CreateAssetOutput, error) { - req, out := c.CreateAssetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAssetRevision = "CreateAssetRevision" - -// CreateAssetRevisionRequest generates a "aws/request.Request" representing the -// client's request for the CreateAssetRevision 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 CreateAssetRevision for more information on using the CreateAssetRevision -// 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 CreateAssetRevisionRequest method. -// req, resp := client.CreateAssetRevisionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateAssetRevision -func (c *DataZone) CreateAssetRevisionRequest(input *CreateAssetRevisionInput) (req *request.Request, output *CreateAssetRevisionOutput) { - op := &request.Operation{ - Name: opCreateAssetRevision, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/assets/{identifier}/revisions", - } - - if input == nil { - input = &CreateAssetRevisionInput{} - } - - output = &CreateAssetRevisionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAssetRevision API operation for Amazon DataZone. -// -// Creates a revision of the asset. -// -// 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 DataZone's -// API operation CreateAssetRevision for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateAssetRevision -func (c *DataZone) CreateAssetRevision(input *CreateAssetRevisionInput) (*CreateAssetRevisionOutput, error) { - req, out := c.CreateAssetRevisionRequest(input) - return out, req.Send() -} - -// CreateAssetRevisionWithContext is the same as CreateAssetRevision with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAssetRevision 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 *DataZone) CreateAssetRevisionWithContext(ctx aws.Context, input *CreateAssetRevisionInput, opts ...request.Option) (*CreateAssetRevisionOutput, error) { - req, out := c.CreateAssetRevisionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAssetType = "CreateAssetType" - -// CreateAssetTypeRequest generates a "aws/request.Request" representing the -// client's request for the CreateAssetType 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 CreateAssetType for more information on using the CreateAssetType -// 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 CreateAssetTypeRequest method. -// req, resp := client.CreateAssetTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateAssetType -func (c *DataZone) CreateAssetTypeRequest(input *CreateAssetTypeInput) (req *request.Request, output *CreateAssetTypeOutput) { - op := &request.Operation{ - Name: opCreateAssetType, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/asset-types", - } - - if input == nil { - input = &CreateAssetTypeInput{} - } - - output = &CreateAssetTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAssetType API operation for Amazon DataZone. -// -// Creates a custom asset type. -// -// 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 DataZone's -// API operation CreateAssetType for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateAssetType -func (c *DataZone) CreateAssetType(input *CreateAssetTypeInput) (*CreateAssetTypeOutput, error) { - req, out := c.CreateAssetTypeRequest(input) - return out, req.Send() -} - -// CreateAssetTypeWithContext is the same as CreateAssetType with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAssetType 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 *DataZone) CreateAssetTypeWithContext(ctx aws.Context, input *CreateAssetTypeInput, opts ...request.Option) (*CreateAssetTypeOutput, error) { - req, out := c.CreateAssetTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDataSource = "CreateDataSource" - -// CreateDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the CreateDataSource 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 CreateDataSource for more information on using the CreateDataSource -// 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 CreateDataSourceRequest method. -// req, resp := client.CreateDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateDataSource -func (c *DataZone) CreateDataSourceRequest(input *CreateDataSourceInput) (req *request.Request, output *CreateDataSourceOutput) { - op := &request.Operation{ - Name: opCreateDataSource, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/data-sources", - } - - if input == nil { - input = &CreateDataSourceInput{} - } - - output = &CreateDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDataSource API operation for Amazon DataZone. -// -// Creates an Amazon DataZone data source. -// -// 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 DataZone's -// API operation CreateDataSource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateDataSource -func (c *DataZone) CreateDataSource(input *CreateDataSourceInput) (*CreateDataSourceOutput, error) { - req, out := c.CreateDataSourceRequest(input) - return out, req.Send() -} - -// CreateDataSourceWithContext is the same as CreateDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDataSource 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 *DataZone) CreateDataSourceWithContext(ctx aws.Context, input *CreateDataSourceInput, opts ...request.Option) (*CreateDataSourceOutput, error) { - req, out := c.CreateDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDomain = "CreateDomain" - -// CreateDomainRequest generates a "aws/request.Request" representing the -// client's request for the CreateDomain 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 CreateDomain for more information on using the CreateDomain -// 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 CreateDomainRequest method. -// req, resp := client.CreateDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateDomain -func (c *DataZone) CreateDomainRequest(input *CreateDomainInput) (req *request.Request, output *CreateDomainOutput) { - op := &request.Operation{ - Name: opCreateDomain, - HTTPMethod: "POST", - HTTPPath: "/v2/domains", - } - - if input == nil { - input = &CreateDomainInput{} - } - - output = &CreateDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDomain API operation for Amazon DataZone. -// -// Creates an Amazon DataZone domain. -// -// 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 DataZone's -// API operation CreateDomain for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateDomain -func (c *DataZone) CreateDomain(input *CreateDomainInput) (*CreateDomainOutput, error) { - req, out := c.CreateDomainRequest(input) - return out, req.Send() -} - -// CreateDomainWithContext is the same as CreateDomain with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDomain 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 *DataZone) CreateDomainWithContext(ctx aws.Context, input *CreateDomainInput, opts ...request.Option) (*CreateDomainOutput, error) { - req, out := c.CreateDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateEnvironment = "CreateEnvironment" - -// CreateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the CreateEnvironment 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 CreateEnvironment for more information on using the CreateEnvironment -// 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 CreateEnvironmentRequest method. -// req, resp := client.CreateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateEnvironment -func (c *DataZone) CreateEnvironmentRequest(input *CreateEnvironmentInput) (req *request.Request, output *CreateEnvironmentOutput) { - op := &request.Operation{ - Name: opCreateEnvironment, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/environments", - } - - if input == nil { - input = &CreateEnvironmentInput{} - } - - output = &CreateEnvironmentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEnvironment API operation for Amazon DataZone. -// -// Create an Amazon DataZone environment. -// -// 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 DataZone's -// API operation CreateEnvironment for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateEnvironment -func (c *DataZone) CreateEnvironment(input *CreateEnvironmentInput) (*CreateEnvironmentOutput, error) { - req, out := c.CreateEnvironmentRequest(input) - return out, req.Send() -} - -// CreateEnvironmentWithContext is the same as CreateEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEnvironment 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 *DataZone) CreateEnvironmentWithContext(ctx aws.Context, input *CreateEnvironmentInput, opts ...request.Option) (*CreateEnvironmentOutput, error) { - req, out := c.CreateEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateEnvironmentProfile = "CreateEnvironmentProfile" - -// CreateEnvironmentProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateEnvironmentProfile 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 CreateEnvironmentProfile for more information on using the CreateEnvironmentProfile -// 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 CreateEnvironmentProfileRequest method. -// req, resp := client.CreateEnvironmentProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateEnvironmentProfile -func (c *DataZone) CreateEnvironmentProfileRequest(input *CreateEnvironmentProfileInput) (req *request.Request, output *CreateEnvironmentProfileOutput) { - op := &request.Operation{ - Name: opCreateEnvironmentProfile, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-profiles", - } - - if input == nil { - input = &CreateEnvironmentProfileInput{} - } - - output = &CreateEnvironmentProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEnvironmentProfile API operation for Amazon DataZone. -// -// Creates an Amazon DataZone environment profile. -// -// 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 DataZone's -// API operation CreateEnvironmentProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateEnvironmentProfile -func (c *DataZone) CreateEnvironmentProfile(input *CreateEnvironmentProfileInput) (*CreateEnvironmentProfileOutput, error) { - req, out := c.CreateEnvironmentProfileRequest(input) - return out, req.Send() -} - -// CreateEnvironmentProfileWithContext is the same as CreateEnvironmentProfile with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEnvironmentProfile 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 *DataZone) CreateEnvironmentProfileWithContext(ctx aws.Context, input *CreateEnvironmentProfileInput, opts ...request.Option) (*CreateEnvironmentProfileOutput, error) { - req, out := c.CreateEnvironmentProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateFormType = "CreateFormType" - -// CreateFormTypeRequest generates a "aws/request.Request" representing the -// client's request for the CreateFormType 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 CreateFormType for more information on using the CreateFormType -// 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 CreateFormTypeRequest method. -// req, resp := client.CreateFormTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateFormType -func (c *DataZone) CreateFormTypeRequest(input *CreateFormTypeInput) (req *request.Request, output *CreateFormTypeOutput) { - op := &request.Operation{ - Name: opCreateFormType, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/form-types", - } - - if input == nil { - input = &CreateFormTypeInput{} - } - - output = &CreateFormTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateFormType API operation for Amazon DataZone. -// -// Creates a metadata form type. -// -// 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 DataZone's -// API operation CreateFormType for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateFormType -func (c *DataZone) CreateFormType(input *CreateFormTypeInput) (*CreateFormTypeOutput, error) { - req, out := c.CreateFormTypeRequest(input) - return out, req.Send() -} - -// CreateFormTypeWithContext is the same as CreateFormType with the addition of -// the ability to pass a context and additional request options. -// -// See CreateFormType 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 *DataZone) CreateFormTypeWithContext(ctx aws.Context, input *CreateFormTypeInput, opts ...request.Option) (*CreateFormTypeOutput, error) { - req, out := c.CreateFormTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateGlossary = "CreateGlossary" - -// CreateGlossaryRequest generates a "aws/request.Request" representing the -// client's request for the CreateGlossary 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 CreateGlossary for more information on using the CreateGlossary -// 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 CreateGlossaryRequest method. -// req, resp := client.CreateGlossaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateGlossary -func (c *DataZone) CreateGlossaryRequest(input *CreateGlossaryInput) (req *request.Request, output *CreateGlossaryOutput) { - op := &request.Operation{ - Name: opCreateGlossary, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/glossaries", - } - - if input == nil { - input = &CreateGlossaryInput{} - } - - output = &CreateGlossaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateGlossary API operation for Amazon DataZone. -// -// Creates an Amazon DataZone business glossary. -// -// 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 DataZone's -// API operation CreateGlossary for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateGlossary -func (c *DataZone) CreateGlossary(input *CreateGlossaryInput) (*CreateGlossaryOutput, error) { - req, out := c.CreateGlossaryRequest(input) - return out, req.Send() -} - -// CreateGlossaryWithContext is the same as CreateGlossary with the addition of -// the ability to pass a context and additional request options. -// -// See CreateGlossary 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 *DataZone) CreateGlossaryWithContext(ctx aws.Context, input *CreateGlossaryInput, opts ...request.Option) (*CreateGlossaryOutput, error) { - req, out := c.CreateGlossaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateGlossaryTerm = "CreateGlossaryTerm" - -// CreateGlossaryTermRequest generates a "aws/request.Request" representing the -// client's request for the CreateGlossaryTerm 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 CreateGlossaryTerm for more information on using the CreateGlossaryTerm -// 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 CreateGlossaryTermRequest method. -// req, resp := client.CreateGlossaryTermRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateGlossaryTerm -func (c *DataZone) CreateGlossaryTermRequest(input *CreateGlossaryTermInput) (req *request.Request, output *CreateGlossaryTermOutput) { - op := &request.Operation{ - Name: opCreateGlossaryTerm, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/glossary-terms", - } - - if input == nil { - input = &CreateGlossaryTermInput{} - } - - output = &CreateGlossaryTermOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateGlossaryTerm API operation for Amazon DataZone. -// -// Creates a business glossary term. -// -// 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 DataZone's -// API operation CreateGlossaryTerm for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateGlossaryTerm -func (c *DataZone) CreateGlossaryTerm(input *CreateGlossaryTermInput) (*CreateGlossaryTermOutput, error) { - req, out := c.CreateGlossaryTermRequest(input) - return out, req.Send() -} - -// CreateGlossaryTermWithContext is the same as CreateGlossaryTerm with the addition of -// the ability to pass a context and additional request options. -// -// See CreateGlossaryTerm 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 *DataZone) CreateGlossaryTermWithContext(ctx aws.Context, input *CreateGlossaryTermInput, opts ...request.Option) (*CreateGlossaryTermOutput, error) { - req, out := c.CreateGlossaryTermRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateGroupProfile = "CreateGroupProfile" - -// CreateGroupProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateGroupProfile 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 CreateGroupProfile for more information on using the CreateGroupProfile -// 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 CreateGroupProfileRequest method. -// req, resp := client.CreateGroupProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateGroupProfile -func (c *DataZone) CreateGroupProfileRequest(input *CreateGroupProfileInput) (req *request.Request, output *CreateGroupProfileOutput) { - op := &request.Operation{ - Name: opCreateGroupProfile, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/group-profiles", - } - - if input == nil { - input = &CreateGroupProfileInput{} - } - - output = &CreateGroupProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateGroupProfile API operation for Amazon DataZone. -// -// Creates a group profile in Amazon DataZone. -// -// 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 DataZone's -// API operation CreateGroupProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateGroupProfile -func (c *DataZone) CreateGroupProfile(input *CreateGroupProfileInput) (*CreateGroupProfileOutput, error) { - req, out := c.CreateGroupProfileRequest(input) - return out, req.Send() -} - -// CreateGroupProfileWithContext is the same as CreateGroupProfile with the addition of -// the ability to pass a context and additional request options. -// -// See CreateGroupProfile 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 *DataZone) CreateGroupProfileWithContext(ctx aws.Context, input *CreateGroupProfileInput, opts ...request.Option) (*CreateGroupProfileOutput, error) { - req, out := c.CreateGroupProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateListingChangeSet = "CreateListingChangeSet" - -// CreateListingChangeSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateListingChangeSet 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 CreateListingChangeSet for more information on using the CreateListingChangeSet -// 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 CreateListingChangeSetRequest method. -// req, resp := client.CreateListingChangeSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateListingChangeSet -func (c *DataZone) CreateListingChangeSetRequest(input *CreateListingChangeSetInput) (req *request.Request, output *CreateListingChangeSetOutput) { - op := &request.Operation{ - Name: opCreateListingChangeSet, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/listings/change-set", - } - - if input == nil { - input = &CreateListingChangeSetInput{} - } - - output = &CreateListingChangeSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateListingChangeSet API operation for Amazon DataZone. -// -// 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 DataZone's -// API operation CreateListingChangeSet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateListingChangeSet -func (c *DataZone) CreateListingChangeSet(input *CreateListingChangeSetInput) (*CreateListingChangeSetOutput, error) { - req, out := c.CreateListingChangeSetRequest(input) - return out, req.Send() -} - -// CreateListingChangeSetWithContext is the same as CreateListingChangeSet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateListingChangeSet 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 *DataZone) CreateListingChangeSetWithContext(ctx aws.Context, input *CreateListingChangeSetInput, opts ...request.Option) (*CreateListingChangeSetOutput, error) { - req, out := c.CreateListingChangeSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateProject = "CreateProject" - -// CreateProjectRequest generates a "aws/request.Request" representing the -// client's request for the CreateProject 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 CreateProject for more information on using the CreateProject -// 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 CreateProjectRequest method. -// req, resp := client.CreateProjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateProject -func (c *DataZone) CreateProjectRequest(input *CreateProjectInput) (req *request.Request, output *CreateProjectOutput) { - op := &request.Operation{ - Name: opCreateProject, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/projects", - } - - if input == nil { - input = &CreateProjectInput{} - } - - output = &CreateProjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateProject API operation for Amazon DataZone. -// -// Creates an Amazon DataZone project. -// -// 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 DataZone's -// API operation CreateProject for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateProject -func (c *DataZone) CreateProject(input *CreateProjectInput) (*CreateProjectOutput, error) { - req, out := c.CreateProjectRequest(input) - return out, req.Send() -} - -// CreateProjectWithContext is the same as CreateProject with the addition of -// the ability to pass a context and additional request options. -// -// See CreateProject 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 *DataZone) CreateProjectWithContext(ctx aws.Context, input *CreateProjectInput, opts ...request.Option) (*CreateProjectOutput, error) { - req, out := c.CreateProjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateProjectMembership = "CreateProjectMembership" - -// CreateProjectMembershipRequest generates a "aws/request.Request" representing the -// client's request for the CreateProjectMembership 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 CreateProjectMembership for more information on using the CreateProjectMembership -// 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 CreateProjectMembershipRequest method. -// req, resp := client.CreateProjectMembershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateProjectMembership -func (c *DataZone) CreateProjectMembershipRequest(input *CreateProjectMembershipInput) (req *request.Request, output *CreateProjectMembershipOutput) { - op := &request.Operation{ - Name: opCreateProjectMembership, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/projects/{projectIdentifier}/createMembership", - } - - if input == nil { - input = &CreateProjectMembershipInput{} - } - - output = &CreateProjectMembershipOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateProjectMembership API operation for Amazon DataZone. -// -// Creates a project membership in Amazon DataZone. -// -// 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 DataZone's -// API operation CreateProjectMembership for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateProjectMembership -func (c *DataZone) CreateProjectMembership(input *CreateProjectMembershipInput) (*CreateProjectMembershipOutput, error) { - req, out := c.CreateProjectMembershipRequest(input) - return out, req.Send() -} - -// CreateProjectMembershipWithContext is the same as CreateProjectMembership with the addition of -// the ability to pass a context and additional request options. -// -// See CreateProjectMembership 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 *DataZone) CreateProjectMembershipWithContext(ctx aws.Context, input *CreateProjectMembershipInput, opts ...request.Option) (*CreateProjectMembershipOutput, error) { - req, out := c.CreateProjectMembershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSubscriptionGrant = "CreateSubscriptionGrant" - -// CreateSubscriptionGrantRequest generates a "aws/request.Request" representing the -// client's request for the CreateSubscriptionGrant 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 CreateSubscriptionGrant for more information on using the CreateSubscriptionGrant -// 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 CreateSubscriptionGrantRequest method. -// req, resp := client.CreateSubscriptionGrantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateSubscriptionGrant -func (c *DataZone) CreateSubscriptionGrantRequest(input *CreateSubscriptionGrantInput) (req *request.Request, output *CreateSubscriptionGrantOutput) { - op := &request.Operation{ - Name: opCreateSubscriptionGrant, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-grants", - } - - if input == nil { - input = &CreateSubscriptionGrantInput{} - } - - output = &CreateSubscriptionGrantOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSubscriptionGrant API operation for Amazon DataZone. -// -// Creates a subsscription grant in Amazon DataZone. -// -// 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 DataZone's -// API operation CreateSubscriptionGrant for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateSubscriptionGrant -func (c *DataZone) CreateSubscriptionGrant(input *CreateSubscriptionGrantInput) (*CreateSubscriptionGrantOutput, error) { - req, out := c.CreateSubscriptionGrantRequest(input) - return out, req.Send() -} - -// CreateSubscriptionGrantWithContext is the same as CreateSubscriptionGrant with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSubscriptionGrant 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 *DataZone) CreateSubscriptionGrantWithContext(ctx aws.Context, input *CreateSubscriptionGrantInput, opts ...request.Option) (*CreateSubscriptionGrantOutput, error) { - req, out := c.CreateSubscriptionGrantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSubscriptionRequest = "CreateSubscriptionRequest" - -// CreateSubscriptionRequestRequest generates a "aws/request.Request" representing the -// client's request for the CreateSubscriptionRequest 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 CreateSubscriptionRequest for more information on using the CreateSubscriptionRequest -// 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 CreateSubscriptionRequestRequest method. -// req, resp := client.CreateSubscriptionRequestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateSubscriptionRequest -func (c *DataZone) CreateSubscriptionRequestRequest(input *CreateSubscriptionRequestInput) (req *request.Request, output *CreateSubscriptionRequestOutput) { - op := &request.Operation{ - Name: opCreateSubscriptionRequest, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-requests", - } - - if input == nil { - input = &CreateSubscriptionRequestInput{} - } - - output = &CreateSubscriptionRequestOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSubscriptionRequest API operation for Amazon DataZone. -// -// Creates a subscription request in Amazon DataZone. -// -// 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 DataZone's -// API operation CreateSubscriptionRequest for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateSubscriptionRequest -func (c *DataZone) CreateSubscriptionRequest(input *CreateSubscriptionRequestInput) (*CreateSubscriptionRequestOutput, error) { - req, out := c.CreateSubscriptionRequestRequest(input) - return out, req.Send() -} - -// CreateSubscriptionRequestWithContext is the same as CreateSubscriptionRequest with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSubscriptionRequest 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 *DataZone) CreateSubscriptionRequestWithContext(ctx aws.Context, input *CreateSubscriptionRequestInput, opts ...request.Option) (*CreateSubscriptionRequestOutput, error) { - req, out := c.CreateSubscriptionRequestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSubscriptionTarget = "CreateSubscriptionTarget" - -// CreateSubscriptionTargetRequest generates a "aws/request.Request" representing the -// client's request for the CreateSubscriptionTarget 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 CreateSubscriptionTarget for more information on using the CreateSubscriptionTarget -// 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 CreateSubscriptionTargetRequest method. -// req, resp := client.CreateSubscriptionTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateSubscriptionTarget -func (c *DataZone) CreateSubscriptionTargetRequest(input *CreateSubscriptionTargetInput) (req *request.Request, output *CreateSubscriptionTargetOutput) { - op := &request.Operation{ - Name: opCreateSubscriptionTarget, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/environments/{environmentIdentifier}/subscription-targets", - } - - if input == nil { - input = &CreateSubscriptionTargetInput{} - } - - output = &CreateSubscriptionTargetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSubscriptionTarget API operation for Amazon DataZone. -// -// Creates a subscription target in Amazon DataZone. -// -// 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 DataZone's -// API operation CreateSubscriptionTarget for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateSubscriptionTarget -func (c *DataZone) CreateSubscriptionTarget(input *CreateSubscriptionTargetInput) (*CreateSubscriptionTargetOutput, error) { - req, out := c.CreateSubscriptionTargetRequest(input) - return out, req.Send() -} - -// CreateSubscriptionTargetWithContext is the same as CreateSubscriptionTarget with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSubscriptionTarget 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 *DataZone) CreateSubscriptionTargetWithContext(ctx aws.Context, input *CreateSubscriptionTargetInput, opts ...request.Option) (*CreateSubscriptionTargetOutput, error) { - req, out := c.CreateSubscriptionTargetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateUserProfile = "CreateUserProfile" - -// CreateUserProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateUserProfile 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 CreateUserProfile for more information on using the CreateUserProfile -// 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 CreateUserProfileRequest method. -// req, resp := client.CreateUserProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateUserProfile -func (c *DataZone) CreateUserProfileRequest(input *CreateUserProfileInput) (req *request.Request, output *CreateUserProfileOutput) { - op := &request.Operation{ - Name: opCreateUserProfile, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/user-profiles", - } - - if input == nil { - input = &CreateUserProfileInput{} - } - - output = &CreateUserProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateUserProfile API operation for Amazon DataZone. -// -// Creates a user profile in Amazon DataZone. -// -// 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 DataZone's -// API operation CreateUserProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateUserProfile -func (c *DataZone) CreateUserProfile(input *CreateUserProfileInput) (*CreateUserProfileOutput, error) { - req, out := c.CreateUserProfileRequest(input) - return out, req.Send() -} - -// CreateUserProfileWithContext is the same as CreateUserProfile with the addition of -// the ability to pass a context and additional request options. -// -// See CreateUserProfile 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 *DataZone) CreateUserProfileWithContext(ctx aws.Context, input *CreateUserProfileInput, opts ...request.Option) (*CreateUserProfileOutput, error) { - req, out := c.CreateUserProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAsset = "DeleteAsset" - -// DeleteAssetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAsset 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 DeleteAsset for more information on using the DeleteAsset -// 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 DeleteAssetRequest method. -// req, resp := client.DeleteAssetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteAsset -func (c *DataZone) DeleteAssetRequest(input *DeleteAssetInput) (req *request.Request, output *DeleteAssetOutput) { - op := &request.Operation{ - Name: opDeleteAsset, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/assets/{identifier}", - } - - if input == nil { - input = &DeleteAssetInput{} - } - - output = &DeleteAssetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAsset API operation for Amazon DataZone. -// -// Delets an asset in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteAsset for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteAsset -func (c *DataZone) DeleteAsset(input *DeleteAssetInput) (*DeleteAssetOutput, error) { - req, out := c.DeleteAssetRequest(input) - return out, req.Send() -} - -// DeleteAssetWithContext is the same as DeleteAsset with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAsset 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 *DataZone) DeleteAssetWithContext(ctx aws.Context, input *DeleteAssetInput, opts ...request.Option) (*DeleteAssetOutput, error) { - req, out := c.DeleteAssetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAssetType = "DeleteAssetType" - -// DeleteAssetTypeRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAssetType 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 DeleteAssetType for more information on using the DeleteAssetType -// 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 DeleteAssetTypeRequest method. -// req, resp := client.DeleteAssetTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteAssetType -func (c *DataZone) DeleteAssetTypeRequest(input *DeleteAssetTypeInput) (req *request.Request, output *DeleteAssetTypeOutput) { - op := &request.Operation{ - Name: opDeleteAssetType, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/asset-types/{identifier}", - } - - if input == nil { - input = &DeleteAssetTypeInput{} - } - - output = &DeleteAssetTypeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAssetType API operation for Amazon DataZone. -// -// Deletes an asset type in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteAssetType for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteAssetType -func (c *DataZone) DeleteAssetType(input *DeleteAssetTypeInput) (*DeleteAssetTypeOutput, error) { - req, out := c.DeleteAssetTypeRequest(input) - return out, req.Send() -} - -// DeleteAssetTypeWithContext is the same as DeleteAssetType with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAssetType 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 *DataZone) DeleteAssetTypeWithContext(ctx aws.Context, input *DeleteAssetTypeInput, opts ...request.Option) (*DeleteAssetTypeOutput, error) { - req, out := c.DeleteAssetTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDataSource = "DeleteDataSource" - -// DeleteDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDataSource 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 DeleteDataSource for more information on using the DeleteDataSource -// 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 DeleteDataSourceRequest method. -// req, resp := client.DeleteDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteDataSource -func (c *DataZone) DeleteDataSourceRequest(input *DeleteDataSourceInput) (req *request.Request, output *DeleteDataSourceOutput) { - op := &request.Operation{ - Name: opDeleteDataSource, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/data-sources/{identifier}", - } - - if input == nil { - input = &DeleteDataSourceInput{} - } - - output = &DeleteDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDataSource API operation for Amazon DataZone. -// -// Deletes a data source in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteDataSource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteDataSource -func (c *DataZone) DeleteDataSource(input *DeleteDataSourceInput) (*DeleteDataSourceOutput, error) { - req, out := c.DeleteDataSourceRequest(input) - return out, req.Send() -} - -// DeleteDataSourceWithContext is the same as DeleteDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDataSource 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 *DataZone) DeleteDataSourceWithContext(ctx aws.Context, input *DeleteDataSourceInput, opts ...request.Option) (*DeleteDataSourceOutput, error) { - req, out := c.DeleteDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDomain = "DeleteDomain" - -// DeleteDomainRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDomain 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 DeleteDomain for more information on using the DeleteDomain -// 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 DeleteDomainRequest method. -// req, resp := client.DeleteDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteDomain -func (c *DataZone) DeleteDomainRequest(input *DeleteDomainInput) (req *request.Request, output *DeleteDomainOutput) { - op := &request.Operation{ - Name: opDeleteDomain, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{identifier}", - } - - if input == nil { - input = &DeleteDomainInput{} - } - - output = &DeleteDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDomain API operation for Amazon DataZone. -// -// Deletes a Amazon DataZone domain. -// -// 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 DataZone's -// API operation DeleteDomain for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteDomain -func (c *DataZone) DeleteDomain(input *DeleteDomainInput) (*DeleteDomainOutput, error) { - req, out := c.DeleteDomainRequest(input) - return out, req.Send() -} - -// DeleteDomainWithContext is the same as DeleteDomain with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDomain 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 *DataZone) DeleteDomainWithContext(ctx aws.Context, input *DeleteDomainInput, opts ...request.Option) (*DeleteDomainOutput, error) { - req, out := c.DeleteDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEnvironment = "DeleteEnvironment" - -// DeleteEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEnvironment 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 DeleteEnvironment for more information on using the DeleteEnvironment -// 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 DeleteEnvironmentRequest method. -// req, resp := client.DeleteEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteEnvironment -func (c *DataZone) DeleteEnvironmentRequest(input *DeleteEnvironmentInput) (req *request.Request, output *DeleteEnvironmentOutput) { - op := &request.Operation{ - Name: opDeleteEnvironment, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/environments/{identifier}", - } - - if input == nil { - input = &DeleteEnvironmentInput{} - } - - output = &DeleteEnvironmentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEnvironment API operation for Amazon DataZone. -// -// Deletes an environment in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteEnvironment for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteEnvironment -func (c *DataZone) DeleteEnvironment(input *DeleteEnvironmentInput) (*DeleteEnvironmentOutput, error) { - req, out := c.DeleteEnvironmentRequest(input) - return out, req.Send() -} - -// DeleteEnvironmentWithContext is the same as DeleteEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEnvironment 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 *DataZone) DeleteEnvironmentWithContext(ctx aws.Context, input *DeleteEnvironmentInput, opts ...request.Option) (*DeleteEnvironmentOutput, error) { - req, out := c.DeleteEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEnvironmentBlueprintConfiguration = "DeleteEnvironmentBlueprintConfiguration" - -// DeleteEnvironmentBlueprintConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEnvironmentBlueprintConfiguration 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 DeleteEnvironmentBlueprintConfiguration for more information on using the DeleteEnvironmentBlueprintConfiguration -// 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 DeleteEnvironmentBlueprintConfigurationRequest method. -// req, resp := client.DeleteEnvironmentBlueprintConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteEnvironmentBlueprintConfiguration -func (c *DataZone) DeleteEnvironmentBlueprintConfigurationRequest(input *DeleteEnvironmentBlueprintConfigurationInput) (req *request.Request, output *DeleteEnvironmentBlueprintConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteEnvironmentBlueprintConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-blueprint-configurations/{environmentBlueprintIdentifier}", - } - - if input == nil { - input = &DeleteEnvironmentBlueprintConfigurationInput{} - } - - output = &DeleteEnvironmentBlueprintConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEnvironmentBlueprintConfiguration API operation for Amazon DataZone. -// -// Deletes the blueprint configuration in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteEnvironmentBlueprintConfiguration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteEnvironmentBlueprintConfiguration -func (c *DataZone) DeleteEnvironmentBlueprintConfiguration(input *DeleteEnvironmentBlueprintConfigurationInput) (*DeleteEnvironmentBlueprintConfigurationOutput, error) { - req, out := c.DeleteEnvironmentBlueprintConfigurationRequest(input) - return out, req.Send() -} - -// DeleteEnvironmentBlueprintConfigurationWithContext is the same as DeleteEnvironmentBlueprintConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEnvironmentBlueprintConfiguration 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 *DataZone) DeleteEnvironmentBlueprintConfigurationWithContext(ctx aws.Context, input *DeleteEnvironmentBlueprintConfigurationInput, opts ...request.Option) (*DeleteEnvironmentBlueprintConfigurationOutput, error) { - req, out := c.DeleteEnvironmentBlueprintConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEnvironmentProfile = "DeleteEnvironmentProfile" - -// DeleteEnvironmentProfileRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEnvironmentProfile 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 DeleteEnvironmentProfile for more information on using the DeleteEnvironmentProfile -// 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 DeleteEnvironmentProfileRequest method. -// req, resp := client.DeleteEnvironmentProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteEnvironmentProfile -func (c *DataZone) DeleteEnvironmentProfileRequest(input *DeleteEnvironmentProfileInput) (req *request.Request, output *DeleteEnvironmentProfileOutput) { - op := &request.Operation{ - Name: opDeleteEnvironmentProfile, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-profiles/{identifier}", - } - - if input == nil { - input = &DeleteEnvironmentProfileInput{} - } - - output = &DeleteEnvironmentProfileOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEnvironmentProfile API operation for Amazon DataZone. -// -// Deletes an environment profile in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteEnvironmentProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteEnvironmentProfile -func (c *DataZone) DeleteEnvironmentProfile(input *DeleteEnvironmentProfileInput) (*DeleteEnvironmentProfileOutput, error) { - req, out := c.DeleteEnvironmentProfileRequest(input) - return out, req.Send() -} - -// DeleteEnvironmentProfileWithContext is the same as DeleteEnvironmentProfile with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEnvironmentProfile 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 *DataZone) DeleteEnvironmentProfileWithContext(ctx aws.Context, input *DeleteEnvironmentProfileInput, opts ...request.Option) (*DeleteEnvironmentProfileOutput, error) { - req, out := c.DeleteEnvironmentProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteFormType = "DeleteFormType" - -// DeleteFormTypeRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFormType 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 DeleteFormType for more information on using the DeleteFormType -// 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 DeleteFormTypeRequest method. -// req, resp := client.DeleteFormTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteFormType -func (c *DataZone) DeleteFormTypeRequest(input *DeleteFormTypeInput) (req *request.Request, output *DeleteFormTypeOutput) { - op := &request.Operation{ - Name: opDeleteFormType, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/form-types/{formTypeIdentifier}", - } - - if input == nil { - input = &DeleteFormTypeInput{} - } - - output = &DeleteFormTypeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteFormType API operation for Amazon DataZone. -// -// Delets and metadata form type in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteFormType for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteFormType -func (c *DataZone) DeleteFormType(input *DeleteFormTypeInput) (*DeleteFormTypeOutput, error) { - req, out := c.DeleteFormTypeRequest(input) - return out, req.Send() -} - -// DeleteFormTypeWithContext is the same as DeleteFormType with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteFormType 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 *DataZone) DeleteFormTypeWithContext(ctx aws.Context, input *DeleteFormTypeInput, opts ...request.Option) (*DeleteFormTypeOutput, error) { - req, out := c.DeleteFormTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteGlossary = "DeleteGlossary" - -// DeleteGlossaryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGlossary 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 DeleteGlossary for more information on using the DeleteGlossary -// 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 DeleteGlossaryRequest method. -// req, resp := client.DeleteGlossaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteGlossary -func (c *DataZone) DeleteGlossaryRequest(input *DeleteGlossaryInput) (req *request.Request, output *DeleteGlossaryOutput) { - op := &request.Operation{ - Name: opDeleteGlossary, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/glossaries/{identifier}", - } - - if input == nil { - input = &DeleteGlossaryInput{} - } - - output = &DeleteGlossaryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteGlossary API operation for Amazon DataZone. -// -// Deletes a business glossary in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteGlossary for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteGlossary -func (c *DataZone) DeleteGlossary(input *DeleteGlossaryInput) (*DeleteGlossaryOutput, error) { - req, out := c.DeleteGlossaryRequest(input) - return out, req.Send() -} - -// DeleteGlossaryWithContext is the same as DeleteGlossary with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteGlossary 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 *DataZone) DeleteGlossaryWithContext(ctx aws.Context, input *DeleteGlossaryInput, opts ...request.Option) (*DeleteGlossaryOutput, error) { - req, out := c.DeleteGlossaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteGlossaryTerm = "DeleteGlossaryTerm" - -// DeleteGlossaryTermRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGlossaryTerm 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 DeleteGlossaryTerm for more information on using the DeleteGlossaryTerm -// 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 DeleteGlossaryTermRequest method. -// req, resp := client.DeleteGlossaryTermRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteGlossaryTerm -func (c *DataZone) DeleteGlossaryTermRequest(input *DeleteGlossaryTermInput) (req *request.Request, output *DeleteGlossaryTermOutput) { - op := &request.Operation{ - Name: opDeleteGlossaryTerm, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/glossary-terms/{identifier}", - } - - if input == nil { - input = &DeleteGlossaryTermInput{} - } - - output = &DeleteGlossaryTermOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteGlossaryTerm API operation for Amazon DataZone. -// -// Deletes a business glossary term in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteGlossaryTerm for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteGlossaryTerm -func (c *DataZone) DeleteGlossaryTerm(input *DeleteGlossaryTermInput) (*DeleteGlossaryTermOutput, error) { - req, out := c.DeleteGlossaryTermRequest(input) - return out, req.Send() -} - -// DeleteGlossaryTermWithContext is the same as DeleteGlossaryTerm with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteGlossaryTerm 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 *DataZone) DeleteGlossaryTermWithContext(ctx aws.Context, input *DeleteGlossaryTermInput, opts ...request.Option) (*DeleteGlossaryTermOutput, error) { - req, out := c.DeleteGlossaryTermRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteListing = "DeleteListing" - -// DeleteListingRequest generates a "aws/request.Request" representing the -// client's request for the DeleteListing 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 DeleteListing for more information on using the DeleteListing -// 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 DeleteListingRequest method. -// req, resp := client.DeleteListingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteListing -func (c *DataZone) DeleteListingRequest(input *DeleteListingInput) (req *request.Request, output *DeleteListingOutput) { - op := &request.Operation{ - Name: opDeleteListing, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/listings/{identifier}", - } - - if input == nil { - input = &DeleteListingInput{} - } - - output = &DeleteListingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteListing API operation for Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteListing for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteListing -func (c *DataZone) DeleteListing(input *DeleteListingInput) (*DeleteListingOutput, error) { - req, out := c.DeleteListingRequest(input) - return out, req.Send() -} - -// DeleteListingWithContext is the same as DeleteListing with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteListing 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 *DataZone) DeleteListingWithContext(ctx aws.Context, input *DeleteListingInput, opts ...request.Option) (*DeleteListingOutput, error) { - req, out := c.DeleteListingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteProject = "DeleteProject" - -// DeleteProjectRequest generates a "aws/request.Request" representing the -// client's request for the DeleteProject 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 DeleteProject for more information on using the DeleteProject -// 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 DeleteProjectRequest method. -// req, resp := client.DeleteProjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteProject -func (c *DataZone) DeleteProjectRequest(input *DeleteProjectInput) (req *request.Request, output *DeleteProjectOutput) { - op := &request.Operation{ - Name: opDeleteProject, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/projects/{identifier}", - } - - if input == nil { - input = &DeleteProjectInput{} - } - - output = &DeleteProjectOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteProject API operation for Amazon DataZone. -// -// Deletes a project in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteProject for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteProject -func (c *DataZone) DeleteProject(input *DeleteProjectInput) (*DeleteProjectOutput, error) { - req, out := c.DeleteProjectRequest(input) - return out, req.Send() -} - -// DeleteProjectWithContext is the same as DeleteProject with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteProject 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 *DataZone) DeleteProjectWithContext(ctx aws.Context, input *DeleteProjectInput, opts ...request.Option) (*DeleteProjectOutput, error) { - req, out := c.DeleteProjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteProjectMembership = "DeleteProjectMembership" - -// DeleteProjectMembershipRequest generates a "aws/request.Request" representing the -// client's request for the DeleteProjectMembership 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 DeleteProjectMembership for more information on using the DeleteProjectMembership -// 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 DeleteProjectMembershipRequest method. -// req, resp := client.DeleteProjectMembershipRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteProjectMembership -func (c *DataZone) DeleteProjectMembershipRequest(input *DeleteProjectMembershipInput) (req *request.Request, output *DeleteProjectMembershipOutput) { - op := &request.Operation{ - Name: opDeleteProjectMembership, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/projects/{projectIdentifier}/deleteMembership", - } - - if input == nil { - input = &DeleteProjectMembershipInput{} - } - - output = &DeleteProjectMembershipOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteProjectMembership API operation for Amazon DataZone. -// -// Deletes project membership in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteProjectMembership for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteProjectMembership -func (c *DataZone) DeleteProjectMembership(input *DeleteProjectMembershipInput) (*DeleteProjectMembershipOutput, error) { - req, out := c.DeleteProjectMembershipRequest(input) - return out, req.Send() -} - -// DeleteProjectMembershipWithContext is the same as DeleteProjectMembership with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteProjectMembership 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 *DataZone) DeleteProjectMembershipWithContext(ctx aws.Context, input *DeleteProjectMembershipInput, opts ...request.Option) (*DeleteProjectMembershipOutput, error) { - req, out := c.DeleteProjectMembershipRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSubscriptionGrant = "DeleteSubscriptionGrant" - -// DeleteSubscriptionGrantRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSubscriptionGrant 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 DeleteSubscriptionGrant for more information on using the DeleteSubscriptionGrant -// 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 DeleteSubscriptionGrantRequest method. -// req, resp := client.DeleteSubscriptionGrantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteSubscriptionGrant -func (c *DataZone) DeleteSubscriptionGrantRequest(input *DeleteSubscriptionGrantInput) (req *request.Request, output *DeleteSubscriptionGrantOutput) { - op := &request.Operation{ - Name: opDeleteSubscriptionGrant, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-grants/{identifier}", - } - - if input == nil { - input = &DeleteSubscriptionGrantInput{} - } - - output = &DeleteSubscriptionGrantOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSubscriptionGrant API operation for Amazon DataZone. -// -// Deletes and subscription grant in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteSubscriptionGrant for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteSubscriptionGrant -func (c *DataZone) DeleteSubscriptionGrant(input *DeleteSubscriptionGrantInput) (*DeleteSubscriptionGrantOutput, error) { - req, out := c.DeleteSubscriptionGrantRequest(input) - return out, req.Send() -} - -// DeleteSubscriptionGrantWithContext is the same as DeleteSubscriptionGrant with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSubscriptionGrant 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 *DataZone) DeleteSubscriptionGrantWithContext(ctx aws.Context, input *DeleteSubscriptionGrantInput, opts ...request.Option) (*DeleteSubscriptionGrantOutput, error) { - req, out := c.DeleteSubscriptionGrantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSubscriptionRequest = "DeleteSubscriptionRequest" - -// DeleteSubscriptionRequestRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSubscriptionRequest 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 DeleteSubscriptionRequest for more information on using the DeleteSubscriptionRequest -// 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 DeleteSubscriptionRequestRequest method. -// req, resp := client.DeleteSubscriptionRequestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteSubscriptionRequest -func (c *DataZone) DeleteSubscriptionRequestRequest(input *DeleteSubscriptionRequestInput) (req *request.Request, output *DeleteSubscriptionRequestOutput) { - op := &request.Operation{ - Name: opDeleteSubscriptionRequest, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-requests/{identifier}", - } - - if input == nil { - input = &DeleteSubscriptionRequestInput{} - } - - output = &DeleteSubscriptionRequestOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSubscriptionRequest API operation for Amazon DataZone. -// -// Deletes a subscription request in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteSubscriptionRequest for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteSubscriptionRequest -func (c *DataZone) DeleteSubscriptionRequest(input *DeleteSubscriptionRequestInput) (*DeleteSubscriptionRequestOutput, error) { - req, out := c.DeleteSubscriptionRequestRequest(input) - return out, req.Send() -} - -// DeleteSubscriptionRequestWithContext is the same as DeleteSubscriptionRequest with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSubscriptionRequest 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 *DataZone) DeleteSubscriptionRequestWithContext(ctx aws.Context, input *DeleteSubscriptionRequestInput, opts ...request.Option) (*DeleteSubscriptionRequestOutput, error) { - req, out := c.DeleteSubscriptionRequestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSubscriptionTarget = "DeleteSubscriptionTarget" - -// DeleteSubscriptionTargetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSubscriptionTarget 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 DeleteSubscriptionTarget for more information on using the DeleteSubscriptionTarget -// 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 DeleteSubscriptionTargetRequest method. -// req, resp := client.DeleteSubscriptionTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteSubscriptionTarget -func (c *DataZone) DeleteSubscriptionTargetRequest(input *DeleteSubscriptionTargetInput) (req *request.Request, output *DeleteSubscriptionTargetOutput) { - op := &request.Operation{ - Name: opDeleteSubscriptionTarget, - HTTPMethod: "DELETE", - HTTPPath: "/v2/domains/{domainIdentifier}/environments/{environmentIdentifier}/subscription-targets/{identifier}", - } - - if input == nil { - input = &DeleteSubscriptionTargetInput{} - } - - output = &DeleteSubscriptionTargetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSubscriptionTarget API operation for Amazon DataZone. -// -// Deletes a subscription target in Amazon DataZone. -// -// 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 DataZone's -// API operation DeleteSubscriptionTarget for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/DeleteSubscriptionTarget -func (c *DataZone) DeleteSubscriptionTarget(input *DeleteSubscriptionTargetInput) (*DeleteSubscriptionTargetOutput, error) { - req, out := c.DeleteSubscriptionTargetRequest(input) - return out, req.Send() -} - -// DeleteSubscriptionTargetWithContext is the same as DeleteSubscriptionTarget with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSubscriptionTarget 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 *DataZone) DeleteSubscriptionTargetWithContext(ctx aws.Context, input *DeleteSubscriptionTargetInput, opts ...request.Option) (*DeleteSubscriptionTargetOutput, error) { - req, out := c.DeleteSubscriptionTargetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAsset = "GetAsset" - -// GetAssetRequest generates a "aws/request.Request" representing the -// client's request for the GetAsset 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 GetAsset for more information on using the GetAsset -// 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 GetAssetRequest method. -// req, resp := client.GetAssetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetAsset -func (c *DataZone) GetAssetRequest(input *GetAssetInput) (req *request.Request, output *GetAssetOutput) { - op := &request.Operation{ - Name: opGetAsset, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/assets/{identifier}", - } - - if input == nil { - input = &GetAssetInput{} - } - - output = &GetAssetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAsset API operation for Amazon DataZone. -// -// Gets an Amazon DataZone asset. -// -// 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 DataZone's -// API operation GetAsset for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetAsset -func (c *DataZone) GetAsset(input *GetAssetInput) (*GetAssetOutput, error) { - req, out := c.GetAssetRequest(input) - return out, req.Send() -} - -// GetAssetWithContext is the same as GetAsset with the addition of -// the ability to pass a context and additional request options. -// -// See GetAsset 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 *DataZone) GetAssetWithContext(ctx aws.Context, input *GetAssetInput, opts ...request.Option) (*GetAssetOutput, error) { - req, out := c.GetAssetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAssetType = "GetAssetType" - -// GetAssetTypeRequest generates a "aws/request.Request" representing the -// client's request for the GetAssetType 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 GetAssetType for more information on using the GetAssetType -// 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 GetAssetTypeRequest method. -// req, resp := client.GetAssetTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetAssetType -func (c *DataZone) GetAssetTypeRequest(input *GetAssetTypeInput) (req *request.Request, output *GetAssetTypeOutput) { - op := &request.Operation{ - Name: opGetAssetType, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/asset-types/{identifier}", - } - - if input == nil { - input = &GetAssetTypeInput{} - } - - output = &GetAssetTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAssetType API operation for Amazon DataZone. -// -// Gets an Amazon DataZone asset type. -// -// 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 DataZone's -// API operation GetAssetType for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetAssetType -func (c *DataZone) GetAssetType(input *GetAssetTypeInput) (*GetAssetTypeOutput, error) { - req, out := c.GetAssetTypeRequest(input) - return out, req.Send() -} - -// GetAssetTypeWithContext is the same as GetAssetType with the addition of -// the ability to pass a context and additional request options. -// -// See GetAssetType 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 *DataZone) GetAssetTypeWithContext(ctx aws.Context, input *GetAssetTypeInput, opts ...request.Option) (*GetAssetTypeOutput, error) { - req, out := c.GetAssetTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDataSource = "GetDataSource" - -// GetDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the GetDataSource 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 GetDataSource for more information on using the GetDataSource -// 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 GetDataSourceRequest method. -// req, resp := client.GetDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetDataSource -func (c *DataZone) GetDataSourceRequest(input *GetDataSourceInput) (req *request.Request, output *GetDataSourceOutput) { - op := &request.Operation{ - Name: opGetDataSource, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/data-sources/{identifier}", - } - - if input == nil { - input = &GetDataSourceInput{} - } - - output = &GetDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataSource API operation for Amazon DataZone. -// -// Gets an Amazon DataZone data source. -// -// 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 DataZone's -// API operation GetDataSource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetDataSource -func (c *DataZone) GetDataSource(input *GetDataSourceInput) (*GetDataSourceOutput, error) { - req, out := c.GetDataSourceRequest(input) - return out, req.Send() -} - -// GetDataSourceWithContext is the same as GetDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataSource 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 *DataZone) GetDataSourceWithContext(ctx aws.Context, input *GetDataSourceInput, opts ...request.Option) (*GetDataSourceOutput, error) { - req, out := c.GetDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDataSourceRun = "GetDataSourceRun" - -// GetDataSourceRunRequest generates a "aws/request.Request" representing the -// client's request for the GetDataSourceRun 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 GetDataSourceRun for more information on using the GetDataSourceRun -// 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 GetDataSourceRunRequest method. -// req, resp := client.GetDataSourceRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetDataSourceRun -func (c *DataZone) GetDataSourceRunRequest(input *GetDataSourceRunInput) (req *request.Request, output *GetDataSourceRunOutput) { - op := &request.Operation{ - Name: opGetDataSourceRun, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/data-source-runs/{identifier}", - } - - if input == nil { - input = &GetDataSourceRunInput{} - } - - output = &GetDataSourceRunOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataSourceRun API operation for Amazon DataZone. -// -// Gets an Amazon DataZone data source run. -// -// 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 DataZone's -// API operation GetDataSourceRun for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetDataSourceRun -func (c *DataZone) GetDataSourceRun(input *GetDataSourceRunInput) (*GetDataSourceRunOutput, error) { - req, out := c.GetDataSourceRunRequest(input) - return out, req.Send() -} - -// GetDataSourceRunWithContext is the same as GetDataSourceRun with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataSourceRun 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 *DataZone) GetDataSourceRunWithContext(ctx aws.Context, input *GetDataSourceRunInput, opts ...request.Option) (*GetDataSourceRunOutput, error) { - req, out := c.GetDataSourceRunRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDomain = "GetDomain" - -// GetDomainRequest generates a "aws/request.Request" representing the -// client's request for the GetDomain 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 GetDomain for more information on using the GetDomain -// 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 GetDomainRequest method. -// req, resp := client.GetDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetDomain -func (c *DataZone) GetDomainRequest(input *GetDomainInput) (req *request.Request, output *GetDomainOutput) { - op := &request.Operation{ - Name: opGetDomain, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{identifier}", - } - - if input == nil { - input = &GetDomainInput{} - } - - output = &GetDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDomain API operation for Amazon DataZone. -// -// Gets an Amazon DataZone domain. -// -// 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 DataZone's -// API operation GetDomain for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetDomain -func (c *DataZone) GetDomain(input *GetDomainInput) (*GetDomainOutput, error) { - req, out := c.GetDomainRequest(input) - return out, req.Send() -} - -// GetDomainWithContext is the same as GetDomain with the addition of -// the ability to pass a context and additional request options. -// -// See GetDomain 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 *DataZone) GetDomainWithContext(ctx aws.Context, input *GetDomainInput, opts ...request.Option) (*GetDomainOutput, error) { - req, out := c.GetDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEnvironment = "GetEnvironment" - -// GetEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the GetEnvironment 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 GetEnvironment for more information on using the GetEnvironment -// 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 GetEnvironmentRequest method. -// req, resp := client.GetEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetEnvironment -func (c *DataZone) GetEnvironmentRequest(input *GetEnvironmentInput) (req *request.Request, output *GetEnvironmentOutput) { - op := &request.Operation{ - Name: opGetEnvironment, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environments/{identifier}", - } - - if input == nil { - input = &GetEnvironmentInput{} - } - - output = &GetEnvironmentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEnvironment API operation for Amazon DataZone. -// -// Gets an Amazon DataZone environment. -// -// 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 DataZone's -// API operation GetEnvironment for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetEnvironment -func (c *DataZone) GetEnvironment(input *GetEnvironmentInput) (*GetEnvironmentOutput, error) { - req, out := c.GetEnvironmentRequest(input) - return out, req.Send() -} - -// GetEnvironmentWithContext is the same as GetEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See GetEnvironment 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 *DataZone) GetEnvironmentWithContext(ctx aws.Context, input *GetEnvironmentInput, opts ...request.Option) (*GetEnvironmentOutput, error) { - req, out := c.GetEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEnvironmentBlueprint = "GetEnvironmentBlueprint" - -// GetEnvironmentBlueprintRequest generates a "aws/request.Request" representing the -// client's request for the GetEnvironmentBlueprint 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 GetEnvironmentBlueprint for more information on using the GetEnvironmentBlueprint -// 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 GetEnvironmentBlueprintRequest method. -// req, resp := client.GetEnvironmentBlueprintRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetEnvironmentBlueprint -func (c *DataZone) GetEnvironmentBlueprintRequest(input *GetEnvironmentBlueprintInput) (req *request.Request, output *GetEnvironmentBlueprintOutput) { - op := &request.Operation{ - Name: opGetEnvironmentBlueprint, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-blueprints/{identifier}", - } - - if input == nil { - input = &GetEnvironmentBlueprintInput{} - } - - output = &GetEnvironmentBlueprintOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEnvironmentBlueprint API operation for Amazon DataZone. -// -// Gets an Amazon DataZone blueprint. -// -// 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 DataZone's -// API operation GetEnvironmentBlueprint for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetEnvironmentBlueprint -func (c *DataZone) GetEnvironmentBlueprint(input *GetEnvironmentBlueprintInput) (*GetEnvironmentBlueprintOutput, error) { - req, out := c.GetEnvironmentBlueprintRequest(input) - return out, req.Send() -} - -// GetEnvironmentBlueprintWithContext is the same as GetEnvironmentBlueprint with the addition of -// the ability to pass a context and additional request options. -// -// See GetEnvironmentBlueprint 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 *DataZone) GetEnvironmentBlueprintWithContext(ctx aws.Context, input *GetEnvironmentBlueprintInput, opts ...request.Option) (*GetEnvironmentBlueprintOutput, error) { - req, out := c.GetEnvironmentBlueprintRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEnvironmentBlueprintConfiguration = "GetEnvironmentBlueprintConfiguration" - -// GetEnvironmentBlueprintConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetEnvironmentBlueprintConfiguration 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 GetEnvironmentBlueprintConfiguration for more information on using the GetEnvironmentBlueprintConfiguration -// 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 GetEnvironmentBlueprintConfigurationRequest method. -// req, resp := client.GetEnvironmentBlueprintConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetEnvironmentBlueprintConfiguration -func (c *DataZone) GetEnvironmentBlueprintConfigurationRequest(input *GetEnvironmentBlueprintConfigurationInput) (req *request.Request, output *GetEnvironmentBlueprintConfigurationOutput) { - op := &request.Operation{ - Name: opGetEnvironmentBlueprintConfiguration, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-blueprint-configurations/{environmentBlueprintIdentifier}", - } - - if input == nil { - input = &GetEnvironmentBlueprintConfigurationInput{} - } - - output = &GetEnvironmentBlueprintConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEnvironmentBlueprintConfiguration API operation for Amazon DataZone. -// -// Gets the blueprint configuration in Amazon DataZone. -// -// 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 DataZone's -// API operation GetEnvironmentBlueprintConfiguration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetEnvironmentBlueprintConfiguration -func (c *DataZone) GetEnvironmentBlueprintConfiguration(input *GetEnvironmentBlueprintConfigurationInput) (*GetEnvironmentBlueprintConfigurationOutput, error) { - req, out := c.GetEnvironmentBlueprintConfigurationRequest(input) - return out, req.Send() -} - -// GetEnvironmentBlueprintConfigurationWithContext is the same as GetEnvironmentBlueprintConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetEnvironmentBlueprintConfiguration 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 *DataZone) GetEnvironmentBlueprintConfigurationWithContext(ctx aws.Context, input *GetEnvironmentBlueprintConfigurationInput, opts ...request.Option) (*GetEnvironmentBlueprintConfigurationOutput, error) { - req, out := c.GetEnvironmentBlueprintConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEnvironmentProfile = "GetEnvironmentProfile" - -// GetEnvironmentProfileRequest generates a "aws/request.Request" representing the -// client's request for the GetEnvironmentProfile 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 GetEnvironmentProfile for more information on using the GetEnvironmentProfile -// 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 GetEnvironmentProfileRequest method. -// req, resp := client.GetEnvironmentProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetEnvironmentProfile -func (c *DataZone) GetEnvironmentProfileRequest(input *GetEnvironmentProfileInput) (req *request.Request, output *GetEnvironmentProfileOutput) { - op := &request.Operation{ - Name: opGetEnvironmentProfile, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-profiles/{identifier}", - } - - if input == nil { - input = &GetEnvironmentProfileInput{} - } - - output = &GetEnvironmentProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEnvironmentProfile API operation for Amazon DataZone. -// -// Gets an evinronment profile in Amazon DataZone. -// -// 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 DataZone's -// API operation GetEnvironmentProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetEnvironmentProfile -func (c *DataZone) GetEnvironmentProfile(input *GetEnvironmentProfileInput) (*GetEnvironmentProfileOutput, error) { - req, out := c.GetEnvironmentProfileRequest(input) - return out, req.Send() -} - -// GetEnvironmentProfileWithContext is the same as GetEnvironmentProfile with the addition of -// the ability to pass a context and additional request options. -// -// See GetEnvironmentProfile 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 *DataZone) GetEnvironmentProfileWithContext(ctx aws.Context, input *GetEnvironmentProfileInput, opts ...request.Option) (*GetEnvironmentProfileOutput, error) { - req, out := c.GetEnvironmentProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetFormType = "GetFormType" - -// GetFormTypeRequest generates a "aws/request.Request" representing the -// client's request for the GetFormType 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 GetFormType for more information on using the GetFormType -// 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 GetFormTypeRequest method. -// req, resp := client.GetFormTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetFormType -func (c *DataZone) GetFormTypeRequest(input *GetFormTypeInput) (req *request.Request, output *GetFormTypeOutput) { - op := &request.Operation{ - Name: opGetFormType, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/form-types/{formTypeIdentifier}", - } - - if input == nil { - input = &GetFormTypeInput{} - } - - output = &GetFormTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetFormType API operation for Amazon DataZone. -// -// Gets a metadata form type in Amazon DataZone. -// -// 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 DataZone's -// API operation GetFormType for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetFormType -func (c *DataZone) GetFormType(input *GetFormTypeInput) (*GetFormTypeOutput, error) { - req, out := c.GetFormTypeRequest(input) - return out, req.Send() -} - -// GetFormTypeWithContext is the same as GetFormType with the addition of -// the ability to pass a context and additional request options. -// -// See GetFormType 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 *DataZone) GetFormTypeWithContext(ctx aws.Context, input *GetFormTypeInput, opts ...request.Option) (*GetFormTypeOutput, error) { - req, out := c.GetFormTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetGlossary = "GetGlossary" - -// GetGlossaryRequest generates a "aws/request.Request" representing the -// client's request for the GetGlossary 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 GetGlossary for more information on using the GetGlossary -// 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 GetGlossaryRequest method. -// req, resp := client.GetGlossaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetGlossary -func (c *DataZone) GetGlossaryRequest(input *GetGlossaryInput) (req *request.Request, output *GetGlossaryOutput) { - op := &request.Operation{ - Name: opGetGlossary, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/glossaries/{identifier}", - } - - if input == nil { - input = &GetGlossaryInput{} - } - - output = &GetGlossaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGlossary API operation for Amazon DataZone. -// -// Gets a business glossary in Amazon DataZone. -// -// 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 DataZone's -// API operation GetGlossary for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetGlossary -func (c *DataZone) GetGlossary(input *GetGlossaryInput) (*GetGlossaryOutput, error) { - req, out := c.GetGlossaryRequest(input) - return out, req.Send() -} - -// GetGlossaryWithContext is the same as GetGlossary with the addition of -// the ability to pass a context and additional request options. -// -// See GetGlossary 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 *DataZone) GetGlossaryWithContext(ctx aws.Context, input *GetGlossaryInput, opts ...request.Option) (*GetGlossaryOutput, error) { - req, out := c.GetGlossaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetGlossaryTerm = "GetGlossaryTerm" - -// GetGlossaryTermRequest generates a "aws/request.Request" representing the -// client's request for the GetGlossaryTerm 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 GetGlossaryTerm for more information on using the GetGlossaryTerm -// 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 GetGlossaryTermRequest method. -// req, resp := client.GetGlossaryTermRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetGlossaryTerm -func (c *DataZone) GetGlossaryTermRequest(input *GetGlossaryTermInput) (req *request.Request, output *GetGlossaryTermOutput) { - op := &request.Operation{ - Name: opGetGlossaryTerm, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/glossary-terms/{identifier}", - } - - if input == nil { - input = &GetGlossaryTermInput{} - } - - output = &GetGlossaryTermOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGlossaryTerm API operation for Amazon DataZone. -// -// Gets a business glossary term in Amazon DataZone. -// -// 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 DataZone's -// API operation GetGlossaryTerm for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetGlossaryTerm -func (c *DataZone) GetGlossaryTerm(input *GetGlossaryTermInput) (*GetGlossaryTermOutput, error) { - req, out := c.GetGlossaryTermRequest(input) - return out, req.Send() -} - -// GetGlossaryTermWithContext is the same as GetGlossaryTerm with the addition of -// the ability to pass a context and additional request options. -// -// See GetGlossaryTerm 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 *DataZone) GetGlossaryTermWithContext(ctx aws.Context, input *GetGlossaryTermInput, opts ...request.Option) (*GetGlossaryTermOutput, error) { - req, out := c.GetGlossaryTermRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetGroupProfile = "GetGroupProfile" - -// GetGroupProfileRequest generates a "aws/request.Request" representing the -// client's request for the GetGroupProfile 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 GetGroupProfile for more information on using the GetGroupProfile -// 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 GetGroupProfileRequest method. -// req, resp := client.GetGroupProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetGroupProfile -func (c *DataZone) GetGroupProfileRequest(input *GetGroupProfileInput) (req *request.Request, output *GetGroupProfileOutput) { - op := &request.Operation{ - Name: opGetGroupProfile, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/group-profiles/{groupIdentifier}", - } - - if input == nil { - input = &GetGroupProfileInput{} - } - - output = &GetGroupProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGroupProfile API operation for Amazon DataZone. -// -// Gets a group profile in Amazon DataZone. -// -// 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 DataZone's -// API operation GetGroupProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetGroupProfile -func (c *DataZone) GetGroupProfile(input *GetGroupProfileInput) (*GetGroupProfileOutput, error) { - req, out := c.GetGroupProfileRequest(input) - return out, req.Send() -} - -// GetGroupProfileWithContext is the same as GetGroupProfile with the addition of -// the ability to pass a context and additional request options. -// -// See GetGroupProfile 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 *DataZone) GetGroupProfileWithContext(ctx aws.Context, input *GetGroupProfileInput, opts ...request.Option) (*GetGroupProfileOutput, error) { - req, out := c.GetGroupProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIamPortalLoginUrl = "GetIamPortalLoginUrl" - -// GetIamPortalLoginUrlRequest generates a "aws/request.Request" representing the -// client's request for the GetIamPortalLoginUrl 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 GetIamPortalLoginUrl for more information on using the GetIamPortalLoginUrl -// 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 GetIamPortalLoginUrlRequest method. -// req, resp := client.GetIamPortalLoginUrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetIamPortalLoginUrl -func (c *DataZone) GetIamPortalLoginUrlRequest(input *GetIamPortalLoginUrlInput) (req *request.Request, output *GetIamPortalLoginUrlOutput) { - op := &request.Operation{ - Name: opGetIamPortalLoginUrl, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/get-portal-login-url", - } - - if input == nil { - input = &GetIamPortalLoginUrlInput{} - } - - output = &GetIamPortalLoginUrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIamPortalLoginUrl API operation for Amazon DataZone. -// -// Gets the data portal URL for the specified Amazon DataZone domain. -// -// 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 DataZone's -// API operation GetIamPortalLoginUrl for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetIamPortalLoginUrl -func (c *DataZone) GetIamPortalLoginUrl(input *GetIamPortalLoginUrlInput) (*GetIamPortalLoginUrlOutput, error) { - req, out := c.GetIamPortalLoginUrlRequest(input) - return out, req.Send() -} - -// GetIamPortalLoginUrlWithContext is the same as GetIamPortalLoginUrl with the addition of -// the ability to pass a context and additional request options. -// -// See GetIamPortalLoginUrl 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 *DataZone) GetIamPortalLoginUrlWithContext(ctx aws.Context, input *GetIamPortalLoginUrlInput, opts ...request.Option) (*GetIamPortalLoginUrlOutput, error) { - req, out := c.GetIamPortalLoginUrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetListing = "GetListing" - -// GetListingRequest generates a "aws/request.Request" representing the -// client's request for the GetListing 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 GetListing for more information on using the GetListing -// 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 GetListingRequest method. -// req, resp := client.GetListingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetListing -func (c *DataZone) GetListingRequest(input *GetListingInput) (req *request.Request, output *GetListingOutput) { - op := &request.Operation{ - Name: opGetListing, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/listings/{identifier}", - } - - if input == nil { - input = &GetListingInput{} - } - - output = &GetListingOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetListing API operation for Amazon DataZone. -// -// 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 DataZone's -// API operation GetListing for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetListing -func (c *DataZone) GetListing(input *GetListingInput) (*GetListingOutput, error) { - req, out := c.GetListingRequest(input) - return out, req.Send() -} - -// GetListingWithContext is the same as GetListing with the addition of -// the ability to pass a context and additional request options. -// -// See GetListing 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 *DataZone) GetListingWithContext(ctx aws.Context, input *GetListingInput, opts ...request.Option) (*GetListingOutput, error) { - req, out := c.GetListingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetProject = "GetProject" - -// GetProjectRequest generates a "aws/request.Request" representing the -// client's request for the GetProject 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 GetProject for more information on using the GetProject -// 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 GetProjectRequest method. -// req, resp := client.GetProjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetProject -func (c *DataZone) GetProjectRequest(input *GetProjectInput) (req *request.Request, output *GetProjectOutput) { - op := &request.Operation{ - Name: opGetProject, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/projects/{identifier}", - } - - if input == nil { - input = &GetProjectInput{} - } - - output = &GetProjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetProject API operation for Amazon DataZone. -// -// Gets a project in Amazon DataZone. -// -// 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 DataZone's -// API operation GetProject for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetProject -func (c *DataZone) GetProject(input *GetProjectInput) (*GetProjectOutput, error) { - req, out := c.GetProjectRequest(input) - return out, req.Send() -} - -// GetProjectWithContext is the same as GetProject with the addition of -// the ability to pass a context and additional request options. -// -// See GetProject 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 *DataZone) GetProjectWithContext(ctx aws.Context, input *GetProjectInput, opts ...request.Option) (*GetProjectOutput, error) { - req, out := c.GetProjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSubscription = "GetSubscription" - -// GetSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the GetSubscription 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 GetSubscription for more information on using the GetSubscription -// 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 GetSubscriptionRequest method. -// req, resp := client.GetSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetSubscription -func (c *DataZone) GetSubscriptionRequest(input *GetSubscriptionInput) (req *request.Request, output *GetSubscriptionOutput) { - op := &request.Operation{ - Name: opGetSubscription, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/subscriptions/{identifier}", - } - - if input == nil { - input = &GetSubscriptionInput{} - } - - output = &GetSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSubscription API operation for Amazon DataZone. -// -// Gets a subscription in Amazon DataZone. -// -// 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 DataZone's -// API operation GetSubscription for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetSubscription -func (c *DataZone) GetSubscription(input *GetSubscriptionInput) (*GetSubscriptionOutput, error) { - req, out := c.GetSubscriptionRequest(input) - return out, req.Send() -} - -// GetSubscriptionWithContext is the same as GetSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See GetSubscription 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 *DataZone) GetSubscriptionWithContext(ctx aws.Context, input *GetSubscriptionInput, opts ...request.Option) (*GetSubscriptionOutput, error) { - req, out := c.GetSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSubscriptionGrant = "GetSubscriptionGrant" - -// GetSubscriptionGrantRequest generates a "aws/request.Request" representing the -// client's request for the GetSubscriptionGrant 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 GetSubscriptionGrant for more information on using the GetSubscriptionGrant -// 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 GetSubscriptionGrantRequest method. -// req, resp := client.GetSubscriptionGrantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetSubscriptionGrant -func (c *DataZone) GetSubscriptionGrantRequest(input *GetSubscriptionGrantInput) (req *request.Request, output *GetSubscriptionGrantOutput) { - op := &request.Operation{ - Name: opGetSubscriptionGrant, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-grants/{identifier}", - } - - if input == nil { - input = &GetSubscriptionGrantInput{} - } - - output = &GetSubscriptionGrantOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSubscriptionGrant API operation for Amazon DataZone. -// -// Gets the subscription grant in Amazon DataZone. -// -// 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 DataZone's -// API operation GetSubscriptionGrant for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetSubscriptionGrant -func (c *DataZone) GetSubscriptionGrant(input *GetSubscriptionGrantInput) (*GetSubscriptionGrantOutput, error) { - req, out := c.GetSubscriptionGrantRequest(input) - return out, req.Send() -} - -// GetSubscriptionGrantWithContext is the same as GetSubscriptionGrant with the addition of -// the ability to pass a context and additional request options. -// -// See GetSubscriptionGrant 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 *DataZone) GetSubscriptionGrantWithContext(ctx aws.Context, input *GetSubscriptionGrantInput, opts ...request.Option) (*GetSubscriptionGrantOutput, error) { - req, out := c.GetSubscriptionGrantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSubscriptionRequestDetails = "GetSubscriptionRequestDetails" - -// GetSubscriptionRequestDetailsRequest generates a "aws/request.Request" representing the -// client's request for the GetSubscriptionRequestDetails 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 GetSubscriptionRequestDetails for more information on using the GetSubscriptionRequestDetails -// 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 GetSubscriptionRequestDetailsRequest method. -// req, resp := client.GetSubscriptionRequestDetailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetSubscriptionRequestDetails -func (c *DataZone) GetSubscriptionRequestDetailsRequest(input *GetSubscriptionRequestDetailsInput) (req *request.Request, output *GetSubscriptionRequestDetailsOutput) { - op := &request.Operation{ - Name: opGetSubscriptionRequestDetails, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-requests/{identifier}", - } - - if input == nil { - input = &GetSubscriptionRequestDetailsInput{} - } - - output = &GetSubscriptionRequestDetailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSubscriptionRequestDetails API operation for Amazon DataZone. -// -// Gets the details of the specified subscription request. -// -// 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 DataZone's -// API operation GetSubscriptionRequestDetails for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetSubscriptionRequestDetails -func (c *DataZone) GetSubscriptionRequestDetails(input *GetSubscriptionRequestDetailsInput) (*GetSubscriptionRequestDetailsOutput, error) { - req, out := c.GetSubscriptionRequestDetailsRequest(input) - return out, req.Send() -} - -// GetSubscriptionRequestDetailsWithContext is the same as GetSubscriptionRequestDetails with the addition of -// the ability to pass a context and additional request options. -// -// See GetSubscriptionRequestDetails 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 *DataZone) GetSubscriptionRequestDetailsWithContext(ctx aws.Context, input *GetSubscriptionRequestDetailsInput, opts ...request.Option) (*GetSubscriptionRequestDetailsOutput, error) { - req, out := c.GetSubscriptionRequestDetailsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSubscriptionTarget = "GetSubscriptionTarget" - -// GetSubscriptionTargetRequest generates a "aws/request.Request" representing the -// client's request for the GetSubscriptionTarget 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 GetSubscriptionTarget for more information on using the GetSubscriptionTarget -// 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 GetSubscriptionTargetRequest method. -// req, resp := client.GetSubscriptionTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetSubscriptionTarget -func (c *DataZone) GetSubscriptionTargetRequest(input *GetSubscriptionTargetInput) (req *request.Request, output *GetSubscriptionTargetOutput) { - op := &request.Operation{ - Name: opGetSubscriptionTarget, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environments/{environmentIdentifier}/subscription-targets/{identifier}", - } - - if input == nil { - input = &GetSubscriptionTargetInput{} - } - - output = &GetSubscriptionTargetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSubscriptionTarget API operation for Amazon DataZone. -// -// Gets the subscription target in Amazon DataZone. -// -// 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 DataZone's -// API operation GetSubscriptionTarget for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetSubscriptionTarget -func (c *DataZone) GetSubscriptionTarget(input *GetSubscriptionTargetInput) (*GetSubscriptionTargetOutput, error) { - req, out := c.GetSubscriptionTargetRequest(input) - return out, req.Send() -} - -// GetSubscriptionTargetWithContext is the same as GetSubscriptionTarget with the addition of -// the ability to pass a context and additional request options. -// -// See GetSubscriptionTarget 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 *DataZone) GetSubscriptionTargetWithContext(ctx aws.Context, input *GetSubscriptionTargetInput, opts ...request.Option) (*GetSubscriptionTargetOutput, error) { - req, out := c.GetSubscriptionTargetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetUserProfile = "GetUserProfile" - -// GetUserProfileRequest generates a "aws/request.Request" representing the -// client's request for the GetUserProfile 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 GetUserProfile for more information on using the GetUserProfile -// 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 GetUserProfileRequest method. -// req, resp := client.GetUserProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetUserProfile -func (c *DataZone) GetUserProfileRequest(input *GetUserProfileInput) (req *request.Request, output *GetUserProfileOutput) { - op := &request.Operation{ - Name: opGetUserProfile, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/user-profiles/{userIdentifier}", - } - - if input == nil { - input = &GetUserProfileInput{} - } - - output = &GetUserProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetUserProfile API operation for Amazon DataZone. -// -// Gets a user profile in Amazon DataZone. -// -// 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 DataZone's -// API operation GetUserProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/GetUserProfile -func (c *DataZone) GetUserProfile(input *GetUserProfileInput) (*GetUserProfileOutput, error) { - req, out := c.GetUserProfileRequest(input) - return out, req.Send() -} - -// GetUserProfileWithContext is the same as GetUserProfile with the addition of -// the ability to pass a context and additional request options. -// -// See GetUserProfile 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 *DataZone) GetUserProfileWithContext(ctx aws.Context, input *GetUserProfileInput, opts ...request.Option) (*GetUserProfileOutput, error) { - req, out := c.GetUserProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAssetRevisions = "ListAssetRevisions" - -// ListAssetRevisionsRequest generates a "aws/request.Request" representing the -// client's request for the ListAssetRevisions 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 ListAssetRevisions for more information on using the ListAssetRevisions -// 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 ListAssetRevisionsRequest method. -// req, resp := client.ListAssetRevisionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListAssetRevisions -func (c *DataZone) ListAssetRevisionsRequest(input *ListAssetRevisionsInput) (req *request.Request, output *ListAssetRevisionsOutput) { - op := &request.Operation{ - Name: opListAssetRevisions, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/assets/{identifier}/revisions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAssetRevisionsInput{} - } - - output = &ListAssetRevisionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssetRevisions API operation for Amazon DataZone. -// -// Lists the revisions for the asset. -// -// 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 DataZone's -// API operation ListAssetRevisions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListAssetRevisions -func (c *DataZone) ListAssetRevisions(input *ListAssetRevisionsInput) (*ListAssetRevisionsOutput, error) { - req, out := c.ListAssetRevisionsRequest(input) - return out, req.Send() -} - -// ListAssetRevisionsWithContext is the same as ListAssetRevisions with the addition of -// the ability to pass a context and additional request options. -// -// See ListAssetRevisions 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 *DataZone) ListAssetRevisionsWithContext(ctx aws.Context, input *ListAssetRevisionsInput, opts ...request.Option) (*ListAssetRevisionsOutput, error) { - req, out := c.ListAssetRevisionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAssetRevisionsPages iterates over the pages of a ListAssetRevisions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssetRevisions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAssetRevisions operation. -// pageNum := 0 -// err := client.ListAssetRevisionsPages(params, -// func(page *datazone.ListAssetRevisionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListAssetRevisionsPages(input *ListAssetRevisionsInput, fn func(*ListAssetRevisionsOutput, bool) bool) error { - return c.ListAssetRevisionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssetRevisionsPagesWithContext same as ListAssetRevisionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListAssetRevisionsPagesWithContext(ctx aws.Context, input *ListAssetRevisionsInput, fn func(*ListAssetRevisionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAssetRevisionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAssetRevisionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAssetRevisionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataSourceRunActivities = "ListDataSourceRunActivities" - -// ListDataSourceRunActivitiesRequest generates a "aws/request.Request" representing the -// client's request for the ListDataSourceRunActivities 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 ListDataSourceRunActivities for more information on using the ListDataSourceRunActivities -// 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 ListDataSourceRunActivitiesRequest method. -// req, resp := client.ListDataSourceRunActivitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListDataSourceRunActivities -func (c *DataZone) ListDataSourceRunActivitiesRequest(input *ListDataSourceRunActivitiesInput) (req *request.Request, output *ListDataSourceRunActivitiesOutput) { - op := &request.Operation{ - Name: opListDataSourceRunActivities, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/data-source-runs/{identifier}/activities", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataSourceRunActivitiesInput{} - } - - output = &ListDataSourceRunActivitiesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataSourceRunActivities API operation for Amazon DataZone. -// -// Lists data source run activities. -// -// 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 DataZone's -// API operation ListDataSourceRunActivities for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListDataSourceRunActivities -func (c *DataZone) ListDataSourceRunActivities(input *ListDataSourceRunActivitiesInput) (*ListDataSourceRunActivitiesOutput, error) { - req, out := c.ListDataSourceRunActivitiesRequest(input) - return out, req.Send() -} - -// ListDataSourceRunActivitiesWithContext is the same as ListDataSourceRunActivities with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataSourceRunActivities 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 *DataZone) ListDataSourceRunActivitiesWithContext(ctx aws.Context, input *ListDataSourceRunActivitiesInput, opts ...request.Option) (*ListDataSourceRunActivitiesOutput, error) { - req, out := c.ListDataSourceRunActivitiesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataSourceRunActivitiesPages iterates over the pages of a ListDataSourceRunActivities operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataSourceRunActivities method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataSourceRunActivities operation. -// pageNum := 0 -// err := client.ListDataSourceRunActivitiesPages(params, -// func(page *datazone.ListDataSourceRunActivitiesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListDataSourceRunActivitiesPages(input *ListDataSourceRunActivitiesInput, fn func(*ListDataSourceRunActivitiesOutput, bool) bool) error { - return c.ListDataSourceRunActivitiesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataSourceRunActivitiesPagesWithContext same as ListDataSourceRunActivitiesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListDataSourceRunActivitiesPagesWithContext(ctx aws.Context, input *ListDataSourceRunActivitiesInput, fn func(*ListDataSourceRunActivitiesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataSourceRunActivitiesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataSourceRunActivitiesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataSourceRunActivitiesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataSourceRuns = "ListDataSourceRuns" - -// ListDataSourceRunsRequest generates a "aws/request.Request" representing the -// client's request for the ListDataSourceRuns 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 ListDataSourceRuns for more information on using the ListDataSourceRuns -// 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 ListDataSourceRunsRequest method. -// req, resp := client.ListDataSourceRunsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListDataSourceRuns -func (c *DataZone) ListDataSourceRunsRequest(input *ListDataSourceRunsInput) (req *request.Request, output *ListDataSourceRunsOutput) { - op := &request.Operation{ - Name: opListDataSourceRuns, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/data-sources/{dataSourceIdentifier}/runs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataSourceRunsInput{} - } - - output = &ListDataSourceRunsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataSourceRuns API operation for Amazon DataZone. -// -// Lists data source runs in Amazon DataZone. -// -// 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 DataZone's -// API operation ListDataSourceRuns for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListDataSourceRuns -func (c *DataZone) ListDataSourceRuns(input *ListDataSourceRunsInput) (*ListDataSourceRunsOutput, error) { - req, out := c.ListDataSourceRunsRequest(input) - return out, req.Send() -} - -// ListDataSourceRunsWithContext is the same as ListDataSourceRuns with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataSourceRuns 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 *DataZone) ListDataSourceRunsWithContext(ctx aws.Context, input *ListDataSourceRunsInput, opts ...request.Option) (*ListDataSourceRunsOutput, error) { - req, out := c.ListDataSourceRunsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataSourceRunsPages iterates over the pages of a ListDataSourceRuns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataSourceRuns method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataSourceRuns operation. -// pageNum := 0 -// err := client.ListDataSourceRunsPages(params, -// func(page *datazone.ListDataSourceRunsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListDataSourceRunsPages(input *ListDataSourceRunsInput, fn func(*ListDataSourceRunsOutput, bool) bool) error { - return c.ListDataSourceRunsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataSourceRunsPagesWithContext same as ListDataSourceRunsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListDataSourceRunsPagesWithContext(ctx aws.Context, input *ListDataSourceRunsInput, fn func(*ListDataSourceRunsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataSourceRunsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataSourceRunsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataSourceRunsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataSources = "ListDataSources" - -// ListDataSourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListDataSources 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 ListDataSources for more information on using the ListDataSources -// 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 ListDataSourcesRequest method. -// req, resp := client.ListDataSourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListDataSources -func (c *DataZone) ListDataSourcesRequest(input *ListDataSourcesInput) (req *request.Request, output *ListDataSourcesOutput) { - op := &request.Operation{ - Name: opListDataSources, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/data-sources", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataSourcesInput{} - } - - output = &ListDataSourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataSources API operation for Amazon DataZone. -// -// Lists data sources in Amazon DataZone. -// -// 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 DataZone's -// API operation ListDataSources for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListDataSources -func (c *DataZone) ListDataSources(input *ListDataSourcesInput) (*ListDataSourcesOutput, error) { - req, out := c.ListDataSourcesRequest(input) - return out, req.Send() -} - -// ListDataSourcesWithContext is the same as ListDataSources with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataSources 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 *DataZone) ListDataSourcesWithContext(ctx aws.Context, input *ListDataSourcesInput, opts ...request.Option) (*ListDataSourcesOutput, error) { - req, out := c.ListDataSourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataSourcesPages iterates over the pages of a ListDataSources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataSources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataSources operation. -// pageNum := 0 -// err := client.ListDataSourcesPages(params, -// func(page *datazone.ListDataSourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListDataSourcesPages(input *ListDataSourcesInput, fn func(*ListDataSourcesOutput, bool) bool) error { - return c.ListDataSourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataSourcesPagesWithContext same as ListDataSourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListDataSourcesPagesWithContext(ctx aws.Context, input *ListDataSourcesInput, fn func(*ListDataSourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataSourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataSourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataSourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDomains = "ListDomains" - -// ListDomainsRequest generates a "aws/request.Request" representing the -// client's request for the ListDomains 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 ListDomains for more information on using the ListDomains -// 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 ListDomainsRequest method. -// req, resp := client.ListDomainsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListDomains -func (c *DataZone) ListDomainsRequest(input *ListDomainsInput) (req *request.Request, output *ListDomainsOutput) { - op := &request.Operation{ - Name: opListDomains, - HTTPMethod: "GET", - HTTPPath: "/v2/domains", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDomainsInput{} - } - - output = &ListDomainsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDomains API operation for Amazon DataZone. -// -// Lists Amazon DataZone domains. -// -// 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 DataZone's -// API operation ListDomains for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListDomains -func (c *DataZone) ListDomains(input *ListDomainsInput) (*ListDomainsOutput, error) { - req, out := c.ListDomainsRequest(input) - return out, req.Send() -} - -// ListDomainsWithContext is the same as ListDomains with the addition of -// the ability to pass a context and additional request options. -// -// See ListDomains 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 *DataZone) ListDomainsWithContext(ctx aws.Context, input *ListDomainsInput, opts ...request.Option) (*ListDomainsOutput, error) { - req, out := c.ListDomainsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDomainsPages iterates over the pages of a ListDomains operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDomains method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDomains operation. -// pageNum := 0 -// err := client.ListDomainsPages(params, -// func(page *datazone.ListDomainsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListDomainsPages(input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool) error { - return c.ListDomainsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDomainsPagesWithContext same as ListDomainsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDomainsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDomainsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEnvironmentBlueprintConfigurations = "ListEnvironmentBlueprintConfigurations" - -// ListEnvironmentBlueprintConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListEnvironmentBlueprintConfigurations 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 ListEnvironmentBlueprintConfigurations for more information on using the ListEnvironmentBlueprintConfigurations -// 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 ListEnvironmentBlueprintConfigurationsRequest method. -// req, resp := client.ListEnvironmentBlueprintConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListEnvironmentBlueprintConfigurations -func (c *DataZone) ListEnvironmentBlueprintConfigurationsRequest(input *ListEnvironmentBlueprintConfigurationsInput) (req *request.Request, output *ListEnvironmentBlueprintConfigurationsOutput) { - op := &request.Operation{ - Name: opListEnvironmentBlueprintConfigurations, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-blueprint-configurations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEnvironmentBlueprintConfigurationsInput{} - } - - output = &ListEnvironmentBlueprintConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEnvironmentBlueprintConfigurations API operation for Amazon DataZone. -// -// Lists blueprint configurations for a Amazon DataZone environment. -// -// 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 DataZone's -// API operation ListEnvironmentBlueprintConfigurations for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListEnvironmentBlueprintConfigurations -func (c *DataZone) ListEnvironmentBlueprintConfigurations(input *ListEnvironmentBlueprintConfigurationsInput) (*ListEnvironmentBlueprintConfigurationsOutput, error) { - req, out := c.ListEnvironmentBlueprintConfigurationsRequest(input) - return out, req.Send() -} - -// ListEnvironmentBlueprintConfigurationsWithContext is the same as ListEnvironmentBlueprintConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListEnvironmentBlueprintConfigurations 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 *DataZone) ListEnvironmentBlueprintConfigurationsWithContext(ctx aws.Context, input *ListEnvironmentBlueprintConfigurationsInput, opts ...request.Option) (*ListEnvironmentBlueprintConfigurationsOutput, error) { - req, out := c.ListEnvironmentBlueprintConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEnvironmentBlueprintConfigurationsPages iterates over the pages of a ListEnvironmentBlueprintConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnvironmentBlueprintConfigurations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEnvironmentBlueprintConfigurations operation. -// pageNum := 0 -// err := client.ListEnvironmentBlueprintConfigurationsPages(params, -// func(page *datazone.ListEnvironmentBlueprintConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListEnvironmentBlueprintConfigurationsPages(input *ListEnvironmentBlueprintConfigurationsInput, fn func(*ListEnvironmentBlueprintConfigurationsOutput, bool) bool) error { - return c.ListEnvironmentBlueprintConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnvironmentBlueprintConfigurationsPagesWithContext same as ListEnvironmentBlueprintConfigurationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListEnvironmentBlueprintConfigurationsPagesWithContext(ctx aws.Context, input *ListEnvironmentBlueprintConfigurationsInput, fn func(*ListEnvironmentBlueprintConfigurationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEnvironmentBlueprintConfigurationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEnvironmentBlueprintConfigurationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEnvironmentBlueprintConfigurationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEnvironmentBlueprints = "ListEnvironmentBlueprints" - -// ListEnvironmentBlueprintsRequest generates a "aws/request.Request" representing the -// client's request for the ListEnvironmentBlueprints 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 ListEnvironmentBlueprints for more information on using the ListEnvironmentBlueprints -// 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 ListEnvironmentBlueprintsRequest method. -// req, resp := client.ListEnvironmentBlueprintsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListEnvironmentBlueprints -func (c *DataZone) ListEnvironmentBlueprintsRequest(input *ListEnvironmentBlueprintsInput) (req *request.Request, output *ListEnvironmentBlueprintsOutput) { - op := &request.Operation{ - Name: opListEnvironmentBlueprints, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-blueprints", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEnvironmentBlueprintsInput{} - } - - output = &ListEnvironmentBlueprintsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEnvironmentBlueprints API operation for Amazon DataZone. -// -// Lists blueprints in an Amazon DataZone environment. -// -// 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 DataZone's -// API operation ListEnvironmentBlueprints for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListEnvironmentBlueprints -func (c *DataZone) ListEnvironmentBlueprints(input *ListEnvironmentBlueprintsInput) (*ListEnvironmentBlueprintsOutput, error) { - req, out := c.ListEnvironmentBlueprintsRequest(input) - return out, req.Send() -} - -// ListEnvironmentBlueprintsWithContext is the same as ListEnvironmentBlueprints with the addition of -// the ability to pass a context and additional request options. -// -// See ListEnvironmentBlueprints 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 *DataZone) ListEnvironmentBlueprintsWithContext(ctx aws.Context, input *ListEnvironmentBlueprintsInput, opts ...request.Option) (*ListEnvironmentBlueprintsOutput, error) { - req, out := c.ListEnvironmentBlueprintsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEnvironmentBlueprintsPages iterates over the pages of a ListEnvironmentBlueprints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnvironmentBlueprints method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEnvironmentBlueprints operation. -// pageNum := 0 -// err := client.ListEnvironmentBlueprintsPages(params, -// func(page *datazone.ListEnvironmentBlueprintsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListEnvironmentBlueprintsPages(input *ListEnvironmentBlueprintsInput, fn func(*ListEnvironmentBlueprintsOutput, bool) bool) error { - return c.ListEnvironmentBlueprintsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnvironmentBlueprintsPagesWithContext same as ListEnvironmentBlueprintsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListEnvironmentBlueprintsPagesWithContext(ctx aws.Context, input *ListEnvironmentBlueprintsInput, fn func(*ListEnvironmentBlueprintsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEnvironmentBlueprintsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEnvironmentBlueprintsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEnvironmentBlueprintsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEnvironmentProfiles = "ListEnvironmentProfiles" - -// ListEnvironmentProfilesRequest generates a "aws/request.Request" representing the -// client's request for the ListEnvironmentProfiles 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 ListEnvironmentProfiles for more information on using the ListEnvironmentProfiles -// 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 ListEnvironmentProfilesRequest method. -// req, resp := client.ListEnvironmentProfilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListEnvironmentProfiles -func (c *DataZone) ListEnvironmentProfilesRequest(input *ListEnvironmentProfilesInput) (req *request.Request, output *ListEnvironmentProfilesOutput) { - op := &request.Operation{ - Name: opListEnvironmentProfiles, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-profiles", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEnvironmentProfilesInput{} - } - - output = &ListEnvironmentProfilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEnvironmentProfiles API operation for Amazon DataZone. -// -// Lists Amazon DataZone environment profiles. -// -// 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 DataZone's -// API operation ListEnvironmentProfiles for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListEnvironmentProfiles -func (c *DataZone) ListEnvironmentProfiles(input *ListEnvironmentProfilesInput) (*ListEnvironmentProfilesOutput, error) { - req, out := c.ListEnvironmentProfilesRequest(input) - return out, req.Send() -} - -// ListEnvironmentProfilesWithContext is the same as ListEnvironmentProfiles with the addition of -// the ability to pass a context and additional request options. -// -// See ListEnvironmentProfiles 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 *DataZone) ListEnvironmentProfilesWithContext(ctx aws.Context, input *ListEnvironmentProfilesInput, opts ...request.Option) (*ListEnvironmentProfilesOutput, error) { - req, out := c.ListEnvironmentProfilesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEnvironmentProfilesPages iterates over the pages of a ListEnvironmentProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnvironmentProfiles method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEnvironmentProfiles operation. -// pageNum := 0 -// err := client.ListEnvironmentProfilesPages(params, -// func(page *datazone.ListEnvironmentProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListEnvironmentProfilesPages(input *ListEnvironmentProfilesInput, fn func(*ListEnvironmentProfilesOutput, bool) bool) error { - return c.ListEnvironmentProfilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnvironmentProfilesPagesWithContext same as ListEnvironmentProfilesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListEnvironmentProfilesPagesWithContext(ctx aws.Context, input *ListEnvironmentProfilesInput, fn func(*ListEnvironmentProfilesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEnvironmentProfilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEnvironmentProfilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEnvironmentProfilesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEnvironments = "ListEnvironments" - -// ListEnvironmentsRequest generates a "aws/request.Request" representing the -// client's request for the ListEnvironments 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 ListEnvironments for more information on using the ListEnvironments -// 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 ListEnvironmentsRequest method. -// req, resp := client.ListEnvironmentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListEnvironments -func (c *DataZone) ListEnvironmentsRequest(input *ListEnvironmentsInput) (req *request.Request, output *ListEnvironmentsOutput) { - op := &request.Operation{ - Name: opListEnvironments, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environments", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEnvironmentsInput{} - } - - output = &ListEnvironmentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEnvironments API operation for Amazon DataZone. -// -// Lists Amazon DataZone environments. -// -// 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 DataZone's -// API operation ListEnvironments for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListEnvironments -func (c *DataZone) ListEnvironments(input *ListEnvironmentsInput) (*ListEnvironmentsOutput, error) { - req, out := c.ListEnvironmentsRequest(input) - return out, req.Send() -} - -// ListEnvironmentsWithContext is the same as ListEnvironments with the addition of -// the ability to pass a context and additional request options. -// -// See ListEnvironments 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 *DataZone) ListEnvironmentsWithContext(ctx aws.Context, input *ListEnvironmentsInput, opts ...request.Option) (*ListEnvironmentsOutput, error) { - req, out := c.ListEnvironmentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEnvironmentsPages iterates over the pages of a ListEnvironments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnvironments method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEnvironments operation. -// pageNum := 0 -// err := client.ListEnvironmentsPages(params, -// func(page *datazone.ListEnvironmentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListEnvironmentsPages(input *ListEnvironmentsInput, fn func(*ListEnvironmentsOutput, bool) bool) error { - return c.ListEnvironmentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnvironmentsPagesWithContext same as ListEnvironmentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListEnvironmentsPagesWithContext(ctx aws.Context, input *ListEnvironmentsInput, fn func(*ListEnvironmentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEnvironmentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEnvironmentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEnvironmentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListNotifications = "ListNotifications" - -// ListNotificationsRequest generates a "aws/request.Request" representing the -// client's request for the ListNotifications 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 ListNotifications for more information on using the ListNotifications -// 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 ListNotificationsRequest method. -// req, resp := client.ListNotificationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListNotifications -func (c *DataZone) ListNotificationsRequest(input *ListNotificationsInput) (req *request.Request, output *ListNotificationsOutput) { - op := &request.Operation{ - Name: opListNotifications, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/notifications", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListNotificationsInput{} - } - - output = &ListNotificationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListNotifications API operation for Amazon DataZone. -// -// Lists all Amazon DataZone notifications. -// -// 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 DataZone's -// API operation ListNotifications for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListNotifications -func (c *DataZone) ListNotifications(input *ListNotificationsInput) (*ListNotificationsOutput, error) { - req, out := c.ListNotificationsRequest(input) - return out, req.Send() -} - -// ListNotificationsWithContext is the same as ListNotifications with the addition of -// the ability to pass a context and additional request options. -// -// See ListNotifications 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 *DataZone) ListNotificationsWithContext(ctx aws.Context, input *ListNotificationsInput, opts ...request.Option) (*ListNotificationsOutput, error) { - req, out := c.ListNotificationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListNotificationsPages iterates over the pages of a ListNotifications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNotifications method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListNotifications operation. -// pageNum := 0 -// err := client.ListNotificationsPages(params, -// func(page *datazone.ListNotificationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListNotificationsPages(input *ListNotificationsInput, fn func(*ListNotificationsOutput, bool) bool) error { - return c.ListNotificationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNotificationsPagesWithContext same as ListNotificationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListNotificationsPagesWithContext(ctx aws.Context, input *ListNotificationsInput, fn func(*ListNotificationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListNotificationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListNotificationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListNotificationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProjectMemberships = "ListProjectMemberships" - -// ListProjectMembershipsRequest generates a "aws/request.Request" representing the -// client's request for the ListProjectMemberships 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 ListProjectMemberships for more information on using the ListProjectMemberships -// 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 ListProjectMembershipsRequest method. -// req, resp := client.ListProjectMembershipsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListProjectMemberships -func (c *DataZone) ListProjectMembershipsRequest(input *ListProjectMembershipsInput) (req *request.Request, output *ListProjectMembershipsOutput) { - op := &request.Operation{ - Name: opListProjectMemberships, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/projects/{projectIdentifier}/memberships", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProjectMembershipsInput{} - } - - output = &ListProjectMembershipsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProjectMemberships API operation for Amazon DataZone. -// -// Lists all members of the specified project. -// -// 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 DataZone's -// API operation ListProjectMemberships for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListProjectMemberships -func (c *DataZone) ListProjectMemberships(input *ListProjectMembershipsInput) (*ListProjectMembershipsOutput, error) { - req, out := c.ListProjectMembershipsRequest(input) - return out, req.Send() -} - -// ListProjectMembershipsWithContext is the same as ListProjectMemberships with the addition of -// the ability to pass a context and additional request options. -// -// See ListProjectMemberships 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 *DataZone) ListProjectMembershipsWithContext(ctx aws.Context, input *ListProjectMembershipsInput, opts ...request.Option) (*ListProjectMembershipsOutput, error) { - req, out := c.ListProjectMembershipsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProjectMembershipsPages iterates over the pages of a ListProjectMemberships operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProjectMemberships method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProjectMemberships operation. -// pageNum := 0 -// err := client.ListProjectMembershipsPages(params, -// func(page *datazone.ListProjectMembershipsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListProjectMembershipsPages(input *ListProjectMembershipsInput, fn func(*ListProjectMembershipsOutput, bool) bool) error { - return c.ListProjectMembershipsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProjectMembershipsPagesWithContext same as ListProjectMembershipsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListProjectMembershipsPagesWithContext(ctx aws.Context, input *ListProjectMembershipsInput, fn func(*ListProjectMembershipsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProjectMembershipsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProjectMembershipsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProjectMembershipsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProjects = "ListProjects" - -// ListProjectsRequest generates a "aws/request.Request" representing the -// client's request for the ListProjects 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 ListProjects for more information on using the ListProjects -// 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 ListProjectsRequest method. -// req, resp := client.ListProjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListProjects -func (c *DataZone) ListProjectsRequest(input *ListProjectsInput) (req *request.Request, output *ListProjectsOutput) { - op := &request.Operation{ - Name: opListProjects, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/projects", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProjectsInput{} - } - - output = &ListProjectsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProjects API operation for Amazon DataZone. -// -// Lists Amazon DataZone projects. -// -// 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 DataZone's -// API operation ListProjects for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListProjects -func (c *DataZone) ListProjects(input *ListProjectsInput) (*ListProjectsOutput, error) { - req, out := c.ListProjectsRequest(input) - return out, req.Send() -} - -// ListProjectsWithContext is the same as ListProjects with the addition of -// the ability to pass a context and additional request options. -// -// See ListProjects 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 *DataZone) ListProjectsWithContext(ctx aws.Context, input *ListProjectsInput, opts ...request.Option) (*ListProjectsOutput, error) { - req, out := c.ListProjectsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProjectsPages iterates over the pages of a ListProjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProjects method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProjects operation. -// pageNum := 0 -// err := client.ListProjectsPages(params, -// func(page *datazone.ListProjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListProjectsPages(input *ListProjectsInput, fn func(*ListProjectsOutput, bool) bool) error { - return c.ListProjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProjectsPagesWithContext same as ListProjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListProjectsPagesWithContext(ctx aws.Context, input *ListProjectsInput, fn func(*ListProjectsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProjectsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSubscriptionGrants = "ListSubscriptionGrants" - -// ListSubscriptionGrantsRequest generates a "aws/request.Request" representing the -// client's request for the ListSubscriptionGrants 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 ListSubscriptionGrants for more information on using the ListSubscriptionGrants -// 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 ListSubscriptionGrantsRequest method. -// req, resp := client.ListSubscriptionGrantsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptionGrants -func (c *DataZone) ListSubscriptionGrantsRequest(input *ListSubscriptionGrantsInput) (req *request.Request, output *ListSubscriptionGrantsOutput) { - op := &request.Operation{ - Name: opListSubscriptionGrants, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-grants", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSubscriptionGrantsInput{} - } - - output = &ListSubscriptionGrantsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSubscriptionGrants API operation for Amazon DataZone. -// -// Lists subscription grants. -// -// 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 DataZone's -// API operation ListSubscriptionGrants for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptionGrants -func (c *DataZone) ListSubscriptionGrants(input *ListSubscriptionGrantsInput) (*ListSubscriptionGrantsOutput, error) { - req, out := c.ListSubscriptionGrantsRequest(input) - return out, req.Send() -} - -// ListSubscriptionGrantsWithContext is the same as ListSubscriptionGrants with the addition of -// the ability to pass a context and additional request options. -// -// See ListSubscriptionGrants 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 *DataZone) ListSubscriptionGrantsWithContext(ctx aws.Context, input *ListSubscriptionGrantsInput, opts ...request.Option) (*ListSubscriptionGrantsOutput, error) { - req, out := c.ListSubscriptionGrantsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSubscriptionGrantsPages iterates over the pages of a ListSubscriptionGrants operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscriptionGrants method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSubscriptionGrants operation. -// pageNum := 0 -// err := client.ListSubscriptionGrantsPages(params, -// func(page *datazone.ListSubscriptionGrantsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListSubscriptionGrantsPages(input *ListSubscriptionGrantsInput, fn func(*ListSubscriptionGrantsOutput, bool) bool) error { - return c.ListSubscriptionGrantsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubscriptionGrantsPagesWithContext same as ListSubscriptionGrantsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListSubscriptionGrantsPagesWithContext(ctx aws.Context, input *ListSubscriptionGrantsInput, fn func(*ListSubscriptionGrantsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSubscriptionGrantsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSubscriptionGrantsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSubscriptionGrantsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSubscriptionRequests = "ListSubscriptionRequests" - -// ListSubscriptionRequestsRequest generates a "aws/request.Request" representing the -// client's request for the ListSubscriptionRequests 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 ListSubscriptionRequests for more information on using the ListSubscriptionRequests -// 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 ListSubscriptionRequestsRequest method. -// req, resp := client.ListSubscriptionRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptionRequests -func (c *DataZone) ListSubscriptionRequestsRequest(input *ListSubscriptionRequestsInput) (req *request.Request, output *ListSubscriptionRequestsOutput) { - op := &request.Operation{ - Name: opListSubscriptionRequests, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-requests", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSubscriptionRequestsInput{} - } - - output = &ListSubscriptionRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSubscriptionRequests API operation for Amazon DataZone. -// -// Lists Amazon DataZone subscription requests. -// -// 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 DataZone's -// API operation ListSubscriptionRequests for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptionRequests -func (c *DataZone) ListSubscriptionRequests(input *ListSubscriptionRequestsInput) (*ListSubscriptionRequestsOutput, error) { - req, out := c.ListSubscriptionRequestsRequest(input) - return out, req.Send() -} - -// ListSubscriptionRequestsWithContext is the same as ListSubscriptionRequests with the addition of -// the ability to pass a context and additional request options. -// -// See ListSubscriptionRequests 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 *DataZone) ListSubscriptionRequestsWithContext(ctx aws.Context, input *ListSubscriptionRequestsInput, opts ...request.Option) (*ListSubscriptionRequestsOutput, error) { - req, out := c.ListSubscriptionRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSubscriptionRequestsPages iterates over the pages of a ListSubscriptionRequests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscriptionRequests method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSubscriptionRequests operation. -// pageNum := 0 -// err := client.ListSubscriptionRequestsPages(params, -// func(page *datazone.ListSubscriptionRequestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListSubscriptionRequestsPages(input *ListSubscriptionRequestsInput, fn func(*ListSubscriptionRequestsOutput, bool) bool) error { - return c.ListSubscriptionRequestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubscriptionRequestsPagesWithContext same as ListSubscriptionRequestsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListSubscriptionRequestsPagesWithContext(ctx aws.Context, input *ListSubscriptionRequestsInput, fn func(*ListSubscriptionRequestsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSubscriptionRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSubscriptionRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSubscriptionRequestsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSubscriptionTargets = "ListSubscriptionTargets" - -// ListSubscriptionTargetsRequest generates a "aws/request.Request" representing the -// client's request for the ListSubscriptionTargets 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 ListSubscriptionTargets for more information on using the ListSubscriptionTargets -// 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 ListSubscriptionTargetsRequest method. -// req, resp := client.ListSubscriptionTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptionTargets -func (c *DataZone) ListSubscriptionTargetsRequest(input *ListSubscriptionTargetsInput) (req *request.Request, output *ListSubscriptionTargetsOutput) { - op := &request.Operation{ - Name: opListSubscriptionTargets, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/environments/{environmentIdentifier}/subscription-targets", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSubscriptionTargetsInput{} - } - - output = &ListSubscriptionTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSubscriptionTargets API operation for Amazon DataZone. -// -// Lists subscription targets in Amazon DataZone. -// -// 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 DataZone's -// API operation ListSubscriptionTargets for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptionTargets -func (c *DataZone) ListSubscriptionTargets(input *ListSubscriptionTargetsInput) (*ListSubscriptionTargetsOutput, error) { - req, out := c.ListSubscriptionTargetsRequest(input) - return out, req.Send() -} - -// ListSubscriptionTargetsWithContext is the same as ListSubscriptionTargets with the addition of -// the ability to pass a context and additional request options. -// -// See ListSubscriptionTargets 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 *DataZone) ListSubscriptionTargetsWithContext(ctx aws.Context, input *ListSubscriptionTargetsInput, opts ...request.Option) (*ListSubscriptionTargetsOutput, error) { - req, out := c.ListSubscriptionTargetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSubscriptionTargetsPages iterates over the pages of a ListSubscriptionTargets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscriptionTargets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSubscriptionTargets operation. -// pageNum := 0 -// err := client.ListSubscriptionTargetsPages(params, -// func(page *datazone.ListSubscriptionTargetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListSubscriptionTargetsPages(input *ListSubscriptionTargetsInput, fn func(*ListSubscriptionTargetsOutput, bool) bool) error { - return c.ListSubscriptionTargetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubscriptionTargetsPagesWithContext same as ListSubscriptionTargetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListSubscriptionTargetsPagesWithContext(ctx aws.Context, input *ListSubscriptionTargetsInput, fn func(*ListSubscriptionTargetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSubscriptionTargetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSubscriptionTargetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSubscriptionTargetsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSubscriptions = "ListSubscriptions" - -// ListSubscriptionsRequest generates a "aws/request.Request" representing the -// client's request for the ListSubscriptions 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 ListSubscriptions for more information on using the ListSubscriptions -// 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 ListSubscriptionsRequest method. -// req, resp := client.ListSubscriptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptions -func (c *DataZone) ListSubscriptionsRequest(input *ListSubscriptionsInput) (req *request.Request, output *ListSubscriptionsOutput) { - op := &request.Operation{ - Name: opListSubscriptions, - HTTPMethod: "GET", - HTTPPath: "/v2/domains/{domainIdentifier}/subscriptions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSubscriptionsInput{} - } - - output = &ListSubscriptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSubscriptions API operation for Amazon DataZone. -// -// Lists subscriptions in Amazon DataZone. -// -// 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 DataZone's -// API operation ListSubscriptions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListSubscriptions -func (c *DataZone) ListSubscriptions(input *ListSubscriptionsInput) (*ListSubscriptionsOutput, error) { - req, out := c.ListSubscriptionsRequest(input) - return out, req.Send() -} - -// ListSubscriptionsWithContext is the same as ListSubscriptions with the addition of -// the ability to pass a context and additional request options. -// -// See ListSubscriptions 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 *DataZone) ListSubscriptionsWithContext(ctx aws.Context, input *ListSubscriptionsInput, opts ...request.Option) (*ListSubscriptionsOutput, error) { - req, out := c.ListSubscriptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSubscriptionsPages iterates over the pages of a ListSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscriptions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSubscriptions operation. -// pageNum := 0 -// err := client.ListSubscriptionsPages(params, -// func(page *datazone.ListSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) ListSubscriptionsPages(input *ListSubscriptionsInput, fn func(*ListSubscriptionsOutput, bool) bool) error { - return c.ListSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubscriptionsPagesWithContext same as ListSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) ListSubscriptionsPagesWithContext(ctx aws.Context, input *ListSubscriptionsInput, fn func(*ListSubscriptionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSubscriptionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListTagsForResource -func (c *DataZone) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon DataZone. -// -// Lists tags for the specified resource in Amazon DataZone. -// -// 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 DataZone's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/ListTagsForResource -func (c *DataZone) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *DataZone) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutEnvironmentBlueprintConfiguration = "PutEnvironmentBlueprintConfiguration" - -// PutEnvironmentBlueprintConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutEnvironmentBlueprintConfiguration 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 PutEnvironmentBlueprintConfiguration for more information on using the PutEnvironmentBlueprintConfiguration -// 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 PutEnvironmentBlueprintConfigurationRequest method. -// req, resp := client.PutEnvironmentBlueprintConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/PutEnvironmentBlueprintConfiguration -func (c *DataZone) PutEnvironmentBlueprintConfigurationRequest(input *PutEnvironmentBlueprintConfigurationInput) (req *request.Request, output *PutEnvironmentBlueprintConfigurationOutput) { - op := &request.Operation{ - Name: opPutEnvironmentBlueprintConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-blueprint-configurations/{environmentBlueprintIdentifier}", - } - - if input == nil { - input = &PutEnvironmentBlueprintConfigurationInput{} - } - - output = &PutEnvironmentBlueprintConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutEnvironmentBlueprintConfiguration API operation for Amazon DataZone. -// -// Writes the configuration for the specified environment blueprint in Amazon -// DataZone. -// -// 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 DataZone's -// API operation PutEnvironmentBlueprintConfiguration for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/PutEnvironmentBlueprintConfiguration -func (c *DataZone) PutEnvironmentBlueprintConfiguration(input *PutEnvironmentBlueprintConfigurationInput) (*PutEnvironmentBlueprintConfigurationOutput, error) { - req, out := c.PutEnvironmentBlueprintConfigurationRequest(input) - return out, req.Send() -} - -// PutEnvironmentBlueprintConfigurationWithContext is the same as PutEnvironmentBlueprintConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutEnvironmentBlueprintConfiguration 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 *DataZone) PutEnvironmentBlueprintConfigurationWithContext(ctx aws.Context, input *PutEnvironmentBlueprintConfigurationInput, opts ...request.Option) (*PutEnvironmentBlueprintConfigurationOutput, error) { - req, out := c.PutEnvironmentBlueprintConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRejectPredictions = "RejectPredictions" - -// RejectPredictionsRequest generates a "aws/request.Request" representing the -// client's request for the RejectPredictions 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 RejectPredictions for more information on using the RejectPredictions -// 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 RejectPredictionsRequest method. -// req, resp := client.RejectPredictionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/RejectPredictions -func (c *DataZone) RejectPredictionsRequest(input *RejectPredictionsInput) (req *request.Request, output *RejectPredictionsOutput) { - op := &request.Operation{ - Name: opRejectPredictions, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/assets/{identifier}/reject-predictions", - } - - if input == nil { - input = &RejectPredictionsInput{} - } - - output = &RejectPredictionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RejectPredictions API operation for Amazon DataZone. -// -// Rejects automatically generated business-friendly metadata for your Amazon -// DataZone assets. -// -// 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 DataZone's -// API operation RejectPredictions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/RejectPredictions -func (c *DataZone) RejectPredictions(input *RejectPredictionsInput) (*RejectPredictionsOutput, error) { - req, out := c.RejectPredictionsRequest(input) - return out, req.Send() -} - -// RejectPredictionsWithContext is the same as RejectPredictions with the addition of -// the ability to pass a context and additional request options. -// -// See RejectPredictions 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 *DataZone) RejectPredictionsWithContext(ctx aws.Context, input *RejectPredictionsInput, opts ...request.Option) (*RejectPredictionsOutput, error) { - req, out := c.RejectPredictionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRejectSubscriptionRequest = "RejectSubscriptionRequest" - -// RejectSubscriptionRequestRequest generates a "aws/request.Request" representing the -// client's request for the RejectSubscriptionRequest 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 RejectSubscriptionRequest for more information on using the RejectSubscriptionRequest -// 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 RejectSubscriptionRequestRequest method. -// req, resp := client.RejectSubscriptionRequestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/RejectSubscriptionRequest -func (c *DataZone) RejectSubscriptionRequestRequest(input *RejectSubscriptionRequestInput) (req *request.Request, output *RejectSubscriptionRequestOutput) { - op := &request.Operation{ - Name: opRejectSubscriptionRequest, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-requests/{identifier}/reject", - } - - if input == nil { - input = &RejectSubscriptionRequestInput{} - } - - output = &RejectSubscriptionRequestOutput{} - req = c.newRequest(op, input, output) - return -} - -// RejectSubscriptionRequest API operation for Amazon DataZone. -// -// Rejects the specified subscription request. -// -// 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 DataZone's -// API operation RejectSubscriptionRequest for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/RejectSubscriptionRequest -func (c *DataZone) RejectSubscriptionRequest(input *RejectSubscriptionRequestInput) (*RejectSubscriptionRequestOutput, error) { - req, out := c.RejectSubscriptionRequestRequest(input) - return out, req.Send() -} - -// RejectSubscriptionRequestWithContext is the same as RejectSubscriptionRequest with the addition of -// the ability to pass a context and additional request options. -// -// See RejectSubscriptionRequest 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 *DataZone) RejectSubscriptionRequestWithContext(ctx aws.Context, input *RejectSubscriptionRequestInput, opts ...request.Option) (*RejectSubscriptionRequestOutput, error) { - req, out := c.RejectSubscriptionRequestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRevokeSubscription = "RevokeSubscription" - -// RevokeSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the RevokeSubscription 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 RevokeSubscription for more information on using the RevokeSubscription -// 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 RevokeSubscriptionRequest method. -// req, resp := client.RevokeSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/RevokeSubscription -func (c *DataZone) RevokeSubscriptionRequest(input *RevokeSubscriptionInput) (req *request.Request, output *RevokeSubscriptionOutput) { - op := &request.Operation{ - Name: opRevokeSubscription, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/subscriptions/{identifier}/revoke", - } - - if input == nil { - input = &RevokeSubscriptionInput{} - } - - output = &RevokeSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// RevokeSubscription API operation for Amazon DataZone. -// -// Revokes a specified subscription in Amazon DataZone. -// -// 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 DataZone's -// API operation RevokeSubscription for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/RevokeSubscription -func (c *DataZone) RevokeSubscription(input *RevokeSubscriptionInput) (*RevokeSubscriptionOutput, error) { - req, out := c.RevokeSubscriptionRequest(input) - return out, req.Send() -} - -// RevokeSubscriptionWithContext is the same as RevokeSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See RevokeSubscription 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 *DataZone) RevokeSubscriptionWithContext(ctx aws.Context, input *RevokeSubscriptionInput, opts ...request.Option) (*RevokeSubscriptionOutput, error) { - req, out := c.RevokeSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSearch = "Search" - -// SearchRequest generates a "aws/request.Request" representing the -// client's request for the Search 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 Search for more information on using the Search -// 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 SearchRequest method. -// req, resp := client.SearchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/Search -func (c *DataZone) SearchRequest(input *SearchInput) (req *request.Request, output *SearchOutput) { - op := &request.Operation{ - Name: opSearch, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/search", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchInput{} - } - - output = &SearchOutput{} - req = c.newRequest(op, input, output) - return -} - -// Search API operation for Amazon DataZone. -// -// Searches for assets in Amazon DataZone. -// -// 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 DataZone's -// API operation Search for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/Search -func (c *DataZone) Search(input *SearchInput) (*SearchOutput, error) { - req, out := c.SearchRequest(input) - return out, req.Send() -} - -// SearchWithContext is the same as Search with the addition of -// the ability to pass a context and additional request options. -// -// See Search 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 *DataZone) SearchWithContext(ctx aws.Context, input *SearchInput, opts ...request.Option) (*SearchOutput, error) { - req, out := c.SearchRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchPages iterates over the pages of a Search operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Search method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a Search operation. -// pageNum := 0 -// err := client.SearchPages(params, -// func(page *datazone.SearchOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) SearchPages(input *SearchInput, fn func(*SearchOutput, bool) bool) error { - return c.SearchPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchPagesWithContext same as SearchPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) SearchPagesWithContext(ctx aws.Context, input *SearchInput, fn func(*SearchOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearchGroupProfiles = "SearchGroupProfiles" - -// SearchGroupProfilesRequest generates a "aws/request.Request" representing the -// client's request for the SearchGroupProfiles 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 SearchGroupProfiles for more information on using the SearchGroupProfiles -// 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 SearchGroupProfilesRequest method. -// req, resp := client.SearchGroupProfilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/SearchGroupProfiles -func (c *DataZone) SearchGroupProfilesRequest(input *SearchGroupProfilesInput) (req *request.Request, output *SearchGroupProfilesOutput) { - op := &request.Operation{ - Name: opSearchGroupProfiles, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/search-group-profiles", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchGroupProfilesInput{} - } - - output = &SearchGroupProfilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchGroupProfiles API operation for Amazon DataZone. -// -// Searches group profiles in Amazon DataZone. -// -// 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 DataZone's -// API operation SearchGroupProfiles for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/SearchGroupProfiles -func (c *DataZone) SearchGroupProfiles(input *SearchGroupProfilesInput) (*SearchGroupProfilesOutput, error) { - req, out := c.SearchGroupProfilesRequest(input) - return out, req.Send() -} - -// SearchGroupProfilesWithContext is the same as SearchGroupProfiles with the addition of -// the ability to pass a context and additional request options. -// -// See SearchGroupProfiles 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 *DataZone) SearchGroupProfilesWithContext(ctx aws.Context, input *SearchGroupProfilesInput, opts ...request.Option) (*SearchGroupProfilesOutput, error) { - req, out := c.SearchGroupProfilesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchGroupProfilesPages iterates over the pages of a SearchGroupProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchGroupProfiles method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchGroupProfiles operation. -// pageNum := 0 -// err := client.SearchGroupProfilesPages(params, -// func(page *datazone.SearchGroupProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) SearchGroupProfilesPages(input *SearchGroupProfilesInput, fn func(*SearchGroupProfilesOutput, bool) bool) error { - return c.SearchGroupProfilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchGroupProfilesPagesWithContext same as SearchGroupProfilesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) SearchGroupProfilesPagesWithContext(ctx aws.Context, input *SearchGroupProfilesInput, fn func(*SearchGroupProfilesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchGroupProfilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchGroupProfilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchGroupProfilesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearchListings = "SearchListings" - -// SearchListingsRequest generates a "aws/request.Request" representing the -// client's request for the SearchListings 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 SearchListings for more information on using the SearchListings -// 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 SearchListingsRequest method. -// req, resp := client.SearchListingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/SearchListings -func (c *DataZone) SearchListingsRequest(input *SearchListingsInput) (req *request.Request, output *SearchListingsOutput) { - op := &request.Operation{ - Name: opSearchListings, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/listings/search", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchListingsInput{} - } - - output = &SearchListingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchListings API operation for Amazon DataZone. -// -// Searches listings in Amazon DataZone. -// -// 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 DataZone's -// API operation SearchListings for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/SearchListings -func (c *DataZone) SearchListings(input *SearchListingsInput) (*SearchListingsOutput, error) { - req, out := c.SearchListingsRequest(input) - return out, req.Send() -} - -// SearchListingsWithContext is the same as SearchListings with the addition of -// the ability to pass a context and additional request options. -// -// See SearchListings 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 *DataZone) SearchListingsWithContext(ctx aws.Context, input *SearchListingsInput, opts ...request.Option) (*SearchListingsOutput, error) { - req, out := c.SearchListingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchListingsPages iterates over the pages of a SearchListings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchListings method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchListings operation. -// pageNum := 0 -// err := client.SearchListingsPages(params, -// func(page *datazone.SearchListingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) SearchListingsPages(input *SearchListingsInput, fn func(*SearchListingsOutput, bool) bool) error { - return c.SearchListingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchListingsPagesWithContext same as SearchListingsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) SearchListingsPagesWithContext(ctx aws.Context, input *SearchListingsInput, fn func(*SearchListingsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchListingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchListingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchListingsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearchTypes = "SearchTypes" - -// SearchTypesRequest generates a "aws/request.Request" representing the -// client's request for the SearchTypes 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 SearchTypes for more information on using the SearchTypes -// 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 SearchTypesRequest method. -// req, resp := client.SearchTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/SearchTypes -func (c *DataZone) SearchTypesRequest(input *SearchTypesInput) (req *request.Request, output *SearchTypesOutput) { - op := &request.Operation{ - Name: opSearchTypes, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/types-search", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchTypesInput{} - } - - output = &SearchTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchTypes API operation for Amazon DataZone. -// -// Searches for types in Amazon DataZone. -// -// 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 DataZone's -// API operation SearchTypes for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/SearchTypes -func (c *DataZone) SearchTypes(input *SearchTypesInput) (*SearchTypesOutput, error) { - req, out := c.SearchTypesRequest(input) - return out, req.Send() -} - -// SearchTypesWithContext is the same as SearchTypes with the addition of -// the ability to pass a context and additional request options. -// -// See SearchTypes 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 *DataZone) SearchTypesWithContext(ctx aws.Context, input *SearchTypesInput, opts ...request.Option) (*SearchTypesOutput, error) { - req, out := c.SearchTypesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchTypesPages iterates over the pages of a SearchTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchTypes method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchTypes operation. -// pageNum := 0 -// err := client.SearchTypesPages(params, -// func(page *datazone.SearchTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) SearchTypesPages(input *SearchTypesInput, fn func(*SearchTypesOutput, bool) bool) error { - return c.SearchTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchTypesPagesWithContext same as SearchTypesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) SearchTypesPagesWithContext(ctx aws.Context, input *SearchTypesInput, fn func(*SearchTypesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchTypesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearchUserProfiles = "SearchUserProfiles" - -// SearchUserProfilesRequest generates a "aws/request.Request" representing the -// client's request for the SearchUserProfiles 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 SearchUserProfiles for more information on using the SearchUserProfiles -// 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 SearchUserProfilesRequest method. -// req, resp := client.SearchUserProfilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/SearchUserProfiles -func (c *DataZone) SearchUserProfilesRequest(input *SearchUserProfilesInput) (req *request.Request, output *SearchUserProfilesOutput) { - op := &request.Operation{ - Name: opSearchUserProfiles, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/search-user-profiles", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchUserProfilesInput{} - } - - output = &SearchUserProfilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchUserProfiles API operation for Amazon DataZone. -// -// Searches user profiles in Amazon DataZone. -// -// 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 DataZone's -// API operation SearchUserProfiles for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/SearchUserProfiles -func (c *DataZone) SearchUserProfiles(input *SearchUserProfilesInput) (*SearchUserProfilesOutput, error) { - req, out := c.SearchUserProfilesRequest(input) - return out, req.Send() -} - -// SearchUserProfilesWithContext is the same as SearchUserProfiles with the addition of -// the ability to pass a context and additional request options. -// -// See SearchUserProfiles 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 *DataZone) SearchUserProfilesWithContext(ctx aws.Context, input *SearchUserProfilesInput, opts ...request.Option) (*SearchUserProfilesOutput, error) { - req, out := c.SearchUserProfilesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchUserProfilesPages iterates over the pages of a SearchUserProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchUserProfiles method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchUserProfiles operation. -// pageNum := 0 -// err := client.SearchUserProfilesPages(params, -// func(page *datazone.SearchUserProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DataZone) SearchUserProfilesPages(input *SearchUserProfilesInput, fn func(*SearchUserProfilesOutput, bool) bool) error { - return c.SearchUserProfilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchUserProfilesPagesWithContext same as SearchUserProfilesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DataZone) SearchUserProfilesPagesWithContext(ctx aws.Context, input *SearchUserProfilesInput, fn func(*SearchUserProfilesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchUserProfilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchUserProfilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchUserProfilesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartDataSourceRun = "StartDataSourceRun" - -// StartDataSourceRunRequest generates a "aws/request.Request" representing the -// client's request for the StartDataSourceRun 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 StartDataSourceRun for more information on using the StartDataSourceRun -// 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 StartDataSourceRunRequest method. -// req, resp := client.StartDataSourceRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/StartDataSourceRun -func (c *DataZone) StartDataSourceRunRequest(input *StartDataSourceRunInput) (req *request.Request, output *StartDataSourceRunOutput) { - op := &request.Operation{ - Name: opStartDataSourceRun, - HTTPMethod: "POST", - HTTPPath: "/v2/domains/{domainIdentifier}/data-sources/{dataSourceIdentifier}/runs", - } - - if input == nil { - input = &StartDataSourceRunInput{} - } - - output = &StartDataSourceRunOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartDataSourceRun API operation for Amazon DataZone. -// -// Start the run of the specified data source in Amazon DataZone. -// -// 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 DataZone's -// API operation StartDataSourceRun for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/StartDataSourceRun -func (c *DataZone) StartDataSourceRun(input *StartDataSourceRunInput) (*StartDataSourceRunOutput, error) { - req, out := c.StartDataSourceRunRequest(input) - return out, req.Send() -} - -// StartDataSourceRunWithContext is the same as StartDataSourceRun with the addition of -// the ability to pass a context and additional request options. -// -// See StartDataSourceRun 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 *DataZone) StartDataSourceRunWithContext(ctx aws.Context, input *StartDataSourceRunInput, opts ...request.Option) (*StartDataSourceRunOutput, error) { - req, out := c.StartDataSourceRunRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/TagResource -func (c *DataZone) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon DataZone. -// -// Tags a resource in Amazon DataZone. -// -// 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 DataZone's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/TagResource -func (c *DataZone) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *DataZone) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UntagResource -func (c *DataZone) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon DataZone. -// -// Untags a resource in Amazon DataZone. -// -// 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 DataZone's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UntagResource -func (c *DataZone) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *DataZone) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDataSource = "UpdateDataSource" - -// UpdateDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDataSource 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 UpdateDataSource for more information on using the UpdateDataSource -// 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 UpdateDataSourceRequest method. -// req, resp := client.UpdateDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateDataSource -func (c *DataZone) UpdateDataSourceRequest(input *UpdateDataSourceInput) (req *request.Request, output *UpdateDataSourceOutput) { - op := &request.Operation{ - Name: opUpdateDataSource, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/data-sources/{identifier}", - } - - if input == nil { - input = &UpdateDataSourceInput{} - } - - output = &UpdateDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDataSource API operation for Amazon DataZone. -// -// Updates the specified data source in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateDataSource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateDataSource -func (c *DataZone) UpdateDataSource(input *UpdateDataSourceInput) (*UpdateDataSourceOutput, error) { - req, out := c.UpdateDataSourceRequest(input) - return out, req.Send() -} - -// UpdateDataSourceWithContext is the same as UpdateDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDataSource 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 *DataZone) UpdateDataSourceWithContext(ctx aws.Context, input *UpdateDataSourceInput, opts ...request.Option) (*UpdateDataSourceOutput, error) { - req, out := c.UpdateDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDomain = "UpdateDomain" - -// UpdateDomainRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDomain 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 UpdateDomain for more information on using the UpdateDomain -// 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 UpdateDomainRequest method. -// req, resp := client.UpdateDomainRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateDomain -func (c *DataZone) UpdateDomainRequest(input *UpdateDomainInput) (req *request.Request, output *UpdateDomainOutput) { - op := &request.Operation{ - Name: opUpdateDomain, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{identifier}", - } - - if input == nil { - input = &UpdateDomainInput{} - } - - output = &UpdateDomainOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDomain API operation for Amazon DataZone. -// -// Updates a Amazon DataZone domain. -// -// 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 DataZone's -// API operation UpdateDomain for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateDomain -func (c *DataZone) UpdateDomain(input *UpdateDomainInput) (*UpdateDomainOutput, error) { - req, out := c.UpdateDomainRequest(input) - return out, req.Send() -} - -// UpdateDomainWithContext is the same as UpdateDomain with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDomain 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 *DataZone) UpdateDomainWithContext(ctx aws.Context, input *UpdateDomainInput, opts ...request.Option) (*UpdateDomainOutput, error) { - req, out := c.UpdateDomainRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateEnvironment = "UpdateEnvironment" - -// UpdateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEnvironment 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 UpdateEnvironment for more information on using the UpdateEnvironment -// 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 UpdateEnvironmentRequest method. -// req, resp := client.UpdateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateEnvironment -func (c *DataZone) UpdateEnvironmentRequest(input *UpdateEnvironmentInput) (req *request.Request, output *UpdateEnvironmentOutput) { - op := &request.Operation{ - Name: opUpdateEnvironment, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/environments/{identifier}", - } - - if input == nil { - input = &UpdateEnvironmentInput{} - } - - output = &UpdateEnvironmentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateEnvironment API operation for Amazon DataZone. -// -// Updates the specified environment in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateEnvironment for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateEnvironment -func (c *DataZone) UpdateEnvironment(input *UpdateEnvironmentInput) (*UpdateEnvironmentOutput, error) { - req, out := c.UpdateEnvironmentRequest(input) - return out, req.Send() -} - -// UpdateEnvironmentWithContext is the same as UpdateEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateEnvironment 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 *DataZone) UpdateEnvironmentWithContext(ctx aws.Context, input *UpdateEnvironmentInput, opts ...request.Option) (*UpdateEnvironmentOutput, error) { - req, out := c.UpdateEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateEnvironmentProfile = "UpdateEnvironmentProfile" - -// UpdateEnvironmentProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEnvironmentProfile 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 UpdateEnvironmentProfile for more information on using the UpdateEnvironmentProfile -// 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 UpdateEnvironmentProfileRequest method. -// req, resp := client.UpdateEnvironmentProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateEnvironmentProfile -func (c *DataZone) UpdateEnvironmentProfileRequest(input *UpdateEnvironmentProfileInput) (req *request.Request, output *UpdateEnvironmentProfileOutput) { - op := &request.Operation{ - Name: opUpdateEnvironmentProfile, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/environment-profiles/{identifier}", - } - - if input == nil { - input = &UpdateEnvironmentProfileInput{} - } - - output = &UpdateEnvironmentProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateEnvironmentProfile API operation for Amazon DataZone. -// -// Updates the specified environment profile in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateEnvironmentProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateEnvironmentProfile -func (c *DataZone) UpdateEnvironmentProfile(input *UpdateEnvironmentProfileInput) (*UpdateEnvironmentProfileOutput, error) { - req, out := c.UpdateEnvironmentProfileRequest(input) - return out, req.Send() -} - -// UpdateEnvironmentProfileWithContext is the same as UpdateEnvironmentProfile with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateEnvironmentProfile 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 *DataZone) UpdateEnvironmentProfileWithContext(ctx aws.Context, input *UpdateEnvironmentProfileInput, opts ...request.Option) (*UpdateEnvironmentProfileOutput, error) { - req, out := c.UpdateEnvironmentProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateGlossary = "UpdateGlossary" - -// UpdateGlossaryRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGlossary 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 UpdateGlossary for more information on using the UpdateGlossary -// 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 UpdateGlossaryRequest method. -// req, resp := client.UpdateGlossaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateGlossary -func (c *DataZone) UpdateGlossaryRequest(input *UpdateGlossaryInput) (req *request.Request, output *UpdateGlossaryOutput) { - op := &request.Operation{ - Name: opUpdateGlossary, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/glossaries/{identifier}", - } - - if input == nil { - input = &UpdateGlossaryInput{} - } - - output = &UpdateGlossaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateGlossary API operation for Amazon DataZone. -// -// Updates the business glossary in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateGlossary for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateGlossary -func (c *DataZone) UpdateGlossary(input *UpdateGlossaryInput) (*UpdateGlossaryOutput, error) { - req, out := c.UpdateGlossaryRequest(input) - return out, req.Send() -} - -// UpdateGlossaryWithContext is the same as UpdateGlossary with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateGlossary 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 *DataZone) UpdateGlossaryWithContext(ctx aws.Context, input *UpdateGlossaryInput, opts ...request.Option) (*UpdateGlossaryOutput, error) { - req, out := c.UpdateGlossaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateGlossaryTerm = "UpdateGlossaryTerm" - -// UpdateGlossaryTermRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGlossaryTerm 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 UpdateGlossaryTerm for more information on using the UpdateGlossaryTerm -// 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 UpdateGlossaryTermRequest method. -// req, resp := client.UpdateGlossaryTermRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateGlossaryTerm -func (c *DataZone) UpdateGlossaryTermRequest(input *UpdateGlossaryTermInput) (req *request.Request, output *UpdateGlossaryTermOutput) { - op := &request.Operation{ - Name: opUpdateGlossaryTerm, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/glossary-terms/{identifier}", - } - - if input == nil { - input = &UpdateGlossaryTermInput{} - } - - output = &UpdateGlossaryTermOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateGlossaryTerm API operation for Amazon DataZone. -// -// Updates a business glossary term in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateGlossaryTerm for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateGlossaryTerm -func (c *DataZone) UpdateGlossaryTerm(input *UpdateGlossaryTermInput) (*UpdateGlossaryTermOutput, error) { - req, out := c.UpdateGlossaryTermRequest(input) - return out, req.Send() -} - -// UpdateGlossaryTermWithContext is the same as UpdateGlossaryTerm with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateGlossaryTerm 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 *DataZone) UpdateGlossaryTermWithContext(ctx aws.Context, input *UpdateGlossaryTermInput, opts ...request.Option) (*UpdateGlossaryTermOutput, error) { - req, out := c.UpdateGlossaryTermRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateGroupProfile = "UpdateGroupProfile" - -// UpdateGroupProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGroupProfile 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 UpdateGroupProfile for more information on using the UpdateGroupProfile -// 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 UpdateGroupProfileRequest method. -// req, resp := client.UpdateGroupProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateGroupProfile -func (c *DataZone) UpdateGroupProfileRequest(input *UpdateGroupProfileInput) (req *request.Request, output *UpdateGroupProfileOutput) { - op := &request.Operation{ - Name: opUpdateGroupProfile, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/group-profiles/{groupIdentifier}", - } - - if input == nil { - input = &UpdateGroupProfileInput{} - } - - output = &UpdateGroupProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateGroupProfile API operation for Amazon DataZone. -// -// Updates the specified group profile in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateGroupProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateGroupProfile -func (c *DataZone) UpdateGroupProfile(input *UpdateGroupProfileInput) (*UpdateGroupProfileOutput, error) { - req, out := c.UpdateGroupProfileRequest(input) - return out, req.Send() -} - -// UpdateGroupProfileWithContext is the same as UpdateGroupProfile with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateGroupProfile 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 *DataZone) UpdateGroupProfileWithContext(ctx aws.Context, input *UpdateGroupProfileInput, opts ...request.Option) (*UpdateGroupProfileOutput, error) { - req, out := c.UpdateGroupProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateProject = "UpdateProject" - -// UpdateProjectRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProject 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 UpdateProject for more information on using the UpdateProject -// 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 UpdateProjectRequest method. -// req, resp := client.UpdateProjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateProject -func (c *DataZone) UpdateProjectRequest(input *UpdateProjectInput) (req *request.Request, output *UpdateProjectOutput) { - op := &request.Operation{ - Name: opUpdateProject, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/projects/{identifier}", - } - - if input == nil { - input = &UpdateProjectInput{} - } - - output = &UpdateProjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateProject API operation for Amazon DataZone. -// -// Updates the specified project in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateProject for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ServiceQuotaExceededException -// The request has exceeded the specified service quota. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateProject -func (c *DataZone) UpdateProject(input *UpdateProjectInput) (*UpdateProjectOutput, error) { - req, out := c.UpdateProjectRequest(input) - return out, req.Send() -} - -// UpdateProjectWithContext is the same as UpdateProject with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateProject 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 *DataZone) UpdateProjectWithContext(ctx aws.Context, input *UpdateProjectInput, opts ...request.Option) (*UpdateProjectOutput, error) { - req, out := c.UpdateProjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSubscriptionGrantStatus = "UpdateSubscriptionGrantStatus" - -// UpdateSubscriptionGrantStatusRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSubscriptionGrantStatus 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 UpdateSubscriptionGrantStatus for more information on using the UpdateSubscriptionGrantStatus -// 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 UpdateSubscriptionGrantStatusRequest method. -// req, resp := client.UpdateSubscriptionGrantStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateSubscriptionGrantStatus -func (c *DataZone) UpdateSubscriptionGrantStatusRequest(input *UpdateSubscriptionGrantStatusInput) (req *request.Request, output *UpdateSubscriptionGrantStatusOutput) { - op := &request.Operation{ - Name: opUpdateSubscriptionGrantStatus, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-grants/{identifier}/status/{assetIdentifier}", - } - - if input == nil { - input = &UpdateSubscriptionGrantStatusInput{} - } - - output = &UpdateSubscriptionGrantStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSubscriptionGrantStatus API operation for Amazon DataZone. -// -// Updates the status of the specified subscription grant status in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateSubscriptionGrantStatus for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateSubscriptionGrantStatus -func (c *DataZone) UpdateSubscriptionGrantStatus(input *UpdateSubscriptionGrantStatusInput) (*UpdateSubscriptionGrantStatusOutput, error) { - req, out := c.UpdateSubscriptionGrantStatusRequest(input) - return out, req.Send() -} - -// UpdateSubscriptionGrantStatusWithContext is the same as UpdateSubscriptionGrantStatus with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSubscriptionGrantStatus 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 *DataZone) UpdateSubscriptionGrantStatusWithContext(ctx aws.Context, input *UpdateSubscriptionGrantStatusInput, opts ...request.Option) (*UpdateSubscriptionGrantStatusOutput, error) { - req, out := c.UpdateSubscriptionGrantStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSubscriptionRequest = "UpdateSubscriptionRequest" - -// UpdateSubscriptionRequestRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSubscriptionRequest 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 UpdateSubscriptionRequest for more information on using the UpdateSubscriptionRequest -// 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 UpdateSubscriptionRequestRequest method. -// req, resp := client.UpdateSubscriptionRequestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateSubscriptionRequest -func (c *DataZone) UpdateSubscriptionRequestRequest(input *UpdateSubscriptionRequestInput) (req *request.Request, output *UpdateSubscriptionRequestOutput) { - op := &request.Operation{ - Name: opUpdateSubscriptionRequest, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/subscription-requests/{identifier}", - } - - if input == nil { - input = &UpdateSubscriptionRequestInput{} - } - - output = &UpdateSubscriptionRequestOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSubscriptionRequest API operation for Amazon DataZone. -// -// Updates a specified subscription request in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateSubscriptionRequest for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateSubscriptionRequest -func (c *DataZone) UpdateSubscriptionRequest(input *UpdateSubscriptionRequestInput) (*UpdateSubscriptionRequestOutput, error) { - req, out := c.UpdateSubscriptionRequestRequest(input) - return out, req.Send() -} - -// UpdateSubscriptionRequestWithContext is the same as UpdateSubscriptionRequest with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSubscriptionRequest 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 *DataZone) UpdateSubscriptionRequestWithContext(ctx aws.Context, input *UpdateSubscriptionRequestInput, opts ...request.Option) (*UpdateSubscriptionRequestOutput, error) { - req, out := c.UpdateSubscriptionRequestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSubscriptionTarget = "UpdateSubscriptionTarget" - -// UpdateSubscriptionTargetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSubscriptionTarget 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 UpdateSubscriptionTarget for more information on using the UpdateSubscriptionTarget -// 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 UpdateSubscriptionTargetRequest method. -// req, resp := client.UpdateSubscriptionTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateSubscriptionTarget -func (c *DataZone) UpdateSubscriptionTargetRequest(input *UpdateSubscriptionTargetInput) (req *request.Request, output *UpdateSubscriptionTargetOutput) { - op := &request.Operation{ - Name: opUpdateSubscriptionTarget, - HTTPMethod: "PATCH", - HTTPPath: "/v2/domains/{domainIdentifier}/environments/{environmentIdentifier}/subscription-targets/{identifier}", - } - - if input == nil { - input = &UpdateSubscriptionTargetInput{} - } - - output = &UpdateSubscriptionTargetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSubscriptionTarget API operation for Amazon DataZone. -// -// Updates the specified subscription target in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateSubscriptionTarget for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// There is a conflict while performing this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateSubscriptionTarget -func (c *DataZone) UpdateSubscriptionTarget(input *UpdateSubscriptionTargetInput) (*UpdateSubscriptionTargetOutput, error) { - req, out := c.UpdateSubscriptionTargetRequest(input) - return out, req.Send() -} - -// UpdateSubscriptionTargetWithContext is the same as UpdateSubscriptionTarget with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSubscriptionTarget 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 *DataZone) UpdateSubscriptionTargetWithContext(ctx aws.Context, input *UpdateSubscriptionTargetInput, opts ...request.Option) (*UpdateSubscriptionTargetOutput, error) { - req, out := c.UpdateSubscriptionTargetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateUserProfile = "UpdateUserProfile" - -// UpdateUserProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUserProfile 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 UpdateUserProfile for more information on using the UpdateUserProfile -// 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 UpdateUserProfileRequest method. -// req, resp := client.UpdateUserProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateUserProfile -func (c *DataZone) UpdateUserProfileRequest(input *UpdateUserProfileInput) (req *request.Request, output *UpdateUserProfileOutput) { - op := &request.Operation{ - Name: opUpdateUserProfile, - HTTPMethod: "PUT", - HTTPPath: "/v2/domains/{domainIdentifier}/user-profiles/{userIdentifier}", - } - - if input == nil { - input = &UpdateUserProfileInput{} - } - - output = &UpdateUserProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateUserProfile API operation for Amazon DataZone. -// -// Updates the specified user profile in Amazon DataZone. -// -// 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 DataZone's -// API operation UpdateUserProfile for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request has failed because of an unknown error, exception or failure. -// -// - ResourceNotFoundException -// The specified resource cannot be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -// -// - UnauthorizedException -// You do not have permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/UpdateUserProfile -func (c *DataZone) UpdateUserProfile(input *UpdateUserProfileInput) (*UpdateUserProfileOutput, error) { - req, out := c.UpdateUserProfileRequest(input) - return out, req.Send() -} - -// UpdateUserProfileWithContext is the same as UpdateUserProfile with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateUserProfile 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 *DataZone) UpdateUserProfileWithContext(ctx aws.Context, input *UpdateUserProfileInput, opts ...request.Option) (*UpdateUserProfileOutput, error) { - req, out := c.UpdateUserProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Specifies the prediction (aka, the automatically generated piece of metadata) -// and the target (for example, a column name) that can be accepted. -type AcceptChoice struct { - _ struct{} `type:"structure"` - - // Specifies the prediction (aka, the automatically generated piece of metadata) - // that can be accepted. - PredictionChoice *int64 `locationName:"predictionChoice" type:"integer"` - - // Specifies the target (for example, a column name) where a prediction can - // be accepted. - PredictionTarget *string `locationName:"predictionTarget" 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 AcceptChoice) 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 AcceptChoice) GoString() string { - return s.String() -} - -// SetPredictionChoice sets the PredictionChoice field's value. -func (s *AcceptChoice) SetPredictionChoice(v int64) *AcceptChoice { - s.PredictionChoice = &v - return s -} - -// SetPredictionTarget sets the PredictionTarget field's value. -func (s *AcceptChoice) SetPredictionTarget(v string) *AcceptChoice { - s.PredictionTarget = &v - return s -} - -type AcceptPredictionsInput struct { - _ struct{} `type:"structure"` - - AcceptChoices []*AcceptChoice `locationName:"acceptChoices" type:"list"` - - // Specifies the rule (or the conditions) under which a prediction can be accepted. - AcceptRule *AcceptRule `locationName:"acceptRule" type:"structure"` - - // A unique, case-sensitive identifier to ensure idempotency of the request. - // This field is automatically populated if not provided. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - Revision *string `location:"querystring" locationName:"revision" min:"1" 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 AcceptPredictionsInput) 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 AcceptPredictionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptPredictionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptPredictionsInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Revision != nil && len(*s.Revision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Revision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAcceptChoices sets the AcceptChoices field's value. -func (s *AcceptPredictionsInput) SetAcceptChoices(v []*AcceptChoice) *AcceptPredictionsInput { - s.AcceptChoices = v - return s -} - -// SetAcceptRule sets the AcceptRule field's value. -func (s *AcceptPredictionsInput) SetAcceptRule(v *AcceptRule) *AcceptPredictionsInput { - s.AcceptRule = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *AcceptPredictionsInput) SetClientToken(v string) *AcceptPredictionsInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *AcceptPredictionsInput) SetDomainIdentifier(v string) *AcceptPredictionsInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *AcceptPredictionsInput) SetIdentifier(v string) *AcceptPredictionsInput { - s.Identifier = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *AcceptPredictionsInput) SetRevision(v string) *AcceptPredictionsInput { - s.Revision = &v - return s -} - -type AcceptPredictionsOutput struct { - _ struct{} `type:"structure"` - - // AssetId is a required field - AssetId *string `locationName:"assetId" type:"string" required:"true"` - - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // Revision is a required field - Revision *string `locationName:"revision" min:"1" 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 AcceptPredictionsOutput) 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 AcceptPredictionsOutput) GoString() string { - return s.String() -} - -// SetAssetId sets the AssetId field's value. -func (s *AcceptPredictionsOutput) SetAssetId(v string) *AcceptPredictionsOutput { - s.AssetId = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *AcceptPredictionsOutput) SetDomainId(v string) *AcceptPredictionsOutput { - s.DomainId = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *AcceptPredictionsOutput) SetRevision(v string) *AcceptPredictionsOutput { - s.Revision = &v - return s -} - -// Specifies the rule and the threshold under which a prediction can be accepted. -type AcceptRule struct { - _ struct{} `type:"structure"` - - // Specifies whether you want to accept the top prediction for all targets or - // none. - Rule *string `locationName:"rule" type:"string" enum:"AcceptRuleBehavior"` - - // The confidence score that specifies the condition at which a prediction can - // be accepted. - Threshold *float64 `locationName:"threshold" type:"float"` -} - -// 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 AcceptRule) 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 AcceptRule) GoString() string { - return s.String() -} - -// SetRule sets the Rule field's value. -func (s *AcceptRule) SetRule(v string) *AcceptRule { - s.Rule = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *AcceptRule) SetThreshold(v float64) *AcceptRule { - s.Threshold = &v - return s -} - -type AcceptSubscriptionRequestInput struct { - _ struct{} `type:"structure"` - - // A description that specifies the reason for accepting the specified subscription - // request. - // - // DecisionComment is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AcceptSubscriptionRequestInput's - // String and GoString methods. - DecisionComment *string `locationName:"decisionComment" min:"1" type:"string" sensitive:"true"` - - // The Amazon DataZone domain where the specified subscription request is being - // accepted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The unique identifier of the subscription request that is to be accepted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 AcceptSubscriptionRequestInput) 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 AcceptSubscriptionRequestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptSubscriptionRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptSubscriptionRequestInput"} - if s.DecisionComment != nil && len(*s.DecisionComment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DecisionComment", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDecisionComment sets the DecisionComment field's value. -func (s *AcceptSubscriptionRequestInput) SetDecisionComment(v string) *AcceptSubscriptionRequestInput { - s.DecisionComment = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *AcceptSubscriptionRequestInput) SetDomainIdentifier(v string) *AcceptSubscriptionRequestInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *AcceptSubscriptionRequestInput) SetIdentifier(v string) *AcceptSubscriptionRequestInput { - s.Identifier = &v - return s -} - -type AcceptSubscriptionRequestOutput struct { - _ struct{} `type:"structure"` - - // The timestamp that specifies when the subscription request was accepted. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Specifies the Amazon DataZone user that accepted the specified subscription - // request. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // Specifies the reason for accepting the subscription request. - // - // DecisionComment is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AcceptSubscriptionRequestOutput's - // String and GoString methods. - DecisionComment *string `locationName:"decisionComment" min:"1" type:"string" sensitive:"true"` - - // The unique identifier of the Amazon DataZone domain where the specified subscription - // request was accepted. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the subscription request. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Specifies the reason for requesting a subscription to the asset. - // - // RequestReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AcceptSubscriptionRequestOutput's - // String and GoString methods. - // - // RequestReason is a required field - RequestReason *string `locationName:"requestReason" min:"1" type:"string" required:"true" sensitive:"true"` - - // Specifes the ID of the Amazon DataZone user who reviewed the subscription - // request. - ReviewerId *string `locationName:"reviewerId" type:"string"` - - // Specifies the status of the subscription request. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionRequestStatus"` - - // Specifies the asset for which the subscription request was created. - // - // SubscribedListings is a required field - SubscribedListings []*SubscribedListing `locationName:"subscribedListings" min:"1" type:"list" required:"true"` - - // Specifies the Amazon DataZone users who are subscribed to the asset specified - // in the subscription request. - // - // SubscribedPrincipals is a required field - SubscribedPrincipals []*SubscribedPrincipal `locationName:"subscribedPrincipals" min:"1" type:"list" required:"true"` - - // Specifies the timestamp when subscription request was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // Specifies the Amazon DataZone user who updated the subscription request. - UpdatedBy *string `locationName:"updatedBy" 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 AcceptSubscriptionRequestOutput) 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 AcceptSubscriptionRequestOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AcceptSubscriptionRequestOutput) SetCreatedAt(v time.Time) *AcceptSubscriptionRequestOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *AcceptSubscriptionRequestOutput) SetCreatedBy(v string) *AcceptSubscriptionRequestOutput { - s.CreatedBy = &v - return s -} - -// SetDecisionComment sets the DecisionComment field's value. -func (s *AcceptSubscriptionRequestOutput) SetDecisionComment(v string) *AcceptSubscriptionRequestOutput { - s.DecisionComment = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *AcceptSubscriptionRequestOutput) SetDomainId(v string) *AcceptSubscriptionRequestOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *AcceptSubscriptionRequestOutput) SetId(v string) *AcceptSubscriptionRequestOutput { - s.Id = &v - return s -} - -// SetRequestReason sets the RequestReason field's value. -func (s *AcceptSubscriptionRequestOutput) SetRequestReason(v string) *AcceptSubscriptionRequestOutput { - s.RequestReason = &v - return s -} - -// SetReviewerId sets the ReviewerId field's value. -func (s *AcceptSubscriptionRequestOutput) SetReviewerId(v string) *AcceptSubscriptionRequestOutput { - s.ReviewerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AcceptSubscriptionRequestOutput) SetStatus(v string) *AcceptSubscriptionRequestOutput { - s.Status = &v - return s -} - -// SetSubscribedListings sets the SubscribedListings field's value. -func (s *AcceptSubscriptionRequestOutput) SetSubscribedListings(v []*SubscribedListing) *AcceptSubscriptionRequestOutput { - s.SubscribedListings = v - return s -} - -// SetSubscribedPrincipals sets the SubscribedPrincipals field's value. -func (s *AcceptSubscriptionRequestOutput) SetSubscribedPrincipals(v []*SubscribedPrincipal) *AcceptSubscriptionRequestOutput { - s.SubscribedPrincipals = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AcceptSubscriptionRequestOutput) SetUpdatedAt(v time.Time) *AcceptSubscriptionRequestOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *AcceptSubscriptionRequestOutput) SetUpdatedBy(v string) *AcceptSubscriptionRequestOutput { - s.UpdatedBy = &v - return s -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A Amazon DataZone inventory asset. -type AssetItem struct { - _ struct{} `type:"structure"` - - // The additional attributes of a Amazon DataZone inventory asset. - AdditionalAttributes *AssetItemAdditionalAttributes `locationName:"additionalAttributes" type:"structure"` - - // The timestamp of when the Amazon DataZone inventory asset was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the inventory asset. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of an Amazon DataZone inventory asset. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AssetItem's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the inventory asset - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The external identifier of the Amazon DataZone inventory asset. - // - // ExternalIdentifier is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AssetItem's - // String and GoString methods. - ExternalIdentifier *string `locationName:"externalIdentifier" min:"1" type:"string" sensitive:"true"` - - // The timestamp of when the first revision of the inventory asset was created. - FirstRevisionCreatedAt *time.Time `locationName:"firstRevisionCreatedAt" type:"timestamp"` - - // The Amazon DataZone user who created the first revision of the inventory - // asset. - FirstRevisionCreatedBy *string `locationName:"firstRevisionCreatedBy" type:"string"` - - // The glossary terms attached to the Amazon DataZone inventory asset. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // the identifier of the Amazon DataZone inventory asset. - // - // Identifier is a required field - Identifier *string `locationName:"identifier" type:"string" required:"true"` - - // The name of the Amazon DataZone inventory asset. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AssetItem's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the Amazon DataZone project that owns the inventory asset. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The identifier of the asset type of the specified Amazon DataZone inventory - // asset. - // - // TypeIdentifier is a required field - TypeIdentifier *string `locationName:"typeIdentifier" min:"1" type:"string" required:"true"` - - // The revision of the inventory asset type. - // - // TypeRevision is a required field - TypeRevision *string `locationName:"typeRevision" min:"1" 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 AssetItem) 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 AssetItem) GoString() string { - return s.String() -} - -// SetAdditionalAttributes sets the AdditionalAttributes field's value. -func (s *AssetItem) SetAdditionalAttributes(v *AssetItemAdditionalAttributes) *AssetItem { - s.AdditionalAttributes = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AssetItem) SetCreatedAt(v time.Time) *AssetItem { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *AssetItem) SetCreatedBy(v string) *AssetItem { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AssetItem) SetDescription(v string) *AssetItem { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *AssetItem) SetDomainId(v string) *AssetItem { - s.DomainId = &v - return s -} - -// SetExternalIdentifier sets the ExternalIdentifier field's value. -func (s *AssetItem) SetExternalIdentifier(v string) *AssetItem { - s.ExternalIdentifier = &v - return s -} - -// SetFirstRevisionCreatedAt sets the FirstRevisionCreatedAt field's value. -func (s *AssetItem) SetFirstRevisionCreatedAt(v time.Time) *AssetItem { - s.FirstRevisionCreatedAt = &v - return s -} - -// SetFirstRevisionCreatedBy sets the FirstRevisionCreatedBy field's value. -func (s *AssetItem) SetFirstRevisionCreatedBy(v string) *AssetItem { - s.FirstRevisionCreatedBy = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *AssetItem) SetGlossaryTerms(v []*string) *AssetItem { - s.GlossaryTerms = v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *AssetItem) SetIdentifier(v string) *AssetItem { - s.Identifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *AssetItem) SetName(v string) *AssetItem { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *AssetItem) SetOwningProjectId(v string) *AssetItem { - s.OwningProjectId = &v - return s -} - -// SetTypeIdentifier sets the TypeIdentifier field's value. -func (s *AssetItem) SetTypeIdentifier(v string) *AssetItem { - s.TypeIdentifier = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *AssetItem) SetTypeRevision(v string) *AssetItem { - s.TypeRevision = &v - return s -} - -// The additional attributes of an inventory asset. -type AssetItemAdditionalAttributes struct { - _ struct{} `type:"structure"` - - // The forms included in the additional attributes of an inventory asset. - FormsOutput []*FormOutput_ `locationName:"formsOutput" type:"list"` - - // The read-only forms included in the additional attributes of an inventory - // asset. - ReadOnlyFormsOutput []*FormOutput_ `locationName:"readOnlyFormsOutput" type:"list"` -} - -// 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 AssetItemAdditionalAttributes) 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 AssetItemAdditionalAttributes) GoString() string { - return s.String() -} - -// SetFormsOutput sets the FormsOutput field's value. -func (s *AssetItemAdditionalAttributes) SetFormsOutput(v []*FormOutput_) *AssetItemAdditionalAttributes { - s.FormsOutput = v - return s -} - -// SetReadOnlyFormsOutput sets the ReadOnlyFormsOutput field's value. -func (s *AssetItemAdditionalAttributes) SetReadOnlyFormsOutput(v []*FormOutput_) *AssetItemAdditionalAttributes { - s.ReadOnlyFormsOutput = v - return s -} - -// An asset published in an Amazon DataZone catalog. -type AssetListing struct { - _ struct{} `type:"structure"` - - // The identifier of an asset published in an Amazon DataZone catalog. - AssetId *string `locationName:"assetId" type:"string"` - - // The revision of an asset published in an Amazon DataZone catalog. - AssetRevision *string `locationName:"assetRevision" min:"1" type:"string"` - - // The type of an asset published in an Amazon DataZone catalog. - AssetType *string `locationName:"assetType" min:"1" type:"string"` - - // The timestamp of when an asset published in an Amazon DataZone catalog was - // created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The metadata forms attached to an asset published in an Amazon DataZone catalog. - Forms *string `locationName:"forms" type:"string"` - - // The glossary terms attached to an asset published in an Amazon DataZone catalog. - GlossaryTerms []*DetailedGlossaryTerm `locationName:"glossaryTerms" type:"list"` - - // The identifier of the project where an asset published in an Amazon DataZone - // catalog exists. - OwningProjectId *string `locationName:"owningProjectId" 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 AssetListing) 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 AssetListing) GoString() string { - return s.String() -} - -// SetAssetId sets the AssetId field's value. -func (s *AssetListing) SetAssetId(v string) *AssetListing { - s.AssetId = &v - return s -} - -// SetAssetRevision sets the AssetRevision field's value. -func (s *AssetListing) SetAssetRevision(v string) *AssetListing { - s.AssetRevision = &v - return s -} - -// SetAssetType sets the AssetType field's value. -func (s *AssetListing) SetAssetType(v string) *AssetListing { - s.AssetType = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AssetListing) SetCreatedAt(v time.Time) *AssetListing { - s.CreatedAt = &v - return s -} - -// SetForms sets the Forms field's value. -func (s *AssetListing) SetForms(v string) *AssetListing { - s.Forms = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *AssetListing) SetGlossaryTerms(v []*DetailedGlossaryTerm) *AssetListing { - s.GlossaryTerms = v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *AssetListing) SetOwningProjectId(v string) *AssetListing { - s.OwningProjectId = &v - return s -} - -// The details of an asset published in an Amazon DataZone catalog. -type AssetListingDetails struct { - _ struct{} `type:"structure"` - - // The identifier of an asset published in an Amazon DataZone catalog. - // - // ListingId is a required field - ListingId *string `locationName:"listingId" type:"string" required:"true"` - - // The status of an asset published in an Amazon DataZone catalog. - // - // ListingStatus is a required field - ListingStatus *string `locationName:"listingStatus" type:"string" required:"true" enum:"ListingStatus"` -} - -// 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 AssetListingDetails) 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 AssetListingDetails) GoString() string { - return s.String() -} - -// SetListingId sets the ListingId field's value. -func (s *AssetListingDetails) SetListingId(v string) *AssetListingDetails { - s.ListingId = &v - return s -} - -// SetListingStatus sets the ListingStatus field's value. -func (s *AssetListingDetails) SetListingStatus(v string) *AssetListingDetails { - s.ListingStatus = &v - return s -} - -// The details of an asset published in an Amazon DataZone catalog. -type AssetListingItem struct { - _ struct{} `type:"structure"` - - // The additional attributes of an asset published in an Amazon DataZone catalog. - AdditionalAttributes *AssetListingItemAdditionalAttributes `locationName:"additionalAttributes" type:"structure"` - - // The timestamp of when an asset published in an Amazon DataZone catalog was - // created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The description of an asset published in an Amazon DataZone catalog. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AssetListingItem's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the inventory asset. - EntityId *string `locationName:"entityId" type:"string"` - - // The revision of the inventory asset. - EntityRevision *string `locationName:"entityRevision" min:"1" type:"string"` - - // The type of the inventory asset. - EntityType *string `locationName:"entityType" min:"1" type:"string"` - - // Glossary terms attached to the inventory asset. - GlossaryTerms []*DetailedGlossaryTerm `locationName:"glossaryTerms" type:"list"` - - // The Amazon DataZone user who created the listing. - ListingCreatedBy *string `locationName:"listingCreatedBy" type:"string"` - - // The identifier of the listing (asset published in Amazon DataZone catalog). - ListingId *string `locationName:"listingId" type:"string"` - - // The revision of the listing (asset published in Amazon DataZone catalog). - ListingRevision *string `locationName:"listingRevision" min:"1" type:"string"` - - // The Amazon DataZone user who updated the listing. - ListingUpdatedBy *string `locationName:"listingUpdatedBy" type:"string"` - - // The name of the inventory asset. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AssetListingItem's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"true"` - - // The identifier of the project that owns the inventory asset. - OwningProjectId *string `locationName:"owningProjectId" 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 AssetListingItem) 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 AssetListingItem) GoString() string { - return s.String() -} - -// SetAdditionalAttributes sets the AdditionalAttributes field's value. -func (s *AssetListingItem) SetAdditionalAttributes(v *AssetListingItemAdditionalAttributes) *AssetListingItem { - s.AdditionalAttributes = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AssetListingItem) SetCreatedAt(v time.Time) *AssetListingItem { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AssetListingItem) SetDescription(v string) *AssetListingItem { - s.Description = &v - return s -} - -// SetEntityId sets the EntityId field's value. -func (s *AssetListingItem) SetEntityId(v string) *AssetListingItem { - s.EntityId = &v - return s -} - -// SetEntityRevision sets the EntityRevision field's value. -func (s *AssetListingItem) SetEntityRevision(v string) *AssetListingItem { - s.EntityRevision = &v - return s -} - -// SetEntityType sets the EntityType field's value. -func (s *AssetListingItem) SetEntityType(v string) *AssetListingItem { - s.EntityType = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *AssetListingItem) SetGlossaryTerms(v []*DetailedGlossaryTerm) *AssetListingItem { - s.GlossaryTerms = v - return s -} - -// SetListingCreatedBy sets the ListingCreatedBy field's value. -func (s *AssetListingItem) SetListingCreatedBy(v string) *AssetListingItem { - s.ListingCreatedBy = &v - return s -} - -// SetListingId sets the ListingId field's value. -func (s *AssetListingItem) SetListingId(v string) *AssetListingItem { - s.ListingId = &v - return s -} - -// SetListingRevision sets the ListingRevision field's value. -func (s *AssetListingItem) SetListingRevision(v string) *AssetListingItem { - s.ListingRevision = &v - return s -} - -// SetListingUpdatedBy sets the ListingUpdatedBy field's value. -func (s *AssetListingItem) SetListingUpdatedBy(v string) *AssetListingItem { - s.ListingUpdatedBy = &v - return s -} - -// SetName sets the Name field's value. -func (s *AssetListingItem) SetName(v string) *AssetListingItem { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *AssetListingItem) SetOwningProjectId(v string) *AssetListingItem { - s.OwningProjectId = &v - return s -} - -// Additional attributes of an inventory asset. -type AssetListingItemAdditionalAttributes struct { - _ struct{} `type:"structure"` - - // The metadata forms that form additional attributes of the metadata asset. - Forms *string `locationName:"forms" 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 AssetListingItemAdditionalAttributes) 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 AssetListingItemAdditionalAttributes) GoString() string { - return s.String() -} - -// SetForms sets the Forms field's value. -func (s *AssetListingItemAdditionalAttributes) SetForms(v string) *AssetListingItemAdditionalAttributes { - s.Forms = &v - return s -} - -// The revision of an inventory asset. -type AssetRevision struct { - _ struct{} `type:"structure"` - - // The timestamp of when an inventory asset revison was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the asset revision. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The Amazon DataZone user who created the inventory asset. - DomainId *string `locationName:"domainId" type:"string"` - - // The identifier of the inventory asset revision. - Id *string `locationName:"id" type:"string"` - - // The revision details of the inventory asset. - Revision *string `locationName:"revision" min:"1" 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 AssetRevision) 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 AssetRevision) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AssetRevision) SetCreatedAt(v time.Time) *AssetRevision { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *AssetRevision) SetCreatedBy(v string) *AssetRevision { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *AssetRevision) SetDomainId(v string) *AssetRevision { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *AssetRevision) SetId(v string) *AssetRevision { - s.Id = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *AssetRevision) SetRevision(v string) *AssetRevision { - s.Revision = &v - return s -} - -type AssetTargetNameMap struct { - _ struct{} `type:"structure"` - - // The identifier of the inventory asset. - // - // AssetId is a required field - AssetId *string `locationName:"assetId" type:"string" required:"true"` - - // The target name in the asset target name map. - // - // TargetName is a required field - TargetName *string `locationName:"targetName" 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 AssetTargetNameMap) 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 AssetTargetNameMap) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssetTargetNameMap) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssetTargetNameMap"} - if s.AssetId == nil { - invalidParams.Add(request.NewErrParamRequired("AssetId")) - } - if s.TargetName == nil { - invalidParams.Add(request.NewErrParamRequired("TargetName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssetId sets the AssetId field's value. -func (s *AssetTargetNameMap) SetAssetId(v string) *AssetTargetNameMap { - s.AssetId = &v - return s -} - -// SetTargetName sets the TargetName field's value. -func (s *AssetTargetNameMap) SetTargetName(v string) *AssetTargetNameMap { - s.TargetName = &v - return s -} - -// The details of the asset type. -type AssetTypeItem struct { - _ struct{} `type:"structure"` - - // The timestamp of when the asset type was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the asset type. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of the asset type. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AssetTypeItem's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain where the asset type exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The forms included in the details of the asset type. - // - // FormsOutput is a required field - FormsOutput map[string]*FormEntryOutput_ `locationName:"formsOutput" type:"map" required:"true"` - - // The name of the asset type. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain where the asset type was originally - // created. - OriginDomainId *string `locationName:"originDomainId" type:"string"` - - // The identifier of the Amazon DataZone project where the asset type exists. - OriginProjectId *string `locationName:"originProjectId" type:"string"` - - // The identifier of the Amazon DataZone project that owns the asset type. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The revision of the asset type. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The timestamp of when the asset type was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the asset type. - UpdatedBy *string `locationName:"updatedBy" 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 AssetTypeItem) 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 AssetTypeItem) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AssetTypeItem) SetCreatedAt(v time.Time) *AssetTypeItem { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *AssetTypeItem) SetCreatedBy(v string) *AssetTypeItem { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AssetTypeItem) SetDescription(v string) *AssetTypeItem { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *AssetTypeItem) SetDomainId(v string) *AssetTypeItem { - s.DomainId = &v - return s -} - -// SetFormsOutput sets the FormsOutput field's value. -func (s *AssetTypeItem) SetFormsOutput(v map[string]*FormEntryOutput_) *AssetTypeItem { - s.FormsOutput = v - return s -} - -// SetName sets the Name field's value. -func (s *AssetTypeItem) SetName(v string) *AssetTypeItem { - s.Name = &v - return s -} - -// SetOriginDomainId sets the OriginDomainId field's value. -func (s *AssetTypeItem) SetOriginDomainId(v string) *AssetTypeItem { - s.OriginDomainId = &v - return s -} - -// SetOriginProjectId sets the OriginProjectId field's value. -func (s *AssetTypeItem) SetOriginProjectId(v string) *AssetTypeItem { - s.OriginProjectId = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *AssetTypeItem) SetOwningProjectId(v string) *AssetTypeItem { - s.OwningProjectId = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *AssetTypeItem) SetRevision(v string) *AssetTypeItem { - s.Revision = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AssetTypeItem) SetUpdatedAt(v time.Time) *AssetTypeItem { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *AssetTypeItem) SetUpdatedBy(v string) *AssetTypeItem { - s.UpdatedBy = &v - return s -} - -// The configuration of the business name generation. -type BusinessNameGenerationConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies whether the business name generation is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` -} - -// 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 BusinessNameGenerationConfiguration) 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 BusinessNameGenerationConfiguration) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *BusinessNameGenerationConfiguration) SetEnabled(v bool) *BusinessNameGenerationConfiguration { - s.Enabled = &v - return s -} - -type CancelSubscriptionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the Amazon DataZone domain where the subscription - // request is being cancelled. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The unique identifier of the subscription that is being cancelled. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 CancelSubscriptionInput) 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 CancelSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelSubscriptionInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CancelSubscriptionInput) SetDomainIdentifier(v string) *CancelSubscriptionInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *CancelSubscriptionInput) SetIdentifier(v string) *CancelSubscriptionInput { - s.Identifier = &v - return s -} - -type CancelSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The timestamp that specifies when the request to cancel the subscription - // was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Specifies the Amazon DataZone user who is cancelling the subscription. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The unique identifier of the Amazon DataZone domain where the subscription - // is being cancelled. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the subscription. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Specifies whether the permissions to the asset are retained after the subscription - // is cancelled. - RetainPermissions *bool `locationName:"retainPermissions" type:"boolean"` - - // The status of the request to cancel the subscription. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionStatus"` - - // The asset to which a subscription is being cancelled. - // - // SubscribedListing is a required field - SubscribedListing *SubscribedListing `locationName:"subscribedListing" type:"structure" required:"true"` - - // The Amazon DataZone user who is made a subscriber to the specified asset - // by the subscription that is being cancelled. - // - // SubscribedPrincipal is a required field - SubscribedPrincipal *SubscribedPrincipal `locationName:"subscribedPrincipal" type:"structure" required:"true"` - - // The unique ID of the subscripton request for the subscription that is being - // cancelled. - SubscriptionRequestId *string `locationName:"subscriptionRequestId" type:"string"` - - // The timestamp that specifies when the subscription was cancelled. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user that cancelled the subscription. - UpdatedBy *string `locationName:"updatedBy" 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 CancelSubscriptionOutput) 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 CancelSubscriptionOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CancelSubscriptionOutput) SetCreatedAt(v time.Time) *CancelSubscriptionOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CancelSubscriptionOutput) SetCreatedBy(v string) *CancelSubscriptionOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CancelSubscriptionOutput) SetDomainId(v string) *CancelSubscriptionOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CancelSubscriptionOutput) SetId(v string) *CancelSubscriptionOutput { - s.Id = &v - return s -} - -// SetRetainPermissions sets the RetainPermissions field's value. -func (s *CancelSubscriptionOutput) SetRetainPermissions(v bool) *CancelSubscriptionOutput { - s.RetainPermissions = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CancelSubscriptionOutput) SetStatus(v string) *CancelSubscriptionOutput { - s.Status = &v - return s -} - -// SetSubscribedListing sets the SubscribedListing field's value. -func (s *CancelSubscriptionOutput) SetSubscribedListing(v *SubscribedListing) *CancelSubscriptionOutput { - s.SubscribedListing = v - return s -} - -// SetSubscribedPrincipal sets the SubscribedPrincipal field's value. -func (s *CancelSubscriptionOutput) SetSubscribedPrincipal(v *SubscribedPrincipal) *CancelSubscriptionOutput { - s.SubscribedPrincipal = v - return s -} - -// SetSubscriptionRequestId sets the SubscriptionRequestId field's value. -func (s *CancelSubscriptionOutput) SetSubscriptionRequestId(v string) *CancelSubscriptionOutput { - s.SubscriptionRequestId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CancelSubscriptionOutput) SetUpdatedAt(v time.Time) *CancelSubscriptionOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *CancelSubscriptionOutput) SetUpdatedBy(v string) *CancelSubscriptionOutput { - s.UpdatedBy = &v - return s -} - -// Part of the provisioning properties of the environment blueprint. -type CloudFormationProperties struct { - _ struct{} `type:"structure"` - - // The template URL of the cloud formation provisioning properties of the environment - // blueprint. - // - // TemplateUrl is a required field - TemplateUrl *string `locationName:"templateUrl" 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 CloudFormationProperties) 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 CloudFormationProperties) GoString() string { - return s.String() -} - -// SetTemplateUrl sets the TemplateUrl field's value. -func (s *CloudFormationProperties) SetTemplateUrl(v string) *CloudFormationProperties { - s.TemplateUrl = &v - return s -} - -// The details of the parameters for the configurable environment action. -type ConfigurableActionParameter struct { - _ struct{} `type:"structure"` - - // The key of the configurable action parameter. - Key *string `locationName:"key" type:"string"` - - // The value of the configurable action parameter. - Value *string `locationName:"value" 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 ConfigurableActionParameter) 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 ConfigurableActionParameter) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *ConfigurableActionParameter) SetKey(v string) *ConfigurableActionParameter { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *ConfigurableActionParameter) SetValue(v string) *ConfigurableActionParameter { - s.Value = &v - return s -} - -// The configurable action of a Amazon DataZone environment. -type ConfigurableEnvironmentAction struct { - _ struct{} `type:"structure"` - - // The authentication type of a configurable action of a Amazon DataZone environment. - Auth *string `locationName:"auth" type:"string" enum:"ConfigurableActionTypeAuthorization"` - - // The parameters of a configurable action in a Amazon DataZone environment. - // - // Parameters is a required field - Parameters []*ConfigurableActionParameter `locationName:"parameters" type:"list" required:"true"` - - // The type of a configurable action in a Amazon DataZone environment. - // - // Type is a required field - Type *string `locationName:"type" 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 ConfigurableEnvironmentAction) 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 ConfigurableEnvironmentAction) GoString() string { - return s.String() -} - -// SetAuth sets the Auth field's value. -func (s *ConfigurableEnvironmentAction) SetAuth(v string) *ConfigurableEnvironmentAction { - s.Auth = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ConfigurableEnvironmentAction) SetParameters(v []*ConfigurableActionParameter) *ConfigurableEnvironmentAction { - s.Parameters = v - return s -} - -// SetType sets the Type field's value. -func (s *ConfigurableEnvironmentAction) SetType(v string) *ConfigurableEnvironmentAction { - s.Type = &v - return s -} - -// There is a conflict while performing this action. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateAssetInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Asset description. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // Amazon DataZone domain where the asset is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // ExternalIdentifier is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetInput's - // String and GoString methods. - ExternalIdentifier *string `locationName:"externalIdentifier" min:"1" type:"string" sensitive:"true"` - - // Metadata forms attached to the asset. - // - // FormsInput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetInput's - // String and GoString methods. - FormsInput []*FormInput_ `locationName:"formsInput" type:"list" sensitive:"true"` - - // Glossary terms attached to the asset. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // Asset name. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The unique identifier of the project that owns this asset. - // - // OwningProjectIdentifier is a required field - OwningProjectIdentifier *string `locationName:"owningProjectIdentifier" type:"string" required:"true"` - - // The configuration of the automatically generated business-friendly metadata - // for the asset. - PredictionConfiguration *PredictionConfiguration `locationName:"predictionConfiguration" type:"structure"` - - // The unique identifier of this asset's type. - // - // TypeIdentifier is a required field - TypeIdentifier *string `locationName:"typeIdentifier" min:"1" type:"string" required:"true"` - - // The revision of this asset's type. - TypeRevision *string `locationName:"typeRevision" min:"1" 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 CreateAssetInput) 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 CreateAssetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssetInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.ExternalIdentifier != nil && len(*s.ExternalIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExternalIdentifier", 1)) - } - if s.GlossaryTerms != nil && len(s.GlossaryTerms) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GlossaryTerms", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.OwningProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OwningProjectIdentifier")) - } - if s.TypeIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TypeIdentifier")) - } - if s.TypeIdentifier != nil && len(*s.TypeIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeIdentifier", 1)) - } - if s.TypeRevision != nil && len(*s.TypeRevision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeRevision", 1)) - } - if s.FormsInput != nil { - for i, v := range s.FormsInput { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "FormsInput", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAssetInput) SetClientToken(v string) *CreateAssetInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAssetInput) SetDescription(v string) *CreateAssetInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateAssetInput) SetDomainIdentifier(v string) *CreateAssetInput { - s.DomainIdentifier = &v - return s -} - -// SetExternalIdentifier sets the ExternalIdentifier field's value. -func (s *CreateAssetInput) SetExternalIdentifier(v string) *CreateAssetInput { - s.ExternalIdentifier = &v - return s -} - -// SetFormsInput sets the FormsInput field's value. -func (s *CreateAssetInput) SetFormsInput(v []*FormInput_) *CreateAssetInput { - s.FormsInput = v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *CreateAssetInput) SetGlossaryTerms(v []*string) *CreateAssetInput { - s.GlossaryTerms = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssetInput) SetName(v string) *CreateAssetInput { - s.Name = &v - return s -} - -// SetOwningProjectIdentifier sets the OwningProjectIdentifier field's value. -func (s *CreateAssetInput) SetOwningProjectIdentifier(v string) *CreateAssetInput { - s.OwningProjectIdentifier = &v - return s -} - -// SetPredictionConfiguration sets the PredictionConfiguration field's value. -func (s *CreateAssetInput) SetPredictionConfiguration(v *PredictionConfiguration) *CreateAssetInput { - s.PredictionConfiguration = v - return s -} - -// SetTypeIdentifier sets the TypeIdentifier field's value. -func (s *CreateAssetInput) SetTypeIdentifier(v string) *CreateAssetInput { - s.TypeIdentifier = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *CreateAssetInput) SetTypeRevision(v string) *CreateAssetInput { - s.TypeRevision = &v - return s -} - -type CreateAssetOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the asset was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user that created this asset in the catalog. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of the created asset. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which the asset was created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // ExternalIdentifier is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetOutput's - // String and GoString methods. - ExternalIdentifier *string `locationName:"externalIdentifier" min:"1" type:"string" sensitive:"true"` - - // The timestamp of when the first revision of the asset took place. - FirstRevisionCreatedAt *time.Time `locationName:"firstRevisionCreatedAt" type:"timestamp"` - - // The Amazon DataZone user that made the first revision of the asset. - FirstRevisionCreatedBy *string `locationName:"firstRevisionCreatedBy" type:"string"` - - // The metadata forms that are attached to the created asset. - // - // FormsOutput is a required field - FormsOutput []*FormOutput_ `locationName:"formsOutput" type:"list" required:"true"` - - // The glossary terms that are attached to the created asset. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The unique identifier of the created asset. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The details of an asset published in an Amazon DataZone catalog. - Listing *AssetListingDetails `locationName:"listing" type:"structure"` - - // The name of the created asset. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone project that owns the created asset. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The configuration of the automatically generated business-friendly metadata - // for the asset. - PredictionConfiguration *PredictionConfiguration `locationName:"predictionConfiguration" type:"structure"` - - // The read-only metadata forms that are attached to the created asset. - ReadOnlyFormsOutput []*FormOutput_ `locationName:"readOnlyFormsOutput" type:"list"` - - // The revision of the asset. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The identifier of the created asset type. - // - // TypeIdentifier is a required field - TypeIdentifier *string `locationName:"typeIdentifier" min:"1" type:"string" required:"true"` - - // The revision type of the asset. - // - // TypeRevision is a required field - TypeRevision *string `locationName:"typeRevision" min:"1" 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 CreateAssetOutput) 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 CreateAssetOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateAssetOutput) SetCreatedAt(v time.Time) *CreateAssetOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateAssetOutput) SetCreatedBy(v string) *CreateAssetOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAssetOutput) SetDescription(v string) *CreateAssetOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateAssetOutput) SetDomainId(v string) *CreateAssetOutput { - s.DomainId = &v - return s -} - -// SetExternalIdentifier sets the ExternalIdentifier field's value. -func (s *CreateAssetOutput) SetExternalIdentifier(v string) *CreateAssetOutput { - s.ExternalIdentifier = &v - return s -} - -// SetFirstRevisionCreatedAt sets the FirstRevisionCreatedAt field's value. -func (s *CreateAssetOutput) SetFirstRevisionCreatedAt(v time.Time) *CreateAssetOutput { - s.FirstRevisionCreatedAt = &v - return s -} - -// SetFirstRevisionCreatedBy sets the FirstRevisionCreatedBy field's value. -func (s *CreateAssetOutput) SetFirstRevisionCreatedBy(v string) *CreateAssetOutput { - s.FirstRevisionCreatedBy = &v - return s -} - -// SetFormsOutput sets the FormsOutput field's value. -func (s *CreateAssetOutput) SetFormsOutput(v []*FormOutput_) *CreateAssetOutput { - s.FormsOutput = v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *CreateAssetOutput) SetGlossaryTerms(v []*string) *CreateAssetOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateAssetOutput) SetId(v string) *CreateAssetOutput { - s.Id = &v - return s -} - -// SetListing sets the Listing field's value. -func (s *CreateAssetOutput) SetListing(v *AssetListingDetails) *CreateAssetOutput { - s.Listing = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssetOutput) SetName(v string) *CreateAssetOutput { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *CreateAssetOutput) SetOwningProjectId(v string) *CreateAssetOutput { - s.OwningProjectId = &v - return s -} - -// SetPredictionConfiguration sets the PredictionConfiguration field's value. -func (s *CreateAssetOutput) SetPredictionConfiguration(v *PredictionConfiguration) *CreateAssetOutput { - s.PredictionConfiguration = v - return s -} - -// SetReadOnlyFormsOutput sets the ReadOnlyFormsOutput field's value. -func (s *CreateAssetOutput) SetReadOnlyFormsOutput(v []*FormOutput_) *CreateAssetOutput { - s.ReadOnlyFormsOutput = v - return s -} - -// SetRevision sets the Revision field's value. -func (s *CreateAssetOutput) SetRevision(v string) *CreateAssetOutput { - s.Revision = &v - return s -} - -// SetTypeIdentifier sets the TypeIdentifier field's value. -func (s *CreateAssetOutput) SetTypeIdentifier(v string) *CreateAssetOutput { - s.TypeIdentifier = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *CreateAssetOutput) SetTypeRevision(v string) *CreateAssetOutput { - s.TypeRevision = &v - return s -} - -type CreateAssetRevisionInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The revised description of the asset. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetRevisionInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The unique identifier of the domain where the asset is being revised. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The metadata forms to be attached to the asset as part of asset revision. - // - // FormsInput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetRevisionInput's - // String and GoString methods. - FormsInput []*FormInput_ `locationName:"formsInput" type:"list" sensitive:"true"` - - // The glossary terms to be attached to the asset as part of asset revision. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The identifier of the asset. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // Te revised name of the asset. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetRevisionInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The configuration of the automatically generated business-friendly metadata - // for the asset. - PredictionConfiguration *PredictionConfiguration `locationName:"predictionConfiguration" type:"structure"` - - // The revision type of the asset. - TypeRevision *string `locationName:"typeRevision" min:"1" 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 CreateAssetRevisionInput) 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 CreateAssetRevisionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssetRevisionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssetRevisionInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GlossaryTerms != nil && len(s.GlossaryTerms) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GlossaryTerms", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TypeRevision != nil && len(*s.TypeRevision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeRevision", 1)) - } - if s.FormsInput != nil { - for i, v := range s.FormsInput { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "FormsInput", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAssetRevisionInput) SetClientToken(v string) *CreateAssetRevisionInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAssetRevisionInput) SetDescription(v string) *CreateAssetRevisionInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateAssetRevisionInput) SetDomainIdentifier(v string) *CreateAssetRevisionInput { - s.DomainIdentifier = &v - return s -} - -// SetFormsInput sets the FormsInput field's value. -func (s *CreateAssetRevisionInput) SetFormsInput(v []*FormInput_) *CreateAssetRevisionInput { - s.FormsInput = v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *CreateAssetRevisionInput) SetGlossaryTerms(v []*string) *CreateAssetRevisionInput { - s.GlossaryTerms = v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *CreateAssetRevisionInput) SetIdentifier(v string) *CreateAssetRevisionInput { - s.Identifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssetRevisionInput) SetName(v string) *CreateAssetRevisionInput { - s.Name = &v - return s -} - -// SetPredictionConfiguration sets the PredictionConfiguration field's value. -func (s *CreateAssetRevisionInput) SetPredictionConfiguration(v *PredictionConfiguration) *CreateAssetRevisionInput { - s.PredictionConfiguration = v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *CreateAssetRevisionInput) SetTypeRevision(v string) *CreateAssetRevisionInput { - s.TypeRevision = &v - return s -} - -type CreateAssetRevisionOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the asset revision occured. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who performed the asset revision. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The revised asset description. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetRevisionOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The unique identifier of the Amazon DataZone domain where the asset was revised. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // ExternalIdentifier is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetRevisionOutput's - // String and GoString methods. - ExternalIdentifier *string `locationName:"externalIdentifier" min:"1" type:"string" sensitive:"true"` - - // The timestamp of when the first asset revision occured. - FirstRevisionCreatedAt *time.Time `locationName:"firstRevisionCreatedAt" type:"timestamp"` - - // The Amazon DataZone user who performed the first asset revision. - FirstRevisionCreatedBy *string `locationName:"firstRevisionCreatedBy" type:"string"` - - // The metadata forms that were attached to the asset as part of the asset revision. - // - // FormsOutput is a required field - FormsOutput []*FormOutput_ `locationName:"formsOutput" type:"list" required:"true"` - - // The glossary terms that were attached to the asset as part of asset revision. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The unique identifier of the asset revision. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The details of an asset published in an Amazon DataZone catalog. - Listing *AssetListingDetails `locationName:"listing" type:"structure"` - - // The revised name of the asset. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetRevisionOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The unique identifier of the revised project that owns the asset. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The configuration of the automatically generated business-friendly metadata - // for the asset. - PredictionConfiguration *PredictionConfiguration `locationName:"predictionConfiguration" type:"structure"` - - // The read-only metadata forms that were attached to the asset as part of the - // asset revision. - ReadOnlyFormsOutput []*FormOutput_ `locationName:"readOnlyFormsOutput" type:"list"` - - // The revision of the asset. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The identifier of the revision type. - // - // TypeIdentifier is a required field - TypeIdentifier *string `locationName:"typeIdentifier" min:"1" type:"string" required:"true"` - - // The revision type of the asset. - // - // TypeRevision is a required field - TypeRevision *string `locationName:"typeRevision" min:"1" 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 CreateAssetRevisionOutput) 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 CreateAssetRevisionOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateAssetRevisionOutput) SetCreatedAt(v time.Time) *CreateAssetRevisionOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateAssetRevisionOutput) SetCreatedBy(v string) *CreateAssetRevisionOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAssetRevisionOutput) SetDescription(v string) *CreateAssetRevisionOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateAssetRevisionOutput) SetDomainId(v string) *CreateAssetRevisionOutput { - s.DomainId = &v - return s -} - -// SetExternalIdentifier sets the ExternalIdentifier field's value. -func (s *CreateAssetRevisionOutput) SetExternalIdentifier(v string) *CreateAssetRevisionOutput { - s.ExternalIdentifier = &v - return s -} - -// SetFirstRevisionCreatedAt sets the FirstRevisionCreatedAt field's value. -func (s *CreateAssetRevisionOutput) SetFirstRevisionCreatedAt(v time.Time) *CreateAssetRevisionOutput { - s.FirstRevisionCreatedAt = &v - return s -} - -// SetFirstRevisionCreatedBy sets the FirstRevisionCreatedBy field's value. -func (s *CreateAssetRevisionOutput) SetFirstRevisionCreatedBy(v string) *CreateAssetRevisionOutput { - s.FirstRevisionCreatedBy = &v - return s -} - -// SetFormsOutput sets the FormsOutput field's value. -func (s *CreateAssetRevisionOutput) SetFormsOutput(v []*FormOutput_) *CreateAssetRevisionOutput { - s.FormsOutput = v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *CreateAssetRevisionOutput) SetGlossaryTerms(v []*string) *CreateAssetRevisionOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateAssetRevisionOutput) SetId(v string) *CreateAssetRevisionOutput { - s.Id = &v - return s -} - -// SetListing sets the Listing field's value. -func (s *CreateAssetRevisionOutput) SetListing(v *AssetListingDetails) *CreateAssetRevisionOutput { - s.Listing = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssetRevisionOutput) SetName(v string) *CreateAssetRevisionOutput { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *CreateAssetRevisionOutput) SetOwningProjectId(v string) *CreateAssetRevisionOutput { - s.OwningProjectId = &v - return s -} - -// SetPredictionConfiguration sets the PredictionConfiguration field's value. -func (s *CreateAssetRevisionOutput) SetPredictionConfiguration(v *PredictionConfiguration) *CreateAssetRevisionOutput { - s.PredictionConfiguration = v - return s -} - -// SetReadOnlyFormsOutput sets the ReadOnlyFormsOutput field's value. -func (s *CreateAssetRevisionOutput) SetReadOnlyFormsOutput(v []*FormOutput_) *CreateAssetRevisionOutput { - s.ReadOnlyFormsOutput = v - return s -} - -// SetRevision sets the Revision field's value. -func (s *CreateAssetRevisionOutput) SetRevision(v string) *CreateAssetRevisionOutput { - s.Revision = &v - return s -} - -// SetTypeIdentifier sets the TypeIdentifier field's value. -func (s *CreateAssetRevisionOutput) SetTypeIdentifier(v string) *CreateAssetRevisionOutput { - s.TypeIdentifier = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *CreateAssetRevisionOutput) SetTypeRevision(v string) *CreateAssetRevisionOutput { - s.TypeRevision = &v - return s -} - -type CreateAssetTypeInput struct { - _ struct{} `type:"structure"` - - // The descripton of the custom asset type. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetTypeInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The unique identifier of the Amazon DataZone domain where the custom asset - // type is being created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The metadata forms that are to be attached to the custom asset type. - // - // FormsInput is a required field - FormsInput map[string]*FormEntryInput_ `locationName:"formsInput" type:"map" required:"true"` - - // The name of the custom asset type. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The identifier of the Amazon DataZone project that is to own the custom asset - // type. - // - // OwningProjectIdentifier is a required field - OwningProjectIdentifier *string `locationName:"owningProjectIdentifier" 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 CreateAssetTypeInput) 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 CreateAssetTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssetTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssetTypeInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.FormsInput == nil { - invalidParams.Add(request.NewErrParamRequired("FormsInput")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.OwningProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OwningProjectIdentifier")) - } - if s.FormsInput != nil { - for i, v := range s.FormsInput { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "FormsInput", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateAssetTypeInput) SetDescription(v string) *CreateAssetTypeInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateAssetTypeInput) SetDomainIdentifier(v string) *CreateAssetTypeInput { - s.DomainIdentifier = &v - return s -} - -// SetFormsInput sets the FormsInput field's value. -func (s *CreateAssetTypeInput) SetFormsInput(v map[string]*FormEntryInput_) *CreateAssetTypeInput { - s.FormsInput = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssetTypeInput) SetName(v string) *CreateAssetTypeInput { - s.Name = &v - return s -} - -// SetOwningProjectIdentifier sets the OwningProjectIdentifier field's value. -func (s *CreateAssetTypeInput) SetOwningProjectIdentifier(v string) *CreateAssetTypeInput { - s.OwningProjectIdentifier = &v - return s -} - -type CreateAssetTypeOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the asset type is to be created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who creates this custom asset type. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of the custom asset type. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAssetTypeOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which the asset type was created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The metadata forms that are attached to the asset type. - // - // FormsOutput is a required field - FormsOutput map[string]*FormEntryOutput_ `locationName:"formsOutput" type:"map" required:"true"` - - // The name of the asset type. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain where the asset type was originally - // created. - OriginDomainId *string `locationName:"originDomainId" type:"string"` - - // The ID of the Amazon DataZone project where the asset type was originally - // created. - OriginProjectId *string `locationName:"originProjectId" type:"string"` - - // The ID of the Amazon DataZone project that currently owns this asset type. - OwningProjectId *string `locationName:"owningProjectId" type:"string"` - - // The revision of the custom asset type. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The timestamp of when the custom type was created. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user that created the custom asset type. - UpdatedBy *string `locationName:"updatedBy" 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 CreateAssetTypeOutput) 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 CreateAssetTypeOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateAssetTypeOutput) SetCreatedAt(v time.Time) *CreateAssetTypeOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateAssetTypeOutput) SetCreatedBy(v string) *CreateAssetTypeOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAssetTypeOutput) SetDescription(v string) *CreateAssetTypeOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateAssetTypeOutput) SetDomainId(v string) *CreateAssetTypeOutput { - s.DomainId = &v - return s -} - -// SetFormsOutput sets the FormsOutput field's value. -func (s *CreateAssetTypeOutput) SetFormsOutput(v map[string]*FormEntryOutput_) *CreateAssetTypeOutput { - s.FormsOutput = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssetTypeOutput) SetName(v string) *CreateAssetTypeOutput { - s.Name = &v - return s -} - -// SetOriginDomainId sets the OriginDomainId field's value. -func (s *CreateAssetTypeOutput) SetOriginDomainId(v string) *CreateAssetTypeOutput { - s.OriginDomainId = &v - return s -} - -// SetOriginProjectId sets the OriginProjectId field's value. -func (s *CreateAssetTypeOutput) SetOriginProjectId(v string) *CreateAssetTypeOutput { - s.OriginProjectId = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *CreateAssetTypeOutput) SetOwningProjectId(v string) *CreateAssetTypeOutput { - s.OwningProjectId = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *CreateAssetTypeOutput) SetRevision(v string) *CreateAssetTypeOutput { - s.Revision = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateAssetTypeOutput) SetUpdatedAt(v time.Time) *CreateAssetTypeOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *CreateAssetTypeOutput) SetUpdatedBy(v string) *CreateAssetTypeOutput { - s.UpdatedBy = &v - return s -} - -type CreateDataSourceInput struct { - _ struct{} `type:"structure"` - - // The metadata forms that are to be attached to the assets that this data source - // works with. - // - // AssetFormsInput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateDataSourceInput's - // String and GoString methods. - AssetFormsInput []*FormInput_ `locationName:"assetFormsInput" type:"list" sensitive:"true"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // Specifies the configuration of the data source. It can be set to either glueRunConfiguration - // or redshiftRunConfiguration. - Configuration *DataSourceConfigurationInput_ `locationName:"configuration" type:"structure"` - - // The description of the data source. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateDataSourceInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain where the data source is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Specifies whether the data source is enabled. - EnableSetting *string `locationName:"enableSetting" type:"string" enum:"EnableSetting"` - - // The unique identifier of the Amazon DataZone environment to which the data - // source publishes assets. - // - // EnvironmentIdentifier is a required field - EnvironmentIdentifier *string `locationName:"environmentIdentifier" type:"string" required:"true"` - - // The name of the data source. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateDataSourceInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the Amazon DataZone project in which you want to add this - // data source. - // - // ProjectIdentifier is a required field - ProjectIdentifier *string `locationName:"projectIdentifier" type:"string" required:"true"` - - // Specifies whether the assets that this data source creates in the inventory - // are to be also automatically published to the catalog. - PublishOnImport *bool `locationName:"publishOnImport" type:"boolean"` - - // Specifies whether the business name generation is to be enabled for this - // data source. - Recommendation *RecommendationConfiguration `locationName:"recommendation" type:"structure"` - - // The schedule of the data source runs. - // - // Schedule is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateDataSourceInput's - // String and GoString methods. - Schedule *ScheduleConfiguration `locationName:"schedule" type:"structure" sensitive:"true"` - - // The type of the data source. - // - // Type is a required field - Type *string `locationName:"type" min:"1" 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 CreateDataSourceInput) 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 CreateDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDataSourceInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentIdentifier")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectIdentifier")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Type != nil && len(*s.Type) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Type", 1)) - } - if s.AssetFormsInput != nil { - for i, v := range s.AssetFormsInput { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AssetFormsInput", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - if s.Schedule != nil { - if err := s.Schedule.Validate(); err != nil { - invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssetFormsInput sets the AssetFormsInput field's value. -func (s *CreateDataSourceInput) SetAssetFormsInput(v []*FormInput_) *CreateDataSourceInput { - s.AssetFormsInput = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDataSourceInput) SetClientToken(v string) *CreateDataSourceInput { - s.ClientToken = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *CreateDataSourceInput) SetConfiguration(v *DataSourceConfigurationInput_) *CreateDataSourceInput { - s.Configuration = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDataSourceInput) SetDescription(v string) *CreateDataSourceInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateDataSourceInput) SetDomainIdentifier(v string) *CreateDataSourceInput { - s.DomainIdentifier = &v - return s -} - -// SetEnableSetting sets the EnableSetting field's value. -func (s *CreateDataSourceInput) SetEnableSetting(v string) *CreateDataSourceInput { - s.EnableSetting = &v - return s -} - -// SetEnvironmentIdentifier sets the EnvironmentIdentifier field's value. -func (s *CreateDataSourceInput) SetEnvironmentIdentifier(v string) *CreateDataSourceInput { - s.EnvironmentIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDataSourceInput) SetName(v string) *CreateDataSourceInput { - s.Name = &v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *CreateDataSourceInput) SetProjectIdentifier(v string) *CreateDataSourceInput { - s.ProjectIdentifier = &v - return s -} - -// SetPublishOnImport sets the PublishOnImport field's value. -func (s *CreateDataSourceInput) SetPublishOnImport(v bool) *CreateDataSourceInput { - s.PublishOnImport = &v - return s -} - -// SetRecommendation sets the Recommendation field's value. -func (s *CreateDataSourceInput) SetRecommendation(v *RecommendationConfiguration) *CreateDataSourceInput { - s.Recommendation = v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *CreateDataSourceInput) SetSchedule(v *ScheduleConfiguration) *CreateDataSourceInput { - s.Schedule = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateDataSourceInput) SetType(v string) *CreateDataSourceInput { - s.Type = &v - return s -} - -type CreateDataSourceOutput struct { - _ struct{} `type:"structure"` - - // The metadata forms attached to the assets that this data source creates. - AssetFormsOutput []*FormOutput_ `locationName:"assetFormsOutput" type:"list"` - - // Specifies the configuration of the data source. It can be set to either glueRunConfiguration - // or redshiftRunConfiguration. - Configuration *DataSourceConfigurationOutput_ `locationName:"configuration" type:"structure"` - - // The timestamp of when the data source was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The description of the data source. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateDataSourceOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which the data source is created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // Specifies whether the data source is enabled. - EnableSetting *string `locationName:"enableSetting" type:"string" enum:"EnableSetting"` - - // The unique identifier of the Amazon DataZone environment to which the data - // source publishes assets. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - ErrorMessage *DataSourceErrorMessage `locationName:"errorMessage" type:"structure"` - - // The unique identifier of the data source. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The timestamp that specifies when the data source was last run. - LastRunAt *time.Time `locationName:"lastRunAt" type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - LastRunErrorMessage *DataSourceErrorMessage `locationName:"lastRunErrorMessage" type:"structure"` - - // The status of the last run of this data source. - LastRunStatus *string `locationName:"lastRunStatus" type:"string" enum:"DataSourceRunStatus"` - - // The name of the data source. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateDataSourceOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone project to which the data source is added. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // Specifies whether the assets that this data source creates in the inventory - // are to be also automatically published to the catalog. - PublishOnImport *bool `locationName:"publishOnImport" type:"boolean"` - - // Specifies whether the business name generation is to be enabled for this - // data source. - Recommendation *RecommendationConfiguration `locationName:"recommendation" type:"structure"` - - // The schedule of the data source runs. - // - // Schedule is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateDataSourceOutput's - // String and GoString methods. - Schedule *ScheduleConfiguration `locationName:"schedule" type:"structure" sensitive:"true"` - - // The status of the data source. - Status *string `locationName:"status" type:"string" enum:"DataSourceStatus"` - - // The type of the data source. - Type *string `locationName:"type" min:"1" type:"string"` - - // The timestamp of when the data source was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 CreateDataSourceOutput) 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 CreateDataSourceOutput) GoString() string { - return s.String() -} - -// SetAssetFormsOutput sets the AssetFormsOutput field's value. -func (s *CreateDataSourceOutput) SetAssetFormsOutput(v []*FormOutput_) *CreateDataSourceOutput { - s.AssetFormsOutput = v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *CreateDataSourceOutput) SetConfiguration(v *DataSourceConfigurationOutput_) *CreateDataSourceOutput { - s.Configuration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateDataSourceOutput) SetCreatedAt(v time.Time) *CreateDataSourceOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDataSourceOutput) SetDescription(v string) *CreateDataSourceOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateDataSourceOutput) SetDomainId(v string) *CreateDataSourceOutput { - s.DomainId = &v - return s -} - -// SetEnableSetting sets the EnableSetting field's value. -func (s *CreateDataSourceOutput) SetEnableSetting(v string) *CreateDataSourceOutput { - s.EnableSetting = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *CreateDataSourceOutput) SetEnvironmentId(v string) *CreateDataSourceOutput { - s.EnvironmentId = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *CreateDataSourceOutput) SetErrorMessage(v *DataSourceErrorMessage) *CreateDataSourceOutput { - s.ErrorMessage = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateDataSourceOutput) SetId(v string) *CreateDataSourceOutput { - s.Id = &v - return s -} - -// SetLastRunAt sets the LastRunAt field's value. -func (s *CreateDataSourceOutput) SetLastRunAt(v time.Time) *CreateDataSourceOutput { - s.LastRunAt = &v - return s -} - -// SetLastRunErrorMessage sets the LastRunErrorMessage field's value. -func (s *CreateDataSourceOutput) SetLastRunErrorMessage(v *DataSourceErrorMessage) *CreateDataSourceOutput { - s.LastRunErrorMessage = v - return s -} - -// SetLastRunStatus sets the LastRunStatus field's value. -func (s *CreateDataSourceOutput) SetLastRunStatus(v string) *CreateDataSourceOutput { - s.LastRunStatus = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDataSourceOutput) SetName(v string) *CreateDataSourceOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *CreateDataSourceOutput) SetProjectId(v string) *CreateDataSourceOutput { - s.ProjectId = &v - return s -} - -// SetPublishOnImport sets the PublishOnImport field's value. -func (s *CreateDataSourceOutput) SetPublishOnImport(v bool) *CreateDataSourceOutput { - s.PublishOnImport = &v - return s -} - -// SetRecommendation sets the Recommendation field's value. -func (s *CreateDataSourceOutput) SetRecommendation(v *RecommendationConfiguration) *CreateDataSourceOutput { - s.Recommendation = v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *CreateDataSourceOutput) SetSchedule(v *ScheduleConfiguration) *CreateDataSourceOutput { - s.Schedule = v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateDataSourceOutput) SetStatus(v string) *CreateDataSourceOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateDataSourceOutput) SetType(v string) *CreateDataSourceOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateDataSourceOutput) SetUpdatedAt(v time.Time) *CreateDataSourceOutput { - s.UpdatedAt = &v - return s -} - -type CreateDomainInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The description of the Amazon DataZone domain. - Description *string `locationName:"description" type:"string"` - - // The domain execution role that is created when an Amazon DataZone domain - // is created. The domain execution role is created in the Amazon Web Services - // account that houses the Amazon DataZone domain. - // - // DomainExecutionRole is a required field - DomainExecutionRole *string `locationName:"domainExecutionRole" type:"string" required:"true"` - - // The identifier of the Amazon Web Services Key Management Service (KMS) key - // that is used to encrypt the Amazon DataZone domain, metadata, and reporting - // data. - KmsKeyIdentifier *string `locationName:"kmsKeyIdentifier" min:"1" type:"string"` - - // The name of the Amazon DataZone domain. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The single-sign on configuration of the Amazon DataZone domain. - SingleSignOn *SingleSignOn `locationName:"singleSignOn" type:"structure"` - - // The tags specified for the Amazon DataZone domain. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateDomainInput) 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 CreateDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDomainInput"} - if s.DomainExecutionRole == nil { - invalidParams.Add(request.NewErrParamRequired("DomainExecutionRole")) - } - if s.KmsKeyIdentifier != nil && len(*s.KmsKeyIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyIdentifier", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDomainInput) SetClientToken(v string) *CreateDomainInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDomainInput) SetDescription(v string) *CreateDomainInput { - s.Description = &v - return s -} - -// SetDomainExecutionRole sets the DomainExecutionRole field's value. -func (s *CreateDomainInput) SetDomainExecutionRole(v string) *CreateDomainInput { - s.DomainExecutionRole = &v - return s -} - -// SetKmsKeyIdentifier sets the KmsKeyIdentifier field's value. -func (s *CreateDomainInput) SetKmsKeyIdentifier(v string) *CreateDomainInput { - s.KmsKeyIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDomainInput) SetName(v string) *CreateDomainInput { - s.Name = &v - return s -} - -// SetSingleSignOn sets the SingleSignOn field's value. -func (s *CreateDomainInput) SetSingleSignOn(v *SingleSignOn) *CreateDomainInput { - s.SingleSignOn = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDomainInput) SetTags(v map[string]*string) *CreateDomainInput { - s.Tags = v - return s -} - -type CreateDomainOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the Amazon DataZone domain. - Arn *string `locationName:"arn" type:"string"` - - // The description of the Amazon DataZone domain. - Description *string `locationName:"description" type:"string"` - - // The domain execution role that is created when an Amazon DataZone domain - // is created. The domain execution role is created in the Amazon Web Services - // account that houses the Amazon DataZone domain. - DomainExecutionRole *string `locationName:"domainExecutionRole" type:"string"` - - // The identifier of the Amazon DataZone domain. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The identifier of the Amazon Web Services Key Management Service (KMS) key - // that is used to encrypt the Amazon DataZone domain, metadata, and reporting - // data. - KmsKeyIdentifier *string `locationName:"kmsKeyIdentifier" min:"1" type:"string"` - - // The name of the Amazon DataZone domain. - Name *string `locationName:"name" type:"string"` - - // The URL of the data portal for this Amazon DataZone domain. - PortalUrl *string `locationName:"portalUrl" type:"string"` - - // The single-sign on configuration of the Amazon DataZone domain. - SingleSignOn *SingleSignOn `locationName:"singleSignOn" type:"structure"` - - // The status of the Amazon DataZone domain. - Status *string `locationName:"status" type:"string" enum:"DomainStatus"` - - // The tags specified for the Amazon DataZone domain. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateDomainOutput) 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 CreateDomainOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateDomainOutput) SetArn(v string) *CreateDomainOutput { - s.Arn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDomainOutput) SetDescription(v string) *CreateDomainOutput { - s.Description = &v - return s -} - -// SetDomainExecutionRole sets the DomainExecutionRole field's value. -func (s *CreateDomainOutput) SetDomainExecutionRole(v string) *CreateDomainOutput { - s.DomainExecutionRole = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateDomainOutput) SetId(v string) *CreateDomainOutput { - s.Id = &v - return s -} - -// SetKmsKeyIdentifier sets the KmsKeyIdentifier field's value. -func (s *CreateDomainOutput) SetKmsKeyIdentifier(v string) *CreateDomainOutput { - s.KmsKeyIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDomainOutput) SetName(v string) *CreateDomainOutput { - s.Name = &v - return s -} - -// SetPortalUrl sets the PortalUrl field's value. -func (s *CreateDomainOutput) SetPortalUrl(v string) *CreateDomainOutput { - s.PortalUrl = &v - return s -} - -// SetSingleSignOn sets the SingleSignOn field's value. -func (s *CreateDomainOutput) SetSingleSignOn(v *SingleSignOn) *CreateDomainOutput { - s.SingleSignOn = v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateDomainOutput) SetStatus(v string) *CreateDomainOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDomainOutput) SetTags(v map[string]*string) *CreateDomainOutput { - s.Tags = v - return s -} - -type CreateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // The description of the Amazon DataZone environment. - Description *string `locationName:"description" type:"string"` - - // The identifier of the Amazon DataZone domain in which the environment is - // created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the environment profile that is used to create this Amazon - // DataZone environment. - // - // EnvironmentProfileIdentifier is a required field - EnvironmentProfileIdentifier *string `locationName:"environmentProfileIdentifier" type:"string" required:"true"` - - // The glossary terms that can be used in this Amazon DataZone environment. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The name of the Amazon DataZone environment. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The identifier of the Amazon DataZone project in which this environment is - // created. - // - // ProjectIdentifier is a required field - ProjectIdentifier *string `locationName:"projectIdentifier" type:"string" required:"true"` - - // The user parameters of this Amazon DataZone environment. - UserParameters []*EnvironmentParameter `locationName:"userParameters" type:"list"` -} - -// 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 CreateEnvironmentInput) 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 CreateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEnvironmentInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentProfileIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentProfileIdentifier")) - } - if s.GlossaryTerms != nil && len(s.GlossaryTerms) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GlossaryTerms", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.ProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateEnvironmentInput) SetDescription(v string) *CreateEnvironmentInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateEnvironmentInput) SetDomainIdentifier(v string) *CreateEnvironmentInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentProfileIdentifier sets the EnvironmentProfileIdentifier field's value. -func (s *CreateEnvironmentInput) SetEnvironmentProfileIdentifier(v string) *CreateEnvironmentInput { - s.EnvironmentProfileIdentifier = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *CreateEnvironmentInput) SetGlossaryTerms(v []*string) *CreateEnvironmentInput { - s.GlossaryTerms = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateEnvironmentInput) SetName(v string) *CreateEnvironmentInput { - s.Name = &v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *CreateEnvironmentInput) SetProjectIdentifier(v string) *CreateEnvironmentInput { - s.ProjectIdentifier = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *CreateEnvironmentInput) SetUserParameters(v []*EnvironmentParameter) *CreateEnvironmentInput { - s.UserParameters = v - return s -} - -type CreateEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account in which the Amazon DataZone environment - // is created. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services region in which the Amazon DataZone environment is - // created. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The timestamp of when the environment was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created this environment. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The deployment properties of this Amazon DataZone environment. - DeploymentProperties *DeploymentProperties `locationName:"deploymentProperties" type:"structure"` - - // The description of this Amazon DataZone environment. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the environment is - // created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The configurable actions of this Amazon DataZone environment. - EnvironmentActions []*ConfigurableEnvironmentAction `locationName:"environmentActions" type:"list"` - - // The ID of the blueprint with which this Amazon DataZone environment was created. - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string"` - - // The ID of the environment profile with which this Amazon DataZone environment - // was created. - // - // EnvironmentProfileId is a required field - EnvironmentProfileId *string `locationName:"environmentProfileId" type:"string" required:"true"` - - // The glossary terms that can be used in this Amazon DataZone environment. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The ID of this Amazon DataZone environment. - Id *string `locationName:"id" type:"string"` - - // The details of the last deployment of this Amazon DataZone environment. - LastDeployment *Deployment `locationName:"lastDeployment" type:"structure"` - - // The name of this environment. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone project in which this environment is created. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The provider of this Amazon DataZone environment. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The provisioned resources of this Amazon DataZone environment. - ProvisionedResources []*Resource `locationName:"provisionedResources" type:"list"` - - // The provisioning properties of this Amazon DataZone environment. - ProvisioningProperties *ProvisioningProperties `locationName:"provisioningProperties" type:"structure"` - - // The status of this Amazon DataZone environment. - Status *string `locationName:"status" type:"string" enum:"EnvironmentStatus"` - - // The timestamp of when this environment was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The user parameters of this Amazon DataZone environment. - UserParameters []*CustomParameter `locationName:"userParameters" type:"list"` -} - -// 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 CreateEnvironmentOutput) 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 CreateEnvironmentOutput) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *CreateEnvironmentOutput) SetAwsAccountId(v string) *CreateEnvironmentOutput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *CreateEnvironmentOutput) SetAwsAccountRegion(v string) *CreateEnvironmentOutput { - s.AwsAccountRegion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateEnvironmentOutput) SetCreatedAt(v time.Time) *CreateEnvironmentOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateEnvironmentOutput) SetCreatedBy(v string) *CreateEnvironmentOutput { - s.CreatedBy = &v - return s -} - -// SetDeploymentProperties sets the DeploymentProperties field's value. -func (s *CreateEnvironmentOutput) SetDeploymentProperties(v *DeploymentProperties) *CreateEnvironmentOutput { - s.DeploymentProperties = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateEnvironmentOutput) SetDescription(v string) *CreateEnvironmentOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateEnvironmentOutput) SetDomainId(v string) *CreateEnvironmentOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentActions sets the EnvironmentActions field's value. -func (s *CreateEnvironmentOutput) SetEnvironmentActions(v []*ConfigurableEnvironmentAction) *CreateEnvironmentOutput { - s.EnvironmentActions = v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *CreateEnvironmentOutput) SetEnvironmentBlueprintId(v string) *CreateEnvironmentOutput { - s.EnvironmentBlueprintId = &v - return s -} - -// SetEnvironmentProfileId sets the EnvironmentProfileId field's value. -func (s *CreateEnvironmentOutput) SetEnvironmentProfileId(v string) *CreateEnvironmentOutput { - s.EnvironmentProfileId = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *CreateEnvironmentOutput) SetGlossaryTerms(v []*string) *CreateEnvironmentOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateEnvironmentOutput) SetId(v string) *CreateEnvironmentOutput { - s.Id = &v - return s -} - -// SetLastDeployment sets the LastDeployment field's value. -func (s *CreateEnvironmentOutput) SetLastDeployment(v *Deployment) *CreateEnvironmentOutput { - s.LastDeployment = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateEnvironmentOutput) SetName(v string) *CreateEnvironmentOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *CreateEnvironmentOutput) SetProjectId(v string) *CreateEnvironmentOutput { - s.ProjectId = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *CreateEnvironmentOutput) SetProvider(v string) *CreateEnvironmentOutput { - s.Provider = &v - return s -} - -// SetProvisionedResources sets the ProvisionedResources field's value. -func (s *CreateEnvironmentOutput) SetProvisionedResources(v []*Resource) *CreateEnvironmentOutput { - s.ProvisionedResources = v - return s -} - -// SetProvisioningProperties sets the ProvisioningProperties field's value. -func (s *CreateEnvironmentOutput) SetProvisioningProperties(v *ProvisioningProperties) *CreateEnvironmentOutput { - s.ProvisioningProperties = v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateEnvironmentOutput) SetStatus(v string) *CreateEnvironmentOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateEnvironmentOutput) SetUpdatedAt(v time.Time) *CreateEnvironmentOutput { - s.UpdatedAt = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *CreateEnvironmentOutput) SetUserParameters(v []*CustomParameter) *CreateEnvironmentOutput { - s.UserParameters = v - return s -} - -type CreateEnvironmentProfileInput struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account in which the Amazon DataZone environment - // is created. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services region in which this environment profile is created. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The description of this Amazon DataZone environment profile. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentProfileInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this environment profile is - // created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the blueprint with which this environment profile is created. - // - // EnvironmentBlueprintIdentifier is a required field - EnvironmentBlueprintIdentifier *string `locationName:"environmentBlueprintIdentifier" type:"string" required:"true"` - - // The name of this Amazon DataZone environment profile. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentProfileInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the project in which to create the environment profile. - // - // ProjectIdentifier is a required field - ProjectIdentifier *string `locationName:"projectIdentifier" type:"string" required:"true"` - - // The user parameters of this Amazon DataZone environment profile. - UserParameters []*EnvironmentParameter `locationName:"userParameters" type:"list"` -} - -// 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 CreateEnvironmentProfileInput) 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 CreateEnvironmentProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEnvironmentProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEnvironmentProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentBlueprintIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentBlueprintIdentifier")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *CreateEnvironmentProfileInput) SetAwsAccountId(v string) *CreateEnvironmentProfileInput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *CreateEnvironmentProfileInput) SetAwsAccountRegion(v string) *CreateEnvironmentProfileInput { - s.AwsAccountRegion = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateEnvironmentProfileInput) SetDescription(v string) *CreateEnvironmentProfileInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateEnvironmentProfileInput) SetDomainIdentifier(v string) *CreateEnvironmentProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentBlueprintIdentifier sets the EnvironmentBlueprintIdentifier field's value. -func (s *CreateEnvironmentProfileInput) SetEnvironmentBlueprintIdentifier(v string) *CreateEnvironmentProfileInput { - s.EnvironmentBlueprintIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateEnvironmentProfileInput) SetName(v string) *CreateEnvironmentProfileInput { - s.Name = &v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *CreateEnvironmentProfileInput) SetProjectIdentifier(v string) *CreateEnvironmentProfileInput { - s.ProjectIdentifier = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *CreateEnvironmentProfileInput) SetUserParameters(v []*EnvironmentParameter) *CreateEnvironmentProfileInput { - s.UserParameters = v - return s -} - -type CreateEnvironmentProfileOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account ID in which this Amazon DataZone environment - // profile is created. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services region in which this Amazon DataZone environment - // profile is created. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The timestamp of when this environment profile was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created this environment profile. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description of this Amazon DataZone environment profile. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentProfileOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this environment profile is - // created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the blueprint with which this environment profile is created. - // - // EnvironmentBlueprintId is a required field - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string" required:"true"` - - // The ID of this Amazon DataZone environment profile. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of this Amazon DataZone environment profile. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentProfileOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone project in which this environment profile is - // created. - ProjectId *string `locationName:"projectId" type:"string"` - - // The timestamp of when this environment profile was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The user parameters of this Amazon DataZone environment profile. - UserParameters []*CustomParameter `locationName:"userParameters" type:"list"` -} - -// 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 CreateEnvironmentProfileOutput) 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 CreateEnvironmentProfileOutput) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *CreateEnvironmentProfileOutput) SetAwsAccountId(v string) *CreateEnvironmentProfileOutput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *CreateEnvironmentProfileOutput) SetAwsAccountRegion(v string) *CreateEnvironmentProfileOutput { - s.AwsAccountRegion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateEnvironmentProfileOutput) SetCreatedAt(v time.Time) *CreateEnvironmentProfileOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateEnvironmentProfileOutput) SetCreatedBy(v string) *CreateEnvironmentProfileOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateEnvironmentProfileOutput) SetDescription(v string) *CreateEnvironmentProfileOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateEnvironmentProfileOutput) SetDomainId(v string) *CreateEnvironmentProfileOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *CreateEnvironmentProfileOutput) SetEnvironmentBlueprintId(v string) *CreateEnvironmentProfileOutput { - s.EnvironmentBlueprintId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateEnvironmentProfileOutput) SetId(v string) *CreateEnvironmentProfileOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateEnvironmentProfileOutput) SetName(v string) *CreateEnvironmentProfileOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *CreateEnvironmentProfileOutput) SetProjectId(v string) *CreateEnvironmentProfileOutput { - s.ProjectId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateEnvironmentProfileOutput) SetUpdatedAt(v time.Time) *CreateEnvironmentProfileOutput { - s.UpdatedAt = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *CreateEnvironmentProfileOutput) SetUserParameters(v []*CustomParameter) *CreateEnvironmentProfileOutput { - s.UserParameters = v - return s -} - -type CreateFormTypeInput struct { - _ struct{} `type:"structure"` - - // The description of this Amazon DataZone metadata form type. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateFormTypeInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this metadata form type is - // created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The model of this Amazon DataZone metadata form type. - // - // Model is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateFormTypeInput's - // String and GoString methods. - // - // Model is a required field - Model *Model `locationName:"model" type:"structure" required:"true" sensitive:"true"` - - // The name of this Amazon DataZone metadata form type. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateFormTypeInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone project that owns this metadata form type. - // - // OwningProjectIdentifier is a required field - OwningProjectIdentifier *string `locationName:"owningProjectIdentifier" type:"string" required:"true"` - - // The status of this Amazon DataZone metadata form type. - Status *string `locationName:"status" type:"string" enum:"FormTypeStatus"` -} - -// 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 CreateFormTypeInput) 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 CreateFormTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFormTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFormTypeInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Model == nil { - invalidParams.Add(request.NewErrParamRequired("Model")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.OwningProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OwningProjectIdentifier")) - } - if s.Model != nil { - if err := s.Model.Validate(); err != nil { - invalidParams.AddNested("Model", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateFormTypeInput) SetDescription(v string) *CreateFormTypeInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateFormTypeInput) SetDomainIdentifier(v string) *CreateFormTypeInput { - s.DomainIdentifier = &v - return s -} - -// SetModel sets the Model field's value. -func (s *CreateFormTypeInput) SetModel(v *Model) *CreateFormTypeInput { - s.Model = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateFormTypeInput) SetName(v string) *CreateFormTypeInput { - s.Name = &v - return s -} - -// SetOwningProjectIdentifier sets the OwningProjectIdentifier field's value. -func (s *CreateFormTypeInput) SetOwningProjectIdentifier(v string) *CreateFormTypeInput { - s.OwningProjectIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateFormTypeInput) SetStatus(v string) *CreateFormTypeInput { - s.Status = &v - return s -} - -type CreateFormTypeOutput struct { - _ struct{} `type:"structure"` - - // The description of this Amazon DataZone metadata form type. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateFormTypeOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this metadata form type is - // created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The name of this Amazon DataZone metadata form type. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateFormTypeOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this metadata form type was - // originally created. - OriginDomainId *string `locationName:"originDomainId" type:"string"` - - // The ID of the project in which this Amazon DataZone metadata form type was - // originally created. - OriginProjectId *string `locationName:"originProjectId" type:"string"` - - // The ID of the project that owns this Amazon DataZone metadata form type. - OwningProjectId *string `locationName:"owningProjectId" type:"string"` - - // The revision of this Amazon DataZone metadata form type. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" 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 CreateFormTypeOutput) 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 CreateFormTypeOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *CreateFormTypeOutput) SetDescription(v string) *CreateFormTypeOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateFormTypeOutput) SetDomainId(v string) *CreateFormTypeOutput { - s.DomainId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateFormTypeOutput) SetName(v string) *CreateFormTypeOutput { - s.Name = &v - return s -} - -// SetOriginDomainId sets the OriginDomainId field's value. -func (s *CreateFormTypeOutput) SetOriginDomainId(v string) *CreateFormTypeOutput { - s.OriginDomainId = &v - return s -} - -// SetOriginProjectId sets the OriginProjectId field's value. -func (s *CreateFormTypeOutput) SetOriginProjectId(v string) *CreateFormTypeOutput { - s.OriginProjectId = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *CreateFormTypeOutput) SetOwningProjectId(v string) *CreateFormTypeOutput { - s.OwningProjectId = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *CreateFormTypeOutput) SetRevision(v string) *CreateFormTypeOutput { - s.Revision = &v - return s -} - -type CreateGlossaryInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The description of this business glossary. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this business glossary is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The name of this business glossary. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the project that currently owns business glossary. - // - // OwningProjectIdentifier is a required field - OwningProjectIdentifier *string `locationName:"owningProjectIdentifier" type:"string" required:"true"` - - // The status of this business glossary. - Status *string `locationName:"status" type:"string" enum:"GlossaryStatus"` -} - -// 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 CreateGlossaryInput) 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 CreateGlossaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGlossaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGlossaryInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.OwningProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OwningProjectIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateGlossaryInput) SetClientToken(v string) *CreateGlossaryInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateGlossaryInput) SetDescription(v string) *CreateGlossaryInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateGlossaryInput) SetDomainIdentifier(v string) *CreateGlossaryInput { - s.DomainIdentifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateGlossaryInput) SetName(v string) *CreateGlossaryInput { - s.Name = &v - return s -} - -// SetOwningProjectIdentifier sets the OwningProjectIdentifier field's value. -func (s *CreateGlossaryInput) SetOwningProjectIdentifier(v string) *CreateGlossaryInput { - s.OwningProjectIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateGlossaryInput) SetStatus(v string) *CreateGlossaryInput { - s.Status = &v - return s -} - -type CreateGlossaryOutput struct { - _ struct{} `type:"structure"` - - // The description of this business glossary. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this business glossary is created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of this business glossary. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of this business glossary. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the project that currently owns this business glossary. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The status of this business glossary. - Status *string `locationName:"status" type:"string" enum:"GlossaryStatus"` -} - -// 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 CreateGlossaryOutput) 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 CreateGlossaryOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *CreateGlossaryOutput) SetDescription(v string) *CreateGlossaryOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateGlossaryOutput) SetDomainId(v string) *CreateGlossaryOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateGlossaryOutput) SetId(v string) *CreateGlossaryOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateGlossaryOutput) SetName(v string) *CreateGlossaryOutput { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *CreateGlossaryOutput) SetOwningProjectId(v string) *CreateGlossaryOutput { - s.OwningProjectId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateGlossaryOutput) SetStatus(v string) *CreateGlossaryOutput { - s.Status = &v - return s -} - -type CreateGlossaryTermInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The ID of the Amazon DataZone domain in which this business glossary term - // is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the business glossary in which this term is created. - // - // GlossaryIdentifier is a required field - GlossaryIdentifier *string `locationName:"glossaryIdentifier" type:"string" required:"true"` - - // The long description of this business glossary term. - // - // LongDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryTermInput's - // String and GoString methods. - LongDescription *string `locationName:"longDescription" type:"string" sensitive:"true"` - - // The name of this business glossary term. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryTermInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The short description of this business glossary term. - // - // ShortDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryTermInput's - // String and GoString methods. - ShortDescription *string `locationName:"shortDescription" type:"string" sensitive:"true"` - - // The status of this business glossary term. - Status *string `locationName:"status" type:"string" enum:"GlossaryTermStatus"` - - // The term relations of this business glossary term. - TermRelations *TermRelations `locationName:"termRelations" 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 CreateGlossaryTermInput) 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 CreateGlossaryTermInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGlossaryTermInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGlossaryTermInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GlossaryIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GlossaryIdentifier")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TermRelations != nil { - if err := s.TermRelations.Validate(); err != nil { - invalidParams.AddNested("TermRelations", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateGlossaryTermInput) SetClientToken(v string) *CreateGlossaryTermInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateGlossaryTermInput) SetDomainIdentifier(v string) *CreateGlossaryTermInput { - s.DomainIdentifier = &v - return s -} - -// SetGlossaryIdentifier sets the GlossaryIdentifier field's value. -func (s *CreateGlossaryTermInput) SetGlossaryIdentifier(v string) *CreateGlossaryTermInput { - s.GlossaryIdentifier = &v - return s -} - -// SetLongDescription sets the LongDescription field's value. -func (s *CreateGlossaryTermInput) SetLongDescription(v string) *CreateGlossaryTermInput { - s.LongDescription = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateGlossaryTermInput) SetName(v string) *CreateGlossaryTermInput { - s.Name = &v - return s -} - -// SetShortDescription sets the ShortDescription field's value. -func (s *CreateGlossaryTermInput) SetShortDescription(v string) *CreateGlossaryTermInput { - s.ShortDescription = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateGlossaryTermInput) SetStatus(v string) *CreateGlossaryTermInput { - s.Status = &v - return s -} - -// SetTermRelations sets the TermRelations field's value. -func (s *CreateGlossaryTermInput) SetTermRelations(v *TermRelations) *CreateGlossaryTermInput { - s.TermRelations = v - return s -} - -type CreateGlossaryTermOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Amazon DataZone domain in which this business glossary term - // is created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the business glossary in which this term is created. - // - // GlossaryId is a required field - GlossaryId *string `locationName:"glossaryId" type:"string" required:"true"` - - // The ID of this business glossary term. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The long description of this business glossary term. - // - // LongDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryTermOutput's - // String and GoString methods. - LongDescription *string `locationName:"longDescription" type:"string" sensitive:"true"` - - // The name of this business glossary term. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryTermOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The short description of this business glossary term. - // - // ShortDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGlossaryTermOutput's - // String and GoString methods. - ShortDescription *string `locationName:"shortDescription" type:"string" sensitive:"true"` - - // The status of this business glossary term. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"GlossaryTermStatus"` - - // The term relations of this business glossary term. - TermRelations *TermRelations `locationName:"termRelations" 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 CreateGlossaryTermOutput) 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 CreateGlossaryTermOutput) GoString() string { - return s.String() -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateGlossaryTermOutput) SetDomainId(v string) *CreateGlossaryTermOutput { - s.DomainId = &v - return s -} - -// SetGlossaryId sets the GlossaryId field's value. -func (s *CreateGlossaryTermOutput) SetGlossaryId(v string) *CreateGlossaryTermOutput { - s.GlossaryId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateGlossaryTermOutput) SetId(v string) *CreateGlossaryTermOutput { - s.Id = &v - return s -} - -// SetLongDescription sets the LongDescription field's value. -func (s *CreateGlossaryTermOutput) SetLongDescription(v string) *CreateGlossaryTermOutput { - s.LongDescription = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateGlossaryTermOutput) SetName(v string) *CreateGlossaryTermOutput { - s.Name = &v - return s -} - -// SetShortDescription sets the ShortDescription field's value. -func (s *CreateGlossaryTermOutput) SetShortDescription(v string) *CreateGlossaryTermOutput { - s.ShortDescription = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateGlossaryTermOutput) SetStatus(v string) *CreateGlossaryTermOutput { - s.Status = &v - return s -} - -// SetTermRelations sets the TermRelations field's value. -func (s *CreateGlossaryTermOutput) SetTermRelations(v *TermRelations) *CreateGlossaryTermOutput { - s.TermRelations = v - return s -} - -type CreateGroupProfileInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The identifier of the Amazon DataZone domain in which the group profile is - // created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the group for which the group profile is created. - // - // GroupIdentifier is a required field - GroupIdentifier *string `locationName:"groupIdentifier" 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 CreateGroupProfileInput) 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 CreateGroupProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGroupProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGroupProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GroupIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateGroupProfileInput) SetClientToken(v string) *CreateGroupProfileInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateGroupProfileInput) SetDomainIdentifier(v string) *CreateGroupProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetGroupIdentifier sets the GroupIdentifier field's value. -func (s *CreateGroupProfileInput) SetGroupIdentifier(v string) *CreateGroupProfileInput { - s.GroupIdentifier = &v - return s -} - -type CreateGroupProfileOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which the group profile is - // created. - DomainId *string `locationName:"domainId" type:"string"` - - // The name of the group for which group profile is created. - // - // GroupName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGroupProfileOutput's - // String and GoString methods. - GroupName *string `locationName:"groupName" min:"1" type:"string" sensitive:"true"` - - // The identifier of the group profile. - Id *string `locationName:"id" type:"string"` - - // The status of the group profile. - Status *string `locationName:"status" type:"string" enum:"GroupProfileStatus"` -} - -// 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 CreateGroupProfileOutput) 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 CreateGroupProfileOutput) GoString() string { - return s.String() -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateGroupProfileOutput) SetDomainId(v string) *CreateGroupProfileOutput { - s.DomainId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreateGroupProfileOutput) SetGroupName(v string) *CreateGroupProfileOutput { - s.GroupName = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateGroupProfileOutput) SetId(v string) *CreateGroupProfileOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateGroupProfileOutput) SetStatus(v string) *CreateGroupProfileOutput { - s.Status = &v - return s -} - -type CreateListingChangeSetInput struct { - _ struct{} `type:"structure"` - - // Action is a required field - Action *string `locationName:"action" type:"string" required:"true" enum:"ChangeAction"` - - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // EntityIdentifier is a required field - EntityIdentifier *string `locationName:"entityIdentifier" type:"string" required:"true"` - - EntityRevision *string `locationName:"entityRevision" min:"1" type:"string"` - - // EntityType is a required field - EntityType *string `locationName:"entityType" type:"string" required:"true" enum:"EntityType"` -} - -// 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 CreateListingChangeSetInput) 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 CreateListingChangeSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateListingChangeSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateListingChangeSetInput"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EntityIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EntityIdentifier")) - } - if s.EntityRevision != nil && len(*s.EntityRevision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EntityRevision", 1)) - } - if s.EntityType == nil { - invalidParams.Add(request.NewErrParamRequired("EntityType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *CreateListingChangeSetInput) SetAction(v string) *CreateListingChangeSetInput { - s.Action = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateListingChangeSetInput) SetClientToken(v string) *CreateListingChangeSetInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateListingChangeSetInput) SetDomainIdentifier(v string) *CreateListingChangeSetInput { - s.DomainIdentifier = &v - return s -} - -// SetEntityIdentifier sets the EntityIdentifier field's value. -func (s *CreateListingChangeSetInput) SetEntityIdentifier(v string) *CreateListingChangeSetInput { - s.EntityIdentifier = &v - return s -} - -// SetEntityRevision sets the EntityRevision field's value. -func (s *CreateListingChangeSetInput) SetEntityRevision(v string) *CreateListingChangeSetInput { - s.EntityRevision = &v - return s -} - -// SetEntityType sets the EntityType field's value. -func (s *CreateListingChangeSetInput) SetEntityType(v string) *CreateListingChangeSetInput { - s.EntityType = &v - return s -} - -type CreateListingChangeSetOutput struct { - _ struct{} `type:"structure"` - - // ListingId is a required field - ListingId *string `locationName:"listingId" type:"string" required:"true"` - - // ListingRevision is a required field - ListingRevision *string `locationName:"listingRevision" min:"1" type:"string" required:"true"` - - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ListingStatus"` -} - -// 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 CreateListingChangeSetOutput) 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 CreateListingChangeSetOutput) GoString() string { - return s.String() -} - -// SetListingId sets the ListingId field's value. -func (s *CreateListingChangeSetOutput) SetListingId(v string) *CreateListingChangeSetOutput { - s.ListingId = &v - return s -} - -// SetListingRevision sets the ListingRevision field's value. -func (s *CreateListingChangeSetOutput) SetListingRevision(v string) *CreateListingChangeSetOutput { - s.ListingRevision = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateListingChangeSetOutput) SetStatus(v string) *CreateListingChangeSetOutput { - s.Status = &v - return s -} - -type CreateProjectInput struct { - _ struct{} `type:"structure"` - - // The description of the Amazon DataZone project. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProjectInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this project is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The glossary terms that can be used in this Amazon DataZone project. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The name of the Amazon DataZone project. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProjectInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"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 CreateProjectInput) 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 CreateProjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateProjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateProjectInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GlossaryTerms != nil && len(s.GlossaryTerms) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GlossaryTerms", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateProjectInput) SetDescription(v string) *CreateProjectInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateProjectInput) SetDomainIdentifier(v string) *CreateProjectInput { - s.DomainIdentifier = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *CreateProjectInput) SetGlossaryTerms(v []*string) *CreateProjectInput { - s.GlossaryTerms = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateProjectInput) SetName(v string) *CreateProjectInput { - s.Name = &v - return s -} - -type CreateProjectMembershipInput struct { - _ struct{} `type:"structure"` - - // The designation of the project membership. - // - // Designation is a required field - Designation *string `locationName:"designation" type:"string" required:"true" enum:"UserDesignation"` - - // The ID of the Amazon DataZone domain in which project membership is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The project member whose project membership was created. - // - // Member is a required field - Member *Member `locationName:"member" type:"structure" required:"true"` - - // The ID of the project for which this project membership was created. - // - // ProjectIdentifier is a required field - ProjectIdentifier *string `location:"uri" locationName:"projectIdentifier" 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 CreateProjectMembershipInput) 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 CreateProjectMembershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateProjectMembershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateProjectMembershipInput"} - if s.Designation == nil { - invalidParams.Add(request.NewErrParamRequired("Designation")) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Member == nil { - invalidParams.Add(request.NewErrParamRequired("Member")) - } - if s.ProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectIdentifier")) - } - if s.ProjectIdentifier != nil && len(*s.ProjectIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProjectIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDesignation sets the Designation field's value. -func (s *CreateProjectMembershipInput) SetDesignation(v string) *CreateProjectMembershipInput { - s.Designation = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateProjectMembershipInput) SetDomainIdentifier(v string) *CreateProjectMembershipInput { - s.DomainIdentifier = &v - return s -} - -// SetMember sets the Member field's value. -func (s *CreateProjectMembershipInput) SetMember(v *Member) *CreateProjectMembershipInput { - s.Member = v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *CreateProjectMembershipInput) SetProjectIdentifier(v string) *CreateProjectMembershipInput { - s.ProjectIdentifier = &v - return s -} - -type CreateProjectMembershipOutput 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 CreateProjectMembershipOutput) 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 CreateProjectMembershipOutput) GoString() string { - return s.String() -} - -type CreateProjectOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the project was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the project. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description of the project. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProjectOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the project was created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The glossary terms that can be used in the project. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The ID of the Amazon DataZone project. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The timestamp of when the project was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the project. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateProjectOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"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 CreateProjectOutput) 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 CreateProjectOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateProjectOutput) SetCreatedAt(v time.Time) *CreateProjectOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateProjectOutput) SetCreatedBy(v string) *CreateProjectOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateProjectOutput) SetDescription(v string) *CreateProjectOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateProjectOutput) SetDomainId(v string) *CreateProjectOutput { - s.DomainId = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *CreateProjectOutput) SetGlossaryTerms(v []*string) *CreateProjectOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateProjectOutput) SetId(v string) *CreateProjectOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *CreateProjectOutput) SetLastUpdatedAt(v time.Time) *CreateProjectOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateProjectOutput) SetName(v string) *CreateProjectOutput { - s.Name = &v - return s -} - -type CreateSubscriptionGrantInput struct { - _ struct{} `type:"structure"` - - // The names of the assets for which the subscription grant is created. - AssetTargetNames []*AssetTargetNameMap `locationName:"assetTargetNames" type:"list"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The ID of the Amazon DataZone domain in which the subscription grant is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the environment in which the subscription grant is created. - // - // EnvironmentIdentifier is a required field - EnvironmentIdentifier *string `locationName:"environmentIdentifier" type:"string" required:"true"` - - // The entity to which the subscription is to be granted. - // - // GrantedEntity is a required field - GrantedEntity *GrantedEntityInput_ `locationName:"grantedEntity" type:"structure" required:"true"` - - // The ID of the subscription target for which the subscription grant is created. - // - // SubscriptionTargetIdentifier is a required field - SubscriptionTargetIdentifier *string `locationName:"subscriptionTargetIdentifier" 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 CreateSubscriptionGrantInput) 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 CreateSubscriptionGrantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSubscriptionGrantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSubscriptionGrantInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentIdentifier")) - } - if s.GrantedEntity == nil { - invalidParams.Add(request.NewErrParamRequired("GrantedEntity")) - } - if s.SubscriptionTargetIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionTargetIdentifier")) - } - if s.AssetTargetNames != nil { - for i, v := range s.AssetTargetNames { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AssetTargetNames", i), err.(request.ErrInvalidParams)) - } - } - } - if s.GrantedEntity != nil { - if err := s.GrantedEntity.Validate(); err != nil { - invalidParams.AddNested("GrantedEntity", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssetTargetNames sets the AssetTargetNames field's value. -func (s *CreateSubscriptionGrantInput) SetAssetTargetNames(v []*AssetTargetNameMap) *CreateSubscriptionGrantInput { - s.AssetTargetNames = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateSubscriptionGrantInput) SetClientToken(v string) *CreateSubscriptionGrantInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateSubscriptionGrantInput) SetDomainIdentifier(v string) *CreateSubscriptionGrantInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentIdentifier sets the EnvironmentIdentifier field's value. -func (s *CreateSubscriptionGrantInput) SetEnvironmentIdentifier(v string) *CreateSubscriptionGrantInput { - s.EnvironmentIdentifier = &v - return s -} - -// SetGrantedEntity sets the GrantedEntity field's value. -func (s *CreateSubscriptionGrantInput) SetGrantedEntity(v *GrantedEntityInput_) *CreateSubscriptionGrantInput { - s.GrantedEntity = v - return s -} - -// SetSubscriptionTargetIdentifier sets the SubscriptionTargetIdentifier field's value. -func (s *CreateSubscriptionGrantInput) SetSubscriptionTargetIdentifier(v string) *CreateSubscriptionGrantInput { - s.SubscriptionTargetIdentifier = &v - return s -} - -type CreateSubscriptionGrantOutput struct { - _ struct{} `type:"structure"` - - // The assets for which the subscription grant is created. - Assets []*SubscribedAsset `locationName:"assets" type:"list"` - - // A timestamp of when the subscription grant is created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription grant. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain in which the subscription grant is created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The entity to which the subscription is granted. - // - // GrantedEntity is a required field - GrantedEntity *GrantedEntity `locationName:"grantedEntity" type:"structure" required:"true"` - - // The ID of the subscription grant. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The status of the subscription grant. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionGrantOverallStatus"` - - // The identifier of the subscription grant. - SubscriptionId *string `locationName:"subscriptionId" type:"string"` - - // The ID of the subscription target for which the subscription grant is created. - // - // SubscriptionTargetId is a required field - SubscriptionTargetId *string `locationName:"subscriptionTargetId" type:"string" required:"true"` - - // A timestamp of when the subscription grant was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription grant. - UpdatedBy *string `locationName:"updatedBy" 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 CreateSubscriptionGrantOutput) 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 CreateSubscriptionGrantOutput) GoString() string { - return s.String() -} - -// SetAssets sets the Assets field's value. -func (s *CreateSubscriptionGrantOutput) SetAssets(v []*SubscribedAsset) *CreateSubscriptionGrantOutput { - s.Assets = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateSubscriptionGrantOutput) SetCreatedAt(v time.Time) *CreateSubscriptionGrantOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateSubscriptionGrantOutput) SetCreatedBy(v string) *CreateSubscriptionGrantOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateSubscriptionGrantOutput) SetDomainId(v string) *CreateSubscriptionGrantOutput { - s.DomainId = &v - return s -} - -// SetGrantedEntity sets the GrantedEntity field's value. -func (s *CreateSubscriptionGrantOutput) SetGrantedEntity(v *GrantedEntity) *CreateSubscriptionGrantOutput { - s.GrantedEntity = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSubscriptionGrantOutput) SetId(v string) *CreateSubscriptionGrantOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateSubscriptionGrantOutput) SetStatus(v string) *CreateSubscriptionGrantOutput { - s.Status = &v - return s -} - -// SetSubscriptionId sets the SubscriptionId field's value. -func (s *CreateSubscriptionGrantOutput) SetSubscriptionId(v string) *CreateSubscriptionGrantOutput { - s.SubscriptionId = &v - return s -} - -// SetSubscriptionTargetId sets the SubscriptionTargetId field's value. -func (s *CreateSubscriptionGrantOutput) SetSubscriptionTargetId(v string) *CreateSubscriptionGrantOutput { - s.SubscriptionTargetId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateSubscriptionGrantOutput) SetUpdatedAt(v time.Time) *CreateSubscriptionGrantOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *CreateSubscriptionGrantOutput) SetUpdatedBy(v string) *CreateSubscriptionGrantOutput { - s.UpdatedBy = &v - return s -} - -type CreateSubscriptionRequestInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The ID of the Amazon DataZone domain in which the subscription request is - // created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The reason for the subscription request. - // - // RequestReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSubscriptionRequestInput's - // String and GoString methods. - // - // RequestReason is a required field - RequestReason *string `locationName:"requestReason" min:"1" type:"string" required:"true" sensitive:"true"` - - // SubscribedListings is a required field - SubscribedListings []*SubscribedListingInput_ `locationName:"subscribedListings" min:"1" type:"list" required:"true"` - - // The Amazon DataZone principals for whom the subscription request is created. - // - // SubscribedPrincipals is a required field - SubscribedPrincipals []*SubscribedPrincipalInput_ `locationName:"subscribedPrincipals" min:"1" type:"list" 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 CreateSubscriptionRequestInput) 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 CreateSubscriptionRequestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSubscriptionRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSubscriptionRequestInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.RequestReason == nil { - invalidParams.Add(request.NewErrParamRequired("RequestReason")) - } - if s.RequestReason != nil && len(*s.RequestReason) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestReason", 1)) - } - if s.SubscribedListings == nil { - invalidParams.Add(request.NewErrParamRequired("SubscribedListings")) - } - if s.SubscribedListings != nil && len(s.SubscribedListings) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubscribedListings", 1)) - } - if s.SubscribedPrincipals == nil { - invalidParams.Add(request.NewErrParamRequired("SubscribedPrincipals")) - } - if s.SubscribedPrincipals != nil && len(s.SubscribedPrincipals) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubscribedPrincipals", 1)) - } - if s.SubscribedListings != nil { - for i, v := range s.SubscribedListings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SubscribedListings", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateSubscriptionRequestInput) SetClientToken(v string) *CreateSubscriptionRequestInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateSubscriptionRequestInput) SetDomainIdentifier(v string) *CreateSubscriptionRequestInput { - s.DomainIdentifier = &v - return s -} - -// SetRequestReason sets the RequestReason field's value. -func (s *CreateSubscriptionRequestInput) SetRequestReason(v string) *CreateSubscriptionRequestInput { - s.RequestReason = &v - return s -} - -// SetSubscribedListings sets the SubscribedListings field's value. -func (s *CreateSubscriptionRequestInput) SetSubscribedListings(v []*SubscribedListingInput_) *CreateSubscriptionRequestInput { - s.SubscribedListings = v - return s -} - -// SetSubscribedPrincipals sets the SubscribedPrincipals field's value. -func (s *CreateSubscriptionRequestInput) SetSubscribedPrincipals(v []*SubscribedPrincipalInput_) *CreateSubscriptionRequestInput { - s.SubscribedPrincipals = v - return s -} - -type CreateSubscriptionRequestOutput struct { - _ struct{} `type:"structure"` - - // A timestamp of when the subscription request is created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription request. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The decision comment of the subscription request. - // - // DecisionComment is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSubscriptionRequestOutput's - // String and GoString methods. - DecisionComment *string `locationName:"decisionComment" min:"1" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in whcih the subscription request is - // created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the subscription request. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The reason for the subscription request. - // - // RequestReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSubscriptionRequestOutput's - // String and GoString methods. - // - // RequestReason is a required field - RequestReason *string `locationName:"requestReason" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the reviewer of the subscription request. - ReviewerId *string `locationName:"reviewerId" type:"string"` - - // The status of the subscription request. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionRequestStatus"` - - // SubscribedListings is a required field - SubscribedListings []*SubscribedListing `locationName:"subscribedListings" min:"1" type:"list" required:"true"` - - // The subscribed principals of the subscription request. - // - // SubscribedPrincipals is a required field - SubscribedPrincipals []*SubscribedPrincipal `locationName:"subscribedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when the subscription request was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription request. - UpdatedBy *string `locationName:"updatedBy" 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 CreateSubscriptionRequestOutput) 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 CreateSubscriptionRequestOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateSubscriptionRequestOutput) SetCreatedAt(v time.Time) *CreateSubscriptionRequestOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateSubscriptionRequestOutput) SetCreatedBy(v string) *CreateSubscriptionRequestOutput { - s.CreatedBy = &v - return s -} - -// SetDecisionComment sets the DecisionComment field's value. -func (s *CreateSubscriptionRequestOutput) SetDecisionComment(v string) *CreateSubscriptionRequestOutput { - s.DecisionComment = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateSubscriptionRequestOutput) SetDomainId(v string) *CreateSubscriptionRequestOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSubscriptionRequestOutput) SetId(v string) *CreateSubscriptionRequestOutput { - s.Id = &v - return s -} - -// SetRequestReason sets the RequestReason field's value. -func (s *CreateSubscriptionRequestOutput) SetRequestReason(v string) *CreateSubscriptionRequestOutput { - s.RequestReason = &v - return s -} - -// SetReviewerId sets the ReviewerId field's value. -func (s *CreateSubscriptionRequestOutput) SetReviewerId(v string) *CreateSubscriptionRequestOutput { - s.ReviewerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateSubscriptionRequestOutput) SetStatus(v string) *CreateSubscriptionRequestOutput { - s.Status = &v - return s -} - -// SetSubscribedListings sets the SubscribedListings field's value. -func (s *CreateSubscriptionRequestOutput) SetSubscribedListings(v []*SubscribedListing) *CreateSubscriptionRequestOutput { - s.SubscribedListings = v - return s -} - -// SetSubscribedPrincipals sets the SubscribedPrincipals field's value. -func (s *CreateSubscriptionRequestOutput) SetSubscribedPrincipals(v []*SubscribedPrincipal) *CreateSubscriptionRequestOutput { - s.SubscribedPrincipals = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateSubscriptionRequestOutput) SetUpdatedAt(v time.Time) *CreateSubscriptionRequestOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *CreateSubscriptionRequestOutput) SetUpdatedBy(v string) *CreateSubscriptionRequestOutput { - s.UpdatedBy = &v - return s -} - -type CreateSubscriptionTargetInput struct { - _ struct{} `type:"structure"` - - // The asset types that can be included in the subscription target. - // - // ApplicableAssetTypes is a required field - ApplicableAssetTypes []*string `locationName:"applicableAssetTypes" type:"list" required:"true"` - - // The authorized principals of the subscription target. - // - // AuthorizedPrincipals is a required field - AuthorizedPrincipals []*string `locationName:"authorizedPrincipals" min:"1" type:"list" required:"true"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The ID of the Amazon DataZone domain in which subscription target is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the environment in which subscription target is created. - // - // EnvironmentIdentifier is a required field - EnvironmentIdentifier *string `location:"uri" locationName:"environmentIdentifier" type:"string" required:"true"` - - // The manage access role that is used to create the subscription target. - // - // ManageAccessRole is a required field - ManageAccessRole *string `locationName:"manageAccessRole" type:"string" required:"true"` - - // The name of the subscription target. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSubscriptionTargetInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The provider of the subscription target. - Provider *string `locationName:"provider" type:"string"` - - // The configuration of the subscription target. - // - // SubscriptionTargetConfig is a required field - SubscriptionTargetConfig []*SubscriptionTargetForm `locationName:"subscriptionTargetConfig" type:"list" required:"true"` - - // The type of the subscription target. - // - // Type is a required field - Type *string `locationName:"type" 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 CreateSubscriptionTargetInput) 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 CreateSubscriptionTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSubscriptionTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSubscriptionTargetInput"} - if s.ApplicableAssetTypes == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicableAssetTypes")) - } - if s.AuthorizedPrincipals == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizedPrincipals")) - } - if s.AuthorizedPrincipals != nil && len(s.AuthorizedPrincipals) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AuthorizedPrincipals", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentIdentifier")) - } - if s.EnvironmentIdentifier != nil && len(*s.EnvironmentIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentIdentifier", 1)) - } - if s.ManageAccessRole == nil { - invalidParams.Add(request.NewErrParamRequired("ManageAccessRole")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SubscriptionTargetConfig == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionTargetConfig")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.SubscriptionTargetConfig != nil { - for i, v := range s.SubscriptionTargetConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SubscriptionTargetConfig", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicableAssetTypes sets the ApplicableAssetTypes field's value. -func (s *CreateSubscriptionTargetInput) SetApplicableAssetTypes(v []*string) *CreateSubscriptionTargetInput { - s.ApplicableAssetTypes = v - return s -} - -// SetAuthorizedPrincipals sets the AuthorizedPrincipals field's value. -func (s *CreateSubscriptionTargetInput) SetAuthorizedPrincipals(v []*string) *CreateSubscriptionTargetInput { - s.AuthorizedPrincipals = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateSubscriptionTargetInput) SetClientToken(v string) *CreateSubscriptionTargetInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateSubscriptionTargetInput) SetDomainIdentifier(v string) *CreateSubscriptionTargetInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentIdentifier sets the EnvironmentIdentifier field's value. -func (s *CreateSubscriptionTargetInput) SetEnvironmentIdentifier(v string) *CreateSubscriptionTargetInput { - s.EnvironmentIdentifier = &v - return s -} - -// SetManageAccessRole sets the ManageAccessRole field's value. -func (s *CreateSubscriptionTargetInput) SetManageAccessRole(v string) *CreateSubscriptionTargetInput { - s.ManageAccessRole = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSubscriptionTargetInput) SetName(v string) *CreateSubscriptionTargetInput { - s.Name = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *CreateSubscriptionTargetInput) SetProvider(v string) *CreateSubscriptionTargetInput { - s.Provider = &v - return s -} - -// SetSubscriptionTargetConfig sets the SubscriptionTargetConfig field's value. -func (s *CreateSubscriptionTargetInput) SetSubscriptionTargetConfig(v []*SubscriptionTargetForm) *CreateSubscriptionTargetInput { - s.SubscriptionTargetConfig = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateSubscriptionTargetInput) SetType(v string) *CreateSubscriptionTargetInput { - s.Type = &v - return s -} - -type CreateSubscriptionTargetOutput struct { - _ struct{} `type:"structure"` - - // The asset types that can be included in the subscription target. - // - // ApplicableAssetTypes is a required field - ApplicableAssetTypes []*string `locationName:"applicableAssetTypes" type:"list" required:"true"` - - // The authorised principals of the subscription target. - // - // AuthorizedPrincipals is a required field - AuthorizedPrincipals []*string `locationName:"authorizedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when the subscription target was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription target. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain in which the subscription target was - // created. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the environment in which the subscription target was created. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // The ID of the subscription target. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The manage access role with which the subscription target was created. - // - // ManageAccessRole is a required field - ManageAccessRole *string `locationName:"manageAccessRole" type:"string" required:"true"` - - // The name of the subscription target. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSubscriptionTargetOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // ??? - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The provider of the subscription target. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The configuration of the subscription target. - // - // SubscriptionTargetConfig is a required field - SubscriptionTargetConfig []*SubscriptionTargetForm `locationName:"subscriptionTargetConfig" type:"list" required:"true"` - - // The type of the subscription target. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true"` - - // The timestamp of when the subscription target was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the subscription target. - UpdatedBy *string `locationName:"updatedBy" 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 CreateSubscriptionTargetOutput) 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 CreateSubscriptionTargetOutput) GoString() string { - return s.String() -} - -// SetApplicableAssetTypes sets the ApplicableAssetTypes field's value. -func (s *CreateSubscriptionTargetOutput) SetApplicableAssetTypes(v []*string) *CreateSubscriptionTargetOutput { - s.ApplicableAssetTypes = v - return s -} - -// SetAuthorizedPrincipals sets the AuthorizedPrincipals field's value. -func (s *CreateSubscriptionTargetOutput) SetAuthorizedPrincipals(v []*string) *CreateSubscriptionTargetOutput { - s.AuthorizedPrincipals = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateSubscriptionTargetOutput) SetCreatedAt(v time.Time) *CreateSubscriptionTargetOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateSubscriptionTargetOutput) SetCreatedBy(v string) *CreateSubscriptionTargetOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateSubscriptionTargetOutput) SetDomainId(v string) *CreateSubscriptionTargetOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *CreateSubscriptionTargetOutput) SetEnvironmentId(v string) *CreateSubscriptionTargetOutput { - s.EnvironmentId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSubscriptionTargetOutput) SetId(v string) *CreateSubscriptionTargetOutput { - s.Id = &v - return s -} - -// SetManageAccessRole sets the ManageAccessRole field's value. -func (s *CreateSubscriptionTargetOutput) SetManageAccessRole(v string) *CreateSubscriptionTargetOutput { - s.ManageAccessRole = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSubscriptionTargetOutput) SetName(v string) *CreateSubscriptionTargetOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *CreateSubscriptionTargetOutput) SetProjectId(v string) *CreateSubscriptionTargetOutput { - s.ProjectId = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *CreateSubscriptionTargetOutput) SetProvider(v string) *CreateSubscriptionTargetOutput { - s.Provider = &v - return s -} - -// SetSubscriptionTargetConfig sets the SubscriptionTargetConfig field's value. -func (s *CreateSubscriptionTargetOutput) SetSubscriptionTargetConfig(v []*SubscriptionTargetForm) *CreateSubscriptionTargetOutput { - s.SubscriptionTargetConfig = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateSubscriptionTargetOutput) SetType(v string) *CreateSubscriptionTargetOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateSubscriptionTargetOutput) SetUpdatedAt(v time.Time) *CreateSubscriptionTargetOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *CreateSubscriptionTargetOutput) SetUpdatedBy(v string) *CreateSubscriptionTargetOutput { - s.UpdatedBy = &v - return s -} - -type CreateUserProfileInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The identifier of the Amazon DataZone domain in which a user profile is created. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the user for which the user profile is created. - // - // UserIdentifier is a required field - UserIdentifier *string `locationName:"userIdentifier" type:"string" required:"true"` - - // The user type of the user for which the user profile is created. - UserType *string `locationName:"userType" type:"string" enum:"UserType"` -} - -// 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 CreateUserProfileInput) 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 CreateUserProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUserProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUserProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.UserIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("UserIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateUserProfileInput) SetClientToken(v string) *CreateUserProfileInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *CreateUserProfileInput) SetDomainIdentifier(v string) *CreateUserProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetUserIdentifier sets the UserIdentifier field's value. -func (s *CreateUserProfileInput) SetUserIdentifier(v string) *CreateUserProfileInput { - s.UserIdentifier = &v - return s -} - -// SetUserType sets the UserType field's value. -func (s *CreateUserProfileInput) SetUserType(v string) *CreateUserProfileInput { - s.UserType = &v - return s -} - -type CreateUserProfileOutput struct { - _ struct{} `type:"structure"` - - // The details of the user profile in Amazon DataZone. - Details *UserProfileDetails `locationName:"details" type:"structure"` - - // The identifier of the Amazon DataZone domain in which a user profile is created. - DomainId *string `locationName:"domainId" type:"string"` - - // The identifier of the user profile. - Id *string `locationName:"id" type:"string"` - - // The status of the user profile. - Status *string `locationName:"status" type:"string" enum:"UserProfileStatus"` - - // The type of the user profile. - Type *string `locationName:"type" type:"string" enum:"UserProfileType"` -} - -// 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 CreateUserProfileOutput) 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 CreateUserProfileOutput) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *CreateUserProfileOutput) SetDetails(v *UserProfileDetails) *CreateUserProfileOutput { - s.Details = v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *CreateUserProfileOutput) SetDomainId(v string) *CreateUserProfileOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateUserProfileOutput) SetId(v string) *CreateUserProfileOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateUserProfileOutput) SetStatus(v string) *CreateUserProfileOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateUserProfileOutput) SetType(v string) *CreateUserProfileOutput { - s.Type = &v - return s -} - -// The details of user parameters of an environment blueprint. -type CustomParameter struct { - _ struct{} `type:"structure"` - - // The default value of the parameter. - DefaultValue *string `locationName:"defaultValue" type:"string"` - - // The description of the parameter. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CustomParameter's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The filed type of the parameter. - // - // FieldType is a required field - FieldType *string `locationName:"fieldType" type:"string" required:"true"` - - // Specifies whether the parameter is editable. - IsEditable *bool `locationName:"isEditable" type:"boolean"` - - // Specifies whether the custom parameter is optional. - IsOptional *bool `locationName:"isOptional" type:"boolean"` - - // The key name of the parameter. - // - // KeyName is a required field - KeyName *string `locationName:"keyName" 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 CustomParameter) 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 CustomParameter) GoString() string { - return s.String() -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *CustomParameter) SetDefaultValue(v string) *CustomParameter { - s.DefaultValue = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CustomParameter) SetDescription(v string) *CustomParameter { - s.Description = &v - return s -} - -// SetFieldType sets the FieldType field's value. -func (s *CustomParameter) SetFieldType(v string) *CustomParameter { - s.FieldType = &v - return s -} - -// SetIsEditable sets the IsEditable field's value. -func (s *CustomParameter) SetIsEditable(v bool) *CustomParameter { - s.IsEditable = &v - return s -} - -// SetIsOptional sets the IsOptional field's value. -func (s *CustomParameter) SetIsOptional(v bool) *CustomParameter { - s.IsOptional = &v - return s -} - -// SetKeyName sets the KeyName field's value. -func (s *CustomParameter) SetKeyName(v string) *CustomParameter { - s.KeyName = &v - return s -} - -type DataProductItem struct { - _ struct{} `type:"structure"` - - DomainId *string `locationName:"domainId" type:"string"` - - ItemId *string `locationName:"itemId" 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 DataProductItem) 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 DataProductItem) GoString() string { - return s.String() -} - -// SetDomainId sets the DomainId field's value. -func (s *DataProductItem) SetDomainId(v string) *DataProductItem { - s.DomainId = &v - return s -} - -// SetItemId sets the ItemId field's value. -func (s *DataProductItem) SetItemId(v string) *DataProductItem { - s.ItemId = &v - return s -} - -type DataProductSummary struct { - _ struct{} `type:"structure"` - - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - CreatedBy *string `locationName:"createdBy" type:"string"` - - DataProductItems []*DataProductItem `locationName:"dataProductItems" type:"list"` - - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DataProductSummary's - // String and GoString methods. - Description *string `locationName:"description" min:"1" type:"string" sensitive:"true"` - - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DataProductSummary's - // String and GoString methods. - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - UpdatedBy *string `locationName:"updatedBy" 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 DataProductSummary) 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 DataProductSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DataProductSummary) SetCreatedAt(v time.Time) *DataProductSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *DataProductSummary) SetCreatedBy(v string) *DataProductSummary { - s.CreatedBy = &v - return s -} - -// SetDataProductItems sets the DataProductItems field's value. -func (s *DataProductSummary) SetDataProductItems(v []*DataProductItem) *DataProductSummary { - s.DataProductItems = v - return s -} - -// SetDescription sets the Description field's value. -func (s *DataProductSummary) SetDescription(v string) *DataProductSummary { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *DataProductSummary) SetDomainId(v string) *DataProductSummary { - s.DomainId = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *DataProductSummary) SetGlossaryTerms(v []*string) *DataProductSummary { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *DataProductSummary) SetId(v string) *DataProductSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *DataProductSummary) SetName(v string) *DataProductSummary { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *DataProductSummary) SetOwningProjectId(v string) *DataProductSummary { - s.OwningProjectId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DataProductSummary) SetUpdatedAt(v time.Time) *DataProductSummary { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *DataProductSummary) SetUpdatedBy(v string) *DataProductSummary { - s.UpdatedBy = &v - return s -} - -// The configuration of the data source. -type DataSourceConfigurationInput_ struct { - _ struct{} `type:"structure"` - - // The configuration of the Amazon Web Services Glue data source. - GlueRunConfiguration *GlueRunConfigurationInput_ `locationName:"glueRunConfiguration" type:"structure"` - - // The configuration of the Amazon Redshift data source. - RedshiftRunConfiguration *RedshiftRunConfigurationInput_ `locationName:"redshiftRunConfiguration" 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 DataSourceConfigurationInput_) 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 DataSourceConfigurationInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataSourceConfigurationInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataSourceConfigurationInput_"} - if s.GlueRunConfiguration != nil { - if err := s.GlueRunConfiguration.Validate(); err != nil { - invalidParams.AddNested("GlueRunConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.RedshiftRunConfiguration != nil { - if err := s.RedshiftRunConfiguration.Validate(); err != nil { - invalidParams.AddNested("RedshiftRunConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGlueRunConfiguration sets the GlueRunConfiguration field's value. -func (s *DataSourceConfigurationInput_) SetGlueRunConfiguration(v *GlueRunConfigurationInput_) *DataSourceConfigurationInput_ { - s.GlueRunConfiguration = v - return s -} - -// SetRedshiftRunConfiguration sets the RedshiftRunConfiguration field's value. -func (s *DataSourceConfigurationInput_) SetRedshiftRunConfiguration(v *RedshiftRunConfigurationInput_) *DataSourceConfigurationInput_ { - s.RedshiftRunConfiguration = v - return s -} - -// The configuration of the data source. -type DataSourceConfigurationOutput_ struct { - _ struct{} `type:"structure"` - - // The configuration of the Amazon Web Services Glue data source. - GlueRunConfiguration *GlueRunConfigurationOutput_ `locationName:"glueRunConfiguration" type:"structure"` - - // The configuration of the Amazon Redshift data source. - RedshiftRunConfiguration *RedshiftRunConfigurationOutput_ `locationName:"redshiftRunConfiguration" 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 DataSourceConfigurationOutput_) 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 DataSourceConfigurationOutput_) GoString() string { - return s.String() -} - -// SetGlueRunConfiguration sets the GlueRunConfiguration field's value. -func (s *DataSourceConfigurationOutput_) SetGlueRunConfiguration(v *GlueRunConfigurationOutput_) *DataSourceConfigurationOutput_ { - s.GlueRunConfiguration = v - return s -} - -// SetRedshiftRunConfiguration sets the RedshiftRunConfiguration field's value. -func (s *DataSourceConfigurationOutput_) SetRedshiftRunConfiguration(v *RedshiftRunConfigurationOutput_) *DataSourceConfigurationOutput_ { - s.RedshiftRunConfiguration = v - return s -} - -// The details of the error message that is returned if the operation cannot -// be successfully completed. -type DataSourceErrorMessage struct { - _ struct{} `type:"structure"` - - // The details of the error message that is returned if the operation cannot - // be successfully completed. - ErrorDetail *string `locationName:"errorDetail" type:"string"` - - // The type of the error message that is returned if the operation cannot be - // successfully completed. - // - // ErrorType is a required field - ErrorType *string `locationName:"errorType" type:"string" required:"true" enum:"DataSourceErrorType"` -} - -// 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 DataSourceErrorMessage) 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 DataSourceErrorMessage) GoString() string { - return s.String() -} - -// SetErrorDetail sets the ErrorDetail field's value. -func (s *DataSourceErrorMessage) SetErrorDetail(v string) *DataSourceErrorMessage { - s.ErrorDetail = &v - return s -} - -// SetErrorType sets the ErrorType field's value. -func (s *DataSourceErrorMessage) SetErrorType(v string) *DataSourceErrorMessage { - s.ErrorType = &v - return s -} - -// The activity details of the data source run. -type DataSourceRunActivity struct { - _ struct{} `type:"structure"` - - // The timestamp of when data source run activity was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The identifier of the asset included in the data source run activity. - DataAssetId *string `locationName:"dataAssetId" type:"string"` - - // The status of the asset included in the data source run activity. - // - // DataAssetStatus is a required field - DataAssetStatus *string `locationName:"dataAssetStatus" type:"string" required:"true" enum:"DataAssetActivityStatus"` - - // The identifier of the data source for the data source run activity. - // - // DataSourceRunId is a required field - DataSourceRunId *string `locationName:"dataSourceRunId" type:"string" required:"true"` - - // The database included in the data source run activity. - // - // Database is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DataSourceRunActivity's - // String and GoString methods. - // - // Database is a required field - Database *string `locationName:"database" min:"1" type:"string" required:"true" sensitive:"true"` - - // The details of the error message that is returned if the operation cannot - // be successfully completed. - ErrorMessage *DataSourceErrorMessage `locationName:"errorMessage" type:"structure"` - - // The project ID included in the data source run activity. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The technical description included in the data source run activity. - // - // TechnicalDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DataSourceRunActivity's - // String and GoString methods. - TechnicalDescription *string `locationName:"technicalDescription" type:"string" sensitive:"true"` - - // The technical name included in the data source run activity. - // - // TechnicalName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DataSourceRunActivity's - // String and GoString methods. - // - // TechnicalName is a required field - TechnicalName *string `locationName:"technicalName" min:"1" type:"string" required:"true" sensitive:"true"` - - // The timestamp of when data source run activity was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 DataSourceRunActivity) 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 DataSourceRunActivity) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DataSourceRunActivity) SetCreatedAt(v time.Time) *DataSourceRunActivity { - s.CreatedAt = &v - return s -} - -// SetDataAssetId sets the DataAssetId field's value. -func (s *DataSourceRunActivity) SetDataAssetId(v string) *DataSourceRunActivity { - s.DataAssetId = &v - return s -} - -// SetDataAssetStatus sets the DataAssetStatus field's value. -func (s *DataSourceRunActivity) SetDataAssetStatus(v string) *DataSourceRunActivity { - s.DataAssetStatus = &v - return s -} - -// SetDataSourceRunId sets the DataSourceRunId field's value. -func (s *DataSourceRunActivity) SetDataSourceRunId(v string) *DataSourceRunActivity { - s.DataSourceRunId = &v - return s -} - -// SetDatabase sets the Database field's value. -func (s *DataSourceRunActivity) SetDatabase(v string) *DataSourceRunActivity { - s.Database = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *DataSourceRunActivity) SetErrorMessage(v *DataSourceErrorMessage) *DataSourceRunActivity { - s.ErrorMessage = v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *DataSourceRunActivity) SetProjectId(v string) *DataSourceRunActivity { - s.ProjectId = &v - return s -} - -// SetTechnicalDescription sets the TechnicalDescription field's value. -func (s *DataSourceRunActivity) SetTechnicalDescription(v string) *DataSourceRunActivity { - s.TechnicalDescription = &v - return s -} - -// SetTechnicalName sets the TechnicalName field's value. -func (s *DataSourceRunActivity) SetTechnicalName(v string) *DataSourceRunActivity { - s.TechnicalName = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DataSourceRunActivity) SetUpdatedAt(v time.Time) *DataSourceRunActivity { - s.UpdatedAt = &v - return s -} - -// The details of a data source run. -type DataSourceRunSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when a data source run was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The identifier of the data source of the data source run. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // The details of the error message that is returned if the operation cannot - // be successfully completed. - ErrorMessage *DataSourceErrorMessage `locationName:"errorMessage" type:"structure"` - - // The identifier of the data source run. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The project ID of the data source run. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The asset statistics from the data source run. - RunStatisticsForAssets *RunStatisticsForAssets `locationName:"runStatisticsForAssets" type:"structure"` - - // The timestamp of when a data source run was started. - StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The status of the data source run. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSourceRunStatus"` - - // The timestamp of when a data source run was stopped. - StoppedAt *time.Time `locationName:"stoppedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The type of the data source run. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"DataSourceRunType"` - - // The timestamp of when a data source run was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 DataSourceRunSummary) 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 DataSourceRunSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DataSourceRunSummary) SetCreatedAt(v time.Time) *DataSourceRunSummary { - s.CreatedAt = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DataSourceRunSummary) SetDataSourceId(v string) *DataSourceRunSummary { - s.DataSourceId = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *DataSourceRunSummary) SetErrorMessage(v *DataSourceErrorMessage) *DataSourceRunSummary { - s.ErrorMessage = v - return s -} - -// SetId sets the Id field's value. -func (s *DataSourceRunSummary) SetId(v string) *DataSourceRunSummary { - s.Id = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *DataSourceRunSummary) SetProjectId(v string) *DataSourceRunSummary { - s.ProjectId = &v - return s -} - -// SetRunStatisticsForAssets sets the RunStatisticsForAssets field's value. -func (s *DataSourceRunSummary) SetRunStatisticsForAssets(v *RunStatisticsForAssets) *DataSourceRunSummary { - s.RunStatisticsForAssets = v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *DataSourceRunSummary) SetStartedAt(v time.Time) *DataSourceRunSummary { - s.StartedAt = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DataSourceRunSummary) SetStatus(v string) *DataSourceRunSummary { - s.Status = &v - return s -} - -// SetStoppedAt sets the StoppedAt field's value. -func (s *DataSourceRunSummary) SetStoppedAt(v time.Time) *DataSourceRunSummary { - s.StoppedAt = &v - return s -} - -// SetType sets the Type field's value. -func (s *DataSourceRunSummary) SetType(v string) *DataSourceRunSummary { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DataSourceRunSummary) SetUpdatedAt(v time.Time) *DataSourceRunSummary { - s.UpdatedAt = &v - return s -} - -// The details of the data source. -type DataSourceSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when the data source was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the data source. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain in which the data source exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // Specifies whether the data source is enabled. - EnableSetting *string `locationName:"enableSetting" type:"string" enum:"EnableSetting"` - - // The ID of the environment in which the data source exists. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // The count of the assets created during the last data source run. - LastRunAssetCount *int64 `locationName:"lastRunAssetCount" type:"integer"` - - // The timestamp of when the data source run was last performed. - LastRunAt *time.Time `locationName:"lastRunAt" type:"timestamp" timestampFormat:"iso8601"` - - // The details of the error message that is returned if the operation cannot - // be successfully completed. - LastRunErrorMessage *DataSourceErrorMessage `locationName:"lastRunErrorMessage" type:"structure"` - - // The status of the last data source run. - LastRunStatus *string `locationName:"lastRunStatus" type:"string" enum:"DataSourceRunStatus"` - - // The name of the data source. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DataSourceSummary's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The details of the schedule of the data source runs. - // - // Schedule is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DataSourceSummary's - // String and GoString methods. - Schedule *ScheduleConfiguration `locationName:"schedule" type:"structure" sensitive:"true"` - - // The status of the data source. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSourceStatus"` - - // The type of the data source. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true"` - - // The timestamp of when the data source was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 DataSourceSummary) 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 DataSourceSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DataSourceSummary) SetCreatedAt(v time.Time) *DataSourceSummary { - s.CreatedAt = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DataSourceSummary) SetDataSourceId(v string) *DataSourceSummary { - s.DataSourceId = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *DataSourceSummary) SetDomainId(v string) *DataSourceSummary { - s.DomainId = &v - return s -} - -// SetEnableSetting sets the EnableSetting field's value. -func (s *DataSourceSummary) SetEnableSetting(v string) *DataSourceSummary { - s.EnableSetting = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DataSourceSummary) SetEnvironmentId(v string) *DataSourceSummary { - s.EnvironmentId = &v - return s -} - -// SetLastRunAssetCount sets the LastRunAssetCount field's value. -func (s *DataSourceSummary) SetLastRunAssetCount(v int64) *DataSourceSummary { - s.LastRunAssetCount = &v - return s -} - -// SetLastRunAt sets the LastRunAt field's value. -func (s *DataSourceSummary) SetLastRunAt(v time.Time) *DataSourceSummary { - s.LastRunAt = &v - return s -} - -// SetLastRunErrorMessage sets the LastRunErrorMessage field's value. -func (s *DataSourceSummary) SetLastRunErrorMessage(v *DataSourceErrorMessage) *DataSourceSummary { - s.LastRunErrorMessage = v - return s -} - -// SetLastRunStatus sets the LastRunStatus field's value. -func (s *DataSourceSummary) SetLastRunStatus(v string) *DataSourceSummary { - s.LastRunStatus = &v - return s -} - -// SetName sets the Name field's value. -func (s *DataSourceSummary) SetName(v string) *DataSourceSummary { - s.Name = &v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *DataSourceSummary) SetSchedule(v *ScheduleConfiguration) *DataSourceSummary { - s.Schedule = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DataSourceSummary) SetStatus(v string) *DataSourceSummary { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *DataSourceSummary) SetType(v string) *DataSourceSummary { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DataSourceSummary) SetUpdatedAt(v time.Time) *DataSourceSummary { - s.UpdatedAt = &v - return s -} - -type DeleteAssetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the asset is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the asset that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteAssetInput) 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 DeleteAssetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAssetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAssetInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteAssetInput) SetDomainIdentifier(v string) *DeleteAssetInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteAssetInput) SetIdentifier(v string) *DeleteAssetInput { - s.Identifier = &v - return s -} - -type DeleteAssetOutput 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 DeleteAssetOutput) 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 DeleteAssetOutput) GoString() string { - return s.String() -} - -type DeleteAssetTypeInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the asset type is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the asset type that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" min:"1" 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 DeleteAssetTypeInput) 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 DeleteAssetTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAssetTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAssetTypeInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteAssetTypeInput) SetDomainIdentifier(v string) *DeleteAssetTypeInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteAssetTypeInput) SetIdentifier(v string) *DeleteAssetTypeInput { - s.Identifier = &v - return s -} - -type DeleteAssetTypeOutput 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 DeleteAssetTypeOutput) 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 DeleteAssetTypeOutput) GoString() string { - return s.String() -} - -type DeleteDataSourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `location:"querystring" locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The ID of the Amazon DataZone domain in which the data source is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the data source that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteDataSourceInput) 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 DeleteDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDataSourceInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteDataSourceInput) SetClientToken(v string) *DeleteDataSourceInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteDataSourceInput) SetDomainIdentifier(v string) *DeleteDataSourceInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteDataSourceInput) SetIdentifier(v string) *DeleteDataSourceInput { - s.Identifier = &v - return s -} - -type DeleteDataSourceOutput struct { - _ struct{} `type:"structure"` - - // The asset data forms associated with this data source. - AssetFormsOutput []*FormOutput_ `locationName:"assetFormsOutput" type:"list"` - - // The configuration of the data source that is deleted. - Configuration *DataSourceConfigurationOutput_ `locationName:"configuration" type:"structure"` - - // The timestamp of when this data source was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The description of the data source that is deleted. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DeleteDataSourceOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which the data source is deleted. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The enable setting of the data source that specifies whether the data source - // is enabled or disabled. - EnableSetting *string `locationName:"enableSetting" type:"string" enum:"EnableSetting"` - - // The ID of the environemnt associated with this data source. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - ErrorMessage *DataSourceErrorMessage `locationName:"errorMessage" type:"structure"` - - // The ID of the data source that is deleted. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The timestamp of when the data source was last run. - LastRunAt *time.Time `locationName:"lastRunAt" type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - LastRunErrorMessage *DataSourceErrorMessage `locationName:"lastRunErrorMessage" type:"structure"` - - // The status of the last run of this data source. - LastRunStatus *string `locationName:"lastRunStatus" type:"string" enum:"DataSourceRunStatus"` - - // The name of the data source that is deleted. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DeleteDataSourceOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the project in which this data source exists and from which it's - // deleted. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // Specifies whether the assets that this data source creates in the inventory - // are to be also automatically published to the catalog. - PublishOnImport *bool `locationName:"publishOnImport" type:"boolean"` - - // The schedule of runs for this data source. - // - // Schedule is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DeleteDataSourceOutput's - // String and GoString methods. - Schedule *ScheduleConfiguration `locationName:"schedule" type:"structure" sensitive:"true"` - - // The status of this data source. - Status *string `locationName:"status" type:"string" enum:"DataSourceStatus"` - - // The type of this data source. - Type *string `locationName:"type" min:"1" type:"string"` - - // The timestamp of when this data source was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 DeleteDataSourceOutput) 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 DeleteDataSourceOutput) GoString() string { - return s.String() -} - -// SetAssetFormsOutput sets the AssetFormsOutput field's value. -func (s *DeleteDataSourceOutput) SetAssetFormsOutput(v []*FormOutput_) *DeleteDataSourceOutput { - s.AssetFormsOutput = v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *DeleteDataSourceOutput) SetConfiguration(v *DataSourceConfigurationOutput_) *DeleteDataSourceOutput { - s.Configuration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DeleteDataSourceOutput) SetCreatedAt(v time.Time) *DeleteDataSourceOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DeleteDataSourceOutput) SetDescription(v string) *DeleteDataSourceOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *DeleteDataSourceOutput) SetDomainId(v string) *DeleteDataSourceOutput { - s.DomainId = &v - return s -} - -// SetEnableSetting sets the EnableSetting field's value. -func (s *DeleteDataSourceOutput) SetEnableSetting(v string) *DeleteDataSourceOutput { - s.EnableSetting = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DeleteDataSourceOutput) SetEnvironmentId(v string) *DeleteDataSourceOutput { - s.EnvironmentId = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *DeleteDataSourceOutput) SetErrorMessage(v *DataSourceErrorMessage) *DeleteDataSourceOutput { - s.ErrorMessage = v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteDataSourceOutput) SetId(v string) *DeleteDataSourceOutput { - s.Id = &v - return s -} - -// SetLastRunAt sets the LastRunAt field's value. -func (s *DeleteDataSourceOutput) SetLastRunAt(v time.Time) *DeleteDataSourceOutput { - s.LastRunAt = &v - return s -} - -// SetLastRunErrorMessage sets the LastRunErrorMessage field's value. -func (s *DeleteDataSourceOutput) SetLastRunErrorMessage(v *DataSourceErrorMessage) *DeleteDataSourceOutput { - s.LastRunErrorMessage = v - return s -} - -// SetLastRunStatus sets the LastRunStatus field's value. -func (s *DeleteDataSourceOutput) SetLastRunStatus(v string) *DeleteDataSourceOutput { - s.LastRunStatus = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteDataSourceOutput) SetName(v string) *DeleteDataSourceOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *DeleteDataSourceOutput) SetProjectId(v string) *DeleteDataSourceOutput { - s.ProjectId = &v - return s -} - -// SetPublishOnImport sets the PublishOnImport field's value. -func (s *DeleteDataSourceOutput) SetPublishOnImport(v bool) *DeleteDataSourceOutput { - s.PublishOnImport = &v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *DeleteDataSourceOutput) SetSchedule(v *ScheduleConfiguration) *DeleteDataSourceOutput { - s.Schedule = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteDataSourceOutput) SetStatus(v string) *DeleteDataSourceOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *DeleteDataSourceOutput) SetType(v string) *DeleteDataSourceOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DeleteDataSourceOutput) SetUpdatedAt(v time.Time) *DeleteDataSourceOutput { - s.UpdatedAt = &v - return s -} - -type DeleteDomainInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `location:"querystring" locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The identifier of the Amazon Web Services domain that is to be deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteDomainInput) 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 DeleteDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDomainInput"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteDomainInput) SetClientToken(v string) *DeleteDomainInput { - s.ClientToken = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteDomainInput) SetIdentifier(v string) *DeleteDomainInput { - s.Identifier = &v - return s -} - -type DeleteDomainOutput struct { - _ struct{} `type:"structure"` - - // The status of the domain. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DomainStatus"` -} - -// 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 DeleteDomainOutput) 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 DeleteDomainOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *DeleteDomainOutput) SetStatus(v string) *DeleteDomainOutput { - s.Status = &v - return s -} - -type DeleteEnvironmentBlueprintConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the blueprint configuration - // is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the blueprint the configuration of which is deleted. - // - // EnvironmentBlueprintIdentifier is a required field - EnvironmentBlueprintIdentifier *string `location:"uri" locationName:"environmentBlueprintIdentifier" 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 DeleteEnvironmentBlueprintConfigurationInput) 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 DeleteEnvironmentBlueprintConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEnvironmentBlueprintConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEnvironmentBlueprintConfigurationInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentBlueprintIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentBlueprintIdentifier")) - } - if s.EnvironmentBlueprintIdentifier != nil && len(*s.EnvironmentBlueprintIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentBlueprintIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteEnvironmentBlueprintConfigurationInput) SetDomainIdentifier(v string) *DeleteEnvironmentBlueprintConfigurationInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentBlueprintIdentifier sets the EnvironmentBlueprintIdentifier field's value. -func (s *DeleteEnvironmentBlueprintConfigurationInput) SetEnvironmentBlueprintIdentifier(v string) *DeleteEnvironmentBlueprintConfigurationInput { - s.EnvironmentBlueprintIdentifier = &v - return s -} - -type DeleteEnvironmentBlueprintConfigurationOutput 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 DeleteEnvironmentBlueprintConfigurationOutput) 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 DeleteEnvironmentBlueprintConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteEnvironmentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the environment is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the environment that is to be deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteEnvironmentInput) 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 DeleteEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEnvironmentInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteEnvironmentInput) SetDomainIdentifier(v string) *DeleteEnvironmentInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteEnvironmentInput) SetIdentifier(v string) *DeleteEnvironmentInput { - s.Identifier = &v - return s -} - -type DeleteEnvironmentOutput 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 DeleteEnvironmentOutput) 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 DeleteEnvironmentOutput) GoString() string { - return s.String() -} - -type DeleteEnvironmentProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the environment profile is - // deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the environment profile that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteEnvironmentProfileInput) 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 DeleteEnvironmentProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEnvironmentProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEnvironmentProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteEnvironmentProfileInput) SetDomainIdentifier(v string) *DeleteEnvironmentProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteEnvironmentProfileInput) SetIdentifier(v string) *DeleteEnvironmentProfileInput { - s.Identifier = &v - return s -} - -type DeleteEnvironmentProfileOutput 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 DeleteEnvironmentProfileOutput) 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 DeleteEnvironmentProfileOutput) GoString() string { - return s.String() -} - -type DeleteFormTypeInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the metadata form type is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the metadata form type that is deleted. - // - // FormTypeIdentifier is a required field - FormTypeIdentifier *string `location:"uri" locationName:"formTypeIdentifier" min:"1" 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 DeleteFormTypeInput) 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 DeleteFormTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFormTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFormTypeInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.FormTypeIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("FormTypeIdentifier")) - } - if s.FormTypeIdentifier != nil && len(*s.FormTypeIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FormTypeIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteFormTypeInput) SetDomainIdentifier(v string) *DeleteFormTypeInput { - s.DomainIdentifier = &v - return s -} - -// SetFormTypeIdentifier sets the FormTypeIdentifier field's value. -func (s *DeleteFormTypeInput) SetFormTypeIdentifier(v string) *DeleteFormTypeInput { - s.FormTypeIdentifier = &v - return s -} - -type DeleteFormTypeOutput 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 DeleteFormTypeOutput) 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 DeleteFormTypeOutput) GoString() string { - return s.String() -} - -type DeleteGlossaryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the business glossary is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the business glossary that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteGlossaryInput) 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 DeleteGlossaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGlossaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGlossaryInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteGlossaryInput) SetDomainIdentifier(v string) *DeleteGlossaryInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteGlossaryInput) SetIdentifier(v string) *DeleteGlossaryInput { - s.Identifier = &v - return s -} - -type DeleteGlossaryOutput 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 DeleteGlossaryOutput) 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 DeleteGlossaryOutput) GoString() string { - return s.String() -} - -type DeleteGlossaryTermInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the business glossary term - // is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the business glossary term that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteGlossaryTermInput) 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 DeleteGlossaryTermInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGlossaryTermInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGlossaryTermInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteGlossaryTermInput) SetDomainIdentifier(v string) *DeleteGlossaryTermInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteGlossaryTermInput) SetIdentifier(v string) *DeleteGlossaryTermInput { - s.Identifier = &v - return s -} - -type DeleteGlossaryTermOutput 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 DeleteGlossaryTermOutput) 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 DeleteGlossaryTermOutput) GoString() string { - return s.String() -} - -type DeleteListingInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteListingInput) 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 DeleteListingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteListingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteListingInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteListingInput) SetDomainIdentifier(v string) *DeleteListingInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteListingInput) SetIdentifier(v string) *DeleteListingInput { - s.Identifier = &v - return s -} - -type DeleteListingOutput 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 DeleteListingOutput) 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 DeleteListingOutput) GoString() string { - return s.String() -} - -type DeleteProjectInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the project is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the project that is to be deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteProjectInput) 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 DeleteProjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteProjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteProjectInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteProjectInput) SetDomainIdentifier(v string) *DeleteProjectInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteProjectInput) SetIdentifier(v string) *DeleteProjectInput { - s.Identifier = &v - return s -} - -type DeleteProjectMembershipInput struct { - _ struct{} `type:"structure"` - - // The ID of the Amazon DataZone domain where project membership is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The project member whose project membership is deleted. - // - // Member is a required field - Member *Member `locationName:"member" type:"structure" required:"true"` - - // The ID of the Amazon DataZone project the membership to which is deleted. - // - // ProjectIdentifier is a required field - ProjectIdentifier *string `location:"uri" locationName:"projectIdentifier" 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 DeleteProjectMembershipInput) 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 DeleteProjectMembershipInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteProjectMembershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteProjectMembershipInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Member == nil { - invalidParams.Add(request.NewErrParamRequired("Member")) - } - if s.ProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectIdentifier")) - } - if s.ProjectIdentifier != nil && len(*s.ProjectIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProjectIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteProjectMembershipInput) SetDomainIdentifier(v string) *DeleteProjectMembershipInput { - s.DomainIdentifier = &v - return s -} - -// SetMember sets the Member field's value. -func (s *DeleteProjectMembershipInput) SetMember(v *Member) *DeleteProjectMembershipInput { - s.Member = v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *DeleteProjectMembershipInput) SetProjectIdentifier(v string) *DeleteProjectMembershipInput { - s.ProjectIdentifier = &v - return s -} - -type DeleteProjectMembershipOutput 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 DeleteProjectMembershipOutput) 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 DeleteProjectMembershipOutput) GoString() string { - return s.String() -} - -type DeleteProjectOutput 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 DeleteProjectOutput) 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 DeleteProjectOutput) GoString() string { - return s.String() -} - -type DeleteSubscriptionGrantInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain where the subscription grant is deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the subscription grant that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteSubscriptionGrantInput) 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 DeleteSubscriptionGrantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSubscriptionGrantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriptionGrantInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteSubscriptionGrantInput) SetDomainIdentifier(v string) *DeleteSubscriptionGrantInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteSubscriptionGrantInput) SetIdentifier(v string) *DeleteSubscriptionGrantInput { - s.Identifier = &v - return s -} - -type DeleteSubscriptionGrantOutput struct { - _ struct{} `type:"structure"` - - // The assets for which the subsctiption grant that is deleted gave access. - Assets []*SubscribedAsset `locationName:"assets" type:"list"` - - // The timestamp of when the subscription grant that is deleted was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription grant that is deleted. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain in which the subscription grant is deleted. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The entity to which the subscription is deleted. - // - // GrantedEntity is a required field - GrantedEntity *GrantedEntity `locationName:"grantedEntity" type:"structure" required:"true"` - - // The ID of the subscription grant that is deleted. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The status of the subscription grant that is deleted. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionGrantOverallStatus"` - - // The identifier of the subsctiption whose subscription grant is to be deleted. - SubscriptionId *string `locationName:"subscriptionId" type:"string"` - - // The ID of the subscription target associated with the subscription grant - // that is deleted. - // - // SubscriptionTargetId is a required field - SubscriptionTargetId *string `locationName:"subscriptionTargetId" type:"string" required:"true"` - - // The timestamp of when the subscription grant that is deleted was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription grant that is deleted. - UpdatedBy *string `locationName:"updatedBy" 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 DeleteSubscriptionGrantOutput) 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 DeleteSubscriptionGrantOutput) GoString() string { - return s.String() -} - -// SetAssets sets the Assets field's value. -func (s *DeleteSubscriptionGrantOutput) SetAssets(v []*SubscribedAsset) *DeleteSubscriptionGrantOutput { - s.Assets = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DeleteSubscriptionGrantOutput) SetCreatedAt(v time.Time) *DeleteSubscriptionGrantOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *DeleteSubscriptionGrantOutput) SetCreatedBy(v string) *DeleteSubscriptionGrantOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *DeleteSubscriptionGrantOutput) SetDomainId(v string) *DeleteSubscriptionGrantOutput { - s.DomainId = &v - return s -} - -// SetGrantedEntity sets the GrantedEntity field's value. -func (s *DeleteSubscriptionGrantOutput) SetGrantedEntity(v *GrantedEntity) *DeleteSubscriptionGrantOutput { - s.GrantedEntity = v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteSubscriptionGrantOutput) SetId(v string) *DeleteSubscriptionGrantOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteSubscriptionGrantOutput) SetStatus(v string) *DeleteSubscriptionGrantOutput { - s.Status = &v - return s -} - -// SetSubscriptionId sets the SubscriptionId field's value. -func (s *DeleteSubscriptionGrantOutput) SetSubscriptionId(v string) *DeleteSubscriptionGrantOutput { - s.SubscriptionId = &v - return s -} - -// SetSubscriptionTargetId sets the SubscriptionTargetId field's value. -func (s *DeleteSubscriptionGrantOutput) SetSubscriptionTargetId(v string) *DeleteSubscriptionGrantOutput { - s.SubscriptionTargetId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DeleteSubscriptionGrantOutput) SetUpdatedAt(v time.Time) *DeleteSubscriptionGrantOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *DeleteSubscriptionGrantOutput) SetUpdatedBy(v string) *DeleteSubscriptionGrantOutput { - s.UpdatedBy = &v - return s -} - -type DeleteSubscriptionRequestInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the subscription request is - // deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the subscription request that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteSubscriptionRequestInput) 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 DeleteSubscriptionRequestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSubscriptionRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriptionRequestInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteSubscriptionRequestInput) SetDomainIdentifier(v string) *DeleteSubscriptionRequestInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteSubscriptionRequestInput) SetIdentifier(v string) *DeleteSubscriptionRequestInput { - s.Identifier = &v - return s -} - -type DeleteSubscriptionRequestOutput 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 DeleteSubscriptionRequestOutput) 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 DeleteSubscriptionRequestOutput) GoString() string { - return s.String() -} - -type DeleteSubscriptionTargetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the subscription target is - // deleted. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the Amazon DataZone environment in which the subscription target - // is deleted. - // - // EnvironmentIdentifier is a required field - EnvironmentIdentifier *string `location:"uri" locationName:"environmentIdentifier" type:"string" required:"true"` - - // The ID of the subscription target that is deleted. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 DeleteSubscriptionTargetInput) 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 DeleteSubscriptionTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSubscriptionTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriptionTargetInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentIdentifier")) - } - if s.EnvironmentIdentifier != nil && len(*s.EnvironmentIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *DeleteSubscriptionTargetInput) SetDomainIdentifier(v string) *DeleteSubscriptionTargetInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentIdentifier sets the EnvironmentIdentifier field's value. -func (s *DeleteSubscriptionTargetInput) SetEnvironmentIdentifier(v string) *DeleteSubscriptionTargetInput { - s.EnvironmentIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteSubscriptionTargetInput) SetIdentifier(v string) *DeleteSubscriptionTargetInput { - s.Identifier = &v - return s -} - -type DeleteSubscriptionTargetOutput 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 DeleteSubscriptionTargetOutput) 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 DeleteSubscriptionTargetOutput) GoString() string { - return s.String() -} - -// The details of the last deployment of the environment. -type Deployment struct { - _ struct{} `type:"structure"` - - // The identifier of the last deployment of the environment. - DeploymentId *string `locationName:"deploymentId" type:"string"` - - // The status of the last deployment of the environment. - DeploymentStatus *string `locationName:"deploymentStatus" type:"string" enum:"DeploymentStatus"` - - // The type of the last deployment of the environment. - DeploymentType *string `locationName:"deploymentType" type:"string" enum:"DeploymentType"` - - // The failure reason of the last deployment of the environment. - FailureReason *EnvironmentError `locationName:"failureReason" type:"structure"` - - // Specifies whether the last deployment of the environment is complete. - IsDeploymentComplete *bool `locationName:"isDeploymentComplete" type:"boolean"` - - // The messages of the last deployment of the environment. - Messages []*string `locationName:"messages" type:"list"` -} - -// 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 Deployment) 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 Deployment) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *Deployment) SetDeploymentId(v string) *Deployment { - s.DeploymentId = &v - return s -} - -// SetDeploymentStatus sets the DeploymentStatus field's value. -func (s *Deployment) SetDeploymentStatus(v string) *Deployment { - s.DeploymentStatus = &v - return s -} - -// SetDeploymentType sets the DeploymentType field's value. -func (s *Deployment) SetDeploymentType(v string) *Deployment { - s.DeploymentType = &v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *Deployment) SetFailureReason(v *EnvironmentError) *Deployment { - s.FailureReason = v - return s -} - -// SetIsDeploymentComplete sets the IsDeploymentComplete field's value. -func (s *Deployment) SetIsDeploymentComplete(v bool) *Deployment { - s.IsDeploymentComplete = &v - return s -} - -// SetMessages sets the Messages field's value. -func (s *Deployment) SetMessages(v []*string) *Deployment { - s.Messages = v - return s -} - -// The deployment properties of the Amazon DataZone blueprint. -type DeploymentProperties struct { - _ struct{} `type:"structure"` - - // The end timeout of the environment blueprint deployment. - EndTimeoutMinutes *int64 `locationName:"endTimeoutMinutes" min:"1" type:"integer"` - - // The start timeout of the environment blueprint deployment. - StartTimeoutMinutes *int64 `locationName:"startTimeoutMinutes" min:"1" 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 DeploymentProperties) 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 DeploymentProperties) GoString() string { - return s.String() -} - -// SetEndTimeoutMinutes sets the EndTimeoutMinutes field's value. -func (s *DeploymentProperties) SetEndTimeoutMinutes(v int64) *DeploymentProperties { - s.EndTimeoutMinutes = &v - return s -} - -// SetStartTimeoutMinutes sets the StartTimeoutMinutes field's value. -func (s *DeploymentProperties) SetStartTimeoutMinutes(v int64) *DeploymentProperties { - s.StartTimeoutMinutes = &v - return s -} - -// Details of a glossary term attached to the inventory asset. -type DetailedGlossaryTerm struct { - _ struct{} `type:"structure"` - - // The name of a glossary term attached to the inventory asset. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DetailedGlossaryTerm's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"true"` - - // The shoft description of a glossary term attached to the inventory asset. - // - // ShortDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DetailedGlossaryTerm's - // String and GoString methods. - ShortDescription *string `locationName:"shortDescription" type:"string" sensitive:"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 DetailedGlossaryTerm) 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 DetailedGlossaryTerm) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *DetailedGlossaryTerm) SetName(v string) *DetailedGlossaryTerm { - s.Name = &v - return s -} - -// SetShortDescription sets the ShortDescription field's value. -func (s *DetailedGlossaryTerm) SetShortDescription(v string) *DetailedGlossaryTerm { - s.ShortDescription = &v - return s -} - -// A summary of a Amazon DataZone domain. -type DomainSummary struct { - _ struct{} `type:"structure"` - - // The ARN of the Amazon DataZone domain. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // A timestamp of when a Amazon DataZone domain was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // A description of an Amazon DataZone domain. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DomainSummary's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // A timestamp of when a Amazon DataZone domain was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` - - // The identifier of the Amazon Web Services account that manages the domain. - // - // ManagedAccountId is a required field - ManagedAccountId *string `locationName:"managedAccountId" type:"string" required:"true"` - - // A name of an Amazon DataZone domain. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DomainSummary's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true" sensitive:"true"` - - // The data portal URL for the Amazon DataZone domain. - PortalUrl *string `locationName:"portalUrl" type:"string"` - - // The status of the Amazon DataZone domain. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DomainStatus"` -} - -// 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 DomainSummary) 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 DomainSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DomainSummary) SetArn(v string) *DomainSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DomainSummary) SetCreatedAt(v time.Time) *DomainSummary { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DomainSummary) SetDescription(v string) *DomainSummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *DomainSummary) SetId(v string) *DomainSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *DomainSummary) SetLastUpdatedAt(v time.Time) *DomainSummary { - s.LastUpdatedAt = &v - return s -} - -// SetManagedAccountId sets the ManagedAccountId field's value. -func (s *DomainSummary) SetManagedAccountId(v string) *DomainSummary { - s.ManagedAccountId = &v - return s -} - -// SetName sets the Name field's value. -func (s *DomainSummary) SetName(v string) *DomainSummary { - s.Name = &v - return s -} - -// SetPortalUrl sets the PortalUrl field's value. -func (s *DomainSummary) SetPortalUrl(v string) *DomainSummary { - s.PortalUrl = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DomainSummary) SetStatus(v string) *DomainSummary { - s.Status = &v - return s -} - -// The configuration details of an environment blueprint. -type EnvironmentBlueprintConfigurationItem struct { - _ struct{} `type:"structure"` - - // The timestamp of when an environment blueprint was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The identifier of the Amazon DataZone domain in which an environment blueprint - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The enabled Amazon Web Services Regions specified in a blueprint configuration. - EnabledRegions []*string `locationName:"enabledRegions" type:"list"` - - // The identifier of the environment blueprint. - // - // EnvironmentBlueprintId is a required field - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string" required:"true"` - - // The ARN of the manage access role specified in the environment blueprint - // configuration. - ManageAccessRoleArn *string `locationName:"manageAccessRoleArn" type:"string"` - - // The ARN of the provisioning role specified in the environment blueprint configuration. - ProvisioningRoleArn *string `locationName:"provisioningRoleArn" type:"string"` - - // The regional parameters of the environment blueprint. - RegionalParameters map[string]map[string]*string `locationName:"regionalParameters" type:"map"` - - // The timestamp of when the environment blueprint was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 EnvironmentBlueprintConfigurationItem) 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 EnvironmentBlueprintConfigurationItem) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *EnvironmentBlueprintConfigurationItem) SetCreatedAt(v time.Time) *EnvironmentBlueprintConfigurationItem { - s.CreatedAt = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *EnvironmentBlueprintConfigurationItem) SetDomainId(v string) *EnvironmentBlueprintConfigurationItem { - s.DomainId = &v - return s -} - -// SetEnabledRegions sets the EnabledRegions field's value. -func (s *EnvironmentBlueprintConfigurationItem) SetEnabledRegions(v []*string) *EnvironmentBlueprintConfigurationItem { - s.EnabledRegions = v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *EnvironmentBlueprintConfigurationItem) SetEnvironmentBlueprintId(v string) *EnvironmentBlueprintConfigurationItem { - s.EnvironmentBlueprintId = &v - return s -} - -// SetManageAccessRoleArn sets the ManageAccessRoleArn field's value. -func (s *EnvironmentBlueprintConfigurationItem) SetManageAccessRoleArn(v string) *EnvironmentBlueprintConfigurationItem { - s.ManageAccessRoleArn = &v - return s -} - -// SetProvisioningRoleArn sets the ProvisioningRoleArn field's value. -func (s *EnvironmentBlueprintConfigurationItem) SetProvisioningRoleArn(v string) *EnvironmentBlueprintConfigurationItem { - s.ProvisioningRoleArn = &v - return s -} - -// SetRegionalParameters sets the RegionalParameters field's value. -func (s *EnvironmentBlueprintConfigurationItem) SetRegionalParameters(v map[string]map[string]*string) *EnvironmentBlueprintConfigurationItem { - s.RegionalParameters = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *EnvironmentBlueprintConfigurationItem) SetUpdatedAt(v time.Time) *EnvironmentBlueprintConfigurationItem { - s.UpdatedAt = &v - return s -} - -// The details of an environment blueprint summary. -type EnvironmentBlueprintSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when an environment blueprint was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The description of a blueprint. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EnvironmentBlueprintSummary's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the blueprint. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of the blueprint. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The provider of the blueprint. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The provisioning properties of the blueprint. - // - // ProvisioningProperties is a required field - ProvisioningProperties *ProvisioningProperties `locationName:"provisioningProperties" type:"structure" required:"true"` - - // The timestamp of when the blueprint was enabled. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 EnvironmentBlueprintSummary) 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 EnvironmentBlueprintSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *EnvironmentBlueprintSummary) SetCreatedAt(v time.Time) *EnvironmentBlueprintSummary { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *EnvironmentBlueprintSummary) SetDescription(v string) *EnvironmentBlueprintSummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *EnvironmentBlueprintSummary) SetId(v string) *EnvironmentBlueprintSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *EnvironmentBlueprintSummary) SetName(v string) *EnvironmentBlueprintSummary { - s.Name = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *EnvironmentBlueprintSummary) SetProvider(v string) *EnvironmentBlueprintSummary { - s.Provider = &v - return s -} - -// SetProvisioningProperties sets the ProvisioningProperties field's value. -func (s *EnvironmentBlueprintSummary) SetProvisioningProperties(v *ProvisioningProperties) *EnvironmentBlueprintSummary { - s.ProvisioningProperties = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *EnvironmentBlueprintSummary) SetUpdatedAt(v time.Time) *EnvironmentBlueprintSummary { - s.UpdatedAt = &v - return s -} - -// The failure reasons for the environment deployment. -type EnvironmentError struct { - _ struct{} `type:"structure"` - - // The error code for the failure reason for the environment deployment. - Code *string `locationName:"code" type:"string"` - - // The error message for the failure reason for the environment deployment. - // - // Message is a required field - Message *string `locationName:"message" 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 EnvironmentError) 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 EnvironmentError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *EnvironmentError) SetCode(v string) *EnvironmentError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *EnvironmentError) SetMessage(v string) *EnvironmentError { - s.Message = &v - return s -} - -// The parameter details of an evironment profile. -type EnvironmentParameter struct { - _ struct{} `type:"structure"` - - // The name of an environment profile parameter. - Name *string `locationName:"name" type:"string"` - - // The value of an environment profile parameter. - Value *string `locationName:"value" 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 EnvironmentParameter) 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 EnvironmentParameter) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *EnvironmentParameter) SetName(v string) *EnvironmentParameter { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *EnvironmentParameter) SetValue(v string) *EnvironmentParameter { - s.Value = &v - return s -} - -// The details of an environment profile. -type EnvironmentProfileSummary struct { - _ struct{} `type:"structure"` - - // The identifier of an Amazon Web Services account in which an environment - // profile exists. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services Region in which an environment profile exists. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The timestamp of when an environment profile was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the environment profile. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description of the environment profile. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EnvironmentProfileSummary's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the environment profile - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of a blueprint with which an environment profile is created. - // - // EnvironmentBlueprintId is a required field - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string" required:"true"` - - // The identifier of the environment profile. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of the environment profile. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EnvironmentProfileSummary's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of a project in which an environment profile exists. - ProjectId *string `locationName:"projectId" type:"string"` - - // The timestamp of when the environment profile was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 EnvironmentProfileSummary) 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 EnvironmentProfileSummary) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *EnvironmentProfileSummary) SetAwsAccountId(v string) *EnvironmentProfileSummary { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *EnvironmentProfileSummary) SetAwsAccountRegion(v string) *EnvironmentProfileSummary { - s.AwsAccountRegion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *EnvironmentProfileSummary) SetCreatedAt(v time.Time) *EnvironmentProfileSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *EnvironmentProfileSummary) SetCreatedBy(v string) *EnvironmentProfileSummary { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *EnvironmentProfileSummary) SetDescription(v string) *EnvironmentProfileSummary { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *EnvironmentProfileSummary) SetDomainId(v string) *EnvironmentProfileSummary { - s.DomainId = &v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *EnvironmentProfileSummary) SetEnvironmentBlueprintId(v string) *EnvironmentProfileSummary { - s.EnvironmentBlueprintId = &v - return s -} - -// SetId sets the Id field's value. -func (s *EnvironmentProfileSummary) SetId(v string) *EnvironmentProfileSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *EnvironmentProfileSummary) SetName(v string) *EnvironmentProfileSummary { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *EnvironmentProfileSummary) SetProjectId(v string) *EnvironmentProfileSummary { - s.ProjectId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *EnvironmentProfileSummary) SetUpdatedAt(v time.Time) *EnvironmentProfileSummary { - s.UpdatedAt = &v - return s -} - -// The details of an environment. -type EnvironmentSummary struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Web Services account in which an environment - // exists. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services Region in which an environment exists. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The timestamp of when the environment was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the environment. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description of the environment. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EnvironmentSummary's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the environment exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the environment profile with which the environment was - // created. - // - // EnvironmentProfileId is a required field - EnvironmentProfileId *string `locationName:"environmentProfileId" type:"string" required:"true"` - - // The identifier of the environment. - Id *string `locationName:"id" type:"string"` - - // The name of the environment. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EnvironmentSummary's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the project in which the environment exists. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The provider of the environment. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The status of the environment. - Status *string `locationName:"status" type:"string" enum:"EnvironmentStatus"` - - // The timestamp of when the environment was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 EnvironmentSummary) 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 EnvironmentSummary) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *EnvironmentSummary) SetAwsAccountId(v string) *EnvironmentSummary { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *EnvironmentSummary) SetAwsAccountRegion(v string) *EnvironmentSummary { - s.AwsAccountRegion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *EnvironmentSummary) SetCreatedAt(v time.Time) *EnvironmentSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *EnvironmentSummary) SetCreatedBy(v string) *EnvironmentSummary { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *EnvironmentSummary) SetDescription(v string) *EnvironmentSummary { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *EnvironmentSummary) SetDomainId(v string) *EnvironmentSummary { - s.DomainId = &v - return s -} - -// SetEnvironmentProfileId sets the EnvironmentProfileId field's value. -func (s *EnvironmentSummary) SetEnvironmentProfileId(v string) *EnvironmentSummary { - s.EnvironmentProfileId = &v - return s -} - -// SetId sets the Id field's value. -func (s *EnvironmentSummary) SetId(v string) *EnvironmentSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *EnvironmentSummary) SetName(v string) *EnvironmentSummary { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *EnvironmentSummary) SetProjectId(v string) *EnvironmentSummary { - s.ProjectId = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *EnvironmentSummary) SetProvider(v string) *EnvironmentSummary { - s.Provider = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EnvironmentSummary) SetStatus(v string) *EnvironmentSummary { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *EnvironmentSummary) SetUpdatedAt(v time.Time) *EnvironmentSummary { - s.UpdatedAt = &v - return s -} - -// Specifies the error message that is returned if the operation cannot be successfully -// completed. -type FailureCause struct { - _ struct{} `type:"structure"` - - // The description of the error message. - Message *string `locationName:"message" 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 FailureCause) 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 FailureCause) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *FailureCause) SetMessage(v string) *FailureCause { - s.Message = &v - return s -} - -// A search filter in Amazon DataZone. -type Filter struct { - _ struct{} `type:"structure"` - - // A search filter attribute in Amazon DataZone. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" min:"1" type:"string" required:"true"` - - // A search filter value in Amazon DataZone. - // - // Value is a required field - Value *string `locationName:"value" min:"1" 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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Filter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Filter"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.Attribute != nil && len(*s.Attribute) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Attribute", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *Filter) SetAttribute(v string) *Filter { - s.Attribute = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Filter) SetValue(v string) *Filter { - s.Value = &v - return s -} - -// A search filter clause in Amazon DataZone. -type FilterClause struct { - _ struct{} `type:"structure"` - - // The 'and' search filter clause in Amazon DataZone. - And []*FilterClause `locationName:"and" min:"1" type:"list"` - - // A search filter in Amazon DataZone. - Filter *Filter `locationName:"filter" type:"structure"` - - // The 'or' search filter clause in Amazon DataZone. - Or []*FilterClause `locationName:"or" min:"1" type:"list"` -} - -// 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 FilterClause) 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 FilterClause) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FilterClause) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FilterClause"} - if s.And != nil && len(s.And) < 1 { - invalidParams.Add(request.NewErrParamMinLen("And", 1)) - } - if s.Or != nil && len(s.Or) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Or", 1)) - } - if s.And != nil { - for i, v := range s.And { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "And", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - if s.Or != nil { - for i, v := range s.Or { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Or", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *FilterClause) SetAnd(v []*FilterClause) *FilterClause { - s.And = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *FilterClause) SetFilter(v *Filter) *FilterClause { - s.Filter = v - return s -} - -// SetOr sets the Or field's value. -func (s *FilterClause) SetOr(v []*FilterClause) *FilterClause { - s.Or = v - return s -} - -// A filter expression in Amazon DataZone. -type FilterExpression struct { - _ struct{} `type:"structure"` - - // The search filter expression. - // - // Expression is a required field - Expression *string `locationName:"expression" min:"1" type:"string" required:"true"` - - // The search filter explresison type. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"FilterExpressionType"` -} - -// 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 FilterExpression) 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 FilterExpression) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FilterExpression) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FilterExpression"} - if s.Expression == nil { - invalidParams.Add(request.NewErrParamRequired("Expression")) - } - if s.Expression != nil && len(*s.Expression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Expression", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExpression sets the Expression field's value. -func (s *FilterExpression) SetExpression(v string) *FilterExpression { - s.Expression = &v - return s -} - -// SetType sets the Type field's value. -func (s *FilterExpression) SetType(v string) *FilterExpression { - s.Type = &v - return s -} - -// The details of the form entry. -type FormEntryInput_ struct { - _ struct{} `type:"structure"` - - // Specifies whether a form entry is required. - Required *bool `locationName:"required" type:"boolean"` - - // The type ID of the form entry. - // - // TypeIdentifier is a required field - TypeIdentifier *string `locationName:"typeIdentifier" min:"1" type:"string" required:"true"` - - // The type revision of the form entry. - // - // TypeRevision is a required field - TypeRevision *string `locationName:"typeRevision" min:"1" 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 FormEntryInput_) 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 FormEntryInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FormEntryInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FormEntryInput_"} - if s.TypeIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TypeIdentifier")) - } - if s.TypeIdentifier != nil && len(*s.TypeIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeIdentifier", 1)) - } - if s.TypeRevision == nil { - invalidParams.Add(request.NewErrParamRequired("TypeRevision")) - } - if s.TypeRevision != nil && len(*s.TypeRevision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeRevision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRequired sets the Required field's value. -func (s *FormEntryInput_) SetRequired(v bool) *FormEntryInput_ { - s.Required = &v - return s -} - -// SetTypeIdentifier sets the TypeIdentifier field's value. -func (s *FormEntryInput_) SetTypeIdentifier(v string) *FormEntryInput_ { - s.TypeIdentifier = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *FormEntryInput_) SetTypeRevision(v string) *FormEntryInput_ { - s.TypeRevision = &v - return s -} - -// The details of the form entry. -type FormEntryOutput_ struct { - _ struct{} `type:"structure"` - - // Specifies whether a form entry is required. - Required *bool `locationName:"required" type:"boolean"` - - // The name of the type of the form entry. - // - // TypeName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by FormEntryOutput_'s - // String and GoString methods. - // - // TypeName is a required field - TypeName *string `locationName:"typeName" min:"1" type:"string" required:"true" sensitive:"true"` - - // The type revision of the form entry. - // - // TypeRevision is a required field - TypeRevision *string `locationName:"typeRevision" min:"1" 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 FormEntryOutput_) 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 FormEntryOutput_) GoString() string { - return s.String() -} - -// SetRequired sets the Required field's value. -func (s *FormEntryOutput_) SetRequired(v bool) *FormEntryOutput_ { - s.Required = &v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *FormEntryOutput_) SetTypeName(v string) *FormEntryOutput_ { - s.TypeName = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *FormEntryOutput_) SetTypeRevision(v string) *FormEntryOutput_ { - s.TypeRevision = &v - return s -} - -// The details of a metadata form. -type FormInput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The content of the metadata form. - Content *string `locationName:"content" type:"string"` - - // The name of the metadata form. - // - // FormName is a required field - FormName *string `locationName:"formName" min:"1" type:"string" required:"true"` - - // The ID of the metadata form type. - TypeIdentifier *string `locationName:"typeIdentifier" min:"1" type:"string"` - - // The revision of the metadata form type. - TypeRevision *string `locationName:"typeRevision" min:"1" 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 FormInput_) 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 FormInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FormInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FormInput_"} - if s.FormName == nil { - invalidParams.Add(request.NewErrParamRequired("FormName")) - } - if s.FormName != nil && len(*s.FormName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FormName", 1)) - } - if s.TypeIdentifier != nil && len(*s.TypeIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeIdentifier", 1)) - } - if s.TypeRevision != nil && len(*s.TypeRevision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TypeRevision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *FormInput_) SetContent(v string) *FormInput_ { - s.Content = &v - return s -} - -// SetFormName sets the FormName field's value. -func (s *FormInput_) SetFormName(v string) *FormInput_ { - s.FormName = &v - return s -} - -// SetTypeIdentifier sets the TypeIdentifier field's value. -func (s *FormInput_) SetTypeIdentifier(v string) *FormInput_ { - s.TypeIdentifier = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *FormInput_) SetTypeRevision(v string) *FormInput_ { - s.TypeRevision = &v - return s -} - -// The details of a metadata form. -type FormOutput_ struct { - _ struct{} `type:"structure"` - - // The content of the metadata form. - Content *string `locationName:"content" type:"string"` - - // The name of the metadata form. - // - // FormName is a required field - FormName *string `locationName:"formName" min:"1" type:"string" required:"true"` - - // The name of the metadata form type. - // - // TypeName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by FormOutput_'s - // String and GoString methods. - TypeName *string `locationName:"typeName" min:"1" type:"string" sensitive:"true"` - - // The revision of the metadata form type. - TypeRevision *string `locationName:"typeRevision" min:"1" 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 FormOutput_) 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 FormOutput_) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *FormOutput_) SetContent(v string) *FormOutput_ { - s.Content = &v - return s -} - -// SetFormName sets the FormName field's value. -func (s *FormOutput_) SetFormName(v string) *FormOutput_ { - s.FormName = &v - return s -} - -// SetTypeName sets the TypeName field's value. -func (s *FormOutput_) SetTypeName(v string) *FormOutput_ { - s.TypeName = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *FormOutput_) SetTypeRevision(v string) *FormOutput_ { - s.TypeRevision = &v - return s -} - -// The details of the metadata form type. -type FormTypeData struct { - _ struct{} `type:"structure"` - - // The timestamp of when the metadata form type was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created teh metadata form type. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of the metadata form type. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by FormTypeData's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the form type exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The imports specified in the form type. - Imports []*Import `locationName:"imports" min:"1" type:"list"` - - // The model of the form type. - // - // Model is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by FormTypeData's - // String and GoString methods. - Model *Model `locationName:"model" type:"structure" sensitive:"true"` - - // The name of the form type. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by FormTypeData's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the form type was originally - // created. - OriginDomainId *string `locationName:"originDomainId" type:"string"` - - // The identifier of the project in which the form type was originally created. - OriginProjectId *string `locationName:"originProjectId" type:"string"` - - // The identifier of the project that owns the form type. - OwningProjectId *string `locationName:"owningProjectId" type:"string"` - - // The revision of the form type. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The status of the form type. - Status *string `locationName:"status" type:"string" enum:"FormTypeStatus"` -} - -// 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 FormTypeData) 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 FormTypeData) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *FormTypeData) SetCreatedAt(v time.Time) *FormTypeData { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *FormTypeData) SetCreatedBy(v string) *FormTypeData { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *FormTypeData) SetDescription(v string) *FormTypeData { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *FormTypeData) SetDomainId(v string) *FormTypeData { - s.DomainId = &v - return s -} - -// SetImports sets the Imports field's value. -func (s *FormTypeData) SetImports(v []*Import) *FormTypeData { - s.Imports = v - return s -} - -// SetModel sets the Model field's value. -func (s *FormTypeData) SetModel(v *Model) *FormTypeData { - s.Model = v - return s -} - -// SetName sets the Name field's value. -func (s *FormTypeData) SetName(v string) *FormTypeData { - s.Name = &v - return s -} - -// SetOriginDomainId sets the OriginDomainId field's value. -func (s *FormTypeData) SetOriginDomainId(v string) *FormTypeData { - s.OriginDomainId = &v - return s -} - -// SetOriginProjectId sets the OriginProjectId field's value. -func (s *FormTypeData) SetOriginProjectId(v string) *FormTypeData { - s.OriginProjectId = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *FormTypeData) SetOwningProjectId(v string) *FormTypeData { - s.OwningProjectId = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *FormTypeData) SetRevision(v string) *FormTypeData { - s.Revision = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *FormTypeData) SetStatus(v string) *FormTypeData { - s.Status = &v - return s -} - -type GetAssetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain to which the asset belongs. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the Amazon DataZone asset. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The revision of the Amazon DataZone asset. - Revision *string `location:"querystring" locationName:"revision" min:"1" 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 GetAssetInput) 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 GetAssetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAssetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAssetInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Revision != nil && len(*s.Revision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Revision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetAssetInput) SetDomainIdentifier(v string) *GetAssetInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetAssetInput) SetIdentifier(v string) *GetAssetInput { - s.Identifier = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *GetAssetInput) SetRevision(v string) *GetAssetInput { - s.Revision = &v - return s -} - -type GetAssetOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the asset was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the asset. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of the Amazon DataZone asset. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetAssetOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain to which the asset belongs. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // ExternalIdentifier is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetAssetOutput's - // String and GoString methods. - ExternalIdentifier *string `locationName:"externalIdentifier" min:"1" type:"string" sensitive:"true"` - - // The timestamp of when the first revision of the asset was created. - FirstRevisionCreatedAt *time.Time `locationName:"firstRevisionCreatedAt" type:"timestamp"` - - // The Amazon DataZone user who created the first revision of the asset. - FirstRevisionCreatedBy *string `locationName:"firstRevisionCreatedBy" type:"string"` - - // The metadata forms attached to the asset. - // - // FormsOutput is a required field - FormsOutput []*FormOutput_ `locationName:"formsOutput" type:"list" required:"true"` - - // The business glossary terms attached to the asset. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The ID of the asset. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The details of an asset published in an Amazon DataZone catalog. - Listing *AssetListingDetails `locationName:"listing" type:"structure"` - - // The name of the asset. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetAssetOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the project that owns the asset. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The read-only metadata forms attached to the asset. - ReadOnlyFormsOutput []*FormOutput_ `locationName:"readOnlyFormsOutput" type:"list"` - - // The revision of the asset. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The ID of the asset type. - // - // TypeIdentifier is a required field - TypeIdentifier *string `locationName:"typeIdentifier" min:"1" type:"string" required:"true"` - - // The revision of the asset type. - // - // TypeRevision is a required field - TypeRevision *string `locationName:"typeRevision" min:"1" 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 GetAssetOutput) 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 GetAssetOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetAssetOutput) SetCreatedAt(v time.Time) *GetAssetOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetAssetOutput) SetCreatedBy(v string) *GetAssetOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetAssetOutput) SetDescription(v string) *GetAssetOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetAssetOutput) SetDomainId(v string) *GetAssetOutput { - s.DomainId = &v - return s -} - -// SetExternalIdentifier sets the ExternalIdentifier field's value. -func (s *GetAssetOutput) SetExternalIdentifier(v string) *GetAssetOutput { - s.ExternalIdentifier = &v - return s -} - -// SetFirstRevisionCreatedAt sets the FirstRevisionCreatedAt field's value. -func (s *GetAssetOutput) SetFirstRevisionCreatedAt(v time.Time) *GetAssetOutput { - s.FirstRevisionCreatedAt = &v - return s -} - -// SetFirstRevisionCreatedBy sets the FirstRevisionCreatedBy field's value. -func (s *GetAssetOutput) SetFirstRevisionCreatedBy(v string) *GetAssetOutput { - s.FirstRevisionCreatedBy = &v - return s -} - -// SetFormsOutput sets the FormsOutput field's value. -func (s *GetAssetOutput) SetFormsOutput(v []*FormOutput_) *GetAssetOutput { - s.FormsOutput = v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *GetAssetOutput) SetGlossaryTerms(v []*string) *GetAssetOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *GetAssetOutput) SetId(v string) *GetAssetOutput { - s.Id = &v - return s -} - -// SetListing sets the Listing field's value. -func (s *GetAssetOutput) SetListing(v *AssetListingDetails) *GetAssetOutput { - s.Listing = v - return s -} - -// SetName sets the Name field's value. -func (s *GetAssetOutput) SetName(v string) *GetAssetOutput { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *GetAssetOutput) SetOwningProjectId(v string) *GetAssetOutput { - s.OwningProjectId = &v - return s -} - -// SetReadOnlyFormsOutput sets the ReadOnlyFormsOutput field's value. -func (s *GetAssetOutput) SetReadOnlyFormsOutput(v []*FormOutput_) *GetAssetOutput { - s.ReadOnlyFormsOutput = v - return s -} - -// SetRevision sets the Revision field's value. -func (s *GetAssetOutput) SetRevision(v string) *GetAssetOutput { - s.Revision = &v - return s -} - -// SetTypeIdentifier sets the TypeIdentifier field's value. -func (s *GetAssetOutput) SetTypeIdentifier(v string) *GetAssetOutput { - s.TypeIdentifier = &v - return s -} - -// SetTypeRevision sets the TypeRevision field's value. -func (s *GetAssetOutput) SetTypeRevision(v string) *GetAssetOutput { - s.TypeRevision = &v - return s -} - -type GetAssetTypeInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the asset type exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the asset type. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" min:"1" type:"string" required:"true"` - - // The revision of the asset type. - Revision *string `location:"querystring" locationName:"revision" min:"1" 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 GetAssetTypeInput) 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 GetAssetTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAssetTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAssetTypeInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Revision != nil && len(*s.Revision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Revision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetAssetTypeInput) SetDomainIdentifier(v string) *GetAssetTypeInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetAssetTypeInput) SetIdentifier(v string) *GetAssetTypeInput { - s.Identifier = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *GetAssetTypeInput) SetRevision(v string) *GetAssetTypeInput { - s.Revision = &v - return s -} - -type GetAssetTypeOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the asset type was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the asset type. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of the asset type. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetAssetTypeOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which the asset type exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The metadata forms attached to the asset type. - // - // FormsOutput is a required field - FormsOutput map[string]*FormEntryOutput_ `locationName:"formsOutput" type:"map" required:"true"` - - // The name of the asset type. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain in which the asset type was originally - // created. - OriginDomainId *string `locationName:"originDomainId" type:"string"` - - // The ID of the Amazon DataZone project in which the asset type was originally - // created. - OriginProjectId *string `locationName:"originProjectId" type:"string"` - - // The ID of the Amazon DataZone project that owns the asset type. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The revision of the asset type. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The timestamp of when the asset type was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user that updated the asset type. - UpdatedBy *string `locationName:"updatedBy" 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 GetAssetTypeOutput) 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 GetAssetTypeOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetAssetTypeOutput) SetCreatedAt(v time.Time) *GetAssetTypeOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetAssetTypeOutput) SetCreatedBy(v string) *GetAssetTypeOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetAssetTypeOutput) SetDescription(v string) *GetAssetTypeOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetAssetTypeOutput) SetDomainId(v string) *GetAssetTypeOutput { - s.DomainId = &v - return s -} - -// SetFormsOutput sets the FormsOutput field's value. -func (s *GetAssetTypeOutput) SetFormsOutput(v map[string]*FormEntryOutput_) *GetAssetTypeOutput { - s.FormsOutput = v - return s -} - -// SetName sets the Name field's value. -func (s *GetAssetTypeOutput) SetName(v string) *GetAssetTypeOutput { - s.Name = &v - return s -} - -// SetOriginDomainId sets the OriginDomainId field's value. -func (s *GetAssetTypeOutput) SetOriginDomainId(v string) *GetAssetTypeOutput { - s.OriginDomainId = &v - return s -} - -// SetOriginProjectId sets the OriginProjectId field's value. -func (s *GetAssetTypeOutput) SetOriginProjectId(v string) *GetAssetTypeOutput { - s.OriginProjectId = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *GetAssetTypeOutput) SetOwningProjectId(v string) *GetAssetTypeOutput { - s.OwningProjectId = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *GetAssetTypeOutput) SetRevision(v string) *GetAssetTypeOutput { - s.Revision = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetAssetTypeOutput) SetUpdatedAt(v time.Time) *GetAssetTypeOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GetAssetTypeOutput) SetUpdatedBy(v string) *GetAssetTypeOutput { - s.UpdatedBy = &v - return s -} - -type GetDataSourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the data source exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the Amazon DataZone data source. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetDataSourceInput) 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 GetDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataSourceInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetDataSourceInput) SetDomainIdentifier(v string) *GetDataSourceInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetDataSourceInput) SetIdentifier(v string) *GetDataSourceInput { - s.Identifier = &v - return s -} - -type GetDataSourceOutput struct { - _ struct{} `type:"structure"` - - // The metadata forms attached to the assets created by this data source. - AssetFormsOutput []*FormOutput_ `locationName:"assetFormsOutput" type:"list"` - - // The configuration of the data source. - Configuration *DataSourceConfigurationOutput_ `locationName:"configuration" type:"structure"` - - // The timestamp of when the data source was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The description of the data source. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetDataSourceOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which the data source exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // Specifies whether this data source is enabled or not. - EnableSetting *string `locationName:"enableSetting" type:"string" enum:"EnableSetting"` - - // The ID of the environment where this data source creates and publishes assets, - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - ErrorMessage *DataSourceErrorMessage `locationName:"errorMessage" type:"structure"` - - // The ID of the data source. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The number of assets created by the data source during its last run. - LastRunAssetCount *int64 `locationName:"lastRunAssetCount" type:"integer"` - - // The timestamp of the last run of the data source. - LastRunAt *time.Time `locationName:"lastRunAt" type:"timestamp" timestampFormat:"iso8601"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - LastRunErrorMessage *DataSourceErrorMessage `locationName:"lastRunErrorMessage" type:"structure"` - - // The status of the last run of the data source. - LastRunStatus *string `locationName:"lastRunStatus" type:"string" enum:"DataSourceRunStatus"` - - // The name of the data source. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetDataSourceOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the project where the data source creates and publishes assets. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // Specifies whether the assets that this data source creates in the inventory - // are to be also automatically published to the catalog. - PublishOnImport *bool `locationName:"publishOnImport" type:"boolean"` - - // The recommendation to be updated as part of the UpdateDataSource action. - Recommendation *RecommendationConfiguration `locationName:"recommendation" type:"structure"` - - // The schedule of the data source runs. - // - // Schedule is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetDataSourceOutput's - // String and GoString methods. - Schedule *ScheduleConfiguration `locationName:"schedule" type:"structure" sensitive:"true"` - - // The status of the data source. - Status *string `locationName:"status" type:"string" enum:"DataSourceStatus"` - - // The type of the data source. - Type *string `locationName:"type" min:"1" type:"string"` - - // The timestamp of when the data source was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 GetDataSourceOutput) 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 GetDataSourceOutput) GoString() string { - return s.String() -} - -// SetAssetFormsOutput sets the AssetFormsOutput field's value. -func (s *GetDataSourceOutput) SetAssetFormsOutput(v []*FormOutput_) *GetDataSourceOutput { - s.AssetFormsOutput = v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *GetDataSourceOutput) SetConfiguration(v *DataSourceConfigurationOutput_) *GetDataSourceOutput { - s.Configuration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetDataSourceOutput) SetCreatedAt(v time.Time) *GetDataSourceOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetDataSourceOutput) SetDescription(v string) *GetDataSourceOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetDataSourceOutput) SetDomainId(v string) *GetDataSourceOutput { - s.DomainId = &v - return s -} - -// SetEnableSetting sets the EnableSetting field's value. -func (s *GetDataSourceOutput) SetEnableSetting(v string) *GetDataSourceOutput { - s.EnableSetting = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *GetDataSourceOutput) SetEnvironmentId(v string) *GetDataSourceOutput { - s.EnvironmentId = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *GetDataSourceOutput) SetErrorMessage(v *DataSourceErrorMessage) *GetDataSourceOutput { - s.ErrorMessage = v - return s -} - -// SetId sets the Id field's value. -func (s *GetDataSourceOutput) SetId(v string) *GetDataSourceOutput { - s.Id = &v - return s -} - -// SetLastRunAssetCount sets the LastRunAssetCount field's value. -func (s *GetDataSourceOutput) SetLastRunAssetCount(v int64) *GetDataSourceOutput { - s.LastRunAssetCount = &v - return s -} - -// SetLastRunAt sets the LastRunAt field's value. -func (s *GetDataSourceOutput) SetLastRunAt(v time.Time) *GetDataSourceOutput { - s.LastRunAt = &v - return s -} - -// SetLastRunErrorMessage sets the LastRunErrorMessage field's value. -func (s *GetDataSourceOutput) SetLastRunErrorMessage(v *DataSourceErrorMessage) *GetDataSourceOutput { - s.LastRunErrorMessage = v - return s -} - -// SetLastRunStatus sets the LastRunStatus field's value. -func (s *GetDataSourceOutput) SetLastRunStatus(v string) *GetDataSourceOutput { - s.LastRunStatus = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetDataSourceOutput) SetName(v string) *GetDataSourceOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *GetDataSourceOutput) SetProjectId(v string) *GetDataSourceOutput { - s.ProjectId = &v - return s -} - -// SetPublishOnImport sets the PublishOnImport field's value. -func (s *GetDataSourceOutput) SetPublishOnImport(v bool) *GetDataSourceOutput { - s.PublishOnImport = &v - return s -} - -// SetRecommendation sets the Recommendation field's value. -func (s *GetDataSourceOutput) SetRecommendation(v *RecommendationConfiguration) *GetDataSourceOutput { - s.Recommendation = v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *GetDataSourceOutput) SetSchedule(v *ScheduleConfiguration) *GetDataSourceOutput { - s.Schedule = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetDataSourceOutput) SetStatus(v string) *GetDataSourceOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetDataSourceOutput) SetType(v string) *GetDataSourceOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetDataSourceOutput) SetUpdatedAt(v time.Time) *GetDataSourceOutput { - s.UpdatedAt = &v - return s -} - -type GetDataSourceRunInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the domain in which this data source run was performed. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the data source run. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetDataSourceRunInput) 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 GetDataSourceRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataSourceRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataSourceRunInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetDataSourceRunInput) SetDomainIdentifier(v string) *GetDataSourceRunInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetDataSourceRunInput) SetIdentifier(v string) *GetDataSourceRunInput { - s.Identifier = &v - return s -} - -type GetDataSourceRunOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the data source run was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The configuration snapshot of the data source run. - DataSourceConfigurationSnapshot *string `locationName:"dataSourceConfigurationSnapshot" type:"string"` - - // The ID of the data source for this data source run. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // The ID of the domain in which this data source run was performed. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - ErrorMessage *DataSourceErrorMessage `locationName:"errorMessage" type:"structure"` - - // The ID of the data source run. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The ID of the project in which this data source run occured. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The asset statistics from this data source run. - RunStatisticsForAssets *RunStatisticsForAssets `locationName:"runStatisticsForAssets" type:"structure"` - - // The timestamp of when this data source run started. - StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The status of this data source run. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSourceRunStatus"` - - // The timestamp of when this data source run stopped. - StoppedAt *time.Time `locationName:"stoppedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The type of this data source run. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"DataSourceRunType"` - - // The timestamp of when this data source run was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 GetDataSourceRunOutput) 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 GetDataSourceRunOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetDataSourceRunOutput) SetCreatedAt(v time.Time) *GetDataSourceRunOutput { - s.CreatedAt = &v - return s -} - -// SetDataSourceConfigurationSnapshot sets the DataSourceConfigurationSnapshot field's value. -func (s *GetDataSourceRunOutput) SetDataSourceConfigurationSnapshot(v string) *GetDataSourceRunOutput { - s.DataSourceConfigurationSnapshot = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *GetDataSourceRunOutput) SetDataSourceId(v string) *GetDataSourceRunOutput { - s.DataSourceId = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetDataSourceRunOutput) SetDomainId(v string) *GetDataSourceRunOutput { - s.DomainId = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *GetDataSourceRunOutput) SetErrorMessage(v *DataSourceErrorMessage) *GetDataSourceRunOutput { - s.ErrorMessage = v - return s -} - -// SetId sets the Id field's value. -func (s *GetDataSourceRunOutput) SetId(v string) *GetDataSourceRunOutput { - s.Id = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *GetDataSourceRunOutput) SetProjectId(v string) *GetDataSourceRunOutput { - s.ProjectId = &v - return s -} - -// SetRunStatisticsForAssets sets the RunStatisticsForAssets field's value. -func (s *GetDataSourceRunOutput) SetRunStatisticsForAssets(v *RunStatisticsForAssets) *GetDataSourceRunOutput { - s.RunStatisticsForAssets = v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *GetDataSourceRunOutput) SetStartedAt(v time.Time) *GetDataSourceRunOutput { - s.StartedAt = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetDataSourceRunOutput) SetStatus(v string) *GetDataSourceRunOutput { - s.Status = &v - return s -} - -// SetStoppedAt sets the StoppedAt field's value. -func (s *GetDataSourceRunOutput) SetStoppedAt(v time.Time) *GetDataSourceRunOutput { - s.StoppedAt = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetDataSourceRunOutput) SetType(v string) *GetDataSourceRunOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetDataSourceRunOutput) SetUpdatedAt(v time.Time) *GetDataSourceRunOutput { - s.UpdatedAt = &v - return s -} - -type GetDomainInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the specified Amazon DataZone domain. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetDomainInput) 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 GetDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDomainInput"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetDomainInput) SetIdentifier(v string) *GetDomainInput { - s.Identifier = &v - return s -} - -type GetDomainOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the specified Amazon DataZone domain. - Arn *string `locationName:"arn" type:"string"` - - // The timestamp of when the Amazon DataZone domain was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The description of the Amazon DataZone domain. - Description *string `locationName:"description" type:"string"` - - // The domain execution role with which the Amazon DataZone domain is created. - // - // DomainExecutionRole is a required field - DomainExecutionRole *string `locationName:"domainExecutionRole" type:"string" required:"true"` - - // The identifier of the specified Amazon DataZone domain. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The identifier of the Amazon Web Services Key Management Service (KMS) key - // that is used to encrypt the Amazon DataZone domain, metadata, and reporting - // data. - KmsKeyIdentifier *string `locationName:"kmsKeyIdentifier" min:"1" type:"string"` - - // The timestamp of when the Amazon DataZone domain was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` - - // The name of the Amazon DataZone domain. - Name *string `locationName:"name" type:"string"` - - // The URL of the data portal for this Amazon DataZone domain. - PortalUrl *string `locationName:"portalUrl" type:"string"` - - // The single sing-on option of the specified Amazon DataZone domain. - SingleSignOn *SingleSignOn `locationName:"singleSignOn" type:"structure"` - - // The status of the specified Amazon DataZone domain. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DomainStatus"` - - // The tags specified for the Amazon DataZone domain. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 GetDomainOutput) 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 GetDomainOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetDomainOutput) SetArn(v string) *GetDomainOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetDomainOutput) SetCreatedAt(v time.Time) *GetDomainOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetDomainOutput) SetDescription(v string) *GetDomainOutput { - s.Description = &v - return s -} - -// SetDomainExecutionRole sets the DomainExecutionRole field's value. -func (s *GetDomainOutput) SetDomainExecutionRole(v string) *GetDomainOutput { - s.DomainExecutionRole = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetDomainOutput) SetId(v string) *GetDomainOutput { - s.Id = &v - return s -} - -// SetKmsKeyIdentifier sets the KmsKeyIdentifier field's value. -func (s *GetDomainOutput) SetKmsKeyIdentifier(v string) *GetDomainOutput { - s.KmsKeyIdentifier = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetDomainOutput) SetLastUpdatedAt(v time.Time) *GetDomainOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetDomainOutput) SetName(v string) *GetDomainOutput { - s.Name = &v - return s -} - -// SetPortalUrl sets the PortalUrl field's value. -func (s *GetDomainOutput) SetPortalUrl(v string) *GetDomainOutput { - s.PortalUrl = &v - return s -} - -// SetSingleSignOn sets the SingleSignOn field's value. -func (s *GetDomainOutput) SetSingleSignOn(v *SingleSignOn) *GetDomainOutput { - s.SingleSignOn = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetDomainOutput) SetStatus(v string) *GetDomainOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetDomainOutput) SetTags(v map[string]*string) *GetDomainOutput { - s.Tags = v - return s -} - -type GetEnvironmentBlueprintConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain where this blueprint exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // He ID of the blueprint. - // - // EnvironmentBlueprintIdentifier is a required field - EnvironmentBlueprintIdentifier *string `location:"uri" locationName:"environmentBlueprintIdentifier" 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 GetEnvironmentBlueprintConfigurationInput) 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 GetEnvironmentBlueprintConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEnvironmentBlueprintConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEnvironmentBlueprintConfigurationInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentBlueprintIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentBlueprintIdentifier")) - } - if s.EnvironmentBlueprintIdentifier != nil && len(*s.EnvironmentBlueprintIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentBlueprintIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetEnvironmentBlueprintConfigurationInput) SetDomainIdentifier(v string) *GetEnvironmentBlueprintConfigurationInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentBlueprintIdentifier sets the EnvironmentBlueprintIdentifier field's value. -func (s *GetEnvironmentBlueprintConfigurationInput) SetEnvironmentBlueprintIdentifier(v string) *GetEnvironmentBlueprintConfigurationInput { - s.EnvironmentBlueprintIdentifier = &v - return s -} - -type GetEnvironmentBlueprintConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when this blueprint was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the Amazon DataZone domain where this blueprint exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The Amazon Web Services regions in which this blueprint is enabled. - EnabledRegions []*string `locationName:"enabledRegions" type:"list"` - - // The ID of the blueprint. - // - // EnvironmentBlueprintId is a required field - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string" required:"true"` - - // The ARN of the manage access role with which this blueprint is created. - ManageAccessRoleArn *string `locationName:"manageAccessRoleArn" type:"string"` - - // The ARN of the provisioning role with which this blueprint is created. - ProvisioningRoleArn *string `locationName:"provisioningRoleArn" type:"string"` - - // The regional parameters of the blueprint. - RegionalParameters map[string]map[string]*string `locationName:"regionalParameters" type:"map"` - - // The timestamp of when this blueprint was upated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 GetEnvironmentBlueprintConfigurationOutput) 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 GetEnvironmentBlueprintConfigurationOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetEnvironmentBlueprintConfigurationOutput) SetCreatedAt(v time.Time) *GetEnvironmentBlueprintConfigurationOutput { - s.CreatedAt = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetEnvironmentBlueprintConfigurationOutput) SetDomainId(v string) *GetEnvironmentBlueprintConfigurationOutput { - s.DomainId = &v - return s -} - -// SetEnabledRegions sets the EnabledRegions field's value. -func (s *GetEnvironmentBlueprintConfigurationOutput) SetEnabledRegions(v []*string) *GetEnvironmentBlueprintConfigurationOutput { - s.EnabledRegions = v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *GetEnvironmentBlueprintConfigurationOutput) SetEnvironmentBlueprintId(v string) *GetEnvironmentBlueprintConfigurationOutput { - s.EnvironmentBlueprintId = &v - return s -} - -// SetManageAccessRoleArn sets the ManageAccessRoleArn field's value. -func (s *GetEnvironmentBlueprintConfigurationOutput) SetManageAccessRoleArn(v string) *GetEnvironmentBlueprintConfigurationOutput { - s.ManageAccessRoleArn = &v - return s -} - -// SetProvisioningRoleArn sets the ProvisioningRoleArn field's value. -func (s *GetEnvironmentBlueprintConfigurationOutput) SetProvisioningRoleArn(v string) *GetEnvironmentBlueprintConfigurationOutput { - s.ProvisioningRoleArn = &v - return s -} - -// SetRegionalParameters sets the RegionalParameters field's value. -func (s *GetEnvironmentBlueprintConfigurationOutput) SetRegionalParameters(v map[string]map[string]*string) *GetEnvironmentBlueprintConfigurationOutput { - s.RegionalParameters = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetEnvironmentBlueprintConfigurationOutput) SetUpdatedAt(v time.Time) *GetEnvironmentBlueprintConfigurationOutput { - s.UpdatedAt = &v - return s -} - -type GetEnvironmentBlueprintInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the domain in which this blueprint exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of this Amazon DataZone blueprint. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetEnvironmentBlueprintInput) 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 GetEnvironmentBlueprintInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEnvironmentBlueprintInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEnvironmentBlueprintInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetEnvironmentBlueprintInput) SetDomainIdentifier(v string) *GetEnvironmentBlueprintInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetEnvironmentBlueprintInput) SetIdentifier(v string) *GetEnvironmentBlueprintInput { - s.Identifier = &v - return s -} - -type GetEnvironmentBlueprintOutput struct { - _ struct{} `type:"structure"` - - // A timestamp of when this blueprint was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The deployment properties of this Amazon DataZone blueprint. - DeploymentProperties *DeploymentProperties `locationName:"deploymentProperties" type:"structure"` - - // The description of this Amazon DataZone blueprint. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetEnvironmentBlueprintOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The glossary terms attached to this Amazon DataZone blueprint. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The ID of this Amazon DataZone blueprint. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of this Amazon DataZone blueprint. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The provider of this Amazon DataZone blueprint. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The provisioning properties of this Amazon DataZone blueprint. - // - // ProvisioningProperties is a required field - ProvisioningProperties *ProvisioningProperties `locationName:"provisioningProperties" type:"structure" required:"true"` - - // The timestamp of when this blueprint was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The user parameters of this blueprint. - UserParameters []*CustomParameter `locationName:"userParameters" type:"list"` -} - -// 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 GetEnvironmentBlueprintOutput) 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 GetEnvironmentBlueprintOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetEnvironmentBlueprintOutput) SetCreatedAt(v time.Time) *GetEnvironmentBlueprintOutput { - s.CreatedAt = &v - return s -} - -// SetDeploymentProperties sets the DeploymentProperties field's value. -func (s *GetEnvironmentBlueprintOutput) SetDeploymentProperties(v *DeploymentProperties) *GetEnvironmentBlueprintOutput { - s.DeploymentProperties = v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetEnvironmentBlueprintOutput) SetDescription(v string) *GetEnvironmentBlueprintOutput { - s.Description = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *GetEnvironmentBlueprintOutput) SetGlossaryTerms(v []*string) *GetEnvironmentBlueprintOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *GetEnvironmentBlueprintOutput) SetId(v string) *GetEnvironmentBlueprintOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetEnvironmentBlueprintOutput) SetName(v string) *GetEnvironmentBlueprintOutput { - s.Name = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *GetEnvironmentBlueprintOutput) SetProvider(v string) *GetEnvironmentBlueprintOutput { - s.Provider = &v - return s -} - -// SetProvisioningProperties sets the ProvisioningProperties field's value. -func (s *GetEnvironmentBlueprintOutput) SetProvisioningProperties(v *ProvisioningProperties) *GetEnvironmentBlueprintOutput { - s.ProvisioningProperties = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetEnvironmentBlueprintOutput) SetUpdatedAt(v time.Time) *GetEnvironmentBlueprintOutput { - s.UpdatedAt = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *GetEnvironmentBlueprintOutput) SetUserParameters(v []*CustomParameter) *GetEnvironmentBlueprintOutput { - s.UserParameters = v - return s -} - -type GetEnvironmentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain where the environment exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the Amazon DataZone environment. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetEnvironmentInput) 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 GetEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEnvironmentInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetEnvironmentInput) SetDomainIdentifier(v string) *GetEnvironmentInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetEnvironmentInput) SetIdentifier(v string) *GetEnvironmentInput { - s.Identifier = &v - return s -} - -type GetEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Amazon Web Services account where the environment exists. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services region where the environment exists. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The timestamp of when the environment was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the environment. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The deployment properties of the environment. - DeploymentProperties *DeploymentProperties `locationName:"deploymentProperties" type:"structure"` - - // The description of the environment. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetEnvironmentOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain where the environment exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The actions of the environment. - EnvironmentActions []*ConfigurableEnvironmentAction `locationName:"environmentActions" type:"list"` - - // The blueprint with which the environment is created. - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string"` - - // The ID of the environment profile with which the environment is created. - // - // EnvironmentProfileId is a required field - EnvironmentProfileId *string `locationName:"environmentProfileId" type:"string" required:"true"` - - // The business glossary terms that can be used in this environment. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The ID of the environment. - Id *string `locationName:"id" type:"string"` - - // The details of the last deployment of the environment. - LastDeployment *Deployment `locationName:"lastDeployment" type:"structure"` - - // The name of the environment. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetEnvironmentOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone project in which this environment is created. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The provider of this Amazon DataZone environment. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The provisioned resources of this Amazon DataZone environment. - ProvisionedResources []*Resource `locationName:"provisionedResources" type:"list"` - - // The provisioning properties of this Amazon DataZone environment. - ProvisioningProperties *ProvisioningProperties `locationName:"provisioningProperties" type:"structure"` - - // The status of this Amazon DataZone environment. - Status *string `locationName:"status" type:"string" enum:"EnvironmentStatus"` - - // The timestamp of when this environment was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The user parameters of this Amazon DataZone environment. - UserParameters []*CustomParameter `locationName:"userParameters" type:"list"` -} - -// 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 GetEnvironmentOutput) 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 GetEnvironmentOutput) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *GetEnvironmentOutput) SetAwsAccountId(v string) *GetEnvironmentOutput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *GetEnvironmentOutput) SetAwsAccountRegion(v string) *GetEnvironmentOutput { - s.AwsAccountRegion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetEnvironmentOutput) SetCreatedAt(v time.Time) *GetEnvironmentOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetEnvironmentOutput) SetCreatedBy(v string) *GetEnvironmentOutput { - s.CreatedBy = &v - return s -} - -// SetDeploymentProperties sets the DeploymentProperties field's value. -func (s *GetEnvironmentOutput) SetDeploymentProperties(v *DeploymentProperties) *GetEnvironmentOutput { - s.DeploymentProperties = v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetEnvironmentOutput) SetDescription(v string) *GetEnvironmentOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetEnvironmentOutput) SetDomainId(v string) *GetEnvironmentOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentActions sets the EnvironmentActions field's value. -func (s *GetEnvironmentOutput) SetEnvironmentActions(v []*ConfigurableEnvironmentAction) *GetEnvironmentOutput { - s.EnvironmentActions = v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *GetEnvironmentOutput) SetEnvironmentBlueprintId(v string) *GetEnvironmentOutput { - s.EnvironmentBlueprintId = &v - return s -} - -// SetEnvironmentProfileId sets the EnvironmentProfileId field's value. -func (s *GetEnvironmentOutput) SetEnvironmentProfileId(v string) *GetEnvironmentOutput { - s.EnvironmentProfileId = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *GetEnvironmentOutput) SetGlossaryTerms(v []*string) *GetEnvironmentOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *GetEnvironmentOutput) SetId(v string) *GetEnvironmentOutput { - s.Id = &v - return s -} - -// SetLastDeployment sets the LastDeployment field's value. -func (s *GetEnvironmentOutput) SetLastDeployment(v *Deployment) *GetEnvironmentOutput { - s.LastDeployment = v - return s -} - -// SetName sets the Name field's value. -func (s *GetEnvironmentOutput) SetName(v string) *GetEnvironmentOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *GetEnvironmentOutput) SetProjectId(v string) *GetEnvironmentOutput { - s.ProjectId = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *GetEnvironmentOutput) SetProvider(v string) *GetEnvironmentOutput { - s.Provider = &v - return s -} - -// SetProvisionedResources sets the ProvisionedResources field's value. -func (s *GetEnvironmentOutput) SetProvisionedResources(v []*Resource) *GetEnvironmentOutput { - s.ProvisionedResources = v - return s -} - -// SetProvisioningProperties sets the ProvisioningProperties field's value. -func (s *GetEnvironmentOutput) SetProvisioningProperties(v *ProvisioningProperties) *GetEnvironmentOutput { - s.ProvisioningProperties = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetEnvironmentOutput) SetStatus(v string) *GetEnvironmentOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetEnvironmentOutput) SetUpdatedAt(v time.Time) *GetEnvironmentOutput { - s.UpdatedAt = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *GetEnvironmentOutput) SetUserParameters(v []*CustomParameter) *GetEnvironmentOutput { - s.UserParameters = v - return s -} - -type GetEnvironmentProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which this environment profile exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the environment profile. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetEnvironmentProfileInput) 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 GetEnvironmentProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEnvironmentProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEnvironmentProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetEnvironmentProfileInput) SetDomainIdentifier(v string) *GetEnvironmentProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetEnvironmentProfileInput) SetIdentifier(v string) *GetEnvironmentProfileInput { - s.Identifier = &v - return s -} - -type GetEnvironmentProfileOutput struct { - _ struct{} `type:"structure"` - - // The ID of the Amazon Web Services account where this environment profile - // exists. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services region where this environment profile exists. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The timestamp of when this environment profile was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created this environment profile. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description of the environment profile. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetEnvironmentProfileOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this environment profile exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the blueprint with which this environment profile is created. - // - // EnvironmentBlueprintId is a required field - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string" required:"true"` - - // The ID of the environment profile. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of the environment profile. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetEnvironmentProfileOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone project in which this environment profile is - // created. - ProjectId *string `locationName:"projectId" type:"string"` - - // The timestamp of when this environment profile was upated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The user parameters of the environment profile. - UserParameters []*CustomParameter `locationName:"userParameters" type:"list"` -} - -// 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 GetEnvironmentProfileOutput) 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 GetEnvironmentProfileOutput) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *GetEnvironmentProfileOutput) SetAwsAccountId(v string) *GetEnvironmentProfileOutput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *GetEnvironmentProfileOutput) SetAwsAccountRegion(v string) *GetEnvironmentProfileOutput { - s.AwsAccountRegion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetEnvironmentProfileOutput) SetCreatedAt(v time.Time) *GetEnvironmentProfileOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetEnvironmentProfileOutput) SetCreatedBy(v string) *GetEnvironmentProfileOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetEnvironmentProfileOutput) SetDescription(v string) *GetEnvironmentProfileOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetEnvironmentProfileOutput) SetDomainId(v string) *GetEnvironmentProfileOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *GetEnvironmentProfileOutput) SetEnvironmentBlueprintId(v string) *GetEnvironmentProfileOutput { - s.EnvironmentBlueprintId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetEnvironmentProfileOutput) SetId(v string) *GetEnvironmentProfileOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetEnvironmentProfileOutput) SetName(v string) *GetEnvironmentProfileOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *GetEnvironmentProfileOutput) SetProjectId(v string) *GetEnvironmentProfileOutput { - s.ProjectId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetEnvironmentProfileOutput) SetUpdatedAt(v time.Time) *GetEnvironmentProfileOutput { - s.UpdatedAt = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *GetEnvironmentProfileOutput) SetUserParameters(v []*CustomParameter) *GetEnvironmentProfileOutput { - s.UserParameters = v - return s -} - -type GetFormTypeInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which this metadata form type exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the metadata form type. - // - // FormTypeIdentifier is a required field - FormTypeIdentifier *string `location:"uri" locationName:"formTypeIdentifier" min:"1" type:"string" required:"true"` - - // The revision of this metadata form type. - Revision *string `location:"querystring" locationName:"revision" min:"1" 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 GetFormTypeInput) 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 GetFormTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFormTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFormTypeInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.FormTypeIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("FormTypeIdentifier")) - } - if s.FormTypeIdentifier != nil && len(*s.FormTypeIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FormTypeIdentifier", 1)) - } - if s.Revision != nil && len(*s.Revision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Revision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetFormTypeInput) SetDomainIdentifier(v string) *GetFormTypeInput { - s.DomainIdentifier = &v - return s -} - -// SetFormTypeIdentifier sets the FormTypeIdentifier field's value. -func (s *GetFormTypeInput) SetFormTypeIdentifier(v string) *GetFormTypeInput { - s.FormTypeIdentifier = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *GetFormTypeInput) SetRevision(v string) *GetFormTypeInput { - s.Revision = &v - return s -} - -type GetFormTypeOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when this metadata form type was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created this metadata form type. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of the metadata form type. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetFormTypeOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this metadata form type exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The imports of the metadata form type. - Imports []*Import `locationName:"imports" min:"1" type:"list"` - - // The model of the metadata form type. - // - // Model is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetFormTypeOutput's - // String and GoString methods. - // - // Model is a required field - Model *Model `locationName:"model" type:"structure" required:"true" sensitive:"true"` - - // The name of the metadata form type. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetFormTypeOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which the metadata form type was - // originally created. - OriginDomainId *string `locationName:"originDomainId" type:"string"` - - // The ID of the project in which this metadata form type was originally created. - OriginProjectId *string `locationName:"originProjectId" type:"string"` - - // The ID of the project that owns this metadata form type. - OwningProjectId *string `locationName:"owningProjectId" type:"string"` - - // The revision of the metadata form type. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" type:"string" required:"true"` - - // The status of the metadata form type. - Status *string `locationName:"status" type:"string" enum:"FormTypeStatus"` -} - -// 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 GetFormTypeOutput) 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 GetFormTypeOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetFormTypeOutput) SetCreatedAt(v time.Time) *GetFormTypeOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetFormTypeOutput) SetCreatedBy(v string) *GetFormTypeOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetFormTypeOutput) SetDescription(v string) *GetFormTypeOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetFormTypeOutput) SetDomainId(v string) *GetFormTypeOutput { - s.DomainId = &v - return s -} - -// SetImports sets the Imports field's value. -func (s *GetFormTypeOutput) SetImports(v []*Import) *GetFormTypeOutput { - s.Imports = v - return s -} - -// SetModel sets the Model field's value. -func (s *GetFormTypeOutput) SetModel(v *Model) *GetFormTypeOutput { - s.Model = v - return s -} - -// SetName sets the Name field's value. -func (s *GetFormTypeOutput) SetName(v string) *GetFormTypeOutput { - s.Name = &v - return s -} - -// SetOriginDomainId sets the OriginDomainId field's value. -func (s *GetFormTypeOutput) SetOriginDomainId(v string) *GetFormTypeOutput { - s.OriginDomainId = &v - return s -} - -// SetOriginProjectId sets the OriginProjectId field's value. -func (s *GetFormTypeOutput) SetOriginProjectId(v string) *GetFormTypeOutput { - s.OriginProjectId = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *GetFormTypeOutput) SetOwningProjectId(v string) *GetFormTypeOutput { - s.OwningProjectId = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *GetFormTypeOutput) SetRevision(v string) *GetFormTypeOutput { - s.Revision = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetFormTypeOutput) SetStatus(v string) *GetFormTypeOutput { - s.Status = &v - return s -} - -type GetGlossaryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which this business glossary exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the business glossary. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetGlossaryInput) 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 GetGlossaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGlossaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGlossaryInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetGlossaryInput) SetDomainIdentifier(v string) *GetGlossaryInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetGlossaryInput) SetIdentifier(v string) *GetGlossaryInput { - s.Identifier = &v - return s -} - -type GetGlossaryOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when this business glossary was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created this business glossary. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The description of the business glossary. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetGlossaryOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which this business glossary exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the business glossary. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of the business glossary. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetGlossaryOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the project that owns this business glossary. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The status of the business glossary. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"GlossaryStatus"` - - // The timestamp of when the business glossary was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the business glossary. - UpdatedBy *string `locationName:"updatedBy" 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 GetGlossaryOutput) 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 GetGlossaryOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetGlossaryOutput) SetCreatedAt(v time.Time) *GetGlossaryOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetGlossaryOutput) SetCreatedBy(v string) *GetGlossaryOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetGlossaryOutput) SetDescription(v string) *GetGlossaryOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetGlossaryOutput) SetDomainId(v string) *GetGlossaryOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetGlossaryOutput) SetId(v string) *GetGlossaryOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetGlossaryOutput) SetName(v string) *GetGlossaryOutput { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *GetGlossaryOutput) SetOwningProjectId(v string) *GetGlossaryOutput { - s.OwningProjectId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetGlossaryOutput) SetStatus(v string) *GetGlossaryOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetGlossaryOutput) SetUpdatedAt(v time.Time) *GetGlossaryOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GetGlossaryOutput) SetUpdatedBy(v string) *GetGlossaryOutput { - s.UpdatedBy = &v - return s -} - -type GetGlossaryTermInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which this business glossary term - // exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the business glossary term. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetGlossaryTermInput) 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 GetGlossaryTermInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGlossaryTermInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGlossaryTermInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetGlossaryTermInput) SetDomainIdentifier(v string) *GetGlossaryTermInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetGlossaryTermInput) SetIdentifier(v string) *GetGlossaryTermInput { - s.Identifier = &v - return s -} - -type GetGlossaryTermOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the business glossary term was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the business glossary. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The ID of the Amazon DataZone domain in which this business glossary term - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the business glossary to which this term belongs. - // - // GlossaryId is a required field - GlossaryId *string `locationName:"glossaryId" type:"string" required:"true"` - - // The ID of the business glossary term. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The long description of the business glossary term. - // - // LongDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetGlossaryTermOutput's - // String and GoString methods. - LongDescription *string `locationName:"longDescription" type:"string" sensitive:"true"` - - // The name of the business glossary term. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetGlossaryTermOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The short decription of the business glossary term. - // - // ShortDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetGlossaryTermOutput's - // String and GoString methods. - ShortDescription *string `locationName:"shortDescription" type:"string" sensitive:"true"` - - // The status of the business glossary term. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"GlossaryTermStatus"` - - // The relations of the business glossary term. - TermRelations *TermRelations `locationName:"termRelations" type:"structure"` - - // The timestamp of when the business glossary term was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the business glossary term. - UpdatedBy *string `locationName:"updatedBy" 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 GetGlossaryTermOutput) 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 GetGlossaryTermOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetGlossaryTermOutput) SetCreatedAt(v time.Time) *GetGlossaryTermOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetGlossaryTermOutput) SetCreatedBy(v string) *GetGlossaryTermOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetGlossaryTermOutput) SetDomainId(v string) *GetGlossaryTermOutput { - s.DomainId = &v - return s -} - -// SetGlossaryId sets the GlossaryId field's value. -func (s *GetGlossaryTermOutput) SetGlossaryId(v string) *GetGlossaryTermOutput { - s.GlossaryId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetGlossaryTermOutput) SetId(v string) *GetGlossaryTermOutput { - s.Id = &v - return s -} - -// SetLongDescription sets the LongDescription field's value. -func (s *GetGlossaryTermOutput) SetLongDescription(v string) *GetGlossaryTermOutput { - s.LongDescription = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetGlossaryTermOutput) SetName(v string) *GetGlossaryTermOutput { - s.Name = &v - return s -} - -// SetShortDescription sets the ShortDescription field's value. -func (s *GetGlossaryTermOutput) SetShortDescription(v string) *GetGlossaryTermOutput { - s.ShortDescription = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetGlossaryTermOutput) SetStatus(v string) *GetGlossaryTermOutput { - s.Status = &v - return s -} - -// SetTermRelations sets the TermRelations field's value. -func (s *GetGlossaryTermOutput) SetTermRelations(v *TermRelations) *GetGlossaryTermOutput { - s.TermRelations = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetGlossaryTermOutput) SetUpdatedAt(v time.Time) *GetGlossaryTermOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GetGlossaryTermOutput) SetUpdatedBy(v string) *GetGlossaryTermOutput { - s.UpdatedBy = &v - return s -} - -type GetGroupProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain in which the group profile exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the group profile. - // - // GroupIdentifier is a required field - GroupIdentifier *string `location:"uri" locationName:"groupIdentifier" 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 GetGroupProfileInput) 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 GetGroupProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGroupProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGroupProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GroupIdentifier")) - } - if s.GroupIdentifier != nil && len(*s.GroupIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetGroupProfileInput) SetDomainIdentifier(v string) *GetGroupProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetGroupIdentifier sets the GroupIdentifier field's value. -func (s *GetGroupProfileInput) SetGroupIdentifier(v string) *GetGroupProfileInput { - s.GroupIdentifier = &v - return s -} - -type GetGroupProfileOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which the group profile exists. - DomainId *string `locationName:"domainId" type:"string"` - - // The name of the group for which the specified group profile exists. - // - // GroupName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetGroupProfileOutput's - // String and GoString methods. - GroupName *string `locationName:"groupName" min:"1" type:"string" sensitive:"true"` - - // The identifier of the group profile. - Id *string `locationName:"id" type:"string"` - - // The identifier of the group profile. - Status *string `locationName:"status" type:"string" enum:"GroupProfileStatus"` -} - -// 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 GetGroupProfileOutput) 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 GetGroupProfileOutput) GoString() string { - return s.String() -} - -// SetDomainId sets the DomainId field's value. -func (s *GetGroupProfileOutput) SetDomainId(v string) *GetGroupProfileOutput { - s.DomainId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GetGroupProfileOutput) SetGroupName(v string) *GetGroupProfileOutput { - s.GroupName = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetGroupProfileOutput) SetId(v string) *GetGroupProfileOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetGroupProfileOutput) SetStatus(v string) *GetGroupProfileOutput { - s.Status = &v - return s -} - -type GetIamPortalLoginUrlInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // the ID of the Amazon DataZone domain the data portal of which you want to - // get. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" 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 GetIamPortalLoginUrlInput) 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 GetIamPortalLoginUrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIamPortalLoginUrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIamPortalLoginUrlInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetIamPortalLoginUrlInput) SetDomainIdentifier(v string) *GetIamPortalLoginUrlInput { - s.DomainIdentifier = &v - return s -} - -type GetIamPortalLoginUrlOutput struct { - _ struct{} `type:"structure"` - - // The data portal URL of the specified Amazon DataZone domain. - AuthCodeUrl *string `locationName:"authCodeUrl" type:"string"` - - // The ID of the user profile. - // - // UserProfileId is a required field - UserProfileId *string `locationName:"userProfileId" 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 GetIamPortalLoginUrlOutput) 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 GetIamPortalLoginUrlOutput) GoString() string { - return s.String() -} - -// SetAuthCodeUrl sets the AuthCodeUrl field's value. -func (s *GetIamPortalLoginUrlOutput) SetAuthCodeUrl(v string) *GetIamPortalLoginUrlOutput { - s.AuthCodeUrl = &v - return s -} - -// SetUserProfileId sets the UserProfileId field's value. -func (s *GetIamPortalLoginUrlOutput) SetUserProfileId(v string) *GetIamPortalLoginUrlOutput { - s.UserProfileId = &v - return s -} - -type GetListingInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - ListingRevision *string `location:"querystring" locationName:"listingRevision" min:"1" 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 GetListingInput) 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 GetListingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetListingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetListingInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.ListingRevision != nil && len(*s.ListingRevision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ListingRevision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetListingInput) SetDomainIdentifier(v string) *GetListingInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetListingInput) SetIdentifier(v string) *GetListingInput { - s.Identifier = &v - return s -} - -// SetListingRevision sets the ListingRevision field's value. -func (s *GetListingInput) SetListingRevision(v string) *GetListingInput { - s.ListingRevision = &v - return s -} - -type GetListingOutput struct { - _ struct{} `type:"structure"` - - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the listing. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetListingOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The details of a listing (aka asset published in a Amazon DataZone catalog). - Item *ListingItem `locationName:"item" type:"structure"` - - // ListingRevision is a required field - ListingRevision *string `locationName:"listingRevision" min:"1" type:"string" required:"true"` - - Name *string `locationName:"name" min:"1" type:"string"` - - Status *string `locationName:"status" type:"string" enum:"ListingStatus"` - - // The timestamp of when the listing was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the listing. - UpdatedBy *string `locationName:"updatedBy" 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 GetListingOutput) 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 GetListingOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetListingOutput) SetCreatedAt(v time.Time) *GetListingOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetListingOutput) SetCreatedBy(v string) *GetListingOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetListingOutput) SetDescription(v string) *GetListingOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetListingOutput) SetDomainId(v string) *GetListingOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetListingOutput) SetId(v string) *GetListingOutput { - s.Id = &v - return s -} - -// SetItem sets the Item field's value. -func (s *GetListingOutput) SetItem(v *ListingItem) *GetListingOutput { - s.Item = v - return s -} - -// SetListingRevision sets the ListingRevision field's value. -func (s *GetListingOutput) SetListingRevision(v string) *GetListingOutput { - s.ListingRevision = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetListingOutput) SetName(v string) *GetListingOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetListingOutput) SetStatus(v string) *GetListingOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetListingOutput) SetUpdatedAt(v time.Time) *GetListingOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GetListingOutput) SetUpdatedBy(v string) *GetListingOutput { - s.UpdatedBy = &v - return s -} - -type GetProjectInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the project exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the project. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetProjectInput) 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 GetProjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetProjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetProjectInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetProjectInput) SetDomainIdentifier(v string) *GetProjectInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetProjectInput) SetIdentifier(v string) *GetProjectInput { - s.Identifier = &v - return s -} - -type GetProjectOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the project was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the project. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description of the project. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetProjectOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the Amazon DataZone domain in which the project exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The business glossary terms that can be used in the project. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // >The ID of the project. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The timestamp of when the project was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the project. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetProjectOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"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 GetProjectOutput) 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 GetProjectOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetProjectOutput) SetCreatedAt(v time.Time) *GetProjectOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetProjectOutput) SetCreatedBy(v string) *GetProjectOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetProjectOutput) SetDescription(v string) *GetProjectOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetProjectOutput) SetDomainId(v string) *GetProjectOutput { - s.DomainId = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *GetProjectOutput) SetGlossaryTerms(v []*string) *GetProjectOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *GetProjectOutput) SetId(v string) *GetProjectOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetProjectOutput) SetLastUpdatedAt(v time.Time) *GetProjectOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetProjectOutput) SetName(v string) *GetProjectOutput { - s.Name = &v - return s -} - -type GetSubscriptionGrantInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the subscription grant exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the subscription grant. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetSubscriptionGrantInput) 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 GetSubscriptionGrantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSubscriptionGrantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionGrantInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetSubscriptionGrantInput) SetDomainIdentifier(v string) *GetSubscriptionGrantInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetSubscriptionGrantInput) SetIdentifier(v string) *GetSubscriptionGrantInput { - s.Identifier = &v - return s -} - -type GetSubscriptionGrantOutput struct { - _ struct{} `type:"structure"` - - // The assets for which the subscription grant is created. - Assets []*SubscribedAsset `locationName:"assets" type:"list"` - - // The timestamp of when the subscription grant is created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription grant. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain in which the subscription grant exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The entity to which the subscription is granted. - // - // GrantedEntity is a required field - GrantedEntity *GrantedEntity `locationName:"grantedEntity" type:"structure" required:"true"` - - // The ID of the subscription grant. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The status of the subscription grant. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionGrantOverallStatus"` - - // The identifier of the subscription. - SubscriptionId *string `locationName:"subscriptionId" type:"string"` - - // The subscription target ID associated with the subscription grant. - // - // SubscriptionTargetId is a required field - SubscriptionTargetId *string `locationName:"subscriptionTargetId" type:"string" required:"true"` - - // The timestamp of when the subscription grant was upated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription grant. - UpdatedBy *string `locationName:"updatedBy" 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 GetSubscriptionGrantOutput) 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 GetSubscriptionGrantOutput) GoString() string { - return s.String() -} - -// SetAssets sets the Assets field's value. -func (s *GetSubscriptionGrantOutput) SetAssets(v []*SubscribedAsset) *GetSubscriptionGrantOutput { - s.Assets = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSubscriptionGrantOutput) SetCreatedAt(v time.Time) *GetSubscriptionGrantOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetSubscriptionGrantOutput) SetCreatedBy(v string) *GetSubscriptionGrantOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetSubscriptionGrantOutput) SetDomainId(v string) *GetSubscriptionGrantOutput { - s.DomainId = &v - return s -} - -// SetGrantedEntity sets the GrantedEntity field's value. -func (s *GetSubscriptionGrantOutput) SetGrantedEntity(v *GrantedEntity) *GetSubscriptionGrantOutput { - s.GrantedEntity = v - return s -} - -// SetId sets the Id field's value. -func (s *GetSubscriptionGrantOutput) SetId(v string) *GetSubscriptionGrantOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetSubscriptionGrantOutput) SetStatus(v string) *GetSubscriptionGrantOutput { - s.Status = &v - return s -} - -// SetSubscriptionId sets the SubscriptionId field's value. -func (s *GetSubscriptionGrantOutput) SetSubscriptionId(v string) *GetSubscriptionGrantOutput { - s.SubscriptionId = &v - return s -} - -// SetSubscriptionTargetId sets the SubscriptionTargetId field's value. -func (s *GetSubscriptionGrantOutput) SetSubscriptionTargetId(v string) *GetSubscriptionGrantOutput { - s.SubscriptionTargetId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetSubscriptionGrantOutput) SetUpdatedAt(v time.Time) *GetSubscriptionGrantOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GetSubscriptionGrantOutput) SetUpdatedBy(v string) *GetSubscriptionGrantOutput { - s.UpdatedBy = &v - return s -} - -type GetSubscriptionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the subscription exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the subscription. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetSubscriptionInput) 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 GetSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetSubscriptionInput) SetDomainIdentifier(v string) *GetSubscriptionInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetSubscriptionInput) SetIdentifier(v string) *GetSubscriptionInput { - s.Identifier = &v - return s -} - -type GetSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the subscription was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain in which the subscription exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the subscription. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The retain permissions of the subscription. - RetainPermissions *bool `locationName:"retainPermissions" type:"boolean"` - - // The status of the subscription. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionStatus"` - - // The details of the published asset for which the subscription grant is created. - // - // SubscribedListing is a required field - SubscribedListing *SubscribedListing `locationName:"subscribedListing" type:"structure" required:"true"` - - // The principal that owns the subscription. - // - // SubscribedPrincipal is a required field - SubscribedPrincipal *SubscribedPrincipal `locationName:"subscribedPrincipal" type:"structure" required:"true"` - - // The ID of the subscription request. - SubscriptionRequestId *string `locationName:"subscriptionRequestId" type:"string"` - - // The timestamp of when the subscription was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription. - UpdatedBy *string `locationName:"updatedBy" 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 GetSubscriptionOutput) 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 GetSubscriptionOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSubscriptionOutput) SetCreatedAt(v time.Time) *GetSubscriptionOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetSubscriptionOutput) SetCreatedBy(v string) *GetSubscriptionOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetSubscriptionOutput) SetDomainId(v string) *GetSubscriptionOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSubscriptionOutput) SetId(v string) *GetSubscriptionOutput { - s.Id = &v - return s -} - -// SetRetainPermissions sets the RetainPermissions field's value. -func (s *GetSubscriptionOutput) SetRetainPermissions(v bool) *GetSubscriptionOutput { - s.RetainPermissions = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetSubscriptionOutput) SetStatus(v string) *GetSubscriptionOutput { - s.Status = &v - return s -} - -// SetSubscribedListing sets the SubscribedListing field's value. -func (s *GetSubscriptionOutput) SetSubscribedListing(v *SubscribedListing) *GetSubscriptionOutput { - s.SubscribedListing = v - return s -} - -// SetSubscribedPrincipal sets the SubscribedPrincipal field's value. -func (s *GetSubscriptionOutput) SetSubscribedPrincipal(v *SubscribedPrincipal) *GetSubscriptionOutput { - s.SubscribedPrincipal = v - return s -} - -// SetSubscriptionRequestId sets the SubscriptionRequestId field's value. -func (s *GetSubscriptionOutput) SetSubscriptionRequestId(v string) *GetSubscriptionOutput { - s.SubscriptionRequestId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetSubscriptionOutput) SetUpdatedAt(v time.Time) *GetSubscriptionOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GetSubscriptionOutput) SetUpdatedBy(v string) *GetSubscriptionOutput { - s.UpdatedBy = &v - return s -} - -type GetSubscriptionRequestDetailsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain in which to get the subscription - // request details. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the subscription request the details of which to get. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetSubscriptionRequestDetailsInput) 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 GetSubscriptionRequestDetailsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSubscriptionRequestDetailsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionRequestDetailsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetSubscriptionRequestDetailsInput) SetDomainIdentifier(v string) *GetSubscriptionRequestDetailsInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetSubscriptionRequestDetailsInput) SetIdentifier(v string) *GetSubscriptionRequestDetailsInput { - s.Identifier = &v - return s -} - -type GetSubscriptionRequestDetailsOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the specified subscription request was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription request. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The decision comment of the subscription request. - // - // DecisionComment is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSubscriptionRequestDetailsOutput's - // String and GoString methods. - DecisionComment *string `locationName:"decisionComment" min:"1" type:"string" sensitive:"true"` - - // The Amazon DataZone domain of the subscription request. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the subscription request. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The reason for the subscription request. - // - // RequestReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSubscriptionRequestDetailsOutput's - // String and GoString methods. - // - // RequestReason is a required field - RequestReason *string `locationName:"requestReason" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the Amazon DataZone user who reviewed the subscription - // request. - ReviewerId *string `locationName:"reviewerId" type:"string"` - - // The status of the subscription request. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionRequestStatus"` - - // The subscribed listings in the subscription request. - // - // SubscribedListings is a required field - SubscribedListings []*SubscribedListing `locationName:"subscribedListings" min:"1" type:"list" required:"true"` - - // The subscribed principals in the subscription request. - // - // SubscribedPrincipals is a required field - SubscribedPrincipals []*SubscribedPrincipal `locationName:"subscribedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when the subscription request was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription request. - UpdatedBy *string `locationName:"updatedBy" 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 GetSubscriptionRequestDetailsOutput) 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 GetSubscriptionRequestDetailsOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetCreatedAt(v time.Time) *GetSubscriptionRequestDetailsOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetCreatedBy(v string) *GetSubscriptionRequestDetailsOutput { - s.CreatedBy = &v - return s -} - -// SetDecisionComment sets the DecisionComment field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetDecisionComment(v string) *GetSubscriptionRequestDetailsOutput { - s.DecisionComment = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetDomainId(v string) *GetSubscriptionRequestDetailsOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetId(v string) *GetSubscriptionRequestDetailsOutput { - s.Id = &v - return s -} - -// SetRequestReason sets the RequestReason field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetRequestReason(v string) *GetSubscriptionRequestDetailsOutput { - s.RequestReason = &v - return s -} - -// SetReviewerId sets the ReviewerId field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetReviewerId(v string) *GetSubscriptionRequestDetailsOutput { - s.ReviewerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetStatus(v string) *GetSubscriptionRequestDetailsOutput { - s.Status = &v - return s -} - -// SetSubscribedListings sets the SubscribedListings field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetSubscribedListings(v []*SubscribedListing) *GetSubscriptionRequestDetailsOutput { - s.SubscribedListings = v - return s -} - -// SetSubscribedPrincipals sets the SubscribedPrincipals field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetSubscribedPrincipals(v []*SubscribedPrincipal) *GetSubscriptionRequestDetailsOutput { - s.SubscribedPrincipals = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetUpdatedAt(v time.Time) *GetSubscriptionRequestDetailsOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GetSubscriptionRequestDetailsOutput) SetUpdatedBy(v string) *GetSubscriptionRequestDetailsOutput { - s.UpdatedBy = &v - return s -} - -type GetSubscriptionTargetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Amazon DataZone domain in which the subscription target exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The ID of the environment associated with the subscription target. - // - // EnvironmentIdentifier is a required field - EnvironmentIdentifier *string `location:"uri" locationName:"environmentIdentifier" type:"string" required:"true"` - - // The ID of the subscription target. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 GetSubscriptionTargetInput) 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 GetSubscriptionTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSubscriptionTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionTargetInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentIdentifier")) - } - if s.EnvironmentIdentifier != nil && len(*s.EnvironmentIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetSubscriptionTargetInput) SetDomainIdentifier(v string) *GetSubscriptionTargetInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentIdentifier sets the EnvironmentIdentifier field's value. -func (s *GetSubscriptionTargetInput) SetEnvironmentIdentifier(v string) *GetSubscriptionTargetInput { - s.EnvironmentIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetSubscriptionTargetInput) SetIdentifier(v string) *GetSubscriptionTargetInput { - s.Identifier = &v - return s -} - -type GetSubscriptionTargetOutput struct { - _ struct{} `type:"structure"` - - // The asset types associated with the subscription target. - // - // ApplicableAssetTypes is a required field - ApplicableAssetTypes []*string `locationName:"applicableAssetTypes" type:"list" required:"true"` - - // The authorized principals of the subscription target. - // - // AuthorizedPrincipals is a required field - AuthorizedPrincipals []*string `locationName:"authorizedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when the subscription target was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription target. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The ID of the Amazon DataZone domain in which the subscription target exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The ID of the environment associated with the subscription target. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // The ID of the subscription target. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The manage access role with which the subscription target was created. - // - // ManageAccessRole is a required field - ManageAccessRole *string `locationName:"manageAccessRole" type:"string" required:"true"` - - // The name of the subscription target. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSubscriptionTargetOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the project associated with the subscription target. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The provider of the subscription target. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The configuration of teh subscription target. - // - // SubscriptionTargetConfig is a required field - SubscriptionTargetConfig []*SubscriptionTargetForm `locationName:"subscriptionTargetConfig" type:"list" required:"true"` - - // The type of the subscription target. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true"` - - // The timestamp of when the subscription target was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the subscription target. - UpdatedBy *string `locationName:"updatedBy" 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 GetSubscriptionTargetOutput) 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 GetSubscriptionTargetOutput) GoString() string { - return s.String() -} - -// SetApplicableAssetTypes sets the ApplicableAssetTypes field's value. -func (s *GetSubscriptionTargetOutput) SetApplicableAssetTypes(v []*string) *GetSubscriptionTargetOutput { - s.ApplicableAssetTypes = v - return s -} - -// SetAuthorizedPrincipals sets the AuthorizedPrincipals field's value. -func (s *GetSubscriptionTargetOutput) SetAuthorizedPrincipals(v []*string) *GetSubscriptionTargetOutput { - s.AuthorizedPrincipals = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSubscriptionTargetOutput) SetCreatedAt(v time.Time) *GetSubscriptionTargetOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetSubscriptionTargetOutput) SetCreatedBy(v string) *GetSubscriptionTargetOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetSubscriptionTargetOutput) SetDomainId(v string) *GetSubscriptionTargetOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *GetSubscriptionTargetOutput) SetEnvironmentId(v string) *GetSubscriptionTargetOutput { - s.EnvironmentId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSubscriptionTargetOutput) SetId(v string) *GetSubscriptionTargetOutput { - s.Id = &v - return s -} - -// SetManageAccessRole sets the ManageAccessRole field's value. -func (s *GetSubscriptionTargetOutput) SetManageAccessRole(v string) *GetSubscriptionTargetOutput { - s.ManageAccessRole = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetSubscriptionTargetOutput) SetName(v string) *GetSubscriptionTargetOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *GetSubscriptionTargetOutput) SetProjectId(v string) *GetSubscriptionTargetOutput { - s.ProjectId = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *GetSubscriptionTargetOutput) SetProvider(v string) *GetSubscriptionTargetOutput { - s.Provider = &v - return s -} - -// SetSubscriptionTargetConfig sets the SubscriptionTargetConfig field's value. -func (s *GetSubscriptionTargetOutput) SetSubscriptionTargetConfig(v []*SubscriptionTargetForm) *GetSubscriptionTargetOutput { - s.SubscriptionTargetConfig = v - return s -} - -// SetType sets the Type field's value. -func (s *GetSubscriptionTargetOutput) SetType(v string) *GetSubscriptionTargetOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetSubscriptionTargetOutput) SetUpdatedAt(v time.Time) *GetSubscriptionTargetOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GetSubscriptionTargetOutput) SetUpdatedBy(v string) *GetSubscriptionTargetOutput { - s.UpdatedBy = &v - return s -} - -type GetUserProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // the ID of the Amazon DataZone domain the data portal of which you want to - // get. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The type of the user profile. - Type *string `location:"querystring" locationName:"type" type:"string" enum:"UserProfileType"` - - // The identifier of the user for which you want to get the user profile. - // - // UserIdentifier is a required field - UserIdentifier *string `location:"uri" locationName:"userIdentifier" 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 GetUserProfileInput) 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 GetUserProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUserProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUserProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.UserIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("UserIdentifier")) - } - if s.UserIdentifier != nil && len(*s.UserIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *GetUserProfileInput) SetDomainIdentifier(v string) *GetUserProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetUserProfileInput) SetType(v string) *GetUserProfileInput { - s.Type = &v - return s -} - -// SetUserIdentifier sets the UserIdentifier field's value. -func (s *GetUserProfileInput) SetUserIdentifier(v string) *GetUserProfileInput { - s.UserIdentifier = &v - return s -} - -type GetUserProfileOutput struct { - _ struct{} `type:"structure"` - - // The details of the user profile in Amazon DataZone. - Details *UserProfileDetails `locationName:"details" type:"structure"` - - // the identifier of the Amazon DataZone domain of which you want to get the - // user profile. - DomainId *string `locationName:"domainId" type:"string"` - - // The identifier of the user profile. - Id *string `locationName:"id" type:"string"` - - // The status of the user profile. - Status *string `locationName:"status" type:"string" enum:"UserProfileStatus"` - - // The type of the user profile. - Type *string `locationName:"type" type:"string" enum:"UserProfileType"` -} - -// 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 GetUserProfileOutput) 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 GetUserProfileOutput) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *GetUserProfileOutput) SetDetails(v *UserProfileDetails) *GetUserProfileOutput { - s.Details = v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GetUserProfileOutput) SetDomainId(v string) *GetUserProfileOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetUserProfileOutput) SetId(v string) *GetUserProfileOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetUserProfileOutput) SetStatus(v string) *GetUserProfileOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetUserProfileOutput) SetType(v string) *GetUserProfileOutput { - s.Type = &v - return s -} - -// The details of a business glossary. -type GlossaryItem struct { - _ struct{} `type:"structure"` - - // The timestamp of when the glossary was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the glossary. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The business glossary description. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GlossaryItem's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the business glossary - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the glossary. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of the glossary. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GlossaryItem's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the project that owns the business glosary. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The business glossary status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"GlossaryStatus"` - - // The timestamp of when the business glossary was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the business glossary. - UpdatedBy *string `locationName:"updatedBy" 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 GlossaryItem) 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 GlossaryItem) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GlossaryItem) SetCreatedAt(v time.Time) *GlossaryItem { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GlossaryItem) SetCreatedBy(v string) *GlossaryItem { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GlossaryItem) SetDescription(v string) *GlossaryItem { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GlossaryItem) SetDomainId(v string) *GlossaryItem { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GlossaryItem) SetId(v string) *GlossaryItem { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GlossaryItem) SetName(v string) *GlossaryItem { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *GlossaryItem) SetOwningProjectId(v string) *GlossaryItem { - s.OwningProjectId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GlossaryItem) SetStatus(v string) *GlossaryItem { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GlossaryItem) SetUpdatedAt(v time.Time) *GlossaryItem { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GlossaryItem) SetUpdatedBy(v string) *GlossaryItem { - s.UpdatedBy = &v - return s -} - -// The details of a business glossary term. -type GlossaryTermItem struct { - _ struct{} `type:"structure"` - - // The timestamp of when a business glossary term was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon DataZone user who created the business glossary. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The identifier of the Amazon DataZone domain in which the business glossary - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the business glossary to which the term belongs. - // - // GlossaryId is a required field - GlossaryId *string `locationName:"glossaryId" type:"string" required:"true"` - - // The identifier of the business glossary term. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The long description of the business glossary term. - // - // LongDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GlossaryTermItem's - // String and GoString methods. - LongDescription *string `locationName:"longDescription" type:"string" sensitive:"true"` - - // The name of the business glossary term. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GlossaryTermItem's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The short description of the business glossary term. - // - // ShortDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GlossaryTermItem's - // String and GoString methods. - ShortDescription *string `locationName:"shortDescription" type:"string" sensitive:"true"` - - // The status of the business glossary term. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"GlossaryTermStatus"` - - // The relations of the business glossary term. - TermRelations *TermRelations `locationName:"termRelations" type:"structure"` - - // The timestamp of when a business glossary term was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the business glossary term. - UpdatedBy *string `locationName:"updatedBy" 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 GlossaryTermItem) 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 GlossaryTermItem) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GlossaryTermItem) SetCreatedAt(v time.Time) *GlossaryTermItem { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GlossaryTermItem) SetCreatedBy(v string) *GlossaryTermItem { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *GlossaryTermItem) SetDomainId(v string) *GlossaryTermItem { - s.DomainId = &v - return s -} - -// SetGlossaryId sets the GlossaryId field's value. -func (s *GlossaryTermItem) SetGlossaryId(v string) *GlossaryTermItem { - s.GlossaryId = &v - return s -} - -// SetId sets the Id field's value. -func (s *GlossaryTermItem) SetId(v string) *GlossaryTermItem { - s.Id = &v - return s -} - -// SetLongDescription sets the LongDescription field's value. -func (s *GlossaryTermItem) SetLongDescription(v string) *GlossaryTermItem { - s.LongDescription = &v - return s -} - -// SetName sets the Name field's value. -func (s *GlossaryTermItem) SetName(v string) *GlossaryTermItem { - s.Name = &v - return s -} - -// SetShortDescription sets the ShortDescription field's value. -func (s *GlossaryTermItem) SetShortDescription(v string) *GlossaryTermItem { - s.ShortDescription = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GlossaryTermItem) SetStatus(v string) *GlossaryTermItem { - s.Status = &v - return s -} - -// SetTermRelations sets the TermRelations field's value. -func (s *GlossaryTermItem) SetTermRelations(v *TermRelations) *GlossaryTermItem { - s.TermRelations = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GlossaryTermItem) SetUpdatedAt(v time.Time) *GlossaryTermItem { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *GlossaryTermItem) SetUpdatedBy(v string) *GlossaryTermItem { - s.UpdatedBy = &v - return s -} - -// The configuration details of the Amazon Web Services Glue data source. -type GlueRunConfigurationInput_ struct { - _ struct{} `type:"structure"` - - // The data access role included in the configuration details of the Amazon - // Web Services Glue data source. - DataAccessRole *string `locationName:"dataAccessRole" type:"string"` - - // The relational filter configurations included in the configuration details - // of the Amazon Web Services Glue data source. - // - // RelationalFilterConfigurations is a required field - RelationalFilterConfigurations []*RelationalFilterConfiguration `locationName:"relationalFilterConfigurations" type:"list" 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 GlueRunConfigurationInput_) 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 GlueRunConfigurationInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlueRunConfigurationInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlueRunConfigurationInput_"} - if s.RelationalFilterConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("RelationalFilterConfigurations")) - } - if s.RelationalFilterConfigurations != nil { - for i, v := range s.RelationalFilterConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RelationalFilterConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataAccessRole sets the DataAccessRole field's value. -func (s *GlueRunConfigurationInput_) SetDataAccessRole(v string) *GlueRunConfigurationInput_ { - s.DataAccessRole = &v - return s -} - -// SetRelationalFilterConfigurations sets the RelationalFilterConfigurations field's value. -func (s *GlueRunConfigurationInput_) SetRelationalFilterConfigurations(v []*RelationalFilterConfiguration) *GlueRunConfigurationInput_ { - s.RelationalFilterConfigurations = v - return s -} - -// The configuration details of the Amazon Web Services Glue data source. -type GlueRunConfigurationOutput_ struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account ID included in the configuration details - // of the Amazon Web Services Glue data source. - AccountId *string `locationName:"accountId" min:"12" type:"string"` - - // The data access role included in the configuration details of the Amazon - // Web Services Glue data source. - DataAccessRole *string `locationName:"dataAccessRole" type:"string"` - - // The Amazon Web Services region included in the configuration details of the - // Amazon Web Services Glue data source. - Region *string `locationName:"region" min:"4" type:"string"` - - // The relational filter configurations included in the configuration details - // of the Amazon Web Services Glue data source. - // - // RelationalFilterConfigurations is a required field - RelationalFilterConfigurations []*RelationalFilterConfiguration `locationName:"relationalFilterConfigurations" type:"list" 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 GlueRunConfigurationOutput_) 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 GlueRunConfigurationOutput_) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *GlueRunConfigurationOutput_) SetAccountId(v string) *GlueRunConfigurationOutput_ { - s.AccountId = &v - return s -} - -// SetDataAccessRole sets the DataAccessRole field's value. -func (s *GlueRunConfigurationOutput_) SetDataAccessRole(v string) *GlueRunConfigurationOutput_ { - s.DataAccessRole = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *GlueRunConfigurationOutput_) SetRegion(v string) *GlueRunConfigurationOutput_ { - s.Region = &v - return s -} - -// SetRelationalFilterConfigurations sets the RelationalFilterConfigurations field's value. -func (s *GlueRunConfigurationOutput_) SetRelationalFilterConfigurations(v []*RelationalFilterConfiguration) *GlueRunConfigurationOutput_ { - s.RelationalFilterConfigurations = v - return s -} - -// The details of a listing for which a subscription is granted. -type GrantedEntity struct { - _ struct{} `type:"structure"` - - // The listing for which a subscription is granted. - Listing *ListingRevision `locationName:"listing" 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 GrantedEntity) 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 GrantedEntity) GoString() string { - return s.String() -} - -// SetListing sets the Listing field's value. -func (s *GrantedEntity) SetListing(v *ListingRevision) *GrantedEntity { - s.Listing = v - return s -} - -// The details of a listing for which a subscription is to be granted. -type GrantedEntityInput_ struct { - _ struct{} `type:"structure"` - - // The listing for which a subscription is to be granted. - Listing *ListingRevisionInput_ `locationName:"listing" 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 GrantedEntityInput_) 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 GrantedEntityInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GrantedEntityInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GrantedEntityInput_"} - if s.Listing != nil { - if err := s.Listing.Validate(); err != nil { - invalidParams.AddNested("Listing", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListing sets the Listing field's value. -func (s *GrantedEntityInput_) SetListing(v *ListingRevisionInput_) *GrantedEntityInput_ { - s.Listing = v - return s -} - -// The details of a group in Amazon DataZone. -type GroupDetails struct { - _ struct{} `type:"structure"` - - // The identifier of the group in Amazon DataZone. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" 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 GroupDetails) 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 GroupDetails) GoString() string { - return s.String() -} - -// SetGroupId sets the GroupId field's value. -func (s *GroupDetails) SetGroupId(v string) *GroupDetails { - s.GroupId = &v - return s -} - -// The details of a group profile. -type GroupProfileSummary struct { - _ struct{} `type:"structure"` - - // The ID of the Amazon DataZone domain of a group profile. - DomainId *string `locationName:"domainId" type:"string"` - - // The group name of a group profile. - // - // GroupName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GroupProfileSummary's - // String and GoString methods. - GroupName *string `locationName:"groupName" min:"1" type:"string" sensitive:"true"` - - // The ID of a group profile. - Id *string `locationName:"id" type:"string"` - - // The status of a group profile. - Status *string `locationName:"status" type:"string" enum:"GroupProfileStatus"` -} - -// 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 GroupProfileSummary) 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 GroupProfileSummary) GoString() string { - return s.String() -} - -// SetDomainId sets the DomainId field's value. -func (s *GroupProfileSummary) SetDomainId(v string) *GroupProfileSummary { - s.DomainId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GroupProfileSummary) SetGroupName(v string) *GroupProfileSummary { - s.GroupName = &v - return s -} - -// SetId sets the Id field's value. -func (s *GroupProfileSummary) SetId(v string) *GroupProfileSummary { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GroupProfileSummary) SetStatus(v string) *GroupProfileSummary { - s.Status = &v - return s -} - -// The details of an IAM user profile in Amazon DataZone. -type IamUserProfileDetails struct { - _ struct{} `type:"structure"` - - // The ARN of an IAM user profile in Amazon DataZone. - Arn *string `locationName:"arn" 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 IamUserProfileDetails) 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 IamUserProfileDetails) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *IamUserProfileDetails) SetArn(v string) *IamUserProfileDetails { - s.Arn = &v - return s -} - -// The details of the import of the metadata form type. -type Import struct { - _ struct{} `type:"structure"` - - // The name of the import. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Import's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The revision of the import. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" 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 Import) 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 Import) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Import) SetName(v string) *Import { - s.Name = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *Import) SetRevision(v string) *Import { - s.Revision = &v - return s -} - -// The request has failed because of an unknown error, exception or failure. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListAssetRevisionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the asset. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The maximum number of revisions to return in a single call to ListAssetRevisions. - // When the number of revisions to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to ListAssetRevisions to list the next set of revisions. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of revisions is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of revisions, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to ListAssetRevisions - // to list the next set of revisions. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListAssetRevisionsInput) 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 ListAssetRevisionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssetRevisionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssetRevisionsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListAssetRevisionsInput) SetDomainIdentifier(v string) *ListAssetRevisionsInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *ListAssetRevisionsInput) SetIdentifier(v string) *ListAssetRevisionsInput { - s.Identifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssetRevisionsInput) SetMaxResults(v int64) *ListAssetRevisionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssetRevisionsInput) SetNextToken(v string) *ListAssetRevisionsInput { - s.NextToken = &v - return s -} - -type ListAssetRevisionsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListAssetRevisions action. - Items []*AssetRevision `locationName:"items" type:"list"` - - // When the number of revisions is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of revisions, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to ListAssetRevisions - // to list the next set of revisions. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAssetRevisionsOutput) 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 ListAssetRevisionsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListAssetRevisionsOutput) SetItems(v []*AssetRevision) *ListAssetRevisionsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssetRevisionsOutput) SetNextToken(v string) *ListAssetRevisionsOutput { - s.NextToken = &v - return s -} - -type ListDataSourceRunActivitiesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain in which to list data source - // run activities. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the data source run. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The maximum number of activities to return in a single call to ListDataSourceRunActivities. - // When the number of activities to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to ListDataSourceRunActivities to list the next set of activities. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of activities is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of activities, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to ListDataSourceRunActivities - // to list the next set of activities. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The status of the data source run. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"DataAssetActivityStatus"` -} - -// 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 ListDataSourceRunActivitiesInput) 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 ListDataSourceRunActivitiesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataSourceRunActivitiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataSourceRunActivitiesInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListDataSourceRunActivitiesInput) SetDomainIdentifier(v string) *ListDataSourceRunActivitiesInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *ListDataSourceRunActivitiesInput) SetIdentifier(v string) *ListDataSourceRunActivitiesInput { - s.Identifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataSourceRunActivitiesInput) SetMaxResults(v int64) *ListDataSourceRunActivitiesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourceRunActivitiesInput) SetNextToken(v string) *ListDataSourceRunActivitiesInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListDataSourceRunActivitiesInput) SetStatus(v string) *ListDataSourceRunActivitiesInput { - s.Status = &v - return s -} - -type ListDataSourceRunActivitiesOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListDataSourceRunActivities action. - // - // Items is a required field - Items []*DataSourceRunActivity `locationName:"items" type:"list" required:"true"` - - // When the number of activities is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of activities, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to ListDataSourceRunActivities - // to list the next set of activities. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDataSourceRunActivitiesOutput) 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 ListDataSourceRunActivitiesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListDataSourceRunActivitiesOutput) SetItems(v []*DataSourceRunActivity) *ListDataSourceRunActivitiesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourceRunActivitiesOutput) SetNextToken(v string) *ListDataSourceRunActivitiesOutput { - s.NextToken = &v - return s -} - -type ListDataSourceRunsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the data source. - // - // DataSourceIdentifier is a required field - DataSourceIdentifier *string `location:"uri" locationName:"dataSourceIdentifier" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which to invoke the ListDataSourceRuns - // action. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The maximum number of runs to return in a single call to ListDataSourceRuns. - // When the number of runs to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to ListDataSourceRuns to list the next set of runs. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of runs is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of runs, the response includes a pagination token named NextToken. - // You can specify this NextToken value in a subsequent call to ListDataSourceRuns - // to list the next set of runs. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The status of the data source. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"DataSourceRunStatus"` -} - -// 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 ListDataSourceRunsInput) 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 ListDataSourceRunsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataSourceRunsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataSourceRunsInput"} - if s.DataSourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceIdentifier")) - } - if s.DataSourceIdentifier != nil && len(*s.DataSourceIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceIdentifier", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceIdentifier sets the DataSourceIdentifier field's value. -func (s *ListDataSourceRunsInput) SetDataSourceIdentifier(v string) *ListDataSourceRunsInput { - s.DataSourceIdentifier = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListDataSourceRunsInput) SetDomainIdentifier(v string) *ListDataSourceRunsInput { - s.DomainIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataSourceRunsInput) SetMaxResults(v int64) *ListDataSourceRunsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourceRunsInput) SetNextToken(v string) *ListDataSourceRunsInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListDataSourceRunsInput) SetStatus(v string) *ListDataSourceRunsInput { - s.Status = &v - return s -} - -type ListDataSourceRunsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListDataSourceRuns action. - // - // Items is a required field - Items []*DataSourceRunSummary `locationName:"items" type:"list" required:"true"` - - // When the number of runs is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of runs, the response includes a pagination token named NextToken. - // You can specify this NextToken value in a subsequent call to ListDataSourceRuns - // to list the next set of runs. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDataSourceRunsOutput) 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 ListDataSourceRunsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListDataSourceRunsOutput) SetItems(v []*DataSourceRunSummary) *ListDataSourceRunsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourceRunsOutput) SetNextToken(v string) *ListDataSourceRunsOutput { - s.NextToken = &v - return s -} - -type ListDataSourcesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain in which to list the data sources. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the environment in which to list the data sources. - EnvironmentIdentifier *string `location:"querystring" locationName:"environmentIdentifier" type:"string"` - - // The maximum number of data sources to return in a single call to ListDataSources. - // When the number of data sources to be listed is greater than the value of - // MaxResults, the response contains a NextToken value that you can use in a - // subsequent call to ListDataSources to list the next set of data sources. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The name of the data source. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListDataSourcesInput's - // String and GoString methods. - Name *string `location:"querystring" locationName:"name" min:"1" type:"string" sensitive:"true"` - - // When the number of data sources is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of data sources, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListDataSources to list the next set of data sources. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the project in which to list data sources. - // - // ProjectIdentifier is a required field - ProjectIdentifier *string `location:"querystring" locationName:"projectIdentifier" type:"string" required:"true"` - - // The status of the data source. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"DataSourceStatus"` - - // The type of the data source. - Type *string `location:"querystring" locationName:"type" min:"1" 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 ListDataSourcesInput) 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 ListDataSourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataSourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataSourcesInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectIdentifier")) - } - if s.Type != nil && len(*s.Type) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Type", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListDataSourcesInput) SetDomainIdentifier(v string) *ListDataSourcesInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentIdentifier sets the EnvironmentIdentifier field's value. -func (s *ListDataSourcesInput) SetEnvironmentIdentifier(v string) *ListDataSourcesInput { - s.EnvironmentIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataSourcesInput) SetMaxResults(v int64) *ListDataSourcesInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListDataSourcesInput) SetName(v string) *ListDataSourcesInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourcesInput) SetNextToken(v string) *ListDataSourcesInput { - s.NextToken = &v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *ListDataSourcesInput) SetProjectIdentifier(v string) *ListDataSourcesInput { - s.ProjectIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListDataSourcesInput) SetStatus(v string) *ListDataSourcesInput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *ListDataSourcesInput) SetType(v string) *ListDataSourcesInput { - s.Type = &v - return s -} - -type ListDataSourcesOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListDataSources action. - // - // Items is a required field - Items []*DataSourceSummary `locationName:"items" type:"list" required:"true"` - - // When the number of data sources is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of data sources, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListDataSources to list the next set of data sources. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDataSourcesOutput) 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 ListDataSourcesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListDataSourcesOutput) SetItems(v []*DataSourceSummary) *ListDataSourcesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourcesOutput) SetNextToken(v string) *ListDataSourcesOutput { - s.NextToken = &v - return s -} - -type ListDomainsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of domains to return in a single call to ListDomains. - // When the number of domains to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to ListDomains to list the next set of domains. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of domains is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of domains, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to ListDomains - // to list the next set of domains. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The status of the data source. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"DomainStatus"` -} - -// 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 ListDomainsInput) 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 ListDomainsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDomainsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDomainsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDomainsInput) SetMaxResults(v int64) *ListDomainsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDomainsInput) SetNextToken(v string) *ListDomainsInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListDomainsInput) SetStatus(v string) *ListDomainsInput { - s.Status = &v - return s -} - -type ListDomainsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListDomains action. - // - // Items is a required field - Items []*DomainSummary `locationName:"items" type:"list" required:"true"` - - // When the number of domains is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of domains, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to ListDomains - // to list the next set of domains. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDomainsOutput) 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 ListDomainsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListDomainsOutput) SetItems(v []*DomainSummary) *ListDomainsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDomainsOutput) SetNextToken(v string) *ListDomainsOutput { - s.NextToken = &v - return s -} - -type ListEnvironmentBlueprintConfigurationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The maximum number of blueprint configurations to return in a single call - // to ListEnvironmentBlueprintConfigurations. When the number of configurations - // to be listed is greater than the value of MaxResults, the response contains - // a NextToken value that you can use in a subsequent call to ListEnvironmentBlueprintConfigurations - // to list the next set of configurations. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of blueprint configurations is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of configurations, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListEnvironmentBlueprintConfigurations to list the next set of configurations. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListEnvironmentBlueprintConfigurationsInput) 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 ListEnvironmentBlueprintConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEnvironmentBlueprintConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEnvironmentBlueprintConfigurationsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListEnvironmentBlueprintConfigurationsInput) SetDomainIdentifier(v string) *ListEnvironmentBlueprintConfigurationsInput { - s.DomainIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEnvironmentBlueprintConfigurationsInput) SetMaxResults(v int64) *ListEnvironmentBlueprintConfigurationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentBlueprintConfigurationsInput) SetNextToken(v string) *ListEnvironmentBlueprintConfigurationsInput { - s.NextToken = &v - return s -} - -type ListEnvironmentBlueprintConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListEnvironmentBlueprintConfigurations action. - Items []*EnvironmentBlueprintConfigurationItem `locationName:"items" type:"list"` - - // When the number of blueprint configurations is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of configurations, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListEnvironmentBlueprintConfigurations to list the next set of configurations. - NextToken *string `locationName:"nextToken" min:"1" 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 ListEnvironmentBlueprintConfigurationsOutput) 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 ListEnvironmentBlueprintConfigurationsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListEnvironmentBlueprintConfigurationsOutput) SetItems(v []*EnvironmentBlueprintConfigurationItem) *ListEnvironmentBlueprintConfigurationsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentBlueprintConfigurationsOutput) SetNextToken(v string) *ListEnvironmentBlueprintConfigurationsOutput { - s.NextToken = &v - return s -} - -type ListEnvironmentBlueprintsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Specifies whether the environment blueprint is managed by Amazon DataZone. - Managed *bool `location:"querystring" locationName:"managed" type:"boolean"` - - // The maximum number of blueprints to return in a single call to ListEnvironmentBlueprints. - // When the number of blueprints to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to ListEnvironmentBlueprints to list the next set of blueprints. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The name of the Amazon DataZone environment. - Name *string `location:"querystring" locationName:"name" min:"1" type:"string"` - - // When the number of blueprints in the environment is greater than the default - // value for the MaxResults parameter, or if you explicitly specify a value - // for MaxResults that is less than the number of blueprints in the environment, - // the response includes a pagination token named NextToken. You can specify - // this NextToken value in a subsequent call to ListEnvironmentBlueprintsto - // list the next set of blueprints. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListEnvironmentBlueprintsInput) 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 ListEnvironmentBlueprintsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEnvironmentBlueprintsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEnvironmentBlueprintsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListEnvironmentBlueprintsInput) SetDomainIdentifier(v string) *ListEnvironmentBlueprintsInput { - s.DomainIdentifier = &v - return s -} - -// SetManaged sets the Managed field's value. -func (s *ListEnvironmentBlueprintsInput) SetManaged(v bool) *ListEnvironmentBlueprintsInput { - s.Managed = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEnvironmentBlueprintsInput) SetMaxResults(v int64) *ListEnvironmentBlueprintsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListEnvironmentBlueprintsInput) SetName(v string) *ListEnvironmentBlueprintsInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentBlueprintsInput) SetNextToken(v string) *ListEnvironmentBlueprintsInput { - s.NextToken = &v - return s -} - -type ListEnvironmentBlueprintsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListEnvironmentBlueprints action. - // - // Items is a required field - Items []*EnvironmentBlueprintSummary `locationName:"items" type:"list" required:"true"` - - // When the number of blueprints in the environment is greater than the default - // value for the MaxResults parameter, or if you explicitly specify a value - // for MaxResults that is less than the number of blueprints in the environment, - // the response includes a pagination token named NextToken. You can specify - // this NextToken value in a subsequent call to ListEnvironmentBlueprintsto - // list the next set of blueprints. - NextToken *string `locationName:"nextToken" min:"1" 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 ListEnvironmentBlueprintsOutput) 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 ListEnvironmentBlueprintsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListEnvironmentBlueprintsOutput) SetItems(v []*EnvironmentBlueprintSummary) *ListEnvironmentBlueprintsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentBlueprintsOutput) SetNextToken(v string) *ListEnvironmentBlueprintsOutput { - s.NextToken = &v - return s -} - -type ListEnvironmentProfilesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Web Services account where you want to list - // environment profiles. - AwsAccountId *string `location:"querystring" locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services region where you want to list environment profiles. - AwsAccountRegion *string `location:"querystring" locationName:"awsAccountRegion" type:"string"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the blueprint that was used to create the environment profiles - // that you want to list. - EnvironmentBlueprintIdentifier *string `location:"querystring" locationName:"environmentBlueprintIdentifier" type:"string"` - - // The maximum number of environment profiles to return in a single call to - // ListEnvironmentProfiles. When the number of environment profiles to be listed - // is greater than the value of MaxResults, the response contains a NextToken - // value that you can use in a subsequent call to ListEnvironmentProfiles to - // list the next set of environment profiles. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListEnvironmentProfilesInput's - // String and GoString methods. - Name *string `location:"querystring" locationName:"name" min:"1" type:"string" sensitive:"true"` - - // When the number of environment profiles is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of environment profiles, the response includes - // a pagination token named NextToken. You can specify this NextToken value - // in a subsequent call to ListEnvironmentProfiles to list the next set of environment - // profiles. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the Amazon DataZone project. - ProjectIdentifier *string `location:"querystring" locationName:"projectIdentifier" 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 ListEnvironmentProfilesInput) 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 ListEnvironmentProfilesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEnvironmentProfilesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEnvironmentProfilesInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *ListEnvironmentProfilesInput) SetAwsAccountId(v string) *ListEnvironmentProfilesInput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *ListEnvironmentProfilesInput) SetAwsAccountRegion(v string) *ListEnvironmentProfilesInput { - s.AwsAccountRegion = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListEnvironmentProfilesInput) SetDomainIdentifier(v string) *ListEnvironmentProfilesInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentBlueprintIdentifier sets the EnvironmentBlueprintIdentifier field's value. -func (s *ListEnvironmentProfilesInput) SetEnvironmentBlueprintIdentifier(v string) *ListEnvironmentProfilesInput { - s.EnvironmentBlueprintIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEnvironmentProfilesInput) SetMaxResults(v int64) *ListEnvironmentProfilesInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListEnvironmentProfilesInput) SetName(v string) *ListEnvironmentProfilesInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentProfilesInput) SetNextToken(v string) *ListEnvironmentProfilesInput { - s.NextToken = &v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *ListEnvironmentProfilesInput) SetProjectIdentifier(v string) *ListEnvironmentProfilesInput { - s.ProjectIdentifier = &v - return s -} - -type ListEnvironmentProfilesOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListEnvironmentProfiles action. - // - // Items is a required field - Items []*EnvironmentProfileSummary `locationName:"items" type:"list" required:"true"` - - // When the number of environment profiles is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of environment profiles, the response includes - // a pagination token named NextToken. You can specify this NextToken value - // in a subsequent call to ListEnvironmentProfiles to list the next set of environment - // profiles. - NextToken *string `locationName:"nextToken" min:"1" 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 ListEnvironmentProfilesOutput) 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 ListEnvironmentProfilesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListEnvironmentProfilesOutput) SetItems(v []*EnvironmentProfileSummary) *ListEnvironmentProfilesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentProfilesOutput) SetNextToken(v string) *ListEnvironmentProfilesOutput { - s.NextToken = &v - return s -} - -type ListEnvironmentsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Web Services account where you want to list - // environments. - AwsAccountId *string `location:"querystring" locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services region where you want to list environments. - AwsAccountRegion *string `location:"querystring" locationName:"awsAccountRegion" type:"string"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the Amazon DataZone blueprint. - EnvironmentBlueprintIdentifier *string `location:"querystring" locationName:"environmentBlueprintIdentifier" type:"string"` - - // The identifier of the environment profile. - EnvironmentProfileIdentifier *string `location:"querystring" locationName:"environmentProfileIdentifier" type:"string"` - - // The maximum number of environments to return in a single call to ListEnvironments. - // When the number of environments to be listed is greater than the value of - // MaxResults, the response contains a NextToken value that you can use in a - // subsequent call to ListEnvironments to list the next set of environments. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - Name *string `location:"querystring" locationName:"name" type:"string"` - - // When the number of environments is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of environments, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListEnvironments to list the next set of environments. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the Amazon DataZone project. - // - // ProjectIdentifier is a required field - ProjectIdentifier *string `location:"querystring" locationName:"projectIdentifier" type:"string" required:"true"` - - // The provider of the environment. - Provider *string `location:"querystring" locationName:"provider" type:"string"` - - // The status of the environments that you want to list. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"EnvironmentStatus"` -} - -// 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 ListEnvironmentsInput) 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 ListEnvironmentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEnvironmentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEnvironmentsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *ListEnvironmentsInput) SetAwsAccountId(v string) *ListEnvironmentsInput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *ListEnvironmentsInput) SetAwsAccountRegion(v string) *ListEnvironmentsInput { - s.AwsAccountRegion = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListEnvironmentsInput) SetDomainIdentifier(v string) *ListEnvironmentsInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentBlueprintIdentifier sets the EnvironmentBlueprintIdentifier field's value. -func (s *ListEnvironmentsInput) SetEnvironmentBlueprintIdentifier(v string) *ListEnvironmentsInput { - s.EnvironmentBlueprintIdentifier = &v - return s -} - -// SetEnvironmentProfileIdentifier sets the EnvironmentProfileIdentifier field's value. -func (s *ListEnvironmentsInput) SetEnvironmentProfileIdentifier(v string) *ListEnvironmentsInput { - s.EnvironmentProfileIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEnvironmentsInput) SetMaxResults(v int64) *ListEnvironmentsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListEnvironmentsInput) SetName(v string) *ListEnvironmentsInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentsInput) SetNextToken(v string) *ListEnvironmentsInput { - s.NextToken = &v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *ListEnvironmentsInput) SetProjectIdentifier(v string) *ListEnvironmentsInput { - s.ProjectIdentifier = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *ListEnvironmentsInput) SetProvider(v string) *ListEnvironmentsInput { - s.Provider = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListEnvironmentsInput) SetStatus(v string) *ListEnvironmentsInput { - s.Status = &v - return s -} - -type ListEnvironmentsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListEnvironments action. - // - // Items is a required field - Items []*EnvironmentSummary `locationName:"items" type:"list" required:"true"` - - // When the number of environments is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of environments, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListEnvironments to list the next set of environments. - NextToken *string `locationName:"nextToken" min:"1" 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 ListEnvironmentsOutput) 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 ListEnvironmentsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListEnvironmentsOutput) SetItems(v []*EnvironmentSummary) *ListEnvironmentsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentsOutput) SetNextToken(v string) *ListEnvironmentsOutput { - s.NextToken = &v - return s -} - -type ListNotificationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The time after which you want to list notifications. - AfterTimestamp *time.Time `location:"querystring" locationName:"afterTimestamp" type:"timestamp"` - - // The time before which you want to list notifications. - BeforeTimestamp *time.Time `location:"querystring" locationName:"beforeTimestamp" type:"timestamp"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The maximum number of notifications to return in a single call to ListNotifications. - // When the number of notifications to be listed is greater than the value of - // MaxResults, the response contains a NextToken value that you can use in a - // subsequent call to ListNotifications to list the next set of notifications. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of notifications is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of notifications, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListNotifications to list the next set of notifications. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The subjects of notifications. - Subjects []*string `location:"querystring" locationName:"subjects" type:"list"` - - // The task status of notifications. - TaskStatus *string `location:"querystring" locationName:"taskStatus" type:"string" enum:"TaskStatus"` - - // The type of notifications. - // - // Type is a required field - Type *string `location:"querystring" locationName:"type" type:"string" required:"true" enum:"NotificationType"` -} - -// 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 ListNotificationsInput) 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 ListNotificationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListNotificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListNotificationsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAfterTimestamp sets the AfterTimestamp field's value. -func (s *ListNotificationsInput) SetAfterTimestamp(v time.Time) *ListNotificationsInput { - s.AfterTimestamp = &v - return s -} - -// SetBeforeTimestamp sets the BeforeTimestamp field's value. -func (s *ListNotificationsInput) SetBeforeTimestamp(v time.Time) *ListNotificationsInput { - s.BeforeTimestamp = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListNotificationsInput) SetDomainIdentifier(v string) *ListNotificationsInput { - s.DomainIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListNotificationsInput) SetMaxResults(v int64) *ListNotificationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListNotificationsInput) SetNextToken(v string) *ListNotificationsInput { - s.NextToken = &v - return s -} - -// SetSubjects sets the Subjects field's value. -func (s *ListNotificationsInput) SetSubjects(v []*string) *ListNotificationsInput { - s.Subjects = v - return s -} - -// SetTaskStatus sets the TaskStatus field's value. -func (s *ListNotificationsInput) SetTaskStatus(v string) *ListNotificationsInput { - s.TaskStatus = &v - return s -} - -// SetType sets the Type field's value. -func (s *ListNotificationsInput) SetType(v string) *ListNotificationsInput { - s.Type = &v - return s -} - -type ListNotificationsOutput struct { - _ struct{} `type:"structure"` - - // When the number of notifications is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of notifications, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListNotifications to list the next set of notifications. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The results of the ListNotifications action. - Notifications []*NotificationOutput_ `locationName:"notifications" type:"list"` -} - -// 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 ListNotificationsOutput) 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 ListNotificationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListNotificationsOutput) SetNextToken(v string) *ListNotificationsOutput { - s.NextToken = &v - return s -} - -// SetNotifications sets the Notifications field's value. -func (s *ListNotificationsOutput) SetNotifications(v []*NotificationOutput_) *ListNotificationsOutput { - s.Notifications = v - return s -} - -type ListProjectMembershipsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain in which you want to list project - // memberships. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The maximum number of memberships to return in a single call to ListProjectMemberships. - // When the number of memberships to be listed is greater than the value of - // MaxResults, the response contains a NextToken value that you can use in a - // subsequent call to ListProjectMemberships to list the next set of memberships. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of memberships is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of memberships, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListProjectMemberships to list the next set of memberships. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the project whose memberships you want to list. - // - // ProjectIdentifier is a required field - ProjectIdentifier *string `location:"uri" locationName:"projectIdentifier" type:"string" required:"true"` - - // The method by which you want to sort the project memberships. - SortBy *string `location:"querystring" locationName:"sortBy" type:"string" enum:"SortFieldProject"` - - // The sort order of the project memberships. - SortOrder *string `location:"querystring" locationName:"sortOrder" type:"string" enum:"SortOrder"` -} - -// 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 ListProjectMembershipsInput) 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 ListProjectMembershipsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProjectMembershipsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProjectMembershipsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ProjectIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectIdentifier")) - } - if s.ProjectIdentifier != nil && len(*s.ProjectIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProjectIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListProjectMembershipsInput) SetDomainIdentifier(v string) *ListProjectMembershipsInput { - s.DomainIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListProjectMembershipsInput) SetMaxResults(v int64) *ListProjectMembershipsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProjectMembershipsInput) SetNextToken(v string) *ListProjectMembershipsInput { - s.NextToken = &v - return s -} - -// SetProjectIdentifier sets the ProjectIdentifier field's value. -func (s *ListProjectMembershipsInput) SetProjectIdentifier(v string) *ListProjectMembershipsInput { - s.ProjectIdentifier = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListProjectMembershipsInput) SetSortBy(v string) *ListProjectMembershipsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListProjectMembershipsInput) SetSortOrder(v string) *ListProjectMembershipsInput { - s.SortOrder = &v - return s -} - -type ListProjectMembershipsOutput struct { - _ struct{} `type:"structure"` - - // The members of the project. - // - // Members is a required field - Members []*ProjectMember `locationName:"members" type:"list" required:"true"` - - // When the number of memberships is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of memberships, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListProjectMemberships to list the next set of memberships. - NextToken *string `locationName:"nextToken" min:"1" 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 ListProjectMembershipsOutput) 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 ListProjectMembershipsOutput) GoString() string { - return s.String() -} - -// SetMembers sets the Members field's value. -func (s *ListProjectMembershipsOutput) SetMembers(v []*ProjectMember) *ListProjectMembershipsOutput { - s.Members = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProjectMembershipsOutput) SetNextToken(v string) *ListProjectMembershipsOutput { - s.NextToken = &v - return s -} - -type ListProjectsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of a group. - GroupIdentifier *string `location:"querystring" locationName:"groupIdentifier" type:"string"` - - // The maximum number of projects to return in a single call to ListProjects. - // When the number of projects to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to ListProjects to list the next set of projects. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListProjectsInput's - // String and GoString methods. - Name *string `location:"querystring" locationName:"name" min:"1" type:"string" sensitive:"true"` - - // When the number of projects is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of projects, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to ListProjects - // to list the next set of projects. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the Amazon DataZone user. - UserIdentifier *string `location:"querystring" locationName:"userIdentifier" 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 ListProjectsInput) 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 ListProjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProjectsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListProjectsInput) SetDomainIdentifier(v string) *ListProjectsInput { - s.DomainIdentifier = &v - return s -} - -// SetGroupIdentifier sets the GroupIdentifier field's value. -func (s *ListProjectsInput) SetGroupIdentifier(v string) *ListProjectsInput { - s.GroupIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListProjectsInput) SetMaxResults(v int64) *ListProjectsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListProjectsInput) SetName(v string) *ListProjectsInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProjectsInput) SetNextToken(v string) *ListProjectsInput { - s.NextToken = &v - return s -} - -// SetUserIdentifier sets the UserIdentifier field's value. -func (s *ListProjectsInput) SetUserIdentifier(v string) *ListProjectsInput { - s.UserIdentifier = &v - return s -} - -type ListProjectsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListProjects action. - Items []*ProjectSummary `locationName:"items" type:"list"` - - // When the number of projects is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of projects, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to ListProjects - // to list the next set of projects. - NextToken *string `locationName:"nextToken" min:"1" 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 ListProjectsOutput) 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 ListProjectsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListProjectsOutput) SetItems(v []*ProjectSummary) *ListProjectsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProjectsOutput) SetNextToken(v string) *ListProjectsOutput { - s.NextToken = &v - return s -} - -type ListSubscriptionGrantsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the Amazon DataZone environment. - EnvironmentId *string `location:"querystring" locationName:"environmentId" type:"string"` - - // The maximum number of subscription grants to return in a single call to ListSubscriptionGrants. - // When the number of subscription grants to be listed is greater than the value - // of MaxResults, the response contains a NextToken value that you can use in - // a subsequent call to ListSubscriptionGrants to list the next set of subscription - // grants. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of subscription grants is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of subscription grants, the response includes - // a pagination token named NextToken. You can specify this NextToken value - // in a subsequent call to ListSubscriptionGrants to list the next set of subscription - // grants. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // Specifies the way of sorting the results of this action. - SortBy *string `location:"querystring" locationName:"sortBy" type:"string" enum:"SortKey"` - - // Specifies the sort order of this action. - SortOrder *string `location:"querystring" locationName:"sortOrder" type:"string" enum:"SortOrder"` - - // The identifier of the subscribed listing. - SubscribedListingId *string `location:"querystring" locationName:"subscribedListingId" type:"string"` - - // The identifier of the subscription. - SubscriptionId *string `location:"querystring" locationName:"subscriptionId" type:"string"` - - // The identifier of the subscription target. - SubscriptionTargetId *string `location:"querystring" locationName:"subscriptionTargetId" 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 ListSubscriptionGrantsInput) 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 ListSubscriptionGrantsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSubscriptionGrantsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionGrantsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListSubscriptionGrantsInput) SetDomainIdentifier(v string) *ListSubscriptionGrantsInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *ListSubscriptionGrantsInput) SetEnvironmentId(v string) *ListSubscriptionGrantsInput { - s.EnvironmentId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSubscriptionGrantsInput) SetMaxResults(v int64) *ListSubscriptionGrantsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionGrantsInput) SetNextToken(v string) *ListSubscriptionGrantsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListSubscriptionGrantsInput) SetSortBy(v string) *ListSubscriptionGrantsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListSubscriptionGrantsInput) SetSortOrder(v string) *ListSubscriptionGrantsInput { - s.SortOrder = &v - return s -} - -// SetSubscribedListingId sets the SubscribedListingId field's value. -func (s *ListSubscriptionGrantsInput) SetSubscribedListingId(v string) *ListSubscriptionGrantsInput { - s.SubscribedListingId = &v - return s -} - -// SetSubscriptionId sets the SubscriptionId field's value. -func (s *ListSubscriptionGrantsInput) SetSubscriptionId(v string) *ListSubscriptionGrantsInput { - s.SubscriptionId = &v - return s -} - -// SetSubscriptionTargetId sets the SubscriptionTargetId field's value. -func (s *ListSubscriptionGrantsInput) SetSubscriptionTargetId(v string) *ListSubscriptionGrantsInput { - s.SubscriptionTargetId = &v - return s -} - -type ListSubscriptionGrantsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListSubscriptionGrants action. - // - // Items is a required field - Items []*SubscriptionGrantSummary `locationName:"items" type:"list" required:"true"` - - // When the number of subscription grants is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of subscription grants, the response includes - // a pagination token named NextToken. You can specify this NextToken value - // in a subsequent call to ListSubscriptionGrants to list the next set of subscription - // grants. - NextToken *string `locationName:"nextToken" min:"1" 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 ListSubscriptionGrantsOutput) 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 ListSubscriptionGrantsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListSubscriptionGrantsOutput) SetItems(v []*SubscriptionGrantSummary) *ListSubscriptionGrantsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionGrantsOutput) SetNextToken(v string) *ListSubscriptionGrantsOutput { - s.NextToken = &v - return s -} - -type ListSubscriptionRequestsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the subscription request approver's project. - ApproverProjectId *string `location:"querystring" locationName:"approverProjectId" type:"string"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The maximum number of subscription requests to return in a single call to - // ListSubscriptionRequests. When the number of subscription requests to be - // listed is greater than the value of MaxResults, the response contains a NextToken - // value that you can use in a subsequent call to ListSubscriptionRequests to - // list the next set of subscription requests. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of subscription requests is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of subscription requests, the response includes - // a pagination token named NextToken. You can specify this NextToken value - // in a subsequent call to ListSubscriptionRequests to list the next set of - // subscription requests. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the project for the subscription requests. - OwningProjectId *string `location:"querystring" locationName:"owningProjectId" type:"string"` - - // Specifies the way to sort the results of this action. - SortBy *string `location:"querystring" locationName:"sortBy" type:"string" enum:"SortKey"` - - // Specifies the sort order for the results of this action. - SortOrder *string `location:"querystring" locationName:"sortOrder" type:"string" enum:"SortOrder"` - - // Specifies the status of the subscription requests. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"SubscriptionRequestStatus"` - - // The identifier of the subscribed listing. - SubscribedListingId *string `location:"querystring" locationName:"subscribedListingId" 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 ListSubscriptionRequestsInput) 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 ListSubscriptionRequestsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSubscriptionRequestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionRequestsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApproverProjectId sets the ApproverProjectId field's value. -func (s *ListSubscriptionRequestsInput) SetApproverProjectId(v string) *ListSubscriptionRequestsInput { - s.ApproverProjectId = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListSubscriptionRequestsInput) SetDomainIdentifier(v string) *ListSubscriptionRequestsInput { - s.DomainIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSubscriptionRequestsInput) SetMaxResults(v int64) *ListSubscriptionRequestsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionRequestsInput) SetNextToken(v string) *ListSubscriptionRequestsInput { - s.NextToken = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *ListSubscriptionRequestsInput) SetOwningProjectId(v string) *ListSubscriptionRequestsInput { - s.OwningProjectId = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListSubscriptionRequestsInput) SetSortBy(v string) *ListSubscriptionRequestsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListSubscriptionRequestsInput) SetSortOrder(v string) *ListSubscriptionRequestsInput { - s.SortOrder = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListSubscriptionRequestsInput) SetStatus(v string) *ListSubscriptionRequestsInput { - s.Status = &v - return s -} - -// SetSubscribedListingId sets the SubscribedListingId field's value. -func (s *ListSubscriptionRequestsInput) SetSubscribedListingId(v string) *ListSubscriptionRequestsInput { - s.SubscribedListingId = &v - return s -} - -type ListSubscriptionRequestsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListSubscriptionRequests action. - // - // Items is a required field - Items []*SubscriptionRequestSummary `locationName:"items" type:"list" required:"true"` - - // When the number of subscription requests is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of subscription requests, the response includes - // a pagination token named NextToken. You can specify this NextToken value - // in a subsequent call to ListSubscriptionRequests to list the next set of - // subscription requests. - NextToken *string `locationName:"nextToken" min:"1" 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 ListSubscriptionRequestsOutput) 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 ListSubscriptionRequestsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListSubscriptionRequestsOutput) SetItems(v []*SubscriptionRequestSummary) *ListSubscriptionRequestsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionRequestsOutput) SetNextToken(v string) *ListSubscriptionRequestsOutput { - s.NextToken = &v - return s -} - -type ListSubscriptionTargetsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon DataZone domain where you want to list subscription - // targets. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the environment where you want to list subscription targets. - // - // EnvironmentIdentifier is a required field - EnvironmentIdentifier *string `location:"uri" locationName:"environmentIdentifier" type:"string" required:"true"` - - // The maximum number of subscription targets to return in a single call to - // ListSubscriptionTargets. When the number of subscription targets to be listed - // is greater than the value of MaxResults, the response contains a NextToken - // value that you can use in a subsequent call to ListSubscriptionTargets to - // list the next set of subscription targets. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of subscription targets is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of subscription targets, the response includes - // a pagination token named NextToken. You can specify this NextToken value - // in a subsequent call to ListSubscriptionTargets to list the next set of subscription - // targets. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // Specifies the way in which the results of this action are to be sorted. - SortBy *string `location:"querystring" locationName:"sortBy" type:"string" enum:"SortKey"` - - // Specifies the sort order for the results of this action. - SortOrder *string `location:"querystring" locationName:"sortOrder" type:"string" enum:"SortOrder"` -} - -// 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 ListSubscriptionTargetsInput) 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 ListSubscriptionTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSubscriptionTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionTargetsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentIdentifier")) - } - if s.EnvironmentIdentifier != nil && len(*s.EnvironmentIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListSubscriptionTargetsInput) SetDomainIdentifier(v string) *ListSubscriptionTargetsInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentIdentifier sets the EnvironmentIdentifier field's value. -func (s *ListSubscriptionTargetsInput) SetEnvironmentIdentifier(v string) *ListSubscriptionTargetsInput { - s.EnvironmentIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSubscriptionTargetsInput) SetMaxResults(v int64) *ListSubscriptionTargetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionTargetsInput) SetNextToken(v string) *ListSubscriptionTargetsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListSubscriptionTargetsInput) SetSortBy(v string) *ListSubscriptionTargetsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListSubscriptionTargetsInput) SetSortOrder(v string) *ListSubscriptionTargetsInput { - s.SortOrder = &v - return s -} - -type ListSubscriptionTargetsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListSubscriptionTargets action. - // - // Items is a required field - Items []*SubscriptionTargetSummary `locationName:"items" type:"list" required:"true"` - - // When the number of subscription targets is greater than the default value - // for the MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of subscription targets, the response includes - // a pagination token named NextToken. You can specify this NextToken value - // in a subsequent call to ListSubscriptionTargets to list the next set of subscription - // targets. - NextToken *string `locationName:"nextToken" min:"1" 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 ListSubscriptionTargetsOutput) 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 ListSubscriptionTargetsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListSubscriptionTargetsOutput) SetItems(v []*SubscriptionTargetSummary) *ListSubscriptionTargetsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionTargetsOutput) SetNextToken(v string) *ListSubscriptionTargetsOutput { - s.NextToken = &v - return s -} - -type ListSubscriptionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the project for the subscription's approver. - ApproverProjectId *string `location:"querystring" locationName:"approverProjectId" type:"string"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The maximum number of subscriptions to return in a single call to ListSubscriptions. - // When the number of subscriptions to be listed is greater than the value of - // MaxResults, the response contains a NextToken value that you can use in a - // subsequent call to ListSubscriptions to list the next set of Subscriptions. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // When the number of subscriptions is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of subscriptions, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListSubscriptions to list the next set of subscriptions. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the owning project. - OwningProjectId *string `location:"querystring" locationName:"owningProjectId" type:"string"` - - // Specifies the way in which the results of this action are to be sorted. - SortBy *string `location:"querystring" locationName:"sortBy" type:"string" enum:"SortKey"` - - // Specifies the sort order for the results of this action. - SortOrder *string `location:"querystring" locationName:"sortOrder" type:"string" enum:"SortOrder"` - - // The status of the subscriptions that you want to list. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"SubscriptionStatus"` - - // The identifier of the subscribed listing for the subscriptions that you want - // to list. - SubscribedListingId *string `location:"querystring" locationName:"subscribedListingId" type:"string"` - - // The identifier of the subscription request for the subscriptions that you - // want to list. - SubscriptionRequestIdentifier *string `location:"querystring" locationName:"subscriptionRequestIdentifier" 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 ListSubscriptionsInput) 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 ListSubscriptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSubscriptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApproverProjectId sets the ApproverProjectId field's value. -func (s *ListSubscriptionsInput) SetApproverProjectId(v string) *ListSubscriptionsInput { - s.ApproverProjectId = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *ListSubscriptionsInput) SetDomainIdentifier(v string) *ListSubscriptionsInput { - s.DomainIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSubscriptionsInput) SetMaxResults(v int64) *ListSubscriptionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionsInput) SetNextToken(v string) *ListSubscriptionsInput { - s.NextToken = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *ListSubscriptionsInput) SetOwningProjectId(v string) *ListSubscriptionsInput { - s.OwningProjectId = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListSubscriptionsInput) SetSortBy(v string) *ListSubscriptionsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListSubscriptionsInput) SetSortOrder(v string) *ListSubscriptionsInput { - s.SortOrder = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListSubscriptionsInput) SetStatus(v string) *ListSubscriptionsInput { - s.Status = &v - return s -} - -// SetSubscribedListingId sets the SubscribedListingId field's value. -func (s *ListSubscriptionsInput) SetSubscribedListingId(v string) *ListSubscriptionsInput { - s.SubscribedListingId = &v - return s -} - -// SetSubscriptionRequestIdentifier sets the SubscriptionRequestIdentifier field's value. -func (s *ListSubscriptionsInput) SetSubscriptionRequestIdentifier(v string) *ListSubscriptionsInput { - s.SubscriptionRequestIdentifier = &v - return s -} - -type ListSubscriptionsOutput struct { - _ struct{} `type:"structure"` - - // The results of the ListSubscriptions action. - // - // Items is a required field - Items []*SubscriptionSummary `locationName:"items" type:"list" required:"true"` - - // When the number of subscriptions is greater than the default value for the - // MaxResults parameter, or if you explicitly specify a value for MaxResults - // that is less than the number of subscriptions, the response includes a pagination - // token named NextToken. You can specify this NextToken value in a subsequent - // call to ListSubscriptions to list the next set of subscriptions. - NextToken *string `locationName:"nextToken" min:"1" 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 ListSubscriptionsOutput) 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 ListSubscriptionsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListSubscriptionsOutput) SetItems(v []*SubscriptionSummary) *ListSubscriptionsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscriptionsOutput) SetNextToken(v string) *ListSubscriptionsOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource whose tags you want to list. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags of the specified resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// The details of a listing (aka asset published in a Amazon DataZone catalog). -type ListingItem struct { - _ struct{} `type:"structure"` - - // An asset published in an Amazon DataZone catalog. - AssetListing *AssetListing `locationName:"assetListing" 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 ListingItem) 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 ListingItem) GoString() string { - return s.String() -} - -// SetAssetListing sets the AssetListing field's value. -func (s *ListingItem) SetAssetListing(v *AssetListing) *ListingItem { - s.AssetListing = v - return s -} - -// A revision of an asset published in a Amazon DataZone catalog. -type ListingRevision struct { - _ struct{} `type:"structure"` - - // An identifier of a revision of an asset published in a Amazon DataZone catalog. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The details of a revision of an asset published in a Amazon DataZone catalog. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" 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 ListingRevision) 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 ListingRevision) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *ListingRevision) SetId(v string) *ListingRevision { - s.Id = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *ListingRevision) SetRevision(v string) *ListingRevision { - s.Revision = &v - return s -} - -// A revision to be made to an asset published in a Amazon DataZone catalog. -type ListingRevisionInput_ struct { - _ struct{} `type:"structure"` - - // An identifier of revision to be made to an asset published in a Amazon DataZone - // catalog. - // - // Identifier is a required field - Identifier *string `locationName:"identifier" type:"string" required:"true"` - - // The details of a revision to be made to an asset published in a Amazon DataZone - // catalog. - // - // Revision is a required field - Revision *string `locationName:"revision" min:"1" 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 ListingRevisionInput_) 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 ListingRevisionInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListingRevisionInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListingRevisionInput_"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Revision == nil { - invalidParams.Add(request.NewErrParamRequired("Revision")) - } - if s.Revision != nil && len(*s.Revision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Revision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *ListingRevisionInput_) SetIdentifier(v string) *ListingRevisionInput_ { - s.Identifier = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *ListingRevisionInput_) SetRevision(v string) *ListingRevisionInput_ { - s.Revision = &v - return s -} - -// The details about a project member. -type Member struct { - _ struct{} `type:"structure"` - - // The ID of the group of a project member. - GroupIdentifier *string `locationName:"groupIdentifier" type:"string"` - - // The user ID of a project member. - UserIdentifier *string `locationName:"userIdentifier" 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 Member) 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 Member) GoString() string { - return s.String() -} - -// SetGroupIdentifier sets the GroupIdentifier field's value. -func (s *Member) SetGroupIdentifier(v string) *Member { - s.GroupIdentifier = &v - return s -} - -// SetUserIdentifier sets the UserIdentifier field's value. -func (s *Member) SetUserIdentifier(v string) *Member { - s.UserIdentifier = &v - return s -} - -// The details about a project member. -type MemberDetails struct { - _ struct{} `type:"structure"` - - // The group details of a project member. - Group *GroupDetails `locationName:"group" type:"structure"` - - // The user details of a project member. - User *UserDetails `locationName:"user" 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 MemberDetails) 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 MemberDetails) GoString() string { - return s.String() -} - -// SetGroup sets the Group field's value. -func (s *MemberDetails) SetGroup(v *GroupDetails) *MemberDetails { - s.Group = v - return s -} - -// SetUser sets the User field's value. -func (s *MemberDetails) SetUser(v *UserDetails) *MemberDetails { - s.User = v - return s -} - -type Model struct { - _ struct{} `type:"structure" sensitive:"true"` - - Smithy *string `locationName:"smithy" min:"1" 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 Model) 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 Model) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Model) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Model"} - if s.Smithy != nil && len(*s.Smithy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Smithy", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSmithy sets the Smithy field's value. -func (s *Model) SetSmithy(v string) *Model { - s.Smithy = &v - return s -} - -// The details of a notification generated in Amazon DataZone. -type NotificationOutput_ struct { - _ struct{} `type:"structure"` - - // The action link included in the notification. - // - // ActionLink is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by NotificationOutput_'s - // String and GoString methods. - // - // ActionLink is a required field - ActionLink *string `locationName:"actionLink" type:"string" required:"true" sensitive:"true"` - - // The timestamp of when a notification was created. - // - // CreationTimestamp is a required field - CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp" required:"true"` - - // The identifier of a Amazon DataZone domain in which the notification exists. - // - // DomainIdentifier is a required field - DomainIdentifier *string `locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the notification. - // - // Identifier is a required field - Identifier *string `locationName:"identifier" type:"string" required:"true"` - - // The timestamp of when the notification was last updated. - // - // LastUpdatedTimestamp is a required field - LastUpdatedTimestamp *time.Time `locationName:"lastUpdatedTimestamp" type:"timestamp" required:"true"` - - // The message included in the notification. - // - // Message is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by NotificationOutput_'s - // String and GoString methods. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true" sensitive:"true"` - - // The metadata included in the notification. - Metadata map[string]*string `locationName:"metadata" type:"map"` - - // The status included in the notification. - Status *string `locationName:"status" type:"string" enum:"TaskStatus"` - - // The title of the notification. - // - // Title is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by NotificationOutput_'s - // String and GoString methods. - // - // Title is a required field - Title *string `locationName:"title" type:"string" required:"true" sensitive:"true"` - - // The topic of the notification. - // - // Topic is a required field - Topic *Topic `locationName:"topic" type:"structure" required:"true"` - - // The type of the notification. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"NotificationType"` -} - -// 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 NotificationOutput_) 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 NotificationOutput_) GoString() string { - return s.String() -} - -// SetActionLink sets the ActionLink field's value. -func (s *NotificationOutput_) SetActionLink(v string) *NotificationOutput_ { - s.ActionLink = &v - return s -} - -// SetCreationTimestamp sets the CreationTimestamp field's value. -func (s *NotificationOutput_) SetCreationTimestamp(v time.Time) *NotificationOutput_ { - s.CreationTimestamp = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *NotificationOutput_) SetDomainIdentifier(v string) *NotificationOutput_ { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *NotificationOutput_) SetIdentifier(v string) *NotificationOutput_ { - s.Identifier = &v - return s -} - -// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. -func (s *NotificationOutput_) SetLastUpdatedTimestamp(v time.Time) *NotificationOutput_ { - s.LastUpdatedTimestamp = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *NotificationOutput_) SetMessage(v string) *NotificationOutput_ { - s.Message = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *NotificationOutput_) SetMetadata(v map[string]*string) *NotificationOutput_ { - s.Metadata = v - return s -} - -// SetStatus sets the Status field's value. -func (s *NotificationOutput_) SetStatus(v string) *NotificationOutput_ { - s.Status = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *NotificationOutput_) SetTitle(v string) *NotificationOutput_ { - s.Title = &v - return s -} - -// SetTopic sets the Topic field's value. -func (s *NotificationOutput_) SetTopic(v *Topic) *NotificationOutput_ { - s.Topic = v - return s -} - -// SetType sets the Type field's value. -func (s *NotificationOutput_) SetType(v string) *NotificationOutput_ { - s.Type = &v - return s -} - -// The details of the resource mentioned in a notification. -type NotificationResource struct { - _ struct{} `type:"structure"` - - // The ID of the resource mentioned in a notification. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of the resource mentioned in a notification. - Name *string `locationName:"name" type:"string"` - - // The type of the resource mentioned in a notification. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"NotificationResourceType"` -} - -// 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 NotificationResource) 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 NotificationResource) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *NotificationResource) SetId(v string) *NotificationResource { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *NotificationResource) SetName(v string) *NotificationResource { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *NotificationResource) SetType(v string) *NotificationResource { - s.Type = &v - return s -} - -// The configuration of the prediction. -type PredictionConfiguration struct { - _ struct{} `type:"structure"` - - // The business name generation mechanism. - BusinessNameGeneration *BusinessNameGenerationConfiguration `locationName:"businessNameGeneration" 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 PredictionConfiguration) 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 PredictionConfiguration) GoString() string { - return s.String() -} - -// SetBusinessNameGeneration sets the BusinessNameGeneration field's value. -func (s *PredictionConfiguration) SetBusinessNameGeneration(v *BusinessNameGenerationConfiguration) *PredictionConfiguration { - s.BusinessNameGeneration = v - return s -} - -// The details of a project member. -type ProjectMember struct { - _ struct{} `type:"structure"` - - // The designated role of a project member. - // - // Designation is a required field - Designation *string `locationName:"designation" type:"string" required:"true" enum:"UserDesignation"` - - // The membership details of a project member. - // - // MemberDetails is a required field - MemberDetails *MemberDetails `locationName:"memberDetails" type:"structure" 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 ProjectMember) 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 ProjectMember) GoString() string { - return s.String() -} - -// SetDesignation sets the Designation field's value. -func (s *ProjectMember) SetDesignation(v string) *ProjectMember { - s.Designation = &v - return s -} - -// SetMemberDetails sets the MemberDetails field's value. -func (s *ProjectMember) SetMemberDetails(v *MemberDetails) *ProjectMember { - s.MemberDetails = v - return s -} - -// The details of a Amazon DataZone project. -type ProjectSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when a project was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the project. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description of a project. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ProjectSummary's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of a Amazon DataZone domain where the project exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of a project. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of a project. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ProjectSummary's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The timestamp of when the project was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 ProjectSummary) 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 ProjectSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ProjectSummary) SetCreatedAt(v time.Time) *ProjectSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *ProjectSummary) SetCreatedBy(v string) *ProjectSummary { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ProjectSummary) SetDescription(v string) *ProjectSummary { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *ProjectSummary) SetDomainId(v string) *ProjectSummary { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *ProjectSummary) SetId(v string) *ProjectSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *ProjectSummary) SetName(v string) *ProjectSummary { - s.Name = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ProjectSummary) SetUpdatedAt(v time.Time) *ProjectSummary { - s.UpdatedAt = &v - return s -} - -// The provisioning properties of an environment blueprint. -type ProvisioningProperties struct { - _ struct{} `type:"structure"` - - // The cloud formation properties included as part of the provisioning properties - // of an environment blueprint. - CloudFormation *CloudFormationProperties `locationName:"cloudFormation" 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 ProvisioningProperties) 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 ProvisioningProperties) GoString() string { - return s.String() -} - -// SetCloudFormation sets the CloudFormation field's value. -func (s *ProvisioningProperties) SetCloudFormation(v *CloudFormationProperties) *ProvisioningProperties { - s.CloudFormation = v - return s -} - -type PutEnvironmentBlueprintConfigurationInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Specifies the enabled Amazon Web Services Regions. - // - // EnabledRegions is a required field - EnabledRegions []*string `locationName:"enabledRegions" type:"list" required:"true"` - - // The identifier of the environment blueprint. - // - // EnvironmentBlueprintIdentifier is a required field - EnvironmentBlueprintIdentifier *string `location:"uri" locationName:"environmentBlueprintIdentifier" type:"string" required:"true"` - - // The ARN of the manage access role. - ManageAccessRoleArn *string `locationName:"manageAccessRoleArn" type:"string"` - - // The ARN of the provisioning role. - ProvisioningRoleArn *string `locationName:"provisioningRoleArn" type:"string"` - - // The regional parameters in the environment blueprint. - RegionalParameters map[string]map[string]*string `locationName:"regionalParameters" type:"map"` -} - -// 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 PutEnvironmentBlueprintConfigurationInput) 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 PutEnvironmentBlueprintConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutEnvironmentBlueprintConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutEnvironmentBlueprintConfigurationInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnabledRegions == nil { - invalidParams.Add(request.NewErrParamRequired("EnabledRegions")) - } - if s.EnvironmentBlueprintIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentBlueprintIdentifier")) - } - if s.EnvironmentBlueprintIdentifier != nil && len(*s.EnvironmentBlueprintIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentBlueprintIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *PutEnvironmentBlueprintConfigurationInput) SetDomainIdentifier(v string) *PutEnvironmentBlueprintConfigurationInput { - s.DomainIdentifier = &v - return s -} - -// SetEnabledRegions sets the EnabledRegions field's value. -func (s *PutEnvironmentBlueprintConfigurationInput) SetEnabledRegions(v []*string) *PutEnvironmentBlueprintConfigurationInput { - s.EnabledRegions = v - return s -} - -// SetEnvironmentBlueprintIdentifier sets the EnvironmentBlueprintIdentifier field's value. -func (s *PutEnvironmentBlueprintConfigurationInput) SetEnvironmentBlueprintIdentifier(v string) *PutEnvironmentBlueprintConfigurationInput { - s.EnvironmentBlueprintIdentifier = &v - return s -} - -// SetManageAccessRoleArn sets the ManageAccessRoleArn field's value. -func (s *PutEnvironmentBlueprintConfigurationInput) SetManageAccessRoleArn(v string) *PutEnvironmentBlueprintConfigurationInput { - s.ManageAccessRoleArn = &v - return s -} - -// SetProvisioningRoleArn sets the ProvisioningRoleArn field's value. -func (s *PutEnvironmentBlueprintConfigurationInput) SetProvisioningRoleArn(v string) *PutEnvironmentBlueprintConfigurationInput { - s.ProvisioningRoleArn = &v - return s -} - -// SetRegionalParameters sets the RegionalParameters field's value. -func (s *PutEnvironmentBlueprintConfigurationInput) SetRegionalParameters(v map[string]map[string]*string) *PutEnvironmentBlueprintConfigurationInput { - s.RegionalParameters = v - return s -} - -type PutEnvironmentBlueprintConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the environment blueprint was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The identifier of the Amazon DataZone domain. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // Specifies the enabled Amazon Web Services Regions. - EnabledRegions []*string `locationName:"enabledRegions" type:"list"` - - // The identifier of the environment blueprint. - // - // EnvironmentBlueprintId is a required field - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string" required:"true"` - - // The ARN of the manage access role. - ManageAccessRoleArn *string `locationName:"manageAccessRoleArn" type:"string"` - - // The ARN of the provisioning role. - ProvisioningRoleArn *string `locationName:"provisioningRoleArn" type:"string"` - - // The regional parameters in the environment blueprint. - RegionalParameters map[string]map[string]*string `locationName:"regionalParameters" type:"map"` - - // The timestamp of when the environment blueprint was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 PutEnvironmentBlueprintConfigurationOutput) 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 PutEnvironmentBlueprintConfigurationOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *PutEnvironmentBlueprintConfigurationOutput) SetCreatedAt(v time.Time) *PutEnvironmentBlueprintConfigurationOutput { - s.CreatedAt = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *PutEnvironmentBlueprintConfigurationOutput) SetDomainId(v string) *PutEnvironmentBlueprintConfigurationOutput { - s.DomainId = &v - return s -} - -// SetEnabledRegions sets the EnabledRegions field's value. -func (s *PutEnvironmentBlueprintConfigurationOutput) SetEnabledRegions(v []*string) *PutEnvironmentBlueprintConfigurationOutput { - s.EnabledRegions = v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *PutEnvironmentBlueprintConfigurationOutput) SetEnvironmentBlueprintId(v string) *PutEnvironmentBlueprintConfigurationOutput { - s.EnvironmentBlueprintId = &v - return s -} - -// SetManageAccessRoleArn sets the ManageAccessRoleArn field's value. -func (s *PutEnvironmentBlueprintConfigurationOutput) SetManageAccessRoleArn(v string) *PutEnvironmentBlueprintConfigurationOutput { - s.ManageAccessRoleArn = &v - return s -} - -// SetProvisioningRoleArn sets the ProvisioningRoleArn field's value. -func (s *PutEnvironmentBlueprintConfigurationOutput) SetProvisioningRoleArn(v string) *PutEnvironmentBlueprintConfigurationOutput { - s.ProvisioningRoleArn = &v - return s -} - -// SetRegionalParameters sets the RegionalParameters field's value. -func (s *PutEnvironmentBlueprintConfigurationOutput) SetRegionalParameters(v map[string]map[string]*string) *PutEnvironmentBlueprintConfigurationOutput { - s.RegionalParameters = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *PutEnvironmentBlueprintConfigurationOutput) SetUpdatedAt(v time.Time) *PutEnvironmentBlueprintConfigurationOutput { - s.UpdatedAt = &v - return s -} - -// The recommendation to be updated as part of the UpdateDataSource action. -type RecommendationConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies whether automatic business name generation is to be enabled or - // not as part of the recommendation configuration. - EnableBusinessNameGeneration *bool `locationName:"enableBusinessNameGeneration" type:"boolean"` -} - -// 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 RecommendationConfiguration) 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 RecommendationConfiguration) GoString() string { - return s.String() -} - -// SetEnableBusinessNameGeneration sets the EnableBusinessNameGeneration field's value. -func (s *RecommendationConfiguration) SetEnableBusinessNameGeneration(v bool) *RecommendationConfiguration { - s.EnableBusinessNameGeneration = &v - return s -} - -// The details of the Amazon Redshift cluster storage. -type RedshiftClusterStorage struct { - _ struct{} `type:"structure"` - - // The name of an Amazon Redshift cluster. - // - // ClusterName is a required field - ClusterName *string `locationName:"clusterName" min:"1" 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 RedshiftClusterStorage) 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 RedshiftClusterStorage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedshiftClusterStorage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedshiftClusterStorage"} - if s.ClusterName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterName")) - } - if s.ClusterName != nil && len(*s.ClusterName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterName sets the ClusterName field's value. -func (s *RedshiftClusterStorage) SetClusterName(v string) *RedshiftClusterStorage { - s.ClusterName = &v - return s -} - -// The details of the credentials required to access an Amazon Redshift cluster. -type RedshiftCredentialConfiguration struct { - _ struct{} `type:"structure"` - - // The ARN of a secret manager for an Amazon Redshift cluster. - // - // SecretManagerArn is a required field - SecretManagerArn *string `locationName:"secretManagerArn" 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 RedshiftCredentialConfiguration) 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 RedshiftCredentialConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedshiftCredentialConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedshiftCredentialConfiguration"} - if s.SecretManagerArn == nil { - invalidParams.Add(request.NewErrParamRequired("SecretManagerArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSecretManagerArn sets the SecretManagerArn field's value. -func (s *RedshiftCredentialConfiguration) SetSecretManagerArn(v string) *RedshiftCredentialConfiguration { - s.SecretManagerArn = &v - return s -} - -// The configuration details of the Amazon Redshift data source. -type RedshiftRunConfigurationInput_ struct { - _ struct{} `type:"structure"` - - // The data access role included in the configuration details of the Amazon - // Redshift data source. - DataAccessRole *string `locationName:"dataAccessRole" type:"string"` - - // The details of the credentials required to access an Amazon Redshift cluster. - // - // RedshiftCredentialConfiguration is a required field - RedshiftCredentialConfiguration *RedshiftCredentialConfiguration `locationName:"redshiftCredentialConfiguration" type:"structure" required:"true"` - - // The details of the Amazon Redshift storage as part of the configuration of - // an Amazon Redshift data source run. - // - // RedshiftStorage is a required field - RedshiftStorage *RedshiftStorage `locationName:"redshiftStorage" type:"structure" required:"true"` - - // The relational filger configurations included in the configuration details - // of the Amazon Redshift data source. - // - // RelationalFilterConfigurations is a required field - RelationalFilterConfigurations []*RelationalFilterConfiguration `locationName:"relationalFilterConfigurations" type:"list" 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 RedshiftRunConfigurationInput_) 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 RedshiftRunConfigurationInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedshiftRunConfigurationInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedshiftRunConfigurationInput_"} - if s.RedshiftCredentialConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("RedshiftCredentialConfiguration")) - } - if s.RedshiftStorage == nil { - invalidParams.Add(request.NewErrParamRequired("RedshiftStorage")) - } - if s.RelationalFilterConfigurations == nil { - invalidParams.Add(request.NewErrParamRequired("RelationalFilterConfigurations")) - } - if s.RedshiftCredentialConfiguration != nil { - if err := s.RedshiftCredentialConfiguration.Validate(); err != nil { - invalidParams.AddNested("RedshiftCredentialConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.RedshiftStorage != nil { - if err := s.RedshiftStorage.Validate(); err != nil { - invalidParams.AddNested("RedshiftStorage", err.(request.ErrInvalidParams)) - } - } - if s.RelationalFilterConfigurations != nil { - for i, v := range s.RelationalFilterConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RelationalFilterConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataAccessRole sets the DataAccessRole field's value. -func (s *RedshiftRunConfigurationInput_) SetDataAccessRole(v string) *RedshiftRunConfigurationInput_ { - s.DataAccessRole = &v - return s -} - -// SetRedshiftCredentialConfiguration sets the RedshiftCredentialConfiguration field's value. -func (s *RedshiftRunConfigurationInput_) SetRedshiftCredentialConfiguration(v *RedshiftCredentialConfiguration) *RedshiftRunConfigurationInput_ { - s.RedshiftCredentialConfiguration = v - return s -} - -// SetRedshiftStorage sets the RedshiftStorage field's value. -func (s *RedshiftRunConfigurationInput_) SetRedshiftStorage(v *RedshiftStorage) *RedshiftRunConfigurationInput_ { - s.RedshiftStorage = v - return s -} - -// SetRelationalFilterConfigurations sets the RelationalFilterConfigurations field's value. -func (s *RedshiftRunConfigurationInput_) SetRelationalFilterConfigurations(v []*RelationalFilterConfiguration) *RedshiftRunConfigurationInput_ { - s.RelationalFilterConfigurations = v - return s -} - -// The configuration details of the Amazon Redshift data source. -type RedshiftRunConfigurationOutput_ struct { - _ struct{} `type:"structure"` - - // The ID of the Amazon Web Services account included in the configuration details - // of the Amazon Redshift data source. - AccountId *string `locationName:"accountId" min:"12" type:"string"` - - // The data access role included in the configuration details of the Amazon - // Redshift data source. - DataAccessRole *string `locationName:"dataAccessRole" type:"string"` - - // The details of the credentials required to access an Amazon Redshift cluster. - // - // RedshiftCredentialConfiguration is a required field - RedshiftCredentialConfiguration *RedshiftCredentialConfiguration `locationName:"redshiftCredentialConfiguration" type:"structure" required:"true"` - - // The details of the Amazon Redshift storage as part of the configuration of - // an Amazon Redshift data source run. - // - // RedshiftStorage is a required field - RedshiftStorage *RedshiftStorage `locationName:"redshiftStorage" type:"structure" required:"true"` - - // The Amazon Web Services region included in the configuration details of the - // Amazon Redshift data source. - Region *string `locationName:"region" min:"4" type:"string"` - - // The relational filger configurations included in the configuration details - // of the Amazon Redshift data source. - // - // RelationalFilterConfigurations is a required field - RelationalFilterConfigurations []*RelationalFilterConfiguration `locationName:"relationalFilterConfigurations" type:"list" 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 RedshiftRunConfigurationOutput_) 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 RedshiftRunConfigurationOutput_) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *RedshiftRunConfigurationOutput_) SetAccountId(v string) *RedshiftRunConfigurationOutput_ { - s.AccountId = &v - return s -} - -// SetDataAccessRole sets the DataAccessRole field's value. -func (s *RedshiftRunConfigurationOutput_) SetDataAccessRole(v string) *RedshiftRunConfigurationOutput_ { - s.DataAccessRole = &v - return s -} - -// SetRedshiftCredentialConfiguration sets the RedshiftCredentialConfiguration field's value. -func (s *RedshiftRunConfigurationOutput_) SetRedshiftCredentialConfiguration(v *RedshiftCredentialConfiguration) *RedshiftRunConfigurationOutput_ { - s.RedshiftCredentialConfiguration = v - return s -} - -// SetRedshiftStorage sets the RedshiftStorage field's value. -func (s *RedshiftRunConfigurationOutput_) SetRedshiftStorage(v *RedshiftStorage) *RedshiftRunConfigurationOutput_ { - s.RedshiftStorage = v - return s -} - -// SetRegion sets the Region field's value. -func (s *RedshiftRunConfigurationOutput_) SetRegion(v string) *RedshiftRunConfigurationOutput_ { - s.Region = &v - return s -} - -// SetRelationalFilterConfigurations sets the RelationalFilterConfigurations field's value. -func (s *RedshiftRunConfigurationOutput_) SetRelationalFilterConfigurations(v []*RelationalFilterConfiguration) *RedshiftRunConfigurationOutput_ { - s.RelationalFilterConfigurations = v - return s -} - -// The details of the Amazon Redshift Serverless workgroup storage. -type RedshiftServerlessStorage struct { - _ struct{} `type:"structure"` - - // The name of the Amazon Redshift Serverless workgroup. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 RedshiftServerlessStorage) 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 RedshiftServerlessStorage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedshiftServerlessStorage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedshiftServerlessStorage"} - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *RedshiftServerlessStorage) SetWorkgroupName(v string) *RedshiftServerlessStorage { - s.WorkgroupName = &v - return s -} - -// The details of the Amazon Redshift storage as part of the configuration of -// an Amazon Redshift data source run. -type RedshiftStorage struct { - _ struct{} `type:"structure"` - - // The details of the Amazon Redshift cluster source. - RedshiftClusterSource *RedshiftClusterStorage `locationName:"redshiftClusterSource" type:"structure"` - - // The details of the Amazon Redshift Serverless workgroup source. - RedshiftServerlessSource *RedshiftServerlessStorage `locationName:"redshiftServerlessSource" 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 RedshiftStorage) 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 RedshiftStorage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedshiftStorage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedshiftStorage"} - if s.RedshiftClusterSource != nil { - if err := s.RedshiftClusterSource.Validate(); err != nil { - invalidParams.AddNested("RedshiftClusterSource", err.(request.ErrInvalidParams)) - } - } - if s.RedshiftServerlessSource != nil { - if err := s.RedshiftServerlessSource.Validate(); err != nil { - invalidParams.AddNested("RedshiftServerlessSource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRedshiftClusterSource sets the RedshiftClusterSource field's value. -func (s *RedshiftStorage) SetRedshiftClusterSource(v *RedshiftClusterStorage) *RedshiftStorage { - s.RedshiftClusterSource = v - return s -} - -// SetRedshiftServerlessSource sets the RedshiftServerlessSource field's value. -func (s *RedshiftStorage) SetRedshiftServerlessSource(v *RedshiftServerlessStorage) *RedshiftStorage { - s.RedshiftServerlessSource = v - return s -} - -// The details of the automatically generated business metadata that is rejected. -type RejectChoice struct { - _ struct{} `type:"structure"` - - // Specifies the the automatically generated business metadata that can be rejected. - PredictionChoices []*int64 `locationName:"predictionChoices" type:"list"` - - // Specifies the target (for example, a column name) where a prediction can - // be rejected. - PredictionTarget *string `locationName:"predictionTarget" 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 RejectChoice) 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 RejectChoice) GoString() string { - return s.String() -} - -// SetPredictionChoices sets the PredictionChoices field's value. -func (s *RejectChoice) SetPredictionChoices(v []*int64) *RejectChoice { - s.PredictionChoices = v - return s -} - -// SetPredictionTarget sets the PredictionTarget field's value. -func (s *RejectChoice) SetPredictionTarget(v string) *RejectChoice { - s.PredictionTarget = &v - return s -} - -type RejectPredictionsInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the prediction. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - RejectChoices []*RejectChoice `locationName:"rejectChoices" type:"list"` - - // Specifies the rule and the threshold under which a prediction can be rejected. - RejectRule *RejectRule `locationName:"rejectRule" type:"structure"` - - Revision *string `location:"querystring" locationName:"revision" min:"1" 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 RejectPredictionsInput) 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 RejectPredictionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RejectPredictionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RejectPredictionsInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Revision != nil && len(*s.Revision) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Revision", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *RejectPredictionsInput) SetClientToken(v string) *RejectPredictionsInput { - s.ClientToken = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *RejectPredictionsInput) SetDomainIdentifier(v string) *RejectPredictionsInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *RejectPredictionsInput) SetIdentifier(v string) *RejectPredictionsInput { - s.Identifier = &v - return s -} - -// SetRejectChoices sets the RejectChoices field's value. -func (s *RejectPredictionsInput) SetRejectChoices(v []*RejectChoice) *RejectPredictionsInput { - s.RejectChoices = v - return s -} - -// SetRejectRule sets the RejectRule field's value. -func (s *RejectPredictionsInput) SetRejectRule(v *RejectRule) *RejectPredictionsInput { - s.RejectRule = v - return s -} - -// SetRevision sets the Revision field's value. -func (s *RejectPredictionsInput) SetRevision(v string) *RejectPredictionsInput { - s.Revision = &v - return s -} - -type RejectPredictionsOutput struct { - _ struct{} `type:"structure"` - - // AssetId is a required field - AssetId *string `locationName:"assetId" type:"string" required:"true"` - - // AssetRevision is a required field - AssetRevision *string `locationName:"assetRevision" min:"1" type:"string" required:"true"` - - // DomainId is a required field - DomainId *string `locationName:"domainId" 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 RejectPredictionsOutput) 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 RejectPredictionsOutput) GoString() string { - return s.String() -} - -// SetAssetId sets the AssetId field's value. -func (s *RejectPredictionsOutput) SetAssetId(v string) *RejectPredictionsOutput { - s.AssetId = &v - return s -} - -// SetAssetRevision sets the AssetRevision field's value. -func (s *RejectPredictionsOutput) SetAssetRevision(v string) *RejectPredictionsOutput { - s.AssetRevision = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *RejectPredictionsOutput) SetDomainId(v string) *RejectPredictionsOutput { - s.DomainId = &v - return s -} - -// Specifies the rule and the threshold under which a prediction can be rejected. -type RejectRule struct { - _ struct{} `type:"structure"` - - // Specifies whether you want to reject the top prediction for all targets or - // none. - Rule *string `locationName:"rule" type:"string" enum:"RejectRuleBehavior"` - - // The confidence score that specifies the condition at which a prediction can - // be rejected. - Threshold *float64 `locationName:"threshold" type:"float"` -} - -// 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 RejectRule) 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 RejectRule) GoString() string { - return s.String() -} - -// SetRule sets the Rule field's value. -func (s *RejectRule) SetRule(v string) *RejectRule { - s.Rule = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *RejectRule) SetThreshold(v float64) *RejectRule { - s.Threshold = &v - return s -} - -type RejectSubscriptionRequestInput struct { - _ struct{} `type:"structure"` - - // The decision comment of the rejected subscription request. - // - // DecisionComment is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RejectSubscriptionRequestInput's - // String and GoString methods. - DecisionComment *string `locationName:"decisionComment" min:"1" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the subscription request - // was rejected. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the subscription request that was rejected. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" 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 RejectSubscriptionRequestInput) 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 RejectSubscriptionRequestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RejectSubscriptionRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RejectSubscriptionRequestInput"} - if s.DecisionComment != nil && len(*s.DecisionComment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DecisionComment", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDecisionComment sets the DecisionComment field's value. -func (s *RejectSubscriptionRequestInput) SetDecisionComment(v string) *RejectSubscriptionRequestInput { - s.DecisionComment = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *RejectSubscriptionRequestInput) SetDomainIdentifier(v string) *RejectSubscriptionRequestInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *RejectSubscriptionRequestInput) SetIdentifier(v string) *RejectSubscriptionRequestInput { - s.Identifier = &v - return s -} - -type RejectSubscriptionRequestOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the subscription request was rejected. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The timestamp of when the subscription request was rejected. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The decision comment of the rejected subscription request. - // - // DecisionComment is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RejectSubscriptionRequestOutput's - // String and GoString methods. - DecisionComment *string `locationName:"decisionComment" min:"1" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the subscription request - // was rejected. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the subscription request that was rejected. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The reason for the subscription request. - // - // RequestReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RejectSubscriptionRequestOutput's - // String and GoString methods. - // - // RequestReason is a required field - RequestReason *string `locationName:"requestReason" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the subscription request reviewer. - ReviewerId *string `locationName:"reviewerId" type:"string"` - - // The status of the subscription request. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionRequestStatus"` - - // The subscribed listings of the subscription request. - // - // SubscribedListings is a required field - SubscribedListings []*SubscribedListing `locationName:"subscribedListings" min:"1" type:"list" required:"true"` - - // The subscribed principals of the subscription request. - // - // SubscribedPrincipals is a required field - SubscribedPrincipals []*SubscribedPrincipal `locationName:"subscribedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when the subscription request was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription request. - UpdatedBy *string `locationName:"updatedBy" 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 RejectSubscriptionRequestOutput) 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 RejectSubscriptionRequestOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *RejectSubscriptionRequestOutput) SetCreatedAt(v time.Time) *RejectSubscriptionRequestOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *RejectSubscriptionRequestOutput) SetCreatedBy(v string) *RejectSubscriptionRequestOutput { - s.CreatedBy = &v - return s -} - -// SetDecisionComment sets the DecisionComment field's value. -func (s *RejectSubscriptionRequestOutput) SetDecisionComment(v string) *RejectSubscriptionRequestOutput { - s.DecisionComment = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *RejectSubscriptionRequestOutput) SetDomainId(v string) *RejectSubscriptionRequestOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *RejectSubscriptionRequestOutput) SetId(v string) *RejectSubscriptionRequestOutput { - s.Id = &v - return s -} - -// SetRequestReason sets the RequestReason field's value. -func (s *RejectSubscriptionRequestOutput) SetRequestReason(v string) *RejectSubscriptionRequestOutput { - s.RequestReason = &v - return s -} - -// SetReviewerId sets the ReviewerId field's value. -func (s *RejectSubscriptionRequestOutput) SetReviewerId(v string) *RejectSubscriptionRequestOutput { - s.ReviewerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RejectSubscriptionRequestOutput) SetStatus(v string) *RejectSubscriptionRequestOutput { - s.Status = &v - return s -} - -// SetSubscribedListings sets the SubscribedListings field's value. -func (s *RejectSubscriptionRequestOutput) SetSubscribedListings(v []*SubscribedListing) *RejectSubscriptionRequestOutput { - s.SubscribedListings = v - return s -} - -// SetSubscribedPrincipals sets the SubscribedPrincipals field's value. -func (s *RejectSubscriptionRequestOutput) SetSubscribedPrincipals(v []*SubscribedPrincipal) *RejectSubscriptionRequestOutput { - s.SubscribedPrincipals = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *RejectSubscriptionRequestOutput) SetUpdatedAt(v time.Time) *RejectSubscriptionRequestOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *RejectSubscriptionRequestOutput) SetUpdatedBy(v string) *RejectSubscriptionRequestOutput { - s.UpdatedBy = &v - return s -} - -// The relational filter configuration for the data source. -type RelationalFilterConfiguration struct { - _ struct{} `type:"structure"` - - // The database name specified in the relational filter configuration for the - // data source. - // - // DatabaseName is a required field - DatabaseName *string `locationName:"databaseName" min:"1" type:"string" required:"true"` - - // The filter expressions specified in the relational filter configuration for - // the data source. - FilterExpressions []*FilterExpression `locationName:"filterExpressions" type:"list"` - - // The schema name specified in the relational filter configuration for the - // data source. - SchemaName *string `locationName:"schemaName" min:"1" 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 RelationalFilterConfiguration) 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 RelationalFilterConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RelationalFilterConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RelationalFilterConfiguration"} - if s.DatabaseName == nil { - invalidParams.Add(request.NewErrParamRequired("DatabaseName")) - } - if s.DatabaseName != nil && len(*s.DatabaseName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatabaseName", 1)) - } - if s.SchemaName != nil && len(*s.SchemaName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SchemaName", 1)) - } - if s.FilterExpressions != nil { - for i, v := range s.FilterExpressions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "FilterExpressions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *RelationalFilterConfiguration) SetDatabaseName(v string) *RelationalFilterConfiguration { - s.DatabaseName = &v - return s -} - -// SetFilterExpressions sets the FilterExpressions field's value. -func (s *RelationalFilterConfiguration) SetFilterExpressions(v []*FilterExpression) *RelationalFilterConfiguration { - s.FilterExpressions = v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *RelationalFilterConfiguration) SetSchemaName(v string) *RelationalFilterConfiguration { - s.SchemaName = &v - return s -} - -// The details of a provisioned resource of this Amazon DataZone environment. -type Resource struct { - _ struct{} `type:"structure"` - - // The name of a provisioned resource of this Amazon DataZone environment. - Name *string `locationName:"name" type:"string"` - - // The provider of a provisioned resource of this Amazon DataZone environment. - Provider *string `locationName:"provider" type:"string"` - - // The type of a provisioned resource of this Amazon DataZone environment. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true"` - - // The value of a provisioned resource of this Amazon DataZone environment. - // - // Value is a required field - Value *string `locationName:"value" 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 Resource) 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 Resource) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Resource) SetName(v string) *Resource { - s.Name = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *Resource) SetProvider(v string) *Resource { - s.Provider = &v - return s -} - -// SetType sets the Type field's value. -func (s *Resource) SetType(v string) *Resource { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Resource) SetValue(v string) *Resource { - s.Value = &v - return s -} - -// The specified resource cannot be found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type RevokeSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain where you want to revoke a subscription. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the revoked subscription. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // Specifies whether permissions are retained when the subscription is revoked. - RetainPermissions *bool `locationName:"retainPermissions" type:"boolean"` -} - -// 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 RevokeSubscriptionInput) 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 RevokeSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RevokeSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RevokeSubscriptionInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *RevokeSubscriptionInput) SetDomainIdentifier(v string) *RevokeSubscriptionInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *RevokeSubscriptionInput) SetIdentifier(v string) *RevokeSubscriptionInput { - s.Identifier = &v - return s -} - -// SetRetainPermissions sets the RetainPermissions field's value. -func (s *RevokeSubscriptionInput) SetRetainPermissions(v bool) *RevokeSubscriptionInput { - s.RetainPermissions = &v - return s -} - -type RevokeSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the subscription was revoked. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The identifier of the user who revoked the subscription. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain where you want to revoke a subscription. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the revoked subscription. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Specifies whether permissions are retained when the subscription is revoked. - RetainPermissions *bool `locationName:"retainPermissions" type:"boolean"` - - // The status of the revoked subscription. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionStatus"` - - // The subscribed listing of the revoked subscription. - // - // SubscribedListing is a required field - SubscribedListing *SubscribedListing `locationName:"subscribedListing" type:"structure" required:"true"` - - // The subscribed principal of the revoked subscription. - // - // SubscribedPrincipal is a required field - SubscribedPrincipal *SubscribedPrincipal `locationName:"subscribedPrincipal" type:"structure" required:"true"` - - // The identifier of the subscription request for the revoked subscription. - SubscriptionRequestId *string `locationName:"subscriptionRequestId" type:"string"` - - // The timestamp of when the subscription was revoked. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who revoked the subscription. - UpdatedBy *string `locationName:"updatedBy" 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 RevokeSubscriptionOutput) 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 RevokeSubscriptionOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *RevokeSubscriptionOutput) SetCreatedAt(v time.Time) *RevokeSubscriptionOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *RevokeSubscriptionOutput) SetCreatedBy(v string) *RevokeSubscriptionOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *RevokeSubscriptionOutput) SetDomainId(v string) *RevokeSubscriptionOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *RevokeSubscriptionOutput) SetId(v string) *RevokeSubscriptionOutput { - s.Id = &v - return s -} - -// SetRetainPermissions sets the RetainPermissions field's value. -func (s *RevokeSubscriptionOutput) SetRetainPermissions(v bool) *RevokeSubscriptionOutput { - s.RetainPermissions = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RevokeSubscriptionOutput) SetStatus(v string) *RevokeSubscriptionOutput { - s.Status = &v - return s -} - -// SetSubscribedListing sets the SubscribedListing field's value. -func (s *RevokeSubscriptionOutput) SetSubscribedListing(v *SubscribedListing) *RevokeSubscriptionOutput { - s.SubscribedListing = v - return s -} - -// SetSubscribedPrincipal sets the SubscribedPrincipal field's value. -func (s *RevokeSubscriptionOutput) SetSubscribedPrincipal(v *SubscribedPrincipal) *RevokeSubscriptionOutput { - s.SubscribedPrincipal = v - return s -} - -// SetSubscriptionRequestId sets the SubscriptionRequestId field's value. -func (s *RevokeSubscriptionOutput) SetSubscriptionRequestId(v string) *RevokeSubscriptionOutput { - s.SubscriptionRequestId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *RevokeSubscriptionOutput) SetUpdatedAt(v time.Time) *RevokeSubscriptionOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *RevokeSubscriptionOutput) SetUpdatedBy(v string) *RevokeSubscriptionOutput { - s.UpdatedBy = &v - return s -} - -// The asset statistics from the data source run. -type RunStatisticsForAssets struct { - _ struct{} `type:"structure"` - - // The added statistic for the data source run. - Added *int64 `locationName:"added" type:"integer"` - - // The failed statistic for the data source run. - Failed *int64 `locationName:"failed" type:"integer"` - - // The skipped statistic for the data source run. - Skipped *int64 `locationName:"skipped" type:"integer"` - - // The unchanged statistic for the data source run. - Unchanged *int64 `locationName:"unchanged" type:"integer"` - - // The updated statistic for the data source run. - Updated *int64 `locationName:"updated" 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 RunStatisticsForAssets) 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 RunStatisticsForAssets) GoString() string { - return s.String() -} - -// SetAdded sets the Added field's value. -func (s *RunStatisticsForAssets) SetAdded(v int64) *RunStatisticsForAssets { - s.Added = &v - return s -} - -// SetFailed sets the Failed field's value. -func (s *RunStatisticsForAssets) SetFailed(v int64) *RunStatisticsForAssets { - s.Failed = &v - return s -} - -// SetSkipped sets the Skipped field's value. -func (s *RunStatisticsForAssets) SetSkipped(v int64) *RunStatisticsForAssets { - s.Skipped = &v - return s -} - -// SetUnchanged sets the Unchanged field's value. -func (s *RunStatisticsForAssets) SetUnchanged(v int64) *RunStatisticsForAssets { - s.Unchanged = &v - return s -} - -// SetUpdated sets the Updated field's value. -func (s *RunStatisticsForAssets) SetUpdated(v int64) *RunStatisticsForAssets { - s.Updated = &v - return s -} - -// The details of the schedule of the data source runs. -type ScheduleConfiguration struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The schedule of the data source runs. - Schedule *string `locationName:"schedule" min:"1" type:"string"` - - // The timezone of the data source run. - Timezone *string `locationName:"timezone" type:"string" enum:"Timezone"` -} - -// 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 ScheduleConfiguration) 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 ScheduleConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScheduleConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScheduleConfiguration"} - if s.Schedule != nil && len(*s.Schedule) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Schedule", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSchedule sets the Schedule field's value. -func (s *ScheduleConfiguration) SetSchedule(v string) *ScheduleConfiguration { - s.Schedule = &v - return s -} - -// SetTimezone sets the Timezone field's value. -func (s *ScheduleConfiguration) SetTimezone(v string) *ScheduleConfiguration { - s.Timezone = &v - return s -} - -type SearchGroupProfilesInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which you want to search - // group profiles. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The group type for which to search. - // - // GroupType is a required field - GroupType *string `locationName:"groupType" type:"string" required:"true" enum:"GroupSearchType"` - - // The maximum number of results to return in a single call to SearchGroupProfiles. - // When the number of results to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to SearchGroupProfiles to list the next set of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to SearchGroupProfiles - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Specifies the text for which to search. - // - // SearchText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchGroupProfilesInput's - // String and GoString methods. - SearchText *string `locationName:"searchText" type:"string" sensitive:"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 SearchGroupProfilesInput) 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 SearchGroupProfilesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchGroupProfilesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchGroupProfilesInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GroupType == nil { - invalidParams.Add(request.NewErrParamRequired("GroupType")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *SearchGroupProfilesInput) SetDomainIdentifier(v string) *SearchGroupProfilesInput { - s.DomainIdentifier = &v - return s -} - -// SetGroupType sets the GroupType field's value. -func (s *SearchGroupProfilesInput) SetGroupType(v string) *SearchGroupProfilesInput { - s.GroupType = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchGroupProfilesInput) SetMaxResults(v int64) *SearchGroupProfilesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchGroupProfilesInput) SetNextToken(v string) *SearchGroupProfilesInput { - s.NextToken = &v - return s -} - -// SetSearchText sets the SearchText field's value. -func (s *SearchGroupProfilesInput) SetSearchText(v string) *SearchGroupProfilesInput { - s.SearchText = &v - return s -} - -type SearchGroupProfilesOutput struct { - _ struct{} `type:"structure"` - - // The results of the SearchGroupProfiles action. - Items []*GroupProfileSummary `locationName:"items" type:"list"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to SearchGroupProfiles - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 SearchGroupProfilesOutput) 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 SearchGroupProfilesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *SearchGroupProfilesOutput) SetItems(v []*GroupProfileSummary) *SearchGroupProfilesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchGroupProfilesOutput) SetNextToken(v string) *SearchGroupProfilesOutput { - s.NextToken = &v - return s -} - -// The details of the search. -type SearchInItem struct { - _ struct{} `type:"structure"` - - // The search attribute. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" min:"1" 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 SearchInItem) 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 SearchInItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchInItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchInItem"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.Attribute != nil && len(*s.Attribute) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Attribute", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *SearchInItem) SetAttribute(v string) *SearchInItem { - s.Attribute = &v - return s -} - -type SearchInput struct { - _ struct{} `type:"structure"` - - // Specifies additional attributes for the Search action. - AdditionalAttributes []*string `locationName:"additionalAttributes" type:"list" enum:"SearchOutputAdditionalAttribute"` - - // The identifier of the Amazon DataZone domain. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Specifies the search filters. - Filters *FilterClause `locationName:"filters" type:"structure"` - - // The maximum number of results to return in a single call to Search. When - // the number of results to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to Search to list the next set of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to Search - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the owning project specified for the search. - OwningProjectIdentifier *string `locationName:"owningProjectIdentifier" type:"string"` - - SearchIn []*SearchInItem `locationName:"searchIn" min:"1" type:"list"` - - // The scope of the search. - // - // SearchScope is a required field - SearchScope *string `locationName:"searchScope" type:"string" required:"true" enum:"InventorySearchScope"` - - // Specifies the text for which to search. - SearchText *string `locationName:"searchText" min:"1" type:"string"` - - // Specifies the way in which the search results are to be sorted. - Sort *SearchSort `locationName:"sort" 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 SearchInput) 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 SearchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SearchIn != nil && len(s.SearchIn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SearchIn", 1)) - } - if s.SearchScope == nil { - invalidParams.Add(request.NewErrParamRequired("SearchScope")) - } - if s.SearchText != nil && len(*s.SearchText) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SearchText", 1)) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } - } - if s.SearchIn != nil { - for i, v := range s.SearchIn { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SearchIn", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Sort != nil { - if err := s.Sort.Validate(); err != nil { - invalidParams.AddNested("Sort", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalAttributes sets the AdditionalAttributes field's value. -func (s *SearchInput) SetAdditionalAttributes(v []*string) *SearchInput { - s.AdditionalAttributes = v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *SearchInput) SetDomainIdentifier(v string) *SearchInput { - s.DomainIdentifier = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *SearchInput) SetFilters(v *FilterClause) *SearchInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchInput) SetMaxResults(v int64) *SearchInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchInput) SetNextToken(v string) *SearchInput { - s.NextToken = &v - return s -} - -// SetOwningProjectIdentifier sets the OwningProjectIdentifier field's value. -func (s *SearchInput) SetOwningProjectIdentifier(v string) *SearchInput { - s.OwningProjectIdentifier = &v - return s -} - -// SetSearchIn sets the SearchIn field's value. -func (s *SearchInput) SetSearchIn(v []*SearchInItem) *SearchInput { - s.SearchIn = v - return s -} - -// SetSearchScope sets the SearchScope field's value. -func (s *SearchInput) SetSearchScope(v string) *SearchInput { - s.SearchScope = &v - return s -} - -// SetSearchText sets the SearchText field's value. -func (s *SearchInput) SetSearchText(v string) *SearchInput { - s.SearchText = &v - return s -} - -// SetSort sets the Sort field's value. -func (s *SearchInput) SetSort(v *SearchSort) *SearchInput { - s.Sort = v - return s -} - -// The details of the search results. -type SearchInventoryResultItem struct { - _ struct{} `type:"structure"` - - // The asset item included in the search results. - AssetItem *AssetItem `locationName:"assetItem" type:"structure"` - - // The data product item included in the search results. - DataProductItem *DataProductSummary `locationName:"dataProductItem" type:"structure"` - - // The glossary item included in the search results. - GlossaryItem *GlossaryItem `locationName:"glossaryItem" type:"structure"` - - // The glossary term item included in the search results. - GlossaryTermItem *GlossaryTermItem `locationName:"glossaryTermItem" 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 SearchInventoryResultItem) 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 SearchInventoryResultItem) GoString() string { - return s.String() -} - -// SetAssetItem sets the AssetItem field's value. -func (s *SearchInventoryResultItem) SetAssetItem(v *AssetItem) *SearchInventoryResultItem { - s.AssetItem = v - return s -} - -// SetDataProductItem sets the DataProductItem field's value. -func (s *SearchInventoryResultItem) SetDataProductItem(v *DataProductSummary) *SearchInventoryResultItem { - s.DataProductItem = v - return s -} - -// SetGlossaryItem sets the GlossaryItem field's value. -func (s *SearchInventoryResultItem) SetGlossaryItem(v *GlossaryItem) *SearchInventoryResultItem { - s.GlossaryItem = v - return s -} - -// SetGlossaryTermItem sets the GlossaryTermItem field's value. -func (s *SearchInventoryResultItem) SetGlossaryTermItem(v *GlossaryTermItem) *SearchInventoryResultItem { - s.GlossaryTermItem = v - return s -} - -type SearchListingsInput struct { - _ struct{} `type:"structure"` - - // Specifies additional attributes for the search. - AdditionalAttributes []*string `locationName:"additionalAttributes" type:"list" enum:"SearchOutputAdditionalAttribute"` - - // The identifier of the domain in which to search listings. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Specifies the filters for the search of listings. - Filters *FilterClause `locationName:"filters" type:"structure"` - - // The maximum number of results to return in a single call to SearchListings. - // When the number of results to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to SearchListings to list the next set of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to SearchListings - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - SearchIn []*SearchInItem `locationName:"searchIn" min:"1" type:"list"` - - // Specifies the text for which to search. - SearchText *string `locationName:"searchText" type:"string"` - - // Specifies the way for sorting the search results. - Sort *SearchSort `locationName:"sort" 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 SearchListingsInput) 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 SearchListingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchListingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchListingsInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SearchIn != nil && len(s.SearchIn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SearchIn", 1)) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } - } - if s.SearchIn != nil { - for i, v := range s.SearchIn { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SearchIn", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Sort != nil { - if err := s.Sort.Validate(); err != nil { - invalidParams.AddNested("Sort", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalAttributes sets the AdditionalAttributes field's value. -func (s *SearchListingsInput) SetAdditionalAttributes(v []*string) *SearchListingsInput { - s.AdditionalAttributes = v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *SearchListingsInput) SetDomainIdentifier(v string) *SearchListingsInput { - s.DomainIdentifier = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *SearchListingsInput) SetFilters(v *FilterClause) *SearchListingsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchListingsInput) SetMaxResults(v int64) *SearchListingsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchListingsInput) SetNextToken(v string) *SearchListingsInput { - s.NextToken = &v - return s -} - -// SetSearchIn sets the SearchIn field's value. -func (s *SearchListingsInput) SetSearchIn(v []*SearchInItem) *SearchListingsInput { - s.SearchIn = v - return s -} - -// SetSearchText sets the SearchText field's value. -func (s *SearchListingsInput) SetSearchText(v string) *SearchListingsInput { - s.SearchText = &v - return s -} - -// SetSort sets the Sort field's value. -func (s *SearchListingsInput) SetSort(v *SearchSort) *SearchListingsInput { - s.Sort = v - return s -} - -type SearchListingsOutput struct { - _ struct{} `type:"structure"` - - // The results of the SearchListings action. - Items []*SearchResultItem `locationName:"items" type:"list"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to SearchListings - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Total number of search results. - TotalMatchCount *int64 `locationName:"totalMatchCount" 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 SearchListingsOutput) 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 SearchListingsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *SearchListingsOutput) SetItems(v []*SearchResultItem) *SearchListingsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchListingsOutput) SetNextToken(v string) *SearchListingsOutput { - s.NextToken = &v - return s -} - -// SetTotalMatchCount sets the TotalMatchCount field's value. -func (s *SearchListingsOutput) SetTotalMatchCount(v int64) *SearchListingsOutput { - s.TotalMatchCount = &v - return s -} - -type SearchOutput struct { - _ struct{} `type:"structure"` - - // The results of the Search action. - Items []*SearchInventoryResultItem `locationName:"items" type:"list"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to Search - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Total number of search results. - TotalMatchCount *int64 `locationName:"totalMatchCount" 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 SearchOutput) 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 SearchOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *SearchOutput) SetItems(v []*SearchInventoryResultItem) *SearchOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchOutput) SetNextToken(v string) *SearchOutput { - s.NextToken = &v - return s -} - -// SetTotalMatchCount sets the TotalMatchCount field's value. -func (s *SearchOutput) SetTotalMatchCount(v int64) *SearchOutput { - s.TotalMatchCount = &v - return s -} - -// The details of the results of the SearchListings action. -type SearchResultItem struct { - _ struct{} `type:"structure"` - - // The asset listing included in the results of the SearchListings action. - AssetListing *AssetListingItem `locationName:"assetListing" 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 SearchResultItem) 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 SearchResultItem) GoString() string { - return s.String() -} - -// SetAssetListing sets the AssetListing field's value. -func (s *SearchResultItem) SetAssetListing(v *AssetListingItem) *SearchResultItem { - s.AssetListing = v - return s -} - -// The details of the way to sort search results. -type SearchSort struct { - _ struct{} `type:"structure"` - - // The attribute detail of the way to sort search results. - // - // Attribute is a required field - Attribute *string `locationName:"attribute" min:"1" type:"string" required:"true"` - - // The order detail of the wya to sort search results. - Order *string `locationName:"order" type:"string" enum:"SortOrder"` -} - -// 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 SearchSort) 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 SearchSort) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchSort) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchSort"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.Attribute != nil && len(*s.Attribute) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Attribute", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttribute sets the Attribute field's value. -func (s *SearchSort) SetAttribute(v string) *SearchSort { - s.Attribute = &v - return s -} - -// SetOrder sets the Order field's value. -func (s *SearchSort) SetOrder(v string) *SearchSort { - s.Order = &v - return s -} - -type SearchTypesInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which to invoke the SearchTypes - // action. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The filters for the SearchTypes action. - Filters *FilterClause `locationName:"filters" type:"structure"` - - // Managed is a required field - Managed *bool `locationName:"managed" type:"boolean" required:"true"` - - // The maximum number of results to return in a single call to SearchTypes. - // When the number of results to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to SearchTypes to list the next set of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to SearchTypes - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - SearchIn []*SearchInItem `locationName:"searchIn" min:"1" type:"list"` - - // Specifies the scope of the search for types. - // - // SearchScope is a required field - SearchScope *string `locationName:"searchScope" type:"string" required:"true" enum:"TypesSearchScope"` - - // Specifies the text for which to search. - SearchText *string `locationName:"searchText" min:"1" type:"string"` - - // The specifies the way to sort the SearchTypes results. - Sort *SearchSort `locationName:"sort" 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 SearchTypesInput) 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 SearchTypesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchTypesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchTypesInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Managed == nil { - invalidParams.Add(request.NewErrParamRequired("Managed")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SearchIn != nil && len(s.SearchIn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SearchIn", 1)) - } - if s.SearchScope == nil { - invalidParams.Add(request.NewErrParamRequired("SearchScope")) - } - if s.SearchText != nil && len(*s.SearchText) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SearchText", 1)) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } - } - if s.SearchIn != nil { - for i, v := range s.SearchIn { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SearchIn", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Sort != nil { - if err := s.Sort.Validate(); err != nil { - invalidParams.AddNested("Sort", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *SearchTypesInput) SetDomainIdentifier(v string) *SearchTypesInput { - s.DomainIdentifier = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *SearchTypesInput) SetFilters(v *FilterClause) *SearchTypesInput { - s.Filters = v - return s -} - -// SetManaged sets the Managed field's value. -func (s *SearchTypesInput) SetManaged(v bool) *SearchTypesInput { - s.Managed = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchTypesInput) SetMaxResults(v int64) *SearchTypesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchTypesInput) SetNextToken(v string) *SearchTypesInput { - s.NextToken = &v - return s -} - -// SetSearchIn sets the SearchIn field's value. -func (s *SearchTypesInput) SetSearchIn(v []*SearchInItem) *SearchTypesInput { - s.SearchIn = v - return s -} - -// SetSearchScope sets the SearchScope field's value. -func (s *SearchTypesInput) SetSearchScope(v string) *SearchTypesInput { - s.SearchScope = &v - return s -} - -// SetSearchText sets the SearchText field's value. -func (s *SearchTypesInput) SetSearchText(v string) *SearchTypesInput { - s.SearchText = &v - return s -} - -// SetSort sets the Sort field's value. -func (s *SearchTypesInput) SetSort(v *SearchSort) *SearchTypesInput { - s.Sort = v - return s -} - -type SearchTypesOutput struct { - _ struct{} `type:"structure"` - - // The results of the SearchTypes action. - Items []*SearchTypesResultItem `locationName:"items" type:"list"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to SearchTypes - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Total number of search results. - TotalMatchCount *int64 `locationName:"totalMatchCount" 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 SearchTypesOutput) 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 SearchTypesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *SearchTypesOutput) SetItems(v []*SearchTypesResultItem) *SearchTypesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchTypesOutput) SetNextToken(v string) *SearchTypesOutput { - s.NextToken = &v - return s -} - -// SetTotalMatchCount sets the TotalMatchCount field's value. -func (s *SearchTypesOutput) SetTotalMatchCount(v int64) *SearchTypesOutput { - s.TotalMatchCount = &v - return s -} - -// The details of the results of the SearchTypes action. -type SearchTypesResultItem struct { - _ struct{} `type:"structure"` - - // The asset type included in the results of the SearchTypes action. - AssetTypeItem *AssetTypeItem `locationName:"assetTypeItem" type:"structure"` - - // The form type included in the results of the SearchTypes action. - FormTypeItem *FormTypeData `locationName:"formTypeItem" 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 SearchTypesResultItem) 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 SearchTypesResultItem) GoString() string { - return s.String() -} - -// SetAssetTypeItem sets the AssetTypeItem field's value. -func (s *SearchTypesResultItem) SetAssetTypeItem(v *AssetTypeItem) *SearchTypesResultItem { - s.AssetTypeItem = v - return s -} - -// SetFormTypeItem sets the FormTypeItem field's value. -func (s *SearchTypesResultItem) SetFormTypeItem(v *FormTypeData) *SearchTypesResultItem { - s.FormTypeItem = v - return s -} - -type SearchUserProfilesInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which you want to search - // user profiles. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The maximum number of results to return in a single call to SearchUserProfiles. - // When the number of results to be listed is greater than the value of MaxResults, - // the response contains a NextToken value that you can use in a subsequent - // call to SearchUserProfiles to list the next set of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to SearchUserProfiles - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Specifies the text for which to search. - // - // SearchText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchUserProfilesInput's - // String and GoString methods. - SearchText *string `locationName:"searchText" type:"string" sensitive:"true"` - - // Specifies the user type for the SearchUserProfiles action. - // - // UserType is a required field - UserType *string `locationName:"userType" type:"string" required:"true" enum:"UserSearchType"` -} - -// 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 SearchUserProfilesInput) 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 SearchUserProfilesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchUserProfilesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchUserProfilesInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.UserType == nil { - invalidParams.Add(request.NewErrParamRequired("UserType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *SearchUserProfilesInput) SetDomainIdentifier(v string) *SearchUserProfilesInput { - s.DomainIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchUserProfilesInput) SetMaxResults(v int64) *SearchUserProfilesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchUserProfilesInput) SetNextToken(v string) *SearchUserProfilesInput { - s.NextToken = &v - return s -} - -// SetSearchText sets the SearchText field's value. -func (s *SearchUserProfilesInput) SetSearchText(v string) *SearchUserProfilesInput { - s.SearchText = &v - return s -} - -// SetUserType sets the UserType field's value. -func (s *SearchUserProfilesInput) SetUserType(v string) *SearchUserProfilesInput { - s.UserType = &v - return s -} - -type SearchUserProfilesOutput struct { - _ struct{} `type:"structure"` - - // The results of the SearchUserProfiles action. - Items []*UserProfileSummary `locationName:"items" type:"list"` - - // When the number of results is greater than the default value for the MaxResults - // parameter, or if you explicitly specify a value for MaxResults that is less - // than the number of results, the response includes a pagination token named - // NextToken. You can specify this NextToken value in a subsequent call to SearchUserProfiles - // to list the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 SearchUserProfilesOutput) 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 SearchUserProfilesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *SearchUserProfilesOutput) SetItems(v []*UserProfileSummary) *SearchUserProfilesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchUserProfilesOutput) SetNextToken(v string) *SearchUserProfilesOutput { - s.NextToken = &v - return s -} - -// The request has exceeded the specified service quota. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The single sign-on details in Amazon DataZone. -type SingleSignOn struct { - _ struct{} `type:"structure"` - - // The type of single sign-on in Amazon DataZone. - Type *string `locationName:"type" type:"string" enum:"AuthType"` - - // The single sign-on user assignment in Amazon DataZone. - UserAssignment *string `locationName:"userAssignment" type:"string" enum:"UserAssignment"` -} - -// 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 SingleSignOn) 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 SingleSignOn) GoString() string { - return s.String() -} - -// SetType sets the Type field's value. -func (s *SingleSignOn) SetType(v string) *SingleSignOn { - s.Type = &v - return s -} - -// SetUserAssignment sets the UserAssignment field's value. -func (s *SingleSignOn) SetUserAssignment(v string) *SingleSignOn { - s.UserAssignment = &v - return s -} - -// The single sign-on details of the user profile. -type SsoUserProfileDetails struct { - _ struct{} `type:"structure"` - - // The first name included in the single sign-on details of the user profile. - // - // FirstName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SsoUserProfileDetails's - // String and GoString methods. - FirstName *string `locationName:"firstName" type:"string" sensitive:"true"` - - // The last name included in the single sign-on details of the user profile. - // - // LastName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SsoUserProfileDetails's - // String and GoString methods. - LastName *string `locationName:"lastName" type:"string" sensitive:"true"` - - // The username included in the single sign-on details of the user profile. - // - // Username is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SsoUserProfileDetails's - // String and GoString methods. - Username *string `locationName:"username" min:"1" type:"string" sensitive:"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 SsoUserProfileDetails) 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 SsoUserProfileDetails) GoString() string { - return s.String() -} - -// SetFirstName sets the FirstName field's value. -func (s *SsoUserProfileDetails) SetFirstName(v string) *SsoUserProfileDetails { - s.FirstName = &v - return s -} - -// SetLastName sets the LastName field's value. -func (s *SsoUserProfileDetails) SetLastName(v string) *SsoUserProfileDetails { - s.LastName = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *SsoUserProfileDetails) SetUsername(v string) *SsoUserProfileDetails { - s.Username = &v - return s -} - -type StartDataSourceRunInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The identifier of the data source. - // - // DataSourceIdentifier is a required field - DataSourceIdentifier *string `location:"uri" locationName:"dataSourceIdentifier" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which to start a data source - // run. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" 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 StartDataSourceRunInput) 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 StartDataSourceRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartDataSourceRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartDataSourceRunInput"} - if s.DataSourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceIdentifier")) - } - if s.DataSourceIdentifier != nil && len(*s.DataSourceIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceIdentifier", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartDataSourceRunInput) SetClientToken(v string) *StartDataSourceRunInput { - s.ClientToken = &v - return s -} - -// SetDataSourceIdentifier sets the DataSourceIdentifier field's value. -func (s *StartDataSourceRunInput) SetDataSourceIdentifier(v string) *StartDataSourceRunInput { - s.DataSourceIdentifier = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *StartDataSourceRunInput) SetDomainIdentifier(v string) *StartDataSourceRunInput { - s.DomainIdentifier = &v - return s -} - -type StartDataSourceRunOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when data source run was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The configuration snapshot of the data source that is being run. - DataSourceConfigurationSnapshot *string `locationName:"dataSourceConfigurationSnapshot" type:"string"` - - // The identifier of the data source. - // - // DataSourceId is a required field - DataSourceId *string `locationName:"dataSourceId" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which to start a data source - // run. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - ErrorMessage *DataSourceErrorMessage `locationName:"errorMessage" type:"structure"` - - // The identifier of the data source run. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The identifier of the project. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // Specifies run statistics for assets. - RunStatisticsForAssets *RunStatisticsForAssets `locationName:"runStatisticsForAssets" type:"structure"` - - // The timestamp of when the data source run was started. - StartedAt *time.Time `locationName:"startedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The status of the data source run. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSourceRunStatus"` - - // The timestamp of when the data source run was stopped. - StoppedAt *time.Time `locationName:"stoppedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The type of the data source run. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"DataSourceRunType"` - - // The timestamp of when the data source run was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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 StartDataSourceRunOutput) 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 StartDataSourceRunOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *StartDataSourceRunOutput) SetCreatedAt(v time.Time) *StartDataSourceRunOutput { - s.CreatedAt = &v - return s -} - -// SetDataSourceConfigurationSnapshot sets the DataSourceConfigurationSnapshot field's value. -func (s *StartDataSourceRunOutput) SetDataSourceConfigurationSnapshot(v string) *StartDataSourceRunOutput { - s.DataSourceConfigurationSnapshot = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *StartDataSourceRunOutput) SetDataSourceId(v string) *StartDataSourceRunOutput { - s.DataSourceId = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *StartDataSourceRunOutput) SetDomainId(v string) *StartDataSourceRunOutput { - s.DomainId = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *StartDataSourceRunOutput) SetErrorMessage(v *DataSourceErrorMessage) *StartDataSourceRunOutput { - s.ErrorMessage = v - return s -} - -// SetId sets the Id field's value. -func (s *StartDataSourceRunOutput) SetId(v string) *StartDataSourceRunOutput { - s.Id = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *StartDataSourceRunOutput) SetProjectId(v string) *StartDataSourceRunOutput { - s.ProjectId = &v - return s -} - -// SetRunStatisticsForAssets sets the RunStatisticsForAssets field's value. -func (s *StartDataSourceRunOutput) SetRunStatisticsForAssets(v *RunStatisticsForAssets) *StartDataSourceRunOutput { - s.RunStatisticsForAssets = v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *StartDataSourceRunOutput) SetStartedAt(v time.Time) *StartDataSourceRunOutput { - s.StartedAt = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartDataSourceRunOutput) SetStatus(v string) *StartDataSourceRunOutput { - s.Status = &v - return s -} - -// SetStoppedAt sets the StoppedAt field's value. -func (s *StartDataSourceRunOutput) SetStoppedAt(v time.Time) *StartDataSourceRunOutput { - s.StoppedAt = &v - return s -} - -// SetType sets the Type field's value. -func (s *StartDataSourceRunOutput) SetType(v string) *StartDataSourceRunOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *StartDataSourceRunOutput) SetUpdatedAt(v time.Time) *StartDataSourceRunOutput { - s.UpdatedAt = &v - return s -} - -// The details of the asset for which the subscription grant is created. -type SubscribedAsset struct { - _ struct{} `type:"structure"` - - // The identifier of the asset for which the subscription grant is created. - // - // AssetId is a required field - AssetId *string `locationName:"assetId" type:"string" required:"true"` - - // The revision of the asset for which the subscription grant is created. - // - // AssetRevision is a required field - AssetRevision *string `locationName:"assetRevision" min:"1" type:"string" required:"true"` - - // The failure cause included in the details of the asset for which the subscription - // grant is created. - FailureCause *FailureCause `locationName:"failureCause" type:"structure"` - - // The failure timestamp included in the details of the asset for which the - // subscription grant is created. - FailureTimestamp *time.Time `locationName:"failureTimestamp" type:"timestamp"` - - // The timestamp of when the subscription grant to the asset is created. - GrantedTimestamp *time.Time `locationName:"grantedTimestamp" type:"timestamp"` - - // The status of the asset for which the subscription grant is created. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionGrantStatus"` - - // The target name of the asset for which the subscription grant is created. - TargetName *string `locationName:"targetName" 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 SubscribedAsset) 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 SubscribedAsset) GoString() string { - return s.String() -} - -// SetAssetId sets the AssetId field's value. -func (s *SubscribedAsset) SetAssetId(v string) *SubscribedAsset { - s.AssetId = &v - return s -} - -// SetAssetRevision sets the AssetRevision field's value. -func (s *SubscribedAsset) SetAssetRevision(v string) *SubscribedAsset { - s.AssetRevision = &v - return s -} - -// SetFailureCause sets the FailureCause field's value. -func (s *SubscribedAsset) SetFailureCause(v *FailureCause) *SubscribedAsset { - s.FailureCause = v - return s -} - -// SetFailureTimestamp sets the FailureTimestamp field's value. -func (s *SubscribedAsset) SetFailureTimestamp(v time.Time) *SubscribedAsset { - s.FailureTimestamp = &v - return s -} - -// SetGrantedTimestamp sets the GrantedTimestamp field's value. -func (s *SubscribedAsset) SetGrantedTimestamp(v time.Time) *SubscribedAsset { - s.GrantedTimestamp = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SubscribedAsset) SetStatus(v string) *SubscribedAsset { - s.Status = &v - return s -} - -// SetTargetName sets the TargetName field's value. -func (s *SubscribedAsset) SetTargetName(v string) *SubscribedAsset { - s.TargetName = &v - return s -} - -// The details of the published asset for which the subscription grant is created. -type SubscribedAssetListing struct { - _ struct{} `type:"structure"` - - // The identifier of the published asset for which the subscription grant is - // created. - EntityId *string `locationName:"entityId" type:"string"` - - // The revision of the published asset for which the subscription grant is created. - EntityRevision *string `locationName:"entityRevision" min:"1" type:"string"` - - // The type of the published asset for which the subscription grant is created. - EntityType *string `locationName:"entityType" min:"1" type:"string"` - - // The forms attached to the published asset for which the subscription grant - // is created. - Forms *string `locationName:"forms" type:"string"` - - // The glossary terms attached to the published asset for which the subscription - // grant is created. - GlossaryTerms []*DetailedGlossaryTerm `locationName:"glossaryTerms" type:"list"` -} - -// 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 SubscribedAssetListing) 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 SubscribedAssetListing) GoString() string { - return s.String() -} - -// SetEntityId sets the EntityId field's value. -func (s *SubscribedAssetListing) SetEntityId(v string) *SubscribedAssetListing { - s.EntityId = &v - return s -} - -// SetEntityRevision sets the EntityRevision field's value. -func (s *SubscribedAssetListing) SetEntityRevision(v string) *SubscribedAssetListing { - s.EntityRevision = &v - return s -} - -// SetEntityType sets the EntityType field's value. -func (s *SubscribedAssetListing) SetEntityType(v string) *SubscribedAssetListing { - s.EntityType = &v - return s -} - -// SetForms sets the Forms field's value. -func (s *SubscribedAssetListing) SetForms(v string) *SubscribedAssetListing { - s.Forms = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *SubscribedAssetListing) SetGlossaryTerms(v []*DetailedGlossaryTerm) *SubscribedAssetListing { - s.GlossaryTerms = v - return s -} - -// The details of the published asset for which the subscription grant is created. -type SubscribedListing struct { - _ struct{} `type:"structure"` - - // The description of the published asset for which the subscription grant is - // created. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SubscribedListing's - // String and GoString methods. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true" sensitive:"true"` - - // The identifier of the published asset for which the subscription grant is - // created. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The published asset for which the subscription grant is created. - // - // Item is a required field - Item *SubscribedListingItem `locationName:"item" type:"structure" required:"true"` - - // The name of the published asset for which the subscription grant is created. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The identifier of the project of the published asset for which the subscription - // grant is created. - // - // OwnerProjectId is a required field - OwnerProjectId *string `locationName:"ownerProjectId" type:"string" required:"true"` - - // The name of the project that owns the published asset for which the subscription - // grant is created. - OwnerProjectName *string `locationName:"ownerProjectName" type:"string"` - - // The revision of the published asset for which the subscription grant is created. - Revision *string `locationName:"revision" min:"1" 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 SubscribedListing) 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 SubscribedListing) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SubscribedListing) SetDescription(v string) *SubscribedListing { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *SubscribedListing) SetId(v string) *SubscribedListing { - s.Id = &v - return s -} - -// SetItem sets the Item field's value. -func (s *SubscribedListing) SetItem(v *SubscribedListingItem) *SubscribedListing { - s.Item = v - return s -} - -// SetName sets the Name field's value. -func (s *SubscribedListing) SetName(v string) *SubscribedListing { - s.Name = &v - return s -} - -// SetOwnerProjectId sets the OwnerProjectId field's value. -func (s *SubscribedListing) SetOwnerProjectId(v string) *SubscribedListing { - s.OwnerProjectId = &v - return s -} - -// SetOwnerProjectName sets the OwnerProjectName field's value. -func (s *SubscribedListing) SetOwnerProjectName(v string) *SubscribedListing { - s.OwnerProjectName = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *SubscribedListing) SetRevision(v string) *SubscribedListing { - s.Revision = &v - return s -} - -// The published asset for which the subscription grant is to be created. -type SubscribedListingInput_ struct { - _ struct{} `type:"structure"` - - // The identifier of the published asset for which the subscription grant is - // to be created. - // - // Identifier is a required field - Identifier *string `locationName:"identifier" 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 SubscribedListingInput_) 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 SubscribedListingInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SubscribedListingInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SubscribedListingInput_"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *SubscribedListingInput_) SetIdentifier(v string) *SubscribedListingInput_ { - s.Identifier = &v - return s -} - -// The published asset for which the subscription grant is created. -type SubscribedListingItem struct { - _ struct{} `type:"structure"` - - // The asset for which the subscription grant is created. - AssetListing *SubscribedAssetListing `locationName:"assetListing" 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 SubscribedListingItem) 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 SubscribedListingItem) GoString() string { - return s.String() -} - -// SetAssetListing sets the AssetListing field's value. -func (s *SubscribedListingItem) SetAssetListing(v *SubscribedAssetListing) *SubscribedListingItem { - s.AssetListing = v - return s -} - -// The principal that has the subscription grant for the asset. -type SubscribedPrincipal struct { - _ struct{} `type:"structure"` - - // The project that has the subscription grant. - Project *SubscribedProject `locationName:"project" 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 SubscribedPrincipal) 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 SubscribedPrincipal) GoString() string { - return s.String() -} - -// SetProject sets the Project field's value. -func (s *SubscribedPrincipal) SetProject(v *SubscribedProject) *SubscribedPrincipal { - s.Project = v - return s -} - -// The principal that is to be given a subscriptiong grant. -type SubscribedPrincipalInput_ struct { - _ struct{} `type:"structure"` - - // The project that is to be given a subscription grant. - Project *SubscribedProjectInput_ `locationName:"project" 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 SubscribedPrincipalInput_) 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 SubscribedPrincipalInput_) GoString() string { - return s.String() -} - -// SetProject sets the Project field's value. -func (s *SubscribedPrincipalInput_) SetProject(v *SubscribedProjectInput_) *SubscribedPrincipalInput_ { - s.Project = v - return s -} - -// The project that has the subscription grant. -type SubscribedProject struct { - _ struct{} `type:"structure"` - - // The identifier of the project that has the subscription grant. - Id *string `locationName:"id" type:"string"` - - // The name of the project that has the subscription grant. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SubscribedProject's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"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 SubscribedProject) 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 SubscribedProject) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *SubscribedProject) SetId(v string) *SubscribedProject { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *SubscribedProject) SetName(v string) *SubscribedProject { - s.Name = &v - return s -} - -// The project that is to be given a subscription grant. -type SubscribedProjectInput_ struct { - _ struct{} `type:"structure"` - - // The identifier of the project that is to be given a subscription grant. - Identifier *string `locationName:"identifier" 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 SubscribedProjectInput_) 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 SubscribedProjectInput_) GoString() string { - return s.String() -} - -// SetIdentifier sets the Identifier field's value. -func (s *SubscribedProjectInput_) SetIdentifier(v string) *SubscribedProjectInput_ { - s.Identifier = &v - return s -} - -// The details of the subscription grant. -type SubscriptionGrantSummary struct { - _ struct{} `type:"structure"` - - // The assets included in the subscription grant. - Assets []*SubscribedAsset `locationName:"assets" type:"list"` - - // The timestamp of when a subscription grant was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The datazone user who created the subscription grant. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which a subscription grant - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The entity to which the subscription is granted. - // - // GrantedEntity is a required field - GrantedEntity *GrantedEntity `locationName:"grantedEntity" type:"structure" required:"true"` - - // The identifier of the subscription grant. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The status of the subscription grant. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionGrantOverallStatus"` - - // The ID of the subscription grant. - SubscriptionId *string `locationName:"subscriptionId" type:"string"` - - // The identifier of the target of the subscription grant. - // - // SubscriptionTargetId is a required field - SubscriptionTargetId *string `locationName:"subscriptionTargetId" type:"string" required:"true"` - - // The timestampf of when the subscription grant was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription grant. - UpdatedBy *string `locationName:"updatedBy" 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 SubscriptionGrantSummary) 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 SubscriptionGrantSummary) GoString() string { - return s.String() -} - -// SetAssets sets the Assets field's value. -func (s *SubscriptionGrantSummary) SetAssets(v []*SubscribedAsset) *SubscriptionGrantSummary { - s.Assets = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SubscriptionGrantSummary) SetCreatedAt(v time.Time) *SubscriptionGrantSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *SubscriptionGrantSummary) SetCreatedBy(v string) *SubscriptionGrantSummary { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *SubscriptionGrantSummary) SetDomainId(v string) *SubscriptionGrantSummary { - s.DomainId = &v - return s -} - -// SetGrantedEntity sets the GrantedEntity field's value. -func (s *SubscriptionGrantSummary) SetGrantedEntity(v *GrantedEntity) *SubscriptionGrantSummary { - s.GrantedEntity = v - return s -} - -// SetId sets the Id field's value. -func (s *SubscriptionGrantSummary) SetId(v string) *SubscriptionGrantSummary { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SubscriptionGrantSummary) SetStatus(v string) *SubscriptionGrantSummary { - s.Status = &v - return s -} - -// SetSubscriptionId sets the SubscriptionId field's value. -func (s *SubscriptionGrantSummary) SetSubscriptionId(v string) *SubscriptionGrantSummary { - s.SubscriptionId = &v - return s -} - -// SetSubscriptionTargetId sets the SubscriptionTargetId field's value. -func (s *SubscriptionGrantSummary) SetSubscriptionTargetId(v string) *SubscriptionGrantSummary { - s.SubscriptionTargetId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SubscriptionGrantSummary) SetUpdatedAt(v time.Time) *SubscriptionGrantSummary { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *SubscriptionGrantSummary) SetUpdatedBy(v string) *SubscriptionGrantSummary { - s.UpdatedBy = &v - return s -} - -// The details of the subscription request. -type SubscriptionRequestSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when a subscription request was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription request. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The decision comment of the subscription request. - // - // DecisionComment is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SubscriptionRequestSummary's - // String and GoString methods. - DecisionComment *string `locationName:"decisionComment" min:"1" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which a subscription request - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the subscription request. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The reason for the subscription request. - // - // RequestReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SubscriptionRequestSummary's - // String and GoString methods. - // - // RequestReason is a required field - RequestReason *string `locationName:"requestReason" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the subscription request reviewer. - ReviewerId *string `locationName:"reviewerId" type:"string"` - - // The status of the subscription request. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionRequestStatus"` - - // The listings included in the subscription request. - // - // SubscribedListings is a required field - SubscribedListings []*SubscribedListing `locationName:"subscribedListings" min:"1" type:"list" required:"true"` - - // The principals included in the subscription request. - // - // SubscribedPrincipals is a required field - SubscribedPrincipals []*SubscribedPrincipal `locationName:"subscribedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when the subscription request was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The identifier of the Amazon DataZone user who updated the subscription request. - UpdatedBy *string `locationName:"updatedBy" 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 SubscriptionRequestSummary) 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 SubscriptionRequestSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SubscriptionRequestSummary) SetCreatedAt(v time.Time) *SubscriptionRequestSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *SubscriptionRequestSummary) SetCreatedBy(v string) *SubscriptionRequestSummary { - s.CreatedBy = &v - return s -} - -// SetDecisionComment sets the DecisionComment field's value. -func (s *SubscriptionRequestSummary) SetDecisionComment(v string) *SubscriptionRequestSummary { - s.DecisionComment = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *SubscriptionRequestSummary) SetDomainId(v string) *SubscriptionRequestSummary { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *SubscriptionRequestSummary) SetId(v string) *SubscriptionRequestSummary { - s.Id = &v - return s -} - -// SetRequestReason sets the RequestReason field's value. -func (s *SubscriptionRequestSummary) SetRequestReason(v string) *SubscriptionRequestSummary { - s.RequestReason = &v - return s -} - -// SetReviewerId sets the ReviewerId field's value. -func (s *SubscriptionRequestSummary) SetReviewerId(v string) *SubscriptionRequestSummary { - s.ReviewerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SubscriptionRequestSummary) SetStatus(v string) *SubscriptionRequestSummary { - s.Status = &v - return s -} - -// SetSubscribedListings sets the SubscribedListings field's value. -func (s *SubscriptionRequestSummary) SetSubscribedListings(v []*SubscribedListing) *SubscriptionRequestSummary { - s.SubscribedListings = v - return s -} - -// SetSubscribedPrincipals sets the SubscribedPrincipals field's value. -func (s *SubscriptionRequestSummary) SetSubscribedPrincipals(v []*SubscribedPrincipal) *SubscriptionRequestSummary { - s.SubscribedPrincipals = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SubscriptionRequestSummary) SetUpdatedAt(v time.Time) *SubscriptionRequestSummary { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *SubscriptionRequestSummary) SetUpdatedBy(v string) *SubscriptionRequestSummary { - s.UpdatedBy = &v - return s -} - -// The details of the subscription. -type SubscriptionSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when the subscription was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which a subscription exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the subscription. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The retain permissions included in the subscription. - RetainPermissions *bool `locationName:"retainPermissions" type:"boolean"` - - // The status of the subscription. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionStatus"` - - // The listing included in the subscription. - // - // SubscribedListing is a required field - SubscribedListing *SubscribedListing `locationName:"subscribedListing" type:"structure" required:"true"` - - // The principal included in the subscription. - // - // SubscribedPrincipal is a required field - SubscribedPrincipal *SubscribedPrincipal `locationName:"subscribedPrincipal" type:"structure" required:"true"` - - // The identifier of the subscription request for the subscription. - SubscriptionRequestId *string `locationName:"subscriptionRequestId" type:"string"` - - // The timestamp of when the subscription was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription. - UpdatedBy *string `locationName:"updatedBy" 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 SubscriptionSummary) 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 SubscriptionSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SubscriptionSummary) SetCreatedAt(v time.Time) *SubscriptionSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *SubscriptionSummary) SetCreatedBy(v string) *SubscriptionSummary { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *SubscriptionSummary) SetDomainId(v string) *SubscriptionSummary { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *SubscriptionSummary) SetId(v string) *SubscriptionSummary { - s.Id = &v - return s -} - -// SetRetainPermissions sets the RetainPermissions field's value. -func (s *SubscriptionSummary) SetRetainPermissions(v bool) *SubscriptionSummary { - s.RetainPermissions = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SubscriptionSummary) SetStatus(v string) *SubscriptionSummary { - s.Status = &v - return s -} - -// SetSubscribedListing sets the SubscribedListing field's value. -func (s *SubscriptionSummary) SetSubscribedListing(v *SubscribedListing) *SubscriptionSummary { - s.SubscribedListing = v - return s -} - -// SetSubscribedPrincipal sets the SubscribedPrincipal field's value. -func (s *SubscriptionSummary) SetSubscribedPrincipal(v *SubscribedPrincipal) *SubscriptionSummary { - s.SubscribedPrincipal = v - return s -} - -// SetSubscriptionRequestId sets the SubscriptionRequestId field's value. -func (s *SubscriptionSummary) SetSubscriptionRequestId(v string) *SubscriptionSummary { - s.SubscriptionRequestId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SubscriptionSummary) SetUpdatedAt(v time.Time) *SubscriptionSummary { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *SubscriptionSummary) SetUpdatedBy(v string) *SubscriptionSummary { - s.UpdatedBy = &v - return s -} - -// The details of the subscription target configuration. -type SubscriptionTargetForm struct { - _ struct{} `type:"structure"` - - // The content of the subscription target configuration. - // - // Content is a required field - Content *string `locationName:"content" type:"string" required:"true"` - - // The form name included in the subscription target configuration. - // - // FormName is a required field - FormName *string `locationName:"formName" min:"1" 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 SubscriptionTargetForm) 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 SubscriptionTargetForm) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SubscriptionTargetForm) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SubscriptionTargetForm"} - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.FormName == nil { - invalidParams.Add(request.NewErrParamRequired("FormName")) - } - if s.FormName != nil && len(*s.FormName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FormName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *SubscriptionTargetForm) SetContent(v string) *SubscriptionTargetForm { - s.Content = &v - return s -} - -// SetFormName sets the FormName field's value. -func (s *SubscriptionTargetForm) SetFormName(v string) *SubscriptionTargetForm { - s.FormName = &v - return s -} - -// The details of the subscription target. -type SubscriptionTargetSummary struct { - _ struct{} `type:"structure"` - - // The asset types included in the subscription target. - // - // ApplicableAssetTypes is a required field - ApplicableAssetTypes []*string `locationName:"applicableAssetTypes" type:"list" required:"true"` - - // The authorized principals included in the subscription target. - // - // AuthorizedPrincipals is a required field - AuthorizedPrincipals []*string `locationName:"authorizedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when the subscription target was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription target. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which the subscription target - // exists. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the environment of the subscription target. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // The identifier of the subscription target. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The manage access role specified in the subscription target. - // - // ManageAccessRole is a required field - ManageAccessRole *string `locationName:"manageAccessRole" type:"string" required:"true"` - - // The name of the subscription target. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SubscriptionTargetSummary's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the project specified in the subscription target. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The provider of the subscription target. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The configuration of the subscription target. - // - // SubscriptionTargetConfig is a required field - SubscriptionTargetConfig []*SubscriptionTargetForm `locationName:"subscriptionTargetConfig" type:"list" required:"true"` - - // The type of the subscription target. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true"` - - // The timestamp of when the subscription target was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the subscription target. - UpdatedBy *string `locationName:"updatedBy" 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 SubscriptionTargetSummary) 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 SubscriptionTargetSummary) GoString() string { - return s.String() -} - -// SetApplicableAssetTypes sets the ApplicableAssetTypes field's value. -func (s *SubscriptionTargetSummary) SetApplicableAssetTypes(v []*string) *SubscriptionTargetSummary { - s.ApplicableAssetTypes = v - return s -} - -// SetAuthorizedPrincipals sets the AuthorizedPrincipals field's value. -func (s *SubscriptionTargetSummary) SetAuthorizedPrincipals(v []*string) *SubscriptionTargetSummary { - s.AuthorizedPrincipals = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SubscriptionTargetSummary) SetCreatedAt(v time.Time) *SubscriptionTargetSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *SubscriptionTargetSummary) SetCreatedBy(v string) *SubscriptionTargetSummary { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *SubscriptionTargetSummary) SetDomainId(v string) *SubscriptionTargetSummary { - s.DomainId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *SubscriptionTargetSummary) SetEnvironmentId(v string) *SubscriptionTargetSummary { - s.EnvironmentId = &v - return s -} - -// SetId sets the Id field's value. -func (s *SubscriptionTargetSummary) SetId(v string) *SubscriptionTargetSummary { - s.Id = &v - return s -} - -// SetManageAccessRole sets the ManageAccessRole field's value. -func (s *SubscriptionTargetSummary) SetManageAccessRole(v string) *SubscriptionTargetSummary { - s.ManageAccessRole = &v - return s -} - -// SetName sets the Name field's value. -func (s *SubscriptionTargetSummary) SetName(v string) *SubscriptionTargetSummary { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *SubscriptionTargetSummary) SetProjectId(v string) *SubscriptionTargetSummary { - s.ProjectId = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *SubscriptionTargetSummary) SetProvider(v string) *SubscriptionTargetSummary { - s.Provider = &v - return s -} - -// SetSubscriptionTargetConfig sets the SubscriptionTargetConfig field's value. -func (s *SubscriptionTargetSummary) SetSubscriptionTargetConfig(v []*SubscriptionTargetForm) *SubscriptionTargetSummary { - s.SubscriptionTargetConfig = v - return s -} - -// SetType sets the Type field's value. -func (s *SubscriptionTargetSummary) SetType(v string) *SubscriptionTargetSummary { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SubscriptionTargetSummary) SetUpdatedAt(v time.Time) *SubscriptionTargetSummary { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *SubscriptionTargetSummary) SetUpdatedBy(v string) *SubscriptionTargetSummary { - s.UpdatedBy = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource to be tagged in Amazon DataZone. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // Specifies the tags for the TagResource action. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The details of the term relations. -type TermRelations struct { - _ struct{} `type:"structure"` - - // The classifies of the term relations. - Classifies []*string `locationName:"classifies" min:"1" type:"list"` - - // The isA property of the term relations. - IsA []*string `locationName:"isA" min:"1" type:"list"` -} - -// 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 TermRelations) 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 TermRelations) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TermRelations) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TermRelations"} - if s.Classifies != nil && len(s.Classifies) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Classifies", 1)) - } - if s.IsA != nil && len(s.IsA) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IsA", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClassifies sets the Classifies field's value. -func (s *TermRelations) SetClassifies(v []*string) *TermRelations { - s.Classifies = v - return s -} - -// SetIsA sets the IsA field's value. -func (s *TermRelations) SetIsA(v []*string) *TermRelations { - s.IsA = v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The topic of the notification. -type Topic struct { - _ struct{} `type:"structure"` - - // The details of the resource mentioned in a notification. - // - // Resource is a required field - Resource *NotificationResource `locationName:"resource" type:"structure" required:"true"` - - // The role of the resource mentioned in a notification. - // - // Role is a required field - Role *string `locationName:"role" type:"string" required:"true" enum:"NotificationRole"` - - // The subject of the resource mentioned in a notification. - // - // Subject is a required field - Subject *string `locationName:"subject" 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 Topic) 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 Topic) GoString() string { - return s.String() -} - -// SetResource sets the Resource field's value. -func (s *Topic) SetResource(v *NotificationResource) *Topic { - s.Resource = v - return s -} - -// SetRole sets the Role field's value. -func (s *Topic) SetRole(v string) *Topic { - s.Role = &v - return s -} - -// SetSubject sets the Subject field's value. -func (s *Topic) SetSubject(v string) *Topic { - s.Subject = &v - return s -} - -// You do not have permission to perform this action. -type UnauthorizedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 UnauthorizedException) 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 UnauthorizedException) GoString() string { - return s.String() -} - -func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { - return &UnauthorizedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnauthorizedException) Code() string { - return "UnauthorizedException" -} - -// Message returns the exception's message. -func (s *UnauthorizedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnauthorizedException) OrigErr() error { - return nil -} - -func (s *UnauthorizedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnauthorizedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnauthorizedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource to be untagged in Amazon DataZone. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // Specifies the tag keys for the UntagResource action. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateDataSourceInput struct { - _ struct{} `type:"structure"` - - // The asset forms to be updated as part of the UpdateDataSource action. - // - // AssetFormsInput is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateDataSourceInput's - // String and GoString methods. - AssetFormsInput []*FormInput_ `locationName:"assetFormsInput" type:"list" sensitive:"true"` - - // The configuration to be updated as part of the UpdateDataSource action. - Configuration *DataSourceConfigurationInput_ `locationName:"configuration" type:"structure"` - - // The description to be updated as part of the UpdateDataSource action. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateDataSourceInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the domain in which to update a data source. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The enable setting to be updated as part of the UpdateDataSource action. - EnableSetting *string `locationName:"enableSetting" type:"string" enum:"EnableSetting"` - - // The identifier of the data source to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The name to be updated as part of the UpdateDataSource action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateDataSourceInput's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"true"` - - // The publish on import setting to be updated as part of the UpdateDataSource - // action. - PublishOnImport *bool `locationName:"publishOnImport" type:"boolean"` - - // The recommendation to be updated as part of the UpdateDataSource action. - Recommendation *RecommendationConfiguration `locationName:"recommendation" type:"structure"` - - // The schedule to be updated as part of the UpdateDataSource action. - // - // Schedule is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateDataSourceInput's - // String and GoString methods. - Schedule *ScheduleConfiguration `locationName:"schedule" type:"structure" sensitive:"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 UpdateDataSourceInput) 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 UpdateDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDataSourceInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.AssetFormsInput != nil { - for i, v := range s.AssetFormsInput { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AssetFormsInput", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - if s.Schedule != nil { - if err := s.Schedule.Validate(); err != nil { - invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssetFormsInput sets the AssetFormsInput field's value. -func (s *UpdateDataSourceInput) SetAssetFormsInput(v []*FormInput_) *UpdateDataSourceInput { - s.AssetFormsInput = v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *UpdateDataSourceInput) SetConfiguration(v *DataSourceConfigurationInput_) *UpdateDataSourceInput { - s.Configuration = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateDataSourceInput) SetDescription(v string) *UpdateDataSourceInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateDataSourceInput) SetDomainIdentifier(v string) *UpdateDataSourceInput { - s.DomainIdentifier = &v - return s -} - -// SetEnableSetting sets the EnableSetting field's value. -func (s *UpdateDataSourceInput) SetEnableSetting(v string) *UpdateDataSourceInput { - s.EnableSetting = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateDataSourceInput) SetIdentifier(v string) *UpdateDataSourceInput { - s.Identifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDataSourceInput) SetName(v string) *UpdateDataSourceInput { - s.Name = &v - return s -} - -// SetPublishOnImport sets the PublishOnImport field's value. -func (s *UpdateDataSourceInput) SetPublishOnImport(v bool) *UpdateDataSourceInput { - s.PublishOnImport = &v - return s -} - -// SetRecommendation sets the Recommendation field's value. -func (s *UpdateDataSourceInput) SetRecommendation(v *RecommendationConfiguration) *UpdateDataSourceInput { - s.Recommendation = v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *UpdateDataSourceInput) SetSchedule(v *ScheduleConfiguration) *UpdateDataSourceInput { - s.Schedule = v - return s -} - -type UpdateDataSourceOutput struct { - _ struct{} `type:"structure"` - - // The asset forms to be updated as part of the UpdateDataSource action. - AssetFormsOutput []*FormOutput_ `locationName:"assetFormsOutput" type:"list"` - - // The configuration to be updated as part of the UpdateDataSource action. - Configuration *DataSourceConfigurationOutput_ `locationName:"configuration" type:"structure"` - - // The timestamp of when the data source was updated. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The description to be updated as part of the UpdateDataSource action. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateDataSourceOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which a data source is to - // be updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The enable setting to be updated as part of the UpdateDataSource action. - EnableSetting *string `locationName:"enableSetting" type:"string" enum:"EnableSetting"` - - // The identifier of the environment in which a data source is to be updated. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - ErrorMessage *DataSourceErrorMessage `locationName:"errorMessage" type:"structure"` - - // The identifier of the data source to be updated. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The timestamp of when the data source was last run. - LastRunAt *time.Time `locationName:"lastRunAt" type:"timestamp" timestampFormat:"iso8601"` - - // The last run error message of the data source. - LastRunErrorMessage *DataSourceErrorMessage `locationName:"lastRunErrorMessage" type:"structure"` - - // The last run status of the data source. - LastRunStatus *string `locationName:"lastRunStatus" type:"string" enum:"DataSourceRunStatus"` - - // The name to be updated as part of the UpdateDataSource action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateDataSourceOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the project where data source is to be updated. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The publish on import setting to be updated as part of the UpdateDataSource - // action. - PublishOnImport *bool `locationName:"publishOnImport" type:"boolean"` - - // The recommendation to be updated as part of the UpdateDataSource action. - Recommendation *RecommendationConfiguration `locationName:"recommendation" type:"structure"` - - // The schedule to be updated as part of the UpdateDataSource action. - // - // Schedule is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateDataSourceOutput's - // String and GoString methods. - Schedule *ScheduleConfiguration `locationName:"schedule" type:"structure" sensitive:"true"` - - // The status to be updated as part of the UpdateDataSource action. - Status *string `locationName:"status" type:"string" enum:"DataSourceStatus"` - - // The type to be updated as part of the UpdateDataSource action. - Type *string `locationName:"type" min:"1" type:"string"` - - // The timestamp of when the data source was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 UpdateDataSourceOutput) 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 UpdateDataSourceOutput) GoString() string { - return s.String() -} - -// SetAssetFormsOutput sets the AssetFormsOutput field's value. -func (s *UpdateDataSourceOutput) SetAssetFormsOutput(v []*FormOutput_) *UpdateDataSourceOutput { - s.AssetFormsOutput = v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *UpdateDataSourceOutput) SetConfiguration(v *DataSourceConfigurationOutput_) *UpdateDataSourceOutput { - s.Configuration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateDataSourceOutput) SetCreatedAt(v time.Time) *UpdateDataSourceOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateDataSourceOutput) SetDescription(v string) *UpdateDataSourceOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateDataSourceOutput) SetDomainId(v string) *UpdateDataSourceOutput { - s.DomainId = &v - return s -} - -// SetEnableSetting sets the EnableSetting field's value. -func (s *UpdateDataSourceOutput) SetEnableSetting(v string) *UpdateDataSourceOutput { - s.EnableSetting = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *UpdateDataSourceOutput) SetEnvironmentId(v string) *UpdateDataSourceOutput { - s.EnvironmentId = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *UpdateDataSourceOutput) SetErrorMessage(v *DataSourceErrorMessage) *UpdateDataSourceOutput { - s.ErrorMessage = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateDataSourceOutput) SetId(v string) *UpdateDataSourceOutput { - s.Id = &v - return s -} - -// SetLastRunAt sets the LastRunAt field's value. -func (s *UpdateDataSourceOutput) SetLastRunAt(v time.Time) *UpdateDataSourceOutput { - s.LastRunAt = &v - return s -} - -// SetLastRunErrorMessage sets the LastRunErrorMessage field's value. -func (s *UpdateDataSourceOutput) SetLastRunErrorMessage(v *DataSourceErrorMessage) *UpdateDataSourceOutput { - s.LastRunErrorMessage = v - return s -} - -// SetLastRunStatus sets the LastRunStatus field's value. -func (s *UpdateDataSourceOutput) SetLastRunStatus(v string) *UpdateDataSourceOutput { - s.LastRunStatus = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDataSourceOutput) SetName(v string) *UpdateDataSourceOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *UpdateDataSourceOutput) SetProjectId(v string) *UpdateDataSourceOutput { - s.ProjectId = &v - return s -} - -// SetPublishOnImport sets the PublishOnImport field's value. -func (s *UpdateDataSourceOutput) SetPublishOnImport(v bool) *UpdateDataSourceOutput { - s.PublishOnImport = &v - return s -} - -// SetRecommendation sets the Recommendation field's value. -func (s *UpdateDataSourceOutput) SetRecommendation(v *RecommendationConfiguration) *UpdateDataSourceOutput { - s.Recommendation = v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *UpdateDataSourceOutput) SetSchedule(v *ScheduleConfiguration) *UpdateDataSourceOutput { - s.Schedule = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateDataSourceOutput) SetStatus(v string) *UpdateDataSourceOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateDataSourceOutput) SetType(v string) *UpdateDataSourceOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateDataSourceOutput) SetUpdatedAt(v time.Time) *UpdateDataSourceOutput { - s.UpdatedAt = &v - return s -} - -type UpdateDomainInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `location:"querystring" locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The description to be updated as part of the UpdateDomain action. - Description *string `locationName:"description" type:"string"` - - // The domain execution role to be updated as part of the UpdateDomain action. - DomainExecutionRole *string `locationName:"domainExecutionRole" type:"string"` - - // The ID of the Amazon Web Services domain that is to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The name to be updated as part of the UpdateDomain action. - Name *string `locationName:"name" type:"string"` - - // The single sign-on option to be updated as part of the UpdateDomain action. - SingleSignOn *SingleSignOn `locationName:"singleSignOn" 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 UpdateDomainInput) 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 UpdateDomainInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDomainInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDomainInput"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateDomainInput) SetClientToken(v string) *UpdateDomainInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateDomainInput) SetDescription(v string) *UpdateDomainInput { - s.Description = &v - return s -} - -// SetDomainExecutionRole sets the DomainExecutionRole field's value. -func (s *UpdateDomainInput) SetDomainExecutionRole(v string) *UpdateDomainInput { - s.DomainExecutionRole = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateDomainInput) SetIdentifier(v string) *UpdateDomainInput { - s.Identifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDomainInput) SetName(v string) *UpdateDomainInput { - s.Name = &v - return s -} - -// SetSingleSignOn sets the SingleSignOn field's value. -func (s *UpdateDomainInput) SetSingleSignOn(v *SingleSignOn) *UpdateDomainInput { - s.SingleSignOn = v - return s -} - -type UpdateDomainOutput struct { - _ struct{} `type:"structure"` - - // The description to be updated as part of the UpdateDomain action. - Description *string `locationName:"description" type:"string"` - - // The domain execution role to be updated as part of the UpdateDomain action. - DomainExecutionRole *string `locationName:"domainExecutionRole" type:"string"` - - // The identifier of the Amazon DataZone domain. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Specifies the timestamp of when the domain was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` - - // The name to be updated as part of the UpdateDomain action. - Name *string `locationName:"name" type:"string"` - - // The single sign-on option of the Amazon DataZone domain. - SingleSignOn *SingleSignOn `locationName:"singleSignOn" 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 UpdateDomainOutput) 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 UpdateDomainOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *UpdateDomainOutput) SetDescription(v string) *UpdateDomainOutput { - s.Description = &v - return s -} - -// SetDomainExecutionRole sets the DomainExecutionRole field's value. -func (s *UpdateDomainOutput) SetDomainExecutionRole(v string) *UpdateDomainOutput { - s.DomainExecutionRole = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateDomainOutput) SetId(v string) *UpdateDomainOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *UpdateDomainOutput) SetLastUpdatedAt(v time.Time) *UpdateDomainOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDomainOutput) SetName(v string) *UpdateDomainOutput { - s.Name = &v - return s -} - -// SetSingleSignOn sets the SingleSignOn field's value. -func (s *UpdateDomainOutput) SetSingleSignOn(v *SingleSignOn) *UpdateDomainOutput { - s.SingleSignOn = v - return s -} - -type UpdateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // The description to be updated as part of the UpdateEnvironment action. - Description *string `locationName:"description" type:"string"` - - // The identifier of the domain in which the environment is to be updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The glossary terms to be updated as part of the UpdateEnvironment action. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The identifier of the environment that is to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The name to be updated as part of the UpdateEnvironment action. - Name *string `locationName:"name" 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 UpdateEnvironmentInput) 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 UpdateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEnvironmentInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GlossaryTerms != nil && len(s.GlossaryTerms) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GlossaryTerms", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateEnvironmentInput) SetDescription(v string) *UpdateEnvironmentInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateEnvironmentInput) SetDomainIdentifier(v string) *UpdateEnvironmentInput { - s.DomainIdentifier = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *UpdateEnvironmentInput) SetGlossaryTerms(v []*string) *UpdateEnvironmentInput { - s.GlossaryTerms = v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateEnvironmentInput) SetIdentifier(v string) *UpdateEnvironmentInput { - s.Identifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateEnvironmentInput) SetName(v string) *UpdateEnvironmentInput { - s.Name = &v - return s -} - -type UpdateEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Web Services account in which the environment - // is to be updated. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services Region in which the environment is updated. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The timestamp of when the environment was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the environment. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The deployment properties to be updated as part of the UpdateEnvironment - // action. - DeploymentProperties *DeploymentProperties `locationName:"deploymentProperties" type:"structure"` - - // The description to be updated as part of the UpdateEnvironment action. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateEnvironmentOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the domain in which the environment is to be updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The environment actions to be updated as part of the UpdateEnvironment action. - EnvironmentActions []*ConfigurableEnvironmentAction `locationName:"environmentActions" type:"list"` - - // The blueprint identifier of the environment. - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string"` - - // The profile identifier of the environment. - // - // EnvironmentProfileId is a required field - EnvironmentProfileId *string `locationName:"environmentProfileId" type:"string" required:"true"` - - // The glossary terms to be updated as part of the UpdateEnvironment action. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The identifier of the environment that is to be updated. - Id *string `locationName:"id" type:"string"` - - // The last deployment of the environment. - LastDeployment *Deployment `locationName:"lastDeployment" type:"structure"` - - // The name to be updated as part of the UpdateEnvironment action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateEnvironmentOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The project identifier of the environment. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The provider identifier of the environment. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The provisioned resources to be updated as part of the UpdateEnvironment - // action. - ProvisionedResources []*Resource `locationName:"provisionedResources" type:"list"` - - // The provisioning properties to be updated as part of the UpdateEnvironment - // action. - ProvisioningProperties *ProvisioningProperties `locationName:"provisioningProperties" type:"structure"` - - // The status to be updated as part of the UpdateEnvironment action. - Status *string `locationName:"status" type:"string" enum:"EnvironmentStatus"` - - // The timestamp of when the environment was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The user parameters to be updated as part of the UpdateEnvironment action. - UserParameters []*CustomParameter `locationName:"userParameters" type:"list"` -} - -// 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 UpdateEnvironmentOutput) 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 UpdateEnvironmentOutput) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *UpdateEnvironmentOutput) SetAwsAccountId(v string) *UpdateEnvironmentOutput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *UpdateEnvironmentOutput) SetAwsAccountRegion(v string) *UpdateEnvironmentOutput { - s.AwsAccountRegion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateEnvironmentOutput) SetCreatedAt(v time.Time) *UpdateEnvironmentOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *UpdateEnvironmentOutput) SetCreatedBy(v string) *UpdateEnvironmentOutput { - s.CreatedBy = &v - return s -} - -// SetDeploymentProperties sets the DeploymentProperties field's value. -func (s *UpdateEnvironmentOutput) SetDeploymentProperties(v *DeploymentProperties) *UpdateEnvironmentOutput { - s.DeploymentProperties = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateEnvironmentOutput) SetDescription(v string) *UpdateEnvironmentOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateEnvironmentOutput) SetDomainId(v string) *UpdateEnvironmentOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentActions sets the EnvironmentActions field's value. -func (s *UpdateEnvironmentOutput) SetEnvironmentActions(v []*ConfigurableEnvironmentAction) *UpdateEnvironmentOutput { - s.EnvironmentActions = v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *UpdateEnvironmentOutput) SetEnvironmentBlueprintId(v string) *UpdateEnvironmentOutput { - s.EnvironmentBlueprintId = &v - return s -} - -// SetEnvironmentProfileId sets the EnvironmentProfileId field's value. -func (s *UpdateEnvironmentOutput) SetEnvironmentProfileId(v string) *UpdateEnvironmentOutput { - s.EnvironmentProfileId = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *UpdateEnvironmentOutput) SetGlossaryTerms(v []*string) *UpdateEnvironmentOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateEnvironmentOutput) SetId(v string) *UpdateEnvironmentOutput { - s.Id = &v - return s -} - -// SetLastDeployment sets the LastDeployment field's value. -func (s *UpdateEnvironmentOutput) SetLastDeployment(v *Deployment) *UpdateEnvironmentOutput { - s.LastDeployment = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateEnvironmentOutput) SetName(v string) *UpdateEnvironmentOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *UpdateEnvironmentOutput) SetProjectId(v string) *UpdateEnvironmentOutput { - s.ProjectId = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *UpdateEnvironmentOutput) SetProvider(v string) *UpdateEnvironmentOutput { - s.Provider = &v - return s -} - -// SetProvisionedResources sets the ProvisionedResources field's value. -func (s *UpdateEnvironmentOutput) SetProvisionedResources(v []*Resource) *UpdateEnvironmentOutput { - s.ProvisionedResources = v - return s -} - -// SetProvisioningProperties sets the ProvisioningProperties field's value. -func (s *UpdateEnvironmentOutput) SetProvisioningProperties(v *ProvisioningProperties) *UpdateEnvironmentOutput { - s.ProvisioningProperties = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateEnvironmentOutput) SetStatus(v string) *UpdateEnvironmentOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateEnvironmentOutput) SetUpdatedAt(v time.Time) *UpdateEnvironmentOutput { - s.UpdatedAt = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *UpdateEnvironmentOutput) SetUserParameters(v []*CustomParameter) *UpdateEnvironmentOutput { - s.UserParameters = v - return s -} - -type UpdateEnvironmentProfileInput struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account in which a specified environment profile - // is to be udpated. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services Region in which a specified environment profile is - // to be updated. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The description to be updated as part of the UpdateEnvironmentProfile action. - Description *string `locationName:"description" type:"string"` - - // The identifier of the Amazon DataZone domain in which an environment profile - // is to be updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the environment profile that is to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The name to be updated as part of the UpdateEnvironmentProfile action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateEnvironmentProfileInput's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"true"` - - // The user parameters to be updated as part of the UpdateEnvironmentProfile - // action. - UserParameters []*EnvironmentParameter `locationName:"userParameters" type:"list"` -} - -// 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 UpdateEnvironmentProfileInput) 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 UpdateEnvironmentProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEnvironmentProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEnvironmentProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *UpdateEnvironmentProfileInput) SetAwsAccountId(v string) *UpdateEnvironmentProfileInput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *UpdateEnvironmentProfileInput) SetAwsAccountRegion(v string) *UpdateEnvironmentProfileInput { - s.AwsAccountRegion = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateEnvironmentProfileInput) SetDescription(v string) *UpdateEnvironmentProfileInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateEnvironmentProfileInput) SetDomainIdentifier(v string) *UpdateEnvironmentProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateEnvironmentProfileInput) SetIdentifier(v string) *UpdateEnvironmentProfileInput { - s.Identifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateEnvironmentProfileInput) SetName(v string) *UpdateEnvironmentProfileInput { - s.Name = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *UpdateEnvironmentProfileInput) SetUserParameters(v []*EnvironmentParameter) *UpdateEnvironmentProfileInput { - s.UserParameters = v - return s -} - -type UpdateEnvironmentProfileOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account in which a specified environment profile - // is to be udpated. - AwsAccountId *string `locationName:"awsAccountId" type:"string"` - - // The Amazon Web Services Region in which a specified environment profile is - // to be updated. - AwsAccountRegion *string `locationName:"awsAccountRegion" type:"string"` - - // The timestamp of when the environment profile was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the environment profile. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description to be updated as part of the UpdateEnvironmentProfile action. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateEnvironmentProfileOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which the environment profile - // is to be updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the blueprint of the environment profile that is to be - // updated. - // - // EnvironmentBlueprintId is a required field - EnvironmentBlueprintId *string `locationName:"environmentBlueprintId" type:"string" required:"true"` - - // The identifier of the environment profile that is to be udpated. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name to be updated as part of the UpdateEnvironmentProfile action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateEnvironmentProfileOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the project of the environment profile that is to be updated. - ProjectId *string `locationName:"projectId" type:"string"` - - // The timestamp of when the environment profile was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The user parameters to be updated as part of the UpdateEnvironmentProfile - // action. - UserParameters []*CustomParameter `locationName:"userParameters" type:"list"` -} - -// 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 UpdateEnvironmentProfileOutput) 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 UpdateEnvironmentProfileOutput) GoString() string { - return s.String() -} - -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *UpdateEnvironmentProfileOutput) SetAwsAccountId(v string) *UpdateEnvironmentProfileOutput { - s.AwsAccountId = &v - return s -} - -// SetAwsAccountRegion sets the AwsAccountRegion field's value. -func (s *UpdateEnvironmentProfileOutput) SetAwsAccountRegion(v string) *UpdateEnvironmentProfileOutput { - s.AwsAccountRegion = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateEnvironmentProfileOutput) SetCreatedAt(v time.Time) *UpdateEnvironmentProfileOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *UpdateEnvironmentProfileOutput) SetCreatedBy(v string) *UpdateEnvironmentProfileOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateEnvironmentProfileOutput) SetDescription(v string) *UpdateEnvironmentProfileOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateEnvironmentProfileOutput) SetDomainId(v string) *UpdateEnvironmentProfileOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentBlueprintId sets the EnvironmentBlueprintId field's value. -func (s *UpdateEnvironmentProfileOutput) SetEnvironmentBlueprintId(v string) *UpdateEnvironmentProfileOutput { - s.EnvironmentBlueprintId = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateEnvironmentProfileOutput) SetId(v string) *UpdateEnvironmentProfileOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateEnvironmentProfileOutput) SetName(v string) *UpdateEnvironmentProfileOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *UpdateEnvironmentProfileOutput) SetProjectId(v string) *UpdateEnvironmentProfileOutput { - s.ProjectId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateEnvironmentProfileOutput) SetUpdatedAt(v time.Time) *UpdateEnvironmentProfileOutput { - s.UpdatedAt = &v - return s -} - -// SetUserParameters sets the UserParameters field's value. -func (s *UpdateEnvironmentProfileOutput) SetUserParameters(v []*CustomParameter) *UpdateEnvironmentProfileOutput { - s.UserParameters = v - return s -} - -type UpdateGlossaryInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that is provided to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The description to be updated as part of the UpdateGlossary action. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which a business glossary - // is to be updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the business glossary to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The name to be updated as part of the UpdateGlossary action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryInput's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"true"` - - // The status to be updated as part of the UpdateGlossary action. - Status *string `locationName:"status" type:"string" enum:"GlossaryStatus"` -} - -// 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 UpdateGlossaryInput) 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 UpdateGlossaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGlossaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGlossaryInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateGlossaryInput) SetClientToken(v string) *UpdateGlossaryInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateGlossaryInput) SetDescription(v string) *UpdateGlossaryInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateGlossaryInput) SetDomainIdentifier(v string) *UpdateGlossaryInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateGlossaryInput) SetIdentifier(v string) *UpdateGlossaryInput { - s.Identifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateGlossaryInput) SetName(v string) *UpdateGlossaryInput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateGlossaryInput) SetStatus(v string) *UpdateGlossaryInput { - s.Status = &v - return s -} - -type UpdateGlossaryOutput struct { - _ struct{} `type:"structure"` - - // The description to be updated as part of the UpdateGlossary action. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which a business glossary - // is to be updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the business glossary that is to be updated. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name to be updated as part of the UpdateGlossary action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the project in which to update a business glossary. - // - // OwningProjectId is a required field - OwningProjectId *string `locationName:"owningProjectId" type:"string" required:"true"` - - // The status to be updated as part of the UpdateGlossary action. - Status *string `locationName:"status" type:"string" enum:"GlossaryStatus"` -} - -// 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 UpdateGlossaryOutput) 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 UpdateGlossaryOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *UpdateGlossaryOutput) SetDescription(v string) *UpdateGlossaryOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateGlossaryOutput) SetDomainId(v string) *UpdateGlossaryOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateGlossaryOutput) SetId(v string) *UpdateGlossaryOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateGlossaryOutput) SetName(v string) *UpdateGlossaryOutput { - s.Name = &v - return s -} - -// SetOwningProjectId sets the OwningProjectId field's value. -func (s *UpdateGlossaryOutput) SetOwningProjectId(v string) *UpdateGlossaryOutput { - s.OwningProjectId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateGlossaryOutput) SetStatus(v string) *UpdateGlossaryOutput { - s.Status = &v - return s -} - -type UpdateGlossaryTermInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which a business glossary - // term is to be updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the business glossary in which a term is to be updated. - GlossaryIdentifier *string `locationName:"glossaryIdentifier" type:"string"` - - // The identifier of the business glossary term that is to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The long description to be updated as part of the UpdateGlossaryTerm action. - // - // LongDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryTermInput's - // String and GoString methods. - LongDescription *string `locationName:"longDescription" type:"string" sensitive:"true"` - - // The name to be updated as part of the UpdateGlossaryTerm action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryTermInput's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"true"` - - // The short description to be updated as part of the UpdateGlossaryTerm action. - // - // ShortDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryTermInput's - // String and GoString methods. - ShortDescription *string `locationName:"shortDescription" type:"string" sensitive:"true"` - - // The status to be updated as part of the UpdateGlossaryTerm action. - Status *string `locationName:"status" type:"string" enum:"GlossaryTermStatus"` - - // The term relations to be updated as part of the UpdateGlossaryTerm action. - TermRelations *TermRelations `locationName:"termRelations" 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 UpdateGlossaryTermInput) 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 UpdateGlossaryTermInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGlossaryTermInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGlossaryTermInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TermRelations != nil { - if err := s.TermRelations.Validate(); err != nil { - invalidParams.AddNested("TermRelations", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateGlossaryTermInput) SetDomainIdentifier(v string) *UpdateGlossaryTermInput { - s.DomainIdentifier = &v - return s -} - -// SetGlossaryIdentifier sets the GlossaryIdentifier field's value. -func (s *UpdateGlossaryTermInput) SetGlossaryIdentifier(v string) *UpdateGlossaryTermInput { - s.GlossaryIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateGlossaryTermInput) SetIdentifier(v string) *UpdateGlossaryTermInput { - s.Identifier = &v - return s -} - -// SetLongDescription sets the LongDescription field's value. -func (s *UpdateGlossaryTermInput) SetLongDescription(v string) *UpdateGlossaryTermInput { - s.LongDescription = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateGlossaryTermInput) SetName(v string) *UpdateGlossaryTermInput { - s.Name = &v - return s -} - -// SetShortDescription sets the ShortDescription field's value. -func (s *UpdateGlossaryTermInput) SetShortDescription(v string) *UpdateGlossaryTermInput { - s.ShortDescription = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateGlossaryTermInput) SetStatus(v string) *UpdateGlossaryTermInput { - s.Status = &v - return s -} - -// SetTermRelations sets the TermRelations field's value. -func (s *UpdateGlossaryTermInput) SetTermRelations(v *TermRelations) *UpdateGlossaryTermInput { - s.TermRelations = v - return s -} - -type UpdateGlossaryTermOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which a business glossary - // term is to be updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the business glossary in which a term is to be updated. - // - // GlossaryId is a required field - GlossaryId *string `locationName:"glossaryId" type:"string" required:"true"` - - // The identifier of the business glossary term that is to be updated. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The long description to be updated as part of the UpdateGlossaryTerm action. - // - // LongDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryTermOutput's - // String and GoString methods. - LongDescription *string `locationName:"longDescription" type:"string" sensitive:"true"` - - // The name to be updated as part of the UpdateGlossaryTerm action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryTermOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The short description to be updated as part of the UpdateGlossaryTerm action. - // - // ShortDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGlossaryTermOutput's - // String and GoString methods. - ShortDescription *string `locationName:"shortDescription" type:"string" sensitive:"true"` - - // The status to be updated as part of the UpdateGlossaryTerm action. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"GlossaryTermStatus"` - - // The term relations to be updated as part of the UpdateGlossaryTerm action. - TermRelations *TermRelations `locationName:"termRelations" 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 UpdateGlossaryTermOutput) 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 UpdateGlossaryTermOutput) GoString() string { - return s.String() -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateGlossaryTermOutput) SetDomainId(v string) *UpdateGlossaryTermOutput { - s.DomainId = &v - return s -} - -// SetGlossaryId sets the GlossaryId field's value. -func (s *UpdateGlossaryTermOutput) SetGlossaryId(v string) *UpdateGlossaryTermOutput { - s.GlossaryId = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateGlossaryTermOutput) SetId(v string) *UpdateGlossaryTermOutput { - s.Id = &v - return s -} - -// SetLongDescription sets the LongDescription field's value. -func (s *UpdateGlossaryTermOutput) SetLongDescription(v string) *UpdateGlossaryTermOutput { - s.LongDescription = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateGlossaryTermOutput) SetName(v string) *UpdateGlossaryTermOutput { - s.Name = &v - return s -} - -// SetShortDescription sets the ShortDescription field's value. -func (s *UpdateGlossaryTermOutput) SetShortDescription(v string) *UpdateGlossaryTermOutput { - s.ShortDescription = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateGlossaryTermOutput) SetStatus(v string) *UpdateGlossaryTermOutput { - s.Status = &v - return s -} - -// SetTermRelations sets the TermRelations field's value. -func (s *UpdateGlossaryTermOutput) SetTermRelations(v *TermRelations) *UpdateGlossaryTermOutput { - s.TermRelations = v - return s -} - -type UpdateGroupProfileInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which a group profile is - // updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the group profile that is updated. - // - // GroupIdentifier is a required field - GroupIdentifier *string `location:"uri" locationName:"groupIdentifier" type:"string" required:"true"` - - // The status of the group profile that is updated. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"GroupProfileStatus"` -} - -// 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 UpdateGroupProfileInput) 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 UpdateGroupProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGroupProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGroupProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GroupIdentifier")) - } - if s.GroupIdentifier != nil && len(*s.GroupIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupIdentifier", 1)) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateGroupProfileInput) SetDomainIdentifier(v string) *UpdateGroupProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetGroupIdentifier sets the GroupIdentifier field's value. -func (s *UpdateGroupProfileInput) SetGroupIdentifier(v string) *UpdateGroupProfileInput { - s.GroupIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateGroupProfileInput) SetStatus(v string) *UpdateGroupProfileInput { - s.Status = &v - return s -} - -type UpdateGroupProfileOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which a group profile is - // updated. - DomainId *string `locationName:"domainId" type:"string"` - - // The name of the group profile that is updated. - // - // GroupName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateGroupProfileOutput's - // String and GoString methods. - GroupName *string `locationName:"groupName" min:"1" type:"string" sensitive:"true"` - - // The identifier of the group profile that is updated. - Id *string `locationName:"id" type:"string"` - - // The status of the group profile that is updated. - Status *string `locationName:"status" type:"string" enum:"GroupProfileStatus"` -} - -// 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 UpdateGroupProfileOutput) 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 UpdateGroupProfileOutput) GoString() string { - return s.String() -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateGroupProfileOutput) SetDomainId(v string) *UpdateGroupProfileOutput { - s.DomainId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *UpdateGroupProfileOutput) SetGroupName(v string) *UpdateGroupProfileOutput { - s.GroupName = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateGroupProfileOutput) SetId(v string) *UpdateGroupProfileOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateGroupProfileOutput) SetStatus(v string) *UpdateGroupProfileOutput { - s.Status = &v - return s -} - -type UpdateProjectInput struct { - _ struct{} `type:"structure"` - - // The description to be updated as part of the UpdateProject action. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateProjectInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which a project is to be - // updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The glossary terms to be updated as part of the UpdateProject action. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The identifier of the project that is to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The name to be updated as part of the UpdateProject action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateProjectInput's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"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 UpdateProjectInput) 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 UpdateProjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateProjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateProjectInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.GlossaryTerms != nil && len(s.GlossaryTerms) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GlossaryTerms", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateProjectInput) SetDescription(v string) *UpdateProjectInput { - s.Description = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateProjectInput) SetDomainIdentifier(v string) *UpdateProjectInput { - s.DomainIdentifier = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *UpdateProjectInput) SetGlossaryTerms(v []*string) *UpdateProjectInput { - s.GlossaryTerms = v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateProjectInput) SetIdentifier(v string) *UpdateProjectInput { - s.Identifier = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateProjectInput) SetName(v string) *UpdateProjectInput { - s.Name = &v - return s -} - -type UpdateProjectOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the project was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon DataZone user who created the project. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The description of the project that is to be updated. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateProjectOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which a project is updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The glossary terms of the project that are to be updated. - GlossaryTerms []*string `locationName:"glossaryTerms" min:"1" type:"list"` - - // The identifier of the project that is to be updated. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The timestamp of when the project was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the project that is to be updated. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateProjectOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"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 UpdateProjectOutput) 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 UpdateProjectOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateProjectOutput) SetCreatedAt(v time.Time) *UpdateProjectOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *UpdateProjectOutput) SetCreatedBy(v string) *UpdateProjectOutput { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateProjectOutput) SetDescription(v string) *UpdateProjectOutput { - s.Description = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateProjectOutput) SetDomainId(v string) *UpdateProjectOutput { - s.DomainId = &v - return s -} - -// SetGlossaryTerms sets the GlossaryTerms field's value. -func (s *UpdateProjectOutput) SetGlossaryTerms(v []*string) *UpdateProjectOutput { - s.GlossaryTerms = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateProjectOutput) SetId(v string) *UpdateProjectOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *UpdateProjectOutput) SetLastUpdatedAt(v time.Time) *UpdateProjectOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateProjectOutput) SetName(v string) *UpdateProjectOutput { - s.Name = &v - return s -} - -type UpdateSubscriptionGrantStatusInput struct { - _ struct{} `type:"structure"` - - // The identifier of the asset the subscription grant status of which is to - // be updated. - // - // AssetIdentifier is a required field - AssetIdentifier *string `location:"uri" locationName:"assetIdentifier" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which a subscription grant - // status is to be updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // Specifies the error message that is returned if the operation cannot be successfully - // completed. - FailureCause *FailureCause `locationName:"failureCause" type:"structure"` - - // The identifier of the subscription grant the status of which is to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The status to be updated as part of the UpdateSubscriptionGrantStatus action. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionGrantStatus"` - - // The target name to be updated as part of the UpdateSubscriptionGrantStatus - // action. - TargetName *string `locationName:"targetName" 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 UpdateSubscriptionGrantStatusInput) 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 UpdateSubscriptionGrantStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSubscriptionGrantStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSubscriptionGrantStatusInput"} - if s.AssetIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AssetIdentifier")) - } - if s.AssetIdentifier != nil && len(*s.AssetIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssetIdentifier", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssetIdentifier sets the AssetIdentifier field's value. -func (s *UpdateSubscriptionGrantStatusInput) SetAssetIdentifier(v string) *UpdateSubscriptionGrantStatusInput { - s.AssetIdentifier = &v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateSubscriptionGrantStatusInput) SetDomainIdentifier(v string) *UpdateSubscriptionGrantStatusInput { - s.DomainIdentifier = &v - return s -} - -// SetFailureCause sets the FailureCause field's value. -func (s *UpdateSubscriptionGrantStatusInput) SetFailureCause(v *FailureCause) *UpdateSubscriptionGrantStatusInput { - s.FailureCause = v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateSubscriptionGrantStatusInput) SetIdentifier(v string) *UpdateSubscriptionGrantStatusInput { - s.Identifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateSubscriptionGrantStatusInput) SetStatus(v string) *UpdateSubscriptionGrantStatusInput { - s.Status = &v - return s -} - -// SetTargetName sets the TargetName field's value. -func (s *UpdateSubscriptionGrantStatusInput) SetTargetName(v string) *UpdateSubscriptionGrantStatusInput { - s.TargetName = &v - return s -} - -type UpdateSubscriptionGrantStatusOutput struct { - _ struct{} `type:"structure"` - - Assets []*SubscribedAsset `locationName:"assets" type:"list"` - - // The timestamp of when the subscription grant status was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone domain user who created the subscription grant status. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which a subscription grant - // status is to be updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The granted entity to be updated as part of the UpdateSubscriptionGrantStatus - // action. - // - // GrantedEntity is a required field - GrantedEntity *GrantedEntity `locationName:"grantedEntity" type:"structure" required:"true"` - - // The identifier of the subscription grant. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The status to be updated as part of the UpdateSubscriptionGrantStatus action. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionGrantOverallStatus"` - - // The identifier of the subscription. - SubscriptionId *string `locationName:"subscriptionId" type:"string"` - - // The identifier of the subscription target whose subscription grant status - // is to be updated. - // - // SubscriptionTargetId is a required field - SubscriptionTargetId *string `locationName:"subscriptionTargetId" type:"string" required:"true"` - - // The timestamp of when the subscription grant status is to be updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription grant status. - UpdatedBy *string `locationName:"updatedBy" 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 UpdateSubscriptionGrantStatusOutput) 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 UpdateSubscriptionGrantStatusOutput) GoString() string { - return s.String() -} - -// SetAssets sets the Assets field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetAssets(v []*SubscribedAsset) *UpdateSubscriptionGrantStatusOutput { - s.Assets = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetCreatedAt(v time.Time) *UpdateSubscriptionGrantStatusOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetCreatedBy(v string) *UpdateSubscriptionGrantStatusOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetDomainId(v string) *UpdateSubscriptionGrantStatusOutput { - s.DomainId = &v - return s -} - -// SetGrantedEntity sets the GrantedEntity field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetGrantedEntity(v *GrantedEntity) *UpdateSubscriptionGrantStatusOutput { - s.GrantedEntity = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetId(v string) *UpdateSubscriptionGrantStatusOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetStatus(v string) *UpdateSubscriptionGrantStatusOutput { - s.Status = &v - return s -} - -// SetSubscriptionId sets the SubscriptionId field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetSubscriptionId(v string) *UpdateSubscriptionGrantStatusOutput { - s.SubscriptionId = &v - return s -} - -// SetSubscriptionTargetId sets the SubscriptionTargetId field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetSubscriptionTargetId(v string) *UpdateSubscriptionGrantStatusOutput { - s.SubscriptionTargetId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetUpdatedAt(v time.Time) *UpdateSubscriptionGrantStatusOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *UpdateSubscriptionGrantStatusOutput) SetUpdatedBy(v string) *UpdateSubscriptionGrantStatusOutput { - s.UpdatedBy = &v - return s -} - -type UpdateSubscriptionRequestInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which a subscription request - // is to be updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the subscription request that is to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The reason for the UpdateSubscriptionRequest action. - // - // RequestReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateSubscriptionRequestInput's - // String and GoString methods. - // - // RequestReason is a required field - RequestReason *string `locationName:"requestReason" min:"1" type:"string" required:"true" sensitive:"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 UpdateSubscriptionRequestInput) 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 UpdateSubscriptionRequestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSubscriptionRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSubscriptionRequestInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.RequestReason == nil { - invalidParams.Add(request.NewErrParamRequired("RequestReason")) - } - if s.RequestReason != nil && len(*s.RequestReason) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestReason", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateSubscriptionRequestInput) SetDomainIdentifier(v string) *UpdateSubscriptionRequestInput { - s.DomainIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateSubscriptionRequestInput) SetIdentifier(v string) *UpdateSubscriptionRequestInput { - s.Identifier = &v - return s -} - -// SetRequestReason sets the RequestReason field's value. -func (s *UpdateSubscriptionRequestInput) SetRequestReason(v string) *UpdateSubscriptionRequestInput { - s.RequestReason = &v - return s -} - -type UpdateSubscriptionRequestOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the subscription request was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription request. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The decision comment of the UpdateSubscriptionRequest action. - // - // DecisionComment is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateSubscriptionRequestOutput's - // String and GoString methods. - DecisionComment *string `locationName:"decisionComment" min:"1" type:"string" sensitive:"true"` - - // The identifier of the Amazon DataZone domain in which a subscription request - // is to be updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the subscription request that is to be updated. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The reason for the UpdateSubscriptionRequest action. - // - // RequestReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateSubscriptionRequestOutput's - // String and GoString methods. - // - // RequestReason is a required field - RequestReason *string `locationName:"requestReason" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the Amazon DataZone user who reviews the subscription request. - ReviewerId *string `locationName:"reviewerId" type:"string"` - - // The status of the subscription request. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"SubscriptionRequestStatus"` - - // The subscribed listings of the subscription request. - // - // SubscribedListings is a required field - SubscribedListings []*SubscribedListing `locationName:"subscribedListings" min:"1" type:"list" required:"true"` - - // The subscribed principals of the subscription request. - // - // SubscribedPrincipals is a required field - SubscribedPrincipals []*SubscribedPrincipal `locationName:"subscribedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when the subscription request was updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who updated the subscription request. - UpdatedBy *string `locationName:"updatedBy" 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 UpdateSubscriptionRequestOutput) 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 UpdateSubscriptionRequestOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateSubscriptionRequestOutput) SetCreatedAt(v time.Time) *UpdateSubscriptionRequestOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *UpdateSubscriptionRequestOutput) SetCreatedBy(v string) *UpdateSubscriptionRequestOutput { - s.CreatedBy = &v - return s -} - -// SetDecisionComment sets the DecisionComment field's value. -func (s *UpdateSubscriptionRequestOutput) SetDecisionComment(v string) *UpdateSubscriptionRequestOutput { - s.DecisionComment = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateSubscriptionRequestOutput) SetDomainId(v string) *UpdateSubscriptionRequestOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateSubscriptionRequestOutput) SetId(v string) *UpdateSubscriptionRequestOutput { - s.Id = &v - return s -} - -// SetRequestReason sets the RequestReason field's value. -func (s *UpdateSubscriptionRequestOutput) SetRequestReason(v string) *UpdateSubscriptionRequestOutput { - s.RequestReason = &v - return s -} - -// SetReviewerId sets the ReviewerId field's value. -func (s *UpdateSubscriptionRequestOutput) SetReviewerId(v string) *UpdateSubscriptionRequestOutput { - s.ReviewerId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateSubscriptionRequestOutput) SetStatus(v string) *UpdateSubscriptionRequestOutput { - s.Status = &v - return s -} - -// SetSubscribedListings sets the SubscribedListings field's value. -func (s *UpdateSubscriptionRequestOutput) SetSubscribedListings(v []*SubscribedListing) *UpdateSubscriptionRequestOutput { - s.SubscribedListings = v - return s -} - -// SetSubscribedPrincipals sets the SubscribedPrincipals field's value. -func (s *UpdateSubscriptionRequestOutput) SetSubscribedPrincipals(v []*SubscribedPrincipal) *UpdateSubscriptionRequestOutput { - s.SubscribedPrincipals = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateSubscriptionRequestOutput) SetUpdatedAt(v time.Time) *UpdateSubscriptionRequestOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *UpdateSubscriptionRequestOutput) SetUpdatedBy(v string) *UpdateSubscriptionRequestOutput { - s.UpdatedBy = &v - return s -} - -type UpdateSubscriptionTargetInput struct { - _ struct{} `type:"structure"` - - // The applicable asset types to be updated as part of the UpdateSubscriptionTarget - // action. - ApplicableAssetTypes []*string `locationName:"applicableAssetTypes" type:"list"` - - // The authorized principals to be updated as part of the UpdateSubscriptionTarget - // action. - AuthorizedPrincipals []*string `locationName:"authorizedPrincipals" min:"1" type:"list"` - - // The identifier of the Amazon DataZone domain in which a subscription target - // is to be updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The identifier of the environment in which a subscription target is to be - // updated. - // - // EnvironmentIdentifier is a required field - EnvironmentIdentifier *string `location:"uri" locationName:"environmentIdentifier" type:"string" required:"true"` - - // Identifier of the subscription target that is to be updated. - // - // Identifier is a required field - Identifier *string `location:"uri" locationName:"identifier" type:"string" required:"true"` - - // The manage access role to be updated as part of the UpdateSubscriptionTarget - // action. - ManageAccessRole *string `locationName:"manageAccessRole" type:"string"` - - // The name to be updated as part of the UpdateSubscriptionTarget action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateSubscriptionTargetInput's - // String and GoString methods. - Name *string `locationName:"name" min:"1" type:"string" sensitive:"true"` - - // The provider to be updated as part of the UpdateSubscriptionTarget action. - Provider *string `locationName:"provider" type:"string"` - - // The configuration to be updated as part of the UpdateSubscriptionTarget action. - SubscriptionTargetConfig []*SubscriptionTargetForm `locationName:"subscriptionTargetConfig" type:"list"` -} - -// 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 UpdateSubscriptionTargetInput) 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 UpdateSubscriptionTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSubscriptionTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSubscriptionTargetInput"} - if s.AuthorizedPrincipals != nil && len(s.AuthorizedPrincipals) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AuthorizedPrincipals", 1)) - } - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.EnvironmentIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentIdentifier")) - } - if s.EnvironmentIdentifier != nil && len(*s.EnvironmentIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentIdentifier", 1)) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Identifier != nil && len(*s.Identifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SubscriptionTargetConfig != nil { - for i, v := range s.SubscriptionTargetConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SubscriptionTargetConfig", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicableAssetTypes sets the ApplicableAssetTypes field's value. -func (s *UpdateSubscriptionTargetInput) SetApplicableAssetTypes(v []*string) *UpdateSubscriptionTargetInput { - s.ApplicableAssetTypes = v - return s -} - -// SetAuthorizedPrincipals sets the AuthorizedPrincipals field's value. -func (s *UpdateSubscriptionTargetInput) SetAuthorizedPrincipals(v []*string) *UpdateSubscriptionTargetInput { - s.AuthorizedPrincipals = v - return s -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateSubscriptionTargetInput) SetDomainIdentifier(v string) *UpdateSubscriptionTargetInput { - s.DomainIdentifier = &v - return s -} - -// SetEnvironmentIdentifier sets the EnvironmentIdentifier field's value. -func (s *UpdateSubscriptionTargetInput) SetEnvironmentIdentifier(v string) *UpdateSubscriptionTargetInput { - s.EnvironmentIdentifier = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateSubscriptionTargetInput) SetIdentifier(v string) *UpdateSubscriptionTargetInput { - s.Identifier = &v - return s -} - -// SetManageAccessRole sets the ManageAccessRole field's value. -func (s *UpdateSubscriptionTargetInput) SetManageAccessRole(v string) *UpdateSubscriptionTargetInput { - s.ManageAccessRole = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSubscriptionTargetInput) SetName(v string) *UpdateSubscriptionTargetInput { - s.Name = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *UpdateSubscriptionTargetInput) SetProvider(v string) *UpdateSubscriptionTargetInput { - s.Provider = &v - return s -} - -// SetSubscriptionTargetConfig sets the SubscriptionTargetConfig field's value. -func (s *UpdateSubscriptionTargetInput) SetSubscriptionTargetConfig(v []*SubscriptionTargetForm) *UpdateSubscriptionTargetInput { - s.SubscriptionTargetConfig = v - return s -} - -type UpdateSubscriptionTargetOutput struct { - _ struct{} `type:"structure"` - - // The applicable asset types to be updated as part of the UpdateSubscriptionTarget - // action. - // - // ApplicableAssetTypes is a required field - ApplicableAssetTypes []*string `locationName:"applicableAssetTypes" type:"list" required:"true"` - - // The authorized principals to be updated as part of the UpdateSubscriptionTarget - // action. - // - // AuthorizedPrincipals is a required field - AuthorizedPrincipals []*string `locationName:"authorizedPrincipals" min:"1" type:"list" required:"true"` - - // The timestamp of when a subscription target was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The Amazon DataZone user who created the subscription target. - // - // CreatedBy is a required field - CreatedBy *string `locationName:"createdBy" type:"string" required:"true"` - - // The identifier of the Amazon DataZone domain in which a subscription target - // is to be updated. - // - // DomainId is a required field - DomainId *string `locationName:"domainId" type:"string" required:"true"` - - // The identifier of the environment in which a subscription target is to be - // updated. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // Identifier of the subscription target that is to be updated. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The manage access role to be updated as part of the UpdateSubscriptionTarget - // action. - // - // ManageAccessRole is a required field - ManageAccessRole *string `locationName:"manageAccessRole" type:"string" required:"true"` - - // The name to be updated as part of the UpdateSubscriptionTarget action. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateSubscriptionTargetOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The identifier of the project in which a subscription target is to be updated. - // - // ProjectId is a required field - ProjectId *string `locationName:"projectId" type:"string" required:"true"` - - // The provider to be updated as part of the UpdateSubscriptionTarget action. - // - // Provider is a required field - Provider *string `locationName:"provider" type:"string" required:"true"` - - // The configuration to be updated as part of the UpdateSubscriptionTarget action. - // - // SubscriptionTargetConfig is a required field - SubscriptionTargetConfig []*SubscriptionTargetForm `locationName:"subscriptionTargetConfig" type:"list" required:"true"` - - // The type to be updated as part of the UpdateSubscriptionTarget action. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true"` - - // The timestamp of when the subscription target was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon DataZone user who updated the subscription target. - UpdatedBy *string `locationName:"updatedBy" 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 UpdateSubscriptionTargetOutput) 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 UpdateSubscriptionTargetOutput) GoString() string { - return s.String() -} - -// SetApplicableAssetTypes sets the ApplicableAssetTypes field's value. -func (s *UpdateSubscriptionTargetOutput) SetApplicableAssetTypes(v []*string) *UpdateSubscriptionTargetOutput { - s.ApplicableAssetTypes = v - return s -} - -// SetAuthorizedPrincipals sets the AuthorizedPrincipals field's value. -func (s *UpdateSubscriptionTargetOutput) SetAuthorizedPrincipals(v []*string) *UpdateSubscriptionTargetOutput { - s.AuthorizedPrincipals = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateSubscriptionTargetOutput) SetCreatedAt(v time.Time) *UpdateSubscriptionTargetOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *UpdateSubscriptionTargetOutput) SetCreatedBy(v string) *UpdateSubscriptionTargetOutput { - s.CreatedBy = &v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateSubscriptionTargetOutput) SetDomainId(v string) *UpdateSubscriptionTargetOutput { - s.DomainId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *UpdateSubscriptionTargetOutput) SetEnvironmentId(v string) *UpdateSubscriptionTargetOutput { - s.EnvironmentId = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateSubscriptionTargetOutput) SetId(v string) *UpdateSubscriptionTargetOutput { - s.Id = &v - return s -} - -// SetManageAccessRole sets the ManageAccessRole field's value. -func (s *UpdateSubscriptionTargetOutput) SetManageAccessRole(v string) *UpdateSubscriptionTargetOutput { - s.ManageAccessRole = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSubscriptionTargetOutput) SetName(v string) *UpdateSubscriptionTargetOutput { - s.Name = &v - return s -} - -// SetProjectId sets the ProjectId field's value. -func (s *UpdateSubscriptionTargetOutput) SetProjectId(v string) *UpdateSubscriptionTargetOutput { - s.ProjectId = &v - return s -} - -// SetProvider sets the Provider field's value. -func (s *UpdateSubscriptionTargetOutput) SetProvider(v string) *UpdateSubscriptionTargetOutput { - s.Provider = &v - return s -} - -// SetSubscriptionTargetConfig sets the SubscriptionTargetConfig field's value. -func (s *UpdateSubscriptionTargetOutput) SetSubscriptionTargetConfig(v []*SubscriptionTargetForm) *UpdateSubscriptionTargetOutput { - s.SubscriptionTargetConfig = v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateSubscriptionTargetOutput) SetType(v string) *UpdateSubscriptionTargetOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateSubscriptionTargetOutput) SetUpdatedAt(v time.Time) *UpdateSubscriptionTargetOutput { - s.UpdatedAt = &v - return s -} - -// SetUpdatedBy sets the UpdatedBy field's value. -func (s *UpdateSubscriptionTargetOutput) SetUpdatedBy(v string) *UpdateSubscriptionTargetOutput { - s.UpdatedBy = &v - return s -} - -type UpdateUserProfileInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone domain in which a user profile is updated. - // - // DomainIdentifier is a required field - DomainIdentifier *string `location:"uri" locationName:"domainIdentifier" type:"string" required:"true"` - - // The status of the user profile that are to be updated. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"UserProfileStatus"` - - // The type of the user profile that are to be updated. - Type *string `locationName:"type" type:"string" enum:"UserProfileType"` - - // The identifier of the user whose user profile is to be updated. - // - // UserIdentifier is a required field - UserIdentifier *string `location:"uri" locationName:"userIdentifier" 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 UpdateUserProfileInput) 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 UpdateUserProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateUserProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateUserProfileInput"} - if s.DomainIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("DomainIdentifier")) - } - if s.DomainIdentifier != nil && len(*s.DomainIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DomainIdentifier", 1)) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.UserIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("UserIdentifier")) - } - if s.UserIdentifier != nil && len(*s.UserIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomainIdentifier sets the DomainIdentifier field's value. -func (s *UpdateUserProfileInput) SetDomainIdentifier(v string) *UpdateUserProfileInput { - s.DomainIdentifier = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateUserProfileInput) SetStatus(v string) *UpdateUserProfileInput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateUserProfileInput) SetType(v string) *UpdateUserProfileInput { - s.Type = &v - return s -} - -// SetUserIdentifier sets the UserIdentifier field's value. -func (s *UpdateUserProfileInput) SetUserIdentifier(v string) *UpdateUserProfileInput { - s.UserIdentifier = &v - return s -} - -type UpdateUserProfileOutput struct { - _ struct{} `type:"structure"` - - // The details of the user profile in Amazon DataZone. - Details *UserProfileDetails `locationName:"details" type:"structure"` - - // The identifier of the Amazon DataZone domain in which a user profile is updated. - DomainId *string `locationName:"domainId" type:"string"` - - // The identifier of the user profile. - Id *string `locationName:"id" type:"string"` - - // The status of the user profile. - Status *string `locationName:"status" type:"string" enum:"UserProfileStatus"` - - // The type of the user profile. - Type *string `locationName:"type" type:"string" enum:"UserProfileType"` -} - -// 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 UpdateUserProfileOutput) 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 UpdateUserProfileOutput) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *UpdateUserProfileOutput) SetDetails(v *UserProfileDetails) *UpdateUserProfileOutput { - s.Details = v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UpdateUserProfileOutput) SetDomainId(v string) *UpdateUserProfileOutput { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateUserProfileOutput) SetId(v string) *UpdateUserProfileOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateUserProfileOutput) SetStatus(v string) *UpdateUserProfileOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateUserProfileOutput) SetType(v string) *UpdateUserProfileOutput { - s.Type = &v - return s -} - -// The user details of a project member. -type UserDetails struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon DataZone user. - // - // UserId is a required field - UserId *string `locationName:"userId" 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 UserDetails) 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 UserDetails) GoString() string { - return s.String() -} - -// SetUserId sets the UserId field's value. -func (s *UserDetails) SetUserId(v string) *UserDetails { - s.UserId = &v - return s -} - -// The details of the user profile in Amazon DataZone. -type UserProfileDetails struct { - _ struct{} `type:"structure"` - - // The IAM details included in the user profile details. - Iam *IamUserProfileDetails `locationName:"iam" type:"structure"` - - // The single sign-on details included in the user profile details. - Sso *SsoUserProfileDetails `locationName:"sso" 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 UserProfileDetails) 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 UserProfileDetails) GoString() string { - return s.String() -} - -// SetIam sets the Iam field's value. -func (s *UserProfileDetails) SetIam(v *IamUserProfileDetails) *UserProfileDetails { - s.Iam = v - return s -} - -// SetSso sets the Sso field's value. -func (s *UserProfileDetails) SetSso(v *SsoUserProfileDetails) *UserProfileDetails { - s.Sso = v - return s -} - -// The details of the user profile. -type UserProfileSummary struct { - _ struct{} `type:"structure"` - - // The details of the user profile. - Details *UserProfileDetails `locationName:"details" type:"structure"` - - // The ID of the Amazon DataZone domain of the user profile. - DomainId *string `locationName:"domainId" type:"string"` - - // The ID of the user profile. - Id *string `locationName:"id" type:"string"` - - // The status of the user profile. - Status *string `locationName:"status" type:"string" enum:"UserProfileStatus"` - - // The type of the user profile. - Type *string `locationName:"type" type:"string" enum:"UserProfileType"` -} - -// 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 UserProfileSummary) 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 UserProfileSummary) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *UserProfileSummary) SetDetails(v *UserProfileDetails) *UserProfileSummary { - s.Details = v - return s -} - -// SetDomainId sets the DomainId field's value. -func (s *UserProfileSummary) SetDomainId(v string) *UserProfileSummary { - s.DomainId = &v - return s -} - -// SetId sets the Id field's value. -func (s *UserProfileSummary) SetId(v string) *UserProfileSummary { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UserProfileSummary) SetStatus(v string) *UserProfileSummary { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *UserProfileSummary) SetType(v string) *UserProfileSummary { - s.Type = &v - return s -} - -// The input fails to satisfy the constraints specified by the Amazon Web Services -// service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // AcceptRuleBehaviorAll is a AcceptRuleBehavior enum value - AcceptRuleBehaviorAll = "ALL" - - // AcceptRuleBehaviorNone is a AcceptRuleBehavior enum value - AcceptRuleBehaviorNone = "NONE" -) - -// AcceptRuleBehavior_Values returns all elements of the AcceptRuleBehavior enum -func AcceptRuleBehavior_Values() []string { - return []string{ - AcceptRuleBehaviorAll, - AcceptRuleBehaviorNone, - } -} - -const ( - // AuthTypeIamIdc is a AuthType enum value - AuthTypeIamIdc = "IAM_IDC" - - // AuthTypeDisabled is a AuthType enum value - AuthTypeDisabled = "DISABLED" -) - -// AuthType_Values returns all elements of the AuthType enum -func AuthType_Values() []string { - return []string{ - AuthTypeIamIdc, - AuthTypeDisabled, - } -} - -const ( - // ChangeActionPublish is a ChangeAction enum value - ChangeActionPublish = "PUBLISH" - - // ChangeActionUnpublish is a ChangeAction enum value - ChangeActionUnpublish = "UNPUBLISH" -) - -// ChangeAction_Values returns all elements of the ChangeAction enum -func ChangeAction_Values() []string { - return []string{ - ChangeActionPublish, - ChangeActionUnpublish, - } -} - -const ( - // ConfigurableActionTypeAuthorizationIam is a ConfigurableActionTypeAuthorization enum value - ConfigurableActionTypeAuthorizationIam = "IAM" - - // ConfigurableActionTypeAuthorizationHttps is a ConfigurableActionTypeAuthorization enum value - ConfigurableActionTypeAuthorizationHttps = "HTTPS" -) - -// ConfigurableActionTypeAuthorization_Values returns all elements of the ConfigurableActionTypeAuthorization enum -func ConfigurableActionTypeAuthorization_Values() []string { - return []string{ - ConfigurableActionTypeAuthorizationIam, - ConfigurableActionTypeAuthorizationHttps, - } -} - -const ( - // DataAssetActivityStatusFailed is a DataAssetActivityStatus enum value - DataAssetActivityStatusFailed = "FAILED" - - // DataAssetActivityStatusPublishingFailed is a DataAssetActivityStatus enum value - DataAssetActivityStatusPublishingFailed = "PUBLISHING_FAILED" - - // DataAssetActivityStatusSucceededCreated is a DataAssetActivityStatus enum value - DataAssetActivityStatusSucceededCreated = "SUCCEEDED_CREATED" - - // DataAssetActivityStatusSucceededUpdated is a DataAssetActivityStatus enum value - DataAssetActivityStatusSucceededUpdated = "SUCCEEDED_UPDATED" - - // DataAssetActivityStatusSkippedAlreadyImported is a DataAssetActivityStatus enum value - DataAssetActivityStatusSkippedAlreadyImported = "SKIPPED_ALREADY_IMPORTED" - - // DataAssetActivityStatusSkippedArchived is a DataAssetActivityStatus enum value - DataAssetActivityStatusSkippedArchived = "SKIPPED_ARCHIVED" - - // DataAssetActivityStatusSkippedNoAccess is a DataAssetActivityStatus enum value - DataAssetActivityStatusSkippedNoAccess = "SKIPPED_NO_ACCESS" - - // DataAssetActivityStatusUnchanged is a DataAssetActivityStatus enum value - DataAssetActivityStatusUnchanged = "UNCHANGED" -) - -// DataAssetActivityStatus_Values returns all elements of the DataAssetActivityStatus enum -func DataAssetActivityStatus_Values() []string { - return []string{ - DataAssetActivityStatusFailed, - DataAssetActivityStatusPublishingFailed, - DataAssetActivityStatusSucceededCreated, - DataAssetActivityStatusSucceededUpdated, - DataAssetActivityStatusSkippedAlreadyImported, - DataAssetActivityStatusSkippedArchived, - DataAssetActivityStatusSkippedNoAccess, - DataAssetActivityStatusUnchanged, - } -} - -const ( - // DataSourceErrorTypeAccessDeniedException is a DataSourceErrorType enum value - DataSourceErrorTypeAccessDeniedException = "ACCESS_DENIED_EXCEPTION" - - // DataSourceErrorTypeConflictException is a DataSourceErrorType enum value - DataSourceErrorTypeConflictException = "CONFLICT_EXCEPTION" - - // DataSourceErrorTypeInternalServerException is a DataSourceErrorType enum value - DataSourceErrorTypeInternalServerException = "INTERNAL_SERVER_EXCEPTION" - - // DataSourceErrorTypeResourceNotFoundException is a DataSourceErrorType enum value - DataSourceErrorTypeResourceNotFoundException = "RESOURCE_NOT_FOUND_EXCEPTION" - - // DataSourceErrorTypeServiceQuotaExceededException is a DataSourceErrorType enum value - DataSourceErrorTypeServiceQuotaExceededException = "SERVICE_QUOTA_EXCEEDED_EXCEPTION" - - // DataSourceErrorTypeThrottlingException is a DataSourceErrorType enum value - DataSourceErrorTypeThrottlingException = "THROTTLING_EXCEPTION" - - // DataSourceErrorTypeValidationException is a DataSourceErrorType enum value - DataSourceErrorTypeValidationException = "VALIDATION_EXCEPTION" -) - -// DataSourceErrorType_Values returns all elements of the DataSourceErrorType enum -func DataSourceErrorType_Values() []string { - return []string{ - DataSourceErrorTypeAccessDeniedException, - DataSourceErrorTypeConflictException, - DataSourceErrorTypeInternalServerException, - DataSourceErrorTypeResourceNotFoundException, - DataSourceErrorTypeServiceQuotaExceededException, - DataSourceErrorTypeThrottlingException, - DataSourceErrorTypeValidationException, - } -} - -const ( - // DataSourceRunStatusRequested is a DataSourceRunStatus enum value - DataSourceRunStatusRequested = "REQUESTED" - - // DataSourceRunStatusRunning is a DataSourceRunStatus enum value - DataSourceRunStatusRunning = "RUNNING" - - // DataSourceRunStatusFailed is a DataSourceRunStatus enum value - DataSourceRunStatusFailed = "FAILED" - - // DataSourceRunStatusPartiallySucceeded is a DataSourceRunStatus enum value - DataSourceRunStatusPartiallySucceeded = "PARTIALLY_SUCCEEDED" - - // DataSourceRunStatusSuccess is a DataSourceRunStatus enum value - DataSourceRunStatusSuccess = "SUCCESS" -) - -// DataSourceRunStatus_Values returns all elements of the DataSourceRunStatus enum -func DataSourceRunStatus_Values() []string { - return []string{ - DataSourceRunStatusRequested, - DataSourceRunStatusRunning, - DataSourceRunStatusFailed, - DataSourceRunStatusPartiallySucceeded, - DataSourceRunStatusSuccess, - } -} - -const ( - // DataSourceRunTypePrioritized is a DataSourceRunType enum value - DataSourceRunTypePrioritized = "PRIORITIZED" - - // DataSourceRunTypeScheduled is a DataSourceRunType enum value - DataSourceRunTypeScheduled = "SCHEDULED" -) - -// DataSourceRunType_Values returns all elements of the DataSourceRunType enum -func DataSourceRunType_Values() []string { - return []string{ - DataSourceRunTypePrioritized, - DataSourceRunTypeScheduled, - } -} - -const ( - // DataSourceStatusCreating is a DataSourceStatus enum value - DataSourceStatusCreating = "CREATING" - - // DataSourceStatusFailedCreation is a DataSourceStatus enum value - DataSourceStatusFailedCreation = "FAILED_CREATION" - - // DataSourceStatusReady is a DataSourceStatus enum value - DataSourceStatusReady = "READY" - - // DataSourceStatusUpdating is a DataSourceStatus enum value - DataSourceStatusUpdating = "UPDATING" - - // DataSourceStatusFailedUpdate is a DataSourceStatus enum value - DataSourceStatusFailedUpdate = "FAILED_UPDATE" - - // DataSourceStatusRunning is a DataSourceStatus enum value - DataSourceStatusRunning = "RUNNING" - - // DataSourceStatusDeleting is a DataSourceStatus enum value - DataSourceStatusDeleting = "DELETING" - - // DataSourceStatusFailedDeletion is a DataSourceStatus enum value - DataSourceStatusFailedDeletion = "FAILED_DELETION" -) - -// DataSourceStatus_Values returns all elements of the DataSourceStatus enum -func DataSourceStatus_Values() []string { - return []string{ - DataSourceStatusCreating, - DataSourceStatusFailedCreation, - DataSourceStatusReady, - DataSourceStatusUpdating, - DataSourceStatusFailedUpdate, - DataSourceStatusRunning, - DataSourceStatusDeleting, - DataSourceStatusFailedDeletion, - } -} - -const ( - // DeploymentStatusInProgress is a DeploymentStatus enum value - DeploymentStatusInProgress = "IN_PROGRESS" - - // DeploymentStatusSuccessful is a DeploymentStatus enum value - DeploymentStatusSuccessful = "SUCCESSFUL" - - // DeploymentStatusFailed is a DeploymentStatus enum value - DeploymentStatusFailed = "FAILED" - - // DeploymentStatusPendingDeployment is a DeploymentStatus enum value - DeploymentStatusPendingDeployment = "PENDING_DEPLOYMENT" -) - -// DeploymentStatus_Values returns all elements of the DeploymentStatus enum -func DeploymentStatus_Values() []string { - return []string{ - DeploymentStatusInProgress, - DeploymentStatusSuccessful, - DeploymentStatusFailed, - DeploymentStatusPendingDeployment, - } -} - -const ( - // DeploymentTypeCreate is a DeploymentType enum value - DeploymentTypeCreate = "CREATE" - - // DeploymentTypeUpdate is a DeploymentType enum value - DeploymentTypeUpdate = "UPDATE" - - // DeploymentTypeDelete is a DeploymentType enum value - DeploymentTypeDelete = "DELETE" -) - -// DeploymentType_Values returns all elements of the DeploymentType enum -func DeploymentType_Values() []string { - return []string{ - DeploymentTypeCreate, - DeploymentTypeUpdate, - DeploymentTypeDelete, - } -} - -const ( - // DomainStatusCreating is a DomainStatus enum value - DomainStatusCreating = "CREATING" - - // DomainStatusAvailable is a DomainStatus enum value - DomainStatusAvailable = "AVAILABLE" - - // DomainStatusCreationFailed is a DomainStatus enum value - DomainStatusCreationFailed = "CREATION_FAILED" - - // DomainStatusDeleting is a DomainStatus enum value - DomainStatusDeleting = "DELETING" - - // DomainStatusDeleted is a DomainStatus enum value - DomainStatusDeleted = "DELETED" - - // DomainStatusDeletionFailed is a DomainStatus enum value - DomainStatusDeletionFailed = "DELETION_FAILED" -) - -// DomainStatus_Values returns all elements of the DomainStatus enum -func DomainStatus_Values() []string { - return []string{ - DomainStatusCreating, - DomainStatusAvailable, - DomainStatusCreationFailed, - DomainStatusDeleting, - DomainStatusDeleted, - DomainStatusDeletionFailed, - } -} - -const ( - // EnableSettingEnabled is a EnableSetting enum value - EnableSettingEnabled = "ENABLED" - - // EnableSettingDisabled is a EnableSetting enum value - EnableSettingDisabled = "DISABLED" -) - -// EnableSetting_Values returns all elements of the EnableSetting enum -func EnableSetting_Values() []string { - return []string{ - EnableSettingEnabled, - EnableSettingDisabled, - } -} - -const ( - // EntityTypeAsset is a EntityType enum value - EntityTypeAsset = "ASSET" -) - -// EntityType_Values returns all elements of the EntityType enum -func EntityType_Values() []string { - return []string{ - EntityTypeAsset, - } -} - -const ( - // EnvironmentStatusActive is a EnvironmentStatus enum value - EnvironmentStatusActive = "ACTIVE" - - // EnvironmentStatusCreating is a EnvironmentStatus enum value - EnvironmentStatusCreating = "CREATING" - - // EnvironmentStatusUpdating is a EnvironmentStatus enum value - EnvironmentStatusUpdating = "UPDATING" - - // EnvironmentStatusDeleting is a EnvironmentStatus enum value - EnvironmentStatusDeleting = "DELETING" - - // EnvironmentStatusCreateFailed is a EnvironmentStatus enum value - EnvironmentStatusCreateFailed = "CREATE_FAILED" - - // EnvironmentStatusUpdateFailed is a EnvironmentStatus enum value - EnvironmentStatusUpdateFailed = "UPDATE_FAILED" - - // EnvironmentStatusDeleteFailed is a EnvironmentStatus enum value - EnvironmentStatusDeleteFailed = "DELETE_FAILED" - - // EnvironmentStatusValidationFailed is a EnvironmentStatus enum value - EnvironmentStatusValidationFailed = "VALIDATION_FAILED" - - // EnvironmentStatusSuspended is a EnvironmentStatus enum value - EnvironmentStatusSuspended = "SUSPENDED" - - // EnvironmentStatusDisabled is a EnvironmentStatus enum value - EnvironmentStatusDisabled = "DISABLED" - - // EnvironmentStatusExpired is a EnvironmentStatus enum value - EnvironmentStatusExpired = "EXPIRED" - - // EnvironmentStatusDeleted is a EnvironmentStatus enum value - EnvironmentStatusDeleted = "DELETED" - - // EnvironmentStatusInaccessible is a EnvironmentStatus enum value - EnvironmentStatusInaccessible = "INACCESSIBLE" -) - -// EnvironmentStatus_Values returns all elements of the EnvironmentStatus enum -func EnvironmentStatus_Values() []string { - return []string{ - EnvironmentStatusActive, - EnvironmentStatusCreating, - EnvironmentStatusUpdating, - EnvironmentStatusDeleting, - EnvironmentStatusCreateFailed, - EnvironmentStatusUpdateFailed, - EnvironmentStatusDeleteFailed, - EnvironmentStatusValidationFailed, - EnvironmentStatusSuspended, - EnvironmentStatusDisabled, - EnvironmentStatusExpired, - EnvironmentStatusDeleted, - EnvironmentStatusInaccessible, - } -} - -const ( - // FilterExpressionTypeInclude is a FilterExpressionType enum value - FilterExpressionTypeInclude = "INCLUDE" - - // FilterExpressionTypeExclude is a FilterExpressionType enum value - FilterExpressionTypeExclude = "EXCLUDE" -) - -// FilterExpressionType_Values returns all elements of the FilterExpressionType enum -func FilterExpressionType_Values() []string { - return []string{ - FilterExpressionTypeInclude, - FilterExpressionTypeExclude, - } -} - -const ( - // FormTypeStatusEnabled is a FormTypeStatus enum value - FormTypeStatusEnabled = "ENABLED" - - // FormTypeStatusDisabled is a FormTypeStatus enum value - FormTypeStatusDisabled = "DISABLED" -) - -// FormTypeStatus_Values returns all elements of the FormTypeStatus enum -func FormTypeStatus_Values() []string { - return []string{ - FormTypeStatusEnabled, - FormTypeStatusDisabled, - } -} - -const ( - // GlossaryStatusDisabled is a GlossaryStatus enum value - GlossaryStatusDisabled = "DISABLED" - - // GlossaryStatusEnabled is a GlossaryStatus enum value - GlossaryStatusEnabled = "ENABLED" -) - -// GlossaryStatus_Values returns all elements of the GlossaryStatus enum -func GlossaryStatus_Values() []string { - return []string{ - GlossaryStatusDisabled, - GlossaryStatusEnabled, - } -} - -const ( - // GlossaryTermStatusEnabled is a GlossaryTermStatus enum value - GlossaryTermStatusEnabled = "ENABLED" - - // GlossaryTermStatusDisabled is a GlossaryTermStatus enum value - GlossaryTermStatusDisabled = "DISABLED" -) - -// GlossaryTermStatus_Values returns all elements of the GlossaryTermStatus enum -func GlossaryTermStatus_Values() []string { - return []string{ - GlossaryTermStatusEnabled, - GlossaryTermStatusDisabled, - } -} - -const ( - // GroupProfileStatusAssigned is a GroupProfileStatus enum value - GroupProfileStatusAssigned = "ASSIGNED" - - // GroupProfileStatusNotAssigned is a GroupProfileStatus enum value - GroupProfileStatusNotAssigned = "NOT_ASSIGNED" -) - -// GroupProfileStatus_Values returns all elements of the GroupProfileStatus enum -func GroupProfileStatus_Values() []string { - return []string{ - GroupProfileStatusAssigned, - GroupProfileStatusNotAssigned, - } -} - -const ( - // GroupSearchTypeSsoGroup is a GroupSearchType enum value - GroupSearchTypeSsoGroup = "SSO_GROUP" - - // GroupSearchTypeDatazoneSsoGroup is a GroupSearchType enum value - GroupSearchTypeDatazoneSsoGroup = "DATAZONE_SSO_GROUP" -) - -// GroupSearchType_Values returns all elements of the GroupSearchType enum -func GroupSearchType_Values() []string { - return []string{ - GroupSearchTypeSsoGroup, - GroupSearchTypeDatazoneSsoGroup, - } -} - -const ( - // InventorySearchScopeAsset is a InventorySearchScope enum value - InventorySearchScopeAsset = "ASSET" - - // InventorySearchScopeGlossary is a InventorySearchScope enum value - InventorySearchScopeGlossary = "GLOSSARY" - - // InventorySearchScopeGlossaryTerm is a InventorySearchScope enum value - InventorySearchScopeGlossaryTerm = "GLOSSARY_TERM" -) - -// InventorySearchScope_Values returns all elements of the InventorySearchScope enum -func InventorySearchScope_Values() []string { - return []string{ - InventorySearchScopeAsset, - InventorySearchScopeGlossary, - InventorySearchScopeGlossaryTerm, - } -} - -const ( - // ListingStatusCreating is a ListingStatus enum value - ListingStatusCreating = "CREATING" - - // ListingStatusActive is a ListingStatus enum value - ListingStatusActive = "ACTIVE" - - // ListingStatusInactive is a ListingStatus enum value - ListingStatusInactive = "INACTIVE" -) - -// ListingStatus_Values returns all elements of the ListingStatus enum -func ListingStatus_Values() []string { - return []string{ - ListingStatusCreating, - ListingStatusActive, - ListingStatusInactive, - } -} - -const ( - // NotificationResourceTypeProject is a NotificationResourceType enum value - NotificationResourceTypeProject = "PROJECT" -) - -// NotificationResourceType_Values returns all elements of the NotificationResourceType enum -func NotificationResourceType_Values() []string { - return []string{ - NotificationResourceTypeProject, - } -} - -const ( - // NotificationRoleProjectOwner is a NotificationRole enum value - NotificationRoleProjectOwner = "PROJECT_OWNER" - - // NotificationRoleProjectContributor is a NotificationRole enum value - NotificationRoleProjectContributor = "PROJECT_CONTRIBUTOR" - - // NotificationRoleProjectViewer is a NotificationRole enum value - NotificationRoleProjectViewer = "PROJECT_VIEWER" - - // NotificationRoleDomainOwner is a NotificationRole enum value - NotificationRoleDomainOwner = "DOMAIN_OWNER" - - // NotificationRoleProjectSubscriber is a NotificationRole enum value - NotificationRoleProjectSubscriber = "PROJECT_SUBSCRIBER" -) - -// NotificationRole_Values returns all elements of the NotificationRole enum -func NotificationRole_Values() []string { - return []string{ - NotificationRoleProjectOwner, - NotificationRoleProjectContributor, - NotificationRoleProjectViewer, - NotificationRoleDomainOwner, - NotificationRoleProjectSubscriber, - } -} - -const ( - // NotificationTypeTask is a NotificationType enum value - NotificationTypeTask = "TASK" - - // NotificationTypeEvent is a NotificationType enum value - NotificationTypeEvent = "EVENT" -) - -// NotificationType_Values returns all elements of the NotificationType enum -func NotificationType_Values() []string { - return []string{ - NotificationTypeTask, - NotificationTypeEvent, - } -} - -const ( - // RejectRuleBehaviorAll is a RejectRuleBehavior enum value - RejectRuleBehaviorAll = "ALL" - - // RejectRuleBehaviorNone is a RejectRuleBehavior enum value - RejectRuleBehaviorNone = "NONE" -) - -// RejectRuleBehavior_Values returns all elements of the RejectRuleBehavior enum -func RejectRuleBehavior_Values() []string { - return []string{ - RejectRuleBehaviorAll, - RejectRuleBehaviorNone, - } -} - -const ( - // SearchOutputAdditionalAttributeForms is a SearchOutputAdditionalAttribute enum value - SearchOutputAdditionalAttributeForms = "FORMS" -) - -// SearchOutputAdditionalAttribute_Values returns all elements of the SearchOutputAdditionalAttribute enum -func SearchOutputAdditionalAttribute_Values() []string { - return []string{ - SearchOutputAdditionalAttributeForms, - } -} - -const ( - // SortFieldProjectName is a SortFieldProject enum value - SortFieldProjectName = "NAME" -) - -// SortFieldProject_Values returns all elements of the SortFieldProject enum -func SortFieldProject_Values() []string { - return []string{ - SortFieldProjectName, - } -} - -const ( - // SortKeyCreatedAt is a SortKey enum value - SortKeyCreatedAt = "CREATED_AT" - - // SortKeyUpdatedAt is a SortKey enum value - SortKeyUpdatedAt = "UPDATED_AT" -) - -// SortKey_Values returns all elements of the SortKey enum -func SortKey_Values() []string { - return []string{ - SortKeyCreatedAt, - SortKeyUpdatedAt, - } -} - -const ( - // SortOrderAscending is a SortOrder enum value - SortOrderAscending = "ASCENDING" - - // SortOrderDescending is a SortOrder enum value - SortOrderDescending = "DESCENDING" -) - -// SortOrder_Values returns all elements of the SortOrder enum -func SortOrder_Values() []string { - return []string{ - SortOrderAscending, - SortOrderDescending, - } -} - -const ( - // SubscriptionGrantOverallStatusPending is a SubscriptionGrantOverallStatus enum value - SubscriptionGrantOverallStatusPending = "PENDING" - - // SubscriptionGrantOverallStatusInProgress is a SubscriptionGrantOverallStatus enum value - SubscriptionGrantOverallStatusInProgress = "IN_PROGRESS" - - // SubscriptionGrantOverallStatusGrantFailed is a SubscriptionGrantOverallStatus enum value - SubscriptionGrantOverallStatusGrantFailed = "GRANT_FAILED" - - // SubscriptionGrantOverallStatusRevokeFailed is a SubscriptionGrantOverallStatus enum value - SubscriptionGrantOverallStatusRevokeFailed = "REVOKE_FAILED" - - // SubscriptionGrantOverallStatusGrantAndRevokeFailed is a SubscriptionGrantOverallStatus enum value - SubscriptionGrantOverallStatusGrantAndRevokeFailed = "GRANT_AND_REVOKE_FAILED" - - // SubscriptionGrantOverallStatusCompleted is a SubscriptionGrantOverallStatus enum value - SubscriptionGrantOverallStatusCompleted = "COMPLETED" - - // SubscriptionGrantOverallStatusInaccessible is a SubscriptionGrantOverallStatus enum value - SubscriptionGrantOverallStatusInaccessible = "INACCESSIBLE" -) - -// SubscriptionGrantOverallStatus_Values returns all elements of the SubscriptionGrantOverallStatus enum -func SubscriptionGrantOverallStatus_Values() []string { - return []string{ - SubscriptionGrantOverallStatusPending, - SubscriptionGrantOverallStatusInProgress, - SubscriptionGrantOverallStatusGrantFailed, - SubscriptionGrantOverallStatusRevokeFailed, - SubscriptionGrantOverallStatusGrantAndRevokeFailed, - SubscriptionGrantOverallStatusCompleted, - SubscriptionGrantOverallStatusInaccessible, - } -} - -const ( - // SubscriptionGrantStatusGrantPending is a SubscriptionGrantStatus enum value - SubscriptionGrantStatusGrantPending = "GRANT_PENDING" - - // SubscriptionGrantStatusRevokePending is a SubscriptionGrantStatus enum value - SubscriptionGrantStatusRevokePending = "REVOKE_PENDING" - - // SubscriptionGrantStatusGrantInProgress is a SubscriptionGrantStatus enum value - SubscriptionGrantStatusGrantInProgress = "GRANT_IN_PROGRESS" - - // SubscriptionGrantStatusRevokeInProgress is a SubscriptionGrantStatus enum value - SubscriptionGrantStatusRevokeInProgress = "REVOKE_IN_PROGRESS" - - // SubscriptionGrantStatusGranted is a SubscriptionGrantStatus enum value - SubscriptionGrantStatusGranted = "GRANTED" - - // SubscriptionGrantStatusRevoked is a SubscriptionGrantStatus enum value - SubscriptionGrantStatusRevoked = "REVOKED" - - // SubscriptionGrantStatusGrantFailed is a SubscriptionGrantStatus enum value - SubscriptionGrantStatusGrantFailed = "GRANT_FAILED" - - // SubscriptionGrantStatusRevokeFailed is a SubscriptionGrantStatus enum value - SubscriptionGrantStatusRevokeFailed = "REVOKE_FAILED" -) - -// SubscriptionGrantStatus_Values returns all elements of the SubscriptionGrantStatus enum -func SubscriptionGrantStatus_Values() []string { - return []string{ - SubscriptionGrantStatusGrantPending, - SubscriptionGrantStatusRevokePending, - SubscriptionGrantStatusGrantInProgress, - SubscriptionGrantStatusRevokeInProgress, - SubscriptionGrantStatusGranted, - SubscriptionGrantStatusRevoked, - SubscriptionGrantStatusGrantFailed, - SubscriptionGrantStatusRevokeFailed, - } -} - -const ( - // SubscriptionRequestStatusPending is a SubscriptionRequestStatus enum value - SubscriptionRequestStatusPending = "PENDING" - - // SubscriptionRequestStatusAccepted is a SubscriptionRequestStatus enum value - SubscriptionRequestStatusAccepted = "ACCEPTED" - - // SubscriptionRequestStatusRejected is a SubscriptionRequestStatus enum value - SubscriptionRequestStatusRejected = "REJECTED" -) - -// SubscriptionRequestStatus_Values returns all elements of the SubscriptionRequestStatus enum -func SubscriptionRequestStatus_Values() []string { - return []string{ - SubscriptionRequestStatusPending, - SubscriptionRequestStatusAccepted, - SubscriptionRequestStatusRejected, - } -} - -const ( - // SubscriptionStatusApproved is a SubscriptionStatus enum value - SubscriptionStatusApproved = "APPROVED" - - // SubscriptionStatusRevoked is a SubscriptionStatus enum value - SubscriptionStatusRevoked = "REVOKED" - - // SubscriptionStatusCancelled is a SubscriptionStatus enum value - SubscriptionStatusCancelled = "CANCELLED" -) - -// SubscriptionStatus_Values returns all elements of the SubscriptionStatus enum -func SubscriptionStatus_Values() []string { - return []string{ - SubscriptionStatusApproved, - SubscriptionStatusRevoked, - SubscriptionStatusCancelled, - } -} - -const ( - // TaskStatusActive is a TaskStatus enum value - TaskStatusActive = "ACTIVE" - - // TaskStatusInactive is a TaskStatus enum value - TaskStatusInactive = "INACTIVE" -) - -// TaskStatus_Values returns all elements of the TaskStatus enum -func TaskStatus_Values() []string { - return []string{ - TaskStatusActive, - TaskStatusInactive, - } -} - -const ( - // TimezoneUtc is a Timezone enum value - TimezoneUtc = "UTC" - - // TimezoneAfricaJohannesburg is a Timezone enum value - TimezoneAfricaJohannesburg = "AFRICA_JOHANNESBURG" - - // TimezoneAmericaMontreal is a Timezone enum value - TimezoneAmericaMontreal = "AMERICA_MONTREAL" - - // TimezoneAmericaSaoPaulo is a Timezone enum value - TimezoneAmericaSaoPaulo = "AMERICA_SAO_PAULO" - - // TimezoneAsiaBahrain is a Timezone enum value - TimezoneAsiaBahrain = "ASIA_BAHRAIN" - - // TimezoneAsiaBangkok is a Timezone enum value - TimezoneAsiaBangkok = "ASIA_BANGKOK" - - // TimezoneAsiaCalcutta is a Timezone enum value - TimezoneAsiaCalcutta = "ASIA_CALCUTTA" - - // TimezoneAsiaDubai is a Timezone enum value - TimezoneAsiaDubai = "ASIA_DUBAI" - - // TimezoneAsiaHongKong is a Timezone enum value - TimezoneAsiaHongKong = "ASIA_HONG_KONG" - - // TimezoneAsiaJakarta is a Timezone enum value - TimezoneAsiaJakarta = "ASIA_JAKARTA" - - // TimezoneAsiaKualaLumpur is a Timezone enum value - TimezoneAsiaKualaLumpur = "ASIA_KUALA_LUMPUR" - - // TimezoneAsiaSeoul is a Timezone enum value - TimezoneAsiaSeoul = "ASIA_SEOUL" - - // TimezoneAsiaShanghai is a Timezone enum value - TimezoneAsiaShanghai = "ASIA_SHANGHAI" - - // TimezoneAsiaSingapore is a Timezone enum value - TimezoneAsiaSingapore = "ASIA_SINGAPORE" - - // TimezoneAsiaTaipei is a Timezone enum value - TimezoneAsiaTaipei = "ASIA_TAIPEI" - - // TimezoneAsiaTokyo is a Timezone enum value - TimezoneAsiaTokyo = "ASIA_TOKYO" - - // TimezoneAustraliaMelbourne is a Timezone enum value - TimezoneAustraliaMelbourne = "AUSTRALIA_MELBOURNE" - - // TimezoneAustraliaSydney is a Timezone enum value - TimezoneAustraliaSydney = "AUSTRALIA_SYDNEY" - - // TimezoneCanadaCentral is a Timezone enum value - TimezoneCanadaCentral = "CANADA_CENTRAL" - - // TimezoneCet is a Timezone enum value - TimezoneCet = "CET" - - // TimezoneCst6cdt is a Timezone enum value - TimezoneCst6cdt = "CST6CDT" - - // TimezoneEtcGmt is a Timezone enum value - TimezoneEtcGmt = "ETC_GMT" - - // TimezoneEtcGmt0 is a Timezone enum value - TimezoneEtcGmt0 = "ETC_GMT0" - - // TimezoneEtcGmtAdd0 is a Timezone enum value - TimezoneEtcGmtAdd0 = "ETC_GMT_ADD_0" - - // TimezoneEtcGmtAdd1 is a Timezone enum value - TimezoneEtcGmtAdd1 = "ETC_GMT_ADD_1" - - // TimezoneEtcGmtAdd10 is a Timezone enum value - TimezoneEtcGmtAdd10 = "ETC_GMT_ADD_10" - - // TimezoneEtcGmtAdd11 is a Timezone enum value - TimezoneEtcGmtAdd11 = "ETC_GMT_ADD_11" - - // TimezoneEtcGmtAdd12 is a Timezone enum value - TimezoneEtcGmtAdd12 = "ETC_GMT_ADD_12" - - // TimezoneEtcGmtAdd2 is a Timezone enum value - TimezoneEtcGmtAdd2 = "ETC_GMT_ADD_2" - - // TimezoneEtcGmtAdd3 is a Timezone enum value - TimezoneEtcGmtAdd3 = "ETC_GMT_ADD_3" - - // TimezoneEtcGmtAdd4 is a Timezone enum value - TimezoneEtcGmtAdd4 = "ETC_GMT_ADD_4" - - // TimezoneEtcGmtAdd5 is a Timezone enum value - TimezoneEtcGmtAdd5 = "ETC_GMT_ADD_5" - - // TimezoneEtcGmtAdd6 is a Timezone enum value - TimezoneEtcGmtAdd6 = "ETC_GMT_ADD_6" - - // TimezoneEtcGmtAdd7 is a Timezone enum value - TimezoneEtcGmtAdd7 = "ETC_GMT_ADD_7" - - // TimezoneEtcGmtAdd8 is a Timezone enum value - TimezoneEtcGmtAdd8 = "ETC_GMT_ADD_8" - - // TimezoneEtcGmtAdd9 is a Timezone enum value - TimezoneEtcGmtAdd9 = "ETC_GMT_ADD_9" - - // TimezoneEtcGmtNeg0 is a Timezone enum value - TimezoneEtcGmtNeg0 = "ETC_GMT_NEG_0" - - // TimezoneEtcGmtNeg1 is a Timezone enum value - TimezoneEtcGmtNeg1 = "ETC_GMT_NEG_1" - - // TimezoneEtcGmtNeg10 is a Timezone enum value - TimezoneEtcGmtNeg10 = "ETC_GMT_NEG_10" - - // TimezoneEtcGmtNeg11 is a Timezone enum value - TimezoneEtcGmtNeg11 = "ETC_GMT_NEG_11" - - // TimezoneEtcGmtNeg12 is a Timezone enum value - TimezoneEtcGmtNeg12 = "ETC_GMT_NEG_12" - - // TimezoneEtcGmtNeg13 is a Timezone enum value - TimezoneEtcGmtNeg13 = "ETC_GMT_NEG_13" - - // TimezoneEtcGmtNeg14 is a Timezone enum value - TimezoneEtcGmtNeg14 = "ETC_GMT_NEG_14" - - // TimezoneEtcGmtNeg2 is a Timezone enum value - TimezoneEtcGmtNeg2 = "ETC_GMT_NEG_2" - - // TimezoneEtcGmtNeg3 is a Timezone enum value - TimezoneEtcGmtNeg3 = "ETC_GMT_NEG_3" - - // TimezoneEtcGmtNeg4 is a Timezone enum value - TimezoneEtcGmtNeg4 = "ETC_GMT_NEG_4" - - // TimezoneEtcGmtNeg5 is a Timezone enum value - TimezoneEtcGmtNeg5 = "ETC_GMT_NEG_5" - - // TimezoneEtcGmtNeg6 is a Timezone enum value - TimezoneEtcGmtNeg6 = "ETC_GMT_NEG_6" - - // TimezoneEtcGmtNeg7 is a Timezone enum value - TimezoneEtcGmtNeg7 = "ETC_GMT_NEG_7" - - // TimezoneEtcGmtNeg8 is a Timezone enum value - TimezoneEtcGmtNeg8 = "ETC_GMT_NEG_8" - - // TimezoneEtcGmtNeg9 is a Timezone enum value - TimezoneEtcGmtNeg9 = "ETC_GMT_NEG_9" - - // TimezoneEuropeDublin is a Timezone enum value - TimezoneEuropeDublin = "EUROPE_DUBLIN" - - // TimezoneEuropeLondon is a Timezone enum value - TimezoneEuropeLondon = "EUROPE_LONDON" - - // TimezoneEuropeParis is a Timezone enum value - TimezoneEuropeParis = "EUROPE_PARIS" - - // TimezoneEuropeStockholm is a Timezone enum value - TimezoneEuropeStockholm = "EUROPE_STOCKHOLM" - - // TimezoneEuropeZurich is a Timezone enum value - TimezoneEuropeZurich = "EUROPE_ZURICH" - - // TimezoneIsrael is a Timezone enum value - TimezoneIsrael = "ISRAEL" - - // TimezoneMexicoGeneral is a Timezone enum value - TimezoneMexicoGeneral = "MEXICO_GENERAL" - - // TimezoneMst7mdt is a Timezone enum value - TimezoneMst7mdt = "MST7MDT" - - // TimezonePacificAuckland is a Timezone enum value - TimezonePacificAuckland = "PACIFIC_AUCKLAND" - - // TimezoneUsCentral is a Timezone enum value - TimezoneUsCentral = "US_CENTRAL" - - // TimezoneUsEastern is a Timezone enum value - TimezoneUsEastern = "US_EASTERN" - - // TimezoneUsMountain is a Timezone enum value - TimezoneUsMountain = "US_MOUNTAIN" - - // TimezoneUsPacific is a Timezone enum value - TimezoneUsPacific = "US_PACIFIC" -) - -// Timezone_Values returns all elements of the Timezone enum -func Timezone_Values() []string { - return []string{ - TimezoneUtc, - TimezoneAfricaJohannesburg, - TimezoneAmericaMontreal, - TimezoneAmericaSaoPaulo, - TimezoneAsiaBahrain, - TimezoneAsiaBangkok, - TimezoneAsiaCalcutta, - TimezoneAsiaDubai, - TimezoneAsiaHongKong, - TimezoneAsiaJakarta, - TimezoneAsiaKualaLumpur, - TimezoneAsiaSeoul, - TimezoneAsiaShanghai, - TimezoneAsiaSingapore, - TimezoneAsiaTaipei, - TimezoneAsiaTokyo, - TimezoneAustraliaMelbourne, - TimezoneAustraliaSydney, - TimezoneCanadaCentral, - TimezoneCet, - TimezoneCst6cdt, - TimezoneEtcGmt, - TimezoneEtcGmt0, - TimezoneEtcGmtAdd0, - TimezoneEtcGmtAdd1, - TimezoneEtcGmtAdd10, - TimezoneEtcGmtAdd11, - TimezoneEtcGmtAdd12, - TimezoneEtcGmtAdd2, - TimezoneEtcGmtAdd3, - TimezoneEtcGmtAdd4, - TimezoneEtcGmtAdd5, - TimezoneEtcGmtAdd6, - TimezoneEtcGmtAdd7, - TimezoneEtcGmtAdd8, - TimezoneEtcGmtAdd9, - TimezoneEtcGmtNeg0, - TimezoneEtcGmtNeg1, - TimezoneEtcGmtNeg10, - TimezoneEtcGmtNeg11, - TimezoneEtcGmtNeg12, - TimezoneEtcGmtNeg13, - TimezoneEtcGmtNeg14, - TimezoneEtcGmtNeg2, - TimezoneEtcGmtNeg3, - TimezoneEtcGmtNeg4, - TimezoneEtcGmtNeg5, - TimezoneEtcGmtNeg6, - TimezoneEtcGmtNeg7, - TimezoneEtcGmtNeg8, - TimezoneEtcGmtNeg9, - TimezoneEuropeDublin, - TimezoneEuropeLondon, - TimezoneEuropeParis, - TimezoneEuropeStockholm, - TimezoneEuropeZurich, - TimezoneIsrael, - TimezoneMexicoGeneral, - TimezoneMst7mdt, - TimezonePacificAuckland, - TimezoneUsCentral, - TimezoneUsEastern, - TimezoneUsMountain, - TimezoneUsPacific, - } -} - -const ( - // TypesSearchScopeAssetType is a TypesSearchScope enum value - TypesSearchScopeAssetType = "ASSET_TYPE" - - // TypesSearchScopeFormType is a TypesSearchScope enum value - TypesSearchScopeFormType = "FORM_TYPE" -) - -// TypesSearchScope_Values returns all elements of the TypesSearchScope enum -func TypesSearchScope_Values() []string { - return []string{ - TypesSearchScopeAssetType, - TypesSearchScopeFormType, - } -} - -const ( - // UserAssignmentAutomatic is a UserAssignment enum value - UserAssignmentAutomatic = "AUTOMATIC" - - // UserAssignmentManual is a UserAssignment enum value - UserAssignmentManual = "MANUAL" -) - -// UserAssignment_Values returns all elements of the UserAssignment enum -func UserAssignment_Values() []string { - return []string{ - UserAssignmentAutomatic, - UserAssignmentManual, - } -} - -const ( - // UserDesignationProjectOwner is a UserDesignation enum value - UserDesignationProjectOwner = "PROJECT_OWNER" - - // UserDesignationProjectContributor is a UserDesignation enum value - UserDesignationProjectContributor = "PROJECT_CONTRIBUTOR" -) - -// UserDesignation_Values returns all elements of the UserDesignation enum -func UserDesignation_Values() []string { - return []string{ - UserDesignationProjectOwner, - UserDesignationProjectContributor, - } -} - -const ( - // UserProfileStatusAssigned is a UserProfileStatus enum value - UserProfileStatusAssigned = "ASSIGNED" - - // UserProfileStatusNotAssigned is a UserProfileStatus enum value - UserProfileStatusNotAssigned = "NOT_ASSIGNED" - - // UserProfileStatusActivated is a UserProfileStatus enum value - UserProfileStatusActivated = "ACTIVATED" - - // UserProfileStatusDeactivated is a UserProfileStatus enum value - UserProfileStatusDeactivated = "DEACTIVATED" -) - -// UserProfileStatus_Values returns all elements of the UserProfileStatus enum -func UserProfileStatus_Values() []string { - return []string{ - UserProfileStatusAssigned, - UserProfileStatusNotAssigned, - UserProfileStatusActivated, - UserProfileStatusDeactivated, - } -} - -const ( - // UserProfileTypeIam is a UserProfileType enum value - UserProfileTypeIam = "IAM" - - // UserProfileTypeSso is a UserProfileType enum value - UserProfileTypeSso = "SSO" -) - -// UserProfileType_Values returns all elements of the UserProfileType enum -func UserProfileType_Values() []string { - return []string{ - UserProfileTypeIam, - UserProfileTypeSso, - } -} - -const ( - // UserSearchTypeSsoUser is a UserSearchType enum value - UserSearchTypeSsoUser = "SSO_USER" - - // UserSearchTypeDatazoneUser is a UserSearchType enum value - UserSearchTypeDatazoneUser = "DATAZONE_USER" - - // UserSearchTypeDatazoneSsoUser is a UserSearchType enum value - UserSearchTypeDatazoneSsoUser = "DATAZONE_SSO_USER" - - // UserSearchTypeDatazoneIamUser is a UserSearchType enum value - UserSearchTypeDatazoneIamUser = "DATAZONE_IAM_USER" -) - -// UserSearchType_Values returns all elements of the UserSearchType enum -func UserSearchType_Values() []string { - return []string{ - UserSearchTypeSsoUser, - UserSearchTypeDatazoneUser, - UserSearchTypeDatazoneSsoUser, - UserSearchTypeDatazoneIamUser, - } -} - -const ( - // UserTypeIamUser is a UserType enum value - UserTypeIamUser = "IAM_USER" - - // UserTypeIamRole is a UserType enum value - UserTypeIamRole = "IAM_ROLE" - - // UserTypeSsoUser is a UserType enum value - UserTypeSsoUser = "SSO_USER" -) - -// UserType_Values returns all elements of the UserType enum -func UserType_Values() []string { - return []string{ - UserTypeIamUser, - UserTypeIamRole, - UserTypeSsoUser, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/datazoneiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/datazoneiface/interface.go deleted file mode 100644 index ae46120732c6..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/datazoneiface/interface.go +++ /dev/null @@ -1,523 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package datazoneiface provides an interface to enable mocking the Amazon DataZone service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package datazoneiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone" -) - -// DataZoneAPI provides an interface to enable mocking the -// datazone.DataZone service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon DataZone. -// func myFunc(svc datazoneiface.DataZoneAPI) bool { -// // Make svc.AcceptPredictions request -// } -// -// func main() { -// sess := session.New() -// svc := datazone.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockDataZoneClient struct { -// datazoneiface.DataZoneAPI -// } -// func (m *mockDataZoneClient) AcceptPredictions(input *datazone.AcceptPredictionsInput) (*datazone.AcceptPredictionsOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockDataZoneClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type DataZoneAPI interface { - AcceptPredictions(*datazone.AcceptPredictionsInput) (*datazone.AcceptPredictionsOutput, error) - AcceptPredictionsWithContext(aws.Context, *datazone.AcceptPredictionsInput, ...request.Option) (*datazone.AcceptPredictionsOutput, error) - AcceptPredictionsRequest(*datazone.AcceptPredictionsInput) (*request.Request, *datazone.AcceptPredictionsOutput) - - AcceptSubscriptionRequest(*datazone.AcceptSubscriptionRequestInput) (*datazone.AcceptSubscriptionRequestOutput, error) - AcceptSubscriptionRequestWithContext(aws.Context, *datazone.AcceptSubscriptionRequestInput, ...request.Option) (*datazone.AcceptSubscriptionRequestOutput, error) - AcceptSubscriptionRequestRequest(*datazone.AcceptSubscriptionRequestInput) (*request.Request, *datazone.AcceptSubscriptionRequestOutput) - - CancelSubscription(*datazone.CancelSubscriptionInput) (*datazone.CancelSubscriptionOutput, error) - CancelSubscriptionWithContext(aws.Context, *datazone.CancelSubscriptionInput, ...request.Option) (*datazone.CancelSubscriptionOutput, error) - CancelSubscriptionRequest(*datazone.CancelSubscriptionInput) (*request.Request, *datazone.CancelSubscriptionOutput) - - CreateAsset(*datazone.CreateAssetInput) (*datazone.CreateAssetOutput, error) - CreateAssetWithContext(aws.Context, *datazone.CreateAssetInput, ...request.Option) (*datazone.CreateAssetOutput, error) - CreateAssetRequest(*datazone.CreateAssetInput) (*request.Request, *datazone.CreateAssetOutput) - - CreateAssetRevision(*datazone.CreateAssetRevisionInput) (*datazone.CreateAssetRevisionOutput, error) - CreateAssetRevisionWithContext(aws.Context, *datazone.CreateAssetRevisionInput, ...request.Option) (*datazone.CreateAssetRevisionOutput, error) - CreateAssetRevisionRequest(*datazone.CreateAssetRevisionInput) (*request.Request, *datazone.CreateAssetRevisionOutput) - - CreateAssetType(*datazone.CreateAssetTypeInput) (*datazone.CreateAssetTypeOutput, error) - CreateAssetTypeWithContext(aws.Context, *datazone.CreateAssetTypeInput, ...request.Option) (*datazone.CreateAssetTypeOutput, error) - CreateAssetTypeRequest(*datazone.CreateAssetTypeInput) (*request.Request, *datazone.CreateAssetTypeOutput) - - CreateDataSource(*datazone.CreateDataSourceInput) (*datazone.CreateDataSourceOutput, error) - CreateDataSourceWithContext(aws.Context, *datazone.CreateDataSourceInput, ...request.Option) (*datazone.CreateDataSourceOutput, error) - CreateDataSourceRequest(*datazone.CreateDataSourceInput) (*request.Request, *datazone.CreateDataSourceOutput) - - CreateDomain(*datazone.CreateDomainInput) (*datazone.CreateDomainOutput, error) - CreateDomainWithContext(aws.Context, *datazone.CreateDomainInput, ...request.Option) (*datazone.CreateDomainOutput, error) - CreateDomainRequest(*datazone.CreateDomainInput) (*request.Request, *datazone.CreateDomainOutput) - - CreateEnvironment(*datazone.CreateEnvironmentInput) (*datazone.CreateEnvironmentOutput, error) - CreateEnvironmentWithContext(aws.Context, *datazone.CreateEnvironmentInput, ...request.Option) (*datazone.CreateEnvironmentOutput, error) - CreateEnvironmentRequest(*datazone.CreateEnvironmentInput) (*request.Request, *datazone.CreateEnvironmentOutput) - - CreateEnvironmentProfile(*datazone.CreateEnvironmentProfileInput) (*datazone.CreateEnvironmentProfileOutput, error) - CreateEnvironmentProfileWithContext(aws.Context, *datazone.CreateEnvironmentProfileInput, ...request.Option) (*datazone.CreateEnvironmentProfileOutput, error) - CreateEnvironmentProfileRequest(*datazone.CreateEnvironmentProfileInput) (*request.Request, *datazone.CreateEnvironmentProfileOutput) - - CreateFormType(*datazone.CreateFormTypeInput) (*datazone.CreateFormTypeOutput, error) - CreateFormTypeWithContext(aws.Context, *datazone.CreateFormTypeInput, ...request.Option) (*datazone.CreateFormTypeOutput, error) - CreateFormTypeRequest(*datazone.CreateFormTypeInput) (*request.Request, *datazone.CreateFormTypeOutput) - - CreateGlossary(*datazone.CreateGlossaryInput) (*datazone.CreateGlossaryOutput, error) - CreateGlossaryWithContext(aws.Context, *datazone.CreateGlossaryInput, ...request.Option) (*datazone.CreateGlossaryOutput, error) - CreateGlossaryRequest(*datazone.CreateGlossaryInput) (*request.Request, *datazone.CreateGlossaryOutput) - - CreateGlossaryTerm(*datazone.CreateGlossaryTermInput) (*datazone.CreateGlossaryTermOutput, error) - CreateGlossaryTermWithContext(aws.Context, *datazone.CreateGlossaryTermInput, ...request.Option) (*datazone.CreateGlossaryTermOutput, error) - CreateGlossaryTermRequest(*datazone.CreateGlossaryTermInput) (*request.Request, *datazone.CreateGlossaryTermOutput) - - CreateGroupProfile(*datazone.CreateGroupProfileInput) (*datazone.CreateGroupProfileOutput, error) - CreateGroupProfileWithContext(aws.Context, *datazone.CreateGroupProfileInput, ...request.Option) (*datazone.CreateGroupProfileOutput, error) - CreateGroupProfileRequest(*datazone.CreateGroupProfileInput) (*request.Request, *datazone.CreateGroupProfileOutput) - - CreateListingChangeSet(*datazone.CreateListingChangeSetInput) (*datazone.CreateListingChangeSetOutput, error) - CreateListingChangeSetWithContext(aws.Context, *datazone.CreateListingChangeSetInput, ...request.Option) (*datazone.CreateListingChangeSetOutput, error) - CreateListingChangeSetRequest(*datazone.CreateListingChangeSetInput) (*request.Request, *datazone.CreateListingChangeSetOutput) - - CreateProject(*datazone.CreateProjectInput) (*datazone.CreateProjectOutput, error) - CreateProjectWithContext(aws.Context, *datazone.CreateProjectInput, ...request.Option) (*datazone.CreateProjectOutput, error) - CreateProjectRequest(*datazone.CreateProjectInput) (*request.Request, *datazone.CreateProjectOutput) - - CreateProjectMembership(*datazone.CreateProjectMembershipInput) (*datazone.CreateProjectMembershipOutput, error) - CreateProjectMembershipWithContext(aws.Context, *datazone.CreateProjectMembershipInput, ...request.Option) (*datazone.CreateProjectMembershipOutput, error) - CreateProjectMembershipRequest(*datazone.CreateProjectMembershipInput) (*request.Request, *datazone.CreateProjectMembershipOutput) - - CreateSubscriptionGrant(*datazone.CreateSubscriptionGrantInput) (*datazone.CreateSubscriptionGrantOutput, error) - CreateSubscriptionGrantWithContext(aws.Context, *datazone.CreateSubscriptionGrantInput, ...request.Option) (*datazone.CreateSubscriptionGrantOutput, error) - CreateSubscriptionGrantRequest(*datazone.CreateSubscriptionGrantInput) (*request.Request, *datazone.CreateSubscriptionGrantOutput) - - CreateSubscriptionRequest(*datazone.CreateSubscriptionRequestInput) (*datazone.CreateSubscriptionRequestOutput, error) - CreateSubscriptionRequestWithContext(aws.Context, *datazone.CreateSubscriptionRequestInput, ...request.Option) (*datazone.CreateSubscriptionRequestOutput, error) - CreateSubscriptionRequestRequest(*datazone.CreateSubscriptionRequestInput) (*request.Request, *datazone.CreateSubscriptionRequestOutput) - - CreateSubscriptionTarget(*datazone.CreateSubscriptionTargetInput) (*datazone.CreateSubscriptionTargetOutput, error) - CreateSubscriptionTargetWithContext(aws.Context, *datazone.CreateSubscriptionTargetInput, ...request.Option) (*datazone.CreateSubscriptionTargetOutput, error) - CreateSubscriptionTargetRequest(*datazone.CreateSubscriptionTargetInput) (*request.Request, *datazone.CreateSubscriptionTargetOutput) - - CreateUserProfile(*datazone.CreateUserProfileInput) (*datazone.CreateUserProfileOutput, error) - CreateUserProfileWithContext(aws.Context, *datazone.CreateUserProfileInput, ...request.Option) (*datazone.CreateUserProfileOutput, error) - CreateUserProfileRequest(*datazone.CreateUserProfileInput) (*request.Request, *datazone.CreateUserProfileOutput) - - DeleteAsset(*datazone.DeleteAssetInput) (*datazone.DeleteAssetOutput, error) - DeleteAssetWithContext(aws.Context, *datazone.DeleteAssetInput, ...request.Option) (*datazone.DeleteAssetOutput, error) - DeleteAssetRequest(*datazone.DeleteAssetInput) (*request.Request, *datazone.DeleteAssetOutput) - - DeleteAssetType(*datazone.DeleteAssetTypeInput) (*datazone.DeleteAssetTypeOutput, error) - DeleteAssetTypeWithContext(aws.Context, *datazone.DeleteAssetTypeInput, ...request.Option) (*datazone.DeleteAssetTypeOutput, error) - DeleteAssetTypeRequest(*datazone.DeleteAssetTypeInput) (*request.Request, *datazone.DeleteAssetTypeOutput) - - DeleteDataSource(*datazone.DeleteDataSourceInput) (*datazone.DeleteDataSourceOutput, error) - DeleteDataSourceWithContext(aws.Context, *datazone.DeleteDataSourceInput, ...request.Option) (*datazone.DeleteDataSourceOutput, error) - DeleteDataSourceRequest(*datazone.DeleteDataSourceInput) (*request.Request, *datazone.DeleteDataSourceOutput) - - DeleteDomain(*datazone.DeleteDomainInput) (*datazone.DeleteDomainOutput, error) - DeleteDomainWithContext(aws.Context, *datazone.DeleteDomainInput, ...request.Option) (*datazone.DeleteDomainOutput, error) - DeleteDomainRequest(*datazone.DeleteDomainInput) (*request.Request, *datazone.DeleteDomainOutput) - - DeleteEnvironment(*datazone.DeleteEnvironmentInput) (*datazone.DeleteEnvironmentOutput, error) - DeleteEnvironmentWithContext(aws.Context, *datazone.DeleteEnvironmentInput, ...request.Option) (*datazone.DeleteEnvironmentOutput, error) - DeleteEnvironmentRequest(*datazone.DeleteEnvironmentInput) (*request.Request, *datazone.DeleteEnvironmentOutput) - - DeleteEnvironmentBlueprintConfiguration(*datazone.DeleteEnvironmentBlueprintConfigurationInput) (*datazone.DeleteEnvironmentBlueprintConfigurationOutput, error) - DeleteEnvironmentBlueprintConfigurationWithContext(aws.Context, *datazone.DeleteEnvironmentBlueprintConfigurationInput, ...request.Option) (*datazone.DeleteEnvironmentBlueprintConfigurationOutput, error) - DeleteEnvironmentBlueprintConfigurationRequest(*datazone.DeleteEnvironmentBlueprintConfigurationInput) (*request.Request, *datazone.DeleteEnvironmentBlueprintConfigurationOutput) - - DeleteEnvironmentProfile(*datazone.DeleteEnvironmentProfileInput) (*datazone.DeleteEnvironmentProfileOutput, error) - DeleteEnvironmentProfileWithContext(aws.Context, *datazone.DeleteEnvironmentProfileInput, ...request.Option) (*datazone.DeleteEnvironmentProfileOutput, error) - DeleteEnvironmentProfileRequest(*datazone.DeleteEnvironmentProfileInput) (*request.Request, *datazone.DeleteEnvironmentProfileOutput) - - DeleteFormType(*datazone.DeleteFormTypeInput) (*datazone.DeleteFormTypeOutput, error) - DeleteFormTypeWithContext(aws.Context, *datazone.DeleteFormTypeInput, ...request.Option) (*datazone.DeleteFormTypeOutput, error) - DeleteFormTypeRequest(*datazone.DeleteFormTypeInput) (*request.Request, *datazone.DeleteFormTypeOutput) - - DeleteGlossary(*datazone.DeleteGlossaryInput) (*datazone.DeleteGlossaryOutput, error) - DeleteGlossaryWithContext(aws.Context, *datazone.DeleteGlossaryInput, ...request.Option) (*datazone.DeleteGlossaryOutput, error) - DeleteGlossaryRequest(*datazone.DeleteGlossaryInput) (*request.Request, *datazone.DeleteGlossaryOutput) - - DeleteGlossaryTerm(*datazone.DeleteGlossaryTermInput) (*datazone.DeleteGlossaryTermOutput, error) - DeleteGlossaryTermWithContext(aws.Context, *datazone.DeleteGlossaryTermInput, ...request.Option) (*datazone.DeleteGlossaryTermOutput, error) - DeleteGlossaryTermRequest(*datazone.DeleteGlossaryTermInput) (*request.Request, *datazone.DeleteGlossaryTermOutput) - - DeleteListing(*datazone.DeleteListingInput) (*datazone.DeleteListingOutput, error) - DeleteListingWithContext(aws.Context, *datazone.DeleteListingInput, ...request.Option) (*datazone.DeleteListingOutput, error) - DeleteListingRequest(*datazone.DeleteListingInput) (*request.Request, *datazone.DeleteListingOutput) - - DeleteProject(*datazone.DeleteProjectInput) (*datazone.DeleteProjectOutput, error) - DeleteProjectWithContext(aws.Context, *datazone.DeleteProjectInput, ...request.Option) (*datazone.DeleteProjectOutput, error) - DeleteProjectRequest(*datazone.DeleteProjectInput) (*request.Request, *datazone.DeleteProjectOutput) - - DeleteProjectMembership(*datazone.DeleteProjectMembershipInput) (*datazone.DeleteProjectMembershipOutput, error) - DeleteProjectMembershipWithContext(aws.Context, *datazone.DeleteProjectMembershipInput, ...request.Option) (*datazone.DeleteProjectMembershipOutput, error) - DeleteProjectMembershipRequest(*datazone.DeleteProjectMembershipInput) (*request.Request, *datazone.DeleteProjectMembershipOutput) - - DeleteSubscriptionGrant(*datazone.DeleteSubscriptionGrantInput) (*datazone.DeleteSubscriptionGrantOutput, error) - DeleteSubscriptionGrantWithContext(aws.Context, *datazone.DeleteSubscriptionGrantInput, ...request.Option) (*datazone.DeleteSubscriptionGrantOutput, error) - DeleteSubscriptionGrantRequest(*datazone.DeleteSubscriptionGrantInput) (*request.Request, *datazone.DeleteSubscriptionGrantOutput) - - DeleteSubscriptionRequest(*datazone.DeleteSubscriptionRequestInput) (*datazone.DeleteSubscriptionRequestOutput, error) - DeleteSubscriptionRequestWithContext(aws.Context, *datazone.DeleteSubscriptionRequestInput, ...request.Option) (*datazone.DeleteSubscriptionRequestOutput, error) - DeleteSubscriptionRequestRequest(*datazone.DeleteSubscriptionRequestInput) (*request.Request, *datazone.DeleteSubscriptionRequestOutput) - - DeleteSubscriptionTarget(*datazone.DeleteSubscriptionTargetInput) (*datazone.DeleteSubscriptionTargetOutput, error) - DeleteSubscriptionTargetWithContext(aws.Context, *datazone.DeleteSubscriptionTargetInput, ...request.Option) (*datazone.DeleteSubscriptionTargetOutput, error) - DeleteSubscriptionTargetRequest(*datazone.DeleteSubscriptionTargetInput) (*request.Request, *datazone.DeleteSubscriptionTargetOutput) - - GetAsset(*datazone.GetAssetInput) (*datazone.GetAssetOutput, error) - GetAssetWithContext(aws.Context, *datazone.GetAssetInput, ...request.Option) (*datazone.GetAssetOutput, error) - GetAssetRequest(*datazone.GetAssetInput) (*request.Request, *datazone.GetAssetOutput) - - GetAssetType(*datazone.GetAssetTypeInput) (*datazone.GetAssetTypeOutput, error) - GetAssetTypeWithContext(aws.Context, *datazone.GetAssetTypeInput, ...request.Option) (*datazone.GetAssetTypeOutput, error) - GetAssetTypeRequest(*datazone.GetAssetTypeInput) (*request.Request, *datazone.GetAssetTypeOutput) - - GetDataSource(*datazone.GetDataSourceInput) (*datazone.GetDataSourceOutput, error) - GetDataSourceWithContext(aws.Context, *datazone.GetDataSourceInput, ...request.Option) (*datazone.GetDataSourceOutput, error) - GetDataSourceRequest(*datazone.GetDataSourceInput) (*request.Request, *datazone.GetDataSourceOutput) - - GetDataSourceRun(*datazone.GetDataSourceRunInput) (*datazone.GetDataSourceRunOutput, error) - GetDataSourceRunWithContext(aws.Context, *datazone.GetDataSourceRunInput, ...request.Option) (*datazone.GetDataSourceRunOutput, error) - GetDataSourceRunRequest(*datazone.GetDataSourceRunInput) (*request.Request, *datazone.GetDataSourceRunOutput) - - GetDomain(*datazone.GetDomainInput) (*datazone.GetDomainOutput, error) - GetDomainWithContext(aws.Context, *datazone.GetDomainInput, ...request.Option) (*datazone.GetDomainOutput, error) - GetDomainRequest(*datazone.GetDomainInput) (*request.Request, *datazone.GetDomainOutput) - - GetEnvironment(*datazone.GetEnvironmentInput) (*datazone.GetEnvironmentOutput, error) - GetEnvironmentWithContext(aws.Context, *datazone.GetEnvironmentInput, ...request.Option) (*datazone.GetEnvironmentOutput, error) - GetEnvironmentRequest(*datazone.GetEnvironmentInput) (*request.Request, *datazone.GetEnvironmentOutput) - - GetEnvironmentBlueprint(*datazone.GetEnvironmentBlueprintInput) (*datazone.GetEnvironmentBlueprintOutput, error) - GetEnvironmentBlueprintWithContext(aws.Context, *datazone.GetEnvironmentBlueprintInput, ...request.Option) (*datazone.GetEnvironmentBlueprintOutput, error) - GetEnvironmentBlueprintRequest(*datazone.GetEnvironmentBlueprintInput) (*request.Request, *datazone.GetEnvironmentBlueprintOutput) - - GetEnvironmentBlueprintConfiguration(*datazone.GetEnvironmentBlueprintConfigurationInput) (*datazone.GetEnvironmentBlueprintConfigurationOutput, error) - GetEnvironmentBlueprintConfigurationWithContext(aws.Context, *datazone.GetEnvironmentBlueprintConfigurationInput, ...request.Option) (*datazone.GetEnvironmentBlueprintConfigurationOutput, error) - GetEnvironmentBlueprintConfigurationRequest(*datazone.GetEnvironmentBlueprintConfigurationInput) (*request.Request, *datazone.GetEnvironmentBlueprintConfigurationOutput) - - GetEnvironmentProfile(*datazone.GetEnvironmentProfileInput) (*datazone.GetEnvironmentProfileOutput, error) - GetEnvironmentProfileWithContext(aws.Context, *datazone.GetEnvironmentProfileInput, ...request.Option) (*datazone.GetEnvironmentProfileOutput, error) - GetEnvironmentProfileRequest(*datazone.GetEnvironmentProfileInput) (*request.Request, *datazone.GetEnvironmentProfileOutput) - - GetFormType(*datazone.GetFormTypeInput) (*datazone.GetFormTypeOutput, error) - GetFormTypeWithContext(aws.Context, *datazone.GetFormTypeInput, ...request.Option) (*datazone.GetFormTypeOutput, error) - GetFormTypeRequest(*datazone.GetFormTypeInput) (*request.Request, *datazone.GetFormTypeOutput) - - GetGlossary(*datazone.GetGlossaryInput) (*datazone.GetGlossaryOutput, error) - GetGlossaryWithContext(aws.Context, *datazone.GetGlossaryInput, ...request.Option) (*datazone.GetGlossaryOutput, error) - GetGlossaryRequest(*datazone.GetGlossaryInput) (*request.Request, *datazone.GetGlossaryOutput) - - GetGlossaryTerm(*datazone.GetGlossaryTermInput) (*datazone.GetGlossaryTermOutput, error) - GetGlossaryTermWithContext(aws.Context, *datazone.GetGlossaryTermInput, ...request.Option) (*datazone.GetGlossaryTermOutput, error) - GetGlossaryTermRequest(*datazone.GetGlossaryTermInput) (*request.Request, *datazone.GetGlossaryTermOutput) - - GetGroupProfile(*datazone.GetGroupProfileInput) (*datazone.GetGroupProfileOutput, error) - GetGroupProfileWithContext(aws.Context, *datazone.GetGroupProfileInput, ...request.Option) (*datazone.GetGroupProfileOutput, error) - GetGroupProfileRequest(*datazone.GetGroupProfileInput) (*request.Request, *datazone.GetGroupProfileOutput) - - GetIamPortalLoginUrl(*datazone.GetIamPortalLoginUrlInput) (*datazone.GetIamPortalLoginUrlOutput, error) - GetIamPortalLoginUrlWithContext(aws.Context, *datazone.GetIamPortalLoginUrlInput, ...request.Option) (*datazone.GetIamPortalLoginUrlOutput, error) - GetIamPortalLoginUrlRequest(*datazone.GetIamPortalLoginUrlInput) (*request.Request, *datazone.GetIamPortalLoginUrlOutput) - - GetListing(*datazone.GetListingInput) (*datazone.GetListingOutput, error) - GetListingWithContext(aws.Context, *datazone.GetListingInput, ...request.Option) (*datazone.GetListingOutput, error) - GetListingRequest(*datazone.GetListingInput) (*request.Request, *datazone.GetListingOutput) - - GetProject(*datazone.GetProjectInput) (*datazone.GetProjectOutput, error) - GetProjectWithContext(aws.Context, *datazone.GetProjectInput, ...request.Option) (*datazone.GetProjectOutput, error) - GetProjectRequest(*datazone.GetProjectInput) (*request.Request, *datazone.GetProjectOutput) - - GetSubscription(*datazone.GetSubscriptionInput) (*datazone.GetSubscriptionOutput, error) - GetSubscriptionWithContext(aws.Context, *datazone.GetSubscriptionInput, ...request.Option) (*datazone.GetSubscriptionOutput, error) - GetSubscriptionRequest(*datazone.GetSubscriptionInput) (*request.Request, *datazone.GetSubscriptionOutput) - - GetSubscriptionGrant(*datazone.GetSubscriptionGrantInput) (*datazone.GetSubscriptionGrantOutput, error) - GetSubscriptionGrantWithContext(aws.Context, *datazone.GetSubscriptionGrantInput, ...request.Option) (*datazone.GetSubscriptionGrantOutput, error) - GetSubscriptionGrantRequest(*datazone.GetSubscriptionGrantInput) (*request.Request, *datazone.GetSubscriptionGrantOutput) - - GetSubscriptionRequestDetails(*datazone.GetSubscriptionRequestDetailsInput) (*datazone.GetSubscriptionRequestDetailsOutput, error) - GetSubscriptionRequestDetailsWithContext(aws.Context, *datazone.GetSubscriptionRequestDetailsInput, ...request.Option) (*datazone.GetSubscriptionRequestDetailsOutput, error) - GetSubscriptionRequestDetailsRequest(*datazone.GetSubscriptionRequestDetailsInput) (*request.Request, *datazone.GetSubscriptionRequestDetailsOutput) - - GetSubscriptionTarget(*datazone.GetSubscriptionTargetInput) (*datazone.GetSubscriptionTargetOutput, error) - GetSubscriptionTargetWithContext(aws.Context, *datazone.GetSubscriptionTargetInput, ...request.Option) (*datazone.GetSubscriptionTargetOutput, error) - GetSubscriptionTargetRequest(*datazone.GetSubscriptionTargetInput) (*request.Request, *datazone.GetSubscriptionTargetOutput) - - GetUserProfile(*datazone.GetUserProfileInput) (*datazone.GetUserProfileOutput, error) - GetUserProfileWithContext(aws.Context, *datazone.GetUserProfileInput, ...request.Option) (*datazone.GetUserProfileOutput, error) - GetUserProfileRequest(*datazone.GetUserProfileInput) (*request.Request, *datazone.GetUserProfileOutput) - - ListAssetRevisions(*datazone.ListAssetRevisionsInput) (*datazone.ListAssetRevisionsOutput, error) - ListAssetRevisionsWithContext(aws.Context, *datazone.ListAssetRevisionsInput, ...request.Option) (*datazone.ListAssetRevisionsOutput, error) - ListAssetRevisionsRequest(*datazone.ListAssetRevisionsInput) (*request.Request, *datazone.ListAssetRevisionsOutput) - - ListAssetRevisionsPages(*datazone.ListAssetRevisionsInput, func(*datazone.ListAssetRevisionsOutput, bool) bool) error - ListAssetRevisionsPagesWithContext(aws.Context, *datazone.ListAssetRevisionsInput, func(*datazone.ListAssetRevisionsOutput, bool) bool, ...request.Option) error - - ListDataSourceRunActivities(*datazone.ListDataSourceRunActivitiesInput) (*datazone.ListDataSourceRunActivitiesOutput, error) - ListDataSourceRunActivitiesWithContext(aws.Context, *datazone.ListDataSourceRunActivitiesInput, ...request.Option) (*datazone.ListDataSourceRunActivitiesOutput, error) - ListDataSourceRunActivitiesRequest(*datazone.ListDataSourceRunActivitiesInput) (*request.Request, *datazone.ListDataSourceRunActivitiesOutput) - - ListDataSourceRunActivitiesPages(*datazone.ListDataSourceRunActivitiesInput, func(*datazone.ListDataSourceRunActivitiesOutput, bool) bool) error - ListDataSourceRunActivitiesPagesWithContext(aws.Context, *datazone.ListDataSourceRunActivitiesInput, func(*datazone.ListDataSourceRunActivitiesOutput, bool) bool, ...request.Option) error - - ListDataSourceRuns(*datazone.ListDataSourceRunsInput) (*datazone.ListDataSourceRunsOutput, error) - ListDataSourceRunsWithContext(aws.Context, *datazone.ListDataSourceRunsInput, ...request.Option) (*datazone.ListDataSourceRunsOutput, error) - ListDataSourceRunsRequest(*datazone.ListDataSourceRunsInput) (*request.Request, *datazone.ListDataSourceRunsOutput) - - ListDataSourceRunsPages(*datazone.ListDataSourceRunsInput, func(*datazone.ListDataSourceRunsOutput, bool) bool) error - ListDataSourceRunsPagesWithContext(aws.Context, *datazone.ListDataSourceRunsInput, func(*datazone.ListDataSourceRunsOutput, bool) bool, ...request.Option) error - - ListDataSources(*datazone.ListDataSourcesInput) (*datazone.ListDataSourcesOutput, error) - ListDataSourcesWithContext(aws.Context, *datazone.ListDataSourcesInput, ...request.Option) (*datazone.ListDataSourcesOutput, error) - ListDataSourcesRequest(*datazone.ListDataSourcesInput) (*request.Request, *datazone.ListDataSourcesOutput) - - ListDataSourcesPages(*datazone.ListDataSourcesInput, func(*datazone.ListDataSourcesOutput, bool) bool) error - ListDataSourcesPagesWithContext(aws.Context, *datazone.ListDataSourcesInput, func(*datazone.ListDataSourcesOutput, bool) bool, ...request.Option) error - - ListDomains(*datazone.ListDomainsInput) (*datazone.ListDomainsOutput, error) - ListDomainsWithContext(aws.Context, *datazone.ListDomainsInput, ...request.Option) (*datazone.ListDomainsOutput, error) - ListDomainsRequest(*datazone.ListDomainsInput) (*request.Request, *datazone.ListDomainsOutput) - - ListDomainsPages(*datazone.ListDomainsInput, func(*datazone.ListDomainsOutput, bool) bool) error - ListDomainsPagesWithContext(aws.Context, *datazone.ListDomainsInput, func(*datazone.ListDomainsOutput, bool) bool, ...request.Option) error - - ListEnvironmentBlueprintConfigurations(*datazone.ListEnvironmentBlueprintConfigurationsInput) (*datazone.ListEnvironmentBlueprintConfigurationsOutput, error) - ListEnvironmentBlueprintConfigurationsWithContext(aws.Context, *datazone.ListEnvironmentBlueprintConfigurationsInput, ...request.Option) (*datazone.ListEnvironmentBlueprintConfigurationsOutput, error) - ListEnvironmentBlueprintConfigurationsRequest(*datazone.ListEnvironmentBlueprintConfigurationsInput) (*request.Request, *datazone.ListEnvironmentBlueprintConfigurationsOutput) - - ListEnvironmentBlueprintConfigurationsPages(*datazone.ListEnvironmentBlueprintConfigurationsInput, func(*datazone.ListEnvironmentBlueprintConfigurationsOutput, bool) bool) error - ListEnvironmentBlueprintConfigurationsPagesWithContext(aws.Context, *datazone.ListEnvironmentBlueprintConfigurationsInput, func(*datazone.ListEnvironmentBlueprintConfigurationsOutput, bool) bool, ...request.Option) error - - ListEnvironmentBlueprints(*datazone.ListEnvironmentBlueprintsInput) (*datazone.ListEnvironmentBlueprintsOutput, error) - ListEnvironmentBlueprintsWithContext(aws.Context, *datazone.ListEnvironmentBlueprintsInput, ...request.Option) (*datazone.ListEnvironmentBlueprintsOutput, error) - ListEnvironmentBlueprintsRequest(*datazone.ListEnvironmentBlueprintsInput) (*request.Request, *datazone.ListEnvironmentBlueprintsOutput) - - ListEnvironmentBlueprintsPages(*datazone.ListEnvironmentBlueprintsInput, func(*datazone.ListEnvironmentBlueprintsOutput, bool) bool) error - ListEnvironmentBlueprintsPagesWithContext(aws.Context, *datazone.ListEnvironmentBlueprintsInput, func(*datazone.ListEnvironmentBlueprintsOutput, bool) bool, ...request.Option) error - - ListEnvironmentProfiles(*datazone.ListEnvironmentProfilesInput) (*datazone.ListEnvironmentProfilesOutput, error) - ListEnvironmentProfilesWithContext(aws.Context, *datazone.ListEnvironmentProfilesInput, ...request.Option) (*datazone.ListEnvironmentProfilesOutput, error) - ListEnvironmentProfilesRequest(*datazone.ListEnvironmentProfilesInput) (*request.Request, *datazone.ListEnvironmentProfilesOutput) - - ListEnvironmentProfilesPages(*datazone.ListEnvironmentProfilesInput, func(*datazone.ListEnvironmentProfilesOutput, bool) bool) error - ListEnvironmentProfilesPagesWithContext(aws.Context, *datazone.ListEnvironmentProfilesInput, func(*datazone.ListEnvironmentProfilesOutput, bool) bool, ...request.Option) error - - ListEnvironments(*datazone.ListEnvironmentsInput) (*datazone.ListEnvironmentsOutput, error) - ListEnvironmentsWithContext(aws.Context, *datazone.ListEnvironmentsInput, ...request.Option) (*datazone.ListEnvironmentsOutput, error) - ListEnvironmentsRequest(*datazone.ListEnvironmentsInput) (*request.Request, *datazone.ListEnvironmentsOutput) - - ListEnvironmentsPages(*datazone.ListEnvironmentsInput, func(*datazone.ListEnvironmentsOutput, bool) bool) error - ListEnvironmentsPagesWithContext(aws.Context, *datazone.ListEnvironmentsInput, func(*datazone.ListEnvironmentsOutput, bool) bool, ...request.Option) error - - ListNotifications(*datazone.ListNotificationsInput) (*datazone.ListNotificationsOutput, error) - ListNotificationsWithContext(aws.Context, *datazone.ListNotificationsInput, ...request.Option) (*datazone.ListNotificationsOutput, error) - ListNotificationsRequest(*datazone.ListNotificationsInput) (*request.Request, *datazone.ListNotificationsOutput) - - ListNotificationsPages(*datazone.ListNotificationsInput, func(*datazone.ListNotificationsOutput, bool) bool) error - ListNotificationsPagesWithContext(aws.Context, *datazone.ListNotificationsInput, func(*datazone.ListNotificationsOutput, bool) bool, ...request.Option) error - - ListProjectMemberships(*datazone.ListProjectMembershipsInput) (*datazone.ListProjectMembershipsOutput, error) - ListProjectMembershipsWithContext(aws.Context, *datazone.ListProjectMembershipsInput, ...request.Option) (*datazone.ListProjectMembershipsOutput, error) - ListProjectMembershipsRequest(*datazone.ListProjectMembershipsInput) (*request.Request, *datazone.ListProjectMembershipsOutput) - - ListProjectMembershipsPages(*datazone.ListProjectMembershipsInput, func(*datazone.ListProjectMembershipsOutput, bool) bool) error - ListProjectMembershipsPagesWithContext(aws.Context, *datazone.ListProjectMembershipsInput, func(*datazone.ListProjectMembershipsOutput, bool) bool, ...request.Option) error - - ListProjects(*datazone.ListProjectsInput) (*datazone.ListProjectsOutput, error) - ListProjectsWithContext(aws.Context, *datazone.ListProjectsInput, ...request.Option) (*datazone.ListProjectsOutput, error) - ListProjectsRequest(*datazone.ListProjectsInput) (*request.Request, *datazone.ListProjectsOutput) - - ListProjectsPages(*datazone.ListProjectsInput, func(*datazone.ListProjectsOutput, bool) bool) error - ListProjectsPagesWithContext(aws.Context, *datazone.ListProjectsInput, func(*datazone.ListProjectsOutput, bool) bool, ...request.Option) error - - ListSubscriptionGrants(*datazone.ListSubscriptionGrantsInput) (*datazone.ListSubscriptionGrantsOutput, error) - ListSubscriptionGrantsWithContext(aws.Context, *datazone.ListSubscriptionGrantsInput, ...request.Option) (*datazone.ListSubscriptionGrantsOutput, error) - ListSubscriptionGrantsRequest(*datazone.ListSubscriptionGrantsInput) (*request.Request, *datazone.ListSubscriptionGrantsOutput) - - ListSubscriptionGrantsPages(*datazone.ListSubscriptionGrantsInput, func(*datazone.ListSubscriptionGrantsOutput, bool) bool) error - ListSubscriptionGrantsPagesWithContext(aws.Context, *datazone.ListSubscriptionGrantsInput, func(*datazone.ListSubscriptionGrantsOutput, bool) bool, ...request.Option) error - - ListSubscriptionRequests(*datazone.ListSubscriptionRequestsInput) (*datazone.ListSubscriptionRequestsOutput, error) - ListSubscriptionRequestsWithContext(aws.Context, *datazone.ListSubscriptionRequestsInput, ...request.Option) (*datazone.ListSubscriptionRequestsOutput, error) - ListSubscriptionRequestsRequest(*datazone.ListSubscriptionRequestsInput) (*request.Request, *datazone.ListSubscriptionRequestsOutput) - - ListSubscriptionRequestsPages(*datazone.ListSubscriptionRequestsInput, func(*datazone.ListSubscriptionRequestsOutput, bool) bool) error - ListSubscriptionRequestsPagesWithContext(aws.Context, *datazone.ListSubscriptionRequestsInput, func(*datazone.ListSubscriptionRequestsOutput, bool) bool, ...request.Option) error - - ListSubscriptionTargets(*datazone.ListSubscriptionTargetsInput) (*datazone.ListSubscriptionTargetsOutput, error) - ListSubscriptionTargetsWithContext(aws.Context, *datazone.ListSubscriptionTargetsInput, ...request.Option) (*datazone.ListSubscriptionTargetsOutput, error) - ListSubscriptionTargetsRequest(*datazone.ListSubscriptionTargetsInput) (*request.Request, *datazone.ListSubscriptionTargetsOutput) - - ListSubscriptionTargetsPages(*datazone.ListSubscriptionTargetsInput, func(*datazone.ListSubscriptionTargetsOutput, bool) bool) error - ListSubscriptionTargetsPagesWithContext(aws.Context, *datazone.ListSubscriptionTargetsInput, func(*datazone.ListSubscriptionTargetsOutput, bool) bool, ...request.Option) error - - ListSubscriptions(*datazone.ListSubscriptionsInput) (*datazone.ListSubscriptionsOutput, error) - ListSubscriptionsWithContext(aws.Context, *datazone.ListSubscriptionsInput, ...request.Option) (*datazone.ListSubscriptionsOutput, error) - ListSubscriptionsRequest(*datazone.ListSubscriptionsInput) (*request.Request, *datazone.ListSubscriptionsOutput) - - ListSubscriptionsPages(*datazone.ListSubscriptionsInput, func(*datazone.ListSubscriptionsOutput, bool) bool) error - ListSubscriptionsPagesWithContext(aws.Context, *datazone.ListSubscriptionsInput, func(*datazone.ListSubscriptionsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*datazone.ListTagsForResourceInput) (*datazone.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *datazone.ListTagsForResourceInput, ...request.Option) (*datazone.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*datazone.ListTagsForResourceInput) (*request.Request, *datazone.ListTagsForResourceOutput) - - PutEnvironmentBlueprintConfiguration(*datazone.PutEnvironmentBlueprintConfigurationInput) (*datazone.PutEnvironmentBlueprintConfigurationOutput, error) - PutEnvironmentBlueprintConfigurationWithContext(aws.Context, *datazone.PutEnvironmentBlueprintConfigurationInput, ...request.Option) (*datazone.PutEnvironmentBlueprintConfigurationOutput, error) - PutEnvironmentBlueprintConfigurationRequest(*datazone.PutEnvironmentBlueprintConfigurationInput) (*request.Request, *datazone.PutEnvironmentBlueprintConfigurationOutput) - - RejectPredictions(*datazone.RejectPredictionsInput) (*datazone.RejectPredictionsOutput, error) - RejectPredictionsWithContext(aws.Context, *datazone.RejectPredictionsInput, ...request.Option) (*datazone.RejectPredictionsOutput, error) - RejectPredictionsRequest(*datazone.RejectPredictionsInput) (*request.Request, *datazone.RejectPredictionsOutput) - - RejectSubscriptionRequest(*datazone.RejectSubscriptionRequestInput) (*datazone.RejectSubscriptionRequestOutput, error) - RejectSubscriptionRequestWithContext(aws.Context, *datazone.RejectSubscriptionRequestInput, ...request.Option) (*datazone.RejectSubscriptionRequestOutput, error) - RejectSubscriptionRequestRequest(*datazone.RejectSubscriptionRequestInput) (*request.Request, *datazone.RejectSubscriptionRequestOutput) - - RevokeSubscription(*datazone.RevokeSubscriptionInput) (*datazone.RevokeSubscriptionOutput, error) - RevokeSubscriptionWithContext(aws.Context, *datazone.RevokeSubscriptionInput, ...request.Option) (*datazone.RevokeSubscriptionOutput, error) - RevokeSubscriptionRequest(*datazone.RevokeSubscriptionInput) (*request.Request, *datazone.RevokeSubscriptionOutput) - - Search(*datazone.SearchInput) (*datazone.SearchOutput, error) - SearchWithContext(aws.Context, *datazone.SearchInput, ...request.Option) (*datazone.SearchOutput, error) - SearchRequest(*datazone.SearchInput) (*request.Request, *datazone.SearchOutput) - - SearchPages(*datazone.SearchInput, func(*datazone.SearchOutput, bool) bool) error - SearchPagesWithContext(aws.Context, *datazone.SearchInput, func(*datazone.SearchOutput, bool) bool, ...request.Option) error - - SearchGroupProfiles(*datazone.SearchGroupProfilesInput) (*datazone.SearchGroupProfilesOutput, error) - SearchGroupProfilesWithContext(aws.Context, *datazone.SearchGroupProfilesInput, ...request.Option) (*datazone.SearchGroupProfilesOutput, error) - SearchGroupProfilesRequest(*datazone.SearchGroupProfilesInput) (*request.Request, *datazone.SearchGroupProfilesOutput) - - SearchGroupProfilesPages(*datazone.SearchGroupProfilesInput, func(*datazone.SearchGroupProfilesOutput, bool) bool) error - SearchGroupProfilesPagesWithContext(aws.Context, *datazone.SearchGroupProfilesInput, func(*datazone.SearchGroupProfilesOutput, bool) bool, ...request.Option) error - - SearchListings(*datazone.SearchListingsInput) (*datazone.SearchListingsOutput, error) - SearchListingsWithContext(aws.Context, *datazone.SearchListingsInput, ...request.Option) (*datazone.SearchListingsOutput, error) - SearchListingsRequest(*datazone.SearchListingsInput) (*request.Request, *datazone.SearchListingsOutput) - - SearchListingsPages(*datazone.SearchListingsInput, func(*datazone.SearchListingsOutput, bool) bool) error - SearchListingsPagesWithContext(aws.Context, *datazone.SearchListingsInput, func(*datazone.SearchListingsOutput, bool) bool, ...request.Option) error - - SearchTypes(*datazone.SearchTypesInput) (*datazone.SearchTypesOutput, error) - SearchTypesWithContext(aws.Context, *datazone.SearchTypesInput, ...request.Option) (*datazone.SearchTypesOutput, error) - SearchTypesRequest(*datazone.SearchTypesInput) (*request.Request, *datazone.SearchTypesOutput) - - SearchTypesPages(*datazone.SearchTypesInput, func(*datazone.SearchTypesOutput, bool) bool) error - SearchTypesPagesWithContext(aws.Context, *datazone.SearchTypesInput, func(*datazone.SearchTypesOutput, bool) bool, ...request.Option) error - - SearchUserProfiles(*datazone.SearchUserProfilesInput) (*datazone.SearchUserProfilesOutput, error) - SearchUserProfilesWithContext(aws.Context, *datazone.SearchUserProfilesInput, ...request.Option) (*datazone.SearchUserProfilesOutput, error) - SearchUserProfilesRequest(*datazone.SearchUserProfilesInput) (*request.Request, *datazone.SearchUserProfilesOutput) - - SearchUserProfilesPages(*datazone.SearchUserProfilesInput, func(*datazone.SearchUserProfilesOutput, bool) bool) error - SearchUserProfilesPagesWithContext(aws.Context, *datazone.SearchUserProfilesInput, func(*datazone.SearchUserProfilesOutput, bool) bool, ...request.Option) error - - StartDataSourceRun(*datazone.StartDataSourceRunInput) (*datazone.StartDataSourceRunOutput, error) - StartDataSourceRunWithContext(aws.Context, *datazone.StartDataSourceRunInput, ...request.Option) (*datazone.StartDataSourceRunOutput, error) - StartDataSourceRunRequest(*datazone.StartDataSourceRunInput) (*request.Request, *datazone.StartDataSourceRunOutput) - - TagResource(*datazone.TagResourceInput) (*datazone.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *datazone.TagResourceInput, ...request.Option) (*datazone.TagResourceOutput, error) - TagResourceRequest(*datazone.TagResourceInput) (*request.Request, *datazone.TagResourceOutput) - - UntagResource(*datazone.UntagResourceInput) (*datazone.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *datazone.UntagResourceInput, ...request.Option) (*datazone.UntagResourceOutput, error) - UntagResourceRequest(*datazone.UntagResourceInput) (*request.Request, *datazone.UntagResourceOutput) - - UpdateDataSource(*datazone.UpdateDataSourceInput) (*datazone.UpdateDataSourceOutput, error) - UpdateDataSourceWithContext(aws.Context, *datazone.UpdateDataSourceInput, ...request.Option) (*datazone.UpdateDataSourceOutput, error) - UpdateDataSourceRequest(*datazone.UpdateDataSourceInput) (*request.Request, *datazone.UpdateDataSourceOutput) - - UpdateDomain(*datazone.UpdateDomainInput) (*datazone.UpdateDomainOutput, error) - UpdateDomainWithContext(aws.Context, *datazone.UpdateDomainInput, ...request.Option) (*datazone.UpdateDomainOutput, error) - UpdateDomainRequest(*datazone.UpdateDomainInput) (*request.Request, *datazone.UpdateDomainOutput) - - UpdateEnvironment(*datazone.UpdateEnvironmentInput) (*datazone.UpdateEnvironmentOutput, error) - UpdateEnvironmentWithContext(aws.Context, *datazone.UpdateEnvironmentInput, ...request.Option) (*datazone.UpdateEnvironmentOutput, error) - UpdateEnvironmentRequest(*datazone.UpdateEnvironmentInput) (*request.Request, *datazone.UpdateEnvironmentOutput) - - UpdateEnvironmentProfile(*datazone.UpdateEnvironmentProfileInput) (*datazone.UpdateEnvironmentProfileOutput, error) - UpdateEnvironmentProfileWithContext(aws.Context, *datazone.UpdateEnvironmentProfileInput, ...request.Option) (*datazone.UpdateEnvironmentProfileOutput, error) - UpdateEnvironmentProfileRequest(*datazone.UpdateEnvironmentProfileInput) (*request.Request, *datazone.UpdateEnvironmentProfileOutput) - - UpdateGlossary(*datazone.UpdateGlossaryInput) (*datazone.UpdateGlossaryOutput, error) - UpdateGlossaryWithContext(aws.Context, *datazone.UpdateGlossaryInput, ...request.Option) (*datazone.UpdateGlossaryOutput, error) - UpdateGlossaryRequest(*datazone.UpdateGlossaryInput) (*request.Request, *datazone.UpdateGlossaryOutput) - - UpdateGlossaryTerm(*datazone.UpdateGlossaryTermInput) (*datazone.UpdateGlossaryTermOutput, error) - UpdateGlossaryTermWithContext(aws.Context, *datazone.UpdateGlossaryTermInput, ...request.Option) (*datazone.UpdateGlossaryTermOutput, error) - UpdateGlossaryTermRequest(*datazone.UpdateGlossaryTermInput) (*request.Request, *datazone.UpdateGlossaryTermOutput) - - UpdateGroupProfile(*datazone.UpdateGroupProfileInput) (*datazone.UpdateGroupProfileOutput, error) - UpdateGroupProfileWithContext(aws.Context, *datazone.UpdateGroupProfileInput, ...request.Option) (*datazone.UpdateGroupProfileOutput, error) - UpdateGroupProfileRequest(*datazone.UpdateGroupProfileInput) (*request.Request, *datazone.UpdateGroupProfileOutput) - - UpdateProject(*datazone.UpdateProjectInput) (*datazone.UpdateProjectOutput, error) - UpdateProjectWithContext(aws.Context, *datazone.UpdateProjectInput, ...request.Option) (*datazone.UpdateProjectOutput, error) - UpdateProjectRequest(*datazone.UpdateProjectInput) (*request.Request, *datazone.UpdateProjectOutput) - - UpdateSubscriptionGrantStatus(*datazone.UpdateSubscriptionGrantStatusInput) (*datazone.UpdateSubscriptionGrantStatusOutput, error) - UpdateSubscriptionGrantStatusWithContext(aws.Context, *datazone.UpdateSubscriptionGrantStatusInput, ...request.Option) (*datazone.UpdateSubscriptionGrantStatusOutput, error) - UpdateSubscriptionGrantStatusRequest(*datazone.UpdateSubscriptionGrantStatusInput) (*request.Request, *datazone.UpdateSubscriptionGrantStatusOutput) - - UpdateSubscriptionRequest(*datazone.UpdateSubscriptionRequestInput) (*datazone.UpdateSubscriptionRequestOutput, error) - UpdateSubscriptionRequestWithContext(aws.Context, *datazone.UpdateSubscriptionRequestInput, ...request.Option) (*datazone.UpdateSubscriptionRequestOutput, error) - UpdateSubscriptionRequestRequest(*datazone.UpdateSubscriptionRequestInput) (*request.Request, *datazone.UpdateSubscriptionRequestOutput) - - UpdateSubscriptionTarget(*datazone.UpdateSubscriptionTargetInput) (*datazone.UpdateSubscriptionTargetOutput, error) - UpdateSubscriptionTargetWithContext(aws.Context, *datazone.UpdateSubscriptionTargetInput, ...request.Option) (*datazone.UpdateSubscriptionTargetOutput, error) - UpdateSubscriptionTargetRequest(*datazone.UpdateSubscriptionTargetInput) (*request.Request, *datazone.UpdateSubscriptionTargetOutput) - - UpdateUserProfile(*datazone.UpdateUserProfileInput) (*datazone.UpdateUserProfileOutput, error) - UpdateUserProfileWithContext(aws.Context, *datazone.UpdateUserProfileInput, ...request.Option) (*datazone.UpdateUserProfileOutput, error) - UpdateUserProfileRequest(*datazone.UpdateUserProfileInput) (*request.Request, *datazone.UpdateUserProfileOutput) -} - -var _ DataZoneAPI = (*datazone.DataZone)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/doc.go deleted file mode 100644 index 146ae4103172..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/doc.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package datazone provides the client and types for making API -// requests to Amazon DataZone. -// -// Amazon DataZone is a data management service that enables you to catalog, -// discover, govern, share, and analyze your data. With Amazon DataZone, you -// can share and access your data across accounts and supported regions. Amazon -// DataZone simplifies your experience across Amazon Web Services services, -// including, but not limited to, Amazon Redshift, Amazon Athena, Amazon Web -// Services Glue, and Amazon Web Services Lake Formation. -// -// See https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10 for more information on this service. -// -// See datazone package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/datazone/ -// -// # Using the Client -// -// To contact Amazon DataZone with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon DataZone client DataZone for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/datazone/#New -package datazone diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/errors.go deleted file mode 100644 index ccfa5201092d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/errors.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package datazone - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // There is a conflict while performing this action. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request has failed because of an unknown error, exception or failure. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource cannot be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request has exceeded the specified service quota. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeUnauthorizedException for service response error code - // "UnauthorizedException". - // - // You do not have permission to perform this action. - ErrCodeUnauthorizedException = "UnauthorizedException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by the Amazon Web Services - // service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "UnauthorizedException": newErrorUnauthorizedException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/service.go deleted file mode 100644 index 31932bc323f9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/datazone/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package datazone - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// DataZone provides the API operation methods for making requests to -// Amazon DataZone. See this package's package overview docs -// for details on the service. -// -// DataZone methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type DataZone struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "DataZone" // Name of service. - EndpointsID = "datazone" // ID to lookup a service endpoint with. - ServiceID = "DataZone" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the DataZone client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a DataZone client from just a session. -// svc := datazone.New(mySession) -// -// // Create a DataZone client with additional configuration -// svc := datazone.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *DataZone { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "datazone" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *DataZone { - svc := &DataZone{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a DataZone operation and runs any -// custom request initialization. -func (c *DataZone) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/api.go deleted file mode 100644 index 560ed6628910..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/api.go +++ /dev/null @@ -1,3854 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package docdbelastic - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateCluster = "CreateCluster" - -// CreateClusterRequest generates a "aws/request.Request" representing the -// client's request for the CreateCluster 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 CreateCluster for more information on using the CreateCluster -// 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 CreateClusterRequest method. -// req, resp := client.CreateClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/CreateCluster -func (c *DocDBElastic) CreateClusterRequest(input *CreateClusterInput) (req *request.Request, output *CreateClusterOutput) { - op := &request.Operation{ - Name: opCreateCluster, - HTTPMethod: "POST", - HTTPPath: "/cluster", - } - - if input == nil { - input = &CreateClusterInput{} - } - - output = &CreateClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCluster API operation for Amazon DocumentDB Elastic Clusters. -// -// Creates a new Elastic DocumentDB cluster and returns its Cluster structure. -// -// 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 DocumentDB Elastic Clusters's -// API operation CreateCluster for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - ServiceQuotaExceededException -// The service quota for the action was exceeded. -// -// - ConflictException -// There was an access conflict. -// -// - InternalServerException -// There was an internal server error. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/CreateCluster -func (c *DocDBElastic) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) { - req, out := c.CreateClusterRequest(input) - return out, req.Send() -} - -// CreateClusterWithContext is the same as CreateCluster with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCluster 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 *DocDBElastic) CreateClusterWithContext(ctx aws.Context, input *CreateClusterInput, opts ...request.Option) (*CreateClusterOutput, error) { - req, out := c.CreateClusterRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateClusterSnapshot = "CreateClusterSnapshot" - -// CreateClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateClusterSnapshot 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 CreateClusterSnapshot for more information on using the CreateClusterSnapshot -// 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 CreateClusterSnapshotRequest method. -// req, resp := client.CreateClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/CreateClusterSnapshot -func (c *DocDBElastic) CreateClusterSnapshotRequest(input *CreateClusterSnapshotInput) (req *request.Request, output *CreateClusterSnapshotOutput) { - op := &request.Operation{ - Name: opCreateClusterSnapshot, - HTTPMethod: "POST", - HTTPPath: "/cluster-snapshot", - } - - if input == nil { - input = &CreateClusterSnapshotInput{} - } - - output = &CreateClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateClusterSnapshot API operation for Amazon DocumentDB Elastic Clusters. -// -// Creates a snapshot of a cluster. -// -// 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 DocumentDB Elastic Clusters's -// API operation CreateClusterSnapshot for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - ServiceQuotaExceededException -// The service quota for the action was exceeded. -// -// - ConflictException -// There was an access conflict. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/CreateClusterSnapshot -func (c *DocDBElastic) CreateClusterSnapshot(input *CreateClusterSnapshotInput) (*CreateClusterSnapshotOutput, error) { - req, out := c.CreateClusterSnapshotRequest(input) - return out, req.Send() -} - -// CreateClusterSnapshotWithContext is the same as CreateClusterSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See CreateClusterSnapshot 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 *DocDBElastic) CreateClusterSnapshotWithContext(ctx aws.Context, input *CreateClusterSnapshotInput, opts ...request.Option) (*CreateClusterSnapshotOutput, error) { - req, out := c.CreateClusterSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCluster = "DeleteCluster" - -// DeleteClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCluster 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 DeleteCluster for more information on using the DeleteCluster -// 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 DeleteClusterRequest method. -// req, resp := client.DeleteClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/DeleteCluster -func (c *DocDBElastic) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { - op := &request.Operation{ - Name: opDeleteCluster, - HTTPMethod: "DELETE", - HTTPPath: "/cluster/{clusterArn}", - } - - if input == nil { - input = &DeleteClusterInput{} - } - - output = &DeleteClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCluster API operation for Amazon DocumentDB Elastic Clusters. -// -// Delete a Elastic DocumentDB cluster. -// -// 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 DocumentDB Elastic Clusters's -// API operation DeleteCluster for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - ConflictException -// There was an access conflict. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/DeleteCluster -func (c *DocDBElastic) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) - return out, req.Send() -} - -// DeleteClusterWithContext is the same as DeleteCluster with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCluster 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 *DocDBElastic) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteClusterSnapshot = "DeleteClusterSnapshot" - -// DeleteClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeleteClusterSnapshot 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 DeleteClusterSnapshot for more information on using the DeleteClusterSnapshot -// 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 DeleteClusterSnapshotRequest method. -// req, resp := client.DeleteClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/DeleteClusterSnapshot -func (c *DocDBElastic) DeleteClusterSnapshotRequest(input *DeleteClusterSnapshotInput) (req *request.Request, output *DeleteClusterSnapshotOutput) { - op := &request.Operation{ - Name: opDeleteClusterSnapshot, - HTTPMethod: "DELETE", - HTTPPath: "/cluster-snapshot/{snapshotArn}", - } - - if input == nil { - input = &DeleteClusterSnapshotInput{} - } - - output = &DeleteClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteClusterSnapshot API operation for Amazon DocumentDB Elastic Clusters. -// -// Delete a Elastic DocumentDB snapshot. -// -// 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 DocumentDB Elastic Clusters's -// API operation DeleteClusterSnapshot for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - ConflictException -// There was an access conflict. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/DeleteClusterSnapshot -func (c *DocDBElastic) DeleteClusterSnapshot(input *DeleteClusterSnapshotInput) (*DeleteClusterSnapshotOutput, error) { - req, out := c.DeleteClusterSnapshotRequest(input) - return out, req.Send() -} - -// DeleteClusterSnapshotWithContext is the same as DeleteClusterSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteClusterSnapshot 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 *DocDBElastic) DeleteClusterSnapshotWithContext(ctx aws.Context, input *DeleteClusterSnapshotInput, opts ...request.Option) (*DeleteClusterSnapshotOutput, error) { - req, out := c.DeleteClusterSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCluster = "GetCluster" - -// GetClusterRequest generates a "aws/request.Request" representing the -// client's request for the GetCluster 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 GetCluster for more information on using the GetCluster -// 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 GetClusterRequest method. -// req, resp := client.GetClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/GetCluster -func (c *DocDBElastic) GetClusterRequest(input *GetClusterInput) (req *request.Request, output *GetClusterOutput) { - op := &request.Operation{ - Name: opGetCluster, - HTTPMethod: "GET", - HTTPPath: "/cluster/{clusterArn}", - } - - if input == nil { - input = &GetClusterInput{} - } - - output = &GetClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCluster API operation for Amazon DocumentDB Elastic Clusters. -// -// Returns information about a specific Elastic DocumentDB cluster. -// -// 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 DocumentDB Elastic Clusters's -// API operation GetCluster for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/GetCluster -func (c *DocDBElastic) GetCluster(input *GetClusterInput) (*GetClusterOutput, error) { - req, out := c.GetClusterRequest(input) - return out, req.Send() -} - -// GetClusterWithContext is the same as GetCluster with the addition of -// the ability to pass a context and additional request options. -// -// See GetCluster 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 *DocDBElastic) GetClusterWithContext(ctx aws.Context, input *GetClusterInput, opts ...request.Option) (*GetClusterOutput, error) { - req, out := c.GetClusterRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetClusterSnapshot = "GetClusterSnapshot" - -// GetClusterSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the GetClusterSnapshot 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 GetClusterSnapshot for more information on using the GetClusterSnapshot -// 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 GetClusterSnapshotRequest method. -// req, resp := client.GetClusterSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/GetClusterSnapshot -func (c *DocDBElastic) GetClusterSnapshotRequest(input *GetClusterSnapshotInput) (req *request.Request, output *GetClusterSnapshotOutput) { - op := &request.Operation{ - Name: opGetClusterSnapshot, - HTTPMethod: "GET", - HTTPPath: "/cluster-snapshot/{snapshotArn}", - } - - if input == nil { - input = &GetClusterSnapshotInput{} - } - - output = &GetClusterSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetClusterSnapshot API operation for Amazon DocumentDB Elastic Clusters. -// -// # Returns information about a specific Elastic DocumentDB snapshot -// -// 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 DocumentDB Elastic Clusters's -// API operation GetClusterSnapshot for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/GetClusterSnapshot -func (c *DocDBElastic) GetClusterSnapshot(input *GetClusterSnapshotInput) (*GetClusterSnapshotOutput, error) { - req, out := c.GetClusterSnapshotRequest(input) - return out, req.Send() -} - -// GetClusterSnapshotWithContext is the same as GetClusterSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See GetClusterSnapshot 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 *DocDBElastic) GetClusterSnapshotWithContext(ctx aws.Context, input *GetClusterSnapshotInput, opts ...request.Option) (*GetClusterSnapshotOutput, error) { - req, out := c.GetClusterSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListClusterSnapshots = "ListClusterSnapshots" - -// ListClusterSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the ListClusterSnapshots 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 ListClusterSnapshots for more information on using the ListClusterSnapshots -// 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 ListClusterSnapshotsRequest method. -// req, resp := client.ListClusterSnapshotsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/ListClusterSnapshots -func (c *DocDBElastic) ListClusterSnapshotsRequest(input *ListClusterSnapshotsInput) (req *request.Request, output *ListClusterSnapshotsOutput) { - op := &request.Operation{ - Name: opListClusterSnapshots, - HTTPMethod: "GET", - HTTPPath: "/cluster-snapshots", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListClusterSnapshotsInput{} - } - - output = &ListClusterSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListClusterSnapshots API operation for Amazon DocumentDB Elastic Clusters. -// -// Returns information about Elastic DocumentDB snapshots for a specified cluster. -// -// 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 DocumentDB Elastic Clusters's -// API operation ListClusterSnapshots for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - InternalServerException -// There was an internal server error. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/ListClusterSnapshots -func (c *DocDBElastic) ListClusterSnapshots(input *ListClusterSnapshotsInput) (*ListClusterSnapshotsOutput, error) { - req, out := c.ListClusterSnapshotsRequest(input) - return out, req.Send() -} - -// ListClusterSnapshotsWithContext is the same as ListClusterSnapshots with the addition of -// the ability to pass a context and additional request options. -// -// See ListClusterSnapshots 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 *DocDBElastic) ListClusterSnapshotsWithContext(ctx aws.Context, input *ListClusterSnapshotsInput, opts ...request.Option) (*ListClusterSnapshotsOutput, error) { - req, out := c.ListClusterSnapshotsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListClusterSnapshotsPages iterates over the pages of a ListClusterSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListClusterSnapshots method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListClusterSnapshots operation. -// pageNum := 0 -// err := client.ListClusterSnapshotsPages(params, -// func(page *docdbelastic.ListClusterSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DocDBElastic) ListClusterSnapshotsPages(input *ListClusterSnapshotsInput, fn func(*ListClusterSnapshotsOutput, bool) bool) error { - return c.ListClusterSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListClusterSnapshotsPagesWithContext same as ListClusterSnapshotsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DocDBElastic) ListClusterSnapshotsPagesWithContext(ctx aws.Context, input *ListClusterSnapshotsInput, fn func(*ListClusterSnapshotsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListClusterSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListClusterSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListClusterSnapshotsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListClusters = "ListClusters" - -// ListClustersRequest generates a "aws/request.Request" representing the -// client's request for the ListClusters 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 ListClusters for more information on using the ListClusters -// 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 ListClustersRequest method. -// req, resp := client.ListClustersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/ListClusters -func (c *DocDBElastic) ListClustersRequest(input *ListClustersInput) (req *request.Request, output *ListClustersOutput) { - op := &request.Operation{ - Name: opListClusters, - HTTPMethod: "GET", - HTTPPath: "/clusters", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListClustersInput{} - } - - output = &ListClustersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListClusters API operation for Amazon DocumentDB Elastic Clusters. -// -// Returns information about provisioned Elastic DocumentDB clusters. -// -// 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 DocumentDB Elastic Clusters's -// API operation ListClusters for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - InternalServerException -// There was an internal server error. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/ListClusters -func (c *DocDBElastic) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) - return out, req.Send() -} - -// ListClustersWithContext is the same as ListClusters with the addition of -// the ability to pass a context and additional request options. -// -// See ListClusters 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 *DocDBElastic) ListClustersWithContext(ctx aws.Context, input *ListClustersInput, opts ...request.Option) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListClustersPages iterates over the pages of a ListClusters operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListClusters method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListClusters operation. -// pageNum := 0 -// err := client.ListClustersPages(params, -// func(page *docdbelastic.ListClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *DocDBElastic) ListClustersPages(input *ListClustersInput, fn func(*ListClustersOutput, bool) bool) error { - return c.ListClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListClustersPagesWithContext same as ListClustersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *DocDBElastic) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersInput, fn func(*ListClustersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/ListTagsForResource -func (c *DocDBElastic) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon DocumentDB Elastic Clusters. -// -// # Lists all tags on a Elastic DocumentDB resource -// -// 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 DocumentDB Elastic Clusters's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/ListTagsForResource -func (c *DocDBElastic) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *DocDBElastic) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreClusterFromSnapshot = "RestoreClusterFromSnapshot" - -// RestoreClusterFromSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the RestoreClusterFromSnapshot 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 RestoreClusterFromSnapshot for more information on using the RestoreClusterFromSnapshot -// 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 RestoreClusterFromSnapshotRequest method. -// req, resp := client.RestoreClusterFromSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/RestoreClusterFromSnapshot -func (c *DocDBElastic) RestoreClusterFromSnapshotRequest(input *RestoreClusterFromSnapshotInput) (req *request.Request, output *RestoreClusterFromSnapshotOutput) { - op := &request.Operation{ - Name: opRestoreClusterFromSnapshot, - HTTPMethod: "POST", - HTTPPath: "/cluster-snapshot/{snapshotArn}/restore", - } - - if input == nil { - input = &RestoreClusterFromSnapshotInput{} - } - - output = &RestoreClusterFromSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreClusterFromSnapshot API operation for Amazon DocumentDB Elastic Clusters. -// -// Restores a Elastic DocumentDB cluster from a snapshot. -// -// 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 DocumentDB Elastic Clusters's -// API operation RestoreClusterFromSnapshot for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - ServiceQuotaExceededException -// The service quota for the action was exceeded. -// -// - ConflictException -// There was an access conflict. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/RestoreClusterFromSnapshot -func (c *DocDBElastic) RestoreClusterFromSnapshot(input *RestoreClusterFromSnapshotInput) (*RestoreClusterFromSnapshotOutput, error) { - req, out := c.RestoreClusterFromSnapshotRequest(input) - return out, req.Send() -} - -// RestoreClusterFromSnapshotWithContext is the same as RestoreClusterFromSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreClusterFromSnapshot 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 *DocDBElastic) RestoreClusterFromSnapshotWithContext(ctx aws.Context, input *RestoreClusterFromSnapshotInput, opts ...request.Option) (*RestoreClusterFromSnapshotOutput, error) { - req, out := c.RestoreClusterFromSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/TagResource -func (c *DocDBElastic) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon DocumentDB Elastic Clusters. -// -// # Adds metadata tags to a Elastic DocumentDB resource -// -// 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 DocumentDB Elastic Clusters's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/TagResource -func (c *DocDBElastic) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *DocDBElastic) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/UntagResource -func (c *DocDBElastic) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon DocumentDB Elastic Clusters. -// -// # Removes metadata tags to a Elastic DocumentDB resource -// -// 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 DocumentDB Elastic Clusters's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/UntagResource -func (c *DocDBElastic) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *DocDBElastic) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCluster = "UpdateCluster" - -// UpdateClusterRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCluster 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 UpdateCluster for more information on using the UpdateCluster -// 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 UpdateClusterRequest method. -// req, resp := client.UpdateClusterRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/UpdateCluster -func (c *DocDBElastic) UpdateClusterRequest(input *UpdateClusterInput) (req *request.Request, output *UpdateClusterOutput) { - op := &request.Operation{ - Name: opUpdateCluster, - HTTPMethod: "PUT", - HTTPPath: "/cluster/{clusterArn}", - } - - if input == nil { - input = &UpdateClusterInput{} - } - - output = &UpdateClusterOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateCluster API operation for Amazon DocumentDB Elastic Clusters. -// -// Modifies a Elastic DocumentDB cluster. This includes updating admin-username/password, -// upgrading API version setting up a backup window and maintenance window -// -// 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 DocumentDB Elastic Clusters's -// API operation UpdateCluster for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// ThrottlingException will be thrown when request was denied due to request -// throttling. -// -// - ValidationException -// A structure defining a validation exception. -// -// - ConflictException -// There was an access conflict. -// -// - InternalServerException -// There was an internal server error. -// -// - ResourceNotFoundException -// The specified resource could not be located. -// -// - AccessDeniedException -// An exception that occurs when there are not sufficient permissions to perform -// an action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28/UpdateCluster -func (c *DocDBElastic) UpdateCluster(input *UpdateClusterInput) (*UpdateClusterOutput, error) { - req, out := c.UpdateClusterRequest(input) - return out, req.Send() -} - -// UpdateClusterWithContext is the same as UpdateCluster with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCluster 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 *DocDBElastic) UpdateClusterWithContext(ctx aws.Context, input *UpdateClusterInput, opts ...request.Option) (*UpdateClusterOutput, error) { - req, out := c.UpdateClusterRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// An exception that occurs when there are not sufficient permissions to perform -// an action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // An error message explaining why access was denied. - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Returns information about a specific Elastic DocumentDB cluster. -type Cluster struct { - _ struct{} `type:"structure"` - - // The name of the Elastic DocumentDB cluster administrator. - // - // AdminUserName is a required field - AdminUserName *string `locationName:"adminUserName" type:"string" required:"true"` - - // The authentication type for the Elastic DocumentDB cluster. - // - // AuthType is a required field - AuthType *string `locationName:"authType" type:"string" required:"true" enum:"Auth"` - - // The arn of the Elastic DocumentDB cluster. - // - // ClusterArn is a required field - ClusterArn *string `locationName:"clusterArn" type:"string" required:"true"` - - // The URL used to connect to the Elastic DocumentDB cluster. - // - // ClusterEndpoint is a required field - ClusterEndpoint *string `locationName:"clusterEndpoint" type:"string" required:"true"` - - // The name of the Elastic DocumentDB cluster. - // - // ClusterName is a required field - ClusterName *string `locationName:"clusterName" type:"string" required:"true"` - - // The time when the Elastic DocumentDB cluster was created in Universal Coordinated - // Time (UTC). - // - // CreateTime is a required field - CreateTime *string `locationName:"createTime" type:"string" required:"true"` - - // The KMS key identifier to use to encrypt the Elastic DocumentDB cluster. - // - // KmsKeyId is a required field - KmsKeyId *string `locationName:"kmsKeyId" type:"string" required:"true"` - - // The weekly time range during which system maintenance can occur, in Universal - // Coordinated Time (UTC). - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // PreferredMaintenanceWindow is a required field - PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" type:"string" required:"true"` - - // The capacity of each shard in the Elastic DocumentDB cluster. - // - // ShardCapacity is a required field - ShardCapacity *int64 `locationName:"shardCapacity" type:"integer" required:"true"` - - // The number of shards in the Elastic DocumentDB cluster. - // - // ShardCount is a required field - ShardCount *int64 `locationName:"shardCount" type:"integer" required:"true"` - - // The status of the Elastic DocumentDB cluster. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"Status"` - - // The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster. - // - // SubnetIds is a required field - SubnetIds []*string `locationName:"subnetIds" type:"list" required:"true"` - - // A list of EC2 VPC security groups associated with this cluster. - // - // VpcSecurityGroupIds is a required field - VpcSecurityGroupIds []*string `locationName:"vpcSecurityGroupIds" type:"list" 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 Cluster) 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 Cluster) GoString() string { - return s.String() -} - -// SetAdminUserName sets the AdminUserName field's value. -func (s *Cluster) SetAdminUserName(v string) *Cluster { - s.AdminUserName = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *Cluster) SetAuthType(v string) *Cluster { - s.AuthType = &v - return s -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *Cluster) SetClusterArn(v string) *Cluster { - s.ClusterArn = &v - return s -} - -// SetClusterEndpoint sets the ClusterEndpoint field's value. -func (s *Cluster) SetClusterEndpoint(v string) *Cluster { - s.ClusterEndpoint = &v - return s -} - -// SetClusterName sets the ClusterName field's value. -func (s *Cluster) SetClusterName(v string) *Cluster { - s.ClusterName = &v - return s -} - -// SetCreateTime sets the CreateTime field's value. -func (s *Cluster) SetCreateTime(v string) *Cluster { - s.CreateTime = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Cluster) SetKmsKeyId(v string) *Cluster { - s.KmsKeyId = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *Cluster) SetPreferredMaintenanceWindow(v string) *Cluster { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetShardCapacity sets the ShardCapacity field's value. -func (s *Cluster) SetShardCapacity(v int64) *Cluster { - s.ShardCapacity = &v - return s -} - -// SetShardCount sets the ShardCount field's value. -func (s *Cluster) SetShardCount(v int64) *Cluster { - s.ShardCount = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Cluster) SetStatus(v string) *Cluster { - s.Status = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *Cluster) SetSubnetIds(v []*string) *Cluster { - s.SubnetIds = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *Cluster) SetVpcSecurityGroupIds(v []*string) *Cluster { - s.VpcSecurityGroupIds = v - return s -} - -// A list of Elastic DocumentDB cluster. -type ClusterInList struct { - _ struct{} `type:"structure"` - - // The arn of the Elastic DocumentDB cluster. - // - // ClusterArn is a required field - ClusterArn *string `locationName:"clusterArn" type:"string" required:"true"` - - // The name of the Elastic DocumentDB cluster. - // - // ClusterName is a required field - ClusterName *string `locationName:"clusterName" type:"string" required:"true"` - - // The status of the Elastic DocumentDB cluster. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"Status"` -} - -// 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 ClusterInList) 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 ClusterInList) GoString() string { - return s.String() -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *ClusterInList) SetClusterArn(v string) *ClusterInList { - s.ClusterArn = &v - return s -} - -// SetClusterName sets the ClusterName field's value. -func (s *ClusterInList) SetClusterName(v string) *ClusterInList { - s.ClusterName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ClusterInList) SetStatus(v string) *ClusterInList { - s.Status = &v - return s -} - -// Returns information about a specific Elastic DocumentDB snapshot. -type ClusterSnapshot struct { - _ struct{} `type:"structure"` - - // The name of the Elastic DocumentDB cluster administrator. - // - // AdminUserName is a required field - AdminUserName *string `locationName:"adminUserName" type:"string" required:"true"` - - // The arn of the Elastic DocumentDB cluster. - // - // ClusterArn is a required field - ClusterArn *string `locationName:"clusterArn" type:"string" required:"true"` - - // The time when the Elastic DocumentDB cluster was created in Universal Coordinated - // Time (UTC). - // - // ClusterCreationTime is a required field - ClusterCreationTime *string `locationName:"clusterCreationTime" type:"string" required:"true"` - - // The KMS key identifier to use to encrypt the Elastic DocumentDB cluster. - // - // KmsKeyId is a required field - KmsKeyId *string `locationName:"kmsKeyId" type:"string" required:"true"` - - // The arn of the Elastic DocumentDB snapshot - // - // SnapshotArn is a required field - SnapshotArn *string `locationName:"snapshotArn" type:"string" required:"true"` - - // The time when the Elastic DocumentDB snapshot was created in Universal Coordinated - // Time (UTC). - // - // SnapshotCreationTime is a required field - SnapshotCreationTime *string `locationName:"snapshotCreationTime" type:"string" required:"true"` - - // The name of the Elastic DocumentDB snapshot. - // - // SnapshotName is a required field - SnapshotName *string `locationName:"snapshotName" type:"string" required:"true"` - - // The status of the Elastic DocumentDB snapshot. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"Status"` - - // A list of the IDs of subnets associated with the DB cluster snapshot. - // - // SubnetIds is a required field - SubnetIds []*string `locationName:"subnetIds" type:"list" required:"true"` - - // A list of the IDs of the VPC security groups associated with the cluster - // snapshot. - // - // VpcSecurityGroupIds is a required field - VpcSecurityGroupIds []*string `locationName:"vpcSecurityGroupIds" type:"list" 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 ClusterSnapshot) 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 ClusterSnapshot) GoString() string { - return s.String() -} - -// SetAdminUserName sets the AdminUserName field's value. -func (s *ClusterSnapshot) SetAdminUserName(v string) *ClusterSnapshot { - s.AdminUserName = &v - return s -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *ClusterSnapshot) SetClusterArn(v string) *ClusterSnapshot { - s.ClusterArn = &v - return s -} - -// SetClusterCreationTime sets the ClusterCreationTime field's value. -func (s *ClusterSnapshot) SetClusterCreationTime(v string) *ClusterSnapshot { - s.ClusterCreationTime = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *ClusterSnapshot) SetKmsKeyId(v string) *ClusterSnapshot { - s.KmsKeyId = &v - return s -} - -// SetSnapshotArn sets the SnapshotArn field's value. -func (s *ClusterSnapshot) SetSnapshotArn(v string) *ClusterSnapshot { - s.SnapshotArn = &v - return s -} - -// SetSnapshotCreationTime sets the SnapshotCreationTime field's value. -func (s *ClusterSnapshot) SetSnapshotCreationTime(v string) *ClusterSnapshot { - s.SnapshotCreationTime = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *ClusterSnapshot) SetSnapshotName(v string) *ClusterSnapshot { - s.SnapshotName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ClusterSnapshot) SetStatus(v string) *ClusterSnapshot { - s.Status = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *ClusterSnapshot) SetSubnetIds(v []*string) *ClusterSnapshot { - s.SubnetIds = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *ClusterSnapshot) SetVpcSecurityGroupIds(v []*string) *ClusterSnapshot { - s.VpcSecurityGroupIds = v - return s -} - -// A list of Elastic DocumentDB snapshots. -type ClusterSnapshotInList struct { - _ struct{} `type:"structure"` - - // The arn of the Elastic DocumentDB cluster. - // - // ClusterArn is a required field - ClusterArn *string `locationName:"clusterArn" type:"string" required:"true"` - - // The arn of the Elastic DocumentDB snapshot - // - // SnapshotArn is a required field - SnapshotArn *string `locationName:"snapshotArn" type:"string" required:"true"` - - // The time when the Elastic DocumentDB snapshot was created in Universal Coordinated - // Time (UTC). - // - // SnapshotCreationTime is a required field - SnapshotCreationTime *string `locationName:"snapshotCreationTime" type:"string" required:"true"` - - // The name of the Elastic DocumentDB snapshot. - // - // SnapshotName is a required field - SnapshotName *string `locationName:"snapshotName" type:"string" required:"true"` - - // The status of the Elastic DocumentDB snapshot. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"Status"` -} - -// 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 ClusterSnapshotInList) 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 ClusterSnapshotInList) GoString() string { - return s.String() -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *ClusterSnapshotInList) SetClusterArn(v string) *ClusterSnapshotInList { - s.ClusterArn = &v - return s -} - -// SetSnapshotArn sets the SnapshotArn field's value. -func (s *ClusterSnapshotInList) SetSnapshotArn(v string) *ClusterSnapshotInList { - s.SnapshotArn = &v - return s -} - -// SetSnapshotCreationTime sets the SnapshotCreationTime field's value. -func (s *ClusterSnapshotInList) SetSnapshotCreationTime(v string) *ClusterSnapshotInList { - s.SnapshotCreationTime = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *ClusterSnapshotInList) SetSnapshotName(v string) *ClusterSnapshotInList { - s.SnapshotName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ClusterSnapshotInList) SetStatus(v string) *ClusterSnapshotInList { - s.Status = &v - return s -} - -// There was an access conflict. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the resource where there was an access conflict. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of the resource where there was an access conflict. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateClusterInput struct { - _ struct{} `type:"structure"` - - // The name of the Elastic DocumentDB cluster administrator. - // - // Constraints: - // - // * Must be from 1 to 63 letters or numbers. - // - // * The first character must be a letter. - // - // * Cannot be a reserved word. - // - // AdminUserName is a required field - AdminUserName *string `locationName:"adminUserName" type:"string" required:"true"` - - // The password for the Elastic DocumentDB cluster administrator and can contain - // any printable ASCII characters. - // - // Constraints: - // - // * Must contain from 8 to 100 characters. - // - // * Cannot contain a forward slash (/), double quote ("), or the "at" symbol - // (@). - // - // AdminUserPassword is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateClusterInput's - // String and GoString methods. - // - // AdminUserPassword is a required field - AdminUserPassword *string `locationName:"adminUserPassword" type:"string" required:"true" sensitive:"true"` - - // The authentication type for the Elastic DocumentDB cluster. - // - // AuthType is a required field - AuthType *string `locationName:"authType" type:"string" required:"true" enum:"Auth"` - - // The client token for the Elastic DocumentDB cluster. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The name of the new Elastic DocumentDB cluster. This parameter is stored - // as a lowercase string. - // - // Constraints: - // - // * Must contain from 1 to 63 letters, numbers, or hyphens. - // - // * The first character must be a letter. - // - // * Cannot end with a hyphen or contain two consecutive hyphens. - // - // Example: my-cluster - // - // ClusterName is a required field - ClusterName *string `locationName:"clusterName" type:"string" required:"true"` - - // The KMS key identifier to use to encrypt the new Elastic DocumentDB cluster. - // - // The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption - // key. If you are creating a cluster using the same Amazon account that owns - // this KMS encryption key, you can use the KMS key alias instead of the ARN - // as the KMS encryption key. - // - // If an encryption key is not specified, Elastic DocumentDB uses the default - // encryption key that KMS creates for your account. Your account has a different - // default encryption key for each Amazon Region. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The weekly time range during which system maintenance can occur, in Universal - // Coordinated Time (UTC). - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: a 30-minute window selected at random from an 8-hour block of time - // for each Amazon Web Services Region, occurring on a random day of the week. - // - // Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" type:"string"` - - // The capacity of each shard in the new Elastic DocumentDB cluster. - // - // ShardCapacity is a required field - ShardCapacity *int64 `locationName:"shardCapacity" type:"integer" required:"true"` - - // The number of shards to create in the new Elastic DocumentDB cluster. - // - // ShardCount is a required field - ShardCount *int64 `locationName:"shardCount" type:"integer" required:"true"` - - // The Amazon EC2 subnet IDs for the new Elastic DocumentDB cluster. - SubnetIds []*string `locationName:"subnetIds" type:"list"` - - // The tags to be assigned to the new Elastic DocumentDB cluster. - Tags map[string]*string `locationName:"tags" type:"map"` - - // A list of EC2 VPC security groups to associate with the new Elastic DocumentDB - // cluster. - VpcSecurityGroupIds []*string `locationName:"vpcSecurityGroupIds" type:"list"` -} - -// 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 CreateClusterInput) 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 CreateClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClusterInput"} - if s.AdminUserName == nil { - invalidParams.Add(request.NewErrParamRequired("AdminUserName")) - } - if s.AdminUserPassword == nil { - invalidParams.Add(request.NewErrParamRequired("AdminUserPassword")) - } - if s.AuthType == nil { - invalidParams.Add(request.NewErrParamRequired("AuthType")) - } - if s.ClusterName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterName")) - } - if s.ShardCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("ShardCapacity")) - } - if s.ShardCount == nil { - invalidParams.Add(request.NewErrParamRequired("ShardCount")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdminUserName sets the AdminUserName field's value. -func (s *CreateClusterInput) SetAdminUserName(v string) *CreateClusterInput { - s.AdminUserName = &v - return s -} - -// SetAdminUserPassword sets the AdminUserPassword field's value. -func (s *CreateClusterInput) SetAdminUserPassword(v string) *CreateClusterInput { - s.AdminUserPassword = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *CreateClusterInput) SetAuthType(v string) *CreateClusterInput { - s.AuthType = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateClusterInput) SetClientToken(v string) *CreateClusterInput { - s.ClientToken = &v - return s -} - -// SetClusterName sets the ClusterName field's value. -func (s *CreateClusterInput) SetClusterName(v string) *CreateClusterInput { - s.ClusterName = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateClusterInput) SetKmsKeyId(v string) *CreateClusterInput { - s.KmsKeyId = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CreateClusterInput) SetPreferredMaintenanceWindow(v string) *CreateClusterInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetShardCapacity sets the ShardCapacity field's value. -func (s *CreateClusterInput) SetShardCapacity(v int64) *CreateClusterInput { - s.ShardCapacity = &v - return s -} - -// SetShardCount sets the ShardCount field's value. -func (s *CreateClusterInput) SetShardCount(v int64) *CreateClusterInput { - s.ShardCount = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateClusterInput) SetSubnetIds(v []*string) *CreateClusterInput { - s.SubnetIds = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateClusterInput) SetTags(v map[string]*string) *CreateClusterInput { - s.Tags = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *CreateClusterInput) SetVpcSecurityGroupIds(v []*string) *CreateClusterInput { - s.VpcSecurityGroupIds = v - return s -} - -type CreateClusterOutput struct { - _ struct{} `type:"structure"` - - // The new Elastic DocumentDB cluster that has been created. - // - // Cluster is a required field - Cluster *Cluster `locationName:"cluster" type:"structure" 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 CreateClusterOutput) 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 CreateClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *CreateClusterOutput) SetCluster(v *Cluster) *CreateClusterOutput { - s.Cluster = v - return s -} - -type CreateClusterSnapshotInput struct { - _ struct{} `type:"structure"` - - // The arn of the Elastic DocumentDB cluster that the snapshot will be taken - // from. - // - // ClusterArn is a required field - ClusterArn *string `locationName:"clusterArn" type:"string" required:"true"` - - // The name of the Elastic DocumentDB snapshot. - // - // SnapshotName is a required field - SnapshotName *string `locationName:"snapshotName" min:"1" type:"string" required:"true"` - - // The tags to be assigned to the new Elastic DocumentDB snapshot. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateClusterSnapshotInput) 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 CreateClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClusterSnapshotInput"} - if s.ClusterArn == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterArn")) - } - if s.SnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotName")) - } - if s.SnapshotName != nil && len(*s.SnapshotName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SnapshotName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *CreateClusterSnapshotInput) SetClusterArn(v string) *CreateClusterSnapshotInput { - s.ClusterArn = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *CreateClusterSnapshotInput) SetSnapshotName(v string) *CreateClusterSnapshotInput { - s.SnapshotName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateClusterSnapshotInput) SetTags(v map[string]*string) *CreateClusterSnapshotInput { - s.Tags = v - return s -} - -type CreateClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Returns information about the new Elastic DocumentDB snapshot. - // - // Snapshot is a required field - Snapshot *ClusterSnapshot `locationName:"snapshot" type:"structure" 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 CreateClusterSnapshotOutput) 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 CreateClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *CreateClusterSnapshotOutput) SetSnapshot(v *ClusterSnapshot) *CreateClusterSnapshotOutput { - s.Snapshot = v - return s -} - -type DeleteClusterInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The arn of the Elastic DocumentDB cluster that is to be deleted. - // - // ClusterArn is a required field - ClusterArn *string `location:"uri" locationName:"clusterArn" 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 DeleteClusterInput) 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 DeleteClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterInput"} - if s.ClusterArn == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterArn")) - } - if s.ClusterArn != nil && len(*s.ClusterArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClusterArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *DeleteClusterInput) SetClusterArn(v string) *DeleteClusterInput { - s.ClusterArn = &v - return s -} - -type DeleteClusterOutput struct { - _ struct{} `type:"structure"` - - // Returns information about the newly deleted Elastic DocumentDB cluster. - // - // Cluster is a required field - Cluster *Cluster `locationName:"cluster" type:"structure" 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 DeleteClusterOutput) 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 DeleteClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *DeleteClusterOutput) SetCluster(v *Cluster) *DeleteClusterOutput { - s.Cluster = v - return s -} - -type DeleteClusterSnapshotInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The arn of the Elastic DocumentDB snapshot that is to be deleted. - // - // SnapshotArn is a required field - SnapshotArn *string `location:"uri" locationName:"snapshotArn" 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 DeleteClusterSnapshotInput) 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 DeleteClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClusterSnapshotInput"} - if s.SnapshotArn == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotArn")) - } - if s.SnapshotArn != nil && len(*s.SnapshotArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SnapshotArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSnapshotArn sets the SnapshotArn field's value. -func (s *DeleteClusterSnapshotInput) SetSnapshotArn(v string) *DeleteClusterSnapshotInput { - s.SnapshotArn = &v - return s -} - -type DeleteClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Returns information about the newly deleted Elastic DocumentDB snapshot. - // - // Snapshot is a required field - Snapshot *ClusterSnapshot `locationName:"snapshot" type:"structure" 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 DeleteClusterSnapshotOutput) 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 DeleteClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *DeleteClusterSnapshotOutput) SetSnapshot(v *ClusterSnapshot) *DeleteClusterSnapshotOutput { - s.Snapshot = v - return s -} - -type GetClusterInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The arn of the Elastic DocumentDB cluster. - // - // ClusterArn is a required field - ClusterArn *string `location:"uri" locationName:"clusterArn" 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 GetClusterInput) 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 GetClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetClusterInput"} - if s.ClusterArn == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterArn")) - } - if s.ClusterArn != nil && len(*s.ClusterArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClusterArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *GetClusterInput) SetClusterArn(v string) *GetClusterInput { - s.ClusterArn = &v - return s -} - -type GetClusterOutput struct { - _ struct{} `type:"structure"` - - // Returns information about a specific Elastic DocumentDB cluster. - // - // Cluster is a required field - Cluster *Cluster `locationName:"cluster" type:"structure" 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 GetClusterOutput) 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 GetClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *GetClusterOutput) SetCluster(v *Cluster) *GetClusterOutput { - s.Cluster = v - return s -} - -type GetClusterSnapshotInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The arn of the Elastic DocumentDB snapshot. - // - // SnapshotArn is a required field - SnapshotArn *string `location:"uri" locationName:"snapshotArn" 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 GetClusterSnapshotInput) 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 GetClusterSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetClusterSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetClusterSnapshotInput"} - if s.SnapshotArn == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotArn")) - } - if s.SnapshotArn != nil && len(*s.SnapshotArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SnapshotArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSnapshotArn sets the SnapshotArn field's value. -func (s *GetClusterSnapshotInput) SetSnapshotArn(v string) *GetClusterSnapshotInput { - s.SnapshotArn = &v - return s -} - -type GetClusterSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Returns information about a specific Elastic DocumentDB snapshot. - // - // Snapshot is a required field - Snapshot *ClusterSnapshot `locationName:"snapshot" type:"structure" 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 GetClusterSnapshotOutput) 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 GetClusterSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *GetClusterSnapshotOutput) SetSnapshot(v *ClusterSnapshot) *GetClusterSnapshotOutput { - s.Snapshot = v - return s -} - -// There was an internal server error. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListClusterSnapshotsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The arn of the Elastic DocumentDB cluster. - ClusterArn *string `location:"querystring" locationName:"clusterArn" type:"string"` - - // The maximum number of entries to recieve in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"20" type:"integer"` - - // The nextToken which is used the get the next page of data. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListClusterSnapshotsInput) 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 ListClusterSnapshotsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListClusterSnapshotsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListClusterSnapshotsInput"} - if s.MaxResults != nil && *s.MaxResults < 20 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *ListClusterSnapshotsInput) SetClusterArn(v string) *ListClusterSnapshotsInput { - s.ClusterArn = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListClusterSnapshotsInput) SetMaxResults(v int64) *ListClusterSnapshotsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListClusterSnapshotsInput) SetNextToken(v string) *ListClusterSnapshotsInput { - s.NextToken = &v - return s -} - -type ListClusterSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // The response will provide a nextToken if there is more data beyond the maxResults. - // - // If there is no more data in the responce, the nextToken will not be returned. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of Elastic DocumentDB snapshots for a specified cluster. - Snapshots []*ClusterSnapshotInList `locationName:"snapshots" type:"list"` -} - -// 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 ListClusterSnapshotsOutput) 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 ListClusterSnapshotsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListClusterSnapshotsOutput) SetNextToken(v string) *ListClusterSnapshotsOutput { - s.NextToken = &v - return s -} - -// SetSnapshots sets the Snapshots field's value. -func (s *ListClusterSnapshotsOutput) SetSnapshots(v []*ClusterSnapshotInList) *ListClusterSnapshotsOutput { - s.Snapshots = v - return s -} - -type ListClustersInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of entries to recieve in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The nextToken which is used the get the next page of data. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListClustersInput) 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 ListClustersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListClustersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListClustersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListClustersInput) SetMaxResults(v int64) *ListClustersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListClustersInput) SetNextToken(v string) *ListClustersInput { - s.NextToken = &v - return s -} - -type ListClustersOutput struct { - _ struct{} `type:"structure"` - - // A list of Elastic DocumentDB cluster. - Clusters []*ClusterInList `locationName:"clusters" type:"list"` - - // The response will provide a nextToken if there is more data beyond the maxResults. - // - // If there is no more data in the responce, the nextToken will not be returned. - NextToken *string `locationName:"nextToken" 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 ListClustersOutput) 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 ListClustersOutput) GoString() string { - return s.String() -} - -// SetClusters sets the Clusters field's value. -func (s *ListClustersOutput) SetClusters(v []*ClusterInList) *ListClustersOutput { - s.Clusters = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListClustersOutput) SetNextToken(v string) *ListClustersOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The arn of the Elastic DocumentDB resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The list of tags for the specified Elastic DocumentDB resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// The specified resource could not be located. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // An error message describing the failure. - Message_ *string `locationName:"message" type:"string"` - - // The ID of the resource that could not be located. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of the resource that could not be found. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type RestoreClusterFromSnapshotInput struct { - _ struct{} `type:"structure"` - - // The name of the Elastic DocumentDB cluster. - // - // ClusterName is a required field - ClusterName *string `locationName:"clusterName" type:"string" required:"true"` - - // The KMS key identifier to use to encrypt the new Elastic DocumentDB cluster. - // - // The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption - // key. If you are creating a cluster using the same Amazon account that owns - // this KMS encryption key, you can use the KMS key alias instead of the ARN - // as the KMS encryption key. - // - // If an encryption key is not specified here, Elastic DocumentDB uses the default - // encryption key that KMS creates for your account. Your account has a different - // default encryption key for each Amazon Region. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The arn of the Elastic DocumentDB snapshot. - // - // SnapshotArn is a required field - SnapshotArn *string `location:"uri" locationName:"snapshotArn" type:"string" required:"true"` - - // The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster. - SubnetIds []*string `locationName:"subnetIds" type:"list"` - - // A list of the tag names to be assigned to the restored DB cluster, in the - // form of an array of key-value pairs in which the key is the tag name and - // the value is the key value. - Tags map[string]*string `locationName:"tags" type:"map"` - - // A list of EC2 VPC security groups to associate with the Elastic DocumentDB - // cluster. - VpcSecurityGroupIds []*string `locationName:"vpcSecurityGroupIds" type:"list"` -} - -// 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 RestoreClusterFromSnapshotInput) 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 RestoreClusterFromSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreClusterFromSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreClusterFromSnapshotInput"} - if s.ClusterName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterName")) - } - if s.SnapshotArn == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotArn")) - } - if s.SnapshotArn != nil && len(*s.SnapshotArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SnapshotArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterName sets the ClusterName field's value. -func (s *RestoreClusterFromSnapshotInput) SetClusterName(v string) *RestoreClusterFromSnapshotInput { - s.ClusterName = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *RestoreClusterFromSnapshotInput) SetKmsKeyId(v string) *RestoreClusterFromSnapshotInput { - s.KmsKeyId = &v - return s -} - -// SetSnapshotArn sets the SnapshotArn field's value. -func (s *RestoreClusterFromSnapshotInput) SetSnapshotArn(v string) *RestoreClusterFromSnapshotInput { - s.SnapshotArn = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *RestoreClusterFromSnapshotInput) SetSubnetIds(v []*string) *RestoreClusterFromSnapshotInput { - s.SubnetIds = v - return s -} - -// SetTags sets the Tags field's value. -func (s *RestoreClusterFromSnapshotInput) SetTags(v map[string]*string) *RestoreClusterFromSnapshotInput { - s.Tags = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *RestoreClusterFromSnapshotInput) SetVpcSecurityGroupIds(v []*string) *RestoreClusterFromSnapshotInput { - s.VpcSecurityGroupIds = v - return s -} - -type RestoreClusterFromSnapshotOutput struct { - _ struct{} `type:"structure"` - - // Returns information about a the restored Elastic DocumentDB cluster. - // - // Cluster is a required field - Cluster *Cluster `locationName:"cluster" type:"structure" 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 RestoreClusterFromSnapshotOutput) 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 RestoreClusterFromSnapshotOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *RestoreClusterFromSnapshotOutput) SetCluster(v *Cluster) *RestoreClusterFromSnapshotOutput { - s.Cluster = v - return s -} - -// The service quota for the action was exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The arn of the Elastic DocumentDB resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The tags to be assigned to the Elastic DocumentDB resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// ThrottlingException will be thrown when request was denied due to request -// throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The number of seconds to wait before retrying the operation. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The arn of the Elastic DocumentDB resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The tag keys to be removed from the Elastic DocumentDB resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateClusterInput struct { - _ struct{} `type:"structure"` - - // The password for the Elastic DocumentDB cluster administrator. This password - // can contain any printable ASCII character except forward slash (/), double - // quote ("), or the "at" symbol (@). - // - // Constraints: Must contain from 8 to 100 characters. - // - // AdminUserPassword is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateClusterInput's - // String and GoString methods. - AdminUserPassword *string `locationName:"adminUserPassword" type:"string" sensitive:"true"` - - // The authentication type for the Elastic DocumentDB cluster. - AuthType *string `locationName:"authType" type:"string" enum:"Auth"` - - // The client token for the Elastic DocumentDB cluster. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The arn of the Elastic DocumentDB cluster. - // - // ClusterArn is a required field - ClusterArn *string `location:"uri" locationName:"clusterArn" type:"string" required:"true"` - - // The weekly time range during which system maintenance can occur, in Universal - // Coordinated Time (UTC). - // - // Format: ddd:hh24:mi-ddd:hh24:mi - // - // Default: a 30-minute window selected at random from an 8-hour block of time - // for each Amazon Web Services Region, occurring on a random day of the week. - // - // Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun - // - // Constraints: Minimum 30-minute window. - PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" type:"string"` - - // The capacity of each shard in the Elastic DocumentDB cluster. - ShardCapacity *int64 `locationName:"shardCapacity" type:"integer"` - - // The number of shards to create in the Elastic DocumentDB cluster. - ShardCount *int64 `locationName:"shardCount" type:"integer"` - - // The number of shards to create in the Elastic DocumentDB cluster. - SubnetIds []*string `locationName:"subnetIds" type:"list"` - - // A list of EC2 VPC security groups to associate with the new Elastic DocumentDB - // cluster. - VpcSecurityGroupIds []*string `locationName:"vpcSecurityGroupIds" type:"list"` -} - -// 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 UpdateClusterInput) 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 UpdateClusterInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateClusterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateClusterInput"} - if s.ClusterArn == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterArn")) - } - if s.ClusterArn != nil && len(*s.ClusterArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClusterArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdminUserPassword sets the AdminUserPassword field's value. -func (s *UpdateClusterInput) SetAdminUserPassword(v string) *UpdateClusterInput { - s.AdminUserPassword = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *UpdateClusterInput) SetAuthType(v string) *UpdateClusterInput { - s.AuthType = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateClusterInput) SetClientToken(v string) *UpdateClusterInput { - s.ClientToken = &v - return s -} - -// SetClusterArn sets the ClusterArn field's value. -func (s *UpdateClusterInput) SetClusterArn(v string) *UpdateClusterInput { - s.ClusterArn = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *UpdateClusterInput) SetPreferredMaintenanceWindow(v string) *UpdateClusterInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetShardCapacity sets the ShardCapacity field's value. -func (s *UpdateClusterInput) SetShardCapacity(v int64) *UpdateClusterInput { - s.ShardCapacity = &v - return s -} - -// SetShardCount sets the ShardCount field's value. -func (s *UpdateClusterInput) SetShardCount(v int64) *UpdateClusterInput { - s.ShardCount = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *UpdateClusterInput) SetSubnetIds(v []*string) *UpdateClusterInput { - s.SubnetIds = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *UpdateClusterInput) SetVpcSecurityGroupIds(v []*string) *UpdateClusterInput { - s.VpcSecurityGroupIds = v - return s -} - -type UpdateClusterOutput struct { - _ struct{} `type:"structure"` - - // Returns information about the updated Elastic DocumentDB cluster. - // - // Cluster is a required field - Cluster *Cluster `locationName:"cluster" type:"structure" 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 UpdateClusterOutput) 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 UpdateClusterOutput) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *UpdateClusterOutput) SetCluster(v *Cluster) *UpdateClusterOutput { - s.Cluster = v - return s -} - -// A structure defining a validation exception. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // A list of the fields in which the validation exception occurred. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - // An error message describing the validation exception. - Message_ *string `locationName:"message" type:"string"` - - // The reason why the validation exception occurred (one of unknownOperation, - // cannotParse, fieldValidationFailed, or other). - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A specific field in which a given validation exception occurred. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // An error message describing the validation exception in this field. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the field where the validation exception occurred. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // AuthPlainText is a Auth enum value - AuthPlainText = "PLAIN_TEXT" - - // AuthSecretArn is a Auth enum value - AuthSecretArn = "SECRET_ARN" -) - -// Auth_Values returns all elements of the Auth enum -func Auth_Values() []string { - return []string{ - AuthPlainText, - AuthSecretArn, - } -} - -const ( - // StatusCreating is a Status enum value - StatusCreating = "CREATING" - - // StatusActive is a Status enum value - StatusActive = "ACTIVE" - - // StatusDeleting is a Status enum value - StatusDeleting = "DELETING" - - // StatusUpdating is a Status enum value - StatusUpdating = "UPDATING" - - // StatusVpcEndpointLimitExceeded is a Status enum value - StatusVpcEndpointLimitExceeded = "VPC_ENDPOINT_LIMIT_EXCEEDED" - - // StatusIpAddressLimitExceeded is a Status enum value - StatusIpAddressLimitExceeded = "IP_ADDRESS_LIMIT_EXCEEDED" - - // StatusInvalidSecurityGroupId is a Status enum value - StatusInvalidSecurityGroupId = "INVALID_SECURITY_GROUP_ID" - - // StatusInvalidSubnetId is a Status enum value - StatusInvalidSubnetId = "INVALID_SUBNET_ID" - - // StatusInaccessibleEncryptionCreds is a Status enum value - StatusInaccessibleEncryptionCreds = "INACCESSIBLE_ENCRYPTION_CREDS" -) - -// Status_Values returns all elements of the Status enum -func Status_Values() []string { - return []string{ - StatusCreating, - StatusActive, - StatusDeleting, - StatusUpdating, - StatusVpcEndpointLimitExceeded, - StatusIpAddressLimitExceeded, - StatusInvalidSecurityGroupId, - StatusInvalidSubnetId, - StatusInaccessibleEncryptionCreds, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/doc.go deleted file mode 100644 index 600ca934ef93..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package docdbelastic provides the client and types for making API -// requests to Amazon DocumentDB Elastic Clusters. -// -// The new Amazon Elastic DocumentDB service endpoint. -// -// See https://docs.aws.amazon.com/goto/WebAPI/docdb-elastic-2022-11-28 for more information on this service. -// -// See docdbelastic package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/docdbelastic/ -// -// # Using the Client -// -// To contact Amazon DocumentDB Elastic Clusters with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon DocumentDB Elastic Clusters client DocDBElastic for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/docdbelastic/#New -package docdbelastic diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/docdbelasticiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/docdbelasticiface/interface.go deleted file mode 100644 index 70825ca3634d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/docdbelasticiface/interface.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package docdbelasticiface provides an interface to enable mocking the Amazon DocumentDB Elastic Clusters service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package docdbelasticiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic" -) - -// DocDBElasticAPI provides an interface to enable mocking the -// docdbelastic.DocDBElastic service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon DocumentDB Elastic Clusters. -// func myFunc(svc docdbelasticiface.DocDBElasticAPI) bool { -// // Make svc.CreateCluster request -// } -// -// func main() { -// sess := session.New() -// svc := docdbelastic.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockDocDBElasticClient struct { -// docdbelasticiface.DocDBElasticAPI -// } -// func (m *mockDocDBElasticClient) CreateCluster(input *docdbelastic.CreateClusterInput) (*docdbelastic.CreateClusterOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockDocDBElasticClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type DocDBElasticAPI interface { - CreateCluster(*docdbelastic.CreateClusterInput) (*docdbelastic.CreateClusterOutput, error) - CreateClusterWithContext(aws.Context, *docdbelastic.CreateClusterInput, ...request.Option) (*docdbelastic.CreateClusterOutput, error) - CreateClusterRequest(*docdbelastic.CreateClusterInput) (*request.Request, *docdbelastic.CreateClusterOutput) - - CreateClusterSnapshot(*docdbelastic.CreateClusterSnapshotInput) (*docdbelastic.CreateClusterSnapshotOutput, error) - CreateClusterSnapshotWithContext(aws.Context, *docdbelastic.CreateClusterSnapshotInput, ...request.Option) (*docdbelastic.CreateClusterSnapshotOutput, error) - CreateClusterSnapshotRequest(*docdbelastic.CreateClusterSnapshotInput) (*request.Request, *docdbelastic.CreateClusterSnapshotOutput) - - DeleteCluster(*docdbelastic.DeleteClusterInput) (*docdbelastic.DeleteClusterOutput, error) - DeleteClusterWithContext(aws.Context, *docdbelastic.DeleteClusterInput, ...request.Option) (*docdbelastic.DeleteClusterOutput, error) - DeleteClusterRequest(*docdbelastic.DeleteClusterInput) (*request.Request, *docdbelastic.DeleteClusterOutput) - - DeleteClusterSnapshot(*docdbelastic.DeleteClusterSnapshotInput) (*docdbelastic.DeleteClusterSnapshotOutput, error) - DeleteClusterSnapshotWithContext(aws.Context, *docdbelastic.DeleteClusterSnapshotInput, ...request.Option) (*docdbelastic.DeleteClusterSnapshotOutput, error) - DeleteClusterSnapshotRequest(*docdbelastic.DeleteClusterSnapshotInput) (*request.Request, *docdbelastic.DeleteClusterSnapshotOutput) - - GetCluster(*docdbelastic.GetClusterInput) (*docdbelastic.GetClusterOutput, error) - GetClusterWithContext(aws.Context, *docdbelastic.GetClusterInput, ...request.Option) (*docdbelastic.GetClusterOutput, error) - GetClusterRequest(*docdbelastic.GetClusterInput) (*request.Request, *docdbelastic.GetClusterOutput) - - GetClusterSnapshot(*docdbelastic.GetClusterSnapshotInput) (*docdbelastic.GetClusterSnapshotOutput, error) - GetClusterSnapshotWithContext(aws.Context, *docdbelastic.GetClusterSnapshotInput, ...request.Option) (*docdbelastic.GetClusterSnapshotOutput, error) - GetClusterSnapshotRequest(*docdbelastic.GetClusterSnapshotInput) (*request.Request, *docdbelastic.GetClusterSnapshotOutput) - - ListClusterSnapshots(*docdbelastic.ListClusterSnapshotsInput) (*docdbelastic.ListClusterSnapshotsOutput, error) - ListClusterSnapshotsWithContext(aws.Context, *docdbelastic.ListClusterSnapshotsInput, ...request.Option) (*docdbelastic.ListClusterSnapshotsOutput, error) - ListClusterSnapshotsRequest(*docdbelastic.ListClusterSnapshotsInput) (*request.Request, *docdbelastic.ListClusterSnapshotsOutput) - - ListClusterSnapshotsPages(*docdbelastic.ListClusterSnapshotsInput, func(*docdbelastic.ListClusterSnapshotsOutput, bool) bool) error - ListClusterSnapshotsPagesWithContext(aws.Context, *docdbelastic.ListClusterSnapshotsInput, func(*docdbelastic.ListClusterSnapshotsOutput, bool) bool, ...request.Option) error - - ListClusters(*docdbelastic.ListClustersInput) (*docdbelastic.ListClustersOutput, error) - ListClustersWithContext(aws.Context, *docdbelastic.ListClustersInput, ...request.Option) (*docdbelastic.ListClustersOutput, error) - ListClustersRequest(*docdbelastic.ListClustersInput) (*request.Request, *docdbelastic.ListClustersOutput) - - ListClustersPages(*docdbelastic.ListClustersInput, func(*docdbelastic.ListClustersOutput, bool) bool) error - ListClustersPagesWithContext(aws.Context, *docdbelastic.ListClustersInput, func(*docdbelastic.ListClustersOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*docdbelastic.ListTagsForResourceInput) (*docdbelastic.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *docdbelastic.ListTagsForResourceInput, ...request.Option) (*docdbelastic.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*docdbelastic.ListTagsForResourceInput) (*request.Request, *docdbelastic.ListTagsForResourceOutput) - - RestoreClusterFromSnapshot(*docdbelastic.RestoreClusterFromSnapshotInput) (*docdbelastic.RestoreClusterFromSnapshotOutput, error) - RestoreClusterFromSnapshotWithContext(aws.Context, *docdbelastic.RestoreClusterFromSnapshotInput, ...request.Option) (*docdbelastic.RestoreClusterFromSnapshotOutput, error) - RestoreClusterFromSnapshotRequest(*docdbelastic.RestoreClusterFromSnapshotInput) (*request.Request, *docdbelastic.RestoreClusterFromSnapshotOutput) - - TagResource(*docdbelastic.TagResourceInput) (*docdbelastic.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *docdbelastic.TagResourceInput, ...request.Option) (*docdbelastic.TagResourceOutput, error) - TagResourceRequest(*docdbelastic.TagResourceInput) (*request.Request, *docdbelastic.TagResourceOutput) - - UntagResource(*docdbelastic.UntagResourceInput) (*docdbelastic.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *docdbelastic.UntagResourceInput, ...request.Option) (*docdbelastic.UntagResourceOutput, error) - UntagResourceRequest(*docdbelastic.UntagResourceInput) (*request.Request, *docdbelastic.UntagResourceOutput) - - UpdateCluster(*docdbelastic.UpdateClusterInput) (*docdbelastic.UpdateClusterOutput, error) - UpdateClusterWithContext(aws.Context, *docdbelastic.UpdateClusterInput, ...request.Option) (*docdbelastic.UpdateClusterOutput, error) - UpdateClusterRequest(*docdbelastic.UpdateClusterInput) (*request.Request, *docdbelastic.UpdateClusterOutput) -} - -var _ DocDBElasticAPI = (*docdbelastic.DocDBElastic)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/errors.go deleted file mode 100644 index bf5c2cb2f241..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package docdbelastic - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // An exception that occurs when there are not sufficient permissions to perform - // an action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // There was an access conflict. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // There was an internal server error. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource could not be located. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The service quota for the action was exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // ThrottlingException will be thrown when request was denied due to request - // throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // A structure defining a validation exception. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/service.go deleted file mode 100644 index 4eeac29a4403..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/docdbelastic/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package docdbelastic - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// DocDBElastic provides the API operation methods for making requests to -// Amazon DocumentDB Elastic Clusters. See this package's package overview docs -// for details on the service. -// -// DocDBElastic methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type DocDBElastic struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "DocDB Elastic" // Name of service. - EndpointsID = "docdb-elastic" // ID to lookup a service endpoint with. - ServiceID = "DocDB Elastic" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the DocDBElastic client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a DocDBElastic client from just a session. -// svc := docdbelastic.New(mySession) -// -// // Create a DocDBElastic client with additional configuration -// svc := docdbelastic.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *DocDBElastic { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "docdb-elastic" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *DocDBElastic { - svc := &DocDBElastic{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-11-28", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a DocDBElastic operation and runs any -// custom request initialization. -func (c *DocDBElastic) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/api.go deleted file mode 100644 index f725f7707a2c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/api.go +++ /dev/null @@ -1,1088 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package eksauth - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opAssumeRoleForPodIdentity = "AssumeRoleForPodIdentity" - -// AssumeRoleForPodIdentityRequest generates a "aws/request.Request" representing the -// client's request for the AssumeRoleForPodIdentity 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 AssumeRoleForPodIdentity for more information on using the AssumeRoleForPodIdentity -// 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 AssumeRoleForPodIdentityRequest method. -// req, resp := client.AssumeRoleForPodIdentityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-auth-2023-11-26/AssumeRoleForPodIdentity -func (c *EKSAuth) AssumeRoleForPodIdentityRequest(input *AssumeRoleForPodIdentityInput) (req *request.Request, output *AssumeRoleForPodIdentityOutput) { - op := &request.Operation{ - Name: opAssumeRoleForPodIdentity, - HTTPMethod: "POST", - HTTPPath: "/clusters/{clusterName}/assume-role-for-pod-identity", - } - - if input == nil { - input = &AssumeRoleForPodIdentityInput{} - } - - output = &AssumeRoleForPodIdentityOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssumeRoleForPodIdentity API operation for Amazon EKS Auth. -// -// The Amazon EKS Auth API and the AssumeRoleForPodIdentity action are only -// used by the EKS Pod Identity Agent. -// -// We recommend that applications use the Amazon Web Services SDKs to connect -// to Amazon Web Services services; if credentials from an EKS Pod Identity -// association are available in the pod, the latest versions of the SDKs use -// them automatically. -// -// 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 EKS Auth's -// API operation AssumeRoleForPodIdentity for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied because your request rate is too high. Reduce the -// frequency of requests. -// -// - InvalidRequestException -// This exception is thrown if the request contains a semantic error. The precise -// meaning will depend on the API, and will be documented in the error message. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The IAM principal -// making the request must have at least one IAM permissions policy attached -// that grants the required permissions. For more information, see Access management -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the IAM -// User Guide. -// -// - InternalServerException -// These errors are usually caused by a server-side issue. -// -// - InvalidTokenException -// The specified Kubernetes service account token is invalid. -// -// - InvalidParameterException -// The specified parameter is invalid. Review the available parameters for the -// API request. -// -// - ExpiredTokenException -// The specified Kubernetes service account token is expired. -// -// - ResourceNotFoundException -// The specified resource could not be found. -// -// - ServiceUnavailableException -// The service is unavailable. Back off and retry the operation. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-auth-2023-11-26/AssumeRoleForPodIdentity -func (c *EKSAuth) AssumeRoleForPodIdentity(input *AssumeRoleForPodIdentityInput) (*AssumeRoleForPodIdentityOutput, error) { - req, out := c.AssumeRoleForPodIdentityRequest(input) - return out, req.Send() -} - -// AssumeRoleForPodIdentityWithContext is the same as AssumeRoleForPodIdentity with the addition of -// the ability to pass a context and additional request options. -// -// See AssumeRoleForPodIdentity 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 *EKSAuth) AssumeRoleForPodIdentityWithContext(ctx aws.Context, input *AssumeRoleForPodIdentityInput, opts ...request.Option) (*AssumeRoleForPodIdentityOutput, error) { - req, out := c.AssumeRoleForPodIdentityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have permissions to perform the requested operation. The IAM principal -// making the request must have at least one IAM permissions policy attached -// that grants the required permissions. For more information, see Access management -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the IAM -// User Guide. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type AssumeRoleForPodIdentityInput struct { - _ struct{} `type:"structure"` - - // The name of the cluster for the request. - // - // ClusterName is a required field - ClusterName *string `location:"uri" locationName:"clusterName" min:"1" type:"string" required:"true"` - - // The token of the Kubernetes service account for the pod. - // - // Token is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AssumeRoleForPodIdentityInput's - // String and GoString methods. - // - // Token is a required field - Token *string `locationName:"token" min:"1" type:"string" required:"true" sensitive:"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 AssumeRoleForPodIdentityInput) 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 AssumeRoleForPodIdentityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssumeRoleForPodIdentityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssumeRoleForPodIdentityInput"} - if s.ClusterName == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterName")) - } - if s.ClusterName != nil && len(*s.ClusterName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) - } - if s.Token == nil { - invalidParams.Add(request.NewErrParamRequired("Token")) - } - if s.Token != nil && len(*s.Token) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Token", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClusterName sets the ClusterName field's value. -func (s *AssumeRoleForPodIdentityInput) SetClusterName(v string) *AssumeRoleForPodIdentityInput { - s.ClusterName = &v - return s -} - -// SetToken sets the Token field's value. -func (s *AssumeRoleForPodIdentityInput) SetToken(v string) *AssumeRoleForPodIdentityInput { - s.Token = &v - return s -} - -type AssumeRoleForPodIdentityOutput struct { - _ struct{} `type:"structure"` - - // An object with the permanent IAM role identity and the temporary session - // name. - // - // The ARN of the IAM role that the temporary credentials authenticate to. - // - // The session name of the temporary session requested to STS. The value is - // a unique identifier that contains the role ID, a colon (:), and the role - // session name of the role that is being assumed. The role ID is generated - // by IAM when the role is created. The role session name part of the value - // follows this format: eks-clustername-podname-random UUID - // - // AssumedRoleUser is a required field - AssumedRoleUser *AssumedRoleUser `locationName:"assumedRoleUser" type:"structure" required:"true"` - - // The identity that is allowed to use the credentials. This value is always - // pods.eks.amazonaws.com. - // - // Audience is a required field - Audience *string `locationName:"audience" type:"string" required:"true"` - - // The Amazon Web Services Signature Version 4 type of temporary credentials. - // - // Credentials is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AssumeRoleForPodIdentityOutput's - // String and GoString methods. - // - // Credentials is a required field - Credentials *Credentials `locationName:"credentials" type:"structure" required:"true" sensitive:"true"` - - // The Amazon Resource Name (ARN) and ID of the EKS Pod Identity association. - // - // PodIdentityAssociation is a required field - PodIdentityAssociation *PodIdentityAssociation `locationName:"podIdentityAssociation" type:"structure" required:"true"` - - // The name of the Kubernetes service account inside the cluster to associate - // the IAM credentials with. - // - // Subject is a required field - Subject *Subject `locationName:"subject" type:"structure" 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 AssumeRoleForPodIdentityOutput) 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 AssumeRoleForPodIdentityOutput) GoString() string { - return s.String() -} - -// SetAssumedRoleUser sets the AssumedRoleUser field's value. -func (s *AssumeRoleForPodIdentityOutput) SetAssumedRoleUser(v *AssumedRoleUser) *AssumeRoleForPodIdentityOutput { - s.AssumedRoleUser = v - return s -} - -// SetAudience sets the Audience field's value. -func (s *AssumeRoleForPodIdentityOutput) SetAudience(v string) *AssumeRoleForPodIdentityOutput { - s.Audience = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *AssumeRoleForPodIdentityOutput) SetCredentials(v *Credentials) *AssumeRoleForPodIdentityOutput { - s.Credentials = v - return s -} - -// SetPodIdentityAssociation sets the PodIdentityAssociation field's value. -func (s *AssumeRoleForPodIdentityOutput) SetPodIdentityAssociation(v *PodIdentityAssociation) *AssumeRoleForPodIdentityOutput { - s.PodIdentityAssociation = v - return s -} - -// SetSubject sets the Subject field's value. -func (s *AssumeRoleForPodIdentityOutput) SetSubject(v *Subject) *AssumeRoleForPodIdentityOutput { - s.Subject = v - return s -} - -// An object with the permanent IAM role identity and the temporary session -// name. -type AssumedRoleUser struct { - _ struct{} `type:"structure"` - - // The ARN of the IAM role that the temporary credentials authenticate to. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The session name of the temporary session requested to STS. The value is - // a unique identifier that contains the role ID, a colon (:), and the role - // session name of the role that is being assumed. The role ID is generated - // by IAM when the role is created. The role session name part of the value - // follows this format: eks-clustername-podname-random UUID - // - // AssumeRoleId is a required field - AssumeRoleId *string `locationName:"assumeRoleId" 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 AssumedRoleUser) 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 AssumedRoleUser) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AssumedRoleUser) SetArn(v string) *AssumedRoleUser { - s.Arn = &v - return s -} - -// SetAssumeRoleId sets the AssumeRoleId field's value. -func (s *AssumedRoleUser) SetAssumeRoleId(v string) *AssumedRoleUser { - s.AssumeRoleId = &v - return s -} - -// The Amazon Web Services Signature Version 4 type of temporary credentials. -type Credentials struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The access key ID that identifies the temporary security credentials. - // - // AccessKeyId is a required field - AccessKeyId *string `locationName:"accessKeyId" type:"string" required:"true"` - - // The Unix epoch timestamp in seconds when the current credentials expire. - // - // Expiration is a required field - Expiration *time.Time `locationName:"expiration" type:"timestamp" required:"true"` - - // The secret access key that applications inside the pods use to sign requests. - // - // SecretAccessKey is a required field - SecretAccessKey *string `locationName:"secretAccessKey" type:"string" required:"true"` - - // The token that applications inside the pods must pass to any service API - // to use the temporary credentials. - // - // SessionToken is a required field - SessionToken *string `locationName:"sessionToken" 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 Credentials) 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 Credentials) GoString() string { - return s.String() -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *Credentials) SetAccessKeyId(v string) *Credentials { - s.AccessKeyId = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *Credentials) SetExpiration(v time.Time) *Credentials { - s.Expiration = &v - return s -} - -// SetSecretAccessKey sets the SecretAccessKey field's value. -func (s *Credentials) SetSecretAccessKey(v string) *Credentials { - s.SecretAccessKey = &v - return s -} - -// SetSessionToken sets the SessionToken field's value. -func (s *Credentials) SetSessionToken(v string) *Credentials { - s.SessionToken = &v - return s -} - -// The specified Kubernetes service account token is expired. -type ExpiredTokenException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ExpiredTokenException) 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 ExpiredTokenException) GoString() string { - return s.String() -} - -func newErrorExpiredTokenException(v protocol.ResponseMetadata) error { - return &ExpiredTokenException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ExpiredTokenException) Code() string { - return "ExpiredTokenException" -} - -// Message returns the exception's message. -func (s *ExpiredTokenException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ExpiredTokenException) OrigErr() error { - return nil -} - -func (s *ExpiredTokenException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ExpiredTokenException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ExpiredTokenException) RequestID() string { - return s.RespMetadata.RequestID -} - -// These errors are usually caused by a server-side issue. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified parameter is invalid. Review the available parameters for the -// API request. -type InvalidParameterException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InvalidParameterException) 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 InvalidParameterException) GoString() string { - return s.String() -} - -func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { - return &InvalidParameterException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidParameterException) Code() string { - return "InvalidParameterException" -} - -// Message returns the exception's message. -func (s *InvalidParameterException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidParameterException) OrigErr() error { - return nil -} - -func (s *InvalidParameterException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidParameterException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidParameterException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown if the request contains a semantic error. The precise -// meaning will depend on the API, and will be documented in the error message. -type InvalidRequestException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InvalidRequestException) 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 InvalidRequestException) GoString() string { - return s.String() -} - -func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { - return &InvalidRequestException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidRequestException) Code() string { - return "InvalidRequestException" -} - -// Message returns the exception's message. -func (s *InvalidRequestException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidRequestException) OrigErr() error { - return nil -} - -func (s *InvalidRequestException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidRequestException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidRequestException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified Kubernetes service account token is invalid. -type InvalidTokenException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InvalidTokenException) 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 InvalidTokenException) GoString() string { - return s.String() -} - -func newErrorInvalidTokenException(v protocol.ResponseMetadata) error { - return &InvalidTokenException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidTokenException) Code() string { - return "InvalidTokenException" -} - -// Message returns the exception's message. -func (s *InvalidTokenException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidTokenException) OrigErr() error { - return nil -} - -func (s *InvalidTokenException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidTokenException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidTokenException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Amazon EKS Pod Identity associations provide the ability to manage credentials -// for your applications, similar to the way that Amazon EC2 instance profiles -// provide credentials to Amazon EC2 instances. -type PodIdentityAssociation struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the EKS Pod Identity association. - // - // AssociationArn is a required field - AssociationArn *string `locationName:"associationArn" type:"string" required:"true"` - - // The ID of the association. - // - // AssociationId is a required field - AssociationId *string `locationName:"associationId" 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 PodIdentityAssociation) 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 PodIdentityAssociation) GoString() string { - return s.String() -} - -// SetAssociationArn sets the AssociationArn field's value. -func (s *PodIdentityAssociation) SetAssociationArn(v string) *PodIdentityAssociation { - s.AssociationArn = &v - return s -} - -// SetAssociationId sets the AssociationId field's value. -func (s *PodIdentityAssociation) SetAssociationId(v string) *PodIdentityAssociation { - s.AssociationId = &v - return s -} - -// The specified resource could not be found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The service is unavailable. Back off and retry the operation. -type ServiceUnavailableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceUnavailableException) 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 ServiceUnavailableException) GoString() string { - return s.String() -} - -func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { - return &ServiceUnavailableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceUnavailableException) Code() string { - return "ServiceUnavailableException" -} - -// Message returns the exception's message. -func (s *ServiceUnavailableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceUnavailableException) OrigErr() error { - return nil -} - -func (s *ServiceUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceUnavailableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceUnavailableException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An object containing the name of the Kubernetes service account inside the -// cluster to associate the IAM credentials with. -type Subject struct { - _ struct{} `type:"structure"` - - // The name of the Kubernetes namespace inside the cluster to create the association - // in. The service account and the pods that use the service account must be - // in this namespace. - // - // Namespace is a required field - Namespace *string `locationName:"namespace" type:"string" required:"true"` - - // The name of the Kubernetes service account inside the cluster to associate - // the IAM credentials with. - // - // ServiceAccount is a required field - ServiceAccount *string `locationName:"serviceAccount" 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 Subject) 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 Subject) GoString() string { - return s.String() -} - -// SetNamespace sets the Namespace field's value. -func (s *Subject) SetNamespace(v string) *Subject { - s.Namespace = &v - return s -} - -// SetServiceAccount sets the ServiceAccount field's value. -func (s *Subject) SetServiceAccount(v string) *Subject { - s.ServiceAccount = &v - return s -} - -// The request was denied because your request rate is too high. Reduce the -// frequency of requests. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/doc.go deleted file mode 100644 index 88bc18f5b3c9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package eksauth provides the client and types for making API -// requests to Amazon EKS Auth. -// -// The Amazon EKS Auth API and the AssumeRoleForPodIdentity action are only -// used by the EKS Pod Identity Agent. -// -// See https://docs.aws.amazon.com/goto/WebAPI/eks-auth-2023-11-26 for more information on this service. -// -// See eksauth package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/eksauth/ -// -// # Using the Client -// -// To contact Amazon EKS Auth with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon EKS Auth client EKSAuth for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/eksauth/#New -package eksauth diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/eksauthiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/eksauthiface/interface.go deleted file mode 100644 index 63b215967837..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/eksauthiface/interface.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package eksauthiface provides an interface to enable mocking the Amazon EKS Auth service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package eksauthiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth" -) - -// EKSAuthAPI provides an interface to enable mocking the -// eksauth.EKSAuth service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon EKS Auth. -// func myFunc(svc eksauthiface.EKSAuthAPI) bool { -// // Make svc.AssumeRoleForPodIdentity request -// } -// -// func main() { -// sess := session.New() -// svc := eksauth.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockEKSAuthClient struct { -// eksauthiface.EKSAuthAPI -// } -// func (m *mockEKSAuthClient) AssumeRoleForPodIdentity(input *eksauth.AssumeRoleForPodIdentityInput) (*eksauth.AssumeRoleForPodIdentityOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockEKSAuthClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type EKSAuthAPI interface { - AssumeRoleForPodIdentity(*eksauth.AssumeRoleForPodIdentityInput) (*eksauth.AssumeRoleForPodIdentityOutput, error) - AssumeRoleForPodIdentityWithContext(aws.Context, *eksauth.AssumeRoleForPodIdentityInput, ...request.Option) (*eksauth.AssumeRoleForPodIdentityOutput, error) - AssumeRoleForPodIdentityRequest(*eksauth.AssumeRoleForPodIdentityInput) (*request.Request, *eksauth.AssumeRoleForPodIdentityOutput) -} - -var _ EKSAuthAPI = (*eksauth.EKSAuth)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/errors.go deleted file mode 100644 index 5d3682d9c40d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/errors.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package eksauth - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have permissions to perform the requested operation. The IAM principal - // making the request must have at least one IAM permissions policy attached - // that grants the required permissions. For more information, see Access management - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the IAM - // User Guide. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeExpiredTokenException for service response error code - // "ExpiredTokenException". - // - // The specified Kubernetes service account token is expired. - ErrCodeExpiredTokenException = "ExpiredTokenException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // These errors are usually caused by a server-side issue. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // The specified parameter is invalid. Review the available parameters for the - // API request. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeInvalidRequestException for service response error code - // "InvalidRequestException". - // - // This exception is thrown if the request contains a semantic error. The precise - // meaning will depend on the API, and will be documented in the error message. - ErrCodeInvalidRequestException = "InvalidRequestException" - - // ErrCodeInvalidTokenException for service response error code - // "InvalidTokenException". - // - // The specified Kubernetes service account token is invalid. - ErrCodeInvalidTokenException = "InvalidTokenException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource could not be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - // - // The service is unavailable. Back off and retry the operation. - ErrCodeServiceUnavailableException = "ServiceUnavailableException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied because your request rate is too high. Reduce the - // frequency of requests. - ErrCodeThrottlingException = "ThrottlingException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ExpiredTokenException": newErrorExpiredTokenException, - "InternalServerException": newErrorInternalServerException, - "InvalidParameterException": newErrorInvalidParameterException, - "InvalidRequestException": newErrorInvalidRequestException, - "InvalidTokenException": newErrorInvalidTokenException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceUnavailableException": newErrorServiceUnavailableException, - "ThrottlingException": newErrorThrottlingException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/service.go deleted file mode 100644 index dab071e67225..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/eksauth/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package eksauth - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// EKSAuth provides the API operation methods for making requests to -// Amazon EKS Auth. See this package's package overview docs -// for details on the service. -// -// EKSAuth methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type EKSAuth struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "EKS Auth" // Name of service. - EndpointsID = "eks-auth" // ID to lookup a service endpoint with. - ServiceID = "EKS Auth" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the EKSAuth client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a EKSAuth client from just a session. -// svc := eksauth.New(mySession) -// -// // Create a EKSAuth client with additional configuration -// svc := eksauth.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *EKSAuth { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "eks-auth" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *EKSAuth { - svc := &EKSAuth{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-11-26", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a EKSAuth operation and runs any -// custom request initialization. -func (c *EKSAuth) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/api.go deleted file mode 100644 index dcabf751da1b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/api.go +++ /dev/null @@ -1,8460 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package entityresolution - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateIdMappingWorkflow = "CreateIdMappingWorkflow" - -// CreateIdMappingWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the CreateIdMappingWorkflow 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 CreateIdMappingWorkflow for more information on using the CreateIdMappingWorkflow -// 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 CreateIdMappingWorkflowRequest method. -// req, resp := client.CreateIdMappingWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/CreateIdMappingWorkflow -func (c *EntityResolution) CreateIdMappingWorkflowRequest(input *CreateIdMappingWorkflowInput) (req *request.Request, output *CreateIdMappingWorkflowOutput) { - op := &request.Operation{ - Name: opCreateIdMappingWorkflow, - HTTPMethod: "POST", - HTTPPath: "/idmappingworkflows", - } - - if input == nil { - input = &CreateIdMappingWorkflowInput{} - } - - output = &CreateIdMappingWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateIdMappingWorkflow API operation for AWS EntityResolution. -// -// Creates an IdMappingWorkflow object which stores the configuration of the -// data processing job to be run. Each IdMappingWorkflow must have a unique -// workflow name. To modify an existing workflow, use the UpdateIdMappingWorkflow -// API. -// -// 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 AWS EntityResolution's -// API operation CreateIdMappingWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ExceedsLimitException -// The request was rejected because it attempted to create resources beyond -// the current Entity Resolution account limits. The error message describes -// the limit exceeded. HTTP Status Code: 402 -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. Example: Workflow already exists, Schema already exists, -// Workflow is currently running, etc. HTTP Status Code: 400 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/CreateIdMappingWorkflow -func (c *EntityResolution) CreateIdMappingWorkflow(input *CreateIdMappingWorkflowInput) (*CreateIdMappingWorkflowOutput, error) { - req, out := c.CreateIdMappingWorkflowRequest(input) - return out, req.Send() -} - -// CreateIdMappingWorkflowWithContext is the same as CreateIdMappingWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See CreateIdMappingWorkflow 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 *EntityResolution) CreateIdMappingWorkflowWithContext(ctx aws.Context, input *CreateIdMappingWorkflowInput, opts ...request.Option) (*CreateIdMappingWorkflowOutput, error) { - req, out := c.CreateIdMappingWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateMatchingWorkflow = "CreateMatchingWorkflow" - -// CreateMatchingWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the CreateMatchingWorkflow 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 CreateMatchingWorkflow for more information on using the CreateMatchingWorkflow -// 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 CreateMatchingWorkflowRequest method. -// req, resp := client.CreateMatchingWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/CreateMatchingWorkflow -func (c *EntityResolution) CreateMatchingWorkflowRequest(input *CreateMatchingWorkflowInput) (req *request.Request, output *CreateMatchingWorkflowOutput) { - op := &request.Operation{ - Name: opCreateMatchingWorkflow, - HTTPMethod: "POST", - HTTPPath: "/matchingworkflows", - } - - if input == nil { - input = &CreateMatchingWorkflowInput{} - } - - output = &CreateMatchingWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateMatchingWorkflow API operation for AWS EntityResolution. -// -// Creates a MatchingWorkflow object which stores the configuration of the data -// processing job to be run. It is important to note that there should not be -// a pre-existing MatchingWorkflow with the same name. To modify an existing -// workflow, utilize the UpdateMatchingWorkflow API. -// -// 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 AWS EntityResolution's -// API operation CreateMatchingWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ExceedsLimitException -// The request was rejected because it attempted to create resources beyond -// the current Entity Resolution account limits. The error message describes -// the limit exceeded. HTTP Status Code: 402 -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. Example: Workflow already exists, Schema already exists, -// Workflow is currently running, etc. HTTP Status Code: 400 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/CreateMatchingWorkflow -func (c *EntityResolution) CreateMatchingWorkflow(input *CreateMatchingWorkflowInput) (*CreateMatchingWorkflowOutput, error) { - req, out := c.CreateMatchingWorkflowRequest(input) - return out, req.Send() -} - -// CreateMatchingWorkflowWithContext is the same as CreateMatchingWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See CreateMatchingWorkflow 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 *EntityResolution) CreateMatchingWorkflowWithContext(ctx aws.Context, input *CreateMatchingWorkflowInput, opts ...request.Option) (*CreateMatchingWorkflowOutput, error) { - req, out := c.CreateMatchingWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSchemaMapping = "CreateSchemaMapping" - -// CreateSchemaMappingRequest generates a "aws/request.Request" representing the -// client's request for the CreateSchemaMapping 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 CreateSchemaMapping for more information on using the CreateSchemaMapping -// 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 CreateSchemaMappingRequest method. -// req, resp := client.CreateSchemaMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/CreateSchemaMapping -func (c *EntityResolution) CreateSchemaMappingRequest(input *CreateSchemaMappingInput) (req *request.Request, output *CreateSchemaMappingOutput) { - op := &request.Operation{ - Name: opCreateSchemaMapping, - HTTPMethod: "POST", - HTTPPath: "/schemas", - } - - if input == nil { - input = &CreateSchemaMappingInput{} - } - - output = &CreateSchemaMappingOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSchemaMapping API operation for AWS EntityResolution. -// -// Creates a schema mapping, which defines the schema of the input customer -// records table. The SchemaMapping also provides Entity Resolution with some -// metadata about the table, such as the attribute types of the columns and -// which columns to match on. -// -// 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 AWS EntityResolution's -// API operation CreateSchemaMapping for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ExceedsLimitException -// The request was rejected because it attempted to create resources beyond -// the current Entity Resolution account limits. The error message describes -// the limit exceeded. HTTP Status Code: 402 -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. Example: Workflow already exists, Schema already exists, -// Workflow is currently running, etc. HTTP Status Code: 400 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/CreateSchemaMapping -func (c *EntityResolution) CreateSchemaMapping(input *CreateSchemaMappingInput) (*CreateSchemaMappingOutput, error) { - req, out := c.CreateSchemaMappingRequest(input) - return out, req.Send() -} - -// CreateSchemaMappingWithContext is the same as CreateSchemaMapping with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSchemaMapping 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 *EntityResolution) CreateSchemaMappingWithContext(ctx aws.Context, input *CreateSchemaMappingInput, opts ...request.Option) (*CreateSchemaMappingOutput, error) { - req, out := c.CreateSchemaMappingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteIdMappingWorkflow = "DeleteIdMappingWorkflow" - -// DeleteIdMappingWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIdMappingWorkflow 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 DeleteIdMappingWorkflow for more information on using the DeleteIdMappingWorkflow -// 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 DeleteIdMappingWorkflowRequest method. -// req, resp := client.DeleteIdMappingWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/DeleteIdMappingWorkflow -func (c *EntityResolution) DeleteIdMappingWorkflowRequest(input *DeleteIdMappingWorkflowInput) (req *request.Request, output *DeleteIdMappingWorkflowOutput) { - op := &request.Operation{ - Name: opDeleteIdMappingWorkflow, - HTTPMethod: "DELETE", - HTTPPath: "/idmappingworkflows/{workflowName}", - } - - if input == nil { - input = &DeleteIdMappingWorkflowInput{} - } - - output = &DeleteIdMappingWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteIdMappingWorkflow API operation for AWS EntityResolution. -// -// Deletes the IdMappingWorkflow with a given name. This operation will succeed -// even if a workflow with the given name does not exist. -// -// 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 AWS EntityResolution's -// API operation DeleteIdMappingWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/DeleteIdMappingWorkflow -func (c *EntityResolution) DeleteIdMappingWorkflow(input *DeleteIdMappingWorkflowInput) (*DeleteIdMappingWorkflowOutput, error) { - req, out := c.DeleteIdMappingWorkflowRequest(input) - return out, req.Send() -} - -// DeleteIdMappingWorkflowWithContext is the same as DeleteIdMappingWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteIdMappingWorkflow 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 *EntityResolution) DeleteIdMappingWorkflowWithContext(ctx aws.Context, input *DeleteIdMappingWorkflowInput, opts ...request.Option) (*DeleteIdMappingWorkflowOutput, error) { - req, out := c.DeleteIdMappingWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteMatchingWorkflow = "DeleteMatchingWorkflow" - -// DeleteMatchingWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMatchingWorkflow 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 DeleteMatchingWorkflow for more information on using the DeleteMatchingWorkflow -// 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 DeleteMatchingWorkflowRequest method. -// req, resp := client.DeleteMatchingWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/DeleteMatchingWorkflow -func (c *EntityResolution) DeleteMatchingWorkflowRequest(input *DeleteMatchingWorkflowInput) (req *request.Request, output *DeleteMatchingWorkflowOutput) { - op := &request.Operation{ - Name: opDeleteMatchingWorkflow, - HTTPMethod: "DELETE", - HTTPPath: "/matchingworkflows/{workflowName}", - } - - if input == nil { - input = &DeleteMatchingWorkflowInput{} - } - - output = &DeleteMatchingWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteMatchingWorkflow API operation for AWS EntityResolution. -// -// Deletes the MatchingWorkflow with a given name. This operation will succeed -// even if a workflow with the given name does not exist. -// -// 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 AWS EntityResolution's -// API operation DeleteMatchingWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/DeleteMatchingWorkflow -func (c *EntityResolution) DeleteMatchingWorkflow(input *DeleteMatchingWorkflowInput) (*DeleteMatchingWorkflowOutput, error) { - req, out := c.DeleteMatchingWorkflowRequest(input) - return out, req.Send() -} - -// DeleteMatchingWorkflowWithContext is the same as DeleteMatchingWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteMatchingWorkflow 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 *EntityResolution) DeleteMatchingWorkflowWithContext(ctx aws.Context, input *DeleteMatchingWorkflowInput, opts ...request.Option) (*DeleteMatchingWorkflowOutput, error) { - req, out := c.DeleteMatchingWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSchemaMapping = "DeleteSchemaMapping" - -// DeleteSchemaMappingRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSchemaMapping 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 DeleteSchemaMapping for more information on using the DeleteSchemaMapping -// 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 DeleteSchemaMappingRequest method. -// req, resp := client.DeleteSchemaMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/DeleteSchemaMapping -func (c *EntityResolution) DeleteSchemaMappingRequest(input *DeleteSchemaMappingInput) (req *request.Request, output *DeleteSchemaMappingOutput) { - op := &request.Operation{ - Name: opDeleteSchemaMapping, - HTTPMethod: "DELETE", - HTTPPath: "/schemas/{schemaName}", - } - - if input == nil { - input = &DeleteSchemaMappingInput{} - } - - output = &DeleteSchemaMappingOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSchemaMapping API operation for AWS EntityResolution. -// -// Deletes the SchemaMapping with a given name. This operation will succeed -// even if a schema with the given name does not exist. This operation will -// fail if there is a MatchingWorkflow object that references the SchemaMapping -// in the workflow's InputSourceConfig. -// -// 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 AWS EntityResolution's -// API operation DeleteSchemaMapping for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. Example: Workflow already exists, Schema already exists, -// Workflow is currently running, etc. HTTP Status Code: 400 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/DeleteSchemaMapping -func (c *EntityResolution) DeleteSchemaMapping(input *DeleteSchemaMappingInput) (*DeleteSchemaMappingOutput, error) { - req, out := c.DeleteSchemaMappingRequest(input) - return out, req.Send() -} - -// DeleteSchemaMappingWithContext is the same as DeleteSchemaMapping with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSchemaMapping 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 *EntityResolution) DeleteSchemaMappingWithContext(ctx aws.Context, input *DeleteSchemaMappingInput, opts ...request.Option) (*DeleteSchemaMappingOutput, error) { - req, out := c.DeleteSchemaMappingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIdMappingJob = "GetIdMappingJob" - -// GetIdMappingJobRequest generates a "aws/request.Request" representing the -// client's request for the GetIdMappingJob 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 GetIdMappingJob for more information on using the GetIdMappingJob -// 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 GetIdMappingJobRequest method. -// req, resp := client.GetIdMappingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetIdMappingJob -func (c *EntityResolution) GetIdMappingJobRequest(input *GetIdMappingJobInput) (req *request.Request, output *GetIdMappingJobOutput) { - op := &request.Operation{ - Name: opGetIdMappingJob, - HTTPMethod: "GET", - HTTPPath: "/idmappingworkflows/{workflowName}/jobs/{jobId}", - } - - if input == nil { - input = &GetIdMappingJobInput{} - } - - output = &GetIdMappingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIdMappingJob API operation for AWS EntityResolution. -// -// Gets the status, metrics, and errors (if there are any) that are associated -// with a job. -// -// 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 AWS EntityResolution's -// API operation GetIdMappingJob for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetIdMappingJob -func (c *EntityResolution) GetIdMappingJob(input *GetIdMappingJobInput) (*GetIdMappingJobOutput, error) { - req, out := c.GetIdMappingJobRequest(input) - return out, req.Send() -} - -// GetIdMappingJobWithContext is the same as GetIdMappingJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetIdMappingJob 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 *EntityResolution) GetIdMappingJobWithContext(ctx aws.Context, input *GetIdMappingJobInput, opts ...request.Option) (*GetIdMappingJobOutput, error) { - req, out := c.GetIdMappingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIdMappingWorkflow = "GetIdMappingWorkflow" - -// GetIdMappingWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the GetIdMappingWorkflow 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 GetIdMappingWorkflow for more information on using the GetIdMappingWorkflow -// 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 GetIdMappingWorkflowRequest method. -// req, resp := client.GetIdMappingWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetIdMappingWorkflow -func (c *EntityResolution) GetIdMappingWorkflowRequest(input *GetIdMappingWorkflowInput) (req *request.Request, output *GetIdMappingWorkflowOutput) { - op := &request.Operation{ - Name: opGetIdMappingWorkflow, - HTTPMethod: "GET", - HTTPPath: "/idmappingworkflows/{workflowName}", - } - - if input == nil { - input = &GetIdMappingWorkflowInput{} - } - - output = &GetIdMappingWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIdMappingWorkflow API operation for AWS EntityResolution. -// -// Returns the IdMappingWorkflow with a given name, if it exists. -// -// 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 AWS EntityResolution's -// API operation GetIdMappingWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetIdMappingWorkflow -func (c *EntityResolution) GetIdMappingWorkflow(input *GetIdMappingWorkflowInput) (*GetIdMappingWorkflowOutput, error) { - req, out := c.GetIdMappingWorkflowRequest(input) - return out, req.Send() -} - -// GetIdMappingWorkflowWithContext is the same as GetIdMappingWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See GetIdMappingWorkflow 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 *EntityResolution) GetIdMappingWorkflowWithContext(ctx aws.Context, input *GetIdMappingWorkflowInput, opts ...request.Option) (*GetIdMappingWorkflowOutput, error) { - req, out := c.GetIdMappingWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMatchId = "GetMatchId" - -// GetMatchIdRequest generates a "aws/request.Request" representing the -// client's request for the GetMatchId 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 GetMatchId for more information on using the GetMatchId -// 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 GetMatchIdRequest method. -// req, resp := client.GetMatchIdRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetMatchId -func (c *EntityResolution) GetMatchIdRequest(input *GetMatchIdInput) (req *request.Request, output *GetMatchIdOutput) { - op := &request.Operation{ - Name: opGetMatchId, - HTTPMethod: "POST", - HTTPPath: "/matchingworkflows/{workflowName}/matches", - } - - if input == nil { - input = &GetMatchIdInput{} - } - - output = &GetMatchIdOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMatchId API operation for AWS EntityResolution. -// -// Returns the corresponding Match ID of a customer record if the record has -// been processed. -// -// 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 AWS EntityResolution's -// API operation GetMatchId for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetMatchId -func (c *EntityResolution) GetMatchId(input *GetMatchIdInput) (*GetMatchIdOutput, error) { - req, out := c.GetMatchIdRequest(input) - return out, req.Send() -} - -// GetMatchIdWithContext is the same as GetMatchId with the addition of -// the ability to pass a context and additional request options. -// -// See GetMatchId 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 *EntityResolution) GetMatchIdWithContext(ctx aws.Context, input *GetMatchIdInput, opts ...request.Option) (*GetMatchIdOutput, error) { - req, out := c.GetMatchIdRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMatchingJob = "GetMatchingJob" - -// GetMatchingJobRequest generates a "aws/request.Request" representing the -// client's request for the GetMatchingJob 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 GetMatchingJob for more information on using the GetMatchingJob -// 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 GetMatchingJobRequest method. -// req, resp := client.GetMatchingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetMatchingJob -func (c *EntityResolution) GetMatchingJobRequest(input *GetMatchingJobInput) (req *request.Request, output *GetMatchingJobOutput) { - op := &request.Operation{ - Name: opGetMatchingJob, - HTTPMethod: "GET", - HTTPPath: "/matchingworkflows/{workflowName}/jobs/{jobId}", - } - - if input == nil { - input = &GetMatchingJobInput{} - } - - output = &GetMatchingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMatchingJob API operation for AWS EntityResolution. -// -// Gets the status, metrics, and errors (if there are any) that are associated -// with a job. -// -// 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 AWS EntityResolution's -// API operation GetMatchingJob for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetMatchingJob -func (c *EntityResolution) GetMatchingJob(input *GetMatchingJobInput) (*GetMatchingJobOutput, error) { - req, out := c.GetMatchingJobRequest(input) - return out, req.Send() -} - -// GetMatchingJobWithContext is the same as GetMatchingJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetMatchingJob 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 *EntityResolution) GetMatchingJobWithContext(ctx aws.Context, input *GetMatchingJobInput, opts ...request.Option) (*GetMatchingJobOutput, error) { - req, out := c.GetMatchingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMatchingWorkflow = "GetMatchingWorkflow" - -// GetMatchingWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the GetMatchingWorkflow 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 GetMatchingWorkflow for more information on using the GetMatchingWorkflow -// 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 GetMatchingWorkflowRequest method. -// req, resp := client.GetMatchingWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetMatchingWorkflow -func (c *EntityResolution) GetMatchingWorkflowRequest(input *GetMatchingWorkflowInput) (req *request.Request, output *GetMatchingWorkflowOutput) { - op := &request.Operation{ - Name: opGetMatchingWorkflow, - HTTPMethod: "GET", - HTTPPath: "/matchingworkflows/{workflowName}", - } - - if input == nil { - input = &GetMatchingWorkflowInput{} - } - - output = &GetMatchingWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMatchingWorkflow API operation for AWS EntityResolution. -// -// Returns the MatchingWorkflow with a given name, if it exists. -// -// 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 AWS EntityResolution's -// API operation GetMatchingWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetMatchingWorkflow -func (c *EntityResolution) GetMatchingWorkflow(input *GetMatchingWorkflowInput) (*GetMatchingWorkflowOutput, error) { - req, out := c.GetMatchingWorkflowRequest(input) - return out, req.Send() -} - -// GetMatchingWorkflowWithContext is the same as GetMatchingWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See GetMatchingWorkflow 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 *EntityResolution) GetMatchingWorkflowWithContext(ctx aws.Context, input *GetMatchingWorkflowInput, opts ...request.Option) (*GetMatchingWorkflowOutput, error) { - req, out := c.GetMatchingWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSchemaMapping = "GetSchemaMapping" - -// GetSchemaMappingRequest generates a "aws/request.Request" representing the -// client's request for the GetSchemaMapping 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 GetSchemaMapping for more information on using the GetSchemaMapping -// 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 GetSchemaMappingRequest method. -// req, resp := client.GetSchemaMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetSchemaMapping -func (c *EntityResolution) GetSchemaMappingRequest(input *GetSchemaMappingInput) (req *request.Request, output *GetSchemaMappingOutput) { - op := &request.Operation{ - Name: opGetSchemaMapping, - HTTPMethod: "GET", - HTTPPath: "/schemas/{schemaName}", - } - - if input == nil { - input = &GetSchemaMappingInput{} - } - - output = &GetSchemaMappingOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSchemaMapping API operation for AWS EntityResolution. -// -// Returns the SchemaMapping of a given name. -// -// 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 AWS EntityResolution's -// API operation GetSchemaMapping for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/GetSchemaMapping -func (c *EntityResolution) GetSchemaMapping(input *GetSchemaMappingInput) (*GetSchemaMappingOutput, error) { - req, out := c.GetSchemaMappingRequest(input) - return out, req.Send() -} - -// GetSchemaMappingWithContext is the same as GetSchemaMapping with the addition of -// the ability to pass a context and additional request options. -// -// See GetSchemaMapping 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 *EntityResolution) GetSchemaMappingWithContext(ctx aws.Context, input *GetSchemaMappingInput, opts ...request.Option) (*GetSchemaMappingOutput, error) { - req, out := c.GetSchemaMappingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListIdMappingJobs = "ListIdMappingJobs" - -// ListIdMappingJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListIdMappingJobs 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 ListIdMappingJobs for more information on using the ListIdMappingJobs -// 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 ListIdMappingJobsRequest method. -// req, resp := client.ListIdMappingJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListIdMappingJobs -func (c *EntityResolution) ListIdMappingJobsRequest(input *ListIdMappingJobsInput) (req *request.Request, output *ListIdMappingJobsOutput) { - op := &request.Operation{ - Name: opListIdMappingJobs, - HTTPMethod: "GET", - HTTPPath: "/idmappingworkflows/{workflowName}/jobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIdMappingJobsInput{} - } - - output = &ListIdMappingJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIdMappingJobs API operation for AWS EntityResolution. -// -// Lists all ID mapping jobs for a given workflow. -// -// 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 AWS EntityResolution's -// API operation ListIdMappingJobs for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListIdMappingJobs -func (c *EntityResolution) ListIdMappingJobs(input *ListIdMappingJobsInput) (*ListIdMappingJobsOutput, error) { - req, out := c.ListIdMappingJobsRequest(input) - return out, req.Send() -} - -// ListIdMappingJobsWithContext is the same as ListIdMappingJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListIdMappingJobs 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 *EntityResolution) ListIdMappingJobsWithContext(ctx aws.Context, input *ListIdMappingJobsInput, opts ...request.Option) (*ListIdMappingJobsOutput, error) { - req, out := c.ListIdMappingJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIdMappingJobsPages iterates over the pages of a ListIdMappingJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIdMappingJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIdMappingJobs operation. -// pageNum := 0 -// err := client.ListIdMappingJobsPages(params, -// func(page *entityresolution.ListIdMappingJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *EntityResolution) ListIdMappingJobsPages(input *ListIdMappingJobsInput, fn func(*ListIdMappingJobsOutput, bool) bool) error { - return c.ListIdMappingJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIdMappingJobsPagesWithContext same as ListIdMappingJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EntityResolution) ListIdMappingJobsPagesWithContext(ctx aws.Context, input *ListIdMappingJobsInput, fn func(*ListIdMappingJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIdMappingJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIdMappingJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIdMappingJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListIdMappingWorkflows = "ListIdMappingWorkflows" - -// ListIdMappingWorkflowsRequest generates a "aws/request.Request" representing the -// client's request for the ListIdMappingWorkflows 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 ListIdMappingWorkflows for more information on using the ListIdMappingWorkflows -// 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 ListIdMappingWorkflowsRequest method. -// req, resp := client.ListIdMappingWorkflowsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListIdMappingWorkflows -func (c *EntityResolution) ListIdMappingWorkflowsRequest(input *ListIdMappingWorkflowsInput) (req *request.Request, output *ListIdMappingWorkflowsOutput) { - op := &request.Operation{ - Name: opListIdMappingWorkflows, - HTTPMethod: "GET", - HTTPPath: "/idmappingworkflows", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIdMappingWorkflowsInput{} - } - - output = &ListIdMappingWorkflowsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIdMappingWorkflows API operation for AWS EntityResolution. -// -// Returns a list of all the IdMappingWorkflows that have been created for an -// Amazon Web Services account. -// -// 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 AWS EntityResolution's -// API operation ListIdMappingWorkflows for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListIdMappingWorkflows -func (c *EntityResolution) ListIdMappingWorkflows(input *ListIdMappingWorkflowsInput) (*ListIdMappingWorkflowsOutput, error) { - req, out := c.ListIdMappingWorkflowsRequest(input) - return out, req.Send() -} - -// ListIdMappingWorkflowsWithContext is the same as ListIdMappingWorkflows with the addition of -// the ability to pass a context and additional request options. -// -// See ListIdMappingWorkflows 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 *EntityResolution) ListIdMappingWorkflowsWithContext(ctx aws.Context, input *ListIdMappingWorkflowsInput, opts ...request.Option) (*ListIdMappingWorkflowsOutput, error) { - req, out := c.ListIdMappingWorkflowsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIdMappingWorkflowsPages iterates over the pages of a ListIdMappingWorkflows operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIdMappingWorkflows method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIdMappingWorkflows operation. -// pageNum := 0 -// err := client.ListIdMappingWorkflowsPages(params, -// func(page *entityresolution.ListIdMappingWorkflowsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *EntityResolution) ListIdMappingWorkflowsPages(input *ListIdMappingWorkflowsInput, fn func(*ListIdMappingWorkflowsOutput, bool) bool) error { - return c.ListIdMappingWorkflowsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIdMappingWorkflowsPagesWithContext same as ListIdMappingWorkflowsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EntityResolution) ListIdMappingWorkflowsPagesWithContext(ctx aws.Context, input *ListIdMappingWorkflowsInput, fn func(*ListIdMappingWorkflowsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIdMappingWorkflowsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIdMappingWorkflowsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIdMappingWorkflowsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListMatchingJobs = "ListMatchingJobs" - -// ListMatchingJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListMatchingJobs 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 ListMatchingJobs for more information on using the ListMatchingJobs -// 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 ListMatchingJobsRequest method. -// req, resp := client.ListMatchingJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListMatchingJobs -func (c *EntityResolution) ListMatchingJobsRequest(input *ListMatchingJobsInput) (req *request.Request, output *ListMatchingJobsOutput) { - op := &request.Operation{ - Name: opListMatchingJobs, - HTTPMethod: "GET", - HTTPPath: "/matchingworkflows/{workflowName}/jobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMatchingJobsInput{} - } - - output = &ListMatchingJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMatchingJobs API operation for AWS EntityResolution. -// -// Lists all jobs for a given workflow. -// -// 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 AWS EntityResolution's -// API operation ListMatchingJobs for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListMatchingJobs -func (c *EntityResolution) ListMatchingJobs(input *ListMatchingJobsInput) (*ListMatchingJobsOutput, error) { - req, out := c.ListMatchingJobsRequest(input) - return out, req.Send() -} - -// ListMatchingJobsWithContext is the same as ListMatchingJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListMatchingJobs 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 *EntityResolution) ListMatchingJobsWithContext(ctx aws.Context, input *ListMatchingJobsInput, opts ...request.Option) (*ListMatchingJobsOutput, error) { - req, out := c.ListMatchingJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMatchingJobsPages iterates over the pages of a ListMatchingJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMatchingJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMatchingJobs operation. -// pageNum := 0 -// err := client.ListMatchingJobsPages(params, -// func(page *entityresolution.ListMatchingJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *EntityResolution) ListMatchingJobsPages(input *ListMatchingJobsInput, fn func(*ListMatchingJobsOutput, bool) bool) error { - return c.ListMatchingJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMatchingJobsPagesWithContext same as ListMatchingJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EntityResolution) ListMatchingJobsPagesWithContext(ctx aws.Context, input *ListMatchingJobsInput, fn func(*ListMatchingJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMatchingJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMatchingJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListMatchingJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListMatchingWorkflows = "ListMatchingWorkflows" - -// ListMatchingWorkflowsRequest generates a "aws/request.Request" representing the -// client's request for the ListMatchingWorkflows 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 ListMatchingWorkflows for more information on using the ListMatchingWorkflows -// 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 ListMatchingWorkflowsRequest method. -// req, resp := client.ListMatchingWorkflowsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListMatchingWorkflows -func (c *EntityResolution) ListMatchingWorkflowsRequest(input *ListMatchingWorkflowsInput) (req *request.Request, output *ListMatchingWorkflowsOutput) { - op := &request.Operation{ - Name: opListMatchingWorkflows, - HTTPMethod: "GET", - HTTPPath: "/matchingworkflows", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMatchingWorkflowsInput{} - } - - output = &ListMatchingWorkflowsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMatchingWorkflows API operation for AWS EntityResolution. -// -// Returns a list of all the MatchingWorkflows that have been created for an -// Amazon Web Services account. -// -// 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 AWS EntityResolution's -// API operation ListMatchingWorkflows for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListMatchingWorkflows -func (c *EntityResolution) ListMatchingWorkflows(input *ListMatchingWorkflowsInput) (*ListMatchingWorkflowsOutput, error) { - req, out := c.ListMatchingWorkflowsRequest(input) - return out, req.Send() -} - -// ListMatchingWorkflowsWithContext is the same as ListMatchingWorkflows with the addition of -// the ability to pass a context and additional request options. -// -// See ListMatchingWorkflows 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 *EntityResolution) ListMatchingWorkflowsWithContext(ctx aws.Context, input *ListMatchingWorkflowsInput, opts ...request.Option) (*ListMatchingWorkflowsOutput, error) { - req, out := c.ListMatchingWorkflowsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMatchingWorkflowsPages iterates over the pages of a ListMatchingWorkflows operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMatchingWorkflows method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMatchingWorkflows operation. -// pageNum := 0 -// err := client.ListMatchingWorkflowsPages(params, -// func(page *entityresolution.ListMatchingWorkflowsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *EntityResolution) ListMatchingWorkflowsPages(input *ListMatchingWorkflowsInput, fn func(*ListMatchingWorkflowsOutput, bool) bool) error { - return c.ListMatchingWorkflowsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMatchingWorkflowsPagesWithContext same as ListMatchingWorkflowsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EntityResolution) ListMatchingWorkflowsPagesWithContext(ctx aws.Context, input *ListMatchingWorkflowsInput, fn func(*ListMatchingWorkflowsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMatchingWorkflowsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMatchingWorkflowsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListMatchingWorkflowsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProviderServices = "ListProviderServices" - -// ListProviderServicesRequest generates a "aws/request.Request" representing the -// client's request for the ListProviderServices 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 ListProviderServices for more information on using the ListProviderServices -// 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 ListProviderServicesRequest method. -// req, resp := client.ListProviderServicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListProviderServices -func (c *EntityResolution) ListProviderServicesRequest(input *ListProviderServicesInput) (req *request.Request, output *ListProviderServicesOutput) { - op := &request.Operation{ - Name: opListProviderServices, - HTTPMethod: "GET", - HTTPPath: "/providerservices", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProviderServicesInput{} - } - - output = &ListProviderServicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProviderServices API operation for AWS EntityResolution. -// -// Returns a list of all the ProviderServices that are available in this Amazon -// Web Services Region. -// -// 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 AWS EntityResolution's -// API operation ListProviderServices for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListProviderServices -func (c *EntityResolution) ListProviderServices(input *ListProviderServicesInput) (*ListProviderServicesOutput, error) { - req, out := c.ListProviderServicesRequest(input) - return out, req.Send() -} - -// ListProviderServicesWithContext is the same as ListProviderServices with the addition of -// the ability to pass a context and additional request options. -// -// See ListProviderServices 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 *EntityResolution) ListProviderServicesWithContext(ctx aws.Context, input *ListProviderServicesInput, opts ...request.Option) (*ListProviderServicesOutput, error) { - req, out := c.ListProviderServicesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProviderServicesPages iterates over the pages of a ListProviderServices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProviderServices method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProviderServices operation. -// pageNum := 0 -// err := client.ListProviderServicesPages(params, -// func(page *entityresolution.ListProviderServicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *EntityResolution) ListProviderServicesPages(input *ListProviderServicesInput, fn func(*ListProviderServicesOutput, bool) bool) error { - return c.ListProviderServicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProviderServicesPagesWithContext same as ListProviderServicesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EntityResolution) ListProviderServicesPagesWithContext(ctx aws.Context, input *ListProviderServicesInput, fn func(*ListProviderServicesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProviderServicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProviderServicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProviderServicesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSchemaMappings = "ListSchemaMappings" - -// ListSchemaMappingsRequest generates a "aws/request.Request" representing the -// client's request for the ListSchemaMappings 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 ListSchemaMappings for more information on using the ListSchemaMappings -// 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 ListSchemaMappingsRequest method. -// req, resp := client.ListSchemaMappingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListSchemaMappings -func (c *EntityResolution) ListSchemaMappingsRequest(input *ListSchemaMappingsInput) (req *request.Request, output *ListSchemaMappingsOutput) { - op := &request.Operation{ - Name: opListSchemaMappings, - HTTPMethod: "GET", - HTTPPath: "/schemas", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSchemaMappingsInput{} - } - - output = &ListSchemaMappingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSchemaMappings API operation for AWS EntityResolution. -// -// Returns a list of all the SchemaMappings that have been created for an Amazon -// Web Services account. -// -// 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 AWS EntityResolution's -// API operation ListSchemaMappings for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListSchemaMappings -func (c *EntityResolution) ListSchemaMappings(input *ListSchemaMappingsInput) (*ListSchemaMappingsOutput, error) { - req, out := c.ListSchemaMappingsRequest(input) - return out, req.Send() -} - -// ListSchemaMappingsWithContext is the same as ListSchemaMappings with the addition of -// the ability to pass a context and additional request options. -// -// See ListSchemaMappings 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 *EntityResolution) ListSchemaMappingsWithContext(ctx aws.Context, input *ListSchemaMappingsInput, opts ...request.Option) (*ListSchemaMappingsOutput, error) { - req, out := c.ListSchemaMappingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSchemaMappingsPages iterates over the pages of a ListSchemaMappings operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSchemaMappings method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSchemaMappings operation. -// pageNum := 0 -// err := client.ListSchemaMappingsPages(params, -// func(page *entityresolution.ListSchemaMappingsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *EntityResolution) ListSchemaMappingsPages(input *ListSchemaMappingsInput, fn func(*ListSchemaMappingsOutput, bool) bool) error { - return c.ListSchemaMappingsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSchemaMappingsPagesWithContext same as ListSchemaMappingsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *EntityResolution) ListSchemaMappingsPagesWithContext(ctx aws.Context, input *ListSchemaMappingsInput, fn func(*ListSchemaMappingsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSchemaMappingsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSchemaMappingsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSchemaMappingsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListTagsForResource -func (c *EntityResolution) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS EntityResolution. -// -// Displays the tags associated with an Entity Resolution resource. In Entity -// Resolution, SchemaMapping, and MatchingWorkflow can be tagged. -// -// 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 AWS EntityResolution's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/ListTagsForResource -func (c *EntityResolution) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *EntityResolution) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartIdMappingJob = "StartIdMappingJob" - -// StartIdMappingJobRequest generates a "aws/request.Request" representing the -// client's request for the StartIdMappingJob 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 StartIdMappingJob for more information on using the StartIdMappingJob -// 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 StartIdMappingJobRequest method. -// req, resp := client.StartIdMappingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/StartIdMappingJob -func (c *EntityResolution) StartIdMappingJobRequest(input *StartIdMappingJobInput) (req *request.Request, output *StartIdMappingJobOutput) { - op := &request.Operation{ - Name: opStartIdMappingJob, - HTTPMethod: "POST", - HTTPPath: "/idmappingworkflows/{workflowName}/jobs", - } - - if input == nil { - input = &StartIdMappingJobInput{} - } - - output = &StartIdMappingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartIdMappingJob API operation for AWS EntityResolution. -// -// Starts the IdMappingJob of a workflow. The workflow must have previously -// been created using the CreateIdMappingWorkflow endpoint. -// -// 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 AWS EntityResolution's -// API operation StartIdMappingJob for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ExceedsLimitException -// The request was rejected because it attempted to create resources beyond -// the current Entity Resolution account limits. The error message describes -// the limit exceeded. HTTP Status Code: 402 -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. Example: Workflow already exists, Schema already exists, -// Workflow is currently running, etc. HTTP Status Code: 400 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/StartIdMappingJob -func (c *EntityResolution) StartIdMappingJob(input *StartIdMappingJobInput) (*StartIdMappingJobOutput, error) { - req, out := c.StartIdMappingJobRequest(input) - return out, req.Send() -} - -// StartIdMappingJobWithContext is the same as StartIdMappingJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartIdMappingJob 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 *EntityResolution) StartIdMappingJobWithContext(ctx aws.Context, input *StartIdMappingJobInput, opts ...request.Option) (*StartIdMappingJobOutput, error) { - req, out := c.StartIdMappingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartMatchingJob = "StartMatchingJob" - -// StartMatchingJobRequest generates a "aws/request.Request" representing the -// client's request for the StartMatchingJob 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 StartMatchingJob for more information on using the StartMatchingJob -// 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 StartMatchingJobRequest method. -// req, resp := client.StartMatchingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/StartMatchingJob -func (c *EntityResolution) StartMatchingJobRequest(input *StartMatchingJobInput) (req *request.Request, output *StartMatchingJobOutput) { - op := &request.Operation{ - Name: opStartMatchingJob, - HTTPMethod: "POST", - HTTPPath: "/matchingworkflows/{workflowName}/jobs", - } - - if input == nil { - input = &StartMatchingJobInput{} - } - - output = &StartMatchingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartMatchingJob API operation for AWS EntityResolution. -// -// Starts the MatchingJob of a workflow. The workflow must have previously been -// created using the CreateMatchingWorkflow endpoint. -// -// 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 AWS EntityResolution's -// API operation StartMatchingJob for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ExceedsLimitException -// The request was rejected because it attempted to create resources beyond -// the current Entity Resolution account limits. The error message describes -// the limit exceeded. HTTP Status Code: 402 -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. Example: Workflow already exists, Schema already exists, -// Workflow is currently running, etc. HTTP Status Code: 400 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/StartMatchingJob -func (c *EntityResolution) StartMatchingJob(input *StartMatchingJobInput) (*StartMatchingJobOutput, error) { - req, out := c.StartMatchingJobRequest(input) - return out, req.Send() -} - -// StartMatchingJobWithContext is the same as StartMatchingJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartMatchingJob 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 *EntityResolution) StartMatchingJobWithContext(ctx aws.Context, input *StartMatchingJobInput, opts ...request.Option) (*StartMatchingJobOutput, error) { - req, out := c.StartMatchingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/TagResource -func (c *EntityResolution) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS EntityResolution. -// -// Assigns one or more tags (key-value pairs) to the specified Entity Resolution -// resource. Tags can help you organize and categorize your resources. You can -// also use them to scope user permissions by granting a user permission to -// access or change only resources with certain tag values. In Entity Resolution, -// SchemaMapping and MatchingWorkflow can be tagged. Tags don't have any semantic -// meaning to Amazon Web Services and are interpreted strictly as strings of -// characters. You can use the TagResource action with a resource that already -// has tags. If you specify a new tag key, this tag is appended to the list -// of tags associated with the resource. If you specify a tag key that is already -// associated with the resource, the new tag value that you specify replaces -// the previous value for that tag. -// -// 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 AWS EntityResolution's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/TagResource -func (c *EntityResolution) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *EntityResolution) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/UntagResource -func (c *EntityResolution) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS EntityResolution. -// -// Removes one or more tags from the specified Entity Resolution resource. In -// Entity Resolution, SchemaMapping, and MatchingWorkflow can be tagged. -// -// 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 AWS EntityResolution's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/UntagResource -func (c *EntityResolution) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *EntityResolution) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateIdMappingWorkflow = "UpdateIdMappingWorkflow" - -// UpdateIdMappingWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIdMappingWorkflow 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 UpdateIdMappingWorkflow for more information on using the UpdateIdMappingWorkflow -// 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 UpdateIdMappingWorkflowRequest method. -// req, resp := client.UpdateIdMappingWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/UpdateIdMappingWorkflow -func (c *EntityResolution) UpdateIdMappingWorkflowRequest(input *UpdateIdMappingWorkflowInput) (req *request.Request, output *UpdateIdMappingWorkflowOutput) { - op := &request.Operation{ - Name: opUpdateIdMappingWorkflow, - HTTPMethod: "PUT", - HTTPPath: "/idmappingworkflows/{workflowName}", - } - - if input == nil { - input = &UpdateIdMappingWorkflowInput{} - } - - output = &UpdateIdMappingWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIdMappingWorkflow API operation for AWS EntityResolution. -// -// Updates an existing IdMappingWorkflow. This method is identical to CreateIdMappingWorkflow, -// except it uses an HTTP PUT request instead of a POST request, and the IdMappingWorkflow -// must already exist for the method to succeed. -// -// 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 AWS EntityResolution's -// API operation UpdateIdMappingWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/UpdateIdMappingWorkflow -func (c *EntityResolution) UpdateIdMappingWorkflow(input *UpdateIdMappingWorkflowInput) (*UpdateIdMappingWorkflowOutput, error) { - req, out := c.UpdateIdMappingWorkflowRequest(input) - return out, req.Send() -} - -// UpdateIdMappingWorkflowWithContext is the same as UpdateIdMappingWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateIdMappingWorkflow 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 *EntityResolution) UpdateIdMappingWorkflowWithContext(ctx aws.Context, input *UpdateIdMappingWorkflowInput, opts ...request.Option) (*UpdateIdMappingWorkflowOutput, error) { - req, out := c.UpdateIdMappingWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateMatchingWorkflow = "UpdateMatchingWorkflow" - -// UpdateMatchingWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the UpdateMatchingWorkflow 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 UpdateMatchingWorkflow for more information on using the UpdateMatchingWorkflow -// 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 UpdateMatchingWorkflowRequest method. -// req, resp := client.UpdateMatchingWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/UpdateMatchingWorkflow -func (c *EntityResolution) UpdateMatchingWorkflowRequest(input *UpdateMatchingWorkflowInput) (req *request.Request, output *UpdateMatchingWorkflowOutput) { - op := &request.Operation{ - Name: opUpdateMatchingWorkflow, - HTTPMethod: "PUT", - HTTPPath: "/matchingworkflows/{workflowName}", - } - - if input == nil { - input = &UpdateMatchingWorkflowInput{} - } - - output = &UpdateMatchingWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateMatchingWorkflow API operation for AWS EntityResolution. -// -// Updates an existing MatchingWorkflow. This method is identical to CreateMatchingWorkflow, -// except it uses an HTTP PUT request instead of a POST request, and the MatchingWorkflow -// must already exist for the method to succeed. -// -// 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 AWS EntityResolution's -// API operation UpdateMatchingWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/UpdateMatchingWorkflow -func (c *EntityResolution) UpdateMatchingWorkflow(input *UpdateMatchingWorkflowInput) (*UpdateMatchingWorkflowOutput, error) { - req, out := c.UpdateMatchingWorkflowRequest(input) - return out, req.Send() -} - -// UpdateMatchingWorkflowWithContext is the same as UpdateMatchingWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateMatchingWorkflow 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 *EntityResolution) UpdateMatchingWorkflowWithContext(ctx aws.Context, input *UpdateMatchingWorkflowInput, opts ...request.Option) (*UpdateMatchingWorkflowOutput, error) { - req, out := c.UpdateMatchingWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSchemaMapping = "UpdateSchemaMapping" - -// UpdateSchemaMappingRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSchemaMapping 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 UpdateSchemaMapping for more information on using the UpdateSchemaMapping -// 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 UpdateSchemaMappingRequest method. -// req, resp := client.UpdateSchemaMappingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/UpdateSchemaMapping -func (c *EntityResolution) UpdateSchemaMappingRequest(input *UpdateSchemaMappingInput) (req *request.Request, output *UpdateSchemaMappingOutput) { - op := &request.Operation{ - Name: opUpdateSchemaMapping, - HTTPMethod: "PUT", - HTTPPath: "/schemas/{schemaName}", - } - - if input == nil { - input = &UpdateSchemaMappingInput{} - } - - output = &UpdateSchemaMappingOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSchemaMapping API operation for AWS EntityResolution. -// -// Updates a schema mapping. -// -// A schema is immutable if it is being used by a workflow. Therefore, you can't -// update a schema mapping if it's associated with a workflow. -// -// 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 AWS EntityResolution's -// API operation UpdateSchemaMapping for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. HTTP Status Code: 429 -// -// - InternalServerException -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -// -// - ResourceNotFoundException -// The resource could not be found. HTTP Status Code: 404 -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. Example: Workflow already exists, Schema already exists, -// Workflow is currently running, etc. HTTP Status Code: 400 -// -// - ValidationException -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/UpdateSchemaMapping -func (c *EntityResolution) UpdateSchemaMapping(input *UpdateSchemaMappingInput) (*UpdateSchemaMappingOutput, error) { - req, out := c.UpdateSchemaMappingRequest(input) - return out, req.Send() -} - -// UpdateSchemaMappingWithContext is the same as UpdateSchemaMapping with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSchemaMapping 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 *EntityResolution) UpdateSchemaMappingWithContext(ctx aws.Context, input *UpdateSchemaMappingInput, opts ...request.Option) (*UpdateSchemaMappingOutput, error) { - req, out := c.UpdateSchemaMappingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. HTTP Status Code: -// 403 -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request could not be processed because of conflict in the current state -// of the resource. Example: Workflow already exists, Schema already exists, -// Workflow is currently running, etc. HTTP Status Code: 400 -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateIdMappingWorkflowInput struct { - _ struct{} `type:"structure"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines the idMappingType and the providerProperties. - // - // IdMappingTechniques is a required field - IdMappingTechniques *IdMappingTechniques `locationName:"idMappingTechniques" type:"structure" required:"true"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*IdMappingWorkflowInputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of IdMappingWorkflowOutputSource objects, each of which contains fields - // OutputS3Path and Output. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*IdMappingWorkflowOutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The name of the workflow. There can't be multiple IdMappingWorkflows with - // the same name. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 CreateIdMappingWorkflowInput) 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 CreateIdMappingWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateIdMappingWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateIdMappingWorkflowInput"} - if s.IdMappingTechniques == nil { - invalidParams.Add(request.NewErrParamRequired("IdMappingTechniques")) - } - if s.InputSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputSourceConfig")) - } - if s.InputSourceConfig != nil && len(s.InputSourceConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputSourceConfig", 1)) - } - if s.OutputSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputSourceConfig")) - } - if s.OutputSourceConfig != nil && len(s.OutputSourceConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputSourceConfig", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - if s.IdMappingTechniques != nil { - if err := s.IdMappingTechniques.Validate(); err != nil { - invalidParams.AddNested("IdMappingTechniques", err.(request.ErrInvalidParams)) - } - } - if s.InputSourceConfig != nil { - for i, v := range s.InputSourceConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputSourceConfig", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputSourceConfig != nil { - for i, v := range s.OutputSourceConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OutputSourceConfig", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateIdMappingWorkflowInput) SetDescription(v string) *CreateIdMappingWorkflowInput { - s.Description = &v - return s -} - -// SetIdMappingTechniques sets the IdMappingTechniques field's value. -func (s *CreateIdMappingWorkflowInput) SetIdMappingTechniques(v *IdMappingTechniques) *CreateIdMappingWorkflowInput { - s.IdMappingTechniques = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *CreateIdMappingWorkflowInput) SetInputSourceConfig(v []*IdMappingWorkflowInputSource) *CreateIdMappingWorkflowInput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *CreateIdMappingWorkflowInput) SetOutputSourceConfig(v []*IdMappingWorkflowOutputSource) *CreateIdMappingWorkflowInput { - s.OutputSourceConfig = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateIdMappingWorkflowInput) SetRoleArn(v string) *CreateIdMappingWorkflowInput { - s.RoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateIdMappingWorkflowInput) SetTags(v map[string]*string) *CreateIdMappingWorkflowInput { - s.Tags = v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *CreateIdMappingWorkflowInput) SetWorkflowName(v string) *CreateIdMappingWorkflowInput { - s.WorkflowName = &v - return s -} - -type CreateIdMappingWorkflowOutput struct { - _ struct{} `type:"structure"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines the idMappingType and the providerProperties. - // - // IdMappingTechniques is a required field - IdMappingTechniques *IdMappingTechniques `locationName:"idMappingTechniques" type:"structure" required:"true"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*IdMappingWorkflowInputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of IdMappingWorkflowOutputSource objects, each of which contains fields - // OutputS3Path and Output. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*IdMappingWorkflowOutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the IDMappingWorkflow. - // - // WorkflowArn is a required field - WorkflowArn *string `locationName:"workflowArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 CreateIdMappingWorkflowOutput) 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 CreateIdMappingWorkflowOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *CreateIdMappingWorkflowOutput) SetDescription(v string) *CreateIdMappingWorkflowOutput { - s.Description = &v - return s -} - -// SetIdMappingTechniques sets the IdMappingTechniques field's value. -func (s *CreateIdMappingWorkflowOutput) SetIdMappingTechniques(v *IdMappingTechniques) *CreateIdMappingWorkflowOutput { - s.IdMappingTechniques = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *CreateIdMappingWorkflowOutput) SetInputSourceConfig(v []*IdMappingWorkflowInputSource) *CreateIdMappingWorkflowOutput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *CreateIdMappingWorkflowOutput) SetOutputSourceConfig(v []*IdMappingWorkflowOutputSource) *CreateIdMappingWorkflowOutput { - s.OutputSourceConfig = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateIdMappingWorkflowOutput) SetRoleArn(v string) *CreateIdMappingWorkflowOutput { - s.RoleArn = &v - return s -} - -// SetWorkflowArn sets the WorkflowArn field's value. -func (s *CreateIdMappingWorkflowOutput) SetWorkflowArn(v string) *CreateIdMappingWorkflowOutput { - s.WorkflowArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *CreateIdMappingWorkflowOutput) SetWorkflowName(v string) *CreateIdMappingWorkflowOutput { - s.WorkflowName = &v - return s -} - -type CreateMatchingWorkflowInput struct { - _ struct{} `type:"structure"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines an incremental run type and has only incrementalRunType - // as a field. - IncrementalRunConfig *IncrementalRunConfig `locationName:"incrementalRunConfig" type:"structure"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*InputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of OutputSource objects, each of which contains fields OutputS3Path, - // ApplyNormalization, and Output. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*OutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // An object which defines the resolutionType and the ruleBasedProperties. - // - // ResolutionTechniques is a required field - ResolutionTechniques *ResolutionTechniques `locationName:"resolutionTechniques" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The name of the workflow. There can't be multiple MatchingWorkflows with - // the same name. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 CreateMatchingWorkflowInput) 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 CreateMatchingWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMatchingWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMatchingWorkflowInput"} - if s.InputSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputSourceConfig")) - } - if s.InputSourceConfig != nil && len(s.InputSourceConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputSourceConfig", 1)) - } - if s.OutputSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputSourceConfig")) - } - if s.OutputSourceConfig != nil && len(s.OutputSourceConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputSourceConfig", 1)) - } - if s.ResolutionTechniques == nil { - invalidParams.Add(request.NewErrParamRequired("ResolutionTechniques")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - if s.InputSourceConfig != nil { - for i, v := range s.InputSourceConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputSourceConfig", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputSourceConfig != nil { - for i, v := range s.OutputSourceConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OutputSourceConfig", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ResolutionTechniques != nil { - if err := s.ResolutionTechniques.Validate(); err != nil { - invalidParams.AddNested("ResolutionTechniques", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateMatchingWorkflowInput) SetDescription(v string) *CreateMatchingWorkflowInput { - s.Description = &v - return s -} - -// SetIncrementalRunConfig sets the IncrementalRunConfig field's value. -func (s *CreateMatchingWorkflowInput) SetIncrementalRunConfig(v *IncrementalRunConfig) *CreateMatchingWorkflowInput { - s.IncrementalRunConfig = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *CreateMatchingWorkflowInput) SetInputSourceConfig(v []*InputSource) *CreateMatchingWorkflowInput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *CreateMatchingWorkflowInput) SetOutputSourceConfig(v []*OutputSource) *CreateMatchingWorkflowInput { - s.OutputSourceConfig = v - return s -} - -// SetResolutionTechniques sets the ResolutionTechniques field's value. -func (s *CreateMatchingWorkflowInput) SetResolutionTechniques(v *ResolutionTechniques) *CreateMatchingWorkflowInput { - s.ResolutionTechniques = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateMatchingWorkflowInput) SetRoleArn(v string) *CreateMatchingWorkflowInput { - s.RoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateMatchingWorkflowInput) SetTags(v map[string]*string) *CreateMatchingWorkflowInput { - s.Tags = v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *CreateMatchingWorkflowInput) SetWorkflowName(v string) *CreateMatchingWorkflowInput { - s.WorkflowName = &v - return s -} - -type CreateMatchingWorkflowOutput struct { - _ struct{} `type:"structure"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines an incremental run type and has only incrementalRunType - // as a field. - IncrementalRunConfig *IncrementalRunConfig `locationName:"incrementalRunConfig" type:"structure"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*InputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of OutputSource objects, each of which contains fields OutputS3Path, - // ApplyNormalization, and Output. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*OutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // An object which defines the resolutionType and the ruleBasedProperties. - // - // ResolutionTechniques is a required field - ResolutionTechniques *ResolutionTechniques `locationName:"resolutionTechniques" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the MatchingWorkflow. - // - // WorkflowArn is a required field - WorkflowArn *string `locationName:"workflowArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 CreateMatchingWorkflowOutput) 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 CreateMatchingWorkflowOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *CreateMatchingWorkflowOutput) SetDescription(v string) *CreateMatchingWorkflowOutput { - s.Description = &v - return s -} - -// SetIncrementalRunConfig sets the IncrementalRunConfig field's value. -func (s *CreateMatchingWorkflowOutput) SetIncrementalRunConfig(v *IncrementalRunConfig) *CreateMatchingWorkflowOutput { - s.IncrementalRunConfig = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *CreateMatchingWorkflowOutput) SetInputSourceConfig(v []*InputSource) *CreateMatchingWorkflowOutput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *CreateMatchingWorkflowOutput) SetOutputSourceConfig(v []*OutputSource) *CreateMatchingWorkflowOutput { - s.OutputSourceConfig = v - return s -} - -// SetResolutionTechniques sets the ResolutionTechniques field's value. -func (s *CreateMatchingWorkflowOutput) SetResolutionTechniques(v *ResolutionTechniques) *CreateMatchingWorkflowOutput { - s.ResolutionTechniques = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateMatchingWorkflowOutput) SetRoleArn(v string) *CreateMatchingWorkflowOutput { - s.RoleArn = &v - return s -} - -// SetWorkflowArn sets the WorkflowArn field's value. -func (s *CreateMatchingWorkflowOutput) SetWorkflowArn(v string) *CreateMatchingWorkflowOutput { - s.WorkflowArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *CreateMatchingWorkflowOutput) SetWorkflowName(v string) *CreateMatchingWorkflowOutput { - s.WorkflowName = &v - return s -} - -type CreateSchemaMappingInput struct { - _ struct{} `type:"structure"` - - // A description of the schema. - Description *string `locationName:"description" type:"string"` - - // A list of MappedInputFields. Each MappedInputField corresponds to a column - // the source data table, and contains column name plus additional information - // that Entity Resolution uses for matching. - // - // MappedInputFields is a required field - MappedInputFields []*SchemaInputAttribute `locationName:"mappedInputFields" min:"2" type:"list" required:"true"` - - // The name of the schema. There can't be multiple SchemaMappings with the same - // name. - // - // SchemaName is a required field - SchemaName *string `locationName:"schemaName" min:"1" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateSchemaMappingInput) 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 CreateSchemaMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSchemaMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSchemaMappingInput"} - if s.MappedInputFields == nil { - invalidParams.Add(request.NewErrParamRequired("MappedInputFields")) - } - if s.MappedInputFields != nil && len(s.MappedInputFields) < 2 { - invalidParams.Add(request.NewErrParamMinLen("MappedInputFields", 2)) - } - if s.SchemaName == nil { - invalidParams.Add(request.NewErrParamRequired("SchemaName")) - } - if s.SchemaName != nil && len(*s.SchemaName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SchemaName", 1)) - } - if s.MappedInputFields != nil { - for i, v := range s.MappedInputFields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MappedInputFields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateSchemaMappingInput) SetDescription(v string) *CreateSchemaMappingInput { - s.Description = &v - return s -} - -// SetMappedInputFields sets the MappedInputFields field's value. -func (s *CreateSchemaMappingInput) SetMappedInputFields(v []*SchemaInputAttribute) *CreateSchemaMappingInput { - s.MappedInputFields = v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *CreateSchemaMappingInput) SetSchemaName(v string) *CreateSchemaMappingInput { - s.SchemaName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSchemaMappingInput) SetTags(v map[string]*string) *CreateSchemaMappingInput { - s.Tags = v - return s -} - -type CreateSchemaMappingOutput struct { - _ struct{} `type:"structure"` - - // A description of the schema. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // A list of MappedInputFields. Each MappedInputField corresponds to a column - // the source data table, and contains column name plus additional information - // that Entity Resolution uses for matching. - // - // MappedInputFields is a required field - MappedInputFields []*SchemaInputAttribute `locationName:"mappedInputFields" min:"2" type:"list" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the SchemaMapping. - // - // SchemaArn is a required field - SchemaArn *string `locationName:"schemaArn" type:"string" required:"true"` - - // The name of the schema. - // - // SchemaName is a required field - SchemaName *string `locationName:"schemaName" min:"1" 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 CreateSchemaMappingOutput) 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 CreateSchemaMappingOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *CreateSchemaMappingOutput) SetDescription(v string) *CreateSchemaMappingOutput { - s.Description = &v - return s -} - -// SetMappedInputFields sets the MappedInputFields field's value. -func (s *CreateSchemaMappingOutput) SetMappedInputFields(v []*SchemaInputAttribute) *CreateSchemaMappingOutput { - s.MappedInputFields = v - return s -} - -// SetSchemaArn sets the SchemaArn field's value. -func (s *CreateSchemaMappingOutput) SetSchemaArn(v string) *CreateSchemaMappingOutput { - s.SchemaArn = &v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *CreateSchemaMappingOutput) SetSchemaName(v string) *CreateSchemaMappingOutput { - s.SchemaName = &v - return s -} - -type DeleteIdMappingWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the workflow to be deleted. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 DeleteIdMappingWorkflowInput) 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 DeleteIdMappingWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIdMappingWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIdMappingWorkflowInput"} - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *DeleteIdMappingWorkflowInput) SetWorkflowName(v string) *DeleteIdMappingWorkflowInput { - s.WorkflowName = &v - return s -} - -type DeleteIdMappingWorkflowOutput struct { - _ struct{} `type:"structure"` - - // A successful operation message. - // - // Message is a required field - Message *string `locationName:"message" 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 DeleteIdMappingWorkflowOutput) 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 DeleteIdMappingWorkflowOutput) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *DeleteIdMappingWorkflowOutput) SetMessage(v string) *DeleteIdMappingWorkflowOutput { - s.Message = &v - return s -} - -type DeleteMatchingWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the workflow to be retrieved. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 DeleteMatchingWorkflowInput) 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 DeleteMatchingWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMatchingWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMatchingWorkflowInput"} - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *DeleteMatchingWorkflowInput) SetWorkflowName(v string) *DeleteMatchingWorkflowInput { - s.WorkflowName = &v - return s -} - -type DeleteMatchingWorkflowOutput struct { - _ struct{} `type:"structure"` - - // A successful operation message. - // - // Message is a required field - Message *string `locationName:"message" 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 DeleteMatchingWorkflowOutput) 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 DeleteMatchingWorkflowOutput) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *DeleteMatchingWorkflowOutput) SetMessage(v string) *DeleteMatchingWorkflowOutput { - s.Message = &v - return s -} - -type DeleteSchemaMappingInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the schema to delete. - // - // SchemaName is a required field - SchemaName *string `location:"uri" locationName:"schemaName" min:"1" 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 DeleteSchemaMappingInput) 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 DeleteSchemaMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSchemaMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSchemaMappingInput"} - if s.SchemaName == nil { - invalidParams.Add(request.NewErrParamRequired("SchemaName")) - } - if s.SchemaName != nil && len(*s.SchemaName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SchemaName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSchemaName sets the SchemaName field's value. -func (s *DeleteSchemaMappingInput) SetSchemaName(v string) *DeleteSchemaMappingInput { - s.SchemaName = &v - return s -} - -type DeleteSchemaMappingOutput struct { - _ struct{} `type:"structure"` - - // A successful operation message. - // - // Message is a required field - Message *string `locationName:"message" 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 DeleteSchemaMappingOutput) 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 DeleteSchemaMappingOutput) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *DeleteSchemaMappingOutput) SetMessage(v string) *DeleteSchemaMappingOutput { - s.Message = &v - return s -} - -// An object containing an error message, if there was an error. -type ErrorDetails struct { - _ struct{} `type:"structure"` - - // The error message from the job, if there is one. - ErrorMessage *string `locationName:"errorMessage" min:"1" 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 ErrorDetails) 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 ErrorDetails) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *ErrorDetails) SetErrorMessage(v string) *ErrorDetails { - s.ErrorMessage = &v - return s -} - -// The request was rejected because it attempted to create resources beyond -// the current Entity Resolution account limits. The error message describes -// the limit exceeded. HTTP Status Code: 402 -type ExceedsLimitException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The name of the quota that has been breached. - QuotaName *string `locationName:"quotaName" type:"string"` - - // The current quota value for the customers. - QuotaValue *int64 `locationName:"quotaValue" 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 ExceedsLimitException) 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 ExceedsLimitException) GoString() string { - return s.String() -} - -func newErrorExceedsLimitException(v protocol.ResponseMetadata) error { - return &ExceedsLimitException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ExceedsLimitException) Code() string { - return "ExceedsLimitException" -} - -// Message returns the exception's message. -func (s *ExceedsLimitException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ExceedsLimitException) OrigErr() error { - return nil -} - -func (s *ExceedsLimitException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ExceedsLimitException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ExceedsLimitException) RequestID() string { - return s.RespMetadata.RequestID -} - -type GetIdMappingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the job. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 GetIdMappingJobInput) 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 GetIdMappingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIdMappingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIdMappingJobInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobId sets the JobId field's value. -func (s *GetIdMappingJobInput) SetJobId(v string) *GetIdMappingJobInput { - s.JobId = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *GetIdMappingJobInput) SetWorkflowName(v string) *GetIdMappingJobInput { - s.WorkflowName = &v - return s -} - -type GetIdMappingJobOutput struct { - _ struct{} `type:"structure"` - - // The time at which the job has finished. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // An object containing an error message, if there was an error. - ErrorDetails *ErrorDetails `locationName:"errorDetails" type:"structure"` - - // The ID of the job. - // - // JobId is a required field - JobId *string `locationName:"jobId" type:"string" required:"true"` - - // Metrics associated with the execution, specifically total records processed, - // unique IDs generated, and records the execution skipped. - Metrics *IdMappingJobMetrics `locationName:"metrics" type:"structure"` - - // The time at which the job was started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // The current status of the job. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"JobStatus"` -} - -// 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 GetIdMappingJobOutput) 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 GetIdMappingJobOutput) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *GetIdMappingJobOutput) SetEndTime(v time.Time) *GetIdMappingJobOutput { - s.EndTime = &v - return s -} - -// SetErrorDetails sets the ErrorDetails field's value. -func (s *GetIdMappingJobOutput) SetErrorDetails(v *ErrorDetails) *GetIdMappingJobOutput { - s.ErrorDetails = v - return s -} - -// SetJobId sets the JobId field's value. -func (s *GetIdMappingJobOutput) SetJobId(v string) *GetIdMappingJobOutput { - s.JobId = &v - return s -} - -// SetMetrics sets the Metrics field's value. -func (s *GetIdMappingJobOutput) SetMetrics(v *IdMappingJobMetrics) *GetIdMappingJobOutput { - s.Metrics = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetIdMappingJobOutput) SetStartTime(v time.Time) *GetIdMappingJobOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetIdMappingJobOutput) SetStatus(v string) *GetIdMappingJobOutput { - s.Status = &v - return s -} - -type GetIdMappingWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 GetIdMappingWorkflowInput) 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 GetIdMappingWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIdMappingWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIdMappingWorkflowInput"} - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *GetIdMappingWorkflowInput) SetWorkflowName(v string) *GetIdMappingWorkflowInput { - s.WorkflowName = &v - return s -} - -type GetIdMappingWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the workflow was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines the idMappingType and the providerProperties. - // - // IdMappingTechniques is a required field - IdMappingTechniques *IdMappingTechniques `locationName:"idMappingTechniques" type:"structure" required:"true"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*IdMappingWorkflowInputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of OutputSource objects, each of which contains fields OutputS3Path - // and KMSArn. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*IdMappingWorkflowOutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to access resources on your behalf. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The timestamp of when the workflow was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the IdMappingWorkflow . - // - // WorkflowArn is a required field - WorkflowArn *string `locationName:"workflowArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 GetIdMappingWorkflowOutput) 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 GetIdMappingWorkflowOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetIdMappingWorkflowOutput) SetCreatedAt(v time.Time) *GetIdMappingWorkflowOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetIdMappingWorkflowOutput) SetDescription(v string) *GetIdMappingWorkflowOutput { - s.Description = &v - return s -} - -// SetIdMappingTechniques sets the IdMappingTechniques field's value. -func (s *GetIdMappingWorkflowOutput) SetIdMappingTechniques(v *IdMappingTechniques) *GetIdMappingWorkflowOutput { - s.IdMappingTechniques = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *GetIdMappingWorkflowOutput) SetInputSourceConfig(v []*IdMappingWorkflowInputSource) *GetIdMappingWorkflowOutput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *GetIdMappingWorkflowOutput) SetOutputSourceConfig(v []*IdMappingWorkflowOutputSource) *GetIdMappingWorkflowOutput { - s.OutputSourceConfig = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetIdMappingWorkflowOutput) SetRoleArn(v string) *GetIdMappingWorkflowOutput { - s.RoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetIdMappingWorkflowOutput) SetTags(v map[string]*string) *GetIdMappingWorkflowOutput { - s.Tags = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetIdMappingWorkflowOutput) SetUpdatedAt(v time.Time) *GetIdMappingWorkflowOutput { - s.UpdatedAt = &v - return s -} - -// SetWorkflowArn sets the WorkflowArn field's value. -func (s *GetIdMappingWorkflowOutput) SetWorkflowArn(v string) *GetIdMappingWorkflowOutput { - s.WorkflowArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *GetIdMappingWorkflowOutput) SetWorkflowName(v string) *GetIdMappingWorkflowOutput { - s.WorkflowName = &v - return s -} - -type GetMatchIdInput struct { - _ struct{} `type:"structure"` - - // The record to fetch the Match ID for. - // - // Record is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetMatchIdInput's - // String and GoString methods. - // - // Record is a required field - Record map[string]*string `locationName:"record" type:"map" required:"true" sensitive:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 GetMatchIdInput) 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 GetMatchIdInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMatchIdInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMatchIdInput"} - if s.Record == nil { - invalidParams.Add(request.NewErrParamRequired("Record")) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRecord sets the Record field's value. -func (s *GetMatchIdInput) SetRecord(v map[string]*string) *GetMatchIdInput { - s.Record = v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *GetMatchIdInput) SetWorkflowName(v string) *GetMatchIdInput { - s.WorkflowName = &v - return s -} - -type GetMatchIdOutput struct { - _ struct{} `type:"structure"` - - // The unique identifiers for this group of match records. - MatchId *string `locationName:"matchId" 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 GetMatchIdOutput) 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 GetMatchIdOutput) GoString() string { - return s.String() -} - -// SetMatchId sets the MatchId field's value. -func (s *GetMatchIdOutput) SetMatchId(v string) *GetMatchIdOutput { - s.MatchId = &v - return s -} - -type GetMatchingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the job. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 GetMatchingJobInput) 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 GetMatchingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMatchingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMatchingJobInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobId sets the JobId field's value. -func (s *GetMatchingJobInput) SetJobId(v string) *GetMatchingJobInput { - s.JobId = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *GetMatchingJobInput) SetWorkflowName(v string) *GetMatchingJobInput { - s.WorkflowName = &v - return s -} - -type GetMatchingJobOutput struct { - _ struct{} `type:"structure"` - - // The time at which the job has finished. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // An object containing an error message, if there was an error. - ErrorDetails *ErrorDetails `locationName:"errorDetails" type:"structure"` - - // The ID of the job. - // - // JobId is a required field - JobId *string `locationName:"jobId" type:"string" required:"true"` - - // Metrics associated with the execution, specifically total records processed, - // unique IDs generated, and records the execution skipped. - Metrics *JobMetrics `locationName:"metrics" type:"structure"` - - // The time at which the job was started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // The current status of the job. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"JobStatus"` -} - -// 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 GetMatchingJobOutput) 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 GetMatchingJobOutput) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *GetMatchingJobOutput) SetEndTime(v time.Time) *GetMatchingJobOutput { - s.EndTime = &v - return s -} - -// SetErrorDetails sets the ErrorDetails field's value. -func (s *GetMatchingJobOutput) SetErrorDetails(v *ErrorDetails) *GetMatchingJobOutput { - s.ErrorDetails = v - return s -} - -// SetJobId sets the JobId field's value. -func (s *GetMatchingJobOutput) SetJobId(v string) *GetMatchingJobOutput { - s.JobId = &v - return s -} - -// SetMetrics sets the Metrics field's value. -func (s *GetMatchingJobOutput) SetMetrics(v *JobMetrics) *GetMatchingJobOutput { - s.Metrics = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetMatchingJobOutput) SetStartTime(v time.Time) *GetMatchingJobOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetMatchingJobOutput) SetStatus(v string) *GetMatchingJobOutput { - s.Status = &v - return s -} - -type GetMatchingWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 GetMatchingWorkflowInput) 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 GetMatchingWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMatchingWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMatchingWorkflowInput"} - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *GetMatchingWorkflowInput) SetWorkflowName(v string) *GetMatchingWorkflowInput { - s.WorkflowName = &v - return s -} - -type GetMatchingWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the workflow was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines an incremental run type and has only incrementalRunType - // as a field. - IncrementalRunConfig *IncrementalRunConfig `locationName:"incrementalRunConfig" type:"structure"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*InputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of OutputSource objects, each of which contains fields OutputS3Path, - // ApplyNormalization, and Output. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*OutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // An object which defines the resolutionType and the ruleBasedProperties. - // - // ResolutionTechniques is a required field - ResolutionTechniques *ResolutionTechniques `locationName:"resolutionTechniques" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to access resources on your behalf. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The timestamp of when the workflow was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the MatchingWorkflow. - // - // WorkflowArn is a required field - WorkflowArn *string `locationName:"workflowArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 GetMatchingWorkflowOutput) 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 GetMatchingWorkflowOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetMatchingWorkflowOutput) SetCreatedAt(v time.Time) *GetMatchingWorkflowOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetMatchingWorkflowOutput) SetDescription(v string) *GetMatchingWorkflowOutput { - s.Description = &v - return s -} - -// SetIncrementalRunConfig sets the IncrementalRunConfig field's value. -func (s *GetMatchingWorkflowOutput) SetIncrementalRunConfig(v *IncrementalRunConfig) *GetMatchingWorkflowOutput { - s.IncrementalRunConfig = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *GetMatchingWorkflowOutput) SetInputSourceConfig(v []*InputSource) *GetMatchingWorkflowOutput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *GetMatchingWorkflowOutput) SetOutputSourceConfig(v []*OutputSource) *GetMatchingWorkflowOutput { - s.OutputSourceConfig = v - return s -} - -// SetResolutionTechniques sets the ResolutionTechniques field's value. -func (s *GetMatchingWorkflowOutput) SetResolutionTechniques(v *ResolutionTechniques) *GetMatchingWorkflowOutput { - s.ResolutionTechniques = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetMatchingWorkflowOutput) SetRoleArn(v string) *GetMatchingWorkflowOutput { - s.RoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetMatchingWorkflowOutput) SetTags(v map[string]*string) *GetMatchingWorkflowOutput { - s.Tags = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetMatchingWorkflowOutput) SetUpdatedAt(v time.Time) *GetMatchingWorkflowOutput { - s.UpdatedAt = &v - return s -} - -// SetWorkflowArn sets the WorkflowArn field's value. -func (s *GetMatchingWorkflowOutput) SetWorkflowArn(v string) *GetMatchingWorkflowOutput { - s.WorkflowArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *GetMatchingWorkflowOutput) SetWorkflowName(v string) *GetMatchingWorkflowOutput { - s.WorkflowName = &v - return s -} - -type GetSchemaMappingInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the schema to be retrieved. - // - // SchemaName is a required field - SchemaName *string `location:"uri" locationName:"schemaName" min:"1" 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 GetSchemaMappingInput) 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 GetSchemaMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSchemaMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSchemaMappingInput"} - if s.SchemaName == nil { - invalidParams.Add(request.NewErrParamRequired("SchemaName")) - } - if s.SchemaName != nil && len(*s.SchemaName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SchemaName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSchemaName sets the SchemaName field's value. -func (s *GetSchemaMappingInput) SetSchemaName(v string) *GetSchemaMappingInput { - s.SchemaName = &v - return s -} - -type GetSchemaMappingOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of when the SchemaMapping was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // A description of the schema. - Description *string `locationName:"description" type:"string"` - - // Specifies whether the schema mapping has been applied to a workflow. - // - // HasWorkflows is a required field - HasWorkflows *bool `locationName:"hasWorkflows" type:"boolean" required:"true"` - - // A list of MappedInputFields. Each MappedInputField corresponds to a column - // the source data table, and contains column name plus additional information - // Venice uses for matching. - // - // MappedInputFields is a required field - MappedInputFields []*SchemaInputAttribute `locationName:"mappedInputFields" min:"2" type:"list" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the SchemaMapping. - // - // SchemaArn is a required field - SchemaArn *string `locationName:"schemaArn" type:"string" required:"true"` - - // The name of the schema. - // - // SchemaName is a required field - SchemaName *string `locationName:"schemaName" min:"1" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The timestamp of when the SchemaMapping was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 GetSchemaMappingOutput) 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 GetSchemaMappingOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSchemaMappingOutput) SetCreatedAt(v time.Time) *GetSchemaMappingOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetSchemaMappingOutput) SetDescription(v string) *GetSchemaMappingOutput { - s.Description = &v - return s -} - -// SetHasWorkflows sets the HasWorkflows field's value. -func (s *GetSchemaMappingOutput) SetHasWorkflows(v bool) *GetSchemaMappingOutput { - s.HasWorkflows = &v - return s -} - -// SetMappedInputFields sets the MappedInputFields field's value. -func (s *GetSchemaMappingOutput) SetMappedInputFields(v []*SchemaInputAttribute) *GetSchemaMappingOutput { - s.MappedInputFields = v - return s -} - -// SetSchemaArn sets the SchemaArn field's value. -func (s *GetSchemaMappingOutput) SetSchemaArn(v string) *GetSchemaMappingOutput { - s.SchemaArn = &v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *GetSchemaMappingOutput) SetSchemaName(v string) *GetSchemaMappingOutput { - s.SchemaName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetSchemaMappingOutput) SetTags(v map[string]*string) *GetSchemaMappingOutput { - s.Tags = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetSchemaMappingOutput) SetUpdatedAt(v time.Time) *GetSchemaMappingOutput { - s.UpdatedAt = &v - return s -} - -// An object containing InputRecords, TotalRecordsProcessed, MatchIDs, and RecordsNotProcessed. -type IdMappingJobMetrics struct { - _ struct{} `type:"structure"` - - // The total number of input records. - InputRecords *int64 `locationName:"inputRecords" type:"integer"` - - // The total number of records that did not get processed. - RecordsNotProcessed *int64 `locationName:"recordsNotProcessed" type:"integer"` - - // The total number of records processed. - TotalRecordsProcessed *int64 `locationName:"totalRecordsProcessed" 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 IdMappingJobMetrics) 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 IdMappingJobMetrics) GoString() string { - return s.String() -} - -// SetInputRecords sets the InputRecords field's value. -func (s *IdMappingJobMetrics) SetInputRecords(v int64) *IdMappingJobMetrics { - s.InputRecords = &v - return s -} - -// SetRecordsNotProcessed sets the RecordsNotProcessed field's value. -func (s *IdMappingJobMetrics) SetRecordsNotProcessed(v int64) *IdMappingJobMetrics { - s.RecordsNotProcessed = &v - return s -} - -// SetTotalRecordsProcessed sets the TotalRecordsProcessed field's value. -func (s *IdMappingJobMetrics) SetTotalRecordsProcessed(v int64) *IdMappingJobMetrics { - s.TotalRecordsProcessed = &v - return s -} - -// An object which defines the ID mapping techniques and provider configurations. -type IdMappingTechniques struct { - _ struct{} `type:"structure"` - - // The type of ID mapping. - // - // IdMappingType is a required field - IdMappingType *string `locationName:"idMappingType" type:"string" required:"true" enum:"IdMappingType"` - - // An object which defines any additional configurations required by the provider - // service. - // - // ProviderProperties is a required field - ProviderProperties *ProviderProperties `locationName:"providerProperties" type:"structure" 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 IdMappingTechniques) 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 IdMappingTechniques) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IdMappingTechniques) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IdMappingTechniques"} - if s.IdMappingType == nil { - invalidParams.Add(request.NewErrParamRequired("IdMappingType")) - } - if s.ProviderProperties == nil { - invalidParams.Add(request.NewErrParamRequired("ProviderProperties")) - } - if s.ProviderProperties != nil { - if err := s.ProviderProperties.Validate(); err != nil { - invalidParams.AddNested("ProviderProperties", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdMappingType sets the IdMappingType field's value. -func (s *IdMappingTechniques) SetIdMappingType(v string) *IdMappingTechniques { - s.IdMappingType = &v - return s -} - -// SetProviderProperties sets the ProviderProperties field's value. -func (s *IdMappingTechniques) SetProviderProperties(v *ProviderProperties) *IdMappingTechniques { - s.ProviderProperties = v - return s -} - -// An object containing InputSourceARN and SchemaName. -type IdMappingWorkflowInputSource struct { - _ struct{} `type:"structure"` - - // An Gluetable ARN for the input source table. - // - // InputSourceARN is a required field - InputSourceARN *string `locationName:"inputSourceARN" type:"string" required:"true"` - - // The name of the schema to be retrieved. - // - // SchemaName is a required field - SchemaName *string `locationName:"schemaName" min:"1" 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 IdMappingWorkflowInputSource) 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 IdMappingWorkflowInputSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IdMappingWorkflowInputSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IdMappingWorkflowInputSource"} - if s.InputSourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("InputSourceARN")) - } - if s.SchemaName == nil { - invalidParams.Add(request.NewErrParamRequired("SchemaName")) - } - if s.SchemaName != nil && len(*s.SchemaName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SchemaName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInputSourceARN sets the InputSourceARN field's value. -func (s *IdMappingWorkflowInputSource) SetInputSourceARN(v string) *IdMappingWorkflowInputSource { - s.InputSourceARN = &v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *IdMappingWorkflowInputSource) SetSchemaName(v string) *IdMappingWorkflowInputSource { - s.SchemaName = &v - return s -} - -// The output source for the ID mapping workflow. -type IdMappingWorkflowOutputSource struct { - _ struct{} `type:"structure"` - - // Customer KMS ARN for encryption at rest. If not provided, system will use - // an Entity Resolution managed KMS key. - KMSArn *string `type:"string"` - - // The S3 path to which Entity Resolution will write the output table. - // - // OutputS3Path is a required field - OutputS3Path *string `locationName:"outputS3Path" min:"1" 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 IdMappingWorkflowOutputSource) 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 IdMappingWorkflowOutputSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IdMappingWorkflowOutputSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IdMappingWorkflowOutputSource"} - if s.OutputS3Path == nil { - invalidParams.Add(request.NewErrParamRequired("OutputS3Path")) - } - if s.OutputS3Path != nil && len(*s.OutputS3Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputS3Path", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKMSArn sets the KMSArn field's value. -func (s *IdMappingWorkflowOutputSource) SetKMSArn(v string) *IdMappingWorkflowOutputSource { - s.KMSArn = &v - return s -} - -// SetOutputS3Path sets the OutputS3Path field's value. -func (s *IdMappingWorkflowOutputSource) SetOutputS3Path(v string) *IdMappingWorkflowOutputSource { - s.OutputS3Path = &v - return s -} - -// A list of IdMappingWorkflowSummary objects, each of which contain the fields -// WorkflowName, WorkflowArn, CreatedAt, and UpdatedAt. -type IdMappingWorkflowSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when the workflow was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The timestamp of when the workflow was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the IdMappingWorkflow. - // - // WorkflowArn is a required field - WorkflowArn *string `locationName:"workflowArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 IdMappingWorkflowSummary) 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 IdMappingWorkflowSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *IdMappingWorkflowSummary) SetCreatedAt(v time.Time) *IdMappingWorkflowSummary { - s.CreatedAt = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *IdMappingWorkflowSummary) SetUpdatedAt(v time.Time) *IdMappingWorkflowSummary { - s.UpdatedAt = &v - return s -} - -// SetWorkflowArn sets the WorkflowArn field's value. -func (s *IdMappingWorkflowSummary) SetWorkflowArn(v string) *IdMappingWorkflowSummary { - s.WorkflowArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *IdMappingWorkflowSummary) SetWorkflowName(v string) *IdMappingWorkflowSummary { - s.WorkflowName = &v - return s -} - -// An object which defines an incremental run type and has only incrementalRunType -// as a field. -type IncrementalRunConfig struct { - _ struct{} `type:"structure"` - - // The type of incremental run. It takes only one value: IMMEDIATE. - IncrementalRunType *string `locationName:"incrementalRunType" type:"string" enum:"IncrementalRunType"` -} - -// 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 IncrementalRunConfig) 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 IncrementalRunConfig) GoString() string { - return s.String() -} - -// SetIncrementalRunType sets the IncrementalRunType field's value. -func (s *IncrementalRunConfig) SetIncrementalRunType(v string) *IncrementalRunConfig { - s.IncrementalRunType = &v - return s -} - -// An object containing InputSourceARN, SchemaName, and ApplyNormalization. -type InputSource struct { - _ struct{} `type:"structure"` - - // Normalizes the attributes defined in the schema in the input data. For example, - // if an attribute has an AttributeType of PHONE_NUMBER, and the data in the - // input table is in a format of 1234567890, Entity Resolution will normalize - // this field in the output to (123)-456-7890. - ApplyNormalization *bool `locationName:"applyNormalization" type:"boolean"` - - // An Glue table ARN for the input source table. - // - // InputSourceARN is a required field - InputSourceARN *string `locationName:"inputSourceARN" type:"string" required:"true"` - - // The name of the schema to be retrieved. - // - // SchemaName is a required field - SchemaName *string `locationName:"schemaName" min:"1" 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 InputSource) 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 InputSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputSource"} - if s.InputSourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("InputSourceARN")) - } - if s.SchemaName == nil { - invalidParams.Add(request.NewErrParamRequired("SchemaName")) - } - if s.SchemaName != nil && len(*s.SchemaName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SchemaName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyNormalization sets the ApplyNormalization field's value. -func (s *InputSource) SetApplyNormalization(v bool) *InputSource { - s.ApplyNormalization = &v - return s -} - -// SetInputSourceARN sets the InputSourceARN field's value. -func (s *InputSource) SetInputSourceARN(v string) *InputSource { - s.InputSourceARN = &v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *InputSource) SetSchemaName(v string) *InputSource { - s.SchemaName = &v - return s -} - -// The Amazon S3 location that temporarily stores your data while it processes. -// Your information won't be saved permanently. -type IntermediateSourceConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon S3 location (bucket and prefix). For example: s3://provider_bucket/DOC-EXAMPLE-BUCKET - // - // IntermediateS3Path is a required field - IntermediateS3Path *string `locationName:"intermediateS3Path" min:"1" 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 IntermediateSourceConfiguration) 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 IntermediateSourceConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IntermediateSourceConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IntermediateSourceConfiguration"} - if s.IntermediateS3Path == nil { - invalidParams.Add(request.NewErrParamRequired("IntermediateS3Path")) - } - if s.IntermediateS3Path != nil && len(*s.IntermediateS3Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IntermediateS3Path", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIntermediateS3Path sets the IntermediateS3Path field's value. -func (s *IntermediateSourceConfiguration) SetIntermediateS3Path(v string) *IntermediateSourceConfiguration { - s.IntermediateS3Path = &v - return s -} - -// This exception occurs when there is an internal failure in the Entity Resolution -// service. HTTP Status Code: 500 -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An object containing InputRecords, TotalRecordsProcessed, MatchIDs, and RecordsNotProcessed. -type JobMetrics struct { - _ struct{} `type:"structure"` - - // The total number of input records. - InputRecords *int64 `locationName:"inputRecords" type:"integer"` - - // The total number of matchIDs generated. - MatchIDs *int64 `locationName:"matchIDs" type:"integer"` - - // The total number of records that did not get processed. - RecordsNotProcessed *int64 `locationName:"recordsNotProcessed" type:"integer"` - - // The total number of records processed. - TotalRecordsProcessed *int64 `locationName:"totalRecordsProcessed" 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 JobMetrics) 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 JobMetrics) GoString() string { - return s.String() -} - -// SetInputRecords sets the InputRecords field's value. -func (s *JobMetrics) SetInputRecords(v int64) *JobMetrics { - s.InputRecords = &v - return s -} - -// SetMatchIDs sets the MatchIDs field's value. -func (s *JobMetrics) SetMatchIDs(v int64) *JobMetrics { - s.MatchIDs = &v - return s -} - -// SetRecordsNotProcessed sets the RecordsNotProcessed field's value. -func (s *JobMetrics) SetRecordsNotProcessed(v int64) *JobMetrics { - s.RecordsNotProcessed = &v - return s -} - -// SetTotalRecordsProcessed sets the TotalRecordsProcessed field's value. -func (s *JobMetrics) SetTotalRecordsProcessed(v int64) *JobMetrics { - s.TotalRecordsProcessed = &v - return s -} - -// An object containing the JobId, Status, StartTime, and EndTime of a job. -type JobSummary struct { - _ struct{} `type:"structure"` - - // The time at which the job has finished. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // The ID of the job. - // - // JobId is a required field - JobId *string `locationName:"jobId" type:"string" required:"true"` - - // The time at which the job was started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // The current status of the job. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"JobStatus"` -} - -// 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 JobSummary) 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 JobSummary) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *JobSummary) SetEndTime(v time.Time) *JobSummary { - s.EndTime = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *JobSummary) SetJobId(v string) *JobSummary { - s.JobId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *JobSummary) SetStartTime(v time.Time) *JobSummary { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *JobSummary) SetStatus(v string) *JobSummary { - s.Status = &v - return s -} - -type ListIdMappingJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of objects returned per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token from the previous API call. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The name of the workflow to be retrieved. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 ListIdMappingJobsInput) 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 ListIdMappingJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIdMappingJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIdMappingJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIdMappingJobsInput) SetMaxResults(v int64) *ListIdMappingJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdMappingJobsInput) SetNextToken(v string) *ListIdMappingJobsInput { - s.NextToken = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *ListIdMappingJobsInput) SetWorkflowName(v string) *ListIdMappingJobsInput { - s.WorkflowName = &v - return s -} - -type ListIdMappingJobsOutput struct { - _ struct{} `type:"structure"` - - // A list of JobSummary objects. - Jobs []*JobSummary `locationName:"jobs" type:"list"` - - // The pagination token from the previous API call. - NextToken *string `locationName:"nextToken" min:"1" 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 ListIdMappingJobsOutput) 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 ListIdMappingJobsOutput) GoString() string { - return s.String() -} - -// SetJobs sets the Jobs field's value. -func (s *ListIdMappingJobsOutput) SetJobs(v []*JobSummary) *ListIdMappingJobsOutput { - s.Jobs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdMappingJobsOutput) SetNextToken(v string) *ListIdMappingJobsOutput { - s.NextToken = &v - return s -} - -type ListIdMappingWorkflowsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of objects returned per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The pagination token from the previous API call. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListIdMappingWorkflowsInput) 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 ListIdMappingWorkflowsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIdMappingWorkflowsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIdMappingWorkflowsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIdMappingWorkflowsInput) SetMaxResults(v int64) *ListIdMappingWorkflowsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdMappingWorkflowsInput) SetNextToken(v string) *ListIdMappingWorkflowsInput { - s.NextToken = &v - return s -} - -type ListIdMappingWorkflowsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token from the previous API call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of IdMappingWorkflowSummary objects. - WorkflowSummaries []*IdMappingWorkflowSummary `locationName:"workflowSummaries" type:"list"` -} - -// 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 ListIdMappingWorkflowsOutput) 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 ListIdMappingWorkflowsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdMappingWorkflowsOutput) SetNextToken(v string) *ListIdMappingWorkflowsOutput { - s.NextToken = &v - return s -} - -// SetWorkflowSummaries sets the WorkflowSummaries field's value. -func (s *ListIdMappingWorkflowsOutput) SetWorkflowSummaries(v []*IdMappingWorkflowSummary) *ListIdMappingWorkflowsOutput { - s.WorkflowSummaries = v - return s -} - -type ListMatchingJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of objects returned per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token from the previous API call. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The name of the workflow to be retrieved. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 ListMatchingJobsInput) 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 ListMatchingJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMatchingJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMatchingJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListMatchingJobsInput) SetMaxResults(v int64) *ListMatchingJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMatchingJobsInput) SetNextToken(v string) *ListMatchingJobsInput { - s.NextToken = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *ListMatchingJobsInput) SetWorkflowName(v string) *ListMatchingJobsInput { - s.WorkflowName = &v - return s -} - -type ListMatchingJobsOutput struct { - _ struct{} `type:"structure"` - - // A list of JobSummary objects, each of which contain the ID, status, start - // time, and end time of a job. - Jobs []*JobSummary `locationName:"jobs" type:"list"` - - // The pagination token from the previous API call. - NextToken *string `locationName:"nextToken" min:"1" 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 ListMatchingJobsOutput) 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 ListMatchingJobsOutput) GoString() string { - return s.String() -} - -// SetJobs sets the Jobs field's value. -func (s *ListMatchingJobsOutput) SetJobs(v []*JobSummary) *ListMatchingJobsOutput { - s.Jobs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMatchingJobsOutput) SetNextToken(v string) *ListMatchingJobsOutput { - s.NextToken = &v - return s -} - -type ListMatchingWorkflowsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of objects returned per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The pagination token from the previous API call. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListMatchingWorkflowsInput) 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 ListMatchingWorkflowsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMatchingWorkflowsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMatchingWorkflowsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListMatchingWorkflowsInput) SetMaxResults(v int64) *ListMatchingWorkflowsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMatchingWorkflowsInput) SetNextToken(v string) *ListMatchingWorkflowsInput { - s.NextToken = &v - return s -} - -type ListMatchingWorkflowsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token from the previous API call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of MatchingWorkflowSummary objects, each of which contain the fields - // WorkflowName, WorkflowArn, CreatedAt, and UpdatedAt. - WorkflowSummaries []*MatchingWorkflowSummary `locationName:"workflowSummaries" type:"list"` -} - -// 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 ListMatchingWorkflowsOutput) 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 ListMatchingWorkflowsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMatchingWorkflowsOutput) SetNextToken(v string) *ListMatchingWorkflowsOutput { - s.NextToken = &v - return s -} - -// SetWorkflowSummaries sets the WorkflowSummaries field's value. -func (s *ListMatchingWorkflowsOutput) SetWorkflowSummaries(v []*MatchingWorkflowSummary) *ListMatchingWorkflowsOutput { - s.WorkflowSummaries = v - return s -} - -type ListProviderServicesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of objects returned per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"15" type:"integer"` - - // The pagination token from the previous API call. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The name of the provider. This name is typically the company name. - ProviderName *string `location:"querystring" locationName:"providerName" min:"1" 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 ListProviderServicesInput) 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 ListProviderServicesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProviderServicesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProviderServicesInput"} - if s.MaxResults != nil && *s.MaxResults < 15 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 15)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ProviderName != nil && len(*s.ProviderName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProviderName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListProviderServicesInput) SetMaxResults(v int64) *ListProviderServicesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProviderServicesInput) SetNextToken(v string) *ListProviderServicesInput { - s.NextToken = &v - return s -} - -// SetProviderName sets the ProviderName field's value. -func (s *ListProviderServicesInput) SetProviderName(v string) *ListProviderServicesInput { - s.ProviderName = &v - return s -} - -type ListProviderServicesOutput struct { - _ struct{} `type:"structure"` - - // The pagination token from the previous API call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of ProviderServices objects. - ProviderServiceSummaries []*ProviderServiceSummary `locationName:"providerServiceSummaries" type:"list"` -} - -// 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 ListProviderServicesOutput) 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 ListProviderServicesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProviderServicesOutput) SetNextToken(v string) *ListProviderServicesOutput { - s.NextToken = &v - return s -} - -// SetProviderServiceSummaries sets the ProviderServiceSummaries field's value. -func (s *ListProviderServicesOutput) SetProviderServiceSummaries(v []*ProviderServiceSummary) *ListProviderServicesOutput { - s.ProviderServiceSummaries = v - return s -} - -type ListSchemaMappingsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of objects returned per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The pagination token from the previous API call. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListSchemaMappingsInput) 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 ListSchemaMappingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSchemaMappingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSchemaMappingsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSchemaMappingsInput) SetMaxResults(v int64) *ListSchemaMappingsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSchemaMappingsInput) SetNextToken(v string) *ListSchemaMappingsInput { - s.NextToken = &v - return s -} - -type ListSchemaMappingsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token from the previous API call. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of SchemaMappingSummary objects, each of which contain the fields - // SchemaName, SchemaArn, CreatedAt, UpdatedAt. - SchemaList []*SchemaMappingSummary `locationName:"schemaList" type:"list"` -} - -// 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 ListSchemaMappingsOutput) 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 ListSchemaMappingsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSchemaMappingsOutput) SetNextToken(v string) *ListSchemaMappingsOutput { - s.NextToken = &v - return s -} - -// SetSchemaList sets the SchemaList field's value. -func (s *ListSchemaMappingsOutput) SetSchemaList(v []*SchemaMappingSummary) *ListSchemaMappingsOutput { - s.SchemaList = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource for which you want to view tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags used to organize, track, or control access for this resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// A list of MatchingWorkflowSummary objects, each of which contain the fields -// WorkflowName, WorkflowArn, CreatedAt, UpdatedAt. -type MatchingWorkflowSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when the workflow was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The method that has been specified for data matching, either using matching - // provided by Entity Resolution or through a provider service. - // - // ResolutionType is a required field - ResolutionType *string `locationName:"resolutionType" type:"string" required:"true" enum:"ResolutionType"` - - // The timestamp of when the workflow was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the MatchingWorkflow. - // - // WorkflowArn is a required field - WorkflowArn *string `locationName:"workflowArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 MatchingWorkflowSummary) 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 MatchingWorkflowSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *MatchingWorkflowSummary) SetCreatedAt(v time.Time) *MatchingWorkflowSummary { - s.CreatedAt = &v - return s -} - -// SetResolutionType sets the ResolutionType field's value. -func (s *MatchingWorkflowSummary) SetResolutionType(v string) *MatchingWorkflowSummary { - s.ResolutionType = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *MatchingWorkflowSummary) SetUpdatedAt(v time.Time) *MatchingWorkflowSummary { - s.UpdatedAt = &v - return s -} - -// SetWorkflowArn sets the WorkflowArn field's value. -func (s *MatchingWorkflowSummary) SetWorkflowArn(v string) *MatchingWorkflowSummary { - s.WorkflowArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *MatchingWorkflowSummary) SetWorkflowName(v string) *MatchingWorkflowSummary { - s.WorkflowName = &v - return s -} - -// A list of OutputAttribute objects, each of which have the fields Name and -// Hashed. Each of these objects selects a column to be included in the output -// table, and whether the values of the column should be hashed. -type OutputAttribute struct { - _ struct{} `type:"structure"` - - // Enables the ability to hash the column values in the output. - Hashed *bool `locationName:"hashed" type:"boolean"` - - // A name of a column to be written to the output. This must be an InputField - // name in the schema mapping. - // - // Name is a required field - Name *string `locationName:"name" 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 OutputAttribute) 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 OutputAttribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutputAttribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputAttribute"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHashed sets the Hashed field's value. -func (s *OutputAttribute) SetHashed(v bool) *OutputAttribute { - s.Hashed = &v - return s -} - -// SetName sets the Name field's value. -func (s *OutputAttribute) SetName(v string) *OutputAttribute { - s.Name = &v - return s -} - -// A list of OutputAttribute objects, each of which have the fields Name and -// Hashed. Each of these objects selects a column to be included in the output -// table, and whether the values of the column should be hashed. -type OutputSource struct { - _ struct{} `type:"structure"` - - // Normalizes the attributes defined in the schema in the input data. For example, - // if an attribute has an AttributeType of PHONE_NUMBER, and the data in the - // input table is in a format of 1234567890, Entity Resolution will normalize - // this field in the output to (123)-456-7890. - ApplyNormalization *bool `locationName:"applyNormalization" type:"boolean"` - - // Customer KMS ARN for encryption at rest. If not provided, system will use - // an Entity Resolution managed KMS key. - KMSArn *string `type:"string"` - - // A list of OutputAttribute objects, each of which have the fields Name and - // Hashed. Each of these objects selects a column to be included in the output - // table, and whether the values of the column should be hashed. - // - // Output is a required field - Output []*OutputAttribute `locationName:"output" type:"list" required:"true"` - - // The S3 path to which Entity Resolution will write the output table. - // - // OutputS3Path is a required field - OutputS3Path *string `locationName:"outputS3Path" min:"1" 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 OutputSource) 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 OutputSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutputSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputSource"} - if s.Output == nil { - invalidParams.Add(request.NewErrParamRequired("Output")) - } - if s.OutputS3Path == nil { - invalidParams.Add(request.NewErrParamRequired("OutputS3Path")) - } - if s.OutputS3Path != nil && len(*s.OutputS3Path) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputS3Path", 1)) - } - if s.Output != nil { - for i, v := range s.Output { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Output", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyNormalization sets the ApplyNormalization field's value. -func (s *OutputSource) SetApplyNormalization(v bool) *OutputSource { - s.ApplyNormalization = &v - return s -} - -// SetKMSArn sets the KMSArn field's value. -func (s *OutputSource) SetKMSArn(v string) *OutputSource { - s.KMSArn = &v - return s -} - -// SetOutput sets the Output field's value. -func (s *OutputSource) SetOutput(v []*OutputAttribute) *OutputSource { - s.Output = v - return s -} - -// SetOutputS3Path sets the OutputS3Path field's value. -func (s *OutputSource) SetOutputS3Path(v string) *OutputSource { - s.OutputS3Path = &v - return s -} - -// An object containing the providerServiceARN, intermediateSourceConfiguration, -// and providerConfiguration. -type ProviderProperties struct { - _ struct{} `type:"structure"` - - // The Amazon S3 location that temporarily stores your data while it processes. - // Your information won't be saved permanently. - IntermediateSourceConfiguration *IntermediateSourceConfiguration `locationName:"intermediateSourceConfiguration" type:"structure"` - - // The ARN of the provider service. - // - // ProviderServiceArn is a required field - ProviderServiceArn *string `locationName:"providerServiceArn" min:"20" 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 ProviderProperties) 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 ProviderProperties) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProviderProperties) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProviderProperties"} - if s.ProviderServiceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ProviderServiceArn")) - } - if s.ProviderServiceArn != nil && len(*s.ProviderServiceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ProviderServiceArn", 20)) - } - if s.IntermediateSourceConfiguration != nil { - if err := s.IntermediateSourceConfiguration.Validate(); err != nil { - invalidParams.AddNested("IntermediateSourceConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIntermediateSourceConfiguration sets the IntermediateSourceConfiguration field's value. -func (s *ProviderProperties) SetIntermediateSourceConfiguration(v *IntermediateSourceConfiguration) *ProviderProperties { - s.IntermediateSourceConfiguration = v - return s -} - -// SetProviderServiceArn sets the ProviderServiceArn field's value. -func (s *ProviderProperties) SetProviderServiceArn(v string) *ProviderProperties { - s.ProviderServiceArn = &v - return s -} - -// A list of ProviderService objects, each of which contain the fields providerName, -// providerServiceArn, providerServiceName, and providerServiceType. -type ProviderServiceSummary struct { - _ struct{} `type:"structure"` - - // The name of the provider. This name is typically the company name. - // - // ProviderName is a required field - ProviderName *string `locationName:"providerName" min:"1" type:"string" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the providerService. - // - // ProviderServiceArn is a required field - ProviderServiceArn *string `locationName:"providerServiceArn" min:"20" type:"string" required:"true"` - - // The display name of the provider service. - // - // ProviderServiceDisplayName is a required field - ProviderServiceDisplayName *string `locationName:"providerServiceDisplayName" type:"string" required:"true"` - - // The name of the product that the provider service provides. - // - // ProviderServiceName is a required field - ProviderServiceName *string `locationName:"providerServiceName" min:"1" type:"string" required:"true"` - - // The type of provider service. - // - // ProviderServiceType is a required field - ProviderServiceType *string `locationName:"providerServiceType" type:"string" required:"true" enum:"ServiceType"` -} - -// 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 ProviderServiceSummary) 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 ProviderServiceSummary) GoString() string { - return s.String() -} - -// SetProviderName sets the ProviderName field's value. -func (s *ProviderServiceSummary) SetProviderName(v string) *ProviderServiceSummary { - s.ProviderName = &v - return s -} - -// SetProviderServiceArn sets the ProviderServiceArn field's value. -func (s *ProviderServiceSummary) SetProviderServiceArn(v string) *ProviderServiceSummary { - s.ProviderServiceArn = &v - return s -} - -// SetProviderServiceDisplayName sets the ProviderServiceDisplayName field's value. -func (s *ProviderServiceSummary) SetProviderServiceDisplayName(v string) *ProviderServiceSummary { - s.ProviderServiceDisplayName = &v - return s -} - -// SetProviderServiceName sets the ProviderServiceName field's value. -func (s *ProviderServiceSummary) SetProviderServiceName(v string) *ProviderServiceSummary { - s.ProviderServiceName = &v - return s -} - -// SetProviderServiceType sets the ProviderServiceType field's value. -func (s *ProviderServiceSummary) SetProviderServiceType(v string) *ProviderServiceSummary { - s.ProviderServiceType = &v - return s -} - -// An object which defines the resolutionType and the ruleBasedProperties. -type ResolutionTechniques struct { - _ struct{} `type:"structure"` - - // The properties of the provider service. - ProviderProperties *ProviderProperties `locationName:"providerProperties" type:"structure"` - - // The type of matching. There are two types of matching: RULE_MATCHING and - // ML_MATCHING. - // - // ResolutionType is a required field - ResolutionType *string `locationName:"resolutionType" type:"string" required:"true" enum:"ResolutionType"` - - // An object which defines the list of matching rules to run and has a field - // Rules, which is a list of rule objects. - RuleBasedProperties *RuleBasedProperties `locationName:"ruleBasedProperties" 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 ResolutionTechniques) 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 ResolutionTechniques) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResolutionTechniques) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResolutionTechniques"} - if s.ResolutionType == nil { - invalidParams.Add(request.NewErrParamRequired("ResolutionType")) - } - if s.ProviderProperties != nil { - if err := s.ProviderProperties.Validate(); err != nil { - invalidParams.AddNested("ProviderProperties", err.(request.ErrInvalidParams)) - } - } - if s.RuleBasedProperties != nil { - if err := s.RuleBasedProperties.Validate(); err != nil { - invalidParams.AddNested("RuleBasedProperties", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProviderProperties sets the ProviderProperties field's value. -func (s *ResolutionTechniques) SetProviderProperties(v *ProviderProperties) *ResolutionTechniques { - s.ProviderProperties = v - return s -} - -// SetResolutionType sets the ResolutionType field's value. -func (s *ResolutionTechniques) SetResolutionType(v string) *ResolutionTechniques { - s.ResolutionType = &v - return s -} - -// SetRuleBasedProperties sets the RuleBasedProperties field's value. -func (s *ResolutionTechniques) SetRuleBasedProperties(v *RuleBasedProperties) *ResolutionTechniques { - s.RuleBasedProperties = v - return s -} - -// The resource could not be found. HTTP Status Code: 404 -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An object containing RuleName, and MatchingKeys. -type Rule struct { - _ struct{} `type:"structure"` - - // A list of MatchingKeys. The MatchingKeys must have been defined in the SchemaMapping. - // Two records are considered to match according to this rule if all of the - // MatchingKeys match. - // - // MatchingKeys is a required field - MatchingKeys []*string `locationName:"matchingKeys" min:"1" type:"list" required:"true"` - - // A name for the matching rule. - // - // RuleName is a required field - RuleName *string `locationName:"ruleName" 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 Rule) 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 Rule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Rule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Rule"} - if s.MatchingKeys == nil { - invalidParams.Add(request.NewErrParamRequired("MatchingKeys")) - } - if s.MatchingKeys != nil && len(s.MatchingKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MatchingKeys", 1)) - } - if s.RuleName == nil { - invalidParams.Add(request.NewErrParamRequired("RuleName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMatchingKeys sets the MatchingKeys field's value. -func (s *Rule) SetMatchingKeys(v []*string) *Rule { - s.MatchingKeys = v - return s -} - -// SetRuleName sets the RuleName field's value. -func (s *Rule) SetRuleName(v string) *Rule { - s.RuleName = &v - return s -} - -// An object which defines the list of matching rules to run and has a field -// Rules, which is a list of rule objects. -type RuleBasedProperties struct { - _ struct{} `type:"structure"` - - // The comparison type. You can either choose ONE_TO_ONE or MANY_TO_MANY as - // the AttributeMatchingModel. When choosing MANY_TO_MANY, the system can match - // attributes across the sub-types of an attribute type. For example, if the - // value of the Email field of Profile A and the value of BusinessEmail field - // of Profile B matches, the two profiles are matched on the Email type. When - // choosing ONE_TO_ONE ,the system can only match if the sub-types are exact - // matches. For example, only when the value of the Email field of Profile A - // and the value of the Email field of Profile B matches, the two profiles are - // matched on the Email type. - // - // AttributeMatchingModel is a required field - AttributeMatchingModel *string `locationName:"attributeMatchingModel" type:"string" required:"true" enum:"AttributeMatchingModel"` - - // A list of Rule objects, each of which have fields RuleName and MatchingKeys. - // - // Rules is a required field - Rules []*Rule `locationName:"rules" min:"1" type:"list" 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 RuleBasedProperties) 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 RuleBasedProperties) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RuleBasedProperties) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RuleBasedProperties"} - if s.AttributeMatchingModel == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeMatchingModel")) - } - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil && len(s.Rules) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Rules", 1)) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeMatchingModel sets the AttributeMatchingModel field's value. -func (s *RuleBasedProperties) SetAttributeMatchingModel(v string) *RuleBasedProperties { - s.AttributeMatchingModel = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *RuleBasedProperties) SetRules(v []*Rule) *RuleBasedProperties { - s.Rules = v - return s -} - -// An object containing FieldName, Type, GroupName, and MatchKey. -type SchemaInputAttribute struct { - _ struct{} `type:"structure"` - - // A string containing the field name. - // - // FieldName is a required field - FieldName *string `locationName:"fieldName" type:"string" required:"true"` - - // Instruct Entity Resolution to combine several columns into a unified column - // with the identical attribute type. For example, when working with columns - // such as first_name, middle_name, and last_name, assigning them a common GroupName - // will prompt Entity Resolution to concatenate them into a single value. - GroupName *string `locationName:"groupName" type:"string"` - - // A key that allows grouping of multiple input attributes into a unified matching - // group. For example, let's consider a scenario where the source table contains - // various addresses, such as business_address and shipping_address. By assigning - // the MatchKey Address to both attributes, Entity Resolution will match records - // across these fields to create a consolidated matching group. If no MatchKey - // is specified for a column, it won't be utilized for matching purposes but - // will still be included in the output table. - MatchKey *string `locationName:"matchKey" type:"string"` - - // The subtype of the attribute, selected from a list of values. - SubType *string `locationName:"subType" type:"string"` - - // The type of the attribute, selected from a list of values. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SchemaAttributeType"` -} - -// 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 SchemaInputAttribute) 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 SchemaInputAttribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SchemaInputAttribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SchemaInputAttribute"} - if s.FieldName == nil { - invalidParams.Add(request.NewErrParamRequired("FieldName")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldName sets the FieldName field's value. -func (s *SchemaInputAttribute) SetFieldName(v string) *SchemaInputAttribute { - s.FieldName = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *SchemaInputAttribute) SetGroupName(v string) *SchemaInputAttribute { - s.GroupName = &v - return s -} - -// SetMatchKey sets the MatchKey field's value. -func (s *SchemaInputAttribute) SetMatchKey(v string) *SchemaInputAttribute { - s.MatchKey = &v - return s -} - -// SetSubType sets the SubType field's value. -func (s *SchemaInputAttribute) SetSubType(v string) *SchemaInputAttribute { - s.SubType = &v - return s -} - -// SetType sets the Type field's value. -func (s *SchemaInputAttribute) SetType(v string) *SchemaInputAttribute { - s.Type = &v - return s -} - -// An object containing SchemaName, SchemaArn, CreatedAt, andUpdatedAt. -type SchemaMappingSummary struct { - _ struct{} `type:"structure"` - - // The timestamp of when the SchemaMapping was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Specifies whether the schema mapping has been applied to a workflow. - // - // HasWorkflows is a required field - HasWorkflows *bool `locationName:"hasWorkflows" type:"boolean" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the SchemaMapping. - // - // SchemaArn is a required field - SchemaArn *string `locationName:"schemaArn" type:"string" required:"true"` - - // The name of the schema. - // - // SchemaName is a required field - SchemaName *string `locationName:"schemaName" min:"1" type:"string" required:"true"` - - // The timestamp of when the SchemaMapping was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 SchemaMappingSummary) 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 SchemaMappingSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SchemaMappingSummary) SetCreatedAt(v time.Time) *SchemaMappingSummary { - s.CreatedAt = &v - return s -} - -// SetHasWorkflows sets the HasWorkflows field's value. -func (s *SchemaMappingSummary) SetHasWorkflows(v bool) *SchemaMappingSummary { - s.HasWorkflows = &v - return s -} - -// SetSchemaArn sets the SchemaArn field's value. -func (s *SchemaMappingSummary) SetSchemaArn(v string) *SchemaMappingSummary { - s.SchemaArn = &v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *SchemaMappingSummary) SetSchemaName(v string) *SchemaMappingSummary { - s.SchemaName = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SchemaMappingSummary) SetUpdatedAt(v time.Time) *SchemaMappingSummary { - s.UpdatedAt = &v - return s -} - -type StartIdMappingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the ID mapping job to be retrieved. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 StartIdMappingJobInput) 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 StartIdMappingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartIdMappingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartIdMappingJobInput"} - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *StartIdMappingJobInput) SetWorkflowName(v string) *StartIdMappingJobInput { - s.WorkflowName = &v - return s -} - -type StartIdMappingJobOutput struct { - _ struct{} `type:"structure"` - - // The ID of the job. - // - // JobId is a required field - JobId *string `locationName:"jobId" 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 StartIdMappingJobOutput) 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 StartIdMappingJobOutput) GoString() string { - return s.String() -} - -// SetJobId sets the JobId field's value. -func (s *StartIdMappingJobOutput) SetJobId(v string) *StartIdMappingJobOutput { - s.JobId = &v - return s -} - -type StartMatchingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the matching job to be retrieved. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 StartMatchingJobInput) 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 StartMatchingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartMatchingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartMatchingJobInput"} - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *StartMatchingJobInput) SetWorkflowName(v string) *StartMatchingJobInput { - s.WorkflowName = &v - return s -} - -type StartMatchingJobOutput struct { - _ struct{} `type:"structure"` - - // The ID of the job. - // - // JobId is a required field - JobId *string `locationName:"jobId" 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 StartMatchingJobOutput) 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 StartMatchingJobOutput) GoString() string { - return s.String() -} - -// SetJobId sets the JobId field's value. -func (s *StartMatchingJobOutput) SetJobId(v string) *StartMatchingJobOutput { - s.JobId = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource for which you want to view tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. HTTP Status Code: 429 -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource for which you want to untag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The list of tag keys to remove from the resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateIdMappingWorkflowInput struct { - _ struct{} `type:"structure"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines the idMappingType and the providerProperties. - // - // IdMappingTechniques is a required field - IdMappingTechniques *IdMappingTechniques `locationName:"idMappingTechniques" type:"structure" required:"true"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*IdMappingWorkflowInputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of OutputSource objects, each of which contains fields OutputS3Path - // and KMSArn. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*IdMappingWorkflowOutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to access resources on your behalf. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 UpdateIdMappingWorkflowInput) 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 UpdateIdMappingWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIdMappingWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIdMappingWorkflowInput"} - if s.IdMappingTechniques == nil { - invalidParams.Add(request.NewErrParamRequired("IdMappingTechniques")) - } - if s.InputSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputSourceConfig")) - } - if s.InputSourceConfig != nil && len(s.InputSourceConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputSourceConfig", 1)) - } - if s.OutputSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputSourceConfig")) - } - if s.OutputSourceConfig != nil && len(s.OutputSourceConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputSourceConfig", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - if s.IdMappingTechniques != nil { - if err := s.IdMappingTechniques.Validate(); err != nil { - invalidParams.AddNested("IdMappingTechniques", err.(request.ErrInvalidParams)) - } - } - if s.InputSourceConfig != nil { - for i, v := range s.InputSourceConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputSourceConfig", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputSourceConfig != nil { - for i, v := range s.OutputSourceConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OutputSourceConfig", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateIdMappingWorkflowInput) SetDescription(v string) *UpdateIdMappingWorkflowInput { - s.Description = &v - return s -} - -// SetIdMappingTechniques sets the IdMappingTechniques field's value. -func (s *UpdateIdMappingWorkflowInput) SetIdMappingTechniques(v *IdMappingTechniques) *UpdateIdMappingWorkflowInput { - s.IdMappingTechniques = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *UpdateIdMappingWorkflowInput) SetInputSourceConfig(v []*IdMappingWorkflowInputSource) *UpdateIdMappingWorkflowInput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *UpdateIdMappingWorkflowInput) SetOutputSourceConfig(v []*IdMappingWorkflowOutputSource) *UpdateIdMappingWorkflowInput { - s.OutputSourceConfig = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateIdMappingWorkflowInput) SetRoleArn(v string) *UpdateIdMappingWorkflowInput { - s.RoleArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *UpdateIdMappingWorkflowInput) SetWorkflowName(v string) *UpdateIdMappingWorkflowInput { - s.WorkflowName = &v - return s -} - -type UpdateIdMappingWorkflowOutput struct { - _ struct{} `type:"structure"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines the idMappingType and the providerProperties. - // - // IdMappingTechniques is a required field - IdMappingTechniques *IdMappingTechniques `locationName:"idMappingTechniques" type:"structure" required:"true"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*IdMappingWorkflowInputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of OutputSource objects, each of which contains fields OutputS3Path - // and KMSArn. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*IdMappingWorkflowOutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to access resources on your behalf. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the workflow role. Entity Resolution assumes - // this role to access resources on your behalf. - // - // WorkflowArn is a required field - WorkflowArn *string `locationName:"workflowArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 UpdateIdMappingWorkflowOutput) 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 UpdateIdMappingWorkflowOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *UpdateIdMappingWorkflowOutput) SetDescription(v string) *UpdateIdMappingWorkflowOutput { - s.Description = &v - return s -} - -// SetIdMappingTechniques sets the IdMappingTechniques field's value. -func (s *UpdateIdMappingWorkflowOutput) SetIdMappingTechniques(v *IdMappingTechniques) *UpdateIdMappingWorkflowOutput { - s.IdMappingTechniques = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *UpdateIdMappingWorkflowOutput) SetInputSourceConfig(v []*IdMappingWorkflowInputSource) *UpdateIdMappingWorkflowOutput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *UpdateIdMappingWorkflowOutput) SetOutputSourceConfig(v []*IdMappingWorkflowOutputSource) *UpdateIdMappingWorkflowOutput { - s.OutputSourceConfig = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateIdMappingWorkflowOutput) SetRoleArn(v string) *UpdateIdMappingWorkflowOutput { - s.RoleArn = &v - return s -} - -// SetWorkflowArn sets the WorkflowArn field's value. -func (s *UpdateIdMappingWorkflowOutput) SetWorkflowArn(v string) *UpdateIdMappingWorkflowOutput { - s.WorkflowArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *UpdateIdMappingWorkflowOutput) SetWorkflowName(v string) *UpdateIdMappingWorkflowOutput { - s.WorkflowName = &v - return s -} - -type UpdateMatchingWorkflowInput struct { - _ struct{} `type:"structure"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines an incremental run type and has only incrementalRunType - // as a field. - IncrementalRunConfig *IncrementalRunConfig `locationName:"incrementalRunConfig" type:"structure"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*InputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of OutputSource objects, each of which contains fields OutputS3Path, - // ApplyNormalization, and Output. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*OutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // An object which defines the resolutionType and the ruleBasedProperties. - // - // ResolutionTechniques is a required field - ResolutionTechniques *ResolutionTechniques `locationName:"resolutionTechniques" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The name of the workflow to be retrieved. - // - // WorkflowName is a required field - WorkflowName *string `location:"uri" locationName:"workflowName" min:"1" 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 UpdateMatchingWorkflowInput) 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 UpdateMatchingWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateMatchingWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateMatchingWorkflowInput"} - if s.InputSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputSourceConfig")) - } - if s.InputSourceConfig != nil && len(s.InputSourceConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputSourceConfig", 1)) - } - if s.OutputSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputSourceConfig")) - } - if s.OutputSourceConfig != nil && len(s.OutputSourceConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputSourceConfig", 1)) - } - if s.ResolutionTechniques == nil { - invalidParams.Add(request.NewErrParamRequired("ResolutionTechniques")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.WorkflowName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowName")) - } - if s.WorkflowName != nil && len(*s.WorkflowName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowName", 1)) - } - if s.InputSourceConfig != nil { - for i, v := range s.InputSourceConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputSourceConfig", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputSourceConfig != nil { - for i, v := range s.OutputSourceConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OutputSourceConfig", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ResolutionTechniques != nil { - if err := s.ResolutionTechniques.Validate(); err != nil { - invalidParams.AddNested("ResolutionTechniques", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateMatchingWorkflowInput) SetDescription(v string) *UpdateMatchingWorkflowInput { - s.Description = &v - return s -} - -// SetIncrementalRunConfig sets the IncrementalRunConfig field's value. -func (s *UpdateMatchingWorkflowInput) SetIncrementalRunConfig(v *IncrementalRunConfig) *UpdateMatchingWorkflowInput { - s.IncrementalRunConfig = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *UpdateMatchingWorkflowInput) SetInputSourceConfig(v []*InputSource) *UpdateMatchingWorkflowInput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *UpdateMatchingWorkflowInput) SetOutputSourceConfig(v []*OutputSource) *UpdateMatchingWorkflowInput { - s.OutputSourceConfig = v - return s -} - -// SetResolutionTechniques sets the ResolutionTechniques field's value. -func (s *UpdateMatchingWorkflowInput) SetResolutionTechniques(v *ResolutionTechniques) *UpdateMatchingWorkflowInput { - s.ResolutionTechniques = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateMatchingWorkflowInput) SetRoleArn(v string) *UpdateMatchingWorkflowInput { - s.RoleArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *UpdateMatchingWorkflowInput) SetWorkflowName(v string) *UpdateMatchingWorkflowInput { - s.WorkflowName = &v - return s -} - -type UpdateMatchingWorkflowOutput struct { - _ struct{} `type:"structure"` - - // A description of the workflow. - Description *string `locationName:"description" type:"string"` - - // An object which defines an incremental run type and has only incrementalRunType - // as a field. - IncrementalRunConfig *IncrementalRunConfig `locationName:"incrementalRunConfig" type:"structure"` - - // A list of InputSource objects, which have the fields InputSourceARN and SchemaName. - // - // InputSourceConfig is a required field - InputSourceConfig []*InputSource `locationName:"inputSourceConfig" min:"1" type:"list" required:"true"` - - // A list of OutputSource objects, each of which contains fields OutputS3Path, - // ApplyNormalization, and Output. - // - // OutputSourceConfig is a required field - OutputSourceConfig []*OutputSource `locationName:"outputSourceConfig" min:"1" type:"list" required:"true"` - - // An object which defines the resolutionType and the ruleBasedProperties - // - // ResolutionTechniques is a required field - ResolutionTechniques *ResolutionTechniques `locationName:"resolutionTechniques" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role. Entity Resolution assumes - // this role to create resources on your behalf as part of workflow execution. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The name of the workflow. - // - // WorkflowName is a required field - WorkflowName *string `locationName:"workflowName" min:"1" 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 UpdateMatchingWorkflowOutput) 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 UpdateMatchingWorkflowOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *UpdateMatchingWorkflowOutput) SetDescription(v string) *UpdateMatchingWorkflowOutput { - s.Description = &v - return s -} - -// SetIncrementalRunConfig sets the IncrementalRunConfig field's value. -func (s *UpdateMatchingWorkflowOutput) SetIncrementalRunConfig(v *IncrementalRunConfig) *UpdateMatchingWorkflowOutput { - s.IncrementalRunConfig = v - return s -} - -// SetInputSourceConfig sets the InputSourceConfig field's value. -func (s *UpdateMatchingWorkflowOutput) SetInputSourceConfig(v []*InputSource) *UpdateMatchingWorkflowOutput { - s.InputSourceConfig = v - return s -} - -// SetOutputSourceConfig sets the OutputSourceConfig field's value. -func (s *UpdateMatchingWorkflowOutput) SetOutputSourceConfig(v []*OutputSource) *UpdateMatchingWorkflowOutput { - s.OutputSourceConfig = v - return s -} - -// SetResolutionTechniques sets the ResolutionTechniques field's value. -func (s *UpdateMatchingWorkflowOutput) SetResolutionTechniques(v *ResolutionTechniques) *UpdateMatchingWorkflowOutput { - s.ResolutionTechniques = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateMatchingWorkflowOutput) SetRoleArn(v string) *UpdateMatchingWorkflowOutput { - s.RoleArn = &v - return s -} - -// SetWorkflowName sets the WorkflowName field's value. -func (s *UpdateMatchingWorkflowOutput) SetWorkflowName(v string) *UpdateMatchingWorkflowOutput { - s.WorkflowName = &v - return s -} - -type UpdateSchemaMappingInput struct { - _ struct{} `type:"structure"` - - // A description of the schema. - Description *string `locationName:"description" type:"string"` - - // A list of MappedInputFields. Each MappedInputField corresponds to a column - // the source data table, and contains column name plus additional information - // that Entity Resolution uses for matching. - // - // MappedInputFields is a required field - MappedInputFields []*SchemaInputAttribute `locationName:"mappedInputFields" min:"2" type:"list" required:"true"` - - // The name of the schema. There can't be multiple SchemaMappings with the same - // name. - // - // SchemaName is a required field - SchemaName *string `location:"uri" locationName:"schemaName" min:"1" 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 UpdateSchemaMappingInput) 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 UpdateSchemaMappingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSchemaMappingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSchemaMappingInput"} - if s.MappedInputFields == nil { - invalidParams.Add(request.NewErrParamRequired("MappedInputFields")) - } - if s.MappedInputFields != nil && len(s.MappedInputFields) < 2 { - invalidParams.Add(request.NewErrParamMinLen("MappedInputFields", 2)) - } - if s.SchemaName == nil { - invalidParams.Add(request.NewErrParamRequired("SchemaName")) - } - if s.SchemaName != nil && len(*s.SchemaName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SchemaName", 1)) - } - if s.MappedInputFields != nil { - for i, v := range s.MappedInputFields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MappedInputFields", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateSchemaMappingInput) SetDescription(v string) *UpdateSchemaMappingInput { - s.Description = &v - return s -} - -// SetMappedInputFields sets the MappedInputFields field's value. -func (s *UpdateSchemaMappingInput) SetMappedInputFields(v []*SchemaInputAttribute) *UpdateSchemaMappingInput { - s.MappedInputFields = v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *UpdateSchemaMappingInput) SetSchemaName(v string) *UpdateSchemaMappingInput { - s.SchemaName = &v - return s -} - -type UpdateSchemaMappingOutput struct { - _ struct{} `type:"structure"` - - // A description of the schema. - Description *string `locationName:"description" type:"string"` - - // A list of MappedInputFields. Each MappedInputField corresponds to a column - // the source data table, and contains column name plus additional information - // that Entity Resolution uses for matching. - // - // MappedInputFields is a required field - MappedInputFields []*SchemaInputAttribute `locationName:"mappedInputFields" min:"2" type:"list" required:"true"` - - // The ARN (Amazon Resource Name) that Entity Resolution generated for the SchemaMapping. - // - // SchemaArn is a required field - SchemaArn *string `locationName:"schemaArn" type:"string" required:"true"` - - // The name of the schema. - // - // SchemaName is a required field - SchemaName *string `locationName:"schemaName" min:"1" 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 UpdateSchemaMappingOutput) 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 UpdateSchemaMappingOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *UpdateSchemaMappingOutput) SetDescription(v string) *UpdateSchemaMappingOutput { - s.Description = &v - return s -} - -// SetMappedInputFields sets the MappedInputFields field's value. -func (s *UpdateSchemaMappingOutput) SetMappedInputFields(v []*SchemaInputAttribute) *UpdateSchemaMappingOutput { - s.MappedInputFields = v - return s -} - -// SetSchemaArn sets the SchemaArn field's value. -func (s *UpdateSchemaMappingOutput) SetSchemaArn(v string) *UpdateSchemaMappingOutput { - s.SchemaArn = &v - return s -} - -// SetSchemaName sets the SchemaName field's value. -func (s *UpdateSchemaMappingOutput) SetSchemaName(v string) *UpdateSchemaMappingOutput { - s.SchemaName = &v - return s -} - -// The input fails to satisfy the constraints specified by Entity Resolution. -// HTTP Status Code: 400 -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // AttributeMatchingModelOneToOne is a AttributeMatchingModel enum value - AttributeMatchingModelOneToOne = "ONE_TO_ONE" - - // AttributeMatchingModelManyToMany is a AttributeMatchingModel enum value - AttributeMatchingModelManyToMany = "MANY_TO_MANY" -) - -// AttributeMatchingModel_Values returns all elements of the AttributeMatchingModel enum -func AttributeMatchingModel_Values() []string { - return []string{ - AttributeMatchingModelOneToOne, - AttributeMatchingModelManyToMany, - } -} - -const ( - // IdMappingTypeProvider is a IdMappingType enum value - IdMappingTypeProvider = "PROVIDER" -) - -// IdMappingType_Values returns all elements of the IdMappingType enum -func IdMappingType_Values() []string { - return []string{ - IdMappingTypeProvider, - } -} - -const ( - // IncrementalRunTypeImmediate is a IncrementalRunType enum value - IncrementalRunTypeImmediate = "IMMEDIATE" -) - -// IncrementalRunType_Values returns all elements of the IncrementalRunType enum -func IncrementalRunType_Values() []string { - return []string{ - IncrementalRunTypeImmediate, - } -} - -const ( - // JobStatusRunning is a JobStatus enum value - JobStatusRunning = "RUNNING" - - // JobStatusSucceeded is a JobStatus enum value - JobStatusSucceeded = "SUCCEEDED" - - // JobStatusFailed is a JobStatus enum value - JobStatusFailed = "FAILED" - - // JobStatusQueued is a JobStatus enum value - JobStatusQueued = "QUEUED" -) - -// JobStatus_Values returns all elements of the JobStatus enum -func JobStatus_Values() []string { - return []string{ - JobStatusRunning, - JobStatusSucceeded, - JobStatusFailed, - JobStatusQueued, - } -} - -const ( - // ResolutionTypeRuleMatching is a ResolutionType enum value - ResolutionTypeRuleMatching = "RULE_MATCHING" - - // ResolutionTypeMlMatching is a ResolutionType enum value - ResolutionTypeMlMatching = "ML_MATCHING" - - // ResolutionTypeProvider is a ResolutionType enum value - ResolutionTypeProvider = "PROVIDER" -) - -// ResolutionType_Values returns all elements of the ResolutionType enum -func ResolutionType_Values() []string { - return []string{ - ResolutionTypeRuleMatching, - ResolutionTypeMlMatching, - ResolutionTypeProvider, - } -} - -const ( - // SchemaAttributeTypeName is a SchemaAttributeType enum value - SchemaAttributeTypeName = "NAME" - - // SchemaAttributeTypeNameFirst is a SchemaAttributeType enum value - SchemaAttributeTypeNameFirst = "NAME_FIRST" - - // SchemaAttributeTypeNameMiddle is a SchemaAttributeType enum value - SchemaAttributeTypeNameMiddle = "NAME_MIDDLE" - - // SchemaAttributeTypeNameLast is a SchemaAttributeType enum value - SchemaAttributeTypeNameLast = "NAME_LAST" - - // SchemaAttributeTypeAddress is a SchemaAttributeType enum value - SchemaAttributeTypeAddress = "ADDRESS" - - // SchemaAttributeTypeAddressStreet1 is a SchemaAttributeType enum value - SchemaAttributeTypeAddressStreet1 = "ADDRESS_STREET1" - - // SchemaAttributeTypeAddressStreet2 is a SchemaAttributeType enum value - SchemaAttributeTypeAddressStreet2 = "ADDRESS_STREET2" - - // SchemaAttributeTypeAddressStreet3 is a SchemaAttributeType enum value - SchemaAttributeTypeAddressStreet3 = "ADDRESS_STREET3" - - // SchemaAttributeTypeAddressCity is a SchemaAttributeType enum value - SchemaAttributeTypeAddressCity = "ADDRESS_CITY" - - // SchemaAttributeTypeAddressState is a SchemaAttributeType enum value - SchemaAttributeTypeAddressState = "ADDRESS_STATE" - - // SchemaAttributeTypeAddressCountry is a SchemaAttributeType enum value - SchemaAttributeTypeAddressCountry = "ADDRESS_COUNTRY" - - // SchemaAttributeTypeAddressPostalcode is a SchemaAttributeType enum value - SchemaAttributeTypeAddressPostalcode = "ADDRESS_POSTALCODE" - - // SchemaAttributeTypePhone is a SchemaAttributeType enum value - SchemaAttributeTypePhone = "PHONE" - - // SchemaAttributeTypePhoneNumber is a SchemaAttributeType enum value - SchemaAttributeTypePhoneNumber = "PHONE_NUMBER" - - // SchemaAttributeTypePhoneCountrycode is a SchemaAttributeType enum value - SchemaAttributeTypePhoneCountrycode = "PHONE_COUNTRYCODE" - - // SchemaAttributeTypeEmailAddress is a SchemaAttributeType enum value - SchemaAttributeTypeEmailAddress = "EMAIL_ADDRESS" - - // SchemaAttributeTypeUniqueId is a SchemaAttributeType enum value - SchemaAttributeTypeUniqueId = "UNIQUE_ID" - - // SchemaAttributeTypeDate is a SchemaAttributeType enum value - SchemaAttributeTypeDate = "DATE" - - // SchemaAttributeTypeString is a SchemaAttributeType enum value - SchemaAttributeTypeString = "STRING" - - // SchemaAttributeTypeProviderId is a SchemaAttributeType enum value - SchemaAttributeTypeProviderId = "PROVIDER_ID" -) - -// SchemaAttributeType_Values returns all elements of the SchemaAttributeType enum -func SchemaAttributeType_Values() []string { - return []string{ - SchemaAttributeTypeName, - SchemaAttributeTypeNameFirst, - SchemaAttributeTypeNameMiddle, - SchemaAttributeTypeNameLast, - SchemaAttributeTypeAddress, - SchemaAttributeTypeAddressStreet1, - SchemaAttributeTypeAddressStreet2, - SchemaAttributeTypeAddressStreet3, - SchemaAttributeTypeAddressCity, - SchemaAttributeTypeAddressState, - SchemaAttributeTypeAddressCountry, - SchemaAttributeTypeAddressPostalcode, - SchemaAttributeTypePhone, - SchemaAttributeTypePhoneNumber, - SchemaAttributeTypePhoneCountrycode, - SchemaAttributeTypeEmailAddress, - SchemaAttributeTypeUniqueId, - SchemaAttributeTypeDate, - SchemaAttributeTypeString, - SchemaAttributeTypeProviderId, - } -} - -const ( - // ServiceTypeAssignment is a ServiceType enum value - ServiceTypeAssignment = "ASSIGNMENT" - - // ServiceTypeIdMapping is a ServiceType enum value - ServiceTypeIdMapping = "ID_MAPPING" -) - -// ServiceType_Values returns all elements of the ServiceType enum -func ServiceType_Values() []string { - return []string{ - ServiceTypeAssignment, - ServiceTypeIdMapping, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/doc.go deleted file mode 100644 index 164933c3d288..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/doc.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package entityresolution provides the client and types for making API -// requests to AWS EntityResolution. -// -// Welcome to the Entity Resolution API Reference. -// -// Entity Resolution is an Amazon Web Services service that provides pre-configured -// entity resolution capabilities that enable developers and analysts at advertising -// and marketing companies to build an accurate and complete view of their consumers. -// -// With Entity Resolution, you can match source records containing consumer -// identifiers, such as name, email address, and phone number. This is true -// even when these records have incomplete or conflicting identifiers. For example, -// Entity Resolution can effectively match a source record from a customer relationship -// management (CRM) system with a source record from a marketing system containing -// campaign information. -// -// To learn more about Entity Resolution concepts, procedures, and best practices, -// see the Entity Resolution User Guide (https://docs.aws.amazon.com/entityresolution/latest/userguide/what-is-service.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10 for more information on this service. -// -// See entityresolution package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/entityresolution/ -// -// # Using the Client -// -// To contact AWS EntityResolution with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS EntityResolution client EntityResolution for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/entityresolution/#New -package entityresolution diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/entityresolutioniface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/entityresolutioniface/interface.go deleted file mode 100644 index 6bc16f135ee2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/entityresolutioniface/interface.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package entityresolutioniface provides an interface to enable mocking the AWS EntityResolution service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package entityresolutioniface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution" -) - -// EntityResolutionAPI provides an interface to enable mocking the -// entityresolution.EntityResolution service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS EntityResolution. -// func myFunc(svc entityresolutioniface.EntityResolutionAPI) bool { -// // Make svc.CreateIdMappingWorkflow request -// } -// -// func main() { -// sess := session.New() -// svc := entityresolution.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockEntityResolutionClient struct { -// entityresolutioniface.EntityResolutionAPI -// } -// func (m *mockEntityResolutionClient) CreateIdMappingWorkflow(input *entityresolution.CreateIdMappingWorkflowInput) (*entityresolution.CreateIdMappingWorkflowOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockEntityResolutionClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type EntityResolutionAPI interface { - CreateIdMappingWorkflow(*entityresolution.CreateIdMappingWorkflowInput) (*entityresolution.CreateIdMappingWorkflowOutput, error) - CreateIdMappingWorkflowWithContext(aws.Context, *entityresolution.CreateIdMappingWorkflowInput, ...request.Option) (*entityresolution.CreateIdMappingWorkflowOutput, error) - CreateIdMappingWorkflowRequest(*entityresolution.CreateIdMappingWorkflowInput) (*request.Request, *entityresolution.CreateIdMappingWorkflowOutput) - - CreateMatchingWorkflow(*entityresolution.CreateMatchingWorkflowInput) (*entityresolution.CreateMatchingWorkflowOutput, error) - CreateMatchingWorkflowWithContext(aws.Context, *entityresolution.CreateMatchingWorkflowInput, ...request.Option) (*entityresolution.CreateMatchingWorkflowOutput, error) - CreateMatchingWorkflowRequest(*entityresolution.CreateMatchingWorkflowInput) (*request.Request, *entityresolution.CreateMatchingWorkflowOutput) - - CreateSchemaMapping(*entityresolution.CreateSchemaMappingInput) (*entityresolution.CreateSchemaMappingOutput, error) - CreateSchemaMappingWithContext(aws.Context, *entityresolution.CreateSchemaMappingInput, ...request.Option) (*entityresolution.CreateSchemaMappingOutput, error) - CreateSchemaMappingRequest(*entityresolution.CreateSchemaMappingInput) (*request.Request, *entityresolution.CreateSchemaMappingOutput) - - DeleteIdMappingWorkflow(*entityresolution.DeleteIdMappingWorkflowInput) (*entityresolution.DeleteIdMappingWorkflowOutput, error) - DeleteIdMappingWorkflowWithContext(aws.Context, *entityresolution.DeleteIdMappingWorkflowInput, ...request.Option) (*entityresolution.DeleteIdMappingWorkflowOutput, error) - DeleteIdMappingWorkflowRequest(*entityresolution.DeleteIdMappingWorkflowInput) (*request.Request, *entityresolution.DeleteIdMappingWorkflowOutput) - - DeleteMatchingWorkflow(*entityresolution.DeleteMatchingWorkflowInput) (*entityresolution.DeleteMatchingWorkflowOutput, error) - DeleteMatchingWorkflowWithContext(aws.Context, *entityresolution.DeleteMatchingWorkflowInput, ...request.Option) (*entityresolution.DeleteMatchingWorkflowOutput, error) - DeleteMatchingWorkflowRequest(*entityresolution.DeleteMatchingWorkflowInput) (*request.Request, *entityresolution.DeleteMatchingWorkflowOutput) - - DeleteSchemaMapping(*entityresolution.DeleteSchemaMappingInput) (*entityresolution.DeleteSchemaMappingOutput, error) - DeleteSchemaMappingWithContext(aws.Context, *entityresolution.DeleteSchemaMappingInput, ...request.Option) (*entityresolution.DeleteSchemaMappingOutput, error) - DeleteSchemaMappingRequest(*entityresolution.DeleteSchemaMappingInput) (*request.Request, *entityresolution.DeleteSchemaMappingOutput) - - GetIdMappingJob(*entityresolution.GetIdMappingJobInput) (*entityresolution.GetIdMappingJobOutput, error) - GetIdMappingJobWithContext(aws.Context, *entityresolution.GetIdMappingJobInput, ...request.Option) (*entityresolution.GetIdMappingJobOutput, error) - GetIdMappingJobRequest(*entityresolution.GetIdMappingJobInput) (*request.Request, *entityresolution.GetIdMappingJobOutput) - - GetIdMappingWorkflow(*entityresolution.GetIdMappingWorkflowInput) (*entityresolution.GetIdMappingWorkflowOutput, error) - GetIdMappingWorkflowWithContext(aws.Context, *entityresolution.GetIdMappingWorkflowInput, ...request.Option) (*entityresolution.GetIdMappingWorkflowOutput, error) - GetIdMappingWorkflowRequest(*entityresolution.GetIdMappingWorkflowInput) (*request.Request, *entityresolution.GetIdMappingWorkflowOutput) - - GetMatchId(*entityresolution.GetMatchIdInput) (*entityresolution.GetMatchIdOutput, error) - GetMatchIdWithContext(aws.Context, *entityresolution.GetMatchIdInput, ...request.Option) (*entityresolution.GetMatchIdOutput, error) - GetMatchIdRequest(*entityresolution.GetMatchIdInput) (*request.Request, *entityresolution.GetMatchIdOutput) - - GetMatchingJob(*entityresolution.GetMatchingJobInput) (*entityresolution.GetMatchingJobOutput, error) - GetMatchingJobWithContext(aws.Context, *entityresolution.GetMatchingJobInput, ...request.Option) (*entityresolution.GetMatchingJobOutput, error) - GetMatchingJobRequest(*entityresolution.GetMatchingJobInput) (*request.Request, *entityresolution.GetMatchingJobOutput) - - GetMatchingWorkflow(*entityresolution.GetMatchingWorkflowInput) (*entityresolution.GetMatchingWorkflowOutput, error) - GetMatchingWorkflowWithContext(aws.Context, *entityresolution.GetMatchingWorkflowInput, ...request.Option) (*entityresolution.GetMatchingWorkflowOutput, error) - GetMatchingWorkflowRequest(*entityresolution.GetMatchingWorkflowInput) (*request.Request, *entityresolution.GetMatchingWorkflowOutput) - - GetSchemaMapping(*entityresolution.GetSchemaMappingInput) (*entityresolution.GetSchemaMappingOutput, error) - GetSchemaMappingWithContext(aws.Context, *entityresolution.GetSchemaMappingInput, ...request.Option) (*entityresolution.GetSchemaMappingOutput, error) - GetSchemaMappingRequest(*entityresolution.GetSchemaMappingInput) (*request.Request, *entityresolution.GetSchemaMappingOutput) - - ListIdMappingJobs(*entityresolution.ListIdMappingJobsInput) (*entityresolution.ListIdMappingJobsOutput, error) - ListIdMappingJobsWithContext(aws.Context, *entityresolution.ListIdMappingJobsInput, ...request.Option) (*entityresolution.ListIdMappingJobsOutput, error) - ListIdMappingJobsRequest(*entityresolution.ListIdMappingJobsInput) (*request.Request, *entityresolution.ListIdMappingJobsOutput) - - ListIdMappingJobsPages(*entityresolution.ListIdMappingJobsInput, func(*entityresolution.ListIdMappingJobsOutput, bool) bool) error - ListIdMappingJobsPagesWithContext(aws.Context, *entityresolution.ListIdMappingJobsInput, func(*entityresolution.ListIdMappingJobsOutput, bool) bool, ...request.Option) error - - ListIdMappingWorkflows(*entityresolution.ListIdMappingWorkflowsInput) (*entityresolution.ListIdMappingWorkflowsOutput, error) - ListIdMappingWorkflowsWithContext(aws.Context, *entityresolution.ListIdMappingWorkflowsInput, ...request.Option) (*entityresolution.ListIdMappingWorkflowsOutput, error) - ListIdMappingWorkflowsRequest(*entityresolution.ListIdMappingWorkflowsInput) (*request.Request, *entityresolution.ListIdMappingWorkflowsOutput) - - ListIdMappingWorkflowsPages(*entityresolution.ListIdMappingWorkflowsInput, func(*entityresolution.ListIdMappingWorkflowsOutput, bool) bool) error - ListIdMappingWorkflowsPagesWithContext(aws.Context, *entityresolution.ListIdMappingWorkflowsInput, func(*entityresolution.ListIdMappingWorkflowsOutput, bool) bool, ...request.Option) error - - ListMatchingJobs(*entityresolution.ListMatchingJobsInput) (*entityresolution.ListMatchingJobsOutput, error) - ListMatchingJobsWithContext(aws.Context, *entityresolution.ListMatchingJobsInput, ...request.Option) (*entityresolution.ListMatchingJobsOutput, error) - ListMatchingJobsRequest(*entityresolution.ListMatchingJobsInput) (*request.Request, *entityresolution.ListMatchingJobsOutput) - - ListMatchingJobsPages(*entityresolution.ListMatchingJobsInput, func(*entityresolution.ListMatchingJobsOutput, bool) bool) error - ListMatchingJobsPagesWithContext(aws.Context, *entityresolution.ListMatchingJobsInput, func(*entityresolution.ListMatchingJobsOutput, bool) bool, ...request.Option) error - - ListMatchingWorkflows(*entityresolution.ListMatchingWorkflowsInput) (*entityresolution.ListMatchingWorkflowsOutput, error) - ListMatchingWorkflowsWithContext(aws.Context, *entityresolution.ListMatchingWorkflowsInput, ...request.Option) (*entityresolution.ListMatchingWorkflowsOutput, error) - ListMatchingWorkflowsRequest(*entityresolution.ListMatchingWorkflowsInput) (*request.Request, *entityresolution.ListMatchingWorkflowsOutput) - - ListMatchingWorkflowsPages(*entityresolution.ListMatchingWorkflowsInput, func(*entityresolution.ListMatchingWorkflowsOutput, bool) bool) error - ListMatchingWorkflowsPagesWithContext(aws.Context, *entityresolution.ListMatchingWorkflowsInput, func(*entityresolution.ListMatchingWorkflowsOutput, bool) bool, ...request.Option) error - - ListProviderServices(*entityresolution.ListProviderServicesInput) (*entityresolution.ListProviderServicesOutput, error) - ListProviderServicesWithContext(aws.Context, *entityresolution.ListProviderServicesInput, ...request.Option) (*entityresolution.ListProviderServicesOutput, error) - ListProviderServicesRequest(*entityresolution.ListProviderServicesInput) (*request.Request, *entityresolution.ListProviderServicesOutput) - - ListProviderServicesPages(*entityresolution.ListProviderServicesInput, func(*entityresolution.ListProviderServicesOutput, bool) bool) error - ListProviderServicesPagesWithContext(aws.Context, *entityresolution.ListProviderServicesInput, func(*entityresolution.ListProviderServicesOutput, bool) bool, ...request.Option) error - - ListSchemaMappings(*entityresolution.ListSchemaMappingsInput) (*entityresolution.ListSchemaMappingsOutput, error) - ListSchemaMappingsWithContext(aws.Context, *entityresolution.ListSchemaMappingsInput, ...request.Option) (*entityresolution.ListSchemaMappingsOutput, error) - ListSchemaMappingsRequest(*entityresolution.ListSchemaMappingsInput) (*request.Request, *entityresolution.ListSchemaMappingsOutput) - - ListSchemaMappingsPages(*entityresolution.ListSchemaMappingsInput, func(*entityresolution.ListSchemaMappingsOutput, bool) bool) error - ListSchemaMappingsPagesWithContext(aws.Context, *entityresolution.ListSchemaMappingsInput, func(*entityresolution.ListSchemaMappingsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*entityresolution.ListTagsForResourceInput) (*entityresolution.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *entityresolution.ListTagsForResourceInput, ...request.Option) (*entityresolution.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*entityresolution.ListTagsForResourceInput) (*request.Request, *entityresolution.ListTagsForResourceOutput) - - StartIdMappingJob(*entityresolution.StartIdMappingJobInput) (*entityresolution.StartIdMappingJobOutput, error) - StartIdMappingJobWithContext(aws.Context, *entityresolution.StartIdMappingJobInput, ...request.Option) (*entityresolution.StartIdMappingJobOutput, error) - StartIdMappingJobRequest(*entityresolution.StartIdMappingJobInput) (*request.Request, *entityresolution.StartIdMappingJobOutput) - - StartMatchingJob(*entityresolution.StartMatchingJobInput) (*entityresolution.StartMatchingJobOutput, error) - StartMatchingJobWithContext(aws.Context, *entityresolution.StartMatchingJobInput, ...request.Option) (*entityresolution.StartMatchingJobOutput, error) - StartMatchingJobRequest(*entityresolution.StartMatchingJobInput) (*request.Request, *entityresolution.StartMatchingJobOutput) - - TagResource(*entityresolution.TagResourceInput) (*entityresolution.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *entityresolution.TagResourceInput, ...request.Option) (*entityresolution.TagResourceOutput, error) - TagResourceRequest(*entityresolution.TagResourceInput) (*request.Request, *entityresolution.TagResourceOutput) - - UntagResource(*entityresolution.UntagResourceInput) (*entityresolution.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *entityresolution.UntagResourceInput, ...request.Option) (*entityresolution.UntagResourceOutput, error) - UntagResourceRequest(*entityresolution.UntagResourceInput) (*request.Request, *entityresolution.UntagResourceOutput) - - UpdateIdMappingWorkflow(*entityresolution.UpdateIdMappingWorkflowInput) (*entityresolution.UpdateIdMappingWorkflowOutput, error) - UpdateIdMappingWorkflowWithContext(aws.Context, *entityresolution.UpdateIdMappingWorkflowInput, ...request.Option) (*entityresolution.UpdateIdMappingWorkflowOutput, error) - UpdateIdMappingWorkflowRequest(*entityresolution.UpdateIdMappingWorkflowInput) (*request.Request, *entityresolution.UpdateIdMappingWorkflowOutput) - - UpdateMatchingWorkflow(*entityresolution.UpdateMatchingWorkflowInput) (*entityresolution.UpdateMatchingWorkflowOutput, error) - UpdateMatchingWorkflowWithContext(aws.Context, *entityresolution.UpdateMatchingWorkflowInput, ...request.Option) (*entityresolution.UpdateMatchingWorkflowOutput, error) - UpdateMatchingWorkflowRequest(*entityresolution.UpdateMatchingWorkflowInput) (*request.Request, *entityresolution.UpdateMatchingWorkflowOutput) - - UpdateSchemaMapping(*entityresolution.UpdateSchemaMappingInput) (*entityresolution.UpdateSchemaMappingOutput, error) - UpdateSchemaMappingWithContext(aws.Context, *entityresolution.UpdateSchemaMappingInput, ...request.Option) (*entityresolution.UpdateSchemaMappingOutput, error) - UpdateSchemaMappingRequest(*entityresolution.UpdateSchemaMappingInput) (*request.Request, *entityresolution.UpdateSchemaMappingOutput) -} - -var _ EntityResolutionAPI = (*entityresolution.EntityResolution)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/errors.go deleted file mode 100644 index ef166f0cb6bc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/errors.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package entityresolution - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. HTTP Status Code: - // 403 - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request could not be processed because of conflict in the current state - // of the resource. Example: Workflow already exists, Schema already exists, - // Workflow is currently running, etc. HTTP Status Code: 400 - ErrCodeConflictException = "ConflictException" - - // ErrCodeExceedsLimitException for service response error code - // "ExceedsLimitException". - // - // The request was rejected because it attempted to create resources beyond - // the current Entity Resolution account limits. The error message describes - // the limit exceeded. HTTP Status Code: 402 - ErrCodeExceedsLimitException = "ExceedsLimitException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // This exception occurs when there is an internal failure in the Entity Resolution - // service. HTTP Status Code: 500 - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource could not be found. HTTP Status Code: 404 - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. HTTP Status Code: 429 - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by Entity Resolution. - // HTTP Status Code: 400 - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "ExceedsLimitException": newErrorExceedsLimitException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/service.go deleted file mode 100644 index 7b6d91566720..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/entityresolution/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package entityresolution - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// EntityResolution provides the API operation methods for making requests to -// AWS EntityResolution. See this package's package overview docs -// for details on the service. -// -// EntityResolution methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type EntityResolution struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "EntityResolution" // Name of service. - EndpointsID = "entityresolution" // ID to lookup a service endpoint with. - ServiceID = "EntityResolution" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the EntityResolution client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a EntityResolution client from just a session. -// svc := entityresolution.New(mySession) -// -// // Create a EntityResolution client with additional configuration -// svc := entityresolution.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *EntityResolution { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "entityresolution" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *EntityResolution { - svc := &EntityResolution{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a EntityResolution operation and runs any -// custom request initialization. -func (c *EntityResolution) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/api.go deleted file mode 100644 index 08dbec534f96..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/api.go +++ /dev/null @@ -1,852 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package freetier - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opGetFreeTierUsage = "GetFreeTierUsage" - -// GetFreeTierUsageRequest generates a "aws/request.Request" representing the -// client's request for the GetFreeTierUsage 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 GetFreeTierUsage for more information on using the GetFreeTierUsage -// 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 GetFreeTierUsageRequest method. -// req, resp := client.GetFreeTierUsageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/freetier-2023-09-07/GetFreeTierUsage -func (c *FreeTier) GetFreeTierUsageRequest(input *GetFreeTierUsageInput) (req *request.Request, output *GetFreeTierUsageOutput) { - op := &request.Operation{ - Name: opGetFreeTierUsage, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetFreeTierUsageInput{} - } - - output = &GetFreeTierUsageOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetFreeTierUsage API operation for AWS Free Tier. -// -// Returns a list of all Free Tier usage objects that match your filters. -// -// 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 AWS Free Tier's -// API operation GetFreeTierUsage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred during the processing of your request. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/freetier-2023-09-07/GetFreeTierUsage -func (c *FreeTier) GetFreeTierUsage(input *GetFreeTierUsageInput) (*GetFreeTierUsageOutput, error) { - req, out := c.GetFreeTierUsageRequest(input) - return out, req.Send() -} - -// GetFreeTierUsageWithContext is the same as GetFreeTierUsage with the addition of -// the ability to pass a context and additional request options. -// -// See GetFreeTierUsage 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 *FreeTier) GetFreeTierUsageWithContext(ctx aws.Context, input *GetFreeTierUsageInput, opts ...request.Option) (*GetFreeTierUsageOutput, error) { - req, out := c.GetFreeTierUsageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetFreeTierUsagePages iterates over the pages of a GetFreeTierUsage operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetFreeTierUsage method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetFreeTierUsage operation. -// pageNum := 0 -// err := client.GetFreeTierUsagePages(params, -// func(page *freetier.GetFreeTierUsageOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *FreeTier) GetFreeTierUsagePages(input *GetFreeTierUsageInput, fn func(*GetFreeTierUsageOutput, bool) bool) error { - return c.GetFreeTierUsagePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetFreeTierUsagePagesWithContext same as GetFreeTierUsagePages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *FreeTier) GetFreeTierUsagePagesWithContext(ctx aws.Context, input *GetFreeTierUsageInput, fn func(*GetFreeTierUsageOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetFreeTierUsageInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetFreeTierUsageRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetFreeTierUsageOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -// Contains the specifications for the filters to use for your request. -type DimensionValues struct { - _ struct{} `type:"structure"` - - // The name of the dimension that you want to filter on. - // - // Key is a required field - Key *string `type:"string" required:"true" enum:"Dimension"` - - // The match options that you can use to filter your results. You can specify - // only one of these values in the array. - // - // MatchOptions is a required field - MatchOptions []*string `type:"list" required:"true" enum:"MatchOption"` - - // The metadata values you can specify to filter upon, so that the results all - // match at least one of the specified values. - // - // Values is a required field - Values []*string `min:"1" type:"list" 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 DimensionValues) 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 DimensionValues) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DimensionValues) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DimensionValues"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.MatchOptions == nil { - invalidParams.Add(request.NewErrParamRequired("MatchOptions")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *DimensionValues) SetKey(v string) *DimensionValues { - s.Key = &v - return s -} - -// SetMatchOptions sets the MatchOptions field's value. -func (s *DimensionValues) SetMatchOptions(v []*string) *DimensionValues { - s.MatchOptions = v - return s -} - -// SetValues sets the Values field's value. -func (s *DimensionValues) SetValues(v []*string) *DimensionValues { - s.Values = v - return s -} - -// Use Expression to filter in the GetFreeTierUsage API operation. -// -// You can use the following patterns: -// -// - Simple dimension values (Dimensions root operator) -// -// - Complex expressions with logical operators (AND, NOT, and OR root operators). -// -// For simple dimension values, you can set the dimension name, values, and -// match type for the filters that you plan to use. -// -// # Example for simple dimension values -// -// You can filter to match exactly for REGION==us-east-1 OR REGION==us-west-1. -// -// The corresponding Expression appears like the following: { "Dimensions": -// { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ], "MatchOptions": -// ["EQUALS"] } } -// -// As shown in the previous example, lists of dimension values are combined -// with OR when you apply the filter. -// -// For complex expressions with logical operators, you can have nested expressions -// to use the logical operators and specify advanced filtering. -// -// # Example for complex expressions with logical operators -// -// You can filter by ((REGION == us-east-1 OR REGION == us-west-1) OR (SERVICE -// CONTAINS AWSLambda)) AND (USAGE_TYPE !CONTAINS DataTransfer). -// -// The corresponding Expression appears like the following: { "And": [ {"Or": -// [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" -// ], "MatchOptions": ["EQUALS"] }}, {"Dimensions": { "Key": "SERVICE", "Values": -// ["AWSLambda"], "MatchOptions": ["CONTAINS"] } } ]}, {"Not": {"Dimensions": -// { "Key": "USAGE_TYPE", "Values": ["DataTransfer"], "MatchOptions": ["CONTAINS"] -// }}} ] } -// -// In the following Contents, you must specify exactly one of the following -// root operators. -type Expression struct { - _ struct{} `type:"structure"` - - // Return results that match all Expressions that you specified in the array. - And []*Expression `type:"list"` - - // The specific dimension, values, and match type to filter objects with. - Dimensions *DimensionValues `type:"structure"` - - // Return results that don’t match the Expression that you specified. - Not *Expression `type:"structure"` - - // Return results that match any of the Expressions that you specified. in the - // array. - Or []*Expression `type:"list"` -} - -// 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 Expression) 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 Expression) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Expression) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Expression"} - if s.Dimensions != nil { - if err := s.Dimensions.Validate(); err != nil { - invalidParams.AddNested("Dimensions", err.(request.ErrInvalidParams)) - } - } - if s.Not != nil { - if err := s.Not.Validate(); err != nil { - invalidParams.AddNested("Not", err.(request.ErrInvalidParams)) - } - } - if s.Or != nil { - for i, v := range s.Or { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Or", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *Expression) SetAnd(v []*Expression) *Expression { - s.And = v - return s -} - -// SetDimensions sets the Dimensions field's value. -func (s *Expression) SetDimensions(v *DimensionValues) *Expression { - s.Dimensions = v - return s -} - -// SetNot sets the Not field's value. -func (s *Expression) SetNot(v *Expression) *Expression { - s.Not = v - return s -} - -// SetOr sets the Or field's value. -func (s *Expression) SetOr(v []*Expression) *Expression { - s.Or = v - return s -} - -// Consists of a Amazon Web Services Free Tier offer’s metadata and your data -// usage for the offer. -type FreeTierUsage struct { - _ struct{} `type:"structure"` - - // Describes the actual usage accrued month-to-day (MTD) that you've used so - // far. - ActualUsageAmount *float64 `locationName:"actualUsageAmount" type:"double"` - - // The description of the Free Tier offer. - Description *string `locationName:"description" type:"string"` - - // Describes the forecasted usage by the month that you're expected to use. - ForecastedUsageAmount *float64 `locationName:"forecastedUsageAmount" type:"double"` - - // Describes the type of the Free Tier offer. For example, the offer can be - // "12 Months Free", "Always Free", and "Free Trial". - FreeTierType *string `locationName:"freeTierType" type:"string"` - - // Describes the maximum usage allowed in Free Tier. - Limit *float64 `locationName:"limit" type:"double"` - - // Describes usageType more granularly with the specific Amazon Web Service - // API operation. For example, this can be the RunInstances API operation for - // Amazon Elastic Compute Cloud. - Operation *string `locationName:"operation" type:"string"` - - // Describes the Amazon Web Services Region for which this offer is applicable - Region *string `locationName:"region" type:"string"` - - // The name of the Amazon Web Service providing the Free Tier offer. For example, - // this can be Amazon Elastic Compute Cloud. - Service *string `locationName:"service" type:"string"` - - // Describes the unit of the usageType, such as Hrs. - Unit *string `locationName:"unit" type:"string"` - - // Describes the usage details of the offer. For example, this might be Global-BoxUsage:freetrial. - UsageType *string `locationName:"usageType" 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 FreeTierUsage) 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 FreeTierUsage) GoString() string { - return s.String() -} - -// SetActualUsageAmount sets the ActualUsageAmount field's value. -func (s *FreeTierUsage) SetActualUsageAmount(v float64) *FreeTierUsage { - s.ActualUsageAmount = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *FreeTierUsage) SetDescription(v string) *FreeTierUsage { - s.Description = &v - return s -} - -// SetForecastedUsageAmount sets the ForecastedUsageAmount field's value. -func (s *FreeTierUsage) SetForecastedUsageAmount(v float64) *FreeTierUsage { - s.ForecastedUsageAmount = &v - return s -} - -// SetFreeTierType sets the FreeTierType field's value. -func (s *FreeTierUsage) SetFreeTierType(v string) *FreeTierUsage { - s.FreeTierType = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *FreeTierUsage) SetLimit(v float64) *FreeTierUsage { - s.Limit = &v - return s -} - -// SetOperation sets the Operation field's value. -func (s *FreeTierUsage) SetOperation(v string) *FreeTierUsage { - s.Operation = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *FreeTierUsage) SetRegion(v string) *FreeTierUsage { - s.Region = &v - return s -} - -// SetService sets the Service field's value. -func (s *FreeTierUsage) SetService(v string) *FreeTierUsage { - s.Service = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *FreeTierUsage) SetUnit(v string) *FreeTierUsage { - s.Unit = &v - return s -} - -// SetUsageType sets the UsageType field's value. -func (s *FreeTierUsage) SetUsageType(v string) *FreeTierUsage { - s.UsageType = &v - return s -} - -type GetFreeTierUsageInput struct { - _ struct{} `type:"structure"` - - // An expression that specifies the conditions that you want each FreeTierUsage - // object to meet. - Filter *Expression `locationName:"filter" type:"structure"` - - // The maximum number of results to return in the response. MaxResults means - // that there can be up to the specified number of values, but there might be - // fewer results based on your filters. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" min:"1" 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 GetFreeTierUsageInput) 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 GetFreeTierUsageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFreeTierUsageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFreeTierUsageInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *GetFreeTierUsageInput) SetFilter(v *Expression) *GetFreeTierUsageInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetFreeTierUsageInput) SetMaxResults(v int64) *GetFreeTierUsageInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetFreeTierUsageInput) SetNextToken(v string) *GetFreeTierUsageInput { - s.NextToken = &v - return s -} - -type GetFreeTierUsageOutput struct { - _ struct{} `type:"structure"` - - // The list of Free Tier usage objects that meet your filter expression. - // - // FreeTierUsages is a required field - FreeTierUsages []*FreeTierUsage `locationName:"freeTierUsages" type:"list" required:"true"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" min:"1" 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 GetFreeTierUsageOutput) 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 GetFreeTierUsageOutput) GoString() string { - return s.String() -} - -// SetFreeTierUsages sets the FreeTierUsages field's value. -func (s *GetFreeTierUsageOutput) SetFreeTierUsages(v []*FreeTierUsage) *GetFreeTierUsageOutput { - s.FreeTierUsages = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetFreeTierUsageOutput) SetNextToken(v string) *GetFreeTierUsageOutput { - s.NextToken = &v - return s -} - -// An unexpected error occurred during the processing of your request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input fails to satisfy the constraints specified by an Amazon Web Service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // DimensionService is a Dimension enum value - DimensionService = "SERVICE" - - // DimensionOperation is a Dimension enum value - DimensionOperation = "OPERATION" - - // DimensionUsageType is a Dimension enum value - DimensionUsageType = "USAGE_TYPE" - - // DimensionRegion is a Dimension enum value - DimensionRegion = "REGION" - - // DimensionFreeTierType is a Dimension enum value - DimensionFreeTierType = "FREE_TIER_TYPE" - - // DimensionDescription is a Dimension enum value - DimensionDescription = "DESCRIPTION" - - // DimensionUsagePercentage is a Dimension enum value - DimensionUsagePercentage = "USAGE_PERCENTAGE" -) - -// Dimension_Values returns all elements of the Dimension enum -func Dimension_Values() []string { - return []string{ - DimensionService, - DimensionOperation, - DimensionUsageType, - DimensionRegion, - DimensionFreeTierType, - DimensionDescription, - DimensionUsagePercentage, - } -} - -const ( - // MatchOptionEquals is a MatchOption enum value - MatchOptionEquals = "EQUALS" - - // MatchOptionStartsWith is a MatchOption enum value - MatchOptionStartsWith = "STARTS_WITH" - - // MatchOptionEndsWith is a MatchOption enum value - MatchOptionEndsWith = "ENDS_WITH" - - // MatchOptionContains is a MatchOption enum value - MatchOptionContains = "CONTAINS" - - // MatchOptionGreaterThanOrEqual is a MatchOption enum value - MatchOptionGreaterThanOrEqual = "GREATER_THAN_OR_EQUAL" -) - -// MatchOption_Values returns all elements of the MatchOption enum -func MatchOption_Values() []string { - return []string{ - MatchOptionEquals, - MatchOptionStartsWith, - MatchOptionEndsWith, - MatchOptionContains, - MatchOptionGreaterThanOrEqual, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/doc.go deleted file mode 100644 index 9d21989bee54..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/doc.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package freetier provides the client and types for making API -// requests to AWS Free Tier. -// -// You can use the Amazon Web Services Free Tier API to query programmatically -// your Free Tier usage data. -// -// Free Tier tracks your monthly usage data for all free tier offers that are -// associated with your Amazon Web Services account. You can use the Free Tier -// API to filter and show only the data that you want. -// -// # Service endpoint -// -// The Free Tier API provides the following endpoint: -// -// - https://freetier.us-east-1.api.aws -// -// For more information, see Using the Amazon Web Services Free Tier (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-free-tier.html) -// in the Billing User Guide. -// -// See https://docs.aws.amazon.com/goto/WebAPI/freetier-2023-09-07 for more information on this service. -// -// See freetier package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/freetier/ -// -// # Using the Client -// -// To contact AWS Free Tier with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Free Tier client FreeTier for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/freetier/#New -package freetier diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/errors.go deleted file mode 100644 index 4da2d1b763a2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/errors.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package freetier - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An unexpected error occurred during the processing of your request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an Amazon Web Service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "InternalServerException": newErrorInternalServerException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/freetieriface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/freetieriface/interface.go deleted file mode 100644 index 17d7da9c85d8..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/freetieriface/interface.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package freetieriface provides an interface to enable mocking the AWS Free Tier service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package freetieriface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier" -) - -// FreeTierAPI provides an interface to enable mocking the -// freetier.FreeTier service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Free Tier. -// func myFunc(svc freetieriface.FreeTierAPI) bool { -// // Make svc.GetFreeTierUsage request -// } -// -// func main() { -// sess := session.New() -// svc := freetier.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockFreeTierClient struct { -// freetieriface.FreeTierAPI -// } -// func (m *mockFreeTierClient) GetFreeTierUsage(input *freetier.GetFreeTierUsageInput) (*freetier.GetFreeTierUsageOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockFreeTierClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type FreeTierAPI interface { - GetFreeTierUsage(*freetier.GetFreeTierUsageInput) (*freetier.GetFreeTierUsageOutput, error) - GetFreeTierUsageWithContext(aws.Context, *freetier.GetFreeTierUsageInput, ...request.Option) (*freetier.GetFreeTierUsageOutput, error) - GetFreeTierUsageRequest(*freetier.GetFreeTierUsageInput) (*request.Request, *freetier.GetFreeTierUsageOutput) - - GetFreeTierUsagePages(*freetier.GetFreeTierUsageInput, func(*freetier.GetFreeTierUsageOutput, bool) bool) error - GetFreeTierUsagePagesWithContext(aws.Context, *freetier.GetFreeTierUsageInput, func(*freetier.GetFreeTierUsageOutput, bool) bool, ...request.Option) error -} - -var _ FreeTierAPI = (*freetier.FreeTier)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/service.go deleted file mode 100644 index 834c7b67be86..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/freetier/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package freetier - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// FreeTier provides the API operation methods for making requests to -// AWS Free Tier. See this package's package overview docs -// for details on the service. -// -// FreeTier methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type FreeTier struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "FreeTier" // Name of service. - EndpointsID = "freetier" // ID to lookup a service endpoint with. - ServiceID = "FreeTier" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the FreeTier client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a FreeTier client from just a session. -// svc := freetier.New(mySession) -// -// // Create a FreeTier client with additional configuration -// svc := freetier.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *FreeTier { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "freetier" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *FreeTier { - svc := &FreeTier{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-09-07", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.0", - TargetPrefix: "AWSFreeTierService", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a FreeTier operation and runs any -// custom request initialization. -func (c *FreeTier) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/groundstation/waiters.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/groundstation/waiters.go deleted file mode 100644 index 383f174f501b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/groundstation/waiters.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package groundstation - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" -) - -// WaitUntilContactScheduled uses the AWS Ground Station API operation -// DescribeContact to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *GroundStation) WaitUntilContactScheduled(input *DescribeContactInput) error { - return c.WaitUntilContactScheduledWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilContactScheduledWithContext is an extended version of WaitUntilContactScheduled. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *GroundStation) WaitUntilContactScheduledWithContext(ctx aws.Context, input *DescribeContactInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilContactScheduled", - MaxAttempts: 180, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "contactStatus", - Expected: "FAILED_TO_SCHEDULE", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "contactStatus", - Expected: "SCHEDULED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *DescribeContactInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeContactRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/api.go deleted file mode 100644 index 78dd123e2c68..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/api.go +++ /dev/null @@ -1,5563 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package internetmonitor - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateMonitor = "CreateMonitor" - -// CreateMonitorRequest generates a "aws/request.Request" representing the -// client's request for the CreateMonitor 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 CreateMonitor for more information on using the CreateMonitor -// 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 CreateMonitorRequest method. -// req, resp := client.CreateMonitorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/CreateMonitor -func (c *InternetMonitor) CreateMonitorRequest(input *CreateMonitorInput) (req *request.Request, output *CreateMonitorOutput) { - op := &request.Operation{ - Name: opCreateMonitor, - HTTPMethod: "POST", - HTTPPath: "/v20210603/Monitors", - } - - if input == nil { - input = &CreateMonitorInput{} - } - - output = &CreateMonitorOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateMonitor API operation for Amazon CloudWatch Internet Monitor. -// -// Creates a monitor in Amazon CloudWatch Internet Monitor. A monitor is built -// based on information from the application resources that you add: VPCs, Network -// Load Balancers (NLBs), Amazon CloudFront distributions, and Amazon WorkSpaces -// directories. Internet Monitor then publishes internet measurements from Amazon -// Web Services that are specific to the city-networks. That is, the locations -// and ASNs (typically internet service providers or ISPs), where clients access -// your application. For more information, see Using Amazon CloudWatch Internet -// Monitor (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-InternetMonitor.html) -// in the Amazon CloudWatch User Guide. -// -// When you create a monitor, you choose the percentage of traffic that you -// want to monitor. You can also set a maximum limit for the number of city-networks -// where client traffic is monitored, that caps the total traffic that Internet -// Monitor monitors. A city-network maximum is the limit of city-networks, but -// you only pay for the number of city-networks that are actually monitored. -// You can update your monitor at any time to change the percentage of traffic -// to monitor or the city-networks maximum. For more information, see Choosing -// a city-network maximum value (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html) -// in the Amazon CloudWatch User Guide. -// -// 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 CloudWatch Internet Monitor's -// API operation CreateMonitor for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// The requested resource is in use. -// -// - LimitExceededException -// The request exceeded a service quota. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/CreateMonitor -func (c *InternetMonitor) CreateMonitor(input *CreateMonitorInput) (*CreateMonitorOutput, error) { - req, out := c.CreateMonitorRequest(input) - return out, req.Send() -} - -// CreateMonitorWithContext is the same as CreateMonitor with the addition of -// the ability to pass a context and additional request options. -// -// See CreateMonitor 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 *InternetMonitor) CreateMonitorWithContext(ctx aws.Context, input *CreateMonitorInput, opts ...request.Option) (*CreateMonitorOutput, error) { - req, out := c.CreateMonitorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteMonitor = "DeleteMonitor" - -// DeleteMonitorRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMonitor 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 DeleteMonitor for more information on using the DeleteMonitor -// 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 DeleteMonitorRequest method. -// req, resp := client.DeleteMonitorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/DeleteMonitor -func (c *InternetMonitor) DeleteMonitorRequest(input *DeleteMonitorInput) (req *request.Request, output *DeleteMonitorOutput) { - op := &request.Operation{ - Name: opDeleteMonitor, - HTTPMethod: "DELETE", - HTTPPath: "/v20210603/Monitors/{MonitorName}", - } - - if input == nil { - input = &DeleteMonitorInput{} - } - - output = &DeleteMonitorOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteMonitor API operation for Amazon CloudWatch Internet Monitor. -// -// Deletes a monitor in Amazon CloudWatch Internet Monitor. -// -// 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 CloudWatch Internet Monitor's -// API operation DeleteMonitor for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/DeleteMonitor -func (c *InternetMonitor) DeleteMonitor(input *DeleteMonitorInput) (*DeleteMonitorOutput, error) { - req, out := c.DeleteMonitorRequest(input) - return out, req.Send() -} - -// DeleteMonitorWithContext is the same as DeleteMonitor with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteMonitor 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 *InternetMonitor) DeleteMonitorWithContext(ctx aws.Context, input *DeleteMonitorInput, opts ...request.Option) (*DeleteMonitorOutput, error) { - req, out := c.DeleteMonitorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetHealthEvent = "GetHealthEvent" - -// GetHealthEventRequest generates a "aws/request.Request" representing the -// client's request for the GetHealthEvent 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 GetHealthEvent for more information on using the GetHealthEvent -// 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 GetHealthEventRequest method. -// req, resp := client.GetHealthEventRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetHealthEvent -func (c *InternetMonitor) GetHealthEventRequest(input *GetHealthEventInput) (req *request.Request, output *GetHealthEventOutput) { - op := &request.Operation{ - Name: opGetHealthEvent, - HTTPMethod: "GET", - HTTPPath: "/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}", - } - - if input == nil { - input = &GetHealthEventInput{} - } - - output = &GetHealthEventOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetHealthEvent API operation for Amazon CloudWatch Internet Monitor. -// -// Gets information the Amazon CloudWatch Internet Monitor has created and stored -// about a health event for a specified monitor. This information includes the -// impacted locations, and all the information related to the event, by location. -// -// The information returned includes the impact on performance, availability, -// and round-trip time, information about the network providers (ASNs), the -// event type, and so on. -// -// Information rolled up at the global traffic level is also returned, including -// the impact type and total traffic impact. -// -// 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 CloudWatch Internet Monitor's -// API operation GetHealthEvent for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetHealthEvent -func (c *InternetMonitor) GetHealthEvent(input *GetHealthEventInput) (*GetHealthEventOutput, error) { - req, out := c.GetHealthEventRequest(input) - return out, req.Send() -} - -// GetHealthEventWithContext is the same as GetHealthEvent with the addition of -// the ability to pass a context and additional request options. -// -// See GetHealthEvent 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 *InternetMonitor) GetHealthEventWithContext(ctx aws.Context, input *GetHealthEventInput, opts ...request.Option) (*GetHealthEventOutput, error) { - req, out := c.GetHealthEventRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMonitor = "GetMonitor" - -// GetMonitorRequest generates a "aws/request.Request" representing the -// client's request for the GetMonitor 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 GetMonitor for more information on using the GetMonitor -// 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 GetMonitorRequest method. -// req, resp := client.GetMonitorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetMonitor -func (c *InternetMonitor) GetMonitorRequest(input *GetMonitorInput) (req *request.Request, output *GetMonitorOutput) { - op := &request.Operation{ - Name: opGetMonitor, - HTTPMethod: "GET", - HTTPPath: "/v20210603/Monitors/{MonitorName}", - } - - if input == nil { - input = &GetMonitorInput{} - } - - output = &GetMonitorOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMonitor API operation for Amazon CloudWatch Internet Monitor. -// -// Gets information about a monitor in Amazon CloudWatch Internet Monitor based -// on a monitor name. The information returned includes the Amazon Resource -// Name (ARN), create time, modified time, resources included in the monitor, -// and status information. -// -// 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 CloudWatch Internet Monitor's -// API operation GetMonitor for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetMonitor -func (c *InternetMonitor) GetMonitor(input *GetMonitorInput) (*GetMonitorOutput, error) { - req, out := c.GetMonitorRequest(input) - return out, req.Send() -} - -// GetMonitorWithContext is the same as GetMonitor with the addition of -// the ability to pass a context and additional request options. -// -// See GetMonitor 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 *InternetMonitor) GetMonitorWithContext(ctx aws.Context, input *GetMonitorInput, opts ...request.Option) (*GetMonitorOutput, error) { - req, out := c.GetMonitorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetQueryResults = "GetQueryResults" - -// GetQueryResultsRequest generates a "aws/request.Request" representing the -// client's request for the GetQueryResults 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 GetQueryResults for more information on using the GetQueryResults -// 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 GetQueryResultsRequest method. -// req, resp := client.GetQueryResultsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetQueryResults -func (c *InternetMonitor) GetQueryResultsRequest(input *GetQueryResultsInput) (req *request.Request, output *GetQueryResultsOutput) { - op := &request.Operation{ - Name: opGetQueryResults, - HTTPMethod: "GET", - HTTPPath: "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Results", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetQueryResultsInput{} - } - - output = &GetQueryResultsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetQueryResults API operation for Amazon CloudWatch Internet Monitor. -// -// Return the data for a query with the Amazon CloudWatch Internet Monitor query -// interface. Specify the query that you want to return results for by providing -// a QueryId and a monitor name. -// -// For more information about using the query interface, including examples, -// see Using the Amazon CloudWatch Internet Monitor query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) -// in the Amazon CloudWatch Internet Monitor User Guide. -// -// 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 CloudWatch Internet Monitor's -// API operation GetQueryResults for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - LimitExceededException -// The request exceeded a service quota. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetQueryResults -func (c *InternetMonitor) GetQueryResults(input *GetQueryResultsInput) (*GetQueryResultsOutput, error) { - req, out := c.GetQueryResultsRequest(input) - return out, req.Send() -} - -// GetQueryResultsWithContext is the same as GetQueryResults with the addition of -// the ability to pass a context and additional request options. -// -// See GetQueryResults 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 *InternetMonitor) GetQueryResultsWithContext(ctx aws.Context, input *GetQueryResultsInput, opts ...request.Option) (*GetQueryResultsOutput, error) { - req, out := c.GetQueryResultsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetQueryResultsPages iterates over the pages of a GetQueryResults operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetQueryResults method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetQueryResults operation. -// pageNum := 0 -// err := client.GetQueryResultsPages(params, -// func(page *internetmonitor.GetQueryResultsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *InternetMonitor) GetQueryResultsPages(input *GetQueryResultsInput, fn func(*GetQueryResultsOutput, bool) bool) error { - return c.GetQueryResultsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetQueryResultsPagesWithContext same as GetQueryResultsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *InternetMonitor) GetQueryResultsPagesWithContext(ctx aws.Context, input *GetQueryResultsInput, fn func(*GetQueryResultsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetQueryResultsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetQueryResultsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetQueryResultsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetQueryStatus = "GetQueryStatus" - -// GetQueryStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetQueryStatus 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 GetQueryStatus for more information on using the GetQueryStatus -// 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 GetQueryStatusRequest method. -// req, resp := client.GetQueryStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetQueryStatus -func (c *InternetMonitor) GetQueryStatusRequest(input *GetQueryStatusInput) (req *request.Request, output *GetQueryStatusOutput) { - op := &request.Operation{ - Name: opGetQueryStatus, - HTTPMethod: "GET", - HTTPPath: "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Status", - } - - if input == nil { - input = &GetQueryStatusInput{} - } - - output = &GetQueryStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetQueryStatus API operation for Amazon CloudWatch Internet Monitor. -// -// Returns the current status of a query for the Amazon CloudWatch Internet -// Monitor query interface, for a specified query ID and monitor. When you run -// a query, check the status to make sure that the query has SUCCEEDED before -// you review the results. -// -// - QUEUED: The query is scheduled to run. -// -// - RUNNING: The query is in progress but not complete. -// -// - SUCCEEDED: The query completed sucessfully. -// -// - FAILED: The query failed due to an error. -// -// - CANCELED: The query was canceled. -// -// 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 CloudWatch Internet Monitor's -// API operation GetQueryStatus for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - LimitExceededException -// The request exceeded a service quota. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/GetQueryStatus -func (c *InternetMonitor) GetQueryStatus(input *GetQueryStatusInput) (*GetQueryStatusOutput, error) { - req, out := c.GetQueryStatusRequest(input) - return out, req.Send() -} - -// GetQueryStatusWithContext is the same as GetQueryStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetQueryStatus 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 *InternetMonitor) GetQueryStatusWithContext(ctx aws.Context, input *GetQueryStatusInput, opts ...request.Option) (*GetQueryStatusOutput, error) { - req, out := c.GetQueryStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListHealthEvents = "ListHealthEvents" - -// ListHealthEventsRequest generates a "aws/request.Request" representing the -// client's request for the ListHealthEvents 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 ListHealthEvents for more information on using the ListHealthEvents -// 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 ListHealthEventsRequest method. -// req, resp := client.ListHealthEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/ListHealthEvents -func (c *InternetMonitor) ListHealthEventsRequest(input *ListHealthEventsInput) (req *request.Request, output *ListHealthEventsOutput) { - op := &request.Operation{ - Name: opListHealthEvents, - HTTPMethod: "GET", - HTTPPath: "/v20210603/Monitors/{MonitorName}/HealthEvents", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListHealthEventsInput{} - } - - output = &ListHealthEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListHealthEvents API operation for Amazon CloudWatch Internet Monitor. -// -// Lists all health events for a monitor in Amazon CloudWatch Internet Monitor. -// Returns information for health events including the event start and end time -// and the status. -// -// Health events that have start times during the time frame that is requested -// are not included in the list of health events. -// -// 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 CloudWatch Internet Monitor's -// API operation ListHealthEvents for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/ListHealthEvents -func (c *InternetMonitor) ListHealthEvents(input *ListHealthEventsInput) (*ListHealthEventsOutput, error) { - req, out := c.ListHealthEventsRequest(input) - return out, req.Send() -} - -// ListHealthEventsWithContext is the same as ListHealthEvents with the addition of -// the ability to pass a context and additional request options. -// -// See ListHealthEvents 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 *InternetMonitor) ListHealthEventsWithContext(ctx aws.Context, input *ListHealthEventsInput, opts ...request.Option) (*ListHealthEventsOutput, error) { - req, out := c.ListHealthEventsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListHealthEventsPages iterates over the pages of a ListHealthEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHealthEvents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListHealthEvents operation. -// pageNum := 0 -// err := client.ListHealthEventsPages(params, -// func(page *internetmonitor.ListHealthEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *InternetMonitor) ListHealthEventsPages(input *ListHealthEventsInput, fn func(*ListHealthEventsOutput, bool) bool) error { - return c.ListHealthEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHealthEventsPagesWithContext same as ListHealthEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *InternetMonitor) ListHealthEventsPagesWithContext(ctx aws.Context, input *ListHealthEventsInput, fn func(*ListHealthEventsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListHealthEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListHealthEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListHealthEventsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListMonitors = "ListMonitors" - -// ListMonitorsRequest generates a "aws/request.Request" representing the -// client's request for the ListMonitors 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 ListMonitors for more information on using the ListMonitors -// 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 ListMonitorsRequest method. -// req, resp := client.ListMonitorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/ListMonitors -func (c *InternetMonitor) ListMonitorsRequest(input *ListMonitorsInput) (req *request.Request, output *ListMonitorsOutput) { - op := &request.Operation{ - Name: opListMonitors, - HTTPMethod: "GET", - HTTPPath: "/v20210603/Monitors", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMonitorsInput{} - } - - output = &ListMonitorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMonitors API operation for Amazon CloudWatch Internet Monitor. -// -// Lists all of your monitors for Amazon CloudWatch Internet Monitor and their -// statuses, along with the Amazon Resource Name (ARN) and name of each monitor. -// -// 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 CloudWatch Internet Monitor's -// API operation ListMonitors for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/ListMonitors -func (c *InternetMonitor) ListMonitors(input *ListMonitorsInput) (*ListMonitorsOutput, error) { - req, out := c.ListMonitorsRequest(input) - return out, req.Send() -} - -// ListMonitorsWithContext is the same as ListMonitors with the addition of -// the ability to pass a context and additional request options. -// -// See ListMonitors 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 *InternetMonitor) ListMonitorsWithContext(ctx aws.Context, input *ListMonitorsInput, opts ...request.Option) (*ListMonitorsOutput, error) { - req, out := c.ListMonitorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMonitorsPages iterates over the pages of a ListMonitors operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMonitors method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMonitors operation. -// pageNum := 0 -// err := client.ListMonitorsPages(params, -// func(page *internetmonitor.ListMonitorsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *InternetMonitor) ListMonitorsPages(input *ListMonitorsInput, fn func(*ListMonitorsOutput, bool) bool) error { - return c.ListMonitorsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMonitorsPagesWithContext same as ListMonitorsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *InternetMonitor) ListMonitorsPagesWithContext(ctx aws.Context, input *ListMonitorsInput, fn func(*ListMonitorsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMonitorsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMonitorsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListMonitorsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/ListTagsForResource -func (c *InternetMonitor) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon CloudWatch Internet Monitor. -// -// Lists the tags for a resource. Tags are supported only for monitors in Amazon -// CloudWatch Internet Monitor. -// -// 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 CloudWatch Internet Monitor's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - TooManyRequestsException -// There were too many requests. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - NotFoundException -// The request specifies something that doesn't exist. -// -// - BadRequestException -// A bad request was received. -// -// - InternalServerErrorException -// There was an internal server error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/ListTagsForResource -func (c *InternetMonitor) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *InternetMonitor) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartQuery = "StartQuery" - -// StartQueryRequest generates a "aws/request.Request" representing the -// client's request for the StartQuery 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 StartQuery for more information on using the StartQuery -// 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 StartQueryRequest method. -// req, resp := client.StartQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/StartQuery -func (c *InternetMonitor) StartQueryRequest(input *StartQueryInput) (req *request.Request, output *StartQueryOutput) { - op := &request.Operation{ - Name: opStartQuery, - HTTPMethod: "POST", - HTTPPath: "/v20210603/Monitors/{MonitorName}/Queries", - } - - if input == nil { - input = &StartQueryInput{} - } - - output = &StartQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartQuery API operation for Amazon CloudWatch Internet Monitor. -// -// Start a query to return data for a specific query type for the Amazon CloudWatch -// Internet Monitor query interface. Specify a time period for the data that -// you want returned by using StartTime and EndTime. You filter the query results -// to return by providing parameters that you specify with FilterParameters. -// -// For more information about using the query interface, including examples, -// see Using the Amazon CloudWatch Internet Monitor query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) -// in the Amazon CloudWatch Internet Monitor User Guide. -// -// 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 CloudWatch Internet Monitor's -// API operation StartQuery for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - LimitExceededException -// The request exceeded a service quota. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/StartQuery -func (c *InternetMonitor) StartQuery(input *StartQueryInput) (*StartQueryOutput, error) { - req, out := c.StartQueryRequest(input) - return out, req.Send() -} - -// StartQueryWithContext is the same as StartQuery with the addition of -// the ability to pass a context and additional request options. -// -// See StartQuery 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 *InternetMonitor) StartQueryWithContext(ctx aws.Context, input *StartQueryInput, opts ...request.Option) (*StartQueryOutput, error) { - req, out := c.StartQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopQuery = "StopQuery" - -// StopQueryRequest generates a "aws/request.Request" representing the -// client's request for the StopQuery 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 StopQuery for more information on using the StopQuery -// 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 StopQueryRequest method. -// req, resp := client.StopQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/StopQuery -func (c *InternetMonitor) StopQueryRequest(input *StopQueryInput) (req *request.Request, output *StopQueryOutput) { - op := &request.Operation{ - Name: opStopQuery, - HTTPMethod: "DELETE", - HTTPPath: "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}", - } - - if input == nil { - input = &StopQueryInput{} - } - - output = &StopQueryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopQuery API operation for Amazon CloudWatch Internet Monitor. -// -// Stop a query that is progress for a specific monitor. -// -// 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 CloudWatch Internet Monitor's -// API operation StopQuery for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - LimitExceededException -// The request exceeded a service quota. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/StopQuery -func (c *InternetMonitor) StopQuery(input *StopQueryInput) (*StopQueryOutput, error) { - req, out := c.StopQueryRequest(input) - return out, req.Send() -} - -// StopQueryWithContext is the same as StopQuery with the addition of -// the ability to pass a context and additional request options. -// -// See StopQuery 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 *InternetMonitor) StopQueryWithContext(ctx aws.Context, input *StopQueryInput, opts ...request.Option) (*StopQueryOutput, error) { - req, out := c.StopQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/TagResource -func (c *InternetMonitor) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon CloudWatch Internet Monitor. -// -// Adds a tag to a resource. Tags are supported only for monitors in Amazon -// CloudWatch Internet Monitor. You can add a maximum of 50 tags in Internet -// Monitor. -// -// A minimum of one tag is required for this call. It returns an error if you -// use the TagResource request with 0 tags. -// -// 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 CloudWatch Internet Monitor's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - TooManyRequestsException -// There were too many requests. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - NotFoundException -// The request specifies something that doesn't exist. -// -// - BadRequestException -// A bad request was received. -// -// - InternalServerErrorException -// There was an internal server error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/TagResource -func (c *InternetMonitor) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *InternetMonitor) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/UntagResource -func (c *InternetMonitor) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon CloudWatch Internet Monitor. -// -// Removes a tag from a resource. -// -// 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 CloudWatch Internet Monitor's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - TooManyRequestsException -// There were too many requests. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - NotFoundException -// The request specifies something that doesn't exist. -// -// - BadRequestException -// A bad request was received. -// -// - InternalServerErrorException -// There was an internal server error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/UntagResource -func (c *InternetMonitor) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *InternetMonitor) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateMonitor = "UpdateMonitor" - -// UpdateMonitorRequest generates a "aws/request.Request" representing the -// client's request for the UpdateMonitor 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 UpdateMonitor for more information on using the UpdateMonitor -// 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 UpdateMonitorRequest method. -// req, resp := client.UpdateMonitorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/UpdateMonitor -func (c *InternetMonitor) UpdateMonitorRequest(input *UpdateMonitorInput) (req *request.Request, output *UpdateMonitorOutput) { - op := &request.Operation{ - Name: opUpdateMonitor, - HTTPMethod: "PATCH", - HTTPPath: "/v20210603/Monitors/{MonitorName}", - } - - if input == nil { - input = &UpdateMonitorInput{} - } - - output = &UpdateMonitorOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateMonitor API operation for Amazon CloudWatch Internet Monitor. -// -// Updates a monitor. You can update a monitor to change the percentage of traffic -// to monitor or the maximum number of city-networks (locations and ASNs), to -// add or remove resources, or to change the status of the monitor. Note that -// you can't change the name of a monitor. -// -// The city-network maximum that you choose is the limit, but you only pay for -// the number of city-networks that are actually monitored. For more information, -// see Choosing a city-network maximum value (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html) -// in the Amazon CloudWatch User Guide. -// -// 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 CloudWatch Internet Monitor's -// API operation UpdateMonitor for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error occurred. -// -// - ResourceNotFoundException -// The request specifies a resource that doesn't exist. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - LimitExceededException -// The request exceeded a service quota. -// -// - ValidationException -// Invalid request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03/UpdateMonitor -func (c *InternetMonitor) UpdateMonitor(input *UpdateMonitorInput) (*UpdateMonitorOutput, error) { - req, out := c.UpdateMonitorRequest(input) - return out, req.Send() -} - -// UpdateMonitorWithContext is the same as UpdateMonitor with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateMonitor 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 *InternetMonitor) UpdateMonitorWithContext(ctx aws.Context, input *UpdateMonitorInput, opts ...request.Option) (*UpdateMonitorOutput, error) { - req, out := c.UpdateMonitorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have sufficient permission to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Amazon CloudWatch Internet Monitor calculates measurements about the availability -// for your application's internet traffic between client locations and Amazon -// Web Services. Amazon Web Services has substantial historical data about internet -// performance and availability between Amazon Web Services services and different -// network providers and geographies. By applying statistical analysis to the -// data, Internet Monitor can detect when the performance and availability for -// your application has dropped, compared to an estimated baseline that's already -// calculated. To make it easier to see those drops, we report that information -// to you in the form of health scores: a performance score and an availability -// score. -// -// Availability in Internet Monitor represents the estimated percentage of traffic -// that is not seeing an availability drop. For example, an availability score -// of 99% for an end user and service location pair is equivalent to 1% of the -// traffic experiencing an availability drop for that pair. -// -// For more information, see How Internet Monitor calculates performance and -// availability scores (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMExperienceScores) -// in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch -// User Guide. -type AvailabilityMeasurement struct { - _ struct{} `type:"structure"` - - // Experience scores, or health scores are calculated for different geographic - // and network provider combinations (that is, different granularities) and - // also summed into global scores. If you view performance or availability scores - // without filtering for any specific geography or service provider, Amazon - // CloudWatch Internet Monitor provides global health scores. - // - // The Amazon CloudWatch Internet Monitor chapter in the CloudWatch User Guide - // includes detailed information about how Internet Monitor calculates health - // scores, including performance and availability scores, and when it creates - // and resolves health events. For more information, see How Amazon Web Services - // calculates performance and availability scores (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMExperienceScores) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - ExperienceScore *float64 `type:"double"` - - // The percentage of impact caused by a health event for client location traffic - // globally. - // - // For information about how Internet Monitor calculates impact, see Inside - // Internet Monitor (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html) - // in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch - // User Guide. - PercentOfClientLocationImpacted *float64 `type:"double"` - - // The impact on total traffic that a health event has, in increased latency - // or reduced availability. This is the percentage of how much latency has increased - // or availability has decreased during the event, compared to what is typical - // for traffic from this client location to the Amazon Web Services location - // using this client network. - // - // For information about how Internet Monitor calculates impact, see How Internet - // Monitor works (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html) - // in the Amazon CloudWatch Internet Monitor section of the Amazon CloudWatch - // User Guide. - PercentOfTotalTrafficImpacted *float64 `type:"double"` -} - -// 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 AvailabilityMeasurement) 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 AvailabilityMeasurement) GoString() string { - return s.String() -} - -// SetExperienceScore sets the ExperienceScore field's value. -func (s *AvailabilityMeasurement) SetExperienceScore(v float64) *AvailabilityMeasurement { - s.ExperienceScore = &v - return s -} - -// SetPercentOfClientLocationImpacted sets the PercentOfClientLocationImpacted field's value. -func (s *AvailabilityMeasurement) SetPercentOfClientLocationImpacted(v float64) *AvailabilityMeasurement { - s.PercentOfClientLocationImpacted = &v - return s -} - -// SetPercentOfTotalTrafficImpacted sets the PercentOfTotalTrafficImpacted field's value. -func (s *AvailabilityMeasurement) SetPercentOfTotalTrafficImpacted(v float64) *AvailabilityMeasurement { - s.PercentOfTotalTrafficImpacted = &v - return s -} - -// A bad request was received. -type BadRequestException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 BadRequestException) 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 BadRequestException) GoString() string { - return s.String() -} - -func newErrorBadRequestException(v protocol.ResponseMetadata) error { - return &BadRequestException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *BadRequestException) Code() string { - return "BadRequestException" -} - -// Message returns the exception's message. -func (s *BadRequestException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *BadRequestException) OrigErr() error { - return nil -} - -func (s *BadRequestException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *BadRequestException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *BadRequestException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The requested resource is in use. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateMonitorInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive string of up to 64 ASCII characters that you specify - // to make an idempotent API request. Don't reuse the same client token for - // other API requests. - ClientToken *string `type:"string" idempotencyToken:"true"` - - // Defines the threshold percentages and other configuration information for - // when Amazon CloudWatch Internet Monitor creates a health event. Internet - // Monitor creates a health event when an internet issue that affects your application - // end users has a health score percentage that is at or below a specific threshold, - // and, sometimes, when other criteria are met. - // - // If you don't set a health event threshold, the default value is 95%. - // - // For more information, see Change health event thresholds (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview) - // in the Internet Monitor section of the CloudWatch User Guide. - HealthEventsConfig *HealthEventsConfig `type:"structure"` - - // Publish internet measurements for Internet Monitor to an Amazon S3 bucket - // in addition to CloudWatch Logs. - InternetMeasurementsLogDelivery *InternetMeasurementsLogDelivery `type:"structure"` - - // The maximum number of city-networks to monitor for your resources. A city-network - // is the location (city) where clients access your application resources from - // and the ASN or network provider, such as an internet service provider (ISP), - // that clients access the resources through. Setting this limit can help control - // billing costs. - // - // To learn more, see Choosing a city-network maximum value (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - MaxCityNetworksToMonitor *int64 `min:"1" type:"integer"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `min:"1" type:"string" required:"true"` - - // The resources to include in a monitor, which you provide as a set of Amazon - // Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront distributions, - // or Amazon WorkSpaces directories. - // - // You can add a combination of VPCs and CloudFront distributions, or you can - // add WorkSpaces directories, or you can add NLBs. You can't add NLBs or WorkSpaces - // directories together with any other resources. - // - // If you add only Amazon VPC resources, at least one VPC must have an Internet - // Gateway attached to it, to make sure that it has internet connectivity. - Resources []*string `type:"list"` - - // The tags for a monitor. You can add a maximum of 50 tags in Internet Monitor. - Tags map[string]*string `type:"map"` - - // The percentage of the internet-facing traffic for your application that you - // want to monitor with this monitor. If you set a city-networks maximum, that - // limit overrides the traffic percentage that you set. - // - // To learn more, see Choosing an application traffic percentage to monitor - // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - TrafficPercentageToMonitor *int64 `min:"1" 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 CreateMonitorInput) 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 CreateMonitorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMonitorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMonitorInput"} - if s.MaxCityNetworksToMonitor != nil && *s.MaxCityNetworksToMonitor < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxCityNetworksToMonitor", 1)) - } - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - if s.TrafficPercentageToMonitor != nil && *s.TrafficPercentageToMonitor < 1 { - invalidParams.Add(request.NewErrParamMinValue("TrafficPercentageToMonitor", 1)) - } - if s.InternetMeasurementsLogDelivery != nil { - if err := s.InternetMeasurementsLogDelivery.Validate(); err != nil { - invalidParams.AddNested("InternetMeasurementsLogDelivery", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateMonitorInput) SetClientToken(v string) *CreateMonitorInput { - s.ClientToken = &v - return s -} - -// SetHealthEventsConfig sets the HealthEventsConfig field's value. -func (s *CreateMonitorInput) SetHealthEventsConfig(v *HealthEventsConfig) *CreateMonitorInput { - s.HealthEventsConfig = v - return s -} - -// SetInternetMeasurementsLogDelivery sets the InternetMeasurementsLogDelivery field's value. -func (s *CreateMonitorInput) SetInternetMeasurementsLogDelivery(v *InternetMeasurementsLogDelivery) *CreateMonitorInput { - s.InternetMeasurementsLogDelivery = v - return s -} - -// SetMaxCityNetworksToMonitor sets the MaxCityNetworksToMonitor field's value. -func (s *CreateMonitorInput) SetMaxCityNetworksToMonitor(v int64) *CreateMonitorInput { - s.MaxCityNetworksToMonitor = &v - return s -} - -// SetMonitorName sets the MonitorName field's value. -func (s *CreateMonitorInput) SetMonitorName(v string) *CreateMonitorInput { - s.MonitorName = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *CreateMonitorInput) SetResources(v []*string) *CreateMonitorInput { - s.Resources = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateMonitorInput) SetTags(v map[string]*string) *CreateMonitorInput { - s.Tags = v - return s -} - -// SetTrafficPercentageToMonitor sets the TrafficPercentageToMonitor field's value. -func (s *CreateMonitorInput) SetTrafficPercentageToMonitor(v int64) *CreateMonitorInput { - s.TrafficPercentageToMonitor = &v - return s -} - -type CreateMonitorOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the monitor. - // - // Arn is a required field - Arn *string `min:"20" type:"string" required:"true"` - - // The status of a monitor. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"MonitorConfigState"` -} - -// 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 CreateMonitorOutput) 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 CreateMonitorOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateMonitorOutput) SetArn(v string) *CreateMonitorOutput { - s.Arn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateMonitorOutput) SetStatus(v string) *CreateMonitorOutput { - s.Status = &v - return s -} - -type DeleteMonitorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the monitor to delete. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" 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 DeleteMonitorInput) 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 DeleteMonitorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMonitorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMonitorInput"} - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMonitorName sets the MonitorName field's value. -func (s *DeleteMonitorInput) SetMonitorName(v string) *DeleteMonitorInput { - s.MonitorName = &v - return s -} - -type DeleteMonitorOutput 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 DeleteMonitorOutput) 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 DeleteMonitorOutput) GoString() string { - return s.String() -} - -// A filter that you use with the results of a Amazon CloudWatch Internet Monitor -// query that you created and ran. The query sets up a repository of data that -// is a subset of your application's Internet Monitor data. FilterParameter -// is a string that defines how you want to filter the repository of data to -// return a set of results, based on your criteria. -// -// The filter parameters that you can specify depend on the query type that -// you used to create the repository, since each query type returns a different -// set of Internet Monitor data. -// -// For each filter, you specify a field (such as city), an operator (such as -// not_equals, and a value or array of values (such as ["Seattle", "Redmond"]). -// Separate values in the array with commas. -// -// For more information about specifying filter parameters, see Using the Amazon -// CloudWatch Internet Monitor query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) -// in the Amazon CloudWatch Internet Monitor User Guide. -type FilterParameter struct { - _ struct{} `type:"structure"` - - // A data field that you want to filter, to further scope your application's - // Internet Monitor data in a repository that you created by running a query. - // A field might be city, for example. The field must be one of the fields that - // was returned by the specific query that you used to create the repository. - Field *string `type:"string"` - - // The operator to use with the filter field and a value, such as not_equals. - Operator *string `type:"string" enum:"Operator"` - - // One or more values to be used, together with the specified operator, to filter - // data for a query. For example, you could specify an array of values such - // as ["Seattle", "Redmond"]. Values in the array are separated by commas. - Values []*string `type:"list"` -} - -// 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 FilterParameter) 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 FilterParameter) GoString() string { - return s.String() -} - -// SetField sets the Field field's value. -func (s *FilterParameter) SetField(v string) *FilterParameter { - s.Field = &v - return s -} - -// SetOperator sets the Operator field's value. -func (s *FilterParameter) SetOperator(v string) *FilterParameter { - s.Operator = &v - return s -} - -// SetValues sets the Values field's value. -func (s *FilterParameter) SetValues(v []*string) *FilterParameter { - s.Values = v - return s -} - -type GetHealthEventInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The internally-generated identifier of a health event. Because EventID contains - // the forward slash (“/”) character, you must URL-encode the EventID field - // in the request URL. - // - // EventId is a required field - EventId *string `location:"uri" locationName:"EventId" min:"1" type:"string" required:"true"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" 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 GetHealthEventInput) 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 GetHealthEventInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetHealthEventInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetHealthEventInput"} - if s.EventId == nil { - invalidParams.Add(request.NewErrParamRequired("EventId")) - } - if s.EventId != nil && len(*s.EventId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EventId", 1)) - } - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventId sets the EventId field's value. -func (s *GetHealthEventInput) SetEventId(v string) *GetHealthEventInput { - s.EventId = &v - return s -} - -// SetMonitorName sets the MonitorName field's value. -func (s *GetHealthEventInput) SetMonitorName(v string) *GetHealthEventInput { - s.MonitorName = &v - return s -} - -type GetHealthEventOutput struct { - _ struct{} `type:"structure"` - - // The time when a health event was created. - CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time when a health event was resolved. If the health event is still active, - // the end time is not set. - EndedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Resource Name (ARN) of the event. - // - // EventArn is a required field - EventArn *string `min:"20" type:"string" required:"true"` - - // The internally-generated identifier of a health event. - // - // EventId is a required field - EventId *string `min:"1" type:"string" required:"true"` - - // The threshold percentage for a health score that determines, along with other - // configuration information, when Internet Monitor creates a health event when - // there's an internet issue that affects your application end users. - HealthScoreThreshold *float64 `type:"double"` - - // The type of impairment of a specific health event. - // - // ImpactType is a required field - ImpactType *string `type:"string" required:"true" enum:"HealthEventImpactType"` - - // The locations affected by a health event. - // - // ImpactedLocations is a required field - ImpactedLocations []*ImpactedLocation `type:"list" required:"true"` - - // The time when a health event was last updated or recalculated. - // - // LastUpdatedAt is a required field - LastUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The impact on total traffic that a health event has, in increased latency - // or reduced availability. This is the percentage of how much latency has increased - // or availability has decreased during the event, compared to what is typical - // for traffic from this client location to the Amazon Web Services location - // using this client network. - PercentOfTotalTrafficImpacted *float64 `type:"double"` - - // The time when a health event started. - // - // StartedAt is a required field - StartedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The status of a health event. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"HealthEventStatus"` -} - -// 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 GetHealthEventOutput) 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 GetHealthEventOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetHealthEventOutput) SetCreatedAt(v time.Time) *GetHealthEventOutput { - s.CreatedAt = &v - return s -} - -// SetEndedAt sets the EndedAt field's value. -func (s *GetHealthEventOutput) SetEndedAt(v time.Time) *GetHealthEventOutput { - s.EndedAt = &v - return s -} - -// SetEventArn sets the EventArn field's value. -func (s *GetHealthEventOutput) SetEventArn(v string) *GetHealthEventOutput { - s.EventArn = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *GetHealthEventOutput) SetEventId(v string) *GetHealthEventOutput { - s.EventId = &v - return s -} - -// SetHealthScoreThreshold sets the HealthScoreThreshold field's value. -func (s *GetHealthEventOutput) SetHealthScoreThreshold(v float64) *GetHealthEventOutput { - s.HealthScoreThreshold = &v - return s -} - -// SetImpactType sets the ImpactType field's value. -func (s *GetHealthEventOutput) SetImpactType(v string) *GetHealthEventOutput { - s.ImpactType = &v - return s -} - -// SetImpactedLocations sets the ImpactedLocations field's value. -func (s *GetHealthEventOutput) SetImpactedLocations(v []*ImpactedLocation) *GetHealthEventOutput { - s.ImpactedLocations = v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetHealthEventOutput) SetLastUpdatedAt(v time.Time) *GetHealthEventOutput { - s.LastUpdatedAt = &v - return s -} - -// SetPercentOfTotalTrafficImpacted sets the PercentOfTotalTrafficImpacted field's value. -func (s *GetHealthEventOutput) SetPercentOfTotalTrafficImpacted(v float64) *GetHealthEventOutput { - s.PercentOfTotalTrafficImpacted = &v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *GetHealthEventOutput) SetStartedAt(v time.Time) *GetHealthEventOutput { - s.StartedAt = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetHealthEventOutput) SetStatus(v string) *GetHealthEventOutput { - s.Status = &v - return s -} - -type GetMonitorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" 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 GetMonitorInput) 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 GetMonitorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMonitorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMonitorInput"} - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMonitorName sets the MonitorName field's value. -func (s *GetMonitorInput) SetMonitorName(v string) *GetMonitorInput { - s.MonitorName = &v - return s -} - -type GetMonitorOutput struct { - _ struct{} `type:"structure"` - - // The time when the monitor was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The list of health event threshold configurations. The threshold percentage - // for a health score determines, along with other configuration information, - // when Internet Monitor creates a health event when there's an internet issue - // that affects your application end users. - // - // For more information, see Change health event thresholds (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview) - // in the Internet Monitor section of the CloudWatch User Guide. - HealthEventsConfig *HealthEventsConfig `type:"structure"` - - // Publish internet measurements for Internet Monitor to another location, such - // as an Amazon S3 bucket. The measurements are also published to Amazon CloudWatch - // Logs. - InternetMeasurementsLogDelivery *InternetMeasurementsLogDelivery `type:"structure"` - - // The maximum number of city-networks to monitor for your resources. A city-network - // is the location (city) where clients access your application resources from - // and the ASN or network provider, such as an internet service provider (ISP), - // that clients access the resources through. This limit can help control billing - // costs. - // - // To learn more, see Choosing a city-network maximum value (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - MaxCityNetworksToMonitor *int64 `min:"1" type:"integer"` - - // The last time that the monitor was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Amazon Resource Name (ARN) of the monitor. - // - // MonitorArn is a required field - MonitorArn *string `min:"20" type:"string" required:"true"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `min:"1" type:"string" required:"true"` - - // The health of the data processing for the monitor. - ProcessingStatus *string `type:"string" enum:"MonitorProcessingStatusCode"` - - // Additional information about the health of the data processing for the monitor. - ProcessingStatusInfo *string `type:"string"` - - // The resources monitored by the monitor. Resources are listed by their Amazon - // Resource Names (ARNs). - // - // Resources is a required field - Resources []*string `type:"list" required:"true"` - - // The status of the monitor. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"MonitorConfigState"` - - // The tags that have been added to monitor. - Tags map[string]*string `type:"map"` - - // The percentage of the internet-facing traffic for your application to monitor - // with this monitor. If you set a city-networks maximum, that limit overrides - // the traffic percentage that you set. - // - // To learn more, see Choosing an application traffic percentage to monitor - // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - TrafficPercentageToMonitor *int64 `min:"1" 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 GetMonitorOutput) 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 GetMonitorOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetMonitorOutput) SetCreatedAt(v time.Time) *GetMonitorOutput { - s.CreatedAt = &v - return s -} - -// SetHealthEventsConfig sets the HealthEventsConfig field's value. -func (s *GetMonitorOutput) SetHealthEventsConfig(v *HealthEventsConfig) *GetMonitorOutput { - s.HealthEventsConfig = v - return s -} - -// SetInternetMeasurementsLogDelivery sets the InternetMeasurementsLogDelivery field's value. -func (s *GetMonitorOutput) SetInternetMeasurementsLogDelivery(v *InternetMeasurementsLogDelivery) *GetMonitorOutput { - s.InternetMeasurementsLogDelivery = v - return s -} - -// SetMaxCityNetworksToMonitor sets the MaxCityNetworksToMonitor field's value. -func (s *GetMonitorOutput) SetMaxCityNetworksToMonitor(v int64) *GetMonitorOutput { - s.MaxCityNetworksToMonitor = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *GetMonitorOutput) SetModifiedAt(v time.Time) *GetMonitorOutput { - s.ModifiedAt = &v - return s -} - -// SetMonitorArn sets the MonitorArn field's value. -func (s *GetMonitorOutput) SetMonitorArn(v string) *GetMonitorOutput { - s.MonitorArn = &v - return s -} - -// SetMonitorName sets the MonitorName field's value. -func (s *GetMonitorOutput) SetMonitorName(v string) *GetMonitorOutput { - s.MonitorName = &v - return s -} - -// SetProcessingStatus sets the ProcessingStatus field's value. -func (s *GetMonitorOutput) SetProcessingStatus(v string) *GetMonitorOutput { - s.ProcessingStatus = &v - return s -} - -// SetProcessingStatusInfo sets the ProcessingStatusInfo field's value. -func (s *GetMonitorOutput) SetProcessingStatusInfo(v string) *GetMonitorOutput { - s.ProcessingStatusInfo = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *GetMonitorOutput) SetResources(v []*string) *GetMonitorOutput { - s.Resources = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetMonitorOutput) SetStatus(v string) *GetMonitorOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetMonitorOutput) SetTags(v map[string]*string) *GetMonitorOutput { - s.Tags = v - return s -} - -// SetTrafficPercentageToMonitor sets the TrafficPercentageToMonitor field's value. -func (s *GetMonitorOutput) SetTrafficPercentageToMonitor(v int64) *GetMonitorOutput { - s.TrafficPercentageToMonitor = &v - return s -} - -type GetQueryResultsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The number of query results that you want to return with this call. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // The name of the monitor to return data for. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" type:"string" required:"true"` - - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` - - // The ID of the query that you want to return data results for. A QueryId is - // an internally-generated identifier for a specific query. - // - // QueryId is a required field - QueryId *string `location:"uri" locationName:"QueryId" 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 GetQueryResultsInput) 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 GetQueryResultsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetQueryResultsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetQueryResultsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetQueryResultsInput) SetMaxResults(v int64) *GetQueryResultsInput { - s.MaxResults = &v - return s -} - -// SetMonitorName sets the MonitorName field's value. -func (s *GetQueryResultsInput) SetMonitorName(v string) *GetQueryResultsInput { - s.MonitorName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetQueryResultsInput) SetNextToken(v string) *GetQueryResultsInput { - s.NextToken = &v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *GetQueryResultsInput) SetQueryId(v string) *GetQueryResultsInput { - s.QueryId = &v - return s -} - -type GetQueryResultsOutput struct { - _ struct{} `type:"structure"` - - // The data results that the query returns. Data is returned in arrays, aligned - // with the Fields for the query, which creates a repository of Amazon CloudWatch - // Internet Monitor information for your application. Then, you can filter the - // information in the repository by using FilterParameters that you define. - // - // Data is a required field - Data [][]*string `type:"list" required:"true"` - - // The fields that the query returns data for. Fields are name-data type pairs, - // such as availability_score-float. - // - // Fields is a required field - Fields []*QueryField `type:"list" required:"true"` - - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *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 GetQueryResultsOutput) 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 GetQueryResultsOutput) GoString() string { - return s.String() -} - -// SetData sets the Data field's value. -func (s *GetQueryResultsOutput) SetData(v [][]*string) *GetQueryResultsOutput { - s.Data = v - return s -} - -// SetFields sets the Fields field's value. -func (s *GetQueryResultsOutput) SetFields(v []*QueryField) *GetQueryResultsOutput { - s.Fields = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetQueryResultsOutput) SetNextToken(v string) *GetQueryResultsOutput { - s.NextToken = &v - return s -} - -type GetQueryStatusInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" type:"string" required:"true"` - - // The ID of the query that you want to return the status for. A QueryId is - // an internally-generated dentifier for a specific query. - // - // QueryId is a required field - QueryId *string `location:"uri" locationName:"QueryId" 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 GetQueryStatusInput) 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 GetQueryStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetQueryStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetQueryStatusInput"} - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMonitorName sets the MonitorName field's value. -func (s *GetQueryStatusInput) SetMonitorName(v string) *GetQueryStatusInput { - s.MonitorName = &v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *GetQueryStatusInput) SetQueryId(v string) *GetQueryStatusInput { - s.QueryId = &v - return s -} - -type GetQueryStatusOutput struct { - _ struct{} `type:"structure"` - - // The current status for a query. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"QueryStatus"` -} - -// 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 GetQueryStatusOutput) 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 GetQueryStatusOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *GetQueryStatusOutput) SetStatus(v string) *GetQueryStatusOutput { - s.Status = &v - return s -} - -// Information about a health event created in a monitor in Amazon CloudWatch -// Internet Monitor. -type HealthEvent struct { - _ struct{} `type:"structure"` - - // When the health event was created. - CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The time when a health event ended. If the health event is still active, - // then the end time is not set. - EndedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Resource Name (ARN) of the event. - // - // EventArn is a required field - EventArn *string `min:"20" type:"string" required:"true"` - - // The internally-generated identifier of a specific network traffic impairment - // health event. - // - // EventId is a required field - EventId *string `min:"1" type:"string" required:"true"` - - // The value of the threshold percentage for performance or availability that - // was configured when Amazon CloudWatch Internet Monitor created the health - // event. - HealthScoreThreshold *float64 `type:"double"` - - // The type of impairment for a health event. - // - // ImpactType is a required field - ImpactType *string `type:"string" required:"true" enum:"HealthEventImpactType"` - - // The locations impacted by the health event. - // - // ImpactedLocations is a required field - ImpactedLocations []*ImpactedLocation `type:"list" required:"true"` - - // When the health event was last updated. - // - // LastUpdatedAt is a required field - LastUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The impact on total traffic that a health event has, in increased latency - // or reduced availability. This is the percentage of how much latency has increased - // or availability has decreased during the event, compared to what is typical - // for traffic from this client location to the Amazon Web Services location - // using this client network. - PercentOfTotalTrafficImpacted *float64 `type:"double"` - - // When a health event started. - // - // StartedAt is a required field - StartedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Health event list member. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"HealthEventStatus"` -} - -// 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 HealthEvent) 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 HealthEvent) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *HealthEvent) SetCreatedAt(v time.Time) *HealthEvent { - s.CreatedAt = &v - return s -} - -// SetEndedAt sets the EndedAt field's value. -func (s *HealthEvent) SetEndedAt(v time.Time) *HealthEvent { - s.EndedAt = &v - return s -} - -// SetEventArn sets the EventArn field's value. -func (s *HealthEvent) SetEventArn(v string) *HealthEvent { - s.EventArn = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *HealthEvent) SetEventId(v string) *HealthEvent { - s.EventId = &v - return s -} - -// SetHealthScoreThreshold sets the HealthScoreThreshold field's value. -func (s *HealthEvent) SetHealthScoreThreshold(v float64) *HealthEvent { - s.HealthScoreThreshold = &v - return s -} - -// SetImpactType sets the ImpactType field's value. -func (s *HealthEvent) SetImpactType(v string) *HealthEvent { - s.ImpactType = &v - return s -} - -// SetImpactedLocations sets the ImpactedLocations field's value. -func (s *HealthEvent) SetImpactedLocations(v []*ImpactedLocation) *HealthEvent { - s.ImpactedLocations = v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *HealthEvent) SetLastUpdatedAt(v time.Time) *HealthEvent { - s.LastUpdatedAt = &v - return s -} - -// SetPercentOfTotalTrafficImpacted sets the PercentOfTotalTrafficImpacted field's value. -func (s *HealthEvent) SetPercentOfTotalTrafficImpacted(v float64) *HealthEvent { - s.PercentOfTotalTrafficImpacted = &v - return s -} - -// SetStartedAt sets the StartedAt field's value. -func (s *HealthEvent) SetStartedAt(v time.Time) *HealthEvent { - s.StartedAt = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *HealthEvent) SetStatus(v string) *HealthEvent { - s.Status = &v - return s -} - -// A complex type with the configuration information that determines the threshold -// and other conditions for when Internet Monitor creates a health event for -// an overall performance or availability issue, across an application's geographies. -// -// Defines the percentages, for overall performance scores and availability -// scores for an application, that are the thresholds for when Amazon CloudWatch -// Internet Monitor creates a health event. You can override the defaults to -// set a custom threshold for overall performance or availability scores, or -// both. -// -// You can also set thresholds for local health scores,, where Internet Monitor -// creates a health event when scores cross a threshold for one or more city-networks, -// in addition to creating an event when an overall score crosses a threshold. -// -// If you don't set a health event threshold, the default value is 95%. -// -// For local thresholds, you also set a minimum percentage of overall traffic -// that is impacted by an issue before Internet Monitor creates an event. In -// addition, you can disable local thresholds, for performance scores, availability -// scores, or both. -// -// For more information, see Change health event thresholds (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview) -// in the Internet Monitor section of the CloudWatch User Guide. -type HealthEventsConfig struct { - _ struct{} `type:"structure"` - - // The configuration that determines the threshold and other conditions for - // when Internet Monitor creates a health event for a local availability issue. - AvailabilityLocalHealthEventsConfig *LocalHealthEventsConfig `type:"structure"` - - // The health event threshold percentage set for availability scores. - AvailabilityScoreThreshold *float64 `type:"double"` - - // The configuration that determines the threshold and other conditions for - // when Internet Monitor creates a health event for a local performance issue. - PerformanceLocalHealthEventsConfig *LocalHealthEventsConfig `type:"structure"` - - // The health event threshold percentage set for performance scores. - PerformanceScoreThreshold *float64 `type:"double"` -} - -// 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 HealthEventsConfig) 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 HealthEventsConfig) GoString() string { - return s.String() -} - -// SetAvailabilityLocalHealthEventsConfig sets the AvailabilityLocalHealthEventsConfig field's value. -func (s *HealthEventsConfig) SetAvailabilityLocalHealthEventsConfig(v *LocalHealthEventsConfig) *HealthEventsConfig { - s.AvailabilityLocalHealthEventsConfig = v - return s -} - -// SetAvailabilityScoreThreshold sets the AvailabilityScoreThreshold field's value. -func (s *HealthEventsConfig) SetAvailabilityScoreThreshold(v float64) *HealthEventsConfig { - s.AvailabilityScoreThreshold = &v - return s -} - -// SetPerformanceLocalHealthEventsConfig sets the PerformanceLocalHealthEventsConfig field's value. -func (s *HealthEventsConfig) SetPerformanceLocalHealthEventsConfig(v *LocalHealthEventsConfig) *HealthEventsConfig { - s.PerformanceLocalHealthEventsConfig = v - return s -} - -// SetPerformanceScoreThreshold sets the PerformanceScoreThreshold field's value. -func (s *HealthEventsConfig) SetPerformanceScoreThreshold(v float64) *HealthEventsConfig { - s.PerformanceScoreThreshold = &v - return s -} - -// Information about a location impacted by a health event in Amazon CloudWatch -// Internet Monitor. -// -// Geographic regions are hierarchically categorized into country, subdivision, -// metro and city geographic granularities. The geographic region is identified -// based on the IP address used at the client locations. -type ImpactedLocation struct { - _ struct{} `type:"structure"` - - // The name of the network at an impacted location. - // - // ASName is a required field - ASName *string `type:"string" required:"true"` - - // The Autonomous System Number (ASN) of the network at an impacted location. - // - // ASNumber is a required field - ASNumber *int64 `type:"long" required:"true"` - - // The cause of the impairment. There are two types of network impairments: - // Amazon Web Services network issues or internet issues. Internet issues are - // typically a problem with a network provider, like an internet service provider - // (ISP). - CausedBy *NetworkImpairment `type:"structure"` - - // The name of the city where the health event is located. - City *string `type:"string"` - - // The name of the country where the health event is located. - // - // Country is a required field - Country *string `type:"string" required:"true"` - - // The country code where the health event is located. The ISO 3166-2 codes - // for the country is provided, when available. - CountryCode *string `type:"string"` - - // The calculated health at a specific location. - InternetHealth *InternetHealth `type:"structure"` - - // The latitude where the health event is located. - Latitude *float64 `type:"double"` - - // The longitude where the health event is located. - Longitude *float64 `type:"double"` - - // The metro area where the health event is located. - // - // Metro indicates a metropolitan region in the United States, such as the region - // around New York City. In non-US countries, this is a second-level subdivision. - // For example, in the United Kingdom, it could be a county, a London borough, - // a unitary authority, council area, and so on. - Metro *string `type:"string"` - - // The service location where the health event is located. - ServiceLocation *string `type:"string"` - - // The status of the health event at an impacted location. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"HealthEventStatus"` - - // The subdivision location where the health event is located. The subdivision - // usually maps to states in most countries (including the United States). For - // United Kingdom, it maps to a country (England, Scotland, Wales) or province - // (Northern Ireland). - Subdivision *string `type:"string"` - - // The subdivision code where the health event is located. The ISO 3166-2 codes - // for country subdivisions is provided, when available. - SubdivisionCode *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 ImpactedLocation) 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 ImpactedLocation) GoString() string { - return s.String() -} - -// SetASName sets the ASName field's value. -func (s *ImpactedLocation) SetASName(v string) *ImpactedLocation { - s.ASName = &v - return s -} - -// SetASNumber sets the ASNumber field's value. -func (s *ImpactedLocation) SetASNumber(v int64) *ImpactedLocation { - s.ASNumber = &v - return s -} - -// SetCausedBy sets the CausedBy field's value. -func (s *ImpactedLocation) SetCausedBy(v *NetworkImpairment) *ImpactedLocation { - s.CausedBy = v - return s -} - -// SetCity sets the City field's value. -func (s *ImpactedLocation) SetCity(v string) *ImpactedLocation { - s.City = &v - return s -} - -// SetCountry sets the Country field's value. -func (s *ImpactedLocation) SetCountry(v string) *ImpactedLocation { - s.Country = &v - return s -} - -// SetCountryCode sets the CountryCode field's value. -func (s *ImpactedLocation) SetCountryCode(v string) *ImpactedLocation { - s.CountryCode = &v - return s -} - -// SetInternetHealth sets the InternetHealth field's value. -func (s *ImpactedLocation) SetInternetHealth(v *InternetHealth) *ImpactedLocation { - s.InternetHealth = v - return s -} - -// SetLatitude sets the Latitude field's value. -func (s *ImpactedLocation) SetLatitude(v float64) *ImpactedLocation { - s.Latitude = &v - return s -} - -// SetLongitude sets the Longitude field's value. -func (s *ImpactedLocation) SetLongitude(v float64) *ImpactedLocation { - s.Longitude = &v - return s -} - -// SetMetro sets the Metro field's value. -func (s *ImpactedLocation) SetMetro(v string) *ImpactedLocation { - s.Metro = &v - return s -} - -// SetServiceLocation sets the ServiceLocation field's value. -func (s *ImpactedLocation) SetServiceLocation(v string) *ImpactedLocation { - s.ServiceLocation = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImpactedLocation) SetStatus(v string) *ImpactedLocation { - s.Status = &v - return s -} - -// SetSubdivision sets the Subdivision field's value. -func (s *ImpactedLocation) SetSubdivision(v string) *ImpactedLocation { - s.Subdivision = &v - return s -} - -// SetSubdivisionCode sets the SubdivisionCode field's value. -func (s *ImpactedLocation) SetSubdivisionCode(v string) *ImpactedLocation { - s.SubdivisionCode = &v - return s -} - -// There was an internal server error. -type InternalServerErrorException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerErrorException) 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 InternalServerErrorException) GoString() string { - return s.String() -} - -func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { - return &InternalServerErrorException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerErrorException) Code() string { - return "InternalServerErrorException" -} - -// Message returns the exception's message. -func (s *InternalServerErrorException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerErrorException) OrigErr() error { - return nil -} - -func (s *InternalServerErrorException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerErrorException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerErrorException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An internal error occurred. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Internet health includes measurements calculated by Amazon CloudWatch Internet -// Monitor about the performance and availability for your application on the -// internet. Amazon Web Services has substantial historical data about internet -// performance and availability between Amazon Web Services services and different -// network providers and geographies. By applying statistical analysis to the -// data, Internet Monitor can detect when the performance and availability for -// your application has dropped, compared to an estimated baseline that's already -// calculated. To make it easier to see those drops, Internet Monitor reports -// the information to you in the form of health scores: a performance score -// and an availability score. -type InternetHealth struct { - _ struct{} `type:"structure"` - - // Availability in Internet Monitor represents the estimated percentage of traffic - // that is not seeing an availability drop. For example, an availability score - // of 99% for an end user and service location pair is equivalent to 1% of the - // traffic experiencing an availability drop for that pair. - // - // For more information, see How Internet Monitor calculates performance and - // availability scores (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMExperienceScores) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - Availability *AvailabilityMeasurement `type:"structure"` - - // Performance in Internet Monitor represents the estimated percentage of traffic - // that is not seeing a performance drop. For example, a performance score of - // 99% for an end user and service location pair is equivalent to 1% of the - // traffic experiencing a performance drop for that pair. - // - // For more information, see How Internet Monitor calculates performance and - // availability scores (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMExperienceScores) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - Performance *PerformanceMeasurement `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 InternetHealth) 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 InternetHealth) GoString() string { - return s.String() -} - -// SetAvailability sets the Availability field's value. -func (s *InternetHealth) SetAvailability(v *AvailabilityMeasurement) *InternetHealth { - s.Availability = v - return s -} - -// SetPerformance sets the Performance field's value. -func (s *InternetHealth) SetPerformance(v *PerformanceMeasurement) *InternetHealth { - s.Performance = v - return s -} - -// Publish internet measurements to an Amazon S3 bucket in addition to CloudWatch -// Logs. -type InternetMeasurementsLogDelivery struct { - _ struct{} `type:"structure"` - - // The configuration information for publishing Internet Monitor internet measurements - // to Amazon S3. The configuration includes the bucket name and (optionally) - // prefix for the S3 bucket to store the measurements, and the delivery status. - // The delivery status is ENABLED or DISABLED, depending on whether you choose - // to deliver internet measurements to S3 logs. - S3Config *S3Config `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 InternetMeasurementsLogDelivery) 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 InternetMeasurementsLogDelivery) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InternetMeasurementsLogDelivery) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InternetMeasurementsLogDelivery"} - if s.S3Config != nil { - if err := s.S3Config.Validate(); err != nil { - invalidParams.AddNested("S3Config", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Config sets the S3Config field's value. -func (s *InternetMeasurementsLogDelivery) SetS3Config(v *S3Config) *InternetMeasurementsLogDelivery { - s.S3Config = v - return s -} - -// The request exceeded a service quota. -type LimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 LimitExceededException) 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 LimitExceededException) GoString() string { - return s.String() -} - -func newErrorLimitExceededException(v protocol.ResponseMetadata) error { - return &LimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *LimitExceededException) Code() string { - return "LimitExceededException" -} - -// Message returns the exception's message. -func (s *LimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *LimitExceededException) OrigErr() error { - return nil -} - -func (s *LimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *LimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *LimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListHealthEventsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The time when a health event ended. If the health event is still ongoing, - // then the end time is not set. - EndTime *time.Time `location:"querystring" locationName:"EndTime" type:"timestamp" timestampFormat:"iso8601"` - - // The status of a health event. - EventStatus *string `location:"querystring" locationName:"EventStatus" type:"string" enum:"HealthEventStatus"` - - // The number of health event objects that you want to return with this call. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" type:"string" required:"true"` - - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` - - // The time when a health event started. - StartTime *time.Time `location:"querystring" locationName:"StartTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 ListHealthEventsInput) 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 ListHealthEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListHealthEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListHealthEventsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *ListHealthEventsInput) SetEndTime(v time.Time) *ListHealthEventsInput { - s.EndTime = &v - return s -} - -// SetEventStatus sets the EventStatus field's value. -func (s *ListHealthEventsInput) SetEventStatus(v string) *ListHealthEventsInput { - s.EventStatus = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListHealthEventsInput) SetMaxResults(v int64) *ListHealthEventsInput { - s.MaxResults = &v - return s -} - -// SetMonitorName sets the MonitorName field's value. -func (s *ListHealthEventsInput) SetMonitorName(v string) *ListHealthEventsInput { - s.MonitorName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListHealthEventsInput) SetNextToken(v string) *ListHealthEventsInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ListHealthEventsInput) SetStartTime(v time.Time) *ListHealthEventsInput { - s.StartTime = &v - return s -} - -type ListHealthEventsOutput struct { - _ struct{} `type:"structure"` - - // A list of health events. - // - // HealthEvents is a required field - HealthEvents []*HealthEvent `type:"list" required:"true"` - - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *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 ListHealthEventsOutput) 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 ListHealthEventsOutput) GoString() string { - return s.String() -} - -// SetHealthEvents sets the HealthEvents field's value. -func (s *ListHealthEventsOutput) SetHealthEvents(v []*HealthEvent) *ListHealthEventsOutput { - s.HealthEvents = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListHealthEventsOutput) SetNextToken(v string) *ListHealthEventsOutput { - s.NextToken = &v - return s -} - -type ListMonitorsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The number of monitor objects that you want to return with this call. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // The status of a monitor. This includes the status of the data processing - // for the monitor and the status of the monitor itself. - // - // For information about the statuses for a monitor, see Monitor (https://docs.aws.amazon.com/internet-monitor/latest/api/API_Monitor.html). - MonitorStatus *string `location:"querystring" locationName:"MonitorStatus" type:"string"` - - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `location:"querystring" locationName:"NextToken" 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 ListMonitorsInput) 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 ListMonitorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMonitorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMonitorsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListMonitorsInput) SetMaxResults(v int64) *ListMonitorsInput { - s.MaxResults = &v - return s -} - -// SetMonitorStatus sets the MonitorStatus field's value. -func (s *ListMonitorsInput) SetMonitorStatus(v string) *ListMonitorsInput { - s.MonitorStatus = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMonitorsInput) SetNextToken(v string) *ListMonitorsInput { - s.NextToken = &v - return s -} - -type ListMonitorsOutput struct { - _ struct{} `type:"structure"` - - // A list of monitors. - // - // Monitors is a required field - Monitors []*Monitor `type:"list" required:"true"` - - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *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 ListMonitorsOutput) 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 ListMonitorsOutput) GoString() string { - return s.String() -} - -// SetMonitors sets the Monitors field's value. -func (s *ListMonitorsOutput) SetMonitors(v []*Monitor) *ListMonitorsOutput { - s.Monitors = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMonitorsOutput) SetNextToken(v string) *ListMonitorsOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) for a resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"20" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // Tags for a resource. - Tags map[string]*string `type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// A complex type with the configuration information that determines the threshold -// and other conditions for when Internet Monitor creates a health event for -// a local performance or availability issue, when scores cross a threshold -// for one or more city-networks. -// -// Defines the percentages, for performance scores or availability scores, that -// are the local thresholds for when Amazon CloudWatch Internet Monitor creates -// a health event. Also defines whether a local threshold is enabled or disabled, -// and the minimum percentage of overall traffic that must be impacted by an -// issue before Internet Monitor creates an event when a threshold is crossed -// for a local health score. -// -// If you don't set a local health event threshold, the default value is 60%. -// -// For more information, see Change health event thresholds (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview) -// in the Internet Monitor section of the CloudWatch User Guide. -type LocalHealthEventsConfig struct { - _ struct{} `type:"structure"` - - // The health event threshold percentage set for a local health score. - HealthScoreThreshold *float64 `type:"double"` - - // The minimum percentage of overall traffic for an application that must be - // impacted by an issue before Internet Monitor creates an event when a threshold - // is crossed for a local health score. - // - // If you don't set a minimum traffic impact threshold, the default value is - // 0.01%. - MinTrafficImpact *float64 `type:"double"` - - // The status of whether Internet Monitor creates a health event based on a - // threshold percentage set for a local health score. The status can be ENABLED - // or DISABLED. - Status *string `type:"string" enum:"LocalHealthEventsConfigStatus"` -} - -// 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 LocalHealthEventsConfig) 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 LocalHealthEventsConfig) GoString() string { - return s.String() -} - -// SetHealthScoreThreshold sets the HealthScoreThreshold field's value. -func (s *LocalHealthEventsConfig) SetHealthScoreThreshold(v float64) *LocalHealthEventsConfig { - s.HealthScoreThreshold = &v - return s -} - -// SetMinTrafficImpact sets the MinTrafficImpact field's value. -func (s *LocalHealthEventsConfig) SetMinTrafficImpact(v float64) *LocalHealthEventsConfig { - s.MinTrafficImpact = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *LocalHealthEventsConfig) SetStatus(v string) *LocalHealthEventsConfig { - s.Status = &v - return s -} - -// The description of and information about a monitor in Amazon CloudWatch Internet -// Monitor. -type Monitor struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the monitor. - // - // MonitorArn is a required field - MonitorArn *string `min:"20" type:"string" required:"true"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `min:"1" type:"string" required:"true"` - - // The health of data processing for the monitor. - ProcessingStatus *string `type:"string" enum:"MonitorProcessingStatusCode"` - - // The status of a monitor. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"MonitorConfigState"` -} - -// 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 Monitor) 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 Monitor) GoString() string { - return s.String() -} - -// SetMonitorArn sets the MonitorArn field's value. -func (s *Monitor) SetMonitorArn(v string) *Monitor { - s.MonitorArn = &v - return s -} - -// SetMonitorName sets the MonitorName field's value. -func (s *Monitor) SetMonitorName(v string) *Monitor { - s.MonitorName = &v - return s -} - -// SetProcessingStatus sets the ProcessingStatus field's value. -func (s *Monitor) SetProcessingStatus(v string) *Monitor { - s.ProcessingStatus = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Monitor) SetStatus(v string) *Monitor { - s.Status = &v - return s -} - -// An internet service provider (ISP) or network in Amazon CloudWatch Internet -// Monitor. -type Network struct { - _ struct{} `type:"structure"` - - // The internet provider name or network name. - // - // ASName is a required field - ASName *string `type:"string" required:"true"` - - // The Autonomous System Number (ASN) of the internet provider or network. - // - // ASNumber is a required field - ASNumber *int64 `type:"long" 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 Network) 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 Network) GoString() string { - return s.String() -} - -// SetASName sets the ASName field's value. -func (s *Network) SetASName(v string) *Network { - s.ASName = &v - return s -} - -// SetASNumber sets the ASNumber field's value. -func (s *Network) SetASNumber(v int64) *Network { - s.ASNumber = &v - return s -} - -// Information about the network impairment for a specific network measured -// by Amazon CloudWatch Internet Monitor. -type NetworkImpairment struct { - _ struct{} `type:"structure"` - - // The combination of the Autonomous System Number (ASN) of the network and - // the name of the network. - // - // AsPath is a required field - AsPath []*Network `type:"list" required:"true"` - - // Type of network impairment. - // - // NetworkEventType is a required field - NetworkEventType *string `type:"string" required:"true" enum:"TriangulationEventType"` - - // The networks that could be impacted by a network impairment event. - // - // Networks is a required field - Networks []*Network `type:"list" 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 NetworkImpairment) 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 NetworkImpairment) GoString() string { - return s.String() -} - -// SetAsPath sets the AsPath field's value. -func (s *NetworkImpairment) SetAsPath(v []*Network) *NetworkImpairment { - s.AsPath = v - return s -} - -// SetNetworkEventType sets the NetworkEventType field's value. -func (s *NetworkImpairment) SetNetworkEventType(v string) *NetworkImpairment { - s.NetworkEventType = &v - return s -} - -// SetNetworks sets the Networks field's value. -func (s *NetworkImpairment) SetNetworks(v []*Network) *NetworkImpairment { - s.Networks = v - return s -} - -// The request specifies something that doesn't exist. -type NotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 NotFoundException) 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 NotFoundException) GoString() string { - return s.String() -} - -func newErrorNotFoundException(v protocol.ResponseMetadata) error { - return &NotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *NotFoundException) Code() string { - return "NotFoundException" -} - -// Message returns the exception's message. -func (s *NotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *NotFoundException) OrigErr() error { - return nil -} - -func (s *NotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *NotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *NotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Amazon CloudWatch Internet Monitor calculates measurements about the performance -// for your application's internet traffic between client locations and Amazon -// Web Services. Amazon Web Services has substantial historical data about internet -// performance and availability between Amazon Web Services services and different -// network providers and geographies. By applying statistical analysis to the -// data, Internet Monitor can detect when the performance and availability for -// your application has dropped, compared to an estimated baseline that's already -// calculated. To make it easier to see those drops, we report that information -// to you in the form of health scores: a performance score and an availability -// score. -// -// Performance in Internet Monitor represents the estimated percentage of traffic -// that is not seeing a performance drop. For example, a performance score of -// 99% for an end user and service location pair is equivalent to 1% of the -// traffic experiencing a performance drop for that pair. -// -// For more information, see How Internet Monitor calculates performance and -// availability scores (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMExperienceScores) -// in the Amazon CloudWatch Internet Monitor section of the CloudWatch User -// Guide. -type PerformanceMeasurement struct { - _ struct{} `type:"structure"` - - // Experience scores, or health scores, are calculated for different geographic - // and network provider combinations (that is, different granularities) and - // also totaled into global scores. If you view performance or availability - // scores without filtering for any specific geography or service provider, - // Amazon CloudWatch Internet Monitor provides global health scores. - // - // The Amazon CloudWatch Internet Monitor chapter in the CloudWatch User Guide - // includes detailed information about how Internet Monitor calculates health - // scores, including performance and availability scores, and when it creates - // and resolves health events. For more information, see How Amazon Web Services - // calculates performance and availability scores (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMExperienceScores) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - ExperienceScore *float64 `type:"double"` - - // How much performance impact was caused by a health event at a client location. - // For performance, this is the percentage of how much latency increased during - // the event compared to typical performance for traffic, from this client location - // to an Amazon Web Services location, using a specific client network. - // - // For more information, see When Amazon Web Services creates and resolves health - // events (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMHealthEventStartStop) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - PercentOfClientLocationImpacted *float64 `type:"double"` - - // The impact on total traffic that a health event has, in increased latency - // or reduced availability. This is the percentage of how much latency has increased - // or availability has decreased during the event, compared to what is typical - // for traffic from this client location to the Amazon Web Services location - // using this client network. - // - // For more information, see When Amazon Web Services creates and resolves health - // events (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMHealthEventStartStop) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - PercentOfTotalTrafficImpacted *float64 `type:"double"` - - // This is the percentage of how much round-trip time increased during the event - // compared to typical round-trip time for your application for traffic. - // - // For more information, see When Amazon Web Services creates and resolves health - // events (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-inside-internet-monitor.html#IMHealthEventStartStop) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - RoundTripTime *RoundTripTime `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 PerformanceMeasurement) 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 PerformanceMeasurement) GoString() string { - return s.String() -} - -// SetExperienceScore sets the ExperienceScore field's value. -func (s *PerformanceMeasurement) SetExperienceScore(v float64) *PerformanceMeasurement { - s.ExperienceScore = &v - return s -} - -// SetPercentOfClientLocationImpacted sets the PercentOfClientLocationImpacted field's value. -func (s *PerformanceMeasurement) SetPercentOfClientLocationImpacted(v float64) *PerformanceMeasurement { - s.PercentOfClientLocationImpacted = &v - return s -} - -// SetPercentOfTotalTrafficImpacted sets the PercentOfTotalTrafficImpacted field's value. -func (s *PerformanceMeasurement) SetPercentOfTotalTrafficImpacted(v float64) *PerformanceMeasurement { - s.PercentOfTotalTrafficImpacted = &v - return s -} - -// SetRoundTripTime sets the RoundTripTime field's value. -func (s *PerformanceMeasurement) SetRoundTripTime(v *RoundTripTime) *PerformanceMeasurement { - s.RoundTripTime = v - return s -} - -// Defines a field to query for your application's Amazon CloudWatch Internet -// Monitor data. You create a data repository by running a query of a specific -// type. Each QueryType includes a specific set of fields and datatypes to retrieve -// data for. -type QueryField struct { - _ struct{} `type:"structure"` - - // The name of a field to query your application's Amazon CloudWatch Internet - // Monitor data for, such as availability_score. - Name *string `type:"string"` - - // The data type for a query field, which must correspond to the field you're - // defining for QueryField. For example, if the query field name is availability_score, - // the data type is float. - Type *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 QueryField) 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 QueryField) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *QueryField) SetName(v string) *QueryField { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *QueryField) SetType(v string) *QueryField { - s.Type = &v - return s -} - -// The request specifies a resource that doesn't exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Round-trip time (RTT) is how long it takes for a request from the user to -// return a response to the user. Amazon CloudWatch Internet Monitor calculates -// RTT at different percentiles: p50, p90, and p95. -type RoundTripTime struct { - _ struct{} `type:"structure"` - - // RTT at the 50th percentile (p50). - P50 *float64 `type:"double"` - - // RTT at the 90th percentile (p90). - P90 *float64 `type:"double"` - - // RTT at the 95th percentile (p95). - P95 *float64 `type:"double"` -} - -// 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 RoundTripTime) 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 RoundTripTime) GoString() string { - return s.String() -} - -// SetP50 sets the P50 field's value. -func (s *RoundTripTime) SetP50(v float64) *RoundTripTime { - s.P50 = &v - return s -} - -// SetP90 sets the P90 field's value. -func (s *RoundTripTime) SetP90(v float64) *RoundTripTime { - s.P90 = &v - return s -} - -// SetP95 sets the P95 field's value. -func (s *RoundTripTime) SetP95(v float64) *RoundTripTime { - s.P95 = &v - return s -} - -// The configuration for publishing Amazon CloudWatch Internet Monitor internet -// measurements to Amazon S3. The configuration includes the bucket name and -// (optionally) prefix for the S3 bucket to store the measurements, and the -// delivery status. The delivery status is ENABLED or DISABLED, depending on -// whether you choose to deliver internet measurements to S3 logs. -type S3Config struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket name. - BucketName *string `min:"3" type:"string"` - - // The Amazon S3 bucket prefix. - BucketPrefix *string `type:"string"` - - // The status of publishing Internet Monitor internet measurements to an Amazon - // S3 bucket. - LogDeliveryStatus *string `type:"string" enum:"LogDeliveryStatus"` -} - -// 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 S3Config) 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 S3Config) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Config) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Config"} - if s.BucketName != nil && len(*s.BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BucketName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3Config) SetBucketName(v string) *S3Config { - s.BucketName = &v - return s -} - -// SetBucketPrefix sets the BucketPrefix field's value. -func (s *S3Config) SetBucketPrefix(v string) *S3Config { - s.BucketPrefix = &v - return s -} - -// SetLogDeliveryStatus sets the LogDeliveryStatus field's value. -func (s *S3Config) SetLogDeliveryStatus(v string) *S3Config { - s.LogDeliveryStatus = &v - return s -} - -type StartQueryInput struct { - _ struct{} `type:"structure"` - - // The timestamp that is the end of the period that you want to retrieve data - // for with your query. - // - // EndTime is a required field - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The FilterParameters field that you use with Amazon CloudWatch Internet Monitor - // queries is a string the defines how you want a query to be filtered. The - // filter parameters that you can specify depend on the query type, since each - // query type returns a different set of Internet Monitor data. - // - // For more information about specifying filter parameters, see Using the Amazon - // CloudWatch Internet Monitor query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) - // in the Amazon CloudWatch Internet Monitor User Guide. - FilterParameters []*FilterParameter `type:"list"` - - // The name of the monitor to query. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" type:"string" required:"true"` - - // The type of query to run. The following are the three types of queries that - // you can run using the Internet Monitor query interface: - // - // * MEASUREMENTS: TBD definition - // - // * TOP_LOCATIONS: TBD definition - // - // * TOP_LOCATION_DETAILS: TBD definition - // - // For lists of the fields returned with each query type and more information - // about how each type of query is performed, see Using the Amazon CloudWatch - // Internet Monitor query interface (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-view-cw-tools-cwim-query.html) - // in the Amazon CloudWatch Internet Monitor User Guide. - // - // QueryType is a required field - QueryType *string `type:"string" required:"true" enum:"QueryType"` - - // The timestamp that is the beginning of the period that you want to retrieve - // data for with your query. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" 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 StartQueryInput) 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 StartQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartQueryInput"} - if s.EndTime == nil { - invalidParams.Add(request.NewErrParamRequired("EndTime")) - } - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - if s.QueryType == nil { - invalidParams.Add(request.NewErrParamRequired("QueryType")) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *StartQueryInput) SetEndTime(v time.Time) *StartQueryInput { - s.EndTime = &v - return s -} - -// SetFilterParameters sets the FilterParameters field's value. -func (s *StartQueryInput) SetFilterParameters(v []*FilterParameter) *StartQueryInput { - s.FilterParameters = v - return s -} - -// SetMonitorName sets the MonitorName field's value. -func (s *StartQueryInput) SetMonitorName(v string) *StartQueryInput { - s.MonitorName = &v - return s -} - -// SetQueryType sets the QueryType field's value. -func (s *StartQueryInput) SetQueryType(v string) *StartQueryInput { - s.QueryType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *StartQueryInput) SetStartTime(v time.Time) *StartQueryInput { - s.StartTime = &v - return s -} - -type StartQueryOutput struct { - _ struct{} `type:"structure"` - - // The internally-generated identifier of a specific query. - // - // QueryId is a required field - QueryId *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 StartQueryOutput) 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 StartQueryOutput) GoString() string { - return s.String() -} - -// SetQueryId sets the QueryId field's value. -func (s *StartQueryOutput) SetQueryId(v string) *StartQueryOutput { - s.QueryId = &v - return s -} - -type StopQueryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" type:"string" required:"true"` - - // The ID of the query that you want to stop. A QueryId is an internally-generated - // identifier for a specific query. - // - // QueryId is a required field - QueryId *string `location:"uri" locationName:"QueryId" 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 StopQueryInput) 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 StopQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopQueryInput"} - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMonitorName sets the MonitorName field's value. -func (s *StopQueryInput) SetMonitorName(v string) *StopQueryInput { - s.MonitorName = &v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *StopQueryInput) SetQueryId(v string) *StopQueryInput { - s.QueryId = &v - return s -} - -type StopQueryOutput 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 StopQueryOutput) 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 StopQueryOutput) GoString() string { - return s.String() -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for a tag that you add to a resource. Tags - // are supported only for monitors in Amazon CloudWatch Internet Monitor. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"20" type:"string" required:"true"` - - // Tags that you add to a resource. You can add a maximum of 50 tags in Internet - // Monitor. - // - // Tags is a required field - Tags map[string]*string `type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// There were too many requests. -type TooManyRequestsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 TooManyRequestsException) 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 TooManyRequestsException) GoString() string { - return s.String() -} - -func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { - return &TooManyRequestsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyRequestsException) Code() string { - return "TooManyRequestsException" -} - -// Message returns the exception's message. -func (s *TooManyRequestsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyRequestsException) OrigErr() error { - return nil -} - -func (s *TooManyRequestsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyRequestsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyRequestsException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) for a tag you remove a resource from. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"20" type:"string" required:"true"` - - // Tag keys that you remove from a resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateMonitorInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive string of up to 64 ASCII characters that you specify - // to make an idempotent API request. You should not reuse the same client token - // for other API requests. - ClientToken *string `type:"string" idempotencyToken:"true"` - - // The list of health score thresholds. A threshold percentage for health scores, - // along with other configuration information, determines when Internet Monitor - // creates a health event when there's an internet issue that affects your application - // end users. - // - // For more information, see Change health event thresholds (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-IM-overview.html#IMUpdateThresholdFromOverview) - // in the Internet Monitor section of the CloudWatch User Guide. - HealthEventsConfig *HealthEventsConfig `type:"structure"` - - // Publish internet measurements for Internet Monitor to another location, such - // as an Amazon S3 bucket. The measurements are also published to Amazon CloudWatch - // Logs. - InternetMeasurementsLogDelivery *InternetMeasurementsLogDelivery `type:"structure"` - - // The maximum number of city-networks to monitor for your application. A city-network - // is the location (city) where clients access your application resources from - // and the ASN or network provider, such as an internet service provider (ISP), - // that clients access the resources through. Setting this limit can help control - // billing costs. - MaxCityNetworksToMonitor *int64 `min:"1" type:"integer"` - - // The name of the monitor. - // - // MonitorName is a required field - MonitorName *string `location:"uri" locationName:"MonitorName" min:"1" type:"string" required:"true"` - - // The resources to include in a monitor, which you provide as a set of Amazon - // Resource Names (ARNs). Resources can be VPCs, NLBs, Amazon CloudFront distributions, - // or Amazon WorkSpaces directories. - // - // You can add a combination of VPCs and CloudFront distributions, or you can - // add WorkSpaces directories, or you can add NLBs. You can't add NLBs or WorkSpaces - // directories together with any other resources. - // - // If you add only Amazon Virtual Private Clouds resources, at least one VPC - // must have an Internet Gateway attached to it, to make sure that it has internet - // connectivity. - ResourcesToAdd []*string `type:"list"` - - // The resources to remove from a monitor, which you provide as a set of Amazon - // Resource Names (ARNs). - ResourcesToRemove []*string `type:"list"` - - // The status for a monitor. The accepted values for Status with the UpdateMonitor - // API call are the following: ACTIVE and INACTIVE. The following values are - // not accepted: PENDING, and ERROR. - Status *string `type:"string" enum:"MonitorConfigState"` - - // The percentage of the internet-facing traffic for your application that you - // want to monitor with this monitor. If you set a city-networks maximum, that - // limit overrides the traffic percentage that you set. - // - // To learn more, see Choosing an application traffic percentage to monitor - // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMTrafficPercentage.html) - // in the Amazon CloudWatch Internet Monitor section of the CloudWatch User - // Guide. - TrafficPercentageToMonitor *int64 `min:"1" 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 UpdateMonitorInput) 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 UpdateMonitorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateMonitorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateMonitorInput"} - if s.MaxCityNetworksToMonitor != nil && *s.MaxCityNetworksToMonitor < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxCityNetworksToMonitor", 1)) - } - if s.MonitorName == nil { - invalidParams.Add(request.NewErrParamRequired("MonitorName")) - } - if s.MonitorName != nil && len(*s.MonitorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MonitorName", 1)) - } - if s.TrafficPercentageToMonitor != nil && *s.TrafficPercentageToMonitor < 1 { - invalidParams.Add(request.NewErrParamMinValue("TrafficPercentageToMonitor", 1)) - } - if s.InternetMeasurementsLogDelivery != nil { - if err := s.InternetMeasurementsLogDelivery.Validate(); err != nil { - invalidParams.AddNested("InternetMeasurementsLogDelivery", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateMonitorInput) SetClientToken(v string) *UpdateMonitorInput { - s.ClientToken = &v - return s -} - -// SetHealthEventsConfig sets the HealthEventsConfig field's value. -func (s *UpdateMonitorInput) SetHealthEventsConfig(v *HealthEventsConfig) *UpdateMonitorInput { - s.HealthEventsConfig = v - return s -} - -// SetInternetMeasurementsLogDelivery sets the InternetMeasurementsLogDelivery field's value. -func (s *UpdateMonitorInput) SetInternetMeasurementsLogDelivery(v *InternetMeasurementsLogDelivery) *UpdateMonitorInput { - s.InternetMeasurementsLogDelivery = v - return s -} - -// SetMaxCityNetworksToMonitor sets the MaxCityNetworksToMonitor field's value. -func (s *UpdateMonitorInput) SetMaxCityNetworksToMonitor(v int64) *UpdateMonitorInput { - s.MaxCityNetworksToMonitor = &v - return s -} - -// SetMonitorName sets the MonitorName field's value. -func (s *UpdateMonitorInput) SetMonitorName(v string) *UpdateMonitorInput { - s.MonitorName = &v - return s -} - -// SetResourcesToAdd sets the ResourcesToAdd field's value. -func (s *UpdateMonitorInput) SetResourcesToAdd(v []*string) *UpdateMonitorInput { - s.ResourcesToAdd = v - return s -} - -// SetResourcesToRemove sets the ResourcesToRemove field's value. -func (s *UpdateMonitorInput) SetResourcesToRemove(v []*string) *UpdateMonitorInput { - s.ResourcesToRemove = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateMonitorInput) SetStatus(v string) *UpdateMonitorInput { - s.Status = &v - return s -} - -// SetTrafficPercentageToMonitor sets the TrafficPercentageToMonitor field's value. -func (s *UpdateMonitorInput) SetTrafficPercentageToMonitor(v int64) *UpdateMonitorInput { - s.TrafficPercentageToMonitor = &v - return s -} - -type UpdateMonitorOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the monitor. - // - // MonitorArn is a required field - MonitorArn *string `min:"20" type:"string" required:"true"` - - // The status of a monitor. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"MonitorConfigState"` -} - -// 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 UpdateMonitorOutput) 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 UpdateMonitorOutput) GoString() string { - return s.String() -} - -// SetMonitorArn sets the MonitorArn field's value. -func (s *UpdateMonitorOutput) SetMonitorArn(v string) *UpdateMonitorOutput { - s.MonitorArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateMonitorOutput) SetStatus(v string) *UpdateMonitorOutput { - s.Status = &v - return s -} - -// Invalid request. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // HealthEventImpactTypeAvailability is a HealthEventImpactType enum value - HealthEventImpactTypeAvailability = "AVAILABILITY" - - // HealthEventImpactTypePerformance is a HealthEventImpactType enum value - HealthEventImpactTypePerformance = "PERFORMANCE" - - // HealthEventImpactTypeLocalAvailability is a HealthEventImpactType enum value - HealthEventImpactTypeLocalAvailability = "LOCAL_AVAILABILITY" - - // HealthEventImpactTypeLocalPerformance is a HealthEventImpactType enum value - HealthEventImpactTypeLocalPerformance = "LOCAL_PERFORMANCE" -) - -// HealthEventImpactType_Values returns all elements of the HealthEventImpactType enum -func HealthEventImpactType_Values() []string { - return []string{ - HealthEventImpactTypeAvailability, - HealthEventImpactTypePerformance, - HealthEventImpactTypeLocalAvailability, - HealthEventImpactTypeLocalPerformance, - } -} - -const ( - // HealthEventStatusActive is a HealthEventStatus enum value - HealthEventStatusActive = "ACTIVE" - - // HealthEventStatusResolved is a HealthEventStatus enum value - HealthEventStatusResolved = "RESOLVED" -) - -// HealthEventStatus_Values returns all elements of the HealthEventStatus enum -func HealthEventStatus_Values() []string { - return []string{ - HealthEventStatusActive, - HealthEventStatusResolved, - } -} - -const ( - // LocalHealthEventsConfigStatusEnabled is a LocalHealthEventsConfigStatus enum value - LocalHealthEventsConfigStatusEnabled = "ENABLED" - - // LocalHealthEventsConfigStatusDisabled is a LocalHealthEventsConfigStatus enum value - LocalHealthEventsConfigStatusDisabled = "DISABLED" -) - -// LocalHealthEventsConfigStatus_Values returns all elements of the LocalHealthEventsConfigStatus enum -func LocalHealthEventsConfigStatus_Values() []string { - return []string{ - LocalHealthEventsConfigStatusEnabled, - LocalHealthEventsConfigStatusDisabled, - } -} - -const ( - // LogDeliveryStatusEnabled is a LogDeliveryStatus enum value - LogDeliveryStatusEnabled = "ENABLED" - - // LogDeliveryStatusDisabled is a LogDeliveryStatus enum value - LogDeliveryStatusDisabled = "DISABLED" -) - -// LogDeliveryStatus_Values returns all elements of the LogDeliveryStatus enum -func LogDeliveryStatus_Values() []string { - return []string{ - LogDeliveryStatusEnabled, - LogDeliveryStatusDisabled, - } -} - -const ( - // MonitorConfigStatePending is a MonitorConfigState enum value - MonitorConfigStatePending = "PENDING" - - // MonitorConfigStateActive is a MonitorConfigState enum value - MonitorConfigStateActive = "ACTIVE" - - // MonitorConfigStateInactive is a MonitorConfigState enum value - MonitorConfigStateInactive = "INACTIVE" - - // MonitorConfigStateError is a MonitorConfigState enum value - MonitorConfigStateError = "ERROR" -) - -// MonitorConfigState_Values returns all elements of the MonitorConfigState enum -func MonitorConfigState_Values() []string { - return []string{ - MonitorConfigStatePending, - MonitorConfigStateActive, - MonitorConfigStateInactive, - MonitorConfigStateError, - } -} - -const ( - // MonitorProcessingStatusCodeOk is a MonitorProcessingStatusCode enum value - MonitorProcessingStatusCodeOk = "OK" - - // MonitorProcessingStatusCodeInactive is a MonitorProcessingStatusCode enum value - MonitorProcessingStatusCodeInactive = "INACTIVE" - - // MonitorProcessingStatusCodeCollectingData is a MonitorProcessingStatusCode enum value - MonitorProcessingStatusCodeCollectingData = "COLLECTING_DATA" - - // MonitorProcessingStatusCodeInsufficientData is a MonitorProcessingStatusCode enum value - MonitorProcessingStatusCodeInsufficientData = "INSUFFICIENT_DATA" - - // MonitorProcessingStatusCodeFaultService is a MonitorProcessingStatusCode enum value - MonitorProcessingStatusCodeFaultService = "FAULT_SERVICE" - - // MonitorProcessingStatusCodeFaultAccessCloudwatch is a MonitorProcessingStatusCode enum value - MonitorProcessingStatusCodeFaultAccessCloudwatch = "FAULT_ACCESS_CLOUDWATCH" -) - -// MonitorProcessingStatusCode_Values returns all elements of the MonitorProcessingStatusCode enum -func MonitorProcessingStatusCode_Values() []string { - return []string{ - MonitorProcessingStatusCodeOk, - MonitorProcessingStatusCodeInactive, - MonitorProcessingStatusCodeCollectingData, - MonitorProcessingStatusCodeInsufficientData, - MonitorProcessingStatusCodeFaultService, - MonitorProcessingStatusCodeFaultAccessCloudwatch, - } -} - -const ( - // OperatorEquals is a Operator enum value - OperatorEquals = "EQUALS" - - // OperatorNotEquals is a Operator enum value - OperatorNotEquals = "NOT_EQUALS" -) - -// Operator_Values returns all elements of the Operator enum -func Operator_Values() []string { - return []string{ - OperatorEquals, - OperatorNotEquals, - } -} - -const ( - // QueryStatusQueued is a QueryStatus enum value - QueryStatusQueued = "QUEUED" - - // QueryStatusRunning is a QueryStatus enum value - QueryStatusRunning = "RUNNING" - - // QueryStatusSucceeded is a QueryStatus enum value - QueryStatusSucceeded = "SUCCEEDED" - - // QueryStatusFailed is a QueryStatus enum value - QueryStatusFailed = "FAILED" - - // QueryStatusCanceled is a QueryStatus enum value - QueryStatusCanceled = "CANCELED" -) - -// QueryStatus_Values returns all elements of the QueryStatus enum -func QueryStatus_Values() []string { - return []string{ - QueryStatusQueued, - QueryStatusRunning, - QueryStatusSucceeded, - QueryStatusFailed, - QueryStatusCanceled, - } -} - -const ( - // QueryTypeMeasurements is a QueryType enum value - QueryTypeMeasurements = "MEASUREMENTS" - - // QueryTypeTopLocations is a QueryType enum value - QueryTypeTopLocations = "TOP_LOCATIONS" - - // QueryTypeTopLocationDetails is a QueryType enum value - QueryTypeTopLocationDetails = "TOP_LOCATION_DETAILS" -) - -// QueryType_Values returns all elements of the QueryType enum -func QueryType_Values() []string { - return []string{ - QueryTypeMeasurements, - QueryTypeTopLocations, - QueryTypeTopLocationDetails, - } -} - -const ( - // TriangulationEventTypeAws is a TriangulationEventType enum value - TriangulationEventTypeAws = "AWS" - - // TriangulationEventTypeInternet is a TriangulationEventType enum value - TriangulationEventTypeInternet = "Internet" -) - -// TriangulationEventType_Values returns all elements of the TriangulationEventType enum -func TriangulationEventType_Values() []string { - return []string{ - TriangulationEventTypeAws, - TriangulationEventTypeInternet, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/doc.go deleted file mode 100644 index 8359c64060cc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/doc.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package internetmonitor provides the client and types for making API -// requests to Amazon CloudWatch Internet Monitor. -// -// Amazon CloudWatch Internet Monitor provides visibility into how internet -// issues impact the performance and availability between your applications -// hosted on Amazon Web Services and your end users. It can reduce the time -// it takes for you to diagnose internet issues from days to minutes. Internet -// Monitor uses the connectivity data that Amazon Web Services captures from -// its global networking footprint to calculate a baseline of performance and -// availability for internet traffic. This is the same data that Amazon Web -// Services uses to monitor internet uptime and availability. With those measurements -// as a baseline, Internet Monitor raises awareness for you when there are significant -// problems for your end users in the different geographic locations where your -// application runs. -// -// Internet Monitor publishes internet measurements to CloudWatch Logs and CloudWatch -// Metrics, to easily support using CloudWatch tools with health information -// for geographies and networks specific to your application. Internet Monitor -// sends health events to Amazon EventBridge so that you can set up notifications. -// If an issue is caused by the Amazon Web Services network, you also automatically -// receive an Amazon Web Services Health Dashboard notification with the steps -// that Amazon Web Services is taking to mitigate the problem. -// -// To use Internet Monitor, you create a monitor and associate your application's -// resources with it - VPCs, NLBs, CloudFront distributions, or WorkSpaces directories -// - so Internet Monitor can determine where your application's internet traffic -// is. Internet Monitor then provides internet measurements from Amazon Web -// Services that are specific to the locations and ASNs (typically, internet -// service providers or ISPs) that communicate with your application. -// -// For more information, see Using Amazon CloudWatch Internet Monitor (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-InternetMonitor.html) -// in the Amazon CloudWatch User Guide. -// -// See https://docs.aws.amazon.com/goto/WebAPI/internetmonitor-2021-06-03 for more information on this service. -// -// See internetmonitor package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/internetmonitor/ -// -// # Using the Client -// -// To contact Amazon CloudWatch Internet Monitor with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon CloudWatch Internet Monitor client InternetMonitor for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/internetmonitor/#New -package internetmonitor diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/errors.go deleted file mode 100644 index 661175e99b03..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/errors.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package internetmonitor - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have sufficient permission to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeBadRequestException for service response error code - // "BadRequestException". - // - // A bad request was received. - ErrCodeBadRequestException = "BadRequestException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The requested resource is in use. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerErrorException for service response error code - // "InternalServerErrorException". - // - // There was an internal server error. - ErrCodeInternalServerErrorException = "InternalServerErrorException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An internal error occurred. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // The request exceeded a service quota. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeNotFoundException for service response error code - // "NotFoundException". - // - // The request specifies something that doesn't exist. - ErrCodeNotFoundException = "NotFoundException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request specifies a resource that doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeTooManyRequestsException for service response error code - // "TooManyRequestsException". - // - // There were too many requests. - ErrCodeTooManyRequestsException = "TooManyRequestsException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Invalid request. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "BadRequestException": newErrorBadRequestException, - "ConflictException": newErrorConflictException, - "InternalServerErrorException": newErrorInternalServerErrorException, - "InternalServerException": newErrorInternalServerException, - "LimitExceededException": newErrorLimitExceededException, - "NotFoundException": newErrorNotFoundException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "TooManyRequestsException": newErrorTooManyRequestsException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/internetmonitoriface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/internetmonitoriface/interface.go deleted file mode 100644 index 177fc5816b08..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/internetmonitoriface/interface.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package internetmonitoriface provides an interface to enable mocking the Amazon CloudWatch Internet Monitor service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package internetmonitoriface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor" -) - -// InternetMonitorAPI provides an interface to enable mocking the -// internetmonitor.InternetMonitor service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon CloudWatch Internet Monitor. -// func myFunc(svc internetmonitoriface.InternetMonitorAPI) bool { -// // Make svc.CreateMonitor request -// } -// -// func main() { -// sess := session.New() -// svc := internetmonitor.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockInternetMonitorClient struct { -// internetmonitoriface.InternetMonitorAPI -// } -// func (m *mockInternetMonitorClient) CreateMonitor(input *internetmonitor.CreateMonitorInput) (*internetmonitor.CreateMonitorOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockInternetMonitorClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type InternetMonitorAPI interface { - CreateMonitor(*internetmonitor.CreateMonitorInput) (*internetmonitor.CreateMonitorOutput, error) - CreateMonitorWithContext(aws.Context, *internetmonitor.CreateMonitorInput, ...request.Option) (*internetmonitor.CreateMonitorOutput, error) - CreateMonitorRequest(*internetmonitor.CreateMonitorInput) (*request.Request, *internetmonitor.CreateMonitorOutput) - - DeleteMonitor(*internetmonitor.DeleteMonitorInput) (*internetmonitor.DeleteMonitorOutput, error) - DeleteMonitorWithContext(aws.Context, *internetmonitor.DeleteMonitorInput, ...request.Option) (*internetmonitor.DeleteMonitorOutput, error) - DeleteMonitorRequest(*internetmonitor.DeleteMonitorInput) (*request.Request, *internetmonitor.DeleteMonitorOutput) - - GetHealthEvent(*internetmonitor.GetHealthEventInput) (*internetmonitor.GetHealthEventOutput, error) - GetHealthEventWithContext(aws.Context, *internetmonitor.GetHealthEventInput, ...request.Option) (*internetmonitor.GetHealthEventOutput, error) - GetHealthEventRequest(*internetmonitor.GetHealthEventInput) (*request.Request, *internetmonitor.GetHealthEventOutput) - - GetMonitor(*internetmonitor.GetMonitorInput) (*internetmonitor.GetMonitorOutput, error) - GetMonitorWithContext(aws.Context, *internetmonitor.GetMonitorInput, ...request.Option) (*internetmonitor.GetMonitorOutput, error) - GetMonitorRequest(*internetmonitor.GetMonitorInput) (*request.Request, *internetmonitor.GetMonitorOutput) - - GetQueryResults(*internetmonitor.GetQueryResultsInput) (*internetmonitor.GetQueryResultsOutput, error) - GetQueryResultsWithContext(aws.Context, *internetmonitor.GetQueryResultsInput, ...request.Option) (*internetmonitor.GetQueryResultsOutput, error) - GetQueryResultsRequest(*internetmonitor.GetQueryResultsInput) (*request.Request, *internetmonitor.GetQueryResultsOutput) - - GetQueryResultsPages(*internetmonitor.GetQueryResultsInput, func(*internetmonitor.GetQueryResultsOutput, bool) bool) error - GetQueryResultsPagesWithContext(aws.Context, *internetmonitor.GetQueryResultsInput, func(*internetmonitor.GetQueryResultsOutput, bool) bool, ...request.Option) error - - GetQueryStatus(*internetmonitor.GetQueryStatusInput) (*internetmonitor.GetQueryStatusOutput, error) - GetQueryStatusWithContext(aws.Context, *internetmonitor.GetQueryStatusInput, ...request.Option) (*internetmonitor.GetQueryStatusOutput, error) - GetQueryStatusRequest(*internetmonitor.GetQueryStatusInput) (*request.Request, *internetmonitor.GetQueryStatusOutput) - - ListHealthEvents(*internetmonitor.ListHealthEventsInput) (*internetmonitor.ListHealthEventsOutput, error) - ListHealthEventsWithContext(aws.Context, *internetmonitor.ListHealthEventsInput, ...request.Option) (*internetmonitor.ListHealthEventsOutput, error) - ListHealthEventsRequest(*internetmonitor.ListHealthEventsInput) (*request.Request, *internetmonitor.ListHealthEventsOutput) - - ListHealthEventsPages(*internetmonitor.ListHealthEventsInput, func(*internetmonitor.ListHealthEventsOutput, bool) bool) error - ListHealthEventsPagesWithContext(aws.Context, *internetmonitor.ListHealthEventsInput, func(*internetmonitor.ListHealthEventsOutput, bool) bool, ...request.Option) error - - ListMonitors(*internetmonitor.ListMonitorsInput) (*internetmonitor.ListMonitorsOutput, error) - ListMonitorsWithContext(aws.Context, *internetmonitor.ListMonitorsInput, ...request.Option) (*internetmonitor.ListMonitorsOutput, error) - ListMonitorsRequest(*internetmonitor.ListMonitorsInput) (*request.Request, *internetmonitor.ListMonitorsOutput) - - ListMonitorsPages(*internetmonitor.ListMonitorsInput, func(*internetmonitor.ListMonitorsOutput, bool) bool) error - ListMonitorsPagesWithContext(aws.Context, *internetmonitor.ListMonitorsInput, func(*internetmonitor.ListMonitorsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*internetmonitor.ListTagsForResourceInput) (*internetmonitor.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *internetmonitor.ListTagsForResourceInput, ...request.Option) (*internetmonitor.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*internetmonitor.ListTagsForResourceInput) (*request.Request, *internetmonitor.ListTagsForResourceOutput) - - StartQuery(*internetmonitor.StartQueryInput) (*internetmonitor.StartQueryOutput, error) - StartQueryWithContext(aws.Context, *internetmonitor.StartQueryInput, ...request.Option) (*internetmonitor.StartQueryOutput, error) - StartQueryRequest(*internetmonitor.StartQueryInput) (*request.Request, *internetmonitor.StartQueryOutput) - - StopQuery(*internetmonitor.StopQueryInput) (*internetmonitor.StopQueryOutput, error) - StopQueryWithContext(aws.Context, *internetmonitor.StopQueryInput, ...request.Option) (*internetmonitor.StopQueryOutput, error) - StopQueryRequest(*internetmonitor.StopQueryInput) (*request.Request, *internetmonitor.StopQueryOutput) - - TagResource(*internetmonitor.TagResourceInput) (*internetmonitor.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *internetmonitor.TagResourceInput, ...request.Option) (*internetmonitor.TagResourceOutput, error) - TagResourceRequest(*internetmonitor.TagResourceInput) (*request.Request, *internetmonitor.TagResourceOutput) - - UntagResource(*internetmonitor.UntagResourceInput) (*internetmonitor.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *internetmonitor.UntagResourceInput, ...request.Option) (*internetmonitor.UntagResourceOutput, error) - UntagResourceRequest(*internetmonitor.UntagResourceInput) (*request.Request, *internetmonitor.UntagResourceOutput) - - UpdateMonitor(*internetmonitor.UpdateMonitorInput) (*internetmonitor.UpdateMonitorOutput, error) - UpdateMonitorWithContext(aws.Context, *internetmonitor.UpdateMonitorInput, ...request.Option) (*internetmonitor.UpdateMonitorOutput, error) - UpdateMonitorRequest(*internetmonitor.UpdateMonitorInput) (*request.Request, *internetmonitor.UpdateMonitorOutput) -} - -var _ InternetMonitorAPI = (*internetmonitor.InternetMonitor)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/service.go deleted file mode 100644 index 210be6b93edf..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/internetmonitor/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package internetmonitor - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// InternetMonitor provides the API operation methods for making requests to -// Amazon CloudWatch Internet Monitor. See this package's package overview docs -// for details on the service. -// -// InternetMonitor methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type InternetMonitor struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "InternetMonitor" // Name of service. - EndpointsID = "internetmonitor" // ID to lookup a service endpoint with. - ServiceID = "InternetMonitor" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the InternetMonitor client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a InternetMonitor client from just a session. -// svc := internetmonitor.New(mySession) -// -// // Create a InternetMonitor client with additional configuration -// svc := internetmonitor.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *InternetMonitor { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "internetmonitor" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *InternetMonitor { - svc := &InternetMonitor{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-06-03", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a InternetMonitor operation and runs any -// custom request initialization. -func (c *InternetMonitor) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/api.go deleted file mode 100644 index 52819ca39f69..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/api.go +++ /dev/null @@ -1,18309 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package iotfleetwise - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opAssociateVehicleFleet = "AssociateVehicleFleet" - -// AssociateVehicleFleetRequest generates a "aws/request.Request" representing the -// client's request for the AssociateVehicleFleet 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 AssociateVehicleFleet for more information on using the AssociateVehicleFleet -// 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 AssociateVehicleFleetRequest method. -// req, resp := client.AssociateVehicleFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/AssociateVehicleFleet -func (c *IoTFleetWise) AssociateVehicleFleetRequest(input *AssociateVehicleFleetInput) (req *request.Request, output *AssociateVehicleFleetOutput) { - op := &request.Operation{ - Name: opAssociateVehicleFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateVehicleFleetInput{} - } - - output = &AssociateVehicleFleetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssociateVehicleFleet API operation for AWS IoT FleetWise. -// -// Adds, or associates, a vehicle with a fleet. -// -// 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 AWS IoT FleetWise's -// API operation AssociateVehicleFleet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/AssociateVehicleFleet -func (c *IoTFleetWise) AssociateVehicleFleet(input *AssociateVehicleFleetInput) (*AssociateVehicleFleetOutput, error) { - req, out := c.AssociateVehicleFleetRequest(input) - return out, req.Send() -} - -// AssociateVehicleFleetWithContext is the same as AssociateVehicleFleet with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateVehicleFleet 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 *IoTFleetWise) AssociateVehicleFleetWithContext(ctx aws.Context, input *AssociateVehicleFleetInput, opts ...request.Option) (*AssociateVehicleFleetOutput, error) { - req, out := c.AssociateVehicleFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchCreateVehicle = "BatchCreateVehicle" - -// BatchCreateVehicleRequest generates a "aws/request.Request" representing the -// client's request for the BatchCreateVehicle 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 BatchCreateVehicle for more information on using the BatchCreateVehicle -// 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 BatchCreateVehicleRequest method. -// req, resp := client.BatchCreateVehicleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/BatchCreateVehicle -func (c *IoTFleetWise) BatchCreateVehicleRequest(input *BatchCreateVehicleInput) (req *request.Request, output *BatchCreateVehicleOutput) { - op := &request.Operation{ - Name: opBatchCreateVehicle, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchCreateVehicleInput{} - } - - output = &BatchCreateVehicleOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchCreateVehicle API operation for AWS IoT FleetWise. -// -// Creates a group, or batch, of vehicles. -// -// You must specify a decoder manifest and a vehicle model (model manifest) -// for each vehicle. -// -// For more information, see Create multiple vehicles (AWS CLI) (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/create-vehicles-cli.html) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// 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 AWS IoT FleetWise's -// API operation BatchCreateVehicle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/BatchCreateVehicle -func (c *IoTFleetWise) BatchCreateVehicle(input *BatchCreateVehicleInput) (*BatchCreateVehicleOutput, error) { - req, out := c.BatchCreateVehicleRequest(input) - return out, req.Send() -} - -// BatchCreateVehicleWithContext is the same as BatchCreateVehicle with the addition of -// the ability to pass a context and additional request options. -// -// See BatchCreateVehicle 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 *IoTFleetWise) BatchCreateVehicleWithContext(ctx aws.Context, input *BatchCreateVehicleInput, opts ...request.Option) (*BatchCreateVehicleOutput, error) { - req, out := c.BatchCreateVehicleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchUpdateVehicle = "BatchUpdateVehicle" - -// BatchUpdateVehicleRequest generates a "aws/request.Request" representing the -// client's request for the BatchUpdateVehicle 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 BatchUpdateVehicle for more information on using the BatchUpdateVehicle -// 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 BatchUpdateVehicleRequest method. -// req, resp := client.BatchUpdateVehicleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/BatchUpdateVehicle -func (c *IoTFleetWise) BatchUpdateVehicleRequest(input *BatchUpdateVehicleInput) (req *request.Request, output *BatchUpdateVehicleOutput) { - op := &request.Operation{ - Name: opBatchUpdateVehicle, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchUpdateVehicleInput{} - } - - output = &BatchUpdateVehicleOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchUpdateVehicle API operation for AWS IoT FleetWise. -// -// Updates a group, or batch, of vehicles. -// -// You must specify a decoder manifest and a vehicle model (model manifest) -// for each vehicle. -// -// For more information, see Update multiple vehicles (AWS CLI) (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/update-vehicles-cli.html) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// 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 AWS IoT FleetWise's -// API operation BatchUpdateVehicle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/BatchUpdateVehicle -func (c *IoTFleetWise) BatchUpdateVehicle(input *BatchUpdateVehicleInput) (*BatchUpdateVehicleOutput, error) { - req, out := c.BatchUpdateVehicleRequest(input) - return out, req.Send() -} - -// BatchUpdateVehicleWithContext is the same as BatchUpdateVehicle with the addition of -// the ability to pass a context and additional request options. -// -// See BatchUpdateVehicle 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 *IoTFleetWise) BatchUpdateVehicleWithContext(ctx aws.Context, input *BatchUpdateVehicleInput, opts ...request.Option) (*BatchUpdateVehicleOutput, error) { - req, out := c.BatchUpdateVehicleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateCampaign = "CreateCampaign" - -// CreateCampaignRequest generates a "aws/request.Request" representing the -// client's request for the CreateCampaign 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 CreateCampaign for more information on using the CreateCampaign -// 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 CreateCampaignRequest method. -// req, resp := client.CreateCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateCampaign -func (c *IoTFleetWise) CreateCampaignRequest(input *CreateCampaignInput) (req *request.Request, output *CreateCampaignOutput) { - op := &request.Operation{ - Name: opCreateCampaign, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCampaignInput{} - } - - output = &CreateCampaignOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCampaign API operation for AWS IoT FleetWise. -// -// Creates an orchestration of data collection rules. The Amazon Web Services -// IoT FleetWise Edge Agent software running in vehicles uses campaigns to decide -// how to collect and transfer data to the cloud. You create campaigns in the -// cloud. After you or your team approve campaigns, Amazon Web Services IoT -// FleetWise automatically deploys them to vehicles. -// -// For more information, see Collect and transfer data with campaigns (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/campaigns.html) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// 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 AWS IoT FleetWise's -// API operation CreateCampaign for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateCampaign -func (c *IoTFleetWise) CreateCampaign(input *CreateCampaignInput) (*CreateCampaignOutput, error) { - req, out := c.CreateCampaignRequest(input) - return out, req.Send() -} - -// CreateCampaignWithContext is the same as CreateCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCampaign 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 *IoTFleetWise) CreateCampaignWithContext(ctx aws.Context, input *CreateCampaignInput, opts ...request.Option) (*CreateCampaignOutput, error) { - req, out := c.CreateCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDecoderManifest = "CreateDecoderManifest" - -// CreateDecoderManifestRequest generates a "aws/request.Request" representing the -// client's request for the CreateDecoderManifest 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 CreateDecoderManifest for more information on using the CreateDecoderManifest -// 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 CreateDecoderManifestRequest method. -// req, resp := client.CreateDecoderManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateDecoderManifest -func (c *IoTFleetWise) CreateDecoderManifestRequest(input *CreateDecoderManifestInput) (req *request.Request, output *CreateDecoderManifestOutput) { - op := &request.Operation{ - Name: opCreateDecoderManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDecoderManifestInput{} - } - - output = &CreateDecoderManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDecoderManifest API operation for AWS IoT FleetWise. -// -// Creates the decoder manifest associated with a model manifest. To create -// a decoder manifest, the following must be true: -// -// - Every signal decoder has a unique name. -// -// - Each signal decoder is associated with a network interface. -// -// - Each network interface has a unique ID. -// -// - The signal decoders are specified in the model manifest. -// -// 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 AWS IoT FleetWise's -// API operation CreateDecoderManifest for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - DecoderManifestValidationException -// The request couldn't be completed because it contains signal decoders with -// one or more validation errors. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateDecoderManifest -func (c *IoTFleetWise) CreateDecoderManifest(input *CreateDecoderManifestInput) (*CreateDecoderManifestOutput, error) { - req, out := c.CreateDecoderManifestRequest(input) - return out, req.Send() -} - -// CreateDecoderManifestWithContext is the same as CreateDecoderManifest with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDecoderManifest 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 *IoTFleetWise) CreateDecoderManifestWithContext(ctx aws.Context, input *CreateDecoderManifestInput, opts ...request.Option) (*CreateDecoderManifestOutput, error) { - req, out := c.CreateDecoderManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateFleet = "CreateFleet" - -// CreateFleetRequest generates a "aws/request.Request" representing the -// client's request for the CreateFleet 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 CreateFleet for more information on using the CreateFleet -// 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 CreateFleetRequest method. -// req, resp := client.CreateFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateFleet -func (c *IoTFleetWise) CreateFleetRequest(input *CreateFleetInput) (req *request.Request, output *CreateFleetOutput) { - op := &request.Operation{ - Name: opCreateFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateFleetInput{} - } - - output = &CreateFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateFleet API operation for AWS IoT FleetWise. -// -// Creates a fleet that represents a group of vehicles. -// -// You must create both a signal catalog and vehicles before you can create -// a fleet. -// -// For more information, see Fleets (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleets.html) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// 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 AWS IoT FleetWise's -// API operation CreateFleet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateFleet -func (c *IoTFleetWise) CreateFleet(input *CreateFleetInput) (*CreateFleetOutput, error) { - req, out := c.CreateFleetRequest(input) - return out, req.Send() -} - -// CreateFleetWithContext is the same as CreateFleet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateFleet 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 *IoTFleetWise) CreateFleetWithContext(ctx aws.Context, input *CreateFleetInput, opts ...request.Option) (*CreateFleetOutput, error) { - req, out := c.CreateFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateModelManifest = "CreateModelManifest" - -// CreateModelManifestRequest generates a "aws/request.Request" representing the -// client's request for the CreateModelManifest 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 CreateModelManifest for more information on using the CreateModelManifest -// 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 CreateModelManifestRequest method. -// req, resp := client.CreateModelManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateModelManifest -func (c *IoTFleetWise) CreateModelManifestRequest(input *CreateModelManifestInput) (req *request.Request, output *CreateModelManifestOutput) { - op := &request.Operation{ - Name: opCreateModelManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateModelManifestInput{} - } - - output = &CreateModelManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateModelManifest API operation for AWS IoT FleetWise. -// -// Creates a vehicle model (model manifest) that specifies signals (attributes, -// branches, sensors, and actuators). -// -// For more information, see Vehicle models (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/vehicle-models.html) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// 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 AWS IoT FleetWise's -// API operation CreateModelManifest for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InvalidSignalsException -// The request couldn't be completed because it contains signals that aren't -// valid. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateModelManifest -func (c *IoTFleetWise) CreateModelManifest(input *CreateModelManifestInput) (*CreateModelManifestOutput, error) { - req, out := c.CreateModelManifestRequest(input) - return out, req.Send() -} - -// CreateModelManifestWithContext is the same as CreateModelManifest with the addition of -// the ability to pass a context and additional request options. -// -// See CreateModelManifest 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 *IoTFleetWise) CreateModelManifestWithContext(ctx aws.Context, input *CreateModelManifestInput, opts ...request.Option) (*CreateModelManifestOutput, error) { - req, out := c.CreateModelManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSignalCatalog = "CreateSignalCatalog" - -// CreateSignalCatalogRequest generates a "aws/request.Request" representing the -// client's request for the CreateSignalCatalog 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 CreateSignalCatalog for more information on using the CreateSignalCatalog -// 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 CreateSignalCatalogRequest method. -// req, resp := client.CreateSignalCatalogRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateSignalCatalog -func (c *IoTFleetWise) CreateSignalCatalogRequest(input *CreateSignalCatalogInput) (req *request.Request, output *CreateSignalCatalogOutput) { - op := &request.Operation{ - Name: opCreateSignalCatalog, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSignalCatalogInput{} - } - - output = &CreateSignalCatalogOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSignalCatalog API operation for AWS IoT FleetWise. -// -// Creates a collection of standardized signals that can be reused to create -// vehicle models. -// -// 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 AWS IoT FleetWise's -// API operation CreateSignalCatalog for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - InvalidNodeException -// The specified node type doesn't match the expected node type for a node. -// You can specify the node type as branch, sensor, actuator, or attribute. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InvalidSignalsException -// The request couldn't be completed because it contains signals that aren't -// valid. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateSignalCatalog -func (c *IoTFleetWise) CreateSignalCatalog(input *CreateSignalCatalogInput) (*CreateSignalCatalogOutput, error) { - req, out := c.CreateSignalCatalogRequest(input) - return out, req.Send() -} - -// CreateSignalCatalogWithContext is the same as CreateSignalCatalog with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSignalCatalog 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 *IoTFleetWise) CreateSignalCatalogWithContext(ctx aws.Context, input *CreateSignalCatalogInput, opts ...request.Option) (*CreateSignalCatalogOutput, error) { - req, out := c.CreateSignalCatalogRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVehicle = "CreateVehicle" - -// CreateVehicleRequest generates a "aws/request.Request" representing the -// client's request for the CreateVehicle 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 CreateVehicle for more information on using the CreateVehicle -// 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 CreateVehicleRequest method. -// req, resp := client.CreateVehicleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateVehicle -func (c *IoTFleetWise) CreateVehicleRequest(input *CreateVehicleInput) (req *request.Request, output *CreateVehicleOutput) { - op := &request.Operation{ - Name: opCreateVehicle, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVehicleInput{} - } - - output = &CreateVehicleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVehicle API operation for AWS IoT FleetWise. -// -// Creates a vehicle, which is an instance of a vehicle model (model manifest). -// Vehicles created from the same vehicle model consist of the same signals -// inherited from the vehicle model. -// -// If you have an existing Amazon Web Services IoT thing, you can use Amazon -// Web Services IoT FleetWise to create a vehicle and collect data from your -// thing. -// -// For more information, see Create a vehicle (AWS CLI) (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/create-vehicle-cli.html) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// 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 AWS IoT FleetWise's -// API operation CreateVehicle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/CreateVehicle -func (c *IoTFleetWise) CreateVehicle(input *CreateVehicleInput) (*CreateVehicleOutput, error) { - req, out := c.CreateVehicleRequest(input) - return out, req.Send() -} - -// CreateVehicleWithContext is the same as CreateVehicle with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVehicle 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 *IoTFleetWise) CreateVehicleWithContext(ctx aws.Context, input *CreateVehicleInput, opts ...request.Option) (*CreateVehicleOutput, error) { - req, out := c.CreateVehicleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCampaign = "DeleteCampaign" - -// DeleteCampaignRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCampaign 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 DeleteCampaign for more information on using the DeleteCampaign -// 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 DeleteCampaignRequest method. -// req, resp := client.DeleteCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteCampaign -func (c *IoTFleetWise) DeleteCampaignRequest(input *DeleteCampaignInput) (req *request.Request, output *DeleteCampaignOutput) { - op := &request.Operation{ - Name: opDeleteCampaign, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCampaignInput{} - } - - output = &DeleteCampaignOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCampaign API operation for AWS IoT FleetWise. -// -// Deletes a data collection campaign. Deleting a campaign suspends all data -// collection and removes it from any vehicles. -// -// 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 AWS IoT FleetWise's -// API operation DeleteCampaign for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteCampaign -func (c *IoTFleetWise) DeleteCampaign(input *DeleteCampaignInput) (*DeleteCampaignOutput, error) { - req, out := c.DeleteCampaignRequest(input) - return out, req.Send() -} - -// DeleteCampaignWithContext is the same as DeleteCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCampaign 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 *IoTFleetWise) DeleteCampaignWithContext(ctx aws.Context, input *DeleteCampaignInput, opts ...request.Option) (*DeleteCampaignOutput, error) { - req, out := c.DeleteCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDecoderManifest = "DeleteDecoderManifest" - -// DeleteDecoderManifestRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDecoderManifest 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 DeleteDecoderManifest for more information on using the DeleteDecoderManifest -// 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 DeleteDecoderManifestRequest method. -// req, resp := client.DeleteDecoderManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteDecoderManifest -func (c *IoTFleetWise) DeleteDecoderManifestRequest(input *DeleteDecoderManifestInput) (req *request.Request, output *DeleteDecoderManifestOutput) { - op := &request.Operation{ - Name: opDeleteDecoderManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDecoderManifestInput{} - } - - output = &DeleteDecoderManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDecoderManifest API operation for AWS IoT FleetWise. -// -// Deletes a decoder manifest. You can't delete a decoder manifest if it has -// vehicles associated with it. -// -// If the decoder manifest is successfully deleted, Amazon Web Services IoT -// FleetWise sends back an HTTP 200 response with an empty body. -// -// 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 AWS IoT FleetWise's -// API operation DeleteDecoderManifest for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteDecoderManifest -func (c *IoTFleetWise) DeleteDecoderManifest(input *DeleteDecoderManifestInput) (*DeleteDecoderManifestOutput, error) { - req, out := c.DeleteDecoderManifestRequest(input) - return out, req.Send() -} - -// DeleteDecoderManifestWithContext is the same as DeleteDecoderManifest with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDecoderManifest 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 *IoTFleetWise) DeleteDecoderManifestWithContext(ctx aws.Context, input *DeleteDecoderManifestInput, opts ...request.Option) (*DeleteDecoderManifestOutput, error) { - req, out := c.DeleteDecoderManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteFleet = "DeleteFleet" - -// DeleteFleetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFleet 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 DeleteFleet for more information on using the DeleteFleet -// 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 DeleteFleetRequest method. -// req, resp := client.DeleteFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteFleet -func (c *IoTFleetWise) DeleteFleetRequest(input *DeleteFleetInput) (req *request.Request, output *DeleteFleetOutput) { - op := &request.Operation{ - Name: opDeleteFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteFleetInput{} - } - - output = &DeleteFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteFleet API operation for AWS IoT FleetWise. -// -// Deletes a fleet. Before you delete a fleet, all vehicles must be dissociated -// from the fleet. For more information, see Delete a fleet (AWS CLI) (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/delete-fleet-cli.html) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// If the fleet is successfully deleted, Amazon Web Services IoT FleetWise sends -// back an HTTP 200 response with an empty body. -// -// 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 AWS IoT FleetWise's -// API operation DeleteFleet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteFleet -func (c *IoTFleetWise) DeleteFleet(input *DeleteFleetInput) (*DeleteFleetOutput, error) { - req, out := c.DeleteFleetRequest(input) - return out, req.Send() -} - -// DeleteFleetWithContext is the same as DeleteFleet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteFleet 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 *IoTFleetWise) DeleteFleetWithContext(ctx aws.Context, input *DeleteFleetInput, opts ...request.Option) (*DeleteFleetOutput, error) { - req, out := c.DeleteFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteModelManifest = "DeleteModelManifest" - -// DeleteModelManifestRequest generates a "aws/request.Request" representing the -// client's request for the DeleteModelManifest 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 DeleteModelManifest for more information on using the DeleteModelManifest -// 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 DeleteModelManifestRequest method. -// req, resp := client.DeleteModelManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteModelManifest -func (c *IoTFleetWise) DeleteModelManifestRequest(input *DeleteModelManifestInput) (req *request.Request, output *DeleteModelManifestOutput) { - op := &request.Operation{ - Name: opDeleteModelManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteModelManifestInput{} - } - - output = &DeleteModelManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteModelManifest API operation for AWS IoT FleetWise. -// -// Deletes a vehicle model (model manifest). -// -// If the vehicle model is successfully deleted, Amazon Web Services IoT FleetWise -// sends back an HTTP 200 response with an empty body. -// -// 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 AWS IoT FleetWise's -// API operation DeleteModelManifest for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteModelManifest -func (c *IoTFleetWise) DeleteModelManifest(input *DeleteModelManifestInput) (*DeleteModelManifestOutput, error) { - req, out := c.DeleteModelManifestRequest(input) - return out, req.Send() -} - -// DeleteModelManifestWithContext is the same as DeleteModelManifest with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteModelManifest 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 *IoTFleetWise) DeleteModelManifestWithContext(ctx aws.Context, input *DeleteModelManifestInput, opts ...request.Option) (*DeleteModelManifestOutput, error) { - req, out := c.DeleteModelManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSignalCatalog = "DeleteSignalCatalog" - -// DeleteSignalCatalogRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSignalCatalog 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 DeleteSignalCatalog for more information on using the DeleteSignalCatalog -// 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 DeleteSignalCatalogRequest method. -// req, resp := client.DeleteSignalCatalogRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteSignalCatalog -func (c *IoTFleetWise) DeleteSignalCatalogRequest(input *DeleteSignalCatalogInput) (req *request.Request, output *DeleteSignalCatalogOutput) { - op := &request.Operation{ - Name: opDeleteSignalCatalog, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSignalCatalogInput{} - } - - output = &DeleteSignalCatalogOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSignalCatalog API operation for AWS IoT FleetWise. -// -// Deletes a signal catalog. -// -// If the signal catalog is successfully deleted, Amazon Web Services IoT FleetWise -// sends back an HTTP 200 response with an empty body. -// -// 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 AWS IoT FleetWise's -// API operation DeleteSignalCatalog for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteSignalCatalog -func (c *IoTFleetWise) DeleteSignalCatalog(input *DeleteSignalCatalogInput) (*DeleteSignalCatalogOutput, error) { - req, out := c.DeleteSignalCatalogRequest(input) - return out, req.Send() -} - -// DeleteSignalCatalogWithContext is the same as DeleteSignalCatalog with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSignalCatalog 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 *IoTFleetWise) DeleteSignalCatalogWithContext(ctx aws.Context, input *DeleteSignalCatalogInput, opts ...request.Option) (*DeleteSignalCatalogOutput, error) { - req, out := c.DeleteSignalCatalogRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVehicle = "DeleteVehicle" - -// DeleteVehicleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVehicle 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 DeleteVehicle for more information on using the DeleteVehicle -// 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 DeleteVehicleRequest method. -// req, resp := client.DeleteVehicleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteVehicle -func (c *IoTFleetWise) DeleteVehicleRequest(input *DeleteVehicleInput) (req *request.Request, output *DeleteVehicleOutput) { - op := &request.Operation{ - Name: opDeleteVehicle, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVehicleInput{} - } - - output = &DeleteVehicleOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVehicle API operation for AWS IoT FleetWise. -// -// Deletes a vehicle and removes it from any campaigns. -// -// If the vehicle is successfully deleted, Amazon Web Services IoT FleetWise -// sends back an HTTP 200 response with an empty body. -// -// 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 AWS IoT FleetWise's -// API operation DeleteVehicle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DeleteVehicle -func (c *IoTFleetWise) DeleteVehicle(input *DeleteVehicleInput) (*DeleteVehicleOutput, error) { - req, out := c.DeleteVehicleRequest(input) - return out, req.Send() -} - -// DeleteVehicleWithContext is the same as DeleteVehicle with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVehicle 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 *IoTFleetWise) DeleteVehicleWithContext(ctx aws.Context, input *DeleteVehicleInput, opts ...request.Option) (*DeleteVehicleOutput, error) { - req, out := c.DeleteVehicleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateVehicleFleet = "DisassociateVehicleFleet" - -// DisassociateVehicleFleetRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateVehicleFleet 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 DisassociateVehicleFleet for more information on using the DisassociateVehicleFleet -// 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 DisassociateVehicleFleetRequest method. -// req, resp := client.DisassociateVehicleFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DisassociateVehicleFleet -func (c *IoTFleetWise) DisassociateVehicleFleetRequest(input *DisassociateVehicleFleetInput) (req *request.Request, output *DisassociateVehicleFleetOutput) { - op := &request.Operation{ - Name: opDisassociateVehicleFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateVehicleFleetInput{} - } - - output = &DisassociateVehicleFleetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateVehicleFleet API operation for AWS IoT FleetWise. -// -// Removes, or disassociates, a vehicle from a fleet. Disassociating a vehicle -// from a fleet doesn't delete the vehicle. -// -// If the vehicle is successfully dissociated from a fleet, Amazon Web Services -// IoT FleetWise sends back an HTTP 200 response with an empty body. -// -// 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 AWS IoT FleetWise's -// API operation DisassociateVehicleFleet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/DisassociateVehicleFleet -func (c *IoTFleetWise) DisassociateVehicleFleet(input *DisassociateVehicleFleetInput) (*DisassociateVehicleFleetOutput, error) { - req, out := c.DisassociateVehicleFleetRequest(input) - return out, req.Send() -} - -// DisassociateVehicleFleetWithContext is the same as DisassociateVehicleFleet with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateVehicleFleet 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 *IoTFleetWise) DisassociateVehicleFleetWithContext(ctx aws.Context, input *DisassociateVehicleFleetInput, opts ...request.Option) (*DisassociateVehicleFleetOutput, error) { - req, out := c.DisassociateVehicleFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCampaign = "GetCampaign" - -// GetCampaignRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaign 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 GetCampaign for more information on using the GetCampaign -// 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 GetCampaignRequest method. -// req, resp := client.GetCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetCampaign -func (c *IoTFleetWise) GetCampaignRequest(input *GetCampaignInput) (req *request.Request, output *GetCampaignOutput) { - op := &request.Operation{ - Name: opGetCampaign, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCampaignInput{} - } - - output = &GetCampaignOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCampaign API operation for AWS IoT FleetWise. -// -// Retrieves information about a campaign. -// -// 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 AWS IoT FleetWise's -// API operation GetCampaign for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetCampaign -func (c *IoTFleetWise) GetCampaign(input *GetCampaignInput) (*GetCampaignOutput, error) { - req, out := c.GetCampaignRequest(input) - return out, req.Send() -} - -// GetCampaignWithContext is the same as GetCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See GetCampaign 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 *IoTFleetWise) GetCampaignWithContext(ctx aws.Context, input *GetCampaignInput, opts ...request.Option) (*GetCampaignOutput, error) { - req, out := c.GetCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDecoderManifest = "GetDecoderManifest" - -// GetDecoderManifestRequest generates a "aws/request.Request" representing the -// client's request for the GetDecoderManifest 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 GetDecoderManifest for more information on using the GetDecoderManifest -// 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 GetDecoderManifestRequest method. -// req, resp := client.GetDecoderManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetDecoderManifest -func (c *IoTFleetWise) GetDecoderManifestRequest(input *GetDecoderManifestInput) (req *request.Request, output *GetDecoderManifestOutput) { - op := &request.Operation{ - Name: opGetDecoderManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetDecoderManifestInput{} - } - - output = &GetDecoderManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDecoderManifest API operation for AWS IoT FleetWise. -// -// Retrieves information about a created decoder manifest. -// -// 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 AWS IoT FleetWise's -// API operation GetDecoderManifest for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetDecoderManifest -func (c *IoTFleetWise) GetDecoderManifest(input *GetDecoderManifestInput) (*GetDecoderManifestOutput, error) { - req, out := c.GetDecoderManifestRequest(input) - return out, req.Send() -} - -// GetDecoderManifestWithContext is the same as GetDecoderManifest with the addition of -// the ability to pass a context and additional request options. -// -// See GetDecoderManifest 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 *IoTFleetWise) GetDecoderManifestWithContext(ctx aws.Context, input *GetDecoderManifestInput, opts ...request.Option) (*GetDecoderManifestOutput, error) { - req, out := c.GetDecoderManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEncryptionConfiguration = "GetEncryptionConfiguration" - -// GetEncryptionConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetEncryptionConfiguration 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 GetEncryptionConfiguration for more information on using the GetEncryptionConfiguration -// 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 GetEncryptionConfigurationRequest method. -// req, resp := client.GetEncryptionConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetEncryptionConfiguration -func (c *IoTFleetWise) GetEncryptionConfigurationRequest(input *GetEncryptionConfigurationInput) (req *request.Request, output *GetEncryptionConfigurationOutput) { - op := &request.Operation{ - Name: opGetEncryptionConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetEncryptionConfigurationInput{} - } - - output = &GetEncryptionConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEncryptionConfiguration API operation for AWS IoT FleetWise. -// -// Retrieves the encryption configuration for resources and data in Amazon Web -// Services IoT FleetWise. -// -// 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 AWS IoT FleetWise's -// API operation GetEncryptionConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetEncryptionConfiguration -func (c *IoTFleetWise) GetEncryptionConfiguration(input *GetEncryptionConfigurationInput) (*GetEncryptionConfigurationOutput, error) { - req, out := c.GetEncryptionConfigurationRequest(input) - return out, req.Send() -} - -// GetEncryptionConfigurationWithContext is the same as GetEncryptionConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetEncryptionConfiguration 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 *IoTFleetWise) GetEncryptionConfigurationWithContext(ctx aws.Context, input *GetEncryptionConfigurationInput, opts ...request.Option) (*GetEncryptionConfigurationOutput, error) { - req, out := c.GetEncryptionConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetFleet = "GetFleet" - -// GetFleetRequest generates a "aws/request.Request" representing the -// client's request for the GetFleet 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 GetFleet for more information on using the GetFleet -// 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 GetFleetRequest method. -// req, resp := client.GetFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetFleet -func (c *IoTFleetWise) GetFleetRequest(input *GetFleetInput) (req *request.Request, output *GetFleetOutput) { - op := &request.Operation{ - Name: opGetFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetFleetInput{} - } - - output = &GetFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetFleet API operation for AWS IoT FleetWise. -// -// Retrieves information about a fleet. -// -// 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 AWS IoT FleetWise's -// API operation GetFleet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetFleet -func (c *IoTFleetWise) GetFleet(input *GetFleetInput) (*GetFleetOutput, error) { - req, out := c.GetFleetRequest(input) - return out, req.Send() -} - -// GetFleetWithContext is the same as GetFleet with the addition of -// the ability to pass a context and additional request options. -// -// See GetFleet 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 *IoTFleetWise) GetFleetWithContext(ctx aws.Context, input *GetFleetInput, opts ...request.Option) (*GetFleetOutput, error) { - req, out := c.GetFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetLoggingOptions = "GetLoggingOptions" - -// GetLoggingOptionsRequest generates a "aws/request.Request" representing the -// client's request for the GetLoggingOptions 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 GetLoggingOptions for more information on using the GetLoggingOptions -// 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 GetLoggingOptionsRequest method. -// req, resp := client.GetLoggingOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetLoggingOptions -func (c *IoTFleetWise) GetLoggingOptionsRequest(input *GetLoggingOptionsInput) (req *request.Request, output *GetLoggingOptionsOutput) { - op := &request.Operation{ - Name: opGetLoggingOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetLoggingOptionsInput{} - } - - output = &GetLoggingOptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetLoggingOptions API operation for AWS IoT FleetWise. -// -// Retrieves the logging options. -// -// 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 AWS IoT FleetWise's -// API operation GetLoggingOptions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetLoggingOptions -func (c *IoTFleetWise) GetLoggingOptions(input *GetLoggingOptionsInput) (*GetLoggingOptionsOutput, error) { - req, out := c.GetLoggingOptionsRequest(input) - return out, req.Send() -} - -// GetLoggingOptionsWithContext is the same as GetLoggingOptions with the addition of -// the ability to pass a context and additional request options. -// -// See GetLoggingOptions 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 *IoTFleetWise) GetLoggingOptionsWithContext(ctx aws.Context, input *GetLoggingOptionsInput, opts ...request.Option) (*GetLoggingOptionsOutput, error) { - req, out := c.GetLoggingOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetModelManifest = "GetModelManifest" - -// GetModelManifestRequest generates a "aws/request.Request" representing the -// client's request for the GetModelManifest 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 GetModelManifest for more information on using the GetModelManifest -// 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 GetModelManifestRequest method. -// req, resp := client.GetModelManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetModelManifest -func (c *IoTFleetWise) GetModelManifestRequest(input *GetModelManifestInput) (req *request.Request, output *GetModelManifestOutput) { - op := &request.Operation{ - Name: opGetModelManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetModelManifestInput{} - } - - output = &GetModelManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetModelManifest API operation for AWS IoT FleetWise. -// -// Retrieves information about a vehicle model (model manifest). -// -// 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 AWS IoT FleetWise's -// API operation GetModelManifest for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetModelManifest -func (c *IoTFleetWise) GetModelManifest(input *GetModelManifestInput) (*GetModelManifestOutput, error) { - req, out := c.GetModelManifestRequest(input) - return out, req.Send() -} - -// GetModelManifestWithContext is the same as GetModelManifest with the addition of -// the ability to pass a context and additional request options. -// -// See GetModelManifest 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 *IoTFleetWise) GetModelManifestWithContext(ctx aws.Context, input *GetModelManifestInput, opts ...request.Option) (*GetModelManifestOutput, error) { - req, out := c.GetModelManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRegisterAccountStatus = "GetRegisterAccountStatus" - -// GetRegisterAccountStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetRegisterAccountStatus 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 GetRegisterAccountStatus for more information on using the GetRegisterAccountStatus -// 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 GetRegisterAccountStatusRequest method. -// req, resp := client.GetRegisterAccountStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetRegisterAccountStatus -func (c *IoTFleetWise) GetRegisterAccountStatusRequest(input *GetRegisterAccountStatusInput) (req *request.Request, output *GetRegisterAccountStatusOutput) { - op := &request.Operation{ - Name: opGetRegisterAccountStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRegisterAccountStatusInput{} - } - - output = &GetRegisterAccountStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRegisterAccountStatus API operation for AWS IoT FleetWise. -// -// Retrieves information about the status of registering your Amazon Web Services -// account, IAM, and Amazon Timestream resources so that Amazon Web Services -// IoT FleetWise can transfer your vehicle data to the Amazon Web Services Cloud. -// -// For more information, including step-by-step procedures, see Setting up Amazon -// Web Services IoT FleetWise (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/setting-up.html). -// -// This API operation doesn't require input parameters. -// -// 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 AWS IoT FleetWise's -// API operation GetRegisterAccountStatus for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetRegisterAccountStatus -func (c *IoTFleetWise) GetRegisterAccountStatus(input *GetRegisterAccountStatusInput) (*GetRegisterAccountStatusOutput, error) { - req, out := c.GetRegisterAccountStatusRequest(input) - return out, req.Send() -} - -// GetRegisterAccountStatusWithContext is the same as GetRegisterAccountStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetRegisterAccountStatus 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 *IoTFleetWise) GetRegisterAccountStatusWithContext(ctx aws.Context, input *GetRegisterAccountStatusInput, opts ...request.Option) (*GetRegisterAccountStatusOutput, error) { - req, out := c.GetRegisterAccountStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSignalCatalog = "GetSignalCatalog" - -// GetSignalCatalogRequest generates a "aws/request.Request" representing the -// client's request for the GetSignalCatalog 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 GetSignalCatalog for more information on using the GetSignalCatalog -// 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 GetSignalCatalogRequest method. -// req, resp := client.GetSignalCatalogRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetSignalCatalog -func (c *IoTFleetWise) GetSignalCatalogRequest(input *GetSignalCatalogInput) (req *request.Request, output *GetSignalCatalogOutput) { - op := &request.Operation{ - Name: opGetSignalCatalog, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSignalCatalogInput{} - } - - output = &GetSignalCatalogOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSignalCatalog API operation for AWS IoT FleetWise. -// -// Retrieves information about a signal catalog. -// -// 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 AWS IoT FleetWise's -// API operation GetSignalCatalog for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetSignalCatalog -func (c *IoTFleetWise) GetSignalCatalog(input *GetSignalCatalogInput) (*GetSignalCatalogOutput, error) { - req, out := c.GetSignalCatalogRequest(input) - return out, req.Send() -} - -// GetSignalCatalogWithContext is the same as GetSignalCatalog with the addition of -// the ability to pass a context and additional request options. -// -// See GetSignalCatalog 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 *IoTFleetWise) GetSignalCatalogWithContext(ctx aws.Context, input *GetSignalCatalogInput, opts ...request.Option) (*GetSignalCatalogOutput, error) { - req, out := c.GetSignalCatalogRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVehicle = "GetVehicle" - -// GetVehicleRequest generates a "aws/request.Request" representing the -// client's request for the GetVehicle 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 GetVehicle for more information on using the GetVehicle -// 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 GetVehicleRequest method. -// req, resp := client.GetVehicleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetVehicle -func (c *IoTFleetWise) GetVehicleRequest(input *GetVehicleInput) (req *request.Request, output *GetVehicleOutput) { - op := &request.Operation{ - Name: opGetVehicle, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetVehicleInput{} - } - - output = &GetVehicleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVehicle API operation for AWS IoT FleetWise. -// -// Retrieves information about a vehicle. -// -// 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 AWS IoT FleetWise's -// API operation GetVehicle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetVehicle -func (c *IoTFleetWise) GetVehicle(input *GetVehicleInput) (*GetVehicleOutput, error) { - req, out := c.GetVehicleRequest(input) - return out, req.Send() -} - -// GetVehicleWithContext is the same as GetVehicle with the addition of -// the ability to pass a context and additional request options. -// -// See GetVehicle 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 *IoTFleetWise) GetVehicleWithContext(ctx aws.Context, input *GetVehicleInput, opts ...request.Option) (*GetVehicleOutput, error) { - req, out := c.GetVehicleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVehicleStatus = "GetVehicleStatus" - -// GetVehicleStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetVehicleStatus 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 GetVehicleStatus for more information on using the GetVehicleStatus -// 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 GetVehicleStatusRequest method. -// req, resp := client.GetVehicleStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetVehicleStatus -func (c *IoTFleetWise) GetVehicleStatusRequest(input *GetVehicleStatusInput) (req *request.Request, output *GetVehicleStatusOutput) { - op := &request.Operation{ - Name: opGetVehicleStatus, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetVehicleStatusInput{} - } - - output = &GetVehicleStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVehicleStatus API operation for AWS IoT FleetWise. -// -// Retrieves information about the status of a vehicle with any associated campaigns. -// -// 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 AWS IoT FleetWise's -// API operation GetVehicleStatus for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/GetVehicleStatus -func (c *IoTFleetWise) GetVehicleStatus(input *GetVehicleStatusInput) (*GetVehicleStatusOutput, error) { - req, out := c.GetVehicleStatusRequest(input) - return out, req.Send() -} - -// GetVehicleStatusWithContext is the same as GetVehicleStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetVehicleStatus 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 *IoTFleetWise) GetVehicleStatusWithContext(ctx aws.Context, input *GetVehicleStatusInput, opts ...request.Option) (*GetVehicleStatusOutput, error) { - req, out := c.GetVehicleStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetVehicleStatusPages iterates over the pages of a GetVehicleStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetVehicleStatus method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetVehicleStatus operation. -// pageNum := 0 -// err := client.GetVehicleStatusPages(params, -// func(page *iotfleetwise.GetVehicleStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) GetVehicleStatusPages(input *GetVehicleStatusInput, fn func(*GetVehicleStatusOutput, bool) bool) error { - return c.GetVehicleStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetVehicleStatusPagesWithContext same as GetVehicleStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) GetVehicleStatusPagesWithContext(ctx aws.Context, input *GetVehicleStatusInput, fn func(*GetVehicleStatusOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetVehicleStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetVehicleStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetVehicleStatusOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opImportDecoderManifest = "ImportDecoderManifest" - -// ImportDecoderManifestRequest generates a "aws/request.Request" representing the -// client's request for the ImportDecoderManifest 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 ImportDecoderManifest for more information on using the ImportDecoderManifest -// 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 ImportDecoderManifestRequest method. -// req, resp := client.ImportDecoderManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ImportDecoderManifest -func (c *IoTFleetWise) ImportDecoderManifestRequest(input *ImportDecoderManifestInput) (req *request.Request, output *ImportDecoderManifestOutput) { - op := &request.Operation{ - Name: opImportDecoderManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportDecoderManifestInput{} - } - - output = &ImportDecoderManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportDecoderManifest API operation for AWS IoT FleetWise. -// -// Creates a decoder manifest using your existing CAN DBC file from your local -// device. -// -// 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 AWS IoT FleetWise's -// API operation ImportDecoderManifest for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - DecoderManifestValidationException -// The request couldn't be completed because it contains signal decoders with -// one or more validation errors. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InvalidSignalsException -// The request couldn't be completed because it contains signals that aren't -// valid. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ImportDecoderManifest -func (c *IoTFleetWise) ImportDecoderManifest(input *ImportDecoderManifestInput) (*ImportDecoderManifestOutput, error) { - req, out := c.ImportDecoderManifestRequest(input) - return out, req.Send() -} - -// ImportDecoderManifestWithContext is the same as ImportDecoderManifest with the addition of -// the ability to pass a context and additional request options. -// -// See ImportDecoderManifest 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 *IoTFleetWise) ImportDecoderManifestWithContext(ctx aws.Context, input *ImportDecoderManifestInput, opts ...request.Option) (*ImportDecoderManifestOutput, error) { - req, out := c.ImportDecoderManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportSignalCatalog = "ImportSignalCatalog" - -// ImportSignalCatalogRequest generates a "aws/request.Request" representing the -// client's request for the ImportSignalCatalog 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 ImportSignalCatalog for more information on using the ImportSignalCatalog -// 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 ImportSignalCatalogRequest method. -// req, resp := client.ImportSignalCatalogRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ImportSignalCatalog -func (c *IoTFleetWise) ImportSignalCatalogRequest(input *ImportSignalCatalogInput) (req *request.Request, output *ImportSignalCatalogOutput) { - op := &request.Operation{ - Name: opImportSignalCatalog, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportSignalCatalogInput{} - } - - output = &ImportSignalCatalogOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportSignalCatalog API operation for AWS IoT FleetWise. -// -// Creates a signal catalog using your existing VSS formatted content from your -// local device. -// -// 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 AWS IoT FleetWise's -// API operation ImportSignalCatalog for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InvalidSignalsException -// The request couldn't be completed because it contains signals that aren't -// valid. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ImportSignalCatalog -func (c *IoTFleetWise) ImportSignalCatalog(input *ImportSignalCatalogInput) (*ImportSignalCatalogOutput, error) { - req, out := c.ImportSignalCatalogRequest(input) - return out, req.Send() -} - -// ImportSignalCatalogWithContext is the same as ImportSignalCatalog with the addition of -// the ability to pass a context and additional request options. -// -// See ImportSignalCatalog 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 *IoTFleetWise) ImportSignalCatalogWithContext(ctx aws.Context, input *ImportSignalCatalogInput, opts ...request.Option) (*ImportSignalCatalogOutput, error) { - req, out := c.ImportSignalCatalogRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCampaigns = "ListCampaigns" - -// ListCampaignsRequest generates a "aws/request.Request" representing the -// client's request for the ListCampaigns 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 ListCampaigns for more information on using the ListCampaigns -// 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 ListCampaignsRequest method. -// req, resp := client.ListCampaignsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListCampaigns -func (c *IoTFleetWise) ListCampaignsRequest(input *ListCampaignsInput) (req *request.Request, output *ListCampaignsOutput) { - op := &request.Operation{ - Name: opListCampaigns, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCampaignsInput{} - } - - output = &ListCampaignsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCampaigns API operation for AWS IoT FleetWise. -// -// Lists information about created campaigns. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListCampaigns for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListCampaigns -func (c *IoTFleetWise) ListCampaigns(input *ListCampaignsInput) (*ListCampaignsOutput, error) { - req, out := c.ListCampaignsRequest(input) - return out, req.Send() -} - -// ListCampaignsWithContext is the same as ListCampaigns with the addition of -// the ability to pass a context and additional request options. -// -// See ListCampaigns 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 *IoTFleetWise) ListCampaignsWithContext(ctx aws.Context, input *ListCampaignsInput, opts ...request.Option) (*ListCampaignsOutput, error) { - req, out := c.ListCampaignsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCampaignsPages iterates over the pages of a ListCampaigns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCampaigns method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCampaigns operation. -// pageNum := 0 -// err := client.ListCampaignsPages(params, -// func(page *iotfleetwise.ListCampaignsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListCampaignsPages(input *ListCampaignsInput, fn func(*ListCampaignsOutput, bool) bool) error { - return c.ListCampaignsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCampaignsPagesWithContext same as ListCampaignsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListCampaignsPagesWithContext(ctx aws.Context, input *ListCampaignsInput, fn func(*ListCampaignsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCampaignsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCampaignsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCampaignsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDecoderManifestNetworkInterfaces = "ListDecoderManifestNetworkInterfaces" - -// ListDecoderManifestNetworkInterfacesRequest generates a "aws/request.Request" representing the -// client's request for the ListDecoderManifestNetworkInterfaces 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 ListDecoderManifestNetworkInterfaces for more information on using the ListDecoderManifestNetworkInterfaces -// 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 ListDecoderManifestNetworkInterfacesRequest method. -// req, resp := client.ListDecoderManifestNetworkInterfacesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListDecoderManifestNetworkInterfaces -func (c *IoTFleetWise) ListDecoderManifestNetworkInterfacesRequest(input *ListDecoderManifestNetworkInterfacesInput) (req *request.Request, output *ListDecoderManifestNetworkInterfacesOutput) { - op := &request.Operation{ - Name: opListDecoderManifestNetworkInterfaces, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDecoderManifestNetworkInterfacesInput{} - } - - output = &ListDecoderManifestNetworkInterfacesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDecoderManifestNetworkInterfaces API operation for AWS IoT FleetWise. -// -// Lists the network interfaces specified in a decoder manifest. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListDecoderManifestNetworkInterfaces for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListDecoderManifestNetworkInterfaces -func (c *IoTFleetWise) ListDecoderManifestNetworkInterfaces(input *ListDecoderManifestNetworkInterfacesInput) (*ListDecoderManifestNetworkInterfacesOutput, error) { - req, out := c.ListDecoderManifestNetworkInterfacesRequest(input) - return out, req.Send() -} - -// ListDecoderManifestNetworkInterfacesWithContext is the same as ListDecoderManifestNetworkInterfaces with the addition of -// the ability to pass a context and additional request options. -// -// See ListDecoderManifestNetworkInterfaces 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 *IoTFleetWise) ListDecoderManifestNetworkInterfacesWithContext(ctx aws.Context, input *ListDecoderManifestNetworkInterfacesInput, opts ...request.Option) (*ListDecoderManifestNetworkInterfacesOutput, error) { - req, out := c.ListDecoderManifestNetworkInterfacesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDecoderManifestNetworkInterfacesPages iterates over the pages of a ListDecoderManifestNetworkInterfaces operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDecoderManifestNetworkInterfaces method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDecoderManifestNetworkInterfaces operation. -// pageNum := 0 -// err := client.ListDecoderManifestNetworkInterfacesPages(params, -// func(page *iotfleetwise.ListDecoderManifestNetworkInterfacesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListDecoderManifestNetworkInterfacesPages(input *ListDecoderManifestNetworkInterfacesInput, fn func(*ListDecoderManifestNetworkInterfacesOutput, bool) bool) error { - return c.ListDecoderManifestNetworkInterfacesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDecoderManifestNetworkInterfacesPagesWithContext same as ListDecoderManifestNetworkInterfacesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListDecoderManifestNetworkInterfacesPagesWithContext(ctx aws.Context, input *ListDecoderManifestNetworkInterfacesInput, fn func(*ListDecoderManifestNetworkInterfacesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDecoderManifestNetworkInterfacesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDecoderManifestNetworkInterfacesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDecoderManifestNetworkInterfacesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDecoderManifestSignals = "ListDecoderManifestSignals" - -// ListDecoderManifestSignalsRequest generates a "aws/request.Request" representing the -// client's request for the ListDecoderManifestSignals 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 ListDecoderManifestSignals for more information on using the ListDecoderManifestSignals -// 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 ListDecoderManifestSignalsRequest method. -// req, resp := client.ListDecoderManifestSignalsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListDecoderManifestSignals -func (c *IoTFleetWise) ListDecoderManifestSignalsRequest(input *ListDecoderManifestSignalsInput) (req *request.Request, output *ListDecoderManifestSignalsOutput) { - op := &request.Operation{ - Name: opListDecoderManifestSignals, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDecoderManifestSignalsInput{} - } - - output = &ListDecoderManifestSignalsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDecoderManifestSignals API operation for AWS IoT FleetWise. -// -// A list of information about signal decoders specified in a decoder manifest. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListDecoderManifestSignals for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListDecoderManifestSignals -func (c *IoTFleetWise) ListDecoderManifestSignals(input *ListDecoderManifestSignalsInput) (*ListDecoderManifestSignalsOutput, error) { - req, out := c.ListDecoderManifestSignalsRequest(input) - return out, req.Send() -} - -// ListDecoderManifestSignalsWithContext is the same as ListDecoderManifestSignals with the addition of -// the ability to pass a context and additional request options. -// -// See ListDecoderManifestSignals 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 *IoTFleetWise) ListDecoderManifestSignalsWithContext(ctx aws.Context, input *ListDecoderManifestSignalsInput, opts ...request.Option) (*ListDecoderManifestSignalsOutput, error) { - req, out := c.ListDecoderManifestSignalsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDecoderManifestSignalsPages iterates over the pages of a ListDecoderManifestSignals operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDecoderManifestSignals method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDecoderManifestSignals operation. -// pageNum := 0 -// err := client.ListDecoderManifestSignalsPages(params, -// func(page *iotfleetwise.ListDecoderManifestSignalsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListDecoderManifestSignalsPages(input *ListDecoderManifestSignalsInput, fn func(*ListDecoderManifestSignalsOutput, bool) bool) error { - return c.ListDecoderManifestSignalsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDecoderManifestSignalsPagesWithContext same as ListDecoderManifestSignalsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListDecoderManifestSignalsPagesWithContext(ctx aws.Context, input *ListDecoderManifestSignalsInput, fn func(*ListDecoderManifestSignalsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDecoderManifestSignalsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDecoderManifestSignalsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDecoderManifestSignalsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDecoderManifests = "ListDecoderManifests" - -// ListDecoderManifestsRequest generates a "aws/request.Request" representing the -// client's request for the ListDecoderManifests 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 ListDecoderManifests for more information on using the ListDecoderManifests -// 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 ListDecoderManifestsRequest method. -// req, resp := client.ListDecoderManifestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListDecoderManifests -func (c *IoTFleetWise) ListDecoderManifestsRequest(input *ListDecoderManifestsInput) (req *request.Request, output *ListDecoderManifestsOutput) { - op := &request.Operation{ - Name: opListDecoderManifests, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDecoderManifestsInput{} - } - - output = &ListDecoderManifestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDecoderManifests API operation for AWS IoT FleetWise. -// -// Lists decoder manifests. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListDecoderManifests for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListDecoderManifests -func (c *IoTFleetWise) ListDecoderManifests(input *ListDecoderManifestsInput) (*ListDecoderManifestsOutput, error) { - req, out := c.ListDecoderManifestsRequest(input) - return out, req.Send() -} - -// ListDecoderManifestsWithContext is the same as ListDecoderManifests with the addition of -// the ability to pass a context and additional request options. -// -// See ListDecoderManifests 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 *IoTFleetWise) ListDecoderManifestsWithContext(ctx aws.Context, input *ListDecoderManifestsInput, opts ...request.Option) (*ListDecoderManifestsOutput, error) { - req, out := c.ListDecoderManifestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDecoderManifestsPages iterates over the pages of a ListDecoderManifests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDecoderManifests method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDecoderManifests operation. -// pageNum := 0 -// err := client.ListDecoderManifestsPages(params, -// func(page *iotfleetwise.ListDecoderManifestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListDecoderManifestsPages(input *ListDecoderManifestsInput, fn func(*ListDecoderManifestsOutput, bool) bool) error { - return c.ListDecoderManifestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDecoderManifestsPagesWithContext same as ListDecoderManifestsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListDecoderManifestsPagesWithContext(ctx aws.Context, input *ListDecoderManifestsInput, fn func(*ListDecoderManifestsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDecoderManifestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDecoderManifestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDecoderManifestsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListFleets = "ListFleets" - -// ListFleetsRequest generates a "aws/request.Request" representing the -// client's request for the ListFleets 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 ListFleets for more information on using the ListFleets -// 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 ListFleetsRequest method. -// req, resp := client.ListFleetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListFleets -func (c *IoTFleetWise) ListFleetsRequest(input *ListFleetsInput) (req *request.Request, output *ListFleetsOutput) { - op := &request.Operation{ - Name: opListFleets, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListFleetsInput{} - } - - output = &ListFleetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListFleets API operation for AWS IoT FleetWise. -// -// Retrieves information for each created fleet in an Amazon Web Services account. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListFleets for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListFleets -func (c *IoTFleetWise) ListFleets(input *ListFleetsInput) (*ListFleetsOutput, error) { - req, out := c.ListFleetsRequest(input) - return out, req.Send() -} - -// ListFleetsWithContext is the same as ListFleets with the addition of -// the ability to pass a context and additional request options. -// -// See ListFleets 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 *IoTFleetWise) ListFleetsWithContext(ctx aws.Context, input *ListFleetsInput, opts ...request.Option) (*ListFleetsOutput, error) { - req, out := c.ListFleetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListFleetsPages iterates over the pages of a ListFleets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFleets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListFleets operation. -// pageNum := 0 -// err := client.ListFleetsPages(params, -// func(page *iotfleetwise.ListFleetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListFleetsPages(input *ListFleetsInput, fn func(*ListFleetsOutput, bool) bool) error { - return c.ListFleetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFleetsPagesWithContext same as ListFleetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListFleetsPagesWithContext(ctx aws.Context, input *ListFleetsInput, fn func(*ListFleetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListFleetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListFleetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListFleetsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListFleetsForVehicle = "ListFleetsForVehicle" - -// ListFleetsForVehicleRequest generates a "aws/request.Request" representing the -// client's request for the ListFleetsForVehicle 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 ListFleetsForVehicle for more information on using the ListFleetsForVehicle -// 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 ListFleetsForVehicleRequest method. -// req, resp := client.ListFleetsForVehicleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListFleetsForVehicle -func (c *IoTFleetWise) ListFleetsForVehicleRequest(input *ListFleetsForVehicleInput) (req *request.Request, output *ListFleetsForVehicleOutput) { - op := &request.Operation{ - Name: opListFleetsForVehicle, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListFleetsForVehicleInput{} - } - - output = &ListFleetsForVehicleOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListFleetsForVehicle API operation for AWS IoT FleetWise. -// -// Retrieves a list of IDs for all fleets that the vehicle is associated with. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListFleetsForVehicle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListFleetsForVehicle -func (c *IoTFleetWise) ListFleetsForVehicle(input *ListFleetsForVehicleInput) (*ListFleetsForVehicleOutput, error) { - req, out := c.ListFleetsForVehicleRequest(input) - return out, req.Send() -} - -// ListFleetsForVehicleWithContext is the same as ListFleetsForVehicle with the addition of -// the ability to pass a context and additional request options. -// -// See ListFleetsForVehicle 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 *IoTFleetWise) ListFleetsForVehicleWithContext(ctx aws.Context, input *ListFleetsForVehicleInput, opts ...request.Option) (*ListFleetsForVehicleOutput, error) { - req, out := c.ListFleetsForVehicleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListFleetsForVehiclePages iterates over the pages of a ListFleetsForVehicle operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListFleetsForVehicle method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListFleetsForVehicle operation. -// pageNum := 0 -// err := client.ListFleetsForVehiclePages(params, -// func(page *iotfleetwise.ListFleetsForVehicleOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListFleetsForVehiclePages(input *ListFleetsForVehicleInput, fn func(*ListFleetsForVehicleOutput, bool) bool) error { - return c.ListFleetsForVehiclePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListFleetsForVehiclePagesWithContext same as ListFleetsForVehiclePages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListFleetsForVehiclePagesWithContext(ctx aws.Context, input *ListFleetsForVehicleInput, fn func(*ListFleetsForVehicleOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListFleetsForVehicleInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListFleetsForVehicleRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListFleetsForVehicleOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListModelManifestNodes = "ListModelManifestNodes" - -// ListModelManifestNodesRequest generates a "aws/request.Request" representing the -// client's request for the ListModelManifestNodes 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 ListModelManifestNodes for more information on using the ListModelManifestNodes -// 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 ListModelManifestNodesRequest method. -// req, resp := client.ListModelManifestNodesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListModelManifestNodes -func (c *IoTFleetWise) ListModelManifestNodesRequest(input *ListModelManifestNodesInput) (req *request.Request, output *ListModelManifestNodesOutput) { - op := &request.Operation{ - Name: opListModelManifestNodes, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListModelManifestNodesInput{} - } - - output = &ListModelManifestNodesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListModelManifestNodes API operation for AWS IoT FleetWise. -// -// Lists information about nodes specified in a vehicle model (model manifest). -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListModelManifestNodes for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListModelManifestNodes -func (c *IoTFleetWise) ListModelManifestNodes(input *ListModelManifestNodesInput) (*ListModelManifestNodesOutput, error) { - req, out := c.ListModelManifestNodesRequest(input) - return out, req.Send() -} - -// ListModelManifestNodesWithContext is the same as ListModelManifestNodes with the addition of -// the ability to pass a context and additional request options. -// -// See ListModelManifestNodes 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 *IoTFleetWise) ListModelManifestNodesWithContext(ctx aws.Context, input *ListModelManifestNodesInput, opts ...request.Option) (*ListModelManifestNodesOutput, error) { - req, out := c.ListModelManifestNodesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListModelManifestNodesPages iterates over the pages of a ListModelManifestNodes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListModelManifestNodes method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListModelManifestNodes operation. -// pageNum := 0 -// err := client.ListModelManifestNodesPages(params, -// func(page *iotfleetwise.ListModelManifestNodesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListModelManifestNodesPages(input *ListModelManifestNodesInput, fn func(*ListModelManifestNodesOutput, bool) bool) error { - return c.ListModelManifestNodesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListModelManifestNodesPagesWithContext same as ListModelManifestNodesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListModelManifestNodesPagesWithContext(ctx aws.Context, input *ListModelManifestNodesInput, fn func(*ListModelManifestNodesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListModelManifestNodesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListModelManifestNodesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListModelManifestNodesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListModelManifests = "ListModelManifests" - -// ListModelManifestsRequest generates a "aws/request.Request" representing the -// client's request for the ListModelManifests 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 ListModelManifests for more information on using the ListModelManifests -// 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 ListModelManifestsRequest method. -// req, resp := client.ListModelManifestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListModelManifests -func (c *IoTFleetWise) ListModelManifestsRequest(input *ListModelManifestsInput) (req *request.Request, output *ListModelManifestsOutput) { - op := &request.Operation{ - Name: opListModelManifests, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListModelManifestsInput{} - } - - output = &ListModelManifestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListModelManifests API operation for AWS IoT FleetWise. -// -// Retrieves a list of vehicle models (model manifests). -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListModelManifests for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListModelManifests -func (c *IoTFleetWise) ListModelManifests(input *ListModelManifestsInput) (*ListModelManifestsOutput, error) { - req, out := c.ListModelManifestsRequest(input) - return out, req.Send() -} - -// ListModelManifestsWithContext is the same as ListModelManifests with the addition of -// the ability to pass a context and additional request options. -// -// See ListModelManifests 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 *IoTFleetWise) ListModelManifestsWithContext(ctx aws.Context, input *ListModelManifestsInput, opts ...request.Option) (*ListModelManifestsOutput, error) { - req, out := c.ListModelManifestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListModelManifestsPages iterates over the pages of a ListModelManifests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListModelManifests method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListModelManifests operation. -// pageNum := 0 -// err := client.ListModelManifestsPages(params, -// func(page *iotfleetwise.ListModelManifestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListModelManifestsPages(input *ListModelManifestsInput, fn func(*ListModelManifestsOutput, bool) bool) error { - return c.ListModelManifestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListModelManifestsPagesWithContext same as ListModelManifestsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListModelManifestsPagesWithContext(ctx aws.Context, input *ListModelManifestsInput, fn func(*ListModelManifestsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListModelManifestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListModelManifestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListModelManifestsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSignalCatalogNodes = "ListSignalCatalogNodes" - -// ListSignalCatalogNodesRequest generates a "aws/request.Request" representing the -// client's request for the ListSignalCatalogNodes 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 ListSignalCatalogNodes for more information on using the ListSignalCatalogNodes -// 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 ListSignalCatalogNodesRequest method. -// req, resp := client.ListSignalCatalogNodesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListSignalCatalogNodes -func (c *IoTFleetWise) ListSignalCatalogNodesRequest(input *ListSignalCatalogNodesInput) (req *request.Request, output *ListSignalCatalogNodesOutput) { - op := &request.Operation{ - Name: opListSignalCatalogNodes, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSignalCatalogNodesInput{} - } - - output = &ListSignalCatalogNodesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSignalCatalogNodes API operation for AWS IoT FleetWise. -// -// Lists of information about the signals (nodes) specified in a signal catalog. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListSignalCatalogNodes for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListSignalCatalogNodes -func (c *IoTFleetWise) ListSignalCatalogNodes(input *ListSignalCatalogNodesInput) (*ListSignalCatalogNodesOutput, error) { - req, out := c.ListSignalCatalogNodesRequest(input) - return out, req.Send() -} - -// ListSignalCatalogNodesWithContext is the same as ListSignalCatalogNodes with the addition of -// the ability to pass a context and additional request options. -// -// See ListSignalCatalogNodes 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 *IoTFleetWise) ListSignalCatalogNodesWithContext(ctx aws.Context, input *ListSignalCatalogNodesInput, opts ...request.Option) (*ListSignalCatalogNodesOutput, error) { - req, out := c.ListSignalCatalogNodesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSignalCatalogNodesPages iterates over the pages of a ListSignalCatalogNodes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSignalCatalogNodes method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSignalCatalogNodes operation. -// pageNum := 0 -// err := client.ListSignalCatalogNodesPages(params, -// func(page *iotfleetwise.ListSignalCatalogNodesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListSignalCatalogNodesPages(input *ListSignalCatalogNodesInput, fn func(*ListSignalCatalogNodesOutput, bool) bool) error { - return c.ListSignalCatalogNodesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSignalCatalogNodesPagesWithContext same as ListSignalCatalogNodesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListSignalCatalogNodesPagesWithContext(ctx aws.Context, input *ListSignalCatalogNodesInput, fn func(*ListSignalCatalogNodesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSignalCatalogNodesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSignalCatalogNodesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSignalCatalogNodesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSignalCatalogs = "ListSignalCatalogs" - -// ListSignalCatalogsRequest generates a "aws/request.Request" representing the -// client's request for the ListSignalCatalogs 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 ListSignalCatalogs for more information on using the ListSignalCatalogs -// 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 ListSignalCatalogsRequest method. -// req, resp := client.ListSignalCatalogsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListSignalCatalogs -func (c *IoTFleetWise) ListSignalCatalogsRequest(input *ListSignalCatalogsInput) (req *request.Request, output *ListSignalCatalogsOutput) { - op := &request.Operation{ - Name: opListSignalCatalogs, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSignalCatalogsInput{} - } - - output = &ListSignalCatalogsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSignalCatalogs API operation for AWS IoT FleetWise. -// -// Lists all the created signal catalogs in an Amazon Web Services account. -// -// You can use to list information about each signal (node) specified in a signal -// catalog. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListSignalCatalogs for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListSignalCatalogs -func (c *IoTFleetWise) ListSignalCatalogs(input *ListSignalCatalogsInput) (*ListSignalCatalogsOutput, error) { - req, out := c.ListSignalCatalogsRequest(input) - return out, req.Send() -} - -// ListSignalCatalogsWithContext is the same as ListSignalCatalogs with the addition of -// the ability to pass a context and additional request options. -// -// See ListSignalCatalogs 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 *IoTFleetWise) ListSignalCatalogsWithContext(ctx aws.Context, input *ListSignalCatalogsInput, opts ...request.Option) (*ListSignalCatalogsOutput, error) { - req, out := c.ListSignalCatalogsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSignalCatalogsPages iterates over the pages of a ListSignalCatalogs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSignalCatalogs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSignalCatalogs operation. -// pageNum := 0 -// err := client.ListSignalCatalogsPages(params, -// func(page *iotfleetwise.ListSignalCatalogsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListSignalCatalogsPages(input *ListSignalCatalogsInput, fn func(*ListSignalCatalogsOutput, bool) bool) error { - return c.ListSignalCatalogsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSignalCatalogsPagesWithContext same as ListSignalCatalogsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListSignalCatalogsPagesWithContext(ctx aws.Context, input *ListSignalCatalogsInput, fn func(*ListSignalCatalogsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSignalCatalogsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSignalCatalogsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSignalCatalogsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListTagsForResource -func (c *IoTFleetWise) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS IoT FleetWise. -// -// Lists the tags (metadata) you have assigned to the resource. -// -// 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 AWS IoT FleetWise's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListTagsForResource -func (c *IoTFleetWise) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *IoTFleetWise) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListVehicles = "ListVehicles" - -// ListVehiclesRequest generates a "aws/request.Request" representing the -// client's request for the ListVehicles 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 ListVehicles for more information on using the ListVehicles -// 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 ListVehiclesRequest method. -// req, resp := client.ListVehiclesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListVehicles -func (c *IoTFleetWise) ListVehiclesRequest(input *ListVehiclesInput) (req *request.Request, output *ListVehiclesOutput) { - op := &request.Operation{ - Name: opListVehicles, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVehiclesInput{} - } - - output = &ListVehiclesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVehicles API operation for AWS IoT FleetWise. -// -// Retrieves a list of summaries of created vehicles. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListVehicles for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListVehicles -func (c *IoTFleetWise) ListVehicles(input *ListVehiclesInput) (*ListVehiclesOutput, error) { - req, out := c.ListVehiclesRequest(input) - return out, req.Send() -} - -// ListVehiclesWithContext is the same as ListVehicles with the addition of -// the ability to pass a context and additional request options. -// -// See ListVehicles 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 *IoTFleetWise) ListVehiclesWithContext(ctx aws.Context, input *ListVehiclesInput, opts ...request.Option) (*ListVehiclesOutput, error) { - req, out := c.ListVehiclesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVehiclesPages iterates over the pages of a ListVehicles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVehicles method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVehicles operation. -// pageNum := 0 -// err := client.ListVehiclesPages(params, -// func(page *iotfleetwise.ListVehiclesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListVehiclesPages(input *ListVehiclesInput, fn func(*ListVehiclesOutput, bool) bool) error { - return c.ListVehiclesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVehiclesPagesWithContext same as ListVehiclesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListVehiclesPagesWithContext(ctx aws.Context, input *ListVehiclesInput, fn func(*ListVehiclesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVehiclesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVehiclesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVehiclesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListVehiclesInFleet = "ListVehiclesInFleet" - -// ListVehiclesInFleetRequest generates a "aws/request.Request" representing the -// client's request for the ListVehiclesInFleet 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 ListVehiclesInFleet for more information on using the ListVehiclesInFleet -// 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 ListVehiclesInFleetRequest method. -// req, resp := client.ListVehiclesInFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListVehiclesInFleet -func (c *IoTFleetWise) ListVehiclesInFleetRequest(input *ListVehiclesInFleetInput) (req *request.Request, output *ListVehiclesInFleetOutput) { - op := &request.Operation{ - Name: opListVehiclesInFleet, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVehiclesInFleetInput{} - } - - output = &ListVehiclesInFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVehiclesInFleet API operation for AWS IoT FleetWise. -// -// Retrieves a list of summaries of all vehicles associated with a fleet. -// -// This API operation uses pagination. Specify the nextToken parameter in the -// request to return more results. -// -// 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 AWS IoT FleetWise's -// API operation ListVehiclesInFleet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/ListVehiclesInFleet -func (c *IoTFleetWise) ListVehiclesInFleet(input *ListVehiclesInFleetInput) (*ListVehiclesInFleetOutput, error) { - req, out := c.ListVehiclesInFleetRequest(input) - return out, req.Send() -} - -// ListVehiclesInFleetWithContext is the same as ListVehiclesInFleet with the addition of -// the ability to pass a context and additional request options. -// -// See ListVehiclesInFleet 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 *IoTFleetWise) ListVehiclesInFleetWithContext(ctx aws.Context, input *ListVehiclesInFleetInput, opts ...request.Option) (*ListVehiclesInFleetOutput, error) { - req, out := c.ListVehiclesInFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVehiclesInFleetPages iterates over the pages of a ListVehiclesInFleet operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVehiclesInFleet method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVehiclesInFleet operation. -// pageNum := 0 -// err := client.ListVehiclesInFleetPages(params, -// func(page *iotfleetwise.ListVehiclesInFleetOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTFleetWise) ListVehiclesInFleetPages(input *ListVehiclesInFleetInput, fn func(*ListVehiclesInFleetOutput, bool) bool) error { - return c.ListVehiclesInFleetPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVehiclesInFleetPagesWithContext same as ListVehiclesInFleetPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTFleetWise) ListVehiclesInFleetPagesWithContext(ctx aws.Context, input *ListVehiclesInFleetInput, fn func(*ListVehiclesInFleetOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVehiclesInFleetInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVehiclesInFleetRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVehiclesInFleetOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutEncryptionConfiguration = "PutEncryptionConfiguration" - -// PutEncryptionConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutEncryptionConfiguration 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 PutEncryptionConfiguration for more information on using the PutEncryptionConfiguration -// 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 PutEncryptionConfigurationRequest method. -// req, resp := client.PutEncryptionConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/PutEncryptionConfiguration -func (c *IoTFleetWise) PutEncryptionConfigurationRequest(input *PutEncryptionConfigurationInput) (req *request.Request, output *PutEncryptionConfigurationOutput) { - op := &request.Operation{ - Name: opPutEncryptionConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutEncryptionConfigurationInput{} - } - - output = &PutEncryptionConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutEncryptionConfiguration API operation for AWS IoT FleetWise. -// -// Creates or updates the encryption configuration. Amazon Web Services IoT -// FleetWise can encrypt your data and resources using an Amazon Web Services -// managed key. Or, you can use a KMS key that you own and manage. For more -// information, see Data encryption (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/data-encryption.html) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// 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 AWS IoT FleetWise's -// API operation PutEncryptionConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/PutEncryptionConfiguration -func (c *IoTFleetWise) PutEncryptionConfiguration(input *PutEncryptionConfigurationInput) (*PutEncryptionConfigurationOutput, error) { - req, out := c.PutEncryptionConfigurationRequest(input) - return out, req.Send() -} - -// PutEncryptionConfigurationWithContext is the same as PutEncryptionConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutEncryptionConfiguration 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 *IoTFleetWise) PutEncryptionConfigurationWithContext(ctx aws.Context, input *PutEncryptionConfigurationInput, opts ...request.Option) (*PutEncryptionConfigurationOutput, error) { - req, out := c.PutEncryptionConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutLoggingOptions = "PutLoggingOptions" - -// PutLoggingOptionsRequest generates a "aws/request.Request" representing the -// client's request for the PutLoggingOptions 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 PutLoggingOptions for more information on using the PutLoggingOptions -// 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 PutLoggingOptionsRequest method. -// req, resp := client.PutLoggingOptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/PutLoggingOptions -func (c *IoTFleetWise) PutLoggingOptionsRequest(input *PutLoggingOptionsInput) (req *request.Request, output *PutLoggingOptionsOutput) { - op := &request.Operation{ - Name: opPutLoggingOptions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutLoggingOptionsInput{} - } - - output = &PutLoggingOptionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutLoggingOptions API operation for AWS IoT FleetWise. -// -// Creates or updates the logging option. -// -// 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 AWS IoT FleetWise's -// API operation PutLoggingOptions for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/PutLoggingOptions -func (c *IoTFleetWise) PutLoggingOptions(input *PutLoggingOptionsInput) (*PutLoggingOptionsOutput, error) { - req, out := c.PutLoggingOptionsRequest(input) - return out, req.Send() -} - -// PutLoggingOptionsWithContext is the same as PutLoggingOptions with the addition of -// the ability to pass a context and additional request options. -// -// See PutLoggingOptions 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 *IoTFleetWise) PutLoggingOptionsWithContext(ctx aws.Context, input *PutLoggingOptionsInput, opts ...request.Option) (*PutLoggingOptionsOutput, error) { - req, out := c.PutLoggingOptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterAccount = "RegisterAccount" - -// RegisterAccountRequest generates a "aws/request.Request" representing the -// client's request for the RegisterAccount 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 RegisterAccount for more information on using the RegisterAccount -// 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 RegisterAccountRequest method. -// req, resp := client.RegisterAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/RegisterAccount -func (c *IoTFleetWise) RegisterAccountRequest(input *RegisterAccountInput) (req *request.Request, output *RegisterAccountOutput) { - op := &request.Operation{ - Name: opRegisterAccount, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterAccountInput{} - } - - output = &RegisterAccountOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterAccount API operation for AWS IoT FleetWise. -// -// This API operation contains deprecated parameters. Register your account -// again without the Timestream resources parameter so that Amazon Web Services -// IoT FleetWise can remove the Timestream metadata stored. You should then -// pass the data destination into the CreateCampaign (https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_CreateCampaign.html) -// API operation. -// -// You must delete any existing campaigns that include an empty data destination -// before you register your account again. For more information, see the DeleteCampaign -// (https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_DeleteCampaign.html) -// API operation. -// -// If you want to delete the Timestream inline policy from the service-linked -// role, such as to mitigate an overly permissive policy, you must first delete -// any existing campaigns. Then delete the service-linked role and register -// your account again to enable CloudWatch metrics. For more information, see -// DeleteServiceLinkedRole (https://docs.aws.amazon.com/IAM/latest/APIReference/API_DeleteServiceLinkedRole.html) -// in the Identity and Access Management API Reference. -// -// Registers your Amazon Web Services account, IAM, and Amazon Timestream resources -// so Amazon Web Services IoT FleetWise can transfer your vehicle data to the -// Amazon Web Services Cloud. For more information, including step-by-step procedures, -// see Setting up Amazon Web Services IoT FleetWise (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/setting-up.html). -// -// An Amazon Web Services account is not the same thing as a "user." An Amazon -// Web Services user (https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_identity-management.html#intro-identity-users) -// is an identity that you create using Identity and Access Management (IAM) -// and takes the form of either an IAM user (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html) -// or an IAM role, both with credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html). -// A single Amazon Web Services account can, and typically does, contain many -// users and roles. -// -// 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 AWS IoT FleetWise's -// API operation RegisterAccount for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/RegisterAccount -func (c *IoTFleetWise) RegisterAccount(input *RegisterAccountInput) (*RegisterAccountOutput, error) { - req, out := c.RegisterAccountRequest(input) - return out, req.Send() -} - -// RegisterAccountWithContext is the same as RegisterAccount with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterAccount 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 *IoTFleetWise) RegisterAccountWithContext(ctx aws.Context, input *RegisterAccountInput, opts ...request.Option) (*RegisterAccountOutput, error) { - req, out := c.RegisterAccountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/TagResource -func (c *IoTFleetWise) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS IoT FleetWise. -// -// Adds to or modifies the tags of the given resource. Tags are metadata which -// can be used to manage a resource. -// -// 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 AWS IoT FleetWise's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/TagResource -func (c *IoTFleetWise) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *IoTFleetWise) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UntagResource -func (c *IoTFleetWise) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS IoT FleetWise. -// -// Removes the given tags (metadata) from the resource. -// -// 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 AWS IoT FleetWise's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UntagResource -func (c *IoTFleetWise) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *IoTFleetWise) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCampaign = "UpdateCampaign" - -// UpdateCampaignRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCampaign 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 UpdateCampaign for more information on using the UpdateCampaign -// 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 UpdateCampaignRequest method. -// req, resp := client.UpdateCampaignRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateCampaign -func (c *IoTFleetWise) UpdateCampaignRequest(input *UpdateCampaignInput) (req *request.Request, output *UpdateCampaignOutput) { - op := &request.Operation{ - Name: opUpdateCampaign, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateCampaignInput{} - } - - output = &UpdateCampaignOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateCampaign API operation for AWS IoT FleetWise. -// -// Updates a campaign. -// -// 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 AWS IoT FleetWise's -// API operation UpdateCampaign for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateCampaign -func (c *IoTFleetWise) UpdateCampaign(input *UpdateCampaignInput) (*UpdateCampaignOutput, error) { - req, out := c.UpdateCampaignRequest(input) - return out, req.Send() -} - -// UpdateCampaignWithContext is the same as UpdateCampaign with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCampaign 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 *IoTFleetWise) UpdateCampaignWithContext(ctx aws.Context, input *UpdateCampaignInput, opts ...request.Option) (*UpdateCampaignOutput, error) { - req, out := c.UpdateCampaignRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDecoderManifest = "UpdateDecoderManifest" - -// UpdateDecoderManifestRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDecoderManifest 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 UpdateDecoderManifest for more information on using the UpdateDecoderManifest -// 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 UpdateDecoderManifestRequest method. -// req, resp := client.UpdateDecoderManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateDecoderManifest -func (c *IoTFleetWise) UpdateDecoderManifestRequest(input *UpdateDecoderManifestInput) (req *request.Request, output *UpdateDecoderManifestOutput) { - op := &request.Operation{ - Name: opUpdateDecoderManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateDecoderManifestInput{} - } - - output = &UpdateDecoderManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDecoderManifest API operation for AWS IoT FleetWise. -// -// Updates a decoder manifest. -// -// A decoder manifest can only be updated when the status is DRAFT. Only ACTIVE -// decoder manifests can be associated with vehicles. -// -// 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 AWS IoT FleetWise's -// API operation UpdateDecoderManifest for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - DecoderManifestValidationException -// The request couldn't be completed because it contains signal decoders with -// one or more validation errors. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateDecoderManifest -func (c *IoTFleetWise) UpdateDecoderManifest(input *UpdateDecoderManifestInput) (*UpdateDecoderManifestOutput, error) { - req, out := c.UpdateDecoderManifestRequest(input) - return out, req.Send() -} - -// UpdateDecoderManifestWithContext is the same as UpdateDecoderManifest with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDecoderManifest 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 *IoTFleetWise) UpdateDecoderManifestWithContext(ctx aws.Context, input *UpdateDecoderManifestInput, opts ...request.Option) (*UpdateDecoderManifestOutput, error) { - req, out := c.UpdateDecoderManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateFleet = "UpdateFleet" - -// UpdateFleetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateFleet 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 UpdateFleet for more information on using the UpdateFleet -// 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 UpdateFleetRequest method. -// req, resp := client.UpdateFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateFleet -func (c *IoTFleetWise) UpdateFleetRequest(input *UpdateFleetInput) (req *request.Request, output *UpdateFleetOutput) { - op := &request.Operation{ - Name: opUpdateFleet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateFleetInput{} - } - - output = &UpdateFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateFleet API operation for AWS IoT FleetWise. -// -// Updates the description of an existing fleet. -// -// If the fleet is successfully updated, Amazon Web Services IoT FleetWise sends -// back an HTTP 200 response with an empty HTTP body. -// -// 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 AWS IoT FleetWise's -// API operation UpdateFleet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateFleet -func (c *IoTFleetWise) UpdateFleet(input *UpdateFleetInput) (*UpdateFleetOutput, error) { - req, out := c.UpdateFleetRequest(input) - return out, req.Send() -} - -// UpdateFleetWithContext is the same as UpdateFleet with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateFleet 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 *IoTFleetWise) UpdateFleetWithContext(ctx aws.Context, input *UpdateFleetInput, opts ...request.Option) (*UpdateFleetOutput, error) { - req, out := c.UpdateFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateModelManifest = "UpdateModelManifest" - -// UpdateModelManifestRequest generates a "aws/request.Request" representing the -// client's request for the UpdateModelManifest 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 UpdateModelManifest for more information on using the UpdateModelManifest -// 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 UpdateModelManifestRequest method. -// req, resp := client.UpdateModelManifestRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateModelManifest -func (c *IoTFleetWise) UpdateModelManifestRequest(input *UpdateModelManifestInput) (req *request.Request, output *UpdateModelManifestOutput) { - op := &request.Operation{ - Name: opUpdateModelManifest, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateModelManifestInput{} - } - - output = &UpdateModelManifestOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateModelManifest API operation for AWS IoT FleetWise. -// -// Updates a vehicle model (model manifest). If created vehicles are associated -// with a vehicle model, it can't be updated. -// -// 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 AWS IoT FleetWise's -// API operation UpdateModelManifest for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InvalidSignalsException -// The request couldn't be completed because it contains signals that aren't -// valid. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateModelManifest -func (c *IoTFleetWise) UpdateModelManifest(input *UpdateModelManifestInput) (*UpdateModelManifestOutput, error) { - req, out := c.UpdateModelManifestRequest(input) - return out, req.Send() -} - -// UpdateModelManifestWithContext is the same as UpdateModelManifest with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateModelManifest 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 *IoTFleetWise) UpdateModelManifestWithContext(ctx aws.Context, input *UpdateModelManifestInput, opts ...request.Option) (*UpdateModelManifestOutput, error) { - req, out := c.UpdateModelManifestRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSignalCatalog = "UpdateSignalCatalog" - -// UpdateSignalCatalogRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSignalCatalog 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 UpdateSignalCatalog for more information on using the UpdateSignalCatalog -// 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 UpdateSignalCatalogRequest method. -// req, resp := client.UpdateSignalCatalogRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateSignalCatalog -func (c *IoTFleetWise) UpdateSignalCatalogRequest(input *UpdateSignalCatalogInput) (req *request.Request, output *UpdateSignalCatalogOutput) { - op := &request.Operation{ - Name: opUpdateSignalCatalog, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSignalCatalogInput{} - } - - output = &UpdateSignalCatalogOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSignalCatalog API operation for AWS IoT FleetWise. -// -// Updates a signal catalog. -// -// 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 AWS IoT FleetWise's -// API operation UpdateSignalCatalog for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - LimitExceededException -// A service quota was exceeded. -// -// - InvalidNodeException -// The specified node type doesn't match the expected node type for a node. -// You can specify the node type as branch, sensor, actuator, or attribute. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - InvalidSignalsException -// The request couldn't be completed because it contains signals that aren't -// valid. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateSignalCatalog -func (c *IoTFleetWise) UpdateSignalCatalog(input *UpdateSignalCatalogInput) (*UpdateSignalCatalogOutput, error) { - req, out := c.UpdateSignalCatalogRequest(input) - return out, req.Send() -} - -// UpdateSignalCatalogWithContext is the same as UpdateSignalCatalog with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSignalCatalog 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 *IoTFleetWise) UpdateSignalCatalogWithContext(ctx aws.Context, input *UpdateSignalCatalogInput, opts ...request.Option) (*UpdateSignalCatalogOutput, error) { - req, out := c.UpdateSignalCatalogRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateVehicle = "UpdateVehicle" - -// UpdateVehicleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVehicle 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 UpdateVehicle for more information on using the UpdateVehicle -// 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 UpdateVehicleRequest method. -// req, resp := client.UpdateVehicleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateVehicle -func (c *IoTFleetWise) UpdateVehicleRequest(input *UpdateVehicleInput) (req *request.Request, output *UpdateVehicleOutput) { - op := &request.Operation{ - Name: opUpdateVehicle, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateVehicleInput{} - } - - output = &UpdateVehicleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateVehicle API operation for AWS IoT FleetWise. -// -// Updates a vehicle. -// -// 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 AWS IoT FleetWise's -// API operation UpdateVehicle for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request couldn't be completed because the server temporarily failed. -// -// - ResourceNotFoundException -// The resource wasn't found. -// -// - ConflictException -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -// -// - ThrottlingException -// The request couldn't be completed due to throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17/UpdateVehicle -func (c *IoTFleetWise) UpdateVehicle(input *UpdateVehicleInput) (*UpdateVehicleOutput, error) { - req, out := c.UpdateVehicleRequest(input) - return out, req.Send() -} - -// UpdateVehicleWithContext is the same as UpdateVehicle with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateVehicle 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 *IoTFleetWise) UpdateVehicleWithContext(ctx aws.Context, input *UpdateVehicleInput, opts ...request.Option) (*UpdateVehicleOutput, error) { - req, out := c.UpdateVehicleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have sufficient permission to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A signal that represents a vehicle device such as the engine, heater, and -// door locks. Data from an actuator reports the state of a certain vehicle -// device. -// -// Updating actuator data can change the state of a device. For example, you -// can turn on or off the heater by updating its actuator data. -type Actuator struct { - _ struct{} `type:"structure"` - - // A list of possible values an actuator can take. - AllowedValues []*string `locationName:"allowedValues" type:"list"` - - // A specified value for the actuator. - // - // Deprecated: assignedValue is no longer in use - AssignedValue *string `locationName:"assignedValue" deprecated:"true" type:"string"` - - // A comment in addition to the description. - Comment *string `locationName:"comment" min:"1" type:"string"` - - // The specified data type of the actuator. - // - // DataType is a required field - DataType *string `locationName:"dataType" type:"string" required:"true" enum:"NodeDataType"` - - // The deprecation message for the node or the branch that was moved or deleted. - DeprecationMessage *string `locationName:"deprecationMessage" min:"1" type:"string"` - - // A brief description of the actuator. - Description *string `locationName:"description" min:"1" type:"string"` - - // The fully qualified name of the actuator. For example, the fully qualified - // name of an actuator might be Vehicle.Front.Left.Door.Lock. - // - // FullyQualifiedName is a required field - FullyQualifiedName *string `locationName:"fullyQualifiedName" type:"string" required:"true"` - - // The specified possible maximum value of an actuator. - Max *float64 `locationName:"max" type:"double"` - - // The specified possible minimum value of an actuator. - Min *float64 `locationName:"min" type:"double"` - - // The fully qualified name of the struct node for the actuator if the data - // type of the actuator is Struct or StructArray. For example, the struct fully - // qualified name of an actuator might be Vehicle.Door.LockStruct. - StructFullyQualifiedName *string `locationName:"structFullyQualifiedName" min:"1" type:"string"` - - // The scientific unit for the actuator. - Unit *string `locationName:"unit" 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 Actuator) 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 Actuator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Actuator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Actuator"} - if s.Comment != nil && len(*s.Comment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Comment", 1)) - } - if s.DataType == nil { - invalidParams.Add(request.NewErrParamRequired("DataType")) - } - if s.DeprecationMessage != nil && len(*s.DeprecationMessage) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeprecationMessage", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FullyQualifiedName == nil { - invalidParams.Add(request.NewErrParamRequired("FullyQualifiedName")) - } - if s.StructFullyQualifiedName != nil && len(*s.StructFullyQualifiedName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StructFullyQualifiedName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *Actuator) SetAllowedValues(v []*string) *Actuator { - s.AllowedValues = v - return s -} - -// SetAssignedValue sets the AssignedValue field's value. -func (s *Actuator) SetAssignedValue(v string) *Actuator { - s.AssignedValue = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *Actuator) SetComment(v string) *Actuator { - s.Comment = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *Actuator) SetDataType(v string) *Actuator { - s.DataType = &v - return s -} - -// SetDeprecationMessage sets the DeprecationMessage field's value. -func (s *Actuator) SetDeprecationMessage(v string) *Actuator { - s.DeprecationMessage = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Actuator) SetDescription(v string) *Actuator { - s.Description = &v - return s -} - -// SetFullyQualifiedName sets the FullyQualifiedName field's value. -func (s *Actuator) SetFullyQualifiedName(v string) *Actuator { - s.FullyQualifiedName = &v - return s -} - -// SetMax sets the Max field's value. -func (s *Actuator) SetMax(v float64) *Actuator { - s.Max = &v - return s -} - -// SetMin sets the Min field's value. -func (s *Actuator) SetMin(v float64) *Actuator { - s.Min = &v - return s -} - -// SetStructFullyQualifiedName sets the StructFullyQualifiedName field's value. -func (s *Actuator) SetStructFullyQualifiedName(v string) *Actuator { - s.StructFullyQualifiedName = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *Actuator) SetUnit(v string) *Actuator { - s.Unit = &v - return s -} - -type AssociateVehicleFleetInput struct { - _ struct{} `type:"structure"` - - // The ID of a fleet. - // - // FleetId is a required field - FleetId *string `locationName:"fleetId" min:"1" type:"string" required:"true"` - - // The unique ID of the vehicle to associate with the fleet. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 AssociateVehicleFleetInput) 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 AssociateVehicleFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateVehicleFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateVehicleFleetInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.FleetId != nil && len(*s.FleetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FleetId", 1)) - } - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFleetId sets the FleetId field's value. -func (s *AssociateVehicleFleetInput) SetFleetId(v string) *AssociateVehicleFleetInput { - s.FleetId = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *AssociateVehicleFleetInput) SetVehicleName(v string) *AssociateVehicleFleetInput { - s.VehicleName = &v - return s -} - -type AssociateVehicleFleetOutput 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 AssociateVehicleFleetOutput) 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 AssociateVehicleFleetOutput) GoString() string { - return s.String() -} - -// A signal that represents static information about the vehicle, such as engine -// type or manufacturing date. -type Attribute struct { - _ struct{} `type:"structure"` - - // A list of possible values an attribute can be assigned. - AllowedValues []*string `locationName:"allowedValues" type:"list"` - - // A specified value for the attribute. - // - // Deprecated: assignedValue is no longer in use - AssignedValue *string `locationName:"assignedValue" deprecated:"true" type:"string"` - - // A comment in addition to the description. - Comment *string `locationName:"comment" min:"1" type:"string"` - - // The specified data type of the attribute. - // - // DataType is a required field - DataType *string `locationName:"dataType" type:"string" required:"true" enum:"NodeDataType"` - - // The default value of the attribute. - DefaultValue *string `locationName:"defaultValue" type:"string"` - - // The deprecation message for the node or the branch that was moved or deleted. - DeprecationMessage *string `locationName:"deprecationMessage" min:"1" type:"string"` - - // A brief description of the attribute. - Description *string `locationName:"description" min:"1" type:"string"` - - // The fully qualified name of the attribute. For example, the fully qualified - // name of an attribute might be Vehicle.Body.Engine.Type. - // - // FullyQualifiedName is a required field - FullyQualifiedName *string `locationName:"fullyQualifiedName" type:"string" required:"true"` - - // The specified possible maximum value of the attribute. - Max *float64 `locationName:"max" type:"double"` - - // The specified possible minimum value of the attribute. - Min *float64 `locationName:"min" type:"double"` - - // The scientific unit for the attribute. - Unit *string `locationName:"unit" 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 Attribute) 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 Attribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Attribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Attribute"} - if s.Comment != nil && len(*s.Comment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Comment", 1)) - } - if s.DataType == nil { - invalidParams.Add(request.NewErrParamRequired("DataType")) - } - if s.DeprecationMessage != nil && len(*s.DeprecationMessage) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeprecationMessage", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FullyQualifiedName == nil { - invalidParams.Add(request.NewErrParamRequired("FullyQualifiedName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *Attribute) SetAllowedValues(v []*string) *Attribute { - s.AllowedValues = v - return s -} - -// SetAssignedValue sets the AssignedValue field's value. -func (s *Attribute) SetAssignedValue(v string) *Attribute { - s.AssignedValue = &v - return s -} - -// SetComment sets the Comment field's value. -func (s *Attribute) SetComment(v string) *Attribute { - s.Comment = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *Attribute) SetDataType(v string) *Attribute { - s.DataType = &v - return s -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *Attribute) SetDefaultValue(v string) *Attribute { - s.DefaultValue = &v - return s -} - -// SetDeprecationMessage sets the DeprecationMessage field's value. -func (s *Attribute) SetDeprecationMessage(v string) *Attribute { - s.DeprecationMessage = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Attribute) SetDescription(v string) *Attribute { - s.Description = &v - return s -} - -// SetFullyQualifiedName sets the FullyQualifiedName field's value. -func (s *Attribute) SetFullyQualifiedName(v string) *Attribute { - s.FullyQualifiedName = &v - return s -} - -// SetMax sets the Max field's value. -func (s *Attribute) SetMax(v float64) *Attribute { - s.Max = &v - return s -} - -// SetMin sets the Min field's value. -func (s *Attribute) SetMin(v float64) *Attribute { - s.Min = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *Attribute) SetUnit(v string) *Attribute { - s.Unit = &v - return s -} - -type BatchCreateVehicleInput struct { - _ struct{} `type:"structure"` - - // A list of information about each vehicle to create. For more information, - // see the API data type. - // - // Vehicles is a required field - Vehicles []*CreateVehicleRequestItem `locationName:"vehicles" min:"1" type:"list" 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 BatchCreateVehicleInput) 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 BatchCreateVehicleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchCreateVehicleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchCreateVehicleInput"} - if s.Vehicles == nil { - invalidParams.Add(request.NewErrParamRequired("Vehicles")) - } - if s.Vehicles != nil && len(s.Vehicles) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Vehicles", 1)) - } - if s.Vehicles != nil { - for i, v := range s.Vehicles { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Vehicles", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVehicles sets the Vehicles field's value. -func (s *BatchCreateVehicleInput) SetVehicles(v []*CreateVehicleRequestItem) *BatchCreateVehicleInput { - s.Vehicles = v - return s -} - -type BatchCreateVehicleOutput struct { - _ struct{} `type:"structure"` - - // A list of information about creation errors, or an empty list if there aren't - // any errors. - Errors []*CreateVehicleError `locationName:"errors" type:"list"` - - // A list of information about a batch of created vehicles. For more information, - // see the API data type. - Vehicles []*CreateVehicleResponseItem `locationName:"vehicles" type:"list"` -} - -// 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 BatchCreateVehicleOutput) 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 BatchCreateVehicleOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchCreateVehicleOutput) SetErrors(v []*CreateVehicleError) *BatchCreateVehicleOutput { - s.Errors = v - return s -} - -// SetVehicles sets the Vehicles field's value. -func (s *BatchCreateVehicleOutput) SetVehicles(v []*CreateVehicleResponseItem) *BatchCreateVehicleOutput { - s.Vehicles = v - return s -} - -type BatchUpdateVehicleInput struct { - _ struct{} `type:"structure"` - - // A list of information about the vehicles to update. For more information, - // see the API data type. - // - // Vehicles is a required field - Vehicles []*UpdateVehicleRequestItem `locationName:"vehicles" min:"1" type:"list" 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 BatchUpdateVehicleInput) 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 BatchUpdateVehicleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchUpdateVehicleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchUpdateVehicleInput"} - if s.Vehicles == nil { - invalidParams.Add(request.NewErrParamRequired("Vehicles")) - } - if s.Vehicles != nil && len(s.Vehicles) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Vehicles", 1)) - } - if s.Vehicles != nil { - for i, v := range s.Vehicles { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Vehicles", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVehicles sets the Vehicles field's value. -func (s *BatchUpdateVehicleInput) SetVehicles(v []*UpdateVehicleRequestItem) *BatchUpdateVehicleInput { - s.Vehicles = v - return s -} - -type BatchUpdateVehicleOutput struct { - _ struct{} `type:"structure"` - - // A list of information about errors returned while updating a batch of vehicles, - // or, if there aren't any errors, an empty list. - Errors []*UpdateVehicleError `locationName:"errors" type:"list"` - - // A list of information about the batch of updated vehicles. - // - // This list contains only unique IDs for the vehicles that were updated. - Vehicles []*UpdateVehicleResponseItem `locationName:"vehicles" type:"list"` -} - -// 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 BatchUpdateVehicleOutput) 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 BatchUpdateVehicleOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchUpdateVehicleOutput) SetErrors(v []*UpdateVehicleError) *BatchUpdateVehicleOutput { - s.Errors = v - return s -} - -// SetVehicles sets the Vehicles field's value. -func (s *BatchUpdateVehicleOutput) SetVehicles(v []*UpdateVehicleResponseItem) *BatchUpdateVehicleOutput { - s.Vehicles = v - return s -} - -// A group of signals that are defined in a hierarchical structure. -type Branch struct { - _ struct{} `type:"structure"` - - // A comment in addition to the description. - Comment *string `locationName:"comment" min:"1" type:"string"` - - // The deprecation message for the node or the branch that was moved or deleted. - DeprecationMessage *string `locationName:"deprecationMessage" min:"1" type:"string"` - - // A brief description of the branch. - Description *string `locationName:"description" min:"1" type:"string"` - - // The fully qualified name of the branch. For example, the fully qualified - // name of a branch might be Vehicle.Body.Engine. - // - // FullyQualifiedName is a required field - FullyQualifiedName *string `locationName:"fullyQualifiedName" 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 Branch) 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 Branch) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Branch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Branch"} - if s.Comment != nil && len(*s.Comment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Comment", 1)) - } - if s.DeprecationMessage != nil && len(*s.DeprecationMessage) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeprecationMessage", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FullyQualifiedName == nil { - invalidParams.Add(request.NewErrParamRequired("FullyQualifiedName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *Branch) SetComment(v string) *Branch { - s.Comment = &v - return s -} - -// SetDeprecationMessage sets the DeprecationMessage field's value. -func (s *Branch) SetDeprecationMessage(v string) *Branch { - s.DeprecationMessage = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Branch) SetDescription(v string) *Branch { - s.Description = &v - return s -} - -// SetFullyQualifiedName sets the FullyQualifiedName field's value. -func (s *Branch) SetFullyQualifiedName(v string) *Branch { - s.FullyQualifiedName = &v - return s -} - -// Information about a campaign. -// -// You can use the API operation to return this information about multiple created -// campaigns. -type CampaignSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of a campaign. - Arn *string `locationName:"arn" type:"string"` - - // The time the campaign was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The description of the campaign. - Description *string `locationName:"description" min:"1" type:"string"` - - // The last time the campaign was modified. - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The name of a campaign. - Name *string `locationName:"name" min:"1" type:"string"` - - // The ARN of the signal catalog associated with the campaign. - SignalCatalogArn *string `locationName:"signalCatalogArn" type:"string"` - - // The state of a campaign. The status can be one of the following: - // - // * CREATING - Amazon Web Services IoT FleetWise is processing your request - // to create the campaign. - // - // * WAITING_FOR_APPROVAL - After a campaign is created, it enters the WAITING_FOR_APPROVAL - // state. To allow Amazon Web Services IoT FleetWise to deploy the campaign - // to the target vehicle or fleet, use the API operation to approve the campaign. - // - // * RUNNING - The campaign is active. - // - // * SUSPENDED - The campaign is suspended. To resume the campaign, use the - // API operation. - Status *string `locationName:"status" type:"string" enum:"CampaignStatus"` - - // The ARN of a vehicle or fleet to which the campaign is deployed. - TargetArn *string `locationName:"targetArn" 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 CampaignSummary) 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 CampaignSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CampaignSummary) SetArn(v string) *CampaignSummary { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CampaignSummary) SetCreationTime(v time.Time) *CampaignSummary { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CampaignSummary) SetDescription(v string) *CampaignSummary { - s.Description = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *CampaignSummary) SetLastModificationTime(v time.Time) *CampaignSummary { - s.LastModificationTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *CampaignSummary) SetName(v string) *CampaignSummary { - s.Name = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *CampaignSummary) SetSignalCatalogArn(v string) *CampaignSummary { - s.SignalCatalogArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CampaignSummary) SetStatus(v string) *CampaignSummary { - s.Status = &v - return s -} - -// SetTargetArn sets the TargetArn field's value. -func (s *CampaignSummary) SetTargetArn(v string) *CampaignSummary { - s.TargetArn = &v - return s -} - -// Configurations used to create a decoder manifest. -type CanDbcDefinition struct { - _ struct{} `type:"structure"` - - // A list of DBC files. You can upload only one DBC file for each network interface - // and specify up to five (inclusive) files in the list. The DBC file can be - // a maximum size of 200 MB. - // - // CanDbcFiles is a required field - CanDbcFiles [][]byte `locationName:"canDbcFiles" min:"1" type:"list" required:"true"` - - // Contains information about a network interface. - // - // NetworkInterface is a required field - NetworkInterface *string `locationName:"networkInterface" min:"1" type:"string" required:"true"` - - // Pairs every signal specified in your vehicle model with a signal decoder. - SignalsMap map[string]*string `locationName:"signalsMap" type:"map"` -} - -// 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 CanDbcDefinition) 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 CanDbcDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CanDbcDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CanDbcDefinition"} - if s.CanDbcFiles == nil { - invalidParams.Add(request.NewErrParamRequired("CanDbcFiles")) - } - if s.CanDbcFiles != nil && len(s.CanDbcFiles) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CanDbcFiles", 1)) - } - if s.NetworkInterface == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterface")) - } - if s.NetworkInterface != nil && len(*s.NetworkInterface) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkInterface", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCanDbcFiles sets the CanDbcFiles field's value. -func (s *CanDbcDefinition) SetCanDbcFiles(v [][]byte) *CanDbcDefinition { - s.CanDbcFiles = v - return s -} - -// SetNetworkInterface sets the NetworkInterface field's value. -func (s *CanDbcDefinition) SetNetworkInterface(v string) *CanDbcDefinition { - s.NetworkInterface = &v - return s -} - -// SetSignalsMap sets the SignalsMap field's value. -func (s *CanDbcDefinition) SetSignalsMap(v map[string]*string) *CanDbcDefinition { - s.SignalsMap = v - return s -} - -// A single controller area network (CAN) device interface. -type CanInterface struct { - _ struct{} `type:"structure"` - - // The unique name of the interface. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The name of the communication protocol for the interface. - ProtocolName *string `locationName:"protocolName" min:"1" type:"string"` - - // The version of the communication protocol for the interface. - ProtocolVersion *string `locationName:"protocolVersion" min:"1" 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 CanInterface) 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 CanInterface) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CanInterface) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CanInterface"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ProtocolName != nil && len(*s.ProtocolName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProtocolName", 1)) - } - if s.ProtocolVersion != nil && len(*s.ProtocolVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProtocolVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CanInterface) SetName(v string) *CanInterface { - s.Name = &v - return s -} - -// SetProtocolName sets the ProtocolName field's value. -func (s *CanInterface) SetProtocolName(v string) *CanInterface { - s.ProtocolName = &v - return s -} - -// SetProtocolVersion sets the ProtocolVersion field's value. -func (s *CanInterface) SetProtocolVersion(v string) *CanInterface { - s.ProtocolVersion = &v - return s -} - -// Information about a single controller area network (CAN) signal and the messages -// it receives and transmits. -type CanSignal struct { - _ struct{} `type:"structure"` - - // A multiplier used to decode the CAN message. - // - // Factor is a required field - Factor *float64 `locationName:"factor" type:"double" required:"true"` - - // Whether the byte ordering of a CAN message is big-endian. - // - // IsBigEndian is a required field - IsBigEndian *bool `locationName:"isBigEndian" type:"boolean" required:"true"` - - // Whether the message data is specified as a signed value. - // - // IsSigned is a required field - IsSigned *bool `locationName:"isSigned" type:"boolean" required:"true"` - - // How many bytes of data are in the message. - // - // Length is a required field - Length *int64 `locationName:"length" type:"integer" required:"true"` - - // The ID of the message. - // - // MessageId is a required field - MessageId *int64 `locationName:"messageId" type:"integer" required:"true"` - - // The name of the signal. - Name *string `locationName:"name" min:"1" type:"string"` - - // The offset used to calculate the signal value. Combined with factor, the - // calculation is value = raw_value * factor + offset. - // - // Offset is a required field - Offset *float64 `locationName:"offset" type:"double" required:"true"` - - // Indicates the beginning of the CAN signal. This should always be the least - // significant bit (LSB). - // - // This value might be different from the value in a DBC file. For little endian - // signals, startBit is the same value as in the DBC file. For big endian signals - // in a DBC file, the start bit is the most significant bit (MSB). You will - // have to calculate the LSB instead and pass it as the startBit. - // - // StartBit is a required field - StartBit *int64 `locationName:"startBit" type:"integer" 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 CanSignal) 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 CanSignal) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CanSignal) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CanSignal"} - if s.Factor == nil { - invalidParams.Add(request.NewErrParamRequired("Factor")) - } - if s.IsBigEndian == nil { - invalidParams.Add(request.NewErrParamRequired("IsBigEndian")) - } - if s.IsSigned == nil { - invalidParams.Add(request.NewErrParamRequired("IsSigned")) - } - if s.Length == nil { - invalidParams.Add(request.NewErrParamRequired("Length")) - } - if s.MessageId == nil { - invalidParams.Add(request.NewErrParamRequired("MessageId")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Offset == nil { - invalidParams.Add(request.NewErrParamRequired("Offset")) - } - if s.StartBit == nil { - invalidParams.Add(request.NewErrParamRequired("StartBit")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFactor sets the Factor field's value. -func (s *CanSignal) SetFactor(v float64) *CanSignal { - s.Factor = &v - return s -} - -// SetIsBigEndian sets the IsBigEndian field's value. -func (s *CanSignal) SetIsBigEndian(v bool) *CanSignal { - s.IsBigEndian = &v - return s -} - -// SetIsSigned sets the IsSigned field's value. -func (s *CanSignal) SetIsSigned(v bool) *CanSignal { - s.IsSigned = &v - return s -} - -// SetLength sets the Length field's value. -func (s *CanSignal) SetLength(v int64) *CanSignal { - s.Length = &v - return s -} - -// SetMessageId sets the MessageId field's value. -func (s *CanSignal) SetMessageId(v int64) *CanSignal { - s.MessageId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CanSignal) SetName(v string) *CanSignal { - s.Name = &v - return s -} - -// SetOffset sets the Offset field's value. -func (s *CanSignal) SetOffset(v float64) *CanSignal { - s.Offset = &v - return s -} - -// SetStartBit sets the StartBit field's value. -func (s *CanSignal) SetStartBit(v int64) *CanSignal { - s.StartBit = &v - return s -} - -// The log delivery option to send data to Amazon CloudWatch Logs. -type CloudWatchLogDeliveryOptions struct { - _ struct{} `type:"structure"` - - // The Amazon CloudWatch Logs group the operation sends data to. - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string"` - - // The type of log to send data to Amazon CloudWatch Logs. - // - // LogType is a required field - LogType *string `locationName:"logType" type:"string" required:"true" enum:"LogType"` -} - -// 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 CloudWatchLogDeliveryOptions) 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 CloudWatchLogDeliveryOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloudWatchLogDeliveryOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudWatchLogDeliveryOptions"} - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) - } - if s.LogType == nil { - invalidParams.Add(request.NewErrParamRequired("LogType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *CloudWatchLogDeliveryOptions) SetLogGroupName(v string) *CloudWatchLogDeliveryOptions { - s.LogGroupName = &v - return s -} - -// SetLogType sets the LogType field's value. -func (s *CloudWatchLogDeliveryOptions) SetLogType(v string) *CloudWatchLogDeliveryOptions { - s.LogType = &v - return s -} - -// Specifies what data to collect and how often or when to collect it. -type CollectionScheme struct { - _ struct{} `type:"structure"` - - // Information about a collection scheme that uses a simple logical expression - // to recognize what data to collect. - ConditionBasedCollectionScheme *ConditionBasedCollectionScheme `locationName:"conditionBasedCollectionScheme" type:"structure"` - - // Information about a collection scheme that uses a time period to decide how - // often to collect data. - TimeBasedCollectionScheme *TimeBasedCollectionScheme `locationName:"timeBasedCollectionScheme" 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 CollectionScheme) 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 CollectionScheme) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CollectionScheme) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CollectionScheme"} - if s.ConditionBasedCollectionScheme != nil { - if err := s.ConditionBasedCollectionScheme.Validate(); err != nil { - invalidParams.AddNested("ConditionBasedCollectionScheme", err.(request.ErrInvalidParams)) - } - } - if s.TimeBasedCollectionScheme != nil { - if err := s.TimeBasedCollectionScheme.Validate(); err != nil { - invalidParams.AddNested("TimeBasedCollectionScheme", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConditionBasedCollectionScheme sets the ConditionBasedCollectionScheme field's value. -func (s *CollectionScheme) SetConditionBasedCollectionScheme(v *ConditionBasedCollectionScheme) *CollectionScheme { - s.ConditionBasedCollectionScheme = v - return s -} - -// SetTimeBasedCollectionScheme sets the TimeBasedCollectionScheme field's value. -func (s *CollectionScheme) SetTimeBasedCollectionScheme(v *TimeBasedCollectionScheme) *CollectionScheme { - s.TimeBasedCollectionScheme = v - return s -} - -// Information about a collection scheme that uses a simple logical expression -// to recognize what data to collect. -type ConditionBasedCollectionScheme struct { - _ struct{} `type:"structure"` - - // Specifies the version of the conditional expression language. - ConditionLanguageVersion *int64 `locationName:"conditionLanguageVersion" min:"1" type:"integer"` - - // The logical expression used to recognize what data to collect. For example, - // $variable.Vehicle.OutsideAirTemperature >= 105.0. - // - // Expression is a required field - Expression *string `locationName:"expression" min:"1" type:"string" required:"true"` - - // The minimum duration of time between two triggering events to collect data, - // in milliseconds. - // - // If a signal changes often, you might want to collect data at a slower rate. - MinimumTriggerIntervalMs *int64 `locationName:"minimumTriggerIntervalMs" type:"long"` - - // Whether to collect data for all triggering events (ALWAYS). Specify (RISING_EDGE), - // or specify only when the condition first evaluates to false. For example, - // triggering on "AirbagDeployed"; Users aren't interested on triggering when - // the airbag is already exploded; they only care about the change from not - // deployed => deployed. - TriggerMode *string `locationName:"triggerMode" type:"string" enum:"TriggerMode"` -} - -// 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 ConditionBasedCollectionScheme) 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 ConditionBasedCollectionScheme) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConditionBasedCollectionScheme) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConditionBasedCollectionScheme"} - if s.ConditionLanguageVersion != nil && *s.ConditionLanguageVersion < 1 { - invalidParams.Add(request.NewErrParamMinValue("ConditionLanguageVersion", 1)) - } - if s.Expression == nil { - invalidParams.Add(request.NewErrParamRequired("Expression")) - } - if s.Expression != nil && len(*s.Expression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Expression", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConditionLanguageVersion sets the ConditionLanguageVersion field's value. -func (s *ConditionBasedCollectionScheme) SetConditionLanguageVersion(v int64) *ConditionBasedCollectionScheme { - s.ConditionLanguageVersion = &v - return s -} - -// SetExpression sets the Expression field's value. -func (s *ConditionBasedCollectionScheme) SetExpression(v string) *ConditionBasedCollectionScheme { - s.Expression = &v - return s -} - -// SetMinimumTriggerIntervalMs sets the MinimumTriggerIntervalMs field's value. -func (s *ConditionBasedCollectionScheme) SetMinimumTriggerIntervalMs(v int64) *ConditionBasedCollectionScheme { - s.MinimumTriggerIntervalMs = &v - return s -} - -// SetTriggerMode sets the TriggerMode field's value. -func (s *ConditionBasedCollectionScheme) SetTriggerMode(v string) *ConditionBasedCollectionScheme { - s.TriggerMode = &v - return s -} - -// The request has conflicting operations. This can occur if you're trying to -// perform more than one operation on the same resource at the same time. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The resource on which there are conflicting operations. - // - // Resource is a required field - Resource *string `locationName:"resource" type:"string" required:"true"` - - // The type of resource on which there are conflicting operations.. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateCampaignInput struct { - _ struct{} `type:"structure"` - - // The data collection scheme associated with the campaign. You can specify - // a scheme that collects data based on time or an event. - // - // CollectionScheme is a required field - CollectionScheme *CollectionScheme `locationName:"collectionScheme" type:"structure" required:"true"` - - // (Optional) Whether to compress signals before transmitting data to Amazon - // Web Services IoT FleetWise. If you don't want to compress the signals, use - // OFF. If it's not specified, SNAPPY is used. - // - // Default: SNAPPY - Compression *string `locationName:"compression" type:"string" enum:"Compression"` - - // The destination where the campaign sends data. You can choose to send data - // to be stored in Amazon S3 or Amazon Timestream. - // - // Amazon S3 optimizes the cost of data storage and provides additional mechanisms - // to use vehicle data, such as data lakes, centralized data storage, data processing - // pipelines, and analytics. Amazon Web Services IoT FleetWise supports at-least-once - // file delivery to S3. Your vehicle data is stored on multiple Amazon Web Services - // IoT FleetWise servers for redundancy and high availability. - // - // You can use Amazon Timestream to access and analyze time series data, and - // Timestream to query vehicle data so that you can identify trends and patterns. - DataDestinationConfigs []*DataDestinationConfig `locationName:"dataDestinationConfigs" min:"1" type:"list"` - - // (Optional) A list of vehicle attributes to associate with a campaign. - // - // Enrich the data with specified vehicle attributes. For example, add make - // and model to the campaign, and Amazon Web Services IoT FleetWise will associate - // the data with those attributes as dimensions in Amazon Timestream. You can - // then query the data against make and model. - // - // Default: An empty array - DataExtraDimensions []*string `locationName:"dataExtraDimensions" type:"list"` - - // An optional description of the campaign to help identify its purpose. - Description *string `locationName:"description" min:"1" type:"string"` - - // (Optional) Option for a vehicle to send diagnostic trouble codes to Amazon - // Web Services IoT FleetWise. If you want to send diagnostic trouble codes, - // use SEND_ACTIVE_DTCS. If it's not specified, OFF is used. - // - // Default: OFF - DiagnosticsMode *string `locationName:"diagnosticsMode" type:"string" enum:"DiagnosticsMode"` - - // (Optional) The time the campaign expires, in seconds since epoch (January - // 1, 1970 at midnight UTC time). Vehicle data isn't collected after the campaign - // expires. - // - // Default: 253402214400 (December 31, 9999, 00:00:00 UTC) - ExpiryTime *time.Time `locationName:"expiryTime" type:"timestamp"` - - // The name of the campaign to create. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // (Optional) How long (in milliseconds) to collect raw data after a triggering - // event initiates the collection. If it's not specified, 0 is used. - // - // Default: 0 - PostTriggerCollectionDuration *int64 `locationName:"postTriggerCollectionDuration" type:"long"` - - // (Optional) A number indicating the priority of one campaign over another - // campaign for a certain vehicle or fleet. A campaign with the lowest value - // is deployed to vehicles before any other campaigns. If it's not specified, - // 0 is used. - // - // Default: 0 - Priority *int64 `locationName:"priority" type:"integer"` - - // (Optional) The Amazon Resource Name (ARN) of the signal catalog to associate - // with the campaign. - // - // SignalCatalogArn is a required field - SignalCatalogArn *string `locationName:"signalCatalogArn" type:"string" required:"true"` - - // (Optional) A list of information about signals to collect. - SignalsToCollect []*SignalInformation `locationName:"signalsToCollect" type:"list"` - - // (Optional) Whether to store collected data after a vehicle lost a connection - // with the cloud. After a connection is re-established, the data is automatically - // forwarded to Amazon Web Services IoT FleetWise. If you want to store collected - // data when a vehicle loses connection with the cloud, use TO_DISK. If it's - // not specified, OFF is used. - // - // Default: OFF - SpoolingMode *string `locationName:"spoolingMode" type:"string" enum:"SpoolingMode"` - - // (Optional) The time, in milliseconds, to deliver a campaign after it was - // approved. If it's not specified, 0 is used. - // - // Default: 0 - StartTime *time.Time `locationName:"startTime" type:"timestamp"` - - // Metadata that can be used to manage the campaign. - Tags []*Tag `locationName:"tags" type:"list"` - - // The ARN of the vehicle or fleet to deploy a campaign to. - // - // TargetArn is a required field - TargetArn *string `locationName:"targetArn" 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 CreateCampaignInput) 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 CreateCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCampaignInput"} - if s.CollectionScheme == nil { - invalidParams.Add(request.NewErrParamRequired("CollectionScheme")) - } - if s.DataDestinationConfigs != nil && len(s.DataDestinationConfigs) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataDestinationConfigs", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SignalCatalogArn == nil { - invalidParams.Add(request.NewErrParamRequired("SignalCatalogArn")) - } - if s.TargetArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetArn")) - } - if s.CollectionScheme != nil { - if err := s.CollectionScheme.Validate(); err != nil { - invalidParams.AddNested("CollectionScheme", err.(request.ErrInvalidParams)) - } - } - if s.DataDestinationConfigs != nil { - for i, v := range s.DataDestinationConfigs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DataDestinationConfigs", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SignalsToCollect != nil { - for i, v := range s.SignalsToCollect { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SignalsToCollect", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollectionScheme sets the CollectionScheme field's value. -func (s *CreateCampaignInput) SetCollectionScheme(v *CollectionScheme) *CreateCampaignInput { - s.CollectionScheme = v - return s -} - -// SetCompression sets the Compression field's value. -func (s *CreateCampaignInput) SetCompression(v string) *CreateCampaignInput { - s.Compression = &v - return s -} - -// SetDataDestinationConfigs sets the DataDestinationConfigs field's value. -func (s *CreateCampaignInput) SetDataDestinationConfigs(v []*DataDestinationConfig) *CreateCampaignInput { - s.DataDestinationConfigs = v - return s -} - -// SetDataExtraDimensions sets the DataExtraDimensions field's value. -func (s *CreateCampaignInput) SetDataExtraDimensions(v []*string) *CreateCampaignInput { - s.DataExtraDimensions = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateCampaignInput) SetDescription(v string) *CreateCampaignInput { - s.Description = &v - return s -} - -// SetDiagnosticsMode sets the DiagnosticsMode field's value. -func (s *CreateCampaignInput) SetDiagnosticsMode(v string) *CreateCampaignInput { - s.DiagnosticsMode = &v - return s -} - -// SetExpiryTime sets the ExpiryTime field's value. -func (s *CreateCampaignInput) SetExpiryTime(v time.Time) *CreateCampaignInput { - s.ExpiryTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateCampaignInput) SetName(v string) *CreateCampaignInput { - s.Name = &v - return s -} - -// SetPostTriggerCollectionDuration sets the PostTriggerCollectionDuration field's value. -func (s *CreateCampaignInput) SetPostTriggerCollectionDuration(v int64) *CreateCampaignInput { - s.PostTriggerCollectionDuration = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *CreateCampaignInput) SetPriority(v int64) *CreateCampaignInput { - s.Priority = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *CreateCampaignInput) SetSignalCatalogArn(v string) *CreateCampaignInput { - s.SignalCatalogArn = &v - return s -} - -// SetSignalsToCollect sets the SignalsToCollect field's value. -func (s *CreateCampaignInput) SetSignalsToCollect(v []*SignalInformation) *CreateCampaignInput { - s.SignalsToCollect = v - return s -} - -// SetSpoolingMode sets the SpoolingMode field's value. -func (s *CreateCampaignInput) SetSpoolingMode(v string) *CreateCampaignInput { - s.SpoolingMode = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *CreateCampaignInput) SetStartTime(v time.Time) *CreateCampaignInput { - s.StartTime = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateCampaignInput) SetTags(v []*Tag) *CreateCampaignInput { - s.Tags = v - return s -} - -// SetTargetArn sets the TargetArn field's value. -func (s *CreateCampaignInput) SetTargetArn(v string) *CreateCampaignInput { - s.TargetArn = &v - return s -} - -type CreateCampaignOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the created campaign. - Arn *string `locationName:"arn" type:"string"` - - // The name of the created campaign. - Name *string `locationName:"name" min:"1" 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 CreateCampaignOutput) 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 CreateCampaignOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateCampaignOutput) SetArn(v string) *CreateCampaignOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateCampaignOutput) SetName(v string) *CreateCampaignOutput { - s.Name = &v - return s -} - -type CreateDecoderManifestInput struct { - _ struct{} `type:"structure"` - - // A brief description of the decoder manifest. - Description *string `locationName:"description" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the vehicle model (model manifest). - // - // ModelManifestArn is a required field - ModelManifestArn *string `locationName:"modelManifestArn" type:"string" required:"true"` - - // The unique name of the decoder manifest to create. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of information about available network interfaces. - NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaces" min:"1" type:"list"` - - // A list of information about signal decoders. - SignalDecoders []*SignalDecoder `locationName:"signalDecoders" min:"1" type:"list"` - - // Metadata that can be used to manage the decoder manifest. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateDecoderManifestInput) 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 CreateDecoderManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDecoderManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDecoderManifestInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.ModelManifestArn == nil { - invalidParams.Add(request.NewErrParamRequired("ModelManifestArn")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NetworkInterfaces != nil && len(s.NetworkInterfaces) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkInterfaces", 1)) - } - if s.SignalDecoders != nil && len(s.SignalDecoders) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SignalDecoders", 1)) - } - if s.NetworkInterfaces != nil { - for i, v := range s.NetworkInterfaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfaces", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SignalDecoders != nil { - for i, v := range s.SignalDecoders { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SignalDecoders", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateDecoderManifestInput) SetDescription(v string) *CreateDecoderManifestInput { - s.Description = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *CreateDecoderManifestInput) SetModelManifestArn(v string) *CreateDecoderManifestInput { - s.ModelManifestArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDecoderManifestInput) SetName(v string) *CreateDecoderManifestInput { - s.Name = &v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *CreateDecoderManifestInput) SetNetworkInterfaces(v []*NetworkInterface) *CreateDecoderManifestInput { - s.NetworkInterfaces = v - return s -} - -// SetSignalDecoders sets the SignalDecoders field's value. -func (s *CreateDecoderManifestInput) SetSignalDecoders(v []*SignalDecoder) *CreateDecoderManifestInput { - s.SignalDecoders = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDecoderManifestInput) SetTags(v []*Tag) *CreateDecoderManifestInput { - s.Tags = v - return s -} - -type CreateDecoderManifestOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the created decoder manifest. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the created decoder manifest. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 CreateDecoderManifestOutput) 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 CreateDecoderManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateDecoderManifestOutput) SetArn(v string) *CreateDecoderManifestOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDecoderManifestOutput) SetName(v string) *CreateDecoderManifestOutput { - s.Name = &v - return s -} - -type CreateFleetInput struct { - _ struct{} `type:"structure"` - - // A brief description of the fleet to create. - Description *string `locationName:"description" min:"1" type:"string"` - - // The unique ID of the fleet to create. - // - // FleetId is a required field - FleetId *string `locationName:"fleetId" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of a signal catalog. - // - // SignalCatalogArn is a required field - SignalCatalogArn *string `locationName:"signalCatalogArn" type:"string" required:"true"` - - // Metadata that can be used to manage the fleet. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateFleetInput) 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 CreateFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFleetInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.FleetId != nil && len(*s.FleetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FleetId", 1)) - } - if s.SignalCatalogArn == nil { - invalidParams.Add(request.NewErrParamRequired("SignalCatalogArn")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateFleetInput) SetDescription(v string) *CreateFleetInput { - s.Description = &v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *CreateFleetInput) SetFleetId(v string) *CreateFleetInput { - s.FleetId = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *CreateFleetInput) SetSignalCatalogArn(v string) *CreateFleetInput { - s.SignalCatalogArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateFleetInput) SetTags(v []*Tag) *CreateFleetInput { - s.Tags = v - return s -} - -type CreateFleetOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the created fleet. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The ID of the created fleet. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 CreateFleetOutput) 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 CreateFleetOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateFleetOutput) SetArn(v string) *CreateFleetOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateFleetOutput) SetId(v string) *CreateFleetOutput { - s.Id = &v - return s -} - -type CreateModelManifestInput struct { - _ struct{} `type:"structure"` - - // A brief description of the vehicle model. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the vehicle model to create. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of nodes, which are a general abstraction of signals. - // - // Nodes is a required field - Nodes []*string `locationName:"nodes" type:"list" required:"true"` - - // The Amazon Resource Name (ARN) of a signal catalog. - // - // SignalCatalogArn is a required field - SignalCatalogArn *string `locationName:"signalCatalogArn" type:"string" required:"true"` - - // Metadata that can be used to manage the vehicle model. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateModelManifestInput) 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 CreateModelManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateModelManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateModelManifestInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Nodes == nil { - invalidParams.Add(request.NewErrParamRequired("Nodes")) - } - if s.SignalCatalogArn == nil { - invalidParams.Add(request.NewErrParamRequired("SignalCatalogArn")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateModelManifestInput) SetDescription(v string) *CreateModelManifestInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateModelManifestInput) SetName(v string) *CreateModelManifestInput { - s.Name = &v - return s -} - -// SetNodes sets the Nodes field's value. -func (s *CreateModelManifestInput) SetNodes(v []*string) *CreateModelManifestInput { - s.Nodes = v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *CreateModelManifestInput) SetSignalCatalogArn(v string) *CreateModelManifestInput { - s.SignalCatalogArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateModelManifestInput) SetTags(v []*Tag) *CreateModelManifestInput { - s.Tags = v - return s -} - -type CreateModelManifestOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the created vehicle model. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the created vehicle model. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 CreateModelManifestOutput) 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 CreateModelManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateModelManifestOutput) SetArn(v string) *CreateModelManifestOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateModelManifestOutput) SetName(v string) *CreateModelManifestOutput { - s.Name = &v - return s -} - -type CreateSignalCatalogInput struct { - _ struct{} `type:"structure"` - - // A brief description of the signal catalog. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the signal catalog to create. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of information about nodes, which are a general abstraction of signals. - // For more information, see the API data type. - Nodes []*Node `locationName:"nodes" type:"list"` - - // Metadata that can be used to manage the signal catalog. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateSignalCatalogInput) 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 CreateSignalCatalogInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSignalCatalogInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSignalCatalogInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Nodes != nil { - for i, v := range s.Nodes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Nodes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateSignalCatalogInput) SetDescription(v string) *CreateSignalCatalogInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSignalCatalogInput) SetName(v string) *CreateSignalCatalogInput { - s.Name = &v - return s -} - -// SetNodes sets the Nodes field's value. -func (s *CreateSignalCatalogInput) SetNodes(v []*Node) *CreateSignalCatalogInput { - s.Nodes = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSignalCatalogInput) SetTags(v []*Tag) *CreateSignalCatalogInput { - s.Tags = v - return s -} - -type CreateSignalCatalogOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the created signal catalog. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the created signal catalog. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 CreateSignalCatalogOutput) 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 CreateSignalCatalogOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateSignalCatalogOutput) SetArn(v string) *CreateSignalCatalogOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSignalCatalogOutput) SetName(v string) *CreateSignalCatalogOutput { - s.Name = &v - return s -} - -// An HTTP error resulting from creating a vehicle. -type CreateVehicleError struct { - _ struct{} `type:"structure"` - - // An HTTP error code. - Code *string `locationName:"code" type:"string"` - - // A description of the HTTP error. - Message *string `locationName:"message" type:"string"` - - // The ID of the vehicle with the error. - VehicleName *string `locationName:"vehicleName" min:"1" 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 CreateVehicleError) 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 CreateVehicleError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *CreateVehicleError) SetCode(v string) *CreateVehicleError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *CreateVehicleError) SetMessage(v string) *CreateVehicleError { - s.Message = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *CreateVehicleError) SetVehicleName(v string) *CreateVehicleError { - s.VehicleName = &v - return s -} - -type CreateVehicleInput struct { - _ struct{} `type:"structure"` - - // An option to create a new Amazon Web Services IoT thing when creating a vehicle, - // or to validate an existing Amazon Web Services IoT thing as a vehicle. - // - // Default: - AssociationBehavior *string `locationName:"associationBehavior" type:"string" enum:"VehicleAssociationBehavior"` - - // Static information about a vehicle in a key-value pair. For example: "engineType" - // : "1.3 L R2" - // - // A campaign must include the keys (attribute names) in dataExtraDimensions - // for them to display in Amazon Timestream. - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // The ARN of a decoder manifest. - // - // DecoderManifestArn is a required field - DecoderManifestArn *string `locationName:"decoderManifestArn" type:"string" required:"true"` - - // The Amazon Resource Name ARN of a vehicle model. - // - // ModelManifestArn is a required field - ModelManifestArn *string `locationName:"modelManifestArn" type:"string" required:"true"` - - // Metadata that can be used to manage the vehicle. - Tags []*Tag `locationName:"tags" type:"list"` - - // The unique ID of the vehicle to create. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 CreateVehicleInput) 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 CreateVehicleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVehicleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVehicleInput"} - if s.DecoderManifestArn == nil { - invalidParams.Add(request.NewErrParamRequired("DecoderManifestArn")) - } - if s.ModelManifestArn == nil { - invalidParams.Add(request.NewErrParamRequired("ModelManifestArn")) - } - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationBehavior sets the AssociationBehavior field's value. -func (s *CreateVehicleInput) SetAssociationBehavior(v string) *CreateVehicleInput { - s.AssociationBehavior = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *CreateVehicleInput) SetAttributes(v map[string]*string) *CreateVehicleInput { - s.Attributes = v - return s -} - -// SetDecoderManifestArn sets the DecoderManifestArn field's value. -func (s *CreateVehicleInput) SetDecoderManifestArn(v string) *CreateVehicleInput { - s.DecoderManifestArn = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *CreateVehicleInput) SetModelManifestArn(v string) *CreateVehicleInput { - s.ModelManifestArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateVehicleInput) SetTags(v []*Tag) *CreateVehicleInput { - s.Tags = v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *CreateVehicleInput) SetVehicleName(v string) *CreateVehicleInput { - s.VehicleName = &v - return s -} - -type CreateVehicleOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the created vehicle. - Arn *string `locationName:"arn" type:"string"` - - // The ARN of a created or validated Amazon Web Services IoT thing. - ThingArn *string `locationName:"thingArn" type:"string"` - - // The unique ID of the created vehicle. - VehicleName *string `locationName:"vehicleName" min:"1" 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 CreateVehicleOutput) 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 CreateVehicleOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateVehicleOutput) SetArn(v string) *CreateVehicleOutput { - s.Arn = &v - return s -} - -// SetThingArn sets the ThingArn field's value. -func (s *CreateVehicleOutput) SetThingArn(v string) *CreateVehicleOutput { - s.ThingArn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *CreateVehicleOutput) SetVehicleName(v string) *CreateVehicleOutput { - s.VehicleName = &v - return s -} - -// Information about the vehicle to create. -type CreateVehicleRequestItem struct { - _ struct{} `type:"structure"` - - // An option to create a new Amazon Web Services IoT thing when creating a vehicle, - // or to validate an existing thing as a vehicle. - AssociationBehavior *string `locationName:"associationBehavior" type:"string" enum:"VehicleAssociationBehavior"` - - // Static information about a vehicle in a key-value pair. For example: "engine - // Type" : "v6" - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // The Amazon Resource Name (ARN) of a decoder manifest associated with the - // vehicle to create. - // - // DecoderManifestArn is a required field - DecoderManifestArn *string `locationName:"decoderManifestArn" type:"string" required:"true"` - - // The ARN of the vehicle model (model manifest) to create the vehicle from. - // - // ModelManifestArn is a required field - ModelManifestArn *string `locationName:"modelManifestArn" type:"string" required:"true"` - - // Metadata which can be used to manage the vehicle. - Tags []*Tag `locationName:"tags" type:"list"` - - // The unique ID of the vehicle to create. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 CreateVehicleRequestItem) 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 CreateVehicleRequestItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVehicleRequestItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVehicleRequestItem"} - if s.DecoderManifestArn == nil { - invalidParams.Add(request.NewErrParamRequired("DecoderManifestArn")) - } - if s.ModelManifestArn == nil { - invalidParams.Add(request.NewErrParamRequired("ModelManifestArn")) - } - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationBehavior sets the AssociationBehavior field's value. -func (s *CreateVehicleRequestItem) SetAssociationBehavior(v string) *CreateVehicleRequestItem { - s.AssociationBehavior = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *CreateVehicleRequestItem) SetAttributes(v map[string]*string) *CreateVehicleRequestItem { - s.Attributes = v - return s -} - -// SetDecoderManifestArn sets the DecoderManifestArn field's value. -func (s *CreateVehicleRequestItem) SetDecoderManifestArn(v string) *CreateVehicleRequestItem { - s.DecoderManifestArn = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *CreateVehicleRequestItem) SetModelManifestArn(v string) *CreateVehicleRequestItem { - s.ModelManifestArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateVehicleRequestItem) SetTags(v []*Tag) *CreateVehicleRequestItem { - s.Tags = v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *CreateVehicleRequestItem) SetVehicleName(v string) *CreateVehicleRequestItem { - s.VehicleName = &v - return s -} - -// Information about a created vehicle. -type CreateVehicleResponseItem struct { - _ struct{} `type:"structure"` - - // The ARN of the created vehicle. - Arn *string `locationName:"arn" type:"string"` - - // The ARN of a created or validated Amazon Web Services IoT thing. - ThingArn *string `locationName:"thingArn" type:"string"` - - // The unique ID of the vehicle to create. - VehicleName *string `locationName:"vehicleName" min:"1" 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 CreateVehicleResponseItem) 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 CreateVehicleResponseItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateVehicleResponseItem) SetArn(v string) *CreateVehicleResponseItem { - s.Arn = &v - return s -} - -// SetThingArn sets the ThingArn field's value. -func (s *CreateVehicleResponseItem) SetThingArn(v string) *CreateVehicleResponseItem { - s.ThingArn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *CreateVehicleResponseItem) SetVehicleName(v string) *CreateVehicleResponseItem { - s.VehicleName = &v - return s -} - -// Represents a member of the complex data structure. The data type of the property -// can be either primitive or another struct. -type CustomProperty struct { - _ struct{} `type:"structure"` - - // A comment in addition to the description. - Comment *string `locationName:"comment" min:"1" type:"string"` - - // Indicates whether the property is binary data. - DataEncoding *string `locationName:"dataEncoding" type:"string" enum:"NodeDataEncoding"` - - // The data type for the custom property. - // - // DataType is a required field - DataType *string `locationName:"dataType" type:"string" required:"true" enum:"NodeDataType"` - - // The deprecation message for the node or the branch that was moved or deleted. - DeprecationMessage *string `locationName:"deprecationMessage" min:"1" type:"string"` - - // A brief description of the custom property. - Description *string `locationName:"description" min:"1" type:"string"` - - // The fully qualified name of the custom property. For example, the fully qualified - // name of a custom property might be ComplexDataTypes.VehicleDataTypes.SVMCamera.FPS. - // - // FullyQualifiedName is a required field - FullyQualifiedName *string `locationName:"fullyQualifiedName" type:"string" required:"true"` - - // The fully qualified name of the struct node for the custom property if the - // data type of the custom property is Struct or StructArray. - StructFullyQualifiedName *string `locationName:"structFullyQualifiedName" min:"1" 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 CustomProperty) 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 CustomProperty) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomProperty) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomProperty"} - if s.Comment != nil && len(*s.Comment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Comment", 1)) - } - if s.DataType == nil { - invalidParams.Add(request.NewErrParamRequired("DataType")) - } - if s.DeprecationMessage != nil && len(*s.DeprecationMessage) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeprecationMessage", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FullyQualifiedName == nil { - invalidParams.Add(request.NewErrParamRequired("FullyQualifiedName")) - } - if s.StructFullyQualifiedName != nil && len(*s.StructFullyQualifiedName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StructFullyQualifiedName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *CustomProperty) SetComment(v string) *CustomProperty { - s.Comment = &v - return s -} - -// SetDataEncoding sets the DataEncoding field's value. -func (s *CustomProperty) SetDataEncoding(v string) *CustomProperty { - s.DataEncoding = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *CustomProperty) SetDataType(v string) *CustomProperty { - s.DataType = &v - return s -} - -// SetDeprecationMessage sets the DeprecationMessage field's value. -func (s *CustomProperty) SetDeprecationMessage(v string) *CustomProperty { - s.DeprecationMessage = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CustomProperty) SetDescription(v string) *CustomProperty { - s.Description = &v - return s -} - -// SetFullyQualifiedName sets the FullyQualifiedName field's value. -func (s *CustomProperty) SetFullyQualifiedName(v string) *CustomProperty { - s.FullyQualifiedName = &v - return s -} - -// SetStructFullyQualifiedName sets the StructFullyQualifiedName field's value. -func (s *CustomProperty) SetStructFullyQualifiedName(v string) *CustomProperty { - s.StructFullyQualifiedName = &v - return s -} - -// The custom structure represents a complex or higher-order data structure. -type CustomStruct struct { - _ struct{} `type:"structure"` - - // A comment in addition to the description. - Comment *string `locationName:"comment" min:"1" type:"string"` - - // The deprecation message for the node or the branch that was moved or deleted. - DeprecationMessage *string `locationName:"deprecationMessage" min:"1" type:"string"` - - // A brief description of the custom structure. - Description *string `locationName:"description" min:"1" type:"string"` - - // The fully qualified name of the custom structure. For example, the fully - // qualified name of a custom structure might be ComplexDataTypes.VehicleDataTypes.SVMCamera. - // - // FullyQualifiedName is a required field - FullyQualifiedName *string `locationName:"fullyQualifiedName" 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 CustomStruct) 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 CustomStruct) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomStruct) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomStruct"} - if s.Comment != nil && len(*s.Comment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Comment", 1)) - } - if s.DeprecationMessage != nil && len(*s.DeprecationMessage) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeprecationMessage", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FullyQualifiedName == nil { - invalidParams.Add(request.NewErrParamRequired("FullyQualifiedName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *CustomStruct) SetComment(v string) *CustomStruct { - s.Comment = &v - return s -} - -// SetDeprecationMessage sets the DeprecationMessage field's value. -func (s *CustomStruct) SetDeprecationMessage(v string) *CustomStruct { - s.DeprecationMessage = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CustomStruct) SetDescription(v string) *CustomStruct { - s.Description = &v - return s -} - -// SetFullyQualifiedName sets the FullyQualifiedName field's value. -func (s *CustomStruct) SetFullyQualifiedName(v string) *CustomStruct { - s.FullyQualifiedName = &v - return s -} - -// The destination where the Amazon Web Services IoT FleetWise campaign sends -// data. You can send data to be stored in Amazon S3 or Amazon Timestream. -type DataDestinationConfig struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket where the Amazon Web Services IoT FleetWise campaign - // sends data. - S3Config *S3Config `locationName:"s3Config" type:"structure"` - - // The Amazon Timestream table where the campaign sends data. - TimestreamConfig *TimestreamConfig `locationName:"timestreamConfig" 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 DataDestinationConfig) 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 DataDestinationConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataDestinationConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataDestinationConfig"} - if s.S3Config != nil { - if err := s.S3Config.Validate(); err != nil { - invalidParams.AddNested("S3Config", err.(request.ErrInvalidParams)) - } - } - if s.TimestreamConfig != nil { - if err := s.TimestreamConfig.Validate(); err != nil { - invalidParams.AddNested("TimestreamConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Config sets the S3Config field's value. -func (s *DataDestinationConfig) SetS3Config(v *S3Config) *DataDestinationConfig { - s.S3Config = v - return s -} - -// SetTimestreamConfig sets the TimestreamConfig field's value. -func (s *DataDestinationConfig) SetTimestreamConfig(v *TimestreamConfig) *DataDestinationConfig { - s.TimestreamConfig = v - return s -} - -// Information about a created decoder manifest. You can use the API operation -// to return this information about multiple decoder manifests. -type DecoderManifestSummary struct { - _ struct{} `type:"structure"` - - // The ARN of a vehicle model (model manifest) associated with the decoder manifest. - Arn *string `locationName:"arn" type:"string"` - - // The time the decoder manifest was created in seconds since epoch (January - // 1, 1970 at midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // A brief description of the decoder manifest. - Description *string `locationName:"description" min:"1" type:"string"` - - // The time the decoder manifest was last updated in seconds since epoch (January - // 1, 1970 at midnight UTC time). - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The detailed message for the decoder manifest. When a decoder manifest is - // in an INVALID status, the message contains detailed reason and help information. - Message *string `locationName:"message" min:"1" type:"string"` - - // The ARN of a vehicle model (model manifest) associated with the decoder manifest. - ModelManifestArn *string `locationName:"modelManifestArn" type:"string"` - - // The name of the decoder manifest. - Name *string `locationName:"name" type:"string"` - - // The state of the decoder manifest. If the status is ACTIVE, the decoder manifest - // can't be edited. If the status is marked DRAFT, you can edit the decoder - // manifest. - Status *string `locationName:"status" type:"string" enum:"ManifestStatus"` -} - -// 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 DecoderManifestSummary) 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 DecoderManifestSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DecoderManifestSummary) SetArn(v string) *DecoderManifestSummary { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DecoderManifestSummary) SetCreationTime(v time.Time) *DecoderManifestSummary { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DecoderManifestSummary) SetDescription(v string) *DecoderManifestSummary { - s.Description = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *DecoderManifestSummary) SetLastModificationTime(v time.Time) *DecoderManifestSummary { - s.LastModificationTime = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *DecoderManifestSummary) SetMessage(v string) *DecoderManifestSummary { - s.Message = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *DecoderManifestSummary) SetModelManifestArn(v string) *DecoderManifestSummary { - s.ModelManifestArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *DecoderManifestSummary) SetName(v string) *DecoderManifestSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DecoderManifestSummary) SetStatus(v string) *DecoderManifestSummary { - s.Status = &v - return s -} - -// The request couldn't be completed because it contains signal decoders with -// one or more validation errors. -type DecoderManifestValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The request couldn't be completed because of invalid network interfaces in - // the request. - InvalidNetworkInterfaces []*InvalidNetworkInterface `locationName:"invalidNetworkInterfaces" type:"list"` - - // The request couldn't be completed because of invalid signals in the request. - InvalidSignals []*InvalidSignalDecoder `locationName:"invalidSignals" type:"list"` - - Message_ *string `locationName:"message" 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 DecoderManifestValidationException) 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 DecoderManifestValidationException) GoString() string { - return s.String() -} - -func newErrorDecoderManifestValidationException(v protocol.ResponseMetadata) error { - return &DecoderManifestValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DecoderManifestValidationException) Code() string { - return "DecoderManifestValidationException" -} - -// Message returns the exception's message. -func (s *DecoderManifestValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DecoderManifestValidationException) OrigErr() error { - return nil -} - -func (s *DecoderManifestValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DecoderManifestValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DecoderManifestValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -type DeleteCampaignInput struct { - _ struct{} `type:"structure"` - - // The name of the campaign to delete. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 DeleteCampaignInput) 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 DeleteCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCampaignInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteCampaignInput) SetName(v string) *DeleteCampaignInput { - s.Name = &v - return s -} - -type DeleteCampaignOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the deleted campaign. - // - // The ARN isn’t returned if a campaign doesn’t exist. - Arn *string `locationName:"arn" type:"string"` - - // The name of the deleted campaign. - Name *string `locationName:"name" min:"1" 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 DeleteCampaignOutput) 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 DeleteCampaignOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteCampaignOutput) SetArn(v string) *DeleteCampaignOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteCampaignOutput) SetName(v string) *DeleteCampaignOutput { - s.Name = &v - return s -} - -type DeleteDecoderManifestInput struct { - _ struct{} `type:"structure"` - - // The name of the decoder manifest to delete. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 DeleteDecoderManifestInput) 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 DeleteDecoderManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDecoderManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDecoderManifestInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteDecoderManifestInput) SetName(v string) *DeleteDecoderManifestInput { - s.Name = &v - return s -} - -type DeleteDecoderManifestOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the deleted decoder manifest. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the deleted decoder manifest. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 DeleteDecoderManifestOutput) 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 DeleteDecoderManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteDecoderManifestOutput) SetArn(v string) *DeleteDecoderManifestOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteDecoderManifestOutput) SetName(v string) *DeleteDecoderManifestOutput { - s.Name = &v - return s -} - -type DeleteFleetInput struct { - _ struct{} `type:"structure"` - - // The ID of the fleet to delete. - // - // FleetId is a required field - FleetId *string `locationName:"fleetId" min:"1" 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 DeleteFleetInput) 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 DeleteFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFleetInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.FleetId != nil && len(*s.FleetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FleetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFleetId sets the FleetId field's value. -func (s *DeleteFleetInput) SetFleetId(v string) *DeleteFleetInput { - s.FleetId = &v - return s -} - -type DeleteFleetOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the deleted fleet. - Arn *string `locationName:"arn" type:"string"` - - // The ID of the deleted fleet. - Id *string `locationName:"id" min:"1" 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 DeleteFleetOutput) 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 DeleteFleetOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteFleetOutput) SetArn(v string) *DeleteFleetOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteFleetOutput) SetId(v string) *DeleteFleetOutput { - s.Id = &v - return s -} - -type DeleteModelManifestInput struct { - _ struct{} `type:"structure"` - - // The name of the model manifest to delete. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 DeleteModelManifestInput) 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 DeleteModelManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteModelManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteModelManifestInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteModelManifestInput) SetName(v string) *DeleteModelManifestInput { - s.Name = &v - return s -} - -type DeleteModelManifestOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the deleted model manifest. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the deleted model manifest. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 DeleteModelManifestOutput) 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 DeleteModelManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteModelManifestOutput) SetArn(v string) *DeleteModelManifestOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteModelManifestOutput) SetName(v string) *DeleteModelManifestOutput { - s.Name = &v - return s -} - -type DeleteSignalCatalogInput struct { - _ struct{} `type:"structure"` - - // The name of the signal catalog to delete. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 DeleteSignalCatalogInput) 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 DeleteSignalCatalogInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSignalCatalogInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSignalCatalogInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteSignalCatalogInput) SetName(v string) *DeleteSignalCatalogInput { - s.Name = &v - return s -} - -type DeleteSignalCatalogOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the deleted signal catalog. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the deleted signal catalog. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 DeleteSignalCatalogOutput) 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 DeleteSignalCatalogOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteSignalCatalogOutput) SetArn(v string) *DeleteSignalCatalogOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteSignalCatalogOutput) SetName(v string) *DeleteSignalCatalogOutput { - s.Name = &v - return s -} - -type DeleteVehicleInput struct { - _ struct{} `type:"structure"` - - // The ID of the vehicle to delete. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 DeleteVehicleInput) 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 DeleteVehicleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVehicleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVehicleInput"} - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVehicleName sets the VehicleName field's value. -func (s *DeleteVehicleInput) SetVehicleName(v string) *DeleteVehicleInput { - s.VehicleName = &v - return s -} - -type DeleteVehicleOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the deleted vehicle. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The ID of the deleted vehicle. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 DeleteVehicleOutput) 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 DeleteVehicleOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteVehicleOutput) SetArn(v string) *DeleteVehicleOutput { - s.Arn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *DeleteVehicleOutput) SetVehicleName(v string) *DeleteVehicleOutput { - s.VehicleName = &v - return s -} - -type DisassociateVehicleFleetInput struct { - _ struct{} `type:"structure"` - - // The unique ID of a fleet. - // - // FleetId is a required field - FleetId *string `locationName:"fleetId" min:"1" type:"string" required:"true"` - - // The unique ID of the vehicle to disassociate from the fleet. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 DisassociateVehicleFleetInput) 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 DisassociateVehicleFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateVehicleFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateVehicleFleetInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.FleetId != nil && len(*s.FleetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FleetId", 1)) - } - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFleetId sets the FleetId field's value. -func (s *DisassociateVehicleFleetInput) SetFleetId(v string) *DisassociateVehicleFleetInput { - s.FleetId = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *DisassociateVehicleFleetInput) SetVehicleName(v string) *DisassociateVehicleFleetInput { - s.VehicleName = &v - return s -} - -type DisassociateVehicleFleetOutput 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 DisassociateVehicleFleetOutput) 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 DisassociateVehicleFleetOutput) GoString() string { - return s.String() -} - -// Information about a fleet. -// -// You can use the API operation to return this information about multiple fleets. -type FleetSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the fleet. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time the fleet was created, in seconds since epoch (January 1, 1970 at - // midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // A brief description of the fleet. - Description *string `locationName:"description" min:"1" type:"string"` - - // The unique ID of the fleet. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // The time the fleet was last updated in seconds since epoch (January 1, 1970 - // at midnight UTC time). - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp"` - - // The ARN of the signal catalog associated with the fleet. - // - // SignalCatalogArn is a required field - SignalCatalogArn *string `locationName:"signalCatalogArn" 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 FleetSummary) 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 FleetSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *FleetSummary) SetArn(v string) *FleetSummary { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *FleetSummary) SetCreationTime(v time.Time) *FleetSummary { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *FleetSummary) SetDescription(v string) *FleetSummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *FleetSummary) SetId(v string) *FleetSummary { - s.Id = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *FleetSummary) SetLastModificationTime(v time.Time) *FleetSummary { - s.LastModificationTime = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *FleetSummary) SetSignalCatalogArn(v string) *FleetSummary { - s.SignalCatalogArn = &v - return s -} - -// Vehicle Signal Specification (VSS) (https://www.w3.org/auto/wg/wiki/Vehicle_Signal_Specification_(VSS)/Vehicle_Data_Spec) -// is a precise language used to describe and model signals in vehicle networks. -// The JSON file collects signal specificiations in a VSS format. -type FormattedVss struct { - _ struct{} `type:"structure"` - - // Provides the VSS in JSON format. - VssJson *string `locationName:"vssJson" 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 FormattedVss) 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 FormattedVss) GoString() string { - return s.String() -} - -// SetVssJson sets the VssJson field's value. -func (s *FormattedVss) SetVssJson(v string) *FormattedVss { - s.VssJson = &v - return s -} - -type GetCampaignInput struct { - _ struct{} `type:"structure"` - - // The name of the campaign to retrieve information about. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 GetCampaignInput) 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 GetCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetCampaignInput) SetName(v string) *GetCampaignInput { - s.Name = &v - return s -} - -type GetCampaignOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the campaign. - Arn *string `locationName:"arn" type:"string"` - - // Information about the data collection scheme associated with the campaign. - CollectionScheme *CollectionScheme `locationName:"collectionScheme" type:"structure"` - - // Whether to compress signals before transmitting data to Amazon Web Services - // IoT FleetWise. If OFF is specified, the signals aren't compressed. If it's - // not specified, SNAPPY is used. - Compression *string `locationName:"compression" type:"string" enum:"Compression"` - - // The time the campaign was created in seconds since epoch (January 1, 1970 - // at midnight UTC time). - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The destination where the campaign sends data. You can choose to send data - // to be stored in Amazon S3 or Amazon Timestream. - // - // Amazon S3 optimizes the cost of data storage and provides additional mechanisms - // to use vehicle data, such as data lakes, centralized data storage, data processing - // pipelines, and analytics. - // - // You can use Amazon Timestream to access and analyze time series data, and - // Timestream to query vehicle data so that you can identify trends and patterns. - DataDestinationConfigs []*DataDestinationConfig `locationName:"dataDestinationConfigs" min:"1" type:"list"` - - // A list of vehicle attributes associated with the campaign. - DataExtraDimensions []*string `locationName:"dataExtraDimensions" type:"list"` - - // The description of the campaign. - Description *string `locationName:"description" min:"1" type:"string"` - - // Option for a vehicle to send diagnostic trouble codes to Amazon Web Services - // IoT FleetWise. - DiagnosticsMode *string `locationName:"diagnosticsMode" type:"string" enum:"DiagnosticsMode"` - - // The time the campaign expires, in seconds since epoch (January 1, 1970 at - // midnight UTC time). Vehicle data won't be collected after the campaign expires. - ExpiryTime *time.Time `locationName:"expiryTime" type:"timestamp"` - - // The last time the campaign was modified. - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp"` - - // The name of the campaign. - Name *string `locationName:"name" min:"1" type:"string"` - - // How long (in seconds) to collect raw data after a triggering event initiates - // the collection. - PostTriggerCollectionDuration *int64 `locationName:"postTriggerCollectionDuration" type:"long"` - - // A number indicating the priority of one campaign over another campaign for - // a certain vehicle or fleet. A campaign with the lowest value is deployed - // to vehicles before any other campaigns. - Priority *int64 `locationName:"priority" type:"integer"` - - // The ARN of a signal catalog. - SignalCatalogArn *string `locationName:"signalCatalogArn" type:"string"` - - // Information about a list of signals to collect data on. - SignalsToCollect []*SignalInformation `locationName:"signalsToCollect" type:"list"` - - // Whether to store collected data after a vehicle lost a connection with the - // cloud. After a connection is re-established, the data is automatically forwarded - // to Amazon Web Services IoT FleetWise. - SpoolingMode *string `locationName:"spoolingMode" type:"string" enum:"SpoolingMode"` - - // The time, in milliseconds, to deliver a campaign after it was approved. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` - - // The state of the campaign. The status can be one of: CREATING, WAITING_FOR_APPROVAL, - // RUNNING, and SUSPENDED. - Status *string `locationName:"status" type:"string" enum:"CampaignStatus"` - - // The ARN of the vehicle or the fleet targeted by the campaign. - TargetArn *string `locationName:"targetArn" 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 GetCampaignOutput) 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 GetCampaignOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetCampaignOutput) SetArn(v string) *GetCampaignOutput { - s.Arn = &v - return s -} - -// SetCollectionScheme sets the CollectionScheme field's value. -func (s *GetCampaignOutput) SetCollectionScheme(v *CollectionScheme) *GetCampaignOutput { - s.CollectionScheme = v - return s -} - -// SetCompression sets the Compression field's value. -func (s *GetCampaignOutput) SetCompression(v string) *GetCampaignOutput { - s.Compression = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetCampaignOutput) SetCreationTime(v time.Time) *GetCampaignOutput { - s.CreationTime = &v - return s -} - -// SetDataDestinationConfigs sets the DataDestinationConfigs field's value. -func (s *GetCampaignOutput) SetDataDestinationConfigs(v []*DataDestinationConfig) *GetCampaignOutput { - s.DataDestinationConfigs = v - return s -} - -// SetDataExtraDimensions sets the DataExtraDimensions field's value. -func (s *GetCampaignOutput) SetDataExtraDimensions(v []*string) *GetCampaignOutput { - s.DataExtraDimensions = v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetCampaignOutput) SetDescription(v string) *GetCampaignOutput { - s.Description = &v - return s -} - -// SetDiagnosticsMode sets the DiagnosticsMode field's value. -func (s *GetCampaignOutput) SetDiagnosticsMode(v string) *GetCampaignOutput { - s.DiagnosticsMode = &v - return s -} - -// SetExpiryTime sets the ExpiryTime field's value. -func (s *GetCampaignOutput) SetExpiryTime(v time.Time) *GetCampaignOutput { - s.ExpiryTime = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *GetCampaignOutput) SetLastModificationTime(v time.Time) *GetCampaignOutput { - s.LastModificationTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetCampaignOutput) SetName(v string) *GetCampaignOutput { - s.Name = &v - return s -} - -// SetPostTriggerCollectionDuration sets the PostTriggerCollectionDuration field's value. -func (s *GetCampaignOutput) SetPostTriggerCollectionDuration(v int64) *GetCampaignOutput { - s.PostTriggerCollectionDuration = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *GetCampaignOutput) SetPriority(v int64) *GetCampaignOutput { - s.Priority = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *GetCampaignOutput) SetSignalCatalogArn(v string) *GetCampaignOutput { - s.SignalCatalogArn = &v - return s -} - -// SetSignalsToCollect sets the SignalsToCollect field's value. -func (s *GetCampaignOutput) SetSignalsToCollect(v []*SignalInformation) *GetCampaignOutput { - s.SignalsToCollect = v - return s -} - -// SetSpoolingMode sets the SpoolingMode field's value. -func (s *GetCampaignOutput) SetSpoolingMode(v string) *GetCampaignOutput { - s.SpoolingMode = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetCampaignOutput) SetStartTime(v time.Time) *GetCampaignOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetCampaignOutput) SetStatus(v string) *GetCampaignOutput { - s.Status = &v - return s -} - -// SetTargetArn sets the TargetArn field's value. -func (s *GetCampaignOutput) SetTargetArn(v string) *GetCampaignOutput { - s.TargetArn = &v - return s -} - -type GetDecoderManifestInput struct { - _ struct{} `type:"structure"` - - // The name of the decoder manifest to retrieve information about. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 GetDecoderManifestInput) 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 GetDecoderManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDecoderManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDecoderManifestInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetDecoderManifestInput) SetName(v string) *GetDecoderManifestInput { - s.Name = &v - return s -} - -type GetDecoderManifestOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the decoder manifest. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time the decoder manifest was created in seconds since epoch (January - // 1, 1970 at midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // A brief description of the decoder manifest. - Description *string `locationName:"description" min:"1" type:"string"` - - // The time the decoder manifest was last updated in seconds since epoch (January - // 1, 1970 at midnight UTC time). - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The detailed message for the decoder manifest. When a decoder manifest is - // in an INVALID status, the message contains detailed reason and help information. - Message *string `locationName:"message" min:"1" type:"string"` - - // The ARN of a vehicle model (model manifest) associated with the decoder manifest. - ModelManifestArn *string `locationName:"modelManifestArn" type:"string"` - - // The name of the decoder manifest. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The state of the decoder manifest. If the status is ACTIVE, the decoder manifest - // can't be edited. If the status is marked DRAFT, you can edit the decoder - // manifest. - Status *string `locationName:"status" type:"string" enum:"ManifestStatus"` -} - -// 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 GetDecoderManifestOutput) 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 GetDecoderManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetDecoderManifestOutput) SetArn(v string) *GetDecoderManifestOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetDecoderManifestOutput) SetCreationTime(v time.Time) *GetDecoderManifestOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetDecoderManifestOutput) SetDescription(v string) *GetDecoderManifestOutput { - s.Description = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *GetDecoderManifestOutput) SetLastModificationTime(v time.Time) *GetDecoderManifestOutput { - s.LastModificationTime = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *GetDecoderManifestOutput) SetMessage(v string) *GetDecoderManifestOutput { - s.Message = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *GetDecoderManifestOutput) SetModelManifestArn(v string) *GetDecoderManifestOutput { - s.ModelManifestArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetDecoderManifestOutput) SetName(v string) *GetDecoderManifestOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetDecoderManifestOutput) SetStatus(v string) *GetDecoderManifestOutput { - s.Status = &v - return s -} - -type GetEncryptionConfigurationInput 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 GetEncryptionConfigurationInput) 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 GetEncryptionConfigurationInput) GoString() string { - return s.String() -} - -type GetEncryptionConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The time when encryption was configured in seconds since epoch (January 1, - // 1970 at midnight UTC time). - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The encryption status. - // - // EncryptionStatus is a required field - EncryptionStatus *string `locationName:"encryptionStatus" type:"string" required:"true" enum:"EncryptionStatus"` - - // The type of encryption. Set to KMS_BASED_ENCRYPTION to use a KMS key that - // you own and manage. Set to FLEETWISE_DEFAULT_ENCRYPTION to use an Amazon - // Web Services managed key that is owned by the Amazon Web Services IoT FleetWise - // service account. - // - // EncryptionType is a required field - EncryptionType *string `locationName:"encryptionType" type:"string" required:"true" enum:"EncryptionType"` - - // The error message that describes why encryption settings couldn't be configured, - // if applicable. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // The ID of the KMS key that is used for encryption. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The time when encryption was last updated in seconds since epoch (January - // 1, 1970 at midnight UTC time). - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp"` -} - -// 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 GetEncryptionConfigurationOutput) 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 GetEncryptionConfigurationOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetEncryptionConfigurationOutput) SetCreationTime(v time.Time) *GetEncryptionConfigurationOutput { - s.CreationTime = &v - return s -} - -// SetEncryptionStatus sets the EncryptionStatus field's value. -func (s *GetEncryptionConfigurationOutput) SetEncryptionStatus(v string) *GetEncryptionConfigurationOutput { - s.EncryptionStatus = &v - return s -} - -// SetEncryptionType sets the EncryptionType field's value. -func (s *GetEncryptionConfigurationOutput) SetEncryptionType(v string) *GetEncryptionConfigurationOutput { - s.EncryptionType = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *GetEncryptionConfigurationOutput) SetErrorMessage(v string) *GetEncryptionConfigurationOutput { - s.ErrorMessage = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *GetEncryptionConfigurationOutput) SetKmsKeyId(v string) *GetEncryptionConfigurationOutput { - s.KmsKeyId = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *GetEncryptionConfigurationOutput) SetLastModificationTime(v time.Time) *GetEncryptionConfigurationOutput { - s.LastModificationTime = &v - return s -} - -type GetFleetInput struct { - _ struct{} `type:"structure"` - - // The ID of the fleet to retrieve information about. - // - // FleetId is a required field - FleetId *string `locationName:"fleetId" min:"1" 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 GetFleetInput) 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 GetFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFleetInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.FleetId != nil && len(*s.FleetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FleetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFleetId sets the FleetId field's value. -func (s *GetFleetInput) SetFleetId(v string) *GetFleetInput { - s.FleetId = &v - return s -} - -type GetFleetOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the fleet. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time the fleet was created in seconds since epoch (January 1, 1970 at - // midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // A brief description of the fleet. - Description *string `locationName:"description" min:"1" type:"string"` - - // The ID of the fleet. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // The time the fleet was last updated, in seconds since epoch (January 1, 1970 - // at midnight UTC time). - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The ARN of a signal catalog associated with the fleet. - // - // SignalCatalogArn is a required field - SignalCatalogArn *string `locationName:"signalCatalogArn" 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 GetFleetOutput) 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 GetFleetOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetFleetOutput) SetArn(v string) *GetFleetOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetFleetOutput) SetCreationTime(v time.Time) *GetFleetOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetFleetOutput) SetDescription(v string) *GetFleetOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetFleetOutput) SetId(v string) *GetFleetOutput { - s.Id = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *GetFleetOutput) SetLastModificationTime(v time.Time) *GetFleetOutput { - s.LastModificationTime = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *GetFleetOutput) SetSignalCatalogArn(v string) *GetFleetOutput { - s.SignalCatalogArn = &v - return s -} - -type GetLoggingOptionsInput 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 GetLoggingOptionsInput) 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 GetLoggingOptionsInput) GoString() string { - return s.String() -} - -type GetLoggingOptionsOutput struct { - _ struct{} `type:"structure"` - - // Returns information about log delivery to Amazon CloudWatch Logs. - // - // CloudWatchLogDelivery is a required field - CloudWatchLogDelivery *CloudWatchLogDeliveryOptions `locationName:"cloudWatchLogDelivery" type:"structure" 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 GetLoggingOptionsOutput) 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 GetLoggingOptionsOutput) GoString() string { - return s.String() -} - -// SetCloudWatchLogDelivery sets the CloudWatchLogDelivery field's value. -func (s *GetLoggingOptionsOutput) SetCloudWatchLogDelivery(v *CloudWatchLogDeliveryOptions) *GetLoggingOptionsOutput { - s.CloudWatchLogDelivery = v - return s -} - -type GetModelManifestInput struct { - _ struct{} `type:"structure"` - - // The name of the vehicle model to retrieve information about. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 GetModelManifestInput) 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 GetModelManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetModelManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetModelManifestInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetModelManifestInput) SetName(v string) *GetModelManifestInput { - s.Name = &v - return s -} - -type GetModelManifestOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the vehicle model. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time the vehicle model was created, in seconds since epoch (January 1, - // 1970 at midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // A brief description of the vehicle model. - Description *string `locationName:"description" min:"1" type:"string"` - - // The last time the vehicle model was modified. - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The name of the vehicle model. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The ARN of the signal catalog associated with the vehicle model. - SignalCatalogArn *string `locationName:"signalCatalogArn" type:"string"` - - // The state of the vehicle model. If the status is ACTIVE, the vehicle model - // can't be edited. You can edit the vehicle model if the status is marked DRAFT. - Status *string `locationName:"status" type:"string" enum:"ManifestStatus"` -} - -// 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 GetModelManifestOutput) 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 GetModelManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetModelManifestOutput) SetArn(v string) *GetModelManifestOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetModelManifestOutput) SetCreationTime(v time.Time) *GetModelManifestOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetModelManifestOutput) SetDescription(v string) *GetModelManifestOutput { - s.Description = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *GetModelManifestOutput) SetLastModificationTime(v time.Time) *GetModelManifestOutput { - s.LastModificationTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetModelManifestOutput) SetName(v string) *GetModelManifestOutput { - s.Name = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *GetModelManifestOutput) SetSignalCatalogArn(v string) *GetModelManifestOutput { - s.SignalCatalogArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetModelManifestOutput) SetStatus(v string) *GetModelManifestOutput { - s.Status = &v - return s -} - -type GetRegisterAccountStatusInput 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 GetRegisterAccountStatusInput) 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 GetRegisterAccountStatusInput) GoString() string { - return s.String() -} - -type GetRegisterAccountStatusOutput struct { - _ struct{} `type:"structure"` - - // The status of registering your account and resources. The status can be one - // of: - // - // * REGISTRATION_SUCCESS - The Amazon Web Services resource is successfully - // registered. - // - // * REGISTRATION_PENDING - Amazon Web Services IoT FleetWise is processing - // the registration request. This process takes approximately five minutes - // to complete. - // - // * REGISTRATION_FAILURE - Amazon Web Services IoT FleetWise can't register - // the AWS resource. Try again later. - // - // AccountStatus is a required field - AccountStatus *string `locationName:"accountStatus" type:"string" required:"true" enum:"RegistrationStatus"` - - // The time the account was registered, in seconds since epoch (January 1, 1970 - // at midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The unique ID of the Amazon Web Services account, provided at account creation. - // - // CustomerAccountId is a required field - CustomerAccountId *string `locationName:"customerAccountId" type:"string" required:"true"` - - // Information about the registered IAM resources or errors, if any. - // - // IamRegistrationResponse is a required field - IamRegistrationResponse *IamRegistrationResponse `locationName:"iamRegistrationResponse" type:"structure" required:"true"` - - // The time this registration was last updated, in seconds since epoch (January - // 1, 1970 at midnight UTC time). - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // Information about the registered Amazon Timestream resources or errors, if - // any. - TimestreamRegistrationResponse *TimestreamRegistrationResponse `locationName:"timestreamRegistrationResponse" 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 GetRegisterAccountStatusOutput) 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 GetRegisterAccountStatusOutput) GoString() string { - return s.String() -} - -// SetAccountStatus sets the AccountStatus field's value. -func (s *GetRegisterAccountStatusOutput) SetAccountStatus(v string) *GetRegisterAccountStatusOutput { - s.AccountStatus = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetRegisterAccountStatusOutput) SetCreationTime(v time.Time) *GetRegisterAccountStatusOutput { - s.CreationTime = &v - return s -} - -// SetCustomerAccountId sets the CustomerAccountId field's value. -func (s *GetRegisterAccountStatusOutput) SetCustomerAccountId(v string) *GetRegisterAccountStatusOutput { - s.CustomerAccountId = &v - return s -} - -// SetIamRegistrationResponse sets the IamRegistrationResponse field's value. -func (s *GetRegisterAccountStatusOutput) SetIamRegistrationResponse(v *IamRegistrationResponse) *GetRegisterAccountStatusOutput { - s.IamRegistrationResponse = v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *GetRegisterAccountStatusOutput) SetLastModificationTime(v time.Time) *GetRegisterAccountStatusOutput { - s.LastModificationTime = &v - return s -} - -// SetTimestreamRegistrationResponse sets the TimestreamRegistrationResponse field's value. -func (s *GetRegisterAccountStatusOutput) SetTimestreamRegistrationResponse(v *TimestreamRegistrationResponse) *GetRegisterAccountStatusOutput { - s.TimestreamRegistrationResponse = v - return s -} - -type GetSignalCatalogInput struct { - _ struct{} `type:"structure"` - - // The name of the signal catalog to retrieve information about. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 GetSignalCatalogInput) 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 GetSignalCatalogInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSignalCatalogInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSignalCatalogInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetSignalCatalogInput) SetName(v string) *GetSignalCatalogInput { - s.Name = &v - return s -} - -type GetSignalCatalogOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the signal catalog. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time the signal catalog was created in seconds since epoch (January 1, - // 1970 at midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // A brief description of the signal catalog. - Description *string `locationName:"description" min:"1" type:"string"` - - // The last time the signal catalog was modified. - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The name of the signal catalog. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The total number of network nodes specified in a signal catalog. - NodeCounts *NodeCounts `locationName:"nodeCounts" 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 GetSignalCatalogOutput) 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 GetSignalCatalogOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSignalCatalogOutput) SetArn(v string) *GetSignalCatalogOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetSignalCatalogOutput) SetCreationTime(v time.Time) *GetSignalCatalogOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetSignalCatalogOutput) SetDescription(v string) *GetSignalCatalogOutput { - s.Description = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *GetSignalCatalogOutput) SetLastModificationTime(v time.Time) *GetSignalCatalogOutput { - s.LastModificationTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetSignalCatalogOutput) SetName(v string) *GetSignalCatalogOutput { - s.Name = &v - return s -} - -// SetNodeCounts sets the NodeCounts field's value. -func (s *GetSignalCatalogOutput) SetNodeCounts(v *NodeCounts) *GetSignalCatalogOutput { - s.NodeCounts = v - return s -} - -type GetVehicleInput struct { - _ struct{} `type:"structure"` - - // The ID of the vehicle to retrieve information about. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 GetVehicleInput) 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 GetVehicleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVehicleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVehicleInput"} - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVehicleName sets the VehicleName field's value. -func (s *GetVehicleInput) SetVehicleName(v string) *GetVehicleInput { - s.VehicleName = &v - return s -} - -type GetVehicleOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the vehicle to retrieve information about. - Arn *string `locationName:"arn" type:"string"` - - // Static information about a vehicle in a key-value pair. For example: - // - // "engineType" : "1.3 L R2" - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // The time the vehicle was created in seconds since epoch (January 1, 1970 - // at midnight UTC time). - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The ARN of a decoder manifest associated with the vehicle. - DecoderManifestArn *string `locationName:"decoderManifestArn" type:"string"` - - // The time the vehicle was last updated in seconds since epoch (January 1, - // 1970 at midnight UTC time). - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp"` - - // The ARN of a vehicle model (model manifest) associated with the vehicle. - ModelManifestArn *string `locationName:"modelManifestArn" type:"string"` - - // The ID of the vehicle. - VehicleName *string `locationName:"vehicleName" min:"1" 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 GetVehicleOutput) 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 GetVehicleOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetVehicleOutput) SetArn(v string) *GetVehicleOutput { - s.Arn = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *GetVehicleOutput) SetAttributes(v map[string]*string) *GetVehicleOutput { - s.Attributes = v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetVehicleOutput) SetCreationTime(v time.Time) *GetVehicleOutput { - s.CreationTime = &v - return s -} - -// SetDecoderManifestArn sets the DecoderManifestArn field's value. -func (s *GetVehicleOutput) SetDecoderManifestArn(v string) *GetVehicleOutput { - s.DecoderManifestArn = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *GetVehicleOutput) SetLastModificationTime(v time.Time) *GetVehicleOutput { - s.LastModificationTime = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *GetVehicleOutput) SetModelManifestArn(v string) *GetVehicleOutput { - s.ModelManifestArn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *GetVehicleOutput) SetVehicleName(v string) *GetVehicleOutput { - s.VehicleName = &v - return s -} - -type GetVehicleStatusInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The ID of the vehicle to retrieve information about. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 GetVehicleStatusInput) 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 GetVehicleStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVehicleStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVehicleStatusInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetVehicleStatusInput) SetMaxResults(v int64) *GetVehicleStatusInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetVehicleStatusInput) SetNextToken(v string) *GetVehicleStatusInput { - s.NextToken = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *GetVehicleStatusInput) SetVehicleName(v string) *GetVehicleStatusInput { - s.VehicleName = &v - return s -} - -type GetVehicleStatusOutput struct { - _ struct{} `type:"structure"` - - // Lists information about the state of the vehicle with deployed campaigns. - Campaigns []*VehicleStatus `locationName:"campaigns" type:"list"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 GetVehicleStatusOutput) 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 GetVehicleStatusOutput) GoString() string { - return s.String() -} - -// SetCampaigns sets the Campaigns field's value. -func (s *GetVehicleStatusOutput) SetCampaigns(v []*VehicleStatus) *GetVehicleStatusOutput { - s.Campaigns = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetVehicleStatusOutput) SetNextToken(v string) *GetVehicleStatusOutput { - s.NextToken = &v - return s -} - -// Information about registering an Identity and Access Management (IAM) resource -// so Amazon Web Services IoT FleetWise edge agent software can transfer your -// vehicle data to Amazon Timestream. -type IamRegistrationResponse struct { - _ struct{} `type:"structure"` - - // A message associated with a registration error. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // The status of registering your IAM resource. The status can be one of REGISTRATION_SUCCESS, - // REGISTRATION_PENDING, REGISTRATION_FAILURE. - // - // RegistrationStatus is a required field - RegistrationStatus *string `locationName:"registrationStatus" type:"string" required:"true" enum:"RegistrationStatus"` - - // The Amazon Resource Name (ARN) of the IAM role to register. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" 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 IamRegistrationResponse) 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 IamRegistrationResponse) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *IamRegistrationResponse) SetErrorMessage(v string) *IamRegistrationResponse { - s.ErrorMessage = &v - return s -} - -// SetRegistrationStatus sets the RegistrationStatus field's value. -func (s *IamRegistrationResponse) SetRegistrationStatus(v string) *IamRegistrationResponse { - s.RegistrationStatus = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *IamRegistrationResponse) SetRoleArn(v string) *IamRegistrationResponse { - s.RoleArn = &v - return s -} - -// The IAM resource that enables Amazon Web Services IoT FleetWise edge agent -// software to send data to Amazon Timestream. -// -// For more information, see IAM roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) -// in the Identity and Access Management User Guide. -type IamResources struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM resource that allows Amazon Web - // Services IoT FleetWise to send data to Amazon Timestream. For example, arn:aws:iam::123456789012:role/SERVICE-ROLE-ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" 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 IamResources) 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 IamResources) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IamResources) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IamResources"} - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRoleArn sets the RoleArn field's value. -func (s *IamResources) SetRoleArn(v string) *IamResources { - s.RoleArn = &v - return s -} - -type ImportDecoderManifestInput struct { - _ struct{} `type:"structure"` - - // The name of the decoder manifest to import. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The file to load into an Amazon Web Services account. - // - // NetworkFileDefinitions is a required field - NetworkFileDefinitions []*NetworkFileDefinition `locationName:"networkFileDefinitions" type:"list" 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 ImportDecoderManifestInput) 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 ImportDecoderManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportDecoderManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportDecoderManifestInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NetworkFileDefinitions == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkFileDefinitions")) - } - if s.NetworkFileDefinitions != nil { - for i, v := range s.NetworkFileDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkFileDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *ImportDecoderManifestInput) SetName(v string) *ImportDecoderManifestInput { - s.Name = &v - return s -} - -// SetNetworkFileDefinitions sets the NetworkFileDefinitions field's value. -func (s *ImportDecoderManifestInput) SetNetworkFileDefinitions(v []*NetworkFileDefinition) *ImportDecoderManifestInput { - s.NetworkFileDefinitions = v - return s -} - -type ImportDecoderManifestOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the decoder manifest that was imported. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the imported decoder manifest. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 ImportDecoderManifestOutput) 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 ImportDecoderManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ImportDecoderManifestOutput) SetArn(v string) *ImportDecoderManifestOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *ImportDecoderManifestOutput) SetName(v string) *ImportDecoderManifestOutput { - s.Name = &v - return s -} - -type ImportSignalCatalogInput struct { - _ struct{} `type:"structure"` - - // A brief description of the signal catalog. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the signal catalog to import. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Metadata that can be used to manage the signal catalog. - Tags []*Tag `locationName:"tags" type:"list"` - - // The contents of the Vehicle Signal Specification (VSS) configuration. VSS - // is a precise language used to describe and model signals in vehicle networks. - Vss *FormattedVss `locationName:"vss" 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 ImportSignalCatalogInput) 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 ImportSignalCatalogInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportSignalCatalogInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportSignalCatalogInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *ImportSignalCatalogInput) SetDescription(v string) *ImportSignalCatalogInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *ImportSignalCatalogInput) SetName(v string) *ImportSignalCatalogInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ImportSignalCatalogInput) SetTags(v []*Tag) *ImportSignalCatalogInput { - s.Tags = v - return s -} - -// SetVss sets the Vss field's value. -func (s *ImportSignalCatalogInput) SetVss(v *FormattedVss) *ImportSignalCatalogInput { - s.Vss = v - return s -} - -type ImportSignalCatalogOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the imported signal catalog. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the imported signal catalog. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 ImportSignalCatalogOutput) 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 ImportSignalCatalogOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ImportSignalCatalogOutput) SetArn(v string) *ImportSignalCatalogOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *ImportSignalCatalogOutput) SetName(v string) *ImportSignalCatalogOutput { - s.Name = &v - return s -} - -// The request couldn't be completed because the server temporarily failed. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The number of seconds to wait before retrying the command. - RetryAfterSeconds *int64 `locationName:"retryAfterSeconds" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A reason a vehicle network interface isn't valid. -type InvalidNetworkInterface struct { - _ struct{} `type:"structure"` - - // The ID of the interface that isn't valid. - InterfaceId *string `locationName:"interfaceId" min:"1" type:"string"` - - // A message about why the interface isn't valid. - Reason *string `locationName:"reason" type:"string" enum:"NetworkInterfaceFailureReason"` -} - -// 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 InvalidNetworkInterface) 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 InvalidNetworkInterface) GoString() string { - return s.String() -} - -// SetInterfaceId sets the InterfaceId field's value. -func (s *InvalidNetworkInterface) SetInterfaceId(v string) *InvalidNetworkInterface { - s.InterfaceId = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *InvalidNetworkInterface) SetReason(v string) *InvalidNetworkInterface { - s.Reason = &v - return s -} - -// The specified node type doesn't match the expected node type for a node. -// You can specify the node type as branch, sensor, actuator, or attribute. -type InvalidNodeException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The specified node type isn't valid. - InvalidNodes []*Node `locationName:"invalidNodes" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason the node validation failed. - Reason *string `locationName:"reason" 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 InvalidNodeException) 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 InvalidNodeException) GoString() string { - return s.String() -} - -func newErrorInvalidNodeException(v protocol.ResponseMetadata) error { - return &InvalidNodeException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidNodeException) Code() string { - return "InvalidNodeException" -} - -// Message returns the exception's message. -func (s *InvalidNodeException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidNodeException) OrigErr() error { - return nil -} - -func (s *InvalidNodeException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidNodeException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidNodeException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A reason that a signal isn't valid. -type InvalidSignal struct { - _ struct{} `type:"structure"` - - // The name of the signal that isn't valid. - Name *string `locationName:"name" min:"1" type:"string"` - - // A message about why the signal isn't valid. - Reason *string `locationName:"reason" 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 InvalidSignal) 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 InvalidSignal) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *InvalidSignal) SetName(v string) *InvalidSignal { - s.Name = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *InvalidSignal) SetReason(v string) *InvalidSignal { - s.Reason = &v - return s -} - -// A reason that a signal decoder isn't valid. -type InvalidSignalDecoder struct { - _ struct{} `type:"structure"` - - // The possible cause for the invalid signal decoder. - Hint *string `locationName:"hint" min:"1" type:"string"` - - // The name of a signal decoder that isn't valid. - Name *string `locationName:"name" min:"1" type:"string"` - - // A message about why the signal decoder isn't valid. - Reason *string `locationName:"reason" type:"string" enum:"SignalDecoderFailureReason"` -} - -// 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 InvalidSignalDecoder) 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 InvalidSignalDecoder) GoString() string { - return s.String() -} - -// SetHint sets the Hint field's value. -func (s *InvalidSignalDecoder) SetHint(v string) *InvalidSignalDecoder { - s.Hint = &v - return s -} - -// SetName sets the Name field's value. -func (s *InvalidSignalDecoder) SetName(v string) *InvalidSignalDecoder { - s.Name = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *InvalidSignalDecoder) SetReason(v string) *InvalidSignalDecoder { - s.Reason = &v - return s -} - -// The request couldn't be completed because it contains signals that aren't -// valid. -type InvalidSignalsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The signals which caused the exception. - InvalidSignals []*InvalidSignal `locationName:"invalidSignals" type:"list"` - - Message_ *string `locationName:"message" 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 InvalidSignalsException) 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 InvalidSignalsException) GoString() string { - return s.String() -} - -func newErrorInvalidSignalsException(v protocol.ResponseMetadata) error { - return &InvalidSignalsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidSignalsException) Code() string { - return "InvalidSignalsException" -} - -// Message returns the exception's message. -func (s *InvalidSignalsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidSignalsException) OrigErr() error { - return nil -} - -func (s *InvalidSignalsException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidSignalsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidSignalsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A service quota was exceeded. -type LimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The identifier of the resource that was exceeded. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of resource that was exceeded. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 LimitExceededException) 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 LimitExceededException) GoString() string { - return s.String() -} - -func newErrorLimitExceededException(v protocol.ResponseMetadata) error { - return &LimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *LimitExceededException) Code() string { - return "LimitExceededException" -} - -// Message returns the exception's message. -func (s *LimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *LimitExceededException) OrigErr() error { - return nil -} - -func (s *LimitExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *LimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *LimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListCampaignsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Optional parameter to filter the results by the status of each created campaign - // in your account. The status can be one of: CREATING, WAITING_FOR_APPROVAL, - // RUNNING, or SUSPENDED. - Status *string `locationName:"status" 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 ListCampaignsInput) 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 ListCampaignsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCampaignsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCampaignsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCampaignsInput) SetMaxResults(v int64) *ListCampaignsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCampaignsInput) SetNextToken(v string) *ListCampaignsInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListCampaignsInput) SetStatus(v string) *ListCampaignsInput { - s.Status = &v - return s -} - -type ListCampaignsOutput struct { - _ struct{} `type:"structure"` - - // A summary of information about each campaign. - CampaignSummaries []*CampaignSummary `locationName:"campaignSummaries" type:"list"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListCampaignsOutput) 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 ListCampaignsOutput) GoString() string { - return s.String() -} - -// SetCampaignSummaries sets the CampaignSummaries field's value. -func (s *ListCampaignsOutput) SetCampaignSummaries(v []*CampaignSummary) *ListCampaignsOutput { - s.CampaignSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCampaignsOutput) SetNextToken(v string) *ListCampaignsOutput { - s.NextToken = &v - return s -} - -type ListDecoderManifestNetworkInterfacesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The name of the decoder manifest to list information about. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDecoderManifestNetworkInterfacesInput) 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 ListDecoderManifestNetworkInterfacesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDecoderManifestNetworkInterfacesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDecoderManifestNetworkInterfacesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDecoderManifestNetworkInterfacesInput) SetMaxResults(v int64) *ListDecoderManifestNetworkInterfacesInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListDecoderManifestNetworkInterfacesInput) SetName(v string) *ListDecoderManifestNetworkInterfacesInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDecoderManifestNetworkInterfacesInput) SetNextToken(v string) *ListDecoderManifestNetworkInterfacesInput { - s.NextToken = &v - return s -} - -type ListDecoderManifestNetworkInterfacesOutput struct { - _ struct{} `type:"structure"` - - // A list of information about network interfaces. - NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaces" min:"1" type:"list"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDecoderManifestNetworkInterfacesOutput) 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 ListDecoderManifestNetworkInterfacesOutput) GoString() string { - return s.String() -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *ListDecoderManifestNetworkInterfacesOutput) SetNetworkInterfaces(v []*NetworkInterface) *ListDecoderManifestNetworkInterfacesOutput { - s.NetworkInterfaces = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDecoderManifestNetworkInterfacesOutput) SetNextToken(v string) *ListDecoderManifestNetworkInterfacesOutput { - s.NextToken = &v - return s -} - -type ListDecoderManifestSignalsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The name of the decoder manifest to list information about. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDecoderManifestSignalsInput) 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 ListDecoderManifestSignalsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDecoderManifestSignalsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDecoderManifestSignalsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDecoderManifestSignalsInput) SetMaxResults(v int64) *ListDecoderManifestSignalsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListDecoderManifestSignalsInput) SetName(v string) *ListDecoderManifestSignalsInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDecoderManifestSignalsInput) SetNextToken(v string) *ListDecoderManifestSignalsInput { - s.NextToken = &v - return s -} - -type ListDecoderManifestSignalsOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Information about a list of signals to decode. - SignalDecoders []*SignalDecoder `locationName:"signalDecoders" min:"1" type:"list"` -} - -// 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 ListDecoderManifestSignalsOutput) 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 ListDecoderManifestSignalsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDecoderManifestSignalsOutput) SetNextToken(v string) *ListDecoderManifestSignalsOutput { - s.NextToken = &v - return s -} - -// SetSignalDecoders sets the SignalDecoders field's value. -func (s *ListDecoderManifestSignalsOutput) SetSignalDecoders(v []*SignalDecoder) *ListDecoderManifestSignalsOutput { - s.SignalDecoders = v - return s -} - -type ListDecoderManifestsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of a vehicle model (model manifest) associated - // with the decoder manifest. - ModelManifestArn *string `locationName:"modelManifestArn" type:"string"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDecoderManifestsInput) 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 ListDecoderManifestsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDecoderManifestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDecoderManifestsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDecoderManifestsInput) SetMaxResults(v int64) *ListDecoderManifestsInput { - s.MaxResults = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *ListDecoderManifestsInput) SetModelManifestArn(v string) *ListDecoderManifestsInput { - s.ModelManifestArn = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDecoderManifestsInput) SetNextToken(v string) *ListDecoderManifestsInput { - s.NextToken = &v - return s -} - -type ListDecoderManifestsOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of information about each decoder manifest. - Summaries []*DecoderManifestSummary `locationName:"summaries" type:"list"` -} - -// 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 ListDecoderManifestsOutput) 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 ListDecoderManifestsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDecoderManifestsOutput) SetNextToken(v string) *ListDecoderManifestsOutput { - s.NextToken = &v - return s -} - -// SetSummaries sets the Summaries field's value. -func (s *ListDecoderManifestsOutput) SetSummaries(v []*DecoderManifestSummary) *ListDecoderManifestsOutput { - s.Summaries = v - return s -} - -type ListFleetsForVehicleInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The ID of the vehicle to retrieve information about. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 ListFleetsForVehicleInput) 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 ListFleetsForVehicleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListFleetsForVehicleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListFleetsForVehicleInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListFleetsForVehicleInput) SetMaxResults(v int64) *ListFleetsForVehicleInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFleetsForVehicleInput) SetNextToken(v string) *ListFleetsForVehicleInput { - s.NextToken = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *ListFleetsForVehicleInput) SetVehicleName(v string) *ListFleetsForVehicleInput { - s.VehicleName = &v - return s -} - -type ListFleetsForVehicleOutput struct { - _ struct{} `type:"structure"` - - // A list of fleet IDs that the vehicle is associated with. - Fleets []*string `locationName:"fleets" type:"list"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListFleetsForVehicleOutput) 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 ListFleetsForVehicleOutput) GoString() string { - return s.String() -} - -// SetFleets sets the Fleets field's value. -func (s *ListFleetsForVehicleOutput) SetFleets(v []*string) *ListFleetsForVehicleOutput { - s.Fleets = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFleetsForVehicleOutput) SetNextToken(v string) *ListFleetsForVehicleOutput { - s.NextToken = &v - return s -} - -type ListFleetsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListFleetsInput) 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 ListFleetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListFleetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListFleetsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListFleetsInput) SetMaxResults(v int64) *ListFleetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFleetsInput) SetNextToken(v string) *ListFleetsInput { - s.NextToken = &v - return s -} - -type ListFleetsOutput struct { - _ struct{} `type:"structure"` - - // A list of information for each fleet. - FleetSummaries []*FleetSummary `locationName:"fleetSummaries" type:"list"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListFleetsOutput) 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 ListFleetsOutput) GoString() string { - return s.String() -} - -// SetFleetSummaries sets the FleetSummaries field's value. -func (s *ListFleetsOutput) SetFleetSummaries(v []*FleetSummary) *ListFleetsOutput { - s.FleetSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListFleetsOutput) SetNextToken(v string) *ListFleetsOutput { - s.NextToken = &v - return s -} - -type ListModelManifestNodesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The name of the vehicle model to list information about. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListModelManifestNodesInput) 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 ListModelManifestNodesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListModelManifestNodesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListModelManifestNodesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListModelManifestNodesInput) SetMaxResults(v int64) *ListModelManifestNodesInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListModelManifestNodesInput) SetName(v string) *ListModelManifestNodesInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListModelManifestNodesInput) SetNextToken(v string) *ListModelManifestNodesInput { - s.NextToken = &v - return s -} - -type ListModelManifestNodesOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of information about nodes. - Nodes []*Node `locationName:"nodes" type:"list"` -} - -// 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 ListModelManifestNodesOutput) 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 ListModelManifestNodesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListModelManifestNodesOutput) SetNextToken(v string) *ListModelManifestNodesOutput { - s.NextToken = &v - return s -} - -// SetNodes sets the Nodes field's value. -func (s *ListModelManifestNodesOutput) SetNodes(v []*Node) *ListModelManifestNodesOutput { - s.Nodes = v - return s -} - -type ListModelManifestsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The ARN of a signal catalog. If you specify a signal catalog, only the vehicle - // models associated with it are returned. - SignalCatalogArn *string `locationName:"signalCatalogArn" 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 ListModelManifestsInput) 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 ListModelManifestsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListModelManifestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListModelManifestsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListModelManifestsInput) SetMaxResults(v int64) *ListModelManifestsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListModelManifestsInput) SetNextToken(v string) *ListModelManifestsInput { - s.NextToken = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *ListModelManifestsInput) SetSignalCatalogArn(v string) *ListModelManifestsInput { - s.SignalCatalogArn = &v - return s -} - -type ListModelManifestsOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of information about vehicle models. - Summaries []*ModelManifestSummary `locationName:"summaries" type:"list"` -} - -// 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 ListModelManifestsOutput) 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 ListModelManifestsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListModelManifestsOutput) SetNextToken(v string) *ListModelManifestsOutput { - s.NextToken = &v - return s -} - -// SetSummaries sets the Summaries field's value. -func (s *ListModelManifestsOutput) SetSummaries(v []*ModelManifestSummary) *ListModelManifestsOutput { - s.Summaries = v - return s -} - -type ListSignalCatalogNodesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The name of the signal catalog to list information about. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListSignalCatalogNodesInput) 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 ListSignalCatalogNodesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSignalCatalogNodesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSignalCatalogNodesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSignalCatalogNodesInput) SetMaxResults(v int64) *ListSignalCatalogNodesInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListSignalCatalogNodesInput) SetName(v string) *ListSignalCatalogNodesInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSignalCatalogNodesInput) SetNextToken(v string) *ListSignalCatalogNodesInput { - s.NextToken = &v - return s -} - -type ListSignalCatalogNodesOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of information about nodes. - Nodes []*Node `locationName:"nodes" type:"list"` -} - -// 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 ListSignalCatalogNodesOutput) 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 ListSignalCatalogNodesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSignalCatalogNodesOutput) SetNextToken(v string) *ListSignalCatalogNodesOutput { - s.NextToken = &v - return s -} - -// SetNodes sets the Nodes field's value. -func (s *ListSignalCatalogNodesOutput) SetNodes(v []*Node) *ListSignalCatalogNodesOutput { - s.Nodes = v - return s -} - -type ListSignalCatalogsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListSignalCatalogsInput) 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 ListSignalCatalogsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSignalCatalogsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSignalCatalogsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSignalCatalogsInput) SetMaxResults(v int64) *ListSignalCatalogsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSignalCatalogsInput) SetNextToken(v string) *ListSignalCatalogsInput { - s.NextToken = &v - return s -} - -type ListSignalCatalogsOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of information about each signal catalog. - Summaries []*SignalCatalogSummary `locationName:"summaries" type:"list"` -} - -// 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 ListSignalCatalogsOutput) 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 ListSignalCatalogsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSignalCatalogsOutput) SetNextToken(v string) *ListSignalCatalogsOutput { - s.NextToken = &v - return s -} - -// SetSummaries sets the Summaries field's value. -func (s *ListSignalCatalogsOutput) SetSummaries(v []*SignalCatalogSummary) *ListSignalCatalogsOutput { - s.Summaries = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { - s.ResourceARN = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The list of tags assigned to the resource. - Tags []*Tag `type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListVehiclesInFleetInput struct { - _ struct{} `type:"structure"` - - // The ID of a fleet. - // - // FleetId is a required field - FleetId *string `locationName:"fleetId" min:"1" type:"string" required:"true"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListVehiclesInFleetInput) 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 ListVehiclesInFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVehiclesInFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVehiclesInFleetInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.FleetId != nil && len(*s.FleetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FleetId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFleetId sets the FleetId field's value. -func (s *ListVehiclesInFleetInput) SetFleetId(v string) *ListVehiclesInFleetInput { - s.FleetId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVehiclesInFleetInput) SetMaxResults(v int64) *ListVehiclesInFleetInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVehiclesInFleetInput) SetNextToken(v string) *ListVehiclesInFleetInput { - s.NextToken = &v - return s -} - -type ListVehiclesInFleetOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of vehicles associated with the fleet. - Vehicles []*string `locationName:"vehicles" type:"list"` -} - -// 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 ListVehiclesInFleetOutput) 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 ListVehiclesInFleetOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVehiclesInFleetOutput) SetNextToken(v string) *ListVehiclesInFleetOutput { - s.NextToken = &v - return s -} - -// SetVehicles sets the Vehicles field's value. -func (s *ListVehiclesInFleetOutput) SetVehicles(v []*string) *ListVehiclesInFleetOutput { - s.Vehicles = v - return s -} - -type ListVehiclesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return, between 1 and 100, inclusive. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of a vehicle model (model manifest). You can - // use this optional parameter to list only the vehicles created from a certain - // vehicle model. - ModelManifestArn *string `locationName:"modelManifestArn" type:"string"` - - // A pagination token for the next set of results. - // - // If the results of a search are large, only a portion of the results are returned, - // and a nextToken pagination token is returned in the response. To retrieve - // the next set of results, reissue the search request and include the returned - // token. When all results have been returned, the response does not contain - // a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListVehiclesInput) 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 ListVehiclesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVehiclesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVehiclesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVehiclesInput) SetMaxResults(v int64) *ListVehiclesInput { - s.MaxResults = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *ListVehiclesInput) SetModelManifestArn(v string) *ListVehiclesInput { - s.ModelManifestArn = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVehiclesInput) SetNextToken(v string) *ListVehiclesInput { - s.NextToken = &v - return s -} - -type ListVehiclesOutput struct { - _ struct{} `type:"structure"` - - // The token to retrieve the next set of results, or null if there are no more - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of vehicles and information about them. - VehicleSummaries []*VehicleSummary `locationName:"vehicleSummaries" type:"list"` -} - -// 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 ListVehiclesOutput) 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 ListVehiclesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVehiclesOutput) SetNextToken(v string) *ListVehiclesOutput { - s.NextToken = &v - return s -} - -// SetVehicleSummaries sets the VehicleSummaries field's value. -func (s *ListVehiclesOutput) SetVehicleSummaries(v []*VehicleSummary) *ListVehiclesOutput { - s.VehicleSummaries = v - return s -} - -// The decoding information for a specific message which support higher order -// data types. -type MessageSignal struct { - _ struct{} `type:"structure"` - - // The structured message for the message signal. It can be defined with either - // a primitiveMessageDefinition, structuredMessageListDefinition, or structuredMessageDefinition - // recursively. - // - // StructuredMessage is a required field - StructuredMessage *StructuredMessage `locationName:"structuredMessage" type:"structure" required:"true"` - - // The topic name for the message signal. It corresponds to topics in ROS 2. - // - // TopicName is a required field - TopicName *string `locationName:"topicName" min:"1" 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 MessageSignal) 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 MessageSignal) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MessageSignal) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MessageSignal"} - if s.StructuredMessage == nil { - invalidParams.Add(request.NewErrParamRequired("StructuredMessage")) - } - if s.TopicName == nil { - invalidParams.Add(request.NewErrParamRequired("TopicName")) - } - if s.TopicName != nil && len(*s.TopicName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicName", 1)) - } - if s.StructuredMessage != nil { - if err := s.StructuredMessage.Validate(); err != nil { - invalidParams.AddNested("StructuredMessage", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStructuredMessage sets the StructuredMessage field's value. -func (s *MessageSignal) SetStructuredMessage(v *StructuredMessage) *MessageSignal { - s.StructuredMessage = v - return s -} - -// SetTopicName sets the TopicName field's value. -func (s *MessageSignal) SetTopicName(v string) *MessageSignal { - s.TopicName = &v - return s -} - -// Information about a vehicle model (model manifest). You can use the API operation -// to return this information about multiple vehicle models. -type ModelManifestSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the vehicle model. - Arn *string `locationName:"arn" type:"string"` - - // The time the vehicle model was created, in seconds since epoch (January 1, - // 1970 at midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // A brief description of the vehicle model. - Description *string `locationName:"description" min:"1" type:"string"` - - // The time the vehicle model was last updated, in seconds since epoch (January - // 1, 1970 at midnight UTC time). - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The name of the vehicle model. - Name *string `locationName:"name" type:"string"` - - // The ARN of the signal catalog associated with the vehicle model. - SignalCatalogArn *string `locationName:"signalCatalogArn" type:"string"` - - // The state of the vehicle model. If the status is ACTIVE, the vehicle model - // can't be edited. If the status is DRAFT, you can edit the vehicle model. - Status *string `locationName:"status" type:"string" enum:"ManifestStatus"` -} - -// 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 ModelManifestSummary) 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 ModelManifestSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ModelManifestSummary) SetArn(v string) *ModelManifestSummary { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ModelManifestSummary) SetCreationTime(v time.Time) *ModelManifestSummary { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModelManifestSummary) SetDescription(v string) *ModelManifestSummary { - s.Description = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *ModelManifestSummary) SetLastModificationTime(v time.Time) *ModelManifestSummary { - s.LastModificationTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *ModelManifestSummary) SetName(v string) *ModelManifestSummary { - s.Name = &v - return s -} - -// SetSignalCatalogArn sets the SignalCatalogArn field's value. -func (s *ModelManifestSummary) SetSignalCatalogArn(v string) *ModelManifestSummary { - s.SignalCatalogArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ModelManifestSummary) SetStatus(v string) *ModelManifestSummary { - s.Status = &v - return s -} - -// Specifications for defining a vehicle network. -type NetworkFileDefinition struct { - _ struct{} `type:"structure"` - - // Information, including CAN DBC files, about the configurations used to create - // a decoder manifest. - CanDbc *CanDbcDefinition `locationName:"canDbc" 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 NetworkFileDefinition) 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 NetworkFileDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NetworkFileDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NetworkFileDefinition"} - if s.CanDbc != nil { - if err := s.CanDbc.Validate(); err != nil { - invalidParams.AddNested("CanDbc", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCanDbc sets the CanDbc field's value. -func (s *NetworkFileDefinition) SetCanDbc(v *CanDbcDefinition) *NetworkFileDefinition { - s.CanDbc = v - return s -} - -// Represents a node and its specifications in an in-vehicle communication network. -// All signal decoders must be associated with a network node. -// -// To return this information about all the network interfaces specified in -// a decoder manifest, use the API operation. -type NetworkInterface struct { - _ struct{} `type:"structure"` - - // Information about a network interface specified by the Controller Area Network - // (CAN) protocol. - CanInterface *CanInterface `locationName:"canInterface" type:"structure"` - - // The ID of the network interface. - // - // InterfaceId is a required field - InterfaceId *string `locationName:"interfaceId" min:"1" type:"string" required:"true"` - - // Information about a network interface specified by the On-board diagnostic - // (OBD) II protocol. - ObdInterface *ObdInterface `locationName:"obdInterface" type:"structure"` - - // The network protocol for the vehicle. For example, CAN_SIGNAL specifies a - // protocol that defines how data is communicated between electronic control - // units (ECUs). OBD_SIGNAL specifies a protocol that defines how self-diagnostic - // data is communicated between ECUs. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"NetworkInterfaceType"` - - // The vehicle middleware defined as a type of network interface. Examples of - // vehicle middleware include ROS2 and SOME/IP. - VehicleMiddleware *VehicleMiddleware `locationName:"vehicleMiddleware" 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 NetworkInterface) 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 NetworkInterface) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NetworkInterface) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NetworkInterface"} - if s.InterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("InterfaceId")) - } - if s.InterfaceId != nil && len(*s.InterfaceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InterfaceId", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.CanInterface != nil { - if err := s.CanInterface.Validate(); err != nil { - invalidParams.AddNested("CanInterface", err.(request.ErrInvalidParams)) - } - } - if s.ObdInterface != nil { - if err := s.ObdInterface.Validate(); err != nil { - invalidParams.AddNested("ObdInterface", err.(request.ErrInvalidParams)) - } - } - if s.VehicleMiddleware != nil { - if err := s.VehicleMiddleware.Validate(); err != nil { - invalidParams.AddNested("VehicleMiddleware", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCanInterface sets the CanInterface field's value. -func (s *NetworkInterface) SetCanInterface(v *CanInterface) *NetworkInterface { - s.CanInterface = v - return s -} - -// SetInterfaceId sets the InterfaceId field's value. -func (s *NetworkInterface) SetInterfaceId(v string) *NetworkInterface { - s.InterfaceId = &v - return s -} - -// SetObdInterface sets the ObdInterface field's value. -func (s *NetworkInterface) SetObdInterface(v *ObdInterface) *NetworkInterface { - s.ObdInterface = v - return s -} - -// SetType sets the Type field's value. -func (s *NetworkInterface) SetType(v string) *NetworkInterface { - s.Type = &v - return s -} - -// SetVehicleMiddleware sets the VehicleMiddleware field's value. -func (s *NetworkInterface) SetVehicleMiddleware(v *VehicleMiddleware) *NetworkInterface { - s.VehicleMiddleware = v - return s -} - -// A general abstraction of a signal. A node can be specified as an actuator, -// attribute, branch, or sensor. -type Node struct { - _ struct{} `type:"structure"` - - // Information about a node specified as an actuator. - // - // An actuator is a digital representation of a vehicle device. - Actuator *Actuator `locationName:"actuator" type:"structure"` - - // Information about a node specified as an attribute. - // - // An attribute represents static information about a vehicle. - Attribute *Attribute `locationName:"attribute" type:"structure"` - - // Information about a node specified as a branch. - // - // A group of signals that are defined in a hierarchical structure. - Branch *Branch `locationName:"branch" type:"structure"` - - // Represents a member of the complex data structure. The datatype of the property - // can be either primitive or another struct. - Property *CustomProperty `locationName:"property" type:"structure"` - - // An input component that reports the environmental condition of a vehicle. - // - // You can collect data about fluid levels, temperatures, vibrations, or battery - // voltage from sensors. - Sensor *Sensor `locationName:"sensor" type:"structure"` - - // Represents a complex or higher-order data structure. - Struct *CustomStruct `locationName:"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 Node) 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 Node) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Node) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Node"} - if s.Actuator != nil { - if err := s.Actuator.Validate(); err != nil { - invalidParams.AddNested("Actuator", err.(request.ErrInvalidParams)) - } - } - if s.Attribute != nil { - if err := s.Attribute.Validate(); err != nil { - invalidParams.AddNested("Attribute", err.(request.ErrInvalidParams)) - } - } - if s.Branch != nil { - if err := s.Branch.Validate(); err != nil { - invalidParams.AddNested("Branch", err.(request.ErrInvalidParams)) - } - } - if s.Property != nil { - if err := s.Property.Validate(); err != nil { - invalidParams.AddNested("Property", err.(request.ErrInvalidParams)) - } - } - if s.Sensor != nil { - if err := s.Sensor.Validate(); err != nil { - invalidParams.AddNested("Sensor", err.(request.ErrInvalidParams)) - } - } - if s.Struct != nil { - if err := s.Struct.Validate(); err != nil { - invalidParams.AddNested("Struct", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActuator sets the Actuator field's value. -func (s *Node) SetActuator(v *Actuator) *Node { - s.Actuator = v - return s -} - -// SetAttribute sets the Attribute field's value. -func (s *Node) SetAttribute(v *Attribute) *Node { - s.Attribute = v - return s -} - -// SetBranch sets the Branch field's value. -func (s *Node) SetBranch(v *Branch) *Node { - s.Branch = v - return s -} - -// SetProperty sets the Property field's value. -func (s *Node) SetProperty(v *CustomProperty) *Node { - s.Property = v - return s -} - -// SetSensor sets the Sensor field's value. -func (s *Node) SetSensor(v *Sensor) *Node { - s.Sensor = v - return s -} - -// SetStruct sets the Struct field's value. -func (s *Node) SetStruct(v *CustomStruct) *Node { - s.Struct = v - return s -} - -// Information about the number of nodes and node types in a vehicle network. -type NodeCounts struct { - _ struct{} `type:"structure"` - - // The total number of nodes in a vehicle network that represent actuators. - TotalActuators *int64 `locationName:"totalActuators" type:"integer"` - - // The total number of nodes in a vehicle network that represent attributes. - TotalAttributes *int64 `locationName:"totalAttributes" type:"integer"` - - // The total number of nodes in a vehicle network that represent branches. - TotalBranches *int64 `locationName:"totalBranches" type:"integer"` - - // The total number of nodes in a vehicle network. - TotalNodes *int64 `locationName:"totalNodes" type:"integer"` - - // The total properties for the node. - TotalProperties *int64 `locationName:"totalProperties" type:"integer"` - - // The total number of nodes in a vehicle network that represent sensors. - TotalSensors *int64 `locationName:"totalSensors" type:"integer"` - - // The total structure for the node. - TotalStructs *int64 `locationName:"totalStructs" 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 NodeCounts) 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 NodeCounts) GoString() string { - return s.String() -} - -// SetTotalActuators sets the TotalActuators field's value. -func (s *NodeCounts) SetTotalActuators(v int64) *NodeCounts { - s.TotalActuators = &v - return s -} - -// SetTotalAttributes sets the TotalAttributes field's value. -func (s *NodeCounts) SetTotalAttributes(v int64) *NodeCounts { - s.TotalAttributes = &v - return s -} - -// SetTotalBranches sets the TotalBranches field's value. -func (s *NodeCounts) SetTotalBranches(v int64) *NodeCounts { - s.TotalBranches = &v - return s -} - -// SetTotalNodes sets the TotalNodes field's value. -func (s *NodeCounts) SetTotalNodes(v int64) *NodeCounts { - s.TotalNodes = &v - return s -} - -// SetTotalProperties sets the TotalProperties field's value. -func (s *NodeCounts) SetTotalProperties(v int64) *NodeCounts { - s.TotalProperties = &v - return s -} - -// SetTotalSensors sets the TotalSensors field's value. -func (s *NodeCounts) SetTotalSensors(v int64) *NodeCounts { - s.TotalSensors = &v - return s -} - -// SetTotalStructs sets the TotalStructs field's value. -func (s *NodeCounts) SetTotalStructs(v int64) *NodeCounts { - s.TotalStructs = &v - return s -} - -// A network interface that specifies the On-board diagnostic (OBD) II network -// protocol. -type ObdInterface struct { - _ struct{} `type:"structure"` - - // The maximum number message requests per diagnostic trouble code per second. - DtcRequestIntervalSeconds *int64 `locationName:"dtcRequestIntervalSeconds" type:"integer"` - - // Whether the vehicle has a transmission control module (TCM). - HasTransmissionEcu *bool `locationName:"hasTransmissionEcu" type:"boolean"` - - // The name of the interface. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The standard OBD II PID. - ObdStandard *string `locationName:"obdStandard" min:"1" type:"string"` - - // The maximum number message requests per second. - PidRequestIntervalSeconds *int64 `locationName:"pidRequestIntervalSeconds" type:"integer"` - - // The ID of the message requesting vehicle data. - // - // RequestMessageId is a required field - RequestMessageId *int64 `locationName:"requestMessageId" type:"integer" required:"true"` - - // Whether to use extended IDs in the message. - UseExtendedIds *bool `locationName:"useExtendedIds" type:"boolean"` -} - -// 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 ObdInterface) 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 ObdInterface) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ObdInterface) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ObdInterface"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ObdStandard != nil && len(*s.ObdStandard) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ObdStandard", 1)) - } - if s.RequestMessageId == nil { - invalidParams.Add(request.NewErrParamRequired("RequestMessageId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDtcRequestIntervalSeconds sets the DtcRequestIntervalSeconds field's value. -func (s *ObdInterface) SetDtcRequestIntervalSeconds(v int64) *ObdInterface { - s.DtcRequestIntervalSeconds = &v - return s -} - -// SetHasTransmissionEcu sets the HasTransmissionEcu field's value. -func (s *ObdInterface) SetHasTransmissionEcu(v bool) *ObdInterface { - s.HasTransmissionEcu = &v - return s -} - -// SetName sets the Name field's value. -func (s *ObdInterface) SetName(v string) *ObdInterface { - s.Name = &v - return s -} - -// SetObdStandard sets the ObdStandard field's value. -func (s *ObdInterface) SetObdStandard(v string) *ObdInterface { - s.ObdStandard = &v - return s -} - -// SetPidRequestIntervalSeconds sets the PidRequestIntervalSeconds field's value. -func (s *ObdInterface) SetPidRequestIntervalSeconds(v int64) *ObdInterface { - s.PidRequestIntervalSeconds = &v - return s -} - -// SetRequestMessageId sets the RequestMessageId field's value. -func (s *ObdInterface) SetRequestMessageId(v int64) *ObdInterface { - s.RequestMessageId = &v - return s -} - -// SetUseExtendedIds sets the UseExtendedIds field's value. -func (s *ObdInterface) SetUseExtendedIds(v bool) *ObdInterface { - s.UseExtendedIds = &v - return s -} - -// Information about signal messages using the on-board diagnostics (OBD) II -// protocol in a vehicle. -type ObdSignal struct { - _ struct{} `type:"structure"` - - // The number of bits to mask in a message. - BitMaskLength *int64 `locationName:"bitMaskLength" min:"1" type:"integer"` - - // The number of positions to shift bits in the message. - BitRightShift *int64 `locationName:"bitRightShift" type:"integer"` - - // The length of a message. - // - // ByteLength is a required field - ByteLength *int64 `locationName:"byteLength" min:"1" type:"integer" required:"true"` - - // The offset used to calculate the signal value. Combined with scaling, the - // calculation is value = raw_value * scaling + offset. - // - // Offset is a required field - Offset *float64 `locationName:"offset" type:"double" required:"true"` - - // The diagnostic code used to request data from a vehicle for this signal. - // - // Pid is a required field - Pid *int64 `locationName:"pid" type:"integer" required:"true"` - - // The length of the requested data. - // - // PidResponseLength is a required field - PidResponseLength *int64 `locationName:"pidResponseLength" min:"1" type:"integer" required:"true"` - - // A multiplier used to decode the message. - // - // Scaling is a required field - Scaling *float64 `locationName:"scaling" type:"double" required:"true"` - - // The mode of operation (diagnostic service) in a message. - // - // ServiceMode is a required field - ServiceMode *int64 `locationName:"serviceMode" type:"integer" required:"true"` - - // Indicates the beginning of the message. - // - // StartByte is a required field - StartByte *int64 `locationName:"startByte" type:"integer" 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 ObdSignal) 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 ObdSignal) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ObdSignal) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ObdSignal"} - if s.BitMaskLength != nil && *s.BitMaskLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("BitMaskLength", 1)) - } - if s.ByteLength == nil { - invalidParams.Add(request.NewErrParamRequired("ByteLength")) - } - if s.ByteLength != nil && *s.ByteLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("ByteLength", 1)) - } - if s.Offset == nil { - invalidParams.Add(request.NewErrParamRequired("Offset")) - } - if s.Pid == nil { - invalidParams.Add(request.NewErrParamRequired("Pid")) - } - if s.PidResponseLength == nil { - invalidParams.Add(request.NewErrParamRequired("PidResponseLength")) - } - if s.PidResponseLength != nil && *s.PidResponseLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("PidResponseLength", 1)) - } - if s.Scaling == nil { - invalidParams.Add(request.NewErrParamRequired("Scaling")) - } - if s.ServiceMode == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceMode")) - } - if s.StartByte == nil { - invalidParams.Add(request.NewErrParamRequired("StartByte")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBitMaskLength sets the BitMaskLength field's value. -func (s *ObdSignal) SetBitMaskLength(v int64) *ObdSignal { - s.BitMaskLength = &v - return s -} - -// SetBitRightShift sets the BitRightShift field's value. -func (s *ObdSignal) SetBitRightShift(v int64) *ObdSignal { - s.BitRightShift = &v - return s -} - -// SetByteLength sets the ByteLength field's value. -func (s *ObdSignal) SetByteLength(v int64) *ObdSignal { - s.ByteLength = &v - return s -} - -// SetOffset sets the Offset field's value. -func (s *ObdSignal) SetOffset(v float64) *ObdSignal { - s.Offset = &v - return s -} - -// SetPid sets the Pid field's value. -func (s *ObdSignal) SetPid(v int64) *ObdSignal { - s.Pid = &v - return s -} - -// SetPidResponseLength sets the PidResponseLength field's value. -func (s *ObdSignal) SetPidResponseLength(v int64) *ObdSignal { - s.PidResponseLength = &v - return s -} - -// SetScaling sets the Scaling field's value. -func (s *ObdSignal) SetScaling(v float64) *ObdSignal { - s.Scaling = &v - return s -} - -// SetServiceMode sets the ServiceMode field's value. -func (s *ObdSignal) SetServiceMode(v int64) *ObdSignal { - s.ServiceMode = &v - return s -} - -// SetStartByte sets the StartByte field's value. -func (s *ObdSignal) SetStartByte(v int64) *ObdSignal { - s.StartByte = &v - return s -} - -// Represents a primitive type node of the complex data structure. -type PrimitiveMessageDefinition struct { - _ struct{} `type:"structure"` - - // Information about a PrimitiveMessage using a ROS 2 compliant primitive type - // message of the complex data structure. - Ros2PrimitiveMessageDefinition *ROS2PrimitiveMessageDefinition `locationName:"ros2PrimitiveMessageDefinition" 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 PrimitiveMessageDefinition) 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 PrimitiveMessageDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrimitiveMessageDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrimitiveMessageDefinition"} - if s.Ros2PrimitiveMessageDefinition != nil { - if err := s.Ros2PrimitiveMessageDefinition.Validate(); err != nil { - invalidParams.AddNested("Ros2PrimitiveMessageDefinition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRos2PrimitiveMessageDefinition sets the Ros2PrimitiveMessageDefinition field's value. -func (s *PrimitiveMessageDefinition) SetRos2PrimitiveMessageDefinition(v *ROS2PrimitiveMessageDefinition) *PrimitiveMessageDefinition { - s.Ros2PrimitiveMessageDefinition = v - return s -} - -type PutEncryptionConfigurationInput struct { - _ struct{} `type:"structure"` - - // The type of encryption. Choose KMS_BASED_ENCRYPTION to use a KMS key or FLEETWISE_DEFAULT_ENCRYPTION - // to use an Amazon Web Services managed key. - // - // EncryptionType is a required field - EncryptionType *string `locationName:"encryptionType" type:"string" required:"true" enum:"EncryptionType"` - - // The ID of the KMS key that is used for encryption. - KmsKeyId *string `locationName:"kmsKeyId" 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 PutEncryptionConfigurationInput) 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 PutEncryptionConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutEncryptionConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutEncryptionConfigurationInput"} - if s.EncryptionType == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionType sets the EncryptionType field's value. -func (s *PutEncryptionConfigurationInput) SetEncryptionType(v string) *PutEncryptionConfigurationInput { - s.EncryptionType = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *PutEncryptionConfigurationInput) SetKmsKeyId(v string) *PutEncryptionConfigurationInput { - s.KmsKeyId = &v - return s -} - -type PutEncryptionConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The encryption status. - // - // EncryptionStatus is a required field - EncryptionStatus *string `locationName:"encryptionStatus" type:"string" required:"true" enum:"EncryptionStatus"` - - // The type of encryption. Set to KMS_BASED_ENCRYPTION to use an KMS key that - // you own and manage. Set to FLEETWISE_DEFAULT_ENCRYPTION to use an Amazon - // Web Services managed key that is owned by the Amazon Web Services IoT FleetWise - // service account. - // - // EncryptionType is a required field - EncryptionType *string `locationName:"encryptionType" type:"string" required:"true" enum:"EncryptionType"` - - // The ID of the KMS key that is used for encryption. - KmsKeyId *string `locationName:"kmsKeyId" 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 PutEncryptionConfigurationOutput) 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 PutEncryptionConfigurationOutput) GoString() string { - return s.String() -} - -// SetEncryptionStatus sets the EncryptionStatus field's value. -func (s *PutEncryptionConfigurationOutput) SetEncryptionStatus(v string) *PutEncryptionConfigurationOutput { - s.EncryptionStatus = &v - return s -} - -// SetEncryptionType sets the EncryptionType field's value. -func (s *PutEncryptionConfigurationOutput) SetEncryptionType(v string) *PutEncryptionConfigurationOutput { - s.EncryptionType = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *PutEncryptionConfigurationOutput) SetKmsKeyId(v string) *PutEncryptionConfigurationOutput { - s.KmsKeyId = &v - return s -} - -type PutLoggingOptionsInput struct { - _ struct{} `type:"structure"` - - // Creates or updates the log delivery option to Amazon CloudWatch Logs. - // - // CloudWatchLogDelivery is a required field - CloudWatchLogDelivery *CloudWatchLogDeliveryOptions `locationName:"cloudWatchLogDelivery" type:"structure" 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 PutLoggingOptionsInput) 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 PutLoggingOptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutLoggingOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutLoggingOptionsInput"} - if s.CloudWatchLogDelivery == nil { - invalidParams.Add(request.NewErrParamRequired("CloudWatchLogDelivery")) - } - if s.CloudWatchLogDelivery != nil { - if err := s.CloudWatchLogDelivery.Validate(); err != nil { - invalidParams.AddNested("CloudWatchLogDelivery", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchLogDelivery sets the CloudWatchLogDelivery field's value. -func (s *PutLoggingOptionsInput) SetCloudWatchLogDelivery(v *CloudWatchLogDeliveryOptions) *PutLoggingOptionsInput { - s.CloudWatchLogDelivery = v - return s -} - -type PutLoggingOptionsOutput 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 PutLoggingOptionsOutput) 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 PutLoggingOptionsOutput) GoString() string { - return s.String() -} - -// Represents a ROS 2 compliant primitive type message of the complex data structure. -type ROS2PrimitiveMessageDefinition struct { - _ struct{} `type:"structure"` - - // The offset used to calculate the signal value. Combined with scaling, the - // calculation is value = raw_value * scaling + offset. - Offset *float64 `locationName:"offset" type:"double"` - - // The primitive type (integer, floating point, boolean, etc.) for the ROS 2 - // primitive message definition. - // - // PrimitiveType is a required field - PrimitiveType *string `locationName:"primitiveType" type:"string" required:"true" enum:"ROS2PrimitiveType"` - - // A multiplier used to decode the message. - Scaling *float64 `locationName:"scaling" type:"double"` - - // An optional attribute specifying the upper bound for STRING and WSTRING. - UpperBound *int64 `locationName:"upperBound" type:"long"` -} - -// 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 ROS2PrimitiveMessageDefinition) 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 ROS2PrimitiveMessageDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ROS2PrimitiveMessageDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ROS2PrimitiveMessageDefinition"} - if s.PrimitiveType == nil { - invalidParams.Add(request.NewErrParamRequired("PrimitiveType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOffset sets the Offset field's value. -func (s *ROS2PrimitiveMessageDefinition) SetOffset(v float64) *ROS2PrimitiveMessageDefinition { - s.Offset = &v - return s -} - -// SetPrimitiveType sets the PrimitiveType field's value. -func (s *ROS2PrimitiveMessageDefinition) SetPrimitiveType(v string) *ROS2PrimitiveMessageDefinition { - s.PrimitiveType = &v - return s -} - -// SetScaling sets the Scaling field's value. -func (s *ROS2PrimitiveMessageDefinition) SetScaling(v float64) *ROS2PrimitiveMessageDefinition { - s.Scaling = &v - return s -} - -// SetUpperBound sets the UpperBound field's value. -func (s *ROS2PrimitiveMessageDefinition) SetUpperBound(v int64) *ROS2PrimitiveMessageDefinition { - s.UpperBound = &v - return s -} - -type RegisterAccountInput struct { - _ struct{} `type:"structure"` - - // The IAM resource that allows Amazon Web Services IoT FleetWise to send data - // to Amazon Timestream. - // - // Deprecated: iamResources is no longer used or needed as input - IamResources *IamResources `locationName:"iamResources" deprecated:"true" type:"structure"` - - // The registered Amazon Timestream resources that Amazon Web Services IoT FleetWise - // edge agent software can transfer your vehicle data to. - // - // Deprecated: Amazon Timestream metadata is now passed in the CreateCampaign API. - TimestreamResources *TimestreamResources `locationName:"timestreamResources" deprecated:"true" 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 RegisterAccountInput) 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 RegisterAccountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterAccountInput"} - if s.IamResources != nil { - if err := s.IamResources.Validate(); err != nil { - invalidParams.AddNested("IamResources", err.(request.ErrInvalidParams)) - } - } - if s.TimestreamResources != nil { - if err := s.TimestreamResources.Validate(); err != nil { - invalidParams.AddNested("TimestreamResources", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIamResources sets the IamResources field's value. -func (s *RegisterAccountInput) SetIamResources(v *IamResources) *RegisterAccountInput { - s.IamResources = v - return s -} - -// SetTimestreamResources sets the TimestreamResources field's value. -func (s *RegisterAccountInput) SetTimestreamResources(v *TimestreamResources) *RegisterAccountInput { - s.TimestreamResources = v - return s -} - -type RegisterAccountOutput struct { - _ struct{} `type:"structure"` - - // The time the account was registered, in seconds since epoch (January 1, 1970 - // at midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The registered IAM resource that allows Amazon Web Services IoT FleetWise - // to send data to Amazon Timestream. - // - // IamResources is a required field - IamResources *IamResources `locationName:"iamResources" type:"structure" required:"true"` - - // The time this registration was last updated, in seconds since epoch (January - // 1, 1970 at midnight UTC time). - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The status of registering your Amazon Web Services account, IAM role, and - // Timestream resources. - // - // RegisterAccountStatus is a required field - RegisterAccountStatus *string `locationName:"registerAccountStatus" type:"string" required:"true" enum:"RegistrationStatus"` - - // The registered Amazon Timestream resources that Amazon Web Services IoT FleetWise - // edge agent software can transfer your vehicle data to. - TimestreamResources *TimestreamResources `locationName:"timestreamResources" 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 RegisterAccountOutput) 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 RegisterAccountOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *RegisterAccountOutput) SetCreationTime(v time.Time) *RegisterAccountOutput { - s.CreationTime = &v - return s -} - -// SetIamResources sets the IamResources field's value. -func (s *RegisterAccountOutput) SetIamResources(v *IamResources) *RegisterAccountOutput { - s.IamResources = v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *RegisterAccountOutput) SetLastModificationTime(v time.Time) *RegisterAccountOutput { - s.LastModificationTime = &v - return s -} - -// SetRegisterAccountStatus sets the RegisterAccountStatus field's value. -func (s *RegisterAccountOutput) SetRegisterAccountStatus(v string) *RegisterAccountOutput { - s.RegisterAccountStatus = &v - return s -} - -// SetTimestreamResources sets the TimestreamResources field's value. -func (s *RegisterAccountOutput) SetTimestreamResources(v *TimestreamResources) *RegisterAccountOutput { - s.TimestreamResources = v - return s -} - -// The resource wasn't found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The identifier of the resource that wasn't found. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of resource that wasn't found. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The Amazon S3 bucket where the Amazon Web Services IoT FleetWise campaign -// sends data. Amazon S3 is an object storage service that stores data as objects -// within buckets. For more information, see Creating, configuring, and working -// with Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html) -// in the Amazon Simple Storage Service User Guide. -type S3Config struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon S3 bucket. - // - // BucketArn is a required field - BucketArn *string `locationName:"bucketArn" min:"16" type:"string" required:"true"` - - // Specify the format that files are saved in the Amazon S3 bucket. You can - // save files in an Apache Parquet or JSON format. - // - // * Parquet - Store data in a columnar storage file format. Parquet is optimal - // for fast data retrieval and can reduce costs. This option is selected - // by default. - // - // * JSON - Store data in a standard text-based JSON file format. - DataFormat *string `locationName:"dataFormat" type:"string" enum:"DataFormat"` - - // (Optional) Enter an S3 bucket prefix. The prefix is the string of characters - // after the bucket name and before the object name. You can use the prefix - // to organize data stored in Amazon S3 buckets. For more information, see Organizing - // objects using prefixes (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html) - // in the Amazon Simple Storage Service User Guide. - // - // By default, Amazon Web Services IoT FleetWise sets the prefix processed-data/year=YY/month=MM/date=DD/hour=HH/ - // (in UTC) to data it delivers to Amazon S3. You can enter a prefix to append - // it to this default prefix. For example, if you enter the prefix vehicles, - // the prefix will be vehicles/processed-data/year=YY/month=MM/date=DD/hour=HH/. - Prefix *string `locationName:"prefix" min:"1" type:"string"` - - // By default, stored data is compressed as a .gzip file. Compressed files have - // a reduced file size, which can optimize the cost of data storage. - StorageCompressionFormat *string `locationName:"storageCompressionFormat" type:"string" enum:"StorageCompressionFormat"` -} - -// 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 S3Config) 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 S3Config) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Config) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Config"} - if s.BucketArn == nil { - invalidParams.Add(request.NewErrParamRequired("BucketArn")) - } - if s.BucketArn != nil && len(*s.BucketArn) < 16 { - invalidParams.Add(request.NewErrParamMinLen("BucketArn", 16)) - } - if s.Prefix != nil && len(*s.Prefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Prefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketArn sets the BucketArn field's value. -func (s *S3Config) SetBucketArn(v string) *S3Config { - s.BucketArn = &v - return s -} - -// SetDataFormat sets the DataFormat field's value. -func (s *S3Config) SetDataFormat(v string) *S3Config { - s.DataFormat = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3Config) SetPrefix(v string) *S3Config { - s.Prefix = &v - return s -} - -// SetStorageCompressionFormat sets the StorageCompressionFormat field's value. -func (s *S3Config) SetStorageCompressionFormat(v string) *S3Config { - s.StorageCompressionFormat = &v - return s -} - -// An input component that reports the environmental condition of a vehicle. -// -// You can collect data about fluid levels, temperatures, vibrations, or battery -// voltage from sensors. -type Sensor struct { - _ struct{} `type:"structure"` - - // A list of possible values a sensor can take. - AllowedValues []*string `locationName:"allowedValues" type:"list"` - - // A comment in addition to the description. - Comment *string `locationName:"comment" min:"1" type:"string"` - - // The specified data type of the sensor. - // - // DataType is a required field - DataType *string `locationName:"dataType" type:"string" required:"true" enum:"NodeDataType"` - - // The deprecation message for the node or the branch that was moved or deleted. - DeprecationMessage *string `locationName:"deprecationMessage" min:"1" type:"string"` - - // A brief description of a sensor. - Description *string `locationName:"description" min:"1" type:"string"` - - // The fully qualified name of the sensor. For example, the fully qualified - // name of a sensor might be Vehicle.Body.Engine.Battery. - // - // FullyQualifiedName is a required field - FullyQualifiedName *string `locationName:"fullyQualifiedName" type:"string" required:"true"` - - // The specified possible maximum value of the sensor. - Max *float64 `locationName:"max" type:"double"` - - // The specified possible minimum value of the sensor. - Min *float64 `locationName:"min" type:"double"` - - // The fully qualified name of the struct node for a sensor if the data type - // of the actuator is Struct or StructArray. For example, the struct fully qualified - // name of a sensor might be Vehicle.ADAS.CameraStruct. - StructFullyQualifiedName *string `locationName:"structFullyQualifiedName" min:"1" type:"string"` - - // The scientific unit of measurement for data collected by the sensor. - Unit *string `locationName:"unit" 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 Sensor) 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 Sensor) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Sensor) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Sensor"} - if s.Comment != nil && len(*s.Comment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Comment", 1)) - } - if s.DataType == nil { - invalidParams.Add(request.NewErrParamRequired("DataType")) - } - if s.DeprecationMessage != nil && len(*s.DeprecationMessage) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeprecationMessage", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FullyQualifiedName == nil { - invalidParams.Add(request.NewErrParamRequired("FullyQualifiedName")) - } - if s.StructFullyQualifiedName != nil && len(*s.StructFullyQualifiedName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StructFullyQualifiedName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *Sensor) SetAllowedValues(v []*string) *Sensor { - s.AllowedValues = v - return s -} - -// SetComment sets the Comment field's value. -func (s *Sensor) SetComment(v string) *Sensor { - s.Comment = &v - return s -} - -// SetDataType sets the DataType field's value. -func (s *Sensor) SetDataType(v string) *Sensor { - s.DataType = &v - return s -} - -// SetDeprecationMessage sets the DeprecationMessage field's value. -func (s *Sensor) SetDeprecationMessage(v string) *Sensor { - s.DeprecationMessage = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Sensor) SetDescription(v string) *Sensor { - s.Description = &v - return s -} - -// SetFullyQualifiedName sets the FullyQualifiedName field's value. -func (s *Sensor) SetFullyQualifiedName(v string) *Sensor { - s.FullyQualifiedName = &v - return s -} - -// SetMax sets the Max field's value. -func (s *Sensor) SetMax(v float64) *Sensor { - s.Max = &v - return s -} - -// SetMin sets the Min field's value. -func (s *Sensor) SetMin(v float64) *Sensor { - s.Min = &v - return s -} - -// SetStructFullyQualifiedName sets the StructFullyQualifiedName field's value. -func (s *Sensor) SetStructFullyQualifiedName(v string) *Sensor { - s.StructFullyQualifiedName = &v - return s -} - -// SetUnit sets the Unit field's value. -func (s *Sensor) SetUnit(v string) *Sensor { - s.Unit = &v - return s -} - -// Information about a collection of standardized signals, which can be attributes, -// branches, sensors, or actuators. -type SignalCatalogSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the signal catalog. - Arn *string `locationName:"arn" type:"string"` - - // The time the signal catalog was created in seconds since epoch (January 1, - // 1970 at midnight UTC time). - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The time the signal catalog was last updated in seconds since epoch (January - // 1, 1970 at midnight UTC time). - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp"` - - // The name of the signal catalog. - Name *string `locationName:"name" 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 SignalCatalogSummary) 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 SignalCatalogSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *SignalCatalogSummary) SetArn(v string) *SignalCatalogSummary { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *SignalCatalogSummary) SetCreationTime(v time.Time) *SignalCatalogSummary { - s.CreationTime = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *SignalCatalogSummary) SetLastModificationTime(v time.Time) *SignalCatalogSummary { - s.LastModificationTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *SignalCatalogSummary) SetName(v string) *SignalCatalogSummary { - s.Name = &v - return s -} - -// Information about a signal decoder. -type SignalDecoder struct { - _ struct{} `type:"structure"` - - // Information about signal decoder using the Controller Area Network (CAN) - // protocol. - CanSignal *CanSignal `locationName:"canSignal" type:"structure"` - - // The fully qualified name of a signal decoder as defined in a vehicle model. - // - // FullyQualifiedName is a required field - FullyQualifiedName *string `locationName:"fullyQualifiedName" min:"1" type:"string" required:"true"` - - // The ID of a network interface that specifies what network protocol a vehicle - // follows. - // - // InterfaceId is a required field - InterfaceId *string `locationName:"interfaceId" min:"1" type:"string" required:"true"` - - // The decoding information for a specific message which supports higher order - // data types. - MessageSignal *MessageSignal `locationName:"messageSignal" type:"structure"` - - // Information about signal decoder using the On-board diagnostic (OBD) II protocol. - ObdSignal *ObdSignal `locationName:"obdSignal" type:"structure"` - - // The network protocol for the vehicle. For example, CAN_SIGNAL specifies a - // protocol that defines how data is communicated between electronic control - // units (ECUs). OBD_SIGNAL specifies a protocol that defines how self-diagnostic - // data is communicated between ECUs. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SignalDecoderType"` -} - -// 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 SignalDecoder) 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 SignalDecoder) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SignalDecoder) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SignalDecoder"} - if s.FullyQualifiedName == nil { - invalidParams.Add(request.NewErrParamRequired("FullyQualifiedName")) - } - if s.FullyQualifiedName != nil && len(*s.FullyQualifiedName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FullyQualifiedName", 1)) - } - if s.InterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("InterfaceId")) - } - if s.InterfaceId != nil && len(*s.InterfaceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InterfaceId", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.CanSignal != nil { - if err := s.CanSignal.Validate(); err != nil { - invalidParams.AddNested("CanSignal", err.(request.ErrInvalidParams)) - } - } - if s.MessageSignal != nil { - if err := s.MessageSignal.Validate(); err != nil { - invalidParams.AddNested("MessageSignal", err.(request.ErrInvalidParams)) - } - } - if s.ObdSignal != nil { - if err := s.ObdSignal.Validate(); err != nil { - invalidParams.AddNested("ObdSignal", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCanSignal sets the CanSignal field's value. -func (s *SignalDecoder) SetCanSignal(v *CanSignal) *SignalDecoder { - s.CanSignal = v - return s -} - -// SetFullyQualifiedName sets the FullyQualifiedName field's value. -func (s *SignalDecoder) SetFullyQualifiedName(v string) *SignalDecoder { - s.FullyQualifiedName = &v - return s -} - -// SetInterfaceId sets the InterfaceId field's value. -func (s *SignalDecoder) SetInterfaceId(v string) *SignalDecoder { - s.InterfaceId = &v - return s -} - -// SetMessageSignal sets the MessageSignal field's value. -func (s *SignalDecoder) SetMessageSignal(v *MessageSignal) *SignalDecoder { - s.MessageSignal = v - return s -} - -// SetObdSignal sets the ObdSignal field's value. -func (s *SignalDecoder) SetObdSignal(v *ObdSignal) *SignalDecoder { - s.ObdSignal = v - return s -} - -// SetType sets the Type field's value. -func (s *SignalDecoder) SetType(v string) *SignalDecoder { - s.Type = &v - return s -} - -// Information about a signal. -type SignalInformation struct { - _ struct{} `type:"structure"` - - // The maximum number of samples to collect. - MaxSampleCount *int64 `locationName:"maxSampleCount" min:"1" type:"long"` - - // The minimum duration of time (in milliseconds) between two triggering events - // to collect data. - // - // If a signal changes often, you might want to collect data at a slower rate. - MinimumSamplingIntervalMs *int64 `locationName:"minimumSamplingIntervalMs" type:"long"` - - // The name of the signal. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 SignalInformation) 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 SignalInformation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SignalInformation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SignalInformation"} - if s.MaxSampleCount != nil && *s.MaxSampleCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxSampleCount", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxSampleCount sets the MaxSampleCount field's value. -func (s *SignalInformation) SetMaxSampleCount(v int64) *SignalInformation { - s.MaxSampleCount = &v - return s -} - -// SetMinimumSamplingIntervalMs sets the MinimumSamplingIntervalMs field's value. -func (s *SignalInformation) SetMinimumSamplingIntervalMs(v int64) *SignalInformation { - s.MinimumSamplingIntervalMs = &v - return s -} - -// SetName sets the Name field's value. -func (s *SignalInformation) SetName(v string) *SignalInformation { - s.Name = &v - return s -} - -// The structured message for the message signal. It can be defined with either -// a primitiveMessageDefinition, structuredMessageListDefinition, or structuredMessageDefinition -// recursively. -type StructuredMessage struct { - _ struct{} `type:"structure"` - - // Represents a primitive type node of the complex data structure. - PrimitiveMessageDefinition *PrimitiveMessageDefinition `locationName:"primitiveMessageDefinition" type:"structure"` - - // Represents a struct type node of the complex data structure. - StructuredMessageDefinition []*StructuredMessageFieldNameAndDataTypePair `locationName:"structuredMessageDefinition" min:"1" type:"list"` - - // Represents a list type node of the complex data structure. - StructuredMessageListDefinition *StructuredMessageListDefinition `locationName:"structuredMessageListDefinition" 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 StructuredMessage) 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 StructuredMessage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StructuredMessage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StructuredMessage"} - if s.StructuredMessageDefinition != nil && len(s.StructuredMessageDefinition) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StructuredMessageDefinition", 1)) - } - if s.PrimitiveMessageDefinition != nil { - if err := s.PrimitiveMessageDefinition.Validate(); err != nil { - invalidParams.AddNested("PrimitiveMessageDefinition", err.(request.ErrInvalidParams)) - } - } - if s.StructuredMessageDefinition != nil { - for i, v := range s.StructuredMessageDefinition { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StructuredMessageDefinition", i), err.(request.ErrInvalidParams)) - } - } - } - if s.StructuredMessageListDefinition != nil { - if err := s.StructuredMessageListDefinition.Validate(); err != nil { - invalidParams.AddNested("StructuredMessageListDefinition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrimitiveMessageDefinition sets the PrimitiveMessageDefinition field's value. -func (s *StructuredMessage) SetPrimitiveMessageDefinition(v *PrimitiveMessageDefinition) *StructuredMessage { - s.PrimitiveMessageDefinition = v - return s -} - -// SetStructuredMessageDefinition sets the StructuredMessageDefinition field's value. -func (s *StructuredMessage) SetStructuredMessageDefinition(v []*StructuredMessageFieldNameAndDataTypePair) *StructuredMessage { - s.StructuredMessageDefinition = v - return s -} - -// SetStructuredMessageListDefinition sets the StructuredMessageListDefinition field's value. -func (s *StructuredMessage) SetStructuredMessageListDefinition(v *StructuredMessageListDefinition) *StructuredMessage { - s.StructuredMessageListDefinition = v - return s -} - -// Represents a StructureMessageName to DataType map element. -type StructuredMessageFieldNameAndDataTypePair struct { - _ struct{} `type:"structure"` - - // The data type. - // - // DataType is a required field - DataType *StructuredMessage `locationName:"dataType" type:"structure" required:"true"` - - // The field name of the structured message. It determines how a data value - // is referenced in the target language. - // - // FieldName is a required field - FieldName *string `locationName:"fieldName" min:"1" 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 StructuredMessageFieldNameAndDataTypePair) 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 StructuredMessageFieldNameAndDataTypePair) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StructuredMessageFieldNameAndDataTypePair) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StructuredMessageFieldNameAndDataTypePair"} - if s.DataType == nil { - invalidParams.Add(request.NewErrParamRequired("DataType")) - } - if s.FieldName == nil { - invalidParams.Add(request.NewErrParamRequired("FieldName")) - } - if s.FieldName != nil && len(*s.FieldName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FieldName", 1)) - } - if s.DataType != nil { - if err := s.DataType.Validate(); err != nil { - invalidParams.AddNested("DataType", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataType sets the DataType field's value. -func (s *StructuredMessageFieldNameAndDataTypePair) SetDataType(v *StructuredMessage) *StructuredMessageFieldNameAndDataTypePair { - s.DataType = v - return s -} - -// SetFieldName sets the FieldName field's value. -func (s *StructuredMessageFieldNameAndDataTypePair) SetFieldName(v string) *StructuredMessageFieldNameAndDataTypePair { - s.FieldName = &v - return s -} - -// Represents a list type node of the complex data structure. -type StructuredMessageListDefinition struct { - _ struct{} `type:"structure"` - - // The capacity of the structured message list definition when the list type - // is FIXED_CAPACITY or DYNAMIC_BOUNDED_CAPACITY. - Capacity *int64 `locationName:"capacity" type:"integer"` - - // The type of list of the structured message list definition. - // - // ListType is a required field - ListType *string `locationName:"listType" type:"string" required:"true" enum:"StructuredMessageListType"` - - // The member type of the structured message list definition. - // - // MemberType is a required field - MemberType *StructuredMessage `locationName:"memberType" type:"structure" required:"true"` - - // The name of the structured message list definition. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 StructuredMessageListDefinition) 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 StructuredMessageListDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StructuredMessageListDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StructuredMessageListDefinition"} - if s.ListType == nil { - invalidParams.Add(request.NewErrParamRequired("ListType")) - } - if s.MemberType == nil { - invalidParams.Add(request.NewErrParamRequired("MemberType")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.MemberType != nil { - if err := s.MemberType.Validate(); err != nil { - invalidParams.AddNested("MemberType", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapacity sets the Capacity field's value. -func (s *StructuredMessageListDefinition) SetCapacity(v int64) *StructuredMessageListDefinition { - s.Capacity = &v - return s -} - -// SetListType sets the ListType field's value. -func (s *StructuredMessageListDefinition) SetListType(v string) *StructuredMessageListDefinition { - s.ListType = &v - return s -} - -// SetMemberType sets the MemberType field's value. -func (s *StructuredMessageListDefinition) SetMemberType(v *StructuredMessage) *StructuredMessageListDefinition { - s.MemberType = v - return s -} - -// SetName sets the Name field's value. -func (s *StructuredMessageListDefinition) SetName(v string) *StructuredMessageListDefinition { - s.Name = &v - return s -} - -// A set of key/value pairs that are used to manage the resource. -type Tag struct { - _ struct{} `type:"structure"` - - // The tag's key. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The tag's value. - // - // Value is a required field - Value *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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true"` - - // The new or modified tags for the resource. - // - // Tags is a required field - Tags []*Tag `type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request couldn't be completed due to throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The quota identifier of the applied throttling rules for this request. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The number of seconds to wait before retrying the command. - RetryAfterSeconds *int64 `locationName:"retryAfterSeconds" type:"integer"` - - // The code for the service that couldn't be completed due to throttling. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about a collection scheme that uses a time period to decide how -// often to collect data. -type TimeBasedCollectionScheme struct { - _ struct{} `type:"structure"` - - // The time period (in milliseconds) to decide how often to collect data. For - // example, if the time period is 60000, the Edge Agent software collects data - // once every minute. - // - // PeriodMs is a required field - PeriodMs *int64 `locationName:"periodMs" min:"10000" type:"long" 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 TimeBasedCollectionScheme) 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 TimeBasedCollectionScheme) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TimeBasedCollectionScheme) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TimeBasedCollectionScheme"} - if s.PeriodMs == nil { - invalidParams.Add(request.NewErrParamRequired("PeriodMs")) - } - if s.PeriodMs != nil && *s.PeriodMs < 10000 { - invalidParams.Add(request.NewErrParamMinValue("PeriodMs", 10000)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPeriodMs sets the PeriodMs field's value. -func (s *TimeBasedCollectionScheme) SetPeriodMs(v int64) *TimeBasedCollectionScheme { - s.PeriodMs = &v - return s -} - -// The Amazon Timestream table where the Amazon Web Services IoT FleetWise campaign -// sends data. Timestream stores and organizes data to optimize query processing -// time and to reduce storage costs. For more information, see Data modeling -// (https://docs.aws.amazon.com/timestream/latest/developerguide/data-modeling.html) -// in the Amazon Timestream Developer Guide. -type TimestreamConfig struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the task execution role that grants Amazon - // Web Services IoT FleetWise permission to deliver data to the Amazon Timestream - // table. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `locationName:"executionRoleArn" min:"20" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Amazon Timestream table. - // - // TimestreamTableArn is a required field - TimestreamTableArn *string `locationName:"timestreamTableArn" min:"20" 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 TimestreamConfig) 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 TimestreamConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TimestreamConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TimestreamConfig"} - if s.ExecutionRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn")) - } - if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 20)) - } - if s.TimestreamTableArn == nil { - invalidParams.Add(request.NewErrParamRequired("TimestreamTableArn")) - } - if s.TimestreamTableArn != nil && len(*s.TimestreamTableArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("TimestreamTableArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *TimestreamConfig) SetExecutionRoleArn(v string) *TimestreamConfig { - s.ExecutionRoleArn = &v - return s -} - -// SetTimestreamTableArn sets the TimestreamTableArn field's value. -func (s *TimestreamConfig) SetTimestreamTableArn(v string) *TimestreamConfig { - s.TimestreamTableArn = &v - return s -} - -// Information about the registered Amazon Timestream resources or errors, if -// any. -type TimestreamRegistrationResponse struct { - _ struct{} `type:"structure"` - - // A message associated with a registration error. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // The status of registering your Amazon Timestream resources. The status can - // be one of REGISTRATION_SUCCESS, REGISTRATION_PENDING, REGISTRATION_FAILURE. - // - // RegistrationStatus is a required field - RegistrationStatus *string `locationName:"registrationStatus" type:"string" required:"true" enum:"RegistrationStatus"` - - // The Amazon Resource Name (ARN) of the Timestream database. - TimestreamDatabaseArn *string `locationName:"timestreamDatabaseArn" type:"string"` - - // The name of the Timestream database. - // - // TimestreamDatabaseName is a required field - TimestreamDatabaseName *string `locationName:"timestreamDatabaseName" min:"3" type:"string" required:"true"` - - // The ARN of the Timestream database table. - TimestreamTableArn *string `locationName:"timestreamTableArn" type:"string"` - - // The name of the Timestream database table. - // - // TimestreamTableName is a required field - TimestreamTableName *string `locationName:"timestreamTableName" min:"3" 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 TimestreamRegistrationResponse) 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 TimestreamRegistrationResponse) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *TimestreamRegistrationResponse) SetErrorMessage(v string) *TimestreamRegistrationResponse { - s.ErrorMessage = &v - return s -} - -// SetRegistrationStatus sets the RegistrationStatus field's value. -func (s *TimestreamRegistrationResponse) SetRegistrationStatus(v string) *TimestreamRegistrationResponse { - s.RegistrationStatus = &v - return s -} - -// SetTimestreamDatabaseArn sets the TimestreamDatabaseArn field's value. -func (s *TimestreamRegistrationResponse) SetTimestreamDatabaseArn(v string) *TimestreamRegistrationResponse { - s.TimestreamDatabaseArn = &v - return s -} - -// SetTimestreamDatabaseName sets the TimestreamDatabaseName field's value. -func (s *TimestreamRegistrationResponse) SetTimestreamDatabaseName(v string) *TimestreamRegistrationResponse { - s.TimestreamDatabaseName = &v - return s -} - -// SetTimestreamTableArn sets the TimestreamTableArn field's value. -func (s *TimestreamRegistrationResponse) SetTimestreamTableArn(v string) *TimestreamRegistrationResponse { - s.TimestreamTableArn = &v - return s -} - -// SetTimestreamTableName sets the TimestreamTableName field's value. -func (s *TimestreamRegistrationResponse) SetTimestreamTableName(v string) *TimestreamRegistrationResponse { - s.TimestreamTableName = &v - return s -} - -// The registered Amazon Timestream resources that Amazon Web Services IoT FleetWise -// edge agent software can transfer your vehicle data to. -type TimestreamResources struct { - _ struct{} `type:"structure"` - - // The name of the registered Amazon Timestream database. - // - // TimestreamDatabaseName is a required field - TimestreamDatabaseName *string `locationName:"timestreamDatabaseName" min:"3" type:"string" required:"true"` - - // The name of the registered Amazon Timestream database table. - // - // TimestreamTableName is a required field - TimestreamTableName *string `locationName:"timestreamTableName" min:"3" 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 TimestreamResources) 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 TimestreamResources) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TimestreamResources) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TimestreamResources"} - if s.TimestreamDatabaseName == nil { - invalidParams.Add(request.NewErrParamRequired("TimestreamDatabaseName")) - } - if s.TimestreamDatabaseName != nil && len(*s.TimestreamDatabaseName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TimestreamDatabaseName", 3)) - } - if s.TimestreamTableName == nil { - invalidParams.Add(request.NewErrParamRequired("TimestreamTableName")) - } - if s.TimestreamTableName != nil && len(*s.TimestreamTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TimestreamTableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTimestreamDatabaseName sets the TimestreamDatabaseName field's value. -func (s *TimestreamResources) SetTimestreamDatabaseName(v string) *TimestreamResources { - s.TimestreamDatabaseName = &v - return s -} - -// SetTimestreamTableName sets the TimestreamTableName field's value. -func (s *TimestreamResources) SetTimestreamTableName(v string) *TimestreamResources { - s.TimestreamTableName = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true"` - - // A list of the keys of the tags to be removed from the resource. - // - // TagKeys is a required field - TagKeys []*string `type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *UntagResourceInput) SetResourceARN(v string) *UntagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateCampaignInput struct { - _ struct{} `type:"structure"` - - // Specifies how to update a campaign. The action can be one of the following: - // - // * APPROVE - To approve delivering a data collection scheme to vehicles. - // - // * SUSPEND - To suspend collecting signal data. The campaign is deleted - // from vehicles and all vehicles in the suspended campaign will stop sending - // data. - // - // * RESUME - To reactivate the SUSPEND campaign. The campaign is redeployed - // to all vehicles and the vehicles will resume sending data. - // - // * UPDATE - To update a campaign. - // - // Action is a required field - Action *string `locationName:"action" type:"string" required:"true" enum:"UpdateCampaignAction"` - - // A list of vehicle attributes to associate with a signal. - // - // Default: An empty array - DataExtraDimensions []*string `locationName:"dataExtraDimensions" type:"list"` - - // The description of the campaign. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the campaign to update. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 UpdateCampaignInput) 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 UpdateCampaignInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCampaignInput"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *UpdateCampaignInput) SetAction(v string) *UpdateCampaignInput { - s.Action = &v - return s -} - -// SetDataExtraDimensions sets the DataExtraDimensions field's value. -func (s *UpdateCampaignInput) SetDataExtraDimensions(v []*string) *UpdateCampaignInput { - s.DataExtraDimensions = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateCampaignInput) SetDescription(v string) *UpdateCampaignInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCampaignInput) SetName(v string) *UpdateCampaignInput { - s.Name = &v - return s -} - -type UpdateCampaignOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the campaign. - Arn *string `locationName:"arn" type:"string"` - - // The name of the updated campaign. - Name *string `locationName:"name" min:"1" type:"string"` - - // The state of a campaign. The status can be one of: - // - // * CREATING - Amazon Web Services IoT FleetWise is processing your request - // to create the campaign. - // - // * WAITING_FOR_APPROVAL - After a campaign is created, it enters the WAITING_FOR_APPROVAL - // state. To allow Amazon Web Services IoT FleetWise to deploy the campaign - // to the target vehicle or fleet, use the API operation to approve the campaign. - // - // * RUNNING - The campaign is active. - // - // * SUSPENDED - The campaign is suspended. To resume the campaign, use the - // API operation. - Status *string `locationName:"status" type:"string" enum:"CampaignStatus"` -} - -// 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 UpdateCampaignOutput) 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 UpdateCampaignOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateCampaignOutput) SetArn(v string) *UpdateCampaignOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCampaignOutput) SetName(v string) *UpdateCampaignOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateCampaignOutput) SetStatus(v string) *UpdateCampaignOutput { - s.Status = &v - return s -} - -type UpdateDecoderManifestInput struct { - _ struct{} `type:"structure"` - - // A brief description of the decoder manifest to update. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the decoder manifest to update. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of information about the network interfaces to add to the decoder - // manifest. - NetworkInterfacesToAdd []*NetworkInterface `locationName:"networkInterfacesToAdd" min:"1" type:"list"` - - // A list of network interfaces to remove from the decoder manifest. - NetworkInterfacesToRemove []*string `locationName:"networkInterfacesToRemove" min:"1" type:"list"` - - // A list of information about the network interfaces to update in the decoder - // manifest. - NetworkInterfacesToUpdate []*NetworkInterface `locationName:"networkInterfacesToUpdate" min:"1" type:"list"` - - // A list of information about decoding additional signals to add to the decoder - // manifest. - SignalDecodersToAdd []*SignalDecoder `locationName:"signalDecodersToAdd" min:"1" type:"list"` - - // A list of signal decoders to remove from the decoder manifest. - SignalDecodersToRemove []*string `locationName:"signalDecodersToRemove" min:"1" type:"list"` - - // A list of updated information about decoding signals to update in the decoder - // manifest. - SignalDecodersToUpdate []*SignalDecoder `locationName:"signalDecodersToUpdate" min:"1" type:"list"` - - // The state of the decoder manifest. If the status is ACTIVE, the decoder manifest - // can't be edited. If the status is DRAFT, you can edit the decoder manifest. - Status *string `locationName:"status" type:"string" enum:"ManifestStatus"` -} - -// 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 UpdateDecoderManifestInput) 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 UpdateDecoderManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDecoderManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDecoderManifestInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NetworkInterfacesToAdd != nil && len(s.NetworkInterfacesToAdd) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkInterfacesToAdd", 1)) - } - if s.NetworkInterfacesToRemove != nil && len(s.NetworkInterfacesToRemove) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkInterfacesToRemove", 1)) - } - if s.NetworkInterfacesToUpdate != nil && len(s.NetworkInterfacesToUpdate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkInterfacesToUpdate", 1)) - } - if s.SignalDecodersToAdd != nil && len(s.SignalDecodersToAdd) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SignalDecodersToAdd", 1)) - } - if s.SignalDecodersToRemove != nil && len(s.SignalDecodersToRemove) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SignalDecodersToRemove", 1)) - } - if s.SignalDecodersToUpdate != nil && len(s.SignalDecodersToUpdate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SignalDecodersToUpdate", 1)) - } - if s.NetworkInterfacesToAdd != nil { - for i, v := range s.NetworkInterfacesToAdd { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfacesToAdd", i), err.(request.ErrInvalidParams)) - } - } - } - if s.NetworkInterfacesToUpdate != nil { - for i, v := range s.NetworkInterfacesToUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NetworkInterfacesToUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SignalDecodersToAdd != nil { - for i, v := range s.SignalDecodersToAdd { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SignalDecodersToAdd", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SignalDecodersToUpdate != nil { - for i, v := range s.SignalDecodersToUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SignalDecodersToUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateDecoderManifestInput) SetDescription(v string) *UpdateDecoderManifestInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDecoderManifestInput) SetName(v string) *UpdateDecoderManifestInput { - s.Name = &v - return s -} - -// SetNetworkInterfacesToAdd sets the NetworkInterfacesToAdd field's value. -func (s *UpdateDecoderManifestInput) SetNetworkInterfacesToAdd(v []*NetworkInterface) *UpdateDecoderManifestInput { - s.NetworkInterfacesToAdd = v - return s -} - -// SetNetworkInterfacesToRemove sets the NetworkInterfacesToRemove field's value. -func (s *UpdateDecoderManifestInput) SetNetworkInterfacesToRemove(v []*string) *UpdateDecoderManifestInput { - s.NetworkInterfacesToRemove = v - return s -} - -// SetNetworkInterfacesToUpdate sets the NetworkInterfacesToUpdate field's value. -func (s *UpdateDecoderManifestInput) SetNetworkInterfacesToUpdate(v []*NetworkInterface) *UpdateDecoderManifestInput { - s.NetworkInterfacesToUpdate = v - return s -} - -// SetSignalDecodersToAdd sets the SignalDecodersToAdd field's value. -func (s *UpdateDecoderManifestInput) SetSignalDecodersToAdd(v []*SignalDecoder) *UpdateDecoderManifestInput { - s.SignalDecodersToAdd = v - return s -} - -// SetSignalDecodersToRemove sets the SignalDecodersToRemove field's value. -func (s *UpdateDecoderManifestInput) SetSignalDecodersToRemove(v []*string) *UpdateDecoderManifestInput { - s.SignalDecodersToRemove = v - return s -} - -// SetSignalDecodersToUpdate sets the SignalDecodersToUpdate field's value. -func (s *UpdateDecoderManifestInput) SetSignalDecodersToUpdate(v []*SignalDecoder) *UpdateDecoderManifestInput { - s.SignalDecodersToUpdate = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateDecoderManifestInput) SetStatus(v string) *UpdateDecoderManifestInput { - s.Status = &v - return s -} - -type UpdateDecoderManifestOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the updated decoder manifest. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the updated decoder manifest. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 UpdateDecoderManifestOutput) 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 UpdateDecoderManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateDecoderManifestOutput) SetArn(v string) *UpdateDecoderManifestOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDecoderManifestOutput) SetName(v string) *UpdateDecoderManifestOutput { - s.Name = &v - return s -} - -type UpdateFleetInput struct { - _ struct{} `type:"structure"` - - // An updated description of the fleet. - Description *string `locationName:"description" min:"1" type:"string"` - - // The ID of the fleet to update. - // - // FleetId is a required field - FleetId *string `locationName:"fleetId" min:"1" 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 UpdateFleetInput) 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 UpdateFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateFleetInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.FleetId != nil && len(*s.FleetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FleetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateFleetInput) SetDescription(v string) *UpdateFleetInput { - s.Description = &v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *UpdateFleetInput) SetFleetId(v string) *UpdateFleetInput { - s.FleetId = &v - return s -} - -type UpdateFleetOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the updated fleet. - Arn *string `locationName:"arn" type:"string"` - - // The ID of the updated fleet. - Id *string `locationName:"id" min:"1" 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 UpdateFleetOutput) 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 UpdateFleetOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateFleetOutput) SetArn(v string) *UpdateFleetOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateFleetOutput) SetId(v string) *UpdateFleetOutput { - s.Id = &v - return s -} - -type UpdateModelManifestInput struct { - _ struct{} `type:"structure"` - - // A brief description of the vehicle model. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the vehicle model to update. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of fullyQualifiedName of nodes, which are a general abstraction of - // signals, to add to the vehicle model. - NodesToAdd []*string `locationName:"nodesToAdd" min:"1" type:"list"` - - // A list of fullyQualifiedName of nodes, which are a general abstraction of - // signals, to remove from the vehicle model. - NodesToRemove []*string `locationName:"nodesToRemove" min:"1" type:"list"` - - // The state of the vehicle model. If the status is ACTIVE, the vehicle model - // can't be edited. If the status is DRAFT, you can edit the vehicle model. - Status *string `locationName:"status" type:"string" enum:"ManifestStatus"` -} - -// 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 UpdateModelManifestInput) 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 UpdateModelManifestInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateModelManifestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateModelManifestInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NodesToAdd != nil && len(s.NodesToAdd) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NodesToAdd", 1)) - } - if s.NodesToRemove != nil && len(s.NodesToRemove) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NodesToRemove", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateModelManifestInput) SetDescription(v string) *UpdateModelManifestInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateModelManifestInput) SetName(v string) *UpdateModelManifestInput { - s.Name = &v - return s -} - -// SetNodesToAdd sets the NodesToAdd field's value. -func (s *UpdateModelManifestInput) SetNodesToAdd(v []*string) *UpdateModelManifestInput { - s.NodesToAdd = v - return s -} - -// SetNodesToRemove sets the NodesToRemove field's value. -func (s *UpdateModelManifestInput) SetNodesToRemove(v []*string) *UpdateModelManifestInput { - s.NodesToRemove = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateModelManifestInput) SetStatus(v string) *UpdateModelManifestInput { - s.Status = &v - return s -} - -type UpdateModelManifestOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the updated vehicle model. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the updated vehicle model. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 UpdateModelManifestOutput) 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 UpdateModelManifestOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateModelManifestOutput) SetArn(v string) *UpdateModelManifestOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateModelManifestOutput) SetName(v string) *UpdateModelManifestOutput { - s.Name = &v - return s -} - -type UpdateSignalCatalogInput struct { - _ struct{} `type:"structure"` - - // A brief description of the signal catalog to update. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the signal catalog to update. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of information about nodes to add to the signal catalog. - NodesToAdd []*Node `locationName:"nodesToAdd" type:"list"` - - // A list of fullyQualifiedName of nodes to remove from the signal catalog. - NodesToRemove []*string `locationName:"nodesToRemove" min:"1" type:"list"` - - // A list of information about nodes to update in the signal catalog. - NodesToUpdate []*Node `locationName:"nodesToUpdate" type:"list"` -} - -// 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 UpdateSignalCatalogInput) 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 UpdateSignalCatalogInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSignalCatalogInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSignalCatalogInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NodesToRemove != nil && len(s.NodesToRemove) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NodesToRemove", 1)) - } - if s.NodesToAdd != nil { - for i, v := range s.NodesToAdd { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NodesToAdd", i), err.(request.ErrInvalidParams)) - } - } - } - if s.NodesToUpdate != nil { - for i, v := range s.NodesToUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NodesToUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateSignalCatalogInput) SetDescription(v string) *UpdateSignalCatalogInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSignalCatalogInput) SetName(v string) *UpdateSignalCatalogInput { - s.Name = &v - return s -} - -// SetNodesToAdd sets the NodesToAdd field's value. -func (s *UpdateSignalCatalogInput) SetNodesToAdd(v []*Node) *UpdateSignalCatalogInput { - s.NodesToAdd = v - return s -} - -// SetNodesToRemove sets the NodesToRemove field's value. -func (s *UpdateSignalCatalogInput) SetNodesToRemove(v []*string) *UpdateSignalCatalogInput { - s.NodesToRemove = v - return s -} - -// SetNodesToUpdate sets the NodesToUpdate field's value. -func (s *UpdateSignalCatalogInput) SetNodesToUpdate(v []*Node) *UpdateSignalCatalogInput { - s.NodesToUpdate = v - return s -} - -type UpdateSignalCatalogOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the updated signal catalog. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The name of the updated signal catalog. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 UpdateSignalCatalogOutput) 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 UpdateSignalCatalogOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateSignalCatalogOutput) SetArn(v string) *UpdateSignalCatalogOutput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSignalCatalogOutput) SetName(v string) *UpdateSignalCatalogOutput { - s.Name = &v - return s -} - -// An HTTP error resulting from updating the description for a vehicle. -type UpdateVehicleError struct { - _ struct{} `type:"structure"` - - // The relevant HTTP error code (400+). - Code *int64 `locationName:"code" type:"integer"` - - // A message associated with the error. - Message *string `locationName:"message" type:"string"` - - // The ID of the vehicle with the error. - VehicleName *string `locationName:"vehicleName" min:"1" 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 UpdateVehicleError) 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 UpdateVehicleError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *UpdateVehicleError) SetCode(v int64) *UpdateVehicleError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *UpdateVehicleError) SetMessage(v string) *UpdateVehicleError { - s.Message = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *UpdateVehicleError) SetVehicleName(v string) *UpdateVehicleError { - s.VehicleName = &v - return s -} - -type UpdateVehicleInput struct { - _ struct{} `type:"structure"` - - // The method the specified attributes will update the existing attributes on - // the vehicle. UseOverwite to replace the vehicle attributes with the specified - // attributes. Or use Merge to combine all attributes. - // - // This is required if attributes are present in the input. - AttributeUpdateMode *string `locationName:"attributeUpdateMode" type:"string" enum:"UpdateMode"` - - // Static information about a vehicle in a key-value pair. For example: - // - // "engineType" : "1.3 L R2" - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // The ARN of the decoder manifest associated with this vehicle. - DecoderManifestArn *string `locationName:"decoderManifestArn" type:"string"` - - // The ARN of a vehicle model (model manifest) associated with the vehicle. - ModelManifestArn *string `locationName:"modelManifestArn" type:"string"` - - // The unique ID of the vehicle to update. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 UpdateVehicleInput) 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 UpdateVehicleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVehicleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVehicleInput"} - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeUpdateMode sets the AttributeUpdateMode field's value. -func (s *UpdateVehicleInput) SetAttributeUpdateMode(v string) *UpdateVehicleInput { - s.AttributeUpdateMode = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *UpdateVehicleInput) SetAttributes(v map[string]*string) *UpdateVehicleInput { - s.Attributes = v - return s -} - -// SetDecoderManifestArn sets the DecoderManifestArn field's value. -func (s *UpdateVehicleInput) SetDecoderManifestArn(v string) *UpdateVehicleInput { - s.DecoderManifestArn = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *UpdateVehicleInput) SetModelManifestArn(v string) *UpdateVehicleInput { - s.ModelManifestArn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *UpdateVehicleInput) SetVehicleName(v string) *UpdateVehicleInput { - s.VehicleName = &v - return s -} - -type UpdateVehicleOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the updated vehicle. - Arn *string `locationName:"arn" type:"string"` - - // The ID of the updated vehicle. - VehicleName *string `locationName:"vehicleName" min:"1" 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 UpdateVehicleOutput) 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 UpdateVehicleOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateVehicleOutput) SetArn(v string) *UpdateVehicleOutput { - s.Arn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *UpdateVehicleOutput) SetVehicleName(v string) *UpdateVehicleOutput { - s.VehicleName = &v - return s -} - -// Information about the vehicle to update. -type UpdateVehicleRequestItem struct { - _ struct{} `type:"structure"` - - // The method the specified attributes will update the existing attributes on - // the vehicle. UseOverwite to replace the vehicle attributes with the specified - // attributes. Or use Merge to combine all attributes. - // - // This is required if attributes are present in the input. - AttributeUpdateMode *string `locationName:"attributeUpdateMode" type:"string" enum:"UpdateMode"` - - // Static information about a vehicle in a key-value pair. For example: - // - // "engineType" : "1.3 L R2" - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // The ARN of the signal decoder manifest associated with the vehicle to update. - DecoderManifestArn *string `locationName:"decoderManifestArn" type:"string"` - - // The ARN of the vehicle model (model manifest) associated with the vehicle - // to update. - ModelManifestArn *string `locationName:"modelManifestArn" type:"string"` - - // The unique ID of the vehicle to update. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 UpdateVehicleRequestItem) 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 UpdateVehicleRequestItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVehicleRequestItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVehicleRequestItem"} - if s.VehicleName == nil { - invalidParams.Add(request.NewErrParamRequired("VehicleName")) - } - if s.VehicleName != nil && len(*s.VehicleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VehicleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeUpdateMode sets the AttributeUpdateMode field's value. -func (s *UpdateVehicleRequestItem) SetAttributeUpdateMode(v string) *UpdateVehicleRequestItem { - s.AttributeUpdateMode = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *UpdateVehicleRequestItem) SetAttributes(v map[string]*string) *UpdateVehicleRequestItem { - s.Attributes = v - return s -} - -// SetDecoderManifestArn sets the DecoderManifestArn field's value. -func (s *UpdateVehicleRequestItem) SetDecoderManifestArn(v string) *UpdateVehicleRequestItem { - s.DecoderManifestArn = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *UpdateVehicleRequestItem) SetModelManifestArn(v string) *UpdateVehicleRequestItem { - s.ModelManifestArn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *UpdateVehicleRequestItem) SetVehicleName(v string) *UpdateVehicleRequestItem { - s.VehicleName = &v - return s -} - -// Information about the updated vehicle. -type UpdateVehicleResponseItem struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the updated vehicle. - Arn *string `locationName:"arn" type:"string"` - - // The unique ID of the updated vehicle. - VehicleName *string `locationName:"vehicleName" min:"1" 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 UpdateVehicleResponseItem) 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 UpdateVehicleResponseItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateVehicleResponseItem) SetArn(v string) *UpdateVehicleResponseItem { - s.Arn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *UpdateVehicleResponseItem) SetVehicleName(v string) *UpdateVehicleResponseItem { - s.VehicleName = &v - return s -} - -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The list of fields that fail to satisfy the constraints specified by an Amazon - // Web Services service. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason the input failed to satisfy the constraints specified by an Amazon - // Web Services service. - Reason *string `locationName:"reason" type:"string" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A validation error due to mismatch between the expected data type, length, -// or pattern of the parameter and the input. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // A message about the validation error. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the parameter field with the validation error. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -// The vehicle middleware defined as a type of network interface. Examples of -// vehicle middleware include ROS2 and SOME/IP. -type VehicleMiddleware struct { - _ struct{} `type:"structure"` - - // The name of the vehicle middleware. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The protocol name of the vehicle middleware. - // - // ProtocolName is a required field - ProtocolName *string `locationName:"protocolName" type:"string" required:"true" enum:"VehicleMiddlewareProtocol"` -} - -// 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 VehicleMiddleware) 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 VehicleMiddleware) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VehicleMiddleware) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VehicleMiddleware"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ProtocolName == nil { - invalidParams.Add(request.NewErrParamRequired("ProtocolName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *VehicleMiddleware) SetName(v string) *VehicleMiddleware { - s.Name = &v - return s -} - -// SetProtocolName sets the ProtocolName field's value. -func (s *VehicleMiddleware) SetProtocolName(v string) *VehicleMiddleware { - s.ProtocolName = &v - return s -} - -// Information about the state of a vehicle and how it relates to the status -// of a campaign. -type VehicleStatus struct { - _ struct{} `type:"structure"` - - // The name of a campaign. - CampaignName *string `locationName:"campaignName" type:"string"` - - // The state of a vehicle, which can be one of the following: - // - // * CREATED - Amazon Web Services IoT FleetWise sucessfully created the - // vehicle. - // - // * READY - The vehicle is ready to receive a campaign deployment. - // - // * HEALTHY - A campaign deployment was delivered to the vehicle. - // - // * SUSPENDED - A campaign associated with the vehicle was suspended and - // data collection was paused. - // - // * DELETING - Amazon Web Services IoT FleetWise is removing a campaign - // from the vehicle. - Status *string `locationName:"status" type:"string" enum:"VehicleState"` - - // The unique ID of the vehicle. - VehicleName *string `locationName:"vehicleName" min:"1" 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 VehicleStatus) 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 VehicleStatus) GoString() string { - return s.String() -} - -// SetCampaignName sets the CampaignName field's value. -func (s *VehicleStatus) SetCampaignName(v string) *VehicleStatus { - s.CampaignName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VehicleStatus) SetStatus(v string) *VehicleStatus { - s.Status = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *VehicleStatus) SetVehicleName(v string) *VehicleStatus { - s.VehicleName = &v - return s -} - -// Information about a vehicle. -// -// To return this information about vehicles in your account, you can use the -// API operation. -type VehicleSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the vehicle. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // The time the vehicle was created in seconds since epoch (January 1, 1970 - // at midnight UTC time). - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The ARN of a decoder manifest associated with the vehicle. - // - // DecoderManifestArn is a required field - DecoderManifestArn *string `locationName:"decoderManifestArn" type:"string" required:"true"` - - // The time the vehicle was last updated in seconds since epoch (January 1, - // 1970 at midnight UTC time). - // - // LastModificationTime is a required field - LastModificationTime *time.Time `locationName:"lastModificationTime" type:"timestamp" required:"true"` - - // The ARN of a vehicle model (model manifest) associated with the vehicle. - // - // ModelManifestArn is a required field - ModelManifestArn *string `locationName:"modelManifestArn" type:"string" required:"true"` - - // The unique ID of the vehicle. - // - // VehicleName is a required field - VehicleName *string `locationName:"vehicleName" min:"1" 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 VehicleSummary) 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 VehicleSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *VehicleSummary) SetArn(v string) *VehicleSummary { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *VehicleSummary) SetCreationTime(v time.Time) *VehicleSummary { - s.CreationTime = &v - return s -} - -// SetDecoderManifestArn sets the DecoderManifestArn field's value. -func (s *VehicleSummary) SetDecoderManifestArn(v string) *VehicleSummary { - s.DecoderManifestArn = &v - return s -} - -// SetLastModificationTime sets the LastModificationTime field's value. -func (s *VehicleSummary) SetLastModificationTime(v time.Time) *VehicleSummary { - s.LastModificationTime = &v - return s -} - -// SetModelManifestArn sets the ModelManifestArn field's value. -func (s *VehicleSummary) SetModelManifestArn(v string) *VehicleSummary { - s.ModelManifestArn = &v - return s -} - -// SetVehicleName sets the VehicleName field's value. -func (s *VehicleSummary) SetVehicleName(v string) *VehicleSummary { - s.VehicleName = &v - return s -} - -const ( - // CampaignStatusCreating is a CampaignStatus enum value - CampaignStatusCreating = "CREATING" - - // CampaignStatusWaitingForApproval is a CampaignStatus enum value - CampaignStatusWaitingForApproval = "WAITING_FOR_APPROVAL" - - // CampaignStatusRunning is a CampaignStatus enum value - CampaignStatusRunning = "RUNNING" - - // CampaignStatusSuspended is a CampaignStatus enum value - CampaignStatusSuspended = "SUSPENDED" -) - -// CampaignStatus_Values returns all elements of the CampaignStatus enum -func CampaignStatus_Values() []string { - return []string{ - CampaignStatusCreating, - CampaignStatusWaitingForApproval, - CampaignStatusRunning, - CampaignStatusSuspended, - } -} - -const ( - // CompressionOff is a Compression enum value - CompressionOff = "OFF" - - // CompressionSnappy is a Compression enum value - CompressionSnappy = "SNAPPY" -) - -// Compression_Values returns all elements of the Compression enum -func Compression_Values() []string { - return []string{ - CompressionOff, - CompressionSnappy, - } -} - -const ( - // DataFormatJson is a DataFormat enum value - DataFormatJson = "JSON" - - // DataFormatParquet is a DataFormat enum value - DataFormatParquet = "PARQUET" -) - -// DataFormat_Values returns all elements of the DataFormat enum -func DataFormat_Values() []string { - return []string{ - DataFormatJson, - DataFormatParquet, - } -} - -const ( - // DiagnosticsModeOff is a DiagnosticsMode enum value - DiagnosticsModeOff = "OFF" - - // DiagnosticsModeSendActiveDtcs is a DiagnosticsMode enum value - DiagnosticsModeSendActiveDtcs = "SEND_ACTIVE_DTCS" -) - -// DiagnosticsMode_Values returns all elements of the DiagnosticsMode enum -func DiagnosticsMode_Values() []string { - return []string{ - DiagnosticsModeOff, - DiagnosticsModeSendActiveDtcs, - } -} - -const ( - // EncryptionStatusPending is a EncryptionStatus enum value - EncryptionStatusPending = "PENDING" - - // EncryptionStatusSuccess is a EncryptionStatus enum value - EncryptionStatusSuccess = "SUCCESS" - - // EncryptionStatusFailure is a EncryptionStatus enum value - EncryptionStatusFailure = "FAILURE" -) - -// EncryptionStatus_Values returns all elements of the EncryptionStatus enum -func EncryptionStatus_Values() []string { - return []string{ - EncryptionStatusPending, - EncryptionStatusSuccess, - EncryptionStatusFailure, - } -} - -const ( - // EncryptionTypeKmsBasedEncryption is a EncryptionType enum value - EncryptionTypeKmsBasedEncryption = "KMS_BASED_ENCRYPTION" - - // EncryptionTypeFleetwiseDefaultEncryption is a EncryptionType enum value - EncryptionTypeFleetwiseDefaultEncryption = "FLEETWISE_DEFAULT_ENCRYPTION" -) - -// EncryptionType_Values returns all elements of the EncryptionType enum -func EncryptionType_Values() []string { - return []string{ - EncryptionTypeKmsBasedEncryption, - EncryptionTypeFleetwiseDefaultEncryption, - } -} - -const ( - // LogTypeOff is a LogType enum value - LogTypeOff = "OFF" - - // LogTypeError is a LogType enum value - LogTypeError = "ERROR" -) - -// LogType_Values returns all elements of the LogType enum -func LogType_Values() []string { - return []string{ - LogTypeOff, - LogTypeError, - } -} - -const ( - // ManifestStatusActive is a ManifestStatus enum value - ManifestStatusActive = "ACTIVE" - - // ManifestStatusDraft is a ManifestStatus enum value - ManifestStatusDraft = "DRAFT" - - // ManifestStatusInvalid is a ManifestStatus enum value - ManifestStatusInvalid = "INVALID" - - // ManifestStatusValidating is a ManifestStatus enum value - ManifestStatusValidating = "VALIDATING" -) - -// ManifestStatus_Values returns all elements of the ManifestStatus enum -func ManifestStatus_Values() []string { - return []string{ - ManifestStatusActive, - ManifestStatusDraft, - ManifestStatusInvalid, - ManifestStatusValidating, - } -} - -const ( - // NetworkInterfaceFailureReasonDuplicateNetworkInterface is a NetworkInterfaceFailureReason enum value - NetworkInterfaceFailureReasonDuplicateNetworkInterface = "DUPLICATE_NETWORK_INTERFACE" - - // NetworkInterfaceFailureReasonConflictingNetworkInterface is a NetworkInterfaceFailureReason enum value - NetworkInterfaceFailureReasonConflictingNetworkInterface = "CONFLICTING_NETWORK_INTERFACE" - - // NetworkInterfaceFailureReasonNetworkInterfaceToAddAlreadyExists is a NetworkInterfaceFailureReason enum value - NetworkInterfaceFailureReasonNetworkInterfaceToAddAlreadyExists = "NETWORK_INTERFACE_TO_ADD_ALREADY_EXISTS" - - // NetworkInterfaceFailureReasonCanNetworkInterfaceInfoIsNull is a NetworkInterfaceFailureReason enum value - NetworkInterfaceFailureReasonCanNetworkInterfaceInfoIsNull = "CAN_NETWORK_INTERFACE_INFO_IS_NULL" - - // NetworkInterfaceFailureReasonObdNetworkInterfaceInfoIsNull is a NetworkInterfaceFailureReason enum value - NetworkInterfaceFailureReasonObdNetworkInterfaceInfoIsNull = "OBD_NETWORK_INTERFACE_INFO_IS_NULL" - - // NetworkInterfaceFailureReasonNetworkInterfaceToRemoveAssociatedWithSignals is a NetworkInterfaceFailureReason enum value - NetworkInterfaceFailureReasonNetworkInterfaceToRemoveAssociatedWithSignals = "NETWORK_INTERFACE_TO_REMOVE_ASSOCIATED_WITH_SIGNALS" - - // NetworkInterfaceFailureReasonVehicleMiddlewareNetworkInterfaceInfoIsNull is a NetworkInterfaceFailureReason enum value - NetworkInterfaceFailureReasonVehicleMiddlewareNetworkInterfaceInfoIsNull = "VEHICLE_MIDDLEWARE_NETWORK_INTERFACE_INFO_IS_NULL" - - // NetworkInterfaceFailureReasonCustomerDecodedSignalNetworkInterfaceInfoIsNull is a NetworkInterfaceFailureReason enum value - NetworkInterfaceFailureReasonCustomerDecodedSignalNetworkInterfaceInfoIsNull = "CUSTOMER_DECODED_SIGNAL_NETWORK_INTERFACE_INFO_IS_NULL" -) - -// NetworkInterfaceFailureReason_Values returns all elements of the NetworkInterfaceFailureReason enum -func NetworkInterfaceFailureReason_Values() []string { - return []string{ - NetworkInterfaceFailureReasonDuplicateNetworkInterface, - NetworkInterfaceFailureReasonConflictingNetworkInterface, - NetworkInterfaceFailureReasonNetworkInterfaceToAddAlreadyExists, - NetworkInterfaceFailureReasonCanNetworkInterfaceInfoIsNull, - NetworkInterfaceFailureReasonObdNetworkInterfaceInfoIsNull, - NetworkInterfaceFailureReasonNetworkInterfaceToRemoveAssociatedWithSignals, - NetworkInterfaceFailureReasonVehicleMiddlewareNetworkInterfaceInfoIsNull, - NetworkInterfaceFailureReasonCustomerDecodedSignalNetworkInterfaceInfoIsNull, - } -} - -const ( - // NetworkInterfaceTypeCanInterface is a NetworkInterfaceType enum value - NetworkInterfaceTypeCanInterface = "CAN_INTERFACE" - - // NetworkInterfaceTypeObdInterface is a NetworkInterfaceType enum value - NetworkInterfaceTypeObdInterface = "OBD_INTERFACE" - - // NetworkInterfaceTypeVehicleMiddleware is a NetworkInterfaceType enum value - NetworkInterfaceTypeVehicleMiddleware = "VEHICLE_MIDDLEWARE" - - // NetworkInterfaceTypeCustomerDecodedInterface is a NetworkInterfaceType enum value - NetworkInterfaceTypeCustomerDecodedInterface = "CUSTOMER_DECODED_INTERFACE" -) - -// NetworkInterfaceType_Values returns all elements of the NetworkInterfaceType enum -func NetworkInterfaceType_Values() []string { - return []string{ - NetworkInterfaceTypeCanInterface, - NetworkInterfaceTypeObdInterface, - NetworkInterfaceTypeVehicleMiddleware, - NetworkInterfaceTypeCustomerDecodedInterface, - } -} - -const ( - // NodeDataEncodingBinary is a NodeDataEncoding enum value - NodeDataEncodingBinary = "BINARY" - - // NodeDataEncodingTyped is a NodeDataEncoding enum value - NodeDataEncodingTyped = "TYPED" -) - -// NodeDataEncoding_Values returns all elements of the NodeDataEncoding enum -func NodeDataEncoding_Values() []string { - return []string{ - NodeDataEncodingBinary, - NodeDataEncodingTyped, - } -} - -const ( - // NodeDataTypeInt8 is a NodeDataType enum value - NodeDataTypeInt8 = "INT8" - - // NodeDataTypeUint8 is a NodeDataType enum value - NodeDataTypeUint8 = "UINT8" - - // NodeDataTypeInt16 is a NodeDataType enum value - NodeDataTypeInt16 = "INT16" - - // NodeDataTypeUint16 is a NodeDataType enum value - NodeDataTypeUint16 = "UINT16" - - // NodeDataTypeInt32 is a NodeDataType enum value - NodeDataTypeInt32 = "INT32" - - // NodeDataTypeUint32 is a NodeDataType enum value - NodeDataTypeUint32 = "UINT32" - - // NodeDataTypeInt64 is a NodeDataType enum value - NodeDataTypeInt64 = "INT64" - - // NodeDataTypeUint64 is a NodeDataType enum value - NodeDataTypeUint64 = "UINT64" - - // NodeDataTypeBoolean is a NodeDataType enum value - NodeDataTypeBoolean = "BOOLEAN" - - // NodeDataTypeFloat is a NodeDataType enum value - NodeDataTypeFloat = "FLOAT" - - // NodeDataTypeDouble is a NodeDataType enum value - NodeDataTypeDouble = "DOUBLE" - - // NodeDataTypeString is a NodeDataType enum value - NodeDataTypeString = "STRING" - - // NodeDataTypeUnixTimestamp is a NodeDataType enum value - NodeDataTypeUnixTimestamp = "UNIX_TIMESTAMP" - - // NodeDataTypeInt8Array is a NodeDataType enum value - NodeDataTypeInt8Array = "INT8_ARRAY" - - // NodeDataTypeUint8Array is a NodeDataType enum value - NodeDataTypeUint8Array = "UINT8_ARRAY" - - // NodeDataTypeInt16Array is a NodeDataType enum value - NodeDataTypeInt16Array = "INT16_ARRAY" - - // NodeDataTypeUint16Array is a NodeDataType enum value - NodeDataTypeUint16Array = "UINT16_ARRAY" - - // NodeDataTypeInt32Array is a NodeDataType enum value - NodeDataTypeInt32Array = "INT32_ARRAY" - - // NodeDataTypeUint32Array is a NodeDataType enum value - NodeDataTypeUint32Array = "UINT32_ARRAY" - - // NodeDataTypeInt64Array is a NodeDataType enum value - NodeDataTypeInt64Array = "INT64_ARRAY" - - // NodeDataTypeUint64Array is a NodeDataType enum value - NodeDataTypeUint64Array = "UINT64_ARRAY" - - // NodeDataTypeBooleanArray is a NodeDataType enum value - NodeDataTypeBooleanArray = "BOOLEAN_ARRAY" - - // NodeDataTypeFloatArray is a NodeDataType enum value - NodeDataTypeFloatArray = "FLOAT_ARRAY" - - // NodeDataTypeDoubleArray is a NodeDataType enum value - NodeDataTypeDoubleArray = "DOUBLE_ARRAY" - - // NodeDataTypeStringArray is a NodeDataType enum value - NodeDataTypeStringArray = "STRING_ARRAY" - - // NodeDataTypeUnixTimestampArray is a NodeDataType enum value - NodeDataTypeUnixTimestampArray = "UNIX_TIMESTAMP_ARRAY" - - // NodeDataTypeUnknown is a NodeDataType enum value - NodeDataTypeUnknown = "UNKNOWN" - - // NodeDataTypeStruct is a NodeDataType enum value - NodeDataTypeStruct = "STRUCT" - - // NodeDataTypeStructArray is a NodeDataType enum value - NodeDataTypeStructArray = "STRUCT_ARRAY" -) - -// NodeDataType_Values returns all elements of the NodeDataType enum -func NodeDataType_Values() []string { - return []string{ - NodeDataTypeInt8, - NodeDataTypeUint8, - NodeDataTypeInt16, - NodeDataTypeUint16, - NodeDataTypeInt32, - NodeDataTypeUint32, - NodeDataTypeInt64, - NodeDataTypeUint64, - NodeDataTypeBoolean, - NodeDataTypeFloat, - NodeDataTypeDouble, - NodeDataTypeString, - NodeDataTypeUnixTimestamp, - NodeDataTypeInt8Array, - NodeDataTypeUint8Array, - NodeDataTypeInt16Array, - NodeDataTypeUint16Array, - NodeDataTypeInt32Array, - NodeDataTypeUint32Array, - NodeDataTypeInt64Array, - NodeDataTypeUint64Array, - NodeDataTypeBooleanArray, - NodeDataTypeFloatArray, - NodeDataTypeDoubleArray, - NodeDataTypeStringArray, - NodeDataTypeUnixTimestampArray, - NodeDataTypeUnknown, - NodeDataTypeStruct, - NodeDataTypeStructArray, - } -} - -const ( - // ROS2PrimitiveTypeBool is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeBool = "BOOL" - - // ROS2PrimitiveTypeByte is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeByte = "BYTE" - - // ROS2PrimitiveTypeChar is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeChar = "CHAR" - - // ROS2PrimitiveTypeFloat32 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeFloat32 = "FLOAT32" - - // ROS2PrimitiveTypeFloat64 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeFloat64 = "FLOAT64" - - // ROS2PrimitiveTypeInt8 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeInt8 = "INT8" - - // ROS2PrimitiveTypeUint8 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeUint8 = "UINT8" - - // ROS2PrimitiveTypeInt16 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeInt16 = "INT16" - - // ROS2PrimitiveTypeUint16 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeUint16 = "UINT16" - - // ROS2PrimitiveTypeInt32 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeInt32 = "INT32" - - // ROS2PrimitiveTypeUint32 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeUint32 = "UINT32" - - // ROS2PrimitiveTypeInt64 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeInt64 = "INT64" - - // ROS2PrimitiveTypeUint64 is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeUint64 = "UINT64" - - // ROS2PrimitiveTypeString is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeString = "STRING" - - // ROS2PrimitiveTypeWstring is a ROS2PrimitiveType enum value - ROS2PrimitiveTypeWstring = "WSTRING" -) - -// ROS2PrimitiveType_Values returns all elements of the ROS2PrimitiveType enum -func ROS2PrimitiveType_Values() []string { - return []string{ - ROS2PrimitiveTypeBool, - ROS2PrimitiveTypeByte, - ROS2PrimitiveTypeChar, - ROS2PrimitiveTypeFloat32, - ROS2PrimitiveTypeFloat64, - ROS2PrimitiveTypeInt8, - ROS2PrimitiveTypeUint8, - ROS2PrimitiveTypeInt16, - ROS2PrimitiveTypeUint16, - ROS2PrimitiveTypeInt32, - ROS2PrimitiveTypeUint32, - ROS2PrimitiveTypeInt64, - ROS2PrimitiveTypeUint64, - ROS2PrimitiveTypeString, - ROS2PrimitiveTypeWstring, - } -} - -const ( - // RegistrationStatusRegistrationPending is a RegistrationStatus enum value - RegistrationStatusRegistrationPending = "REGISTRATION_PENDING" - - // RegistrationStatusRegistrationSuccess is a RegistrationStatus enum value - RegistrationStatusRegistrationSuccess = "REGISTRATION_SUCCESS" - - // RegistrationStatusRegistrationFailure is a RegistrationStatus enum value - RegistrationStatusRegistrationFailure = "REGISTRATION_FAILURE" -) - -// RegistrationStatus_Values returns all elements of the RegistrationStatus enum -func RegistrationStatus_Values() []string { - return []string{ - RegistrationStatusRegistrationPending, - RegistrationStatusRegistrationSuccess, - RegistrationStatusRegistrationFailure, - } -} - -const ( - // SignalDecoderFailureReasonDuplicateSignal is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonDuplicateSignal = "DUPLICATE_SIGNAL" - - // SignalDecoderFailureReasonConflictingSignal is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonConflictingSignal = "CONFLICTING_SIGNAL" - - // SignalDecoderFailureReasonSignalToAddAlreadyExists is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonSignalToAddAlreadyExists = "SIGNAL_TO_ADD_ALREADY_EXISTS" - - // SignalDecoderFailureReasonSignalNotAssociatedWithNetworkInterface is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonSignalNotAssociatedWithNetworkInterface = "SIGNAL_NOT_ASSOCIATED_WITH_NETWORK_INTERFACE" - - // SignalDecoderFailureReasonNetworkInterfaceTypeIncompatibleWithSignalDecoderType is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonNetworkInterfaceTypeIncompatibleWithSignalDecoderType = "NETWORK_INTERFACE_TYPE_INCOMPATIBLE_WITH_SIGNAL_DECODER_TYPE" - - // SignalDecoderFailureReasonSignalNotInModel is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonSignalNotInModel = "SIGNAL_NOT_IN_MODEL" - - // SignalDecoderFailureReasonCanSignalInfoIsNull is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonCanSignalInfoIsNull = "CAN_SIGNAL_INFO_IS_NULL" - - // SignalDecoderFailureReasonObdSignalInfoIsNull is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonObdSignalInfoIsNull = "OBD_SIGNAL_INFO_IS_NULL" - - // SignalDecoderFailureReasonNoDecoderInfoForSignalInModel is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonNoDecoderInfoForSignalInModel = "NO_DECODER_INFO_FOR_SIGNAL_IN_MODEL" - - // SignalDecoderFailureReasonMessageSignalInfoIsNull is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonMessageSignalInfoIsNull = "MESSAGE_SIGNAL_INFO_IS_NULL" - - // SignalDecoderFailureReasonSignalDecoderTypeIncompatibleWithMessageSignalType is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonSignalDecoderTypeIncompatibleWithMessageSignalType = "SIGNAL_DECODER_TYPE_INCOMPATIBLE_WITH_MESSAGE_SIGNAL_TYPE" - - // SignalDecoderFailureReasonStructSizeMismatch is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonStructSizeMismatch = "STRUCT_SIZE_MISMATCH" - - // SignalDecoderFailureReasonNoSignalInCatalogForDecoderSignal is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonNoSignalInCatalogForDecoderSignal = "NO_SIGNAL_IN_CATALOG_FOR_DECODER_SIGNAL" - - // SignalDecoderFailureReasonSignalDecoderIncompatibleWithSignalCatalog is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonSignalDecoderIncompatibleWithSignalCatalog = "SIGNAL_DECODER_INCOMPATIBLE_WITH_SIGNAL_CATALOG" - - // SignalDecoderFailureReasonEmptyMessageSignal is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonEmptyMessageSignal = "EMPTY_MESSAGE_SIGNAL" - - // SignalDecoderFailureReasonCustomerDecodedSignalInfoIsNull is a SignalDecoderFailureReason enum value - SignalDecoderFailureReasonCustomerDecodedSignalInfoIsNull = "CUSTOMER_DECODED_SIGNAL_INFO_IS_NULL" -) - -// SignalDecoderFailureReason_Values returns all elements of the SignalDecoderFailureReason enum -func SignalDecoderFailureReason_Values() []string { - return []string{ - SignalDecoderFailureReasonDuplicateSignal, - SignalDecoderFailureReasonConflictingSignal, - SignalDecoderFailureReasonSignalToAddAlreadyExists, - SignalDecoderFailureReasonSignalNotAssociatedWithNetworkInterface, - SignalDecoderFailureReasonNetworkInterfaceTypeIncompatibleWithSignalDecoderType, - SignalDecoderFailureReasonSignalNotInModel, - SignalDecoderFailureReasonCanSignalInfoIsNull, - SignalDecoderFailureReasonObdSignalInfoIsNull, - SignalDecoderFailureReasonNoDecoderInfoForSignalInModel, - SignalDecoderFailureReasonMessageSignalInfoIsNull, - SignalDecoderFailureReasonSignalDecoderTypeIncompatibleWithMessageSignalType, - SignalDecoderFailureReasonStructSizeMismatch, - SignalDecoderFailureReasonNoSignalInCatalogForDecoderSignal, - SignalDecoderFailureReasonSignalDecoderIncompatibleWithSignalCatalog, - SignalDecoderFailureReasonEmptyMessageSignal, - SignalDecoderFailureReasonCustomerDecodedSignalInfoIsNull, - } -} - -const ( - // SignalDecoderTypeCanSignal is a SignalDecoderType enum value - SignalDecoderTypeCanSignal = "CAN_SIGNAL" - - // SignalDecoderTypeObdSignal is a SignalDecoderType enum value - SignalDecoderTypeObdSignal = "OBD_SIGNAL" - - // SignalDecoderTypeMessageSignal is a SignalDecoderType enum value - SignalDecoderTypeMessageSignal = "MESSAGE_SIGNAL" - - // SignalDecoderTypeCustomerDecodedSignal is a SignalDecoderType enum value - SignalDecoderTypeCustomerDecodedSignal = "CUSTOMER_DECODED_SIGNAL" -) - -// SignalDecoderType_Values returns all elements of the SignalDecoderType enum -func SignalDecoderType_Values() []string { - return []string{ - SignalDecoderTypeCanSignal, - SignalDecoderTypeObdSignal, - SignalDecoderTypeMessageSignal, - SignalDecoderTypeCustomerDecodedSignal, - } -} - -const ( - // SpoolingModeOff is a SpoolingMode enum value - SpoolingModeOff = "OFF" - - // SpoolingModeToDisk is a SpoolingMode enum value - SpoolingModeToDisk = "TO_DISK" -) - -// SpoolingMode_Values returns all elements of the SpoolingMode enum -func SpoolingMode_Values() []string { - return []string{ - SpoolingModeOff, - SpoolingModeToDisk, - } -} - -const ( - // StorageCompressionFormatNone is a StorageCompressionFormat enum value - StorageCompressionFormatNone = "NONE" - - // StorageCompressionFormatGzip is a StorageCompressionFormat enum value - StorageCompressionFormatGzip = "GZIP" -) - -// StorageCompressionFormat_Values returns all elements of the StorageCompressionFormat enum -func StorageCompressionFormat_Values() []string { - return []string{ - StorageCompressionFormatNone, - StorageCompressionFormatGzip, - } -} - -const ( - // StructuredMessageListTypeFixedCapacity is a StructuredMessageListType enum value - StructuredMessageListTypeFixedCapacity = "FIXED_CAPACITY" - - // StructuredMessageListTypeDynamicUnboundedCapacity is a StructuredMessageListType enum value - StructuredMessageListTypeDynamicUnboundedCapacity = "DYNAMIC_UNBOUNDED_CAPACITY" - - // StructuredMessageListTypeDynamicBoundedCapacity is a StructuredMessageListType enum value - StructuredMessageListTypeDynamicBoundedCapacity = "DYNAMIC_BOUNDED_CAPACITY" -) - -// StructuredMessageListType_Values returns all elements of the StructuredMessageListType enum -func StructuredMessageListType_Values() []string { - return []string{ - StructuredMessageListTypeFixedCapacity, - StructuredMessageListTypeDynamicUnboundedCapacity, - StructuredMessageListTypeDynamicBoundedCapacity, - } -} - -const ( - // TriggerModeAlways is a TriggerMode enum value - TriggerModeAlways = "ALWAYS" - - // TriggerModeRisingEdge is a TriggerMode enum value - TriggerModeRisingEdge = "RISING_EDGE" -) - -// TriggerMode_Values returns all elements of the TriggerMode enum -func TriggerMode_Values() []string { - return []string{ - TriggerModeAlways, - TriggerModeRisingEdge, - } -} - -const ( - // UpdateCampaignActionApprove is a UpdateCampaignAction enum value - UpdateCampaignActionApprove = "APPROVE" - - // UpdateCampaignActionSuspend is a UpdateCampaignAction enum value - UpdateCampaignActionSuspend = "SUSPEND" - - // UpdateCampaignActionResume is a UpdateCampaignAction enum value - UpdateCampaignActionResume = "RESUME" - - // UpdateCampaignActionUpdate is a UpdateCampaignAction enum value - UpdateCampaignActionUpdate = "UPDATE" -) - -// UpdateCampaignAction_Values returns all elements of the UpdateCampaignAction enum -func UpdateCampaignAction_Values() []string { - return []string{ - UpdateCampaignActionApprove, - UpdateCampaignActionSuspend, - UpdateCampaignActionResume, - UpdateCampaignActionUpdate, - } -} - -const ( - // UpdateModeOverwrite is a UpdateMode enum value - UpdateModeOverwrite = "Overwrite" - - // UpdateModeMerge is a UpdateMode enum value - UpdateModeMerge = "Merge" -) - -// UpdateMode_Values returns all elements of the UpdateMode enum -func UpdateMode_Values() []string { - return []string{ - UpdateModeOverwrite, - UpdateModeMerge, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} - -const ( - // VehicleAssociationBehaviorCreateIotThing is a VehicleAssociationBehavior enum value - VehicleAssociationBehaviorCreateIotThing = "CreateIotThing" - - // VehicleAssociationBehaviorValidateIotThingExists is a VehicleAssociationBehavior enum value - VehicleAssociationBehaviorValidateIotThingExists = "ValidateIotThingExists" -) - -// VehicleAssociationBehavior_Values returns all elements of the VehicleAssociationBehavior enum -func VehicleAssociationBehavior_Values() []string { - return []string{ - VehicleAssociationBehaviorCreateIotThing, - VehicleAssociationBehaviorValidateIotThingExists, - } -} - -const ( - // VehicleMiddlewareProtocolRos2 is a VehicleMiddlewareProtocol enum value - VehicleMiddlewareProtocolRos2 = "ROS_2" -) - -// VehicleMiddlewareProtocol_Values returns all elements of the VehicleMiddlewareProtocol enum -func VehicleMiddlewareProtocol_Values() []string { - return []string{ - VehicleMiddlewareProtocolRos2, - } -} - -const ( - // VehicleStateCreated is a VehicleState enum value - VehicleStateCreated = "CREATED" - - // VehicleStateReady is a VehicleState enum value - VehicleStateReady = "READY" - - // VehicleStateHealthy is a VehicleState enum value - VehicleStateHealthy = "HEALTHY" - - // VehicleStateSuspended is a VehicleState enum value - VehicleStateSuspended = "SUSPENDED" - - // VehicleStateDeleting is a VehicleState enum value - VehicleStateDeleting = "DELETING" -) - -// VehicleState_Values returns all elements of the VehicleState enum -func VehicleState_Values() []string { - return []string{ - VehicleStateCreated, - VehicleStateReady, - VehicleStateHealthy, - VehicleStateSuspended, - VehicleStateDeleting, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/doc.go deleted file mode 100644 index 0d877961e755..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/doc.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package iotfleetwise provides the client and types for making API -// requests to AWS IoT FleetWise. -// -// Amazon Web Services IoT FleetWise is a fully managed service that you can -// use to collect, model, and transfer vehicle data to the Amazon Web Services -// cloud at scale. With Amazon Web Services IoT FleetWise, you can standardize -// all of your vehicle data models, independent of the in-vehicle communication -// architecture, and define data collection rules to transfer only high-value -// data to the cloud. -// -// For more information, see What is Amazon Web Services IoT FleetWise? (https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/) -// in the Amazon Web Services IoT FleetWise Developer Guide. -// -// See https://docs.aws.amazon.com/goto/WebAPI/iotfleetwise-2021-06-17 for more information on this service. -// -// See iotfleetwise package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/iotfleetwise/ -// -// # Using the Client -// -// To contact AWS IoT FleetWise with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS IoT FleetWise client IoTFleetWise for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/iotfleetwise/#New -package iotfleetwise diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/errors.go deleted file mode 100644 index 3f8261ed5460..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/errors.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package iotfleetwise - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have sufficient permission to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request has conflicting operations. This can occur if you're trying to - // perform more than one operation on the same resource at the same time. - ErrCodeConflictException = "ConflictException" - - // ErrCodeDecoderManifestValidationException for service response error code - // "DecoderManifestValidationException". - // - // The request couldn't be completed because it contains signal decoders with - // one or more validation errors. - ErrCodeDecoderManifestValidationException = "DecoderManifestValidationException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request couldn't be completed because the server temporarily failed. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeInvalidNodeException for service response error code - // "InvalidNodeException". - // - // The specified node type doesn't match the expected node type for a node. - // You can specify the node type as branch, sensor, actuator, or attribute. - ErrCodeInvalidNodeException = "InvalidNodeException" - - // ErrCodeInvalidSignalsException for service response error code - // "InvalidSignalsException". - // - // The request couldn't be completed because it contains signals that aren't - // valid. - ErrCodeInvalidSignalsException = "InvalidSignalsException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // A service quota was exceeded. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource wasn't found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request couldn't be completed due to throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an Amazon Web Services - // service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "DecoderManifestValidationException": newErrorDecoderManifestValidationException, - "InternalServerException": newErrorInternalServerException, - "InvalidNodeException": newErrorInvalidNodeException, - "InvalidSignalsException": newErrorInvalidSignalsException, - "LimitExceededException": newErrorLimitExceededException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/iotfleetwiseiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/iotfleetwiseiface/interface.go deleted file mode 100644 index 128471ce1ec8..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/iotfleetwiseiface/interface.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package iotfleetwiseiface provides an interface to enable mocking the AWS IoT FleetWise service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package iotfleetwiseiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise" -) - -// IoTFleetWiseAPI provides an interface to enable mocking the -// iotfleetwise.IoTFleetWise service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS IoT FleetWise. -// func myFunc(svc iotfleetwiseiface.IoTFleetWiseAPI) bool { -// // Make svc.AssociateVehicleFleet request -// } -// -// func main() { -// sess := session.New() -// svc := iotfleetwise.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockIoTFleetWiseClient struct { -// iotfleetwiseiface.IoTFleetWiseAPI -// } -// func (m *mockIoTFleetWiseClient) AssociateVehicleFleet(input *iotfleetwise.AssociateVehicleFleetInput) (*iotfleetwise.AssociateVehicleFleetOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockIoTFleetWiseClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type IoTFleetWiseAPI interface { - AssociateVehicleFleet(*iotfleetwise.AssociateVehicleFleetInput) (*iotfleetwise.AssociateVehicleFleetOutput, error) - AssociateVehicleFleetWithContext(aws.Context, *iotfleetwise.AssociateVehicleFleetInput, ...request.Option) (*iotfleetwise.AssociateVehicleFleetOutput, error) - AssociateVehicleFleetRequest(*iotfleetwise.AssociateVehicleFleetInput) (*request.Request, *iotfleetwise.AssociateVehicleFleetOutput) - - BatchCreateVehicle(*iotfleetwise.BatchCreateVehicleInput) (*iotfleetwise.BatchCreateVehicleOutput, error) - BatchCreateVehicleWithContext(aws.Context, *iotfleetwise.BatchCreateVehicleInput, ...request.Option) (*iotfleetwise.BatchCreateVehicleOutput, error) - BatchCreateVehicleRequest(*iotfleetwise.BatchCreateVehicleInput) (*request.Request, *iotfleetwise.BatchCreateVehicleOutput) - - BatchUpdateVehicle(*iotfleetwise.BatchUpdateVehicleInput) (*iotfleetwise.BatchUpdateVehicleOutput, error) - BatchUpdateVehicleWithContext(aws.Context, *iotfleetwise.BatchUpdateVehicleInput, ...request.Option) (*iotfleetwise.BatchUpdateVehicleOutput, error) - BatchUpdateVehicleRequest(*iotfleetwise.BatchUpdateVehicleInput) (*request.Request, *iotfleetwise.BatchUpdateVehicleOutput) - - CreateCampaign(*iotfleetwise.CreateCampaignInput) (*iotfleetwise.CreateCampaignOutput, error) - CreateCampaignWithContext(aws.Context, *iotfleetwise.CreateCampaignInput, ...request.Option) (*iotfleetwise.CreateCampaignOutput, error) - CreateCampaignRequest(*iotfleetwise.CreateCampaignInput) (*request.Request, *iotfleetwise.CreateCampaignOutput) - - CreateDecoderManifest(*iotfleetwise.CreateDecoderManifestInput) (*iotfleetwise.CreateDecoderManifestOutput, error) - CreateDecoderManifestWithContext(aws.Context, *iotfleetwise.CreateDecoderManifestInput, ...request.Option) (*iotfleetwise.CreateDecoderManifestOutput, error) - CreateDecoderManifestRequest(*iotfleetwise.CreateDecoderManifestInput) (*request.Request, *iotfleetwise.CreateDecoderManifestOutput) - - CreateFleet(*iotfleetwise.CreateFleetInput) (*iotfleetwise.CreateFleetOutput, error) - CreateFleetWithContext(aws.Context, *iotfleetwise.CreateFleetInput, ...request.Option) (*iotfleetwise.CreateFleetOutput, error) - CreateFleetRequest(*iotfleetwise.CreateFleetInput) (*request.Request, *iotfleetwise.CreateFleetOutput) - - CreateModelManifest(*iotfleetwise.CreateModelManifestInput) (*iotfleetwise.CreateModelManifestOutput, error) - CreateModelManifestWithContext(aws.Context, *iotfleetwise.CreateModelManifestInput, ...request.Option) (*iotfleetwise.CreateModelManifestOutput, error) - CreateModelManifestRequest(*iotfleetwise.CreateModelManifestInput) (*request.Request, *iotfleetwise.CreateModelManifestOutput) - - CreateSignalCatalog(*iotfleetwise.CreateSignalCatalogInput) (*iotfleetwise.CreateSignalCatalogOutput, error) - CreateSignalCatalogWithContext(aws.Context, *iotfleetwise.CreateSignalCatalogInput, ...request.Option) (*iotfleetwise.CreateSignalCatalogOutput, error) - CreateSignalCatalogRequest(*iotfleetwise.CreateSignalCatalogInput) (*request.Request, *iotfleetwise.CreateSignalCatalogOutput) - - CreateVehicle(*iotfleetwise.CreateVehicleInput) (*iotfleetwise.CreateVehicleOutput, error) - CreateVehicleWithContext(aws.Context, *iotfleetwise.CreateVehicleInput, ...request.Option) (*iotfleetwise.CreateVehicleOutput, error) - CreateVehicleRequest(*iotfleetwise.CreateVehicleInput) (*request.Request, *iotfleetwise.CreateVehicleOutput) - - DeleteCampaign(*iotfleetwise.DeleteCampaignInput) (*iotfleetwise.DeleteCampaignOutput, error) - DeleteCampaignWithContext(aws.Context, *iotfleetwise.DeleteCampaignInput, ...request.Option) (*iotfleetwise.DeleteCampaignOutput, error) - DeleteCampaignRequest(*iotfleetwise.DeleteCampaignInput) (*request.Request, *iotfleetwise.DeleteCampaignOutput) - - DeleteDecoderManifest(*iotfleetwise.DeleteDecoderManifestInput) (*iotfleetwise.DeleteDecoderManifestOutput, error) - DeleteDecoderManifestWithContext(aws.Context, *iotfleetwise.DeleteDecoderManifestInput, ...request.Option) (*iotfleetwise.DeleteDecoderManifestOutput, error) - DeleteDecoderManifestRequest(*iotfleetwise.DeleteDecoderManifestInput) (*request.Request, *iotfleetwise.DeleteDecoderManifestOutput) - - DeleteFleet(*iotfleetwise.DeleteFleetInput) (*iotfleetwise.DeleteFleetOutput, error) - DeleteFleetWithContext(aws.Context, *iotfleetwise.DeleteFleetInput, ...request.Option) (*iotfleetwise.DeleteFleetOutput, error) - DeleteFleetRequest(*iotfleetwise.DeleteFleetInput) (*request.Request, *iotfleetwise.DeleteFleetOutput) - - DeleteModelManifest(*iotfleetwise.DeleteModelManifestInput) (*iotfleetwise.DeleteModelManifestOutput, error) - DeleteModelManifestWithContext(aws.Context, *iotfleetwise.DeleteModelManifestInput, ...request.Option) (*iotfleetwise.DeleteModelManifestOutput, error) - DeleteModelManifestRequest(*iotfleetwise.DeleteModelManifestInput) (*request.Request, *iotfleetwise.DeleteModelManifestOutput) - - DeleteSignalCatalog(*iotfleetwise.DeleteSignalCatalogInput) (*iotfleetwise.DeleteSignalCatalogOutput, error) - DeleteSignalCatalogWithContext(aws.Context, *iotfleetwise.DeleteSignalCatalogInput, ...request.Option) (*iotfleetwise.DeleteSignalCatalogOutput, error) - DeleteSignalCatalogRequest(*iotfleetwise.DeleteSignalCatalogInput) (*request.Request, *iotfleetwise.DeleteSignalCatalogOutput) - - DeleteVehicle(*iotfleetwise.DeleteVehicleInput) (*iotfleetwise.DeleteVehicleOutput, error) - DeleteVehicleWithContext(aws.Context, *iotfleetwise.DeleteVehicleInput, ...request.Option) (*iotfleetwise.DeleteVehicleOutput, error) - DeleteVehicleRequest(*iotfleetwise.DeleteVehicleInput) (*request.Request, *iotfleetwise.DeleteVehicleOutput) - - DisassociateVehicleFleet(*iotfleetwise.DisassociateVehicleFleetInput) (*iotfleetwise.DisassociateVehicleFleetOutput, error) - DisassociateVehicleFleetWithContext(aws.Context, *iotfleetwise.DisassociateVehicleFleetInput, ...request.Option) (*iotfleetwise.DisassociateVehicleFleetOutput, error) - DisassociateVehicleFleetRequest(*iotfleetwise.DisassociateVehicleFleetInput) (*request.Request, *iotfleetwise.DisassociateVehicleFleetOutput) - - GetCampaign(*iotfleetwise.GetCampaignInput) (*iotfleetwise.GetCampaignOutput, error) - GetCampaignWithContext(aws.Context, *iotfleetwise.GetCampaignInput, ...request.Option) (*iotfleetwise.GetCampaignOutput, error) - GetCampaignRequest(*iotfleetwise.GetCampaignInput) (*request.Request, *iotfleetwise.GetCampaignOutput) - - GetDecoderManifest(*iotfleetwise.GetDecoderManifestInput) (*iotfleetwise.GetDecoderManifestOutput, error) - GetDecoderManifestWithContext(aws.Context, *iotfleetwise.GetDecoderManifestInput, ...request.Option) (*iotfleetwise.GetDecoderManifestOutput, error) - GetDecoderManifestRequest(*iotfleetwise.GetDecoderManifestInput) (*request.Request, *iotfleetwise.GetDecoderManifestOutput) - - GetEncryptionConfiguration(*iotfleetwise.GetEncryptionConfigurationInput) (*iotfleetwise.GetEncryptionConfigurationOutput, error) - GetEncryptionConfigurationWithContext(aws.Context, *iotfleetwise.GetEncryptionConfigurationInput, ...request.Option) (*iotfleetwise.GetEncryptionConfigurationOutput, error) - GetEncryptionConfigurationRequest(*iotfleetwise.GetEncryptionConfigurationInput) (*request.Request, *iotfleetwise.GetEncryptionConfigurationOutput) - - GetFleet(*iotfleetwise.GetFleetInput) (*iotfleetwise.GetFleetOutput, error) - GetFleetWithContext(aws.Context, *iotfleetwise.GetFleetInput, ...request.Option) (*iotfleetwise.GetFleetOutput, error) - GetFleetRequest(*iotfleetwise.GetFleetInput) (*request.Request, *iotfleetwise.GetFleetOutput) - - GetLoggingOptions(*iotfleetwise.GetLoggingOptionsInput) (*iotfleetwise.GetLoggingOptionsOutput, error) - GetLoggingOptionsWithContext(aws.Context, *iotfleetwise.GetLoggingOptionsInput, ...request.Option) (*iotfleetwise.GetLoggingOptionsOutput, error) - GetLoggingOptionsRequest(*iotfleetwise.GetLoggingOptionsInput) (*request.Request, *iotfleetwise.GetLoggingOptionsOutput) - - GetModelManifest(*iotfleetwise.GetModelManifestInput) (*iotfleetwise.GetModelManifestOutput, error) - GetModelManifestWithContext(aws.Context, *iotfleetwise.GetModelManifestInput, ...request.Option) (*iotfleetwise.GetModelManifestOutput, error) - GetModelManifestRequest(*iotfleetwise.GetModelManifestInput) (*request.Request, *iotfleetwise.GetModelManifestOutput) - - GetRegisterAccountStatus(*iotfleetwise.GetRegisterAccountStatusInput) (*iotfleetwise.GetRegisterAccountStatusOutput, error) - GetRegisterAccountStatusWithContext(aws.Context, *iotfleetwise.GetRegisterAccountStatusInput, ...request.Option) (*iotfleetwise.GetRegisterAccountStatusOutput, error) - GetRegisterAccountStatusRequest(*iotfleetwise.GetRegisterAccountStatusInput) (*request.Request, *iotfleetwise.GetRegisterAccountStatusOutput) - - GetSignalCatalog(*iotfleetwise.GetSignalCatalogInput) (*iotfleetwise.GetSignalCatalogOutput, error) - GetSignalCatalogWithContext(aws.Context, *iotfleetwise.GetSignalCatalogInput, ...request.Option) (*iotfleetwise.GetSignalCatalogOutput, error) - GetSignalCatalogRequest(*iotfleetwise.GetSignalCatalogInput) (*request.Request, *iotfleetwise.GetSignalCatalogOutput) - - GetVehicle(*iotfleetwise.GetVehicleInput) (*iotfleetwise.GetVehicleOutput, error) - GetVehicleWithContext(aws.Context, *iotfleetwise.GetVehicleInput, ...request.Option) (*iotfleetwise.GetVehicleOutput, error) - GetVehicleRequest(*iotfleetwise.GetVehicleInput) (*request.Request, *iotfleetwise.GetVehicleOutput) - - GetVehicleStatus(*iotfleetwise.GetVehicleStatusInput) (*iotfleetwise.GetVehicleStatusOutput, error) - GetVehicleStatusWithContext(aws.Context, *iotfleetwise.GetVehicleStatusInput, ...request.Option) (*iotfleetwise.GetVehicleStatusOutput, error) - GetVehicleStatusRequest(*iotfleetwise.GetVehicleStatusInput) (*request.Request, *iotfleetwise.GetVehicleStatusOutput) - - GetVehicleStatusPages(*iotfleetwise.GetVehicleStatusInput, func(*iotfleetwise.GetVehicleStatusOutput, bool) bool) error - GetVehicleStatusPagesWithContext(aws.Context, *iotfleetwise.GetVehicleStatusInput, func(*iotfleetwise.GetVehicleStatusOutput, bool) bool, ...request.Option) error - - ImportDecoderManifest(*iotfleetwise.ImportDecoderManifestInput) (*iotfleetwise.ImportDecoderManifestOutput, error) - ImportDecoderManifestWithContext(aws.Context, *iotfleetwise.ImportDecoderManifestInput, ...request.Option) (*iotfleetwise.ImportDecoderManifestOutput, error) - ImportDecoderManifestRequest(*iotfleetwise.ImportDecoderManifestInput) (*request.Request, *iotfleetwise.ImportDecoderManifestOutput) - - ImportSignalCatalog(*iotfleetwise.ImportSignalCatalogInput) (*iotfleetwise.ImportSignalCatalogOutput, error) - ImportSignalCatalogWithContext(aws.Context, *iotfleetwise.ImportSignalCatalogInput, ...request.Option) (*iotfleetwise.ImportSignalCatalogOutput, error) - ImportSignalCatalogRequest(*iotfleetwise.ImportSignalCatalogInput) (*request.Request, *iotfleetwise.ImportSignalCatalogOutput) - - ListCampaigns(*iotfleetwise.ListCampaignsInput) (*iotfleetwise.ListCampaignsOutput, error) - ListCampaignsWithContext(aws.Context, *iotfleetwise.ListCampaignsInput, ...request.Option) (*iotfleetwise.ListCampaignsOutput, error) - ListCampaignsRequest(*iotfleetwise.ListCampaignsInput) (*request.Request, *iotfleetwise.ListCampaignsOutput) - - ListCampaignsPages(*iotfleetwise.ListCampaignsInput, func(*iotfleetwise.ListCampaignsOutput, bool) bool) error - ListCampaignsPagesWithContext(aws.Context, *iotfleetwise.ListCampaignsInput, func(*iotfleetwise.ListCampaignsOutput, bool) bool, ...request.Option) error - - ListDecoderManifestNetworkInterfaces(*iotfleetwise.ListDecoderManifestNetworkInterfacesInput) (*iotfleetwise.ListDecoderManifestNetworkInterfacesOutput, error) - ListDecoderManifestNetworkInterfacesWithContext(aws.Context, *iotfleetwise.ListDecoderManifestNetworkInterfacesInput, ...request.Option) (*iotfleetwise.ListDecoderManifestNetworkInterfacesOutput, error) - ListDecoderManifestNetworkInterfacesRequest(*iotfleetwise.ListDecoderManifestNetworkInterfacesInput) (*request.Request, *iotfleetwise.ListDecoderManifestNetworkInterfacesOutput) - - ListDecoderManifestNetworkInterfacesPages(*iotfleetwise.ListDecoderManifestNetworkInterfacesInput, func(*iotfleetwise.ListDecoderManifestNetworkInterfacesOutput, bool) bool) error - ListDecoderManifestNetworkInterfacesPagesWithContext(aws.Context, *iotfleetwise.ListDecoderManifestNetworkInterfacesInput, func(*iotfleetwise.ListDecoderManifestNetworkInterfacesOutput, bool) bool, ...request.Option) error - - ListDecoderManifestSignals(*iotfleetwise.ListDecoderManifestSignalsInput) (*iotfleetwise.ListDecoderManifestSignalsOutput, error) - ListDecoderManifestSignalsWithContext(aws.Context, *iotfleetwise.ListDecoderManifestSignalsInput, ...request.Option) (*iotfleetwise.ListDecoderManifestSignalsOutput, error) - ListDecoderManifestSignalsRequest(*iotfleetwise.ListDecoderManifestSignalsInput) (*request.Request, *iotfleetwise.ListDecoderManifestSignalsOutput) - - ListDecoderManifestSignalsPages(*iotfleetwise.ListDecoderManifestSignalsInput, func(*iotfleetwise.ListDecoderManifestSignalsOutput, bool) bool) error - ListDecoderManifestSignalsPagesWithContext(aws.Context, *iotfleetwise.ListDecoderManifestSignalsInput, func(*iotfleetwise.ListDecoderManifestSignalsOutput, bool) bool, ...request.Option) error - - ListDecoderManifests(*iotfleetwise.ListDecoderManifestsInput) (*iotfleetwise.ListDecoderManifestsOutput, error) - ListDecoderManifestsWithContext(aws.Context, *iotfleetwise.ListDecoderManifestsInput, ...request.Option) (*iotfleetwise.ListDecoderManifestsOutput, error) - ListDecoderManifestsRequest(*iotfleetwise.ListDecoderManifestsInput) (*request.Request, *iotfleetwise.ListDecoderManifestsOutput) - - ListDecoderManifestsPages(*iotfleetwise.ListDecoderManifestsInput, func(*iotfleetwise.ListDecoderManifestsOutput, bool) bool) error - ListDecoderManifestsPagesWithContext(aws.Context, *iotfleetwise.ListDecoderManifestsInput, func(*iotfleetwise.ListDecoderManifestsOutput, bool) bool, ...request.Option) error - - ListFleets(*iotfleetwise.ListFleetsInput) (*iotfleetwise.ListFleetsOutput, error) - ListFleetsWithContext(aws.Context, *iotfleetwise.ListFleetsInput, ...request.Option) (*iotfleetwise.ListFleetsOutput, error) - ListFleetsRequest(*iotfleetwise.ListFleetsInput) (*request.Request, *iotfleetwise.ListFleetsOutput) - - ListFleetsPages(*iotfleetwise.ListFleetsInput, func(*iotfleetwise.ListFleetsOutput, bool) bool) error - ListFleetsPagesWithContext(aws.Context, *iotfleetwise.ListFleetsInput, func(*iotfleetwise.ListFleetsOutput, bool) bool, ...request.Option) error - - ListFleetsForVehicle(*iotfleetwise.ListFleetsForVehicleInput) (*iotfleetwise.ListFleetsForVehicleOutput, error) - ListFleetsForVehicleWithContext(aws.Context, *iotfleetwise.ListFleetsForVehicleInput, ...request.Option) (*iotfleetwise.ListFleetsForVehicleOutput, error) - ListFleetsForVehicleRequest(*iotfleetwise.ListFleetsForVehicleInput) (*request.Request, *iotfleetwise.ListFleetsForVehicleOutput) - - ListFleetsForVehiclePages(*iotfleetwise.ListFleetsForVehicleInput, func(*iotfleetwise.ListFleetsForVehicleOutput, bool) bool) error - ListFleetsForVehiclePagesWithContext(aws.Context, *iotfleetwise.ListFleetsForVehicleInput, func(*iotfleetwise.ListFleetsForVehicleOutput, bool) bool, ...request.Option) error - - ListModelManifestNodes(*iotfleetwise.ListModelManifestNodesInput) (*iotfleetwise.ListModelManifestNodesOutput, error) - ListModelManifestNodesWithContext(aws.Context, *iotfleetwise.ListModelManifestNodesInput, ...request.Option) (*iotfleetwise.ListModelManifestNodesOutput, error) - ListModelManifestNodesRequest(*iotfleetwise.ListModelManifestNodesInput) (*request.Request, *iotfleetwise.ListModelManifestNodesOutput) - - ListModelManifestNodesPages(*iotfleetwise.ListModelManifestNodesInput, func(*iotfleetwise.ListModelManifestNodesOutput, bool) bool) error - ListModelManifestNodesPagesWithContext(aws.Context, *iotfleetwise.ListModelManifestNodesInput, func(*iotfleetwise.ListModelManifestNodesOutput, bool) bool, ...request.Option) error - - ListModelManifests(*iotfleetwise.ListModelManifestsInput) (*iotfleetwise.ListModelManifestsOutput, error) - ListModelManifestsWithContext(aws.Context, *iotfleetwise.ListModelManifestsInput, ...request.Option) (*iotfleetwise.ListModelManifestsOutput, error) - ListModelManifestsRequest(*iotfleetwise.ListModelManifestsInput) (*request.Request, *iotfleetwise.ListModelManifestsOutput) - - ListModelManifestsPages(*iotfleetwise.ListModelManifestsInput, func(*iotfleetwise.ListModelManifestsOutput, bool) bool) error - ListModelManifestsPagesWithContext(aws.Context, *iotfleetwise.ListModelManifestsInput, func(*iotfleetwise.ListModelManifestsOutput, bool) bool, ...request.Option) error - - ListSignalCatalogNodes(*iotfleetwise.ListSignalCatalogNodesInput) (*iotfleetwise.ListSignalCatalogNodesOutput, error) - ListSignalCatalogNodesWithContext(aws.Context, *iotfleetwise.ListSignalCatalogNodesInput, ...request.Option) (*iotfleetwise.ListSignalCatalogNodesOutput, error) - ListSignalCatalogNodesRequest(*iotfleetwise.ListSignalCatalogNodesInput) (*request.Request, *iotfleetwise.ListSignalCatalogNodesOutput) - - ListSignalCatalogNodesPages(*iotfleetwise.ListSignalCatalogNodesInput, func(*iotfleetwise.ListSignalCatalogNodesOutput, bool) bool) error - ListSignalCatalogNodesPagesWithContext(aws.Context, *iotfleetwise.ListSignalCatalogNodesInput, func(*iotfleetwise.ListSignalCatalogNodesOutput, bool) bool, ...request.Option) error - - ListSignalCatalogs(*iotfleetwise.ListSignalCatalogsInput) (*iotfleetwise.ListSignalCatalogsOutput, error) - ListSignalCatalogsWithContext(aws.Context, *iotfleetwise.ListSignalCatalogsInput, ...request.Option) (*iotfleetwise.ListSignalCatalogsOutput, error) - ListSignalCatalogsRequest(*iotfleetwise.ListSignalCatalogsInput) (*request.Request, *iotfleetwise.ListSignalCatalogsOutput) - - ListSignalCatalogsPages(*iotfleetwise.ListSignalCatalogsInput, func(*iotfleetwise.ListSignalCatalogsOutput, bool) bool) error - ListSignalCatalogsPagesWithContext(aws.Context, *iotfleetwise.ListSignalCatalogsInput, func(*iotfleetwise.ListSignalCatalogsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*iotfleetwise.ListTagsForResourceInput) (*iotfleetwise.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *iotfleetwise.ListTagsForResourceInput, ...request.Option) (*iotfleetwise.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*iotfleetwise.ListTagsForResourceInput) (*request.Request, *iotfleetwise.ListTagsForResourceOutput) - - ListVehicles(*iotfleetwise.ListVehiclesInput) (*iotfleetwise.ListVehiclesOutput, error) - ListVehiclesWithContext(aws.Context, *iotfleetwise.ListVehiclesInput, ...request.Option) (*iotfleetwise.ListVehiclesOutput, error) - ListVehiclesRequest(*iotfleetwise.ListVehiclesInput) (*request.Request, *iotfleetwise.ListVehiclesOutput) - - ListVehiclesPages(*iotfleetwise.ListVehiclesInput, func(*iotfleetwise.ListVehiclesOutput, bool) bool) error - ListVehiclesPagesWithContext(aws.Context, *iotfleetwise.ListVehiclesInput, func(*iotfleetwise.ListVehiclesOutput, bool) bool, ...request.Option) error - - ListVehiclesInFleet(*iotfleetwise.ListVehiclesInFleetInput) (*iotfleetwise.ListVehiclesInFleetOutput, error) - ListVehiclesInFleetWithContext(aws.Context, *iotfleetwise.ListVehiclesInFleetInput, ...request.Option) (*iotfleetwise.ListVehiclesInFleetOutput, error) - ListVehiclesInFleetRequest(*iotfleetwise.ListVehiclesInFleetInput) (*request.Request, *iotfleetwise.ListVehiclesInFleetOutput) - - ListVehiclesInFleetPages(*iotfleetwise.ListVehiclesInFleetInput, func(*iotfleetwise.ListVehiclesInFleetOutput, bool) bool) error - ListVehiclesInFleetPagesWithContext(aws.Context, *iotfleetwise.ListVehiclesInFleetInput, func(*iotfleetwise.ListVehiclesInFleetOutput, bool) bool, ...request.Option) error - - PutEncryptionConfiguration(*iotfleetwise.PutEncryptionConfigurationInput) (*iotfleetwise.PutEncryptionConfigurationOutput, error) - PutEncryptionConfigurationWithContext(aws.Context, *iotfleetwise.PutEncryptionConfigurationInput, ...request.Option) (*iotfleetwise.PutEncryptionConfigurationOutput, error) - PutEncryptionConfigurationRequest(*iotfleetwise.PutEncryptionConfigurationInput) (*request.Request, *iotfleetwise.PutEncryptionConfigurationOutput) - - PutLoggingOptions(*iotfleetwise.PutLoggingOptionsInput) (*iotfleetwise.PutLoggingOptionsOutput, error) - PutLoggingOptionsWithContext(aws.Context, *iotfleetwise.PutLoggingOptionsInput, ...request.Option) (*iotfleetwise.PutLoggingOptionsOutput, error) - PutLoggingOptionsRequest(*iotfleetwise.PutLoggingOptionsInput) (*request.Request, *iotfleetwise.PutLoggingOptionsOutput) - - RegisterAccount(*iotfleetwise.RegisterAccountInput) (*iotfleetwise.RegisterAccountOutput, error) - RegisterAccountWithContext(aws.Context, *iotfleetwise.RegisterAccountInput, ...request.Option) (*iotfleetwise.RegisterAccountOutput, error) - RegisterAccountRequest(*iotfleetwise.RegisterAccountInput) (*request.Request, *iotfleetwise.RegisterAccountOutput) - - TagResource(*iotfleetwise.TagResourceInput) (*iotfleetwise.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *iotfleetwise.TagResourceInput, ...request.Option) (*iotfleetwise.TagResourceOutput, error) - TagResourceRequest(*iotfleetwise.TagResourceInput) (*request.Request, *iotfleetwise.TagResourceOutput) - - UntagResource(*iotfleetwise.UntagResourceInput) (*iotfleetwise.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *iotfleetwise.UntagResourceInput, ...request.Option) (*iotfleetwise.UntagResourceOutput, error) - UntagResourceRequest(*iotfleetwise.UntagResourceInput) (*request.Request, *iotfleetwise.UntagResourceOutput) - - UpdateCampaign(*iotfleetwise.UpdateCampaignInput) (*iotfleetwise.UpdateCampaignOutput, error) - UpdateCampaignWithContext(aws.Context, *iotfleetwise.UpdateCampaignInput, ...request.Option) (*iotfleetwise.UpdateCampaignOutput, error) - UpdateCampaignRequest(*iotfleetwise.UpdateCampaignInput) (*request.Request, *iotfleetwise.UpdateCampaignOutput) - - UpdateDecoderManifest(*iotfleetwise.UpdateDecoderManifestInput) (*iotfleetwise.UpdateDecoderManifestOutput, error) - UpdateDecoderManifestWithContext(aws.Context, *iotfleetwise.UpdateDecoderManifestInput, ...request.Option) (*iotfleetwise.UpdateDecoderManifestOutput, error) - UpdateDecoderManifestRequest(*iotfleetwise.UpdateDecoderManifestInput) (*request.Request, *iotfleetwise.UpdateDecoderManifestOutput) - - UpdateFleet(*iotfleetwise.UpdateFleetInput) (*iotfleetwise.UpdateFleetOutput, error) - UpdateFleetWithContext(aws.Context, *iotfleetwise.UpdateFleetInput, ...request.Option) (*iotfleetwise.UpdateFleetOutput, error) - UpdateFleetRequest(*iotfleetwise.UpdateFleetInput) (*request.Request, *iotfleetwise.UpdateFleetOutput) - - UpdateModelManifest(*iotfleetwise.UpdateModelManifestInput) (*iotfleetwise.UpdateModelManifestOutput, error) - UpdateModelManifestWithContext(aws.Context, *iotfleetwise.UpdateModelManifestInput, ...request.Option) (*iotfleetwise.UpdateModelManifestOutput, error) - UpdateModelManifestRequest(*iotfleetwise.UpdateModelManifestInput) (*request.Request, *iotfleetwise.UpdateModelManifestOutput) - - UpdateSignalCatalog(*iotfleetwise.UpdateSignalCatalogInput) (*iotfleetwise.UpdateSignalCatalogOutput, error) - UpdateSignalCatalogWithContext(aws.Context, *iotfleetwise.UpdateSignalCatalogInput, ...request.Option) (*iotfleetwise.UpdateSignalCatalogOutput, error) - UpdateSignalCatalogRequest(*iotfleetwise.UpdateSignalCatalogInput) (*request.Request, *iotfleetwise.UpdateSignalCatalogOutput) - - UpdateVehicle(*iotfleetwise.UpdateVehicleInput) (*iotfleetwise.UpdateVehicleOutput, error) - UpdateVehicleWithContext(aws.Context, *iotfleetwise.UpdateVehicleInput, ...request.Option) (*iotfleetwise.UpdateVehicleOutput, error) - UpdateVehicleRequest(*iotfleetwise.UpdateVehicleInput) (*request.Request, *iotfleetwise.UpdateVehicleOutput) -} - -var _ IoTFleetWiseAPI = (*iotfleetwise.IoTFleetWise)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/service.go deleted file mode 100644 index 4b8402a5d569..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotfleetwise/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package iotfleetwise - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// IoTFleetWise provides the API operation methods for making requests to -// AWS IoT FleetWise. See this package's package overview docs -// for details on the service. -// -// IoTFleetWise methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type IoTFleetWise struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "IoTFleetWise" // Name of service. - EndpointsID = "iotfleetwise" // ID to lookup a service endpoint with. - ServiceID = "IoTFleetWise" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the IoTFleetWise client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a IoTFleetWise client from just a session. -// svc := iotfleetwise.New(mySession) -// -// // Create a IoTFleetWise client with additional configuration -// svc := iotfleetwise.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *IoTFleetWise { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "iotfleetwise" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *IoTFleetWise { - svc := &IoTFleetWise{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-06-17", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.0", - TargetPrefix: "IoTAutobahnControlPlane", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a IoTFleetWise operation and runs any -// custom request initialization. -func (c *IoTFleetWise) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/api.go deleted file mode 100644 index 3e3a7efc90ef..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/api.go +++ /dev/null @@ -1,6062 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package iotroborunner - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateDestination = "CreateDestination" - -// CreateDestinationRequest generates a "aws/request.Request" representing the -// client's request for the CreateDestination 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 CreateDestination for more information on using the CreateDestination -// 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 CreateDestinationRequest method. -// req, resp := client.CreateDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/CreateDestination -func (c *IoTRoboRunner) CreateDestinationRequest(input *CreateDestinationInput) (req *request.Request, output *CreateDestinationOutput) { - op := &request.Operation{ - Name: opCreateDestination, - HTTPMethod: "POST", - HTTPPath: "/createDestination", - } - - if input == nil { - input = &CreateDestinationInput{} - } - - output = &CreateDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDestination API operation for AWS IoT RoboRunner. -// -// # Grants permission to create a destination -// -// 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 AWS IoT RoboRunner's -// API operation CreateDestination for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Exception thrown if a resource in a create request already exists. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// - ServiceQuotaExceededException -// Exception thrown if the user's AWS account has reached a service limit and -// the operation cannot proceed. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/CreateDestination -func (c *IoTRoboRunner) CreateDestination(input *CreateDestinationInput) (*CreateDestinationOutput, error) { - req, out := c.CreateDestinationRequest(input) - return out, req.Send() -} - -// CreateDestinationWithContext is the same as CreateDestination with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDestination 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 *IoTRoboRunner) CreateDestinationWithContext(ctx aws.Context, input *CreateDestinationInput, opts ...request.Option) (*CreateDestinationOutput, error) { - req, out := c.CreateDestinationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSite = "CreateSite" - -// CreateSiteRequest generates a "aws/request.Request" representing the -// client's request for the CreateSite 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 CreateSite for more information on using the CreateSite -// 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 CreateSiteRequest method. -// req, resp := client.CreateSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/CreateSite -func (c *IoTRoboRunner) CreateSiteRequest(input *CreateSiteInput) (req *request.Request, output *CreateSiteOutput) { - op := &request.Operation{ - Name: opCreateSite, - HTTPMethod: "POST", - HTTPPath: "/createSite", - } - - if input == nil { - input = &CreateSiteInput{} - } - - output = &CreateSiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSite API operation for AWS IoT RoboRunner. -// -// # Grants permission to create a site -// -// 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 AWS IoT RoboRunner's -// API operation CreateSite for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Exception thrown if a resource in a create request already exists. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// - ServiceQuotaExceededException -// Exception thrown if the user's AWS account has reached a service limit and -// the operation cannot proceed. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/CreateSite -func (c *IoTRoboRunner) CreateSite(input *CreateSiteInput) (*CreateSiteOutput, error) { - req, out := c.CreateSiteRequest(input) - return out, req.Send() -} - -// CreateSiteWithContext is the same as CreateSite with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSite 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 *IoTRoboRunner) CreateSiteWithContext(ctx aws.Context, input *CreateSiteInput, opts ...request.Option) (*CreateSiteOutput, error) { - req, out := c.CreateSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateWorker = "CreateWorker" - -// CreateWorkerRequest generates a "aws/request.Request" representing the -// client's request for the CreateWorker 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 CreateWorker for more information on using the CreateWorker -// 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 CreateWorkerRequest method. -// req, resp := client.CreateWorkerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/CreateWorker -func (c *IoTRoboRunner) CreateWorkerRequest(input *CreateWorkerInput) (req *request.Request, output *CreateWorkerOutput) { - op := &request.Operation{ - Name: opCreateWorker, - HTTPMethod: "POST", - HTTPPath: "/createWorker", - } - - if input == nil { - input = &CreateWorkerInput{} - } - - output = &CreateWorkerOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWorker API operation for AWS IoT RoboRunner. -// -// # Grants permission to create a worker -// -// 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 AWS IoT RoboRunner's -// API operation CreateWorker for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Exception thrown if a resource in a create request already exists. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// - ServiceQuotaExceededException -// Exception thrown if the user's AWS account has reached a service limit and -// the operation cannot proceed. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/CreateWorker -func (c *IoTRoboRunner) CreateWorker(input *CreateWorkerInput) (*CreateWorkerOutput, error) { - req, out := c.CreateWorkerRequest(input) - return out, req.Send() -} - -// CreateWorkerWithContext is the same as CreateWorker with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWorker 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 *IoTRoboRunner) CreateWorkerWithContext(ctx aws.Context, input *CreateWorkerInput, opts ...request.Option) (*CreateWorkerOutput, error) { - req, out := c.CreateWorkerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateWorkerFleet = "CreateWorkerFleet" - -// CreateWorkerFleetRequest generates a "aws/request.Request" representing the -// client's request for the CreateWorkerFleet 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 CreateWorkerFleet for more information on using the CreateWorkerFleet -// 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 CreateWorkerFleetRequest method. -// req, resp := client.CreateWorkerFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/CreateWorkerFleet -func (c *IoTRoboRunner) CreateWorkerFleetRequest(input *CreateWorkerFleetInput) (req *request.Request, output *CreateWorkerFleetOutput) { - op := &request.Operation{ - Name: opCreateWorkerFleet, - HTTPMethod: "POST", - HTTPPath: "/createWorkerFleet", - } - - if input == nil { - input = &CreateWorkerFleetInput{} - } - - output = &CreateWorkerFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWorkerFleet API operation for AWS IoT RoboRunner. -// -// # Grants permission to create a worker fleet -// -// 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 AWS IoT RoboRunner's -// API operation CreateWorkerFleet for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Exception thrown if a resource in a create request already exists. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// - ServiceQuotaExceededException -// Exception thrown if the user's AWS account has reached a service limit and -// the operation cannot proceed. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/CreateWorkerFleet -func (c *IoTRoboRunner) CreateWorkerFleet(input *CreateWorkerFleetInput) (*CreateWorkerFleetOutput, error) { - req, out := c.CreateWorkerFleetRequest(input) - return out, req.Send() -} - -// CreateWorkerFleetWithContext is the same as CreateWorkerFleet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWorkerFleet 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 *IoTRoboRunner) CreateWorkerFleetWithContext(ctx aws.Context, input *CreateWorkerFleetInput, opts ...request.Option) (*CreateWorkerFleetOutput, error) { - req, out := c.CreateWorkerFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDestination = "DeleteDestination" - -// DeleteDestinationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDestination 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 DeleteDestination for more information on using the DeleteDestination -// 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 DeleteDestinationRequest method. -// req, resp := client.DeleteDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/DeleteDestination -func (c *IoTRoboRunner) DeleteDestinationRequest(input *DeleteDestinationInput) (req *request.Request, output *DeleteDestinationOutput) { - op := &request.Operation{ - Name: opDeleteDestination, - HTTPMethod: "POST", - HTTPPath: "/deleteDestination", - } - - if input == nil { - input = &DeleteDestinationInput{} - } - - output = &DeleteDestinationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDestination API operation for AWS IoT RoboRunner. -// -// # Grants permission to delete a destination -// -// 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 AWS IoT RoboRunner's -// API operation DeleteDestination for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Exception thrown if a resource in a create request already exists. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/DeleteDestination -func (c *IoTRoboRunner) DeleteDestination(input *DeleteDestinationInput) (*DeleteDestinationOutput, error) { - req, out := c.DeleteDestinationRequest(input) - return out, req.Send() -} - -// DeleteDestinationWithContext is the same as DeleteDestination with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDestination 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 *IoTRoboRunner) DeleteDestinationWithContext(ctx aws.Context, input *DeleteDestinationInput, opts ...request.Option) (*DeleteDestinationOutput, error) { - req, out := c.DeleteDestinationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSite = "DeleteSite" - -// DeleteSiteRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSite 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 DeleteSite for more information on using the DeleteSite -// 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 DeleteSiteRequest method. -// req, resp := client.DeleteSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/DeleteSite -func (c *IoTRoboRunner) DeleteSiteRequest(input *DeleteSiteInput) (req *request.Request, output *DeleteSiteOutput) { - op := &request.Operation{ - Name: opDeleteSite, - HTTPMethod: "POST", - HTTPPath: "/deleteSite", - } - - if input == nil { - input = &DeleteSiteInput{} - } - - output = &DeleteSiteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSite API operation for AWS IoT RoboRunner. -// -// # Grants permission to delete a site -// -// 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 AWS IoT RoboRunner's -// API operation DeleteSite for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Exception thrown if a resource in a create request already exists. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/DeleteSite -func (c *IoTRoboRunner) DeleteSite(input *DeleteSiteInput) (*DeleteSiteOutput, error) { - req, out := c.DeleteSiteRequest(input) - return out, req.Send() -} - -// DeleteSiteWithContext is the same as DeleteSite with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSite 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 *IoTRoboRunner) DeleteSiteWithContext(ctx aws.Context, input *DeleteSiteInput, opts ...request.Option) (*DeleteSiteOutput, error) { - req, out := c.DeleteSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWorker = "DeleteWorker" - -// DeleteWorkerRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWorker 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 DeleteWorker for more information on using the DeleteWorker -// 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 DeleteWorkerRequest method. -// req, resp := client.DeleteWorkerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/DeleteWorker -func (c *IoTRoboRunner) DeleteWorkerRequest(input *DeleteWorkerInput) (req *request.Request, output *DeleteWorkerOutput) { - op := &request.Operation{ - Name: opDeleteWorker, - HTTPMethod: "POST", - HTTPPath: "/deleteWorker", - } - - if input == nil { - input = &DeleteWorkerInput{} - } - - output = &DeleteWorkerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteWorker API operation for AWS IoT RoboRunner. -// -// # Grants permission to delete a worker -// -// 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 AWS IoT RoboRunner's -// API operation DeleteWorker for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Exception thrown if a resource in a create request already exists. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/DeleteWorker -func (c *IoTRoboRunner) DeleteWorker(input *DeleteWorkerInput) (*DeleteWorkerOutput, error) { - req, out := c.DeleteWorkerRequest(input) - return out, req.Send() -} - -// DeleteWorkerWithContext is the same as DeleteWorker with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWorker 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 *IoTRoboRunner) DeleteWorkerWithContext(ctx aws.Context, input *DeleteWorkerInput, opts ...request.Option) (*DeleteWorkerOutput, error) { - req, out := c.DeleteWorkerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWorkerFleet = "DeleteWorkerFleet" - -// DeleteWorkerFleetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWorkerFleet 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 DeleteWorkerFleet for more information on using the DeleteWorkerFleet -// 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 DeleteWorkerFleetRequest method. -// req, resp := client.DeleteWorkerFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/DeleteWorkerFleet -func (c *IoTRoboRunner) DeleteWorkerFleetRequest(input *DeleteWorkerFleetInput) (req *request.Request, output *DeleteWorkerFleetOutput) { - op := &request.Operation{ - Name: opDeleteWorkerFleet, - HTTPMethod: "POST", - HTTPPath: "/deleteWorkerFleet", - } - - if input == nil { - input = &DeleteWorkerFleetInput{} - } - - output = &DeleteWorkerFleetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteWorkerFleet API operation for AWS IoT RoboRunner. -// -// # Grants permission to delete a worker fleet -// -// 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 AWS IoT RoboRunner's -// API operation DeleteWorkerFleet for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Exception thrown if a resource in a create request already exists. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/DeleteWorkerFleet -func (c *IoTRoboRunner) DeleteWorkerFleet(input *DeleteWorkerFleetInput) (*DeleteWorkerFleetOutput, error) { - req, out := c.DeleteWorkerFleetRequest(input) - return out, req.Send() -} - -// DeleteWorkerFleetWithContext is the same as DeleteWorkerFleet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWorkerFleet 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 *IoTRoboRunner) DeleteWorkerFleetWithContext(ctx aws.Context, input *DeleteWorkerFleetInput, opts ...request.Option) (*DeleteWorkerFleetOutput, error) { - req, out := c.DeleteWorkerFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDestination = "GetDestination" - -// GetDestinationRequest generates a "aws/request.Request" representing the -// client's request for the GetDestination 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 GetDestination for more information on using the GetDestination -// 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 GetDestinationRequest method. -// req, resp := client.GetDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/GetDestination -func (c *IoTRoboRunner) GetDestinationRequest(input *GetDestinationInput) (req *request.Request, output *GetDestinationOutput) { - op := &request.Operation{ - Name: opGetDestination, - HTTPMethod: "GET", - HTTPPath: "/getDestination", - } - - if input == nil { - input = &GetDestinationInput{} - } - - output = &GetDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDestination API operation for AWS IoT RoboRunner. -// -// # Grants permission to get a destination -// -// 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 AWS IoT RoboRunner's -// API operation GetDestination for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/GetDestination -func (c *IoTRoboRunner) GetDestination(input *GetDestinationInput) (*GetDestinationOutput, error) { - req, out := c.GetDestinationRequest(input) - return out, req.Send() -} - -// GetDestinationWithContext is the same as GetDestination with the addition of -// the ability to pass a context and additional request options. -// -// See GetDestination 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 *IoTRoboRunner) GetDestinationWithContext(ctx aws.Context, input *GetDestinationInput, opts ...request.Option) (*GetDestinationOutput, error) { - req, out := c.GetDestinationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSite = "GetSite" - -// GetSiteRequest generates a "aws/request.Request" representing the -// client's request for the GetSite 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 GetSite for more information on using the GetSite -// 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 GetSiteRequest method. -// req, resp := client.GetSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/GetSite -func (c *IoTRoboRunner) GetSiteRequest(input *GetSiteInput) (req *request.Request, output *GetSiteOutput) { - op := &request.Operation{ - Name: opGetSite, - HTTPMethod: "GET", - HTTPPath: "/getSite", - } - - if input == nil { - input = &GetSiteInput{} - } - - output = &GetSiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSite API operation for AWS IoT RoboRunner. -// -// # Grants permission to get a site -// -// 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 AWS IoT RoboRunner's -// API operation GetSite for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/GetSite -func (c *IoTRoboRunner) GetSite(input *GetSiteInput) (*GetSiteOutput, error) { - req, out := c.GetSiteRequest(input) - return out, req.Send() -} - -// GetSiteWithContext is the same as GetSite with the addition of -// the ability to pass a context and additional request options. -// -// See GetSite 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 *IoTRoboRunner) GetSiteWithContext(ctx aws.Context, input *GetSiteInput, opts ...request.Option) (*GetSiteOutput, error) { - req, out := c.GetSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWorker = "GetWorker" - -// GetWorkerRequest generates a "aws/request.Request" representing the -// client's request for the GetWorker 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 GetWorker for more information on using the GetWorker -// 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 GetWorkerRequest method. -// req, resp := client.GetWorkerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/GetWorker -func (c *IoTRoboRunner) GetWorkerRequest(input *GetWorkerInput) (req *request.Request, output *GetWorkerOutput) { - op := &request.Operation{ - Name: opGetWorker, - HTTPMethod: "GET", - HTTPPath: "/getWorker", - } - - if input == nil { - input = &GetWorkerInput{} - } - - output = &GetWorkerOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWorker API operation for AWS IoT RoboRunner. -// -// # Grants permission to get a worker -// -// 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 AWS IoT RoboRunner's -// API operation GetWorker for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/GetWorker -func (c *IoTRoboRunner) GetWorker(input *GetWorkerInput) (*GetWorkerOutput, error) { - req, out := c.GetWorkerRequest(input) - return out, req.Send() -} - -// GetWorkerWithContext is the same as GetWorker with the addition of -// the ability to pass a context and additional request options. -// -// See GetWorker 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 *IoTRoboRunner) GetWorkerWithContext(ctx aws.Context, input *GetWorkerInput, opts ...request.Option) (*GetWorkerOutput, error) { - req, out := c.GetWorkerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWorkerFleet = "GetWorkerFleet" - -// GetWorkerFleetRequest generates a "aws/request.Request" representing the -// client's request for the GetWorkerFleet 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 GetWorkerFleet for more information on using the GetWorkerFleet -// 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 GetWorkerFleetRequest method. -// req, resp := client.GetWorkerFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/GetWorkerFleet -func (c *IoTRoboRunner) GetWorkerFleetRequest(input *GetWorkerFleetInput) (req *request.Request, output *GetWorkerFleetOutput) { - op := &request.Operation{ - Name: opGetWorkerFleet, - HTTPMethod: "GET", - HTTPPath: "/getWorkerFleet", - } - - if input == nil { - input = &GetWorkerFleetInput{} - } - - output = &GetWorkerFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWorkerFleet API operation for AWS IoT RoboRunner. -// -// # Grants permission to get a worker fleet -// -// 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 AWS IoT RoboRunner's -// API operation GetWorkerFleet for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/GetWorkerFleet -func (c *IoTRoboRunner) GetWorkerFleet(input *GetWorkerFleetInput) (*GetWorkerFleetOutput, error) { - req, out := c.GetWorkerFleetRequest(input) - return out, req.Send() -} - -// GetWorkerFleetWithContext is the same as GetWorkerFleet with the addition of -// the ability to pass a context and additional request options. -// -// See GetWorkerFleet 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 *IoTRoboRunner) GetWorkerFleetWithContext(ctx aws.Context, input *GetWorkerFleetInput, opts ...request.Option) (*GetWorkerFleetOutput, error) { - req, out := c.GetWorkerFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListDestinations = "ListDestinations" - -// ListDestinationsRequest generates a "aws/request.Request" representing the -// client's request for the ListDestinations 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 ListDestinations for more information on using the ListDestinations -// 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 ListDestinationsRequest method. -// req, resp := client.ListDestinationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/ListDestinations -func (c *IoTRoboRunner) ListDestinationsRequest(input *ListDestinationsInput) (req *request.Request, output *ListDestinationsOutput) { - op := &request.Operation{ - Name: opListDestinations, - HTTPMethod: "GET", - HTTPPath: "/listDestinations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDestinationsInput{} - } - - output = &ListDestinationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDestinations API operation for AWS IoT RoboRunner. -// -// # Grants permission to list destinations -// -// 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 AWS IoT RoboRunner's -// API operation ListDestinations for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/ListDestinations -func (c *IoTRoboRunner) ListDestinations(input *ListDestinationsInput) (*ListDestinationsOutput, error) { - req, out := c.ListDestinationsRequest(input) - return out, req.Send() -} - -// ListDestinationsWithContext is the same as ListDestinations with the addition of -// the ability to pass a context and additional request options. -// -// See ListDestinations 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 *IoTRoboRunner) ListDestinationsWithContext(ctx aws.Context, input *ListDestinationsInput, opts ...request.Option) (*ListDestinationsOutput, error) { - req, out := c.ListDestinationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDestinationsPages iterates over the pages of a ListDestinations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDestinations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDestinations operation. -// pageNum := 0 -// err := client.ListDestinationsPages(params, -// func(page *iotroborunner.ListDestinationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTRoboRunner) ListDestinationsPages(input *ListDestinationsInput, fn func(*ListDestinationsOutput, bool) bool) error { - return c.ListDestinationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDestinationsPagesWithContext same as ListDestinationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTRoboRunner) ListDestinationsPagesWithContext(ctx aws.Context, input *ListDestinationsInput, fn func(*ListDestinationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDestinationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDestinationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDestinationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSites = "ListSites" - -// ListSitesRequest generates a "aws/request.Request" representing the -// client's request for the ListSites 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 ListSites for more information on using the ListSites -// 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 ListSitesRequest method. -// req, resp := client.ListSitesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/ListSites -func (c *IoTRoboRunner) ListSitesRequest(input *ListSitesInput) (req *request.Request, output *ListSitesOutput) { - op := &request.Operation{ - Name: opListSites, - HTTPMethod: "GET", - HTTPPath: "/listSites", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSitesInput{} - } - - output = &ListSitesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSites API operation for AWS IoT RoboRunner. -// -// # Grants permission to list sites -// -// 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 AWS IoT RoboRunner's -// API operation ListSites for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/ListSites -func (c *IoTRoboRunner) ListSites(input *ListSitesInput) (*ListSitesOutput, error) { - req, out := c.ListSitesRequest(input) - return out, req.Send() -} - -// ListSitesWithContext is the same as ListSites with the addition of -// the ability to pass a context and additional request options. -// -// See ListSites 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 *IoTRoboRunner) ListSitesWithContext(ctx aws.Context, input *ListSitesInput, opts ...request.Option) (*ListSitesOutput, error) { - req, out := c.ListSitesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSitesPages iterates over the pages of a ListSites operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSites method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSites operation. -// pageNum := 0 -// err := client.ListSitesPages(params, -// func(page *iotroborunner.ListSitesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTRoboRunner) ListSitesPages(input *ListSitesInput, fn func(*ListSitesOutput, bool) bool) error { - return c.ListSitesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSitesPagesWithContext same as ListSitesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTRoboRunner) ListSitesPagesWithContext(ctx aws.Context, input *ListSitesInput, fn func(*ListSitesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSitesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSitesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSitesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkerFleets = "ListWorkerFleets" - -// ListWorkerFleetsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkerFleets 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 ListWorkerFleets for more information on using the ListWorkerFleets -// 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 ListWorkerFleetsRequest method. -// req, resp := client.ListWorkerFleetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/ListWorkerFleets -func (c *IoTRoboRunner) ListWorkerFleetsRequest(input *ListWorkerFleetsInput) (req *request.Request, output *ListWorkerFleetsOutput) { - op := &request.Operation{ - Name: opListWorkerFleets, - HTTPMethod: "GET", - HTTPPath: "/listWorkerFleets", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkerFleetsInput{} - } - - output = &ListWorkerFleetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWorkerFleets API operation for AWS IoT RoboRunner. -// -// # Grants permission to list worker fleets -// -// 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 AWS IoT RoboRunner's -// API operation ListWorkerFleets for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/ListWorkerFleets -func (c *IoTRoboRunner) ListWorkerFleets(input *ListWorkerFleetsInput) (*ListWorkerFleetsOutput, error) { - req, out := c.ListWorkerFleetsRequest(input) - return out, req.Send() -} - -// ListWorkerFleetsWithContext is the same as ListWorkerFleets with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkerFleets 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 *IoTRoboRunner) ListWorkerFleetsWithContext(ctx aws.Context, input *ListWorkerFleetsInput, opts ...request.Option) (*ListWorkerFleetsOutput, error) { - req, out := c.ListWorkerFleetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkerFleetsPages iterates over the pages of a ListWorkerFleets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkerFleets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkerFleets operation. -// pageNum := 0 -// err := client.ListWorkerFleetsPages(params, -// func(page *iotroborunner.ListWorkerFleetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTRoboRunner) ListWorkerFleetsPages(input *ListWorkerFleetsInput, fn func(*ListWorkerFleetsOutput, bool) bool) error { - return c.ListWorkerFleetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkerFleetsPagesWithContext same as ListWorkerFleetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTRoboRunner) ListWorkerFleetsPagesWithContext(ctx aws.Context, input *ListWorkerFleetsInput, fn func(*ListWorkerFleetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkerFleetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkerFleetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkerFleetsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkers = "ListWorkers" - -// ListWorkersRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkers 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 ListWorkers for more information on using the ListWorkers -// 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 ListWorkersRequest method. -// req, resp := client.ListWorkersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/ListWorkers -func (c *IoTRoboRunner) ListWorkersRequest(input *ListWorkersInput) (req *request.Request, output *ListWorkersOutput) { - op := &request.Operation{ - Name: opListWorkers, - HTTPMethod: "GET", - HTTPPath: "/listWorkers", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkersInput{} - } - - output = &ListWorkersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWorkers API operation for AWS IoT RoboRunner. -// -// # Grants permission to list workers -// -// 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 AWS IoT RoboRunner's -// API operation ListWorkers for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/ListWorkers -func (c *IoTRoboRunner) ListWorkers(input *ListWorkersInput) (*ListWorkersOutput, error) { - req, out := c.ListWorkersRequest(input) - return out, req.Send() -} - -// ListWorkersWithContext is the same as ListWorkers with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkers 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 *IoTRoboRunner) ListWorkersWithContext(ctx aws.Context, input *ListWorkersInput, opts ...request.Option) (*ListWorkersOutput, error) { - req, out := c.ListWorkersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkersPages iterates over the pages of a ListWorkers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkers operation. -// pageNum := 0 -// err := client.ListWorkersPages(params, -// func(page *iotroborunner.ListWorkersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IoTRoboRunner) ListWorkersPages(input *ListWorkersInput, fn func(*ListWorkersOutput, bool) bool) error { - return c.ListWorkersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkersPagesWithContext same as ListWorkersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IoTRoboRunner) ListWorkersPagesWithContext(ctx aws.Context, input *ListWorkersInput, fn func(*ListWorkersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opUpdateDestination = "UpdateDestination" - -// UpdateDestinationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDestination 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 UpdateDestination for more information on using the UpdateDestination -// 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 UpdateDestinationRequest method. -// req, resp := client.UpdateDestinationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/UpdateDestination -func (c *IoTRoboRunner) UpdateDestinationRequest(input *UpdateDestinationInput) (req *request.Request, output *UpdateDestinationOutput) { - op := &request.Operation{ - Name: opUpdateDestination, - HTTPMethod: "POST", - HTTPPath: "/updateDestination", - } - - if input == nil { - input = &UpdateDestinationInput{} - } - - output = &UpdateDestinationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDestination API operation for AWS IoT RoboRunner. -// -// # Grants permission to update a destination -// -// 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 AWS IoT RoboRunner's -// API operation UpdateDestination for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/UpdateDestination -func (c *IoTRoboRunner) UpdateDestination(input *UpdateDestinationInput) (*UpdateDestinationOutput, error) { - req, out := c.UpdateDestinationRequest(input) - return out, req.Send() -} - -// UpdateDestinationWithContext is the same as UpdateDestination with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDestination 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 *IoTRoboRunner) UpdateDestinationWithContext(ctx aws.Context, input *UpdateDestinationInput, opts ...request.Option) (*UpdateDestinationOutput, error) { - req, out := c.UpdateDestinationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSite = "UpdateSite" - -// UpdateSiteRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSite 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 UpdateSite for more information on using the UpdateSite -// 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 UpdateSiteRequest method. -// req, resp := client.UpdateSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/UpdateSite -func (c *IoTRoboRunner) UpdateSiteRequest(input *UpdateSiteInput) (req *request.Request, output *UpdateSiteOutput) { - op := &request.Operation{ - Name: opUpdateSite, - HTTPMethod: "POST", - HTTPPath: "/updateSite", - } - - if input == nil { - input = &UpdateSiteInput{} - } - - output = &UpdateSiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSite API operation for AWS IoT RoboRunner. -// -// # Grants permission to update a site -// -// 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 AWS IoT RoboRunner's -// API operation UpdateSite for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/UpdateSite -func (c *IoTRoboRunner) UpdateSite(input *UpdateSiteInput) (*UpdateSiteOutput, error) { - req, out := c.UpdateSiteRequest(input) - return out, req.Send() -} - -// UpdateSiteWithContext is the same as UpdateSite with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSite 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 *IoTRoboRunner) UpdateSiteWithContext(ctx aws.Context, input *UpdateSiteInput, opts ...request.Option) (*UpdateSiteOutput, error) { - req, out := c.UpdateSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWorker = "UpdateWorker" - -// UpdateWorkerRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWorker 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 UpdateWorker for more information on using the UpdateWorker -// 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 UpdateWorkerRequest method. -// req, resp := client.UpdateWorkerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/UpdateWorker -func (c *IoTRoboRunner) UpdateWorkerRequest(input *UpdateWorkerInput) (req *request.Request, output *UpdateWorkerOutput) { - op := &request.Operation{ - Name: opUpdateWorker, - HTTPMethod: "POST", - HTTPPath: "/updateWorker", - } - - if input == nil { - input = &UpdateWorkerInput{} - } - - output = &UpdateWorkerOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateWorker API operation for AWS IoT RoboRunner. -// -// # Grants permission to update a worker -// -// 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 AWS IoT RoboRunner's -// API operation UpdateWorker for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/UpdateWorker -func (c *IoTRoboRunner) UpdateWorker(input *UpdateWorkerInput) (*UpdateWorkerOutput, error) { - req, out := c.UpdateWorkerRequest(input) - return out, req.Send() -} - -// UpdateWorkerWithContext is the same as UpdateWorker with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWorker 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 *IoTRoboRunner) UpdateWorkerWithContext(ctx aws.Context, input *UpdateWorkerInput, opts ...request.Option) (*UpdateWorkerOutput, error) { - req, out := c.UpdateWorkerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWorkerFleet = "UpdateWorkerFleet" - -// UpdateWorkerFleetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWorkerFleet 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 UpdateWorkerFleet for more information on using the UpdateWorkerFleet -// 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 UpdateWorkerFleetRequest method. -// req, resp := client.UpdateWorkerFleetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/UpdateWorkerFleet -func (c *IoTRoboRunner) UpdateWorkerFleetRequest(input *UpdateWorkerFleetInput) (req *request.Request, output *UpdateWorkerFleetOutput) { - op := &request.Operation{ - Name: opUpdateWorkerFleet, - HTTPMethod: "POST", - HTTPPath: "/updateWorkerFleet", - } - - if input == nil { - input = &UpdateWorkerFleetInput{} - } - - output = &UpdateWorkerFleetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateWorkerFleet API operation for AWS IoT RoboRunner. -// -// # Grants permission to update a worker fleet -// -// 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 AWS IoT RoboRunner's -// API operation UpdateWorkerFleet for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// Exception thrown if an invalid parameter is provided to an API. -// -// - ResourceNotFoundException -// Exception thrown if a resource referenced in the request doesn't exist. -// -// - ThrottlingException -// Exception thrown if the api has been called too quickly be the client. -// -// - InternalServerException -// Exception thrown if something goes wrong within the service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10/UpdateWorkerFleet -func (c *IoTRoboRunner) UpdateWorkerFleet(input *UpdateWorkerFleetInput) (*UpdateWorkerFleetOutput, error) { - req, out := c.UpdateWorkerFleetRequest(input) - return out, req.Send() -} - -// UpdateWorkerFleetWithContext is the same as UpdateWorkerFleet with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWorkerFleet 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 *IoTRoboRunner) UpdateWorkerFleetWithContext(ctx aws.Context, input *UpdateWorkerFleetInput, opts ...request.Option) (*UpdateWorkerFleetOutput, error) { - req, out := c.UpdateWorkerFleetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// User does not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Cartesian coordinates in 3D space relative to the RoboRunner origin. -type CartesianCoordinates struct { - _ struct{} `type:"structure"` - - // X coordinate. - // - // X is a required field - X *float64 `locationName:"x" type:"double" required:"true"` - - // Y coordinate. - // - // Y is a required field - Y *float64 `locationName:"y" type:"double" required:"true"` - - // Z coordinate. - Z *float64 `locationName:"z" type:"double"` -} - -// 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 CartesianCoordinates) 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 CartesianCoordinates) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CartesianCoordinates) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CartesianCoordinates"} - if s.X == nil { - invalidParams.Add(request.NewErrParamRequired("X")) - } - if s.Y == nil { - invalidParams.Add(request.NewErrParamRequired("Y")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetX sets the X field's value. -func (s *CartesianCoordinates) SetX(v float64) *CartesianCoordinates { - s.X = &v - return s -} - -// SetY sets the Y field's value. -func (s *CartesianCoordinates) SetY(v float64) *CartesianCoordinates { - s.Y = &v - return s -} - -// SetZ sets the Z field's value. -func (s *CartesianCoordinates) SetZ(v float64) *CartesianCoordinates { - s.Z = &v - return s -} - -// Exception thrown if a resource in a create request already exists. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateDestinationInput struct { - _ struct{} `type:"structure"` - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Token used for detecting replayed requests. Replayed requests will not be - // performed multiple times. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" type:"string" required:"true"` - - // The state of the destination. Default used if not specified. - State *string `locationName:"state" type:"string" enum:"DestinationState"` -} - -// 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 CreateDestinationInput) 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 CreateDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDestinationInput"} - if s.AdditionalFixedProperties != nil && len(*s.AdditionalFixedProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalFixedProperties", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Site == nil { - invalidParams.Add(request.NewErrParamRequired("Site")) - } - if s.Site != nil && len(*s.Site) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Site", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *CreateDestinationInput) SetAdditionalFixedProperties(v string) *CreateDestinationInput { - s.AdditionalFixedProperties = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDestinationInput) SetClientToken(v string) *CreateDestinationInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDestinationInput) SetName(v string) *CreateDestinationInput { - s.Name = &v - return s -} - -// SetSite sets the Site field's value. -func (s *CreateDestinationInput) SetSite(v string) *CreateDestinationInput { - s.Site = &v - return s -} - -// SetState sets the State field's value. -func (s *CreateDestinationInput) SetState(v string) *CreateDestinationInput { - s.State = &v - return s -} - -type CreateDestinationOutput struct { - _ struct{} `type:"structure"` - - // Destination ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Filters access by the destination's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // State of the destination. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"DestinationState"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 CreateDestinationOutput) 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 CreateDestinationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateDestinationOutput) SetArn(v string) *CreateDestinationOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateDestinationOutput) SetCreatedAt(v time.Time) *CreateDestinationOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateDestinationOutput) SetId(v string) *CreateDestinationOutput { - s.Id = &v - return s -} - -// SetState sets the State field's value. -func (s *CreateDestinationOutput) SetState(v string) *CreateDestinationOutput { - s.State = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateDestinationOutput) SetUpdatedAt(v time.Time) *CreateDestinationOutput { - s.UpdatedAt = &v - return s -} - -type CreateSiteInput struct { - _ struct{} `type:"structure"` - - // Token used for detecting replayed requests. Replayed requests will not be - // performed multiple times. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - // - // CountryCode is a required field - CountryCode *string `locationName:"countryCode" min:"2" type:"string" required:"true"` - - // A high-level description of the site. - Description *string `locationName:"description" type:"string"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 CreateSiteInput) 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 CreateSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSiteInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.CountryCode == nil { - invalidParams.Add(request.NewErrParamRequired("CountryCode")) - } - if s.CountryCode != nil && len(*s.CountryCode) < 2 { - invalidParams.Add(request.NewErrParamMinLen("CountryCode", 2)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateSiteInput) SetClientToken(v string) *CreateSiteInput { - s.ClientToken = &v - return s -} - -// SetCountryCode sets the CountryCode field's value. -func (s *CreateSiteInput) SetCountryCode(v string) *CreateSiteInput { - s.CountryCode = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateSiteInput) SetDescription(v string) *CreateSiteInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSiteInput) SetName(v string) *CreateSiteInput { - s.Name = &v - return s -} - -type CreateSiteOutput struct { - _ struct{} `type:"structure"` - - // Site ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Filters access by the site's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 CreateSiteOutput) 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 CreateSiteOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateSiteOutput) SetArn(v string) *CreateSiteOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateSiteOutput) SetCreatedAt(v time.Time) *CreateSiteOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSiteOutput) SetId(v string) *CreateSiteOutput { - s.Id = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateSiteOutput) SetUpdatedAt(v time.Time) *CreateSiteOutput { - s.UpdatedAt = &v - return s -} - -type CreateWorkerFleetInput struct { - _ struct{} `type:"structure"` - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Token used for detecting replayed requests. Replayed requests will not be - // performed multiple times. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" 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 CreateWorkerFleetInput) 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 CreateWorkerFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkerFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkerFleetInput"} - if s.AdditionalFixedProperties != nil && len(*s.AdditionalFixedProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalFixedProperties", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Site == nil { - invalidParams.Add(request.NewErrParamRequired("Site")) - } - if s.Site != nil && len(*s.Site) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Site", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *CreateWorkerFleetInput) SetAdditionalFixedProperties(v string) *CreateWorkerFleetInput { - s.AdditionalFixedProperties = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateWorkerFleetInput) SetClientToken(v string) *CreateWorkerFleetInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkerFleetInput) SetName(v string) *CreateWorkerFleetInput { - s.Name = &v - return s -} - -// SetSite sets the Site field's value. -func (s *CreateWorkerFleetInput) SetSite(v string) *CreateWorkerFleetInput { - s.Site = &v - return s -} - -type CreateWorkerFleetOutput struct { - _ struct{} `type:"structure"` - - // Full ARN of the worker fleet. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Filters access by the worker fleet's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 CreateWorkerFleetOutput) 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 CreateWorkerFleetOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateWorkerFleetOutput) SetArn(v string) *CreateWorkerFleetOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateWorkerFleetOutput) SetCreatedAt(v time.Time) *CreateWorkerFleetOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateWorkerFleetOutput) SetId(v string) *CreateWorkerFleetOutput { - s.Id = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateWorkerFleetOutput) SetUpdatedAt(v time.Time) *CreateWorkerFleetOutput { - s.UpdatedAt = &v - return s -} - -type CreateWorkerInput struct { - _ struct{} `type:"structure"` - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // JSON blob containing unstructured worker properties that are transient and - // may change during regular operation. - AdditionalTransientProperties *string `locationName:"additionalTransientProperties" min:"1" type:"string"` - - // Token used for detecting replayed requests. Replayed requests will not be - // performed multiple times. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Full ARN of the worker fleet. - // - // Fleet is a required field - Fleet *string `locationName:"fleet" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Worker orientation measured in units clockwise from north. - Orientation *Orientation `locationName:"orientation" type:"structure"` - - // Supported coordinates for worker position. - Position *PositionCoordinates `locationName:"position" type:"structure"` - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *VendorProperties `locationName:"vendorProperties" 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 CreateWorkerInput) 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 CreateWorkerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkerInput"} - if s.AdditionalFixedProperties != nil && len(*s.AdditionalFixedProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalFixedProperties", 1)) - } - if s.AdditionalTransientProperties != nil && len(*s.AdditionalTransientProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalTransientProperties", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Fleet == nil { - invalidParams.Add(request.NewErrParamRequired("Fleet")) - } - if s.Fleet != nil && len(*s.Fleet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Fleet", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Position != nil { - if err := s.Position.Validate(); err != nil { - invalidParams.AddNested("Position", err.(request.ErrInvalidParams)) - } - } - if s.VendorProperties != nil { - if err := s.VendorProperties.Validate(); err != nil { - invalidParams.AddNested("VendorProperties", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *CreateWorkerInput) SetAdditionalFixedProperties(v string) *CreateWorkerInput { - s.AdditionalFixedProperties = &v - return s -} - -// SetAdditionalTransientProperties sets the AdditionalTransientProperties field's value. -func (s *CreateWorkerInput) SetAdditionalTransientProperties(v string) *CreateWorkerInput { - s.AdditionalTransientProperties = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateWorkerInput) SetClientToken(v string) *CreateWorkerInput { - s.ClientToken = &v - return s -} - -// SetFleet sets the Fleet field's value. -func (s *CreateWorkerInput) SetFleet(v string) *CreateWorkerInput { - s.Fleet = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkerInput) SetName(v string) *CreateWorkerInput { - s.Name = &v - return s -} - -// SetOrientation sets the Orientation field's value. -func (s *CreateWorkerInput) SetOrientation(v *Orientation) *CreateWorkerInput { - s.Orientation = v - return s -} - -// SetPosition sets the Position field's value. -func (s *CreateWorkerInput) SetPosition(v *PositionCoordinates) *CreateWorkerInput { - s.Position = v - return s -} - -// SetVendorProperties sets the VendorProperties field's value. -func (s *CreateWorkerInput) SetVendorProperties(v *VendorProperties) *CreateWorkerInput { - s.VendorProperties = v - return s -} - -type CreateWorkerOutput struct { - _ struct{} `type:"structure"` - - // Full ARN of the worker. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Filters access by the workers identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 CreateWorkerOutput) 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 CreateWorkerOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateWorkerOutput) SetArn(v string) *CreateWorkerOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateWorkerOutput) SetCreatedAt(v time.Time) *CreateWorkerOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateWorkerOutput) SetId(v string) *CreateWorkerOutput { - s.Id = &v - return s -} - -// SetSite sets the Site field's value. -func (s *CreateWorkerOutput) SetSite(v string) *CreateWorkerOutput { - s.Site = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CreateWorkerOutput) SetUpdatedAt(v time.Time) *CreateWorkerOutput { - s.UpdatedAt = &v - return s -} - -type DeleteDestinationInput struct { - _ struct{} `type:"structure"` - - // Destination ARN. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 DeleteDestinationInput) 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 DeleteDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDestinationInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteDestinationInput) SetId(v string) *DeleteDestinationInput { - s.Id = &v - return s -} - -type DeleteDestinationOutput 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 DeleteDestinationOutput) 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 DeleteDestinationOutput) GoString() string { - return s.String() -} - -type DeleteSiteInput struct { - _ struct{} `type:"structure"` - - // Site ARN. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 DeleteSiteInput) 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 DeleteSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSiteInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteSiteInput) SetId(v string) *DeleteSiteInput { - s.Id = &v - return s -} - -type DeleteSiteOutput 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 DeleteSiteOutput) 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 DeleteSiteOutput) GoString() string { - return s.String() -} - -type DeleteWorkerFleetInput struct { - _ struct{} `type:"structure"` - - // Full ARN of the worker fleet. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 DeleteWorkerFleetInput) 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 DeleteWorkerFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkerFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkerFleetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteWorkerFleetInput) SetId(v string) *DeleteWorkerFleetInput { - s.Id = &v - return s -} - -type DeleteWorkerFleetOutput 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 DeleteWorkerFleetOutput) 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 DeleteWorkerFleetOutput) GoString() string { - return s.String() -} - -type DeleteWorkerInput struct { - _ struct{} `type:"structure"` - - // Full ARN of the worker. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 DeleteWorkerInput) 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 DeleteWorkerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkerInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteWorkerInput) SetId(v string) *DeleteWorkerInput { - s.Id = &v - return s -} - -type DeleteWorkerOutput 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 DeleteWorkerOutput) 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 DeleteWorkerOutput) GoString() string { - return s.String() -} - -// Area within a facility where work can be performed. -type Destination struct { - _ struct{} `type:"structure"` - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Destination ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Filters access by the destination's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" type:"string" required:"true"` - - // State of the destination. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"DestinationState"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 Destination) 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 Destination) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *Destination) SetAdditionalFixedProperties(v string) *Destination { - s.AdditionalFixedProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Destination) SetArn(v string) *Destination { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Destination) SetCreatedAt(v time.Time) *Destination { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *Destination) SetId(v string) *Destination { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *Destination) SetName(v string) *Destination { - s.Name = &v - return s -} - -// SetSite sets the Site field's value. -func (s *Destination) SetSite(v string) *Destination { - s.Site = &v - return s -} - -// SetState sets the State field's value. -func (s *Destination) SetState(v string) *Destination { - s.State = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Destination) SetUpdatedAt(v time.Time) *Destination { - s.UpdatedAt = &v - return s -} - -type GetDestinationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Destination ARN. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" min:"1" 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 GetDestinationInput) 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 GetDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDestinationInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetDestinationInput) SetId(v string) *GetDestinationInput { - s.Id = &v - return s -} - -type GetDestinationOutput struct { - _ struct{} `type:"structure"` - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Destination ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Filters access by the destination's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" type:"string" required:"true"` - - // State of the destination. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"DestinationState"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 GetDestinationOutput) 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 GetDestinationOutput) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *GetDestinationOutput) SetAdditionalFixedProperties(v string) *GetDestinationOutput { - s.AdditionalFixedProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetDestinationOutput) SetArn(v string) *GetDestinationOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetDestinationOutput) SetCreatedAt(v time.Time) *GetDestinationOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetDestinationOutput) SetId(v string) *GetDestinationOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetDestinationOutput) SetName(v string) *GetDestinationOutput { - s.Name = &v - return s -} - -// SetSite sets the Site field's value. -func (s *GetDestinationOutput) SetSite(v string) *GetDestinationOutput { - s.Site = &v - return s -} - -// SetState sets the State field's value. -func (s *GetDestinationOutput) SetState(v string) *GetDestinationOutput { - s.State = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetDestinationOutput) SetUpdatedAt(v time.Time) *GetDestinationOutput { - s.UpdatedAt = &v - return s -} - -type GetSiteInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Site ARN. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" min:"1" 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 GetSiteInput) 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 GetSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSiteInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetSiteInput) SetId(v string) *GetSiteInput { - s.Id = &v - return s -} - -type GetSiteOutput struct { - _ struct{} `type:"structure"` - - // Site ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - // - // CountryCode is a required field - CountryCode *string `locationName:"countryCode" min:"2" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // A high-level description of the site. - Description *string `locationName:"description" type:"string"` - - // Filters access by the site's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 GetSiteOutput) 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 GetSiteOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSiteOutput) SetArn(v string) *GetSiteOutput { - s.Arn = &v - return s -} - -// SetCountryCode sets the CountryCode field's value. -func (s *GetSiteOutput) SetCountryCode(v string) *GetSiteOutput { - s.CountryCode = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSiteOutput) SetCreatedAt(v time.Time) *GetSiteOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetSiteOutput) SetDescription(v string) *GetSiteOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSiteOutput) SetId(v string) *GetSiteOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetSiteOutput) SetName(v string) *GetSiteOutput { - s.Name = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetSiteOutput) SetUpdatedAt(v time.Time) *GetSiteOutput { - s.UpdatedAt = &v - return s -} - -type GetWorkerFleetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Full ARN of the worker fleet. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" min:"1" 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 GetWorkerFleetInput) 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 GetWorkerFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWorkerFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWorkerFleetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetWorkerFleetInput) SetId(v string) *GetWorkerFleetInput { - s.Id = &v - return s -} - -type GetWorkerFleetOutput struct { - _ struct{} `type:"structure"` - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Full ARN of the worker fleet. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Filters access by the worker fleet's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 GetWorkerFleetOutput) 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 GetWorkerFleetOutput) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *GetWorkerFleetOutput) SetAdditionalFixedProperties(v string) *GetWorkerFleetOutput { - s.AdditionalFixedProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetWorkerFleetOutput) SetArn(v string) *GetWorkerFleetOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetWorkerFleetOutput) SetCreatedAt(v time.Time) *GetWorkerFleetOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetWorkerFleetOutput) SetId(v string) *GetWorkerFleetOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetWorkerFleetOutput) SetName(v string) *GetWorkerFleetOutput { - s.Name = &v - return s -} - -// SetSite sets the Site field's value. -func (s *GetWorkerFleetOutput) SetSite(v string) *GetWorkerFleetOutput { - s.Site = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetWorkerFleetOutput) SetUpdatedAt(v time.Time) *GetWorkerFleetOutput { - s.UpdatedAt = &v - return s -} - -type GetWorkerInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Full ARN of the worker. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" min:"1" 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 GetWorkerInput) 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 GetWorkerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWorkerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWorkerInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetWorkerInput) SetId(v string) *GetWorkerInput { - s.Id = &v - return s -} - -type GetWorkerOutput struct { - _ struct{} `type:"structure"` - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // JSON blob containing unstructured worker properties that are transient and - // may change during regular operation. - AdditionalTransientProperties *string `locationName:"additionalTransientProperties" min:"1" type:"string"` - - // Full ARN of the worker. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Full ARN of the worker fleet. - // - // Fleet is a required field - Fleet *string `locationName:"fleet" min:"1" type:"string" required:"true"` - - // Filters access by the workers identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Worker orientation measured in units clockwise from north. - Orientation *Orientation `locationName:"orientation" type:"structure"` - - // Supported coordinates for worker position. - Position *PositionCoordinates `locationName:"position" type:"structure"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *VendorProperties `locationName:"vendorProperties" 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 GetWorkerOutput) 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 GetWorkerOutput) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *GetWorkerOutput) SetAdditionalFixedProperties(v string) *GetWorkerOutput { - s.AdditionalFixedProperties = &v - return s -} - -// SetAdditionalTransientProperties sets the AdditionalTransientProperties field's value. -func (s *GetWorkerOutput) SetAdditionalTransientProperties(v string) *GetWorkerOutput { - s.AdditionalTransientProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetWorkerOutput) SetArn(v string) *GetWorkerOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetWorkerOutput) SetCreatedAt(v time.Time) *GetWorkerOutput { - s.CreatedAt = &v - return s -} - -// SetFleet sets the Fleet field's value. -func (s *GetWorkerOutput) SetFleet(v string) *GetWorkerOutput { - s.Fleet = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetWorkerOutput) SetId(v string) *GetWorkerOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetWorkerOutput) SetName(v string) *GetWorkerOutput { - s.Name = &v - return s -} - -// SetOrientation sets the Orientation field's value. -func (s *GetWorkerOutput) SetOrientation(v *Orientation) *GetWorkerOutput { - s.Orientation = v - return s -} - -// SetPosition sets the Position field's value. -func (s *GetWorkerOutput) SetPosition(v *PositionCoordinates) *GetWorkerOutput { - s.Position = v - return s -} - -// SetSite sets the Site field's value. -func (s *GetWorkerOutput) SetSite(v string) *GetWorkerOutput { - s.Site = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetWorkerOutput) SetUpdatedAt(v time.Time) *GetWorkerOutput { - s.UpdatedAt = &v - return s -} - -// SetVendorProperties sets the VendorProperties field's value. -func (s *GetWorkerOutput) SetVendorProperties(v *VendorProperties) *GetWorkerOutput { - s.VendorProperties = v - return s -} - -// Exception thrown if something goes wrong within the service. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListDestinationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Maximum number of results to retrieve in a single call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Pagination token returned when another page of data exists. Provide it in - // your next call to the API to receive the next page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // Site ARN. - // - // Site is a required field - Site *string `location:"querystring" locationName:"site" min:"1" type:"string" required:"true"` - - // State of the destination. - State *string `location:"querystring" locationName:"state" type:"string" enum:"DestinationState"` -} - -// 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 ListDestinationsInput) 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 ListDestinationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDestinationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDestinationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Site == nil { - invalidParams.Add(request.NewErrParamRequired("Site")) - } - if s.Site != nil && len(*s.Site) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Site", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDestinationsInput) SetMaxResults(v int64) *ListDestinationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDestinationsInput) SetNextToken(v string) *ListDestinationsInput { - s.NextToken = &v - return s -} - -// SetSite sets the Site field's value. -func (s *ListDestinationsInput) SetSite(v string) *ListDestinationsInput { - s.Site = &v - return s -} - -// SetState sets the State field's value. -func (s *ListDestinationsInput) SetState(v string) *ListDestinationsInput { - s.State = &v - return s -} - -type ListDestinationsOutput struct { - _ struct{} `type:"structure"` - - // List of destinations. - Destinations []*Destination `locationName:"destinations" type:"list"` - - // Pagination token returned when another page of data exists. Provide it in - // your next call to the API to receive the next page. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDestinationsOutput) 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 ListDestinationsOutput) GoString() string { - return s.String() -} - -// SetDestinations sets the Destinations field's value. -func (s *ListDestinationsOutput) SetDestinations(v []*Destination) *ListDestinationsOutput { - s.Destinations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDestinationsOutput) SetNextToken(v string) *ListDestinationsOutput { - s.NextToken = &v - return s -} - -type ListSitesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Maximum number of results to retrieve in a single ListSites call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Pagination token returned when another page of data exists. Provide it in - // your next call to the API to receive the next page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListSitesInput) 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 ListSitesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSitesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSitesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSitesInput) SetMaxResults(v int64) *ListSitesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSitesInput) SetNextToken(v string) *ListSitesInput { - s.NextToken = &v - return s -} - -type ListSitesOutput struct { - _ struct{} `type:"structure"` - - // Pagination token returned when another page of data exists. Provide it in - // your next call to the API to receive the next page. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // List of facilities. - Sites []*Site `locationName:"sites" type:"list"` -} - -// 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 ListSitesOutput) 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 ListSitesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSitesOutput) SetNextToken(v string) *ListSitesOutput { - s.NextToken = &v - return s -} - -// SetSites sets the Sites field's value. -func (s *ListSitesOutput) SetSites(v []*Site) *ListSitesOutput { - s.Sites = v - return s -} - -type ListWorkerFleetsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Maximum number of results to retrieve in a single ListWorkerFleets call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Pagination token returned when another page of data exists. Provide it in - // your next call to the API to receive the next page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // Site ARN. - // - // Site is a required field - Site *string `location:"querystring" locationName:"site" min:"1" 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 ListWorkerFleetsInput) 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 ListWorkerFleetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkerFleetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkerFleetsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Site == nil { - invalidParams.Add(request.NewErrParamRequired("Site")) - } - if s.Site != nil && len(*s.Site) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Site", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkerFleetsInput) SetMaxResults(v int64) *ListWorkerFleetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkerFleetsInput) SetNextToken(v string) *ListWorkerFleetsInput { - s.NextToken = &v - return s -} - -// SetSite sets the Site field's value. -func (s *ListWorkerFleetsInput) SetSite(v string) *ListWorkerFleetsInput { - s.Site = &v - return s -} - -type ListWorkerFleetsOutput struct { - _ struct{} `type:"structure"` - - // Pagination token returned when another page of data exists. Provide it in - // your next call to the API to receive the next page. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // List of worker fleets. - WorkerFleets []*WorkerFleet `locationName:"workerFleets" type:"list"` -} - -// 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 ListWorkerFleetsOutput) 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 ListWorkerFleetsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkerFleetsOutput) SetNextToken(v string) *ListWorkerFleetsOutput { - s.NextToken = &v - return s -} - -// SetWorkerFleets sets the WorkerFleets field's value. -func (s *ListWorkerFleetsOutput) SetWorkerFleets(v []*WorkerFleet) *ListWorkerFleetsOutput { - s.WorkerFleets = v - return s -} - -type ListWorkersInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Full ARN of the worker fleet. - Fleet *string `location:"querystring" locationName:"fleet" min:"1" type:"string"` - - // Maximum number of results to retrieve in a single ListWorkers call. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Pagination token returned when another page of data exists. Provide it in - // your next call to the API to receive the next page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // Site ARN. - // - // Site is a required field - Site *string `location:"querystring" locationName:"site" min:"1" 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 ListWorkersInput) 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 ListWorkersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkersInput"} - if s.Fleet != nil && len(*s.Fleet) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Fleet", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Site == nil { - invalidParams.Add(request.NewErrParamRequired("Site")) - } - if s.Site != nil && len(*s.Site) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Site", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFleet sets the Fleet field's value. -func (s *ListWorkersInput) SetFleet(v string) *ListWorkersInput { - s.Fleet = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkersInput) SetMaxResults(v int64) *ListWorkersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkersInput) SetNextToken(v string) *ListWorkersInput { - s.NextToken = &v - return s -} - -// SetSite sets the Site field's value. -func (s *ListWorkersInput) SetSite(v string) *ListWorkersInput { - s.Site = &v - return s -} - -type ListWorkersOutput struct { - _ struct{} `type:"structure"` - - // Pagination token returned when another page of data exists. Provide it in - // your next call to the API to receive the next page. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // List of workers. - Workers []*Worker `locationName:"workers" type:"list"` -} - -// 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 ListWorkersOutput) 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 ListWorkersOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkersOutput) SetNextToken(v string) *ListWorkersOutput { - s.NextToken = &v - return s -} - -// SetWorkers sets the Workers field's value. -func (s *ListWorkersOutput) SetWorkers(v []*Worker) *ListWorkersOutput { - s.Workers = v - return s -} - -// Worker orientation measured in units clockwise from north. -type Orientation struct { - _ struct{} `type:"structure"` - - // Degrees, limited on [0, 360) - Degrees *float64 `locationName:"degrees" type:"double"` -} - -// 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 Orientation) 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 Orientation) GoString() string { - return s.String() -} - -// SetDegrees sets the Degrees field's value. -func (s *Orientation) SetDegrees(v float64) *Orientation { - s.Degrees = &v - return s -} - -// Supported coordinates for worker position. -type PositionCoordinates struct { - _ struct{} `type:"structure"` - - // Cartesian coordinates. - CartesianCoordinates *CartesianCoordinates `locationName:"cartesianCoordinates" 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 PositionCoordinates) 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 PositionCoordinates) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PositionCoordinates) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PositionCoordinates"} - if s.CartesianCoordinates != nil { - if err := s.CartesianCoordinates.Validate(); err != nil { - invalidParams.AddNested("CartesianCoordinates", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCartesianCoordinates sets the CartesianCoordinates field's value. -func (s *PositionCoordinates) SetCartesianCoordinates(v *CartesianCoordinates) *PositionCoordinates { - s.CartesianCoordinates = v - return s -} - -// Exception thrown if a resource referenced in the request doesn't exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Exception thrown if the user's AWS account has reached a service limit and -// the operation cannot proceed. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Facility containing destinations, workers, activities, and tasks. -type Site struct { - _ struct{} `type:"structure"` - - // Site ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - // - // CountryCode is a required field - CountryCode *string `locationName:"countryCode" min:"2" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // The name of the site. Mutable after creation and unique within a given account. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 Site) 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 Site) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Site) SetArn(v string) *Site { - s.Arn = &v - return s -} - -// SetCountryCode sets the CountryCode field's value. -func (s *Site) SetCountryCode(v string) *Site { - s.CountryCode = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Site) SetCreatedAt(v time.Time) *Site { - s.CreatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *Site) SetName(v string) *Site { - s.Name = &v - return s -} - -// Exception thrown if the api has been called too quickly be the client. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UpdateDestinationInput struct { - _ struct{} `type:"structure"` - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Destination ARN. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - Name *string `locationName:"name" min:"1" type:"string"` - - // State of the destination. - State *string `locationName:"state" type:"string" enum:"DestinationState"` -} - -// 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 UpdateDestinationInput) 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 UpdateDestinationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDestinationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDestinationInput"} - if s.AdditionalFixedProperties != nil && len(*s.AdditionalFixedProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalFixedProperties", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *UpdateDestinationInput) SetAdditionalFixedProperties(v string) *UpdateDestinationInput { - s.AdditionalFixedProperties = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateDestinationInput) SetId(v string) *UpdateDestinationInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDestinationInput) SetName(v string) *UpdateDestinationInput { - s.Name = &v - return s -} - -// SetState sets the State field's value. -func (s *UpdateDestinationInput) SetState(v string) *UpdateDestinationInput { - s.State = &v - return s -} - -type UpdateDestinationOutput struct { - _ struct{} `type:"structure"` - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Destination ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Filters access by the destination's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // State of the destination. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"DestinationState"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 UpdateDestinationOutput) 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 UpdateDestinationOutput) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *UpdateDestinationOutput) SetAdditionalFixedProperties(v string) *UpdateDestinationOutput { - s.AdditionalFixedProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *UpdateDestinationOutput) SetArn(v string) *UpdateDestinationOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateDestinationOutput) SetId(v string) *UpdateDestinationOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDestinationOutput) SetName(v string) *UpdateDestinationOutput { - s.Name = &v - return s -} - -// SetState sets the State field's value. -func (s *UpdateDestinationOutput) SetState(v string) *UpdateDestinationOutput { - s.State = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateDestinationOutput) SetUpdatedAt(v time.Time) *UpdateDestinationOutput { - s.UpdatedAt = &v - return s -} - -type UpdateSiteInput struct { - _ struct{} `type:"structure"` - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - CountryCode *string `locationName:"countryCode" min:"2" type:"string"` - - // A high-level description of the site. - Description *string `locationName:"description" type:"string"` - - // Site ARN. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - Name *string `locationName:"name" min:"1" 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 UpdateSiteInput) 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 UpdateSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSiteInput"} - if s.CountryCode != nil && len(*s.CountryCode) < 2 { - invalidParams.Add(request.NewErrParamMinLen("CountryCode", 2)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCountryCode sets the CountryCode field's value. -func (s *UpdateSiteInput) SetCountryCode(v string) *UpdateSiteInput { - s.CountryCode = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateSiteInput) SetDescription(v string) *UpdateSiteInput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateSiteInput) SetId(v string) *UpdateSiteInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSiteInput) SetName(v string) *UpdateSiteInput { - s.Name = &v - return s -} - -type UpdateSiteOutput struct { - _ struct{} `type:"structure"` - - // Site ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - CountryCode *string `locationName:"countryCode" min:"2" type:"string"` - - // A high-level description of the site. - Description *string `locationName:"description" type:"string"` - - // Filters access by the site's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 UpdateSiteOutput) 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 UpdateSiteOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateSiteOutput) SetArn(v string) *UpdateSiteOutput { - s.Arn = &v - return s -} - -// SetCountryCode sets the CountryCode field's value. -func (s *UpdateSiteOutput) SetCountryCode(v string) *UpdateSiteOutput { - s.CountryCode = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateSiteOutput) SetDescription(v string) *UpdateSiteOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateSiteOutput) SetId(v string) *UpdateSiteOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSiteOutput) SetName(v string) *UpdateSiteOutput { - s.Name = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateSiteOutput) SetUpdatedAt(v time.Time) *UpdateSiteOutput { - s.UpdatedAt = &v - return s -} - -type UpdateWorkerFleetInput struct { - _ struct{} `type:"structure"` - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Full ARN of the worker fleet. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - Name *string `locationName:"name" min:"1" 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 UpdateWorkerFleetInput) 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 UpdateWorkerFleetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWorkerFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWorkerFleetInput"} - if s.AdditionalFixedProperties != nil && len(*s.AdditionalFixedProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalFixedProperties", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *UpdateWorkerFleetInput) SetAdditionalFixedProperties(v string) *UpdateWorkerFleetInput { - s.AdditionalFixedProperties = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkerFleetInput) SetId(v string) *UpdateWorkerFleetInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkerFleetInput) SetName(v string) *UpdateWorkerFleetInput { - s.Name = &v - return s -} - -type UpdateWorkerFleetOutput struct { - _ struct{} `type:"structure"` - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Full ARN of the worker fleet. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Filters access by the worker fleet's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 UpdateWorkerFleetOutput) 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 UpdateWorkerFleetOutput) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *UpdateWorkerFleetOutput) SetAdditionalFixedProperties(v string) *UpdateWorkerFleetOutput { - s.AdditionalFixedProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *UpdateWorkerFleetOutput) SetArn(v string) *UpdateWorkerFleetOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkerFleetOutput) SetId(v string) *UpdateWorkerFleetOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkerFleetOutput) SetName(v string) *UpdateWorkerFleetOutput { - s.Name = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateWorkerFleetOutput) SetUpdatedAt(v time.Time) *UpdateWorkerFleetOutput { - s.UpdatedAt = &v - return s -} - -type UpdateWorkerInput struct { - _ struct{} `type:"structure"` - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // JSON blob containing unstructured worker properties that are transient and - // may change during regular operation. - AdditionalTransientProperties *string `locationName:"additionalTransientProperties" min:"1" type:"string"` - - // Full ARN of the worker. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - Name *string `locationName:"name" min:"1" type:"string"` - - // Worker orientation measured in units clockwise from north. - Orientation *Orientation `locationName:"orientation" type:"structure"` - - // Supported coordinates for worker position. - Position *PositionCoordinates `locationName:"position" type:"structure"` - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *VendorProperties `locationName:"vendorProperties" 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 UpdateWorkerInput) 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 UpdateWorkerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWorkerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWorkerInput"} - if s.AdditionalFixedProperties != nil && len(*s.AdditionalFixedProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalFixedProperties", 1)) - } - if s.AdditionalTransientProperties != nil && len(*s.AdditionalTransientProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalTransientProperties", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Position != nil { - if err := s.Position.Validate(); err != nil { - invalidParams.AddNested("Position", err.(request.ErrInvalidParams)) - } - } - if s.VendorProperties != nil { - if err := s.VendorProperties.Validate(); err != nil { - invalidParams.AddNested("VendorProperties", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *UpdateWorkerInput) SetAdditionalFixedProperties(v string) *UpdateWorkerInput { - s.AdditionalFixedProperties = &v - return s -} - -// SetAdditionalTransientProperties sets the AdditionalTransientProperties field's value. -func (s *UpdateWorkerInput) SetAdditionalTransientProperties(v string) *UpdateWorkerInput { - s.AdditionalTransientProperties = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkerInput) SetId(v string) *UpdateWorkerInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkerInput) SetName(v string) *UpdateWorkerInput { - s.Name = &v - return s -} - -// SetOrientation sets the Orientation field's value. -func (s *UpdateWorkerInput) SetOrientation(v *Orientation) *UpdateWorkerInput { - s.Orientation = v - return s -} - -// SetPosition sets the Position field's value. -func (s *UpdateWorkerInput) SetPosition(v *PositionCoordinates) *UpdateWorkerInput { - s.Position = v - return s -} - -// SetVendorProperties sets the VendorProperties field's value. -func (s *UpdateWorkerInput) SetVendorProperties(v *VendorProperties) *UpdateWorkerInput { - s.VendorProperties = v - return s -} - -type UpdateWorkerOutput struct { - _ struct{} `type:"structure"` - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // JSON blob containing unstructured worker properties that are transient and - // may change during regular operation. - AdditionalTransientProperties *string `locationName:"additionalTransientProperties" min:"1" type:"string"` - - // Full ARN of the worker. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Full ARN of the worker fleet. - // - // Fleet is a required field - Fleet *string `locationName:"fleet" min:"1" type:"string" required:"true"` - - // Filters access by the workers identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Worker orientation measured in units clockwise from north. - Orientation *Orientation `locationName:"orientation" type:"structure"` - - // Supported coordinates for worker position. - Position *PositionCoordinates `locationName:"position" type:"structure"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *VendorProperties `locationName:"vendorProperties" 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 UpdateWorkerOutput) 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 UpdateWorkerOutput) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *UpdateWorkerOutput) SetAdditionalFixedProperties(v string) *UpdateWorkerOutput { - s.AdditionalFixedProperties = &v - return s -} - -// SetAdditionalTransientProperties sets the AdditionalTransientProperties field's value. -func (s *UpdateWorkerOutput) SetAdditionalTransientProperties(v string) *UpdateWorkerOutput { - s.AdditionalTransientProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *UpdateWorkerOutput) SetArn(v string) *UpdateWorkerOutput { - s.Arn = &v - return s -} - -// SetFleet sets the Fleet field's value. -func (s *UpdateWorkerOutput) SetFleet(v string) *UpdateWorkerOutput { - s.Fleet = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkerOutput) SetId(v string) *UpdateWorkerOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkerOutput) SetName(v string) *UpdateWorkerOutput { - s.Name = &v - return s -} - -// SetOrientation sets the Orientation field's value. -func (s *UpdateWorkerOutput) SetOrientation(v *Orientation) *UpdateWorkerOutput { - s.Orientation = v - return s -} - -// SetPosition sets the Position field's value. -func (s *UpdateWorkerOutput) SetPosition(v *PositionCoordinates) *UpdateWorkerOutput { - s.Position = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateWorkerOutput) SetUpdatedAt(v time.Time) *UpdateWorkerOutput { - s.UpdatedAt = &v - return s -} - -// SetVendorProperties sets the VendorProperties field's value. -func (s *UpdateWorkerOutput) SetVendorProperties(v *VendorProperties) *UpdateWorkerOutput { - s.VendorProperties = v - return s -} - -// Exception thrown if an invalid parameter is provided to an API. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Properties of the worker that are provided by the vendor FMS. -type VendorProperties struct { - _ struct{} `type:"structure"` - - // JSON blob containing unstructured vendor properties that are fixed and won't - // change during regular operation. - VendorAdditionalFixedProperties *string `locationName:"vendorAdditionalFixedProperties" min:"1" type:"string"` - - // JSON blob containing unstructured vendor properties that are transient and - // may change during regular operation. - VendorAdditionalTransientProperties *string `locationName:"vendorAdditionalTransientProperties" min:"1" type:"string"` - - // The worker ID defined by the vendor FMS. - // - // VendorWorkerId is a required field - VendorWorkerId *string `locationName:"vendorWorkerId" min:"1" type:"string" required:"true"` - - // The worker IP address defined by the vendor FMS. - VendorWorkerIpAddress *string `locationName:"vendorWorkerIpAddress" min:"1" 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 VendorProperties) 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 VendorProperties) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VendorProperties) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VendorProperties"} - if s.VendorAdditionalFixedProperties != nil && len(*s.VendorAdditionalFixedProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VendorAdditionalFixedProperties", 1)) - } - if s.VendorAdditionalTransientProperties != nil && len(*s.VendorAdditionalTransientProperties) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VendorAdditionalTransientProperties", 1)) - } - if s.VendorWorkerId == nil { - invalidParams.Add(request.NewErrParamRequired("VendorWorkerId")) - } - if s.VendorWorkerId != nil && len(*s.VendorWorkerId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VendorWorkerId", 1)) - } - if s.VendorWorkerIpAddress != nil && len(*s.VendorWorkerIpAddress) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VendorWorkerIpAddress", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVendorAdditionalFixedProperties sets the VendorAdditionalFixedProperties field's value. -func (s *VendorProperties) SetVendorAdditionalFixedProperties(v string) *VendorProperties { - s.VendorAdditionalFixedProperties = &v - return s -} - -// SetVendorAdditionalTransientProperties sets the VendorAdditionalTransientProperties field's value. -func (s *VendorProperties) SetVendorAdditionalTransientProperties(v string) *VendorProperties { - s.VendorAdditionalTransientProperties = &v - return s -} - -// SetVendorWorkerId sets the VendorWorkerId field's value. -func (s *VendorProperties) SetVendorWorkerId(v string) *VendorProperties { - s.VendorWorkerId = &v - return s -} - -// SetVendorWorkerIpAddress sets the VendorWorkerIpAddress field's value. -func (s *VendorProperties) SetVendorWorkerIpAddress(v string) *VendorProperties { - s.VendorWorkerIpAddress = &v - return s -} - -// A unit capable of performing tasks. -type Worker struct { - _ struct{} `type:"structure"` - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // JSON blob containing unstructured worker properties that are transient and - // may change during regular operation. - AdditionalTransientProperties *string `locationName:"additionalTransientProperties" min:"1" type:"string"` - - // Full ARN of the worker. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Full ARN of the worker fleet. - // - // Fleet is a required field - Fleet *string `locationName:"fleet" min:"1" type:"string" required:"true"` - - // Filters access by the workers identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Worker orientation measured in units clockwise from north. - Orientation *Orientation `locationName:"orientation" type:"structure"` - - // Supported coordinates for worker position. - Position *PositionCoordinates `locationName:"position" type:"structure"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" required:"true"` - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *VendorProperties `locationName:"vendorProperties" 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 Worker) 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 Worker) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *Worker) SetAdditionalFixedProperties(v string) *Worker { - s.AdditionalFixedProperties = &v - return s -} - -// SetAdditionalTransientProperties sets the AdditionalTransientProperties field's value. -func (s *Worker) SetAdditionalTransientProperties(v string) *Worker { - s.AdditionalTransientProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Worker) SetArn(v string) *Worker { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Worker) SetCreatedAt(v time.Time) *Worker { - s.CreatedAt = &v - return s -} - -// SetFleet sets the Fleet field's value. -func (s *Worker) SetFleet(v string) *Worker { - s.Fleet = &v - return s -} - -// SetId sets the Id field's value. -func (s *Worker) SetId(v string) *Worker { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *Worker) SetName(v string) *Worker { - s.Name = &v - return s -} - -// SetOrientation sets the Orientation field's value. -func (s *Worker) SetOrientation(v *Orientation) *Worker { - s.Orientation = v - return s -} - -// SetPosition sets the Position field's value. -func (s *Worker) SetPosition(v *PositionCoordinates) *Worker { - s.Position = v - return s -} - -// SetSite sets the Site field's value. -func (s *Worker) SetSite(v string) *Worker { - s.Site = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Worker) SetUpdatedAt(v time.Time) *Worker { - s.UpdatedAt = &v - return s -} - -// SetVendorProperties sets the VendorProperties field's value. -func (s *Worker) SetVendorProperties(v *VendorProperties) *Worker { - s.VendorProperties = v - return s -} - -// A collection of workers organized within a facility. -type WorkerFleet struct { - _ struct{} `type:"structure"` - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string `locationName:"additionalFixedProperties" min:"1" type:"string"` - - // Full ARN of the worker fleet. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" required:"true"` - - // Filters access by the worker fleet's identifier - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // Human friendly name of the resource. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Site ARN. - // - // Site is a required field - Site *string `locationName:"site" min:"1" type:"string" required:"true"` - - // Timestamp at which the resource was last updated. - // - // UpdatedAt is a required field - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" 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 WorkerFleet) 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 WorkerFleet) GoString() string { - return s.String() -} - -// SetAdditionalFixedProperties sets the AdditionalFixedProperties field's value. -func (s *WorkerFleet) SetAdditionalFixedProperties(v string) *WorkerFleet { - s.AdditionalFixedProperties = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *WorkerFleet) SetArn(v string) *WorkerFleet { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *WorkerFleet) SetCreatedAt(v time.Time) *WorkerFleet { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *WorkerFleet) SetId(v string) *WorkerFleet { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *WorkerFleet) SetName(v string) *WorkerFleet { - s.Name = &v - return s -} - -// SetSite sets the Site field's value. -func (s *WorkerFleet) SetSite(v string) *WorkerFleet { - s.Site = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *WorkerFleet) SetUpdatedAt(v time.Time) *WorkerFleet { - s.UpdatedAt = &v - return s -} - -// State of the destination. -const ( - // DestinationStateEnabled is a DestinationState enum value - DestinationStateEnabled = "ENABLED" - - // DestinationStateDisabled is a DestinationState enum value - DestinationStateDisabled = "DISABLED" - - // DestinationStateDecommissioned is a DestinationState enum value - DestinationStateDecommissioned = "DECOMMISSIONED" -) - -// DestinationState_Values returns all elements of the DestinationState enum -func DestinationState_Values() []string { - return []string{ - DestinationStateEnabled, - DestinationStateDisabled, - DestinationStateDecommissioned, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/doc.go deleted file mode 100644 index dace9a9492c7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package iotroborunner provides the client and types for making API -// requests to AWS IoT RoboRunner. -// -// An example service, deployed with the Octane Service creator, which will -// echo the string -// -// See https://docs.aws.amazon.com/goto/WebAPI/iot-roborunner-2018-05-10 for more information on this service. -// -// See iotroborunner package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/iotroborunner/ -// -// # Using the Client -// -// To contact AWS IoT RoboRunner with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS IoT RoboRunner client IoTRoboRunner for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/iotroborunner/#New -package iotroborunner diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/errors.go deleted file mode 100644 index 2500f6a9904f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/errors.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package iotroborunner - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // User does not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Exception thrown if a resource in a create request already exists. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Exception thrown if something goes wrong within the service. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Exception thrown if a resource referenced in the request doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Exception thrown if the user's AWS account has reached a service limit and - // the operation cannot proceed. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // Exception thrown if the api has been called too quickly be the client. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Exception thrown if an invalid parameter is provided to an API. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/iotroborunneriface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/iotroborunneriface/interface.go deleted file mode 100644 index 140d007fb94d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/iotroborunneriface/interface.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package iotroborunneriface provides an interface to enable mocking the AWS IoT RoboRunner service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package iotroborunneriface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner" -) - -// IoTRoboRunnerAPI provides an interface to enable mocking the -// iotroborunner.IoTRoboRunner service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS IoT RoboRunner. -// func myFunc(svc iotroborunneriface.IoTRoboRunnerAPI) bool { -// // Make svc.CreateDestination request -// } -// -// func main() { -// sess := session.New() -// svc := iotroborunner.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockIoTRoboRunnerClient struct { -// iotroborunneriface.IoTRoboRunnerAPI -// } -// func (m *mockIoTRoboRunnerClient) CreateDestination(input *iotroborunner.CreateDestinationInput) (*iotroborunner.CreateDestinationOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockIoTRoboRunnerClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type IoTRoboRunnerAPI interface { - CreateDestination(*iotroborunner.CreateDestinationInput) (*iotroborunner.CreateDestinationOutput, error) - CreateDestinationWithContext(aws.Context, *iotroborunner.CreateDestinationInput, ...request.Option) (*iotroborunner.CreateDestinationOutput, error) - CreateDestinationRequest(*iotroborunner.CreateDestinationInput) (*request.Request, *iotroborunner.CreateDestinationOutput) - - CreateSite(*iotroborunner.CreateSiteInput) (*iotroborunner.CreateSiteOutput, error) - CreateSiteWithContext(aws.Context, *iotroborunner.CreateSiteInput, ...request.Option) (*iotroborunner.CreateSiteOutput, error) - CreateSiteRequest(*iotroborunner.CreateSiteInput) (*request.Request, *iotroborunner.CreateSiteOutput) - - CreateWorker(*iotroborunner.CreateWorkerInput) (*iotroborunner.CreateWorkerOutput, error) - CreateWorkerWithContext(aws.Context, *iotroborunner.CreateWorkerInput, ...request.Option) (*iotroborunner.CreateWorkerOutput, error) - CreateWorkerRequest(*iotroborunner.CreateWorkerInput) (*request.Request, *iotroborunner.CreateWorkerOutput) - - CreateWorkerFleet(*iotroborunner.CreateWorkerFleetInput) (*iotroborunner.CreateWorkerFleetOutput, error) - CreateWorkerFleetWithContext(aws.Context, *iotroborunner.CreateWorkerFleetInput, ...request.Option) (*iotroborunner.CreateWorkerFleetOutput, error) - CreateWorkerFleetRequest(*iotroborunner.CreateWorkerFleetInput) (*request.Request, *iotroborunner.CreateWorkerFleetOutput) - - DeleteDestination(*iotroborunner.DeleteDestinationInput) (*iotroborunner.DeleteDestinationOutput, error) - DeleteDestinationWithContext(aws.Context, *iotroborunner.DeleteDestinationInput, ...request.Option) (*iotroborunner.DeleteDestinationOutput, error) - DeleteDestinationRequest(*iotroborunner.DeleteDestinationInput) (*request.Request, *iotroborunner.DeleteDestinationOutput) - - DeleteSite(*iotroborunner.DeleteSiteInput) (*iotroborunner.DeleteSiteOutput, error) - DeleteSiteWithContext(aws.Context, *iotroborunner.DeleteSiteInput, ...request.Option) (*iotroborunner.DeleteSiteOutput, error) - DeleteSiteRequest(*iotroborunner.DeleteSiteInput) (*request.Request, *iotroborunner.DeleteSiteOutput) - - DeleteWorker(*iotroborunner.DeleteWorkerInput) (*iotroborunner.DeleteWorkerOutput, error) - DeleteWorkerWithContext(aws.Context, *iotroborunner.DeleteWorkerInput, ...request.Option) (*iotroborunner.DeleteWorkerOutput, error) - DeleteWorkerRequest(*iotroborunner.DeleteWorkerInput) (*request.Request, *iotroborunner.DeleteWorkerOutput) - - DeleteWorkerFleet(*iotroborunner.DeleteWorkerFleetInput) (*iotroborunner.DeleteWorkerFleetOutput, error) - DeleteWorkerFleetWithContext(aws.Context, *iotroborunner.DeleteWorkerFleetInput, ...request.Option) (*iotroborunner.DeleteWorkerFleetOutput, error) - DeleteWorkerFleetRequest(*iotroborunner.DeleteWorkerFleetInput) (*request.Request, *iotroborunner.DeleteWorkerFleetOutput) - - GetDestination(*iotroborunner.GetDestinationInput) (*iotroborunner.GetDestinationOutput, error) - GetDestinationWithContext(aws.Context, *iotroborunner.GetDestinationInput, ...request.Option) (*iotroborunner.GetDestinationOutput, error) - GetDestinationRequest(*iotroborunner.GetDestinationInput) (*request.Request, *iotroborunner.GetDestinationOutput) - - GetSite(*iotroborunner.GetSiteInput) (*iotroborunner.GetSiteOutput, error) - GetSiteWithContext(aws.Context, *iotroborunner.GetSiteInput, ...request.Option) (*iotroborunner.GetSiteOutput, error) - GetSiteRequest(*iotroborunner.GetSiteInput) (*request.Request, *iotroborunner.GetSiteOutput) - - GetWorker(*iotroborunner.GetWorkerInput) (*iotroborunner.GetWorkerOutput, error) - GetWorkerWithContext(aws.Context, *iotroborunner.GetWorkerInput, ...request.Option) (*iotroborunner.GetWorkerOutput, error) - GetWorkerRequest(*iotroborunner.GetWorkerInput) (*request.Request, *iotroborunner.GetWorkerOutput) - - GetWorkerFleet(*iotroborunner.GetWorkerFleetInput) (*iotroborunner.GetWorkerFleetOutput, error) - GetWorkerFleetWithContext(aws.Context, *iotroborunner.GetWorkerFleetInput, ...request.Option) (*iotroborunner.GetWorkerFleetOutput, error) - GetWorkerFleetRequest(*iotroborunner.GetWorkerFleetInput) (*request.Request, *iotroborunner.GetWorkerFleetOutput) - - ListDestinations(*iotroborunner.ListDestinationsInput) (*iotroborunner.ListDestinationsOutput, error) - ListDestinationsWithContext(aws.Context, *iotroborunner.ListDestinationsInput, ...request.Option) (*iotroborunner.ListDestinationsOutput, error) - ListDestinationsRequest(*iotroborunner.ListDestinationsInput) (*request.Request, *iotroborunner.ListDestinationsOutput) - - ListDestinationsPages(*iotroborunner.ListDestinationsInput, func(*iotroborunner.ListDestinationsOutput, bool) bool) error - ListDestinationsPagesWithContext(aws.Context, *iotroborunner.ListDestinationsInput, func(*iotroborunner.ListDestinationsOutput, bool) bool, ...request.Option) error - - ListSites(*iotroborunner.ListSitesInput) (*iotroborunner.ListSitesOutput, error) - ListSitesWithContext(aws.Context, *iotroborunner.ListSitesInput, ...request.Option) (*iotroborunner.ListSitesOutput, error) - ListSitesRequest(*iotroborunner.ListSitesInput) (*request.Request, *iotroborunner.ListSitesOutput) - - ListSitesPages(*iotroborunner.ListSitesInput, func(*iotroborunner.ListSitesOutput, bool) bool) error - ListSitesPagesWithContext(aws.Context, *iotroborunner.ListSitesInput, func(*iotroborunner.ListSitesOutput, bool) bool, ...request.Option) error - - ListWorkerFleets(*iotroborunner.ListWorkerFleetsInput) (*iotroborunner.ListWorkerFleetsOutput, error) - ListWorkerFleetsWithContext(aws.Context, *iotroborunner.ListWorkerFleetsInput, ...request.Option) (*iotroborunner.ListWorkerFleetsOutput, error) - ListWorkerFleetsRequest(*iotroborunner.ListWorkerFleetsInput) (*request.Request, *iotroborunner.ListWorkerFleetsOutput) - - ListWorkerFleetsPages(*iotroborunner.ListWorkerFleetsInput, func(*iotroborunner.ListWorkerFleetsOutput, bool) bool) error - ListWorkerFleetsPagesWithContext(aws.Context, *iotroborunner.ListWorkerFleetsInput, func(*iotroborunner.ListWorkerFleetsOutput, bool) bool, ...request.Option) error - - ListWorkers(*iotroborunner.ListWorkersInput) (*iotroborunner.ListWorkersOutput, error) - ListWorkersWithContext(aws.Context, *iotroborunner.ListWorkersInput, ...request.Option) (*iotroborunner.ListWorkersOutput, error) - ListWorkersRequest(*iotroborunner.ListWorkersInput) (*request.Request, *iotroborunner.ListWorkersOutput) - - ListWorkersPages(*iotroborunner.ListWorkersInput, func(*iotroborunner.ListWorkersOutput, bool) bool) error - ListWorkersPagesWithContext(aws.Context, *iotroborunner.ListWorkersInput, func(*iotroborunner.ListWorkersOutput, bool) bool, ...request.Option) error - - UpdateDestination(*iotroborunner.UpdateDestinationInput) (*iotroborunner.UpdateDestinationOutput, error) - UpdateDestinationWithContext(aws.Context, *iotroborunner.UpdateDestinationInput, ...request.Option) (*iotroborunner.UpdateDestinationOutput, error) - UpdateDestinationRequest(*iotroborunner.UpdateDestinationInput) (*request.Request, *iotroborunner.UpdateDestinationOutput) - - UpdateSite(*iotroborunner.UpdateSiteInput) (*iotroborunner.UpdateSiteOutput, error) - UpdateSiteWithContext(aws.Context, *iotroborunner.UpdateSiteInput, ...request.Option) (*iotroborunner.UpdateSiteOutput, error) - UpdateSiteRequest(*iotroborunner.UpdateSiteInput) (*request.Request, *iotroborunner.UpdateSiteOutput) - - UpdateWorker(*iotroborunner.UpdateWorkerInput) (*iotroborunner.UpdateWorkerOutput, error) - UpdateWorkerWithContext(aws.Context, *iotroborunner.UpdateWorkerInput, ...request.Option) (*iotroborunner.UpdateWorkerOutput, error) - UpdateWorkerRequest(*iotroborunner.UpdateWorkerInput) (*request.Request, *iotroborunner.UpdateWorkerOutput) - - UpdateWorkerFleet(*iotroborunner.UpdateWorkerFleetInput) (*iotroborunner.UpdateWorkerFleetOutput, error) - UpdateWorkerFleetWithContext(aws.Context, *iotroborunner.UpdateWorkerFleetInput, ...request.Option) (*iotroborunner.UpdateWorkerFleetOutput, error) - UpdateWorkerFleetRequest(*iotroborunner.UpdateWorkerFleetInput) (*request.Request, *iotroborunner.UpdateWorkerFleetOutput) -} - -var _ IoTRoboRunnerAPI = (*iotroborunner.IoTRoboRunner)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/service.go deleted file mode 100644 index 1c93ba322b42..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/iotroborunner/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package iotroborunner - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// IoTRoboRunner provides the API operation methods for making requests to -// AWS IoT RoboRunner. See this package's package overview docs -// for details on the service. -// -// IoTRoboRunner methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type IoTRoboRunner struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "IoT RoboRunner" // Name of service. - EndpointsID = "iotroborunner" // ID to lookup a service endpoint with. - ServiceID = "IoT RoboRunner" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the IoTRoboRunner client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a IoTRoboRunner client from just a session. -// svc := iotroborunner.New(mySession) -// -// // Create a IoTRoboRunner client with additional configuration -// svc := iotroborunner.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *IoTRoboRunner { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "iotroborunner" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *IoTRoboRunner { - svc := &IoTRoboRunner{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a IoTRoboRunner operation and runs any -// custom request initialization. -func (c *IoTRoboRunner) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/api.go deleted file mode 100644 index 34ea04a4bd31..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/api.go +++ /dev/null @@ -1,7906 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ivsrealtime - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateEncoderConfiguration = "CreateEncoderConfiguration" - -// CreateEncoderConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the CreateEncoderConfiguration 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 CreateEncoderConfiguration for more information on using the CreateEncoderConfiguration -// 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 CreateEncoderConfigurationRequest method. -// req, resp := client.CreateEncoderConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/CreateEncoderConfiguration -func (c *IVSRealTime) CreateEncoderConfigurationRequest(input *CreateEncoderConfigurationInput) (req *request.Request, output *CreateEncoderConfigurationOutput) { - op := &request.Operation{ - Name: opCreateEncoderConfiguration, - HTTPMethod: "POST", - HTTPPath: "/CreateEncoderConfiguration", - } - - if input == nil { - input = &CreateEncoderConfigurationInput{} - } - - output = &CreateEncoderConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEncoderConfiguration API operation for Amazon Interactive Video Service RealTime. -// -// Creates an EncoderConfiguration object. -// -// 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 Interactive Video Service RealTime's -// API operation CreateEncoderConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// - PendingVerification -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/CreateEncoderConfiguration -func (c *IVSRealTime) CreateEncoderConfiguration(input *CreateEncoderConfigurationInput) (*CreateEncoderConfigurationOutput, error) { - req, out := c.CreateEncoderConfigurationRequest(input) - return out, req.Send() -} - -// CreateEncoderConfigurationWithContext is the same as CreateEncoderConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEncoderConfiguration 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 *IVSRealTime) CreateEncoderConfigurationWithContext(ctx aws.Context, input *CreateEncoderConfigurationInput, opts ...request.Option) (*CreateEncoderConfigurationOutput, error) { - req, out := c.CreateEncoderConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateParticipantToken = "CreateParticipantToken" - -// CreateParticipantTokenRequest generates a "aws/request.Request" representing the -// client's request for the CreateParticipantToken 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 CreateParticipantToken for more information on using the CreateParticipantToken -// 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 CreateParticipantTokenRequest method. -// req, resp := client.CreateParticipantTokenRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/CreateParticipantToken -func (c *IVSRealTime) CreateParticipantTokenRequest(input *CreateParticipantTokenInput) (req *request.Request, output *CreateParticipantTokenOutput) { - op := &request.Operation{ - Name: opCreateParticipantToken, - HTTPMethod: "POST", - HTTPPath: "/CreateParticipantToken", - } - - if input == nil { - input = &CreateParticipantTokenInput{} - } - - output = &CreateParticipantTokenOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateParticipantToken API operation for Amazon Interactive Video Service RealTime. -// -// Creates an additional token for a specified stage. This can be done after -// stage creation or when tokens expire. Tokens always are scoped to the stage -// for which they are created. -// -// Encryption keys are owned by Amazon IVS and never used directly by your application. -// -// 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 Interactive Video Service RealTime's -// API operation CreateParticipantToken for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - ServiceQuotaExceededException -// -// - PendingVerification -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/CreateParticipantToken -func (c *IVSRealTime) CreateParticipantToken(input *CreateParticipantTokenInput) (*CreateParticipantTokenOutput, error) { - req, out := c.CreateParticipantTokenRequest(input) - return out, req.Send() -} - -// CreateParticipantTokenWithContext is the same as CreateParticipantToken with the addition of -// the ability to pass a context and additional request options. -// -// See CreateParticipantToken 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 *IVSRealTime) CreateParticipantTokenWithContext(ctx aws.Context, input *CreateParticipantTokenInput, opts ...request.Option) (*CreateParticipantTokenOutput, error) { - req, out := c.CreateParticipantTokenRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateStage = "CreateStage" - -// CreateStageRequest generates a "aws/request.Request" representing the -// client's request for the CreateStage 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 CreateStage for more information on using the CreateStage -// 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 CreateStageRequest method. -// req, resp := client.CreateStageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/CreateStage -func (c *IVSRealTime) CreateStageRequest(input *CreateStageInput) (req *request.Request, output *CreateStageOutput) { - op := &request.Operation{ - Name: opCreateStage, - HTTPMethod: "POST", - HTTPPath: "/CreateStage", - } - - if input == nil { - input = &CreateStageInput{} - } - - output = &CreateStageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateStage API operation for Amazon Interactive Video Service RealTime. -// -// Creates a new stage (and optionally participant tokens). -// -// 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 Interactive Video Service RealTime's -// API operation CreateStage for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// -// - AccessDeniedException -// -// - ServiceQuotaExceededException -// -// - PendingVerification -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/CreateStage -func (c *IVSRealTime) CreateStage(input *CreateStageInput) (*CreateStageOutput, error) { - req, out := c.CreateStageRequest(input) - return out, req.Send() -} - -// CreateStageWithContext is the same as CreateStage with the addition of -// the ability to pass a context and additional request options. -// -// See CreateStage 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 *IVSRealTime) CreateStageWithContext(ctx aws.Context, input *CreateStageInput, opts ...request.Option) (*CreateStageOutput, error) { - req, out := c.CreateStageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateStorageConfiguration = "CreateStorageConfiguration" - -// CreateStorageConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the CreateStorageConfiguration 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 CreateStorageConfiguration for more information on using the CreateStorageConfiguration -// 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 CreateStorageConfigurationRequest method. -// req, resp := client.CreateStorageConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/CreateStorageConfiguration -func (c *IVSRealTime) CreateStorageConfigurationRequest(input *CreateStorageConfigurationInput) (req *request.Request, output *CreateStorageConfigurationOutput) { - op := &request.Operation{ - Name: opCreateStorageConfiguration, - HTTPMethod: "POST", - HTTPPath: "/CreateStorageConfiguration", - } - - if input == nil { - input = &CreateStorageConfigurationInput{} - } - - output = &CreateStorageConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateStorageConfiguration API operation for Amazon Interactive Video Service RealTime. -// -// Creates a new storage configuration, used to enable recording to Amazon S3. -// When a StorageConfiguration is created, IVS will modify the S3 bucketPolicy -// of the provided bucket. This will ensure that IVS has sufficient permissions -// to write content to the provided bucket. -// -// 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 Interactive Video Service RealTime's -// API operation CreateStorageConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// - PendingVerification -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/CreateStorageConfiguration -func (c *IVSRealTime) CreateStorageConfiguration(input *CreateStorageConfigurationInput) (*CreateStorageConfigurationOutput, error) { - req, out := c.CreateStorageConfigurationRequest(input) - return out, req.Send() -} - -// CreateStorageConfigurationWithContext is the same as CreateStorageConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See CreateStorageConfiguration 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 *IVSRealTime) CreateStorageConfigurationWithContext(ctx aws.Context, input *CreateStorageConfigurationInput, opts ...request.Option) (*CreateStorageConfigurationOutput, error) { - req, out := c.CreateStorageConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEncoderConfiguration = "DeleteEncoderConfiguration" - -// DeleteEncoderConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEncoderConfiguration 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 DeleteEncoderConfiguration for more information on using the DeleteEncoderConfiguration -// 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 DeleteEncoderConfigurationRequest method. -// req, resp := client.DeleteEncoderConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/DeleteEncoderConfiguration -func (c *IVSRealTime) DeleteEncoderConfigurationRequest(input *DeleteEncoderConfigurationInput) (req *request.Request, output *DeleteEncoderConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteEncoderConfiguration, - HTTPMethod: "POST", - HTTPPath: "/DeleteEncoderConfiguration", - } - - if input == nil { - input = &DeleteEncoderConfigurationInput{} - } - - output = &DeleteEncoderConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEncoderConfiguration API operation for Amazon Interactive Video Service RealTime. -// -// Deletes an EncoderConfiguration resource. Ensures that no Compositions are -// using this template; otherwise, returns an error. -// -// 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 Interactive Video Service RealTime's -// API operation DeleteEncoderConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/DeleteEncoderConfiguration -func (c *IVSRealTime) DeleteEncoderConfiguration(input *DeleteEncoderConfigurationInput) (*DeleteEncoderConfigurationOutput, error) { - req, out := c.DeleteEncoderConfigurationRequest(input) - return out, req.Send() -} - -// DeleteEncoderConfigurationWithContext is the same as DeleteEncoderConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEncoderConfiguration 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 *IVSRealTime) DeleteEncoderConfigurationWithContext(ctx aws.Context, input *DeleteEncoderConfigurationInput, opts ...request.Option) (*DeleteEncoderConfigurationOutput, error) { - req, out := c.DeleteEncoderConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteStage = "DeleteStage" - -// DeleteStageRequest generates a "aws/request.Request" representing the -// client's request for the DeleteStage 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 DeleteStage for more information on using the DeleteStage -// 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 DeleteStageRequest method. -// req, resp := client.DeleteStageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/DeleteStage -func (c *IVSRealTime) DeleteStageRequest(input *DeleteStageInput) (req *request.Request, output *DeleteStageOutput) { - op := &request.Operation{ - Name: opDeleteStage, - HTTPMethod: "POST", - HTTPPath: "/DeleteStage", - } - - if input == nil { - input = &DeleteStageInput{} - } - - output = &DeleteStageOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteStage API operation for Amazon Interactive Video Service RealTime. -// -// Shuts down and deletes the specified stage (disconnecting all participants). -// -// 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 Interactive Video Service RealTime's -// API operation DeleteStage for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - ConflictException -// -// - PendingVerification -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/DeleteStage -func (c *IVSRealTime) DeleteStage(input *DeleteStageInput) (*DeleteStageOutput, error) { - req, out := c.DeleteStageRequest(input) - return out, req.Send() -} - -// DeleteStageWithContext is the same as DeleteStage with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteStage 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 *IVSRealTime) DeleteStageWithContext(ctx aws.Context, input *DeleteStageInput, opts ...request.Option) (*DeleteStageOutput, error) { - req, out := c.DeleteStageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteStorageConfiguration = "DeleteStorageConfiguration" - -// DeleteStorageConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteStorageConfiguration 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 DeleteStorageConfiguration for more information on using the DeleteStorageConfiguration -// 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 DeleteStorageConfigurationRequest method. -// req, resp := client.DeleteStorageConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/DeleteStorageConfiguration -func (c *IVSRealTime) DeleteStorageConfigurationRequest(input *DeleteStorageConfigurationInput) (req *request.Request, output *DeleteStorageConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteStorageConfiguration, - HTTPMethod: "POST", - HTTPPath: "/DeleteStorageConfiguration", - } - - if input == nil { - input = &DeleteStorageConfigurationInput{} - } - - output = &DeleteStorageConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteStorageConfiguration API operation for Amazon Interactive Video Service RealTime. -// -// Deletes the storage configuration for the specified ARN. -// -// If you try to delete a storage configuration that is used by a Composition, -// you will get an error (409 ConflictException). To avoid this, for all Compositions -// that reference the storage configuration, first use StopComposition and wait -// for it to complete, then use DeleteStorageConfiguration. -// -// 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 Interactive Video Service RealTime's -// API operation DeleteStorageConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/DeleteStorageConfiguration -func (c *IVSRealTime) DeleteStorageConfiguration(input *DeleteStorageConfigurationInput) (*DeleteStorageConfigurationOutput, error) { - req, out := c.DeleteStorageConfigurationRequest(input) - return out, req.Send() -} - -// DeleteStorageConfigurationWithContext is the same as DeleteStorageConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteStorageConfiguration 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 *IVSRealTime) DeleteStorageConfigurationWithContext(ctx aws.Context, input *DeleteStorageConfigurationInput, opts ...request.Option) (*DeleteStorageConfigurationOutput, error) { - req, out := c.DeleteStorageConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisconnectParticipant = "DisconnectParticipant" - -// DisconnectParticipantRequest generates a "aws/request.Request" representing the -// client's request for the DisconnectParticipant 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 DisconnectParticipant for more information on using the DisconnectParticipant -// 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 DisconnectParticipantRequest method. -// req, resp := client.DisconnectParticipantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/DisconnectParticipant -func (c *IVSRealTime) DisconnectParticipantRequest(input *DisconnectParticipantInput) (req *request.Request, output *DisconnectParticipantOutput) { - op := &request.Operation{ - Name: opDisconnectParticipant, - HTTPMethod: "POST", - HTTPPath: "/DisconnectParticipant", - } - - if input == nil { - input = &DisconnectParticipantInput{} - } - - output = &DisconnectParticipantOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisconnectParticipant API operation for Amazon Interactive Video Service RealTime. -// -// Disconnects a specified participant and revokes the participant permanently -// from a specified stage. -// -// 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 Interactive Video Service RealTime's -// API operation DisconnectParticipant for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - PendingVerification -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/DisconnectParticipant -func (c *IVSRealTime) DisconnectParticipant(input *DisconnectParticipantInput) (*DisconnectParticipantOutput, error) { - req, out := c.DisconnectParticipantRequest(input) - return out, req.Send() -} - -// DisconnectParticipantWithContext is the same as DisconnectParticipant with the addition of -// the ability to pass a context and additional request options. -// -// See DisconnectParticipant 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 *IVSRealTime) DisconnectParticipantWithContext(ctx aws.Context, input *DisconnectParticipantInput, opts ...request.Option) (*DisconnectParticipantOutput, error) { - req, out := c.DisconnectParticipantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetComposition = "GetComposition" - -// GetCompositionRequest generates a "aws/request.Request" representing the -// client's request for the GetComposition 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 GetComposition for more information on using the GetComposition -// 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 GetCompositionRequest method. -// req, resp := client.GetCompositionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetComposition -func (c *IVSRealTime) GetCompositionRequest(input *GetCompositionInput) (req *request.Request, output *GetCompositionOutput) { - op := &request.Operation{ - Name: opGetComposition, - HTTPMethod: "POST", - HTTPPath: "/GetComposition", - } - - if input == nil { - input = &GetCompositionInput{} - } - - output = &GetCompositionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetComposition API operation for Amazon Interactive Video Service RealTime. -// -// Get information about the specified Composition resource. -// -// 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 Interactive Video Service RealTime's -// API operation GetComposition for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetComposition -func (c *IVSRealTime) GetComposition(input *GetCompositionInput) (*GetCompositionOutput, error) { - req, out := c.GetCompositionRequest(input) - return out, req.Send() -} - -// GetCompositionWithContext is the same as GetComposition with the addition of -// the ability to pass a context and additional request options. -// -// See GetComposition 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 *IVSRealTime) GetCompositionWithContext(ctx aws.Context, input *GetCompositionInput, opts ...request.Option) (*GetCompositionOutput, error) { - req, out := c.GetCompositionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEncoderConfiguration = "GetEncoderConfiguration" - -// GetEncoderConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetEncoderConfiguration 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 GetEncoderConfiguration for more information on using the GetEncoderConfiguration -// 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 GetEncoderConfigurationRequest method. -// req, resp := client.GetEncoderConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetEncoderConfiguration -func (c *IVSRealTime) GetEncoderConfigurationRequest(input *GetEncoderConfigurationInput) (req *request.Request, output *GetEncoderConfigurationOutput) { - op := &request.Operation{ - Name: opGetEncoderConfiguration, - HTTPMethod: "POST", - HTTPPath: "/GetEncoderConfiguration", - } - - if input == nil { - input = &GetEncoderConfigurationInput{} - } - - output = &GetEncoderConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEncoderConfiguration API operation for Amazon Interactive Video Service RealTime. -// -// Gets information about the specified EncoderConfiguration resource. -// -// 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 Interactive Video Service RealTime's -// API operation GetEncoderConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetEncoderConfiguration -func (c *IVSRealTime) GetEncoderConfiguration(input *GetEncoderConfigurationInput) (*GetEncoderConfigurationOutput, error) { - req, out := c.GetEncoderConfigurationRequest(input) - return out, req.Send() -} - -// GetEncoderConfigurationWithContext is the same as GetEncoderConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetEncoderConfiguration 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 *IVSRealTime) GetEncoderConfigurationWithContext(ctx aws.Context, input *GetEncoderConfigurationInput, opts ...request.Option) (*GetEncoderConfigurationOutput, error) { - req, out := c.GetEncoderConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetParticipant = "GetParticipant" - -// GetParticipantRequest generates a "aws/request.Request" representing the -// client's request for the GetParticipant 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 GetParticipant for more information on using the GetParticipant -// 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 GetParticipantRequest method. -// req, resp := client.GetParticipantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetParticipant -func (c *IVSRealTime) GetParticipantRequest(input *GetParticipantInput) (req *request.Request, output *GetParticipantOutput) { - op := &request.Operation{ - Name: opGetParticipant, - HTTPMethod: "POST", - HTTPPath: "/GetParticipant", - } - - if input == nil { - input = &GetParticipantInput{} - } - - output = &GetParticipantOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetParticipant API operation for Amazon Interactive Video Service RealTime. -// -// Gets information about the specified participant token. -// -// 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 Interactive Video Service RealTime's -// API operation GetParticipant for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetParticipant -func (c *IVSRealTime) GetParticipant(input *GetParticipantInput) (*GetParticipantOutput, error) { - req, out := c.GetParticipantRequest(input) - return out, req.Send() -} - -// GetParticipantWithContext is the same as GetParticipant with the addition of -// the ability to pass a context and additional request options. -// -// See GetParticipant 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 *IVSRealTime) GetParticipantWithContext(ctx aws.Context, input *GetParticipantInput, opts ...request.Option) (*GetParticipantOutput, error) { - req, out := c.GetParticipantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetStage = "GetStage" - -// GetStageRequest generates a "aws/request.Request" representing the -// client's request for the GetStage 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 GetStage for more information on using the GetStage -// 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 GetStageRequest method. -// req, resp := client.GetStageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetStage -func (c *IVSRealTime) GetStageRequest(input *GetStageInput) (req *request.Request, output *GetStageOutput) { - op := &request.Operation{ - Name: opGetStage, - HTTPMethod: "POST", - HTTPPath: "/GetStage", - } - - if input == nil { - input = &GetStageInput{} - } - - output = &GetStageOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStage API operation for Amazon Interactive Video Service RealTime. -// -// Gets information for the specified stage. -// -// 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 Interactive Video Service RealTime's -// API operation GetStage for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetStage -func (c *IVSRealTime) GetStage(input *GetStageInput) (*GetStageOutput, error) { - req, out := c.GetStageRequest(input) - return out, req.Send() -} - -// GetStageWithContext is the same as GetStage with the addition of -// the ability to pass a context and additional request options. -// -// See GetStage 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 *IVSRealTime) GetStageWithContext(ctx aws.Context, input *GetStageInput, opts ...request.Option) (*GetStageOutput, error) { - req, out := c.GetStageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetStageSession = "GetStageSession" - -// GetStageSessionRequest generates a "aws/request.Request" representing the -// client's request for the GetStageSession 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 GetStageSession for more information on using the GetStageSession -// 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 GetStageSessionRequest method. -// req, resp := client.GetStageSessionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetStageSession -func (c *IVSRealTime) GetStageSessionRequest(input *GetStageSessionInput) (req *request.Request, output *GetStageSessionOutput) { - op := &request.Operation{ - Name: opGetStageSession, - HTTPMethod: "POST", - HTTPPath: "/GetStageSession", - } - - if input == nil { - input = &GetStageSessionInput{} - } - - output = &GetStageSessionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStageSession API operation for Amazon Interactive Video Service RealTime. -// -// Gets information for the specified stage session. -// -// 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 Interactive Video Service RealTime's -// API operation GetStageSession for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetStageSession -func (c *IVSRealTime) GetStageSession(input *GetStageSessionInput) (*GetStageSessionOutput, error) { - req, out := c.GetStageSessionRequest(input) - return out, req.Send() -} - -// GetStageSessionWithContext is the same as GetStageSession with the addition of -// the ability to pass a context and additional request options. -// -// See GetStageSession 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 *IVSRealTime) GetStageSessionWithContext(ctx aws.Context, input *GetStageSessionInput, opts ...request.Option) (*GetStageSessionOutput, error) { - req, out := c.GetStageSessionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetStorageConfiguration = "GetStorageConfiguration" - -// GetStorageConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetStorageConfiguration 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 GetStorageConfiguration for more information on using the GetStorageConfiguration -// 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 GetStorageConfigurationRequest method. -// req, resp := client.GetStorageConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetStorageConfiguration -func (c *IVSRealTime) GetStorageConfigurationRequest(input *GetStorageConfigurationInput) (req *request.Request, output *GetStorageConfigurationOutput) { - op := &request.Operation{ - Name: opGetStorageConfiguration, - HTTPMethod: "POST", - HTTPPath: "/GetStorageConfiguration", - } - - if input == nil { - input = &GetStorageConfigurationInput{} - } - - output = &GetStorageConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetStorageConfiguration API operation for Amazon Interactive Video Service RealTime. -// -// Gets the storage configuration for the specified ARN. -// -// 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 Interactive Video Service RealTime's -// API operation GetStorageConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/GetStorageConfiguration -func (c *IVSRealTime) GetStorageConfiguration(input *GetStorageConfigurationInput) (*GetStorageConfigurationOutput, error) { - req, out := c.GetStorageConfigurationRequest(input) - return out, req.Send() -} - -// GetStorageConfigurationWithContext is the same as GetStorageConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetStorageConfiguration 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 *IVSRealTime) GetStorageConfigurationWithContext(ctx aws.Context, input *GetStorageConfigurationInput, opts ...request.Option) (*GetStorageConfigurationOutput, error) { - req, out := c.GetStorageConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCompositions = "ListCompositions" - -// ListCompositionsRequest generates a "aws/request.Request" representing the -// client's request for the ListCompositions 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 ListCompositions for more information on using the ListCompositions -// 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 ListCompositionsRequest method. -// req, resp := client.ListCompositionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListCompositions -func (c *IVSRealTime) ListCompositionsRequest(input *ListCompositionsInput) (req *request.Request, output *ListCompositionsOutput) { - op := &request.Operation{ - Name: opListCompositions, - HTTPMethod: "POST", - HTTPPath: "/ListCompositions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCompositionsInput{} - } - - output = &ListCompositionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCompositions API operation for Amazon Interactive Video Service RealTime. -// -// Gets summary information about all Compositions in your account, in the AWS -// region where the API request is processed. -// -// 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 Interactive Video Service RealTime's -// API operation ListCompositions for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListCompositions -func (c *IVSRealTime) ListCompositions(input *ListCompositionsInput) (*ListCompositionsOutput, error) { - req, out := c.ListCompositionsRequest(input) - return out, req.Send() -} - -// ListCompositionsWithContext is the same as ListCompositions with the addition of -// the ability to pass a context and additional request options. -// -// See ListCompositions 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 *IVSRealTime) ListCompositionsWithContext(ctx aws.Context, input *ListCompositionsInput, opts ...request.Option) (*ListCompositionsOutput, error) { - req, out := c.ListCompositionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCompositionsPages iterates over the pages of a ListCompositions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCompositions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCompositions operation. -// pageNum := 0 -// err := client.ListCompositionsPages(params, -// func(page *ivsrealtime.ListCompositionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IVSRealTime) ListCompositionsPages(input *ListCompositionsInput, fn func(*ListCompositionsOutput, bool) bool) error { - return c.ListCompositionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCompositionsPagesWithContext same as ListCompositionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IVSRealTime) ListCompositionsPagesWithContext(ctx aws.Context, input *ListCompositionsInput, fn func(*ListCompositionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCompositionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCompositionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCompositionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEncoderConfigurations = "ListEncoderConfigurations" - -// ListEncoderConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListEncoderConfigurations 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 ListEncoderConfigurations for more information on using the ListEncoderConfigurations -// 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 ListEncoderConfigurationsRequest method. -// req, resp := client.ListEncoderConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListEncoderConfigurations -func (c *IVSRealTime) ListEncoderConfigurationsRequest(input *ListEncoderConfigurationsInput) (req *request.Request, output *ListEncoderConfigurationsOutput) { - op := &request.Operation{ - Name: opListEncoderConfigurations, - HTTPMethod: "POST", - HTTPPath: "/ListEncoderConfigurations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEncoderConfigurationsInput{} - } - - output = &ListEncoderConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEncoderConfigurations API operation for Amazon Interactive Video Service RealTime. -// -// Gets summary information about all EncoderConfigurations in your account, -// in the AWS region where the API request is processed. -// -// 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 Interactive Video Service RealTime's -// API operation ListEncoderConfigurations for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListEncoderConfigurations -func (c *IVSRealTime) ListEncoderConfigurations(input *ListEncoderConfigurationsInput) (*ListEncoderConfigurationsOutput, error) { - req, out := c.ListEncoderConfigurationsRequest(input) - return out, req.Send() -} - -// ListEncoderConfigurationsWithContext is the same as ListEncoderConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListEncoderConfigurations 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 *IVSRealTime) ListEncoderConfigurationsWithContext(ctx aws.Context, input *ListEncoderConfigurationsInput, opts ...request.Option) (*ListEncoderConfigurationsOutput, error) { - req, out := c.ListEncoderConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEncoderConfigurationsPages iterates over the pages of a ListEncoderConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEncoderConfigurations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEncoderConfigurations operation. -// pageNum := 0 -// err := client.ListEncoderConfigurationsPages(params, -// func(page *ivsrealtime.ListEncoderConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IVSRealTime) ListEncoderConfigurationsPages(input *ListEncoderConfigurationsInput, fn func(*ListEncoderConfigurationsOutput, bool) bool) error { - return c.ListEncoderConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEncoderConfigurationsPagesWithContext same as ListEncoderConfigurationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IVSRealTime) ListEncoderConfigurationsPagesWithContext(ctx aws.Context, input *ListEncoderConfigurationsInput, fn func(*ListEncoderConfigurationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEncoderConfigurationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEncoderConfigurationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEncoderConfigurationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListParticipantEvents = "ListParticipantEvents" - -// ListParticipantEventsRequest generates a "aws/request.Request" representing the -// client's request for the ListParticipantEvents 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 ListParticipantEvents for more information on using the ListParticipantEvents -// 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 ListParticipantEventsRequest method. -// req, resp := client.ListParticipantEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListParticipantEvents -func (c *IVSRealTime) ListParticipantEventsRequest(input *ListParticipantEventsInput) (req *request.Request, output *ListParticipantEventsOutput) { - op := &request.Operation{ - Name: opListParticipantEvents, - HTTPMethod: "POST", - HTTPPath: "/ListParticipantEvents", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListParticipantEventsInput{} - } - - output = &ListParticipantEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListParticipantEvents API operation for Amazon Interactive Video Service RealTime. -// -// Lists events for a specified participant that occurred during a specified -// stage session. -// -// 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 Interactive Video Service RealTime's -// API operation ListParticipantEvents for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListParticipantEvents -func (c *IVSRealTime) ListParticipantEvents(input *ListParticipantEventsInput) (*ListParticipantEventsOutput, error) { - req, out := c.ListParticipantEventsRequest(input) - return out, req.Send() -} - -// ListParticipantEventsWithContext is the same as ListParticipantEvents with the addition of -// the ability to pass a context and additional request options. -// -// See ListParticipantEvents 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 *IVSRealTime) ListParticipantEventsWithContext(ctx aws.Context, input *ListParticipantEventsInput, opts ...request.Option) (*ListParticipantEventsOutput, error) { - req, out := c.ListParticipantEventsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListParticipantEventsPages iterates over the pages of a ListParticipantEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListParticipantEvents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListParticipantEvents operation. -// pageNum := 0 -// err := client.ListParticipantEventsPages(params, -// func(page *ivsrealtime.ListParticipantEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IVSRealTime) ListParticipantEventsPages(input *ListParticipantEventsInput, fn func(*ListParticipantEventsOutput, bool) bool) error { - return c.ListParticipantEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListParticipantEventsPagesWithContext same as ListParticipantEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IVSRealTime) ListParticipantEventsPagesWithContext(ctx aws.Context, input *ListParticipantEventsInput, fn func(*ListParticipantEventsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListParticipantEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListParticipantEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListParticipantEventsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListParticipants = "ListParticipants" - -// ListParticipantsRequest generates a "aws/request.Request" representing the -// client's request for the ListParticipants 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 ListParticipants for more information on using the ListParticipants -// 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 ListParticipantsRequest method. -// req, resp := client.ListParticipantsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListParticipants -func (c *IVSRealTime) ListParticipantsRequest(input *ListParticipantsInput) (req *request.Request, output *ListParticipantsOutput) { - op := &request.Operation{ - Name: opListParticipants, - HTTPMethod: "POST", - HTTPPath: "/ListParticipants", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListParticipantsInput{} - } - - output = &ListParticipantsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListParticipants API operation for Amazon Interactive Video Service RealTime. -// -// Lists all participants in a specified stage session. -// -// 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 Interactive Video Service RealTime's -// API operation ListParticipants for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListParticipants -func (c *IVSRealTime) ListParticipants(input *ListParticipantsInput) (*ListParticipantsOutput, error) { - req, out := c.ListParticipantsRequest(input) - return out, req.Send() -} - -// ListParticipantsWithContext is the same as ListParticipants with the addition of -// the ability to pass a context and additional request options. -// -// See ListParticipants 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 *IVSRealTime) ListParticipantsWithContext(ctx aws.Context, input *ListParticipantsInput, opts ...request.Option) (*ListParticipantsOutput, error) { - req, out := c.ListParticipantsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListParticipantsPages iterates over the pages of a ListParticipants operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListParticipants method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListParticipants operation. -// pageNum := 0 -// err := client.ListParticipantsPages(params, -// func(page *ivsrealtime.ListParticipantsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IVSRealTime) ListParticipantsPages(input *ListParticipantsInput, fn func(*ListParticipantsOutput, bool) bool) error { - return c.ListParticipantsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListParticipantsPagesWithContext same as ListParticipantsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IVSRealTime) ListParticipantsPagesWithContext(ctx aws.Context, input *ListParticipantsInput, fn func(*ListParticipantsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListParticipantsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListParticipantsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListParticipantsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListStageSessions = "ListStageSessions" - -// ListStageSessionsRequest generates a "aws/request.Request" representing the -// client's request for the ListStageSessions 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 ListStageSessions for more information on using the ListStageSessions -// 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 ListStageSessionsRequest method. -// req, resp := client.ListStageSessionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListStageSessions -func (c *IVSRealTime) ListStageSessionsRequest(input *ListStageSessionsInput) (req *request.Request, output *ListStageSessionsOutput) { - op := &request.Operation{ - Name: opListStageSessions, - HTTPMethod: "POST", - HTTPPath: "/ListStageSessions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListStageSessionsInput{} - } - - output = &ListStageSessionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListStageSessions API operation for Amazon Interactive Video Service RealTime. -// -// Gets all sessions for a specified stage. -// -// 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 Interactive Video Service RealTime's -// API operation ListStageSessions for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// -// - AccessDeniedException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListStageSessions -func (c *IVSRealTime) ListStageSessions(input *ListStageSessionsInput) (*ListStageSessionsOutput, error) { - req, out := c.ListStageSessionsRequest(input) - return out, req.Send() -} - -// ListStageSessionsWithContext is the same as ListStageSessions with the addition of -// the ability to pass a context and additional request options. -// -// See ListStageSessions 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 *IVSRealTime) ListStageSessionsWithContext(ctx aws.Context, input *ListStageSessionsInput, opts ...request.Option) (*ListStageSessionsOutput, error) { - req, out := c.ListStageSessionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListStageSessionsPages iterates over the pages of a ListStageSessions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStageSessions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListStageSessions operation. -// pageNum := 0 -// err := client.ListStageSessionsPages(params, -// func(page *ivsrealtime.ListStageSessionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IVSRealTime) ListStageSessionsPages(input *ListStageSessionsInput, fn func(*ListStageSessionsOutput, bool) bool) error { - return c.ListStageSessionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStageSessionsPagesWithContext same as ListStageSessionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IVSRealTime) ListStageSessionsPagesWithContext(ctx aws.Context, input *ListStageSessionsInput, fn func(*ListStageSessionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListStageSessionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListStageSessionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListStageSessionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListStages = "ListStages" - -// ListStagesRequest generates a "aws/request.Request" representing the -// client's request for the ListStages 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 ListStages for more information on using the ListStages -// 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 ListStagesRequest method. -// req, resp := client.ListStagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListStages -func (c *IVSRealTime) ListStagesRequest(input *ListStagesInput) (req *request.Request, output *ListStagesOutput) { - op := &request.Operation{ - Name: opListStages, - HTTPMethod: "POST", - HTTPPath: "/ListStages", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListStagesInput{} - } - - output = &ListStagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListStages API operation for Amazon Interactive Video Service RealTime. -// -// Gets summary information about all stages in your account, in the AWS region -// where the API request is processed. -// -// 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 Interactive Video Service RealTime's -// API operation ListStages for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// -// - AccessDeniedException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListStages -func (c *IVSRealTime) ListStages(input *ListStagesInput) (*ListStagesOutput, error) { - req, out := c.ListStagesRequest(input) - return out, req.Send() -} - -// ListStagesWithContext is the same as ListStages with the addition of -// the ability to pass a context and additional request options. -// -// See ListStages 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 *IVSRealTime) ListStagesWithContext(ctx aws.Context, input *ListStagesInput, opts ...request.Option) (*ListStagesOutput, error) { - req, out := c.ListStagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListStagesPages iterates over the pages of a ListStages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStages method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListStages operation. -// pageNum := 0 -// err := client.ListStagesPages(params, -// func(page *ivsrealtime.ListStagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IVSRealTime) ListStagesPages(input *ListStagesInput, fn func(*ListStagesOutput, bool) bool) error { - return c.ListStagesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStagesPagesWithContext same as ListStagesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IVSRealTime) ListStagesPagesWithContext(ctx aws.Context, input *ListStagesInput, fn func(*ListStagesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListStagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListStagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListStagesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListStorageConfigurations = "ListStorageConfigurations" - -// ListStorageConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListStorageConfigurations 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 ListStorageConfigurations for more information on using the ListStorageConfigurations -// 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 ListStorageConfigurationsRequest method. -// req, resp := client.ListStorageConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListStorageConfigurations -func (c *IVSRealTime) ListStorageConfigurationsRequest(input *ListStorageConfigurationsInput) (req *request.Request, output *ListStorageConfigurationsOutput) { - op := &request.Operation{ - Name: opListStorageConfigurations, - HTTPMethod: "POST", - HTTPPath: "/ListStorageConfigurations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListStorageConfigurationsInput{} - } - - output = &ListStorageConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListStorageConfigurations API operation for Amazon Interactive Video Service RealTime. -// -// Gets summary information about all storage configurations in your account, -// in the AWS region where the API request is processed. -// -// 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 Interactive Video Service RealTime's -// API operation ListStorageConfigurations for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListStorageConfigurations -func (c *IVSRealTime) ListStorageConfigurations(input *ListStorageConfigurationsInput) (*ListStorageConfigurationsOutput, error) { - req, out := c.ListStorageConfigurationsRequest(input) - return out, req.Send() -} - -// ListStorageConfigurationsWithContext is the same as ListStorageConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListStorageConfigurations 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 *IVSRealTime) ListStorageConfigurationsWithContext(ctx aws.Context, input *ListStorageConfigurationsInput, opts ...request.Option) (*ListStorageConfigurationsOutput, error) { - req, out := c.ListStorageConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListStorageConfigurationsPages iterates over the pages of a ListStorageConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListStorageConfigurations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListStorageConfigurations operation. -// pageNum := 0 -// err := client.ListStorageConfigurationsPages(params, -// func(page *ivsrealtime.ListStorageConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *IVSRealTime) ListStorageConfigurationsPages(input *ListStorageConfigurationsInput, fn func(*ListStorageConfigurationsOutput, bool) bool) error { - return c.ListStorageConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListStorageConfigurationsPagesWithContext same as ListStorageConfigurationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *IVSRealTime) ListStorageConfigurationsPagesWithContext(ctx aws.Context, input *ListStorageConfigurationsInput, fn func(*ListStorageConfigurationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListStorageConfigurationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListStorageConfigurationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListStorageConfigurationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListTagsForResource -func (c *IVSRealTime) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Interactive Video Service RealTime. -// -// Gets information about AWS tags for the specified ARN. -// -// 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 Interactive Video Service RealTime's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - InternalServerException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/ListTagsForResource -func (c *IVSRealTime) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *IVSRealTime) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartComposition = "StartComposition" - -// StartCompositionRequest generates a "aws/request.Request" representing the -// client's request for the StartComposition 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 StartComposition for more information on using the StartComposition -// 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 StartCompositionRequest method. -// req, resp := client.StartCompositionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/StartComposition -func (c *IVSRealTime) StartCompositionRequest(input *StartCompositionInput) (req *request.Request, output *StartCompositionOutput) { - op := &request.Operation{ - Name: opStartComposition, - HTTPMethod: "POST", - HTTPPath: "/StartComposition", - } - - if input == nil { - input = &StartCompositionInput{} - } - - output = &StartCompositionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartComposition API operation for Amazon Interactive Video Service RealTime. -// -// Starts a Composition from a stage based on the configuration provided in -// the request. -// -// A Composition is an ephemeral resource that exists after this endpoint returns -// successfully. Composition stops and the resource is deleted: -// -// - When StopComposition is called. -// -// - After a 1-minute timeout, when all participants are disconnected from -// the stage. -// -// - After a 1-minute timeout, if there are no participants in the stage -// when StartComposition is called. -// -// - When broadcasting to the IVS channel fails and all retries are exhausted. -// -// - When broadcasting is disconnected and all attempts to reconnect are -// exhausted. -// -// 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 Interactive Video Service RealTime's -// API operation StartComposition for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// - PendingVerification -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/StartComposition -func (c *IVSRealTime) StartComposition(input *StartCompositionInput) (*StartCompositionOutput, error) { - req, out := c.StartCompositionRequest(input) - return out, req.Send() -} - -// StartCompositionWithContext is the same as StartComposition with the addition of -// the ability to pass a context and additional request options. -// -// See StartComposition 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 *IVSRealTime) StartCompositionWithContext(ctx aws.Context, input *StartCompositionInput, opts ...request.Option) (*StartCompositionOutput, error) { - req, out := c.StartCompositionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopComposition = "StopComposition" - -// StopCompositionRequest generates a "aws/request.Request" representing the -// client's request for the StopComposition 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 StopComposition for more information on using the StopComposition -// 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 StopCompositionRequest method. -// req, resp := client.StopCompositionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/StopComposition -func (c *IVSRealTime) StopCompositionRequest(input *StopCompositionInput) (req *request.Request, output *StopCompositionOutput) { - op := &request.Operation{ - Name: opStopComposition, - HTTPMethod: "POST", - HTTPPath: "/StopComposition", - } - - if input == nil { - input = &StopCompositionInput{} - } - - output = &StopCompositionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopComposition API operation for Amazon Interactive Video Service RealTime. -// -// Stops and deletes a Composition resource. Any broadcast from the Composition -// resource is stopped. -// -// 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 Interactive Video Service RealTime's -// API operation StopComposition for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - InternalServerException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/StopComposition -func (c *IVSRealTime) StopComposition(input *StopCompositionInput) (*StopCompositionOutput, error) { - req, out := c.StopCompositionRequest(input) - return out, req.Send() -} - -// StopCompositionWithContext is the same as StopComposition with the addition of -// the ability to pass a context and additional request options. -// -// See StopComposition 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 *IVSRealTime) StopCompositionWithContext(ctx aws.Context, input *StopCompositionInput, opts ...request.Option) (*StopCompositionOutput, error) { - req, out := c.StopCompositionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/TagResource -func (c *IVSRealTime) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon Interactive Video Service RealTime. -// -// Adds or updates tags for the AWS resource with the specified ARN. -// -// 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 Interactive Video Service RealTime's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - InternalServerException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/TagResource -func (c *IVSRealTime) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *IVSRealTime) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/UntagResource -func (c *IVSRealTime) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon Interactive Video Service RealTime. -// -// Removes tags from the resource with the specified ARN. -// -// 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 Interactive Video Service RealTime's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - InternalServerException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/UntagResource -func (c *IVSRealTime) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *IVSRealTime) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateStage = "UpdateStage" - -// UpdateStageRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStage 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 UpdateStage for more information on using the UpdateStage -// 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 UpdateStageRequest method. -// req, resp := client.UpdateStageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/UpdateStage -func (c *IVSRealTime) UpdateStageRequest(input *UpdateStageInput) (req *request.Request, output *UpdateStageOutput) { - op := &request.Operation{ - Name: opUpdateStage, - HTTPMethod: "POST", - HTTPPath: "/UpdateStage", - } - - if input == nil { - input = &UpdateStageInput{} - } - - output = &UpdateStageOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateStage API operation for Amazon Interactive Video Service RealTime. -// -// Updates a stage’s configuration. -// -// 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 Interactive Video Service RealTime's -// API operation UpdateStage for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// - AccessDeniedException -// -// - ServiceQuotaExceededException -// -// - PendingVerification -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14/UpdateStage -func (c *IVSRealTime) UpdateStage(input *UpdateStageInput) (*UpdateStageOutput, error) { - req, out := c.UpdateStageRequest(input) - return out, req.Send() -} - -// UpdateStageWithContext is the same as UpdateStage with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateStage 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 *IVSRealTime) UpdateStageWithContext(ctx aws.Context, input *UpdateStageInput, opts ...request.Option) (*UpdateStageOutput, error) { - req, out := c.UpdateStageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // User does not have sufficient access to perform this action. - ExceptionMessage *string `locationName:"exceptionMessage" type:"string"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Object specifying a channel as a destination. -type ChannelDestinationConfiguration struct { - _ struct{} `type:"structure"` - - // ARN of the channel to use for broadcasting. The channel and stage resources - // must be in the same AWS account and region. The channel must be offline (not - // broadcasting). - // - // ChannelArn is a required field - ChannelArn *string `locationName:"channelArn" min:"1" type:"string" required:"true"` - - // ARN of the EncoderConfiguration resource. The encoder configuration and stage - // resources must be in the same AWS account and region. - EncoderConfigurationArn *string `locationName:"encoderConfigurationArn" min:"1" 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 ChannelDestinationConfiguration) 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 ChannelDestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChannelDestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChannelDestinationConfiguration"} - if s.ChannelArn == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelArn")) - } - if s.ChannelArn != nil && len(*s.ChannelArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelArn", 1)) - } - if s.EncoderConfigurationArn != nil && len(*s.EncoderConfigurationArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EncoderConfigurationArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelArn sets the ChannelArn field's value. -func (s *ChannelDestinationConfiguration) SetChannelArn(v string) *ChannelDestinationConfiguration { - s.ChannelArn = &v - return s -} - -// SetEncoderConfigurationArn sets the EncoderConfigurationArn field's value. -func (s *ChannelDestinationConfiguration) SetEncoderConfigurationArn(v string) *ChannelDestinationConfiguration { - s.EncoderConfigurationArn = &v - return s -} - -// Object specifying a Composition resource. -type Composition struct { - _ struct{} `type:"structure"` - - // ARN of the Composition resource. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Array of Destination objects. A Composition can contain either one destination - // (channel or s3) or two (one channel and one s3). - // - // Destinations is a required field - Destinations []*Destination `locationName:"destinations" min:"1" type:"list" required:"true"` - - // UTC time of the Composition end. This is an ISO 8601 timestamp; note that - // this is returned as a string. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // Layout object to configure composition parameters. - // - // Layout is a required field - Layout *LayoutConfiguration `locationName:"layout" type:"structure" required:"true"` - - // ARN of the stage used as input - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" type:"string" required:"true"` - - // UTC time of the Composition start. This is an ISO 8601 timestamp; note that - // this is returned as a string. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // State of the Composition. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"CompositionState"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 Composition) 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 Composition) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Composition) SetArn(v string) *Composition { - s.Arn = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *Composition) SetDestinations(v []*Destination) *Composition { - s.Destinations = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *Composition) SetEndTime(v time.Time) *Composition { - s.EndTime = &v - return s -} - -// SetLayout sets the Layout field's value. -func (s *Composition) SetLayout(v *LayoutConfiguration) *Composition { - s.Layout = v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *Composition) SetStageArn(v string) *Composition { - s.StageArn = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Composition) SetStartTime(v time.Time) *Composition { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *Composition) SetState(v string) *Composition { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Composition) SetTags(v map[string]*string) *Composition { - s.Tags = v - return s -} - -// Summary information about a Composition. -type CompositionSummary struct { - _ struct{} `type:"structure"` - - // ARN of the Composition resource. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Array of Destination objects. - // - // Destinations is a required field - Destinations []*DestinationSummary `locationName:"destinations" min:"1" type:"list" required:"true"` - - // UTC time of the Composition end. This is an ISO 8601 timestamp; note that - // this is returned as a string. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // ARN of the attached stage. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" type:"string" required:"true"` - - // UTC time of the Composition start. This is an ISO 8601 timestamp; note that - // this is returned as a string. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // State of the Composition resource. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"CompositionState"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CompositionSummary) 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 CompositionSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CompositionSummary) SetArn(v string) *CompositionSummary { - s.Arn = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *CompositionSummary) SetDestinations(v []*DestinationSummary) *CompositionSummary { - s.Destinations = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *CompositionSummary) SetEndTime(v time.Time) *CompositionSummary { - s.EndTime = &v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *CompositionSummary) SetStageArn(v string) *CompositionSummary { - s.StageArn = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *CompositionSummary) SetStartTime(v time.Time) *CompositionSummary { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *CompositionSummary) SetState(v string) *CompositionSummary { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CompositionSummary) SetTags(v map[string]*string) *CompositionSummary { - s.Tags = v - return s -} - -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Updating or deleting a resource can cause an inconsistent state. - ExceptionMessage *string `locationName:"exceptionMessage" type:"string"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateEncoderConfigurationInput struct { - _ struct{} `type:"structure"` - - // Optional name to identify the resource. - Name *string `locationName:"name" type:"string"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` - - // Video configuration. Default: video resolution 1280x720, bitrate 2500 kbps, - // 30 fps. - Video *Video `locationName:"video" 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 CreateEncoderConfigurationInput) 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 CreateEncoderConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEncoderConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEncoderConfigurationInput"} - if s.Video != nil { - if err := s.Video.Validate(); err != nil { - invalidParams.AddNested("Video", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateEncoderConfigurationInput) SetName(v string) *CreateEncoderConfigurationInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateEncoderConfigurationInput) SetTags(v map[string]*string) *CreateEncoderConfigurationInput { - s.Tags = v - return s -} - -// SetVideo sets the Video field's value. -func (s *CreateEncoderConfigurationInput) SetVideo(v *Video) *CreateEncoderConfigurationInput { - s.Video = v - return s -} - -type CreateEncoderConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The EncoderConfiguration that was created. - EncoderConfiguration *EncoderConfiguration `locationName:"encoderConfiguration" 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 CreateEncoderConfigurationOutput) 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 CreateEncoderConfigurationOutput) GoString() string { - return s.String() -} - -// SetEncoderConfiguration sets the EncoderConfiguration field's value. -func (s *CreateEncoderConfigurationOutput) SetEncoderConfiguration(v *EncoderConfiguration) *CreateEncoderConfigurationOutput { - s.EncoderConfiguration = v - return s -} - -type CreateParticipantTokenInput struct { - _ struct{} `type:"structure"` - - // Application-provided attributes to encode into the token and attach to a - // stage. Map keys and values can contain UTF-8 encoded text. The maximum length - // of this field is 1 KB total. This field is exposed to all stage participants - // and should not be used for personally identifying, confidential, or sensitive - // information. - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // Set of capabilities that the user is allowed to perform in the stage. Default: - // PUBLISH, SUBSCRIBE. - Capabilities []*string `locationName:"capabilities" type:"list" enum:"ParticipantTokenCapability"` - - // Duration (in minutes), after which the token expires. Default: 720 (12 hours). - Duration *int64 `locationName:"duration" min:"1" type:"integer"` - - // ARN of the stage to which this token is scoped. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" type:"string" required:"true"` - - // Name that can be specified to help identify the token. This can be any UTF-8 - // encoded text. This field is exposed to all stage participants and should - // not be used for personally identifying, confidential, or sensitive information. - UserId *string `locationName:"userId" 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 CreateParticipantTokenInput) 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 CreateParticipantTokenInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateParticipantTokenInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateParticipantTokenInput"} - if s.Duration != nil && *s.Duration < 1 { - invalidParams.Add(request.NewErrParamMinValue("Duration", 1)) - } - if s.StageArn == nil { - invalidParams.Add(request.NewErrParamRequired("StageArn")) - } - if s.StageArn != nil && len(*s.StageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *CreateParticipantTokenInput) SetAttributes(v map[string]*string) *CreateParticipantTokenInput { - s.Attributes = v - return s -} - -// SetCapabilities sets the Capabilities field's value. -func (s *CreateParticipantTokenInput) SetCapabilities(v []*string) *CreateParticipantTokenInput { - s.Capabilities = v - return s -} - -// SetDuration sets the Duration field's value. -func (s *CreateParticipantTokenInput) SetDuration(v int64) *CreateParticipantTokenInput { - s.Duration = &v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *CreateParticipantTokenInput) SetStageArn(v string) *CreateParticipantTokenInput { - s.StageArn = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *CreateParticipantTokenInput) SetUserId(v string) *CreateParticipantTokenInput { - s.UserId = &v - return s -} - -type CreateParticipantTokenOutput struct { - _ struct{} `type:"structure"` - - // The participant token that was created. - ParticipantToken *ParticipantToken `locationName:"participantToken" 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 CreateParticipantTokenOutput) 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 CreateParticipantTokenOutput) GoString() string { - return s.String() -} - -// SetParticipantToken sets the ParticipantToken field's value. -func (s *CreateParticipantTokenOutput) SetParticipantToken(v *ParticipantToken) *CreateParticipantTokenOutput { - s.ParticipantToken = v - return s -} - -type CreateStageInput struct { - _ struct{} `type:"structure"` - - // Optional name that can be specified for the stage being created. - Name *string `locationName:"name" type:"string"` - - // Array of participant token configuration objects to attach to the new stage. - ParticipantTokenConfigurations []*ParticipantTokenConfiguration `locationName:"participantTokenConfigurations" type:"list"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateStageInput) 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 CreateStageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStageInput"} - if s.ParticipantTokenConfigurations != nil { - for i, v := range s.ParticipantTokenConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ParticipantTokenConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateStageInput) SetName(v string) *CreateStageInput { - s.Name = &v - return s -} - -// SetParticipantTokenConfigurations sets the ParticipantTokenConfigurations field's value. -func (s *CreateStageInput) SetParticipantTokenConfigurations(v []*ParticipantTokenConfiguration) *CreateStageInput { - s.ParticipantTokenConfigurations = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateStageInput) SetTags(v map[string]*string) *CreateStageInput { - s.Tags = v - return s -} - -type CreateStageOutput struct { - _ struct{} `type:"structure"` - - // Participant tokens attached to the stage. These correspond to the participants - // in the request. - ParticipantTokens []*ParticipantToken `locationName:"participantTokens" type:"list"` - - // The stage that was created. - Stage *Stage `locationName:"stage" 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 CreateStageOutput) 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 CreateStageOutput) GoString() string { - return s.String() -} - -// SetParticipantTokens sets the ParticipantTokens field's value. -func (s *CreateStageOutput) SetParticipantTokens(v []*ParticipantToken) *CreateStageOutput { - s.ParticipantTokens = v - return s -} - -// SetStage sets the Stage field's value. -func (s *CreateStageOutput) SetStage(v *Stage) *CreateStageOutput { - s.Stage = v - return s -} - -type CreateStorageConfigurationInput struct { - _ struct{} `type:"structure"` - - // Storage configuration name. The value does not need to be unique. - Name *string `locationName:"name" type:"string"` - - // A complex type that contains a storage configuration for where recorded video - // will be stored. - // - // S3 is a required field - S3 *S3StorageConfiguration `locationName:"s3" type:"structure" required:"true"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateStorageConfigurationInput) 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 CreateStorageConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateStorageConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateStorageConfigurationInput"} - if s.S3 == nil { - invalidParams.Add(request.NewErrParamRequired("S3")) - } - if s.S3 != nil { - if err := s.S3.Validate(); err != nil { - invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateStorageConfigurationInput) SetName(v string) *CreateStorageConfigurationInput { - s.Name = &v - return s -} - -// SetS3 sets the S3 field's value. -func (s *CreateStorageConfigurationInput) SetS3(v *S3StorageConfiguration) *CreateStorageConfigurationInput { - s.S3 = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateStorageConfigurationInput) SetTags(v map[string]*string) *CreateStorageConfigurationInput { - s.Tags = v - return s -} - -type CreateStorageConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The StorageConfiguration that was created. - StorageConfiguration *StorageConfiguration `locationName:"storageConfiguration" 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 CreateStorageConfigurationOutput) 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 CreateStorageConfigurationOutput) GoString() string { - return s.String() -} - -// SetStorageConfiguration sets the StorageConfiguration field's value. -func (s *CreateStorageConfigurationOutput) SetStorageConfiguration(v *StorageConfiguration) *CreateStorageConfigurationOutput { - s.StorageConfiguration = v - return s -} - -type DeleteEncoderConfigurationInput struct { - _ struct{} `type:"structure"` - - // ARN of the EncoderConfiguration. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 DeleteEncoderConfigurationInput) 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 DeleteEncoderConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEncoderConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEncoderConfigurationInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *DeleteEncoderConfigurationInput) SetArn(v string) *DeleteEncoderConfigurationInput { - s.Arn = &v - return s -} - -type DeleteEncoderConfigurationOutput 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 DeleteEncoderConfigurationOutput) 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 DeleteEncoderConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteStageInput struct { - _ struct{} `type:"structure"` - - // ARN of the stage to be deleted. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 DeleteStageInput) 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 DeleteStageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStageInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *DeleteStageInput) SetArn(v string) *DeleteStageInput { - s.Arn = &v - return s -} - -type DeleteStageOutput 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 DeleteStageOutput) 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 DeleteStageOutput) GoString() string { - return s.String() -} - -type DeleteStorageConfigurationInput struct { - _ struct{} `type:"structure"` - - // ARN of the storage configuration to be deleted. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 DeleteStorageConfigurationInput) 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 DeleteStorageConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStorageConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStorageConfigurationInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *DeleteStorageConfigurationInput) SetArn(v string) *DeleteStorageConfigurationInput { - s.Arn = &v - return s -} - -type DeleteStorageConfigurationOutput 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 DeleteStorageConfigurationOutput) 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 DeleteStorageConfigurationOutput) GoString() string { - return s.String() -} - -// Object specifying the status of a Destination. -type Destination struct { - _ struct{} `type:"structure"` - - // Configuration used to create this destination. - // - // Configuration is a required field - Configuration *DestinationConfiguration `locationName:"configuration" type:"structure" required:"true"` - - // Optional details regarding the status of the destination. - Detail *DestinationDetail `locationName:"detail" type:"structure"` - - // UTC time of the destination end. This is an ISO 8601 timestamp; note that - // this is returned as a string. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // Unique identifier for this destination, assigned by IVS. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // UTC time of the destination start. This is an ISO 8601 timestamp; note that - // this is returned as a string. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // State of the Composition Destination. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"DestinationState"` -} - -// 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 Destination) 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 Destination) GoString() string { - return s.String() -} - -// SetConfiguration sets the Configuration field's value. -func (s *Destination) SetConfiguration(v *DestinationConfiguration) *Destination { - s.Configuration = v - return s -} - -// SetDetail sets the Detail field's value. -func (s *Destination) SetDetail(v *DestinationDetail) *Destination { - s.Detail = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *Destination) SetEndTime(v time.Time) *Destination { - s.EndTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *Destination) SetId(v string) *Destination { - s.Id = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Destination) SetStartTime(v time.Time) *Destination { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *Destination) SetState(v string) *Destination { - s.State = &v - return s -} - -// Complex data type that defines destination-configuration objects. -type DestinationConfiguration struct { - _ struct{} `type:"structure"` - - // An IVS channel to be used for broadcasting, for server-side composition. - // Either a channel or an s3 must be specified. - Channel *ChannelDestinationConfiguration `locationName:"channel" type:"structure"` - - // Name that can be specified to help identify the destination. - Name *string `locationName:"name" type:"string"` - - // An S3 storage configuration to be used for recording video data. Either a - // channel or an s3 must be specified. - S3 *S3DestinationConfiguration `locationName:"s3" 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 DestinationConfiguration) 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 DestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DestinationConfiguration"} - if s.Channel != nil { - if err := s.Channel.Validate(); err != nil { - invalidParams.AddNested("Channel", err.(request.ErrInvalidParams)) - } - } - if s.S3 != nil { - if err := s.S3.Validate(); err != nil { - invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannel sets the Channel field's value. -func (s *DestinationConfiguration) SetChannel(v *ChannelDestinationConfiguration) *DestinationConfiguration { - s.Channel = v - return s -} - -// SetName sets the Name field's value. -func (s *DestinationConfiguration) SetName(v string) *DestinationConfiguration { - s.Name = &v - return s -} - -// SetS3 sets the S3 field's value. -func (s *DestinationConfiguration) SetS3(v *S3DestinationConfiguration) *DestinationConfiguration { - s.S3 = v - return s -} - -// Complex data type that defines destination-detail objects. -type DestinationDetail struct { - _ struct{} `type:"structure"` - - // An S3 detail object to return information about the S3 destination. - S3 *S3Detail `locationName:"s3" 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 DestinationDetail) 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 DestinationDetail) GoString() string { - return s.String() -} - -// SetS3 sets the S3 field's value. -func (s *DestinationDetail) SetS3(v *S3Detail) *DestinationDetail { - s.S3 = v - return s -} - -// Summary information about a Destination. -type DestinationSummary struct { - _ struct{} `type:"structure"` - - // UTC time of the destination end. This is an ISO 8601 timestamp; note that - // this is returned as a string. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // Unique identifier for this destination, assigned by IVS. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // UTC time of the destination start. This is an ISO 8601 timestamp; note that - // this is returned as a string. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // State of the Composition Destination. - // - // State is a required field - State *string `locationName:"state" type:"string" required:"true" enum:"DestinationState"` -} - -// 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 DestinationSummary) 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 DestinationSummary) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *DestinationSummary) SetEndTime(v time.Time) *DestinationSummary { - s.EndTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *DestinationSummary) SetId(v string) *DestinationSummary { - s.Id = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DestinationSummary) SetStartTime(v time.Time) *DestinationSummary { - s.StartTime = &v - return s -} - -// SetState sets the State field's value. -func (s *DestinationSummary) SetState(v string) *DestinationSummary { - s.State = &v - return s -} - -type DisconnectParticipantInput struct { - _ struct{} `type:"structure"` - - // Identifier of the participant to be disconnected. This is assigned by IVS - // and returned by CreateParticipantToken. - // - // ParticipantId is a required field - ParticipantId *string `locationName:"participantId" type:"string" required:"true"` - - // Description of why this participant is being disconnected. - Reason *string `locationName:"reason" type:"string"` - - // ARN of the stage to which the participant is attached. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" 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 DisconnectParticipantInput) 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 DisconnectParticipantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisconnectParticipantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisconnectParticipantInput"} - if s.ParticipantId == nil { - invalidParams.Add(request.NewErrParamRequired("ParticipantId")) - } - if s.StageArn == nil { - invalidParams.Add(request.NewErrParamRequired("StageArn")) - } - if s.StageArn != nil && len(*s.StageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParticipantId sets the ParticipantId field's value. -func (s *DisconnectParticipantInput) SetParticipantId(v string) *DisconnectParticipantInput { - s.ParticipantId = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *DisconnectParticipantInput) SetReason(v string) *DisconnectParticipantInput { - s.Reason = &v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *DisconnectParticipantInput) SetStageArn(v string) *DisconnectParticipantInput { - s.StageArn = &v - return s -} - -type DisconnectParticipantOutput 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 DisconnectParticipantOutput) 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 DisconnectParticipantOutput) GoString() string { - return s.String() -} - -// Settings for transcoding. -type EncoderConfiguration struct { - _ struct{} `type:"structure"` - - // ARN of the EncoderConfiguration resource. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Optional name to identify the resource. - Name *string `locationName:"name" type:"string"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` - - // Video configuration. Default: video resolution 1280x720, bitrate 2500 kbps, - // 30 fps - Video *Video `locationName:"video" 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 EncoderConfiguration) 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 EncoderConfiguration) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *EncoderConfiguration) SetArn(v string) *EncoderConfiguration { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *EncoderConfiguration) SetName(v string) *EncoderConfiguration { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *EncoderConfiguration) SetTags(v map[string]*string) *EncoderConfiguration { - s.Tags = v - return s -} - -// SetVideo sets the Video field's value. -func (s *EncoderConfiguration) SetVideo(v *Video) *EncoderConfiguration { - s.Video = v - return s -} - -// Summary information about an EncoderConfiguration. -type EncoderConfigurationSummary struct { - _ struct{} `type:"structure"` - - // ARN of the EncoderConfiguration resource. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Optional name to identify the resource. - Name *string `locationName:"name" type:"string"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 EncoderConfigurationSummary) 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 EncoderConfigurationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *EncoderConfigurationSummary) SetArn(v string) *EncoderConfigurationSummary { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *EncoderConfigurationSummary) SetName(v string) *EncoderConfigurationSummary { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *EncoderConfigurationSummary) SetTags(v map[string]*string) *EncoderConfigurationSummary { - s.Tags = v - return s -} - -// An occurrence during a stage session. -type Event struct { - _ struct{} `type:"structure"` - - // If the event is an error event, the error code is provided to give insight - // into the specific error that occurred. If the event is not an error event, - // this field is null. INSUFFICIENT_CAPABILITIES indicates that the participant - // tried to take an action that the participant’s token is not allowed to - // do. For more information about participant capabilities, see the capabilities - // field in CreateParticipantToken. QUOTA_EXCEEDED indicates that the number - // of participants who want to publish/subscribe to a stage exceeds the quota; - // for more information, see Service Quotas (https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/service-quotas.html). - // PUBLISHER_NOT_FOUND indicates that the participant tried to subscribe to - // a publisher that doesn’t exist. - ErrorCode *string `locationName:"errorCode" type:"string" enum:"EventErrorCode"` - - // ISO 8601 timestamp (returned as a string) for when the event occurred. - EventTime *time.Time `locationName:"eventTime" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the event. - Name *string `locationName:"name" type:"string" enum:"EventName"` - - // Unique identifier for the participant who triggered the event. This is assigned - // by IVS. - ParticipantId *string `locationName:"participantId" type:"string"` - - // Unique identifier for the remote participant. For a subscribe event, this - // is the publisher. For a publish or join event, this is null. This is assigned - // by IVS. - RemoteParticipantId *string `locationName:"remoteParticipantId" 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 Event) 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 Event) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *Event) SetErrorCode(v string) *Event { - s.ErrorCode = &v - return s -} - -// SetEventTime sets the EventTime field's value. -func (s *Event) SetEventTime(v time.Time) *Event { - s.EventTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *Event) SetName(v string) *Event { - s.Name = &v - return s -} - -// SetParticipantId sets the ParticipantId field's value. -func (s *Event) SetParticipantId(v string) *Event { - s.ParticipantId = &v - return s -} - -// SetRemoteParticipantId sets the RemoteParticipantId field's value. -func (s *Event) SetRemoteParticipantId(v string) *Event { - s.RemoteParticipantId = &v - return s -} - -type GetCompositionInput struct { - _ struct{} `type:"structure"` - - // ARN of the Composition resource. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 GetCompositionInput) 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 GetCompositionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCompositionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCompositionInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *GetCompositionInput) SetArn(v string) *GetCompositionInput { - s.Arn = &v - return s -} - -type GetCompositionOutput struct { - _ struct{} `type:"structure"` - - // The Composition that was returned. - Composition *Composition `locationName:"composition" 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 GetCompositionOutput) 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 GetCompositionOutput) GoString() string { - return s.String() -} - -// SetComposition sets the Composition field's value. -func (s *GetCompositionOutput) SetComposition(v *Composition) *GetCompositionOutput { - s.Composition = v - return s -} - -type GetEncoderConfigurationInput struct { - _ struct{} `type:"structure"` - - // ARN of the EncoderConfiguration resource. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 GetEncoderConfigurationInput) 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 GetEncoderConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEncoderConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEncoderConfigurationInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *GetEncoderConfigurationInput) SetArn(v string) *GetEncoderConfigurationInput { - s.Arn = &v - return s -} - -type GetEncoderConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The EncoderConfiguration that was returned. - EncoderConfiguration *EncoderConfiguration `locationName:"encoderConfiguration" 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 GetEncoderConfigurationOutput) 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 GetEncoderConfigurationOutput) GoString() string { - return s.String() -} - -// SetEncoderConfiguration sets the EncoderConfiguration field's value. -func (s *GetEncoderConfigurationOutput) SetEncoderConfiguration(v *EncoderConfiguration) *GetEncoderConfigurationOutput { - s.EncoderConfiguration = v - return s -} - -type GetParticipantInput struct { - _ struct{} `type:"structure"` - - // Unique identifier for the participant. This is assigned by IVS and returned - // by CreateParticipantToken. - // - // ParticipantId is a required field - ParticipantId *string `locationName:"participantId" type:"string" required:"true"` - - // ID of a session within the stage. - // - // SessionId is a required field - SessionId *string `locationName:"sessionId" min:"16" type:"string" required:"true"` - - // Stage ARN. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" 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 GetParticipantInput) 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 GetParticipantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetParticipantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetParticipantInput"} - if s.ParticipantId == nil { - invalidParams.Add(request.NewErrParamRequired("ParticipantId")) - } - if s.SessionId == nil { - invalidParams.Add(request.NewErrParamRequired("SessionId")) - } - if s.SessionId != nil && len(*s.SessionId) < 16 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 16)) - } - if s.StageArn == nil { - invalidParams.Add(request.NewErrParamRequired("StageArn")) - } - if s.StageArn != nil && len(*s.StageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParticipantId sets the ParticipantId field's value. -func (s *GetParticipantInput) SetParticipantId(v string) *GetParticipantInput { - s.ParticipantId = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *GetParticipantInput) SetSessionId(v string) *GetParticipantInput { - s.SessionId = &v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *GetParticipantInput) SetStageArn(v string) *GetParticipantInput { - s.StageArn = &v - return s -} - -type GetParticipantOutput struct { - _ struct{} `type:"structure"` - - // The participant that is returned. - Participant *Participant `locationName:"participant" 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 GetParticipantOutput) 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 GetParticipantOutput) GoString() string { - return s.String() -} - -// SetParticipant sets the Participant field's value. -func (s *GetParticipantOutput) SetParticipant(v *Participant) *GetParticipantOutput { - s.Participant = v - return s -} - -type GetStageInput struct { - _ struct{} `type:"structure"` - - // ARN of the stage for which the information is to be retrieved. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 GetStageInput) 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 GetStageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStageInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *GetStageInput) SetArn(v string) *GetStageInput { - s.Arn = &v - return s -} - -type GetStageOutput struct { - _ struct{} `type:"structure"` - - // The stage that is returned. - Stage *Stage `locationName:"stage" 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 GetStageOutput) 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 GetStageOutput) GoString() string { - return s.String() -} - -// SetStage sets the Stage field's value. -func (s *GetStageOutput) SetStage(v *Stage) *GetStageOutput { - s.Stage = v - return s -} - -type GetStageSessionInput struct { - _ struct{} `type:"structure"` - - // ID of a session within the stage. - // - // SessionId is a required field - SessionId *string `locationName:"sessionId" min:"16" type:"string" required:"true"` - - // ARN of the stage for which the information is to be retrieved. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" 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 GetStageSessionInput) 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 GetStageSessionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStageSessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStageSessionInput"} - if s.SessionId == nil { - invalidParams.Add(request.NewErrParamRequired("SessionId")) - } - if s.SessionId != nil && len(*s.SessionId) < 16 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 16)) - } - if s.StageArn == nil { - invalidParams.Add(request.NewErrParamRequired("StageArn")) - } - if s.StageArn != nil && len(*s.StageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSessionId sets the SessionId field's value. -func (s *GetStageSessionInput) SetSessionId(v string) *GetStageSessionInput { - s.SessionId = &v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *GetStageSessionInput) SetStageArn(v string) *GetStageSessionInput { - s.StageArn = &v - return s -} - -type GetStageSessionOutput struct { - _ struct{} `type:"structure"` - - // The stage session that is returned. - StageSession *StageSession `locationName:"stageSession" 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 GetStageSessionOutput) 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 GetStageSessionOutput) GoString() string { - return s.String() -} - -// SetStageSession sets the StageSession field's value. -func (s *GetStageSessionOutput) SetStageSession(v *StageSession) *GetStageSessionOutput { - s.StageSession = v - return s -} - -type GetStorageConfigurationInput struct { - _ struct{} `type:"structure"` - - // ARN of the storage configuration to be retrieved. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 GetStorageConfigurationInput) 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 GetStorageConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetStorageConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetStorageConfigurationInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *GetStorageConfigurationInput) SetArn(v string) *GetStorageConfigurationInput { - s.Arn = &v - return s -} - -type GetStorageConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The StorageConfiguration that was returned. - StorageConfiguration *StorageConfiguration `locationName:"storageConfiguration" 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 GetStorageConfigurationOutput) 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 GetStorageConfigurationOutput) GoString() string { - return s.String() -} - -// SetStorageConfiguration sets the StorageConfiguration field's value. -func (s *GetStorageConfigurationOutput) SetStorageConfiguration(v *StorageConfiguration) *GetStorageConfigurationOutput { - s.StorageConfiguration = v - return s -} - -// Configuration information specific to Grid layout, for server-side composition. -// See "Layouts" in Server-Side Composition (https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/server-side-composition.html). -type GridConfiguration struct { - _ struct{} `type:"structure"` - - // This attribute name identifies the featured slot. A participant with this - // attribute set to "true" (as a string value) in ParticipantTokenConfiguration - // is placed in the featured slot. - FeaturedParticipantAttribute *string `locationName:"featuredParticipantAttribute" 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 GridConfiguration) 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 GridConfiguration) GoString() string { - return s.String() -} - -// SetFeaturedParticipantAttribute sets the FeaturedParticipantAttribute field's value. -func (s *GridConfiguration) SetFeaturedParticipantAttribute(v string) *GridConfiguration { - s.FeaturedParticipantAttribute = &v - return s -} - -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Unexpected error during processing of request. - ExceptionMessage *string `locationName:"exceptionMessage" type:"string"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Configuration information of supported layouts for server-side composition. -type LayoutConfiguration struct { - _ struct{} `type:"structure"` - - // Configuration related to grid layout. Default: Grid layout. - Grid *GridConfiguration `locationName:"grid" 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 LayoutConfiguration) 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 LayoutConfiguration) GoString() string { - return s.String() -} - -// SetGrid sets the Grid field's value. -func (s *LayoutConfiguration) SetGrid(v *GridConfiguration) *LayoutConfiguration { - s.Grid = v - return s -} - -type ListCompositionsInput struct { - _ struct{} `type:"structure"` - - // Filters the Composition list to match the specified EncoderConfiguration - // attached to at least one of its output. - FilterByEncoderConfigurationArn *string `locationName:"filterByEncoderConfigurationArn" min:"1" type:"string"` - - // Filters the Composition list to match the specified Stage ARN. - FilterByStageArn *string `locationName:"filterByStageArn" min:"1" type:"string"` - - // Maximum number of results to return. Default: 100. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The first Composition to retrieve. This is used for pagination; see the nextToken - // response field. - NextToken *string `locationName:"nextToken" 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 ListCompositionsInput) 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 ListCompositionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCompositionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCompositionsInput"} - if s.FilterByEncoderConfigurationArn != nil && len(*s.FilterByEncoderConfigurationArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterByEncoderConfigurationArn", 1)) - } - if s.FilterByStageArn != nil && len(*s.FilterByStageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FilterByStageArn", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterByEncoderConfigurationArn sets the FilterByEncoderConfigurationArn field's value. -func (s *ListCompositionsInput) SetFilterByEncoderConfigurationArn(v string) *ListCompositionsInput { - s.FilterByEncoderConfigurationArn = &v - return s -} - -// SetFilterByStageArn sets the FilterByStageArn field's value. -func (s *ListCompositionsInput) SetFilterByStageArn(v string) *ListCompositionsInput { - s.FilterByStageArn = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCompositionsInput) SetMaxResults(v int64) *ListCompositionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCompositionsInput) SetNextToken(v string) *ListCompositionsInput { - s.NextToken = &v - return s -} - -type ListCompositionsOutput struct { - _ struct{} `type:"structure"` - - // List of the matching Compositions (summary information only). - // - // Compositions is a required field - Compositions []*CompositionSummary `locationName:"compositions" type:"list" required:"true"` - - // If there are more compositions than maxResults, use nextToken in the request - // to get the next set. - NextToken *string `locationName:"nextToken" 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 ListCompositionsOutput) 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 ListCompositionsOutput) GoString() string { - return s.String() -} - -// SetCompositions sets the Compositions field's value. -func (s *ListCompositionsOutput) SetCompositions(v []*CompositionSummary) *ListCompositionsOutput { - s.Compositions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCompositionsOutput) SetNextToken(v string) *ListCompositionsOutput { - s.NextToken = &v - return s -} - -type ListEncoderConfigurationsInput struct { - _ struct{} `type:"structure"` - - // Maximum number of results to return. Default: 100. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The first encoder configuration to retrieve. This is used for pagination; - // see the nextToken response field. - NextToken *string `locationName:"nextToken" 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 ListEncoderConfigurationsInput) 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 ListEncoderConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEncoderConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEncoderConfigurationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEncoderConfigurationsInput) SetMaxResults(v int64) *ListEncoderConfigurationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEncoderConfigurationsInput) SetNextToken(v string) *ListEncoderConfigurationsInput { - s.NextToken = &v - return s -} - -type ListEncoderConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // List of the matching EncoderConfigurations (summary information only). - // - // EncoderConfigurations is a required field - EncoderConfigurations []*EncoderConfigurationSummary `locationName:"encoderConfigurations" type:"list" required:"true"` - - // If there are more encoder configurations than maxResults, use nextToken in - // the request to get the next set. - NextToken *string `locationName:"nextToken" 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 ListEncoderConfigurationsOutput) 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 ListEncoderConfigurationsOutput) GoString() string { - return s.String() -} - -// SetEncoderConfigurations sets the EncoderConfigurations field's value. -func (s *ListEncoderConfigurationsOutput) SetEncoderConfigurations(v []*EncoderConfigurationSummary) *ListEncoderConfigurationsOutput { - s.EncoderConfigurations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEncoderConfigurationsOutput) SetNextToken(v string) *ListEncoderConfigurationsOutput { - s.NextToken = &v - return s -} - -type ListParticipantEventsInput struct { - _ struct{} `type:"structure"` - - // Maximum number of results to return. Default: 50. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The first participant event to retrieve. This is used for pagination; see - // the nextToken response field. - NextToken *string `locationName:"nextToken" type:"string"` - - // Unique identifier for this participant. This is assigned by IVS and returned - // by CreateParticipantToken. - // - // ParticipantId is a required field - ParticipantId *string `locationName:"participantId" type:"string" required:"true"` - - // ID of a session within the stage. - // - // SessionId is a required field - SessionId *string `locationName:"sessionId" min:"16" type:"string" required:"true"` - - // Stage ARN. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" 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 ListParticipantEventsInput) 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 ListParticipantEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListParticipantEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListParticipantEventsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ParticipantId == nil { - invalidParams.Add(request.NewErrParamRequired("ParticipantId")) - } - if s.SessionId == nil { - invalidParams.Add(request.NewErrParamRequired("SessionId")) - } - if s.SessionId != nil && len(*s.SessionId) < 16 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 16)) - } - if s.StageArn == nil { - invalidParams.Add(request.NewErrParamRequired("StageArn")) - } - if s.StageArn != nil && len(*s.StageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListParticipantEventsInput) SetMaxResults(v int64) *ListParticipantEventsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListParticipantEventsInput) SetNextToken(v string) *ListParticipantEventsInput { - s.NextToken = &v - return s -} - -// SetParticipantId sets the ParticipantId field's value. -func (s *ListParticipantEventsInput) SetParticipantId(v string) *ListParticipantEventsInput { - s.ParticipantId = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *ListParticipantEventsInput) SetSessionId(v string) *ListParticipantEventsInput { - s.SessionId = &v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *ListParticipantEventsInput) SetStageArn(v string) *ListParticipantEventsInput { - s.StageArn = &v - return s -} - -type ListParticipantEventsOutput struct { - _ struct{} `type:"structure"` - - // List of the matching events. - // - // Events is a required field - Events []*Event `locationName:"events" type:"list" required:"true"` - - // If there are more events than maxResults, use nextToken in the request to - // get the next set. - NextToken *string `locationName:"nextToken" 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 ListParticipantEventsOutput) 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 ListParticipantEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *ListParticipantEventsOutput) SetEvents(v []*Event) *ListParticipantEventsOutput { - s.Events = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListParticipantEventsOutput) SetNextToken(v string) *ListParticipantEventsOutput { - s.NextToken = &v - return s -} - -type ListParticipantsInput struct { - _ struct{} `type:"structure"` - - // Filters the response list to only show participants who published during - // the stage session. Only one of filterByUserId, filterByPublished, or filterByState - // can be provided per request. - FilterByPublished *bool `locationName:"filterByPublished" type:"boolean"` - - // Filters the response list to only show participants in the specified state. - // Only one of filterByUserId, filterByPublished, or filterByState can be provided - // per request. - FilterByState *string `locationName:"filterByState" type:"string" enum:"ParticipantState"` - - // Filters the response list to match the specified user ID. Only one of filterByUserId, - // filterByPublished, or filterByState can be provided per request. A userId - // is a customer-assigned name to help identify the token; this can be used - // to link a participant to a user in the customer’s own systems. - FilterByUserId *string `locationName:"filterByUserId" type:"string"` - - // Maximum number of results to return. Default: 50. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The first participant to retrieve. This is used for pagination; see the nextToken - // response field. - NextToken *string `locationName:"nextToken" type:"string"` - - // ID of the session within the stage. - // - // SessionId is a required field - SessionId *string `locationName:"sessionId" min:"16" type:"string" required:"true"` - - // Stage ARN. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" 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 ListParticipantsInput) 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 ListParticipantsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListParticipantsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListParticipantsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.SessionId == nil { - invalidParams.Add(request.NewErrParamRequired("SessionId")) - } - if s.SessionId != nil && len(*s.SessionId) < 16 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 16)) - } - if s.StageArn == nil { - invalidParams.Add(request.NewErrParamRequired("StageArn")) - } - if s.StageArn != nil && len(*s.StageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterByPublished sets the FilterByPublished field's value. -func (s *ListParticipantsInput) SetFilterByPublished(v bool) *ListParticipantsInput { - s.FilterByPublished = &v - return s -} - -// SetFilterByState sets the FilterByState field's value. -func (s *ListParticipantsInput) SetFilterByState(v string) *ListParticipantsInput { - s.FilterByState = &v - return s -} - -// SetFilterByUserId sets the FilterByUserId field's value. -func (s *ListParticipantsInput) SetFilterByUserId(v string) *ListParticipantsInput { - s.FilterByUserId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListParticipantsInput) SetMaxResults(v int64) *ListParticipantsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListParticipantsInput) SetNextToken(v string) *ListParticipantsInput { - s.NextToken = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *ListParticipantsInput) SetSessionId(v string) *ListParticipantsInput { - s.SessionId = &v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *ListParticipantsInput) SetStageArn(v string) *ListParticipantsInput { - s.StageArn = &v - return s -} - -type ListParticipantsOutput struct { - _ struct{} `type:"structure"` - - // If there are more participants than maxResults, use nextToken in the request - // to get the next set. - NextToken *string `locationName:"nextToken" type:"string"` - - // List of the matching participants (summary information only). - // - // Participants is a required field - Participants []*ParticipantSummary `locationName:"participants" type:"list" 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 ListParticipantsOutput) 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 ListParticipantsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListParticipantsOutput) SetNextToken(v string) *ListParticipantsOutput { - s.NextToken = &v - return s -} - -// SetParticipants sets the Participants field's value. -func (s *ListParticipantsOutput) SetParticipants(v []*ParticipantSummary) *ListParticipantsOutput { - s.Participants = v - return s -} - -type ListStageSessionsInput struct { - _ struct{} `type:"structure"` - - // Maximum number of results to return. Default: 50. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The first stage session to retrieve. This is used for pagination; see the - // nextToken response field. - NextToken *string `locationName:"nextToken" type:"string"` - - // Stage ARN. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" 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 ListStageSessionsInput) 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 ListStageSessionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListStageSessionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStageSessionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.StageArn == nil { - invalidParams.Add(request.NewErrParamRequired("StageArn")) - } - if s.StageArn != nil && len(*s.StageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListStageSessionsInput) SetMaxResults(v int64) *ListStageSessionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStageSessionsInput) SetNextToken(v string) *ListStageSessionsInput { - s.NextToken = &v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *ListStageSessionsInput) SetStageArn(v string) *ListStageSessionsInput { - s.StageArn = &v - return s -} - -type ListStageSessionsOutput struct { - _ struct{} `type:"structure"` - - // If there are more stage sessions than maxResults, use nextToken in the request - // to get the next set. - NextToken *string `locationName:"nextToken" type:"string"` - - // List of matching stage sessions. - // - // StageSessions is a required field - StageSessions []*StageSessionSummary `locationName:"stageSessions" type:"list" 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 ListStageSessionsOutput) 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 ListStageSessionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStageSessionsOutput) SetNextToken(v string) *ListStageSessionsOutput { - s.NextToken = &v - return s -} - -// SetStageSessions sets the StageSessions field's value. -func (s *ListStageSessionsOutput) SetStageSessions(v []*StageSessionSummary) *ListStageSessionsOutput { - s.StageSessions = v - return s -} - -type ListStagesInput struct { - _ struct{} `type:"structure"` - - // Maximum number of results to return. Default: 50. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The first stage to retrieve. This is used for pagination; see the nextToken - // response field. - NextToken *string `locationName:"nextToken" 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 ListStagesInput) 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 ListStagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListStagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStagesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListStagesInput) SetMaxResults(v int64) *ListStagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStagesInput) SetNextToken(v string) *ListStagesInput { - s.NextToken = &v - return s -} - -type ListStagesOutput struct { - _ struct{} `type:"structure"` - - // If there are more stages than maxResults, use nextToken in the request to - // get the next set. - NextToken *string `locationName:"nextToken" type:"string"` - - // List of the matching stages (summary information only). - // - // Stages is a required field - Stages []*StageSummary `locationName:"stages" type:"list" 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 ListStagesOutput) 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 ListStagesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStagesOutput) SetNextToken(v string) *ListStagesOutput { - s.NextToken = &v - return s -} - -// SetStages sets the Stages field's value. -func (s *ListStagesOutput) SetStages(v []*StageSummary) *ListStagesOutput { - s.Stages = v - return s -} - -type ListStorageConfigurationsInput struct { - _ struct{} `type:"structure"` - - // Maximum number of storage configurations to return. Default: your service - // quota or 100, whichever is smaller. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The first storage configuration to retrieve. This is used for pagination; - // see the nextToken response field. - NextToken *string `locationName:"nextToken" 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 ListStorageConfigurationsInput) 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 ListStorageConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListStorageConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStorageConfigurationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListStorageConfigurationsInput) SetMaxResults(v int64) *ListStorageConfigurationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStorageConfigurationsInput) SetNextToken(v string) *ListStorageConfigurationsInput { - s.NextToken = &v - return s -} - -type ListStorageConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // If there are more storage configurations than maxResults, use nextToken in - // the request to get the next set. - NextToken *string `locationName:"nextToken" type:"string"` - - // List of the matching storage configurations. - // - // StorageConfigurations is a required field - StorageConfigurations []*StorageConfigurationSummary `locationName:"storageConfigurations" type:"list" 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 ListStorageConfigurationsOutput) 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 ListStorageConfigurationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListStorageConfigurationsOutput) SetNextToken(v string) *ListStorageConfigurationsOutput { - s.NextToken = &v - return s -} - -// SetStorageConfigurations sets the StorageConfigurations field's value. -func (s *ListStorageConfigurationsOutput) SetStorageConfigurations(v []*StorageConfigurationSummary) *ListStorageConfigurationsOutput { - s.StorageConfigurations = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource to be retrieved. The ARN must be URL-encoded. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Object describing a participant that has joined a stage. -type Participant struct { - _ struct{} `type:"structure"` - - // Application-provided attributes to encode into the token and attach to a - // stage. Map keys and values can contain UTF-8 encoded text. The maximum length - // of this field is 1 KB total. This field is exposed to all stage participants - // and should not be used for personally identifying, confidential, or sensitive - // information. - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // The participant’s browser. - BrowserName *string `locationName:"browserName" type:"string"` - - // The participant’s browser version. - BrowserVersion *string `locationName:"browserVersion" type:"string"` - - // ISO 8601 timestamp (returned as a string) when the participant first joined - // the stage session. - FirstJoinTime *time.Time `locationName:"firstJoinTime" type:"timestamp" timestampFormat:"iso8601"` - - // The participant’s Internet Service Provider. - IspName *string `locationName:"ispName" type:"string"` - - // The participant’s operating system. - OsName *string `locationName:"osName" type:"string"` - - // The participant’s operating system version. - OsVersion *string `locationName:"osVersion" type:"string"` - - // Unique identifier for this participant, assigned by IVS. - ParticipantId *string `locationName:"participantId" type:"string"` - - // Whether the participant ever published to the stage session. - Published *bool `locationName:"published" type:"boolean"` - - // The participant’s SDK version. - SdkVersion *string `locationName:"sdkVersion" type:"string"` - - // Whether the participant is connected to or disconnected from the stage. - State *string `locationName:"state" type:"string" enum:"ParticipantState"` - - // Customer-assigned name to help identify the token; this can be used to link - // a participant to a user in the customer’s own systems. This can be any - // UTF-8 encoded text. This field is exposed to all stage participants and should - // not be used for personally identifying, confidential, or sensitive information. - UserId *string `locationName:"userId" 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 Participant) 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 Participant) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *Participant) SetAttributes(v map[string]*string) *Participant { - s.Attributes = v - return s -} - -// SetBrowserName sets the BrowserName field's value. -func (s *Participant) SetBrowserName(v string) *Participant { - s.BrowserName = &v - return s -} - -// SetBrowserVersion sets the BrowserVersion field's value. -func (s *Participant) SetBrowserVersion(v string) *Participant { - s.BrowserVersion = &v - return s -} - -// SetFirstJoinTime sets the FirstJoinTime field's value. -func (s *Participant) SetFirstJoinTime(v time.Time) *Participant { - s.FirstJoinTime = &v - return s -} - -// SetIspName sets the IspName field's value. -func (s *Participant) SetIspName(v string) *Participant { - s.IspName = &v - return s -} - -// SetOsName sets the OsName field's value. -func (s *Participant) SetOsName(v string) *Participant { - s.OsName = &v - return s -} - -// SetOsVersion sets the OsVersion field's value. -func (s *Participant) SetOsVersion(v string) *Participant { - s.OsVersion = &v - return s -} - -// SetParticipantId sets the ParticipantId field's value. -func (s *Participant) SetParticipantId(v string) *Participant { - s.ParticipantId = &v - return s -} - -// SetPublished sets the Published field's value. -func (s *Participant) SetPublished(v bool) *Participant { - s.Published = &v - return s -} - -// SetSdkVersion sets the SdkVersion field's value. -func (s *Participant) SetSdkVersion(v string) *Participant { - s.SdkVersion = &v - return s -} - -// SetState sets the State field's value. -func (s *Participant) SetState(v string) *Participant { - s.State = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *Participant) SetUserId(v string) *Participant { - s.UserId = &v - return s -} - -// Summary object describing a participant that has joined a stage. -type ParticipantSummary struct { - _ struct{} `type:"structure"` - - // ISO 8601 timestamp (returned as a string) when the participant first joined - // the stage session. - FirstJoinTime *time.Time `locationName:"firstJoinTime" type:"timestamp" timestampFormat:"iso8601"` - - // Unique identifier for this participant, assigned by IVS. - ParticipantId *string `locationName:"participantId" type:"string"` - - // Whether the participant ever published to the stage session. - Published *bool `locationName:"published" type:"boolean"` - - // Whether the participant is connected to or disconnected from the stage. - State *string `locationName:"state" type:"string" enum:"ParticipantState"` - - // Customer-assigned name to help identify the token; this can be used to link - // a participant to a user in the customer’s own systems. This can be any - // UTF-8 encoded text. This field is exposed to all stage participants and should - // not be used for personally identifying, confidential, or sensitive information. - UserId *string `locationName:"userId" 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 ParticipantSummary) 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 ParticipantSummary) GoString() string { - return s.String() -} - -// SetFirstJoinTime sets the FirstJoinTime field's value. -func (s *ParticipantSummary) SetFirstJoinTime(v time.Time) *ParticipantSummary { - s.FirstJoinTime = &v - return s -} - -// SetParticipantId sets the ParticipantId field's value. -func (s *ParticipantSummary) SetParticipantId(v string) *ParticipantSummary { - s.ParticipantId = &v - return s -} - -// SetPublished sets the Published field's value. -func (s *ParticipantSummary) SetPublished(v bool) *ParticipantSummary { - s.Published = &v - return s -} - -// SetState sets the State field's value. -func (s *ParticipantSummary) SetState(v string) *ParticipantSummary { - s.State = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *ParticipantSummary) SetUserId(v string) *ParticipantSummary { - s.UserId = &v - return s -} - -// Object specifying a participant token in a stage. -// -// Important: Treat tokens as opaque; i.e., do not build functionality based -// on token contents. The format of tokens could change in the future. -type ParticipantToken struct { - _ struct{} `type:"structure"` - - // Application-provided attributes to encode into the token and attach to a - // stage. This field is exposed to all stage participants and should not be - // used for personally identifying, confidential, or sensitive information. - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // Set of capabilities that the user is allowed to perform in the stage. - Capabilities []*string `locationName:"capabilities" type:"list" enum:"ParticipantTokenCapability"` - - // Duration (in minutes), after which the participant token expires. Default: - // 720 (12 hours). - Duration *int64 `locationName:"duration" min:"1" type:"integer"` - - // ISO 8601 timestamp (returned as a string) for when this token expires. - ExpirationTime *time.Time `locationName:"expirationTime" type:"timestamp" timestampFormat:"iso8601"` - - // Unique identifier for this participant token, assigned by IVS. - ParticipantId *string `locationName:"participantId" type:"string"` - - // The issued client token, encrypted. - // - // Token is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ParticipantToken's - // String and GoString methods. - Token *string `locationName:"token" type:"string" sensitive:"true"` - - // Customer-assigned name to help identify the token; this can be used to link - // a participant to a user in the customer’s own systems. This can be any - // UTF-8 encoded text. This field is exposed to all stage participants and should - // not be used for personally identifying, confidential, or sensitive information. - UserId *string `locationName:"userId" 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 ParticipantToken) 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 ParticipantToken) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *ParticipantToken) SetAttributes(v map[string]*string) *ParticipantToken { - s.Attributes = v - return s -} - -// SetCapabilities sets the Capabilities field's value. -func (s *ParticipantToken) SetCapabilities(v []*string) *ParticipantToken { - s.Capabilities = v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ParticipantToken) SetDuration(v int64) *ParticipantToken { - s.Duration = &v - return s -} - -// SetExpirationTime sets the ExpirationTime field's value. -func (s *ParticipantToken) SetExpirationTime(v time.Time) *ParticipantToken { - s.ExpirationTime = &v - return s -} - -// SetParticipantId sets the ParticipantId field's value. -func (s *ParticipantToken) SetParticipantId(v string) *ParticipantToken { - s.ParticipantId = &v - return s -} - -// SetToken sets the Token field's value. -func (s *ParticipantToken) SetToken(v string) *ParticipantToken { - s.Token = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *ParticipantToken) SetUserId(v string) *ParticipantToken { - s.UserId = &v - return s -} - -// Object specifying a participant token configuration in a stage. -type ParticipantTokenConfiguration struct { - _ struct{} `type:"structure"` - - // Application-provided attributes to encode into the corresponding participant - // token and attach to a stage. Map keys and values can contain UTF-8 encoded - // text. The maximum length of this field is 1 KB total. This field is exposed - // to all stage participants and should not be used for personally identifying, - // confidential, or sensitive information. - Attributes map[string]*string `locationName:"attributes" type:"map"` - - // Set of capabilities that the user is allowed to perform in the stage. - Capabilities []*string `locationName:"capabilities" type:"list" enum:"ParticipantTokenCapability"` - - // Duration (in minutes), after which the corresponding participant token expires. - // Default: 720 (12 hours). - Duration *int64 `locationName:"duration" min:"1" type:"integer"` - - // Customer-assigned name to help identify the token; this can be used to link - // a participant to a user in the customer’s own systems. This can be any - // UTF-8 encoded text. This field is exposed to all stage participants and should - // not be used for personally identifying, confidential, or sensitive information. - UserId *string `locationName:"userId" 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 ParticipantTokenConfiguration) 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 ParticipantTokenConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ParticipantTokenConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ParticipantTokenConfiguration"} - if s.Duration != nil && *s.Duration < 1 { - invalidParams.Add(request.NewErrParamMinValue("Duration", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *ParticipantTokenConfiguration) SetAttributes(v map[string]*string) *ParticipantTokenConfiguration { - s.Attributes = v - return s -} - -// SetCapabilities sets the Capabilities field's value. -func (s *ParticipantTokenConfiguration) SetCapabilities(v []*string) *ParticipantTokenConfiguration { - s.Capabilities = v - return s -} - -// SetDuration sets the Duration field's value. -func (s *ParticipantTokenConfiguration) SetDuration(v int64) *ParticipantTokenConfiguration { - s.Duration = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *ParticipantTokenConfiguration) SetUserId(v string) *ParticipantTokenConfiguration { - s.UserId = &v - return s -} - -type PendingVerification struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Your account is pending verification. - ExceptionMessage *string `locationName:"exceptionMessage" type:"string"` - - Message_ *string `locationName:"message" 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 PendingVerification) 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 PendingVerification) GoString() string { - return s.String() -} - -func newErrorPendingVerification(v protocol.ResponseMetadata) error { - return &PendingVerification{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PendingVerification) Code() string { - return "PendingVerification" -} - -// Message returns the exception's message. -func (s *PendingVerification) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PendingVerification) OrigErr() error { - return nil -} - -func (s *PendingVerification) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PendingVerification) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PendingVerification) RequestID() string { - return s.RespMetadata.RequestID -} - -// An object representing a configuration to record a stage stream. -type RecordingConfiguration struct { - _ struct{} `type:"structure"` - - // The recording format for storing a recording in Amazon S3. - Format *string `locationName:"format" type:"string" enum:"RecordingConfigurationFormat"` -} - -// 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 RecordingConfiguration) 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 RecordingConfiguration) GoString() string { - return s.String() -} - -// SetFormat sets the Format field's value. -func (s *RecordingConfiguration) SetFormat(v string) *RecordingConfiguration { - s.Format = &v - return s -} - -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Request references a resource which does not exist. - ExceptionMessage *string `locationName:"exceptionMessage" type:"string"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A complex type that describes an S3 location where recorded videos will be -// stored. -type S3DestinationConfiguration struct { - _ struct{} `type:"structure"` - - // ARNs of the EncoderConfiguration resource. The encoder configuration and - // stage resources must be in the same AWS account and region. - // - // EncoderConfigurationArns is a required field - EncoderConfigurationArns []*string `locationName:"encoderConfigurationArns" min:"1" type:"list" required:"true"` - - // Array of maps, each of the form string:string (key:value). This is an optional - // customer specification, currently used only to specify the recording format - // for storing a recording in Amazon S3. - RecordingConfiguration *RecordingConfiguration `locationName:"recordingConfiguration" type:"structure"` - - // ARN of the StorageConfiguration where recorded videos will be stored. - // - // StorageConfigurationArn is a required field - StorageConfigurationArn *string `locationName:"storageConfigurationArn" min:"1" 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 S3DestinationConfiguration) 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 S3DestinationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3DestinationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3DestinationConfiguration"} - if s.EncoderConfigurationArns == nil { - invalidParams.Add(request.NewErrParamRequired("EncoderConfigurationArns")) - } - if s.EncoderConfigurationArns != nil && len(s.EncoderConfigurationArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EncoderConfigurationArns", 1)) - } - if s.StorageConfigurationArn == nil { - invalidParams.Add(request.NewErrParamRequired("StorageConfigurationArn")) - } - if s.StorageConfigurationArn != nil && len(*s.StorageConfigurationArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StorageConfigurationArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncoderConfigurationArns sets the EncoderConfigurationArns field's value. -func (s *S3DestinationConfiguration) SetEncoderConfigurationArns(v []*string) *S3DestinationConfiguration { - s.EncoderConfigurationArns = v - return s -} - -// SetRecordingConfiguration sets the RecordingConfiguration field's value. -func (s *S3DestinationConfiguration) SetRecordingConfiguration(v *RecordingConfiguration) *S3DestinationConfiguration { - s.RecordingConfiguration = v - return s -} - -// SetStorageConfigurationArn sets the StorageConfigurationArn field's value. -func (s *S3DestinationConfiguration) SetStorageConfigurationArn(v string) *S3DestinationConfiguration { - s.StorageConfigurationArn = &v - return s -} - -// Complex data type that defines S3Detail objects. -type S3Detail struct { - _ struct{} `type:"structure"` - - // The S3 bucket prefix under which the recording is stored. - // - // RecordingPrefix is a required field - RecordingPrefix *string `locationName:"recordingPrefix" 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 S3Detail) 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 S3Detail) GoString() string { - return s.String() -} - -// SetRecordingPrefix sets the RecordingPrefix field's value. -func (s *S3Detail) SetRecordingPrefix(v string) *S3Detail { - s.RecordingPrefix = &v - return s -} - -// A complex type that describes an S3 location where recorded videos will be -// stored. -type S3StorageConfiguration struct { - _ struct{} `type:"structure"` - - // Location (S3 bucket name) where recorded videos will be stored. Note that - // the StorageConfiguration and S3 bucket must be in the same region as the - // Composition. - // - // BucketName is a required field - BucketName *string `locationName:"bucketName" min:"3" 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 S3StorageConfiguration) 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 S3StorageConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3StorageConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3StorageConfiguration"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - if s.BucketName != nil && len(*s.BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BucketName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3StorageConfiguration) SetBucketName(v string) *S3StorageConfiguration { - s.BucketName = &v - return s -} - -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Request would cause a service quota to be exceeded. - ExceptionMessage *string `locationName:"exceptionMessage" type:"string"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Object specifying a stage. -type Stage struct { - _ struct{} `type:"structure"` - - // ID of the active session within the stage. - ActiveSessionId *string `locationName:"activeSessionId" min:"16" type:"string"` - - // Stage ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Stage name. - Name *string `locationName:"name" type:"string"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 Stage) 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 Stage) GoString() string { - return s.String() -} - -// SetActiveSessionId sets the ActiveSessionId field's value. -func (s *Stage) SetActiveSessionId(v string) *Stage { - s.ActiveSessionId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Stage) SetArn(v string) *Stage { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *Stage) SetName(v string) *Stage { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Stage) SetTags(v map[string]*string) *Stage { - s.Tags = v - return s -} - -// A stage session begins when the first participant joins a stage and ends -// after the last participant leaves the stage. A stage session helps with debugging -// stages by grouping events and participants into shorter periods of time (i.e., -// a session), which is helpful when stages are used over long periods of time. -type StageSession struct { - _ struct{} `type:"structure"` - - // ISO 8601 timestamp (returned as a string) when the stage session ended. This - // is null if the stage is active. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // ID of the session within the stage. - SessionId *string `locationName:"sessionId" min:"16" type:"string"` - - // ISO 8601 timestamp (returned as a string) when this stage session began. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 StageSession) 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 StageSession) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *StageSession) SetEndTime(v time.Time) *StageSession { - s.EndTime = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *StageSession) SetSessionId(v string) *StageSession { - s.SessionId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *StageSession) SetStartTime(v time.Time) *StageSession { - s.StartTime = &v - return s -} - -// Summary information about a stage session. -type StageSessionSummary struct { - _ struct{} `type:"structure"` - - // ISO 8601 timestamp (returned as a string) when the stage session ended. This - // is null if the stage is active. - EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` - - // ID of the session within the stage. - SessionId *string `locationName:"sessionId" min:"16" type:"string"` - - // ISO 8601 timestamp (returned as a string) when this stage session began. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 StageSessionSummary) 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 StageSessionSummary) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *StageSessionSummary) SetEndTime(v time.Time) *StageSessionSummary { - s.EndTime = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *StageSessionSummary) SetSessionId(v string) *StageSessionSummary { - s.SessionId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *StageSessionSummary) SetStartTime(v time.Time) *StageSessionSummary { - s.StartTime = &v - return s -} - -// Summary information about a stage. -type StageSummary struct { - _ struct{} `type:"structure"` - - // ID of the active session within the stage. - ActiveSessionId *string `locationName:"activeSessionId" min:"16" type:"string"` - - // Stage ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Stage name. - Name *string `locationName:"name" type:"string"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 StageSummary) 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 StageSummary) GoString() string { - return s.String() -} - -// SetActiveSessionId sets the ActiveSessionId field's value. -func (s *StageSummary) SetActiveSessionId(v string) *StageSummary { - s.ActiveSessionId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *StageSummary) SetArn(v string) *StageSummary { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *StageSummary) SetName(v string) *StageSummary { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StageSummary) SetTags(v map[string]*string) *StageSummary { - s.Tags = v - return s -} - -type StartCompositionInput struct { - _ struct{} `type:"structure"` - - // Array of destination configuration. - // - // Destinations is a required field - Destinations []*DestinationConfiguration `locationName:"destinations" min:"1" type:"list" required:"true"` - - // Idempotency token. - IdempotencyToken *string `locationName:"idempotencyToken" min:"1" type:"string" idempotencyToken:"true"` - - // Layout object to configure composition parameters. - Layout *LayoutConfiguration `locationName:"layout" type:"structure"` - - // ARN of the stage to be used for compositing. - // - // StageArn is a required field - StageArn *string `locationName:"stageArn" min:"1" type:"string" required:"true"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 StartCompositionInput) 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 StartCompositionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartCompositionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartCompositionInput"} - if s.Destinations == nil { - invalidParams.Add(request.NewErrParamRequired("Destinations")) - } - if s.Destinations != nil && len(s.Destinations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Destinations", 1)) - } - if s.IdempotencyToken != nil && len(*s.IdempotencyToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IdempotencyToken", 1)) - } - if s.StageArn == nil { - invalidParams.Add(request.NewErrParamRequired("StageArn")) - } - if s.StageArn != nil && len(*s.StageArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StageArn", 1)) - } - if s.Destinations != nil { - for i, v := range s.Destinations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinations sets the Destinations field's value. -func (s *StartCompositionInput) SetDestinations(v []*DestinationConfiguration) *StartCompositionInput { - s.Destinations = v - return s -} - -// SetIdempotencyToken sets the IdempotencyToken field's value. -func (s *StartCompositionInput) SetIdempotencyToken(v string) *StartCompositionInput { - s.IdempotencyToken = &v - return s -} - -// SetLayout sets the Layout field's value. -func (s *StartCompositionInput) SetLayout(v *LayoutConfiguration) *StartCompositionInput { - s.Layout = v - return s -} - -// SetStageArn sets the StageArn field's value. -func (s *StartCompositionInput) SetStageArn(v string) *StartCompositionInput { - s.StageArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartCompositionInput) SetTags(v map[string]*string) *StartCompositionInput { - s.Tags = v - return s -} - -type StartCompositionOutput struct { - _ struct{} `type:"structure"` - - // The Composition that was created. - Composition *Composition `locationName:"composition" 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 StartCompositionOutput) 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 StartCompositionOutput) GoString() string { - return s.String() -} - -// SetComposition sets the Composition field's value. -func (s *StartCompositionOutput) SetComposition(v *Composition) *StartCompositionOutput { - s.Composition = v - return s -} - -type StopCompositionInput struct { - _ struct{} `type:"structure"` - - // ARN of the Composition. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" 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 StopCompositionInput) 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 StopCompositionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopCompositionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopCompositionInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *StopCompositionInput) SetArn(v string) *StopCompositionInput { - s.Arn = &v - return s -} - -type StopCompositionOutput 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 StopCompositionOutput) 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 StopCompositionOutput) GoString() string { - return s.String() -} - -// A complex type that describes a location where recorded videos will be stored. -type StorageConfiguration struct { - _ struct{} `type:"structure"` - - // ARN of the storage configuration. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Name of the storage configuration. - Name *string `locationName:"name" type:"string"` - - // An S3 destination configuration where recorded videos will be stored. - S3 *S3StorageConfiguration `locationName:"s3" type:"structure"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 StorageConfiguration) 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 StorageConfiguration) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StorageConfiguration) SetArn(v string) *StorageConfiguration { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *StorageConfiguration) SetName(v string) *StorageConfiguration { - s.Name = &v - return s -} - -// SetS3 sets the S3 field's value. -func (s *StorageConfiguration) SetS3(v *S3StorageConfiguration) *StorageConfiguration { - s.S3 = v - return s -} - -// SetTags sets the Tags field's value. -func (s *StorageConfiguration) SetTags(v map[string]*string) *StorageConfiguration { - s.Tags = v - return s -} - -// Summary information about a storage configuration. -type StorageConfigurationSummary struct { - _ struct{} `type:"structure"` - - // ARN of the storage configuration. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Name of the storage configuration. - Name *string `locationName:"name" type:"string"` - - // An S3 destination configuration where recorded videos will be stored. - S3 *S3StorageConfiguration `locationName:"s3" type:"structure"` - - // Tags attached to the resource. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints on tags beyond what is documented - // there. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 StorageConfigurationSummary) 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 StorageConfigurationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StorageConfigurationSummary) SetArn(v string) *StorageConfigurationSummary { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *StorageConfigurationSummary) SetName(v string) *StorageConfigurationSummary { - s.Name = &v - return s -} - -// SetS3 sets the S3 field's value. -func (s *StorageConfigurationSummary) SetS3(v *S3StorageConfiguration) *StorageConfigurationSummary { - s.S3 = v - return s -} - -// SetTags sets the Tags field's value. -func (s *StorageConfigurationSummary) SetTags(v map[string]*string) *StorageConfigurationSummary { - s.Tags = v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource to be tagged. The ARN must be URL-encoded. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // Array of tags to be added or updated. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints beyond what is documented - // there. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource to be untagged. The ARN must be URL-encoded. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // Array of tags to be removed. Array of maps, each of the form string:string - // (key:value). See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // for details, including restrictions that apply to tags and "Tag naming limits - // and requirements"; Amazon IVS has no constraints beyond what is documented - // there. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateStageInput struct { - _ struct{} `type:"structure"` - - // ARN of the stage to be updated. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // Name of the stage to be updated. - Name *string `locationName:"name" 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 UpdateStageInput) 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 UpdateStageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateStageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateStageInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *UpdateStageInput) SetArn(v string) *UpdateStageInput { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateStageInput) SetName(v string) *UpdateStageInput { - s.Name = &v - return s -} - -type UpdateStageOutput struct { - _ struct{} `type:"structure"` - - // The updated stage. - Stage *Stage `locationName:"stage" 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 UpdateStageOutput) 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 UpdateStageOutput) GoString() string { - return s.String() -} - -// SetStage sets the Stage field's value. -func (s *UpdateStageOutput) SetStage(v *Stage) *UpdateStageOutput { - s.Stage = v - return s -} - -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The input fails to satisfy the constraints specified by an Amazon Web Services - // service. - ExceptionMessage *string `locationName:"exceptionMessage" type:"string"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Settings for video. -type Video struct { - _ struct{} `type:"structure"` - - // Bitrate for generated output, in bps. Default: 2500000. - Bitrate *int64 `locationName:"bitrate" min:"1" type:"integer"` - - // Video frame rate, in fps. Default: 30. - Framerate *float64 `locationName:"framerate" min:"1" type:"float"` - - // Video-resolution height. Note that the maximum value is determined by width - // times height, such that the maximum total pixels is 2073600 (1920x1080 or - // 1080x1920). Default: 720. - Height *int64 `locationName:"height" min:"1" type:"integer"` - - // Video-resolution width. Note that the maximum value is determined by width - // times height, such that the maximum total pixels is 2073600 (1920x1080 or - // 1080x1920). Default: 1280. - Width *int64 `locationName:"width" min:"1" 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 Video) 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 Video) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Video) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Video"} - if s.Bitrate != nil && *s.Bitrate < 1 { - invalidParams.Add(request.NewErrParamMinValue("Bitrate", 1)) - } - if s.Framerate != nil && *s.Framerate < 1 { - invalidParams.Add(request.NewErrParamMinValue("Framerate", 1)) - } - if s.Height != nil && *s.Height < 1 { - invalidParams.Add(request.NewErrParamMinValue("Height", 1)) - } - if s.Width != nil && *s.Width < 1 { - invalidParams.Add(request.NewErrParamMinValue("Width", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBitrate sets the Bitrate field's value. -func (s *Video) SetBitrate(v int64) *Video { - s.Bitrate = &v - return s -} - -// SetFramerate sets the Framerate field's value. -func (s *Video) SetFramerate(v float64) *Video { - s.Framerate = &v - return s -} - -// SetHeight sets the Height field's value. -func (s *Video) SetHeight(v int64) *Video { - s.Height = &v - return s -} - -// SetWidth sets the Width field's value. -func (s *Video) SetWidth(v int64) *Video { - s.Width = &v - return s -} - -const ( - // CompositionStateStarting is a CompositionState enum value - CompositionStateStarting = "STARTING" - - // CompositionStateActive is a CompositionState enum value - CompositionStateActive = "ACTIVE" - - // CompositionStateStopping is a CompositionState enum value - CompositionStateStopping = "STOPPING" - - // CompositionStateFailed is a CompositionState enum value - CompositionStateFailed = "FAILED" - - // CompositionStateStopped is a CompositionState enum value - CompositionStateStopped = "STOPPED" -) - -// CompositionState_Values returns all elements of the CompositionState enum -func CompositionState_Values() []string { - return []string{ - CompositionStateStarting, - CompositionStateActive, - CompositionStateStopping, - CompositionStateFailed, - CompositionStateStopped, - } -} - -const ( - // DestinationStateStarting is a DestinationState enum value - DestinationStateStarting = "STARTING" - - // DestinationStateActive is a DestinationState enum value - DestinationStateActive = "ACTIVE" - - // DestinationStateStopping is a DestinationState enum value - DestinationStateStopping = "STOPPING" - - // DestinationStateReconnecting is a DestinationState enum value - DestinationStateReconnecting = "RECONNECTING" - - // DestinationStateFailed is a DestinationState enum value - DestinationStateFailed = "FAILED" - - // DestinationStateStopped is a DestinationState enum value - DestinationStateStopped = "STOPPED" -) - -// DestinationState_Values returns all elements of the DestinationState enum -func DestinationState_Values() []string { - return []string{ - DestinationStateStarting, - DestinationStateActive, - DestinationStateStopping, - DestinationStateReconnecting, - DestinationStateFailed, - DestinationStateStopped, - } -} - -const ( - // EventErrorCodeInsufficientCapabilities is a EventErrorCode enum value - EventErrorCodeInsufficientCapabilities = "INSUFFICIENT_CAPABILITIES" - - // EventErrorCodeQuotaExceeded is a EventErrorCode enum value - EventErrorCodeQuotaExceeded = "QUOTA_EXCEEDED" - - // EventErrorCodePublisherNotFound is a EventErrorCode enum value - EventErrorCodePublisherNotFound = "PUBLISHER_NOT_FOUND" -) - -// EventErrorCode_Values returns all elements of the EventErrorCode enum -func EventErrorCode_Values() []string { - return []string{ - EventErrorCodeInsufficientCapabilities, - EventErrorCodeQuotaExceeded, - EventErrorCodePublisherNotFound, - } -} - -const ( - // EventNameJoined is a EventName enum value - EventNameJoined = "JOINED" - - // EventNameLeft is a EventName enum value - EventNameLeft = "LEFT" - - // EventNamePublishStarted is a EventName enum value - EventNamePublishStarted = "PUBLISH_STARTED" - - // EventNamePublishStopped is a EventName enum value - EventNamePublishStopped = "PUBLISH_STOPPED" - - // EventNameSubscribeStarted is a EventName enum value - EventNameSubscribeStarted = "SUBSCRIBE_STARTED" - - // EventNameSubscribeStopped is a EventName enum value - EventNameSubscribeStopped = "SUBSCRIBE_STOPPED" - - // EventNamePublishError is a EventName enum value - EventNamePublishError = "PUBLISH_ERROR" - - // EventNameSubscribeError is a EventName enum value - EventNameSubscribeError = "SUBSCRIBE_ERROR" - - // EventNameJoinError is a EventName enum value - EventNameJoinError = "JOIN_ERROR" -) - -// EventName_Values returns all elements of the EventName enum -func EventName_Values() []string { - return []string{ - EventNameJoined, - EventNameLeft, - EventNamePublishStarted, - EventNamePublishStopped, - EventNameSubscribeStarted, - EventNameSubscribeStopped, - EventNamePublishError, - EventNameSubscribeError, - EventNameJoinError, - } -} - -const ( - // ParticipantStateConnected is a ParticipantState enum value - ParticipantStateConnected = "CONNECTED" - - // ParticipantStateDisconnected is a ParticipantState enum value - ParticipantStateDisconnected = "DISCONNECTED" -) - -// ParticipantState_Values returns all elements of the ParticipantState enum -func ParticipantState_Values() []string { - return []string{ - ParticipantStateConnected, - ParticipantStateDisconnected, - } -} - -const ( - // ParticipantTokenCapabilityPublish is a ParticipantTokenCapability enum value - ParticipantTokenCapabilityPublish = "PUBLISH" - - // ParticipantTokenCapabilitySubscribe is a ParticipantTokenCapability enum value - ParticipantTokenCapabilitySubscribe = "SUBSCRIBE" -) - -// ParticipantTokenCapability_Values returns all elements of the ParticipantTokenCapability enum -func ParticipantTokenCapability_Values() []string { - return []string{ - ParticipantTokenCapabilityPublish, - ParticipantTokenCapabilitySubscribe, - } -} - -const ( - // RecordingConfigurationFormatHls is a RecordingConfigurationFormat enum value - RecordingConfigurationFormatHls = "HLS" -) - -// RecordingConfigurationFormat_Values returns all elements of the RecordingConfigurationFormat enum -func RecordingConfigurationFormat_Values() []string { - return []string{ - RecordingConfigurationFormatHls, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/doc.go deleted file mode 100644 index 279cef93d02e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/doc.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ivsrealtime provides the client and types for making API -// requests to Amazon Interactive Video Service RealTime. -// -// # Introduction -// -// The Amazon Interactive Video Service (IVS) real-time API is REST compatible, -// using a standard HTTP API and an AWS EventBridge event stream for responses. -// JSON is used for both requests and responses, including errors. -// -// Terminology: -// -// - A stage is a virtual space where participants can exchange video in -// real time. -// -// - A participant token is a token that authenticates a participant when -// they join a stage. -// -// - A participant object represents participants (people) in the stage and -// contains information about them. When a token is created, it includes -// a participant ID; when a participant uses that token to join a stage, -// the participant is associated with that participant ID. There is a 1:1 -// mapping between participant tokens and participants. -// -// - Server-side composition: The composition process composites participants -// of a stage into a single video and forwards it to a set of outputs (e.g., -// IVS channels). Composition endpoints support this process. -// -// - Server-side composition: A composition controls the look of the outputs, -// including how participants are positioned in the video. -// -// # Resources -// -// The following resources contain information about your IVS live stream (see -// Getting Started with Amazon IVS Real-Time Streaming (https://docs.aws.amazon.com/ivs/latest/RealTimeUserGuide/getting-started.html)): -// -// - Stage — A stage is a virtual space where participants can exchange -// video in real time. -// -// # Tagging -// -// A tag is a metadata label that you assign to an AWS resource. A tag comprises -// a key and a value, both set by you. For example, you might set a tag as topic:nature -// to label a particular video category. See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) -// for more information, including restrictions that apply to tags and "Tag -// naming limits and requirements"; Amazon IVS stages has no service-specific -// constraints beyond what is documented there. -// -// Tags can help you identify and organize your AWS resources. For example, -// you can use the same tag for different resources to indicate that they are -// related. You can also use tags to manage access (see Access Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html)). -// -// The Amazon IVS real-time API has these tag-related endpoints: TagResource, -// UntagResource, and ListTagsForResource. The following resource supports tagging: -// Stage. -// -// At most 50 tags can be applied to a resource. -// -// Stages Endpoints -// -// - CreateParticipantToken — Creates an additional token for a specified -// stage. This can be done after stage creation or when tokens expire. -// -// - CreateStage — Creates a new stage (and optionally participant tokens). -// -// - DeleteStage — Shuts down and deletes the specified stage (disconnecting -// all participants). -// -// - DisconnectParticipant — Disconnects a specified participant and revokes -// the participant permanently from a specified stage. -// -// - GetParticipant — Gets information about the specified participant -// token. -// -// - GetStage — Gets information for the specified stage. -// -// - GetStageSession — Gets information for the specified stage session. -// -// - ListParticipantEvents — Lists events for a specified participant that -// occurred during a specified stage session. -// -// - ListParticipants — Lists all participants in a specified stage session. -// -// - ListStages — Gets summary information about all stages in your account, -// in the AWS region where the API request is processed. -// -// - ListStageSessions — Gets all sessions for a specified stage. -// -// - UpdateStage — Updates a stage’s configuration. -// -// Composition Endpoints -// -// - GetComposition — Gets information about the specified Composition -// resource. -// -// - ListCompositions — Gets summary information about all Compositions -// in your account, in the AWS region where the API request is processed. -// -// - StartComposition — Starts a Composition from a stage based on the -// configuration provided in the request. -// -// - StopComposition — Stops and deletes a Composition resource. Any broadcast -// from the Composition resource is stopped. -// -// EncoderConfiguration Endpoints -// -// - CreateEncoderConfiguration — Creates an EncoderConfiguration object. -// -// - DeleteEncoderConfiguration — Deletes an EncoderConfiguration resource. -// Ensures that no Compositions are using this template; otherwise, returns -// an error. -// -// - GetEncoderConfiguration — Gets information about the specified EncoderConfiguration -// resource. -// -// - ListEncoderConfigurations — Gets summary information about all EncoderConfigurations -// in your account, in the AWS region where the API request is processed. -// -// StorageConfiguration Endpoints -// -// - CreateStorageConfiguration — Creates a new storage configuration, -// used to enable recording to Amazon S3. -// -// - DeleteStorageConfiguration — Deletes the storage configuration for -// the specified ARN. -// -// - GetStorageConfiguration — Gets the storage configuration for the specified -// ARN. -// -// - ListStorageConfigurations — Gets summary information about all storage -// configurations in your account, in the AWS region where the API request -// is processed. -// -// Tags Endpoints -// -// - ListTagsForResource — Gets information about AWS tags for the specified -// ARN. -// -// - TagResource — Adds or updates tags for the AWS resource with the specified -// ARN. -// -// - UntagResource — Removes tags from the resource with the specified -// ARN. -// -// See https://docs.aws.amazon.com/goto/WebAPI/ivs-realtime-2020-07-14 for more information on this service. -// -// See ivsrealtime package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/ivsrealtime/ -// -// # Using the Client -// -// To contact Amazon Interactive Video Service RealTime with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Interactive Video Service RealTime client IVSRealTime for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/ivsrealtime/#New -package ivsrealtime diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/errors.go deleted file mode 100644 index 3a5b910e74b5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/errors.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ivsrealtime - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodePendingVerification for service response error code - // "PendingVerification". - ErrCodePendingVerification = "PendingVerification" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "PendingVerification": newErrorPendingVerification, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/ivsrealtimeiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/ivsrealtimeiface/interface.go deleted file mode 100644 index 53b9d1d9f736..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/ivsrealtimeiface/interface.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ivsrealtimeiface provides an interface to enable mocking the Amazon Interactive Video Service RealTime service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package ivsrealtimeiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime" -) - -// IVSRealTimeAPI provides an interface to enable mocking the -// ivsrealtime.IVSRealTime service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Interactive Video Service RealTime. -// func myFunc(svc ivsrealtimeiface.IVSRealTimeAPI) bool { -// // Make svc.CreateEncoderConfiguration request -// } -// -// func main() { -// sess := session.New() -// svc := ivsrealtime.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockIVSRealTimeClient struct { -// ivsrealtimeiface.IVSRealTimeAPI -// } -// func (m *mockIVSRealTimeClient) CreateEncoderConfiguration(input *ivsrealtime.CreateEncoderConfigurationInput) (*ivsrealtime.CreateEncoderConfigurationOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockIVSRealTimeClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type IVSRealTimeAPI interface { - CreateEncoderConfiguration(*ivsrealtime.CreateEncoderConfigurationInput) (*ivsrealtime.CreateEncoderConfigurationOutput, error) - CreateEncoderConfigurationWithContext(aws.Context, *ivsrealtime.CreateEncoderConfigurationInput, ...request.Option) (*ivsrealtime.CreateEncoderConfigurationOutput, error) - CreateEncoderConfigurationRequest(*ivsrealtime.CreateEncoderConfigurationInput) (*request.Request, *ivsrealtime.CreateEncoderConfigurationOutput) - - CreateParticipantToken(*ivsrealtime.CreateParticipantTokenInput) (*ivsrealtime.CreateParticipantTokenOutput, error) - CreateParticipantTokenWithContext(aws.Context, *ivsrealtime.CreateParticipantTokenInput, ...request.Option) (*ivsrealtime.CreateParticipantTokenOutput, error) - CreateParticipantTokenRequest(*ivsrealtime.CreateParticipantTokenInput) (*request.Request, *ivsrealtime.CreateParticipantTokenOutput) - - CreateStage(*ivsrealtime.CreateStageInput) (*ivsrealtime.CreateStageOutput, error) - CreateStageWithContext(aws.Context, *ivsrealtime.CreateStageInput, ...request.Option) (*ivsrealtime.CreateStageOutput, error) - CreateStageRequest(*ivsrealtime.CreateStageInput) (*request.Request, *ivsrealtime.CreateStageOutput) - - CreateStorageConfiguration(*ivsrealtime.CreateStorageConfigurationInput) (*ivsrealtime.CreateStorageConfigurationOutput, error) - CreateStorageConfigurationWithContext(aws.Context, *ivsrealtime.CreateStorageConfigurationInput, ...request.Option) (*ivsrealtime.CreateStorageConfigurationOutput, error) - CreateStorageConfigurationRequest(*ivsrealtime.CreateStorageConfigurationInput) (*request.Request, *ivsrealtime.CreateStorageConfigurationOutput) - - DeleteEncoderConfiguration(*ivsrealtime.DeleteEncoderConfigurationInput) (*ivsrealtime.DeleteEncoderConfigurationOutput, error) - DeleteEncoderConfigurationWithContext(aws.Context, *ivsrealtime.DeleteEncoderConfigurationInput, ...request.Option) (*ivsrealtime.DeleteEncoderConfigurationOutput, error) - DeleteEncoderConfigurationRequest(*ivsrealtime.DeleteEncoderConfigurationInput) (*request.Request, *ivsrealtime.DeleteEncoderConfigurationOutput) - - DeleteStage(*ivsrealtime.DeleteStageInput) (*ivsrealtime.DeleteStageOutput, error) - DeleteStageWithContext(aws.Context, *ivsrealtime.DeleteStageInput, ...request.Option) (*ivsrealtime.DeleteStageOutput, error) - DeleteStageRequest(*ivsrealtime.DeleteStageInput) (*request.Request, *ivsrealtime.DeleteStageOutput) - - DeleteStorageConfiguration(*ivsrealtime.DeleteStorageConfigurationInput) (*ivsrealtime.DeleteStorageConfigurationOutput, error) - DeleteStorageConfigurationWithContext(aws.Context, *ivsrealtime.DeleteStorageConfigurationInput, ...request.Option) (*ivsrealtime.DeleteStorageConfigurationOutput, error) - DeleteStorageConfigurationRequest(*ivsrealtime.DeleteStorageConfigurationInput) (*request.Request, *ivsrealtime.DeleteStorageConfigurationOutput) - - DisconnectParticipant(*ivsrealtime.DisconnectParticipantInput) (*ivsrealtime.DisconnectParticipantOutput, error) - DisconnectParticipantWithContext(aws.Context, *ivsrealtime.DisconnectParticipantInput, ...request.Option) (*ivsrealtime.DisconnectParticipantOutput, error) - DisconnectParticipantRequest(*ivsrealtime.DisconnectParticipantInput) (*request.Request, *ivsrealtime.DisconnectParticipantOutput) - - GetComposition(*ivsrealtime.GetCompositionInput) (*ivsrealtime.GetCompositionOutput, error) - GetCompositionWithContext(aws.Context, *ivsrealtime.GetCompositionInput, ...request.Option) (*ivsrealtime.GetCompositionOutput, error) - GetCompositionRequest(*ivsrealtime.GetCompositionInput) (*request.Request, *ivsrealtime.GetCompositionOutput) - - GetEncoderConfiguration(*ivsrealtime.GetEncoderConfigurationInput) (*ivsrealtime.GetEncoderConfigurationOutput, error) - GetEncoderConfigurationWithContext(aws.Context, *ivsrealtime.GetEncoderConfigurationInput, ...request.Option) (*ivsrealtime.GetEncoderConfigurationOutput, error) - GetEncoderConfigurationRequest(*ivsrealtime.GetEncoderConfigurationInput) (*request.Request, *ivsrealtime.GetEncoderConfigurationOutput) - - GetParticipant(*ivsrealtime.GetParticipantInput) (*ivsrealtime.GetParticipantOutput, error) - GetParticipantWithContext(aws.Context, *ivsrealtime.GetParticipantInput, ...request.Option) (*ivsrealtime.GetParticipantOutput, error) - GetParticipantRequest(*ivsrealtime.GetParticipantInput) (*request.Request, *ivsrealtime.GetParticipantOutput) - - GetStage(*ivsrealtime.GetStageInput) (*ivsrealtime.GetStageOutput, error) - GetStageWithContext(aws.Context, *ivsrealtime.GetStageInput, ...request.Option) (*ivsrealtime.GetStageOutput, error) - GetStageRequest(*ivsrealtime.GetStageInput) (*request.Request, *ivsrealtime.GetStageOutput) - - GetStageSession(*ivsrealtime.GetStageSessionInput) (*ivsrealtime.GetStageSessionOutput, error) - GetStageSessionWithContext(aws.Context, *ivsrealtime.GetStageSessionInput, ...request.Option) (*ivsrealtime.GetStageSessionOutput, error) - GetStageSessionRequest(*ivsrealtime.GetStageSessionInput) (*request.Request, *ivsrealtime.GetStageSessionOutput) - - GetStorageConfiguration(*ivsrealtime.GetStorageConfigurationInput) (*ivsrealtime.GetStorageConfigurationOutput, error) - GetStorageConfigurationWithContext(aws.Context, *ivsrealtime.GetStorageConfigurationInput, ...request.Option) (*ivsrealtime.GetStorageConfigurationOutput, error) - GetStorageConfigurationRequest(*ivsrealtime.GetStorageConfigurationInput) (*request.Request, *ivsrealtime.GetStorageConfigurationOutput) - - ListCompositions(*ivsrealtime.ListCompositionsInput) (*ivsrealtime.ListCompositionsOutput, error) - ListCompositionsWithContext(aws.Context, *ivsrealtime.ListCompositionsInput, ...request.Option) (*ivsrealtime.ListCompositionsOutput, error) - ListCompositionsRequest(*ivsrealtime.ListCompositionsInput) (*request.Request, *ivsrealtime.ListCompositionsOutput) - - ListCompositionsPages(*ivsrealtime.ListCompositionsInput, func(*ivsrealtime.ListCompositionsOutput, bool) bool) error - ListCompositionsPagesWithContext(aws.Context, *ivsrealtime.ListCompositionsInput, func(*ivsrealtime.ListCompositionsOutput, bool) bool, ...request.Option) error - - ListEncoderConfigurations(*ivsrealtime.ListEncoderConfigurationsInput) (*ivsrealtime.ListEncoderConfigurationsOutput, error) - ListEncoderConfigurationsWithContext(aws.Context, *ivsrealtime.ListEncoderConfigurationsInput, ...request.Option) (*ivsrealtime.ListEncoderConfigurationsOutput, error) - ListEncoderConfigurationsRequest(*ivsrealtime.ListEncoderConfigurationsInput) (*request.Request, *ivsrealtime.ListEncoderConfigurationsOutput) - - ListEncoderConfigurationsPages(*ivsrealtime.ListEncoderConfigurationsInput, func(*ivsrealtime.ListEncoderConfigurationsOutput, bool) bool) error - ListEncoderConfigurationsPagesWithContext(aws.Context, *ivsrealtime.ListEncoderConfigurationsInput, func(*ivsrealtime.ListEncoderConfigurationsOutput, bool) bool, ...request.Option) error - - ListParticipantEvents(*ivsrealtime.ListParticipantEventsInput) (*ivsrealtime.ListParticipantEventsOutput, error) - ListParticipantEventsWithContext(aws.Context, *ivsrealtime.ListParticipantEventsInput, ...request.Option) (*ivsrealtime.ListParticipantEventsOutput, error) - ListParticipantEventsRequest(*ivsrealtime.ListParticipantEventsInput) (*request.Request, *ivsrealtime.ListParticipantEventsOutput) - - ListParticipantEventsPages(*ivsrealtime.ListParticipantEventsInput, func(*ivsrealtime.ListParticipantEventsOutput, bool) bool) error - ListParticipantEventsPagesWithContext(aws.Context, *ivsrealtime.ListParticipantEventsInput, func(*ivsrealtime.ListParticipantEventsOutput, bool) bool, ...request.Option) error - - ListParticipants(*ivsrealtime.ListParticipantsInput) (*ivsrealtime.ListParticipantsOutput, error) - ListParticipantsWithContext(aws.Context, *ivsrealtime.ListParticipantsInput, ...request.Option) (*ivsrealtime.ListParticipantsOutput, error) - ListParticipantsRequest(*ivsrealtime.ListParticipantsInput) (*request.Request, *ivsrealtime.ListParticipantsOutput) - - ListParticipantsPages(*ivsrealtime.ListParticipantsInput, func(*ivsrealtime.ListParticipantsOutput, bool) bool) error - ListParticipantsPagesWithContext(aws.Context, *ivsrealtime.ListParticipantsInput, func(*ivsrealtime.ListParticipantsOutput, bool) bool, ...request.Option) error - - ListStageSessions(*ivsrealtime.ListStageSessionsInput) (*ivsrealtime.ListStageSessionsOutput, error) - ListStageSessionsWithContext(aws.Context, *ivsrealtime.ListStageSessionsInput, ...request.Option) (*ivsrealtime.ListStageSessionsOutput, error) - ListStageSessionsRequest(*ivsrealtime.ListStageSessionsInput) (*request.Request, *ivsrealtime.ListStageSessionsOutput) - - ListStageSessionsPages(*ivsrealtime.ListStageSessionsInput, func(*ivsrealtime.ListStageSessionsOutput, bool) bool) error - ListStageSessionsPagesWithContext(aws.Context, *ivsrealtime.ListStageSessionsInput, func(*ivsrealtime.ListStageSessionsOutput, bool) bool, ...request.Option) error - - ListStages(*ivsrealtime.ListStagesInput) (*ivsrealtime.ListStagesOutput, error) - ListStagesWithContext(aws.Context, *ivsrealtime.ListStagesInput, ...request.Option) (*ivsrealtime.ListStagesOutput, error) - ListStagesRequest(*ivsrealtime.ListStagesInput) (*request.Request, *ivsrealtime.ListStagesOutput) - - ListStagesPages(*ivsrealtime.ListStagesInput, func(*ivsrealtime.ListStagesOutput, bool) bool) error - ListStagesPagesWithContext(aws.Context, *ivsrealtime.ListStagesInput, func(*ivsrealtime.ListStagesOutput, bool) bool, ...request.Option) error - - ListStorageConfigurations(*ivsrealtime.ListStorageConfigurationsInput) (*ivsrealtime.ListStorageConfigurationsOutput, error) - ListStorageConfigurationsWithContext(aws.Context, *ivsrealtime.ListStorageConfigurationsInput, ...request.Option) (*ivsrealtime.ListStorageConfigurationsOutput, error) - ListStorageConfigurationsRequest(*ivsrealtime.ListStorageConfigurationsInput) (*request.Request, *ivsrealtime.ListStorageConfigurationsOutput) - - ListStorageConfigurationsPages(*ivsrealtime.ListStorageConfigurationsInput, func(*ivsrealtime.ListStorageConfigurationsOutput, bool) bool) error - ListStorageConfigurationsPagesWithContext(aws.Context, *ivsrealtime.ListStorageConfigurationsInput, func(*ivsrealtime.ListStorageConfigurationsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*ivsrealtime.ListTagsForResourceInput) (*ivsrealtime.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *ivsrealtime.ListTagsForResourceInput, ...request.Option) (*ivsrealtime.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*ivsrealtime.ListTagsForResourceInput) (*request.Request, *ivsrealtime.ListTagsForResourceOutput) - - StartComposition(*ivsrealtime.StartCompositionInput) (*ivsrealtime.StartCompositionOutput, error) - StartCompositionWithContext(aws.Context, *ivsrealtime.StartCompositionInput, ...request.Option) (*ivsrealtime.StartCompositionOutput, error) - StartCompositionRequest(*ivsrealtime.StartCompositionInput) (*request.Request, *ivsrealtime.StartCompositionOutput) - - StopComposition(*ivsrealtime.StopCompositionInput) (*ivsrealtime.StopCompositionOutput, error) - StopCompositionWithContext(aws.Context, *ivsrealtime.StopCompositionInput, ...request.Option) (*ivsrealtime.StopCompositionOutput, error) - StopCompositionRequest(*ivsrealtime.StopCompositionInput) (*request.Request, *ivsrealtime.StopCompositionOutput) - - TagResource(*ivsrealtime.TagResourceInput) (*ivsrealtime.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *ivsrealtime.TagResourceInput, ...request.Option) (*ivsrealtime.TagResourceOutput, error) - TagResourceRequest(*ivsrealtime.TagResourceInput) (*request.Request, *ivsrealtime.TagResourceOutput) - - UntagResource(*ivsrealtime.UntagResourceInput) (*ivsrealtime.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *ivsrealtime.UntagResourceInput, ...request.Option) (*ivsrealtime.UntagResourceOutput, error) - UntagResourceRequest(*ivsrealtime.UntagResourceInput) (*request.Request, *ivsrealtime.UntagResourceOutput) - - UpdateStage(*ivsrealtime.UpdateStageInput) (*ivsrealtime.UpdateStageOutput, error) - UpdateStageWithContext(aws.Context, *ivsrealtime.UpdateStageInput, ...request.Option) (*ivsrealtime.UpdateStageOutput, error) - UpdateStageRequest(*ivsrealtime.UpdateStageInput) (*request.Request, *ivsrealtime.UpdateStageOutput) -} - -var _ IVSRealTimeAPI = (*ivsrealtime.IVSRealTime)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/service.go deleted file mode 100644 index 3789cfee9f9a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ivsrealtime/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ivsrealtime - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// IVSRealTime provides the API operation methods for making requests to -// Amazon Interactive Video Service RealTime. See this package's package overview docs -// for details on the service. -// -// IVSRealTime methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type IVSRealTime struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "IVS RealTime" // Name of service. - EndpointsID = "ivsrealtime" // ID to lookup a service endpoint with. - ServiceID = "IVS RealTime" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the IVSRealTime client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a IVSRealTime client from just a session. -// svc := ivsrealtime.New(mySession) -// -// // Create a IVSRealTime client with additional configuration -// svc := ivsrealtime.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *IVSRealTime { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "ivs" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *IVSRealTime { - svc := &IVSRealTime{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2020-07-14", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a IVSRealTime operation and runs any -// custom request initialization. -func (c *IVSRealTime) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/api.go deleted file mode 100644 index 8c490979a1d4..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/api.go +++ /dev/null @@ -1,2926 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kendraranking - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opCreateRescoreExecutionPlan = "CreateRescoreExecutionPlan" - -// CreateRescoreExecutionPlanRequest generates a "aws/request.Request" representing the -// client's request for the CreateRescoreExecutionPlan 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 CreateRescoreExecutionPlan for more information on using the CreateRescoreExecutionPlan -// 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 CreateRescoreExecutionPlanRequest method. -// req, resp := client.CreateRescoreExecutionPlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/CreateRescoreExecutionPlan -func (c *KendraRanking) CreateRescoreExecutionPlanRequest(input *CreateRescoreExecutionPlanInput) (req *request.Request, output *CreateRescoreExecutionPlanOutput) { - op := &request.Operation{ - Name: opCreateRescoreExecutionPlan, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRescoreExecutionPlanInput{} - } - - output = &CreateRescoreExecutionPlanOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRescoreExecutionPlan API operation for Amazon Kendra Intelligent Ranking. -// -// Creates a rescore execution plan. A rescore execution plan is an Amazon Kendra -// Intelligent Ranking resource used for provisioning the Rescore API. You set -// the number of capacity units that you require for Amazon Kendra Intelligent -// Ranking to rescore or re-rank a search service's results. -// -// For an example of using the CreateRescoreExecutionPlan API, including using -// the Python and Java SDKs, see Semantically ranking a search service's results -// (https://docs.aws.amazon.com/kendra/latest/dg/search-service-rerank.html). -// -// 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 Kendra Intelligent Ranking's -// API operation CreateRescoreExecutionPlan for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - ConflictException -// A conflict occurred with the request. Please fix any inconsistencies with -// your resources and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Kendra Intelligent Ranking -// service. Please see Quotas (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) -// for more information, or contact Support (http://aws.amazon.com/contact-us/) -// to inquire about an increase of limits. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/CreateRescoreExecutionPlan -func (c *KendraRanking) CreateRescoreExecutionPlan(input *CreateRescoreExecutionPlanInput) (*CreateRescoreExecutionPlanOutput, error) { - req, out := c.CreateRescoreExecutionPlanRequest(input) - return out, req.Send() -} - -// CreateRescoreExecutionPlanWithContext is the same as CreateRescoreExecutionPlan with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRescoreExecutionPlan 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 *KendraRanking) CreateRescoreExecutionPlanWithContext(ctx aws.Context, input *CreateRescoreExecutionPlanInput, opts ...request.Option) (*CreateRescoreExecutionPlanOutput, error) { - req, out := c.CreateRescoreExecutionPlanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRescoreExecutionPlan = "DeleteRescoreExecutionPlan" - -// DeleteRescoreExecutionPlanRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRescoreExecutionPlan 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 DeleteRescoreExecutionPlan for more information on using the DeleteRescoreExecutionPlan -// 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 DeleteRescoreExecutionPlanRequest method. -// req, resp := client.DeleteRescoreExecutionPlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/DeleteRescoreExecutionPlan -func (c *KendraRanking) DeleteRescoreExecutionPlanRequest(input *DeleteRescoreExecutionPlanInput) (req *request.Request, output *DeleteRescoreExecutionPlanOutput) { - op := &request.Operation{ - Name: opDeleteRescoreExecutionPlan, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRescoreExecutionPlanInput{} - } - - output = &DeleteRescoreExecutionPlanOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRescoreExecutionPlan API operation for Amazon Kendra Intelligent Ranking. -// -// Deletes a rescore execution plan. A rescore execution plan is an Amazon Kendra -// Intelligent Ranking resource used for provisioning the Rescore API. -// -// 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 Kendra Intelligent Ranking's -// API operation DeleteRescoreExecutionPlan for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - ConflictException -// A conflict occurred with the request. Please fix any inconsistencies with -// your resources and try again. -// -// - ResourceNotFoundException -// The resource you want to use doesn't exist. Please check you have provided -// the correct resource and try again. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/DeleteRescoreExecutionPlan -func (c *KendraRanking) DeleteRescoreExecutionPlan(input *DeleteRescoreExecutionPlanInput) (*DeleteRescoreExecutionPlanOutput, error) { - req, out := c.DeleteRescoreExecutionPlanRequest(input) - return out, req.Send() -} - -// DeleteRescoreExecutionPlanWithContext is the same as DeleteRescoreExecutionPlan with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRescoreExecutionPlan 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 *KendraRanking) DeleteRescoreExecutionPlanWithContext(ctx aws.Context, input *DeleteRescoreExecutionPlanInput, opts ...request.Option) (*DeleteRescoreExecutionPlanOutput, error) { - req, out := c.DeleteRescoreExecutionPlanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeRescoreExecutionPlan = "DescribeRescoreExecutionPlan" - -// DescribeRescoreExecutionPlanRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRescoreExecutionPlan 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 DescribeRescoreExecutionPlan for more information on using the DescribeRescoreExecutionPlan -// 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 DescribeRescoreExecutionPlanRequest method. -// req, resp := client.DescribeRescoreExecutionPlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/DescribeRescoreExecutionPlan -func (c *KendraRanking) DescribeRescoreExecutionPlanRequest(input *DescribeRescoreExecutionPlanInput) (req *request.Request, output *DescribeRescoreExecutionPlanOutput) { - op := &request.Operation{ - Name: opDescribeRescoreExecutionPlan, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeRescoreExecutionPlanInput{} - } - - output = &DescribeRescoreExecutionPlanOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeRescoreExecutionPlan API operation for Amazon Kendra Intelligent Ranking. -// -// Gets information about a rescore execution plan. A rescore execution plan -// is an Amazon Kendra Intelligent Ranking resource used for provisioning the -// Rescore API. -// -// 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 Kendra Intelligent Ranking's -// API operation DescribeRescoreExecutionPlan for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - ResourceNotFoundException -// The resource you want to use doesn't exist. Please check you have provided -// the correct resource and try again. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/DescribeRescoreExecutionPlan -func (c *KendraRanking) DescribeRescoreExecutionPlan(input *DescribeRescoreExecutionPlanInput) (*DescribeRescoreExecutionPlanOutput, error) { - req, out := c.DescribeRescoreExecutionPlanRequest(input) - return out, req.Send() -} - -// DescribeRescoreExecutionPlanWithContext is the same as DescribeRescoreExecutionPlan with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeRescoreExecutionPlan 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 *KendraRanking) DescribeRescoreExecutionPlanWithContext(ctx aws.Context, input *DescribeRescoreExecutionPlanInput, opts ...request.Option) (*DescribeRescoreExecutionPlanOutput, error) { - req, out := c.DescribeRescoreExecutionPlanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListRescoreExecutionPlans = "ListRescoreExecutionPlans" - -// ListRescoreExecutionPlansRequest generates a "aws/request.Request" representing the -// client's request for the ListRescoreExecutionPlans 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 ListRescoreExecutionPlans for more information on using the ListRescoreExecutionPlans -// 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 ListRescoreExecutionPlansRequest method. -// req, resp := client.ListRescoreExecutionPlansRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/ListRescoreExecutionPlans -func (c *KendraRanking) ListRescoreExecutionPlansRequest(input *ListRescoreExecutionPlansInput) (req *request.Request, output *ListRescoreExecutionPlansOutput) { - op := &request.Operation{ - Name: opListRescoreExecutionPlans, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRescoreExecutionPlansInput{} - } - - output = &ListRescoreExecutionPlansOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRescoreExecutionPlans API operation for Amazon Kendra Intelligent Ranking. -// -// Lists your rescore execution plans. A rescore execution plan is an Amazon -// Kendra Intelligent Ranking resource used for provisioning the Rescore API. -// -// 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 Kendra Intelligent Ranking's -// API operation ListRescoreExecutionPlans for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/ListRescoreExecutionPlans -func (c *KendraRanking) ListRescoreExecutionPlans(input *ListRescoreExecutionPlansInput) (*ListRescoreExecutionPlansOutput, error) { - req, out := c.ListRescoreExecutionPlansRequest(input) - return out, req.Send() -} - -// ListRescoreExecutionPlansWithContext is the same as ListRescoreExecutionPlans with the addition of -// the ability to pass a context and additional request options. -// -// See ListRescoreExecutionPlans 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 *KendraRanking) ListRescoreExecutionPlansWithContext(ctx aws.Context, input *ListRescoreExecutionPlansInput, opts ...request.Option) (*ListRescoreExecutionPlansOutput, error) { - req, out := c.ListRescoreExecutionPlansRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRescoreExecutionPlansPages iterates over the pages of a ListRescoreExecutionPlans operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRescoreExecutionPlans method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRescoreExecutionPlans operation. -// pageNum := 0 -// err := client.ListRescoreExecutionPlansPages(params, -// func(page *kendraranking.ListRescoreExecutionPlansOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *KendraRanking) ListRescoreExecutionPlansPages(input *ListRescoreExecutionPlansInput, fn func(*ListRescoreExecutionPlansOutput, bool) bool) error { - return c.ListRescoreExecutionPlansPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRescoreExecutionPlansPagesWithContext same as ListRescoreExecutionPlansPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *KendraRanking) ListRescoreExecutionPlansPagesWithContext(ctx aws.Context, input *ListRescoreExecutionPlansInput, fn func(*ListRescoreExecutionPlansOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRescoreExecutionPlansInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRescoreExecutionPlansRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRescoreExecutionPlansOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/ListTagsForResource -func (c *KendraRanking) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Kendra Intelligent Ranking. -// -// Gets a list of tags associated with a specified resource. A rescore execution -// plan is an example of a resource that can have tags associated with it. -// -// 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 Kendra Intelligent Ranking's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - ResourceUnavailableException -// The resource you want to use is unavailable. Please check you have provided -// the correct resource information and try again. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/ListTagsForResource -func (c *KendraRanking) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *KendraRanking) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRescore = "Rescore" - -// RescoreRequest generates a "aws/request.Request" representing the -// client's request for the Rescore 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 Rescore for more information on using the Rescore -// 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 RescoreRequest method. -// req, resp := client.RescoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/Rescore -func (c *KendraRanking) RescoreRequest(input *RescoreInput) (req *request.Request, output *RescoreOutput) { - op := &request.Operation{ - Name: opRescore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RescoreInput{} - } - - output = &RescoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// Rescore API operation for Amazon Kendra Intelligent Ranking. -// -// Rescores or re-ranks search results from a search service such as OpenSearch -// (self managed). You use the semantic search capabilities of Amazon Kendra -// Intelligent Ranking to improve the search service's results. -// -// 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 Kendra Intelligent Ranking's -// API operation Rescore for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - ConflictException -// A conflict occurred with the request. Please fix any inconsistencies with -// your resources and try again. -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - ResourceNotFoundException -// The resource you want to use doesn't exist. Please check you have provided -// the correct resource and try again. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/Rescore -func (c *KendraRanking) Rescore(input *RescoreInput) (*RescoreOutput, error) { - req, out := c.RescoreRequest(input) - return out, req.Send() -} - -// RescoreWithContext is the same as Rescore with the addition of -// the ability to pass a context and additional request options. -// -// See Rescore 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 *KendraRanking) RescoreWithContext(ctx aws.Context, input *RescoreInput, opts ...request.Option) (*RescoreOutput, error) { - req, out := c.RescoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/TagResource -func (c *KendraRanking) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon Kendra Intelligent Ranking. -// -// Adds a specified tag to a specified rescore execution plan. A rescore execution -// plan is an Amazon Kendra Intelligent Ranking resource used for provisioning -// the Rescore API. If the tag already exists, the existing value is replaced -// with the new value. -// -// 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 Kendra Intelligent Ranking's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - ResourceUnavailableException -// The resource you want to use is unavailable. Please check you have provided -// the correct resource information and try again. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/TagResource -func (c *KendraRanking) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *KendraRanking) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/UntagResource -func (c *KendraRanking) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon Kendra Intelligent Ranking. -// -// Removes a tag from a rescore execution plan. A rescore execution plan is -// an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore -// operation. -// -// 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 Kendra Intelligent Ranking's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - ResourceUnavailableException -// The resource you want to use is unavailable. Please check you have provided -// the correct resource information and try again. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/UntagResource -func (c *KendraRanking) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *KendraRanking) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateRescoreExecutionPlan = "UpdateRescoreExecutionPlan" - -// UpdateRescoreExecutionPlanRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRescoreExecutionPlan 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 UpdateRescoreExecutionPlan for more information on using the UpdateRescoreExecutionPlan -// 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 UpdateRescoreExecutionPlanRequest method. -// req, resp := client.UpdateRescoreExecutionPlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/UpdateRescoreExecutionPlan -func (c *KendraRanking) UpdateRescoreExecutionPlanRequest(input *UpdateRescoreExecutionPlanInput) (req *request.Request, output *UpdateRescoreExecutionPlanOutput) { - op := &request.Operation{ - Name: opUpdateRescoreExecutionPlan, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateRescoreExecutionPlanInput{} - } - - output = &UpdateRescoreExecutionPlanOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateRescoreExecutionPlan API operation for Amazon Kendra Intelligent Ranking. -// -// Updates a rescore execution plan. A rescore execution plan is an Amazon Kendra -// Intelligent Ranking resource used for provisioning the Rescore API. You can -// update the number of capacity units you require for Amazon Kendra Intelligent -// Ranking to rescore or re-rank a search service's results. -// -// 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 Kendra Intelligent Ranking's -// API operation UpdateRescoreExecutionPlan for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -// -// - ResourceNotFoundException -// The resource you want to use doesn't exist. Please check you have provided -// the correct resource and try again. -// -// - ThrottlingException -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -// -// - AccessDeniedException -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Kendra Intelligent Ranking -// service. Please see Quotas (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) -// for more information, or contact Support (http://aws.amazon.com/contact-us/) -// to inquire about an increase of limits. -// -// - ConflictException -// A conflict occurred with the request. Please fix any inconsistencies with -// your resources and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19/UpdateRescoreExecutionPlan -func (c *KendraRanking) UpdateRescoreExecutionPlan(input *UpdateRescoreExecutionPlanInput) (*UpdateRescoreExecutionPlanOutput, error) { - req, out := c.UpdateRescoreExecutionPlanRequest(input) - return out, req.Send() -} - -// UpdateRescoreExecutionPlanWithContext is the same as UpdateRescoreExecutionPlan with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateRescoreExecutionPlan 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 *KendraRanking) UpdateRescoreExecutionPlanWithContext(ctx aws.Context, input *UpdateRescoreExecutionPlanInput, opts ...request.Option) (*UpdateRescoreExecutionPlanOutput, error) { - req, out := c.UpdateRescoreExecutionPlanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don’t have sufficient access to perform this action. Please ensure -// you have the required permission policies and user accounts and try again. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Sets additional capacity units configured for your rescore execution plan. -// A rescore execution plan is an Amazon Kendra Intelligent Ranking resource -// used for provisioning the Rescore API. You can add and remove capacity units -// to fit your usage requirements. -type CapacityUnitsConfiguration struct { - _ struct{} `type:"structure"` - - // The amount of extra capacity for your rescore execution plan. - // - // A single extra capacity unit for a rescore execution plan provides 0.01 rescore - // requests per second. You can add up to 1000 extra capacity units. - // - // RescoreCapacityUnits is a required field - RescoreCapacityUnits *int64 `type:"integer" 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 CapacityUnitsConfiguration) 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 CapacityUnitsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CapacityUnitsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CapacityUnitsConfiguration"} - if s.RescoreCapacityUnits == nil { - invalidParams.Add(request.NewErrParamRequired("RescoreCapacityUnits")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRescoreCapacityUnits sets the RescoreCapacityUnits field's value. -func (s *CapacityUnitsConfiguration) SetRescoreCapacityUnits(v int64) *CapacityUnitsConfiguration { - s.RescoreCapacityUnits = &v - return s -} - -// A conflict occurred with the request. Please fix any inconsistencies with -// your resources and try again. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateRescoreExecutionPlanInput struct { - _ struct{} `type:"structure"` - - // You can set additional capacity units to meet the needs of your rescore execution - // plan. You are given a single capacity unit by default. If you want to use - // the default capacity, you don't set additional capacity units. For more information - // on the default capacity and additional capacity units, see Adjusting capacity - // (https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html). - CapacityUnits *CapacityUnitsConfiguration `type:"structure"` - - // A token that you provide to identify the request to create a rescore execution - // plan. Multiple calls to the CreateRescoreExecutionPlanRequest API with the - // same client token will create only one rescore execution plan. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // A description for the rescore execution plan. - Description *string `type:"string"` - - // A name for the rescore execution plan. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A list of key-value pairs that identify or categorize your rescore execution - // plan. You can also use tags to help control access to the rescore execution - // plan. Tag keys and values can consist of Unicode letters, digits, white space, - // and any of the following symbols: _ . : / = + - @. - Tags []*Tag `type:"list"` -} - -// 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 CreateRescoreExecutionPlanInput) 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 CreateRescoreExecutionPlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRescoreExecutionPlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRescoreExecutionPlanInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.CapacityUnits != nil { - if err := s.CapacityUnits.Validate(); err != nil { - invalidParams.AddNested("CapacityUnits", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapacityUnits sets the CapacityUnits field's value. -func (s *CreateRescoreExecutionPlanInput) SetCapacityUnits(v *CapacityUnitsConfiguration) *CreateRescoreExecutionPlanInput { - s.CapacityUnits = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateRescoreExecutionPlanInput) SetClientToken(v string) *CreateRescoreExecutionPlanInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateRescoreExecutionPlanInput) SetDescription(v string) *CreateRescoreExecutionPlanInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateRescoreExecutionPlanInput) SetName(v string) *CreateRescoreExecutionPlanInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateRescoreExecutionPlanInput) SetTags(v []*Tag) *CreateRescoreExecutionPlanInput { - s.Tags = v - return s -} - -type CreateRescoreExecutionPlanOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rescore execution plan. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The identifier of the rescore execution plan. - // - // Id is a required field - Id *string `min:"36" 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 CreateRescoreExecutionPlanOutput) 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 CreateRescoreExecutionPlanOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateRescoreExecutionPlanOutput) SetArn(v string) *CreateRescoreExecutionPlanOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateRescoreExecutionPlanOutput) SetId(v string) *CreateRescoreExecutionPlanOutput { - s.Id = &v - return s -} - -type DeleteRescoreExecutionPlanInput struct { - _ struct{} `type:"structure"` - - // The identifier of the rescore execution plan that you want to delete. - // - // Id is a required field - Id *string `min:"36" 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 DeleteRescoreExecutionPlanInput) 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 DeleteRescoreExecutionPlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRescoreExecutionPlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRescoreExecutionPlanInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 36 { - invalidParams.Add(request.NewErrParamMinLen("Id", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteRescoreExecutionPlanInput) SetId(v string) *DeleteRescoreExecutionPlanInput { - s.Id = &v - return s -} - -type DeleteRescoreExecutionPlanOutput 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 DeleteRescoreExecutionPlanOutput) 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 DeleteRescoreExecutionPlanOutput) GoString() string { - return s.String() -} - -type DescribeRescoreExecutionPlanInput struct { - _ struct{} `type:"structure"` - - // The identifier of the rescore execution plan that you want to get information - // on. - // - // Id is a required field - Id *string `min:"36" 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 DescribeRescoreExecutionPlanInput) 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 DescribeRescoreExecutionPlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRescoreExecutionPlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRescoreExecutionPlanInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 36 { - invalidParams.Add(request.NewErrParamMinLen("Id", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DescribeRescoreExecutionPlanInput) SetId(v string) *DescribeRescoreExecutionPlanInput { - s.Id = &v - return s -} - -type DescribeRescoreExecutionPlanOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rescore execution plan. - Arn *string `type:"string"` - - // The capacity units set for the rescore execution plan. A capacity of zero - // indicates that the rescore execution plan is using the default capacity. - // For more information on the default capacity and additional capacity units, - // see Adjusting capacity (https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html). - CapacityUnits *CapacityUnitsConfiguration `type:"structure"` - - // The Unix timestamp of when the rescore execution plan was created. - CreatedAt *time.Time `type:"timestamp"` - - // The description for the rescore execution plan. - Description *string `type:"string"` - - // When the Status field value is FAILED, the ErrorMessage field contains a - // message that explains why. - ErrorMessage *string `min:"1" type:"string"` - - // The identifier of the rescore execution plan. - Id *string `min:"36" type:"string"` - - // The name for the rescore execution plan. - Name *string `min:"1" type:"string"` - - // The current status of the rescore execution plan. When the value is ACTIVE, - // the rescore execution plan is ready for use. If the Status field value is - // FAILED, the ErrorMessage field contains a message that explains why. - Status *string `type:"string" enum:"RescoreExecutionPlanStatus"` - - // The Unix timestamp of when the rescore execution plan was last updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 DescribeRescoreExecutionPlanOutput) 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 DescribeRescoreExecutionPlanOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetArn(v string) *DescribeRescoreExecutionPlanOutput { - s.Arn = &v - return s -} - -// SetCapacityUnits sets the CapacityUnits field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetCapacityUnits(v *CapacityUnitsConfiguration) *DescribeRescoreExecutionPlanOutput { - s.CapacityUnits = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetCreatedAt(v time.Time) *DescribeRescoreExecutionPlanOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetDescription(v string) *DescribeRescoreExecutionPlanOutput { - s.Description = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetErrorMessage(v string) *DescribeRescoreExecutionPlanOutput { - s.ErrorMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetId(v string) *DescribeRescoreExecutionPlanOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetName(v string) *DescribeRescoreExecutionPlanOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetStatus(v string) *DescribeRescoreExecutionPlanOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DescribeRescoreExecutionPlanOutput) SetUpdatedAt(v time.Time) *DescribeRescoreExecutionPlanOutput { - s.UpdatedAt = &v - return s -} - -// Information about a document from a search service such as OpenSearch (self -// managed). Amazon Kendra Intelligent Ranking uses this information to rank -// and score on. -type Document struct { - _ struct{} `type:"structure"` - - // The body text of the search service's document. - Body *string `min:"1" type:"string"` - - // The optional group identifier of the document from the search service. Documents - // with the same group identifier are grouped together and processed as one - // document within the service. - GroupId *string `min:"1" type:"string"` - - // The identifier of the document from the search service. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // The original document score or rank from the search service. Amazon Kendra - // Intelligent Ranking gives the document a new score or rank based on its intelligent - // search algorithms. - // - // OriginalScore is a required field - OriginalScore *float64 `type:"float" required:"true"` - - // The title of the search service's document. - Title *string `min:"1" type:"string"` - - // The body text of the search service's document represented as a list of tokens - // or words. You must choose to provide Body or TokenizedBody. You cannot provide - // both. - TokenizedBody []*string `min:"1" type:"list"` - - // The title of the search service's document represented as a list of tokens - // or words. You must choose to provide Title or TokenizedTitle. You cannot - // provide both. - TokenizedTitle []*string `min:"1" type:"list"` -} - -// 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 Document) 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 Document) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Document) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Document"} - if s.Body != nil && len(*s.Body) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Body", 1)) - } - if s.GroupId != nil && len(*s.GroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.OriginalScore == nil { - invalidParams.Add(request.NewErrParamRequired("OriginalScore")) - } - if s.OriginalScore != nil && *s.OriginalScore < -100000 { - invalidParams.Add(request.NewErrParamMinValue("OriginalScore", -100000)) - } - if s.Title != nil && len(*s.Title) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Title", 1)) - } - if s.TokenizedBody != nil && len(s.TokenizedBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TokenizedBody", 1)) - } - if s.TokenizedTitle != nil && len(s.TokenizedTitle) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TokenizedTitle", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *Document) SetBody(v string) *Document { - s.Body = &v - return s -} - -// SetGroupId sets the GroupId field's value. -func (s *Document) SetGroupId(v string) *Document { - s.GroupId = &v - return s -} - -// SetId sets the Id field's value. -func (s *Document) SetId(v string) *Document { - s.Id = &v - return s -} - -// SetOriginalScore sets the OriginalScore field's value. -func (s *Document) SetOriginalScore(v float64) *Document { - s.OriginalScore = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *Document) SetTitle(v string) *Document { - s.Title = &v - return s -} - -// SetTokenizedBody sets the TokenizedBody field's value. -func (s *Document) SetTokenizedBody(v []*string) *Document { - s.TokenizedBody = v - return s -} - -// SetTokenizedTitle sets the TokenizedTitle field's value. -func (s *Document) SetTokenizedTitle(v []*string) *Document { - s.TokenizedTitle = v - return s -} - -// An issue occurred with the internal server used for your Amazon Kendra Intelligent -// Ranking service. Please wait a few minutes and try again, or contact Support -// (http://aws.amazon.com/contact-us/) for help. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListRescoreExecutionPlansInput struct { - _ struct{} `type:"structure"` - - // The maximum number of rescore execution plans to return. - MaxResults *int64 `min:"1" type:"integer"` - - // If the response is truncated, Amazon Kendra Intelligent Ranking returns a - // pagination token in the response. You can use this pagination token to retrieve - // the next set of rescore execution plans. - NextToken *string `min:"1" 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 ListRescoreExecutionPlansInput) 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 ListRescoreExecutionPlansInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRescoreExecutionPlansInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRescoreExecutionPlansInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRescoreExecutionPlansInput) SetMaxResults(v int64) *ListRescoreExecutionPlansInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRescoreExecutionPlansInput) SetNextToken(v string) *ListRescoreExecutionPlansInput { - s.NextToken = &v - return s -} - -type ListRescoreExecutionPlansOutput struct { - _ struct{} `type:"structure"` - - // If the response is truncated, Amazon Kendra Intelligent Ranking returns a - // pagination token in the response. - NextToken *string `min:"1" type:"string"` - - // An array of summary information for one or more rescore execution plans. - SummaryItems []*RescoreExecutionPlanSummary `type:"list"` -} - -// 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 ListRescoreExecutionPlansOutput) 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 ListRescoreExecutionPlansOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRescoreExecutionPlansOutput) SetNextToken(v string) *ListRescoreExecutionPlansOutput { - s.NextToken = &v - return s -} - -// SetSummaryItems sets the SummaryItems field's value. -func (s *ListRescoreExecutionPlansOutput) SetSummaryItems(v []*RescoreExecutionPlanSummary) *ListRescoreExecutionPlansOutput { - s.SummaryItems = v - return s -} - -// The request information for listing tags associated with a rescore execution -// plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource -// used for provisioning the Rescore API. -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rescore execution plan to get a list - // of tags for. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { - s.ResourceARN = &v - return s -} - -// If the action is successful, the service sends back an HTTP 200 response. -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of tags associated with the rescore execution plan. - Tags []*Tag `type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Summary information for a rescore execution plan. A rescore execution plan -// is an Amazon Kendra Intelligent Ranking resource used for provisioning the -// Rescore API. -type RescoreExecutionPlanSummary struct { - _ struct{} `type:"structure"` - - // The Unix timestamp when the rescore execution plan was created. - CreatedAt *time.Time `type:"timestamp"` - - // The identifier of the rescore execution plan. - Id *string `min:"36" type:"string"` - - // The name of the rescore execution plan. - Name *string `min:"1" type:"string"` - - // The current status of the rescore execution plan. When the value is ACTIVE, - // the rescore execution plan is ready for use. - Status *string `type:"string" enum:"RescoreExecutionPlanStatus"` - - // The Unix timestamp when the rescore execution plan was last updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 RescoreExecutionPlanSummary) 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 RescoreExecutionPlanSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *RescoreExecutionPlanSummary) SetCreatedAt(v time.Time) *RescoreExecutionPlanSummary { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *RescoreExecutionPlanSummary) SetId(v string) *RescoreExecutionPlanSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *RescoreExecutionPlanSummary) SetName(v string) *RescoreExecutionPlanSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RescoreExecutionPlanSummary) SetStatus(v string) *RescoreExecutionPlanSummary { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *RescoreExecutionPlanSummary) SetUpdatedAt(v time.Time) *RescoreExecutionPlanSummary { - s.UpdatedAt = &v - return s -} - -type RescoreInput struct { - _ struct{} `type:"structure"` - - // The list of documents for Amazon Kendra Intelligent Ranking to rescore or - // rank on. - // - // Documents is a required field - Documents []*Document `min:"1" type:"list" required:"true"` - - // The identifier of the rescore execution plan. A rescore execution plan is - // an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore - // API. - // - // RescoreExecutionPlanId is a required field - RescoreExecutionPlanId *string `min:"36" type:"string" required:"true"` - - // The input query from the search service. - // - // SearchQuery is a required field - SearchQuery *string `min:"1" 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 RescoreInput) 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 RescoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RescoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RescoreInput"} - if s.Documents == nil { - invalidParams.Add(request.NewErrParamRequired("Documents")) - } - if s.Documents != nil && len(s.Documents) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Documents", 1)) - } - if s.RescoreExecutionPlanId == nil { - invalidParams.Add(request.NewErrParamRequired("RescoreExecutionPlanId")) - } - if s.RescoreExecutionPlanId != nil && len(*s.RescoreExecutionPlanId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("RescoreExecutionPlanId", 36)) - } - if s.SearchQuery == nil { - invalidParams.Add(request.NewErrParamRequired("SearchQuery")) - } - if s.SearchQuery != nil && len(*s.SearchQuery) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SearchQuery", 1)) - } - if s.Documents != nil { - for i, v := range s.Documents { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Documents", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocuments sets the Documents field's value. -func (s *RescoreInput) SetDocuments(v []*Document) *RescoreInput { - s.Documents = v - return s -} - -// SetRescoreExecutionPlanId sets the RescoreExecutionPlanId field's value. -func (s *RescoreInput) SetRescoreExecutionPlanId(v string) *RescoreInput { - s.RescoreExecutionPlanId = &v - return s -} - -// SetSearchQuery sets the SearchQuery field's value. -func (s *RescoreInput) SetSearchQuery(v string) *RescoreInput { - s.SearchQuery = &v - return s -} - -type RescoreOutput struct { - _ struct{} `type:"structure"` - - // The identifier associated with the scores that Amazon Kendra Intelligent - // Ranking gives to the results. Amazon Kendra Intelligent Ranking rescores - // or re-ranks the results for the search service. - RescoreId *string `min:"1" type:"string"` - - // A list of result items for documents with new relevancy scores. The results - // are in descending order. - ResultItems []*RescoreResultItem `min:"1" type:"list"` -} - -// 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 RescoreOutput) 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 RescoreOutput) GoString() string { - return s.String() -} - -// SetRescoreId sets the RescoreId field's value. -func (s *RescoreOutput) SetRescoreId(v string) *RescoreOutput { - s.RescoreId = &v - return s -} - -// SetResultItems sets the ResultItems field's value. -func (s *RescoreOutput) SetResultItems(v []*RescoreResultItem) *RescoreOutput { - s.ResultItems = v - return s -} - -// A result item for a document with a new relevancy score. -type RescoreResultItem struct { - _ struct{} `type:"structure"` - - // The identifier of the document from the search service. - DocumentId *string `min:"1" type:"string"` - - // The relevancy score or rank that Amazon Kendra Intelligent Ranking gives - // to the result. - Score *float64 `type:"float"` -} - -// 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 RescoreResultItem) 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 RescoreResultItem) GoString() string { - return s.String() -} - -// SetDocumentId sets the DocumentId field's value. -func (s *RescoreResultItem) SetDocumentId(v string) *RescoreResultItem { - s.DocumentId = &v - return s -} - -// SetScore sets the Score field's value. -func (s *RescoreResultItem) SetScore(v float64) *RescoreResultItem { - s.Score = &v - return s -} - -// The resource you want to use doesn't exist. Please check you have provided -// the correct resource and try again. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The resource you want to use is unavailable. Please check you have provided -// the correct resource information and try again. -type ResourceUnavailableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ResourceUnavailableException) 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 ResourceUnavailableException) GoString() string { - return s.String() -} - -func newErrorResourceUnavailableException(v protocol.ResponseMetadata) error { - return &ResourceUnavailableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceUnavailableException) Code() string { - return "ResourceUnavailableException" -} - -// Message returns the exception's message. -func (s *ResourceUnavailableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceUnavailableException) OrigErr() error { - return nil -} - -func (s *ResourceUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceUnavailableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceUnavailableException) RequestID() string { - return s.RespMetadata.RequestID -} - -// You have exceeded the set limits for your Amazon Kendra Intelligent Ranking -// service. Please see Quotas (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) -// for more information, or contact Support (http://aws.amazon.com/contact-us/) -// to inquire about an increase of limits. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A key-value pair that identifies or categorizes a rescore execution plan. -// A rescore execution plan is an Amazon Kendra Intelligent Ranking resource -// used for provisioning the Rescore API. You can also use a tag to help control -// access to a rescore execution plan. A tag key and value can consist of Unicode -// letters, digits, white space, and any of the following symbols: _ . : / = -// + - @. -type Tag struct { - _ struct{} `type:"structure"` - - // The key for the tag. Keys are not case sensitive and must be unique. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value associated with the tag. The value can be an empty string but it - // can't be null. - // - // Value is a required field - Value *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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// The request information for tagging a rescore execution plan. A rescore execution -// plan is an Amazon Kendra Intelligent Ranking resource used for provisioning -// the Rescore API. -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rescore execution plan to tag. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true"` - - // A list of tag keys to add to a rescore execution plan. If a tag already exists, - // the existing value is replaced with the new value. - // - // Tags is a required field - Tags []*Tag `type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -// If the action is successful, the service sends back an HTTP 200 response -// with an empty HTTP body. -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. Please reduce the number -// of requests and try again. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request information to remove a tag from a rescore execution plan. A -// rescore execution plan is an Amazon Kendra Intelligent Ranking resource used -// for provisioning the Rescore API. -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rescore execution plan to remove the - // tag. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true"` - - // A list of tag keys to remove from the rescore execution plan. If a tag key - // does not exist on the resource, it is ignored. - // - // TagKeys is a required field - TagKeys []*string `type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *UntagResourceInput) SetResourceARN(v string) *UntagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -// If the action is successful, the service sends back an HTTP 200 response -// with an empty HTTP body. -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateRescoreExecutionPlanInput struct { - _ struct{} `type:"structure"` - - // You can set additional capacity units to meet the needs of your rescore execution - // plan. You are given a single capacity unit by default. If you want to use - // the default capacity, you don't set additional capacity units. For more information - // on the default capacity and additional capacity units, see Adjusting capacity - // (https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html). - CapacityUnits *CapacityUnitsConfiguration `type:"structure"` - - // A new description for the rescore execution plan. - Description *string `type:"string"` - - // The identifier of the rescore execution plan that you want to update. - // - // Id is a required field - Id *string `min:"36" type:"string" required:"true"` - - // A new name for the rescore execution plan. - Name *string `min:"1" 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 UpdateRescoreExecutionPlanInput) 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 UpdateRescoreExecutionPlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRescoreExecutionPlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRescoreExecutionPlanInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 36 { - invalidParams.Add(request.NewErrParamMinLen("Id", 36)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.CapacityUnits != nil { - if err := s.CapacityUnits.Validate(); err != nil { - invalidParams.AddNested("CapacityUnits", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapacityUnits sets the CapacityUnits field's value. -func (s *UpdateRescoreExecutionPlanInput) SetCapacityUnits(v *CapacityUnitsConfiguration) *UpdateRescoreExecutionPlanInput { - s.CapacityUnits = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateRescoreExecutionPlanInput) SetDescription(v string) *UpdateRescoreExecutionPlanInput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateRescoreExecutionPlanInput) SetId(v string) *UpdateRescoreExecutionPlanInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateRescoreExecutionPlanInput) SetName(v string) *UpdateRescoreExecutionPlanInput { - s.Name = &v - return s -} - -type UpdateRescoreExecutionPlanOutput 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 UpdateRescoreExecutionPlanOutput) 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 UpdateRescoreExecutionPlanOutput) GoString() string { - return s.String() -} - -// The input fails to satisfy the constraints set by the Amazon Kendra Intelligent -// Ranking service. Please provide the correct input and try again. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // RescoreExecutionPlanStatusCreating is a RescoreExecutionPlanStatus enum value - RescoreExecutionPlanStatusCreating = "CREATING" - - // RescoreExecutionPlanStatusUpdating is a RescoreExecutionPlanStatus enum value - RescoreExecutionPlanStatusUpdating = "UPDATING" - - // RescoreExecutionPlanStatusActive is a RescoreExecutionPlanStatus enum value - RescoreExecutionPlanStatusActive = "ACTIVE" - - // RescoreExecutionPlanStatusDeleting is a RescoreExecutionPlanStatus enum value - RescoreExecutionPlanStatusDeleting = "DELETING" - - // RescoreExecutionPlanStatusFailed is a RescoreExecutionPlanStatus enum value - RescoreExecutionPlanStatusFailed = "FAILED" -) - -// RescoreExecutionPlanStatus_Values returns all elements of the RescoreExecutionPlanStatus enum -func RescoreExecutionPlanStatus_Values() []string { - return []string{ - RescoreExecutionPlanStatusCreating, - RescoreExecutionPlanStatusUpdating, - RescoreExecutionPlanStatusActive, - RescoreExecutionPlanStatusDeleting, - RescoreExecutionPlanStatusFailed, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/doc.go deleted file mode 100644 index bd2e25c01db0..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package kendraranking provides the client and types for making API -// requests to Amazon Kendra Intelligent Ranking. -// -// Amazon Kendra Intelligent Ranking uses Amazon Kendra semantic search capabilities -// to intelligently re-rank a search service's results. -// -// See https://docs.aws.amazon.com/goto/WebAPI/kendra-ranking-2022-10-19 for more information on this service. -// -// See kendraranking package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/kendraranking/ -// -// # Using the Client -// -// To contact Amazon Kendra Intelligent Ranking with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Kendra Intelligent Ranking client KendraRanking for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/kendraranking/#New -package kendraranking diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/errors.go deleted file mode 100644 index 67324cb6c18a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/errors.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kendraranking - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don’t have sufficient access to perform this action. Please ensure - // you have the required permission policies and user accounts and try again. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // A conflict occurred with the request. Please fix any inconsistencies with - // your resources and try again. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An issue occurred with the internal server used for your Amazon Kendra Intelligent - // Ranking service. Please wait a few minutes and try again, or contact Support - // (http://aws.amazon.com/contact-us/) for help. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource you want to use doesn't exist. Please check you have provided - // the correct resource and try again. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeResourceUnavailableException for service response error code - // "ResourceUnavailableException". - // - // The resource you want to use is unavailable. Please check you have provided - // the correct resource information and try again. - ErrCodeResourceUnavailableException = "ResourceUnavailableException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // You have exceeded the set limits for your Amazon Kendra Intelligent Ranking - // service. Please see Quotas (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) - // for more information, or contact Support (http://aws.amazon.com/contact-us/) - // to inquire about an increase of limits. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. Please reduce the number - // of requests and try again. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints set by the Amazon Kendra Intelligent - // Ranking service. Please provide the correct input and try again. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ResourceUnavailableException": newErrorResourceUnavailableException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/kendrarankingiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/kendrarankingiface/interface.go deleted file mode 100644 index 709cfdea7e2a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/kendrarankingiface/interface.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package kendrarankingiface provides an interface to enable mocking the Amazon Kendra Intelligent Ranking service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package kendrarankingiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking" -) - -// KendraRankingAPI provides an interface to enable mocking the -// kendraranking.KendraRanking service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Kendra Intelligent Ranking. -// func myFunc(svc kendrarankingiface.KendraRankingAPI) bool { -// // Make svc.CreateRescoreExecutionPlan request -// } -// -// func main() { -// sess := session.New() -// svc := kendraranking.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockKendraRankingClient struct { -// kendrarankingiface.KendraRankingAPI -// } -// func (m *mockKendraRankingClient) CreateRescoreExecutionPlan(input *kendraranking.CreateRescoreExecutionPlanInput) (*kendraranking.CreateRescoreExecutionPlanOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockKendraRankingClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type KendraRankingAPI interface { - CreateRescoreExecutionPlan(*kendraranking.CreateRescoreExecutionPlanInput) (*kendraranking.CreateRescoreExecutionPlanOutput, error) - CreateRescoreExecutionPlanWithContext(aws.Context, *kendraranking.CreateRescoreExecutionPlanInput, ...request.Option) (*kendraranking.CreateRescoreExecutionPlanOutput, error) - CreateRescoreExecutionPlanRequest(*kendraranking.CreateRescoreExecutionPlanInput) (*request.Request, *kendraranking.CreateRescoreExecutionPlanOutput) - - DeleteRescoreExecutionPlan(*kendraranking.DeleteRescoreExecutionPlanInput) (*kendraranking.DeleteRescoreExecutionPlanOutput, error) - DeleteRescoreExecutionPlanWithContext(aws.Context, *kendraranking.DeleteRescoreExecutionPlanInput, ...request.Option) (*kendraranking.DeleteRescoreExecutionPlanOutput, error) - DeleteRescoreExecutionPlanRequest(*kendraranking.DeleteRescoreExecutionPlanInput) (*request.Request, *kendraranking.DeleteRescoreExecutionPlanOutput) - - DescribeRescoreExecutionPlan(*kendraranking.DescribeRescoreExecutionPlanInput) (*kendraranking.DescribeRescoreExecutionPlanOutput, error) - DescribeRescoreExecutionPlanWithContext(aws.Context, *kendraranking.DescribeRescoreExecutionPlanInput, ...request.Option) (*kendraranking.DescribeRescoreExecutionPlanOutput, error) - DescribeRescoreExecutionPlanRequest(*kendraranking.DescribeRescoreExecutionPlanInput) (*request.Request, *kendraranking.DescribeRescoreExecutionPlanOutput) - - ListRescoreExecutionPlans(*kendraranking.ListRescoreExecutionPlansInput) (*kendraranking.ListRescoreExecutionPlansOutput, error) - ListRescoreExecutionPlansWithContext(aws.Context, *kendraranking.ListRescoreExecutionPlansInput, ...request.Option) (*kendraranking.ListRescoreExecutionPlansOutput, error) - ListRescoreExecutionPlansRequest(*kendraranking.ListRescoreExecutionPlansInput) (*request.Request, *kendraranking.ListRescoreExecutionPlansOutput) - - ListRescoreExecutionPlansPages(*kendraranking.ListRescoreExecutionPlansInput, func(*kendraranking.ListRescoreExecutionPlansOutput, bool) bool) error - ListRescoreExecutionPlansPagesWithContext(aws.Context, *kendraranking.ListRescoreExecutionPlansInput, func(*kendraranking.ListRescoreExecutionPlansOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*kendraranking.ListTagsForResourceInput) (*kendraranking.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *kendraranking.ListTagsForResourceInput, ...request.Option) (*kendraranking.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*kendraranking.ListTagsForResourceInput) (*request.Request, *kendraranking.ListTagsForResourceOutput) - - Rescore(*kendraranking.RescoreInput) (*kendraranking.RescoreOutput, error) - RescoreWithContext(aws.Context, *kendraranking.RescoreInput, ...request.Option) (*kendraranking.RescoreOutput, error) - RescoreRequest(*kendraranking.RescoreInput) (*request.Request, *kendraranking.RescoreOutput) - - TagResource(*kendraranking.TagResourceInput) (*kendraranking.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *kendraranking.TagResourceInput, ...request.Option) (*kendraranking.TagResourceOutput, error) - TagResourceRequest(*kendraranking.TagResourceInput) (*request.Request, *kendraranking.TagResourceOutput) - - UntagResource(*kendraranking.UntagResourceInput) (*kendraranking.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *kendraranking.UntagResourceInput, ...request.Option) (*kendraranking.UntagResourceOutput, error) - UntagResourceRequest(*kendraranking.UntagResourceInput) (*request.Request, *kendraranking.UntagResourceOutput) - - UpdateRescoreExecutionPlan(*kendraranking.UpdateRescoreExecutionPlanInput) (*kendraranking.UpdateRescoreExecutionPlanOutput, error) - UpdateRescoreExecutionPlanWithContext(aws.Context, *kendraranking.UpdateRescoreExecutionPlanInput, ...request.Option) (*kendraranking.UpdateRescoreExecutionPlanOutput, error) - UpdateRescoreExecutionPlanRequest(*kendraranking.UpdateRescoreExecutionPlanInput) (*request.Request, *kendraranking.UpdateRescoreExecutionPlanOutput) -} - -var _ KendraRankingAPI = (*kendraranking.KendraRanking)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/service.go deleted file mode 100644 index 581e2550a429..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kendraranking/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kendraranking - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// KendraRanking provides the API operation methods for making requests to -// Amazon Kendra Intelligent Ranking. See this package's package overview docs -// for details on the service. -// -// KendraRanking methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type KendraRanking struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Kendra Ranking" // Name of service. - EndpointsID = "kendra-ranking" // ID to lookup a service endpoint with. - ServiceID = "Kendra Ranking" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the KendraRanking client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a KendraRanking client from just a session. -// svc := kendraranking.New(mySession) -// -// // Create a KendraRanking client with additional configuration -// svc := kendraranking.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *KendraRanking { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "kendra-ranking" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *KendraRanking { - svc := &KendraRanking{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-10-19", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.0", - TargetPrefix: "AWSKendraRerankingFrontendService", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a KendraRanking operation and runs any -// custom request initialization. -func (c *KendraRanking) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/api.go deleted file mode 100644 index 5b816cbcde9b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/api.go +++ /dev/null @@ -1,448 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kinesisvideowebrtcstorage - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opJoinStorageSession = "JoinStorageSession" - -// JoinStorageSessionRequest generates a "aws/request.Request" representing the -// client's request for the JoinStorageSession 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 JoinStorageSession for more information on using the JoinStorageSession -// 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 JoinStorageSessionRequest method. -// req, resp := client.JoinStorageSessionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-webrtc-storage-2018-05-10/JoinStorageSession -func (c *KinesisVideoWebRTCStorage) JoinStorageSessionRequest(input *JoinStorageSessionInput) (req *request.Request, output *JoinStorageSessionOutput) { - op := &request.Operation{ - Name: opJoinStorageSession, - HTTPMethod: "POST", - HTTPPath: "/joinStorageSession", - } - - if input == nil { - input = &JoinStorageSessionInput{} - } - - output = &JoinStorageSessionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// JoinStorageSession API operation for Amazon Kinesis Video WebRTC Storage. -// -// Join the ongoing one way-video and/or multi-way audio WebRTC session as a -// video producing device for an input channel. If there’s no existing session -// for the channel, a new streaming session needs to be created, and the Amazon -// Resource Name (ARN) of the signaling channel must be provided. -// -// Currently for the SINGLE_MASTER type, a video producing device is able to -// ingest both audio and video media into a stream, while viewers can only ingest -// audio. Both a video producing device and viewers can join the session first, -// and wait for other participants. -// -// While participants are having peer to peer conversations through webRTC, -// the ingested media session will be stored into the Kinesis Video Stream. -// Multiple viewers are able to playback real-time media. -// -// Customers can also use existing Kinesis Video Streams features like HLS or -// DASH playback, Image generation, and more with ingested WebRTC media. -// -// Assume that only one video producing device client can be associated with -// a session for the channel. If more than one client joins the session of a -// specific channel as a video producing device, the most recent client request -// takes precedence. -// -// 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 Kinesis Video WebRTC Storage's -// API operation JoinStorageSession for usage and error information. -// -// Returned Error Types: -// -// - ClientLimitExceededException -// Kinesis Video Streams has throttled the request because you have exceeded -// the limit of allowed client calls. Try making the call later. -// -// - InvalidArgumentException -// The value for this input parameter is invalid. -// -// - AccessDeniedException -// You do not have required permissions to perform this operation. -// -// - ResourceNotFoundException -// The specified resource is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-webrtc-storage-2018-05-10/JoinStorageSession -func (c *KinesisVideoWebRTCStorage) JoinStorageSession(input *JoinStorageSessionInput) (*JoinStorageSessionOutput, error) { - req, out := c.JoinStorageSessionRequest(input) - return out, req.Send() -} - -// JoinStorageSessionWithContext is the same as JoinStorageSession with the addition of -// the ability to pass a context and additional request options. -// -// See JoinStorageSession 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 *KinesisVideoWebRTCStorage) JoinStorageSessionWithContext(ctx aws.Context, input *JoinStorageSessionInput, opts ...request.Option) (*JoinStorageSessionOutput, error) { - req, out := c.JoinStorageSessionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have required permissions to perform this operation. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Kinesis Video Streams has throttled the request because you have exceeded -// the limit of allowed client calls. Try making the call later. -type ClientLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ClientLimitExceededException) 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 ClientLimitExceededException) GoString() string { - return s.String() -} - -func newErrorClientLimitExceededException(v protocol.ResponseMetadata) error { - return &ClientLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ClientLimitExceededException) Code() string { - return "ClientLimitExceededException" -} - -// Message returns the exception's message. -func (s *ClientLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ClientLimitExceededException) OrigErr() error { - return nil -} - -func (s *ClientLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ClientLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ClientLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The value for this input parameter is invalid. -type InvalidArgumentException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InvalidArgumentException) 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 InvalidArgumentException) GoString() string { - return s.String() -} - -func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { - return &InvalidArgumentException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidArgumentException) Code() string { - return "InvalidArgumentException" -} - -// Message returns the exception's message. -func (s *InvalidArgumentException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidArgumentException) OrigErr() error { - return nil -} - -func (s *InvalidArgumentException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidArgumentException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidArgumentException) RequestID() string { - return s.RespMetadata.RequestID -} - -type JoinStorageSessionInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the signaling channel. - // - // ChannelArn is a required field - ChannelArn *string `locationName:"channelArn" 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 JoinStorageSessionInput) 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 JoinStorageSessionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *JoinStorageSessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "JoinStorageSessionInput"} - if s.ChannelArn == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelArn sets the ChannelArn field's value. -func (s *JoinStorageSessionInput) SetChannelArn(v string) *JoinStorageSessionInput { - s.ChannelArn = &v - return s -} - -type JoinStorageSessionOutput 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 JoinStorageSessionOutput) 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 JoinStorageSessionOutput) GoString() string { - return s.String() -} - -// The specified resource is not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/doc.go deleted file mode 100644 index 84dc786b6803..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package kinesisvideowebrtcstorage provides the client and types for making API -// requests to Amazon Kinesis Video WebRTC Storage. -// -// See https://docs.aws.amazon.com/goto/WebAPI/kinesis-video-webrtc-storage-2018-05-10 for more information on this service. -// -// See kinesisvideowebrtcstorage package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/kinesisvideowebrtcstorage/ -// -// # Using the Client -// -// To contact Amazon Kinesis Video WebRTC Storage with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Kinesis Video WebRTC Storage client KinesisVideoWebRTCStorage for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/kinesisvideowebrtcstorage/#New -package kinesisvideowebrtcstorage diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/errors.go deleted file mode 100644 index 23901caf18fa..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/errors.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kinesisvideowebrtcstorage - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have required permissions to perform this operation. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeClientLimitExceededException for service response error code - // "ClientLimitExceededException". - // - // Kinesis Video Streams has throttled the request because you have exceeded - // the limit of allowed client calls. Try making the call later. - ErrCodeClientLimitExceededException = "ClientLimitExceededException" - - // ErrCodeInvalidArgumentException for service response error code - // "InvalidArgumentException". - // - // The value for this input parameter is invalid. - ErrCodeInvalidArgumentException = "InvalidArgumentException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource is not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ClientLimitExceededException": newErrorClientLimitExceededException, - "InvalidArgumentException": newErrorInvalidArgumentException, - "ResourceNotFoundException": newErrorResourceNotFoundException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/kinesisvideowebrtcstorageiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/kinesisvideowebrtcstorageiface/interface.go deleted file mode 100644 index 203344ed566d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/kinesisvideowebrtcstorageiface/interface.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package kinesisvideowebrtcstorageiface provides an interface to enable mocking the Amazon Kinesis Video WebRTC Storage service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package kinesisvideowebrtcstorageiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage" -) - -// KinesisVideoWebRTCStorageAPI provides an interface to enable mocking the -// kinesisvideowebrtcstorage.KinesisVideoWebRTCStorage service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Kinesis Video WebRTC Storage. -// func myFunc(svc kinesisvideowebrtcstorageiface.KinesisVideoWebRTCStorageAPI) bool { -// // Make svc.JoinStorageSession request -// } -// -// func main() { -// sess := session.New() -// svc := kinesisvideowebrtcstorage.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockKinesisVideoWebRTCStorageClient struct { -// kinesisvideowebrtcstorageiface.KinesisVideoWebRTCStorageAPI -// } -// func (m *mockKinesisVideoWebRTCStorageClient) JoinStorageSession(input *kinesisvideowebrtcstorage.JoinStorageSessionInput) (*kinesisvideowebrtcstorage.JoinStorageSessionOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockKinesisVideoWebRTCStorageClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type KinesisVideoWebRTCStorageAPI interface { - JoinStorageSession(*kinesisvideowebrtcstorage.JoinStorageSessionInput) (*kinesisvideowebrtcstorage.JoinStorageSessionOutput, error) - JoinStorageSessionWithContext(aws.Context, *kinesisvideowebrtcstorage.JoinStorageSessionInput, ...request.Option) (*kinesisvideowebrtcstorage.JoinStorageSessionOutput, error) - JoinStorageSessionRequest(*kinesisvideowebrtcstorage.JoinStorageSessionInput) (*request.Request, *kinesisvideowebrtcstorage.JoinStorageSessionOutput) -} - -var _ KinesisVideoWebRTCStorageAPI = (*kinesisvideowebrtcstorage.KinesisVideoWebRTCStorage)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/service.go deleted file mode 100644 index 469dbd4fc8c2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/kinesisvideowebrtcstorage/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package kinesisvideowebrtcstorage - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// KinesisVideoWebRTCStorage provides the API operation methods for making requests to -// Amazon Kinesis Video WebRTC Storage. See this package's package overview docs -// for details on the service. -// -// KinesisVideoWebRTCStorage methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type KinesisVideoWebRTCStorage struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Kinesis Video WebRTC Storage" // Name of service. - EndpointsID = "kinesisvideo" // ID to lookup a service endpoint with. - ServiceID = "Kinesis Video WebRTC Storage" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the KinesisVideoWebRTCStorage client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a KinesisVideoWebRTCStorage client from just a session. -// svc := kinesisvideowebrtcstorage.New(mySession) -// -// // Create a KinesisVideoWebRTCStorage client with additional configuration -// svc := kinesisvideowebrtcstorage.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *KinesisVideoWebRTCStorage { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "kinesisvideo" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *KinesisVideoWebRTCStorage { - svc := &KinesisVideoWebRTCStorage{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a KinesisVideoWebRTCStorage operation and runs any -// custom request initialization. -func (c *KinesisVideoWebRTCStorage) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/api.go deleted file mode 100644 index 137dc45b2649..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/api.go +++ /dev/null @@ -1,2703 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package launchwizard - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opCreateDeployment = "CreateDeployment" - -// CreateDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the CreateDeployment 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 CreateDeployment for more information on using the CreateDeployment -// 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 CreateDeploymentRequest method. -// req, resp := client.CreateDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/CreateDeployment -func (c *LaunchWizard) CreateDeploymentRequest(input *CreateDeploymentInput) (req *request.Request, output *CreateDeploymentOutput) { - op := &request.Operation{ - Name: opCreateDeployment, - HTTPMethod: "POST", - HTTPPath: "/createDeployment", - } - - if input == nil { - input = &CreateDeploymentInput{} - } - - output = &CreateDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDeployment API operation for AWS Launch Wizard. -// -// Creates a deployment for the given workload. Deployments created by this -// operation are not available in the Launch Wizard console to use the Clone -// deployment action on. -// -// 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 AWS Launch Wizard's -// API operation CreateDeployment for usage and error information. -// -// Returned Error Types: -// -// - ResourceLimitException -// You have exceeded an Launch Wizard resource limit. For example, you might -// have too many deployments in progress. -// -// - InternalServerException -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ResourceNotFoundException -// The specified workload or deployment resource can't be found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/CreateDeployment -func (c *LaunchWizard) CreateDeployment(input *CreateDeploymentInput) (*CreateDeploymentOutput, error) { - req, out := c.CreateDeploymentRequest(input) - return out, req.Send() -} - -// CreateDeploymentWithContext is the same as CreateDeployment with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDeployment 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 *LaunchWizard) CreateDeploymentWithContext(ctx aws.Context, input *CreateDeploymentInput, opts ...request.Option) (*CreateDeploymentOutput, error) { - req, out := c.CreateDeploymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDeployment = "DeleteDeployment" - -// DeleteDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDeployment 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 DeleteDeployment for more information on using the DeleteDeployment -// 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 DeleteDeploymentRequest method. -// req, resp := client.DeleteDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/DeleteDeployment -func (c *LaunchWizard) DeleteDeploymentRequest(input *DeleteDeploymentInput) (req *request.Request, output *DeleteDeploymentOutput) { - op := &request.Operation{ - Name: opDeleteDeployment, - HTTPMethod: "POST", - HTTPPath: "/deleteDeployment", - } - - if input == nil { - input = &DeleteDeploymentInput{} - } - - output = &DeleteDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDeployment API operation for AWS Launch Wizard. -// -// Deletes a deployment. -// -// 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 AWS Launch Wizard's -// API operation DeleteDeployment for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ResourceNotFoundException -// The specified workload or deployment resource can't be found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/DeleteDeployment -func (c *LaunchWizard) DeleteDeployment(input *DeleteDeploymentInput) (*DeleteDeploymentOutput, error) { - req, out := c.DeleteDeploymentRequest(input) - return out, req.Send() -} - -// DeleteDeploymentWithContext is the same as DeleteDeployment with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDeployment 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 *LaunchWizard) DeleteDeploymentWithContext(ctx aws.Context, input *DeleteDeploymentInput, opts ...request.Option) (*DeleteDeploymentOutput, error) { - req, out := c.DeleteDeploymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDeployment = "GetDeployment" - -// GetDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the GetDeployment 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 GetDeployment for more information on using the GetDeployment -// 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 GetDeploymentRequest method. -// req, resp := client.GetDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/GetDeployment -func (c *LaunchWizard) GetDeploymentRequest(input *GetDeploymentInput) (req *request.Request, output *GetDeploymentOutput) { - op := &request.Operation{ - Name: opGetDeployment, - HTTPMethod: "POST", - HTTPPath: "/getDeployment", - } - - if input == nil { - input = &GetDeploymentInput{} - } - - output = &GetDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeployment API operation for AWS Launch Wizard. -// -// Returns information about the deployment. -// -// 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 AWS Launch Wizard's -// API operation GetDeployment for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ResourceNotFoundException -// The specified workload or deployment resource can't be found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/GetDeployment -func (c *LaunchWizard) GetDeployment(input *GetDeploymentInput) (*GetDeploymentOutput, error) { - req, out := c.GetDeploymentRequest(input) - return out, req.Send() -} - -// GetDeploymentWithContext is the same as GetDeployment with the addition of -// the ability to pass a context and additional request options. -// -// See GetDeployment 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 *LaunchWizard) GetDeploymentWithContext(ctx aws.Context, input *GetDeploymentInput, opts ...request.Option) (*GetDeploymentOutput, error) { - req, out := c.GetDeploymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWorkload = "GetWorkload" - -// GetWorkloadRequest generates a "aws/request.Request" representing the -// client's request for the GetWorkload 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 GetWorkload for more information on using the GetWorkload -// 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 GetWorkloadRequest method. -// req, resp := client.GetWorkloadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/GetWorkload -func (c *LaunchWizard) GetWorkloadRequest(input *GetWorkloadInput) (req *request.Request, output *GetWorkloadOutput) { - op := &request.Operation{ - Name: opGetWorkload, - HTTPMethod: "POST", - HTTPPath: "/getWorkload", - } - - if input == nil { - input = &GetWorkloadInput{} - } - - output = &GetWorkloadOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWorkload API operation for AWS Launch Wizard. -// -// Returns information about a workload. -// -// 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 AWS Launch Wizard's -// API operation GetWorkload for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ResourceNotFoundException -// The specified workload or deployment resource can't be found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/GetWorkload -func (c *LaunchWizard) GetWorkload(input *GetWorkloadInput) (*GetWorkloadOutput, error) { - req, out := c.GetWorkloadRequest(input) - return out, req.Send() -} - -// GetWorkloadWithContext is the same as GetWorkload with the addition of -// the ability to pass a context and additional request options. -// -// See GetWorkload 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 *LaunchWizard) GetWorkloadWithContext(ctx aws.Context, input *GetWorkloadInput, opts ...request.Option) (*GetWorkloadOutput, error) { - req, out := c.GetWorkloadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListDeploymentEvents = "ListDeploymentEvents" - -// ListDeploymentEventsRequest generates a "aws/request.Request" representing the -// client's request for the ListDeploymentEvents 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 ListDeploymentEvents for more information on using the ListDeploymentEvents -// 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 ListDeploymentEventsRequest method. -// req, resp := client.ListDeploymentEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/ListDeploymentEvents -func (c *LaunchWizard) ListDeploymentEventsRequest(input *ListDeploymentEventsInput) (req *request.Request, output *ListDeploymentEventsOutput) { - op := &request.Operation{ - Name: opListDeploymentEvents, - HTTPMethod: "POST", - HTTPPath: "/listDeploymentEvents", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDeploymentEventsInput{} - } - - output = &ListDeploymentEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeploymentEvents API operation for AWS Launch Wizard. -// -// Lists the events of a deployment. -// -// 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 AWS Launch Wizard's -// API operation ListDeploymentEvents for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ResourceNotFoundException -// The specified workload or deployment resource can't be found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/ListDeploymentEvents -func (c *LaunchWizard) ListDeploymentEvents(input *ListDeploymentEventsInput) (*ListDeploymentEventsOutput, error) { - req, out := c.ListDeploymentEventsRequest(input) - return out, req.Send() -} - -// ListDeploymentEventsWithContext is the same as ListDeploymentEvents with the addition of -// the ability to pass a context and additional request options. -// -// See ListDeploymentEvents 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 *LaunchWizard) ListDeploymentEventsWithContext(ctx aws.Context, input *ListDeploymentEventsInput, opts ...request.Option) (*ListDeploymentEventsOutput, error) { - req, out := c.ListDeploymentEventsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDeploymentEventsPages iterates over the pages of a ListDeploymentEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeploymentEvents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDeploymentEvents operation. -// pageNum := 0 -// err := client.ListDeploymentEventsPages(params, -// func(page *launchwizard.ListDeploymentEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LaunchWizard) ListDeploymentEventsPages(input *ListDeploymentEventsInput, fn func(*ListDeploymentEventsOutput, bool) bool) error { - return c.ListDeploymentEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDeploymentEventsPagesWithContext same as ListDeploymentEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LaunchWizard) ListDeploymentEventsPagesWithContext(ctx aws.Context, input *ListDeploymentEventsInput, fn func(*ListDeploymentEventsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDeploymentEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDeploymentEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDeploymentEventsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDeployments = "ListDeployments" - -// ListDeploymentsRequest generates a "aws/request.Request" representing the -// client's request for the ListDeployments 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 ListDeployments for more information on using the ListDeployments -// 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 ListDeploymentsRequest method. -// req, resp := client.ListDeploymentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/ListDeployments -func (c *LaunchWizard) ListDeploymentsRequest(input *ListDeploymentsInput) (req *request.Request, output *ListDeploymentsOutput) { - op := &request.Operation{ - Name: opListDeployments, - HTTPMethod: "POST", - HTTPPath: "/listDeployments", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDeploymentsInput{} - } - - output = &ListDeploymentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeployments API operation for AWS Launch Wizard. -// -// Lists the deployments that have been created. -// -// 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 AWS Launch Wizard's -// API operation ListDeployments for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/ListDeployments -func (c *LaunchWizard) ListDeployments(input *ListDeploymentsInput) (*ListDeploymentsOutput, error) { - req, out := c.ListDeploymentsRequest(input) - return out, req.Send() -} - -// ListDeploymentsWithContext is the same as ListDeployments with the addition of -// the ability to pass a context and additional request options. -// -// See ListDeployments 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 *LaunchWizard) ListDeploymentsWithContext(ctx aws.Context, input *ListDeploymentsInput, opts ...request.Option) (*ListDeploymentsOutput, error) { - req, out := c.ListDeploymentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDeploymentsPages iterates over the pages of a ListDeployments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeployments method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDeployments operation. -// pageNum := 0 -// err := client.ListDeploymentsPages(params, -// func(page *launchwizard.ListDeploymentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LaunchWizard) ListDeploymentsPages(input *ListDeploymentsInput, fn func(*ListDeploymentsOutput, bool) bool) error { - return c.ListDeploymentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDeploymentsPagesWithContext same as ListDeploymentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LaunchWizard) ListDeploymentsPagesWithContext(ctx aws.Context, input *ListDeploymentsInput, fn func(*ListDeploymentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDeploymentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDeploymentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDeploymentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkloadDeploymentPatterns = "ListWorkloadDeploymentPatterns" - -// ListWorkloadDeploymentPatternsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkloadDeploymentPatterns 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 ListWorkloadDeploymentPatterns for more information on using the ListWorkloadDeploymentPatterns -// 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 ListWorkloadDeploymentPatternsRequest method. -// req, resp := client.ListWorkloadDeploymentPatternsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/ListWorkloadDeploymentPatterns -func (c *LaunchWizard) ListWorkloadDeploymentPatternsRequest(input *ListWorkloadDeploymentPatternsInput) (req *request.Request, output *ListWorkloadDeploymentPatternsOutput) { - op := &request.Operation{ - Name: opListWorkloadDeploymentPatterns, - HTTPMethod: "POST", - HTTPPath: "/listWorkloadDeploymentPatterns", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkloadDeploymentPatternsInput{} - } - - output = &ListWorkloadDeploymentPatternsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWorkloadDeploymentPatterns API operation for AWS Launch Wizard. -// -// Lists the workload deployment patterns. -// -// 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 AWS Launch Wizard's -// API operation ListWorkloadDeploymentPatterns for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ResourceNotFoundException -// The specified workload or deployment resource can't be found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/ListWorkloadDeploymentPatterns -func (c *LaunchWizard) ListWorkloadDeploymentPatterns(input *ListWorkloadDeploymentPatternsInput) (*ListWorkloadDeploymentPatternsOutput, error) { - req, out := c.ListWorkloadDeploymentPatternsRequest(input) - return out, req.Send() -} - -// ListWorkloadDeploymentPatternsWithContext is the same as ListWorkloadDeploymentPatterns with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkloadDeploymentPatterns 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 *LaunchWizard) ListWorkloadDeploymentPatternsWithContext(ctx aws.Context, input *ListWorkloadDeploymentPatternsInput, opts ...request.Option) (*ListWorkloadDeploymentPatternsOutput, error) { - req, out := c.ListWorkloadDeploymentPatternsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkloadDeploymentPatternsPages iterates over the pages of a ListWorkloadDeploymentPatterns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkloadDeploymentPatterns method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkloadDeploymentPatterns operation. -// pageNum := 0 -// err := client.ListWorkloadDeploymentPatternsPages(params, -// func(page *launchwizard.ListWorkloadDeploymentPatternsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LaunchWizard) ListWorkloadDeploymentPatternsPages(input *ListWorkloadDeploymentPatternsInput, fn func(*ListWorkloadDeploymentPatternsOutput, bool) bool) error { - return c.ListWorkloadDeploymentPatternsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkloadDeploymentPatternsPagesWithContext same as ListWorkloadDeploymentPatternsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LaunchWizard) ListWorkloadDeploymentPatternsPagesWithContext(ctx aws.Context, input *ListWorkloadDeploymentPatternsInput, fn func(*ListWorkloadDeploymentPatternsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkloadDeploymentPatternsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkloadDeploymentPatternsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkloadDeploymentPatternsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkloads = "ListWorkloads" - -// ListWorkloadsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkloads 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 ListWorkloads for more information on using the ListWorkloads -// 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 ListWorkloadsRequest method. -// req, resp := client.ListWorkloadsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/ListWorkloads -func (c *LaunchWizard) ListWorkloadsRequest(input *ListWorkloadsInput) (req *request.Request, output *ListWorkloadsOutput) { - op := &request.Operation{ - Name: opListWorkloads, - HTTPMethod: "POST", - HTTPPath: "/listWorkloads", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkloadsInput{} - } - - output = &ListWorkloadsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWorkloads API operation for AWS Launch Wizard. -// -// Lists the workloads. -// -// 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 AWS Launch Wizard's -// API operation ListWorkloads for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10/ListWorkloads -func (c *LaunchWizard) ListWorkloads(input *ListWorkloadsInput) (*ListWorkloadsOutput, error) { - req, out := c.ListWorkloadsRequest(input) - return out, req.Send() -} - -// ListWorkloadsWithContext is the same as ListWorkloads with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkloads 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 *LaunchWizard) ListWorkloadsWithContext(ctx aws.Context, input *ListWorkloadsInput, opts ...request.Option) (*ListWorkloadsOutput, error) { - req, out := c.ListWorkloadsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkloadsPages iterates over the pages of a ListWorkloads operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkloads method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkloads operation. -// pageNum := 0 -// err := client.ListWorkloadsPages(params, -// func(page *launchwizard.ListWorkloadsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LaunchWizard) ListWorkloadsPages(input *ListWorkloadsInput, fn func(*ListWorkloadsOutput, bool) bool) error { - return c.ListWorkloadsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkloadsPagesWithContext same as ListWorkloadsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LaunchWizard) ListWorkloadsPagesWithContext(ctx aws.Context, input *ListWorkloadsInput, fn func(*ListWorkloadsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkloadsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkloadsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkloadsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -type CreateDeploymentInput struct { - _ struct{} `type:"structure"` - - // The name of the deployment pattern supported by a given workload. You can - // use the ListWorkloadDeploymentPatterns (https://docs.aws.amazon.com/launchwizard/latest/APIReference/API_ListWorkloadDeploymentPatterns.html) - // operation to discover supported values for this parameter. - // - // DeploymentPatternName is a required field - DeploymentPatternName *string `locationName:"deploymentPatternName" min:"1" type:"string" required:"true"` - - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` - - // The name of the deployment. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The settings specified for the deployment. For more information on the specifications - // required for creating a deployment, see Workload specifications (https://docs.aws.amazon.com/launchwizard/latest/APIReference/launch-wizard-specifications.html). - // - // Specifications is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateDeploymentInput's - // String and GoString methods. - // - // Specifications is a required field - Specifications map[string]*string `locationName:"specifications" min:"1" type:"map" required:"true" sensitive:"true"` - - // The name of the workload. You can use the ListWorkloadDeploymentPatterns - // (https://docs.aws.amazon.com/launchwizard/latest/APIReference/API_ListWorkloadDeploymentPatterns.html) - // operation to discover supported values for this parameter. - // - // WorkloadName is a required field - WorkloadName *string `locationName:"workloadName" min:"1" 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 CreateDeploymentInput) 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 CreateDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentInput"} - if s.DeploymentPatternName == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentPatternName")) - } - if s.DeploymentPatternName != nil && len(*s.DeploymentPatternName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentPatternName", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Specifications == nil { - invalidParams.Add(request.NewErrParamRequired("Specifications")) - } - if s.Specifications != nil && len(s.Specifications) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Specifications", 1)) - } - if s.WorkloadName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkloadName")) - } - if s.WorkloadName != nil && len(*s.WorkloadName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkloadName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentPatternName sets the DeploymentPatternName field's value. -func (s *CreateDeploymentInput) SetDeploymentPatternName(v string) *CreateDeploymentInput { - s.DeploymentPatternName = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateDeploymentInput) SetDryRun(v bool) *CreateDeploymentInput { - s.DryRun = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateDeploymentInput) SetName(v string) *CreateDeploymentInput { - s.Name = &v - return s -} - -// SetSpecifications sets the Specifications field's value. -func (s *CreateDeploymentInput) SetSpecifications(v map[string]*string) *CreateDeploymentInput { - s.Specifications = v - return s -} - -// SetWorkloadName sets the WorkloadName field's value. -func (s *CreateDeploymentInput) SetWorkloadName(v string) *CreateDeploymentInput { - s.WorkloadName = &v - return s -} - -type CreateDeploymentOutput struct { - _ struct{} `type:"structure"` - - // The ID of the deployment. - DeploymentId *string `locationName:"deploymentId" min:"2" 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 CreateDeploymentOutput) 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 CreateDeploymentOutput) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *CreateDeploymentOutput) SetDeploymentId(v string) *CreateDeploymentOutput { - s.DeploymentId = &v - return s -} - -type DeleteDeploymentInput struct { - _ struct{} `type:"structure"` - - // The ID of the deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" min:"2" 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 DeleteDeploymentInput) 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 DeleteDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDeploymentInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.DeploymentId != nil && len(*s.DeploymentId) < 2 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentId", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *DeleteDeploymentInput) SetDeploymentId(v string) *DeleteDeploymentInput { - s.DeploymentId = &v - return s -} - -type DeleteDeploymentOutput struct { - _ struct{} `type:"structure"` - - // The status of the deployment. - Status *string `locationName:"status" type:"string" enum:"DeploymentStatus"` - - // The reason for the deployment status. - StatusReason *string `locationName:"statusReason" 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 DeleteDeploymentOutput) 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 DeleteDeploymentOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *DeleteDeploymentOutput) SetStatus(v string) *DeleteDeploymentOutput { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *DeleteDeploymentOutput) SetStatusReason(v string) *DeleteDeploymentOutput { - s.StatusReason = &v - return s -} - -// The data associated with a deployment. -type DeploymentData struct { - _ struct{} `type:"structure"` - - // The time the deployment was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The time the deployment was deleted. - DeletedAt *time.Time `locationName:"deletedAt" type:"timestamp"` - - // The ID of the deployment. - Id *string `locationName:"id" min:"2" type:"string"` - - // The name of the deployment. - Name *string `locationName:"name" type:"string"` - - // The pattern name of the deployment. - PatternName *string `locationName:"patternName" min:"1" type:"string"` - - // The resource group of the deployment. - ResourceGroup *string `locationName:"resourceGroup" type:"string"` - - // The specifications of the deployment. For more information on specifications - // for each deployment, see Workload specifications (https://docs.aws.amazon.com/launchwizard/latest/APIReference/launch-wizard-specifications.html). - // - // Specifications is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DeploymentData's - // String and GoString methods. - Specifications map[string]*string `locationName:"specifications" min:"1" type:"map" sensitive:"true"` - - // The status of the deployment. - Status *string `locationName:"status" type:"string" enum:"DeploymentStatus"` - - // The name of the workload. - WorkloadName *string `locationName:"workloadName" min:"1" 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 DeploymentData) 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 DeploymentData) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DeploymentData) SetCreatedAt(v time.Time) *DeploymentData { - s.CreatedAt = &v - return s -} - -// SetDeletedAt sets the DeletedAt field's value. -func (s *DeploymentData) SetDeletedAt(v time.Time) *DeploymentData { - s.DeletedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeploymentData) SetId(v string) *DeploymentData { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeploymentData) SetName(v string) *DeploymentData { - s.Name = &v - return s -} - -// SetPatternName sets the PatternName field's value. -func (s *DeploymentData) SetPatternName(v string) *DeploymentData { - s.PatternName = &v - return s -} - -// SetResourceGroup sets the ResourceGroup field's value. -func (s *DeploymentData) SetResourceGroup(v string) *DeploymentData { - s.ResourceGroup = &v - return s -} - -// SetSpecifications sets the Specifications field's value. -func (s *DeploymentData) SetSpecifications(v map[string]*string) *DeploymentData { - s.Specifications = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeploymentData) SetStatus(v string) *DeploymentData { - s.Status = &v - return s -} - -// SetWorkloadName sets the WorkloadName field's value. -func (s *DeploymentData) SetWorkloadName(v string) *DeploymentData { - s.WorkloadName = &v - return s -} - -// A summary of the deployment data. -type DeploymentDataSummary struct { - _ struct{} `type:"structure"` - - // The time the deployment was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The ID of the deployment. - Id *string `locationName:"id" min:"2" type:"string"` - - // The name of the deployment - Name *string `locationName:"name" type:"string"` - - // The name of the workload deployment pattern. - PatternName *string `locationName:"patternName" min:"1" type:"string"` - - // The status of the deployment. - Status *string `locationName:"status" type:"string" enum:"DeploymentStatus"` - - // The name of the workload. - WorkloadName *string `locationName:"workloadName" min:"1" 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 DeploymentDataSummary) 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 DeploymentDataSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DeploymentDataSummary) SetCreatedAt(v time.Time) *DeploymentDataSummary { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeploymentDataSummary) SetId(v string) *DeploymentDataSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeploymentDataSummary) SetName(v string) *DeploymentDataSummary { - s.Name = &v - return s -} - -// SetPatternName sets the PatternName field's value. -func (s *DeploymentDataSummary) SetPatternName(v string) *DeploymentDataSummary { - s.PatternName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeploymentDataSummary) SetStatus(v string) *DeploymentDataSummary { - s.Status = &v - return s -} - -// SetWorkloadName sets the WorkloadName field's value. -func (s *DeploymentDataSummary) SetWorkloadName(v string) *DeploymentDataSummary { - s.WorkloadName = &v - return s -} - -// A summary of the deployment event data. -type DeploymentEventDataSummary struct { - _ struct{} `type:"structure"` - - // The description of the deployment event. - Description *string `locationName:"description" type:"string"` - - // The name of the deployment event. - Name *string `locationName:"name" type:"string"` - - // The status of the deployment event. - Status *string `locationName:"status" type:"string" enum:"EventStatus"` - - // The reason of the deployment event status. - StatusReason *string `locationName:"statusReason" type:"string"` - - // The timestamp of the deployment event. - Timestamp *time.Time `locationName:"timestamp" type:"timestamp"` -} - -// 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 DeploymentEventDataSummary) 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 DeploymentEventDataSummary) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *DeploymentEventDataSummary) SetDescription(v string) *DeploymentEventDataSummary { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeploymentEventDataSummary) SetName(v string) *DeploymentEventDataSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeploymentEventDataSummary) SetStatus(v string) *DeploymentEventDataSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *DeploymentEventDataSummary) SetStatusReason(v string) *DeploymentEventDataSummary { - s.StatusReason = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *DeploymentEventDataSummary) SetTimestamp(v time.Time) *DeploymentEventDataSummary { - s.Timestamp = &v - return s -} - -// A filter name and value pair that is used to return more specific results -// from a describe operation. Filters can be used to match a set of resources -// by specific criteria. -type DeploymentFilter struct { - _ struct{} `type:"structure"` - - // The name of the filter. Filter names are case-sensitive. - Name *string `locationName:"name" type:"string" enum:"DeploymentFilterKey"` - - // The filter values. Filter values are case-sensitive. If you specify multiple - // values for a filter, the values are joined with an OR, and the request returns - // all results that match any of the specified values. - Values []*string `locationName:"values" type:"list"` -} - -// 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 DeploymentFilter) 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 DeploymentFilter) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *DeploymentFilter) SetName(v string) *DeploymentFilter { - s.Name = &v - return s -} - -// SetValues sets the Values field's value. -func (s *DeploymentFilter) SetValues(v []*string) *DeploymentFilter { - s.Values = v - return s -} - -type GetDeploymentInput struct { - _ struct{} `type:"structure"` - - // The ID of the deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" min:"2" 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 GetDeploymentInput) 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 GetDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeploymentInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.DeploymentId != nil && len(*s.DeploymentId) < 2 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentId", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentInput) SetDeploymentId(v string) *GetDeploymentInput { - s.DeploymentId = &v - return s -} - -type GetDeploymentOutput struct { - _ struct{} `type:"structure"` - - // An object that details the deployment. - Deployment *DeploymentData `locationName:"deployment" 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 GetDeploymentOutput) 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 GetDeploymentOutput) GoString() string { - return s.String() -} - -// SetDeployment sets the Deployment field's value. -func (s *GetDeploymentOutput) SetDeployment(v *DeploymentData) *GetDeploymentOutput { - s.Deployment = v - return s -} - -type GetWorkloadInput struct { - _ struct{} `type:"structure"` - - // The name of the workload. - // - // WorkloadName is a required field - WorkloadName *string `locationName:"workloadName" min:"1" 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 GetWorkloadInput) 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 GetWorkloadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWorkloadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWorkloadInput"} - if s.WorkloadName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkloadName")) - } - if s.WorkloadName != nil && len(*s.WorkloadName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkloadName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkloadName sets the WorkloadName field's value. -func (s *GetWorkloadInput) SetWorkloadName(v string) *GetWorkloadInput { - s.WorkloadName = &v - return s -} - -type GetWorkloadOutput struct { - _ struct{} `type:"structure"` - - // Information about the workload. - Workload *WorkloadData `locationName:"workload" 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 GetWorkloadOutput) 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 GetWorkloadOutput) GoString() string { - return s.String() -} - -// SetWorkload sets the Workload field's value. -func (s *GetWorkloadOutput) SetWorkload(v *WorkloadData) *GetWorkloadOutput { - s.Workload = v - return s -} - -// An internal error has occurred. Retry your request, but if the problem persists, -// contact us with details by posting a question on re:Post (https://repost.aws/). -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListDeploymentEventsInput struct { - _ struct{} `type:"structure"` - - // The ID of the deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" min:"2" type:"string" required:"true"` - - // The maximum number of items to return for this request. To get the next page - // of items, make another request with the token returned in the output. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token returned from a previous paginated request. Pagination continues - // from the end of the items returned by the previous request. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDeploymentEventsInput) 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 ListDeploymentEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeploymentEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeploymentEventsInput"} - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.DeploymentId != nil && len(*s.DeploymentId) < 2 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentId", 2)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *ListDeploymentEventsInput) SetDeploymentId(v string) *ListDeploymentEventsInput { - s.DeploymentId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDeploymentEventsInput) SetMaxResults(v int64) *ListDeploymentEventsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentEventsInput) SetNextToken(v string) *ListDeploymentEventsInput { - s.NextToken = &v - return s -} - -type ListDeploymentEventsOutput struct { - _ struct{} `type:"structure"` - - // Lists the deployment events. - DeploymentEvents []*DeploymentEventDataSummary `locationName:"deploymentEvents" type:"list"` - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDeploymentEventsOutput) 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 ListDeploymentEventsOutput) GoString() string { - return s.String() -} - -// SetDeploymentEvents sets the DeploymentEvents field's value. -func (s *ListDeploymentEventsOutput) SetDeploymentEvents(v []*DeploymentEventDataSummary) *ListDeploymentEventsOutput { - s.DeploymentEvents = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentEventsOutput) SetNextToken(v string) *ListDeploymentEventsOutput { - s.NextToken = &v - return s -} - -type ListDeploymentsInput struct { - _ struct{} `type:"structure"` - - // Filters to scope the results. The following filters are supported: - // - // * WORKLOAD_NAME - // - // * DEPLOYMENT_STATUS - Filters []*DeploymentFilter `locationName:"filters" min:"1" type:"list"` - - // The maximum number of items to return for this request. To get the next page - // of items, make another request with the token returned in the output. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token returned from a previous paginated request. Pagination continues - // from the end of the items returned by the previous request. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDeploymentsInput) 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 ListDeploymentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeploymentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeploymentsInput"} - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListDeploymentsInput) SetFilters(v []*DeploymentFilter) *ListDeploymentsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDeploymentsInput) SetMaxResults(v int64) *ListDeploymentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentsInput) SetNextToken(v string) *ListDeploymentsInput { - s.NextToken = &v - return s -} - -type ListDeploymentsOutput struct { - _ struct{} `type:"structure"` - - // Lists the deployments. - Deployments []*DeploymentDataSummary `locationName:"deployments" type:"list"` - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDeploymentsOutput) 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 ListDeploymentsOutput) GoString() string { - return s.String() -} - -// SetDeployments sets the Deployments field's value. -func (s *ListDeploymentsOutput) SetDeployments(v []*DeploymentDataSummary) *ListDeploymentsOutput { - s.Deployments = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentsOutput) SetNextToken(v string) *ListDeploymentsOutput { - s.NextToken = &v - return s -} - -type ListWorkloadDeploymentPatternsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return for this request. To get the next page - // of items, make another request with the token returned in the output. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token returned from a previous paginated request. Pagination continues - // from the end of the items returned by the previous request. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The name of the workload. - // - // WorkloadName is a required field - WorkloadName *string `locationName:"workloadName" min:"1" 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 ListWorkloadDeploymentPatternsInput) 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 ListWorkloadDeploymentPatternsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkloadDeploymentPatternsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkloadDeploymentPatternsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.WorkloadName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkloadName")) - } - if s.WorkloadName != nil && len(*s.WorkloadName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkloadName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkloadDeploymentPatternsInput) SetMaxResults(v int64) *ListWorkloadDeploymentPatternsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkloadDeploymentPatternsInput) SetNextToken(v string) *ListWorkloadDeploymentPatternsInput { - s.NextToken = &v - return s -} - -// SetWorkloadName sets the WorkloadName field's value. -func (s *ListWorkloadDeploymentPatternsInput) SetWorkloadName(v string) *ListWorkloadDeploymentPatternsInput { - s.WorkloadName = &v - return s -} - -type ListWorkloadDeploymentPatternsOutput struct { - _ struct{} `type:"structure"` - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Describes the workload deployment patterns. - WorkloadDeploymentPatterns []*WorkloadDeploymentPatternDataSummary `locationName:"workloadDeploymentPatterns" type:"list"` -} - -// 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 ListWorkloadDeploymentPatternsOutput) 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 ListWorkloadDeploymentPatternsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkloadDeploymentPatternsOutput) SetNextToken(v string) *ListWorkloadDeploymentPatternsOutput { - s.NextToken = &v - return s -} - -// SetWorkloadDeploymentPatterns sets the WorkloadDeploymentPatterns field's value. -func (s *ListWorkloadDeploymentPatternsOutput) SetWorkloadDeploymentPatterns(v []*WorkloadDeploymentPatternDataSummary) *ListWorkloadDeploymentPatternsOutput { - s.WorkloadDeploymentPatterns = v - return s -} - -type ListWorkloadsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return for this request. To get the next page - // of items, make another request with the token returned in the output. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token returned from a previous paginated request. Pagination continues - // from the end of the items returned by the previous request. - NextToken *string `locationName:"nextToken" min:"1" 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 ListWorkloadsInput) 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 ListWorkloadsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkloadsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkloadsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkloadsInput) SetMaxResults(v int64) *ListWorkloadsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkloadsInput) SetNextToken(v string) *ListWorkloadsInput { - s.NextToken = &v - return s -} - -type ListWorkloadsOutput struct { - _ struct{} `type:"structure"` - - // The token to include in another request to get the next page of items. This - // value is null when there are no more items to return. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Information about the workloads. - Workloads []*WorkloadDataSummary `locationName:"workloads" type:"list"` -} - -// 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 ListWorkloadsOutput) 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 ListWorkloadsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkloadsOutput) SetNextToken(v string) *ListWorkloadsOutput { - s.NextToken = &v - return s -} - -// SetWorkloads sets the Workloads field's value. -func (s *ListWorkloadsOutput) SetWorkloads(v []*WorkloadDataSummary) *ListWorkloadsOutput { - s.Workloads = v - return s -} - -// You have exceeded an Launch Wizard resource limit. For example, you might -// have too many deployments in progress. -type ResourceLimitException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceLimitException) 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 ResourceLimitException) GoString() string { - return s.String() -} - -func newErrorResourceLimitException(v protocol.ResponseMetadata) error { - return &ResourceLimitException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceLimitException) Code() string { - return "ResourceLimitException" -} - -// Message returns the exception's message. -func (s *ResourceLimitException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceLimitException) OrigErr() error { - return nil -} - -func (s *ResourceLimitException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceLimitException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceLimitException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified workload or deployment resource can't be found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Describes a workload. -type WorkloadData struct { - _ struct{} `type:"structure"` - - // The description of a workload. - Description *string `locationName:"description" type:"string"` - - // The display name of a workload. - DisplayName *string `locationName:"displayName" type:"string"` - - // The URL of a workload document. - DocumentationUrl *string `locationName:"documentationUrl" type:"string"` - - // The URL of a workload icon. - IconUrl *string `locationName:"iconUrl" type:"string"` - - // The status of a workload. - Status *string `locationName:"status" type:"string" enum:"WorkloadStatus"` - - // The message about a workload's status. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The name of the workload. - WorkloadName *string `locationName:"workloadName" min:"1" 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 WorkloadData) 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 WorkloadData) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *WorkloadData) SetDescription(v string) *WorkloadData { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *WorkloadData) SetDisplayName(v string) *WorkloadData { - s.DisplayName = &v - return s -} - -// SetDocumentationUrl sets the DocumentationUrl field's value. -func (s *WorkloadData) SetDocumentationUrl(v string) *WorkloadData { - s.DocumentationUrl = &v - return s -} - -// SetIconUrl sets the IconUrl field's value. -func (s *WorkloadData) SetIconUrl(v string) *WorkloadData { - s.IconUrl = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *WorkloadData) SetStatus(v string) *WorkloadData { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *WorkloadData) SetStatusMessage(v string) *WorkloadData { - s.StatusMessage = &v - return s -} - -// SetWorkloadName sets the WorkloadName field's value. -func (s *WorkloadData) SetWorkloadName(v string) *WorkloadData { - s.WorkloadName = &v - return s -} - -// Describes workload data. -type WorkloadDataSummary struct { - _ struct{} `type:"structure"` - - // The display name of the workload data. - DisplayName *string `locationName:"displayName" type:"string"` - - // The name of the workload. - WorkloadName *string `locationName:"workloadName" min:"1" 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 WorkloadDataSummary) 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 WorkloadDataSummary) GoString() string { - return s.String() -} - -// SetDisplayName sets the DisplayName field's value. -func (s *WorkloadDataSummary) SetDisplayName(v string) *WorkloadDataSummary { - s.DisplayName = &v - return s -} - -// SetWorkloadName sets the WorkloadName field's value. -func (s *WorkloadDataSummary) SetWorkloadName(v string) *WorkloadDataSummary { - s.WorkloadName = &v - return s -} - -// Describes a workload deployment pattern. -type WorkloadDeploymentPatternDataSummary struct { - _ struct{} `type:"structure"` - - // The name of a workload deployment pattern. - DeploymentPatternName *string `locationName:"deploymentPatternName" min:"1" type:"string"` - - // The description of a workload deployment pattern. - Description *string `locationName:"description" type:"string"` - - // The display name of a workload deployment pattern. - DisplayName *string `locationName:"displayName" type:"string"` - - // The status of a workload deployment pattern. - Status *string `locationName:"status" type:"string" enum:"WorkloadDeploymentPatternStatus"` - - // A message about a workload deployment pattern's status. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The name of the workload. - WorkloadName *string `locationName:"workloadName" min:"1" type:"string"` - - // The name of the workload deployment pattern version. - WorkloadVersionName *string `locationName:"workloadVersionName" min:"5" 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 WorkloadDeploymentPatternDataSummary) 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 WorkloadDeploymentPatternDataSummary) GoString() string { - return s.String() -} - -// SetDeploymentPatternName sets the DeploymentPatternName field's value. -func (s *WorkloadDeploymentPatternDataSummary) SetDeploymentPatternName(v string) *WorkloadDeploymentPatternDataSummary { - s.DeploymentPatternName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *WorkloadDeploymentPatternDataSummary) SetDescription(v string) *WorkloadDeploymentPatternDataSummary { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *WorkloadDeploymentPatternDataSummary) SetDisplayName(v string) *WorkloadDeploymentPatternDataSummary { - s.DisplayName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *WorkloadDeploymentPatternDataSummary) SetStatus(v string) *WorkloadDeploymentPatternDataSummary { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *WorkloadDeploymentPatternDataSummary) SetStatusMessage(v string) *WorkloadDeploymentPatternDataSummary { - s.StatusMessage = &v - return s -} - -// SetWorkloadName sets the WorkloadName field's value. -func (s *WorkloadDeploymentPatternDataSummary) SetWorkloadName(v string) *WorkloadDeploymentPatternDataSummary { - s.WorkloadName = &v - return s -} - -// SetWorkloadVersionName sets the WorkloadVersionName field's value. -func (s *WorkloadDeploymentPatternDataSummary) SetWorkloadVersionName(v string) *WorkloadDeploymentPatternDataSummary { - s.WorkloadVersionName = &v - return s -} - -const ( - // DeploymentFilterKeyWorkloadName is a DeploymentFilterKey enum value - DeploymentFilterKeyWorkloadName = "WORKLOAD_NAME" - - // DeploymentFilterKeyDeploymentStatus is a DeploymentFilterKey enum value - DeploymentFilterKeyDeploymentStatus = "DEPLOYMENT_STATUS" -) - -// DeploymentFilterKey_Values returns all elements of the DeploymentFilterKey enum -func DeploymentFilterKey_Values() []string { - return []string{ - DeploymentFilterKeyWorkloadName, - DeploymentFilterKeyDeploymentStatus, - } -} - -const ( - // DeploymentStatusCompleted is a DeploymentStatus enum value - DeploymentStatusCompleted = "COMPLETED" - - // DeploymentStatusCreating is a DeploymentStatus enum value - DeploymentStatusCreating = "CREATING" - - // DeploymentStatusDeleteInProgress is a DeploymentStatus enum value - DeploymentStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // DeploymentStatusDeleteInitiating is a DeploymentStatus enum value - DeploymentStatusDeleteInitiating = "DELETE_INITIATING" - - // DeploymentStatusDeleteFailed is a DeploymentStatus enum value - DeploymentStatusDeleteFailed = "DELETE_FAILED" - - // DeploymentStatusDeleted is a DeploymentStatus enum value - DeploymentStatusDeleted = "DELETED" - - // DeploymentStatusFailed is a DeploymentStatus enum value - DeploymentStatusFailed = "FAILED" - - // DeploymentStatusInProgress is a DeploymentStatus enum value - DeploymentStatusInProgress = "IN_PROGRESS" - - // DeploymentStatusValidating is a DeploymentStatus enum value - DeploymentStatusValidating = "VALIDATING" -) - -// DeploymentStatus_Values returns all elements of the DeploymentStatus enum -func DeploymentStatus_Values() []string { - return []string{ - DeploymentStatusCompleted, - DeploymentStatusCreating, - DeploymentStatusDeleteInProgress, - DeploymentStatusDeleteInitiating, - DeploymentStatusDeleteFailed, - DeploymentStatusDeleted, - DeploymentStatusFailed, - DeploymentStatusInProgress, - DeploymentStatusValidating, - } -} - -const ( - // EventStatusCanceled is a EventStatus enum value - EventStatusCanceled = "CANCELED" - - // EventStatusCanceling is a EventStatus enum value - EventStatusCanceling = "CANCELING" - - // EventStatusCompleted is a EventStatus enum value - EventStatusCompleted = "COMPLETED" - - // EventStatusCreated is a EventStatus enum value - EventStatusCreated = "CREATED" - - // EventStatusFailed is a EventStatus enum value - EventStatusFailed = "FAILED" - - // EventStatusInProgress is a EventStatus enum value - EventStatusInProgress = "IN_PROGRESS" - - // EventStatusPending is a EventStatus enum value - EventStatusPending = "PENDING" - - // EventStatusTimedOut is a EventStatus enum value - EventStatusTimedOut = "TIMED_OUT" -) - -// EventStatus_Values returns all elements of the EventStatus enum -func EventStatus_Values() []string { - return []string{ - EventStatusCanceled, - EventStatusCanceling, - EventStatusCompleted, - EventStatusCreated, - EventStatusFailed, - EventStatusInProgress, - EventStatusPending, - EventStatusTimedOut, - } -} - -const ( - // WorkloadDeploymentPatternStatusActive is a WorkloadDeploymentPatternStatus enum value - WorkloadDeploymentPatternStatusActive = "ACTIVE" - - // WorkloadDeploymentPatternStatusInactive is a WorkloadDeploymentPatternStatus enum value - WorkloadDeploymentPatternStatusInactive = "INACTIVE" - - // WorkloadDeploymentPatternStatusDisabled is a WorkloadDeploymentPatternStatus enum value - WorkloadDeploymentPatternStatusDisabled = "DISABLED" - - // WorkloadDeploymentPatternStatusDeleted is a WorkloadDeploymentPatternStatus enum value - WorkloadDeploymentPatternStatusDeleted = "DELETED" -) - -// WorkloadDeploymentPatternStatus_Values returns all elements of the WorkloadDeploymentPatternStatus enum -func WorkloadDeploymentPatternStatus_Values() []string { - return []string{ - WorkloadDeploymentPatternStatusActive, - WorkloadDeploymentPatternStatusInactive, - WorkloadDeploymentPatternStatusDisabled, - WorkloadDeploymentPatternStatusDeleted, - } -} - -const ( - // WorkloadStatusActive is a WorkloadStatus enum value - WorkloadStatusActive = "ACTIVE" - - // WorkloadStatusInactive is a WorkloadStatus enum value - WorkloadStatusInactive = "INACTIVE" - - // WorkloadStatusDisabled is a WorkloadStatus enum value - WorkloadStatusDisabled = "DISABLED" - - // WorkloadStatusDeleted is a WorkloadStatus enum value - WorkloadStatusDeleted = "DELETED" -) - -// WorkloadStatus_Values returns all elements of the WorkloadStatus enum -func WorkloadStatus_Values() []string { - return []string{ - WorkloadStatusActive, - WorkloadStatusInactive, - WorkloadStatusDisabled, - WorkloadStatusDeleted, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/doc.go deleted file mode 100644 index fba4b407ec9e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package launchwizard provides the client and types for making API -// requests to AWS Launch Wizard. -// -// Launch Wizard offers a guided way of sizing, configuring, and deploying Amazon -// Web Services resources for third party applications, such as Microsoft SQL -// Server Always On and HANA based SAP systems, without the need to manually -// identify and provision individual Amazon Web Services resources. -// -// See https://docs.aws.amazon.com/goto/WebAPI/launch-wizard-2018-05-10 for more information on this service. -// -// See launchwizard package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/launchwizard/ -// -// # Using the Client -// -// To contact AWS Launch Wizard with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Launch Wizard client LaunchWizard for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/launchwizard/#New -package launchwizard diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/errors.go deleted file mode 100644 index 68028b9921cf..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/errors.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package launchwizard - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An internal error has occurred. Retry your request, but if the problem persists, - // contact us with details by posting a question on re:Post (https://repost.aws/). - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceLimitException for service response error code - // "ResourceLimitException". - // - // You have exceeded an Launch Wizard resource limit. For example, you might - // have too many deployments in progress. - ErrCodeResourceLimitException = "ResourceLimitException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified workload or deployment resource can't be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an Amazon Web Services - // service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "InternalServerException": newErrorInternalServerException, - "ResourceLimitException": newErrorResourceLimitException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/launchwizardiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/launchwizardiface/interface.go deleted file mode 100644 index 0b57181fef32..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/launchwizardiface/interface.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package launchwizardiface provides an interface to enable mocking the AWS Launch Wizard service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package launchwizardiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard" -) - -// LaunchWizardAPI provides an interface to enable mocking the -// launchwizard.LaunchWizard service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Launch Wizard. -// func myFunc(svc launchwizardiface.LaunchWizardAPI) bool { -// // Make svc.CreateDeployment request -// } -// -// func main() { -// sess := session.New() -// svc := launchwizard.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockLaunchWizardClient struct { -// launchwizardiface.LaunchWizardAPI -// } -// func (m *mockLaunchWizardClient) CreateDeployment(input *launchwizard.CreateDeploymentInput) (*launchwizard.CreateDeploymentOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockLaunchWizardClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type LaunchWizardAPI interface { - CreateDeployment(*launchwizard.CreateDeploymentInput) (*launchwizard.CreateDeploymentOutput, error) - CreateDeploymentWithContext(aws.Context, *launchwizard.CreateDeploymentInput, ...request.Option) (*launchwizard.CreateDeploymentOutput, error) - CreateDeploymentRequest(*launchwizard.CreateDeploymentInput) (*request.Request, *launchwizard.CreateDeploymentOutput) - - DeleteDeployment(*launchwizard.DeleteDeploymentInput) (*launchwizard.DeleteDeploymentOutput, error) - DeleteDeploymentWithContext(aws.Context, *launchwizard.DeleteDeploymentInput, ...request.Option) (*launchwizard.DeleteDeploymentOutput, error) - DeleteDeploymentRequest(*launchwizard.DeleteDeploymentInput) (*request.Request, *launchwizard.DeleteDeploymentOutput) - - GetDeployment(*launchwizard.GetDeploymentInput) (*launchwizard.GetDeploymentOutput, error) - GetDeploymentWithContext(aws.Context, *launchwizard.GetDeploymentInput, ...request.Option) (*launchwizard.GetDeploymentOutput, error) - GetDeploymentRequest(*launchwizard.GetDeploymentInput) (*request.Request, *launchwizard.GetDeploymentOutput) - - GetWorkload(*launchwizard.GetWorkloadInput) (*launchwizard.GetWorkloadOutput, error) - GetWorkloadWithContext(aws.Context, *launchwizard.GetWorkloadInput, ...request.Option) (*launchwizard.GetWorkloadOutput, error) - GetWorkloadRequest(*launchwizard.GetWorkloadInput) (*request.Request, *launchwizard.GetWorkloadOutput) - - ListDeploymentEvents(*launchwizard.ListDeploymentEventsInput) (*launchwizard.ListDeploymentEventsOutput, error) - ListDeploymentEventsWithContext(aws.Context, *launchwizard.ListDeploymentEventsInput, ...request.Option) (*launchwizard.ListDeploymentEventsOutput, error) - ListDeploymentEventsRequest(*launchwizard.ListDeploymentEventsInput) (*request.Request, *launchwizard.ListDeploymentEventsOutput) - - ListDeploymentEventsPages(*launchwizard.ListDeploymentEventsInput, func(*launchwizard.ListDeploymentEventsOutput, bool) bool) error - ListDeploymentEventsPagesWithContext(aws.Context, *launchwizard.ListDeploymentEventsInput, func(*launchwizard.ListDeploymentEventsOutput, bool) bool, ...request.Option) error - - ListDeployments(*launchwizard.ListDeploymentsInput) (*launchwizard.ListDeploymentsOutput, error) - ListDeploymentsWithContext(aws.Context, *launchwizard.ListDeploymentsInput, ...request.Option) (*launchwizard.ListDeploymentsOutput, error) - ListDeploymentsRequest(*launchwizard.ListDeploymentsInput) (*request.Request, *launchwizard.ListDeploymentsOutput) - - ListDeploymentsPages(*launchwizard.ListDeploymentsInput, func(*launchwizard.ListDeploymentsOutput, bool) bool) error - ListDeploymentsPagesWithContext(aws.Context, *launchwizard.ListDeploymentsInput, func(*launchwizard.ListDeploymentsOutput, bool) bool, ...request.Option) error - - ListWorkloadDeploymentPatterns(*launchwizard.ListWorkloadDeploymentPatternsInput) (*launchwizard.ListWorkloadDeploymentPatternsOutput, error) - ListWorkloadDeploymentPatternsWithContext(aws.Context, *launchwizard.ListWorkloadDeploymentPatternsInput, ...request.Option) (*launchwizard.ListWorkloadDeploymentPatternsOutput, error) - ListWorkloadDeploymentPatternsRequest(*launchwizard.ListWorkloadDeploymentPatternsInput) (*request.Request, *launchwizard.ListWorkloadDeploymentPatternsOutput) - - ListWorkloadDeploymentPatternsPages(*launchwizard.ListWorkloadDeploymentPatternsInput, func(*launchwizard.ListWorkloadDeploymentPatternsOutput, bool) bool) error - ListWorkloadDeploymentPatternsPagesWithContext(aws.Context, *launchwizard.ListWorkloadDeploymentPatternsInput, func(*launchwizard.ListWorkloadDeploymentPatternsOutput, bool) bool, ...request.Option) error - - ListWorkloads(*launchwizard.ListWorkloadsInput) (*launchwizard.ListWorkloadsOutput, error) - ListWorkloadsWithContext(aws.Context, *launchwizard.ListWorkloadsInput, ...request.Option) (*launchwizard.ListWorkloadsOutput, error) - ListWorkloadsRequest(*launchwizard.ListWorkloadsInput) (*request.Request, *launchwizard.ListWorkloadsOutput) - - ListWorkloadsPages(*launchwizard.ListWorkloadsInput, func(*launchwizard.ListWorkloadsOutput, bool) bool) error - ListWorkloadsPagesWithContext(aws.Context, *launchwizard.ListWorkloadsInput, func(*launchwizard.ListWorkloadsOutput, bool) bool, ...request.Option) error -} - -var _ LaunchWizardAPI = (*launchwizard.LaunchWizard)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/service.go deleted file mode 100644 index dee78988a028..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/launchwizard/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package launchwizard - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// LaunchWizard provides the API operation methods for making requests to -// AWS Launch Wizard. See this package's package overview docs -// for details on the service. -// -// LaunchWizard methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type LaunchWizard struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Launch Wizard" // Name of service. - EndpointsID = "launchwizard" // ID to lookup a service endpoint with. - ServiceID = "Launch Wizard" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the LaunchWizard client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a LaunchWizard client from just a session. -// svc := launchwizard.New(mySession) -// -// // Create a LaunchWizard client with additional configuration -// svc := launchwizard.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *LaunchWizard { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "launchwizard" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *LaunchWizard { - svc := &LaunchWizard{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a LaunchWizard operation and runs any -// custom request initialization. -func (c *LaunchWizard) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/api.go deleted file mode 100644 index 6019c27f78c3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/api.go +++ /dev/null @@ -1,1554 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package licensemanagerlinuxsubscriptions - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opGetServiceSettings = "GetServiceSettings" - -// GetServiceSettingsRequest generates a "aws/request.Request" representing the -// client's request for the GetServiceSettings 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 GetServiceSettings for more information on using the GetServiceSettings -// 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 GetServiceSettingsRequest method. -// req, resp := client.GetServiceSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10/GetServiceSettings -func (c *LicenseManagerLinuxSubscriptions) GetServiceSettingsRequest(input *GetServiceSettingsInput) (req *request.Request, output *GetServiceSettingsOutput) { - op := &request.Operation{ - Name: opGetServiceSettings, - HTTPMethod: "POST", - HTTPPath: "/subscription/GetServiceSettings", - } - - if input == nil { - input = &GetServiceSettingsInput{} - } - - output = &GetServiceSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetServiceSettings API operation for AWS License Manager Linux Subscriptions. -// -// Lists the Linux subscriptions service settings. -// -// 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 AWS License Manager Linux Subscriptions's -// API operation GetServiceSettings for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An exception occurred with the service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The provided input is not valid. Try your request again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10/GetServiceSettings -func (c *LicenseManagerLinuxSubscriptions) GetServiceSettings(input *GetServiceSettingsInput) (*GetServiceSettingsOutput, error) { - req, out := c.GetServiceSettingsRequest(input) - return out, req.Send() -} - -// GetServiceSettingsWithContext is the same as GetServiceSettings with the addition of -// the ability to pass a context and additional request options. -// -// See GetServiceSettings 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 *LicenseManagerLinuxSubscriptions) GetServiceSettingsWithContext(ctx aws.Context, input *GetServiceSettingsInput, opts ...request.Option) (*GetServiceSettingsOutput, error) { - req, out := c.GetServiceSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListLinuxSubscriptionInstances = "ListLinuxSubscriptionInstances" - -// ListLinuxSubscriptionInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListLinuxSubscriptionInstances 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 ListLinuxSubscriptionInstances for more information on using the ListLinuxSubscriptionInstances -// 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 ListLinuxSubscriptionInstancesRequest method. -// req, resp := client.ListLinuxSubscriptionInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10/ListLinuxSubscriptionInstances -func (c *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionInstancesRequest(input *ListLinuxSubscriptionInstancesInput) (req *request.Request, output *ListLinuxSubscriptionInstancesOutput) { - op := &request.Operation{ - Name: opListLinuxSubscriptionInstances, - HTTPMethod: "POST", - HTTPPath: "/subscription/ListLinuxSubscriptionInstances", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListLinuxSubscriptionInstancesInput{} - } - - output = &ListLinuxSubscriptionInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLinuxSubscriptionInstances API operation for AWS License Manager Linux Subscriptions. -// -// Lists the running Amazon EC2 instances that were discovered with commercial -// Linux subscriptions. -// -// 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 AWS License Manager Linux Subscriptions's -// API operation ListLinuxSubscriptionInstances for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An exception occurred with the service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The provided input is not valid. Try your request again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10/ListLinuxSubscriptionInstances -func (c *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionInstances(input *ListLinuxSubscriptionInstancesInput) (*ListLinuxSubscriptionInstancesOutput, error) { - req, out := c.ListLinuxSubscriptionInstancesRequest(input) - return out, req.Send() -} - -// ListLinuxSubscriptionInstancesWithContext is the same as ListLinuxSubscriptionInstances with the addition of -// the ability to pass a context and additional request options. -// -// See ListLinuxSubscriptionInstances 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 *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionInstancesWithContext(ctx aws.Context, input *ListLinuxSubscriptionInstancesInput, opts ...request.Option) (*ListLinuxSubscriptionInstancesOutput, error) { - req, out := c.ListLinuxSubscriptionInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListLinuxSubscriptionInstancesPages iterates over the pages of a ListLinuxSubscriptionInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLinuxSubscriptionInstances method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListLinuxSubscriptionInstances operation. -// pageNum := 0 -// err := client.ListLinuxSubscriptionInstancesPages(params, -// func(page *licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionInstancesPages(input *ListLinuxSubscriptionInstancesInput, fn func(*ListLinuxSubscriptionInstancesOutput, bool) bool) error { - return c.ListLinuxSubscriptionInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLinuxSubscriptionInstancesPagesWithContext same as ListLinuxSubscriptionInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionInstancesPagesWithContext(ctx aws.Context, input *ListLinuxSubscriptionInstancesInput, fn func(*ListLinuxSubscriptionInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLinuxSubscriptionInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLinuxSubscriptionInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListLinuxSubscriptionInstancesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListLinuxSubscriptions = "ListLinuxSubscriptions" - -// ListLinuxSubscriptionsRequest generates a "aws/request.Request" representing the -// client's request for the ListLinuxSubscriptions 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 ListLinuxSubscriptions for more information on using the ListLinuxSubscriptions -// 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 ListLinuxSubscriptionsRequest method. -// req, resp := client.ListLinuxSubscriptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10/ListLinuxSubscriptions -func (c *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionsRequest(input *ListLinuxSubscriptionsInput) (req *request.Request, output *ListLinuxSubscriptionsOutput) { - op := &request.Operation{ - Name: opListLinuxSubscriptions, - HTTPMethod: "POST", - HTTPPath: "/subscription/ListLinuxSubscriptions", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListLinuxSubscriptionsInput{} - } - - output = &ListLinuxSubscriptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLinuxSubscriptions API operation for AWS License Manager Linux Subscriptions. -// -// Lists the Linux subscriptions that have been discovered. If you have linked -// your organization, the returned results will include data aggregated across -// your accounts in Organizations. -// -// 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 AWS License Manager Linux Subscriptions's -// API operation ListLinuxSubscriptions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An exception occurred with the service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The provided input is not valid. Try your request again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10/ListLinuxSubscriptions -func (c *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptions(input *ListLinuxSubscriptionsInput) (*ListLinuxSubscriptionsOutput, error) { - req, out := c.ListLinuxSubscriptionsRequest(input) - return out, req.Send() -} - -// ListLinuxSubscriptionsWithContext is the same as ListLinuxSubscriptions with the addition of -// the ability to pass a context and additional request options. -// -// See ListLinuxSubscriptions 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 *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionsWithContext(ctx aws.Context, input *ListLinuxSubscriptionsInput, opts ...request.Option) (*ListLinuxSubscriptionsOutput, error) { - req, out := c.ListLinuxSubscriptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListLinuxSubscriptionsPages iterates over the pages of a ListLinuxSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLinuxSubscriptions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListLinuxSubscriptions operation. -// pageNum := 0 -// err := client.ListLinuxSubscriptionsPages(params, -// func(page *licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionsPages(input *ListLinuxSubscriptionsInput, fn func(*ListLinuxSubscriptionsOutput, bool) bool) error { - return c.ListLinuxSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLinuxSubscriptionsPagesWithContext same as ListLinuxSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LicenseManagerLinuxSubscriptions) ListLinuxSubscriptionsPagesWithContext(ctx aws.Context, input *ListLinuxSubscriptionsInput, fn func(*ListLinuxSubscriptionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLinuxSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLinuxSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListLinuxSubscriptionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opUpdateServiceSettings = "UpdateServiceSettings" - -// UpdateServiceSettingsRequest generates a "aws/request.Request" representing the -// client's request for the UpdateServiceSettings 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 UpdateServiceSettings for more information on using the UpdateServiceSettings -// 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 UpdateServiceSettingsRequest method. -// req, resp := client.UpdateServiceSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10/UpdateServiceSettings -func (c *LicenseManagerLinuxSubscriptions) UpdateServiceSettingsRequest(input *UpdateServiceSettingsInput) (req *request.Request, output *UpdateServiceSettingsOutput) { - op := &request.Operation{ - Name: opUpdateServiceSettings, - HTTPMethod: "POST", - HTTPPath: "/subscription/UpdateServiceSettings", - } - - if input == nil { - input = &UpdateServiceSettingsInput{} - } - - output = &UpdateServiceSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateServiceSettings API operation for AWS License Manager Linux Subscriptions. -// -// Updates the service settings for Linux subscriptions. -// -// 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 AWS License Manager Linux Subscriptions's -// API operation UpdateServiceSettings for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An exception occurred with the service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The provided input is not valid. Try your request again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10/UpdateServiceSettings -func (c *LicenseManagerLinuxSubscriptions) UpdateServiceSettings(input *UpdateServiceSettingsInput) (*UpdateServiceSettingsOutput, error) { - req, out := c.UpdateServiceSettingsRequest(input) - return out, req.Send() -} - -// UpdateServiceSettingsWithContext is the same as UpdateServiceSettings with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateServiceSettings 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 *LicenseManagerLinuxSubscriptions) UpdateServiceSettingsWithContext(ctx aws.Context, input *UpdateServiceSettingsInput, opts ...request.Option) (*UpdateServiceSettingsOutput, error) { - req, out := c.UpdateServiceSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// A filter object that is used to return more specific results from a describe -// operation. Filters can be used to match a set of resources by specific criteria. -type Filter struct { - _ struct{} `type:"structure"` - - // The type of name to filter by. - Name *string `type:"string"` - - // An operator for filtering results. - Operator *string `min:"1" type:"string" enum:"Operator"` - - // One or more values for the name to filter by. - Values []*string `min:"1" type:"list"` -} - -// 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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Filter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Filter"} - if s.Operator != nil && len(*s.Operator) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Operator", 1)) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *Filter) SetName(v string) *Filter { - s.Name = &v - return s -} - -// SetOperator sets the Operator field's value. -func (s *Filter) SetOperator(v string) *Filter { - s.Operator = &v - return s -} - -// SetValues sets the Values field's value. -func (s *Filter) SetValues(v []*string) *Filter { - s.Values = v - return s -} - -type GetServiceSettingsInput struct { - _ struct{} `type:"structure" nopayload:"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 GetServiceSettingsInput) 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 GetServiceSettingsInput) GoString() string { - return s.String() -} - -type GetServiceSettingsOutput struct { - _ struct{} `type:"structure"` - - // The Region in which License Manager displays the aggregated data for Linux - // subscriptions. - HomeRegions []*string `min:"1" type:"list"` - - // Lists if discovery has been enabled for Linux subscriptions. - LinuxSubscriptionsDiscovery *string `type:"string" enum:"LinuxSubscriptionsDiscovery"` - - // Lists the settings defined for Linux subscriptions discovery. The settings - // include if Organizations integration has been enabled, and which Regions - // data will be aggregated from. - LinuxSubscriptionsDiscoverySettings *LinuxSubscriptionsDiscoverySettings `type:"structure"` - - // Indicates the status of Linux subscriptions settings being applied. - Status *string `type:"string" enum:"Status"` - - // A message which details the Linux subscriptions service settings current - // status. - StatusMessage map[string]*string `type:"map"` -} - -// 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 GetServiceSettingsOutput) 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 GetServiceSettingsOutput) GoString() string { - return s.String() -} - -// SetHomeRegions sets the HomeRegions field's value. -func (s *GetServiceSettingsOutput) SetHomeRegions(v []*string) *GetServiceSettingsOutput { - s.HomeRegions = v - return s -} - -// SetLinuxSubscriptionsDiscovery sets the LinuxSubscriptionsDiscovery field's value. -func (s *GetServiceSettingsOutput) SetLinuxSubscriptionsDiscovery(v string) *GetServiceSettingsOutput { - s.LinuxSubscriptionsDiscovery = &v - return s -} - -// SetLinuxSubscriptionsDiscoverySettings sets the LinuxSubscriptionsDiscoverySettings field's value. -func (s *GetServiceSettingsOutput) SetLinuxSubscriptionsDiscoverySettings(v *LinuxSubscriptionsDiscoverySettings) *GetServiceSettingsOutput { - s.LinuxSubscriptionsDiscoverySettings = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetServiceSettingsOutput) SetStatus(v string) *GetServiceSettingsOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetServiceSettingsOutput) SetStatusMessage(v map[string]*string) *GetServiceSettingsOutput { - s.StatusMessage = v - return s -} - -// Details discovered information about a running instance using Linux subscriptions. -type Instance struct { - _ struct{} `type:"structure"` - - // The account ID which owns the instance. - AccountID *string `type:"string"` - - // The AMI ID used to launch the instance. - AmiId *string `type:"string"` - - // The instance ID of the resource. - InstanceID *string `type:"string"` - - // The instance type of the resource. - InstanceType *string `type:"string"` - - // The time in which the last discovery updated the instance details. - LastUpdatedTime *string `type:"string"` - - // The product code for the instance. For more information, see Usage operation - // values (https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html) - // in the License Manager User Guide . - ProductCode []*string `type:"list"` - - // The Region the instance is running in. - Region *string `type:"string"` - - // The status of the instance. - Status *string `type:"string"` - - // The name of the subscription being used by the instance. - SubscriptionName *string `type:"string"` - - // The usage operation of the instance. For more information, see For more information, - // see Usage operation values (https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html) - // in the License Manager User Guide. - UsageOperation *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 Instance) 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 Instance) GoString() string { - return s.String() -} - -// SetAccountID sets the AccountID field's value. -func (s *Instance) SetAccountID(v string) *Instance { - s.AccountID = &v - return s -} - -// SetAmiId sets the AmiId field's value. -func (s *Instance) SetAmiId(v string) *Instance { - s.AmiId = &v - return s -} - -// SetInstanceID sets the InstanceID field's value. -func (s *Instance) SetInstanceID(v string) *Instance { - s.InstanceID = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *Instance) SetInstanceType(v string) *Instance { - s.InstanceType = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *Instance) SetLastUpdatedTime(v string) *Instance { - s.LastUpdatedTime = &v - return s -} - -// SetProductCode sets the ProductCode field's value. -func (s *Instance) SetProductCode(v []*string) *Instance { - s.ProductCode = v - return s -} - -// SetRegion sets the Region field's value. -func (s *Instance) SetRegion(v string) *Instance { - s.Region = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Instance) SetStatus(v string) *Instance { - s.Status = &v - return s -} - -// SetSubscriptionName sets the SubscriptionName field's value. -func (s *Instance) SetSubscriptionName(v string) *Instance { - s.SubscriptionName = &v - return s -} - -// SetUsageOperation sets the UsageOperation field's value. -func (s *Instance) SetUsageOperation(v string) *Instance { - s.UsageOperation = &v - return s -} - -// An exception occurred with the service. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Lists the settings defined for discovering Linux subscriptions. -type LinuxSubscriptionsDiscoverySettings struct { - _ struct{} `type:"structure"` - - // Details if you have enabled resource discovery across your accounts in Organizations. - // - // OrganizationIntegration is a required field - OrganizationIntegration *string `type:"string" required:"true" enum:"OrganizationIntegration"` - - // The Regions in which to discover data for Linux subscriptions. - // - // SourceRegions is a required field - SourceRegions []*string `min:"1" type:"list" 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 LinuxSubscriptionsDiscoverySettings) 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 LinuxSubscriptionsDiscoverySettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LinuxSubscriptionsDiscoverySettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LinuxSubscriptionsDiscoverySettings"} - if s.OrganizationIntegration == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationIntegration")) - } - if s.SourceRegions == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegions")) - } - if s.SourceRegions != nil && len(s.SourceRegions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceRegions", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOrganizationIntegration sets the OrganizationIntegration field's value. -func (s *LinuxSubscriptionsDiscoverySettings) SetOrganizationIntegration(v string) *LinuxSubscriptionsDiscoverySettings { - s.OrganizationIntegration = &v - return s -} - -// SetSourceRegions sets the SourceRegions field's value. -func (s *LinuxSubscriptionsDiscoverySettings) SetSourceRegions(v []*string) *LinuxSubscriptionsDiscoverySettings { - s.SourceRegions = v - return s -} - -// NextToken length limit is half of ddb accepted limit. Increase this limit -// if parameters in request increases. -type ListLinuxSubscriptionInstancesInput struct { - _ struct{} `type:"structure"` - - // An array of structures that you can use to filter the results to those that - // match one or more sets of key-value pairs that you specify. For example, - // you can filter by the name of AmiID with an optional operator to see subscriptions - // that match, partially match, or don't match a certain Amazon Machine Image - // (AMI) ID. - // - // The valid names for this filter are: - // - // * AmiID - // - // * InstanceID - // - // * AccountID - // - // * Status - // - // * Region - // - // * UsageOperation - // - // * ProductCode - // - // * InstanceType - // - // The valid Operators for this filter are: - // - // * contains - // - // * equals - // - // * Notequal - Filters []*Filter `type:"list"` - - // Maximum number of results to return in a single call. - MaxResults *int64 `type:"integer"` - - // Token for the next set of results. - NextToken *string `min:"1" 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 ListLinuxSubscriptionInstancesInput) 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 ListLinuxSubscriptionInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListLinuxSubscriptionInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLinuxSubscriptionInstancesInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListLinuxSubscriptionInstancesInput) SetFilters(v []*Filter) *ListLinuxSubscriptionInstancesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListLinuxSubscriptionInstancesInput) SetMaxResults(v int64) *ListLinuxSubscriptionInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLinuxSubscriptionInstancesInput) SetNextToken(v string) *ListLinuxSubscriptionInstancesInput { - s.NextToken = &v - return s -} - -type ListLinuxSubscriptionInstancesOutput struct { - _ struct{} `type:"structure"` - - // An array that contains instance objects. - Instances []*Instance `type:"list"` - - // Token for the next set of results. - NextToken *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 ListLinuxSubscriptionInstancesOutput) 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 ListLinuxSubscriptionInstancesOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *ListLinuxSubscriptionInstancesOutput) SetInstances(v []*Instance) *ListLinuxSubscriptionInstancesOutput { - s.Instances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLinuxSubscriptionInstancesOutput) SetNextToken(v string) *ListLinuxSubscriptionInstancesOutput { - s.NextToken = &v - return s -} - -// NextToken length limit is half of ddb accepted limit. Increase this limit -// if parameters in request increases. -type ListLinuxSubscriptionsInput struct { - _ struct{} `type:"structure"` - - // An array of structures that you can use to filter the results to those that - // match one or more sets of key-value pairs that you specify. For example, - // you can filter by the name of Subscription with an optional operator to see - // subscriptions that match, partially match, or don't match a certain subscription's - // name. - // - // The valid names for this filter are: - // - // * Subscription - // - // The valid Operators for this filter are: - // - // * contains - // - // * equals - // - // * Notequal - Filters []*Filter `type:"list"` - - // Maximum number of results to return in a single call. - MaxResults *int64 `type:"integer"` - - // Token for the next set of results. - NextToken *string `min:"1" 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 ListLinuxSubscriptionsInput) 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 ListLinuxSubscriptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListLinuxSubscriptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLinuxSubscriptionsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListLinuxSubscriptionsInput) SetFilters(v []*Filter) *ListLinuxSubscriptionsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListLinuxSubscriptionsInput) SetMaxResults(v int64) *ListLinuxSubscriptionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLinuxSubscriptionsInput) SetNextToken(v string) *ListLinuxSubscriptionsInput { - s.NextToken = &v - return s -} - -type ListLinuxSubscriptionsOutput struct { - _ struct{} `type:"structure"` - - // Token for the next set of results. - NextToken *string `type:"string"` - - // An array that contains subscription objects. - Subscriptions []*Subscription `type:"list"` -} - -// 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 ListLinuxSubscriptionsOutput) 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 ListLinuxSubscriptionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLinuxSubscriptionsOutput) SetNextToken(v string) *ListLinuxSubscriptionsOutput { - s.NextToken = &v - return s -} - -// SetSubscriptions sets the Subscriptions field's value. -func (s *ListLinuxSubscriptionsOutput) SetSubscriptions(v []*Subscription) *ListLinuxSubscriptionsOutput { - s.Subscriptions = v - return s -} - -// An object which details a discovered Linux subscription. -type Subscription struct { - _ struct{} `type:"structure"` - - // The total amount of running instances using this subscription. - InstanceCount *int64 `type:"long"` - - // The name of the subscription. - Name *string `type:"string"` - - // The type of subscription. The type can be subscription-included with Amazon - // EC2, Bring Your Own Subscription model (BYOS), or from the Amazon Web Services - // Marketplace. Certain subscriptions may use licensing from the Amazon Web - // Services Marketplace as well as OS licensing from Amazon EC2 or BYOS. - Type *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 Subscription) 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 Subscription) GoString() string { - return s.String() -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *Subscription) SetInstanceCount(v int64) *Subscription { - s.InstanceCount = &v - return s -} - -// SetName sets the Name field's value. -func (s *Subscription) SetName(v string) *Subscription { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *Subscription) SetType(v string) *Subscription { - s.Type = &v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UpdateServiceSettingsInput struct { - _ struct{} `type:"structure"` - - // Describes if updates are allowed to the service settings for Linux subscriptions. - // If you allow updates, you can aggregate Linux subscription data in more than - // one home Region. - AllowUpdate *bool `type:"boolean"` - - // Describes if the discovery of Linux subscriptions is enabled. - // - // LinuxSubscriptionsDiscovery is a required field - LinuxSubscriptionsDiscovery *string `type:"string" required:"true" enum:"LinuxSubscriptionsDiscovery"` - - // The settings defined for Linux subscriptions discovery. The settings include - // if Organizations integration has been enabled, and which Regions data will - // be aggregated from. - // - // LinuxSubscriptionsDiscoverySettings is a required field - LinuxSubscriptionsDiscoverySettings *LinuxSubscriptionsDiscoverySettings `type:"structure" 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 UpdateServiceSettingsInput) 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 UpdateServiceSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateServiceSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateServiceSettingsInput"} - if s.LinuxSubscriptionsDiscovery == nil { - invalidParams.Add(request.NewErrParamRequired("LinuxSubscriptionsDiscovery")) - } - if s.LinuxSubscriptionsDiscoverySettings == nil { - invalidParams.Add(request.NewErrParamRequired("LinuxSubscriptionsDiscoverySettings")) - } - if s.LinuxSubscriptionsDiscoverySettings != nil { - if err := s.LinuxSubscriptionsDiscoverySettings.Validate(); err != nil { - invalidParams.AddNested("LinuxSubscriptionsDiscoverySettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowUpdate sets the AllowUpdate field's value. -func (s *UpdateServiceSettingsInput) SetAllowUpdate(v bool) *UpdateServiceSettingsInput { - s.AllowUpdate = &v - return s -} - -// SetLinuxSubscriptionsDiscovery sets the LinuxSubscriptionsDiscovery field's value. -func (s *UpdateServiceSettingsInput) SetLinuxSubscriptionsDiscovery(v string) *UpdateServiceSettingsInput { - s.LinuxSubscriptionsDiscovery = &v - return s -} - -// SetLinuxSubscriptionsDiscoverySettings sets the LinuxSubscriptionsDiscoverySettings field's value. -func (s *UpdateServiceSettingsInput) SetLinuxSubscriptionsDiscoverySettings(v *LinuxSubscriptionsDiscoverySettings) *UpdateServiceSettingsInput { - s.LinuxSubscriptionsDiscoverySettings = v - return s -} - -type UpdateServiceSettingsOutput struct { - _ struct{} `type:"structure"` - - // The Region in which License Manager displays the aggregated data for Linux - // subscriptions. - HomeRegions []*string `min:"1" type:"list"` - - // Lists if discovery has been enabled for Linux subscriptions. - LinuxSubscriptionsDiscovery *string `type:"string" enum:"LinuxSubscriptionsDiscovery"` - - // The settings defined for Linux subscriptions discovery. The settings include - // if Organizations integration has been enabled, and which Regions data will - // be aggregated from. - LinuxSubscriptionsDiscoverySettings *LinuxSubscriptionsDiscoverySettings `type:"structure"` - - // Indicates the status of Linux subscriptions settings being applied. - Status *string `type:"string" enum:"Status"` - - // A message which details the Linux subscriptions service settings current - // status. - StatusMessage map[string]*string `type:"map"` -} - -// 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 UpdateServiceSettingsOutput) 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 UpdateServiceSettingsOutput) GoString() string { - return s.String() -} - -// SetHomeRegions sets the HomeRegions field's value. -func (s *UpdateServiceSettingsOutput) SetHomeRegions(v []*string) *UpdateServiceSettingsOutput { - s.HomeRegions = v - return s -} - -// SetLinuxSubscriptionsDiscovery sets the LinuxSubscriptionsDiscovery field's value. -func (s *UpdateServiceSettingsOutput) SetLinuxSubscriptionsDiscovery(v string) *UpdateServiceSettingsOutput { - s.LinuxSubscriptionsDiscovery = &v - return s -} - -// SetLinuxSubscriptionsDiscoverySettings sets the LinuxSubscriptionsDiscoverySettings field's value. -func (s *UpdateServiceSettingsOutput) SetLinuxSubscriptionsDiscoverySettings(v *LinuxSubscriptionsDiscoverySettings) *UpdateServiceSettingsOutput { - s.LinuxSubscriptionsDiscoverySettings = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateServiceSettingsOutput) SetStatus(v string) *UpdateServiceSettingsOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *UpdateServiceSettingsOutput) SetStatusMessage(v map[string]*string) *UpdateServiceSettingsOutput { - s.StatusMessage = v - return s -} - -// The provided input is not valid. Try your request again. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // LinuxSubscriptionsDiscoveryEnabled is a LinuxSubscriptionsDiscovery enum value - LinuxSubscriptionsDiscoveryEnabled = "Enabled" - - // LinuxSubscriptionsDiscoveryDisabled is a LinuxSubscriptionsDiscovery enum value - LinuxSubscriptionsDiscoveryDisabled = "Disabled" -) - -// LinuxSubscriptionsDiscovery_Values returns all elements of the LinuxSubscriptionsDiscovery enum -func LinuxSubscriptionsDiscovery_Values() []string { - return []string{ - LinuxSubscriptionsDiscoveryEnabled, - LinuxSubscriptionsDiscoveryDisabled, - } -} - -const ( - // OperatorEqual is a Operator enum value - OperatorEqual = "Equal" - - // OperatorNotEqual is a Operator enum value - OperatorNotEqual = "NotEqual" - - // OperatorContains is a Operator enum value - OperatorContains = "Contains" -) - -// Operator_Values returns all elements of the Operator enum -func Operator_Values() []string { - return []string{ - OperatorEqual, - OperatorNotEqual, - OperatorContains, - } -} - -const ( - // OrganizationIntegrationEnabled is a OrganizationIntegration enum value - OrganizationIntegrationEnabled = "Enabled" - - // OrganizationIntegrationDisabled is a OrganizationIntegration enum value - OrganizationIntegrationDisabled = "Disabled" -) - -// OrganizationIntegration_Values returns all elements of the OrganizationIntegration enum -func OrganizationIntegration_Values() []string { - return []string{ - OrganizationIntegrationEnabled, - OrganizationIntegrationDisabled, - } -} - -const ( - // StatusInProgress is a Status enum value - StatusInProgress = "InProgress" - - // StatusCompleted is a Status enum value - StatusCompleted = "Completed" - - // StatusSuccessful is a Status enum value - StatusSuccessful = "Successful" - - // StatusFailed is a Status enum value - StatusFailed = "Failed" -) - -// Status_Values returns all elements of the Status enum -func Status_Values() []string { - return []string{ - StatusInProgress, - StatusCompleted, - StatusSuccessful, - StatusFailed, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/doc.go deleted file mode 100644 index 0c7c555f2b20..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package licensemanagerlinuxsubscriptions provides the client and types for making API -// requests to AWS License Manager Linux Subscriptions. -// -// With License Manager, you can discover and track your commercial Linux subscriptions -// on running Amazon EC2 instances. -// -// See https://docs.aws.amazon.com/goto/WebAPI/license-manager-linux-subscriptions-2018-05-10 for more information on this service. -// -// See licensemanagerlinuxsubscriptions package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/licensemanagerlinuxsubscriptions/ -// -// # Using the Client -// -// To contact AWS License Manager Linux Subscriptions with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS License Manager Linux Subscriptions client LicenseManagerLinuxSubscriptions for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/licensemanagerlinuxsubscriptions/#New -package licensemanagerlinuxsubscriptions diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/errors.go deleted file mode 100644 index 2efc8d6e1c3f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/errors.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package licensemanagerlinuxsubscriptions - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An exception occurred with the service. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The provided input is not valid. Try your request again. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "InternalServerException": newErrorInternalServerException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/licensemanagerlinuxsubscriptionsiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/licensemanagerlinuxsubscriptionsiface/interface.go deleted file mode 100644 index e27f8537ca92..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/licensemanagerlinuxsubscriptionsiface/interface.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package licensemanagerlinuxsubscriptionsiface provides an interface to enable mocking the AWS License Manager Linux Subscriptions service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package licensemanagerlinuxsubscriptionsiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions" -) - -// LicenseManagerLinuxSubscriptionsAPI provides an interface to enable mocking the -// licensemanagerlinuxsubscriptions.LicenseManagerLinuxSubscriptions service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS License Manager Linux Subscriptions. -// func myFunc(svc licensemanagerlinuxsubscriptionsiface.LicenseManagerLinuxSubscriptionsAPI) bool { -// // Make svc.GetServiceSettings request -// } -// -// func main() { -// sess := session.New() -// svc := licensemanagerlinuxsubscriptions.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockLicenseManagerLinuxSubscriptionsClient struct { -// licensemanagerlinuxsubscriptionsiface.LicenseManagerLinuxSubscriptionsAPI -// } -// func (m *mockLicenseManagerLinuxSubscriptionsClient) GetServiceSettings(input *licensemanagerlinuxsubscriptions.GetServiceSettingsInput) (*licensemanagerlinuxsubscriptions.GetServiceSettingsOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockLicenseManagerLinuxSubscriptionsClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type LicenseManagerLinuxSubscriptionsAPI interface { - GetServiceSettings(*licensemanagerlinuxsubscriptions.GetServiceSettingsInput) (*licensemanagerlinuxsubscriptions.GetServiceSettingsOutput, error) - GetServiceSettingsWithContext(aws.Context, *licensemanagerlinuxsubscriptions.GetServiceSettingsInput, ...request.Option) (*licensemanagerlinuxsubscriptions.GetServiceSettingsOutput, error) - GetServiceSettingsRequest(*licensemanagerlinuxsubscriptions.GetServiceSettingsInput) (*request.Request, *licensemanagerlinuxsubscriptions.GetServiceSettingsOutput) - - ListLinuxSubscriptionInstances(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesInput) (*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesOutput, error) - ListLinuxSubscriptionInstancesWithContext(aws.Context, *licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesInput, ...request.Option) (*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesOutput, error) - ListLinuxSubscriptionInstancesRequest(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesInput) (*request.Request, *licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesOutput) - - ListLinuxSubscriptionInstancesPages(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesInput, func(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesOutput, bool) bool) error - ListLinuxSubscriptionInstancesPagesWithContext(aws.Context, *licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesInput, func(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionInstancesOutput, bool) bool, ...request.Option) error - - ListLinuxSubscriptions(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsInput) (*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsOutput, error) - ListLinuxSubscriptionsWithContext(aws.Context, *licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsInput, ...request.Option) (*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsOutput, error) - ListLinuxSubscriptionsRequest(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsInput) (*request.Request, *licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsOutput) - - ListLinuxSubscriptionsPages(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsInput, func(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsOutput, bool) bool) error - ListLinuxSubscriptionsPagesWithContext(aws.Context, *licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsInput, func(*licensemanagerlinuxsubscriptions.ListLinuxSubscriptionsOutput, bool) bool, ...request.Option) error - - UpdateServiceSettings(*licensemanagerlinuxsubscriptions.UpdateServiceSettingsInput) (*licensemanagerlinuxsubscriptions.UpdateServiceSettingsOutput, error) - UpdateServiceSettingsWithContext(aws.Context, *licensemanagerlinuxsubscriptions.UpdateServiceSettingsInput, ...request.Option) (*licensemanagerlinuxsubscriptions.UpdateServiceSettingsOutput, error) - UpdateServiceSettingsRequest(*licensemanagerlinuxsubscriptions.UpdateServiceSettingsInput) (*request.Request, *licensemanagerlinuxsubscriptions.UpdateServiceSettingsOutput) -} - -var _ LicenseManagerLinuxSubscriptionsAPI = (*licensemanagerlinuxsubscriptions.LicenseManagerLinuxSubscriptions)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/service.go deleted file mode 100644 index ba556c0965c2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerlinuxsubscriptions/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package licensemanagerlinuxsubscriptions - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// LicenseManagerLinuxSubscriptions provides the API operation methods for making requests to -// AWS License Manager Linux Subscriptions. See this package's package overview docs -// for details on the service. -// -// LicenseManagerLinuxSubscriptions methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type LicenseManagerLinuxSubscriptions struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "License Manager Linux Subscriptions" // Name of service. - EndpointsID = "license-manager-linux-subscriptions" // ID to lookup a service endpoint with. - ServiceID = "License Manager Linux Subscriptions" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the LicenseManagerLinuxSubscriptions client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a LicenseManagerLinuxSubscriptions client from just a session. -// svc := licensemanagerlinuxsubscriptions.New(mySession) -// -// // Create a LicenseManagerLinuxSubscriptions client with additional configuration -// svc := licensemanagerlinuxsubscriptions.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *LicenseManagerLinuxSubscriptions { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "license-manager-linux-subscriptions" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *LicenseManagerLinuxSubscriptions { - svc := &LicenseManagerLinuxSubscriptions{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a LicenseManagerLinuxSubscriptions operation and runs any -// custom request initialization. -func (c *LicenseManagerLinuxSubscriptions) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/api.go deleted file mode 100644 index 2f6c94fafc12..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/api.go +++ /dev/null @@ -1,3603 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package licensemanagerusersubscriptions - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opAssociateUser = "AssociateUser" - -// AssociateUserRequest generates a "aws/request.Request" representing the -// client's request for the AssociateUser 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 AssociateUser for more information on using the AssociateUser -// 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 AssociateUserRequest method. -// req, resp := client.AssociateUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/AssociateUser -func (c *LicenseManagerUserSubscriptions) AssociateUserRequest(input *AssociateUserInput) (req *request.Request, output *AssociateUserOutput) { - op := &request.Operation{ - Name: opAssociateUser, - HTTPMethod: "POST", - HTTPPath: "/user/AssociateUser", - } - - if input == nil { - input = &AssociateUserInput{} - } - - output = &AssociateUserOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateUser API operation for AWS License Manager User Subscriptions. -// -// Associates the user to an EC2 instance to utilize user-based subscriptions. -// -// Your estimated bill for charges on the number of users and related costs -// will take 48 hours to appear for billing periods that haven't closed (marked -// as Pending billing status) in Amazon Web Services Billing. For more information, -// see Viewing your monthly charges (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/invoice.html) -// in the Amazon Web Services Billing User Guide. -// -// 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 AWS License Manager User Subscriptions's -// API operation AssociateUser for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/AssociateUser -func (c *LicenseManagerUserSubscriptions) AssociateUser(input *AssociateUserInput) (*AssociateUserOutput, error) { - req, out := c.AssociateUserRequest(input) - return out, req.Send() -} - -// AssociateUserWithContext is the same as AssociateUser with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateUser 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 *LicenseManagerUserSubscriptions) AssociateUserWithContext(ctx aws.Context, input *AssociateUserInput, opts ...request.Option) (*AssociateUserOutput, error) { - req, out := c.AssociateUserRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterIdentityProvider = "DeregisterIdentityProvider" - -// DeregisterIdentityProviderRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterIdentityProvider 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 DeregisterIdentityProvider for more information on using the DeregisterIdentityProvider -// 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 DeregisterIdentityProviderRequest method. -// req, resp := client.DeregisterIdentityProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/DeregisterIdentityProvider -func (c *LicenseManagerUserSubscriptions) DeregisterIdentityProviderRequest(input *DeregisterIdentityProviderInput) (req *request.Request, output *DeregisterIdentityProviderOutput) { - op := &request.Operation{ - Name: opDeregisterIdentityProvider, - HTTPMethod: "POST", - HTTPPath: "/identity-provider/DeregisterIdentityProvider", - } - - if input == nil { - input = &DeregisterIdentityProviderInput{} - } - - output = &DeregisterIdentityProviderOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterIdentityProvider API operation for AWS License Manager User Subscriptions. -// -// Deregisters the identity provider from providing user-based subscriptions. -// -// 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 AWS License Manager User Subscriptions's -// API operation DeregisterIdentityProvider for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/DeregisterIdentityProvider -func (c *LicenseManagerUserSubscriptions) DeregisterIdentityProvider(input *DeregisterIdentityProviderInput) (*DeregisterIdentityProviderOutput, error) { - req, out := c.DeregisterIdentityProviderRequest(input) - return out, req.Send() -} - -// DeregisterIdentityProviderWithContext is the same as DeregisterIdentityProvider with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterIdentityProvider 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 *LicenseManagerUserSubscriptions) DeregisterIdentityProviderWithContext(ctx aws.Context, input *DeregisterIdentityProviderInput, opts ...request.Option) (*DeregisterIdentityProviderOutput, error) { - req, out := c.DeregisterIdentityProviderRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateUser = "DisassociateUser" - -// DisassociateUserRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateUser 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 DisassociateUser for more information on using the DisassociateUser -// 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 DisassociateUserRequest method. -// req, resp := client.DisassociateUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/DisassociateUser -func (c *LicenseManagerUserSubscriptions) DisassociateUserRequest(input *DisassociateUserInput) (req *request.Request, output *DisassociateUserOutput) { - op := &request.Operation{ - Name: opDisassociateUser, - HTTPMethod: "POST", - HTTPPath: "/user/DisassociateUser", - } - - if input == nil { - input = &DisassociateUserInput{} - } - - output = &DisassociateUserOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisassociateUser API operation for AWS License Manager User Subscriptions. -// -// Disassociates the user from an EC2 instance providing user-based subscriptions. -// -// 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 AWS License Manager User Subscriptions's -// API operation DisassociateUser for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/DisassociateUser -func (c *LicenseManagerUserSubscriptions) DisassociateUser(input *DisassociateUserInput) (*DisassociateUserOutput, error) { - req, out := c.DisassociateUserRequest(input) - return out, req.Send() -} - -// DisassociateUserWithContext is the same as DisassociateUser with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateUser 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 *LicenseManagerUserSubscriptions) DisassociateUserWithContext(ctx aws.Context, input *DisassociateUserInput, opts ...request.Option) (*DisassociateUserOutput, error) { - req, out := c.DisassociateUserRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListIdentityProviders = "ListIdentityProviders" - -// ListIdentityProvidersRequest generates a "aws/request.Request" representing the -// client's request for the ListIdentityProviders 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 ListIdentityProviders for more information on using the ListIdentityProviders -// 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 ListIdentityProvidersRequest method. -// req, resp := client.ListIdentityProvidersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/ListIdentityProviders -func (c *LicenseManagerUserSubscriptions) ListIdentityProvidersRequest(input *ListIdentityProvidersInput) (req *request.Request, output *ListIdentityProvidersOutput) { - op := &request.Operation{ - Name: opListIdentityProviders, - HTTPMethod: "POST", - HTTPPath: "/identity-provider/ListIdentityProviders", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIdentityProvidersInput{} - } - - output = &ListIdentityProvidersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIdentityProviders API operation for AWS License Manager User Subscriptions. -// -// Lists the identity providers for user-based subscriptions. -// -// 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 AWS License Manager User Subscriptions's -// API operation ListIdentityProviders for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/ListIdentityProviders -func (c *LicenseManagerUserSubscriptions) ListIdentityProviders(input *ListIdentityProvidersInput) (*ListIdentityProvidersOutput, error) { - req, out := c.ListIdentityProvidersRequest(input) - return out, req.Send() -} - -// ListIdentityProvidersWithContext is the same as ListIdentityProviders with the addition of -// the ability to pass a context and additional request options. -// -// See ListIdentityProviders 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 *LicenseManagerUserSubscriptions) ListIdentityProvidersWithContext(ctx aws.Context, input *ListIdentityProvidersInput, opts ...request.Option) (*ListIdentityProvidersOutput, error) { - req, out := c.ListIdentityProvidersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIdentityProvidersPages iterates over the pages of a ListIdentityProviders operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIdentityProviders method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIdentityProviders operation. -// pageNum := 0 -// err := client.ListIdentityProvidersPages(params, -// func(page *licensemanagerusersubscriptions.ListIdentityProvidersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LicenseManagerUserSubscriptions) ListIdentityProvidersPages(input *ListIdentityProvidersInput, fn func(*ListIdentityProvidersOutput, bool) bool) error { - return c.ListIdentityProvidersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIdentityProvidersPagesWithContext same as ListIdentityProvidersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LicenseManagerUserSubscriptions) ListIdentityProvidersPagesWithContext(ctx aws.Context, input *ListIdentityProvidersInput, fn func(*ListIdentityProvidersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIdentityProvidersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIdentityProvidersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIdentityProvidersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListInstances = "ListInstances" - -// ListInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListInstances 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 ListInstances for more information on using the ListInstances -// 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 ListInstancesRequest method. -// req, resp := client.ListInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/ListInstances -func (c *LicenseManagerUserSubscriptions) ListInstancesRequest(input *ListInstancesInput) (req *request.Request, output *ListInstancesOutput) { - op := &request.Operation{ - Name: opListInstances, - HTTPMethod: "POST", - HTTPPath: "/instance/ListInstances", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListInstancesInput{} - } - - output = &ListInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListInstances API operation for AWS License Manager User Subscriptions. -// -// Lists the EC2 instances providing user-based subscriptions. -// -// 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 AWS License Manager User Subscriptions's -// API operation ListInstances for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/ListInstances -func (c *LicenseManagerUserSubscriptions) ListInstances(input *ListInstancesInput) (*ListInstancesOutput, error) { - req, out := c.ListInstancesRequest(input) - return out, req.Send() -} - -// ListInstancesWithContext is the same as ListInstances with the addition of -// the ability to pass a context and additional request options. -// -// See ListInstances 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 *LicenseManagerUserSubscriptions) ListInstancesWithContext(ctx aws.Context, input *ListInstancesInput, opts ...request.Option) (*ListInstancesOutput, error) { - req, out := c.ListInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListInstancesPages iterates over the pages of a ListInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListInstances method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListInstances operation. -// pageNum := 0 -// err := client.ListInstancesPages(params, -// func(page *licensemanagerusersubscriptions.ListInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LicenseManagerUserSubscriptions) ListInstancesPages(input *ListInstancesInput, fn func(*ListInstancesOutput, bool) bool) error { - return c.ListInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListInstancesPagesWithContext same as ListInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LicenseManagerUserSubscriptions) ListInstancesPagesWithContext(ctx aws.Context, input *ListInstancesInput, fn func(*ListInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListInstancesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProductSubscriptions = "ListProductSubscriptions" - -// ListProductSubscriptionsRequest generates a "aws/request.Request" representing the -// client's request for the ListProductSubscriptions 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 ListProductSubscriptions for more information on using the ListProductSubscriptions -// 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 ListProductSubscriptionsRequest method. -// req, resp := client.ListProductSubscriptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/ListProductSubscriptions -func (c *LicenseManagerUserSubscriptions) ListProductSubscriptionsRequest(input *ListProductSubscriptionsInput) (req *request.Request, output *ListProductSubscriptionsOutput) { - op := &request.Operation{ - Name: opListProductSubscriptions, - HTTPMethod: "POST", - HTTPPath: "/user/ListProductSubscriptions", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProductSubscriptionsInput{} - } - - output = &ListProductSubscriptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProductSubscriptions API operation for AWS License Manager User Subscriptions. -// -// Lists the user-based subscription products available from an identity provider. -// -// 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 AWS License Manager User Subscriptions's -// API operation ListProductSubscriptions for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/ListProductSubscriptions -func (c *LicenseManagerUserSubscriptions) ListProductSubscriptions(input *ListProductSubscriptionsInput) (*ListProductSubscriptionsOutput, error) { - req, out := c.ListProductSubscriptionsRequest(input) - return out, req.Send() -} - -// ListProductSubscriptionsWithContext is the same as ListProductSubscriptions with the addition of -// the ability to pass a context and additional request options. -// -// See ListProductSubscriptions 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 *LicenseManagerUserSubscriptions) ListProductSubscriptionsWithContext(ctx aws.Context, input *ListProductSubscriptionsInput, opts ...request.Option) (*ListProductSubscriptionsOutput, error) { - req, out := c.ListProductSubscriptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProductSubscriptionsPages iterates over the pages of a ListProductSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProductSubscriptions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProductSubscriptions operation. -// pageNum := 0 -// err := client.ListProductSubscriptionsPages(params, -// func(page *licensemanagerusersubscriptions.ListProductSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LicenseManagerUserSubscriptions) ListProductSubscriptionsPages(input *ListProductSubscriptionsInput, fn func(*ListProductSubscriptionsOutput, bool) bool) error { - return c.ListProductSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProductSubscriptionsPagesWithContext same as ListProductSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LicenseManagerUserSubscriptions) ListProductSubscriptionsPagesWithContext(ctx aws.Context, input *ListProductSubscriptionsInput, fn func(*ListProductSubscriptionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProductSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProductSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProductSubscriptionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListUserAssociations = "ListUserAssociations" - -// ListUserAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the ListUserAssociations 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 ListUserAssociations for more information on using the ListUserAssociations -// 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 ListUserAssociationsRequest method. -// req, resp := client.ListUserAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/ListUserAssociations -func (c *LicenseManagerUserSubscriptions) ListUserAssociationsRequest(input *ListUserAssociationsInput) (req *request.Request, output *ListUserAssociationsOutput) { - op := &request.Operation{ - Name: opListUserAssociations, - HTTPMethod: "POST", - HTTPPath: "/user/ListUserAssociations", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListUserAssociationsInput{} - } - - output = &ListUserAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListUserAssociations API operation for AWS License Manager User Subscriptions. -// -// Lists user associations for an identity provider. -// -// 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 AWS License Manager User Subscriptions's -// API operation ListUserAssociations for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/ListUserAssociations -func (c *LicenseManagerUserSubscriptions) ListUserAssociations(input *ListUserAssociationsInput) (*ListUserAssociationsOutput, error) { - req, out := c.ListUserAssociationsRequest(input) - return out, req.Send() -} - -// ListUserAssociationsWithContext is the same as ListUserAssociations with the addition of -// the ability to pass a context and additional request options. -// -// See ListUserAssociations 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 *LicenseManagerUserSubscriptions) ListUserAssociationsWithContext(ctx aws.Context, input *ListUserAssociationsInput, opts ...request.Option) (*ListUserAssociationsOutput, error) { - req, out := c.ListUserAssociationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListUserAssociationsPages iterates over the pages of a ListUserAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUserAssociations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListUserAssociations operation. -// pageNum := 0 -// err := client.ListUserAssociationsPages(params, -// func(page *licensemanagerusersubscriptions.ListUserAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *LicenseManagerUserSubscriptions) ListUserAssociationsPages(input *ListUserAssociationsInput, fn func(*ListUserAssociationsOutput, bool) bool) error { - return c.ListUserAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListUserAssociationsPagesWithContext same as ListUserAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *LicenseManagerUserSubscriptions) ListUserAssociationsPagesWithContext(ctx aws.Context, input *ListUserAssociationsInput, fn func(*ListUserAssociationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListUserAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListUserAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListUserAssociationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opRegisterIdentityProvider = "RegisterIdentityProvider" - -// RegisterIdentityProviderRequest generates a "aws/request.Request" representing the -// client's request for the RegisterIdentityProvider 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 RegisterIdentityProvider for more information on using the RegisterIdentityProvider -// 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 RegisterIdentityProviderRequest method. -// req, resp := client.RegisterIdentityProviderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/RegisterIdentityProvider -func (c *LicenseManagerUserSubscriptions) RegisterIdentityProviderRequest(input *RegisterIdentityProviderInput) (req *request.Request, output *RegisterIdentityProviderOutput) { - op := &request.Operation{ - Name: opRegisterIdentityProvider, - HTTPMethod: "POST", - HTTPPath: "/identity-provider/RegisterIdentityProvider", - } - - if input == nil { - input = &RegisterIdentityProviderInput{} - } - - output = &RegisterIdentityProviderOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterIdentityProvider API operation for AWS License Manager User Subscriptions. -// -// Registers an identity provider for user-based subscriptions. -// -// 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 AWS License Manager User Subscriptions's -// API operation RegisterIdentityProvider for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/RegisterIdentityProvider -func (c *LicenseManagerUserSubscriptions) RegisterIdentityProvider(input *RegisterIdentityProviderInput) (*RegisterIdentityProviderOutput, error) { - req, out := c.RegisterIdentityProviderRequest(input) - return out, req.Send() -} - -// RegisterIdentityProviderWithContext is the same as RegisterIdentityProvider with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterIdentityProvider 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 *LicenseManagerUserSubscriptions) RegisterIdentityProviderWithContext(ctx aws.Context, input *RegisterIdentityProviderInput, opts ...request.Option) (*RegisterIdentityProviderOutput, error) { - req, out := c.RegisterIdentityProviderRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartProductSubscription = "StartProductSubscription" - -// StartProductSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the StartProductSubscription 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 StartProductSubscription for more information on using the StartProductSubscription -// 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 StartProductSubscriptionRequest method. -// req, resp := client.StartProductSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/StartProductSubscription -func (c *LicenseManagerUserSubscriptions) StartProductSubscriptionRequest(input *StartProductSubscriptionInput) (req *request.Request, output *StartProductSubscriptionOutput) { - op := &request.Operation{ - Name: opStartProductSubscription, - HTTPMethod: "POST", - HTTPPath: "/user/StartProductSubscription", - } - - if input == nil { - input = &StartProductSubscriptionInput{} - } - - output = &StartProductSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartProductSubscription API operation for AWS License Manager User Subscriptions. -// -// Starts a product subscription for a user with the specified identity provider. -// -// Your estimated bill for charges on the number of users and related costs -// will take 48 hours to appear for billing periods that haven't closed (marked -// as Pending billing status) in Amazon Web Services Billing. For more information, -// see Viewing your monthly charges (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/invoice.html) -// in the Amazon Web Services Billing User Guide. -// -// 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 AWS License Manager User Subscriptions's -// API operation StartProductSubscription for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/StartProductSubscription -func (c *LicenseManagerUserSubscriptions) StartProductSubscription(input *StartProductSubscriptionInput) (*StartProductSubscriptionOutput, error) { - req, out := c.StartProductSubscriptionRequest(input) - return out, req.Send() -} - -// StartProductSubscriptionWithContext is the same as StartProductSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See StartProductSubscription 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 *LicenseManagerUserSubscriptions) StartProductSubscriptionWithContext(ctx aws.Context, input *StartProductSubscriptionInput, opts ...request.Option) (*StartProductSubscriptionOutput, error) { - req, out := c.StartProductSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopProductSubscription = "StopProductSubscription" - -// StopProductSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the StopProductSubscription 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 StopProductSubscription for more information on using the StopProductSubscription -// 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 StopProductSubscriptionRequest method. -// req, resp := client.StopProductSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/StopProductSubscription -func (c *LicenseManagerUserSubscriptions) StopProductSubscriptionRequest(input *StopProductSubscriptionInput) (req *request.Request, output *StopProductSubscriptionOutput) { - op := &request.Operation{ - Name: opStopProductSubscription, - HTTPMethod: "POST", - HTTPPath: "/user/StopProductSubscription", - } - - if input == nil { - input = &StopProductSubscriptionInput{} - } - - output = &StopProductSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopProductSubscription API operation for AWS License Manager User Subscriptions. -// -// Stops a product subscription for a user with the specified identity provider. -// -// 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 AWS License Manager User Subscriptions's -// API operation StopProductSubscription for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request failed because a service quota is exceeded. -// -// - ConflictException -// The request couldn't be completed because it conflicted with the current -// state of the resource. -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - ResourceNotFoundException -// The resource couldn't be found. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/StopProductSubscription -func (c *LicenseManagerUserSubscriptions) StopProductSubscription(input *StopProductSubscriptionInput) (*StopProductSubscriptionOutput, error) { - req, out := c.StopProductSubscriptionRequest(input) - return out, req.Send() -} - -// StopProductSubscriptionWithContext is the same as StopProductSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See StopProductSubscription 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 *LicenseManagerUserSubscriptions) StopProductSubscriptionWithContext(ctx aws.Context, input *StopProductSubscriptionInput, opts ...request.Option) (*StopProductSubscriptionOutput, error) { - req, out := c.StopProductSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateIdentityProviderSettings = "UpdateIdentityProviderSettings" - -// UpdateIdentityProviderSettingsRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIdentityProviderSettings 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 UpdateIdentityProviderSettings for more information on using the UpdateIdentityProviderSettings -// 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 UpdateIdentityProviderSettingsRequest method. -// req, resp := client.UpdateIdentityProviderSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/UpdateIdentityProviderSettings -func (c *LicenseManagerUserSubscriptions) UpdateIdentityProviderSettingsRequest(input *UpdateIdentityProviderSettingsInput) (req *request.Request, output *UpdateIdentityProviderSettingsOutput) { - op := &request.Operation{ - Name: opUpdateIdentityProviderSettings, - HTTPMethod: "POST", - HTTPPath: "/identity-provider/UpdateIdentityProviderSettings", - } - - if input == nil { - input = &UpdateIdentityProviderSettingsInput{} - } - - output = &UpdateIdentityProviderSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIdentityProviderSettings API operation for AWS License Manager User Subscriptions. -// -// Updates additional product configuration settings for the registered identity -// provider. -// -// 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 AWS License Manager User Subscriptions's -// API operation UpdateIdentityProviderSettings for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// A parameter is not valid. -// -// - ThrottlingException -// The request was denied because of request throttling. Retry the request. -// -// - InternalServerException -// An exception occurred with the service. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10/UpdateIdentityProviderSettings -func (c *LicenseManagerUserSubscriptions) UpdateIdentityProviderSettings(input *UpdateIdentityProviderSettingsInput) (*UpdateIdentityProviderSettingsOutput, error) { - req, out := c.UpdateIdentityProviderSettingsRequest(input) - return out, req.Send() -} - -// UpdateIdentityProviderSettingsWithContext is the same as UpdateIdentityProviderSettings with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateIdentityProviderSettings 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 *LicenseManagerUserSubscriptions) UpdateIdentityProviderSettingsWithContext(ctx aws.Context, input *UpdateIdentityProviderSettingsInput, opts ...request.Option) (*UpdateIdentityProviderSettingsOutput, error) { - req, out := c.UpdateIdentityProviderSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Details about an Active Directory identity provider. -type ActiveDirectoryIdentityProvider struct { - _ struct{} `type:"structure"` - - // The directory ID for an Active Directory identity provider. - DirectoryId *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 ActiveDirectoryIdentityProvider) 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 ActiveDirectoryIdentityProvider) GoString() string { - return s.String() -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *ActiveDirectoryIdentityProvider) SetDirectoryId(v string) *ActiveDirectoryIdentityProvider { - s.DirectoryId = &v - return s -} - -type AssociateUserInput struct { - _ struct{} `type:"structure"` - - // The domain name of the user. - Domain *string `type:"string"` - - // The identity provider of the user. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The ID of the EC2 instance, which provides user-based subscriptions. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The user name from the identity provider for the user. - // - // Username is a required field - Username *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 AssociateUserInput) 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 AssociateUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateUserInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.Username == nil { - invalidParams.Add(request.NewErrParamRequired("Username")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomain sets the Domain field's value. -func (s *AssociateUserInput) SetDomain(v string) *AssociateUserInput { - s.Domain = &v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *AssociateUserInput) SetIdentityProvider(v *IdentityProvider) *AssociateUserInput { - s.IdentityProvider = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *AssociateUserInput) SetInstanceId(v string) *AssociateUserInput { - s.InstanceId = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *AssociateUserInput) SetUsername(v string) *AssociateUserInput { - s.Username = &v - return s -} - -type AssociateUserOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the associate user operation. - // - // InstanceUserSummary is a required field - InstanceUserSummary *InstanceUserSummary `type:"structure" 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 AssociateUserOutput) 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 AssociateUserOutput) GoString() string { - return s.String() -} - -// SetInstanceUserSummary sets the InstanceUserSummary field's value. -func (s *AssociateUserOutput) SetInstanceUserSummary(v *InstanceUserSummary) *AssociateUserOutput { - s.InstanceUserSummary = v - return s -} - -// The request couldn't be completed because it conflicted with the current -// state of the resource. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type DeregisterIdentityProviderInput struct { - _ struct{} `type:"structure"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The name of the user-based subscription product. - // - // Product is a required field - Product *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 DeregisterIdentityProviderInput) 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 DeregisterIdentityProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterIdentityProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterIdentityProviderInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.Product == nil { - invalidParams.Add(request.NewErrParamRequired("Product")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *DeregisterIdentityProviderInput) SetIdentityProvider(v *IdentityProvider) *DeregisterIdentityProviderInput { - s.IdentityProvider = v - return s -} - -// SetProduct sets the Product field's value. -func (s *DeregisterIdentityProviderInput) SetProduct(v string) *DeregisterIdentityProviderInput { - s.Product = &v - return s -} - -type DeregisterIdentityProviderOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the results of an identity provider operation. - // - // IdentityProviderSummary is a required field - IdentityProviderSummary *IdentityProviderSummary `type:"structure" 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 DeregisterIdentityProviderOutput) 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 DeregisterIdentityProviderOutput) GoString() string { - return s.String() -} - -// SetIdentityProviderSummary sets the IdentityProviderSummary field's value. -func (s *DeregisterIdentityProviderOutput) SetIdentityProviderSummary(v *IdentityProviderSummary) *DeregisterIdentityProviderOutput { - s.IdentityProviderSummary = v - return s -} - -type DisassociateUserInput struct { - _ struct{} `type:"structure"` - - // The domain name of the user. - Domain *string `type:"string"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The ID of the EC2 instance, which provides user-based subscriptions. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The user name from the identity provider for the user. - // - // Username is a required field - Username *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 DisassociateUserInput) 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 DisassociateUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateUserInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - if s.Username == nil { - invalidParams.Add(request.NewErrParamRequired("Username")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomain sets the Domain field's value. -func (s *DisassociateUserInput) SetDomain(v string) *DisassociateUserInput { - s.Domain = &v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *DisassociateUserInput) SetIdentityProvider(v *IdentityProvider) *DisassociateUserInput { - s.IdentityProvider = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DisassociateUserInput) SetInstanceId(v string) *DisassociateUserInput { - s.InstanceId = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *DisassociateUserInput) SetUsername(v string) *DisassociateUserInput { - s.Username = &v - return s -} - -type DisassociateUserOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the associate user operation. - // - // InstanceUserSummary is a required field - InstanceUserSummary *InstanceUserSummary `type:"structure" 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 DisassociateUserOutput) 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 DisassociateUserOutput) GoString() string { - return s.String() -} - -// SetInstanceUserSummary sets the InstanceUserSummary field's value. -func (s *DisassociateUserOutput) SetInstanceUserSummary(v *InstanceUserSummary) *DisassociateUserOutput { - s.InstanceUserSummary = v - return s -} - -// A filter name and value pair that is used to return more specific results -// from a describe operation. Filters can be used to match a set of resources -// by specific criteria, such as tags, attributes, or IDs. -type Filter struct { - _ struct{} `type:"structure"` - - // The name of an attribute to use as a filter. - Attribute *string `type:"string"` - - // The type of search (For example, eq, geq, leq) - Operation *string `type:"string"` - - // Value of the filter. - Value *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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// SetAttribute sets the Attribute field's value. -func (s *Filter) SetAttribute(v string) *Filter { - s.Attribute = &v - return s -} - -// SetOperation sets the Operation field's value. -func (s *Filter) SetOperation(v string) *Filter { - s.Operation = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Filter) SetValue(v string) *Filter { - s.Value = &v - return s -} - -// Details about an identity provider. -type IdentityProvider struct { - _ struct{} `type:"structure"` - - // An object that details an Active Directory identity provider. - ActiveDirectoryIdentityProvider *ActiveDirectoryIdentityProvider `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 IdentityProvider) 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 IdentityProvider) GoString() string { - return s.String() -} - -// SetActiveDirectoryIdentityProvider sets the ActiveDirectoryIdentityProvider field's value. -func (s *IdentityProvider) SetActiveDirectoryIdentityProvider(v *ActiveDirectoryIdentityProvider) *IdentityProvider { - s.ActiveDirectoryIdentityProvider = v - return s -} - -// Describes an identity provider. -type IdentityProviderSummary struct { - _ struct{} `type:"structure"` - - // The failure message associated with an identity provider. - FailureMessage *string `type:"string"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The name of the user-based subscription product. - // - // Product is a required field - Product *string `type:"string" required:"true"` - - // An object that details the registered identity provider’s product related - // configuration settings such as the subnets to provision VPC endpoints. - // - // Settings is a required field - Settings *Settings `type:"structure" required:"true"` - - // The status of an identity provider. - // - // Status is a required field - Status *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 IdentityProviderSummary) 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 IdentityProviderSummary) GoString() string { - return s.String() -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *IdentityProviderSummary) SetFailureMessage(v string) *IdentityProviderSummary { - s.FailureMessage = &v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *IdentityProviderSummary) SetIdentityProvider(v *IdentityProvider) *IdentityProviderSummary { - s.IdentityProvider = v - return s -} - -// SetProduct sets the Product field's value. -func (s *IdentityProviderSummary) SetProduct(v string) *IdentityProviderSummary { - s.Product = &v - return s -} - -// SetSettings sets the Settings field's value. -func (s *IdentityProviderSummary) SetSettings(v *Settings) *IdentityProviderSummary { - s.Settings = v - return s -} - -// SetStatus sets the Status field's value. -func (s *IdentityProviderSummary) SetStatus(v string) *IdentityProviderSummary { - s.Status = &v - return s -} - -// Describes an EC2 instance providing user-based subscriptions. -type InstanceSummary struct { - _ struct{} `type:"structure"` - - // The ID of the EC2 instance, which provides user-based subscriptions. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The date of the last status check. - LastStatusCheckDate *string `type:"string"` - - // A list of provided user-based subscription products. - // - // Products is a required field - Products []*string `type:"list" required:"true"` - - // The status of an EC2 instance resource. - // - // Status is a required field - Status *string `type:"string" required:"true"` - - // The status message for an EC2 instance. - StatusMessage *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 InstanceSummary) 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 InstanceSummary) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceSummary) SetInstanceId(v string) *InstanceSummary { - s.InstanceId = &v - return s -} - -// SetLastStatusCheckDate sets the LastStatusCheckDate field's value. -func (s *InstanceSummary) SetLastStatusCheckDate(v string) *InstanceSummary { - s.LastStatusCheckDate = &v - return s -} - -// SetProducts sets the Products field's value. -func (s *InstanceSummary) SetProducts(v []*string) *InstanceSummary { - s.Products = v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceSummary) SetStatus(v string) *InstanceSummary { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *InstanceSummary) SetStatusMessage(v string) *InstanceSummary { - s.StatusMessage = &v - return s -} - -// Describes users of an EC2 instance providing user-based subscriptions. -type InstanceUserSummary struct { - _ struct{} `type:"structure"` - - // The date a user was associated with an EC2 instance. - AssociationDate *string `type:"string"` - - // The date a user was disassociated from an EC2 instance. - DisassociationDate *string `type:"string"` - - // The domain name of the user. - Domain *string `type:"string"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The ID of the EC2 instance, which provides user-based subscriptions. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // The status of a user associated with an EC2 instance. - // - // Status is a required field - Status *string `type:"string" required:"true"` - - // The status message for users of an EC2 instance. - StatusMessage *string `type:"string"` - - // The user name from the identity provider for the user. - // - // Username is a required field - Username *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 InstanceUserSummary) 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 InstanceUserSummary) GoString() string { - return s.String() -} - -// SetAssociationDate sets the AssociationDate field's value. -func (s *InstanceUserSummary) SetAssociationDate(v string) *InstanceUserSummary { - s.AssociationDate = &v - return s -} - -// SetDisassociationDate sets the DisassociationDate field's value. -func (s *InstanceUserSummary) SetDisassociationDate(v string) *InstanceUserSummary { - s.DisassociationDate = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *InstanceUserSummary) SetDomain(v string) *InstanceUserSummary { - s.Domain = &v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *InstanceUserSummary) SetIdentityProvider(v *IdentityProvider) *InstanceUserSummary { - s.IdentityProvider = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceUserSummary) SetInstanceId(v string) *InstanceUserSummary { - s.InstanceId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceUserSummary) SetStatus(v string) *InstanceUserSummary { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *InstanceUserSummary) SetStatusMessage(v string) *InstanceUserSummary { - s.StatusMessage = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *InstanceUserSummary) SetUsername(v string) *InstanceUserSummary { - s.Username = &v - return s -} - -// An exception occurred with the service. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListIdentityProvidersInput struct { - _ struct{} `type:"structure"` - - // Maximum number of results to return in a single call. - MaxResults *int64 `type:"integer"` - - // Token for the next set of results. - NextToken *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 ListIdentityProvidersInput) 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 ListIdentityProvidersInput) GoString() string { - return s.String() -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIdentityProvidersInput) SetMaxResults(v int64) *ListIdentityProvidersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdentityProvidersInput) SetNextToken(v string) *ListIdentityProvidersInput { - s.NextToken = &v - return s -} - -type ListIdentityProvidersOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the list identity providers operation. - // - // IdentityProviderSummaries is a required field - IdentityProviderSummaries []*IdentityProviderSummary `type:"list" required:"true"` - - // Token for the next set of results. - NextToken *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 ListIdentityProvidersOutput) 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 ListIdentityProvidersOutput) GoString() string { - return s.String() -} - -// SetIdentityProviderSummaries sets the IdentityProviderSummaries field's value. -func (s *ListIdentityProvidersOutput) SetIdentityProviderSummaries(v []*IdentityProviderSummary) *ListIdentityProvidersOutput { - s.IdentityProviderSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdentityProvidersOutput) SetNextToken(v string) *ListIdentityProvidersOutput { - s.NextToken = &v - return s -} - -type ListInstancesInput struct { - _ struct{} `type:"structure"` - - // An array of structures that you can use to filter the results to those that - // match one or more sets of key-value pairs that you specify. - Filters []*Filter `type:"list"` - - // Maximum number of results to return in a single call. - MaxResults *int64 `type:"integer"` - - // Token for the next set of results. - NextToken *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 ListInstancesInput) 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 ListInstancesInput) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *ListInstancesInput) SetFilters(v []*Filter) *ListInstancesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListInstancesInput) SetMaxResults(v int64) *ListInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListInstancesInput) SetNextToken(v string) *ListInstancesInput { - s.NextToken = &v - return s -} - -type ListInstancesOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the list instances operation. - InstanceSummaries []*InstanceSummary `type:"list"` - - // Token for the next set of results. - NextToken *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 ListInstancesOutput) 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 ListInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceSummaries sets the InstanceSummaries field's value. -func (s *ListInstancesOutput) SetInstanceSummaries(v []*InstanceSummary) *ListInstancesOutput { - s.InstanceSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListInstancesOutput) SetNextToken(v string) *ListInstancesOutput { - s.NextToken = &v - return s -} - -type ListProductSubscriptionsInput struct { - _ struct{} `type:"structure"` - - // An array of structures that you can use to filter the results to those that - // match one or more sets of key-value pairs that you specify. - Filters []*Filter `type:"list"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // Maximum number of results to return in a single call. - MaxResults *int64 `type:"integer"` - - // Token for the next set of results. - NextToken *string `type:"string"` - - // The name of the user-based subscription product. - // - // Product is a required field - Product *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 ListProductSubscriptionsInput) 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 ListProductSubscriptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProductSubscriptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProductSubscriptionsInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.Product == nil { - invalidParams.Add(request.NewErrParamRequired("Product")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListProductSubscriptionsInput) SetFilters(v []*Filter) *ListProductSubscriptionsInput { - s.Filters = v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *ListProductSubscriptionsInput) SetIdentityProvider(v *IdentityProvider) *ListProductSubscriptionsInput { - s.IdentityProvider = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListProductSubscriptionsInput) SetMaxResults(v int64) *ListProductSubscriptionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProductSubscriptionsInput) SetNextToken(v string) *ListProductSubscriptionsInput { - s.NextToken = &v - return s -} - -// SetProduct sets the Product field's value. -func (s *ListProductSubscriptionsInput) SetProduct(v string) *ListProductSubscriptionsInput { - s.Product = &v - return s -} - -type ListProductSubscriptionsOutput struct { - _ struct{} `type:"structure"` - - // Token for the next set of results. - NextToken *string `type:"string"` - - // Metadata that describes the list product subscriptions operation. - ProductUserSummaries []*ProductUserSummary `type:"list"` -} - -// 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 ListProductSubscriptionsOutput) 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 ListProductSubscriptionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProductSubscriptionsOutput) SetNextToken(v string) *ListProductSubscriptionsOutput { - s.NextToken = &v - return s -} - -// SetProductUserSummaries sets the ProductUserSummaries field's value. -func (s *ListProductSubscriptionsOutput) SetProductUserSummaries(v []*ProductUserSummary) *ListProductSubscriptionsOutput { - s.ProductUserSummaries = v - return s -} - -type ListUserAssociationsInput struct { - _ struct{} `type:"structure"` - - // An array of structures that you can use to filter the results to those that - // match one or more sets of key-value pairs that you specify. - Filters []*Filter `type:"list"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The ID of the EC2 instance, which provides user-based subscriptions. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` - - // Maximum number of results to return in a single call. - MaxResults *int64 `type:"integer"` - - // Token for the next set of results. - NextToken *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 ListUserAssociationsInput) 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 ListUserAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListUserAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListUserAssociationsInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.InstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListUserAssociationsInput) SetFilters(v []*Filter) *ListUserAssociationsInput { - s.Filters = v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *ListUserAssociationsInput) SetIdentityProvider(v *IdentityProvider) *ListUserAssociationsInput { - s.IdentityProvider = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ListUserAssociationsInput) SetInstanceId(v string) *ListUserAssociationsInput { - s.InstanceId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListUserAssociationsInput) SetMaxResults(v int64) *ListUserAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListUserAssociationsInput) SetNextToken(v string) *ListUserAssociationsInput { - s.NextToken = &v - return s -} - -type ListUserAssociationsOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the list user association operation. - InstanceUserSummaries []*InstanceUserSummary `type:"list"` - - // Token for the next set of results. - NextToken *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 ListUserAssociationsOutput) 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 ListUserAssociationsOutput) GoString() string { - return s.String() -} - -// SetInstanceUserSummaries sets the InstanceUserSummaries field's value. -func (s *ListUserAssociationsOutput) SetInstanceUserSummaries(v []*InstanceUserSummary) *ListUserAssociationsOutput { - s.InstanceUserSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListUserAssociationsOutput) SetNextToken(v string) *ListUserAssociationsOutput { - s.NextToken = &v - return s -} - -// The summary of the user-based subscription products for a user. -type ProductUserSummary struct { - _ struct{} `type:"structure"` - - // The domain name of the user. - Domain *string `type:"string"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The name of the user-based subscription product. - // - // Product is a required field - Product *string `type:"string" required:"true"` - - // The status of a product for a user. - // - // Status is a required field - Status *string `type:"string" required:"true"` - - // The status message for a product for a user. - StatusMessage *string `type:"string"` - - // The end date of a subscription. - SubscriptionEndDate *string `type:"string"` - - // The start date of a subscription. - SubscriptionStartDate *string `type:"string"` - - // The user name from the identity provider of the user. - // - // Username is a required field - Username *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 ProductUserSummary) 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 ProductUserSummary) GoString() string { - return s.String() -} - -// SetDomain sets the Domain field's value. -func (s *ProductUserSummary) SetDomain(v string) *ProductUserSummary { - s.Domain = &v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *ProductUserSummary) SetIdentityProvider(v *IdentityProvider) *ProductUserSummary { - s.IdentityProvider = v - return s -} - -// SetProduct sets the Product field's value. -func (s *ProductUserSummary) SetProduct(v string) *ProductUserSummary { - s.Product = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ProductUserSummary) SetStatus(v string) *ProductUserSummary { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ProductUserSummary) SetStatusMessage(v string) *ProductUserSummary { - s.StatusMessage = &v - return s -} - -// SetSubscriptionEndDate sets the SubscriptionEndDate field's value. -func (s *ProductUserSummary) SetSubscriptionEndDate(v string) *ProductUserSummary { - s.SubscriptionEndDate = &v - return s -} - -// SetSubscriptionStartDate sets the SubscriptionStartDate field's value. -func (s *ProductUserSummary) SetSubscriptionStartDate(v string) *ProductUserSummary { - s.SubscriptionStartDate = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *ProductUserSummary) SetUsername(v string) *ProductUserSummary { - s.Username = &v - return s -} - -type RegisterIdentityProviderInput struct { - _ struct{} `type:"structure"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The name of the user-based subscription product. - // - // Product is a required field - Product *string `type:"string" required:"true"` - - // The registered identity provider’s product related configuration settings - // such as the subnets to provision VPC endpoints. - Settings *Settings `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 RegisterIdentityProviderInput) 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 RegisterIdentityProviderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterIdentityProviderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterIdentityProviderInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.Product == nil { - invalidParams.Add(request.NewErrParamRequired("Product")) - } - if s.Settings != nil { - if err := s.Settings.Validate(); err != nil { - invalidParams.AddNested("Settings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *RegisterIdentityProviderInput) SetIdentityProvider(v *IdentityProvider) *RegisterIdentityProviderInput { - s.IdentityProvider = v - return s -} - -// SetProduct sets the Product field's value. -func (s *RegisterIdentityProviderInput) SetProduct(v string) *RegisterIdentityProviderInput { - s.Product = &v - return s -} - -// SetSettings sets the Settings field's value. -func (s *RegisterIdentityProviderInput) SetSettings(v *Settings) *RegisterIdentityProviderInput { - s.Settings = v - return s -} - -type RegisterIdentityProviderOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the results of an identity provider operation. - // - // IdentityProviderSummary is a required field - IdentityProviderSummary *IdentityProviderSummary `type:"structure" 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 RegisterIdentityProviderOutput) 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 RegisterIdentityProviderOutput) GoString() string { - return s.String() -} - -// SetIdentityProviderSummary sets the IdentityProviderSummary field's value. -func (s *RegisterIdentityProviderOutput) SetIdentityProviderSummary(v *IdentityProviderSummary) *RegisterIdentityProviderOutput { - s.IdentityProviderSummary = v - return s -} - -// The resource couldn't be found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request failed because a service quota is exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The registered identity provider’s product related configuration settings -// such as the subnets to provision VPC endpoints, and the security group ID -// that is associated with the VPC endpoints. The security group should permit -// inbound TCP port 1688 communication from resources in the VPC. -type Settings struct { - _ struct{} `type:"structure"` - - // A security group ID that allows inbound TCP port 1688 communication between - // resources in your VPC and the VPC endpoint for activation servers. - // - // SecurityGroupId is a required field - SecurityGroupId *string `min:"5" type:"string" required:"true"` - - // The subnets defined for the registered identity provider. - // - // Subnets is a required field - Subnets []*string `min:"1" type:"list" 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 Settings) 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 Settings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Settings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Settings"} - if s.SecurityGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityGroupId")) - } - if s.SecurityGroupId != nil && len(*s.SecurityGroupId) < 5 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroupId", 5)) - } - if s.Subnets == nil { - invalidParams.Add(request.NewErrParamRequired("Subnets")) - } - if s.Subnets != nil && len(s.Subnets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Subnets", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSecurityGroupId sets the SecurityGroupId field's value. -func (s *Settings) SetSecurityGroupId(v string) *Settings { - s.SecurityGroupId = &v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *Settings) SetSubnets(v []*string) *Settings { - s.Subnets = v - return s -} - -type StartProductSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The domain name of the user. - Domain *string `type:"string"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The name of the user-based subscription product. - // - // Product is a required field - Product *string `type:"string" required:"true"` - - // The user name from the identity provider of the user. - // - // Username is a required field - Username *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 StartProductSubscriptionInput) 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 StartProductSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartProductSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartProductSubscriptionInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.Product == nil { - invalidParams.Add(request.NewErrParamRequired("Product")) - } - if s.Username == nil { - invalidParams.Add(request.NewErrParamRequired("Username")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomain sets the Domain field's value. -func (s *StartProductSubscriptionInput) SetDomain(v string) *StartProductSubscriptionInput { - s.Domain = &v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *StartProductSubscriptionInput) SetIdentityProvider(v *IdentityProvider) *StartProductSubscriptionInput { - s.IdentityProvider = v - return s -} - -// SetProduct sets the Product field's value. -func (s *StartProductSubscriptionInput) SetProduct(v string) *StartProductSubscriptionInput { - s.Product = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *StartProductSubscriptionInput) SetUsername(v string) *StartProductSubscriptionInput { - s.Username = &v - return s -} - -type StartProductSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the start product subscription operation. - // - // ProductUserSummary is a required field - ProductUserSummary *ProductUserSummary `type:"structure" 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 StartProductSubscriptionOutput) 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 StartProductSubscriptionOutput) GoString() string { - return s.String() -} - -// SetProductUserSummary sets the ProductUserSummary field's value. -func (s *StartProductSubscriptionOutput) SetProductUserSummary(v *ProductUserSummary) *StartProductSubscriptionOutput { - s.ProductUserSummary = v - return s -} - -type StopProductSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The domain name of the user. - Domain *string `type:"string"` - - // An object that specifies details for the identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The name of the user-based subscription product. - // - // Product is a required field - Product *string `type:"string" required:"true"` - - // The user name from the identity provider for the user. - // - // Username is a required field - Username *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 StopProductSubscriptionInput) 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 StopProductSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopProductSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopProductSubscriptionInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.Product == nil { - invalidParams.Add(request.NewErrParamRequired("Product")) - } - if s.Username == nil { - invalidParams.Add(request.NewErrParamRequired("Username")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomain sets the Domain field's value. -func (s *StopProductSubscriptionInput) SetDomain(v string) *StopProductSubscriptionInput { - s.Domain = &v - return s -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *StopProductSubscriptionInput) SetIdentityProvider(v *IdentityProvider) *StopProductSubscriptionInput { - s.IdentityProvider = v - return s -} - -// SetProduct sets the Product field's value. -func (s *StopProductSubscriptionInput) SetProduct(v string) *StopProductSubscriptionInput { - s.Product = &v - return s -} - -// SetUsername sets the Username field's value. -func (s *StopProductSubscriptionInput) SetUsername(v string) *StopProductSubscriptionInput { - s.Username = &v - return s -} - -type StopProductSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // Metadata that describes the start product subscription operation. - // - // ProductUserSummary is a required field - ProductUserSummary *ProductUserSummary `type:"structure" 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 StopProductSubscriptionOutput) 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 StopProductSubscriptionOutput) GoString() string { - return s.String() -} - -// SetProductUserSummary sets the ProductUserSummary field's value. -func (s *StopProductSubscriptionOutput) SetProductUserSummary(v *ProductUserSummary) *StopProductSubscriptionOutput { - s.ProductUserSummary = v - return s -} - -// The request was denied because of request throttling. Retry the request. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UpdateIdentityProviderSettingsInput struct { - _ struct{} `type:"structure"` - - // Details about an identity provider. - // - // IdentityProvider is a required field - IdentityProvider *IdentityProvider `type:"structure" required:"true"` - - // The name of the user-based subscription product. - // - // Product is a required field - Product *string `type:"string" required:"true"` - - // Updates the registered identity provider’s product related configuration - // settings. You can update any combination of settings in a single operation - // such as the: - // - // * Subnets which you want to add to provision VPC endpoints. - // - // * Subnets which you want to remove the VPC endpoints from. - // - // * Security group ID which permits traffic to the VPC endpoints. - // - // UpdateSettings is a required field - UpdateSettings *UpdateSettings `type:"structure" 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 UpdateIdentityProviderSettingsInput) 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 UpdateIdentityProviderSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIdentityProviderSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIdentityProviderSettingsInput"} - if s.IdentityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityProvider")) - } - if s.Product == nil { - invalidParams.Add(request.NewErrParamRequired("Product")) - } - if s.UpdateSettings == nil { - invalidParams.Add(request.NewErrParamRequired("UpdateSettings")) - } - if s.UpdateSettings != nil { - if err := s.UpdateSettings.Validate(); err != nil { - invalidParams.AddNested("UpdateSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentityProvider sets the IdentityProvider field's value. -func (s *UpdateIdentityProviderSettingsInput) SetIdentityProvider(v *IdentityProvider) *UpdateIdentityProviderSettingsInput { - s.IdentityProvider = v - return s -} - -// SetProduct sets the Product field's value. -func (s *UpdateIdentityProviderSettingsInput) SetProduct(v string) *UpdateIdentityProviderSettingsInput { - s.Product = &v - return s -} - -// SetUpdateSettings sets the UpdateSettings field's value. -func (s *UpdateIdentityProviderSettingsInput) SetUpdateSettings(v *UpdateSettings) *UpdateIdentityProviderSettingsInput { - s.UpdateSettings = v - return s -} - -type UpdateIdentityProviderSettingsOutput struct { - _ struct{} `type:"structure"` - - // Describes an identity provider. - // - // IdentityProviderSummary is a required field - IdentityProviderSummary *IdentityProviderSummary `type:"structure" 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 UpdateIdentityProviderSettingsOutput) 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 UpdateIdentityProviderSettingsOutput) GoString() string { - return s.String() -} - -// SetIdentityProviderSummary sets the IdentityProviderSummary field's value. -func (s *UpdateIdentityProviderSettingsOutput) SetIdentityProviderSummary(v *IdentityProviderSummary) *UpdateIdentityProviderSettingsOutput { - s.IdentityProviderSummary = v - return s -} - -// Updates the registered identity provider’s product related configuration -// settings such as the subnets to provision VPC endpoints. -type UpdateSettings struct { - _ struct{} `type:"structure"` - - // The ID of one or more subnets in which License Manager will create a VPC - // endpoint for products that require connectivity to activation servers. - // - // AddSubnets is a required field - AddSubnets []*string `type:"list" required:"true"` - - // The ID of one or more subnets to remove. - // - // RemoveSubnets is a required field - RemoveSubnets []*string `type:"list" required:"true"` - - // A security group ID that allows inbound TCP port 1688 communication between - // resources in your VPC and the VPC endpoints for activation servers. - SecurityGroupId *string `min:"5" 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 UpdateSettings) 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 UpdateSettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSettings"} - if s.AddSubnets == nil { - invalidParams.Add(request.NewErrParamRequired("AddSubnets")) - } - if s.RemoveSubnets == nil { - invalidParams.Add(request.NewErrParamRequired("RemoveSubnets")) - } - if s.SecurityGroupId != nil && len(*s.SecurityGroupId) < 5 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroupId", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddSubnets sets the AddSubnets field's value. -func (s *UpdateSettings) SetAddSubnets(v []*string) *UpdateSettings { - s.AddSubnets = v - return s -} - -// SetRemoveSubnets sets the RemoveSubnets field's value. -func (s *UpdateSettings) SetRemoveSubnets(v []*string) *UpdateSettings { - s.RemoveSubnets = v - return s -} - -// SetSecurityGroupId sets the SecurityGroupId field's value. -func (s *UpdateSettings) SetSecurityGroupId(v string) *UpdateSettings { - s.SecurityGroupId = &v - return s -} - -// A parameter is not valid. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/doc.go deleted file mode 100644 index 70bf748cfd91..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/doc.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package licensemanagerusersubscriptions provides the client and types for making API -// requests to AWS License Manager User Subscriptions. -// -// With License Manager, you can create user-based subscriptions to utilize -// licensed software with a per user subscription fee on Amazon EC2 instances. -// -// See https://docs.aws.amazon.com/goto/WebAPI/license-manager-user-subscriptions-2018-05-10 for more information on this service. -// -// See licensemanagerusersubscriptions package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/licensemanagerusersubscriptions/ -// -// # Using the Client -// -// To contact AWS License Manager User Subscriptions with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS License Manager User Subscriptions client LicenseManagerUserSubscriptions for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/licensemanagerusersubscriptions/#New -package licensemanagerusersubscriptions diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/errors.go deleted file mode 100644 index 96c8b441e864..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/errors.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package licensemanagerusersubscriptions - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request couldn't be completed because it conflicted with the current - // state of the resource. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An exception occurred with the service. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource couldn't be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request failed because a service quota is exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied because of request throttling. Retry the request. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // A parameter is not valid. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/licensemanagerusersubscriptionsiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/licensemanagerusersubscriptionsiface/interface.go deleted file mode 100644 index 1f588120a0f5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/licensemanagerusersubscriptionsiface/interface.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package licensemanagerusersubscriptionsiface provides an interface to enable mocking the AWS License Manager User Subscriptions service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package licensemanagerusersubscriptionsiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions" -) - -// LicenseManagerUserSubscriptionsAPI provides an interface to enable mocking the -// licensemanagerusersubscriptions.LicenseManagerUserSubscriptions service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS License Manager User Subscriptions. -// func myFunc(svc licensemanagerusersubscriptionsiface.LicenseManagerUserSubscriptionsAPI) bool { -// // Make svc.AssociateUser request -// } -// -// func main() { -// sess := session.New() -// svc := licensemanagerusersubscriptions.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockLicenseManagerUserSubscriptionsClient struct { -// licensemanagerusersubscriptionsiface.LicenseManagerUserSubscriptionsAPI -// } -// func (m *mockLicenseManagerUserSubscriptionsClient) AssociateUser(input *licensemanagerusersubscriptions.AssociateUserInput) (*licensemanagerusersubscriptions.AssociateUserOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockLicenseManagerUserSubscriptionsClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type LicenseManagerUserSubscriptionsAPI interface { - AssociateUser(*licensemanagerusersubscriptions.AssociateUserInput) (*licensemanagerusersubscriptions.AssociateUserOutput, error) - AssociateUserWithContext(aws.Context, *licensemanagerusersubscriptions.AssociateUserInput, ...request.Option) (*licensemanagerusersubscriptions.AssociateUserOutput, error) - AssociateUserRequest(*licensemanagerusersubscriptions.AssociateUserInput) (*request.Request, *licensemanagerusersubscriptions.AssociateUserOutput) - - DeregisterIdentityProvider(*licensemanagerusersubscriptions.DeregisterIdentityProviderInput) (*licensemanagerusersubscriptions.DeregisterIdentityProviderOutput, error) - DeregisterIdentityProviderWithContext(aws.Context, *licensemanagerusersubscriptions.DeregisterIdentityProviderInput, ...request.Option) (*licensemanagerusersubscriptions.DeregisterIdentityProviderOutput, error) - DeregisterIdentityProviderRequest(*licensemanagerusersubscriptions.DeregisterIdentityProviderInput) (*request.Request, *licensemanagerusersubscriptions.DeregisterIdentityProviderOutput) - - DisassociateUser(*licensemanagerusersubscriptions.DisassociateUserInput) (*licensemanagerusersubscriptions.DisassociateUserOutput, error) - DisassociateUserWithContext(aws.Context, *licensemanagerusersubscriptions.DisassociateUserInput, ...request.Option) (*licensemanagerusersubscriptions.DisassociateUserOutput, error) - DisassociateUserRequest(*licensemanagerusersubscriptions.DisassociateUserInput) (*request.Request, *licensemanagerusersubscriptions.DisassociateUserOutput) - - ListIdentityProviders(*licensemanagerusersubscriptions.ListIdentityProvidersInput) (*licensemanagerusersubscriptions.ListIdentityProvidersOutput, error) - ListIdentityProvidersWithContext(aws.Context, *licensemanagerusersubscriptions.ListIdentityProvidersInput, ...request.Option) (*licensemanagerusersubscriptions.ListIdentityProvidersOutput, error) - ListIdentityProvidersRequest(*licensemanagerusersubscriptions.ListIdentityProvidersInput) (*request.Request, *licensemanagerusersubscriptions.ListIdentityProvidersOutput) - - ListIdentityProvidersPages(*licensemanagerusersubscriptions.ListIdentityProvidersInput, func(*licensemanagerusersubscriptions.ListIdentityProvidersOutput, bool) bool) error - ListIdentityProvidersPagesWithContext(aws.Context, *licensemanagerusersubscriptions.ListIdentityProvidersInput, func(*licensemanagerusersubscriptions.ListIdentityProvidersOutput, bool) bool, ...request.Option) error - - ListInstances(*licensemanagerusersubscriptions.ListInstancesInput) (*licensemanagerusersubscriptions.ListInstancesOutput, error) - ListInstancesWithContext(aws.Context, *licensemanagerusersubscriptions.ListInstancesInput, ...request.Option) (*licensemanagerusersubscriptions.ListInstancesOutput, error) - ListInstancesRequest(*licensemanagerusersubscriptions.ListInstancesInput) (*request.Request, *licensemanagerusersubscriptions.ListInstancesOutput) - - ListInstancesPages(*licensemanagerusersubscriptions.ListInstancesInput, func(*licensemanagerusersubscriptions.ListInstancesOutput, bool) bool) error - ListInstancesPagesWithContext(aws.Context, *licensemanagerusersubscriptions.ListInstancesInput, func(*licensemanagerusersubscriptions.ListInstancesOutput, bool) bool, ...request.Option) error - - ListProductSubscriptions(*licensemanagerusersubscriptions.ListProductSubscriptionsInput) (*licensemanagerusersubscriptions.ListProductSubscriptionsOutput, error) - ListProductSubscriptionsWithContext(aws.Context, *licensemanagerusersubscriptions.ListProductSubscriptionsInput, ...request.Option) (*licensemanagerusersubscriptions.ListProductSubscriptionsOutput, error) - ListProductSubscriptionsRequest(*licensemanagerusersubscriptions.ListProductSubscriptionsInput) (*request.Request, *licensemanagerusersubscriptions.ListProductSubscriptionsOutput) - - ListProductSubscriptionsPages(*licensemanagerusersubscriptions.ListProductSubscriptionsInput, func(*licensemanagerusersubscriptions.ListProductSubscriptionsOutput, bool) bool) error - ListProductSubscriptionsPagesWithContext(aws.Context, *licensemanagerusersubscriptions.ListProductSubscriptionsInput, func(*licensemanagerusersubscriptions.ListProductSubscriptionsOutput, bool) bool, ...request.Option) error - - ListUserAssociations(*licensemanagerusersubscriptions.ListUserAssociationsInput) (*licensemanagerusersubscriptions.ListUserAssociationsOutput, error) - ListUserAssociationsWithContext(aws.Context, *licensemanagerusersubscriptions.ListUserAssociationsInput, ...request.Option) (*licensemanagerusersubscriptions.ListUserAssociationsOutput, error) - ListUserAssociationsRequest(*licensemanagerusersubscriptions.ListUserAssociationsInput) (*request.Request, *licensemanagerusersubscriptions.ListUserAssociationsOutput) - - ListUserAssociationsPages(*licensemanagerusersubscriptions.ListUserAssociationsInput, func(*licensemanagerusersubscriptions.ListUserAssociationsOutput, bool) bool) error - ListUserAssociationsPagesWithContext(aws.Context, *licensemanagerusersubscriptions.ListUserAssociationsInput, func(*licensemanagerusersubscriptions.ListUserAssociationsOutput, bool) bool, ...request.Option) error - - RegisterIdentityProvider(*licensemanagerusersubscriptions.RegisterIdentityProviderInput) (*licensemanagerusersubscriptions.RegisterIdentityProviderOutput, error) - RegisterIdentityProviderWithContext(aws.Context, *licensemanagerusersubscriptions.RegisterIdentityProviderInput, ...request.Option) (*licensemanagerusersubscriptions.RegisterIdentityProviderOutput, error) - RegisterIdentityProviderRequest(*licensemanagerusersubscriptions.RegisterIdentityProviderInput) (*request.Request, *licensemanagerusersubscriptions.RegisterIdentityProviderOutput) - - StartProductSubscription(*licensemanagerusersubscriptions.StartProductSubscriptionInput) (*licensemanagerusersubscriptions.StartProductSubscriptionOutput, error) - StartProductSubscriptionWithContext(aws.Context, *licensemanagerusersubscriptions.StartProductSubscriptionInput, ...request.Option) (*licensemanagerusersubscriptions.StartProductSubscriptionOutput, error) - StartProductSubscriptionRequest(*licensemanagerusersubscriptions.StartProductSubscriptionInput) (*request.Request, *licensemanagerusersubscriptions.StartProductSubscriptionOutput) - - StopProductSubscription(*licensemanagerusersubscriptions.StopProductSubscriptionInput) (*licensemanagerusersubscriptions.StopProductSubscriptionOutput, error) - StopProductSubscriptionWithContext(aws.Context, *licensemanagerusersubscriptions.StopProductSubscriptionInput, ...request.Option) (*licensemanagerusersubscriptions.StopProductSubscriptionOutput, error) - StopProductSubscriptionRequest(*licensemanagerusersubscriptions.StopProductSubscriptionInput) (*request.Request, *licensemanagerusersubscriptions.StopProductSubscriptionOutput) - - UpdateIdentityProviderSettings(*licensemanagerusersubscriptions.UpdateIdentityProviderSettingsInput) (*licensemanagerusersubscriptions.UpdateIdentityProviderSettingsOutput, error) - UpdateIdentityProviderSettingsWithContext(aws.Context, *licensemanagerusersubscriptions.UpdateIdentityProviderSettingsInput, ...request.Option) (*licensemanagerusersubscriptions.UpdateIdentityProviderSettingsOutput, error) - UpdateIdentityProviderSettingsRequest(*licensemanagerusersubscriptions.UpdateIdentityProviderSettingsInput) (*request.Request, *licensemanagerusersubscriptions.UpdateIdentityProviderSettingsOutput) -} - -var _ LicenseManagerUserSubscriptionsAPI = (*licensemanagerusersubscriptions.LicenseManagerUserSubscriptions)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/service.go deleted file mode 100644 index ff4dd1232cf4..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/licensemanagerusersubscriptions/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package licensemanagerusersubscriptions - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// LicenseManagerUserSubscriptions provides the API operation methods for making requests to -// AWS License Manager User Subscriptions. See this package's package overview docs -// for details on the service. -// -// LicenseManagerUserSubscriptions methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type LicenseManagerUserSubscriptions struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "License Manager User Subscriptions" // Name of service. - EndpointsID = "license-manager-user-subscriptions" // ID to lookup a service endpoint with. - ServiceID = "License Manager User Subscriptions" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the LicenseManagerUserSubscriptions client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a LicenseManagerUserSubscriptions client from just a session. -// svc := licensemanagerusersubscriptions.New(mySession) -// -// // Create a LicenseManagerUserSubscriptions client with additional configuration -// svc := licensemanagerusersubscriptions.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *LicenseManagerUserSubscriptions { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "license-manager-user-subscriptions" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *LicenseManagerUserSubscriptions { - svc := &LicenseManagerUserSubscriptions{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a LicenseManagerUserSubscriptions operation and runs any -// custom request initialization. -func (c *LicenseManagerUserSubscriptions) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/api.go deleted file mode 100644 index 0ebe2b3b1cd1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/api.go +++ /dev/null @@ -1,11720 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package m2 - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCancelBatchJobExecution = "CancelBatchJobExecution" - -// CancelBatchJobExecutionRequest generates a "aws/request.Request" representing the -// client's request for the CancelBatchJobExecution 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 CancelBatchJobExecution for more information on using the CancelBatchJobExecution -// 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 CancelBatchJobExecutionRequest method. -// req, resp := client.CancelBatchJobExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CancelBatchJobExecution -func (c *M2) CancelBatchJobExecutionRequest(input *CancelBatchJobExecutionInput) (req *request.Request, output *CancelBatchJobExecutionOutput) { - op := &request.Operation{ - Name: opCancelBatchJobExecution, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/batch-job-executions/{executionId}/cancel", - } - - if input == nil { - input = &CancelBatchJobExecutionInput{} - } - - output = &CancelBatchJobExecutionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CancelBatchJobExecution API operation for AWSMainframeModernization. -// -// Cancels the running of a specific batch job execution. -// -// 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 AWSMainframeModernization's -// API operation CancelBatchJobExecution for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CancelBatchJobExecution -func (c *M2) CancelBatchJobExecution(input *CancelBatchJobExecutionInput) (*CancelBatchJobExecutionOutput, error) { - req, out := c.CancelBatchJobExecutionRequest(input) - return out, req.Send() -} - -// CancelBatchJobExecutionWithContext is the same as CancelBatchJobExecution with the addition of -// the ability to pass a context and additional request options. -// -// See CancelBatchJobExecution 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 *M2) CancelBatchJobExecutionWithContext(ctx aws.Context, input *CancelBatchJobExecutionInput, opts ...request.Option) (*CancelBatchJobExecutionOutput, error) { - req, out := c.CancelBatchJobExecutionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateApplication = "CreateApplication" - -// CreateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the CreateApplication 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 CreateApplication for more information on using the CreateApplication -// 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 CreateApplicationRequest method. -// req, resp := client.CreateApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CreateApplication -func (c *M2) CreateApplicationRequest(input *CreateApplicationInput) (req *request.Request, output *CreateApplicationOutput) { - op := &request.Operation{ - Name: opCreateApplication, - HTTPMethod: "POST", - HTTPPath: "/applications", - } - - if input == nil { - input = &CreateApplicationInput{} - } - - output = &CreateApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateApplication API operation for AWSMainframeModernization. -// -// Creates a new application with given parameters. Requires an existing runtime -// environment and application definition file. -// -// 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 AWSMainframeModernization's -// API operation CreateApplication for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// One or more quotas for Amazon Web Services Mainframe Modernization exceeds -// the limit. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CreateApplication -func (c *M2) CreateApplication(input *CreateApplicationInput) (*CreateApplicationOutput, error) { - req, out := c.CreateApplicationRequest(input) - return out, req.Send() -} - -// CreateApplicationWithContext is the same as CreateApplication with the addition of -// the ability to pass a context and additional request options. -// -// See CreateApplication 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 *M2) CreateApplicationWithContext(ctx aws.Context, input *CreateApplicationInput, opts ...request.Option) (*CreateApplicationOutput, error) { - req, out := c.CreateApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDataSetImportTask = "CreateDataSetImportTask" - -// CreateDataSetImportTaskRequest generates a "aws/request.Request" representing the -// client's request for the CreateDataSetImportTask 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 CreateDataSetImportTask for more information on using the CreateDataSetImportTask -// 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 CreateDataSetImportTaskRequest method. -// req, resp := client.CreateDataSetImportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CreateDataSetImportTask -func (c *M2) CreateDataSetImportTaskRequest(input *CreateDataSetImportTaskInput) (req *request.Request, output *CreateDataSetImportTaskOutput) { - op := &request.Operation{ - Name: opCreateDataSetImportTask, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/dataset-import-task", - } - - if input == nil { - input = &CreateDataSetImportTaskInput{} - } - - output = &CreateDataSetImportTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDataSetImportTask API operation for AWSMainframeModernization. -// -// Starts a data set import task for a specific application. -// -// 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 AWSMainframeModernization's -// API operation CreateDataSetImportTask for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ServiceQuotaExceededException -// One or more quotas for Amazon Web Services Mainframe Modernization exceeds -// the limit. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CreateDataSetImportTask -func (c *M2) CreateDataSetImportTask(input *CreateDataSetImportTaskInput) (*CreateDataSetImportTaskOutput, error) { - req, out := c.CreateDataSetImportTaskRequest(input) - return out, req.Send() -} - -// CreateDataSetImportTaskWithContext is the same as CreateDataSetImportTask with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDataSetImportTask 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 *M2) CreateDataSetImportTaskWithContext(ctx aws.Context, input *CreateDataSetImportTaskInput, opts ...request.Option) (*CreateDataSetImportTaskOutput, error) { - req, out := c.CreateDataSetImportTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDeployment = "CreateDeployment" - -// CreateDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the CreateDeployment 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 CreateDeployment for more information on using the CreateDeployment -// 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 CreateDeploymentRequest method. -// req, resp := client.CreateDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CreateDeployment -func (c *M2) CreateDeploymentRequest(input *CreateDeploymentInput) (req *request.Request, output *CreateDeploymentOutput) { - op := &request.Operation{ - Name: opCreateDeployment, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/deployments", - } - - if input == nil { - input = &CreateDeploymentInput{} - } - - output = &CreateDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDeployment API operation for AWSMainframeModernization. -// -// Creates and starts a deployment to deploy an application into a runtime environment. -// -// 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 AWSMainframeModernization's -// API operation CreateDeployment for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ServiceQuotaExceededException -// One or more quotas for Amazon Web Services Mainframe Modernization exceeds -// the limit. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CreateDeployment -func (c *M2) CreateDeployment(input *CreateDeploymentInput) (*CreateDeploymentOutput, error) { - req, out := c.CreateDeploymentRequest(input) - return out, req.Send() -} - -// CreateDeploymentWithContext is the same as CreateDeployment with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDeployment 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 *M2) CreateDeploymentWithContext(ctx aws.Context, input *CreateDeploymentInput, opts ...request.Option) (*CreateDeploymentOutput, error) { - req, out := c.CreateDeploymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateEnvironment = "CreateEnvironment" - -// CreateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the CreateEnvironment 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 CreateEnvironment for more information on using the CreateEnvironment -// 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 CreateEnvironmentRequest method. -// req, resp := client.CreateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CreateEnvironment -func (c *M2) CreateEnvironmentRequest(input *CreateEnvironmentInput) (req *request.Request, output *CreateEnvironmentOutput) { - op := &request.Operation{ - Name: opCreateEnvironment, - HTTPMethod: "POST", - HTTPPath: "/environments", - } - - if input == nil { - input = &CreateEnvironmentInput{} - } - - output = &CreateEnvironmentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEnvironment API operation for AWSMainframeModernization. -// -// Creates a runtime environment for a given runtime engine. -// -// 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 AWSMainframeModernization's -// API operation CreateEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// One or more quotas for Amazon Web Services Mainframe Modernization exceeds -// the limit. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/CreateEnvironment -func (c *M2) CreateEnvironment(input *CreateEnvironmentInput) (*CreateEnvironmentOutput, error) { - req, out := c.CreateEnvironmentRequest(input) - return out, req.Send() -} - -// CreateEnvironmentWithContext is the same as CreateEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEnvironment 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 *M2) CreateEnvironmentWithContext(ctx aws.Context, input *CreateEnvironmentInput, opts ...request.Option) (*CreateEnvironmentOutput, error) { - req, out := c.CreateEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteApplication = "DeleteApplication" - -// DeleteApplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApplication 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 DeleteApplication for more information on using the DeleteApplication -// 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 DeleteApplicationRequest method. -// req, resp := client.DeleteApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/DeleteApplication -func (c *M2) DeleteApplicationRequest(input *DeleteApplicationInput) (req *request.Request, output *DeleteApplicationOutput) { - op := &request.Operation{ - Name: opDeleteApplication, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}", - } - - if input == nil { - input = &DeleteApplicationInput{} - } - - output = &DeleteApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApplication API operation for AWSMainframeModernization. -// -// Deletes a specific application. You cannot delete a running application. -// -// 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 AWSMainframeModernization's -// API operation DeleteApplication for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/DeleteApplication -func (c *M2) DeleteApplication(input *DeleteApplicationInput) (*DeleteApplicationOutput, error) { - req, out := c.DeleteApplicationRequest(input) - return out, req.Send() -} - -// DeleteApplicationWithContext is the same as DeleteApplication with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteApplication 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 *M2) DeleteApplicationWithContext(ctx aws.Context, input *DeleteApplicationInput, opts ...request.Option) (*DeleteApplicationOutput, error) { - req, out := c.DeleteApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteApplicationFromEnvironment = "DeleteApplicationFromEnvironment" - -// DeleteApplicationFromEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApplicationFromEnvironment 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 DeleteApplicationFromEnvironment for more information on using the DeleteApplicationFromEnvironment -// 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 DeleteApplicationFromEnvironmentRequest method. -// req, resp := client.DeleteApplicationFromEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/DeleteApplicationFromEnvironment -func (c *M2) DeleteApplicationFromEnvironmentRequest(input *DeleteApplicationFromEnvironmentInput) (req *request.Request, output *DeleteApplicationFromEnvironmentOutput) { - op := &request.Operation{ - Name: opDeleteApplicationFromEnvironment, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/environment/{environmentId}", - } - - if input == nil { - input = &DeleteApplicationFromEnvironmentInput{} - } - - output = &DeleteApplicationFromEnvironmentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApplicationFromEnvironment API operation for AWSMainframeModernization. -// -// Deletes a specific application from the specific runtime environment where -// it was previously deployed. You cannot delete a runtime environment using -// DeleteEnvironment if any application has ever been deployed to it. This API -// removes the association of the application with the runtime environment so -// you can delete the environment smoothly. -// -// 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 AWSMainframeModernization's -// API operation DeleteApplicationFromEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/DeleteApplicationFromEnvironment -func (c *M2) DeleteApplicationFromEnvironment(input *DeleteApplicationFromEnvironmentInput) (*DeleteApplicationFromEnvironmentOutput, error) { - req, out := c.DeleteApplicationFromEnvironmentRequest(input) - return out, req.Send() -} - -// DeleteApplicationFromEnvironmentWithContext is the same as DeleteApplicationFromEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteApplicationFromEnvironment 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 *M2) DeleteApplicationFromEnvironmentWithContext(ctx aws.Context, input *DeleteApplicationFromEnvironmentInput, opts ...request.Option) (*DeleteApplicationFromEnvironmentOutput, error) { - req, out := c.DeleteApplicationFromEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEnvironment = "DeleteEnvironment" - -// DeleteEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEnvironment 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 DeleteEnvironment for more information on using the DeleteEnvironment -// 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 DeleteEnvironmentRequest method. -// req, resp := client.DeleteEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/DeleteEnvironment -func (c *M2) DeleteEnvironmentRequest(input *DeleteEnvironmentInput) (req *request.Request, output *DeleteEnvironmentOutput) { - op := &request.Operation{ - Name: opDeleteEnvironment, - HTTPMethod: "DELETE", - HTTPPath: "/environments/{environmentId}", - } - - if input == nil { - input = &DeleteEnvironmentInput{} - } - - output = &DeleteEnvironmentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEnvironment API operation for AWSMainframeModernization. -// -// Deletes a specific runtime environment. The environment cannot contain deployed -// applications. If it does, you must delete those applications before you delete -// the environment. -// -// 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 AWSMainframeModernization's -// API operation DeleteEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/DeleteEnvironment -func (c *M2) DeleteEnvironment(input *DeleteEnvironmentInput) (*DeleteEnvironmentOutput, error) { - req, out := c.DeleteEnvironmentRequest(input) - return out, req.Send() -} - -// DeleteEnvironmentWithContext is the same as DeleteEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEnvironment 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 *M2) DeleteEnvironmentWithContext(ctx aws.Context, input *DeleteEnvironmentInput, opts ...request.Option) (*DeleteEnvironmentOutput, error) { - req, out := c.DeleteEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetApplication = "GetApplication" - -// GetApplicationRequest generates a "aws/request.Request" representing the -// client's request for the GetApplication 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 GetApplication for more information on using the GetApplication -// 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 GetApplicationRequest method. -// req, resp := client.GetApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetApplication -func (c *M2) GetApplicationRequest(input *GetApplicationInput) (req *request.Request, output *GetApplicationOutput) { - op := &request.Operation{ - Name: opGetApplication, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}", - } - - if input == nil { - input = &GetApplicationInput{} - } - - output = &GetApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetApplication API operation for AWSMainframeModernization. -// -// Describes the details of a specific application. -// -// 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 AWSMainframeModernization's -// API operation GetApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetApplication -func (c *M2) GetApplication(input *GetApplicationInput) (*GetApplicationOutput, error) { - req, out := c.GetApplicationRequest(input) - return out, req.Send() -} - -// GetApplicationWithContext is the same as GetApplication with the addition of -// the ability to pass a context and additional request options. -// -// See GetApplication 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 *M2) GetApplicationWithContext(ctx aws.Context, input *GetApplicationInput, opts ...request.Option) (*GetApplicationOutput, error) { - req, out := c.GetApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetApplicationVersion = "GetApplicationVersion" - -// GetApplicationVersionRequest generates a "aws/request.Request" representing the -// client's request for the GetApplicationVersion 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 GetApplicationVersion for more information on using the GetApplicationVersion -// 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 GetApplicationVersionRequest method. -// req, resp := client.GetApplicationVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetApplicationVersion -func (c *M2) GetApplicationVersionRequest(input *GetApplicationVersionInput) (req *request.Request, output *GetApplicationVersionOutput) { - op := &request.Operation{ - Name: opGetApplicationVersion, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/versions/{applicationVersion}", - } - - if input == nil { - input = &GetApplicationVersionInput{} - } - - output = &GetApplicationVersionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetApplicationVersion API operation for AWSMainframeModernization. -// -// Returns details about a specific version of a specific application. -// -// 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 AWSMainframeModernization's -// API operation GetApplicationVersion for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetApplicationVersion -func (c *M2) GetApplicationVersion(input *GetApplicationVersionInput) (*GetApplicationVersionOutput, error) { - req, out := c.GetApplicationVersionRequest(input) - return out, req.Send() -} - -// GetApplicationVersionWithContext is the same as GetApplicationVersion with the addition of -// the ability to pass a context and additional request options. -// -// See GetApplicationVersion 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 *M2) GetApplicationVersionWithContext(ctx aws.Context, input *GetApplicationVersionInput, opts ...request.Option) (*GetApplicationVersionOutput, error) { - req, out := c.GetApplicationVersionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBatchJobExecution = "GetBatchJobExecution" - -// GetBatchJobExecutionRequest generates a "aws/request.Request" representing the -// client's request for the GetBatchJobExecution 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 GetBatchJobExecution for more information on using the GetBatchJobExecution -// 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 GetBatchJobExecutionRequest method. -// req, resp := client.GetBatchJobExecutionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetBatchJobExecution -func (c *M2) GetBatchJobExecutionRequest(input *GetBatchJobExecutionInput) (req *request.Request, output *GetBatchJobExecutionOutput) { - op := &request.Operation{ - Name: opGetBatchJobExecution, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/batch-job-executions/{executionId}", - } - - if input == nil { - input = &GetBatchJobExecutionInput{} - } - - output = &GetBatchJobExecutionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBatchJobExecution API operation for AWSMainframeModernization. -// -// Gets the details of a specific batch job execution for a specific application. -// -// 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 AWSMainframeModernization's -// API operation GetBatchJobExecution for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetBatchJobExecution -func (c *M2) GetBatchJobExecution(input *GetBatchJobExecutionInput) (*GetBatchJobExecutionOutput, error) { - req, out := c.GetBatchJobExecutionRequest(input) - return out, req.Send() -} - -// GetBatchJobExecutionWithContext is the same as GetBatchJobExecution with the addition of -// the ability to pass a context and additional request options. -// -// See GetBatchJobExecution 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 *M2) GetBatchJobExecutionWithContext(ctx aws.Context, input *GetBatchJobExecutionInput, opts ...request.Option) (*GetBatchJobExecutionOutput, error) { - req, out := c.GetBatchJobExecutionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDataSetDetails = "GetDataSetDetails" - -// GetDataSetDetailsRequest generates a "aws/request.Request" representing the -// client's request for the GetDataSetDetails 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 GetDataSetDetails for more information on using the GetDataSetDetails -// 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 GetDataSetDetailsRequest method. -// req, resp := client.GetDataSetDetailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetDataSetDetails -func (c *M2) GetDataSetDetailsRequest(input *GetDataSetDetailsInput) (req *request.Request, output *GetDataSetDetailsOutput) { - op := &request.Operation{ - Name: opGetDataSetDetails, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/datasets/{dataSetName}", - } - - if input == nil { - input = &GetDataSetDetailsInput{} - } - - output = &GetDataSetDetailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataSetDetails API operation for AWSMainframeModernization. -// -// Gets the details of a specific data set. -// -// 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 AWSMainframeModernization's -// API operation GetDataSetDetails for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ExecutionTimeoutException -// Failed to connect to server, or didn’t receive response within expected -// time period. -// -// - ServiceUnavailableException -// Server cannot process the request at the moment. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetDataSetDetails -func (c *M2) GetDataSetDetails(input *GetDataSetDetailsInput) (*GetDataSetDetailsOutput, error) { - req, out := c.GetDataSetDetailsRequest(input) - return out, req.Send() -} - -// GetDataSetDetailsWithContext is the same as GetDataSetDetails with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataSetDetails 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 *M2) GetDataSetDetailsWithContext(ctx aws.Context, input *GetDataSetDetailsInput, opts ...request.Option) (*GetDataSetDetailsOutput, error) { - req, out := c.GetDataSetDetailsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDataSetImportTask = "GetDataSetImportTask" - -// GetDataSetImportTaskRequest generates a "aws/request.Request" representing the -// client's request for the GetDataSetImportTask 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 GetDataSetImportTask for more information on using the GetDataSetImportTask -// 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 GetDataSetImportTaskRequest method. -// req, resp := client.GetDataSetImportTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetDataSetImportTask -func (c *M2) GetDataSetImportTaskRequest(input *GetDataSetImportTaskInput) (req *request.Request, output *GetDataSetImportTaskOutput) { - op := &request.Operation{ - Name: opGetDataSetImportTask, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/dataset-import-tasks/{taskId}", - } - - if input == nil { - input = &GetDataSetImportTaskInput{} - } - - output = &GetDataSetImportTaskOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataSetImportTask API operation for AWSMainframeModernization. -// -// Gets the status of a data set import task initiated with the CreateDataSetImportTask -// operation. -// -// 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 AWSMainframeModernization's -// API operation GetDataSetImportTask for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetDataSetImportTask -func (c *M2) GetDataSetImportTask(input *GetDataSetImportTaskInput) (*GetDataSetImportTaskOutput, error) { - req, out := c.GetDataSetImportTaskRequest(input) - return out, req.Send() -} - -// GetDataSetImportTaskWithContext is the same as GetDataSetImportTask with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataSetImportTask 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 *M2) GetDataSetImportTaskWithContext(ctx aws.Context, input *GetDataSetImportTaskInput, opts ...request.Option) (*GetDataSetImportTaskOutput, error) { - req, out := c.GetDataSetImportTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDeployment = "GetDeployment" - -// GetDeploymentRequest generates a "aws/request.Request" representing the -// client's request for the GetDeployment 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 GetDeployment for more information on using the GetDeployment -// 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 GetDeploymentRequest method. -// req, resp := client.GetDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetDeployment -func (c *M2) GetDeploymentRequest(input *GetDeploymentInput) (req *request.Request, output *GetDeploymentOutput) { - op := &request.Operation{ - Name: opGetDeployment, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/deployments/{deploymentId}", - } - - if input == nil { - input = &GetDeploymentInput{} - } - - output = &GetDeploymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeployment API operation for AWSMainframeModernization. -// -// Gets details of a specific deployment with a given deployment identifier. -// -// 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 AWSMainframeModernization's -// API operation GetDeployment for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetDeployment -func (c *M2) GetDeployment(input *GetDeploymentInput) (*GetDeploymentOutput, error) { - req, out := c.GetDeploymentRequest(input) - return out, req.Send() -} - -// GetDeploymentWithContext is the same as GetDeployment with the addition of -// the ability to pass a context and additional request options. -// -// See GetDeployment 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 *M2) GetDeploymentWithContext(ctx aws.Context, input *GetDeploymentInput, opts ...request.Option) (*GetDeploymentOutput, error) { - req, out := c.GetDeploymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEnvironment = "GetEnvironment" - -// GetEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the GetEnvironment 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 GetEnvironment for more information on using the GetEnvironment -// 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 GetEnvironmentRequest method. -// req, resp := client.GetEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetEnvironment -func (c *M2) GetEnvironmentRequest(input *GetEnvironmentInput) (req *request.Request, output *GetEnvironmentOutput) { - op := &request.Operation{ - Name: opGetEnvironment, - HTTPMethod: "GET", - HTTPPath: "/environments/{environmentId}", - } - - if input == nil { - input = &GetEnvironmentInput{} - } - - output = &GetEnvironmentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEnvironment API operation for AWSMainframeModernization. -// -// Describes a specific runtime environment. -// -// 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 AWSMainframeModernization's -// API operation GetEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetEnvironment -func (c *M2) GetEnvironment(input *GetEnvironmentInput) (*GetEnvironmentOutput, error) { - req, out := c.GetEnvironmentRequest(input) - return out, req.Send() -} - -// GetEnvironmentWithContext is the same as GetEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See GetEnvironment 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 *M2) GetEnvironmentWithContext(ctx aws.Context, input *GetEnvironmentInput, opts ...request.Option) (*GetEnvironmentOutput, error) { - req, out := c.GetEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSignedBluinsightsUrl = "GetSignedBluinsightsUrl" - -// GetSignedBluinsightsUrlRequest generates a "aws/request.Request" representing the -// client's request for the GetSignedBluinsightsUrl 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 GetSignedBluinsightsUrl for more information on using the GetSignedBluinsightsUrl -// 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 GetSignedBluinsightsUrlRequest method. -// req, resp := client.GetSignedBluinsightsUrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetSignedBluinsightsUrl -func (c *M2) GetSignedBluinsightsUrlRequest(input *GetSignedBluinsightsUrlInput) (req *request.Request, output *GetSignedBluinsightsUrlOutput) { - op := &request.Operation{ - Name: opGetSignedBluinsightsUrl, - HTTPMethod: "GET", - HTTPPath: "/signed-bi-url", - } - - if input == nil { - input = &GetSignedBluinsightsUrlInput{} - } - - output = &GetSignedBluinsightsUrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSignedBluinsightsUrl API operation for AWSMainframeModernization. -// -// Gets a single sign-on URL that can be used to connect to AWS Blu Insights. -// -// 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 AWSMainframeModernization's -// API operation GetSignedBluinsightsUrl for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/GetSignedBluinsightsUrl -func (c *M2) GetSignedBluinsightsUrl(input *GetSignedBluinsightsUrlInput) (*GetSignedBluinsightsUrlOutput, error) { - req, out := c.GetSignedBluinsightsUrlRequest(input) - return out, req.Send() -} - -// GetSignedBluinsightsUrlWithContext is the same as GetSignedBluinsightsUrl with the addition of -// the ability to pass a context and additional request options. -// -// See GetSignedBluinsightsUrl 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 *M2) GetSignedBluinsightsUrlWithContext(ctx aws.Context, input *GetSignedBluinsightsUrlInput, opts ...request.Option) (*GetSignedBluinsightsUrlOutput, error) { - req, out := c.GetSignedBluinsightsUrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListApplicationVersions = "ListApplicationVersions" - -// ListApplicationVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListApplicationVersions 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 ListApplicationVersions for more information on using the ListApplicationVersions -// 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 ListApplicationVersionsRequest method. -// req, resp := client.ListApplicationVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListApplicationVersions -func (c *M2) ListApplicationVersionsRequest(input *ListApplicationVersionsInput) (req *request.Request, output *ListApplicationVersionsOutput) { - op := &request.Operation{ - Name: opListApplicationVersions, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/versions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListApplicationVersionsInput{} - } - - output = &ListApplicationVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListApplicationVersions API operation for AWSMainframeModernization. -// -// Returns a list of the application versions for a specific application. -// -// 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 AWSMainframeModernization's -// API operation ListApplicationVersions for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListApplicationVersions -func (c *M2) ListApplicationVersions(input *ListApplicationVersionsInput) (*ListApplicationVersionsOutput, error) { - req, out := c.ListApplicationVersionsRequest(input) - return out, req.Send() -} - -// ListApplicationVersionsWithContext is the same as ListApplicationVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListApplicationVersions 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 *M2) ListApplicationVersionsWithContext(ctx aws.Context, input *ListApplicationVersionsInput, opts ...request.Option) (*ListApplicationVersionsOutput, error) { - req, out := c.ListApplicationVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListApplicationVersionsPages iterates over the pages of a ListApplicationVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApplicationVersions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListApplicationVersions operation. -// pageNum := 0 -// err := client.ListApplicationVersionsPages(params, -// func(page *m2.ListApplicationVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListApplicationVersionsPages(input *ListApplicationVersionsInput, fn func(*ListApplicationVersionsOutput, bool) bool) error { - return c.ListApplicationVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListApplicationVersionsPagesWithContext same as ListApplicationVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListApplicationVersionsPagesWithContext(ctx aws.Context, input *ListApplicationVersionsInput, fn func(*ListApplicationVersionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListApplicationVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListApplicationVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListApplicationVersionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListApplications = "ListApplications" - -// ListApplicationsRequest generates a "aws/request.Request" representing the -// client's request for the ListApplications 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 ListApplications for more information on using the ListApplications -// 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 ListApplicationsRequest method. -// req, resp := client.ListApplicationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListApplications -func (c *M2) ListApplicationsRequest(input *ListApplicationsInput) (req *request.Request, output *ListApplicationsOutput) { - op := &request.Operation{ - Name: opListApplications, - HTTPMethod: "GET", - HTTPPath: "/applications", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListApplicationsInput{} - } - - output = &ListApplicationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListApplications API operation for AWSMainframeModernization. -// -// Lists the applications associated with a specific Amazon Web Services account. -// You can provide the unique identifier of a specific runtime environment in -// a query parameter to see all applications associated with that environment. -// -// 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 AWSMainframeModernization's -// API operation ListApplications for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListApplications -func (c *M2) ListApplications(input *ListApplicationsInput) (*ListApplicationsOutput, error) { - req, out := c.ListApplicationsRequest(input) - return out, req.Send() -} - -// ListApplicationsWithContext is the same as ListApplications with the addition of -// the ability to pass a context and additional request options. -// -// See ListApplications 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 *M2) ListApplicationsWithContext(ctx aws.Context, input *ListApplicationsInput, opts ...request.Option) (*ListApplicationsOutput, error) { - req, out := c.ListApplicationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListApplicationsPages iterates over the pages of a ListApplications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApplications method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListApplications operation. -// pageNum := 0 -// err := client.ListApplicationsPages(params, -// func(page *m2.ListApplicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListApplicationsPages(input *ListApplicationsInput, fn func(*ListApplicationsOutput, bool) bool) error { - return c.ListApplicationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListApplicationsPagesWithContext same as ListApplicationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListApplicationsPagesWithContext(ctx aws.Context, input *ListApplicationsInput, fn func(*ListApplicationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListApplicationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListApplicationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListBatchJobDefinitions = "ListBatchJobDefinitions" - -// ListBatchJobDefinitionsRequest generates a "aws/request.Request" representing the -// client's request for the ListBatchJobDefinitions 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 ListBatchJobDefinitions for more information on using the ListBatchJobDefinitions -// 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 ListBatchJobDefinitionsRequest method. -// req, resp := client.ListBatchJobDefinitionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListBatchJobDefinitions -func (c *M2) ListBatchJobDefinitionsRequest(input *ListBatchJobDefinitionsInput) (req *request.Request, output *ListBatchJobDefinitionsOutput) { - op := &request.Operation{ - Name: opListBatchJobDefinitions, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/batch-job-definitions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListBatchJobDefinitionsInput{} - } - - output = &ListBatchJobDefinitionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBatchJobDefinitions API operation for AWSMainframeModernization. -// -// Lists all the available batch job definitions based on the batch job resources -// uploaded during the application creation. You can use the batch job definitions -// in the list to start a batch job. -// -// 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 AWSMainframeModernization's -// API operation ListBatchJobDefinitions for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListBatchJobDefinitions -func (c *M2) ListBatchJobDefinitions(input *ListBatchJobDefinitionsInput) (*ListBatchJobDefinitionsOutput, error) { - req, out := c.ListBatchJobDefinitionsRequest(input) - return out, req.Send() -} - -// ListBatchJobDefinitionsWithContext is the same as ListBatchJobDefinitions with the addition of -// the ability to pass a context and additional request options. -// -// See ListBatchJobDefinitions 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 *M2) ListBatchJobDefinitionsWithContext(ctx aws.Context, input *ListBatchJobDefinitionsInput, opts ...request.Option) (*ListBatchJobDefinitionsOutput, error) { - req, out := c.ListBatchJobDefinitionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListBatchJobDefinitionsPages iterates over the pages of a ListBatchJobDefinitions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListBatchJobDefinitions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListBatchJobDefinitions operation. -// pageNum := 0 -// err := client.ListBatchJobDefinitionsPages(params, -// func(page *m2.ListBatchJobDefinitionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListBatchJobDefinitionsPages(input *ListBatchJobDefinitionsInput, fn func(*ListBatchJobDefinitionsOutput, bool) bool) error { - return c.ListBatchJobDefinitionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListBatchJobDefinitionsPagesWithContext same as ListBatchJobDefinitionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListBatchJobDefinitionsPagesWithContext(ctx aws.Context, input *ListBatchJobDefinitionsInput, fn func(*ListBatchJobDefinitionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListBatchJobDefinitionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListBatchJobDefinitionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListBatchJobDefinitionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListBatchJobExecutions = "ListBatchJobExecutions" - -// ListBatchJobExecutionsRequest generates a "aws/request.Request" representing the -// client's request for the ListBatchJobExecutions 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 ListBatchJobExecutions for more information on using the ListBatchJobExecutions -// 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 ListBatchJobExecutionsRequest method. -// req, resp := client.ListBatchJobExecutionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListBatchJobExecutions -func (c *M2) ListBatchJobExecutionsRequest(input *ListBatchJobExecutionsInput) (req *request.Request, output *ListBatchJobExecutionsOutput) { - op := &request.Operation{ - Name: opListBatchJobExecutions, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/batch-job-executions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListBatchJobExecutionsInput{} - } - - output = &ListBatchJobExecutionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBatchJobExecutions API operation for AWSMainframeModernization. -// -// Lists historical, current, and scheduled batch job executions for a specific -// application. -// -// 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 AWSMainframeModernization's -// API operation ListBatchJobExecutions for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListBatchJobExecutions -func (c *M2) ListBatchJobExecutions(input *ListBatchJobExecutionsInput) (*ListBatchJobExecutionsOutput, error) { - req, out := c.ListBatchJobExecutionsRequest(input) - return out, req.Send() -} - -// ListBatchJobExecutionsWithContext is the same as ListBatchJobExecutions with the addition of -// the ability to pass a context and additional request options. -// -// See ListBatchJobExecutions 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 *M2) ListBatchJobExecutionsWithContext(ctx aws.Context, input *ListBatchJobExecutionsInput, opts ...request.Option) (*ListBatchJobExecutionsOutput, error) { - req, out := c.ListBatchJobExecutionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListBatchJobExecutionsPages iterates over the pages of a ListBatchJobExecutions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListBatchJobExecutions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListBatchJobExecutions operation. -// pageNum := 0 -// err := client.ListBatchJobExecutionsPages(params, -// func(page *m2.ListBatchJobExecutionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListBatchJobExecutionsPages(input *ListBatchJobExecutionsInput, fn func(*ListBatchJobExecutionsOutput, bool) bool) error { - return c.ListBatchJobExecutionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListBatchJobExecutionsPagesWithContext same as ListBatchJobExecutionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListBatchJobExecutionsPagesWithContext(ctx aws.Context, input *ListBatchJobExecutionsInput, fn func(*ListBatchJobExecutionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListBatchJobExecutionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListBatchJobExecutionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListBatchJobExecutionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataSetImportHistory = "ListDataSetImportHistory" - -// ListDataSetImportHistoryRequest generates a "aws/request.Request" representing the -// client's request for the ListDataSetImportHistory 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 ListDataSetImportHistory for more information on using the ListDataSetImportHistory -// 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 ListDataSetImportHistoryRequest method. -// req, resp := client.ListDataSetImportHistoryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListDataSetImportHistory -func (c *M2) ListDataSetImportHistoryRequest(input *ListDataSetImportHistoryInput) (req *request.Request, output *ListDataSetImportHistoryOutput) { - op := &request.Operation{ - Name: opListDataSetImportHistory, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/dataset-import-tasks", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataSetImportHistoryInput{} - } - - output = &ListDataSetImportHistoryOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataSetImportHistory API operation for AWSMainframeModernization. -// -// Lists the data set imports for the specified application. -// -// 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 AWSMainframeModernization's -// API operation ListDataSetImportHistory for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListDataSetImportHistory -func (c *M2) ListDataSetImportHistory(input *ListDataSetImportHistoryInput) (*ListDataSetImportHistoryOutput, error) { - req, out := c.ListDataSetImportHistoryRequest(input) - return out, req.Send() -} - -// ListDataSetImportHistoryWithContext is the same as ListDataSetImportHistory with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataSetImportHistory 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 *M2) ListDataSetImportHistoryWithContext(ctx aws.Context, input *ListDataSetImportHistoryInput, opts ...request.Option) (*ListDataSetImportHistoryOutput, error) { - req, out := c.ListDataSetImportHistoryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataSetImportHistoryPages iterates over the pages of a ListDataSetImportHistory operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataSetImportHistory method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataSetImportHistory operation. -// pageNum := 0 -// err := client.ListDataSetImportHistoryPages(params, -// func(page *m2.ListDataSetImportHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListDataSetImportHistoryPages(input *ListDataSetImportHistoryInput, fn func(*ListDataSetImportHistoryOutput, bool) bool) error { - return c.ListDataSetImportHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataSetImportHistoryPagesWithContext same as ListDataSetImportHistoryPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListDataSetImportHistoryPagesWithContext(ctx aws.Context, input *ListDataSetImportHistoryInput, fn func(*ListDataSetImportHistoryOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataSetImportHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataSetImportHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataSetImportHistoryOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataSets = "ListDataSets" - -// ListDataSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListDataSets 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 ListDataSets for more information on using the ListDataSets -// 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 ListDataSetsRequest method. -// req, resp := client.ListDataSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListDataSets -func (c *M2) ListDataSetsRequest(input *ListDataSetsInput) (req *request.Request, output *ListDataSetsOutput) { - op := &request.Operation{ - Name: opListDataSets, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/datasets", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataSetsInput{} - } - - output = &ListDataSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataSets API operation for AWSMainframeModernization. -// -// Lists the data sets imported for a specific application. In Amazon Web Services -// Mainframe Modernization, data sets are associated with applications deployed -// on runtime environments. This is known as importing data sets. Currently, -// Amazon Web Services Mainframe Modernization can import data sets into catalogs -// using CreateDataSetImportTask (https://docs.aws.amazon.com/m2/latest/APIReference/API_CreateDataSetImportTask.html). -// -// 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 AWSMainframeModernization's -// API operation ListDataSets for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ExecutionTimeoutException -// Failed to connect to server, or didn’t receive response within expected -// time period. -// -// - ServiceUnavailableException -// Server cannot process the request at the moment. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListDataSets -func (c *M2) ListDataSets(input *ListDataSetsInput) (*ListDataSetsOutput, error) { - req, out := c.ListDataSetsRequest(input) - return out, req.Send() -} - -// ListDataSetsWithContext is the same as ListDataSets with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataSets 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 *M2) ListDataSetsWithContext(ctx aws.Context, input *ListDataSetsInput, opts ...request.Option) (*ListDataSetsOutput, error) { - req, out := c.ListDataSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataSetsPages iterates over the pages of a ListDataSets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataSets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataSets operation. -// pageNum := 0 -// err := client.ListDataSetsPages(params, -// func(page *m2.ListDataSetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListDataSetsPages(input *ListDataSetsInput, fn func(*ListDataSetsOutput, bool) bool) error { - return c.ListDataSetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataSetsPagesWithContext same as ListDataSetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListDataSetsPagesWithContext(ctx aws.Context, input *ListDataSetsInput, fn func(*ListDataSetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataSetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataSetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataSetsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDeployments = "ListDeployments" - -// ListDeploymentsRequest generates a "aws/request.Request" representing the -// client's request for the ListDeployments 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 ListDeployments for more information on using the ListDeployments -// 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 ListDeploymentsRequest method. -// req, resp := client.ListDeploymentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListDeployments -func (c *M2) ListDeploymentsRequest(input *ListDeploymentsInput) (req *request.Request, output *ListDeploymentsOutput) { - op := &request.Operation{ - Name: opListDeployments, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/deployments", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDeploymentsInput{} - } - - output = &ListDeploymentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeployments API operation for AWSMainframeModernization. -// -// Returns a list of all deployments of a specific application. A deployment -// is a combination of a specific application and a specific version of that -// application. Each deployment is mapped to a particular application version. -// -// 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 AWSMainframeModernization's -// API operation ListDeployments for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListDeployments -func (c *M2) ListDeployments(input *ListDeploymentsInput) (*ListDeploymentsOutput, error) { - req, out := c.ListDeploymentsRequest(input) - return out, req.Send() -} - -// ListDeploymentsWithContext is the same as ListDeployments with the addition of -// the ability to pass a context and additional request options. -// -// See ListDeployments 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 *M2) ListDeploymentsWithContext(ctx aws.Context, input *ListDeploymentsInput, opts ...request.Option) (*ListDeploymentsOutput, error) { - req, out := c.ListDeploymentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDeploymentsPages iterates over the pages of a ListDeployments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeployments method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDeployments operation. -// pageNum := 0 -// err := client.ListDeploymentsPages(params, -// func(page *m2.ListDeploymentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListDeploymentsPages(input *ListDeploymentsInput, fn func(*ListDeploymentsOutput, bool) bool) error { - return c.ListDeploymentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDeploymentsPagesWithContext same as ListDeploymentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListDeploymentsPagesWithContext(ctx aws.Context, input *ListDeploymentsInput, fn func(*ListDeploymentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDeploymentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDeploymentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDeploymentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEngineVersions = "ListEngineVersions" - -// ListEngineVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListEngineVersions 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 ListEngineVersions for more information on using the ListEngineVersions -// 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 ListEngineVersionsRequest method. -// req, resp := client.ListEngineVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListEngineVersions -func (c *M2) ListEngineVersionsRequest(input *ListEngineVersionsInput) (req *request.Request, output *ListEngineVersionsOutput) { - op := &request.Operation{ - Name: opListEngineVersions, - HTTPMethod: "GET", - HTTPPath: "/engine-versions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEngineVersionsInput{} - } - - output = &ListEngineVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEngineVersions API operation for AWSMainframeModernization. -// -// Lists the available engine versions. -// -// 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 AWSMainframeModernization's -// API operation ListEngineVersions for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListEngineVersions -func (c *M2) ListEngineVersions(input *ListEngineVersionsInput) (*ListEngineVersionsOutput, error) { - req, out := c.ListEngineVersionsRequest(input) - return out, req.Send() -} - -// ListEngineVersionsWithContext is the same as ListEngineVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListEngineVersions 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 *M2) ListEngineVersionsWithContext(ctx aws.Context, input *ListEngineVersionsInput, opts ...request.Option) (*ListEngineVersionsOutput, error) { - req, out := c.ListEngineVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEngineVersionsPages iterates over the pages of a ListEngineVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEngineVersions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEngineVersions operation. -// pageNum := 0 -// err := client.ListEngineVersionsPages(params, -// func(page *m2.ListEngineVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListEngineVersionsPages(input *ListEngineVersionsInput, fn func(*ListEngineVersionsOutput, bool) bool) error { - return c.ListEngineVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEngineVersionsPagesWithContext same as ListEngineVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListEngineVersionsPagesWithContext(ctx aws.Context, input *ListEngineVersionsInput, fn func(*ListEngineVersionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEngineVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEngineVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEngineVersionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEnvironments = "ListEnvironments" - -// ListEnvironmentsRequest generates a "aws/request.Request" representing the -// client's request for the ListEnvironments 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 ListEnvironments for more information on using the ListEnvironments -// 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 ListEnvironmentsRequest method. -// req, resp := client.ListEnvironmentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListEnvironments -func (c *M2) ListEnvironmentsRequest(input *ListEnvironmentsInput) (req *request.Request, output *ListEnvironmentsOutput) { - op := &request.Operation{ - Name: opListEnvironments, - HTTPMethod: "GET", - HTTPPath: "/environments", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEnvironmentsInput{} - } - - output = &ListEnvironmentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEnvironments API operation for AWSMainframeModernization. -// -// Lists the runtime environments. -// -// 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 AWSMainframeModernization's -// API operation ListEnvironments for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListEnvironments -func (c *M2) ListEnvironments(input *ListEnvironmentsInput) (*ListEnvironmentsOutput, error) { - req, out := c.ListEnvironmentsRequest(input) - return out, req.Send() -} - -// ListEnvironmentsWithContext is the same as ListEnvironments with the addition of -// the ability to pass a context and additional request options. -// -// See ListEnvironments 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 *M2) ListEnvironmentsWithContext(ctx aws.Context, input *ListEnvironmentsInput, opts ...request.Option) (*ListEnvironmentsOutput, error) { - req, out := c.ListEnvironmentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEnvironmentsPages iterates over the pages of a ListEnvironments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnvironments method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEnvironments operation. -// pageNum := 0 -// err := client.ListEnvironmentsPages(params, -// func(page *m2.ListEnvironmentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *M2) ListEnvironmentsPages(input *ListEnvironmentsInput, fn func(*ListEnvironmentsOutput, bool) bool) error { - return c.ListEnvironmentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnvironmentsPagesWithContext same as ListEnvironmentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *M2) ListEnvironmentsPagesWithContext(ctx aws.Context, input *ListEnvironmentsInput, fn func(*ListEnvironmentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEnvironmentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEnvironmentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEnvironmentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListTagsForResource -func (c *M2) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWSMainframeModernization. -// -// Lists the tags for the specified resource. -// -// 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 AWSMainframeModernization's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/ListTagsForResource -func (c *M2) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *M2) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartApplication = "StartApplication" - -// StartApplicationRequest generates a "aws/request.Request" representing the -// client's request for the StartApplication 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 StartApplication for more information on using the StartApplication -// 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 StartApplicationRequest method. -// req, resp := client.StartApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/StartApplication -func (c *M2) StartApplicationRequest(input *StartApplicationInput) (req *request.Request, output *StartApplicationOutput) { - op := &request.Operation{ - Name: opStartApplication, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/start", - } - - if input == nil { - input = &StartApplicationInput{} - } - - output = &StartApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartApplication API operation for AWSMainframeModernization. -// -// Starts an application that is currently stopped. -// -// 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 AWSMainframeModernization's -// API operation StartApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/StartApplication -func (c *M2) StartApplication(input *StartApplicationInput) (*StartApplicationOutput, error) { - req, out := c.StartApplicationRequest(input) - return out, req.Send() -} - -// StartApplicationWithContext is the same as StartApplication with the addition of -// the ability to pass a context and additional request options. -// -// See StartApplication 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 *M2) StartApplicationWithContext(ctx aws.Context, input *StartApplicationInput, opts ...request.Option) (*StartApplicationOutput, error) { - req, out := c.StartApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartBatchJob = "StartBatchJob" - -// StartBatchJobRequest generates a "aws/request.Request" representing the -// client's request for the StartBatchJob 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 StartBatchJob for more information on using the StartBatchJob -// 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 StartBatchJobRequest method. -// req, resp := client.StartBatchJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/StartBatchJob -func (c *M2) StartBatchJobRequest(input *StartBatchJobInput) (req *request.Request, output *StartBatchJobOutput) { - op := &request.Operation{ - Name: opStartBatchJob, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/batch-job", - } - - if input == nil { - input = &StartBatchJobInput{} - } - - output = &StartBatchJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartBatchJob API operation for AWSMainframeModernization. -// -// Starts a batch job and returns the unique identifier of this execution of -// the batch job. The associated application must be running in order to start -// the batch job. -// -// 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 AWSMainframeModernization's -// API operation StartBatchJob for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/StartBatchJob -func (c *M2) StartBatchJob(input *StartBatchJobInput) (*StartBatchJobOutput, error) { - req, out := c.StartBatchJobRequest(input) - return out, req.Send() -} - -// StartBatchJobWithContext is the same as StartBatchJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartBatchJob 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 *M2) StartBatchJobWithContext(ctx aws.Context, input *StartBatchJobInput, opts ...request.Option) (*StartBatchJobOutput, error) { - req, out := c.StartBatchJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopApplication = "StopApplication" - -// StopApplicationRequest generates a "aws/request.Request" representing the -// client's request for the StopApplication 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 StopApplication for more information on using the StopApplication -// 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 StopApplicationRequest method. -// req, resp := client.StopApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/StopApplication -func (c *M2) StopApplicationRequest(input *StopApplicationInput) (req *request.Request, output *StopApplicationOutput) { - op := &request.Operation{ - Name: opStopApplication, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/stop", - } - - if input == nil { - input = &StopApplicationInput{} - } - - output = &StopApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopApplication API operation for AWSMainframeModernization. -// -// Stops a running application. -// -// 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 AWSMainframeModernization's -// API operation StopApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/StopApplication -func (c *M2) StopApplication(input *StopApplicationInput) (*StopApplicationOutput, error) { - req, out := c.StopApplicationRequest(input) - return out, req.Send() -} - -// StopApplicationWithContext is the same as StopApplication with the addition of -// the ability to pass a context and additional request options. -// -// See StopApplication 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 *M2) StopApplicationWithContext(ctx aws.Context, input *StopApplicationInput, opts ...request.Option) (*StopApplicationOutput, error) { - req, out := c.StopApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/TagResource -func (c *M2) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWSMainframeModernization. -// -// Adds one or more tags to the specified resource. -// -// 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 AWSMainframeModernization's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ServiceQuotaExceededException -// One or more quotas for Amazon Web Services Mainframe Modernization exceeds -// the limit. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/TagResource -func (c *M2) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *M2) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/UntagResource -func (c *M2) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWSMainframeModernization. -// -// Removes one or more tags from the specified resource. -// -// 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 AWSMainframeModernization's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/UntagResource -func (c *M2) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *M2) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateApplication = "UpdateApplication" - -// UpdateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplication 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 UpdateApplication for more information on using the UpdateApplication -// 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 UpdateApplicationRequest method. -// req, resp := client.UpdateApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/UpdateApplication -func (c *M2) UpdateApplicationRequest(input *UpdateApplicationInput) (req *request.Request, output *UpdateApplicationOutput) { - op := &request.Operation{ - Name: opUpdateApplication, - HTTPMethod: "PATCH", - HTTPPath: "/applications/{applicationId}", - } - - if input == nil { - input = &UpdateApplicationInput{} - } - - output = &UpdateApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateApplication API operation for AWSMainframeModernization. -// -// Updates an application and creates a new version. -// -// 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 AWSMainframeModernization's -// API operation UpdateApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/UpdateApplication -func (c *M2) UpdateApplication(input *UpdateApplicationInput) (*UpdateApplicationOutput, error) { - req, out := c.UpdateApplicationRequest(input) - return out, req.Send() -} - -// UpdateApplicationWithContext is the same as UpdateApplication with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateApplication 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 *M2) UpdateApplicationWithContext(ctx aws.Context, input *UpdateApplicationInput, opts ...request.Option) (*UpdateApplicationOutput, error) { - req, out := c.UpdateApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateEnvironment = "UpdateEnvironment" - -// UpdateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEnvironment 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 UpdateEnvironment for more information on using the UpdateEnvironment -// 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 UpdateEnvironmentRequest method. -// req, resp := client.UpdateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/UpdateEnvironment -func (c *M2) UpdateEnvironmentRequest(input *UpdateEnvironmentInput) (req *request.Request, output *UpdateEnvironmentOutput) { - op := &request.Operation{ - Name: opUpdateEnvironment, - HTTPMethod: "PATCH", - HTTPPath: "/environments/{environmentId}", - } - - if input == nil { - input = &UpdateEnvironmentInput{} - } - - output = &UpdateEnvironmentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateEnvironment API operation for AWSMainframeModernization. -// -// Updates the configuration details for a specific runtime environment. -// -// 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 AWSMainframeModernization's -// API operation UpdateEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource was not found. -// -// - ServiceQuotaExceededException -// One or more quotas for Amazon Web Services Mainframe Modernization exceeds -// the limit. -// -// - ThrottlingException -// The number of requests made exceeds the limit. -// -// - AccessDeniedException -// The account or role doesn't have the right permissions to make the request. -// -// - ConflictException -// The parameters provided in the request conflict with existing resources. -// -// - ValidationException -// One or more parameters provided in the request is not valid. -// -// - InternalServerException -// An unexpected error occurred during the processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28/UpdateEnvironment -func (c *M2) UpdateEnvironment(input *UpdateEnvironmentInput) (*UpdateEnvironmentOutput, error) { - req, out := c.UpdateEnvironmentRequest(input) - return out, req.Send() -} - -// UpdateEnvironmentWithContext is the same as UpdateEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateEnvironment 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 *M2) UpdateEnvironmentWithContext(ctx aws.Context, input *UpdateEnvironmentInput, opts ...request.Option) (*UpdateEnvironmentOutput, error) { - req, out := c.UpdateEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// The account or role doesn't have the right permissions to make the request. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Defines an alternate key. This value is optional. A legacy data set might -// not have any alternate key defined but if those alternate keys definitions -// exist, provide them, as some applications will make use of them. -type AlternateKey struct { - _ struct{} `type:"structure"` - - // Indicates whether the alternate key values are supposed to be unique for - // the given data set. - AllowDuplicates *bool `locationName:"allowDuplicates" type:"boolean"` - - // A strictly positive integer value representing the length of the alternate - // key. - // - // Length is a required field - Length *int64 `locationName:"length" type:"integer" required:"true"` - - // The name of the alternate key. - Name *string `locationName:"name" type:"string"` - - // A positive integer value representing the offset to mark the start of the - // alternate key part in the record byte array. - // - // Offset is a required field - Offset *int64 `locationName:"offset" type:"integer" 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 AlternateKey) 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 AlternateKey) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AlternateKey) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AlternateKey"} - if s.Length == nil { - invalidParams.Add(request.NewErrParamRequired("Length")) - } - if s.Offset == nil { - invalidParams.Add(request.NewErrParamRequired("Offset")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowDuplicates sets the AllowDuplicates field's value. -func (s *AlternateKey) SetAllowDuplicates(v bool) *AlternateKey { - s.AllowDuplicates = &v - return s -} - -// SetLength sets the Length field's value. -func (s *AlternateKey) SetLength(v int64) *AlternateKey { - s.Length = &v - return s -} - -// SetName sets the Name field's value. -func (s *AlternateKey) SetName(v string) *AlternateKey { - s.Name = &v - return s -} - -// SetOffset sets the Offset field's value. -func (s *AlternateKey) SetOffset(v int64) *AlternateKey { - s.Offset = &v - return s -} - -// A subset of the possible application attributes. Used in the application -// list. -type ApplicationSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the application. - // - // ApplicationArn is a required field - ApplicationArn *string `locationName:"applicationArn" type:"string" required:"true"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `locationName:"applicationId" type:"string" required:"true"` - - // The version of the application. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" required:"true"` - - // The timestamp when the application was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // Indicates either an ongoing deployment or if the application has ever deployed - // successfully. - DeploymentStatus *string `locationName:"deploymentStatus" type:"string" enum:"ApplicationDeploymentLifecycle"` - - // The description of the application. - Description *string `locationName:"description" type:"string"` - - // The type of the target platform for this application. - // - // EngineType is a required field - EngineType *string `locationName:"engineType" type:"string" required:"true" enum:"EngineType"` - - // The unique identifier of the runtime environment that hosts this application. - EnvironmentId *string `locationName:"environmentId" type:"string"` - - // The timestamp when you last started the application. Null until the application - // runs for the first time. - LastStartTime *time.Time `locationName:"lastStartTime" type:"timestamp"` - - // The name of the application. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the role associated with the application. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The status of the application. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ApplicationLifecycle"` - - // Indicates the status of the latest version of the application. - VersionStatus *string `locationName:"versionStatus" type:"string" enum:"ApplicationVersionLifecycle"` -} - -// 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 ApplicationSummary) 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 ApplicationSummary) GoString() string { - return s.String() -} - -// SetApplicationArn sets the ApplicationArn field's value. -func (s *ApplicationSummary) SetApplicationArn(v string) *ApplicationSummary { - s.ApplicationArn = &v - return s -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ApplicationSummary) SetApplicationId(v string) *ApplicationSummary { - s.ApplicationId = &v - return s -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *ApplicationSummary) SetApplicationVersion(v int64) *ApplicationSummary { - s.ApplicationVersion = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ApplicationSummary) SetCreationTime(v time.Time) *ApplicationSummary { - s.CreationTime = &v - return s -} - -// SetDeploymentStatus sets the DeploymentStatus field's value. -func (s *ApplicationSummary) SetDeploymentStatus(v string) *ApplicationSummary { - s.DeploymentStatus = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ApplicationSummary) SetDescription(v string) *ApplicationSummary { - s.Description = &v - return s -} - -// SetEngineType sets the EngineType field's value. -func (s *ApplicationSummary) SetEngineType(v string) *ApplicationSummary { - s.EngineType = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *ApplicationSummary) SetEnvironmentId(v string) *ApplicationSummary { - s.EnvironmentId = &v - return s -} - -// SetLastStartTime sets the LastStartTime field's value. -func (s *ApplicationSummary) SetLastStartTime(v time.Time) *ApplicationSummary { - s.LastStartTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *ApplicationSummary) SetName(v string) *ApplicationSummary { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *ApplicationSummary) SetRoleArn(v string) *ApplicationSummary { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ApplicationSummary) SetStatus(v string) *ApplicationSummary { - s.Status = &v - return s -} - -// SetVersionStatus sets the VersionStatus field's value. -func (s *ApplicationSummary) SetVersionStatus(v string) *ApplicationSummary { - s.VersionStatus = &v - return s -} - -// Defines an application version summary. -type ApplicationVersionSummary struct { - _ struct{} `type:"structure"` - - // The application version. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" required:"true"` - - // The timestamp when the application version was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The status of the application. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ApplicationVersionLifecycle"` - - // The reason for the reported status. - StatusReason *string `locationName:"statusReason" 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 ApplicationVersionSummary) 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 ApplicationVersionSummary) GoString() string { - return s.String() -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *ApplicationVersionSummary) SetApplicationVersion(v int64) *ApplicationVersionSummary { - s.ApplicationVersion = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ApplicationVersionSummary) SetCreationTime(v time.Time) *ApplicationVersionSummary { - s.CreationTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ApplicationVersionSummary) SetStatus(v string) *ApplicationVersionSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *ApplicationVersionSummary) SetStatusReason(v string) *ApplicationVersionSummary { - s.StatusReason = &v - return s -} - -// Defines the details of a batch job. -type BatchJobDefinition struct { - _ struct{} `type:"structure"` - - // Specifies a file containing a batch job definition. - FileBatchJobDefinition *FileBatchJobDefinition `locationName:"fileBatchJobDefinition" type:"structure"` - - // A script containing a batch job definition. - ScriptBatchJobDefinition *ScriptBatchJobDefinition `locationName:"scriptBatchJobDefinition" 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 BatchJobDefinition) 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 BatchJobDefinition) GoString() string { - return s.String() -} - -// SetFileBatchJobDefinition sets the FileBatchJobDefinition field's value. -func (s *BatchJobDefinition) SetFileBatchJobDefinition(v *FileBatchJobDefinition) *BatchJobDefinition { - s.FileBatchJobDefinition = v - return s -} - -// SetScriptBatchJobDefinition sets the ScriptBatchJobDefinition field's value. -func (s *BatchJobDefinition) SetScriptBatchJobDefinition(v *ScriptBatchJobDefinition) *BatchJobDefinition { - s.ScriptBatchJobDefinition = v - return s -} - -// A subset of the possible batch job attributes. Used in the batch job list. -type BatchJobExecutionSummary struct { - _ struct{} `type:"structure"` - - // The unique identifier of the application that hosts this batch job. - // - // ApplicationId is a required field - ApplicationId *string `locationName:"applicationId" type:"string" required:"true"` - - // The unique identifier of this batch job. - BatchJobIdentifier *BatchJobIdentifier `locationName:"batchJobIdentifier" type:"structure"` - - // The timestamp when this batch job execution ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // The unique identifier of this execution of the batch job. - // - // ExecutionId is a required field - ExecutionId *string `locationName:"executionId" type:"string" required:"true"` - - // The unique identifier of a particular batch job. - JobId *string `locationName:"jobId" type:"string"` - - // The name of a particular batch job. - JobName *string `locationName:"jobName" type:"string"` - - // The type of a particular batch job execution. - JobType *string `locationName:"jobType" type:"string" enum:"BatchJobType"` - - // The batch job return code from either the Blu Age or Micro Focus runtime - // engines. For more information, see Batch return codes (https://www.ibm.com/docs/en/was/8.5.5?topic=model-batch-return-codes) - // in the IBM WebSphere Application Server documentation. - ReturnCode *string `locationName:"returnCode" type:"string"` - - // The timestamp when a particular batch job execution started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // The status of a particular batch job execution. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"BatchJobExecutionStatus"` -} - -// 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 BatchJobExecutionSummary) 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 BatchJobExecutionSummary) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *BatchJobExecutionSummary) SetApplicationId(v string) *BatchJobExecutionSummary { - s.ApplicationId = &v - return s -} - -// SetBatchJobIdentifier sets the BatchJobIdentifier field's value. -func (s *BatchJobExecutionSummary) SetBatchJobIdentifier(v *BatchJobIdentifier) *BatchJobExecutionSummary { - s.BatchJobIdentifier = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *BatchJobExecutionSummary) SetEndTime(v time.Time) *BatchJobExecutionSummary { - s.EndTime = &v - return s -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *BatchJobExecutionSummary) SetExecutionId(v string) *BatchJobExecutionSummary { - s.ExecutionId = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *BatchJobExecutionSummary) SetJobId(v string) *BatchJobExecutionSummary { - s.JobId = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *BatchJobExecutionSummary) SetJobName(v string) *BatchJobExecutionSummary { - s.JobName = &v - return s -} - -// SetJobType sets the JobType field's value. -func (s *BatchJobExecutionSummary) SetJobType(v string) *BatchJobExecutionSummary { - s.JobType = &v - return s -} - -// SetReturnCode sets the ReturnCode field's value. -func (s *BatchJobExecutionSummary) SetReturnCode(v string) *BatchJobExecutionSummary { - s.ReturnCode = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *BatchJobExecutionSummary) SetStartTime(v time.Time) *BatchJobExecutionSummary { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *BatchJobExecutionSummary) SetStatus(v string) *BatchJobExecutionSummary { - s.Status = &v - return s -} - -// Identifies a specific batch job. -type BatchJobIdentifier struct { - _ struct{} `type:"structure"` - - // Specifies a file associated with a specific batch job. - FileBatchJobIdentifier *FileBatchJobIdentifier `locationName:"fileBatchJobIdentifier" type:"structure"` - - // Specifies an Amazon S3 location that identifies the batch jobs that you want - // to run. Use this identifier to run ad hoc batch jobs. - S3BatchJobIdentifier *S3BatchJobIdentifier `locationName:"s3BatchJobIdentifier" type:"structure"` - - // A batch job identifier in which the batch job to run is identified by the - // script name. - ScriptBatchJobIdentifier *ScriptBatchJobIdentifier `locationName:"scriptBatchJobIdentifier" 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 BatchJobIdentifier) 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 BatchJobIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchJobIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchJobIdentifier"} - if s.FileBatchJobIdentifier != nil { - if err := s.FileBatchJobIdentifier.Validate(); err != nil { - invalidParams.AddNested("FileBatchJobIdentifier", err.(request.ErrInvalidParams)) - } - } - if s.S3BatchJobIdentifier != nil { - if err := s.S3BatchJobIdentifier.Validate(); err != nil { - invalidParams.AddNested("S3BatchJobIdentifier", err.(request.ErrInvalidParams)) - } - } - if s.ScriptBatchJobIdentifier != nil { - if err := s.ScriptBatchJobIdentifier.Validate(); err != nil { - invalidParams.AddNested("ScriptBatchJobIdentifier", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileBatchJobIdentifier sets the FileBatchJobIdentifier field's value. -func (s *BatchJobIdentifier) SetFileBatchJobIdentifier(v *FileBatchJobIdentifier) *BatchJobIdentifier { - s.FileBatchJobIdentifier = v - return s -} - -// SetS3BatchJobIdentifier sets the S3BatchJobIdentifier field's value. -func (s *BatchJobIdentifier) SetS3BatchJobIdentifier(v *S3BatchJobIdentifier) *BatchJobIdentifier { - s.S3BatchJobIdentifier = v - return s -} - -// SetScriptBatchJobIdentifier sets the ScriptBatchJobIdentifier field's value. -func (s *BatchJobIdentifier) SetScriptBatchJobIdentifier(v *ScriptBatchJobIdentifier) *BatchJobIdentifier { - s.ScriptBatchJobIdentifier = v - return s -} - -type CancelBatchJobExecutionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The unique identifier of the batch job execution. - // - // ExecutionId is a required field - ExecutionId *string `location:"uri" locationName:"executionId" 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 CancelBatchJobExecutionInput) 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 CancelBatchJobExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelBatchJobExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelBatchJobExecutionInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.ExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionId")) - } - if s.ExecutionId != nil && len(*s.ExecutionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CancelBatchJobExecutionInput) SetApplicationId(v string) *CancelBatchJobExecutionInput { - s.ApplicationId = &v - return s -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *CancelBatchJobExecutionInput) SetExecutionId(v string) *CancelBatchJobExecutionInput { - s.ExecutionId = &v - return s -} - -type CancelBatchJobExecutionOutput 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 CancelBatchJobExecutionOutput) 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 CancelBatchJobExecutionOutput) GoString() string { - return s.String() -} - -// The parameters provided in the request conflict with existing resources. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the conflicting resource. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of the conflicting resource. - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateApplicationInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier the service generates to ensure the idempotency - // of the request to create an application. The service generates the clientToken - // when the API call is triggered. The token expires after one hour, so if you - // retry the API within this timeframe with the same clientToken, you will get - // the same response. The service also handles deleting the clientToken after - // it expires. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The application definition for this application. You can specify either inline - // JSON or an S3 bucket location. - // - // Definition is a required field - Definition *Definition `locationName:"definition" type:"structure" required:"true"` - - // The description of the application. - Description *string `locationName:"description" type:"string"` - - // The type of the target platform for this application. - // - // EngineType is a required field - EngineType *string `locationName:"engineType" type:"string" required:"true" enum:"EngineType"` - - // The identifier of a customer managed key. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The unique identifier of the application. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that identifies a role that the application - // uses to access Amazon Web Services resources that are not part of the application - // or are in a different Amazon Web Services account. - RoleArn *string `locationName:"roleArn" type:"string"` - - // A list of tags to apply to the application. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateApplicationInput) 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 CreateApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateApplicationInput"} - if s.Definition == nil { - invalidParams.Add(request.NewErrParamRequired("Definition")) - } - if s.EngineType == nil { - invalidParams.Add(request.NewErrParamRequired("EngineType")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Definition != nil { - if err := s.Definition.Validate(); err != nil { - invalidParams.AddNested("Definition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateApplicationInput) SetClientToken(v string) *CreateApplicationInput { - s.ClientToken = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *CreateApplicationInput) SetDefinition(v *Definition) *CreateApplicationInput { - s.Definition = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateApplicationInput) SetDescription(v string) *CreateApplicationInput { - s.Description = &v - return s -} - -// SetEngineType sets the EngineType field's value. -func (s *CreateApplicationInput) SetEngineType(v string) *CreateApplicationInput { - s.EngineType = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateApplicationInput) SetKmsKeyId(v string) *CreateApplicationInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateApplicationInput) SetName(v string) *CreateApplicationInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateApplicationInput) SetRoleArn(v string) *CreateApplicationInput { - s.RoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateApplicationInput) SetTags(v map[string]*string) *CreateApplicationInput { - s.Tags = v - return s -} - -type CreateApplicationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the application. - // - // ApplicationArn is a required field - ApplicationArn *string `locationName:"applicationArn" type:"string" required:"true"` - - // The unique application identifier. - // - // ApplicationId is a required field - ApplicationId *string `locationName:"applicationId" type:"string" required:"true"` - - // The version number of the application. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" 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 CreateApplicationOutput) 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 CreateApplicationOutput) GoString() string { - return s.String() -} - -// SetApplicationArn sets the ApplicationArn field's value. -func (s *CreateApplicationOutput) SetApplicationArn(v string) *CreateApplicationOutput { - s.ApplicationArn = &v - return s -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateApplicationOutput) SetApplicationId(v string) *CreateApplicationOutput { - s.ApplicationId = &v - return s -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *CreateApplicationOutput) SetApplicationVersion(v int64) *CreateApplicationOutput { - s.ApplicationVersion = &v - return s -} - -type CreateDataSetImportTaskInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the application for which you want to import data - // sets. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request to create a data set import. The service generates the clientToken - // when the API call is triggered. The token expires after one hour, so if you - // retry the API within this timeframe with the same clientToken, you will get - // the same response. The service also handles deleting the clientToken after - // it expires. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The data set import task configuration. - // - // ImportConfig is a required field - ImportConfig *DataSetImportConfig `locationName:"importConfig" type:"structure" 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 CreateDataSetImportTaskInput) 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 CreateDataSetImportTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDataSetImportTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDataSetImportTaskInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.ImportConfig == nil { - invalidParams.Add(request.NewErrParamRequired("ImportConfig")) - } - if s.ImportConfig != nil { - if err := s.ImportConfig.Validate(); err != nil { - invalidParams.AddNested("ImportConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateDataSetImportTaskInput) SetApplicationId(v string) *CreateDataSetImportTaskInput { - s.ApplicationId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDataSetImportTaskInput) SetClientToken(v string) *CreateDataSetImportTaskInput { - s.ClientToken = &v - return s -} - -// SetImportConfig sets the ImportConfig field's value. -func (s *CreateDataSetImportTaskInput) SetImportConfig(v *DataSetImportConfig) *CreateDataSetImportTaskInput { - s.ImportConfig = v - return s -} - -type CreateDataSetImportTaskOutput struct { - _ struct{} `type:"structure"` - - // The task identifier. This operation is asynchronous. Use this identifier - // with the GetDataSetImportTask operation to obtain the status of this task. - // - // TaskId is a required field - TaskId *string `locationName:"taskId" 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 CreateDataSetImportTaskOutput) 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 CreateDataSetImportTaskOutput) GoString() string { - return s.String() -} - -// SetTaskId sets the TaskId field's value. -func (s *CreateDataSetImportTaskOutput) SetTaskId(v string) *CreateDataSetImportTaskOutput { - s.TaskId = &v - return s -} - -type CreateDeploymentInput struct { - _ struct{} `type:"structure"` - - // The application identifier. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The version of the application to deploy. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" required:"true"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request to create a deployment. The service generates the clientToken - // when the API call is triggered. The token expires after one hour, so if you - // retry the API within this timeframe with the same clientToken, you will get - // the same response. The service also handles deleting the clientToken after - // it expires. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The identifier of the runtime environment where you want to deploy this application. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" 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 CreateDeploymentInput) 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 CreateDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDeploymentInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.ApplicationVersion == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationVersion")) - } - if s.ApplicationVersion != nil && *s.ApplicationVersion < 1 { - invalidParams.Add(request.NewErrParamMinValue("ApplicationVersion", 1)) - } - if s.EnvironmentId == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateDeploymentInput) SetApplicationId(v string) *CreateDeploymentInput { - s.ApplicationId = &v - return s -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *CreateDeploymentInput) SetApplicationVersion(v int64) *CreateDeploymentInput { - s.ApplicationVersion = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDeploymentInput) SetClientToken(v string) *CreateDeploymentInput { - s.ClientToken = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *CreateDeploymentInput) SetEnvironmentId(v string) *CreateDeploymentInput { - s.EnvironmentId = &v - return s -} - -type CreateDeploymentOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" 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 CreateDeploymentOutput) 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 CreateDeploymentOutput) GoString() string { - return s.String() -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *CreateDeploymentOutput) SetDeploymentId(v string) *CreateDeploymentOutput { - s.DeploymentId = &v - return s -} - -type CreateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request to create an environment. The service generates the clientToken - // when the API call is triggered. The token expires after one hour, so if you - // retry the API within this timeframe with the same clientToken, you will get - // the same response. The service also handles deleting the clientToken after - // it expires. - ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` - - // The description of the runtime environment. - Description *string `locationName:"description" type:"string"` - - // The engine type for the runtime environment. - // - // EngineType is a required field - EngineType *string `locationName:"engineType" type:"string" required:"true" enum:"EngineType"` - - // The version of the engine type for the runtime environment. - EngineVersion *string `locationName:"engineVersion" type:"string"` - - // The details of a high availability configuration for this runtime environment. - HighAvailabilityConfig *HighAvailabilityConfig `locationName:"highAvailabilityConfig" type:"structure"` - - // The type of instance for the runtime environment. - // - // InstanceType is a required field - InstanceType *string `locationName:"instanceType" type:"string" required:"true"` - - // The identifier of a customer managed key. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The name of the runtime environment. Must be unique within the account. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // Configures the maintenance window that you want for the runtime environment. - // The maintenance window must have the format ddd:hh24:mi-ddd:hh24:mi and must - // be less than 24 hours. The following two examples are valid maintenance windows: - // sun:23:45-mon:00:15 or sat:01:00-sat:03:00. - // - // If you do not provide a value, a random system-generated value will be assigned. - PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" type:"string"` - - // Specifies whether the runtime environment is publicly accessible. - PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"` - - // The list of security groups for the VPC associated with this runtime environment. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // Optional. The storage configurations for this runtime environment. - StorageConfigurations []*StorageConfiguration `locationName:"storageConfigurations" type:"list"` - - // The list of subnets associated with the VPC for this runtime environment. - SubnetIds []*string `locationName:"subnetIds" type:"list"` - - // The tags for the runtime environment. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateEnvironmentInput) 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 CreateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEnvironmentInput"} - if s.EngineType == nil { - invalidParams.Add(request.NewErrParamRequired("EngineType")) - } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.HighAvailabilityConfig != nil { - if err := s.HighAvailabilityConfig.Validate(); err != nil { - invalidParams.AddNested("HighAvailabilityConfig", err.(request.ErrInvalidParams)) - } - } - if s.StorageConfigurations != nil { - for i, v := range s.StorageConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StorageConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateEnvironmentInput) SetClientToken(v string) *CreateEnvironmentInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateEnvironmentInput) SetDescription(v string) *CreateEnvironmentInput { - s.Description = &v - return s -} - -// SetEngineType sets the EngineType field's value. -func (s *CreateEnvironmentInput) SetEngineType(v string) *CreateEnvironmentInput { - s.EngineType = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *CreateEnvironmentInput) SetEngineVersion(v string) *CreateEnvironmentInput { - s.EngineVersion = &v - return s -} - -// SetHighAvailabilityConfig sets the HighAvailabilityConfig field's value. -func (s *CreateEnvironmentInput) SetHighAvailabilityConfig(v *HighAvailabilityConfig) *CreateEnvironmentInput { - s.HighAvailabilityConfig = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *CreateEnvironmentInput) SetInstanceType(v string) *CreateEnvironmentInput { - s.InstanceType = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateEnvironmentInput) SetKmsKeyId(v string) *CreateEnvironmentInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateEnvironmentInput) SetName(v string) *CreateEnvironmentInput { - s.Name = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *CreateEnvironmentInput) SetPreferredMaintenanceWindow(v string) *CreateEnvironmentInput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *CreateEnvironmentInput) SetPubliclyAccessible(v bool) *CreateEnvironmentInput { - s.PubliclyAccessible = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateEnvironmentInput) SetSecurityGroupIds(v []*string) *CreateEnvironmentInput { - s.SecurityGroupIds = v - return s -} - -// SetStorageConfigurations sets the StorageConfigurations field's value. -func (s *CreateEnvironmentInput) SetStorageConfigurations(v []*StorageConfiguration) *CreateEnvironmentInput { - s.StorageConfigurations = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateEnvironmentInput) SetSubnetIds(v []*string) *CreateEnvironmentInput { - s.SubnetIds = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateEnvironmentInput) SetTags(v map[string]*string) *CreateEnvironmentInput { - s.Tags = v - return s -} - -type CreateEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the runtime environment. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" 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 CreateEnvironmentOutput) 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 CreateEnvironmentOutput) GoString() string { - return s.String() -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *CreateEnvironmentOutput) SetEnvironmentId(v string) *CreateEnvironmentOutput { - s.EnvironmentId = &v - return s -} - -// Defines a data set. -type DataSet struct { - _ struct{} `type:"structure"` - - // The logical identifier for a specific data set (in mainframe format). - // - // DatasetName is a required field - DatasetName *string `locationName:"datasetName" type:"string" required:"true"` - - // The type of dataset. The only supported value is VSAM. - // - // DatasetOrg is a required field - DatasetOrg *DatasetOrgAttributes `locationName:"datasetOrg" type:"structure" required:"true"` - - // The length of a record. - // - // RecordLength is a required field - RecordLength *RecordLength `locationName:"recordLength" type:"structure" required:"true"` - - // The relative location of the data set in the database or file system. - RelativePath *string `locationName:"relativePath" type:"string"` - - // The storage type of the data set: database or file system. For Micro Focus, - // database corresponds to datastore and file system corresponds to EFS/FSX. - // For Blu Age, there is no support of file system and database corresponds - // to Blusam. - StorageType *string `locationName:"storageType" 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 DataSet) 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 DataSet) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataSet) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataSet"} - if s.DatasetName == nil { - invalidParams.Add(request.NewErrParamRequired("DatasetName")) - } - if s.DatasetOrg == nil { - invalidParams.Add(request.NewErrParamRequired("DatasetOrg")) - } - if s.RecordLength == nil { - invalidParams.Add(request.NewErrParamRequired("RecordLength")) - } - if s.DatasetOrg != nil { - if err := s.DatasetOrg.Validate(); err != nil { - invalidParams.AddNested("DatasetOrg", err.(request.ErrInvalidParams)) - } - } - if s.RecordLength != nil { - if err := s.RecordLength.Validate(); err != nil { - invalidParams.AddNested("RecordLength", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatasetName sets the DatasetName field's value. -func (s *DataSet) SetDatasetName(v string) *DataSet { - s.DatasetName = &v - return s -} - -// SetDatasetOrg sets the DatasetOrg field's value. -func (s *DataSet) SetDatasetOrg(v *DatasetOrgAttributes) *DataSet { - s.DatasetOrg = v - return s -} - -// SetRecordLength sets the RecordLength field's value. -func (s *DataSet) SetRecordLength(v *RecordLength) *DataSet { - s.RecordLength = v - return s -} - -// SetRelativePath sets the RelativePath field's value. -func (s *DataSet) SetRelativePath(v string) *DataSet { - s.RelativePath = &v - return s -} - -// SetStorageType sets the StorageType field's value. -func (s *DataSet) SetStorageType(v string) *DataSet { - s.StorageType = &v - return s -} - -// Identifies one or more data sets you want to import with the CreateDataSetImportTask -// operation. -type DataSetImportConfig struct { - _ struct{} `type:"structure"` - - // The data sets. - DataSets []*DataSetImportItem `locationName:"dataSets" min:"1" type:"list"` - - // The Amazon S3 location of the data sets. - S3Location *string `locationName:"s3Location" 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 DataSetImportConfig) 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 DataSetImportConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataSetImportConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataSetImportConfig"} - if s.DataSets != nil && len(s.DataSets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSets", 1)) - } - if s.DataSets != nil { - for i, v := range s.DataSets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DataSets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSets sets the DataSets field's value. -func (s *DataSetImportConfig) SetDataSets(v []*DataSetImportItem) *DataSetImportConfig { - s.DataSets = v - return s -} - -// SetS3Location sets the S3Location field's value. -func (s *DataSetImportConfig) SetS3Location(v string) *DataSetImportConfig { - s.S3Location = &v - return s -} - -// Identifies a specific data set to import from an external location. -type DataSetImportItem struct { - _ struct{} `type:"structure"` - - // The data set. - // - // DataSet is a required field - DataSet *DataSet `locationName:"dataSet" type:"structure" required:"true"` - - // The location of the data set. - // - // ExternalLocation is a required field - ExternalLocation *ExternalLocation `locationName:"externalLocation" type:"structure" 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 DataSetImportItem) 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 DataSetImportItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataSetImportItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataSetImportItem"} - if s.DataSet == nil { - invalidParams.Add(request.NewErrParamRequired("DataSet")) - } - if s.ExternalLocation == nil { - invalidParams.Add(request.NewErrParamRequired("ExternalLocation")) - } - if s.DataSet != nil { - if err := s.DataSet.Validate(); err != nil { - invalidParams.AddNested("DataSet", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSet sets the DataSet field's value. -func (s *DataSetImportItem) SetDataSet(v *DataSet) *DataSetImportItem { - s.DataSet = v - return s -} - -// SetExternalLocation sets the ExternalLocation field's value. -func (s *DataSetImportItem) SetExternalLocation(v *ExternalLocation) *DataSetImportItem { - s.ExternalLocation = v - return s -} - -// Represents a summary of data set imports. -type DataSetImportSummary struct { - _ struct{} `type:"structure"` - - // The number of data set imports that have failed. - // - // Failed is a required field - Failed *int64 `locationName:"failed" type:"integer" required:"true"` - - // The number of data set imports that are in progress. - // - // InProgress is a required field - InProgress *int64 `locationName:"inProgress" type:"integer" required:"true"` - - // The number of data set imports that are pending. - // - // Pending is a required field - Pending *int64 `locationName:"pending" type:"integer" required:"true"` - - // The number of data set imports that have succeeded. - // - // Succeeded is a required field - Succeeded *int64 `locationName:"succeeded" type:"integer" required:"true"` - - // The total number of data set imports. - // - // Total is a required field - Total *int64 `locationName:"total" type:"integer" 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 DataSetImportSummary) 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 DataSetImportSummary) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *DataSetImportSummary) SetFailed(v int64) *DataSetImportSummary { - s.Failed = &v - return s -} - -// SetInProgress sets the InProgress field's value. -func (s *DataSetImportSummary) SetInProgress(v int64) *DataSetImportSummary { - s.InProgress = &v - return s -} - -// SetPending sets the Pending field's value. -func (s *DataSetImportSummary) SetPending(v int64) *DataSetImportSummary { - s.Pending = &v - return s -} - -// SetSucceeded sets the Succeeded field's value. -func (s *DataSetImportSummary) SetSucceeded(v int64) *DataSetImportSummary { - s.Succeeded = &v - return s -} - -// SetTotal sets the Total field's value. -func (s *DataSetImportSummary) SetTotal(v int64) *DataSetImportSummary { - s.Total = &v - return s -} - -// Contains information about a data set import task. -type DataSetImportTask struct { - _ struct{} `type:"structure"` - - // The status of the data set import task. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSetTaskLifecycle"` - - // If dataset import failed, the failure reason will show here. - StatusReason *string `locationName:"statusReason" type:"string"` - - // A summary of the data set import task. - // - // Summary is a required field - Summary *DataSetImportSummary `locationName:"summary" type:"structure" required:"true"` - - // The identifier of the data set import task. - // - // TaskId is a required field - TaskId *string `locationName:"taskId" 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 DataSetImportTask) 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 DataSetImportTask) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *DataSetImportTask) SetStatus(v string) *DataSetImportTask { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *DataSetImportTask) SetStatusReason(v string) *DataSetImportTask { - s.StatusReason = &v - return s -} - -// SetSummary sets the Summary field's value. -func (s *DataSetImportTask) SetSummary(v *DataSetImportSummary) *DataSetImportTask { - s.Summary = v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *DataSetImportTask) SetTaskId(v string) *DataSetImportTask { - s.TaskId = &v - return s -} - -// A subset of the possible data set attributes. -type DataSetSummary struct { - _ struct{} `type:"structure"` - - // The timestamp when the data set was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The name of the data set. - // - // DataSetName is a required field - DataSetName *string `locationName:"dataSetName" type:"string" required:"true"` - - // The type of data set. The only supported value is VSAM. - DataSetOrg *string `locationName:"dataSetOrg" type:"string"` - - // The format of the data set. - Format *string `locationName:"format" type:"string"` - - // The last time the data set was referenced. - LastReferencedTime *time.Time `locationName:"lastReferencedTime" type:"timestamp"` - - // The last time the data set was updated. - LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` -} - -// 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 DataSetSummary) 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 DataSetSummary) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DataSetSummary) SetCreationTime(v time.Time) *DataSetSummary { - s.CreationTime = &v - return s -} - -// SetDataSetName sets the DataSetName field's value. -func (s *DataSetSummary) SetDataSetName(v string) *DataSetSummary { - s.DataSetName = &v - return s -} - -// SetDataSetOrg sets the DataSetOrg field's value. -func (s *DataSetSummary) SetDataSetOrg(v string) *DataSetSummary { - s.DataSetOrg = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *DataSetSummary) SetFormat(v string) *DataSetSummary { - s.Format = &v - return s -} - -// SetLastReferencedTime sets the LastReferencedTime field's value. -func (s *DataSetSummary) SetLastReferencedTime(v time.Time) *DataSetSummary { - s.LastReferencedTime = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *DataSetSummary) SetLastUpdatedTime(v time.Time) *DataSetSummary { - s.LastUpdatedTime = &v - return s -} - -// Additional details about the data set. Different attributes correspond to -// different data set organizations. The values are populated based on datasetOrg, -// storageType and backend (Blu Age or Micro Focus). -type DatasetDetailOrgAttributes struct { - _ struct{} `type:"structure"` - - // The generation data group of the data set. - Gdg *GdgDetailAttributes `locationName:"gdg" type:"structure"` - - // The details of a PO type data set. - Po *PoDetailAttributes `locationName:"po" type:"structure"` - - // The details of a PS type data set. - Ps *PsDetailAttributes `locationName:"ps" type:"structure"` - - // The details of a VSAM data set. - Vsam *VsamDetailAttributes `locationName:"vsam" 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 DatasetDetailOrgAttributes) 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 DatasetDetailOrgAttributes) GoString() string { - return s.String() -} - -// SetGdg sets the Gdg field's value. -func (s *DatasetDetailOrgAttributes) SetGdg(v *GdgDetailAttributes) *DatasetDetailOrgAttributes { - s.Gdg = v - return s -} - -// SetPo sets the Po field's value. -func (s *DatasetDetailOrgAttributes) SetPo(v *PoDetailAttributes) *DatasetDetailOrgAttributes { - s.Po = v - return s -} - -// SetPs sets the Ps field's value. -func (s *DatasetDetailOrgAttributes) SetPs(v *PsDetailAttributes) *DatasetDetailOrgAttributes { - s.Ps = v - return s -} - -// SetVsam sets the Vsam field's value. -func (s *DatasetDetailOrgAttributes) SetVsam(v *VsamDetailAttributes) *DatasetDetailOrgAttributes { - s.Vsam = v - return s -} - -// Additional details about the data set. Different attributes correspond to -// different data set organizations. The values are populated based on datasetOrg, -// storageType and backend (Blu Age or Micro Focus). -type DatasetOrgAttributes struct { - _ struct{} `type:"structure"` - - // The generation data group of the data set. - Gdg *GdgAttributes `locationName:"gdg" type:"structure"` - - // The details of a PO type data set. - Po *PoAttributes `locationName:"po" type:"structure"` - - // The details of a PS type data set. - Ps *PsAttributes `locationName:"ps" type:"structure"` - - // The details of a VSAM data set. - Vsam *VsamAttributes `locationName:"vsam" 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 DatasetOrgAttributes) 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 DatasetOrgAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DatasetOrgAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DatasetOrgAttributes"} - if s.Po != nil { - if err := s.Po.Validate(); err != nil { - invalidParams.AddNested("Po", err.(request.ErrInvalidParams)) - } - } - if s.Ps != nil { - if err := s.Ps.Validate(); err != nil { - invalidParams.AddNested("Ps", err.(request.ErrInvalidParams)) - } - } - if s.Vsam != nil { - if err := s.Vsam.Validate(); err != nil { - invalidParams.AddNested("Vsam", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGdg sets the Gdg field's value. -func (s *DatasetOrgAttributes) SetGdg(v *GdgAttributes) *DatasetOrgAttributes { - s.Gdg = v - return s -} - -// SetPo sets the Po field's value. -func (s *DatasetOrgAttributes) SetPo(v *PoAttributes) *DatasetOrgAttributes { - s.Po = v - return s -} - -// SetPs sets the Ps field's value. -func (s *DatasetOrgAttributes) SetPs(v *PsAttributes) *DatasetOrgAttributes { - s.Ps = v - return s -} - -// SetVsam sets the Vsam field's value. -func (s *DatasetOrgAttributes) SetVsam(v *VsamAttributes) *DatasetOrgAttributes { - s.Vsam = v - return s -} - -// The application definition for a particular application. -type Definition struct { - _ struct{} `type:"structure"` - - // The content of the application definition. This is a JSON object that contains - // the resource configuration/definitions that identify an application. - Content *string `locationName:"content" min:"1" type:"string"` - - // The S3 bucket that contains the application definition. - S3Location *string `locationName:"s3Location" 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 Definition) 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 Definition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Definition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Definition"} - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *Definition) SetContent(v string) *Definition { - s.Content = &v - return s -} - -// SetS3Location sets the S3Location field's value. -func (s *Definition) SetS3Location(v string) *Definition { - s.S3Location = &v - return s -} - -type DeleteApplicationFromEnvironmentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application you want to delete. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The unique identifier of the runtime environment where the application was - // previously deployed. - // - // EnvironmentId is a required field - EnvironmentId *string `location:"uri" locationName:"environmentId" 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 DeleteApplicationFromEnvironmentInput) 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 DeleteApplicationFromEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApplicationFromEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApplicationFromEnvironmentInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.EnvironmentId == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentId")) - } - if s.EnvironmentId != nil && len(*s.EnvironmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteApplicationFromEnvironmentInput) SetApplicationId(v string) *DeleteApplicationFromEnvironmentInput { - s.ApplicationId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DeleteApplicationFromEnvironmentInput) SetEnvironmentId(v string) *DeleteApplicationFromEnvironmentInput { - s.EnvironmentId = &v - return s -} - -type DeleteApplicationFromEnvironmentOutput 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 DeleteApplicationFromEnvironmentOutput) 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 DeleteApplicationFromEnvironmentOutput) GoString() string { - return s.String() -} - -type DeleteApplicationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application you want to delete. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" 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 DeleteApplicationInput) 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 DeleteApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteApplicationInput) SetApplicationId(v string) *DeleteApplicationInput { - s.ApplicationId = &v - return s -} - -type DeleteApplicationOutput 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 DeleteApplicationOutput) 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 DeleteApplicationOutput) GoString() string { - return s.String() -} - -type DeleteEnvironmentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the runtime environment you want to delete. - // - // EnvironmentId is a required field - EnvironmentId *string `location:"uri" locationName:"environmentId" 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 DeleteEnvironmentInput) 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 DeleteEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEnvironmentInput"} - if s.EnvironmentId == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentId")) - } - if s.EnvironmentId != nil && len(*s.EnvironmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DeleteEnvironmentInput) SetEnvironmentId(v string) *DeleteEnvironmentInput { - s.EnvironmentId = &v - return s -} - -type DeleteEnvironmentOutput 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 DeleteEnvironmentOutput) 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 DeleteEnvironmentOutput) GoString() string { - return s.String() -} - -// Contains a summary of a deployed application. -type DeployedVersionSummary struct { - _ struct{} `type:"structure"` - - // The version of the deployed application. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" required:"true"` - - // The status of the deployment. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DeploymentLifecycle"` - - // The reason for the reported status. - StatusReason *string `locationName:"statusReason" 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 DeployedVersionSummary) 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 DeployedVersionSummary) GoString() string { - return s.String() -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *DeployedVersionSummary) SetApplicationVersion(v int64) *DeployedVersionSummary { - s.ApplicationVersion = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeployedVersionSummary) SetStatus(v string) *DeployedVersionSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *DeployedVersionSummary) SetStatusReason(v string) *DeployedVersionSummary { - s.StatusReason = &v - return s -} - -// A subset of information about a specific deployment. -type DeploymentSummary struct { - _ struct{} `type:"structure"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `locationName:"applicationId" type:"string" required:"true"` - - // The version of the application. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" required:"true"` - - // The timestamp when the deployment was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The unique identifier of the deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` - - // The unique identifier of the runtime environment. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // The current status of the deployment. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DeploymentLifecycle"` - - // The reason for the reported status. - StatusReason *string `locationName:"statusReason" 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 DeploymentSummary) 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 DeploymentSummary) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeploymentSummary) SetApplicationId(v string) *DeploymentSummary { - s.ApplicationId = &v - return s -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *DeploymentSummary) SetApplicationVersion(v int64) *DeploymentSummary { - s.ApplicationVersion = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DeploymentSummary) SetCreationTime(v time.Time) *DeploymentSummary { - s.CreationTime = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *DeploymentSummary) SetDeploymentId(v string) *DeploymentSummary { - s.DeploymentId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DeploymentSummary) SetEnvironmentId(v string) *DeploymentSummary { - s.EnvironmentId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeploymentSummary) SetStatus(v string) *DeploymentSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *DeploymentSummary) SetStatusReason(v string) *DeploymentSummary { - s.StatusReason = &v - return s -} - -// Defines the storage configuration for an Amazon EFS file system. -type EfsStorageConfiguration struct { - _ struct{} `type:"structure"` - - // The file system identifier. - // - // FileSystemId is a required field - FileSystemId *string `locationName:"file-system-id" type:"string" required:"true"` - - // The mount point for the file system. - // - // MountPoint is a required field - MountPoint *string `locationName:"mount-point" 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 EfsStorageConfiguration) 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 EfsStorageConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EfsStorageConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EfsStorageConfiguration"} - if s.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - if s.MountPoint == nil { - invalidParams.Add(request.NewErrParamRequired("MountPoint")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *EfsStorageConfiguration) SetFileSystemId(v string) *EfsStorageConfiguration { - s.FileSystemId = &v - return s -} - -// SetMountPoint sets the MountPoint field's value. -func (s *EfsStorageConfiguration) SetMountPoint(v string) *EfsStorageConfiguration { - s.MountPoint = &v - return s -} - -// A subset of information about the engine version for a specific application. -type EngineVersionsSummary struct { - _ struct{} `type:"structure"` - - // The type of target platform for the application. - // - // EngineType is a required field - EngineType *string `locationName:"engineType" type:"string" required:"true"` - - // The version of the engine type used by the application. - // - // EngineVersion is a required field - EngineVersion *string `locationName:"engineVersion" 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 EngineVersionsSummary) 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 EngineVersionsSummary) GoString() string { - return s.String() -} - -// SetEngineType sets the EngineType field's value. -func (s *EngineVersionsSummary) SetEngineType(v string) *EngineVersionsSummary { - s.EngineType = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *EngineVersionsSummary) SetEngineVersion(v string) *EngineVersionsSummary { - s.EngineVersion = &v - return s -} - -// Contains a subset of the possible runtime environment attributes. Used in -// the environment list. -type EnvironmentSummary struct { - _ struct{} `type:"structure"` - - // The timestamp when the runtime environment was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The target platform for the runtime environment. - // - // EngineType is a required field - EngineType *string `locationName:"engineType" type:"string" required:"true" enum:"EngineType"` - - // The version of the runtime engine. - // - // EngineVersion is a required field - EngineVersion *string `locationName:"engineVersion" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of a particular runtime environment. - // - // EnvironmentArn is a required field - EnvironmentArn *string `locationName:"environmentArn" type:"string" required:"true"` - - // The unique identifier of a particular runtime environment. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // The instance type of the runtime environment. - // - // InstanceType is a required field - InstanceType *string `locationName:"instanceType" type:"string" required:"true"` - - // The name of the runtime environment. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The status of the runtime environment - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"EnvironmentLifecycle"` -} - -// 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 EnvironmentSummary) 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 EnvironmentSummary) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *EnvironmentSummary) SetCreationTime(v time.Time) *EnvironmentSummary { - s.CreationTime = &v - return s -} - -// SetEngineType sets the EngineType field's value. -func (s *EnvironmentSummary) SetEngineType(v string) *EnvironmentSummary { - s.EngineType = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *EnvironmentSummary) SetEngineVersion(v string) *EnvironmentSummary { - s.EngineVersion = &v - return s -} - -// SetEnvironmentArn sets the EnvironmentArn field's value. -func (s *EnvironmentSummary) SetEnvironmentArn(v string) *EnvironmentSummary { - s.EnvironmentArn = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *EnvironmentSummary) SetEnvironmentId(v string) *EnvironmentSummary { - s.EnvironmentId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *EnvironmentSummary) SetInstanceType(v string) *EnvironmentSummary { - s.InstanceType = &v - return s -} - -// SetName sets the Name field's value. -func (s *EnvironmentSummary) SetName(v string) *EnvironmentSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EnvironmentSummary) SetStatus(v string) *EnvironmentSummary { - s.Status = &v - return s -} - -// Failed to connect to server, or didn’t receive response within expected -// time period. -type ExecutionTimeoutException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ExecutionTimeoutException) 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 ExecutionTimeoutException) GoString() string { - return s.String() -} - -func newErrorExecutionTimeoutException(v protocol.ResponseMetadata) error { - return &ExecutionTimeoutException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ExecutionTimeoutException) Code() string { - return "ExecutionTimeoutException" -} - -// Message returns the exception's message. -func (s *ExecutionTimeoutException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ExecutionTimeoutException) OrigErr() error { - return nil -} - -func (s *ExecutionTimeoutException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ExecutionTimeoutException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ExecutionTimeoutException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Defines an external storage location. -type ExternalLocation struct { - _ struct{} `type:"structure"` - - // The URI of the Amazon S3 bucket. - S3Location *string `locationName:"s3Location" 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 ExternalLocation) 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 ExternalLocation) GoString() string { - return s.String() -} - -// SetS3Location sets the S3Location field's value. -func (s *ExternalLocation) SetS3Location(v string) *ExternalLocation { - s.S3Location = &v - return s -} - -// A file containing a batch job definition. -type FileBatchJobDefinition struct { - _ struct{} `type:"structure"` - - // The name of the file containing the batch job definition. - // - // FileName is a required field - FileName *string `locationName:"fileName" type:"string" required:"true"` - - // The path to the file containing the batch job definition. - FolderPath *string `locationName:"folderPath" 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 FileBatchJobDefinition) 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 FileBatchJobDefinition) GoString() string { - return s.String() -} - -// SetFileName sets the FileName field's value. -func (s *FileBatchJobDefinition) SetFileName(v string) *FileBatchJobDefinition { - s.FileName = &v - return s -} - -// SetFolderPath sets the FolderPath field's value. -func (s *FileBatchJobDefinition) SetFolderPath(v string) *FileBatchJobDefinition { - s.FolderPath = &v - return s -} - -// A batch job identifier in which the batch job to run is identified by the -// file name and the relative path to the file name. -type FileBatchJobIdentifier struct { - _ struct{} `type:"structure"` - - // The file name for the batch job identifier. - // - // FileName is a required field - FileName *string `locationName:"fileName" type:"string" required:"true"` - - // The relative path to the file name for the batch job identifier. - FolderPath *string `locationName:"folderPath" 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 FileBatchJobIdentifier) 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 FileBatchJobIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FileBatchJobIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FileBatchJobIdentifier"} - if s.FileName == nil { - invalidParams.Add(request.NewErrParamRequired("FileName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileName sets the FileName field's value. -func (s *FileBatchJobIdentifier) SetFileName(v string) *FileBatchJobIdentifier { - s.FileName = &v - return s -} - -// SetFolderPath sets the FolderPath field's value. -func (s *FileBatchJobIdentifier) SetFolderPath(v string) *FileBatchJobIdentifier { - s.FolderPath = &v - return s -} - -// Defines the storage configuration for an Amazon FSx file system. -type FsxStorageConfiguration struct { - _ struct{} `type:"structure"` - - // The file system identifier. - // - // FileSystemId is a required field - FileSystemId *string `locationName:"file-system-id" type:"string" required:"true"` - - // The mount point for the file system. - // - // MountPoint is a required field - MountPoint *string `locationName:"mount-point" 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 FsxStorageConfiguration) 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 FsxStorageConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FsxStorageConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FsxStorageConfiguration"} - if s.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - if s.MountPoint == nil { - invalidParams.Add(request.NewErrParamRequired("MountPoint")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFileSystemId sets the FileSystemId field's value. -func (s *FsxStorageConfiguration) SetFileSystemId(v string) *FsxStorageConfiguration { - s.FileSystemId = &v - return s -} - -// SetMountPoint sets the MountPoint field's value. -func (s *FsxStorageConfiguration) SetMountPoint(v string) *FsxStorageConfiguration { - s.MountPoint = &v - return s -} - -// The required attributes for a generation data group data set. A generation -// data set is one of a collection of successive, historically related, catalogued -// data sets that together are known as a generation data group (GDG). Use this -// structure when you want to import a GDG. For more information on GDG, see -// Generation data sets (https://www.ibm.com/docs/en/zos/2.3.0?topic=guide-generation-data-sets). -type GdgAttributes struct { - _ struct{} `type:"structure"` - - // The maximum number of generation data sets, up to 255, in a GDG. - Limit *int64 `locationName:"limit" type:"integer"` - - // The disposition of the data set in the catalog. - RollDisposition *string `locationName:"rollDisposition" 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 GdgAttributes) 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 GdgAttributes) GoString() string { - return s.String() -} - -// SetLimit sets the Limit field's value. -func (s *GdgAttributes) SetLimit(v int64) *GdgAttributes { - s.Limit = &v - return s -} - -// SetRollDisposition sets the RollDisposition field's value. -func (s *GdgAttributes) SetRollDisposition(v string) *GdgAttributes { - s.RollDisposition = &v - return s -} - -// The required attributes for a generation data group data set. A generation -// data set is one of a collection of successive, historically related, catalogued -// data sets that together are known as a generation data group (GDG). Use this -// structure when you want to import a GDG. For more information on GDG, see -// Generation data sets (https://www.ibm.com/docs/en/zos/2.3.0?topic=guide-generation-data-sets). -type GdgDetailAttributes struct { - _ struct{} `type:"structure"` - - // The maximum number of generation data sets, up to 255, in a GDG. - Limit *int64 `locationName:"limit" type:"integer"` - - // The disposition of the data set in the catalog. - RollDisposition *string `locationName:"rollDisposition" 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 GdgDetailAttributes) 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 GdgDetailAttributes) GoString() string { - return s.String() -} - -// SetLimit sets the Limit field's value. -func (s *GdgDetailAttributes) SetLimit(v int64) *GdgDetailAttributes { - s.Limit = &v - return s -} - -// SetRollDisposition sets the RollDisposition field's value. -func (s *GdgDetailAttributes) SetRollDisposition(v string) *GdgDetailAttributes { - s.RollDisposition = &v - return s -} - -type GetApplicationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" 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 GetApplicationInput) 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 GetApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetApplicationInput) SetApplicationId(v string) *GetApplicationInput { - s.ApplicationId = &v - return s -} - -type GetApplicationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the application. - // - // ApplicationArn is a required field - ApplicationArn *string `locationName:"applicationArn" type:"string" required:"true"` - - // The identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `locationName:"applicationId" type:"string" required:"true"` - - // The timestamp when this application was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The version of the application that is deployed. - DeployedVersion *DeployedVersionSummary `locationName:"deployedVersion" type:"structure"` - - // The description of the application. - Description *string `locationName:"description" type:"string"` - - // The type of the target platform for the application. - // - // EngineType is a required field - EngineType *string `locationName:"engineType" type:"string" required:"true" enum:"EngineType"` - - // The identifier of the runtime environment where you want to deploy the application. - EnvironmentId *string `locationName:"environmentId" type:"string"` - - // The identifier of a customer managed key. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The timestamp when you last started the application. Null until the application - // runs for the first time. - LastStartTime *time.Time `locationName:"lastStartTime" type:"timestamp"` - - // The latest version of the application. - // - // LatestVersion is a required field - LatestVersion *ApplicationVersionSummary `locationName:"latestVersion" type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) for the network load balancer listener created - // in your Amazon Web Services account. Amazon Web Services Mainframe Modernization - // creates this listener for you the first time you deploy an application. - ListenerArns []*string `locationName:"listenerArns" min:"1" type:"list"` - - // The port associated with the network load balancer listener created in your - // Amazon Web Services account. - ListenerPorts []*int64 `locationName:"listenerPorts" min:"1" type:"list"` - - // The public DNS name of the load balancer created in your Amazon Web Services - // account. - LoadBalancerDnsName *string `locationName:"loadBalancerDnsName" type:"string"` - - // The list of log summaries. Each log summary includes the log type as well - // as the log group identifier. These are CloudWatch logs. Amazon Web Services - // Mainframe Modernization pushes the application log to CloudWatch under the - // customer's account. - LogGroups []*LogGroupSummary `locationName:"logGroups" type:"list"` - - // The unique identifier of the application. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the role associated with the application. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The status of the application. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ApplicationLifecycle"` - - // The reason for the reported status. - StatusReason *string `locationName:"statusReason" type:"string"` - - // A list of tags associated with the application. - Tags map[string]*string `locationName:"tags" type:"map"` - - // Returns the Amazon Resource Names (ARNs) of the target groups that are attached - // to the network load balancer. - TargetGroupArns []*string `locationName:"targetGroupArns" min:"1" type:"list"` -} - -// 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 GetApplicationOutput) 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 GetApplicationOutput) GoString() string { - return s.String() -} - -// SetApplicationArn sets the ApplicationArn field's value. -func (s *GetApplicationOutput) SetApplicationArn(v string) *GetApplicationOutput { - s.ApplicationArn = &v - return s -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetApplicationOutput) SetApplicationId(v string) *GetApplicationOutput { - s.ApplicationId = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetApplicationOutput) SetCreationTime(v time.Time) *GetApplicationOutput { - s.CreationTime = &v - return s -} - -// SetDeployedVersion sets the DeployedVersion field's value. -func (s *GetApplicationOutput) SetDeployedVersion(v *DeployedVersionSummary) *GetApplicationOutput { - s.DeployedVersion = v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetApplicationOutput) SetDescription(v string) *GetApplicationOutput { - s.Description = &v - return s -} - -// SetEngineType sets the EngineType field's value. -func (s *GetApplicationOutput) SetEngineType(v string) *GetApplicationOutput { - s.EngineType = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *GetApplicationOutput) SetEnvironmentId(v string) *GetApplicationOutput { - s.EnvironmentId = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *GetApplicationOutput) SetKmsKeyId(v string) *GetApplicationOutput { - s.KmsKeyId = &v - return s -} - -// SetLastStartTime sets the LastStartTime field's value. -func (s *GetApplicationOutput) SetLastStartTime(v time.Time) *GetApplicationOutput { - s.LastStartTime = &v - return s -} - -// SetLatestVersion sets the LatestVersion field's value. -func (s *GetApplicationOutput) SetLatestVersion(v *ApplicationVersionSummary) *GetApplicationOutput { - s.LatestVersion = v - return s -} - -// SetListenerArns sets the ListenerArns field's value. -func (s *GetApplicationOutput) SetListenerArns(v []*string) *GetApplicationOutput { - s.ListenerArns = v - return s -} - -// SetListenerPorts sets the ListenerPorts field's value. -func (s *GetApplicationOutput) SetListenerPorts(v []*int64) *GetApplicationOutput { - s.ListenerPorts = v - return s -} - -// SetLoadBalancerDnsName sets the LoadBalancerDnsName field's value. -func (s *GetApplicationOutput) SetLoadBalancerDnsName(v string) *GetApplicationOutput { - s.LoadBalancerDnsName = &v - return s -} - -// SetLogGroups sets the LogGroups field's value. -func (s *GetApplicationOutput) SetLogGroups(v []*LogGroupSummary) *GetApplicationOutput { - s.LogGroups = v - return s -} - -// SetName sets the Name field's value. -func (s *GetApplicationOutput) SetName(v string) *GetApplicationOutput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetApplicationOutput) SetRoleArn(v string) *GetApplicationOutput { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetApplicationOutput) SetStatus(v string) *GetApplicationOutput { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *GetApplicationOutput) SetStatusReason(v string) *GetApplicationOutput { - s.StatusReason = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetApplicationOutput) SetTags(v map[string]*string) *GetApplicationOutput { - s.Tags = v - return s -} - -// SetTargetGroupArns sets the TargetGroupArns field's value. -func (s *GetApplicationOutput) SetTargetGroupArns(v []*string) *GetApplicationOutput { - s.TargetGroupArns = v - return s -} - -type GetApplicationVersionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The specific version of the application. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `location:"uri" locationName:"applicationVersion" min:"1" type:"integer" 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 GetApplicationVersionInput) 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 GetApplicationVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetApplicationVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApplicationVersionInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.ApplicationVersion == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationVersion")) - } - if s.ApplicationVersion != nil && *s.ApplicationVersion < 1 { - invalidParams.Add(request.NewErrParamMinValue("ApplicationVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetApplicationVersionInput) SetApplicationId(v string) *GetApplicationVersionInput { - s.ApplicationId = &v - return s -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *GetApplicationVersionInput) SetApplicationVersion(v int64) *GetApplicationVersionInput { - s.ApplicationVersion = &v - return s -} - -type GetApplicationVersionOutput struct { - _ struct{} `type:"structure"` - - // The specific version of the application. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" required:"true"` - - // The timestamp when the application version was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The content of the application definition. This is a JSON object that contains - // the resource configuration and definitions that identify an application. - // - // DefinitionContent is a required field - DefinitionContent *string `locationName:"definitionContent" min:"1" type:"string" required:"true"` - - // The application description. - Description *string `locationName:"description" type:"string"` - - // The name of the application version. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The status of the application version. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ApplicationVersionLifecycle"` - - // The reason for the reported status. - StatusReason *string `locationName:"statusReason" 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 GetApplicationVersionOutput) 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 GetApplicationVersionOutput) GoString() string { - return s.String() -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *GetApplicationVersionOutput) SetApplicationVersion(v int64) *GetApplicationVersionOutput { - s.ApplicationVersion = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetApplicationVersionOutput) SetCreationTime(v time.Time) *GetApplicationVersionOutput { - s.CreationTime = &v - return s -} - -// SetDefinitionContent sets the DefinitionContent field's value. -func (s *GetApplicationVersionOutput) SetDefinitionContent(v string) *GetApplicationVersionOutput { - s.DefinitionContent = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetApplicationVersionOutput) SetDescription(v string) *GetApplicationVersionOutput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetApplicationVersionOutput) SetName(v string) *GetApplicationVersionOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetApplicationVersionOutput) SetStatus(v string) *GetApplicationVersionOutput { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *GetApplicationVersionOutput) SetStatusReason(v string) *GetApplicationVersionOutput { - s.StatusReason = &v - return s -} - -type GetBatchJobExecutionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The unique identifier of the batch job execution. - // - // ExecutionId is a required field - ExecutionId *string `location:"uri" locationName:"executionId" 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 GetBatchJobExecutionInput) 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 GetBatchJobExecutionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBatchJobExecutionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBatchJobExecutionInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.ExecutionId == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionId")) - } - if s.ExecutionId != nil && len(*s.ExecutionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetBatchJobExecutionInput) SetApplicationId(v string) *GetBatchJobExecutionInput { - s.ApplicationId = &v - return s -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *GetBatchJobExecutionInput) SetExecutionId(v string) *GetBatchJobExecutionInput { - s.ExecutionId = &v - return s -} - -type GetBatchJobExecutionOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `locationName:"applicationId" type:"string" required:"true"` - - // The unique identifier of this batch job. - BatchJobIdentifier *BatchJobIdentifier `locationName:"batchJobIdentifier" type:"structure"` - - // The timestamp when the batch job execution ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // The unique identifier for this batch job execution. - // - // ExecutionId is a required field - ExecutionId *string `locationName:"executionId" type:"string" required:"true"` - - // The unique identifier for this batch job. - JobId *string `locationName:"jobId" type:"string"` - - // The name of this batch job. - JobName *string `locationName:"jobName" type:"string"` - - // The type of job. - JobType *string `locationName:"jobType" type:"string" enum:"BatchJobType"` - - // The user for the job. - JobUser *string `locationName:"jobUser" type:"string"` - - // The batch job return code from either the Blu Age or Micro Focus runtime - // engines. For more information, see Batch return codes (https://www.ibm.com/docs/en/was/8.5.5?topic=model-batch-return-codes) - // in the IBM WebSphere Application Server documentation. - ReturnCode *string `locationName:"returnCode" type:"string"` - - // The timestamp when the batch job execution started. - // - // StartTime is a required field - StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - - // The status of the batch job execution. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"BatchJobExecutionStatus"` - - // The reason for the reported status. - StatusReason *string `locationName:"statusReason" 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 GetBatchJobExecutionOutput) 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 GetBatchJobExecutionOutput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetBatchJobExecutionOutput) SetApplicationId(v string) *GetBatchJobExecutionOutput { - s.ApplicationId = &v - return s -} - -// SetBatchJobIdentifier sets the BatchJobIdentifier field's value. -func (s *GetBatchJobExecutionOutput) SetBatchJobIdentifier(v *BatchJobIdentifier) *GetBatchJobExecutionOutput { - s.BatchJobIdentifier = v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *GetBatchJobExecutionOutput) SetEndTime(v time.Time) *GetBatchJobExecutionOutput { - s.EndTime = &v - return s -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *GetBatchJobExecutionOutput) SetExecutionId(v string) *GetBatchJobExecutionOutput { - s.ExecutionId = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *GetBatchJobExecutionOutput) SetJobId(v string) *GetBatchJobExecutionOutput { - s.JobId = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *GetBatchJobExecutionOutput) SetJobName(v string) *GetBatchJobExecutionOutput { - s.JobName = &v - return s -} - -// SetJobType sets the JobType field's value. -func (s *GetBatchJobExecutionOutput) SetJobType(v string) *GetBatchJobExecutionOutput { - s.JobType = &v - return s -} - -// SetJobUser sets the JobUser field's value. -func (s *GetBatchJobExecutionOutput) SetJobUser(v string) *GetBatchJobExecutionOutput { - s.JobUser = &v - return s -} - -// SetReturnCode sets the ReturnCode field's value. -func (s *GetBatchJobExecutionOutput) SetReturnCode(v string) *GetBatchJobExecutionOutput { - s.ReturnCode = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetBatchJobExecutionOutput) SetStartTime(v time.Time) *GetBatchJobExecutionOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetBatchJobExecutionOutput) SetStatus(v string) *GetBatchJobExecutionOutput { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *GetBatchJobExecutionOutput) SetStatusReason(v string) *GetBatchJobExecutionOutput { - s.StatusReason = &v - return s -} - -type GetDataSetDetailsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application that this data set is associated - // with. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The name of the data set. - // - // DataSetName is a required field - DataSetName *string `location:"uri" locationName:"dataSetName" 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 GetDataSetDetailsInput) 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 GetDataSetDetailsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataSetDetailsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataSetDetailsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.DataSetName == nil { - invalidParams.Add(request.NewErrParamRequired("DataSetName")) - } - if s.DataSetName != nil && len(*s.DataSetName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSetName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetDataSetDetailsInput) SetApplicationId(v string) *GetDataSetDetailsInput { - s.ApplicationId = &v - return s -} - -// SetDataSetName sets the DataSetName field's value. -func (s *GetDataSetDetailsInput) SetDataSetName(v string) *GetDataSetDetailsInput { - s.DataSetName = &v - return s -} - -type GetDataSetDetailsOutput struct { - _ struct{} `type:"structure"` - - // The size of the block on disk. - Blocksize *int64 `locationName:"blocksize" type:"integer"` - - // The timestamp when the data set was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The name of the data set. - // - // DataSetName is a required field - DataSetName *string `locationName:"dataSetName" type:"string" required:"true"` - - // The type of data set. The only supported value is VSAM. - DataSetOrg *DatasetDetailOrgAttributes `locationName:"dataSetOrg" type:"structure"` - - // File size of the dataset. - FileSize *int64 `locationName:"fileSize" type:"long"` - - // The last time the data set was referenced. - LastReferencedTime *time.Time `locationName:"lastReferencedTime" type:"timestamp"` - - // The last time the data set was updated. - LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` - - // The location where the data set is stored. - Location *string `locationName:"location" type:"string"` - - // The length of records in the data set. - RecordLength *int64 `locationName:"recordLength" 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 GetDataSetDetailsOutput) 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 GetDataSetDetailsOutput) GoString() string { - return s.String() -} - -// SetBlocksize sets the Blocksize field's value. -func (s *GetDataSetDetailsOutput) SetBlocksize(v int64) *GetDataSetDetailsOutput { - s.Blocksize = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetDataSetDetailsOutput) SetCreationTime(v time.Time) *GetDataSetDetailsOutput { - s.CreationTime = &v - return s -} - -// SetDataSetName sets the DataSetName field's value. -func (s *GetDataSetDetailsOutput) SetDataSetName(v string) *GetDataSetDetailsOutput { - s.DataSetName = &v - return s -} - -// SetDataSetOrg sets the DataSetOrg field's value. -func (s *GetDataSetDetailsOutput) SetDataSetOrg(v *DatasetDetailOrgAttributes) *GetDataSetDetailsOutput { - s.DataSetOrg = v - return s -} - -// SetFileSize sets the FileSize field's value. -func (s *GetDataSetDetailsOutput) SetFileSize(v int64) *GetDataSetDetailsOutput { - s.FileSize = &v - return s -} - -// SetLastReferencedTime sets the LastReferencedTime field's value. -func (s *GetDataSetDetailsOutput) SetLastReferencedTime(v time.Time) *GetDataSetDetailsOutput { - s.LastReferencedTime = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *GetDataSetDetailsOutput) SetLastUpdatedTime(v time.Time) *GetDataSetDetailsOutput { - s.LastUpdatedTime = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *GetDataSetDetailsOutput) SetLocation(v string) *GetDataSetDetailsOutput { - s.Location = &v - return s -} - -// SetRecordLength sets the RecordLength field's value. -func (s *GetDataSetDetailsOutput) SetRecordLength(v int64) *GetDataSetDetailsOutput { - s.RecordLength = &v - return s -} - -type GetDataSetImportTaskInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The application identifier. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The task identifier returned by the CreateDataSetImportTask operation. - // - // TaskId is a required field - TaskId *string `location:"uri" locationName:"taskId" 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 GetDataSetImportTaskInput) 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 GetDataSetImportTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataSetImportTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataSetImportTaskInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.TaskId == nil { - invalidParams.Add(request.NewErrParamRequired("TaskId")) - } - if s.TaskId != nil && len(*s.TaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetDataSetImportTaskInput) SetApplicationId(v string) *GetDataSetImportTaskInput { - s.ApplicationId = &v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *GetDataSetImportTaskInput) SetTaskId(v string) *GetDataSetImportTaskInput { - s.TaskId = &v - return s -} - -type GetDataSetImportTaskOutput struct { - _ struct{} `type:"structure"` - - // The status of the task. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DataSetTaskLifecycle"` - - // A summary of the status of the task. - Summary *DataSetImportSummary `locationName:"summary" type:"structure"` - - // The task identifier. - // - // TaskId is a required field - TaskId *string `locationName:"taskId" 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 GetDataSetImportTaskOutput) 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 GetDataSetImportTaskOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *GetDataSetImportTaskOutput) SetStatus(v string) *GetDataSetImportTaskOutput { - s.Status = &v - return s -} - -// SetSummary sets the Summary field's value. -func (s *GetDataSetImportTaskOutput) SetSummary(v *DataSetImportSummary) *GetDataSetImportTaskOutput { - s.Summary = v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *GetDataSetImportTaskOutput) SetTaskId(v string) *GetDataSetImportTaskOutput { - s.TaskId = &v - return s -} - -type GetDeploymentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The unique identifier for the deployment. - // - // DeploymentId is a required field - DeploymentId *string `location:"uri" locationName:"deploymentId" 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 GetDeploymentInput) 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 GetDeploymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeploymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeploymentInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.DeploymentId == nil { - invalidParams.Add(request.NewErrParamRequired("DeploymentId")) - } - if s.DeploymentId != nil && len(*s.DeploymentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeploymentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetDeploymentInput) SetApplicationId(v string) *GetDeploymentInput { - s.ApplicationId = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentInput) SetDeploymentId(v string) *GetDeploymentInput { - s.DeploymentId = &v - return s -} - -type GetDeploymentOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `locationName:"applicationId" type:"string" required:"true"` - - // The application version. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" required:"true"` - - // The timestamp when the deployment was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The unique identifier of the deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` - - // The unique identifier of the runtime environment. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // The status of the deployment. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"DeploymentLifecycle"` - - // The reason for the reported status. - StatusReason *string `locationName:"statusReason" 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 GetDeploymentOutput) 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 GetDeploymentOutput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetDeploymentOutput) SetApplicationId(v string) *GetDeploymentOutput { - s.ApplicationId = &v - return s -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *GetDeploymentOutput) SetApplicationVersion(v int64) *GetDeploymentOutput { - s.ApplicationVersion = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetDeploymentOutput) SetCreationTime(v time.Time) *GetDeploymentOutput { - s.CreationTime = &v - return s -} - -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentOutput) SetDeploymentId(v string) *GetDeploymentOutput { - s.DeploymentId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *GetDeploymentOutput) SetEnvironmentId(v string) *GetDeploymentOutput { - s.EnvironmentId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetDeploymentOutput) SetStatus(v string) *GetDeploymentOutput { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *GetDeploymentOutput) SetStatusReason(v string) *GetDeploymentOutput { - s.StatusReason = &v - return s -} - -type GetEnvironmentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the runtime environment. - // - // EnvironmentId is a required field - EnvironmentId *string `location:"uri" locationName:"environmentId" 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 GetEnvironmentInput) 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 GetEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEnvironmentInput"} - if s.EnvironmentId == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentId")) - } - if s.EnvironmentId != nil && len(*s.EnvironmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *GetEnvironmentInput) SetEnvironmentId(v string) *GetEnvironmentInput { - s.EnvironmentId = &v - return s -} - -type GetEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // The number of instances included in the runtime environment. A standalone - // runtime environment has a maximum of one instance. Currently, a high availability - // runtime environment has a maximum of two instances. - ActualCapacity *int64 `locationName:"actualCapacity" type:"integer"` - - // The timestamp when the runtime environment was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" required:"true"` - - // The description of the runtime environment. - Description *string `locationName:"description" type:"string"` - - // The target platform for the runtime environment. - // - // EngineType is a required field - EngineType *string `locationName:"engineType" type:"string" required:"true" enum:"EngineType"` - - // The version of the runtime engine. - // - // EngineVersion is a required field - EngineVersion *string `locationName:"engineVersion" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the runtime environment. - // - // EnvironmentArn is a required field - EnvironmentArn *string `locationName:"environmentArn" type:"string" required:"true"` - - // The unique identifier of the runtime environment. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" type:"string" required:"true"` - - // The desired capacity of the high availability configuration for the runtime - // environment. - HighAvailabilityConfig *HighAvailabilityConfig `locationName:"highAvailabilityConfig" type:"structure"` - - // The type of instance underlying the runtime environment. - // - // InstanceType is a required field - InstanceType *string `locationName:"instanceType" type:"string" required:"true"` - - // The identifier of a customer managed key. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The Amazon Resource Name (ARN) for the load balancer used with the runtime - // environment. - LoadBalancerArn *string `locationName:"loadBalancerArn" type:"string"` - - // The name of the runtime environment. Must be unique within the account. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // Indicates the pending maintenance scheduled on this environment. - PendingMaintenance *PendingMaintenance `locationName:"pendingMaintenance" type:"structure"` - - // The maintenance window for the runtime environment. If you don't provide - // a value for the maintenance window, the service assigns a random value. - PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" type:"string"` - - // Whether applications running in this runtime environment are publicly accessible. - PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"` - - // The unique identifiers of the security groups assigned to this runtime environment. - // - // SecurityGroupIds is a required field - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list" required:"true"` - - // The status of the runtime environment. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"EnvironmentLifecycle"` - - // The reason for the reported status. - StatusReason *string `locationName:"statusReason" type:"string"` - - // The storage configurations defined for the runtime environment. - StorageConfigurations []*StorageConfiguration `locationName:"storageConfigurations" type:"list"` - - // The unique identifiers of the subnets assigned to this runtime environment. - // - // SubnetIds is a required field - SubnetIds []*string `locationName:"subnetIds" type:"list" required:"true"` - - // The tags defined for this runtime environment. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The unique identifier for the VPC used with this runtime environment. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" 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 GetEnvironmentOutput) 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 GetEnvironmentOutput) GoString() string { - return s.String() -} - -// SetActualCapacity sets the ActualCapacity field's value. -func (s *GetEnvironmentOutput) SetActualCapacity(v int64) *GetEnvironmentOutput { - s.ActualCapacity = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetEnvironmentOutput) SetCreationTime(v time.Time) *GetEnvironmentOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetEnvironmentOutput) SetDescription(v string) *GetEnvironmentOutput { - s.Description = &v - return s -} - -// SetEngineType sets the EngineType field's value. -func (s *GetEnvironmentOutput) SetEngineType(v string) *GetEnvironmentOutput { - s.EngineType = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *GetEnvironmentOutput) SetEngineVersion(v string) *GetEnvironmentOutput { - s.EngineVersion = &v - return s -} - -// SetEnvironmentArn sets the EnvironmentArn field's value. -func (s *GetEnvironmentOutput) SetEnvironmentArn(v string) *GetEnvironmentOutput { - s.EnvironmentArn = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *GetEnvironmentOutput) SetEnvironmentId(v string) *GetEnvironmentOutput { - s.EnvironmentId = &v - return s -} - -// SetHighAvailabilityConfig sets the HighAvailabilityConfig field's value. -func (s *GetEnvironmentOutput) SetHighAvailabilityConfig(v *HighAvailabilityConfig) *GetEnvironmentOutput { - s.HighAvailabilityConfig = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *GetEnvironmentOutput) SetInstanceType(v string) *GetEnvironmentOutput { - s.InstanceType = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *GetEnvironmentOutput) SetKmsKeyId(v string) *GetEnvironmentOutput { - s.KmsKeyId = &v - return s -} - -// SetLoadBalancerArn sets the LoadBalancerArn field's value. -func (s *GetEnvironmentOutput) SetLoadBalancerArn(v string) *GetEnvironmentOutput { - s.LoadBalancerArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetEnvironmentOutput) SetName(v string) *GetEnvironmentOutput { - s.Name = &v - return s -} - -// SetPendingMaintenance sets the PendingMaintenance field's value. -func (s *GetEnvironmentOutput) SetPendingMaintenance(v *PendingMaintenance) *GetEnvironmentOutput { - s.PendingMaintenance = v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *GetEnvironmentOutput) SetPreferredMaintenanceWindow(v string) *GetEnvironmentOutput { - s.PreferredMaintenanceWindow = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *GetEnvironmentOutput) SetPubliclyAccessible(v bool) *GetEnvironmentOutput { - s.PubliclyAccessible = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *GetEnvironmentOutput) SetSecurityGroupIds(v []*string) *GetEnvironmentOutput { - s.SecurityGroupIds = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetEnvironmentOutput) SetStatus(v string) *GetEnvironmentOutput { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *GetEnvironmentOutput) SetStatusReason(v string) *GetEnvironmentOutput { - s.StatusReason = &v - return s -} - -// SetStorageConfigurations sets the StorageConfigurations field's value. -func (s *GetEnvironmentOutput) SetStorageConfigurations(v []*StorageConfiguration) *GetEnvironmentOutput { - s.StorageConfigurations = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *GetEnvironmentOutput) SetSubnetIds(v []*string) *GetEnvironmentOutput { - s.SubnetIds = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetEnvironmentOutput) SetTags(v map[string]*string) *GetEnvironmentOutput { - s.Tags = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *GetEnvironmentOutput) SetVpcId(v string) *GetEnvironmentOutput { - s.VpcId = &v - return s -} - -type GetSignedBluinsightsUrlInput struct { - _ struct{} `type:"structure" nopayload:"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 GetSignedBluinsightsUrlInput) 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 GetSignedBluinsightsUrlInput) GoString() string { - return s.String() -} - -type GetSignedBluinsightsUrlOutput struct { - _ struct{} `type:"structure"` - - // Single sign-on AWS Blu Insights URL. - // - // SignedBiUrl is a required field - SignedBiUrl *string `locationName:"signedBiUrl" 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 GetSignedBluinsightsUrlOutput) 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 GetSignedBluinsightsUrlOutput) GoString() string { - return s.String() -} - -// SetSignedBiUrl sets the SignedBiUrl field's value. -func (s *GetSignedBluinsightsUrlOutput) SetSignedBiUrl(v string) *GetSignedBluinsightsUrlOutput { - s.SignedBiUrl = &v - return s -} - -// Defines the details of a high availability configuration. -type HighAvailabilityConfig struct { - _ struct{} `type:"structure"` - - // The number of instances in a high availability configuration. The minimum - // possible value is 1 and the maximum is 100. - // - // DesiredCapacity is a required field - DesiredCapacity *int64 `locationName:"desiredCapacity" type:"integer" 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 HighAvailabilityConfig) 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 HighAvailabilityConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HighAvailabilityConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HighAvailabilityConfig"} - if s.DesiredCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("DesiredCapacity")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDesiredCapacity sets the DesiredCapacity field's value. -func (s *HighAvailabilityConfig) SetDesiredCapacity(v int64) *HighAvailabilityConfig { - s.DesiredCapacity = &v - return s -} - -// An unexpected error occurred during the processing of the request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The number of seconds to wait before retrying the request. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Identifies a specific batch job. -type JobIdentifier struct { - _ struct{} `type:"structure"` - - // The name of the file that contains the batch job definition. - FileName *string `locationName:"fileName" type:"string"` - - // The name of the script that contains the batch job definition. - ScriptName *string `locationName:"scriptName" 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 JobIdentifier) 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 JobIdentifier) GoString() string { - return s.String() -} - -// SetFileName sets the FileName field's value. -func (s *JobIdentifier) SetFileName(v string) *JobIdentifier { - s.FileName = &v - return s -} - -// SetScriptName sets the ScriptName field's value. -func (s *JobIdentifier) SetScriptName(v string) *JobIdentifier { - s.ScriptName = &v - return s -} - -type ListApplicationVersionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The maximum number of application versions to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token returned from a previous call to this operation. This - // specifies the next item to return. To return to the beginning of the list, - // exclude this parameter. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListApplicationVersionsInput) 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 ListApplicationVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListApplicationVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListApplicationVersionsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListApplicationVersionsInput) SetApplicationId(v string) *ListApplicationVersionsInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListApplicationVersionsInput) SetMaxResults(v int64) *ListApplicationVersionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationVersionsInput) SetNextToken(v string) *ListApplicationVersionsInput { - s.NextToken = &v - return s -} - -type ListApplicationVersionsOutput struct { - _ struct{} `type:"structure"` - - // The list of application versions. - // - // ApplicationVersions is a required field - ApplicationVersions []*ApplicationVersionSummary `locationName:"applicationVersions" type:"list" required:"true"` - - // If there are more items to return, this contains a token that is passed to - // a subsequent call to this operation to retrieve the next set of items. - NextToken *string `locationName:"nextToken" 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 ListApplicationVersionsOutput) 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 ListApplicationVersionsOutput) GoString() string { - return s.String() -} - -// SetApplicationVersions sets the ApplicationVersions field's value. -func (s *ListApplicationVersionsOutput) SetApplicationVersions(v []*ApplicationVersionSummary) *ListApplicationVersionsOutput { - s.ApplicationVersions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationVersionsOutput) SetNextToken(v string) *ListApplicationVersionsOutput { - s.NextToken = &v - return s -} - -type ListApplicationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the runtime environment where the applications are - // deployed. - EnvironmentId *string `location:"querystring" locationName:"environmentId" type:"string"` - - // The maximum number of applications to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The names of the applications. - Names []*string `location:"querystring" locationName:"names" min:"1" type:"list"` - - // A pagination token to control the number of applications displayed in the - // list. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListApplicationsInput) 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 ListApplicationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListApplicationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListApplicationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Names != nil && len(s.Names) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Names", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *ListApplicationsInput) SetEnvironmentId(v string) *ListApplicationsInput { - s.EnvironmentId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListApplicationsInput) SetMaxResults(v int64) *ListApplicationsInput { - s.MaxResults = &v - return s -} - -// SetNames sets the Names field's value. -func (s *ListApplicationsInput) SetNames(v []*string) *ListApplicationsInput { - s.Names = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsInput) SetNextToken(v string) *ListApplicationsInput { - s.NextToken = &v - return s -} - -type ListApplicationsOutput struct { - _ struct{} `type:"structure"` - - // Returns a list of summary details for all the applications in a runtime environment. - // - // Applications is a required field - Applications []*ApplicationSummary `locationName:"applications" type:"list" required:"true"` - - // A pagination token that's returned when the response doesn't contain all - // applications. - NextToken *string `locationName:"nextToken" 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 ListApplicationsOutput) 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 ListApplicationsOutput) GoString() string { - return s.String() -} - -// SetApplications sets the Applications field's value. -func (s *ListApplicationsOutput) SetApplications(v []*ApplicationSummary) *ListApplicationsOutput { - s.Applications = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsOutput) SetNextToken(v string) *ListApplicationsOutput { - s.NextToken = &v - return s -} - -type ListBatchJobDefinitionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The maximum number of batch job definitions to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token returned from a previous call to this operation. This - // specifies the next item to return. To return to the beginning of the list, - // exclude this parameter. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // If the batch job definition is a FileBatchJobDefinition, the prefix allows - // you to search on the file names of FileBatchJobDefinitions. - Prefix *string `location:"querystring" locationName:"prefix" 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 ListBatchJobDefinitionsInput) 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 ListBatchJobDefinitionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBatchJobDefinitionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBatchJobDefinitionsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListBatchJobDefinitionsInput) SetApplicationId(v string) *ListBatchJobDefinitionsInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListBatchJobDefinitionsInput) SetMaxResults(v int64) *ListBatchJobDefinitionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBatchJobDefinitionsInput) SetNextToken(v string) *ListBatchJobDefinitionsInput { - s.NextToken = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListBatchJobDefinitionsInput) SetPrefix(v string) *ListBatchJobDefinitionsInput { - s.Prefix = &v - return s -} - -type ListBatchJobDefinitionsOutput struct { - _ struct{} `type:"structure"` - - // The list of batch job definitions. - // - // BatchJobDefinitions is a required field - BatchJobDefinitions []*BatchJobDefinition `locationName:"batchJobDefinitions" type:"list" required:"true"` - - // If there are more items to return, this contains a token that is passed to - // a subsequent call to this operation to retrieve the next set of items. - NextToken *string `locationName:"nextToken" 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 ListBatchJobDefinitionsOutput) 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 ListBatchJobDefinitionsOutput) GoString() string { - return s.String() -} - -// SetBatchJobDefinitions sets the BatchJobDefinitions field's value. -func (s *ListBatchJobDefinitionsOutput) SetBatchJobDefinitions(v []*BatchJobDefinition) *ListBatchJobDefinitionsOutput { - s.BatchJobDefinitions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBatchJobDefinitionsOutput) SetNextToken(v string) *ListBatchJobDefinitionsOutput { - s.NextToken = &v - return s -} - -type ListBatchJobExecutionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The unique identifier of each batch job execution. - ExecutionIds []*string `location:"querystring" locationName:"executionIds" min:"1" type:"list"` - - // The name of each batch job execution. - JobName *string `location:"querystring" locationName:"jobName" type:"string"` - - // The maximum number of batch job executions to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token to control the number of batch job executions displayed - // in the list. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The time after which the batch job executions started. - StartedAfter *time.Time `location:"querystring" locationName:"startedAfter" type:"timestamp"` - - // The time before the batch job executions started. - StartedBefore *time.Time `location:"querystring" locationName:"startedBefore" type:"timestamp"` - - // The status of the batch job executions. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"BatchJobExecutionStatus"` -} - -// 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 ListBatchJobExecutionsInput) 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 ListBatchJobExecutionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBatchJobExecutionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBatchJobExecutionsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.ExecutionIds != nil && len(s.ExecutionIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionIds", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListBatchJobExecutionsInput) SetApplicationId(v string) *ListBatchJobExecutionsInput { - s.ApplicationId = &v - return s -} - -// SetExecutionIds sets the ExecutionIds field's value. -func (s *ListBatchJobExecutionsInput) SetExecutionIds(v []*string) *ListBatchJobExecutionsInput { - s.ExecutionIds = v - return s -} - -// SetJobName sets the JobName field's value. -func (s *ListBatchJobExecutionsInput) SetJobName(v string) *ListBatchJobExecutionsInput { - s.JobName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListBatchJobExecutionsInput) SetMaxResults(v int64) *ListBatchJobExecutionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBatchJobExecutionsInput) SetNextToken(v string) *ListBatchJobExecutionsInput { - s.NextToken = &v - return s -} - -// SetStartedAfter sets the StartedAfter field's value. -func (s *ListBatchJobExecutionsInput) SetStartedAfter(v time.Time) *ListBatchJobExecutionsInput { - s.StartedAfter = &v - return s -} - -// SetStartedBefore sets the StartedBefore field's value. -func (s *ListBatchJobExecutionsInput) SetStartedBefore(v time.Time) *ListBatchJobExecutionsInput { - s.StartedBefore = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListBatchJobExecutionsInput) SetStatus(v string) *ListBatchJobExecutionsInput { - s.Status = &v - return s -} - -type ListBatchJobExecutionsOutput struct { - _ struct{} `type:"structure"` - - // Returns a list of batch job executions for an application. - // - // BatchJobExecutions is a required field - BatchJobExecutions []*BatchJobExecutionSummary `locationName:"batchJobExecutions" type:"list" required:"true"` - - // A pagination token that's returned when the response doesn't contain all - // batch job executions. - NextToken *string `locationName:"nextToken" 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 ListBatchJobExecutionsOutput) 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 ListBatchJobExecutionsOutput) GoString() string { - return s.String() -} - -// SetBatchJobExecutions sets the BatchJobExecutions field's value. -func (s *ListBatchJobExecutionsOutput) SetBatchJobExecutions(v []*BatchJobExecutionSummary) *ListBatchJobExecutionsOutput { - s.BatchJobExecutions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListBatchJobExecutionsOutput) SetNextToken(v string) *ListBatchJobExecutionsOutput { - s.NextToken = &v - return s -} - -type ListDataSetImportHistoryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The maximum number of objects to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token returned from a previous call to this operation. This - // specifies the next item to return. To return to the beginning of the list, - // exclude this parameter. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListDataSetImportHistoryInput) 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 ListDataSetImportHistoryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataSetImportHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataSetImportHistoryInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListDataSetImportHistoryInput) SetApplicationId(v string) *ListDataSetImportHistoryInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataSetImportHistoryInput) SetMaxResults(v int64) *ListDataSetImportHistoryInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSetImportHistoryInput) SetNextToken(v string) *ListDataSetImportHistoryInput { - s.NextToken = &v - return s -} - -type ListDataSetImportHistoryOutput struct { - _ struct{} `type:"structure"` - - // The data set import tasks. - // - // DataSetImportTasks is a required field - DataSetImportTasks []*DataSetImportTask `locationName:"dataSetImportTasks" type:"list" required:"true"` - - // If there are more items to return, this contains a token that is passed to - // a subsequent call to this operation to retrieve the next set of items. - NextToken *string `locationName:"nextToken" 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 ListDataSetImportHistoryOutput) 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 ListDataSetImportHistoryOutput) GoString() string { - return s.String() -} - -// SetDataSetImportTasks sets the DataSetImportTasks field's value. -func (s *ListDataSetImportHistoryOutput) SetDataSetImportTasks(v []*DataSetImportTask) *ListDataSetImportHistoryOutput { - s.DataSetImportTasks = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSetImportHistoryOutput) SetNextToken(v string) *ListDataSetImportHistoryOutput { - s.NextToken = &v - return s -} - -type ListDataSetsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application for which you want to list the associated - // data sets. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The maximum number of objects to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Filter dataset name matching the specified pattern. Can use * and % as wild - // cards. - NameFilter *string `location:"querystring" locationName:"nameFilter" type:"string"` - - // A pagination token returned from a previous call to this operation. This - // specifies the next item to return. To return to the beginning of the list, - // exclude this parameter. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The prefix of the data set name, which you can use to filter the list of - // data sets. - Prefix *string `location:"querystring" locationName:"prefix" 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 ListDataSetsInput) 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 ListDataSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataSetsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListDataSetsInput) SetApplicationId(v string) *ListDataSetsInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataSetsInput) SetMaxResults(v int64) *ListDataSetsInput { - s.MaxResults = &v - return s -} - -// SetNameFilter sets the NameFilter field's value. -func (s *ListDataSetsInput) SetNameFilter(v string) *ListDataSetsInput { - s.NameFilter = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSetsInput) SetNextToken(v string) *ListDataSetsInput { - s.NextToken = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListDataSetsInput) SetPrefix(v string) *ListDataSetsInput { - s.Prefix = &v - return s -} - -type ListDataSetsOutput struct { - _ struct{} `type:"structure"` - - // The list of data sets, containing information including the creation time, - // the data set name, the data set organization, the data set format, and the - // last time the data set was referenced or updated. - // - // DataSets is a required field - DataSets []*DataSetSummary `locationName:"dataSets" type:"list" required:"true"` - - // If there are more items to return, this contains a token that is passed to - // a subsequent call to this operation to retrieve the next set of items. - NextToken *string `locationName:"nextToken" 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 ListDataSetsOutput) 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 ListDataSetsOutput) GoString() string { - return s.String() -} - -// SetDataSets sets the DataSets field's value. -func (s *ListDataSetsOutput) SetDataSets(v []*DataSetSummary) *ListDataSetsOutput { - s.DataSets = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSetsOutput) SetNextToken(v string) *ListDataSetsOutput { - s.NextToken = &v - return s -} - -type ListDeploymentsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The application identifier. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The maximum number of objects to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token returned from a previous call to this operation. This - // specifies the next item to return. To return to the beginning of the list, - // exclude this parameter. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListDeploymentsInput) 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 ListDeploymentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeploymentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeploymentsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListDeploymentsInput) SetApplicationId(v string) *ListDeploymentsInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDeploymentsInput) SetMaxResults(v int64) *ListDeploymentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentsInput) SetNextToken(v string) *ListDeploymentsInput { - s.NextToken = &v - return s -} - -type ListDeploymentsOutput struct { - _ struct{} `type:"structure"` - - // The list of deployments that is returned. - // - // Deployments is a required field - Deployments []*DeploymentSummary `locationName:"deployments" type:"list" required:"true"` - - // If there are more items to return, this contains a token that is passed to - // a subsequent call to this operation to retrieve the next set of items. - NextToken *string `locationName:"nextToken" 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 ListDeploymentsOutput) 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 ListDeploymentsOutput) GoString() string { - return s.String() -} - -// SetDeployments sets the Deployments field's value. -func (s *ListDeploymentsOutput) SetDeployments(v []*DeploymentSummary) *ListDeploymentsOutput { - s.Deployments = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeploymentsOutput) SetNextToken(v string) *ListDeploymentsOutput { - s.NextToken = &v - return s -} - -type ListEngineVersionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The type of target platform. - EngineType *string `location:"querystring" locationName:"engineType" type:"string" enum:"EngineType"` - - // The maximum number of objects to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token returned from a previous call to this operation. This - // specifies the next item to return. To return to the beginning of the list, - // exclude this parameter. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListEngineVersionsInput) 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 ListEngineVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEngineVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEngineVersionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEngineType sets the EngineType field's value. -func (s *ListEngineVersionsInput) SetEngineType(v string) *ListEngineVersionsInput { - s.EngineType = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEngineVersionsInput) SetMaxResults(v int64) *ListEngineVersionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEngineVersionsInput) SetNextToken(v string) *ListEngineVersionsInput { - s.NextToken = &v - return s -} - -type ListEngineVersionsOutput struct { - _ struct{} `type:"structure"` - - // Returns the engine versions. - // - // EngineVersions is a required field - EngineVersions []*EngineVersionsSummary `locationName:"engineVersions" type:"list" required:"true"` - - // If there are more items to return, this contains a token that is passed to - // a subsequent call to this operation to retrieve the next set of items. - NextToken *string `locationName:"nextToken" 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 ListEngineVersionsOutput) 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 ListEngineVersionsOutput) GoString() string { - return s.String() -} - -// SetEngineVersions sets the EngineVersions field's value. -func (s *ListEngineVersionsOutput) SetEngineVersions(v []*EngineVersionsSummary) *ListEngineVersionsOutput { - s.EngineVersions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEngineVersionsOutput) SetNextToken(v string) *ListEngineVersionsOutput { - s.NextToken = &v - return s -} - -type ListEnvironmentsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The engine type for the runtime environment. - EngineType *string `location:"querystring" locationName:"engineType" type:"string" enum:"EngineType"` - - // The maximum number of runtime environments to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The names of the runtime environments. Must be unique within the account. - Names []*string `location:"querystring" locationName:"names" min:"1" type:"list"` - - // A pagination token to control the number of runtime environments displayed - // in the list. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListEnvironmentsInput) 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 ListEnvironmentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEnvironmentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEnvironmentsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Names != nil && len(s.Names) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Names", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEngineType sets the EngineType field's value. -func (s *ListEnvironmentsInput) SetEngineType(v string) *ListEnvironmentsInput { - s.EngineType = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEnvironmentsInput) SetMaxResults(v int64) *ListEnvironmentsInput { - s.MaxResults = &v - return s -} - -// SetNames sets the Names field's value. -func (s *ListEnvironmentsInput) SetNames(v []*string) *ListEnvironmentsInput { - s.Names = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentsInput) SetNextToken(v string) *ListEnvironmentsInput { - s.NextToken = &v - return s -} - -type ListEnvironmentsOutput struct { - _ struct{} `type:"structure"` - - // Returns a list of summary details for all the runtime environments in your - // account. - // - // Environments is a required field - Environments []*EnvironmentSummary `locationName:"environments" type:"list" required:"true"` - - // A pagination token that's returned when the response doesn't contain all - // the runtime environments. - NextToken *string `locationName:"nextToken" 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 ListEnvironmentsOutput) 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 ListEnvironmentsOutput) GoString() string { - return s.String() -} - -// SetEnvironments sets the Environments field's value. -func (s *ListEnvironmentsOutput) SetEnvironments(v []*EnvironmentSummary) *ListEnvironmentsOutput { - s.Environments = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentsOutput) SetNextToken(v string) *ListEnvironmentsOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags for the resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// A subset of the attributes that describe a log group. In CloudWatch a log -// group is a group of log streams that share the same retention, monitoring, -// and access control settings. -type LogGroupSummary struct { - _ struct{} `type:"structure"` - - // The name of the log group. - // - // LogGroupName is a required field - LogGroupName *string `locationName:"logGroupName" min:"1" type:"string" required:"true"` - - // The type of log. - // - // LogType is a required field - LogType *string `locationName:"logType" 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 LogGroupSummary) 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 LogGroupSummary) GoString() string { - return s.String() -} - -// SetLogGroupName sets the LogGroupName field's value. -func (s *LogGroupSummary) SetLogGroupName(v string) *LogGroupSummary { - s.LogGroupName = &v - return s -} - -// SetLogType sets the LogType field's value. -func (s *LogGroupSummary) SetLogType(v string) *LogGroupSummary { - s.LogType = &v - return s -} - -// The information about the maintenance schedule. -type MaintenanceSchedule struct { - _ struct{} `type:"structure"` - - // The time the scheduled maintenance is to end. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // The time the scheduled maintenance is to start. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` -} - -// 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 MaintenanceSchedule) 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 MaintenanceSchedule) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *MaintenanceSchedule) SetEndTime(v time.Time) *MaintenanceSchedule { - s.EndTime = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *MaintenanceSchedule) SetStartTime(v time.Time) *MaintenanceSchedule { - s.StartTime = &v - return s -} - -// The scheduled maintenance for a runtime engine. -type PendingMaintenance struct { - _ struct{} `type:"structure"` - - // The specific runtime engine that the maintenance schedule applies to. - EngineVersion *string `locationName:"engineVersion" type:"string"` - - // The maintenance schedule for the runtime engine version. - Schedule *MaintenanceSchedule `locationName:"schedule" 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 PendingMaintenance) 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 PendingMaintenance) GoString() string { - return s.String() -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *PendingMaintenance) SetEngineVersion(v string) *PendingMaintenance { - s.EngineVersion = &v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *PendingMaintenance) SetSchedule(v *MaintenanceSchedule) *PendingMaintenance { - s.Schedule = v - return s -} - -// The supported properties for a PO type data set. -type PoAttributes struct { - _ struct{} `type:"structure"` - - // The character set encoding of the data set. - Encoding *string `locationName:"encoding" type:"string"` - - // The format of the data set records. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true"` - - // An array containing one or more filename extensions, allowing you to specify - // which files to be included as PDS member. - // - // MemberFileExtensions is a required field - MemberFileExtensions []*string `locationName:"memberFileExtensions" min:"1" type:"list" 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 PoAttributes) 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 PoAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PoAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PoAttributes"} - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.MemberFileExtensions == nil { - invalidParams.Add(request.NewErrParamRequired("MemberFileExtensions")) - } - if s.MemberFileExtensions != nil && len(s.MemberFileExtensions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MemberFileExtensions", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncoding sets the Encoding field's value. -func (s *PoAttributes) SetEncoding(v string) *PoAttributes { - s.Encoding = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *PoAttributes) SetFormat(v string) *PoAttributes { - s.Format = &v - return s -} - -// SetMemberFileExtensions sets the MemberFileExtensions field's value. -func (s *PoAttributes) SetMemberFileExtensions(v []*string) *PoAttributes { - s.MemberFileExtensions = v - return s -} - -// The supported properties for a PO type data set. -type PoDetailAttributes struct { - _ struct{} `type:"structure"` - - // The character set encoding of the data set. - // - // Encoding is a required field - Encoding *string `locationName:"encoding" type:"string" required:"true"` - - // The format of the data set records. - // - // Format is a required field - Format *string `locationName:"format" 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 PoDetailAttributes) 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 PoDetailAttributes) GoString() string { - return s.String() -} - -// SetEncoding sets the Encoding field's value. -func (s *PoDetailAttributes) SetEncoding(v string) *PoDetailAttributes { - s.Encoding = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *PoDetailAttributes) SetFormat(v string) *PoDetailAttributes { - s.Format = &v - return s -} - -// The primary key for a KSDS data set. -type PrimaryKey struct { - _ struct{} `type:"structure"` - - // A strictly positive integer value representing the length of the primary - // key. - // - // Length is a required field - Length *int64 `locationName:"length" type:"integer" required:"true"` - - // A name for the Primary Key. - Name *string `locationName:"name" type:"string"` - - // A positive integer value representing the offset to mark the start of the - // primary key in the record byte array. - // - // Offset is a required field - Offset *int64 `locationName:"offset" type:"integer" 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 PrimaryKey) 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 PrimaryKey) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrimaryKey) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrimaryKey"} - if s.Length == nil { - invalidParams.Add(request.NewErrParamRequired("Length")) - } - if s.Offset == nil { - invalidParams.Add(request.NewErrParamRequired("Offset")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLength sets the Length field's value. -func (s *PrimaryKey) SetLength(v int64) *PrimaryKey { - s.Length = &v - return s -} - -// SetName sets the Name field's value. -func (s *PrimaryKey) SetName(v string) *PrimaryKey { - s.Name = &v - return s -} - -// SetOffset sets the Offset field's value. -func (s *PrimaryKey) SetOffset(v int64) *PrimaryKey { - s.Offset = &v - return s -} - -// The supported properties for a PS type data set. -type PsAttributes struct { - _ struct{} `type:"structure"` - - // The character set encoding of the data set. - Encoding *string `locationName:"encoding" type:"string"` - - // The format of the data set records. - // - // Format is a required field - Format *string `locationName:"format" 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 PsAttributes) 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 PsAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PsAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PsAttributes"} - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncoding sets the Encoding field's value. -func (s *PsAttributes) SetEncoding(v string) *PsAttributes { - s.Encoding = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *PsAttributes) SetFormat(v string) *PsAttributes { - s.Format = &v - return s -} - -// The supported properties for a PS type data set. -type PsDetailAttributes struct { - _ struct{} `type:"structure"` - - // The character set encoding of the data set. - // - // Encoding is a required field - Encoding *string `locationName:"encoding" type:"string" required:"true"` - - // The format of the data set records. - // - // Format is a required field - Format *string `locationName:"format" 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 PsDetailAttributes) 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 PsDetailAttributes) GoString() string { - return s.String() -} - -// SetEncoding sets the Encoding field's value. -func (s *PsDetailAttributes) SetEncoding(v string) *PsDetailAttributes { - s.Encoding = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *PsDetailAttributes) SetFormat(v string) *PsDetailAttributes { - s.Format = &v - return s -} - -// The length of the records in the data set. -type RecordLength struct { - _ struct{} `type:"structure"` - - // The maximum record length. In case of fixed, both minimum and maximum are - // the same. - // - // Max is a required field - Max *int64 `locationName:"max" type:"integer" required:"true"` - - // The minimum record length of a record. - // - // Min is a required field - Min *int64 `locationName:"min" type:"integer" 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 RecordLength) 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 RecordLength) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RecordLength) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RecordLength"} - if s.Max == nil { - invalidParams.Add(request.NewErrParamRequired("Max")) - } - if s.Min == nil { - invalidParams.Add(request.NewErrParamRequired("Min")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMax sets the Max field's value. -func (s *RecordLength) SetMax(v int64) *RecordLength { - s.Max = &v - return s -} - -// SetMin sets the Min field's value. -func (s *RecordLength) SetMin(v int64) *RecordLength { - s.Min = &v - return s -} - -// The specified resource was not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the missing resource. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of the missing resource. - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A batch job identifier in which the batch jobs to run are identified by an -// Amazon S3 location. -type S3BatchJobIdentifier struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket that contains the batch job definitions. - // - // Bucket is a required field - Bucket *string `locationName:"bucket" type:"string" required:"true"` - - // Identifies the batch job definition. This identifier can also point to any - // batch job definition that already exists in the application or to one of - // the batch job definitions within the directory that is specified in keyPrefix. - // - // Identifier is a required field - Identifier *JobIdentifier `locationName:"identifier" type:"structure" required:"true"` - - // The key prefix that specifies the path to the folder in the S3 bucket that - // has the batch job definitions. - KeyPrefix *string `locationName:"keyPrefix" 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 S3BatchJobIdentifier) 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 S3BatchJobIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3BatchJobIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3BatchJobIdentifier"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *S3BatchJobIdentifier) SetBucket(v string) *S3BatchJobIdentifier { - s.Bucket = &v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *S3BatchJobIdentifier) SetIdentifier(v *JobIdentifier) *S3BatchJobIdentifier { - s.Identifier = v - return s -} - -// SetKeyPrefix sets the KeyPrefix field's value. -func (s *S3BatchJobIdentifier) SetKeyPrefix(v string) *S3BatchJobIdentifier { - s.KeyPrefix = &v - return s -} - -// A batch job definition contained in a script. -type ScriptBatchJobDefinition struct { - _ struct{} `type:"structure"` - - // The name of the script containing the batch job definition. - // - // ScriptName is a required field - ScriptName *string `locationName:"scriptName" 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 ScriptBatchJobDefinition) 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 ScriptBatchJobDefinition) GoString() string { - return s.String() -} - -// SetScriptName sets the ScriptName field's value. -func (s *ScriptBatchJobDefinition) SetScriptName(v string) *ScriptBatchJobDefinition { - s.ScriptName = &v - return s -} - -// A batch job identifier in which the batch job to run is identified by the -// script name. -type ScriptBatchJobIdentifier struct { - _ struct{} `type:"structure"` - - // The name of the script containing the batch job definition. - // - // ScriptName is a required field - ScriptName *string `locationName:"scriptName" 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 ScriptBatchJobIdentifier) 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 ScriptBatchJobIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScriptBatchJobIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScriptBatchJobIdentifier"} - if s.ScriptName == nil { - invalidParams.Add(request.NewErrParamRequired("ScriptName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetScriptName sets the ScriptName field's value. -func (s *ScriptBatchJobIdentifier) SetScriptName(v string) *ScriptBatchJobIdentifier { - s.ScriptName = &v - return s -} - -// One or more quotas for Amazon Web Services Mainframe Modernization exceeds -// the limit. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The identifier of the exceeded quota. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The ID of the resource that is exceeding the quota limit. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of resource that is exceeding the quota limit for Amazon Web Services - // Mainframe Modernization. - ResourceType *string `locationName:"resourceType" type:"string"` - - // A code that identifies the service that the exceeded quota belongs to. - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Server cannot process the request at the moment. -type ServiceUnavailableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceUnavailableException) 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 ServiceUnavailableException) GoString() string { - return s.String() -} - -func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { - return &ServiceUnavailableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceUnavailableException) Code() string { - return "ServiceUnavailableException" -} - -// Message returns the exception's message. -func (s *ServiceUnavailableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceUnavailableException) OrigErr() error { - return nil -} - -func (s *ServiceUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceUnavailableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceUnavailableException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartApplicationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the application you want to start. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" 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 StartApplicationInput) 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 StartApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *StartApplicationInput) SetApplicationId(v string) *StartApplicationInput { - s.ApplicationId = &v - return s -} - -type StartApplicationOutput 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 StartApplicationOutput) 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 StartApplicationOutput) GoString() string { - return s.String() -} - -type StartBatchJobInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the application associated with this batch job. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The unique identifier of the batch job. - // - // BatchJobIdentifier is a required field - BatchJobIdentifier *BatchJobIdentifier `locationName:"batchJobIdentifier" type:"structure" required:"true"` - - // The collection of batch job parameters. For details about limits for keys - // and values, see Coding variables in JCL (https://www.ibm.com/docs/en/workload-automation/9.3.0?topic=zos-coding-variables-in-jcl). - JobParams map[string]*string `locationName:"jobParams" type:"map"` -} - -// 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 StartBatchJobInput) 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 StartBatchJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartBatchJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartBatchJobInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.BatchJobIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("BatchJobIdentifier")) - } - if s.BatchJobIdentifier != nil { - if err := s.BatchJobIdentifier.Validate(); err != nil { - invalidParams.AddNested("BatchJobIdentifier", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *StartBatchJobInput) SetApplicationId(v string) *StartBatchJobInput { - s.ApplicationId = &v - return s -} - -// SetBatchJobIdentifier sets the BatchJobIdentifier field's value. -func (s *StartBatchJobInput) SetBatchJobIdentifier(v *BatchJobIdentifier) *StartBatchJobInput { - s.BatchJobIdentifier = v - return s -} - -// SetJobParams sets the JobParams field's value. -func (s *StartBatchJobInput) SetJobParams(v map[string]*string) *StartBatchJobInput { - s.JobParams = v - return s -} - -type StartBatchJobOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of this execution of the batch job. - // - // ExecutionId is a required field - ExecutionId *string `locationName:"executionId" 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 StartBatchJobOutput) 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 StartBatchJobOutput) GoString() string { - return s.String() -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *StartBatchJobOutput) SetExecutionId(v string) *StartBatchJobOutput { - s.ExecutionId = &v - return s -} - -type StopApplicationInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the application you want to stop. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // Stopping an application process can take a long time. Setting this parameter - // to true lets you force stop the application so you don't need to wait until - // the process finishes to apply another action on the application. The default - // value is false. - ForceStop *bool `locationName:"forceStop" type:"boolean"` -} - -// 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 StopApplicationInput) 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 StopApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *StopApplicationInput) SetApplicationId(v string) *StopApplicationInput { - s.ApplicationId = &v - return s -} - -// SetForceStop sets the ForceStop field's value. -func (s *StopApplicationInput) SetForceStop(v bool) *StopApplicationInput { - s.ForceStop = &v - return s -} - -type StopApplicationOutput 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 StopApplicationOutput) 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 StopApplicationOutput) GoString() string { - return s.String() -} - -// Defines the storage configuration for a runtime environment. -type StorageConfiguration struct { - _ struct{} `type:"structure"` - - // Defines the storage configuration for an Amazon EFS file system. - Efs *EfsStorageConfiguration `locationName:"efs" type:"structure"` - - // Defines the storage configuration for an Amazon FSx file system. - Fsx *FsxStorageConfiguration `locationName:"fsx" 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 StorageConfiguration) 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 StorageConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StorageConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StorageConfiguration"} - if s.Efs != nil { - if err := s.Efs.Validate(); err != nil { - invalidParams.AddNested("Efs", err.(request.ErrInvalidParams)) - } - } - if s.Fsx != nil { - if err := s.Fsx.Validate(); err != nil { - invalidParams.AddNested("Fsx", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEfs sets the Efs field's value. -func (s *StorageConfiguration) SetEfs(v *EfsStorageConfiguration) *StorageConfiguration { - s.Efs = v - return s -} - -// SetFsx sets the Fsx field's value. -func (s *StorageConfiguration) SetFsx(v *FsxStorageConfiguration) *StorageConfiguration { - s.Fsx = v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tags to add to the resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The number of requests made exceeds the limit. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The identifier of the throttled request. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The number of seconds to wait before retrying the request. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The identifier of the service that the throttled request was made to. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The keys of the tags to remove. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateApplicationInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the application you want to update. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" type:"string" required:"true"` - - // The current version of the application to update. - // - // CurrentApplicationVersion is a required field - CurrentApplicationVersion *int64 `locationName:"currentApplicationVersion" min:"1" type:"integer" required:"true"` - - // The application definition for this application. You can specify either inline - // JSON or an S3 bucket location. - Definition *Definition `locationName:"definition" type:"structure"` - - // The description of the application to update. - Description *string `locationName:"description" 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 UpdateApplicationInput) 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 UpdateApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.CurrentApplicationVersion == nil { - invalidParams.Add(request.NewErrParamRequired("CurrentApplicationVersion")) - } - if s.CurrentApplicationVersion != nil && *s.CurrentApplicationVersion < 1 { - invalidParams.Add(request.NewErrParamMinValue("CurrentApplicationVersion", 1)) - } - if s.Definition != nil { - if err := s.Definition.Validate(); err != nil { - invalidParams.AddNested("Definition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateApplicationInput) SetApplicationId(v string) *UpdateApplicationInput { - s.ApplicationId = &v - return s -} - -// SetCurrentApplicationVersion sets the CurrentApplicationVersion field's value. -func (s *UpdateApplicationInput) SetCurrentApplicationVersion(v int64) *UpdateApplicationInput { - s.CurrentApplicationVersion = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *UpdateApplicationInput) SetDefinition(v *Definition) *UpdateApplicationInput { - s.Definition = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateApplicationInput) SetDescription(v string) *UpdateApplicationInput { - s.Description = &v - return s -} - -type UpdateApplicationOutput struct { - _ struct{} `type:"structure"` - - // The new version of the application. - // - // ApplicationVersion is a required field - ApplicationVersion *int64 `locationName:"applicationVersion" min:"1" type:"integer" 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 UpdateApplicationOutput) 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 UpdateApplicationOutput) GoString() string { - return s.String() -} - -// SetApplicationVersion sets the ApplicationVersion field's value. -func (s *UpdateApplicationOutput) SetApplicationVersion(v int64) *UpdateApplicationOutput { - s.ApplicationVersion = &v - return s -} - -type UpdateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // Indicates whether to update the runtime environment during the maintenance - // window. The default is false. Currently, Amazon Web Services Mainframe Modernization - // accepts the engineVersion parameter only if applyDuringMaintenanceWindow - // is true. If any parameter other than engineVersion is provided in UpdateEnvironmentRequest, - // it will fail if applyDuringMaintenanceWindow is set to true. - ApplyDuringMaintenanceWindow *bool `locationName:"applyDuringMaintenanceWindow" type:"boolean"` - - // The desired capacity for the runtime environment to update. The minimum possible - // value is 0 and the maximum is 100. - DesiredCapacity *int64 `locationName:"desiredCapacity" type:"integer"` - - // The version of the runtime engine for the runtime environment. - EngineVersion *string `locationName:"engineVersion" type:"string"` - - // The unique identifier of the runtime environment that you want to update. - // - // EnvironmentId is a required field - EnvironmentId *string `location:"uri" locationName:"environmentId" type:"string" required:"true"` - - // Forces the updates on the environment. This option is needed if the applications - // in the environment are not stopped or if there are ongoing application-related - // activities in the environment. - // - // If you use this option, be aware that it could lead to data corruption in - // the applications, and that you might need to perform repair and recovery - // procedures for the applications. - // - // This option is not needed if the attribute being updated is preferredMaintenanceWindow. - ForceUpdate *bool `locationName:"forceUpdate" type:"boolean"` - - // The instance type for the runtime environment to update. - InstanceType *string `locationName:"instanceType" type:"string"` - - // Configures the maintenance window that you want for the runtime environment. - // The maintenance window must have the format ddd:hh24:mi-ddd:hh24:mi and must - // be less than 24 hours. The following two examples are valid maintenance windows: - // sun:23:45-mon:00:15 or sat:01:00-sat:03:00. - // - // If you do not provide a value, a random system-generated value will be assigned. - PreferredMaintenanceWindow *string `locationName:"preferredMaintenanceWindow" 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 UpdateEnvironmentInput) 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 UpdateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEnvironmentInput"} - if s.EnvironmentId == nil { - invalidParams.Add(request.NewErrParamRequired("EnvironmentId")) - } - if s.EnvironmentId != nil && len(*s.EnvironmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnvironmentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyDuringMaintenanceWindow sets the ApplyDuringMaintenanceWindow field's value. -func (s *UpdateEnvironmentInput) SetApplyDuringMaintenanceWindow(v bool) *UpdateEnvironmentInput { - s.ApplyDuringMaintenanceWindow = &v - return s -} - -// SetDesiredCapacity sets the DesiredCapacity field's value. -func (s *UpdateEnvironmentInput) SetDesiredCapacity(v int64) *UpdateEnvironmentInput { - s.DesiredCapacity = &v - return s -} - -// SetEngineVersion sets the EngineVersion field's value. -func (s *UpdateEnvironmentInput) SetEngineVersion(v string) *UpdateEnvironmentInput { - s.EngineVersion = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *UpdateEnvironmentInput) SetEnvironmentId(v string) *UpdateEnvironmentInput { - s.EnvironmentId = &v - return s -} - -// SetForceUpdate sets the ForceUpdate field's value. -func (s *UpdateEnvironmentInput) SetForceUpdate(v bool) *UpdateEnvironmentInput { - s.ForceUpdate = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *UpdateEnvironmentInput) SetInstanceType(v string) *UpdateEnvironmentInput { - s.InstanceType = &v - return s -} - -// SetPreferredMaintenanceWindow sets the PreferredMaintenanceWindow field's value. -func (s *UpdateEnvironmentInput) SetPreferredMaintenanceWindow(v string) *UpdateEnvironmentInput { - s.PreferredMaintenanceWindow = &v - return s -} - -type UpdateEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the runtime environment that was updated. - // - // EnvironmentId is a required field - EnvironmentId *string `locationName:"environmentId" 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 UpdateEnvironmentOutput) 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 UpdateEnvironmentOutput) GoString() string { - return s.String() -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *UpdateEnvironmentOutput) SetEnvironmentId(v string) *UpdateEnvironmentOutput { - s.EnvironmentId = &v - return s -} - -// One or more parameters provided in the request is not valid. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The list of fields that failed service validation. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason why it failed service validation. - Reason *string `locationName:"reason" type:"string" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about a validation exception field. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // The message of the exception field. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the exception field. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -// The attributes of a VSAM type data set. -type VsamAttributes struct { - _ struct{} `type:"structure"` - - // The alternate key definitions, if any. A legacy dataset might not have any - // alternate key defined, but if those alternate keys definitions exist, provide - // them as some applications will make use of them. - AlternateKeys []*AlternateKey `locationName:"alternateKeys" type:"list"` - - // Indicates whether indexes for this dataset are stored as compressed values. - // If you have a large data set (typically > 100 Mb), consider setting this - // flag to True. - Compressed *bool `locationName:"compressed" type:"boolean"` - - // The character set used by the data set. Can be ASCII, EBCDIC, or unknown. - Encoding *string `locationName:"encoding" type:"string"` - - // The record format of the data set. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true"` - - // The primary key of the data set. - PrimaryKey *PrimaryKey `locationName:"primaryKey" 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 VsamAttributes) 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 VsamAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VsamAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VsamAttributes"} - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.AlternateKeys != nil { - for i, v := range s.AlternateKeys { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AlternateKeys", i), err.(request.ErrInvalidParams)) - } - } - } - if s.PrimaryKey != nil { - if err := s.PrimaryKey.Validate(); err != nil { - invalidParams.AddNested("PrimaryKey", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlternateKeys sets the AlternateKeys field's value. -func (s *VsamAttributes) SetAlternateKeys(v []*AlternateKey) *VsamAttributes { - s.AlternateKeys = v - return s -} - -// SetCompressed sets the Compressed field's value. -func (s *VsamAttributes) SetCompressed(v bool) *VsamAttributes { - s.Compressed = &v - return s -} - -// SetEncoding sets the Encoding field's value. -func (s *VsamAttributes) SetEncoding(v string) *VsamAttributes { - s.Encoding = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *VsamAttributes) SetFormat(v string) *VsamAttributes { - s.Format = &v - return s -} - -// SetPrimaryKey sets the PrimaryKey field's value. -func (s *VsamAttributes) SetPrimaryKey(v *PrimaryKey) *VsamAttributes { - s.PrimaryKey = v - return s -} - -// The attributes of a VSAM type data set. -type VsamDetailAttributes struct { - _ struct{} `type:"structure"` - - // The alternate key definitions, if any. A legacy dataset might not have any - // alternate key defined, but if those alternate keys definitions exist, provide - // them as some applications will make use of them. - AlternateKeys []*AlternateKey `locationName:"alternateKeys" type:"list"` - - // If set to True, enforces loading the data set into cache before it’s used - // by the application. - CacheAtStartup *bool `locationName:"cacheAtStartup" type:"boolean"` - - // Indicates whether indexes for this dataset are stored as compressed values. - // If you have a large data set (typically > 100 Mb), consider setting this - // flag to True. - Compressed *bool `locationName:"compressed" type:"boolean"` - - // The character set used by the data set. Can be ASCII, EBCDIC, or unknown. - Encoding *string `locationName:"encoding" type:"string"` - - // The primary key of the data set. - PrimaryKey *PrimaryKey `locationName:"primaryKey" type:"structure"` - - // The record format of the data set. - RecordFormat *string `locationName:"recordFormat" 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 VsamDetailAttributes) 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 VsamDetailAttributes) GoString() string { - return s.String() -} - -// SetAlternateKeys sets the AlternateKeys field's value. -func (s *VsamDetailAttributes) SetAlternateKeys(v []*AlternateKey) *VsamDetailAttributes { - s.AlternateKeys = v - return s -} - -// SetCacheAtStartup sets the CacheAtStartup field's value. -func (s *VsamDetailAttributes) SetCacheAtStartup(v bool) *VsamDetailAttributes { - s.CacheAtStartup = &v - return s -} - -// SetCompressed sets the Compressed field's value. -func (s *VsamDetailAttributes) SetCompressed(v bool) *VsamDetailAttributes { - s.Compressed = &v - return s -} - -// SetEncoding sets the Encoding field's value. -func (s *VsamDetailAttributes) SetEncoding(v string) *VsamDetailAttributes { - s.Encoding = &v - return s -} - -// SetPrimaryKey sets the PrimaryKey field's value. -func (s *VsamDetailAttributes) SetPrimaryKey(v *PrimaryKey) *VsamDetailAttributes { - s.PrimaryKey = v - return s -} - -// SetRecordFormat sets the RecordFormat field's value. -func (s *VsamDetailAttributes) SetRecordFormat(v string) *VsamDetailAttributes { - s.RecordFormat = &v - return s -} - -const ( - // ApplicationDeploymentLifecycleDeploying is a ApplicationDeploymentLifecycle enum value - ApplicationDeploymentLifecycleDeploying = "Deploying" - - // ApplicationDeploymentLifecycleDeployed is a ApplicationDeploymentLifecycle enum value - ApplicationDeploymentLifecycleDeployed = "Deployed" -) - -// ApplicationDeploymentLifecycle_Values returns all elements of the ApplicationDeploymentLifecycle enum -func ApplicationDeploymentLifecycle_Values() []string { - return []string{ - ApplicationDeploymentLifecycleDeploying, - ApplicationDeploymentLifecycleDeployed, - } -} - -const ( - // ApplicationLifecycleCreating is a ApplicationLifecycle enum value - ApplicationLifecycleCreating = "Creating" - - // ApplicationLifecycleCreated is a ApplicationLifecycle enum value - ApplicationLifecycleCreated = "Created" - - // ApplicationLifecycleAvailable is a ApplicationLifecycle enum value - ApplicationLifecycleAvailable = "Available" - - // ApplicationLifecycleReady is a ApplicationLifecycle enum value - ApplicationLifecycleReady = "Ready" - - // ApplicationLifecycleStarting is a ApplicationLifecycle enum value - ApplicationLifecycleStarting = "Starting" - - // ApplicationLifecycleRunning is a ApplicationLifecycle enum value - ApplicationLifecycleRunning = "Running" - - // ApplicationLifecycleStopping is a ApplicationLifecycle enum value - ApplicationLifecycleStopping = "Stopping" - - // ApplicationLifecycleStopped is a ApplicationLifecycle enum value - ApplicationLifecycleStopped = "Stopped" - - // ApplicationLifecycleFailed is a ApplicationLifecycle enum value - ApplicationLifecycleFailed = "Failed" - - // ApplicationLifecycleDeleting is a ApplicationLifecycle enum value - ApplicationLifecycleDeleting = "Deleting" - - // ApplicationLifecycleDeletingFromEnvironment is a ApplicationLifecycle enum value - ApplicationLifecycleDeletingFromEnvironment = "Deleting From Environment" -) - -// ApplicationLifecycle_Values returns all elements of the ApplicationLifecycle enum -func ApplicationLifecycle_Values() []string { - return []string{ - ApplicationLifecycleCreating, - ApplicationLifecycleCreated, - ApplicationLifecycleAvailable, - ApplicationLifecycleReady, - ApplicationLifecycleStarting, - ApplicationLifecycleRunning, - ApplicationLifecycleStopping, - ApplicationLifecycleStopped, - ApplicationLifecycleFailed, - ApplicationLifecycleDeleting, - ApplicationLifecycleDeletingFromEnvironment, - } -} - -const ( - // ApplicationVersionLifecycleCreating is a ApplicationVersionLifecycle enum value - ApplicationVersionLifecycleCreating = "Creating" - - // ApplicationVersionLifecycleAvailable is a ApplicationVersionLifecycle enum value - ApplicationVersionLifecycleAvailable = "Available" - - // ApplicationVersionLifecycleFailed is a ApplicationVersionLifecycle enum value - ApplicationVersionLifecycleFailed = "Failed" -) - -// ApplicationVersionLifecycle_Values returns all elements of the ApplicationVersionLifecycle enum -func ApplicationVersionLifecycle_Values() []string { - return []string{ - ApplicationVersionLifecycleCreating, - ApplicationVersionLifecycleAvailable, - ApplicationVersionLifecycleFailed, - } -} - -const ( - // BatchJobExecutionStatusSubmitting is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusSubmitting = "Submitting" - - // BatchJobExecutionStatusHolding is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusHolding = "Holding" - - // BatchJobExecutionStatusDispatching is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusDispatching = "Dispatching" - - // BatchJobExecutionStatusRunning is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusRunning = "Running" - - // BatchJobExecutionStatusCancelling is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusCancelling = "Cancelling" - - // BatchJobExecutionStatusCancelled is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusCancelled = "Cancelled" - - // BatchJobExecutionStatusSucceeded is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusSucceeded = "Succeeded" - - // BatchJobExecutionStatusFailed is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusFailed = "Failed" - - // BatchJobExecutionStatusSucceededWithWarning is a BatchJobExecutionStatus enum value - BatchJobExecutionStatusSucceededWithWarning = "Succeeded With Warning" -) - -// BatchJobExecutionStatus_Values returns all elements of the BatchJobExecutionStatus enum -func BatchJobExecutionStatus_Values() []string { - return []string{ - BatchJobExecutionStatusSubmitting, - BatchJobExecutionStatusHolding, - BatchJobExecutionStatusDispatching, - BatchJobExecutionStatusRunning, - BatchJobExecutionStatusCancelling, - BatchJobExecutionStatusCancelled, - BatchJobExecutionStatusSucceeded, - BatchJobExecutionStatusFailed, - BatchJobExecutionStatusSucceededWithWarning, - } -} - -const ( - // BatchJobTypeVse is a BatchJobType enum value - BatchJobTypeVse = "VSE" - - // BatchJobTypeJes2 is a BatchJobType enum value - BatchJobTypeJes2 = "JES2" - - // BatchJobTypeJes3 is a BatchJobType enum value - BatchJobTypeJes3 = "JES3" -) - -// BatchJobType_Values returns all elements of the BatchJobType enum -func BatchJobType_Values() []string { - return []string{ - BatchJobTypeVse, - BatchJobTypeJes2, - BatchJobTypeJes3, - } -} - -const ( - // DataSetTaskLifecycleCreating is a DataSetTaskLifecycle enum value - DataSetTaskLifecycleCreating = "Creating" - - // DataSetTaskLifecycleRunning is a DataSetTaskLifecycle enum value - DataSetTaskLifecycleRunning = "Running" - - // DataSetTaskLifecycleCompleted is a DataSetTaskLifecycle enum value - DataSetTaskLifecycleCompleted = "Completed" - - // DataSetTaskLifecycleFailed is a DataSetTaskLifecycle enum value - DataSetTaskLifecycleFailed = "Failed" -) - -// DataSetTaskLifecycle_Values returns all elements of the DataSetTaskLifecycle enum -func DataSetTaskLifecycle_Values() []string { - return []string{ - DataSetTaskLifecycleCreating, - DataSetTaskLifecycleRunning, - DataSetTaskLifecycleCompleted, - DataSetTaskLifecycleFailed, - } -} - -const ( - // DeploymentLifecycleDeploying is a DeploymentLifecycle enum value - DeploymentLifecycleDeploying = "Deploying" - - // DeploymentLifecycleSucceeded is a DeploymentLifecycle enum value - DeploymentLifecycleSucceeded = "Succeeded" - - // DeploymentLifecycleFailed is a DeploymentLifecycle enum value - DeploymentLifecycleFailed = "Failed" - - // DeploymentLifecycleUpdatingDeployment is a DeploymentLifecycle enum value - DeploymentLifecycleUpdatingDeployment = "Updating Deployment" -) - -// DeploymentLifecycle_Values returns all elements of the DeploymentLifecycle enum -func DeploymentLifecycle_Values() []string { - return []string{ - DeploymentLifecycleDeploying, - DeploymentLifecycleSucceeded, - DeploymentLifecycleFailed, - DeploymentLifecycleUpdatingDeployment, - } -} - -const ( - // EngineTypeMicrofocus is a EngineType enum value - EngineTypeMicrofocus = "microfocus" - - // EngineTypeBluage is a EngineType enum value - EngineTypeBluage = "bluage" -) - -// EngineType_Values returns all elements of the EngineType enum -func EngineType_Values() []string { - return []string{ - EngineTypeMicrofocus, - EngineTypeBluage, - } -} - -const ( - // EnvironmentLifecycleCreating is a EnvironmentLifecycle enum value - EnvironmentLifecycleCreating = "Creating" - - // EnvironmentLifecycleAvailable is a EnvironmentLifecycle enum value - EnvironmentLifecycleAvailable = "Available" - - // EnvironmentLifecycleUpdating is a EnvironmentLifecycle enum value - EnvironmentLifecycleUpdating = "Updating" - - // EnvironmentLifecycleDeleting is a EnvironmentLifecycle enum value - EnvironmentLifecycleDeleting = "Deleting" - - // EnvironmentLifecycleFailed is a EnvironmentLifecycle enum value - EnvironmentLifecycleFailed = "Failed" -) - -// EnvironmentLifecycle_Values returns all elements of the EnvironmentLifecycle enum -func EnvironmentLifecycle_Values() []string { - return []string{ - EnvironmentLifecycleCreating, - EnvironmentLifecycleAvailable, - EnvironmentLifecycleUpdating, - EnvironmentLifecycleDeleting, - EnvironmentLifecycleFailed, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/doc.go deleted file mode 100644 index 301d79a9881b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/doc.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package m2 provides the client and types for making API -// requests to AWSMainframeModernization. -// -// Amazon Web Services Mainframe Modernization provides tools and resources -// to help you plan and implement migration and modernization from mainframes -// to Amazon Web Services managed runtime environments. It provides tools for -// analyzing existing mainframe applications, developing or updating mainframe -// applications using COBOL or PL/I, and implementing an automated pipeline -// for continuous integration and continuous delivery (CI/CD) of the applications. -// -// See https://docs.aws.amazon.com/goto/WebAPI/m2-2021-04-28 for more information on this service. -// -// See m2 package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/m2/ -// -// # Using the Client -// -// To contact AWSMainframeModernization with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWSMainframeModernization client M2 for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/m2/#New -package m2 diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/errors.go deleted file mode 100644 index 655817f3b9fc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/errors.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package m2 - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // The account or role doesn't have the right permissions to make the request. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The parameters provided in the request conflict with existing resources. - ErrCodeConflictException = "ConflictException" - - // ErrCodeExecutionTimeoutException for service response error code - // "ExecutionTimeoutException". - // - // Failed to connect to server, or didn’t receive response within expected - // time period. - ErrCodeExecutionTimeoutException = "ExecutionTimeoutException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An unexpected error occurred during the processing of the request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // One or more quotas for Amazon Web Services Mainframe Modernization exceeds - // the limit. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - // - // Server cannot process the request at the moment. - ErrCodeServiceUnavailableException = "ServiceUnavailableException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The number of requests made exceeds the limit. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // One or more parameters provided in the request is not valid. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "ExecutionTimeoutException": newErrorExecutionTimeoutException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ServiceUnavailableException": newErrorServiceUnavailableException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/m2iface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/m2iface/interface.go deleted file mode 100644 index 1dc73cbb3d93..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/m2iface/interface.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package m2iface provides an interface to enable mocking the AWSMainframeModernization service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package m2iface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2" -) - -// M2API provides an interface to enable mocking the -// m2.M2 service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWSMainframeModernization. -// func myFunc(svc m2iface.M2API) bool { -// // Make svc.CancelBatchJobExecution request -// } -// -// func main() { -// sess := session.New() -// svc := m2.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockM2Client struct { -// m2iface.M2API -// } -// func (m *mockM2Client) CancelBatchJobExecution(input *m2.CancelBatchJobExecutionInput) (*m2.CancelBatchJobExecutionOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockM2Client{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type M2API interface { - CancelBatchJobExecution(*m2.CancelBatchJobExecutionInput) (*m2.CancelBatchJobExecutionOutput, error) - CancelBatchJobExecutionWithContext(aws.Context, *m2.CancelBatchJobExecutionInput, ...request.Option) (*m2.CancelBatchJobExecutionOutput, error) - CancelBatchJobExecutionRequest(*m2.CancelBatchJobExecutionInput) (*request.Request, *m2.CancelBatchJobExecutionOutput) - - CreateApplication(*m2.CreateApplicationInput) (*m2.CreateApplicationOutput, error) - CreateApplicationWithContext(aws.Context, *m2.CreateApplicationInput, ...request.Option) (*m2.CreateApplicationOutput, error) - CreateApplicationRequest(*m2.CreateApplicationInput) (*request.Request, *m2.CreateApplicationOutput) - - CreateDataSetImportTask(*m2.CreateDataSetImportTaskInput) (*m2.CreateDataSetImportTaskOutput, error) - CreateDataSetImportTaskWithContext(aws.Context, *m2.CreateDataSetImportTaskInput, ...request.Option) (*m2.CreateDataSetImportTaskOutput, error) - CreateDataSetImportTaskRequest(*m2.CreateDataSetImportTaskInput) (*request.Request, *m2.CreateDataSetImportTaskOutput) - - CreateDeployment(*m2.CreateDeploymentInput) (*m2.CreateDeploymentOutput, error) - CreateDeploymentWithContext(aws.Context, *m2.CreateDeploymentInput, ...request.Option) (*m2.CreateDeploymentOutput, error) - CreateDeploymentRequest(*m2.CreateDeploymentInput) (*request.Request, *m2.CreateDeploymentOutput) - - CreateEnvironment(*m2.CreateEnvironmentInput) (*m2.CreateEnvironmentOutput, error) - CreateEnvironmentWithContext(aws.Context, *m2.CreateEnvironmentInput, ...request.Option) (*m2.CreateEnvironmentOutput, error) - CreateEnvironmentRequest(*m2.CreateEnvironmentInput) (*request.Request, *m2.CreateEnvironmentOutput) - - DeleteApplication(*m2.DeleteApplicationInput) (*m2.DeleteApplicationOutput, error) - DeleteApplicationWithContext(aws.Context, *m2.DeleteApplicationInput, ...request.Option) (*m2.DeleteApplicationOutput, error) - DeleteApplicationRequest(*m2.DeleteApplicationInput) (*request.Request, *m2.DeleteApplicationOutput) - - DeleteApplicationFromEnvironment(*m2.DeleteApplicationFromEnvironmentInput) (*m2.DeleteApplicationFromEnvironmentOutput, error) - DeleteApplicationFromEnvironmentWithContext(aws.Context, *m2.DeleteApplicationFromEnvironmentInput, ...request.Option) (*m2.DeleteApplicationFromEnvironmentOutput, error) - DeleteApplicationFromEnvironmentRequest(*m2.DeleteApplicationFromEnvironmentInput) (*request.Request, *m2.DeleteApplicationFromEnvironmentOutput) - - DeleteEnvironment(*m2.DeleteEnvironmentInput) (*m2.DeleteEnvironmentOutput, error) - DeleteEnvironmentWithContext(aws.Context, *m2.DeleteEnvironmentInput, ...request.Option) (*m2.DeleteEnvironmentOutput, error) - DeleteEnvironmentRequest(*m2.DeleteEnvironmentInput) (*request.Request, *m2.DeleteEnvironmentOutput) - - GetApplication(*m2.GetApplicationInput) (*m2.GetApplicationOutput, error) - GetApplicationWithContext(aws.Context, *m2.GetApplicationInput, ...request.Option) (*m2.GetApplicationOutput, error) - GetApplicationRequest(*m2.GetApplicationInput) (*request.Request, *m2.GetApplicationOutput) - - GetApplicationVersion(*m2.GetApplicationVersionInput) (*m2.GetApplicationVersionOutput, error) - GetApplicationVersionWithContext(aws.Context, *m2.GetApplicationVersionInput, ...request.Option) (*m2.GetApplicationVersionOutput, error) - GetApplicationVersionRequest(*m2.GetApplicationVersionInput) (*request.Request, *m2.GetApplicationVersionOutput) - - GetBatchJobExecution(*m2.GetBatchJobExecutionInput) (*m2.GetBatchJobExecutionOutput, error) - GetBatchJobExecutionWithContext(aws.Context, *m2.GetBatchJobExecutionInput, ...request.Option) (*m2.GetBatchJobExecutionOutput, error) - GetBatchJobExecutionRequest(*m2.GetBatchJobExecutionInput) (*request.Request, *m2.GetBatchJobExecutionOutput) - - GetDataSetDetails(*m2.GetDataSetDetailsInput) (*m2.GetDataSetDetailsOutput, error) - GetDataSetDetailsWithContext(aws.Context, *m2.GetDataSetDetailsInput, ...request.Option) (*m2.GetDataSetDetailsOutput, error) - GetDataSetDetailsRequest(*m2.GetDataSetDetailsInput) (*request.Request, *m2.GetDataSetDetailsOutput) - - GetDataSetImportTask(*m2.GetDataSetImportTaskInput) (*m2.GetDataSetImportTaskOutput, error) - GetDataSetImportTaskWithContext(aws.Context, *m2.GetDataSetImportTaskInput, ...request.Option) (*m2.GetDataSetImportTaskOutput, error) - GetDataSetImportTaskRequest(*m2.GetDataSetImportTaskInput) (*request.Request, *m2.GetDataSetImportTaskOutput) - - GetDeployment(*m2.GetDeploymentInput) (*m2.GetDeploymentOutput, error) - GetDeploymentWithContext(aws.Context, *m2.GetDeploymentInput, ...request.Option) (*m2.GetDeploymentOutput, error) - GetDeploymentRequest(*m2.GetDeploymentInput) (*request.Request, *m2.GetDeploymentOutput) - - GetEnvironment(*m2.GetEnvironmentInput) (*m2.GetEnvironmentOutput, error) - GetEnvironmentWithContext(aws.Context, *m2.GetEnvironmentInput, ...request.Option) (*m2.GetEnvironmentOutput, error) - GetEnvironmentRequest(*m2.GetEnvironmentInput) (*request.Request, *m2.GetEnvironmentOutput) - - GetSignedBluinsightsUrl(*m2.GetSignedBluinsightsUrlInput) (*m2.GetSignedBluinsightsUrlOutput, error) - GetSignedBluinsightsUrlWithContext(aws.Context, *m2.GetSignedBluinsightsUrlInput, ...request.Option) (*m2.GetSignedBluinsightsUrlOutput, error) - GetSignedBluinsightsUrlRequest(*m2.GetSignedBluinsightsUrlInput) (*request.Request, *m2.GetSignedBluinsightsUrlOutput) - - ListApplicationVersions(*m2.ListApplicationVersionsInput) (*m2.ListApplicationVersionsOutput, error) - ListApplicationVersionsWithContext(aws.Context, *m2.ListApplicationVersionsInput, ...request.Option) (*m2.ListApplicationVersionsOutput, error) - ListApplicationVersionsRequest(*m2.ListApplicationVersionsInput) (*request.Request, *m2.ListApplicationVersionsOutput) - - ListApplicationVersionsPages(*m2.ListApplicationVersionsInput, func(*m2.ListApplicationVersionsOutput, bool) bool) error - ListApplicationVersionsPagesWithContext(aws.Context, *m2.ListApplicationVersionsInput, func(*m2.ListApplicationVersionsOutput, bool) bool, ...request.Option) error - - ListApplications(*m2.ListApplicationsInput) (*m2.ListApplicationsOutput, error) - ListApplicationsWithContext(aws.Context, *m2.ListApplicationsInput, ...request.Option) (*m2.ListApplicationsOutput, error) - ListApplicationsRequest(*m2.ListApplicationsInput) (*request.Request, *m2.ListApplicationsOutput) - - ListApplicationsPages(*m2.ListApplicationsInput, func(*m2.ListApplicationsOutput, bool) bool) error - ListApplicationsPagesWithContext(aws.Context, *m2.ListApplicationsInput, func(*m2.ListApplicationsOutput, bool) bool, ...request.Option) error - - ListBatchJobDefinitions(*m2.ListBatchJobDefinitionsInput) (*m2.ListBatchJobDefinitionsOutput, error) - ListBatchJobDefinitionsWithContext(aws.Context, *m2.ListBatchJobDefinitionsInput, ...request.Option) (*m2.ListBatchJobDefinitionsOutput, error) - ListBatchJobDefinitionsRequest(*m2.ListBatchJobDefinitionsInput) (*request.Request, *m2.ListBatchJobDefinitionsOutput) - - ListBatchJobDefinitionsPages(*m2.ListBatchJobDefinitionsInput, func(*m2.ListBatchJobDefinitionsOutput, bool) bool) error - ListBatchJobDefinitionsPagesWithContext(aws.Context, *m2.ListBatchJobDefinitionsInput, func(*m2.ListBatchJobDefinitionsOutput, bool) bool, ...request.Option) error - - ListBatchJobExecutions(*m2.ListBatchJobExecutionsInput) (*m2.ListBatchJobExecutionsOutput, error) - ListBatchJobExecutionsWithContext(aws.Context, *m2.ListBatchJobExecutionsInput, ...request.Option) (*m2.ListBatchJobExecutionsOutput, error) - ListBatchJobExecutionsRequest(*m2.ListBatchJobExecutionsInput) (*request.Request, *m2.ListBatchJobExecutionsOutput) - - ListBatchJobExecutionsPages(*m2.ListBatchJobExecutionsInput, func(*m2.ListBatchJobExecutionsOutput, bool) bool) error - ListBatchJobExecutionsPagesWithContext(aws.Context, *m2.ListBatchJobExecutionsInput, func(*m2.ListBatchJobExecutionsOutput, bool) bool, ...request.Option) error - - ListDataSetImportHistory(*m2.ListDataSetImportHistoryInput) (*m2.ListDataSetImportHistoryOutput, error) - ListDataSetImportHistoryWithContext(aws.Context, *m2.ListDataSetImportHistoryInput, ...request.Option) (*m2.ListDataSetImportHistoryOutput, error) - ListDataSetImportHistoryRequest(*m2.ListDataSetImportHistoryInput) (*request.Request, *m2.ListDataSetImportHistoryOutput) - - ListDataSetImportHistoryPages(*m2.ListDataSetImportHistoryInput, func(*m2.ListDataSetImportHistoryOutput, bool) bool) error - ListDataSetImportHistoryPagesWithContext(aws.Context, *m2.ListDataSetImportHistoryInput, func(*m2.ListDataSetImportHistoryOutput, bool) bool, ...request.Option) error - - ListDataSets(*m2.ListDataSetsInput) (*m2.ListDataSetsOutput, error) - ListDataSetsWithContext(aws.Context, *m2.ListDataSetsInput, ...request.Option) (*m2.ListDataSetsOutput, error) - ListDataSetsRequest(*m2.ListDataSetsInput) (*request.Request, *m2.ListDataSetsOutput) - - ListDataSetsPages(*m2.ListDataSetsInput, func(*m2.ListDataSetsOutput, bool) bool) error - ListDataSetsPagesWithContext(aws.Context, *m2.ListDataSetsInput, func(*m2.ListDataSetsOutput, bool) bool, ...request.Option) error - - ListDeployments(*m2.ListDeploymentsInput) (*m2.ListDeploymentsOutput, error) - ListDeploymentsWithContext(aws.Context, *m2.ListDeploymentsInput, ...request.Option) (*m2.ListDeploymentsOutput, error) - ListDeploymentsRequest(*m2.ListDeploymentsInput) (*request.Request, *m2.ListDeploymentsOutput) - - ListDeploymentsPages(*m2.ListDeploymentsInput, func(*m2.ListDeploymentsOutput, bool) bool) error - ListDeploymentsPagesWithContext(aws.Context, *m2.ListDeploymentsInput, func(*m2.ListDeploymentsOutput, bool) bool, ...request.Option) error - - ListEngineVersions(*m2.ListEngineVersionsInput) (*m2.ListEngineVersionsOutput, error) - ListEngineVersionsWithContext(aws.Context, *m2.ListEngineVersionsInput, ...request.Option) (*m2.ListEngineVersionsOutput, error) - ListEngineVersionsRequest(*m2.ListEngineVersionsInput) (*request.Request, *m2.ListEngineVersionsOutput) - - ListEngineVersionsPages(*m2.ListEngineVersionsInput, func(*m2.ListEngineVersionsOutput, bool) bool) error - ListEngineVersionsPagesWithContext(aws.Context, *m2.ListEngineVersionsInput, func(*m2.ListEngineVersionsOutput, bool) bool, ...request.Option) error - - ListEnvironments(*m2.ListEnvironmentsInput) (*m2.ListEnvironmentsOutput, error) - ListEnvironmentsWithContext(aws.Context, *m2.ListEnvironmentsInput, ...request.Option) (*m2.ListEnvironmentsOutput, error) - ListEnvironmentsRequest(*m2.ListEnvironmentsInput) (*request.Request, *m2.ListEnvironmentsOutput) - - ListEnvironmentsPages(*m2.ListEnvironmentsInput, func(*m2.ListEnvironmentsOutput, bool) bool) error - ListEnvironmentsPagesWithContext(aws.Context, *m2.ListEnvironmentsInput, func(*m2.ListEnvironmentsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*m2.ListTagsForResourceInput) (*m2.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *m2.ListTagsForResourceInput, ...request.Option) (*m2.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*m2.ListTagsForResourceInput) (*request.Request, *m2.ListTagsForResourceOutput) - - StartApplication(*m2.StartApplicationInput) (*m2.StartApplicationOutput, error) - StartApplicationWithContext(aws.Context, *m2.StartApplicationInput, ...request.Option) (*m2.StartApplicationOutput, error) - StartApplicationRequest(*m2.StartApplicationInput) (*request.Request, *m2.StartApplicationOutput) - - StartBatchJob(*m2.StartBatchJobInput) (*m2.StartBatchJobOutput, error) - StartBatchJobWithContext(aws.Context, *m2.StartBatchJobInput, ...request.Option) (*m2.StartBatchJobOutput, error) - StartBatchJobRequest(*m2.StartBatchJobInput) (*request.Request, *m2.StartBatchJobOutput) - - StopApplication(*m2.StopApplicationInput) (*m2.StopApplicationOutput, error) - StopApplicationWithContext(aws.Context, *m2.StopApplicationInput, ...request.Option) (*m2.StopApplicationOutput, error) - StopApplicationRequest(*m2.StopApplicationInput) (*request.Request, *m2.StopApplicationOutput) - - TagResource(*m2.TagResourceInput) (*m2.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *m2.TagResourceInput, ...request.Option) (*m2.TagResourceOutput, error) - TagResourceRequest(*m2.TagResourceInput) (*request.Request, *m2.TagResourceOutput) - - UntagResource(*m2.UntagResourceInput) (*m2.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *m2.UntagResourceInput, ...request.Option) (*m2.UntagResourceOutput, error) - UntagResourceRequest(*m2.UntagResourceInput) (*request.Request, *m2.UntagResourceOutput) - - UpdateApplication(*m2.UpdateApplicationInput) (*m2.UpdateApplicationOutput, error) - UpdateApplicationWithContext(aws.Context, *m2.UpdateApplicationInput, ...request.Option) (*m2.UpdateApplicationOutput, error) - UpdateApplicationRequest(*m2.UpdateApplicationInput) (*request.Request, *m2.UpdateApplicationOutput) - - UpdateEnvironment(*m2.UpdateEnvironmentInput) (*m2.UpdateEnvironmentOutput, error) - UpdateEnvironmentWithContext(aws.Context, *m2.UpdateEnvironmentInput, ...request.Option) (*m2.UpdateEnvironmentOutput, error) - UpdateEnvironmentRequest(*m2.UpdateEnvironmentInput) (*request.Request, *m2.UpdateEnvironmentOutput) -} - -var _ M2API = (*m2.M2)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/service.go deleted file mode 100644 index 4163d43a229f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/m2/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package m2 - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// M2 provides the API operation methods for making requests to -// AWSMainframeModernization. See this package's package overview docs -// for details on the service. -// -// M2 methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type M2 struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "m2" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "m2" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the M2 client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a M2 client from just a session. -// svc := m2.New(mySession) -// -// // Create a M2 client with additional configuration -// svc := m2.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *M2 { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "m2" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *M2 { - svc := &M2{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-04-28", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a M2 operation and runs any -// custom request initialization. -func (c *M2) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/macie2/waiters.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/macie2/waiters.go deleted file mode 100644 index b0e3117f2fb7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/macie2/waiters.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package macie2 - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" -) - -// WaitUntilFindingRevealed uses the Amazon Macie 2 API operation -// GetSensitiveDataOccurrences to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Macie2) WaitUntilFindingRevealed(input *GetSensitiveDataOccurrencesInput) error { - return c.WaitUntilFindingRevealedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilFindingRevealedWithContext is an extended version of WaitUntilFindingRevealed. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Macie2) WaitUntilFindingRevealedWithContext(ctx aws.Context, input *GetSensitiveDataOccurrencesInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilFindingRevealed", - MaxAttempts: 60, - Delay: request.ConstantWaiterDelay(2 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "SUCCESS", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "ERROR", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetSensitiveDataOccurrencesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetSensitiveDataOccurrencesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/api.go deleted file mode 100644 index 35a999128192..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/api.go +++ /dev/null @@ -1,4004 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package managedblockchainquery - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opBatchGetTokenBalance = "BatchGetTokenBalance" - -// BatchGetTokenBalanceRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetTokenBalance 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 BatchGetTokenBalance for more information on using the BatchGetTokenBalance -// 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 BatchGetTokenBalanceRequest method. -// req, resp := client.BatchGetTokenBalanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/BatchGetTokenBalance -func (c *ManagedBlockchainQuery) BatchGetTokenBalanceRequest(input *BatchGetTokenBalanceInput) (req *request.Request, output *BatchGetTokenBalanceOutput) { - op := &request.Operation{ - Name: opBatchGetTokenBalance, - HTTPMethod: "POST", - HTTPPath: "/batch-get-token-balance", - } - - if input == nil { - input = &BatchGetTokenBalanceInput{} - } - - output = &BatchGetTokenBalanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetTokenBalance API operation for Amazon Managed Blockchain Query. -// -// Gets the token balance for a batch of tokens by using the BatchGetTokenBalance -// action for every token in the request. -// -// Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token -// standards are supported. -// -// 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 Managed Blockchain Query's -// API operation BatchGetTokenBalance for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -// -// - ValidationException -// The resource passed is invalid. -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// The Amazon Web Services account doesn’t have access to this resource. -// -// - InternalServerException -// The request processing has failed because of an internal error in the service. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded for this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/BatchGetTokenBalance -func (c *ManagedBlockchainQuery) BatchGetTokenBalance(input *BatchGetTokenBalanceInput) (*BatchGetTokenBalanceOutput, error) { - req, out := c.BatchGetTokenBalanceRequest(input) - return out, req.Send() -} - -// BatchGetTokenBalanceWithContext is the same as BatchGetTokenBalance with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetTokenBalance 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 *ManagedBlockchainQuery) BatchGetTokenBalanceWithContext(ctx aws.Context, input *BatchGetTokenBalanceInput, opts ...request.Option) (*BatchGetTokenBalanceOutput, error) { - req, out := c.BatchGetTokenBalanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAssetContract = "GetAssetContract" - -// GetAssetContractRequest generates a "aws/request.Request" representing the -// client's request for the GetAssetContract 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 GetAssetContract for more information on using the GetAssetContract -// 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 GetAssetContractRequest method. -// req, resp := client.GetAssetContractRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetAssetContract -func (c *ManagedBlockchainQuery) GetAssetContractRequest(input *GetAssetContractInput) (req *request.Request, output *GetAssetContractOutput) { - op := &request.Operation{ - Name: opGetAssetContract, - HTTPMethod: "POST", - HTTPPath: "/get-asset-contract", - } - - if input == nil { - input = &GetAssetContractInput{} - } - - output = &GetAssetContractOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAssetContract API operation for Amazon Managed Blockchain Query. -// -// Gets the information about a specific contract deployed on the blockchain. -// -// - The Bitcoin blockchain networks do not support this operation. -// -// - Metadata is currently only available for some ERC-20 contracts. Metadata -// will be available for additional contracts in the future. -// -// 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 Managed Blockchain Query's -// API operation GetAssetContract for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -// -// - ValidationException -// The resource passed is invalid. -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// The Amazon Web Services account doesn’t have access to this resource. -// -// - InternalServerException -// The request processing has failed because of an internal error in the service. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded for this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetAssetContract -func (c *ManagedBlockchainQuery) GetAssetContract(input *GetAssetContractInput) (*GetAssetContractOutput, error) { - req, out := c.GetAssetContractRequest(input) - return out, req.Send() -} - -// GetAssetContractWithContext is the same as GetAssetContract with the addition of -// the ability to pass a context and additional request options. -// -// See GetAssetContract 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 *ManagedBlockchainQuery) GetAssetContractWithContext(ctx aws.Context, input *GetAssetContractInput, opts ...request.Option) (*GetAssetContractOutput, error) { - req, out := c.GetAssetContractRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTokenBalance = "GetTokenBalance" - -// GetTokenBalanceRequest generates a "aws/request.Request" representing the -// client's request for the GetTokenBalance 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 GetTokenBalance for more information on using the GetTokenBalance -// 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 GetTokenBalanceRequest method. -// req, resp := client.GetTokenBalanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetTokenBalance -func (c *ManagedBlockchainQuery) GetTokenBalanceRequest(input *GetTokenBalanceInput) (req *request.Request, output *GetTokenBalanceOutput) { - op := &request.Operation{ - Name: opGetTokenBalance, - HTTPMethod: "POST", - HTTPPath: "/get-token-balance", - } - - if input == nil { - input = &GetTokenBalanceInput{} - } - - output = &GetTokenBalanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTokenBalance API operation for Amazon Managed Blockchain Query. -// -// Gets the balance of a specific token, including native tokens, for a given -// address (wallet or contract) on the blockchain. -// -// Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token -// standards are supported. -// -// 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 Managed Blockchain Query's -// API operation GetTokenBalance for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -// -// - ValidationException -// The resource passed is invalid. -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// The Amazon Web Services account doesn’t have access to this resource. -// -// - InternalServerException -// The request processing has failed because of an internal error in the service. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded for this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetTokenBalance -func (c *ManagedBlockchainQuery) GetTokenBalance(input *GetTokenBalanceInput) (*GetTokenBalanceOutput, error) { - req, out := c.GetTokenBalanceRequest(input) - return out, req.Send() -} - -// GetTokenBalanceWithContext is the same as GetTokenBalance with the addition of -// the ability to pass a context and additional request options. -// -// See GetTokenBalance 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 *ManagedBlockchainQuery) GetTokenBalanceWithContext(ctx aws.Context, input *GetTokenBalanceInput, opts ...request.Option) (*GetTokenBalanceOutput, error) { - req, out := c.GetTokenBalanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTransaction = "GetTransaction" - -// GetTransactionRequest generates a "aws/request.Request" representing the -// client's request for the GetTransaction 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 GetTransaction for more information on using the GetTransaction -// 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 GetTransactionRequest method. -// req, resp := client.GetTransactionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetTransaction -func (c *ManagedBlockchainQuery) GetTransactionRequest(input *GetTransactionInput) (req *request.Request, output *GetTransactionOutput) { - op := &request.Operation{ - Name: opGetTransaction, - HTTPMethod: "POST", - HTTPPath: "/get-transaction", - } - - if input == nil { - input = &GetTransactionInput{} - } - - output = &GetTransactionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTransaction API operation for Amazon Managed Blockchain Query. -// -// Get the details of a transaction. -// -// 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 Managed Blockchain Query's -// API operation GetTransaction for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -// -// - ValidationException -// The resource passed is invalid. -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// The Amazon Web Services account doesn’t have access to this resource. -// -// - InternalServerException -// The request processing has failed because of an internal error in the service. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded for this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/GetTransaction -func (c *ManagedBlockchainQuery) GetTransaction(input *GetTransactionInput) (*GetTransactionOutput, error) { - req, out := c.GetTransactionRequest(input) - return out, req.Send() -} - -// GetTransactionWithContext is the same as GetTransaction with the addition of -// the ability to pass a context and additional request options. -// -// See GetTransaction 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 *ManagedBlockchainQuery) GetTransactionWithContext(ctx aws.Context, input *GetTransactionInput, opts ...request.Option) (*GetTransactionOutput, error) { - req, out := c.GetTransactionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAssetContracts = "ListAssetContracts" - -// ListAssetContractsRequest generates a "aws/request.Request" representing the -// client's request for the ListAssetContracts 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 ListAssetContracts for more information on using the ListAssetContracts -// 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 ListAssetContractsRequest method. -// req, resp := client.ListAssetContractsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListAssetContracts -func (c *ManagedBlockchainQuery) ListAssetContractsRequest(input *ListAssetContractsInput) (req *request.Request, output *ListAssetContractsOutput) { - op := &request.Operation{ - Name: opListAssetContracts, - HTTPMethod: "POST", - HTTPPath: "/list-asset-contracts", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAssetContractsInput{} - } - - output = &ListAssetContractsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssetContracts API operation for Amazon Managed Blockchain Query. -// -// Lists all the contracts for a given contract type deployed by an address -// (either a contract address or a wallet address). -// -// The Bitcoin blockchain networks do not support this operation. -// -// 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 Managed Blockchain Query's -// API operation ListAssetContracts for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -// -// - ValidationException -// The resource passed is invalid. -// -// - AccessDeniedException -// The Amazon Web Services account doesn’t have access to this resource. -// -// - InternalServerException -// The request processing has failed because of an internal error in the service. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded for this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListAssetContracts -func (c *ManagedBlockchainQuery) ListAssetContracts(input *ListAssetContractsInput) (*ListAssetContractsOutput, error) { - req, out := c.ListAssetContractsRequest(input) - return out, req.Send() -} - -// ListAssetContractsWithContext is the same as ListAssetContracts with the addition of -// the ability to pass a context and additional request options. -// -// See ListAssetContracts 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 *ManagedBlockchainQuery) ListAssetContractsWithContext(ctx aws.Context, input *ListAssetContractsInput, opts ...request.Option) (*ListAssetContractsOutput, error) { - req, out := c.ListAssetContractsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAssetContractsPages iterates over the pages of a ListAssetContracts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssetContracts method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAssetContracts operation. -// pageNum := 0 -// err := client.ListAssetContractsPages(params, -// func(page *managedblockchainquery.ListAssetContractsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ManagedBlockchainQuery) ListAssetContractsPages(input *ListAssetContractsInput, fn func(*ListAssetContractsOutput, bool) bool) error { - return c.ListAssetContractsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssetContractsPagesWithContext same as ListAssetContractsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ManagedBlockchainQuery) ListAssetContractsPagesWithContext(ctx aws.Context, input *ListAssetContractsInput, fn func(*ListAssetContractsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAssetContractsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAssetContractsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAssetContractsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTokenBalances = "ListTokenBalances" - -// ListTokenBalancesRequest generates a "aws/request.Request" representing the -// client's request for the ListTokenBalances 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 ListTokenBalances for more information on using the ListTokenBalances -// 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 ListTokenBalancesRequest method. -// req, resp := client.ListTokenBalancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTokenBalances -func (c *ManagedBlockchainQuery) ListTokenBalancesRequest(input *ListTokenBalancesInput) (req *request.Request, output *ListTokenBalancesOutput) { - op := &request.Operation{ - Name: opListTokenBalances, - HTTPMethod: "POST", - HTTPPath: "/list-token-balances", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTokenBalancesInput{} - } - - output = &ListTokenBalancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTokenBalances API operation for Amazon Managed Blockchain Query. -// -// This action returns the following for a given blockchain network: -// -// - Lists all token balances owned by an address (either a contract address -// or a wallet address). -// -// - Lists all token balances for all tokens created by a contract. -// -// - Lists all token balances for a given token. -// -// You must always specify the network property of the tokenFilter when using -// this operation. -// -// 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 Managed Blockchain Query's -// API operation ListTokenBalances for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -// -// - ValidationException -// The resource passed is invalid. -// -// - AccessDeniedException -// The Amazon Web Services account doesn’t have access to this resource. -// -// - InternalServerException -// The request processing has failed because of an internal error in the service. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded for this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTokenBalances -func (c *ManagedBlockchainQuery) ListTokenBalances(input *ListTokenBalancesInput) (*ListTokenBalancesOutput, error) { - req, out := c.ListTokenBalancesRequest(input) - return out, req.Send() -} - -// ListTokenBalancesWithContext is the same as ListTokenBalances with the addition of -// the ability to pass a context and additional request options. -// -// See ListTokenBalances 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 *ManagedBlockchainQuery) ListTokenBalancesWithContext(ctx aws.Context, input *ListTokenBalancesInput, opts ...request.Option) (*ListTokenBalancesOutput, error) { - req, out := c.ListTokenBalancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTokenBalancesPages iterates over the pages of a ListTokenBalances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTokenBalances method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTokenBalances operation. -// pageNum := 0 -// err := client.ListTokenBalancesPages(params, -// func(page *managedblockchainquery.ListTokenBalancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ManagedBlockchainQuery) ListTokenBalancesPages(input *ListTokenBalancesInput, fn func(*ListTokenBalancesOutput, bool) bool) error { - return c.ListTokenBalancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTokenBalancesPagesWithContext same as ListTokenBalancesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ManagedBlockchainQuery) ListTokenBalancesPagesWithContext(ctx aws.Context, input *ListTokenBalancesInput, fn func(*ListTokenBalancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTokenBalancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTokenBalancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTokenBalancesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTransactionEvents = "ListTransactionEvents" - -// ListTransactionEventsRequest generates a "aws/request.Request" representing the -// client's request for the ListTransactionEvents 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 ListTransactionEvents for more information on using the ListTransactionEvents -// 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 ListTransactionEventsRequest method. -// req, resp := client.ListTransactionEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTransactionEvents -func (c *ManagedBlockchainQuery) ListTransactionEventsRequest(input *ListTransactionEventsInput) (req *request.Request, output *ListTransactionEventsOutput) { - op := &request.Operation{ - Name: opListTransactionEvents, - HTTPMethod: "POST", - HTTPPath: "/list-transaction-events", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTransactionEventsInput{} - } - - output = &ListTransactionEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTransactionEvents API operation for Amazon Managed Blockchain Query. -// -// An array of TransactionEvent objects. Each object contains details about -// the transaction event. -// -// 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 Managed Blockchain Query's -// API operation ListTransactionEvents for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -// -// - ValidationException -// The resource passed is invalid. -// -// - AccessDeniedException -// The Amazon Web Services account doesn’t have access to this resource. -// -// - InternalServerException -// The request processing has failed because of an internal error in the service. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded for this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTransactionEvents -func (c *ManagedBlockchainQuery) ListTransactionEvents(input *ListTransactionEventsInput) (*ListTransactionEventsOutput, error) { - req, out := c.ListTransactionEventsRequest(input) - return out, req.Send() -} - -// ListTransactionEventsWithContext is the same as ListTransactionEvents with the addition of -// the ability to pass a context and additional request options. -// -// See ListTransactionEvents 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 *ManagedBlockchainQuery) ListTransactionEventsWithContext(ctx aws.Context, input *ListTransactionEventsInput, opts ...request.Option) (*ListTransactionEventsOutput, error) { - req, out := c.ListTransactionEventsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTransactionEventsPages iterates over the pages of a ListTransactionEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTransactionEvents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTransactionEvents operation. -// pageNum := 0 -// err := client.ListTransactionEventsPages(params, -// func(page *managedblockchainquery.ListTransactionEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ManagedBlockchainQuery) ListTransactionEventsPages(input *ListTransactionEventsInput, fn func(*ListTransactionEventsOutput, bool) bool) error { - return c.ListTransactionEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTransactionEventsPagesWithContext same as ListTransactionEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ManagedBlockchainQuery) ListTransactionEventsPagesWithContext(ctx aws.Context, input *ListTransactionEventsInput, fn func(*ListTransactionEventsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTransactionEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTransactionEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTransactionEventsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTransactions = "ListTransactions" - -// ListTransactionsRequest generates a "aws/request.Request" representing the -// client's request for the ListTransactions 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 ListTransactions for more information on using the ListTransactions -// 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 ListTransactionsRequest method. -// req, resp := client.ListTransactionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTransactions -func (c *ManagedBlockchainQuery) ListTransactionsRequest(input *ListTransactionsInput) (req *request.Request, output *ListTransactionsOutput) { - op := &request.Operation{ - Name: opListTransactions, - HTTPMethod: "POST", - HTTPPath: "/list-transactions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTransactionsInput{} - } - - output = &ListTransactionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTransactions API operation for Amazon Managed Blockchain Query. -// -// Lists all of the transactions on a given wallet address or to a specific -// contract. -// -// 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 Managed Blockchain Query's -// API operation ListTransactions for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -// -// - ValidationException -// The resource passed is invalid. -// -// - AccessDeniedException -// The Amazon Web Services account doesn’t have access to this resource. -// -// - InternalServerException -// The request processing has failed because of an internal error in the service. -// -// - ServiceQuotaExceededException -// The service quota has been exceeded for this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04/ListTransactions -func (c *ManagedBlockchainQuery) ListTransactions(input *ListTransactionsInput) (*ListTransactionsOutput, error) { - req, out := c.ListTransactionsRequest(input) - return out, req.Send() -} - -// ListTransactionsWithContext is the same as ListTransactions with the addition of -// the ability to pass a context and additional request options. -// -// See ListTransactions 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 *ManagedBlockchainQuery) ListTransactionsWithContext(ctx aws.Context, input *ListTransactionsInput, opts ...request.Option) (*ListTransactionsOutput, error) { - req, out := c.ListTransactionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTransactionsPages iterates over the pages of a ListTransactions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTransactions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTransactions operation. -// pageNum := 0 -// err := client.ListTransactionsPages(params, -// func(page *managedblockchainquery.ListTransactionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ManagedBlockchainQuery) ListTransactionsPages(input *ListTransactionsInput, fn func(*ListTransactionsOutput, bool) bool) error { - return c.ListTransactionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTransactionsPagesWithContext same as ListTransactionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ManagedBlockchainQuery) ListTransactionsPagesWithContext(ctx aws.Context, input *ListTransactionsInput, fn func(*ListTransactionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTransactionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTransactionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTransactionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -// The Amazon Web Services account doesn’t have access to this resource. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The container for the exception message. - Message_ *string `locationName:"message" min:"1" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This container contains information about an contract. -type AssetContract struct { - _ struct{} `type:"structure"` - - // The container for the contract identifier containing its blockchain network - // and address. - // - // ContractIdentifier is a required field - ContractIdentifier *ContractIdentifier `locationName:"contractIdentifier" type:"structure" required:"true"` - - // The address of the contract deployer. - // - // DeployerAddress is a required field - DeployerAddress *string `locationName:"deployerAddress" type:"string" required:"true"` - - // The token standard of the contract. - // - // TokenStandard is a required field - TokenStandard *string `locationName:"tokenStandard" type:"string" required:"true" enum:"QueryTokenStandard"` -} - -// 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 AssetContract) 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 AssetContract) GoString() string { - return s.String() -} - -// SetContractIdentifier sets the ContractIdentifier field's value. -func (s *AssetContract) SetContractIdentifier(v *ContractIdentifier) *AssetContract { - s.ContractIdentifier = v - return s -} - -// SetDeployerAddress sets the DeployerAddress field's value. -func (s *AssetContract) SetDeployerAddress(v string) *AssetContract { - s.DeployerAddress = &v - return s -} - -// SetTokenStandard sets the TokenStandard field's value. -func (s *AssetContract) SetTokenStandard(v string) *AssetContract { - s.TokenStandard = &v - return s -} - -// Error generated from a failed BatchGetTokenBalance request. -type BatchGetTokenBalanceErrorItem struct { - _ struct{} `type:"structure"` - - // The container for time. - AtBlockchainInstant *BlockchainInstant `locationName:"atBlockchainInstant" type:"structure"` - - // The error code associated with the error. - // - // ErrorCode is a required field - ErrorCode *string `locationName:"errorCode" type:"string" required:"true"` - - // The message associated with the error. - // - // ErrorMessage is a required field - ErrorMessage *string `locationName:"errorMessage" type:"string" required:"true"` - - // The type of error. - // - // ErrorType is a required field - ErrorType *string `locationName:"errorType" type:"string" required:"true" enum:"ErrorType"` - - // The container for the identifier of the owner. - OwnerIdentifier *OwnerIdentifier `locationName:"ownerIdentifier" type:"structure"` - - // The container for the identifier for the token including the unique token - // ID and its blockchain network. - // - // Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token - // standards are supported. - TokenIdentifier *TokenIdentifier `locationName:"tokenIdentifier" 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 BatchGetTokenBalanceErrorItem) 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 BatchGetTokenBalanceErrorItem) GoString() string { - return s.String() -} - -// SetAtBlockchainInstant sets the AtBlockchainInstant field's value. -func (s *BatchGetTokenBalanceErrorItem) SetAtBlockchainInstant(v *BlockchainInstant) *BatchGetTokenBalanceErrorItem { - s.AtBlockchainInstant = v - return s -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *BatchGetTokenBalanceErrorItem) SetErrorCode(v string) *BatchGetTokenBalanceErrorItem { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *BatchGetTokenBalanceErrorItem) SetErrorMessage(v string) *BatchGetTokenBalanceErrorItem { - s.ErrorMessage = &v - return s -} - -// SetErrorType sets the ErrorType field's value. -func (s *BatchGetTokenBalanceErrorItem) SetErrorType(v string) *BatchGetTokenBalanceErrorItem { - s.ErrorType = &v - return s -} - -// SetOwnerIdentifier sets the OwnerIdentifier field's value. -func (s *BatchGetTokenBalanceErrorItem) SetOwnerIdentifier(v *OwnerIdentifier) *BatchGetTokenBalanceErrorItem { - s.OwnerIdentifier = v - return s -} - -// SetTokenIdentifier sets the TokenIdentifier field's value. -func (s *BatchGetTokenBalanceErrorItem) SetTokenIdentifier(v *TokenIdentifier) *BatchGetTokenBalanceErrorItem { - s.TokenIdentifier = v - return s -} - -type BatchGetTokenBalanceInput struct { - _ struct{} `type:"structure"` - - // An array of BatchGetTokenBalanceInputItem objects whose balance is being - // requested. - GetTokenBalanceInputs []*BatchGetTokenBalanceInputItem `locationName:"getTokenBalanceInputs" min:"1" type:"list"` -} - -// 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 BatchGetTokenBalanceInput) 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 BatchGetTokenBalanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetTokenBalanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetTokenBalanceInput"} - if s.GetTokenBalanceInputs != nil && len(s.GetTokenBalanceInputs) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GetTokenBalanceInputs", 1)) - } - if s.GetTokenBalanceInputs != nil { - for i, v := range s.GetTokenBalanceInputs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GetTokenBalanceInputs", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGetTokenBalanceInputs sets the GetTokenBalanceInputs field's value. -func (s *BatchGetTokenBalanceInput) SetGetTokenBalanceInputs(v []*BatchGetTokenBalanceInputItem) *BatchGetTokenBalanceInput { - s.GetTokenBalanceInputs = v - return s -} - -// The container for the input for getting a token balance. -type BatchGetTokenBalanceInputItem struct { - _ struct{} `type:"structure"` - - // The container for time. - AtBlockchainInstant *BlockchainInstant `locationName:"atBlockchainInstant" type:"structure"` - - // The container for the identifier of the owner. - // - // OwnerIdentifier is a required field - OwnerIdentifier *OwnerIdentifier `locationName:"ownerIdentifier" type:"structure" required:"true"` - - // The container for the identifier for the token including the unique token - // ID and its blockchain network. - // - // Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token - // standards are supported. - // - // TokenIdentifier is a required field - TokenIdentifier *TokenIdentifier `locationName:"tokenIdentifier" type:"structure" 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 BatchGetTokenBalanceInputItem) 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 BatchGetTokenBalanceInputItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetTokenBalanceInputItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetTokenBalanceInputItem"} - if s.OwnerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OwnerIdentifier")) - } - if s.TokenIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TokenIdentifier")) - } - if s.OwnerIdentifier != nil { - if err := s.OwnerIdentifier.Validate(); err != nil { - invalidParams.AddNested("OwnerIdentifier", err.(request.ErrInvalidParams)) - } - } - if s.TokenIdentifier != nil { - if err := s.TokenIdentifier.Validate(); err != nil { - invalidParams.AddNested("TokenIdentifier", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAtBlockchainInstant sets the AtBlockchainInstant field's value. -func (s *BatchGetTokenBalanceInputItem) SetAtBlockchainInstant(v *BlockchainInstant) *BatchGetTokenBalanceInputItem { - s.AtBlockchainInstant = v - return s -} - -// SetOwnerIdentifier sets the OwnerIdentifier field's value. -func (s *BatchGetTokenBalanceInputItem) SetOwnerIdentifier(v *OwnerIdentifier) *BatchGetTokenBalanceInputItem { - s.OwnerIdentifier = v - return s -} - -// SetTokenIdentifier sets the TokenIdentifier field's value. -func (s *BatchGetTokenBalanceInputItem) SetTokenIdentifier(v *TokenIdentifier) *BatchGetTokenBalanceInputItem { - s.TokenIdentifier = v - return s -} - -type BatchGetTokenBalanceOutput struct { - _ struct{} `type:"structure"` - - // An array of BatchGetTokenBalanceErrorItem objects returned from the request. - // - // Errors is a required field - Errors []*BatchGetTokenBalanceErrorItem `locationName:"errors" type:"list" required:"true"` - - // An array of BatchGetTokenBalanceOutputItem objects returned by the response. - // - // TokenBalances is a required field - TokenBalances []*BatchGetTokenBalanceOutputItem `locationName:"tokenBalances" type:"list" 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 BatchGetTokenBalanceOutput) 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 BatchGetTokenBalanceOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchGetTokenBalanceOutput) SetErrors(v []*BatchGetTokenBalanceErrorItem) *BatchGetTokenBalanceOutput { - s.Errors = v - return s -} - -// SetTokenBalances sets the TokenBalances field's value. -func (s *BatchGetTokenBalanceOutput) SetTokenBalances(v []*BatchGetTokenBalanceOutputItem) *BatchGetTokenBalanceOutput { - s.TokenBalances = v - return s -} - -// The container for the properties of a token balance output. -type BatchGetTokenBalanceOutputItem struct { - _ struct{} `type:"structure"` - - // The container for time. - // - // AtBlockchainInstant is a required field - AtBlockchainInstant *BlockchainInstant `locationName:"atBlockchainInstant" type:"structure" required:"true"` - - // The container for the token balance. - // - // Balance is a required field - Balance *string `locationName:"balance" type:"string" required:"true"` - - // The container for time. - LastUpdatedTime *BlockchainInstant `locationName:"lastUpdatedTime" type:"structure"` - - // The container for the identifier of the owner. - OwnerIdentifier *OwnerIdentifier `locationName:"ownerIdentifier" type:"structure"` - - // The container for the identifier for the token including the unique token - // ID and its blockchain network. - // - // Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token - // standards are supported. - TokenIdentifier *TokenIdentifier `locationName:"tokenIdentifier" 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 BatchGetTokenBalanceOutputItem) 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 BatchGetTokenBalanceOutputItem) GoString() string { - return s.String() -} - -// SetAtBlockchainInstant sets the AtBlockchainInstant field's value. -func (s *BatchGetTokenBalanceOutputItem) SetAtBlockchainInstant(v *BlockchainInstant) *BatchGetTokenBalanceOutputItem { - s.AtBlockchainInstant = v - return s -} - -// SetBalance sets the Balance field's value. -func (s *BatchGetTokenBalanceOutputItem) SetBalance(v string) *BatchGetTokenBalanceOutputItem { - s.Balance = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *BatchGetTokenBalanceOutputItem) SetLastUpdatedTime(v *BlockchainInstant) *BatchGetTokenBalanceOutputItem { - s.LastUpdatedTime = v - return s -} - -// SetOwnerIdentifier sets the OwnerIdentifier field's value. -func (s *BatchGetTokenBalanceOutputItem) SetOwnerIdentifier(v *OwnerIdentifier) *BatchGetTokenBalanceOutputItem { - s.OwnerIdentifier = v - return s -} - -// SetTokenIdentifier sets the TokenIdentifier field's value. -func (s *BatchGetTokenBalanceOutputItem) SetTokenIdentifier(v *TokenIdentifier) *BatchGetTokenBalanceOutputItem { - s.TokenIdentifier = v - return s -} - -// The container for time. -type BlockchainInstant struct { - _ struct{} `type:"structure"` - - // The container of the Timestamp of the blockchain instant. - // - // This timestamp will only be recorded up to the second. - Time *time.Time `locationName:"time" type:"timestamp"` -} - -// 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 BlockchainInstant) 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 BlockchainInstant) GoString() string { - return s.String() -} - -// SetTime sets the Time field's value. -func (s *BlockchainInstant) SetTime(v time.Time) *BlockchainInstant { - s.Time = &v - return s -} - -// The contract or wallet address by which to filter the request. -type ContractFilter struct { - _ struct{} `type:"structure"` - - // The network address of the deployer. - // - // DeployerAddress is a required field - DeployerAddress *string `locationName:"deployerAddress" type:"string" required:"true"` - - // The blockchain network of the contract. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The container for the token standard. - // - // TokenStandard is a required field - TokenStandard *string `locationName:"tokenStandard" type:"string" required:"true" enum:"QueryTokenStandard"` -} - -// 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 ContractFilter) 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 ContractFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContractFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContractFilter"} - if s.DeployerAddress == nil { - invalidParams.Add(request.NewErrParamRequired("DeployerAddress")) - } - if s.Network == nil { - invalidParams.Add(request.NewErrParamRequired("Network")) - } - if s.TokenStandard == nil { - invalidParams.Add(request.NewErrParamRequired("TokenStandard")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeployerAddress sets the DeployerAddress field's value. -func (s *ContractFilter) SetDeployerAddress(v string) *ContractFilter { - s.DeployerAddress = &v - return s -} - -// SetNetwork sets the Network field's value. -func (s *ContractFilter) SetNetwork(v string) *ContractFilter { - s.Network = &v - return s -} - -// SetTokenStandard sets the TokenStandard field's value. -func (s *ContractFilter) SetTokenStandard(v string) *ContractFilter { - s.TokenStandard = &v - return s -} - -// Container for the blockchain address and network information about a contract. -type ContractIdentifier struct { - _ struct{} `type:"structure"` - - // Container for the blockchain address about a contract. - // - // ContractAddress is a required field - ContractAddress *string `locationName:"contractAddress" type:"string" required:"true"` - - // The blockchain network of the contract. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` -} - -// 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 ContractIdentifier) 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 ContractIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContractIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContractIdentifier"} - if s.ContractAddress == nil { - invalidParams.Add(request.NewErrParamRequired("ContractAddress")) - } - if s.Network == nil { - invalidParams.Add(request.NewErrParamRequired("Network")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContractAddress sets the ContractAddress field's value. -func (s *ContractIdentifier) SetContractAddress(v string) *ContractIdentifier { - s.ContractAddress = &v - return s -} - -// SetNetwork sets the Network field's value. -func (s *ContractIdentifier) SetNetwork(v string) *ContractIdentifier { - s.Network = &v - return s -} - -// The metadata of the contract. -type ContractMetadata struct { - _ struct{} `type:"structure"` - - // The decimals used by the token contract. - Decimals *int64 `locationName:"decimals" type:"integer"` - - // The name of the token contract. - Name *string `locationName:"name" type:"string"` - - // The symbol of the token contract. - Symbol *string `locationName:"symbol" 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 ContractMetadata) 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 ContractMetadata) GoString() string { - return s.String() -} - -// SetDecimals sets the Decimals field's value. -func (s *ContractMetadata) SetDecimals(v int64) *ContractMetadata { - s.Decimals = &v - return s -} - -// SetName sets the Name field's value. -func (s *ContractMetadata) SetName(v string) *ContractMetadata { - s.Name = &v - return s -} - -// SetSymbol sets the Symbol field's value. -func (s *ContractMetadata) SetSymbol(v string) *ContractMetadata { - s.Symbol = &v - return s -} - -type GetAssetContractInput struct { - _ struct{} `type:"structure"` - - // Contains the blockchain address and network information about the contract. - // - // ContractIdentifier is a required field - ContractIdentifier *ContractIdentifier `locationName:"contractIdentifier" type:"structure" 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 GetAssetContractInput) 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 GetAssetContractInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAssetContractInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAssetContractInput"} - if s.ContractIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ContractIdentifier")) - } - if s.ContractIdentifier != nil { - if err := s.ContractIdentifier.Validate(); err != nil { - invalidParams.AddNested("ContractIdentifier", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContractIdentifier sets the ContractIdentifier field's value. -func (s *GetAssetContractInput) SetContractIdentifier(v *ContractIdentifier) *GetAssetContractInput { - s.ContractIdentifier = v - return s -} - -type GetAssetContractOutput struct { - _ struct{} `type:"structure"` - - // Contains the blockchain address and network information about the contract. - // - // ContractIdentifier is a required field - ContractIdentifier *ContractIdentifier `locationName:"contractIdentifier" type:"structure" required:"true"` - - // The address of the deployer of contract. - // - // DeployerAddress is a required field - DeployerAddress *string `locationName:"deployerAddress" type:"string" required:"true"` - - // The metadata of the contract. - Metadata *ContractMetadata `locationName:"metadata" type:"structure"` - - // The token standard of the contract requested. - // - // TokenStandard is a required field - TokenStandard *string `locationName:"tokenStandard" type:"string" required:"true" enum:"QueryTokenStandard"` -} - -// 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 GetAssetContractOutput) 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 GetAssetContractOutput) GoString() string { - return s.String() -} - -// SetContractIdentifier sets the ContractIdentifier field's value. -func (s *GetAssetContractOutput) SetContractIdentifier(v *ContractIdentifier) *GetAssetContractOutput { - s.ContractIdentifier = v - return s -} - -// SetDeployerAddress sets the DeployerAddress field's value. -func (s *GetAssetContractOutput) SetDeployerAddress(v string) *GetAssetContractOutput { - s.DeployerAddress = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetAssetContractOutput) SetMetadata(v *ContractMetadata) *GetAssetContractOutput { - s.Metadata = v - return s -} - -// SetTokenStandard sets the TokenStandard field's value. -func (s *GetAssetContractOutput) SetTokenStandard(v string) *GetAssetContractOutput { - s.TokenStandard = &v - return s -} - -type GetTokenBalanceInput struct { - _ struct{} `type:"structure"` - - // The time for when the TokenBalance is requested or the current time if a - // time is not provided in the request. - // - // This time will only be recorded up to the second. - AtBlockchainInstant *BlockchainInstant `locationName:"atBlockchainInstant" type:"structure"` - - // The container for the identifier for the owner. - // - // OwnerIdentifier is a required field - OwnerIdentifier *OwnerIdentifier `locationName:"ownerIdentifier" type:"structure" required:"true"` - - // The container for the identifier for the token, including the unique token - // ID and its blockchain network. - // - // TokenIdentifier is a required field - TokenIdentifier *TokenIdentifier `locationName:"tokenIdentifier" type:"structure" 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 GetTokenBalanceInput) 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 GetTokenBalanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTokenBalanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTokenBalanceInput"} - if s.OwnerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OwnerIdentifier")) - } - if s.TokenIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TokenIdentifier")) - } - if s.OwnerIdentifier != nil { - if err := s.OwnerIdentifier.Validate(); err != nil { - invalidParams.AddNested("OwnerIdentifier", err.(request.ErrInvalidParams)) - } - } - if s.TokenIdentifier != nil { - if err := s.TokenIdentifier.Validate(); err != nil { - invalidParams.AddNested("TokenIdentifier", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAtBlockchainInstant sets the AtBlockchainInstant field's value. -func (s *GetTokenBalanceInput) SetAtBlockchainInstant(v *BlockchainInstant) *GetTokenBalanceInput { - s.AtBlockchainInstant = v - return s -} - -// SetOwnerIdentifier sets the OwnerIdentifier field's value. -func (s *GetTokenBalanceInput) SetOwnerIdentifier(v *OwnerIdentifier) *GetTokenBalanceInput { - s.OwnerIdentifier = v - return s -} - -// SetTokenIdentifier sets the TokenIdentifier field's value. -func (s *GetTokenBalanceInput) SetTokenIdentifier(v *TokenIdentifier) *GetTokenBalanceInput { - s.TokenIdentifier = v - return s -} - -type GetTokenBalanceOutput struct { - _ struct{} `type:"structure"` - - // The container for time. - // - // AtBlockchainInstant is a required field - AtBlockchainInstant *BlockchainInstant `locationName:"atBlockchainInstant" type:"structure" required:"true"` - - // The container for the token balance. - // - // Balance is a required field - Balance *string `locationName:"balance" type:"string" required:"true"` - - // The container for time. - LastUpdatedTime *BlockchainInstant `locationName:"lastUpdatedTime" type:"structure"` - - // The container for the identifier of the owner. - OwnerIdentifier *OwnerIdentifier `locationName:"ownerIdentifier" type:"structure"` - - // The container for the identifier for the token including the unique token - // ID and its blockchain network. - // - // Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token - // standards are supported. - TokenIdentifier *TokenIdentifier `locationName:"tokenIdentifier" 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 GetTokenBalanceOutput) 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 GetTokenBalanceOutput) GoString() string { - return s.String() -} - -// SetAtBlockchainInstant sets the AtBlockchainInstant field's value. -func (s *GetTokenBalanceOutput) SetAtBlockchainInstant(v *BlockchainInstant) *GetTokenBalanceOutput { - s.AtBlockchainInstant = v - return s -} - -// SetBalance sets the Balance field's value. -func (s *GetTokenBalanceOutput) SetBalance(v string) *GetTokenBalanceOutput { - s.Balance = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *GetTokenBalanceOutput) SetLastUpdatedTime(v *BlockchainInstant) *GetTokenBalanceOutput { - s.LastUpdatedTime = v - return s -} - -// SetOwnerIdentifier sets the OwnerIdentifier field's value. -func (s *GetTokenBalanceOutput) SetOwnerIdentifier(v *OwnerIdentifier) *GetTokenBalanceOutput { - s.OwnerIdentifier = v - return s -} - -// SetTokenIdentifier sets the TokenIdentifier field's value. -func (s *GetTokenBalanceOutput) SetTokenIdentifier(v *TokenIdentifier) *GetTokenBalanceOutput { - s.TokenIdentifier = v - return s -} - -type GetTransactionInput struct { - _ struct{} `type:"structure"` - - // The blockchain network where the transaction occurred. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The hash of the transaction. It is generated whenever a transaction is verified - // and added to the blockchain. - // - // TransactionHash is a required field - TransactionHash *string `locationName:"transactionHash" 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 GetTransactionInput) 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 GetTransactionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTransactionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTransactionInput"} - if s.Network == nil { - invalidParams.Add(request.NewErrParamRequired("Network")) - } - if s.TransactionHash == nil { - invalidParams.Add(request.NewErrParamRequired("TransactionHash")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNetwork sets the Network field's value. -func (s *GetTransactionInput) SetNetwork(v string) *GetTransactionInput { - s.Network = &v - return s -} - -// SetTransactionHash sets the TransactionHash field's value. -func (s *GetTransactionInput) SetTransactionHash(v string) *GetTransactionInput { - s.TransactionHash = &v - return s -} - -type GetTransactionOutput struct { - _ struct{} `type:"structure"` - - // Contains the details of the transaction. - // - // Transaction is a required field - Transaction *Transaction `locationName:"transaction" type:"structure" 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 GetTransactionOutput) 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 GetTransactionOutput) GoString() string { - return s.String() -} - -// SetTransaction sets the Transaction field's value. -func (s *GetTransactionOutput) SetTransaction(v *Transaction) *GetTransactionOutput { - s.Transaction = v - return s -} - -// The request processing has failed because of an internal error in the service. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The container for the exception message. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The container of the retryAfterSeconds value. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListAssetContractsInput struct { - _ struct{} `type:"structure"` - - // Contains the filter parameter for the request. - // - // ContractFilter is a required field - ContractFilter *ContractFilter `locationName:"contractFilter" type:"structure" required:"true"` - - // The maximum number of contracts to list. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" 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 ListAssetContractsInput) 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 ListAssetContractsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssetContractsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssetContractsInput"} - if s.ContractFilter == nil { - invalidParams.Add(request.NewErrParamRequired("ContractFilter")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ContractFilter != nil { - if err := s.ContractFilter.Validate(); err != nil { - invalidParams.AddNested("ContractFilter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContractFilter sets the ContractFilter field's value. -func (s *ListAssetContractsInput) SetContractFilter(v *ContractFilter) *ListAssetContractsInput { - s.ContractFilter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssetContractsInput) SetMaxResults(v int64) *ListAssetContractsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssetContractsInput) SetNextToken(v string) *ListAssetContractsInput { - s.NextToken = &v - return s -} - -type ListAssetContractsOutput struct { - _ struct{} `type:"structure"` - - // An array of contract objects that contain the properties for each contract. - // - // Contracts is a required field - Contracts []*AssetContract `locationName:"contracts" type:"list" required:"true"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" 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 ListAssetContractsOutput) 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 ListAssetContractsOutput) GoString() string { - return s.String() -} - -// SetContracts sets the Contracts field's value. -func (s *ListAssetContractsOutput) SetContracts(v []*AssetContract) *ListAssetContractsOutput { - s.Contracts = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssetContractsOutput) SetNextToken(v string) *ListAssetContractsOutput { - s.NextToken = &v - return s -} - -type ListTokenBalancesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of token balances to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" type:"string"` - - // The contract or wallet address on the blockchain network by which to filter - // the request. You must specify the address property of the ownerFilter when - // listing balances of tokens owned by the address. - OwnerFilter *OwnerFilter `locationName:"ownerFilter" type:"structure"` - - // The contract address or a token identifier on the blockchain network by which - // to filter the request. You must specify the contractAddress property of this - // container when listing tokens minted by a contract. - // - // You must always specify the network property of this container when using - // this operation. - // - // TokenFilter is a required field - TokenFilter *TokenFilter `locationName:"tokenFilter" type:"structure" 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 ListTokenBalancesInput) 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 ListTokenBalancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTokenBalancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTokenBalancesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.TokenFilter == nil { - invalidParams.Add(request.NewErrParamRequired("TokenFilter")) - } - if s.OwnerFilter != nil { - if err := s.OwnerFilter.Validate(); err != nil { - invalidParams.AddNested("OwnerFilter", err.(request.ErrInvalidParams)) - } - } - if s.TokenFilter != nil { - if err := s.TokenFilter.Validate(); err != nil { - invalidParams.AddNested("TokenFilter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTokenBalancesInput) SetMaxResults(v int64) *ListTokenBalancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTokenBalancesInput) SetNextToken(v string) *ListTokenBalancesInput { - s.NextToken = &v - return s -} - -// SetOwnerFilter sets the OwnerFilter field's value. -func (s *ListTokenBalancesInput) SetOwnerFilter(v *OwnerFilter) *ListTokenBalancesInput { - s.OwnerFilter = v - return s -} - -// SetTokenFilter sets the TokenFilter field's value. -func (s *ListTokenBalancesInput) SetTokenFilter(v *TokenFilter) *ListTokenBalancesInput { - s.TokenFilter = v - return s -} - -type ListTokenBalancesOutput struct { - _ struct{} `type:"structure"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" type:"string"` - - // An array of TokenBalance objects. Each object contains details about the - // token balance. - // - // TokenBalances is a required field - TokenBalances []*TokenBalance `locationName:"tokenBalances" type:"list" 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 ListTokenBalancesOutput) 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 ListTokenBalancesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTokenBalancesOutput) SetNextToken(v string) *ListTokenBalancesOutput { - s.NextToken = &v - return s -} - -// SetTokenBalances sets the TokenBalances field's value. -func (s *ListTokenBalancesOutput) SetTokenBalances(v []*TokenBalance) *ListTokenBalancesOutput { - s.TokenBalances = v - return s -} - -type ListTransactionEventsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of transaction events to list. - // - // Even if additional results can be retrieved, the request can return less - // results than maxResults or an empty array of results. - // - // To retrieve the next set of results, make another request with the returned - // nextToken value. The value of nextToken is null when there are no more results - // to return - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The blockchain network where the transaction events occurred. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" type:"string"` - - // The hash of the transaction. It is generated whenever a transaction is verified - // and added to the blockchain. - // - // TransactionHash is a required field - TransactionHash *string `locationName:"transactionHash" 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 ListTransactionEventsInput) 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 ListTransactionEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTransactionEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTransactionEventsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Network == nil { - invalidParams.Add(request.NewErrParamRequired("Network")) - } - if s.TransactionHash == nil { - invalidParams.Add(request.NewErrParamRequired("TransactionHash")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTransactionEventsInput) SetMaxResults(v int64) *ListTransactionEventsInput { - s.MaxResults = &v - return s -} - -// SetNetwork sets the Network field's value. -func (s *ListTransactionEventsInput) SetNetwork(v string) *ListTransactionEventsInput { - s.Network = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTransactionEventsInput) SetNextToken(v string) *ListTransactionEventsInput { - s.NextToken = &v - return s -} - -// SetTransactionHash sets the TransactionHash field's value. -func (s *ListTransactionEventsInput) SetTransactionHash(v string) *ListTransactionEventsInput { - s.TransactionHash = &v - return s -} - -type ListTransactionEventsOutput struct { - _ struct{} `type:"structure"` - - // An array of TransactionEvent objects. Each object contains details about - // the transaction events. - // - // Events is a required field - Events []*TransactionEvent `locationName:"events" type:"list" required:"true"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" 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 ListTransactionEventsOutput) 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 ListTransactionEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *ListTransactionEventsOutput) SetEvents(v []*TransactionEvent) *ListTransactionEventsOutput { - s.Events = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTransactionEventsOutput) SetNextToken(v string) *ListTransactionEventsOutput { - s.NextToken = &v - return s -} - -type ListTransactionsInput struct { - _ struct{} `type:"structure"` - - // The address (either a contract or wallet), whose transactions are being requested. - // - // Address is a required field - Address *string `locationName:"address" type:"string" required:"true"` - - // The container for time. - FromBlockchainInstant *BlockchainInstant `locationName:"fromBlockchainInstant" type:"structure"` - - // The maximum number of transactions to list. - // - // Even if additional results can be retrieved, the request can return less - // results than maxResults or an empty array of results. - // - // To retrieve the next set of results, make another request with the returned - // nextToken value. The value of nextToken is null when there are no more results - // to return - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The blockchain network where the transactions occurred. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" type:"string"` - - // Sorts items in an ascending order if the first page starts at fromTime. Sorts - // items in a descending order if the first page starts at toTime. - Sort *ListTransactionsSort `locationName:"sort" type:"structure"` - - // The container for time. - ToBlockchainInstant *BlockchainInstant `locationName:"toBlockchainInstant" 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 ListTransactionsInput) 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 ListTransactionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTransactionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTransactionsInput"} - if s.Address == nil { - invalidParams.Add(request.NewErrParamRequired("Address")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Network == nil { - invalidParams.Add(request.NewErrParamRequired("Network")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddress sets the Address field's value. -func (s *ListTransactionsInput) SetAddress(v string) *ListTransactionsInput { - s.Address = &v - return s -} - -// SetFromBlockchainInstant sets the FromBlockchainInstant field's value. -func (s *ListTransactionsInput) SetFromBlockchainInstant(v *BlockchainInstant) *ListTransactionsInput { - s.FromBlockchainInstant = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTransactionsInput) SetMaxResults(v int64) *ListTransactionsInput { - s.MaxResults = &v - return s -} - -// SetNetwork sets the Network field's value. -func (s *ListTransactionsInput) SetNetwork(v string) *ListTransactionsInput { - s.Network = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTransactionsInput) SetNextToken(v string) *ListTransactionsInput { - s.NextToken = &v - return s -} - -// SetSort sets the Sort field's value. -func (s *ListTransactionsInput) SetSort(v *ListTransactionsSort) *ListTransactionsInput { - s.Sort = v - return s -} - -// SetToBlockchainInstant sets the ToBlockchainInstant field's value. -func (s *ListTransactionsInput) SetToBlockchainInstant(v *BlockchainInstant) *ListTransactionsInput { - s.ToBlockchainInstant = v - return s -} - -type ListTransactionsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token that indicates the next set of results to retrieve. - NextToken *string `locationName:"nextToken" type:"string"` - - // The array of transactions returned by the request. - // - // Transactions is a required field - Transactions []*TransactionOutputItem `locationName:"transactions" type:"list" 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 ListTransactionsOutput) 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 ListTransactionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTransactionsOutput) SetNextToken(v string) *ListTransactionsOutput { - s.NextToken = &v - return s -} - -// SetTransactions sets the Transactions field's value. -func (s *ListTransactionsOutput) SetTransactions(v []*TransactionOutputItem) *ListTransactionsOutput { - s.Transactions = v - return s -} - -// The container for determining how the list transaction result will be sorted. -type ListTransactionsSort struct { - _ struct{} `type:"structure"` - - // Defaults to the value TRANSACTION_TIMESTAMP. - SortBy *string `locationName:"sortBy" type:"string" enum:"ListTransactionsSortBy"` - - // The container for the sort order for ListTransactions. The SortOrder field - // only accepts the values ASCENDING and DESCENDING. Not providing SortOrder - // will default to ASCENDING. - SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrder"` -} - -// 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 ListTransactionsSort) 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 ListTransactionsSort) GoString() string { - return s.String() -} - -// SetSortBy sets the SortBy field's value. -func (s *ListTransactionsSort) SetSortBy(v string) *ListTransactionsSort { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListTransactionsSort) SetSortOrder(v string) *ListTransactionsSort { - s.SortOrder = &v - return s -} - -// The container for the owner information to filter by. -type OwnerFilter struct { - _ struct{} `type:"structure"` - - // The contract or wallet address. - // - // Address is a required field - Address *string `locationName:"address" 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 OwnerFilter) 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 OwnerFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OwnerFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OwnerFilter"} - if s.Address == nil { - invalidParams.Add(request.NewErrParamRequired("Address")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddress sets the Address field's value. -func (s *OwnerFilter) SetAddress(v string) *OwnerFilter { - s.Address = &v - return s -} - -// The container for the identifier of the owner. -type OwnerIdentifier struct { - _ struct{} `type:"structure"` - - // The contract or wallet address for the owner. - // - // Address is a required field - Address *string `locationName:"address" 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 OwnerIdentifier) 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 OwnerIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OwnerIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OwnerIdentifier"} - if s.Address == nil { - invalidParams.Add(request.NewErrParamRequired("Address")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddress sets the Address field's value. -func (s *OwnerIdentifier) SetAddress(v string) *OwnerIdentifier { - s.Address = &v - return s -} - -// The resource was not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The container for the exception message. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The resourceId of the resource that caused the exception. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resourceType of the resource that caused the exception. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` -} - -// 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The service quota has been exceeded for this resource. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The container for the exception message. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The container for the quotaCode. - // - // QuotaCode is a required field - QuotaCode *string `locationName:"quotaCode" type:"string" required:"true"` - - // The resourceId of the resource that caused the exception. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resourceType of the resource that caused the exception. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` - - // The container for the serviceCode. - // - // ServiceCode is a required field - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request or operation couldn't be performed because a service is throttling -// requests. The most common source of throttling errors is when you create -// resources that exceed your service limit for this resource type. Request -// a limit increase or delete unused resources, if possible. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The container for the exception message. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The container for the quotaCode. - // - // QuotaCode is a required field - QuotaCode *string `locationName:"quotaCode" type:"string" required:"true"` - - // The container of the retryAfterSeconds value. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The container for the serviceCode. - // - // ServiceCode is a required field - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The balance of the token. -type TokenBalance struct { - _ struct{} `type:"structure"` - - // The time for when the TokenBalance is requested or the current time if a - // time is not provided in the request. - // - // This time will only be recorded up to the second. - // - // AtBlockchainInstant is a required field - AtBlockchainInstant *BlockchainInstant `locationName:"atBlockchainInstant" type:"structure" required:"true"` - - // The container of the token balance. - // - // Balance is a required field - Balance *string `locationName:"balance" type:"string" required:"true"` - - // The Timestamp of the last transaction at which the balance for the token - // in the wallet was updated. - LastUpdatedTime *BlockchainInstant `locationName:"lastUpdatedTime" type:"structure"` - - // The container for the identifier of the owner. - OwnerIdentifier *OwnerIdentifier `locationName:"ownerIdentifier" type:"structure"` - - // The identifier for the token, including the unique token ID and its blockchain - // network. - TokenIdentifier *TokenIdentifier `locationName:"tokenIdentifier" 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 TokenBalance) 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 TokenBalance) GoString() string { - return s.String() -} - -// SetAtBlockchainInstant sets the AtBlockchainInstant field's value. -func (s *TokenBalance) SetAtBlockchainInstant(v *BlockchainInstant) *TokenBalance { - s.AtBlockchainInstant = v - return s -} - -// SetBalance sets the Balance field's value. -func (s *TokenBalance) SetBalance(v string) *TokenBalance { - s.Balance = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *TokenBalance) SetLastUpdatedTime(v *BlockchainInstant) *TokenBalance { - s.LastUpdatedTime = v - return s -} - -// SetOwnerIdentifier sets the OwnerIdentifier field's value. -func (s *TokenBalance) SetOwnerIdentifier(v *OwnerIdentifier) *TokenBalance { - s.OwnerIdentifier = v - return s -} - -// SetTokenIdentifier sets the TokenIdentifier field's value. -func (s *TokenBalance) SetTokenIdentifier(v *TokenIdentifier) *TokenBalance { - s.TokenIdentifier = v - return s -} - -// The container of the token filter like the contract address on a given blockchain -// network or a unique token identifier on a given blockchain network. -// -// You must always specify the network property of this container when using -// this operation. -type TokenFilter struct { - _ struct{} `type:"structure"` - - // This is the address of the contract. - ContractAddress *string `locationName:"contractAddress" type:"string"` - - // The blockchain network of the token. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The unique identifier of the token. - TokenId *string `locationName:"tokenId" 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 TokenFilter) 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 TokenFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TokenFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TokenFilter"} - if s.Network == nil { - invalidParams.Add(request.NewErrParamRequired("Network")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContractAddress sets the ContractAddress field's value. -func (s *TokenFilter) SetContractAddress(v string) *TokenFilter { - s.ContractAddress = &v - return s -} - -// SetNetwork sets the Network field's value. -func (s *TokenFilter) SetNetwork(v string) *TokenFilter { - s.Network = &v - return s -} - -// SetTokenId sets the TokenId field's value. -func (s *TokenFilter) SetTokenId(v string) *TokenFilter { - s.TokenId = &v - return s -} - -// The container for the identifier for the token including the unique token -// ID and its blockchain network. -// -// Only the native tokens BTC,ETH, and the ERC-20, ERC-721, and ERC 1155 token -// standards are supported. -type TokenIdentifier struct { - _ struct{} `type:"structure"` - - // This is the token's contract address. - ContractAddress *string `locationName:"contractAddress" type:"string"` - - // The blockchain network of the token. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The unique identifier of the token. - // - // You must specify this container with btc for the native BTC token, and eth - // for the native ETH token. For all other token types you must specify the - // tokenId in the 64 character hexadecimal tokenid format. - TokenId *string `locationName:"tokenId" 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 TokenIdentifier) 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 TokenIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TokenIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TokenIdentifier"} - if s.Network == nil { - invalidParams.Add(request.NewErrParamRequired("Network")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContractAddress sets the ContractAddress field's value. -func (s *TokenIdentifier) SetContractAddress(v string) *TokenIdentifier { - s.ContractAddress = &v - return s -} - -// SetNetwork sets the Network field's value. -func (s *TokenIdentifier) SetNetwork(v string) *TokenIdentifier { - s.Network = &v - return s -} - -// SetTokenId sets the TokenId field's value. -func (s *TokenIdentifier) SetTokenId(v string) *TokenIdentifier { - s.TokenId = &v - return s -} - -// There are two possible types of transactions used for this data type: -// -// - A Bitcoin transaction is a movement of BTC from one address to another. -// -// - An Ethereum transaction refers to an action initiated by an externally -// owned account, which is an account managed by a human, not a contract. -// For example, if Bob sends Alice 1 ETH, Bob's account must be debited and -// Alice's must be credited. This state-changing action occurs within a transaction. -type Transaction struct { - _ struct{} `type:"structure"` - - // The block hash is a unique identifier for a block. It is a fixed-size string - // that is calculated by using the information in the block. The block hash - // is used to verify the integrity of the data in the block. - BlockHash *string `locationName:"blockHash" type:"string"` - - // The block number in which the transaction is recorded. - BlockNumber *string `locationName:"blockNumber" type:"string"` - - // The blockchain address for the contract. - ContractAddress *string `locationName:"contractAddress" type:"string"` - - // The amount of gas used up to the specified point in the block. - CumulativeGasUsed *string `locationName:"cumulativeGasUsed" type:"string"` - - // The effective gas price. - EffectiveGasPrice *string `locationName:"effectiveGasPrice" type:"string"` - - // The initiator of the transaction. It is either in the form a public key or - // a contract address. - From *string `locationName:"from" type:"string"` - - // The amount of gas used for the transaction. - GasUsed *string `locationName:"gasUsed" type:"string"` - - // The blockchain network where the transaction occurred. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The number of transactions in the block. - // - // NumberOfTransactions is a required field - NumberOfTransactions *int64 `locationName:"numberOfTransactions" type:"long" required:"true"` - - // The signature of the transaction. The X coordinate of a point R. - SignatureR *string `locationName:"signatureR" type:"string"` - - // The signature of the transaction. The Y coordinate of a point S. - SignatureS *string `locationName:"signatureS" type:"string"` - - // The signature of the transaction. The Z coordinate of a point V. - SignatureV *int64 `locationName:"signatureV" type:"integer"` - - // The status of the transaction. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"QueryTransactionStatus"` - - // The identifier of the transaction. It is generated whenever a transaction - // is verified and added to the blockchain. - // - // To is a required field - To *string `locationName:"to" type:"string" required:"true"` - - // The transaction fee. - TransactionFee *string `locationName:"transactionFee" type:"string"` - - // The hash of the transaction. It is generated whenever a transaction is verified - // and added to the blockchain. - // - // TransactionHash is a required field - TransactionHash *string `locationName:"transactionHash" type:"string" required:"true"` - - // The unique identifier of the transaction. It is generated whenever a transaction - // is verified and added to the blockchain. - TransactionId *string `locationName:"transactionId" type:"string"` - - // The index of the transaction within a blockchain. - // - // TransactionIndex is a required field - TransactionIndex *int64 `locationName:"transactionIndex" type:"long" required:"true"` - - // The Timestamp of the transaction. - // - // TransactionTimestamp is a required field - TransactionTimestamp *time.Time `locationName:"transactionTimestamp" type:"timestamp" 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 Transaction) 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 Transaction) GoString() string { - return s.String() -} - -// SetBlockHash sets the BlockHash field's value. -func (s *Transaction) SetBlockHash(v string) *Transaction { - s.BlockHash = &v - return s -} - -// SetBlockNumber sets the BlockNumber field's value. -func (s *Transaction) SetBlockNumber(v string) *Transaction { - s.BlockNumber = &v - return s -} - -// SetContractAddress sets the ContractAddress field's value. -func (s *Transaction) SetContractAddress(v string) *Transaction { - s.ContractAddress = &v - return s -} - -// SetCumulativeGasUsed sets the CumulativeGasUsed field's value. -func (s *Transaction) SetCumulativeGasUsed(v string) *Transaction { - s.CumulativeGasUsed = &v - return s -} - -// SetEffectiveGasPrice sets the EffectiveGasPrice field's value. -func (s *Transaction) SetEffectiveGasPrice(v string) *Transaction { - s.EffectiveGasPrice = &v - return s -} - -// SetFrom sets the From field's value. -func (s *Transaction) SetFrom(v string) *Transaction { - s.From = &v - return s -} - -// SetGasUsed sets the GasUsed field's value. -func (s *Transaction) SetGasUsed(v string) *Transaction { - s.GasUsed = &v - return s -} - -// SetNetwork sets the Network field's value. -func (s *Transaction) SetNetwork(v string) *Transaction { - s.Network = &v - return s -} - -// SetNumberOfTransactions sets the NumberOfTransactions field's value. -func (s *Transaction) SetNumberOfTransactions(v int64) *Transaction { - s.NumberOfTransactions = &v - return s -} - -// SetSignatureR sets the SignatureR field's value. -func (s *Transaction) SetSignatureR(v string) *Transaction { - s.SignatureR = &v - return s -} - -// SetSignatureS sets the SignatureS field's value. -func (s *Transaction) SetSignatureS(v string) *Transaction { - s.SignatureS = &v - return s -} - -// SetSignatureV sets the SignatureV field's value. -func (s *Transaction) SetSignatureV(v int64) *Transaction { - s.SignatureV = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Transaction) SetStatus(v string) *Transaction { - s.Status = &v - return s -} - -// SetTo sets the To field's value. -func (s *Transaction) SetTo(v string) *Transaction { - s.To = &v - return s -} - -// SetTransactionFee sets the TransactionFee field's value. -func (s *Transaction) SetTransactionFee(v string) *Transaction { - s.TransactionFee = &v - return s -} - -// SetTransactionHash sets the TransactionHash field's value. -func (s *Transaction) SetTransactionHash(v string) *Transaction { - s.TransactionHash = &v - return s -} - -// SetTransactionId sets the TransactionId field's value. -func (s *Transaction) SetTransactionId(v string) *Transaction { - s.TransactionId = &v - return s -} - -// SetTransactionIndex sets the TransactionIndex field's value. -func (s *Transaction) SetTransactionIndex(v int64) *Transaction { - s.TransactionIndex = &v - return s -} - -// SetTransactionTimestamp sets the TransactionTimestamp field's value. -func (s *Transaction) SetTransactionTimestamp(v time.Time) *Transaction { - s.TransactionTimestamp = &v - return s -} - -// The container for the properties of a transaction event. -type TransactionEvent struct { - _ struct{} `type:"structure"` - - // The blockchain address. for the contract - ContractAddress *string `locationName:"contractAddress" type:"string"` - - // The type of transaction event. - // - // EventType is a required field - EventType *string `locationName:"eventType" type:"string" required:"true" enum:"QueryTransactionEventType"` - - // The wallet address initiating the transaction. It can either be a public - // key or a contract. - From *string `locationName:"from" type:"string"` - - // The blockchain network where the transaction occurred. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The wallet address receiving the transaction. It can either be a public key - // or a contract. - To *string `locationName:"to" type:"string"` - - // The unique identifier for the token involved in the transaction. - TokenId *string `locationName:"tokenId" type:"string"` - - // The hash of the transaction. It is generated whenever a transaction is verified - // and added to the blockchain. - // - // TransactionHash is a required field - TransactionHash *string `locationName:"transactionHash" type:"string" required:"true"` - - // The unique identifier of the transaction. It is generated whenever a transaction - // is verified and added to the blockchain. - TransactionId *string `locationName:"transactionId" type:"string"` - - // The value that was transacted. - Value *string `locationName:"value" type:"string"` - - // The position of the vout in the transaction output list. - VoutIndex *int64 `locationName:"voutIndex" 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 TransactionEvent) 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 TransactionEvent) GoString() string { - return s.String() -} - -// SetContractAddress sets the ContractAddress field's value. -func (s *TransactionEvent) SetContractAddress(v string) *TransactionEvent { - s.ContractAddress = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *TransactionEvent) SetEventType(v string) *TransactionEvent { - s.EventType = &v - return s -} - -// SetFrom sets the From field's value. -func (s *TransactionEvent) SetFrom(v string) *TransactionEvent { - s.From = &v - return s -} - -// SetNetwork sets the Network field's value. -func (s *TransactionEvent) SetNetwork(v string) *TransactionEvent { - s.Network = &v - return s -} - -// SetTo sets the To field's value. -func (s *TransactionEvent) SetTo(v string) *TransactionEvent { - s.To = &v - return s -} - -// SetTokenId sets the TokenId field's value. -func (s *TransactionEvent) SetTokenId(v string) *TransactionEvent { - s.TokenId = &v - return s -} - -// SetTransactionHash sets the TransactionHash field's value. -func (s *TransactionEvent) SetTransactionHash(v string) *TransactionEvent { - s.TransactionHash = &v - return s -} - -// SetTransactionId sets the TransactionId field's value. -func (s *TransactionEvent) SetTransactionId(v string) *TransactionEvent { - s.TransactionId = &v - return s -} - -// SetValue sets the Value field's value. -func (s *TransactionEvent) SetValue(v string) *TransactionEvent { - s.Value = &v - return s -} - -// SetVoutIndex sets the VoutIndex field's value. -func (s *TransactionEvent) SetVoutIndex(v int64) *TransactionEvent { - s.VoutIndex = &v - return s -} - -// The container of the transaction output. -type TransactionOutputItem struct { - _ struct{} `type:"structure"` - - // The blockchain network where the transaction occurred. - // - // Network is a required field - Network *string `locationName:"network" type:"string" required:"true" enum:"QueryNetwork"` - - // The hash of the transaction. It is generated whenever a transaction is verified - // and added to the blockchain. - // - // TransactionHash is a required field - TransactionHash *string `locationName:"transactionHash" type:"string" required:"true"` - - // The time when the transaction occurred. - // - // TransactionTimestamp is a required field - TransactionTimestamp *time.Time `locationName:"transactionTimestamp" type:"timestamp" 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 TransactionOutputItem) 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 TransactionOutputItem) GoString() string { - return s.String() -} - -// SetNetwork sets the Network field's value. -func (s *TransactionOutputItem) SetNetwork(v string) *TransactionOutputItem { - s.Network = &v - return s -} - -// SetTransactionHash sets the TransactionHash field's value. -func (s *TransactionOutputItem) SetTransactionHash(v string) *TransactionOutputItem { - s.TransactionHash = &v - return s -} - -// SetTransactionTimestamp sets the TransactionTimestamp field's value. -func (s *TransactionOutputItem) SetTransactionTimestamp(v time.Time) *TransactionOutputItem { - s.TransactionTimestamp = &v - return s -} - -// The resource passed is invalid. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The container for the fieldList of the exception. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - // The container for the exception message. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The container for the reason for the exception - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The resource passed is invalid. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // The ValidationException message. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the field that triggered the ValidationException. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // ErrorTypeValidationException is a ErrorType enum value - ErrorTypeValidationException = "VALIDATION_EXCEPTION" - - // ErrorTypeResourceNotFoundException is a ErrorType enum value - ErrorTypeResourceNotFoundException = "RESOURCE_NOT_FOUND_EXCEPTION" -) - -// ErrorType_Values returns all elements of the ErrorType enum -func ErrorType_Values() []string { - return []string{ - ErrorTypeValidationException, - ErrorTypeResourceNotFoundException, - } -} - -const ( - // ListTransactionsSortByTransactionTimestamp is a ListTransactionsSortBy enum value - ListTransactionsSortByTransactionTimestamp = "TRANSACTION_TIMESTAMP" -) - -// ListTransactionsSortBy_Values returns all elements of the ListTransactionsSortBy enum -func ListTransactionsSortBy_Values() []string { - return []string{ - ListTransactionsSortByTransactionTimestamp, - } -} - -const ( - // QueryNetworkEthereumMainnet is a QueryNetwork enum value - QueryNetworkEthereumMainnet = "ETHEREUM_MAINNET" - - // QueryNetworkBitcoinMainnet is a QueryNetwork enum value - QueryNetworkBitcoinMainnet = "BITCOIN_MAINNET" - - // QueryNetworkBitcoinTestnet is a QueryNetwork enum value - QueryNetworkBitcoinTestnet = "BITCOIN_TESTNET" - - // QueryNetworkEthereumSepoliaTestnet is a QueryNetwork enum value - QueryNetworkEthereumSepoliaTestnet = "ETHEREUM_SEPOLIA_TESTNET" -) - -// QueryNetwork_Values returns all elements of the QueryNetwork enum -func QueryNetwork_Values() []string { - return []string{ - QueryNetworkEthereumMainnet, - QueryNetworkBitcoinMainnet, - QueryNetworkBitcoinTestnet, - QueryNetworkEthereumSepoliaTestnet, - } -} - -const ( - // QueryTokenStandardErc20 is a QueryTokenStandard enum value - QueryTokenStandardErc20 = "ERC20" - - // QueryTokenStandardErc721 is a QueryTokenStandard enum value - QueryTokenStandardErc721 = "ERC721" - - // QueryTokenStandardErc1155 is a QueryTokenStandard enum value - QueryTokenStandardErc1155 = "ERC1155" -) - -// QueryTokenStandard_Values returns all elements of the QueryTokenStandard enum -func QueryTokenStandard_Values() []string { - return []string{ - QueryTokenStandardErc20, - QueryTokenStandardErc721, - QueryTokenStandardErc1155, - } -} - -const ( - // QueryTransactionEventTypeErc20Transfer is a QueryTransactionEventType enum value - QueryTransactionEventTypeErc20Transfer = "ERC20_TRANSFER" - - // QueryTransactionEventTypeErc20Mint is a QueryTransactionEventType enum value - QueryTransactionEventTypeErc20Mint = "ERC20_MINT" - - // QueryTransactionEventTypeErc20Burn is a QueryTransactionEventType enum value - QueryTransactionEventTypeErc20Burn = "ERC20_BURN" - - // QueryTransactionEventTypeErc20Deposit is a QueryTransactionEventType enum value - QueryTransactionEventTypeErc20Deposit = "ERC20_DEPOSIT" - - // QueryTransactionEventTypeErc20Withdrawal is a QueryTransactionEventType enum value - QueryTransactionEventTypeErc20Withdrawal = "ERC20_WITHDRAWAL" - - // QueryTransactionEventTypeErc721Transfer is a QueryTransactionEventType enum value - QueryTransactionEventTypeErc721Transfer = "ERC721_TRANSFER" - - // QueryTransactionEventTypeErc1155Transfer is a QueryTransactionEventType enum value - QueryTransactionEventTypeErc1155Transfer = "ERC1155_TRANSFER" - - // QueryTransactionEventTypeBitcoinVin is a QueryTransactionEventType enum value - QueryTransactionEventTypeBitcoinVin = "BITCOIN_VIN" - - // QueryTransactionEventTypeBitcoinVout is a QueryTransactionEventType enum value - QueryTransactionEventTypeBitcoinVout = "BITCOIN_VOUT" - - // QueryTransactionEventTypeInternalEthTransfer is a QueryTransactionEventType enum value - QueryTransactionEventTypeInternalEthTransfer = "INTERNAL_ETH_TRANSFER" - - // QueryTransactionEventTypeEthTransfer is a QueryTransactionEventType enum value - QueryTransactionEventTypeEthTransfer = "ETH_TRANSFER" -) - -// QueryTransactionEventType_Values returns all elements of the QueryTransactionEventType enum -func QueryTransactionEventType_Values() []string { - return []string{ - QueryTransactionEventTypeErc20Transfer, - QueryTransactionEventTypeErc20Mint, - QueryTransactionEventTypeErc20Burn, - QueryTransactionEventTypeErc20Deposit, - QueryTransactionEventTypeErc20Withdrawal, - QueryTransactionEventTypeErc721Transfer, - QueryTransactionEventTypeErc1155Transfer, - QueryTransactionEventTypeBitcoinVin, - QueryTransactionEventTypeBitcoinVout, - QueryTransactionEventTypeInternalEthTransfer, - QueryTransactionEventTypeEthTransfer, - } -} - -const ( - // QueryTransactionStatusFinal is a QueryTransactionStatus enum value - QueryTransactionStatusFinal = "FINAL" - - // QueryTransactionStatusFailed is a QueryTransactionStatus enum value - QueryTransactionStatusFailed = "FAILED" -) - -// QueryTransactionStatus_Values returns all elements of the QueryTransactionStatus enum -func QueryTransactionStatus_Values() []string { - return []string{ - QueryTransactionStatusFinal, - QueryTransactionStatusFailed, - } -} - -const ( - // ResourceTypeCollection is a ResourceType enum value - ResourceTypeCollection = "collection" -) - -// ResourceType_Values returns all elements of the ResourceType enum -func ResourceType_Values() []string { - return []string{ - ResourceTypeCollection, - } -} - -const ( - // SortOrderAscending is a SortOrder enum value - SortOrderAscending = "ASCENDING" - - // SortOrderDescending is a SortOrder enum value - SortOrderDescending = "DESCENDING" -) - -// SortOrder_Values returns all elements of the SortOrder enum -func SortOrder_Values() []string { - return []string{ - SortOrderAscending, - SortOrderDescending, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/doc.go deleted file mode 100644 index 4bda751321e1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/doc.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package managedblockchainquery provides the client and types for making API -// requests to Amazon Managed Blockchain Query. -// -// Amazon Managed Blockchain (AMB) Query provides you with convenient access -// to multi-blockchain network data, which makes it easier for you to extract -// contextual data related to blockchain activity. You can use AMB Query to -// read data from public blockchain networks, such as Bitcoin Mainnet and Ethereum -// Mainnet. You can also get information such as the current and historical -// balances of addresses, or you can get a list of blockchain transactions for -// a given time period. Additionally, you can get details of a given transaction, -// such as transaction events, which you can further analyze or use in business -// logic for your applications. -// -// See https://docs.aws.amazon.com/goto/WebAPI/managedblockchain-query-2023-05-04 for more information on this service. -// -// See managedblockchainquery package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/managedblockchainquery/ -// -// # Using the Client -// -// To contact Amazon Managed Blockchain Query with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Managed Blockchain Query client ManagedBlockchainQuery for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/managedblockchainquery/#New -package managedblockchainquery diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/errors.go deleted file mode 100644 index 762151ba4fa2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/errors.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package managedblockchainquery - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // The Amazon Web Services account doesn’t have access to this resource. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request processing has failed because of an internal error in the service. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The service quota has been exceeded for this resource. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request or operation couldn't be performed because a service is throttling - // requests. The most common source of throttling errors is when you create - // resources that exceed your service limit for this resource type. Request - // a limit increase or delete unused resources, if possible. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The resource passed is invalid. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/managedblockchainqueryiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/managedblockchainqueryiface/interface.go deleted file mode 100644 index 79c4bd1e1b5e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/managedblockchainqueryiface/interface.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package managedblockchainqueryiface provides an interface to enable mocking the Amazon Managed Blockchain Query service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package managedblockchainqueryiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery" -) - -// ManagedBlockchainQueryAPI provides an interface to enable mocking the -// managedblockchainquery.ManagedBlockchainQuery service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Managed Blockchain Query. -// func myFunc(svc managedblockchainqueryiface.ManagedBlockchainQueryAPI) bool { -// // Make svc.BatchGetTokenBalance request -// } -// -// func main() { -// sess := session.New() -// svc := managedblockchainquery.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockManagedBlockchainQueryClient struct { -// managedblockchainqueryiface.ManagedBlockchainQueryAPI -// } -// func (m *mockManagedBlockchainQueryClient) BatchGetTokenBalance(input *managedblockchainquery.BatchGetTokenBalanceInput) (*managedblockchainquery.BatchGetTokenBalanceOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockManagedBlockchainQueryClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type ManagedBlockchainQueryAPI interface { - BatchGetTokenBalance(*managedblockchainquery.BatchGetTokenBalanceInput) (*managedblockchainquery.BatchGetTokenBalanceOutput, error) - BatchGetTokenBalanceWithContext(aws.Context, *managedblockchainquery.BatchGetTokenBalanceInput, ...request.Option) (*managedblockchainquery.BatchGetTokenBalanceOutput, error) - BatchGetTokenBalanceRequest(*managedblockchainquery.BatchGetTokenBalanceInput) (*request.Request, *managedblockchainquery.BatchGetTokenBalanceOutput) - - GetAssetContract(*managedblockchainquery.GetAssetContractInput) (*managedblockchainquery.GetAssetContractOutput, error) - GetAssetContractWithContext(aws.Context, *managedblockchainquery.GetAssetContractInput, ...request.Option) (*managedblockchainquery.GetAssetContractOutput, error) - GetAssetContractRequest(*managedblockchainquery.GetAssetContractInput) (*request.Request, *managedblockchainquery.GetAssetContractOutput) - - GetTokenBalance(*managedblockchainquery.GetTokenBalanceInput) (*managedblockchainquery.GetTokenBalanceOutput, error) - GetTokenBalanceWithContext(aws.Context, *managedblockchainquery.GetTokenBalanceInput, ...request.Option) (*managedblockchainquery.GetTokenBalanceOutput, error) - GetTokenBalanceRequest(*managedblockchainquery.GetTokenBalanceInput) (*request.Request, *managedblockchainquery.GetTokenBalanceOutput) - - GetTransaction(*managedblockchainquery.GetTransactionInput) (*managedblockchainquery.GetTransactionOutput, error) - GetTransactionWithContext(aws.Context, *managedblockchainquery.GetTransactionInput, ...request.Option) (*managedblockchainquery.GetTransactionOutput, error) - GetTransactionRequest(*managedblockchainquery.GetTransactionInput) (*request.Request, *managedblockchainquery.GetTransactionOutput) - - ListAssetContracts(*managedblockchainquery.ListAssetContractsInput) (*managedblockchainquery.ListAssetContractsOutput, error) - ListAssetContractsWithContext(aws.Context, *managedblockchainquery.ListAssetContractsInput, ...request.Option) (*managedblockchainquery.ListAssetContractsOutput, error) - ListAssetContractsRequest(*managedblockchainquery.ListAssetContractsInput) (*request.Request, *managedblockchainquery.ListAssetContractsOutput) - - ListAssetContractsPages(*managedblockchainquery.ListAssetContractsInput, func(*managedblockchainquery.ListAssetContractsOutput, bool) bool) error - ListAssetContractsPagesWithContext(aws.Context, *managedblockchainquery.ListAssetContractsInput, func(*managedblockchainquery.ListAssetContractsOutput, bool) bool, ...request.Option) error - - ListTokenBalances(*managedblockchainquery.ListTokenBalancesInput) (*managedblockchainquery.ListTokenBalancesOutput, error) - ListTokenBalancesWithContext(aws.Context, *managedblockchainquery.ListTokenBalancesInput, ...request.Option) (*managedblockchainquery.ListTokenBalancesOutput, error) - ListTokenBalancesRequest(*managedblockchainquery.ListTokenBalancesInput) (*request.Request, *managedblockchainquery.ListTokenBalancesOutput) - - ListTokenBalancesPages(*managedblockchainquery.ListTokenBalancesInput, func(*managedblockchainquery.ListTokenBalancesOutput, bool) bool) error - ListTokenBalancesPagesWithContext(aws.Context, *managedblockchainquery.ListTokenBalancesInput, func(*managedblockchainquery.ListTokenBalancesOutput, bool) bool, ...request.Option) error - - ListTransactionEvents(*managedblockchainquery.ListTransactionEventsInput) (*managedblockchainquery.ListTransactionEventsOutput, error) - ListTransactionEventsWithContext(aws.Context, *managedblockchainquery.ListTransactionEventsInput, ...request.Option) (*managedblockchainquery.ListTransactionEventsOutput, error) - ListTransactionEventsRequest(*managedblockchainquery.ListTransactionEventsInput) (*request.Request, *managedblockchainquery.ListTransactionEventsOutput) - - ListTransactionEventsPages(*managedblockchainquery.ListTransactionEventsInput, func(*managedblockchainquery.ListTransactionEventsOutput, bool) bool) error - ListTransactionEventsPagesWithContext(aws.Context, *managedblockchainquery.ListTransactionEventsInput, func(*managedblockchainquery.ListTransactionEventsOutput, bool) bool, ...request.Option) error - - ListTransactions(*managedblockchainquery.ListTransactionsInput) (*managedblockchainquery.ListTransactionsOutput, error) - ListTransactionsWithContext(aws.Context, *managedblockchainquery.ListTransactionsInput, ...request.Option) (*managedblockchainquery.ListTransactionsOutput, error) - ListTransactionsRequest(*managedblockchainquery.ListTransactionsInput) (*request.Request, *managedblockchainquery.ListTransactionsOutput) - - ListTransactionsPages(*managedblockchainquery.ListTransactionsInput, func(*managedblockchainquery.ListTransactionsOutput, bool) bool) error - ListTransactionsPagesWithContext(aws.Context, *managedblockchainquery.ListTransactionsInput, func(*managedblockchainquery.ListTransactionsOutput, bool) bool, ...request.Option) error -} - -var _ ManagedBlockchainQueryAPI = (*managedblockchainquery.ManagedBlockchainQuery)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/service.go deleted file mode 100644 index 8148a89c20c5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/managedblockchainquery/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package managedblockchainquery - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// ManagedBlockchainQuery provides the API operation methods for making requests to -// Amazon Managed Blockchain Query. See this package's package overview docs -// for details on the service. -// -// ManagedBlockchainQuery methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ManagedBlockchainQuery struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ManagedBlockchain Query" // Name of service. - EndpointsID = "managedblockchain-query" // ID to lookup a service endpoint with. - ServiceID = "ManagedBlockchain Query" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the ManagedBlockchainQuery client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a ManagedBlockchainQuery client from just a session. -// svc := managedblockchainquery.New(mySession) -// -// // Create a ManagedBlockchainQuery client with additional configuration -// svc := managedblockchainquery.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ManagedBlockchainQuery { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "managedblockchain-query" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ManagedBlockchainQuery { - svc := &ManagedBlockchainQuery{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-05-04", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ManagedBlockchainQuery operation and runs any -// custom request initialization. -func (c *ManagedBlockchainQuery) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/api.go deleted file mode 100644 index 005689f65e73..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/api.go +++ /dev/null @@ -1,8614 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package mediapackagev2 - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateChannel = "CreateChannel" - -// CreateChannelRequest generates a "aws/request.Request" representing the -// client's request for the CreateChannel 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 CreateChannel for more information on using the CreateChannel -// 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 CreateChannelRequest method. -// req, resp := client.CreateChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/CreateChannel -func (c *MediaPackageV2) CreateChannelRequest(input *CreateChannelInput) (req *request.Request, output *CreateChannelOutput) { - op := &request.Operation{ - Name: opCreateChannel, - HTTPMethod: "POST", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel", - } - - if input == nil { - input = &CreateChannelInput{} - } - - output = &CreateChannelOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateChannel API operation for AWS Elemental MediaPackage v2. -// -// Create a channel to start receiving content streams. The channel represents -// the input to MediaPackage for incoming live content from an encoder such -// as AWS Elemental MediaLive. The channel receives content, and after packaging -// it, outputs it through an origin endpoint to downstream devices (such as -// video players or CDNs) that request the content. You can create only one -// channel with each request. We recommend that you spread out channels between -// channel groups, such as putting redundant channels in the same AWS Region -// in different channel groups. -// -// 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 AWS Elemental MediaPackage v2's -// API operation CreateChannel for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/CreateChannel -func (c *MediaPackageV2) CreateChannel(input *CreateChannelInput) (*CreateChannelOutput, error) { - req, out := c.CreateChannelRequest(input) - return out, req.Send() -} - -// CreateChannelWithContext is the same as CreateChannel with the addition of -// the ability to pass a context and additional request options. -// -// See CreateChannel 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 *MediaPackageV2) CreateChannelWithContext(ctx aws.Context, input *CreateChannelInput, opts ...request.Option) (*CreateChannelOutput, error) { - req, out := c.CreateChannelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateChannelGroup = "CreateChannelGroup" - -// CreateChannelGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateChannelGroup 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 CreateChannelGroup for more information on using the CreateChannelGroup -// 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 CreateChannelGroupRequest method. -// req, resp := client.CreateChannelGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/CreateChannelGroup -func (c *MediaPackageV2) CreateChannelGroupRequest(input *CreateChannelGroupInput) (req *request.Request, output *CreateChannelGroupOutput) { - op := &request.Operation{ - Name: opCreateChannelGroup, - HTTPMethod: "POST", - HTTPPath: "/channelGroup", - } - - if input == nil { - input = &CreateChannelGroupInput{} - } - - output = &CreateChannelGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateChannelGroup API operation for AWS Elemental MediaPackage v2. -// -// Create a channel group to group your channels and origin endpoints. A channel -// group is the top-level resource that consists of channels and origin endpoints -// that are associated with it and that provides predictable URLs for stream -// delivery. All channels and origin endpoints within the channel group are -// guaranteed to share the DNS. You can create only one channel group with each -// request. -// -// 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 AWS Elemental MediaPackage v2's -// API operation CreateChannelGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/CreateChannelGroup -func (c *MediaPackageV2) CreateChannelGroup(input *CreateChannelGroupInput) (*CreateChannelGroupOutput, error) { - req, out := c.CreateChannelGroupRequest(input) - return out, req.Send() -} - -// CreateChannelGroupWithContext is the same as CreateChannelGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateChannelGroup 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 *MediaPackageV2) CreateChannelGroupWithContext(ctx aws.Context, input *CreateChannelGroupInput, opts ...request.Option) (*CreateChannelGroupOutput, error) { - req, out := c.CreateChannelGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateOriginEndpoint = "CreateOriginEndpoint" - -// CreateOriginEndpointRequest generates a "aws/request.Request" representing the -// client's request for the CreateOriginEndpoint 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 CreateOriginEndpoint for more information on using the CreateOriginEndpoint -// 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 CreateOriginEndpointRequest method. -// req, resp := client.CreateOriginEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/CreateOriginEndpoint -func (c *MediaPackageV2) CreateOriginEndpointRequest(input *CreateOriginEndpointInput) (req *request.Request, output *CreateOriginEndpointOutput) { - op := &request.Operation{ - Name: opCreateOriginEndpoint, - HTTPMethod: "POST", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint", - } - - if input == nil { - input = &CreateOriginEndpointInput{} - } - - output = &CreateOriginEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateOriginEndpoint API operation for AWS Elemental MediaPackage v2. -// -// The endpoint is attached to a channel, and represents the output of the live -// content. You can associate multiple endpoints to a single channel. Each endpoint -// gives players and downstream CDNs (such as Amazon CloudFront) access to the -// content for playback. Content can't be served from a channel until it has -// an endpoint. You can create only one endpoint with each request. -// -// 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 AWS Elemental MediaPackage v2's -// API operation CreateOriginEndpoint for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/CreateOriginEndpoint -func (c *MediaPackageV2) CreateOriginEndpoint(input *CreateOriginEndpointInput) (*CreateOriginEndpointOutput, error) { - req, out := c.CreateOriginEndpointRequest(input) - return out, req.Send() -} - -// CreateOriginEndpointWithContext is the same as CreateOriginEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See CreateOriginEndpoint 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 *MediaPackageV2) CreateOriginEndpointWithContext(ctx aws.Context, input *CreateOriginEndpointInput, opts ...request.Option) (*CreateOriginEndpointOutput, error) { - req, out := c.CreateOriginEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteChannel = "DeleteChannel" - -// DeleteChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteChannel 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 DeleteChannel for more information on using the DeleteChannel -// 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 DeleteChannelRequest method. -// req, resp := client.DeleteChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteChannel -func (c *MediaPackageV2) DeleteChannelRequest(input *DeleteChannelInput) (req *request.Request, output *DeleteChannelOutput) { - op := &request.Operation{ - Name: opDeleteChannel, - HTTPMethod: "DELETE", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/", - } - - if input == nil { - input = &DeleteChannelInput{} - } - - output = &DeleteChannelOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteChannel API operation for AWS Elemental MediaPackage v2. -// -// Delete a channel to stop AWS Elemental MediaPackage from receiving further -// content. You must delete the channel's origin endpoints before you can delete -// the channel. -// -// 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 AWS Elemental MediaPackage v2's -// API operation DeleteChannel for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteChannel -func (c *MediaPackageV2) DeleteChannel(input *DeleteChannelInput) (*DeleteChannelOutput, error) { - req, out := c.DeleteChannelRequest(input) - return out, req.Send() -} - -// DeleteChannelWithContext is the same as DeleteChannel with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteChannel 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 *MediaPackageV2) DeleteChannelWithContext(ctx aws.Context, input *DeleteChannelInput, opts ...request.Option) (*DeleteChannelOutput, error) { - req, out := c.DeleteChannelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteChannelGroup = "DeleteChannelGroup" - -// DeleteChannelGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteChannelGroup 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 DeleteChannelGroup for more information on using the DeleteChannelGroup -// 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 DeleteChannelGroupRequest method. -// req, resp := client.DeleteChannelGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteChannelGroup -func (c *MediaPackageV2) DeleteChannelGroupRequest(input *DeleteChannelGroupInput) (req *request.Request, output *DeleteChannelGroupOutput) { - op := &request.Operation{ - Name: opDeleteChannelGroup, - HTTPMethod: "DELETE", - HTTPPath: "/channelGroup/{ChannelGroupName}", - } - - if input == nil { - input = &DeleteChannelGroupInput{} - } - - output = &DeleteChannelGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteChannelGroup API operation for AWS Elemental MediaPackage v2. -// -// Delete a channel group. You must delete the channel group's channels and -// origin endpoints before you can delete the channel group. If you delete a -// channel group, you'll lose access to the egress domain and will have to create -// a new channel group to replace it. -// -// 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 AWS Elemental MediaPackage v2's -// API operation DeleteChannelGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteChannelGroup -func (c *MediaPackageV2) DeleteChannelGroup(input *DeleteChannelGroupInput) (*DeleteChannelGroupOutput, error) { - req, out := c.DeleteChannelGroupRequest(input) - return out, req.Send() -} - -// DeleteChannelGroupWithContext is the same as DeleteChannelGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteChannelGroup 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 *MediaPackageV2) DeleteChannelGroupWithContext(ctx aws.Context, input *DeleteChannelGroupInput, opts ...request.Option) (*DeleteChannelGroupOutput, error) { - req, out := c.DeleteChannelGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteChannelPolicy = "DeleteChannelPolicy" - -// DeleteChannelPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteChannelPolicy 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 DeleteChannelPolicy for more information on using the DeleteChannelPolicy -// 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 DeleteChannelPolicyRequest method. -// req, resp := client.DeleteChannelPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteChannelPolicy -func (c *MediaPackageV2) DeleteChannelPolicyRequest(input *DeleteChannelPolicyInput) (req *request.Request, output *DeleteChannelPolicyOutput) { - op := &request.Operation{ - Name: opDeleteChannelPolicy, - HTTPMethod: "DELETE", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy", - } - - if input == nil { - input = &DeleteChannelPolicyInput{} - } - - output = &DeleteChannelPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteChannelPolicy API operation for AWS Elemental MediaPackage v2. -// -// Delete a channel policy. -// -// 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 AWS Elemental MediaPackage v2's -// API operation DeleteChannelPolicy for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteChannelPolicy -func (c *MediaPackageV2) DeleteChannelPolicy(input *DeleteChannelPolicyInput) (*DeleteChannelPolicyOutput, error) { - req, out := c.DeleteChannelPolicyRequest(input) - return out, req.Send() -} - -// DeleteChannelPolicyWithContext is the same as DeleteChannelPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteChannelPolicy 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 *MediaPackageV2) DeleteChannelPolicyWithContext(ctx aws.Context, input *DeleteChannelPolicyInput, opts ...request.Option) (*DeleteChannelPolicyOutput, error) { - req, out := c.DeleteChannelPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteOriginEndpoint = "DeleteOriginEndpoint" - -// DeleteOriginEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DeleteOriginEndpoint 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 DeleteOriginEndpoint for more information on using the DeleteOriginEndpoint -// 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 DeleteOriginEndpointRequest method. -// req, resp := client.DeleteOriginEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteOriginEndpoint -func (c *MediaPackageV2) DeleteOriginEndpointRequest(input *DeleteOriginEndpointInput) (req *request.Request, output *DeleteOriginEndpointOutput) { - op := &request.Operation{ - Name: opDeleteOriginEndpoint, - HTTPMethod: "DELETE", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}", - } - - if input == nil { - input = &DeleteOriginEndpointInput{} - } - - output = &DeleteOriginEndpointOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteOriginEndpoint API operation for AWS Elemental MediaPackage v2. -// -// Origin endpoints can serve content until they're deleted. Delete the endpoint -// if it should no longer respond to playback requests. You must delete all -// endpoints from a channel before you can delete the channel. -// -// 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 AWS Elemental MediaPackage v2's -// API operation DeleteOriginEndpoint for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteOriginEndpoint -func (c *MediaPackageV2) DeleteOriginEndpoint(input *DeleteOriginEndpointInput) (*DeleteOriginEndpointOutput, error) { - req, out := c.DeleteOriginEndpointRequest(input) - return out, req.Send() -} - -// DeleteOriginEndpointWithContext is the same as DeleteOriginEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteOriginEndpoint 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 *MediaPackageV2) DeleteOriginEndpointWithContext(ctx aws.Context, input *DeleteOriginEndpointInput, opts ...request.Option) (*DeleteOriginEndpointOutput, error) { - req, out := c.DeleteOriginEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteOriginEndpointPolicy = "DeleteOriginEndpointPolicy" - -// DeleteOriginEndpointPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteOriginEndpointPolicy 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 DeleteOriginEndpointPolicy for more information on using the DeleteOriginEndpointPolicy -// 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 DeleteOriginEndpointPolicyRequest method. -// req, resp := client.DeleteOriginEndpointPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteOriginEndpointPolicy -func (c *MediaPackageV2) DeleteOriginEndpointPolicyRequest(input *DeleteOriginEndpointPolicyInput) (req *request.Request, output *DeleteOriginEndpointPolicyOutput) { - op := &request.Operation{ - Name: opDeleteOriginEndpointPolicy, - HTTPMethod: "DELETE", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy", - } - - if input == nil { - input = &DeleteOriginEndpointPolicyInput{} - } - - output = &DeleteOriginEndpointPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteOriginEndpointPolicy API operation for AWS Elemental MediaPackage v2. -// -// Delete an origin endpoint policy. -// -// 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 AWS Elemental MediaPackage v2's -// API operation DeleteOriginEndpointPolicy for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/DeleteOriginEndpointPolicy -func (c *MediaPackageV2) DeleteOriginEndpointPolicy(input *DeleteOriginEndpointPolicyInput) (*DeleteOriginEndpointPolicyOutput, error) { - req, out := c.DeleteOriginEndpointPolicyRequest(input) - return out, req.Send() -} - -// DeleteOriginEndpointPolicyWithContext is the same as DeleteOriginEndpointPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteOriginEndpointPolicy 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 *MediaPackageV2) DeleteOriginEndpointPolicyWithContext(ctx aws.Context, input *DeleteOriginEndpointPolicyInput, opts ...request.Option) (*DeleteOriginEndpointPolicyOutput, error) { - req, out := c.DeleteOriginEndpointPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetChannel = "GetChannel" - -// GetChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetChannel 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 GetChannel for more information on using the GetChannel -// 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 GetChannelRequest method. -// req, resp := client.GetChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetChannel -func (c *MediaPackageV2) GetChannelRequest(input *GetChannelInput) (req *request.Request, output *GetChannelOutput) { - op := &request.Operation{ - Name: opGetChannel, - HTTPMethod: "GET", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/", - } - - if input == nil { - input = &GetChannelInput{} - } - - output = &GetChannelOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChannel API operation for AWS Elemental MediaPackage v2. -// -// Retrieves the specified channel that's configured in AWS Elemental MediaPackage, -// including the origin endpoints that are associated with it. -// -// 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 AWS Elemental MediaPackage v2's -// API operation GetChannel for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetChannel -func (c *MediaPackageV2) GetChannel(input *GetChannelInput) (*GetChannelOutput, error) { - req, out := c.GetChannelRequest(input) - return out, req.Send() -} - -// GetChannelWithContext is the same as GetChannel with the addition of -// the ability to pass a context and additional request options. -// -// See GetChannel 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 *MediaPackageV2) GetChannelWithContext(ctx aws.Context, input *GetChannelInput, opts ...request.Option) (*GetChannelOutput, error) { - req, out := c.GetChannelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetChannelGroup = "GetChannelGroup" - -// GetChannelGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetChannelGroup 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 GetChannelGroup for more information on using the GetChannelGroup -// 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 GetChannelGroupRequest method. -// req, resp := client.GetChannelGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetChannelGroup -func (c *MediaPackageV2) GetChannelGroupRequest(input *GetChannelGroupInput) (req *request.Request, output *GetChannelGroupOutput) { - op := &request.Operation{ - Name: opGetChannelGroup, - HTTPMethod: "GET", - HTTPPath: "/channelGroup/{ChannelGroupName}", - } - - if input == nil { - input = &GetChannelGroupInput{} - } - - output = &GetChannelGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChannelGroup API operation for AWS Elemental MediaPackage v2. -// -// Retrieves the specified channel group that's configured in AWS Elemental -// MediaPackage, including the channels and origin endpoints that are associated -// with it. -// -// 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 AWS Elemental MediaPackage v2's -// API operation GetChannelGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetChannelGroup -func (c *MediaPackageV2) GetChannelGroup(input *GetChannelGroupInput) (*GetChannelGroupOutput, error) { - req, out := c.GetChannelGroupRequest(input) - return out, req.Send() -} - -// GetChannelGroupWithContext is the same as GetChannelGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetChannelGroup 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 *MediaPackageV2) GetChannelGroupWithContext(ctx aws.Context, input *GetChannelGroupInput, opts ...request.Option) (*GetChannelGroupOutput, error) { - req, out := c.GetChannelGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetChannelPolicy = "GetChannelPolicy" - -// GetChannelPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetChannelPolicy 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 GetChannelPolicy for more information on using the GetChannelPolicy -// 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 GetChannelPolicyRequest method. -// req, resp := client.GetChannelPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetChannelPolicy -func (c *MediaPackageV2) GetChannelPolicyRequest(input *GetChannelPolicyInput) (req *request.Request, output *GetChannelPolicyOutput) { - op := &request.Operation{ - Name: opGetChannelPolicy, - HTTPMethod: "GET", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy", - } - - if input == nil { - input = &GetChannelPolicyInput{} - } - - output = &GetChannelPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChannelPolicy API operation for AWS Elemental MediaPackage v2. -// -// Retrieves the specified channel policy that's configured in AWS Elemental -// MediaPackage. With policies, you can specify who has access to AWS resources -// and what actions they can perform on those resources. -// -// 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 AWS Elemental MediaPackage v2's -// API operation GetChannelPolicy for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetChannelPolicy -func (c *MediaPackageV2) GetChannelPolicy(input *GetChannelPolicyInput) (*GetChannelPolicyOutput, error) { - req, out := c.GetChannelPolicyRequest(input) - return out, req.Send() -} - -// GetChannelPolicyWithContext is the same as GetChannelPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetChannelPolicy 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 *MediaPackageV2) GetChannelPolicyWithContext(ctx aws.Context, input *GetChannelPolicyInput, opts ...request.Option) (*GetChannelPolicyOutput, error) { - req, out := c.GetChannelPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetOriginEndpoint = "GetOriginEndpoint" - -// GetOriginEndpointRequest generates a "aws/request.Request" representing the -// client's request for the GetOriginEndpoint 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 GetOriginEndpoint for more information on using the GetOriginEndpoint -// 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 GetOriginEndpointRequest method. -// req, resp := client.GetOriginEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetOriginEndpoint -func (c *MediaPackageV2) GetOriginEndpointRequest(input *GetOriginEndpointInput) (req *request.Request, output *GetOriginEndpointOutput) { - op := &request.Operation{ - Name: opGetOriginEndpoint, - HTTPMethod: "GET", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}", - } - - if input == nil { - input = &GetOriginEndpointInput{} - } - - output = &GetOriginEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOriginEndpoint API operation for AWS Elemental MediaPackage v2. -// -// Retrieves the specified origin endpoint that's configured in AWS Elemental -// MediaPackage to obtain its playback URL and to view the packaging settings -// that it's currently using. -// -// 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 AWS Elemental MediaPackage v2's -// API operation GetOriginEndpoint for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetOriginEndpoint -func (c *MediaPackageV2) GetOriginEndpoint(input *GetOriginEndpointInput) (*GetOriginEndpointOutput, error) { - req, out := c.GetOriginEndpointRequest(input) - return out, req.Send() -} - -// GetOriginEndpointWithContext is the same as GetOriginEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See GetOriginEndpoint 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 *MediaPackageV2) GetOriginEndpointWithContext(ctx aws.Context, input *GetOriginEndpointInput, opts ...request.Option) (*GetOriginEndpointOutput, error) { - req, out := c.GetOriginEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetOriginEndpointPolicy = "GetOriginEndpointPolicy" - -// GetOriginEndpointPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetOriginEndpointPolicy 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 GetOriginEndpointPolicy for more information on using the GetOriginEndpointPolicy -// 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 GetOriginEndpointPolicyRequest method. -// req, resp := client.GetOriginEndpointPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetOriginEndpointPolicy -func (c *MediaPackageV2) GetOriginEndpointPolicyRequest(input *GetOriginEndpointPolicyInput) (req *request.Request, output *GetOriginEndpointPolicyOutput) { - op := &request.Operation{ - Name: opGetOriginEndpointPolicy, - HTTPMethod: "GET", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy", - } - - if input == nil { - input = &GetOriginEndpointPolicyInput{} - } - - output = &GetOriginEndpointPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOriginEndpointPolicy API operation for AWS Elemental MediaPackage v2. -// -// Retrieves the specified origin endpoint policy that's configured in AWS Elemental -// MediaPackage. -// -// 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 AWS Elemental MediaPackage v2's -// API operation GetOriginEndpointPolicy for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/GetOriginEndpointPolicy -func (c *MediaPackageV2) GetOriginEndpointPolicy(input *GetOriginEndpointPolicyInput) (*GetOriginEndpointPolicyOutput, error) { - req, out := c.GetOriginEndpointPolicyRequest(input) - return out, req.Send() -} - -// GetOriginEndpointPolicyWithContext is the same as GetOriginEndpointPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetOriginEndpointPolicy 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 *MediaPackageV2) GetOriginEndpointPolicyWithContext(ctx aws.Context, input *GetOriginEndpointPolicyInput, opts ...request.Option) (*GetOriginEndpointPolicyOutput, error) { - req, out := c.GetOriginEndpointPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListChannelGroups = "ListChannelGroups" - -// ListChannelGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListChannelGroups 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 ListChannelGroups for more information on using the ListChannelGroups -// 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 ListChannelGroupsRequest method. -// req, resp := client.ListChannelGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/ListChannelGroups -func (c *MediaPackageV2) ListChannelGroupsRequest(input *ListChannelGroupsInput) (req *request.Request, output *ListChannelGroupsOutput) { - op := &request.Operation{ - Name: opListChannelGroups, - HTTPMethod: "GET", - HTTPPath: "/channelGroup", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListChannelGroupsInput{} - } - - output = &ListChannelGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListChannelGroups API operation for AWS Elemental MediaPackage v2. -// -// Retrieves all channel groups that are configured in AWS Elemental MediaPackage, -// including the channels and origin endpoints that are associated with it. -// -// 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 AWS Elemental MediaPackage v2's -// API operation ListChannelGroups for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/ListChannelGroups -func (c *MediaPackageV2) ListChannelGroups(input *ListChannelGroupsInput) (*ListChannelGroupsOutput, error) { - req, out := c.ListChannelGroupsRequest(input) - return out, req.Send() -} - -// ListChannelGroupsWithContext is the same as ListChannelGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListChannelGroups 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 *MediaPackageV2) ListChannelGroupsWithContext(ctx aws.Context, input *ListChannelGroupsInput, opts ...request.Option) (*ListChannelGroupsOutput, error) { - req, out := c.ListChannelGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListChannelGroupsPages iterates over the pages of a ListChannelGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChannelGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListChannelGroups operation. -// pageNum := 0 -// err := client.ListChannelGroupsPages(params, -// func(page *mediapackagev2.ListChannelGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MediaPackageV2) ListChannelGroupsPages(input *ListChannelGroupsInput, fn func(*ListChannelGroupsOutput, bool) bool) error { - return c.ListChannelGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChannelGroupsPagesWithContext same as ListChannelGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MediaPackageV2) ListChannelGroupsPagesWithContext(ctx aws.Context, input *ListChannelGroupsInput, fn func(*ListChannelGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListChannelGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListChannelGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListChannelGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListChannels = "ListChannels" - -// ListChannelsRequest generates a "aws/request.Request" representing the -// client's request for the ListChannels 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 ListChannels for more information on using the ListChannels -// 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 ListChannelsRequest method. -// req, resp := client.ListChannelsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/ListChannels -func (c *MediaPackageV2) ListChannelsRequest(input *ListChannelsInput) (req *request.Request, output *ListChannelsOutput) { - op := &request.Operation{ - Name: opListChannels, - HTTPMethod: "GET", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListChannelsInput{} - } - - output = &ListChannelsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListChannels API operation for AWS Elemental MediaPackage v2. -// -// Retrieves all channels in a specific channel group that are configured in -// AWS Elemental MediaPackage, including the origin endpoints that are associated -// with it. -// -// 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 AWS Elemental MediaPackage v2's -// API operation ListChannels for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/ListChannels -func (c *MediaPackageV2) ListChannels(input *ListChannelsInput) (*ListChannelsOutput, error) { - req, out := c.ListChannelsRequest(input) - return out, req.Send() -} - -// ListChannelsWithContext is the same as ListChannels with the addition of -// the ability to pass a context and additional request options. -// -// See ListChannels 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 *MediaPackageV2) ListChannelsWithContext(ctx aws.Context, input *ListChannelsInput, opts ...request.Option) (*ListChannelsOutput, error) { - req, out := c.ListChannelsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListChannelsPages iterates over the pages of a ListChannels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChannels method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListChannels operation. -// pageNum := 0 -// err := client.ListChannelsPages(params, -// func(page *mediapackagev2.ListChannelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MediaPackageV2) ListChannelsPages(input *ListChannelsInput, fn func(*ListChannelsOutput, bool) bool) error { - return c.ListChannelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChannelsPagesWithContext same as ListChannelsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MediaPackageV2) ListChannelsPagesWithContext(ctx aws.Context, input *ListChannelsInput, fn func(*ListChannelsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListChannelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListChannelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListOriginEndpoints = "ListOriginEndpoints" - -// ListOriginEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the ListOriginEndpoints 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 ListOriginEndpoints for more information on using the ListOriginEndpoints -// 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 ListOriginEndpointsRequest method. -// req, resp := client.ListOriginEndpointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/ListOriginEndpoints -func (c *MediaPackageV2) ListOriginEndpointsRequest(input *ListOriginEndpointsInput) (req *request.Request, output *ListOriginEndpointsOutput) { - op := &request.Operation{ - Name: opListOriginEndpoints, - HTTPMethod: "GET", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListOriginEndpointsInput{} - } - - output = &ListOriginEndpointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOriginEndpoints API operation for AWS Elemental MediaPackage v2. -// -// Retrieves all origin endpoints in a specific channel that are configured -// in AWS Elemental MediaPackage. -// -// 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 AWS Elemental MediaPackage v2's -// API operation ListOriginEndpoints for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/ListOriginEndpoints -func (c *MediaPackageV2) ListOriginEndpoints(input *ListOriginEndpointsInput) (*ListOriginEndpointsOutput, error) { - req, out := c.ListOriginEndpointsRequest(input) - return out, req.Send() -} - -// ListOriginEndpointsWithContext is the same as ListOriginEndpoints with the addition of -// the ability to pass a context and additional request options. -// -// See ListOriginEndpoints 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 *MediaPackageV2) ListOriginEndpointsWithContext(ctx aws.Context, input *ListOriginEndpointsInput, opts ...request.Option) (*ListOriginEndpointsOutput, error) { - req, out := c.ListOriginEndpointsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListOriginEndpointsPages iterates over the pages of a ListOriginEndpoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOriginEndpoints method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListOriginEndpoints operation. -// pageNum := 0 -// err := client.ListOriginEndpointsPages(params, -// func(page *mediapackagev2.ListOriginEndpointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MediaPackageV2) ListOriginEndpointsPages(input *ListOriginEndpointsInput, fn func(*ListOriginEndpointsOutput, bool) bool) error { - return c.ListOriginEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOriginEndpointsPagesWithContext same as ListOriginEndpointsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MediaPackageV2) ListOriginEndpointsPagesWithContext(ctx aws.Context, input *ListOriginEndpointsInput, fn func(*ListOriginEndpointsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListOriginEndpointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListOriginEndpointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListOriginEndpointsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/ListTagsForResource -func (c *MediaPackageV2) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Elemental MediaPackage v2. -// -// Lists the tags assigned to a resource. -// -// 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 AWS Elemental MediaPackage v2's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/ListTagsForResource -func (c *MediaPackageV2) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *MediaPackageV2) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutChannelPolicy = "PutChannelPolicy" - -// PutChannelPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutChannelPolicy 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 PutChannelPolicy for more information on using the PutChannelPolicy -// 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 PutChannelPolicyRequest method. -// req, resp := client.PutChannelPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/PutChannelPolicy -func (c *MediaPackageV2) PutChannelPolicyRequest(input *PutChannelPolicyInput) (req *request.Request, output *PutChannelPolicyOutput) { - op := &request.Operation{ - Name: opPutChannelPolicy, - HTTPMethod: "PUT", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/policy", - } - - if input == nil { - input = &PutChannelPolicyInput{} - } - - output = &PutChannelPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutChannelPolicy API operation for AWS Elemental MediaPackage v2. -// -// Attaches an IAM policy to the specified channel. With policies, you can specify -// who has access to AWS resources and what actions they can perform on those -// resources. You can attach only one policy with each request. -// -// 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 AWS Elemental MediaPackage v2's -// API operation PutChannelPolicy for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/PutChannelPolicy -func (c *MediaPackageV2) PutChannelPolicy(input *PutChannelPolicyInput) (*PutChannelPolicyOutput, error) { - req, out := c.PutChannelPolicyRequest(input) - return out, req.Send() -} - -// PutChannelPolicyWithContext is the same as PutChannelPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutChannelPolicy 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 *MediaPackageV2) PutChannelPolicyWithContext(ctx aws.Context, input *PutChannelPolicyInput, opts ...request.Option) (*PutChannelPolicyOutput, error) { - req, out := c.PutChannelPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutOriginEndpointPolicy = "PutOriginEndpointPolicy" - -// PutOriginEndpointPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutOriginEndpointPolicy 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 PutOriginEndpointPolicy for more information on using the PutOriginEndpointPolicy -// 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 PutOriginEndpointPolicyRequest method. -// req, resp := client.PutOriginEndpointPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/PutOriginEndpointPolicy -func (c *MediaPackageV2) PutOriginEndpointPolicyRequest(input *PutOriginEndpointPolicyInput) (req *request.Request, output *PutOriginEndpointPolicyOutput) { - op := &request.Operation{ - Name: opPutOriginEndpointPolicy, - HTTPMethod: "POST", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}/policy", - } - - if input == nil { - input = &PutOriginEndpointPolicyInput{} - } - - output = &PutOriginEndpointPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutOriginEndpointPolicy API operation for AWS Elemental MediaPackage v2. -// -// Attaches an IAM policy to the specified origin endpoint. You can attach only -// one policy with each request. -// -// 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 AWS Elemental MediaPackage v2's -// API operation PutOriginEndpointPolicy for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/PutOriginEndpointPolicy -func (c *MediaPackageV2) PutOriginEndpointPolicy(input *PutOriginEndpointPolicyInput) (*PutOriginEndpointPolicyOutput, error) { - req, out := c.PutOriginEndpointPolicyRequest(input) - return out, req.Send() -} - -// PutOriginEndpointPolicyWithContext is the same as PutOriginEndpointPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutOriginEndpointPolicy 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 *MediaPackageV2) PutOriginEndpointPolicyWithContext(ctx aws.Context, input *PutOriginEndpointPolicyInput, opts ...request.Option) (*PutOriginEndpointPolicyOutput, error) { - req, out := c.PutOriginEndpointPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/TagResource -func (c *MediaPackageV2) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Elemental MediaPackage v2. -// -// Assigns one of more tags (key-value pairs) to the specified MediaPackage -// resource. -// -// Tags can help you organize and categorize your resources. You can also use -// them to scope user permissions, by granting a user permission to access or -// change only resources with certain tag values. You can use the TagResource -// operation with a resource that already has tags. If you specify a new tag -// key for the resource, this tag is appended to the list of tags associated -// with the resource. If you specify a tag key that is already associated with -// the resource, the new tag value that you specify replaces the previous value -// for that tag. -// -// 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 AWS Elemental MediaPackage v2's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/TagResource -func (c *MediaPackageV2) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *MediaPackageV2) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/UntagResource -func (c *MediaPackageV2) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Elemental MediaPackage v2. -// -// Removes one or more tags from the specified resource. -// -// 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 AWS Elemental MediaPackage v2's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/UntagResource -func (c *MediaPackageV2) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *MediaPackageV2) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateChannel = "UpdateChannel" - -// UpdateChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateChannel 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 UpdateChannel for more information on using the UpdateChannel -// 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 UpdateChannelRequest method. -// req, resp := client.UpdateChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/UpdateChannel -func (c *MediaPackageV2) UpdateChannelRequest(input *UpdateChannelInput) (req *request.Request, output *UpdateChannelOutput) { - op := &request.Operation{ - Name: opUpdateChannel, - HTTPMethod: "PUT", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/", - } - - if input == nil { - input = &UpdateChannelInput{} - } - - output = &UpdateChannelOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateChannel API operation for AWS Elemental MediaPackage v2. -// -// Update the specified channel. You can edit if MediaPackage sends ingest or -// egress access logs to the CloudWatch log group, if content will be encrypted, -// the description on a channel, and your channel's policy settings. You can't -// edit the name of the channel or CloudFront distribution details. -// -// Any edits you make that impact the video output may not be reflected for -// a few minutes. -// -// 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 AWS Elemental MediaPackage v2's -// API operation UpdateChannel for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/UpdateChannel -func (c *MediaPackageV2) UpdateChannel(input *UpdateChannelInput) (*UpdateChannelOutput, error) { - req, out := c.UpdateChannelRequest(input) - return out, req.Send() -} - -// UpdateChannelWithContext is the same as UpdateChannel with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateChannel 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 *MediaPackageV2) UpdateChannelWithContext(ctx aws.Context, input *UpdateChannelInput, opts ...request.Option) (*UpdateChannelOutput, error) { - req, out := c.UpdateChannelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateChannelGroup = "UpdateChannelGroup" - -// UpdateChannelGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateChannelGroup 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 UpdateChannelGroup for more information on using the UpdateChannelGroup -// 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 UpdateChannelGroupRequest method. -// req, resp := client.UpdateChannelGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/UpdateChannelGroup -func (c *MediaPackageV2) UpdateChannelGroupRequest(input *UpdateChannelGroupInput) (req *request.Request, output *UpdateChannelGroupOutput) { - op := &request.Operation{ - Name: opUpdateChannelGroup, - HTTPMethod: "PUT", - HTTPPath: "/channelGroup/{ChannelGroupName}", - } - - if input == nil { - input = &UpdateChannelGroupInput{} - } - - output = &UpdateChannelGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateChannelGroup API operation for AWS Elemental MediaPackage v2. -// -// Update the specified channel group. You can edit the description on a channel -// group for easier identification later from the AWS Elemental MediaPackage -// console. You can't edit the name of the channel group. -// -// Any edits you make that impact the video output may not be reflected for -// a few minutes. -// -// 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 AWS Elemental MediaPackage v2's -// API operation UpdateChannelGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/UpdateChannelGroup -func (c *MediaPackageV2) UpdateChannelGroup(input *UpdateChannelGroupInput) (*UpdateChannelGroupOutput, error) { - req, out := c.UpdateChannelGroupRequest(input) - return out, req.Send() -} - -// UpdateChannelGroupWithContext is the same as UpdateChannelGroup with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateChannelGroup 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 *MediaPackageV2) UpdateChannelGroupWithContext(ctx aws.Context, input *UpdateChannelGroupInput, opts ...request.Option) (*UpdateChannelGroupOutput, error) { - req, out := c.UpdateChannelGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateOriginEndpoint = "UpdateOriginEndpoint" - -// UpdateOriginEndpointRequest generates a "aws/request.Request" representing the -// client's request for the UpdateOriginEndpoint 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 UpdateOriginEndpoint for more information on using the UpdateOriginEndpoint -// 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 UpdateOriginEndpointRequest method. -// req, resp := client.UpdateOriginEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/UpdateOriginEndpoint -func (c *MediaPackageV2) UpdateOriginEndpointRequest(input *UpdateOriginEndpointInput) (req *request.Request, output *UpdateOriginEndpointOutput) { - op := &request.Operation{ - Name: opUpdateOriginEndpoint, - HTTPMethod: "PUT", - HTTPPath: "/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}", - } - - if input == nil { - input = &UpdateOriginEndpointInput{} - } - - output = &UpdateOriginEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateOriginEndpoint API operation for AWS Elemental MediaPackage v2. -// -// Update the specified origin endpoint. Edit the packaging preferences on an -// endpoint to optimize the viewing experience. You can't edit the name of the -// endpoint. -// -// Any edits you make that impact the video output may not be reflected for -// a few minutes. -// -// 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 AWS Elemental MediaPackage v2's -// API operation UpdateOriginEndpoint for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request throughput limit was exceeded. -// -// - ConflictException -// Updating or deleting this resource can cause an inconsistent state. -// -// - InternalServerException -// Indicates that an error from the service occurred while trying to process -// a request. -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -// -// - ValidationException -// The input failed to meet the constraints specified by the AWS service. -// -// - ResourceNotFoundException -// The specified resource doesn't exist. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25/UpdateOriginEndpoint -func (c *MediaPackageV2) UpdateOriginEndpoint(input *UpdateOriginEndpointInput) (*UpdateOriginEndpointOutput, error) { - req, out := c.UpdateOriginEndpointRequest(input) - return out, req.Send() -} - -// UpdateOriginEndpointWithContext is the same as UpdateOriginEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateOriginEndpoint 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 *MediaPackageV2) UpdateOriginEndpointWithContext(ctx aws.Context, input *UpdateOriginEndpointInput, opts ...request.Option) (*UpdateOriginEndpointOutput, error) { - req, out := c.UpdateOriginEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management in the IAM User Guide. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The configuration of the channel group. -type ChannelGroupListConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The date and time the channel group was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // Any descriptive information that you want to add to the channel group for - // future identification purposes. - Description *string `type:"string"` - - // The date and time the channel group was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" 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 ChannelGroupListConfiguration) 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 ChannelGroupListConfiguration) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ChannelGroupListConfiguration) SetArn(v string) *ChannelGroupListConfiguration { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *ChannelGroupListConfiguration) SetChannelGroupName(v string) *ChannelGroupListConfiguration { - s.ChannelGroupName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ChannelGroupListConfiguration) SetCreatedAt(v time.Time) *ChannelGroupListConfiguration { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ChannelGroupListConfiguration) SetDescription(v string) *ChannelGroupListConfiguration { - s.Description = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *ChannelGroupListConfiguration) SetModifiedAt(v time.Time) *ChannelGroupListConfiguration { - s.ModifiedAt = &v - return s -} - -// The configuration of the channel. -type ChannelListConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `type:"string" required:"true"` - - // The date and time the channel was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // Any descriptive information that you want to add to the channel for future - // identification purposes. - Description *string `type:"string"` - - // The date and time the channel was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" 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 ChannelListConfiguration) 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 ChannelListConfiguration) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ChannelListConfiguration) SetArn(v string) *ChannelListConfiguration { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *ChannelListConfiguration) SetChannelGroupName(v string) *ChannelListConfiguration { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *ChannelListConfiguration) SetChannelName(v string) *ChannelListConfiguration { - s.ChannelName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ChannelListConfiguration) SetCreatedAt(v time.Time) *ChannelListConfiguration { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ChannelListConfiguration) SetDescription(v string) *ChannelListConfiguration { - s.Description = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *ChannelListConfiguration) SetModifiedAt(v time.Time) *ChannelListConfiguration { - s.ModifiedAt = &v - return s -} - -// Updating or deleting this resource can cause an inconsistent state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The type of ConflictException. - ConflictExceptionType *string `type:"string" enum:"ConflictExceptionType"` - - Message_ *string `locationName:"Message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateChannelGroupInput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // You can't use spaces in the name. You can't change the name after you create - // the channel group. - // - // ChannelGroupName is a required field - ChannelGroupName *string `min:"1" type:"string" required:"true"` - - // A unique, case-sensitive token that you provide to ensure the idempotency - // of the request. - ClientToken *string `location:"header" locationName:"x-amzn-client-token" min:"1" type:"string" idempotencyToken:"true"` - - // Enter any descriptive text that helps you to identify the channel group. - Description *string `type:"string"` - - // A comma-separated list of tag key:value pairs that you define. For example: - // - // "Key1": "Value1", - // - // "Key2": "Value2" - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateChannelGroupInput) 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 CreateChannelGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateChannelGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateChannelGroupInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *CreateChannelGroupInput) SetChannelGroupName(v string) *CreateChannelGroupInput { - s.ChannelGroupName = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateChannelGroupInput) SetClientToken(v string) *CreateChannelGroupInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateChannelGroupInput) SetDescription(v string) *CreateChannelGroupInput { - s.Description = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateChannelGroupInput) SetTags(v map[string]*string) *CreateChannelGroupInput { - s.Tags = v - return s -} - -type CreateChannelGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The date and time the channel group was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description for your channel group. - Description *string `type:"string"` - - // The output domain where the source stream should be sent. Integrate the egress - // domain with a downstream CDN (such as Amazon CloudFront) or playback device. - // - // EgressDomain is a required field - EgressDomain *string `type:"string" required:"true"` - - // The date and time the channel group was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The comma-separated list of tag key:value pairs assigned to the channel group. - Tags map[string]*string `type:"map"` -} - -// 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 CreateChannelGroupOutput) 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 CreateChannelGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateChannelGroupOutput) SetArn(v string) *CreateChannelGroupOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *CreateChannelGroupOutput) SetChannelGroupName(v string) *CreateChannelGroupOutput { - s.ChannelGroupName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateChannelGroupOutput) SetCreatedAt(v time.Time) *CreateChannelGroupOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateChannelGroupOutput) SetDescription(v string) *CreateChannelGroupOutput { - s.Description = &v - return s -} - -// SetEgressDomain sets the EgressDomain field's value. -func (s *CreateChannelGroupOutput) SetEgressDomain(v string) *CreateChannelGroupOutput { - s.EgressDomain = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *CreateChannelGroupOutput) SetModifiedAt(v time.Time) *CreateChannelGroupOutput { - s.ModifiedAt = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateChannelGroupOutput) SetTags(v map[string]*string) *CreateChannelGroupOutput { - s.Tags = v - return s -} - -type CreateChannelInput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. You can't change the name after you create the channel. - // - // ChannelName is a required field - ChannelName *string `min:"1" type:"string" required:"true"` - - // A unique, case-sensitive token that you provide to ensure the idempotency - // of the request. - ClientToken *string `location:"header" locationName:"x-amzn-client-token" min:"1" type:"string" idempotencyToken:"true"` - - // Enter any descriptive text that helps you to identify the channel. - Description *string `type:"string"` - - // A comma-separated list of tag key:value pairs that you define. For example: - // - // "Key1": "Value1", - // - // "Key2": "Value2" - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateChannelInput) 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 CreateChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateChannelInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *CreateChannelInput) SetChannelGroupName(v string) *CreateChannelInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *CreateChannelInput) SetChannelName(v string) *CreateChannelInput { - s.ChannelName = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateChannelInput) SetClientToken(v string) *CreateChannelInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateChannelInput) SetDescription(v string) *CreateChannelInput { - s.Description = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateChannelInput) SetTags(v map[string]*string) *CreateChannelInput { - s.Tags = v - return s -} - -type CreateChannelOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `type:"string" required:"true"` - - // The date and time the channel was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description for your channel. - Description *string `type:"string"` - - // The list of ingest endpoints. - IngestEndpoints []*IngestEndpoint `type:"list"` - - // The date and time the channel was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The comma-separated list of tag key:value pairs assigned to the channel. - Tags map[string]*string `type:"map"` -} - -// 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 CreateChannelOutput) 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 CreateChannelOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateChannelOutput) SetArn(v string) *CreateChannelOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *CreateChannelOutput) SetChannelGroupName(v string) *CreateChannelOutput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *CreateChannelOutput) SetChannelName(v string) *CreateChannelOutput { - s.ChannelName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateChannelOutput) SetCreatedAt(v time.Time) *CreateChannelOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateChannelOutput) SetDescription(v string) *CreateChannelOutput { - s.Description = &v - return s -} - -// SetIngestEndpoints sets the IngestEndpoints field's value. -func (s *CreateChannelOutput) SetIngestEndpoints(v []*IngestEndpoint) *CreateChannelOutput { - s.IngestEndpoints = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *CreateChannelOutput) SetModifiedAt(v time.Time) *CreateChannelOutput { - s.ModifiedAt = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateChannelOutput) SetTags(v map[string]*string) *CreateChannelOutput { - s.Tags = v - return s -} - -// Create an HTTP live streaming (HLS) manifest configuration. -type CreateHlsManifestConfiguration struct { - _ struct{} `type:"structure"` - - // A short string that's appended to the endpoint URL. The child manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default manifest name, index, with an added suffix to distinguish - // it from the manifest name. The manifestName on the HLSManifest object overrides - // the manifestName you provided on the originEndpoint object. - ChildManifestName *string `min:"1" type:"string"` - - // Filter configuration includes settings for manifest filtering, start and - // end times, and time delay that apply to all of your egress requests for this - // manifest. - FilterConfiguration *FilterConfiguration `type:"structure"` - - // A short short string that's appended to the endpoint URL. The manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default manifest name, index. MediaPackage automatically inserts - // the format extension, such as .m3u8. You can't use the same manifest name - // if you use HLS manifest and low-latency HLS manifest. The manifestName on - // the HLSManifest object overrides the manifestName you provided on the originEndpoint - // object. - // - // ManifestName is a required field - ManifestName *string `min:"1" type:"string" required:"true"` - - // The total duration (in seconds) of the manifest's content. - ManifestWindowSeconds *int64 `min:"30" type:"integer"` - - // Inserts EXT-X-PROGRAM-DATE-TIME tags in the output manifest at the interval - // that you specify. If you don't enter an interval, EXT-X-PROGRAM-DATE-TIME - // tags aren't included in the manifest. The tags sync the stream to the wall - // clock so that viewers can seek to a specific time in the playback timeline - // on the player. ID3Timed metadata messages generate every 5 seconds whenever - // the content is ingested. - // - // Irrespective of this parameter, if any ID3Timed metadata is in the HLS input, - // it is passed through to the HLS output. - ProgramDateTimeIntervalSeconds *int64 `min:"1" type:"integer"` - - // The SCTE configuration. - ScteHls *ScteHls `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 CreateHlsManifestConfiguration) 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 CreateHlsManifestConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateHlsManifestConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateHlsManifestConfiguration"} - if s.ChildManifestName != nil && len(*s.ChildManifestName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChildManifestName", 1)) - } - if s.ManifestName == nil { - invalidParams.Add(request.NewErrParamRequired("ManifestName")) - } - if s.ManifestName != nil && len(*s.ManifestName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ManifestName", 1)) - } - if s.ManifestWindowSeconds != nil && *s.ManifestWindowSeconds < 30 { - invalidParams.Add(request.NewErrParamMinValue("ManifestWindowSeconds", 30)) - } - if s.ProgramDateTimeIntervalSeconds != nil && *s.ProgramDateTimeIntervalSeconds < 1 { - invalidParams.Add(request.NewErrParamMinValue("ProgramDateTimeIntervalSeconds", 1)) - } - if s.FilterConfiguration != nil { - if err := s.FilterConfiguration.Validate(); err != nil { - invalidParams.AddNested("FilterConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChildManifestName sets the ChildManifestName field's value. -func (s *CreateHlsManifestConfiguration) SetChildManifestName(v string) *CreateHlsManifestConfiguration { - s.ChildManifestName = &v - return s -} - -// SetFilterConfiguration sets the FilterConfiguration field's value. -func (s *CreateHlsManifestConfiguration) SetFilterConfiguration(v *FilterConfiguration) *CreateHlsManifestConfiguration { - s.FilterConfiguration = v - return s -} - -// SetManifestName sets the ManifestName field's value. -func (s *CreateHlsManifestConfiguration) SetManifestName(v string) *CreateHlsManifestConfiguration { - s.ManifestName = &v - return s -} - -// SetManifestWindowSeconds sets the ManifestWindowSeconds field's value. -func (s *CreateHlsManifestConfiguration) SetManifestWindowSeconds(v int64) *CreateHlsManifestConfiguration { - s.ManifestWindowSeconds = &v - return s -} - -// SetProgramDateTimeIntervalSeconds sets the ProgramDateTimeIntervalSeconds field's value. -func (s *CreateHlsManifestConfiguration) SetProgramDateTimeIntervalSeconds(v int64) *CreateHlsManifestConfiguration { - s.ProgramDateTimeIntervalSeconds = &v - return s -} - -// SetScteHls sets the ScteHls field's value. -func (s *CreateHlsManifestConfiguration) SetScteHls(v *ScteHls) *CreateHlsManifestConfiguration { - s.ScteHls = v - return s -} - -// Create a low-latency HTTP live streaming (HLS) manifest configuration. -type CreateLowLatencyHlsManifestConfiguration struct { - _ struct{} `type:"structure"` - - // A short string that's appended to the endpoint URL. The child manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default manifest name, index, with an added suffix to distinguish - // it from the manifest name. The manifestName on the HLSManifest object overrides - // the manifestName you provided on the originEndpoint object. - ChildManifestName *string `min:"1" type:"string"` - - // Filter configuration includes settings for manifest filtering, start and - // end times, and time delay that apply to all of your egress requests for this - // manifest. - FilterConfiguration *FilterConfiguration `type:"structure"` - - // A short short string that's appended to the endpoint URL. The manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default manifest name, index. MediaPackage automatically inserts - // the format extension, such as .m3u8. You can't use the same manifest name - // if you use HLS manifest and low-latency HLS manifest. The manifestName on - // the HLSManifest object overrides the manifestName you provided on the originEndpoint - // object. - // - // ManifestName is a required field - ManifestName *string `min:"1" type:"string" required:"true"` - - // The total duration (in seconds) of the manifest's content. - ManifestWindowSeconds *int64 `min:"30" type:"integer"` - - // Inserts EXT-X-PROGRAM-DATE-TIME tags in the output manifest at the interval - // that you specify. If you don't enter an interval, EXT-X-PROGRAM-DATE-TIME - // tags aren't included in the manifest. The tags sync the stream to the wall - // clock so that viewers can seek to a specific time in the playback timeline - // on the player. ID3Timed metadata messages generate every 5 seconds whenever - // the content is ingested. - // - // Irrespective of this parameter, if any ID3Timed metadata is in the HLS input, - // it is passed through to the HLS output. - ProgramDateTimeIntervalSeconds *int64 `min:"1" type:"integer"` - - // The SCTE configuration. - ScteHls *ScteHls `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 CreateLowLatencyHlsManifestConfiguration) 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 CreateLowLatencyHlsManifestConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLowLatencyHlsManifestConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLowLatencyHlsManifestConfiguration"} - if s.ChildManifestName != nil && len(*s.ChildManifestName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChildManifestName", 1)) - } - if s.ManifestName == nil { - invalidParams.Add(request.NewErrParamRequired("ManifestName")) - } - if s.ManifestName != nil && len(*s.ManifestName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ManifestName", 1)) - } - if s.ManifestWindowSeconds != nil && *s.ManifestWindowSeconds < 30 { - invalidParams.Add(request.NewErrParamMinValue("ManifestWindowSeconds", 30)) - } - if s.ProgramDateTimeIntervalSeconds != nil && *s.ProgramDateTimeIntervalSeconds < 1 { - invalidParams.Add(request.NewErrParamMinValue("ProgramDateTimeIntervalSeconds", 1)) - } - if s.FilterConfiguration != nil { - if err := s.FilterConfiguration.Validate(); err != nil { - invalidParams.AddNested("FilterConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChildManifestName sets the ChildManifestName field's value. -func (s *CreateLowLatencyHlsManifestConfiguration) SetChildManifestName(v string) *CreateLowLatencyHlsManifestConfiguration { - s.ChildManifestName = &v - return s -} - -// SetFilterConfiguration sets the FilterConfiguration field's value. -func (s *CreateLowLatencyHlsManifestConfiguration) SetFilterConfiguration(v *FilterConfiguration) *CreateLowLatencyHlsManifestConfiguration { - s.FilterConfiguration = v - return s -} - -// SetManifestName sets the ManifestName field's value. -func (s *CreateLowLatencyHlsManifestConfiguration) SetManifestName(v string) *CreateLowLatencyHlsManifestConfiguration { - s.ManifestName = &v - return s -} - -// SetManifestWindowSeconds sets the ManifestWindowSeconds field's value. -func (s *CreateLowLatencyHlsManifestConfiguration) SetManifestWindowSeconds(v int64) *CreateLowLatencyHlsManifestConfiguration { - s.ManifestWindowSeconds = &v - return s -} - -// SetProgramDateTimeIntervalSeconds sets the ProgramDateTimeIntervalSeconds field's value. -func (s *CreateLowLatencyHlsManifestConfiguration) SetProgramDateTimeIntervalSeconds(v int64) *CreateLowLatencyHlsManifestConfiguration { - s.ProgramDateTimeIntervalSeconds = &v - return s -} - -// SetScteHls sets the ScteHls field's value. -func (s *CreateLowLatencyHlsManifestConfiguration) SetScteHls(v *ScteHls) *CreateLowLatencyHlsManifestConfiguration { - s.ScteHls = v - return s -} - -type CreateOriginEndpointInput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // A unique, case-sensitive token that you provide to ensure the idempotency - // of the request. - ClientToken *string `location:"header" locationName:"x-amzn-client-token" min:"1" type:"string" idempotencyToken:"true"` - - // The type of container to attach to this origin endpoint. A container type - // is a file format that encapsulates one or more media streams, such as audio - // and video, into a single file. You can't change the container type after - // you create the endpoint. - // - // ContainerType is a required field - ContainerType *string `type:"string" required:"true" enum:"ContainerType"` - - // Enter any descriptive text that helps you to identify the origin endpoint. - Description *string `type:"string"` - - // An HTTP live streaming (HLS) manifest configuration. - HlsManifests []*CreateHlsManifestConfiguration `type:"list"` - - // A low-latency HLS manifest configuration. - LowLatencyHlsManifests []*CreateLowLatencyHlsManifestConfiguration `type:"list"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and must be unique for your account in the AWS Region - // and channel. You can't use spaces in the name. You can't change the name - // after you create the endpoint. - // - // OriginEndpointName is a required field - OriginEndpointName *string `min:"1" type:"string" required:"true"` - - // The segment configuration, including the segment name, duration, and other - // configuration values. - Segment *Segment `type:"structure"` - - // The size of the window (in seconds) to create a window of the live stream - // that's available for on-demand viewing. Viewers can start-over or catch-up - // on content that falls within the window. The maximum startover window is - // 1,209,600 seconds (14 days). - StartoverWindowSeconds *int64 `min:"60" type:"integer"` - - // A comma-separated list of tag key:value pairs that you define. For example: - // - // "Key1": "Value1", - // - // "Key2": "Value2" - Tags map[string]*string `type:"map"` -} - -// 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 CreateOriginEndpointInput) 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 CreateOriginEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateOriginEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateOriginEndpointInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ContainerType == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerType")) - } - if s.OriginEndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("OriginEndpointName")) - } - if s.OriginEndpointName != nil && len(*s.OriginEndpointName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OriginEndpointName", 1)) - } - if s.StartoverWindowSeconds != nil && *s.StartoverWindowSeconds < 60 { - invalidParams.Add(request.NewErrParamMinValue("StartoverWindowSeconds", 60)) - } - if s.HlsManifests != nil { - for i, v := range s.HlsManifests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "HlsManifests", i), err.(request.ErrInvalidParams)) - } - } - } - if s.LowLatencyHlsManifests != nil { - for i, v := range s.LowLatencyHlsManifests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LowLatencyHlsManifests", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Segment != nil { - if err := s.Segment.Validate(); err != nil { - invalidParams.AddNested("Segment", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *CreateOriginEndpointInput) SetChannelGroupName(v string) *CreateOriginEndpointInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *CreateOriginEndpointInput) SetChannelName(v string) *CreateOriginEndpointInput { - s.ChannelName = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateOriginEndpointInput) SetClientToken(v string) *CreateOriginEndpointInput { - s.ClientToken = &v - return s -} - -// SetContainerType sets the ContainerType field's value. -func (s *CreateOriginEndpointInput) SetContainerType(v string) *CreateOriginEndpointInput { - s.ContainerType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateOriginEndpointInput) SetDescription(v string) *CreateOriginEndpointInput { - s.Description = &v - return s -} - -// SetHlsManifests sets the HlsManifests field's value. -func (s *CreateOriginEndpointInput) SetHlsManifests(v []*CreateHlsManifestConfiguration) *CreateOriginEndpointInput { - s.HlsManifests = v - return s -} - -// SetLowLatencyHlsManifests sets the LowLatencyHlsManifests field's value. -func (s *CreateOriginEndpointInput) SetLowLatencyHlsManifests(v []*CreateLowLatencyHlsManifestConfiguration) *CreateOriginEndpointInput { - s.LowLatencyHlsManifests = v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *CreateOriginEndpointInput) SetOriginEndpointName(v string) *CreateOriginEndpointInput { - s.OriginEndpointName = &v - return s -} - -// SetSegment sets the Segment field's value. -func (s *CreateOriginEndpointInput) SetSegment(v *Segment) *CreateOriginEndpointInput { - s.Segment = v - return s -} - -// SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. -func (s *CreateOriginEndpointInput) SetStartoverWindowSeconds(v int64) *CreateOriginEndpointInput { - s.StartoverWindowSeconds = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateOriginEndpointInput) SetTags(v map[string]*string) *CreateOriginEndpointInput { - s.Tags = v - return s -} - -type CreateOriginEndpointOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `min:"1" type:"string" required:"true"` - - // The type of container attached to this origin endpoint. - // - // ContainerType is a required field - ContainerType *string `type:"string" required:"true" enum:"ContainerType"` - - // The date and time the origin endpoint was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description for your origin endpoint. - Description *string `type:"string"` - - // An HTTP live streaming (HLS) manifest configuration. - HlsManifests []*GetHlsManifestConfiguration `type:"list"` - - // A low-latency HLS manifest configuration. - LowLatencyHlsManifests []*GetLowLatencyHlsManifestConfiguration `type:"list"` - - // The date and time the origin endpoint was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `min:"1" type:"string" required:"true"` - - // The segment configuration, including the segment name, duration, and other - // configuration values. - // - // Segment is a required field - Segment *Segment `type:"structure" required:"true"` - - // The size of the window (in seconds) to create a window of the live stream - // that's available for on-demand viewing. Viewers can start-over or catch-up - // on content that falls within the window. - StartoverWindowSeconds *int64 `type:"integer"` - - // The comma-separated list of tag key:value pairs assigned to the origin endpoint. - Tags map[string]*string `type:"map"` -} - -// 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 CreateOriginEndpointOutput) 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 CreateOriginEndpointOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateOriginEndpointOutput) SetArn(v string) *CreateOriginEndpointOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *CreateOriginEndpointOutput) SetChannelGroupName(v string) *CreateOriginEndpointOutput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *CreateOriginEndpointOutput) SetChannelName(v string) *CreateOriginEndpointOutput { - s.ChannelName = &v - return s -} - -// SetContainerType sets the ContainerType field's value. -func (s *CreateOriginEndpointOutput) SetContainerType(v string) *CreateOriginEndpointOutput { - s.ContainerType = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateOriginEndpointOutput) SetCreatedAt(v time.Time) *CreateOriginEndpointOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateOriginEndpointOutput) SetDescription(v string) *CreateOriginEndpointOutput { - s.Description = &v - return s -} - -// SetHlsManifests sets the HlsManifests field's value. -func (s *CreateOriginEndpointOutput) SetHlsManifests(v []*GetHlsManifestConfiguration) *CreateOriginEndpointOutput { - s.HlsManifests = v - return s -} - -// SetLowLatencyHlsManifests sets the LowLatencyHlsManifests field's value. -func (s *CreateOriginEndpointOutput) SetLowLatencyHlsManifests(v []*GetLowLatencyHlsManifestConfiguration) *CreateOriginEndpointOutput { - s.LowLatencyHlsManifests = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *CreateOriginEndpointOutput) SetModifiedAt(v time.Time) *CreateOriginEndpointOutput { - s.ModifiedAt = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *CreateOriginEndpointOutput) SetOriginEndpointName(v string) *CreateOriginEndpointOutput { - s.OriginEndpointName = &v - return s -} - -// SetSegment sets the Segment field's value. -func (s *CreateOriginEndpointOutput) SetSegment(v *Segment) *CreateOriginEndpointOutput { - s.Segment = v - return s -} - -// SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. -func (s *CreateOriginEndpointOutput) SetStartoverWindowSeconds(v int64) *CreateOriginEndpointOutput { - s.StartoverWindowSeconds = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateOriginEndpointOutput) SetTags(v map[string]*string) *CreateOriginEndpointOutput { - s.Tags = v - return s -} - -type DeleteChannelGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" 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 DeleteChannelGroupInput) 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 DeleteChannelGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteChannelGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteChannelGroupInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *DeleteChannelGroupInput) SetChannelGroupName(v string) *DeleteChannelGroupInput { - s.ChannelGroupName = &v - return s -} - -type DeleteChannelGroupOutput 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 DeleteChannelGroupOutput) 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 DeleteChannelGroupOutput) GoString() string { - return s.String() -} - -type DeleteChannelInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" 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 DeleteChannelInput) 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 DeleteChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteChannelInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *DeleteChannelInput) SetChannelGroupName(v string) *DeleteChannelInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *DeleteChannelInput) SetChannelName(v string) *DeleteChannelInput { - s.ChannelName = &v - return s -} - -type DeleteChannelOutput 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 DeleteChannelOutput) 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 DeleteChannelOutput) GoString() string { - return s.String() -} - -type DeleteChannelPolicyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" 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 DeleteChannelPolicyInput) 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 DeleteChannelPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteChannelPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteChannelPolicyInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *DeleteChannelPolicyInput) SetChannelGroupName(v string) *DeleteChannelPolicyInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *DeleteChannelPolicyInput) SetChannelName(v string) *DeleteChannelPolicyInput { - s.ChannelName = &v - return s -} - -type DeleteChannelPolicyOutput 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 DeleteChannelPolicyOutput) 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 DeleteChannelPolicyOutput) GoString() string { - return s.String() -} - -type DeleteOriginEndpointInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `location:"uri" locationName:"OriginEndpointName" min:"1" 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 DeleteOriginEndpointInput) 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 DeleteOriginEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteOriginEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteOriginEndpointInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.OriginEndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("OriginEndpointName")) - } - if s.OriginEndpointName != nil && len(*s.OriginEndpointName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OriginEndpointName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *DeleteOriginEndpointInput) SetChannelGroupName(v string) *DeleteOriginEndpointInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *DeleteOriginEndpointInput) SetChannelName(v string) *DeleteOriginEndpointInput { - s.ChannelName = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *DeleteOriginEndpointInput) SetOriginEndpointName(v string) *DeleteOriginEndpointInput { - s.OriginEndpointName = &v - return s -} - -type DeleteOriginEndpointOutput 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 DeleteOriginEndpointOutput) 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 DeleteOriginEndpointOutput) GoString() string { - return s.String() -} - -type DeleteOriginEndpointPolicyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `location:"uri" locationName:"OriginEndpointName" min:"1" 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 DeleteOriginEndpointPolicyInput) 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 DeleteOriginEndpointPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteOriginEndpointPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteOriginEndpointPolicyInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.OriginEndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("OriginEndpointName")) - } - if s.OriginEndpointName != nil && len(*s.OriginEndpointName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OriginEndpointName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *DeleteOriginEndpointPolicyInput) SetChannelGroupName(v string) *DeleteOriginEndpointPolicyInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *DeleteOriginEndpointPolicyInput) SetChannelName(v string) *DeleteOriginEndpointPolicyInput { - s.ChannelName = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *DeleteOriginEndpointPolicyInput) SetOriginEndpointName(v string) *DeleteOriginEndpointPolicyInput { - s.OriginEndpointName = &v - return s -} - -type DeleteOriginEndpointPolicyOutput 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 DeleteOriginEndpointPolicyOutput) 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 DeleteOriginEndpointPolicyOutput) GoString() string { - return s.String() -} - -// The parameters for encrypting content. -type Encryption struct { - _ struct{} `type:"structure"` - - // A 128-bit, 16-byte hex value represented by a 32-character string, used in - // conjunction with the key for encrypting content. If you don't specify a value, - // then MediaPackage creates the constant initialization vector (IV). - ConstantInitializationVector *string `min:"32" type:"string"` - - // The encryption method to use. - // - // EncryptionMethod is a required field - EncryptionMethod *EncryptionMethod `type:"structure" required:"true"` - - // The frequency (in seconds) of key changes for live workflows, in which content - // is streamed real time. The service retrieves content keys before the live - // content begins streaming, and then retrieves them as needed over the lifetime - // of the workflow. By default, key rotation is set to 300 seconds (5 minutes), - // the minimum rotation interval, which is equivalent to setting it to 300. - // If you don't enter an interval, content keys aren't rotated. - // - // The following example setting causes the service to rotate keys every thirty - // minutes: 1800 - KeyRotationIntervalSeconds *int64 `min:"300" type:"integer"` - - // The parameters for the SPEKE key provider. - // - // SpekeKeyProvider is a required field - SpekeKeyProvider *SpekeKeyProvider `type:"structure" 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 Encryption) 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 Encryption) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Encryption) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Encryption"} - if s.ConstantInitializationVector != nil && len(*s.ConstantInitializationVector) < 32 { - invalidParams.Add(request.NewErrParamMinLen("ConstantInitializationVector", 32)) - } - if s.EncryptionMethod == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionMethod")) - } - if s.KeyRotationIntervalSeconds != nil && *s.KeyRotationIntervalSeconds < 300 { - invalidParams.Add(request.NewErrParamMinValue("KeyRotationIntervalSeconds", 300)) - } - if s.SpekeKeyProvider == nil { - invalidParams.Add(request.NewErrParamRequired("SpekeKeyProvider")) - } - if s.SpekeKeyProvider != nil { - if err := s.SpekeKeyProvider.Validate(); err != nil { - invalidParams.AddNested("SpekeKeyProvider", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConstantInitializationVector sets the ConstantInitializationVector field's value. -func (s *Encryption) SetConstantInitializationVector(v string) *Encryption { - s.ConstantInitializationVector = &v - return s -} - -// SetEncryptionMethod sets the EncryptionMethod field's value. -func (s *Encryption) SetEncryptionMethod(v *EncryptionMethod) *Encryption { - s.EncryptionMethod = v - return s -} - -// SetKeyRotationIntervalSeconds sets the KeyRotationIntervalSeconds field's value. -func (s *Encryption) SetKeyRotationIntervalSeconds(v int64) *Encryption { - s.KeyRotationIntervalSeconds = &v - return s -} - -// SetSpekeKeyProvider sets the SpekeKeyProvider field's value. -func (s *Encryption) SetSpekeKeyProvider(v *SpekeKeyProvider) *Encryption { - s.SpekeKeyProvider = v - return s -} - -// Configure one or more content encryption keys for your endpoints that use -// SPEKE Version 2.0. The encryption contract defines which content keys are -// used to encrypt the audio and video tracks in your stream. To configure the -// encryption contract, specify which audio and video encryption presets to -// use. -type EncryptionContractConfiguration struct { - _ struct{} `type:"structure"` - - // A collection of audio encryption presets. - // - // Value description: - // - // * PRESET-AUDIO-1 - Use one content key to encrypt all of the audio tracks - // in your stream. - // - // * PRESET-AUDIO-2 - Use one content key to encrypt all of the stereo audio - // tracks and one content key to encrypt all of the multichannel audio tracks. - // - // * PRESET-AUDIO-3 - Use one content key to encrypt all of the stereo audio - // tracks, one content key to encrypt all of the multichannel audio tracks - // with 3 to 6 channels, and one content key to encrypt all of the multichannel - // audio tracks with more than 6 channels. - // - // * SHARED - Use the same content key for all of the audio and video tracks - // in your stream. - // - // * UNENCRYPTED - Don't encrypt any of the audio tracks in your stream. - // - // PresetSpeke20Audio is a required field - PresetSpeke20Audio *string `type:"string" required:"true" enum:"PresetSpeke20Audio"` - - // A collection of video encryption presets. - // - // Value description: - // - // * PRESET-VIDEO-1 - Use one content key to encrypt all of the video tracks - // in your stream. - // - // * PRESET-VIDEO-2 - Use one content key to encrypt all of the SD video - // tracks and one content key for all HD and higher resolutions video tracks. - // - // * PRESET-VIDEO-3 - Use one content key to encrypt all of the SD video - // tracks, one content key for HD video tracks and one content key for all - // UHD video tracks. - // - // * PRESET-VIDEO-4 - Use one content key to encrypt all of the SD video - // tracks, one content key for HD video tracks, one content key for all UHD1 - // video tracks and one content key for all UHD2 video tracks. - // - // * PRESET-VIDEO-5 - Use one content key to encrypt all of the SD video - // tracks, one content key for HD1 video tracks, one content key for HD2 - // video tracks, one content key for all UHD1 video tracks and one content - // key for all UHD2 video tracks. - // - // * PRESET-VIDEO-6 - Use one content key to encrypt all of the SD video - // tracks, one content key for HD1 video tracks, one content key for HD2 - // video tracks and one content key for all UHD video tracks. - // - // * PRESET-VIDEO-7 - Use one content key to encrypt all of the SD+HD1 video - // tracks, one content key for HD2 video tracks and one content key for all - // UHD video tracks. - // - // * PRESET-VIDEO-8 - Use one content key to encrypt all of the SD+HD1 video - // tracks, one content key for HD2 video tracks, one content key for all - // UHD1 video tracks and one content key for all UHD2 video tracks. - // - // * SHARED - Use the same content key for all of the video and audio tracks - // in your stream. - // - // * UNENCRYPTED - Don't encrypt any of the video tracks in your stream. - // - // PresetSpeke20Video is a required field - PresetSpeke20Video *string `type:"string" required:"true" enum:"PresetSpeke20Video"` -} - -// 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 EncryptionContractConfiguration) 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 EncryptionContractConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptionContractConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptionContractConfiguration"} - if s.PresetSpeke20Audio == nil { - invalidParams.Add(request.NewErrParamRequired("PresetSpeke20Audio")) - } - if s.PresetSpeke20Video == nil { - invalidParams.Add(request.NewErrParamRequired("PresetSpeke20Video")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPresetSpeke20Audio sets the PresetSpeke20Audio field's value. -func (s *EncryptionContractConfiguration) SetPresetSpeke20Audio(v string) *EncryptionContractConfiguration { - s.PresetSpeke20Audio = &v - return s -} - -// SetPresetSpeke20Video sets the PresetSpeke20Video field's value. -func (s *EncryptionContractConfiguration) SetPresetSpeke20Video(v string) *EncryptionContractConfiguration { - s.PresetSpeke20Video = &v - return s -} - -// The encryption type. -type EncryptionMethod struct { - _ struct{} `type:"structure"` - - // The encryption method to use. - CmafEncryptionMethod *string `type:"string" enum:"CmafEncryptionMethod"` - - // The encryption method to use. - TsEncryptionMethod *string `type:"string" enum:"TsEncryptionMethod"` -} - -// 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 EncryptionMethod) 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 EncryptionMethod) GoString() string { - return s.String() -} - -// SetCmafEncryptionMethod sets the CmafEncryptionMethod field's value. -func (s *EncryptionMethod) SetCmafEncryptionMethod(v string) *EncryptionMethod { - s.CmafEncryptionMethod = &v - return s -} - -// SetTsEncryptionMethod sets the TsEncryptionMethod field's value. -func (s *EncryptionMethod) SetTsEncryptionMethod(v string) *EncryptionMethod { - s.TsEncryptionMethod = &v - return s -} - -// Filter configuration includes settings for manifest filtering, start and -// end times, and time delay that apply to all of your egress requests for this -// manifest. -type FilterConfiguration struct { - _ struct{} `type:"structure"` - - // Optionally specify the end time for all of your manifest egress requests. - // When you include end time, note that you cannot use end time query parameters - // for this manifest's endpoint URL. - End *time.Time `type:"timestamp"` - - // Optionally specify one or more manifest filters for all of your manifest - // egress requests. When you include a manifest filter, note that you cannot - // use an identical manifest filter query parameter for this manifest's endpoint - // URL. - ManifestFilter *string `min:"1" type:"string"` - - // Optionally specify the start time for all of your manifest egress requests. - // When you include start time, note that you cannot use start time query parameters - // for this manifest's endpoint URL. - Start *time.Time `type:"timestamp"` - - // Optionally specify the time delay for all of your manifest egress requests. - // Enter a value that is smaller than your endpoint's startover window. When - // you include time delay, note that you cannot use time delay query parameters - // for this manifest's endpoint URL. - TimeDelaySeconds *int64 `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 FilterConfiguration) 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 FilterConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FilterConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FilterConfiguration"} - if s.ManifestFilter != nil && len(*s.ManifestFilter) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ManifestFilter", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnd sets the End field's value. -func (s *FilterConfiguration) SetEnd(v time.Time) *FilterConfiguration { - s.End = &v - return s -} - -// SetManifestFilter sets the ManifestFilter field's value. -func (s *FilterConfiguration) SetManifestFilter(v string) *FilterConfiguration { - s.ManifestFilter = &v - return s -} - -// SetStart sets the Start field's value. -func (s *FilterConfiguration) SetStart(v time.Time) *FilterConfiguration { - s.Start = &v - return s -} - -// SetTimeDelaySeconds sets the TimeDelaySeconds field's value. -func (s *FilterConfiguration) SetTimeDelaySeconds(v int64) *FilterConfiguration { - s.TimeDelaySeconds = &v - return s -} - -type GetChannelGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" 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 GetChannelGroupInput) 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 GetChannelGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChannelGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChannelGroupInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetChannelGroupInput) SetChannelGroupName(v string) *GetChannelGroupInput { - s.ChannelGroupName = &v - return s -} - -type GetChannelGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The date and time the channel group was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description for your channel group. - Description *string `type:"string"` - - // The output domain where the source stream should be sent. Integrate the domain - // with a downstream CDN (such as Amazon CloudFront) or playback device. - // - // EgressDomain is a required field - EgressDomain *string `type:"string" required:"true"` - - // The date and time the channel group was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The comma-separated list of tag key:value pairs assigned to the channel group. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 GetChannelGroupOutput) 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 GetChannelGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetChannelGroupOutput) SetArn(v string) *GetChannelGroupOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetChannelGroupOutput) SetChannelGroupName(v string) *GetChannelGroupOutput { - s.ChannelGroupName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetChannelGroupOutput) SetCreatedAt(v time.Time) *GetChannelGroupOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetChannelGroupOutput) SetDescription(v string) *GetChannelGroupOutput { - s.Description = &v - return s -} - -// SetEgressDomain sets the EgressDomain field's value. -func (s *GetChannelGroupOutput) SetEgressDomain(v string) *GetChannelGroupOutput { - s.EgressDomain = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *GetChannelGroupOutput) SetModifiedAt(v time.Time) *GetChannelGroupOutput { - s.ModifiedAt = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetChannelGroupOutput) SetTags(v map[string]*string) *GetChannelGroupOutput { - s.Tags = v - return s -} - -type GetChannelInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" 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 GetChannelInput) 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 GetChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChannelInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetChannelInput) SetChannelGroupName(v string) *GetChannelInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *GetChannelInput) SetChannelName(v string) *GetChannelInput { - s.ChannelName = &v - return s -} - -type GetChannelOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `type:"string" required:"true"` - - // The date and time the channel was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description for your channel. - Description *string `type:"string"` - - // The list of ingest endpoints. - IngestEndpoints []*IngestEndpoint `type:"list"` - - // The date and time the channel was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The comma-separated list of tag key:value pairs assigned to the channel. - Tags map[string]*string `type:"map"` -} - -// 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 GetChannelOutput) 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 GetChannelOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetChannelOutput) SetArn(v string) *GetChannelOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetChannelOutput) SetChannelGroupName(v string) *GetChannelOutput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *GetChannelOutput) SetChannelName(v string) *GetChannelOutput { - s.ChannelName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetChannelOutput) SetCreatedAt(v time.Time) *GetChannelOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetChannelOutput) SetDescription(v string) *GetChannelOutput { - s.Description = &v - return s -} - -// SetIngestEndpoints sets the IngestEndpoints field's value. -func (s *GetChannelOutput) SetIngestEndpoints(v []*IngestEndpoint) *GetChannelOutput { - s.IngestEndpoints = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *GetChannelOutput) SetModifiedAt(v time.Time) *GetChannelOutput { - s.ModifiedAt = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetChannelOutput) SetTags(v map[string]*string) *GetChannelOutput { - s.Tags = v - return s -} - -type GetChannelPolicyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" 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 GetChannelPolicyInput) 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 GetChannelPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChannelPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChannelPolicyInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetChannelPolicyInput) SetChannelGroupName(v string) *GetChannelPolicyInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *GetChannelPolicyInput) SetChannelName(v string) *GetChannelPolicyInput { - s.ChannelName = &v - return s -} - -type GetChannelPolicyOutput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `type:"string" required:"true"` - - // The policy assigned to the channel. - // - // Policy is a required field - Policy *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 GetChannelPolicyOutput) 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 GetChannelPolicyOutput) GoString() string { - return s.String() -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetChannelPolicyOutput) SetChannelGroupName(v string) *GetChannelPolicyOutput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *GetChannelPolicyOutput) SetChannelName(v string) *GetChannelPolicyOutput { - s.ChannelName = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *GetChannelPolicyOutput) SetPolicy(v string) *GetChannelPolicyOutput { - s.Policy = &v - return s -} - -// Retrieve the HTTP live streaming (HLS) manifest configuration. -type GetHlsManifestConfiguration struct { - _ struct{} `type:"structure"` - - // A short string that's appended to the endpoint URL. The child manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default child manifest name, index_1. The manifestName on the HLSManifest - // object overrides the manifestName you provided on the originEndpoint object. - ChildManifestName *string `min:"1" type:"string"` - - // Filter configuration includes settings for manifest filtering, start and - // end times, and time delay that apply to all of your egress requests for this - // manifest. - FilterConfiguration *FilterConfiguration `type:"structure"` - - // A short short string that's appended to the endpoint URL. The manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default manifest name, index. MediaPackage automatically inserts - // the format extension, such as .m3u8. You can't use the same manifest name - // if you use HLS manifest and low-latency HLS manifest. The manifestName on - // the HLSManifest object overrides the manifestName you provided on the originEndpoint - // object. - // - // ManifestName is a required field - ManifestName *string `min:"1" type:"string" required:"true"` - - // The total duration (in seconds) of the manifest's content. - ManifestWindowSeconds *int64 `type:"integer"` - - // Inserts EXT-X-PROGRAM-DATE-TIME tags in the output manifest at the interval - // that you specify. If you don't enter an interval, EXT-X-PROGRAM-DATE-TIME - // tags aren't included in the manifest. The tags sync the stream to the wall - // clock so that viewers can seek to a specific time in the playback timeline - // on the player. ID3Timed metadata messages generate every 5 seconds whenever - // the content is ingested. - // - // Irrespective of this parameter, if any ID3Timed metadata is in the HLS input, - // it is passed through to the HLS output. - ProgramDateTimeIntervalSeconds *int64 `type:"integer"` - - // The SCTE configuration. - ScteHls *ScteHls `type:"structure"` - - // The egress domain URL for stream delivery from MediaPackage. - // - // Url is a required field - Url *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 GetHlsManifestConfiguration) 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 GetHlsManifestConfiguration) GoString() string { - return s.String() -} - -// SetChildManifestName sets the ChildManifestName field's value. -func (s *GetHlsManifestConfiguration) SetChildManifestName(v string) *GetHlsManifestConfiguration { - s.ChildManifestName = &v - return s -} - -// SetFilterConfiguration sets the FilterConfiguration field's value. -func (s *GetHlsManifestConfiguration) SetFilterConfiguration(v *FilterConfiguration) *GetHlsManifestConfiguration { - s.FilterConfiguration = v - return s -} - -// SetManifestName sets the ManifestName field's value. -func (s *GetHlsManifestConfiguration) SetManifestName(v string) *GetHlsManifestConfiguration { - s.ManifestName = &v - return s -} - -// SetManifestWindowSeconds sets the ManifestWindowSeconds field's value. -func (s *GetHlsManifestConfiguration) SetManifestWindowSeconds(v int64) *GetHlsManifestConfiguration { - s.ManifestWindowSeconds = &v - return s -} - -// SetProgramDateTimeIntervalSeconds sets the ProgramDateTimeIntervalSeconds field's value. -func (s *GetHlsManifestConfiguration) SetProgramDateTimeIntervalSeconds(v int64) *GetHlsManifestConfiguration { - s.ProgramDateTimeIntervalSeconds = &v - return s -} - -// SetScteHls sets the ScteHls field's value. -func (s *GetHlsManifestConfiguration) SetScteHls(v *ScteHls) *GetHlsManifestConfiguration { - s.ScteHls = v - return s -} - -// SetUrl sets the Url field's value. -func (s *GetHlsManifestConfiguration) SetUrl(v string) *GetHlsManifestConfiguration { - s.Url = &v - return s -} - -// Retrieve the low-latency HTTP live streaming (HLS) manifest configuration. -type GetLowLatencyHlsManifestConfiguration struct { - _ struct{} `type:"structure"` - - // A short string that's appended to the endpoint URL. The child manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default child manifest name, index_1. The manifestName on the HLSManifest - // object overrides the manifestName you provided on the originEndpoint object. - ChildManifestName *string `min:"1" type:"string"` - - // Filter configuration includes settings for manifest filtering, start and - // end times, and time delay that apply to all of your egress requests for this - // manifest. - FilterConfiguration *FilterConfiguration `type:"structure"` - - // A short short string that's appended to the endpoint URL. The manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default manifest name, index. MediaPackage automatically inserts - // the format extension, such as .m3u8. You can't use the same manifest name - // if you use HLS manifest and low-latency HLS manifest. The manifestName on - // the HLSManifest object overrides the manifestName you provided on the originEndpoint - // object. - // - // ManifestName is a required field - ManifestName *string `min:"1" type:"string" required:"true"` - - // The total duration (in seconds) of the manifest's content. - ManifestWindowSeconds *int64 `type:"integer"` - - // Inserts EXT-X-PROGRAM-DATE-TIME tags in the output manifest at the interval - // that you specify. If you don't enter an interval, EXT-X-PROGRAM-DATE-TIME - // tags aren't included in the manifest. The tags sync the stream to the wall - // clock so that viewers can seek to a specific time in the playback timeline - // on the player. ID3Timed metadata messages generate every 5 seconds whenever - // the content is ingested. - // - // Irrespective of this parameter, if any ID3Timed metadata is in the HLS input, - // it is passed through to the HLS output. - ProgramDateTimeIntervalSeconds *int64 `type:"integer"` - - // The SCTE configuration. - ScteHls *ScteHls `type:"structure"` - - // The egress domain URL for stream delivery from MediaPackage. - // - // Url is a required field - Url *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 GetLowLatencyHlsManifestConfiguration) 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 GetLowLatencyHlsManifestConfiguration) GoString() string { - return s.String() -} - -// SetChildManifestName sets the ChildManifestName field's value. -func (s *GetLowLatencyHlsManifestConfiguration) SetChildManifestName(v string) *GetLowLatencyHlsManifestConfiguration { - s.ChildManifestName = &v - return s -} - -// SetFilterConfiguration sets the FilterConfiguration field's value. -func (s *GetLowLatencyHlsManifestConfiguration) SetFilterConfiguration(v *FilterConfiguration) *GetLowLatencyHlsManifestConfiguration { - s.FilterConfiguration = v - return s -} - -// SetManifestName sets the ManifestName field's value. -func (s *GetLowLatencyHlsManifestConfiguration) SetManifestName(v string) *GetLowLatencyHlsManifestConfiguration { - s.ManifestName = &v - return s -} - -// SetManifestWindowSeconds sets the ManifestWindowSeconds field's value. -func (s *GetLowLatencyHlsManifestConfiguration) SetManifestWindowSeconds(v int64) *GetLowLatencyHlsManifestConfiguration { - s.ManifestWindowSeconds = &v - return s -} - -// SetProgramDateTimeIntervalSeconds sets the ProgramDateTimeIntervalSeconds field's value. -func (s *GetLowLatencyHlsManifestConfiguration) SetProgramDateTimeIntervalSeconds(v int64) *GetLowLatencyHlsManifestConfiguration { - s.ProgramDateTimeIntervalSeconds = &v - return s -} - -// SetScteHls sets the ScteHls field's value. -func (s *GetLowLatencyHlsManifestConfiguration) SetScteHls(v *ScteHls) *GetLowLatencyHlsManifestConfiguration { - s.ScteHls = v - return s -} - -// SetUrl sets the Url field's value. -func (s *GetLowLatencyHlsManifestConfiguration) SetUrl(v string) *GetLowLatencyHlsManifestConfiguration { - s.Url = &v - return s -} - -type GetOriginEndpointInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `location:"uri" locationName:"OriginEndpointName" min:"1" 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 GetOriginEndpointInput) 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 GetOriginEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOriginEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOriginEndpointInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.OriginEndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("OriginEndpointName")) - } - if s.OriginEndpointName != nil && len(*s.OriginEndpointName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OriginEndpointName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetOriginEndpointInput) SetChannelGroupName(v string) *GetOriginEndpointInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *GetOriginEndpointInput) SetChannelName(v string) *GetOriginEndpointInput { - s.ChannelName = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *GetOriginEndpointInput) SetOriginEndpointName(v string) *GetOriginEndpointInput { - s.OriginEndpointName = &v - return s -} - -type GetOriginEndpointOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `min:"1" type:"string" required:"true"` - - // The type of container attached to this origin endpoint. - // - // ContainerType is a required field - ContainerType *string `type:"string" required:"true" enum:"ContainerType"` - - // The date and time the origin endpoint was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description for your origin endpoint. - Description *string `type:"string"` - - // An HTTP live streaming (HLS) manifest configuration. - HlsManifests []*GetHlsManifestConfiguration `type:"list"` - - // A low-latency HLS manifest configuration. - LowLatencyHlsManifests []*GetLowLatencyHlsManifestConfiguration `type:"list"` - - // The date and time the origin endpoint was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `min:"1" type:"string" required:"true"` - - // The segment configuration, including the segment name, duration, and other - // configuration values. - // - // Segment is a required field - Segment *Segment `type:"structure" required:"true"` - - // The size of the window (in seconds) to create a window of the live stream - // that's available for on-demand viewing. Viewers can start-over or catch-up - // on content that falls within the window. - StartoverWindowSeconds *int64 `type:"integer"` - - // The comma-separated list of tag key:value pairs assigned to the origin endpoint. - Tags map[string]*string `type:"map"` -} - -// 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 GetOriginEndpointOutput) 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 GetOriginEndpointOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetOriginEndpointOutput) SetArn(v string) *GetOriginEndpointOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetOriginEndpointOutput) SetChannelGroupName(v string) *GetOriginEndpointOutput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *GetOriginEndpointOutput) SetChannelName(v string) *GetOriginEndpointOutput { - s.ChannelName = &v - return s -} - -// SetContainerType sets the ContainerType field's value. -func (s *GetOriginEndpointOutput) SetContainerType(v string) *GetOriginEndpointOutput { - s.ContainerType = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetOriginEndpointOutput) SetCreatedAt(v time.Time) *GetOriginEndpointOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetOriginEndpointOutput) SetDescription(v string) *GetOriginEndpointOutput { - s.Description = &v - return s -} - -// SetHlsManifests sets the HlsManifests field's value. -func (s *GetOriginEndpointOutput) SetHlsManifests(v []*GetHlsManifestConfiguration) *GetOriginEndpointOutput { - s.HlsManifests = v - return s -} - -// SetLowLatencyHlsManifests sets the LowLatencyHlsManifests field's value. -func (s *GetOriginEndpointOutput) SetLowLatencyHlsManifests(v []*GetLowLatencyHlsManifestConfiguration) *GetOriginEndpointOutput { - s.LowLatencyHlsManifests = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *GetOriginEndpointOutput) SetModifiedAt(v time.Time) *GetOriginEndpointOutput { - s.ModifiedAt = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *GetOriginEndpointOutput) SetOriginEndpointName(v string) *GetOriginEndpointOutput { - s.OriginEndpointName = &v - return s -} - -// SetSegment sets the Segment field's value. -func (s *GetOriginEndpointOutput) SetSegment(v *Segment) *GetOriginEndpointOutput { - s.Segment = v - return s -} - -// SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. -func (s *GetOriginEndpointOutput) SetStartoverWindowSeconds(v int64) *GetOriginEndpointOutput { - s.StartoverWindowSeconds = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetOriginEndpointOutput) SetTags(v map[string]*string) *GetOriginEndpointOutput { - s.Tags = v - return s -} - -type GetOriginEndpointPolicyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `location:"uri" locationName:"OriginEndpointName" min:"1" 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 GetOriginEndpointPolicyInput) 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 GetOriginEndpointPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOriginEndpointPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOriginEndpointPolicyInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.OriginEndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("OriginEndpointName")) - } - if s.OriginEndpointName != nil && len(*s.OriginEndpointName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OriginEndpointName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetOriginEndpointPolicyInput) SetChannelGroupName(v string) *GetOriginEndpointPolicyInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *GetOriginEndpointPolicyInput) SetChannelName(v string) *GetOriginEndpointPolicyInput { - s.ChannelName = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *GetOriginEndpointPolicyInput) SetOriginEndpointName(v string) *GetOriginEndpointPolicyInput { - s.OriginEndpointName = &v - return s -} - -type GetOriginEndpointPolicyOutput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `min:"1" type:"string" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `min:"1" type:"string" required:"true"` - - // The policy assigned to the origin endpoint. - // - // Policy is a required field - Policy *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 GetOriginEndpointPolicyOutput) 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 GetOriginEndpointPolicyOutput) GoString() string { - return s.String() -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *GetOriginEndpointPolicyOutput) SetChannelGroupName(v string) *GetOriginEndpointPolicyOutput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *GetOriginEndpointPolicyOutput) SetChannelName(v string) *GetOriginEndpointPolicyOutput { - s.ChannelName = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *GetOriginEndpointPolicyOutput) SetOriginEndpointName(v string) *GetOriginEndpointPolicyOutput { - s.OriginEndpointName = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *GetOriginEndpointPolicyOutput) SetPolicy(v string) *GetOriginEndpointPolicyOutput { - s.Policy = &v - return s -} - -// The ingest domain URL where the source stream should be sent. -type IngestEndpoint struct { - _ struct{} `type:"structure"` - - // The system-generated unique identifier for the IngestEndpoint. - Id *string `type:"string"` - - // The ingest domain URL where the source stream should be sent. - Url *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 IngestEndpoint) 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 IngestEndpoint) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *IngestEndpoint) SetId(v string) *IngestEndpoint { - s.Id = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *IngestEndpoint) SetUrl(v string) *IngestEndpoint { - s.Url = &v - return s -} - -// Indicates that an error from the service occurred while trying to process -// a request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListChannelGroupsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token from the GET list request. Use the token to fetch the - // next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListChannelGroupsInput) 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 ListChannelGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListChannelGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChannelGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListChannelGroupsInput) SetMaxResults(v int64) *ListChannelGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChannelGroupsInput) SetNextToken(v string) *ListChannelGroupsInput { - s.NextToken = &v - return s -} - -type ListChannelGroupsOutput struct { - _ struct{} `type:"structure"` - - // The objects being returned. - Items []*ChannelGroupListConfiguration `type:"list"` - - // The pagination token from the GET list request. Use the token to fetch the - // next page of results. - NextToken *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 ListChannelGroupsOutput) 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 ListChannelGroupsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListChannelGroupsOutput) SetItems(v []*ChannelGroupListConfiguration) *ListChannelGroupsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChannelGroupsOutput) SetNextToken(v string) *ListChannelGroupsOutput { - s.NextToken = &v - return s -} - -type ListChannelsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The maximum number of results to return in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token from the GET list request. Use the token to fetch the - // next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListChannelsInput) 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 ListChannelsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListChannelsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChannelsInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *ListChannelsInput) SetChannelGroupName(v string) *ListChannelsInput { - s.ChannelGroupName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListChannelsInput) SetMaxResults(v int64) *ListChannelsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChannelsInput) SetNextToken(v string) *ListChannelsInput { - s.NextToken = &v - return s -} - -type ListChannelsOutput struct { - _ struct{} `type:"structure"` - - // The objects being returned. - Items []*ChannelListConfiguration `type:"list"` - - // The pagination token from the GET list request. - NextToken *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 ListChannelsOutput) 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 ListChannelsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListChannelsOutput) SetItems(v []*ChannelListConfiguration) *ListChannelsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChannelsOutput) SetNextToken(v string) *ListChannelsOutput { - s.NextToken = &v - return s -} - -// List the HTTP live streaming (HLS) manifest configuration. -type ListHlsManifestConfiguration struct { - _ struct{} `type:"structure"` - - // A short string that's appended to the endpoint URL. The child manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default child manifest name, index_1. The manifestName on the HLSManifest - // object overrides the manifestName you provided on the originEndpoint object. - ChildManifestName *string `min:"1" type:"string"` - - // A short short string that's appended to the endpoint URL. The manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default manifest name, index. MediaPackage automatically inserts - // the format extension, such as .m3u8. You can't use the same manifest name - // if you use HLS manifest and low-latency HLS manifest. The manifestName on - // the HLSManifest object overrides the manifestName you provided on the originEndpoint - // object. - // - // ManifestName is a required field - ManifestName *string `min:"1" type:"string" required:"true"` - - // The egress domain URL for stream delivery from MediaPackage. - Url *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 ListHlsManifestConfiguration) 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 ListHlsManifestConfiguration) GoString() string { - return s.String() -} - -// SetChildManifestName sets the ChildManifestName field's value. -func (s *ListHlsManifestConfiguration) SetChildManifestName(v string) *ListHlsManifestConfiguration { - s.ChildManifestName = &v - return s -} - -// SetManifestName sets the ManifestName field's value. -func (s *ListHlsManifestConfiguration) SetManifestName(v string) *ListHlsManifestConfiguration { - s.ManifestName = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *ListHlsManifestConfiguration) SetUrl(v string) *ListHlsManifestConfiguration { - s.Url = &v - return s -} - -// List the low-latency HTTP live streaming (HLS) manifest configuration. -type ListLowLatencyHlsManifestConfiguration struct { - _ struct{} `type:"structure"` - - // A short string that's appended to the endpoint URL. The child manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default child manifest name, index_1. The manifestName on the HLSManifest - // object overrides the manifestName you provided on the originEndpoint object. - ChildManifestName *string `min:"1" type:"string"` - - // A short short string that's appended to the endpoint URL. The manifest name - // creates a unique path to this endpoint. If you don't enter a value, MediaPackage - // uses the default manifest name, index. MediaPackage automatically inserts - // the format extension, such as .m3u8. You can't use the same manifest name - // if you use HLS manifest and low-latency HLS manifest. The manifestName on - // the HLSManifest object overrides the manifestName you provided on the originEndpoint - // object. - // - // ManifestName is a required field - ManifestName *string `min:"1" type:"string" required:"true"` - - // The egress domain URL for stream delivery from MediaPackage. - Url *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 ListLowLatencyHlsManifestConfiguration) 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 ListLowLatencyHlsManifestConfiguration) GoString() string { - return s.String() -} - -// SetChildManifestName sets the ChildManifestName field's value. -func (s *ListLowLatencyHlsManifestConfiguration) SetChildManifestName(v string) *ListLowLatencyHlsManifestConfiguration { - s.ChildManifestName = &v - return s -} - -// SetManifestName sets the ManifestName field's value. -func (s *ListLowLatencyHlsManifestConfiguration) SetManifestName(v string) *ListLowLatencyHlsManifestConfiguration { - s.ManifestName = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *ListLowLatencyHlsManifestConfiguration) SetUrl(v string) *ListLowLatencyHlsManifestConfiguration { - s.Url = &v - return s -} - -type ListOriginEndpointsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // The maximum number of results to return in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token from the GET list request. Use the token to fetch the - // next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListOriginEndpointsInput) 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 ListOriginEndpointsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListOriginEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOriginEndpointsInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *ListOriginEndpointsInput) SetChannelGroupName(v string) *ListOriginEndpointsInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *ListOriginEndpointsInput) SetChannelName(v string) *ListOriginEndpointsInput { - s.ChannelName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListOriginEndpointsInput) SetMaxResults(v int64) *ListOriginEndpointsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOriginEndpointsInput) SetNextToken(v string) *ListOriginEndpointsInput { - s.NextToken = &v - return s -} - -type ListOriginEndpointsOutput struct { - _ struct{} `type:"structure"` - - // The objects being returned. - Items []*OriginEndpointListConfiguration `type:"list"` - - // The pagination token from the GET list request. Use the token to fetch the - // next page of results. - NextToken *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 ListOriginEndpointsOutput) 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 ListOriginEndpointsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListOriginEndpointsOutput) SetItems(v []*OriginEndpointListConfiguration) *ListOriginEndpointsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOriginEndpointsOutput) SetNextToken(v string) *ListOriginEndpointsOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the CloudWatch resource that you want to view tags for. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // Contains a map of the key-value pairs for the resource tag or tags assigned - // to the resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// The configuration of the origin endpoint. -type OriginEndpointListConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `min:"1" type:"string" required:"true"` - - // The type of container attached to this origin endpoint. A container type - // is a file format that encapsulates one or more media streams, such as audio - // and video, into a single file. - // - // ContainerType is a required field - ContainerType *string `type:"string" required:"true" enum:"ContainerType"` - - // The date and time the origin endpoint was created. - CreatedAt *time.Time `type:"timestamp"` - - // Any descriptive information that you want to add to the origin endpoint for - // future identification purposes. - Description *string `type:"string"` - - // An HTTP live streaming (HLS) manifest configuration. - HlsManifests []*ListHlsManifestConfiguration `type:"list"` - - // A low-latency HLS manifest configuration. - LowLatencyHlsManifests []*ListLowLatencyHlsManifestConfiguration `type:"list"` - - // The date and time the origin endpoint was modified. - ModifiedAt *time.Time `type:"timestamp"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `min:"1" 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 OriginEndpointListConfiguration) 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 OriginEndpointListConfiguration) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *OriginEndpointListConfiguration) SetArn(v string) *OriginEndpointListConfiguration { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *OriginEndpointListConfiguration) SetChannelGroupName(v string) *OriginEndpointListConfiguration { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *OriginEndpointListConfiguration) SetChannelName(v string) *OriginEndpointListConfiguration { - s.ChannelName = &v - return s -} - -// SetContainerType sets the ContainerType field's value. -func (s *OriginEndpointListConfiguration) SetContainerType(v string) *OriginEndpointListConfiguration { - s.ContainerType = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *OriginEndpointListConfiguration) SetCreatedAt(v time.Time) *OriginEndpointListConfiguration { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *OriginEndpointListConfiguration) SetDescription(v string) *OriginEndpointListConfiguration { - s.Description = &v - return s -} - -// SetHlsManifests sets the HlsManifests field's value. -func (s *OriginEndpointListConfiguration) SetHlsManifests(v []*ListHlsManifestConfiguration) *OriginEndpointListConfiguration { - s.HlsManifests = v - return s -} - -// SetLowLatencyHlsManifests sets the LowLatencyHlsManifests field's value. -func (s *OriginEndpointListConfiguration) SetLowLatencyHlsManifests(v []*ListLowLatencyHlsManifestConfiguration) *OriginEndpointListConfiguration { - s.LowLatencyHlsManifests = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *OriginEndpointListConfiguration) SetModifiedAt(v time.Time) *OriginEndpointListConfiguration { - s.ModifiedAt = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *OriginEndpointListConfiguration) SetOriginEndpointName(v string) *OriginEndpointListConfiguration { - s.OriginEndpointName = &v - return s -} - -type PutChannelPolicyInput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // The policy to attach to the specified channel. - // - // Policy is a required field - Policy *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 PutChannelPolicyInput) 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 PutChannelPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutChannelPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutChannelPolicyInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *PutChannelPolicyInput) SetChannelGroupName(v string) *PutChannelPolicyInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *PutChannelPolicyInput) SetChannelName(v string) *PutChannelPolicyInput { - s.ChannelName = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *PutChannelPolicyInput) SetPolicy(v string) *PutChannelPolicyInput { - s.Policy = &v - return s -} - -type PutChannelPolicyOutput 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 PutChannelPolicyOutput) 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 PutChannelPolicyOutput) GoString() string { - return s.String() -} - -type PutOriginEndpointPolicyInput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `location:"uri" locationName:"OriginEndpointName" min:"1" type:"string" required:"true"` - - // The policy to attach to the specified origin endpoint. - // - // Policy is a required field - Policy *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 PutOriginEndpointPolicyInput) 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 PutOriginEndpointPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutOriginEndpointPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutOriginEndpointPolicyInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.OriginEndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("OriginEndpointName")) - } - if s.OriginEndpointName != nil && len(*s.OriginEndpointName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OriginEndpointName", 1)) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *PutOriginEndpointPolicyInput) SetChannelGroupName(v string) *PutOriginEndpointPolicyInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *PutOriginEndpointPolicyInput) SetChannelName(v string) *PutOriginEndpointPolicyInput { - s.ChannelName = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *PutOriginEndpointPolicyInput) SetOriginEndpointName(v string) *PutOriginEndpointPolicyInput { - s.OriginEndpointName = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *PutOriginEndpointPolicyInput) SetPolicy(v string) *PutOriginEndpointPolicyInput { - s.Policy = &v - return s -} - -type PutOriginEndpointPolicyOutput 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 PutOriginEndpointPolicyOutput) 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 PutOriginEndpointPolicyOutput) GoString() string { - return s.String() -} - -// The specified resource doesn't exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The specified resource type wasn't found. - ResourceTypeNotFound *string `type:"string" enum:"ResourceTypeNotFound"` -} - -// 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The SCTE configuration. -type Scte struct { - _ struct{} `type:"structure"` - - // The SCTE-35 message types that you want to be treated as ad markers in the - // output. - ScteFilter []*string `type:"list" enum:"ScteFilter"` -} - -// 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 Scte) 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 Scte) GoString() string { - return s.String() -} - -// SetScteFilter sets the ScteFilter field's value. -func (s *Scte) SetScteFilter(v []*string) *Scte { - s.ScteFilter = v - return s -} - -// The SCTE configuration. -type ScteHls struct { - _ struct{} `type:"structure"` - - // Ad markers indicate when ads should be inserted during playback. If you include - // ad markers in the content stream in your upstream encoders, then you need - // to inform MediaPackage what to do with the ad markers in the output. Choose - // what you want MediaPackage to do with the ad markers. - // - // Value description: - // - // * DATERANGE - Insert EXT-X-DATERANGE tags to signal ad and program transition - // events in TS and CMAF manifests. If you use DATERANGE, you must set a - // programDateTimeIntervalSeconds value of 1 or higher. To learn more about - // DATERANGE, see SCTE-35 Ad Marker EXT-X-DATERANGE (http://docs.aws.amazon.com/mediapackage/latest/ug/scte-35-ad-marker-ext-x-daterange.html). - AdMarkerHls *string `type:"string" enum:"AdMarkerHls"` -} - -// 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 ScteHls) 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 ScteHls) GoString() string { - return s.String() -} - -// SetAdMarkerHls sets the AdMarkerHls field's value. -func (s *ScteHls) SetAdMarkerHls(v string) *ScteHls { - s.AdMarkerHls = &v - return s -} - -// The segment configuration, including the segment name, duration, and other -// configuration values. -type Segment struct { - _ struct{} `type:"structure"` - - // The parameters for encrypting content. - Encryption *Encryption `type:"structure"` - - // When selected, the stream set includes an additional I-frame only stream, - // along with the other tracks. If false, this extra stream is not included. - // MediaPackage generates an I-frame only stream from the first rendition in - // the manifest. The service inserts EXT-I-FRAMES-ONLY tags in the output manifest, - // and then generates and includes an I-frames only playlist in the stream. - // This playlist permits player functionality like fast forward and rewind. - IncludeIframeOnlyStreams *bool `type:"boolean"` - - // The SCTE configuration options in the segment settings. - Scte *Scte `type:"structure"` - - // The duration (in seconds) of each segment. Enter a value equal to, or a multiple - // of, the input segment duration. If the value that you enter is different - // from the input segment duration, MediaPackage rounds segments to the nearest - // multiple of the input segment duration. - SegmentDurationSeconds *int64 `min:"1" type:"integer"` - - // The name that describes the segment. The name is the base name of the segment - // used in all content manifests inside of the endpoint. You can't use spaces - // in the name. - SegmentName *string `min:"1" type:"string"` - - // By default, MediaPackage excludes all digital video broadcasting (DVB) subtitles - // from the output. When selected, MediaPackage passes through DVB subtitles - // into the output. - TsIncludeDvbSubtitles *bool `type:"boolean"` - - // When selected, MediaPackage bundles all audio tracks in a rendition group. - // All other tracks in the stream can be used with any audio rendition from - // the group. - TsUseAudioRenditionGroup *bool `type:"boolean"` -} - -// 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 Segment) 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 Segment) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Segment) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Segment"} - if s.SegmentDurationSeconds != nil && *s.SegmentDurationSeconds < 1 { - invalidParams.Add(request.NewErrParamMinValue("SegmentDurationSeconds", 1)) - } - if s.SegmentName != nil && len(*s.SegmentName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SegmentName", 1)) - } - if s.Encryption != nil { - if err := s.Encryption.Validate(); err != nil { - invalidParams.AddNested("Encryption", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryption sets the Encryption field's value. -func (s *Segment) SetEncryption(v *Encryption) *Segment { - s.Encryption = v - return s -} - -// SetIncludeIframeOnlyStreams sets the IncludeIframeOnlyStreams field's value. -func (s *Segment) SetIncludeIframeOnlyStreams(v bool) *Segment { - s.IncludeIframeOnlyStreams = &v - return s -} - -// SetScte sets the Scte field's value. -func (s *Segment) SetScte(v *Scte) *Segment { - s.Scte = v - return s -} - -// SetSegmentDurationSeconds sets the SegmentDurationSeconds field's value. -func (s *Segment) SetSegmentDurationSeconds(v int64) *Segment { - s.SegmentDurationSeconds = &v - return s -} - -// SetSegmentName sets the SegmentName field's value. -func (s *Segment) SetSegmentName(v string) *Segment { - s.SegmentName = &v - return s -} - -// SetTsIncludeDvbSubtitles sets the TsIncludeDvbSubtitles field's value. -func (s *Segment) SetTsIncludeDvbSubtitles(v bool) *Segment { - s.TsIncludeDvbSubtitles = &v - return s -} - -// SetTsUseAudioRenditionGroup sets the TsUseAudioRenditionGroup field's value. -func (s *Segment) SetTsUseAudioRenditionGroup(v bool) *Segment { - s.TsUseAudioRenditionGroup = &v - return s -} - -// The request would cause a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The parameters for the SPEKE key provider. -type SpekeKeyProvider struct { - _ struct{} `type:"structure"` - - // The DRM solution provider you're using to protect your content during distribution. - // - // DrmSystems is a required field - DrmSystems []*string `min:"1" type:"list" required:"true" enum:"DrmSystem"` - - // Configure one or more content encryption keys for your endpoints that use - // SPEKE Version 2.0. The encryption contract defines which content keys are - // used to encrypt the audio and video tracks in your stream. To configure the - // encryption contract, specify which audio and video encryption presets to - // use. - // - // EncryptionContractConfiguration is a required field - EncryptionContractConfiguration *EncryptionContractConfiguration `type:"structure" required:"true"` - - // The unique identifier for the content. The service sends this to the key - // server to identify the current endpoint. How unique you make this depends - // on how fine-grained you want access controls to be. The service does not - // permit you to use the same ID for two simultaneous encryption processes. - // The resource ID is also known as the content ID. - // - // The following example shows a resource ID: MovieNight20171126093045 - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The ARN for the IAM role granted by the key provider that provides access - // to the key provider API. This role must have a trust policy that allows MediaPackage - // to assume the role, and it must have a sufficient permissions policy to allow - // access to the specific key retrieval URL. Get this from your DRM solution - // provider. - // - // Valid format: arn:aws:iam::{accountID}:role/{name}. The following example - // shows a role ARN: arn:aws:iam::444455556666:role/SpekeAccess - // - // RoleArn is a required field - RoleArn *string `min:"1" type:"string" required:"true"` - - // The URL of the API Gateway proxy that you set up to talk to your key server. - // The API Gateway proxy must reside in the same AWS Region as MediaPackage - // and must start with https://. - // - // The following example shows a URL: https://1wm2dx1f33.execute-api.us-west-2.amazonaws.com/SpekeSample/copyProtection - // - // Url is a required field - Url *string `min:"1" 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 SpekeKeyProvider) 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 SpekeKeyProvider) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SpekeKeyProvider) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SpekeKeyProvider"} - if s.DrmSystems == nil { - invalidParams.Add(request.NewErrParamRequired("DrmSystems")) - } - if s.DrmSystems != nil && len(s.DrmSystems) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DrmSystems", 1)) - } - if s.EncryptionContractConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionContractConfiguration")) - } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - if s.Url == nil { - invalidParams.Add(request.NewErrParamRequired("Url")) - } - if s.Url != nil && len(*s.Url) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Url", 1)) - } - if s.EncryptionContractConfiguration != nil { - if err := s.EncryptionContractConfiguration.Validate(); err != nil { - invalidParams.AddNested("EncryptionContractConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDrmSystems sets the DrmSystems field's value. -func (s *SpekeKeyProvider) SetDrmSystems(v []*string) *SpekeKeyProvider { - s.DrmSystems = v - return s -} - -// SetEncryptionContractConfiguration sets the EncryptionContractConfiguration field's value. -func (s *SpekeKeyProvider) SetEncryptionContractConfiguration(v *EncryptionContractConfiguration) *SpekeKeyProvider { - s.EncryptionContractConfiguration = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *SpekeKeyProvider) SetResourceId(v string) *SpekeKeyProvider { - s.ResourceId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *SpekeKeyProvider) SetRoleArn(v string) *SpekeKeyProvider { - s.RoleArn = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *SpekeKeyProvider) SetUrl(v string) *SpekeKeyProvider { - s.Url = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the MediaPackage resource that you're adding tags to. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - - // Contains a map of the key-value pairs for the resource tag or tags assigned - // to the resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request throughput limit was exceeded. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the MediaPackage resource that you're removing tags from. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - - // The list of tag keys to remove from the resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateChannelGroupInput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // Any descriptive information that you want to add to the channel group for - // future identification purposes. - Description *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 UpdateChannelGroupInput) 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 UpdateChannelGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateChannelGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateChannelGroupInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *UpdateChannelGroupInput) SetChannelGroupName(v string) *UpdateChannelGroupInput { - s.ChannelGroupName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateChannelGroupInput) SetDescription(v string) *UpdateChannelGroupInput { - s.Description = &v - return s -} - -type UpdateChannelGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The date and time the channel group was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description for your channel group. - Description *string `type:"string"` - - // The output domain where the source stream is sent. Integrate the domain with - // a downstream CDN (such as Amazon CloudFront) or playback device. - // - // EgressDomain is a required field - EgressDomain *string `type:"string" required:"true"` - - // The date and time the channel group was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The comma-separated list of tag key:value pairs assigned to the channel group. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 UpdateChannelGroupOutput) 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 UpdateChannelGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateChannelGroupOutput) SetArn(v string) *UpdateChannelGroupOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *UpdateChannelGroupOutput) SetChannelGroupName(v string) *UpdateChannelGroupOutput { - s.ChannelGroupName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateChannelGroupOutput) SetCreatedAt(v time.Time) *UpdateChannelGroupOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateChannelGroupOutput) SetDescription(v string) *UpdateChannelGroupOutput { - s.Description = &v - return s -} - -// SetEgressDomain sets the EgressDomain field's value. -func (s *UpdateChannelGroupOutput) SetEgressDomain(v string) *UpdateChannelGroupOutput { - s.EgressDomain = &v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *UpdateChannelGroupOutput) SetModifiedAt(v time.Time) *UpdateChannelGroupOutput { - s.ModifiedAt = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateChannelGroupOutput) SetTags(v map[string]*string) *UpdateChannelGroupOutput { - s.Tags = v - return s -} - -type UpdateChannelInput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // Any descriptive information that you want to add to the channel for future - // identification purposes. - Description *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 UpdateChannelInput) 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 UpdateChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateChannelInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *UpdateChannelInput) SetChannelGroupName(v string) *UpdateChannelInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *UpdateChannelInput) SetChannelName(v string) *UpdateChannelInput { - s.ChannelName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateChannelInput) SetDescription(v string) *UpdateChannelInput { - s.Description = &v - return s -} - -type UpdateChannelOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `type:"string" required:"true"` - - // The date and time the channel was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description for your channel. - Description *string `type:"string"` - - // The list of ingest endpoints. - IngestEndpoints []*IngestEndpoint `type:"list"` - - // The date and time the channel was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The comma-separated list of tag key:value pairs assigned to the channel. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 UpdateChannelOutput) 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 UpdateChannelOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateChannelOutput) SetArn(v string) *UpdateChannelOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *UpdateChannelOutput) SetChannelGroupName(v string) *UpdateChannelOutput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *UpdateChannelOutput) SetChannelName(v string) *UpdateChannelOutput { - s.ChannelName = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateChannelOutput) SetCreatedAt(v time.Time) *UpdateChannelOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateChannelOutput) SetDescription(v string) *UpdateChannelOutput { - s.Description = &v - return s -} - -// SetIngestEndpoints sets the IngestEndpoints field's value. -func (s *UpdateChannelOutput) SetIngestEndpoints(v []*IngestEndpoint) *UpdateChannelOutput { - s.IngestEndpoints = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *UpdateChannelOutput) SetModifiedAt(v time.Time) *UpdateChannelOutput { - s.ModifiedAt = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateChannelOutput) SetTags(v map[string]*string) *UpdateChannelOutput { - s.Tags = v - return s -} - -type UpdateOriginEndpointInput struct { - _ struct{} `type:"structure"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `location:"uri" locationName:"ChannelGroupName" min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `location:"uri" locationName:"ChannelName" min:"1" type:"string" required:"true"` - - // The type of container attached to this origin endpoint. A container type - // is a file format that encapsulates one or more media streams, such as audio - // and video, into a single file. - // - // ContainerType is a required field - ContainerType *string `type:"string" required:"true" enum:"ContainerType"` - - // Any descriptive information that you want to add to the origin endpoint for - // future identification purposes. - Description *string `type:"string"` - - // An HTTP live streaming (HLS) manifest configuration. - HlsManifests []*CreateHlsManifestConfiguration `type:"list"` - - // A low-latency HLS manifest configuration. - LowLatencyHlsManifests []*CreateLowLatencyHlsManifestConfiguration `type:"list"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `location:"uri" locationName:"OriginEndpointName" min:"1" type:"string" required:"true"` - - // The segment configuration, including the segment name, duration, and other - // configuration values. - Segment *Segment `type:"structure"` - - // The size of the window (in seconds) to create a window of the live stream - // that's available for on-demand viewing. Viewers can start-over or catch-up - // on content that falls within the window. The maximum startover window is - // 1,209,600 seconds (14 days). - StartoverWindowSeconds *int64 `min:"60" 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 UpdateOriginEndpointInput) 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 UpdateOriginEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateOriginEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateOriginEndpointInput"} - if s.ChannelGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelGroupName")) - } - if s.ChannelGroupName != nil && len(*s.ChannelGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelGroupName", 1)) - } - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.ContainerType == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerType")) - } - if s.OriginEndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("OriginEndpointName")) - } - if s.OriginEndpointName != nil && len(*s.OriginEndpointName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OriginEndpointName", 1)) - } - if s.StartoverWindowSeconds != nil && *s.StartoverWindowSeconds < 60 { - invalidParams.Add(request.NewErrParamMinValue("StartoverWindowSeconds", 60)) - } - if s.HlsManifests != nil { - for i, v := range s.HlsManifests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "HlsManifests", i), err.(request.ErrInvalidParams)) - } - } - } - if s.LowLatencyHlsManifests != nil { - for i, v := range s.LowLatencyHlsManifests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LowLatencyHlsManifests", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Segment != nil { - if err := s.Segment.Validate(); err != nil { - invalidParams.AddNested("Segment", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *UpdateOriginEndpointInput) SetChannelGroupName(v string) *UpdateOriginEndpointInput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *UpdateOriginEndpointInput) SetChannelName(v string) *UpdateOriginEndpointInput { - s.ChannelName = &v - return s -} - -// SetContainerType sets the ContainerType field's value. -func (s *UpdateOriginEndpointInput) SetContainerType(v string) *UpdateOriginEndpointInput { - s.ContainerType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateOriginEndpointInput) SetDescription(v string) *UpdateOriginEndpointInput { - s.Description = &v - return s -} - -// SetHlsManifests sets the HlsManifests field's value. -func (s *UpdateOriginEndpointInput) SetHlsManifests(v []*CreateHlsManifestConfiguration) *UpdateOriginEndpointInput { - s.HlsManifests = v - return s -} - -// SetLowLatencyHlsManifests sets the LowLatencyHlsManifests field's value. -func (s *UpdateOriginEndpointInput) SetLowLatencyHlsManifests(v []*CreateLowLatencyHlsManifestConfiguration) *UpdateOriginEndpointInput { - s.LowLatencyHlsManifests = v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *UpdateOriginEndpointInput) SetOriginEndpointName(v string) *UpdateOriginEndpointInput { - s.OriginEndpointName = &v - return s -} - -// SetSegment sets the Segment field's value. -func (s *UpdateOriginEndpointInput) SetSegment(v *Segment) *UpdateOriginEndpointInput { - s.Segment = v - return s -} - -// SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. -func (s *UpdateOriginEndpointInput) SetStartoverWindowSeconds(v int64) *UpdateOriginEndpointInput { - s.StartoverWindowSeconds = &v - return s -} - -type UpdateOriginEndpointOutput struct { - _ struct{} `type:"structure"` - - // The ARN associated with the resource. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The name that describes the channel group. The name is the primary identifier - // for the channel group, and must be unique for your account in the AWS Region. - // - // ChannelGroupName is a required field - ChannelGroupName *string `min:"1" type:"string" required:"true"` - - // The name that describes the channel. The name is the primary identifier for - // the channel, and must be unique for your account in the AWS Region and channel - // group. - // - // ChannelName is a required field - ChannelName *string `min:"1" type:"string" required:"true"` - - // The type of container attached to this origin endpoint. - // - // ContainerType is a required field - ContainerType *string `type:"string" required:"true" enum:"ContainerType"` - - // The date and time the origin endpoint was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `type:"timestamp" required:"true"` - - // The description of the origin endpoint. - Description *string `type:"string"` - - // An HTTP live streaming (HLS) manifest configuration. - HlsManifests []*GetHlsManifestConfiguration `type:"list"` - - // A low-latency HLS manifest configuration. - LowLatencyHlsManifests []*GetLowLatencyHlsManifestConfiguration `type:"list"` - - // The date and time the origin endpoint was modified. - // - // ModifiedAt is a required field - ModifiedAt *time.Time `type:"timestamp" required:"true"` - - // The name that describes the origin endpoint. The name is the primary identifier - // for the origin endpoint, and and must be unique for your account in the AWS - // Region and channel. - // - // OriginEndpointName is a required field - OriginEndpointName *string `min:"1" type:"string" required:"true"` - - // The segment configuration, including the segment name, duration, and other - // configuration values. - // - // Segment is a required field - Segment *Segment `type:"structure" required:"true"` - - // The size of the window (in seconds) to create a window of the live stream - // that's available for on-demand viewing. Viewers can start-over or catch-up - // on content that falls within the window. - StartoverWindowSeconds *int64 `type:"integer"` - - // The comma-separated list of tag key:value pairs assigned to the origin endpoint. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 UpdateOriginEndpointOutput) 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 UpdateOriginEndpointOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateOriginEndpointOutput) SetArn(v string) *UpdateOriginEndpointOutput { - s.Arn = &v - return s -} - -// SetChannelGroupName sets the ChannelGroupName field's value. -func (s *UpdateOriginEndpointOutput) SetChannelGroupName(v string) *UpdateOriginEndpointOutput { - s.ChannelGroupName = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *UpdateOriginEndpointOutput) SetChannelName(v string) *UpdateOriginEndpointOutput { - s.ChannelName = &v - return s -} - -// SetContainerType sets the ContainerType field's value. -func (s *UpdateOriginEndpointOutput) SetContainerType(v string) *UpdateOriginEndpointOutput { - s.ContainerType = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateOriginEndpointOutput) SetCreatedAt(v time.Time) *UpdateOriginEndpointOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateOriginEndpointOutput) SetDescription(v string) *UpdateOriginEndpointOutput { - s.Description = &v - return s -} - -// SetHlsManifests sets the HlsManifests field's value. -func (s *UpdateOriginEndpointOutput) SetHlsManifests(v []*GetHlsManifestConfiguration) *UpdateOriginEndpointOutput { - s.HlsManifests = v - return s -} - -// SetLowLatencyHlsManifests sets the LowLatencyHlsManifests field's value. -func (s *UpdateOriginEndpointOutput) SetLowLatencyHlsManifests(v []*GetLowLatencyHlsManifestConfiguration) *UpdateOriginEndpointOutput { - s.LowLatencyHlsManifests = v - return s -} - -// SetModifiedAt sets the ModifiedAt field's value. -func (s *UpdateOriginEndpointOutput) SetModifiedAt(v time.Time) *UpdateOriginEndpointOutput { - s.ModifiedAt = &v - return s -} - -// SetOriginEndpointName sets the OriginEndpointName field's value. -func (s *UpdateOriginEndpointOutput) SetOriginEndpointName(v string) *UpdateOriginEndpointOutput { - s.OriginEndpointName = &v - return s -} - -// SetSegment sets the Segment field's value. -func (s *UpdateOriginEndpointOutput) SetSegment(v *Segment) *UpdateOriginEndpointOutput { - s.Segment = v - return s -} - -// SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. -func (s *UpdateOriginEndpointOutput) SetStartoverWindowSeconds(v int64) *UpdateOriginEndpointOutput { - s.StartoverWindowSeconds = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateOriginEndpointOutput) SetTags(v map[string]*string) *UpdateOriginEndpointOutput { - s.Tags = v - return s -} - -// The input failed to meet the constraints specified by the AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The type of ValidationException. - ValidationExceptionType *string `type:"string" enum:"ValidationExceptionType"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // AdMarkerHlsDaterange is a AdMarkerHls enum value - AdMarkerHlsDaterange = "DATERANGE" -) - -// AdMarkerHls_Values returns all elements of the AdMarkerHls enum -func AdMarkerHls_Values() []string { - return []string{ - AdMarkerHlsDaterange, - } -} - -const ( - // CmafEncryptionMethodCenc is a CmafEncryptionMethod enum value - CmafEncryptionMethodCenc = "CENC" - - // CmafEncryptionMethodCbcs is a CmafEncryptionMethod enum value - CmafEncryptionMethodCbcs = "CBCS" -) - -// CmafEncryptionMethod_Values returns all elements of the CmafEncryptionMethod enum -func CmafEncryptionMethod_Values() []string { - return []string{ - CmafEncryptionMethodCenc, - CmafEncryptionMethodCbcs, - } -} - -const ( - // ConflictExceptionTypeResourceInUse is a ConflictExceptionType enum value - ConflictExceptionTypeResourceInUse = "RESOURCE_IN_USE" - - // ConflictExceptionTypeResourceAlreadyExists is a ConflictExceptionType enum value - ConflictExceptionTypeResourceAlreadyExists = "RESOURCE_ALREADY_EXISTS" - - // ConflictExceptionTypeIdempotentParameterMismatch is a ConflictExceptionType enum value - ConflictExceptionTypeIdempotentParameterMismatch = "IDEMPOTENT_PARAMETER_MISMATCH" - - // ConflictExceptionTypeConflictingOperation is a ConflictExceptionType enum value - ConflictExceptionTypeConflictingOperation = "CONFLICTING_OPERATION" -) - -// ConflictExceptionType_Values returns all elements of the ConflictExceptionType enum -func ConflictExceptionType_Values() []string { - return []string{ - ConflictExceptionTypeResourceInUse, - ConflictExceptionTypeResourceAlreadyExists, - ConflictExceptionTypeIdempotentParameterMismatch, - ConflictExceptionTypeConflictingOperation, - } -} - -const ( - // ContainerTypeTs is a ContainerType enum value - ContainerTypeTs = "TS" - - // ContainerTypeCmaf is a ContainerType enum value - ContainerTypeCmaf = "CMAF" -) - -// ContainerType_Values returns all elements of the ContainerType enum -func ContainerType_Values() []string { - return []string{ - ContainerTypeTs, - ContainerTypeCmaf, - } -} - -const ( - // DrmSystemClearKeyAes128 is a DrmSystem enum value - DrmSystemClearKeyAes128 = "CLEAR_KEY_AES_128" - - // DrmSystemFairplay is a DrmSystem enum value - DrmSystemFairplay = "FAIRPLAY" - - // DrmSystemPlayready is a DrmSystem enum value - DrmSystemPlayready = "PLAYREADY" - - // DrmSystemWidevine is a DrmSystem enum value - DrmSystemWidevine = "WIDEVINE" -) - -// DrmSystem_Values returns all elements of the DrmSystem enum -func DrmSystem_Values() []string { - return []string{ - DrmSystemClearKeyAes128, - DrmSystemFairplay, - DrmSystemPlayready, - DrmSystemWidevine, - } -} - -const ( - // PresetSpeke20AudioPresetAudio1 is a PresetSpeke20Audio enum value - PresetSpeke20AudioPresetAudio1 = "PRESET_AUDIO_1" - - // PresetSpeke20AudioPresetAudio2 is a PresetSpeke20Audio enum value - PresetSpeke20AudioPresetAudio2 = "PRESET_AUDIO_2" - - // PresetSpeke20AudioPresetAudio3 is a PresetSpeke20Audio enum value - PresetSpeke20AudioPresetAudio3 = "PRESET_AUDIO_3" - - // PresetSpeke20AudioShared is a PresetSpeke20Audio enum value - PresetSpeke20AudioShared = "SHARED" - - // PresetSpeke20AudioUnencrypted is a PresetSpeke20Audio enum value - PresetSpeke20AudioUnencrypted = "UNENCRYPTED" -) - -// PresetSpeke20Audio_Values returns all elements of the PresetSpeke20Audio enum -func PresetSpeke20Audio_Values() []string { - return []string{ - PresetSpeke20AudioPresetAudio1, - PresetSpeke20AudioPresetAudio2, - PresetSpeke20AudioPresetAudio3, - PresetSpeke20AudioShared, - PresetSpeke20AudioUnencrypted, - } -} - -const ( - // PresetSpeke20VideoPresetVideo1 is a PresetSpeke20Video enum value - PresetSpeke20VideoPresetVideo1 = "PRESET_VIDEO_1" - - // PresetSpeke20VideoPresetVideo2 is a PresetSpeke20Video enum value - PresetSpeke20VideoPresetVideo2 = "PRESET_VIDEO_2" - - // PresetSpeke20VideoPresetVideo3 is a PresetSpeke20Video enum value - PresetSpeke20VideoPresetVideo3 = "PRESET_VIDEO_3" - - // PresetSpeke20VideoPresetVideo4 is a PresetSpeke20Video enum value - PresetSpeke20VideoPresetVideo4 = "PRESET_VIDEO_4" - - // PresetSpeke20VideoPresetVideo5 is a PresetSpeke20Video enum value - PresetSpeke20VideoPresetVideo5 = "PRESET_VIDEO_5" - - // PresetSpeke20VideoPresetVideo6 is a PresetSpeke20Video enum value - PresetSpeke20VideoPresetVideo6 = "PRESET_VIDEO_6" - - // PresetSpeke20VideoPresetVideo7 is a PresetSpeke20Video enum value - PresetSpeke20VideoPresetVideo7 = "PRESET_VIDEO_7" - - // PresetSpeke20VideoPresetVideo8 is a PresetSpeke20Video enum value - PresetSpeke20VideoPresetVideo8 = "PRESET_VIDEO_8" - - // PresetSpeke20VideoShared is a PresetSpeke20Video enum value - PresetSpeke20VideoShared = "SHARED" - - // PresetSpeke20VideoUnencrypted is a PresetSpeke20Video enum value - PresetSpeke20VideoUnencrypted = "UNENCRYPTED" -) - -// PresetSpeke20Video_Values returns all elements of the PresetSpeke20Video enum -func PresetSpeke20Video_Values() []string { - return []string{ - PresetSpeke20VideoPresetVideo1, - PresetSpeke20VideoPresetVideo2, - PresetSpeke20VideoPresetVideo3, - PresetSpeke20VideoPresetVideo4, - PresetSpeke20VideoPresetVideo5, - PresetSpeke20VideoPresetVideo6, - PresetSpeke20VideoPresetVideo7, - PresetSpeke20VideoPresetVideo8, - PresetSpeke20VideoShared, - PresetSpeke20VideoUnencrypted, - } -} - -const ( - // ResourceTypeNotFoundChannelGroup is a ResourceTypeNotFound enum value - ResourceTypeNotFoundChannelGroup = "CHANNEL_GROUP" - - // ResourceTypeNotFoundChannel is a ResourceTypeNotFound enum value - ResourceTypeNotFoundChannel = "CHANNEL" - - // ResourceTypeNotFoundOriginEndpoint is a ResourceTypeNotFound enum value - ResourceTypeNotFoundOriginEndpoint = "ORIGIN_ENDPOINT" -) - -// ResourceTypeNotFound_Values returns all elements of the ResourceTypeNotFound enum -func ResourceTypeNotFound_Values() []string { - return []string{ - ResourceTypeNotFoundChannelGroup, - ResourceTypeNotFoundChannel, - ResourceTypeNotFoundOriginEndpoint, - } -} - -const ( - // ScteFilterSpliceInsert is a ScteFilter enum value - ScteFilterSpliceInsert = "SPLICE_INSERT" - - // ScteFilterBreak is a ScteFilter enum value - ScteFilterBreak = "BREAK" - - // ScteFilterProviderAdvertisement is a ScteFilter enum value - ScteFilterProviderAdvertisement = "PROVIDER_ADVERTISEMENT" - - // ScteFilterDistributorAdvertisement is a ScteFilter enum value - ScteFilterDistributorAdvertisement = "DISTRIBUTOR_ADVERTISEMENT" - - // ScteFilterProviderPlacementOpportunity is a ScteFilter enum value - ScteFilterProviderPlacementOpportunity = "PROVIDER_PLACEMENT_OPPORTUNITY" - - // ScteFilterDistributorPlacementOpportunity is a ScteFilter enum value - ScteFilterDistributorPlacementOpportunity = "DISTRIBUTOR_PLACEMENT_OPPORTUNITY" - - // ScteFilterProviderOverlayPlacementOpportunity is a ScteFilter enum value - ScteFilterProviderOverlayPlacementOpportunity = "PROVIDER_OVERLAY_PLACEMENT_OPPORTUNITY" - - // ScteFilterDistributorOverlayPlacementOpportunity is a ScteFilter enum value - ScteFilterDistributorOverlayPlacementOpportunity = "DISTRIBUTOR_OVERLAY_PLACEMENT_OPPORTUNITY" - - // ScteFilterProgram is a ScteFilter enum value - ScteFilterProgram = "PROGRAM" -) - -// ScteFilter_Values returns all elements of the ScteFilter enum -func ScteFilter_Values() []string { - return []string{ - ScteFilterSpliceInsert, - ScteFilterBreak, - ScteFilterProviderAdvertisement, - ScteFilterDistributorAdvertisement, - ScteFilterProviderPlacementOpportunity, - ScteFilterDistributorPlacementOpportunity, - ScteFilterProviderOverlayPlacementOpportunity, - ScteFilterDistributorOverlayPlacementOpportunity, - ScteFilterProgram, - } -} - -const ( - // TsEncryptionMethodAes128 is a TsEncryptionMethod enum value - TsEncryptionMethodAes128 = "AES_128" - - // TsEncryptionMethodSampleAes is a TsEncryptionMethod enum value - TsEncryptionMethodSampleAes = "SAMPLE_AES" -) - -// TsEncryptionMethod_Values returns all elements of the TsEncryptionMethod enum -func TsEncryptionMethod_Values() []string { - return []string{ - TsEncryptionMethodAes128, - TsEncryptionMethodSampleAes, - } -} - -const ( - // ValidationExceptionTypeContainerTypeImmutable is a ValidationExceptionType enum value - ValidationExceptionTypeContainerTypeImmutable = "CONTAINER_TYPE_IMMUTABLE" - - // ValidationExceptionTypeInvalidPaginationToken is a ValidationExceptionType enum value - ValidationExceptionTypeInvalidPaginationToken = "INVALID_PAGINATION_TOKEN" - - // ValidationExceptionTypeInvalidPaginationMaxResults is a ValidationExceptionType enum value - ValidationExceptionTypeInvalidPaginationMaxResults = "INVALID_PAGINATION_MAX_RESULTS" - - // ValidationExceptionTypeInvalidPolicy is a ValidationExceptionType enum value - ValidationExceptionTypeInvalidPolicy = "INVALID_POLICY" - - // ValidationExceptionTypeInvalidRoleArn is a ValidationExceptionType enum value - ValidationExceptionTypeInvalidRoleArn = "INVALID_ROLE_ARN" - - // ValidationExceptionTypeManifestNameCollision is a ValidationExceptionType enum value - ValidationExceptionTypeManifestNameCollision = "MANIFEST_NAME_COLLISION" - - // ValidationExceptionTypeEncryptionMethodContainerTypeMismatch is a ValidationExceptionType enum value - ValidationExceptionTypeEncryptionMethodContainerTypeMismatch = "ENCRYPTION_METHOD_CONTAINER_TYPE_MISMATCH" - - // ValidationExceptionTypeCencIvIncompatible is a ValidationExceptionType enum value - ValidationExceptionTypeCencIvIncompatible = "CENC_IV_INCOMPATIBLE" - - // ValidationExceptionTypeEncryptionContractWithoutAudioRenditionIncompatible is a ValidationExceptionType enum value - ValidationExceptionTypeEncryptionContractWithoutAudioRenditionIncompatible = "ENCRYPTION_CONTRACT_WITHOUT_AUDIO_RENDITION_INCOMPATIBLE" - - // ValidationExceptionTypeEncryptionContractUnencrypted is a ValidationExceptionType enum value - ValidationExceptionTypeEncryptionContractUnencrypted = "ENCRYPTION_CONTRACT_UNENCRYPTED" - - // ValidationExceptionTypeEncryptionContractShared is a ValidationExceptionType enum value - ValidationExceptionTypeEncryptionContractShared = "ENCRYPTION_CONTRACT_SHARED" - - // ValidationExceptionTypeNumManifestsLow is a ValidationExceptionType enum value - ValidationExceptionTypeNumManifestsLow = "NUM_MANIFESTS_LOW" - - // ValidationExceptionTypeNumManifestsHigh is a ValidationExceptionType enum value - ValidationExceptionTypeNumManifestsHigh = "NUM_MANIFESTS_HIGH" - - // ValidationExceptionTypeDrmSystemsEncryptionMethodIncompatible is a ValidationExceptionType enum value - ValidationExceptionTypeDrmSystemsEncryptionMethodIncompatible = "DRM_SYSTEMS_ENCRYPTION_METHOD_INCOMPATIBLE" - - // ValidationExceptionTypeRoleArnNotAssumable is a ValidationExceptionType enum value - ValidationExceptionTypeRoleArnNotAssumable = "ROLE_ARN_NOT_ASSUMABLE" - - // ValidationExceptionTypeRoleArnLengthOutOfRange is a ValidationExceptionType enum value - ValidationExceptionTypeRoleArnLengthOutOfRange = "ROLE_ARN_LENGTH_OUT_OF_RANGE" - - // ValidationExceptionTypeRoleArnInvalidFormat is a ValidationExceptionType enum value - ValidationExceptionTypeRoleArnInvalidFormat = "ROLE_ARN_INVALID_FORMAT" - - // ValidationExceptionTypeUrlInvalid is a ValidationExceptionType enum value - ValidationExceptionTypeUrlInvalid = "URL_INVALID" - - // ValidationExceptionTypeUrlScheme is a ValidationExceptionType enum value - ValidationExceptionTypeUrlScheme = "URL_SCHEME" - - // ValidationExceptionTypeUrlUserInfo is a ValidationExceptionType enum value - ValidationExceptionTypeUrlUserInfo = "URL_USER_INFO" - - // ValidationExceptionTypeUrlPort is a ValidationExceptionType enum value - ValidationExceptionTypeUrlPort = "URL_PORT" - - // ValidationExceptionTypeUrlUnknownHost is a ValidationExceptionType enum value - ValidationExceptionTypeUrlUnknownHost = "URL_UNKNOWN_HOST" - - // ValidationExceptionTypeUrlLocalAddress is a ValidationExceptionType enum value - ValidationExceptionTypeUrlLocalAddress = "URL_LOCAL_ADDRESS" - - // ValidationExceptionTypeUrlLoopbackAddress is a ValidationExceptionType enum value - ValidationExceptionTypeUrlLoopbackAddress = "URL_LOOPBACK_ADDRESS" - - // ValidationExceptionTypeUrlLinkLocalAddress is a ValidationExceptionType enum value - ValidationExceptionTypeUrlLinkLocalAddress = "URL_LINK_LOCAL_ADDRESS" - - // ValidationExceptionTypeUrlMulticastAddress is a ValidationExceptionType enum value - ValidationExceptionTypeUrlMulticastAddress = "URL_MULTICAST_ADDRESS" - - // ValidationExceptionTypeMemberInvalid is a ValidationExceptionType enum value - ValidationExceptionTypeMemberInvalid = "MEMBER_INVALID" - - // ValidationExceptionTypeMemberMissing is a ValidationExceptionType enum value - ValidationExceptionTypeMemberMissing = "MEMBER_MISSING" - - // ValidationExceptionTypeMemberMinValue is a ValidationExceptionType enum value - ValidationExceptionTypeMemberMinValue = "MEMBER_MIN_VALUE" - - // ValidationExceptionTypeMemberMaxValue is a ValidationExceptionType enum value - ValidationExceptionTypeMemberMaxValue = "MEMBER_MAX_VALUE" - - // ValidationExceptionTypeMemberMinLength is a ValidationExceptionType enum value - ValidationExceptionTypeMemberMinLength = "MEMBER_MIN_LENGTH" - - // ValidationExceptionTypeMemberMaxLength is a ValidationExceptionType enum value - ValidationExceptionTypeMemberMaxLength = "MEMBER_MAX_LENGTH" - - // ValidationExceptionTypeMemberInvalidEnumValue is a ValidationExceptionType enum value - ValidationExceptionTypeMemberInvalidEnumValue = "MEMBER_INVALID_ENUM_VALUE" - - // ValidationExceptionTypeMemberDoesNotMatchPattern is a ValidationExceptionType enum value - ValidationExceptionTypeMemberDoesNotMatchPattern = "MEMBER_DOES_NOT_MATCH_PATTERN" - - // ValidationExceptionTypeInvalidManifestFilter is a ValidationExceptionType enum value - ValidationExceptionTypeInvalidManifestFilter = "INVALID_MANIFEST_FILTER" - - // ValidationExceptionTypeInvalidTimeDelaySeconds is a ValidationExceptionType enum value - ValidationExceptionTypeInvalidTimeDelaySeconds = "INVALID_TIME_DELAY_SECONDS" - - // ValidationExceptionTypeEndTimeEarlierThanStartTime is a ValidationExceptionType enum value - ValidationExceptionTypeEndTimeEarlierThanStartTime = "END_TIME_EARLIER_THAN_START_TIME" -) - -// ValidationExceptionType_Values returns all elements of the ValidationExceptionType enum -func ValidationExceptionType_Values() []string { - return []string{ - ValidationExceptionTypeContainerTypeImmutable, - ValidationExceptionTypeInvalidPaginationToken, - ValidationExceptionTypeInvalidPaginationMaxResults, - ValidationExceptionTypeInvalidPolicy, - ValidationExceptionTypeInvalidRoleArn, - ValidationExceptionTypeManifestNameCollision, - ValidationExceptionTypeEncryptionMethodContainerTypeMismatch, - ValidationExceptionTypeCencIvIncompatible, - ValidationExceptionTypeEncryptionContractWithoutAudioRenditionIncompatible, - ValidationExceptionTypeEncryptionContractUnencrypted, - ValidationExceptionTypeEncryptionContractShared, - ValidationExceptionTypeNumManifestsLow, - ValidationExceptionTypeNumManifestsHigh, - ValidationExceptionTypeDrmSystemsEncryptionMethodIncompatible, - ValidationExceptionTypeRoleArnNotAssumable, - ValidationExceptionTypeRoleArnLengthOutOfRange, - ValidationExceptionTypeRoleArnInvalidFormat, - ValidationExceptionTypeUrlInvalid, - ValidationExceptionTypeUrlScheme, - ValidationExceptionTypeUrlUserInfo, - ValidationExceptionTypeUrlPort, - ValidationExceptionTypeUrlUnknownHost, - ValidationExceptionTypeUrlLocalAddress, - ValidationExceptionTypeUrlLoopbackAddress, - ValidationExceptionTypeUrlLinkLocalAddress, - ValidationExceptionTypeUrlMulticastAddress, - ValidationExceptionTypeMemberInvalid, - ValidationExceptionTypeMemberMissing, - ValidationExceptionTypeMemberMinValue, - ValidationExceptionTypeMemberMaxValue, - ValidationExceptionTypeMemberMinLength, - ValidationExceptionTypeMemberMaxLength, - ValidationExceptionTypeMemberInvalidEnumValue, - ValidationExceptionTypeMemberDoesNotMatchPattern, - ValidationExceptionTypeInvalidManifestFilter, - ValidationExceptionTypeInvalidTimeDelaySeconds, - ValidationExceptionTypeEndTimeEarlierThanStartTime, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/doc.go deleted file mode 100644 index a60a18bce2bc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/doc.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package mediapackagev2 provides the client and types for making API -// requests to AWS Elemental MediaPackage v2. -// -// This guide is intended for creating AWS Elemental MediaPackage resources -// in MediaPackage Version 2 (v2) starting from May 2023. To get started with -// MediaPackage v2, create your MediaPackage resources. There isn't an automated -// process to migrate your resources from MediaPackage v1 to MediaPackage v2. -// -// The names of the entities that you use to access this API, like URLs and -// ARNs, all have the versioning information added, like "v2", to distinguish -// from the prior version. If you used MediaPackage prior to this release, you -// can't use the MediaPackage v2 CLI or the MediaPackage v2 API to access any -// MediaPackage v1 resources. -// -// If you created resources in MediaPackage v1, use video on demand (VOD) workflows, -// and aren't looking to migrate to MediaPackage v2 yet, see the MediaPackage -// v1 Live API Reference (https://docs.aws.amazon.com/mediapackage/latest/apireference/what-is.html). -// -// This is the AWS Elemental MediaPackage v2 Live REST API Reference. It describes -// all the MediaPackage API operations for live content in detail, and provides -// sample requests, responses, and errors for the supported web services protocols. -// -// We assume that you have the IAM permissions that you need to use MediaPackage -// via the REST API. We also assume that you are familiar with the features -// and operations of MediaPackage, as described in the AWS Elemental MediaPackage -// User Guide. -// -// See https://docs.aws.amazon.com/goto/WebAPI/mediapackagev2-2022-12-25 for more information on this service. -// -// See mediapackagev2 package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/mediapackagev2/ -// -// # Using the Client -// -// To contact AWS Elemental MediaPackage v2 with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Elemental MediaPackage v2 client MediaPackageV2 for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/mediapackagev2/#New -package mediapackagev2 diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/errors.go deleted file mode 100644 index 6a2779ae7a8d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/errors.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package mediapackagev2 - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have permissions to perform the requested operation. The user or - // role that is making the request must have at least one IAM permissions policy - // attached that grants the required permissions. For more information, see - // Access Management in the IAM User Guide. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Updating or deleting this resource can cause an inconsistent state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Indicates that an error from the service occurred while trying to process - // a request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request would cause a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request throughput limit was exceeded. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input failed to meet the constraints specified by the AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/mediapackagev2iface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/mediapackagev2iface/interface.go deleted file mode 100644 index 4f006a621675..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/mediapackagev2iface/interface.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package mediapackagev2iface provides an interface to enable mocking the AWS Elemental MediaPackage v2 service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package mediapackagev2iface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2" -) - -// MediaPackageV2API provides an interface to enable mocking the -// mediapackagev2.MediaPackageV2 service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Elemental MediaPackage v2. -// func myFunc(svc mediapackagev2iface.MediaPackageV2API) bool { -// // Make svc.CreateChannel request -// } -// -// func main() { -// sess := session.New() -// svc := mediapackagev2.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockMediaPackageV2Client struct { -// mediapackagev2iface.MediaPackageV2API -// } -// func (m *mockMediaPackageV2Client) CreateChannel(input *mediapackagev2.CreateChannelInput) (*mediapackagev2.CreateChannelOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockMediaPackageV2Client{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type MediaPackageV2API interface { - CreateChannel(*mediapackagev2.CreateChannelInput) (*mediapackagev2.CreateChannelOutput, error) - CreateChannelWithContext(aws.Context, *mediapackagev2.CreateChannelInput, ...request.Option) (*mediapackagev2.CreateChannelOutput, error) - CreateChannelRequest(*mediapackagev2.CreateChannelInput) (*request.Request, *mediapackagev2.CreateChannelOutput) - - CreateChannelGroup(*mediapackagev2.CreateChannelGroupInput) (*mediapackagev2.CreateChannelGroupOutput, error) - CreateChannelGroupWithContext(aws.Context, *mediapackagev2.CreateChannelGroupInput, ...request.Option) (*mediapackagev2.CreateChannelGroupOutput, error) - CreateChannelGroupRequest(*mediapackagev2.CreateChannelGroupInput) (*request.Request, *mediapackagev2.CreateChannelGroupOutput) - - CreateOriginEndpoint(*mediapackagev2.CreateOriginEndpointInput) (*mediapackagev2.CreateOriginEndpointOutput, error) - CreateOriginEndpointWithContext(aws.Context, *mediapackagev2.CreateOriginEndpointInput, ...request.Option) (*mediapackagev2.CreateOriginEndpointOutput, error) - CreateOriginEndpointRequest(*mediapackagev2.CreateOriginEndpointInput) (*request.Request, *mediapackagev2.CreateOriginEndpointOutput) - - DeleteChannel(*mediapackagev2.DeleteChannelInput) (*mediapackagev2.DeleteChannelOutput, error) - DeleteChannelWithContext(aws.Context, *mediapackagev2.DeleteChannelInput, ...request.Option) (*mediapackagev2.DeleteChannelOutput, error) - DeleteChannelRequest(*mediapackagev2.DeleteChannelInput) (*request.Request, *mediapackagev2.DeleteChannelOutput) - - DeleteChannelGroup(*mediapackagev2.DeleteChannelGroupInput) (*mediapackagev2.DeleteChannelGroupOutput, error) - DeleteChannelGroupWithContext(aws.Context, *mediapackagev2.DeleteChannelGroupInput, ...request.Option) (*mediapackagev2.DeleteChannelGroupOutput, error) - DeleteChannelGroupRequest(*mediapackagev2.DeleteChannelGroupInput) (*request.Request, *mediapackagev2.DeleteChannelGroupOutput) - - DeleteChannelPolicy(*mediapackagev2.DeleteChannelPolicyInput) (*mediapackagev2.DeleteChannelPolicyOutput, error) - DeleteChannelPolicyWithContext(aws.Context, *mediapackagev2.DeleteChannelPolicyInput, ...request.Option) (*mediapackagev2.DeleteChannelPolicyOutput, error) - DeleteChannelPolicyRequest(*mediapackagev2.DeleteChannelPolicyInput) (*request.Request, *mediapackagev2.DeleteChannelPolicyOutput) - - DeleteOriginEndpoint(*mediapackagev2.DeleteOriginEndpointInput) (*mediapackagev2.DeleteOriginEndpointOutput, error) - DeleteOriginEndpointWithContext(aws.Context, *mediapackagev2.DeleteOriginEndpointInput, ...request.Option) (*mediapackagev2.DeleteOriginEndpointOutput, error) - DeleteOriginEndpointRequest(*mediapackagev2.DeleteOriginEndpointInput) (*request.Request, *mediapackagev2.DeleteOriginEndpointOutput) - - DeleteOriginEndpointPolicy(*mediapackagev2.DeleteOriginEndpointPolicyInput) (*mediapackagev2.DeleteOriginEndpointPolicyOutput, error) - DeleteOriginEndpointPolicyWithContext(aws.Context, *mediapackagev2.DeleteOriginEndpointPolicyInput, ...request.Option) (*mediapackagev2.DeleteOriginEndpointPolicyOutput, error) - DeleteOriginEndpointPolicyRequest(*mediapackagev2.DeleteOriginEndpointPolicyInput) (*request.Request, *mediapackagev2.DeleteOriginEndpointPolicyOutput) - - GetChannel(*mediapackagev2.GetChannelInput) (*mediapackagev2.GetChannelOutput, error) - GetChannelWithContext(aws.Context, *mediapackagev2.GetChannelInput, ...request.Option) (*mediapackagev2.GetChannelOutput, error) - GetChannelRequest(*mediapackagev2.GetChannelInput) (*request.Request, *mediapackagev2.GetChannelOutput) - - GetChannelGroup(*mediapackagev2.GetChannelGroupInput) (*mediapackagev2.GetChannelGroupOutput, error) - GetChannelGroupWithContext(aws.Context, *mediapackagev2.GetChannelGroupInput, ...request.Option) (*mediapackagev2.GetChannelGroupOutput, error) - GetChannelGroupRequest(*mediapackagev2.GetChannelGroupInput) (*request.Request, *mediapackagev2.GetChannelGroupOutput) - - GetChannelPolicy(*mediapackagev2.GetChannelPolicyInput) (*mediapackagev2.GetChannelPolicyOutput, error) - GetChannelPolicyWithContext(aws.Context, *mediapackagev2.GetChannelPolicyInput, ...request.Option) (*mediapackagev2.GetChannelPolicyOutput, error) - GetChannelPolicyRequest(*mediapackagev2.GetChannelPolicyInput) (*request.Request, *mediapackagev2.GetChannelPolicyOutput) - - GetOriginEndpoint(*mediapackagev2.GetOriginEndpointInput) (*mediapackagev2.GetOriginEndpointOutput, error) - GetOriginEndpointWithContext(aws.Context, *mediapackagev2.GetOriginEndpointInput, ...request.Option) (*mediapackagev2.GetOriginEndpointOutput, error) - GetOriginEndpointRequest(*mediapackagev2.GetOriginEndpointInput) (*request.Request, *mediapackagev2.GetOriginEndpointOutput) - - GetOriginEndpointPolicy(*mediapackagev2.GetOriginEndpointPolicyInput) (*mediapackagev2.GetOriginEndpointPolicyOutput, error) - GetOriginEndpointPolicyWithContext(aws.Context, *mediapackagev2.GetOriginEndpointPolicyInput, ...request.Option) (*mediapackagev2.GetOriginEndpointPolicyOutput, error) - GetOriginEndpointPolicyRequest(*mediapackagev2.GetOriginEndpointPolicyInput) (*request.Request, *mediapackagev2.GetOriginEndpointPolicyOutput) - - ListChannelGroups(*mediapackagev2.ListChannelGroupsInput) (*mediapackagev2.ListChannelGroupsOutput, error) - ListChannelGroupsWithContext(aws.Context, *mediapackagev2.ListChannelGroupsInput, ...request.Option) (*mediapackagev2.ListChannelGroupsOutput, error) - ListChannelGroupsRequest(*mediapackagev2.ListChannelGroupsInput) (*request.Request, *mediapackagev2.ListChannelGroupsOutput) - - ListChannelGroupsPages(*mediapackagev2.ListChannelGroupsInput, func(*mediapackagev2.ListChannelGroupsOutput, bool) bool) error - ListChannelGroupsPagesWithContext(aws.Context, *mediapackagev2.ListChannelGroupsInput, func(*mediapackagev2.ListChannelGroupsOutput, bool) bool, ...request.Option) error - - ListChannels(*mediapackagev2.ListChannelsInput) (*mediapackagev2.ListChannelsOutput, error) - ListChannelsWithContext(aws.Context, *mediapackagev2.ListChannelsInput, ...request.Option) (*mediapackagev2.ListChannelsOutput, error) - ListChannelsRequest(*mediapackagev2.ListChannelsInput) (*request.Request, *mediapackagev2.ListChannelsOutput) - - ListChannelsPages(*mediapackagev2.ListChannelsInput, func(*mediapackagev2.ListChannelsOutput, bool) bool) error - ListChannelsPagesWithContext(aws.Context, *mediapackagev2.ListChannelsInput, func(*mediapackagev2.ListChannelsOutput, bool) bool, ...request.Option) error - - ListOriginEndpoints(*mediapackagev2.ListOriginEndpointsInput) (*mediapackagev2.ListOriginEndpointsOutput, error) - ListOriginEndpointsWithContext(aws.Context, *mediapackagev2.ListOriginEndpointsInput, ...request.Option) (*mediapackagev2.ListOriginEndpointsOutput, error) - ListOriginEndpointsRequest(*mediapackagev2.ListOriginEndpointsInput) (*request.Request, *mediapackagev2.ListOriginEndpointsOutput) - - ListOriginEndpointsPages(*mediapackagev2.ListOriginEndpointsInput, func(*mediapackagev2.ListOriginEndpointsOutput, bool) bool) error - ListOriginEndpointsPagesWithContext(aws.Context, *mediapackagev2.ListOriginEndpointsInput, func(*mediapackagev2.ListOriginEndpointsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*mediapackagev2.ListTagsForResourceInput) (*mediapackagev2.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *mediapackagev2.ListTagsForResourceInput, ...request.Option) (*mediapackagev2.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*mediapackagev2.ListTagsForResourceInput) (*request.Request, *mediapackagev2.ListTagsForResourceOutput) - - PutChannelPolicy(*mediapackagev2.PutChannelPolicyInput) (*mediapackagev2.PutChannelPolicyOutput, error) - PutChannelPolicyWithContext(aws.Context, *mediapackagev2.PutChannelPolicyInput, ...request.Option) (*mediapackagev2.PutChannelPolicyOutput, error) - PutChannelPolicyRequest(*mediapackagev2.PutChannelPolicyInput) (*request.Request, *mediapackagev2.PutChannelPolicyOutput) - - PutOriginEndpointPolicy(*mediapackagev2.PutOriginEndpointPolicyInput) (*mediapackagev2.PutOriginEndpointPolicyOutput, error) - PutOriginEndpointPolicyWithContext(aws.Context, *mediapackagev2.PutOriginEndpointPolicyInput, ...request.Option) (*mediapackagev2.PutOriginEndpointPolicyOutput, error) - PutOriginEndpointPolicyRequest(*mediapackagev2.PutOriginEndpointPolicyInput) (*request.Request, *mediapackagev2.PutOriginEndpointPolicyOutput) - - TagResource(*mediapackagev2.TagResourceInput) (*mediapackagev2.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *mediapackagev2.TagResourceInput, ...request.Option) (*mediapackagev2.TagResourceOutput, error) - TagResourceRequest(*mediapackagev2.TagResourceInput) (*request.Request, *mediapackagev2.TagResourceOutput) - - UntagResource(*mediapackagev2.UntagResourceInput) (*mediapackagev2.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *mediapackagev2.UntagResourceInput, ...request.Option) (*mediapackagev2.UntagResourceOutput, error) - UntagResourceRequest(*mediapackagev2.UntagResourceInput) (*request.Request, *mediapackagev2.UntagResourceOutput) - - UpdateChannel(*mediapackagev2.UpdateChannelInput) (*mediapackagev2.UpdateChannelOutput, error) - UpdateChannelWithContext(aws.Context, *mediapackagev2.UpdateChannelInput, ...request.Option) (*mediapackagev2.UpdateChannelOutput, error) - UpdateChannelRequest(*mediapackagev2.UpdateChannelInput) (*request.Request, *mediapackagev2.UpdateChannelOutput) - - UpdateChannelGroup(*mediapackagev2.UpdateChannelGroupInput) (*mediapackagev2.UpdateChannelGroupOutput, error) - UpdateChannelGroupWithContext(aws.Context, *mediapackagev2.UpdateChannelGroupInput, ...request.Option) (*mediapackagev2.UpdateChannelGroupOutput, error) - UpdateChannelGroupRequest(*mediapackagev2.UpdateChannelGroupInput) (*request.Request, *mediapackagev2.UpdateChannelGroupOutput) - - UpdateOriginEndpoint(*mediapackagev2.UpdateOriginEndpointInput) (*mediapackagev2.UpdateOriginEndpointOutput, error) - UpdateOriginEndpointWithContext(aws.Context, *mediapackagev2.UpdateOriginEndpointInput, ...request.Option) (*mediapackagev2.UpdateOriginEndpointOutput, error) - UpdateOriginEndpointRequest(*mediapackagev2.UpdateOriginEndpointInput) (*request.Request, *mediapackagev2.UpdateOriginEndpointOutput) -} - -var _ MediaPackageV2API = (*mediapackagev2.MediaPackageV2)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/service.go deleted file mode 100644 index 9eaa04c297f9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/mediapackagev2/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package mediapackagev2 - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// MediaPackageV2 provides the API operation methods for making requests to -// AWS Elemental MediaPackage v2. See this package's package overview docs -// for details on the service. -// -// MediaPackageV2 methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type MediaPackageV2 struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "MediaPackageV2" // Name of service. - EndpointsID = "mediapackagev2" // ID to lookup a service endpoint with. - ServiceID = "MediaPackageV2" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the MediaPackageV2 client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a MediaPackageV2 client from just a session. -// svc := mediapackagev2.New(mySession) -// -// // Create a MediaPackageV2 client with additional configuration -// svc := mediapackagev2.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *MediaPackageV2 { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "mediapackagev2" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *MediaPackageV2 { - svc := &MediaPackageV2{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-12-25", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a MediaPackageV2 operation and runs any -// custom request initialization. -func (c *MediaPackageV2) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/api.go deleted file mode 100644 index d6c412a1f2ff..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/api.go +++ /dev/null @@ -1,6383 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package medicalimaging - -import ( - "fmt" - "io" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCopyImageSet = "CopyImageSet" - -// CopyImageSetRequest generates a "aws/request.Request" representing the -// client's request for the CopyImageSet 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 CopyImageSet for more information on using the CopyImageSet -// 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 CopyImageSetRequest method. -// req, resp := client.CopyImageSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/CopyImageSet -func (c *MedicalImaging) CopyImageSetRequest(input *CopyImageSetInput) (req *request.Request, output *CopyImageSetOutput) { - op := &request.Operation{ - Name: opCopyImageSet, - HTTPMethod: "POST", - HTTPPath: "/datastore/{datastoreId}/imageSet/{sourceImageSetId}/copyImageSet", - } - - if input == nil { - input = &CopyImageSetInput{} - } - - output = &CopyImageSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("runtime-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CopyImageSet API operation for AWS Health Imaging. -// -// Copy an image set. -// -// 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 AWS Health Imaging's -// API operation CopyImageSet for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ServiceQuotaExceededException -// The request caused a service quota to be exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/CopyImageSet -func (c *MedicalImaging) CopyImageSet(input *CopyImageSetInput) (*CopyImageSetOutput, error) { - req, out := c.CopyImageSetRequest(input) - return out, req.Send() -} - -// CopyImageSetWithContext is the same as CopyImageSet with the addition of -// the ability to pass a context and additional request options. -// -// See CopyImageSet 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 *MedicalImaging) CopyImageSetWithContext(ctx aws.Context, input *CopyImageSetInput, opts ...request.Option) (*CopyImageSetOutput, error) { - req, out := c.CopyImageSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDatastore = "CreateDatastore" - -// CreateDatastoreRequest generates a "aws/request.Request" representing the -// client's request for the CreateDatastore 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 CreateDatastore for more information on using the CreateDatastore -// 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 CreateDatastoreRequest method. -// req, resp := client.CreateDatastoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/CreateDatastore -func (c *MedicalImaging) CreateDatastoreRequest(input *CreateDatastoreInput) (req *request.Request, output *CreateDatastoreOutput) { - op := &request.Operation{ - Name: opCreateDatastore, - HTTPMethod: "POST", - HTTPPath: "/datastore", - } - - if input == nil { - input = &CreateDatastoreInput{} - } - - output = &CreateDatastoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDatastore API operation for AWS Health Imaging. -// -// Create a data store. -// -// 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 AWS Health Imaging's -// API operation CreateDatastore for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ServiceQuotaExceededException -// The request caused a service quota to be exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/CreateDatastore -func (c *MedicalImaging) CreateDatastore(input *CreateDatastoreInput) (*CreateDatastoreOutput, error) { - req, out := c.CreateDatastoreRequest(input) - return out, req.Send() -} - -// CreateDatastoreWithContext is the same as CreateDatastore with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDatastore 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 *MedicalImaging) CreateDatastoreWithContext(ctx aws.Context, input *CreateDatastoreInput, opts ...request.Option) (*CreateDatastoreOutput, error) { - req, out := c.CreateDatastoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDatastore = "DeleteDatastore" - -// DeleteDatastoreRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDatastore 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 DeleteDatastore for more information on using the DeleteDatastore -// 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 DeleteDatastoreRequest method. -// req, resp := client.DeleteDatastoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/DeleteDatastore -func (c *MedicalImaging) DeleteDatastoreRequest(input *DeleteDatastoreInput) (req *request.Request, output *DeleteDatastoreOutput) { - op := &request.Operation{ - Name: opDeleteDatastore, - HTTPMethod: "DELETE", - HTTPPath: "/datastore/{datastoreId}", - } - - if input == nil { - input = &DeleteDatastoreInput{} - } - - output = &DeleteDatastoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteDatastore API operation for AWS Health Imaging. -// -// Delete a data store. -// -// Before a data store can be deleted, you must first delete all image sets -// within it. -// -// 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 AWS Health Imaging's -// API operation DeleteDatastore for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/DeleteDatastore -func (c *MedicalImaging) DeleteDatastore(input *DeleteDatastoreInput) (*DeleteDatastoreOutput, error) { - req, out := c.DeleteDatastoreRequest(input) - return out, req.Send() -} - -// DeleteDatastoreWithContext is the same as DeleteDatastore with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDatastore 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 *MedicalImaging) DeleteDatastoreWithContext(ctx aws.Context, input *DeleteDatastoreInput, opts ...request.Option) (*DeleteDatastoreOutput, error) { - req, out := c.DeleteDatastoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteImageSet = "DeleteImageSet" - -// DeleteImageSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteImageSet 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 DeleteImageSet for more information on using the DeleteImageSet -// 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 DeleteImageSetRequest method. -// req, resp := client.DeleteImageSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/DeleteImageSet -func (c *MedicalImaging) DeleteImageSetRequest(input *DeleteImageSetInput) (req *request.Request, output *DeleteImageSetOutput) { - op := &request.Operation{ - Name: opDeleteImageSet, - HTTPMethod: "POST", - HTTPPath: "/datastore/{datastoreId}/imageSet/{imageSetId}/deleteImageSet", - } - - if input == nil { - input = &DeleteImageSetInput{} - } - - output = &DeleteImageSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("runtime-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteImageSet API operation for AWS Health Imaging. -// -// Delete an image set. -// -// 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 AWS Health Imaging's -// API operation DeleteImageSet for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/DeleteImageSet -func (c *MedicalImaging) DeleteImageSet(input *DeleteImageSetInput) (*DeleteImageSetOutput, error) { - req, out := c.DeleteImageSetRequest(input) - return out, req.Send() -} - -// DeleteImageSetWithContext is the same as DeleteImageSet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteImageSet 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 *MedicalImaging) DeleteImageSetWithContext(ctx aws.Context, input *DeleteImageSetInput, opts ...request.Option) (*DeleteImageSetOutput, error) { - req, out := c.DeleteImageSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDICOMImportJob = "GetDICOMImportJob" - -// GetDICOMImportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetDICOMImportJob 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 GetDICOMImportJob for more information on using the GetDICOMImportJob -// 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 GetDICOMImportJobRequest method. -// req, resp := client.GetDICOMImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetDICOMImportJob -func (c *MedicalImaging) GetDICOMImportJobRequest(input *GetDICOMImportJobInput) (req *request.Request, output *GetDICOMImportJobOutput) { - op := &request.Operation{ - Name: opGetDICOMImportJob, - HTTPMethod: "GET", - HTTPPath: "/getDICOMImportJob/datastore/{datastoreId}/job/{jobId}", - } - - if input == nil { - input = &GetDICOMImportJobInput{} - } - - output = &GetDICOMImportJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDICOMImportJob API operation for AWS Health Imaging. -// -// Get the import job properties to learn more about the job or job progress. -// -// 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 AWS Health Imaging's -// API operation GetDICOMImportJob for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetDICOMImportJob -func (c *MedicalImaging) GetDICOMImportJob(input *GetDICOMImportJobInput) (*GetDICOMImportJobOutput, error) { - req, out := c.GetDICOMImportJobRequest(input) - return out, req.Send() -} - -// GetDICOMImportJobWithContext is the same as GetDICOMImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetDICOMImportJob 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 *MedicalImaging) GetDICOMImportJobWithContext(ctx aws.Context, input *GetDICOMImportJobInput, opts ...request.Option) (*GetDICOMImportJobOutput, error) { - req, out := c.GetDICOMImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDatastore = "GetDatastore" - -// GetDatastoreRequest generates a "aws/request.Request" representing the -// client's request for the GetDatastore 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 GetDatastore for more information on using the GetDatastore -// 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 GetDatastoreRequest method. -// req, resp := client.GetDatastoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetDatastore -func (c *MedicalImaging) GetDatastoreRequest(input *GetDatastoreInput) (req *request.Request, output *GetDatastoreOutput) { - op := &request.Operation{ - Name: opGetDatastore, - HTTPMethod: "GET", - HTTPPath: "/datastore/{datastoreId}", - } - - if input == nil { - input = &GetDatastoreInput{} - } - - output = &GetDatastoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDatastore API operation for AWS Health Imaging. -// -// Get data store properties. -// -// 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 AWS Health Imaging's -// API operation GetDatastore for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetDatastore -func (c *MedicalImaging) GetDatastore(input *GetDatastoreInput) (*GetDatastoreOutput, error) { - req, out := c.GetDatastoreRequest(input) - return out, req.Send() -} - -// GetDatastoreWithContext is the same as GetDatastore with the addition of -// the ability to pass a context and additional request options. -// -// See GetDatastore 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 *MedicalImaging) GetDatastoreWithContext(ctx aws.Context, input *GetDatastoreInput, opts ...request.Option) (*GetDatastoreOutput, error) { - req, out := c.GetDatastoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetImageFrame = "GetImageFrame" - -// GetImageFrameRequest generates a "aws/request.Request" representing the -// client's request for the GetImageFrame 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 GetImageFrame for more information on using the GetImageFrame -// 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 GetImageFrameRequest method. -// req, resp := client.GetImageFrameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetImageFrame -func (c *MedicalImaging) GetImageFrameRequest(input *GetImageFrameInput) (req *request.Request, output *GetImageFrameOutput) { - op := &request.Operation{ - Name: opGetImageFrame, - HTTPMethod: "POST", - HTTPPath: "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageFrame", - } - - if input == nil { - input = &GetImageFrameInput{} - } - - output = &GetImageFrameOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("runtime-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetImageFrame API operation for AWS Health Imaging. -// -// Get an image frame (pixel data) for an image set. -// -// 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 AWS Health Imaging's -// API operation GetImageFrame for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetImageFrame -func (c *MedicalImaging) GetImageFrame(input *GetImageFrameInput) (*GetImageFrameOutput, error) { - req, out := c.GetImageFrameRequest(input) - return out, req.Send() -} - -// GetImageFrameWithContext is the same as GetImageFrame with the addition of -// the ability to pass a context and additional request options. -// -// See GetImageFrame 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 *MedicalImaging) GetImageFrameWithContext(ctx aws.Context, input *GetImageFrameInput, opts ...request.Option) (*GetImageFrameOutput, error) { - req, out := c.GetImageFrameRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetImageSet = "GetImageSet" - -// GetImageSetRequest generates a "aws/request.Request" representing the -// client's request for the GetImageSet 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 GetImageSet for more information on using the GetImageSet -// 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 GetImageSetRequest method. -// req, resp := client.GetImageSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetImageSet -func (c *MedicalImaging) GetImageSetRequest(input *GetImageSetInput) (req *request.Request, output *GetImageSetOutput) { - op := &request.Operation{ - Name: opGetImageSet, - HTTPMethod: "POST", - HTTPPath: "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageSet", - } - - if input == nil { - input = &GetImageSetInput{} - } - - output = &GetImageSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("runtime-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetImageSet API operation for AWS Health Imaging. -// -// Get image set properties. -// -// 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 AWS Health Imaging's -// API operation GetImageSet for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetImageSet -func (c *MedicalImaging) GetImageSet(input *GetImageSetInput) (*GetImageSetOutput, error) { - req, out := c.GetImageSetRequest(input) - return out, req.Send() -} - -// GetImageSetWithContext is the same as GetImageSet with the addition of -// the ability to pass a context and additional request options. -// -// See GetImageSet 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 *MedicalImaging) GetImageSetWithContext(ctx aws.Context, input *GetImageSetInput, opts ...request.Option) (*GetImageSetOutput, error) { - req, out := c.GetImageSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetImageSetMetadata = "GetImageSetMetadata" - -// GetImageSetMetadataRequest generates a "aws/request.Request" representing the -// client's request for the GetImageSetMetadata 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 GetImageSetMetadata for more information on using the GetImageSetMetadata -// 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 GetImageSetMetadataRequest method. -// req, resp := client.GetImageSetMetadataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetImageSetMetadata -func (c *MedicalImaging) GetImageSetMetadataRequest(input *GetImageSetMetadataInput) (req *request.Request, output *GetImageSetMetadataOutput) { - op := &request.Operation{ - Name: opGetImageSetMetadata, - HTTPMethod: "POST", - HTTPPath: "/datastore/{datastoreId}/imageSet/{imageSetId}/getImageSetMetadata", - } - - if input == nil { - input = &GetImageSetMetadataInput{} - } - - output = &GetImageSetMetadataOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("runtime-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetImageSetMetadata API operation for AWS Health Imaging. -// -// Get metadata attributes for an image set. -// -// 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 AWS Health Imaging's -// API operation GetImageSetMetadata for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/GetImageSetMetadata -func (c *MedicalImaging) GetImageSetMetadata(input *GetImageSetMetadataInput) (*GetImageSetMetadataOutput, error) { - req, out := c.GetImageSetMetadataRequest(input) - return out, req.Send() -} - -// GetImageSetMetadataWithContext is the same as GetImageSetMetadata with the addition of -// the ability to pass a context and additional request options. -// -// See GetImageSetMetadata 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 *MedicalImaging) GetImageSetMetadataWithContext(ctx aws.Context, input *GetImageSetMetadataInput, opts ...request.Option) (*GetImageSetMetadataOutput, error) { - req, out := c.GetImageSetMetadataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListDICOMImportJobs = "ListDICOMImportJobs" - -// ListDICOMImportJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListDICOMImportJobs 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 ListDICOMImportJobs for more information on using the ListDICOMImportJobs -// 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 ListDICOMImportJobsRequest method. -// req, resp := client.ListDICOMImportJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/ListDICOMImportJobs -func (c *MedicalImaging) ListDICOMImportJobsRequest(input *ListDICOMImportJobsInput) (req *request.Request, output *ListDICOMImportJobsOutput) { - op := &request.Operation{ - Name: opListDICOMImportJobs, - HTTPMethod: "GET", - HTTPPath: "/listDICOMImportJobs/datastore/{datastoreId}", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDICOMImportJobsInput{} - } - - output = &ListDICOMImportJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDICOMImportJobs API operation for AWS Health Imaging. -// -// List import jobs created for a specific data store. -// -// 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 AWS Health Imaging's -// API operation ListDICOMImportJobs for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/ListDICOMImportJobs -func (c *MedicalImaging) ListDICOMImportJobs(input *ListDICOMImportJobsInput) (*ListDICOMImportJobsOutput, error) { - req, out := c.ListDICOMImportJobsRequest(input) - return out, req.Send() -} - -// ListDICOMImportJobsWithContext is the same as ListDICOMImportJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListDICOMImportJobs 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 *MedicalImaging) ListDICOMImportJobsWithContext(ctx aws.Context, input *ListDICOMImportJobsInput, opts ...request.Option) (*ListDICOMImportJobsOutput, error) { - req, out := c.ListDICOMImportJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDICOMImportJobsPages iterates over the pages of a ListDICOMImportJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDICOMImportJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDICOMImportJobs operation. -// pageNum := 0 -// err := client.ListDICOMImportJobsPages(params, -// func(page *medicalimaging.ListDICOMImportJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MedicalImaging) ListDICOMImportJobsPages(input *ListDICOMImportJobsInput, fn func(*ListDICOMImportJobsOutput, bool) bool) error { - return c.ListDICOMImportJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDICOMImportJobsPagesWithContext same as ListDICOMImportJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MedicalImaging) ListDICOMImportJobsPagesWithContext(ctx aws.Context, input *ListDICOMImportJobsInput, fn func(*ListDICOMImportJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDICOMImportJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDICOMImportJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDICOMImportJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDatastores = "ListDatastores" - -// ListDatastoresRequest generates a "aws/request.Request" representing the -// client's request for the ListDatastores 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 ListDatastores for more information on using the ListDatastores -// 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 ListDatastoresRequest method. -// req, resp := client.ListDatastoresRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/ListDatastores -func (c *MedicalImaging) ListDatastoresRequest(input *ListDatastoresInput) (req *request.Request, output *ListDatastoresOutput) { - op := &request.Operation{ - Name: opListDatastores, - HTTPMethod: "GET", - HTTPPath: "/datastore", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDatastoresInput{} - } - - output = &ListDatastoresOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDatastores API operation for AWS Health Imaging. -// -// List data stores. -// -// 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 AWS Health Imaging's -// API operation ListDatastores for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/ListDatastores -func (c *MedicalImaging) ListDatastores(input *ListDatastoresInput) (*ListDatastoresOutput, error) { - req, out := c.ListDatastoresRequest(input) - return out, req.Send() -} - -// ListDatastoresWithContext is the same as ListDatastores with the addition of -// the ability to pass a context and additional request options. -// -// See ListDatastores 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 *MedicalImaging) ListDatastoresWithContext(ctx aws.Context, input *ListDatastoresInput, opts ...request.Option) (*ListDatastoresOutput, error) { - req, out := c.ListDatastoresRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDatastoresPages iterates over the pages of a ListDatastores operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDatastores method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDatastores operation. -// pageNum := 0 -// err := client.ListDatastoresPages(params, -// func(page *medicalimaging.ListDatastoresOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MedicalImaging) ListDatastoresPages(input *ListDatastoresInput, fn func(*ListDatastoresOutput, bool) bool) error { - return c.ListDatastoresPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDatastoresPagesWithContext same as ListDatastoresPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MedicalImaging) ListDatastoresPagesWithContext(ctx aws.Context, input *ListDatastoresInput, fn func(*ListDatastoresOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDatastoresInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDatastoresRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDatastoresOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListImageSetVersions = "ListImageSetVersions" - -// ListImageSetVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListImageSetVersions 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 ListImageSetVersions for more information on using the ListImageSetVersions -// 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 ListImageSetVersionsRequest method. -// req, resp := client.ListImageSetVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/ListImageSetVersions -func (c *MedicalImaging) ListImageSetVersionsRequest(input *ListImageSetVersionsInput) (req *request.Request, output *ListImageSetVersionsOutput) { - op := &request.Operation{ - Name: opListImageSetVersions, - HTTPMethod: "POST", - HTTPPath: "/datastore/{datastoreId}/imageSet/{imageSetId}/listImageSetVersions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListImageSetVersionsInput{} - } - - output = &ListImageSetVersionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("runtime-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListImageSetVersions API operation for AWS Health Imaging. -// -// List image set versions. -// -// 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 AWS Health Imaging's -// API operation ListImageSetVersions for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/ListImageSetVersions -func (c *MedicalImaging) ListImageSetVersions(input *ListImageSetVersionsInput) (*ListImageSetVersionsOutput, error) { - req, out := c.ListImageSetVersionsRequest(input) - return out, req.Send() -} - -// ListImageSetVersionsWithContext is the same as ListImageSetVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListImageSetVersions 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 *MedicalImaging) ListImageSetVersionsWithContext(ctx aws.Context, input *ListImageSetVersionsInput, opts ...request.Option) (*ListImageSetVersionsOutput, error) { - req, out := c.ListImageSetVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListImageSetVersionsPages iterates over the pages of a ListImageSetVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListImageSetVersions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListImageSetVersions operation. -// pageNum := 0 -// err := client.ListImageSetVersionsPages(params, -// func(page *medicalimaging.ListImageSetVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MedicalImaging) ListImageSetVersionsPages(input *ListImageSetVersionsInput, fn func(*ListImageSetVersionsOutput, bool) bool) error { - return c.ListImageSetVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListImageSetVersionsPagesWithContext same as ListImageSetVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MedicalImaging) ListImageSetVersionsPagesWithContext(ctx aws.Context, input *ListImageSetVersionsInput, fn func(*ListImageSetVersionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListImageSetVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListImageSetVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListImageSetVersionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/ListTagsForResource -func (c *MedicalImaging) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Health Imaging. -// -// Lists all tags associated with a medical imaging resource. -// -// 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 AWS Health Imaging's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/ListTagsForResource -func (c *MedicalImaging) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *MedicalImaging) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSearchImageSets = "SearchImageSets" - -// SearchImageSetsRequest generates a "aws/request.Request" representing the -// client's request for the SearchImageSets 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 SearchImageSets for more information on using the SearchImageSets -// 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 SearchImageSetsRequest method. -// req, resp := client.SearchImageSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/SearchImageSets -func (c *MedicalImaging) SearchImageSetsRequest(input *SearchImageSetsInput) (req *request.Request, output *SearchImageSetsOutput) { - op := &request.Operation{ - Name: opSearchImageSets, - HTTPMethod: "POST", - HTTPPath: "/datastore/{datastoreId}/searchImageSets", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchImageSetsInput{} - } - - output = &SearchImageSetsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("runtime-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// SearchImageSets API operation for AWS Health Imaging. -// -// Search image sets based on defined input attributes. -// -// SearchImageSets accepts a single search query parameter and returns a paginated -// response of all image sets that have the matching criteria. All range queries -// must be input as (lowerBound, upperBound). -// -// SearchImageSets uses the updatedAt field for sorting in decreasing order -// from latest to oldest. -// -// 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 AWS Health Imaging's -// API operation SearchImageSets for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/SearchImageSets -func (c *MedicalImaging) SearchImageSets(input *SearchImageSetsInput) (*SearchImageSetsOutput, error) { - req, out := c.SearchImageSetsRequest(input) - return out, req.Send() -} - -// SearchImageSetsWithContext is the same as SearchImageSets with the addition of -// the ability to pass a context and additional request options. -// -// See SearchImageSets 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 *MedicalImaging) SearchImageSetsWithContext(ctx aws.Context, input *SearchImageSetsInput, opts ...request.Option) (*SearchImageSetsOutput, error) { - req, out := c.SearchImageSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchImageSetsPages iterates over the pages of a SearchImageSets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchImageSets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchImageSets operation. -// pageNum := 0 -// err := client.SearchImageSetsPages(params, -// func(page *medicalimaging.SearchImageSetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MedicalImaging) SearchImageSetsPages(input *SearchImageSetsInput, fn func(*SearchImageSetsOutput, bool) bool) error { - return c.SearchImageSetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchImageSetsPagesWithContext same as SearchImageSetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MedicalImaging) SearchImageSetsPagesWithContext(ctx aws.Context, input *SearchImageSetsInput, fn func(*SearchImageSetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchImageSetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchImageSetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchImageSetsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartDICOMImportJob = "StartDICOMImportJob" - -// StartDICOMImportJobRequest generates a "aws/request.Request" representing the -// client's request for the StartDICOMImportJob 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 StartDICOMImportJob for more information on using the StartDICOMImportJob -// 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 StartDICOMImportJobRequest method. -// req, resp := client.StartDICOMImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/StartDICOMImportJob -func (c *MedicalImaging) StartDICOMImportJobRequest(input *StartDICOMImportJobInput) (req *request.Request, output *StartDICOMImportJobOutput) { - op := &request.Operation{ - Name: opStartDICOMImportJob, - HTTPMethod: "POST", - HTTPPath: "/startDICOMImportJob/datastore/{datastoreId}", - } - - if input == nil { - input = &StartDICOMImportJobInput{} - } - - output = &StartDICOMImportJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartDICOMImportJob API operation for AWS Health Imaging. -// -// Start importing bulk data into an ACTIVE data store. The import job imports -// DICOM P10 files found in the S3 prefix specified by the inputS3Uri parameter. -// The import job stores processing results in the file specified by the outputS3Uri -// parameter. -// -// 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 AWS Health Imaging's -// API operation StartDICOMImportJob for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ServiceQuotaExceededException -// The request caused a service quota to be exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/StartDICOMImportJob -func (c *MedicalImaging) StartDICOMImportJob(input *StartDICOMImportJobInput) (*StartDICOMImportJobOutput, error) { - req, out := c.StartDICOMImportJobRequest(input) - return out, req.Send() -} - -// StartDICOMImportJobWithContext is the same as StartDICOMImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartDICOMImportJob 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 *MedicalImaging) StartDICOMImportJobWithContext(ctx aws.Context, input *StartDICOMImportJobInput, opts ...request.Option) (*StartDICOMImportJobOutput, error) { - req, out := c.StartDICOMImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/TagResource -func (c *MedicalImaging) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Health Imaging. -// -// Adds a user-specifed key and value tag to a medical imaging resource. -// -// 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 AWS Health Imaging's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/TagResource -func (c *MedicalImaging) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *MedicalImaging) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/UntagResource -func (c *MedicalImaging) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Health Imaging. -// -// Removes tags from a medical imaging resource. -// -// 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 AWS Health Imaging's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/UntagResource -func (c *MedicalImaging) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *MedicalImaging) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateImageSetMetadata = "UpdateImageSetMetadata" - -// UpdateImageSetMetadataRequest generates a "aws/request.Request" representing the -// client's request for the UpdateImageSetMetadata 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 UpdateImageSetMetadata for more information on using the UpdateImageSetMetadata -// 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 UpdateImageSetMetadataRequest method. -// req, resp := client.UpdateImageSetMetadataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/UpdateImageSetMetadata -func (c *MedicalImaging) UpdateImageSetMetadataRequest(input *UpdateImageSetMetadataInput) (req *request.Request, output *UpdateImageSetMetadataOutput) { - op := &request.Operation{ - Name: opUpdateImageSetMetadata, - HTTPMethod: "POST", - HTTPPath: "/datastore/{datastoreId}/imageSet/{imageSetId}/updateImageSetMetadata", - } - - if input == nil { - input = &UpdateImageSetMetadataInput{} - } - - output = &UpdateImageSetMetadataOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("runtime-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateImageSetMetadata API operation for AWS Health Imaging. -// -// Update image set metadata attributes. -// -// 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 AWS Health Imaging's -// API operation UpdateImageSetMetadata for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to throttling. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints set by the service. -// -// - InternalServerException -// An unexpected error occurred during processing of the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ServiceQuotaExceededException -// The request caused a service quota to be exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19/UpdateImageSetMetadata -func (c *MedicalImaging) UpdateImageSetMetadata(input *UpdateImageSetMetadataInput) (*UpdateImageSetMetadataOutput, error) { - req, out := c.UpdateImageSetMetadataRequest(input) - return out, req.Send() -} - -// UpdateImageSetMetadataWithContext is the same as UpdateImageSetMetadata with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateImageSetMetadata 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 *MedicalImaging) UpdateImageSetMetadataWithContext(ctx aws.Context, input *UpdateImageSetMetadataInput, opts ...request.Option) (*UpdateImageSetMetadataOutput, error) { - req, out := c.UpdateImageSetMetadataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// The user does not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Updating or deleting a resource can cause an inconsistent state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Copy the destination image set. -type CopyDestinationImageSet struct { - _ struct{} `type:"structure"` - - // The image set identifier for the destination image set. - // - // ImageSetId is a required field - ImageSetId *string `locationName:"imageSetId" type:"string" required:"true"` - - // The latest version identifier for the destination image set. - // - // LatestVersionId is a required field - LatestVersionId *string `locationName:"latestVersionId" 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 CopyDestinationImageSet) 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 CopyDestinationImageSet) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyDestinationImageSet) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyDestinationImageSet"} - if s.ImageSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageSetId")) - } - if s.LatestVersionId == nil { - invalidParams.Add(request.NewErrParamRequired("LatestVersionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *CopyDestinationImageSet) SetImageSetId(v string) *CopyDestinationImageSet { - s.ImageSetId = &v - return s -} - -// SetLatestVersionId sets the LatestVersionId field's value. -func (s *CopyDestinationImageSet) SetLatestVersionId(v string) *CopyDestinationImageSet { - s.LatestVersionId = &v - return s -} - -// Copy the image set properties of the destination image set. -type CopyDestinationImageSetProperties struct { - _ struct{} `type:"structure"` - - // The timestamp when the destination image set properties were created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon Resource Name (ARN) assigned to the destination image set. - ImageSetArn *string `locationName:"imageSetArn" type:"string"` - - // The image set identifier of the copied image set properties. - // - // ImageSetId is a required field - ImageSetId *string `locationName:"imageSetId" type:"string" required:"true"` - - // The image set state of the destination image set properties. - ImageSetState *string `locationName:"imageSetState" type:"string" enum:"ImageSetState"` - - // The image set workflow status of the destination image set properties. - ImageSetWorkflowStatus *string `locationName:"imageSetWorkflowStatus" type:"string" enum:"ImageSetWorkflowStatus"` - - // The latest version identifier for the destination image set properties. - // - // LatestVersionId is a required field - LatestVersionId *string `locationName:"latestVersionId" type:"string" required:"true"` - - // The timestamp when the destination image set properties were last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 CopyDestinationImageSetProperties) 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 CopyDestinationImageSetProperties) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CopyDestinationImageSetProperties) SetCreatedAt(v time.Time) *CopyDestinationImageSetProperties { - s.CreatedAt = &v - return s -} - -// SetImageSetArn sets the ImageSetArn field's value. -func (s *CopyDestinationImageSetProperties) SetImageSetArn(v string) *CopyDestinationImageSetProperties { - s.ImageSetArn = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *CopyDestinationImageSetProperties) SetImageSetId(v string) *CopyDestinationImageSetProperties { - s.ImageSetId = &v - return s -} - -// SetImageSetState sets the ImageSetState field's value. -func (s *CopyDestinationImageSetProperties) SetImageSetState(v string) *CopyDestinationImageSetProperties { - s.ImageSetState = &v - return s -} - -// SetImageSetWorkflowStatus sets the ImageSetWorkflowStatus field's value. -func (s *CopyDestinationImageSetProperties) SetImageSetWorkflowStatus(v string) *CopyDestinationImageSetProperties { - s.ImageSetWorkflowStatus = &v - return s -} - -// SetLatestVersionId sets the LatestVersionId field's value. -func (s *CopyDestinationImageSetProperties) SetLatestVersionId(v string) *CopyDestinationImageSetProperties { - s.LatestVersionId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CopyDestinationImageSetProperties) SetUpdatedAt(v time.Time) *CopyDestinationImageSetProperties { - s.UpdatedAt = &v - return s -} - -// Copy image set information. -type CopyImageSetInformation struct { - _ struct{} `type:"structure"` - - // The destination image set. - DestinationImageSet *CopyDestinationImageSet `locationName:"destinationImageSet" type:"structure"` - - // The source image set. - // - // SourceImageSet is a required field - SourceImageSet *CopySourceImageSetInformation `locationName:"sourceImageSet" type:"structure" 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 CopyImageSetInformation) 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 CopyImageSetInformation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyImageSetInformation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyImageSetInformation"} - if s.SourceImageSet == nil { - invalidParams.Add(request.NewErrParamRequired("SourceImageSet")) - } - if s.DestinationImageSet != nil { - if err := s.DestinationImageSet.Validate(); err != nil { - invalidParams.AddNested("DestinationImageSet", err.(request.ErrInvalidParams)) - } - } - if s.SourceImageSet != nil { - if err := s.SourceImageSet.Validate(); err != nil { - invalidParams.AddNested("SourceImageSet", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinationImageSet sets the DestinationImageSet field's value. -func (s *CopyImageSetInformation) SetDestinationImageSet(v *CopyDestinationImageSet) *CopyImageSetInformation { - s.DestinationImageSet = v - return s -} - -// SetSourceImageSet sets the SourceImageSet field's value. -func (s *CopyImageSetInformation) SetSourceImageSet(v *CopySourceImageSetInformation) *CopyImageSetInformation { - s.SourceImageSet = v - return s -} - -type CopyImageSetInput struct { - _ struct{} `type:"structure" payload:"CopyImageSetInformation"` - - // Copy image set information. - // - // CopyImageSetInformation is a required field - CopyImageSetInformation *CopyImageSetInformation `locationName:"copyImageSetInformation" type:"structure" required:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The source image set identifier. - // - // SourceImageSetId is a required field - SourceImageSetId *string `location:"uri" locationName:"sourceImageSetId" 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 CopyImageSetInput) 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 CopyImageSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyImageSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyImageSetInput"} - if s.CopyImageSetInformation == nil { - invalidParams.Add(request.NewErrParamRequired("CopyImageSetInformation")) - } - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.SourceImageSetId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceImageSetId")) - } - if s.SourceImageSetId != nil && len(*s.SourceImageSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceImageSetId", 1)) - } - if s.CopyImageSetInformation != nil { - if err := s.CopyImageSetInformation.Validate(); err != nil { - invalidParams.AddNested("CopyImageSetInformation", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCopyImageSetInformation sets the CopyImageSetInformation field's value. -func (s *CopyImageSetInput) SetCopyImageSetInformation(v *CopyImageSetInformation) *CopyImageSetInput { - s.CopyImageSetInformation = v - return s -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *CopyImageSetInput) SetDatastoreId(v string) *CopyImageSetInput { - s.DatastoreId = &v - return s -} - -// SetSourceImageSetId sets the SourceImageSetId field's value. -func (s *CopyImageSetInput) SetSourceImageSetId(v string) *CopyImageSetInput { - s.SourceImageSetId = &v - return s -} - -type CopyImageSetOutput struct { - _ struct{} `type:"structure"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The properties of the destination image set. - // - // DestinationImageSetProperties is a required field - DestinationImageSetProperties *CopyDestinationImageSetProperties `locationName:"destinationImageSetProperties" type:"structure" required:"true"` - - // The properties of the source image set. - // - // SourceImageSetProperties is a required field - SourceImageSetProperties *CopySourceImageSetProperties `locationName:"sourceImageSetProperties" type:"structure" 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 CopyImageSetOutput) 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 CopyImageSetOutput) GoString() string { - return s.String() -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *CopyImageSetOutput) SetDatastoreId(v string) *CopyImageSetOutput { - s.DatastoreId = &v - return s -} - -// SetDestinationImageSetProperties sets the DestinationImageSetProperties field's value. -func (s *CopyImageSetOutput) SetDestinationImageSetProperties(v *CopyDestinationImageSetProperties) *CopyImageSetOutput { - s.DestinationImageSetProperties = v - return s -} - -// SetSourceImageSetProperties sets the SourceImageSetProperties field's value. -func (s *CopyImageSetOutput) SetSourceImageSetProperties(v *CopySourceImageSetProperties) *CopyImageSetOutput { - s.SourceImageSetProperties = v - return s -} - -// Copy source image set information. -type CopySourceImageSetInformation struct { - _ struct{} `type:"structure"` - - // The latest version identifier for the source image set. - // - // LatestVersionId is a required field - LatestVersionId *string `locationName:"latestVersionId" 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 CopySourceImageSetInformation) 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 CopySourceImageSetInformation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopySourceImageSetInformation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopySourceImageSetInformation"} - if s.LatestVersionId == nil { - invalidParams.Add(request.NewErrParamRequired("LatestVersionId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLatestVersionId sets the LatestVersionId field's value. -func (s *CopySourceImageSetInformation) SetLatestVersionId(v string) *CopySourceImageSetInformation { - s.LatestVersionId = &v - return s -} - -// Copy source image set properties. -type CopySourceImageSetProperties struct { - _ struct{} `type:"structure"` - - // The timestamp when the source image set properties were created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon Resource Name (ARN) assigned to the source image set. - ImageSetArn *string `locationName:"imageSetArn" type:"string"` - - // The image set identifier for the copied source image set. - // - // ImageSetId is a required field - ImageSetId *string `locationName:"imageSetId" type:"string" required:"true"` - - // The image set state of the copied source image set. - ImageSetState *string `locationName:"imageSetState" type:"string" enum:"ImageSetState"` - - // The workflow status of the copied source image set. - ImageSetWorkflowStatus *string `locationName:"imageSetWorkflowStatus" type:"string" enum:"ImageSetWorkflowStatus"` - - // The latest version identifier for the copied source image set. - // - // LatestVersionId is a required field - LatestVersionId *string `locationName:"latestVersionId" type:"string" required:"true"` - - // The timestamp when the source image set properties were updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 CopySourceImageSetProperties) 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 CopySourceImageSetProperties) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CopySourceImageSetProperties) SetCreatedAt(v time.Time) *CopySourceImageSetProperties { - s.CreatedAt = &v - return s -} - -// SetImageSetArn sets the ImageSetArn field's value. -func (s *CopySourceImageSetProperties) SetImageSetArn(v string) *CopySourceImageSetProperties { - s.ImageSetArn = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *CopySourceImageSetProperties) SetImageSetId(v string) *CopySourceImageSetProperties { - s.ImageSetId = &v - return s -} - -// SetImageSetState sets the ImageSetState field's value. -func (s *CopySourceImageSetProperties) SetImageSetState(v string) *CopySourceImageSetProperties { - s.ImageSetState = &v - return s -} - -// SetImageSetWorkflowStatus sets the ImageSetWorkflowStatus field's value. -func (s *CopySourceImageSetProperties) SetImageSetWorkflowStatus(v string) *CopySourceImageSetProperties { - s.ImageSetWorkflowStatus = &v - return s -} - -// SetLatestVersionId sets the LatestVersionId field's value. -func (s *CopySourceImageSetProperties) SetLatestVersionId(v string) *CopySourceImageSetProperties { - s.LatestVersionId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CopySourceImageSetProperties) SetUpdatedAt(v time.Time) *CopySourceImageSetProperties { - s.UpdatedAt = &v - return s -} - -type CreateDatastoreInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for API idempotency. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The data store name. - DatastoreName *string `locationName:"datastoreName" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) assigned to the Key Management Service (KMS) - // key for accessing encrypted data. - KmsKeyArn *string `locationName:"kmsKeyArn" min:"1" type:"string"` - - // The tags provided when creating a data store. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateDatastoreInput) 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 CreateDatastoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDatastoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDatastoreInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DatastoreName != nil && len(*s.DatastoreName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreName", 1)) - } - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDatastoreInput) SetClientToken(v string) *CreateDatastoreInput { - s.ClientToken = &v - return s -} - -// SetDatastoreName sets the DatastoreName field's value. -func (s *CreateDatastoreInput) SetDatastoreName(v string) *CreateDatastoreInput { - s.DatastoreName = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *CreateDatastoreInput) SetKmsKeyArn(v string) *CreateDatastoreInput { - s.KmsKeyArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDatastoreInput) SetTags(v map[string]*string) *CreateDatastoreInput { - s.Tags = v - return s -} - -type CreateDatastoreOutput struct { - _ struct{} `type:"structure"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The data store status. - // - // DatastoreStatus is a required field - DatastoreStatus *string `locationName:"datastoreStatus" type:"string" required:"true" enum:"DatastoreStatus"` -} - -// 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 CreateDatastoreOutput) 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 CreateDatastoreOutput) GoString() string { - return s.String() -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *CreateDatastoreOutput) SetDatastoreId(v string) *CreateDatastoreOutput { - s.DatastoreId = &v - return s -} - -// SetDatastoreStatus sets the DatastoreStatus field's value. -func (s *CreateDatastoreOutput) SetDatastoreStatus(v string) *CreateDatastoreOutput { - s.DatastoreStatus = &v - return s -} - -// Properties of the import job. -type DICOMImportJobProperties struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that grants permissions to access medical - // imaging resources. - // - // DataAccessRoleArn is a required field - DataAccessRoleArn *string `locationName:"dataAccessRoleArn" min:"20" type:"string" required:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The timestamp for when the import job was ended. - EndedAt *time.Time `locationName:"endedAt" type:"timestamp"` - - // The input prefix path for the S3 bucket that contains the DICOM P10 files - // to be imported. - // - // InputS3Uri is a required field - InputS3Uri *string `locationName:"inputS3Uri" min:"1" type:"string" required:"true"` - - // The import job identifier. - // - // JobId is a required field - JobId *string `locationName:"jobId" min:"1" type:"string" required:"true"` - - // The import job name. - // - // JobName is a required field - JobName *string `locationName:"jobName" min:"1" type:"string" required:"true"` - - // The filters for listing import jobs based on status. - // - // JobStatus is a required field - JobStatus *string `locationName:"jobStatus" type:"string" required:"true" enum:"JobStatus"` - - // The error message thrown if an import job fails. - Message *string `locationName:"message" min:"1" type:"string"` - - // The output prefix of the S3 bucket to upload the results of the DICOM import - // job. - // - // OutputS3Uri is a required field - OutputS3Uri *string `locationName:"outputS3Uri" min:"1" type:"string" required:"true"` - - // The timestamp for when the import job was submitted. - SubmittedAt *time.Time `locationName:"submittedAt" type:"timestamp"` -} - -// 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 DICOMImportJobProperties) 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 DICOMImportJobProperties) GoString() string { - return s.String() -} - -// SetDataAccessRoleArn sets the DataAccessRoleArn field's value. -func (s *DICOMImportJobProperties) SetDataAccessRoleArn(v string) *DICOMImportJobProperties { - s.DataAccessRoleArn = &v - return s -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *DICOMImportJobProperties) SetDatastoreId(v string) *DICOMImportJobProperties { - s.DatastoreId = &v - return s -} - -// SetEndedAt sets the EndedAt field's value. -func (s *DICOMImportJobProperties) SetEndedAt(v time.Time) *DICOMImportJobProperties { - s.EndedAt = &v - return s -} - -// SetInputS3Uri sets the InputS3Uri field's value. -func (s *DICOMImportJobProperties) SetInputS3Uri(v string) *DICOMImportJobProperties { - s.InputS3Uri = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *DICOMImportJobProperties) SetJobId(v string) *DICOMImportJobProperties { - s.JobId = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *DICOMImportJobProperties) SetJobName(v string) *DICOMImportJobProperties { - s.JobName = &v - return s -} - -// SetJobStatus sets the JobStatus field's value. -func (s *DICOMImportJobProperties) SetJobStatus(v string) *DICOMImportJobProperties { - s.JobStatus = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *DICOMImportJobProperties) SetMessage(v string) *DICOMImportJobProperties { - s.Message = &v - return s -} - -// SetOutputS3Uri sets the OutputS3Uri field's value. -func (s *DICOMImportJobProperties) SetOutputS3Uri(v string) *DICOMImportJobProperties { - s.OutputS3Uri = &v - return s -} - -// SetSubmittedAt sets the SubmittedAt field's value. -func (s *DICOMImportJobProperties) SetSubmittedAt(v time.Time) *DICOMImportJobProperties { - s.SubmittedAt = &v - return s -} - -// Summary of import job. -type DICOMImportJobSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that grants permissions to access medical - // imaging resources. - DataAccessRoleArn *string `locationName:"dataAccessRoleArn" min:"20" type:"string"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The timestamp when an import job ended. - EndedAt *time.Time `locationName:"endedAt" type:"timestamp"` - - // The import job identifier. - // - // JobId is a required field - JobId *string `locationName:"jobId" min:"1" type:"string" required:"true"` - - // The import job name. - // - // JobName is a required field - JobName *string `locationName:"jobName" min:"1" type:"string" required:"true"` - - // The filters for listing import jobs based on status. - // - // JobStatus is a required field - JobStatus *string `locationName:"jobStatus" type:"string" required:"true" enum:"JobStatus"` - - // The error message thrown if an import job fails. - Message *string `locationName:"message" min:"1" type:"string"` - - // The timestamp when an import job was submitted. - SubmittedAt *time.Time `locationName:"submittedAt" type:"timestamp"` -} - -// 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 DICOMImportJobSummary) 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 DICOMImportJobSummary) GoString() string { - return s.String() -} - -// SetDataAccessRoleArn sets the DataAccessRoleArn field's value. -func (s *DICOMImportJobSummary) SetDataAccessRoleArn(v string) *DICOMImportJobSummary { - s.DataAccessRoleArn = &v - return s -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *DICOMImportJobSummary) SetDatastoreId(v string) *DICOMImportJobSummary { - s.DatastoreId = &v - return s -} - -// SetEndedAt sets the EndedAt field's value. -func (s *DICOMImportJobSummary) SetEndedAt(v time.Time) *DICOMImportJobSummary { - s.EndedAt = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *DICOMImportJobSummary) SetJobId(v string) *DICOMImportJobSummary { - s.JobId = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *DICOMImportJobSummary) SetJobName(v string) *DICOMImportJobSummary { - s.JobName = &v - return s -} - -// SetJobStatus sets the JobStatus field's value. -func (s *DICOMImportJobSummary) SetJobStatus(v string) *DICOMImportJobSummary { - s.JobStatus = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *DICOMImportJobSummary) SetMessage(v string) *DICOMImportJobSummary { - s.Message = &v - return s -} - -// SetSubmittedAt sets the SubmittedAt field's value. -func (s *DICOMImportJobSummary) SetSubmittedAt(v time.Time) *DICOMImportJobSummary { - s.SubmittedAt = &v - return s -} - -// The aggregated structure to store DICOM study date and study time for search -// capabilities. -type DICOMStudyDateAndTime struct { - _ struct{} `type:"structure"` - - // The DICOM study date provided in yyMMdd format. - // - // DICOMStudyDate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMStudyDateAndTime's - // String and GoString methods. - // - // DICOMStudyDate is a required field - DICOMStudyDate *string `type:"string" required:"true" sensitive:"true"` - - // The DICOM study time provided in HHmmss.FFFFFF format. - // - // DICOMStudyTime is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMStudyDateAndTime's - // String and GoString methods. - DICOMStudyTime *string `type:"string" sensitive:"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 DICOMStudyDateAndTime) 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 DICOMStudyDateAndTime) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DICOMStudyDateAndTime) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DICOMStudyDateAndTime"} - if s.DICOMStudyDate == nil { - invalidParams.Add(request.NewErrParamRequired("DICOMStudyDate")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDICOMStudyDate sets the DICOMStudyDate field's value. -func (s *DICOMStudyDateAndTime) SetDICOMStudyDate(v string) *DICOMStudyDateAndTime { - s.DICOMStudyDate = &v - return s -} - -// SetDICOMStudyTime sets the DICOMStudyTime field's value. -func (s *DICOMStudyDateAndTime) SetDICOMStudyTime(v string) *DICOMStudyDateAndTime { - s.DICOMStudyTime = &v - return s -} - -// The DICOM attributes returned as a part of a response. Each image set has -// these properties as part of a search result. -type DICOMTags struct { - _ struct{} `type:"structure"` - - // The accession number for the DICOM study. - // - // DICOMAccessionNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMAccessionNumber *string `type:"string" sensitive:"true"` - - // The total number of instances in the DICOM study. - DICOMNumberOfStudyRelatedInstances *int64 `type:"integer"` - - // The total number of series in the DICOM study. - DICOMNumberOfStudyRelatedSeries *int64 `type:"integer"` - - // The patient birth date. - // - // DICOMPatientBirthDate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMPatientBirthDate *string `type:"string" sensitive:"true"` - - // The unique identifier for a patient in a DICOM Study. - // - // DICOMPatientId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMPatientId *string `type:"string" sensitive:"true"` - - // The patient name. - // - // DICOMPatientName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMPatientName *string `type:"string" sensitive:"true"` - - // The patient sex. - // - // DICOMPatientSex is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMPatientSex *string `type:"string" sensitive:"true"` - - // The study date. - // - // DICOMStudyDate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMStudyDate *string `type:"string" sensitive:"true"` - - // The description of the study. - // - // DICOMStudyDescription is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMStudyDescription *string `type:"string" sensitive:"true"` - - // The DICOM provided studyId. - // - // DICOMStudyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMStudyId *string `type:"string" sensitive:"true"` - - // The DICOM provided identifier for studyInstanceUid.> - // - // DICOMStudyInstanceUID is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMStudyInstanceUID *string `type:"string" sensitive:"true"` - - // The study time. - // - // DICOMStudyTime is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMTags's - // String and GoString methods. - DICOMStudyTime *string `type:"string" sensitive:"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 DICOMTags) 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 DICOMTags) GoString() string { - return s.String() -} - -// SetDICOMAccessionNumber sets the DICOMAccessionNumber field's value. -func (s *DICOMTags) SetDICOMAccessionNumber(v string) *DICOMTags { - s.DICOMAccessionNumber = &v - return s -} - -// SetDICOMNumberOfStudyRelatedInstances sets the DICOMNumberOfStudyRelatedInstances field's value. -func (s *DICOMTags) SetDICOMNumberOfStudyRelatedInstances(v int64) *DICOMTags { - s.DICOMNumberOfStudyRelatedInstances = &v - return s -} - -// SetDICOMNumberOfStudyRelatedSeries sets the DICOMNumberOfStudyRelatedSeries field's value. -func (s *DICOMTags) SetDICOMNumberOfStudyRelatedSeries(v int64) *DICOMTags { - s.DICOMNumberOfStudyRelatedSeries = &v - return s -} - -// SetDICOMPatientBirthDate sets the DICOMPatientBirthDate field's value. -func (s *DICOMTags) SetDICOMPatientBirthDate(v string) *DICOMTags { - s.DICOMPatientBirthDate = &v - return s -} - -// SetDICOMPatientId sets the DICOMPatientId field's value. -func (s *DICOMTags) SetDICOMPatientId(v string) *DICOMTags { - s.DICOMPatientId = &v - return s -} - -// SetDICOMPatientName sets the DICOMPatientName field's value. -func (s *DICOMTags) SetDICOMPatientName(v string) *DICOMTags { - s.DICOMPatientName = &v - return s -} - -// SetDICOMPatientSex sets the DICOMPatientSex field's value. -func (s *DICOMTags) SetDICOMPatientSex(v string) *DICOMTags { - s.DICOMPatientSex = &v - return s -} - -// SetDICOMStudyDate sets the DICOMStudyDate field's value. -func (s *DICOMTags) SetDICOMStudyDate(v string) *DICOMTags { - s.DICOMStudyDate = &v - return s -} - -// SetDICOMStudyDescription sets the DICOMStudyDescription field's value. -func (s *DICOMTags) SetDICOMStudyDescription(v string) *DICOMTags { - s.DICOMStudyDescription = &v - return s -} - -// SetDICOMStudyId sets the DICOMStudyId field's value. -func (s *DICOMTags) SetDICOMStudyId(v string) *DICOMTags { - s.DICOMStudyId = &v - return s -} - -// SetDICOMStudyInstanceUID sets the DICOMStudyInstanceUID field's value. -func (s *DICOMTags) SetDICOMStudyInstanceUID(v string) *DICOMTags { - s.DICOMStudyInstanceUID = &v - return s -} - -// SetDICOMStudyTime sets the DICOMStudyTime field's value. -func (s *DICOMTags) SetDICOMStudyTime(v string) *DICOMTags { - s.DICOMStudyTime = &v - return s -} - -// The object containing removableAttributes and updatableAttributes. -type DICOMUpdates struct { - _ struct{} `type:"structure"` - - // The DICOM tags to be removed from ImageSetMetadata. - // - // RemovableAttributes is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMUpdates's - // String and GoString methods. - // - // RemovableAttributes is automatically base64 encoded/decoded by the SDK. - RemovableAttributes []byte `locationName:"removableAttributes" min:"1" type:"blob" sensitive:"true"` - - // The DICOM tags that need to be updated in ImageSetMetadata. - // - // UpdatableAttributes is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DICOMUpdates's - // String and GoString methods. - // - // UpdatableAttributes is automatically base64 encoded/decoded by the SDK. - UpdatableAttributes []byte `locationName:"updatableAttributes" min:"1" type:"blob" sensitive:"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 DICOMUpdates) 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 DICOMUpdates) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DICOMUpdates) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DICOMUpdates"} - if s.RemovableAttributes != nil && len(s.RemovableAttributes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RemovableAttributes", 1)) - } - if s.UpdatableAttributes != nil && len(s.UpdatableAttributes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UpdatableAttributes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRemovableAttributes sets the RemovableAttributes field's value. -func (s *DICOMUpdates) SetRemovableAttributes(v []byte) *DICOMUpdates { - s.RemovableAttributes = v - return s -} - -// SetUpdatableAttributes sets the UpdatableAttributes field's value. -func (s *DICOMUpdates) SetUpdatableAttributes(v []byte) *DICOMUpdates { - s.UpdatableAttributes = v - return s -} - -// The properties associated with the data store. -type DatastoreProperties struct { - _ struct{} `type:"structure"` - - // The timestamp when the data store was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon Resource Name (ARN) for the data store. - DatastoreArn *string `locationName:"datastoreArn" type:"string"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The data store name. - // - // DatastoreName is a required field - DatastoreName *string `locationName:"datastoreName" min:"1" type:"string" required:"true"` - - // The data store status. - // - // DatastoreStatus is a required field - DatastoreStatus *string `locationName:"datastoreStatus" type:"string" required:"true" enum:"DatastoreStatus"` - - // The Amazon Resource Name (ARN) assigned to the Key Management Service (KMS) - // key for accessing encrypted data. - KmsKeyArn *string `locationName:"kmsKeyArn" min:"1" type:"string"` - - // The timestamp when the data store was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 DatastoreProperties) 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 DatastoreProperties) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DatastoreProperties) SetCreatedAt(v time.Time) *DatastoreProperties { - s.CreatedAt = &v - return s -} - -// SetDatastoreArn sets the DatastoreArn field's value. -func (s *DatastoreProperties) SetDatastoreArn(v string) *DatastoreProperties { - s.DatastoreArn = &v - return s -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *DatastoreProperties) SetDatastoreId(v string) *DatastoreProperties { - s.DatastoreId = &v - return s -} - -// SetDatastoreName sets the DatastoreName field's value. -func (s *DatastoreProperties) SetDatastoreName(v string) *DatastoreProperties { - s.DatastoreName = &v - return s -} - -// SetDatastoreStatus sets the DatastoreStatus field's value. -func (s *DatastoreProperties) SetDatastoreStatus(v string) *DatastoreProperties { - s.DatastoreStatus = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *DatastoreProperties) SetKmsKeyArn(v string) *DatastoreProperties { - s.KmsKeyArn = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DatastoreProperties) SetUpdatedAt(v time.Time) *DatastoreProperties { - s.UpdatedAt = &v - return s -} - -// List of summaries of data stores. -type DatastoreSummary struct { - _ struct{} `type:"structure"` - - // The timestamp when the data store was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon Resource Name (ARN) for the data store. - DatastoreArn *string `locationName:"datastoreArn" type:"string"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The data store name. - // - // DatastoreName is a required field - DatastoreName *string `locationName:"datastoreName" min:"1" type:"string" required:"true"` - - // The data store status. - // - // DatastoreStatus is a required field - DatastoreStatus *string `locationName:"datastoreStatus" type:"string" required:"true" enum:"DatastoreStatus"` - - // The timestamp when the data store was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 DatastoreSummary) 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 DatastoreSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DatastoreSummary) SetCreatedAt(v time.Time) *DatastoreSummary { - s.CreatedAt = &v - return s -} - -// SetDatastoreArn sets the DatastoreArn field's value. -func (s *DatastoreSummary) SetDatastoreArn(v string) *DatastoreSummary { - s.DatastoreArn = &v - return s -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *DatastoreSummary) SetDatastoreId(v string) *DatastoreSummary { - s.DatastoreId = &v - return s -} - -// SetDatastoreName sets the DatastoreName field's value. -func (s *DatastoreSummary) SetDatastoreName(v string) *DatastoreSummary { - s.DatastoreName = &v - return s -} - -// SetDatastoreStatus sets the DatastoreStatus field's value. -func (s *DatastoreSummary) SetDatastoreStatus(v string) *DatastoreSummary { - s.DatastoreStatus = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DatastoreSummary) SetUpdatedAt(v time.Time) *DatastoreSummary { - s.UpdatedAt = &v - return s -} - -type DeleteDatastoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" 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 DeleteDatastoreInput) 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 DeleteDatastoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDatastoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDatastoreInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *DeleteDatastoreInput) SetDatastoreId(v string) *DeleteDatastoreInput { - s.DatastoreId = &v - return s -} - -type DeleteDatastoreOutput struct { - _ struct{} `type:"structure"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The data store status. - // - // DatastoreStatus is a required field - DatastoreStatus *string `locationName:"datastoreStatus" type:"string" required:"true" enum:"DatastoreStatus"` -} - -// 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 DeleteDatastoreOutput) 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 DeleteDatastoreOutput) GoString() string { - return s.String() -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *DeleteDatastoreOutput) SetDatastoreId(v string) *DeleteDatastoreOutput { - s.DatastoreId = &v - return s -} - -// SetDatastoreStatus sets the DatastoreStatus field's value. -func (s *DeleteDatastoreOutput) SetDatastoreStatus(v string) *DeleteDatastoreOutput { - s.DatastoreStatus = &v - return s -} - -type DeleteImageSetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `location:"uri" locationName:"imageSetId" 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 DeleteImageSetInput) 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 DeleteImageSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteImageSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteImageSetInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.ImageSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageSetId")) - } - if s.ImageSetId != nil && len(*s.ImageSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *DeleteImageSetInput) SetDatastoreId(v string) *DeleteImageSetInput { - s.DatastoreId = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *DeleteImageSetInput) SetImageSetId(v string) *DeleteImageSetInput { - s.ImageSetId = &v - return s -} - -type DeleteImageSetOutput struct { - _ struct{} `type:"structure"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `locationName:"imageSetId" type:"string" required:"true"` - - // The image set state. - // - // ImageSetState is a required field - ImageSetState *string `locationName:"imageSetState" type:"string" required:"true" enum:"ImageSetState"` - - // The image set workflow status. - // - // ImageSetWorkflowStatus is a required field - ImageSetWorkflowStatus *string `locationName:"imageSetWorkflowStatus" type:"string" required:"true" enum:"ImageSetWorkflowStatus"` -} - -// 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 DeleteImageSetOutput) 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 DeleteImageSetOutput) GoString() string { - return s.String() -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *DeleteImageSetOutput) SetDatastoreId(v string) *DeleteImageSetOutput { - s.DatastoreId = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *DeleteImageSetOutput) SetImageSetId(v string) *DeleteImageSetOutput { - s.ImageSetId = &v - return s -} - -// SetImageSetState sets the ImageSetState field's value. -func (s *DeleteImageSetOutput) SetImageSetState(v string) *DeleteImageSetOutput { - s.ImageSetState = &v - return s -} - -// SetImageSetWorkflowStatus sets the ImageSetWorkflowStatus field's value. -func (s *DeleteImageSetOutput) SetImageSetWorkflowStatus(v string) *DeleteImageSetOutput { - s.ImageSetWorkflowStatus = &v - return s -} - -type GetDICOMImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The import job identifier. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" min:"1" 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 GetDICOMImportJobInput) 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 GetDICOMImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDICOMImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDICOMImportJobInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *GetDICOMImportJobInput) SetDatastoreId(v string) *GetDICOMImportJobInput { - s.DatastoreId = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *GetDICOMImportJobInput) SetJobId(v string) *GetDICOMImportJobInput { - s.JobId = &v - return s -} - -type GetDICOMImportJobOutput struct { - _ struct{} `type:"structure"` - - // The properties of the import job. - // - // JobProperties is a required field - JobProperties *DICOMImportJobProperties `locationName:"jobProperties" type:"structure" 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 GetDICOMImportJobOutput) 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 GetDICOMImportJobOutput) GoString() string { - return s.String() -} - -// SetJobProperties sets the JobProperties field's value. -func (s *GetDICOMImportJobOutput) SetJobProperties(v *DICOMImportJobProperties) *GetDICOMImportJobOutput { - s.JobProperties = v - return s -} - -type GetDatastoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" 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 GetDatastoreInput) 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 GetDatastoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDatastoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDatastoreInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *GetDatastoreInput) SetDatastoreId(v string) *GetDatastoreInput { - s.DatastoreId = &v - return s -} - -type GetDatastoreOutput struct { - _ struct{} `type:"structure"` - - // The data store properties. - // - // DatastoreProperties is a required field - DatastoreProperties *DatastoreProperties `locationName:"datastoreProperties" type:"structure" 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 GetDatastoreOutput) 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 GetDatastoreOutput) GoString() string { - return s.String() -} - -// SetDatastoreProperties sets the DatastoreProperties field's value. -func (s *GetDatastoreOutput) SetDatastoreProperties(v *DatastoreProperties) *GetDatastoreOutput { - s.DatastoreProperties = v - return s -} - -type GetImageFrameInput struct { - _ struct{} `type:"structure" payload:"ImageFrameInformation"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // Information about the image frame (pixel data) identifier. - // - // ImageFrameInformation is a required field - ImageFrameInformation *ImageFrameInformation `locationName:"imageFrameInformation" type:"structure" required:"true"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `location:"uri" locationName:"imageSetId" 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 GetImageFrameInput) 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 GetImageFrameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetImageFrameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetImageFrameInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.ImageFrameInformation == nil { - invalidParams.Add(request.NewErrParamRequired("ImageFrameInformation")) - } - if s.ImageSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageSetId")) - } - if s.ImageSetId != nil && len(*s.ImageSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageSetId", 1)) - } - if s.ImageFrameInformation != nil { - if err := s.ImageFrameInformation.Validate(); err != nil { - invalidParams.AddNested("ImageFrameInformation", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *GetImageFrameInput) SetDatastoreId(v string) *GetImageFrameInput { - s.DatastoreId = &v - return s -} - -// SetImageFrameInformation sets the ImageFrameInformation field's value. -func (s *GetImageFrameInput) SetImageFrameInformation(v *ImageFrameInformation) *GetImageFrameInput { - s.ImageFrameInformation = v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *GetImageFrameInput) SetImageSetId(v string) *GetImageFrameInput { - s.ImageSetId = &v - return s -} - -type GetImageFrameOutput struct { - _ struct{} `type:"structure" payload:"ImageFrameBlob"` - - // The format in which the image frame information is returned to the customer. - // Default is application/octet-stream. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The blob containing the aggregated image frame information. - // - // ImageFrameBlob is a required field - ImageFrameBlob io.ReadCloser `locationName:"imageFrameBlob" type:"blob" 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 GetImageFrameOutput) 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 GetImageFrameOutput) GoString() string { - return s.String() -} - -// SetContentType sets the ContentType field's value. -func (s *GetImageFrameOutput) SetContentType(v string) *GetImageFrameOutput { - s.ContentType = &v - return s -} - -// SetImageFrameBlob sets the ImageFrameBlob field's value. -func (s *GetImageFrameOutput) SetImageFrameBlob(v io.ReadCloser) *GetImageFrameOutput { - s.ImageFrameBlob = v - return s -} - -type GetImageSetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `location:"uri" locationName:"imageSetId" type:"string" required:"true"` - - // The image set version identifier. - VersionId *string `location:"querystring" locationName:"version" 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 GetImageSetInput) 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 GetImageSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetImageSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetImageSetInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.ImageSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageSetId")) - } - if s.ImageSetId != nil && len(*s.ImageSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *GetImageSetInput) SetDatastoreId(v string) *GetImageSetInput { - s.DatastoreId = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *GetImageSetInput) SetImageSetId(v string) *GetImageSetInput { - s.ImageSetId = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetImageSetInput) SetVersionId(v string) *GetImageSetInput { - s.VersionId = &v - return s -} - -type GetImageSetMetadataInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `location:"uri" locationName:"imageSetId" type:"string" required:"true"` - - // The image set version identifier. - VersionId *string `location:"querystring" locationName:"version" 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 GetImageSetMetadataInput) 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 GetImageSetMetadataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetImageSetMetadataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetImageSetMetadataInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.ImageSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageSetId")) - } - if s.ImageSetId != nil && len(*s.ImageSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageSetId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *GetImageSetMetadataInput) SetDatastoreId(v string) *GetImageSetMetadataInput { - s.DatastoreId = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *GetImageSetMetadataInput) SetImageSetId(v string) *GetImageSetMetadataInput { - s.ImageSetId = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetImageSetMetadataInput) SetVersionId(v string) *GetImageSetMetadataInput { - s.VersionId = &v - return s -} - -type GetImageSetMetadataOutput struct { - _ struct{} `type:"structure" payload:"ImageSetMetadataBlob"` - - // The compression format in which image set metadata attributes are returned. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The format in which the study metadata is returned to the customer. Default - // is text/plain. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The blob containing the aggregated metadata information for the image set. - // - // ImageSetMetadataBlob is a required field - ImageSetMetadataBlob io.ReadCloser `locationName:"imageSetMetadataBlob" type:"blob" 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 GetImageSetMetadataOutput) 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 GetImageSetMetadataOutput) GoString() string { - return s.String() -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *GetImageSetMetadataOutput) SetContentEncoding(v string) *GetImageSetMetadataOutput { - s.ContentEncoding = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *GetImageSetMetadataOutput) SetContentType(v string) *GetImageSetMetadataOutput { - s.ContentType = &v - return s -} - -// SetImageSetMetadataBlob sets the ImageSetMetadataBlob field's value. -func (s *GetImageSetMetadataOutput) SetImageSetMetadataBlob(v io.ReadCloser) *GetImageSetMetadataOutput { - s.ImageSetMetadataBlob = v - return s -} - -type GetImageSetOutput struct { - _ struct{} `type:"structure"` - - // The timestamp when image set properties were created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The timestamp when the image set properties were deleted. - DeletedAt *time.Time `locationName:"deletedAt" type:"timestamp"` - - // The Amazon Resource Name (ARN) assigned to the image set. - ImageSetArn *string `locationName:"imageSetArn" type:"string"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `locationName:"imageSetId" type:"string" required:"true"` - - // The image set state. - // - // ImageSetState is a required field - ImageSetState *string `locationName:"imageSetState" type:"string" required:"true" enum:"ImageSetState"` - - // The image set workflow status. - ImageSetWorkflowStatus *string `locationName:"imageSetWorkflowStatus" type:"string" enum:"ImageSetWorkflowStatus"` - - // The error message thrown if an image set action fails. - Message *string `locationName:"message" min:"1" type:"string"` - - // The timestamp when image set properties were updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The image set version identifier. - // - // VersionId is a required field - VersionId *string `locationName:"versionId" 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 GetImageSetOutput) 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 GetImageSetOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetImageSetOutput) SetCreatedAt(v time.Time) *GetImageSetOutput { - s.CreatedAt = &v - return s -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *GetImageSetOutput) SetDatastoreId(v string) *GetImageSetOutput { - s.DatastoreId = &v - return s -} - -// SetDeletedAt sets the DeletedAt field's value. -func (s *GetImageSetOutput) SetDeletedAt(v time.Time) *GetImageSetOutput { - s.DeletedAt = &v - return s -} - -// SetImageSetArn sets the ImageSetArn field's value. -func (s *GetImageSetOutput) SetImageSetArn(v string) *GetImageSetOutput { - s.ImageSetArn = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *GetImageSetOutput) SetImageSetId(v string) *GetImageSetOutput { - s.ImageSetId = &v - return s -} - -// SetImageSetState sets the ImageSetState field's value. -func (s *GetImageSetOutput) SetImageSetState(v string) *GetImageSetOutput { - s.ImageSetState = &v - return s -} - -// SetImageSetWorkflowStatus sets the ImageSetWorkflowStatus field's value. -func (s *GetImageSetOutput) SetImageSetWorkflowStatus(v string) *GetImageSetOutput { - s.ImageSetWorkflowStatus = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *GetImageSetOutput) SetMessage(v string) *GetImageSetOutput { - s.Message = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetImageSetOutput) SetUpdatedAt(v time.Time) *GetImageSetOutput { - s.UpdatedAt = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetImageSetOutput) SetVersionId(v string) *GetImageSetOutput { - s.VersionId = &v - return s -} - -// Information about the image frame (pixel data) identifier. -type ImageFrameInformation struct { - _ struct{} `type:"structure"` - - // The image frame (pixel data) identifier. - // - // ImageFrameId is a required field - ImageFrameId *string `locationName:"imageFrameId" 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 ImageFrameInformation) 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 ImageFrameInformation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImageFrameInformation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImageFrameInformation"} - if s.ImageFrameId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageFrameId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImageFrameId sets the ImageFrameId field's value. -func (s *ImageFrameInformation) SetImageFrameId(v string) *ImageFrameInformation { - s.ImageFrameId = &v - return s -} - -// The image set properties. -type ImageSetProperties struct { - _ struct{} `type:"structure"` - - // The timestamp when the image set properties were created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The timestamp when the image set properties were deleted. - DeletedAt *time.Time `locationName:"deletedAt" type:"timestamp"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `locationName:"imageSetId" type:"string" required:"true"` - - // The image set state. - // - // ImageSetState is a required field - ImageSetState *string `locationName:"imageSetState" type:"string" required:"true" enum:"ImageSetState"` - - // The image set workflow status. - ImageSetWorkflowStatus *string `type:"string" enum:"ImageSetWorkflowStatus"` - - // The error message thrown if an image set action fails. - Message *string `locationName:"message" min:"1" type:"string"` - - // The timestamp when the image set properties were updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The image set version identifier. - // - // VersionId is a required field - VersionId *string `locationName:"versionId" 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 ImageSetProperties) 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 ImageSetProperties) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ImageSetProperties) SetCreatedAt(v time.Time) *ImageSetProperties { - s.CreatedAt = &v - return s -} - -// SetDeletedAt sets the DeletedAt field's value. -func (s *ImageSetProperties) SetDeletedAt(v time.Time) *ImageSetProperties { - s.DeletedAt = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *ImageSetProperties) SetImageSetId(v string) *ImageSetProperties { - s.ImageSetId = &v - return s -} - -// SetImageSetState sets the ImageSetState field's value. -func (s *ImageSetProperties) SetImageSetState(v string) *ImageSetProperties { - s.ImageSetState = &v - return s -} - -// SetImageSetWorkflowStatus sets the ImageSetWorkflowStatus field's value. -func (s *ImageSetProperties) SetImageSetWorkflowStatus(v string) *ImageSetProperties { - s.ImageSetWorkflowStatus = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ImageSetProperties) SetMessage(v string) *ImageSetProperties { - s.Message = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ImageSetProperties) SetUpdatedAt(v time.Time) *ImageSetProperties { - s.UpdatedAt = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *ImageSetProperties) SetVersionId(v string) *ImageSetProperties { - s.VersionId = &v - return s -} - -// Summary of the image set metadata. -type ImageSetsMetadataSummary struct { - _ struct{} `type:"structure"` - - // The time an image set is created. Sample creation date is provided in 1985-04-12T23:20:50.52Z - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The DICOM tags associated with the image set. - DICOMTags *DICOMTags `type:"structure"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `locationName:"imageSetId" type:"string" required:"true"` - - // The time an image set was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The image set version. - Version *int64 `locationName:"version" 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 ImageSetsMetadataSummary) 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 ImageSetsMetadataSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ImageSetsMetadataSummary) SetCreatedAt(v time.Time) *ImageSetsMetadataSummary { - s.CreatedAt = &v - return s -} - -// SetDICOMTags sets the DICOMTags field's value. -func (s *ImageSetsMetadataSummary) SetDICOMTags(v *DICOMTags) *ImageSetsMetadataSummary { - s.DICOMTags = v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *ImageSetsMetadataSummary) SetImageSetId(v string) *ImageSetsMetadataSummary { - s.ImageSetId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ImageSetsMetadataSummary) SetUpdatedAt(v time.Time) *ImageSetsMetadataSummary { - s.UpdatedAt = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *ImageSetsMetadataSummary) SetVersion(v int64) *ImageSetsMetadataSummary { - s.Version = &v - return s -} - -// An unexpected error occurred during processing of the request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListDICOMImportJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The filters for listing import jobs based on status. - JobStatus *string `location:"querystring" locationName:"jobStatus" type:"string" enum:"JobStatus"` - - // The max results count. The upper bound is determined by load testing. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token used to request the list of import jobs on the next - // page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListDICOMImportJobsInput) 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 ListDICOMImportJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDICOMImportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDICOMImportJobsInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *ListDICOMImportJobsInput) SetDatastoreId(v string) *ListDICOMImportJobsInput { - s.DatastoreId = &v - return s -} - -// SetJobStatus sets the JobStatus field's value. -func (s *ListDICOMImportJobsInput) SetJobStatus(v string) *ListDICOMImportJobsInput { - s.JobStatus = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDICOMImportJobsInput) SetMaxResults(v int64) *ListDICOMImportJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDICOMImportJobsInput) SetNextToken(v string) *ListDICOMImportJobsInput { - s.NextToken = &v - return s -} - -type ListDICOMImportJobsOutput struct { - _ struct{} `type:"structure"` - - // A list of job summaries. - // - // JobSummaries is a required field - JobSummaries []*DICOMImportJobSummary `locationName:"jobSummaries" type:"list" required:"true"` - - // The pagination token used to retrieve the list of import jobs on the next - // page. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDICOMImportJobsOutput) 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 ListDICOMImportJobsOutput) GoString() string { - return s.String() -} - -// SetJobSummaries sets the JobSummaries field's value. -func (s *ListDICOMImportJobsOutput) SetJobSummaries(v []*DICOMImportJobSummary) *ListDICOMImportJobsOutput { - s.JobSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDICOMImportJobsOutput) SetNextToken(v string) *ListDICOMImportJobsOutput { - s.NextToken = &v - return s -} - -type ListDatastoresInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store status. - DatastoreStatus *string `location:"querystring" locationName:"datastoreStatus" type:"string" enum:"DatastoreStatus"` - - // Valid Range: Minimum value of 1. Maximum value of 50. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token used to request the list of data stores on the next - // page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListDatastoresInput) 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 ListDatastoresInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDatastoresInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDatastoresInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreStatus sets the DatastoreStatus field's value. -func (s *ListDatastoresInput) SetDatastoreStatus(v string) *ListDatastoresInput { - s.DatastoreStatus = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDatastoresInput) SetMaxResults(v int64) *ListDatastoresInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDatastoresInput) SetNextToken(v string) *ListDatastoresInput { - s.NextToken = &v - return s -} - -type ListDatastoresOutput struct { - _ struct{} `type:"structure"` - - // The list of summaries of data stores. - DatastoreSummaries []*DatastoreSummary `locationName:"datastoreSummaries" type:"list"` - - // The pagination token used to retrieve the list of data stores on the next - // page. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDatastoresOutput) 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 ListDatastoresOutput) GoString() string { - return s.String() -} - -// SetDatastoreSummaries sets the DatastoreSummaries field's value. -func (s *ListDatastoresOutput) SetDatastoreSummaries(v []*DatastoreSummary) *ListDatastoresOutput { - s.DatastoreSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDatastoresOutput) SetNextToken(v string) *ListDatastoresOutput { - s.NextToken = &v - return s -} - -type ListImageSetVersionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `location:"uri" locationName:"imageSetId" type:"string" required:"true"` - - // The max results count. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The pagination token used to request the list of image set versions on the - // next page. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListImageSetVersionsInput) 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 ListImageSetVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListImageSetVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListImageSetVersionsInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.ImageSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageSetId")) - } - if s.ImageSetId != nil && len(*s.ImageSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageSetId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *ListImageSetVersionsInput) SetDatastoreId(v string) *ListImageSetVersionsInput { - s.DatastoreId = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *ListImageSetVersionsInput) SetImageSetId(v string) *ListImageSetVersionsInput { - s.ImageSetId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListImageSetVersionsInput) SetMaxResults(v int64) *ListImageSetVersionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImageSetVersionsInput) SetNextToken(v string) *ListImageSetVersionsInput { - s.NextToken = &v - return s -} - -type ListImageSetVersionsOutput struct { - _ struct{} `type:"structure"` - - // Lists all properties associated with an image set. - // - // ImageSetPropertiesList is a required field - ImageSetPropertiesList []*ImageSetProperties `locationName:"imageSetPropertiesList" type:"list" required:"true"` - - // The pagination token used to retrieve the list of image set versions on the - // next page. - NextToken *string `locationName:"nextToken" min:"1" 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 ListImageSetVersionsOutput) 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 ListImageSetVersionsOutput) GoString() string { - return s.String() -} - -// SetImageSetPropertiesList sets the ImageSetPropertiesList field's value. -func (s *ListImageSetVersionsOutput) SetImageSetPropertiesList(v []*ImageSetProperties) *ListImageSetVersionsOutput { - s.ImageSetPropertiesList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImageSetVersionsOutput) SetNextToken(v string) *ListImageSetVersionsOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the medical imaging resource to list tags - // for. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of all tags associated with a medical imaging resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Contains DICOMUpdates. -type MetadataUpdates struct { - _ struct{} `type:"structure"` - - // The object containing removableAttributes and updatableAttributes. - DICOMUpdates *DICOMUpdates `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 MetadataUpdates) 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 MetadataUpdates) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetadataUpdates) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetadataUpdates"} - if s.DICOMUpdates != nil { - if err := s.DICOMUpdates.Validate(); err != nil { - invalidParams.AddNested("DICOMUpdates", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDICOMUpdates sets the DICOMUpdates field's value. -func (s *MetadataUpdates) SetDICOMUpdates(v *DICOMUpdates) *MetadataUpdates { - s.DICOMUpdates = v - return s -} - -// The request references a resource which does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The search input attribute value. -type SearchByAttributeValue struct { - _ struct{} `type:"structure"` - - // The created at time of the image set provided for search. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The DICOM accession number for search. - // - // DICOMAccessionNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchByAttributeValue's - // String and GoString methods. - DICOMAccessionNumber *string `type:"string" sensitive:"true"` - - // The patient ID input for search. - // - // DICOMPatientId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchByAttributeValue's - // String and GoString methods. - DICOMPatientId *string `type:"string" sensitive:"true"` - - // The aggregated structure containing DICOM study date and study time for search. - DICOMStudyDateAndTime *DICOMStudyDateAndTime `type:"structure"` - - // The DICOM study ID for search. - // - // DICOMStudyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchByAttributeValue's - // String and GoString methods. - DICOMStudyId *string `type:"string" sensitive:"true"` - - // The DICOM study instance UID for search. - // - // DICOMStudyInstanceUID is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchByAttributeValue's - // String and GoString methods. - DICOMStudyInstanceUID *string `type:"string" sensitive:"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 SearchByAttributeValue) 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 SearchByAttributeValue) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchByAttributeValue) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchByAttributeValue"} - if s.DICOMStudyDateAndTime != nil { - if err := s.DICOMStudyDateAndTime.Validate(); err != nil { - invalidParams.AddNested("DICOMStudyDateAndTime", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SearchByAttributeValue) SetCreatedAt(v time.Time) *SearchByAttributeValue { - s.CreatedAt = &v - return s -} - -// SetDICOMAccessionNumber sets the DICOMAccessionNumber field's value. -func (s *SearchByAttributeValue) SetDICOMAccessionNumber(v string) *SearchByAttributeValue { - s.DICOMAccessionNumber = &v - return s -} - -// SetDICOMPatientId sets the DICOMPatientId field's value. -func (s *SearchByAttributeValue) SetDICOMPatientId(v string) *SearchByAttributeValue { - s.DICOMPatientId = &v - return s -} - -// SetDICOMStudyDateAndTime sets the DICOMStudyDateAndTime field's value. -func (s *SearchByAttributeValue) SetDICOMStudyDateAndTime(v *DICOMStudyDateAndTime) *SearchByAttributeValue { - s.DICOMStudyDateAndTime = v - return s -} - -// SetDICOMStudyId sets the DICOMStudyId field's value. -func (s *SearchByAttributeValue) SetDICOMStudyId(v string) *SearchByAttributeValue { - s.DICOMStudyId = &v - return s -} - -// SetDICOMStudyInstanceUID sets the DICOMStudyInstanceUID field's value. -func (s *SearchByAttributeValue) SetDICOMStudyInstanceUID(v string) *SearchByAttributeValue { - s.DICOMStudyInstanceUID = &v - return s -} - -// The search criteria. -type SearchCriteria struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The filters for the search criteria. - Filters []*SearchFilter `locationName:"filters" min:"1" type:"list"` -} - -// 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 SearchCriteria) 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 SearchCriteria) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchCriteria) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchCriteria"} - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *SearchCriteria) SetFilters(v []*SearchFilter) *SearchCriteria { - s.Filters = v - return s -} - -// The search filter. -type SearchFilter struct { - _ struct{} `type:"structure"` - - // The search filter operator for imageSetDateTime. - // - // Operator is a required field - Operator *string `locationName:"operator" type:"string" required:"true" enum:"Operator"` - - // The search filter values. - // - // Values is a required field - Values []*SearchByAttributeValue `locationName:"values" min:"1" type:"list" 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 SearchFilter) 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 SearchFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchFilter"} - if s.Operator == nil { - invalidParams.Add(request.NewErrParamRequired("Operator")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - if s.Values != nil { - for i, v := range s.Values { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Values", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOperator sets the Operator field's value. -func (s *SearchFilter) SetOperator(v string) *SearchFilter { - s.Operator = &v - return s -} - -// SetValues sets the Values field's value. -func (s *SearchFilter) SetValues(v []*SearchByAttributeValue) *SearchFilter { - s.Values = v - return s -} - -type SearchImageSetsInput struct { - _ struct{} `type:"structure" payload:"SearchCriteria"` - - // The identifier of the data store where the image sets reside. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The maximum number of results that can be returned in a search. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token used for pagination of results returned in the response. Use the - // token returned from the previous request to continue results where the previous - // request ended. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The search criteria that filters by applying a maximum of 1 item to SearchByAttribute. - // - // SearchCriteria is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchImageSetsInput's - // String and GoString methods. - SearchCriteria *SearchCriteria `locationName:"searchCriteria" type:"structure" sensitive:"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 SearchImageSetsInput) 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 SearchImageSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchImageSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchImageSetsInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SearchCriteria != nil { - if err := s.SearchCriteria.Validate(); err != nil { - invalidParams.AddNested("SearchCriteria", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *SearchImageSetsInput) SetDatastoreId(v string) *SearchImageSetsInput { - s.DatastoreId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchImageSetsInput) SetMaxResults(v int64) *SearchImageSetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchImageSetsInput) SetNextToken(v string) *SearchImageSetsInput { - s.NextToken = &v - return s -} - -// SetSearchCriteria sets the SearchCriteria field's value. -func (s *SearchImageSetsInput) SetSearchCriteria(v *SearchCriteria) *SearchImageSetsInput { - s.SearchCriteria = v - return s -} - -type SearchImageSetsOutput struct { - _ struct{} `type:"structure"` - - // The model containing the image set results. - // - // ImageSetsMetadataSummaries is a required field - ImageSetsMetadataSummaries []*ImageSetsMetadataSummary `locationName:"imageSetsMetadataSummaries" type:"list" required:"true"` - - // The token for pagination results. - NextToken *string `locationName:"nextToken" min:"1" 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 SearchImageSetsOutput) 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 SearchImageSetsOutput) GoString() string { - return s.String() -} - -// SetImageSetsMetadataSummaries sets the ImageSetsMetadataSummaries field's value. -func (s *SearchImageSetsOutput) SetImageSetsMetadataSummaries(v []*ImageSetsMetadataSummary) *SearchImageSetsOutput { - s.ImageSetsMetadataSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchImageSetsOutput) SetNextToken(v string) *SearchImageSetsOutput { - s.NextToken = &v - return s -} - -// The request caused a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartDICOMImportJobInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for API idempotency. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) of the IAM role that grants permission to - // access medical imaging resources. - // - // DataAccessRoleArn is a required field - DataAccessRoleArn *string `locationName:"dataAccessRoleArn" min:"20" type:"string" required:"true"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The input prefix path for the S3 bucket that contains the DICOM files to - // be imported. - // - // InputS3Uri is a required field - InputS3Uri *string `locationName:"inputS3Uri" min:"1" type:"string" required:"true"` - - // The import job name. - JobName *string `locationName:"jobName" min:"1" type:"string"` - - // The output prefix of the S3 bucket to upload the results of the DICOM import - // job. - // - // OutputS3Uri is a required field - OutputS3Uri *string `locationName:"outputS3Uri" min:"1" 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 StartDICOMImportJobInput) 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 StartDICOMImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartDICOMImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartDICOMImportJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DataAccessRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("DataAccessRoleArn")) - } - if s.DataAccessRoleArn != nil && len(*s.DataAccessRoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("DataAccessRoleArn", 20)) - } - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.InputS3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("InputS3Uri")) - } - if s.InputS3Uri != nil && len(*s.InputS3Uri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputS3Uri", 1)) - } - if s.JobName != nil && len(*s.JobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobName", 1)) - } - if s.OutputS3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("OutputS3Uri")) - } - if s.OutputS3Uri != nil && len(*s.OutputS3Uri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputS3Uri", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartDICOMImportJobInput) SetClientToken(v string) *StartDICOMImportJobInput { - s.ClientToken = &v - return s -} - -// SetDataAccessRoleArn sets the DataAccessRoleArn field's value. -func (s *StartDICOMImportJobInput) SetDataAccessRoleArn(v string) *StartDICOMImportJobInput { - s.DataAccessRoleArn = &v - return s -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *StartDICOMImportJobInput) SetDatastoreId(v string) *StartDICOMImportJobInput { - s.DatastoreId = &v - return s -} - -// SetInputS3Uri sets the InputS3Uri field's value. -func (s *StartDICOMImportJobInput) SetInputS3Uri(v string) *StartDICOMImportJobInput { - s.InputS3Uri = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *StartDICOMImportJobInput) SetJobName(v string) *StartDICOMImportJobInput { - s.JobName = &v - return s -} - -// SetOutputS3Uri sets the OutputS3Uri field's value. -func (s *StartDICOMImportJobInput) SetOutputS3Uri(v string) *StartDICOMImportJobInput { - s.OutputS3Uri = &v - return s -} - -type StartDICOMImportJobOutput struct { - _ struct{} `type:"structure"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The import job identifier. - // - // JobId is a required field - JobId *string `locationName:"jobId" min:"1" type:"string" required:"true"` - - // The import job status. - // - // JobStatus is a required field - JobStatus *string `locationName:"jobStatus" type:"string" required:"true" enum:"JobStatus"` - - // The timestamp when the import job was submitted. - // - // SubmittedAt is a required field - SubmittedAt *time.Time `locationName:"submittedAt" type:"timestamp" 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 StartDICOMImportJobOutput) 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 StartDICOMImportJobOutput) GoString() string { - return s.String() -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *StartDICOMImportJobOutput) SetDatastoreId(v string) *StartDICOMImportJobOutput { - s.DatastoreId = &v - return s -} - -// SetJobId sets the JobId field's value. -func (s *StartDICOMImportJobOutput) SetJobId(v string) *StartDICOMImportJobOutput { - s.JobId = &v - return s -} - -// SetJobStatus sets the JobStatus field's value. -func (s *StartDICOMImportJobOutput) SetJobStatus(v string) *StartDICOMImportJobOutput { - s.JobStatus = &v - return s -} - -// SetSubmittedAt sets the SubmittedAt field's value. -func (s *StartDICOMImportJobOutput) SetSubmittedAt(v time.Time) *StartDICOMImportJobOutput { - s.SubmittedAt = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the medical imaging resource that tags - // are being added to. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The user-specified key and value tag pairs added to a medical imaging resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the medical imaging resource that tags - // are being removed from. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The keys for the tags to be removed from the medical imaging resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateImageSetMetadataInput struct { - _ struct{} `type:"structure" payload:"UpdateImageSetMetadataUpdates"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `location:"uri" locationName:"datastoreId" type:"string" required:"true"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `location:"uri" locationName:"imageSetId" type:"string" required:"true"` - - // The latest image set version identifier. - // - // LatestVersionId is a required field - LatestVersionId *string `location:"querystring" locationName:"latestVersion" type:"string" required:"true"` - - // Update image set metadata updates. - // - // UpdateImageSetMetadataUpdates is a required field - UpdateImageSetMetadataUpdates *MetadataUpdates `locationName:"updateImageSetMetadataUpdates" type:"structure" 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 UpdateImageSetMetadataInput) 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 UpdateImageSetMetadataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateImageSetMetadataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateImageSetMetadataInput"} - if s.DatastoreId == nil { - invalidParams.Add(request.NewErrParamRequired("DatastoreId")) - } - if s.DatastoreId != nil && len(*s.DatastoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatastoreId", 1)) - } - if s.ImageSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageSetId")) - } - if s.ImageSetId != nil && len(*s.ImageSetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageSetId", 1)) - } - if s.LatestVersionId == nil { - invalidParams.Add(request.NewErrParamRequired("LatestVersionId")) - } - if s.UpdateImageSetMetadataUpdates == nil { - invalidParams.Add(request.NewErrParamRequired("UpdateImageSetMetadataUpdates")) - } - if s.UpdateImageSetMetadataUpdates != nil { - if err := s.UpdateImageSetMetadataUpdates.Validate(); err != nil { - invalidParams.AddNested("UpdateImageSetMetadataUpdates", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *UpdateImageSetMetadataInput) SetDatastoreId(v string) *UpdateImageSetMetadataInput { - s.DatastoreId = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *UpdateImageSetMetadataInput) SetImageSetId(v string) *UpdateImageSetMetadataInput { - s.ImageSetId = &v - return s -} - -// SetLatestVersionId sets the LatestVersionId field's value. -func (s *UpdateImageSetMetadataInput) SetLatestVersionId(v string) *UpdateImageSetMetadataInput { - s.LatestVersionId = &v - return s -} - -// SetUpdateImageSetMetadataUpdates sets the UpdateImageSetMetadataUpdates field's value. -func (s *UpdateImageSetMetadataInput) SetUpdateImageSetMetadataUpdates(v *MetadataUpdates) *UpdateImageSetMetadataInput { - s.UpdateImageSetMetadataUpdates = v - return s -} - -type UpdateImageSetMetadataOutput struct { - _ struct{} `type:"structure"` - - // The timestamp when image set metadata was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The data store identifier. - // - // DatastoreId is a required field - DatastoreId *string `locationName:"datastoreId" type:"string" required:"true"` - - // The image set identifier. - // - // ImageSetId is a required field - ImageSetId *string `locationName:"imageSetId" type:"string" required:"true"` - - // The image set state. - // - // ImageSetState is a required field - ImageSetState *string `locationName:"imageSetState" type:"string" required:"true" enum:"ImageSetState"` - - // The image set workflow status. - ImageSetWorkflowStatus *string `locationName:"imageSetWorkflowStatus" type:"string" enum:"ImageSetWorkflowStatus"` - - // The latest image set version identifier. - // - // LatestVersionId is a required field - LatestVersionId *string `locationName:"latestVersionId" type:"string" required:"true"` - - // The error message thrown if an update image set metadata action fails. - Message *string `locationName:"message" min:"1" type:"string"` - - // The timestamp when image set metadata was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 UpdateImageSetMetadataOutput) 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 UpdateImageSetMetadataOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *UpdateImageSetMetadataOutput) SetCreatedAt(v time.Time) *UpdateImageSetMetadataOutput { - s.CreatedAt = &v - return s -} - -// SetDatastoreId sets the DatastoreId field's value. -func (s *UpdateImageSetMetadataOutput) SetDatastoreId(v string) *UpdateImageSetMetadataOutput { - s.DatastoreId = &v - return s -} - -// SetImageSetId sets the ImageSetId field's value. -func (s *UpdateImageSetMetadataOutput) SetImageSetId(v string) *UpdateImageSetMetadataOutput { - s.ImageSetId = &v - return s -} - -// SetImageSetState sets the ImageSetState field's value. -func (s *UpdateImageSetMetadataOutput) SetImageSetState(v string) *UpdateImageSetMetadataOutput { - s.ImageSetState = &v - return s -} - -// SetImageSetWorkflowStatus sets the ImageSetWorkflowStatus field's value. -func (s *UpdateImageSetMetadataOutput) SetImageSetWorkflowStatus(v string) *UpdateImageSetMetadataOutput { - s.ImageSetWorkflowStatus = &v - return s -} - -// SetLatestVersionId sets the LatestVersionId field's value. -func (s *UpdateImageSetMetadataOutput) SetLatestVersionId(v string) *UpdateImageSetMetadataOutput { - s.LatestVersionId = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *UpdateImageSetMetadataOutput) SetMessage(v string) *UpdateImageSetMetadataOutput { - s.Message = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateImageSetMetadataOutput) SetUpdatedAt(v time.Time) *UpdateImageSetMetadataOutput { - s.UpdatedAt = &v - return s -} - -// The input fails to satisfy the constraints set by the service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // DatastoreStatusCreating is a DatastoreStatus enum value - DatastoreStatusCreating = "CREATING" - - // DatastoreStatusCreateFailed is a DatastoreStatus enum value - DatastoreStatusCreateFailed = "CREATE_FAILED" - - // DatastoreStatusActive is a DatastoreStatus enum value - DatastoreStatusActive = "ACTIVE" - - // DatastoreStatusDeleting is a DatastoreStatus enum value - DatastoreStatusDeleting = "DELETING" - - // DatastoreStatusDeleted is a DatastoreStatus enum value - DatastoreStatusDeleted = "DELETED" -) - -// DatastoreStatus_Values returns all elements of the DatastoreStatus enum -func DatastoreStatus_Values() []string { - return []string{ - DatastoreStatusCreating, - DatastoreStatusCreateFailed, - DatastoreStatusActive, - DatastoreStatusDeleting, - DatastoreStatusDeleted, - } -} - -const ( - // ImageSetStateActive is a ImageSetState enum value - ImageSetStateActive = "ACTIVE" - - // ImageSetStateLocked is a ImageSetState enum value - ImageSetStateLocked = "LOCKED" - - // ImageSetStateDeleted is a ImageSetState enum value - ImageSetStateDeleted = "DELETED" -) - -// ImageSetState_Values returns all elements of the ImageSetState enum -func ImageSetState_Values() []string { - return []string{ - ImageSetStateActive, - ImageSetStateLocked, - ImageSetStateDeleted, - } -} - -const ( - // ImageSetWorkflowStatusCreated is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusCreated = "CREATED" - - // ImageSetWorkflowStatusCopied is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusCopied = "COPIED" - - // ImageSetWorkflowStatusCopying is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusCopying = "COPYING" - - // ImageSetWorkflowStatusCopyingWithReadOnlyAccess is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusCopyingWithReadOnlyAccess = "COPYING_WITH_READ_ONLY_ACCESS" - - // ImageSetWorkflowStatusCopyFailed is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusCopyFailed = "COPY_FAILED" - - // ImageSetWorkflowStatusUpdating is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusUpdating = "UPDATING" - - // ImageSetWorkflowStatusUpdated is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusUpdated = "UPDATED" - - // ImageSetWorkflowStatusUpdateFailed is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusUpdateFailed = "UPDATE_FAILED" - - // ImageSetWorkflowStatusDeleting is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusDeleting = "DELETING" - - // ImageSetWorkflowStatusDeleted is a ImageSetWorkflowStatus enum value - ImageSetWorkflowStatusDeleted = "DELETED" -) - -// ImageSetWorkflowStatus_Values returns all elements of the ImageSetWorkflowStatus enum -func ImageSetWorkflowStatus_Values() []string { - return []string{ - ImageSetWorkflowStatusCreated, - ImageSetWorkflowStatusCopied, - ImageSetWorkflowStatusCopying, - ImageSetWorkflowStatusCopyingWithReadOnlyAccess, - ImageSetWorkflowStatusCopyFailed, - ImageSetWorkflowStatusUpdating, - ImageSetWorkflowStatusUpdated, - ImageSetWorkflowStatusUpdateFailed, - ImageSetWorkflowStatusDeleting, - ImageSetWorkflowStatusDeleted, - } -} - -const ( - // JobStatusSubmitted is a JobStatus enum value - JobStatusSubmitted = "SUBMITTED" - - // JobStatusInProgress is a JobStatus enum value - JobStatusInProgress = "IN_PROGRESS" - - // JobStatusCompleted is a JobStatus enum value - JobStatusCompleted = "COMPLETED" - - // JobStatusFailed is a JobStatus enum value - JobStatusFailed = "FAILED" -) - -// JobStatus_Values returns all elements of the JobStatus enum -func JobStatus_Values() []string { - return []string{ - JobStatusSubmitted, - JobStatusInProgress, - JobStatusCompleted, - JobStatusFailed, - } -} - -const ( - // OperatorEqual is a Operator enum value - OperatorEqual = "EQUAL" - - // OperatorBetween is a Operator enum value - OperatorBetween = "BETWEEN" -) - -// Operator_Values returns all elements of the Operator enum -func Operator_Values() []string { - return []string{ - OperatorEqual, - OperatorBetween, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/doc.go deleted file mode 100644 index e56bda9ae5e9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/doc.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package medicalimaging provides the client and types for making API -// requests to AWS Health Imaging. -// -// This is the AWS HealthImaging API Reference. AWS HealthImaging is a HIPAA-eligible -// service that helps health care providers and their medical imaging ISV partners -// store, transform, and apply machine learning to medical images. For an introduction -// to the service, see the AWS HealthImaging Developer Guide (https://docs.aws.amazon.com/healthimaging/latest/devguide/what-is.html). -// -// We recommend using one of the AWS Software Development Kits (SDKs) for your -// programming language, as they take care of request authentication, serialization, -// and connection management. For more information, see Tools to build on AWS -// (http://aws.amazon.com/developer/tools). -// -// For information about using HealthImaging API actions in one of the language-specific -// AWS SDKs, refer to the See Also link at the end of each section that describes -// an API action or data type. -// -// The following sections list AWS HealthImaging API actions categorized according -// to functionality. Links are provided to actions within this Reference, along -// with links back to corresponding sections in the AWS HealthImaging Developer -// Guide where you can view console procedures and CLI/SDK code examples. -// -// Data store actions -// -// - CreateDatastore (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_CreateDatastore.html) -// – See Creating a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/create-data-store.html). -// -// - GetDatastore (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetDatastore.html) -// – See Getting data store properties (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-data-store.html). -// -// - ListDatastores (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_ListDatastores.html) -// – See Listing data stores (https://docs.aws.amazon.com/healthimaging/latest/devguide/list-data-stores.html). -// -// - DeleteDatastore (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_DeleteDatastore.html) -// – See Deleting a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/delete-data-store.html). -// -// Import job actions -// -// - StartDICOMImportJob (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_StartDICOMImportJob.html) -// – See Starting an import job (https://docs.aws.amazon.com/healthimaging/latest/devguide/start-dicom-import-job.html). -// -// - GetDICOMImportJob (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetDICOMImportJob.html) -// – See Getting import job properties (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-dicom-import-job.html). -// -// - ListDICOMImportJobs (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_ListDICOMImportJobs.html) -// – See Listing import jobs (https://docs.aws.amazon.com/healthimaging/latest/devguide/list-dicom-import-jobs.html). -// -// Image set access actions -// -// - SearchImageSets (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_SearchImageSets.html) -// – See Searching image sets (https://docs.aws.amazon.com/healthimaging/latest/devguide/search-image-sets.html). -// -// - GetImageSet (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetImageSet.html) -// – See Getting image set properties (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-image-set-properties.html). -// -// - GetImageSetMetadata (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetImageSetMetadata.html) -// – See Getting image set metadata (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-image-set-metadata.html). -// -// - GetImageFrame (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_GetImageFrame.html) -// – See Getting image set pixel data (https://docs.aws.amazon.com/healthimaging/latest/devguide/get-image-frame.html). -// -// Image set modification actions -// -// - ListImageSetVersions (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_ListImageSetVersions.html) -// – See Listing image set versions (https://docs.aws.amazon.com/healthimaging/latest/devguide/list-image-set-versions.html). -// -// - UpdateImageSetMetadata (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_UpdateImageSetMetadata.html) -// – See Updating image set metadata (https://docs.aws.amazon.com/healthimaging/latest/devguide/update-image-set-metadata.html). -// -// - CopyImageSet (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_CopyImageSet.html) -// – See Copying an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/copy-image-set.html). -// -// - DeleteImageSet (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_DeleteImageSet.html) -// – See Deleting an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/delete-image-set.html). -// -// Tagging actions -// -// - TagResource (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_TagResource.html) -// – See Tagging a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-data-store.html) -// and Tagging an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-image-set.html). -// -// - ListTagsForResource (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_ListTagsForResource.html) -// – See Tagging a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-data-store.html) -// and Tagging an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-image-set.html). -// -// - UntagResource (https://docs.aws.amazon.com/healthimaging/latest/APIReference/API_UntagResource.html) -// – See Tagging a data store (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-data-store.html) -// and Tagging an image set (https://docs.aws.amazon.com/healthimaging/latest/devguide/tag-list-untag-image-set.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/medical-imaging-2023-07-19 for more information on this service. -// -// See medicalimaging package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/medicalimaging/ -// -// # Using the Client -// -// To contact AWS Health Imaging with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Health Imaging client MedicalImaging for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/medicalimaging/#New -package medicalimaging diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/errors.go deleted file mode 100644 index 62f0293e7c21..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/errors.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package medicalimaging - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // The user does not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Updating or deleting a resource can cause an inconsistent state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An unexpected error occurred during processing of the request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request references a resource which does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request caused a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints set by the service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/medicalimagingiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/medicalimagingiface/interface.go deleted file mode 100644 index 5c5a1bc27042..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/medicalimagingiface/interface.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package medicalimagingiface provides an interface to enable mocking the AWS Health Imaging service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package medicalimagingiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging" -) - -// MedicalImagingAPI provides an interface to enable mocking the -// medicalimaging.MedicalImaging service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Health Imaging. -// func myFunc(svc medicalimagingiface.MedicalImagingAPI) bool { -// // Make svc.CopyImageSet request -// } -// -// func main() { -// sess := session.New() -// svc := medicalimaging.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockMedicalImagingClient struct { -// medicalimagingiface.MedicalImagingAPI -// } -// func (m *mockMedicalImagingClient) CopyImageSet(input *medicalimaging.CopyImageSetInput) (*medicalimaging.CopyImageSetOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockMedicalImagingClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type MedicalImagingAPI interface { - CopyImageSet(*medicalimaging.CopyImageSetInput) (*medicalimaging.CopyImageSetOutput, error) - CopyImageSetWithContext(aws.Context, *medicalimaging.CopyImageSetInput, ...request.Option) (*medicalimaging.CopyImageSetOutput, error) - CopyImageSetRequest(*medicalimaging.CopyImageSetInput) (*request.Request, *medicalimaging.CopyImageSetOutput) - - CreateDatastore(*medicalimaging.CreateDatastoreInput) (*medicalimaging.CreateDatastoreOutput, error) - CreateDatastoreWithContext(aws.Context, *medicalimaging.CreateDatastoreInput, ...request.Option) (*medicalimaging.CreateDatastoreOutput, error) - CreateDatastoreRequest(*medicalimaging.CreateDatastoreInput) (*request.Request, *medicalimaging.CreateDatastoreOutput) - - DeleteDatastore(*medicalimaging.DeleteDatastoreInput) (*medicalimaging.DeleteDatastoreOutput, error) - DeleteDatastoreWithContext(aws.Context, *medicalimaging.DeleteDatastoreInput, ...request.Option) (*medicalimaging.DeleteDatastoreOutput, error) - DeleteDatastoreRequest(*medicalimaging.DeleteDatastoreInput) (*request.Request, *medicalimaging.DeleteDatastoreOutput) - - DeleteImageSet(*medicalimaging.DeleteImageSetInput) (*medicalimaging.DeleteImageSetOutput, error) - DeleteImageSetWithContext(aws.Context, *medicalimaging.DeleteImageSetInput, ...request.Option) (*medicalimaging.DeleteImageSetOutput, error) - DeleteImageSetRequest(*medicalimaging.DeleteImageSetInput) (*request.Request, *medicalimaging.DeleteImageSetOutput) - - GetDICOMImportJob(*medicalimaging.GetDICOMImportJobInput) (*medicalimaging.GetDICOMImportJobOutput, error) - GetDICOMImportJobWithContext(aws.Context, *medicalimaging.GetDICOMImportJobInput, ...request.Option) (*medicalimaging.GetDICOMImportJobOutput, error) - GetDICOMImportJobRequest(*medicalimaging.GetDICOMImportJobInput) (*request.Request, *medicalimaging.GetDICOMImportJobOutput) - - GetDatastore(*medicalimaging.GetDatastoreInput) (*medicalimaging.GetDatastoreOutput, error) - GetDatastoreWithContext(aws.Context, *medicalimaging.GetDatastoreInput, ...request.Option) (*medicalimaging.GetDatastoreOutput, error) - GetDatastoreRequest(*medicalimaging.GetDatastoreInput) (*request.Request, *medicalimaging.GetDatastoreOutput) - - GetImageFrame(*medicalimaging.GetImageFrameInput) (*medicalimaging.GetImageFrameOutput, error) - GetImageFrameWithContext(aws.Context, *medicalimaging.GetImageFrameInput, ...request.Option) (*medicalimaging.GetImageFrameOutput, error) - GetImageFrameRequest(*medicalimaging.GetImageFrameInput) (*request.Request, *medicalimaging.GetImageFrameOutput) - - GetImageSet(*medicalimaging.GetImageSetInput) (*medicalimaging.GetImageSetOutput, error) - GetImageSetWithContext(aws.Context, *medicalimaging.GetImageSetInput, ...request.Option) (*medicalimaging.GetImageSetOutput, error) - GetImageSetRequest(*medicalimaging.GetImageSetInput) (*request.Request, *medicalimaging.GetImageSetOutput) - - GetImageSetMetadata(*medicalimaging.GetImageSetMetadataInput) (*medicalimaging.GetImageSetMetadataOutput, error) - GetImageSetMetadataWithContext(aws.Context, *medicalimaging.GetImageSetMetadataInput, ...request.Option) (*medicalimaging.GetImageSetMetadataOutput, error) - GetImageSetMetadataRequest(*medicalimaging.GetImageSetMetadataInput) (*request.Request, *medicalimaging.GetImageSetMetadataOutput) - - ListDICOMImportJobs(*medicalimaging.ListDICOMImportJobsInput) (*medicalimaging.ListDICOMImportJobsOutput, error) - ListDICOMImportJobsWithContext(aws.Context, *medicalimaging.ListDICOMImportJobsInput, ...request.Option) (*medicalimaging.ListDICOMImportJobsOutput, error) - ListDICOMImportJobsRequest(*medicalimaging.ListDICOMImportJobsInput) (*request.Request, *medicalimaging.ListDICOMImportJobsOutput) - - ListDICOMImportJobsPages(*medicalimaging.ListDICOMImportJobsInput, func(*medicalimaging.ListDICOMImportJobsOutput, bool) bool) error - ListDICOMImportJobsPagesWithContext(aws.Context, *medicalimaging.ListDICOMImportJobsInput, func(*medicalimaging.ListDICOMImportJobsOutput, bool) bool, ...request.Option) error - - ListDatastores(*medicalimaging.ListDatastoresInput) (*medicalimaging.ListDatastoresOutput, error) - ListDatastoresWithContext(aws.Context, *medicalimaging.ListDatastoresInput, ...request.Option) (*medicalimaging.ListDatastoresOutput, error) - ListDatastoresRequest(*medicalimaging.ListDatastoresInput) (*request.Request, *medicalimaging.ListDatastoresOutput) - - ListDatastoresPages(*medicalimaging.ListDatastoresInput, func(*medicalimaging.ListDatastoresOutput, bool) bool) error - ListDatastoresPagesWithContext(aws.Context, *medicalimaging.ListDatastoresInput, func(*medicalimaging.ListDatastoresOutput, bool) bool, ...request.Option) error - - ListImageSetVersions(*medicalimaging.ListImageSetVersionsInput) (*medicalimaging.ListImageSetVersionsOutput, error) - ListImageSetVersionsWithContext(aws.Context, *medicalimaging.ListImageSetVersionsInput, ...request.Option) (*medicalimaging.ListImageSetVersionsOutput, error) - ListImageSetVersionsRequest(*medicalimaging.ListImageSetVersionsInput) (*request.Request, *medicalimaging.ListImageSetVersionsOutput) - - ListImageSetVersionsPages(*medicalimaging.ListImageSetVersionsInput, func(*medicalimaging.ListImageSetVersionsOutput, bool) bool) error - ListImageSetVersionsPagesWithContext(aws.Context, *medicalimaging.ListImageSetVersionsInput, func(*medicalimaging.ListImageSetVersionsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*medicalimaging.ListTagsForResourceInput) (*medicalimaging.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *medicalimaging.ListTagsForResourceInput, ...request.Option) (*medicalimaging.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*medicalimaging.ListTagsForResourceInput) (*request.Request, *medicalimaging.ListTagsForResourceOutput) - - SearchImageSets(*medicalimaging.SearchImageSetsInput) (*medicalimaging.SearchImageSetsOutput, error) - SearchImageSetsWithContext(aws.Context, *medicalimaging.SearchImageSetsInput, ...request.Option) (*medicalimaging.SearchImageSetsOutput, error) - SearchImageSetsRequest(*medicalimaging.SearchImageSetsInput) (*request.Request, *medicalimaging.SearchImageSetsOutput) - - SearchImageSetsPages(*medicalimaging.SearchImageSetsInput, func(*medicalimaging.SearchImageSetsOutput, bool) bool) error - SearchImageSetsPagesWithContext(aws.Context, *medicalimaging.SearchImageSetsInput, func(*medicalimaging.SearchImageSetsOutput, bool) bool, ...request.Option) error - - StartDICOMImportJob(*medicalimaging.StartDICOMImportJobInput) (*medicalimaging.StartDICOMImportJobOutput, error) - StartDICOMImportJobWithContext(aws.Context, *medicalimaging.StartDICOMImportJobInput, ...request.Option) (*medicalimaging.StartDICOMImportJobOutput, error) - StartDICOMImportJobRequest(*medicalimaging.StartDICOMImportJobInput) (*request.Request, *medicalimaging.StartDICOMImportJobOutput) - - TagResource(*medicalimaging.TagResourceInput) (*medicalimaging.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *medicalimaging.TagResourceInput, ...request.Option) (*medicalimaging.TagResourceOutput, error) - TagResourceRequest(*medicalimaging.TagResourceInput) (*request.Request, *medicalimaging.TagResourceOutput) - - UntagResource(*medicalimaging.UntagResourceInput) (*medicalimaging.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *medicalimaging.UntagResourceInput, ...request.Option) (*medicalimaging.UntagResourceOutput, error) - UntagResourceRequest(*medicalimaging.UntagResourceInput) (*request.Request, *medicalimaging.UntagResourceOutput) - - UpdateImageSetMetadata(*medicalimaging.UpdateImageSetMetadataInput) (*medicalimaging.UpdateImageSetMetadataOutput, error) - UpdateImageSetMetadataWithContext(aws.Context, *medicalimaging.UpdateImageSetMetadataInput, ...request.Option) (*medicalimaging.UpdateImageSetMetadataOutput, error) - UpdateImageSetMetadataRequest(*medicalimaging.UpdateImageSetMetadataInput) (*request.Request, *medicalimaging.UpdateImageSetMetadataOutput) -} - -var _ MedicalImagingAPI = (*medicalimaging.MedicalImaging)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/service.go deleted file mode 100644 index 1e8d2ec19148..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/medicalimaging/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package medicalimaging - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// MedicalImaging provides the API operation methods for making requests to -// AWS Health Imaging. See this package's package overview docs -// for details on the service. -// -// MedicalImaging methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type MedicalImaging struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Medical Imaging" // Name of service. - EndpointsID = "medical-imaging" // ID to lookup a service endpoint with. - ServiceID = "Medical Imaging" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the MedicalImaging client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a MedicalImaging client from just a session. -// svc := medicalimaging.New(mySession) -// -// // Create a MedicalImaging client with additional configuration -// svc := medicalimaging.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *MedicalImaging { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "medical-imaging" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *MedicalImaging { - svc := &MedicalImaging{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-07-19", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a MedicalImaging operation and runs any -// custom request initialization. -func (c *MedicalImaging) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/api.go deleted file mode 100644 index 6f165a3315c2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/api.go +++ /dev/null @@ -1,8943 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package migrationhuborchestrator - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateWorkflow = "CreateWorkflow" - -// CreateWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the CreateWorkflow 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 CreateWorkflow for more information on using the CreateWorkflow -// 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 CreateWorkflowRequest method. -// req, resp := client.CreateWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/CreateWorkflow -func (c *MigrationHubOrchestrator) CreateWorkflowRequest(input *CreateWorkflowInput) (req *request.Request, output *CreateWorkflowOutput) { - op := &request.Operation{ - Name: opCreateWorkflow, - HTTPMethod: "POST", - HTTPPath: "/migrationworkflow/", - } - - if input == nil { - input = &CreateWorkflowInput{} - } - - output = &CreateWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWorkflow API operation for AWS Migration Hub Orchestrator. -// -// Create a workflow to orchestrate your migrations. -// -// 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 AWS Migration Hub Orchestrator's -// API operation CreateWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/CreateWorkflow -func (c *MigrationHubOrchestrator) CreateWorkflow(input *CreateWorkflowInput) (*CreateWorkflowOutput, error) { - req, out := c.CreateWorkflowRequest(input) - return out, req.Send() -} - -// CreateWorkflowWithContext is the same as CreateWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWorkflow 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 *MigrationHubOrchestrator) CreateWorkflowWithContext(ctx aws.Context, input *CreateWorkflowInput, opts ...request.Option) (*CreateWorkflowOutput, error) { - req, out := c.CreateWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateWorkflowStep = "CreateWorkflowStep" - -// CreateWorkflowStepRequest generates a "aws/request.Request" representing the -// client's request for the CreateWorkflowStep 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 CreateWorkflowStep for more information on using the CreateWorkflowStep -// 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 CreateWorkflowStepRequest method. -// req, resp := client.CreateWorkflowStepRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/CreateWorkflowStep -func (c *MigrationHubOrchestrator) CreateWorkflowStepRequest(input *CreateWorkflowStepInput) (req *request.Request, output *CreateWorkflowStepOutput) { - op := &request.Operation{ - Name: opCreateWorkflowStep, - HTTPMethod: "POST", - HTTPPath: "/workflowstep", - } - - if input == nil { - input = &CreateWorkflowStepInput{} - } - - output = &CreateWorkflowStepOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWorkflowStep API operation for AWS Migration Hub Orchestrator. -// -// Create a step in the migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation CreateWorkflowStep for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/CreateWorkflowStep -func (c *MigrationHubOrchestrator) CreateWorkflowStep(input *CreateWorkflowStepInput) (*CreateWorkflowStepOutput, error) { - req, out := c.CreateWorkflowStepRequest(input) - return out, req.Send() -} - -// CreateWorkflowStepWithContext is the same as CreateWorkflowStep with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWorkflowStep 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 *MigrationHubOrchestrator) CreateWorkflowStepWithContext(ctx aws.Context, input *CreateWorkflowStepInput, opts ...request.Option) (*CreateWorkflowStepOutput, error) { - req, out := c.CreateWorkflowStepRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateWorkflowStepGroup = "CreateWorkflowStepGroup" - -// CreateWorkflowStepGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateWorkflowStepGroup 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 CreateWorkflowStepGroup for more information on using the CreateWorkflowStepGroup -// 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 CreateWorkflowStepGroupRequest method. -// req, resp := client.CreateWorkflowStepGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/CreateWorkflowStepGroup -func (c *MigrationHubOrchestrator) CreateWorkflowStepGroupRequest(input *CreateWorkflowStepGroupInput) (req *request.Request, output *CreateWorkflowStepGroupOutput) { - op := &request.Operation{ - Name: opCreateWorkflowStepGroup, - HTTPMethod: "POST", - HTTPPath: "/workflowstepgroups", - } - - if input == nil { - input = &CreateWorkflowStepGroupInput{} - } - - output = &CreateWorkflowStepGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWorkflowStepGroup API operation for AWS Migration Hub Orchestrator. -// -// Create a step group in a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation CreateWorkflowStepGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/CreateWorkflowStepGroup -func (c *MigrationHubOrchestrator) CreateWorkflowStepGroup(input *CreateWorkflowStepGroupInput) (*CreateWorkflowStepGroupOutput, error) { - req, out := c.CreateWorkflowStepGroupRequest(input) - return out, req.Send() -} - -// CreateWorkflowStepGroupWithContext is the same as CreateWorkflowStepGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWorkflowStepGroup 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 *MigrationHubOrchestrator) CreateWorkflowStepGroupWithContext(ctx aws.Context, input *CreateWorkflowStepGroupInput, opts ...request.Option) (*CreateWorkflowStepGroupOutput, error) { - req, out := c.CreateWorkflowStepGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWorkflow = "DeleteWorkflow" - -// DeleteWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWorkflow 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 DeleteWorkflow for more information on using the DeleteWorkflow -// 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 DeleteWorkflowRequest method. -// req, resp := client.DeleteWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/DeleteWorkflow -func (c *MigrationHubOrchestrator) DeleteWorkflowRequest(input *DeleteWorkflowInput) (req *request.Request, output *DeleteWorkflowOutput) { - op := &request.Operation{ - Name: opDeleteWorkflow, - HTTPMethod: "DELETE", - HTTPPath: "/migrationworkflow/{id}", - } - - if input == nil { - input = &DeleteWorkflowInput{} - } - - output = &DeleteWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteWorkflow API operation for AWS Migration Hub Orchestrator. -// -// Delete a migration workflow. You must pause a running workflow in Migration -// Hub Orchestrator console to delete it. -// -// 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 AWS Migration Hub Orchestrator's -// API operation DeleteWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/DeleteWorkflow -func (c *MigrationHubOrchestrator) DeleteWorkflow(input *DeleteWorkflowInput) (*DeleteWorkflowOutput, error) { - req, out := c.DeleteWorkflowRequest(input) - return out, req.Send() -} - -// DeleteWorkflowWithContext is the same as DeleteWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWorkflow 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 *MigrationHubOrchestrator) DeleteWorkflowWithContext(ctx aws.Context, input *DeleteWorkflowInput, opts ...request.Option) (*DeleteWorkflowOutput, error) { - req, out := c.DeleteWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWorkflowStep = "DeleteWorkflowStep" - -// DeleteWorkflowStepRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWorkflowStep 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 DeleteWorkflowStep for more information on using the DeleteWorkflowStep -// 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 DeleteWorkflowStepRequest method. -// req, resp := client.DeleteWorkflowStepRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/DeleteWorkflowStep -func (c *MigrationHubOrchestrator) DeleteWorkflowStepRequest(input *DeleteWorkflowStepInput) (req *request.Request, output *DeleteWorkflowStepOutput) { - op := &request.Operation{ - Name: opDeleteWorkflowStep, - HTTPMethod: "DELETE", - HTTPPath: "/workflowstep/{id}", - } - - if input == nil { - input = &DeleteWorkflowStepInput{} - } - - output = &DeleteWorkflowStepOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteWorkflowStep API operation for AWS Migration Hub Orchestrator. -// -// Delete a step in a migration workflow. Pause the workflow to delete a running -// step. -// -// 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 AWS Migration Hub Orchestrator's -// API operation DeleteWorkflowStep for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/DeleteWorkflowStep -func (c *MigrationHubOrchestrator) DeleteWorkflowStep(input *DeleteWorkflowStepInput) (*DeleteWorkflowStepOutput, error) { - req, out := c.DeleteWorkflowStepRequest(input) - return out, req.Send() -} - -// DeleteWorkflowStepWithContext is the same as DeleteWorkflowStep with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWorkflowStep 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 *MigrationHubOrchestrator) DeleteWorkflowStepWithContext(ctx aws.Context, input *DeleteWorkflowStepInput, opts ...request.Option) (*DeleteWorkflowStepOutput, error) { - req, out := c.DeleteWorkflowStepRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWorkflowStepGroup = "DeleteWorkflowStepGroup" - -// DeleteWorkflowStepGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWorkflowStepGroup 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 DeleteWorkflowStepGroup for more information on using the DeleteWorkflowStepGroup -// 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 DeleteWorkflowStepGroupRequest method. -// req, resp := client.DeleteWorkflowStepGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/DeleteWorkflowStepGroup -func (c *MigrationHubOrchestrator) DeleteWorkflowStepGroupRequest(input *DeleteWorkflowStepGroupInput) (req *request.Request, output *DeleteWorkflowStepGroupOutput) { - op := &request.Operation{ - Name: opDeleteWorkflowStepGroup, - HTTPMethod: "DELETE", - HTTPPath: "/workflowstepgroup/{id}", - } - - if input == nil { - input = &DeleteWorkflowStepGroupInput{} - } - - output = &DeleteWorkflowStepGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteWorkflowStepGroup API operation for AWS Migration Hub Orchestrator. -// -// Delete a step group in a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation DeleteWorkflowStepGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/DeleteWorkflowStepGroup -func (c *MigrationHubOrchestrator) DeleteWorkflowStepGroup(input *DeleteWorkflowStepGroupInput) (*DeleteWorkflowStepGroupOutput, error) { - req, out := c.DeleteWorkflowStepGroupRequest(input) - return out, req.Send() -} - -// DeleteWorkflowStepGroupWithContext is the same as DeleteWorkflowStepGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWorkflowStepGroup 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 *MigrationHubOrchestrator) DeleteWorkflowStepGroupWithContext(ctx aws.Context, input *DeleteWorkflowStepGroupInput, opts ...request.Option) (*DeleteWorkflowStepGroupOutput, error) { - req, out := c.DeleteWorkflowStepGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTemplate = "GetTemplate" - -// GetTemplateRequest generates a "aws/request.Request" representing the -// client's request for the GetTemplate 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 GetTemplate for more information on using the GetTemplate -// 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 GetTemplateRequest method. -// req, resp := client.GetTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetTemplate -func (c *MigrationHubOrchestrator) GetTemplateRequest(input *GetTemplateInput) (req *request.Request, output *GetTemplateOutput) { - op := &request.Operation{ - Name: opGetTemplate, - HTTPMethod: "GET", - HTTPPath: "/migrationworkflowtemplate/{id}", - } - - if input == nil { - input = &GetTemplateInput{} - } - - output = &GetTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTemplate API operation for AWS Migration Hub Orchestrator. -// -// Get the template you want to use for creating a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation GetTemplate for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetTemplate -func (c *MigrationHubOrchestrator) GetTemplate(input *GetTemplateInput) (*GetTemplateOutput, error) { - req, out := c.GetTemplateRequest(input) - return out, req.Send() -} - -// GetTemplateWithContext is the same as GetTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See GetTemplate 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 *MigrationHubOrchestrator) GetTemplateWithContext(ctx aws.Context, input *GetTemplateInput, opts ...request.Option) (*GetTemplateOutput, error) { - req, out := c.GetTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTemplateStep = "GetTemplateStep" - -// GetTemplateStepRequest generates a "aws/request.Request" representing the -// client's request for the GetTemplateStep 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 GetTemplateStep for more information on using the GetTemplateStep -// 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 GetTemplateStepRequest method. -// req, resp := client.GetTemplateStepRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetTemplateStep -func (c *MigrationHubOrchestrator) GetTemplateStepRequest(input *GetTemplateStepInput) (req *request.Request, output *GetTemplateStepOutput) { - op := &request.Operation{ - Name: opGetTemplateStep, - HTTPMethod: "GET", - HTTPPath: "/templatestep/{id}", - } - - if input == nil { - input = &GetTemplateStepInput{} - } - - output = &GetTemplateStepOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTemplateStep API operation for AWS Migration Hub Orchestrator. -// -// Get a specific step in a template. -// -// 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 AWS Migration Hub Orchestrator's -// API operation GetTemplateStep for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetTemplateStep -func (c *MigrationHubOrchestrator) GetTemplateStep(input *GetTemplateStepInput) (*GetTemplateStepOutput, error) { - req, out := c.GetTemplateStepRequest(input) - return out, req.Send() -} - -// GetTemplateStepWithContext is the same as GetTemplateStep with the addition of -// the ability to pass a context and additional request options. -// -// See GetTemplateStep 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 *MigrationHubOrchestrator) GetTemplateStepWithContext(ctx aws.Context, input *GetTemplateStepInput, opts ...request.Option) (*GetTemplateStepOutput, error) { - req, out := c.GetTemplateStepRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTemplateStepGroup = "GetTemplateStepGroup" - -// GetTemplateStepGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetTemplateStepGroup 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 GetTemplateStepGroup for more information on using the GetTemplateStepGroup -// 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 GetTemplateStepGroupRequest method. -// req, resp := client.GetTemplateStepGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetTemplateStepGroup -func (c *MigrationHubOrchestrator) GetTemplateStepGroupRequest(input *GetTemplateStepGroupInput) (req *request.Request, output *GetTemplateStepGroupOutput) { - op := &request.Operation{ - Name: opGetTemplateStepGroup, - HTTPMethod: "GET", - HTTPPath: "/templates/{templateId}/stepgroups/{id}", - } - - if input == nil { - input = &GetTemplateStepGroupInput{} - } - - output = &GetTemplateStepGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTemplateStepGroup API operation for AWS Migration Hub Orchestrator. -// -// Get a step group in a template. -// -// 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 AWS Migration Hub Orchestrator's -// API operation GetTemplateStepGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetTemplateStepGroup -func (c *MigrationHubOrchestrator) GetTemplateStepGroup(input *GetTemplateStepGroupInput) (*GetTemplateStepGroupOutput, error) { - req, out := c.GetTemplateStepGroupRequest(input) - return out, req.Send() -} - -// GetTemplateStepGroupWithContext is the same as GetTemplateStepGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetTemplateStepGroup 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 *MigrationHubOrchestrator) GetTemplateStepGroupWithContext(ctx aws.Context, input *GetTemplateStepGroupInput, opts ...request.Option) (*GetTemplateStepGroupOutput, error) { - req, out := c.GetTemplateStepGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWorkflow = "GetWorkflow" - -// GetWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the GetWorkflow 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 GetWorkflow for more information on using the GetWorkflow -// 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 GetWorkflowRequest method. -// req, resp := client.GetWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetWorkflow -func (c *MigrationHubOrchestrator) GetWorkflowRequest(input *GetWorkflowInput) (req *request.Request, output *GetWorkflowOutput) { - op := &request.Operation{ - Name: opGetWorkflow, - HTTPMethod: "GET", - HTTPPath: "/migrationworkflow/{id}", - } - - if input == nil { - input = &GetWorkflowInput{} - } - - output = &GetWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWorkflow API operation for AWS Migration Hub Orchestrator. -// -// Get migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation GetWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetWorkflow -func (c *MigrationHubOrchestrator) GetWorkflow(input *GetWorkflowInput) (*GetWorkflowOutput, error) { - req, out := c.GetWorkflowRequest(input) - return out, req.Send() -} - -// GetWorkflowWithContext is the same as GetWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See GetWorkflow 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 *MigrationHubOrchestrator) GetWorkflowWithContext(ctx aws.Context, input *GetWorkflowInput, opts ...request.Option) (*GetWorkflowOutput, error) { - req, out := c.GetWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWorkflowStep = "GetWorkflowStep" - -// GetWorkflowStepRequest generates a "aws/request.Request" representing the -// client's request for the GetWorkflowStep 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 GetWorkflowStep for more information on using the GetWorkflowStep -// 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 GetWorkflowStepRequest method. -// req, resp := client.GetWorkflowStepRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetWorkflowStep -func (c *MigrationHubOrchestrator) GetWorkflowStepRequest(input *GetWorkflowStepInput) (req *request.Request, output *GetWorkflowStepOutput) { - op := &request.Operation{ - Name: opGetWorkflowStep, - HTTPMethod: "GET", - HTTPPath: "/workflowstep/{id}", - } - - if input == nil { - input = &GetWorkflowStepInput{} - } - - output = &GetWorkflowStepOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWorkflowStep API operation for AWS Migration Hub Orchestrator. -// -// Get a step in the migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation GetWorkflowStep for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetWorkflowStep -func (c *MigrationHubOrchestrator) GetWorkflowStep(input *GetWorkflowStepInput) (*GetWorkflowStepOutput, error) { - req, out := c.GetWorkflowStepRequest(input) - return out, req.Send() -} - -// GetWorkflowStepWithContext is the same as GetWorkflowStep with the addition of -// the ability to pass a context and additional request options. -// -// See GetWorkflowStep 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 *MigrationHubOrchestrator) GetWorkflowStepWithContext(ctx aws.Context, input *GetWorkflowStepInput, opts ...request.Option) (*GetWorkflowStepOutput, error) { - req, out := c.GetWorkflowStepRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWorkflowStepGroup = "GetWorkflowStepGroup" - -// GetWorkflowStepGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetWorkflowStepGroup 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 GetWorkflowStepGroup for more information on using the GetWorkflowStepGroup -// 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 GetWorkflowStepGroupRequest method. -// req, resp := client.GetWorkflowStepGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetWorkflowStepGroup -func (c *MigrationHubOrchestrator) GetWorkflowStepGroupRequest(input *GetWorkflowStepGroupInput) (req *request.Request, output *GetWorkflowStepGroupOutput) { - op := &request.Operation{ - Name: opGetWorkflowStepGroup, - HTTPMethod: "GET", - HTTPPath: "/workflowstepgroup/{id}", - } - - if input == nil { - input = &GetWorkflowStepGroupInput{} - } - - output = &GetWorkflowStepGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWorkflowStepGroup API operation for AWS Migration Hub Orchestrator. -// -// Get the step group of a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation GetWorkflowStepGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/GetWorkflowStepGroup -func (c *MigrationHubOrchestrator) GetWorkflowStepGroup(input *GetWorkflowStepGroupInput) (*GetWorkflowStepGroupOutput, error) { - req, out := c.GetWorkflowStepGroupRequest(input) - return out, req.Send() -} - -// GetWorkflowStepGroupWithContext is the same as GetWorkflowStepGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetWorkflowStepGroup 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 *MigrationHubOrchestrator) GetWorkflowStepGroupWithContext(ctx aws.Context, input *GetWorkflowStepGroupInput, opts ...request.Option) (*GetWorkflowStepGroupOutput, error) { - req, out := c.GetWorkflowStepGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListPlugins = "ListPlugins" - -// ListPluginsRequest generates a "aws/request.Request" representing the -// client's request for the ListPlugins 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 ListPlugins for more information on using the ListPlugins -// 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 ListPluginsRequest method. -// req, resp := client.ListPluginsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListPlugins -func (c *MigrationHubOrchestrator) ListPluginsRequest(input *ListPluginsInput) (req *request.Request, output *ListPluginsOutput) { - op := &request.Operation{ - Name: opListPlugins, - HTTPMethod: "GET", - HTTPPath: "/plugins", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPluginsInput{} - } - - output = &ListPluginsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPlugins API operation for AWS Migration Hub Orchestrator. -// -// List AWS Migration Hub Orchestrator plugins. -// -// 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 AWS Migration Hub Orchestrator's -// API operation ListPlugins for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListPlugins -func (c *MigrationHubOrchestrator) ListPlugins(input *ListPluginsInput) (*ListPluginsOutput, error) { - req, out := c.ListPluginsRequest(input) - return out, req.Send() -} - -// ListPluginsWithContext is the same as ListPlugins with the addition of -// the ability to pass a context and additional request options. -// -// See ListPlugins 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 *MigrationHubOrchestrator) ListPluginsWithContext(ctx aws.Context, input *ListPluginsInput, opts ...request.Option) (*ListPluginsOutput, error) { - req, out := c.ListPluginsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPluginsPages iterates over the pages of a ListPlugins operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPlugins method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPlugins operation. -// pageNum := 0 -// err := client.ListPluginsPages(params, -// func(page *migrationhuborchestrator.ListPluginsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MigrationHubOrchestrator) ListPluginsPages(input *ListPluginsInput, fn func(*ListPluginsOutput, bool) bool) error { - return c.ListPluginsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPluginsPagesWithContext same as ListPluginsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MigrationHubOrchestrator) ListPluginsPagesWithContext(ctx aws.Context, input *ListPluginsInput, fn func(*ListPluginsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPluginsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPluginsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPluginsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListTagsForResource -func (c *MigrationHubOrchestrator) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Migration Hub Orchestrator. -// -// List the tags added to a resource. -// -// 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 AWS Migration Hub Orchestrator's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListTagsForResource -func (c *MigrationHubOrchestrator) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *MigrationHubOrchestrator) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTemplateStepGroups = "ListTemplateStepGroups" - -// ListTemplateStepGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListTemplateStepGroups 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 ListTemplateStepGroups for more information on using the ListTemplateStepGroups -// 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 ListTemplateStepGroupsRequest method. -// req, resp := client.ListTemplateStepGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListTemplateStepGroups -func (c *MigrationHubOrchestrator) ListTemplateStepGroupsRequest(input *ListTemplateStepGroupsInput) (req *request.Request, output *ListTemplateStepGroupsOutput) { - op := &request.Operation{ - Name: opListTemplateStepGroups, - HTTPMethod: "GET", - HTTPPath: "/templatestepgroups/{templateId}", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTemplateStepGroupsInput{} - } - - output = &ListTemplateStepGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTemplateStepGroups API operation for AWS Migration Hub Orchestrator. -// -// List the step groups in a template. -// -// 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 AWS Migration Hub Orchestrator's -// API operation ListTemplateStepGroups for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListTemplateStepGroups -func (c *MigrationHubOrchestrator) ListTemplateStepGroups(input *ListTemplateStepGroupsInput) (*ListTemplateStepGroupsOutput, error) { - req, out := c.ListTemplateStepGroupsRequest(input) - return out, req.Send() -} - -// ListTemplateStepGroupsWithContext is the same as ListTemplateStepGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListTemplateStepGroups 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 *MigrationHubOrchestrator) ListTemplateStepGroupsWithContext(ctx aws.Context, input *ListTemplateStepGroupsInput, opts ...request.Option) (*ListTemplateStepGroupsOutput, error) { - req, out := c.ListTemplateStepGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTemplateStepGroupsPages iterates over the pages of a ListTemplateStepGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTemplateStepGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTemplateStepGroups operation. -// pageNum := 0 -// err := client.ListTemplateStepGroupsPages(params, -// func(page *migrationhuborchestrator.ListTemplateStepGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MigrationHubOrchestrator) ListTemplateStepGroupsPages(input *ListTemplateStepGroupsInput, fn func(*ListTemplateStepGroupsOutput, bool) bool) error { - return c.ListTemplateStepGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTemplateStepGroupsPagesWithContext same as ListTemplateStepGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MigrationHubOrchestrator) ListTemplateStepGroupsPagesWithContext(ctx aws.Context, input *ListTemplateStepGroupsInput, fn func(*ListTemplateStepGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTemplateStepGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTemplateStepGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTemplateStepGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTemplateSteps = "ListTemplateSteps" - -// ListTemplateStepsRequest generates a "aws/request.Request" representing the -// client's request for the ListTemplateSteps 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 ListTemplateSteps for more information on using the ListTemplateSteps -// 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 ListTemplateStepsRequest method. -// req, resp := client.ListTemplateStepsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListTemplateSteps -func (c *MigrationHubOrchestrator) ListTemplateStepsRequest(input *ListTemplateStepsInput) (req *request.Request, output *ListTemplateStepsOutput) { - op := &request.Operation{ - Name: opListTemplateSteps, - HTTPMethod: "GET", - HTTPPath: "/templatesteps", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTemplateStepsInput{} - } - - output = &ListTemplateStepsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTemplateSteps API operation for AWS Migration Hub Orchestrator. -// -// List the steps in a template. -// -// 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 AWS Migration Hub Orchestrator's -// API operation ListTemplateSteps for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListTemplateSteps -func (c *MigrationHubOrchestrator) ListTemplateSteps(input *ListTemplateStepsInput) (*ListTemplateStepsOutput, error) { - req, out := c.ListTemplateStepsRequest(input) - return out, req.Send() -} - -// ListTemplateStepsWithContext is the same as ListTemplateSteps with the addition of -// the ability to pass a context and additional request options. -// -// See ListTemplateSteps 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 *MigrationHubOrchestrator) ListTemplateStepsWithContext(ctx aws.Context, input *ListTemplateStepsInput, opts ...request.Option) (*ListTemplateStepsOutput, error) { - req, out := c.ListTemplateStepsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTemplateStepsPages iterates over the pages of a ListTemplateSteps operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTemplateSteps method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTemplateSteps operation. -// pageNum := 0 -// err := client.ListTemplateStepsPages(params, -// func(page *migrationhuborchestrator.ListTemplateStepsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MigrationHubOrchestrator) ListTemplateStepsPages(input *ListTemplateStepsInput, fn func(*ListTemplateStepsOutput, bool) bool) error { - return c.ListTemplateStepsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTemplateStepsPagesWithContext same as ListTemplateStepsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MigrationHubOrchestrator) ListTemplateStepsPagesWithContext(ctx aws.Context, input *ListTemplateStepsInput, fn func(*ListTemplateStepsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTemplateStepsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTemplateStepsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTemplateStepsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTemplates = "ListTemplates" - -// ListTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the ListTemplates 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 ListTemplates for more information on using the ListTemplates -// 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 ListTemplatesRequest method. -// req, resp := client.ListTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListTemplates -func (c *MigrationHubOrchestrator) ListTemplatesRequest(input *ListTemplatesInput) (req *request.Request, output *ListTemplatesOutput) { - op := &request.Operation{ - Name: opListTemplates, - HTTPMethod: "GET", - HTTPPath: "/migrationworkflowtemplates", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTemplatesInput{} - } - - output = &ListTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTemplates API operation for AWS Migration Hub Orchestrator. -// -// List the templates available in Migration Hub Orchestrator to create a migration -// workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation ListTemplates for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListTemplates -func (c *MigrationHubOrchestrator) ListTemplates(input *ListTemplatesInput) (*ListTemplatesOutput, error) { - req, out := c.ListTemplatesRequest(input) - return out, req.Send() -} - -// ListTemplatesWithContext is the same as ListTemplates with the addition of -// the ability to pass a context and additional request options. -// -// See ListTemplates 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 *MigrationHubOrchestrator) ListTemplatesWithContext(ctx aws.Context, input *ListTemplatesInput, opts ...request.Option) (*ListTemplatesOutput, error) { - req, out := c.ListTemplatesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTemplatesPages iterates over the pages of a ListTemplates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTemplates method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTemplates operation. -// pageNum := 0 -// err := client.ListTemplatesPages(params, -// func(page *migrationhuborchestrator.ListTemplatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MigrationHubOrchestrator) ListTemplatesPages(input *ListTemplatesInput, fn func(*ListTemplatesOutput, bool) bool) error { - return c.ListTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTemplatesPagesWithContext same as ListTemplatesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MigrationHubOrchestrator) ListTemplatesPagesWithContext(ctx aws.Context, input *ListTemplatesInput, fn func(*ListTemplatesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTemplatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTemplatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTemplatesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkflowStepGroups = "ListWorkflowStepGroups" - -// ListWorkflowStepGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkflowStepGroups 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 ListWorkflowStepGroups for more information on using the ListWorkflowStepGroups -// 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 ListWorkflowStepGroupsRequest method. -// req, resp := client.ListWorkflowStepGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListWorkflowStepGroups -func (c *MigrationHubOrchestrator) ListWorkflowStepGroupsRequest(input *ListWorkflowStepGroupsInput) (req *request.Request, output *ListWorkflowStepGroupsOutput) { - op := &request.Operation{ - Name: opListWorkflowStepGroups, - HTTPMethod: "GET", - HTTPPath: "/workflowstepgroups", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkflowStepGroupsInput{} - } - - output = &ListWorkflowStepGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWorkflowStepGroups API operation for AWS Migration Hub Orchestrator. -// -// List the step groups in a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation ListWorkflowStepGroups for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListWorkflowStepGroups -func (c *MigrationHubOrchestrator) ListWorkflowStepGroups(input *ListWorkflowStepGroupsInput) (*ListWorkflowStepGroupsOutput, error) { - req, out := c.ListWorkflowStepGroupsRequest(input) - return out, req.Send() -} - -// ListWorkflowStepGroupsWithContext is the same as ListWorkflowStepGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkflowStepGroups 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 *MigrationHubOrchestrator) ListWorkflowStepGroupsWithContext(ctx aws.Context, input *ListWorkflowStepGroupsInput, opts ...request.Option) (*ListWorkflowStepGroupsOutput, error) { - req, out := c.ListWorkflowStepGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkflowStepGroupsPages iterates over the pages of a ListWorkflowStepGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkflowStepGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkflowStepGroups operation. -// pageNum := 0 -// err := client.ListWorkflowStepGroupsPages(params, -// func(page *migrationhuborchestrator.ListWorkflowStepGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MigrationHubOrchestrator) ListWorkflowStepGroupsPages(input *ListWorkflowStepGroupsInput, fn func(*ListWorkflowStepGroupsOutput, bool) bool) error { - return c.ListWorkflowStepGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkflowStepGroupsPagesWithContext same as ListWorkflowStepGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MigrationHubOrchestrator) ListWorkflowStepGroupsPagesWithContext(ctx aws.Context, input *ListWorkflowStepGroupsInput, fn func(*ListWorkflowStepGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkflowStepGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkflowStepGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkflowStepGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkflowSteps = "ListWorkflowSteps" - -// ListWorkflowStepsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkflowSteps 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 ListWorkflowSteps for more information on using the ListWorkflowSteps -// 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 ListWorkflowStepsRequest method. -// req, resp := client.ListWorkflowStepsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListWorkflowSteps -func (c *MigrationHubOrchestrator) ListWorkflowStepsRequest(input *ListWorkflowStepsInput) (req *request.Request, output *ListWorkflowStepsOutput) { - op := &request.Operation{ - Name: opListWorkflowSteps, - HTTPMethod: "GET", - HTTPPath: "/workflow/{workflowId}/workflowstepgroups/{stepGroupId}/workflowsteps", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkflowStepsInput{} - } - - output = &ListWorkflowStepsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWorkflowSteps API operation for AWS Migration Hub Orchestrator. -// -// List the steps in a workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation ListWorkflowSteps for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListWorkflowSteps -func (c *MigrationHubOrchestrator) ListWorkflowSteps(input *ListWorkflowStepsInput) (*ListWorkflowStepsOutput, error) { - req, out := c.ListWorkflowStepsRequest(input) - return out, req.Send() -} - -// ListWorkflowStepsWithContext is the same as ListWorkflowSteps with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkflowSteps 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 *MigrationHubOrchestrator) ListWorkflowStepsWithContext(ctx aws.Context, input *ListWorkflowStepsInput, opts ...request.Option) (*ListWorkflowStepsOutput, error) { - req, out := c.ListWorkflowStepsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkflowStepsPages iterates over the pages of a ListWorkflowSteps operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkflowSteps method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkflowSteps operation. -// pageNum := 0 -// err := client.ListWorkflowStepsPages(params, -// func(page *migrationhuborchestrator.ListWorkflowStepsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MigrationHubOrchestrator) ListWorkflowStepsPages(input *ListWorkflowStepsInput, fn func(*ListWorkflowStepsOutput, bool) bool) error { - return c.ListWorkflowStepsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkflowStepsPagesWithContext same as ListWorkflowStepsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MigrationHubOrchestrator) ListWorkflowStepsPagesWithContext(ctx aws.Context, input *ListWorkflowStepsInput, fn func(*ListWorkflowStepsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkflowStepsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkflowStepsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkflowStepsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkflows = "ListWorkflows" - -// ListWorkflowsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkflows 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 ListWorkflows for more information on using the ListWorkflows -// 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 ListWorkflowsRequest method. -// req, resp := client.ListWorkflowsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListWorkflows -func (c *MigrationHubOrchestrator) ListWorkflowsRequest(input *ListWorkflowsInput) (req *request.Request, output *ListWorkflowsOutput) { - op := &request.Operation{ - Name: opListWorkflows, - HTTPMethod: "GET", - HTTPPath: "/migrationworkflows", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkflowsInput{} - } - - output = &ListWorkflowsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWorkflows API operation for AWS Migration Hub Orchestrator. -// -// List the migration workflows. -// -// 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 AWS Migration Hub Orchestrator's -// API operation ListWorkflows for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/ListWorkflows -func (c *MigrationHubOrchestrator) ListWorkflows(input *ListWorkflowsInput) (*ListWorkflowsOutput, error) { - req, out := c.ListWorkflowsRequest(input) - return out, req.Send() -} - -// ListWorkflowsWithContext is the same as ListWorkflows with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkflows 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 *MigrationHubOrchestrator) ListWorkflowsWithContext(ctx aws.Context, input *ListWorkflowsInput, opts ...request.Option) (*ListWorkflowsOutput, error) { - req, out := c.ListWorkflowsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkflowsPages iterates over the pages of a ListWorkflows operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkflows method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkflows operation. -// pageNum := 0 -// err := client.ListWorkflowsPages(params, -// func(page *migrationhuborchestrator.ListWorkflowsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *MigrationHubOrchestrator) ListWorkflowsPages(input *ListWorkflowsInput, fn func(*ListWorkflowsOutput, bool) bool) error { - return c.ListWorkflowsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkflowsPagesWithContext same as ListWorkflowsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *MigrationHubOrchestrator) ListWorkflowsPagesWithContext(ctx aws.Context, input *ListWorkflowsInput, fn func(*ListWorkflowsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkflowsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkflowsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkflowsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opRetryWorkflowStep = "RetryWorkflowStep" - -// RetryWorkflowStepRequest generates a "aws/request.Request" representing the -// client's request for the RetryWorkflowStep 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 RetryWorkflowStep for more information on using the RetryWorkflowStep -// 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 RetryWorkflowStepRequest method. -// req, resp := client.RetryWorkflowStepRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/RetryWorkflowStep -func (c *MigrationHubOrchestrator) RetryWorkflowStepRequest(input *RetryWorkflowStepInput) (req *request.Request, output *RetryWorkflowStepOutput) { - op := &request.Operation{ - Name: opRetryWorkflowStep, - HTTPMethod: "POST", - HTTPPath: "/retryworkflowstep/{id}", - } - - if input == nil { - input = &RetryWorkflowStepInput{} - } - - output = &RetryWorkflowStepOutput{} - req = c.newRequest(op, input, output) - return -} - -// RetryWorkflowStep API operation for AWS Migration Hub Orchestrator. -// -// Retry a failed step in a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation RetryWorkflowStep for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/RetryWorkflowStep -func (c *MigrationHubOrchestrator) RetryWorkflowStep(input *RetryWorkflowStepInput) (*RetryWorkflowStepOutput, error) { - req, out := c.RetryWorkflowStepRequest(input) - return out, req.Send() -} - -// RetryWorkflowStepWithContext is the same as RetryWorkflowStep with the addition of -// the ability to pass a context and additional request options. -// -// See RetryWorkflowStep 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 *MigrationHubOrchestrator) RetryWorkflowStepWithContext(ctx aws.Context, input *RetryWorkflowStepInput, opts ...request.Option) (*RetryWorkflowStepOutput, error) { - req, out := c.RetryWorkflowStepRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartWorkflow = "StartWorkflow" - -// StartWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the StartWorkflow 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 StartWorkflow for more information on using the StartWorkflow -// 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 StartWorkflowRequest method. -// req, resp := client.StartWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/StartWorkflow -func (c *MigrationHubOrchestrator) StartWorkflowRequest(input *StartWorkflowInput) (req *request.Request, output *StartWorkflowOutput) { - op := &request.Operation{ - Name: opStartWorkflow, - HTTPMethod: "POST", - HTTPPath: "/migrationworkflow/{id}/start", - } - - if input == nil { - input = &StartWorkflowInput{} - } - - output = &StartWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartWorkflow API operation for AWS Migration Hub Orchestrator. -// -// Start a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation StartWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/StartWorkflow -func (c *MigrationHubOrchestrator) StartWorkflow(input *StartWorkflowInput) (*StartWorkflowOutput, error) { - req, out := c.StartWorkflowRequest(input) - return out, req.Send() -} - -// StartWorkflowWithContext is the same as StartWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See StartWorkflow 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 *MigrationHubOrchestrator) StartWorkflowWithContext(ctx aws.Context, input *StartWorkflowInput, opts ...request.Option) (*StartWorkflowOutput, error) { - req, out := c.StartWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopWorkflow = "StopWorkflow" - -// StopWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the StopWorkflow 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 StopWorkflow for more information on using the StopWorkflow -// 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 StopWorkflowRequest method. -// req, resp := client.StopWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/StopWorkflow -func (c *MigrationHubOrchestrator) StopWorkflowRequest(input *StopWorkflowInput) (req *request.Request, output *StopWorkflowOutput) { - op := &request.Operation{ - Name: opStopWorkflow, - HTTPMethod: "POST", - HTTPPath: "/migrationworkflow/{id}/stop", - } - - if input == nil { - input = &StopWorkflowInput{} - } - - output = &StopWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopWorkflow API operation for AWS Migration Hub Orchestrator. -// -// Stop an ongoing migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation StopWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/StopWorkflow -func (c *MigrationHubOrchestrator) StopWorkflow(input *StopWorkflowInput) (*StopWorkflowOutput, error) { - req, out := c.StopWorkflowRequest(input) - return out, req.Send() -} - -// StopWorkflowWithContext is the same as StopWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See StopWorkflow 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 *MigrationHubOrchestrator) StopWorkflowWithContext(ctx aws.Context, input *StopWorkflowInput, opts ...request.Option) (*StopWorkflowOutput, error) { - req, out := c.StopWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/TagResource -func (c *MigrationHubOrchestrator) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Migration Hub Orchestrator. -// -// Tag a resource by specifying its Amazon Resource Name (ARN). -// -// 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 AWS Migration Hub Orchestrator's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/TagResource -func (c *MigrationHubOrchestrator) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *MigrationHubOrchestrator) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/UntagResource -func (c *MigrationHubOrchestrator) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Migration Hub Orchestrator. -// -// Deletes the tags for a resource. -// -// 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 AWS Migration Hub Orchestrator's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/UntagResource -func (c *MigrationHubOrchestrator) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *MigrationHubOrchestrator) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWorkflow = "UpdateWorkflow" - -// UpdateWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWorkflow 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 UpdateWorkflow for more information on using the UpdateWorkflow -// 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 UpdateWorkflowRequest method. -// req, resp := client.UpdateWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/UpdateWorkflow -func (c *MigrationHubOrchestrator) UpdateWorkflowRequest(input *UpdateWorkflowInput) (req *request.Request, output *UpdateWorkflowOutput) { - op := &request.Operation{ - Name: opUpdateWorkflow, - HTTPMethod: "POST", - HTTPPath: "/migrationworkflow/{id}", - } - - if input == nil { - input = &UpdateWorkflowInput{} - } - - output = &UpdateWorkflowOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateWorkflow API operation for AWS Migration Hub Orchestrator. -// -// Update a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation UpdateWorkflow for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/UpdateWorkflow -func (c *MigrationHubOrchestrator) UpdateWorkflow(input *UpdateWorkflowInput) (*UpdateWorkflowOutput, error) { - req, out := c.UpdateWorkflowRequest(input) - return out, req.Send() -} - -// UpdateWorkflowWithContext is the same as UpdateWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWorkflow 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 *MigrationHubOrchestrator) UpdateWorkflowWithContext(ctx aws.Context, input *UpdateWorkflowInput, opts ...request.Option) (*UpdateWorkflowOutput, error) { - req, out := c.UpdateWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWorkflowStep = "UpdateWorkflowStep" - -// UpdateWorkflowStepRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWorkflowStep 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 UpdateWorkflowStep for more information on using the UpdateWorkflowStep -// 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 UpdateWorkflowStepRequest method. -// req, resp := client.UpdateWorkflowStepRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/UpdateWorkflowStep -func (c *MigrationHubOrchestrator) UpdateWorkflowStepRequest(input *UpdateWorkflowStepInput) (req *request.Request, output *UpdateWorkflowStepOutput) { - op := &request.Operation{ - Name: opUpdateWorkflowStep, - HTTPMethod: "POST", - HTTPPath: "/workflowstep/{id}", - } - - if input == nil { - input = &UpdateWorkflowStepInput{} - } - - output = &UpdateWorkflowStepOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateWorkflowStep API operation for AWS Migration Hub Orchestrator. -// -// Update a step in a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation UpdateWorkflowStep for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/UpdateWorkflowStep -func (c *MigrationHubOrchestrator) UpdateWorkflowStep(input *UpdateWorkflowStepInput) (*UpdateWorkflowStepOutput, error) { - req, out := c.UpdateWorkflowStepRequest(input) - return out, req.Send() -} - -// UpdateWorkflowStepWithContext is the same as UpdateWorkflowStep with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWorkflowStep 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 *MigrationHubOrchestrator) UpdateWorkflowStepWithContext(ctx aws.Context, input *UpdateWorkflowStepInput, opts ...request.Option) (*UpdateWorkflowStepOutput, error) { - req, out := c.UpdateWorkflowStepRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWorkflowStepGroup = "UpdateWorkflowStepGroup" - -// UpdateWorkflowStepGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWorkflowStepGroup 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 UpdateWorkflowStepGroup for more information on using the UpdateWorkflowStepGroup -// 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 UpdateWorkflowStepGroupRequest method. -// req, resp := client.UpdateWorkflowStepGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/UpdateWorkflowStepGroup -func (c *MigrationHubOrchestrator) UpdateWorkflowStepGroupRequest(input *UpdateWorkflowStepGroupInput) (req *request.Request, output *UpdateWorkflowStepGroupOutput) { - op := &request.Operation{ - Name: opUpdateWorkflowStepGroup, - HTTPMethod: "POST", - HTTPPath: "/workflowstepgroup/{id}", - } - - if input == nil { - input = &UpdateWorkflowStepGroupInput{} - } - - output = &UpdateWorkflowStepGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateWorkflowStepGroup API operation for AWS Migration Hub Orchestrator. -// -// Update the step group in a migration workflow. -// -// 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 AWS Migration Hub Orchestrator's -// API operation UpdateWorkflowStepGroup for usage and error information. -// -// Returned Error Types: -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - InternalServerException -// An internal error has occurred. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28/UpdateWorkflowStepGroup -func (c *MigrationHubOrchestrator) UpdateWorkflowStepGroup(input *UpdateWorkflowStepGroupInput) (*UpdateWorkflowStepGroupOutput, error) { - req, out := c.UpdateWorkflowStepGroupRequest(input) - return out, req.Send() -} - -// UpdateWorkflowStepGroupWithContext is the same as UpdateWorkflowStepGroup with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWorkflowStepGroup 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 *MigrationHubOrchestrator) UpdateWorkflowStepGroupWithContext(ctx aws.Context, input *UpdateWorkflowStepGroupInput, opts ...request.Option) (*UpdateWorkflowStepGroupOutput, error) { - req, out := c.UpdateWorkflowStepGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateWorkflowInput struct { - _ struct{} `type:"structure"` - - // The configuration ID of the application configured in Application Discovery - // Service. - // - // ApplicationConfigurationId is a required field - ApplicationConfigurationId *string `locationName:"applicationConfigurationId" min:"1" type:"string" required:"true"` - - // The description of the migration workflow. - Description *string `locationName:"description" type:"string"` - - // The input parameters required to create a migration workflow. - // - // InputParameters is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateWorkflowInput's - // String and GoString methods. - // - // InputParameters is a required field - InputParameters map[string]*StepInput_ `locationName:"inputParameters" type:"map" required:"true" sensitive:"true"` - - // The name of the migration workflow. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The servers on which a step will be run. - StepTargets []*string `locationName:"stepTargets" type:"list"` - - // The tags to add on a migration workflow. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The ID of the template. - // - // TemplateId is a required field - TemplateId *string `locationName:"templateId" min:"1" 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 CreateWorkflowInput) 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 CreateWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkflowInput"} - if s.ApplicationConfigurationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationConfigurationId")) - } - if s.ApplicationConfigurationId != nil && len(*s.ApplicationConfigurationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationConfigurationId", 1)) - } - if s.InputParameters == nil { - invalidParams.Add(request.NewErrParamRequired("InputParameters")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateId")) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationConfigurationId sets the ApplicationConfigurationId field's value. -func (s *CreateWorkflowInput) SetApplicationConfigurationId(v string) *CreateWorkflowInput { - s.ApplicationConfigurationId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateWorkflowInput) SetDescription(v string) *CreateWorkflowInput { - s.Description = &v - return s -} - -// SetInputParameters sets the InputParameters field's value. -func (s *CreateWorkflowInput) SetInputParameters(v map[string]*StepInput_) *CreateWorkflowInput { - s.InputParameters = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkflowInput) SetName(v string) *CreateWorkflowInput { - s.Name = &v - return s -} - -// SetStepTargets sets the StepTargets field's value. -func (s *CreateWorkflowInput) SetStepTargets(v []*string) *CreateWorkflowInput { - s.StepTargets = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateWorkflowInput) SetTags(v map[string]*string) *CreateWorkflowInput { - s.Tags = v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *CreateWorkflowInput) SetTemplateId(v string) *CreateWorkflowInput { - s.TemplateId = &v - return s -} - -type CreateWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The configuration ID of the application configured in Application Discovery - // Service. - AdsApplicationConfigurationId *string `locationName:"adsApplicationConfigurationId" type:"string"` - - // The Amazon Resource Name (ARN) of the migration workflow. - Arn *string `locationName:"arn" type:"string"` - - // The time at which the migration workflow was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The description of the migration workflow. - Description *string `locationName:"description" type:"string"` - - // The ID of the migration workflow. - Id *string `locationName:"id" min:"1" type:"string"` - - // The name of the migration workflow. - Name *string `locationName:"name" type:"string"` - - // The status of the migration workflow. - Status *string `locationName:"status" type:"string" enum:"MigrationWorkflowStatusEnum"` - - // The servers on which a step will be run. - StepTargets []*string `locationName:"stepTargets" type:"list"` - - // The tags to add on a migration workflow. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The ID of the template. - TemplateId *string `locationName:"templateId" type:"string"` - - // The inputs for creating a migration workflow. - // - // WorkflowInputs is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateWorkflowOutput's - // String and GoString methods. - WorkflowInputs map[string]*StepInput_ `locationName:"workflowInputs" type:"map" sensitive:"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 CreateWorkflowOutput) 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 CreateWorkflowOutput) GoString() string { - return s.String() -} - -// SetAdsApplicationConfigurationId sets the AdsApplicationConfigurationId field's value. -func (s *CreateWorkflowOutput) SetAdsApplicationConfigurationId(v string) *CreateWorkflowOutput { - s.AdsApplicationConfigurationId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *CreateWorkflowOutput) SetArn(v string) *CreateWorkflowOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreateWorkflowOutput) SetCreationTime(v time.Time) *CreateWorkflowOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateWorkflowOutput) SetDescription(v string) *CreateWorkflowOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateWorkflowOutput) SetId(v string) *CreateWorkflowOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkflowOutput) SetName(v string) *CreateWorkflowOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateWorkflowOutput) SetStatus(v string) *CreateWorkflowOutput { - s.Status = &v - return s -} - -// SetStepTargets sets the StepTargets field's value. -func (s *CreateWorkflowOutput) SetStepTargets(v []*string) *CreateWorkflowOutput { - s.StepTargets = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateWorkflowOutput) SetTags(v map[string]*string) *CreateWorkflowOutput { - s.Tags = v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *CreateWorkflowOutput) SetTemplateId(v string) *CreateWorkflowOutput { - s.TemplateId = &v - return s -} - -// SetWorkflowInputs sets the WorkflowInputs field's value. -func (s *CreateWorkflowOutput) SetWorkflowInputs(v map[string]*StepInput_) *CreateWorkflowOutput { - s.WorkflowInputs = v - return s -} - -type CreateWorkflowStepGroupInput struct { - _ struct{} `type:"structure"` - - // The description of the step group. - Description *string `locationName:"description" type:"string"` - - // The name of the step group. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The next step group. - Next []*string `locationName:"next" type:"list"` - - // The previous step group. - Previous []*string `locationName:"previous" type:"list"` - - // The ID of the migration workflow that will contain the step group. - // - // WorkflowId is a required field - WorkflowId *string `locationName:"workflowId" min:"1" 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 CreateWorkflowStepGroupInput) 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 CreateWorkflowStepGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkflowStepGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkflowStepGroupInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateWorkflowStepGroupInput) SetDescription(v string) *CreateWorkflowStepGroupInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkflowStepGroupInput) SetName(v string) *CreateWorkflowStepGroupInput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *CreateWorkflowStepGroupInput) SetNext(v []*string) *CreateWorkflowStepGroupInput { - s.Next = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *CreateWorkflowStepGroupInput) SetPrevious(v []*string) *CreateWorkflowStepGroupInput { - s.Previous = v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *CreateWorkflowStepGroupInput) SetWorkflowId(v string) *CreateWorkflowStepGroupInput { - s.WorkflowId = &v - return s -} - -type CreateWorkflowStepGroupOutput struct { - _ struct{} `type:"structure"` - - // The time at which the step group is created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The description of the step group. - Description *string `locationName:"description" type:"string"` - - // The ID of the step group. - Id *string `locationName:"id" type:"string"` - - // The name of the step group. - Name *string `locationName:"name" type:"string"` - - // The next step group. - Next []*string `locationName:"next" type:"list"` - - // The previous step group. - Previous []*string `locationName:"previous" type:"list"` - - // List of AWS services utilized in a migration workflow. - Tools []*Tool `locationName:"tools" type:"list"` - - // The ID of the migration workflow that contains the step group. - WorkflowId *string `locationName:"workflowId" 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 CreateWorkflowStepGroupOutput) 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 CreateWorkflowStepGroupOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreateWorkflowStepGroupOutput) SetCreationTime(v time.Time) *CreateWorkflowStepGroupOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateWorkflowStepGroupOutput) SetDescription(v string) *CreateWorkflowStepGroupOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateWorkflowStepGroupOutput) SetId(v string) *CreateWorkflowStepGroupOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkflowStepGroupOutput) SetName(v string) *CreateWorkflowStepGroupOutput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *CreateWorkflowStepGroupOutput) SetNext(v []*string) *CreateWorkflowStepGroupOutput { - s.Next = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *CreateWorkflowStepGroupOutput) SetPrevious(v []*string) *CreateWorkflowStepGroupOutput { - s.Previous = v - return s -} - -// SetTools sets the Tools field's value. -func (s *CreateWorkflowStepGroupOutput) SetTools(v []*Tool) *CreateWorkflowStepGroupOutput { - s.Tools = v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *CreateWorkflowStepGroupOutput) SetWorkflowId(v string) *CreateWorkflowStepGroupOutput { - s.WorkflowId = &v - return s -} - -type CreateWorkflowStepInput struct { - _ struct{} `type:"structure"` - - // The description of the step. - Description *string `locationName:"description" type:"string"` - - // The name of the step. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The next step. - Next []*string `locationName:"next" type:"list"` - - // The key value pairs added for the expected output. - Outputs []*WorkflowStepOutput_ `locationName:"outputs" type:"list"` - - // The previous step. - Previous []*string `locationName:"previous" type:"list"` - - // The action type of the step. You must run and update the status of a manual - // step for the workflow to continue after the completion of the step. - // - // StepActionType is a required field - StepActionType *string `locationName:"stepActionType" type:"string" required:"true" enum:"StepActionType"` - - // The ID of the step group. - // - // StepGroupId is a required field - StepGroupId *string `locationName:"stepGroupId" min:"1" type:"string" required:"true"` - - // The servers on which a step will be run. - StepTarget []*string `locationName:"stepTarget" type:"list"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `locationName:"workflowId" min:"1" type:"string" required:"true"` - - // The custom script to run tests on source or target environments. - WorkflowStepAutomationConfiguration *WorkflowStepAutomationConfiguration `locationName:"workflowStepAutomationConfiguration" 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 CreateWorkflowStepInput) 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 CreateWorkflowStepInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkflowStepInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkflowStepInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.StepActionType == nil { - invalidParams.Add(request.NewErrParamRequired("StepActionType")) - } - if s.StepGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("StepGroupId")) - } - if s.StepGroupId != nil && len(*s.StepGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StepGroupId", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - if s.Outputs != nil { - for i, v := range s.Outputs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Outputs", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateWorkflowStepInput) SetDescription(v string) *CreateWorkflowStepInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkflowStepInput) SetName(v string) *CreateWorkflowStepInput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *CreateWorkflowStepInput) SetNext(v []*string) *CreateWorkflowStepInput { - s.Next = v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *CreateWorkflowStepInput) SetOutputs(v []*WorkflowStepOutput_) *CreateWorkflowStepInput { - s.Outputs = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *CreateWorkflowStepInput) SetPrevious(v []*string) *CreateWorkflowStepInput { - s.Previous = v - return s -} - -// SetStepActionType sets the StepActionType field's value. -func (s *CreateWorkflowStepInput) SetStepActionType(v string) *CreateWorkflowStepInput { - s.StepActionType = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *CreateWorkflowStepInput) SetStepGroupId(v string) *CreateWorkflowStepInput { - s.StepGroupId = &v - return s -} - -// SetStepTarget sets the StepTarget field's value. -func (s *CreateWorkflowStepInput) SetStepTarget(v []*string) *CreateWorkflowStepInput { - s.StepTarget = v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *CreateWorkflowStepInput) SetWorkflowId(v string) *CreateWorkflowStepInput { - s.WorkflowId = &v - return s -} - -// SetWorkflowStepAutomationConfiguration sets the WorkflowStepAutomationConfiguration field's value. -func (s *CreateWorkflowStepInput) SetWorkflowStepAutomationConfiguration(v *WorkflowStepAutomationConfiguration) *CreateWorkflowStepInput { - s.WorkflowStepAutomationConfiguration = v - return s -} - -type CreateWorkflowStepOutput struct { - _ struct{} `type:"structure"` - - // The ID of the step. - Id *string `locationName:"id" type:"string"` - - // The name of the step. - Name *string `locationName:"name" type:"string"` - - // The ID of the step group. - StepGroupId *string `locationName:"stepGroupId" type:"string"` - - // The ID of the migration workflow. - WorkflowId *string `locationName:"workflowId" 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 CreateWorkflowStepOutput) 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 CreateWorkflowStepOutput) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *CreateWorkflowStepOutput) SetId(v string) *CreateWorkflowStepOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkflowStepOutput) SetName(v string) *CreateWorkflowStepOutput { - s.Name = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *CreateWorkflowStepOutput) SetStepGroupId(v string) *CreateWorkflowStepOutput { - s.StepGroupId = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *CreateWorkflowStepOutput) SetWorkflowId(v string) *CreateWorkflowStepOutput { - s.WorkflowId = &v - return s -} - -type DeleteWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the migration workflow you want to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 DeleteWorkflowInput) 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 DeleteWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkflowInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteWorkflowInput) SetId(v string) *DeleteWorkflowInput { - s.Id = &v - return s -} - -type DeleteWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the migration workflow. - Arn *string `locationName:"arn" type:"string"` - - // The ID of the migration workflow. - Id *string `locationName:"id" min:"1" type:"string"` - - // The status of the migration workflow. - Status *string `locationName:"status" type:"string" enum:"MigrationWorkflowStatusEnum"` -} - -// 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 DeleteWorkflowOutput) 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 DeleteWorkflowOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteWorkflowOutput) SetArn(v string) *DeleteWorkflowOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteWorkflowOutput) SetId(v string) *DeleteWorkflowOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteWorkflowOutput) SetStatus(v string) *DeleteWorkflowOutput { - s.Status = &v - return s -} - -type DeleteWorkflowStepGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the step group you want to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `location:"querystring" locationName:"workflowId" min:"1" 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 DeleteWorkflowStepGroupInput) 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 DeleteWorkflowStepGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkflowStepGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkflowStepGroupInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteWorkflowStepGroupInput) SetId(v string) *DeleteWorkflowStepGroupInput { - s.Id = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *DeleteWorkflowStepGroupInput) SetWorkflowId(v string) *DeleteWorkflowStepGroupInput { - s.WorkflowId = &v - return s -} - -type DeleteWorkflowStepGroupOutput 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 DeleteWorkflowStepGroupOutput) 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 DeleteWorkflowStepGroupOutput) GoString() string { - return s.String() -} - -type DeleteWorkflowStepInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the step you want to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The ID of the step group that contains the step you want to delete. - // - // StepGroupId is a required field - StepGroupId *string `location:"querystring" locationName:"stepGroupId" min:"1" type:"string" required:"true"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `location:"querystring" locationName:"workflowId" min:"1" 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 DeleteWorkflowStepInput) 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 DeleteWorkflowStepInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkflowStepInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkflowStepInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.StepGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("StepGroupId")) - } - if s.StepGroupId != nil && len(*s.StepGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StepGroupId", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteWorkflowStepInput) SetId(v string) *DeleteWorkflowStepInput { - s.Id = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *DeleteWorkflowStepInput) SetStepGroupId(v string) *DeleteWorkflowStepInput { - s.StepGroupId = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *DeleteWorkflowStepInput) SetWorkflowId(v string) *DeleteWorkflowStepInput { - s.WorkflowId = &v - return s -} - -type DeleteWorkflowStepOutput 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 DeleteWorkflowStepOutput) 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 DeleteWorkflowStepOutput) GoString() string { - return s.String() -} - -type GetTemplateInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the template. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 GetTemplateInput) 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 GetTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetTemplateInput) SetId(v string) *GetTemplateInput { - s.Id = &v - return s -} - -type GetTemplateOutput struct { - _ struct{} `type:"structure"` - - // The time at which the template was last created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The time at which the template was last created. - Description *string `locationName:"description" type:"string"` - - // The ID of the template. - Id *string `locationName:"id" type:"string"` - - // The inputs provided for the creation of the migration workflow. - Inputs []*TemplateInput_ `locationName:"inputs" type:"list"` - - // The name of the template. - Name *string `locationName:"name" type:"string"` - - // The status of the template. - Status *string `locationName:"status" type:"string" enum:"TemplateStatus"` - - // List of AWS services utilized in a migration workflow. - Tools []*Tool `locationName:"tools" type:"list"` -} - -// 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 GetTemplateOutput) 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 GetTemplateOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetTemplateOutput) SetCreationTime(v time.Time) *GetTemplateOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetTemplateOutput) SetDescription(v string) *GetTemplateOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetTemplateOutput) SetId(v string) *GetTemplateOutput { - s.Id = &v - return s -} - -// SetInputs sets the Inputs field's value. -func (s *GetTemplateOutput) SetInputs(v []*TemplateInput_) *GetTemplateOutput { - s.Inputs = v - return s -} - -// SetName sets the Name field's value. -func (s *GetTemplateOutput) SetName(v string) *GetTemplateOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetTemplateOutput) SetStatus(v string) *GetTemplateOutput { - s.Status = &v - return s -} - -// SetTools sets the Tools field's value. -func (s *GetTemplateOutput) SetTools(v []*Tool) *GetTemplateOutput { - s.Tools = v - return s -} - -type GetTemplateStepGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the step group. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The ID of the template. - // - // TemplateId is a required field - TemplateId *string `location:"uri" locationName:"templateId" min:"1" 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 GetTemplateStepGroupInput) 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 GetTemplateStepGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateStepGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateStepGroupInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.TemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateId")) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetTemplateStepGroupInput) SetId(v string) *GetTemplateStepGroupInput { - s.Id = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *GetTemplateStepGroupInput) SetTemplateId(v string) *GetTemplateStepGroupInput { - s.TemplateId = &v - return s -} - -type GetTemplateStepGroupOutput struct { - _ struct{} `type:"structure"` - - // The time at which the step group was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The description of the step group. - Description *string `locationName:"description" type:"string"` - - // The ID of the step group. - Id *string `locationName:"id" type:"string"` - - // The time at which the step group was last modified. - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp"` - - // The name of the step group. - Name *string `locationName:"name" type:"string"` - - // The next step group. - Next []*string `locationName:"next" type:"list"` - - // The previous step group. - Previous []*string `locationName:"previous" type:"list"` - - // The status of the step group. - Status *string `locationName:"status" type:"string" enum:"StepGroupStatus"` - - // The ID of the template. - TemplateId *string `locationName:"templateId" type:"string"` - - // List of AWS services utilized in a migration workflow. - Tools []*Tool `locationName:"tools" type:"list"` -} - -// 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 GetTemplateStepGroupOutput) 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 GetTemplateStepGroupOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetTemplateStepGroupOutput) SetCreationTime(v time.Time) *GetTemplateStepGroupOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetTemplateStepGroupOutput) SetDescription(v string) *GetTemplateStepGroupOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetTemplateStepGroupOutput) SetId(v string) *GetTemplateStepGroupOutput { - s.Id = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *GetTemplateStepGroupOutput) SetLastModifiedTime(v time.Time) *GetTemplateStepGroupOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetTemplateStepGroupOutput) SetName(v string) *GetTemplateStepGroupOutput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *GetTemplateStepGroupOutput) SetNext(v []*string) *GetTemplateStepGroupOutput { - s.Next = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *GetTemplateStepGroupOutput) SetPrevious(v []*string) *GetTemplateStepGroupOutput { - s.Previous = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetTemplateStepGroupOutput) SetStatus(v string) *GetTemplateStepGroupOutput { - s.Status = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *GetTemplateStepGroupOutput) SetTemplateId(v string) *GetTemplateStepGroupOutput { - s.TemplateId = &v - return s -} - -// SetTools sets the Tools field's value. -func (s *GetTemplateStepGroupOutput) SetTools(v []*Tool) *GetTemplateStepGroupOutput { - s.Tools = v - return s -} - -type GetTemplateStepInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the step. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The ID of the step group. - // - // StepGroupId is a required field - StepGroupId *string `location:"querystring" locationName:"stepGroupId" min:"1" type:"string" required:"true"` - - // The ID of the template. - // - // TemplateId is a required field - TemplateId *string `location:"querystring" locationName:"templateId" min:"1" 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 GetTemplateStepInput) 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 GetTemplateStepInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateStepInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateStepInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.StepGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("StepGroupId")) - } - if s.StepGroupId != nil && len(*s.StepGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StepGroupId", 1)) - } - if s.TemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateId")) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetTemplateStepInput) SetId(v string) *GetTemplateStepInput { - s.Id = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *GetTemplateStepInput) SetStepGroupId(v string) *GetTemplateStepInput { - s.StepGroupId = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *GetTemplateStepInput) SetTemplateId(v string) *GetTemplateStepInput { - s.TemplateId = &v - return s -} - -type GetTemplateStepOutput struct { - _ struct{} `type:"structure"` - - // The time at which the step was created. - CreationTime *string `locationName:"creationTime" type:"string"` - - // The description of the step. - Description *string `locationName:"description" type:"string"` - - // The ID of the step. - Id *string `locationName:"id" min:"1" type:"string"` - - // The name of the step. - Name *string `locationName:"name" type:"string"` - - // The next step. - Next []*string `locationName:"next" type:"list"` - - // The outputs of the step. - Outputs []*StepOutput_ `locationName:"outputs" type:"list"` - - // The previous step. - Previous []*string `locationName:"previous" type:"list"` - - // The action type of the step. You must run and update the status of a manual - // step for the workflow to continue after the completion of the step. - StepActionType *string `locationName:"stepActionType" type:"string" enum:"StepActionType"` - - // The custom script to run tests on source or target environments. - StepAutomationConfiguration *StepAutomationConfiguration `locationName:"stepAutomationConfiguration" type:"structure"` - - // The ID of the step group. - StepGroupId *string `locationName:"stepGroupId" min:"1" type:"string"` - - // The ID of the template. - TemplateId *string `locationName:"templateId" min:"1" 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 GetTemplateStepOutput) 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 GetTemplateStepOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetTemplateStepOutput) SetCreationTime(v string) *GetTemplateStepOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetTemplateStepOutput) SetDescription(v string) *GetTemplateStepOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetTemplateStepOutput) SetId(v string) *GetTemplateStepOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetTemplateStepOutput) SetName(v string) *GetTemplateStepOutput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *GetTemplateStepOutput) SetNext(v []*string) *GetTemplateStepOutput { - s.Next = v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *GetTemplateStepOutput) SetOutputs(v []*StepOutput_) *GetTemplateStepOutput { - s.Outputs = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *GetTemplateStepOutput) SetPrevious(v []*string) *GetTemplateStepOutput { - s.Previous = v - return s -} - -// SetStepActionType sets the StepActionType field's value. -func (s *GetTemplateStepOutput) SetStepActionType(v string) *GetTemplateStepOutput { - s.StepActionType = &v - return s -} - -// SetStepAutomationConfiguration sets the StepAutomationConfiguration field's value. -func (s *GetTemplateStepOutput) SetStepAutomationConfiguration(v *StepAutomationConfiguration) *GetTemplateStepOutput { - s.StepAutomationConfiguration = v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *GetTemplateStepOutput) SetStepGroupId(v string) *GetTemplateStepOutput { - s.StepGroupId = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *GetTemplateStepOutput) SetTemplateId(v string) *GetTemplateStepOutput { - s.TemplateId = &v - return s -} - -type GetWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the migration workflow. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 GetWorkflowInput) 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 GetWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWorkflowInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetWorkflowInput) SetId(v string) *GetWorkflowInput { - s.Id = &v - return s -} - -type GetWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The configuration ID of the application configured in Application Discovery - // Service. - AdsApplicationConfigurationId *string `locationName:"adsApplicationConfigurationId" type:"string"` - - // The name of the application configured in Application Discovery Service. - AdsApplicationName *string `locationName:"adsApplicationName" type:"string"` - - // The Amazon Resource Name (ARN) of the migration workflow. - Arn *string `locationName:"arn" type:"string"` - - // Get a list of completed steps in the migration workflow. - CompletedSteps *int64 `locationName:"completedSteps" type:"integer"` - - // The time at which the migration workflow was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The description of the migration workflow. - Description *string `locationName:"description" type:"string"` - - // The time at which the migration workflow ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // The ID of the migration workflow. - Id *string `locationName:"id" min:"1" type:"string"` - - // The time at which the migration workflow was last modified. - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp"` - - // The time at which the migration workflow was last started. - LastStartTime *time.Time `locationName:"lastStartTime" type:"timestamp"` - - // The time at which the migration workflow was last stopped. - LastStopTime *time.Time `locationName:"lastStopTime" type:"timestamp"` - - // The name of the migration workflow. - Name *string `locationName:"name" type:"string"` - - // The status of the migration workflow. - Status *string `locationName:"status" type:"string" enum:"MigrationWorkflowStatusEnum"` - - // The status message of the migration workflow. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The tags added to the migration workflow. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The ID of the template. - TemplateId *string `locationName:"templateId" type:"string"` - - // List of AWS services utilized in a migration workflow. - Tools []*Tool `locationName:"tools" type:"list"` - - // The total number of steps in the migration workflow. - TotalSteps *int64 `locationName:"totalSteps" type:"integer"` - - // The Amazon S3 bucket where the migration logs are stored. - WorkflowBucket *string `locationName:"workflowBucket" type:"string"` - - // The inputs required for creating the migration workflow. - // - // WorkflowInputs is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetWorkflowOutput's - // String and GoString methods. - WorkflowInputs map[string]*StepInput_ `locationName:"workflowInputs" type:"map" sensitive:"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 GetWorkflowOutput) 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 GetWorkflowOutput) GoString() string { - return s.String() -} - -// SetAdsApplicationConfigurationId sets the AdsApplicationConfigurationId field's value. -func (s *GetWorkflowOutput) SetAdsApplicationConfigurationId(v string) *GetWorkflowOutput { - s.AdsApplicationConfigurationId = &v - return s -} - -// SetAdsApplicationName sets the AdsApplicationName field's value. -func (s *GetWorkflowOutput) SetAdsApplicationName(v string) *GetWorkflowOutput { - s.AdsApplicationName = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetWorkflowOutput) SetArn(v string) *GetWorkflowOutput { - s.Arn = &v - return s -} - -// SetCompletedSteps sets the CompletedSteps field's value. -func (s *GetWorkflowOutput) SetCompletedSteps(v int64) *GetWorkflowOutput { - s.CompletedSteps = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetWorkflowOutput) SetCreationTime(v time.Time) *GetWorkflowOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetWorkflowOutput) SetDescription(v string) *GetWorkflowOutput { - s.Description = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *GetWorkflowOutput) SetEndTime(v time.Time) *GetWorkflowOutput { - s.EndTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetWorkflowOutput) SetId(v string) *GetWorkflowOutput { - s.Id = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *GetWorkflowOutput) SetLastModifiedTime(v time.Time) *GetWorkflowOutput { - s.LastModifiedTime = &v - return s -} - -// SetLastStartTime sets the LastStartTime field's value. -func (s *GetWorkflowOutput) SetLastStartTime(v time.Time) *GetWorkflowOutput { - s.LastStartTime = &v - return s -} - -// SetLastStopTime sets the LastStopTime field's value. -func (s *GetWorkflowOutput) SetLastStopTime(v time.Time) *GetWorkflowOutput { - s.LastStopTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetWorkflowOutput) SetName(v string) *GetWorkflowOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetWorkflowOutput) SetStatus(v string) *GetWorkflowOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetWorkflowOutput) SetStatusMessage(v string) *GetWorkflowOutput { - s.StatusMessage = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetWorkflowOutput) SetTags(v map[string]*string) *GetWorkflowOutput { - s.Tags = v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *GetWorkflowOutput) SetTemplateId(v string) *GetWorkflowOutput { - s.TemplateId = &v - return s -} - -// SetTools sets the Tools field's value. -func (s *GetWorkflowOutput) SetTools(v []*Tool) *GetWorkflowOutput { - s.Tools = v - return s -} - -// SetTotalSteps sets the TotalSteps field's value. -func (s *GetWorkflowOutput) SetTotalSteps(v int64) *GetWorkflowOutput { - s.TotalSteps = &v - return s -} - -// SetWorkflowBucket sets the WorkflowBucket field's value. -func (s *GetWorkflowOutput) SetWorkflowBucket(v string) *GetWorkflowOutput { - s.WorkflowBucket = &v - return s -} - -// SetWorkflowInputs sets the WorkflowInputs field's value. -func (s *GetWorkflowOutput) SetWorkflowInputs(v map[string]*StepInput_) *GetWorkflowOutput { - s.WorkflowInputs = v - return s -} - -type GetWorkflowStepGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the step group. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `location:"querystring" locationName:"workflowId" min:"1" 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 GetWorkflowStepGroupInput) 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 GetWorkflowStepGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWorkflowStepGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWorkflowStepGroupInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetWorkflowStepGroupInput) SetId(v string) *GetWorkflowStepGroupInput { - s.Id = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *GetWorkflowStepGroupInput) SetWorkflowId(v string) *GetWorkflowStepGroupInput { - s.WorkflowId = &v - return s -} - -type GetWorkflowStepGroupOutput struct { - _ struct{} `type:"structure"` - - // The time at which the step group was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The description of the step group. - Description *string `locationName:"description" type:"string"` - - // The time at which the step group ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // The ID of the step group. - Id *string `locationName:"id" min:"1" type:"string"` - - // The time at which the step group was last modified. - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp"` - - // The name of the step group. - Name *string `locationName:"name" type:"string"` - - // The next step group. - Next []*string `locationName:"next" type:"list"` - - // The owner of the step group. - Owner *string `locationName:"owner" type:"string" enum:"Owner"` - - // The previous step group. - Previous []*string `locationName:"previous" type:"list"` - - // The status of the step group. - Status *string `locationName:"status" type:"string" enum:"StepGroupStatus"` - - // List of AWS services utilized in a migration workflow. - Tools []*Tool `locationName:"tools" type:"list"` - - // The ID of the migration workflow. - WorkflowId *string `locationName:"workflowId" 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 GetWorkflowStepGroupOutput) 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 GetWorkflowStepGroupOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetWorkflowStepGroupOutput) SetCreationTime(v time.Time) *GetWorkflowStepGroupOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetWorkflowStepGroupOutput) SetDescription(v string) *GetWorkflowStepGroupOutput { - s.Description = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *GetWorkflowStepGroupOutput) SetEndTime(v time.Time) *GetWorkflowStepGroupOutput { - s.EndTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetWorkflowStepGroupOutput) SetId(v string) *GetWorkflowStepGroupOutput { - s.Id = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *GetWorkflowStepGroupOutput) SetLastModifiedTime(v time.Time) *GetWorkflowStepGroupOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetWorkflowStepGroupOutput) SetName(v string) *GetWorkflowStepGroupOutput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *GetWorkflowStepGroupOutput) SetNext(v []*string) *GetWorkflowStepGroupOutput { - s.Next = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *GetWorkflowStepGroupOutput) SetOwner(v string) *GetWorkflowStepGroupOutput { - s.Owner = &v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *GetWorkflowStepGroupOutput) SetPrevious(v []*string) *GetWorkflowStepGroupOutput { - s.Previous = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetWorkflowStepGroupOutput) SetStatus(v string) *GetWorkflowStepGroupOutput { - s.Status = &v - return s -} - -// SetTools sets the Tools field's value. -func (s *GetWorkflowStepGroupOutput) SetTools(v []*Tool) *GetWorkflowStepGroupOutput { - s.Tools = v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *GetWorkflowStepGroupOutput) SetWorkflowId(v string) *GetWorkflowStepGroupOutput { - s.WorkflowId = &v - return s -} - -type GetWorkflowStepInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the step. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // desThe ID of the step group. - // - // StepGroupId is a required field - StepGroupId *string `location:"querystring" locationName:"stepGroupId" min:"1" type:"string" required:"true"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `location:"querystring" locationName:"workflowId" min:"1" 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 GetWorkflowStepInput) 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 GetWorkflowStepInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWorkflowStepInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWorkflowStepInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.StepGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("StepGroupId")) - } - if s.StepGroupId != nil && len(*s.StepGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StepGroupId", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetWorkflowStepInput) SetId(v string) *GetWorkflowStepInput { - s.Id = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *GetWorkflowStepInput) SetStepGroupId(v string) *GetWorkflowStepInput { - s.StepGroupId = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *GetWorkflowStepInput) SetWorkflowId(v string) *GetWorkflowStepInput { - s.WorkflowId = &v - return s -} - -type GetWorkflowStepOutput struct { - _ struct{} `type:"structure"` - - // The time at which the step was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The description of the step. - Description *string `locationName:"description" type:"string"` - - // The time at which the step ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // The time at which the workflow was last started. - LastStartTime *time.Time `locationName:"lastStartTime" type:"timestamp"` - - // The name of the step. - Name *string `locationName:"name" type:"string"` - - // The next step. - Next []*string `locationName:"next" type:"list"` - - // The number of servers that have been migrated. - NoOfSrvCompleted *int64 `locationName:"noOfSrvCompleted" type:"integer"` - - // The number of servers that have failed to migrate. - NoOfSrvFailed *int64 `locationName:"noOfSrvFailed" type:"integer"` - - // The outputs of the step. - Outputs []*WorkflowStepOutput_ `locationName:"outputs" type:"list"` - - // The owner of the step. - Owner *string `locationName:"owner" type:"string" enum:"Owner"` - - // The previous step. - Previous []*string `locationName:"previous" type:"list"` - - // The output location of the script. - ScriptOutputLocation *string `locationName:"scriptOutputLocation" type:"string"` - - // The status of the step. - Status *string `locationName:"status" type:"string" enum:"StepStatus"` - - // The status message of the migration workflow. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The action type of the step. You must run and update the status of a manual - // step for the workflow to continue after the completion of the step. - StepActionType *string `locationName:"stepActionType" type:"string" enum:"StepActionType"` - - // The ID of the step group. - StepGroupId *string `locationName:"stepGroupId" type:"string"` - - // The ID of the step. - StepId *string `locationName:"stepId" type:"string"` - - // The servers on which a step will be run. - StepTarget []*string `locationName:"stepTarget" type:"list"` - - // The total number of servers that have been migrated. - TotalNoOfSrv *int64 `locationName:"totalNoOfSrv" type:"integer"` - - // The ID of the migration workflow. - WorkflowId *string `locationName:"workflowId" type:"string"` - - // The custom script to run tests on source or target environments. - WorkflowStepAutomationConfiguration *WorkflowStepAutomationConfiguration `locationName:"workflowStepAutomationConfiguration" 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 GetWorkflowStepOutput) 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 GetWorkflowStepOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetWorkflowStepOutput) SetCreationTime(v time.Time) *GetWorkflowStepOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetWorkflowStepOutput) SetDescription(v string) *GetWorkflowStepOutput { - s.Description = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *GetWorkflowStepOutput) SetEndTime(v time.Time) *GetWorkflowStepOutput { - s.EndTime = &v - return s -} - -// SetLastStartTime sets the LastStartTime field's value. -func (s *GetWorkflowStepOutput) SetLastStartTime(v time.Time) *GetWorkflowStepOutput { - s.LastStartTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetWorkflowStepOutput) SetName(v string) *GetWorkflowStepOutput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *GetWorkflowStepOutput) SetNext(v []*string) *GetWorkflowStepOutput { - s.Next = v - return s -} - -// SetNoOfSrvCompleted sets the NoOfSrvCompleted field's value. -func (s *GetWorkflowStepOutput) SetNoOfSrvCompleted(v int64) *GetWorkflowStepOutput { - s.NoOfSrvCompleted = &v - return s -} - -// SetNoOfSrvFailed sets the NoOfSrvFailed field's value. -func (s *GetWorkflowStepOutput) SetNoOfSrvFailed(v int64) *GetWorkflowStepOutput { - s.NoOfSrvFailed = &v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *GetWorkflowStepOutput) SetOutputs(v []*WorkflowStepOutput_) *GetWorkflowStepOutput { - s.Outputs = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *GetWorkflowStepOutput) SetOwner(v string) *GetWorkflowStepOutput { - s.Owner = &v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *GetWorkflowStepOutput) SetPrevious(v []*string) *GetWorkflowStepOutput { - s.Previous = v - return s -} - -// SetScriptOutputLocation sets the ScriptOutputLocation field's value. -func (s *GetWorkflowStepOutput) SetScriptOutputLocation(v string) *GetWorkflowStepOutput { - s.ScriptOutputLocation = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetWorkflowStepOutput) SetStatus(v string) *GetWorkflowStepOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetWorkflowStepOutput) SetStatusMessage(v string) *GetWorkflowStepOutput { - s.StatusMessage = &v - return s -} - -// SetStepActionType sets the StepActionType field's value. -func (s *GetWorkflowStepOutput) SetStepActionType(v string) *GetWorkflowStepOutput { - s.StepActionType = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *GetWorkflowStepOutput) SetStepGroupId(v string) *GetWorkflowStepOutput { - s.StepGroupId = &v - return s -} - -// SetStepId sets the StepId field's value. -func (s *GetWorkflowStepOutput) SetStepId(v string) *GetWorkflowStepOutput { - s.StepId = &v - return s -} - -// SetStepTarget sets the StepTarget field's value. -func (s *GetWorkflowStepOutput) SetStepTarget(v []*string) *GetWorkflowStepOutput { - s.StepTarget = v - return s -} - -// SetTotalNoOfSrv sets the TotalNoOfSrv field's value. -func (s *GetWorkflowStepOutput) SetTotalNoOfSrv(v int64) *GetWorkflowStepOutput { - s.TotalNoOfSrv = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *GetWorkflowStepOutput) SetWorkflowId(v string) *GetWorkflowStepOutput { - s.WorkflowId = &v - return s -} - -// SetWorkflowStepAutomationConfiguration sets the WorkflowStepAutomationConfiguration field's value. -func (s *GetWorkflowStepOutput) SetWorkflowStepAutomationConfiguration(v *WorkflowStepAutomationConfiguration) *GetWorkflowStepOutput { - s.WorkflowStepAutomationConfiguration = v - return s -} - -// An internal error has occurred. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListPluginsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of plugins that can be returned. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The pagination token. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListPluginsInput) 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 ListPluginsInput) GoString() string { - return s.String() -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPluginsInput) SetMaxResults(v int64) *ListPluginsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPluginsInput) SetNextToken(v string) *ListPluginsInput { - s.NextToken = &v - return s -} - -type ListPluginsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token. - NextToken *string `locationName:"nextToken" type:"string"` - - // Migration Hub Orchestrator plugins. - Plugins []*PluginSummary `locationName:"plugins" type:"list"` -} - -// 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 ListPluginsOutput) 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 ListPluginsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPluginsOutput) SetNextToken(v string) *ListPluginsOutput { - s.NextToken = &v - return s -} - -// SetPlugins sets the Plugins field's value. -func (s *ListPluginsOutput) SetPlugins(v []*PluginSummary) *ListPluginsOutput { - s.Plugins = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags added to a resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListTemplateStepGroupsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that can be returned. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The pagination token. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The ID of the template. - // - // TemplateId is a required field - TemplateId *string `location:"uri" locationName:"templateId" min:"1" 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 ListTemplateStepGroupsInput) 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 ListTemplateStepGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTemplateStepGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTemplateStepGroupsInput"} - if s.TemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateId")) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTemplateStepGroupsInput) SetMaxResults(v int64) *ListTemplateStepGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplateStepGroupsInput) SetNextToken(v string) *ListTemplateStepGroupsInput { - s.NextToken = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *ListTemplateStepGroupsInput) SetTemplateId(v string) *ListTemplateStepGroupsInput { - s.TemplateId = &v - return s -} - -type ListTemplateStepGroupsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token. - NextToken *string `locationName:"nextToken" type:"string"` - - // The summary of the step group in the template. - // - // TemplateStepGroupSummary is a required field - TemplateStepGroupSummary []*TemplateStepGroupSummary `locationName:"templateStepGroupSummary" type:"list" 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 ListTemplateStepGroupsOutput) 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 ListTemplateStepGroupsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplateStepGroupsOutput) SetNextToken(v string) *ListTemplateStepGroupsOutput { - s.NextToken = &v - return s -} - -// SetTemplateStepGroupSummary sets the TemplateStepGroupSummary field's value. -func (s *ListTemplateStepGroupsOutput) SetTemplateStepGroupSummary(v []*TemplateStepGroupSummary) *ListTemplateStepGroupsOutput { - s.TemplateStepGroupSummary = v - return s -} - -type ListTemplateStepsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that can be returned. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The pagination token. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The ID of the step group. - // - // StepGroupId is a required field - StepGroupId *string `location:"querystring" locationName:"stepGroupId" min:"1" type:"string" required:"true"` - - // The ID of the template. - // - // TemplateId is a required field - TemplateId *string `location:"querystring" locationName:"templateId" min:"1" 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 ListTemplateStepsInput) 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 ListTemplateStepsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTemplateStepsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTemplateStepsInput"} - if s.StepGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("StepGroupId")) - } - if s.StepGroupId != nil && len(*s.StepGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StepGroupId", 1)) - } - if s.TemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateId")) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTemplateStepsInput) SetMaxResults(v int64) *ListTemplateStepsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplateStepsInput) SetNextToken(v string) *ListTemplateStepsInput { - s.NextToken = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *ListTemplateStepsInput) SetStepGroupId(v string) *ListTemplateStepsInput { - s.StepGroupId = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *ListTemplateStepsInput) SetTemplateId(v string) *ListTemplateStepsInput { - s.TemplateId = &v - return s -} - -type ListTemplateStepsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token. - NextToken *string `locationName:"nextToken" type:"string"` - - // The list of summaries of steps in a template. - TemplateStepSummaryList []*TemplateStepSummary `locationName:"templateStepSummaryList" type:"list"` -} - -// 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 ListTemplateStepsOutput) 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 ListTemplateStepsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplateStepsOutput) SetNextToken(v string) *ListTemplateStepsOutput { - s.NextToken = &v - return s -} - -// SetTemplateStepSummaryList sets the TemplateStepSummaryList field's value. -func (s *ListTemplateStepsOutput) SetTemplateStepSummaryList(v []*TemplateStepSummary) *ListTemplateStepsOutput { - s.TemplateStepSummaryList = v - return s -} - -type ListTemplatesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that can be returned. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The name of the template. - Name *string `location:"querystring" locationName:"name" min:"1" type:"string"` - - // The pagination token. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListTemplatesInput) 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 ListTemplatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTemplatesInput"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTemplatesInput) SetMaxResults(v int64) *ListTemplatesInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListTemplatesInput) SetName(v string) *ListTemplatesInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplatesInput) SetNextToken(v string) *ListTemplatesInput { - s.NextToken = &v - return s -} - -type ListTemplatesOutput struct { - _ struct{} `type:"structure"` - - // The pagination token. - NextToken *string `locationName:"nextToken" type:"string"` - - // The summary of the template. - // - // TemplateSummary is a required field - TemplateSummary []*TemplateSummary `locationName:"templateSummary" type:"list" 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 ListTemplatesOutput) 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 ListTemplatesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplatesOutput) SetNextToken(v string) *ListTemplatesOutput { - s.NextToken = &v - return s -} - -// SetTemplateSummary sets the TemplateSummary field's value. -func (s *ListTemplatesOutput) SetTemplateSummary(v []*TemplateSummary) *ListTemplatesOutput { - s.TemplateSummary = v - return s -} - -type ListWorkflowStepGroupsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that can be returned. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The pagination token. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `location:"querystring" locationName:"workflowId" min:"1" 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 ListWorkflowStepGroupsInput) 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 ListWorkflowStepGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkflowStepGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkflowStepGroupsInput"} - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkflowStepGroupsInput) SetMaxResults(v int64) *ListWorkflowStepGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkflowStepGroupsInput) SetNextToken(v string) *ListWorkflowStepGroupsInput { - s.NextToken = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *ListWorkflowStepGroupsInput) SetWorkflowId(v string) *ListWorkflowStepGroupsInput { - s.WorkflowId = &v - return s -} - -type ListWorkflowStepGroupsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token. - NextToken *string `locationName:"nextToken" type:"string"` - - // The summary of step groups in a migration workflow. - // - // WorkflowStepGroupsSummary is a required field - WorkflowStepGroupsSummary []*WorkflowStepGroupSummary `locationName:"workflowStepGroupsSummary" type:"list" 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 ListWorkflowStepGroupsOutput) 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 ListWorkflowStepGroupsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkflowStepGroupsOutput) SetNextToken(v string) *ListWorkflowStepGroupsOutput { - s.NextToken = &v - return s -} - -// SetWorkflowStepGroupsSummary sets the WorkflowStepGroupsSummary field's value. -func (s *ListWorkflowStepGroupsOutput) SetWorkflowStepGroupsSummary(v []*WorkflowStepGroupSummary) *ListWorkflowStepGroupsOutput { - s.WorkflowStepGroupsSummary = v - return s -} - -type ListWorkflowStepsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that can be returned. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The pagination token. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The ID of the step group. - // - // StepGroupId is a required field - StepGroupId *string `location:"uri" locationName:"stepGroupId" min:"1" type:"string" required:"true"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `location:"uri" locationName:"workflowId" min:"1" 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 ListWorkflowStepsInput) 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 ListWorkflowStepsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkflowStepsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkflowStepsInput"} - if s.StepGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("StepGroupId")) - } - if s.StepGroupId != nil && len(*s.StepGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StepGroupId", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkflowStepsInput) SetMaxResults(v int64) *ListWorkflowStepsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkflowStepsInput) SetNextToken(v string) *ListWorkflowStepsInput { - s.NextToken = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *ListWorkflowStepsInput) SetStepGroupId(v string) *ListWorkflowStepsInput { - s.StepGroupId = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *ListWorkflowStepsInput) SetWorkflowId(v string) *ListWorkflowStepsInput { - s.WorkflowId = &v - return s -} - -type ListWorkflowStepsOutput struct { - _ struct{} `type:"structure"` - - // The pagination token. - NextToken *string `locationName:"nextToken" type:"string"` - - // The summary of steps in a migration workflow. - // - // WorkflowStepsSummary is a required field - WorkflowStepsSummary []*WorkflowStepSummary `locationName:"workflowStepsSummary" type:"list" 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 ListWorkflowStepsOutput) 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 ListWorkflowStepsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkflowStepsOutput) SetNextToken(v string) *ListWorkflowStepsOutput { - s.NextToken = &v - return s -} - -// SetWorkflowStepsSummary sets the WorkflowStepsSummary field's value. -func (s *ListWorkflowStepsOutput) SetWorkflowStepsSummary(v []*WorkflowStepSummary) *ListWorkflowStepsOutput { - s.WorkflowStepsSummary = v - return s -} - -type ListWorkflowsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the application configured in Application Discovery Service. - AdsApplicationConfigurationName *string `location:"querystring" locationName:"adsApplicationConfigurationName" min:"1" type:"string"` - - // The maximum number of results that can be returned. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // The name of the migration workflow. - Name *string `location:"querystring" locationName:"name" type:"string"` - - // The pagination token. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The status of the migration workflow. - Status *string `location:"querystring" locationName:"status" type:"string" enum:"MigrationWorkflowStatusEnum"` - - // The ID of the template. - TemplateId *string `location:"querystring" locationName:"templateId" min:"1" 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 ListWorkflowsInput) 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 ListWorkflowsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkflowsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkflowsInput"} - if s.AdsApplicationConfigurationName != nil && len(*s.AdsApplicationConfigurationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdsApplicationConfigurationName", 1)) - } - if s.TemplateId != nil && len(*s.TemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdsApplicationConfigurationName sets the AdsApplicationConfigurationName field's value. -func (s *ListWorkflowsInput) SetAdsApplicationConfigurationName(v string) *ListWorkflowsInput { - s.AdsApplicationConfigurationName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkflowsInput) SetMaxResults(v int64) *ListWorkflowsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListWorkflowsInput) SetName(v string) *ListWorkflowsInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkflowsInput) SetNextToken(v string) *ListWorkflowsInput { - s.NextToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListWorkflowsInput) SetStatus(v string) *ListWorkflowsInput { - s.Status = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *ListWorkflowsInput) SetTemplateId(v string) *ListWorkflowsInput { - s.TemplateId = &v - return s -} - -type ListWorkflowsOutput struct { - _ struct{} `type:"structure"` - - // The summary of the migration workflow. - // - // MigrationWorkflowSummary is a required field - MigrationWorkflowSummary []*MigrationWorkflowSummary `locationName:"migrationWorkflowSummary" type:"list" required:"true"` - - // The pagination token. - NextToken *string `locationName:"nextToken" 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 ListWorkflowsOutput) 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 ListWorkflowsOutput) GoString() string { - return s.String() -} - -// SetMigrationWorkflowSummary sets the MigrationWorkflowSummary field's value. -func (s *ListWorkflowsOutput) SetMigrationWorkflowSummary(v []*MigrationWorkflowSummary) *ListWorkflowsOutput { - s.MigrationWorkflowSummary = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkflowsOutput) SetNextToken(v string) *ListWorkflowsOutput { - s.NextToken = &v - return s -} - -// The summary of a migration workflow. -type MigrationWorkflowSummary struct { - _ struct{} `type:"structure"` - - // The name of the application configured in Application Discovery Service. - AdsApplicationConfigurationName *string `locationName:"adsApplicationConfigurationName" type:"string"` - - // The steps completed in the migration workflow. - CompletedSteps *int64 `locationName:"completedSteps" type:"integer"` - - // The time at which the migration workflow was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The time at which the migration workflow ended. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // The ID of the migration workflow. - Id *string `locationName:"id" min:"1" type:"string"` - - // The name of the migration workflow. - Name *string `locationName:"name" type:"string"` - - // The status of the migration workflow. - Status *string `locationName:"status" type:"string" enum:"MigrationWorkflowStatusEnum"` - - // The status message of the migration workflow. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The ID of the template. - TemplateId *string `locationName:"templateId" type:"string"` - - // All the steps in a migration workflow. - TotalSteps *int64 `locationName:"totalSteps" 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 MigrationWorkflowSummary) 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 MigrationWorkflowSummary) GoString() string { - return s.String() -} - -// SetAdsApplicationConfigurationName sets the AdsApplicationConfigurationName field's value. -func (s *MigrationWorkflowSummary) SetAdsApplicationConfigurationName(v string) *MigrationWorkflowSummary { - s.AdsApplicationConfigurationName = &v - return s -} - -// SetCompletedSteps sets the CompletedSteps field's value. -func (s *MigrationWorkflowSummary) SetCompletedSteps(v int64) *MigrationWorkflowSummary { - s.CompletedSteps = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *MigrationWorkflowSummary) SetCreationTime(v time.Time) *MigrationWorkflowSummary { - s.CreationTime = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *MigrationWorkflowSummary) SetEndTime(v time.Time) *MigrationWorkflowSummary { - s.EndTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *MigrationWorkflowSummary) SetId(v string) *MigrationWorkflowSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *MigrationWorkflowSummary) SetName(v string) *MigrationWorkflowSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *MigrationWorkflowSummary) SetStatus(v string) *MigrationWorkflowSummary { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *MigrationWorkflowSummary) SetStatusMessage(v string) *MigrationWorkflowSummary { - s.StatusMessage = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *MigrationWorkflowSummary) SetTemplateId(v string) *MigrationWorkflowSummary { - s.TemplateId = &v - return s -} - -// SetTotalSteps sets the TotalSteps field's value. -func (s *MigrationWorkflowSummary) SetTotalSteps(v int64) *MigrationWorkflowSummary { - s.TotalSteps = &v - return s -} - -// Command to be run on a particular operating system. -type PlatformCommand struct { - _ struct{} `type:"structure"` - - // Command for Linux. - Linux *string `locationName:"linux" type:"string"` - - // Command for Windows. - Windows *string `locationName:"windows" 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 PlatformCommand) 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 PlatformCommand) GoString() string { - return s.String() -} - -// SetLinux sets the Linux field's value. -func (s *PlatformCommand) SetLinux(v string) *PlatformCommand { - s.Linux = &v - return s -} - -// SetWindows sets the Windows field's value. -func (s *PlatformCommand) SetWindows(v string) *PlatformCommand { - s.Windows = &v - return s -} - -// The script location for a particular operating system. -type PlatformScriptKey struct { - _ struct{} `type:"structure"` - - // The script location for Linux. - Linux *string `locationName:"linux" type:"string"` - - // The script location for Windows. - Windows *string `locationName:"windows" 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 PlatformScriptKey) 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 PlatformScriptKey) GoString() string { - return s.String() -} - -// SetLinux sets the Linux field's value. -func (s *PlatformScriptKey) SetLinux(v string) *PlatformScriptKey { - s.Linux = &v - return s -} - -// SetWindows sets the Windows field's value. -func (s *PlatformScriptKey) SetWindows(v string) *PlatformScriptKey { - s.Windows = &v - return s -} - -// The summary of the Migration Hub Orchestrator plugin. -type PluginSummary struct { - _ struct{} `type:"structure"` - - // The name of the host. - Hostname *string `locationName:"hostname" type:"string"` - - // The IP address at which the plugin is located. - IpAddress *string `locationName:"ipAddress" type:"string"` - - // The ID of the plugin. - PluginId *string `locationName:"pluginId" min:"1" type:"string"` - - // The time at which the plugin was registered. - RegisteredTime *string `locationName:"registeredTime" type:"string"` - - // The status of the plugin. - Status *string `locationName:"status" type:"string" enum:"PluginHealth"` - - // The version of the plugin. - Version *string `locationName:"version" 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 PluginSummary) 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 PluginSummary) GoString() string { - return s.String() -} - -// SetHostname sets the Hostname field's value. -func (s *PluginSummary) SetHostname(v string) *PluginSummary { - s.Hostname = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *PluginSummary) SetIpAddress(v string) *PluginSummary { - s.IpAddress = &v - return s -} - -// SetPluginId sets the PluginId field's value. -func (s *PluginSummary) SetPluginId(v string) *PluginSummary { - s.PluginId = &v - return s -} - -// SetRegisteredTime sets the RegisteredTime field's value. -func (s *PluginSummary) SetRegisteredTime(v string) *PluginSummary { - s.RegisteredTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *PluginSummary) SetStatus(v string) *PluginSummary { - s.Status = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *PluginSummary) SetVersion(v string) *PluginSummary { - s.Version = &v - return s -} - -// The resource is not available. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type RetryWorkflowStepInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the step. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The ID of the step group. - // - // StepGroupId is a required field - StepGroupId *string `location:"querystring" locationName:"stepGroupId" min:"1" type:"string" required:"true"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `location:"querystring" locationName:"workflowId" min:"1" 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 RetryWorkflowStepInput) 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 RetryWorkflowStepInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetryWorkflowStepInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetryWorkflowStepInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.StepGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("StepGroupId")) - } - if s.StepGroupId != nil && len(*s.StepGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StepGroupId", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *RetryWorkflowStepInput) SetId(v string) *RetryWorkflowStepInput { - s.Id = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *RetryWorkflowStepInput) SetStepGroupId(v string) *RetryWorkflowStepInput { - s.StepGroupId = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *RetryWorkflowStepInput) SetWorkflowId(v string) *RetryWorkflowStepInput { - s.WorkflowId = &v - return s -} - -type RetryWorkflowStepOutput struct { - _ struct{} `type:"structure"` - - // The ID of the step. - Id *string `locationName:"id" type:"string"` - - // The status of the step. - Status *string `locationName:"status" type:"string" enum:"StepStatus"` - - // The ID of the step group. - StepGroupId *string `locationName:"stepGroupId" type:"string"` - - // The ID of the migration workflow. - WorkflowId *string `locationName:"workflowId" 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 RetryWorkflowStepOutput) 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 RetryWorkflowStepOutput) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *RetryWorkflowStepOutput) SetId(v string) *RetryWorkflowStepOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RetryWorkflowStepOutput) SetStatus(v string) *RetryWorkflowStepOutput { - s.Status = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *RetryWorkflowStepOutput) SetStepGroupId(v string) *RetryWorkflowStepOutput { - s.StepGroupId = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *RetryWorkflowStepOutput) SetWorkflowId(v string) *RetryWorkflowStepOutput { - s.WorkflowId = &v - return s -} - -type StartWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the migration workflow. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 StartWorkflowInput) 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 StartWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartWorkflowInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *StartWorkflowInput) SetId(v string) *StartWorkflowInput { - s.Id = &v - return s -} - -type StartWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the migration workflow. - Arn *string `locationName:"arn" type:"string"` - - // The ID of the migration workflow. - Id *string `locationName:"id" min:"1" type:"string"` - - // The time at which the migration workflow was last started. - LastStartTime *time.Time `locationName:"lastStartTime" type:"timestamp"` - - // The status of the migration workflow. - Status *string `locationName:"status" type:"string" enum:"MigrationWorkflowStatusEnum"` - - // The status message of the migration workflow. - StatusMessage *string `locationName:"statusMessage" 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 StartWorkflowOutput) 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 StartWorkflowOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartWorkflowOutput) SetArn(v string) *StartWorkflowOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartWorkflowOutput) SetId(v string) *StartWorkflowOutput { - s.Id = &v - return s -} - -// SetLastStartTime sets the LastStartTime field's value. -func (s *StartWorkflowOutput) SetLastStartTime(v time.Time) *StartWorkflowOutput { - s.LastStartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartWorkflowOutput) SetStatus(v string) *StartWorkflowOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *StartWorkflowOutput) SetStatusMessage(v string) *StartWorkflowOutput { - s.StatusMessage = &v - return s -} - -// The custom script to run tests on source or target environments. -type StepAutomationConfiguration struct { - _ struct{} `type:"structure"` - - // The command to run the script. - Command *PlatformCommand `locationName:"command" type:"structure"` - - // The source or target environment. - RunEnvironment *string `locationName:"runEnvironment" type:"string" enum:"RunEnvironment"` - - // The Amazon S3 bucket where the script is located. - ScriptLocationS3Bucket *string `locationName:"scriptLocationS3Bucket" type:"string"` - - // The Amazon S3 key for the script location. - ScriptLocationS3Key *PlatformScriptKey `locationName:"scriptLocationS3Key" type:"structure"` - - // The servers on which to run the script. - TargetType *string `locationName:"targetType" type:"string" enum:"TargetType"` -} - -// 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 StepAutomationConfiguration) 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 StepAutomationConfiguration) GoString() string { - return s.String() -} - -// SetCommand sets the Command field's value. -func (s *StepAutomationConfiguration) SetCommand(v *PlatformCommand) *StepAutomationConfiguration { - s.Command = v - return s -} - -// SetRunEnvironment sets the RunEnvironment field's value. -func (s *StepAutomationConfiguration) SetRunEnvironment(v string) *StepAutomationConfiguration { - s.RunEnvironment = &v - return s -} - -// SetScriptLocationS3Bucket sets the ScriptLocationS3Bucket field's value. -func (s *StepAutomationConfiguration) SetScriptLocationS3Bucket(v string) *StepAutomationConfiguration { - s.ScriptLocationS3Bucket = &v - return s -} - -// SetScriptLocationS3Key sets the ScriptLocationS3Key field's value. -func (s *StepAutomationConfiguration) SetScriptLocationS3Key(v *PlatformScriptKey) *StepAutomationConfiguration { - s.ScriptLocationS3Key = v - return s -} - -// SetTargetType sets the TargetType field's value. -func (s *StepAutomationConfiguration) SetTargetType(v string) *StepAutomationConfiguration { - s.TargetType = &v - return s -} - -// A map of key value pairs that is generated when you create a migration workflow. -// The key value pairs will differ based on your selection of the template. -type StepInput_ struct { - _ struct{} `type:"structure"` - - // The value of the integer. - IntegerValue *int64 `locationName:"integerValue" type:"integer"` - - // List of string values. - ListOfStringsValue []*string `locationName:"listOfStringsValue" type:"list"` - - // Map of string values. - MapOfStringValue map[string]*string `locationName:"mapOfStringValue" type:"map"` - - // String value. - StringValue *string `locationName:"stringValue" 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 StepInput_) 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 StepInput_) GoString() string { - return s.String() -} - -// SetIntegerValue sets the IntegerValue field's value. -func (s *StepInput_) SetIntegerValue(v int64) *StepInput_ { - s.IntegerValue = &v - return s -} - -// SetListOfStringsValue sets the ListOfStringsValue field's value. -func (s *StepInput_) SetListOfStringsValue(v []*string) *StepInput_ { - s.ListOfStringsValue = v - return s -} - -// SetMapOfStringValue sets the MapOfStringValue field's value. -func (s *StepInput_) SetMapOfStringValue(v map[string]*string) *StepInput_ { - s.MapOfStringValue = v - return s -} - -// SetStringValue sets the StringValue field's value. -func (s *StepInput_) SetStringValue(v string) *StepInput_ { - s.StringValue = &v - return s -} - -// The output of the step. -type StepOutput_ struct { - _ struct{} `type:"structure"` - - // The data type of the step output. - DataType *string `locationName:"dataType" type:"string" enum:"DataType"` - - // The name of the step. - Name *string `locationName:"name" type:"string"` - - // Determine if an output is required from a step. - Required *bool `locationName:"required" type:"boolean"` -} - -// 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 StepOutput_) 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 StepOutput_) GoString() string { - return s.String() -} - -// SetDataType sets the DataType field's value. -func (s *StepOutput_) SetDataType(v string) *StepOutput_ { - s.DataType = &v - return s -} - -// SetName sets the Name field's value. -func (s *StepOutput_) SetName(v string) *StepOutput_ { - s.Name = &v - return s -} - -// SetRequired sets the Required field's value. -func (s *StepOutput_) SetRequired(v bool) *StepOutput_ { - s.Required = &v - return s -} - -type StopWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the migration workflow. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 StopWorkflowInput) 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 StopWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopWorkflowInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *StopWorkflowInput) SetId(v string) *StopWorkflowInput { - s.Id = &v - return s -} - -type StopWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the migration workflow. - Arn *string `locationName:"arn" type:"string"` - - // The ID of the migration workflow. - Id *string `locationName:"id" min:"1" type:"string"` - - // The time at which the migration workflow was stopped. - LastStopTime *time.Time `locationName:"lastStopTime" type:"timestamp"` - - // The status of the migration workflow. - Status *string `locationName:"status" type:"string" enum:"MigrationWorkflowStatusEnum"` - - // The status message of the migration workflow. - StatusMessage *string `locationName:"statusMessage" 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 StopWorkflowOutput) 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 StopWorkflowOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StopWorkflowOutput) SetArn(v string) *StopWorkflowOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *StopWorkflowOutput) SetId(v string) *StopWorkflowOutput { - s.Id = &v - return s -} - -// SetLastStopTime sets the LastStopTime field's value. -func (s *StopWorkflowOutput) SetLastStopTime(v time.Time) *StopWorkflowOutput { - s.LastStopTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StopWorkflowOutput) SetStatus(v string) *StopWorkflowOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *StopWorkflowOutput) SetStatusMessage(v string) *StopWorkflowOutput { - s.StatusMessage = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource to which you want to add tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // A collection of labels, in the form of key:value pairs, that apply to this - // resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The input parameters of a template. -type TemplateInput_ struct { - _ struct{} `type:"structure"` - - // The data type of the template input. - DataType *string `locationName:"dataType" type:"string" enum:"DataType"` - - // The name of the template. - InputName *string `locationName:"inputName" min:"1" type:"string"` - - // Determine if an input is required from the template. - Required *bool `locationName:"required" type:"boolean"` -} - -// 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 TemplateInput_) 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 TemplateInput_) GoString() string { - return s.String() -} - -// SetDataType sets the DataType field's value. -func (s *TemplateInput_) SetDataType(v string) *TemplateInput_ { - s.DataType = &v - return s -} - -// SetInputName sets the InputName field's value. -func (s *TemplateInput_) SetInputName(v string) *TemplateInput_ { - s.InputName = &v - return s -} - -// SetRequired sets the Required field's value. -func (s *TemplateInput_) SetRequired(v bool) *TemplateInput_ { - s.Required = &v - return s -} - -// The summary of the step group in the template. -type TemplateStepGroupSummary struct { - _ struct{} `type:"structure"` - - // The ID of the step group. - Id *string `locationName:"id" type:"string"` - - // The name of the step group. - Name *string `locationName:"name" type:"string"` - - // The next step group. - Next []*string `locationName:"next" type:"list"` - - // The previous step group. - Previous []*string `locationName:"previous" type:"list"` -} - -// 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 TemplateStepGroupSummary) 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 TemplateStepGroupSummary) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *TemplateStepGroupSummary) SetId(v string) *TemplateStepGroupSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *TemplateStepGroupSummary) SetName(v string) *TemplateStepGroupSummary { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *TemplateStepGroupSummary) SetNext(v []*string) *TemplateStepGroupSummary { - s.Next = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *TemplateStepGroupSummary) SetPrevious(v []*string) *TemplateStepGroupSummary { - s.Previous = v - return s -} - -// The summary of the step. -type TemplateStepSummary struct { - _ struct{} `type:"structure"` - - // The ID of the step. - Id *string `locationName:"id" type:"string"` - - // The name of the step. - Name *string `locationName:"name" type:"string"` - - // The next step. - Next []*string `locationName:"next" type:"list"` - - // The owner of the step. - Owner *string `locationName:"owner" type:"string" enum:"Owner"` - - // The previous step. - Previous []*string `locationName:"previous" type:"list"` - - // The action type of the step. You must run and update the status of a manual - // step for the workflow to continue after the completion of the step. - StepActionType *string `locationName:"stepActionType" type:"string" enum:"StepActionType"` - - // The ID of the step group. - StepGroupId *string `locationName:"stepGroupId" type:"string"` - - // The servers on which to run the script. - TargetType *string `locationName:"targetType" type:"string" enum:"TargetType"` - - // The ID of the template. - TemplateId *string `locationName:"templateId" 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 TemplateStepSummary) 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 TemplateStepSummary) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *TemplateStepSummary) SetId(v string) *TemplateStepSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *TemplateStepSummary) SetName(v string) *TemplateStepSummary { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *TemplateStepSummary) SetNext(v []*string) *TemplateStepSummary { - s.Next = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *TemplateStepSummary) SetOwner(v string) *TemplateStepSummary { - s.Owner = &v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *TemplateStepSummary) SetPrevious(v []*string) *TemplateStepSummary { - s.Previous = v - return s -} - -// SetStepActionType sets the StepActionType field's value. -func (s *TemplateStepSummary) SetStepActionType(v string) *TemplateStepSummary { - s.StepActionType = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *TemplateStepSummary) SetStepGroupId(v string) *TemplateStepSummary { - s.StepGroupId = &v - return s -} - -// SetTargetType sets the TargetType field's value. -func (s *TemplateStepSummary) SetTargetType(v string) *TemplateStepSummary { - s.TargetType = &v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *TemplateStepSummary) SetTemplateId(v string) *TemplateStepSummary { - s.TemplateId = &v - return s -} - -// The summary of the template. -type TemplateSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the template. - Arn *string `locationName:"arn" type:"string"` - - // The description of the template. - Description *string `locationName:"description" type:"string"` - - // The ID of the template. - Id *string `locationName:"id" type:"string"` - - // The name of the template. - Name *string `locationName:"name" 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 TemplateSummary) 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 TemplateSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *TemplateSummary) SetArn(v string) *TemplateSummary { - s.Arn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *TemplateSummary) SetDescription(v string) *TemplateSummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *TemplateSummary) SetId(v string) *TemplateSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *TemplateSummary) SetName(v string) *TemplateSummary { - s.Name = &v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// List of AWS services utilized in a migration workflow. -type Tool struct { - _ struct{} `type:"structure"` - - // The name of an AWS service. - Name *string `locationName:"name" type:"string"` - - // The URL of an AWS service. - Url *string `locationName:"url" 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 Tool) 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 Tool) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Tool) SetName(v string) *Tool { - s.Name = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *Tool) SetUrl(v string) *Tool { - s.Url = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource from which you want to remove - // tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // One or more tag keys. Specify only the tag keys, not the tag values. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateWorkflowInput struct { - _ struct{} `type:"structure"` - - // The description of the migration workflow. - Description *string `locationName:"description" type:"string"` - - // The ID of the migration workflow. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The input parameters required to update a migration workflow. - // - // InputParameters is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateWorkflowInput's - // String and GoString methods. - InputParameters map[string]*StepInput_ `locationName:"inputParameters" type:"map" sensitive:"true"` - - // The name of the migration workflow. - Name *string `locationName:"name" min:"1" type:"string"` - - // The servers on which a step will be run. - StepTargets []*string `locationName:"stepTargets" type:"list"` -} - -// 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 UpdateWorkflowInput) 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 UpdateWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWorkflowInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateWorkflowInput) SetDescription(v string) *UpdateWorkflowInput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkflowInput) SetId(v string) *UpdateWorkflowInput { - s.Id = &v - return s -} - -// SetInputParameters sets the InputParameters field's value. -func (s *UpdateWorkflowInput) SetInputParameters(v map[string]*StepInput_) *UpdateWorkflowInput { - s.InputParameters = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkflowInput) SetName(v string) *UpdateWorkflowInput { - s.Name = &v - return s -} - -// SetStepTargets sets the StepTargets field's value. -func (s *UpdateWorkflowInput) SetStepTargets(v []*string) *UpdateWorkflowInput { - s.StepTargets = v - return s -} - -type UpdateWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The ID of the application configured in Application Discovery Service. - AdsApplicationConfigurationId *string `locationName:"adsApplicationConfigurationId" type:"string"` - - // The Amazon Resource Name (ARN) of the migration workflow. - Arn *string `locationName:"arn" type:"string"` - - // The time at which the migration workflow was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - - // The description of the migration workflow. - Description *string `locationName:"description" type:"string"` - - // The ID of the migration workflow. - Id *string `locationName:"id" min:"1" type:"string"` - - // The time at which the migration workflow was last modified. - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp"` - - // The name of the migration workflow. - Name *string `locationName:"name" type:"string"` - - // The status of the migration workflow. - Status *string `locationName:"status" type:"string" enum:"MigrationWorkflowStatusEnum"` - - // The servers on which a step will be run. - StepTargets []*string `locationName:"stepTargets" type:"list"` - - // The tags added to the migration workflow. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The ID of the template. - TemplateId *string `locationName:"templateId" type:"string"` - - // The inputs required to update a migration workflow. - // - // WorkflowInputs is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateWorkflowOutput's - // String and GoString methods. - WorkflowInputs map[string]*StepInput_ `locationName:"workflowInputs" type:"map" sensitive:"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 UpdateWorkflowOutput) 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 UpdateWorkflowOutput) GoString() string { - return s.String() -} - -// SetAdsApplicationConfigurationId sets the AdsApplicationConfigurationId field's value. -func (s *UpdateWorkflowOutput) SetAdsApplicationConfigurationId(v string) *UpdateWorkflowOutput { - s.AdsApplicationConfigurationId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *UpdateWorkflowOutput) SetArn(v string) *UpdateWorkflowOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *UpdateWorkflowOutput) SetCreationTime(v time.Time) *UpdateWorkflowOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateWorkflowOutput) SetDescription(v string) *UpdateWorkflowOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkflowOutput) SetId(v string) *UpdateWorkflowOutput { - s.Id = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *UpdateWorkflowOutput) SetLastModifiedTime(v time.Time) *UpdateWorkflowOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkflowOutput) SetName(v string) *UpdateWorkflowOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateWorkflowOutput) SetStatus(v string) *UpdateWorkflowOutput { - s.Status = &v - return s -} - -// SetStepTargets sets the StepTargets field's value. -func (s *UpdateWorkflowOutput) SetStepTargets(v []*string) *UpdateWorkflowOutput { - s.StepTargets = v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateWorkflowOutput) SetTags(v map[string]*string) *UpdateWorkflowOutput { - s.Tags = v - return s -} - -// SetTemplateId sets the TemplateId field's value. -func (s *UpdateWorkflowOutput) SetTemplateId(v string) *UpdateWorkflowOutput { - s.TemplateId = &v - return s -} - -// SetWorkflowInputs sets the WorkflowInputs field's value. -func (s *UpdateWorkflowOutput) SetWorkflowInputs(v map[string]*StepInput_) *UpdateWorkflowOutput { - s.WorkflowInputs = v - return s -} - -type UpdateWorkflowStepGroupInput struct { - _ struct{} `type:"structure"` - - // The description of the step group. - Description *string `locationName:"description" type:"string"` - - // The ID of the step group. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The name of the step group. - Name *string `locationName:"name" min:"1" type:"string"` - - // The next step group. - Next []*string `locationName:"next" type:"list"` - - // The previous step group. - Previous []*string `locationName:"previous" type:"list"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `location:"querystring" locationName:"workflowId" min:"1" 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 UpdateWorkflowStepGroupInput) 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 UpdateWorkflowStepGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWorkflowStepGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWorkflowStepGroupInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateWorkflowStepGroupInput) SetDescription(v string) *UpdateWorkflowStepGroupInput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkflowStepGroupInput) SetId(v string) *UpdateWorkflowStepGroupInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkflowStepGroupInput) SetName(v string) *UpdateWorkflowStepGroupInput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *UpdateWorkflowStepGroupInput) SetNext(v []*string) *UpdateWorkflowStepGroupInput { - s.Next = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *UpdateWorkflowStepGroupInput) SetPrevious(v []*string) *UpdateWorkflowStepGroupInput { - s.Previous = v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *UpdateWorkflowStepGroupInput) SetWorkflowId(v string) *UpdateWorkflowStepGroupInput { - s.WorkflowId = &v - return s -} - -type UpdateWorkflowStepGroupOutput struct { - _ struct{} `type:"structure"` - - // The description of the step group. - Description *string `locationName:"description" type:"string"` - - // The ID of the step group. - Id *string `locationName:"id" type:"string"` - - // The time at which the step group was last modified. - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp"` - - // The name of the step group. - Name *string `locationName:"name" type:"string"` - - // The next step group. - Next []*string `locationName:"next" type:"list"` - - // The previous step group. - Previous []*string `locationName:"previous" type:"list"` - - // List of AWS services utilized in a migration workflow. - Tools []*Tool `locationName:"tools" type:"list"` - - // The ID of the migration workflow. - WorkflowId *string `locationName:"workflowId" 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 UpdateWorkflowStepGroupOutput) 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 UpdateWorkflowStepGroupOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *UpdateWorkflowStepGroupOutput) SetDescription(v string) *UpdateWorkflowStepGroupOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkflowStepGroupOutput) SetId(v string) *UpdateWorkflowStepGroupOutput { - s.Id = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *UpdateWorkflowStepGroupOutput) SetLastModifiedTime(v time.Time) *UpdateWorkflowStepGroupOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkflowStepGroupOutput) SetName(v string) *UpdateWorkflowStepGroupOutput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *UpdateWorkflowStepGroupOutput) SetNext(v []*string) *UpdateWorkflowStepGroupOutput { - s.Next = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *UpdateWorkflowStepGroupOutput) SetPrevious(v []*string) *UpdateWorkflowStepGroupOutput { - s.Previous = v - return s -} - -// SetTools sets the Tools field's value. -func (s *UpdateWorkflowStepGroupOutput) SetTools(v []*Tool) *UpdateWorkflowStepGroupOutput { - s.Tools = v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *UpdateWorkflowStepGroupOutput) SetWorkflowId(v string) *UpdateWorkflowStepGroupOutput { - s.WorkflowId = &v - return s -} - -type UpdateWorkflowStepInput struct { - _ struct{} `type:"structure"` - - // The description of the step. - Description *string `locationName:"description" type:"string"` - - // The ID of the step. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The name of the step. - Name *string `locationName:"name" min:"1" type:"string"` - - // The next step. - Next []*string `locationName:"next" type:"list"` - - // The outputs of a step. - Outputs []*WorkflowStepOutput_ `locationName:"outputs" type:"list"` - - // The previous step. - Previous []*string `locationName:"previous" type:"list"` - - // The status of the step. - Status *string `locationName:"status" type:"string" enum:"StepStatus"` - - // The action type of the step. You must run and update the status of a manual - // step for the workflow to continue after the completion of the step. - StepActionType *string `locationName:"stepActionType" type:"string" enum:"StepActionType"` - - // The ID of the step group. - // - // StepGroupId is a required field - StepGroupId *string `locationName:"stepGroupId" min:"1" type:"string" required:"true"` - - // The servers on which a step will be run. - StepTarget []*string `locationName:"stepTarget" type:"list"` - - // The ID of the migration workflow. - // - // WorkflowId is a required field - WorkflowId *string `locationName:"workflowId" min:"1" type:"string" required:"true"` - - // The custom script to run tests on the source and target environments. - WorkflowStepAutomationConfiguration *WorkflowStepAutomationConfiguration `locationName:"workflowStepAutomationConfiguration" 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 UpdateWorkflowStepInput) 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 UpdateWorkflowStepInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWorkflowStepInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWorkflowStepInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.StepGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("StepGroupId")) - } - if s.StepGroupId != nil && len(*s.StepGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StepGroupId", 1)) - } - if s.WorkflowId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkflowId")) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - if s.Outputs != nil { - for i, v := range s.Outputs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Outputs", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateWorkflowStepInput) SetDescription(v string) *UpdateWorkflowStepInput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkflowStepInput) SetId(v string) *UpdateWorkflowStepInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkflowStepInput) SetName(v string) *UpdateWorkflowStepInput { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *UpdateWorkflowStepInput) SetNext(v []*string) *UpdateWorkflowStepInput { - s.Next = v - return s -} - -// SetOutputs sets the Outputs field's value. -func (s *UpdateWorkflowStepInput) SetOutputs(v []*WorkflowStepOutput_) *UpdateWorkflowStepInput { - s.Outputs = v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *UpdateWorkflowStepInput) SetPrevious(v []*string) *UpdateWorkflowStepInput { - s.Previous = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateWorkflowStepInput) SetStatus(v string) *UpdateWorkflowStepInput { - s.Status = &v - return s -} - -// SetStepActionType sets the StepActionType field's value. -func (s *UpdateWorkflowStepInput) SetStepActionType(v string) *UpdateWorkflowStepInput { - s.StepActionType = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *UpdateWorkflowStepInput) SetStepGroupId(v string) *UpdateWorkflowStepInput { - s.StepGroupId = &v - return s -} - -// SetStepTarget sets the StepTarget field's value. -func (s *UpdateWorkflowStepInput) SetStepTarget(v []*string) *UpdateWorkflowStepInput { - s.StepTarget = v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *UpdateWorkflowStepInput) SetWorkflowId(v string) *UpdateWorkflowStepInput { - s.WorkflowId = &v - return s -} - -// SetWorkflowStepAutomationConfiguration sets the WorkflowStepAutomationConfiguration field's value. -func (s *UpdateWorkflowStepInput) SetWorkflowStepAutomationConfiguration(v *WorkflowStepAutomationConfiguration) *UpdateWorkflowStepInput { - s.WorkflowStepAutomationConfiguration = v - return s -} - -type UpdateWorkflowStepOutput struct { - _ struct{} `type:"structure"` - - // The ID of the step. - Id *string `locationName:"id" min:"1" type:"string"` - - // The name of the step. - Name *string `locationName:"name" type:"string"` - - // The ID of the step group. - StepGroupId *string `locationName:"stepGroupId" type:"string"` - - // The ID of the migration workflow. - WorkflowId *string `locationName:"workflowId" 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 UpdateWorkflowStepOutput) 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 UpdateWorkflowStepOutput) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *UpdateWorkflowStepOutput) SetId(v string) *UpdateWorkflowStepOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkflowStepOutput) SetName(v string) *UpdateWorkflowStepOutput { - s.Name = &v - return s -} - -// SetStepGroupId sets the StepGroupId field's value. -func (s *UpdateWorkflowStepOutput) SetStepGroupId(v string) *UpdateWorkflowStepOutput { - s.StepGroupId = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *UpdateWorkflowStepOutput) SetWorkflowId(v string) *UpdateWorkflowStepOutput { - s.WorkflowId = &v - return s -} - -// The input fails to satisfy the constraints specified by an AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The custom script to run tests on source or target environments. -type WorkflowStepAutomationConfiguration struct { - _ struct{} `type:"structure"` - - // The command required to run the script. - Command *PlatformCommand `locationName:"command" type:"structure"` - - // The source or target environment. - RunEnvironment *string `locationName:"runEnvironment" type:"string" enum:"RunEnvironment"` - - // The Amazon S3 bucket where the script is located. - ScriptLocationS3Bucket *string `locationName:"scriptLocationS3Bucket" type:"string"` - - // The Amazon S3 key for the script location. - ScriptLocationS3Key *PlatformScriptKey `locationName:"scriptLocationS3Key" type:"structure"` - - // The servers on which to run the script. - TargetType *string `locationName:"targetType" type:"string" enum:"TargetType"` -} - -// 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 WorkflowStepAutomationConfiguration) 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 WorkflowStepAutomationConfiguration) GoString() string { - return s.String() -} - -// SetCommand sets the Command field's value. -func (s *WorkflowStepAutomationConfiguration) SetCommand(v *PlatformCommand) *WorkflowStepAutomationConfiguration { - s.Command = v - return s -} - -// SetRunEnvironment sets the RunEnvironment field's value. -func (s *WorkflowStepAutomationConfiguration) SetRunEnvironment(v string) *WorkflowStepAutomationConfiguration { - s.RunEnvironment = &v - return s -} - -// SetScriptLocationS3Bucket sets the ScriptLocationS3Bucket field's value. -func (s *WorkflowStepAutomationConfiguration) SetScriptLocationS3Bucket(v string) *WorkflowStepAutomationConfiguration { - s.ScriptLocationS3Bucket = &v - return s -} - -// SetScriptLocationS3Key sets the ScriptLocationS3Key field's value. -func (s *WorkflowStepAutomationConfiguration) SetScriptLocationS3Key(v *PlatformScriptKey) *WorkflowStepAutomationConfiguration { - s.ScriptLocationS3Key = v - return s -} - -// SetTargetType sets the TargetType field's value. -func (s *WorkflowStepAutomationConfiguration) SetTargetType(v string) *WorkflowStepAutomationConfiguration { - s.TargetType = &v - return s -} - -// The summary of a step group in a workflow. -type WorkflowStepGroupSummary struct { - _ struct{} `type:"structure"` - - // The ID of the step group. - Id *string `locationName:"id" type:"string"` - - // The name of the step group. - Name *string `locationName:"name" type:"string"` - - // The next step group. - Next []*string `locationName:"next" type:"list"` - - // The owner of the step group. - Owner *string `locationName:"owner" type:"string" enum:"Owner"` - - // The previous step group. - Previous []*string `locationName:"previous" type:"list"` - - // The status of the step group. - Status *string `locationName:"status" type:"string" enum:"StepGroupStatus"` -} - -// 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 WorkflowStepGroupSummary) 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 WorkflowStepGroupSummary) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *WorkflowStepGroupSummary) SetId(v string) *WorkflowStepGroupSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *WorkflowStepGroupSummary) SetName(v string) *WorkflowStepGroupSummary { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *WorkflowStepGroupSummary) SetNext(v []*string) *WorkflowStepGroupSummary { - s.Next = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *WorkflowStepGroupSummary) SetOwner(v string) *WorkflowStepGroupSummary { - s.Owner = &v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *WorkflowStepGroupSummary) SetPrevious(v []*string) *WorkflowStepGroupSummary { - s.Previous = v - return s -} - -// SetStatus sets the Status field's value. -func (s *WorkflowStepGroupSummary) SetStatus(v string) *WorkflowStepGroupSummary { - s.Status = &v - return s -} - -// A structure to hold multiple values of an output. -type WorkflowStepOutputUnion struct { - _ struct{} `type:"structure"` - - // The integer value. - IntegerValue *int64 `locationName:"integerValue" type:"integer"` - - // The list of string value. - ListOfStringValue []*string `locationName:"listOfStringValue" type:"list"` - - // The string value. - StringValue *string `locationName:"stringValue" 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 WorkflowStepOutputUnion) 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 WorkflowStepOutputUnion) GoString() string { - return s.String() -} - -// SetIntegerValue sets the IntegerValue field's value. -func (s *WorkflowStepOutputUnion) SetIntegerValue(v int64) *WorkflowStepOutputUnion { - s.IntegerValue = &v - return s -} - -// SetListOfStringValue sets the ListOfStringValue field's value. -func (s *WorkflowStepOutputUnion) SetListOfStringValue(v []*string) *WorkflowStepOutputUnion { - s.ListOfStringValue = v - return s -} - -// SetStringValue sets the StringValue field's value. -func (s *WorkflowStepOutputUnion) SetStringValue(v string) *WorkflowStepOutputUnion { - s.StringValue = &v - return s -} - -// The output of a step. -type WorkflowStepOutput_ struct { - _ struct{} `type:"structure"` - - // The data type of the output. - DataType *string `locationName:"dataType" type:"string" enum:"DataType"` - - // The name of the step. - Name *string `locationName:"name" min:"1" type:"string"` - - // Determine if an output is required from a step. - Required *bool `locationName:"required" type:"boolean"` - - // The value of the output. - Value *WorkflowStepOutputUnion `locationName:"value" 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 WorkflowStepOutput_) 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 WorkflowStepOutput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WorkflowStepOutput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WorkflowStepOutput_"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataType sets the DataType field's value. -func (s *WorkflowStepOutput_) SetDataType(v string) *WorkflowStepOutput_ { - s.DataType = &v - return s -} - -// SetName sets the Name field's value. -func (s *WorkflowStepOutput_) SetName(v string) *WorkflowStepOutput_ { - s.Name = &v - return s -} - -// SetRequired sets the Required field's value. -func (s *WorkflowStepOutput_) SetRequired(v bool) *WorkflowStepOutput_ { - s.Required = &v - return s -} - -// SetValue sets the Value field's value. -func (s *WorkflowStepOutput_) SetValue(v *WorkflowStepOutputUnion) *WorkflowStepOutput_ { - s.Value = v - return s -} - -// The summary of the step in a migration workflow. -type WorkflowStepSummary struct { - _ struct{} `type:"structure"` - - // The description of the step. - Description *string `locationName:"description" type:"string"` - - // The name of the step. - Name *string `locationName:"name" type:"string"` - - // The next step. - Next []*string `locationName:"next" type:"list"` - - // The number of servers that have been migrated. - NoOfSrvCompleted *int64 `locationName:"noOfSrvCompleted" type:"integer"` - - // The number of servers that have failed to migrate. - NoOfSrvFailed *int64 `locationName:"noOfSrvFailed" type:"integer"` - - // The owner of the step. - Owner *string `locationName:"owner" type:"string" enum:"Owner"` - - // The previous step. - Previous []*string `locationName:"previous" type:"list"` - - // The location of the script. - ScriptLocation *string `locationName:"scriptLocation" type:"string"` - - // The status of the step. - Status *string `locationName:"status" type:"string" enum:"StepStatus"` - - // The status message of the migration workflow. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The action type of the step. You must run and update the status of a manual - // step for the workflow to continue after the completion of the step. - StepActionType *string `locationName:"stepActionType" type:"string" enum:"StepActionType"` - - // The ID of the step. - StepId *string `locationName:"stepId" type:"string"` - - // The total number of servers that have been migrated. - TotalNoOfSrv *int64 `locationName:"totalNoOfSrv" 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 WorkflowStepSummary) 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 WorkflowStepSummary) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *WorkflowStepSummary) SetDescription(v string) *WorkflowStepSummary { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *WorkflowStepSummary) SetName(v string) *WorkflowStepSummary { - s.Name = &v - return s -} - -// SetNext sets the Next field's value. -func (s *WorkflowStepSummary) SetNext(v []*string) *WorkflowStepSummary { - s.Next = v - return s -} - -// SetNoOfSrvCompleted sets the NoOfSrvCompleted field's value. -func (s *WorkflowStepSummary) SetNoOfSrvCompleted(v int64) *WorkflowStepSummary { - s.NoOfSrvCompleted = &v - return s -} - -// SetNoOfSrvFailed sets the NoOfSrvFailed field's value. -func (s *WorkflowStepSummary) SetNoOfSrvFailed(v int64) *WorkflowStepSummary { - s.NoOfSrvFailed = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *WorkflowStepSummary) SetOwner(v string) *WorkflowStepSummary { - s.Owner = &v - return s -} - -// SetPrevious sets the Previous field's value. -func (s *WorkflowStepSummary) SetPrevious(v []*string) *WorkflowStepSummary { - s.Previous = v - return s -} - -// SetScriptLocation sets the ScriptLocation field's value. -func (s *WorkflowStepSummary) SetScriptLocation(v string) *WorkflowStepSummary { - s.ScriptLocation = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *WorkflowStepSummary) SetStatus(v string) *WorkflowStepSummary { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *WorkflowStepSummary) SetStatusMessage(v string) *WorkflowStepSummary { - s.StatusMessage = &v - return s -} - -// SetStepActionType sets the StepActionType field's value. -func (s *WorkflowStepSummary) SetStepActionType(v string) *WorkflowStepSummary { - s.StepActionType = &v - return s -} - -// SetStepId sets the StepId field's value. -func (s *WorkflowStepSummary) SetStepId(v string) *WorkflowStepSummary { - s.StepId = &v - return s -} - -// SetTotalNoOfSrv sets the TotalNoOfSrv field's value. -func (s *WorkflowStepSummary) SetTotalNoOfSrv(v int64) *WorkflowStepSummary { - s.TotalNoOfSrv = &v - return s -} - -const ( - // DataTypeString is a DataType enum value - DataTypeString = "STRING" - - // DataTypeInteger is a DataType enum value - DataTypeInteger = "INTEGER" - - // DataTypeStringlist is a DataType enum value - DataTypeStringlist = "STRINGLIST" - - // DataTypeStringmap is a DataType enum value - DataTypeStringmap = "STRINGMAP" -) - -// DataType_Values returns all elements of the DataType enum -func DataType_Values() []string { - return []string{ - DataTypeString, - DataTypeInteger, - DataTypeStringlist, - DataTypeStringmap, - } -} - -const ( - // MigrationWorkflowStatusEnumCreating is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumCreating = "CREATING" - - // MigrationWorkflowStatusEnumNotStarted is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumNotStarted = "NOT_STARTED" - - // MigrationWorkflowStatusEnumCreationFailed is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumCreationFailed = "CREATION_FAILED" - - // MigrationWorkflowStatusEnumStarting is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumStarting = "STARTING" - - // MigrationWorkflowStatusEnumInProgress is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumInProgress = "IN_PROGRESS" - - // MigrationWorkflowStatusEnumWorkflowFailed is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumWorkflowFailed = "WORKFLOW_FAILED" - - // MigrationWorkflowStatusEnumPaused is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumPaused = "PAUSED" - - // MigrationWorkflowStatusEnumPausing is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumPausing = "PAUSING" - - // MigrationWorkflowStatusEnumPausingFailed is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumPausingFailed = "PAUSING_FAILED" - - // MigrationWorkflowStatusEnumUserAttentionRequired is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumUserAttentionRequired = "USER_ATTENTION_REQUIRED" - - // MigrationWorkflowStatusEnumDeleting is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumDeleting = "DELETING" - - // MigrationWorkflowStatusEnumDeletionFailed is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumDeletionFailed = "DELETION_FAILED" - - // MigrationWorkflowStatusEnumDeleted is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumDeleted = "DELETED" - - // MigrationWorkflowStatusEnumCompleted is a MigrationWorkflowStatusEnum enum value - MigrationWorkflowStatusEnumCompleted = "COMPLETED" -) - -// MigrationWorkflowStatusEnum_Values returns all elements of the MigrationWorkflowStatusEnum enum -func MigrationWorkflowStatusEnum_Values() []string { - return []string{ - MigrationWorkflowStatusEnumCreating, - MigrationWorkflowStatusEnumNotStarted, - MigrationWorkflowStatusEnumCreationFailed, - MigrationWorkflowStatusEnumStarting, - MigrationWorkflowStatusEnumInProgress, - MigrationWorkflowStatusEnumWorkflowFailed, - MigrationWorkflowStatusEnumPaused, - MigrationWorkflowStatusEnumPausing, - MigrationWorkflowStatusEnumPausingFailed, - MigrationWorkflowStatusEnumUserAttentionRequired, - MigrationWorkflowStatusEnumDeleting, - MigrationWorkflowStatusEnumDeletionFailed, - MigrationWorkflowStatusEnumDeleted, - MigrationWorkflowStatusEnumCompleted, - } -} - -const ( - // OwnerAwsManaged is a Owner enum value - OwnerAwsManaged = "AWS_MANAGED" - - // OwnerCustom is a Owner enum value - OwnerCustom = "CUSTOM" -) - -// Owner_Values returns all elements of the Owner enum -func Owner_Values() []string { - return []string{ - OwnerAwsManaged, - OwnerCustom, - } -} - -const ( - // PluginHealthHealthy is a PluginHealth enum value - PluginHealthHealthy = "HEALTHY" - - // PluginHealthUnhealthy is a PluginHealth enum value - PluginHealthUnhealthy = "UNHEALTHY" -) - -// PluginHealth_Values returns all elements of the PluginHealth enum -func PluginHealth_Values() []string { - return []string{ - PluginHealthHealthy, - PluginHealthUnhealthy, - } -} - -const ( - // RunEnvironmentAws is a RunEnvironment enum value - RunEnvironmentAws = "AWS" - - // RunEnvironmentOnpremise is a RunEnvironment enum value - RunEnvironmentOnpremise = "ONPREMISE" -) - -// RunEnvironment_Values returns all elements of the RunEnvironment enum -func RunEnvironment_Values() []string { - return []string{ - RunEnvironmentAws, - RunEnvironmentOnpremise, - } -} - -const ( - // StepActionTypeManual is a StepActionType enum value - StepActionTypeManual = "MANUAL" - - // StepActionTypeAutomated is a StepActionType enum value - StepActionTypeAutomated = "AUTOMATED" -) - -// StepActionType_Values returns all elements of the StepActionType enum -func StepActionType_Values() []string { - return []string{ - StepActionTypeManual, - StepActionTypeAutomated, - } -} - -const ( - // StepGroupStatusAwaitingDependencies is a StepGroupStatus enum value - StepGroupStatusAwaitingDependencies = "AWAITING_DEPENDENCIES" - - // StepGroupStatusReady is a StepGroupStatus enum value - StepGroupStatusReady = "READY" - - // StepGroupStatusInProgress is a StepGroupStatus enum value - StepGroupStatusInProgress = "IN_PROGRESS" - - // StepGroupStatusCompleted is a StepGroupStatus enum value - StepGroupStatusCompleted = "COMPLETED" - - // StepGroupStatusFailed is a StepGroupStatus enum value - StepGroupStatusFailed = "FAILED" - - // StepGroupStatusPaused is a StepGroupStatus enum value - StepGroupStatusPaused = "PAUSED" - - // StepGroupStatusPausing is a StepGroupStatus enum value - StepGroupStatusPausing = "PAUSING" - - // StepGroupStatusUserAttentionRequired is a StepGroupStatus enum value - StepGroupStatusUserAttentionRequired = "USER_ATTENTION_REQUIRED" -) - -// StepGroupStatus_Values returns all elements of the StepGroupStatus enum -func StepGroupStatus_Values() []string { - return []string{ - StepGroupStatusAwaitingDependencies, - StepGroupStatusReady, - StepGroupStatusInProgress, - StepGroupStatusCompleted, - StepGroupStatusFailed, - StepGroupStatusPaused, - StepGroupStatusPausing, - StepGroupStatusUserAttentionRequired, - } -} - -const ( - // StepStatusAwaitingDependencies is a StepStatus enum value - StepStatusAwaitingDependencies = "AWAITING_DEPENDENCIES" - - // StepStatusReady is a StepStatus enum value - StepStatusReady = "READY" - - // StepStatusInProgress is a StepStatus enum value - StepStatusInProgress = "IN_PROGRESS" - - // StepStatusCompleted is a StepStatus enum value - StepStatusCompleted = "COMPLETED" - - // StepStatusFailed is a StepStatus enum value - StepStatusFailed = "FAILED" - - // StepStatusPaused is a StepStatus enum value - StepStatusPaused = "PAUSED" - - // StepStatusUserAttentionRequired is a StepStatus enum value - StepStatusUserAttentionRequired = "USER_ATTENTION_REQUIRED" -) - -// StepStatus_Values returns all elements of the StepStatus enum -func StepStatus_Values() []string { - return []string{ - StepStatusAwaitingDependencies, - StepStatusReady, - StepStatusInProgress, - StepStatusCompleted, - StepStatusFailed, - StepStatusPaused, - StepStatusUserAttentionRequired, - } -} - -const ( - // TargetTypeSingle is a TargetType enum value - TargetTypeSingle = "SINGLE" - - // TargetTypeAll is a TargetType enum value - TargetTypeAll = "ALL" - - // TargetTypeNone is a TargetType enum value - TargetTypeNone = "NONE" -) - -// TargetType_Values returns all elements of the TargetType enum -func TargetType_Values() []string { - return []string{ - TargetTypeSingle, - TargetTypeAll, - TargetTypeNone, - } -} - -const ( - // TemplateStatusCreated is a TemplateStatus enum value - TemplateStatusCreated = "CREATED" -) - -// TemplateStatus_Values returns all elements of the TemplateStatus enum -func TemplateStatus_Values() []string { - return []string{ - TemplateStatusCreated, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/doc.go deleted file mode 100644 index 7994b962e5ff..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package migrationhuborchestrator provides the client and types for making API -// requests to AWS Migration Hub Orchestrator. -// -// This API reference provides descriptions, syntax, and other details about -// each of the actions and data types for AWS Migration Hub Orchestrator. he -// topic for each action shows the API request parameters and the response. -// Alternatively, you can use one of the AWS SDKs to access an API that is tailored -// to the programming language or platform that you're using. -// -// See https://docs.aws.amazon.com/goto/WebAPI/migrationhuborchestrator-2021-08-28 for more information on this service. -// -// See migrationhuborchestrator package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/migrationhuborchestrator/ -// -// # Using the Client -// -// To contact AWS Migration Hub Orchestrator with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Migration Hub Orchestrator client MigrationHubOrchestrator for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/migrationhuborchestrator/#New -package migrationhuborchestrator diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/errors.go deleted file mode 100644 index 9d47998f9c20..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/errors.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package migrationhuborchestrator - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An internal error has occurred. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource is not available. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/migrationhuborchestratoriface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/migrationhuborchestratoriface/interface.go deleted file mode 100644 index 1facb43bd9c5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/migrationhuborchestratoriface/interface.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package migrationhuborchestratoriface provides an interface to enable mocking the AWS Migration Hub Orchestrator service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package migrationhuborchestratoriface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator" -) - -// MigrationHubOrchestratorAPI provides an interface to enable mocking the -// migrationhuborchestrator.MigrationHubOrchestrator service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Migration Hub Orchestrator. -// func myFunc(svc migrationhuborchestratoriface.MigrationHubOrchestratorAPI) bool { -// // Make svc.CreateWorkflow request -// } -// -// func main() { -// sess := session.New() -// svc := migrationhuborchestrator.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockMigrationHubOrchestratorClient struct { -// migrationhuborchestratoriface.MigrationHubOrchestratorAPI -// } -// func (m *mockMigrationHubOrchestratorClient) CreateWorkflow(input *migrationhuborchestrator.CreateWorkflowInput) (*migrationhuborchestrator.CreateWorkflowOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockMigrationHubOrchestratorClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type MigrationHubOrchestratorAPI interface { - CreateWorkflow(*migrationhuborchestrator.CreateWorkflowInput) (*migrationhuborchestrator.CreateWorkflowOutput, error) - CreateWorkflowWithContext(aws.Context, *migrationhuborchestrator.CreateWorkflowInput, ...request.Option) (*migrationhuborchestrator.CreateWorkflowOutput, error) - CreateWorkflowRequest(*migrationhuborchestrator.CreateWorkflowInput) (*request.Request, *migrationhuborchestrator.CreateWorkflowOutput) - - CreateWorkflowStep(*migrationhuborchestrator.CreateWorkflowStepInput) (*migrationhuborchestrator.CreateWorkflowStepOutput, error) - CreateWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.CreateWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.CreateWorkflowStepOutput, error) - CreateWorkflowStepRequest(*migrationhuborchestrator.CreateWorkflowStepInput) (*request.Request, *migrationhuborchestrator.CreateWorkflowStepOutput) - - CreateWorkflowStepGroup(*migrationhuborchestrator.CreateWorkflowStepGroupInput) (*migrationhuborchestrator.CreateWorkflowStepGroupOutput, error) - CreateWorkflowStepGroupWithContext(aws.Context, *migrationhuborchestrator.CreateWorkflowStepGroupInput, ...request.Option) (*migrationhuborchestrator.CreateWorkflowStepGroupOutput, error) - CreateWorkflowStepGroupRequest(*migrationhuborchestrator.CreateWorkflowStepGroupInput) (*request.Request, *migrationhuborchestrator.CreateWorkflowStepGroupOutput) - - DeleteWorkflow(*migrationhuborchestrator.DeleteWorkflowInput) (*migrationhuborchestrator.DeleteWorkflowOutput, error) - DeleteWorkflowWithContext(aws.Context, *migrationhuborchestrator.DeleteWorkflowInput, ...request.Option) (*migrationhuborchestrator.DeleteWorkflowOutput, error) - DeleteWorkflowRequest(*migrationhuborchestrator.DeleteWorkflowInput) (*request.Request, *migrationhuborchestrator.DeleteWorkflowOutput) - - DeleteWorkflowStep(*migrationhuborchestrator.DeleteWorkflowStepInput) (*migrationhuborchestrator.DeleteWorkflowStepOutput, error) - DeleteWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.DeleteWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.DeleteWorkflowStepOutput, error) - DeleteWorkflowStepRequest(*migrationhuborchestrator.DeleteWorkflowStepInput) (*request.Request, *migrationhuborchestrator.DeleteWorkflowStepOutput) - - DeleteWorkflowStepGroup(*migrationhuborchestrator.DeleteWorkflowStepGroupInput) (*migrationhuborchestrator.DeleteWorkflowStepGroupOutput, error) - DeleteWorkflowStepGroupWithContext(aws.Context, *migrationhuborchestrator.DeleteWorkflowStepGroupInput, ...request.Option) (*migrationhuborchestrator.DeleteWorkflowStepGroupOutput, error) - DeleteWorkflowStepGroupRequest(*migrationhuborchestrator.DeleteWorkflowStepGroupInput) (*request.Request, *migrationhuborchestrator.DeleteWorkflowStepGroupOutput) - - GetTemplate(*migrationhuborchestrator.GetTemplateInput) (*migrationhuborchestrator.GetTemplateOutput, error) - GetTemplateWithContext(aws.Context, *migrationhuborchestrator.GetTemplateInput, ...request.Option) (*migrationhuborchestrator.GetTemplateOutput, error) - GetTemplateRequest(*migrationhuborchestrator.GetTemplateInput) (*request.Request, *migrationhuborchestrator.GetTemplateOutput) - - GetTemplateStep(*migrationhuborchestrator.GetTemplateStepInput) (*migrationhuborchestrator.GetTemplateStepOutput, error) - GetTemplateStepWithContext(aws.Context, *migrationhuborchestrator.GetTemplateStepInput, ...request.Option) (*migrationhuborchestrator.GetTemplateStepOutput, error) - GetTemplateStepRequest(*migrationhuborchestrator.GetTemplateStepInput) (*request.Request, *migrationhuborchestrator.GetTemplateStepOutput) - - GetTemplateStepGroup(*migrationhuborchestrator.GetTemplateStepGroupInput) (*migrationhuborchestrator.GetTemplateStepGroupOutput, error) - GetTemplateStepGroupWithContext(aws.Context, *migrationhuborchestrator.GetTemplateStepGroupInput, ...request.Option) (*migrationhuborchestrator.GetTemplateStepGroupOutput, error) - GetTemplateStepGroupRequest(*migrationhuborchestrator.GetTemplateStepGroupInput) (*request.Request, *migrationhuborchestrator.GetTemplateStepGroupOutput) - - GetWorkflow(*migrationhuborchestrator.GetWorkflowInput) (*migrationhuborchestrator.GetWorkflowOutput, error) - GetWorkflowWithContext(aws.Context, *migrationhuborchestrator.GetWorkflowInput, ...request.Option) (*migrationhuborchestrator.GetWorkflowOutput, error) - GetWorkflowRequest(*migrationhuborchestrator.GetWorkflowInput) (*request.Request, *migrationhuborchestrator.GetWorkflowOutput) - - GetWorkflowStep(*migrationhuborchestrator.GetWorkflowStepInput) (*migrationhuborchestrator.GetWorkflowStepOutput, error) - GetWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.GetWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.GetWorkflowStepOutput, error) - GetWorkflowStepRequest(*migrationhuborchestrator.GetWorkflowStepInput) (*request.Request, *migrationhuborchestrator.GetWorkflowStepOutput) - - GetWorkflowStepGroup(*migrationhuborchestrator.GetWorkflowStepGroupInput) (*migrationhuborchestrator.GetWorkflowStepGroupOutput, error) - GetWorkflowStepGroupWithContext(aws.Context, *migrationhuborchestrator.GetWorkflowStepGroupInput, ...request.Option) (*migrationhuborchestrator.GetWorkflowStepGroupOutput, error) - GetWorkflowStepGroupRequest(*migrationhuborchestrator.GetWorkflowStepGroupInput) (*request.Request, *migrationhuborchestrator.GetWorkflowStepGroupOutput) - - ListPlugins(*migrationhuborchestrator.ListPluginsInput) (*migrationhuborchestrator.ListPluginsOutput, error) - ListPluginsWithContext(aws.Context, *migrationhuborchestrator.ListPluginsInput, ...request.Option) (*migrationhuborchestrator.ListPluginsOutput, error) - ListPluginsRequest(*migrationhuborchestrator.ListPluginsInput) (*request.Request, *migrationhuborchestrator.ListPluginsOutput) - - ListPluginsPages(*migrationhuborchestrator.ListPluginsInput, func(*migrationhuborchestrator.ListPluginsOutput, bool) bool) error - ListPluginsPagesWithContext(aws.Context, *migrationhuborchestrator.ListPluginsInput, func(*migrationhuborchestrator.ListPluginsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*migrationhuborchestrator.ListTagsForResourceInput) (*migrationhuborchestrator.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *migrationhuborchestrator.ListTagsForResourceInput, ...request.Option) (*migrationhuborchestrator.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*migrationhuborchestrator.ListTagsForResourceInput) (*request.Request, *migrationhuborchestrator.ListTagsForResourceOutput) - - ListTemplateStepGroups(*migrationhuborchestrator.ListTemplateStepGroupsInput) (*migrationhuborchestrator.ListTemplateStepGroupsOutput, error) - ListTemplateStepGroupsWithContext(aws.Context, *migrationhuborchestrator.ListTemplateStepGroupsInput, ...request.Option) (*migrationhuborchestrator.ListTemplateStepGroupsOutput, error) - ListTemplateStepGroupsRequest(*migrationhuborchestrator.ListTemplateStepGroupsInput) (*request.Request, *migrationhuborchestrator.ListTemplateStepGroupsOutput) - - ListTemplateStepGroupsPages(*migrationhuborchestrator.ListTemplateStepGroupsInput, func(*migrationhuborchestrator.ListTemplateStepGroupsOutput, bool) bool) error - ListTemplateStepGroupsPagesWithContext(aws.Context, *migrationhuborchestrator.ListTemplateStepGroupsInput, func(*migrationhuborchestrator.ListTemplateStepGroupsOutput, bool) bool, ...request.Option) error - - ListTemplateSteps(*migrationhuborchestrator.ListTemplateStepsInput) (*migrationhuborchestrator.ListTemplateStepsOutput, error) - ListTemplateStepsWithContext(aws.Context, *migrationhuborchestrator.ListTemplateStepsInput, ...request.Option) (*migrationhuborchestrator.ListTemplateStepsOutput, error) - ListTemplateStepsRequest(*migrationhuborchestrator.ListTemplateStepsInput) (*request.Request, *migrationhuborchestrator.ListTemplateStepsOutput) - - ListTemplateStepsPages(*migrationhuborchestrator.ListTemplateStepsInput, func(*migrationhuborchestrator.ListTemplateStepsOutput, bool) bool) error - ListTemplateStepsPagesWithContext(aws.Context, *migrationhuborchestrator.ListTemplateStepsInput, func(*migrationhuborchestrator.ListTemplateStepsOutput, bool) bool, ...request.Option) error - - ListTemplates(*migrationhuborchestrator.ListTemplatesInput) (*migrationhuborchestrator.ListTemplatesOutput, error) - ListTemplatesWithContext(aws.Context, *migrationhuborchestrator.ListTemplatesInput, ...request.Option) (*migrationhuborchestrator.ListTemplatesOutput, error) - ListTemplatesRequest(*migrationhuborchestrator.ListTemplatesInput) (*request.Request, *migrationhuborchestrator.ListTemplatesOutput) - - ListTemplatesPages(*migrationhuborchestrator.ListTemplatesInput, func(*migrationhuborchestrator.ListTemplatesOutput, bool) bool) error - ListTemplatesPagesWithContext(aws.Context, *migrationhuborchestrator.ListTemplatesInput, func(*migrationhuborchestrator.ListTemplatesOutput, bool) bool, ...request.Option) error - - ListWorkflowStepGroups(*migrationhuborchestrator.ListWorkflowStepGroupsInput) (*migrationhuborchestrator.ListWorkflowStepGroupsOutput, error) - ListWorkflowStepGroupsWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowStepGroupsInput, ...request.Option) (*migrationhuborchestrator.ListWorkflowStepGroupsOutput, error) - ListWorkflowStepGroupsRequest(*migrationhuborchestrator.ListWorkflowStepGroupsInput) (*request.Request, *migrationhuborchestrator.ListWorkflowStepGroupsOutput) - - ListWorkflowStepGroupsPages(*migrationhuborchestrator.ListWorkflowStepGroupsInput, func(*migrationhuborchestrator.ListWorkflowStepGroupsOutput, bool) bool) error - ListWorkflowStepGroupsPagesWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowStepGroupsInput, func(*migrationhuborchestrator.ListWorkflowStepGroupsOutput, bool) bool, ...request.Option) error - - ListWorkflowSteps(*migrationhuborchestrator.ListWorkflowStepsInput) (*migrationhuborchestrator.ListWorkflowStepsOutput, error) - ListWorkflowStepsWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowStepsInput, ...request.Option) (*migrationhuborchestrator.ListWorkflowStepsOutput, error) - ListWorkflowStepsRequest(*migrationhuborchestrator.ListWorkflowStepsInput) (*request.Request, *migrationhuborchestrator.ListWorkflowStepsOutput) - - ListWorkflowStepsPages(*migrationhuborchestrator.ListWorkflowStepsInput, func(*migrationhuborchestrator.ListWorkflowStepsOutput, bool) bool) error - ListWorkflowStepsPagesWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowStepsInput, func(*migrationhuborchestrator.ListWorkflowStepsOutput, bool) bool, ...request.Option) error - - ListWorkflows(*migrationhuborchestrator.ListWorkflowsInput) (*migrationhuborchestrator.ListWorkflowsOutput, error) - ListWorkflowsWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowsInput, ...request.Option) (*migrationhuborchestrator.ListWorkflowsOutput, error) - ListWorkflowsRequest(*migrationhuborchestrator.ListWorkflowsInput) (*request.Request, *migrationhuborchestrator.ListWorkflowsOutput) - - ListWorkflowsPages(*migrationhuborchestrator.ListWorkflowsInput, func(*migrationhuborchestrator.ListWorkflowsOutput, bool) bool) error - ListWorkflowsPagesWithContext(aws.Context, *migrationhuborchestrator.ListWorkflowsInput, func(*migrationhuborchestrator.ListWorkflowsOutput, bool) bool, ...request.Option) error - - RetryWorkflowStep(*migrationhuborchestrator.RetryWorkflowStepInput) (*migrationhuborchestrator.RetryWorkflowStepOutput, error) - RetryWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.RetryWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.RetryWorkflowStepOutput, error) - RetryWorkflowStepRequest(*migrationhuborchestrator.RetryWorkflowStepInput) (*request.Request, *migrationhuborchestrator.RetryWorkflowStepOutput) - - StartWorkflow(*migrationhuborchestrator.StartWorkflowInput) (*migrationhuborchestrator.StartWorkflowOutput, error) - StartWorkflowWithContext(aws.Context, *migrationhuborchestrator.StartWorkflowInput, ...request.Option) (*migrationhuborchestrator.StartWorkflowOutput, error) - StartWorkflowRequest(*migrationhuborchestrator.StartWorkflowInput) (*request.Request, *migrationhuborchestrator.StartWorkflowOutput) - - StopWorkflow(*migrationhuborchestrator.StopWorkflowInput) (*migrationhuborchestrator.StopWorkflowOutput, error) - StopWorkflowWithContext(aws.Context, *migrationhuborchestrator.StopWorkflowInput, ...request.Option) (*migrationhuborchestrator.StopWorkflowOutput, error) - StopWorkflowRequest(*migrationhuborchestrator.StopWorkflowInput) (*request.Request, *migrationhuborchestrator.StopWorkflowOutput) - - TagResource(*migrationhuborchestrator.TagResourceInput) (*migrationhuborchestrator.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *migrationhuborchestrator.TagResourceInput, ...request.Option) (*migrationhuborchestrator.TagResourceOutput, error) - TagResourceRequest(*migrationhuborchestrator.TagResourceInput) (*request.Request, *migrationhuborchestrator.TagResourceOutput) - - UntagResource(*migrationhuborchestrator.UntagResourceInput) (*migrationhuborchestrator.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *migrationhuborchestrator.UntagResourceInput, ...request.Option) (*migrationhuborchestrator.UntagResourceOutput, error) - UntagResourceRequest(*migrationhuborchestrator.UntagResourceInput) (*request.Request, *migrationhuborchestrator.UntagResourceOutput) - - UpdateWorkflow(*migrationhuborchestrator.UpdateWorkflowInput) (*migrationhuborchestrator.UpdateWorkflowOutput, error) - UpdateWorkflowWithContext(aws.Context, *migrationhuborchestrator.UpdateWorkflowInput, ...request.Option) (*migrationhuborchestrator.UpdateWorkflowOutput, error) - UpdateWorkflowRequest(*migrationhuborchestrator.UpdateWorkflowInput) (*request.Request, *migrationhuborchestrator.UpdateWorkflowOutput) - - UpdateWorkflowStep(*migrationhuborchestrator.UpdateWorkflowStepInput) (*migrationhuborchestrator.UpdateWorkflowStepOutput, error) - UpdateWorkflowStepWithContext(aws.Context, *migrationhuborchestrator.UpdateWorkflowStepInput, ...request.Option) (*migrationhuborchestrator.UpdateWorkflowStepOutput, error) - UpdateWorkflowStepRequest(*migrationhuborchestrator.UpdateWorkflowStepInput) (*request.Request, *migrationhuborchestrator.UpdateWorkflowStepOutput) - - UpdateWorkflowStepGroup(*migrationhuborchestrator.UpdateWorkflowStepGroupInput) (*migrationhuborchestrator.UpdateWorkflowStepGroupOutput, error) - UpdateWorkflowStepGroupWithContext(aws.Context, *migrationhuborchestrator.UpdateWorkflowStepGroupInput, ...request.Option) (*migrationhuborchestrator.UpdateWorkflowStepGroupOutput, error) - UpdateWorkflowStepGroupRequest(*migrationhuborchestrator.UpdateWorkflowStepGroupInput) (*request.Request, *migrationhuborchestrator.UpdateWorkflowStepGroupOutput) -} - -var _ MigrationHubOrchestratorAPI = (*migrationhuborchestrator.MigrationHubOrchestrator)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/service.go deleted file mode 100644 index b7c9e50311af..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/migrationhuborchestrator/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package migrationhuborchestrator - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// MigrationHubOrchestrator provides the API operation methods for making requests to -// AWS Migration Hub Orchestrator. See this package's package overview docs -// for details on the service. -// -// MigrationHubOrchestrator methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type MigrationHubOrchestrator struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "MigrationHubOrchestrator" // Name of service. - EndpointsID = "migrationhub-orchestrator" // ID to lookup a service endpoint with. - ServiceID = "MigrationHubOrchestrator" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the MigrationHubOrchestrator client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a MigrationHubOrchestrator client from just a session. -// svc := migrationhuborchestrator.New(mySession) -// -// // Create a MigrationHubOrchestrator client with additional configuration -// svc := migrationhuborchestrator.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *MigrationHubOrchestrator { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "migrationhub-orchestrator" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *MigrationHubOrchestrator { - svc := &MigrationHubOrchestrator{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-08-28", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a MigrationHubOrchestrator operation and runs any -// custom request initialization. -func (c *MigrationHubOrchestrator) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/api.go deleted file mode 100644 index 9d27af860eaf..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/api.go +++ /dev/null @@ -1,13906 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package neptunedata - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opCancelGremlinQuery = "CancelGremlinQuery" - -// CancelGremlinQueryRequest generates a "aws/request.Request" representing the -// client's request for the CancelGremlinQuery 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 CancelGremlinQuery for more information on using the CancelGremlinQuery -// 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 CancelGremlinQueryRequest method. -// req, resp := client.CancelGremlinQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelGremlinQuery -func (c *Neptunedata) CancelGremlinQueryRequest(input *CancelGremlinQueryInput) (req *request.Request, output *CancelGremlinQueryOutput) { - op := &request.Operation{ - Name: opCancelGremlinQuery, - HTTPMethod: "DELETE", - HTTPPath: "/gremlin/status/{queryId}", - } - - if input == nil { - input = &CancelGremlinQueryInput{} - } - - output = &CancelGremlinQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelGremlinQuery API operation for Amazon NeptuneData. -// -// Cancels a Gremlin query. See Gremlin query cancellation (https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-api-status-cancel.html) -// for more information. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:CancelQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#cancelquery) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation CancelGremlinQuery for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelGremlinQuery -func (c *Neptunedata) CancelGremlinQuery(input *CancelGremlinQueryInput) (*CancelGremlinQueryOutput, error) { - req, out := c.CancelGremlinQueryRequest(input) - return out, req.Send() -} - -// CancelGremlinQueryWithContext is the same as CancelGremlinQuery with the addition of -// the ability to pass a context and additional request options. -// -// See CancelGremlinQuery 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 *Neptunedata) CancelGremlinQueryWithContext(ctx aws.Context, input *CancelGremlinQueryInput, opts ...request.Option) (*CancelGremlinQueryOutput, error) { - req, out := c.CancelGremlinQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelLoaderJob = "CancelLoaderJob" - -// CancelLoaderJobRequest generates a "aws/request.Request" representing the -// client's request for the CancelLoaderJob 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 CancelLoaderJob for more information on using the CancelLoaderJob -// 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 CancelLoaderJobRequest method. -// req, resp := client.CancelLoaderJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelLoaderJob -func (c *Neptunedata) CancelLoaderJobRequest(input *CancelLoaderJobInput) (req *request.Request, output *CancelLoaderJobOutput) { - op := &request.Operation{ - Name: opCancelLoaderJob, - HTTPMethod: "DELETE", - HTTPPath: "/loader/{loadId}", - } - - if input == nil { - input = &CancelLoaderJobInput{} - } - - output = &CancelLoaderJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelLoaderJob API operation for Amazon NeptuneData. -// -// Cancels a specified load job. This is an HTTP DELETE request. See Neptune -// Loader Get-Status API (https://docs.aws.amazon.com/neptune/latest/userguide/load-api-reference-status.htm) -// for more information. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:CancelLoaderJob (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#cancelloaderjob) -// IAM action in that cluster.. -// -// 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 NeptuneData's -// API operation CancelLoaderJob for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - BulkLoadIdNotFoundException -// Raised when a specified bulk-load job ID cannot be found. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - LoadUrlAccessDeniedException -// Raised when access is denied to a specified load URL. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - InternalFailureException -// Raised when the processing of the request failed unexpectedly. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelLoaderJob -func (c *Neptunedata) CancelLoaderJob(input *CancelLoaderJobInput) (*CancelLoaderJobOutput, error) { - req, out := c.CancelLoaderJobRequest(input) - return out, req.Send() -} - -// CancelLoaderJobWithContext is the same as CancelLoaderJob with the addition of -// the ability to pass a context and additional request options. -// -// See CancelLoaderJob 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 *Neptunedata) CancelLoaderJobWithContext(ctx aws.Context, input *CancelLoaderJobInput, opts ...request.Option) (*CancelLoaderJobOutput, error) { - req, out := c.CancelLoaderJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelMLDataProcessingJob = "CancelMLDataProcessingJob" - -// CancelMLDataProcessingJobRequest generates a "aws/request.Request" representing the -// client's request for the CancelMLDataProcessingJob 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 CancelMLDataProcessingJob for more information on using the CancelMLDataProcessingJob -// 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 CancelMLDataProcessingJobRequest method. -// req, resp := client.CancelMLDataProcessingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelMLDataProcessingJob -func (c *Neptunedata) CancelMLDataProcessingJobRequest(input *CancelMLDataProcessingJobInput) (req *request.Request, output *CancelMLDataProcessingJobOutput) { - op := &request.Operation{ - Name: opCancelMLDataProcessingJob, - HTTPMethod: "DELETE", - HTTPPath: "/ml/dataprocessing/{id}", - } - - if input == nil { - input = &CancelMLDataProcessingJobInput{} - } - - output = &CancelMLDataProcessingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelMLDataProcessingJob API operation for Amazon NeptuneData. -// -// Cancels a Neptune ML data processing job. See The dataprocessing command -// (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-dataprocessing.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:CancelMLDataProcessingJob (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#cancelmldataprocessingjob) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation CancelMLDataProcessingJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelMLDataProcessingJob -func (c *Neptunedata) CancelMLDataProcessingJob(input *CancelMLDataProcessingJobInput) (*CancelMLDataProcessingJobOutput, error) { - req, out := c.CancelMLDataProcessingJobRequest(input) - return out, req.Send() -} - -// CancelMLDataProcessingJobWithContext is the same as CancelMLDataProcessingJob with the addition of -// the ability to pass a context and additional request options. -// -// See CancelMLDataProcessingJob 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 *Neptunedata) CancelMLDataProcessingJobWithContext(ctx aws.Context, input *CancelMLDataProcessingJobInput, opts ...request.Option) (*CancelMLDataProcessingJobOutput, error) { - req, out := c.CancelMLDataProcessingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelMLModelTrainingJob = "CancelMLModelTrainingJob" - -// CancelMLModelTrainingJobRequest generates a "aws/request.Request" representing the -// client's request for the CancelMLModelTrainingJob 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 CancelMLModelTrainingJob for more information on using the CancelMLModelTrainingJob -// 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 CancelMLModelTrainingJobRequest method. -// req, resp := client.CancelMLModelTrainingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelMLModelTrainingJob -func (c *Neptunedata) CancelMLModelTrainingJobRequest(input *CancelMLModelTrainingJobInput) (req *request.Request, output *CancelMLModelTrainingJobOutput) { - op := &request.Operation{ - Name: opCancelMLModelTrainingJob, - HTTPMethod: "DELETE", - HTTPPath: "/ml/modeltraining/{id}", - } - - if input == nil { - input = &CancelMLModelTrainingJobInput{} - } - - output = &CancelMLModelTrainingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelMLModelTrainingJob API operation for Amazon NeptuneData. -// -// Cancels a Neptune ML model training job. See Model training using the modeltraining -// command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-modeltraining.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:CancelMLModelTrainingJob (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#cancelmlmodeltrainingjob) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation CancelMLModelTrainingJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelMLModelTrainingJob -func (c *Neptunedata) CancelMLModelTrainingJob(input *CancelMLModelTrainingJobInput) (*CancelMLModelTrainingJobOutput, error) { - req, out := c.CancelMLModelTrainingJobRequest(input) - return out, req.Send() -} - -// CancelMLModelTrainingJobWithContext is the same as CancelMLModelTrainingJob with the addition of -// the ability to pass a context and additional request options. -// -// See CancelMLModelTrainingJob 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 *Neptunedata) CancelMLModelTrainingJobWithContext(ctx aws.Context, input *CancelMLModelTrainingJobInput, opts ...request.Option) (*CancelMLModelTrainingJobOutput, error) { - req, out := c.CancelMLModelTrainingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelMLModelTransformJob = "CancelMLModelTransformJob" - -// CancelMLModelTransformJobRequest generates a "aws/request.Request" representing the -// client's request for the CancelMLModelTransformJob 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 CancelMLModelTransformJob for more information on using the CancelMLModelTransformJob -// 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 CancelMLModelTransformJobRequest method. -// req, resp := client.CancelMLModelTransformJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelMLModelTransformJob -func (c *Neptunedata) CancelMLModelTransformJobRequest(input *CancelMLModelTransformJobInput) (req *request.Request, output *CancelMLModelTransformJobOutput) { - op := &request.Operation{ - Name: opCancelMLModelTransformJob, - HTTPMethod: "DELETE", - HTTPPath: "/ml/modeltransform/{id}", - } - - if input == nil { - input = &CancelMLModelTransformJobInput{} - } - - output = &CancelMLModelTransformJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelMLModelTransformJob API operation for Amazon NeptuneData. -// -// Cancels a specified model transform job. See Use a trained model to generate -// new model artifacts (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-model-transform.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:CancelMLModelTransformJob (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#cancelmlmodeltransformjob) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation CancelMLModelTransformJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelMLModelTransformJob -func (c *Neptunedata) CancelMLModelTransformJob(input *CancelMLModelTransformJobInput) (*CancelMLModelTransformJobOutput, error) { - req, out := c.CancelMLModelTransformJobRequest(input) - return out, req.Send() -} - -// CancelMLModelTransformJobWithContext is the same as CancelMLModelTransformJob with the addition of -// the ability to pass a context and additional request options. -// -// See CancelMLModelTransformJob 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 *Neptunedata) CancelMLModelTransformJobWithContext(ctx aws.Context, input *CancelMLModelTransformJobInput, opts ...request.Option) (*CancelMLModelTransformJobOutput, error) { - req, out := c.CancelMLModelTransformJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelOpenCypherQuery = "CancelOpenCypherQuery" - -// CancelOpenCypherQueryRequest generates a "aws/request.Request" representing the -// client's request for the CancelOpenCypherQuery 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 CancelOpenCypherQuery for more information on using the CancelOpenCypherQuery -// 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 CancelOpenCypherQueryRequest method. -// req, resp := client.CancelOpenCypherQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelOpenCypherQuery -func (c *Neptunedata) CancelOpenCypherQueryRequest(input *CancelOpenCypherQueryInput) (req *request.Request, output *CancelOpenCypherQueryOutput) { - op := &request.Operation{ - Name: opCancelOpenCypherQuery, - HTTPMethod: "DELETE", - HTTPPath: "/opencypher/status/{queryId}", - } - - if input == nil { - input = &CancelOpenCypherQueryInput{} - } - - output = &CancelOpenCypherQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelOpenCypherQuery API operation for Amazon NeptuneData. -// -// Cancels a specified openCypher query. See Neptune openCypher status endpoint -// (https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-opencypher-status.html) -// for more information. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:CancelQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#cancelquery) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation CancelOpenCypherQuery for usage and error information. -// -// Returned Error Types: -// -// - InvalidNumericDataException -// Raised when invalid numerical data is encountered when servicing a request. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CancelOpenCypherQuery -func (c *Neptunedata) CancelOpenCypherQuery(input *CancelOpenCypherQueryInput) (*CancelOpenCypherQueryOutput, error) { - req, out := c.CancelOpenCypherQueryRequest(input) - return out, req.Send() -} - -// CancelOpenCypherQueryWithContext is the same as CancelOpenCypherQuery with the addition of -// the ability to pass a context and additional request options. -// -// See CancelOpenCypherQuery 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 *Neptunedata) CancelOpenCypherQueryWithContext(ctx aws.Context, input *CancelOpenCypherQueryInput, opts ...request.Option) (*CancelOpenCypherQueryOutput, error) { - req, out := c.CancelOpenCypherQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateMLEndpoint = "CreateMLEndpoint" - -// CreateMLEndpointRequest generates a "aws/request.Request" representing the -// client's request for the CreateMLEndpoint 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 CreateMLEndpoint for more information on using the CreateMLEndpoint -// 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 CreateMLEndpointRequest method. -// req, resp := client.CreateMLEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CreateMLEndpoint -func (c *Neptunedata) CreateMLEndpointRequest(input *CreateMLEndpointInput) (req *request.Request, output *CreateMLEndpointOutput) { - op := &request.Operation{ - Name: opCreateMLEndpoint, - HTTPMethod: "POST", - HTTPPath: "/ml/endpoints", - } - - if input == nil { - input = &CreateMLEndpointInput{} - } - - output = &CreateMLEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateMLEndpoint API operation for Amazon NeptuneData. -// -// Creates a new Neptune ML inference endpoint that lets you query one specific -// model that the model-training process constructed. See Managing inference -// endpoints using the endpoints command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-endpoints.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:CreateMLEndpoint (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#createmlendpoint) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation CreateMLEndpoint for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CreateMLEndpoint -func (c *Neptunedata) CreateMLEndpoint(input *CreateMLEndpointInput) (*CreateMLEndpointOutput, error) { - req, out := c.CreateMLEndpointRequest(input) - return out, req.Send() -} - -// CreateMLEndpointWithContext is the same as CreateMLEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See CreateMLEndpoint 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 *Neptunedata) CreateMLEndpointWithContext(ctx aws.Context, input *CreateMLEndpointInput, opts ...request.Option) (*CreateMLEndpointOutput, error) { - req, out := c.CreateMLEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteMLEndpoint = "DeleteMLEndpoint" - -// DeleteMLEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DeleteMLEndpoint 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 DeleteMLEndpoint for more information on using the DeleteMLEndpoint -// 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 DeleteMLEndpointRequest method. -// req, resp := client.DeleteMLEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/DeleteMLEndpoint -func (c *Neptunedata) DeleteMLEndpointRequest(input *DeleteMLEndpointInput) (req *request.Request, output *DeleteMLEndpointOutput) { - op := &request.Operation{ - Name: opDeleteMLEndpoint, - HTTPMethod: "DELETE", - HTTPPath: "/ml/endpoints/{id}", - } - - if input == nil { - input = &DeleteMLEndpointInput{} - } - - output = &DeleteMLEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteMLEndpoint API operation for Amazon NeptuneData. -// -// Cancels the creation of a Neptune ML inference endpoint. See Managing inference -// endpoints using the endpoints command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-endpoints.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:DeleteMLEndpoint (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#deletemlendpoint) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation DeleteMLEndpoint for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/DeleteMLEndpoint -func (c *Neptunedata) DeleteMLEndpoint(input *DeleteMLEndpointInput) (*DeleteMLEndpointOutput, error) { - req, out := c.DeleteMLEndpointRequest(input) - return out, req.Send() -} - -// DeleteMLEndpointWithContext is the same as DeleteMLEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteMLEndpoint 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 *Neptunedata) DeleteMLEndpointWithContext(ctx aws.Context, input *DeleteMLEndpointInput, opts ...request.Option) (*DeleteMLEndpointOutput, error) { - req, out := c.DeleteMLEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePropertygraphStatistics = "DeletePropertygraphStatistics" - -// DeletePropertygraphStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the DeletePropertygraphStatistics 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 DeletePropertygraphStatistics for more information on using the DeletePropertygraphStatistics -// 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 DeletePropertygraphStatisticsRequest method. -// req, resp := client.DeletePropertygraphStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/DeletePropertygraphStatistics -func (c *Neptunedata) DeletePropertygraphStatisticsRequest(input *DeletePropertygraphStatisticsInput) (req *request.Request, output *DeletePropertygraphStatisticsOutput) { - op := &request.Operation{ - Name: opDeletePropertygraphStatistics, - HTTPMethod: "DELETE", - HTTPPath: "/propertygraph/statistics", - } - - if input == nil { - input = &DeletePropertygraphStatisticsInput{} - } - - output = &DeletePropertygraphStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeletePropertygraphStatistics API operation for Amazon NeptuneData. -// -// Deletes statistics for Gremlin and openCypher (property graph) data. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:DeleteStatistics (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#deletestatistics) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation DeletePropertygraphStatistics for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - StatisticsNotAvailableException -// Raised when statistics needed to satisfy a request are not available. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/DeletePropertygraphStatistics -func (c *Neptunedata) DeletePropertygraphStatistics(input *DeletePropertygraphStatisticsInput) (*DeletePropertygraphStatisticsOutput, error) { - req, out := c.DeletePropertygraphStatisticsRequest(input) - return out, req.Send() -} - -// DeletePropertygraphStatisticsWithContext is the same as DeletePropertygraphStatistics with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePropertygraphStatistics 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 *Neptunedata) DeletePropertygraphStatisticsWithContext(ctx aws.Context, input *DeletePropertygraphStatisticsInput, opts ...request.Option) (*DeletePropertygraphStatisticsOutput, error) { - req, out := c.DeletePropertygraphStatisticsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSparqlStatistics = "DeleteSparqlStatistics" - -// DeleteSparqlStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSparqlStatistics 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 DeleteSparqlStatistics for more information on using the DeleteSparqlStatistics -// 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 DeleteSparqlStatisticsRequest method. -// req, resp := client.DeleteSparqlStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/DeleteSparqlStatistics -func (c *Neptunedata) DeleteSparqlStatisticsRequest(input *DeleteSparqlStatisticsInput) (req *request.Request, output *DeleteSparqlStatisticsOutput) { - op := &request.Operation{ - Name: opDeleteSparqlStatistics, - HTTPMethod: "DELETE", - HTTPPath: "/sparql/statistics", - } - - if input == nil { - input = &DeleteSparqlStatisticsInput{} - } - - output = &DeleteSparqlStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSparqlStatistics API operation for Amazon NeptuneData. -// -// # Deletes SPARQL statistics -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:DeleteStatistics (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#deletestatistics) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation DeleteSparqlStatistics for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - StatisticsNotAvailableException -// Raised when statistics needed to satisfy a request are not available. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/DeleteSparqlStatistics -func (c *Neptunedata) DeleteSparqlStatistics(input *DeleteSparqlStatisticsInput) (*DeleteSparqlStatisticsOutput, error) { - req, out := c.DeleteSparqlStatisticsRequest(input) - return out, req.Send() -} - -// DeleteSparqlStatisticsWithContext is the same as DeleteSparqlStatistics with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSparqlStatistics 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 *Neptunedata) DeleteSparqlStatisticsWithContext(ctx aws.Context, input *DeleteSparqlStatisticsInput, opts ...request.Option) (*DeleteSparqlStatisticsOutput, error) { - req, out := c.DeleteSparqlStatisticsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExecuteFastReset = "ExecuteFastReset" - -// ExecuteFastResetRequest generates a "aws/request.Request" representing the -// client's request for the ExecuteFastReset 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 ExecuteFastReset for more information on using the ExecuteFastReset -// 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 ExecuteFastResetRequest method. -// req, resp := client.ExecuteFastResetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteFastReset -func (c *Neptunedata) ExecuteFastResetRequest(input *ExecuteFastResetInput) (req *request.Request, output *ExecuteFastResetOutput) { - op := &request.Operation{ - Name: opExecuteFastReset, - HTTPMethod: "POST", - HTTPPath: "/system", - } - - if input == nil { - input = &ExecuteFastResetInput{} - } - - output = &ExecuteFastResetOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExecuteFastReset API operation for Amazon NeptuneData. -// -// The fast reset REST API lets you reset a Neptune graph quicky and easily, -// removing all of its data. -// -// Neptune fast reset is a two-step process. First you call ExecuteFastReset -// with action set to initiateDatabaseReset. This returns a UUID token which -// you then include when calling ExecuteFastReset again with action set to performDatabaseReset. -// See Empty an Amazon Neptune DB cluster using the fast reset API (https://docs.aws.amazon.com/neptune/latest/userguide/manage-console-fast-reset.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ResetDatabase (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#resetdatabase) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation ExecuteFastReset for usage and error information. -// -// Returned Error Types: -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - ServerShutdownException -// Raised when the server shuts down while processing a request. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - MethodNotAllowedException -// Raised when the HTTP method used by a request is not supported by the endpoint -// being used. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteFastReset -func (c *Neptunedata) ExecuteFastReset(input *ExecuteFastResetInput) (*ExecuteFastResetOutput, error) { - req, out := c.ExecuteFastResetRequest(input) - return out, req.Send() -} - -// ExecuteFastResetWithContext is the same as ExecuteFastReset with the addition of -// the ability to pass a context and additional request options. -// -// See ExecuteFastReset 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 *Neptunedata) ExecuteFastResetWithContext(ctx aws.Context, input *ExecuteFastResetInput, opts ...request.Option) (*ExecuteFastResetOutput, error) { - req, out := c.ExecuteFastResetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExecuteGremlinExplainQuery = "ExecuteGremlinExplainQuery" - -// ExecuteGremlinExplainQueryRequest generates a "aws/request.Request" representing the -// client's request for the ExecuteGremlinExplainQuery 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 ExecuteGremlinExplainQuery for more information on using the ExecuteGremlinExplainQuery -// 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 ExecuteGremlinExplainQueryRequest method. -// req, resp := client.ExecuteGremlinExplainQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteGremlinExplainQuery -func (c *Neptunedata) ExecuteGremlinExplainQueryRequest(input *ExecuteGremlinExplainQueryInput) (req *request.Request, output *ExecuteGremlinExplainQueryOutput) { - op := &request.Operation{ - Name: opExecuteGremlinExplainQuery, - HTTPMethod: "POST", - HTTPPath: "/gremlin/explain", - } - - if input == nil { - input = &ExecuteGremlinExplainQueryInput{} - } - - output = &ExecuteGremlinExplainQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExecuteGremlinExplainQuery API operation for Amazon NeptuneData. -// -// Executes a Gremlin Explain query. -// -// Amazon Neptune has added a Gremlin feature named explain that provides is -// a self-service tool for understanding the execution approach being taken -// by the Neptune engine for the query. You invoke it by adding an explain parameter -// to an HTTP call that submits a Gremlin query. -// -// The explain feature provides information about the logical structure of query -// execution plans. You can use this information to identify potential evaluation -// and execution bottlenecks and to tune your query, as explained in Tuning -// Gremlin queries (https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-traversal-tuning.html). -// You can also use query hints to improve query execution plans. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows one of the following IAM actions in that cluster, depending on -// the query: -// -// - neptune-db:ReadDataViaQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#readdataviaquery) -// -// - neptune-db:WriteDataViaQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#writedataviaquery) -// -// - neptune-db:DeleteDataViaQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#deletedataviaquery) -// -// Note that the neptune-db:QueryLanguage:Gremlin (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of Gremlin queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation ExecuteGremlinExplainQuery for usage and error information. -// -// Returned Error Types: -// -// - QueryTooLargeException -// Raised when the body of a query is too large. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - QueryLimitExceededException -// Raised when the number of active queries exceeds what the server can process. -// The query in question can be retried when the system is less busy. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - QueryLimitException -// Raised when the size of a query exceeds the system limit. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - CancelledByUserException -// Raised when a user cancelled a request. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - MemoryLimitExceededException -// Raised when a request fails because of insufficient memory resources. The -// request can be retried. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - MalformedQueryException -// Raised when a query is submitted that is syntactically incorrect or does -// not pass additional validation. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteGremlinExplainQuery -func (c *Neptunedata) ExecuteGremlinExplainQuery(input *ExecuteGremlinExplainQueryInput) (*ExecuteGremlinExplainQueryOutput, error) { - req, out := c.ExecuteGremlinExplainQueryRequest(input) - return out, req.Send() -} - -// ExecuteGremlinExplainQueryWithContext is the same as ExecuteGremlinExplainQuery with the addition of -// the ability to pass a context and additional request options. -// -// See ExecuteGremlinExplainQuery 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 *Neptunedata) ExecuteGremlinExplainQueryWithContext(ctx aws.Context, input *ExecuteGremlinExplainQueryInput, opts ...request.Option) (*ExecuteGremlinExplainQueryOutput, error) { - req, out := c.ExecuteGremlinExplainQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExecuteGremlinProfileQuery = "ExecuteGremlinProfileQuery" - -// ExecuteGremlinProfileQueryRequest generates a "aws/request.Request" representing the -// client's request for the ExecuteGremlinProfileQuery 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 ExecuteGremlinProfileQuery for more information on using the ExecuteGremlinProfileQuery -// 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 ExecuteGremlinProfileQueryRequest method. -// req, resp := client.ExecuteGremlinProfileQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteGremlinProfileQuery -func (c *Neptunedata) ExecuteGremlinProfileQueryRequest(input *ExecuteGremlinProfileQueryInput) (req *request.Request, output *ExecuteGremlinProfileQueryOutput) { - op := &request.Operation{ - Name: opExecuteGremlinProfileQuery, - HTTPMethod: "POST", - HTTPPath: "/gremlin/profile", - } - - if input == nil { - input = &ExecuteGremlinProfileQueryInput{} - } - - output = &ExecuteGremlinProfileQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExecuteGremlinProfileQuery API operation for Amazon NeptuneData. -// -// Executes a Gremlin Profile query, which runs a specified traversal, collects -// various metrics about the run, and produces a profile report as output. See -// Gremlin profile API in Neptune (https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html) -// for details. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ReadDataViaQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#readdataviaquery) -// IAM action in that cluster. -// -// Note that the neptune-db:QueryLanguage:Gremlin (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of Gremlin queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation ExecuteGremlinProfileQuery for usage and error information. -// -// Returned Error Types: -// -// - QueryTooLargeException -// Raised when the body of a query is too large. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - QueryLimitExceededException -// Raised when the number of active queries exceeds what the server can process. -// The query in question can be retried when the system is less busy. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - QueryLimitException -// Raised when the size of a query exceeds the system limit. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - CancelledByUserException -// Raised when a user cancelled a request. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - MemoryLimitExceededException -// Raised when a request fails because of insufficient memory resources. The -// request can be retried. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - MalformedQueryException -// Raised when a query is submitted that is syntactically incorrect or does -// not pass additional validation. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteGremlinProfileQuery -func (c *Neptunedata) ExecuteGremlinProfileQuery(input *ExecuteGremlinProfileQueryInput) (*ExecuteGremlinProfileQueryOutput, error) { - req, out := c.ExecuteGremlinProfileQueryRequest(input) - return out, req.Send() -} - -// ExecuteGremlinProfileQueryWithContext is the same as ExecuteGremlinProfileQuery with the addition of -// the ability to pass a context and additional request options. -// -// See ExecuteGremlinProfileQuery 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 *Neptunedata) ExecuteGremlinProfileQueryWithContext(ctx aws.Context, input *ExecuteGremlinProfileQueryInput, opts ...request.Option) (*ExecuteGremlinProfileQueryOutput, error) { - req, out := c.ExecuteGremlinProfileQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExecuteGremlinQuery = "ExecuteGremlinQuery" - -// ExecuteGremlinQueryRequest generates a "aws/request.Request" representing the -// client's request for the ExecuteGremlinQuery 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 ExecuteGremlinQuery for more information on using the ExecuteGremlinQuery -// 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 ExecuteGremlinQueryRequest method. -// req, resp := client.ExecuteGremlinQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteGremlinQuery -func (c *Neptunedata) ExecuteGremlinQueryRequest(input *ExecuteGremlinQueryInput) (req *request.Request, output *ExecuteGremlinQueryOutput) { - op := &request.Operation{ - Name: opExecuteGremlinQuery, - HTTPMethod: "POST", - HTTPPath: "/gremlin", - } - - if input == nil { - input = &ExecuteGremlinQueryInput{} - } - - output = &ExecuteGremlinQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExecuteGremlinQuery API operation for Amazon NeptuneData. -// -// This commands executes a Gremlin query. Amazon Neptune is compatible with -// Apache TinkerPop3 and Gremlin, so you can use the Gremlin traversal language -// to query the graph, as described under The Graph (https://tinkerpop.apache.org/docs/current/reference/#graph) -// in the Apache TinkerPop3 documentation. More details can also be found in -// Accessing a Neptune graph with Gremlin (https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that enables one of the following IAM actions in that cluster, depending -// on the query: -// -// - neptune-db:ReadDataViaQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#readdataviaquery) -// -// - neptune-db:WriteDataViaQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#writedataviaquery) -// -// - neptune-db:DeleteDataViaQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#deletedataviaquery) -// -// Note that the neptune-db:QueryLanguage:Gremlin (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of Gremlin queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation ExecuteGremlinQuery for usage and error information. -// -// Returned Error Types: -// -// - QueryTooLargeException -// Raised when the body of a query is too large. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - QueryLimitExceededException -// Raised when the number of active queries exceeds what the server can process. -// The query in question can be retried when the system is less busy. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - QueryLimitException -// Raised when the size of a query exceeds the system limit. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - CancelledByUserException -// Raised when a user cancelled a request. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - MemoryLimitExceededException -// Raised when a request fails because of insufficient memory resources. The -// request can be retried. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - MalformedQueryException -// Raised when a query is submitted that is syntactically incorrect or does -// not pass additional validation. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteGremlinQuery -func (c *Neptunedata) ExecuteGremlinQuery(input *ExecuteGremlinQueryInput) (*ExecuteGremlinQueryOutput, error) { - req, out := c.ExecuteGremlinQueryRequest(input) - return out, req.Send() -} - -// ExecuteGremlinQueryWithContext is the same as ExecuteGremlinQuery with the addition of -// the ability to pass a context and additional request options. -// -// See ExecuteGremlinQuery 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 *Neptunedata) ExecuteGremlinQueryWithContext(ctx aws.Context, input *ExecuteGremlinQueryInput, opts ...request.Option) (*ExecuteGremlinQueryOutput, error) { - req, out := c.ExecuteGremlinQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExecuteOpenCypherExplainQuery = "ExecuteOpenCypherExplainQuery" - -// ExecuteOpenCypherExplainQueryRequest generates a "aws/request.Request" representing the -// client's request for the ExecuteOpenCypherExplainQuery 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 ExecuteOpenCypherExplainQuery for more information on using the ExecuteOpenCypherExplainQuery -// 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 ExecuteOpenCypherExplainQueryRequest method. -// req, resp := client.ExecuteOpenCypherExplainQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteOpenCypherExplainQuery -func (c *Neptunedata) ExecuteOpenCypherExplainQueryRequest(input *ExecuteOpenCypherExplainQueryInput) (req *request.Request, output *ExecuteOpenCypherExplainQueryOutput) { - op := &request.Operation{ - Name: opExecuteOpenCypherExplainQuery, - HTTPMethod: "POST", - HTTPPath: "/opencypher/explain", - } - - if input == nil { - input = &ExecuteOpenCypherExplainQueryInput{} - } - - output = &ExecuteOpenCypherExplainQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExecuteOpenCypherExplainQuery API operation for Amazon NeptuneData. -// -// Executes an openCypher explain request. See The openCypher explain feature -// (https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-opencypher-explain.html) -// for more information. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ReadDataViaQuery (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#readdataviaquery) -// IAM action in that cluster. -// -// Note that the neptune-db:QueryLanguage:OpenCypher (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of openCypher queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation ExecuteOpenCypherExplainQuery for usage and error information. -// -// Returned Error Types: -// -// - QueryTooLargeException -// Raised when the body of a query is too large. -// -// - InvalidNumericDataException -// Raised when invalid numerical data is encountered when servicing a request. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - QueryLimitExceededException -// Raised when the number of active queries exceeds what the server can process. -// The query in question can be retried when the system is less busy. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - QueryLimitException -// Raised when the size of a query exceeds the system limit. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - CancelledByUserException -// Raised when a user cancelled a request. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - MemoryLimitExceededException -// Raised when a request fails because of insufficient memory resources. The -// request can be retried. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - MalformedQueryException -// Raised when a query is submitted that is syntactically incorrect or does -// not pass additional validation. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ExecuteOpenCypherExplainQuery -func (c *Neptunedata) ExecuteOpenCypherExplainQuery(input *ExecuteOpenCypherExplainQueryInput) (*ExecuteOpenCypherExplainQueryOutput, error) { - req, out := c.ExecuteOpenCypherExplainQueryRequest(input) - return out, req.Send() -} - -// ExecuteOpenCypherExplainQueryWithContext is the same as ExecuteOpenCypherExplainQuery with the addition of -// the ability to pass a context and additional request options. -// -// See ExecuteOpenCypherExplainQuery 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 *Neptunedata) ExecuteOpenCypherExplainQueryWithContext(ctx aws.Context, input *ExecuteOpenCypherExplainQueryInput, opts ...request.Option) (*ExecuteOpenCypherExplainQueryOutput, error) { - req, out := c.ExecuteOpenCypherExplainQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEngineStatus = "GetEngineStatus" - -// GetEngineStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetEngineStatus 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 GetEngineStatus for more information on using the GetEngineStatus -// 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 GetEngineStatusRequest method. -// req, resp := client.GetEngineStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetEngineStatus -func (c *Neptunedata) GetEngineStatusRequest(input *GetEngineStatusInput) (req *request.Request, output *GetEngineStatusOutput) { - op := &request.Operation{ - Name: opGetEngineStatus, - HTTPMethod: "GET", - HTTPPath: "/status", - } - - if input == nil { - input = &GetEngineStatusInput{} - } - - output = &GetEngineStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEngineStatus API operation for Amazon NeptuneData. -// -// Retrieves the status of the graph database on the host. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetEngineStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getenginestatus) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation GetEngineStatus for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - InternalFailureException -// Raised when the processing of the request failed unexpectedly. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetEngineStatus -func (c *Neptunedata) GetEngineStatus(input *GetEngineStatusInput) (*GetEngineStatusOutput, error) { - req, out := c.GetEngineStatusRequest(input) - return out, req.Send() -} - -// GetEngineStatusWithContext is the same as GetEngineStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetEngineStatus 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 *Neptunedata) GetEngineStatusWithContext(ctx aws.Context, input *GetEngineStatusInput, opts ...request.Option) (*GetEngineStatusOutput, error) { - req, out := c.GetEngineStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetGremlinQueryStatus = "GetGremlinQueryStatus" - -// GetGremlinQueryStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetGremlinQueryStatus 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 GetGremlinQueryStatus for more information on using the GetGremlinQueryStatus -// 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 GetGremlinQueryStatusRequest method. -// req, resp := client.GetGremlinQueryStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetGremlinQueryStatus -func (c *Neptunedata) GetGremlinQueryStatusRequest(input *GetGremlinQueryStatusInput) (req *request.Request, output *GetGremlinQueryStatusOutput) { - op := &request.Operation{ - Name: opGetGremlinQueryStatus, - HTTPMethod: "GET", - HTTPPath: "/gremlin/status/{queryId}", - } - - if input == nil { - input = &GetGremlinQueryStatusInput{} - } - - output = &GetGremlinQueryStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGremlinQueryStatus API operation for Amazon NeptuneData. -// -// Gets the status of a specified Gremlin query. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetQueryStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getquerystatus) -// IAM action in that cluster. -// -// Note that the neptune-db:QueryLanguage:Gremlin (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of Gremlin queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation GetGremlinQueryStatus for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetGremlinQueryStatus -func (c *Neptunedata) GetGremlinQueryStatus(input *GetGremlinQueryStatusInput) (*GetGremlinQueryStatusOutput, error) { - req, out := c.GetGremlinQueryStatusRequest(input) - return out, req.Send() -} - -// GetGremlinQueryStatusWithContext is the same as GetGremlinQueryStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetGremlinQueryStatus 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 *Neptunedata) GetGremlinQueryStatusWithContext(ctx aws.Context, input *GetGremlinQueryStatusInput, opts ...request.Option) (*GetGremlinQueryStatusOutput, error) { - req, out := c.GetGremlinQueryStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMLDataProcessingJob = "GetMLDataProcessingJob" - -// GetMLDataProcessingJobRequest generates a "aws/request.Request" representing the -// client's request for the GetMLDataProcessingJob 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 GetMLDataProcessingJob for more information on using the GetMLDataProcessingJob -// 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 GetMLDataProcessingJobRequest method. -// req, resp := client.GetMLDataProcessingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetMLDataProcessingJob -func (c *Neptunedata) GetMLDataProcessingJobRequest(input *GetMLDataProcessingJobInput) (req *request.Request, output *GetMLDataProcessingJobOutput) { - op := &request.Operation{ - Name: opGetMLDataProcessingJob, - HTTPMethod: "GET", - HTTPPath: "/ml/dataprocessing/{id}", - } - - if input == nil { - input = &GetMLDataProcessingJobInput{} - } - - output = &GetMLDataProcessingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMLDataProcessingJob API operation for Amazon NeptuneData. -// -// Retrieves information about a specified data processing job. See The dataprocessing -// command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-dataprocessing.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:neptune-db:GetMLDataProcessingJobStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getmldataprocessingjobstatus) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation GetMLDataProcessingJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetMLDataProcessingJob -func (c *Neptunedata) GetMLDataProcessingJob(input *GetMLDataProcessingJobInput) (*GetMLDataProcessingJobOutput, error) { - req, out := c.GetMLDataProcessingJobRequest(input) - return out, req.Send() -} - -// GetMLDataProcessingJobWithContext is the same as GetMLDataProcessingJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetMLDataProcessingJob 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 *Neptunedata) GetMLDataProcessingJobWithContext(ctx aws.Context, input *GetMLDataProcessingJobInput, opts ...request.Option) (*GetMLDataProcessingJobOutput, error) { - req, out := c.GetMLDataProcessingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMLEndpoint = "GetMLEndpoint" - -// GetMLEndpointRequest generates a "aws/request.Request" representing the -// client's request for the GetMLEndpoint 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 GetMLEndpoint for more information on using the GetMLEndpoint -// 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 GetMLEndpointRequest method. -// req, resp := client.GetMLEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetMLEndpoint -func (c *Neptunedata) GetMLEndpointRequest(input *GetMLEndpointInput) (req *request.Request, output *GetMLEndpointOutput) { - op := &request.Operation{ - Name: opGetMLEndpoint, - HTTPMethod: "GET", - HTTPPath: "/ml/endpoints/{id}", - } - - if input == nil { - input = &GetMLEndpointInput{} - } - - output = &GetMLEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMLEndpoint API operation for Amazon NeptuneData. -// -// Retrieves details about an inference endpoint. See Managing inference endpoints -// using the endpoints command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-endpoints.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetMLEndpointStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getmlendpointstatus) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation GetMLEndpoint for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetMLEndpoint -func (c *Neptunedata) GetMLEndpoint(input *GetMLEndpointInput) (*GetMLEndpointOutput, error) { - req, out := c.GetMLEndpointRequest(input) - return out, req.Send() -} - -// GetMLEndpointWithContext is the same as GetMLEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See GetMLEndpoint 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 *Neptunedata) GetMLEndpointWithContext(ctx aws.Context, input *GetMLEndpointInput, opts ...request.Option) (*GetMLEndpointOutput, error) { - req, out := c.GetMLEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMLModelTrainingJob = "GetMLModelTrainingJob" - -// GetMLModelTrainingJobRequest generates a "aws/request.Request" representing the -// client's request for the GetMLModelTrainingJob 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 GetMLModelTrainingJob for more information on using the GetMLModelTrainingJob -// 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 GetMLModelTrainingJobRequest method. -// req, resp := client.GetMLModelTrainingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetMLModelTrainingJob -func (c *Neptunedata) GetMLModelTrainingJobRequest(input *GetMLModelTrainingJobInput) (req *request.Request, output *GetMLModelTrainingJobOutput) { - op := &request.Operation{ - Name: opGetMLModelTrainingJob, - HTTPMethod: "GET", - HTTPPath: "/ml/modeltraining/{id}", - } - - if input == nil { - input = &GetMLModelTrainingJobInput{} - } - - output = &GetMLModelTrainingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMLModelTrainingJob API operation for Amazon NeptuneData. -// -// Retrieves information about a Neptune ML model training job. See Model training -// using the modeltraining command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-modeltraining.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetMLModelTrainingJobStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getmlmodeltrainingjobstatus) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation GetMLModelTrainingJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetMLModelTrainingJob -func (c *Neptunedata) GetMLModelTrainingJob(input *GetMLModelTrainingJobInput) (*GetMLModelTrainingJobOutput, error) { - req, out := c.GetMLModelTrainingJobRequest(input) - return out, req.Send() -} - -// GetMLModelTrainingJobWithContext is the same as GetMLModelTrainingJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetMLModelTrainingJob 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 *Neptunedata) GetMLModelTrainingJobWithContext(ctx aws.Context, input *GetMLModelTrainingJobInput, opts ...request.Option) (*GetMLModelTrainingJobOutput, error) { - req, out := c.GetMLModelTrainingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMLModelTransformJob = "GetMLModelTransformJob" - -// GetMLModelTransformJobRequest generates a "aws/request.Request" representing the -// client's request for the GetMLModelTransformJob 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 GetMLModelTransformJob for more information on using the GetMLModelTransformJob -// 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 GetMLModelTransformJobRequest method. -// req, resp := client.GetMLModelTransformJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetMLModelTransformJob -func (c *Neptunedata) GetMLModelTransformJobRequest(input *GetMLModelTransformJobInput) (req *request.Request, output *GetMLModelTransformJobOutput) { - op := &request.Operation{ - Name: opGetMLModelTransformJob, - HTTPMethod: "GET", - HTTPPath: "/ml/modeltransform/{id}", - } - - if input == nil { - input = &GetMLModelTransformJobInput{} - } - - output = &GetMLModelTransformJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMLModelTransformJob API operation for Amazon NeptuneData. -// -// Gets information about a specified model transform job. See Use a trained -// model to generate new model artifacts (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-model-transform.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetMLModelTransformJobStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getmlmodeltransformjobstatus) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation GetMLModelTransformJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetMLModelTransformJob -func (c *Neptunedata) GetMLModelTransformJob(input *GetMLModelTransformJobInput) (*GetMLModelTransformJobOutput, error) { - req, out := c.GetMLModelTransformJobRequest(input) - return out, req.Send() -} - -// GetMLModelTransformJobWithContext is the same as GetMLModelTransformJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetMLModelTransformJob 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 *Neptunedata) GetMLModelTransformJobWithContext(ctx aws.Context, input *GetMLModelTransformJobInput, opts ...request.Option) (*GetMLModelTransformJobOutput, error) { - req, out := c.GetMLModelTransformJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetOpenCypherQueryStatus = "GetOpenCypherQueryStatus" - -// GetOpenCypherQueryStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetOpenCypherQueryStatus 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 GetOpenCypherQueryStatus for more information on using the GetOpenCypherQueryStatus -// 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 GetOpenCypherQueryStatusRequest method. -// req, resp := client.GetOpenCypherQueryStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetOpenCypherQueryStatus -func (c *Neptunedata) GetOpenCypherQueryStatusRequest(input *GetOpenCypherQueryStatusInput) (req *request.Request, output *GetOpenCypherQueryStatusOutput) { - op := &request.Operation{ - Name: opGetOpenCypherQueryStatus, - HTTPMethod: "GET", - HTTPPath: "/opencypher/status/{queryId}", - } - - if input == nil { - input = &GetOpenCypherQueryStatusInput{} - } - - output = &GetOpenCypherQueryStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOpenCypherQueryStatus API operation for Amazon NeptuneData. -// -// Retrieves the status of a specified openCypher query. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetQueryStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getquerystatus) -// IAM action in that cluster. -// -// Note that the neptune-db:QueryLanguage:OpenCypher (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of openCypher queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation GetOpenCypherQueryStatus for usage and error information. -// -// Returned Error Types: -// -// - InvalidNumericDataException -// Raised when invalid numerical data is encountered when servicing a request. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetOpenCypherQueryStatus -func (c *Neptunedata) GetOpenCypherQueryStatus(input *GetOpenCypherQueryStatusInput) (*GetOpenCypherQueryStatusOutput, error) { - req, out := c.GetOpenCypherQueryStatusRequest(input) - return out, req.Send() -} - -// GetOpenCypherQueryStatusWithContext is the same as GetOpenCypherQueryStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetOpenCypherQueryStatus 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 *Neptunedata) GetOpenCypherQueryStatusWithContext(ctx aws.Context, input *GetOpenCypherQueryStatusInput, opts ...request.Option) (*GetOpenCypherQueryStatusOutput, error) { - req, out := c.GetOpenCypherQueryStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPropertygraphStatistics = "GetPropertygraphStatistics" - -// GetPropertygraphStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the GetPropertygraphStatistics 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 GetPropertygraphStatistics for more information on using the GetPropertygraphStatistics -// 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 GetPropertygraphStatisticsRequest method. -// req, resp := client.GetPropertygraphStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetPropertygraphStatistics -func (c *Neptunedata) GetPropertygraphStatisticsRequest(input *GetPropertygraphStatisticsInput) (req *request.Request, output *GetPropertygraphStatisticsOutput) { - op := &request.Operation{ - Name: opGetPropertygraphStatistics, - HTTPMethod: "GET", - HTTPPath: "/propertygraph/statistics", - } - - if input == nil { - input = &GetPropertygraphStatisticsInput{} - } - - output = &GetPropertygraphStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPropertygraphStatistics API operation for Amazon NeptuneData. -// -// Gets property graph statistics (Gremlin and openCypher). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetStatisticsStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getstatisticsstatus) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation GetPropertygraphStatistics for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - StatisticsNotAvailableException -// Raised when statistics needed to satisfy a request are not available. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetPropertygraphStatistics -func (c *Neptunedata) GetPropertygraphStatistics(input *GetPropertygraphStatisticsInput) (*GetPropertygraphStatisticsOutput, error) { - req, out := c.GetPropertygraphStatisticsRequest(input) - return out, req.Send() -} - -// GetPropertygraphStatisticsWithContext is the same as GetPropertygraphStatistics with the addition of -// the ability to pass a context and additional request options. -// -// See GetPropertygraphStatistics 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 *Neptunedata) GetPropertygraphStatisticsWithContext(ctx aws.Context, input *GetPropertygraphStatisticsInput, opts ...request.Option) (*GetPropertygraphStatisticsOutput, error) { - req, out := c.GetPropertygraphStatisticsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPropertygraphSummary = "GetPropertygraphSummary" - -// GetPropertygraphSummaryRequest generates a "aws/request.Request" representing the -// client's request for the GetPropertygraphSummary 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 GetPropertygraphSummary for more information on using the GetPropertygraphSummary -// 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 GetPropertygraphSummaryRequest method. -// req, resp := client.GetPropertygraphSummaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetPropertygraphSummary -func (c *Neptunedata) GetPropertygraphSummaryRequest(input *GetPropertygraphSummaryInput) (req *request.Request, output *GetPropertygraphSummaryOutput) { - op := &request.Operation{ - Name: opGetPropertygraphSummary, - HTTPMethod: "GET", - HTTPPath: "/propertygraph/statistics/summary", - } - - if input == nil { - input = &GetPropertygraphSummaryInput{} - } - - output = &GetPropertygraphSummaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPropertygraphSummary API operation for Amazon NeptuneData. -// -// Gets a graph summary for a property graph. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetGraphSummary (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getgraphsummary) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation GetPropertygraphSummary for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - StatisticsNotAvailableException -// Raised when statistics needed to satisfy a request are not available. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetPropertygraphSummary -func (c *Neptunedata) GetPropertygraphSummary(input *GetPropertygraphSummaryInput) (*GetPropertygraphSummaryOutput, error) { - req, out := c.GetPropertygraphSummaryRequest(input) - return out, req.Send() -} - -// GetPropertygraphSummaryWithContext is the same as GetPropertygraphSummary with the addition of -// the ability to pass a context and additional request options. -// -// See GetPropertygraphSummary 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 *Neptunedata) GetPropertygraphSummaryWithContext(ctx aws.Context, input *GetPropertygraphSummaryInput, opts ...request.Option) (*GetPropertygraphSummaryOutput, error) { - req, out := c.GetPropertygraphSummaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRDFGraphSummary = "GetRDFGraphSummary" - -// GetRDFGraphSummaryRequest generates a "aws/request.Request" representing the -// client's request for the GetRDFGraphSummary 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 GetRDFGraphSummary for more information on using the GetRDFGraphSummary -// 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 GetRDFGraphSummaryRequest method. -// req, resp := client.GetRDFGraphSummaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetRDFGraphSummary -func (c *Neptunedata) GetRDFGraphSummaryRequest(input *GetRDFGraphSummaryInput) (req *request.Request, output *GetRDFGraphSummaryOutput) { - op := &request.Operation{ - Name: opGetRDFGraphSummary, - HTTPMethod: "GET", - HTTPPath: "/rdf/statistics/summary", - } - - if input == nil { - input = &GetRDFGraphSummaryInput{} - } - - output = &GetRDFGraphSummaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRDFGraphSummary API operation for Amazon NeptuneData. -// -// Gets a graph summary for an RDF graph. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetGraphSummary (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getgraphsummary) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation GetRDFGraphSummary for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - StatisticsNotAvailableException -// Raised when statistics needed to satisfy a request are not available. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetRDFGraphSummary -func (c *Neptunedata) GetRDFGraphSummary(input *GetRDFGraphSummaryInput) (*GetRDFGraphSummaryOutput, error) { - req, out := c.GetRDFGraphSummaryRequest(input) - return out, req.Send() -} - -// GetRDFGraphSummaryWithContext is the same as GetRDFGraphSummary with the addition of -// the ability to pass a context and additional request options. -// -// See GetRDFGraphSummary 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 *Neptunedata) GetRDFGraphSummaryWithContext(ctx aws.Context, input *GetRDFGraphSummaryInput, opts ...request.Option) (*GetRDFGraphSummaryOutput, error) { - req, out := c.GetRDFGraphSummaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSparqlStatistics = "GetSparqlStatistics" - -// GetSparqlStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the GetSparqlStatistics 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 GetSparqlStatistics for more information on using the GetSparqlStatistics -// 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 GetSparqlStatisticsRequest method. -// req, resp := client.GetSparqlStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetSparqlStatistics -func (c *Neptunedata) GetSparqlStatisticsRequest(input *GetSparqlStatisticsInput) (req *request.Request, output *GetSparqlStatisticsOutput) { - op := &request.Operation{ - Name: opGetSparqlStatistics, - HTTPMethod: "GET", - HTTPPath: "/sparql/statistics", - } - - if input == nil { - input = &GetSparqlStatisticsInput{} - } - - output = &GetSparqlStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSparqlStatistics API operation for Amazon NeptuneData. -// -// Gets RDF statistics (SPARQL). -// -// 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 NeptuneData's -// API operation GetSparqlStatistics for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - StatisticsNotAvailableException -// Raised when statistics needed to satisfy a request are not available. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetSparqlStatistics -func (c *Neptunedata) GetSparqlStatistics(input *GetSparqlStatisticsInput) (*GetSparqlStatisticsOutput, error) { - req, out := c.GetSparqlStatisticsRequest(input) - return out, req.Send() -} - -// GetSparqlStatisticsWithContext is the same as GetSparqlStatistics with the addition of -// the ability to pass a context and additional request options. -// -// See GetSparqlStatistics 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 *Neptunedata) GetSparqlStatisticsWithContext(ctx aws.Context, input *GetSparqlStatisticsInput, opts ...request.Option) (*GetSparqlStatisticsOutput, error) { - req, out := c.GetSparqlStatisticsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSparqlStream = "GetSparqlStream" - -// GetSparqlStreamRequest generates a "aws/request.Request" representing the -// client's request for the GetSparqlStream 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 GetSparqlStream for more information on using the GetSparqlStream -// 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 GetSparqlStreamRequest method. -// req, resp := client.GetSparqlStreamRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetSparqlStream -func (c *Neptunedata) GetSparqlStreamRequest(input *GetSparqlStreamInput) (req *request.Request, output *GetSparqlStreamOutput) { - op := &request.Operation{ - Name: opGetSparqlStream, - HTTPMethod: "GET", - HTTPPath: "/sparql/stream", - } - - if input == nil { - input = &GetSparqlStreamInput{} - } - - output = &GetSparqlStreamOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSparqlStream API operation for Amazon NeptuneData. -// -// Gets a stream for an RDF graph. -// -// With the Neptune Streams feature, you can generate a complete sequence of -// change-log entries that record every change made to your graph data as it -// happens. GetSparqlStream lets you collect these change-log entries for an -// RDF graph. -// -// The Neptune streams feature needs to be enabled on your Neptune DBcluster. -// To enable streams, set the neptune_streams (https://docs.aws.amazon.com/neptune/latest/userguide/parameters.html#parameters-db-cluster-parameters-neptune_streams) -// DB cluster parameter to 1. -// -// See Capturing graph changes in real time using Neptune streams (https://docs.aws.amazon.com/neptune/latest/userguide/streams.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetStreamRecords (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getstreamrecords) -// IAM action in that cluster. -// -// Note that the neptune-db:QueryLanguage:Sparql (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of SPARQL queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation GetSparqlStream for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - ExpiredStreamException -// Raised when a request attempts to access an stream that has expired. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - MemoryLimitExceededException -// Raised when a request fails because of insufficient memory resources. The -// request can be retried. -// -// - StreamRecordsNotFoundException -// Raised when stream records requested by a query cannot be found. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ThrottlingException -// Raised when the rate of requests exceeds the maximum throughput. Requests -// can be retried after encountering this exception. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/GetSparqlStream -func (c *Neptunedata) GetSparqlStream(input *GetSparqlStreamInput) (*GetSparqlStreamOutput, error) { - req, out := c.GetSparqlStreamRequest(input) - return out, req.Send() -} - -// GetSparqlStreamWithContext is the same as GetSparqlStream with the addition of -// the ability to pass a context and additional request options. -// -// See GetSparqlStream 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 *Neptunedata) GetSparqlStreamWithContext(ctx aws.Context, input *GetSparqlStreamInput, opts ...request.Option) (*GetSparqlStreamOutput, error) { - req, out := c.GetSparqlStreamRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListGremlinQueries = "ListGremlinQueries" - -// ListGremlinQueriesRequest generates a "aws/request.Request" representing the -// client's request for the ListGremlinQueries 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 ListGremlinQueries for more information on using the ListGremlinQueries -// 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 ListGremlinQueriesRequest method. -// req, resp := client.ListGremlinQueriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListGremlinQueries -func (c *Neptunedata) ListGremlinQueriesRequest(input *ListGremlinQueriesInput) (req *request.Request, output *ListGremlinQueriesOutput) { - op := &request.Operation{ - Name: opListGremlinQueries, - HTTPMethod: "GET", - HTTPPath: "/gremlin/status", - } - - if input == nil { - input = &ListGremlinQueriesInput{} - } - - output = &ListGremlinQueriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListGremlinQueries API operation for Amazon NeptuneData. -// -// Lists active Gremlin queries. See Gremlin query status API (https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-api-status.html) -// for details about the output. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetQueryStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getquerystatus) -// IAM action in that cluster. -// -// Note that the neptune-db:QueryLanguage:Gremlin (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of Gremlin queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation ListGremlinQueries for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListGremlinQueries -func (c *Neptunedata) ListGremlinQueries(input *ListGremlinQueriesInput) (*ListGremlinQueriesOutput, error) { - req, out := c.ListGremlinQueriesRequest(input) - return out, req.Send() -} - -// ListGremlinQueriesWithContext is the same as ListGremlinQueries with the addition of -// the ability to pass a context and additional request options. -// -// See ListGremlinQueries 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 *Neptunedata) ListGremlinQueriesWithContext(ctx aws.Context, input *ListGremlinQueriesInput, opts ...request.Option) (*ListGremlinQueriesOutput, error) { - req, out := c.ListGremlinQueriesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListLoaderJobs = "ListLoaderJobs" - -// ListLoaderJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListLoaderJobs 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 ListLoaderJobs for more information on using the ListLoaderJobs -// 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 ListLoaderJobsRequest method. -// req, resp := client.ListLoaderJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListLoaderJobs -func (c *Neptunedata) ListLoaderJobsRequest(input *ListLoaderJobsInput) (req *request.Request, output *ListLoaderJobsOutput) { - op := &request.Operation{ - Name: opListLoaderJobs, - HTTPMethod: "GET", - HTTPPath: "/loader", - } - - if input == nil { - input = &ListLoaderJobsInput{} - } - - output = &ListLoaderJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLoaderJobs API operation for Amazon NeptuneData. -// -// Retrieves a list of the loadIds for all active loader jobs. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ListLoaderJobs (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#listloaderjobs) -// IAM action in that cluster.. -// -// 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 NeptuneData's -// API operation ListLoaderJobs for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - BulkLoadIdNotFoundException -// Raised when a specified bulk-load job ID cannot be found. -// -// - InternalFailureException -// Raised when the processing of the request failed unexpectedly. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - LoadUrlAccessDeniedException -// Raised when access is denied to a specified load URL. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListLoaderJobs -func (c *Neptunedata) ListLoaderJobs(input *ListLoaderJobsInput) (*ListLoaderJobsOutput, error) { - req, out := c.ListLoaderJobsRequest(input) - return out, req.Send() -} - -// ListLoaderJobsWithContext is the same as ListLoaderJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListLoaderJobs 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 *Neptunedata) ListLoaderJobsWithContext(ctx aws.Context, input *ListLoaderJobsInput, opts ...request.Option) (*ListLoaderJobsOutput, error) { - req, out := c.ListLoaderJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListMLDataProcessingJobs = "ListMLDataProcessingJobs" - -// ListMLDataProcessingJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListMLDataProcessingJobs 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 ListMLDataProcessingJobs for more information on using the ListMLDataProcessingJobs -// 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 ListMLDataProcessingJobsRequest method. -// req, resp := client.ListMLDataProcessingJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListMLDataProcessingJobs -func (c *Neptunedata) ListMLDataProcessingJobsRequest(input *ListMLDataProcessingJobsInput) (req *request.Request, output *ListMLDataProcessingJobsOutput) { - op := &request.Operation{ - Name: opListMLDataProcessingJobs, - HTTPMethod: "GET", - HTTPPath: "/ml/dataprocessing", - } - - if input == nil { - input = &ListMLDataProcessingJobsInput{} - } - - output = &ListMLDataProcessingJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMLDataProcessingJobs API operation for Amazon NeptuneData. -// -// Returns a list of Neptune ML data processing jobs. See Listing active data-processing -// jobs using the Neptune ML dataprocessing command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-dataprocessing.html#machine-learning-api-dataprocessing-list-jobs). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ListMLDataProcessingJobs (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#listmldataprocessingjobs) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation ListMLDataProcessingJobs for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListMLDataProcessingJobs -func (c *Neptunedata) ListMLDataProcessingJobs(input *ListMLDataProcessingJobsInput) (*ListMLDataProcessingJobsOutput, error) { - req, out := c.ListMLDataProcessingJobsRequest(input) - return out, req.Send() -} - -// ListMLDataProcessingJobsWithContext is the same as ListMLDataProcessingJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListMLDataProcessingJobs 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 *Neptunedata) ListMLDataProcessingJobsWithContext(ctx aws.Context, input *ListMLDataProcessingJobsInput, opts ...request.Option) (*ListMLDataProcessingJobsOutput, error) { - req, out := c.ListMLDataProcessingJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListMLEndpoints = "ListMLEndpoints" - -// ListMLEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the ListMLEndpoints 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 ListMLEndpoints for more information on using the ListMLEndpoints -// 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 ListMLEndpointsRequest method. -// req, resp := client.ListMLEndpointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListMLEndpoints -func (c *Neptunedata) ListMLEndpointsRequest(input *ListMLEndpointsInput) (req *request.Request, output *ListMLEndpointsOutput) { - op := &request.Operation{ - Name: opListMLEndpoints, - HTTPMethod: "GET", - HTTPPath: "/ml/endpoints", - } - - if input == nil { - input = &ListMLEndpointsInput{} - } - - output = &ListMLEndpointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMLEndpoints API operation for Amazon NeptuneData. -// -// Lists existing inference endpoints. See Managing inference endpoints using -// the endpoints command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-endpoints.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ListMLEndpoints (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#listmlendpoints) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation ListMLEndpoints for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListMLEndpoints -func (c *Neptunedata) ListMLEndpoints(input *ListMLEndpointsInput) (*ListMLEndpointsOutput, error) { - req, out := c.ListMLEndpointsRequest(input) - return out, req.Send() -} - -// ListMLEndpointsWithContext is the same as ListMLEndpoints with the addition of -// the ability to pass a context and additional request options. -// -// See ListMLEndpoints 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 *Neptunedata) ListMLEndpointsWithContext(ctx aws.Context, input *ListMLEndpointsInput, opts ...request.Option) (*ListMLEndpointsOutput, error) { - req, out := c.ListMLEndpointsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListMLModelTrainingJobs = "ListMLModelTrainingJobs" - -// ListMLModelTrainingJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListMLModelTrainingJobs 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 ListMLModelTrainingJobs for more information on using the ListMLModelTrainingJobs -// 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 ListMLModelTrainingJobsRequest method. -// req, resp := client.ListMLModelTrainingJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListMLModelTrainingJobs -func (c *Neptunedata) ListMLModelTrainingJobsRequest(input *ListMLModelTrainingJobsInput) (req *request.Request, output *ListMLModelTrainingJobsOutput) { - op := &request.Operation{ - Name: opListMLModelTrainingJobs, - HTTPMethod: "GET", - HTTPPath: "/ml/modeltraining", - } - - if input == nil { - input = &ListMLModelTrainingJobsInput{} - } - - output = &ListMLModelTrainingJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMLModelTrainingJobs API operation for Amazon NeptuneData. -// -// Lists Neptune ML model-training jobs. See Model training using the modeltraining -// command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-modeltraining.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:neptune-db:ListMLModelTrainingJobs (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#neptune-db:listmlmodeltrainingjobs) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation ListMLModelTrainingJobs for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListMLModelTrainingJobs -func (c *Neptunedata) ListMLModelTrainingJobs(input *ListMLModelTrainingJobsInput) (*ListMLModelTrainingJobsOutput, error) { - req, out := c.ListMLModelTrainingJobsRequest(input) - return out, req.Send() -} - -// ListMLModelTrainingJobsWithContext is the same as ListMLModelTrainingJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListMLModelTrainingJobs 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 *Neptunedata) ListMLModelTrainingJobsWithContext(ctx aws.Context, input *ListMLModelTrainingJobsInput, opts ...request.Option) (*ListMLModelTrainingJobsOutput, error) { - req, out := c.ListMLModelTrainingJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListMLModelTransformJobs = "ListMLModelTransformJobs" - -// ListMLModelTransformJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListMLModelTransformJobs 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 ListMLModelTransformJobs for more information on using the ListMLModelTransformJobs -// 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 ListMLModelTransformJobsRequest method. -// req, resp := client.ListMLModelTransformJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListMLModelTransformJobs -func (c *Neptunedata) ListMLModelTransformJobsRequest(input *ListMLModelTransformJobsInput) (req *request.Request, output *ListMLModelTransformJobsOutput) { - op := &request.Operation{ - Name: opListMLModelTransformJobs, - HTTPMethod: "GET", - HTTPPath: "/ml/modeltransform", - } - - if input == nil { - input = &ListMLModelTransformJobsInput{} - } - - output = &ListMLModelTransformJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMLModelTransformJobs API operation for Amazon NeptuneData. -// -// Returns a list of model transform job IDs. See Use a trained model to generate -// new model artifacts (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-model-transform.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ListMLModelTransformJobs (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#listmlmodeltransformjobs) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation ListMLModelTransformJobs for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListMLModelTransformJobs -func (c *Neptunedata) ListMLModelTransformJobs(input *ListMLModelTransformJobsInput) (*ListMLModelTransformJobsOutput, error) { - req, out := c.ListMLModelTransformJobsRequest(input) - return out, req.Send() -} - -// ListMLModelTransformJobsWithContext is the same as ListMLModelTransformJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListMLModelTransformJobs 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 *Neptunedata) ListMLModelTransformJobsWithContext(ctx aws.Context, input *ListMLModelTransformJobsInput, opts ...request.Option) (*ListMLModelTransformJobsOutput, error) { - req, out := c.ListMLModelTransformJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListOpenCypherQueries = "ListOpenCypherQueries" - -// ListOpenCypherQueriesRequest generates a "aws/request.Request" representing the -// client's request for the ListOpenCypherQueries 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 ListOpenCypherQueries for more information on using the ListOpenCypherQueries -// 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 ListOpenCypherQueriesRequest method. -// req, resp := client.ListOpenCypherQueriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListOpenCypherQueries -func (c *Neptunedata) ListOpenCypherQueriesRequest(input *ListOpenCypherQueriesInput) (req *request.Request, output *ListOpenCypherQueriesOutput) { - op := &request.Operation{ - Name: opListOpenCypherQueries, - HTTPMethod: "GET", - HTTPPath: "/opencypher/status", - } - - if input == nil { - input = &ListOpenCypherQueriesInput{} - } - - output = &ListOpenCypherQueriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOpenCypherQueries API operation for Amazon NeptuneData. -// -// Lists active openCypher queries. See Neptune openCypher status endpoint (https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-opencypher-status.html) -// for more information. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:GetQueryStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getquerystatus) -// IAM action in that cluster. -// -// Note that the neptune-db:QueryLanguage:OpenCypher (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html#iam-neptune-condition-keys) -// IAM condition key can be used in the policy document to restrict the use -// of openCypher queries (see Condition keys available in Neptune IAM data-access -// policy statements (https://docs.aws.amazon.com/neptune/latest/userguide/iam-data-condition-keys.html)). -// -// 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 NeptuneData's -// API operation ListOpenCypherQueries for usage and error information. -// -// Returned Error Types: -// -// - InvalidNumericDataException -// Raised when invalid numerical data is encountered when servicing a request. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - FailureByQueryException -// Raised when a request fails. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ParsingException -// Raised when a parsing issue is encountered. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - TimeLimitExceededException -// Raised when the an operation exceeds the time limit allowed for it. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - ConcurrentModificationException -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ListOpenCypherQueries -func (c *Neptunedata) ListOpenCypherQueries(input *ListOpenCypherQueriesInput) (*ListOpenCypherQueriesOutput, error) { - req, out := c.ListOpenCypherQueriesRequest(input) - return out, req.Send() -} - -// ListOpenCypherQueriesWithContext is the same as ListOpenCypherQueries with the addition of -// the ability to pass a context and additional request options. -// -// See ListOpenCypherQueries 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 *Neptunedata) ListOpenCypherQueriesWithContext(ctx aws.Context, input *ListOpenCypherQueriesInput, opts ...request.Option) (*ListOpenCypherQueriesOutput, error) { - req, out := c.ListOpenCypherQueriesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opManagePropertygraphStatistics = "ManagePropertygraphStatistics" - -// ManagePropertygraphStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the ManagePropertygraphStatistics 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 ManagePropertygraphStatistics for more information on using the ManagePropertygraphStatistics -// 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 ManagePropertygraphStatisticsRequest method. -// req, resp := client.ManagePropertygraphStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ManagePropertygraphStatistics -func (c *Neptunedata) ManagePropertygraphStatisticsRequest(input *ManagePropertygraphStatisticsInput) (req *request.Request, output *ManagePropertygraphStatisticsOutput) { - op := &request.Operation{ - Name: opManagePropertygraphStatistics, - HTTPMethod: "POST", - HTTPPath: "/propertygraph/statistics", - } - - if input == nil { - input = &ManagePropertygraphStatisticsInput{} - } - - output = &ManagePropertygraphStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ManagePropertygraphStatistics API operation for Amazon NeptuneData. -// -// Manages the generation and use of property graph statistics. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ManageStatistics (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#managestatistics) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation ManagePropertygraphStatistics for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - StatisticsNotAvailableException -// Raised when statistics needed to satisfy a request are not available. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ManagePropertygraphStatistics -func (c *Neptunedata) ManagePropertygraphStatistics(input *ManagePropertygraphStatisticsInput) (*ManagePropertygraphStatisticsOutput, error) { - req, out := c.ManagePropertygraphStatisticsRequest(input) - return out, req.Send() -} - -// ManagePropertygraphStatisticsWithContext is the same as ManagePropertygraphStatistics with the addition of -// the ability to pass a context and additional request options. -// -// See ManagePropertygraphStatistics 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 *Neptunedata) ManagePropertygraphStatisticsWithContext(ctx aws.Context, input *ManagePropertygraphStatisticsInput, opts ...request.Option) (*ManagePropertygraphStatisticsOutput, error) { - req, out := c.ManagePropertygraphStatisticsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opManageSparqlStatistics = "ManageSparqlStatistics" - -// ManageSparqlStatisticsRequest generates a "aws/request.Request" representing the -// client's request for the ManageSparqlStatistics 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 ManageSparqlStatistics for more information on using the ManageSparqlStatistics -// 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 ManageSparqlStatisticsRequest method. -// req, resp := client.ManageSparqlStatisticsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ManageSparqlStatistics -func (c *Neptunedata) ManageSparqlStatisticsRequest(input *ManageSparqlStatisticsInput) (req *request.Request, output *ManageSparqlStatisticsOutput) { - op := &request.Operation{ - Name: opManageSparqlStatistics, - HTTPMethod: "POST", - HTTPPath: "/sparql/statistics", - } - - if input == nil { - input = &ManageSparqlStatisticsInput{} - } - - output = &ManageSparqlStatisticsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ManageSparqlStatistics API operation for Amazon NeptuneData. -// -// Manages the generation and use of RDF graph statistics. -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:ManageStatistics (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#managestatistics) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation ManageSparqlStatistics for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - StatisticsNotAvailableException -// Raised when statistics needed to satisfy a request are not available. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - AccessDeniedException -// Raised in case of an authentication or authorization failure. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ReadOnlyViolationException -// Raised when a request attempts to write to a read-only resource. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/ManageSparqlStatistics -func (c *Neptunedata) ManageSparqlStatistics(input *ManageSparqlStatisticsInput) (*ManageSparqlStatisticsOutput, error) { - req, out := c.ManageSparqlStatisticsRequest(input) - return out, req.Send() -} - -// ManageSparqlStatisticsWithContext is the same as ManageSparqlStatistics with the addition of -// the ability to pass a context and additional request options. -// -// See ManageSparqlStatistics 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 *Neptunedata) ManageSparqlStatisticsWithContext(ctx aws.Context, input *ManageSparqlStatisticsInput, opts ...request.Option) (*ManageSparqlStatisticsOutput, error) { - req, out := c.ManageSparqlStatisticsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartLoaderJob = "StartLoaderJob" - -// StartLoaderJobRequest generates a "aws/request.Request" representing the -// client's request for the StartLoaderJob 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 StartLoaderJob for more information on using the StartLoaderJob -// 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 StartLoaderJobRequest method. -// req, resp := client.StartLoaderJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/StartLoaderJob -func (c *Neptunedata) StartLoaderJobRequest(input *StartLoaderJobInput) (req *request.Request, output *StartLoaderJobOutput) { - op := &request.Operation{ - Name: opStartLoaderJob, - HTTPMethod: "POST", - HTTPPath: "/loader", - } - - if input == nil { - input = &StartLoaderJobInput{} - } - - output = &StartLoaderJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartLoaderJob API operation for Amazon NeptuneData. -// -// Starts a Neptune bulk loader job to load data from an Amazon S3 bucket into -// a Neptune DB instance. See Using the Amazon Neptune Bulk Loader to Ingest -// Data (https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:StartLoaderJob (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#startloaderjob) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation StartLoaderJob for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - BulkLoadIdNotFoundException -// Raised when a specified bulk-load job ID cannot be found. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - LoadUrlAccessDeniedException -// Raised when access is denied to a specified load URL. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - InternalFailureException -// Raised when the processing of the request failed unexpectedly. -// -// - S3Exception -// Raised when there is a problem accessing Amazon S3. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/StartLoaderJob -func (c *Neptunedata) StartLoaderJob(input *StartLoaderJobInput) (*StartLoaderJobOutput, error) { - req, out := c.StartLoaderJobRequest(input) - return out, req.Send() -} - -// StartLoaderJobWithContext is the same as StartLoaderJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartLoaderJob 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 *Neptunedata) StartLoaderJobWithContext(ctx aws.Context, input *StartLoaderJobInput, opts ...request.Option) (*StartLoaderJobOutput, error) { - req, out := c.StartLoaderJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartMLDataProcessingJob = "StartMLDataProcessingJob" - -// StartMLDataProcessingJobRequest generates a "aws/request.Request" representing the -// client's request for the StartMLDataProcessingJob 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 StartMLDataProcessingJob for more information on using the StartMLDataProcessingJob -// 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 StartMLDataProcessingJobRequest method. -// req, resp := client.StartMLDataProcessingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/StartMLDataProcessingJob -func (c *Neptunedata) StartMLDataProcessingJobRequest(input *StartMLDataProcessingJobInput) (req *request.Request, output *StartMLDataProcessingJobOutput) { - op := &request.Operation{ - Name: opStartMLDataProcessingJob, - HTTPMethod: "POST", - HTTPPath: "/ml/dataprocessing", - } - - if input == nil { - input = &StartMLDataProcessingJobInput{} - } - - output = &StartMLDataProcessingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartMLDataProcessingJob API operation for Amazon NeptuneData. -// -// Creates a new Neptune ML data processing job for processing the graph data -// exported from Neptune for training. See The dataprocessing command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-dataprocessing.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:StartMLModelDataProcessingJob (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#startmlmodeldataprocessingjob) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation StartMLDataProcessingJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/StartMLDataProcessingJob -func (c *Neptunedata) StartMLDataProcessingJob(input *StartMLDataProcessingJobInput) (*StartMLDataProcessingJobOutput, error) { - req, out := c.StartMLDataProcessingJobRequest(input) - return out, req.Send() -} - -// StartMLDataProcessingJobWithContext is the same as StartMLDataProcessingJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartMLDataProcessingJob 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 *Neptunedata) StartMLDataProcessingJobWithContext(ctx aws.Context, input *StartMLDataProcessingJobInput, opts ...request.Option) (*StartMLDataProcessingJobOutput, error) { - req, out := c.StartMLDataProcessingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartMLModelTrainingJob = "StartMLModelTrainingJob" - -// StartMLModelTrainingJobRequest generates a "aws/request.Request" representing the -// client's request for the StartMLModelTrainingJob 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 StartMLModelTrainingJob for more information on using the StartMLModelTrainingJob -// 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 StartMLModelTrainingJobRequest method. -// req, resp := client.StartMLModelTrainingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/StartMLModelTrainingJob -func (c *Neptunedata) StartMLModelTrainingJobRequest(input *StartMLModelTrainingJobInput) (req *request.Request, output *StartMLModelTrainingJobOutput) { - op := &request.Operation{ - Name: opStartMLModelTrainingJob, - HTTPMethod: "POST", - HTTPPath: "/ml/modeltraining", - } - - if input == nil { - input = &StartMLModelTrainingJobInput{} - } - - output = &StartMLModelTrainingJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartMLModelTrainingJob API operation for Amazon NeptuneData. -// -// Creates a new Neptune ML model training job. See Model training using the -// modeltraining command (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-modeltraining.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:StartMLModelTrainingJob (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#startmlmodeltrainingjob) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation StartMLModelTrainingJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/StartMLModelTrainingJob -func (c *Neptunedata) StartMLModelTrainingJob(input *StartMLModelTrainingJobInput) (*StartMLModelTrainingJobOutput, error) { - req, out := c.StartMLModelTrainingJobRequest(input) - return out, req.Send() -} - -// StartMLModelTrainingJobWithContext is the same as StartMLModelTrainingJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartMLModelTrainingJob 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 *Neptunedata) StartMLModelTrainingJobWithContext(ctx aws.Context, input *StartMLModelTrainingJobInput, opts ...request.Option) (*StartMLModelTrainingJobOutput, error) { - req, out := c.StartMLModelTrainingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartMLModelTransformJob = "StartMLModelTransformJob" - -// StartMLModelTransformJobRequest generates a "aws/request.Request" representing the -// client's request for the StartMLModelTransformJob 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 StartMLModelTransformJob for more information on using the StartMLModelTransformJob -// 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 StartMLModelTransformJobRequest method. -// req, resp := client.StartMLModelTransformJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/StartMLModelTransformJob -func (c *Neptunedata) StartMLModelTransformJobRequest(input *StartMLModelTransformJobInput) (req *request.Request, output *StartMLModelTransformJobOutput) { - op := &request.Operation{ - Name: opStartMLModelTransformJob, - HTTPMethod: "POST", - HTTPPath: "/ml/modeltransform", - } - - if input == nil { - input = &StartMLModelTransformJobInput{} - } - - output = &StartMLModelTransformJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartMLModelTransformJob API operation for Amazon NeptuneData. -// -// Creates a new model transform job. See Use a trained model to generate new -// model artifacts (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-model-transform.html). -// -// When invoking this operation in a Neptune cluster that has IAM authentication -// enabled, the IAM user or role making the request must have a policy attached -// that allows the neptune-db:StartMLModelTransformJob (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#startmlmodeltransformjob) -// IAM action in that cluster. -// -// 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 NeptuneData's -// API operation StartMLModelTransformJob for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// Raised when a request attempts to initiate an operation that is not supported. -// -// - BadRequestException -// Raised when a request is submitted that cannot be processed. -// -// - MLResourceNotFoundException -// Raised when a specified machine-learning resource could not be found. -// -// - InvalidParameterException -// Raised when a parameter value is not valid. -// -// - ClientTimeoutException -// Raised when a request timed out in the client. -// -// - PreconditionsFailedException -// Raised when a precondition for processing a request is not satisfied. -// -// - ConstraintViolationException -// Raised when a value in a request field did not satisfy required constraints. -// -// - InvalidArgumentException -// Raised when an argument in a request has an invalid value. -// -// - MissingParameterException -// Raised when a required parameter is missing. -// -// - IllegalArgumentException -// Raised when an argument in a request is not supported. -// -// - TooManyRequestsException -// Raised when the number of requests being processed exceeds the limit. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/StartMLModelTransformJob -func (c *Neptunedata) StartMLModelTransformJob(input *StartMLModelTransformJobInput) (*StartMLModelTransformJobOutput, error) { - req, out := c.StartMLModelTransformJobRequest(input) - return out, req.Send() -} - -// StartMLModelTransformJobWithContext is the same as StartMLModelTransformJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartMLModelTransformJob 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 *Neptunedata) StartMLModelTransformJobWithContext(ctx aws.Context, input *StartMLModelTransformJobInput, opts ...request.Option) (*StartMLModelTransformJobOutput, error) { - req, out := c.StartMLModelTransformJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Raised in case of an authentication or authorization failure. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a request is submitted that cannot be processed. -type BadRequestException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the bad request. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 BadRequestException) 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 BadRequestException) GoString() string { - return s.String() -} - -func newErrorBadRequestException(v protocol.ResponseMetadata) error { - return &BadRequestException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *BadRequestException) Code() string { - return "BadRequestException" -} - -// Message returns the exception's message. -func (s *BadRequestException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *BadRequestException) OrigErr() error { - return nil -} - -func (s *BadRequestException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *BadRequestException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *BadRequestException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a specified bulk-load job ID cannot be found. -type BulkLoadIdNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The bulk-load job ID that could not be found. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 BulkLoadIdNotFoundException) 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 BulkLoadIdNotFoundException) GoString() string { - return s.String() -} - -func newErrorBulkLoadIdNotFoundException(v protocol.ResponseMetadata) error { - return &BulkLoadIdNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *BulkLoadIdNotFoundException) Code() string { - return "BulkLoadIdNotFoundException" -} - -// Message returns the exception's message. -func (s *BulkLoadIdNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *BulkLoadIdNotFoundException) OrigErr() error { - return nil -} - -func (s *BulkLoadIdNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *BulkLoadIdNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *BulkLoadIdNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CancelGremlinQueryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier that identifies the query to be canceled. - // - // QueryId is a required field - QueryId *string `location:"uri" locationName:"queryId" 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 CancelGremlinQueryInput) 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 CancelGremlinQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelGremlinQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelGremlinQueryInput"} - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueryId sets the QueryId field's value. -func (s *CancelGremlinQueryInput) SetQueryId(v string) *CancelGremlinQueryInput { - s.QueryId = &v - return s -} - -type CancelGremlinQueryOutput struct { - _ struct{} `type:"structure"` - - // The status of the cancelation - Status *string `locationName:"status" 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 CancelGremlinQueryOutput) 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 CancelGremlinQueryOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *CancelGremlinQueryOutput) SetStatus(v string) *CancelGremlinQueryOutput { - s.Status = &v - return s -} - -type CancelLoaderJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the load job to be deleted. - // - // LoadId is a required field - LoadId *string `location:"uri" locationName:"loadId" 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 CancelLoaderJobInput) 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 CancelLoaderJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelLoaderJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelLoaderJobInput"} - if s.LoadId == nil { - invalidParams.Add(request.NewErrParamRequired("LoadId")) - } - if s.LoadId != nil && len(*s.LoadId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LoadId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoadId sets the LoadId field's value. -func (s *CancelLoaderJobInput) SetLoadId(v string) *CancelLoaderJobInput { - s.LoadId = &v - return s -} - -type CancelLoaderJobOutput struct { - _ struct{} `type:"structure"` - - // The cancellation status. - Status *string `locationName:"status" 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 CancelLoaderJobOutput) 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 CancelLoaderJobOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *CancelLoaderJobOutput) SetStatus(v string) *CancelLoaderJobOutput { - s.Status = &v - return s -} - -type CancelMLDataProcessingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // If set to TRUE, this flag specifies that all Neptune ML S3 artifacts should - // be deleted when the job is stopped. The default is FALSE. - Clean *bool `location:"querystring" locationName:"clean" type:"boolean"` - - // The unique identifier of the data-processing job. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 CancelMLDataProcessingJobInput) 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 CancelMLDataProcessingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelMLDataProcessingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelMLDataProcessingJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClean sets the Clean field's value. -func (s *CancelMLDataProcessingJobInput) SetClean(v bool) *CancelMLDataProcessingJobInput { - s.Clean = &v - return s -} - -// SetId sets the Id field's value. -func (s *CancelMLDataProcessingJobInput) SetId(v string) *CancelMLDataProcessingJobInput { - s.Id = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *CancelMLDataProcessingJobInput) SetNeptuneIamRoleArn(v string) *CancelMLDataProcessingJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -type CancelMLDataProcessingJobOutput struct { - _ struct{} `type:"structure"` - - // The status of the cancellation request. - Status *string `locationName:"status" 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 CancelMLDataProcessingJobOutput) 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 CancelMLDataProcessingJobOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *CancelMLDataProcessingJobOutput) SetStatus(v string) *CancelMLDataProcessingJobOutput { - s.Status = &v - return s -} - -type CancelMLModelTrainingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // If set to TRUE, this flag specifies that all Amazon S3 artifacts should be - // deleted when the job is stopped. The default is FALSE. - Clean *bool `location:"querystring" locationName:"clean" type:"boolean"` - - // The unique identifier of the model-training job to be canceled. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 CancelMLModelTrainingJobInput) 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 CancelMLModelTrainingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelMLModelTrainingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelMLModelTrainingJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClean sets the Clean field's value. -func (s *CancelMLModelTrainingJobInput) SetClean(v bool) *CancelMLModelTrainingJobInput { - s.Clean = &v - return s -} - -// SetId sets the Id field's value. -func (s *CancelMLModelTrainingJobInput) SetId(v string) *CancelMLModelTrainingJobInput { - s.Id = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *CancelMLModelTrainingJobInput) SetNeptuneIamRoleArn(v string) *CancelMLModelTrainingJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -type CancelMLModelTrainingJobOutput struct { - _ struct{} `type:"structure"` - - // The status of the cancellation. - Status *string `locationName:"status" 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 CancelMLModelTrainingJobOutput) 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 CancelMLModelTrainingJobOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *CancelMLModelTrainingJobOutput) SetStatus(v string) *CancelMLModelTrainingJobOutput { - s.Status = &v - return s -} - -type CancelMLModelTransformJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // If this flag is set to TRUE, all Neptune ML S3 artifacts should be deleted - // when the job is stopped. The default is FALSE. - Clean *bool `location:"querystring" locationName:"clean" type:"boolean"` - - // The unique ID of the model transform job to be canceled. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 CancelMLModelTransformJobInput) 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 CancelMLModelTransformJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelMLModelTransformJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelMLModelTransformJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClean sets the Clean field's value. -func (s *CancelMLModelTransformJobInput) SetClean(v bool) *CancelMLModelTransformJobInput { - s.Clean = &v - return s -} - -// SetId sets the Id field's value. -func (s *CancelMLModelTransformJobInput) SetId(v string) *CancelMLModelTransformJobInput { - s.Id = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *CancelMLModelTransformJobInput) SetNeptuneIamRoleArn(v string) *CancelMLModelTransformJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -type CancelMLModelTransformJobOutput struct { - _ struct{} `type:"structure"` - - // the status of the cancelation. - Status *string `locationName:"status" 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 CancelMLModelTransformJobOutput) 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 CancelMLModelTransformJobOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *CancelMLModelTransformJobOutput) SetStatus(v string) *CancelMLModelTransformJobOutput { - s.Status = &v - return s -} - -type CancelOpenCypherQueryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique ID of the openCypher query to cancel. - // - // QueryId is a required field - QueryId *string `location:"uri" locationName:"queryId" type:"string" required:"true"` - - // If set to TRUE, causes the cancelation of the openCypher query to happen - // silently. - Silent *bool `location:"querystring" locationName:"silent" type:"boolean"` -} - -// 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 CancelOpenCypherQueryInput) 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 CancelOpenCypherQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelOpenCypherQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelOpenCypherQueryInput"} - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueryId sets the QueryId field's value. -func (s *CancelOpenCypherQueryInput) SetQueryId(v string) *CancelOpenCypherQueryInput { - s.QueryId = &v - return s -} - -// SetSilent sets the Silent field's value. -func (s *CancelOpenCypherQueryInput) SetSilent(v bool) *CancelOpenCypherQueryInput { - s.Silent = &v - return s -} - -type CancelOpenCypherQueryOutput struct { - _ struct{} `type:"structure"` - - // The cancelation payload for the openCypher query. - Payload *bool `locationName:"payload" type:"boolean"` - - // The cancellation status of the openCypher query. - Status *string `locationName:"status" 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 CancelOpenCypherQueryOutput) 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 CancelOpenCypherQueryOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *CancelOpenCypherQueryOutput) SetPayload(v bool) *CancelOpenCypherQueryOutput { - s.Payload = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CancelOpenCypherQueryOutput) SetStatus(v string) *CancelOpenCypherQueryOutput { - s.Status = &v - return s -} - -// Raised when a user cancelled a request. -type CancelledByUserException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 CancelledByUserException) 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 CancelledByUserException) GoString() string { - return s.String() -} - -func newErrorCancelledByUserException(v protocol.ResponseMetadata) error { - return &CancelledByUserException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *CancelledByUserException) Code() string { - return "CancelledByUserException" -} - -// Message returns the exception's message. -func (s *CancelledByUserException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *CancelledByUserException) OrigErr() error { - return nil -} - -func (s *CancelledByUserException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *CancelledByUserException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *CancelledByUserException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a request timed out in the client. -type ClientTimeoutException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 ClientTimeoutException) 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 ClientTimeoutException) GoString() string { - return s.String() -} - -func newErrorClientTimeoutException(v protocol.ResponseMetadata) error { - return &ClientTimeoutException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ClientTimeoutException) Code() string { - return "ClientTimeoutException" -} - -// Message returns the exception's message. -func (s *ClientTimeoutException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ClientTimeoutException) OrigErr() error { - return nil -} - -func (s *ClientTimeoutException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ClientTimeoutException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ClientTimeoutException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a request attempts to modify data that is concurrently being -// modified by another process. -type ConcurrentModificationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 ConcurrentModificationException) 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 ConcurrentModificationException) GoString() string { - return s.String() -} - -func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { - return &ConcurrentModificationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConcurrentModificationException) Code() string { - return "ConcurrentModificationException" -} - -// Message returns the exception's message. -func (s *ConcurrentModificationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConcurrentModificationException) OrigErr() error { - return nil -} - -func (s *ConcurrentModificationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConcurrentModificationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConcurrentModificationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a value in a request field did not satisfy required constraints. -type ConstraintViolationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 ConstraintViolationException) 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 ConstraintViolationException) GoString() string { - return s.String() -} - -func newErrorConstraintViolationException(v protocol.ResponseMetadata) error { - return &ConstraintViolationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConstraintViolationException) Code() string { - return "ConstraintViolationException" -} - -// Message returns the exception's message. -func (s *ConstraintViolationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConstraintViolationException) OrigErr() error { - return nil -} - -func (s *ConstraintViolationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConstraintViolationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConstraintViolationException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateMLEndpointInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the new inference endpoint. The default is an autogenerated - // timestamped name. - Id *string `locationName:"id" type:"string"` - - // The minimum number of Amazon EC2 instances to deploy to an endpoint for prediction. - // The default is 1 - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The type of Neptune ML instance to use for online servicing. The default - // is ml.m5.xlarge. Choosing the ML instance for an inference endpoint depends - // on the task type, the graph size, and your budget. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The job Id of the completed model-training job that has created the model - // that the inference endpoint will point to. You must supply either the mlModelTrainingJobId - // or the mlModelTransformJobId. - MlModelTrainingJobId *string `locationName:"mlModelTrainingJobId" type:"string"` - - // The job Id of the completed model-transform job. You must supply either the - // mlModelTrainingJobId or the mlModelTransformJobId. - MlModelTransformJobId *string `locationName:"mlModelTransformJobId" type:"string"` - - // Model type for training. By default the Neptune ML model is automatically - // based on the modelType used in data processing, but you can specify a different - // model type here. The default is rgcn for heterogeneous graphs and kge for - // knowledge graphs. The only valid value for heterogeneous graphs is rgcn. - // Valid values for knowledge graphs are: kge, transe, distmult, and rotate. - ModelName *string `locationName:"modelName" type:"string"` - - // The ARN of an IAM role providing Neptune access to SageMaker and Amazon S3 - // resources. This must be listed in your DB cluster parameter group or an error - // will be thrown. - NeptuneIamRoleArn *string `locationName:"neptuneIamRoleArn" type:"string"` - - // If set to true, update indicates that this is an update request. The default - // is false. You must supply either the mlModelTrainingJobId or the mlModelTransformJobId. - Update *bool `locationName:"update" type:"boolean"` - - // The Amazon Key Management Service (Amazon KMS) key that SageMaker uses to - // encrypt data on the storage volume attached to the ML compute instances that - // run the training job. The default is None. - VolumeEncryptionKMSKey *string `locationName:"volumeEncryptionKMSKey" 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 CreateMLEndpointInput) 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 CreateMLEndpointInput) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *CreateMLEndpointInput) SetId(v string) *CreateMLEndpointInput { - s.Id = &v - return s -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *CreateMLEndpointInput) SetInstanceCount(v int64) *CreateMLEndpointInput { - s.InstanceCount = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *CreateMLEndpointInput) SetInstanceType(v string) *CreateMLEndpointInput { - s.InstanceType = &v - return s -} - -// SetMlModelTrainingJobId sets the MlModelTrainingJobId field's value. -func (s *CreateMLEndpointInput) SetMlModelTrainingJobId(v string) *CreateMLEndpointInput { - s.MlModelTrainingJobId = &v - return s -} - -// SetMlModelTransformJobId sets the MlModelTransformJobId field's value. -func (s *CreateMLEndpointInput) SetMlModelTransformJobId(v string) *CreateMLEndpointInput { - s.MlModelTransformJobId = &v - return s -} - -// SetModelName sets the ModelName field's value. -func (s *CreateMLEndpointInput) SetModelName(v string) *CreateMLEndpointInput { - s.ModelName = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *CreateMLEndpointInput) SetNeptuneIamRoleArn(v string) *CreateMLEndpointInput { - s.NeptuneIamRoleArn = &v - return s -} - -// SetUpdate sets the Update field's value. -func (s *CreateMLEndpointInput) SetUpdate(v bool) *CreateMLEndpointInput { - s.Update = &v - return s -} - -// SetVolumeEncryptionKMSKey sets the VolumeEncryptionKMSKey field's value. -func (s *CreateMLEndpointInput) SetVolumeEncryptionKMSKey(v string) *CreateMLEndpointInput { - s.VolumeEncryptionKMSKey = &v - return s -} - -type CreateMLEndpointOutput struct { - _ struct{} `type:"structure"` - - // The ARN for the new inference endpoint. - Arn *string `locationName:"arn" type:"string"` - - // The endpoint creation time, in milliseconds. - CreationTimeInMillis *int64 `locationName:"creationTimeInMillis" type:"long"` - - // The unique ID of the new inference endpoint. - Id *string `locationName:"id" 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 CreateMLEndpointOutput) 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 CreateMLEndpointOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateMLEndpointOutput) SetArn(v string) *CreateMLEndpointOutput { - s.Arn = &v - return s -} - -// SetCreationTimeInMillis sets the CreationTimeInMillis field's value. -func (s *CreateMLEndpointOutput) SetCreationTimeInMillis(v int64) *CreateMLEndpointOutput { - s.CreationTimeInMillis = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateMLEndpointOutput) SetId(v string) *CreateMLEndpointOutput { - s.Id = &v - return s -} - -// Contains custom model training parameters. See Custom models in Neptune ML -// (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-custom-models.html). -type CustomModelTrainingParameters struct { - _ struct{} `type:"structure"` - - // The path to the Amazon S3 location where the Python module implementing your - // model is located. This must point to a valid existing Amazon S3 location - // that contains, at a minimum, a training script, a transform script, and a - // model-hpo-configuration.json file. - // - // SourceS3DirectoryPath is a required field - SourceS3DirectoryPath *string `locationName:"sourceS3DirectoryPath" type:"string" required:"true"` - - // The name of the entry point in your module of a script that performs model - // training and takes hyperparameters as command-line arguments, including fixed - // hyperparameters. The default is training.py. - TrainingEntryPointScript *string `locationName:"trainingEntryPointScript" type:"string"` - - // The name of the entry point in your module of a script that should be run - // after the best model from the hyperparameter search has been identified, - // to compute the model artifacts necessary for model deployment. It should - // be able to run with no command-line arguments.The default is transform.py. - TransformEntryPointScript *string `locationName:"transformEntryPointScript" 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 CustomModelTrainingParameters) 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 CustomModelTrainingParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomModelTrainingParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomModelTrainingParameters"} - if s.SourceS3DirectoryPath == nil { - invalidParams.Add(request.NewErrParamRequired("SourceS3DirectoryPath")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceS3DirectoryPath sets the SourceS3DirectoryPath field's value. -func (s *CustomModelTrainingParameters) SetSourceS3DirectoryPath(v string) *CustomModelTrainingParameters { - s.SourceS3DirectoryPath = &v - return s -} - -// SetTrainingEntryPointScript sets the TrainingEntryPointScript field's value. -func (s *CustomModelTrainingParameters) SetTrainingEntryPointScript(v string) *CustomModelTrainingParameters { - s.TrainingEntryPointScript = &v - return s -} - -// SetTransformEntryPointScript sets the TransformEntryPointScript field's value. -func (s *CustomModelTrainingParameters) SetTransformEntryPointScript(v string) *CustomModelTrainingParameters { - s.TransformEntryPointScript = &v - return s -} - -// Contains custom model transform parameters. See Use a trained model to generate -// new model artifacts (https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-model-transform.html). -type CustomModelTransformParameters struct { - _ struct{} `type:"structure"` - - // The path to the Amazon S3 location where the Python module implementing your - // model is located. This must point to a valid existing Amazon S3 location - // that contains, at a minimum, a training script, a transform script, and a - // model-hpo-configuration.json file. - // - // SourceS3DirectoryPath is a required field - SourceS3DirectoryPath *string `locationName:"sourceS3DirectoryPath" type:"string" required:"true"` - - // The name of the entry point in your module of a script that should be run - // after the best model from the hyperparameter search has been identified, - // to compute the model artifacts necessary for model deployment. It should - // be able to run with no command-line arguments. The default is transform.py. - TransformEntryPointScript *string `locationName:"transformEntryPointScript" 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 CustomModelTransformParameters) 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 CustomModelTransformParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomModelTransformParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomModelTransformParameters"} - if s.SourceS3DirectoryPath == nil { - invalidParams.Add(request.NewErrParamRequired("SourceS3DirectoryPath")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceS3DirectoryPath sets the SourceS3DirectoryPath field's value. -func (s *CustomModelTransformParameters) SetSourceS3DirectoryPath(v string) *CustomModelTransformParameters { - s.SourceS3DirectoryPath = &v - return s -} - -// SetTransformEntryPointScript sets the TransformEntryPointScript field's value. -func (s *CustomModelTransformParameters) SetTransformEntryPointScript(v string) *CustomModelTransformParameters { - s.TransformEntryPointScript = &v - return s -} - -type DeleteMLEndpointInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // If this flag is set to TRUE, all Neptune ML S3 artifacts should be deleted - // when the job is stopped. The default is FALSE. - Clean *bool `location:"querystring" locationName:"clean" type:"boolean"` - - // The unique identifier of the inference endpoint. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The ARN of an IAM role providing Neptune access to SageMaker and Amazon S3 - // resources. This must be listed in your DB cluster parameter group or an error - // will be thrown. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 DeleteMLEndpointInput) 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 DeleteMLEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteMLEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteMLEndpointInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClean sets the Clean field's value. -func (s *DeleteMLEndpointInput) SetClean(v bool) *DeleteMLEndpointInput { - s.Clean = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteMLEndpointInput) SetId(v string) *DeleteMLEndpointInput { - s.Id = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *DeleteMLEndpointInput) SetNeptuneIamRoleArn(v string) *DeleteMLEndpointInput { - s.NeptuneIamRoleArn = &v - return s -} - -type DeleteMLEndpointOutput struct { - _ struct{} `type:"structure"` - - // The status of the cancellation. - Status *string `locationName:"status" 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 DeleteMLEndpointOutput) 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 DeleteMLEndpointOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *DeleteMLEndpointOutput) SetStatus(v string) *DeleteMLEndpointOutput { - s.Status = &v - return s -} - -type DeletePropertygraphStatisticsInput struct { - _ struct{} `type:"structure" nopayload:"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 DeletePropertygraphStatisticsInput) 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 DeletePropertygraphStatisticsInput) GoString() string { - return s.String() -} - -type DeletePropertygraphStatisticsOutput struct { - _ struct{} `type:"structure"` - - // The deletion payload. - Payload *DeleteStatisticsValueMap `locationName:"payload" type:"structure"` - - // The cancel status. - Status *string `locationName:"status" type:"string"` - - // The HTTP response code: 200 if the delete was successful, or 204 if there - // were no statistics to delete. - StatusCode *int64 `location:"statusCode" locationName:"statusCode" 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 DeletePropertygraphStatisticsOutput) 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 DeletePropertygraphStatisticsOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *DeletePropertygraphStatisticsOutput) SetPayload(v *DeleteStatisticsValueMap) *DeletePropertygraphStatisticsOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeletePropertygraphStatisticsOutput) SetStatus(v string) *DeletePropertygraphStatisticsOutput { - s.Status = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *DeletePropertygraphStatisticsOutput) SetStatusCode(v int64) *DeletePropertygraphStatisticsOutput { - s.StatusCode = &v - return s -} - -type DeleteSparqlStatisticsInput struct { - _ struct{} `type:"structure" nopayload:"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 DeleteSparqlStatisticsInput) 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 DeleteSparqlStatisticsInput) GoString() string { - return s.String() -} - -type DeleteSparqlStatisticsOutput struct { - _ struct{} `type:"structure"` - - // The deletion payload. - Payload *DeleteStatisticsValueMap `locationName:"payload" type:"structure"` - - // The cancel status. - Status *string `locationName:"status" type:"string"` - - // The HTTP response code: 200 if the delete was successful, or 204 if there - // were no statistics to delete. - StatusCode *int64 `location:"statusCode" locationName:"statusCode" 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 DeleteSparqlStatisticsOutput) 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 DeleteSparqlStatisticsOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *DeleteSparqlStatisticsOutput) SetPayload(v *DeleteStatisticsValueMap) *DeleteSparqlStatisticsOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteSparqlStatisticsOutput) SetStatus(v string) *DeleteSparqlStatisticsOutput { - s.Status = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *DeleteSparqlStatisticsOutput) SetStatusCode(v int64) *DeleteSparqlStatisticsOutput { - s.StatusCode = &v - return s -} - -// The payload for DeleteStatistics. -type DeleteStatisticsValueMap struct { - _ struct{} `type:"structure"` - - // The current status of the statistics. - Active *bool `locationName:"active" type:"boolean"` - - // The ID of the statistics generation run that is currently occurring. - StatisticsId *string `locationName:"statisticsId" 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 DeleteStatisticsValueMap) 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 DeleteStatisticsValueMap) GoString() string { - return s.String() -} - -// SetActive sets the Active field's value. -func (s *DeleteStatisticsValueMap) SetActive(v bool) *DeleteStatisticsValueMap { - s.Active = &v - return s -} - -// SetStatisticsId sets the StatisticsId field's value. -func (s *DeleteStatisticsValueMap) SetStatisticsId(v string) *DeleteStatisticsValueMap { - s.StatisticsId = &v - return s -} - -// An edge structure. -type EdgeStructure struct { - _ struct{} `type:"structure"` - - // The number of edges that have this specific structure. - Count *int64 `locationName:"count" type:"long"` - - // A list of edge properties present in this specific structure. - EdgeProperties []*string `locationName:"edgeProperties" type:"list"` -} - -// 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 EdgeStructure) 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 EdgeStructure) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *EdgeStructure) SetCount(v int64) *EdgeStructure { - s.Count = &v - return s -} - -// SetEdgeProperties sets the EdgeProperties field's value. -func (s *EdgeStructure) SetEdgeProperties(v []*string) *EdgeStructure { - s.EdgeProperties = v - return s -} - -type ExecuteFastResetInput struct { - _ struct{} `type:"structure"` - - // The fast reset action. One of the following values: - // - // * initiateDatabaseReset – This action generates a unique token needed - // to actually perform the fast reset. - // - // * performDatabaseReset – This action uses the token generated by the - // initiateDatabaseReset action to actually perform the fast reset. - // - // Action is a required field - Action *string `locationName:"action" type:"string" required:"true" enum:"Action"` - - // The fast-reset token to initiate the reset. - Token *string `locationName:"token" 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 ExecuteFastResetInput) 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 ExecuteFastResetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecuteFastResetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecuteFastResetInput"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *ExecuteFastResetInput) SetAction(v string) *ExecuteFastResetInput { - s.Action = &v - return s -} - -// SetToken sets the Token field's value. -func (s *ExecuteFastResetInput) SetToken(v string) *ExecuteFastResetInput { - s.Token = &v - return s -} - -type ExecuteFastResetOutput struct { - _ struct{} `type:"structure"` - - // The payload is only returned by the initiateDatabaseReset action, and contains - // the unique token to use with the performDatabaseReset action to make the - // reset occur. - Payload *FastResetToken `locationName:"payload" type:"structure"` - - // The status is only returned for the performDatabaseReset action, and indicates - // whether or not the fast reset rquest is accepted. - // - // Status is a required field - Status *string `locationName:"status" 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 ExecuteFastResetOutput) 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 ExecuteFastResetOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *ExecuteFastResetOutput) SetPayload(v *FastResetToken) *ExecuteFastResetOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ExecuteFastResetOutput) SetStatus(v string) *ExecuteFastResetOutput { - s.Status = &v - return s -} - -type ExecuteGremlinExplainQueryInput struct { - _ struct{} `type:"structure"` - - // The Gremlin explain query string. - // - // GremlinQuery is a required field - GremlinQuery *string `locationName:"gremlin" 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 ExecuteGremlinExplainQueryInput) 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 ExecuteGremlinExplainQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecuteGremlinExplainQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecuteGremlinExplainQueryInput"} - if s.GremlinQuery == nil { - invalidParams.Add(request.NewErrParamRequired("GremlinQuery")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGremlinQuery sets the GremlinQuery field's value. -func (s *ExecuteGremlinExplainQueryInput) SetGremlinQuery(v string) *ExecuteGremlinExplainQueryInput { - s.GremlinQuery = &v - return s -} - -type ExecuteGremlinExplainQueryOutput struct { - _ struct{} `type:"structure" payload:"Output"` - - // A text blob containing the Gremlin explain result, as described in Tuning - // Gremlin queries (https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-traversal-tuning.html). - Output []byte `locationName:"output" type:"blob"` -} - -// 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 ExecuteGremlinExplainQueryOutput) 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 ExecuteGremlinExplainQueryOutput) GoString() string { - return s.String() -} - -// SetOutput sets the Output field's value. -func (s *ExecuteGremlinExplainQueryOutput) SetOutput(v []byte) *ExecuteGremlinExplainQueryOutput { - s.Output = v - return s -} - -type ExecuteGremlinProfileQueryInput struct { - _ struct{} `type:"structure"` - - // If non-zero, causes the results string to be truncated at that number of - // characters. If set to zero, the string contains all the results. - Chop *int64 `locationName:"profile.chop" type:"integer"` - - // The Gremlin query string to profile. - // - // GremlinQuery is a required field - GremlinQuery *string `locationName:"gremlin" type:"string" required:"true"` - - // If this flag is set to TRUE, the results include a detailed report of all - // index operations that took place during query execution and serialization. - IndexOps *bool `locationName:"profile.indexOps" type:"boolean"` - - // If this flag is set to TRUE, the query results are gathered and displayed - // as part of the profile report. If FALSE, only the result count is displayed. - Results *bool `locationName:"profile.results" type:"boolean"` - - // If non-null, the gathered results are returned in a serialized response message - // in the format specified by this parameter. See Gremlin profile API in Neptune - // (https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html) - // for more information. - Serializer *string `locationName:"profile.serializer" 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 ExecuteGremlinProfileQueryInput) 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 ExecuteGremlinProfileQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecuteGremlinProfileQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecuteGremlinProfileQueryInput"} - if s.GremlinQuery == nil { - invalidParams.Add(request.NewErrParamRequired("GremlinQuery")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChop sets the Chop field's value. -func (s *ExecuteGremlinProfileQueryInput) SetChop(v int64) *ExecuteGremlinProfileQueryInput { - s.Chop = &v - return s -} - -// SetGremlinQuery sets the GremlinQuery field's value. -func (s *ExecuteGremlinProfileQueryInput) SetGremlinQuery(v string) *ExecuteGremlinProfileQueryInput { - s.GremlinQuery = &v - return s -} - -// SetIndexOps sets the IndexOps field's value. -func (s *ExecuteGremlinProfileQueryInput) SetIndexOps(v bool) *ExecuteGremlinProfileQueryInput { - s.IndexOps = &v - return s -} - -// SetResults sets the Results field's value. -func (s *ExecuteGremlinProfileQueryInput) SetResults(v bool) *ExecuteGremlinProfileQueryInput { - s.Results = &v - return s -} - -// SetSerializer sets the Serializer field's value. -func (s *ExecuteGremlinProfileQueryInput) SetSerializer(v string) *ExecuteGremlinProfileQueryInput { - s.Serializer = &v - return s -} - -type ExecuteGremlinProfileQueryOutput struct { - _ struct{} `type:"structure" payload:"Output"` - - // A text blob containing the Gremlin Profile result. See Gremlin profile API - // in Neptune (https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-profile-api.html) - // for details. - Output []byte `locationName:"output" type:"blob"` -} - -// 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 ExecuteGremlinProfileQueryOutput) 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 ExecuteGremlinProfileQueryOutput) GoString() string { - return s.String() -} - -// SetOutput sets the Output field's value. -func (s *ExecuteGremlinProfileQueryOutput) SetOutput(v []byte) *ExecuteGremlinProfileQueryOutput { - s.Output = v - return s -} - -type ExecuteGremlinQueryInput struct { - _ struct{} `type:"structure"` - - // Using this API, you can run Gremlin queries in string format much as you - // can using the HTTP endpoint. The interface is compatible with whatever Gremlin - // version your DB cluster is using (see the Tinkerpop client section (https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-client.html#best-practices-gremlin-java-latest) - // to determine which Gremlin releases your engine version supports). - // - // GremlinQuery is a required field - GremlinQuery *string `locationName:"gremlin" type:"string" required:"true"` - - // If non-null, the query results are returned in a serialized response message - // in the format specified by this parameter. See the GraphSON (https://tinkerpop.apache.org/docs/current/reference/#_graphson) - // section in the TinkerPop documentation for a list of the formats that are - // currently supported. - Serializer *string `location:"header" locationName:"accept" 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 ExecuteGremlinQueryInput) 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 ExecuteGremlinQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecuteGremlinQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecuteGremlinQueryInput"} - if s.GremlinQuery == nil { - invalidParams.Add(request.NewErrParamRequired("GremlinQuery")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGremlinQuery sets the GremlinQuery field's value. -func (s *ExecuteGremlinQueryInput) SetGremlinQuery(v string) *ExecuteGremlinQueryInput { - s.GremlinQuery = &v - return s -} - -// SetSerializer sets the Serializer field's value. -func (s *ExecuteGremlinQueryInput) SetSerializer(v string) *ExecuteGremlinQueryInput { - s.Serializer = &v - return s -} - -type ExecuteGremlinQueryOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the Gremlin query. - RequestId *string `locationName:"requestId" type:"string"` - - // The status of the Gremlin query. - Status *GremlinQueryStatusAttributes `locationName:"status" 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 ExecuteGremlinQueryOutput) 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 ExecuteGremlinQueryOutput) GoString() string { - return s.String() -} - -// SetRequestId sets the RequestId field's value. -func (s *ExecuteGremlinQueryOutput) SetRequestId(v string) *ExecuteGremlinQueryOutput { - s.RequestId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ExecuteGremlinQueryOutput) SetStatus(v *GremlinQueryStatusAttributes) *ExecuteGremlinQueryOutput { - s.Status = v - return s -} - -type ExecuteOpenCypherExplainQueryInput struct { - _ struct{} `type:"structure"` - - // The openCypher explain mode. Can be one of: static, dynamic, or details. - // - // ExplainMode is a required field - ExplainMode *string `locationName:"explain" type:"string" required:"true" enum:"OpenCypherExplainMode"` - - // The openCypher query string. - // - // OpenCypherQuery is a required field - OpenCypherQuery *string `locationName:"query" type:"string" required:"true"` - - // The openCypher query parameters. - Parameters *string `locationName:"parameters" 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 ExecuteOpenCypherExplainQueryInput) 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 ExecuteOpenCypherExplainQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecuteOpenCypherExplainQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecuteOpenCypherExplainQueryInput"} - if s.ExplainMode == nil { - invalidParams.Add(request.NewErrParamRequired("ExplainMode")) - } - if s.OpenCypherQuery == nil { - invalidParams.Add(request.NewErrParamRequired("OpenCypherQuery")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExplainMode sets the ExplainMode field's value. -func (s *ExecuteOpenCypherExplainQueryInput) SetExplainMode(v string) *ExecuteOpenCypherExplainQueryInput { - s.ExplainMode = &v - return s -} - -// SetOpenCypherQuery sets the OpenCypherQuery field's value. -func (s *ExecuteOpenCypherExplainQueryInput) SetOpenCypherQuery(v string) *ExecuteOpenCypherExplainQueryInput { - s.OpenCypherQuery = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *ExecuteOpenCypherExplainQueryInput) SetParameters(v string) *ExecuteOpenCypherExplainQueryInput { - s.Parameters = &v - return s -} - -type ExecuteOpenCypherExplainQueryOutput struct { - _ struct{} `type:"structure" payload:"Results"` - - // A text blob containing the openCypher explain results. - // - // Results is a required field - Results []byte `locationName:"results" type:"blob" 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 ExecuteOpenCypherExplainQueryOutput) 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 ExecuteOpenCypherExplainQueryOutput) GoString() string { - return s.String() -} - -// SetResults sets the Results field's value. -func (s *ExecuteOpenCypherExplainQueryOutput) SetResults(v []byte) *ExecuteOpenCypherExplainQueryOutput { - s.Results = v - return s -} - -// Raised when a request attempts to access an stream that has expired. -type ExpiredStreamException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 ExpiredStreamException) 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 ExpiredStreamException) GoString() string { - return s.String() -} - -func newErrorExpiredStreamException(v protocol.ResponseMetadata) error { - return &ExpiredStreamException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ExpiredStreamException) Code() string { - return "ExpiredStreamException" -} - -// Message returns the exception's message. -func (s *ExpiredStreamException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ExpiredStreamException) OrigErr() error { - return nil -} - -func (s *ExpiredStreamException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ExpiredStreamException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ExpiredStreamException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a request fails. -type FailureByQueryException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 FailureByQueryException) 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 FailureByQueryException) GoString() string { - return s.String() -} - -func newErrorFailureByQueryException(v protocol.ResponseMetadata) error { - return &FailureByQueryException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *FailureByQueryException) Code() string { - return "FailureByQueryException" -} - -// Message returns the exception's message. -func (s *FailureByQueryException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *FailureByQueryException) OrigErr() error { - return nil -} - -func (s *FailureByQueryException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *FailureByQueryException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *FailureByQueryException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A structure containing the fast reset token used to initiate a fast reset. -type FastResetToken struct { - _ struct{} `type:"structure"` - - // A UUID generated by the database in the initiateDatabaseReset action, and - // then consumed by the performDatabaseReset to reset the database. - Token *string `locationName:"token" 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 FastResetToken) 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 FastResetToken) GoString() string { - return s.String() -} - -// SetToken sets the Token field's value. -func (s *FastResetToken) SetToken(v string) *FastResetToken { - s.Token = &v - return s -} - -type GetEngineStatusInput struct { - _ struct{} `type:"structure" nopayload:"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 GetEngineStatusInput) 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 GetEngineStatusInput) GoString() string { - return s.String() -} - -type GetEngineStatusOutput struct { - _ struct{} `type:"structure"` - - // Set to the Neptune engine version running on your DB cluster. If this engine - // version has been manually patched since it was released, the version number - // is prefixed by Patch-. - DbEngineVersion *string `locationName:"dbEngineVersion" type:"string"` - - // Set to enabled if the DFE engine is fully enabled, or to viaQueryHint (the - // default) if the DFE engine is only used with queries that have the useDFE - // query hint set to true. - DfeQueryEngine *string `locationName:"dfeQueryEngine" type:"string"` - - // Contains information about the Gremlin query language available on your cluster. - // Specifically, it contains a version field that specifies the current TinkerPop - // version being used by the engine. - Gremlin *QueryLanguageVersion `locationName:"gremlin" type:"structure"` - - // Contains Lab Mode settings being used by the engine. - LabMode map[string]*string `locationName:"labMode" type:"map"` - - // Contains information about the openCypher query language available on your - // cluster. Specifically, it contains a version field that specifies the current - // operCypher version being used by the engine. - Opencypher *QueryLanguageVersion `locationName:"opencypher" type:"structure"` - - // Set to reader if the instance is a read-replica, or to writer if the instance - // is the primary instance. - Role *string `locationName:"role" type:"string"` - - // If there are transactions being rolled back, this field is set to the number - // of such transactions. If there are none, the field doesn't appear at all. - RollingBackTrxCount *int64 `locationName:"rollingBackTrxCount" type:"integer"` - - // Set to the start time of the earliest transaction being rolled back. If no - // transactions are being rolled back, the field doesn't appear at all. - RollingBackTrxEarliestStartTime *string `locationName:"rollingBackTrxEarliestStartTime" type:"string"` - - // Contains information about the current settings on your DB cluster. For example, - // contains the current cluster query timeout setting (clusterQueryTimeoutInMs). - Settings map[string]*string `locationName:"settings" type:"map"` - - // Contains information about the SPARQL query language available on your cluster. - // Specifically, it contains a version field that specifies the current SPARQL - // version being used by the engine. - Sparql *QueryLanguageVersion `locationName:"sparql" type:"structure"` - - // Set to the UTC time at which the current server process started. - StartTime *string `locationName:"startTime" type:"string"` - - // Set to healthy if the instance is not experiencing problems. If the instance - // is recovering from a crash or from being rebooted and there are active transactions - // running from the latest server shutdown, status is set to recovery. - Status *string `locationName:"status" 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 GetEngineStatusOutput) 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 GetEngineStatusOutput) GoString() string { - return s.String() -} - -// SetDbEngineVersion sets the DbEngineVersion field's value. -func (s *GetEngineStatusOutput) SetDbEngineVersion(v string) *GetEngineStatusOutput { - s.DbEngineVersion = &v - return s -} - -// SetDfeQueryEngine sets the DfeQueryEngine field's value. -func (s *GetEngineStatusOutput) SetDfeQueryEngine(v string) *GetEngineStatusOutput { - s.DfeQueryEngine = &v - return s -} - -// SetGremlin sets the Gremlin field's value. -func (s *GetEngineStatusOutput) SetGremlin(v *QueryLanguageVersion) *GetEngineStatusOutput { - s.Gremlin = v - return s -} - -// SetLabMode sets the LabMode field's value. -func (s *GetEngineStatusOutput) SetLabMode(v map[string]*string) *GetEngineStatusOutput { - s.LabMode = v - return s -} - -// SetOpencypher sets the Opencypher field's value. -func (s *GetEngineStatusOutput) SetOpencypher(v *QueryLanguageVersion) *GetEngineStatusOutput { - s.Opencypher = v - return s -} - -// SetRole sets the Role field's value. -func (s *GetEngineStatusOutput) SetRole(v string) *GetEngineStatusOutput { - s.Role = &v - return s -} - -// SetRollingBackTrxCount sets the RollingBackTrxCount field's value. -func (s *GetEngineStatusOutput) SetRollingBackTrxCount(v int64) *GetEngineStatusOutput { - s.RollingBackTrxCount = &v - return s -} - -// SetRollingBackTrxEarliestStartTime sets the RollingBackTrxEarliestStartTime field's value. -func (s *GetEngineStatusOutput) SetRollingBackTrxEarliestStartTime(v string) *GetEngineStatusOutput { - s.RollingBackTrxEarliestStartTime = &v - return s -} - -// SetSettings sets the Settings field's value. -func (s *GetEngineStatusOutput) SetSettings(v map[string]*string) *GetEngineStatusOutput { - s.Settings = v - return s -} - -// SetSparql sets the Sparql field's value. -func (s *GetEngineStatusOutput) SetSparql(v *QueryLanguageVersion) *GetEngineStatusOutput { - s.Sparql = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetEngineStatusOutput) SetStartTime(v string) *GetEngineStatusOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetEngineStatusOutput) SetStatus(v string) *GetEngineStatusOutput { - s.Status = &v - return s -} - -type GetGremlinQueryStatusInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier that identifies the Gremlin query. - // - // QueryId is a required field - QueryId *string `location:"uri" locationName:"queryId" 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 GetGremlinQueryStatusInput) 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 GetGremlinQueryStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGremlinQueryStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGremlinQueryStatusInput"} - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueryId sets the QueryId field's value. -func (s *GetGremlinQueryStatusInput) SetQueryId(v string) *GetGremlinQueryStatusInput { - s.QueryId = &v - return s -} - -type GetGremlinQueryStatusOutput struct { - _ struct{} `type:"structure"` - - // The evaluation status of the Gremlin query. - QueryEvalStats *QueryEvalStats `locationName:"queryEvalStats" type:"structure"` - - // The ID of the query for which status is being returned. - QueryId *string `locationName:"queryId" type:"string"` - - // The Gremlin query string. - QueryString *string `locationName:"queryString" 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 GetGremlinQueryStatusOutput) 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 GetGremlinQueryStatusOutput) GoString() string { - return s.String() -} - -// SetQueryEvalStats sets the QueryEvalStats field's value. -func (s *GetGremlinQueryStatusOutput) SetQueryEvalStats(v *QueryEvalStats) *GetGremlinQueryStatusOutput { - s.QueryEvalStats = v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *GetGremlinQueryStatusOutput) SetQueryId(v string) *GetGremlinQueryStatusOutput { - s.QueryId = &v - return s -} - -// SetQueryString sets the QueryString field's value. -func (s *GetGremlinQueryStatusOutput) SetQueryString(v string) *GetGremlinQueryStatusOutput { - s.QueryString = &v - return s -} - -type GetMLDataProcessingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the data-processing job to be retrieved. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 GetMLDataProcessingJobInput) 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 GetMLDataProcessingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMLDataProcessingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMLDataProcessingJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetMLDataProcessingJobInput) SetId(v string) *GetMLDataProcessingJobInput { - s.Id = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *GetMLDataProcessingJobInput) SetNeptuneIamRoleArn(v string) *GetMLDataProcessingJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -type GetMLDataProcessingJobOutput struct { - _ struct{} `type:"structure"` - - // The unique identifier of this data-processing job. - Id *string `locationName:"id" type:"string"` - - // Definition of the data processing job. - ProcessingJob *MlResourceDefinition `locationName:"processingJob" type:"structure"` - - // Status of the data processing job. - Status *string `locationName:"status" 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 GetMLDataProcessingJobOutput) 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 GetMLDataProcessingJobOutput) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *GetMLDataProcessingJobOutput) SetId(v string) *GetMLDataProcessingJobOutput { - s.Id = &v - return s -} - -// SetProcessingJob sets the ProcessingJob field's value. -func (s *GetMLDataProcessingJobOutput) SetProcessingJob(v *MlResourceDefinition) *GetMLDataProcessingJobOutput { - s.ProcessingJob = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetMLDataProcessingJobOutput) SetStatus(v string) *GetMLDataProcessingJobOutput { - s.Status = &v - return s -} - -type GetMLEndpointInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the inference endpoint. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 GetMLEndpointInput) 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 GetMLEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMLEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMLEndpointInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetMLEndpointInput) SetId(v string) *GetMLEndpointInput { - s.Id = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *GetMLEndpointInput) SetNeptuneIamRoleArn(v string) *GetMLEndpointInput { - s.NeptuneIamRoleArn = &v - return s -} - -type GetMLEndpointOutput struct { - _ struct{} `type:"structure"` - - // The endpoint definition. - Endpoint *MlResourceDefinition `locationName:"endpoint" type:"structure"` - - // The endpoint configuration - EndpointConfig *MlConfigDefinition `locationName:"endpointConfig" type:"structure"` - - // The unique identifier of the inference endpoint. - Id *string `locationName:"id" type:"string"` - - // The status of the inference endpoint. - Status *string `locationName:"status" 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 GetMLEndpointOutput) 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 GetMLEndpointOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *GetMLEndpointOutput) SetEndpoint(v *MlResourceDefinition) *GetMLEndpointOutput { - s.Endpoint = v - return s -} - -// SetEndpointConfig sets the EndpointConfig field's value. -func (s *GetMLEndpointOutput) SetEndpointConfig(v *MlConfigDefinition) *GetMLEndpointOutput { - s.EndpointConfig = v - return s -} - -// SetId sets the Id field's value. -func (s *GetMLEndpointOutput) SetId(v string) *GetMLEndpointOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetMLEndpointOutput) SetStatus(v string) *GetMLEndpointOutput { - s.Status = &v - return s -} - -type GetMLModelTrainingJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the model-training job to retrieve. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 GetMLModelTrainingJobInput) 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 GetMLModelTrainingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMLModelTrainingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMLModelTrainingJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetMLModelTrainingJobInput) SetId(v string) *GetMLModelTrainingJobInput { - s.Id = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *GetMLModelTrainingJobInput) SetNeptuneIamRoleArn(v string) *GetMLModelTrainingJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -type GetMLModelTrainingJobOutput struct { - _ struct{} `type:"structure"` - - // The HPO job. - HpoJob *MlResourceDefinition `locationName:"hpoJob" type:"structure"` - - // The unique identifier of this model-training job. - Id *string `locationName:"id" type:"string"` - - // A list of the configurations of the ML models being used. - MlModels []*MlConfigDefinition `locationName:"mlModels" type:"list"` - - // The model transform job. - ModelTransformJob *MlResourceDefinition `locationName:"modelTransformJob" type:"structure"` - - // The data processing job. - ProcessingJob *MlResourceDefinition `locationName:"processingJob" type:"structure"` - - // The status of the model training job. - Status *string `locationName:"status" 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 GetMLModelTrainingJobOutput) 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 GetMLModelTrainingJobOutput) GoString() string { - return s.String() -} - -// SetHpoJob sets the HpoJob field's value. -func (s *GetMLModelTrainingJobOutput) SetHpoJob(v *MlResourceDefinition) *GetMLModelTrainingJobOutput { - s.HpoJob = v - return s -} - -// SetId sets the Id field's value. -func (s *GetMLModelTrainingJobOutput) SetId(v string) *GetMLModelTrainingJobOutput { - s.Id = &v - return s -} - -// SetMlModels sets the MlModels field's value. -func (s *GetMLModelTrainingJobOutput) SetMlModels(v []*MlConfigDefinition) *GetMLModelTrainingJobOutput { - s.MlModels = v - return s -} - -// SetModelTransformJob sets the ModelTransformJob field's value. -func (s *GetMLModelTrainingJobOutput) SetModelTransformJob(v *MlResourceDefinition) *GetMLModelTrainingJobOutput { - s.ModelTransformJob = v - return s -} - -// SetProcessingJob sets the ProcessingJob field's value. -func (s *GetMLModelTrainingJobOutput) SetProcessingJob(v *MlResourceDefinition) *GetMLModelTrainingJobOutput { - s.ProcessingJob = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetMLModelTrainingJobOutput) SetStatus(v string) *GetMLModelTrainingJobOutput { - s.Status = &v - return s -} - -type GetMLModelTransformJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the model-transform job to be reetrieved. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 GetMLModelTransformJobInput) 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 GetMLModelTransformJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetMLModelTransformJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMLModelTransformJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetMLModelTransformJobInput) SetId(v string) *GetMLModelTransformJobInput { - s.Id = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *GetMLModelTransformJobInput) SetNeptuneIamRoleArn(v string) *GetMLModelTransformJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -type GetMLModelTransformJobOutput struct { - _ struct{} `type:"structure"` - - // The base data processing job. - BaseProcessingJob *MlResourceDefinition `locationName:"baseProcessingJob" type:"structure"` - - // The unique identifier of the model-transform job to be retrieved. - Id *string `locationName:"id" type:"string"` - - // A list of the configuration information for the models being used. - Models []*MlConfigDefinition `locationName:"models" type:"list"` - - // The remote model transform job. - RemoteModelTransformJob *MlResourceDefinition `locationName:"remoteModelTransformJob" type:"structure"` - - // The status of the model-transform job. - Status *string `locationName:"status" 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 GetMLModelTransformJobOutput) 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 GetMLModelTransformJobOutput) GoString() string { - return s.String() -} - -// SetBaseProcessingJob sets the BaseProcessingJob field's value. -func (s *GetMLModelTransformJobOutput) SetBaseProcessingJob(v *MlResourceDefinition) *GetMLModelTransformJobOutput { - s.BaseProcessingJob = v - return s -} - -// SetId sets the Id field's value. -func (s *GetMLModelTransformJobOutput) SetId(v string) *GetMLModelTransformJobOutput { - s.Id = &v - return s -} - -// SetModels sets the Models field's value. -func (s *GetMLModelTransformJobOutput) SetModels(v []*MlConfigDefinition) *GetMLModelTransformJobOutput { - s.Models = v - return s -} - -// SetRemoteModelTransformJob sets the RemoteModelTransformJob field's value. -func (s *GetMLModelTransformJobOutput) SetRemoteModelTransformJob(v *MlResourceDefinition) *GetMLModelTransformJobOutput { - s.RemoteModelTransformJob = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetMLModelTransformJobOutput) SetStatus(v string) *GetMLModelTransformJobOutput { - s.Status = &v - return s -} - -type GetOpenCypherQueryStatusInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique ID of the openCypher query for which to retrieve the query status. - // - // QueryId is a required field - QueryId *string `location:"uri" locationName:"queryId" 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 GetOpenCypherQueryStatusInput) 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 GetOpenCypherQueryStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOpenCypherQueryStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOpenCypherQueryStatusInput"} - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetQueryId sets the QueryId field's value. -func (s *GetOpenCypherQueryStatusInput) SetQueryId(v string) *GetOpenCypherQueryStatusInput { - s.QueryId = &v - return s -} - -type GetOpenCypherQueryStatusOutput struct { - _ struct{} `type:"structure"` - - // The openCypher query evaluation status. - QueryEvalStats *QueryEvalStats `locationName:"queryEvalStats" type:"structure"` - - // The unique ID of the query for which status is being returned. - QueryId *string `locationName:"queryId" type:"string"` - - // The openCypher query string. - QueryString *string `locationName:"queryString" 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 GetOpenCypherQueryStatusOutput) 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 GetOpenCypherQueryStatusOutput) GoString() string { - return s.String() -} - -// SetQueryEvalStats sets the QueryEvalStats field's value. -func (s *GetOpenCypherQueryStatusOutput) SetQueryEvalStats(v *QueryEvalStats) *GetOpenCypherQueryStatusOutput { - s.QueryEvalStats = v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *GetOpenCypherQueryStatusOutput) SetQueryId(v string) *GetOpenCypherQueryStatusOutput { - s.QueryId = &v - return s -} - -// SetQueryString sets the QueryString field's value. -func (s *GetOpenCypherQueryStatusOutput) SetQueryString(v string) *GetOpenCypherQueryStatusOutput { - s.QueryString = &v - return s -} - -type GetPropertygraphStatisticsInput struct { - _ struct{} `type:"structure" nopayload:"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 GetPropertygraphStatisticsInput) 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 GetPropertygraphStatisticsInput) GoString() string { - return s.String() -} - -type GetPropertygraphStatisticsOutput struct { - _ struct{} `type:"structure"` - - // Statistics for property-graph data. - // - // Payload is a required field - Payload *Statistics `locationName:"payload" type:"structure" required:"true"` - - // The HTTP return code of the request. If the request succeeded, the code is - // 200. See Common error codes for DFE statistics request (https://docs.aws.amazon.com/neptune/latest/userguide/neptune-dfe-statistics.html#neptune-dfe-statistics-errors) - // for a list of common errors. - // - // Status is a required field - Status *string `locationName:"status" 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 GetPropertygraphStatisticsOutput) 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 GetPropertygraphStatisticsOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *GetPropertygraphStatisticsOutput) SetPayload(v *Statistics) *GetPropertygraphStatisticsOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetPropertygraphStatisticsOutput) SetStatus(v string) *GetPropertygraphStatisticsOutput { - s.Status = &v - return s -} - -type GetPropertygraphSummaryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Mode can take one of two values: BASIC (the default), and DETAILED. - Mode *string `location:"querystring" locationName:"mode" type:"string" enum:"GraphSummaryType"` -} - -// 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 GetPropertygraphSummaryInput) 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 GetPropertygraphSummaryInput) GoString() string { - return s.String() -} - -// SetMode sets the Mode field's value. -func (s *GetPropertygraphSummaryInput) SetMode(v string) *GetPropertygraphSummaryInput { - s.Mode = &v - return s -} - -type GetPropertygraphSummaryOutput struct { - _ struct{} `type:"structure"` - - // Payload containing the property graph summary response. - Payload *PropertygraphSummaryValueMap `locationName:"payload" type:"structure"` - - // The HTTP return code of the request. If the request succeeded, the code is - // 200. - StatusCode *int64 `location:"statusCode" locationName:"statusCode" 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 GetPropertygraphSummaryOutput) 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 GetPropertygraphSummaryOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *GetPropertygraphSummaryOutput) SetPayload(v *PropertygraphSummaryValueMap) *GetPropertygraphSummaryOutput { - s.Payload = v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *GetPropertygraphSummaryOutput) SetStatusCode(v int64) *GetPropertygraphSummaryOutput { - s.StatusCode = &v - return s -} - -type GetRDFGraphSummaryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Mode can take one of two values: BASIC (the default), and DETAILED. - Mode *string `location:"querystring" locationName:"mode" type:"string" enum:"GraphSummaryType"` -} - -// 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 GetRDFGraphSummaryInput) 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 GetRDFGraphSummaryInput) GoString() string { - return s.String() -} - -// SetMode sets the Mode field's value. -func (s *GetRDFGraphSummaryInput) SetMode(v string) *GetRDFGraphSummaryInput { - s.Mode = &v - return s -} - -type GetRDFGraphSummaryOutput struct { - _ struct{} `type:"structure"` - - // Payload for an RDF graph summary response - Payload *RDFGraphSummaryValueMap `locationName:"payload" type:"structure"` - - // The HTTP return code of the request. If the request succeeded, the code is - // 200. - StatusCode *int64 `location:"statusCode" locationName:"statusCode" 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 GetRDFGraphSummaryOutput) 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 GetRDFGraphSummaryOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *GetRDFGraphSummaryOutput) SetPayload(v *RDFGraphSummaryValueMap) *GetRDFGraphSummaryOutput { - s.Payload = v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *GetRDFGraphSummaryOutput) SetStatusCode(v int64) *GetRDFGraphSummaryOutput { - s.StatusCode = &v - return s -} - -type GetSparqlStatisticsInput struct { - _ struct{} `type:"structure" nopayload:"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 GetSparqlStatisticsInput) 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 GetSparqlStatisticsInput) GoString() string { - return s.String() -} - -type GetSparqlStatisticsOutput struct { - _ struct{} `type:"structure"` - - // Statistics for RDF data. - // - // Payload is a required field - Payload *Statistics `locationName:"payload" type:"structure" required:"true"` - - // The HTTP return code of the request. If the request succeeded, the code is - // 200. See Common error codes for DFE statistics request (https://docs.aws.amazon.com/neptune/latest/userguide/neptune-dfe-statistics.html#neptune-dfe-statistics-errors) - // for a list of common errors. - // - // When invoking this operation in a Neptune cluster that has IAM authentication - // enabled, the IAM user or role making the request must have a policy attached - // that allows the neptune-db:GetStatisticsStatus (https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#getstatisticsstatus) - // IAM action in that cluster. - // - // Status is a required field - Status *string `locationName:"status" 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 GetSparqlStatisticsOutput) 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 GetSparqlStatisticsOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *GetSparqlStatisticsOutput) SetPayload(v *Statistics) *GetSparqlStatisticsOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetSparqlStatisticsOutput) SetStatus(v string) *GetSparqlStatisticsOutput { - s.Status = &v - return s -} - -type GetSparqlStreamInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The commit number of the starting record to read from the change-log stream. - // This parameter is required when iteratorType isAT_SEQUENCE_NUMBER or AFTER_SEQUENCE_NUMBER, - // and ignored when iteratorType is TRIM_HORIZON or LATEST. - CommitNum *int64 `location:"querystring" locationName:"commitNum" type:"long"` - - // If set to TRUE, Neptune compresses the response using gzip encoding. - Encoding *string `location:"header" locationName:"Accept-Encoding" type:"string" enum:"Encoding"` - - // Can be one of: - // - // * AT_SEQUENCE_NUMBER – Indicates that reading should start from the - // event sequence number specified jointly by the commitNum and opNum parameters. - // - // * AFTER_SEQUENCE_NUMBER – Indicates that reading should start right - // after the event sequence number specified jointly by the commitNum and - // opNum parameters. - // - // * TRIM_HORIZON – Indicates that reading should start at the last untrimmed - // record in the system, which is the oldest unexpired (not yet deleted) - // record in the change-log stream. - // - // * LATEST – Indicates that reading should start at the most recent record - // in the system, which is the latest unexpired (not yet deleted) record - // in the change-log stream. - IteratorType *string `location:"querystring" locationName:"iteratorType" type:"string" enum:"IteratorType"` - - // Specifies the maximum number of records to return. There is also a size limit - // of 10 MB on the response that can't be modified and that takes precedence - // over the number of records specified in the limit parameter. The response - // does include a threshold-breaching record if the 10 MB limit was reached. - // - // The range for limit is 1 to 100,000, with a default of 10. - Limit *int64 `location:"querystring" locationName:"limit" min:"1" type:"long"` - - // The operation sequence number within the specified commit to start reading - // from in the change-log stream data. The default is 1. - OpNum *int64 `location:"querystring" locationName:"opNum" type:"long"` -} - -// 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 GetSparqlStreamInput) 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 GetSparqlStreamInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSparqlStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSparqlStreamInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommitNum sets the CommitNum field's value. -func (s *GetSparqlStreamInput) SetCommitNum(v int64) *GetSparqlStreamInput { - s.CommitNum = &v - return s -} - -// SetEncoding sets the Encoding field's value. -func (s *GetSparqlStreamInput) SetEncoding(v string) *GetSparqlStreamInput { - s.Encoding = &v - return s -} - -// SetIteratorType sets the IteratorType field's value. -func (s *GetSparqlStreamInput) SetIteratorType(v string) *GetSparqlStreamInput { - s.IteratorType = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *GetSparqlStreamInput) SetLimit(v int64) *GetSparqlStreamInput { - s.Limit = &v - return s -} - -// SetOpNum sets the OpNum field's value. -func (s *GetSparqlStreamInput) SetOpNum(v int64) *GetSparqlStreamInput { - s.OpNum = &v - return s -} - -type GetSparqlStreamOutput struct { - _ struct{} `type:"structure"` - - // Serialization format for the change records being returned. Currently, the - // only supported value is NQUADS. - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true"` - - // Sequence identifier of the last change in the stream response. - // - // An event ID is composed of two fields: a commitNum, which identifies a transaction - // that changed the graph, and an opNum, which identifies a specific operation - // within that transaction: - // - // LastEventId is a required field - LastEventId map[string]*string `locationName:"lastEventId" type:"map" required:"true"` - - // The time at which the commit for the transaction was requested, in milliseconds - // from the Unix epoch. - // - // LastTrxTimestampInMillis is a required field - LastTrxTimestampInMillis *int64 `locationName:"lastTrxTimestamp" type:"long" required:"true"` - - // An array of serialized change-log stream records included in the response. - // - // Records is a required field - Records []*SparqlRecord `locationName:"records" type:"list" required:"true"` - - // The total number of records in the response. - // - // TotalRecords is a required field - TotalRecords *int64 `locationName:"totalRecords" type:"integer" 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 GetSparqlStreamOutput) 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 GetSparqlStreamOutput) GoString() string { - return s.String() -} - -// SetFormat sets the Format field's value. -func (s *GetSparqlStreamOutput) SetFormat(v string) *GetSparqlStreamOutput { - s.Format = &v - return s -} - -// SetLastEventId sets the LastEventId field's value. -func (s *GetSparqlStreamOutput) SetLastEventId(v map[string]*string) *GetSparqlStreamOutput { - s.LastEventId = v - return s -} - -// SetLastTrxTimestampInMillis sets the LastTrxTimestampInMillis field's value. -func (s *GetSparqlStreamOutput) SetLastTrxTimestampInMillis(v int64) *GetSparqlStreamOutput { - s.LastTrxTimestampInMillis = &v - return s -} - -// SetRecords sets the Records field's value. -func (s *GetSparqlStreamOutput) SetRecords(v []*SparqlRecord) *GetSparqlStreamOutput { - s.Records = v - return s -} - -// SetTotalRecords sets the TotalRecords field's value. -func (s *GetSparqlStreamOutput) SetTotalRecords(v int64) *GetSparqlStreamOutput { - s.TotalRecords = &v - return s -} - -// Captures the status of a Gremlin query (see the Gremlin query status API -// (https://docs.aws.amazon.com/neptune/latest/userguide/gremlin-api-status.html) -// page). -type GremlinQueryStatus struct { - _ struct{} `type:"structure"` - - // The query statistics of the Gremlin query. - QueryEvalStats *QueryEvalStats `locationName:"queryEvalStats" type:"structure"` - - // The ID of the Gremlin query. - QueryId *string `locationName:"queryId" type:"string"` - - // The query string of the Gremlin query. - QueryString *string `locationName:"queryString" 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 GremlinQueryStatus) 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 GremlinQueryStatus) GoString() string { - return s.String() -} - -// SetQueryEvalStats sets the QueryEvalStats field's value. -func (s *GremlinQueryStatus) SetQueryEvalStats(v *QueryEvalStats) *GremlinQueryStatus { - s.QueryEvalStats = v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *GremlinQueryStatus) SetQueryId(v string) *GremlinQueryStatus { - s.QueryId = &v - return s -} - -// SetQueryString sets the QueryString field's value. -func (s *GremlinQueryStatus) SetQueryString(v string) *GremlinQueryStatus { - s.QueryString = &v - return s -} - -// Contains status components of a Gremlin query. -type GremlinQueryStatusAttributes struct { - _ struct{} `type:"structure"` - - // The HTTP response code returned fro the Gremlin query request.. - Code *int64 `locationName:"code" type:"integer"` - - // The status message. - Message *string `locationName:"message" 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 GremlinQueryStatusAttributes) 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 GremlinQueryStatusAttributes) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *GremlinQueryStatusAttributes) SetCode(v int64) *GremlinQueryStatusAttributes { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *GremlinQueryStatusAttributes) SetMessage(v string) *GremlinQueryStatusAttributes { - s.Message = &v - return s -} - -// Raised when an argument in a request is not supported. -type IllegalArgumentException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 IllegalArgumentException) 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 IllegalArgumentException) GoString() string { - return s.String() -} - -func newErrorIllegalArgumentException(v protocol.ResponseMetadata) error { - return &IllegalArgumentException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *IllegalArgumentException) Code() string { - return "IllegalArgumentException" -} - -// Message returns the exception's message. -func (s *IllegalArgumentException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *IllegalArgumentException) OrigErr() error { - return nil -} - -func (s *IllegalArgumentException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *IllegalArgumentException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *IllegalArgumentException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when the processing of the request failed unexpectedly. -type InternalFailureException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 InternalFailureException) 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 InternalFailureException) GoString() string { - return s.String() -} - -func newErrorInternalFailureException(v protocol.ResponseMetadata) error { - return &InternalFailureException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalFailureException) Code() string { - return "InternalFailureException" -} - -// Message returns the exception's message. -func (s *InternalFailureException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalFailureException) OrigErr() error { - return nil -} - -func (s *InternalFailureException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalFailureException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalFailureException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when an argument in a request has an invalid value. -type InvalidArgumentException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 InvalidArgumentException) 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 InvalidArgumentException) GoString() string { - return s.String() -} - -func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { - return &InvalidArgumentException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidArgumentException) Code() string { - return "InvalidArgumentException" -} - -// Message returns the exception's message. -func (s *InvalidArgumentException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidArgumentException) OrigErr() error { - return nil -} - -func (s *InvalidArgumentException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidArgumentException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidArgumentException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when invalid numerical data is encountered when servicing a request. -type InvalidNumericDataException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 InvalidNumericDataException) 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 InvalidNumericDataException) GoString() string { - return s.String() -} - -func newErrorInvalidNumericDataException(v protocol.ResponseMetadata) error { - return &InvalidNumericDataException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidNumericDataException) Code() string { - return "InvalidNumericDataException" -} - -// Message returns the exception's message. -func (s *InvalidNumericDataException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidNumericDataException) OrigErr() error { - return nil -} - -func (s *InvalidNumericDataException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidNumericDataException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidNumericDataException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a parameter value is not valid. -type InvalidParameterException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request that includes an invalid parameter. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 InvalidParameterException) 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 InvalidParameterException) GoString() string { - return s.String() -} - -func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { - return &InvalidParameterException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidParameterException) Code() string { - return "InvalidParameterException" -} - -// Message returns the exception's message. -func (s *InvalidParameterException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidParameterException) OrigErr() error { - return nil -} - -func (s *InvalidParameterException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidParameterException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidParameterException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListGremlinQueriesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // If set to TRUE, the list returned includes waiting queries. The default is - // FALSE; - IncludeWaiting *bool `location:"querystring" locationName:"includeWaiting" type:"boolean"` -} - -// 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 ListGremlinQueriesInput) 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 ListGremlinQueriesInput) GoString() string { - return s.String() -} - -// SetIncludeWaiting sets the IncludeWaiting field's value. -func (s *ListGremlinQueriesInput) SetIncludeWaiting(v bool) *ListGremlinQueriesInput { - s.IncludeWaiting = &v - return s -} - -type ListGremlinQueriesOutput struct { - _ struct{} `type:"structure"` - - // The number of queries that have been accepted but not yet completed, including - // queries in the queue. - AcceptedQueryCount *int64 `locationName:"acceptedQueryCount" type:"integer"` - - // A list of the current queries. - Queries []*GremlinQueryStatus `locationName:"queries" type:"list"` - - // The number of Gremlin queries currently running. - RunningQueryCount *int64 `locationName:"runningQueryCount" 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 ListGremlinQueriesOutput) 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 ListGremlinQueriesOutput) GoString() string { - return s.String() -} - -// SetAcceptedQueryCount sets the AcceptedQueryCount field's value. -func (s *ListGremlinQueriesOutput) SetAcceptedQueryCount(v int64) *ListGremlinQueriesOutput { - s.AcceptedQueryCount = &v - return s -} - -// SetQueries sets the Queries field's value. -func (s *ListGremlinQueriesOutput) SetQueries(v []*GremlinQueryStatus) *ListGremlinQueriesOutput { - s.Queries = v - return s -} - -// SetRunningQueryCount sets the RunningQueryCount field's value. -func (s *ListGremlinQueriesOutput) SetRunningQueryCount(v int64) *ListGremlinQueriesOutput { - s.RunningQueryCount = &v - return s -} - -type ListLoaderJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // An optional parameter that can be used to exclude the load IDs of queued - // load requests when requesting a list of load IDs by setting the parameter - // to FALSE. The default value is TRUE. - IncludeQueuedLoads *bool `location:"querystring" locationName:"includeQueuedLoads" type:"boolean"` - - // The number of load IDs to list. Must be a positive integer greater than zero - // and not more than 100 (which is the default). - Limit *int64 `location:"querystring" locationName:"limit" min:"1" 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 ListLoaderJobsInput) 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 ListLoaderJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListLoaderJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLoaderJobsInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIncludeQueuedLoads sets the IncludeQueuedLoads field's value. -func (s *ListLoaderJobsInput) SetIncludeQueuedLoads(v bool) *ListLoaderJobsInput { - s.IncludeQueuedLoads = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListLoaderJobsInput) SetLimit(v int64) *ListLoaderJobsInput { - s.Limit = &v - return s -} - -type ListLoaderJobsOutput struct { - _ struct{} `type:"structure"` - - // The requested list of job IDs. - // - // Payload is a required field - Payload *LoaderIdResult `locationName:"payload" type:"structure" required:"true"` - - // Returns the status of the job list request. - // - // Status is a required field - Status *string `locationName:"status" 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 ListLoaderJobsOutput) 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 ListLoaderJobsOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *ListLoaderJobsOutput) SetPayload(v *LoaderIdResult) *ListLoaderJobsOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListLoaderJobsOutput) SetStatus(v string) *ListLoaderJobsOutput { - s.Status = &v - return s -} - -type ListMLDataProcessingJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of items to return (from 1 to 1024; the default is 10). - MaxItems *int64 `location:"querystring" locationName:"maxItems" min:"1" type:"integer"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 ListMLDataProcessingJobsInput) 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 ListMLDataProcessingJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMLDataProcessingJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMLDataProcessingJobsInput"} - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListMLDataProcessingJobsInput) SetMaxItems(v int64) *ListMLDataProcessingJobsInput { - s.MaxItems = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *ListMLDataProcessingJobsInput) SetNeptuneIamRoleArn(v string) *ListMLDataProcessingJobsInput { - s.NeptuneIamRoleArn = &v - return s -} - -type ListMLDataProcessingJobsOutput struct { - _ struct{} `type:"structure"` - - // A page listing data processing job IDs. - Ids []*string `locationName:"ids" type:"list"` -} - -// 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 ListMLDataProcessingJobsOutput) 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 ListMLDataProcessingJobsOutput) GoString() string { - return s.String() -} - -// SetIds sets the Ids field's value. -func (s *ListMLDataProcessingJobsOutput) SetIds(v []*string) *ListMLDataProcessingJobsOutput { - s.Ids = v - return s -} - -type ListMLEndpointsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of items to return (from 1 to 1024; the default is 10. - MaxItems *int64 `location:"querystring" locationName:"maxItems" min:"1" type:"integer"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 ListMLEndpointsInput) 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 ListMLEndpointsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMLEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMLEndpointsInput"} - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListMLEndpointsInput) SetMaxItems(v int64) *ListMLEndpointsInput { - s.MaxItems = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *ListMLEndpointsInput) SetNeptuneIamRoleArn(v string) *ListMLEndpointsInput { - s.NeptuneIamRoleArn = &v - return s -} - -type ListMLEndpointsOutput struct { - _ struct{} `type:"structure"` - - // A page from the list of inference endpoint IDs. - Ids []*string `locationName:"ids" type:"list"` -} - -// 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 ListMLEndpointsOutput) 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 ListMLEndpointsOutput) GoString() string { - return s.String() -} - -// SetIds sets the Ids field's value. -func (s *ListMLEndpointsOutput) SetIds(v []*string) *ListMLEndpointsOutput { - s.Ids = v - return s -} - -type ListMLModelTrainingJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of items to return (from 1 to 1024; the default is 10). - MaxItems *int64 `location:"querystring" locationName:"maxItems" min:"1" type:"integer"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 ListMLModelTrainingJobsInput) 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 ListMLModelTrainingJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMLModelTrainingJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMLModelTrainingJobsInput"} - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListMLModelTrainingJobsInput) SetMaxItems(v int64) *ListMLModelTrainingJobsInput { - s.MaxItems = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *ListMLModelTrainingJobsInput) SetNeptuneIamRoleArn(v string) *ListMLModelTrainingJobsInput { - s.NeptuneIamRoleArn = &v - return s -} - -type ListMLModelTrainingJobsOutput struct { - _ struct{} `type:"structure"` - - // A page of the list of model training job IDs. - Ids []*string `locationName:"ids" type:"list"` -} - -// 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 ListMLModelTrainingJobsOutput) 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 ListMLModelTrainingJobsOutput) GoString() string { - return s.String() -} - -// SetIds sets the Ids field's value. -func (s *ListMLModelTrainingJobsOutput) SetIds(v []*string) *ListMLModelTrainingJobsOutput { - s.Ids = v - return s -} - -type ListMLModelTransformJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of items to return (from 1 to 1024; the default is 10). - MaxItems *int64 `location:"querystring" locationName:"maxItems" min:"1" type:"integer"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `location:"querystring" locationName:"neptuneIamRoleArn" 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 ListMLModelTransformJobsInput) 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 ListMLModelTransformJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMLModelTransformJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMLModelTransformJobsInput"} - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxItems sets the MaxItems field's value. -func (s *ListMLModelTransformJobsInput) SetMaxItems(v int64) *ListMLModelTransformJobsInput { - s.MaxItems = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *ListMLModelTransformJobsInput) SetNeptuneIamRoleArn(v string) *ListMLModelTransformJobsInput { - s.NeptuneIamRoleArn = &v - return s -} - -type ListMLModelTransformJobsOutput struct { - _ struct{} `type:"structure"` - - // A page from the list of model transform IDs. - Ids []*string `locationName:"ids" type:"list"` -} - -// 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 ListMLModelTransformJobsOutput) 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 ListMLModelTransformJobsOutput) GoString() string { - return s.String() -} - -// SetIds sets the Ids field's value. -func (s *ListMLModelTransformJobsOutput) SetIds(v []*string) *ListMLModelTransformJobsOutput { - s.Ids = v - return s -} - -type ListOpenCypherQueriesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // When set to TRUE and other parameters are not present, causes status information - // to be returned for waiting queries as well as for running queries. - IncludeWaiting *bool `location:"querystring" locationName:"includeWaiting" type:"boolean"` -} - -// 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 ListOpenCypherQueriesInput) 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 ListOpenCypherQueriesInput) GoString() string { - return s.String() -} - -// SetIncludeWaiting sets the IncludeWaiting field's value. -func (s *ListOpenCypherQueriesInput) SetIncludeWaiting(v bool) *ListOpenCypherQueriesInput { - s.IncludeWaiting = &v - return s -} - -type ListOpenCypherQueriesOutput struct { - _ struct{} `type:"structure"` - - // The number of queries that have been accepted but not yet completed, including - // queries in the queue. - AcceptedQueryCount *int64 `locationName:"acceptedQueryCount" type:"integer"` - - // A list of current openCypher queries. - Queries []*GremlinQueryStatus `locationName:"queries" type:"list"` - - // The number of currently running openCypher queries. - RunningQueryCount *int64 `locationName:"runningQueryCount" 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 ListOpenCypherQueriesOutput) 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 ListOpenCypherQueriesOutput) GoString() string { - return s.String() -} - -// SetAcceptedQueryCount sets the AcceptedQueryCount field's value. -func (s *ListOpenCypherQueriesOutput) SetAcceptedQueryCount(v int64) *ListOpenCypherQueriesOutput { - s.AcceptedQueryCount = &v - return s -} - -// SetQueries sets the Queries field's value. -func (s *ListOpenCypherQueriesOutput) SetQueries(v []*GremlinQueryStatus) *ListOpenCypherQueriesOutput { - s.Queries = v - return s -} - -// SetRunningQueryCount sets the RunningQueryCount field's value. -func (s *ListOpenCypherQueriesOutput) SetRunningQueryCount(v int64) *ListOpenCypherQueriesOutput { - s.RunningQueryCount = &v - return s -} - -// Raised when access is denied to a specified load URL. -type LoadUrlAccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 LoadUrlAccessDeniedException) 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 LoadUrlAccessDeniedException) GoString() string { - return s.String() -} - -func newErrorLoadUrlAccessDeniedException(v protocol.ResponseMetadata) error { - return &LoadUrlAccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *LoadUrlAccessDeniedException) Code() string { - return "LoadUrlAccessDeniedException" -} - -// Message returns the exception's message. -func (s *LoadUrlAccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *LoadUrlAccessDeniedException) OrigErr() error { - return nil -} - -func (s *LoadUrlAccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *LoadUrlAccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *LoadUrlAccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains a list of load IDs. -type LoaderIdResult struct { - _ struct{} `type:"structure"` - - // A list of load IDs. - LoadIds []*string `locationName:"loadIds" type:"list"` -} - -// 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 LoaderIdResult) 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 LoaderIdResult) GoString() string { - return s.String() -} - -// SetLoadIds sets the LoadIds field's value. -func (s *LoaderIdResult) SetLoadIds(v []*string) *LoaderIdResult { - s.LoadIds = v - return s -} - -// Raised when a specified machine-learning resource could not be found. -type MLResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 MLResourceNotFoundException) 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 MLResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorMLResourceNotFoundException(v protocol.ResponseMetadata) error { - return &MLResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MLResourceNotFoundException) Code() string { - return "MLResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *MLResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MLResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *MLResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MLResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MLResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a query is submitted that is syntactically incorrect or does -// not pass additional validation. -type MalformedQueryException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the malformed query request. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 MalformedQueryException) 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 MalformedQueryException) GoString() string { - return s.String() -} - -func newErrorMalformedQueryException(v protocol.ResponseMetadata) error { - return &MalformedQueryException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MalformedQueryException) Code() string { - return "MalformedQueryException" -} - -// Message returns the exception's message. -func (s *MalformedQueryException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MalformedQueryException) OrigErr() error { - return nil -} - -func (s *MalformedQueryException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MalformedQueryException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MalformedQueryException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ManagePropertygraphStatisticsInput struct { - _ struct{} `type:"structure"` - - // The statistics generation mode. One of: DISABLE_AUTOCOMPUTE, ENABLE_AUTOCOMPUTE, - // or REFRESH, the last of which manually triggers DFE statistics generation. - Mode *string `locationName:"mode" type:"string" enum:"StatisticsAutoGenerationMode"` -} - -// 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 ManagePropertygraphStatisticsInput) 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 ManagePropertygraphStatisticsInput) GoString() string { - return s.String() -} - -// SetMode sets the Mode field's value. -func (s *ManagePropertygraphStatisticsInput) SetMode(v string) *ManagePropertygraphStatisticsInput { - s.Mode = &v - return s -} - -type ManagePropertygraphStatisticsOutput struct { - _ struct{} `type:"structure"` - - // This is only returned for refresh mode. - Payload *RefreshStatisticsIdMap `locationName:"payload" type:"structure"` - - // The HTTP return code of the request. If the request succeeded, the code is - // 200. - // - // Status is a required field - Status *string `locationName:"status" 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 ManagePropertygraphStatisticsOutput) 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 ManagePropertygraphStatisticsOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *ManagePropertygraphStatisticsOutput) SetPayload(v *RefreshStatisticsIdMap) *ManagePropertygraphStatisticsOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ManagePropertygraphStatisticsOutput) SetStatus(v string) *ManagePropertygraphStatisticsOutput { - s.Status = &v - return s -} - -type ManageSparqlStatisticsInput struct { - _ struct{} `type:"structure"` - - // The statistics generation mode. One of: DISABLE_AUTOCOMPUTE, ENABLE_AUTOCOMPUTE, - // or REFRESH, the last of which manually triggers DFE statistics generation. - Mode *string `locationName:"mode" type:"string" enum:"StatisticsAutoGenerationMode"` -} - -// 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 ManageSparqlStatisticsInput) 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 ManageSparqlStatisticsInput) GoString() string { - return s.String() -} - -// SetMode sets the Mode field's value. -func (s *ManageSparqlStatisticsInput) SetMode(v string) *ManageSparqlStatisticsInput { - s.Mode = &v - return s -} - -type ManageSparqlStatisticsOutput struct { - _ struct{} `type:"structure"` - - // This is only returned for refresh mode. - Payload *RefreshStatisticsIdMap `locationName:"payload" type:"structure"` - - // The HTTP return code of the request. If the request succeeded, the code is - // 200. - // - // Status is a required field - Status *string `locationName:"status" 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 ManageSparqlStatisticsOutput) 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 ManageSparqlStatisticsOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *ManageSparqlStatisticsOutput) SetPayload(v *RefreshStatisticsIdMap) *ManageSparqlStatisticsOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ManageSparqlStatisticsOutput) SetStatus(v string) *ManageSparqlStatisticsOutput { - s.Status = &v - return s -} - -// Raised when a request fails because of insufficient memory resources. The -// request can be retried. -type MemoryLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request that failed. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 MemoryLimitExceededException) 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 MemoryLimitExceededException) GoString() string { - return s.String() -} - -func newErrorMemoryLimitExceededException(v protocol.ResponseMetadata) error { - return &MemoryLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MemoryLimitExceededException) Code() string { - return "MemoryLimitExceededException" -} - -// Message returns the exception's message. -func (s *MemoryLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MemoryLimitExceededException) OrigErr() error { - return nil -} - -func (s *MemoryLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MemoryLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MemoryLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when the HTTP method used by a request is not supported by the endpoint -// being used. -type MethodNotAllowedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 MethodNotAllowedException) 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 MethodNotAllowedException) GoString() string { - return s.String() -} - -func newErrorMethodNotAllowedException(v protocol.ResponseMetadata) error { - return &MethodNotAllowedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MethodNotAllowedException) Code() string { - return "MethodNotAllowedException" -} - -// Message returns the exception's message. -func (s *MethodNotAllowedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MethodNotAllowedException) OrigErr() error { - return nil -} - -func (s *MethodNotAllowedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MethodNotAllowedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MethodNotAllowedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a required parameter is missing. -type MissingParameterException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in which the parameter is missing. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 MissingParameterException) 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 MissingParameterException) GoString() string { - return s.String() -} - -func newErrorMissingParameterException(v protocol.ResponseMetadata) error { - return &MissingParameterException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MissingParameterException) Code() string { - return "MissingParameterException" -} - -// Message returns the exception's message. -func (s *MissingParameterException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MissingParameterException) OrigErr() error { - return nil -} - -func (s *MissingParameterException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MissingParameterException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MissingParameterException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains a Neptune ML configuration. -type MlConfigDefinition struct { - _ struct{} `type:"structure"` - - // The ARN for the configuration. - Arn *string `locationName:"arn" type:"string"` - - // The configuration name. - Name *string `locationName:"name" 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 MlConfigDefinition) 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 MlConfigDefinition) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *MlConfigDefinition) SetArn(v string) *MlConfigDefinition { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *MlConfigDefinition) SetName(v string) *MlConfigDefinition { - s.Name = &v - return s -} - -// Defines a Neptune ML resource. -type MlResourceDefinition struct { - _ struct{} `type:"structure"` - - // The resource ARN. - Arn *string `locationName:"arn" type:"string"` - - // The CloudWatch log URL for the resource. - CloudwatchLogUrl *string `locationName:"cloudwatchLogUrl" type:"string"` - - // The failure reason, in case of a failure. - FailureReason *string `locationName:"failureReason" type:"string"` - - // The resource name. - Name *string `locationName:"name" type:"string"` - - // The output location. - OutputLocation *string `locationName:"outputLocation" type:"string"` - - // The resource status. - Status *string `locationName:"status" 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 MlResourceDefinition) 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 MlResourceDefinition) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *MlResourceDefinition) SetArn(v string) *MlResourceDefinition { - s.Arn = &v - return s -} - -// SetCloudwatchLogUrl sets the CloudwatchLogUrl field's value. -func (s *MlResourceDefinition) SetCloudwatchLogUrl(v string) *MlResourceDefinition { - s.CloudwatchLogUrl = &v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *MlResourceDefinition) SetFailureReason(v string) *MlResourceDefinition { - s.FailureReason = &v - return s -} - -// SetName sets the Name field's value. -func (s *MlResourceDefinition) SetName(v string) *MlResourceDefinition { - s.Name = &v - return s -} - -// SetOutputLocation sets the OutputLocation field's value. -func (s *MlResourceDefinition) SetOutputLocation(v string) *MlResourceDefinition { - s.OutputLocation = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *MlResourceDefinition) SetStatus(v string) *MlResourceDefinition { - s.Status = &v - return s -} - -// A node structure. -type NodeStructure struct { - _ struct{} `type:"structure"` - - // Number of nodes that have this specific structure. - Count *int64 `locationName:"count" type:"long"` - - // A list of distinct outgoing edge labels present in this specific structure. - DistinctOutgoingEdgeLabels []*string `locationName:"distinctOutgoingEdgeLabels" type:"list"` - - // A list of the node properties present in this specific structure. - NodeProperties []*string `locationName:"nodeProperties" type:"list"` -} - -// 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 NodeStructure) 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 NodeStructure) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *NodeStructure) SetCount(v int64) *NodeStructure { - s.Count = &v - return s -} - -// SetDistinctOutgoingEdgeLabels sets the DistinctOutgoingEdgeLabels field's value. -func (s *NodeStructure) SetDistinctOutgoingEdgeLabels(v []*string) *NodeStructure { - s.DistinctOutgoingEdgeLabels = v - return s -} - -// SetNodeProperties sets the NodeProperties field's value. -func (s *NodeStructure) SetNodeProperties(v []*string) *NodeStructure { - s.NodeProperties = v - return s -} - -// Raised when a parsing issue is encountered. -type ParsingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 ParsingException) 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 ParsingException) GoString() string { - return s.String() -} - -func newErrorParsingException(v protocol.ResponseMetadata) error { - return &ParsingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ParsingException) Code() string { - return "ParsingException" -} - -// Message returns the exception's message. -func (s *ParsingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ParsingException) OrigErr() error { - return nil -} - -func (s *ParsingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ParsingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ParsingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a precondition for processing a request is not satisfied. -type PreconditionsFailedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 PreconditionsFailedException) 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 PreconditionsFailedException) GoString() string { - return s.String() -} - -func newErrorPreconditionsFailedException(v protocol.ResponseMetadata) error { - return &PreconditionsFailedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PreconditionsFailedException) Code() string { - return "PreconditionsFailedException" -} - -// Message returns the exception's message. -func (s *PreconditionsFailedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PreconditionsFailedException) OrigErr() error { - return nil -} - -func (s *PreconditionsFailedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PreconditionsFailedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PreconditionsFailedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The graph summary API returns a read-only list of node and edge labels and -// property keys, along with counts of nodes, edges, and properties. See Graph -// summary response for a property graph (PG) (https://docs.aws.amazon.com/neptune/latest/userguide/neptune-graph-summary.html#neptune-graph-summary-pg-response). -type PropertygraphSummary struct { - _ struct{} `type:"structure"` - - // A list of the distinct edge labels in the graph. - EdgeLabels []*string `locationName:"edgeLabels" type:"list"` - - // A list of the distinct edge properties in the graph, along with the count - // of edges where each property is used. - EdgeProperties []map[string]*int64 `locationName:"edgeProperties" type:"list"` - - // This field is only present when the requested mode is DETAILED. It contains - // a list of edge structures. - EdgeStructures []*EdgeStructure `locationName:"edgeStructures" type:"list"` - - // A list of the distinct node labels in the graph. - NodeLabels []*string `locationName:"nodeLabels" type:"list"` - - // The number of distinct node properties in the graph. - NodeProperties []map[string]*int64 `locationName:"nodeProperties" type:"list"` - - // This field is only present when the requested mode is DETAILED. It contains - // a list of node structures. - NodeStructures []*NodeStructure `locationName:"nodeStructures" type:"list"` - - // The number of distinct edge labels in the graph. - NumEdgeLabels *int64 `locationName:"numEdgeLabels" type:"long"` - - // The number of distinct edge properties in the graph. - NumEdgeProperties *int64 `locationName:"numEdgeProperties" type:"long"` - - // The number of edges in the graph. - NumEdges *int64 `locationName:"numEdges" type:"long"` - - // The number of distinct node labels in the graph. - NumNodeLabels *int64 `locationName:"numNodeLabels" type:"long"` - - // A list of the distinct node properties in the graph, along with the count - // of nodes where each property is used. - NumNodeProperties *int64 `locationName:"numNodeProperties" type:"long"` - - // The number of nodes in the graph. - NumNodes *int64 `locationName:"numNodes" type:"long"` - - // The total number of usages of all edge properties. - TotalEdgePropertyValues *int64 `locationName:"totalEdgePropertyValues" type:"long"` - - // The total number of usages of all node properties. - TotalNodePropertyValues *int64 `locationName:"totalNodePropertyValues" type:"long"` -} - -// 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 PropertygraphSummary) 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 PropertygraphSummary) GoString() string { - return s.String() -} - -// SetEdgeLabels sets the EdgeLabels field's value. -func (s *PropertygraphSummary) SetEdgeLabels(v []*string) *PropertygraphSummary { - s.EdgeLabels = v - return s -} - -// SetEdgeProperties sets the EdgeProperties field's value. -func (s *PropertygraphSummary) SetEdgeProperties(v []map[string]*int64) *PropertygraphSummary { - s.EdgeProperties = v - return s -} - -// SetEdgeStructures sets the EdgeStructures field's value. -func (s *PropertygraphSummary) SetEdgeStructures(v []*EdgeStructure) *PropertygraphSummary { - s.EdgeStructures = v - return s -} - -// SetNodeLabels sets the NodeLabels field's value. -func (s *PropertygraphSummary) SetNodeLabels(v []*string) *PropertygraphSummary { - s.NodeLabels = v - return s -} - -// SetNodeProperties sets the NodeProperties field's value. -func (s *PropertygraphSummary) SetNodeProperties(v []map[string]*int64) *PropertygraphSummary { - s.NodeProperties = v - return s -} - -// SetNodeStructures sets the NodeStructures field's value. -func (s *PropertygraphSummary) SetNodeStructures(v []*NodeStructure) *PropertygraphSummary { - s.NodeStructures = v - return s -} - -// SetNumEdgeLabels sets the NumEdgeLabels field's value. -func (s *PropertygraphSummary) SetNumEdgeLabels(v int64) *PropertygraphSummary { - s.NumEdgeLabels = &v - return s -} - -// SetNumEdgeProperties sets the NumEdgeProperties field's value. -func (s *PropertygraphSummary) SetNumEdgeProperties(v int64) *PropertygraphSummary { - s.NumEdgeProperties = &v - return s -} - -// SetNumEdges sets the NumEdges field's value. -func (s *PropertygraphSummary) SetNumEdges(v int64) *PropertygraphSummary { - s.NumEdges = &v - return s -} - -// SetNumNodeLabels sets the NumNodeLabels field's value. -func (s *PropertygraphSummary) SetNumNodeLabels(v int64) *PropertygraphSummary { - s.NumNodeLabels = &v - return s -} - -// SetNumNodeProperties sets the NumNodeProperties field's value. -func (s *PropertygraphSummary) SetNumNodeProperties(v int64) *PropertygraphSummary { - s.NumNodeProperties = &v - return s -} - -// SetNumNodes sets the NumNodes field's value. -func (s *PropertygraphSummary) SetNumNodes(v int64) *PropertygraphSummary { - s.NumNodes = &v - return s -} - -// SetTotalEdgePropertyValues sets the TotalEdgePropertyValues field's value. -func (s *PropertygraphSummary) SetTotalEdgePropertyValues(v int64) *PropertygraphSummary { - s.TotalEdgePropertyValues = &v - return s -} - -// SetTotalNodePropertyValues sets the TotalNodePropertyValues field's value. -func (s *PropertygraphSummary) SetTotalNodePropertyValues(v int64) *PropertygraphSummary { - s.TotalNodePropertyValues = &v - return s -} - -// Payload for the property graph summary response. -type PropertygraphSummaryValueMap struct { - _ struct{} `type:"structure"` - - // The graph summary. - GraphSummary *PropertygraphSummary `locationName:"graphSummary" type:"structure"` - - // The timestamp, in ISO 8601 format, of the time at which Neptune last computed - // statistics. - LastStatisticsComputationTime *time.Time `locationName:"lastStatisticsComputationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The version of this graph summary response. - Version *string `locationName:"version" 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 PropertygraphSummaryValueMap) 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 PropertygraphSummaryValueMap) GoString() string { - return s.String() -} - -// SetGraphSummary sets the GraphSummary field's value. -func (s *PropertygraphSummaryValueMap) SetGraphSummary(v *PropertygraphSummary) *PropertygraphSummaryValueMap { - s.GraphSummary = v - return s -} - -// SetLastStatisticsComputationTime sets the LastStatisticsComputationTime field's value. -func (s *PropertygraphSummaryValueMap) SetLastStatisticsComputationTime(v time.Time) *PropertygraphSummaryValueMap { - s.LastStatisticsComputationTime = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *PropertygraphSummaryValueMap) SetVersion(v string) *PropertygraphSummaryValueMap { - s.Version = &v - return s -} - -// Structure to capture query statistics such as how many queries are running, -// accepted or waiting and their details. -type QueryEvalStats struct { - _ struct{} `type:"structure"` - - // Set to TRUE if the query was cancelled, or FALSE otherwise. - Cancelled *bool `locationName:"cancelled" type:"boolean"` - - // The number of milliseconds the query has been running so far. - Elapsed *int64 `locationName:"elapsed" type:"integer"` - - // Indicates how long the query waited, in milliseconds. - Waited *int64 `locationName:"waited" 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 QueryEvalStats) 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 QueryEvalStats) GoString() string { - return s.String() -} - -// SetCancelled sets the Cancelled field's value. -func (s *QueryEvalStats) SetCancelled(v bool) *QueryEvalStats { - s.Cancelled = &v - return s -} - -// SetElapsed sets the Elapsed field's value. -func (s *QueryEvalStats) SetElapsed(v int64) *QueryEvalStats { - s.Elapsed = &v - return s -} - -// SetWaited sets the Waited field's value. -func (s *QueryEvalStats) SetWaited(v int64) *QueryEvalStats { - s.Waited = &v - return s -} - -// Structure for expressing the query language version. -type QueryLanguageVersion struct { - _ struct{} `type:"structure"` - - // The version of the query language. - // - // Version is a required field - Version *string `locationName:"version" 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 QueryLanguageVersion) 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 QueryLanguageVersion) GoString() string { - return s.String() -} - -// SetVersion sets the Version field's value. -func (s *QueryLanguageVersion) SetVersion(v string) *QueryLanguageVersion { - s.Version = &v - return s -} - -// Raised when the number of active queries exceeds what the server can process. -// The query in question can be retried when the system is less busy. -type QueryLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request which exceeded the limit. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 QueryLimitExceededException) 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 QueryLimitExceededException) GoString() string { - return s.String() -} - -func newErrorQueryLimitExceededException(v protocol.ResponseMetadata) error { - return &QueryLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *QueryLimitExceededException) Code() string { - return "QueryLimitExceededException" -} - -// Message returns the exception's message. -func (s *QueryLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *QueryLimitExceededException) OrigErr() error { - return nil -} - -func (s *QueryLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *QueryLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *QueryLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when the size of a query exceeds the system limit. -type QueryLimitException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request that exceeded the limit. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 QueryLimitException) 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 QueryLimitException) GoString() string { - return s.String() -} - -func newErrorQueryLimitException(v protocol.ResponseMetadata) error { - return &QueryLimitException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *QueryLimitException) Code() string { - return "QueryLimitException" -} - -// Message returns the exception's message. -func (s *QueryLimitException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *QueryLimitException) OrigErr() error { - return nil -} - -func (s *QueryLimitException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *QueryLimitException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *QueryLimitException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when the body of a query is too large. -type QueryTooLargeException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request that is too large. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 QueryTooLargeException) 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 QueryTooLargeException) GoString() string { - return s.String() -} - -func newErrorQueryTooLargeException(v protocol.ResponseMetadata) error { - return &QueryTooLargeException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *QueryTooLargeException) Code() string { - return "QueryTooLargeException" -} - -// Message returns the exception's message. -func (s *QueryTooLargeException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *QueryTooLargeException) OrigErr() error { - return nil -} - -func (s *QueryTooLargeException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *QueryTooLargeException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *QueryTooLargeException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The RDF graph summary API returns a read-only list of classes and predicate -// keys, along with counts of quads, subjects, and predicates. -type RDFGraphSummary struct { - _ struct{} `type:"structure"` - - // A list of the classes in the graph. - Classes []*string `locationName:"classes" type:"list"` - - // The number of classes in the graph. - NumClasses *int64 `locationName:"numClasses" type:"long"` - - // The number of distinct predicates in the graph. - NumDistinctPredicates *int64 `locationName:"numDistinctPredicates" type:"long"` - - // The number of distinct subjects in the graph. - NumDistinctSubjects *int64 `locationName:"numDistinctSubjects" type:"long"` - - // The number of quads in the graph. - NumQuads *int64 `locationName:"numQuads" type:"long"` - - // "A list of predicates in the graph, along with the predicate counts. - Predicates []map[string]*int64 `locationName:"predicates" type:"list"` - - // This field is only present when the request mode is DETAILED. It contains - // a list of subject structures. - SubjectStructures []*SubjectStructure `locationName:"subjectStructures" type:"list"` -} - -// 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 RDFGraphSummary) 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 RDFGraphSummary) GoString() string { - return s.String() -} - -// SetClasses sets the Classes field's value. -func (s *RDFGraphSummary) SetClasses(v []*string) *RDFGraphSummary { - s.Classes = v - return s -} - -// SetNumClasses sets the NumClasses field's value. -func (s *RDFGraphSummary) SetNumClasses(v int64) *RDFGraphSummary { - s.NumClasses = &v - return s -} - -// SetNumDistinctPredicates sets the NumDistinctPredicates field's value. -func (s *RDFGraphSummary) SetNumDistinctPredicates(v int64) *RDFGraphSummary { - s.NumDistinctPredicates = &v - return s -} - -// SetNumDistinctSubjects sets the NumDistinctSubjects field's value. -func (s *RDFGraphSummary) SetNumDistinctSubjects(v int64) *RDFGraphSummary { - s.NumDistinctSubjects = &v - return s -} - -// SetNumQuads sets the NumQuads field's value. -func (s *RDFGraphSummary) SetNumQuads(v int64) *RDFGraphSummary { - s.NumQuads = &v - return s -} - -// SetPredicates sets the Predicates field's value. -func (s *RDFGraphSummary) SetPredicates(v []map[string]*int64) *RDFGraphSummary { - s.Predicates = v - return s -} - -// SetSubjectStructures sets the SubjectStructures field's value. -func (s *RDFGraphSummary) SetSubjectStructures(v []*SubjectStructure) *RDFGraphSummary { - s.SubjectStructures = v - return s -} - -// Payload for an RDF graph summary response. -type RDFGraphSummaryValueMap struct { - _ struct{} `type:"structure"` - - // The graph summary of an RDF graph. See Graph summary response for an RDF - // graph (https://docs.aws.amazon.com/neptune/latest/userguide/neptune-graph-summary.html#neptune-graph-summary-rdf-response). - GraphSummary *RDFGraphSummary `locationName:"graphSummary" type:"structure"` - - // The timestamp, in ISO 8601 format, of the time at which Neptune last computed - // statistics. - LastStatisticsComputationTime *time.Time `locationName:"lastStatisticsComputationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The version of this graph summary response. - Version *string `locationName:"version" 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 RDFGraphSummaryValueMap) 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 RDFGraphSummaryValueMap) GoString() string { - return s.String() -} - -// SetGraphSummary sets the GraphSummary field's value. -func (s *RDFGraphSummaryValueMap) SetGraphSummary(v *RDFGraphSummary) *RDFGraphSummaryValueMap { - s.GraphSummary = v - return s -} - -// SetLastStatisticsComputationTime sets the LastStatisticsComputationTime field's value. -func (s *RDFGraphSummaryValueMap) SetLastStatisticsComputationTime(v time.Time) *RDFGraphSummaryValueMap { - s.LastStatisticsComputationTime = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *RDFGraphSummaryValueMap) SetVersion(v string) *RDFGraphSummaryValueMap { - s.Version = &v - return s -} - -// Raised when a request attempts to write to a read-only resource. -type ReadOnlyViolationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in which the parameter is missing. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 ReadOnlyViolationException) 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 ReadOnlyViolationException) GoString() string { - return s.String() -} - -func newErrorReadOnlyViolationException(v protocol.ResponseMetadata) error { - return &ReadOnlyViolationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ReadOnlyViolationException) Code() string { - return "ReadOnlyViolationException" -} - -// Message returns the exception's message. -func (s *ReadOnlyViolationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ReadOnlyViolationException) OrigErr() error { - return nil -} - -func (s *ReadOnlyViolationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ReadOnlyViolationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ReadOnlyViolationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Statistics for REFRESH mode. -type RefreshStatisticsIdMap struct { - _ struct{} `type:"structure"` - - // The ID of the statistics generation run that is currently occurring. - StatisticsId *string `locationName:"statisticsId" 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 RefreshStatisticsIdMap) 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 RefreshStatisticsIdMap) GoString() string { - return s.String() -} - -// SetStatisticsId sets the StatisticsId field's value. -func (s *RefreshStatisticsIdMap) SetStatisticsId(v string) *RefreshStatisticsIdMap { - s.StatisticsId = &v - return s -} - -// Raised when there is a problem accessing Amazon S3. -type S3Exception struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 S3Exception) 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 S3Exception) GoString() string { - return s.String() -} - -func newErrorS3Exception(v protocol.ResponseMetadata) error { - return &S3Exception{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *S3Exception) Code() string { - return "S3Exception" -} - -// Message returns the exception's message. -func (s *S3Exception) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *S3Exception) OrigErr() error { - return nil -} - -func (s *S3Exception) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *S3Exception) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *S3Exception) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when the server shuts down while processing a request. -type ServerShutdownException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 ServerShutdownException) 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 ServerShutdownException) GoString() string { - return s.String() -} - -func newErrorServerShutdownException(v protocol.ResponseMetadata) error { - return &ServerShutdownException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServerShutdownException) Code() string { - return "ServerShutdownException" -} - -// Message returns the exception's message. -func (s *ServerShutdownException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServerShutdownException) OrigErr() error { - return nil -} - -func (s *ServerShutdownException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServerShutdownException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServerShutdownException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Neptune logs are converted to SPARQL quads in the graph using the Resource -// Description Framework (RDF) N-QUADS (https://www.w3.org/TR/n-quads/) language -// defined in the W3C RDF 1.1 N-Quads specification -type SparqlData struct { - _ struct{} `type:"structure"` - - // Holds an N-QUADS (https://www.w3.org/TR/n-quads/) statement expressing the - // changed quad. - // - // Stmt is a required field - Stmt *string `locationName:"stmt" 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 SparqlData) 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 SparqlData) GoString() string { - return s.String() -} - -// SetStmt sets the Stmt field's value. -func (s *SparqlData) SetStmt(v string) *SparqlData { - s.Stmt = &v - return s -} - -// A serialized SPARQL stream record capturing a change-log entry for the RDF -// graph. -type SparqlRecord struct { - _ struct{} `type:"structure"` - - // The time at which the commit for the transaction was requested, in milliseconds - // from the Unix epoch. - // - // CommitTimestampInMillis is a required field - CommitTimestampInMillis *int64 `locationName:"commitTimestamp" type:"long" required:"true"` - - // The serialized SPARQL change record. The serialization formats of each record - // are described in more detail in Serialization Formats in Neptune Streams - // (https://docs.aws.amazon.com/neptune/latest/userguide/streams-change-formats.html). - // - // Data is a required field - Data *SparqlData `locationName:"data" type:"structure" required:"true"` - - // The sequence identifier of the stream change record. - // - // EventId is a required field - EventId map[string]*string `locationName:"eventId" type:"map" required:"true"` - - // Only present if this operation is the last one in its transaction. If present, - // it is set to true. It is useful for ensuring that an entire transaction is - // consumed. - IsLastOp *bool `locationName:"isLastOp" type:"boolean"` - - // The operation that created the change. - // - // Op is a required field - Op *string `locationName:"op" 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 SparqlRecord) 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 SparqlRecord) GoString() string { - return s.String() -} - -// SetCommitTimestampInMillis sets the CommitTimestampInMillis field's value. -func (s *SparqlRecord) SetCommitTimestampInMillis(v int64) *SparqlRecord { - s.CommitTimestampInMillis = &v - return s -} - -// SetData sets the Data field's value. -func (s *SparqlRecord) SetData(v *SparqlData) *SparqlRecord { - s.Data = v - return s -} - -// SetEventId sets the EventId field's value. -func (s *SparqlRecord) SetEventId(v map[string]*string) *SparqlRecord { - s.EventId = v - return s -} - -// SetIsLastOp sets the IsLastOp field's value. -func (s *SparqlRecord) SetIsLastOp(v bool) *SparqlRecord { - s.IsLastOp = &v - return s -} - -// SetOp sets the Op field's value. -func (s *SparqlRecord) SetOp(v string) *SparqlRecord { - s.Op = &v - return s -} - -type StartLoaderJobInput struct { - _ struct{} `type:"structure"` - - // This is an optional parameter that can make a queued load request contingent - // on the successful completion of one or more previous jobs in the queue. - // - // Neptune can queue up as many as 64 load requests at a time, if their queueRequest - // parameters are set to "TRUE". The dependencies parameter lets you make execution - // of such a queued request dependent on the successful completion of one or - // more specified previous requests in the queue. - // - // For example, if load Job-A and Job-B are independent of each other, but load - // Job-C needs Job-A and Job-B to be finished before it begins, proceed as follows: - // - // Submit load-job-A and load-job-B one after another in any order, and save - // their load-ids. - // - // Submit load-job-C with the load-ids of the two jobs in its dependencies field: - // - // Because of the dependencies parameter, the bulk loader will not start Job-C - // until Job-A and Job-B have completed successfully. If either one of them - // fails, Job-C will not be executed, and its status will be set to LOAD_FAILED_BECAUSE_DEPENDENCY_NOT_SATISFIED. - // - // You can set up multiple levels of dependency in this way, so that the failure - // of one job will cause all requests that are directly or indirectly dependent - // on it to be cancelled. - Dependencies []*string `locationName:"dependencies" type:"list"` - - // failOnError – A flag to toggle a complete stop on an error. - // - // Allowed values: "TRUE", "FALSE". - // - // Default value: "TRUE". - // - // When this parameter is set to "FALSE", the loader tries to load all the data - // in the location specified, skipping any entries with errors. - // - // When this parameter is set to "TRUE", the loader stops as soon as it encounters - // an error. Data loaded up to that point persists. - FailOnError *bool `locationName:"failOnError" type:"boolean"` - - // The format of the data. For more information about data formats for the Neptune - // Loader command, see Load Data Formats (https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-format.html). - // - // Allowed values - // - // * csv for the Gremlin CSV data format (https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-format-gremlin.html). - // - // * opencypher for the openCypher CSV data format (https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-format-opencypher.html). - // - // * ntriples for the N-Triples RDF data format (https://www.w3.org/TR/n-triples/). - // - // * nquads for the N-Quads RDF data format (https://www.w3.org/TR/n-quads/). - // - // * rdfxml for the RDF\XML RDF data format (https://www.w3.org/TR/rdf-syntax-grammar/). - // - // * turtle for the Turtle RDF data format (https://www.w3.org/TR/turtle/). - // - // Format is a required field - Format *string `locationName:"format" type:"string" required:"true" enum:"Format"` - - // The Amazon Resource Name (ARN) for an IAM role to be assumed by the Neptune - // DB instance for access to the S3 bucket. The IAM role ARN provided here should - // be attached to the DB cluster (see Adding the IAM Role to an Amazon Neptune - // Cluster (https://docs.aws.amazon.com/neptune/latest/userguide/bulk-load-tutorial-IAM-add-role-cluster.html). - // - // IamRoleArn is a required field - IamRoleArn *string `locationName:"iamRoleArn" type:"string" required:"true"` - - // The load job mode. - // - // Allowed values: RESUME, NEW, AUTO. - // - // Default value: AUTO. - // - // * RESUME – In RESUME mode, the loader looks for a previous load from - // this source, and if it finds one, resumes that load job. If no previous - // load job is found, the loader stops. The loader avoids reloading files - // that were successfully loaded in a previous job. It only tries to process - // failed files. If you dropped previously loaded data from your Neptune - // cluster, that data is not reloaded in this mode. If a previous load job - // loaded all files from the same source successfully, nothing is reloaded, - // and the loader returns success. - // - // * NEW – In NEW mode, the creates a new load request regardless of any - // previous loads. You can use this mode to reload all the data from a source - // after dropping previously loaded data from your Neptune cluster, or to - // load new data available at the same source. - // - // * AUTO – In AUTO mode, the loader looks for a previous load job from - // the same source, and if it finds one, resumes that job, just as in RESUME - // mode. If the loader doesn't find a previous load job from the same source, - // it loads all data from the source, just as in NEW mode. - Mode *string `locationName:"mode" type:"string" enum:"Mode"` - - // The optional parallelism parameter can be set to reduce the number of threads - // used by the bulk load process. - // - // Allowed values: - // - // * LOW – The number of threads used is the number of available vCPUs - // divided by 8. - // - // * MEDIUM – The number of threads used is the number of available vCPUs - // divided by 2. - // - // * HIGH – The number of threads used is the same as the number of available - // vCPUs. - // - // * OVERSUBSCRIBE – The number of threads used is the number of available - // vCPUs multiplied by 2. If this value is used, the bulk loader takes up - // all available resources. This does not mean, however, that the OVERSUBSCRIBE - // setting results in 100% CPU utilization. Because the load operation is - // I/O bound, the highest CPU utilization to expect is in the 60% to 70% - // range. - // - // Default value: HIGH - // - // The parallelism setting can sometimes result in a deadlock between threads - // when loading openCypher data. When this happens, Neptune returns the LOAD_DATA_DEADLOCK - // error. You can generally fix the issue by setting parallelism to a lower - // setting and retrying the load command. - Parallelism *string `locationName:"parallelism" type:"string" enum:"Parallelism"` - - // parserConfiguration – An optional object with additional parser configuration - // values. Each of the child parameters is also optional: - // - // * namedGraphUri – The default graph for all RDF formats when no graph - // is specified (for non-quads formats and NQUAD entries with no graph). - // The default is https://aws.amazon.com/neptune/vocab/v01/DefaultNamedGraph. - // - // * baseUri – The base URI for RDF/XML and Turtle formats. The default - // is https://aws.amazon.com/neptune/default. - // - // * allowEmptyStrings – Gremlin users need to be able to pass empty string - // values("") as node and edge properties when loading CSV data. If allowEmptyStrings - // is set to false (the default), such empty strings are treated as nulls - // and are not loaded. If allowEmptyStrings is set to true, the loader treats - // empty strings as valid property values and loads them accordingly. - ParserConfiguration map[string]*string `locationName:"parserConfiguration" type:"map"` - - // This is an optional flag parameter that indicates whether the load request - // can be queued up or not. - // - // You don't have to wait for one load job to complete before issuing the next - // one, because Neptune can queue up as many as 64 jobs at a time, provided - // that their queueRequest parameters are all set to "TRUE". The queue order - // of the jobs will be first-in-first-out (FIFO). - // - // If the queueRequest parameter is omitted or set to "FALSE", the load request - // will fail if another load job is already running. - // - // Allowed values: "TRUE", "FALSE". - // - // Default value: "FALSE". - QueueRequest *bool `locationName:"queueRequest" type:"boolean"` - - // The Amazon region of the S3 bucket. This must match the Amazon Region of - // the DB cluster. - // - // S3BucketRegion is a required field - S3BucketRegion *string `locationName:"region" type:"string" required:"true" enum:"S3BucketRegion"` - - // The source parameter accepts an S3 URI that identifies a single file, multiple - // files, a folder, or multiple folders. Neptune loads every data file in any - // folder that is specified. - // - // The URI can be in any of the following formats. - // - // * s3://(bucket_name)/(object-key-name) - // - // * https://s3.amazonaws.com/(bucket_name)/(object-key-name) - // - // * https://s3.us-east-1.amazonaws.com/(bucket_name)/(object-key-name) - // - // The object-key-name element of the URI is equivalent to the prefix (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html#API_ListObjects_RequestParameters) - // parameter in an S3 ListObjects (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) - // API call. It identifies all the objects in the specified S3 bucket whose - // names begin with that prefix. That can be a single file or folder, or multiple - // files and/or folders. - // - // The specified folder or folders can contain multiple vertex files and multiple - // edge files. - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true"` - - // updateSingleCardinalityProperties is an optional parameter that controls - // how the bulk loader treats a new value for single-cardinality vertex or edge - // properties. This is not supported for loading openCypher data. - // - // Allowed values: "TRUE", "FALSE". - // - // Default value: "FALSE". - // - // By default, or when updateSingleCardinalityProperties is explicitly set to - // "FALSE", the loader treats a new value as an error, because it violates single - // cardinality. - // - // When updateSingleCardinalityProperties is set to "TRUE", on the other hand, - // the bulk loader replaces the existing value with the new one. If multiple - // edge or single-cardinality vertex property values are provided in the source - // file(s) being loaded, the final value at the end of the bulk load could be - // any one of those new values. The loader only guarantees that the existing - // value has been replaced by one of the new ones. - UpdateSingleCardinalityProperties *bool `locationName:"updateSingleCardinalityProperties" type:"boolean"` - - // This parameter is required only when loading openCypher data that contains - // relationship IDs. It must be included and set to True when openCypher relationship - // IDs are explicitly provided in the load data (recommended). - // - // When userProvidedEdgeIds is absent or set to True, an :ID column must be - // present in every relationship file in the load. - // - // When userProvidedEdgeIds is present and set to False, relationship files - // in the load must not contain an :ID column. Instead, the Neptune loader automatically - // generates an ID for each relationship. - // - // It's useful to provide relationship IDs explicitly so that the loader can - // resume loading after error in the CSV data have been fixed, without having - // to reload any relationships that have already been loaded. If relationship - // IDs have not been explicitly assigned, the loader cannot resume a failed - // load if any relationship file has had to be corrected, and must instead reload - // all the relationships. - UserProvidedEdgeIds *bool `locationName:"userProvidedEdgeIds" type:"boolean"` -} - -// 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 StartLoaderJobInput) 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 StartLoaderJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartLoaderJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartLoaderJobInput"} - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.IamRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("IamRoleArn")) - } - if s.S3BucketRegion == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketRegion")) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDependencies sets the Dependencies field's value. -func (s *StartLoaderJobInput) SetDependencies(v []*string) *StartLoaderJobInput { - s.Dependencies = v - return s -} - -// SetFailOnError sets the FailOnError field's value. -func (s *StartLoaderJobInput) SetFailOnError(v bool) *StartLoaderJobInput { - s.FailOnError = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *StartLoaderJobInput) SetFormat(v string) *StartLoaderJobInput { - s.Format = &v - return s -} - -// SetIamRoleArn sets the IamRoleArn field's value. -func (s *StartLoaderJobInput) SetIamRoleArn(v string) *StartLoaderJobInput { - s.IamRoleArn = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *StartLoaderJobInput) SetMode(v string) *StartLoaderJobInput { - s.Mode = &v - return s -} - -// SetParallelism sets the Parallelism field's value. -func (s *StartLoaderJobInput) SetParallelism(v string) *StartLoaderJobInput { - s.Parallelism = &v - return s -} - -// SetParserConfiguration sets the ParserConfiguration field's value. -func (s *StartLoaderJobInput) SetParserConfiguration(v map[string]*string) *StartLoaderJobInput { - s.ParserConfiguration = v - return s -} - -// SetQueueRequest sets the QueueRequest field's value. -func (s *StartLoaderJobInput) SetQueueRequest(v bool) *StartLoaderJobInput { - s.QueueRequest = &v - return s -} - -// SetS3BucketRegion sets the S3BucketRegion field's value. -func (s *StartLoaderJobInput) SetS3BucketRegion(v string) *StartLoaderJobInput { - s.S3BucketRegion = &v - return s -} - -// SetSource sets the Source field's value. -func (s *StartLoaderJobInput) SetSource(v string) *StartLoaderJobInput { - s.Source = &v - return s -} - -// SetUpdateSingleCardinalityProperties sets the UpdateSingleCardinalityProperties field's value. -func (s *StartLoaderJobInput) SetUpdateSingleCardinalityProperties(v bool) *StartLoaderJobInput { - s.UpdateSingleCardinalityProperties = &v - return s -} - -// SetUserProvidedEdgeIds sets the UserProvidedEdgeIds field's value. -func (s *StartLoaderJobInput) SetUserProvidedEdgeIds(v bool) *StartLoaderJobInput { - s.UserProvidedEdgeIds = &v - return s -} - -type StartLoaderJobOutput struct { - _ struct{} `type:"structure"` - - // Contains a loadId name-value pair that provides an identifier for the load - // operation. - // - // Payload is a required field - Payload map[string]*string `locationName:"payload" type:"map" required:"true"` - - // The HTTP return code indicating the status of the load job. - // - // Status is a required field - Status *string `locationName:"status" 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 StartLoaderJobOutput) 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 StartLoaderJobOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *StartLoaderJobOutput) SetPayload(v map[string]*string) *StartLoaderJobOutput { - s.Payload = v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartLoaderJobOutput) SetStatus(v string) *StartLoaderJobOutput { - s.Status = &v - return s -} - -type StartMLDataProcessingJobInput struct { - _ struct{} `type:"structure"` - - // A data specification file that describes how to load the exported graph data - // for training. The file is automatically generated by the Neptune export toolkit. - // The default is training-data-configuration.json. - ConfigFileName *string `locationName:"configFileName" type:"string"` - - // A unique identifier for the new job. The default is an autogenerated UUID. - Id *string `locationName:"id" type:"string"` - - // The URI of the Amazon S3 location where you want SageMaker to download the - // data needed to run the data processing job. - // - // InputDataS3Location is a required field - InputDataS3Location *string `locationName:"inputDataS3Location" type:"string" required:"true"` - - // One of the two model types that Neptune ML currently supports: heterogeneous - // graph models (heterogeneous), and knowledge graph (kge). The default is none. - // If not specified, Neptune ML chooses the model type automatically based on - // the data. - ModelType *string `locationName:"modelType" type:"string"` - - // The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to - // perform tasks on your behalf. This must be listed in your DB cluster parameter - // group or an error will occur. - NeptuneIamRoleArn *string `locationName:"neptuneIamRoleArn" type:"string"` - - // The job ID of a completed data processing job run on an earlier version of - // the data. - PreviousDataProcessingJobId *string `locationName:"previousDataProcessingJobId" type:"string"` - - // The URI of the Amazon S3 location where you want SageMaker to save the results - // of a data processing job. - // - // ProcessedDataS3Location is a required field - ProcessedDataS3Location *string `locationName:"processedDataS3Location" type:"string" required:"true"` - - // The type of ML instance used during data processing. Its memory should be - // large enough to hold the processed dataset. The default is the smallest ml.r5 - // type whose memory is ten times larger than the size of the exported graph - // data on disk. - ProcessingInstanceType *string `locationName:"processingInstanceType" type:"string"` - - // The disk volume size of the processing instance. Both input data and processed - // data are stored on disk, so the volume size must be large enough to hold - // both data sets. The default is 0. If not specified or 0, Neptune ML chooses - // the volume size automatically based on the data size. - ProcessingInstanceVolumeSizeInGB *int64 `locationName:"processingInstanceVolumeSizeInGB" type:"integer"` - - // Timeout in seconds for the data processing job. The default is 86,400 (1 - // day). - ProcessingTimeOutInSeconds *int64 `locationName:"processingTimeOutInSeconds" type:"integer"` - - // The Amazon Key Management Service (Amazon KMS) key that SageMaker uses to - // encrypt the output of the processing job. The default is none. - S3OutputEncryptionKMSKey *string `locationName:"s3OutputEncryptionKMSKey" type:"string"` - - // The ARN of an IAM role for SageMaker execution. This must be listed in your - // DB cluster parameter group or an error will occur. - SagemakerIamRoleArn *string `locationName:"sagemakerIamRoleArn" type:"string"` - - // The VPC security group IDs. The default is None. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // The IDs of the subnets in the Neptune VPC. The default is None. - Subnets []*string `locationName:"subnets" type:"list"` - - // The Amazon Key Management Service (Amazon KMS) key that SageMaker uses to - // encrypt data on the storage volume attached to the ML compute instances that - // run the training job. The default is None. - VolumeEncryptionKMSKey *string `locationName:"volumeEncryptionKMSKey" 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 StartMLDataProcessingJobInput) 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 StartMLDataProcessingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartMLDataProcessingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartMLDataProcessingJobInput"} - if s.InputDataS3Location == nil { - invalidParams.Add(request.NewErrParamRequired("InputDataS3Location")) - } - if s.ProcessedDataS3Location == nil { - invalidParams.Add(request.NewErrParamRequired("ProcessedDataS3Location")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigFileName sets the ConfigFileName field's value. -func (s *StartMLDataProcessingJobInput) SetConfigFileName(v string) *StartMLDataProcessingJobInput { - s.ConfigFileName = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartMLDataProcessingJobInput) SetId(v string) *StartMLDataProcessingJobInput { - s.Id = &v - return s -} - -// SetInputDataS3Location sets the InputDataS3Location field's value. -func (s *StartMLDataProcessingJobInput) SetInputDataS3Location(v string) *StartMLDataProcessingJobInput { - s.InputDataS3Location = &v - return s -} - -// SetModelType sets the ModelType field's value. -func (s *StartMLDataProcessingJobInput) SetModelType(v string) *StartMLDataProcessingJobInput { - s.ModelType = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *StartMLDataProcessingJobInput) SetNeptuneIamRoleArn(v string) *StartMLDataProcessingJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -// SetPreviousDataProcessingJobId sets the PreviousDataProcessingJobId field's value. -func (s *StartMLDataProcessingJobInput) SetPreviousDataProcessingJobId(v string) *StartMLDataProcessingJobInput { - s.PreviousDataProcessingJobId = &v - return s -} - -// SetProcessedDataS3Location sets the ProcessedDataS3Location field's value. -func (s *StartMLDataProcessingJobInput) SetProcessedDataS3Location(v string) *StartMLDataProcessingJobInput { - s.ProcessedDataS3Location = &v - return s -} - -// SetProcessingInstanceType sets the ProcessingInstanceType field's value. -func (s *StartMLDataProcessingJobInput) SetProcessingInstanceType(v string) *StartMLDataProcessingJobInput { - s.ProcessingInstanceType = &v - return s -} - -// SetProcessingInstanceVolumeSizeInGB sets the ProcessingInstanceVolumeSizeInGB field's value. -func (s *StartMLDataProcessingJobInput) SetProcessingInstanceVolumeSizeInGB(v int64) *StartMLDataProcessingJobInput { - s.ProcessingInstanceVolumeSizeInGB = &v - return s -} - -// SetProcessingTimeOutInSeconds sets the ProcessingTimeOutInSeconds field's value. -func (s *StartMLDataProcessingJobInput) SetProcessingTimeOutInSeconds(v int64) *StartMLDataProcessingJobInput { - s.ProcessingTimeOutInSeconds = &v - return s -} - -// SetS3OutputEncryptionKMSKey sets the S3OutputEncryptionKMSKey field's value. -func (s *StartMLDataProcessingJobInput) SetS3OutputEncryptionKMSKey(v string) *StartMLDataProcessingJobInput { - s.S3OutputEncryptionKMSKey = &v - return s -} - -// SetSagemakerIamRoleArn sets the SagemakerIamRoleArn field's value. -func (s *StartMLDataProcessingJobInput) SetSagemakerIamRoleArn(v string) *StartMLDataProcessingJobInput { - s.SagemakerIamRoleArn = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *StartMLDataProcessingJobInput) SetSecurityGroupIds(v []*string) *StartMLDataProcessingJobInput { - s.SecurityGroupIds = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *StartMLDataProcessingJobInput) SetSubnets(v []*string) *StartMLDataProcessingJobInput { - s.Subnets = v - return s -} - -// SetVolumeEncryptionKMSKey sets the VolumeEncryptionKMSKey field's value. -func (s *StartMLDataProcessingJobInput) SetVolumeEncryptionKMSKey(v string) *StartMLDataProcessingJobInput { - s.VolumeEncryptionKMSKey = &v - return s -} - -type StartMLDataProcessingJobOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the data processing job. - Arn *string `locationName:"arn" type:"string"` - - // The time it took to create the new processing job, in milliseconds. - CreationTimeInMillis *int64 `locationName:"creationTimeInMillis" type:"long"` - - // The unique ID of the new data processing job. - Id *string `locationName:"id" 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 StartMLDataProcessingJobOutput) 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 StartMLDataProcessingJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartMLDataProcessingJobOutput) SetArn(v string) *StartMLDataProcessingJobOutput { - s.Arn = &v - return s -} - -// SetCreationTimeInMillis sets the CreationTimeInMillis field's value. -func (s *StartMLDataProcessingJobOutput) SetCreationTimeInMillis(v int64) *StartMLDataProcessingJobOutput { - s.CreationTimeInMillis = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartMLDataProcessingJobOutput) SetId(v string) *StartMLDataProcessingJobOutput { - s.Id = &v - return s -} - -type StartMLModelTrainingJobInput struct { - _ struct{} `type:"structure"` - - // The type of ML instance used in preparing and managing training of ML models. - // This is a CPU instance chosen based on memory requirements for processing - // the training data and model. - BaseProcessingInstanceType *string `locationName:"baseProcessingInstanceType" type:"string"` - - // The configuration for custom model training. This is a JSON object. - CustomModelTrainingParameters *CustomModelTrainingParameters `locationName:"customModelTrainingParameters" type:"structure"` - - // The job ID of the completed data-processing job that has created the data - // that the training will work with. - // - // DataProcessingJobId is a required field - DataProcessingJobId *string `locationName:"dataProcessingJobId" type:"string" required:"true"` - - // Optimizes the cost of training machine-learning models by using Amazon Elastic - // Compute Cloud spot instances. The default is False. - EnableManagedSpotTraining *bool `locationName:"enableManagedSpotTraining" type:"boolean"` - - // A unique identifier for the new job. The default is An autogenerated UUID. - Id *string `locationName:"id" type:"string"` - - // Maximum total number of training jobs to start for the hyperparameter tuning - // job. The default is 2. Neptune ML automatically tunes the hyperparameters - // of the machine learning model. To obtain a model that performs well, use - // at least 10 jobs (in other words, set maxHPONumberOfTrainingJobs to 10). - // In general, the more tuning runs, the better the results. - MaxHPONumberOfTrainingJobs *int64 `locationName:"maxHPONumberOfTrainingJobs" type:"integer"` - - // Maximum number of parallel training jobs to start for the hyperparameter - // tuning job. The default is 2. The number of parallel jobs you can run is - // limited by the available resources on your training instance. - MaxHPOParallelTrainingJobs *int64 `locationName:"maxHPOParallelTrainingJobs" type:"integer"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `locationName:"neptuneIamRoleArn" type:"string"` - - // The job ID of a completed model-training job that you want to update incrementally - // based on updated data. - PreviousModelTrainingJobId *string `locationName:"previousModelTrainingJobId" type:"string"` - - // The Amazon Key Management Service (KMS) key that SageMaker uses to encrypt - // the output of the processing job. The default is none. - S3OutputEncryptionKMSKey *string `locationName:"s3OutputEncryptionKMSKey" type:"string"` - - // The ARN of an IAM role for SageMaker execution.This must be listed in your - // DB cluster parameter group or an error will occur. - SagemakerIamRoleArn *string `locationName:"sagemakerIamRoleArn" type:"string"` - - // The VPC security group IDs. The default is None. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // The IDs of the subnets in the Neptune VPC. The default is None. - Subnets []*string `locationName:"subnets" type:"list"` - - // The location in Amazon S3 where the model artifacts are to be stored. - // - // TrainModelS3Location is a required field - TrainModelS3Location *string `locationName:"trainModelS3Location" type:"string" required:"true"` - - // The type of ML instance used for model training. All Neptune ML models support - // CPU, GPU, and multiGPU training. The default is ml.p3.2xlarge. Choosing the - // right instance type for training depends on the task type, graph size, and - // your budget. - TrainingInstanceType *string `locationName:"trainingInstanceType" type:"string"` - - // The disk volume size of the training instance. Both input data and the output - // model are stored on disk, so the volume size must be large enough to hold - // both data sets. The default is 0. If not specified or 0, Neptune ML selects - // a disk volume size based on the recommendation generated in the data processing - // step. - TrainingInstanceVolumeSizeInGB *int64 `locationName:"trainingInstanceVolumeSizeInGB" type:"integer"` - - // Timeout in seconds for the training job. The default is 86,400 (1 day). - TrainingTimeOutInSeconds *int64 `locationName:"trainingTimeOutInSeconds" type:"integer"` - - // The Amazon Key Management Service (KMS) key that SageMaker uses to encrypt - // data on the storage volume attached to the ML compute instances that run - // the training job. The default is None. - VolumeEncryptionKMSKey *string `locationName:"volumeEncryptionKMSKey" 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 StartMLModelTrainingJobInput) 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 StartMLModelTrainingJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartMLModelTrainingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartMLModelTrainingJobInput"} - if s.DataProcessingJobId == nil { - invalidParams.Add(request.NewErrParamRequired("DataProcessingJobId")) - } - if s.TrainModelS3Location == nil { - invalidParams.Add(request.NewErrParamRequired("TrainModelS3Location")) - } - if s.CustomModelTrainingParameters != nil { - if err := s.CustomModelTrainingParameters.Validate(); err != nil { - invalidParams.AddNested("CustomModelTrainingParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaseProcessingInstanceType sets the BaseProcessingInstanceType field's value. -func (s *StartMLModelTrainingJobInput) SetBaseProcessingInstanceType(v string) *StartMLModelTrainingJobInput { - s.BaseProcessingInstanceType = &v - return s -} - -// SetCustomModelTrainingParameters sets the CustomModelTrainingParameters field's value. -func (s *StartMLModelTrainingJobInput) SetCustomModelTrainingParameters(v *CustomModelTrainingParameters) *StartMLModelTrainingJobInput { - s.CustomModelTrainingParameters = v - return s -} - -// SetDataProcessingJobId sets the DataProcessingJobId field's value. -func (s *StartMLModelTrainingJobInput) SetDataProcessingJobId(v string) *StartMLModelTrainingJobInput { - s.DataProcessingJobId = &v - return s -} - -// SetEnableManagedSpotTraining sets the EnableManagedSpotTraining field's value. -func (s *StartMLModelTrainingJobInput) SetEnableManagedSpotTraining(v bool) *StartMLModelTrainingJobInput { - s.EnableManagedSpotTraining = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartMLModelTrainingJobInput) SetId(v string) *StartMLModelTrainingJobInput { - s.Id = &v - return s -} - -// SetMaxHPONumberOfTrainingJobs sets the MaxHPONumberOfTrainingJobs field's value. -func (s *StartMLModelTrainingJobInput) SetMaxHPONumberOfTrainingJobs(v int64) *StartMLModelTrainingJobInput { - s.MaxHPONumberOfTrainingJobs = &v - return s -} - -// SetMaxHPOParallelTrainingJobs sets the MaxHPOParallelTrainingJobs field's value. -func (s *StartMLModelTrainingJobInput) SetMaxHPOParallelTrainingJobs(v int64) *StartMLModelTrainingJobInput { - s.MaxHPOParallelTrainingJobs = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *StartMLModelTrainingJobInput) SetNeptuneIamRoleArn(v string) *StartMLModelTrainingJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -// SetPreviousModelTrainingJobId sets the PreviousModelTrainingJobId field's value. -func (s *StartMLModelTrainingJobInput) SetPreviousModelTrainingJobId(v string) *StartMLModelTrainingJobInput { - s.PreviousModelTrainingJobId = &v - return s -} - -// SetS3OutputEncryptionKMSKey sets the S3OutputEncryptionKMSKey field's value. -func (s *StartMLModelTrainingJobInput) SetS3OutputEncryptionKMSKey(v string) *StartMLModelTrainingJobInput { - s.S3OutputEncryptionKMSKey = &v - return s -} - -// SetSagemakerIamRoleArn sets the SagemakerIamRoleArn field's value. -func (s *StartMLModelTrainingJobInput) SetSagemakerIamRoleArn(v string) *StartMLModelTrainingJobInput { - s.SagemakerIamRoleArn = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *StartMLModelTrainingJobInput) SetSecurityGroupIds(v []*string) *StartMLModelTrainingJobInput { - s.SecurityGroupIds = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *StartMLModelTrainingJobInput) SetSubnets(v []*string) *StartMLModelTrainingJobInput { - s.Subnets = v - return s -} - -// SetTrainModelS3Location sets the TrainModelS3Location field's value. -func (s *StartMLModelTrainingJobInput) SetTrainModelS3Location(v string) *StartMLModelTrainingJobInput { - s.TrainModelS3Location = &v - return s -} - -// SetTrainingInstanceType sets the TrainingInstanceType field's value. -func (s *StartMLModelTrainingJobInput) SetTrainingInstanceType(v string) *StartMLModelTrainingJobInput { - s.TrainingInstanceType = &v - return s -} - -// SetTrainingInstanceVolumeSizeInGB sets the TrainingInstanceVolumeSizeInGB field's value. -func (s *StartMLModelTrainingJobInput) SetTrainingInstanceVolumeSizeInGB(v int64) *StartMLModelTrainingJobInput { - s.TrainingInstanceVolumeSizeInGB = &v - return s -} - -// SetTrainingTimeOutInSeconds sets the TrainingTimeOutInSeconds field's value. -func (s *StartMLModelTrainingJobInput) SetTrainingTimeOutInSeconds(v int64) *StartMLModelTrainingJobInput { - s.TrainingTimeOutInSeconds = &v - return s -} - -// SetVolumeEncryptionKMSKey sets the VolumeEncryptionKMSKey field's value. -func (s *StartMLModelTrainingJobInput) SetVolumeEncryptionKMSKey(v string) *StartMLModelTrainingJobInput { - s.VolumeEncryptionKMSKey = &v - return s -} - -type StartMLModelTrainingJobOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the new model training job. - Arn *string `locationName:"arn" type:"string"` - - // The model training job creation time, in milliseconds. - CreationTimeInMillis *int64 `locationName:"creationTimeInMillis" type:"long"` - - // The unique ID of the new model training job. - Id *string `locationName:"id" 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 StartMLModelTrainingJobOutput) 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 StartMLModelTrainingJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartMLModelTrainingJobOutput) SetArn(v string) *StartMLModelTrainingJobOutput { - s.Arn = &v - return s -} - -// SetCreationTimeInMillis sets the CreationTimeInMillis field's value. -func (s *StartMLModelTrainingJobOutput) SetCreationTimeInMillis(v int64) *StartMLModelTrainingJobOutput { - s.CreationTimeInMillis = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartMLModelTrainingJobOutput) SetId(v string) *StartMLModelTrainingJobOutput { - s.Id = &v - return s -} - -type StartMLModelTransformJobInput struct { - _ struct{} `type:"structure"` - - // The type of ML instance used in preparing and managing training of ML models. - // This is an ML compute instance chosen based on memory requirements for processing - // the training data and model. - BaseProcessingInstanceType *string `locationName:"baseProcessingInstanceType" type:"string"` - - // The disk volume size of the training instance in gigabytes. The default is - // 0. Both input data and the output model are stored on disk, so the volume - // size must be large enough to hold both data sets. If not specified or 0, - // Neptune ML selects a disk volume size based on the recommendation generated - // in the data processing step. - BaseProcessingInstanceVolumeSizeInGB *int64 `locationName:"baseProcessingInstanceVolumeSizeInGB" type:"integer"` - - // Configuration information for a model transform using a custom model. The - // customModelTransformParameters object contains the following fields, which - // must have values compatible with the saved model parameters from the training - // job: - CustomModelTransformParameters *CustomModelTransformParameters `locationName:"customModelTransformParameters" type:"structure"` - - // The job ID of a completed data-processing job. You must include either dataProcessingJobId - // and a mlModelTrainingJobId, or a trainingJobName. - DataProcessingJobId *string `locationName:"dataProcessingJobId" type:"string"` - - // A unique identifier for the new job. The default is an autogenerated UUID. - Id *string `locationName:"id" type:"string"` - - // The job ID of a completed model-training job. You must include either dataProcessingJobId - // and a mlModelTrainingJobId, or a trainingJobName. - MlModelTrainingJobId *string `locationName:"mlModelTrainingJobId" type:"string"` - - // The location in Amazon S3 where the model artifacts are to be stored. - // - // ModelTransformOutputS3Location is a required field - ModelTransformOutputS3Location *string `locationName:"modelTransformOutputS3Location" type:"string" required:"true"` - - // The ARN of an IAM role that provides Neptune access to SageMaker and Amazon - // S3 resources. This must be listed in your DB cluster parameter group or an - // error will occur. - NeptuneIamRoleArn *string `locationName:"neptuneIamRoleArn" type:"string"` - - // The Amazon Key Management Service (KMS) key that SageMaker uses to encrypt - // the output of the processing job. The default is none. - S3OutputEncryptionKMSKey *string `locationName:"s3OutputEncryptionKMSKey" type:"string"` - - // The ARN of an IAM role for SageMaker execution. This must be listed in your - // DB cluster parameter group or an error will occur. - SagemakerIamRoleArn *string `locationName:"sagemakerIamRoleArn" type:"string"` - - // The VPC security group IDs. The default is None. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // The IDs of the subnets in the Neptune VPC. The default is None. - Subnets []*string `locationName:"subnets" type:"list"` - - // The name of a completed SageMaker training job. You must include either dataProcessingJobId - // and a mlModelTrainingJobId, or a trainingJobName. - TrainingJobName *string `locationName:"trainingJobName" type:"string"` - - // The Amazon Key Management Service (KMS) key that SageMaker uses to encrypt - // data on the storage volume attached to the ML compute instances that run - // the training job. The default is None. - VolumeEncryptionKMSKey *string `locationName:"volumeEncryptionKMSKey" 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 StartMLModelTransformJobInput) 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 StartMLModelTransformJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartMLModelTransformJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartMLModelTransformJobInput"} - if s.ModelTransformOutputS3Location == nil { - invalidParams.Add(request.NewErrParamRequired("ModelTransformOutputS3Location")) - } - if s.CustomModelTransformParameters != nil { - if err := s.CustomModelTransformParameters.Validate(); err != nil { - invalidParams.AddNested("CustomModelTransformParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaseProcessingInstanceType sets the BaseProcessingInstanceType field's value. -func (s *StartMLModelTransformJobInput) SetBaseProcessingInstanceType(v string) *StartMLModelTransformJobInput { - s.BaseProcessingInstanceType = &v - return s -} - -// SetBaseProcessingInstanceVolumeSizeInGB sets the BaseProcessingInstanceVolumeSizeInGB field's value. -func (s *StartMLModelTransformJobInput) SetBaseProcessingInstanceVolumeSizeInGB(v int64) *StartMLModelTransformJobInput { - s.BaseProcessingInstanceVolumeSizeInGB = &v - return s -} - -// SetCustomModelTransformParameters sets the CustomModelTransformParameters field's value. -func (s *StartMLModelTransformJobInput) SetCustomModelTransformParameters(v *CustomModelTransformParameters) *StartMLModelTransformJobInput { - s.CustomModelTransformParameters = v - return s -} - -// SetDataProcessingJobId sets the DataProcessingJobId field's value. -func (s *StartMLModelTransformJobInput) SetDataProcessingJobId(v string) *StartMLModelTransformJobInput { - s.DataProcessingJobId = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartMLModelTransformJobInput) SetId(v string) *StartMLModelTransformJobInput { - s.Id = &v - return s -} - -// SetMlModelTrainingJobId sets the MlModelTrainingJobId field's value. -func (s *StartMLModelTransformJobInput) SetMlModelTrainingJobId(v string) *StartMLModelTransformJobInput { - s.MlModelTrainingJobId = &v - return s -} - -// SetModelTransformOutputS3Location sets the ModelTransformOutputS3Location field's value. -func (s *StartMLModelTransformJobInput) SetModelTransformOutputS3Location(v string) *StartMLModelTransformJobInput { - s.ModelTransformOutputS3Location = &v - return s -} - -// SetNeptuneIamRoleArn sets the NeptuneIamRoleArn field's value. -func (s *StartMLModelTransformJobInput) SetNeptuneIamRoleArn(v string) *StartMLModelTransformJobInput { - s.NeptuneIamRoleArn = &v - return s -} - -// SetS3OutputEncryptionKMSKey sets the S3OutputEncryptionKMSKey field's value. -func (s *StartMLModelTransformJobInput) SetS3OutputEncryptionKMSKey(v string) *StartMLModelTransformJobInput { - s.S3OutputEncryptionKMSKey = &v - return s -} - -// SetSagemakerIamRoleArn sets the SagemakerIamRoleArn field's value. -func (s *StartMLModelTransformJobInput) SetSagemakerIamRoleArn(v string) *StartMLModelTransformJobInput { - s.SagemakerIamRoleArn = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *StartMLModelTransformJobInput) SetSecurityGroupIds(v []*string) *StartMLModelTransformJobInput { - s.SecurityGroupIds = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *StartMLModelTransformJobInput) SetSubnets(v []*string) *StartMLModelTransformJobInput { - s.Subnets = v - return s -} - -// SetTrainingJobName sets the TrainingJobName field's value. -func (s *StartMLModelTransformJobInput) SetTrainingJobName(v string) *StartMLModelTransformJobInput { - s.TrainingJobName = &v - return s -} - -// SetVolumeEncryptionKMSKey sets the VolumeEncryptionKMSKey field's value. -func (s *StartMLModelTransformJobInput) SetVolumeEncryptionKMSKey(v string) *StartMLModelTransformJobInput { - s.VolumeEncryptionKMSKey = &v - return s -} - -type StartMLModelTransformJobOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the model transform job. - Arn *string `locationName:"arn" type:"string"` - - // The creation time of the model transform job, in milliseconds. - CreationTimeInMillis *int64 `locationName:"creationTimeInMillis" type:"long"` - - // The unique ID of the new model transform job. - Id *string `locationName:"id" 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 StartMLModelTransformJobOutput) 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 StartMLModelTransformJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartMLModelTransformJobOutput) SetArn(v string) *StartMLModelTransformJobOutput { - s.Arn = &v - return s -} - -// SetCreationTimeInMillis sets the CreationTimeInMillis field's value. -func (s *StartMLModelTransformJobOutput) SetCreationTimeInMillis(v int64) *StartMLModelTransformJobOutput { - s.CreationTimeInMillis = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartMLModelTransformJobOutput) SetId(v string) *StartMLModelTransformJobOutput { - s.Id = &v - return s -} - -// Contains statistics information. The DFE engine uses information about the -// data in your Neptune graph to make effective trade-offs when planning query -// execution. This information takes the form of statistics that include so-called -// characteristic sets and predicate statistics that can guide query planning. -// See Managing statistics for the Neptune DFE to use (https://docs.aws.amazon.com/neptune/latest/userguide/neptune-dfe-statistics.html). -type Statistics struct { - _ struct{} `type:"structure"` - - // Indicates whether or not DFE statistics generation is enabled at all. - Active *bool `locationName:"active" type:"boolean"` - - // Indicates whether or not automatic statistics generation is enabled. - AutoCompute *bool `locationName:"autoCompute" type:"boolean"` - - // The UTC time at which DFE statistics have most recently been generated. - Date *time.Time `locationName:"date" type:"timestamp" timestampFormat:"iso8601"` - - // A note about problems in the case where statistics are invalid. - Note *string `locationName:"note" type:"string"` - - // A StatisticsSummary structure that contains: - // - // * signatureCount - The total number of signatures across all characteristic - // sets. - // - // * instanceCount - The total number of characteristic-set instances. - // - // * predicateCount - The total number of unique predicates. - SignatureInfo *StatisticsSummary `locationName:"signatureInfo" type:"structure"` - - // Reports the ID of the current statistics generation run. A value of -1 indicates - // that no statistics have been generated. - StatisticsId *string `locationName:"statisticsId" 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 Statistics) 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 Statistics) GoString() string { - return s.String() -} - -// SetActive sets the Active field's value. -func (s *Statistics) SetActive(v bool) *Statistics { - s.Active = &v - return s -} - -// SetAutoCompute sets the AutoCompute field's value. -func (s *Statistics) SetAutoCompute(v bool) *Statistics { - s.AutoCompute = &v - return s -} - -// SetDate sets the Date field's value. -func (s *Statistics) SetDate(v time.Time) *Statistics { - s.Date = &v - return s -} - -// SetNote sets the Note field's value. -func (s *Statistics) SetNote(v string) *Statistics { - s.Note = &v - return s -} - -// SetSignatureInfo sets the SignatureInfo field's value. -func (s *Statistics) SetSignatureInfo(v *StatisticsSummary) *Statistics { - s.SignatureInfo = v - return s -} - -// SetStatisticsId sets the StatisticsId field's value. -func (s *Statistics) SetStatisticsId(v string) *Statistics { - s.StatisticsId = &v - return s -} - -// Raised when statistics needed to satisfy a request are not available. -type StatisticsNotAvailableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 StatisticsNotAvailableException) 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 StatisticsNotAvailableException) GoString() string { - return s.String() -} - -func newErrorStatisticsNotAvailableException(v protocol.ResponseMetadata) error { - return &StatisticsNotAvailableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *StatisticsNotAvailableException) Code() string { - return "StatisticsNotAvailableException" -} - -// Message returns the exception's message. -func (s *StatisticsNotAvailableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *StatisticsNotAvailableException) OrigErr() error { - return nil -} - -func (s *StatisticsNotAvailableException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *StatisticsNotAvailableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *StatisticsNotAvailableException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about the characteristic sets generated in the statistics. -type StatisticsSummary struct { - _ struct{} `type:"structure"` - - // The total number of characteristic-set instances. - InstanceCount *int64 `locationName:"instanceCount" type:"integer"` - - // The total number of unique predicates. - PredicateCount *int64 `locationName:"predicateCount" type:"integer"` - - // The total number of signatures across all characteristic sets. - SignatureCount *int64 `locationName:"signatureCount" 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 StatisticsSummary) 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 StatisticsSummary) GoString() string { - return s.String() -} - -// SetInstanceCount sets the InstanceCount field's value. -func (s *StatisticsSummary) SetInstanceCount(v int64) *StatisticsSummary { - s.InstanceCount = &v - return s -} - -// SetPredicateCount sets the PredicateCount field's value. -func (s *StatisticsSummary) SetPredicateCount(v int64) *StatisticsSummary { - s.PredicateCount = &v - return s -} - -// SetSignatureCount sets the SignatureCount field's value. -func (s *StatisticsSummary) SetSignatureCount(v int64) *StatisticsSummary { - s.SignatureCount = &v - return s -} - -// Raised when stream records requested by a query cannot be found. -type StreamRecordsNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 StreamRecordsNotFoundException) 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 StreamRecordsNotFoundException) GoString() string { - return s.String() -} - -func newErrorStreamRecordsNotFoundException(v protocol.ResponseMetadata) error { - return &StreamRecordsNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *StreamRecordsNotFoundException) Code() string { - return "StreamRecordsNotFoundException" -} - -// Message returns the exception's message. -func (s *StreamRecordsNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *StreamRecordsNotFoundException) OrigErr() error { - return nil -} - -func (s *StreamRecordsNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *StreamRecordsNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *StreamRecordsNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A subject structure. -type SubjectStructure struct { - _ struct{} `type:"structure"` - - // Number of occurrences of this specific structure. - Count *int64 `locationName:"count" type:"long"` - - // A list of predicates present in this specific structure. - Predicates []*string `locationName:"predicates" type:"list"` -} - -// 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 SubjectStructure) 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 SubjectStructure) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *SubjectStructure) SetCount(v int64) *SubjectStructure { - s.Count = &v - return s -} - -// SetPredicates sets the Predicates field's value. -func (s *SubjectStructure) SetPredicates(v []*string) *SubjectStructure { - s.Predicates = v - return s -} - -// Raised when the rate of requests exceeds the maximum throughput. Requests -// can be retried after encountering this exception. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request that could not be processed for this reason. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when the an operation exceeds the time limit allowed for it. -type TimeLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request that could not be processed for this reason. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 TimeLimitExceededException) 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 TimeLimitExceededException) GoString() string { - return s.String() -} - -func newErrorTimeLimitExceededException(v protocol.ResponseMetadata) error { - return &TimeLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TimeLimitExceededException) Code() string { - return "TimeLimitExceededException" -} - -// Message returns the exception's message. -func (s *TimeLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TimeLimitExceededException) OrigErr() error { - return nil -} - -func (s *TimeLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TimeLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TimeLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when the number of requests being processed exceeds the limit. -type TooManyRequestsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request that could not be processed for this reason. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 TooManyRequestsException) 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 TooManyRequestsException) GoString() string { - return s.String() -} - -func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { - return &TooManyRequestsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyRequestsException) Code() string { - return "TooManyRequestsException" -} - -// Message returns the exception's message. -func (s *TooManyRequestsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyRequestsException) OrigErr() error { - return nil -} - -func (s *TooManyRequestsException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyRequestsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyRequestsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Raised when a request attempts to initiate an operation that is not supported. -type UnsupportedOperationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The HTTP status code returned with the exception. - Code_ *string `locationName:"code" type:"string"` - - // A detailed message describing the problem. - // - // DetailedMessage is a required field - DetailedMessage *string `locationName:"detailedMessage" type:"string" required:"true"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the request in question. - // - // RequestId is a required field - RequestId *string `locationName:"requestId" 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 UnsupportedOperationException) 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 UnsupportedOperationException) GoString() string { - return s.String() -} - -func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { - return &UnsupportedOperationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnsupportedOperationException) Code() string { - return "UnsupportedOperationException" -} - -// Message returns the exception's message. -func (s *UnsupportedOperationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnsupportedOperationException) OrigErr() error { - return nil -} - -func (s *UnsupportedOperationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnsupportedOperationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnsupportedOperationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // ActionInitiateDatabaseReset is a Action enum value - ActionInitiateDatabaseReset = "initiateDatabaseReset" - - // ActionPerformDatabaseReset is a Action enum value - ActionPerformDatabaseReset = "performDatabaseReset" -) - -// Action_Values returns all elements of the Action enum -func Action_Values() []string { - return []string{ - ActionInitiateDatabaseReset, - ActionPerformDatabaseReset, - } -} - -const ( - // EncodingGzip is a Encoding enum value - EncodingGzip = "gzip" -) - -// Encoding_Values returns all elements of the Encoding enum -func Encoding_Values() []string { - return []string{ - EncodingGzip, - } -} - -const ( - // FormatCsv is a Format enum value - FormatCsv = "csv" - - // FormatOpencypher is a Format enum value - FormatOpencypher = "opencypher" - - // FormatNtriples is a Format enum value - FormatNtriples = "ntriples" - - // FormatNquads is a Format enum value - FormatNquads = "nquads" - - // FormatRdfxml is a Format enum value - FormatRdfxml = "rdfxml" - - // FormatTurtle is a Format enum value - FormatTurtle = "turtle" -) - -// Format_Values returns all elements of the Format enum -func Format_Values() []string { - return []string{ - FormatCsv, - FormatOpencypher, - FormatNtriples, - FormatNquads, - FormatRdfxml, - FormatTurtle, - } -} - -const ( - // GraphSummaryTypeBasic is a GraphSummaryType enum value - GraphSummaryTypeBasic = "basic" - - // GraphSummaryTypeDetailed is a GraphSummaryType enum value - GraphSummaryTypeDetailed = "detailed" -) - -// GraphSummaryType_Values returns all elements of the GraphSummaryType enum -func GraphSummaryType_Values() []string { - return []string{ - GraphSummaryTypeBasic, - GraphSummaryTypeDetailed, - } -} - -const ( - // IteratorTypeAtSequenceNumber is a IteratorType enum value - IteratorTypeAtSequenceNumber = "AT_SEQUENCE_NUMBER" - - // IteratorTypeAfterSequenceNumber is a IteratorType enum value - IteratorTypeAfterSequenceNumber = "AFTER_SEQUENCE_NUMBER" - - // IteratorTypeTrimHorizon is a IteratorType enum value - IteratorTypeTrimHorizon = "TRIM_HORIZON" - - // IteratorTypeLatest is a IteratorType enum value - IteratorTypeLatest = "LATEST" -) - -// IteratorType_Values returns all elements of the IteratorType enum -func IteratorType_Values() []string { - return []string{ - IteratorTypeAtSequenceNumber, - IteratorTypeAfterSequenceNumber, - IteratorTypeTrimHorizon, - IteratorTypeLatest, - } -} - -const ( - // ModeResume is a Mode enum value - ModeResume = "RESUME" - - // ModeNew is a Mode enum value - ModeNew = "NEW" - - // ModeAuto is a Mode enum value - ModeAuto = "AUTO" -) - -// Mode_Values returns all elements of the Mode enum -func Mode_Values() []string { - return []string{ - ModeResume, - ModeNew, - ModeAuto, - } -} - -const ( - // OpenCypherExplainModeStatic is a OpenCypherExplainMode enum value - OpenCypherExplainModeStatic = "static" - - // OpenCypherExplainModeDynamic is a OpenCypherExplainMode enum value - OpenCypherExplainModeDynamic = "dynamic" - - // OpenCypherExplainModeDetails is a OpenCypherExplainMode enum value - OpenCypherExplainModeDetails = "details" -) - -// OpenCypherExplainMode_Values returns all elements of the OpenCypherExplainMode enum -func OpenCypherExplainMode_Values() []string { - return []string{ - OpenCypherExplainModeStatic, - OpenCypherExplainModeDynamic, - OpenCypherExplainModeDetails, - } -} - -const ( - // ParallelismLow is a Parallelism enum value - ParallelismLow = "LOW" - - // ParallelismMedium is a Parallelism enum value - ParallelismMedium = "MEDIUM" - - // ParallelismHigh is a Parallelism enum value - ParallelismHigh = "HIGH" - - // ParallelismOversubscribe is a Parallelism enum value - ParallelismOversubscribe = "OVERSUBSCRIBE" -) - -// Parallelism_Values returns all elements of the Parallelism enum -func Parallelism_Values() []string { - return []string{ - ParallelismLow, - ParallelismMedium, - ParallelismHigh, - ParallelismOversubscribe, - } -} - -const ( - // S3BucketRegionUsEast1 is a S3BucketRegion enum value - S3BucketRegionUsEast1 = "us-east-1" - - // S3BucketRegionUsEast2 is a S3BucketRegion enum value - S3BucketRegionUsEast2 = "us-east-2" - - // S3BucketRegionUsWest1 is a S3BucketRegion enum value - S3BucketRegionUsWest1 = "us-west-1" - - // S3BucketRegionUsWest2 is a S3BucketRegion enum value - S3BucketRegionUsWest2 = "us-west-2" - - // S3BucketRegionCaCentral1 is a S3BucketRegion enum value - S3BucketRegionCaCentral1 = "ca-central-1" - - // S3BucketRegionSaEast1 is a S3BucketRegion enum value - S3BucketRegionSaEast1 = "sa-east-1" - - // S3BucketRegionEuNorth1 is a S3BucketRegion enum value - S3BucketRegionEuNorth1 = "eu-north-1" - - // S3BucketRegionEuWest1 is a S3BucketRegion enum value - S3BucketRegionEuWest1 = "eu-west-1" - - // S3BucketRegionEuWest2 is a S3BucketRegion enum value - S3BucketRegionEuWest2 = "eu-west-2" - - // S3BucketRegionEuWest3 is a S3BucketRegion enum value - S3BucketRegionEuWest3 = "eu-west-3" - - // S3BucketRegionEuCentral1 is a S3BucketRegion enum value - S3BucketRegionEuCentral1 = "eu-central-1" - - // S3BucketRegionMeSouth1 is a S3BucketRegion enum value - S3BucketRegionMeSouth1 = "me-south-1" - - // S3BucketRegionAfSouth1 is a S3BucketRegion enum value - S3BucketRegionAfSouth1 = "af-south-1" - - // S3BucketRegionApEast1 is a S3BucketRegion enum value - S3BucketRegionApEast1 = "ap-east-1" - - // S3BucketRegionApNortheast1 is a S3BucketRegion enum value - S3BucketRegionApNortheast1 = "ap-northeast-1" - - // S3BucketRegionApNortheast2 is a S3BucketRegion enum value - S3BucketRegionApNortheast2 = "ap-northeast-2" - - // S3BucketRegionApSoutheast1 is a S3BucketRegion enum value - S3BucketRegionApSoutheast1 = "ap-southeast-1" - - // S3BucketRegionApSoutheast2 is a S3BucketRegion enum value - S3BucketRegionApSoutheast2 = "ap-southeast-2" - - // S3BucketRegionApSouth1 is a S3BucketRegion enum value - S3BucketRegionApSouth1 = "ap-south-1" - - // S3BucketRegionCnNorth1 is a S3BucketRegion enum value - S3BucketRegionCnNorth1 = "cn-north-1" - - // S3BucketRegionCnNorthwest1 is a S3BucketRegion enum value - S3BucketRegionCnNorthwest1 = "cn-northwest-1" - - // S3BucketRegionUsGovWest1 is a S3BucketRegion enum value - S3BucketRegionUsGovWest1 = "us-gov-west-1" - - // S3BucketRegionUsGovEast1 is a S3BucketRegion enum value - S3BucketRegionUsGovEast1 = "us-gov-east-1" -) - -// S3BucketRegion_Values returns all elements of the S3BucketRegion enum -func S3BucketRegion_Values() []string { - return []string{ - S3BucketRegionUsEast1, - S3BucketRegionUsEast2, - S3BucketRegionUsWest1, - S3BucketRegionUsWest2, - S3BucketRegionCaCentral1, - S3BucketRegionSaEast1, - S3BucketRegionEuNorth1, - S3BucketRegionEuWest1, - S3BucketRegionEuWest2, - S3BucketRegionEuWest3, - S3BucketRegionEuCentral1, - S3BucketRegionMeSouth1, - S3BucketRegionAfSouth1, - S3BucketRegionApEast1, - S3BucketRegionApNortheast1, - S3BucketRegionApNortheast2, - S3BucketRegionApSoutheast1, - S3BucketRegionApSoutheast2, - S3BucketRegionApSouth1, - S3BucketRegionCnNorth1, - S3BucketRegionCnNorthwest1, - S3BucketRegionUsGovWest1, - S3BucketRegionUsGovEast1, - } -} - -const ( - // StatisticsAutoGenerationModeDisableAutoCompute is a StatisticsAutoGenerationMode enum value - StatisticsAutoGenerationModeDisableAutoCompute = "disableAutoCompute" - - // StatisticsAutoGenerationModeEnableAutoCompute is a StatisticsAutoGenerationMode enum value - StatisticsAutoGenerationModeEnableAutoCompute = "enableAutoCompute" - - // StatisticsAutoGenerationModeRefresh is a StatisticsAutoGenerationMode enum value - StatisticsAutoGenerationModeRefresh = "refresh" -) - -// StatisticsAutoGenerationMode_Values returns all elements of the StatisticsAutoGenerationMode enum -func StatisticsAutoGenerationMode_Values() []string { - return []string{ - StatisticsAutoGenerationModeDisableAutoCompute, - StatisticsAutoGenerationModeEnableAutoCompute, - StatisticsAutoGenerationModeRefresh, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/doc.go deleted file mode 100644 index 88f333c22e60..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package neptunedata provides the client and types for making API -// requests to Amazon NeptuneData. -// -// The Amazon Neptune data API provides SDK support for more than 40 of Neptune's -// data operations, including data loading, query execution, data inquiry, and -// machine learning. It supports the Gremlin and openCypher query languages, -// and is available in all SDK languages. It automatically signs API requests -// and greatly simplifies integrating Neptune into your applications. -// -// See https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01 for more information on this service. -// -// See neptunedata package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/neptunedata/ -// -// # Using the Client -// -// To contact Amazon NeptuneData with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon NeptuneData client Neptunedata for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/neptunedata/#New -package neptunedata diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/errors.go deleted file mode 100644 index 1dbc3a7e4798..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/errors.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package neptunedata - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // Raised in case of an authentication or authorization failure. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeBadRequestException for service response error code - // "BadRequestException". - // - // Raised when a request is submitted that cannot be processed. - ErrCodeBadRequestException = "BadRequestException" - - // ErrCodeBulkLoadIdNotFoundException for service response error code - // "BulkLoadIdNotFoundException". - // - // Raised when a specified bulk-load job ID cannot be found. - ErrCodeBulkLoadIdNotFoundException = "BulkLoadIdNotFoundException" - - // ErrCodeCancelledByUserException for service response error code - // "CancelledByUserException". - // - // Raised when a user cancelled a request. - ErrCodeCancelledByUserException = "CancelledByUserException" - - // ErrCodeClientTimeoutException for service response error code - // "ClientTimeoutException". - // - // Raised when a request timed out in the client. - ErrCodeClientTimeoutException = "ClientTimeoutException" - - // ErrCodeConcurrentModificationException for service response error code - // "ConcurrentModificationException". - // - // Raised when a request attempts to modify data that is concurrently being - // modified by another process. - ErrCodeConcurrentModificationException = "ConcurrentModificationException" - - // ErrCodeConstraintViolationException for service response error code - // "ConstraintViolationException". - // - // Raised when a value in a request field did not satisfy required constraints. - ErrCodeConstraintViolationException = "ConstraintViolationException" - - // ErrCodeExpiredStreamException for service response error code - // "ExpiredStreamException". - // - // Raised when a request attempts to access an stream that has expired. - ErrCodeExpiredStreamException = "ExpiredStreamException" - - // ErrCodeFailureByQueryException for service response error code - // "FailureByQueryException". - // - // Raised when a request fails. - ErrCodeFailureByQueryException = "FailureByQueryException" - - // ErrCodeIllegalArgumentException for service response error code - // "IllegalArgumentException". - // - // Raised when an argument in a request is not supported. - ErrCodeIllegalArgumentException = "IllegalArgumentException" - - // ErrCodeInternalFailureException for service response error code - // "InternalFailureException". - // - // Raised when the processing of the request failed unexpectedly. - ErrCodeInternalFailureException = "InternalFailureException" - - // ErrCodeInvalidArgumentException for service response error code - // "InvalidArgumentException". - // - // Raised when an argument in a request has an invalid value. - ErrCodeInvalidArgumentException = "InvalidArgumentException" - - // ErrCodeInvalidNumericDataException for service response error code - // "InvalidNumericDataException". - // - // Raised when invalid numerical data is encountered when servicing a request. - ErrCodeInvalidNumericDataException = "InvalidNumericDataException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // Raised when a parameter value is not valid. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeLoadUrlAccessDeniedException for service response error code - // "LoadUrlAccessDeniedException". - // - // Raised when access is denied to a specified load URL. - ErrCodeLoadUrlAccessDeniedException = "LoadUrlAccessDeniedException" - - // ErrCodeMLResourceNotFoundException for service response error code - // "MLResourceNotFoundException". - // - // Raised when a specified machine-learning resource could not be found. - ErrCodeMLResourceNotFoundException = "MLResourceNotFoundException" - - // ErrCodeMalformedQueryException for service response error code - // "MalformedQueryException". - // - // Raised when a query is submitted that is syntactically incorrect or does - // not pass additional validation. - ErrCodeMalformedQueryException = "MalformedQueryException" - - // ErrCodeMemoryLimitExceededException for service response error code - // "MemoryLimitExceededException". - // - // Raised when a request fails because of insufficient memory resources. The - // request can be retried. - ErrCodeMemoryLimitExceededException = "MemoryLimitExceededException" - - // ErrCodeMethodNotAllowedException for service response error code - // "MethodNotAllowedException". - // - // Raised when the HTTP method used by a request is not supported by the endpoint - // being used. - ErrCodeMethodNotAllowedException = "MethodNotAllowedException" - - // ErrCodeMissingParameterException for service response error code - // "MissingParameterException". - // - // Raised when a required parameter is missing. - ErrCodeMissingParameterException = "MissingParameterException" - - // ErrCodeParsingException for service response error code - // "ParsingException". - // - // Raised when a parsing issue is encountered. - ErrCodeParsingException = "ParsingException" - - // ErrCodePreconditionsFailedException for service response error code - // "PreconditionsFailedException". - // - // Raised when a precondition for processing a request is not satisfied. - ErrCodePreconditionsFailedException = "PreconditionsFailedException" - - // ErrCodeQueryLimitExceededException for service response error code - // "QueryLimitExceededException". - // - // Raised when the number of active queries exceeds what the server can process. - // The query in question can be retried when the system is less busy. - ErrCodeQueryLimitExceededException = "QueryLimitExceededException" - - // ErrCodeQueryLimitException for service response error code - // "QueryLimitException". - // - // Raised when the size of a query exceeds the system limit. - ErrCodeQueryLimitException = "QueryLimitException" - - // ErrCodeQueryTooLargeException for service response error code - // "QueryTooLargeException". - // - // Raised when the body of a query is too large. - ErrCodeQueryTooLargeException = "QueryTooLargeException" - - // ErrCodeReadOnlyViolationException for service response error code - // "ReadOnlyViolationException". - // - // Raised when a request attempts to write to a read-only resource. - ErrCodeReadOnlyViolationException = "ReadOnlyViolationException" - - // ErrCodeS3Exception for service response error code - // "S3Exception". - // - // Raised when there is a problem accessing Amazon S3. - ErrCodeS3Exception = "S3Exception" - - // ErrCodeServerShutdownException for service response error code - // "ServerShutdownException". - // - // Raised when the server shuts down while processing a request. - ErrCodeServerShutdownException = "ServerShutdownException" - - // ErrCodeStatisticsNotAvailableException for service response error code - // "StatisticsNotAvailableException". - // - // Raised when statistics needed to satisfy a request are not available. - ErrCodeStatisticsNotAvailableException = "StatisticsNotAvailableException" - - // ErrCodeStreamRecordsNotFoundException for service response error code - // "StreamRecordsNotFoundException". - // - // Raised when stream records requested by a query cannot be found. - ErrCodeStreamRecordsNotFoundException = "StreamRecordsNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // Raised when the rate of requests exceeds the maximum throughput. Requests - // can be retried after encountering this exception. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeTimeLimitExceededException for service response error code - // "TimeLimitExceededException". - // - // Raised when the an operation exceeds the time limit allowed for it. - ErrCodeTimeLimitExceededException = "TimeLimitExceededException" - - // ErrCodeTooManyRequestsException for service response error code - // "TooManyRequestsException". - // - // Raised when the number of requests being processed exceeds the limit. - ErrCodeTooManyRequestsException = "TooManyRequestsException" - - // ErrCodeUnsupportedOperationException for service response error code - // "UnsupportedOperationException". - // - // Raised when a request attempts to initiate an operation that is not supported. - ErrCodeUnsupportedOperationException = "UnsupportedOperationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "BadRequestException": newErrorBadRequestException, - "BulkLoadIdNotFoundException": newErrorBulkLoadIdNotFoundException, - "CancelledByUserException": newErrorCancelledByUserException, - "ClientTimeoutException": newErrorClientTimeoutException, - "ConcurrentModificationException": newErrorConcurrentModificationException, - "ConstraintViolationException": newErrorConstraintViolationException, - "ExpiredStreamException": newErrorExpiredStreamException, - "FailureByQueryException": newErrorFailureByQueryException, - "IllegalArgumentException": newErrorIllegalArgumentException, - "InternalFailureException": newErrorInternalFailureException, - "InvalidArgumentException": newErrorInvalidArgumentException, - "InvalidNumericDataException": newErrorInvalidNumericDataException, - "InvalidParameterException": newErrorInvalidParameterException, - "LoadUrlAccessDeniedException": newErrorLoadUrlAccessDeniedException, - "MLResourceNotFoundException": newErrorMLResourceNotFoundException, - "MalformedQueryException": newErrorMalformedQueryException, - "MemoryLimitExceededException": newErrorMemoryLimitExceededException, - "MethodNotAllowedException": newErrorMethodNotAllowedException, - "MissingParameterException": newErrorMissingParameterException, - "ParsingException": newErrorParsingException, - "PreconditionsFailedException": newErrorPreconditionsFailedException, - "QueryLimitExceededException": newErrorQueryLimitExceededException, - "QueryLimitException": newErrorQueryLimitException, - "QueryTooLargeException": newErrorQueryTooLargeException, - "ReadOnlyViolationException": newErrorReadOnlyViolationException, - "S3Exception": newErrorS3Exception, - "ServerShutdownException": newErrorServerShutdownException, - "StatisticsNotAvailableException": newErrorStatisticsNotAvailableException, - "StreamRecordsNotFoundException": newErrorStreamRecordsNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "TimeLimitExceededException": newErrorTimeLimitExceededException, - "TooManyRequestsException": newErrorTooManyRequestsException, - "UnsupportedOperationException": newErrorUnsupportedOperationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/neptunedataiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/neptunedataiface/interface.go deleted file mode 100644 index 9e76915195c3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/neptunedataiface/interface.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package neptunedataiface provides an interface to enable mocking the Amazon NeptuneData service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package neptunedataiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata" -) - -// NeptunedataAPI provides an interface to enable mocking the -// neptunedata.Neptunedata service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon NeptuneData. -// func myFunc(svc neptunedataiface.NeptunedataAPI) bool { -// // Make svc.CancelGremlinQuery request -// } -// -// func main() { -// sess := session.New() -// svc := neptunedata.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockNeptunedataClient struct { -// neptunedataiface.NeptunedataAPI -// } -// func (m *mockNeptunedataClient) CancelGremlinQuery(input *neptunedata.CancelGremlinQueryInput) (*neptunedata.CancelGremlinQueryOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockNeptunedataClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type NeptunedataAPI interface { - CancelGremlinQuery(*neptunedata.CancelGremlinQueryInput) (*neptunedata.CancelGremlinQueryOutput, error) - CancelGremlinQueryWithContext(aws.Context, *neptunedata.CancelGremlinQueryInput, ...request.Option) (*neptunedata.CancelGremlinQueryOutput, error) - CancelGremlinQueryRequest(*neptunedata.CancelGremlinQueryInput) (*request.Request, *neptunedata.CancelGremlinQueryOutput) - - CancelLoaderJob(*neptunedata.CancelLoaderJobInput) (*neptunedata.CancelLoaderJobOutput, error) - CancelLoaderJobWithContext(aws.Context, *neptunedata.CancelLoaderJobInput, ...request.Option) (*neptunedata.CancelLoaderJobOutput, error) - CancelLoaderJobRequest(*neptunedata.CancelLoaderJobInput) (*request.Request, *neptunedata.CancelLoaderJobOutput) - - CancelMLDataProcessingJob(*neptunedata.CancelMLDataProcessingJobInput) (*neptunedata.CancelMLDataProcessingJobOutput, error) - CancelMLDataProcessingJobWithContext(aws.Context, *neptunedata.CancelMLDataProcessingJobInput, ...request.Option) (*neptunedata.CancelMLDataProcessingJobOutput, error) - CancelMLDataProcessingJobRequest(*neptunedata.CancelMLDataProcessingJobInput) (*request.Request, *neptunedata.CancelMLDataProcessingJobOutput) - - CancelMLModelTrainingJob(*neptunedata.CancelMLModelTrainingJobInput) (*neptunedata.CancelMLModelTrainingJobOutput, error) - CancelMLModelTrainingJobWithContext(aws.Context, *neptunedata.CancelMLModelTrainingJobInput, ...request.Option) (*neptunedata.CancelMLModelTrainingJobOutput, error) - CancelMLModelTrainingJobRequest(*neptunedata.CancelMLModelTrainingJobInput) (*request.Request, *neptunedata.CancelMLModelTrainingJobOutput) - - CancelMLModelTransformJob(*neptunedata.CancelMLModelTransformJobInput) (*neptunedata.CancelMLModelTransformJobOutput, error) - CancelMLModelTransformJobWithContext(aws.Context, *neptunedata.CancelMLModelTransformJobInput, ...request.Option) (*neptunedata.CancelMLModelTransformJobOutput, error) - CancelMLModelTransformJobRequest(*neptunedata.CancelMLModelTransformJobInput) (*request.Request, *neptunedata.CancelMLModelTransformJobOutput) - - CancelOpenCypherQuery(*neptunedata.CancelOpenCypherQueryInput) (*neptunedata.CancelOpenCypherQueryOutput, error) - CancelOpenCypherQueryWithContext(aws.Context, *neptunedata.CancelOpenCypherQueryInput, ...request.Option) (*neptunedata.CancelOpenCypherQueryOutput, error) - CancelOpenCypherQueryRequest(*neptunedata.CancelOpenCypherQueryInput) (*request.Request, *neptunedata.CancelOpenCypherQueryOutput) - - CreateMLEndpoint(*neptunedata.CreateMLEndpointInput) (*neptunedata.CreateMLEndpointOutput, error) - CreateMLEndpointWithContext(aws.Context, *neptunedata.CreateMLEndpointInput, ...request.Option) (*neptunedata.CreateMLEndpointOutput, error) - CreateMLEndpointRequest(*neptunedata.CreateMLEndpointInput) (*request.Request, *neptunedata.CreateMLEndpointOutput) - - DeleteMLEndpoint(*neptunedata.DeleteMLEndpointInput) (*neptunedata.DeleteMLEndpointOutput, error) - DeleteMLEndpointWithContext(aws.Context, *neptunedata.DeleteMLEndpointInput, ...request.Option) (*neptunedata.DeleteMLEndpointOutput, error) - DeleteMLEndpointRequest(*neptunedata.DeleteMLEndpointInput) (*request.Request, *neptunedata.DeleteMLEndpointOutput) - - DeletePropertygraphStatistics(*neptunedata.DeletePropertygraphStatisticsInput) (*neptunedata.DeletePropertygraphStatisticsOutput, error) - DeletePropertygraphStatisticsWithContext(aws.Context, *neptunedata.DeletePropertygraphStatisticsInput, ...request.Option) (*neptunedata.DeletePropertygraphStatisticsOutput, error) - DeletePropertygraphStatisticsRequest(*neptunedata.DeletePropertygraphStatisticsInput) (*request.Request, *neptunedata.DeletePropertygraphStatisticsOutput) - - DeleteSparqlStatistics(*neptunedata.DeleteSparqlStatisticsInput) (*neptunedata.DeleteSparqlStatisticsOutput, error) - DeleteSparqlStatisticsWithContext(aws.Context, *neptunedata.DeleteSparqlStatisticsInput, ...request.Option) (*neptunedata.DeleteSparqlStatisticsOutput, error) - DeleteSparqlStatisticsRequest(*neptunedata.DeleteSparqlStatisticsInput) (*request.Request, *neptunedata.DeleteSparqlStatisticsOutput) - - ExecuteFastReset(*neptunedata.ExecuteFastResetInput) (*neptunedata.ExecuteFastResetOutput, error) - ExecuteFastResetWithContext(aws.Context, *neptunedata.ExecuteFastResetInput, ...request.Option) (*neptunedata.ExecuteFastResetOutput, error) - ExecuteFastResetRequest(*neptunedata.ExecuteFastResetInput) (*request.Request, *neptunedata.ExecuteFastResetOutput) - - ExecuteGremlinExplainQuery(*neptunedata.ExecuteGremlinExplainQueryInput) (*neptunedata.ExecuteGremlinExplainQueryOutput, error) - ExecuteGremlinExplainQueryWithContext(aws.Context, *neptunedata.ExecuteGremlinExplainQueryInput, ...request.Option) (*neptunedata.ExecuteGremlinExplainQueryOutput, error) - ExecuteGremlinExplainQueryRequest(*neptunedata.ExecuteGremlinExplainQueryInput) (*request.Request, *neptunedata.ExecuteGremlinExplainQueryOutput) - - ExecuteGremlinProfileQuery(*neptunedata.ExecuteGremlinProfileQueryInput) (*neptunedata.ExecuteGremlinProfileQueryOutput, error) - ExecuteGremlinProfileQueryWithContext(aws.Context, *neptunedata.ExecuteGremlinProfileQueryInput, ...request.Option) (*neptunedata.ExecuteGremlinProfileQueryOutput, error) - ExecuteGremlinProfileQueryRequest(*neptunedata.ExecuteGremlinProfileQueryInput) (*request.Request, *neptunedata.ExecuteGremlinProfileQueryOutput) - - ExecuteGremlinQuery(*neptunedata.ExecuteGremlinQueryInput) (*neptunedata.ExecuteGremlinQueryOutput, error) - ExecuteGremlinQueryWithContext(aws.Context, *neptunedata.ExecuteGremlinQueryInput, ...request.Option) (*neptunedata.ExecuteGremlinQueryOutput, error) - ExecuteGremlinQueryRequest(*neptunedata.ExecuteGremlinQueryInput) (*request.Request, *neptunedata.ExecuteGremlinQueryOutput) - - ExecuteOpenCypherExplainQuery(*neptunedata.ExecuteOpenCypherExplainQueryInput) (*neptunedata.ExecuteOpenCypherExplainQueryOutput, error) - ExecuteOpenCypherExplainQueryWithContext(aws.Context, *neptunedata.ExecuteOpenCypherExplainQueryInput, ...request.Option) (*neptunedata.ExecuteOpenCypherExplainQueryOutput, error) - ExecuteOpenCypherExplainQueryRequest(*neptunedata.ExecuteOpenCypherExplainQueryInput) (*request.Request, *neptunedata.ExecuteOpenCypherExplainQueryOutput) - - GetEngineStatus(*neptunedata.GetEngineStatusInput) (*neptunedata.GetEngineStatusOutput, error) - GetEngineStatusWithContext(aws.Context, *neptunedata.GetEngineStatusInput, ...request.Option) (*neptunedata.GetEngineStatusOutput, error) - GetEngineStatusRequest(*neptunedata.GetEngineStatusInput) (*request.Request, *neptunedata.GetEngineStatusOutput) - - GetGremlinQueryStatus(*neptunedata.GetGremlinQueryStatusInput) (*neptunedata.GetGremlinQueryStatusOutput, error) - GetGremlinQueryStatusWithContext(aws.Context, *neptunedata.GetGremlinQueryStatusInput, ...request.Option) (*neptunedata.GetGremlinQueryStatusOutput, error) - GetGremlinQueryStatusRequest(*neptunedata.GetGremlinQueryStatusInput) (*request.Request, *neptunedata.GetGremlinQueryStatusOutput) - - GetMLDataProcessingJob(*neptunedata.GetMLDataProcessingJobInput) (*neptunedata.GetMLDataProcessingJobOutput, error) - GetMLDataProcessingJobWithContext(aws.Context, *neptunedata.GetMLDataProcessingJobInput, ...request.Option) (*neptunedata.GetMLDataProcessingJobOutput, error) - GetMLDataProcessingJobRequest(*neptunedata.GetMLDataProcessingJobInput) (*request.Request, *neptunedata.GetMLDataProcessingJobOutput) - - GetMLEndpoint(*neptunedata.GetMLEndpointInput) (*neptunedata.GetMLEndpointOutput, error) - GetMLEndpointWithContext(aws.Context, *neptunedata.GetMLEndpointInput, ...request.Option) (*neptunedata.GetMLEndpointOutput, error) - GetMLEndpointRequest(*neptunedata.GetMLEndpointInput) (*request.Request, *neptunedata.GetMLEndpointOutput) - - GetMLModelTrainingJob(*neptunedata.GetMLModelTrainingJobInput) (*neptunedata.GetMLModelTrainingJobOutput, error) - GetMLModelTrainingJobWithContext(aws.Context, *neptunedata.GetMLModelTrainingJobInput, ...request.Option) (*neptunedata.GetMLModelTrainingJobOutput, error) - GetMLModelTrainingJobRequest(*neptunedata.GetMLModelTrainingJobInput) (*request.Request, *neptunedata.GetMLModelTrainingJobOutput) - - GetMLModelTransformJob(*neptunedata.GetMLModelTransformJobInput) (*neptunedata.GetMLModelTransformJobOutput, error) - GetMLModelTransformJobWithContext(aws.Context, *neptunedata.GetMLModelTransformJobInput, ...request.Option) (*neptunedata.GetMLModelTransformJobOutput, error) - GetMLModelTransformJobRequest(*neptunedata.GetMLModelTransformJobInput) (*request.Request, *neptunedata.GetMLModelTransformJobOutput) - - GetOpenCypherQueryStatus(*neptunedata.GetOpenCypherQueryStatusInput) (*neptunedata.GetOpenCypherQueryStatusOutput, error) - GetOpenCypherQueryStatusWithContext(aws.Context, *neptunedata.GetOpenCypherQueryStatusInput, ...request.Option) (*neptunedata.GetOpenCypherQueryStatusOutput, error) - GetOpenCypherQueryStatusRequest(*neptunedata.GetOpenCypherQueryStatusInput) (*request.Request, *neptunedata.GetOpenCypherQueryStatusOutput) - - GetPropertygraphStatistics(*neptunedata.GetPropertygraphStatisticsInput) (*neptunedata.GetPropertygraphStatisticsOutput, error) - GetPropertygraphStatisticsWithContext(aws.Context, *neptunedata.GetPropertygraphStatisticsInput, ...request.Option) (*neptunedata.GetPropertygraphStatisticsOutput, error) - GetPropertygraphStatisticsRequest(*neptunedata.GetPropertygraphStatisticsInput) (*request.Request, *neptunedata.GetPropertygraphStatisticsOutput) - - GetPropertygraphSummary(*neptunedata.GetPropertygraphSummaryInput) (*neptunedata.GetPropertygraphSummaryOutput, error) - GetPropertygraphSummaryWithContext(aws.Context, *neptunedata.GetPropertygraphSummaryInput, ...request.Option) (*neptunedata.GetPropertygraphSummaryOutput, error) - GetPropertygraphSummaryRequest(*neptunedata.GetPropertygraphSummaryInput) (*request.Request, *neptunedata.GetPropertygraphSummaryOutput) - - GetRDFGraphSummary(*neptunedata.GetRDFGraphSummaryInput) (*neptunedata.GetRDFGraphSummaryOutput, error) - GetRDFGraphSummaryWithContext(aws.Context, *neptunedata.GetRDFGraphSummaryInput, ...request.Option) (*neptunedata.GetRDFGraphSummaryOutput, error) - GetRDFGraphSummaryRequest(*neptunedata.GetRDFGraphSummaryInput) (*request.Request, *neptunedata.GetRDFGraphSummaryOutput) - - GetSparqlStatistics(*neptunedata.GetSparqlStatisticsInput) (*neptunedata.GetSparqlStatisticsOutput, error) - GetSparqlStatisticsWithContext(aws.Context, *neptunedata.GetSparqlStatisticsInput, ...request.Option) (*neptunedata.GetSparqlStatisticsOutput, error) - GetSparqlStatisticsRequest(*neptunedata.GetSparqlStatisticsInput) (*request.Request, *neptunedata.GetSparqlStatisticsOutput) - - GetSparqlStream(*neptunedata.GetSparqlStreamInput) (*neptunedata.GetSparqlStreamOutput, error) - GetSparqlStreamWithContext(aws.Context, *neptunedata.GetSparqlStreamInput, ...request.Option) (*neptunedata.GetSparqlStreamOutput, error) - GetSparqlStreamRequest(*neptunedata.GetSparqlStreamInput) (*request.Request, *neptunedata.GetSparqlStreamOutput) - - ListGremlinQueries(*neptunedata.ListGremlinQueriesInput) (*neptunedata.ListGremlinQueriesOutput, error) - ListGremlinQueriesWithContext(aws.Context, *neptunedata.ListGremlinQueriesInput, ...request.Option) (*neptunedata.ListGremlinQueriesOutput, error) - ListGremlinQueriesRequest(*neptunedata.ListGremlinQueriesInput) (*request.Request, *neptunedata.ListGremlinQueriesOutput) - - ListLoaderJobs(*neptunedata.ListLoaderJobsInput) (*neptunedata.ListLoaderJobsOutput, error) - ListLoaderJobsWithContext(aws.Context, *neptunedata.ListLoaderJobsInput, ...request.Option) (*neptunedata.ListLoaderJobsOutput, error) - ListLoaderJobsRequest(*neptunedata.ListLoaderJobsInput) (*request.Request, *neptunedata.ListLoaderJobsOutput) - - ListMLDataProcessingJobs(*neptunedata.ListMLDataProcessingJobsInput) (*neptunedata.ListMLDataProcessingJobsOutput, error) - ListMLDataProcessingJobsWithContext(aws.Context, *neptunedata.ListMLDataProcessingJobsInput, ...request.Option) (*neptunedata.ListMLDataProcessingJobsOutput, error) - ListMLDataProcessingJobsRequest(*neptunedata.ListMLDataProcessingJobsInput) (*request.Request, *neptunedata.ListMLDataProcessingJobsOutput) - - ListMLEndpoints(*neptunedata.ListMLEndpointsInput) (*neptunedata.ListMLEndpointsOutput, error) - ListMLEndpointsWithContext(aws.Context, *neptunedata.ListMLEndpointsInput, ...request.Option) (*neptunedata.ListMLEndpointsOutput, error) - ListMLEndpointsRequest(*neptunedata.ListMLEndpointsInput) (*request.Request, *neptunedata.ListMLEndpointsOutput) - - ListMLModelTrainingJobs(*neptunedata.ListMLModelTrainingJobsInput) (*neptunedata.ListMLModelTrainingJobsOutput, error) - ListMLModelTrainingJobsWithContext(aws.Context, *neptunedata.ListMLModelTrainingJobsInput, ...request.Option) (*neptunedata.ListMLModelTrainingJobsOutput, error) - ListMLModelTrainingJobsRequest(*neptunedata.ListMLModelTrainingJobsInput) (*request.Request, *neptunedata.ListMLModelTrainingJobsOutput) - - ListMLModelTransformJobs(*neptunedata.ListMLModelTransformJobsInput) (*neptunedata.ListMLModelTransformJobsOutput, error) - ListMLModelTransformJobsWithContext(aws.Context, *neptunedata.ListMLModelTransformJobsInput, ...request.Option) (*neptunedata.ListMLModelTransformJobsOutput, error) - ListMLModelTransformJobsRequest(*neptunedata.ListMLModelTransformJobsInput) (*request.Request, *neptunedata.ListMLModelTransformJobsOutput) - - ListOpenCypherQueries(*neptunedata.ListOpenCypherQueriesInput) (*neptunedata.ListOpenCypherQueriesOutput, error) - ListOpenCypherQueriesWithContext(aws.Context, *neptunedata.ListOpenCypherQueriesInput, ...request.Option) (*neptunedata.ListOpenCypherQueriesOutput, error) - ListOpenCypherQueriesRequest(*neptunedata.ListOpenCypherQueriesInput) (*request.Request, *neptunedata.ListOpenCypherQueriesOutput) - - ManagePropertygraphStatistics(*neptunedata.ManagePropertygraphStatisticsInput) (*neptunedata.ManagePropertygraphStatisticsOutput, error) - ManagePropertygraphStatisticsWithContext(aws.Context, *neptunedata.ManagePropertygraphStatisticsInput, ...request.Option) (*neptunedata.ManagePropertygraphStatisticsOutput, error) - ManagePropertygraphStatisticsRequest(*neptunedata.ManagePropertygraphStatisticsInput) (*request.Request, *neptunedata.ManagePropertygraphStatisticsOutput) - - ManageSparqlStatistics(*neptunedata.ManageSparqlStatisticsInput) (*neptunedata.ManageSparqlStatisticsOutput, error) - ManageSparqlStatisticsWithContext(aws.Context, *neptunedata.ManageSparqlStatisticsInput, ...request.Option) (*neptunedata.ManageSparqlStatisticsOutput, error) - ManageSparqlStatisticsRequest(*neptunedata.ManageSparqlStatisticsInput) (*request.Request, *neptunedata.ManageSparqlStatisticsOutput) - - StartLoaderJob(*neptunedata.StartLoaderJobInput) (*neptunedata.StartLoaderJobOutput, error) - StartLoaderJobWithContext(aws.Context, *neptunedata.StartLoaderJobInput, ...request.Option) (*neptunedata.StartLoaderJobOutput, error) - StartLoaderJobRequest(*neptunedata.StartLoaderJobInput) (*request.Request, *neptunedata.StartLoaderJobOutput) - - StartMLDataProcessingJob(*neptunedata.StartMLDataProcessingJobInput) (*neptunedata.StartMLDataProcessingJobOutput, error) - StartMLDataProcessingJobWithContext(aws.Context, *neptunedata.StartMLDataProcessingJobInput, ...request.Option) (*neptunedata.StartMLDataProcessingJobOutput, error) - StartMLDataProcessingJobRequest(*neptunedata.StartMLDataProcessingJobInput) (*request.Request, *neptunedata.StartMLDataProcessingJobOutput) - - StartMLModelTrainingJob(*neptunedata.StartMLModelTrainingJobInput) (*neptunedata.StartMLModelTrainingJobOutput, error) - StartMLModelTrainingJobWithContext(aws.Context, *neptunedata.StartMLModelTrainingJobInput, ...request.Option) (*neptunedata.StartMLModelTrainingJobOutput, error) - StartMLModelTrainingJobRequest(*neptunedata.StartMLModelTrainingJobInput) (*request.Request, *neptunedata.StartMLModelTrainingJobOutput) - - StartMLModelTransformJob(*neptunedata.StartMLModelTransformJobInput) (*neptunedata.StartMLModelTransformJobOutput, error) - StartMLModelTransformJobWithContext(aws.Context, *neptunedata.StartMLModelTransformJobInput, ...request.Option) (*neptunedata.StartMLModelTransformJobOutput, error) - StartMLModelTransformJobRequest(*neptunedata.StartMLModelTransformJobInput) (*request.Request, *neptunedata.StartMLModelTransformJobOutput) -} - -var _ NeptunedataAPI = (*neptunedata.Neptunedata)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/service.go deleted file mode 100644 index 3961465686e6..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/neptunedata/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package neptunedata - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// Neptunedata provides the API operation methods for making requests to -// Amazon NeptuneData. See this package's package overview docs -// for details on the service. -// -// Neptunedata methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type Neptunedata struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "neptunedata" // Name of service. - EndpointsID = "neptune-db" // ID to lookup a service endpoint with. - ServiceID = "neptunedata" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the Neptunedata client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a Neptunedata client from just a session. -// svc := neptunedata.New(mySession) -// -// // Create a Neptunedata client with additional configuration -// svc := neptunedata.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Neptunedata { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "neptune-db" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *Neptunedata { - svc := &Neptunedata{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-08-01", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Neptunedata operation and runs any -// custom request initialization. -func (c *Neptunedata) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/api.go deleted file mode 100644 index 943f1fa11f6a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/api.go +++ /dev/null @@ -1,3955 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package oam - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateLink = "CreateLink" - -// CreateLinkRequest generates a "aws/request.Request" representing the -// client's request for the CreateLink 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 CreateLink for more information on using the CreateLink -// 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 CreateLinkRequest method. -// req, resp := client.CreateLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/CreateLink -func (c *OAM) CreateLinkRequest(input *CreateLinkInput) (req *request.Request, output *CreateLinkOutput) { - op := &request.Operation{ - Name: opCreateLink, - HTTPMethod: "POST", - HTTPPath: "/CreateLink", - } - - if input == nil { - input = &CreateLinkInput{} - } - - output = &CreateLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLink API operation for CloudWatch Observability Access Manager. -// -// Creates a link between a source account and a sink that you have created -// in a monitoring account. -// -// Before you create a link, you must create a sink in the monitoring account -// and create a sink policy in that account. The sink policy must permit the -// source account to link to it. You can grant permission to source accounts -// by granting permission to an entire organization or to individual accounts. -// -// For more information, see CreateSink (https://docs.aws.amazon.com/OAM/latest/APIReference/API_CreateSink.html) -// and PutSinkPolicy (https://docs.aws.amazon.com/OAM/latest/APIReference/API_PutSinkPolicy.html). -// -// Each monitoring account can be linked to as many as 100,000 source accounts. -// -// Each source account can be linked to as many as five monitoring accounts. -// -// 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 CloudWatch Observability Access Manager's -// API operation CreateLink for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - ConflictException -// A resource was in an inconsistent state during an update or a deletion. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/CreateLink -func (c *OAM) CreateLink(input *CreateLinkInput) (*CreateLinkOutput, error) { - req, out := c.CreateLinkRequest(input) - return out, req.Send() -} - -// CreateLinkWithContext is the same as CreateLink with the addition of -// the ability to pass a context and additional request options. -// -// See CreateLink 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 *OAM) CreateLinkWithContext(ctx aws.Context, input *CreateLinkInput, opts ...request.Option) (*CreateLinkOutput, error) { - req, out := c.CreateLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSink = "CreateSink" - -// CreateSinkRequest generates a "aws/request.Request" representing the -// client's request for the CreateSink 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 CreateSink for more information on using the CreateSink -// 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 CreateSinkRequest method. -// req, resp := client.CreateSinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/CreateSink -func (c *OAM) CreateSinkRequest(input *CreateSinkInput) (req *request.Request, output *CreateSinkOutput) { - op := &request.Operation{ - Name: opCreateSink, - HTTPMethod: "POST", - HTTPPath: "/CreateSink", - } - - if input == nil { - input = &CreateSinkInput{} - } - - output = &CreateSinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSink API operation for CloudWatch Observability Access Manager. -// -// Use this to create a sink in the current account, so that it can be used -// as a monitoring account in CloudWatch cross-account observability. A sink -// is a resource that represents an attachment point in a monitoring account. -// Source accounts can link to the sink to send observability data. -// -// After you create a sink, you must create a sink policy that allows source -// accounts to attach to it. For more information, see PutSinkPolicy (https://docs.aws.amazon.com/OAM/latest/APIReference/API_PutSinkPolicy.html). -// -// Each account can contain one sink. If you delete a sink, you can then create -// a new one in that account. -// -// 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 CloudWatch Observability Access Manager's -// API operation CreateSink for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - ConflictException -// A resource was in an inconsistent state during an update or a deletion. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/CreateSink -func (c *OAM) CreateSink(input *CreateSinkInput) (*CreateSinkOutput, error) { - req, out := c.CreateSinkRequest(input) - return out, req.Send() -} - -// CreateSinkWithContext is the same as CreateSink with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSink 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 *OAM) CreateSinkWithContext(ctx aws.Context, input *CreateSinkInput, opts ...request.Option) (*CreateSinkOutput, error) { - req, out := c.CreateSinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteLink = "DeleteLink" - -// DeleteLinkRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLink 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 DeleteLink for more information on using the DeleteLink -// 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 DeleteLinkRequest method. -// req, resp := client.DeleteLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/DeleteLink -func (c *OAM) DeleteLinkRequest(input *DeleteLinkInput) (req *request.Request, output *DeleteLinkOutput) { - op := &request.Operation{ - Name: opDeleteLink, - HTTPMethod: "POST", - HTTPPath: "/DeleteLink", - } - - if input == nil { - input = &DeleteLinkInput{} - } - - output = &DeleteLinkOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteLink API operation for CloudWatch Observability Access Manager. -// -// Deletes a link between a monitoring account sink and a source account. You -// must run this operation in the source account. -// -// 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 CloudWatch Observability Access Manager's -// API operation DeleteLink for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/DeleteLink -func (c *OAM) DeleteLink(input *DeleteLinkInput) (*DeleteLinkOutput, error) { - req, out := c.DeleteLinkRequest(input) - return out, req.Send() -} - -// DeleteLinkWithContext is the same as DeleteLink with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteLink 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 *OAM) DeleteLinkWithContext(ctx aws.Context, input *DeleteLinkInput, opts ...request.Option) (*DeleteLinkOutput, error) { - req, out := c.DeleteLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSink = "DeleteSink" - -// DeleteSinkRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSink 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 DeleteSink for more information on using the DeleteSink -// 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 DeleteSinkRequest method. -// req, resp := client.DeleteSinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/DeleteSink -func (c *OAM) DeleteSinkRequest(input *DeleteSinkInput) (req *request.Request, output *DeleteSinkOutput) { - op := &request.Operation{ - Name: opDeleteSink, - HTTPMethod: "POST", - HTTPPath: "/DeleteSink", - } - - if input == nil { - input = &DeleteSinkInput{} - } - - output = &DeleteSinkOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSink API operation for CloudWatch Observability Access Manager. -// -// Deletes a sink. You must delete all links to a sink before you can delete -// that sink. -// -// 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 CloudWatch Observability Access Manager's -// API operation DeleteSink for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - ConflictException -// A resource was in an inconsistent state during an update or a deletion. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/DeleteSink -func (c *OAM) DeleteSink(input *DeleteSinkInput) (*DeleteSinkOutput, error) { - req, out := c.DeleteSinkRequest(input) - return out, req.Send() -} - -// DeleteSinkWithContext is the same as DeleteSink with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSink 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 *OAM) DeleteSinkWithContext(ctx aws.Context, input *DeleteSinkInput, opts ...request.Option) (*DeleteSinkOutput, error) { - req, out := c.DeleteSinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetLink = "GetLink" - -// GetLinkRequest generates a "aws/request.Request" representing the -// client's request for the GetLink 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 GetLink for more information on using the GetLink -// 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 GetLinkRequest method. -// req, resp := client.GetLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/GetLink -func (c *OAM) GetLinkRequest(input *GetLinkInput) (req *request.Request, output *GetLinkOutput) { - op := &request.Operation{ - Name: opGetLink, - HTTPMethod: "POST", - HTTPPath: "/GetLink", - } - - if input == nil { - input = &GetLinkInput{} - } - - output = &GetLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetLink API operation for CloudWatch Observability Access Manager. -// -// Returns complete information about one link. -// -// To use this operation, provide the link ARN. To retrieve a list of link ARNs, -// use ListLinks (https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListLinks.html). -// -// 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 CloudWatch Observability Access Manager's -// API operation GetLink for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/GetLink -func (c *OAM) GetLink(input *GetLinkInput) (*GetLinkOutput, error) { - req, out := c.GetLinkRequest(input) - return out, req.Send() -} - -// GetLinkWithContext is the same as GetLink with the addition of -// the ability to pass a context and additional request options. -// -// See GetLink 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 *OAM) GetLinkWithContext(ctx aws.Context, input *GetLinkInput, opts ...request.Option) (*GetLinkOutput, error) { - req, out := c.GetLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSink = "GetSink" - -// GetSinkRequest generates a "aws/request.Request" representing the -// client's request for the GetSink 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 GetSink for more information on using the GetSink -// 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 GetSinkRequest method. -// req, resp := client.GetSinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/GetSink -func (c *OAM) GetSinkRequest(input *GetSinkInput) (req *request.Request, output *GetSinkOutput) { - op := &request.Operation{ - Name: opGetSink, - HTTPMethod: "POST", - HTTPPath: "/GetSink", - } - - if input == nil { - input = &GetSinkInput{} - } - - output = &GetSinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSink API operation for CloudWatch Observability Access Manager. -// -// Returns complete information about one monitoring account sink. -// -// To use this operation, provide the sink ARN. To retrieve a list of sink ARNs, -// use ListSinks (https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListSinks.html). -// -// 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 CloudWatch Observability Access Manager's -// API operation GetSink for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/GetSink -func (c *OAM) GetSink(input *GetSinkInput) (*GetSinkOutput, error) { - req, out := c.GetSinkRequest(input) - return out, req.Send() -} - -// GetSinkWithContext is the same as GetSink with the addition of -// the ability to pass a context and additional request options. -// -// See GetSink 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 *OAM) GetSinkWithContext(ctx aws.Context, input *GetSinkInput, opts ...request.Option) (*GetSinkOutput, error) { - req, out := c.GetSinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSinkPolicy = "GetSinkPolicy" - -// GetSinkPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetSinkPolicy 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 GetSinkPolicy for more information on using the GetSinkPolicy -// 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 GetSinkPolicyRequest method. -// req, resp := client.GetSinkPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/GetSinkPolicy -func (c *OAM) GetSinkPolicyRequest(input *GetSinkPolicyInput) (req *request.Request, output *GetSinkPolicyOutput) { - op := &request.Operation{ - Name: opGetSinkPolicy, - HTTPMethod: "POST", - HTTPPath: "/GetSinkPolicy", - } - - if input == nil { - input = &GetSinkPolicyInput{} - } - - output = &GetSinkPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSinkPolicy API operation for CloudWatch Observability Access Manager. -// -// Returns the current sink policy attached to this sink. The sink policy specifies -// what accounts can attach to this sink as source accounts, and what types -// of data they can share. -// -// 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 CloudWatch Observability Access Manager's -// API operation GetSinkPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/GetSinkPolicy -func (c *OAM) GetSinkPolicy(input *GetSinkPolicyInput) (*GetSinkPolicyOutput, error) { - req, out := c.GetSinkPolicyRequest(input) - return out, req.Send() -} - -// GetSinkPolicyWithContext is the same as GetSinkPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetSinkPolicy 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 *OAM) GetSinkPolicyWithContext(ctx aws.Context, input *GetSinkPolicyInput, opts ...request.Option) (*GetSinkPolicyOutput, error) { - req, out := c.GetSinkPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAttachedLinks = "ListAttachedLinks" - -// ListAttachedLinksRequest generates a "aws/request.Request" representing the -// client's request for the ListAttachedLinks 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 ListAttachedLinks for more information on using the ListAttachedLinks -// 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 ListAttachedLinksRequest method. -// req, resp := client.ListAttachedLinksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/ListAttachedLinks -func (c *OAM) ListAttachedLinksRequest(input *ListAttachedLinksInput) (req *request.Request, output *ListAttachedLinksOutput) { - op := &request.Operation{ - Name: opListAttachedLinks, - HTTPMethod: "POST", - HTTPPath: "/ListAttachedLinks", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAttachedLinksInput{} - } - - output = &ListAttachedLinksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAttachedLinks API operation for CloudWatch Observability Access Manager. -// -// Returns a list of source account links that are linked to this monitoring -// account sink. -// -// To use this operation, provide the sink ARN. To retrieve a list of sink ARNs, -// use ListSinks (https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListSinks.html). -// -// To find a list of links for one source account, use ListLinks (https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListLinks.html). -// -// 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 CloudWatch Observability Access Manager's -// API operation ListAttachedLinks for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/ListAttachedLinks -func (c *OAM) ListAttachedLinks(input *ListAttachedLinksInput) (*ListAttachedLinksOutput, error) { - req, out := c.ListAttachedLinksRequest(input) - return out, req.Send() -} - -// ListAttachedLinksWithContext is the same as ListAttachedLinks with the addition of -// the ability to pass a context and additional request options. -// -// See ListAttachedLinks 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 *OAM) ListAttachedLinksWithContext(ctx aws.Context, input *ListAttachedLinksInput, opts ...request.Option) (*ListAttachedLinksOutput, error) { - req, out := c.ListAttachedLinksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAttachedLinksPages iterates over the pages of a ListAttachedLinks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAttachedLinks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAttachedLinks operation. -// pageNum := 0 -// err := client.ListAttachedLinksPages(params, -// func(page *oam.ListAttachedLinksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OAM) ListAttachedLinksPages(input *ListAttachedLinksInput, fn func(*ListAttachedLinksOutput, bool) bool) error { - return c.ListAttachedLinksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAttachedLinksPagesWithContext same as ListAttachedLinksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OAM) ListAttachedLinksPagesWithContext(ctx aws.Context, input *ListAttachedLinksInput, fn func(*ListAttachedLinksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAttachedLinksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAttachedLinksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAttachedLinksOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListLinks = "ListLinks" - -// ListLinksRequest generates a "aws/request.Request" representing the -// client's request for the ListLinks 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 ListLinks for more information on using the ListLinks -// 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 ListLinksRequest method. -// req, resp := client.ListLinksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/ListLinks -func (c *OAM) ListLinksRequest(input *ListLinksInput) (req *request.Request, output *ListLinksOutput) { - op := &request.Operation{ - Name: opListLinks, - HTTPMethod: "POST", - HTTPPath: "/ListLinks", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListLinksInput{} - } - - output = &ListLinksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLinks API operation for CloudWatch Observability Access Manager. -// -// Use this operation in a source account to return a list of links to monitoring -// account sinks that this source account has. -// -// To find a list of links for one monitoring account sink, use ListAttachedLinks -// (https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListAttachedLinks.html) -// from within the monitoring account. -// -// 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 CloudWatch Observability Access Manager's -// API operation ListLinks for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/ListLinks -func (c *OAM) ListLinks(input *ListLinksInput) (*ListLinksOutput, error) { - req, out := c.ListLinksRequest(input) - return out, req.Send() -} - -// ListLinksWithContext is the same as ListLinks with the addition of -// the ability to pass a context and additional request options. -// -// See ListLinks 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 *OAM) ListLinksWithContext(ctx aws.Context, input *ListLinksInput, opts ...request.Option) (*ListLinksOutput, error) { - req, out := c.ListLinksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListLinksPages iterates over the pages of a ListLinks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLinks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListLinks operation. -// pageNum := 0 -// err := client.ListLinksPages(params, -// func(page *oam.ListLinksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OAM) ListLinksPages(input *ListLinksInput, fn func(*ListLinksOutput, bool) bool) error { - return c.ListLinksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLinksPagesWithContext same as ListLinksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OAM) ListLinksPagesWithContext(ctx aws.Context, input *ListLinksInput, fn func(*ListLinksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLinksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLinksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListLinksOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSinks = "ListSinks" - -// ListSinksRequest generates a "aws/request.Request" representing the -// client's request for the ListSinks 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 ListSinks for more information on using the ListSinks -// 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 ListSinksRequest method. -// req, resp := client.ListSinksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/ListSinks -func (c *OAM) ListSinksRequest(input *ListSinksInput) (req *request.Request, output *ListSinksOutput) { - op := &request.Operation{ - Name: opListSinks, - HTTPMethod: "POST", - HTTPPath: "/ListSinks", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSinksInput{} - } - - output = &ListSinksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSinks API operation for CloudWatch Observability Access Manager. -// -// Use this operation in a monitoring account to return the list of sinks created -// in that account. -// -// 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 CloudWatch Observability Access Manager's -// API operation ListSinks for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/ListSinks -func (c *OAM) ListSinks(input *ListSinksInput) (*ListSinksOutput, error) { - req, out := c.ListSinksRequest(input) - return out, req.Send() -} - -// ListSinksWithContext is the same as ListSinks with the addition of -// the ability to pass a context and additional request options. -// -// See ListSinks 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 *OAM) ListSinksWithContext(ctx aws.Context, input *ListSinksInput, opts ...request.Option) (*ListSinksOutput, error) { - req, out := c.ListSinksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSinksPages iterates over the pages of a ListSinks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSinks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSinks operation. -// pageNum := 0 -// err := client.ListSinksPages(params, -// func(page *oam.ListSinksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OAM) ListSinksPages(input *ListSinksInput, fn func(*ListSinksOutput, bool) bool) error { - return c.ListSinksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSinksPagesWithContext same as ListSinksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OAM) ListSinksPagesWithContext(ctx aws.Context, input *ListSinksInput, fn func(*ListSinksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSinksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSinksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSinksOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/ListTagsForResource -func (c *OAM) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for CloudWatch Observability Access Manager. -// -// Displays the tags associated with a resource. Both sinks and links support -// tagging. -// -// 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 CloudWatch Observability Access Manager's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The value of a parameter in the request caused an error. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/ListTagsForResource -func (c *OAM) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *OAM) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutSinkPolicy = "PutSinkPolicy" - -// PutSinkPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutSinkPolicy 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 PutSinkPolicy for more information on using the PutSinkPolicy -// 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 PutSinkPolicyRequest method. -// req, resp := client.PutSinkPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/PutSinkPolicy -func (c *OAM) PutSinkPolicyRequest(input *PutSinkPolicyInput) (req *request.Request, output *PutSinkPolicyOutput) { - op := &request.Operation{ - Name: opPutSinkPolicy, - HTTPMethod: "POST", - HTTPPath: "/PutSinkPolicy", - } - - if input == nil { - input = &PutSinkPolicyInput{} - } - - output = &PutSinkPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutSinkPolicy API operation for CloudWatch Observability Access Manager. -// -// Creates or updates the resource policy that grants permissions to source -// accounts to link to the monitoring account sink. When you create a sink policy, -// you can grant permissions to all accounts in an organization or to individual -// accounts. -// -// You can also use a sink policy to limit the types of data that is shared. -// The three types that you can allow or deny are: -// -// - Metrics - Specify with AWS::CloudWatch::Metric -// -// - Log groups - Specify with AWS::Logs::LogGroup -// -// - Traces - Specify with AWS::XRay::Trace -// -// - Application Insights - Applications - Specify with AWS::ApplicationInsights::Application -// -// See the examples in this section to see how to specify permitted source accounts -// and data types. -// -// 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 CloudWatch Observability Access Manager's -// API operation PutSinkPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/PutSinkPolicy -func (c *OAM) PutSinkPolicy(input *PutSinkPolicyInput) (*PutSinkPolicyOutput, error) { - req, out := c.PutSinkPolicyRequest(input) - return out, req.Send() -} - -// PutSinkPolicyWithContext is the same as PutSinkPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutSinkPolicy 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 *OAM) PutSinkPolicyWithContext(ctx aws.Context, input *PutSinkPolicyInput, opts ...request.Option) (*PutSinkPolicyOutput, error) { - req, out := c.PutSinkPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/TagResource -func (c *OAM) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "PUT", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for CloudWatch Observability Access Manager. -// -// Assigns one or more tags (key-value pairs) to the specified resource. Both -// sinks and links can be tagged. -// -// Tags can help you organize and categorize your resources. You can also use -// them to scope user permissions by granting a user permission to access or -// change only resources with certain tag values. -// -// Tags don't have any semantic meaning to Amazon Web Services and are interpreted -// strictly as strings of characters. -// -// You can use the TagResource action with a resource that already has tags. -// If you specify a new tag key for the alarm, this tag is appended to the list -// of tags associated with the alarm. If you specify a tag key that is already -// associated with the alarm, the new tag value that you specify replaces the -// previous value for that tag. -// -// You can associate as many as 50 tags with a resource. -// -// Unlike tagging permissions in other Amazon Web Services services, to tag -// or untag links and sinks you must have the oam:ResourceTag permission. The -// iam:ResourceTag permission does not allow you to tag and untag links and -// sinks. -// -// 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 CloudWatch Observability Access Manager's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The value of a parameter in the request caused an error. -// -// - TooManyTagsException -// A resource can have no more than 50 tags. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/TagResource -func (c *OAM) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *OAM) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/UntagResource -func (c *OAM) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for CloudWatch Observability Access Manager. -// -// Removes one or more tags from the specified resource. -// -// Unlike tagging permissions in other Amazon Web Services services, to tag -// or untag links and sinks you must have the oam:ResourceTag permission. The -// iam:TagResource permission does not allow you to tag and untag links and -// sinks. -// -// 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 CloudWatch Observability Access Manager's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The value of a parameter in the request caused an error. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/UntagResource -func (c *OAM) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *OAM) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateLink = "UpdateLink" - -// UpdateLinkRequest generates a "aws/request.Request" representing the -// client's request for the UpdateLink 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 UpdateLink for more information on using the UpdateLink -// 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 UpdateLinkRequest method. -// req, resp := client.UpdateLinkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/UpdateLink -func (c *OAM) UpdateLinkRequest(input *UpdateLinkInput) (req *request.Request, output *UpdateLinkOutput) { - op := &request.Operation{ - Name: opUpdateLink, - HTTPMethod: "POST", - HTTPPath: "/UpdateLink", - } - - if input == nil { - input = &UpdateLinkInput{} - } - - output = &UpdateLinkOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateLink API operation for CloudWatch Observability Access Manager. -// -// Use this operation to change what types of data are shared from a source -// account to its linked monitoring account sink. You can't change the sink -// or change the monitoring account with this operation. -// -// To update the list of tags associated with the sink, use TagResource (https://docs.aws.amazon.com/OAM/latest/APIReference/API_TagResource.html). -// -// 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 CloudWatch Observability Access Manager's -// API operation UpdateLink for usage and error information. -// -// Returned Error Types: -// -// - InternalServiceFault -// Unexpected error while processing the request. Retry the request. -// -// - MissingRequiredParameterException -// A required parameter is missing from the request. -// -// - InvalidParameterException -// A parameter is specified incorrectly. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10/UpdateLink -func (c *OAM) UpdateLink(input *UpdateLinkInput) (*UpdateLinkOutput, error) { - req, out := c.UpdateLinkRequest(input) - return out, req.Send() -} - -// UpdateLinkWithContext is the same as UpdateLink with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateLink 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 *OAM) UpdateLinkWithContext(ctx aws.Context, input *UpdateLinkInput, opts ...request.Option) (*UpdateLinkOutput, error) { - req, out := c.UpdateLinkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// A resource was in an inconsistent state during an update or a deletion. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The name of the exception. - AmznErrorType *string `location:"header" locationName:"x-amzn-ErrorType" type:"string"` - - Message_ *string `locationName:"Message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateLinkInput struct { - _ struct{} `type:"structure"` - - // Specify a friendly human-readable name to use to identify this source account - // when you are viewing data from it in the monitoring account. - // - // You can use a custom label or use the following variables: - // - // * $AccountName is the name of the account - // - // * $AccountEmail is the globally unique email address of the account - // - // * $AccountEmailNoDomain is the email address of the account without the - // domain name - // - // LabelTemplate is a required field - LabelTemplate *string `min:"1" type:"string" required:"true"` - - // An array of strings that define which types of data that the source account - // shares with the monitoring account. - // - // ResourceTypes is a required field - ResourceTypes []*string `min:"1" type:"list" required:"true" enum:"ResourceType"` - - // The ARN of the sink to use to create this link. You can use ListSinks (https://docs.aws.amazon.com/OAM/latest/APIReference/API_ListSinks.html) - // to find the ARNs of sinks. - // - // For more information about sinks, see CreateSink (https://docs.aws.amazon.com/OAM/latest/APIReference/API_CreateSink.html). - // - // SinkIdentifier is a required field - SinkIdentifier *string `type:"string" required:"true"` - - // Assigns one or more tags (key-value pairs) to the link. - // - // Tags can help you organize and categorize your resources. You can also use - // them to scope user permissions by granting a user permission to access or - // change only resources with certain tag values. - // - // For more information about using tags to control access, see Controlling - // access to Amazon Web Services resources using tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html). - Tags map[string]*string `type:"map"` -} - -// 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 CreateLinkInput) 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 CreateLinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLinkInput"} - if s.LabelTemplate == nil { - invalidParams.Add(request.NewErrParamRequired("LabelTemplate")) - } - if s.LabelTemplate != nil && len(*s.LabelTemplate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LabelTemplate", 1)) - } - if s.ResourceTypes == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceTypes")) - } - if s.ResourceTypes != nil && len(s.ResourceTypes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceTypes", 1)) - } - if s.SinkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SinkIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLabelTemplate sets the LabelTemplate field's value. -func (s *CreateLinkInput) SetLabelTemplate(v string) *CreateLinkInput { - s.LabelTemplate = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *CreateLinkInput) SetResourceTypes(v []*string) *CreateLinkInput { - s.ResourceTypes = v - return s -} - -// SetSinkIdentifier sets the SinkIdentifier field's value. -func (s *CreateLinkInput) SetSinkIdentifier(v string) *CreateLinkInput { - s.SinkIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateLinkInput) SetTags(v map[string]*string) *CreateLinkInput { - s.Tags = v - return s -} - -type CreateLinkOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the link that is newly created. - Arn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the link - // ARN. - Id *string `type:"string"` - - // The label that you assigned to this link. If the labelTemplate includes variables, - // this field displays the variables resolved to their actual values. - Label *string `type:"string"` - - // The exact label template that you specified, with the variables not resolved. - LabelTemplate *string `type:"string"` - - // The resource types supported by this link. - ResourceTypes []*string `type:"list"` - - // The ARN of the sink that is used for this link. - SinkArn *string `type:"string"` - - // The tags assigned to the link. - Tags map[string]*string `type:"map"` -} - -// 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 CreateLinkOutput) 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 CreateLinkOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateLinkOutput) SetArn(v string) *CreateLinkOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateLinkOutput) SetId(v string) *CreateLinkOutput { - s.Id = &v - return s -} - -// SetLabel sets the Label field's value. -func (s *CreateLinkOutput) SetLabel(v string) *CreateLinkOutput { - s.Label = &v - return s -} - -// SetLabelTemplate sets the LabelTemplate field's value. -func (s *CreateLinkOutput) SetLabelTemplate(v string) *CreateLinkOutput { - s.LabelTemplate = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *CreateLinkOutput) SetResourceTypes(v []*string) *CreateLinkOutput { - s.ResourceTypes = v - return s -} - -// SetSinkArn sets the SinkArn field's value. -func (s *CreateLinkOutput) SetSinkArn(v string) *CreateLinkOutput { - s.SinkArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateLinkOutput) SetTags(v map[string]*string) *CreateLinkOutput { - s.Tags = v - return s -} - -type CreateSinkInput struct { - _ struct{} `type:"structure"` - - // A name for the sink. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Assigns one or more tags (key-value pairs) to the link. - // - // Tags can help you organize and categorize your resources. You can also use - // them to scope user permissions by granting a user permission to access or - // change only resources with certain tag values. - // - // For more information about using tags to control access, see Controlling - // access to Amazon Web Services resources using tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html). - Tags map[string]*string `type:"map"` -} - -// 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 CreateSinkInput) 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 CreateSinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSinkInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateSinkInput) SetName(v string) *CreateSinkInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSinkInput) SetTags(v map[string]*string) *CreateSinkInput { - s.Tags = v - return s -} - -type CreateSinkOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the sink that is newly created. - Arn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the sink - // ARN. - Id *string `type:"string"` - - // The name of the sink. - Name *string `type:"string"` - - // The tags assigned to the sink. - Tags map[string]*string `type:"map"` -} - -// 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 CreateSinkOutput) 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 CreateSinkOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateSinkOutput) SetArn(v string) *CreateSinkOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSinkOutput) SetId(v string) *CreateSinkOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSinkOutput) SetName(v string) *CreateSinkOutput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSinkOutput) SetTags(v map[string]*string) *CreateSinkOutput { - s.Tags = v - return s -} - -type DeleteLinkInput struct { - _ struct{} `type:"structure"` - - // The ARN of the link to delete. - // - // Identifier is a required field - Identifier *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 DeleteLinkInput) 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 DeleteLinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLinkInput"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteLinkInput) SetIdentifier(v string) *DeleteLinkInput { - s.Identifier = &v - return s -} - -type DeleteLinkOutput 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 DeleteLinkOutput) 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 DeleteLinkOutput) GoString() string { - return s.String() -} - -type DeleteSinkInput struct { - _ struct{} `type:"structure"` - - // The ARN of the sink to delete. - // - // Identifier is a required field - Identifier *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 DeleteSinkInput) 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 DeleteSinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSinkInput"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *DeleteSinkInput) SetIdentifier(v string) *DeleteSinkInput { - s.Identifier = &v - return s -} - -type DeleteSinkOutput 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 DeleteSinkOutput) 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 DeleteSinkOutput) GoString() string { - return s.String() -} - -type GetLinkInput struct { - _ struct{} `type:"structure"` - - // The ARN of the link to retrieve information for. - // - // Identifier is a required field - Identifier *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 GetLinkInput) 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 GetLinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetLinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetLinkInput"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetLinkInput) SetIdentifier(v string) *GetLinkInput { - s.Identifier = &v - return s -} - -type GetLinkOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the link. - Arn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the link - // ARN. - Id *string `type:"string"` - - // The label that you assigned to this link, with the variables resolved to - // their actual values. - Label *string `type:"string"` - - // The exact label template that was specified when the link was created, with - // the template variables not resolved. - LabelTemplate *string `type:"string"` - - // The resource types supported by this link. - ResourceTypes []*string `type:"list"` - - // The ARN of the sink that is used for this link. - SinkArn *string `type:"string"` - - // The tags assigned to the link. - Tags map[string]*string `type:"map"` -} - -// 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 GetLinkOutput) 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 GetLinkOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetLinkOutput) SetArn(v string) *GetLinkOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetLinkOutput) SetId(v string) *GetLinkOutput { - s.Id = &v - return s -} - -// SetLabel sets the Label field's value. -func (s *GetLinkOutput) SetLabel(v string) *GetLinkOutput { - s.Label = &v - return s -} - -// SetLabelTemplate sets the LabelTemplate field's value. -func (s *GetLinkOutput) SetLabelTemplate(v string) *GetLinkOutput { - s.LabelTemplate = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *GetLinkOutput) SetResourceTypes(v []*string) *GetLinkOutput { - s.ResourceTypes = v - return s -} - -// SetSinkArn sets the SinkArn field's value. -func (s *GetLinkOutput) SetSinkArn(v string) *GetLinkOutput { - s.SinkArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetLinkOutput) SetTags(v map[string]*string) *GetLinkOutput { - s.Tags = v - return s -} - -type GetSinkInput struct { - _ struct{} `type:"structure"` - - // The ARN of the sink to retrieve information for. - // - // Identifier is a required field - Identifier *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 GetSinkInput) 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 GetSinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSinkInput"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *GetSinkInput) SetIdentifier(v string) *GetSinkInput { - s.Identifier = &v - return s -} - -type GetSinkOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the sink. - Arn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the sink - // ARN. - Id *string `type:"string"` - - // The name of the sink. - Name *string `type:"string"` - - // The tags assigned to the sink. - Tags map[string]*string `type:"map"` -} - -// 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 GetSinkOutput) 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 GetSinkOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSinkOutput) SetArn(v string) *GetSinkOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSinkOutput) SetId(v string) *GetSinkOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetSinkOutput) SetName(v string) *GetSinkOutput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetSinkOutput) SetTags(v map[string]*string) *GetSinkOutput { - s.Tags = v - return s -} - -type GetSinkPolicyInput struct { - _ struct{} `type:"structure"` - - // The ARN of the sink to retrieve the policy of. - // - // SinkIdentifier is a required field - SinkIdentifier *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 GetSinkPolicyInput) 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 GetSinkPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSinkPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSinkPolicyInput"} - if s.SinkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SinkIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSinkIdentifier sets the SinkIdentifier field's value. -func (s *GetSinkPolicyInput) SetSinkIdentifier(v string) *GetSinkPolicyInput { - s.SinkIdentifier = &v - return s -} - -type GetSinkPolicyOutput struct { - _ struct{} `type:"structure"` - - // The policy that you specified, in JSON format. - Policy *string `type:"string"` - - // The ARN of the sink. - SinkArn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the sink - // ARN. - SinkId *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 GetSinkPolicyOutput) 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 GetSinkPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetSinkPolicyOutput) SetPolicy(v string) *GetSinkPolicyOutput { - s.Policy = &v - return s -} - -// SetSinkArn sets the SinkArn field's value. -func (s *GetSinkPolicyOutput) SetSinkArn(v string) *GetSinkPolicyOutput { - s.SinkArn = &v - return s -} - -// SetSinkId sets the SinkId field's value. -func (s *GetSinkPolicyOutput) SetSinkId(v string) *GetSinkPolicyOutput { - s.SinkId = &v - return s -} - -// Unexpected error while processing the request. Retry the request. -type InternalServiceFault struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The name of the exception. - AmznErrorType *string `location:"header" locationName:"x-amzn-ErrorType" type:"string"` - - Message_ *string `locationName:"Message" 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 InternalServiceFault) 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 InternalServiceFault) GoString() string { - return s.String() -} - -func newErrorInternalServiceFault(v protocol.ResponseMetadata) error { - return &InternalServiceFault{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServiceFault) Code() string { - return "InternalServiceFault" -} - -// Message returns the exception's message. -func (s *InternalServiceFault) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServiceFault) OrigErr() error { - return nil -} - -func (s *InternalServiceFault) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServiceFault) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServiceFault) RequestID() string { - return s.RespMetadata.RequestID -} - -// A parameter is specified incorrectly. -type InvalidParameterException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The name of the exception. - AmznErrorType *string `location:"header" locationName:"x-amzn-ErrorType" type:"string"` - - Message_ *string `locationName:"message" 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 InvalidParameterException) 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 InvalidParameterException) GoString() string { - return s.String() -} - -func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { - return &InvalidParameterException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidParameterException) Code() string { - return "InvalidParameterException" -} - -// Message returns the exception's message. -func (s *InvalidParameterException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidParameterException) OrigErr() error { - return nil -} - -func (s *InvalidParameterException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidParameterException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidParameterException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListAttachedLinksInput struct { - _ struct{} `type:"structure"` - - // Limits the number of returned links to the specified number. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. You received this token from - // a previous call. - NextToken *string `type:"string"` - - // The ARN of the sink that you want to retrieve links for. - // - // SinkIdentifier is a required field - SinkIdentifier *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 ListAttachedLinksInput) 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 ListAttachedLinksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAttachedLinksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAttachedLinksInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.SinkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SinkIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAttachedLinksInput) SetMaxResults(v int64) *ListAttachedLinksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAttachedLinksInput) SetNextToken(v string) *ListAttachedLinksInput { - s.NextToken = &v - return s -} - -// SetSinkIdentifier sets the SinkIdentifier field's value. -func (s *ListAttachedLinksInput) SetSinkIdentifier(v string) *ListAttachedLinksInput { - s.SinkIdentifier = &v - return s -} - -// A structure that contains information about one link attached to this monitoring -// account sink. -type ListAttachedLinksItem struct { - _ struct{} `type:"structure"` - - // The label that was assigned to this link at creation, with the variables - // resolved to their actual values. - Label *string `type:"string"` - - // The ARN of the link. - LinkArn *string `type:"string"` - - // The resource types supported by this link. - ResourceTypes []*string `type:"list"` -} - -// 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 ListAttachedLinksItem) 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 ListAttachedLinksItem) GoString() string { - return s.String() -} - -// SetLabel sets the Label field's value. -func (s *ListAttachedLinksItem) SetLabel(v string) *ListAttachedLinksItem { - s.Label = &v - return s -} - -// SetLinkArn sets the LinkArn field's value. -func (s *ListAttachedLinksItem) SetLinkArn(v string) *ListAttachedLinksItem { - s.LinkArn = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *ListAttachedLinksItem) SetResourceTypes(v []*string) *ListAttachedLinksItem { - s.ResourceTypes = v - return s -} - -type ListAttachedLinksOutput struct { - _ struct{} `type:"structure"` - - // An array of structures that contain the information about the attached links. - // - // Items is a required field - Items []*ListAttachedLinksItem `type:"list" required:"true"` - - // The token to use when requesting the next set of links. - NextToken *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 ListAttachedLinksOutput) 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 ListAttachedLinksOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListAttachedLinksOutput) SetItems(v []*ListAttachedLinksItem) *ListAttachedLinksOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAttachedLinksOutput) SetNextToken(v string) *ListAttachedLinksOutput { - s.NextToken = &v - return s -} - -type ListLinksInput struct { - _ struct{} `type:"structure"` - - // Limits the number of returned links to the specified number. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. You received this token from - // a previous call. - NextToken *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 ListLinksInput) 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 ListLinksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListLinksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLinksInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListLinksInput) SetMaxResults(v int64) *ListLinksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLinksInput) SetNextToken(v string) *ListLinksInput { - s.NextToken = &v - return s -} - -// A structure that contains information about one of this source account's -// links to a monitoring account. -type ListLinksItem struct { - _ struct{} `type:"structure"` - - // The ARN of the link. - Arn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the link - // ARN. - Id *string `type:"string"` - - // The label that was assigned to this link at creation, with the variables - // resolved to their actual values. - Label *string `type:"string"` - - // The resource types supported by this link. - ResourceTypes []*string `type:"list"` - - // The ARN of the sink that this link is attached to. - SinkArn *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 ListLinksItem) 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 ListLinksItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListLinksItem) SetArn(v string) *ListLinksItem { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ListLinksItem) SetId(v string) *ListLinksItem { - s.Id = &v - return s -} - -// SetLabel sets the Label field's value. -func (s *ListLinksItem) SetLabel(v string) *ListLinksItem { - s.Label = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *ListLinksItem) SetResourceTypes(v []*string) *ListLinksItem { - s.ResourceTypes = v - return s -} - -// SetSinkArn sets the SinkArn field's value. -func (s *ListLinksItem) SetSinkArn(v string) *ListLinksItem { - s.SinkArn = &v - return s -} - -type ListLinksOutput struct { - _ struct{} `type:"structure"` - - // An array of structures that contain the information about the returned links. - // - // Items is a required field - Items []*ListLinksItem `type:"list" required:"true"` - - // The token to use when requesting the next set of links. - NextToken *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 ListLinksOutput) 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 ListLinksOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListLinksOutput) SetItems(v []*ListLinksItem) *ListLinksOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLinksOutput) SetNextToken(v string) *ListLinksOutput { - s.NextToken = &v - return s -} - -type ListSinksInput struct { - _ struct{} `type:"structure"` - - // Limits the number of returned links to the specified number. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of items to return. You received this token from - // a previous call. - NextToken *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 ListSinksInput) 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 ListSinksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSinksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSinksInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSinksInput) SetMaxResults(v int64) *ListSinksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSinksInput) SetNextToken(v string) *ListSinksInput { - s.NextToken = &v - return s -} - -// A structure that contains information about one of this monitoring account's -// sinks. -type ListSinksItem struct { - _ struct{} `type:"structure"` - - // The ARN of the sink. - Arn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the sink - // ARN. - Id *string `type:"string"` - - // The name of the sink. - Name *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 ListSinksItem) 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 ListSinksItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListSinksItem) SetArn(v string) *ListSinksItem { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ListSinksItem) SetId(v string) *ListSinksItem { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListSinksItem) SetName(v string) *ListSinksItem { - s.Name = &v - return s -} - -type ListSinksOutput struct { - _ struct{} `type:"structure"` - - // An array of structures that contain the information about the returned sinks. - // - // Items is a required field - Items []*ListSinksItem `type:"list" required:"true"` - - // The token to use when requesting the next set of sinks. - NextToken *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 ListSinksOutput) 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 ListSinksOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListSinksOutput) SetItems(v []*ListSinksItem) *ListSinksOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSinksOutput) SetNextToken(v string) *ListSinksOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource that you want to view tags for. - // - // The ARN format of a sink is arn:aws:oam:Region:account-id:sink/sink-id - // - // The ARN format of a link is arn:aws:oam:Region:account-id:link/link-id - // - // For more information about ARN format, see CloudWatch Logs resources and - // operations (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html). - // - // Unlike tagging permissions in other Amazon Web Services services, to retrieve - // the list of tags for links or sinks you must have the oam:RequestTag permission. - // The aws:ReguestTag permission does not allow you to tag and untag links and - // sinks. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The list of tags associated with the requested resource.> - Tags map[string]*string `type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// A required parameter is missing from the request. -type MissingRequiredParameterException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The name of the exception. - AmznErrorType *string `location:"header" locationName:"x-amzn-ErrorType" type:"string"` - - Message_ *string `locationName:"message" 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 MissingRequiredParameterException) 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 MissingRequiredParameterException) GoString() string { - return s.String() -} - -func newErrorMissingRequiredParameterException(v protocol.ResponseMetadata) error { - return &MissingRequiredParameterException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MissingRequiredParameterException) Code() string { - return "MissingRequiredParameterException" -} - -// Message returns the exception's message. -func (s *MissingRequiredParameterException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MissingRequiredParameterException) OrigErr() error { - return nil -} - -func (s *MissingRequiredParameterException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MissingRequiredParameterException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MissingRequiredParameterException) RequestID() string { - return s.RespMetadata.RequestID -} - -type PutSinkPolicyInput struct { - _ struct{} `type:"structure"` - - // The JSON policy to use. If you are updating an existing policy, the entire - // existing policy is replaced by what you specify here. - // - // The policy must be in JSON string format with quotation marks escaped and - // no newlines. - // - // For examples of different types of policies, see the Examples section on - // this page. - // - // Policy is a required field - Policy *string `type:"string" required:"true"` - - // The ARN of the sink to attach this policy to. - // - // SinkIdentifier is a required field - SinkIdentifier *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 PutSinkPolicyInput) 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 PutSinkPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutSinkPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutSinkPolicyInput"} - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.SinkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SinkIdentifier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicy sets the Policy field's value. -func (s *PutSinkPolicyInput) SetPolicy(v string) *PutSinkPolicyInput { - s.Policy = &v - return s -} - -// SetSinkIdentifier sets the SinkIdentifier field's value. -func (s *PutSinkPolicyInput) SetSinkIdentifier(v string) *PutSinkPolicyInput { - s.SinkIdentifier = &v - return s -} - -type PutSinkPolicyOutput struct { - _ struct{} `type:"structure"` - - // The policy that you specified. - Policy *string `type:"string"` - - // The ARN of the sink. - SinkArn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the sink - // ARN. - SinkId *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 PutSinkPolicyOutput) 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 PutSinkPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *PutSinkPolicyOutput) SetPolicy(v string) *PutSinkPolicyOutput { - s.Policy = &v - return s -} - -// SetSinkArn sets the SinkArn field's value. -func (s *PutSinkPolicyOutput) SetSinkArn(v string) *PutSinkPolicyOutput { - s.SinkArn = &v - return s -} - -// SetSinkId sets the SinkId field's value. -func (s *PutSinkPolicyOutput) SetSinkId(v string) *PutSinkPolicyOutput { - s.SinkId = &v - return s -} - -// The request references a resource that does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The name of the exception. - AmznErrorType *string `location:"header" locationName:"x-amzn-ErrorType" type:"string"` - - Message_ *string `locationName:"Message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request would cause a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The name of the exception. - AmznErrorType *string `location:"header" locationName:"x-amzn-ErrorType" type:"string"` - - Message_ *string `locationName:"Message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource that you're adding tags to. - // - // The ARN format of a sink is arn:aws:oam:Region:account-id:sink/sink-id - // - // The ARN format of a link is arn:aws:oam:Region:account-id:link/link-id - // - // For more information about ARN format, see CloudWatch Logs resources and - // operations (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html). - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - - // The list of key-value pairs to associate with the resource. - // - // Tags is a required field - Tags map[string]*string `type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// A resource can have no more than 50 tags. -type TooManyTagsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 TooManyTagsException) 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 TooManyTagsException) GoString() string { - return s.String() -} - -func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { - return &TooManyTagsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyTagsException) Code() string { - return "TooManyTagsException" -} - -// Message returns the exception's message. -func (s *TooManyTagsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyTagsException) OrigErr() error { - return nil -} - -func (s *TooManyTagsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyTagsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyTagsException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource that you're removing tags from. - // - // The ARN format of a sink is arn:aws:oam:Region:account-id:sink/sink-id - // - // The ARN format of a link is arn:aws:oam:Region:account-id:link/link-id - // - // For more information about ARN format, see CloudWatch Logs resources and - // operations (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html). - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - - // The list of tag keys to remove from the resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateLinkInput struct { - _ struct{} `type:"structure"` - - // The ARN of the link that you want to update. - // - // Identifier is a required field - Identifier *string `type:"string" required:"true"` - - // An array of strings that define which types of data that the source account - // will send to the monitoring account. - // - // Your input here replaces the current set of data types that are shared. - // - // ResourceTypes is a required field - ResourceTypes []*string `min:"1" type:"list" required:"true" enum:"ResourceType"` -} - -// 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 UpdateLinkInput) 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 UpdateLinkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateLinkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateLinkInput"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.ResourceTypes == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceTypes")) - } - if s.ResourceTypes != nil && len(s.ResourceTypes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceTypes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *UpdateLinkInput) SetIdentifier(v string) *UpdateLinkInput { - s.Identifier = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *UpdateLinkInput) SetResourceTypes(v []*string) *UpdateLinkInput { - s.ResourceTypes = v - return s -} - -type UpdateLinkOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the link that you have updated. - Arn *string `type:"string"` - - // The random ID string that Amazon Web Services generated as part of the sink - // ARN. - Id *string `type:"string"` - - // The label assigned to this link, with the variables resolved to their actual - // values. - Label *string `type:"string"` - - // The exact label template that was specified when the link was created, with - // the template variables not resolved. - LabelTemplate *string `min:"1" type:"string"` - - // The resource types now supported by this link. - ResourceTypes []*string `type:"list"` - - // The ARN of the sink that is used for this link. - SinkArn *string `type:"string"` - - // The tags assigned to the link. - Tags map[string]*string `type:"map"` -} - -// 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 UpdateLinkOutput) 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 UpdateLinkOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateLinkOutput) SetArn(v string) *UpdateLinkOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateLinkOutput) SetId(v string) *UpdateLinkOutput { - s.Id = &v - return s -} - -// SetLabel sets the Label field's value. -func (s *UpdateLinkOutput) SetLabel(v string) *UpdateLinkOutput { - s.Label = &v - return s -} - -// SetLabelTemplate sets the LabelTemplate field's value. -func (s *UpdateLinkOutput) SetLabelTemplate(v string) *UpdateLinkOutput { - s.LabelTemplate = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *UpdateLinkOutput) SetResourceTypes(v []*string) *UpdateLinkOutput { - s.ResourceTypes = v - return s -} - -// SetSinkArn sets the SinkArn field's value. -func (s *UpdateLinkOutput) SetSinkArn(v string) *UpdateLinkOutput { - s.SinkArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateLinkOutput) SetTags(v map[string]*string) *UpdateLinkOutput { - s.Tags = v - return s -} - -// The value of a parameter in the request caused an error. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // ResourceTypeAwsCloudWatchMetric is a ResourceType enum value - ResourceTypeAwsCloudWatchMetric = "AWS::CloudWatch::Metric" - - // ResourceTypeAwsLogsLogGroup is a ResourceType enum value - ResourceTypeAwsLogsLogGroup = "AWS::Logs::LogGroup" - - // ResourceTypeAwsXrayTrace is a ResourceType enum value - ResourceTypeAwsXrayTrace = "AWS::XRay::Trace" - - // ResourceTypeAwsApplicationInsightsApplication is a ResourceType enum value - ResourceTypeAwsApplicationInsightsApplication = "AWS::ApplicationInsights::Application" -) - -// ResourceType_Values returns all elements of the ResourceType enum -func ResourceType_Values() []string { - return []string{ - ResourceTypeAwsCloudWatchMetric, - ResourceTypeAwsLogsLogGroup, - ResourceTypeAwsXrayTrace, - ResourceTypeAwsApplicationInsightsApplication, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/doc.go deleted file mode 100644 index aee505bb2444..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/doc.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package oam provides the client and types for making API -// requests to CloudWatch Observability Access Manager. -// -// Use Amazon CloudWatch Observability Access Manager to create and manage links -// between source accounts and monitoring accounts by using CloudWatch cross-account -// observability. With CloudWatch cross-account observability, you can monitor -// and troubleshoot applications that span multiple accounts within a Region. -// Seamlessly search, visualize, and analyze your metrics, logs, traces, and -// Application Insights applications in any of the linked accounts without account -// boundaries. -// -// Set up one or more Amazon Web Services accounts as monitoring accounts and -// link them with multiple source accounts. A monitoring account is a central -// Amazon Web Services account that can view and interact with observability -// data generated from source accounts. A source account is an individual Amazon -// Web Services account that generates observability data for the resources -// that reside in it. Source accounts share their observability data with the -// monitoring account. The shared observability data can include metrics in -// Amazon CloudWatch, logs in Amazon CloudWatch Logs, traces in X-Ray, and applications -// in Amazon CloudWatch Application Insights. -// -// See https://docs.aws.amazon.com/goto/WebAPI/oam-2022-06-10 for more information on this service. -// -// See oam package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/oam/ -// -// # Using the Client -// -// To contact CloudWatch Observability Access Manager with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the CloudWatch Observability Access Manager client OAM for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/oam/#New -package oam diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/errors.go deleted file mode 100644 index 4d44c4b88a45..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/errors.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package oam - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // A resource was in an inconsistent state during an update or a deletion. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServiceFault for service response error code - // "InternalServiceFault". - // - // Unexpected error while processing the request. Retry the request. - ErrCodeInternalServiceFault = "InternalServiceFault" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // A parameter is specified incorrectly. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeMissingRequiredParameterException for service response error code - // "MissingRequiredParameterException". - // - // A required parameter is missing from the request. - ErrCodeMissingRequiredParameterException = "MissingRequiredParameterException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request references a resource that does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request would cause a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTagsException". - // - // A resource can have no more than 50 tags. - ErrCodeTooManyTagsException = "TooManyTagsException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The value of a parameter in the request caused an error. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "ConflictException": newErrorConflictException, - "InternalServiceFault": newErrorInternalServiceFault, - "InvalidParameterException": newErrorInvalidParameterException, - "MissingRequiredParameterException": newErrorMissingRequiredParameterException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "TooManyTagsException": newErrorTooManyTagsException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/oamiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/oamiface/interface.go deleted file mode 100644 index c080781a6e3c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/oamiface/interface.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package oamiface provides an interface to enable mocking the CloudWatch Observability Access Manager service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package oamiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam" -) - -// OAMAPI provides an interface to enable mocking the -// oam.OAM service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // CloudWatch Observability Access Manager. -// func myFunc(svc oamiface.OAMAPI) bool { -// // Make svc.CreateLink request -// } -// -// func main() { -// sess := session.New() -// svc := oam.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockOAMClient struct { -// oamiface.OAMAPI -// } -// func (m *mockOAMClient) CreateLink(input *oam.CreateLinkInput) (*oam.CreateLinkOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockOAMClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type OAMAPI interface { - CreateLink(*oam.CreateLinkInput) (*oam.CreateLinkOutput, error) - CreateLinkWithContext(aws.Context, *oam.CreateLinkInput, ...request.Option) (*oam.CreateLinkOutput, error) - CreateLinkRequest(*oam.CreateLinkInput) (*request.Request, *oam.CreateLinkOutput) - - CreateSink(*oam.CreateSinkInput) (*oam.CreateSinkOutput, error) - CreateSinkWithContext(aws.Context, *oam.CreateSinkInput, ...request.Option) (*oam.CreateSinkOutput, error) - CreateSinkRequest(*oam.CreateSinkInput) (*request.Request, *oam.CreateSinkOutput) - - DeleteLink(*oam.DeleteLinkInput) (*oam.DeleteLinkOutput, error) - DeleteLinkWithContext(aws.Context, *oam.DeleteLinkInput, ...request.Option) (*oam.DeleteLinkOutput, error) - DeleteLinkRequest(*oam.DeleteLinkInput) (*request.Request, *oam.DeleteLinkOutput) - - DeleteSink(*oam.DeleteSinkInput) (*oam.DeleteSinkOutput, error) - DeleteSinkWithContext(aws.Context, *oam.DeleteSinkInput, ...request.Option) (*oam.DeleteSinkOutput, error) - DeleteSinkRequest(*oam.DeleteSinkInput) (*request.Request, *oam.DeleteSinkOutput) - - GetLink(*oam.GetLinkInput) (*oam.GetLinkOutput, error) - GetLinkWithContext(aws.Context, *oam.GetLinkInput, ...request.Option) (*oam.GetLinkOutput, error) - GetLinkRequest(*oam.GetLinkInput) (*request.Request, *oam.GetLinkOutput) - - GetSink(*oam.GetSinkInput) (*oam.GetSinkOutput, error) - GetSinkWithContext(aws.Context, *oam.GetSinkInput, ...request.Option) (*oam.GetSinkOutput, error) - GetSinkRequest(*oam.GetSinkInput) (*request.Request, *oam.GetSinkOutput) - - GetSinkPolicy(*oam.GetSinkPolicyInput) (*oam.GetSinkPolicyOutput, error) - GetSinkPolicyWithContext(aws.Context, *oam.GetSinkPolicyInput, ...request.Option) (*oam.GetSinkPolicyOutput, error) - GetSinkPolicyRequest(*oam.GetSinkPolicyInput) (*request.Request, *oam.GetSinkPolicyOutput) - - ListAttachedLinks(*oam.ListAttachedLinksInput) (*oam.ListAttachedLinksOutput, error) - ListAttachedLinksWithContext(aws.Context, *oam.ListAttachedLinksInput, ...request.Option) (*oam.ListAttachedLinksOutput, error) - ListAttachedLinksRequest(*oam.ListAttachedLinksInput) (*request.Request, *oam.ListAttachedLinksOutput) - - ListAttachedLinksPages(*oam.ListAttachedLinksInput, func(*oam.ListAttachedLinksOutput, bool) bool) error - ListAttachedLinksPagesWithContext(aws.Context, *oam.ListAttachedLinksInput, func(*oam.ListAttachedLinksOutput, bool) bool, ...request.Option) error - - ListLinks(*oam.ListLinksInput) (*oam.ListLinksOutput, error) - ListLinksWithContext(aws.Context, *oam.ListLinksInput, ...request.Option) (*oam.ListLinksOutput, error) - ListLinksRequest(*oam.ListLinksInput) (*request.Request, *oam.ListLinksOutput) - - ListLinksPages(*oam.ListLinksInput, func(*oam.ListLinksOutput, bool) bool) error - ListLinksPagesWithContext(aws.Context, *oam.ListLinksInput, func(*oam.ListLinksOutput, bool) bool, ...request.Option) error - - ListSinks(*oam.ListSinksInput) (*oam.ListSinksOutput, error) - ListSinksWithContext(aws.Context, *oam.ListSinksInput, ...request.Option) (*oam.ListSinksOutput, error) - ListSinksRequest(*oam.ListSinksInput) (*request.Request, *oam.ListSinksOutput) - - ListSinksPages(*oam.ListSinksInput, func(*oam.ListSinksOutput, bool) bool) error - ListSinksPagesWithContext(aws.Context, *oam.ListSinksInput, func(*oam.ListSinksOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*oam.ListTagsForResourceInput) (*oam.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *oam.ListTagsForResourceInput, ...request.Option) (*oam.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*oam.ListTagsForResourceInput) (*request.Request, *oam.ListTagsForResourceOutput) - - PutSinkPolicy(*oam.PutSinkPolicyInput) (*oam.PutSinkPolicyOutput, error) - PutSinkPolicyWithContext(aws.Context, *oam.PutSinkPolicyInput, ...request.Option) (*oam.PutSinkPolicyOutput, error) - PutSinkPolicyRequest(*oam.PutSinkPolicyInput) (*request.Request, *oam.PutSinkPolicyOutput) - - TagResource(*oam.TagResourceInput) (*oam.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *oam.TagResourceInput, ...request.Option) (*oam.TagResourceOutput, error) - TagResourceRequest(*oam.TagResourceInput) (*request.Request, *oam.TagResourceOutput) - - UntagResource(*oam.UntagResourceInput) (*oam.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *oam.UntagResourceInput, ...request.Option) (*oam.UntagResourceOutput, error) - UntagResourceRequest(*oam.UntagResourceInput) (*request.Request, *oam.UntagResourceOutput) - - UpdateLink(*oam.UpdateLinkInput) (*oam.UpdateLinkOutput, error) - UpdateLinkWithContext(aws.Context, *oam.UpdateLinkInput, ...request.Option) (*oam.UpdateLinkOutput, error) - UpdateLinkRequest(*oam.UpdateLinkInput) (*request.Request, *oam.UpdateLinkOutput) -} - -var _ OAMAPI = (*oam.OAM)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/service.go deleted file mode 100644 index 9edbadb4bd89..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/oam/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package oam - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// OAM provides the API operation methods for making requests to -// CloudWatch Observability Access Manager. See this package's package overview docs -// for details on the service. -// -// OAM methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OAM struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "OAM" // Name of service. - EndpointsID = "oam" // ID to lookup a service endpoint with. - ServiceID = "OAM" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the OAM client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a OAM client from just a session. -// svc := oam.New(mySession) -// -// // Create a OAM client with additional configuration -// svc := oam.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *OAM { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "oam" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *OAM { - svc := &OAM{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-06-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a OAM operation and runs any -// custom request initialization. -func (c *OAM) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/api.go deleted file mode 100644 index eebdfbe386e9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/api.go +++ /dev/null @@ -1,27623 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package omics - -import ( - "fmt" - "io" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opAbortMultipartReadSetUpload = "AbortMultipartReadSetUpload" - -// AbortMultipartReadSetUploadRequest generates a "aws/request.Request" representing the -// client's request for the AbortMultipartReadSetUpload 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 AbortMultipartReadSetUpload for more information on using the AbortMultipartReadSetUpload -// 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 AbortMultipartReadSetUploadRequest method. -// req, resp := client.AbortMultipartReadSetUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/AbortMultipartReadSetUpload -func (c *Omics) AbortMultipartReadSetUploadRequest(input *AbortMultipartReadSetUploadInput) (req *request.Request, output *AbortMultipartReadSetUploadOutput) { - op := &request.Operation{ - Name: opAbortMultipartReadSetUpload, - HTTPMethod: "DELETE", - HTTPPath: "/sequencestore/{sequenceStoreId}/upload/{uploadId}/abort", - } - - if input == nil { - input = &AbortMultipartReadSetUploadInput{} - } - - output = &AbortMultipartReadSetUploadOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// AbortMultipartReadSetUpload API operation for Amazon Omics. -// -// Stops a multipart upload. -// -// 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 Omics's -// API operation AbortMultipartReadSetUpload for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - NotSupportedOperationException -// The operation is not supported by Amazon Omics, or the API does not exist. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/AbortMultipartReadSetUpload -func (c *Omics) AbortMultipartReadSetUpload(input *AbortMultipartReadSetUploadInput) (*AbortMultipartReadSetUploadOutput, error) { - req, out := c.AbortMultipartReadSetUploadRequest(input) - return out, req.Send() -} - -// AbortMultipartReadSetUploadWithContext is the same as AbortMultipartReadSetUpload with the addition of -// the ability to pass a context and additional request options. -// -// See AbortMultipartReadSetUpload 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 *Omics) AbortMultipartReadSetUploadWithContext(ctx aws.Context, input *AbortMultipartReadSetUploadInput, opts ...request.Option) (*AbortMultipartReadSetUploadOutput, error) { - req, out := c.AbortMultipartReadSetUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAcceptShare = "AcceptShare" - -// AcceptShareRequest generates a "aws/request.Request" representing the -// client's request for the AcceptShare 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 AcceptShare for more information on using the AcceptShare -// 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 AcceptShareRequest method. -// req, resp := client.AcceptShareRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/AcceptShare -func (c *Omics) AcceptShareRequest(input *AcceptShareInput) (req *request.Request, output *AcceptShareOutput) { - op := &request.Operation{ - Name: opAcceptShare, - HTTPMethod: "POST", - HTTPPath: "/share/{shareId}", - } - - if input == nil { - input = &AcceptShareInput{} - } - - output = &AcceptShareOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// AcceptShare API operation for Amazon Omics. -// -// Accepts a share for an analytics store. -// -// 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 Omics's -// API operation AcceptShare for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/AcceptShare -func (c *Omics) AcceptShare(input *AcceptShareInput) (*AcceptShareOutput, error) { - req, out := c.AcceptShareRequest(input) - return out, req.Send() -} - -// AcceptShareWithContext is the same as AcceptShare with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptShare 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 *Omics) AcceptShareWithContext(ctx aws.Context, input *AcceptShareInput, opts ...request.Option) (*AcceptShareOutput, error) { - req, out := c.AcceptShareRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchDeleteReadSet = "BatchDeleteReadSet" - -// BatchDeleteReadSetRequest generates a "aws/request.Request" representing the -// client's request for the BatchDeleteReadSet 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 BatchDeleteReadSet for more information on using the BatchDeleteReadSet -// 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 BatchDeleteReadSetRequest method. -// req, resp := client.BatchDeleteReadSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/BatchDeleteReadSet -func (c *Omics) BatchDeleteReadSetRequest(input *BatchDeleteReadSetInput) (req *request.Request, output *BatchDeleteReadSetOutput) { - op := &request.Operation{ - Name: opBatchDeleteReadSet, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/readset/batch/delete", - } - - if input == nil { - input = &BatchDeleteReadSetInput{} - } - - output = &BatchDeleteReadSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// BatchDeleteReadSet API operation for Amazon Omics. -// -// Deletes one or more read sets. -// -// 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 Omics's -// API operation BatchDeleteReadSet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/BatchDeleteReadSet -func (c *Omics) BatchDeleteReadSet(input *BatchDeleteReadSetInput) (*BatchDeleteReadSetOutput, error) { - req, out := c.BatchDeleteReadSetRequest(input) - return out, req.Send() -} - -// BatchDeleteReadSetWithContext is the same as BatchDeleteReadSet with the addition of -// the ability to pass a context and additional request options. -// -// See BatchDeleteReadSet 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 *Omics) BatchDeleteReadSetWithContext(ctx aws.Context, input *BatchDeleteReadSetInput, opts ...request.Option) (*BatchDeleteReadSetOutput, error) { - req, out := c.BatchDeleteReadSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelAnnotationImportJob = "CancelAnnotationImportJob" - -// CancelAnnotationImportJobRequest generates a "aws/request.Request" representing the -// client's request for the CancelAnnotationImportJob 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 CancelAnnotationImportJob for more information on using the CancelAnnotationImportJob -// 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 CancelAnnotationImportJobRequest method. -// req, resp := client.CancelAnnotationImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CancelAnnotationImportJob -func (c *Omics) CancelAnnotationImportJobRequest(input *CancelAnnotationImportJobInput) (req *request.Request, output *CancelAnnotationImportJobOutput) { - op := &request.Operation{ - Name: opCancelAnnotationImportJob, - HTTPMethod: "DELETE", - HTTPPath: "/import/annotation/{jobId}", - } - - if input == nil { - input = &CancelAnnotationImportJobInput{} - } - - output = &CancelAnnotationImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CancelAnnotationImportJob API operation for Amazon Omics. -// -// Cancels an annotation import job. -// -// 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 Omics's -// API operation CancelAnnotationImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CancelAnnotationImportJob -func (c *Omics) CancelAnnotationImportJob(input *CancelAnnotationImportJobInput) (*CancelAnnotationImportJobOutput, error) { - req, out := c.CancelAnnotationImportJobRequest(input) - return out, req.Send() -} - -// CancelAnnotationImportJobWithContext is the same as CancelAnnotationImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See CancelAnnotationImportJob 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 *Omics) CancelAnnotationImportJobWithContext(ctx aws.Context, input *CancelAnnotationImportJobInput, opts ...request.Option) (*CancelAnnotationImportJobOutput, error) { - req, out := c.CancelAnnotationImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelRun = "CancelRun" - -// CancelRunRequest generates a "aws/request.Request" representing the -// client's request for the CancelRun 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 CancelRun for more information on using the CancelRun -// 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 CancelRunRequest method. -// req, resp := client.CancelRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CancelRun -func (c *Omics) CancelRunRequest(input *CancelRunInput) (req *request.Request, output *CancelRunOutput) { - op := &request.Operation{ - Name: opCancelRun, - HTTPMethod: "POST", - HTTPPath: "/run/{id}/cancel", - } - - if input == nil { - input = &CancelRunInput{} - } - - output = &CancelRunOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CancelRun API operation for Amazon Omics. -// -// Cancels a run. -// -// 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 Omics's -// API operation CancelRun for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CancelRun -func (c *Omics) CancelRun(input *CancelRunInput) (*CancelRunOutput, error) { - req, out := c.CancelRunRequest(input) - return out, req.Send() -} - -// CancelRunWithContext is the same as CancelRun with the addition of -// the ability to pass a context and additional request options. -// -// See CancelRun 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 *Omics) CancelRunWithContext(ctx aws.Context, input *CancelRunInput, opts ...request.Option) (*CancelRunOutput, error) { - req, out := c.CancelRunRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelVariantImportJob = "CancelVariantImportJob" - -// CancelVariantImportJobRequest generates a "aws/request.Request" representing the -// client's request for the CancelVariantImportJob 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 CancelVariantImportJob for more information on using the CancelVariantImportJob -// 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 CancelVariantImportJobRequest method. -// req, resp := client.CancelVariantImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CancelVariantImportJob -func (c *Omics) CancelVariantImportJobRequest(input *CancelVariantImportJobInput) (req *request.Request, output *CancelVariantImportJobOutput) { - op := &request.Operation{ - Name: opCancelVariantImportJob, - HTTPMethod: "DELETE", - HTTPPath: "/import/variant/{jobId}", - } - - if input == nil { - input = &CancelVariantImportJobInput{} - } - - output = &CancelVariantImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CancelVariantImportJob API operation for Amazon Omics. -// -// Cancels a variant import job. -// -// 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 Omics's -// API operation CancelVariantImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CancelVariantImportJob -func (c *Omics) CancelVariantImportJob(input *CancelVariantImportJobInput) (*CancelVariantImportJobOutput, error) { - req, out := c.CancelVariantImportJobRequest(input) - return out, req.Send() -} - -// CancelVariantImportJobWithContext is the same as CancelVariantImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See CancelVariantImportJob 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 *Omics) CancelVariantImportJobWithContext(ctx aws.Context, input *CancelVariantImportJobInput, opts ...request.Option) (*CancelVariantImportJobOutput, error) { - req, out := c.CancelVariantImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCompleteMultipartReadSetUpload = "CompleteMultipartReadSetUpload" - -// CompleteMultipartReadSetUploadRequest generates a "aws/request.Request" representing the -// client's request for the CompleteMultipartReadSetUpload 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 CompleteMultipartReadSetUpload for more information on using the CompleteMultipartReadSetUpload -// 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 CompleteMultipartReadSetUploadRequest method. -// req, resp := client.CompleteMultipartReadSetUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CompleteMultipartReadSetUpload -func (c *Omics) CompleteMultipartReadSetUploadRequest(input *CompleteMultipartReadSetUploadInput) (req *request.Request, output *CompleteMultipartReadSetUploadOutput) { - op := &request.Operation{ - Name: opCompleteMultipartReadSetUpload, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/upload/{uploadId}/complete", - } - - if input == nil { - input = &CompleteMultipartReadSetUploadInput{} - } - - output = &CompleteMultipartReadSetUploadOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CompleteMultipartReadSetUpload API operation for Amazon Omics. -// -// Concludes a multipart upload once you have uploaded all the components. -// -// 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 Omics's -// API operation CompleteMultipartReadSetUpload for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - NotSupportedOperationException -// The operation is not supported by Amazon Omics, or the API does not exist. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CompleteMultipartReadSetUpload -func (c *Omics) CompleteMultipartReadSetUpload(input *CompleteMultipartReadSetUploadInput) (*CompleteMultipartReadSetUploadOutput, error) { - req, out := c.CompleteMultipartReadSetUploadRequest(input) - return out, req.Send() -} - -// CompleteMultipartReadSetUploadWithContext is the same as CompleteMultipartReadSetUpload with the addition of -// the ability to pass a context and additional request options. -// -// See CompleteMultipartReadSetUpload 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 *Omics) CompleteMultipartReadSetUploadWithContext(ctx aws.Context, input *CompleteMultipartReadSetUploadInput, opts ...request.Option) (*CompleteMultipartReadSetUploadOutput, error) { - req, out := c.CompleteMultipartReadSetUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAnnotationStore = "CreateAnnotationStore" - -// CreateAnnotationStoreRequest generates a "aws/request.Request" representing the -// client's request for the CreateAnnotationStore 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 CreateAnnotationStore for more information on using the CreateAnnotationStore -// 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 CreateAnnotationStoreRequest method. -// req, resp := client.CreateAnnotationStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateAnnotationStore -func (c *Omics) CreateAnnotationStoreRequest(input *CreateAnnotationStoreInput) (req *request.Request, output *CreateAnnotationStoreOutput) { - op := &request.Operation{ - Name: opCreateAnnotationStore, - HTTPMethod: "POST", - HTTPPath: "/annotationStore", - } - - if input == nil { - input = &CreateAnnotationStoreInput{} - } - - output = &CreateAnnotationStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateAnnotationStore API operation for Amazon Omics. -// -// Creates an annotation store. -// -// 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 Omics's -// API operation CreateAnnotationStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateAnnotationStore -func (c *Omics) CreateAnnotationStore(input *CreateAnnotationStoreInput) (*CreateAnnotationStoreOutput, error) { - req, out := c.CreateAnnotationStoreRequest(input) - return out, req.Send() -} - -// CreateAnnotationStoreWithContext is the same as CreateAnnotationStore with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAnnotationStore 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 *Omics) CreateAnnotationStoreWithContext(ctx aws.Context, input *CreateAnnotationStoreInput, opts ...request.Option) (*CreateAnnotationStoreOutput, error) { - req, out := c.CreateAnnotationStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAnnotationStoreVersion = "CreateAnnotationStoreVersion" - -// CreateAnnotationStoreVersionRequest generates a "aws/request.Request" representing the -// client's request for the CreateAnnotationStoreVersion 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 CreateAnnotationStoreVersion for more information on using the CreateAnnotationStoreVersion -// 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 CreateAnnotationStoreVersionRequest method. -// req, resp := client.CreateAnnotationStoreVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateAnnotationStoreVersion -func (c *Omics) CreateAnnotationStoreVersionRequest(input *CreateAnnotationStoreVersionInput) (req *request.Request, output *CreateAnnotationStoreVersionOutput) { - op := &request.Operation{ - Name: opCreateAnnotationStoreVersion, - HTTPMethod: "POST", - HTTPPath: "/annotationStore/{name}/version", - } - - if input == nil { - input = &CreateAnnotationStoreVersionInput{} - } - - output = &CreateAnnotationStoreVersionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateAnnotationStoreVersion API operation for Amazon Omics. -// -// Creates a new version of an annotation store. -// -// 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 Omics's -// API operation CreateAnnotationStoreVersion for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateAnnotationStoreVersion -func (c *Omics) CreateAnnotationStoreVersion(input *CreateAnnotationStoreVersionInput) (*CreateAnnotationStoreVersionOutput, error) { - req, out := c.CreateAnnotationStoreVersionRequest(input) - return out, req.Send() -} - -// CreateAnnotationStoreVersionWithContext is the same as CreateAnnotationStoreVersion with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAnnotationStoreVersion 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 *Omics) CreateAnnotationStoreVersionWithContext(ctx aws.Context, input *CreateAnnotationStoreVersionInput, opts ...request.Option) (*CreateAnnotationStoreVersionOutput, error) { - req, out := c.CreateAnnotationStoreVersionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateMultipartReadSetUpload = "CreateMultipartReadSetUpload" - -// CreateMultipartReadSetUploadRequest generates a "aws/request.Request" representing the -// client's request for the CreateMultipartReadSetUpload 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 CreateMultipartReadSetUpload for more information on using the CreateMultipartReadSetUpload -// 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 CreateMultipartReadSetUploadRequest method. -// req, resp := client.CreateMultipartReadSetUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateMultipartReadSetUpload -func (c *Omics) CreateMultipartReadSetUploadRequest(input *CreateMultipartReadSetUploadInput) (req *request.Request, output *CreateMultipartReadSetUploadOutput) { - op := &request.Operation{ - Name: opCreateMultipartReadSetUpload, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/upload", - } - - if input == nil { - input = &CreateMultipartReadSetUploadInput{} - } - - output = &CreateMultipartReadSetUploadOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateMultipartReadSetUpload API operation for Amazon Omics. -// -// Begins a multipart read set upload. -// -// 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 Omics's -// API operation CreateMultipartReadSetUpload for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - NotSupportedOperationException -// The operation is not supported by Amazon Omics, or the API does not exist. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateMultipartReadSetUpload -func (c *Omics) CreateMultipartReadSetUpload(input *CreateMultipartReadSetUploadInput) (*CreateMultipartReadSetUploadOutput, error) { - req, out := c.CreateMultipartReadSetUploadRequest(input) - return out, req.Send() -} - -// CreateMultipartReadSetUploadWithContext is the same as CreateMultipartReadSetUpload with the addition of -// the ability to pass a context and additional request options. -// -// See CreateMultipartReadSetUpload 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 *Omics) CreateMultipartReadSetUploadWithContext(ctx aws.Context, input *CreateMultipartReadSetUploadInput, opts ...request.Option) (*CreateMultipartReadSetUploadOutput, error) { - req, out := c.CreateMultipartReadSetUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateReferenceStore = "CreateReferenceStore" - -// CreateReferenceStoreRequest generates a "aws/request.Request" representing the -// client's request for the CreateReferenceStore 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 CreateReferenceStore for more information on using the CreateReferenceStore -// 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 CreateReferenceStoreRequest method. -// req, resp := client.CreateReferenceStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateReferenceStore -func (c *Omics) CreateReferenceStoreRequest(input *CreateReferenceStoreInput) (req *request.Request, output *CreateReferenceStoreOutput) { - op := &request.Operation{ - Name: opCreateReferenceStore, - HTTPMethod: "POST", - HTTPPath: "/referencestore", - } - - if input == nil { - input = &CreateReferenceStoreInput{} - } - - output = &CreateReferenceStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateReferenceStore API operation for Amazon Omics. -// -// Creates a reference store. -// -// 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 Omics's -// API operation CreateReferenceStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateReferenceStore -func (c *Omics) CreateReferenceStore(input *CreateReferenceStoreInput) (*CreateReferenceStoreOutput, error) { - req, out := c.CreateReferenceStoreRequest(input) - return out, req.Send() -} - -// CreateReferenceStoreWithContext is the same as CreateReferenceStore with the addition of -// the ability to pass a context and additional request options. -// -// See CreateReferenceStore 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 *Omics) CreateReferenceStoreWithContext(ctx aws.Context, input *CreateReferenceStoreInput, opts ...request.Option) (*CreateReferenceStoreOutput, error) { - req, out := c.CreateReferenceStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRunGroup = "CreateRunGroup" - -// CreateRunGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateRunGroup 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 CreateRunGroup for more information on using the CreateRunGroup -// 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 CreateRunGroupRequest method. -// req, resp := client.CreateRunGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateRunGroup -func (c *Omics) CreateRunGroupRequest(input *CreateRunGroupInput) (req *request.Request, output *CreateRunGroupOutput) { - op := &request.Operation{ - Name: opCreateRunGroup, - HTTPMethod: "POST", - HTTPPath: "/runGroup", - } - - if input == nil { - input = &CreateRunGroupInput{} - } - - output = &CreateRunGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateRunGroup API operation for Amazon Omics. -// -// Creates a run group. -// -// 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 Omics's -// API operation CreateRunGroup for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateRunGroup -func (c *Omics) CreateRunGroup(input *CreateRunGroupInput) (*CreateRunGroupOutput, error) { - req, out := c.CreateRunGroupRequest(input) - return out, req.Send() -} - -// CreateRunGroupWithContext is the same as CreateRunGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRunGroup 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 *Omics) CreateRunGroupWithContext(ctx aws.Context, input *CreateRunGroupInput, opts ...request.Option) (*CreateRunGroupOutput, error) { - req, out := c.CreateRunGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSequenceStore = "CreateSequenceStore" - -// CreateSequenceStoreRequest generates a "aws/request.Request" representing the -// client's request for the CreateSequenceStore 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 CreateSequenceStore for more information on using the CreateSequenceStore -// 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 CreateSequenceStoreRequest method. -// req, resp := client.CreateSequenceStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateSequenceStore -func (c *Omics) CreateSequenceStoreRequest(input *CreateSequenceStoreInput) (req *request.Request, output *CreateSequenceStoreOutput) { - op := &request.Operation{ - Name: opCreateSequenceStore, - HTTPMethod: "POST", - HTTPPath: "/sequencestore", - } - - if input == nil { - input = &CreateSequenceStoreInput{} - } - - output = &CreateSequenceStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateSequenceStore API operation for Amazon Omics. -// -// Creates a sequence store. -// -// 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 Omics's -// API operation CreateSequenceStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateSequenceStore -func (c *Omics) CreateSequenceStore(input *CreateSequenceStoreInput) (*CreateSequenceStoreOutput, error) { - req, out := c.CreateSequenceStoreRequest(input) - return out, req.Send() -} - -// CreateSequenceStoreWithContext is the same as CreateSequenceStore with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSequenceStore 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 *Omics) CreateSequenceStoreWithContext(ctx aws.Context, input *CreateSequenceStoreInput, opts ...request.Option) (*CreateSequenceStoreOutput, error) { - req, out := c.CreateSequenceStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateShare = "CreateShare" - -// CreateShareRequest generates a "aws/request.Request" representing the -// client's request for the CreateShare 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 CreateShare for more information on using the CreateShare -// 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 CreateShareRequest method. -// req, resp := client.CreateShareRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateShare -func (c *Omics) CreateShareRequest(input *CreateShareInput) (req *request.Request, output *CreateShareOutput) { - op := &request.Operation{ - Name: opCreateShare, - HTTPMethod: "POST", - HTTPPath: "/share", - } - - if input == nil { - input = &CreateShareInput{} - } - - output = &CreateShareOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateShare API operation for Amazon Omics. -// -// Creates a share offer that can be accepted outside the account by a subscriber. -// The share is created by the owner and accepted by the principal subscriber. -// -// 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 Omics's -// API operation CreateShare for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateShare -func (c *Omics) CreateShare(input *CreateShareInput) (*CreateShareOutput, error) { - req, out := c.CreateShareRequest(input) - return out, req.Send() -} - -// CreateShareWithContext is the same as CreateShare with the addition of -// the ability to pass a context and additional request options. -// -// See CreateShare 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 *Omics) CreateShareWithContext(ctx aws.Context, input *CreateShareInput, opts ...request.Option) (*CreateShareOutput, error) { - req, out := c.CreateShareRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVariantStore = "CreateVariantStore" - -// CreateVariantStoreRequest generates a "aws/request.Request" representing the -// client's request for the CreateVariantStore 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 CreateVariantStore for more information on using the CreateVariantStore -// 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 CreateVariantStoreRequest method. -// req, resp := client.CreateVariantStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateVariantStore -func (c *Omics) CreateVariantStoreRequest(input *CreateVariantStoreInput) (req *request.Request, output *CreateVariantStoreOutput) { - op := &request.Operation{ - Name: opCreateVariantStore, - HTTPMethod: "POST", - HTTPPath: "/variantStore", - } - - if input == nil { - input = &CreateVariantStoreInput{} - } - - output = &CreateVariantStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateVariantStore API operation for Amazon Omics. -// -// Creates a variant store. -// -// 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 Omics's -// API operation CreateVariantStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateVariantStore -func (c *Omics) CreateVariantStore(input *CreateVariantStoreInput) (*CreateVariantStoreOutput, error) { - req, out := c.CreateVariantStoreRequest(input) - return out, req.Send() -} - -// CreateVariantStoreWithContext is the same as CreateVariantStore with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVariantStore 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 *Omics) CreateVariantStoreWithContext(ctx aws.Context, input *CreateVariantStoreInput, opts ...request.Option) (*CreateVariantStoreOutput, error) { - req, out := c.CreateVariantStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateWorkflow = "CreateWorkflow" - -// CreateWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the CreateWorkflow 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 CreateWorkflow for more information on using the CreateWorkflow -// 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 CreateWorkflowRequest method. -// req, resp := client.CreateWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateWorkflow -func (c *Omics) CreateWorkflowRequest(input *CreateWorkflowInput) (req *request.Request, output *CreateWorkflowOutput) { - op := &request.Operation{ - Name: opCreateWorkflow, - HTTPMethod: "POST", - HTTPPath: "/workflow", - } - - if input == nil { - input = &CreateWorkflowInput{} - } - - output = &CreateWorkflowOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateWorkflow API operation for Amazon Omics. -// -// Creates a workflow. -// -// 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 Omics's -// API operation CreateWorkflow for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/CreateWorkflow -func (c *Omics) CreateWorkflow(input *CreateWorkflowInput) (*CreateWorkflowOutput, error) { - req, out := c.CreateWorkflowRequest(input) - return out, req.Send() -} - -// CreateWorkflowWithContext is the same as CreateWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWorkflow 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 *Omics) CreateWorkflowWithContext(ctx aws.Context, input *CreateWorkflowInput, opts ...request.Option) (*CreateWorkflowOutput, error) { - req, out := c.CreateWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAnnotationStore = "DeleteAnnotationStore" - -// DeleteAnnotationStoreRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAnnotationStore 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 DeleteAnnotationStore for more information on using the DeleteAnnotationStore -// 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 DeleteAnnotationStoreRequest method. -// req, resp := client.DeleteAnnotationStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteAnnotationStore -func (c *Omics) DeleteAnnotationStoreRequest(input *DeleteAnnotationStoreInput) (req *request.Request, output *DeleteAnnotationStoreOutput) { - op := &request.Operation{ - Name: opDeleteAnnotationStore, - HTTPMethod: "DELETE", - HTTPPath: "/annotationStore/{name}", - } - - if input == nil { - input = &DeleteAnnotationStoreInput{} - } - - output = &DeleteAnnotationStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteAnnotationStore API operation for Amazon Omics. -// -// Deletes an annotation store. -// -// 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 Omics's -// API operation DeleteAnnotationStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteAnnotationStore -func (c *Omics) DeleteAnnotationStore(input *DeleteAnnotationStoreInput) (*DeleteAnnotationStoreOutput, error) { - req, out := c.DeleteAnnotationStoreRequest(input) - return out, req.Send() -} - -// DeleteAnnotationStoreWithContext is the same as DeleteAnnotationStore with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAnnotationStore 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 *Omics) DeleteAnnotationStoreWithContext(ctx aws.Context, input *DeleteAnnotationStoreInput, opts ...request.Option) (*DeleteAnnotationStoreOutput, error) { - req, out := c.DeleteAnnotationStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAnnotationStoreVersions = "DeleteAnnotationStoreVersions" - -// DeleteAnnotationStoreVersionsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAnnotationStoreVersions 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 DeleteAnnotationStoreVersions for more information on using the DeleteAnnotationStoreVersions -// 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 DeleteAnnotationStoreVersionsRequest method. -// req, resp := client.DeleteAnnotationStoreVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteAnnotationStoreVersions -func (c *Omics) DeleteAnnotationStoreVersionsRequest(input *DeleteAnnotationStoreVersionsInput) (req *request.Request, output *DeleteAnnotationStoreVersionsOutput) { - op := &request.Operation{ - Name: opDeleteAnnotationStoreVersions, - HTTPMethod: "POST", - HTTPPath: "/annotationStore/{name}/versions/delete", - } - - if input == nil { - input = &DeleteAnnotationStoreVersionsInput{} - } - - output = &DeleteAnnotationStoreVersionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteAnnotationStoreVersions API operation for Amazon Omics. -// -// Deletes one or multiple versions of an annotation store. -// -// 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 Omics's -// API operation DeleteAnnotationStoreVersions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteAnnotationStoreVersions -func (c *Omics) DeleteAnnotationStoreVersions(input *DeleteAnnotationStoreVersionsInput) (*DeleteAnnotationStoreVersionsOutput, error) { - req, out := c.DeleteAnnotationStoreVersionsRequest(input) - return out, req.Send() -} - -// DeleteAnnotationStoreVersionsWithContext is the same as DeleteAnnotationStoreVersions with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAnnotationStoreVersions 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 *Omics) DeleteAnnotationStoreVersionsWithContext(ctx aws.Context, input *DeleteAnnotationStoreVersionsInput, opts ...request.Option) (*DeleteAnnotationStoreVersionsOutput, error) { - req, out := c.DeleteAnnotationStoreVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteReference = "DeleteReference" - -// DeleteReferenceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReference 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 DeleteReference for more information on using the DeleteReference -// 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 DeleteReferenceRequest method. -// req, resp := client.DeleteReferenceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteReference -func (c *Omics) DeleteReferenceRequest(input *DeleteReferenceInput) (req *request.Request, output *DeleteReferenceOutput) { - op := &request.Operation{ - Name: opDeleteReference, - HTTPMethod: "DELETE", - HTTPPath: "/referencestore/{referenceStoreId}/reference/{id}", - } - - if input == nil { - input = &DeleteReferenceInput{} - } - - output = &DeleteReferenceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteReference API operation for Amazon Omics. -// -// Deletes a genome reference. -// -// 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 Omics's -// API operation DeleteReference for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteReference -func (c *Omics) DeleteReference(input *DeleteReferenceInput) (*DeleteReferenceOutput, error) { - req, out := c.DeleteReferenceRequest(input) - return out, req.Send() -} - -// DeleteReferenceWithContext is the same as DeleteReference with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteReference 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 *Omics) DeleteReferenceWithContext(ctx aws.Context, input *DeleteReferenceInput, opts ...request.Option) (*DeleteReferenceOutput, error) { - req, out := c.DeleteReferenceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteReferenceStore = "DeleteReferenceStore" - -// DeleteReferenceStoreRequest generates a "aws/request.Request" representing the -// client's request for the DeleteReferenceStore 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 DeleteReferenceStore for more information on using the DeleteReferenceStore -// 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 DeleteReferenceStoreRequest method. -// req, resp := client.DeleteReferenceStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteReferenceStore -func (c *Omics) DeleteReferenceStoreRequest(input *DeleteReferenceStoreInput) (req *request.Request, output *DeleteReferenceStoreOutput) { - op := &request.Operation{ - Name: opDeleteReferenceStore, - HTTPMethod: "DELETE", - HTTPPath: "/referencestore/{id}", - } - - if input == nil { - input = &DeleteReferenceStoreInput{} - } - - output = &DeleteReferenceStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteReferenceStore API operation for Amazon Omics. -// -// Deletes a genome reference store. -// -// 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 Omics's -// API operation DeleteReferenceStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteReferenceStore -func (c *Omics) DeleteReferenceStore(input *DeleteReferenceStoreInput) (*DeleteReferenceStoreOutput, error) { - req, out := c.DeleteReferenceStoreRequest(input) - return out, req.Send() -} - -// DeleteReferenceStoreWithContext is the same as DeleteReferenceStore with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteReferenceStore 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 *Omics) DeleteReferenceStoreWithContext(ctx aws.Context, input *DeleteReferenceStoreInput, opts ...request.Option) (*DeleteReferenceStoreOutput, error) { - req, out := c.DeleteReferenceStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRun = "DeleteRun" - -// DeleteRunRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRun 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 DeleteRun for more information on using the DeleteRun -// 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 DeleteRunRequest method. -// req, resp := client.DeleteRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteRun -func (c *Omics) DeleteRunRequest(input *DeleteRunInput) (req *request.Request, output *DeleteRunOutput) { - op := &request.Operation{ - Name: opDeleteRun, - HTTPMethod: "DELETE", - HTTPPath: "/run/{id}", - } - - if input == nil { - input = &DeleteRunInput{} - } - - output = &DeleteRunOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteRun API operation for Amazon Omics. -// -// Deletes a workflow run. -// -// 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 Omics's -// API operation DeleteRun for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteRun -func (c *Omics) DeleteRun(input *DeleteRunInput) (*DeleteRunOutput, error) { - req, out := c.DeleteRunRequest(input) - return out, req.Send() -} - -// DeleteRunWithContext is the same as DeleteRun with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRun 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 *Omics) DeleteRunWithContext(ctx aws.Context, input *DeleteRunInput, opts ...request.Option) (*DeleteRunOutput, error) { - req, out := c.DeleteRunRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRunGroup = "DeleteRunGroup" - -// DeleteRunGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRunGroup 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 DeleteRunGroup for more information on using the DeleteRunGroup -// 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 DeleteRunGroupRequest method. -// req, resp := client.DeleteRunGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteRunGroup -func (c *Omics) DeleteRunGroupRequest(input *DeleteRunGroupInput) (req *request.Request, output *DeleteRunGroupOutput) { - op := &request.Operation{ - Name: opDeleteRunGroup, - HTTPMethod: "DELETE", - HTTPPath: "/runGroup/{id}", - } - - if input == nil { - input = &DeleteRunGroupInput{} - } - - output = &DeleteRunGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteRunGroup API operation for Amazon Omics. -// -// Deletes a workflow run group. -// -// 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 Omics's -// API operation DeleteRunGroup for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteRunGroup -func (c *Omics) DeleteRunGroup(input *DeleteRunGroupInput) (*DeleteRunGroupOutput, error) { - req, out := c.DeleteRunGroupRequest(input) - return out, req.Send() -} - -// DeleteRunGroupWithContext is the same as DeleteRunGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRunGroup 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 *Omics) DeleteRunGroupWithContext(ctx aws.Context, input *DeleteRunGroupInput, opts ...request.Option) (*DeleteRunGroupOutput, error) { - req, out := c.DeleteRunGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSequenceStore = "DeleteSequenceStore" - -// DeleteSequenceStoreRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSequenceStore 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 DeleteSequenceStore for more information on using the DeleteSequenceStore -// 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 DeleteSequenceStoreRequest method. -// req, resp := client.DeleteSequenceStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteSequenceStore -func (c *Omics) DeleteSequenceStoreRequest(input *DeleteSequenceStoreInput) (req *request.Request, output *DeleteSequenceStoreOutput) { - op := &request.Operation{ - Name: opDeleteSequenceStore, - HTTPMethod: "DELETE", - HTTPPath: "/sequencestore/{id}", - } - - if input == nil { - input = &DeleteSequenceStoreInput{} - } - - output = &DeleteSequenceStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteSequenceStore API operation for Amazon Omics. -// -// Deletes a sequence store. -// -// 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 Omics's -// API operation DeleteSequenceStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteSequenceStore -func (c *Omics) DeleteSequenceStore(input *DeleteSequenceStoreInput) (*DeleteSequenceStoreOutput, error) { - req, out := c.DeleteSequenceStoreRequest(input) - return out, req.Send() -} - -// DeleteSequenceStoreWithContext is the same as DeleteSequenceStore with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSequenceStore 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 *Omics) DeleteSequenceStoreWithContext(ctx aws.Context, input *DeleteSequenceStoreInput, opts ...request.Option) (*DeleteSequenceStoreOutput, error) { - req, out := c.DeleteSequenceStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteShare = "DeleteShare" - -// DeleteShareRequest generates a "aws/request.Request" representing the -// client's request for the DeleteShare 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 DeleteShare for more information on using the DeleteShare -// 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 DeleteShareRequest method. -// req, resp := client.DeleteShareRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteShare -func (c *Omics) DeleteShareRequest(input *DeleteShareInput) (req *request.Request, output *DeleteShareOutput) { - op := &request.Operation{ - Name: opDeleteShare, - HTTPMethod: "DELETE", - HTTPPath: "/share/{shareId}", - } - - if input == nil { - input = &DeleteShareInput{} - } - - output = &DeleteShareOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteShare API operation for Amazon Omics. -// -// Deletes a share of an analytics store. -// -// 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 Omics's -// API operation DeleteShare for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteShare -func (c *Omics) DeleteShare(input *DeleteShareInput) (*DeleteShareOutput, error) { - req, out := c.DeleteShareRequest(input) - return out, req.Send() -} - -// DeleteShareWithContext is the same as DeleteShare with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteShare 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 *Omics) DeleteShareWithContext(ctx aws.Context, input *DeleteShareInput, opts ...request.Option) (*DeleteShareOutput, error) { - req, out := c.DeleteShareRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVariantStore = "DeleteVariantStore" - -// DeleteVariantStoreRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVariantStore 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 DeleteVariantStore for more information on using the DeleteVariantStore -// 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 DeleteVariantStoreRequest method. -// req, resp := client.DeleteVariantStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteVariantStore -func (c *Omics) DeleteVariantStoreRequest(input *DeleteVariantStoreInput) (req *request.Request, output *DeleteVariantStoreOutput) { - op := &request.Operation{ - Name: opDeleteVariantStore, - HTTPMethod: "DELETE", - HTTPPath: "/variantStore/{name}", - } - - if input == nil { - input = &DeleteVariantStoreInput{} - } - - output = &DeleteVariantStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteVariantStore API operation for Amazon Omics. -// -// Deletes a variant store. -// -// 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 Omics's -// API operation DeleteVariantStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteVariantStore -func (c *Omics) DeleteVariantStore(input *DeleteVariantStoreInput) (*DeleteVariantStoreOutput, error) { - req, out := c.DeleteVariantStoreRequest(input) - return out, req.Send() -} - -// DeleteVariantStoreWithContext is the same as DeleteVariantStore with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVariantStore 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 *Omics) DeleteVariantStoreWithContext(ctx aws.Context, input *DeleteVariantStoreInput, opts ...request.Option) (*DeleteVariantStoreOutput, error) { - req, out := c.DeleteVariantStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWorkflow = "DeleteWorkflow" - -// DeleteWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWorkflow 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 DeleteWorkflow for more information on using the DeleteWorkflow -// 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 DeleteWorkflowRequest method. -// req, resp := client.DeleteWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteWorkflow -func (c *Omics) DeleteWorkflowRequest(input *DeleteWorkflowInput) (req *request.Request, output *DeleteWorkflowOutput) { - op := &request.Operation{ - Name: opDeleteWorkflow, - HTTPMethod: "DELETE", - HTTPPath: "/workflow/{id}", - } - - if input == nil { - input = &DeleteWorkflowInput{} - } - - output = &DeleteWorkflowOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteWorkflow API operation for Amazon Omics. -// -// Deletes a workflow. -// -// 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 Omics's -// API operation DeleteWorkflow for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/DeleteWorkflow -func (c *Omics) DeleteWorkflow(input *DeleteWorkflowInput) (*DeleteWorkflowOutput, error) { - req, out := c.DeleteWorkflowRequest(input) - return out, req.Send() -} - -// DeleteWorkflowWithContext is the same as DeleteWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWorkflow 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 *Omics) DeleteWorkflowWithContext(ctx aws.Context, input *DeleteWorkflowInput, opts ...request.Option) (*DeleteWorkflowOutput, error) { - req, out := c.DeleteWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAnnotationImportJob = "GetAnnotationImportJob" - -// GetAnnotationImportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetAnnotationImportJob 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 GetAnnotationImportJob for more information on using the GetAnnotationImportJob -// 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 GetAnnotationImportJobRequest method. -// req, resp := client.GetAnnotationImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetAnnotationImportJob -func (c *Omics) GetAnnotationImportJobRequest(input *GetAnnotationImportJobInput) (req *request.Request, output *GetAnnotationImportJobOutput) { - op := &request.Operation{ - Name: opGetAnnotationImportJob, - HTTPMethod: "GET", - HTTPPath: "/import/annotation/{jobId}", - } - - if input == nil { - input = &GetAnnotationImportJobInput{} - } - - output = &GetAnnotationImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetAnnotationImportJob API operation for Amazon Omics. -// -// Gets information about an annotation import job. -// -// 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 Omics's -// API operation GetAnnotationImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetAnnotationImportJob -func (c *Omics) GetAnnotationImportJob(input *GetAnnotationImportJobInput) (*GetAnnotationImportJobOutput, error) { - req, out := c.GetAnnotationImportJobRequest(input) - return out, req.Send() -} - -// GetAnnotationImportJobWithContext is the same as GetAnnotationImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetAnnotationImportJob 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 *Omics) GetAnnotationImportJobWithContext(ctx aws.Context, input *GetAnnotationImportJobInput, opts ...request.Option) (*GetAnnotationImportJobOutput, error) { - req, out := c.GetAnnotationImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAnnotationStore = "GetAnnotationStore" - -// GetAnnotationStoreRequest generates a "aws/request.Request" representing the -// client's request for the GetAnnotationStore 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 GetAnnotationStore for more information on using the GetAnnotationStore -// 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 GetAnnotationStoreRequest method. -// req, resp := client.GetAnnotationStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetAnnotationStore -func (c *Omics) GetAnnotationStoreRequest(input *GetAnnotationStoreInput) (req *request.Request, output *GetAnnotationStoreOutput) { - op := &request.Operation{ - Name: opGetAnnotationStore, - HTTPMethod: "GET", - HTTPPath: "/annotationStore/{name}", - } - - if input == nil { - input = &GetAnnotationStoreInput{} - } - - output = &GetAnnotationStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetAnnotationStore API operation for Amazon Omics. -// -// Gets information about an annotation store. -// -// 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 Omics's -// API operation GetAnnotationStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetAnnotationStore -func (c *Omics) GetAnnotationStore(input *GetAnnotationStoreInput) (*GetAnnotationStoreOutput, error) { - req, out := c.GetAnnotationStoreRequest(input) - return out, req.Send() -} - -// GetAnnotationStoreWithContext is the same as GetAnnotationStore with the addition of -// the ability to pass a context and additional request options. -// -// See GetAnnotationStore 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 *Omics) GetAnnotationStoreWithContext(ctx aws.Context, input *GetAnnotationStoreInput, opts ...request.Option) (*GetAnnotationStoreOutput, error) { - req, out := c.GetAnnotationStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAnnotationStoreVersion = "GetAnnotationStoreVersion" - -// GetAnnotationStoreVersionRequest generates a "aws/request.Request" representing the -// client's request for the GetAnnotationStoreVersion 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 GetAnnotationStoreVersion for more information on using the GetAnnotationStoreVersion -// 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 GetAnnotationStoreVersionRequest method. -// req, resp := client.GetAnnotationStoreVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetAnnotationStoreVersion -func (c *Omics) GetAnnotationStoreVersionRequest(input *GetAnnotationStoreVersionInput) (req *request.Request, output *GetAnnotationStoreVersionOutput) { - op := &request.Operation{ - Name: opGetAnnotationStoreVersion, - HTTPMethod: "GET", - HTTPPath: "/annotationStore/{name}/version/{versionName}", - } - - if input == nil { - input = &GetAnnotationStoreVersionInput{} - } - - output = &GetAnnotationStoreVersionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetAnnotationStoreVersion API operation for Amazon Omics. -// -// Retrieves the metadata for an annotation store version. -// -// 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 Omics's -// API operation GetAnnotationStoreVersion for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetAnnotationStoreVersion -func (c *Omics) GetAnnotationStoreVersion(input *GetAnnotationStoreVersionInput) (*GetAnnotationStoreVersionOutput, error) { - req, out := c.GetAnnotationStoreVersionRequest(input) - return out, req.Send() -} - -// GetAnnotationStoreVersionWithContext is the same as GetAnnotationStoreVersion with the addition of -// the ability to pass a context and additional request options. -// -// See GetAnnotationStoreVersion 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 *Omics) GetAnnotationStoreVersionWithContext(ctx aws.Context, input *GetAnnotationStoreVersionInput, opts ...request.Option) (*GetAnnotationStoreVersionOutput, error) { - req, out := c.GetAnnotationStoreVersionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReadSet = "GetReadSet" - -// GetReadSetRequest generates a "aws/request.Request" representing the -// client's request for the GetReadSet 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 GetReadSet for more information on using the GetReadSet -// 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 GetReadSetRequest method. -// req, resp := client.GetReadSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSet -func (c *Omics) GetReadSetRequest(input *GetReadSetInput) (req *request.Request, output *GetReadSetOutput) { - op := &request.Operation{ - Name: opGetReadSet, - HTTPMethod: "GET", - HTTPPath: "/sequencestore/{sequenceStoreId}/readset/{id}", - } - - if input == nil { - input = &GetReadSetInput{} - } - - output = &GetReadSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReadSet API operation for Amazon Omics. -// -// Gets a file from a read set. -// -// 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 Omics's -// API operation GetReadSet for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - RangeNotSatisfiableException -// The ranges specified in the request are not valid. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSet -func (c *Omics) GetReadSet(input *GetReadSetInput) (*GetReadSetOutput, error) { - req, out := c.GetReadSetRequest(input) - return out, req.Send() -} - -// GetReadSetWithContext is the same as GetReadSet with the addition of -// the ability to pass a context and additional request options. -// -// See GetReadSet 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 *Omics) GetReadSetWithContext(ctx aws.Context, input *GetReadSetInput, opts ...request.Option) (*GetReadSetOutput, error) { - req, out := c.GetReadSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReadSetActivationJob = "GetReadSetActivationJob" - -// GetReadSetActivationJobRequest generates a "aws/request.Request" representing the -// client's request for the GetReadSetActivationJob 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 GetReadSetActivationJob for more information on using the GetReadSetActivationJob -// 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 GetReadSetActivationJobRequest method. -// req, resp := client.GetReadSetActivationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSetActivationJob -func (c *Omics) GetReadSetActivationJobRequest(input *GetReadSetActivationJobInput) (req *request.Request, output *GetReadSetActivationJobOutput) { - op := &request.Operation{ - Name: opGetReadSetActivationJob, - HTTPMethod: "GET", - HTTPPath: "/sequencestore/{sequenceStoreId}/activationjob/{id}", - } - - if input == nil { - input = &GetReadSetActivationJobInput{} - } - - output = &GetReadSetActivationJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReadSetActivationJob API operation for Amazon Omics. -// -// Gets information about a read set activation job. -// -// 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 Omics's -// API operation GetReadSetActivationJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSetActivationJob -func (c *Omics) GetReadSetActivationJob(input *GetReadSetActivationJobInput) (*GetReadSetActivationJobOutput, error) { - req, out := c.GetReadSetActivationJobRequest(input) - return out, req.Send() -} - -// GetReadSetActivationJobWithContext is the same as GetReadSetActivationJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetReadSetActivationJob 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 *Omics) GetReadSetActivationJobWithContext(ctx aws.Context, input *GetReadSetActivationJobInput, opts ...request.Option) (*GetReadSetActivationJobOutput, error) { - req, out := c.GetReadSetActivationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReadSetExportJob = "GetReadSetExportJob" - -// GetReadSetExportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetReadSetExportJob 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 GetReadSetExportJob for more information on using the GetReadSetExportJob -// 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 GetReadSetExportJobRequest method. -// req, resp := client.GetReadSetExportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSetExportJob -func (c *Omics) GetReadSetExportJobRequest(input *GetReadSetExportJobInput) (req *request.Request, output *GetReadSetExportJobOutput) { - op := &request.Operation{ - Name: opGetReadSetExportJob, - HTTPMethod: "GET", - HTTPPath: "/sequencestore/{sequenceStoreId}/exportjob/{id}", - } - - if input == nil { - input = &GetReadSetExportJobInput{} - } - - output = &GetReadSetExportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReadSetExportJob API operation for Amazon Omics. -// -// Gets information about a read set export job. -// -// 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 Omics's -// API operation GetReadSetExportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSetExportJob -func (c *Omics) GetReadSetExportJob(input *GetReadSetExportJobInput) (*GetReadSetExportJobOutput, error) { - req, out := c.GetReadSetExportJobRequest(input) - return out, req.Send() -} - -// GetReadSetExportJobWithContext is the same as GetReadSetExportJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetReadSetExportJob 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 *Omics) GetReadSetExportJobWithContext(ctx aws.Context, input *GetReadSetExportJobInput, opts ...request.Option) (*GetReadSetExportJobOutput, error) { - req, out := c.GetReadSetExportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReadSetImportJob = "GetReadSetImportJob" - -// GetReadSetImportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetReadSetImportJob 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 GetReadSetImportJob for more information on using the GetReadSetImportJob -// 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 GetReadSetImportJobRequest method. -// req, resp := client.GetReadSetImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSetImportJob -func (c *Omics) GetReadSetImportJobRequest(input *GetReadSetImportJobInput) (req *request.Request, output *GetReadSetImportJobOutput) { - op := &request.Operation{ - Name: opGetReadSetImportJob, - HTTPMethod: "GET", - HTTPPath: "/sequencestore/{sequenceStoreId}/importjob/{id}", - } - - if input == nil { - input = &GetReadSetImportJobInput{} - } - - output = &GetReadSetImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReadSetImportJob API operation for Amazon Omics. -// -// Gets information about a read set import job. -// -// 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 Omics's -// API operation GetReadSetImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSetImportJob -func (c *Omics) GetReadSetImportJob(input *GetReadSetImportJobInput) (*GetReadSetImportJobOutput, error) { - req, out := c.GetReadSetImportJobRequest(input) - return out, req.Send() -} - -// GetReadSetImportJobWithContext is the same as GetReadSetImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetReadSetImportJob 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 *Omics) GetReadSetImportJobWithContext(ctx aws.Context, input *GetReadSetImportJobInput, opts ...request.Option) (*GetReadSetImportJobOutput, error) { - req, out := c.GetReadSetImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReadSetMetadata = "GetReadSetMetadata" - -// GetReadSetMetadataRequest generates a "aws/request.Request" representing the -// client's request for the GetReadSetMetadata 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 GetReadSetMetadata for more information on using the GetReadSetMetadata -// 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 GetReadSetMetadataRequest method. -// req, resp := client.GetReadSetMetadataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSetMetadata -func (c *Omics) GetReadSetMetadataRequest(input *GetReadSetMetadataInput) (req *request.Request, output *GetReadSetMetadataOutput) { - op := &request.Operation{ - Name: opGetReadSetMetadata, - HTTPMethod: "GET", - HTTPPath: "/sequencestore/{sequenceStoreId}/readset/{id}/metadata", - } - - if input == nil { - input = &GetReadSetMetadataInput{} - } - - output = &GetReadSetMetadataOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReadSetMetadata API operation for Amazon Omics. -// -// Gets details about a read set. -// -// 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 Omics's -// API operation GetReadSetMetadata for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReadSetMetadata -func (c *Omics) GetReadSetMetadata(input *GetReadSetMetadataInput) (*GetReadSetMetadataOutput, error) { - req, out := c.GetReadSetMetadataRequest(input) - return out, req.Send() -} - -// GetReadSetMetadataWithContext is the same as GetReadSetMetadata with the addition of -// the ability to pass a context and additional request options. -// -// See GetReadSetMetadata 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 *Omics) GetReadSetMetadataWithContext(ctx aws.Context, input *GetReadSetMetadataInput, opts ...request.Option) (*GetReadSetMetadataOutput, error) { - req, out := c.GetReadSetMetadataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReference = "GetReference" - -// GetReferenceRequest generates a "aws/request.Request" representing the -// client's request for the GetReference 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 GetReference for more information on using the GetReference -// 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 GetReferenceRequest method. -// req, resp := client.GetReferenceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReference -func (c *Omics) GetReferenceRequest(input *GetReferenceInput) (req *request.Request, output *GetReferenceOutput) { - op := &request.Operation{ - Name: opGetReference, - HTTPMethod: "GET", - HTTPPath: "/referencestore/{referenceStoreId}/reference/{id}", - } - - if input == nil { - input = &GetReferenceInput{} - } - - output = &GetReferenceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReference API operation for Amazon Omics. -// -// Gets a reference file. -// -// 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 Omics's -// API operation GetReference for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - RangeNotSatisfiableException -// The ranges specified in the request are not valid. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReference -func (c *Omics) GetReference(input *GetReferenceInput) (*GetReferenceOutput, error) { - req, out := c.GetReferenceRequest(input) - return out, req.Send() -} - -// GetReferenceWithContext is the same as GetReference with the addition of -// the ability to pass a context and additional request options. -// -// See GetReference 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 *Omics) GetReferenceWithContext(ctx aws.Context, input *GetReferenceInput, opts ...request.Option) (*GetReferenceOutput, error) { - req, out := c.GetReferenceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReferenceImportJob = "GetReferenceImportJob" - -// GetReferenceImportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetReferenceImportJob 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 GetReferenceImportJob for more information on using the GetReferenceImportJob -// 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 GetReferenceImportJobRequest method. -// req, resp := client.GetReferenceImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReferenceImportJob -func (c *Omics) GetReferenceImportJobRequest(input *GetReferenceImportJobInput) (req *request.Request, output *GetReferenceImportJobOutput) { - op := &request.Operation{ - Name: opGetReferenceImportJob, - HTTPMethod: "GET", - HTTPPath: "/referencestore/{referenceStoreId}/importjob/{id}", - } - - if input == nil { - input = &GetReferenceImportJobInput{} - } - - output = &GetReferenceImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReferenceImportJob API operation for Amazon Omics. -// -// Gets information about a reference import job. -// -// 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 Omics's -// API operation GetReferenceImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReferenceImportJob -func (c *Omics) GetReferenceImportJob(input *GetReferenceImportJobInput) (*GetReferenceImportJobOutput, error) { - req, out := c.GetReferenceImportJobRequest(input) - return out, req.Send() -} - -// GetReferenceImportJobWithContext is the same as GetReferenceImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetReferenceImportJob 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 *Omics) GetReferenceImportJobWithContext(ctx aws.Context, input *GetReferenceImportJobInput, opts ...request.Option) (*GetReferenceImportJobOutput, error) { - req, out := c.GetReferenceImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReferenceMetadata = "GetReferenceMetadata" - -// GetReferenceMetadataRequest generates a "aws/request.Request" representing the -// client's request for the GetReferenceMetadata 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 GetReferenceMetadata for more information on using the GetReferenceMetadata -// 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 GetReferenceMetadataRequest method. -// req, resp := client.GetReferenceMetadataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReferenceMetadata -func (c *Omics) GetReferenceMetadataRequest(input *GetReferenceMetadataInput) (req *request.Request, output *GetReferenceMetadataOutput) { - op := &request.Operation{ - Name: opGetReferenceMetadata, - HTTPMethod: "GET", - HTTPPath: "/referencestore/{referenceStoreId}/reference/{id}/metadata", - } - - if input == nil { - input = &GetReferenceMetadataInput{} - } - - output = &GetReferenceMetadataOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReferenceMetadata API operation for Amazon Omics. -// -// Gets information about a genome reference's metadata. -// -// 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 Omics's -// API operation GetReferenceMetadata for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReferenceMetadata -func (c *Omics) GetReferenceMetadata(input *GetReferenceMetadataInput) (*GetReferenceMetadataOutput, error) { - req, out := c.GetReferenceMetadataRequest(input) - return out, req.Send() -} - -// GetReferenceMetadataWithContext is the same as GetReferenceMetadata with the addition of -// the ability to pass a context and additional request options. -// -// See GetReferenceMetadata 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 *Omics) GetReferenceMetadataWithContext(ctx aws.Context, input *GetReferenceMetadataInput, opts ...request.Option) (*GetReferenceMetadataOutput, error) { - req, out := c.GetReferenceMetadataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetReferenceStore = "GetReferenceStore" - -// GetReferenceStoreRequest generates a "aws/request.Request" representing the -// client's request for the GetReferenceStore 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 GetReferenceStore for more information on using the GetReferenceStore -// 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 GetReferenceStoreRequest method. -// req, resp := client.GetReferenceStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReferenceStore -func (c *Omics) GetReferenceStoreRequest(input *GetReferenceStoreInput) (req *request.Request, output *GetReferenceStoreOutput) { - op := &request.Operation{ - Name: opGetReferenceStore, - HTTPMethod: "GET", - HTTPPath: "/referencestore/{id}", - } - - if input == nil { - input = &GetReferenceStoreInput{} - } - - output = &GetReferenceStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetReferenceStore API operation for Amazon Omics. -// -// Gets information about a reference store. -// -// 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 Omics's -// API operation GetReferenceStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetReferenceStore -func (c *Omics) GetReferenceStore(input *GetReferenceStoreInput) (*GetReferenceStoreOutput, error) { - req, out := c.GetReferenceStoreRequest(input) - return out, req.Send() -} - -// GetReferenceStoreWithContext is the same as GetReferenceStore with the addition of -// the ability to pass a context and additional request options. -// -// See GetReferenceStore 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 *Omics) GetReferenceStoreWithContext(ctx aws.Context, input *GetReferenceStoreInput, opts ...request.Option) (*GetReferenceStoreOutput, error) { - req, out := c.GetReferenceStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRun = "GetRun" - -// GetRunRequest generates a "aws/request.Request" representing the -// client's request for the GetRun 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 GetRun for more information on using the GetRun -// 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 GetRunRequest method. -// req, resp := client.GetRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetRun -func (c *Omics) GetRunRequest(input *GetRunInput) (req *request.Request, output *GetRunOutput) { - op := &request.Operation{ - Name: opGetRun, - HTTPMethod: "GET", - HTTPPath: "/run/{id}", - } - - if input == nil { - input = &GetRunInput{} - } - - output = &GetRunOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetRun API operation for Amazon Omics. -// -// Gets information about a workflow run. -// -// 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 Omics's -// API operation GetRun for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetRun -func (c *Omics) GetRun(input *GetRunInput) (*GetRunOutput, error) { - req, out := c.GetRunRequest(input) - return out, req.Send() -} - -// GetRunWithContext is the same as GetRun with the addition of -// the ability to pass a context and additional request options. -// -// See GetRun 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 *Omics) GetRunWithContext(ctx aws.Context, input *GetRunInput, opts ...request.Option) (*GetRunOutput, error) { - req, out := c.GetRunRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRunGroup = "GetRunGroup" - -// GetRunGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetRunGroup 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 GetRunGroup for more information on using the GetRunGroup -// 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 GetRunGroupRequest method. -// req, resp := client.GetRunGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetRunGroup -func (c *Omics) GetRunGroupRequest(input *GetRunGroupInput) (req *request.Request, output *GetRunGroupOutput) { - op := &request.Operation{ - Name: opGetRunGroup, - HTTPMethod: "GET", - HTTPPath: "/runGroup/{id}", - } - - if input == nil { - input = &GetRunGroupInput{} - } - - output = &GetRunGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetRunGroup API operation for Amazon Omics. -// -// Gets information about a workflow run group. -// -// 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 Omics's -// API operation GetRunGroup for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetRunGroup -func (c *Omics) GetRunGroup(input *GetRunGroupInput) (*GetRunGroupOutput, error) { - req, out := c.GetRunGroupRequest(input) - return out, req.Send() -} - -// GetRunGroupWithContext is the same as GetRunGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetRunGroup 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 *Omics) GetRunGroupWithContext(ctx aws.Context, input *GetRunGroupInput, opts ...request.Option) (*GetRunGroupOutput, error) { - req, out := c.GetRunGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRunTask = "GetRunTask" - -// GetRunTaskRequest generates a "aws/request.Request" representing the -// client's request for the GetRunTask 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 GetRunTask for more information on using the GetRunTask -// 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 GetRunTaskRequest method. -// req, resp := client.GetRunTaskRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetRunTask -func (c *Omics) GetRunTaskRequest(input *GetRunTaskInput) (req *request.Request, output *GetRunTaskOutput) { - op := &request.Operation{ - Name: opGetRunTask, - HTTPMethod: "GET", - HTTPPath: "/run/{id}/task/{taskId}", - } - - if input == nil { - input = &GetRunTaskInput{} - } - - output = &GetRunTaskOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetRunTask API operation for Amazon Omics. -// -// Gets information about a workflow run task. -// -// 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 Omics's -// API operation GetRunTask for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetRunTask -func (c *Omics) GetRunTask(input *GetRunTaskInput) (*GetRunTaskOutput, error) { - req, out := c.GetRunTaskRequest(input) - return out, req.Send() -} - -// GetRunTaskWithContext is the same as GetRunTask with the addition of -// the ability to pass a context and additional request options. -// -// See GetRunTask 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 *Omics) GetRunTaskWithContext(ctx aws.Context, input *GetRunTaskInput, opts ...request.Option) (*GetRunTaskOutput, error) { - req, out := c.GetRunTaskRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSequenceStore = "GetSequenceStore" - -// GetSequenceStoreRequest generates a "aws/request.Request" representing the -// client's request for the GetSequenceStore 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 GetSequenceStore for more information on using the GetSequenceStore -// 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 GetSequenceStoreRequest method. -// req, resp := client.GetSequenceStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetSequenceStore -func (c *Omics) GetSequenceStoreRequest(input *GetSequenceStoreInput) (req *request.Request, output *GetSequenceStoreOutput) { - op := &request.Operation{ - Name: opGetSequenceStore, - HTTPMethod: "GET", - HTTPPath: "/sequencestore/{id}", - } - - if input == nil { - input = &GetSequenceStoreInput{} - } - - output = &GetSequenceStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetSequenceStore API operation for Amazon Omics. -// -// Gets information about a sequence store. -// -// 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 Omics's -// API operation GetSequenceStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetSequenceStore -func (c *Omics) GetSequenceStore(input *GetSequenceStoreInput) (*GetSequenceStoreOutput, error) { - req, out := c.GetSequenceStoreRequest(input) - return out, req.Send() -} - -// GetSequenceStoreWithContext is the same as GetSequenceStore with the addition of -// the ability to pass a context and additional request options. -// -// See GetSequenceStore 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 *Omics) GetSequenceStoreWithContext(ctx aws.Context, input *GetSequenceStoreInput, opts ...request.Option) (*GetSequenceStoreOutput, error) { - req, out := c.GetSequenceStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetShare = "GetShare" - -// GetShareRequest generates a "aws/request.Request" representing the -// client's request for the GetShare 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 GetShare for more information on using the GetShare -// 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 GetShareRequest method. -// req, resp := client.GetShareRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetShare -func (c *Omics) GetShareRequest(input *GetShareInput) (req *request.Request, output *GetShareOutput) { - op := &request.Operation{ - Name: opGetShare, - HTTPMethod: "GET", - HTTPPath: "/share/{shareId}", - } - - if input == nil { - input = &GetShareInput{} - } - - output = &GetShareOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetShare API operation for Amazon Omics. -// -// Retrieves the metadata for a share. -// -// 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 Omics's -// API operation GetShare for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetShare -func (c *Omics) GetShare(input *GetShareInput) (*GetShareOutput, error) { - req, out := c.GetShareRequest(input) - return out, req.Send() -} - -// GetShareWithContext is the same as GetShare with the addition of -// the ability to pass a context and additional request options. -// -// See GetShare 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 *Omics) GetShareWithContext(ctx aws.Context, input *GetShareInput, opts ...request.Option) (*GetShareOutput, error) { - req, out := c.GetShareRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVariantImportJob = "GetVariantImportJob" - -// GetVariantImportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetVariantImportJob 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 GetVariantImportJob for more information on using the GetVariantImportJob -// 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 GetVariantImportJobRequest method. -// req, resp := client.GetVariantImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetVariantImportJob -func (c *Omics) GetVariantImportJobRequest(input *GetVariantImportJobInput) (req *request.Request, output *GetVariantImportJobOutput) { - op := &request.Operation{ - Name: opGetVariantImportJob, - HTTPMethod: "GET", - HTTPPath: "/import/variant/{jobId}", - } - - if input == nil { - input = &GetVariantImportJobInput{} - } - - output = &GetVariantImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetVariantImportJob API operation for Amazon Omics. -// -// Gets information about a variant import job. -// -// 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 Omics's -// API operation GetVariantImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetVariantImportJob -func (c *Omics) GetVariantImportJob(input *GetVariantImportJobInput) (*GetVariantImportJobOutput, error) { - req, out := c.GetVariantImportJobRequest(input) - return out, req.Send() -} - -// GetVariantImportJobWithContext is the same as GetVariantImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetVariantImportJob 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 *Omics) GetVariantImportJobWithContext(ctx aws.Context, input *GetVariantImportJobInput, opts ...request.Option) (*GetVariantImportJobOutput, error) { - req, out := c.GetVariantImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVariantStore = "GetVariantStore" - -// GetVariantStoreRequest generates a "aws/request.Request" representing the -// client's request for the GetVariantStore 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 GetVariantStore for more information on using the GetVariantStore -// 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 GetVariantStoreRequest method. -// req, resp := client.GetVariantStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetVariantStore -func (c *Omics) GetVariantStoreRequest(input *GetVariantStoreInput) (req *request.Request, output *GetVariantStoreOutput) { - op := &request.Operation{ - Name: opGetVariantStore, - HTTPMethod: "GET", - HTTPPath: "/variantStore/{name}", - } - - if input == nil { - input = &GetVariantStoreInput{} - } - - output = &GetVariantStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetVariantStore API operation for Amazon Omics. -// -// Gets information about a variant store. -// -// 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 Omics's -// API operation GetVariantStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetVariantStore -func (c *Omics) GetVariantStore(input *GetVariantStoreInput) (*GetVariantStoreOutput, error) { - req, out := c.GetVariantStoreRequest(input) - return out, req.Send() -} - -// GetVariantStoreWithContext is the same as GetVariantStore with the addition of -// the ability to pass a context and additional request options. -// -// See GetVariantStore 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 *Omics) GetVariantStoreWithContext(ctx aws.Context, input *GetVariantStoreInput, opts ...request.Option) (*GetVariantStoreOutput, error) { - req, out := c.GetVariantStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWorkflow = "GetWorkflow" - -// GetWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the GetWorkflow 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 GetWorkflow for more information on using the GetWorkflow -// 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 GetWorkflowRequest method. -// req, resp := client.GetWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetWorkflow -func (c *Omics) GetWorkflowRequest(input *GetWorkflowInput) (req *request.Request, output *GetWorkflowOutput) { - op := &request.Operation{ - Name: opGetWorkflow, - HTTPMethod: "GET", - HTTPPath: "/workflow/{id}", - } - - if input == nil { - input = &GetWorkflowInput{} - } - - output = &GetWorkflowOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetWorkflow API operation for Amazon Omics. -// -// Gets information about a workflow. -// -// 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 Omics's -// API operation GetWorkflow for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/GetWorkflow -func (c *Omics) GetWorkflow(input *GetWorkflowInput) (*GetWorkflowOutput, error) { - req, out := c.GetWorkflowRequest(input) - return out, req.Send() -} - -// GetWorkflowWithContext is the same as GetWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See GetWorkflow 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 *Omics) GetWorkflowWithContext(ctx aws.Context, input *GetWorkflowInput, opts ...request.Option) (*GetWorkflowOutput, error) { - req, out := c.GetWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAnnotationImportJobs = "ListAnnotationImportJobs" - -// ListAnnotationImportJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListAnnotationImportJobs 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 ListAnnotationImportJobs for more information on using the ListAnnotationImportJobs -// 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 ListAnnotationImportJobsRequest method. -// req, resp := client.ListAnnotationImportJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListAnnotationImportJobs -func (c *Omics) ListAnnotationImportJobsRequest(input *ListAnnotationImportJobsInput) (req *request.Request, output *ListAnnotationImportJobsOutput) { - op := &request.Operation{ - Name: opListAnnotationImportJobs, - HTTPMethod: "POST", - HTTPPath: "/import/annotations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAnnotationImportJobsInput{} - } - - output = &ListAnnotationImportJobsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListAnnotationImportJobs API operation for Amazon Omics. -// -// Retrieves a list of annotation import jobs. -// -// 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 Omics's -// API operation ListAnnotationImportJobs for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListAnnotationImportJobs -func (c *Omics) ListAnnotationImportJobs(input *ListAnnotationImportJobsInput) (*ListAnnotationImportJobsOutput, error) { - req, out := c.ListAnnotationImportJobsRequest(input) - return out, req.Send() -} - -// ListAnnotationImportJobsWithContext is the same as ListAnnotationImportJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListAnnotationImportJobs 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 *Omics) ListAnnotationImportJobsWithContext(ctx aws.Context, input *ListAnnotationImportJobsInput, opts ...request.Option) (*ListAnnotationImportJobsOutput, error) { - req, out := c.ListAnnotationImportJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAnnotationImportJobsPages iterates over the pages of a ListAnnotationImportJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAnnotationImportJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAnnotationImportJobs operation. -// pageNum := 0 -// err := client.ListAnnotationImportJobsPages(params, -// func(page *omics.ListAnnotationImportJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListAnnotationImportJobsPages(input *ListAnnotationImportJobsInput, fn func(*ListAnnotationImportJobsOutput, bool) bool) error { - return c.ListAnnotationImportJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAnnotationImportJobsPagesWithContext same as ListAnnotationImportJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListAnnotationImportJobsPagesWithContext(ctx aws.Context, input *ListAnnotationImportJobsInput, fn func(*ListAnnotationImportJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAnnotationImportJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAnnotationImportJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAnnotationImportJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAnnotationStoreVersions = "ListAnnotationStoreVersions" - -// ListAnnotationStoreVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListAnnotationStoreVersions 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 ListAnnotationStoreVersions for more information on using the ListAnnotationStoreVersions -// 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 ListAnnotationStoreVersionsRequest method. -// req, resp := client.ListAnnotationStoreVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListAnnotationStoreVersions -func (c *Omics) ListAnnotationStoreVersionsRequest(input *ListAnnotationStoreVersionsInput) (req *request.Request, output *ListAnnotationStoreVersionsOutput) { - op := &request.Operation{ - Name: opListAnnotationStoreVersions, - HTTPMethod: "POST", - HTTPPath: "/annotationStore/{name}/versions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAnnotationStoreVersionsInput{} - } - - output = &ListAnnotationStoreVersionsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListAnnotationStoreVersions API operation for Amazon Omics. -// -// Lists the versions of an annotation store. -// -// 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 Omics's -// API operation ListAnnotationStoreVersions for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListAnnotationStoreVersions -func (c *Omics) ListAnnotationStoreVersions(input *ListAnnotationStoreVersionsInput) (*ListAnnotationStoreVersionsOutput, error) { - req, out := c.ListAnnotationStoreVersionsRequest(input) - return out, req.Send() -} - -// ListAnnotationStoreVersionsWithContext is the same as ListAnnotationStoreVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListAnnotationStoreVersions 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 *Omics) ListAnnotationStoreVersionsWithContext(ctx aws.Context, input *ListAnnotationStoreVersionsInput, opts ...request.Option) (*ListAnnotationStoreVersionsOutput, error) { - req, out := c.ListAnnotationStoreVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAnnotationStoreVersionsPages iterates over the pages of a ListAnnotationStoreVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAnnotationStoreVersions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAnnotationStoreVersions operation. -// pageNum := 0 -// err := client.ListAnnotationStoreVersionsPages(params, -// func(page *omics.ListAnnotationStoreVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListAnnotationStoreVersionsPages(input *ListAnnotationStoreVersionsInput, fn func(*ListAnnotationStoreVersionsOutput, bool) bool) error { - return c.ListAnnotationStoreVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAnnotationStoreVersionsPagesWithContext same as ListAnnotationStoreVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListAnnotationStoreVersionsPagesWithContext(ctx aws.Context, input *ListAnnotationStoreVersionsInput, fn func(*ListAnnotationStoreVersionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAnnotationStoreVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAnnotationStoreVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAnnotationStoreVersionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAnnotationStores = "ListAnnotationStores" - -// ListAnnotationStoresRequest generates a "aws/request.Request" representing the -// client's request for the ListAnnotationStores 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 ListAnnotationStores for more information on using the ListAnnotationStores -// 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 ListAnnotationStoresRequest method. -// req, resp := client.ListAnnotationStoresRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListAnnotationStores -func (c *Omics) ListAnnotationStoresRequest(input *ListAnnotationStoresInput) (req *request.Request, output *ListAnnotationStoresOutput) { - op := &request.Operation{ - Name: opListAnnotationStores, - HTTPMethod: "POST", - HTTPPath: "/annotationStores", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAnnotationStoresInput{} - } - - output = &ListAnnotationStoresOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListAnnotationStores API operation for Amazon Omics. -// -// Retrieves a list of annotation stores. -// -// 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 Omics's -// API operation ListAnnotationStores for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListAnnotationStores -func (c *Omics) ListAnnotationStores(input *ListAnnotationStoresInput) (*ListAnnotationStoresOutput, error) { - req, out := c.ListAnnotationStoresRequest(input) - return out, req.Send() -} - -// ListAnnotationStoresWithContext is the same as ListAnnotationStores with the addition of -// the ability to pass a context and additional request options. -// -// See ListAnnotationStores 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 *Omics) ListAnnotationStoresWithContext(ctx aws.Context, input *ListAnnotationStoresInput, opts ...request.Option) (*ListAnnotationStoresOutput, error) { - req, out := c.ListAnnotationStoresRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAnnotationStoresPages iterates over the pages of a ListAnnotationStores operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAnnotationStores method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAnnotationStores operation. -// pageNum := 0 -// err := client.ListAnnotationStoresPages(params, -// func(page *omics.ListAnnotationStoresOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListAnnotationStoresPages(input *ListAnnotationStoresInput, fn func(*ListAnnotationStoresOutput, bool) bool) error { - return c.ListAnnotationStoresPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAnnotationStoresPagesWithContext same as ListAnnotationStoresPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListAnnotationStoresPagesWithContext(ctx aws.Context, input *ListAnnotationStoresInput, fn func(*ListAnnotationStoresOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAnnotationStoresInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAnnotationStoresRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAnnotationStoresOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListMultipartReadSetUploads = "ListMultipartReadSetUploads" - -// ListMultipartReadSetUploadsRequest generates a "aws/request.Request" representing the -// client's request for the ListMultipartReadSetUploads 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 ListMultipartReadSetUploads for more information on using the ListMultipartReadSetUploads -// 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 ListMultipartReadSetUploadsRequest method. -// req, resp := client.ListMultipartReadSetUploadsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListMultipartReadSetUploads -func (c *Omics) ListMultipartReadSetUploadsRequest(input *ListMultipartReadSetUploadsInput) (req *request.Request, output *ListMultipartReadSetUploadsOutput) { - op := &request.Operation{ - Name: opListMultipartReadSetUploads, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/uploads", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMultipartReadSetUploadsInput{} - } - - output = &ListMultipartReadSetUploadsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListMultipartReadSetUploads API operation for Amazon Omics. -// -// Lists all multipart read set uploads and their statuses. -// -// 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 Omics's -// API operation ListMultipartReadSetUploads for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - NotSupportedOperationException -// The operation is not supported by Amazon Omics, or the API does not exist. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListMultipartReadSetUploads -func (c *Omics) ListMultipartReadSetUploads(input *ListMultipartReadSetUploadsInput) (*ListMultipartReadSetUploadsOutput, error) { - req, out := c.ListMultipartReadSetUploadsRequest(input) - return out, req.Send() -} - -// ListMultipartReadSetUploadsWithContext is the same as ListMultipartReadSetUploads with the addition of -// the ability to pass a context and additional request options. -// -// See ListMultipartReadSetUploads 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 *Omics) ListMultipartReadSetUploadsWithContext(ctx aws.Context, input *ListMultipartReadSetUploadsInput, opts ...request.Option) (*ListMultipartReadSetUploadsOutput, error) { - req, out := c.ListMultipartReadSetUploadsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMultipartReadSetUploadsPages iterates over the pages of a ListMultipartReadSetUploads operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMultipartReadSetUploads method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMultipartReadSetUploads operation. -// pageNum := 0 -// err := client.ListMultipartReadSetUploadsPages(params, -// func(page *omics.ListMultipartReadSetUploadsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListMultipartReadSetUploadsPages(input *ListMultipartReadSetUploadsInput, fn func(*ListMultipartReadSetUploadsOutput, bool) bool) error { - return c.ListMultipartReadSetUploadsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMultipartReadSetUploadsPagesWithContext same as ListMultipartReadSetUploadsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListMultipartReadSetUploadsPagesWithContext(ctx aws.Context, input *ListMultipartReadSetUploadsInput, fn func(*ListMultipartReadSetUploadsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMultipartReadSetUploadsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMultipartReadSetUploadsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListMultipartReadSetUploadsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListReadSetActivationJobs = "ListReadSetActivationJobs" - -// ListReadSetActivationJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListReadSetActivationJobs 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 ListReadSetActivationJobs for more information on using the ListReadSetActivationJobs -// 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 ListReadSetActivationJobsRequest method. -// req, resp := client.ListReadSetActivationJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSetActivationJobs -func (c *Omics) ListReadSetActivationJobsRequest(input *ListReadSetActivationJobsInput) (req *request.Request, output *ListReadSetActivationJobsOutput) { - op := &request.Operation{ - Name: opListReadSetActivationJobs, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/activationjobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListReadSetActivationJobsInput{} - } - - output = &ListReadSetActivationJobsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListReadSetActivationJobs API operation for Amazon Omics. -// -// Retrieves a list of read set activation jobs. -// -// 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 Omics's -// API operation ListReadSetActivationJobs for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSetActivationJobs -func (c *Omics) ListReadSetActivationJobs(input *ListReadSetActivationJobsInput) (*ListReadSetActivationJobsOutput, error) { - req, out := c.ListReadSetActivationJobsRequest(input) - return out, req.Send() -} - -// ListReadSetActivationJobsWithContext is the same as ListReadSetActivationJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListReadSetActivationJobs 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 *Omics) ListReadSetActivationJobsWithContext(ctx aws.Context, input *ListReadSetActivationJobsInput, opts ...request.Option) (*ListReadSetActivationJobsOutput, error) { - req, out := c.ListReadSetActivationJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListReadSetActivationJobsPages iterates over the pages of a ListReadSetActivationJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReadSetActivationJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListReadSetActivationJobs operation. -// pageNum := 0 -// err := client.ListReadSetActivationJobsPages(params, -// func(page *omics.ListReadSetActivationJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListReadSetActivationJobsPages(input *ListReadSetActivationJobsInput, fn func(*ListReadSetActivationJobsOutput, bool) bool) error { - return c.ListReadSetActivationJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReadSetActivationJobsPagesWithContext same as ListReadSetActivationJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListReadSetActivationJobsPagesWithContext(ctx aws.Context, input *ListReadSetActivationJobsInput, fn func(*ListReadSetActivationJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListReadSetActivationJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListReadSetActivationJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListReadSetActivationJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListReadSetExportJobs = "ListReadSetExportJobs" - -// ListReadSetExportJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListReadSetExportJobs 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 ListReadSetExportJobs for more information on using the ListReadSetExportJobs -// 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 ListReadSetExportJobsRequest method. -// req, resp := client.ListReadSetExportJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSetExportJobs -func (c *Omics) ListReadSetExportJobsRequest(input *ListReadSetExportJobsInput) (req *request.Request, output *ListReadSetExportJobsOutput) { - op := &request.Operation{ - Name: opListReadSetExportJobs, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/exportjobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListReadSetExportJobsInput{} - } - - output = &ListReadSetExportJobsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListReadSetExportJobs API operation for Amazon Omics. -// -// Retrieves a list of read set export jobs. -// -// 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 Omics's -// API operation ListReadSetExportJobs for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSetExportJobs -func (c *Omics) ListReadSetExportJobs(input *ListReadSetExportJobsInput) (*ListReadSetExportJobsOutput, error) { - req, out := c.ListReadSetExportJobsRequest(input) - return out, req.Send() -} - -// ListReadSetExportJobsWithContext is the same as ListReadSetExportJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListReadSetExportJobs 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 *Omics) ListReadSetExportJobsWithContext(ctx aws.Context, input *ListReadSetExportJobsInput, opts ...request.Option) (*ListReadSetExportJobsOutput, error) { - req, out := c.ListReadSetExportJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListReadSetExportJobsPages iterates over the pages of a ListReadSetExportJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReadSetExportJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListReadSetExportJobs operation. -// pageNum := 0 -// err := client.ListReadSetExportJobsPages(params, -// func(page *omics.ListReadSetExportJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListReadSetExportJobsPages(input *ListReadSetExportJobsInput, fn func(*ListReadSetExportJobsOutput, bool) bool) error { - return c.ListReadSetExportJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReadSetExportJobsPagesWithContext same as ListReadSetExportJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListReadSetExportJobsPagesWithContext(ctx aws.Context, input *ListReadSetExportJobsInput, fn func(*ListReadSetExportJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListReadSetExportJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListReadSetExportJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListReadSetExportJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListReadSetImportJobs = "ListReadSetImportJobs" - -// ListReadSetImportJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListReadSetImportJobs 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 ListReadSetImportJobs for more information on using the ListReadSetImportJobs -// 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 ListReadSetImportJobsRequest method. -// req, resp := client.ListReadSetImportJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSetImportJobs -func (c *Omics) ListReadSetImportJobsRequest(input *ListReadSetImportJobsInput) (req *request.Request, output *ListReadSetImportJobsOutput) { - op := &request.Operation{ - Name: opListReadSetImportJobs, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/importjobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListReadSetImportJobsInput{} - } - - output = &ListReadSetImportJobsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListReadSetImportJobs API operation for Amazon Omics. -// -// Retrieves a list of read set import jobs. -// -// 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 Omics's -// API operation ListReadSetImportJobs for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSetImportJobs -func (c *Omics) ListReadSetImportJobs(input *ListReadSetImportJobsInput) (*ListReadSetImportJobsOutput, error) { - req, out := c.ListReadSetImportJobsRequest(input) - return out, req.Send() -} - -// ListReadSetImportJobsWithContext is the same as ListReadSetImportJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListReadSetImportJobs 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 *Omics) ListReadSetImportJobsWithContext(ctx aws.Context, input *ListReadSetImportJobsInput, opts ...request.Option) (*ListReadSetImportJobsOutput, error) { - req, out := c.ListReadSetImportJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListReadSetImportJobsPages iterates over the pages of a ListReadSetImportJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReadSetImportJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListReadSetImportJobs operation. -// pageNum := 0 -// err := client.ListReadSetImportJobsPages(params, -// func(page *omics.ListReadSetImportJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListReadSetImportJobsPages(input *ListReadSetImportJobsInput, fn func(*ListReadSetImportJobsOutput, bool) bool) error { - return c.ListReadSetImportJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReadSetImportJobsPagesWithContext same as ListReadSetImportJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListReadSetImportJobsPagesWithContext(ctx aws.Context, input *ListReadSetImportJobsInput, fn func(*ListReadSetImportJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListReadSetImportJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListReadSetImportJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListReadSetImportJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListReadSetUploadParts = "ListReadSetUploadParts" - -// ListReadSetUploadPartsRequest generates a "aws/request.Request" representing the -// client's request for the ListReadSetUploadParts 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 ListReadSetUploadParts for more information on using the ListReadSetUploadParts -// 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 ListReadSetUploadPartsRequest method. -// req, resp := client.ListReadSetUploadPartsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSetUploadParts -func (c *Omics) ListReadSetUploadPartsRequest(input *ListReadSetUploadPartsInput) (req *request.Request, output *ListReadSetUploadPartsOutput) { - op := &request.Operation{ - Name: opListReadSetUploadParts, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/upload/{uploadId}/parts", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListReadSetUploadPartsInput{} - } - - output = &ListReadSetUploadPartsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListReadSetUploadParts API operation for Amazon Omics. -// -// This operation will list all parts in a requested multipart upload for a -// sequence store. -// -// 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 Omics's -// API operation ListReadSetUploadParts for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - NotSupportedOperationException -// The operation is not supported by Amazon Omics, or the API does not exist. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSetUploadParts -func (c *Omics) ListReadSetUploadParts(input *ListReadSetUploadPartsInput) (*ListReadSetUploadPartsOutput, error) { - req, out := c.ListReadSetUploadPartsRequest(input) - return out, req.Send() -} - -// ListReadSetUploadPartsWithContext is the same as ListReadSetUploadParts with the addition of -// the ability to pass a context and additional request options. -// -// See ListReadSetUploadParts 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 *Omics) ListReadSetUploadPartsWithContext(ctx aws.Context, input *ListReadSetUploadPartsInput, opts ...request.Option) (*ListReadSetUploadPartsOutput, error) { - req, out := c.ListReadSetUploadPartsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListReadSetUploadPartsPages iterates over the pages of a ListReadSetUploadParts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReadSetUploadParts method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListReadSetUploadParts operation. -// pageNum := 0 -// err := client.ListReadSetUploadPartsPages(params, -// func(page *omics.ListReadSetUploadPartsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListReadSetUploadPartsPages(input *ListReadSetUploadPartsInput, fn func(*ListReadSetUploadPartsOutput, bool) bool) error { - return c.ListReadSetUploadPartsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReadSetUploadPartsPagesWithContext same as ListReadSetUploadPartsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListReadSetUploadPartsPagesWithContext(ctx aws.Context, input *ListReadSetUploadPartsInput, fn func(*ListReadSetUploadPartsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListReadSetUploadPartsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListReadSetUploadPartsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListReadSetUploadPartsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListReadSets = "ListReadSets" - -// ListReadSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListReadSets 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 ListReadSets for more information on using the ListReadSets -// 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 ListReadSetsRequest method. -// req, resp := client.ListReadSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSets -func (c *Omics) ListReadSetsRequest(input *ListReadSetsInput) (req *request.Request, output *ListReadSetsOutput) { - op := &request.Operation{ - Name: opListReadSets, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/readsets", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListReadSetsInput{} - } - - output = &ListReadSetsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListReadSets API operation for Amazon Omics. -// -// Retrieves a list of read sets. -// -// 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 Omics's -// API operation ListReadSets for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReadSets -func (c *Omics) ListReadSets(input *ListReadSetsInput) (*ListReadSetsOutput, error) { - req, out := c.ListReadSetsRequest(input) - return out, req.Send() -} - -// ListReadSetsWithContext is the same as ListReadSets with the addition of -// the ability to pass a context and additional request options. -// -// See ListReadSets 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 *Omics) ListReadSetsWithContext(ctx aws.Context, input *ListReadSetsInput, opts ...request.Option) (*ListReadSetsOutput, error) { - req, out := c.ListReadSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListReadSetsPages iterates over the pages of a ListReadSets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReadSets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListReadSets operation. -// pageNum := 0 -// err := client.ListReadSetsPages(params, -// func(page *omics.ListReadSetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListReadSetsPages(input *ListReadSetsInput, fn func(*ListReadSetsOutput, bool) bool) error { - return c.ListReadSetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReadSetsPagesWithContext same as ListReadSetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListReadSetsPagesWithContext(ctx aws.Context, input *ListReadSetsInput, fn func(*ListReadSetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListReadSetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListReadSetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListReadSetsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListReferenceImportJobs = "ListReferenceImportJobs" - -// ListReferenceImportJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListReferenceImportJobs 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 ListReferenceImportJobs for more information on using the ListReferenceImportJobs -// 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 ListReferenceImportJobsRequest method. -// req, resp := client.ListReferenceImportJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReferenceImportJobs -func (c *Omics) ListReferenceImportJobsRequest(input *ListReferenceImportJobsInput) (req *request.Request, output *ListReferenceImportJobsOutput) { - op := &request.Operation{ - Name: opListReferenceImportJobs, - HTTPMethod: "POST", - HTTPPath: "/referencestore/{referenceStoreId}/importjobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListReferenceImportJobsInput{} - } - - output = &ListReferenceImportJobsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListReferenceImportJobs API operation for Amazon Omics. -// -// Retrieves a list of reference import jobs. -// -// 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 Omics's -// API operation ListReferenceImportJobs for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReferenceImportJobs -func (c *Omics) ListReferenceImportJobs(input *ListReferenceImportJobsInput) (*ListReferenceImportJobsOutput, error) { - req, out := c.ListReferenceImportJobsRequest(input) - return out, req.Send() -} - -// ListReferenceImportJobsWithContext is the same as ListReferenceImportJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListReferenceImportJobs 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 *Omics) ListReferenceImportJobsWithContext(ctx aws.Context, input *ListReferenceImportJobsInput, opts ...request.Option) (*ListReferenceImportJobsOutput, error) { - req, out := c.ListReferenceImportJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListReferenceImportJobsPages iterates over the pages of a ListReferenceImportJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReferenceImportJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListReferenceImportJobs operation. -// pageNum := 0 -// err := client.ListReferenceImportJobsPages(params, -// func(page *omics.ListReferenceImportJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListReferenceImportJobsPages(input *ListReferenceImportJobsInput, fn func(*ListReferenceImportJobsOutput, bool) bool) error { - return c.ListReferenceImportJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReferenceImportJobsPagesWithContext same as ListReferenceImportJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListReferenceImportJobsPagesWithContext(ctx aws.Context, input *ListReferenceImportJobsInput, fn func(*ListReferenceImportJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListReferenceImportJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListReferenceImportJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListReferenceImportJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListReferenceStores = "ListReferenceStores" - -// ListReferenceStoresRequest generates a "aws/request.Request" representing the -// client's request for the ListReferenceStores 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 ListReferenceStores for more information on using the ListReferenceStores -// 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 ListReferenceStoresRequest method. -// req, resp := client.ListReferenceStoresRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReferenceStores -func (c *Omics) ListReferenceStoresRequest(input *ListReferenceStoresInput) (req *request.Request, output *ListReferenceStoresOutput) { - op := &request.Operation{ - Name: opListReferenceStores, - HTTPMethod: "POST", - HTTPPath: "/referencestores", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListReferenceStoresInput{} - } - - output = &ListReferenceStoresOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListReferenceStores API operation for Amazon Omics. -// -// Retrieves a list of reference stores. -// -// 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 Omics's -// API operation ListReferenceStores for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReferenceStores -func (c *Omics) ListReferenceStores(input *ListReferenceStoresInput) (*ListReferenceStoresOutput, error) { - req, out := c.ListReferenceStoresRequest(input) - return out, req.Send() -} - -// ListReferenceStoresWithContext is the same as ListReferenceStores with the addition of -// the ability to pass a context and additional request options. -// -// See ListReferenceStores 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 *Omics) ListReferenceStoresWithContext(ctx aws.Context, input *ListReferenceStoresInput, opts ...request.Option) (*ListReferenceStoresOutput, error) { - req, out := c.ListReferenceStoresRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListReferenceStoresPages iterates over the pages of a ListReferenceStores operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReferenceStores method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListReferenceStores operation. -// pageNum := 0 -// err := client.ListReferenceStoresPages(params, -// func(page *omics.ListReferenceStoresOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListReferenceStoresPages(input *ListReferenceStoresInput, fn func(*ListReferenceStoresOutput, bool) bool) error { - return c.ListReferenceStoresPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReferenceStoresPagesWithContext same as ListReferenceStoresPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListReferenceStoresPagesWithContext(ctx aws.Context, input *ListReferenceStoresInput, fn func(*ListReferenceStoresOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListReferenceStoresInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListReferenceStoresRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListReferenceStoresOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListReferences = "ListReferences" - -// ListReferencesRequest generates a "aws/request.Request" representing the -// client's request for the ListReferences 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 ListReferences for more information on using the ListReferences -// 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 ListReferencesRequest method. -// req, resp := client.ListReferencesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReferences -func (c *Omics) ListReferencesRequest(input *ListReferencesInput) (req *request.Request, output *ListReferencesOutput) { - op := &request.Operation{ - Name: opListReferences, - HTTPMethod: "POST", - HTTPPath: "/referencestore/{referenceStoreId}/references", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListReferencesInput{} - } - - output = &ListReferencesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListReferences API operation for Amazon Omics. -// -// Retrieves a list of references. -// -// 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 Omics's -// API operation ListReferences for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListReferences -func (c *Omics) ListReferences(input *ListReferencesInput) (*ListReferencesOutput, error) { - req, out := c.ListReferencesRequest(input) - return out, req.Send() -} - -// ListReferencesWithContext is the same as ListReferences with the addition of -// the ability to pass a context and additional request options. -// -// See ListReferences 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 *Omics) ListReferencesWithContext(ctx aws.Context, input *ListReferencesInput, opts ...request.Option) (*ListReferencesOutput, error) { - req, out := c.ListReferencesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListReferencesPages iterates over the pages of a ListReferences operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListReferences method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListReferences operation. -// pageNum := 0 -// err := client.ListReferencesPages(params, -// func(page *omics.ListReferencesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListReferencesPages(input *ListReferencesInput, fn func(*ListReferencesOutput, bool) bool) error { - return c.ListReferencesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListReferencesPagesWithContext same as ListReferencesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListReferencesPagesWithContext(ctx aws.Context, input *ListReferencesInput, fn func(*ListReferencesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListReferencesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListReferencesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListReferencesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRunGroups = "ListRunGroups" - -// ListRunGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListRunGroups 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 ListRunGroups for more information on using the ListRunGroups -// 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 ListRunGroupsRequest method. -// req, resp := client.ListRunGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListRunGroups -func (c *Omics) ListRunGroupsRequest(input *ListRunGroupsInput) (req *request.Request, output *ListRunGroupsOutput) { - op := &request.Operation{ - Name: opListRunGroups, - HTTPMethod: "GET", - HTTPPath: "/runGroup", - Paginator: &request.Paginator{ - InputTokens: []string{"startingToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRunGroupsInput{} - } - - output = &ListRunGroupsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListRunGroups API operation for Amazon Omics. -// -// Retrieves a list of run groups. -// -// 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 Omics's -// API operation ListRunGroups for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListRunGroups -func (c *Omics) ListRunGroups(input *ListRunGroupsInput) (*ListRunGroupsOutput, error) { - req, out := c.ListRunGroupsRequest(input) - return out, req.Send() -} - -// ListRunGroupsWithContext is the same as ListRunGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListRunGroups 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 *Omics) ListRunGroupsWithContext(ctx aws.Context, input *ListRunGroupsInput, opts ...request.Option) (*ListRunGroupsOutput, error) { - req, out := c.ListRunGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRunGroupsPages iterates over the pages of a ListRunGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRunGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRunGroups operation. -// pageNum := 0 -// err := client.ListRunGroupsPages(params, -// func(page *omics.ListRunGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListRunGroupsPages(input *ListRunGroupsInput, fn func(*ListRunGroupsOutput, bool) bool) error { - return c.ListRunGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRunGroupsPagesWithContext same as ListRunGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListRunGroupsPagesWithContext(ctx aws.Context, input *ListRunGroupsInput, fn func(*ListRunGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRunGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRunGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRunGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRunTasks = "ListRunTasks" - -// ListRunTasksRequest generates a "aws/request.Request" representing the -// client's request for the ListRunTasks 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 ListRunTasks for more information on using the ListRunTasks -// 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 ListRunTasksRequest method. -// req, resp := client.ListRunTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListRunTasks -func (c *Omics) ListRunTasksRequest(input *ListRunTasksInput) (req *request.Request, output *ListRunTasksOutput) { - op := &request.Operation{ - Name: opListRunTasks, - HTTPMethod: "GET", - HTTPPath: "/run/{id}/task", - Paginator: &request.Paginator{ - InputTokens: []string{"startingToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRunTasksInput{} - } - - output = &ListRunTasksOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListRunTasks API operation for Amazon Omics. -// -// Retrieves a list of tasks for a run. -// -// 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 Omics's -// API operation ListRunTasks for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListRunTasks -func (c *Omics) ListRunTasks(input *ListRunTasksInput) (*ListRunTasksOutput, error) { - req, out := c.ListRunTasksRequest(input) - return out, req.Send() -} - -// ListRunTasksWithContext is the same as ListRunTasks with the addition of -// the ability to pass a context and additional request options. -// -// See ListRunTasks 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 *Omics) ListRunTasksWithContext(ctx aws.Context, input *ListRunTasksInput, opts ...request.Option) (*ListRunTasksOutput, error) { - req, out := c.ListRunTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRunTasksPages iterates over the pages of a ListRunTasks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRunTasks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRunTasks operation. -// pageNum := 0 -// err := client.ListRunTasksPages(params, -// func(page *omics.ListRunTasksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListRunTasksPages(input *ListRunTasksInput, fn func(*ListRunTasksOutput, bool) bool) error { - return c.ListRunTasksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRunTasksPagesWithContext same as ListRunTasksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListRunTasksPagesWithContext(ctx aws.Context, input *ListRunTasksInput, fn func(*ListRunTasksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRunTasksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRunTasksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRunTasksOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRuns = "ListRuns" - -// ListRunsRequest generates a "aws/request.Request" representing the -// client's request for the ListRuns 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 ListRuns for more information on using the ListRuns -// 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 ListRunsRequest method. -// req, resp := client.ListRunsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListRuns -func (c *Omics) ListRunsRequest(input *ListRunsInput) (req *request.Request, output *ListRunsOutput) { - op := &request.Operation{ - Name: opListRuns, - HTTPMethod: "GET", - HTTPPath: "/run", - Paginator: &request.Paginator{ - InputTokens: []string{"startingToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRunsInput{} - } - - output = &ListRunsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListRuns API operation for Amazon Omics. -// -// Retrieves a list of runs. -// -// 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 Omics's -// API operation ListRuns for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListRuns -func (c *Omics) ListRuns(input *ListRunsInput) (*ListRunsOutput, error) { - req, out := c.ListRunsRequest(input) - return out, req.Send() -} - -// ListRunsWithContext is the same as ListRuns with the addition of -// the ability to pass a context and additional request options. -// -// See ListRuns 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 *Omics) ListRunsWithContext(ctx aws.Context, input *ListRunsInput, opts ...request.Option) (*ListRunsOutput, error) { - req, out := c.ListRunsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRunsPages iterates over the pages of a ListRuns operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRuns method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRuns operation. -// pageNum := 0 -// err := client.ListRunsPages(params, -// func(page *omics.ListRunsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListRunsPages(input *ListRunsInput, fn func(*ListRunsOutput, bool) bool) error { - return c.ListRunsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRunsPagesWithContext same as ListRunsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListRunsPagesWithContext(ctx aws.Context, input *ListRunsInput, fn func(*ListRunsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRunsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRunsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRunsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSequenceStores = "ListSequenceStores" - -// ListSequenceStoresRequest generates a "aws/request.Request" representing the -// client's request for the ListSequenceStores 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 ListSequenceStores for more information on using the ListSequenceStores -// 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 ListSequenceStoresRequest method. -// req, resp := client.ListSequenceStoresRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListSequenceStores -func (c *Omics) ListSequenceStoresRequest(input *ListSequenceStoresInput) (req *request.Request, output *ListSequenceStoresOutput) { - op := &request.Operation{ - Name: opListSequenceStores, - HTTPMethod: "POST", - HTTPPath: "/sequencestores", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSequenceStoresInput{} - } - - output = &ListSequenceStoresOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListSequenceStores API operation for Amazon Omics. -// -// Retrieves a list of sequence stores. -// -// 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 Omics's -// API operation ListSequenceStores for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListSequenceStores -func (c *Omics) ListSequenceStores(input *ListSequenceStoresInput) (*ListSequenceStoresOutput, error) { - req, out := c.ListSequenceStoresRequest(input) - return out, req.Send() -} - -// ListSequenceStoresWithContext is the same as ListSequenceStores with the addition of -// the ability to pass a context and additional request options. -// -// See ListSequenceStores 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 *Omics) ListSequenceStoresWithContext(ctx aws.Context, input *ListSequenceStoresInput, opts ...request.Option) (*ListSequenceStoresOutput, error) { - req, out := c.ListSequenceStoresRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSequenceStoresPages iterates over the pages of a ListSequenceStores operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSequenceStores method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSequenceStores operation. -// pageNum := 0 -// err := client.ListSequenceStoresPages(params, -// func(page *omics.ListSequenceStoresOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListSequenceStoresPages(input *ListSequenceStoresInput, fn func(*ListSequenceStoresOutput, bool) bool) error { - return c.ListSequenceStoresPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSequenceStoresPagesWithContext same as ListSequenceStoresPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListSequenceStoresPagesWithContext(ctx aws.Context, input *ListSequenceStoresInput, fn func(*ListSequenceStoresOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSequenceStoresInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSequenceStoresRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSequenceStoresOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListShares = "ListShares" - -// ListSharesRequest generates a "aws/request.Request" representing the -// client's request for the ListShares 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 ListShares for more information on using the ListShares -// 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 ListSharesRequest method. -// req, resp := client.ListSharesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListShares -func (c *Omics) ListSharesRequest(input *ListSharesInput) (req *request.Request, output *ListSharesOutput) { - op := &request.Operation{ - Name: opListShares, - HTTPMethod: "POST", - HTTPPath: "/shares", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSharesInput{} - } - - output = &ListSharesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListShares API operation for Amazon Omics. -// -// Lists all shares associated with an account. -// -// 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 Omics's -// API operation ListShares for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListShares -func (c *Omics) ListShares(input *ListSharesInput) (*ListSharesOutput, error) { - req, out := c.ListSharesRequest(input) - return out, req.Send() -} - -// ListSharesWithContext is the same as ListShares with the addition of -// the ability to pass a context and additional request options. -// -// See ListShares 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 *Omics) ListSharesWithContext(ctx aws.Context, input *ListSharesInput, opts ...request.Option) (*ListSharesOutput, error) { - req, out := c.ListSharesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSharesPages iterates over the pages of a ListShares operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListShares method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListShares operation. -// pageNum := 0 -// err := client.ListSharesPages(params, -// func(page *omics.ListSharesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListSharesPages(input *ListSharesInput, fn func(*ListSharesOutput, bool) bool) error { - return c.ListSharesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSharesPagesWithContext same as ListSharesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListSharesPagesWithContext(ctx aws.Context, input *ListSharesInput, fn func(*ListSharesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSharesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSharesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSharesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListTagsForResource -func (c *Omics) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("tags-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListTagsForResource API operation for Amazon Omics. -// -// Retrieves a list of tags for a resource. -// -// 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 Omics's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListTagsForResource -func (c *Omics) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *Omics) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListVariantImportJobs = "ListVariantImportJobs" - -// ListVariantImportJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListVariantImportJobs 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 ListVariantImportJobs for more information on using the ListVariantImportJobs -// 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 ListVariantImportJobsRequest method. -// req, resp := client.ListVariantImportJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListVariantImportJobs -func (c *Omics) ListVariantImportJobsRequest(input *ListVariantImportJobsInput) (req *request.Request, output *ListVariantImportJobsOutput) { - op := &request.Operation{ - Name: opListVariantImportJobs, - HTTPMethod: "POST", - HTTPPath: "/import/variants", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVariantImportJobsInput{} - } - - output = &ListVariantImportJobsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListVariantImportJobs API operation for Amazon Omics. -// -// Retrieves a list of variant import jobs. -// -// 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 Omics's -// API operation ListVariantImportJobs for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListVariantImportJobs -func (c *Omics) ListVariantImportJobs(input *ListVariantImportJobsInput) (*ListVariantImportJobsOutput, error) { - req, out := c.ListVariantImportJobsRequest(input) - return out, req.Send() -} - -// ListVariantImportJobsWithContext is the same as ListVariantImportJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListVariantImportJobs 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 *Omics) ListVariantImportJobsWithContext(ctx aws.Context, input *ListVariantImportJobsInput, opts ...request.Option) (*ListVariantImportJobsOutput, error) { - req, out := c.ListVariantImportJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVariantImportJobsPages iterates over the pages of a ListVariantImportJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVariantImportJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVariantImportJobs operation. -// pageNum := 0 -// err := client.ListVariantImportJobsPages(params, -// func(page *omics.ListVariantImportJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListVariantImportJobsPages(input *ListVariantImportJobsInput, fn func(*ListVariantImportJobsOutput, bool) bool) error { - return c.ListVariantImportJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVariantImportJobsPagesWithContext same as ListVariantImportJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListVariantImportJobsPagesWithContext(ctx aws.Context, input *ListVariantImportJobsInput, fn func(*ListVariantImportJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVariantImportJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVariantImportJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVariantImportJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListVariantStores = "ListVariantStores" - -// ListVariantStoresRequest generates a "aws/request.Request" representing the -// client's request for the ListVariantStores 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 ListVariantStores for more information on using the ListVariantStores -// 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 ListVariantStoresRequest method. -// req, resp := client.ListVariantStoresRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListVariantStores -func (c *Omics) ListVariantStoresRequest(input *ListVariantStoresInput) (req *request.Request, output *ListVariantStoresOutput) { - op := &request.Operation{ - Name: opListVariantStores, - HTTPMethod: "POST", - HTTPPath: "/variantStores", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVariantStoresInput{} - } - - output = &ListVariantStoresOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListVariantStores API operation for Amazon Omics. -// -// Retrieves a list of variant stores. -// -// 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 Omics's -// API operation ListVariantStores for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListVariantStores -func (c *Omics) ListVariantStores(input *ListVariantStoresInput) (*ListVariantStoresOutput, error) { - req, out := c.ListVariantStoresRequest(input) - return out, req.Send() -} - -// ListVariantStoresWithContext is the same as ListVariantStores with the addition of -// the ability to pass a context and additional request options. -// -// See ListVariantStores 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 *Omics) ListVariantStoresWithContext(ctx aws.Context, input *ListVariantStoresInput, opts ...request.Option) (*ListVariantStoresOutput, error) { - req, out := c.ListVariantStoresRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVariantStoresPages iterates over the pages of a ListVariantStores operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVariantStores method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVariantStores operation. -// pageNum := 0 -// err := client.ListVariantStoresPages(params, -// func(page *omics.ListVariantStoresOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListVariantStoresPages(input *ListVariantStoresInput, fn func(*ListVariantStoresOutput, bool) bool) error { - return c.ListVariantStoresPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVariantStoresPagesWithContext same as ListVariantStoresPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListVariantStoresPagesWithContext(ctx aws.Context, input *ListVariantStoresInput, fn func(*ListVariantStoresOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVariantStoresInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVariantStoresRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVariantStoresOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkflows = "ListWorkflows" - -// ListWorkflowsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkflows 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 ListWorkflows for more information on using the ListWorkflows -// 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 ListWorkflowsRequest method. -// req, resp := client.ListWorkflowsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListWorkflows -func (c *Omics) ListWorkflowsRequest(input *ListWorkflowsInput) (req *request.Request, output *ListWorkflowsOutput) { - op := &request.Operation{ - Name: opListWorkflows, - HTTPMethod: "GET", - HTTPPath: "/workflow", - Paginator: &request.Paginator{ - InputTokens: []string{"startingToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkflowsInput{} - } - - output = &ListWorkflowsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListWorkflows API operation for Amazon Omics. -// -// Retrieves a list of workflows. -// -// 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 Omics's -// API operation ListWorkflows for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/ListWorkflows -func (c *Omics) ListWorkflows(input *ListWorkflowsInput) (*ListWorkflowsOutput, error) { - req, out := c.ListWorkflowsRequest(input) - return out, req.Send() -} - -// ListWorkflowsWithContext is the same as ListWorkflows with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkflows 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 *Omics) ListWorkflowsWithContext(ctx aws.Context, input *ListWorkflowsInput, opts ...request.Option) (*ListWorkflowsOutput, error) { - req, out := c.ListWorkflowsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkflowsPages iterates over the pages of a ListWorkflows operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkflows method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkflows operation. -// pageNum := 0 -// err := client.ListWorkflowsPages(params, -// func(page *omics.ListWorkflowsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Omics) ListWorkflowsPages(input *ListWorkflowsInput, fn func(*ListWorkflowsOutput, bool) bool) error { - return c.ListWorkflowsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkflowsPagesWithContext same as ListWorkflowsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Omics) ListWorkflowsPagesWithContext(ctx aws.Context, input *ListWorkflowsInput, fn func(*ListWorkflowsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkflowsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkflowsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkflowsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartAnnotationImportJob = "StartAnnotationImportJob" - -// StartAnnotationImportJobRequest generates a "aws/request.Request" representing the -// client's request for the StartAnnotationImportJob 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 StartAnnotationImportJob for more information on using the StartAnnotationImportJob -// 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 StartAnnotationImportJobRequest method. -// req, resp := client.StartAnnotationImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartAnnotationImportJob -func (c *Omics) StartAnnotationImportJobRequest(input *StartAnnotationImportJobInput) (req *request.Request, output *StartAnnotationImportJobOutput) { - op := &request.Operation{ - Name: opStartAnnotationImportJob, - HTTPMethod: "POST", - HTTPPath: "/import/annotation", - } - - if input == nil { - input = &StartAnnotationImportJobInput{} - } - - output = &StartAnnotationImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// StartAnnotationImportJob API operation for Amazon Omics. -// -// Starts an annotation import job. -// -// 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 Omics's -// API operation StartAnnotationImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartAnnotationImportJob -func (c *Omics) StartAnnotationImportJob(input *StartAnnotationImportJobInput) (*StartAnnotationImportJobOutput, error) { - req, out := c.StartAnnotationImportJobRequest(input) - return out, req.Send() -} - -// StartAnnotationImportJobWithContext is the same as StartAnnotationImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartAnnotationImportJob 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 *Omics) StartAnnotationImportJobWithContext(ctx aws.Context, input *StartAnnotationImportJobInput, opts ...request.Option) (*StartAnnotationImportJobOutput, error) { - req, out := c.StartAnnotationImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartReadSetActivationJob = "StartReadSetActivationJob" - -// StartReadSetActivationJobRequest generates a "aws/request.Request" representing the -// client's request for the StartReadSetActivationJob 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 StartReadSetActivationJob for more information on using the StartReadSetActivationJob -// 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 StartReadSetActivationJobRequest method. -// req, resp := client.StartReadSetActivationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartReadSetActivationJob -func (c *Omics) StartReadSetActivationJobRequest(input *StartReadSetActivationJobInput) (req *request.Request, output *StartReadSetActivationJobOutput) { - op := &request.Operation{ - Name: opStartReadSetActivationJob, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/activationjob", - } - - if input == nil { - input = &StartReadSetActivationJobInput{} - } - - output = &StartReadSetActivationJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// StartReadSetActivationJob API operation for Amazon Omics. -// -// Activates an archived read set. To reduce storage charges, Amazon Omics archives -// unused read sets after 30 days. -// -// 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 Omics's -// API operation StartReadSetActivationJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartReadSetActivationJob -func (c *Omics) StartReadSetActivationJob(input *StartReadSetActivationJobInput) (*StartReadSetActivationJobOutput, error) { - req, out := c.StartReadSetActivationJobRequest(input) - return out, req.Send() -} - -// StartReadSetActivationJobWithContext is the same as StartReadSetActivationJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartReadSetActivationJob 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 *Omics) StartReadSetActivationJobWithContext(ctx aws.Context, input *StartReadSetActivationJobInput, opts ...request.Option) (*StartReadSetActivationJobOutput, error) { - req, out := c.StartReadSetActivationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartReadSetExportJob = "StartReadSetExportJob" - -// StartReadSetExportJobRequest generates a "aws/request.Request" representing the -// client's request for the StartReadSetExportJob 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 StartReadSetExportJob for more information on using the StartReadSetExportJob -// 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 StartReadSetExportJobRequest method. -// req, resp := client.StartReadSetExportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartReadSetExportJob -func (c *Omics) StartReadSetExportJobRequest(input *StartReadSetExportJobInput) (req *request.Request, output *StartReadSetExportJobOutput) { - op := &request.Operation{ - Name: opStartReadSetExportJob, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/exportjob", - } - - if input == nil { - input = &StartReadSetExportJobInput{} - } - - output = &StartReadSetExportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// StartReadSetExportJob API operation for Amazon Omics. -// -// Exports a read set to Amazon S3. -// -// 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 Omics's -// API operation StartReadSetExportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartReadSetExportJob -func (c *Omics) StartReadSetExportJob(input *StartReadSetExportJobInput) (*StartReadSetExportJobOutput, error) { - req, out := c.StartReadSetExportJobRequest(input) - return out, req.Send() -} - -// StartReadSetExportJobWithContext is the same as StartReadSetExportJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartReadSetExportJob 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 *Omics) StartReadSetExportJobWithContext(ctx aws.Context, input *StartReadSetExportJobInput, opts ...request.Option) (*StartReadSetExportJobOutput, error) { - req, out := c.StartReadSetExportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartReadSetImportJob = "StartReadSetImportJob" - -// StartReadSetImportJobRequest generates a "aws/request.Request" representing the -// client's request for the StartReadSetImportJob 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 StartReadSetImportJob for more information on using the StartReadSetImportJob -// 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 StartReadSetImportJobRequest method. -// req, resp := client.StartReadSetImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartReadSetImportJob -func (c *Omics) StartReadSetImportJobRequest(input *StartReadSetImportJobInput) (req *request.Request, output *StartReadSetImportJobOutput) { - op := &request.Operation{ - Name: opStartReadSetImportJob, - HTTPMethod: "POST", - HTTPPath: "/sequencestore/{sequenceStoreId}/importjob", - } - - if input == nil { - input = &StartReadSetImportJobInput{} - } - - output = &StartReadSetImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// StartReadSetImportJob API operation for Amazon Omics. -// -// Starts a read set import job. -// -// 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 Omics's -// API operation StartReadSetImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartReadSetImportJob -func (c *Omics) StartReadSetImportJob(input *StartReadSetImportJobInput) (*StartReadSetImportJobOutput, error) { - req, out := c.StartReadSetImportJobRequest(input) - return out, req.Send() -} - -// StartReadSetImportJobWithContext is the same as StartReadSetImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartReadSetImportJob 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 *Omics) StartReadSetImportJobWithContext(ctx aws.Context, input *StartReadSetImportJobInput, opts ...request.Option) (*StartReadSetImportJobOutput, error) { - req, out := c.StartReadSetImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartReferenceImportJob = "StartReferenceImportJob" - -// StartReferenceImportJobRequest generates a "aws/request.Request" representing the -// client's request for the StartReferenceImportJob 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 StartReferenceImportJob for more information on using the StartReferenceImportJob -// 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 StartReferenceImportJobRequest method. -// req, resp := client.StartReferenceImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartReferenceImportJob -func (c *Omics) StartReferenceImportJobRequest(input *StartReferenceImportJobInput) (req *request.Request, output *StartReferenceImportJobOutput) { - op := &request.Operation{ - Name: opStartReferenceImportJob, - HTTPMethod: "POST", - HTTPPath: "/referencestore/{referenceStoreId}/importjob", - } - - if input == nil { - input = &StartReferenceImportJobInput{} - } - - output = &StartReferenceImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("control-storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// StartReferenceImportJob API operation for Amazon Omics. -// -// Starts a reference import job. -// -// 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 Omics's -// API operation StartReferenceImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartReferenceImportJob -func (c *Omics) StartReferenceImportJob(input *StartReferenceImportJobInput) (*StartReferenceImportJobOutput, error) { - req, out := c.StartReferenceImportJobRequest(input) - return out, req.Send() -} - -// StartReferenceImportJobWithContext is the same as StartReferenceImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartReferenceImportJob 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 *Omics) StartReferenceImportJobWithContext(ctx aws.Context, input *StartReferenceImportJobInput, opts ...request.Option) (*StartReferenceImportJobOutput, error) { - req, out := c.StartReferenceImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartRun = "StartRun" - -// StartRunRequest generates a "aws/request.Request" representing the -// client's request for the StartRun 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 StartRun for more information on using the StartRun -// 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 StartRunRequest method. -// req, resp := client.StartRunRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartRun -func (c *Omics) StartRunRequest(input *StartRunInput) (req *request.Request, output *StartRunOutput) { - op := &request.Operation{ - Name: opStartRun, - HTTPMethod: "POST", - HTTPPath: "/run", - } - - if input == nil { - input = &StartRunInput{} - } - - output = &StartRunOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// StartRun API operation for Amazon Omics. -// -// Starts a workflow run. To duplicate a run, specify the run's ID and a role -// ARN. The remaining parameters are copied from the previous run. -// -// The total number of runs in your account is subject to a quota per Region. -// To avoid needing to delete runs manually, you can set the retention mode -// to REMOVE. Runs with this setting are deleted automatically when the run -// quoata is exceeded. -// -// 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 Omics's -// API operation StartRun for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartRun -func (c *Omics) StartRun(input *StartRunInput) (*StartRunOutput, error) { - req, out := c.StartRunRequest(input) - return out, req.Send() -} - -// StartRunWithContext is the same as StartRun with the addition of -// the ability to pass a context and additional request options. -// -// See StartRun 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 *Omics) StartRunWithContext(ctx aws.Context, input *StartRunInput, opts ...request.Option) (*StartRunOutput, error) { - req, out := c.StartRunRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartVariantImportJob = "StartVariantImportJob" - -// StartVariantImportJobRequest generates a "aws/request.Request" representing the -// client's request for the StartVariantImportJob 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 StartVariantImportJob for more information on using the StartVariantImportJob -// 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 StartVariantImportJobRequest method. -// req, resp := client.StartVariantImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartVariantImportJob -func (c *Omics) StartVariantImportJobRequest(input *StartVariantImportJobInput) (req *request.Request, output *StartVariantImportJobOutput) { - op := &request.Operation{ - Name: opStartVariantImportJob, - HTTPMethod: "POST", - HTTPPath: "/import/variant", - } - - if input == nil { - input = &StartVariantImportJobInput{} - } - - output = &StartVariantImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// StartVariantImportJob API operation for Amazon Omics. -// -// Starts a variant import job. -// -// 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 Omics's -// API operation StartVariantImportJob for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/StartVariantImportJob -func (c *Omics) StartVariantImportJob(input *StartVariantImportJobInput) (*StartVariantImportJobOutput, error) { - req, out := c.StartVariantImportJobRequest(input) - return out, req.Send() -} - -// StartVariantImportJobWithContext is the same as StartVariantImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartVariantImportJob 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 *Omics) StartVariantImportJobWithContext(ctx aws.Context, input *StartVariantImportJobInput, opts ...request.Option) (*StartVariantImportJobOutput, error) { - req, out := c.StartVariantImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/TagResource -func (c *Omics) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("tags-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// TagResource API operation for Amazon Omics. -// -// Tags a resource. -// -// 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 Omics's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/TagResource -func (c *Omics) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *Omics) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UntagResource -func (c *Omics) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("tags-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UntagResource API operation for Amazon Omics. -// -// Removes tags from a resource. -// -// 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 Omics's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UntagResource -func (c *Omics) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *Omics) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAnnotationStore = "UpdateAnnotationStore" - -// UpdateAnnotationStoreRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAnnotationStore 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 UpdateAnnotationStore for more information on using the UpdateAnnotationStore -// 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 UpdateAnnotationStoreRequest method. -// req, resp := client.UpdateAnnotationStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateAnnotationStore -func (c *Omics) UpdateAnnotationStoreRequest(input *UpdateAnnotationStoreInput) (req *request.Request, output *UpdateAnnotationStoreOutput) { - op := &request.Operation{ - Name: opUpdateAnnotationStore, - HTTPMethod: "POST", - HTTPPath: "/annotationStore/{name}", - } - - if input == nil { - input = &UpdateAnnotationStoreInput{} - } - - output = &UpdateAnnotationStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateAnnotationStore API operation for Amazon Omics. -// -// Updates an annotation store. -// -// 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 Omics's -// API operation UpdateAnnotationStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateAnnotationStore -func (c *Omics) UpdateAnnotationStore(input *UpdateAnnotationStoreInput) (*UpdateAnnotationStoreOutput, error) { - req, out := c.UpdateAnnotationStoreRequest(input) - return out, req.Send() -} - -// UpdateAnnotationStoreWithContext is the same as UpdateAnnotationStore with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAnnotationStore 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 *Omics) UpdateAnnotationStoreWithContext(ctx aws.Context, input *UpdateAnnotationStoreInput, opts ...request.Option) (*UpdateAnnotationStoreOutput, error) { - req, out := c.UpdateAnnotationStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAnnotationStoreVersion = "UpdateAnnotationStoreVersion" - -// UpdateAnnotationStoreVersionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAnnotationStoreVersion 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 UpdateAnnotationStoreVersion for more information on using the UpdateAnnotationStoreVersion -// 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 UpdateAnnotationStoreVersionRequest method. -// req, resp := client.UpdateAnnotationStoreVersionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateAnnotationStoreVersion -func (c *Omics) UpdateAnnotationStoreVersionRequest(input *UpdateAnnotationStoreVersionInput) (req *request.Request, output *UpdateAnnotationStoreVersionOutput) { - op := &request.Operation{ - Name: opUpdateAnnotationStoreVersion, - HTTPMethod: "POST", - HTTPPath: "/annotationStore/{name}/version/{versionName}", - } - - if input == nil { - input = &UpdateAnnotationStoreVersionInput{} - } - - output = &UpdateAnnotationStoreVersionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateAnnotationStoreVersion API operation for Amazon Omics. -// -// Updates the description of an annotation store version. -// -// 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 Omics's -// API operation UpdateAnnotationStoreVersion for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateAnnotationStoreVersion -func (c *Omics) UpdateAnnotationStoreVersion(input *UpdateAnnotationStoreVersionInput) (*UpdateAnnotationStoreVersionOutput, error) { - req, out := c.UpdateAnnotationStoreVersionRequest(input) - return out, req.Send() -} - -// UpdateAnnotationStoreVersionWithContext is the same as UpdateAnnotationStoreVersion with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAnnotationStoreVersion 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 *Omics) UpdateAnnotationStoreVersionWithContext(ctx aws.Context, input *UpdateAnnotationStoreVersionInput, opts ...request.Option) (*UpdateAnnotationStoreVersionOutput, error) { - req, out := c.UpdateAnnotationStoreVersionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateRunGroup = "UpdateRunGroup" - -// UpdateRunGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRunGroup 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 UpdateRunGroup for more information on using the UpdateRunGroup -// 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 UpdateRunGroupRequest method. -// req, resp := client.UpdateRunGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateRunGroup -func (c *Omics) UpdateRunGroupRequest(input *UpdateRunGroupInput) (req *request.Request, output *UpdateRunGroupOutput) { - op := &request.Operation{ - Name: opUpdateRunGroup, - HTTPMethod: "POST", - HTTPPath: "/runGroup/{id}", - } - - if input == nil { - input = &UpdateRunGroupInput{} - } - - output = &UpdateRunGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateRunGroup API operation for Amazon Omics. -// -// Updates a run group. -// -// 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 Omics's -// API operation UpdateRunGroup for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateRunGroup -func (c *Omics) UpdateRunGroup(input *UpdateRunGroupInput) (*UpdateRunGroupOutput, error) { - req, out := c.UpdateRunGroupRequest(input) - return out, req.Send() -} - -// UpdateRunGroupWithContext is the same as UpdateRunGroup with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateRunGroup 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 *Omics) UpdateRunGroupWithContext(ctx aws.Context, input *UpdateRunGroupInput, opts ...request.Option) (*UpdateRunGroupOutput, error) { - req, out := c.UpdateRunGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateVariantStore = "UpdateVariantStore" - -// UpdateVariantStoreRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVariantStore 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 UpdateVariantStore for more information on using the UpdateVariantStore -// 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 UpdateVariantStoreRequest method. -// req, resp := client.UpdateVariantStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateVariantStore -func (c *Omics) UpdateVariantStoreRequest(input *UpdateVariantStoreInput) (req *request.Request, output *UpdateVariantStoreOutput) { - op := &request.Operation{ - Name: opUpdateVariantStore, - HTTPMethod: "POST", - HTTPPath: "/variantStore/{name}", - } - - if input == nil { - input = &UpdateVariantStoreInput{} - } - - output = &UpdateVariantStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("analytics-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateVariantStore API operation for Amazon Omics. -// -// Updates a variant store. -// -// 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 Omics's -// API operation UpdateVariantStore for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateVariantStore -func (c *Omics) UpdateVariantStore(input *UpdateVariantStoreInput) (*UpdateVariantStoreOutput, error) { - req, out := c.UpdateVariantStoreRequest(input) - return out, req.Send() -} - -// UpdateVariantStoreWithContext is the same as UpdateVariantStore with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateVariantStore 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 *Omics) UpdateVariantStoreWithContext(ctx aws.Context, input *UpdateVariantStoreInput, opts ...request.Option) (*UpdateVariantStoreOutput, error) { - req, out := c.UpdateVariantStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWorkflow = "UpdateWorkflow" - -// UpdateWorkflowRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWorkflow 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 UpdateWorkflow for more information on using the UpdateWorkflow -// 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 UpdateWorkflowRequest method. -// req, resp := client.UpdateWorkflowRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateWorkflow -func (c *Omics) UpdateWorkflowRequest(input *UpdateWorkflowInput) (req *request.Request, output *UpdateWorkflowOutput) { - op := &request.Operation{ - Name: opUpdateWorkflow, - HTTPMethod: "POST", - HTTPPath: "/workflow/{id}", - } - - if input == nil { - input = &UpdateWorkflowInput{} - } - - output = &UpdateWorkflowOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("workflows-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateWorkflow API operation for Amazon Omics. -// -// Updates a workflow. -// -// 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 Omics's -// API operation UpdateWorkflow for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// The request cannot be applied to the target resource in its current state. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UpdateWorkflow -func (c *Omics) UpdateWorkflow(input *UpdateWorkflowInput) (*UpdateWorkflowOutput, error) { - req, out := c.UpdateWorkflowRequest(input) - return out, req.Send() -} - -// UpdateWorkflowWithContext is the same as UpdateWorkflow with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWorkflow 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 *Omics) UpdateWorkflowWithContext(ctx aws.Context, input *UpdateWorkflowInput, opts ...request.Option) (*UpdateWorkflowOutput, error) { - req, out := c.UpdateWorkflowRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUploadReadSetPart = "UploadReadSetPart" - -// UploadReadSetPartRequest generates a "aws/request.Request" representing the -// client's request for the UploadReadSetPart 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 UploadReadSetPart for more information on using the UploadReadSetPart -// 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 UploadReadSetPartRequest method. -// req, resp := client.UploadReadSetPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UploadReadSetPart -func (c *Omics) UploadReadSetPartRequest(input *UploadReadSetPartInput) (req *request.Request, output *UploadReadSetPartOutput) { - op := &request.Operation{ - Name: opUploadReadSetPart, - HTTPMethod: "PUT", - HTTPPath: "/sequencestore/{sequenceStoreId}/upload/{uploadId}/part", - } - - if input == nil { - input = &UploadReadSetPartInput{} - } - - output = &UploadReadSetPartOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Sign.Remove(v4.SignRequestHandler) - handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) - req.Handlers.Sign.PushFrontNamed(handler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("storage-", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UploadReadSetPart API operation for Amazon Omics. -// -// This operation uploads a specific part of a read set. If you upload a new -// part using a previously used part number, the previously uploaded part will -// be overwritten. -// -// 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 Omics's -// API operation UploadReadSetPart for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An unexpected error occurred. Try the request again. -// -// - NotSupportedOperationException -// The operation is not supported by Amazon Omics, or the API does not exist. -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// The target resource was not found in the current Region. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - RequestTimeoutException -// The request timed out. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28/UploadReadSetPart -func (c *Omics) UploadReadSetPart(input *UploadReadSetPartInput) (*UploadReadSetPartOutput, error) { - req, out := c.UploadReadSetPartRequest(input) - return out, req.Send() -} - -// UploadReadSetPartWithContext is the same as UploadReadSetPart with the addition of -// the ability to pass a context and additional request options. -// -// See UploadReadSetPart 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 *Omics) UploadReadSetPartWithContext(ctx aws.Context, input *UploadReadSetPartInput, opts ...request.Option) (*UploadReadSetPartOutput, error) { - req, out := c.UploadReadSetPartRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AbortMultipartReadSetUploadInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The sequence store ID for the store involved in the multipart upload. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The ID for the multipart upload. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" min:"10" 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 AbortMultipartReadSetUploadInput) 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 AbortMultipartReadSetUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AbortMultipartReadSetUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AbortMultipartReadSetUploadInput"} - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.UploadId != nil && len(*s.UploadId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *AbortMultipartReadSetUploadInput) SetSequenceStoreId(v string) *AbortMultipartReadSetUploadInput { - s.SequenceStoreId = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *AbortMultipartReadSetUploadInput) SetUploadId(v string) *AbortMultipartReadSetUploadInput { - s.UploadId = &v - return s -} - -type AbortMultipartReadSetUploadOutput 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 AbortMultipartReadSetUploadOutput) 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 AbortMultipartReadSetUploadOutput) GoString() string { - return s.String() -} - -type AcceptShareInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID for a share offer for analytics store data. - // - // ShareId is a required field - ShareId *string `location:"uri" locationName:"shareId" 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 AcceptShareInput) 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 AcceptShareInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptShareInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptShareInput"} - if s.ShareId == nil { - invalidParams.Add(request.NewErrParamRequired("ShareId")) - } - if s.ShareId != nil && len(*s.ShareId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShareId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetShareId sets the ShareId field's value. -func (s *AcceptShareInput) SetShareId(v string) *AcceptShareInput { - s.ShareId = &v - return s -} - -type AcceptShareOutput struct { - _ struct{} `type:"structure"` - - // The status of an analytics store share. - Status *string `locationName:"status" type:"string" enum:"ShareStatus"` -} - -// 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 AcceptShareOutput) 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 AcceptShareOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *AcceptShareOutput) SetStatus(v string) *AcceptShareOutput { - s.Status = &v - return s -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A read set activation job filter. -type ActivateReadSetFilter struct { - _ struct{} `type:"structure"` - - // The filter's start date. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's end date. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's status. - Status *string `locationName:"status" type:"string" enum:"ReadSetActivationJobStatus"` -} - -// 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 ActivateReadSetFilter) 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 ActivateReadSetFilter) GoString() string { - return s.String() -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ActivateReadSetFilter) SetCreatedAfter(v time.Time) *ActivateReadSetFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ActivateReadSetFilter) SetCreatedBefore(v time.Time) *ActivateReadSetFilter { - s.CreatedBefore = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ActivateReadSetFilter) SetStatus(v string) *ActivateReadSetFilter { - s.Status = &v - return s -} - -// A read set activation job. -type ActivateReadSetJobItem struct { - _ struct{} `type:"structure"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetActivationJobStatus"` -} - -// 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 ActivateReadSetJobItem) 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 ActivateReadSetJobItem) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *ActivateReadSetJobItem) SetCompletionTime(v time.Time) *ActivateReadSetJobItem { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ActivateReadSetJobItem) SetCreationTime(v time.Time) *ActivateReadSetJobItem { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *ActivateReadSetJobItem) SetId(v string) *ActivateReadSetJobItem { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ActivateReadSetJobItem) SetSequenceStoreId(v string) *ActivateReadSetJobItem { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ActivateReadSetJobItem) SetStatus(v string) *ActivateReadSetJobItem { - s.Status = &v - return s -} - -// A source for a read set activation job. -type ActivateReadSetSourceItem struct { - _ struct{} `type:"structure"` - - // The source's read set ID. - // - // ReadSetId is a required field - ReadSetId *string `locationName:"readSetId" min:"10" type:"string" required:"true"` - - // The source's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetActivationJobItemStatus"` - - // The source's status message. - StatusMessage *string `locationName:"statusMessage" min:"1" 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 ActivateReadSetSourceItem) 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 ActivateReadSetSourceItem) GoString() string { - return s.String() -} - -// SetReadSetId sets the ReadSetId field's value. -func (s *ActivateReadSetSourceItem) SetReadSetId(v string) *ActivateReadSetSourceItem { - s.ReadSetId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ActivateReadSetSourceItem) SetStatus(v string) *ActivateReadSetSourceItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ActivateReadSetSourceItem) SetStatusMessage(v string) *ActivateReadSetSourceItem { - s.StatusMessage = &v - return s -} - -// Details about an imported annotation item. -type AnnotationImportItemDetail struct { - _ struct{} `type:"structure"` - - // The item's job status. - // - // JobStatus is a required field - JobStatus *string `locationName:"jobStatus" type:"string" required:"true" enum:"JobStatus"` - - // The source file's location in Amazon S3. - // - // Source is a required field - Source *string `locationName:"source" 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 AnnotationImportItemDetail) 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 AnnotationImportItemDetail) GoString() string { - return s.String() -} - -// SetJobStatus sets the JobStatus field's value. -func (s *AnnotationImportItemDetail) SetJobStatus(v string) *AnnotationImportItemDetail { - s.JobStatus = &v - return s -} - -// SetSource sets the Source field's value. -func (s *AnnotationImportItemDetail) SetSource(v string) *AnnotationImportItemDetail { - s.Source = &v - return s -} - -// A source for an annotation import job. -type AnnotationImportItemSource struct { - _ struct{} `type:"structure"` - - // The source file's location in Amazon S3. - // - // Source is a required field - Source *string `locationName:"source" 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 AnnotationImportItemSource) 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 AnnotationImportItemSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnnotationImportItemSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnnotationImportItemSource"} - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSource sets the Source field's value. -func (s *AnnotationImportItemSource) SetSource(v string) *AnnotationImportItemSource { - s.Source = &v - return s -} - -// An annotation import job. -type AnnotationImportJobItem struct { - _ struct{} `type:"structure"` - - // The annotation schema generated by the parsed annotation data. - AnnotationFields map[string]*string `locationName:"annotationFields" type:"map"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's destination annotation store. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" type:"string" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's left normalization setting. - RunLeftNormalization *bool `locationName:"runLeftNormalization" type:"boolean"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"JobStatus"` - - // When the job was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The name of the annotation store version. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" 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 AnnotationImportJobItem) 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 AnnotationImportJobItem) GoString() string { - return s.String() -} - -// SetAnnotationFields sets the AnnotationFields field's value. -func (s *AnnotationImportJobItem) SetAnnotationFields(v map[string]*string) *AnnotationImportJobItem { - s.AnnotationFields = v - return s -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *AnnotationImportJobItem) SetCompletionTime(v time.Time) *AnnotationImportJobItem { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *AnnotationImportJobItem) SetCreationTime(v time.Time) *AnnotationImportJobItem { - s.CreationTime = &v - return s -} - -// SetDestinationName sets the DestinationName field's value. -func (s *AnnotationImportJobItem) SetDestinationName(v string) *AnnotationImportJobItem { - s.DestinationName = &v - return s -} - -// SetId sets the Id field's value. -func (s *AnnotationImportJobItem) SetId(v string) *AnnotationImportJobItem { - s.Id = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *AnnotationImportJobItem) SetRoleArn(v string) *AnnotationImportJobItem { - s.RoleArn = &v - return s -} - -// SetRunLeftNormalization sets the RunLeftNormalization field's value. -func (s *AnnotationImportJobItem) SetRunLeftNormalization(v bool) *AnnotationImportJobItem { - s.RunLeftNormalization = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AnnotationImportJobItem) SetStatus(v string) *AnnotationImportJobItem { - s.Status = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *AnnotationImportJobItem) SetUpdateTime(v time.Time) *AnnotationImportJobItem { - s.UpdateTime = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *AnnotationImportJobItem) SetVersionName(v string) *AnnotationImportJobItem { - s.VersionName = &v - return s -} - -// An annotation store. -type AnnotationStoreItem struct { - _ struct{} `type:"structure"` - - // The store's creation time. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The store's name. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The store's genome reference. - // - // Reference is a required field - Reference *ReferenceItem `locationName:"reference" type:"structure" required:"true"` - - // The store's server-side encryption (SSE) settings. - // - // SseConfig is a required field - SseConfig *SseConfig `locationName:"sseConfig" type:"structure" required:"true"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` - - // The store's status message. - // - // StatusMessage is a required field - StatusMessage *string `locationName:"statusMessage" type:"string" required:"true"` - - // The store's ARN. - // - // StoreArn is a required field - StoreArn *string `locationName:"storeArn" min:"20" type:"string" required:"true"` - - // The store's file format. - // - // StoreFormat is a required field - StoreFormat *string `locationName:"storeFormat" type:"string" required:"true" enum:"StoreFormat"` - - // The store's size in bytes. - // - // StoreSizeBytes is a required field - StoreSizeBytes *int64 `locationName:"storeSizeBytes" type:"long" required:"true"` - - // When the store was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 AnnotationStoreItem) 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 AnnotationStoreItem) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *AnnotationStoreItem) SetCreationTime(v time.Time) *AnnotationStoreItem { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AnnotationStoreItem) SetDescription(v string) *AnnotationStoreItem { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *AnnotationStoreItem) SetId(v string) *AnnotationStoreItem { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *AnnotationStoreItem) SetName(v string) *AnnotationStoreItem { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *AnnotationStoreItem) SetReference(v *ReferenceItem) *AnnotationStoreItem { - s.Reference = v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *AnnotationStoreItem) SetSseConfig(v *SseConfig) *AnnotationStoreItem { - s.SseConfig = v - return s -} - -// SetStatus sets the Status field's value. -func (s *AnnotationStoreItem) SetStatus(v string) *AnnotationStoreItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *AnnotationStoreItem) SetStatusMessage(v string) *AnnotationStoreItem { - s.StatusMessage = &v - return s -} - -// SetStoreArn sets the StoreArn field's value. -func (s *AnnotationStoreItem) SetStoreArn(v string) *AnnotationStoreItem { - s.StoreArn = &v - return s -} - -// SetStoreFormat sets the StoreFormat field's value. -func (s *AnnotationStoreItem) SetStoreFormat(v string) *AnnotationStoreItem { - s.StoreFormat = &v - return s -} - -// SetStoreSizeBytes sets the StoreSizeBytes field's value. -func (s *AnnotationStoreItem) SetStoreSizeBytes(v int64) *AnnotationStoreItem { - s.StoreSizeBytes = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *AnnotationStoreItem) SetUpdateTime(v time.Time) *AnnotationStoreItem { - s.UpdateTime = &v - return s -} - -// Annotation store versions. -type AnnotationStoreVersionItem struct { - _ struct{} `type:"structure"` - - // The time stamp for when an annotation store version was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The description of an annotation store version. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The annotation store version ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // A name given to an annotation store version to distinguish it from others. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The status of an annotation store version. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"VersionStatus"` - - // The status of an annotation store version. - // - // StatusMessage is a required field - StatusMessage *string `locationName:"statusMessage" type:"string" required:"true"` - - // The store ID for an annotation store version. - // - // StoreId is a required field - StoreId *string `locationName:"storeId" type:"string" required:"true"` - - // The time stamp for when an annotation store version was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Arn for an annotation store version. - // - // VersionArn is a required field - VersionArn *string `locationName:"versionArn" min:"20" type:"string" required:"true"` - - // The name of an annotation store version. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" type:"string" required:"true"` - - // The size of an annotation store version in Bytes. - // - // VersionSizeBytes is a required field - VersionSizeBytes *int64 `locationName:"versionSizeBytes" type:"long" 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 AnnotationStoreVersionItem) 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 AnnotationStoreVersionItem) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *AnnotationStoreVersionItem) SetCreationTime(v time.Time) *AnnotationStoreVersionItem { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AnnotationStoreVersionItem) SetDescription(v string) *AnnotationStoreVersionItem { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *AnnotationStoreVersionItem) SetId(v string) *AnnotationStoreVersionItem { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *AnnotationStoreVersionItem) SetName(v string) *AnnotationStoreVersionItem { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AnnotationStoreVersionItem) SetStatus(v string) *AnnotationStoreVersionItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *AnnotationStoreVersionItem) SetStatusMessage(v string) *AnnotationStoreVersionItem { - s.StatusMessage = &v - return s -} - -// SetStoreId sets the StoreId field's value. -func (s *AnnotationStoreVersionItem) SetStoreId(v string) *AnnotationStoreVersionItem { - s.StoreId = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *AnnotationStoreVersionItem) SetUpdateTime(v time.Time) *AnnotationStoreVersionItem { - s.UpdateTime = &v - return s -} - -// SetVersionArn sets the VersionArn field's value. -func (s *AnnotationStoreVersionItem) SetVersionArn(v string) *AnnotationStoreVersionItem { - s.VersionArn = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *AnnotationStoreVersionItem) SetVersionName(v string) *AnnotationStoreVersionItem { - s.VersionName = &v - return s -} - -// SetVersionSizeBytes sets the VersionSizeBytes field's value. -func (s *AnnotationStoreVersionItem) SetVersionSizeBytes(v int64) *AnnotationStoreVersionItem { - s.VersionSizeBytes = &v - return s -} - -type BatchDeleteReadSetInput struct { - _ struct{} `type:"structure"` - - // The read sets' IDs. - // - // Ids is a required field - Ids []*string `locationName:"ids" min:"1" type:"list" required:"true"` - - // The read sets' sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 BatchDeleteReadSetInput) 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 BatchDeleteReadSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchDeleteReadSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchDeleteReadSetInput"} - if s.Ids == nil { - invalidParams.Add(request.NewErrParamRequired("Ids")) - } - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIds sets the Ids field's value. -func (s *BatchDeleteReadSetInput) SetIds(v []*string) *BatchDeleteReadSetInput { - s.Ids = v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *BatchDeleteReadSetInput) SetSequenceStoreId(v string) *BatchDeleteReadSetInput { - s.SequenceStoreId = &v - return s -} - -type BatchDeleteReadSetOutput struct { - _ struct{} `type:"structure"` - - // Errors returned by individual delete operations. - Errors []*ReadSetBatchError `locationName:"errors" type:"list"` -} - -// 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 BatchDeleteReadSetOutput) 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 BatchDeleteReadSetOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchDeleteReadSetOutput) SetErrors(v []*ReadSetBatchError) *BatchDeleteReadSetOutput { - s.Errors = v - return s -} - -type CancelAnnotationImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The job's ID. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" 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 CancelAnnotationImportJobInput) 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 CancelAnnotationImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelAnnotationImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelAnnotationImportJobInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobId sets the JobId field's value. -func (s *CancelAnnotationImportJobInput) SetJobId(v string) *CancelAnnotationImportJobInput { - s.JobId = &v - return s -} - -type CancelAnnotationImportJobOutput 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 CancelAnnotationImportJobOutput) 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 CancelAnnotationImportJobOutput) GoString() string { - return s.String() -} - -type CancelRunInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The run's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 CancelRunInput) 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 CancelRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelRunInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *CancelRunInput) SetId(v string) *CancelRunInput { - s.Id = &v - return s -} - -type CancelRunOutput 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 CancelRunOutput) 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 CancelRunOutput) GoString() string { - return s.String() -} - -type CancelVariantImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The job's ID. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" 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 CancelVariantImportJobInput) 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 CancelVariantImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelVariantImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelVariantImportJobInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobId sets the JobId field's value. -func (s *CancelVariantImportJobInput) SetJobId(v string) *CancelVariantImportJobInput { - s.JobId = &v - return s -} - -type CancelVariantImportJobOutput 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 CancelVariantImportJobOutput) 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 CancelVariantImportJobOutput) GoString() string { - return s.String() -} - -type CompleteMultipartReadSetUploadInput struct { - _ struct{} `type:"structure"` - - // The individual uploads or parts of a multipart upload. - // - // Parts is a required field - Parts []*CompleteReadSetUploadPartListItem `locationName:"parts" type:"list" required:"true"` - - // The sequence store ID for the store involved in the multipart upload. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The ID for the multipart upload. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" min:"10" 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 CompleteMultipartReadSetUploadInput) 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 CompleteMultipartReadSetUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CompleteMultipartReadSetUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CompleteMultipartReadSetUploadInput"} - if s.Parts == nil { - invalidParams.Add(request.NewErrParamRequired("Parts")) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.UploadId != nil && len(*s.UploadId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 10)) - } - if s.Parts != nil { - for i, v := range s.Parts { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Parts", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParts sets the Parts field's value. -func (s *CompleteMultipartReadSetUploadInput) SetParts(v []*CompleteReadSetUploadPartListItem) *CompleteMultipartReadSetUploadInput { - s.Parts = v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *CompleteMultipartReadSetUploadInput) SetSequenceStoreId(v string) *CompleteMultipartReadSetUploadInput { - s.SequenceStoreId = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CompleteMultipartReadSetUploadInput) SetUploadId(v string) *CompleteMultipartReadSetUploadInput { - s.UploadId = &v - return s -} - -type CompleteMultipartReadSetUploadOutput struct { - _ struct{} `type:"structure"` - - // The read set ID created for an uploaded read set. - // - // ReadSetId is a required field - ReadSetId *string `locationName:"readSetId" min:"10" 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 CompleteMultipartReadSetUploadOutput) 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 CompleteMultipartReadSetUploadOutput) GoString() string { - return s.String() -} - -// SetReadSetId sets the ReadSetId field's value. -func (s *CompleteMultipartReadSetUploadOutput) SetReadSetId(v string) *CompleteMultipartReadSetUploadOutput { - s.ReadSetId = &v - return s -} - -// Part of the response to the CompleteReadSetUpload API, including metadata. -type CompleteReadSetUploadPartListItem struct { - _ struct{} `type:"structure"` - - // A unique identifier used to confirm that parts are being added to the correct - // upload. - // - // Checksum is a required field - Checksum *string `locationName:"checksum" type:"string" required:"true"` - - // A number identifying the part in a read set upload. - // - // PartNumber is a required field - PartNumber *int64 `locationName:"partNumber" min:"1" type:"integer" required:"true"` - - // The source file of the part being uploaded. - // - // PartSource is a required field - PartSource *string `locationName:"partSource" type:"string" required:"true" enum:"ReadSetPartSource"` -} - -// 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 CompleteReadSetUploadPartListItem) 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 CompleteReadSetUploadPartListItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CompleteReadSetUploadPartListItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CompleteReadSetUploadPartListItem"} - if s.Checksum == nil { - invalidParams.Add(request.NewErrParamRequired("Checksum")) - } - if s.PartNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PartNumber")) - } - if s.PartNumber != nil && *s.PartNumber < 1 { - invalidParams.Add(request.NewErrParamMinValue("PartNumber", 1)) - } - if s.PartSource == nil { - invalidParams.Add(request.NewErrParamRequired("PartSource")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChecksum sets the Checksum field's value. -func (s *CompleteReadSetUploadPartListItem) SetChecksum(v string) *CompleteReadSetUploadPartListItem { - s.Checksum = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *CompleteReadSetUploadPartListItem) SetPartNumber(v int64) *CompleteReadSetUploadPartListItem { - s.PartNumber = &v - return s -} - -// SetPartSource sets the PartSource field's value. -func (s *CompleteReadSetUploadPartListItem) SetPartSource(v string) *CompleteReadSetUploadPartListItem { - s.PartSource = &v - return s -} - -// The request cannot be applied to the target resource in its current state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateAnnotationStoreInput struct { - _ struct{} `type:"structure"` - - // A description for the store. - Description *string `locationName:"description" type:"string"` - - // A name for the store. - Name *string `locationName:"name" min:"3" type:"string"` - - // The genome reference for the store's annotations. - Reference *ReferenceItem `locationName:"reference" type:"structure"` - - // Server-side encryption (SSE) settings for the store. - SseConfig *SseConfig `locationName:"sseConfig" type:"structure"` - - // The annotation file format of the store. - // - // StoreFormat is a required field - StoreFormat *string `locationName:"storeFormat" type:"string" required:"true" enum:"StoreFormat"` - - // File parsing options for the annotation store. - StoreOptions *StoreOptions `locationName:"storeOptions" type:"structure"` - - // Tags for the store. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The name given to an annotation store version to distinguish it from other - // versions. - VersionName *string `locationName:"versionName" min:"3" 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 CreateAnnotationStoreInput) 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 CreateAnnotationStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAnnotationStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAnnotationStoreInput"} - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.StoreFormat == nil { - invalidParams.Add(request.NewErrParamRequired("StoreFormat")) - } - if s.VersionName != nil && len(*s.VersionName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("VersionName", 3)) - } - if s.Reference != nil { - if err := s.Reference.Validate(); err != nil { - invalidParams.AddNested("Reference", err.(request.ErrInvalidParams)) - } - } - if s.SseConfig != nil { - if err := s.SseConfig.Validate(); err != nil { - invalidParams.AddNested("SseConfig", err.(request.ErrInvalidParams)) - } - } - if s.StoreOptions != nil { - if err := s.StoreOptions.Validate(); err != nil { - invalidParams.AddNested("StoreOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateAnnotationStoreInput) SetDescription(v string) *CreateAnnotationStoreInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAnnotationStoreInput) SetName(v string) *CreateAnnotationStoreInput { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *CreateAnnotationStoreInput) SetReference(v *ReferenceItem) *CreateAnnotationStoreInput { - s.Reference = v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *CreateAnnotationStoreInput) SetSseConfig(v *SseConfig) *CreateAnnotationStoreInput { - s.SseConfig = v - return s -} - -// SetStoreFormat sets the StoreFormat field's value. -func (s *CreateAnnotationStoreInput) SetStoreFormat(v string) *CreateAnnotationStoreInput { - s.StoreFormat = &v - return s -} - -// SetStoreOptions sets the StoreOptions field's value. -func (s *CreateAnnotationStoreInput) SetStoreOptions(v *StoreOptions) *CreateAnnotationStoreInput { - s.StoreOptions = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAnnotationStoreInput) SetTags(v map[string]*string) *CreateAnnotationStoreInput { - s.Tags = v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *CreateAnnotationStoreInput) SetVersionName(v string) *CreateAnnotationStoreInput { - s.VersionName = &v - return s -} - -type CreateAnnotationStoreOutput struct { - _ struct{} `type:"structure"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The store's name. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The store's genome reference. Required for all stores except TSV format with - // generic annotations. - Reference *ReferenceItem `locationName:"reference" type:"structure"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` - - // The annotation file format of the store. - StoreFormat *string `locationName:"storeFormat" type:"string" enum:"StoreFormat"` - - // The store's file parsing options. - StoreOptions *StoreOptions `locationName:"storeOptions" type:"structure"` - - // The name given to an annotation store version to distinguish it from other - // versions. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" 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 CreateAnnotationStoreOutput) 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 CreateAnnotationStoreOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreateAnnotationStoreOutput) SetCreationTime(v time.Time) *CreateAnnotationStoreOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateAnnotationStoreOutput) SetId(v string) *CreateAnnotationStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAnnotationStoreOutput) SetName(v string) *CreateAnnotationStoreOutput { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *CreateAnnotationStoreOutput) SetReference(v *ReferenceItem) *CreateAnnotationStoreOutput { - s.Reference = v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateAnnotationStoreOutput) SetStatus(v string) *CreateAnnotationStoreOutput { - s.Status = &v - return s -} - -// SetStoreFormat sets the StoreFormat field's value. -func (s *CreateAnnotationStoreOutput) SetStoreFormat(v string) *CreateAnnotationStoreOutput { - s.StoreFormat = &v - return s -} - -// SetStoreOptions sets the StoreOptions field's value. -func (s *CreateAnnotationStoreOutput) SetStoreOptions(v *StoreOptions) *CreateAnnotationStoreOutput { - s.StoreOptions = v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *CreateAnnotationStoreOutput) SetVersionName(v string) *CreateAnnotationStoreOutput { - s.VersionName = &v - return s -} - -type CreateAnnotationStoreVersionInput struct { - _ struct{} `type:"structure"` - - // The description of an annotation store version. - Description *string `locationName:"description" type:"string"` - - // The name of an annotation store version from which versions are being created. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" min:"3" type:"string" required:"true"` - - // Any tags added to annotation store version. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The name given to an annotation store version to distinguish it from other - // versions. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" type:"string" required:"true"` - - // The options for an annotation store version. - VersionOptions *VersionOptions `locationName:"versionOptions" 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 CreateAnnotationStoreVersionInput) 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 CreateAnnotationStoreVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAnnotationStoreVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAnnotationStoreVersionInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.VersionName == nil { - invalidParams.Add(request.NewErrParamRequired("VersionName")) - } - if s.VersionName != nil && len(*s.VersionName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("VersionName", 3)) - } - if s.VersionOptions != nil { - if err := s.VersionOptions.Validate(); err != nil { - invalidParams.AddNested("VersionOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateAnnotationStoreVersionInput) SetDescription(v string) *CreateAnnotationStoreVersionInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAnnotationStoreVersionInput) SetName(v string) *CreateAnnotationStoreVersionInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAnnotationStoreVersionInput) SetTags(v map[string]*string) *CreateAnnotationStoreVersionInput { - s.Tags = v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *CreateAnnotationStoreVersionInput) SetVersionName(v string) *CreateAnnotationStoreVersionInput { - s.VersionName = &v - return s -} - -// SetVersionOptions sets the VersionOptions field's value. -func (s *CreateAnnotationStoreVersionInput) SetVersionOptions(v *VersionOptions) *CreateAnnotationStoreVersionInput { - s.VersionOptions = v - return s -} - -type CreateAnnotationStoreVersionOutput struct { - _ struct{} `type:"structure"` - - // The time stamp for the creation of an annotation store version. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // A generated ID for the annotation store - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name given to an annotation store version to distinguish it from other - // versions. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The status of a annotation store version. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"VersionStatus"` - - // The ID for the annotation store from which new versions are being created. - // - // StoreId is a required field - StoreId *string `locationName:"storeId" type:"string" required:"true"` - - // The name given to an annotation store version to distinguish it from other - // versions. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" type:"string" required:"true"` - - // The options for an annotation store version. - VersionOptions *VersionOptions `locationName:"versionOptions" 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 CreateAnnotationStoreVersionOutput) 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 CreateAnnotationStoreVersionOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreateAnnotationStoreVersionOutput) SetCreationTime(v time.Time) *CreateAnnotationStoreVersionOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateAnnotationStoreVersionOutput) SetId(v string) *CreateAnnotationStoreVersionOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAnnotationStoreVersionOutput) SetName(v string) *CreateAnnotationStoreVersionOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateAnnotationStoreVersionOutput) SetStatus(v string) *CreateAnnotationStoreVersionOutput { - s.Status = &v - return s -} - -// SetStoreId sets the StoreId field's value. -func (s *CreateAnnotationStoreVersionOutput) SetStoreId(v string) *CreateAnnotationStoreVersionOutput { - s.StoreId = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *CreateAnnotationStoreVersionOutput) SetVersionName(v string) *CreateAnnotationStoreVersionOutput { - s.VersionName = &v - return s -} - -// SetVersionOptions sets the VersionOptions field's value. -func (s *CreateAnnotationStoreVersionOutput) SetVersionOptions(v *VersionOptions) *CreateAnnotationStoreVersionOutput { - s.VersionOptions = v - return s -} - -type CreateMultipartReadSetUploadInput struct { - _ struct{} `type:"structure"` - - // An idempotency token that can be used to avoid triggering multiple multipart - // uploads. - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The description of the read set. - Description *string `locationName:"description" min:"1" type:"string"` - - // Where the source originated. - GeneratedFrom *string `locationName:"generatedFrom" min:"1" type:"string"` - - // The name of the read set. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The ARN of the reference. - ReferenceArn *string `locationName:"referenceArn" min:"1" type:"string"` - - // The source's sample ID. - // - // SampleId is a required field - SampleId *string `locationName:"sampleId" min:"1" type:"string" required:"true"` - - // The sequence store ID for the store that is the destination of the multipart - // uploads. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The type of file being uploaded. - // - // SourceFileType is a required field - SourceFileType *string `locationName:"sourceFileType" type:"string" required:"true" enum:"FileType"` - - // The source's subject ID. - // - // SubjectId is a required field - SubjectId *string `locationName:"subjectId" min:"1" type:"string" required:"true"` - - // Any tags to add to the read set. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateMultipartReadSetUploadInput) 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 CreateMultipartReadSetUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMultipartReadSetUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMultipartReadSetUploadInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.GeneratedFrom != nil && len(*s.GeneratedFrom) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GeneratedFrom", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ReferenceArn != nil && len(*s.ReferenceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceArn", 1)) - } - if s.SampleId == nil { - invalidParams.Add(request.NewErrParamRequired("SampleId")) - } - if s.SampleId != nil && len(*s.SampleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SampleId", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.SourceFileType == nil { - invalidParams.Add(request.NewErrParamRequired("SourceFileType")) - } - if s.SubjectId == nil { - invalidParams.Add(request.NewErrParamRequired("SubjectId")) - } - if s.SubjectId != nil && len(*s.SubjectId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubjectId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateMultipartReadSetUploadInput) SetClientToken(v string) *CreateMultipartReadSetUploadInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateMultipartReadSetUploadInput) SetDescription(v string) *CreateMultipartReadSetUploadInput { - s.Description = &v - return s -} - -// SetGeneratedFrom sets the GeneratedFrom field's value. -func (s *CreateMultipartReadSetUploadInput) SetGeneratedFrom(v string) *CreateMultipartReadSetUploadInput { - s.GeneratedFrom = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateMultipartReadSetUploadInput) SetName(v string) *CreateMultipartReadSetUploadInput { - s.Name = &v - return s -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *CreateMultipartReadSetUploadInput) SetReferenceArn(v string) *CreateMultipartReadSetUploadInput { - s.ReferenceArn = &v - return s -} - -// SetSampleId sets the SampleId field's value. -func (s *CreateMultipartReadSetUploadInput) SetSampleId(v string) *CreateMultipartReadSetUploadInput { - s.SampleId = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *CreateMultipartReadSetUploadInput) SetSequenceStoreId(v string) *CreateMultipartReadSetUploadInput { - s.SequenceStoreId = &v - return s -} - -// SetSourceFileType sets the SourceFileType field's value. -func (s *CreateMultipartReadSetUploadInput) SetSourceFileType(v string) *CreateMultipartReadSetUploadInput { - s.SourceFileType = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *CreateMultipartReadSetUploadInput) SetSubjectId(v string) *CreateMultipartReadSetUploadInput { - s.SubjectId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateMultipartReadSetUploadInput) SetTags(v map[string]*string) *CreateMultipartReadSetUploadInput { - s.Tags = v - return s -} - -type CreateMultipartReadSetUploadOutput struct { - _ struct{} `type:"structure"` - - // The creation time of the multipart upload. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The description of the read set. - Description *string `locationName:"description" min:"1" type:"string"` - - // The source of the read set. - GeneratedFrom *string `locationName:"generatedFrom" min:"1" type:"string"` - - // The name of the read set. - Name *string `locationName:"name" min:"1" type:"string"` - - // The read set source's reference ARN. - // - // ReferenceArn is a required field - ReferenceArn *string `locationName:"referenceArn" min:"1" type:"string" required:"true"` - - // The source's sample ID. - // - // SampleId is a required field - SampleId *string `locationName:"sampleId" min:"1" type:"string" required:"true"` - - // The sequence store ID for the store that the read set will be created in. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The file type of the read set source. - // - // SourceFileType is a required field - SourceFileType *string `locationName:"sourceFileType" type:"string" required:"true" enum:"FileType"` - - // The source's subject ID. - // - // SubjectId is a required field - SubjectId *string `locationName:"subjectId" min:"1" type:"string" required:"true"` - - // The tags to add to the read set. - Tags map[string]*string `locationName:"tags" type:"map"` - - // he ID for the initiated multipart upload. - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" min:"10" 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 CreateMultipartReadSetUploadOutput) 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 CreateMultipartReadSetUploadOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreateMultipartReadSetUploadOutput) SetCreationTime(v time.Time) *CreateMultipartReadSetUploadOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateMultipartReadSetUploadOutput) SetDescription(v string) *CreateMultipartReadSetUploadOutput { - s.Description = &v - return s -} - -// SetGeneratedFrom sets the GeneratedFrom field's value. -func (s *CreateMultipartReadSetUploadOutput) SetGeneratedFrom(v string) *CreateMultipartReadSetUploadOutput { - s.GeneratedFrom = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateMultipartReadSetUploadOutput) SetName(v string) *CreateMultipartReadSetUploadOutput { - s.Name = &v - return s -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *CreateMultipartReadSetUploadOutput) SetReferenceArn(v string) *CreateMultipartReadSetUploadOutput { - s.ReferenceArn = &v - return s -} - -// SetSampleId sets the SampleId field's value. -func (s *CreateMultipartReadSetUploadOutput) SetSampleId(v string) *CreateMultipartReadSetUploadOutput { - s.SampleId = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *CreateMultipartReadSetUploadOutput) SetSequenceStoreId(v string) *CreateMultipartReadSetUploadOutput { - s.SequenceStoreId = &v - return s -} - -// SetSourceFileType sets the SourceFileType field's value. -func (s *CreateMultipartReadSetUploadOutput) SetSourceFileType(v string) *CreateMultipartReadSetUploadOutput { - s.SourceFileType = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *CreateMultipartReadSetUploadOutput) SetSubjectId(v string) *CreateMultipartReadSetUploadOutput { - s.SubjectId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateMultipartReadSetUploadOutput) SetTags(v map[string]*string) *CreateMultipartReadSetUploadOutput { - s.Tags = v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CreateMultipartReadSetUploadOutput) SetUploadId(v string) *CreateMultipartReadSetUploadOutput { - s.UploadId = &v - return s -} - -type CreateReferenceStoreInput struct { - _ struct{} `type:"structure"` - - // To ensure that requests don't run multiple times, specify a unique token - // for each request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // A description for the store. - Description *string `locationName:"description" min:"1" type:"string"` - - // A name for the store. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Server-side encryption (SSE) settings for the store. - SseConfig *SseConfig `locationName:"sseConfig" type:"structure"` - - // Tags for the store. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateReferenceStoreInput) 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 CreateReferenceStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateReferenceStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateReferenceStoreInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SseConfig != nil { - if err := s.SseConfig.Validate(); err != nil { - invalidParams.AddNested("SseConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateReferenceStoreInput) SetClientToken(v string) *CreateReferenceStoreInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateReferenceStoreInput) SetDescription(v string) *CreateReferenceStoreInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateReferenceStoreInput) SetName(v string) *CreateReferenceStoreInput { - s.Name = &v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *CreateReferenceStoreInput) SetSseConfig(v *SseConfig) *CreateReferenceStoreInput { - s.SseConfig = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateReferenceStoreInput) SetTags(v map[string]*string) *CreateReferenceStoreInput { - s.Tags = v - return s -} - -type CreateReferenceStoreOutput struct { - _ struct{} `type:"structure"` - - // The store's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The store's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The store's SSE settings. - SseConfig *SseConfig `locationName:"sseConfig" 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 CreateReferenceStoreOutput) 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 CreateReferenceStoreOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateReferenceStoreOutput) SetArn(v string) *CreateReferenceStoreOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreateReferenceStoreOutput) SetCreationTime(v time.Time) *CreateReferenceStoreOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateReferenceStoreOutput) SetDescription(v string) *CreateReferenceStoreOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateReferenceStoreOutput) SetId(v string) *CreateReferenceStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateReferenceStoreOutput) SetName(v string) *CreateReferenceStoreOutput { - s.Name = &v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *CreateReferenceStoreOutput) SetSseConfig(v *SseConfig) *CreateReferenceStoreOutput { - s.SseConfig = v - return s -} - -type CreateRunGroupInput struct { - _ struct{} `type:"structure"` - - // The maximum number of CPUs to use in the group. - MaxCpus *int64 `locationName:"maxCpus" min:"1" type:"integer"` - - // A maximum run time for the group in minutes. - MaxDuration *int64 `locationName:"maxDuration" min:"1" type:"integer"` - - // The maximum GPUs that can be used by a run group. - MaxGpus *int64 `locationName:"maxGpus" min:"1" type:"integer"` - - // The maximum number of concurrent runs for the group. - MaxRuns *int64 `locationName:"maxRuns" min:"1" type:"integer"` - - // A name for the group. - Name *string `locationName:"name" min:"1" type:"string"` - - // To ensure that requests don't run multiple times, specify a unique ID for - // each request. - RequestId *string `locationName:"requestId" min:"1" type:"string" idempotencyToken:"true"` - - // Tags for the group. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateRunGroupInput) 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 CreateRunGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRunGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRunGroupInput"} - if s.MaxCpus != nil && *s.MaxCpus < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxCpus", 1)) - } - if s.MaxDuration != nil && *s.MaxDuration < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxDuration", 1)) - } - if s.MaxGpus != nil && *s.MaxGpus < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxGpus", 1)) - } - if s.MaxRuns != nil && *s.MaxRuns < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxRuns", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RequestId != nil && len(*s.RequestId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxCpus sets the MaxCpus field's value. -func (s *CreateRunGroupInput) SetMaxCpus(v int64) *CreateRunGroupInput { - s.MaxCpus = &v - return s -} - -// SetMaxDuration sets the MaxDuration field's value. -func (s *CreateRunGroupInput) SetMaxDuration(v int64) *CreateRunGroupInput { - s.MaxDuration = &v - return s -} - -// SetMaxGpus sets the MaxGpus field's value. -func (s *CreateRunGroupInput) SetMaxGpus(v int64) *CreateRunGroupInput { - s.MaxGpus = &v - return s -} - -// SetMaxRuns sets the MaxRuns field's value. -func (s *CreateRunGroupInput) SetMaxRuns(v int64) *CreateRunGroupInput { - s.MaxRuns = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateRunGroupInput) SetName(v string) *CreateRunGroupInput { - s.Name = &v - return s -} - -// SetRequestId sets the RequestId field's value. -func (s *CreateRunGroupInput) SetRequestId(v string) *CreateRunGroupInput { - s.RequestId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateRunGroupInput) SetTags(v map[string]*string) *CreateRunGroupInput { - s.Tags = v - return s -} - -type CreateRunGroupOutput struct { - _ struct{} `type:"structure"` - - // The group's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // The group's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // Tags for the run group. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateRunGroupOutput) 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 CreateRunGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateRunGroupOutput) SetArn(v string) *CreateRunGroupOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateRunGroupOutput) SetId(v string) *CreateRunGroupOutput { - s.Id = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateRunGroupOutput) SetTags(v map[string]*string) *CreateRunGroupOutput { - s.Tags = v - return s -} - -type CreateSequenceStoreInput struct { - _ struct{} `type:"structure"` - - // To ensure that requests don't run multiple times, specify a unique token - // for each request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // A description for the store. - Description *string `locationName:"description" min:"1" type:"string"` - - // An S3 location that is used to store files that have failed a direct upload. - FallbackLocation *string `locationName:"fallbackLocation" type:"string"` - - // A name for the store. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Server-side encryption (SSE) settings for the store. - SseConfig *SseConfig `locationName:"sseConfig" type:"structure"` - - // Tags for the store. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateSequenceStoreInput) 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 CreateSequenceStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSequenceStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSequenceStoreInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SseConfig != nil { - if err := s.SseConfig.Validate(); err != nil { - invalidParams.AddNested("SseConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateSequenceStoreInput) SetClientToken(v string) *CreateSequenceStoreInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateSequenceStoreInput) SetDescription(v string) *CreateSequenceStoreInput { - s.Description = &v - return s -} - -// SetFallbackLocation sets the FallbackLocation field's value. -func (s *CreateSequenceStoreInput) SetFallbackLocation(v string) *CreateSequenceStoreInput { - s.FallbackLocation = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSequenceStoreInput) SetName(v string) *CreateSequenceStoreInput { - s.Name = &v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *CreateSequenceStoreInput) SetSseConfig(v *SseConfig) *CreateSequenceStoreInput { - s.SseConfig = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSequenceStoreInput) SetTags(v map[string]*string) *CreateSequenceStoreInput { - s.Tags = v - return s -} - -type CreateSequenceStoreOutput struct { - _ struct{} `type:"structure"` - - // The store's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // An S3 location that is used to store files that have failed a direct upload. - FallbackLocation *string `locationName:"fallbackLocation" type:"string"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The store's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The store's SSE settings. - SseConfig *SseConfig `locationName:"sseConfig" 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 CreateSequenceStoreOutput) 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 CreateSequenceStoreOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateSequenceStoreOutput) SetArn(v string) *CreateSequenceStoreOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreateSequenceStoreOutput) SetCreationTime(v time.Time) *CreateSequenceStoreOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateSequenceStoreOutput) SetDescription(v string) *CreateSequenceStoreOutput { - s.Description = &v - return s -} - -// SetFallbackLocation sets the FallbackLocation field's value. -func (s *CreateSequenceStoreOutput) SetFallbackLocation(v string) *CreateSequenceStoreOutput { - s.FallbackLocation = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSequenceStoreOutput) SetId(v string) *CreateSequenceStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSequenceStoreOutput) SetName(v string) *CreateSequenceStoreOutput { - s.Name = &v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *CreateSequenceStoreOutput) SetSseConfig(v *SseConfig) *CreateSequenceStoreOutput { - s.SseConfig = v - return s -} - -type CreateShareInput struct { - _ struct{} `type:"structure"` - - // The principal subscriber is the account being given access to the analytics - // store data through the share offer. - // - // PrincipalSubscriber is a required field - PrincipalSubscriber *string `locationName:"principalSubscriber" type:"string" required:"true"` - - // The resource ARN for the analytics store to be shared. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` - - // A name given to the share. - ShareName *string `locationName:"shareName" min:"1" 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 CreateShareInput) 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 CreateShareInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateShareInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateShareInput"} - if s.PrincipalSubscriber == nil { - invalidParams.Add(request.NewErrParamRequired("PrincipalSubscriber")) - } - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ShareName != nil && len(*s.ShareName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShareName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrincipalSubscriber sets the PrincipalSubscriber field's value. -func (s *CreateShareInput) SetPrincipalSubscriber(v string) *CreateShareInput { - s.PrincipalSubscriber = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *CreateShareInput) SetResourceArn(v string) *CreateShareInput { - s.ResourceArn = &v - return s -} - -// SetShareName sets the ShareName field's value. -func (s *CreateShareInput) SetShareName(v string) *CreateShareInput { - s.ShareName = &v - return s -} - -type CreateShareOutput struct { - _ struct{} `type:"structure"` - - // An ID generated for the share. - ShareId *string `locationName:"shareId" type:"string"` - - // A name given to the share. - ShareName *string `locationName:"shareName" min:"1" type:"string"` - - // The status of a share. - Status *string `locationName:"status" type:"string" enum:"ShareStatus"` -} - -// 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 CreateShareOutput) 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 CreateShareOutput) GoString() string { - return s.String() -} - -// SetShareId sets the ShareId field's value. -func (s *CreateShareOutput) SetShareId(v string) *CreateShareOutput { - s.ShareId = &v - return s -} - -// SetShareName sets the ShareName field's value. -func (s *CreateShareOutput) SetShareName(v string) *CreateShareOutput { - s.ShareName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateShareOutput) SetStatus(v string) *CreateShareOutput { - s.Status = &v - return s -} - -type CreateVariantStoreInput struct { - _ struct{} `type:"structure"` - - // A description for the store. - Description *string `locationName:"description" type:"string"` - - // A name for the store. - Name *string `locationName:"name" min:"3" type:"string"` - - // The genome reference for the store's variants. - // - // Reference is a required field - Reference *ReferenceItem `locationName:"reference" type:"structure" required:"true"` - - // Server-side encryption (SSE) settings for the store. - SseConfig *SseConfig `locationName:"sseConfig" type:"structure"` - - // Tags for the store. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateVariantStoreInput) 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 CreateVariantStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVariantStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVariantStoreInput"} - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Reference == nil { - invalidParams.Add(request.NewErrParamRequired("Reference")) - } - if s.Reference != nil { - if err := s.Reference.Validate(); err != nil { - invalidParams.AddNested("Reference", err.(request.ErrInvalidParams)) - } - } - if s.SseConfig != nil { - if err := s.SseConfig.Validate(); err != nil { - invalidParams.AddNested("SseConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateVariantStoreInput) SetDescription(v string) *CreateVariantStoreInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateVariantStoreInput) SetName(v string) *CreateVariantStoreInput { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *CreateVariantStoreInput) SetReference(v *ReferenceItem) *CreateVariantStoreInput { - s.Reference = v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *CreateVariantStoreInput) SetSseConfig(v *SseConfig) *CreateVariantStoreInput { - s.SseConfig = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateVariantStoreInput) SetTags(v map[string]*string) *CreateVariantStoreInput { - s.Tags = v - return s -} - -type CreateVariantStoreOutput struct { - _ struct{} `type:"structure"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The store's name. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The store's genome reference. - Reference *ReferenceItem `locationName:"reference" type:"structure"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` -} - -// 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 CreateVariantStoreOutput) 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 CreateVariantStoreOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreateVariantStoreOutput) SetCreationTime(v time.Time) *CreateVariantStoreOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateVariantStoreOutput) SetId(v string) *CreateVariantStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateVariantStoreOutput) SetName(v string) *CreateVariantStoreOutput { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *CreateVariantStoreOutput) SetReference(v *ReferenceItem) *CreateVariantStoreOutput { - s.Reference = v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateVariantStoreOutput) SetStatus(v string) *CreateVariantStoreOutput { - s.Status = &v - return s -} - -type CreateWorkflowInput struct { - _ struct{} `type:"structure"` - - // The computational accelerator specified to run the workflow. - Accelerators *string `locationName:"accelerators" min:"1" type:"string" enum:"Accelerators"` - - // The URI of a definition for the workflow. - DefinitionUri *string `locationName:"definitionUri" min:"1" type:"string"` - - // A ZIP archive for the workflow. - // DefinitionZip is automatically base64 encoded/decoded by the SDK. - DefinitionZip []byte `locationName:"definitionZip" type:"blob"` - - // A description for the workflow. - Description *string `locationName:"description" min:"1" type:"string"` - - // An engine for the workflow. - Engine *string `locationName:"engine" min:"1" type:"string" enum:"WorkflowEngine"` - - // The path of the main definition file for the workflow. - Main *string `locationName:"main" min:"1" type:"string"` - - // A name for the workflow. - Name *string `locationName:"name" min:"1" type:"string"` - - // A parameter template for the workflow. - ParameterTemplate map[string]*WorkflowParameter `locationName:"parameterTemplate" min:"1" type:"map"` - - // To ensure that requests don't run multiple times, specify a unique ID for - // each request. - RequestId *string `locationName:"requestId" min:"1" type:"string" idempotencyToken:"true"` - - // A storage capacity for the workflow in gigabytes. - StorageCapacity *int64 `locationName:"storageCapacity" type:"integer"` - - // Tags for the workflow. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateWorkflowInput) 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 CreateWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkflowInput"} - if s.Accelerators != nil && len(*s.Accelerators) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Accelerators", 1)) - } - if s.DefinitionUri != nil && len(*s.DefinitionUri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DefinitionUri", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Engine != nil && len(*s.Engine) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Engine", 1)) - } - if s.Main != nil && len(*s.Main) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Main", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ParameterTemplate != nil && len(s.ParameterTemplate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ParameterTemplate", 1)) - } - if s.RequestId != nil && len(*s.RequestId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccelerators sets the Accelerators field's value. -func (s *CreateWorkflowInput) SetAccelerators(v string) *CreateWorkflowInput { - s.Accelerators = &v - return s -} - -// SetDefinitionUri sets the DefinitionUri field's value. -func (s *CreateWorkflowInput) SetDefinitionUri(v string) *CreateWorkflowInput { - s.DefinitionUri = &v - return s -} - -// SetDefinitionZip sets the DefinitionZip field's value. -func (s *CreateWorkflowInput) SetDefinitionZip(v []byte) *CreateWorkflowInput { - s.DefinitionZip = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateWorkflowInput) SetDescription(v string) *CreateWorkflowInput { - s.Description = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *CreateWorkflowInput) SetEngine(v string) *CreateWorkflowInput { - s.Engine = &v - return s -} - -// SetMain sets the Main field's value. -func (s *CreateWorkflowInput) SetMain(v string) *CreateWorkflowInput { - s.Main = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWorkflowInput) SetName(v string) *CreateWorkflowInput { - s.Name = &v - return s -} - -// SetParameterTemplate sets the ParameterTemplate field's value. -func (s *CreateWorkflowInput) SetParameterTemplate(v map[string]*WorkflowParameter) *CreateWorkflowInput { - s.ParameterTemplate = v - return s -} - -// SetRequestId sets the RequestId field's value. -func (s *CreateWorkflowInput) SetRequestId(v string) *CreateWorkflowInput { - s.RequestId = &v - return s -} - -// SetStorageCapacity sets the StorageCapacity field's value. -func (s *CreateWorkflowInput) SetStorageCapacity(v int64) *CreateWorkflowInput { - s.StorageCapacity = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateWorkflowInput) SetTags(v map[string]*string) *CreateWorkflowInput { - s.Tags = v - return s -} - -type CreateWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The workflow's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // The workflow's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // The workflow's status. - Status *string `locationName:"status" min:"1" type:"string" enum:"WorkflowStatus"` - - // The workflow's tags. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateWorkflowOutput) 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 CreateWorkflowOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateWorkflowOutput) SetArn(v string) *CreateWorkflowOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateWorkflowOutput) SetId(v string) *CreateWorkflowOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateWorkflowOutput) SetStatus(v string) *CreateWorkflowOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateWorkflowOutput) SetTags(v map[string]*string) *CreateWorkflowOutput { - s.Tags = v - return s -} - -type DeleteAnnotationStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Whether to force deletion. - Force *bool `location:"querystring" locationName:"force" type:"boolean"` - - // The store's name. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" 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 DeleteAnnotationStoreInput) 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 DeleteAnnotationStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAnnotationStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAnnotationStoreInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetForce sets the Force field's value. -func (s *DeleteAnnotationStoreInput) SetForce(v bool) *DeleteAnnotationStoreInput { - s.Force = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteAnnotationStoreInput) SetName(v string) *DeleteAnnotationStoreInput { - s.Name = &v - return s -} - -type DeleteAnnotationStoreOutput struct { - _ struct{} `type:"structure"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` -} - -// 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 DeleteAnnotationStoreOutput) 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 DeleteAnnotationStoreOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *DeleteAnnotationStoreOutput) SetStatus(v string) *DeleteAnnotationStoreOutput { - s.Status = &v - return s -} - -type DeleteAnnotationStoreVersionsInput struct { - _ struct{} `type:"structure"` - - // Forces the deletion of an annotation store version when imports are in-progress.. - Force *bool `location:"querystring" locationName:"force" type:"boolean"` - - // The name of the annotation store from which versions are being deleted. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` - - // The versions of an annotation store to be deleted. - // - // Versions is a required field - Versions []*string `locationName:"versions" min:"1" type:"list" 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 DeleteAnnotationStoreVersionsInput) 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 DeleteAnnotationStoreVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAnnotationStoreVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAnnotationStoreVersionsInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Versions == nil { - invalidParams.Add(request.NewErrParamRequired("Versions")) - } - if s.Versions != nil && len(s.Versions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Versions", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetForce sets the Force field's value. -func (s *DeleteAnnotationStoreVersionsInput) SetForce(v bool) *DeleteAnnotationStoreVersionsInput { - s.Force = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteAnnotationStoreVersionsInput) SetName(v string) *DeleteAnnotationStoreVersionsInput { - s.Name = &v - return s -} - -// SetVersions sets the Versions field's value. -func (s *DeleteAnnotationStoreVersionsInput) SetVersions(v []*string) *DeleteAnnotationStoreVersionsInput { - s.Versions = v - return s -} - -type DeleteAnnotationStoreVersionsOutput struct { - _ struct{} `type:"structure"` - - // Any errors that occur when attempting to delete an annotation store version. - Errors []*VersionDeleteError `locationName:"errors" type:"list"` -} - -// 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 DeleteAnnotationStoreVersionsOutput) 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 DeleteAnnotationStoreVersionsOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *DeleteAnnotationStoreVersionsOutput) SetErrors(v []*VersionDeleteError) *DeleteAnnotationStoreVersionsOutput { - s.Errors = v - return s -} - -type DeleteReferenceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The reference's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The reference's store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `location:"uri" locationName:"referenceStoreId" min:"10" 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 DeleteReferenceInput) 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 DeleteReferenceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReferenceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReferenceInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.ReferenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("ReferenceStoreId")) - } - if s.ReferenceStoreId != nil && len(*s.ReferenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteReferenceInput) SetId(v string) *DeleteReferenceInput { - s.Id = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *DeleteReferenceInput) SetReferenceStoreId(v string) *DeleteReferenceInput { - s.ReferenceStoreId = &v - return s -} - -type DeleteReferenceOutput 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 DeleteReferenceOutput) 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 DeleteReferenceOutput) GoString() string { - return s.String() -} - -type DeleteReferenceStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" 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 DeleteReferenceStoreInput) 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 DeleteReferenceStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReferenceStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReferenceStoreInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteReferenceStoreInput) SetId(v string) *DeleteReferenceStoreInput { - s.Id = &v - return s -} - -type DeleteReferenceStoreOutput 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 DeleteReferenceStoreOutput) 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 DeleteReferenceStoreOutput) GoString() string { - return s.String() -} - -type DeleteRunGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The run group's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 DeleteRunGroupInput) 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 DeleteRunGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRunGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRunGroupInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteRunGroupInput) SetId(v string) *DeleteRunGroupInput { - s.Id = &v - return s -} - -type DeleteRunGroupOutput 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 DeleteRunGroupOutput) 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 DeleteRunGroupOutput) GoString() string { - return s.String() -} - -type DeleteRunInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The run's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 DeleteRunInput) 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 DeleteRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRunInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteRunInput) SetId(v string) *DeleteRunInput { - s.Id = &v - return s -} - -type DeleteRunOutput 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 DeleteRunOutput) 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 DeleteRunOutput) GoString() string { - return s.String() -} - -type DeleteSequenceStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The sequence store's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" 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 DeleteSequenceStoreInput) 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 DeleteSequenceStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSequenceStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSequenceStoreInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteSequenceStoreInput) SetId(v string) *DeleteSequenceStoreInput { - s.Id = &v - return s -} - -type DeleteSequenceStoreOutput 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 DeleteSequenceStoreOutput) 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 DeleteSequenceStoreOutput) GoString() string { - return s.String() -} - -type DeleteShareInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID for the share request to be deleted. - // - // ShareId is a required field - ShareId *string `location:"uri" locationName:"shareId" 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 DeleteShareInput) 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 DeleteShareInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteShareInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteShareInput"} - if s.ShareId == nil { - invalidParams.Add(request.NewErrParamRequired("ShareId")) - } - if s.ShareId != nil && len(*s.ShareId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShareId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetShareId sets the ShareId field's value. -func (s *DeleteShareInput) SetShareId(v string) *DeleteShareInput { - s.ShareId = &v - return s -} - -type DeleteShareOutput struct { - _ struct{} `type:"structure"` - - // The status of the share being deleted. - Status *string `locationName:"status" type:"string" enum:"ShareStatus"` -} - -// 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 DeleteShareOutput) 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 DeleteShareOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *DeleteShareOutput) SetStatus(v string) *DeleteShareOutput { - s.Status = &v - return s -} - -type DeleteVariantStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Whether to force deletion. - Force *bool `location:"querystring" locationName:"force" type:"boolean"` - - // The store's name. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" 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 DeleteVariantStoreInput) 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 DeleteVariantStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVariantStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVariantStoreInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetForce sets the Force field's value. -func (s *DeleteVariantStoreInput) SetForce(v bool) *DeleteVariantStoreInput { - s.Force = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteVariantStoreInput) SetName(v string) *DeleteVariantStoreInput { - s.Name = &v - return s -} - -type DeleteVariantStoreOutput struct { - _ struct{} `type:"structure"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` -} - -// 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 DeleteVariantStoreOutput) 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 DeleteVariantStoreOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *DeleteVariantStoreOutput) SetStatus(v string) *DeleteVariantStoreOutput { - s.Status = &v - return s -} - -type DeleteWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The workflow's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 DeleteWorkflowInput) 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 DeleteWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkflowInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteWorkflowInput) SetId(v string) *DeleteWorkflowInput { - s.Id = &v - return s -} - -type DeleteWorkflowOutput 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 DeleteWorkflowOutput) 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 DeleteWorkflowOutput) GoString() string { - return s.String() -} - -// The entity tag (ETag) is a hash of the object representing its semantic content. -type ETag struct { - _ struct{} `type:"structure"` - - // The algorithm used to calculate the read set’s ETag(s). - Algorithm *string `locationName:"algorithm" type:"string" enum:"ETagAlgorithm"` - - // The ETag hash calculated on Source1 of the read set. - Source1 *string `locationName:"source1" type:"string"` - - // The ETag hash calculated on Source2 of the read set. - Source2 *string `locationName:"source2" 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 ETag) 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 ETag) GoString() string { - return s.String() -} - -// SetAlgorithm sets the Algorithm field's value. -func (s *ETag) SetAlgorithm(v string) *ETag { - s.Algorithm = &v - return s -} - -// SetSource1 sets the Source1 field's value. -func (s *ETag) SetSource1(v string) *ETag { - s.Source1 = &v - return s -} - -// SetSource2 sets the Source2 field's value. -func (s *ETag) SetSource2(v string) *ETag { - s.Source2 = &v - return s -} - -// A read set. -type ExportReadSet struct { - _ struct{} `type:"structure"` - - // The set's ID. - // - // ReadSetId is a required field - ReadSetId *string `locationName:"readSetId" min:"10" 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 ExportReadSet) 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 ExportReadSet) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportReadSet) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportReadSet"} - if s.ReadSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ReadSetId")) - } - if s.ReadSetId != nil && len(*s.ReadSetId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReadSetId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReadSetId sets the ReadSetId field's value. -func (s *ExportReadSet) SetReadSetId(v string) *ExportReadSet { - s.ReadSetId = &v - return s -} - -// Details about a read set. -type ExportReadSetDetail struct { - _ struct{} `type:"structure"` - - // The set's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The set's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetExportJobItemStatus"` - - // The set's status message. - StatusMessage *string `locationName:"statusMessage" min:"1" 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 ExportReadSetDetail) 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 ExportReadSetDetail) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *ExportReadSetDetail) SetId(v string) *ExportReadSetDetail { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ExportReadSetDetail) SetStatus(v string) *ExportReadSetDetail { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ExportReadSetDetail) SetStatusMessage(v string) *ExportReadSetDetail { - s.StatusMessage = &v - return s -} - -// An read set export job filter. -type ExportReadSetFilter struct { - _ struct{} `type:"structure"` - - // The filter's start date. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's end date. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` - - // A status to filter on. - Status *string `locationName:"status" type:"string" enum:"ReadSetExportJobStatus"` -} - -// 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 ExportReadSetFilter) 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 ExportReadSetFilter) GoString() string { - return s.String() -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ExportReadSetFilter) SetCreatedAfter(v time.Time) *ExportReadSetFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ExportReadSetFilter) SetCreatedBefore(v time.Time) *ExportReadSetFilter { - s.CreatedBefore = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ExportReadSetFilter) SetStatus(v string) *ExportReadSetFilter { - s.Status = &v - return s -} - -// Details about a read set export job. -type ExportReadSetJobDetail struct { - _ struct{} `type:"structure"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's destination in Amazon S3. - // - // Destination is a required field - Destination *string `locationName:"destination" type:"string" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetExportJobStatus"` -} - -// 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 ExportReadSetJobDetail) 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 ExportReadSetJobDetail) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *ExportReadSetJobDetail) SetCompletionTime(v time.Time) *ExportReadSetJobDetail { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ExportReadSetJobDetail) SetCreationTime(v time.Time) *ExportReadSetJobDetail { - s.CreationTime = &v - return s -} - -// SetDestination sets the Destination field's value. -func (s *ExportReadSetJobDetail) SetDestination(v string) *ExportReadSetJobDetail { - s.Destination = &v - return s -} - -// SetId sets the Id field's value. -func (s *ExportReadSetJobDetail) SetId(v string) *ExportReadSetJobDetail { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ExportReadSetJobDetail) SetSequenceStoreId(v string) *ExportReadSetJobDetail { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ExportReadSetJobDetail) SetStatus(v string) *ExportReadSetJobDetail { - s.Status = &v - return s -} - -// Details about a file. -type FileInformation struct { - _ struct{} `type:"structure"` - - // The file's content length. - ContentLength *int64 `locationName:"contentLength" min:"1" type:"long"` - - // The file's part size. - PartSize *int64 `locationName:"partSize" min:"1" type:"long"` - - // The file's total parts. - TotalParts *int64 `locationName:"totalParts" min:"1" 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 FileInformation) 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 FileInformation) GoString() string { - return s.String() -} - -// SetContentLength sets the ContentLength field's value. -func (s *FileInformation) SetContentLength(v int64) *FileInformation { - s.ContentLength = &v - return s -} - -// SetPartSize sets the PartSize field's value. -func (s *FileInformation) SetPartSize(v int64) *FileInformation { - s.PartSize = &v - return s -} - -// SetTotalParts sets the TotalParts field's value. -func (s *FileInformation) SetTotalParts(v int64) *FileInformation { - s.TotalParts = &v - return s -} - -// Use filters to focus the returned annotation store versions on a specific -// parameter, such as the status of the annotation store. -type Filter struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Number (Arn) for an analytics store. - ResourceArns []*string `locationName:"resourceArns" min:"1" type:"list"` - - // The status of an annotation store version. - Status []*string `locationName:"status" type:"list" enum:"ShareStatus"` -} - -// 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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Filter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Filter"} - if s.ResourceArns != nil && len(s.ResourceArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArns sets the ResourceArns field's value. -func (s *Filter) SetResourceArns(v []*string) *Filter { - s.ResourceArns = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Filter) SetStatus(v []*string) *Filter { - s.Status = v - return s -} - -// Formatting options for a file. -type FormatOptions struct { - _ struct{} `type:"structure"` - - // Options for a TSV file. - TsvOptions *TsvOptions `locationName:"tsvOptions" type:"structure"` - - // Options for a VCF file. - VcfOptions *VcfOptions `locationName:"vcfOptions" 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 FormatOptions) 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 FormatOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FormatOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FormatOptions"} - if s.TsvOptions != nil { - if err := s.TsvOptions.Validate(); err != nil { - invalidParams.AddNested("TsvOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTsvOptions sets the TsvOptions field's value. -func (s *FormatOptions) SetTsvOptions(v *TsvOptions) *FormatOptions { - s.TsvOptions = v - return s -} - -// SetVcfOptions sets the VcfOptions field's value. -func (s *FormatOptions) SetVcfOptions(v *VcfOptions) *FormatOptions { - s.VcfOptions = v - return s -} - -type GetAnnotationImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The job's ID. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" 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 GetAnnotationImportJobInput) 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 GetAnnotationImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAnnotationImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAnnotationImportJobInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobId sets the JobId field's value. -func (s *GetAnnotationImportJobInput) SetJobId(v string) *GetAnnotationImportJobInput { - s.JobId = &v - return s -} - -type GetAnnotationImportJobOutput struct { - _ struct{} `type:"structure"` - - // The annotation schema generated by the parsed annotation data. - AnnotationFields map[string]*string `locationName:"annotationFields" type:"map"` - - // When the job completed. - // - // CompletionTime is a required field - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's destination annotation store. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" min:"3" type:"string" required:"true"` - - // Formatting options for a file. - // - // FormatOptions is a required field - FormatOptions *FormatOptions `locationName:"formatOptions" type:"structure" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The job's imported items. - // - // Items is a required field - Items []*AnnotationImportItemDetail `locationName:"items" min:"1" type:"list" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's left normalization setting. - // - // RunLeftNormalization is a required field - RunLeftNormalization *bool `locationName:"runLeftNormalization" type:"boolean" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"JobStatus"` - - // The job's status message. - // - // StatusMessage is a required field - StatusMessage *string `locationName:"statusMessage" type:"string" required:"true"` - - // When the job was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The name of the annotation store version. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" 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 GetAnnotationImportJobOutput) 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 GetAnnotationImportJobOutput) GoString() string { - return s.String() -} - -// SetAnnotationFields sets the AnnotationFields field's value. -func (s *GetAnnotationImportJobOutput) SetAnnotationFields(v map[string]*string) *GetAnnotationImportJobOutput { - s.AnnotationFields = v - return s -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *GetAnnotationImportJobOutput) SetCompletionTime(v time.Time) *GetAnnotationImportJobOutput { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetAnnotationImportJobOutput) SetCreationTime(v time.Time) *GetAnnotationImportJobOutput { - s.CreationTime = &v - return s -} - -// SetDestinationName sets the DestinationName field's value. -func (s *GetAnnotationImportJobOutput) SetDestinationName(v string) *GetAnnotationImportJobOutput { - s.DestinationName = &v - return s -} - -// SetFormatOptions sets the FormatOptions field's value. -func (s *GetAnnotationImportJobOutput) SetFormatOptions(v *FormatOptions) *GetAnnotationImportJobOutput { - s.FormatOptions = v - return s -} - -// SetId sets the Id field's value. -func (s *GetAnnotationImportJobOutput) SetId(v string) *GetAnnotationImportJobOutput { - s.Id = &v - return s -} - -// SetItems sets the Items field's value. -func (s *GetAnnotationImportJobOutput) SetItems(v []*AnnotationImportItemDetail) *GetAnnotationImportJobOutput { - s.Items = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetAnnotationImportJobOutput) SetRoleArn(v string) *GetAnnotationImportJobOutput { - s.RoleArn = &v - return s -} - -// SetRunLeftNormalization sets the RunLeftNormalization field's value. -func (s *GetAnnotationImportJobOutput) SetRunLeftNormalization(v bool) *GetAnnotationImportJobOutput { - s.RunLeftNormalization = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetAnnotationImportJobOutput) SetStatus(v string) *GetAnnotationImportJobOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetAnnotationImportJobOutput) SetStatusMessage(v string) *GetAnnotationImportJobOutput { - s.StatusMessage = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *GetAnnotationImportJobOutput) SetUpdateTime(v time.Time) *GetAnnotationImportJobOutput { - s.UpdateTime = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *GetAnnotationImportJobOutput) SetVersionName(v string) *GetAnnotationImportJobOutput { - s.VersionName = &v - return s -} - -type GetAnnotationStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The store's name. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" 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 GetAnnotationStoreInput) 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 GetAnnotationStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAnnotationStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAnnotationStoreInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetAnnotationStoreInput) SetName(v string) *GetAnnotationStoreInput { - s.Name = &v - return s -} - -type GetAnnotationStoreOutput struct { - _ struct{} `type:"structure"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The store's name. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // An integer indicating how many versions of an annotation store exist. - // - // NumVersions is a required field - NumVersions *int64 `locationName:"numVersions" type:"integer" required:"true"` - - // The store's genome reference. - // - // Reference is a required field - Reference *ReferenceItem `locationName:"reference" type:"structure" required:"true"` - - // The store's server-side encryption (SSE) settings. - // - // SseConfig is a required field - SseConfig *SseConfig `locationName:"sseConfig" type:"structure" required:"true"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` - - // A status message. - // - // StatusMessage is a required field - StatusMessage *string `locationName:"statusMessage" type:"string" required:"true"` - - // The store's ARN. - // - // StoreArn is a required field - StoreArn *string `locationName:"storeArn" min:"20" type:"string" required:"true"` - - // The store's annotation file format. - StoreFormat *string `locationName:"storeFormat" type:"string" enum:"StoreFormat"` - - // The store's parsing options. - StoreOptions *StoreOptions `locationName:"storeOptions" type:"structure"` - - // The store's size in bytes. - // - // StoreSizeBytes is a required field - StoreSizeBytes *int64 `locationName:"storeSizeBytes" type:"long" required:"true"` - - // The store's tags. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true"` - - // When the store was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 GetAnnotationStoreOutput) 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 GetAnnotationStoreOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetAnnotationStoreOutput) SetCreationTime(v time.Time) *GetAnnotationStoreOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetAnnotationStoreOutput) SetDescription(v string) *GetAnnotationStoreOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetAnnotationStoreOutput) SetId(v string) *GetAnnotationStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetAnnotationStoreOutput) SetName(v string) *GetAnnotationStoreOutput { - s.Name = &v - return s -} - -// SetNumVersions sets the NumVersions field's value. -func (s *GetAnnotationStoreOutput) SetNumVersions(v int64) *GetAnnotationStoreOutput { - s.NumVersions = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *GetAnnotationStoreOutput) SetReference(v *ReferenceItem) *GetAnnotationStoreOutput { - s.Reference = v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *GetAnnotationStoreOutput) SetSseConfig(v *SseConfig) *GetAnnotationStoreOutput { - s.SseConfig = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetAnnotationStoreOutput) SetStatus(v string) *GetAnnotationStoreOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetAnnotationStoreOutput) SetStatusMessage(v string) *GetAnnotationStoreOutput { - s.StatusMessage = &v - return s -} - -// SetStoreArn sets the StoreArn field's value. -func (s *GetAnnotationStoreOutput) SetStoreArn(v string) *GetAnnotationStoreOutput { - s.StoreArn = &v - return s -} - -// SetStoreFormat sets the StoreFormat field's value. -func (s *GetAnnotationStoreOutput) SetStoreFormat(v string) *GetAnnotationStoreOutput { - s.StoreFormat = &v - return s -} - -// SetStoreOptions sets the StoreOptions field's value. -func (s *GetAnnotationStoreOutput) SetStoreOptions(v *StoreOptions) *GetAnnotationStoreOutput { - s.StoreOptions = v - return s -} - -// SetStoreSizeBytes sets the StoreSizeBytes field's value. -func (s *GetAnnotationStoreOutput) SetStoreSizeBytes(v int64) *GetAnnotationStoreOutput { - s.StoreSizeBytes = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetAnnotationStoreOutput) SetTags(v map[string]*string) *GetAnnotationStoreOutput { - s.Tags = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *GetAnnotationStoreOutput) SetUpdateTime(v time.Time) *GetAnnotationStoreOutput { - s.UpdateTime = &v - return s -} - -type GetAnnotationStoreVersionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name given to an annotation store version to distinguish it from others. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` - - // The name given to an annotation store version to distinguish it from others. - // - // VersionName is a required field - VersionName *string `location:"uri" locationName:"versionName" 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 GetAnnotationStoreVersionInput) 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 GetAnnotationStoreVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAnnotationStoreVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAnnotationStoreVersionInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.VersionName == nil { - invalidParams.Add(request.NewErrParamRequired("VersionName")) - } - if s.VersionName != nil && len(*s.VersionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetAnnotationStoreVersionInput) SetName(v string) *GetAnnotationStoreVersionInput { - s.Name = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *GetAnnotationStoreVersionInput) SetVersionName(v string) *GetAnnotationStoreVersionInput { - s.VersionName = &v - return s -} - -type GetAnnotationStoreVersionOutput struct { - _ struct{} `type:"structure"` - - // The time stamp for when an annotation store version was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The description for an annotation store version. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The annotation store version ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of the annotation store. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The status of an annotation store version. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"VersionStatus"` - - // The status of an annotation store version. - // - // StatusMessage is a required field - StatusMessage *string `locationName:"statusMessage" type:"string" required:"true"` - - // The store ID for annotation store version. - // - // StoreId is a required field - StoreId *string `locationName:"storeId" type:"string" required:"true"` - - // Any tags associated with an annotation store version. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true"` - - // The time stamp for when an annotation store version was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Arn for the annotation store. - // - // VersionArn is a required field - VersionArn *string `locationName:"versionArn" min:"20" type:"string" required:"true"` - - // The name given to an annotation store version to distinguish it from others. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" type:"string" required:"true"` - - // The options for an annotation store version. - VersionOptions *VersionOptions `locationName:"versionOptions" type:"structure"` - - // The size of the annotation store version in Bytes. - // - // VersionSizeBytes is a required field - VersionSizeBytes *int64 `locationName:"versionSizeBytes" type:"long" 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 GetAnnotationStoreVersionOutput) 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 GetAnnotationStoreVersionOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetAnnotationStoreVersionOutput) SetCreationTime(v time.Time) *GetAnnotationStoreVersionOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetAnnotationStoreVersionOutput) SetDescription(v string) *GetAnnotationStoreVersionOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetAnnotationStoreVersionOutput) SetId(v string) *GetAnnotationStoreVersionOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetAnnotationStoreVersionOutput) SetName(v string) *GetAnnotationStoreVersionOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetAnnotationStoreVersionOutput) SetStatus(v string) *GetAnnotationStoreVersionOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetAnnotationStoreVersionOutput) SetStatusMessage(v string) *GetAnnotationStoreVersionOutput { - s.StatusMessage = &v - return s -} - -// SetStoreId sets the StoreId field's value. -func (s *GetAnnotationStoreVersionOutput) SetStoreId(v string) *GetAnnotationStoreVersionOutput { - s.StoreId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetAnnotationStoreVersionOutput) SetTags(v map[string]*string) *GetAnnotationStoreVersionOutput { - s.Tags = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *GetAnnotationStoreVersionOutput) SetUpdateTime(v time.Time) *GetAnnotationStoreVersionOutput { - s.UpdateTime = &v - return s -} - -// SetVersionArn sets the VersionArn field's value. -func (s *GetAnnotationStoreVersionOutput) SetVersionArn(v string) *GetAnnotationStoreVersionOutput { - s.VersionArn = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *GetAnnotationStoreVersionOutput) SetVersionName(v string) *GetAnnotationStoreVersionOutput { - s.VersionName = &v - return s -} - -// SetVersionOptions sets the VersionOptions field's value. -func (s *GetAnnotationStoreVersionOutput) SetVersionOptions(v *VersionOptions) *GetAnnotationStoreVersionOutput { - s.VersionOptions = v - return s -} - -// SetVersionSizeBytes sets the VersionSizeBytes field's value. -func (s *GetAnnotationStoreVersionOutput) SetVersionSizeBytes(v int64) *GetAnnotationStoreVersionOutput { - s.VersionSizeBytes = &v - return s -} - -type GetReadSetActivationJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 GetReadSetActivationJobInput) 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 GetReadSetActivationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReadSetActivationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReadSetActivationJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetReadSetActivationJobInput) SetId(v string) *GetReadSetActivationJobInput { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetActivationJobInput) SetSequenceStoreId(v string) *GetReadSetActivationJobInput { - s.SequenceStoreId = &v - return s -} - -type GetReadSetActivationJobOutput struct { - _ struct{} `type:"structure"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's source files. - Sources []*ActivateReadSetSourceItem `locationName:"sources" type:"list"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetActivationJobStatus"` - - // The job's status message. - StatusMessage *string `locationName:"statusMessage" min:"1" 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 GetReadSetActivationJobOutput) 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 GetReadSetActivationJobOutput) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *GetReadSetActivationJobOutput) SetCompletionTime(v time.Time) *GetReadSetActivationJobOutput { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetReadSetActivationJobOutput) SetCreationTime(v time.Time) *GetReadSetActivationJobOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetReadSetActivationJobOutput) SetId(v string) *GetReadSetActivationJobOutput { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetActivationJobOutput) SetSequenceStoreId(v string) *GetReadSetActivationJobOutput { - s.SequenceStoreId = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *GetReadSetActivationJobOutput) SetSources(v []*ActivateReadSetSourceItem) *GetReadSetActivationJobOutput { - s.Sources = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetReadSetActivationJobOutput) SetStatus(v string) *GetReadSetActivationJobOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetReadSetActivationJobOutput) SetStatusMessage(v string) *GetReadSetActivationJobOutput { - s.StatusMessage = &v - return s -} - -type GetReadSetExportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 GetReadSetExportJobInput) 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 GetReadSetExportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReadSetExportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReadSetExportJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetReadSetExportJobInput) SetId(v string) *GetReadSetExportJobInput { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetExportJobInput) SetSequenceStoreId(v string) *GetReadSetExportJobInput { - s.SequenceStoreId = &v - return s -} - -type GetReadSetExportJobOutput struct { - _ struct{} `type:"structure"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's destination in Amazon S3. - // - // Destination is a required field - Destination *string `locationName:"destination" type:"string" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's read sets. - ReadSets []*ExportReadSetDetail `locationName:"readSets" type:"list"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetExportJobStatus"` - - // The job's status message. - StatusMessage *string `locationName:"statusMessage" min:"1" 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 GetReadSetExportJobOutput) 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 GetReadSetExportJobOutput) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *GetReadSetExportJobOutput) SetCompletionTime(v time.Time) *GetReadSetExportJobOutput { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetReadSetExportJobOutput) SetCreationTime(v time.Time) *GetReadSetExportJobOutput { - s.CreationTime = &v - return s -} - -// SetDestination sets the Destination field's value. -func (s *GetReadSetExportJobOutput) SetDestination(v string) *GetReadSetExportJobOutput { - s.Destination = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetReadSetExportJobOutput) SetId(v string) *GetReadSetExportJobOutput { - s.Id = &v - return s -} - -// SetReadSets sets the ReadSets field's value. -func (s *GetReadSetExportJobOutput) SetReadSets(v []*ExportReadSetDetail) *GetReadSetExportJobOutput { - s.ReadSets = v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetExportJobOutput) SetSequenceStoreId(v string) *GetReadSetExportJobOutput { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetReadSetExportJobOutput) SetStatus(v string) *GetReadSetExportJobOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetReadSetExportJobOutput) SetStatusMessage(v string) *GetReadSetExportJobOutput { - s.StatusMessage = &v - return s -} - -type GetReadSetImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 GetReadSetImportJobInput) 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 GetReadSetImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReadSetImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReadSetImportJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetReadSetImportJobInput) SetId(v string) *GetReadSetImportJobInput { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetImportJobInput) SetSequenceStoreId(v string) *GetReadSetImportJobInput { - s.SequenceStoreId = &v - return s -} - -type GetReadSetImportJobOutput struct { - _ struct{} `type:"structure"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's source files. - // - // Sources is a required field - Sources []*ImportReadSetSourceItem `locationName:"sources" type:"list" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetImportJobStatus"` - - // The job's status message. - StatusMessage *string `locationName:"statusMessage" min:"1" 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 GetReadSetImportJobOutput) 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 GetReadSetImportJobOutput) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *GetReadSetImportJobOutput) SetCompletionTime(v time.Time) *GetReadSetImportJobOutput { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetReadSetImportJobOutput) SetCreationTime(v time.Time) *GetReadSetImportJobOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetReadSetImportJobOutput) SetId(v string) *GetReadSetImportJobOutput { - s.Id = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetReadSetImportJobOutput) SetRoleArn(v string) *GetReadSetImportJobOutput { - s.RoleArn = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetImportJobOutput) SetSequenceStoreId(v string) *GetReadSetImportJobOutput { - s.SequenceStoreId = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *GetReadSetImportJobOutput) SetSources(v []*ImportReadSetSourceItem) *GetReadSetImportJobOutput { - s.Sources = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetReadSetImportJobOutput) SetStatus(v string) *GetReadSetImportJobOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetReadSetImportJobOutput) SetStatusMessage(v string) *GetReadSetImportJobOutput { - s.StatusMessage = &v - return s -} - -type GetReadSetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The file to retrieve. - File *string `location:"querystring" locationName:"file" type:"string" enum:"ReadSetFile"` - - // The read set's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The part number to retrieve. - // - // PartNumber is a required field - PartNumber *int64 `location:"querystring" locationName:"partNumber" min:"1" type:"integer" required:"true"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 GetReadSetInput) 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 GetReadSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReadSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReadSetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.PartNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PartNumber")) - } - if s.PartNumber != nil && *s.PartNumber < 1 { - invalidParams.Add(request.NewErrParamMinValue("PartNumber", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFile sets the File field's value. -func (s *GetReadSetInput) SetFile(v string) *GetReadSetInput { - s.File = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetReadSetInput) SetId(v string) *GetReadSetInput { - s.Id = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *GetReadSetInput) SetPartNumber(v int64) *GetReadSetInput { - s.PartNumber = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetInput) SetSequenceStoreId(v string) *GetReadSetInput { - s.SequenceStoreId = &v - return s -} - -type GetReadSetMetadataInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The read set's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 GetReadSetMetadataInput) 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 GetReadSetMetadataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReadSetMetadataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReadSetMetadataInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetReadSetMetadataInput) SetId(v string) *GetReadSetMetadataInput { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetMetadataInput) SetSequenceStoreId(v string) *GetReadSetMetadataInput { - s.SequenceStoreId = &v - return s -} - -type GetReadSetMetadataOutput struct { - _ struct{} `type:"structure"` - - // The read set's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the read set was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The creation type of the read set. - CreationType *string `locationName:"creationType" type:"string" enum:"CreationType"` - - // The read set's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The entity tag (ETag) is a hash of the object meant to represent its semantic - // content. - Etag *ETag `locationName:"etag" type:"structure"` - - // The read set's file type. - // - // FileType is a required field - FileType *string `locationName:"fileType" type:"string" required:"true" enum:"FileType"` - - // The read set's files. - Files *ReadSetFiles `locationName:"files" type:"structure"` - - // The read set's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The read set's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The read set's genome reference ARN. - ReferenceArn *string `locationName:"referenceArn" min:"1" type:"string"` - - // The read set's sample ID. - SampleId *string `locationName:"sampleId" min:"1" type:"string"` - - // The read set's sequence information. - SequenceInformation *SequenceInformation `locationName:"sequenceInformation" type:"structure"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The read set's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetStatus"` - - // The status message for a read set. It provides more detail as to why the - // read set has a status. - StatusMessage *string `locationName:"statusMessage" min:"1" type:"string"` - - // The read set's subject ID. - SubjectId *string `locationName:"subjectId" min:"1" 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 GetReadSetMetadataOutput) 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 GetReadSetMetadataOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetReadSetMetadataOutput) SetArn(v string) *GetReadSetMetadataOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetReadSetMetadataOutput) SetCreationTime(v time.Time) *GetReadSetMetadataOutput { - s.CreationTime = &v - return s -} - -// SetCreationType sets the CreationType field's value. -func (s *GetReadSetMetadataOutput) SetCreationType(v string) *GetReadSetMetadataOutput { - s.CreationType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetReadSetMetadataOutput) SetDescription(v string) *GetReadSetMetadataOutput { - s.Description = &v - return s -} - -// SetEtag sets the Etag field's value. -func (s *GetReadSetMetadataOutput) SetEtag(v *ETag) *GetReadSetMetadataOutput { - s.Etag = v - return s -} - -// SetFileType sets the FileType field's value. -func (s *GetReadSetMetadataOutput) SetFileType(v string) *GetReadSetMetadataOutput { - s.FileType = &v - return s -} - -// SetFiles sets the Files field's value. -func (s *GetReadSetMetadataOutput) SetFiles(v *ReadSetFiles) *GetReadSetMetadataOutput { - s.Files = v - return s -} - -// SetId sets the Id field's value. -func (s *GetReadSetMetadataOutput) SetId(v string) *GetReadSetMetadataOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetReadSetMetadataOutput) SetName(v string) *GetReadSetMetadataOutput { - s.Name = &v - return s -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *GetReadSetMetadataOutput) SetReferenceArn(v string) *GetReadSetMetadataOutput { - s.ReferenceArn = &v - return s -} - -// SetSampleId sets the SampleId field's value. -func (s *GetReadSetMetadataOutput) SetSampleId(v string) *GetReadSetMetadataOutput { - s.SampleId = &v - return s -} - -// SetSequenceInformation sets the SequenceInformation field's value. -func (s *GetReadSetMetadataOutput) SetSequenceInformation(v *SequenceInformation) *GetReadSetMetadataOutput { - s.SequenceInformation = v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *GetReadSetMetadataOutput) SetSequenceStoreId(v string) *GetReadSetMetadataOutput { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetReadSetMetadataOutput) SetStatus(v string) *GetReadSetMetadataOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetReadSetMetadataOutput) SetStatusMessage(v string) *GetReadSetMetadataOutput { - s.StatusMessage = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *GetReadSetMetadataOutput) SetSubjectId(v string) *GetReadSetMetadataOutput { - s.SubjectId = &v - return s -} - -type GetReadSetOutput struct { - _ struct{} `type:"structure" payload:"Payload"` - - // The read set file payload. - Payload io.ReadCloser `locationName:"payload" type:"blob"` -} - -// 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 GetReadSetOutput) 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 GetReadSetOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *GetReadSetOutput) SetPayload(v io.ReadCloser) *GetReadSetOutput { - s.Payload = v - return s -} - -type GetReferenceImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The job's reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `location:"uri" locationName:"referenceStoreId" min:"10" 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 GetReferenceImportJobInput) 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 GetReferenceImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReferenceImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReferenceImportJobInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.ReferenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("ReferenceStoreId")) - } - if s.ReferenceStoreId != nil && len(*s.ReferenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetReferenceImportJobInput) SetId(v string) *GetReferenceImportJobInput { - s.Id = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *GetReferenceImportJobInput) SetReferenceStoreId(v string) *GetReferenceImportJobInput { - s.ReferenceStoreId = &v - return s -} - -type GetReferenceImportJobOutput struct { - _ struct{} `type:"structure"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `locationName:"referenceStoreId" min:"10" type:"string" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's source files. - // - // Sources is a required field - Sources []*ImportReferenceSourceItem `locationName:"sources" type:"list" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReferenceImportJobStatus"` - - // The job's status message. - StatusMessage *string `locationName:"statusMessage" min:"1" 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 GetReferenceImportJobOutput) 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 GetReferenceImportJobOutput) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *GetReferenceImportJobOutput) SetCompletionTime(v time.Time) *GetReferenceImportJobOutput { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetReferenceImportJobOutput) SetCreationTime(v time.Time) *GetReferenceImportJobOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetReferenceImportJobOutput) SetId(v string) *GetReferenceImportJobOutput { - s.Id = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *GetReferenceImportJobOutput) SetReferenceStoreId(v string) *GetReferenceImportJobOutput { - s.ReferenceStoreId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetReferenceImportJobOutput) SetRoleArn(v string) *GetReferenceImportJobOutput { - s.RoleArn = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *GetReferenceImportJobOutput) SetSources(v []*ImportReferenceSourceItem) *GetReferenceImportJobOutput { - s.Sources = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetReferenceImportJobOutput) SetStatus(v string) *GetReferenceImportJobOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetReferenceImportJobOutput) SetStatusMessage(v string) *GetReferenceImportJobOutput { - s.StatusMessage = &v - return s -} - -type GetReferenceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The file to retrieve. - File *string `location:"querystring" locationName:"file" type:"string" enum:"ReferenceFile"` - - // The reference's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The part number to retrieve. - // - // PartNumber is a required field - PartNumber *int64 `location:"querystring" locationName:"partNumber" min:"1" type:"integer" required:"true"` - - // The range to retrieve. - Range *string `location:"header" locationName:"Range" min:"1" type:"string"` - - // The reference's store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `location:"uri" locationName:"referenceStoreId" min:"10" 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 GetReferenceInput) 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 GetReferenceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReferenceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReferenceInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.PartNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PartNumber")) - } - if s.PartNumber != nil && *s.PartNumber < 1 { - invalidParams.Add(request.NewErrParamMinValue("PartNumber", 1)) - } - if s.Range != nil && len(*s.Range) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Range", 1)) - } - if s.ReferenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("ReferenceStoreId")) - } - if s.ReferenceStoreId != nil && len(*s.ReferenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFile sets the File field's value. -func (s *GetReferenceInput) SetFile(v string) *GetReferenceInput { - s.File = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetReferenceInput) SetId(v string) *GetReferenceInput { - s.Id = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *GetReferenceInput) SetPartNumber(v int64) *GetReferenceInput { - s.PartNumber = &v - return s -} - -// SetRange sets the Range field's value. -func (s *GetReferenceInput) SetRange(v string) *GetReferenceInput { - s.Range = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *GetReferenceInput) SetReferenceStoreId(v string) *GetReferenceInput { - s.ReferenceStoreId = &v - return s -} - -type GetReferenceMetadataInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The reference's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" type:"string" required:"true"` - - // The reference's reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `location:"uri" locationName:"referenceStoreId" min:"10" 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 GetReferenceMetadataInput) 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 GetReferenceMetadataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReferenceMetadataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReferenceMetadataInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - if s.ReferenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("ReferenceStoreId")) - } - if s.ReferenceStoreId != nil && len(*s.ReferenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetReferenceMetadataInput) SetId(v string) *GetReferenceMetadataInput { - s.Id = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *GetReferenceMetadataInput) SetReferenceStoreId(v string) *GetReferenceMetadataInput { - s.ReferenceStoreId = &v - return s -} - -type GetReferenceMetadataOutput struct { - _ struct{} `type:"structure"` - - // The reference's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the reference was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The reference's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The reference's files. - Files *ReferenceFiles `locationName:"files" type:"structure"` - - // The reference's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The reference's MD5 checksum. - // - // Md5 is a required field - Md5 *string `locationName:"md5" min:"1" type:"string" required:"true"` - - // The reference's name. - Name *string `locationName:"name" min:"3" type:"string"` - - // The reference's reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `locationName:"referenceStoreId" min:"10" type:"string" required:"true"` - - // The reference's status. - Status *string `locationName:"status" type:"string" enum:"ReferenceStatus"` - - // When the reference was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 GetReferenceMetadataOutput) 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 GetReferenceMetadataOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetReferenceMetadataOutput) SetArn(v string) *GetReferenceMetadataOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetReferenceMetadataOutput) SetCreationTime(v time.Time) *GetReferenceMetadataOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetReferenceMetadataOutput) SetDescription(v string) *GetReferenceMetadataOutput { - s.Description = &v - return s -} - -// SetFiles sets the Files field's value. -func (s *GetReferenceMetadataOutput) SetFiles(v *ReferenceFiles) *GetReferenceMetadataOutput { - s.Files = v - return s -} - -// SetId sets the Id field's value. -func (s *GetReferenceMetadataOutput) SetId(v string) *GetReferenceMetadataOutput { - s.Id = &v - return s -} - -// SetMd5 sets the Md5 field's value. -func (s *GetReferenceMetadataOutput) SetMd5(v string) *GetReferenceMetadataOutput { - s.Md5 = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetReferenceMetadataOutput) SetName(v string) *GetReferenceMetadataOutput { - s.Name = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *GetReferenceMetadataOutput) SetReferenceStoreId(v string) *GetReferenceMetadataOutput { - s.ReferenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetReferenceMetadataOutput) SetStatus(v string) *GetReferenceMetadataOutput { - s.Status = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *GetReferenceMetadataOutput) SetUpdateTime(v time.Time) *GetReferenceMetadataOutput { - s.UpdateTime = &v - return s -} - -type GetReferenceOutput struct { - _ struct{} `type:"structure" payload:"Payload"` - - // The reference file payload. - Payload io.ReadCloser `locationName:"payload" type:"blob"` -} - -// 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 GetReferenceOutput) 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 GetReferenceOutput) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *GetReferenceOutput) SetPayload(v io.ReadCloser) *GetReferenceOutput { - s.Payload = v - return s -} - -type GetReferenceStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" 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 GetReferenceStoreInput) 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 GetReferenceStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetReferenceStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetReferenceStoreInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetReferenceStoreInput) SetId(v string) *GetReferenceStoreInput { - s.Id = &v - return s -} - -type GetReferenceStoreOutput struct { - _ struct{} `type:"structure"` - - // The store's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The store's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The store's server-side encryption (SSE) settings. - SseConfig *SseConfig `locationName:"sseConfig" 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 GetReferenceStoreOutput) 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 GetReferenceStoreOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetReferenceStoreOutput) SetArn(v string) *GetReferenceStoreOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetReferenceStoreOutput) SetCreationTime(v time.Time) *GetReferenceStoreOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetReferenceStoreOutput) SetDescription(v string) *GetReferenceStoreOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetReferenceStoreOutput) SetId(v string) *GetReferenceStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetReferenceStoreOutput) SetName(v string) *GetReferenceStoreOutput { - s.Name = &v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *GetReferenceStoreOutput) SetSseConfig(v *SseConfig) *GetReferenceStoreOutput { - s.SseConfig = v - return s -} - -type GetRunGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The group's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 GetRunGroupInput) 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 GetRunGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRunGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRunGroupInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetRunGroupInput) SetId(v string) *GetRunGroupInput { - s.Id = &v - return s -} - -type GetRunGroupOutput struct { - _ struct{} `type:"structure"` - - // The group's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // When the group was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The group's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // The group's maximum number of CPUs to use. - MaxCpus *int64 `locationName:"maxCpus" min:"1" type:"integer"` - - // The group's maximum run time in minutes. - MaxDuration *int64 `locationName:"maxDuration" min:"1" type:"integer"` - - // The maximum GPUs that can be used by a run group. - MaxGpus *int64 `locationName:"maxGpus" min:"1" type:"integer"` - - // The maximum number of concurrent runs for the group. - MaxRuns *int64 `locationName:"maxRuns" min:"1" type:"integer"` - - // The group's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The group's tags. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 GetRunGroupOutput) 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 GetRunGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetRunGroupOutput) SetArn(v string) *GetRunGroupOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetRunGroupOutput) SetCreationTime(v time.Time) *GetRunGroupOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetRunGroupOutput) SetId(v string) *GetRunGroupOutput { - s.Id = &v - return s -} - -// SetMaxCpus sets the MaxCpus field's value. -func (s *GetRunGroupOutput) SetMaxCpus(v int64) *GetRunGroupOutput { - s.MaxCpus = &v - return s -} - -// SetMaxDuration sets the MaxDuration field's value. -func (s *GetRunGroupOutput) SetMaxDuration(v int64) *GetRunGroupOutput { - s.MaxDuration = &v - return s -} - -// SetMaxGpus sets the MaxGpus field's value. -func (s *GetRunGroupOutput) SetMaxGpus(v int64) *GetRunGroupOutput { - s.MaxGpus = &v - return s -} - -// SetMaxRuns sets the MaxRuns field's value. -func (s *GetRunGroupOutput) SetMaxRuns(v int64) *GetRunGroupOutput { - s.MaxRuns = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetRunGroupOutput) SetName(v string) *GetRunGroupOutput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetRunGroupOutput) SetTags(v map[string]*string) *GetRunGroupOutput { - s.Tags = v - return s -} - -type GetRunInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The run's export format. - Export []*string `location:"querystring" locationName:"export" type:"list" enum:"RunExport"` - - // The run's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" 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 GetRunInput) 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 GetRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRunInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExport sets the Export field's value. -func (s *GetRunInput) SetExport(v []*string) *GetRunInput { - s.Export = v - return s -} - -// SetId sets the Id field's value. -func (s *GetRunInput) SetId(v string) *GetRunInput { - s.Id = &v - return s -} - -type GetRunOutput struct { - _ struct{} `type:"structure"` - - // The computational accelerator used to run the workflow. - Accelerators *string `locationName:"accelerators" min:"1" type:"string" enum:"Accelerators"` - - // The run's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // When the run was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The run's definition. - Definition *string `locationName:"definition" min:"1" type:"string"` - - // The run's digest. - Digest *string `locationName:"digest" min:"1" type:"string"` - - // The reason a run has failed. - FailureReason *string `locationName:"failureReason" min:"1" type:"string"` - - // The run's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // The run's log level. - LogLevel *string `locationName:"logLevel" min:"1" type:"string" enum:"RunLogLevel"` - - // The location of the run log. - LogLocation *RunLogLocation `locationName:"logLocation" type:"structure"` - - // The run's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The run's output URI. - OutputUri *string `locationName:"outputUri" min:"1" type:"string"` - - // The run's priority. - Priority *int64 `locationName:"priority" type:"integer"` - - // The run's resource digests. - ResourceDigests map[string]*string `locationName:"resourceDigests" type:"map"` - - // The run's retention mode. - RetentionMode *string `locationName:"retentionMode" min:"1" type:"string" enum:"RunRetentionMode"` - - // The run's service role ARN. - RoleArn *string `locationName:"roleArn" min:"1" type:"string"` - - // The run's group ID. - RunGroupId *string `locationName:"runGroupId" min:"1" type:"string"` - - // The run's ID. - RunId *string `locationName:"runId" min:"1" type:"string"` - - // The destination for workflow outputs. - RunOutputUri *string `locationName:"runOutputUri" min:"1" type:"string"` - - // When the run started. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // Who started the run. - StartedBy *string `locationName:"startedBy" min:"1" type:"string"` - - // The run's status. - Status *string `locationName:"status" min:"1" type:"string" enum:"RunStatus"` - - // The run's status message. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The run's stop time. - StopTime *time.Time `locationName:"stopTime" type:"timestamp" timestampFormat:"iso8601"` - - // The run's storage capacity in gigabytes. - StorageCapacity *int64 `locationName:"storageCapacity" type:"integer"` - - // The run's tags. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The universally unique identifier for a run. - Uuid *string `locationName:"uuid" min:"1" type:"string"` - - // The run's workflow ID. - WorkflowId *string `locationName:"workflowId" min:"1" type:"string"` - - // The run's workflow type. - WorkflowType *string `locationName:"workflowType" min:"1" type:"string" enum:"WorkflowType"` -} - -// 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 GetRunOutput) 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 GetRunOutput) GoString() string { - return s.String() -} - -// SetAccelerators sets the Accelerators field's value. -func (s *GetRunOutput) SetAccelerators(v string) *GetRunOutput { - s.Accelerators = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetRunOutput) SetArn(v string) *GetRunOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetRunOutput) SetCreationTime(v time.Time) *GetRunOutput { - s.CreationTime = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *GetRunOutput) SetDefinition(v string) *GetRunOutput { - s.Definition = &v - return s -} - -// SetDigest sets the Digest field's value. -func (s *GetRunOutput) SetDigest(v string) *GetRunOutput { - s.Digest = &v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *GetRunOutput) SetFailureReason(v string) *GetRunOutput { - s.FailureReason = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetRunOutput) SetId(v string) *GetRunOutput { - s.Id = &v - return s -} - -// SetLogLevel sets the LogLevel field's value. -func (s *GetRunOutput) SetLogLevel(v string) *GetRunOutput { - s.LogLevel = &v - return s -} - -// SetLogLocation sets the LogLocation field's value. -func (s *GetRunOutput) SetLogLocation(v *RunLogLocation) *GetRunOutput { - s.LogLocation = v - return s -} - -// SetName sets the Name field's value. -func (s *GetRunOutput) SetName(v string) *GetRunOutput { - s.Name = &v - return s -} - -// SetOutputUri sets the OutputUri field's value. -func (s *GetRunOutput) SetOutputUri(v string) *GetRunOutput { - s.OutputUri = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *GetRunOutput) SetPriority(v int64) *GetRunOutput { - s.Priority = &v - return s -} - -// SetResourceDigests sets the ResourceDigests field's value. -func (s *GetRunOutput) SetResourceDigests(v map[string]*string) *GetRunOutput { - s.ResourceDigests = v - return s -} - -// SetRetentionMode sets the RetentionMode field's value. -func (s *GetRunOutput) SetRetentionMode(v string) *GetRunOutput { - s.RetentionMode = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetRunOutput) SetRoleArn(v string) *GetRunOutput { - s.RoleArn = &v - return s -} - -// SetRunGroupId sets the RunGroupId field's value. -func (s *GetRunOutput) SetRunGroupId(v string) *GetRunOutput { - s.RunGroupId = &v - return s -} - -// SetRunId sets the RunId field's value. -func (s *GetRunOutput) SetRunId(v string) *GetRunOutput { - s.RunId = &v - return s -} - -// SetRunOutputUri sets the RunOutputUri field's value. -func (s *GetRunOutput) SetRunOutputUri(v string) *GetRunOutput { - s.RunOutputUri = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetRunOutput) SetStartTime(v time.Time) *GetRunOutput { - s.StartTime = &v - return s -} - -// SetStartedBy sets the StartedBy field's value. -func (s *GetRunOutput) SetStartedBy(v string) *GetRunOutput { - s.StartedBy = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetRunOutput) SetStatus(v string) *GetRunOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetRunOutput) SetStatusMessage(v string) *GetRunOutput { - s.StatusMessage = &v - return s -} - -// SetStopTime sets the StopTime field's value. -func (s *GetRunOutput) SetStopTime(v time.Time) *GetRunOutput { - s.StopTime = &v - return s -} - -// SetStorageCapacity sets the StorageCapacity field's value. -func (s *GetRunOutput) SetStorageCapacity(v int64) *GetRunOutput { - s.StorageCapacity = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetRunOutput) SetTags(v map[string]*string) *GetRunOutput { - s.Tags = v - return s -} - -// SetUuid sets the Uuid field's value. -func (s *GetRunOutput) SetUuid(v string) *GetRunOutput { - s.Uuid = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *GetRunOutput) SetWorkflowId(v string) *GetRunOutput { - s.WorkflowId = &v - return s -} - -// SetWorkflowType sets the WorkflowType field's value. -func (s *GetRunOutput) SetWorkflowType(v string) *GetRunOutput { - s.WorkflowType = &v - return s -} - -type GetRunTaskInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The workflow run ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The task's ID. - // - // TaskId is a required field - TaskId *string `location:"uri" locationName:"taskId" min:"1" 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 GetRunTaskInput) 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 GetRunTaskInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRunTaskInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRunTaskInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.TaskId == nil { - invalidParams.Add(request.NewErrParamRequired("TaskId")) - } - if s.TaskId != nil && len(*s.TaskId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetRunTaskInput) SetId(v string) *GetRunTaskInput { - s.Id = &v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *GetRunTaskInput) SetTaskId(v string) *GetRunTaskInput { - s.TaskId = &v - return s -} - -type GetRunTaskOutput struct { - _ struct{} `type:"structure"` - - // The task's CPU usage. - Cpus *int64 `locationName:"cpus" min:"1" type:"integer"` - - // When the task was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The reason a task has failed. - FailureReason *string `locationName:"failureReason" min:"1" type:"string"` - - // The number of Graphics Processing Units (GPU) specified in the task. - Gpus *int64 `locationName:"gpus" type:"integer"` - - // The instance type for a task. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The task's log stream. - LogStream *string `locationName:"logStream" type:"string"` - - // The task's memory use in gigabytes. - Memory *int64 `locationName:"memory" min:"1" type:"integer"` - - // The task's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The task's start time. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The task's status. - Status *string `locationName:"status" min:"1" type:"string" enum:"TaskStatus"` - - // The task's status message. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The task's stop time. - StopTime *time.Time `locationName:"stopTime" type:"timestamp" timestampFormat:"iso8601"` - - // The task's ID. - TaskId *string `locationName:"taskId" min:"1" 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 GetRunTaskOutput) 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 GetRunTaskOutput) GoString() string { - return s.String() -} - -// SetCpus sets the Cpus field's value. -func (s *GetRunTaskOutput) SetCpus(v int64) *GetRunTaskOutput { - s.Cpus = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetRunTaskOutput) SetCreationTime(v time.Time) *GetRunTaskOutput { - s.CreationTime = &v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *GetRunTaskOutput) SetFailureReason(v string) *GetRunTaskOutput { - s.FailureReason = &v - return s -} - -// SetGpus sets the Gpus field's value. -func (s *GetRunTaskOutput) SetGpus(v int64) *GetRunTaskOutput { - s.Gpus = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *GetRunTaskOutput) SetInstanceType(v string) *GetRunTaskOutput { - s.InstanceType = &v - return s -} - -// SetLogStream sets the LogStream field's value. -func (s *GetRunTaskOutput) SetLogStream(v string) *GetRunTaskOutput { - s.LogStream = &v - return s -} - -// SetMemory sets the Memory field's value. -func (s *GetRunTaskOutput) SetMemory(v int64) *GetRunTaskOutput { - s.Memory = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetRunTaskOutput) SetName(v string) *GetRunTaskOutput { - s.Name = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetRunTaskOutput) SetStartTime(v time.Time) *GetRunTaskOutput { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetRunTaskOutput) SetStatus(v string) *GetRunTaskOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetRunTaskOutput) SetStatusMessage(v string) *GetRunTaskOutput { - s.StatusMessage = &v - return s -} - -// SetStopTime sets the StopTime field's value. -func (s *GetRunTaskOutput) SetStopTime(v time.Time) *GetRunTaskOutput { - s.StopTime = &v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *GetRunTaskOutput) SetTaskId(v string) *GetRunTaskOutput { - s.TaskId = &v - return s -} - -type GetSequenceStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"10" 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 GetSequenceStoreInput) 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 GetSequenceStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSequenceStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSequenceStoreInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 10 { - invalidParams.Add(request.NewErrParamMinLen("Id", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetSequenceStoreInput) SetId(v string) *GetSequenceStoreInput { - s.Id = &v - return s -} - -type GetSequenceStoreOutput struct { - _ struct{} `type:"structure"` - - // The store's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // An S3 location that is used to store files that have failed a direct upload. - FallbackLocation *string `locationName:"fallbackLocation" type:"string"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The store's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The store's server-side encryption (SSE) settings. - SseConfig *SseConfig `locationName:"sseConfig" 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 GetSequenceStoreOutput) 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 GetSequenceStoreOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSequenceStoreOutput) SetArn(v string) *GetSequenceStoreOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetSequenceStoreOutput) SetCreationTime(v time.Time) *GetSequenceStoreOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetSequenceStoreOutput) SetDescription(v string) *GetSequenceStoreOutput { - s.Description = &v - return s -} - -// SetFallbackLocation sets the FallbackLocation field's value. -func (s *GetSequenceStoreOutput) SetFallbackLocation(v string) *GetSequenceStoreOutput { - s.FallbackLocation = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSequenceStoreOutput) SetId(v string) *GetSequenceStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetSequenceStoreOutput) SetName(v string) *GetSequenceStoreOutput { - s.Name = &v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *GetSequenceStoreOutput) SetSseConfig(v *SseConfig) *GetSequenceStoreOutput { - s.SseConfig = v - return s -} - -type GetShareInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The generated ID for a share. - // - // ShareId is a required field - ShareId *string `location:"uri" locationName:"shareId" 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 GetShareInput) 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 GetShareInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetShareInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetShareInput"} - if s.ShareId == nil { - invalidParams.Add(request.NewErrParamRequired("ShareId")) - } - if s.ShareId != nil && len(*s.ShareId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShareId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetShareId sets the ShareId field's value. -func (s *GetShareInput) SetShareId(v string) *GetShareInput { - s.ShareId = &v - return s -} - -type GetShareOutput struct { - _ struct{} `type:"structure"` - - // An analytic store share details object. contains status, resourceArn, ownerId, - // etc. - Share *ShareDetails `locationName:"share" 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 GetShareOutput) 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 GetShareOutput) GoString() string { - return s.String() -} - -// SetShare sets the Share field's value. -func (s *GetShareOutput) SetShare(v *ShareDetails) *GetShareOutput { - s.Share = v - return s -} - -type GetVariantImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The job's ID. - // - // JobId is a required field - JobId *string `location:"uri" locationName:"jobId" 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 GetVariantImportJobInput) 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 GetVariantImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVariantImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVariantImportJobInput"} - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetJobId sets the JobId field's value. -func (s *GetVariantImportJobInput) SetJobId(v string) *GetVariantImportJobInput { - s.JobId = &v - return s -} - -type GetVariantImportJobOutput struct { - _ struct{} `type:"structure"` - - // The annotation schema generated by the parsed annotation data. - AnnotationFields map[string]*string `locationName:"annotationFields" type:"map"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's destination variant store. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" min:"3" type:"string" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The job's items. - // - // Items is a required field - Items []*VariantImportItemDetail `locationName:"items" min:"1" type:"list" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's left normalization setting. - // - // RunLeftNormalization is a required field - RunLeftNormalization *bool `locationName:"runLeftNormalization" type:"boolean" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"JobStatus"` - - // The job's status message. - // - // StatusMessage is a required field - StatusMessage *string `locationName:"statusMessage" type:"string" required:"true"` - - // When the job was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 GetVariantImportJobOutput) 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 GetVariantImportJobOutput) GoString() string { - return s.String() -} - -// SetAnnotationFields sets the AnnotationFields field's value. -func (s *GetVariantImportJobOutput) SetAnnotationFields(v map[string]*string) *GetVariantImportJobOutput { - s.AnnotationFields = v - return s -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *GetVariantImportJobOutput) SetCompletionTime(v time.Time) *GetVariantImportJobOutput { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetVariantImportJobOutput) SetCreationTime(v time.Time) *GetVariantImportJobOutput { - s.CreationTime = &v - return s -} - -// SetDestinationName sets the DestinationName field's value. -func (s *GetVariantImportJobOutput) SetDestinationName(v string) *GetVariantImportJobOutput { - s.DestinationName = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetVariantImportJobOutput) SetId(v string) *GetVariantImportJobOutput { - s.Id = &v - return s -} - -// SetItems sets the Items field's value. -func (s *GetVariantImportJobOutput) SetItems(v []*VariantImportItemDetail) *GetVariantImportJobOutput { - s.Items = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetVariantImportJobOutput) SetRoleArn(v string) *GetVariantImportJobOutput { - s.RoleArn = &v - return s -} - -// SetRunLeftNormalization sets the RunLeftNormalization field's value. -func (s *GetVariantImportJobOutput) SetRunLeftNormalization(v bool) *GetVariantImportJobOutput { - s.RunLeftNormalization = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetVariantImportJobOutput) SetStatus(v string) *GetVariantImportJobOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetVariantImportJobOutput) SetStatusMessage(v string) *GetVariantImportJobOutput { - s.StatusMessage = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *GetVariantImportJobOutput) SetUpdateTime(v time.Time) *GetVariantImportJobOutput { - s.UpdateTime = &v - return s -} - -type GetVariantStoreInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The store's name. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" 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 GetVariantStoreInput) 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 GetVariantStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVariantStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVariantStoreInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetVariantStoreInput) SetName(v string) *GetVariantStoreInput { - s.Name = &v - return s -} - -type GetVariantStoreOutput struct { - _ struct{} `type:"structure"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The store's name. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The store's genome reference. - // - // Reference is a required field - Reference *ReferenceItem `locationName:"reference" type:"structure" required:"true"` - - // The store's server-side encryption (SSE) settings. - // - // SseConfig is a required field - SseConfig *SseConfig `locationName:"sseConfig" type:"structure" required:"true"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` - - // The store's status message. - // - // StatusMessage is a required field - StatusMessage *string `locationName:"statusMessage" type:"string" required:"true"` - - // The store's ARN. - // - // StoreArn is a required field - StoreArn *string `locationName:"storeArn" min:"20" type:"string" required:"true"` - - // The store's size in bytes. - // - // StoreSizeBytes is a required field - StoreSizeBytes *int64 `locationName:"storeSizeBytes" type:"long" required:"true"` - - // The store's tags. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true"` - - // When the store was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 GetVariantStoreOutput) 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 GetVariantStoreOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetVariantStoreOutput) SetCreationTime(v time.Time) *GetVariantStoreOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetVariantStoreOutput) SetDescription(v string) *GetVariantStoreOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetVariantStoreOutput) SetId(v string) *GetVariantStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetVariantStoreOutput) SetName(v string) *GetVariantStoreOutput { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *GetVariantStoreOutput) SetReference(v *ReferenceItem) *GetVariantStoreOutput { - s.Reference = v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *GetVariantStoreOutput) SetSseConfig(v *SseConfig) *GetVariantStoreOutput { - s.SseConfig = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetVariantStoreOutput) SetStatus(v string) *GetVariantStoreOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetVariantStoreOutput) SetStatusMessage(v string) *GetVariantStoreOutput { - s.StatusMessage = &v - return s -} - -// SetStoreArn sets the StoreArn field's value. -func (s *GetVariantStoreOutput) SetStoreArn(v string) *GetVariantStoreOutput { - s.StoreArn = &v - return s -} - -// SetStoreSizeBytes sets the StoreSizeBytes field's value. -func (s *GetVariantStoreOutput) SetStoreSizeBytes(v int64) *GetVariantStoreOutput { - s.StoreSizeBytes = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetVariantStoreOutput) SetTags(v map[string]*string) *GetVariantStoreOutput { - s.Tags = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *GetVariantStoreOutput) SetUpdateTime(v time.Time) *GetVariantStoreOutput { - s.UpdateTime = &v - return s -} - -type GetWorkflowInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The export format for the workflow. - Export []*string `location:"querystring" locationName:"export" type:"list" enum:"WorkflowExport"` - - // The workflow's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The workflow's type. - Type *string `location:"querystring" locationName:"type" min:"1" type:"string" enum:"WorkflowType"` -} - -// 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 GetWorkflowInput) 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 GetWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWorkflowInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Type != nil && len(*s.Type) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Type", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExport sets the Export field's value. -func (s *GetWorkflowInput) SetExport(v []*string) *GetWorkflowInput { - s.Export = v - return s -} - -// SetId sets the Id field's value. -func (s *GetWorkflowInput) SetId(v string) *GetWorkflowInput { - s.Id = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetWorkflowInput) SetType(v string) *GetWorkflowInput { - s.Type = &v - return s -} - -type GetWorkflowOutput struct { - _ struct{} `type:"structure"` - - // The computational accelerator specified to run the workflow. - Accelerators *string `locationName:"accelerators" min:"1" type:"string" enum:"Accelerators"` - - // The workflow's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // When the workflow was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The workflow's definition. - Definition *string `locationName:"definition" min:"1" type:"string"` - - // The workflow's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The workflow's digest. - Digest *string `locationName:"digest" min:"1" type:"string"` - - // The workflow's engine. - Engine *string `locationName:"engine" min:"1" type:"string" enum:"WorkflowEngine"` - - // The workflow's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // The path of the main definition file for the workflow. - Main *string `locationName:"main" min:"1" type:"string"` - - // Gets metadata for workflow. - Metadata map[string]*string `locationName:"metadata" type:"map"` - - // The workflow's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The workflow's parameter template. - ParameterTemplate map[string]*WorkflowParameter `locationName:"parameterTemplate" min:"1" type:"map"` - - // The workflow's status. - Status *string `locationName:"status" min:"1" type:"string" enum:"WorkflowStatus"` - - // The workflow's status message. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The workflow's storage capacity in gigabytes. - StorageCapacity *int64 `locationName:"storageCapacity" type:"integer"` - - // The workflow's tags. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The workflow's type. - Type *string `locationName:"type" min:"1" type:"string" enum:"WorkflowType"` -} - -// 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 GetWorkflowOutput) 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 GetWorkflowOutput) GoString() string { - return s.String() -} - -// SetAccelerators sets the Accelerators field's value. -func (s *GetWorkflowOutput) SetAccelerators(v string) *GetWorkflowOutput { - s.Accelerators = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetWorkflowOutput) SetArn(v string) *GetWorkflowOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetWorkflowOutput) SetCreationTime(v time.Time) *GetWorkflowOutput { - s.CreationTime = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *GetWorkflowOutput) SetDefinition(v string) *GetWorkflowOutput { - s.Definition = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetWorkflowOutput) SetDescription(v string) *GetWorkflowOutput { - s.Description = &v - return s -} - -// SetDigest sets the Digest field's value. -func (s *GetWorkflowOutput) SetDigest(v string) *GetWorkflowOutput { - s.Digest = &v - return s -} - -// SetEngine sets the Engine field's value. -func (s *GetWorkflowOutput) SetEngine(v string) *GetWorkflowOutput { - s.Engine = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetWorkflowOutput) SetId(v string) *GetWorkflowOutput { - s.Id = &v - return s -} - -// SetMain sets the Main field's value. -func (s *GetWorkflowOutput) SetMain(v string) *GetWorkflowOutput { - s.Main = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetWorkflowOutput) SetMetadata(v map[string]*string) *GetWorkflowOutput { - s.Metadata = v - return s -} - -// SetName sets the Name field's value. -func (s *GetWorkflowOutput) SetName(v string) *GetWorkflowOutput { - s.Name = &v - return s -} - -// SetParameterTemplate sets the ParameterTemplate field's value. -func (s *GetWorkflowOutput) SetParameterTemplate(v map[string]*WorkflowParameter) *GetWorkflowOutput { - s.ParameterTemplate = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetWorkflowOutput) SetStatus(v string) *GetWorkflowOutput { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *GetWorkflowOutput) SetStatusMessage(v string) *GetWorkflowOutput { - s.StatusMessage = &v - return s -} - -// SetStorageCapacity sets the StorageCapacity field's value. -func (s *GetWorkflowOutput) SetStorageCapacity(v int64) *GetWorkflowOutput { - s.StorageCapacity = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetWorkflowOutput) SetTags(v map[string]*string) *GetWorkflowOutput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *GetWorkflowOutput) SetType(v string) *GetWorkflowOutput { - s.Type = &v - return s -} - -// A filter for import read set jobs. -type ImportReadSetFilter struct { - _ struct{} `type:"structure"` - - // The filter's start date. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's end date. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` - - // A status to filter on. - Status *string `locationName:"status" type:"string" enum:"ReadSetImportJobStatus"` -} - -// 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 ImportReadSetFilter) 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 ImportReadSetFilter) GoString() string { - return s.String() -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ImportReadSetFilter) SetCreatedAfter(v time.Time) *ImportReadSetFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ImportReadSetFilter) SetCreatedBefore(v time.Time) *ImportReadSetFilter { - s.CreatedBefore = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportReadSetFilter) SetStatus(v string) *ImportReadSetFilter { - s.Status = &v - return s -} - -// An import read set job. -type ImportReadSetJobItem struct { - _ struct{} `type:"structure"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetImportJobStatus"` -} - -// 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 ImportReadSetJobItem) 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 ImportReadSetJobItem) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *ImportReadSetJobItem) SetCompletionTime(v time.Time) *ImportReadSetJobItem { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ImportReadSetJobItem) SetCreationTime(v time.Time) *ImportReadSetJobItem { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *ImportReadSetJobItem) SetId(v string) *ImportReadSetJobItem { - s.Id = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *ImportReadSetJobItem) SetRoleArn(v string) *ImportReadSetJobItem { - s.RoleArn = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ImportReadSetJobItem) SetSequenceStoreId(v string) *ImportReadSetJobItem { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportReadSetJobItem) SetStatus(v string) *ImportReadSetJobItem { - s.Status = &v - return s -} - -// A source for an import read set job. -type ImportReadSetSourceItem struct { - _ struct{} `type:"structure"` - - // The source's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // Where the source originated. - GeneratedFrom *string `locationName:"generatedFrom" min:"1" type:"string"` - - // The source's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The source's genome reference ARN. - ReferenceArn *string `locationName:"referenceArn" min:"1" type:"string"` - - // The source's sample ID. - // - // SampleId is a required field - SampleId *string `locationName:"sampleId" min:"1" type:"string" required:"true"` - - // The source's file type. - // - // SourceFileType is a required field - SourceFileType *string `locationName:"sourceFileType" type:"string" required:"true" enum:"FileType"` - - // The source files' location in Amazon S3. - // - // SourceFiles is a required field - SourceFiles *SourceFiles `locationName:"sourceFiles" type:"structure" required:"true"` - - // The source's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetImportJobItemStatus"` - - // The source's status message. - StatusMessage *string `locationName:"statusMessage" min:"1" type:"string"` - - // The source's subject ID. - // - // SubjectId is a required field - SubjectId *string `locationName:"subjectId" min:"1" type:"string" required:"true"` - - // The source's tags. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ImportReadSetSourceItem) 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 ImportReadSetSourceItem) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportReadSetSourceItem) SetDescription(v string) *ImportReadSetSourceItem { - s.Description = &v - return s -} - -// SetGeneratedFrom sets the GeneratedFrom field's value. -func (s *ImportReadSetSourceItem) SetGeneratedFrom(v string) *ImportReadSetSourceItem { - s.GeneratedFrom = &v - return s -} - -// SetName sets the Name field's value. -func (s *ImportReadSetSourceItem) SetName(v string) *ImportReadSetSourceItem { - s.Name = &v - return s -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *ImportReadSetSourceItem) SetReferenceArn(v string) *ImportReadSetSourceItem { - s.ReferenceArn = &v - return s -} - -// SetSampleId sets the SampleId field's value. -func (s *ImportReadSetSourceItem) SetSampleId(v string) *ImportReadSetSourceItem { - s.SampleId = &v - return s -} - -// SetSourceFileType sets the SourceFileType field's value. -func (s *ImportReadSetSourceItem) SetSourceFileType(v string) *ImportReadSetSourceItem { - s.SourceFileType = &v - return s -} - -// SetSourceFiles sets the SourceFiles field's value. -func (s *ImportReadSetSourceItem) SetSourceFiles(v *SourceFiles) *ImportReadSetSourceItem { - s.SourceFiles = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportReadSetSourceItem) SetStatus(v string) *ImportReadSetSourceItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ImportReadSetSourceItem) SetStatusMessage(v string) *ImportReadSetSourceItem { - s.StatusMessage = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *ImportReadSetSourceItem) SetSubjectId(v string) *ImportReadSetSourceItem { - s.SubjectId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ImportReadSetSourceItem) SetTags(v map[string]*string) *ImportReadSetSourceItem { - s.Tags = v - return s -} - -// A filter for import references. -type ImportReferenceFilter struct { - _ struct{} `type:"structure"` - - // The filter's start date. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's end date. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` - - // A status to filter on. - Status *string `locationName:"status" type:"string" enum:"ReferenceImportJobStatus"` -} - -// 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 ImportReferenceFilter) 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 ImportReferenceFilter) GoString() string { - return s.String() -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ImportReferenceFilter) SetCreatedAfter(v time.Time) *ImportReferenceFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ImportReferenceFilter) SetCreatedBefore(v time.Time) *ImportReferenceFilter { - s.CreatedBefore = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportReferenceFilter) SetStatus(v string) *ImportReferenceFilter { - s.Status = &v - return s -} - -// An import reference job. -type ImportReferenceJobItem struct { - _ struct{} `type:"structure"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `locationName:"referenceStoreId" min:"10" type:"string" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReferenceImportJobStatus"` -} - -// 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 ImportReferenceJobItem) 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 ImportReferenceJobItem) GoString() string { - return s.String() -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *ImportReferenceJobItem) SetCompletionTime(v time.Time) *ImportReferenceJobItem { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ImportReferenceJobItem) SetCreationTime(v time.Time) *ImportReferenceJobItem { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *ImportReferenceJobItem) SetId(v string) *ImportReferenceJobItem { - s.Id = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *ImportReferenceJobItem) SetReferenceStoreId(v string) *ImportReferenceJobItem { - s.ReferenceStoreId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *ImportReferenceJobItem) SetRoleArn(v string) *ImportReferenceJobItem { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportReferenceJobItem) SetStatus(v string) *ImportReferenceJobItem { - s.Status = &v - return s -} - -// An genome reference source. -type ImportReferenceSourceItem struct { - _ struct{} `type:"structure"` - - // The source's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The source's name. - Name *string `locationName:"name" min:"3" type:"string"` - - // The source file's location in Amazon S3. - SourceFile *string `locationName:"sourceFile" type:"string"` - - // The source's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReferenceImportJobItemStatus"` - - // The source's status message. - StatusMessage *string `locationName:"statusMessage" min:"1" type:"string"` - - // The source's tags. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ImportReferenceSourceItem) 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 ImportReferenceSourceItem) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportReferenceSourceItem) SetDescription(v string) *ImportReferenceSourceItem { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *ImportReferenceSourceItem) SetName(v string) *ImportReferenceSourceItem { - s.Name = &v - return s -} - -// SetSourceFile sets the SourceFile field's value. -func (s *ImportReferenceSourceItem) SetSourceFile(v string) *ImportReferenceSourceItem { - s.SourceFile = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportReferenceSourceItem) SetStatus(v string) *ImportReferenceSourceItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ImportReferenceSourceItem) SetStatusMessage(v string) *ImportReferenceSourceItem { - s.StatusMessage = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ImportReferenceSourceItem) SetTags(v map[string]*string) *ImportReferenceSourceItem { - s.Tags = v - return s -} - -// An unexpected error occurred. Try the request again. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A filter for annotation import jobs. -type ListAnnotationImportJobsFilter struct { - _ struct{} `type:"structure"` - - // A status to filter on. - Status *string `locationName:"status" type:"string" enum:"JobStatus"` - - // A store name to filter on. - StoreName *string `locationName:"storeName" 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 ListAnnotationImportJobsFilter) 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 ListAnnotationImportJobsFilter) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *ListAnnotationImportJobsFilter) SetStatus(v string) *ListAnnotationImportJobsFilter { - s.Status = &v - return s -} - -// SetStoreName sets the StoreName field's value. -func (s *ListAnnotationImportJobsFilter) SetStoreName(v string) *ListAnnotationImportJobsFilter { - s.StoreName = &v - return s -} - -type ListAnnotationImportJobsInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ListAnnotationImportJobsFilter `locationName:"filter" type:"structure"` - - // IDs of annotation import jobs to retrieve. - Ids []*string `locationName:"ids" min:"1" type:"list"` - - // The maximum number of jobs to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specifies the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListAnnotationImportJobsInput) 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 ListAnnotationImportJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAnnotationImportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAnnotationImportJobsInput"} - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListAnnotationImportJobsInput) SetFilter(v *ListAnnotationImportJobsFilter) *ListAnnotationImportJobsInput { - s.Filter = v - return s -} - -// SetIds sets the Ids field's value. -func (s *ListAnnotationImportJobsInput) SetIds(v []*string) *ListAnnotationImportJobsInput { - s.Ids = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAnnotationImportJobsInput) SetMaxResults(v int64) *ListAnnotationImportJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAnnotationImportJobsInput) SetNextToken(v string) *ListAnnotationImportJobsInput { - s.NextToken = &v - return s -} - -type ListAnnotationImportJobsOutput struct { - _ struct{} `type:"structure"` - - // A list of jobs. - AnnotationImportJobs []*AnnotationImportJobItem `locationName:"annotationImportJobs" type:"list"` - - // Specifies the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `locationName:"nextToken" 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 ListAnnotationImportJobsOutput) 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 ListAnnotationImportJobsOutput) GoString() string { - return s.String() -} - -// SetAnnotationImportJobs sets the AnnotationImportJobs field's value. -func (s *ListAnnotationImportJobsOutput) SetAnnotationImportJobs(v []*AnnotationImportJobItem) *ListAnnotationImportJobsOutput { - s.AnnotationImportJobs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAnnotationImportJobsOutput) SetNextToken(v string) *ListAnnotationImportJobsOutput { - s.NextToken = &v - return s -} - -// Use filters to focus the returned annotation store versions on a specific -// parameter, such as the status of the annotation store. -type ListAnnotationStoreVersionsFilter struct { - _ struct{} `type:"structure"` - - // The status of an annotation store version. - Status *string `locationName:"status" type:"string" enum:"VersionStatus"` -} - -// 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 ListAnnotationStoreVersionsFilter) 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 ListAnnotationStoreVersionsFilter) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *ListAnnotationStoreVersionsFilter) SetStatus(v string) *ListAnnotationStoreVersionsFilter { - s.Status = &v - return s -} - -type ListAnnotationStoreVersionsInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list of annotation store versions. - Filter *ListAnnotationStoreVersionsFilter `locationName:"filter" type:"structure"` - - // The maximum number of annotation store versions to return in one page of - // results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The name of an annotation store. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` - - // Specifies the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListAnnotationStoreVersionsInput) 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 ListAnnotationStoreVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAnnotationStoreVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAnnotationStoreVersionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListAnnotationStoreVersionsInput) SetFilter(v *ListAnnotationStoreVersionsFilter) *ListAnnotationStoreVersionsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAnnotationStoreVersionsInput) SetMaxResults(v int64) *ListAnnotationStoreVersionsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListAnnotationStoreVersionsInput) SetName(v string) *ListAnnotationStoreVersionsInput { - s.Name = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAnnotationStoreVersionsInput) SetNextToken(v string) *ListAnnotationStoreVersionsInput { - s.NextToken = &v - return s -} - -type ListAnnotationStoreVersionsOutput struct { - _ struct{} `type:"structure"` - - // Lists all versions of an annotation store. - AnnotationStoreVersions []*AnnotationStoreVersionItem `locationName:"annotationStoreVersions" type:"list"` - - // Specifies the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `locationName:"nextToken" 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 ListAnnotationStoreVersionsOutput) 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 ListAnnotationStoreVersionsOutput) GoString() string { - return s.String() -} - -// SetAnnotationStoreVersions sets the AnnotationStoreVersions field's value. -func (s *ListAnnotationStoreVersionsOutput) SetAnnotationStoreVersions(v []*AnnotationStoreVersionItem) *ListAnnotationStoreVersionsOutput { - s.AnnotationStoreVersions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAnnotationStoreVersionsOutput) SetNextToken(v string) *ListAnnotationStoreVersionsOutput { - s.NextToken = &v - return s -} - -// A filter for annotation stores. -type ListAnnotationStoresFilter struct { - _ struct{} `type:"structure"` - - // A status to filter on. - Status *string `locationName:"status" type:"string" enum:"StoreStatus"` -} - -// 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 ListAnnotationStoresFilter) 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 ListAnnotationStoresFilter) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *ListAnnotationStoresFilter) SetStatus(v string) *ListAnnotationStoresFilter { - s.Status = &v - return s -} - -type ListAnnotationStoresInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ListAnnotationStoresFilter `locationName:"filter" type:"structure"` - - // IDs of stores to list. - Ids []*string `locationName:"ids" min:"1" type:"list"` - - // The maximum number of stores to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListAnnotationStoresInput) 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 ListAnnotationStoresInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAnnotationStoresInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAnnotationStoresInput"} - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListAnnotationStoresInput) SetFilter(v *ListAnnotationStoresFilter) *ListAnnotationStoresInput { - s.Filter = v - return s -} - -// SetIds sets the Ids field's value. -func (s *ListAnnotationStoresInput) SetIds(v []*string) *ListAnnotationStoresInput { - s.Ids = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAnnotationStoresInput) SetMaxResults(v int64) *ListAnnotationStoresInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAnnotationStoresInput) SetNextToken(v string) *ListAnnotationStoresInput { - s.NextToken = &v - return s -} - -type ListAnnotationStoresOutput struct { - _ struct{} `type:"structure"` - - // A list of stores. - AnnotationStores []*AnnotationStoreItem `locationName:"annotationStores" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" 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 ListAnnotationStoresOutput) 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 ListAnnotationStoresOutput) GoString() string { - return s.String() -} - -// SetAnnotationStores sets the AnnotationStores field's value. -func (s *ListAnnotationStoresOutput) SetAnnotationStores(v []*AnnotationStoreItem) *ListAnnotationStoresOutput { - s.AnnotationStores = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAnnotationStoresOutput) SetNextToken(v string) *ListAnnotationStoresOutput { - s.NextToken = &v - return s -} - -type ListMultipartReadSetUploadsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of multipart uploads returned in a page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Next token returned in the response of a previous ListMultipartReadSetUploads - // call. Used to get the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The Sequence Store ID used for the multipart uploads. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 ListMultipartReadSetUploadsInput) 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 ListMultipartReadSetUploadsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMultipartReadSetUploadsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMultipartReadSetUploadsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListMultipartReadSetUploadsInput) SetMaxResults(v int64) *ListMultipartReadSetUploadsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMultipartReadSetUploadsInput) SetNextToken(v string) *ListMultipartReadSetUploadsInput { - s.NextToken = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ListMultipartReadSetUploadsInput) SetSequenceStoreId(v string) *ListMultipartReadSetUploadsInput { - s.SequenceStoreId = &v - return s -} - -type ListMultipartReadSetUploadsOutput struct { - _ struct{} `type:"structure"` - - // Next token returned in the response of a previous ListMultipartReadSetUploads - // call. Used to get the next page of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // An array of multipart uploads. - Uploads []*MultipartReadSetUploadListItem `locationName:"uploads" type:"list"` -} - -// 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 ListMultipartReadSetUploadsOutput) 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 ListMultipartReadSetUploadsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMultipartReadSetUploadsOutput) SetNextToken(v string) *ListMultipartReadSetUploadsOutput { - s.NextToken = &v - return s -} - -// SetUploads sets the Uploads field's value. -func (s *ListMultipartReadSetUploadsOutput) SetUploads(v []*MultipartReadSetUploadListItem) *ListMultipartReadSetUploadsOutput { - s.Uploads = v - return s -} - -type ListReadSetActivationJobsInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ActivateReadSetFilter `locationName:"filter" type:"structure"` - - // The maximum number of read set activation jobs to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 ListReadSetActivationJobsInput) 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 ListReadSetActivationJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReadSetActivationJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReadSetActivationJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListReadSetActivationJobsInput) SetFilter(v *ActivateReadSetFilter) *ListReadSetActivationJobsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListReadSetActivationJobsInput) SetMaxResults(v int64) *ListReadSetActivationJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetActivationJobsInput) SetNextToken(v string) *ListReadSetActivationJobsInput { - s.NextToken = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ListReadSetActivationJobsInput) SetSequenceStoreId(v string) *ListReadSetActivationJobsInput { - s.SequenceStoreId = &v - return s -} - -type ListReadSetActivationJobsOutput struct { - _ struct{} `type:"structure"` - - // A list of jobs. - ActivationJobs []*ActivateReadSetJobItem `locationName:"activationJobs" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" 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 ListReadSetActivationJobsOutput) 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 ListReadSetActivationJobsOutput) GoString() string { - return s.String() -} - -// SetActivationJobs sets the ActivationJobs field's value. -func (s *ListReadSetActivationJobsOutput) SetActivationJobs(v []*ActivateReadSetJobItem) *ListReadSetActivationJobsOutput { - s.ActivationJobs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetActivationJobsOutput) SetNextToken(v string) *ListReadSetActivationJobsOutput { - s.NextToken = &v - return s -} - -type ListReadSetExportJobsInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ExportReadSetFilter `locationName:"filter" type:"structure"` - - // The maximum number of jobs to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The jobs' sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 ListReadSetExportJobsInput) 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 ListReadSetExportJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReadSetExportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReadSetExportJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListReadSetExportJobsInput) SetFilter(v *ExportReadSetFilter) *ListReadSetExportJobsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListReadSetExportJobsInput) SetMaxResults(v int64) *ListReadSetExportJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetExportJobsInput) SetNextToken(v string) *ListReadSetExportJobsInput { - s.NextToken = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ListReadSetExportJobsInput) SetSequenceStoreId(v string) *ListReadSetExportJobsInput { - s.SequenceStoreId = &v - return s -} - -type ListReadSetExportJobsOutput struct { - _ struct{} `type:"structure"` - - // A list of jobs. - ExportJobs []*ExportReadSetJobDetail `locationName:"exportJobs" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" 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 ListReadSetExportJobsOutput) 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 ListReadSetExportJobsOutput) GoString() string { - return s.String() -} - -// SetExportJobs sets the ExportJobs field's value. -func (s *ListReadSetExportJobsOutput) SetExportJobs(v []*ExportReadSetJobDetail) *ListReadSetExportJobsOutput { - s.ExportJobs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetExportJobsOutput) SetNextToken(v string) *ListReadSetExportJobsOutput { - s.NextToken = &v - return s -} - -type ListReadSetImportJobsInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ImportReadSetFilter `locationName:"filter" type:"structure"` - - // The maximum number of jobs to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The jobs' sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 ListReadSetImportJobsInput) 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 ListReadSetImportJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReadSetImportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReadSetImportJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListReadSetImportJobsInput) SetFilter(v *ImportReadSetFilter) *ListReadSetImportJobsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListReadSetImportJobsInput) SetMaxResults(v int64) *ListReadSetImportJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetImportJobsInput) SetNextToken(v string) *ListReadSetImportJobsInput { - s.NextToken = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ListReadSetImportJobsInput) SetSequenceStoreId(v string) *ListReadSetImportJobsInput { - s.SequenceStoreId = &v - return s -} - -type ListReadSetImportJobsOutput struct { - _ struct{} `type:"structure"` - - // A list of jobs. - ImportJobs []*ImportReadSetJobItem `locationName:"importJobs" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" 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 ListReadSetImportJobsOutput) 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 ListReadSetImportJobsOutput) GoString() string { - return s.String() -} - -// SetImportJobs sets the ImportJobs field's value. -func (s *ListReadSetImportJobsOutput) SetImportJobs(v []*ImportReadSetJobItem) *ListReadSetImportJobsOutput { - s.ImportJobs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetImportJobsOutput) SetNextToken(v string) *ListReadSetImportJobsOutput { - s.NextToken = &v - return s -} - -type ListReadSetUploadPartsInput struct { - _ struct{} `type:"structure"` - - // Attributes used to filter for a specific subset of read set part uploads. - Filter *ReadSetUploadPartListFilter `locationName:"filter" type:"structure"` - - // The maximum number of read set upload parts returned in a page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Next token returned in the response of a previous ListReadSetUploadPartsRequest - // call. Used to get the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The source file for the upload part. - // - // PartSource is a required field - PartSource *string `locationName:"partSource" type:"string" required:"true" enum:"ReadSetPartSource"` - - // The Sequence Store ID used for the multipart uploads. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The ID for the initiated multipart upload. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" min:"10" 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 ListReadSetUploadPartsInput) 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 ListReadSetUploadPartsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReadSetUploadPartsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReadSetUploadPartsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.PartSource == nil { - invalidParams.Add(request.NewErrParamRequired("PartSource")) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.UploadId != nil && len(*s.UploadId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListReadSetUploadPartsInput) SetFilter(v *ReadSetUploadPartListFilter) *ListReadSetUploadPartsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListReadSetUploadPartsInput) SetMaxResults(v int64) *ListReadSetUploadPartsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetUploadPartsInput) SetNextToken(v string) *ListReadSetUploadPartsInput { - s.NextToken = &v - return s -} - -// SetPartSource sets the PartSource field's value. -func (s *ListReadSetUploadPartsInput) SetPartSource(v string) *ListReadSetUploadPartsInput { - s.PartSource = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ListReadSetUploadPartsInput) SetSequenceStoreId(v string) *ListReadSetUploadPartsInput { - s.SequenceStoreId = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *ListReadSetUploadPartsInput) SetUploadId(v string) *ListReadSetUploadPartsInput { - s.UploadId = &v - return s -} - -type ListReadSetUploadPartsOutput struct { - _ struct{} `type:"structure"` - - // Next token returned in the response of a previous ListReadSetUploadParts - // call. Used to get the next page of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // An array of upload parts. - Parts []*ReadSetUploadPartListItem `locationName:"parts" type:"list"` -} - -// 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 ListReadSetUploadPartsOutput) 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 ListReadSetUploadPartsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetUploadPartsOutput) SetNextToken(v string) *ListReadSetUploadPartsOutput { - s.NextToken = &v - return s -} - -// SetParts sets the Parts field's value. -func (s *ListReadSetUploadPartsOutput) SetParts(v []*ReadSetUploadPartListItem) *ListReadSetUploadPartsOutput { - s.Parts = v - return s -} - -type ListReadSetsInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ReadSetFilter `locationName:"filter" type:"structure"` - - // The maximum number of read sets to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The jobs' sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" 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 ListReadSetsInput) 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 ListReadSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReadSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReadSetsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListReadSetsInput) SetFilter(v *ReadSetFilter) *ListReadSetsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListReadSetsInput) SetMaxResults(v int64) *ListReadSetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetsInput) SetNextToken(v string) *ListReadSetsInput { - s.NextToken = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ListReadSetsInput) SetSequenceStoreId(v string) *ListReadSetsInput { - s.SequenceStoreId = &v - return s -} - -type ListReadSetsOutput struct { - _ struct{} `type:"structure"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of read sets. - // - // ReadSets is a required field - ReadSets []*ReadSetListItem `locationName:"readSets" type:"list" 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 ListReadSetsOutput) 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 ListReadSetsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReadSetsOutput) SetNextToken(v string) *ListReadSetsOutput { - s.NextToken = &v - return s -} - -// SetReadSets sets the ReadSets field's value. -func (s *ListReadSetsOutput) SetReadSets(v []*ReadSetListItem) *ListReadSetsOutput { - s.ReadSets = v - return s -} - -type ListReferenceImportJobsInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ImportReferenceFilter `locationName:"filter" type:"structure"` - - // The maximum number of jobs to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The job's reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `location:"uri" locationName:"referenceStoreId" min:"10" 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 ListReferenceImportJobsInput) 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 ListReferenceImportJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReferenceImportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReferenceImportJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ReferenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("ReferenceStoreId")) - } - if s.ReferenceStoreId != nil && len(*s.ReferenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceStoreId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListReferenceImportJobsInput) SetFilter(v *ImportReferenceFilter) *ListReferenceImportJobsInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListReferenceImportJobsInput) SetMaxResults(v int64) *ListReferenceImportJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReferenceImportJobsInput) SetNextToken(v string) *ListReferenceImportJobsInput { - s.NextToken = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *ListReferenceImportJobsInput) SetReferenceStoreId(v string) *ListReferenceImportJobsInput { - s.ReferenceStoreId = &v - return s -} - -type ListReferenceImportJobsOutput struct { - _ struct{} `type:"structure"` - - // A lis of jobs. - ImportJobs []*ImportReferenceJobItem `locationName:"importJobs" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" 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 ListReferenceImportJobsOutput) 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 ListReferenceImportJobsOutput) GoString() string { - return s.String() -} - -// SetImportJobs sets the ImportJobs field's value. -func (s *ListReferenceImportJobsOutput) SetImportJobs(v []*ImportReferenceJobItem) *ListReferenceImportJobsOutput { - s.ImportJobs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReferenceImportJobsOutput) SetNextToken(v string) *ListReferenceImportJobsOutput { - s.NextToken = &v - return s -} - -type ListReferenceStoresInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ReferenceStoreFilter `locationName:"filter" type:"structure"` - - // The maximum number of stores to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListReferenceStoresInput) 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 ListReferenceStoresInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReferenceStoresInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReferenceStoresInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListReferenceStoresInput) SetFilter(v *ReferenceStoreFilter) *ListReferenceStoresInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListReferenceStoresInput) SetMaxResults(v int64) *ListReferenceStoresInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReferenceStoresInput) SetNextToken(v string) *ListReferenceStoresInput { - s.NextToken = &v - return s -} - -type ListReferenceStoresOutput struct { - _ struct{} `type:"structure"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of reference stores. - // - // ReferenceStores is a required field - ReferenceStores []*ReferenceStoreDetail `locationName:"referenceStores" type:"list" 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 ListReferenceStoresOutput) 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 ListReferenceStoresOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReferenceStoresOutput) SetNextToken(v string) *ListReferenceStoresOutput { - s.NextToken = &v - return s -} - -// SetReferenceStores sets the ReferenceStores field's value. -func (s *ListReferenceStoresOutput) SetReferenceStores(v []*ReferenceStoreDetail) *ListReferenceStoresOutput { - s.ReferenceStores = v - return s -} - -type ListReferencesInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ReferenceFilter `locationName:"filter" type:"structure"` - - // The maximum number of references to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The references' reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `location:"uri" locationName:"referenceStoreId" min:"10" 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 ListReferencesInput) 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 ListReferencesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReferencesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReferencesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ReferenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("ReferenceStoreId")) - } - if s.ReferenceStoreId != nil && len(*s.ReferenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceStoreId", 10)) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListReferencesInput) SetFilter(v *ReferenceFilter) *ListReferencesInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListReferencesInput) SetMaxResults(v int64) *ListReferencesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReferencesInput) SetNextToken(v string) *ListReferencesInput { - s.NextToken = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *ListReferencesInput) SetReferenceStoreId(v string) *ListReferencesInput { - s.ReferenceStoreId = &v - return s -} - -type ListReferencesOutput struct { - _ struct{} `type:"structure"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of references. - // - // References is a required field - References []*ReferenceListItem `locationName:"references" type:"list" 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 ListReferencesOutput) 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 ListReferencesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListReferencesOutput) SetNextToken(v string) *ListReferencesOutput { - s.NextToken = &v - return s -} - -// SetReferences sets the References field's value. -func (s *ListReferencesOutput) SetReferences(v []*ReferenceListItem) *ListReferencesOutput { - s.References = v - return s -} - -type ListRunGroupsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of run groups to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The run groups' name. - Name *string `location:"querystring" locationName:"name" min:"1" type:"string"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - StartingToken *string `location:"querystring" locationName:"startingToken" min:"1" 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 ListRunGroupsInput) 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 ListRunGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRunGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRunGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.StartingToken != nil && len(*s.StartingToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StartingToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRunGroupsInput) SetMaxResults(v int64) *ListRunGroupsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListRunGroupsInput) SetName(v string) *ListRunGroupsInput { - s.Name = &v - return s -} - -// SetStartingToken sets the StartingToken field's value. -func (s *ListRunGroupsInput) SetStartingToken(v string) *ListRunGroupsInput { - s.StartingToken = &v - return s -} - -type ListRunGroupsOutput struct { - _ struct{} `type:"structure"` - - // A list of groups. - Items []*RunGroupListItem `locationName:"items" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" 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 ListRunGroupsOutput) 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 ListRunGroupsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListRunGroupsOutput) SetItems(v []*RunGroupListItem) *ListRunGroupsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRunGroupsOutput) SetNextToken(v string) *ListRunGroupsOutput { - s.NextToken = &v - return s -} - -type ListRunTasksInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The run's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The maximum number of run tasks to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - StartingToken *string `location:"querystring" locationName:"startingToken" min:"1" type:"string"` - - // Filter the list by status. - Status *string `location:"querystring" locationName:"status" min:"1" type:"string" enum:"TaskStatus"` -} - -// 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 ListRunTasksInput) 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 ListRunTasksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRunTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRunTasksInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.StartingToken != nil && len(*s.StartingToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StartingToken", 1)) - } - if s.Status != nil && len(*s.Status) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Status", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *ListRunTasksInput) SetId(v string) *ListRunTasksInput { - s.Id = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRunTasksInput) SetMaxResults(v int64) *ListRunTasksInput { - s.MaxResults = &v - return s -} - -// SetStartingToken sets the StartingToken field's value. -func (s *ListRunTasksInput) SetStartingToken(v string) *ListRunTasksInput { - s.StartingToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListRunTasksInput) SetStatus(v string) *ListRunTasksInput { - s.Status = &v - return s -} - -type ListRunTasksOutput struct { - _ struct{} `type:"structure"` - - // A list of tasks. - Items []*TaskListItem `locationName:"items" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" 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 ListRunTasksOutput) 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 ListRunTasksOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListRunTasksOutput) SetItems(v []*TaskListItem) *ListRunTasksOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRunTasksOutput) SetNextToken(v string) *ListRunTasksOutput { - s.NextToken = &v - return s -} - -type ListRunsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of runs to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Filter the list by run name. - Name *string `location:"querystring" locationName:"name" min:"1" type:"string"` - - // Filter the list by run group ID. - RunGroupId *string `location:"querystring" locationName:"runGroupId" min:"1" type:"string"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - StartingToken *string `location:"querystring" locationName:"startingToken" min:"1" type:"string"` - - // The status of a run. - Status *string `location:"querystring" locationName:"status" min:"1" type:"string" enum:"RunStatus"` -} - -// 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 ListRunsInput) 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 ListRunsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRunsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRunsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RunGroupId != nil && len(*s.RunGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RunGroupId", 1)) - } - if s.StartingToken != nil && len(*s.StartingToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StartingToken", 1)) - } - if s.Status != nil && len(*s.Status) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Status", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRunsInput) SetMaxResults(v int64) *ListRunsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListRunsInput) SetName(v string) *ListRunsInput { - s.Name = &v - return s -} - -// SetRunGroupId sets the RunGroupId field's value. -func (s *ListRunsInput) SetRunGroupId(v string) *ListRunsInput { - s.RunGroupId = &v - return s -} - -// SetStartingToken sets the StartingToken field's value. -func (s *ListRunsInput) SetStartingToken(v string) *ListRunsInput { - s.StartingToken = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListRunsInput) SetStatus(v string) *ListRunsInput { - s.Status = &v - return s -} - -type ListRunsOutput struct { - _ struct{} `type:"structure"` - - // A list of runs. - Items []*RunListItem `locationName:"items" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" 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 ListRunsOutput) 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 ListRunsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListRunsOutput) SetItems(v []*RunListItem) *ListRunsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRunsOutput) SetNextToken(v string) *ListRunsOutput { - s.NextToken = &v - return s -} - -type ListSequenceStoresInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *SequenceStoreFilter `locationName:"filter" type:"structure"` - - // The maximum number of stores to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListSequenceStoresInput) 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 ListSequenceStoresInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSequenceStoresInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSequenceStoresInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListSequenceStoresInput) SetFilter(v *SequenceStoreFilter) *ListSequenceStoresInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSequenceStoresInput) SetMaxResults(v int64) *ListSequenceStoresInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSequenceStoresInput) SetNextToken(v string) *ListSequenceStoresInput { - s.NextToken = &v - return s -} - -type ListSequenceStoresOutput struct { - _ struct{} `type:"structure"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // A list of sequence stores. - // - // SequenceStores is a required field - SequenceStores []*SequenceStoreDetail `locationName:"sequenceStores" type:"list" 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 ListSequenceStoresOutput) 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 ListSequenceStoresOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSequenceStoresOutput) SetNextToken(v string) *ListSequenceStoresOutput { - s.NextToken = &v - return s -} - -// SetSequenceStores sets the SequenceStores field's value. -func (s *ListSequenceStoresOutput) SetSequenceStores(v []*SequenceStoreDetail) *ListSequenceStoresOutput { - s.SequenceStores = v - return s -} - -type ListSharesInput struct { - _ struct{} `type:"structure"` - - // Attributes used to filter for a specific subset of shares. - Filter *Filter `locationName:"filter" type:"structure"` - - // The maximum number of shares to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` - - // Next token returned in the response of a previous ListReadSetUploadPartsRequest - // call. Used to get the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The account that owns the analytics store shared. - // - // ResourceOwner is a required field - ResourceOwner *string `locationName:"resourceOwner" type:"string" required:"true" enum:"ResourceOwner"` -} - -// 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 ListSharesInput) 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 ListSharesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSharesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSharesInput"} - if s.ResourceOwner == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceOwner")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListSharesInput) SetFilter(v *Filter) *ListSharesInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSharesInput) SetMaxResults(v int64) *ListSharesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSharesInput) SetNextToken(v string) *ListSharesInput { - s.NextToken = &v - return s -} - -// SetResourceOwner sets the ResourceOwner field's value. -func (s *ListSharesInput) SetResourceOwner(v string) *ListSharesInput { - s.ResourceOwner = &v - return s -} - -type ListSharesOutput struct { - _ struct{} `type:"structure"` - - // Next token returned in the response of a previous ListSharesResponse call. - // Used to get the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // The shares available and their meta details. - // - // Shares is a required field - Shares []*ShareDetails `locationName:"shares" type:"list" 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 ListSharesOutput) 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 ListSharesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSharesOutput) SetNextToken(v string) *ListSharesOutput { - s.NextToken = &v - return s -} - -// SetShares sets the Shares field's value. -func (s *ListSharesOutput) SetShares(v []*ShareDetails) *ListSharesOutput { - s.Shares = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The resource's ARN. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of tags. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// A filter for variant import jobs. -type ListVariantImportJobsFilter struct { - _ struct{} `type:"structure"` - - // A status to filter on. - Status *string `locationName:"status" type:"string" enum:"JobStatus"` - - // A store name to filter on. - StoreName *string `locationName:"storeName" 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 ListVariantImportJobsFilter) 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 ListVariantImportJobsFilter) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *ListVariantImportJobsFilter) SetStatus(v string) *ListVariantImportJobsFilter { - s.Status = &v - return s -} - -// SetStoreName sets the StoreName field's value. -func (s *ListVariantImportJobsFilter) SetStoreName(v string) *ListVariantImportJobsFilter { - s.StoreName = &v - return s -} - -type ListVariantImportJobsInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ListVariantImportJobsFilter `locationName:"filter" type:"structure"` - - // A list of job IDs. - Ids []*string `locationName:"ids" min:"1" type:"list"` - - // The maximum number of import jobs to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListVariantImportJobsInput) 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 ListVariantImportJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVariantImportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVariantImportJobsInput"} - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListVariantImportJobsInput) SetFilter(v *ListVariantImportJobsFilter) *ListVariantImportJobsInput { - s.Filter = v - return s -} - -// SetIds sets the Ids field's value. -func (s *ListVariantImportJobsInput) SetIds(v []*string) *ListVariantImportJobsInput { - s.Ids = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVariantImportJobsInput) SetMaxResults(v int64) *ListVariantImportJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVariantImportJobsInput) SetNextToken(v string) *ListVariantImportJobsInput { - s.NextToken = &v - return s -} - -type ListVariantImportJobsOutput struct { - _ struct{} `type:"structure"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of jobs. - VariantImportJobs []*VariantImportJobItem `locationName:"variantImportJobs" type:"list"` -} - -// 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 ListVariantImportJobsOutput) 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 ListVariantImportJobsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVariantImportJobsOutput) SetNextToken(v string) *ListVariantImportJobsOutput { - s.NextToken = &v - return s -} - -// SetVariantImportJobs sets the VariantImportJobs field's value. -func (s *ListVariantImportJobsOutput) SetVariantImportJobs(v []*VariantImportJobItem) *ListVariantImportJobsOutput { - s.VariantImportJobs = v - return s -} - -// A filter for variant stores. -type ListVariantStoresFilter struct { - _ struct{} `type:"structure"` - - // A status to filter on. - Status *string `locationName:"status" type:"string" enum:"StoreStatus"` -} - -// 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 ListVariantStoresFilter) 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 ListVariantStoresFilter) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *ListVariantStoresFilter) SetStatus(v string) *ListVariantStoresFilter { - s.Status = &v - return s -} - -type ListVariantStoresInput struct { - _ struct{} `type:"structure"` - - // A filter to apply to the list. - Filter *ListVariantStoresFilter `locationName:"filter" type:"structure"` - - // A list of store IDs. - Ids []*string `locationName:"ids" min:"1" type:"list"` - - // The maximum number of stores to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListVariantStoresInput) 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 ListVariantStoresInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVariantStoresInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVariantStoresInput"} - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListVariantStoresInput) SetFilter(v *ListVariantStoresFilter) *ListVariantStoresInput { - s.Filter = v - return s -} - -// SetIds sets the Ids field's value. -func (s *ListVariantStoresInput) SetIds(v []*string) *ListVariantStoresInput { - s.Ids = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVariantStoresInput) SetMaxResults(v int64) *ListVariantStoresInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVariantStoresInput) SetNextToken(v string) *ListVariantStoresInput { - s.NextToken = &v - return s -} - -type ListVariantStoresOutput struct { - _ struct{} `type:"structure"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of variant stores. - VariantStores []*VariantStoreItem `locationName:"variantStores" type:"list"` -} - -// 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 ListVariantStoresOutput) 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 ListVariantStoresOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVariantStoresOutput) SetNextToken(v string) *ListVariantStoresOutput { - s.NextToken = &v - return s -} - -// SetVariantStores sets the VariantStores field's value. -func (s *ListVariantStoresOutput) SetVariantStores(v []*VariantStoreItem) *ListVariantStoresOutput { - s.VariantStores = v - return s -} - -type ListWorkflowsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of workflows to return in one page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The workflows' name. - Name *string `location:"querystring" locationName:"name" min:"1" type:"string"` - - // Specify the pagination token from a previous request to retrieve the next - // page of results. - StartingToken *string `location:"querystring" locationName:"startingToken" min:"1" type:"string"` - - // The workflows' type. - Type *string `location:"querystring" locationName:"type" min:"1" type:"string" enum:"WorkflowType"` -} - -// 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 ListWorkflowsInput) 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 ListWorkflowsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkflowsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkflowsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.StartingToken != nil && len(*s.StartingToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StartingToken", 1)) - } - if s.Type != nil && len(*s.Type) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Type", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkflowsInput) SetMaxResults(v int64) *ListWorkflowsInput { - s.MaxResults = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListWorkflowsInput) SetName(v string) *ListWorkflowsInput { - s.Name = &v - return s -} - -// SetStartingToken sets the StartingToken field's value. -func (s *ListWorkflowsInput) SetStartingToken(v string) *ListWorkflowsInput { - s.StartingToken = &v - return s -} - -// SetType sets the Type field's value. -func (s *ListWorkflowsInput) SetType(v string) *ListWorkflowsInput { - s.Type = &v - return s -} - -type ListWorkflowsOutput struct { - _ struct{} `type:"structure"` - - // The workflows' items. - Items []*WorkflowListItem `locationName:"items" type:"list"` - - // A pagination token that's included if more results are available. - NextToken *string `locationName:"nextToken" min:"1" 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 ListWorkflowsOutput) 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 ListWorkflowsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListWorkflowsOutput) SetItems(v []*WorkflowListItem) *ListWorkflowsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkflowsOutput) SetNextToken(v string) *ListWorkflowsOutput { - s.NextToken = &v - return s -} - -// Part of the response to ListMultipartReadSetUploads, excluding completed -// and aborted multipart uploads. -type MultipartReadSetUploadListItem struct { - _ struct{} `type:"structure"` - - // The time stamp for when a direct upload was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The description of a read set. - Description *string `locationName:"description" min:"1" type:"string"` - - // The source of an uploaded part. - // - // GeneratedFrom is a required field - GeneratedFrom *string `locationName:"generatedFrom" min:"1" type:"string" required:"true"` - - // The name of a read set. - Name *string `locationName:"name" min:"1" type:"string"` - - // The source's reference ARN. - // - // ReferenceArn is a required field - ReferenceArn *string `locationName:"referenceArn" min:"1" type:"string" required:"true"` - - // The read set source's sample ID. - // - // SampleId is a required field - SampleId *string `locationName:"sampleId" min:"1" type:"string" required:"true"` - - // The sequence store ID used for the multipart upload. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The type of file the read set originated from. - // - // SourceFileType is a required field - SourceFileType *string `locationName:"sourceFileType" type:"string" required:"true" enum:"FileType"` - - // The read set source's subject ID. - // - // SubjectId is a required field - SubjectId *string `locationName:"subjectId" min:"1" type:"string" required:"true"` - - // Any tags you wish to add to a read set. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The ID for the initiated multipart upload. - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" min:"10" 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 MultipartReadSetUploadListItem) 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 MultipartReadSetUploadListItem) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *MultipartReadSetUploadListItem) SetCreationTime(v time.Time) *MultipartReadSetUploadListItem { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *MultipartReadSetUploadListItem) SetDescription(v string) *MultipartReadSetUploadListItem { - s.Description = &v - return s -} - -// SetGeneratedFrom sets the GeneratedFrom field's value. -func (s *MultipartReadSetUploadListItem) SetGeneratedFrom(v string) *MultipartReadSetUploadListItem { - s.GeneratedFrom = &v - return s -} - -// SetName sets the Name field's value. -func (s *MultipartReadSetUploadListItem) SetName(v string) *MultipartReadSetUploadListItem { - s.Name = &v - return s -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *MultipartReadSetUploadListItem) SetReferenceArn(v string) *MultipartReadSetUploadListItem { - s.ReferenceArn = &v - return s -} - -// SetSampleId sets the SampleId field's value. -func (s *MultipartReadSetUploadListItem) SetSampleId(v string) *MultipartReadSetUploadListItem { - s.SampleId = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *MultipartReadSetUploadListItem) SetSequenceStoreId(v string) *MultipartReadSetUploadListItem { - s.SequenceStoreId = &v - return s -} - -// SetSourceFileType sets the SourceFileType field's value. -func (s *MultipartReadSetUploadListItem) SetSourceFileType(v string) *MultipartReadSetUploadListItem { - s.SourceFileType = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *MultipartReadSetUploadListItem) SetSubjectId(v string) *MultipartReadSetUploadListItem { - s.SubjectId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *MultipartReadSetUploadListItem) SetTags(v map[string]*string) *MultipartReadSetUploadListItem { - s.Tags = v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *MultipartReadSetUploadListItem) SetUploadId(v string) *MultipartReadSetUploadListItem { - s.UploadId = &v - return s -} - -// The operation is not supported by Amazon Omics, or the API does not exist. -type NotSupportedOperationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 NotSupportedOperationException) 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 NotSupportedOperationException) GoString() string { - return s.String() -} - -func newErrorNotSupportedOperationException(v protocol.ResponseMetadata) error { - return &NotSupportedOperationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *NotSupportedOperationException) Code() string { - return "NotSupportedOperationException" -} - -// Message returns the exception's message. -func (s *NotSupportedOperationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *NotSupportedOperationException) OrigErr() error { - return nil -} - -func (s *NotSupportedOperationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *NotSupportedOperationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *NotSupportedOperationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The ranges specified in the request are not valid. -type RangeNotSatisfiableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 RangeNotSatisfiableException) 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 RangeNotSatisfiableException) GoString() string { - return s.String() -} - -func newErrorRangeNotSatisfiableException(v protocol.ResponseMetadata) error { - return &RangeNotSatisfiableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *RangeNotSatisfiableException) Code() string { - return "RangeNotSatisfiableException" -} - -// Message returns the exception's message. -func (s *RangeNotSatisfiableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *RangeNotSatisfiableException) OrigErr() error { - return nil -} - -func (s *RangeNotSatisfiableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *RangeNotSatisfiableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *RangeNotSatisfiableException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Read options for an annotation import job. -type ReadOptions struct { - _ struct{} `type:"structure"` - - // The file's comment character. - Comment *string `locationName:"comment" min:"1" type:"string"` - - // The file's encoding. - Encoding *string `locationName:"encoding" min:"1" type:"string"` - - // A character for escaping quotes in the file. - Escape *string `locationName:"escape" min:"1" type:"string"` - - // Whether quotes need to be escaped in the file. - EscapeQuotes *bool `locationName:"escapeQuotes" type:"boolean"` - - // Whether the file has a header row. - Header *bool `locationName:"header" type:"boolean"` - - // A line separator for the file. - LineSep *string `locationName:"lineSep" min:"1" type:"string"` - - // The file's quote character. - Quote *string `locationName:"quote" min:"1" type:"string"` - - // Whether all values need to be quoted, or just those that contain quotes. - QuoteAll *bool `locationName:"quoteAll" type:"boolean"` - - // The file's field separator. - Sep *string `locationName:"sep" min:"1" 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 ReadOptions) 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 ReadOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReadOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReadOptions"} - if s.Comment != nil && len(*s.Comment) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Comment", 1)) - } - if s.Encoding != nil && len(*s.Encoding) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Encoding", 1)) - } - if s.Escape != nil && len(*s.Escape) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Escape", 1)) - } - if s.LineSep != nil && len(*s.LineSep) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LineSep", 1)) - } - if s.Quote != nil && len(*s.Quote) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Quote", 1)) - } - if s.Sep != nil && len(*s.Sep) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Sep", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *ReadOptions) SetComment(v string) *ReadOptions { - s.Comment = &v - return s -} - -// SetEncoding sets the Encoding field's value. -func (s *ReadOptions) SetEncoding(v string) *ReadOptions { - s.Encoding = &v - return s -} - -// SetEscape sets the Escape field's value. -func (s *ReadOptions) SetEscape(v string) *ReadOptions { - s.Escape = &v - return s -} - -// SetEscapeQuotes sets the EscapeQuotes field's value. -func (s *ReadOptions) SetEscapeQuotes(v bool) *ReadOptions { - s.EscapeQuotes = &v - return s -} - -// SetHeader sets the Header field's value. -func (s *ReadOptions) SetHeader(v bool) *ReadOptions { - s.Header = &v - return s -} - -// SetLineSep sets the LineSep field's value. -func (s *ReadOptions) SetLineSep(v string) *ReadOptions { - s.LineSep = &v - return s -} - -// SetQuote sets the Quote field's value. -func (s *ReadOptions) SetQuote(v string) *ReadOptions { - s.Quote = &v - return s -} - -// SetQuoteAll sets the QuoteAll field's value. -func (s *ReadOptions) SetQuoteAll(v bool) *ReadOptions { - s.QuoteAll = &v - return s -} - -// SetSep sets the Sep field's value. -func (s *ReadOptions) SetSep(v string) *ReadOptions { - s.Sep = &v - return s -} - -// An error from a batch read set operation. -type ReadSetBatchError struct { - _ struct{} `type:"structure"` - - // The error's code. - // - // Code is a required field - Code *string `locationName:"code" type:"string" required:"true"` - - // The error's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The error's message. - // - // Message is a required field - Message *string `locationName:"message" 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 ReadSetBatchError) 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 ReadSetBatchError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ReadSetBatchError) SetCode(v string) *ReadSetBatchError { - s.Code = &v - return s -} - -// SetId sets the Id field's value. -func (s *ReadSetBatchError) SetId(v string) *ReadSetBatchError { - s.Id = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ReadSetBatchError) SetMessage(v string) *ReadSetBatchError { - s.Message = &v - return s -} - -// Files in a read set. -type ReadSetFiles struct { - _ struct{} `type:"structure"` - - // The files' index. - Index *FileInformation `locationName:"index" type:"structure"` - - // The location of the first file in Amazon S3. - Source1 *FileInformation `locationName:"source1" type:"structure"` - - // The location of the second file in Amazon S3. - Source2 *FileInformation `locationName:"source2" 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 ReadSetFiles) 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 ReadSetFiles) GoString() string { - return s.String() -} - -// SetIndex sets the Index field's value. -func (s *ReadSetFiles) SetIndex(v *FileInformation) *ReadSetFiles { - s.Index = v - return s -} - -// SetSource1 sets the Source1 field's value. -func (s *ReadSetFiles) SetSource1(v *FileInformation) *ReadSetFiles { - s.Source1 = v - return s -} - -// SetSource2 sets the Source2 field's value. -func (s *ReadSetFiles) SetSource2(v *FileInformation) *ReadSetFiles { - s.Source2 = v - return s -} - -// A filter for read sets. -type ReadSetFilter struct { - _ struct{} `type:"structure"` - - // The filter's start date. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's end date. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` - - // The creation type of the read set. - CreationType *string `locationName:"creationType" type:"string" enum:"CreationType"` - - // Where the source originated. - GeneratedFrom *string `locationName:"generatedFrom" min:"1" type:"string"` - - // A name to filter on. - Name *string `locationName:"name" min:"1" type:"string"` - - // A genome reference ARN to filter on. - ReferenceArn *string `locationName:"referenceArn" type:"string"` - - // The read set source's sample ID. - SampleId *string `locationName:"sampleId" min:"1" type:"string"` - - // A status to filter on. - Status *string `locationName:"status" type:"string" enum:"ReadSetStatus"` - - // The read set source's subject ID. - SubjectId *string `locationName:"subjectId" min:"1" 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 ReadSetFilter) 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 ReadSetFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReadSetFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReadSetFilter"} - if s.GeneratedFrom != nil && len(*s.GeneratedFrom) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GeneratedFrom", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SampleId != nil && len(*s.SampleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SampleId", 1)) - } - if s.SubjectId != nil && len(*s.SubjectId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubjectId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ReadSetFilter) SetCreatedAfter(v time.Time) *ReadSetFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ReadSetFilter) SetCreatedBefore(v time.Time) *ReadSetFilter { - s.CreatedBefore = &v - return s -} - -// SetCreationType sets the CreationType field's value. -func (s *ReadSetFilter) SetCreationType(v string) *ReadSetFilter { - s.CreationType = &v - return s -} - -// SetGeneratedFrom sets the GeneratedFrom field's value. -func (s *ReadSetFilter) SetGeneratedFrom(v string) *ReadSetFilter { - s.GeneratedFrom = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReadSetFilter) SetName(v string) *ReadSetFilter { - s.Name = &v - return s -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *ReadSetFilter) SetReferenceArn(v string) *ReadSetFilter { - s.ReferenceArn = &v - return s -} - -// SetSampleId sets the SampleId field's value. -func (s *ReadSetFilter) SetSampleId(v string) *ReadSetFilter { - s.SampleId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReadSetFilter) SetStatus(v string) *ReadSetFilter { - s.Status = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *ReadSetFilter) SetSubjectId(v string) *ReadSetFilter { - s.SubjectId = &v - return s -} - -// A read set. -type ReadSetListItem struct { - _ struct{} `type:"structure"` - - // The read set's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the read set was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The creation type of the read set. - CreationType *string `locationName:"creationType" type:"string" enum:"CreationType"` - - // The read set's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The entity tag (ETag) is a hash of the object representing its semantic content. - Etag *ETag `locationName:"etag" type:"structure"` - - // The read set's file type. - // - // FileType is a required field - FileType *string `locationName:"fileType" type:"string" required:"true" enum:"FileType"` - - // The read set's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The read set's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The read set's genome reference ARN. - ReferenceArn *string `locationName:"referenceArn" min:"1" type:"string"` - - // The read set's sample ID. - SampleId *string `locationName:"sampleId" min:"1" type:"string"` - - // Details about a sequence. - SequenceInformation *SequenceInformation `locationName:"sequenceInformation" type:"structure"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The read set's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetStatus"` - - // The status for a read set. It provides more detail as to why the read set - // has a status. - StatusMessage *string `locationName:"statusMessage" min:"1" type:"string"` - - // The read set's subject ID. - SubjectId *string `locationName:"subjectId" min:"1" 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 ReadSetListItem) 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 ReadSetListItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ReadSetListItem) SetArn(v string) *ReadSetListItem { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ReadSetListItem) SetCreationTime(v time.Time) *ReadSetListItem { - s.CreationTime = &v - return s -} - -// SetCreationType sets the CreationType field's value. -func (s *ReadSetListItem) SetCreationType(v string) *ReadSetListItem { - s.CreationType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ReadSetListItem) SetDescription(v string) *ReadSetListItem { - s.Description = &v - return s -} - -// SetEtag sets the Etag field's value. -func (s *ReadSetListItem) SetEtag(v *ETag) *ReadSetListItem { - s.Etag = v - return s -} - -// SetFileType sets the FileType field's value. -func (s *ReadSetListItem) SetFileType(v string) *ReadSetListItem { - s.FileType = &v - return s -} - -// SetId sets the Id field's value. -func (s *ReadSetListItem) SetId(v string) *ReadSetListItem { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReadSetListItem) SetName(v string) *ReadSetListItem { - s.Name = &v - return s -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *ReadSetListItem) SetReferenceArn(v string) *ReadSetListItem { - s.ReferenceArn = &v - return s -} - -// SetSampleId sets the SampleId field's value. -func (s *ReadSetListItem) SetSampleId(v string) *ReadSetListItem { - s.SampleId = &v - return s -} - -// SetSequenceInformation sets the SequenceInformation field's value. -func (s *ReadSetListItem) SetSequenceInformation(v *SequenceInformation) *ReadSetListItem { - s.SequenceInformation = v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *ReadSetListItem) SetSequenceStoreId(v string) *ReadSetListItem { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReadSetListItem) SetStatus(v string) *ReadSetListItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ReadSetListItem) SetStatusMessage(v string) *ReadSetListItem { - s.StatusMessage = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *ReadSetListItem) SetSubjectId(v string) *ReadSetListItem { - s.SubjectId = &v - return s -} - -// Filter settings that select for read set upload parts of interest. -type ReadSetUploadPartListFilter struct { - _ struct{} `type:"structure"` - - // Filters for read set uploads after a specified time. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // Filters for read set part uploads before a specified time. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 ReadSetUploadPartListFilter) 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 ReadSetUploadPartListFilter) GoString() string { - return s.String() -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ReadSetUploadPartListFilter) SetCreatedAfter(v time.Time) *ReadSetUploadPartListFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ReadSetUploadPartListFilter) SetCreatedBefore(v time.Time) *ReadSetUploadPartListFilter { - s.CreatedBefore = &v - return s -} - -// The metadata of a single part of a file that was added to a multipart upload. -// A list of these parts is returned in the response to the ListReadSetUploadParts -// API. -type ReadSetUploadPartListItem struct { - _ struct{} `type:"structure"` - - // A unique identifier used to confirm that parts are being added to the correct - // upload. - // - // Checksum is a required field - Checksum *string `locationName:"checksum" type:"string" required:"true"` - - // The time stamp for when a direct upload was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The time stamp for the most recent update to an uploaded part. - LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp" timestampFormat:"iso8601"` - - // The number identifying the part in an upload. - // - // PartNumber is a required field - PartNumber *int64 `locationName:"partNumber" min:"1" type:"integer" required:"true"` - - // The size of the the part in an upload. - // - // PartSize is a required field - PartSize *int64 `locationName:"partSize" min:"1" type:"long" required:"true"` - - // The origin of the part being direct uploaded. - // - // PartSource is a required field - PartSource *string `locationName:"partSource" type:"string" required:"true" enum:"ReadSetPartSource"` -} - -// 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 ReadSetUploadPartListItem) 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 ReadSetUploadPartListItem) GoString() string { - return s.String() -} - -// SetChecksum sets the Checksum field's value. -func (s *ReadSetUploadPartListItem) SetChecksum(v string) *ReadSetUploadPartListItem { - s.Checksum = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ReadSetUploadPartListItem) SetCreationTime(v time.Time) *ReadSetUploadPartListItem { - s.CreationTime = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *ReadSetUploadPartListItem) SetLastUpdatedTime(v time.Time) *ReadSetUploadPartListItem { - s.LastUpdatedTime = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *ReadSetUploadPartListItem) SetPartNumber(v int64) *ReadSetUploadPartListItem { - s.PartNumber = &v - return s -} - -// SetPartSize sets the PartSize field's value. -func (s *ReadSetUploadPartListItem) SetPartSize(v int64) *ReadSetUploadPartListItem { - s.PartSize = &v - return s -} - -// SetPartSource sets the PartSource field's value. -func (s *ReadSetUploadPartListItem) SetPartSource(v string) *ReadSetUploadPartListItem { - s.PartSource = &v - return s -} - -// A set of genome reference files. -type ReferenceFiles struct { - _ struct{} `type:"structure"` - - // The files' index. - Index *FileInformation `locationName:"index" type:"structure"` - - // The source file's location in Amazon S3. - Source *FileInformation `locationName:"source" 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 ReferenceFiles) 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 ReferenceFiles) GoString() string { - return s.String() -} - -// SetIndex sets the Index field's value. -func (s *ReferenceFiles) SetIndex(v *FileInformation) *ReferenceFiles { - s.Index = v - return s -} - -// SetSource sets the Source field's value. -func (s *ReferenceFiles) SetSource(v *FileInformation) *ReferenceFiles { - s.Source = v - return s -} - -// A filter for references. -type ReferenceFilter struct { - _ struct{} `type:"structure"` - - // The filter's start date. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's end date. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` - - // An MD5 checksum to filter on. - Md5 *string `locationName:"md5" min:"1" type:"string"` - - // A name to filter on. - Name *string `locationName:"name" min:"3" 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 ReferenceFilter) 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 ReferenceFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReferenceFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReferenceFilter"} - if s.Md5 != nil && len(*s.Md5) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Md5", 1)) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ReferenceFilter) SetCreatedAfter(v time.Time) *ReferenceFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ReferenceFilter) SetCreatedBefore(v time.Time) *ReferenceFilter { - s.CreatedBefore = &v - return s -} - -// SetMd5 sets the Md5 field's value. -func (s *ReferenceFilter) SetMd5(v string) *ReferenceFilter { - s.Md5 = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReferenceFilter) SetName(v string) *ReferenceFilter { - s.Name = &v - return s -} - -// A genome reference. -type ReferenceItem struct { - _ struct{} `type:"structure"` - - // The reference's ARN. - ReferenceArn *string `locationName:"referenceArn" min:"1" 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 ReferenceItem) 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 ReferenceItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReferenceItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReferenceItem"} - if s.ReferenceArn != nil && len(*s.ReferenceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *ReferenceItem) SetReferenceArn(v string) *ReferenceItem { - s.ReferenceArn = &v - return s -} - -// A genome reference. -type ReferenceListItem struct { - _ struct{} `type:"structure"` - - // The reference's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the reference was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The reference's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The reference's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The reference's MD5 checksum. - // - // Md5 is a required field - Md5 *string `locationName:"md5" min:"1" type:"string" required:"true"` - - // The reference's name. - Name *string `locationName:"name" min:"3" type:"string"` - - // The reference's store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `locationName:"referenceStoreId" min:"10" type:"string" required:"true"` - - // The reference's status. - Status *string `locationName:"status" type:"string" enum:"ReferenceStatus"` - - // When the reference was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 ReferenceListItem) 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 ReferenceListItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ReferenceListItem) SetArn(v string) *ReferenceListItem { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ReferenceListItem) SetCreationTime(v time.Time) *ReferenceListItem { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ReferenceListItem) SetDescription(v string) *ReferenceListItem { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *ReferenceListItem) SetId(v string) *ReferenceListItem { - s.Id = &v - return s -} - -// SetMd5 sets the Md5 field's value. -func (s *ReferenceListItem) SetMd5(v string) *ReferenceListItem { - s.Md5 = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReferenceListItem) SetName(v string) *ReferenceListItem { - s.Name = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *ReferenceListItem) SetReferenceStoreId(v string) *ReferenceListItem { - s.ReferenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReferenceListItem) SetStatus(v string) *ReferenceListItem { - s.Status = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *ReferenceListItem) SetUpdateTime(v time.Time) *ReferenceListItem { - s.UpdateTime = &v - return s -} - -// Details about a reference store. -type ReferenceStoreDetail struct { - _ struct{} `type:"structure"` - - // The store's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The store's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The store's server-side encryption (SSE) settings. - SseConfig *SseConfig `locationName:"sseConfig" 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 ReferenceStoreDetail) 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 ReferenceStoreDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ReferenceStoreDetail) SetArn(v string) *ReferenceStoreDetail { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ReferenceStoreDetail) SetCreationTime(v time.Time) *ReferenceStoreDetail { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ReferenceStoreDetail) SetDescription(v string) *ReferenceStoreDetail { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *ReferenceStoreDetail) SetId(v string) *ReferenceStoreDetail { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReferenceStoreDetail) SetName(v string) *ReferenceStoreDetail { - s.Name = &v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *ReferenceStoreDetail) SetSseConfig(v *SseConfig) *ReferenceStoreDetail { - s.SseConfig = v - return s -} - -// A filter for reference stores. -type ReferenceStoreFilter struct { - _ struct{} `type:"structure"` - - // The filter's start date. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's end date. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` - - // The name to filter on. - Name *string `locationName:"name" min:"1" 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 ReferenceStoreFilter) 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 ReferenceStoreFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReferenceStoreFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReferenceStoreFilter"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *ReferenceStoreFilter) SetCreatedAfter(v time.Time) *ReferenceStoreFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *ReferenceStoreFilter) SetCreatedBefore(v time.Time) *ReferenceStoreFilter { - s.CreatedBefore = &v - return s -} - -// SetName sets the Name field's value. -func (s *ReferenceStoreFilter) SetName(v string) *ReferenceStoreFilter { - s.Name = &v - return s -} - -// The request timed out. -type RequestTimeoutException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 RequestTimeoutException) 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 RequestTimeoutException) GoString() string { - return s.String() -} - -func newErrorRequestTimeoutException(v protocol.ResponseMetadata) error { - return &RequestTimeoutException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *RequestTimeoutException) Code() string { - return "RequestTimeoutException" -} - -// Message returns the exception's message. -func (s *RequestTimeoutException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *RequestTimeoutException) OrigErr() error { - return nil -} - -func (s *RequestTimeoutException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *RequestTimeoutException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *RequestTimeoutException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The target resource was not found in the current Region. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A run group. -type RunGroupListItem struct { - _ struct{} `type:"structure"` - - // The group's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // When the group was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The group's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // The group's maximum CPU count setting. - MaxCpus *int64 `locationName:"maxCpus" min:"1" type:"integer"` - - // The group's maximum duration setting in minutes. - MaxDuration *int64 `locationName:"maxDuration" min:"1" type:"integer"` - - // The maximum GPUs that can be used by a run group. - MaxGpus *int64 `locationName:"maxGpus" min:"1" type:"integer"` - - // The group's maximum concurrent run setting. - MaxRuns *int64 `locationName:"maxRuns" min:"1" type:"integer"` - - // The group's name. - Name *string `locationName:"name" min:"1" 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 RunGroupListItem) 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 RunGroupListItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *RunGroupListItem) SetArn(v string) *RunGroupListItem { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *RunGroupListItem) SetCreationTime(v time.Time) *RunGroupListItem { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *RunGroupListItem) SetId(v string) *RunGroupListItem { - s.Id = &v - return s -} - -// SetMaxCpus sets the MaxCpus field's value. -func (s *RunGroupListItem) SetMaxCpus(v int64) *RunGroupListItem { - s.MaxCpus = &v - return s -} - -// SetMaxDuration sets the MaxDuration field's value. -func (s *RunGroupListItem) SetMaxDuration(v int64) *RunGroupListItem { - s.MaxDuration = &v - return s -} - -// SetMaxGpus sets the MaxGpus field's value. -func (s *RunGroupListItem) SetMaxGpus(v int64) *RunGroupListItem { - s.MaxGpus = &v - return s -} - -// SetMaxRuns sets the MaxRuns field's value. -func (s *RunGroupListItem) SetMaxRuns(v int64) *RunGroupListItem { - s.MaxRuns = &v - return s -} - -// SetName sets the Name field's value. -func (s *RunGroupListItem) SetName(v string) *RunGroupListItem { - s.Name = &v - return s -} - -// A workflow run. -type RunListItem struct { - _ struct{} `type:"structure"` - - // The run's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // When the run was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The run's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // The run's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The run's priority. - Priority *int64 `locationName:"priority" type:"integer"` - - // When the run started. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The run's status. - Status *string `locationName:"status" min:"1" type:"string" enum:"RunStatus"` - - // When the run stopped. - StopTime *time.Time `locationName:"stopTime" type:"timestamp" timestampFormat:"iso8601"` - - // The run's storage capacity. - StorageCapacity *int64 `locationName:"storageCapacity" type:"integer"` - - // The run's workflow ID. - WorkflowId *string `locationName:"workflowId" min:"1" 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 RunListItem) 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 RunListItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *RunListItem) SetArn(v string) *RunListItem { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *RunListItem) SetCreationTime(v time.Time) *RunListItem { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *RunListItem) SetId(v string) *RunListItem { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *RunListItem) SetName(v string) *RunListItem { - s.Name = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *RunListItem) SetPriority(v int64) *RunListItem { - s.Priority = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *RunListItem) SetStartTime(v time.Time) *RunListItem { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RunListItem) SetStatus(v string) *RunListItem { - s.Status = &v - return s -} - -// SetStopTime sets the StopTime field's value. -func (s *RunListItem) SetStopTime(v time.Time) *RunListItem { - s.StopTime = &v - return s -} - -// SetStorageCapacity sets the StorageCapacity field's value. -func (s *RunListItem) SetStorageCapacity(v int64) *RunListItem { - s.StorageCapacity = &v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *RunListItem) SetWorkflowId(v string) *RunListItem { - s.WorkflowId = &v - return s -} - -// The URI for the run log. -type RunLogLocation struct { - _ struct{} `type:"structure"` - - // The log stream ARN for the engine log. - EngineLogStream *string `locationName:"engineLogStream" type:"string"` - - // The log stream ARN for the run log. - RunLogStream *string `locationName:"runLogStream" 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 RunLogLocation) 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 RunLogLocation) GoString() string { - return s.String() -} - -// SetEngineLogStream sets the EngineLogStream field's value. -func (s *RunLogLocation) SetEngineLogStream(v string) *RunLogLocation { - s.EngineLogStream = &v - return s -} - -// SetRunLogStream sets the RunLogStream field's value. -func (s *RunLogLocation) SetRunLogStream(v string) *RunLogLocation { - s.RunLogStream = &v - return s -} - -// Details about a sequence. -type SequenceInformation struct { - _ struct{} `type:"structure"` - - // The sequence's alignment setting. - Alignment *string `locationName:"alignment" type:"string"` - - // Where the sequence originated. - GeneratedFrom *string `locationName:"generatedFrom" min:"1" type:"string"` - - // The sequence's total base count. - TotalBaseCount *int64 `locationName:"totalBaseCount" type:"long"` - - // The sequence's total read count. - TotalReadCount *int64 `locationName:"totalReadCount" type:"long"` -} - -// 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 SequenceInformation) 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 SequenceInformation) GoString() string { - return s.String() -} - -// SetAlignment sets the Alignment field's value. -func (s *SequenceInformation) SetAlignment(v string) *SequenceInformation { - s.Alignment = &v - return s -} - -// SetGeneratedFrom sets the GeneratedFrom field's value. -func (s *SequenceInformation) SetGeneratedFrom(v string) *SequenceInformation { - s.GeneratedFrom = &v - return s -} - -// SetTotalBaseCount sets the TotalBaseCount field's value. -func (s *SequenceInformation) SetTotalBaseCount(v int64) *SequenceInformation { - s.TotalBaseCount = &v - return s -} - -// SetTotalReadCount sets the TotalReadCount field's value. -func (s *SequenceInformation) SetTotalReadCount(v int64) *SequenceInformation { - s.TotalReadCount = &v - return s -} - -// Details about a sequence store. -type SequenceStoreDetail struct { - _ struct{} `type:"structure"` - - // The store's ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // An S3 location that is used to store files that have failed a direct upload. - FallbackLocation *string `locationName:"fallbackLocation" type:"string"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The store's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The store's server-side encryption (SSE) settings. - SseConfig *SseConfig `locationName:"sseConfig" 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 SequenceStoreDetail) 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 SequenceStoreDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *SequenceStoreDetail) SetArn(v string) *SequenceStoreDetail { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *SequenceStoreDetail) SetCreationTime(v time.Time) *SequenceStoreDetail { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *SequenceStoreDetail) SetDescription(v string) *SequenceStoreDetail { - s.Description = &v - return s -} - -// SetFallbackLocation sets the FallbackLocation field's value. -func (s *SequenceStoreDetail) SetFallbackLocation(v string) *SequenceStoreDetail { - s.FallbackLocation = &v - return s -} - -// SetId sets the Id field's value. -func (s *SequenceStoreDetail) SetId(v string) *SequenceStoreDetail { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *SequenceStoreDetail) SetName(v string) *SequenceStoreDetail { - s.Name = &v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *SequenceStoreDetail) SetSseConfig(v *SseConfig) *SequenceStoreDetail { - s.SseConfig = v - return s -} - -// A filter for a sequence store. -type SequenceStoreFilter struct { - _ struct{} `type:"structure"` - - // The filter's start date. - CreatedAfter *time.Time `locationName:"createdAfter" type:"timestamp" timestampFormat:"iso8601"` - - // The filter's end date. - CreatedBefore *time.Time `locationName:"createdBefore" type:"timestamp" timestampFormat:"iso8601"` - - // A name to filter on. - Name *string `locationName:"name" min:"1" 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 SequenceStoreFilter) 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 SequenceStoreFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SequenceStoreFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SequenceStoreFilter"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreatedAfter sets the CreatedAfter field's value. -func (s *SequenceStoreFilter) SetCreatedAfter(v time.Time) *SequenceStoreFilter { - s.CreatedAfter = &v - return s -} - -// SetCreatedBefore sets the CreatedBefore field's value. -func (s *SequenceStoreFilter) SetCreatedBefore(v time.Time) *SequenceStoreFilter { - s.CreatedBefore = &v - return s -} - -// SetName sets the Name field's value. -func (s *SequenceStoreFilter) SetName(v string) *SequenceStoreFilter { - s.Name = &v - return s -} - -// The request exceeds a service quota. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The details of a share. -type ShareDetails struct { - _ struct{} `type:"structure"` - - // The timestamp for when the share was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The account ID for the data owner. The owner creates the share offer. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The principal subscriber is the account the analytics store data is being - // shared with. - PrincipalSubscriber *string `locationName:"principalSubscriber" type:"string"` - - // The resource Arn of the analytics store being shared. - ResourceArn *string `locationName:"resourceArn" type:"string"` - - // The ID for a share offer for an analytics store . - ShareId *string `locationName:"shareId" type:"string"` - - // The name of the share. - ShareName *string `locationName:"shareName" min:"1" type:"string"` - - // The status of a share. - Status *string `locationName:"status" type:"string" enum:"ShareStatus"` - - // The status message for a share. It provides more details on the status of - // the share. - StatusMessage *string `locationName:"statusMessage" type:"string"` - - // The timestamp of the share update. - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 ShareDetails) 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 ShareDetails) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ShareDetails) SetCreationTime(v time.Time) *ShareDetails { - s.CreationTime = &v - return s -} - -// SetOwnerId sets the OwnerId field's value. -func (s *ShareDetails) SetOwnerId(v string) *ShareDetails { - s.OwnerId = &v - return s -} - -// SetPrincipalSubscriber sets the PrincipalSubscriber field's value. -func (s *ShareDetails) SetPrincipalSubscriber(v string) *ShareDetails { - s.PrincipalSubscriber = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ShareDetails) SetResourceArn(v string) *ShareDetails { - s.ResourceArn = &v - return s -} - -// SetShareId sets the ShareId field's value. -func (s *ShareDetails) SetShareId(v string) *ShareDetails { - s.ShareId = &v - return s -} - -// SetShareName sets the ShareName field's value. -func (s *ShareDetails) SetShareName(v string) *ShareDetails { - s.ShareName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ShareDetails) SetStatus(v string) *ShareDetails { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *ShareDetails) SetStatusMessage(v string) *ShareDetails { - s.StatusMessage = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *ShareDetails) SetUpdateTime(v time.Time) *ShareDetails { - s.UpdateTime = &v - return s -} - -// Source files for a sequence. -type SourceFiles struct { - _ struct{} `type:"structure"` - - // The location of the first file in Amazon S3. - // - // Source1 is a required field - Source1 *string `locationName:"source1" type:"string" required:"true"` - - // The location of the second file in Amazon S3. - Source2 *string `locationName:"source2" 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 SourceFiles) 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 SourceFiles) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceFiles) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceFiles"} - if s.Source1 == nil { - invalidParams.Add(request.NewErrParamRequired("Source1")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSource1 sets the Source1 field's value. -func (s *SourceFiles) SetSource1(v string) *SourceFiles { - s.Source1 = &v - return s -} - -// SetSource2 sets the Source2 field's value. -func (s *SourceFiles) SetSource2(v string) *SourceFiles { - s.Source2 = &v - return s -} - -// Server-side encryption (SSE) settings for a store. -type SseConfig struct { - _ struct{} `type:"structure"` - - // An encryption key ARN. - KeyArn *string `locationName:"keyArn" min:"20" type:"string"` - - // The encryption type. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"EncryptionType"` -} - -// 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 SseConfig) 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 SseConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SseConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SseConfig"} - if s.KeyArn != nil && len(*s.KeyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("KeyArn", 20)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyArn sets the KeyArn field's value. -func (s *SseConfig) SetKeyArn(v string) *SseConfig { - s.KeyArn = &v - return s -} - -// SetType sets the Type field's value. -func (s *SseConfig) SetType(v string) *SseConfig { - s.Type = &v - return s -} - -type StartAnnotationImportJobInput struct { - _ struct{} `type:"structure"` - - // The annotation schema generated by the parsed annotation data. - AnnotationFields map[string]*string `locationName:"annotationFields" type:"map"` - - // A destination annotation store for the job. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" min:"3" type:"string" required:"true"` - - // Formatting options for the annotation file. - FormatOptions *FormatOptions `locationName:"formatOptions" type:"structure"` - - // Items to import. - // - // Items is a required field - Items []*AnnotationImportItemSource `locationName:"items" min:"1" type:"list" required:"true"` - - // A service role for the job. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's left normalization setting. - RunLeftNormalization *bool `locationName:"runLeftNormalization" type:"boolean"` - - // The name of the annotation store version. - VersionName *string `locationName:"versionName" min:"3" 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 StartAnnotationImportJobInput) 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 StartAnnotationImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartAnnotationImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartAnnotationImportJobInput"} - if s.DestinationName == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationName")) - } - if s.DestinationName != nil && len(*s.DestinationName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DestinationName", 3)) - } - if s.Items == nil { - invalidParams.Add(request.NewErrParamRequired("Items")) - } - if s.Items != nil && len(s.Items) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Items", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.VersionName != nil && len(*s.VersionName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("VersionName", 3)) - } - if s.FormatOptions != nil { - if err := s.FormatOptions.Validate(); err != nil { - invalidParams.AddNested("FormatOptions", err.(request.ErrInvalidParams)) - } - } - if s.Items != nil { - for i, v := range s.Items { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnnotationFields sets the AnnotationFields field's value. -func (s *StartAnnotationImportJobInput) SetAnnotationFields(v map[string]*string) *StartAnnotationImportJobInput { - s.AnnotationFields = v - return s -} - -// SetDestinationName sets the DestinationName field's value. -func (s *StartAnnotationImportJobInput) SetDestinationName(v string) *StartAnnotationImportJobInput { - s.DestinationName = &v - return s -} - -// SetFormatOptions sets the FormatOptions field's value. -func (s *StartAnnotationImportJobInput) SetFormatOptions(v *FormatOptions) *StartAnnotationImportJobInput { - s.FormatOptions = v - return s -} - -// SetItems sets the Items field's value. -func (s *StartAnnotationImportJobInput) SetItems(v []*AnnotationImportItemSource) *StartAnnotationImportJobInput { - s.Items = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartAnnotationImportJobInput) SetRoleArn(v string) *StartAnnotationImportJobInput { - s.RoleArn = &v - return s -} - -// SetRunLeftNormalization sets the RunLeftNormalization field's value. -func (s *StartAnnotationImportJobInput) SetRunLeftNormalization(v bool) *StartAnnotationImportJobInput { - s.RunLeftNormalization = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *StartAnnotationImportJobInput) SetVersionName(v string) *StartAnnotationImportJobInput { - s.VersionName = &v - return s -} - -type StartAnnotationImportJobOutput struct { - _ struct{} `type:"structure"` - - // The job's ID. - // - // JobId is a required field - JobId *string `locationName:"jobId" 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 StartAnnotationImportJobOutput) 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 StartAnnotationImportJobOutput) GoString() string { - return s.String() -} - -// SetJobId sets the JobId field's value. -func (s *StartAnnotationImportJobOutput) SetJobId(v string) *StartAnnotationImportJobOutput { - s.JobId = &v - return s -} - -type StartReadSetActivationJobInput struct { - _ struct{} `type:"structure"` - - // To ensure that jobs don't run multiple times, specify a unique token for - // each job. - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's source files. - // - // Sources is a required field - Sources []*StartReadSetActivationJobSourceItem `locationName:"sources" min:"1" type:"list" 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 StartReadSetActivationJobInput) 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 StartReadSetActivationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReadSetActivationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReadSetActivationJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.Sources == nil { - invalidParams.Add(request.NewErrParamRequired("Sources")) - } - if s.Sources != nil && len(s.Sources) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Sources", 1)) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartReadSetActivationJobInput) SetClientToken(v string) *StartReadSetActivationJobInput { - s.ClientToken = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *StartReadSetActivationJobInput) SetSequenceStoreId(v string) *StartReadSetActivationJobInput { - s.SequenceStoreId = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *StartReadSetActivationJobInput) SetSources(v []*StartReadSetActivationJobSourceItem) *StartReadSetActivationJobInput { - s.Sources = v - return s -} - -type StartReadSetActivationJobOutput struct { - _ struct{} `type:"structure"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetActivationJobStatus"` -} - -// 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 StartReadSetActivationJobOutput) 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 StartReadSetActivationJobOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StartReadSetActivationJobOutput) SetCreationTime(v time.Time) *StartReadSetActivationJobOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartReadSetActivationJobOutput) SetId(v string) *StartReadSetActivationJobOutput { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *StartReadSetActivationJobOutput) SetSequenceStoreId(v string) *StartReadSetActivationJobOutput { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartReadSetActivationJobOutput) SetStatus(v string) *StartReadSetActivationJobOutput { - s.Status = &v - return s -} - -// A source for a read set activation job. -type StartReadSetActivationJobSourceItem struct { - _ struct{} `type:"structure"` - - // The source's read set ID. - // - // ReadSetId is a required field - ReadSetId *string `locationName:"readSetId" min:"10" 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 StartReadSetActivationJobSourceItem) 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 StartReadSetActivationJobSourceItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReadSetActivationJobSourceItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReadSetActivationJobSourceItem"} - if s.ReadSetId == nil { - invalidParams.Add(request.NewErrParamRequired("ReadSetId")) - } - if s.ReadSetId != nil && len(*s.ReadSetId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReadSetId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReadSetId sets the ReadSetId field's value. -func (s *StartReadSetActivationJobSourceItem) SetReadSetId(v string) *StartReadSetActivationJobSourceItem { - s.ReadSetId = &v - return s -} - -type StartReadSetExportJobInput struct { - _ struct{} `type:"structure"` - - // To ensure that jobs don't run multiple times, specify a unique token for - // each job. - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // A location for exported files in Amazon S3. - // - // Destination is a required field - Destination *string `locationName:"destination" type:"string" required:"true"` - - // A service role for the job. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's source files. - // - // Sources is a required field - Sources []*ExportReadSet `locationName:"sources" min:"1" type:"list" 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 StartReadSetExportJobInput) 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 StartReadSetExportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReadSetExportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReadSetExportJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.Sources == nil { - invalidParams.Add(request.NewErrParamRequired("Sources")) - } - if s.Sources != nil && len(s.Sources) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Sources", 1)) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartReadSetExportJobInput) SetClientToken(v string) *StartReadSetExportJobInput { - s.ClientToken = &v - return s -} - -// SetDestination sets the Destination field's value. -func (s *StartReadSetExportJobInput) SetDestination(v string) *StartReadSetExportJobInput { - s.Destination = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartReadSetExportJobInput) SetRoleArn(v string) *StartReadSetExportJobInput { - s.RoleArn = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *StartReadSetExportJobInput) SetSequenceStoreId(v string) *StartReadSetExportJobInput { - s.SequenceStoreId = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *StartReadSetExportJobInput) SetSources(v []*ExportReadSet) *StartReadSetExportJobInput { - s.Sources = v - return s -} - -type StartReadSetExportJobOutput struct { - _ struct{} `type:"structure"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's output location. - // - // Destination is a required field - Destination *string `locationName:"destination" type:"string" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetExportJobStatus"` -} - -// 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 StartReadSetExportJobOutput) 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 StartReadSetExportJobOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StartReadSetExportJobOutput) SetCreationTime(v time.Time) *StartReadSetExportJobOutput { - s.CreationTime = &v - return s -} - -// SetDestination sets the Destination field's value. -func (s *StartReadSetExportJobOutput) SetDestination(v string) *StartReadSetExportJobOutput { - s.Destination = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartReadSetExportJobOutput) SetId(v string) *StartReadSetExportJobOutput { - s.Id = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *StartReadSetExportJobOutput) SetSequenceStoreId(v string) *StartReadSetExportJobOutput { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartReadSetExportJobOutput) SetStatus(v string) *StartReadSetExportJobOutput { - s.Status = &v - return s -} - -type StartReadSetImportJobInput struct { - _ struct{} `type:"structure"` - - // To ensure that jobs don't run multiple times, specify a unique token for - // each job. - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // A service role for the job. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's source files. - // - // Sources is a required field - Sources []*StartReadSetImportJobSourceItem `locationName:"sources" min:"1" type:"list" 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 StartReadSetImportJobInput) 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 StartReadSetImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReadSetImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReadSetImportJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.Sources == nil { - invalidParams.Add(request.NewErrParamRequired("Sources")) - } - if s.Sources != nil && len(s.Sources) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Sources", 1)) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartReadSetImportJobInput) SetClientToken(v string) *StartReadSetImportJobInput { - s.ClientToken = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartReadSetImportJobInput) SetRoleArn(v string) *StartReadSetImportJobInput { - s.RoleArn = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *StartReadSetImportJobInput) SetSequenceStoreId(v string) *StartReadSetImportJobInput { - s.SequenceStoreId = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *StartReadSetImportJobInput) SetSources(v []*StartReadSetImportJobSourceItem) *StartReadSetImportJobInput { - s.Sources = v - return s -} - -type StartReadSetImportJobOutput struct { - _ struct{} `type:"structure"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The read set's sequence store ID. - // - // SequenceStoreId is a required field - SequenceStoreId *string `locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReadSetImportJobStatus"` -} - -// 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 StartReadSetImportJobOutput) 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 StartReadSetImportJobOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StartReadSetImportJobOutput) SetCreationTime(v time.Time) *StartReadSetImportJobOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartReadSetImportJobOutput) SetId(v string) *StartReadSetImportJobOutput { - s.Id = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartReadSetImportJobOutput) SetRoleArn(v string) *StartReadSetImportJobOutput { - s.RoleArn = &v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *StartReadSetImportJobOutput) SetSequenceStoreId(v string) *StartReadSetImportJobOutput { - s.SequenceStoreId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartReadSetImportJobOutput) SetStatus(v string) *StartReadSetImportJobOutput { - s.Status = &v - return s -} - -// A source for a read set import job. -type StartReadSetImportJobSourceItem struct { - _ struct{} `type:"structure"` - - // The source's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // Where the source originated. - GeneratedFrom *string `locationName:"generatedFrom" min:"1" type:"string"` - - // The source's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The source's reference ARN. - ReferenceArn *string `locationName:"referenceArn" min:"1" type:"string"` - - // The source's sample ID. - // - // SampleId is a required field - SampleId *string `locationName:"sampleId" min:"1" type:"string" required:"true"` - - // The source's file type. - // - // SourceFileType is a required field - SourceFileType *string `locationName:"sourceFileType" type:"string" required:"true" enum:"FileType"` - - // The source files' location in Amazon S3. - // - // SourceFiles is a required field - SourceFiles *SourceFiles `locationName:"sourceFiles" type:"structure" required:"true"` - - // The source's subject ID. - // - // SubjectId is a required field - SubjectId *string `locationName:"subjectId" min:"1" type:"string" required:"true"` - - // The source's tags. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 StartReadSetImportJobSourceItem) 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 StartReadSetImportJobSourceItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReadSetImportJobSourceItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReadSetImportJobSourceItem"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.GeneratedFrom != nil && len(*s.GeneratedFrom) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GeneratedFrom", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ReferenceArn != nil && len(*s.ReferenceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceArn", 1)) - } - if s.SampleId == nil { - invalidParams.Add(request.NewErrParamRequired("SampleId")) - } - if s.SampleId != nil && len(*s.SampleId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SampleId", 1)) - } - if s.SourceFileType == nil { - invalidParams.Add(request.NewErrParamRequired("SourceFileType")) - } - if s.SourceFiles == nil { - invalidParams.Add(request.NewErrParamRequired("SourceFiles")) - } - if s.SubjectId == nil { - invalidParams.Add(request.NewErrParamRequired("SubjectId")) - } - if s.SubjectId != nil && len(*s.SubjectId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubjectId", 1)) - } - if s.SourceFiles != nil { - if err := s.SourceFiles.Validate(); err != nil { - invalidParams.AddNested("SourceFiles", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *StartReadSetImportJobSourceItem) SetDescription(v string) *StartReadSetImportJobSourceItem { - s.Description = &v - return s -} - -// SetGeneratedFrom sets the GeneratedFrom field's value. -func (s *StartReadSetImportJobSourceItem) SetGeneratedFrom(v string) *StartReadSetImportJobSourceItem { - s.GeneratedFrom = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartReadSetImportJobSourceItem) SetName(v string) *StartReadSetImportJobSourceItem { - s.Name = &v - return s -} - -// SetReferenceArn sets the ReferenceArn field's value. -func (s *StartReadSetImportJobSourceItem) SetReferenceArn(v string) *StartReadSetImportJobSourceItem { - s.ReferenceArn = &v - return s -} - -// SetSampleId sets the SampleId field's value. -func (s *StartReadSetImportJobSourceItem) SetSampleId(v string) *StartReadSetImportJobSourceItem { - s.SampleId = &v - return s -} - -// SetSourceFileType sets the SourceFileType field's value. -func (s *StartReadSetImportJobSourceItem) SetSourceFileType(v string) *StartReadSetImportJobSourceItem { - s.SourceFileType = &v - return s -} - -// SetSourceFiles sets the SourceFiles field's value. -func (s *StartReadSetImportJobSourceItem) SetSourceFiles(v *SourceFiles) *StartReadSetImportJobSourceItem { - s.SourceFiles = v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *StartReadSetImportJobSourceItem) SetSubjectId(v string) *StartReadSetImportJobSourceItem { - s.SubjectId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartReadSetImportJobSourceItem) SetTags(v map[string]*string) *StartReadSetImportJobSourceItem { - s.Tags = v - return s -} - -type StartReferenceImportJobInput struct { - _ struct{} `type:"structure"` - - // To ensure that jobs don't run multiple times, specify a unique token for - // each job. - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The job's reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `location:"uri" locationName:"referenceStoreId" min:"10" type:"string" required:"true"` - - // A service role for the job. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's source files. - // - // Sources is a required field - Sources []*StartReferenceImportJobSourceItem `locationName:"sources" min:"1" type:"list" 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 StartReferenceImportJobInput) 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 StartReferenceImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReferenceImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReferenceImportJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ReferenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("ReferenceStoreId")) - } - if s.ReferenceStoreId != nil && len(*s.ReferenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("ReferenceStoreId", 10)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.Sources == nil { - invalidParams.Add(request.NewErrParamRequired("Sources")) - } - if s.Sources != nil && len(s.Sources) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Sources", 1)) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartReferenceImportJobInput) SetClientToken(v string) *StartReferenceImportJobInput { - s.ClientToken = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *StartReferenceImportJobInput) SetReferenceStoreId(v string) *StartReferenceImportJobInput { - s.ReferenceStoreId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartReferenceImportJobInput) SetRoleArn(v string) *StartReferenceImportJobInput { - s.RoleArn = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *StartReferenceImportJobInput) SetSources(v []*StartReferenceImportJobSourceItem) *StartReferenceImportJobInput { - s.Sources = v - return s -} - -type StartReferenceImportJobOutput struct { - _ struct{} `type:"structure"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" min:"10" type:"string" required:"true"` - - // The job's reference store ID. - // - // ReferenceStoreId is a required field - ReferenceStoreId *string `locationName:"referenceStoreId" min:"10" type:"string" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ReferenceImportJobStatus"` -} - -// 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 StartReferenceImportJobOutput) 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 StartReferenceImportJobOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StartReferenceImportJobOutput) SetCreationTime(v time.Time) *StartReferenceImportJobOutput { - s.CreationTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartReferenceImportJobOutput) SetId(v string) *StartReferenceImportJobOutput { - s.Id = &v - return s -} - -// SetReferenceStoreId sets the ReferenceStoreId field's value. -func (s *StartReferenceImportJobOutput) SetReferenceStoreId(v string) *StartReferenceImportJobOutput { - s.ReferenceStoreId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartReferenceImportJobOutput) SetRoleArn(v string) *StartReferenceImportJobOutput { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartReferenceImportJobOutput) SetStatus(v string) *StartReferenceImportJobOutput { - s.Status = &v - return s -} - -// A source for a reference import job. -type StartReferenceImportJobSourceItem struct { - _ struct{} `type:"structure"` - - // The source's description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The source's name. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The source file's location in Amazon S3. - // - // SourceFile is a required field - SourceFile *string `locationName:"sourceFile" type:"string" required:"true"` - - // The source's tags. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 StartReferenceImportJobSourceItem) 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 StartReferenceImportJobSourceItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReferenceImportJobSourceItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReferenceImportJobSourceItem"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.SourceFile == nil { - invalidParams.Add(request.NewErrParamRequired("SourceFile")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *StartReferenceImportJobSourceItem) SetDescription(v string) *StartReferenceImportJobSourceItem { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartReferenceImportJobSourceItem) SetName(v string) *StartReferenceImportJobSourceItem { - s.Name = &v - return s -} - -// SetSourceFile sets the SourceFile field's value. -func (s *StartReferenceImportJobSourceItem) SetSourceFile(v string) *StartReferenceImportJobSourceItem { - s.SourceFile = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartReferenceImportJobSourceItem) SetTags(v map[string]*string) *StartReferenceImportJobSourceItem { - s.Tags = v - return s -} - -type StartRunInput struct { - _ struct{} `type:"structure"` - - // A log level for the run. - LogLevel *string `locationName:"logLevel" min:"1" type:"string" enum:"RunLogLevel"` - - // A name for the run. - Name *string `locationName:"name" min:"1" type:"string"` - - // An output URI for the run. - OutputUri *string `locationName:"outputUri" min:"1" type:"string"` - - // A priority for the run. - Priority *int64 `locationName:"priority" type:"integer"` - - // To ensure that requests don't run multiple times, specify a unique ID for - // each request. - RequestId *string `locationName:"requestId" min:"1" type:"string" idempotencyToken:"true"` - - // The retention mode for the run. - RetentionMode *string `locationName:"retentionMode" min:"1" type:"string" enum:"RunRetentionMode"` - - // A service role for the run. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"1" type:"string" required:"true"` - - // The run's group ID. - RunGroupId *string `locationName:"runGroupId" min:"1" type:"string"` - - // The ID of a run to duplicate. - RunId *string `locationName:"runId" min:"1" type:"string"` - - // A storage capacity for the run in gigabytes. - StorageCapacity *int64 `locationName:"storageCapacity" type:"integer"` - - // Tags for the run. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The run's workflow ID. - WorkflowId *string `locationName:"workflowId" min:"1" type:"string"` - - // The run's workflow type. - WorkflowType *string `locationName:"workflowType" min:"1" type:"string" enum:"WorkflowType"` -} - -// 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 StartRunInput) 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 StartRunInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartRunInput"} - if s.LogLevel != nil && len(*s.LogLevel) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogLevel", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.OutputUri != nil && len(*s.OutputUri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OutputUri", 1)) - } - if s.RequestId != nil && len(*s.RequestId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestId", 1)) - } - if s.RetentionMode != nil && len(*s.RetentionMode) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RetentionMode", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - if s.RunGroupId != nil && len(*s.RunGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RunGroupId", 1)) - } - if s.RunId != nil && len(*s.RunId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RunId", 1)) - } - if s.WorkflowId != nil && len(*s.WorkflowId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowId", 1)) - } - if s.WorkflowType != nil && len(*s.WorkflowType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkflowType", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogLevel sets the LogLevel field's value. -func (s *StartRunInput) SetLogLevel(v string) *StartRunInput { - s.LogLevel = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartRunInput) SetName(v string) *StartRunInput { - s.Name = &v - return s -} - -// SetOutputUri sets the OutputUri field's value. -func (s *StartRunInput) SetOutputUri(v string) *StartRunInput { - s.OutputUri = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *StartRunInput) SetPriority(v int64) *StartRunInput { - s.Priority = &v - return s -} - -// SetRequestId sets the RequestId field's value. -func (s *StartRunInput) SetRequestId(v string) *StartRunInput { - s.RequestId = &v - return s -} - -// SetRetentionMode sets the RetentionMode field's value. -func (s *StartRunInput) SetRetentionMode(v string) *StartRunInput { - s.RetentionMode = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartRunInput) SetRoleArn(v string) *StartRunInput { - s.RoleArn = &v - return s -} - -// SetRunGroupId sets the RunGroupId field's value. -func (s *StartRunInput) SetRunGroupId(v string) *StartRunInput { - s.RunGroupId = &v - return s -} - -// SetRunId sets the RunId field's value. -func (s *StartRunInput) SetRunId(v string) *StartRunInput { - s.RunId = &v - return s -} - -// SetStorageCapacity sets the StorageCapacity field's value. -func (s *StartRunInput) SetStorageCapacity(v int64) *StartRunInput { - s.StorageCapacity = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartRunInput) SetTags(v map[string]*string) *StartRunInput { - s.Tags = v - return s -} - -// SetWorkflowId sets the WorkflowId field's value. -func (s *StartRunInput) SetWorkflowId(v string) *StartRunInput { - s.WorkflowId = &v - return s -} - -// SetWorkflowType sets the WorkflowType field's value. -func (s *StartRunInput) SetWorkflowType(v string) *StartRunInput { - s.WorkflowType = &v - return s -} - -type StartRunOutput struct { - _ struct{} `type:"structure"` - - // The run's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // The run's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // The destination for workflow outputs. - RunOutputUri *string `locationName:"runOutputUri" min:"1" type:"string"` - - // The run's status. - Status *string `locationName:"status" min:"1" type:"string" enum:"RunStatus"` - - // The run's tags. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The universally unique identifier for a run. - Uuid *string `locationName:"uuid" min:"1" 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 StartRunOutput) 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 StartRunOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartRunOutput) SetArn(v string) *StartRunOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *StartRunOutput) SetId(v string) *StartRunOutput { - s.Id = &v - return s -} - -// SetRunOutputUri sets the RunOutputUri field's value. -func (s *StartRunOutput) SetRunOutputUri(v string) *StartRunOutput { - s.RunOutputUri = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartRunOutput) SetStatus(v string) *StartRunOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartRunOutput) SetTags(v map[string]*string) *StartRunOutput { - s.Tags = v - return s -} - -// SetUuid sets the Uuid field's value. -func (s *StartRunOutput) SetUuid(v string) *StartRunOutput { - s.Uuid = &v - return s -} - -type StartVariantImportJobInput struct { - _ struct{} `type:"structure"` - - // The annotation schema generated by the parsed annotation data. - AnnotationFields map[string]*string `locationName:"annotationFields" type:"map"` - - // The destination variant store for the job. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" min:"3" type:"string" required:"true"` - - // Items to import. - // - // Items is a required field - Items []*VariantImportItemSource `locationName:"items" min:"1" type:"list" required:"true"` - - // A service role for the job. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's left normalization setting. - RunLeftNormalization *bool `locationName:"runLeftNormalization" type:"boolean"` -} - -// 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 StartVariantImportJobInput) 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 StartVariantImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartVariantImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartVariantImportJobInput"} - if s.DestinationName == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationName")) - } - if s.DestinationName != nil && len(*s.DestinationName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("DestinationName", 3)) - } - if s.Items == nil { - invalidParams.Add(request.NewErrParamRequired("Items")) - } - if s.Items != nil && len(s.Items) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Items", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.Items != nil { - for i, v := range s.Items { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnnotationFields sets the AnnotationFields field's value. -func (s *StartVariantImportJobInput) SetAnnotationFields(v map[string]*string) *StartVariantImportJobInput { - s.AnnotationFields = v - return s -} - -// SetDestinationName sets the DestinationName field's value. -func (s *StartVariantImportJobInput) SetDestinationName(v string) *StartVariantImportJobInput { - s.DestinationName = &v - return s -} - -// SetItems sets the Items field's value. -func (s *StartVariantImportJobInput) SetItems(v []*VariantImportItemSource) *StartVariantImportJobInput { - s.Items = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartVariantImportJobInput) SetRoleArn(v string) *StartVariantImportJobInput { - s.RoleArn = &v - return s -} - -// SetRunLeftNormalization sets the RunLeftNormalization field's value. -func (s *StartVariantImportJobInput) SetRunLeftNormalization(v bool) *StartVariantImportJobInput { - s.RunLeftNormalization = &v - return s -} - -type StartVariantImportJobOutput struct { - _ struct{} `type:"structure"` - - // The job's ID. - // - // JobId is a required field - JobId *string `locationName:"jobId" 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 StartVariantImportJobOutput) 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 StartVariantImportJobOutput) GoString() string { - return s.String() -} - -// SetJobId sets the JobId field's value. -func (s *StartVariantImportJobOutput) SetJobId(v string) *StartVariantImportJobOutput { - s.JobId = &v - return s -} - -// Settings for a store. -type StoreOptions struct { - _ struct{} `type:"structure"` - - // File settings for a TSV store. - TsvStoreOptions *TsvStoreOptions `locationName:"tsvStoreOptions" 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 StoreOptions) 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 StoreOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StoreOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StoreOptions"} - if s.TsvStoreOptions != nil { - if err := s.TsvStoreOptions.Validate(); err != nil { - invalidParams.AddNested("TsvStoreOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTsvStoreOptions sets the TsvStoreOptions field's value. -func (s *StoreOptions) SetTsvStoreOptions(v *TsvStoreOptions) *StoreOptions { - s.TsvStoreOptions = v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The resource's ARN. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // Tags for the resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// A workflow run task. -type TaskListItem struct { - _ struct{} `type:"structure"` - - // The task's CPU count. - Cpus *int64 `locationName:"cpus" min:"1" type:"integer"` - - // When the task was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The number of Graphics Processing Units (GPU) specified for the task. - Gpus *int64 `locationName:"gpus" type:"integer"` - - // The instance type for a task. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The task's memory use in gigabyes. - Memory *int64 `locationName:"memory" min:"1" type:"integer"` - - // The task's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // When the task started. - StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` - - // The task's status. - Status *string `locationName:"status" min:"1" type:"string" enum:"TaskStatus"` - - // When the task stopped. - StopTime *time.Time `locationName:"stopTime" type:"timestamp" timestampFormat:"iso8601"` - - // The task's ID. - TaskId *string `locationName:"taskId" min:"1" 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 TaskListItem) 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 TaskListItem) GoString() string { - return s.String() -} - -// SetCpus sets the Cpus field's value. -func (s *TaskListItem) SetCpus(v int64) *TaskListItem { - s.Cpus = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *TaskListItem) SetCreationTime(v time.Time) *TaskListItem { - s.CreationTime = &v - return s -} - -// SetGpus sets the Gpus field's value. -func (s *TaskListItem) SetGpus(v int64) *TaskListItem { - s.Gpus = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *TaskListItem) SetInstanceType(v string) *TaskListItem { - s.InstanceType = &v - return s -} - -// SetMemory sets the Memory field's value. -func (s *TaskListItem) SetMemory(v int64) *TaskListItem { - s.Memory = &v - return s -} - -// SetName sets the Name field's value. -func (s *TaskListItem) SetName(v string) *TaskListItem { - s.Name = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *TaskListItem) SetStartTime(v time.Time) *TaskListItem { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TaskListItem) SetStatus(v string) *TaskListItem { - s.Status = &v - return s -} - -// SetStopTime sets the StopTime field's value. -func (s *TaskListItem) SetStopTime(v time.Time) *TaskListItem { - s.StopTime = &v - return s -} - -// SetTaskId sets the TaskId field's value. -func (s *TaskListItem) SetTaskId(v string) *TaskListItem { - s.TaskId = &v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Formatting options for a TSV file. -type TsvOptions struct { - _ struct{} `type:"structure"` - - // The file's read options. - ReadOptions *ReadOptions `locationName:"readOptions" 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 TsvOptions) 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 TsvOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TsvOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TsvOptions"} - if s.ReadOptions != nil { - if err := s.ReadOptions.Validate(); err != nil { - invalidParams.AddNested("ReadOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReadOptions sets the ReadOptions field's value. -func (s *TsvOptions) SetReadOptions(v *ReadOptions) *TsvOptions { - s.ReadOptions = v - return s -} - -// File settings for a TSV store. -type TsvStoreOptions struct { - _ struct{} `type:"structure"` - - // The store's annotation type. - AnnotationType *string `locationName:"annotationType" type:"string" enum:"AnnotationType"` - - // The store's header key to column name mapping. - FormatToHeader map[string]*string `locationName:"formatToHeader" type:"map"` - - // The store's schema. - Schema []map[string]*string `locationName:"schema" min:"1" type:"list"` -} - -// 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 TsvStoreOptions) 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 TsvStoreOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TsvStoreOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TsvStoreOptions"} - if s.Schema != nil && len(s.Schema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Schema", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnnotationType sets the AnnotationType field's value. -func (s *TsvStoreOptions) SetAnnotationType(v string) *TsvStoreOptions { - s.AnnotationType = &v - return s -} - -// SetFormatToHeader sets the FormatToHeader field's value. -func (s *TsvStoreOptions) SetFormatToHeader(v map[string]*string) *TsvStoreOptions { - s.FormatToHeader = v - return s -} - -// SetSchema sets the Schema field's value. -func (s *TsvStoreOptions) SetSchema(v []map[string]*string) *TsvStoreOptions { - s.Schema = v - return s -} - -// The options for a TSV file. -type TsvVersionOptions struct { - _ struct{} `type:"structure"` - - // The store version's annotation type. - AnnotationType *string `locationName:"annotationType" type:"string" enum:"AnnotationType"` - - // The annotation store version's header key to column name mapping. - FormatToHeader map[string]*string `locationName:"formatToHeader" type:"map"` - - // The TSV schema for an annotation store version. - Schema []map[string]*string `locationName:"schema" min:"1" type:"list"` -} - -// 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 TsvVersionOptions) 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 TsvVersionOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TsvVersionOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TsvVersionOptions"} - if s.Schema != nil && len(s.Schema) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Schema", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnnotationType sets the AnnotationType field's value. -func (s *TsvVersionOptions) SetAnnotationType(v string) *TsvVersionOptions { - s.AnnotationType = &v - return s -} - -// SetFormatToHeader sets the FormatToHeader field's value. -func (s *TsvVersionOptions) SetFormatToHeader(v map[string]*string) *TsvVersionOptions { - s.FormatToHeader = v - return s -} - -// SetSchema sets the Schema field's value. -func (s *TsvVersionOptions) SetSchema(v []map[string]*string) *TsvVersionOptions { - s.Schema = v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The resource's ARN. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // Keys of tags to remove. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateAnnotationStoreInput struct { - _ struct{} `type:"structure"` - - // A description for the store. - Description *string `locationName:"description" type:"string"` - - // A name for the store. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" 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 UpdateAnnotationStoreInput) 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 UpdateAnnotationStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAnnotationStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAnnotationStoreInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateAnnotationStoreInput) SetDescription(v string) *UpdateAnnotationStoreInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateAnnotationStoreInput) SetName(v string) *UpdateAnnotationStoreInput { - s.Name = &v - return s -} - -type UpdateAnnotationStoreOutput struct { - _ struct{} `type:"structure"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The store's name. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The store's genome reference. - // - // Reference is a required field - Reference *ReferenceItem `locationName:"reference" type:"structure" required:"true"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` - - // The annotation file format of the store. - StoreFormat *string `locationName:"storeFormat" type:"string" enum:"StoreFormat"` - - // Parsing options for the store. - StoreOptions *StoreOptions `locationName:"storeOptions" type:"structure"` - - // When the store was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 UpdateAnnotationStoreOutput) 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 UpdateAnnotationStoreOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *UpdateAnnotationStoreOutput) SetCreationTime(v time.Time) *UpdateAnnotationStoreOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAnnotationStoreOutput) SetDescription(v string) *UpdateAnnotationStoreOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateAnnotationStoreOutput) SetId(v string) *UpdateAnnotationStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateAnnotationStoreOutput) SetName(v string) *UpdateAnnotationStoreOutput { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *UpdateAnnotationStoreOutput) SetReference(v *ReferenceItem) *UpdateAnnotationStoreOutput { - s.Reference = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateAnnotationStoreOutput) SetStatus(v string) *UpdateAnnotationStoreOutput { - s.Status = &v - return s -} - -// SetStoreFormat sets the StoreFormat field's value. -func (s *UpdateAnnotationStoreOutput) SetStoreFormat(v string) *UpdateAnnotationStoreOutput { - s.StoreFormat = &v - return s -} - -// SetStoreOptions sets the StoreOptions field's value. -func (s *UpdateAnnotationStoreOutput) SetStoreOptions(v *StoreOptions) *UpdateAnnotationStoreOutput { - s.StoreOptions = v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *UpdateAnnotationStoreOutput) SetUpdateTime(v time.Time) *UpdateAnnotationStoreOutput { - s.UpdateTime = &v - return s -} - -type UpdateAnnotationStoreVersionInput struct { - _ struct{} `type:"structure"` - - // The description of an annotation store. - Description *string `locationName:"description" type:"string"` - - // The name of an annotation store. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` - - // The name of an annotation store version. - // - // VersionName is a required field - VersionName *string `location:"uri" locationName:"versionName" 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 UpdateAnnotationStoreVersionInput) 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 UpdateAnnotationStoreVersionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAnnotationStoreVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAnnotationStoreVersionInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.VersionName == nil { - invalidParams.Add(request.NewErrParamRequired("VersionName")) - } - if s.VersionName != nil && len(*s.VersionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateAnnotationStoreVersionInput) SetDescription(v string) *UpdateAnnotationStoreVersionInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateAnnotationStoreVersionInput) SetName(v string) *UpdateAnnotationStoreVersionInput { - s.Name = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *UpdateAnnotationStoreVersionInput) SetVersionName(v string) *UpdateAnnotationStoreVersionInput { - s.VersionName = &v - return s -} - -type UpdateAnnotationStoreVersionOutput struct { - _ struct{} `type:"structure"` - - // The time stamp for when an annotation store version was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The description of an annotation store version. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The annotation store version ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The name of an annotation store. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The status of an annotation store version. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"VersionStatus"` - - // The annotation store ID. - // - // StoreId is a required field - StoreId *string `locationName:"storeId" type:"string" required:"true"` - - // The time stamp for when an annotation store version was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The name of an annotation store version. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" 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 UpdateAnnotationStoreVersionOutput) 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 UpdateAnnotationStoreVersionOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *UpdateAnnotationStoreVersionOutput) SetCreationTime(v time.Time) *UpdateAnnotationStoreVersionOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAnnotationStoreVersionOutput) SetDescription(v string) *UpdateAnnotationStoreVersionOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateAnnotationStoreVersionOutput) SetId(v string) *UpdateAnnotationStoreVersionOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateAnnotationStoreVersionOutput) SetName(v string) *UpdateAnnotationStoreVersionOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateAnnotationStoreVersionOutput) SetStatus(v string) *UpdateAnnotationStoreVersionOutput { - s.Status = &v - return s -} - -// SetStoreId sets the StoreId field's value. -func (s *UpdateAnnotationStoreVersionOutput) SetStoreId(v string) *UpdateAnnotationStoreVersionOutput { - s.StoreId = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *UpdateAnnotationStoreVersionOutput) SetUpdateTime(v time.Time) *UpdateAnnotationStoreVersionOutput { - s.UpdateTime = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *UpdateAnnotationStoreVersionOutput) SetVersionName(v string) *UpdateAnnotationStoreVersionOutput { - s.VersionName = &v - return s -} - -type UpdateRunGroupInput struct { - _ struct{} `type:"structure"` - - // The group's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // The maximum number of CPUs to use. - MaxCpus *int64 `locationName:"maxCpus" min:"1" type:"integer"` - - // A maximum run time for the group in minutes. - MaxDuration *int64 `locationName:"maxDuration" min:"1" type:"integer"` - - // The maximum GPUs that can be used by a run group. - MaxGpus *int64 `locationName:"maxGpus" min:"1" type:"integer"` - - // The maximum number of concurrent runs for the group. - MaxRuns *int64 `locationName:"maxRuns" min:"1" type:"integer"` - - // A name for the group. - Name *string `locationName:"name" min:"1" 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 UpdateRunGroupInput) 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 UpdateRunGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRunGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRunGroupInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.MaxCpus != nil && *s.MaxCpus < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxCpus", 1)) - } - if s.MaxDuration != nil && *s.MaxDuration < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxDuration", 1)) - } - if s.MaxGpus != nil && *s.MaxGpus < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxGpus", 1)) - } - if s.MaxRuns != nil && *s.MaxRuns < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxRuns", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *UpdateRunGroupInput) SetId(v string) *UpdateRunGroupInput { - s.Id = &v - return s -} - -// SetMaxCpus sets the MaxCpus field's value. -func (s *UpdateRunGroupInput) SetMaxCpus(v int64) *UpdateRunGroupInput { - s.MaxCpus = &v - return s -} - -// SetMaxDuration sets the MaxDuration field's value. -func (s *UpdateRunGroupInput) SetMaxDuration(v int64) *UpdateRunGroupInput { - s.MaxDuration = &v - return s -} - -// SetMaxGpus sets the MaxGpus field's value. -func (s *UpdateRunGroupInput) SetMaxGpus(v int64) *UpdateRunGroupInput { - s.MaxGpus = &v - return s -} - -// SetMaxRuns sets the MaxRuns field's value. -func (s *UpdateRunGroupInput) SetMaxRuns(v int64) *UpdateRunGroupInput { - s.MaxRuns = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateRunGroupInput) SetName(v string) *UpdateRunGroupInput { - s.Name = &v - return s -} - -type UpdateRunGroupOutput 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 UpdateRunGroupOutput) 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 UpdateRunGroupOutput) GoString() string { - return s.String() -} - -type UpdateVariantStoreInput struct { - _ struct{} `type:"structure"` - - // A description for the store. - Description *string `locationName:"description" type:"string"` - - // A name for the store. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" 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 UpdateVariantStoreInput) 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 UpdateVariantStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVariantStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVariantStoreInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateVariantStoreInput) SetDescription(v string) *UpdateVariantStoreInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateVariantStoreInput) SetName(v string) *UpdateVariantStoreInput { - s.Name = &v - return s -} - -type UpdateVariantStoreOutput struct { - _ struct{} `type:"structure"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The store's name. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The store's genome reference. - // - // Reference is a required field - Reference *ReferenceItem `locationName:"reference" type:"structure" required:"true"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` - - // When the store was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 UpdateVariantStoreOutput) 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 UpdateVariantStoreOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *UpdateVariantStoreOutput) SetCreationTime(v time.Time) *UpdateVariantStoreOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateVariantStoreOutput) SetDescription(v string) *UpdateVariantStoreOutput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateVariantStoreOutput) SetId(v string) *UpdateVariantStoreOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateVariantStoreOutput) SetName(v string) *UpdateVariantStoreOutput { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *UpdateVariantStoreOutput) SetReference(v *ReferenceItem) *UpdateVariantStoreOutput { - s.Reference = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateVariantStoreOutput) SetStatus(v string) *UpdateVariantStoreOutput { - s.Status = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *UpdateVariantStoreOutput) SetUpdateTime(v time.Time) *UpdateVariantStoreOutput { - s.UpdateTime = &v - return s -} - -type UpdateWorkflowInput struct { - _ struct{} `type:"structure"` - - // A description for the workflow. - Description *string `locationName:"description" min:"1" type:"string"` - - // The workflow's ID. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" min:"1" type:"string" required:"true"` - - // A name for the workflow. - Name *string `locationName:"name" min:"1" 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 UpdateWorkflowInput) 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 UpdateWorkflowInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWorkflowInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWorkflowInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateWorkflowInput) SetDescription(v string) *UpdateWorkflowInput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateWorkflowInput) SetId(v string) *UpdateWorkflowInput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateWorkflowInput) SetName(v string) *UpdateWorkflowInput { - s.Name = &v - return s -} - -type UpdateWorkflowOutput 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 UpdateWorkflowOutput) 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 UpdateWorkflowOutput) GoString() string { - return s.String() -} - -type UploadReadSetPartInput struct { - _ struct{} `type:"structure" payload:"Payload"` - - // The number of the part being uploaded. - // - // PartNumber is a required field - PartNumber *int64 `location:"querystring" locationName:"partNumber" min:"1" type:"integer" required:"true"` - - // The source file for an upload part. - // - // PartSource is a required field - PartSource *string `location:"querystring" locationName:"partSource" type:"string" required:"true" enum:"ReadSetPartSource"` - - // The read set data to upload for a part. - // - // To use an non-seekable io.Reader for this request wrap the io.Reader with - // "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable - // readers. This will allow the SDK to send the reader's payload as chunked - // transfer encoding. - // - // Payload is a required field - Payload io.ReadSeeker `locationName:"payload" type:"blob" required:"true"` - - // The Sequence Store ID used for the multipart upload. - // - // SequenceStoreId is a required field - SequenceStoreId *string `location:"uri" locationName:"sequenceStoreId" min:"10" type:"string" required:"true"` - - // The ID for the initiated multipart upload. - // - // UploadId is a required field - UploadId *string `location:"uri" locationName:"uploadId" min:"10" 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 UploadReadSetPartInput) 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 UploadReadSetPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadReadSetPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadReadSetPartInput"} - if s.PartNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PartNumber")) - } - if s.PartNumber != nil && *s.PartNumber < 1 { - invalidParams.Add(request.NewErrParamMinValue("PartNumber", 1)) - } - if s.PartSource == nil { - invalidParams.Add(request.NewErrParamRequired("PartSource")) - } - if s.Payload == nil { - invalidParams.Add(request.NewErrParamRequired("Payload")) - } - if s.SequenceStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("SequenceStoreId")) - } - if s.SequenceStoreId != nil && len(*s.SequenceStoreId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("SequenceStoreId", 10)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.UploadId != nil && len(*s.UploadId) < 10 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPartNumber sets the PartNumber field's value. -func (s *UploadReadSetPartInput) SetPartNumber(v int64) *UploadReadSetPartInput { - s.PartNumber = &v - return s -} - -// SetPartSource sets the PartSource field's value. -func (s *UploadReadSetPartInput) SetPartSource(v string) *UploadReadSetPartInput { - s.PartSource = &v - return s -} - -// SetPayload sets the Payload field's value. -func (s *UploadReadSetPartInput) SetPayload(v io.ReadSeeker) *UploadReadSetPartInput { - s.Payload = v - return s -} - -// SetSequenceStoreId sets the SequenceStoreId field's value. -func (s *UploadReadSetPartInput) SetSequenceStoreId(v string) *UploadReadSetPartInput { - s.SequenceStoreId = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UploadReadSetPartInput) SetUploadId(v string) *UploadReadSetPartInput { - s.UploadId = &v - return s -} - -type UploadReadSetPartOutput struct { - _ struct{} `type:"structure"` - - // An identifier used to confirm that parts are being added to the intended - // upload. - // - // Checksum is a required field - Checksum *string `locationName:"checksum" 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 UploadReadSetPartOutput) 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 UploadReadSetPartOutput) GoString() string { - return s.String() -} - -// SetChecksum sets the Checksum field's value. -func (s *UploadReadSetPartOutput) SetChecksum(v string) *UploadReadSetPartOutput { - s.Checksum = &v - return s -} - -// The input fails to satisfy the constraints specified by an AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Details about an imported variant item. -type VariantImportItemDetail struct { - _ struct{} `type:"structure"` - - // The item's job status. - // - // JobStatus is a required field - JobStatus *string `locationName:"jobStatus" type:"string" required:"true" enum:"JobStatus"` - - // The source file's location in Amazon S3. - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true"` - - // A message that provides additional context about a job - StatusMessage *string `locationName:"statusMessage" 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 VariantImportItemDetail) 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 VariantImportItemDetail) GoString() string { - return s.String() -} - -// SetJobStatus sets the JobStatus field's value. -func (s *VariantImportItemDetail) SetJobStatus(v string) *VariantImportItemDetail { - s.JobStatus = &v - return s -} - -// SetSource sets the Source field's value. -func (s *VariantImportItemDetail) SetSource(v string) *VariantImportItemDetail { - s.Source = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VariantImportItemDetail) SetStatusMessage(v string) *VariantImportItemDetail { - s.StatusMessage = &v - return s -} - -// A imported variant item's source. -type VariantImportItemSource struct { - _ struct{} `type:"structure"` - - // The source file's location in Amazon S3. - // - // Source is a required field - Source *string `locationName:"source" 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 VariantImportItemSource) 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 VariantImportItemSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VariantImportItemSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VariantImportItemSource"} - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSource sets the Source field's value. -func (s *VariantImportItemSource) SetSource(v string) *VariantImportItemSource { - s.Source = &v - return s -} - -// A variant import job. -type VariantImportJobItem struct { - _ struct{} `type:"structure"` - - // The annotation schema generated by the parsed annotation data. - AnnotationFields map[string]*string `locationName:"annotationFields" type:"map"` - - // When the job completed. - CompletionTime *time.Time `locationName:"completionTime" type:"timestamp" timestampFormat:"iso8601"` - - // When the job was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The job's destination variant store. - // - // DestinationName is a required field - DestinationName *string `locationName:"destinationName" type:"string" required:"true"` - - // The job's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The job's service role ARN. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" min:"20" type:"string" required:"true"` - - // The job's left normalization setting. - RunLeftNormalization *bool `locationName:"runLeftNormalization" type:"boolean"` - - // The job's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"JobStatus"` - - // When the job was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 VariantImportJobItem) 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 VariantImportJobItem) GoString() string { - return s.String() -} - -// SetAnnotationFields sets the AnnotationFields field's value. -func (s *VariantImportJobItem) SetAnnotationFields(v map[string]*string) *VariantImportJobItem { - s.AnnotationFields = v - return s -} - -// SetCompletionTime sets the CompletionTime field's value. -func (s *VariantImportJobItem) SetCompletionTime(v time.Time) *VariantImportJobItem { - s.CompletionTime = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *VariantImportJobItem) SetCreationTime(v time.Time) *VariantImportJobItem { - s.CreationTime = &v - return s -} - -// SetDestinationName sets the DestinationName field's value. -func (s *VariantImportJobItem) SetDestinationName(v string) *VariantImportJobItem { - s.DestinationName = &v - return s -} - -// SetId sets the Id field's value. -func (s *VariantImportJobItem) SetId(v string) *VariantImportJobItem { - s.Id = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *VariantImportJobItem) SetRoleArn(v string) *VariantImportJobItem { - s.RoleArn = &v - return s -} - -// SetRunLeftNormalization sets the RunLeftNormalization field's value. -func (s *VariantImportJobItem) SetRunLeftNormalization(v bool) *VariantImportJobItem { - s.RunLeftNormalization = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VariantImportJobItem) SetStatus(v string) *VariantImportJobItem { - s.Status = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *VariantImportJobItem) SetUpdateTime(v time.Time) *VariantImportJobItem { - s.UpdateTime = &v - return s -} - -// A variant store. -type VariantStoreItem struct { - _ struct{} `type:"structure"` - - // When the store was created. - // - // CreationTime is a required field - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The store's description. - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The store's ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The store's name. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The store's genome reference. - // - // Reference is a required field - Reference *ReferenceItem `locationName:"reference" type:"structure" required:"true"` - - // The store's server-side encryption (SSE) settings. - // - // SseConfig is a required field - SseConfig *SseConfig `locationName:"sseConfig" type:"structure" required:"true"` - - // The store's status. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"StoreStatus"` - - // The store's status message. - // - // StatusMessage is a required field - StatusMessage *string `locationName:"statusMessage" type:"string" required:"true"` - - // The store's ARN. - // - // StoreArn is a required field - StoreArn *string `locationName:"storeArn" min:"20" type:"string" required:"true"` - - // The store's size in bytes. - // - // StoreSizeBytes is a required field - StoreSizeBytes *int64 `locationName:"storeSizeBytes" type:"long" required:"true"` - - // When the store was updated. - // - // UpdateTime is a required field - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" timestampFormat:"iso8601" 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 VariantStoreItem) 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 VariantStoreItem) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *VariantStoreItem) SetCreationTime(v time.Time) *VariantStoreItem { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *VariantStoreItem) SetDescription(v string) *VariantStoreItem { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *VariantStoreItem) SetId(v string) *VariantStoreItem { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *VariantStoreItem) SetName(v string) *VariantStoreItem { - s.Name = &v - return s -} - -// SetReference sets the Reference field's value. -func (s *VariantStoreItem) SetReference(v *ReferenceItem) *VariantStoreItem { - s.Reference = v - return s -} - -// SetSseConfig sets the SseConfig field's value. -func (s *VariantStoreItem) SetSseConfig(v *SseConfig) *VariantStoreItem { - s.SseConfig = v - return s -} - -// SetStatus sets the Status field's value. -func (s *VariantStoreItem) SetStatus(v string) *VariantStoreItem { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *VariantStoreItem) SetStatusMessage(v string) *VariantStoreItem { - s.StatusMessage = &v - return s -} - -// SetStoreArn sets the StoreArn field's value. -func (s *VariantStoreItem) SetStoreArn(v string) *VariantStoreItem { - s.StoreArn = &v - return s -} - -// SetStoreSizeBytes sets the StoreSizeBytes field's value. -func (s *VariantStoreItem) SetStoreSizeBytes(v int64) *VariantStoreItem { - s.StoreSizeBytes = &v - return s -} - -// SetUpdateTime sets the UpdateTime field's value. -func (s *VariantStoreItem) SetUpdateTime(v time.Time) *VariantStoreItem { - s.UpdateTime = &v - return s -} - -// Formatting options for a VCF file. -type VcfOptions struct { - _ struct{} `type:"structure"` - - // The file's ignore filter field setting. - IgnoreFilterField *bool `locationName:"ignoreFilterField" type:"boolean"` - - // The file's ignore qual field setting. - IgnoreQualField *bool `locationName:"ignoreQualField" type:"boolean"` -} - -// 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 VcfOptions) 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 VcfOptions) GoString() string { - return s.String() -} - -// SetIgnoreFilterField sets the IgnoreFilterField field's value. -func (s *VcfOptions) SetIgnoreFilterField(v bool) *VcfOptions { - s.IgnoreFilterField = &v - return s -} - -// SetIgnoreQualField sets the IgnoreQualField field's value. -func (s *VcfOptions) SetIgnoreQualField(v bool) *VcfOptions { - s.IgnoreQualField = &v - return s -} - -// The error preventing deletion of the annotation store version. -type VersionDeleteError struct { - _ struct{} `type:"structure"` - - // The message explaining the error in annotation store deletion. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name given to an annotation store version. - // - // VersionName is a required field - VersionName *string `locationName:"versionName" min:"3" 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 VersionDeleteError) 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 VersionDeleteError) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *VersionDeleteError) SetMessage(v string) *VersionDeleteError { - s.Message = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *VersionDeleteError) SetVersionName(v string) *VersionDeleteError { - s.VersionName = &v - return s -} - -// The options for an annotation store version. -type VersionOptions struct { - _ struct{} `type:"structure"` - - // File settings for a version of a TSV store. - TsvVersionOptions *TsvVersionOptions `locationName:"tsvVersionOptions" 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 VersionOptions) 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 VersionOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VersionOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VersionOptions"} - if s.TsvVersionOptions != nil { - if err := s.TsvVersionOptions.Validate(); err != nil { - invalidParams.AddNested("TsvVersionOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTsvVersionOptions sets the TsvVersionOptions field's value. -func (s *VersionOptions) SetTsvVersionOptions(v *TsvVersionOptions) *VersionOptions { - s.TsvVersionOptions = v - return s -} - -// A workflow. -type WorkflowListItem struct { - _ struct{} `type:"structure"` - - // The workflow's ARN. - Arn *string `locationName:"arn" min:"1" type:"string"` - - // When the workflow was created. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp" timestampFormat:"iso8601"` - - // The workflow's digest. - Digest *string `locationName:"digest" min:"1" type:"string"` - - // The workflow's ID. - Id *string `locationName:"id" min:"1" type:"string"` - - // Any metadata available for workflow. The information listed may vary depending - // on the workflow, and there may also be no metadata to return. - Metadata map[string]*string `locationName:"metadata" type:"map"` - - // The workflow's name. - Name *string `locationName:"name" min:"1" type:"string"` - - // The workflow's status. - Status *string `locationName:"status" min:"1" type:"string" enum:"WorkflowStatus"` - - // The workflow's type. - Type *string `locationName:"type" min:"1" type:"string" enum:"WorkflowType"` -} - -// 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 WorkflowListItem) 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 WorkflowListItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *WorkflowListItem) SetArn(v string) *WorkflowListItem { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *WorkflowListItem) SetCreationTime(v time.Time) *WorkflowListItem { - s.CreationTime = &v - return s -} - -// SetDigest sets the Digest field's value. -func (s *WorkflowListItem) SetDigest(v string) *WorkflowListItem { - s.Digest = &v - return s -} - -// SetId sets the Id field's value. -func (s *WorkflowListItem) SetId(v string) *WorkflowListItem { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *WorkflowListItem) SetMetadata(v map[string]*string) *WorkflowListItem { - s.Metadata = v - return s -} - -// SetName sets the Name field's value. -func (s *WorkflowListItem) SetName(v string) *WorkflowListItem { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *WorkflowListItem) SetStatus(v string) *WorkflowListItem { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *WorkflowListItem) SetType(v string) *WorkflowListItem { - s.Type = &v - return s -} - -// A workflow parameter. -type WorkflowParameter struct { - _ struct{} `type:"structure"` - - // The parameter's description. - Description *string `locationName:"description" type:"string"` - - // Whether the parameter is optional. - Optional *bool `locationName:"optional" type:"boolean"` -} - -// 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 WorkflowParameter) 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 WorkflowParameter) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *WorkflowParameter) SetDescription(v string) *WorkflowParameter { - s.Description = &v - return s -} - -// SetOptional sets the Optional field's value. -func (s *WorkflowParameter) SetOptional(v bool) *WorkflowParameter { - s.Optional = &v - return s -} - -const ( - // AcceleratorsGpu is a Accelerators enum value - AcceleratorsGpu = "GPU" -) - -// Accelerators_Values returns all elements of the Accelerators enum -func Accelerators_Values() []string { - return []string{ - AcceleratorsGpu, - } -} - -const ( - // AnnotationTypeGeneric is a AnnotationType enum value - AnnotationTypeGeneric = "GENERIC" - - // AnnotationTypeChrPos is a AnnotationType enum value - AnnotationTypeChrPos = "CHR_POS" - - // AnnotationTypeChrPosRefAlt is a AnnotationType enum value - AnnotationTypeChrPosRefAlt = "CHR_POS_REF_ALT" - - // AnnotationTypeChrStartEndOneBase is a AnnotationType enum value - AnnotationTypeChrStartEndOneBase = "CHR_START_END_ONE_BASE" - - // AnnotationTypeChrStartEndRefAltOneBase is a AnnotationType enum value - AnnotationTypeChrStartEndRefAltOneBase = "CHR_START_END_REF_ALT_ONE_BASE" - - // AnnotationTypeChrStartEndZeroBase is a AnnotationType enum value - AnnotationTypeChrStartEndZeroBase = "CHR_START_END_ZERO_BASE" - - // AnnotationTypeChrStartEndRefAltZeroBase is a AnnotationType enum value - AnnotationTypeChrStartEndRefAltZeroBase = "CHR_START_END_REF_ALT_ZERO_BASE" -) - -// AnnotationType_Values returns all elements of the AnnotationType enum -func AnnotationType_Values() []string { - return []string{ - AnnotationTypeGeneric, - AnnotationTypeChrPos, - AnnotationTypeChrPosRefAlt, - AnnotationTypeChrStartEndOneBase, - AnnotationTypeChrStartEndRefAltOneBase, - AnnotationTypeChrStartEndZeroBase, - AnnotationTypeChrStartEndRefAltZeroBase, - } -} - -const ( - // CreationTypeImport is a CreationType enum value - CreationTypeImport = "IMPORT" - - // CreationTypeUpload is a CreationType enum value - CreationTypeUpload = "UPLOAD" -) - -// CreationType_Values returns all elements of the CreationType enum -func CreationType_Values() []string { - return []string{ - CreationTypeImport, - CreationTypeUpload, - } -} - -const ( - // ETagAlgorithmFastqMd5up is a ETagAlgorithm enum value - ETagAlgorithmFastqMd5up = "FASTQ_MD5up" - - // ETagAlgorithmBamMd5up is a ETagAlgorithm enum value - ETagAlgorithmBamMd5up = "BAM_MD5up" - - // ETagAlgorithmCramMd5up is a ETagAlgorithm enum value - ETagAlgorithmCramMd5up = "CRAM_MD5up" -) - -// ETagAlgorithm_Values returns all elements of the ETagAlgorithm enum -func ETagAlgorithm_Values() []string { - return []string{ - ETagAlgorithmFastqMd5up, - ETagAlgorithmBamMd5up, - ETagAlgorithmCramMd5up, - } -} - -const ( - // EncryptionTypeKms is a EncryptionType enum value - EncryptionTypeKms = "KMS" -) - -// EncryptionType_Values returns all elements of the EncryptionType enum -func EncryptionType_Values() []string { - return []string{ - EncryptionTypeKms, - } -} - -const ( - // FileTypeFastq is a FileType enum value - FileTypeFastq = "FASTQ" - - // FileTypeBam is a FileType enum value - FileTypeBam = "BAM" - - // FileTypeCram is a FileType enum value - FileTypeCram = "CRAM" - - // FileTypeUbam is a FileType enum value - FileTypeUbam = "UBAM" -) - -// FileType_Values returns all elements of the FileType enum -func FileType_Values() []string { - return []string{ - FileTypeFastq, - FileTypeBam, - FileTypeCram, - FileTypeUbam, - } -} - -const ( - // FormatToHeaderKeyChr is a FormatToHeaderKey enum value - FormatToHeaderKeyChr = "CHR" - - // FormatToHeaderKeyStart is a FormatToHeaderKey enum value - FormatToHeaderKeyStart = "START" - - // FormatToHeaderKeyEnd is a FormatToHeaderKey enum value - FormatToHeaderKeyEnd = "END" - - // FormatToHeaderKeyRef is a FormatToHeaderKey enum value - FormatToHeaderKeyRef = "REF" - - // FormatToHeaderKeyAlt is a FormatToHeaderKey enum value - FormatToHeaderKeyAlt = "ALT" - - // FormatToHeaderKeyPos is a FormatToHeaderKey enum value - FormatToHeaderKeyPos = "POS" -) - -// FormatToHeaderKey_Values returns all elements of the FormatToHeaderKey enum -func FormatToHeaderKey_Values() []string { - return []string{ - FormatToHeaderKeyChr, - FormatToHeaderKeyStart, - FormatToHeaderKeyEnd, - FormatToHeaderKeyRef, - FormatToHeaderKeyAlt, - FormatToHeaderKeyPos, - } -} - -const ( - // JobStatusSubmitted is a JobStatus enum value - JobStatusSubmitted = "SUBMITTED" - - // JobStatusInProgress is a JobStatus enum value - JobStatusInProgress = "IN_PROGRESS" - - // JobStatusCancelled is a JobStatus enum value - JobStatusCancelled = "CANCELLED" - - // JobStatusCompleted is a JobStatus enum value - JobStatusCompleted = "COMPLETED" - - // JobStatusFailed is a JobStatus enum value - JobStatusFailed = "FAILED" - - // JobStatusCompletedWithFailures is a JobStatus enum value - JobStatusCompletedWithFailures = "COMPLETED_WITH_FAILURES" -) - -// JobStatus_Values returns all elements of the JobStatus enum -func JobStatus_Values() []string { - return []string{ - JobStatusSubmitted, - JobStatusInProgress, - JobStatusCancelled, - JobStatusCompleted, - JobStatusFailed, - JobStatusCompletedWithFailures, - } -} - -const ( - // ReadSetActivationJobItemStatusNotStarted is a ReadSetActivationJobItemStatus enum value - ReadSetActivationJobItemStatusNotStarted = "NOT_STARTED" - - // ReadSetActivationJobItemStatusInProgress is a ReadSetActivationJobItemStatus enum value - ReadSetActivationJobItemStatusInProgress = "IN_PROGRESS" - - // ReadSetActivationJobItemStatusFinished is a ReadSetActivationJobItemStatus enum value - ReadSetActivationJobItemStatusFinished = "FINISHED" - - // ReadSetActivationJobItemStatusFailed is a ReadSetActivationJobItemStatus enum value - ReadSetActivationJobItemStatusFailed = "FAILED" -) - -// ReadSetActivationJobItemStatus_Values returns all elements of the ReadSetActivationJobItemStatus enum -func ReadSetActivationJobItemStatus_Values() []string { - return []string{ - ReadSetActivationJobItemStatusNotStarted, - ReadSetActivationJobItemStatusInProgress, - ReadSetActivationJobItemStatusFinished, - ReadSetActivationJobItemStatusFailed, - } -} - -const ( - // ReadSetActivationJobStatusSubmitted is a ReadSetActivationJobStatus enum value - ReadSetActivationJobStatusSubmitted = "SUBMITTED" - - // ReadSetActivationJobStatusInProgress is a ReadSetActivationJobStatus enum value - ReadSetActivationJobStatusInProgress = "IN_PROGRESS" - - // ReadSetActivationJobStatusCancelling is a ReadSetActivationJobStatus enum value - ReadSetActivationJobStatusCancelling = "CANCELLING" - - // ReadSetActivationJobStatusCancelled is a ReadSetActivationJobStatus enum value - ReadSetActivationJobStatusCancelled = "CANCELLED" - - // ReadSetActivationJobStatusFailed is a ReadSetActivationJobStatus enum value - ReadSetActivationJobStatusFailed = "FAILED" - - // ReadSetActivationJobStatusCompleted is a ReadSetActivationJobStatus enum value - ReadSetActivationJobStatusCompleted = "COMPLETED" - - // ReadSetActivationJobStatusCompletedWithFailures is a ReadSetActivationJobStatus enum value - ReadSetActivationJobStatusCompletedWithFailures = "COMPLETED_WITH_FAILURES" -) - -// ReadSetActivationJobStatus_Values returns all elements of the ReadSetActivationJobStatus enum -func ReadSetActivationJobStatus_Values() []string { - return []string{ - ReadSetActivationJobStatusSubmitted, - ReadSetActivationJobStatusInProgress, - ReadSetActivationJobStatusCancelling, - ReadSetActivationJobStatusCancelled, - ReadSetActivationJobStatusFailed, - ReadSetActivationJobStatusCompleted, - ReadSetActivationJobStatusCompletedWithFailures, - } -} - -const ( - // ReadSetExportJobItemStatusNotStarted is a ReadSetExportJobItemStatus enum value - ReadSetExportJobItemStatusNotStarted = "NOT_STARTED" - - // ReadSetExportJobItemStatusInProgress is a ReadSetExportJobItemStatus enum value - ReadSetExportJobItemStatusInProgress = "IN_PROGRESS" - - // ReadSetExportJobItemStatusFinished is a ReadSetExportJobItemStatus enum value - ReadSetExportJobItemStatusFinished = "FINISHED" - - // ReadSetExportJobItemStatusFailed is a ReadSetExportJobItemStatus enum value - ReadSetExportJobItemStatusFailed = "FAILED" -) - -// ReadSetExportJobItemStatus_Values returns all elements of the ReadSetExportJobItemStatus enum -func ReadSetExportJobItemStatus_Values() []string { - return []string{ - ReadSetExportJobItemStatusNotStarted, - ReadSetExportJobItemStatusInProgress, - ReadSetExportJobItemStatusFinished, - ReadSetExportJobItemStatusFailed, - } -} - -const ( - // ReadSetExportJobStatusSubmitted is a ReadSetExportJobStatus enum value - ReadSetExportJobStatusSubmitted = "SUBMITTED" - - // ReadSetExportJobStatusInProgress is a ReadSetExportJobStatus enum value - ReadSetExportJobStatusInProgress = "IN_PROGRESS" - - // ReadSetExportJobStatusCancelling is a ReadSetExportJobStatus enum value - ReadSetExportJobStatusCancelling = "CANCELLING" - - // ReadSetExportJobStatusCancelled is a ReadSetExportJobStatus enum value - ReadSetExportJobStatusCancelled = "CANCELLED" - - // ReadSetExportJobStatusFailed is a ReadSetExportJobStatus enum value - ReadSetExportJobStatusFailed = "FAILED" - - // ReadSetExportJobStatusCompleted is a ReadSetExportJobStatus enum value - ReadSetExportJobStatusCompleted = "COMPLETED" - - // ReadSetExportJobStatusCompletedWithFailures is a ReadSetExportJobStatus enum value - ReadSetExportJobStatusCompletedWithFailures = "COMPLETED_WITH_FAILURES" -) - -// ReadSetExportJobStatus_Values returns all elements of the ReadSetExportJobStatus enum -func ReadSetExportJobStatus_Values() []string { - return []string{ - ReadSetExportJobStatusSubmitted, - ReadSetExportJobStatusInProgress, - ReadSetExportJobStatusCancelling, - ReadSetExportJobStatusCancelled, - ReadSetExportJobStatusFailed, - ReadSetExportJobStatusCompleted, - ReadSetExportJobStatusCompletedWithFailures, - } -} - -const ( - // ReadSetFileSource1 is a ReadSetFile enum value - ReadSetFileSource1 = "SOURCE1" - - // ReadSetFileSource2 is a ReadSetFile enum value - ReadSetFileSource2 = "SOURCE2" - - // ReadSetFileIndex is a ReadSetFile enum value - ReadSetFileIndex = "INDEX" -) - -// ReadSetFile_Values returns all elements of the ReadSetFile enum -func ReadSetFile_Values() []string { - return []string{ - ReadSetFileSource1, - ReadSetFileSource2, - ReadSetFileIndex, - } -} - -const ( - // ReadSetImportJobItemStatusNotStarted is a ReadSetImportJobItemStatus enum value - ReadSetImportJobItemStatusNotStarted = "NOT_STARTED" - - // ReadSetImportJobItemStatusInProgress is a ReadSetImportJobItemStatus enum value - ReadSetImportJobItemStatusInProgress = "IN_PROGRESS" - - // ReadSetImportJobItemStatusFinished is a ReadSetImportJobItemStatus enum value - ReadSetImportJobItemStatusFinished = "FINISHED" - - // ReadSetImportJobItemStatusFailed is a ReadSetImportJobItemStatus enum value - ReadSetImportJobItemStatusFailed = "FAILED" -) - -// ReadSetImportJobItemStatus_Values returns all elements of the ReadSetImportJobItemStatus enum -func ReadSetImportJobItemStatus_Values() []string { - return []string{ - ReadSetImportJobItemStatusNotStarted, - ReadSetImportJobItemStatusInProgress, - ReadSetImportJobItemStatusFinished, - ReadSetImportJobItemStatusFailed, - } -} - -const ( - // ReadSetImportJobStatusSubmitted is a ReadSetImportJobStatus enum value - ReadSetImportJobStatusSubmitted = "SUBMITTED" - - // ReadSetImportJobStatusInProgress is a ReadSetImportJobStatus enum value - ReadSetImportJobStatusInProgress = "IN_PROGRESS" - - // ReadSetImportJobStatusCancelling is a ReadSetImportJobStatus enum value - ReadSetImportJobStatusCancelling = "CANCELLING" - - // ReadSetImportJobStatusCancelled is a ReadSetImportJobStatus enum value - ReadSetImportJobStatusCancelled = "CANCELLED" - - // ReadSetImportJobStatusFailed is a ReadSetImportJobStatus enum value - ReadSetImportJobStatusFailed = "FAILED" - - // ReadSetImportJobStatusCompleted is a ReadSetImportJobStatus enum value - ReadSetImportJobStatusCompleted = "COMPLETED" - - // ReadSetImportJobStatusCompletedWithFailures is a ReadSetImportJobStatus enum value - ReadSetImportJobStatusCompletedWithFailures = "COMPLETED_WITH_FAILURES" -) - -// ReadSetImportJobStatus_Values returns all elements of the ReadSetImportJobStatus enum -func ReadSetImportJobStatus_Values() []string { - return []string{ - ReadSetImportJobStatusSubmitted, - ReadSetImportJobStatusInProgress, - ReadSetImportJobStatusCancelling, - ReadSetImportJobStatusCancelled, - ReadSetImportJobStatusFailed, - ReadSetImportJobStatusCompleted, - ReadSetImportJobStatusCompletedWithFailures, - } -} - -const ( - // ReadSetPartSourceSource1 is a ReadSetPartSource enum value - ReadSetPartSourceSource1 = "SOURCE1" - - // ReadSetPartSourceSource2 is a ReadSetPartSource enum value - ReadSetPartSourceSource2 = "SOURCE2" -) - -// ReadSetPartSource_Values returns all elements of the ReadSetPartSource enum -func ReadSetPartSource_Values() []string { - return []string{ - ReadSetPartSourceSource1, - ReadSetPartSourceSource2, - } -} - -const ( - // ReadSetStatusArchived is a ReadSetStatus enum value - ReadSetStatusArchived = "ARCHIVED" - - // ReadSetStatusActivating is a ReadSetStatus enum value - ReadSetStatusActivating = "ACTIVATING" - - // ReadSetStatusActive is a ReadSetStatus enum value - ReadSetStatusActive = "ACTIVE" - - // ReadSetStatusDeleting is a ReadSetStatus enum value - ReadSetStatusDeleting = "DELETING" - - // ReadSetStatusDeleted is a ReadSetStatus enum value - ReadSetStatusDeleted = "DELETED" - - // ReadSetStatusProcessingUpload is a ReadSetStatus enum value - ReadSetStatusProcessingUpload = "PROCESSING_UPLOAD" - - // ReadSetStatusUploadFailed is a ReadSetStatus enum value - ReadSetStatusUploadFailed = "UPLOAD_FAILED" -) - -// ReadSetStatus_Values returns all elements of the ReadSetStatus enum -func ReadSetStatus_Values() []string { - return []string{ - ReadSetStatusArchived, - ReadSetStatusActivating, - ReadSetStatusActive, - ReadSetStatusDeleting, - ReadSetStatusDeleted, - ReadSetStatusProcessingUpload, - ReadSetStatusUploadFailed, - } -} - -const ( - // ReferenceFileSource is a ReferenceFile enum value - ReferenceFileSource = "SOURCE" - - // ReferenceFileIndex is a ReferenceFile enum value - ReferenceFileIndex = "INDEX" -) - -// ReferenceFile_Values returns all elements of the ReferenceFile enum -func ReferenceFile_Values() []string { - return []string{ - ReferenceFileSource, - ReferenceFileIndex, - } -} - -const ( - // ReferenceImportJobItemStatusNotStarted is a ReferenceImportJobItemStatus enum value - ReferenceImportJobItemStatusNotStarted = "NOT_STARTED" - - // ReferenceImportJobItemStatusInProgress is a ReferenceImportJobItemStatus enum value - ReferenceImportJobItemStatusInProgress = "IN_PROGRESS" - - // ReferenceImportJobItemStatusFinished is a ReferenceImportJobItemStatus enum value - ReferenceImportJobItemStatusFinished = "FINISHED" - - // ReferenceImportJobItemStatusFailed is a ReferenceImportJobItemStatus enum value - ReferenceImportJobItemStatusFailed = "FAILED" -) - -// ReferenceImportJobItemStatus_Values returns all elements of the ReferenceImportJobItemStatus enum -func ReferenceImportJobItemStatus_Values() []string { - return []string{ - ReferenceImportJobItemStatusNotStarted, - ReferenceImportJobItemStatusInProgress, - ReferenceImportJobItemStatusFinished, - ReferenceImportJobItemStatusFailed, - } -} - -const ( - // ReferenceImportJobStatusSubmitted is a ReferenceImportJobStatus enum value - ReferenceImportJobStatusSubmitted = "SUBMITTED" - - // ReferenceImportJobStatusInProgress is a ReferenceImportJobStatus enum value - ReferenceImportJobStatusInProgress = "IN_PROGRESS" - - // ReferenceImportJobStatusCancelling is a ReferenceImportJobStatus enum value - ReferenceImportJobStatusCancelling = "CANCELLING" - - // ReferenceImportJobStatusCancelled is a ReferenceImportJobStatus enum value - ReferenceImportJobStatusCancelled = "CANCELLED" - - // ReferenceImportJobStatusFailed is a ReferenceImportJobStatus enum value - ReferenceImportJobStatusFailed = "FAILED" - - // ReferenceImportJobStatusCompleted is a ReferenceImportJobStatus enum value - ReferenceImportJobStatusCompleted = "COMPLETED" - - // ReferenceImportJobStatusCompletedWithFailures is a ReferenceImportJobStatus enum value - ReferenceImportJobStatusCompletedWithFailures = "COMPLETED_WITH_FAILURES" -) - -// ReferenceImportJobStatus_Values returns all elements of the ReferenceImportJobStatus enum -func ReferenceImportJobStatus_Values() []string { - return []string{ - ReferenceImportJobStatusSubmitted, - ReferenceImportJobStatusInProgress, - ReferenceImportJobStatusCancelling, - ReferenceImportJobStatusCancelled, - ReferenceImportJobStatusFailed, - ReferenceImportJobStatusCompleted, - ReferenceImportJobStatusCompletedWithFailures, - } -} - -const ( - // ReferenceStatusActive is a ReferenceStatus enum value - ReferenceStatusActive = "ACTIVE" - - // ReferenceStatusDeleting is a ReferenceStatus enum value - ReferenceStatusDeleting = "DELETING" - - // ReferenceStatusDeleted is a ReferenceStatus enum value - ReferenceStatusDeleted = "DELETED" -) - -// ReferenceStatus_Values returns all elements of the ReferenceStatus enum -func ReferenceStatus_Values() []string { - return []string{ - ReferenceStatusActive, - ReferenceStatusDeleting, - ReferenceStatusDeleted, - } -} - -const ( - // ResourceOwnerSelf is a ResourceOwner enum value - ResourceOwnerSelf = "SELF" - - // ResourceOwnerOther is a ResourceOwner enum value - ResourceOwnerOther = "OTHER" -) - -// ResourceOwner_Values returns all elements of the ResourceOwner enum -func ResourceOwner_Values() []string { - return []string{ - ResourceOwnerSelf, - ResourceOwnerOther, - } -} - -const ( - // RunExportDefinition is a RunExport enum value - RunExportDefinition = "DEFINITION" -) - -// RunExport_Values returns all elements of the RunExport enum -func RunExport_Values() []string { - return []string{ - RunExportDefinition, - } -} - -const ( - // RunLogLevelOff is a RunLogLevel enum value - RunLogLevelOff = "OFF" - - // RunLogLevelFatal is a RunLogLevel enum value - RunLogLevelFatal = "FATAL" - - // RunLogLevelError is a RunLogLevel enum value - RunLogLevelError = "ERROR" - - // RunLogLevelAll is a RunLogLevel enum value - RunLogLevelAll = "ALL" -) - -// RunLogLevel_Values returns all elements of the RunLogLevel enum -func RunLogLevel_Values() []string { - return []string{ - RunLogLevelOff, - RunLogLevelFatal, - RunLogLevelError, - RunLogLevelAll, - } -} - -const ( - // RunRetentionModeRetain is a RunRetentionMode enum value - RunRetentionModeRetain = "RETAIN" - - // RunRetentionModeRemove is a RunRetentionMode enum value - RunRetentionModeRemove = "REMOVE" -) - -// RunRetentionMode_Values returns all elements of the RunRetentionMode enum -func RunRetentionMode_Values() []string { - return []string{ - RunRetentionModeRetain, - RunRetentionModeRemove, - } -} - -const ( - // RunStatusPending is a RunStatus enum value - RunStatusPending = "PENDING" - - // RunStatusStarting is a RunStatus enum value - RunStatusStarting = "STARTING" - - // RunStatusRunning is a RunStatus enum value - RunStatusRunning = "RUNNING" - - // RunStatusStopping is a RunStatus enum value - RunStatusStopping = "STOPPING" - - // RunStatusCompleted is a RunStatus enum value - RunStatusCompleted = "COMPLETED" - - // RunStatusDeleted is a RunStatus enum value - RunStatusDeleted = "DELETED" - - // RunStatusCancelled is a RunStatus enum value - RunStatusCancelled = "CANCELLED" - - // RunStatusFailed is a RunStatus enum value - RunStatusFailed = "FAILED" -) - -// RunStatus_Values returns all elements of the RunStatus enum -func RunStatus_Values() []string { - return []string{ - RunStatusPending, - RunStatusStarting, - RunStatusRunning, - RunStatusStopping, - RunStatusCompleted, - RunStatusDeleted, - RunStatusCancelled, - RunStatusFailed, - } -} - -const ( - // SchemaValueTypeLong is a SchemaValueType enum value - SchemaValueTypeLong = "LONG" - - // SchemaValueTypeInt is a SchemaValueType enum value - SchemaValueTypeInt = "INT" - - // SchemaValueTypeString is a SchemaValueType enum value - SchemaValueTypeString = "STRING" - - // SchemaValueTypeFloat is a SchemaValueType enum value - SchemaValueTypeFloat = "FLOAT" - - // SchemaValueTypeDouble is a SchemaValueType enum value - SchemaValueTypeDouble = "DOUBLE" - - // SchemaValueTypeBoolean is a SchemaValueType enum value - SchemaValueTypeBoolean = "BOOLEAN" -) - -// SchemaValueType_Values returns all elements of the SchemaValueType enum -func SchemaValueType_Values() []string { - return []string{ - SchemaValueTypeLong, - SchemaValueTypeInt, - SchemaValueTypeString, - SchemaValueTypeFloat, - SchemaValueTypeDouble, - SchemaValueTypeBoolean, - } -} - -const ( - // ShareStatusPending is a ShareStatus enum value - ShareStatusPending = "PENDING" - - // ShareStatusActivating is a ShareStatus enum value - ShareStatusActivating = "ACTIVATING" - - // ShareStatusActive is a ShareStatus enum value - ShareStatusActive = "ACTIVE" - - // ShareStatusDeleting is a ShareStatus enum value - ShareStatusDeleting = "DELETING" - - // ShareStatusDeleted is a ShareStatus enum value - ShareStatusDeleted = "DELETED" - - // ShareStatusFailed is a ShareStatus enum value - ShareStatusFailed = "FAILED" -) - -// ShareStatus_Values returns all elements of the ShareStatus enum -func ShareStatus_Values() []string { - return []string{ - ShareStatusPending, - ShareStatusActivating, - ShareStatusActive, - ShareStatusDeleting, - ShareStatusDeleted, - ShareStatusFailed, - } -} - -const ( - // StoreFormatGff is a StoreFormat enum value - StoreFormatGff = "GFF" - - // StoreFormatTsv is a StoreFormat enum value - StoreFormatTsv = "TSV" - - // StoreFormatVcf is a StoreFormat enum value - StoreFormatVcf = "VCF" -) - -// StoreFormat_Values returns all elements of the StoreFormat enum -func StoreFormat_Values() []string { - return []string{ - StoreFormatGff, - StoreFormatTsv, - StoreFormatVcf, - } -} - -const ( - // StoreStatusCreating is a StoreStatus enum value - StoreStatusCreating = "CREATING" - - // StoreStatusUpdating is a StoreStatus enum value - StoreStatusUpdating = "UPDATING" - - // StoreStatusDeleting is a StoreStatus enum value - StoreStatusDeleting = "DELETING" - - // StoreStatusActive is a StoreStatus enum value - StoreStatusActive = "ACTIVE" - - // StoreStatusFailed is a StoreStatus enum value - StoreStatusFailed = "FAILED" -) - -// StoreStatus_Values returns all elements of the StoreStatus enum -func StoreStatus_Values() []string { - return []string{ - StoreStatusCreating, - StoreStatusUpdating, - StoreStatusDeleting, - StoreStatusActive, - StoreStatusFailed, - } -} - -const ( - // TaskStatusPending is a TaskStatus enum value - TaskStatusPending = "PENDING" - - // TaskStatusStarting is a TaskStatus enum value - TaskStatusStarting = "STARTING" - - // TaskStatusRunning is a TaskStatus enum value - TaskStatusRunning = "RUNNING" - - // TaskStatusStopping is a TaskStatus enum value - TaskStatusStopping = "STOPPING" - - // TaskStatusCompleted is a TaskStatus enum value - TaskStatusCompleted = "COMPLETED" - - // TaskStatusCancelled is a TaskStatus enum value - TaskStatusCancelled = "CANCELLED" - - // TaskStatusFailed is a TaskStatus enum value - TaskStatusFailed = "FAILED" -) - -// TaskStatus_Values returns all elements of the TaskStatus enum -func TaskStatus_Values() []string { - return []string{ - TaskStatusPending, - TaskStatusStarting, - TaskStatusRunning, - TaskStatusStopping, - TaskStatusCompleted, - TaskStatusCancelled, - TaskStatusFailed, - } -} - -const ( - // VersionStatusCreating is a VersionStatus enum value - VersionStatusCreating = "CREATING" - - // VersionStatusUpdating is a VersionStatus enum value - VersionStatusUpdating = "UPDATING" - - // VersionStatusDeleting is a VersionStatus enum value - VersionStatusDeleting = "DELETING" - - // VersionStatusActive is a VersionStatus enum value - VersionStatusActive = "ACTIVE" - - // VersionStatusFailed is a VersionStatus enum value - VersionStatusFailed = "FAILED" -) - -// VersionStatus_Values returns all elements of the VersionStatus enum -func VersionStatus_Values() []string { - return []string{ - VersionStatusCreating, - VersionStatusUpdating, - VersionStatusDeleting, - VersionStatusActive, - VersionStatusFailed, - } -} - -const ( - // WorkflowEngineWdl is a WorkflowEngine enum value - WorkflowEngineWdl = "WDL" - - // WorkflowEngineNextflow is a WorkflowEngine enum value - WorkflowEngineNextflow = "NEXTFLOW" - - // WorkflowEngineCwl is a WorkflowEngine enum value - WorkflowEngineCwl = "CWL" -) - -// WorkflowEngine_Values returns all elements of the WorkflowEngine enum -func WorkflowEngine_Values() []string { - return []string{ - WorkflowEngineWdl, - WorkflowEngineNextflow, - WorkflowEngineCwl, - } -} - -const ( - // WorkflowExportDefinition is a WorkflowExport enum value - WorkflowExportDefinition = "DEFINITION" -) - -// WorkflowExport_Values returns all elements of the WorkflowExport enum -func WorkflowExport_Values() []string { - return []string{ - WorkflowExportDefinition, - } -} - -const ( - // WorkflowStatusCreating is a WorkflowStatus enum value - WorkflowStatusCreating = "CREATING" - - // WorkflowStatusActive is a WorkflowStatus enum value - WorkflowStatusActive = "ACTIVE" - - // WorkflowStatusUpdating is a WorkflowStatus enum value - WorkflowStatusUpdating = "UPDATING" - - // WorkflowStatusDeleted is a WorkflowStatus enum value - WorkflowStatusDeleted = "DELETED" - - // WorkflowStatusFailed is a WorkflowStatus enum value - WorkflowStatusFailed = "FAILED" - - // WorkflowStatusInactive is a WorkflowStatus enum value - WorkflowStatusInactive = "INACTIVE" -) - -// WorkflowStatus_Values returns all elements of the WorkflowStatus enum -func WorkflowStatus_Values() []string { - return []string{ - WorkflowStatusCreating, - WorkflowStatusActive, - WorkflowStatusUpdating, - WorkflowStatusDeleted, - WorkflowStatusFailed, - WorkflowStatusInactive, - } -} - -const ( - // WorkflowTypePrivate is a WorkflowType enum value - WorkflowTypePrivate = "PRIVATE" - - // WorkflowTypeReady2run is a WorkflowType enum value - WorkflowTypeReady2run = "READY2RUN" -) - -// WorkflowType_Values returns all elements of the WorkflowType enum -func WorkflowType_Values() []string { - return []string{ - WorkflowTypePrivate, - WorkflowTypeReady2run, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/doc.go deleted file mode 100644 index 7a6142084079..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/doc.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package omics provides the client and types for making API -// requests to Amazon Omics. -// -// This is the AWS HealthOmics API Reference. For an introduction to the service, -// see What is AWS HealthOmics? (https://docs.aws.amazon.com/omics/latest/dev/) -// in the AWS HealthOmics User Guide. -// -// See https://docs.aws.amazon.com/goto/WebAPI/omics-2022-11-28 for more information on this service. -// -// See omics package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/omics/ -// -// # Using the Client -// -// To contact Amazon Omics with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Omics client Omics for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/omics/#New -package omics diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/errors.go deleted file mode 100644 index 19307ac1a747..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/errors.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package omics - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request cannot be applied to the target resource in its current state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An unexpected error occurred. Try the request again. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeNotSupportedOperationException for service response error code - // "NotSupportedOperationException". - // - // The operation is not supported by Amazon Omics, or the API does not exist. - ErrCodeNotSupportedOperationException = "NotSupportedOperationException" - - // ErrCodeRangeNotSatisfiableException for service response error code - // "RangeNotSatisfiableException". - // - // The ranges specified in the request are not valid. - ErrCodeRangeNotSatisfiableException = "RangeNotSatisfiableException" - - // ErrCodeRequestTimeoutException for service response error code - // "RequestTimeoutException". - // - // The request timed out. - ErrCodeRequestTimeoutException = "RequestTimeoutException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The target resource was not found in the current Region. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request exceeds a service quota. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "NotSupportedOperationException": newErrorNotSupportedOperationException, - "RangeNotSatisfiableException": newErrorRangeNotSatisfiableException, - "RequestTimeoutException": newErrorRequestTimeoutException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/omicsiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/omicsiface/interface.go deleted file mode 100644 index 555a28eb1985..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/omicsiface/interface.go +++ /dev/null @@ -1,503 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package omicsiface provides an interface to enable mocking the Amazon Omics service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package omicsiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics" -) - -// OmicsAPI provides an interface to enable mocking the -// omics.Omics service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Omics. -// func myFunc(svc omicsiface.OmicsAPI) bool { -// // Make svc.AbortMultipartReadSetUpload request -// } -// -// func main() { -// sess := session.New() -// svc := omics.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockOmicsClient struct { -// omicsiface.OmicsAPI -// } -// func (m *mockOmicsClient) AbortMultipartReadSetUpload(input *omics.AbortMultipartReadSetUploadInput) (*omics.AbortMultipartReadSetUploadOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockOmicsClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type OmicsAPI interface { - AbortMultipartReadSetUpload(*omics.AbortMultipartReadSetUploadInput) (*omics.AbortMultipartReadSetUploadOutput, error) - AbortMultipartReadSetUploadWithContext(aws.Context, *omics.AbortMultipartReadSetUploadInput, ...request.Option) (*omics.AbortMultipartReadSetUploadOutput, error) - AbortMultipartReadSetUploadRequest(*omics.AbortMultipartReadSetUploadInput) (*request.Request, *omics.AbortMultipartReadSetUploadOutput) - - AcceptShare(*omics.AcceptShareInput) (*omics.AcceptShareOutput, error) - AcceptShareWithContext(aws.Context, *omics.AcceptShareInput, ...request.Option) (*omics.AcceptShareOutput, error) - AcceptShareRequest(*omics.AcceptShareInput) (*request.Request, *omics.AcceptShareOutput) - - BatchDeleteReadSet(*omics.BatchDeleteReadSetInput) (*omics.BatchDeleteReadSetOutput, error) - BatchDeleteReadSetWithContext(aws.Context, *omics.BatchDeleteReadSetInput, ...request.Option) (*omics.BatchDeleteReadSetOutput, error) - BatchDeleteReadSetRequest(*omics.BatchDeleteReadSetInput) (*request.Request, *omics.BatchDeleteReadSetOutput) - - CancelAnnotationImportJob(*omics.CancelAnnotationImportJobInput) (*omics.CancelAnnotationImportJobOutput, error) - CancelAnnotationImportJobWithContext(aws.Context, *omics.CancelAnnotationImportJobInput, ...request.Option) (*omics.CancelAnnotationImportJobOutput, error) - CancelAnnotationImportJobRequest(*omics.CancelAnnotationImportJobInput) (*request.Request, *omics.CancelAnnotationImportJobOutput) - - CancelRun(*omics.CancelRunInput) (*omics.CancelRunOutput, error) - CancelRunWithContext(aws.Context, *omics.CancelRunInput, ...request.Option) (*omics.CancelRunOutput, error) - CancelRunRequest(*omics.CancelRunInput) (*request.Request, *omics.CancelRunOutput) - - CancelVariantImportJob(*omics.CancelVariantImportJobInput) (*omics.CancelVariantImportJobOutput, error) - CancelVariantImportJobWithContext(aws.Context, *omics.CancelVariantImportJobInput, ...request.Option) (*omics.CancelVariantImportJobOutput, error) - CancelVariantImportJobRequest(*omics.CancelVariantImportJobInput) (*request.Request, *omics.CancelVariantImportJobOutput) - - CompleteMultipartReadSetUpload(*omics.CompleteMultipartReadSetUploadInput) (*omics.CompleteMultipartReadSetUploadOutput, error) - CompleteMultipartReadSetUploadWithContext(aws.Context, *omics.CompleteMultipartReadSetUploadInput, ...request.Option) (*omics.CompleteMultipartReadSetUploadOutput, error) - CompleteMultipartReadSetUploadRequest(*omics.CompleteMultipartReadSetUploadInput) (*request.Request, *omics.CompleteMultipartReadSetUploadOutput) - - CreateAnnotationStore(*omics.CreateAnnotationStoreInput) (*omics.CreateAnnotationStoreOutput, error) - CreateAnnotationStoreWithContext(aws.Context, *omics.CreateAnnotationStoreInput, ...request.Option) (*omics.CreateAnnotationStoreOutput, error) - CreateAnnotationStoreRequest(*omics.CreateAnnotationStoreInput) (*request.Request, *omics.CreateAnnotationStoreOutput) - - CreateAnnotationStoreVersion(*omics.CreateAnnotationStoreVersionInput) (*omics.CreateAnnotationStoreVersionOutput, error) - CreateAnnotationStoreVersionWithContext(aws.Context, *omics.CreateAnnotationStoreVersionInput, ...request.Option) (*omics.CreateAnnotationStoreVersionOutput, error) - CreateAnnotationStoreVersionRequest(*omics.CreateAnnotationStoreVersionInput) (*request.Request, *omics.CreateAnnotationStoreVersionOutput) - - CreateMultipartReadSetUpload(*omics.CreateMultipartReadSetUploadInput) (*omics.CreateMultipartReadSetUploadOutput, error) - CreateMultipartReadSetUploadWithContext(aws.Context, *omics.CreateMultipartReadSetUploadInput, ...request.Option) (*omics.CreateMultipartReadSetUploadOutput, error) - CreateMultipartReadSetUploadRequest(*omics.CreateMultipartReadSetUploadInput) (*request.Request, *omics.CreateMultipartReadSetUploadOutput) - - CreateReferenceStore(*omics.CreateReferenceStoreInput) (*omics.CreateReferenceStoreOutput, error) - CreateReferenceStoreWithContext(aws.Context, *omics.CreateReferenceStoreInput, ...request.Option) (*omics.CreateReferenceStoreOutput, error) - CreateReferenceStoreRequest(*omics.CreateReferenceStoreInput) (*request.Request, *omics.CreateReferenceStoreOutput) - - CreateRunGroup(*omics.CreateRunGroupInput) (*omics.CreateRunGroupOutput, error) - CreateRunGroupWithContext(aws.Context, *omics.CreateRunGroupInput, ...request.Option) (*omics.CreateRunGroupOutput, error) - CreateRunGroupRequest(*omics.CreateRunGroupInput) (*request.Request, *omics.CreateRunGroupOutput) - - CreateSequenceStore(*omics.CreateSequenceStoreInput) (*omics.CreateSequenceStoreOutput, error) - CreateSequenceStoreWithContext(aws.Context, *omics.CreateSequenceStoreInput, ...request.Option) (*omics.CreateSequenceStoreOutput, error) - CreateSequenceStoreRequest(*omics.CreateSequenceStoreInput) (*request.Request, *omics.CreateSequenceStoreOutput) - - CreateShare(*omics.CreateShareInput) (*omics.CreateShareOutput, error) - CreateShareWithContext(aws.Context, *omics.CreateShareInput, ...request.Option) (*omics.CreateShareOutput, error) - CreateShareRequest(*omics.CreateShareInput) (*request.Request, *omics.CreateShareOutput) - - CreateVariantStore(*omics.CreateVariantStoreInput) (*omics.CreateVariantStoreOutput, error) - CreateVariantStoreWithContext(aws.Context, *omics.CreateVariantStoreInput, ...request.Option) (*omics.CreateVariantStoreOutput, error) - CreateVariantStoreRequest(*omics.CreateVariantStoreInput) (*request.Request, *omics.CreateVariantStoreOutput) - - CreateWorkflow(*omics.CreateWorkflowInput) (*omics.CreateWorkflowOutput, error) - CreateWorkflowWithContext(aws.Context, *omics.CreateWorkflowInput, ...request.Option) (*omics.CreateWorkflowOutput, error) - CreateWorkflowRequest(*omics.CreateWorkflowInput) (*request.Request, *omics.CreateWorkflowOutput) - - DeleteAnnotationStore(*omics.DeleteAnnotationStoreInput) (*omics.DeleteAnnotationStoreOutput, error) - DeleteAnnotationStoreWithContext(aws.Context, *omics.DeleteAnnotationStoreInput, ...request.Option) (*omics.DeleteAnnotationStoreOutput, error) - DeleteAnnotationStoreRequest(*omics.DeleteAnnotationStoreInput) (*request.Request, *omics.DeleteAnnotationStoreOutput) - - DeleteAnnotationStoreVersions(*omics.DeleteAnnotationStoreVersionsInput) (*omics.DeleteAnnotationStoreVersionsOutput, error) - DeleteAnnotationStoreVersionsWithContext(aws.Context, *omics.DeleteAnnotationStoreVersionsInput, ...request.Option) (*omics.DeleteAnnotationStoreVersionsOutput, error) - DeleteAnnotationStoreVersionsRequest(*omics.DeleteAnnotationStoreVersionsInput) (*request.Request, *omics.DeleteAnnotationStoreVersionsOutput) - - DeleteReference(*omics.DeleteReferenceInput) (*omics.DeleteReferenceOutput, error) - DeleteReferenceWithContext(aws.Context, *omics.DeleteReferenceInput, ...request.Option) (*omics.DeleteReferenceOutput, error) - DeleteReferenceRequest(*omics.DeleteReferenceInput) (*request.Request, *omics.DeleteReferenceOutput) - - DeleteReferenceStore(*omics.DeleteReferenceStoreInput) (*omics.DeleteReferenceStoreOutput, error) - DeleteReferenceStoreWithContext(aws.Context, *omics.DeleteReferenceStoreInput, ...request.Option) (*omics.DeleteReferenceStoreOutput, error) - DeleteReferenceStoreRequest(*omics.DeleteReferenceStoreInput) (*request.Request, *omics.DeleteReferenceStoreOutput) - - DeleteRun(*omics.DeleteRunInput) (*omics.DeleteRunOutput, error) - DeleteRunWithContext(aws.Context, *omics.DeleteRunInput, ...request.Option) (*omics.DeleteRunOutput, error) - DeleteRunRequest(*omics.DeleteRunInput) (*request.Request, *omics.DeleteRunOutput) - - DeleteRunGroup(*omics.DeleteRunGroupInput) (*omics.DeleteRunGroupOutput, error) - DeleteRunGroupWithContext(aws.Context, *omics.DeleteRunGroupInput, ...request.Option) (*omics.DeleteRunGroupOutput, error) - DeleteRunGroupRequest(*omics.DeleteRunGroupInput) (*request.Request, *omics.DeleteRunGroupOutput) - - DeleteSequenceStore(*omics.DeleteSequenceStoreInput) (*omics.DeleteSequenceStoreOutput, error) - DeleteSequenceStoreWithContext(aws.Context, *omics.DeleteSequenceStoreInput, ...request.Option) (*omics.DeleteSequenceStoreOutput, error) - DeleteSequenceStoreRequest(*omics.DeleteSequenceStoreInput) (*request.Request, *omics.DeleteSequenceStoreOutput) - - DeleteShare(*omics.DeleteShareInput) (*omics.DeleteShareOutput, error) - DeleteShareWithContext(aws.Context, *omics.DeleteShareInput, ...request.Option) (*omics.DeleteShareOutput, error) - DeleteShareRequest(*omics.DeleteShareInput) (*request.Request, *omics.DeleteShareOutput) - - DeleteVariantStore(*omics.DeleteVariantStoreInput) (*omics.DeleteVariantStoreOutput, error) - DeleteVariantStoreWithContext(aws.Context, *omics.DeleteVariantStoreInput, ...request.Option) (*omics.DeleteVariantStoreOutput, error) - DeleteVariantStoreRequest(*omics.DeleteVariantStoreInput) (*request.Request, *omics.DeleteVariantStoreOutput) - - DeleteWorkflow(*omics.DeleteWorkflowInput) (*omics.DeleteWorkflowOutput, error) - DeleteWorkflowWithContext(aws.Context, *omics.DeleteWorkflowInput, ...request.Option) (*omics.DeleteWorkflowOutput, error) - DeleteWorkflowRequest(*omics.DeleteWorkflowInput) (*request.Request, *omics.DeleteWorkflowOutput) - - GetAnnotationImportJob(*omics.GetAnnotationImportJobInput) (*omics.GetAnnotationImportJobOutput, error) - GetAnnotationImportJobWithContext(aws.Context, *omics.GetAnnotationImportJobInput, ...request.Option) (*omics.GetAnnotationImportJobOutput, error) - GetAnnotationImportJobRequest(*omics.GetAnnotationImportJobInput) (*request.Request, *omics.GetAnnotationImportJobOutput) - - GetAnnotationStore(*omics.GetAnnotationStoreInput) (*omics.GetAnnotationStoreOutput, error) - GetAnnotationStoreWithContext(aws.Context, *omics.GetAnnotationStoreInput, ...request.Option) (*omics.GetAnnotationStoreOutput, error) - GetAnnotationStoreRequest(*omics.GetAnnotationStoreInput) (*request.Request, *omics.GetAnnotationStoreOutput) - - GetAnnotationStoreVersion(*omics.GetAnnotationStoreVersionInput) (*omics.GetAnnotationStoreVersionOutput, error) - GetAnnotationStoreVersionWithContext(aws.Context, *omics.GetAnnotationStoreVersionInput, ...request.Option) (*omics.GetAnnotationStoreVersionOutput, error) - GetAnnotationStoreVersionRequest(*omics.GetAnnotationStoreVersionInput) (*request.Request, *omics.GetAnnotationStoreVersionOutput) - - GetReadSet(*omics.GetReadSetInput) (*omics.GetReadSetOutput, error) - GetReadSetWithContext(aws.Context, *omics.GetReadSetInput, ...request.Option) (*omics.GetReadSetOutput, error) - GetReadSetRequest(*omics.GetReadSetInput) (*request.Request, *omics.GetReadSetOutput) - - GetReadSetActivationJob(*omics.GetReadSetActivationJobInput) (*omics.GetReadSetActivationJobOutput, error) - GetReadSetActivationJobWithContext(aws.Context, *omics.GetReadSetActivationJobInput, ...request.Option) (*omics.GetReadSetActivationJobOutput, error) - GetReadSetActivationJobRequest(*omics.GetReadSetActivationJobInput) (*request.Request, *omics.GetReadSetActivationJobOutput) - - GetReadSetExportJob(*omics.GetReadSetExportJobInput) (*omics.GetReadSetExportJobOutput, error) - GetReadSetExportJobWithContext(aws.Context, *omics.GetReadSetExportJobInput, ...request.Option) (*omics.GetReadSetExportJobOutput, error) - GetReadSetExportJobRequest(*omics.GetReadSetExportJobInput) (*request.Request, *omics.GetReadSetExportJobOutput) - - GetReadSetImportJob(*omics.GetReadSetImportJobInput) (*omics.GetReadSetImportJobOutput, error) - GetReadSetImportJobWithContext(aws.Context, *omics.GetReadSetImportJobInput, ...request.Option) (*omics.GetReadSetImportJobOutput, error) - GetReadSetImportJobRequest(*omics.GetReadSetImportJobInput) (*request.Request, *omics.GetReadSetImportJobOutput) - - GetReadSetMetadata(*omics.GetReadSetMetadataInput) (*omics.GetReadSetMetadataOutput, error) - GetReadSetMetadataWithContext(aws.Context, *omics.GetReadSetMetadataInput, ...request.Option) (*omics.GetReadSetMetadataOutput, error) - GetReadSetMetadataRequest(*omics.GetReadSetMetadataInput) (*request.Request, *omics.GetReadSetMetadataOutput) - - GetReference(*omics.GetReferenceInput) (*omics.GetReferenceOutput, error) - GetReferenceWithContext(aws.Context, *omics.GetReferenceInput, ...request.Option) (*omics.GetReferenceOutput, error) - GetReferenceRequest(*omics.GetReferenceInput) (*request.Request, *omics.GetReferenceOutput) - - GetReferenceImportJob(*omics.GetReferenceImportJobInput) (*omics.GetReferenceImportJobOutput, error) - GetReferenceImportJobWithContext(aws.Context, *omics.GetReferenceImportJobInput, ...request.Option) (*omics.GetReferenceImportJobOutput, error) - GetReferenceImportJobRequest(*omics.GetReferenceImportJobInput) (*request.Request, *omics.GetReferenceImportJobOutput) - - GetReferenceMetadata(*omics.GetReferenceMetadataInput) (*omics.GetReferenceMetadataOutput, error) - GetReferenceMetadataWithContext(aws.Context, *omics.GetReferenceMetadataInput, ...request.Option) (*omics.GetReferenceMetadataOutput, error) - GetReferenceMetadataRequest(*omics.GetReferenceMetadataInput) (*request.Request, *omics.GetReferenceMetadataOutput) - - GetReferenceStore(*omics.GetReferenceStoreInput) (*omics.GetReferenceStoreOutput, error) - GetReferenceStoreWithContext(aws.Context, *omics.GetReferenceStoreInput, ...request.Option) (*omics.GetReferenceStoreOutput, error) - GetReferenceStoreRequest(*omics.GetReferenceStoreInput) (*request.Request, *omics.GetReferenceStoreOutput) - - GetRun(*omics.GetRunInput) (*omics.GetRunOutput, error) - GetRunWithContext(aws.Context, *omics.GetRunInput, ...request.Option) (*omics.GetRunOutput, error) - GetRunRequest(*omics.GetRunInput) (*request.Request, *omics.GetRunOutput) - - GetRunGroup(*omics.GetRunGroupInput) (*omics.GetRunGroupOutput, error) - GetRunGroupWithContext(aws.Context, *omics.GetRunGroupInput, ...request.Option) (*omics.GetRunGroupOutput, error) - GetRunGroupRequest(*omics.GetRunGroupInput) (*request.Request, *omics.GetRunGroupOutput) - - GetRunTask(*omics.GetRunTaskInput) (*omics.GetRunTaskOutput, error) - GetRunTaskWithContext(aws.Context, *omics.GetRunTaskInput, ...request.Option) (*omics.GetRunTaskOutput, error) - GetRunTaskRequest(*omics.GetRunTaskInput) (*request.Request, *omics.GetRunTaskOutput) - - GetSequenceStore(*omics.GetSequenceStoreInput) (*omics.GetSequenceStoreOutput, error) - GetSequenceStoreWithContext(aws.Context, *omics.GetSequenceStoreInput, ...request.Option) (*omics.GetSequenceStoreOutput, error) - GetSequenceStoreRequest(*omics.GetSequenceStoreInput) (*request.Request, *omics.GetSequenceStoreOutput) - - GetShare(*omics.GetShareInput) (*omics.GetShareOutput, error) - GetShareWithContext(aws.Context, *omics.GetShareInput, ...request.Option) (*omics.GetShareOutput, error) - GetShareRequest(*omics.GetShareInput) (*request.Request, *omics.GetShareOutput) - - GetVariantImportJob(*omics.GetVariantImportJobInput) (*omics.GetVariantImportJobOutput, error) - GetVariantImportJobWithContext(aws.Context, *omics.GetVariantImportJobInput, ...request.Option) (*omics.GetVariantImportJobOutput, error) - GetVariantImportJobRequest(*omics.GetVariantImportJobInput) (*request.Request, *omics.GetVariantImportJobOutput) - - GetVariantStore(*omics.GetVariantStoreInput) (*omics.GetVariantStoreOutput, error) - GetVariantStoreWithContext(aws.Context, *omics.GetVariantStoreInput, ...request.Option) (*omics.GetVariantStoreOutput, error) - GetVariantStoreRequest(*omics.GetVariantStoreInput) (*request.Request, *omics.GetVariantStoreOutput) - - GetWorkflow(*omics.GetWorkflowInput) (*omics.GetWorkflowOutput, error) - GetWorkflowWithContext(aws.Context, *omics.GetWorkflowInput, ...request.Option) (*omics.GetWorkflowOutput, error) - GetWorkflowRequest(*omics.GetWorkflowInput) (*request.Request, *omics.GetWorkflowOutput) - - ListAnnotationImportJobs(*omics.ListAnnotationImportJobsInput) (*omics.ListAnnotationImportJobsOutput, error) - ListAnnotationImportJobsWithContext(aws.Context, *omics.ListAnnotationImportJobsInput, ...request.Option) (*omics.ListAnnotationImportJobsOutput, error) - ListAnnotationImportJobsRequest(*omics.ListAnnotationImportJobsInput) (*request.Request, *omics.ListAnnotationImportJobsOutput) - - ListAnnotationImportJobsPages(*omics.ListAnnotationImportJobsInput, func(*omics.ListAnnotationImportJobsOutput, bool) bool) error - ListAnnotationImportJobsPagesWithContext(aws.Context, *omics.ListAnnotationImportJobsInput, func(*omics.ListAnnotationImportJobsOutput, bool) bool, ...request.Option) error - - ListAnnotationStoreVersions(*omics.ListAnnotationStoreVersionsInput) (*omics.ListAnnotationStoreVersionsOutput, error) - ListAnnotationStoreVersionsWithContext(aws.Context, *omics.ListAnnotationStoreVersionsInput, ...request.Option) (*omics.ListAnnotationStoreVersionsOutput, error) - ListAnnotationStoreVersionsRequest(*omics.ListAnnotationStoreVersionsInput) (*request.Request, *omics.ListAnnotationStoreVersionsOutput) - - ListAnnotationStoreVersionsPages(*omics.ListAnnotationStoreVersionsInput, func(*omics.ListAnnotationStoreVersionsOutput, bool) bool) error - ListAnnotationStoreVersionsPagesWithContext(aws.Context, *omics.ListAnnotationStoreVersionsInput, func(*omics.ListAnnotationStoreVersionsOutput, bool) bool, ...request.Option) error - - ListAnnotationStores(*omics.ListAnnotationStoresInput) (*omics.ListAnnotationStoresOutput, error) - ListAnnotationStoresWithContext(aws.Context, *omics.ListAnnotationStoresInput, ...request.Option) (*omics.ListAnnotationStoresOutput, error) - ListAnnotationStoresRequest(*omics.ListAnnotationStoresInput) (*request.Request, *omics.ListAnnotationStoresOutput) - - ListAnnotationStoresPages(*omics.ListAnnotationStoresInput, func(*omics.ListAnnotationStoresOutput, bool) bool) error - ListAnnotationStoresPagesWithContext(aws.Context, *omics.ListAnnotationStoresInput, func(*omics.ListAnnotationStoresOutput, bool) bool, ...request.Option) error - - ListMultipartReadSetUploads(*omics.ListMultipartReadSetUploadsInput) (*omics.ListMultipartReadSetUploadsOutput, error) - ListMultipartReadSetUploadsWithContext(aws.Context, *omics.ListMultipartReadSetUploadsInput, ...request.Option) (*omics.ListMultipartReadSetUploadsOutput, error) - ListMultipartReadSetUploadsRequest(*omics.ListMultipartReadSetUploadsInput) (*request.Request, *omics.ListMultipartReadSetUploadsOutput) - - ListMultipartReadSetUploadsPages(*omics.ListMultipartReadSetUploadsInput, func(*omics.ListMultipartReadSetUploadsOutput, bool) bool) error - ListMultipartReadSetUploadsPagesWithContext(aws.Context, *omics.ListMultipartReadSetUploadsInput, func(*omics.ListMultipartReadSetUploadsOutput, bool) bool, ...request.Option) error - - ListReadSetActivationJobs(*omics.ListReadSetActivationJobsInput) (*omics.ListReadSetActivationJobsOutput, error) - ListReadSetActivationJobsWithContext(aws.Context, *omics.ListReadSetActivationJobsInput, ...request.Option) (*omics.ListReadSetActivationJobsOutput, error) - ListReadSetActivationJobsRequest(*omics.ListReadSetActivationJobsInput) (*request.Request, *omics.ListReadSetActivationJobsOutput) - - ListReadSetActivationJobsPages(*omics.ListReadSetActivationJobsInput, func(*omics.ListReadSetActivationJobsOutput, bool) bool) error - ListReadSetActivationJobsPagesWithContext(aws.Context, *omics.ListReadSetActivationJobsInput, func(*omics.ListReadSetActivationJobsOutput, bool) bool, ...request.Option) error - - ListReadSetExportJobs(*omics.ListReadSetExportJobsInput) (*omics.ListReadSetExportJobsOutput, error) - ListReadSetExportJobsWithContext(aws.Context, *omics.ListReadSetExportJobsInput, ...request.Option) (*omics.ListReadSetExportJobsOutput, error) - ListReadSetExportJobsRequest(*omics.ListReadSetExportJobsInput) (*request.Request, *omics.ListReadSetExportJobsOutput) - - ListReadSetExportJobsPages(*omics.ListReadSetExportJobsInput, func(*omics.ListReadSetExportJobsOutput, bool) bool) error - ListReadSetExportJobsPagesWithContext(aws.Context, *omics.ListReadSetExportJobsInput, func(*omics.ListReadSetExportJobsOutput, bool) bool, ...request.Option) error - - ListReadSetImportJobs(*omics.ListReadSetImportJobsInput) (*omics.ListReadSetImportJobsOutput, error) - ListReadSetImportJobsWithContext(aws.Context, *omics.ListReadSetImportJobsInput, ...request.Option) (*omics.ListReadSetImportJobsOutput, error) - ListReadSetImportJobsRequest(*omics.ListReadSetImportJobsInput) (*request.Request, *omics.ListReadSetImportJobsOutput) - - ListReadSetImportJobsPages(*omics.ListReadSetImportJobsInput, func(*omics.ListReadSetImportJobsOutput, bool) bool) error - ListReadSetImportJobsPagesWithContext(aws.Context, *omics.ListReadSetImportJobsInput, func(*omics.ListReadSetImportJobsOutput, bool) bool, ...request.Option) error - - ListReadSetUploadParts(*omics.ListReadSetUploadPartsInput) (*omics.ListReadSetUploadPartsOutput, error) - ListReadSetUploadPartsWithContext(aws.Context, *omics.ListReadSetUploadPartsInput, ...request.Option) (*omics.ListReadSetUploadPartsOutput, error) - ListReadSetUploadPartsRequest(*omics.ListReadSetUploadPartsInput) (*request.Request, *omics.ListReadSetUploadPartsOutput) - - ListReadSetUploadPartsPages(*omics.ListReadSetUploadPartsInput, func(*omics.ListReadSetUploadPartsOutput, bool) bool) error - ListReadSetUploadPartsPagesWithContext(aws.Context, *omics.ListReadSetUploadPartsInput, func(*omics.ListReadSetUploadPartsOutput, bool) bool, ...request.Option) error - - ListReadSets(*omics.ListReadSetsInput) (*omics.ListReadSetsOutput, error) - ListReadSetsWithContext(aws.Context, *omics.ListReadSetsInput, ...request.Option) (*omics.ListReadSetsOutput, error) - ListReadSetsRequest(*omics.ListReadSetsInput) (*request.Request, *omics.ListReadSetsOutput) - - ListReadSetsPages(*omics.ListReadSetsInput, func(*omics.ListReadSetsOutput, bool) bool) error - ListReadSetsPagesWithContext(aws.Context, *omics.ListReadSetsInput, func(*omics.ListReadSetsOutput, bool) bool, ...request.Option) error - - ListReferenceImportJobs(*omics.ListReferenceImportJobsInput) (*omics.ListReferenceImportJobsOutput, error) - ListReferenceImportJobsWithContext(aws.Context, *omics.ListReferenceImportJobsInput, ...request.Option) (*omics.ListReferenceImportJobsOutput, error) - ListReferenceImportJobsRequest(*omics.ListReferenceImportJobsInput) (*request.Request, *omics.ListReferenceImportJobsOutput) - - ListReferenceImportJobsPages(*omics.ListReferenceImportJobsInput, func(*omics.ListReferenceImportJobsOutput, bool) bool) error - ListReferenceImportJobsPagesWithContext(aws.Context, *omics.ListReferenceImportJobsInput, func(*omics.ListReferenceImportJobsOutput, bool) bool, ...request.Option) error - - ListReferenceStores(*omics.ListReferenceStoresInput) (*omics.ListReferenceStoresOutput, error) - ListReferenceStoresWithContext(aws.Context, *omics.ListReferenceStoresInput, ...request.Option) (*omics.ListReferenceStoresOutput, error) - ListReferenceStoresRequest(*omics.ListReferenceStoresInput) (*request.Request, *omics.ListReferenceStoresOutput) - - ListReferenceStoresPages(*omics.ListReferenceStoresInput, func(*omics.ListReferenceStoresOutput, bool) bool) error - ListReferenceStoresPagesWithContext(aws.Context, *omics.ListReferenceStoresInput, func(*omics.ListReferenceStoresOutput, bool) bool, ...request.Option) error - - ListReferences(*omics.ListReferencesInput) (*omics.ListReferencesOutput, error) - ListReferencesWithContext(aws.Context, *omics.ListReferencesInput, ...request.Option) (*omics.ListReferencesOutput, error) - ListReferencesRequest(*omics.ListReferencesInput) (*request.Request, *omics.ListReferencesOutput) - - ListReferencesPages(*omics.ListReferencesInput, func(*omics.ListReferencesOutput, bool) bool) error - ListReferencesPagesWithContext(aws.Context, *omics.ListReferencesInput, func(*omics.ListReferencesOutput, bool) bool, ...request.Option) error - - ListRunGroups(*omics.ListRunGroupsInput) (*omics.ListRunGroupsOutput, error) - ListRunGroupsWithContext(aws.Context, *omics.ListRunGroupsInput, ...request.Option) (*omics.ListRunGroupsOutput, error) - ListRunGroupsRequest(*omics.ListRunGroupsInput) (*request.Request, *omics.ListRunGroupsOutput) - - ListRunGroupsPages(*omics.ListRunGroupsInput, func(*omics.ListRunGroupsOutput, bool) bool) error - ListRunGroupsPagesWithContext(aws.Context, *omics.ListRunGroupsInput, func(*omics.ListRunGroupsOutput, bool) bool, ...request.Option) error - - ListRunTasks(*omics.ListRunTasksInput) (*omics.ListRunTasksOutput, error) - ListRunTasksWithContext(aws.Context, *omics.ListRunTasksInput, ...request.Option) (*omics.ListRunTasksOutput, error) - ListRunTasksRequest(*omics.ListRunTasksInput) (*request.Request, *omics.ListRunTasksOutput) - - ListRunTasksPages(*omics.ListRunTasksInput, func(*omics.ListRunTasksOutput, bool) bool) error - ListRunTasksPagesWithContext(aws.Context, *omics.ListRunTasksInput, func(*omics.ListRunTasksOutput, bool) bool, ...request.Option) error - - ListRuns(*omics.ListRunsInput) (*omics.ListRunsOutput, error) - ListRunsWithContext(aws.Context, *omics.ListRunsInput, ...request.Option) (*omics.ListRunsOutput, error) - ListRunsRequest(*omics.ListRunsInput) (*request.Request, *omics.ListRunsOutput) - - ListRunsPages(*omics.ListRunsInput, func(*omics.ListRunsOutput, bool) bool) error - ListRunsPagesWithContext(aws.Context, *omics.ListRunsInput, func(*omics.ListRunsOutput, bool) bool, ...request.Option) error - - ListSequenceStores(*omics.ListSequenceStoresInput) (*omics.ListSequenceStoresOutput, error) - ListSequenceStoresWithContext(aws.Context, *omics.ListSequenceStoresInput, ...request.Option) (*omics.ListSequenceStoresOutput, error) - ListSequenceStoresRequest(*omics.ListSequenceStoresInput) (*request.Request, *omics.ListSequenceStoresOutput) - - ListSequenceStoresPages(*omics.ListSequenceStoresInput, func(*omics.ListSequenceStoresOutput, bool) bool) error - ListSequenceStoresPagesWithContext(aws.Context, *omics.ListSequenceStoresInput, func(*omics.ListSequenceStoresOutput, bool) bool, ...request.Option) error - - ListShares(*omics.ListSharesInput) (*omics.ListSharesOutput, error) - ListSharesWithContext(aws.Context, *omics.ListSharesInput, ...request.Option) (*omics.ListSharesOutput, error) - ListSharesRequest(*omics.ListSharesInput) (*request.Request, *omics.ListSharesOutput) - - ListSharesPages(*omics.ListSharesInput, func(*omics.ListSharesOutput, bool) bool) error - ListSharesPagesWithContext(aws.Context, *omics.ListSharesInput, func(*omics.ListSharesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*omics.ListTagsForResourceInput) (*omics.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *omics.ListTagsForResourceInput, ...request.Option) (*omics.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*omics.ListTagsForResourceInput) (*request.Request, *omics.ListTagsForResourceOutput) - - ListVariantImportJobs(*omics.ListVariantImportJobsInput) (*omics.ListVariantImportJobsOutput, error) - ListVariantImportJobsWithContext(aws.Context, *omics.ListVariantImportJobsInput, ...request.Option) (*omics.ListVariantImportJobsOutput, error) - ListVariantImportJobsRequest(*omics.ListVariantImportJobsInput) (*request.Request, *omics.ListVariantImportJobsOutput) - - ListVariantImportJobsPages(*omics.ListVariantImportJobsInput, func(*omics.ListVariantImportJobsOutput, bool) bool) error - ListVariantImportJobsPagesWithContext(aws.Context, *omics.ListVariantImportJobsInput, func(*omics.ListVariantImportJobsOutput, bool) bool, ...request.Option) error - - ListVariantStores(*omics.ListVariantStoresInput) (*omics.ListVariantStoresOutput, error) - ListVariantStoresWithContext(aws.Context, *omics.ListVariantStoresInput, ...request.Option) (*omics.ListVariantStoresOutput, error) - ListVariantStoresRequest(*omics.ListVariantStoresInput) (*request.Request, *omics.ListVariantStoresOutput) - - ListVariantStoresPages(*omics.ListVariantStoresInput, func(*omics.ListVariantStoresOutput, bool) bool) error - ListVariantStoresPagesWithContext(aws.Context, *omics.ListVariantStoresInput, func(*omics.ListVariantStoresOutput, bool) bool, ...request.Option) error - - ListWorkflows(*omics.ListWorkflowsInput) (*omics.ListWorkflowsOutput, error) - ListWorkflowsWithContext(aws.Context, *omics.ListWorkflowsInput, ...request.Option) (*omics.ListWorkflowsOutput, error) - ListWorkflowsRequest(*omics.ListWorkflowsInput) (*request.Request, *omics.ListWorkflowsOutput) - - ListWorkflowsPages(*omics.ListWorkflowsInput, func(*omics.ListWorkflowsOutput, bool) bool) error - ListWorkflowsPagesWithContext(aws.Context, *omics.ListWorkflowsInput, func(*omics.ListWorkflowsOutput, bool) bool, ...request.Option) error - - StartAnnotationImportJob(*omics.StartAnnotationImportJobInput) (*omics.StartAnnotationImportJobOutput, error) - StartAnnotationImportJobWithContext(aws.Context, *omics.StartAnnotationImportJobInput, ...request.Option) (*omics.StartAnnotationImportJobOutput, error) - StartAnnotationImportJobRequest(*omics.StartAnnotationImportJobInput) (*request.Request, *omics.StartAnnotationImportJobOutput) - - StartReadSetActivationJob(*omics.StartReadSetActivationJobInput) (*omics.StartReadSetActivationJobOutput, error) - StartReadSetActivationJobWithContext(aws.Context, *omics.StartReadSetActivationJobInput, ...request.Option) (*omics.StartReadSetActivationJobOutput, error) - StartReadSetActivationJobRequest(*omics.StartReadSetActivationJobInput) (*request.Request, *omics.StartReadSetActivationJobOutput) - - StartReadSetExportJob(*omics.StartReadSetExportJobInput) (*omics.StartReadSetExportJobOutput, error) - StartReadSetExportJobWithContext(aws.Context, *omics.StartReadSetExportJobInput, ...request.Option) (*omics.StartReadSetExportJobOutput, error) - StartReadSetExportJobRequest(*omics.StartReadSetExportJobInput) (*request.Request, *omics.StartReadSetExportJobOutput) - - StartReadSetImportJob(*omics.StartReadSetImportJobInput) (*omics.StartReadSetImportJobOutput, error) - StartReadSetImportJobWithContext(aws.Context, *omics.StartReadSetImportJobInput, ...request.Option) (*omics.StartReadSetImportJobOutput, error) - StartReadSetImportJobRequest(*omics.StartReadSetImportJobInput) (*request.Request, *omics.StartReadSetImportJobOutput) - - StartReferenceImportJob(*omics.StartReferenceImportJobInput) (*omics.StartReferenceImportJobOutput, error) - StartReferenceImportJobWithContext(aws.Context, *omics.StartReferenceImportJobInput, ...request.Option) (*omics.StartReferenceImportJobOutput, error) - StartReferenceImportJobRequest(*omics.StartReferenceImportJobInput) (*request.Request, *omics.StartReferenceImportJobOutput) - - StartRun(*omics.StartRunInput) (*omics.StartRunOutput, error) - StartRunWithContext(aws.Context, *omics.StartRunInput, ...request.Option) (*omics.StartRunOutput, error) - StartRunRequest(*omics.StartRunInput) (*request.Request, *omics.StartRunOutput) - - StartVariantImportJob(*omics.StartVariantImportJobInput) (*omics.StartVariantImportJobOutput, error) - StartVariantImportJobWithContext(aws.Context, *omics.StartVariantImportJobInput, ...request.Option) (*omics.StartVariantImportJobOutput, error) - StartVariantImportJobRequest(*omics.StartVariantImportJobInput) (*request.Request, *omics.StartVariantImportJobOutput) - - TagResource(*omics.TagResourceInput) (*omics.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *omics.TagResourceInput, ...request.Option) (*omics.TagResourceOutput, error) - TagResourceRequest(*omics.TagResourceInput) (*request.Request, *omics.TagResourceOutput) - - UntagResource(*omics.UntagResourceInput) (*omics.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *omics.UntagResourceInput, ...request.Option) (*omics.UntagResourceOutput, error) - UntagResourceRequest(*omics.UntagResourceInput) (*request.Request, *omics.UntagResourceOutput) - - UpdateAnnotationStore(*omics.UpdateAnnotationStoreInput) (*omics.UpdateAnnotationStoreOutput, error) - UpdateAnnotationStoreWithContext(aws.Context, *omics.UpdateAnnotationStoreInput, ...request.Option) (*omics.UpdateAnnotationStoreOutput, error) - UpdateAnnotationStoreRequest(*omics.UpdateAnnotationStoreInput) (*request.Request, *omics.UpdateAnnotationStoreOutput) - - UpdateAnnotationStoreVersion(*omics.UpdateAnnotationStoreVersionInput) (*omics.UpdateAnnotationStoreVersionOutput, error) - UpdateAnnotationStoreVersionWithContext(aws.Context, *omics.UpdateAnnotationStoreVersionInput, ...request.Option) (*omics.UpdateAnnotationStoreVersionOutput, error) - UpdateAnnotationStoreVersionRequest(*omics.UpdateAnnotationStoreVersionInput) (*request.Request, *omics.UpdateAnnotationStoreVersionOutput) - - UpdateRunGroup(*omics.UpdateRunGroupInput) (*omics.UpdateRunGroupOutput, error) - UpdateRunGroupWithContext(aws.Context, *omics.UpdateRunGroupInput, ...request.Option) (*omics.UpdateRunGroupOutput, error) - UpdateRunGroupRequest(*omics.UpdateRunGroupInput) (*request.Request, *omics.UpdateRunGroupOutput) - - UpdateVariantStore(*omics.UpdateVariantStoreInput) (*omics.UpdateVariantStoreOutput, error) - UpdateVariantStoreWithContext(aws.Context, *omics.UpdateVariantStoreInput, ...request.Option) (*omics.UpdateVariantStoreOutput, error) - UpdateVariantStoreRequest(*omics.UpdateVariantStoreInput) (*request.Request, *omics.UpdateVariantStoreOutput) - - UpdateWorkflow(*omics.UpdateWorkflowInput) (*omics.UpdateWorkflowOutput, error) - UpdateWorkflowWithContext(aws.Context, *omics.UpdateWorkflowInput, ...request.Option) (*omics.UpdateWorkflowOutput, error) - UpdateWorkflowRequest(*omics.UpdateWorkflowInput) (*request.Request, *omics.UpdateWorkflowOutput) - - UploadReadSetPart(*omics.UploadReadSetPartInput) (*omics.UploadReadSetPartOutput, error) - UploadReadSetPartWithContext(aws.Context, *omics.UploadReadSetPartInput, ...request.Option) (*omics.UploadReadSetPartOutput, error) - UploadReadSetPartRequest(*omics.UploadReadSetPartInput) (*request.Request, *omics.UploadReadSetPartOutput) - - WaitUntilAnnotationImportJobCreated(*omics.GetAnnotationImportJobInput) error - WaitUntilAnnotationImportJobCreatedWithContext(aws.Context, *omics.GetAnnotationImportJobInput, ...request.WaiterOption) error - - WaitUntilAnnotationStoreCreated(*omics.GetAnnotationStoreInput) error - WaitUntilAnnotationStoreCreatedWithContext(aws.Context, *omics.GetAnnotationStoreInput, ...request.WaiterOption) error - - WaitUntilAnnotationStoreDeleted(*omics.GetAnnotationStoreInput) error - WaitUntilAnnotationStoreDeletedWithContext(aws.Context, *omics.GetAnnotationStoreInput, ...request.WaiterOption) error - - WaitUntilAnnotationStoreVersionCreated(*omics.GetAnnotationStoreVersionInput) error - WaitUntilAnnotationStoreVersionCreatedWithContext(aws.Context, *omics.GetAnnotationStoreVersionInput, ...request.WaiterOption) error - - WaitUntilAnnotationStoreVersionDeleted(*omics.GetAnnotationStoreVersionInput) error - WaitUntilAnnotationStoreVersionDeletedWithContext(aws.Context, *omics.GetAnnotationStoreVersionInput, ...request.WaiterOption) error - - WaitUntilReadSetActivationJobCompleted(*omics.GetReadSetActivationJobInput) error - WaitUntilReadSetActivationJobCompletedWithContext(aws.Context, *omics.GetReadSetActivationJobInput, ...request.WaiterOption) error - - WaitUntilReadSetExportJobCompleted(*omics.GetReadSetExportJobInput) error - WaitUntilReadSetExportJobCompletedWithContext(aws.Context, *omics.GetReadSetExportJobInput, ...request.WaiterOption) error - - WaitUntilReadSetImportJobCompleted(*omics.GetReadSetImportJobInput) error - WaitUntilReadSetImportJobCompletedWithContext(aws.Context, *omics.GetReadSetImportJobInput, ...request.WaiterOption) error - - WaitUntilReferenceImportJobCompleted(*omics.GetReferenceImportJobInput) error - WaitUntilReferenceImportJobCompletedWithContext(aws.Context, *omics.GetReferenceImportJobInput, ...request.WaiterOption) error - - WaitUntilRunCompleted(*omics.GetRunInput) error - WaitUntilRunCompletedWithContext(aws.Context, *omics.GetRunInput, ...request.WaiterOption) error - - WaitUntilRunRunning(*omics.GetRunInput) error - WaitUntilRunRunningWithContext(aws.Context, *omics.GetRunInput, ...request.WaiterOption) error - - WaitUntilTaskCompleted(*omics.GetRunTaskInput) error - WaitUntilTaskCompletedWithContext(aws.Context, *omics.GetRunTaskInput, ...request.WaiterOption) error - - WaitUntilTaskRunning(*omics.GetRunTaskInput) error - WaitUntilTaskRunningWithContext(aws.Context, *omics.GetRunTaskInput, ...request.WaiterOption) error - - WaitUntilVariantImportJobCreated(*omics.GetVariantImportJobInput) error - WaitUntilVariantImportJobCreatedWithContext(aws.Context, *omics.GetVariantImportJobInput, ...request.WaiterOption) error - - WaitUntilVariantStoreCreated(*omics.GetVariantStoreInput) error - WaitUntilVariantStoreCreatedWithContext(aws.Context, *omics.GetVariantStoreInput, ...request.WaiterOption) error - - WaitUntilVariantStoreDeleted(*omics.GetVariantStoreInput) error - WaitUntilVariantStoreDeletedWithContext(aws.Context, *omics.GetVariantStoreInput, ...request.WaiterOption) error - - WaitUntilWorkflowActive(*omics.GetWorkflowInput) error - WaitUntilWorkflowActiveWithContext(aws.Context, *omics.GetWorkflowInput, ...request.WaiterOption) error -} - -var _ OmicsAPI = (*omics.Omics)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/service.go deleted file mode 100644 index 9c58e6698928..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package omics - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// Omics provides the API operation methods for making requests to -// Amazon Omics. See this package's package overview docs -// for details on the service. -// -// Omics methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type Omics struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Omics" // Name of service. - EndpointsID = "omics" // ID to lookup a service endpoint with. - ServiceID = "Omics" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the Omics client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a Omics client from just a session. -// svc := omics.New(mySession) -// -// // Create a Omics client with additional configuration -// svc := omics.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Omics { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "omics" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *Omics { - svc := &Omics{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-11-28", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Omics operation and runs any -// custom request initialization. -func (c *Omics) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/waiters.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/waiters.go deleted file mode 100644 index dda4e63fba87..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/omics/waiters.go +++ /dev/null @@ -1,1132 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package omics - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" -) - -// WaitUntilAnnotationImportJobCreated uses the Amazon Omics API operation -// GetAnnotationImportJob to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilAnnotationImportJobCreated(input *GetAnnotationImportJobInput) error { - return c.WaitUntilAnnotationImportJobCreatedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilAnnotationImportJobCreatedWithContext is an extended version of WaitUntilAnnotationImportJobCreated. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilAnnotationImportJobCreatedWithContext(ctx aws.Context, input *GetAnnotationImportJobInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilAnnotationImportJobCreated", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "SUBMITTED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "IN_PROGRESS", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLED", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetAnnotationImportJobInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetAnnotationImportJobRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilAnnotationStoreCreated uses the Amazon Omics API operation -// GetAnnotationStore to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilAnnotationStoreCreated(input *GetAnnotationStoreInput) error { - return c.WaitUntilAnnotationStoreCreatedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilAnnotationStoreCreatedWithContext is an extended version of WaitUntilAnnotationStoreCreated. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilAnnotationStoreCreatedWithContext(ctx aws.Context, input *GetAnnotationStoreInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilAnnotationStoreCreated", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "ACTIVE", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CREATING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "UPDATING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetAnnotationStoreInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetAnnotationStoreRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilAnnotationStoreDeleted uses the Amazon Omics API operation -// GetAnnotationStore to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilAnnotationStoreDeleted(input *GetAnnotationStoreInput) error { - return c.WaitUntilAnnotationStoreDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilAnnotationStoreDeletedWithContext is an extended version of WaitUntilAnnotationStoreDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilAnnotationStoreDeletedWithContext(ctx aws.Context, input *GetAnnotationStoreInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilAnnotationStoreDeleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "DELETED", - }, - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "ResourceNotFoundException", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "DELETING", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetAnnotationStoreInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetAnnotationStoreRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilAnnotationStoreVersionCreated uses the Amazon Omics API operation -// GetAnnotationStoreVersion to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilAnnotationStoreVersionCreated(input *GetAnnotationStoreVersionInput) error { - return c.WaitUntilAnnotationStoreVersionCreatedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilAnnotationStoreVersionCreatedWithContext is an extended version of WaitUntilAnnotationStoreVersionCreated. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilAnnotationStoreVersionCreatedWithContext(ctx aws.Context, input *GetAnnotationStoreVersionInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilAnnotationStoreVersionCreated", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "ACTIVE", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CREATING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "UPDATING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetAnnotationStoreVersionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetAnnotationStoreVersionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilAnnotationStoreVersionDeleted uses the Amazon Omics API operation -// GetAnnotationStoreVersion to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilAnnotationStoreVersionDeleted(input *GetAnnotationStoreVersionInput) error { - return c.WaitUntilAnnotationStoreVersionDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilAnnotationStoreVersionDeletedWithContext is an extended version of WaitUntilAnnotationStoreVersionDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilAnnotationStoreVersionDeletedWithContext(ctx aws.Context, input *GetAnnotationStoreVersionInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilAnnotationStoreVersionDeleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "DELETED", - }, - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "ResourceNotFoundException", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "DELETING", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetAnnotationStoreVersionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetAnnotationStoreVersionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilReadSetActivationJobCompleted uses the Amazon Omics API operation -// GetReadSetActivationJob to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilReadSetActivationJobCompleted(input *GetReadSetActivationJobInput) error { - return c.WaitUntilReadSetActivationJobCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilReadSetActivationJobCompletedWithContext is an extended version of WaitUntilReadSetActivationJobCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilReadSetActivationJobCompletedWithContext(ctx aws.Context, input *GetReadSetActivationJobInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilReadSetActivationJobCompleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "SUBMITTED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "IN_PROGRESS", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED_WITH_FAILURES", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetReadSetActivationJobInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetReadSetActivationJobRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilReadSetExportJobCompleted uses the Amazon Omics API operation -// GetReadSetExportJob to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilReadSetExportJobCompleted(input *GetReadSetExportJobInput) error { - return c.WaitUntilReadSetExportJobCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilReadSetExportJobCompletedWithContext is an extended version of WaitUntilReadSetExportJobCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilReadSetExportJobCompletedWithContext(ctx aws.Context, input *GetReadSetExportJobInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilReadSetExportJobCompleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "SUBMITTED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "IN_PROGRESS", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED_WITH_FAILURES", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetReadSetExportJobInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetReadSetExportJobRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilReadSetImportJobCompleted uses the Amazon Omics API operation -// GetReadSetImportJob to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilReadSetImportJobCompleted(input *GetReadSetImportJobInput) error { - return c.WaitUntilReadSetImportJobCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilReadSetImportJobCompletedWithContext is an extended version of WaitUntilReadSetImportJobCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilReadSetImportJobCompletedWithContext(ctx aws.Context, input *GetReadSetImportJobInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilReadSetImportJobCompleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "SUBMITTED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "IN_PROGRESS", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED_WITH_FAILURES", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetReadSetImportJobInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetReadSetImportJobRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilReferenceImportJobCompleted uses the Amazon Omics API operation -// GetReferenceImportJob to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilReferenceImportJobCompleted(input *GetReferenceImportJobInput) error { - return c.WaitUntilReferenceImportJobCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilReferenceImportJobCompletedWithContext is an extended version of WaitUntilReferenceImportJobCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilReferenceImportJobCompletedWithContext(ctx aws.Context, input *GetReferenceImportJobInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilReferenceImportJobCompleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "SUBMITTED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "IN_PROGRESS", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED_WITH_FAILURES", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetReferenceImportJobInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetReferenceImportJobRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilRunCompleted uses the Amazon Omics API operation -// GetRun to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilRunCompleted(input *GetRunInput) error { - return c.WaitUntilRunCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilRunCompletedWithContext is an extended version of WaitUntilRunCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilRunCompletedWithContext(ctx aws.Context, input *GetRunInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilRunCompleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "PENDING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "STARTING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "RUNNING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "STOPPING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetRunInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetRunRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilRunRunning uses the Amazon Omics API operation -// GetRun to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilRunRunning(input *GetRunInput) error { - return c.WaitUntilRunRunningWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilRunRunningWithContext is an extended version of WaitUntilRunRunning. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilRunRunningWithContext(ctx aws.Context, input *GetRunInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilRunRunning", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "RUNNING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "PENDING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "STARTING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetRunInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetRunRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilTaskCompleted uses the Amazon Omics API operation -// GetRunTask to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilTaskCompleted(input *GetRunTaskInput) error { - return c.WaitUntilTaskCompletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilTaskCompletedWithContext is an extended version of WaitUntilTaskCompleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilTaskCompletedWithContext(ctx aws.Context, input *GetRunTaskInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilTaskCompleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "PENDING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "STARTING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "RUNNING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "STOPPING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetRunTaskInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetRunTaskRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilTaskRunning uses the Amazon Omics API operation -// GetRunTask to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilTaskRunning(input *GetRunTaskInput) error { - return c.WaitUntilTaskRunningWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilTaskRunningWithContext is an extended version of WaitUntilTaskRunning. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilTaskRunningWithContext(ctx aws.Context, input *GetRunTaskInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilTaskRunning", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "RUNNING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "PENDING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "STARTING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetRunTaskInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetRunTaskRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVariantImportJobCreated uses the Amazon Omics API operation -// GetVariantImportJob to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilVariantImportJobCreated(input *GetVariantImportJobInput) error { - return c.WaitUntilVariantImportJobCreatedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVariantImportJobCreatedWithContext is an extended version of WaitUntilVariantImportJobCreated. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilVariantImportJobCreatedWithContext(ctx aws.Context, input *GetVariantImportJobInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVariantImportJobCreated", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "SUBMITTED", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "IN_PROGRESS", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CANCELLED", - }, - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "COMPLETED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetVariantImportJobInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetVariantImportJobRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVariantStoreCreated uses the Amazon Omics API operation -// GetVariantStore to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilVariantStoreCreated(input *GetVariantStoreInput) error { - return c.WaitUntilVariantStoreCreatedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVariantStoreCreatedWithContext is an extended version of WaitUntilVariantStoreCreated. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilVariantStoreCreatedWithContext(ctx aws.Context, input *GetVariantStoreInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVariantStoreCreated", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "ACTIVE", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CREATING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "UPDATING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetVariantStoreInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetVariantStoreRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilVariantStoreDeleted uses the Amazon Omics API operation -// GetVariantStore to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilVariantStoreDeleted(input *GetVariantStoreInput) error { - return c.WaitUntilVariantStoreDeletedWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilVariantStoreDeletedWithContext is an extended version of WaitUntilVariantStoreDeleted. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilVariantStoreDeletedWithContext(ctx aws.Context, input *GetVariantStoreInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilVariantStoreDeleted", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(30 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "DELETED", - }, - { - State: request.SuccessWaiterState, - Matcher: request.ErrorWaiterMatch, - Expected: "ResourceNotFoundException", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "DELETING", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetVariantStoreInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetVariantStoreRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilWorkflowActive uses the Amazon Omics API operation -// GetWorkflow to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *Omics) WaitUntilWorkflowActive(input *GetWorkflowInput) error { - return c.WaitUntilWorkflowActiveWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilWorkflowActiveWithContext is an extended version of WaitUntilWorkflowActive. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// 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 *Omics) WaitUntilWorkflowActiveWithContext(ctx aws.Context, input *GetWorkflowInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilWorkflowActive", - MaxAttempts: 10, - Delay: request.ConstantWaiterDelay(3 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "ACTIVE", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "CREATING", - }, - { - State: request.RetryWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "UPDATING", - }, - { - State: request.FailureWaiterState, - Matcher: request.PathWaiterMatch, Argument: "status", - Expected: "FAILED", - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *GetWorkflowInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetWorkflowRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/api.go deleted file mode 100644 index c53d8f99491f..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/api.go +++ /dev/null @@ -1,10519 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package opensearchserverless - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opBatchGetCollection = "BatchGetCollection" - -// BatchGetCollectionRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetCollection 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 BatchGetCollection for more information on using the BatchGetCollection -// 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 BatchGetCollectionRequest method. -// req, resp := client.BatchGetCollectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/BatchGetCollection -func (c *OpenSearchServerless) BatchGetCollectionRequest(input *BatchGetCollectionInput) (req *request.Request, output *BatchGetCollectionOutput) { - op := &request.Operation{ - Name: opBatchGetCollection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetCollectionInput{} - } - - output = &BatchGetCollectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetCollection API operation for OpenSearch Service Serverless. -// -// Returns attributes for one or more collections, including the collection -// endpoint and the OpenSearch Dashboards endpoint. For more information, see -// Creating and managing Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html). -// -// 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 OpenSearch Service Serverless's -// API operation BatchGetCollection for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/BatchGetCollection -func (c *OpenSearchServerless) BatchGetCollection(input *BatchGetCollectionInput) (*BatchGetCollectionOutput, error) { - req, out := c.BatchGetCollectionRequest(input) - return out, req.Send() -} - -// BatchGetCollectionWithContext is the same as BatchGetCollection with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetCollection 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 *OpenSearchServerless) BatchGetCollectionWithContext(ctx aws.Context, input *BatchGetCollectionInput, opts ...request.Option) (*BatchGetCollectionOutput, error) { - req, out := c.BatchGetCollectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchGetEffectiveLifecyclePolicy = "BatchGetEffectiveLifecyclePolicy" - -// BatchGetEffectiveLifecyclePolicyRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetEffectiveLifecyclePolicy 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 BatchGetEffectiveLifecyclePolicy for more information on using the BatchGetEffectiveLifecyclePolicy -// 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 BatchGetEffectiveLifecyclePolicyRequest method. -// req, resp := client.BatchGetEffectiveLifecyclePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/BatchGetEffectiveLifecyclePolicy -func (c *OpenSearchServerless) BatchGetEffectiveLifecyclePolicyRequest(input *BatchGetEffectiveLifecyclePolicyInput) (req *request.Request, output *BatchGetEffectiveLifecyclePolicyOutput) { - op := &request.Operation{ - Name: opBatchGetEffectiveLifecyclePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetEffectiveLifecyclePolicyInput{} - } - - output = &BatchGetEffectiveLifecyclePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetEffectiveLifecyclePolicy API operation for OpenSearch Service Serverless. -// -// Returns a list of successful and failed retrievals for the OpenSearch Serverless -// indexes. For more information, see Viewing data lifecycle policies (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-lifecycle.html#serverless-lifecycle-list). -// -// 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 OpenSearch Service Serverless's -// API operation BatchGetEffectiveLifecyclePolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/BatchGetEffectiveLifecyclePolicy -func (c *OpenSearchServerless) BatchGetEffectiveLifecyclePolicy(input *BatchGetEffectiveLifecyclePolicyInput) (*BatchGetEffectiveLifecyclePolicyOutput, error) { - req, out := c.BatchGetEffectiveLifecyclePolicyRequest(input) - return out, req.Send() -} - -// BatchGetEffectiveLifecyclePolicyWithContext is the same as BatchGetEffectiveLifecyclePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetEffectiveLifecyclePolicy 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 *OpenSearchServerless) BatchGetEffectiveLifecyclePolicyWithContext(ctx aws.Context, input *BatchGetEffectiveLifecyclePolicyInput, opts ...request.Option) (*BatchGetEffectiveLifecyclePolicyOutput, error) { - req, out := c.BatchGetEffectiveLifecyclePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchGetLifecyclePolicy = "BatchGetLifecyclePolicy" - -// BatchGetLifecyclePolicyRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetLifecyclePolicy 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 BatchGetLifecyclePolicy for more information on using the BatchGetLifecyclePolicy -// 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 BatchGetLifecyclePolicyRequest method. -// req, resp := client.BatchGetLifecyclePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/BatchGetLifecyclePolicy -func (c *OpenSearchServerless) BatchGetLifecyclePolicyRequest(input *BatchGetLifecyclePolicyInput) (req *request.Request, output *BatchGetLifecyclePolicyOutput) { - op := &request.Operation{ - Name: opBatchGetLifecyclePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetLifecyclePolicyInput{} - } - - output = &BatchGetLifecyclePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetLifecyclePolicy API operation for OpenSearch Service Serverless. -// -// Returns one or more configured OpenSearch Serverless lifecycle policies. -// For more information, see Viewing data lifecycle policies (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-lifecycle.html#serverless-lifecycle-list). -// -// 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 OpenSearch Service Serverless's -// API operation BatchGetLifecyclePolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/BatchGetLifecyclePolicy -func (c *OpenSearchServerless) BatchGetLifecyclePolicy(input *BatchGetLifecyclePolicyInput) (*BatchGetLifecyclePolicyOutput, error) { - req, out := c.BatchGetLifecyclePolicyRequest(input) - return out, req.Send() -} - -// BatchGetLifecyclePolicyWithContext is the same as BatchGetLifecyclePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetLifecyclePolicy 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 *OpenSearchServerless) BatchGetLifecyclePolicyWithContext(ctx aws.Context, input *BatchGetLifecyclePolicyInput, opts ...request.Option) (*BatchGetLifecyclePolicyOutput, error) { - req, out := c.BatchGetLifecyclePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchGetVpcEndpoint = "BatchGetVpcEndpoint" - -// BatchGetVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetVpcEndpoint 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 BatchGetVpcEndpoint for more information on using the BatchGetVpcEndpoint -// 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 BatchGetVpcEndpointRequest method. -// req, resp := client.BatchGetVpcEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/BatchGetVpcEndpoint -func (c *OpenSearchServerless) BatchGetVpcEndpointRequest(input *BatchGetVpcEndpointInput) (req *request.Request, output *BatchGetVpcEndpointOutput) { - op := &request.Operation{ - Name: opBatchGetVpcEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchGetVpcEndpointInput{} - } - - output = &BatchGetVpcEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetVpcEndpoint API operation for OpenSearch Service Serverless. -// -// Returns attributes for one or more VPC endpoints associated with the current -// account. For more information, see Access Amazon OpenSearch Serverless using -// an interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html). -// -// 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 OpenSearch Service Serverless's -// API operation BatchGetVpcEndpoint for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/BatchGetVpcEndpoint -func (c *OpenSearchServerless) BatchGetVpcEndpoint(input *BatchGetVpcEndpointInput) (*BatchGetVpcEndpointOutput, error) { - req, out := c.BatchGetVpcEndpointRequest(input) - return out, req.Send() -} - -// BatchGetVpcEndpointWithContext is the same as BatchGetVpcEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetVpcEndpoint 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 *OpenSearchServerless) BatchGetVpcEndpointWithContext(ctx aws.Context, input *BatchGetVpcEndpointInput, opts ...request.Option) (*BatchGetVpcEndpointOutput, error) { - req, out := c.BatchGetVpcEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAccessPolicy = "CreateAccessPolicy" - -// CreateAccessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreateAccessPolicy 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 CreateAccessPolicy for more information on using the CreateAccessPolicy -// 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 CreateAccessPolicyRequest method. -// req, resp := client.CreateAccessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateAccessPolicy -func (c *OpenSearchServerless) CreateAccessPolicyRequest(input *CreateAccessPolicyInput) (req *request.Request, output *CreateAccessPolicyOutput) { - op := &request.Operation{ - Name: opCreateAccessPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAccessPolicyInput{} - } - - output = &CreateAccessPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAccessPolicy API operation for OpenSearch Service Serverless. -// -// Creates a data access policy for OpenSearch Serverless. Access policies limit -// access to collections and the resources within them, and allow a user to -// access that data irrespective of the access mechanism or network source. -// For more information, see Data access control for Amazon OpenSearch Serverless -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html). -// -// 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 OpenSearch Service Serverless's -// API operation CreateAccessPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateAccessPolicy -func (c *OpenSearchServerless) CreateAccessPolicy(input *CreateAccessPolicyInput) (*CreateAccessPolicyOutput, error) { - req, out := c.CreateAccessPolicyRequest(input) - return out, req.Send() -} - -// CreateAccessPolicyWithContext is the same as CreateAccessPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAccessPolicy 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 *OpenSearchServerless) CreateAccessPolicyWithContext(ctx aws.Context, input *CreateAccessPolicyInput, opts ...request.Option) (*CreateAccessPolicyOutput, error) { - req, out := c.CreateAccessPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateCollection = "CreateCollection" - -// CreateCollectionRequest generates a "aws/request.Request" representing the -// client's request for the CreateCollection 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 CreateCollection for more information on using the CreateCollection -// 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 CreateCollectionRequest method. -// req, resp := client.CreateCollectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateCollection -func (c *OpenSearchServerless) CreateCollectionRequest(input *CreateCollectionInput) (req *request.Request, output *CreateCollectionOutput) { - op := &request.Operation{ - Name: opCreateCollection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCollectionInput{} - } - - output = &CreateCollectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCollection API operation for OpenSearch Service Serverless. -// -// Creates a new OpenSearch Serverless collection. For more information, see -// Creating and managing Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html). -// -// 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 OpenSearch Service Serverless's -// API operation CreateCollection for usage and error information. -// -// Returned Error Types: -// -// - OcuLimitExceededException -// Thrown when the collection you're attempting to create results in a number -// of search or indexing OCUs that exceeds the account limit. -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateCollection -func (c *OpenSearchServerless) CreateCollection(input *CreateCollectionInput) (*CreateCollectionOutput, error) { - req, out := c.CreateCollectionRequest(input) - return out, req.Send() -} - -// CreateCollectionWithContext is the same as CreateCollection with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCollection 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 *OpenSearchServerless) CreateCollectionWithContext(ctx aws.Context, input *CreateCollectionInput, opts ...request.Option) (*CreateCollectionOutput, error) { - req, out := c.CreateCollectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateLifecyclePolicy = "CreateLifecyclePolicy" - -// CreateLifecyclePolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreateLifecyclePolicy 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 CreateLifecyclePolicy for more information on using the CreateLifecyclePolicy -// 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 CreateLifecyclePolicyRequest method. -// req, resp := client.CreateLifecyclePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateLifecyclePolicy -func (c *OpenSearchServerless) CreateLifecyclePolicyRequest(input *CreateLifecyclePolicyInput) (req *request.Request, output *CreateLifecyclePolicyOutput) { - op := &request.Operation{ - Name: opCreateLifecyclePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLifecyclePolicyInput{} - } - - output = &CreateLifecyclePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateLifecyclePolicy API operation for OpenSearch Service Serverless. -// -// Creates a lifecyle policy to be applied to OpenSearch Serverless indexes. -// Lifecycle policies define the number of days or hours to retain the data -// on an OpenSearch Serverless index. For more information, see Creating data -// lifecycle policies (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-lifecycle.html#serverless-lifecycle-create). -// -// 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 OpenSearch Service Serverless's -// API operation CreateLifecyclePolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateLifecyclePolicy -func (c *OpenSearchServerless) CreateLifecyclePolicy(input *CreateLifecyclePolicyInput) (*CreateLifecyclePolicyOutput, error) { - req, out := c.CreateLifecyclePolicyRequest(input) - return out, req.Send() -} - -// CreateLifecyclePolicyWithContext is the same as CreateLifecyclePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See CreateLifecyclePolicy 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 *OpenSearchServerless) CreateLifecyclePolicyWithContext(ctx aws.Context, input *CreateLifecyclePolicyInput, opts ...request.Option) (*CreateLifecyclePolicyOutput, error) { - req, out := c.CreateLifecyclePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSecurityConfig = "CreateSecurityConfig" - -// CreateSecurityConfigRequest generates a "aws/request.Request" representing the -// client's request for the CreateSecurityConfig 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 CreateSecurityConfig for more information on using the CreateSecurityConfig -// 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 CreateSecurityConfigRequest method. -// req, resp := client.CreateSecurityConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateSecurityConfig -func (c *OpenSearchServerless) CreateSecurityConfigRequest(input *CreateSecurityConfigInput) (req *request.Request, output *CreateSecurityConfigOutput) { - op := &request.Operation{ - Name: opCreateSecurityConfig, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSecurityConfigInput{} - } - - output = &CreateSecurityConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSecurityConfig API operation for OpenSearch Service Serverless. -// -// Specifies a security configuration for OpenSearch Serverless. For more information, -// see SAML authentication for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html). -// -// 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 OpenSearch Service Serverless's -// API operation CreateSecurityConfig for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateSecurityConfig -func (c *OpenSearchServerless) CreateSecurityConfig(input *CreateSecurityConfigInput) (*CreateSecurityConfigOutput, error) { - req, out := c.CreateSecurityConfigRequest(input) - return out, req.Send() -} - -// CreateSecurityConfigWithContext is the same as CreateSecurityConfig with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSecurityConfig 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 *OpenSearchServerless) CreateSecurityConfigWithContext(ctx aws.Context, input *CreateSecurityConfigInput, opts ...request.Option) (*CreateSecurityConfigOutput, error) { - req, out := c.CreateSecurityConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSecurityPolicy = "CreateSecurityPolicy" - -// CreateSecurityPolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreateSecurityPolicy 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 CreateSecurityPolicy for more information on using the CreateSecurityPolicy -// 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 CreateSecurityPolicyRequest method. -// req, resp := client.CreateSecurityPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateSecurityPolicy -func (c *OpenSearchServerless) CreateSecurityPolicyRequest(input *CreateSecurityPolicyInput) (req *request.Request, output *CreateSecurityPolicyOutput) { - op := &request.Operation{ - Name: opCreateSecurityPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSecurityPolicyInput{} - } - - output = &CreateSecurityPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSecurityPolicy API operation for OpenSearch Service Serverless. -// -// Creates a security policy to be used by one or more OpenSearch Serverless -// collections. Security policies provide access to a collection and its OpenSearch -// Dashboards endpoint from public networks or specific VPC endpoints. They -// also allow you to secure a collection with a KMS encryption key. For more -// information, see Network access for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-network.html) -// and Encryption at rest for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-encryption.html). -// -// 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 OpenSearch Service Serverless's -// API operation CreateSecurityPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateSecurityPolicy -func (c *OpenSearchServerless) CreateSecurityPolicy(input *CreateSecurityPolicyInput) (*CreateSecurityPolicyOutput, error) { - req, out := c.CreateSecurityPolicyRequest(input) - return out, req.Send() -} - -// CreateSecurityPolicyWithContext is the same as CreateSecurityPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSecurityPolicy 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 *OpenSearchServerless) CreateSecurityPolicyWithContext(ctx aws.Context, input *CreateSecurityPolicyInput, opts ...request.Option) (*CreateSecurityPolicyOutput, error) { - req, out := c.CreateSecurityPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateVpcEndpoint = "CreateVpcEndpoint" - -// CreateVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the CreateVpcEndpoint 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 CreateVpcEndpoint for more information on using the CreateVpcEndpoint -// 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 CreateVpcEndpointRequest method. -// req, resp := client.CreateVpcEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateVpcEndpoint -func (c *OpenSearchServerless) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *request.Request, output *CreateVpcEndpointOutput) { - op := &request.Operation{ - Name: opCreateVpcEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateVpcEndpointInput{} - } - - output = &CreateVpcEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateVpcEndpoint API operation for OpenSearch Service Serverless. -// -// Creates an OpenSearch Serverless-managed interface VPC endpoint. For more -// information, see Access Amazon OpenSearch Serverless using an interface endpoint -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html). -// -// 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 OpenSearch Service Serverless's -// API operation CreateVpcEndpoint for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateVpcEndpoint -func (c *OpenSearchServerless) CreateVpcEndpoint(input *CreateVpcEndpointInput) (*CreateVpcEndpointOutput, error) { - req, out := c.CreateVpcEndpointRequest(input) - return out, req.Send() -} - -// CreateVpcEndpointWithContext is the same as CreateVpcEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See CreateVpcEndpoint 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 *OpenSearchServerless) CreateVpcEndpointWithContext(ctx aws.Context, input *CreateVpcEndpointInput, opts ...request.Option) (*CreateVpcEndpointOutput, error) { - req, out := c.CreateVpcEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAccessPolicy = "DeleteAccessPolicy" - -// DeleteAccessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAccessPolicy 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 DeleteAccessPolicy for more information on using the DeleteAccessPolicy -// 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 DeleteAccessPolicyRequest method. -// req, resp := client.DeleteAccessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteAccessPolicy -func (c *OpenSearchServerless) DeleteAccessPolicyRequest(input *DeleteAccessPolicyInput) (req *request.Request, output *DeleteAccessPolicyOutput) { - op := &request.Operation{ - Name: opDeleteAccessPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAccessPolicyInput{} - } - - output = &DeleteAccessPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAccessPolicy API operation for OpenSearch Service Serverless. -// -// Deletes an OpenSearch Serverless access policy. For more information, see -// Data access control for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html). -// -// 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 OpenSearch Service Serverless's -// API operation DeleteAccessPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteAccessPolicy -func (c *OpenSearchServerless) DeleteAccessPolicy(input *DeleteAccessPolicyInput) (*DeleteAccessPolicyOutput, error) { - req, out := c.DeleteAccessPolicyRequest(input) - return out, req.Send() -} - -// DeleteAccessPolicyWithContext is the same as DeleteAccessPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAccessPolicy 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 *OpenSearchServerless) DeleteAccessPolicyWithContext(ctx aws.Context, input *DeleteAccessPolicyInput, opts ...request.Option) (*DeleteAccessPolicyOutput, error) { - req, out := c.DeleteAccessPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCollection = "DeleteCollection" - -// DeleteCollectionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCollection 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 DeleteCollection for more information on using the DeleteCollection -// 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 DeleteCollectionRequest method. -// req, resp := client.DeleteCollectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteCollection -func (c *OpenSearchServerless) DeleteCollectionRequest(input *DeleteCollectionInput) (req *request.Request, output *DeleteCollectionOutput) { - op := &request.Operation{ - Name: opDeleteCollection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCollectionInput{} - } - - output = &DeleteCollectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCollection API operation for OpenSearch Service Serverless. -// -// Deletes an OpenSearch Serverless collection. For more information, see Creating -// and managing Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html). -// -// 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 OpenSearch Service Serverless's -// API operation DeleteCollection for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteCollection -func (c *OpenSearchServerless) DeleteCollection(input *DeleteCollectionInput) (*DeleteCollectionOutput, error) { - req, out := c.DeleteCollectionRequest(input) - return out, req.Send() -} - -// DeleteCollectionWithContext is the same as DeleteCollection with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCollection 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 *OpenSearchServerless) DeleteCollectionWithContext(ctx aws.Context, input *DeleteCollectionInput, opts ...request.Option) (*DeleteCollectionOutput, error) { - req, out := c.DeleteCollectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteLifecyclePolicy = "DeleteLifecyclePolicy" - -// DeleteLifecyclePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLifecyclePolicy 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 DeleteLifecyclePolicy for more information on using the DeleteLifecyclePolicy -// 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 DeleteLifecyclePolicyRequest method. -// req, resp := client.DeleteLifecyclePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteLifecyclePolicy -func (c *OpenSearchServerless) DeleteLifecyclePolicyRequest(input *DeleteLifecyclePolicyInput) (req *request.Request, output *DeleteLifecyclePolicyOutput) { - op := &request.Operation{ - Name: opDeleteLifecyclePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLifecyclePolicyInput{} - } - - output = &DeleteLifecyclePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteLifecyclePolicy API operation for OpenSearch Service Serverless. -// -// Deletes an OpenSearch Serverless lifecycle policy. For more information, -// see Deleting data lifecycle policies (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-lifecycle.html#serverless-lifecycle-delete). -// -// 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 OpenSearch Service Serverless's -// API operation DeleteLifecyclePolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteLifecyclePolicy -func (c *OpenSearchServerless) DeleteLifecyclePolicy(input *DeleteLifecyclePolicyInput) (*DeleteLifecyclePolicyOutput, error) { - req, out := c.DeleteLifecyclePolicyRequest(input) - return out, req.Send() -} - -// DeleteLifecyclePolicyWithContext is the same as DeleteLifecyclePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteLifecyclePolicy 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 *OpenSearchServerless) DeleteLifecyclePolicyWithContext(ctx aws.Context, input *DeleteLifecyclePolicyInput, opts ...request.Option) (*DeleteLifecyclePolicyOutput, error) { - req, out := c.DeleteLifecyclePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSecurityConfig = "DeleteSecurityConfig" - -// DeleteSecurityConfigRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSecurityConfig 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 DeleteSecurityConfig for more information on using the DeleteSecurityConfig -// 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 DeleteSecurityConfigRequest method. -// req, resp := client.DeleteSecurityConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteSecurityConfig -func (c *OpenSearchServerless) DeleteSecurityConfigRequest(input *DeleteSecurityConfigInput) (req *request.Request, output *DeleteSecurityConfigOutput) { - op := &request.Operation{ - Name: opDeleteSecurityConfig, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSecurityConfigInput{} - } - - output = &DeleteSecurityConfigOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSecurityConfig API operation for OpenSearch Service Serverless. -// -// Deletes a security configuration for OpenSearch Serverless. For more information, -// see SAML authentication for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html). -// -// 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 OpenSearch Service Serverless's -// API operation DeleteSecurityConfig for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteSecurityConfig -func (c *OpenSearchServerless) DeleteSecurityConfig(input *DeleteSecurityConfigInput) (*DeleteSecurityConfigOutput, error) { - req, out := c.DeleteSecurityConfigRequest(input) - return out, req.Send() -} - -// DeleteSecurityConfigWithContext is the same as DeleteSecurityConfig with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSecurityConfig 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 *OpenSearchServerless) DeleteSecurityConfigWithContext(ctx aws.Context, input *DeleteSecurityConfigInput, opts ...request.Option) (*DeleteSecurityConfigOutput, error) { - req, out := c.DeleteSecurityConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSecurityPolicy = "DeleteSecurityPolicy" - -// DeleteSecurityPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSecurityPolicy 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 DeleteSecurityPolicy for more information on using the DeleteSecurityPolicy -// 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 DeleteSecurityPolicyRequest method. -// req, resp := client.DeleteSecurityPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteSecurityPolicy -func (c *OpenSearchServerless) DeleteSecurityPolicyRequest(input *DeleteSecurityPolicyInput) (req *request.Request, output *DeleteSecurityPolicyOutput) { - op := &request.Operation{ - Name: opDeleteSecurityPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSecurityPolicyInput{} - } - - output = &DeleteSecurityPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSecurityPolicy API operation for OpenSearch Service Serverless. -// -// Deletes an OpenSearch Serverless security policy. -// -// 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 OpenSearch Service Serverless's -// API operation DeleteSecurityPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteSecurityPolicy -func (c *OpenSearchServerless) DeleteSecurityPolicy(input *DeleteSecurityPolicyInput) (*DeleteSecurityPolicyOutput, error) { - req, out := c.DeleteSecurityPolicyRequest(input) - return out, req.Send() -} - -// DeleteSecurityPolicyWithContext is the same as DeleteSecurityPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSecurityPolicy 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 *OpenSearchServerless) DeleteSecurityPolicyWithContext(ctx aws.Context, input *DeleteSecurityPolicyInput, opts ...request.Option) (*DeleteSecurityPolicyOutput, error) { - req, out := c.DeleteSecurityPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVpcEndpoint = "DeleteVpcEndpoint" - -// DeleteVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVpcEndpoint 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 DeleteVpcEndpoint for more information on using the DeleteVpcEndpoint -// 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 DeleteVpcEndpointRequest method. -// req, resp := client.DeleteVpcEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteVpcEndpoint -func (c *OpenSearchServerless) DeleteVpcEndpointRequest(input *DeleteVpcEndpointInput) (req *request.Request, output *DeleteVpcEndpointOutput) { - op := &request.Operation{ - Name: opDeleteVpcEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteVpcEndpointInput{} - } - - output = &DeleteVpcEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteVpcEndpoint API operation for OpenSearch Service Serverless. -// -// Deletes an OpenSearch Serverless-managed interface endpoint. For more information, -// see Access Amazon OpenSearch Serverless using an interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html). -// -// 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 OpenSearch Service Serverless's -// API operation DeleteVpcEndpoint for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/DeleteVpcEndpoint -func (c *OpenSearchServerless) DeleteVpcEndpoint(input *DeleteVpcEndpointInput) (*DeleteVpcEndpointOutput, error) { - req, out := c.DeleteVpcEndpointRequest(input) - return out, req.Send() -} - -// DeleteVpcEndpointWithContext is the same as DeleteVpcEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVpcEndpoint 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 *OpenSearchServerless) DeleteVpcEndpointWithContext(ctx aws.Context, input *DeleteVpcEndpointInput, opts ...request.Option) (*DeleteVpcEndpointOutput, error) { - req, out := c.DeleteVpcEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAccessPolicy = "GetAccessPolicy" - -// GetAccessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetAccessPolicy 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 GetAccessPolicy for more information on using the GetAccessPolicy -// 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 GetAccessPolicyRequest method. -// req, resp := client.GetAccessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetAccessPolicy -func (c *OpenSearchServerless) GetAccessPolicyRequest(input *GetAccessPolicyInput) (req *request.Request, output *GetAccessPolicyOutput) { - op := &request.Operation{ - Name: opGetAccessPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAccessPolicyInput{} - } - - output = &GetAccessPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccessPolicy API operation for OpenSearch Service Serverless. -// -// Returns an OpenSearch Serverless access policy. For more information, see -// Data access control for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html). -// -// 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 OpenSearch Service Serverless's -// API operation GetAccessPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetAccessPolicy -func (c *OpenSearchServerless) GetAccessPolicy(input *GetAccessPolicyInput) (*GetAccessPolicyOutput, error) { - req, out := c.GetAccessPolicyRequest(input) - return out, req.Send() -} - -// GetAccessPolicyWithContext is the same as GetAccessPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetAccessPolicy 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 *OpenSearchServerless) GetAccessPolicyWithContext(ctx aws.Context, input *GetAccessPolicyInput, opts ...request.Option) (*GetAccessPolicyOutput, error) { - req, out := c.GetAccessPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAccountSettings = "GetAccountSettings" - -// GetAccountSettingsRequest generates a "aws/request.Request" representing the -// client's request for the GetAccountSettings 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 GetAccountSettings for more information on using the GetAccountSettings -// 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 GetAccountSettingsRequest method. -// req, resp := client.GetAccountSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetAccountSettings -func (c *OpenSearchServerless) GetAccountSettingsRequest(input *GetAccountSettingsInput) (req *request.Request, output *GetAccountSettingsOutput) { - op := &request.Operation{ - Name: opGetAccountSettings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAccountSettingsInput{} - } - - output = &GetAccountSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccountSettings API operation for OpenSearch Service Serverless. -// -// Returns account-level settings related to OpenSearch Serverless. -// -// 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 OpenSearch Service Serverless's -// API operation GetAccountSettings for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetAccountSettings -func (c *OpenSearchServerless) GetAccountSettings(input *GetAccountSettingsInput) (*GetAccountSettingsOutput, error) { - req, out := c.GetAccountSettingsRequest(input) - return out, req.Send() -} - -// GetAccountSettingsWithContext is the same as GetAccountSettings with the addition of -// the ability to pass a context and additional request options. -// -// See GetAccountSettings 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 *OpenSearchServerless) GetAccountSettingsWithContext(ctx aws.Context, input *GetAccountSettingsInput, opts ...request.Option) (*GetAccountSettingsOutput, error) { - req, out := c.GetAccountSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPoliciesStats = "GetPoliciesStats" - -// GetPoliciesStatsRequest generates a "aws/request.Request" representing the -// client's request for the GetPoliciesStats 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 GetPoliciesStats for more information on using the GetPoliciesStats -// 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 GetPoliciesStatsRequest method. -// req, resp := client.GetPoliciesStatsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetPoliciesStats -func (c *OpenSearchServerless) GetPoliciesStatsRequest(input *GetPoliciesStatsInput) (req *request.Request, output *GetPoliciesStatsOutput) { - op := &request.Operation{ - Name: opGetPoliciesStats, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPoliciesStatsInput{} - } - - output = &GetPoliciesStatsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPoliciesStats API operation for OpenSearch Service Serverless. -// -// Returns statistical information about your OpenSearch Serverless access policies, -// security configurations, and security policies. -// -// 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 OpenSearch Service Serverless's -// API operation GetPoliciesStats for usage and error information. -// -// Returned Error Types: -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetPoliciesStats -func (c *OpenSearchServerless) GetPoliciesStats(input *GetPoliciesStatsInput) (*GetPoliciesStatsOutput, error) { - req, out := c.GetPoliciesStatsRequest(input) - return out, req.Send() -} - -// GetPoliciesStatsWithContext is the same as GetPoliciesStats with the addition of -// the ability to pass a context and additional request options. -// -// See GetPoliciesStats 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 *OpenSearchServerless) GetPoliciesStatsWithContext(ctx aws.Context, input *GetPoliciesStatsInput, opts ...request.Option) (*GetPoliciesStatsOutput, error) { - req, out := c.GetPoliciesStatsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSecurityConfig = "GetSecurityConfig" - -// GetSecurityConfigRequest generates a "aws/request.Request" representing the -// client's request for the GetSecurityConfig 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 GetSecurityConfig for more information on using the GetSecurityConfig -// 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 GetSecurityConfigRequest method. -// req, resp := client.GetSecurityConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetSecurityConfig -func (c *OpenSearchServerless) GetSecurityConfigRequest(input *GetSecurityConfigInput) (req *request.Request, output *GetSecurityConfigOutput) { - op := &request.Operation{ - Name: opGetSecurityConfig, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSecurityConfigInput{} - } - - output = &GetSecurityConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSecurityConfig API operation for OpenSearch Service Serverless. -// -// Returns information about an OpenSearch Serverless security configuration. -// For more information, see SAML authentication for Amazon OpenSearch Serverless -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html). -// -// 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 OpenSearch Service Serverless's -// API operation GetSecurityConfig for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetSecurityConfig -func (c *OpenSearchServerless) GetSecurityConfig(input *GetSecurityConfigInput) (*GetSecurityConfigOutput, error) { - req, out := c.GetSecurityConfigRequest(input) - return out, req.Send() -} - -// GetSecurityConfigWithContext is the same as GetSecurityConfig with the addition of -// the ability to pass a context and additional request options. -// -// See GetSecurityConfig 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 *OpenSearchServerless) GetSecurityConfigWithContext(ctx aws.Context, input *GetSecurityConfigInput, opts ...request.Option) (*GetSecurityConfigOutput, error) { - req, out := c.GetSecurityConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSecurityPolicy = "GetSecurityPolicy" - -// GetSecurityPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetSecurityPolicy 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 GetSecurityPolicy for more information on using the GetSecurityPolicy -// 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 GetSecurityPolicyRequest method. -// req, resp := client.GetSecurityPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetSecurityPolicy -func (c *OpenSearchServerless) GetSecurityPolicyRequest(input *GetSecurityPolicyInput) (req *request.Request, output *GetSecurityPolicyOutput) { - op := &request.Operation{ - Name: opGetSecurityPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSecurityPolicyInput{} - } - - output = &GetSecurityPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSecurityPolicy API operation for OpenSearch Service Serverless. -// -// Returns information about a configured OpenSearch Serverless security policy. -// For more information, see Network access for Amazon OpenSearch Serverless -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-network.html) -// and Encryption at rest for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-encryption.html). -// -// 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 OpenSearch Service Serverless's -// API operation GetSecurityPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/GetSecurityPolicy -func (c *OpenSearchServerless) GetSecurityPolicy(input *GetSecurityPolicyInput) (*GetSecurityPolicyOutput, error) { - req, out := c.GetSecurityPolicyRequest(input) - return out, req.Send() -} - -// GetSecurityPolicyWithContext is the same as GetSecurityPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetSecurityPolicy 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 *OpenSearchServerless) GetSecurityPolicyWithContext(ctx aws.Context, input *GetSecurityPolicyInput, opts ...request.Option) (*GetSecurityPolicyOutput, error) { - req, out := c.GetSecurityPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAccessPolicies = "ListAccessPolicies" - -// ListAccessPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListAccessPolicies 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 ListAccessPolicies for more information on using the ListAccessPolicies -// 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 ListAccessPoliciesRequest method. -// req, resp := client.ListAccessPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListAccessPolicies -func (c *OpenSearchServerless) ListAccessPoliciesRequest(input *ListAccessPoliciesInput) (req *request.Request, output *ListAccessPoliciesOutput) { - op := &request.Operation{ - Name: opListAccessPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAccessPoliciesInput{} - } - - output = &ListAccessPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAccessPolicies API operation for OpenSearch Service Serverless. -// -// Returns information about a list of OpenSearch Serverless access policies. -// -// 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 OpenSearch Service Serverless's -// API operation ListAccessPolicies for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListAccessPolicies -func (c *OpenSearchServerless) ListAccessPolicies(input *ListAccessPoliciesInput) (*ListAccessPoliciesOutput, error) { - req, out := c.ListAccessPoliciesRequest(input) - return out, req.Send() -} - -// ListAccessPoliciesWithContext is the same as ListAccessPolicies with the addition of -// the ability to pass a context and additional request options. -// -// See ListAccessPolicies 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 *OpenSearchServerless) ListAccessPoliciesWithContext(ctx aws.Context, input *ListAccessPoliciesInput, opts ...request.Option) (*ListAccessPoliciesOutput, error) { - req, out := c.ListAccessPoliciesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAccessPoliciesPages iterates over the pages of a ListAccessPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccessPolicies method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAccessPolicies operation. -// pageNum := 0 -// err := client.ListAccessPoliciesPages(params, -// func(page *opensearchserverless.ListAccessPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OpenSearchServerless) ListAccessPoliciesPages(input *ListAccessPoliciesInput, fn func(*ListAccessPoliciesOutput, bool) bool) error { - return c.ListAccessPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccessPoliciesPagesWithContext same as ListAccessPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OpenSearchServerless) ListAccessPoliciesPagesWithContext(ctx aws.Context, input *ListAccessPoliciesInput, fn func(*ListAccessPoliciesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAccessPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAccessPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAccessPoliciesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListCollections = "ListCollections" - -// ListCollectionsRequest generates a "aws/request.Request" representing the -// client's request for the ListCollections 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 ListCollections for more information on using the ListCollections -// 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 ListCollectionsRequest method. -// req, resp := client.ListCollectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListCollections -func (c *OpenSearchServerless) ListCollectionsRequest(input *ListCollectionsInput) (req *request.Request, output *ListCollectionsOutput) { - op := &request.Operation{ - Name: opListCollections, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCollectionsInput{} - } - - output = &ListCollectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCollections API operation for OpenSearch Service Serverless. -// -// Lists all OpenSearch Serverless collections. For more information, see Creating -// and managing Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html). -// -// Make sure to include an empty request body {} if you don't include any collection -// filters in the request. -// -// 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 OpenSearch Service Serverless's -// API operation ListCollections for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListCollections -func (c *OpenSearchServerless) ListCollections(input *ListCollectionsInput) (*ListCollectionsOutput, error) { - req, out := c.ListCollectionsRequest(input) - return out, req.Send() -} - -// ListCollectionsWithContext is the same as ListCollections with the addition of -// the ability to pass a context and additional request options. -// -// See ListCollections 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 *OpenSearchServerless) ListCollectionsWithContext(ctx aws.Context, input *ListCollectionsInput, opts ...request.Option) (*ListCollectionsOutput, error) { - req, out := c.ListCollectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCollectionsPages iterates over the pages of a ListCollections operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCollections method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCollections operation. -// pageNum := 0 -// err := client.ListCollectionsPages(params, -// func(page *opensearchserverless.ListCollectionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OpenSearchServerless) ListCollectionsPages(input *ListCollectionsInput, fn func(*ListCollectionsOutput, bool) bool) error { - return c.ListCollectionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCollectionsPagesWithContext same as ListCollectionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OpenSearchServerless) ListCollectionsPagesWithContext(ctx aws.Context, input *ListCollectionsInput, fn func(*ListCollectionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCollectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCollectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCollectionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListLifecyclePolicies = "ListLifecyclePolicies" - -// ListLifecyclePoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListLifecyclePolicies 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 ListLifecyclePolicies for more information on using the ListLifecyclePolicies -// 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 ListLifecyclePoliciesRequest method. -// req, resp := client.ListLifecyclePoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListLifecyclePolicies -func (c *OpenSearchServerless) ListLifecyclePoliciesRequest(input *ListLifecyclePoliciesInput) (req *request.Request, output *ListLifecyclePoliciesOutput) { - op := &request.Operation{ - Name: opListLifecyclePolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListLifecyclePoliciesInput{} - } - - output = &ListLifecyclePoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLifecyclePolicies API operation for OpenSearch Service Serverless. -// -// Returns a list of OpenSearch Serverless lifecycle policies. For more information, -// see Viewing data lifecycle policies (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-lifecycle.html#serverless-lifecycle-list). -// -// 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 OpenSearch Service Serverless's -// API operation ListLifecyclePolicies for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListLifecyclePolicies -func (c *OpenSearchServerless) ListLifecyclePolicies(input *ListLifecyclePoliciesInput) (*ListLifecyclePoliciesOutput, error) { - req, out := c.ListLifecyclePoliciesRequest(input) - return out, req.Send() -} - -// ListLifecyclePoliciesWithContext is the same as ListLifecyclePolicies with the addition of -// the ability to pass a context and additional request options. -// -// See ListLifecyclePolicies 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 *OpenSearchServerless) ListLifecyclePoliciesWithContext(ctx aws.Context, input *ListLifecyclePoliciesInput, opts ...request.Option) (*ListLifecyclePoliciesOutput, error) { - req, out := c.ListLifecyclePoliciesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListLifecyclePoliciesPages iterates over the pages of a ListLifecyclePolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLifecyclePolicies method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListLifecyclePolicies operation. -// pageNum := 0 -// err := client.ListLifecyclePoliciesPages(params, -// func(page *opensearchserverless.ListLifecyclePoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OpenSearchServerless) ListLifecyclePoliciesPages(input *ListLifecyclePoliciesInput, fn func(*ListLifecyclePoliciesOutput, bool) bool) error { - return c.ListLifecyclePoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLifecyclePoliciesPagesWithContext same as ListLifecyclePoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OpenSearchServerless) ListLifecyclePoliciesPagesWithContext(ctx aws.Context, input *ListLifecyclePoliciesInput, fn func(*ListLifecyclePoliciesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLifecyclePoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLifecyclePoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListLifecyclePoliciesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSecurityConfigs = "ListSecurityConfigs" - -// ListSecurityConfigsRequest generates a "aws/request.Request" representing the -// client's request for the ListSecurityConfigs 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 ListSecurityConfigs for more information on using the ListSecurityConfigs -// 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 ListSecurityConfigsRequest method. -// req, resp := client.ListSecurityConfigsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListSecurityConfigs -func (c *OpenSearchServerless) ListSecurityConfigsRequest(input *ListSecurityConfigsInput) (req *request.Request, output *ListSecurityConfigsOutput) { - op := &request.Operation{ - Name: opListSecurityConfigs, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSecurityConfigsInput{} - } - - output = &ListSecurityConfigsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSecurityConfigs API operation for OpenSearch Service Serverless. -// -// Returns information about configured OpenSearch Serverless security configurations. -// For more information, see SAML authentication for Amazon OpenSearch Serverless -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html). -// -// 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 OpenSearch Service Serverless's -// API operation ListSecurityConfigs for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListSecurityConfigs -func (c *OpenSearchServerless) ListSecurityConfigs(input *ListSecurityConfigsInput) (*ListSecurityConfigsOutput, error) { - req, out := c.ListSecurityConfigsRequest(input) - return out, req.Send() -} - -// ListSecurityConfigsWithContext is the same as ListSecurityConfigs with the addition of -// the ability to pass a context and additional request options. -// -// See ListSecurityConfigs 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 *OpenSearchServerless) ListSecurityConfigsWithContext(ctx aws.Context, input *ListSecurityConfigsInput, opts ...request.Option) (*ListSecurityConfigsOutput, error) { - req, out := c.ListSecurityConfigsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSecurityConfigsPages iterates over the pages of a ListSecurityConfigs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSecurityConfigs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSecurityConfigs operation. -// pageNum := 0 -// err := client.ListSecurityConfigsPages(params, -// func(page *opensearchserverless.ListSecurityConfigsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OpenSearchServerless) ListSecurityConfigsPages(input *ListSecurityConfigsInput, fn func(*ListSecurityConfigsOutput, bool) bool) error { - return c.ListSecurityConfigsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSecurityConfigsPagesWithContext same as ListSecurityConfigsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OpenSearchServerless) ListSecurityConfigsPagesWithContext(ctx aws.Context, input *ListSecurityConfigsInput, fn func(*ListSecurityConfigsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSecurityConfigsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSecurityConfigsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSecurityConfigsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSecurityPolicies = "ListSecurityPolicies" - -// ListSecurityPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListSecurityPolicies 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 ListSecurityPolicies for more information on using the ListSecurityPolicies -// 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 ListSecurityPoliciesRequest method. -// req, resp := client.ListSecurityPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListSecurityPolicies -func (c *OpenSearchServerless) ListSecurityPoliciesRequest(input *ListSecurityPoliciesInput) (req *request.Request, output *ListSecurityPoliciesOutput) { - op := &request.Operation{ - Name: opListSecurityPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSecurityPoliciesInput{} - } - - output = &ListSecurityPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSecurityPolicies API operation for OpenSearch Service Serverless. -// -// Returns information about configured OpenSearch Serverless security policies. -// -// 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 OpenSearch Service Serverless's -// API operation ListSecurityPolicies for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListSecurityPolicies -func (c *OpenSearchServerless) ListSecurityPolicies(input *ListSecurityPoliciesInput) (*ListSecurityPoliciesOutput, error) { - req, out := c.ListSecurityPoliciesRequest(input) - return out, req.Send() -} - -// ListSecurityPoliciesWithContext is the same as ListSecurityPolicies with the addition of -// the ability to pass a context and additional request options. -// -// See ListSecurityPolicies 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 *OpenSearchServerless) ListSecurityPoliciesWithContext(ctx aws.Context, input *ListSecurityPoliciesInput, opts ...request.Option) (*ListSecurityPoliciesOutput, error) { - req, out := c.ListSecurityPoliciesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSecurityPoliciesPages iterates over the pages of a ListSecurityPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSecurityPolicies method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSecurityPolicies operation. -// pageNum := 0 -// err := client.ListSecurityPoliciesPages(params, -// func(page *opensearchserverless.ListSecurityPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OpenSearchServerless) ListSecurityPoliciesPages(input *ListSecurityPoliciesInput, fn func(*ListSecurityPoliciesOutput, bool) bool) error { - return c.ListSecurityPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSecurityPoliciesPagesWithContext same as ListSecurityPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OpenSearchServerless) ListSecurityPoliciesPagesWithContext(ctx aws.Context, input *ListSecurityPoliciesInput, fn func(*ListSecurityPoliciesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSecurityPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSecurityPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSecurityPoliciesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListTagsForResource -func (c *OpenSearchServerless) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for OpenSearch Service Serverless. -// -// Returns the tags for an OpenSearch Serverless resource. For more information, -// see Tagging Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-collection.html). -// -// 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 OpenSearch Service Serverless's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListTagsForResource -func (c *OpenSearchServerless) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *OpenSearchServerless) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListVpcEndpoints = "ListVpcEndpoints" - -// ListVpcEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the ListVpcEndpoints 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 ListVpcEndpoints for more information on using the ListVpcEndpoints -// 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 ListVpcEndpointsRequest method. -// req, resp := client.ListVpcEndpointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListVpcEndpoints -func (c *OpenSearchServerless) ListVpcEndpointsRequest(input *ListVpcEndpointsInput) (req *request.Request, output *ListVpcEndpointsOutput) { - op := &request.Operation{ - Name: opListVpcEndpoints, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVpcEndpointsInput{} - } - - output = &ListVpcEndpointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVpcEndpoints API operation for OpenSearch Service Serverless. -// -// Returns the OpenSearch Serverless-managed interface VPC endpoints associated -// with the current account. For more information, see Access Amazon OpenSearch -// Serverless using an interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html). -// -// 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 OpenSearch Service Serverless's -// API operation ListVpcEndpoints for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/ListVpcEndpoints -func (c *OpenSearchServerless) ListVpcEndpoints(input *ListVpcEndpointsInput) (*ListVpcEndpointsOutput, error) { - req, out := c.ListVpcEndpointsRequest(input) - return out, req.Send() -} - -// ListVpcEndpointsWithContext is the same as ListVpcEndpoints with the addition of -// the ability to pass a context and additional request options. -// -// See ListVpcEndpoints 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 *OpenSearchServerless) ListVpcEndpointsWithContext(ctx aws.Context, input *ListVpcEndpointsInput, opts ...request.Option) (*ListVpcEndpointsOutput, error) { - req, out := c.ListVpcEndpointsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVpcEndpointsPages iterates over the pages of a ListVpcEndpoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVpcEndpoints method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVpcEndpoints operation. -// pageNum := 0 -// err := client.ListVpcEndpointsPages(params, -// func(page *opensearchserverless.ListVpcEndpointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OpenSearchServerless) ListVpcEndpointsPages(input *ListVpcEndpointsInput, fn func(*ListVpcEndpointsOutput, bool) bool) error { - return c.ListVpcEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVpcEndpointsPagesWithContext same as ListVpcEndpointsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OpenSearchServerless) ListVpcEndpointsPagesWithContext(ctx aws.Context, input *ListVpcEndpointsInput, fn func(*ListVpcEndpointsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVpcEndpointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVpcEndpointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVpcEndpointsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/TagResource -func (c *OpenSearchServerless) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for OpenSearch Service Serverless. -// -// Associates tags with an OpenSearch Serverless resource. For more information, -// see Tagging Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-collection.html). -// -// 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 OpenSearch Service Serverless's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/TagResource -func (c *OpenSearchServerless) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *OpenSearchServerless) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UntagResource -func (c *OpenSearchServerless) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for OpenSearch Service Serverless. -// -// Removes a tag or set of tags from an OpenSearch Serverless resource. For -// more information, see Tagging Amazon OpenSearch Serverless collections (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-collection.html). -// -// 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 OpenSearch Service Serverless's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UntagResource -func (c *OpenSearchServerless) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *OpenSearchServerless) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAccessPolicy = "UpdateAccessPolicy" - -// UpdateAccessPolicyRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAccessPolicy 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 UpdateAccessPolicy for more information on using the UpdateAccessPolicy -// 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 UpdateAccessPolicyRequest method. -// req, resp := client.UpdateAccessPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateAccessPolicy -func (c *OpenSearchServerless) UpdateAccessPolicyRequest(input *UpdateAccessPolicyInput) (req *request.Request, output *UpdateAccessPolicyOutput) { - op := &request.Operation{ - Name: opUpdateAccessPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAccessPolicyInput{} - } - - output = &UpdateAccessPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAccessPolicy API operation for OpenSearch Service Serverless. -// -// Updates an OpenSearch Serverless access policy. For more information, see -// Data access control for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html). -// -// 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 OpenSearch Service Serverless's -// API operation UpdateAccessPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateAccessPolicy -func (c *OpenSearchServerless) UpdateAccessPolicy(input *UpdateAccessPolicyInput) (*UpdateAccessPolicyOutput, error) { - req, out := c.UpdateAccessPolicyRequest(input) - return out, req.Send() -} - -// UpdateAccessPolicyWithContext is the same as UpdateAccessPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAccessPolicy 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 *OpenSearchServerless) UpdateAccessPolicyWithContext(ctx aws.Context, input *UpdateAccessPolicyInput, opts ...request.Option) (*UpdateAccessPolicyOutput, error) { - req, out := c.UpdateAccessPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAccountSettings = "UpdateAccountSettings" - -// UpdateAccountSettingsRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAccountSettings 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 UpdateAccountSettings for more information on using the UpdateAccountSettings -// 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 UpdateAccountSettingsRequest method. -// req, resp := client.UpdateAccountSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateAccountSettings -func (c *OpenSearchServerless) UpdateAccountSettingsRequest(input *UpdateAccountSettingsInput) (req *request.Request, output *UpdateAccountSettingsOutput) { - op := &request.Operation{ - Name: opUpdateAccountSettings, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAccountSettingsInput{} - } - - output = &UpdateAccountSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAccountSettings API operation for OpenSearch Service Serverless. -// -// Update the OpenSearch Serverless settings for the current Amazon Web Services -// account. For more information, see Managing capacity limits for Amazon OpenSearch -// Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-scaling.html). -// -// 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 OpenSearch Service Serverless's -// API operation UpdateAccountSettings for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateAccountSettings -func (c *OpenSearchServerless) UpdateAccountSettings(input *UpdateAccountSettingsInput) (*UpdateAccountSettingsOutput, error) { - req, out := c.UpdateAccountSettingsRequest(input) - return out, req.Send() -} - -// UpdateAccountSettingsWithContext is the same as UpdateAccountSettings with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAccountSettings 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 *OpenSearchServerless) UpdateAccountSettingsWithContext(ctx aws.Context, input *UpdateAccountSettingsInput, opts ...request.Option) (*UpdateAccountSettingsOutput, error) { - req, out := c.UpdateAccountSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCollection = "UpdateCollection" - -// UpdateCollectionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCollection 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 UpdateCollection for more information on using the UpdateCollection -// 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 UpdateCollectionRequest method. -// req, resp := client.UpdateCollectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateCollection -func (c *OpenSearchServerless) UpdateCollectionRequest(input *UpdateCollectionInput) (req *request.Request, output *UpdateCollectionOutput) { - op := &request.Operation{ - Name: opUpdateCollection, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateCollectionInput{} - } - - output = &UpdateCollectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateCollection API operation for OpenSearch Service Serverless. -// -// Updates an OpenSearch Serverless collection. -// -// 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 OpenSearch Service Serverless's -// API operation UpdateCollection for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateCollection -func (c *OpenSearchServerless) UpdateCollection(input *UpdateCollectionInput) (*UpdateCollectionOutput, error) { - req, out := c.UpdateCollectionRequest(input) - return out, req.Send() -} - -// UpdateCollectionWithContext is the same as UpdateCollection with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCollection 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 *OpenSearchServerless) UpdateCollectionWithContext(ctx aws.Context, input *UpdateCollectionInput, opts ...request.Option) (*UpdateCollectionOutput, error) { - req, out := c.UpdateCollectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateLifecyclePolicy = "UpdateLifecyclePolicy" - -// UpdateLifecyclePolicyRequest generates a "aws/request.Request" representing the -// client's request for the UpdateLifecyclePolicy 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 UpdateLifecyclePolicy for more information on using the UpdateLifecyclePolicy -// 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 UpdateLifecyclePolicyRequest method. -// req, resp := client.UpdateLifecyclePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateLifecyclePolicy -func (c *OpenSearchServerless) UpdateLifecyclePolicyRequest(input *UpdateLifecyclePolicyInput) (req *request.Request, output *UpdateLifecyclePolicyOutput) { - op := &request.Operation{ - Name: opUpdateLifecyclePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateLifecyclePolicyInput{} - } - - output = &UpdateLifecyclePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateLifecyclePolicy API operation for OpenSearch Service Serverless. -// -// Updates an OpenSearch Serverless access policy. For more information, see -// Updating data lifecycle policies (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-lifecycle.html#serverless-lifecycle-update). -// -// 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 OpenSearch Service Serverless's -// API operation UpdateLifecyclePolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateLifecyclePolicy -func (c *OpenSearchServerless) UpdateLifecyclePolicy(input *UpdateLifecyclePolicyInput) (*UpdateLifecyclePolicyOutput, error) { - req, out := c.UpdateLifecyclePolicyRequest(input) - return out, req.Send() -} - -// UpdateLifecyclePolicyWithContext is the same as UpdateLifecyclePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateLifecyclePolicy 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 *OpenSearchServerless) UpdateLifecyclePolicyWithContext(ctx aws.Context, input *UpdateLifecyclePolicyInput, opts ...request.Option) (*UpdateLifecyclePolicyOutput, error) { - req, out := c.UpdateLifecyclePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSecurityConfig = "UpdateSecurityConfig" - -// UpdateSecurityConfigRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSecurityConfig 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 UpdateSecurityConfig for more information on using the UpdateSecurityConfig -// 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 UpdateSecurityConfigRequest method. -// req, resp := client.UpdateSecurityConfigRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateSecurityConfig -func (c *OpenSearchServerless) UpdateSecurityConfigRequest(input *UpdateSecurityConfigInput) (req *request.Request, output *UpdateSecurityConfigOutput) { - op := &request.Operation{ - Name: opUpdateSecurityConfig, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSecurityConfigInput{} - } - - output = &UpdateSecurityConfigOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSecurityConfig API operation for OpenSearch Service Serverless. -// -// Updates a security configuration for OpenSearch Serverless. For more information, -// see SAML authentication for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-saml.html). -// -// 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 OpenSearch Service Serverless's -// API operation UpdateSecurityConfig for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateSecurityConfig -func (c *OpenSearchServerless) UpdateSecurityConfig(input *UpdateSecurityConfigInput) (*UpdateSecurityConfigOutput, error) { - req, out := c.UpdateSecurityConfigRequest(input) - return out, req.Send() -} - -// UpdateSecurityConfigWithContext is the same as UpdateSecurityConfig with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSecurityConfig 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 *OpenSearchServerless) UpdateSecurityConfigWithContext(ctx aws.Context, input *UpdateSecurityConfigInput, opts ...request.Option) (*UpdateSecurityConfigOutput, error) { - req, out := c.UpdateSecurityConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSecurityPolicy = "UpdateSecurityPolicy" - -// UpdateSecurityPolicyRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSecurityPolicy 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 UpdateSecurityPolicy for more information on using the UpdateSecurityPolicy -// 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 UpdateSecurityPolicyRequest method. -// req, resp := client.UpdateSecurityPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateSecurityPolicy -func (c *OpenSearchServerless) UpdateSecurityPolicyRequest(input *UpdateSecurityPolicyInput) (req *request.Request, output *UpdateSecurityPolicyOutput) { - op := &request.Operation{ - Name: opUpdateSecurityPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSecurityPolicyInput{} - } - - output = &UpdateSecurityPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSecurityPolicy API operation for OpenSearch Service Serverless. -// -// Updates an OpenSearch Serverless security policy. For more information, see -// Network access for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-network.html) -// and Encryption at rest for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-encryption.html). -// -// 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 OpenSearch Service Serverless's -// API operation UpdateSecurityPolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ResourceNotFoundException -// Thrown when accessing or deleting a resource that does not exist. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// - ServiceQuotaExceededException -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateSecurityPolicy -func (c *OpenSearchServerless) UpdateSecurityPolicy(input *UpdateSecurityPolicyInput) (*UpdateSecurityPolicyOutput, error) { - req, out := c.UpdateSecurityPolicyRequest(input) - return out, req.Send() -} - -// UpdateSecurityPolicyWithContext is the same as UpdateSecurityPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSecurityPolicy 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 *OpenSearchServerless) UpdateSecurityPolicyWithContext(ctx aws.Context, input *UpdateSecurityPolicyInput, opts ...request.Option) (*UpdateSecurityPolicyOutput, error) { - req, out := c.UpdateSecurityPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateVpcEndpoint = "UpdateVpcEndpoint" - -// UpdateVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVpcEndpoint 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 UpdateVpcEndpoint for more information on using the UpdateVpcEndpoint -// 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 UpdateVpcEndpointRequest method. -// req, resp := client.UpdateVpcEndpointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateVpcEndpoint -func (c *OpenSearchServerless) UpdateVpcEndpointRequest(input *UpdateVpcEndpointInput) (req *request.Request, output *UpdateVpcEndpointOutput) { - op := &request.Operation{ - Name: opUpdateVpcEndpoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateVpcEndpointInput{} - } - - output = &UpdateVpcEndpointOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateVpcEndpoint API operation for OpenSearch Service Serverless. -// -// Updates an OpenSearch Serverless-managed interface endpoint. For more information, -// see Access Amazon OpenSearch Serverless using an interface endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html). -// -// 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 OpenSearch Service Serverless's -// API operation UpdateVpcEndpoint for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Thrown when an error internal to the service occurs while processing a request. -// -// - ConflictException -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -// -// - ValidationException -// Thrown when the HTTP request contains invalid input or is missing required -// input. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/UpdateVpcEndpoint -func (c *OpenSearchServerless) UpdateVpcEndpoint(input *UpdateVpcEndpointInput) (*UpdateVpcEndpointOutput, error) { - req, out := c.UpdateVpcEndpointRequest(input) - return out, req.Send() -} - -// UpdateVpcEndpointWithContext is the same as UpdateVpcEndpoint with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateVpcEndpoint 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 *OpenSearchServerless) UpdateVpcEndpointWithContext(ctx aws.Context, input *UpdateVpcEndpointInput, opts ...request.Option) (*UpdateVpcEndpointOutput, error) { - req, out := c.UpdateVpcEndpointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Details about an OpenSearch Serverless access policy. -type AccessPolicyDetail struct { - _ struct{} `type:"structure"` - - // The date the policy was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the policy. - Description *string `locationName:"description" type:"string"` - - // The timestamp of when the policy was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the policy. - Name *string `locationName:"name" min:"3" type:"string"` - - // The version of the policy. - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string"` - - // The type of access policy. - Type *string `locationName:"type" type:"string" enum:"AccessPolicyType"` -} - -// 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 AccessPolicyDetail) 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 AccessPolicyDetail) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *AccessPolicyDetail) SetCreatedDate(v int64) *AccessPolicyDetail { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AccessPolicyDetail) SetDescription(v string) *AccessPolicyDetail { - s.Description = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *AccessPolicyDetail) SetLastModifiedDate(v int64) *AccessPolicyDetail { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *AccessPolicyDetail) SetName(v string) *AccessPolicyDetail { - s.Name = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *AccessPolicyDetail) SetPolicyVersion(v string) *AccessPolicyDetail { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *AccessPolicyDetail) SetType(v string) *AccessPolicyDetail { - s.Type = &v - return s -} - -// Statistics for an OpenSearch Serverless access policy. -type AccessPolicyStats struct { - _ struct{} `type:"structure"` - - // The number of data access policies in the current account. - DataPolicyCount *int64 `type:"long"` -} - -// 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 AccessPolicyStats) 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 AccessPolicyStats) GoString() string { - return s.String() -} - -// SetDataPolicyCount sets the DataPolicyCount field's value. -func (s *AccessPolicyStats) SetDataPolicyCount(v int64) *AccessPolicyStats { - s.DataPolicyCount = &v - return s -} - -// A summary of the data access policy. -type AccessPolicySummary struct { - _ struct{} `type:"structure"` - - // The Epoch time when the access policy was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the access policy. - Description *string `locationName:"description" type:"string"` - - // The date and time when the collection was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the access policy. - Name *string `locationName:"name" min:"3" type:"string"` - - // The version of the policy. - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string"` - - // The type of access policy. Currently, the only available type is data. - Type *string `locationName:"type" type:"string" enum:"AccessPolicyType"` -} - -// 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 AccessPolicySummary) 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 AccessPolicySummary) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *AccessPolicySummary) SetCreatedDate(v int64) *AccessPolicySummary { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AccessPolicySummary) SetDescription(v string) *AccessPolicySummary { - s.Description = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *AccessPolicySummary) SetLastModifiedDate(v int64) *AccessPolicySummary { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *AccessPolicySummary) SetName(v string) *AccessPolicySummary { - s.Name = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *AccessPolicySummary) SetPolicyVersion(v string) *AccessPolicySummary { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *AccessPolicySummary) SetType(v string) *AccessPolicySummary { - s.Type = &v - return s -} - -// OpenSearch Serverless-related information for the current account. -type AccountSettingsDetail struct { - _ struct{} `type:"structure"` - - // The maximum capacity limits for all OpenSearch Serverless collections, in - // OpenSearch Compute Units (OCUs). These limits are used to scale your collections - // based on the current workload. For more information, see Managing capacity - // limits for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-scaling.html). - CapacityLimits *CapacityLimits `locationName:"capacityLimits" 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 AccountSettingsDetail) 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 AccountSettingsDetail) GoString() string { - return s.String() -} - -// SetCapacityLimits sets the CapacityLimits field's value. -func (s *AccountSettingsDetail) SetCapacityLimits(v *CapacityLimits) *AccountSettingsDetail { - s.CapacityLimits = v - return s -} - -type BatchGetCollectionInput struct { - _ struct{} `type:"structure"` - - // A list of collection IDs. You can't provide names and IDs in the same request. - // The ID is part of the collection endpoint. You can also retrieve it using - // the ListCollections (https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_ListCollections.html) - // API. - Ids []*string `locationName:"ids" min:"1" type:"list"` - - // A list of collection names. You can't provide names and IDs in the same request. - Names []*string `locationName:"names" min:"1" type:"list"` -} - -// 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 BatchGetCollectionInput) 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 BatchGetCollectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetCollectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetCollectionInput"} - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - if s.Names != nil && len(s.Names) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Names", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIds sets the Ids field's value. -func (s *BatchGetCollectionInput) SetIds(v []*string) *BatchGetCollectionInput { - s.Ids = v - return s -} - -// SetNames sets the Names field's value. -func (s *BatchGetCollectionInput) SetNames(v []*string) *BatchGetCollectionInput { - s.Names = v - return s -} - -type BatchGetCollectionOutput struct { - _ struct{} `type:"structure"` - - // Details about each collection. - CollectionDetails []*CollectionDetail `locationName:"collectionDetails" type:"list"` - - // Error information for the request. - CollectionErrorDetails []*CollectionErrorDetail `locationName:"collectionErrorDetails" type:"list"` -} - -// 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 BatchGetCollectionOutput) 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 BatchGetCollectionOutput) GoString() string { - return s.String() -} - -// SetCollectionDetails sets the CollectionDetails field's value. -func (s *BatchGetCollectionOutput) SetCollectionDetails(v []*CollectionDetail) *BatchGetCollectionOutput { - s.CollectionDetails = v - return s -} - -// SetCollectionErrorDetails sets the CollectionErrorDetails field's value. -func (s *BatchGetCollectionOutput) SetCollectionErrorDetails(v []*CollectionErrorDetail) *BatchGetCollectionOutput { - s.CollectionErrorDetails = v - return s -} - -type BatchGetEffectiveLifecyclePolicyInput struct { - _ struct{} `type:"structure"` - - // The unique identifiers of policy types and resource names. - // - // ResourceIdentifiers is a required field - ResourceIdentifiers []*LifecyclePolicyResourceIdentifier `locationName:"resourceIdentifiers" min:"1" type:"list" 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 BatchGetEffectiveLifecyclePolicyInput) 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 BatchGetEffectiveLifecyclePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetEffectiveLifecyclePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetEffectiveLifecyclePolicyInput"} - if s.ResourceIdentifiers == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifiers")) - } - if s.ResourceIdentifiers != nil && len(s.ResourceIdentifiers) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifiers", 1)) - } - if s.ResourceIdentifiers != nil { - for i, v := range s.ResourceIdentifiers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceIdentifiers", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceIdentifiers sets the ResourceIdentifiers field's value. -func (s *BatchGetEffectiveLifecyclePolicyInput) SetResourceIdentifiers(v []*LifecyclePolicyResourceIdentifier) *BatchGetEffectiveLifecyclePolicyInput { - s.ResourceIdentifiers = v - return s -} - -type BatchGetEffectiveLifecyclePolicyOutput struct { - _ struct{} `type:"structure"` - - // A list of lifecycle policies applied to the OpenSearch Serverless indexes. - EffectiveLifecyclePolicyDetails []*EffectiveLifecyclePolicyDetail `locationName:"effectiveLifecyclePolicyDetails" type:"list"` - - // A list of resources for which retrieval failed. - EffectiveLifecyclePolicyErrorDetails []*EffectiveLifecyclePolicyErrorDetail `locationName:"effectiveLifecyclePolicyErrorDetails" type:"list"` -} - -// 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 BatchGetEffectiveLifecyclePolicyOutput) 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 BatchGetEffectiveLifecyclePolicyOutput) GoString() string { - return s.String() -} - -// SetEffectiveLifecyclePolicyDetails sets the EffectiveLifecyclePolicyDetails field's value. -func (s *BatchGetEffectiveLifecyclePolicyOutput) SetEffectiveLifecyclePolicyDetails(v []*EffectiveLifecyclePolicyDetail) *BatchGetEffectiveLifecyclePolicyOutput { - s.EffectiveLifecyclePolicyDetails = v - return s -} - -// SetEffectiveLifecyclePolicyErrorDetails sets the EffectiveLifecyclePolicyErrorDetails field's value. -func (s *BatchGetEffectiveLifecyclePolicyOutput) SetEffectiveLifecyclePolicyErrorDetails(v []*EffectiveLifecyclePolicyErrorDetail) *BatchGetEffectiveLifecyclePolicyOutput { - s.EffectiveLifecyclePolicyErrorDetails = v - return s -} - -type BatchGetLifecyclePolicyInput struct { - _ struct{} `type:"structure"` - - // The unique identifiers of policy types and policy names. - // - // Identifiers is a required field - Identifiers []*LifecyclePolicyIdentifier `locationName:"identifiers" min:"1" type:"list" 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 BatchGetLifecyclePolicyInput) 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 BatchGetLifecyclePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetLifecyclePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetLifecyclePolicyInput"} - if s.Identifiers == nil { - invalidParams.Add(request.NewErrParamRequired("Identifiers")) - } - if s.Identifiers != nil && len(s.Identifiers) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Identifiers", 1)) - } - if s.Identifiers != nil { - for i, v := range s.Identifiers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Identifiers", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifiers sets the Identifiers field's value. -func (s *BatchGetLifecyclePolicyInput) SetIdentifiers(v []*LifecyclePolicyIdentifier) *BatchGetLifecyclePolicyInput { - s.Identifiers = v - return s -} - -type BatchGetLifecyclePolicyOutput struct { - _ struct{} `type:"structure"` - - // A list of lifecycle policies matched to the input policy name and policy - // type. - LifecyclePolicyDetails []*LifecyclePolicyDetail `locationName:"lifecyclePolicyDetails" type:"list"` - - // A list of lifecycle policy names and policy types for which retrieval failed. - LifecyclePolicyErrorDetails []*LifecyclePolicyErrorDetail `locationName:"lifecyclePolicyErrorDetails" type:"list"` -} - -// 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 BatchGetLifecyclePolicyOutput) 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 BatchGetLifecyclePolicyOutput) GoString() string { - return s.String() -} - -// SetLifecyclePolicyDetails sets the LifecyclePolicyDetails field's value. -func (s *BatchGetLifecyclePolicyOutput) SetLifecyclePolicyDetails(v []*LifecyclePolicyDetail) *BatchGetLifecyclePolicyOutput { - s.LifecyclePolicyDetails = v - return s -} - -// SetLifecyclePolicyErrorDetails sets the LifecyclePolicyErrorDetails field's value. -func (s *BatchGetLifecyclePolicyOutput) SetLifecyclePolicyErrorDetails(v []*LifecyclePolicyErrorDetail) *BatchGetLifecyclePolicyOutput { - s.LifecyclePolicyErrorDetails = v - return s -} - -type BatchGetVpcEndpointInput struct { - _ struct{} `type:"structure"` - - // A list of VPC endpoint identifiers. - // - // Ids is a required field - Ids []*string `locationName:"ids" min:"1" type:"list" 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 BatchGetVpcEndpointInput) 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 BatchGetVpcEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetVpcEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetVpcEndpointInput"} - if s.Ids == nil { - invalidParams.Add(request.NewErrParamRequired("Ids")) - } - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIds sets the Ids field's value. -func (s *BatchGetVpcEndpointInput) SetIds(v []*string) *BatchGetVpcEndpointInput { - s.Ids = v - return s -} - -type BatchGetVpcEndpointOutput struct { - _ struct{} `type:"structure"` - - // Details about the specified VPC endpoint. - VpcEndpointDetails []*VpcEndpointDetail `locationName:"vpcEndpointDetails" type:"list"` - - // Error information for a failed request. - VpcEndpointErrorDetails []*VpcEndpointErrorDetail `locationName:"vpcEndpointErrorDetails" type:"list"` -} - -// 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 BatchGetVpcEndpointOutput) 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 BatchGetVpcEndpointOutput) GoString() string { - return s.String() -} - -// SetVpcEndpointDetails sets the VpcEndpointDetails field's value. -func (s *BatchGetVpcEndpointOutput) SetVpcEndpointDetails(v []*VpcEndpointDetail) *BatchGetVpcEndpointOutput { - s.VpcEndpointDetails = v - return s -} - -// SetVpcEndpointErrorDetails sets the VpcEndpointErrorDetails field's value. -func (s *BatchGetVpcEndpointOutput) SetVpcEndpointErrorDetails(v []*VpcEndpointErrorDetail) *BatchGetVpcEndpointOutput { - s.VpcEndpointErrorDetails = v - return s -} - -// The maximum capacity limits for all OpenSearch Serverless collections, in -// OpenSearch Compute Units (OCUs). These limits are used to scale your collections -// based on the current workload. For more information, see Managing capacity -// limits for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-scaling.html). -type CapacityLimits struct { - _ struct{} `type:"structure"` - - // The maximum indexing capacity for collections. - MaxIndexingCapacityInOCU *int64 `locationName:"maxIndexingCapacityInOCU" min:"2" type:"integer"` - - // The maximum search capacity for collections. - MaxSearchCapacityInOCU *int64 `locationName:"maxSearchCapacityInOCU" min:"2" 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 CapacityLimits) 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 CapacityLimits) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CapacityLimits) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CapacityLimits"} - if s.MaxIndexingCapacityInOCU != nil && *s.MaxIndexingCapacityInOCU < 2 { - invalidParams.Add(request.NewErrParamMinValue("MaxIndexingCapacityInOCU", 2)) - } - if s.MaxSearchCapacityInOCU != nil && *s.MaxSearchCapacityInOCU < 2 { - invalidParams.Add(request.NewErrParamMinValue("MaxSearchCapacityInOCU", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxIndexingCapacityInOCU sets the MaxIndexingCapacityInOCU field's value. -func (s *CapacityLimits) SetMaxIndexingCapacityInOCU(v int64) *CapacityLimits { - s.MaxIndexingCapacityInOCU = &v - return s -} - -// SetMaxSearchCapacityInOCU sets the MaxSearchCapacityInOCU field's value. -func (s *CapacityLimits) SetMaxSearchCapacityInOCU(v int64) *CapacityLimits { - s.MaxSearchCapacityInOCU = &v - return s -} - -// Details about each OpenSearch Serverless collection, including the collection -// endpoint and the OpenSearch Dashboards endpoint. -type CollectionDetail struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the collection. - Arn *string `locationName:"arn" type:"string"` - - // Collection-specific endpoint used to submit index, search, and data upload - // requests to an OpenSearch Serverless collection. - CollectionEndpoint *string `locationName:"collectionEndpoint" type:"string"` - - // The Epoch time when the collection was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // Collection-specific endpoint used to access OpenSearch Dashboards. - DashboardEndpoint *string `locationName:"dashboardEndpoint" type:"string"` - - // A description of the collection. - Description *string `locationName:"description" type:"string"` - - // A unique identifier for the collection. - Id *string `locationName:"id" min:"3" type:"string"` - - // The ARN of the Amazon Web Services KMS key used to encrypt the collection. - KmsKeyArn *string `locationName:"kmsKeyArn" type:"string"` - - // The date and time when the collection was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the collection. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status of the collection. - Status *string `locationName:"status" type:"string" enum:"CollectionStatus"` - - // The type of collection. - Type *string `locationName:"type" type:"string" enum:"CollectionType"` -} - -// 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 CollectionDetail) 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 CollectionDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CollectionDetail) SetArn(v string) *CollectionDetail { - s.Arn = &v - return s -} - -// SetCollectionEndpoint sets the CollectionEndpoint field's value. -func (s *CollectionDetail) SetCollectionEndpoint(v string) *CollectionDetail { - s.CollectionEndpoint = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *CollectionDetail) SetCreatedDate(v int64) *CollectionDetail { - s.CreatedDate = &v - return s -} - -// SetDashboardEndpoint sets the DashboardEndpoint field's value. -func (s *CollectionDetail) SetDashboardEndpoint(v string) *CollectionDetail { - s.DashboardEndpoint = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CollectionDetail) SetDescription(v string) *CollectionDetail { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *CollectionDetail) SetId(v string) *CollectionDetail { - s.Id = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *CollectionDetail) SetKmsKeyArn(v string) *CollectionDetail { - s.KmsKeyArn = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *CollectionDetail) SetLastModifiedDate(v int64) *CollectionDetail { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *CollectionDetail) SetName(v string) *CollectionDetail { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CollectionDetail) SetStatus(v string) *CollectionDetail { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *CollectionDetail) SetType(v string) *CollectionDetail { - s.Type = &v - return s -} - -// Error information for an OpenSearch Serverless request. -type CollectionErrorDetail struct { - _ struct{} `type:"structure"` - - // The error code for the request. For example, NOT_FOUND. - ErrorCode *string `locationName:"errorCode" type:"string"` - - // A description of the error. For example, The specified Collection is not - // found. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // If the request contains collection IDs, the response includes the IDs provided - // in the request. - Id *string `locationName:"id" min:"3" type:"string"` - - // If the request contains collection names, the response includes the names - // provided in the request. - Name *string `locationName:"name" min:"3" 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 CollectionErrorDetail) 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 CollectionErrorDetail) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *CollectionErrorDetail) SetErrorCode(v string) *CollectionErrorDetail { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *CollectionErrorDetail) SetErrorMessage(v string) *CollectionErrorDetail { - s.ErrorMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *CollectionErrorDetail) SetId(v string) *CollectionErrorDetail { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CollectionErrorDetail) SetName(v string) *CollectionErrorDetail { - s.Name = &v - return s -} - -// A list of filter keys that you can use for LIST, UPDATE, and DELETE requests -// to OpenSearch Serverless collections. -type CollectionFilters struct { - _ struct{} `type:"structure"` - - // The name of the collection. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status of the collection. - Status *string `locationName:"status" type:"string" enum:"CollectionStatus"` -} - -// 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 CollectionFilters) 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 CollectionFilters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CollectionFilters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CollectionFilters"} - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CollectionFilters) SetName(v string) *CollectionFilters { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CollectionFilters) SetStatus(v string) *CollectionFilters { - s.Status = &v - return s -} - -// Details about each OpenSearch Serverless collection. -type CollectionSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the collection. - Arn *string `locationName:"arn" type:"string"` - - // The unique identifier of the collection. - Id *string `locationName:"id" min:"3" type:"string"` - - // The name of the collection. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status of the collection. - Status *string `locationName:"status" type:"string" enum:"CollectionStatus"` -} - -// 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 CollectionSummary) 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 CollectionSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CollectionSummary) SetArn(v string) *CollectionSummary { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CollectionSummary) SetId(v string) *CollectionSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CollectionSummary) SetName(v string) *CollectionSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CollectionSummary) SetStatus(v string) *CollectionSummary { - s.Status = &v - return s -} - -// When creating a resource, thrown when a resource with the same name already -// exists or is being created. When deleting a resource, thrown when the resource -// is not in the ACTIVE or FAILED state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateAccessPolicyInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description of the policy. Typically used to store information about the - // permissions defined in the policy. - Description *string `locationName:"description" type:"string"` - - // The name of the policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The JSON policy document to use as the content for the policy. - // - // Policy is a required field - Policy *string `locationName:"policy" min:"1" type:"string" required:"true"` - - // The type of policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AccessPolicyType"` -} - -// 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 CreateAccessPolicyInput) 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 CreateAccessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAccessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAccessPolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAccessPolicyInput) SetClientToken(v string) *CreateAccessPolicyInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAccessPolicyInput) SetDescription(v string) *CreateAccessPolicyInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAccessPolicyInput) SetName(v string) *CreateAccessPolicyInput { - s.Name = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *CreateAccessPolicyInput) SetPolicy(v string) *CreateAccessPolicyInput { - s.Policy = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateAccessPolicyInput) SetType(v string) *CreateAccessPolicyInput { - s.Type = &v - return s -} - -type CreateAccessPolicyOutput struct { - _ struct{} `type:"structure"` - - // Details about the created access policy. - AccessPolicyDetail *AccessPolicyDetail `locationName:"accessPolicyDetail" 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 CreateAccessPolicyOutput) 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 CreateAccessPolicyOutput) GoString() string { - return s.String() -} - -// SetAccessPolicyDetail sets the AccessPolicyDetail field's value. -func (s *CreateAccessPolicyOutput) SetAccessPolicyDetail(v *AccessPolicyDetail) *CreateAccessPolicyOutput { - s.AccessPolicyDetail = v - return s -} - -// Details about the created OpenSearch Serverless collection. -type CreateCollectionDetail struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the collection. - Arn *string `locationName:"arn" type:"string"` - - // The Epoch time when the collection was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // A description of the collection. - Description *string `locationName:"description" type:"string"` - - // The unique identifier of the collection. - Id *string `locationName:"id" min:"3" type:"string"` - - // The Amazon Resource Name (ARN) of the KMS key with which to encrypt the collection. - KmsKeyArn *string `locationName:"kmsKeyArn" type:"string"` - - // The date and time when the collection was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the collection. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status of the collection. - Status *string `locationName:"status" type:"string" enum:"CollectionStatus"` - - // The type of collection. - Type *string `locationName:"type" type:"string" enum:"CollectionType"` -} - -// 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 CreateCollectionDetail) 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 CreateCollectionDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateCollectionDetail) SetArn(v string) *CreateCollectionDetail { - s.Arn = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *CreateCollectionDetail) SetCreatedDate(v int64) *CreateCollectionDetail { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateCollectionDetail) SetDescription(v string) *CreateCollectionDetail { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateCollectionDetail) SetId(v string) *CreateCollectionDetail { - s.Id = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *CreateCollectionDetail) SetKmsKeyArn(v string) *CreateCollectionDetail { - s.KmsKeyArn = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *CreateCollectionDetail) SetLastModifiedDate(v int64) *CreateCollectionDetail { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateCollectionDetail) SetName(v string) *CreateCollectionDetail { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateCollectionDetail) SetStatus(v string) *CreateCollectionDetail { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateCollectionDetail) SetType(v string) *CreateCollectionDetail { - s.Type = &v - return s -} - -type CreateCollectionInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Description of the collection. - Description *string `locationName:"description" type:"string"` - - // Name of the collection. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // An arbitrary set of tags (key–value pairs) to associate with the OpenSearch - // Serverless collection. - Tags []*Tag `locationName:"tags" type:"list"` - - // The type of collection. - Type *string `locationName:"type" type:"string" enum:"CollectionType"` -} - -// 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 CreateCollectionInput) 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 CreateCollectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCollectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCollectionInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateCollectionInput) SetClientToken(v string) *CreateCollectionInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateCollectionInput) SetDescription(v string) *CreateCollectionInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateCollectionInput) SetName(v string) *CreateCollectionInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateCollectionInput) SetTags(v []*Tag) *CreateCollectionInput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateCollectionInput) SetType(v string) *CreateCollectionInput { - s.Type = &v - return s -} - -type CreateCollectionOutput struct { - _ struct{} `type:"structure"` - - // Details about the collection. - CreateCollectionDetail *CreateCollectionDetail `locationName:"createCollectionDetail" 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 CreateCollectionOutput) 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 CreateCollectionOutput) GoString() string { - return s.String() -} - -// SetCreateCollectionDetail sets the CreateCollectionDetail field's value. -func (s *CreateCollectionOutput) SetCreateCollectionDetail(v *CreateCollectionDetail) *CreateCollectionOutput { - s.CreateCollectionDetail = v - return s -} - -type CreateLifecyclePolicyInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description of the lifecycle policy. - Description *string `locationName:"description" type:"string"` - - // The name of the lifecycle policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The JSON policy document to use as the content for the lifecycle policy. - // - // Policy is a required field - Policy *string `locationName:"policy" min:"1" type:"string" required:"true"` - - // The type of lifecycle policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"LifecyclePolicyType"` -} - -// 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 CreateLifecyclePolicyInput) 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 CreateLifecyclePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLifecyclePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLifecyclePolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateLifecyclePolicyInput) SetClientToken(v string) *CreateLifecyclePolicyInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateLifecyclePolicyInput) SetDescription(v string) *CreateLifecyclePolicyInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateLifecyclePolicyInput) SetName(v string) *CreateLifecyclePolicyInput { - s.Name = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *CreateLifecyclePolicyInput) SetPolicy(v string) *CreateLifecyclePolicyInput { - s.Policy = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateLifecyclePolicyInput) SetType(v string) *CreateLifecyclePolicyInput { - s.Type = &v - return s -} - -type CreateLifecyclePolicyOutput struct { - _ struct{} `type:"structure"` - - // Details about the created lifecycle policy. - LifecyclePolicyDetail *LifecyclePolicyDetail `locationName:"lifecyclePolicyDetail" 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 CreateLifecyclePolicyOutput) 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 CreateLifecyclePolicyOutput) GoString() string { - return s.String() -} - -// SetLifecyclePolicyDetail sets the LifecyclePolicyDetail field's value. -func (s *CreateLifecyclePolicyOutput) SetLifecyclePolicyDetail(v *LifecyclePolicyDetail) *CreateLifecyclePolicyOutput { - s.LifecyclePolicyDetail = v - return s -} - -type CreateSecurityConfigInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description of the security configuration. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the security configuration. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // Describes SAML options in in the form of a key-value map. This field is required - // if you specify saml for the type parameter. - SamlOptions *SamlConfigOptions `locationName:"samlOptions" type:"structure"` - - // The type of security configuration. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SecurityConfigType"` -} - -// 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 CreateSecurityConfigInput) 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 CreateSecurityConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSecurityConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSecurityConfigInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.SamlOptions != nil { - if err := s.SamlOptions.Validate(); err != nil { - invalidParams.AddNested("SamlOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateSecurityConfigInput) SetClientToken(v string) *CreateSecurityConfigInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateSecurityConfigInput) SetDescription(v string) *CreateSecurityConfigInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSecurityConfigInput) SetName(v string) *CreateSecurityConfigInput { - s.Name = &v - return s -} - -// SetSamlOptions sets the SamlOptions field's value. -func (s *CreateSecurityConfigInput) SetSamlOptions(v *SamlConfigOptions) *CreateSecurityConfigInput { - s.SamlOptions = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateSecurityConfigInput) SetType(v string) *CreateSecurityConfigInput { - s.Type = &v - return s -} - -type CreateSecurityConfigOutput struct { - _ struct{} `type:"structure"` - - // Details about the created security configuration. - SecurityConfigDetail *SecurityConfigDetail `locationName:"securityConfigDetail" 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 CreateSecurityConfigOutput) 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 CreateSecurityConfigOutput) GoString() string { - return s.String() -} - -// SetSecurityConfigDetail sets the SecurityConfigDetail field's value. -func (s *CreateSecurityConfigOutput) SetSecurityConfigDetail(v *SecurityConfigDetail) *CreateSecurityConfigOutput { - s.SecurityConfigDetail = v - return s -} - -type CreateSecurityPolicyInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description of the policy. Typically used to store information about the - // permissions defined in the policy. - Description *string `locationName:"description" type:"string"` - - // The name of the policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The JSON policy document to use as the content for the new policy. - // - // Policy is a required field - Policy *string `locationName:"policy" min:"1" type:"string" required:"true"` - - // The type of security policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SecurityPolicyType"` -} - -// 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 CreateSecurityPolicyInput) 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 CreateSecurityPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSecurityPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSecurityPolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateSecurityPolicyInput) SetClientToken(v string) *CreateSecurityPolicyInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateSecurityPolicyInput) SetDescription(v string) *CreateSecurityPolicyInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSecurityPolicyInput) SetName(v string) *CreateSecurityPolicyInput { - s.Name = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *CreateSecurityPolicyInput) SetPolicy(v string) *CreateSecurityPolicyInput { - s.Policy = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateSecurityPolicyInput) SetType(v string) *CreateSecurityPolicyInput { - s.Type = &v - return s -} - -type CreateSecurityPolicyOutput struct { - _ struct{} `type:"structure"` - - // Details about the created security policy. - SecurityPolicyDetail *SecurityPolicyDetail `locationName:"securityPolicyDetail" 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 CreateSecurityPolicyOutput) 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 CreateSecurityPolicyOutput) GoString() string { - return s.String() -} - -// SetSecurityPolicyDetail sets the SecurityPolicyDetail field's value. -func (s *CreateSecurityPolicyOutput) SetSecurityPolicyDetail(v *SecurityPolicyDetail) *CreateSecurityPolicyOutput { - s.SecurityPolicyDetail = v - return s -} - -// Creation details for an OpenSearch Serverless-managed interface endpoint. -// For more information, see Access Amazon OpenSearch Serverless using an interface -// endpoint (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html). -type CreateVpcEndpointDetail struct { - _ struct{} `type:"structure"` - - // The unique identifier of the endpoint. - Id *string `locationName:"id" min:"1" type:"string"` - - // The name of the endpoint. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status in the endpoint creation process. - Status *string `locationName:"status" type:"string" enum:"VpcEndpointStatus"` -} - -// 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 CreateVpcEndpointDetail) 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 CreateVpcEndpointDetail) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *CreateVpcEndpointDetail) SetId(v string) *CreateVpcEndpointDetail { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateVpcEndpointDetail) SetName(v string) *CreateVpcEndpointDetail { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateVpcEndpointDetail) SetStatus(v string) *CreateVpcEndpointDetail { - s.Status = &v - return s -} - -type CreateVpcEndpointInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The name of the interface endpoint. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The unique identifiers of the security groups that define the ports, protocols, - // and sources for inbound traffic that you are authorizing into your endpoint. - SecurityGroupIds []*string `locationName:"securityGroupIds" min:"1" type:"list"` - - // The ID of one or more subnets from which you'll access OpenSearch Serverless. - // - // SubnetIds is a required field - SubnetIds []*string `locationName:"subnetIds" min:"1" type:"list" required:"true"` - - // The ID of the VPC from which you'll access OpenSearch Serverless. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" min:"1" 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 CreateVpcEndpointInput) 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 CreateVpcEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.SecurityGroupIds != nil && len(s.SecurityGroupIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroupIds", 1)) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - if s.SubnetIds != nil && len(s.SubnetIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubnetIds", 1)) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) - } - if s.VpcId != nil && len(*s.VpcId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VpcId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointInput) SetClientToken(v string) *CreateVpcEndpointInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateVpcEndpointInput) SetName(v string) *CreateVpcEndpointInput { - s.Name = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateVpcEndpointInput) SetSecurityGroupIds(v []*string) *CreateVpcEndpointInput { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateVpcEndpointInput) SetSubnetIds(v []*string) *CreateVpcEndpointInput { - s.SubnetIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateVpcEndpointInput) SetVpcId(v string) *CreateVpcEndpointInput { - s.VpcId = &v - return s -} - -type CreateVpcEndpointOutput struct { - _ struct{} `type:"structure"` - - // Details about the created interface VPC endpoint. - CreateVpcEndpointDetail *CreateVpcEndpointDetail `locationName:"createVpcEndpointDetail" 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 CreateVpcEndpointOutput) 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 CreateVpcEndpointOutput) GoString() string { - return s.String() -} - -// SetCreateVpcEndpointDetail sets the CreateVpcEndpointDetail field's value. -func (s *CreateVpcEndpointOutput) SetCreateVpcEndpointDetail(v *CreateVpcEndpointDetail) *CreateVpcEndpointOutput { - s.CreateVpcEndpointDetail = v - return s -} - -type DeleteAccessPolicyInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The name of the policy to delete. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The type of policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AccessPolicyType"` -} - -// 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 DeleteAccessPolicyInput) 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 DeleteAccessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAccessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAccessPolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteAccessPolicyInput) SetClientToken(v string) *DeleteAccessPolicyInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteAccessPolicyInput) SetName(v string) *DeleteAccessPolicyInput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *DeleteAccessPolicyInput) SetType(v string) *DeleteAccessPolicyInput { - s.Type = &v - return s -} - -type DeleteAccessPolicyOutput 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 DeleteAccessPolicyOutput) 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 DeleteAccessPolicyOutput) GoString() string { - return s.String() -} - -// Details about a deleted OpenSearch Serverless collection. -type DeleteCollectionDetail struct { - _ struct{} `type:"structure"` - - // The unique identifier of the collection. - Id *string `locationName:"id" min:"3" type:"string"` - - // The name of the collection. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status of the collection. - Status *string `locationName:"status" type:"string" enum:"CollectionStatus"` -} - -// 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 DeleteCollectionDetail) 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 DeleteCollectionDetail) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *DeleteCollectionDetail) SetId(v string) *DeleteCollectionDetail { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteCollectionDetail) SetName(v string) *DeleteCollectionDetail { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteCollectionDetail) SetStatus(v string) *DeleteCollectionDetail { - s.Status = &v - return s -} - -type DeleteCollectionInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The unique identifier of the collection. For example, 1iu5usc406kd. The ID - // is part of the collection endpoint. You can also retrieve it using the ListCollections - // (https://docs.aws.amazon.com/opensearch-service/latest/ServerlessAPIReference/API_ListCollections.html) - // API. - // - // Id is a required field - Id *string `locationName:"id" min:"3" 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 DeleteCollectionInput) 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 DeleteCollectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCollectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCollectionInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Id", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteCollectionInput) SetClientToken(v string) *DeleteCollectionInput { - s.ClientToken = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteCollectionInput) SetId(v string) *DeleteCollectionInput { - s.Id = &v - return s -} - -type DeleteCollectionOutput struct { - _ struct{} `type:"structure"` - - // Details of the deleted collection. - DeleteCollectionDetail *DeleteCollectionDetail `locationName:"deleteCollectionDetail" 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 DeleteCollectionOutput) 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 DeleteCollectionOutput) GoString() string { - return s.String() -} - -// SetDeleteCollectionDetail sets the DeleteCollectionDetail field's value. -func (s *DeleteCollectionOutput) SetDeleteCollectionDetail(v *DeleteCollectionDetail) *DeleteCollectionOutput { - s.DeleteCollectionDetail = v - return s -} - -type DeleteLifecyclePolicyInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The name of the policy to delete. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The type of lifecycle policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"LifecyclePolicyType"` -} - -// 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 DeleteLifecyclePolicyInput) 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 DeleteLifecyclePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLifecyclePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLifecyclePolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteLifecyclePolicyInput) SetClientToken(v string) *DeleteLifecyclePolicyInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteLifecyclePolicyInput) SetName(v string) *DeleteLifecyclePolicyInput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *DeleteLifecyclePolicyInput) SetType(v string) *DeleteLifecyclePolicyInput { - s.Type = &v - return s -} - -type DeleteLifecyclePolicyOutput 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 DeleteLifecyclePolicyOutput) 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 DeleteLifecyclePolicyOutput) GoString() string { - return s.String() -} - -type DeleteSecurityConfigInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The security configuration identifier. For SAML the ID will be saml//. - // For example, saml/123456789123/OKTADev. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 DeleteSecurityConfigInput) 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 DeleteSecurityConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSecurityConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSecurityConfigInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteSecurityConfigInput) SetClientToken(v string) *DeleteSecurityConfigInput { - s.ClientToken = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteSecurityConfigInput) SetId(v string) *DeleteSecurityConfigInput { - s.Id = &v - return s -} - -type DeleteSecurityConfigOutput 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 DeleteSecurityConfigOutput) 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 DeleteSecurityConfigOutput) GoString() string { - return s.String() -} - -type DeleteSecurityPolicyInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The name of the policy to delete. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The type of policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SecurityPolicyType"` -} - -// 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 DeleteSecurityPolicyInput) 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 DeleteSecurityPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSecurityPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSecurityPolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteSecurityPolicyInput) SetClientToken(v string) *DeleteSecurityPolicyInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteSecurityPolicyInput) SetName(v string) *DeleteSecurityPolicyInput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *DeleteSecurityPolicyInput) SetType(v string) *DeleteSecurityPolicyInput { - s.Type = &v - return s -} - -type DeleteSecurityPolicyOutput 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 DeleteSecurityPolicyOutput) 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 DeleteSecurityPolicyOutput) GoString() string { - return s.String() -} - -// Deletion details for an OpenSearch Serverless-managed interface endpoint. -type DeleteVpcEndpointDetail struct { - _ struct{} `type:"structure"` - - // The unique identifier of the endpoint. - Id *string `locationName:"id" min:"1" type:"string"` - - // The name of the endpoint. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status of the endpoint deletion process. - Status *string `locationName:"status" type:"string" enum:"VpcEndpointStatus"` -} - -// 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 DeleteVpcEndpointDetail) 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 DeleteVpcEndpointDetail) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *DeleteVpcEndpointDetail) SetId(v string) *DeleteVpcEndpointDetail { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteVpcEndpointDetail) SetName(v string) *DeleteVpcEndpointDetail { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteVpcEndpointDetail) SetStatus(v string) *DeleteVpcEndpointDetail { - s.Status = &v - return s -} - -type DeleteVpcEndpointInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The VPC endpoint identifier. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 DeleteVpcEndpointInput) 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 DeleteVpcEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteVpcEndpointInput) SetClientToken(v string) *DeleteVpcEndpointInput { - s.ClientToken = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteVpcEndpointInput) SetId(v string) *DeleteVpcEndpointInput { - s.Id = &v - return s -} - -type DeleteVpcEndpointOutput struct { - _ struct{} `type:"structure"` - - // Details about the deleted endpoint. - DeleteVpcEndpointDetail *DeleteVpcEndpointDetail `locationName:"deleteVpcEndpointDetail" 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 DeleteVpcEndpointOutput) 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 DeleteVpcEndpointOutput) GoString() string { - return s.String() -} - -// SetDeleteVpcEndpointDetail sets the DeleteVpcEndpointDetail field's value. -func (s *DeleteVpcEndpointOutput) SetDeleteVpcEndpointDetail(v *DeleteVpcEndpointDetail) *DeleteVpcEndpointOutput { - s.DeleteVpcEndpointDetail = v - return s -} - -// Error information for an OpenSearch Serverless request. -type EffectiveLifecyclePolicyDetail struct { - _ struct{} `type:"structure"` - - // The minimum number of index retention days set. That is an optional param - // that will return as true if the minimum number of days or hours is not set - // to a index resource. - NoMinRetentionPeriod *bool `locationName:"noMinRetentionPeriod" type:"boolean"` - - // The name of the lifecycle policy. - PolicyName *string `locationName:"policyName" min:"3" type:"string"` - - // The name of the OpenSearch Serverless index resource. - Resource *string `locationName:"resource" type:"string"` - - // The type of OpenSearch Serverless resource. Currently, the only supported - // resource is index. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` - - // The minimum number of index retention in days or hours. This is an optional - // parameter that will return only if it’s set. - RetentionPeriod *string `locationName:"retentionPeriod" type:"string"` - - // The type of lifecycle policy. - Type *string `locationName:"type" type:"string" enum:"LifecyclePolicyType"` -} - -// 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 EffectiveLifecyclePolicyDetail) 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 EffectiveLifecyclePolicyDetail) GoString() string { - return s.String() -} - -// SetNoMinRetentionPeriod sets the NoMinRetentionPeriod field's value. -func (s *EffectiveLifecyclePolicyDetail) SetNoMinRetentionPeriod(v bool) *EffectiveLifecyclePolicyDetail { - s.NoMinRetentionPeriod = &v - return s -} - -// SetPolicyName sets the PolicyName field's value. -func (s *EffectiveLifecyclePolicyDetail) SetPolicyName(v string) *EffectiveLifecyclePolicyDetail { - s.PolicyName = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *EffectiveLifecyclePolicyDetail) SetResource(v string) *EffectiveLifecyclePolicyDetail { - s.Resource = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *EffectiveLifecyclePolicyDetail) SetResourceType(v string) *EffectiveLifecyclePolicyDetail { - s.ResourceType = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *EffectiveLifecyclePolicyDetail) SetRetentionPeriod(v string) *EffectiveLifecyclePolicyDetail { - s.RetentionPeriod = &v - return s -} - -// SetType sets the Type field's value. -func (s *EffectiveLifecyclePolicyDetail) SetType(v string) *EffectiveLifecyclePolicyDetail { - s.Type = &v - return s -} - -// Error information for an OpenSearch Serverless request. -type EffectiveLifecyclePolicyErrorDetail struct { - _ struct{} `type:"structure"` - - // The error code for the request. - ErrorCode *string `locationName:"errorCode" type:"string"` - - // A description of the error. For example, The specified Index resource is - // not found. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // The name of OpenSearch Serverless index resource. - Resource *string `locationName:"resource" type:"string"` - - // The type of lifecycle policy. - Type *string `locationName:"type" type:"string" enum:"LifecyclePolicyType"` -} - -// 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 EffectiveLifecyclePolicyErrorDetail) 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 EffectiveLifecyclePolicyErrorDetail) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *EffectiveLifecyclePolicyErrorDetail) SetErrorCode(v string) *EffectiveLifecyclePolicyErrorDetail { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *EffectiveLifecyclePolicyErrorDetail) SetErrorMessage(v string) *EffectiveLifecyclePolicyErrorDetail { - s.ErrorMessage = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *EffectiveLifecyclePolicyErrorDetail) SetResource(v string) *EffectiveLifecyclePolicyErrorDetail { - s.Resource = &v - return s -} - -// SetType sets the Type field's value. -func (s *EffectiveLifecyclePolicyErrorDetail) SetType(v string) *EffectiveLifecyclePolicyErrorDetail { - s.Type = &v - return s -} - -type GetAccessPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the access policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // Tye type of policy. Currently, the only supported value is data. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AccessPolicyType"` -} - -// 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 GetAccessPolicyInput) 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 GetAccessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAccessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAccessPolicyInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetAccessPolicyInput) SetName(v string) *GetAccessPolicyInput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetAccessPolicyInput) SetType(v string) *GetAccessPolicyInput { - s.Type = &v - return s -} - -type GetAccessPolicyOutput struct { - _ struct{} `type:"structure"` - - // Details about the requested access policy. - AccessPolicyDetail *AccessPolicyDetail `locationName:"accessPolicyDetail" 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 GetAccessPolicyOutput) 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 GetAccessPolicyOutput) GoString() string { - return s.String() -} - -// SetAccessPolicyDetail sets the AccessPolicyDetail field's value. -func (s *GetAccessPolicyOutput) SetAccessPolicyDetail(v *AccessPolicyDetail) *GetAccessPolicyOutput { - s.AccessPolicyDetail = v - return s -} - -type GetAccountSettingsInput 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 GetAccountSettingsInput) 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 GetAccountSettingsInput) GoString() string { - return s.String() -} - -type GetAccountSettingsOutput struct { - _ struct{} `type:"structure"` - - // OpenSearch Serverless-related details for the current account. - AccountSettingsDetail *AccountSettingsDetail `locationName:"accountSettingsDetail" 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 GetAccountSettingsOutput) 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 GetAccountSettingsOutput) GoString() string { - return s.String() -} - -// SetAccountSettingsDetail sets the AccountSettingsDetail field's value. -func (s *GetAccountSettingsOutput) SetAccountSettingsDetail(v *AccountSettingsDetail) *GetAccountSettingsOutput { - s.AccountSettingsDetail = v - return s -} - -type GetPoliciesStatsInput 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 GetPoliciesStatsInput) 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 GetPoliciesStatsInput) GoString() string { - return s.String() -} - -type GetPoliciesStatsOutput struct { - _ struct{} `type:"structure"` - - // Information about the data access policies in your account. - AccessPolicyStats *AccessPolicyStats `type:"structure"` - - // Information about the lifecycle policies in your account. - LifecyclePolicyStats *LifecyclePolicyStats `type:"structure"` - - // Information about the security configurations in your account. - SecurityConfigStats *SecurityConfigStats `type:"structure"` - - // Information about the security policies in your account. - SecurityPolicyStats *SecurityPolicyStats `type:"structure"` - - // The total number of OpenSearch Serverless security policies and configurations - // in your account. - TotalPolicyCount *int64 `type:"long"` -} - -// 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 GetPoliciesStatsOutput) 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 GetPoliciesStatsOutput) GoString() string { - return s.String() -} - -// SetAccessPolicyStats sets the AccessPolicyStats field's value. -func (s *GetPoliciesStatsOutput) SetAccessPolicyStats(v *AccessPolicyStats) *GetPoliciesStatsOutput { - s.AccessPolicyStats = v - return s -} - -// SetLifecyclePolicyStats sets the LifecyclePolicyStats field's value. -func (s *GetPoliciesStatsOutput) SetLifecyclePolicyStats(v *LifecyclePolicyStats) *GetPoliciesStatsOutput { - s.LifecyclePolicyStats = v - return s -} - -// SetSecurityConfigStats sets the SecurityConfigStats field's value. -func (s *GetPoliciesStatsOutput) SetSecurityConfigStats(v *SecurityConfigStats) *GetPoliciesStatsOutput { - s.SecurityConfigStats = v - return s -} - -// SetSecurityPolicyStats sets the SecurityPolicyStats field's value. -func (s *GetPoliciesStatsOutput) SetSecurityPolicyStats(v *SecurityPolicyStats) *GetPoliciesStatsOutput { - s.SecurityPolicyStats = v - return s -} - -// SetTotalPolicyCount sets the TotalPolicyCount field's value. -func (s *GetPoliciesStatsOutput) SetTotalPolicyCount(v int64) *GetPoliciesStatsOutput { - s.TotalPolicyCount = &v - return s -} - -type GetSecurityConfigInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the security configuration. - // - // Id is a required field - Id *string `locationName:"id" min:"1" 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 GetSecurityConfigInput) 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 GetSecurityConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSecurityConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSecurityConfigInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetSecurityConfigInput) SetId(v string) *GetSecurityConfigInput { - s.Id = &v - return s -} - -type GetSecurityConfigOutput struct { - _ struct{} `type:"structure"` - - // Details of the requested security configuration. - SecurityConfigDetail *SecurityConfigDetail `locationName:"securityConfigDetail" 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 GetSecurityConfigOutput) 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 GetSecurityConfigOutput) GoString() string { - return s.String() -} - -// SetSecurityConfigDetail sets the SecurityConfigDetail field's value. -func (s *GetSecurityConfigOutput) SetSecurityConfigDetail(v *SecurityConfigDetail) *GetSecurityConfigOutput { - s.SecurityConfigDetail = v - return s -} - -type GetSecurityPolicyInput struct { - _ struct{} `type:"structure"` - - // The name of the security policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The type of security policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SecurityPolicyType"` -} - -// 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 GetSecurityPolicyInput) 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 GetSecurityPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSecurityPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSecurityPolicyInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetSecurityPolicyInput) SetName(v string) *GetSecurityPolicyInput { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetSecurityPolicyInput) SetType(v string) *GetSecurityPolicyInput { - s.Type = &v - return s -} - -type GetSecurityPolicyOutput struct { - _ struct{} `type:"structure"` - - // Details about the requested security policy. - SecurityPolicyDetail *SecurityPolicyDetail `locationName:"securityPolicyDetail" 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 GetSecurityPolicyOutput) 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 GetSecurityPolicyOutput) GoString() string { - return s.String() -} - -// SetSecurityPolicyDetail sets the SecurityPolicyDetail field's value. -func (s *GetSecurityPolicyOutput) SetSecurityPolicyDetail(v *SecurityPolicyDetail) *GetSecurityPolicyOutput { - s.SecurityPolicyDetail = v - return s -} - -// Thrown when an error internal to the service occurs while processing a request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Details about an OpenSearch Serverless lifecycle policy. -type LifecyclePolicyDetail struct { - _ struct{} `type:"structure"` - - // The date the lifecycle policy was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the lifecycle policy. - Description *string `locationName:"description" type:"string"` - - // The timestamp of when the lifecycle policy was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the lifecycle policy. - Name *string `locationName:"name" min:"3" type:"string"` - - // The version of the lifecycle policy. - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string"` - - // The type of lifecycle policy. - Type *string `locationName:"type" type:"string" enum:"LifecyclePolicyType"` -} - -// 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 LifecyclePolicyDetail) 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 LifecyclePolicyDetail) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *LifecyclePolicyDetail) SetCreatedDate(v int64) *LifecyclePolicyDetail { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *LifecyclePolicyDetail) SetDescription(v string) *LifecyclePolicyDetail { - s.Description = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *LifecyclePolicyDetail) SetLastModifiedDate(v int64) *LifecyclePolicyDetail { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *LifecyclePolicyDetail) SetName(v string) *LifecyclePolicyDetail { - s.Name = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *LifecyclePolicyDetail) SetPolicyVersion(v string) *LifecyclePolicyDetail { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *LifecyclePolicyDetail) SetType(v string) *LifecyclePolicyDetail { - s.Type = &v - return s -} - -// Error information for an OpenSearch Serverless request. -type LifecyclePolicyErrorDetail struct { - _ struct{} `type:"structure"` - - // The error code for the request. For example, NOT_FOUND. - ErrorCode *string `locationName:"errorCode" type:"string"` - - // A description of the error. For example, The specified Lifecycle Policy is - // not found. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // The name of the lifecycle policy. - Name *string `locationName:"name" min:"3" type:"string"` - - // The type of lifecycle policy. - Type *string `locationName:"type" type:"string" enum:"LifecyclePolicyType"` -} - -// 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 LifecyclePolicyErrorDetail) 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 LifecyclePolicyErrorDetail) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *LifecyclePolicyErrorDetail) SetErrorCode(v string) *LifecyclePolicyErrorDetail { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *LifecyclePolicyErrorDetail) SetErrorMessage(v string) *LifecyclePolicyErrorDetail { - s.ErrorMessage = &v - return s -} - -// SetName sets the Name field's value. -func (s *LifecyclePolicyErrorDetail) SetName(v string) *LifecyclePolicyErrorDetail { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *LifecyclePolicyErrorDetail) SetType(v string) *LifecyclePolicyErrorDetail { - s.Type = &v - return s -} - -// The unique identifiers of policy types and policy names. -type LifecyclePolicyIdentifier struct { - _ struct{} `type:"structure"` - - // The name of the lifecycle policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The type of lifecycle policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"LifecyclePolicyType"` -} - -// 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 LifecyclePolicyIdentifier) 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 LifecyclePolicyIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecyclePolicyIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecyclePolicyIdentifier"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *LifecyclePolicyIdentifier) SetName(v string) *LifecyclePolicyIdentifier { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *LifecyclePolicyIdentifier) SetType(v string) *LifecyclePolicyIdentifier { - s.Type = &v - return s -} - -// The unique identifiers of policy types and resource names. -type LifecyclePolicyResourceIdentifier struct { - _ struct{} `type:"structure"` - - // The name of the OpenSearch Serverless ilndex resource. - // - // Resource is a required field - Resource *string `locationName:"resource" type:"string" required:"true"` - - // The type of lifecycle policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"LifecyclePolicyType"` -} - -// 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 LifecyclePolicyResourceIdentifier) 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 LifecyclePolicyResourceIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecyclePolicyResourceIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecyclePolicyResourceIdentifier"} - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResource sets the Resource field's value. -func (s *LifecyclePolicyResourceIdentifier) SetResource(v string) *LifecyclePolicyResourceIdentifier { - s.Resource = &v - return s -} - -// SetType sets the Type field's value. -func (s *LifecyclePolicyResourceIdentifier) SetType(v string) *LifecyclePolicyResourceIdentifier { - s.Type = &v - return s -} - -// Statistics for an OpenSearch Serverless lifecycle policy. -type LifecyclePolicyStats struct { - _ struct{} `type:"structure"` - - // The number of retention lifecycle policies in the current account. - RetentionPolicyCount *int64 `type:"long"` -} - -// 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 LifecyclePolicyStats) 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 LifecyclePolicyStats) GoString() string { - return s.String() -} - -// SetRetentionPolicyCount sets the RetentionPolicyCount field's value. -func (s *LifecyclePolicyStats) SetRetentionPolicyCount(v int64) *LifecyclePolicyStats { - s.RetentionPolicyCount = &v - return s -} - -// A summary of the lifecycle policy. -type LifecyclePolicySummary struct { - _ struct{} `type:"structure"` - - // The Epoch time when the lifecycle policy was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the lifecycle policy. - Description *string `locationName:"description" type:"string"` - - // The date and time when the lifecycle policy was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the lifecycle policy. - Name *string `locationName:"name" min:"3" type:"string"` - - // The version of the lifecycle policy. - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string"` - - // The type of lifecycle policy. - Type *string `locationName:"type" type:"string" enum:"LifecyclePolicyType"` -} - -// 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 LifecyclePolicySummary) 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 LifecyclePolicySummary) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *LifecyclePolicySummary) SetCreatedDate(v int64) *LifecyclePolicySummary { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *LifecyclePolicySummary) SetDescription(v string) *LifecyclePolicySummary { - s.Description = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *LifecyclePolicySummary) SetLastModifiedDate(v int64) *LifecyclePolicySummary { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *LifecyclePolicySummary) SetName(v string) *LifecyclePolicySummary { - s.Name = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *LifecyclePolicySummary) SetPolicyVersion(v string) *LifecyclePolicySummary { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *LifecyclePolicySummary) SetType(v string) *LifecyclePolicySummary { - s.Type = &v - return s -} - -type ListAccessPoliciesInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to get the next page of results. The default is 20. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListAccessPolicies operation returns a nextToken, you can - // include the returned nextToken in subsequent ListAccessPolicies operations, - // which returns results in the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // Resource filters (can be collections or indexes) that policies can apply - // to. - Resource []*string `locationName:"resource" min:"1" type:"list"` - - // The type of access policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AccessPolicyType"` -} - -// 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 ListAccessPoliciesInput) 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 ListAccessPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAccessPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAccessPoliciesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Resource != nil && len(s.Resource) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Resource", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAccessPoliciesInput) SetMaxResults(v int64) *ListAccessPoliciesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccessPoliciesInput) SetNextToken(v string) *ListAccessPoliciesInput { - s.NextToken = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *ListAccessPoliciesInput) SetResource(v []*string) *ListAccessPoliciesInput { - s.Resource = v - return s -} - -// SetType sets the Type field's value. -func (s *ListAccessPoliciesInput) SetType(v string) *ListAccessPoliciesInput { - s.Type = &v - return s -} - -type ListAccessPoliciesOutput struct { - _ struct{} `type:"structure"` - - // Details about the requested access policies. - AccessPolicySummaries []*AccessPolicySummary `locationName:"accessPolicySummaries" type:"list"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" 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 ListAccessPoliciesOutput) 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 ListAccessPoliciesOutput) GoString() string { - return s.String() -} - -// SetAccessPolicySummaries sets the AccessPolicySummaries field's value. -func (s *ListAccessPoliciesOutput) SetAccessPolicySummaries(v []*AccessPolicySummary) *ListAccessPoliciesOutput { - s.AccessPolicySummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccessPoliciesOutput) SetNextToken(v string) *ListAccessPoliciesOutput { - s.NextToken = &v - return s -} - -type ListCollectionsInput struct { - _ struct{} `type:"structure"` - - // A list of filter names and values that you can use for requests. - CollectionFilters *CollectionFilters `locationName:"collectionFilters" type:"structure"` - - // The maximum number of results to return. Default is 20. You can use nextToken - // to get the next page of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListCollections operation returns a nextToken, you can include - // the returned nextToken in subsequent ListCollections operations, which returns - // results in the next page. - NextToken *string `locationName:"nextToken" 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 ListCollectionsInput) 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 ListCollectionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCollectionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCollectionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.CollectionFilters != nil { - if err := s.CollectionFilters.Validate(); err != nil { - invalidParams.AddNested("CollectionFilters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCollectionFilters sets the CollectionFilters field's value. -func (s *ListCollectionsInput) SetCollectionFilters(v *CollectionFilters) *ListCollectionsInput { - s.CollectionFilters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCollectionsInput) SetMaxResults(v int64) *ListCollectionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCollectionsInput) SetNextToken(v string) *ListCollectionsInput { - s.NextToken = &v - return s -} - -type ListCollectionsOutput struct { - _ struct{} `type:"structure"` - - // Details about each collection. - CollectionSummaries []*CollectionSummary `locationName:"collectionSummaries" type:"list"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" 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 ListCollectionsOutput) 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 ListCollectionsOutput) GoString() string { - return s.String() -} - -// SetCollectionSummaries sets the CollectionSummaries field's value. -func (s *ListCollectionsOutput) SetCollectionSummaries(v []*CollectionSummary) *ListCollectionsOutput { - s.CollectionSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCollectionsOutput) SetNextToken(v string) *ListCollectionsOutput { - s.NextToken = &v - return s -} - -type ListLifecyclePoliciesInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use use nextToken to get the next page of results. The default is - // 10. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListLifecyclePolicies operation returns a nextToken, you - // can include the returned nextToken in subsequent ListLifecyclePolicies operations, - // which returns results in the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // Resource filters that policies can apply to. Currently, the only supported - // resource type is index. - Resources []*string `locationName:"resources" min:"1" type:"list"` - - // The type of lifecycle policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"LifecyclePolicyType"` -} - -// 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 ListLifecyclePoliciesInput) 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 ListLifecyclePoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListLifecyclePoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLifecyclePoliciesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Resources != nil && len(s.Resources) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Resources", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListLifecyclePoliciesInput) SetMaxResults(v int64) *ListLifecyclePoliciesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLifecyclePoliciesInput) SetNextToken(v string) *ListLifecyclePoliciesInput { - s.NextToken = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *ListLifecyclePoliciesInput) SetResources(v []*string) *ListLifecyclePoliciesInput { - s.Resources = v - return s -} - -// SetType sets the Type field's value. -func (s *ListLifecyclePoliciesInput) SetType(v string) *ListLifecyclePoliciesInput { - s.Type = &v - return s -} - -type ListLifecyclePoliciesOutput struct { - _ struct{} `type:"structure"` - - // Details about the requested lifecycle policies. - LifecyclePolicySummaries []*LifecyclePolicySummary `locationName:"lifecyclePolicySummaries" type:"list"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" 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 ListLifecyclePoliciesOutput) 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 ListLifecyclePoliciesOutput) GoString() string { - return s.String() -} - -// SetLifecyclePolicySummaries sets the LifecyclePolicySummaries field's value. -func (s *ListLifecyclePoliciesOutput) SetLifecyclePolicySummaries(v []*LifecyclePolicySummary) *ListLifecyclePoliciesOutput { - s.LifecyclePolicySummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLifecyclePoliciesOutput) SetNextToken(v string) *ListLifecyclePoliciesOutput { - s.NextToken = &v - return s -} - -type ListSecurityConfigsInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to get the next page of results. The default is 20. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListSecurityConfigs operation returns a nextToken, you can - // include the returned nextToken in subsequent ListSecurityConfigs operations, - // which returns results in the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // The type of security configuration. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SecurityConfigType"` -} - -// 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 ListSecurityConfigsInput) 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 ListSecurityConfigsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSecurityConfigsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSecurityConfigsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSecurityConfigsInput) SetMaxResults(v int64) *ListSecurityConfigsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSecurityConfigsInput) SetNextToken(v string) *ListSecurityConfigsInput { - s.NextToken = &v - return s -} - -// SetType sets the Type field's value. -func (s *ListSecurityConfigsInput) SetType(v string) *ListSecurityConfigsInput { - s.Type = &v - return s -} - -type ListSecurityConfigsOutput struct { - _ struct{} `type:"structure"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // Details about the security configurations in your account. - SecurityConfigSummaries []*SecurityConfigSummary `locationName:"securityConfigSummaries" type:"list"` -} - -// 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 ListSecurityConfigsOutput) 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 ListSecurityConfigsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSecurityConfigsOutput) SetNextToken(v string) *ListSecurityConfigsOutput { - s.NextToken = &v - return s -} - -// SetSecurityConfigSummaries sets the SecurityConfigSummaries field's value. -func (s *ListSecurityConfigsOutput) SetSecurityConfigSummaries(v []*SecurityConfigSummary) *ListSecurityConfigsOutput { - s.SecurityConfigSummaries = v - return s -} - -type ListSecurityPoliciesInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to get the next page of results. The default is 20. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListSecurityPolicies operation returns a nextToken, you can - // include the returned nextToken in subsequent ListSecurityPolicies operations, - // which returns results in the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // Resource filters (can be collection or indexes) that policies can apply to. - Resource []*string `locationName:"resource" min:"1" type:"list"` - - // The type of policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SecurityPolicyType"` -} - -// 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 ListSecurityPoliciesInput) 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 ListSecurityPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSecurityPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSecurityPoliciesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Resource != nil && len(s.Resource) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Resource", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSecurityPoliciesInput) SetMaxResults(v int64) *ListSecurityPoliciesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSecurityPoliciesInput) SetNextToken(v string) *ListSecurityPoliciesInput { - s.NextToken = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *ListSecurityPoliciesInput) SetResource(v []*string) *ListSecurityPoliciesInput { - s.Resource = v - return s -} - -// SetType sets the Type field's value. -func (s *ListSecurityPoliciesInput) SetType(v string) *ListSecurityPoliciesInput { - s.Type = &v - return s -} - -type ListSecurityPoliciesOutput struct { - _ struct{} `type:"structure"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // Details about the security policies in your account. - SecurityPolicySummaries []*SecurityPolicySummary `locationName:"securityPolicySummaries" type:"list"` -} - -// 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 ListSecurityPoliciesOutput) 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 ListSecurityPoliciesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSecurityPoliciesOutput) SetNextToken(v string) *ListSecurityPoliciesOutput { - s.NextToken = &v - return s -} - -// SetSecurityPolicySummaries sets the SecurityPolicySummaries field's value. -func (s *ListSecurityPoliciesOutput) SetSecurityPolicySummaries(v []*SecurityPolicySummary) *ListSecurityPoliciesOutput { - s.SecurityPolicySummaries = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. The resource must be active - // (not in the DELETING state), and must be owned by the account ID included - // in the request. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags associated with the resource. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListVpcEndpointsInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to get the next page of results. The default is 20. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListVpcEndpoints operation returns a nextToken, you can include - // the returned nextToken in subsequent ListVpcEndpoints operations, which returns - // results in the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // Filter the results according to the current status of the VPC endpoint. Possible - // statuses are CREATING, DELETING, UPDATING, ACTIVE, and FAILED. - VpcEndpointFilters *VpcEndpointFilters `locationName:"vpcEndpointFilters" 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 ListVpcEndpointsInput) 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 ListVpcEndpointsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVpcEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVpcEndpointsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVpcEndpointsInput) SetMaxResults(v int64) *ListVpcEndpointsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVpcEndpointsInput) SetNextToken(v string) *ListVpcEndpointsInput { - s.NextToken = &v - return s -} - -// SetVpcEndpointFilters sets the VpcEndpointFilters field's value. -func (s *ListVpcEndpointsInput) SetVpcEndpointFilters(v *VpcEndpointFilters) *ListVpcEndpointsInput { - s.VpcEndpointFilters = v - return s -} - -type ListVpcEndpointsOutput struct { - _ struct{} `type:"structure"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // Details about each VPC endpoint, including the name and current status. - VpcEndpointSummaries []*VpcEndpointSummary `locationName:"vpcEndpointSummaries" type:"list"` -} - -// 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 ListVpcEndpointsOutput) 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 ListVpcEndpointsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVpcEndpointsOutput) SetNextToken(v string) *ListVpcEndpointsOutput { - s.NextToken = &v - return s -} - -// SetVpcEndpointSummaries sets the VpcEndpointSummaries field's value. -func (s *ListVpcEndpointsOutput) SetVpcEndpointSummaries(v []*VpcEndpointSummary) *ListVpcEndpointsOutput { - s.VpcEndpointSummaries = v - return s -} - -// Thrown when the collection you're attempting to create results in a number -// of search or indexing OCUs that exceeds the account limit. -type OcuLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Description of the error. - Message_ *string `locationName:"message" 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 OcuLimitExceededException) 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 OcuLimitExceededException) GoString() string { - return s.String() -} - -func newErrorOcuLimitExceededException(v protocol.ResponseMetadata) error { - return &OcuLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *OcuLimitExceededException) Code() string { - return "OcuLimitExceededException" -} - -// Message returns the exception's message. -func (s *OcuLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *OcuLimitExceededException) OrigErr() error { - return nil -} - -func (s *OcuLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *OcuLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *OcuLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Thrown when accessing or deleting a resource that does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Describes SAML options for an OpenSearch Serverless security configuration -// in the form of a key-value map. -type SamlConfigOptions struct { - _ struct{} `type:"structure"` - - // The group attribute for this SAML integration. - GroupAttribute *string `locationName:"groupAttribute" min:"1" type:"string"` - - // The XML IdP metadata file generated from your identity provider. - // - // Metadata is a required field - Metadata *string `locationName:"metadata" min:"1" type:"string" required:"true"` - - // The session timeout, in minutes. Default is 60 minutes (12 hours). - SessionTimeout *int64 `locationName:"sessionTimeout" min:"5" type:"integer"` - - // A user attribute for this SAML integration. - UserAttribute *string `locationName:"userAttribute" min:"1" 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 SamlConfigOptions) 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 SamlConfigOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SamlConfigOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SamlConfigOptions"} - if s.GroupAttribute != nil && len(*s.GroupAttribute) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupAttribute", 1)) - } - if s.Metadata == nil { - invalidParams.Add(request.NewErrParamRequired("Metadata")) - } - if s.Metadata != nil && len(*s.Metadata) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Metadata", 1)) - } - if s.SessionTimeout != nil && *s.SessionTimeout < 5 { - invalidParams.Add(request.NewErrParamMinValue("SessionTimeout", 5)) - } - if s.UserAttribute != nil && len(*s.UserAttribute) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserAttribute", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupAttribute sets the GroupAttribute field's value. -func (s *SamlConfigOptions) SetGroupAttribute(v string) *SamlConfigOptions { - s.GroupAttribute = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *SamlConfigOptions) SetMetadata(v string) *SamlConfigOptions { - s.Metadata = &v - return s -} - -// SetSessionTimeout sets the SessionTimeout field's value. -func (s *SamlConfigOptions) SetSessionTimeout(v int64) *SamlConfigOptions { - s.SessionTimeout = &v - return s -} - -// SetUserAttribute sets the UserAttribute field's value. -func (s *SamlConfigOptions) SetUserAttribute(v string) *SamlConfigOptions { - s.UserAttribute = &v - return s -} - -// Details about a security configuration for OpenSearch Serverless. -type SecurityConfigDetail struct { - _ struct{} `type:"structure"` - - // The version of the security configuration. - ConfigVersion *string `locationName:"configVersion" min:"20" type:"string"` - - // The date the configuration was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the security configuration. - Description *string `locationName:"description" min:"1" type:"string"` - - // The unique identifier of the security configuration. - Id *string `locationName:"id" min:"1" type:"string"` - - // The timestamp of when the configuration was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // SAML options for the security configuration in the form of a key-value map. - SamlOptions *SamlConfigOptions `locationName:"samlOptions" type:"structure"` - - // The type of security configuration. - Type *string `locationName:"type" type:"string" enum:"SecurityConfigType"` -} - -// 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 SecurityConfigDetail) 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 SecurityConfigDetail) GoString() string { - return s.String() -} - -// SetConfigVersion sets the ConfigVersion field's value. -func (s *SecurityConfigDetail) SetConfigVersion(v string) *SecurityConfigDetail { - s.ConfigVersion = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *SecurityConfigDetail) SetCreatedDate(v int64) *SecurityConfigDetail { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *SecurityConfigDetail) SetDescription(v string) *SecurityConfigDetail { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *SecurityConfigDetail) SetId(v string) *SecurityConfigDetail { - s.Id = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *SecurityConfigDetail) SetLastModifiedDate(v int64) *SecurityConfigDetail { - s.LastModifiedDate = &v - return s -} - -// SetSamlOptions sets the SamlOptions field's value. -func (s *SecurityConfigDetail) SetSamlOptions(v *SamlConfigOptions) *SecurityConfigDetail { - s.SamlOptions = v - return s -} - -// SetType sets the Type field's value. -func (s *SecurityConfigDetail) SetType(v string) *SecurityConfigDetail { - s.Type = &v - return s -} - -// Statistics for an OpenSearch Serverless security configuration. -type SecurityConfigStats struct { - _ struct{} `type:"structure"` - - // The number of security configurations in the current account. - SamlConfigCount *int64 `type:"long"` -} - -// 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 SecurityConfigStats) 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 SecurityConfigStats) GoString() string { - return s.String() -} - -// SetSamlConfigCount sets the SamlConfigCount field's value. -func (s *SecurityConfigStats) SetSamlConfigCount(v int64) *SecurityConfigStats { - s.SamlConfigCount = &v - return s -} - -// A summary of a security configuration for OpenSearch Serverless. -type SecurityConfigSummary struct { - _ struct{} `type:"structure"` - - // The version of the security configuration. - ConfigVersion *string `locationName:"configVersion" min:"20" type:"string"` - - // The Epoch time when the security configuration was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the security configuration. - Description *string `locationName:"description" min:"1" type:"string"` - - // The unique identifier of the security configuration. - Id *string `locationName:"id" min:"1" type:"string"` - - // The timestamp of when the configuration was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The type of security configuration. - Type *string `locationName:"type" type:"string" enum:"SecurityConfigType"` -} - -// 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 SecurityConfigSummary) 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 SecurityConfigSummary) GoString() string { - return s.String() -} - -// SetConfigVersion sets the ConfigVersion field's value. -func (s *SecurityConfigSummary) SetConfigVersion(v string) *SecurityConfigSummary { - s.ConfigVersion = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *SecurityConfigSummary) SetCreatedDate(v int64) *SecurityConfigSummary { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *SecurityConfigSummary) SetDescription(v string) *SecurityConfigSummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *SecurityConfigSummary) SetId(v string) *SecurityConfigSummary { - s.Id = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *SecurityConfigSummary) SetLastModifiedDate(v int64) *SecurityConfigSummary { - s.LastModifiedDate = &v - return s -} - -// SetType sets the Type field's value. -func (s *SecurityConfigSummary) SetType(v string) *SecurityConfigSummary { - s.Type = &v - return s -} - -// Details about an OpenSearch Serverless security policy. -type SecurityPolicyDetail struct { - _ struct{} `type:"structure"` - - // The date the policy was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the security policy. - Description *string `locationName:"description" type:"string"` - - // The timestamp of when the policy was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the policy. - Name *string `locationName:"name" min:"3" type:"string"` - - // The version of the policy. - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string"` - - // The type of security policy. - Type *string `locationName:"type" type:"string" enum:"SecurityPolicyType"` -} - -// 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 SecurityPolicyDetail) 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 SecurityPolicyDetail) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *SecurityPolicyDetail) SetCreatedDate(v int64) *SecurityPolicyDetail { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *SecurityPolicyDetail) SetDescription(v string) *SecurityPolicyDetail { - s.Description = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *SecurityPolicyDetail) SetLastModifiedDate(v int64) *SecurityPolicyDetail { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *SecurityPolicyDetail) SetName(v string) *SecurityPolicyDetail { - s.Name = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *SecurityPolicyDetail) SetPolicyVersion(v string) *SecurityPolicyDetail { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *SecurityPolicyDetail) SetType(v string) *SecurityPolicyDetail { - s.Type = &v - return s -} - -// Statistics for an OpenSearch Serverless security policy. -type SecurityPolicyStats struct { - _ struct{} `type:"structure"` - - // The number of encryption policies in the current account. - EncryptionPolicyCount *int64 `type:"long"` - - // The number of network policies in the current account. - NetworkPolicyCount *int64 `type:"long"` -} - -// 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 SecurityPolicyStats) 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 SecurityPolicyStats) GoString() string { - return s.String() -} - -// SetEncryptionPolicyCount sets the EncryptionPolicyCount field's value. -func (s *SecurityPolicyStats) SetEncryptionPolicyCount(v int64) *SecurityPolicyStats { - s.EncryptionPolicyCount = &v - return s -} - -// SetNetworkPolicyCount sets the NetworkPolicyCount field's value. -func (s *SecurityPolicyStats) SetNetworkPolicyCount(v int64) *SecurityPolicyStats { - s.NetworkPolicyCount = &v - return s -} - -// A summary of a security policy for OpenSearch Serverless. -type SecurityPolicySummary struct { - _ struct{} `type:"structure"` - - // The date the policy was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the security policy. - Description *string `locationName:"description" type:"string"` - - // The timestamp of when the policy was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the policy. - Name *string `locationName:"name" min:"3" type:"string"` - - // The version of the policy. - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string"` - - // The type of security policy. - Type *string `locationName:"type" type:"string" enum:"SecurityPolicyType"` -} - -// 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 SecurityPolicySummary) 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 SecurityPolicySummary) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *SecurityPolicySummary) SetCreatedDate(v int64) *SecurityPolicySummary { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *SecurityPolicySummary) SetDescription(v string) *SecurityPolicySummary { - s.Description = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *SecurityPolicySummary) SetLastModifiedDate(v int64) *SecurityPolicySummary { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *SecurityPolicySummary) SetName(v string) *SecurityPolicySummary { - s.Name = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *SecurityPolicySummary) SetPolicyVersion(v string) *SecurityPolicySummary { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *SecurityPolicySummary) SetType(v string) *SecurityPolicySummary { - s.Type = &v - return s -} - -// Thrown when you attempt to create more resources than the service allows -// based on service quotas. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // Service Quotas requirement to identify originating quota. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // Identifier of the resource affected. - ResourceId *string `locationName:"resourceId" type:"string"` - - // Type of the resource affected. - ResourceType *string `locationName:"resourceType" type:"string"` - - // Service Quotas requirement to identify originating service. - // - // ServiceCode is a required field - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A map of key-value pairs associated to an OpenSearch Serverless resource. -type Tag struct { - _ struct{} `type:"structure"` - - // The key to use in the tag. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // The value of the tag. - // - // Value is a required field - Value *string `locationName:"value" 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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. The resource must be active - // (not in the DELETING state), and must be owned by the account ID included - // in the request. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // A list of tags (key-value pairs) to add to the resource. All tag keys in - // the request must be unique. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource to remove tags from. The resource - // must be active (not in the DELETING state), and must be owned by the account - // ID included in the request. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The tag or set of tags to remove from the resource. All tag keys in the request - // must be unique. - // - // TagKeys is a required field - TagKeys []*string `locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateAccessPolicyInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description of the policy. Typically used to store information about the - // permissions defined in the policy. - Description *string `locationName:"description" type:"string"` - - // The name of the policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The JSON policy document to use as the content for the policy. - Policy *string `locationName:"policy" min:"1" type:"string"` - - // The version of the policy being updated. - // - // PolicyVersion is a required field - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string" required:"true"` - - // The type of policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AccessPolicyType"` -} - -// 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 UpdateAccessPolicyInput) 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 UpdateAccessPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAccessPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAccessPolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.PolicyVersion == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyVersion")) - } - if s.PolicyVersion != nil && len(*s.PolicyVersion) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyVersion", 20)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateAccessPolicyInput) SetClientToken(v string) *UpdateAccessPolicyInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateAccessPolicyInput) SetDescription(v string) *UpdateAccessPolicyInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateAccessPolicyInput) SetName(v string) *UpdateAccessPolicyInput { - s.Name = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *UpdateAccessPolicyInput) SetPolicy(v string) *UpdateAccessPolicyInput { - s.Policy = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *UpdateAccessPolicyInput) SetPolicyVersion(v string) *UpdateAccessPolicyInput { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateAccessPolicyInput) SetType(v string) *UpdateAccessPolicyInput { - s.Type = &v - return s -} - -type UpdateAccessPolicyOutput struct { - _ struct{} `type:"structure"` - - // Details about the updated access policy. - AccessPolicyDetail *AccessPolicyDetail `locationName:"accessPolicyDetail" 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 UpdateAccessPolicyOutput) 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 UpdateAccessPolicyOutput) GoString() string { - return s.String() -} - -// SetAccessPolicyDetail sets the AccessPolicyDetail field's value. -func (s *UpdateAccessPolicyOutput) SetAccessPolicyDetail(v *AccessPolicyDetail) *UpdateAccessPolicyOutput { - s.AccessPolicyDetail = v - return s -} - -type UpdateAccountSettingsInput struct { - _ struct{} `type:"structure"` - - // The maximum capacity limits for all OpenSearch Serverless collections, in - // OpenSearch Compute Units (OCUs). These limits are used to scale your collections - // based on the current workload. For more information, see Managing capacity - // limits for Amazon OpenSearch Serverless (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-scaling.html). - CapacityLimits *CapacityLimits `locationName:"capacityLimits" 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 UpdateAccountSettingsInput) 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 UpdateAccountSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAccountSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAccountSettingsInput"} - if s.CapacityLimits != nil { - if err := s.CapacityLimits.Validate(); err != nil { - invalidParams.AddNested("CapacityLimits", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapacityLimits sets the CapacityLimits field's value. -func (s *UpdateAccountSettingsInput) SetCapacityLimits(v *CapacityLimits) *UpdateAccountSettingsInput { - s.CapacityLimits = v - return s -} - -type UpdateAccountSettingsOutput struct { - _ struct{} `type:"structure"` - - // OpenSearch Serverless-related settings for the current Amazon Web Services - // account. - AccountSettingsDetail *AccountSettingsDetail `locationName:"accountSettingsDetail" 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 UpdateAccountSettingsOutput) 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 UpdateAccountSettingsOutput) GoString() string { - return s.String() -} - -// SetAccountSettingsDetail sets the AccountSettingsDetail field's value. -func (s *UpdateAccountSettingsOutput) SetAccountSettingsDetail(v *AccountSettingsDetail) *UpdateAccountSettingsOutput { - s.AccountSettingsDetail = v - return s -} - -// Details about an updated OpenSearch Serverless collection. -type UpdateCollectionDetail struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the collection. - Arn *string `locationName:"arn" type:"string"` - - // The date and time when the collection was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The description of the collection. - Description *string `locationName:"description" type:"string"` - - // The unique identifier of the collection. - Id *string `locationName:"id" min:"3" type:"string"` - - // The date and time when the collection was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the collection. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status of the collection. - Status *string `locationName:"status" type:"string" enum:"CollectionStatus"` - - // The collection type. - Type *string `locationName:"type" type:"string" enum:"CollectionType"` -} - -// 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 UpdateCollectionDetail) 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 UpdateCollectionDetail) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateCollectionDetail) SetArn(v string) *UpdateCollectionDetail { - s.Arn = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *UpdateCollectionDetail) SetCreatedDate(v int64) *UpdateCollectionDetail { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateCollectionDetail) SetDescription(v string) *UpdateCollectionDetail { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateCollectionDetail) SetId(v string) *UpdateCollectionDetail { - s.Id = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *UpdateCollectionDetail) SetLastModifiedDate(v int64) *UpdateCollectionDetail { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCollectionDetail) SetName(v string) *UpdateCollectionDetail { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateCollectionDetail) SetStatus(v string) *UpdateCollectionDetail { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateCollectionDetail) SetType(v string) *UpdateCollectionDetail { - s.Type = &v - return s -} - -type UpdateCollectionInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description of the collection. - Description *string `locationName:"description" type:"string"` - - // The unique identifier of the collection. - // - // Id is a required field - Id *string `locationName:"id" min:"3" 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 UpdateCollectionInput) 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 UpdateCollectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCollectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCollectionInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Id", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateCollectionInput) SetClientToken(v string) *UpdateCollectionInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateCollectionInput) SetDescription(v string) *UpdateCollectionInput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateCollectionInput) SetId(v string) *UpdateCollectionInput { - s.Id = &v - return s -} - -type UpdateCollectionOutput struct { - _ struct{} `type:"structure"` - - // Details about the updated collection. - UpdateCollectionDetail *UpdateCollectionDetail `locationName:"updateCollectionDetail" 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 UpdateCollectionOutput) 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 UpdateCollectionOutput) GoString() string { - return s.String() -} - -// SetUpdateCollectionDetail sets the UpdateCollectionDetail field's value. -func (s *UpdateCollectionOutput) SetUpdateCollectionDetail(v *UpdateCollectionDetail) *UpdateCollectionOutput { - s.UpdateCollectionDetail = v - return s -} - -type UpdateLifecyclePolicyInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description of the lifecycle policy. - Description *string `locationName:"description" type:"string"` - - // The name of the policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The JSON policy document to use as the content for the lifecycle policy. - Policy *string `locationName:"policy" min:"1" type:"string"` - - // The version of the policy being updated. - // - // PolicyVersion is a required field - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string" required:"true"` - - // The type of lifecycle policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"LifecyclePolicyType"` -} - -// 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 UpdateLifecyclePolicyInput) 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 UpdateLifecyclePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateLifecyclePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateLifecyclePolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.PolicyVersion == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyVersion")) - } - if s.PolicyVersion != nil && len(*s.PolicyVersion) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyVersion", 20)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateLifecyclePolicyInput) SetClientToken(v string) *UpdateLifecyclePolicyInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateLifecyclePolicyInput) SetDescription(v string) *UpdateLifecyclePolicyInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateLifecyclePolicyInput) SetName(v string) *UpdateLifecyclePolicyInput { - s.Name = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *UpdateLifecyclePolicyInput) SetPolicy(v string) *UpdateLifecyclePolicyInput { - s.Policy = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *UpdateLifecyclePolicyInput) SetPolicyVersion(v string) *UpdateLifecyclePolicyInput { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateLifecyclePolicyInput) SetType(v string) *UpdateLifecyclePolicyInput { - s.Type = &v - return s -} - -type UpdateLifecyclePolicyOutput struct { - _ struct{} `type:"structure"` - - // Details about the updated lifecycle policy. - LifecyclePolicyDetail *LifecyclePolicyDetail `locationName:"lifecyclePolicyDetail" 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 UpdateLifecyclePolicyOutput) 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 UpdateLifecyclePolicyOutput) GoString() string { - return s.String() -} - -// SetLifecyclePolicyDetail sets the LifecyclePolicyDetail field's value. -func (s *UpdateLifecyclePolicyOutput) SetLifecyclePolicyDetail(v *LifecyclePolicyDetail) *UpdateLifecyclePolicyOutput { - s.LifecyclePolicyDetail = v - return s -} - -type UpdateSecurityConfigInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The version of the security configuration to be updated. You can find the - // most recent version of a security configuration using the GetSecurityPolicy - // command. - // - // ConfigVersion is a required field - ConfigVersion *string `locationName:"configVersion" min:"20" type:"string" required:"true"` - - // A description of the security configuration. - Description *string `locationName:"description" min:"1" type:"string"` - - // The security configuration identifier. For SAML the ID will be saml//. - // For example, saml/123456789123/OKTADev. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // SAML options in in the form of a key-value map. - SamlOptions *SamlConfigOptions `locationName:"samlOptions" 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 UpdateSecurityConfigInput) 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 UpdateSecurityConfigInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSecurityConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSecurityConfigInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ConfigVersion == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigVersion")) - } - if s.ConfigVersion != nil && len(*s.ConfigVersion) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ConfigVersion", 20)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.SamlOptions != nil { - if err := s.SamlOptions.Validate(); err != nil { - invalidParams.AddNested("SamlOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateSecurityConfigInput) SetClientToken(v string) *UpdateSecurityConfigInput { - s.ClientToken = &v - return s -} - -// SetConfigVersion sets the ConfigVersion field's value. -func (s *UpdateSecurityConfigInput) SetConfigVersion(v string) *UpdateSecurityConfigInput { - s.ConfigVersion = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateSecurityConfigInput) SetDescription(v string) *UpdateSecurityConfigInput { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateSecurityConfigInput) SetId(v string) *UpdateSecurityConfigInput { - s.Id = &v - return s -} - -// SetSamlOptions sets the SamlOptions field's value. -func (s *UpdateSecurityConfigInput) SetSamlOptions(v *SamlConfigOptions) *UpdateSecurityConfigInput { - s.SamlOptions = v - return s -} - -type UpdateSecurityConfigOutput struct { - _ struct{} `type:"structure"` - - // Details about the updated security configuration. - SecurityConfigDetail *SecurityConfigDetail `locationName:"securityConfigDetail" 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 UpdateSecurityConfigOutput) 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 UpdateSecurityConfigOutput) GoString() string { - return s.String() -} - -// SetSecurityConfigDetail sets the SecurityConfigDetail field's value. -func (s *UpdateSecurityConfigOutput) SetSecurityConfigDetail(v *SecurityConfigDetail) *UpdateSecurityConfigOutput { - s.SecurityConfigDetail = v - return s -} - -type UpdateSecurityPolicyInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description of the policy. Typically used to store information about the - // permissions defined in the policy. - Description *string `locationName:"description" type:"string"` - - // The name of the policy. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The JSON policy document to use as the content for the new policy. - Policy *string `locationName:"policy" min:"1" type:"string"` - - // The version of the policy being updated. - // - // PolicyVersion is a required field - PolicyVersion *string `locationName:"policyVersion" min:"20" type:"string" required:"true"` - - // The type of access policy. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SecurityPolicyType"` -} - -// 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 UpdateSecurityPolicyInput) 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 UpdateSecurityPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSecurityPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSecurityPolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.PolicyVersion == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyVersion")) - } - if s.PolicyVersion != nil && len(*s.PolicyVersion) < 20 { - invalidParams.Add(request.NewErrParamMinLen("PolicyVersion", 20)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateSecurityPolicyInput) SetClientToken(v string) *UpdateSecurityPolicyInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateSecurityPolicyInput) SetDescription(v string) *UpdateSecurityPolicyInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateSecurityPolicyInput) SetName(v string) *UpdateSecurityPolicyInput { - s.Name = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *UpdateSecurityPolicyInput) SetPolicy(v string) *UpdateSecurityPolicyInput { - s.Policy = &v - return s -} - -// SetPolicyVersion sets the PolicyVersion field's value. -func (s *UpdateSecurityPolicyInput) SetPolicyVersion(v string) *UpdateSecurityPolicyInput { - s.PolicyVersion = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateSecurityPolicyInput) SetType(v string) *UpdateSecurityPolicyInput { - s.Type = &v - return s -} - -type UpdateSecurityPolicyOutput struct { - _ struct{} `type:"structure"` - - // Details about the updated security policy. - SecurityPolicyDetail *SecurityPolicyDetail `locationName:"securityPolicyDetail" 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 UpdateSecurityPolicyOutput) 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 UpdateSecurityPolicyOutput) GoString() string { - return s.String() -} - -// SetSecurityPolicyDetail sets the SecurityPolicyDetail field's value. -func (s *UpdateSecurityPolicyOutput) SetSecurityPolicyDetail(v *SecurityPolicyDetail) *UpdateSecurityPolicyOutput { - s.SecurityPolicyDetail = v - return s -} - -// Update details for an OpenSearch Serverless-managed interface endpoint. -type UpdateVpcEndpointDetail struct { - _ struct{} `type:"structure"` - - // The unique identifier of the endpoint. - Id *string `locationName:"id" min:"1" type:"string"` - - // The timestamp of when the endpoint was last modified. - LastModifiedDate *int64 `locationName:"lastModifiedDate" type:"long"` - - // The name of the endpoint. - Name *string `locationName:"name" min:"3" type:"string"` - - // The unique identifiers of the security groups that define the ports, protocols, - // and sources for inbound traffic that you are authorizing into your endpoint. - SecurityGroupIds []*string `locationName:"securityGroupIds" min:"1" type:"list"` - - // The current status of the endpoint update process. - Status *string `locationName:"status" type:"string" enum:"VpcEndpointStatus"` - - // The ID of the subnets from which you access OpenSearch Serverless. - SubnetIds []*string `locationName:"subnetIds" min:"1" type:"list"` -} - -// 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 UpdateVpcEndpointDetail) 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 UpdateVpcEndpointDetail) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *UpdateVpcEndpointDetail) SetId(v string) *UpdateVpcEndpointDetail { - s.Id = &v - return s -} - -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *UpdateVpcEndpointDetail) SetLastModifiedDate(v int64) *UpdateVpcEndpointDetail { - s.LastModifiedDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateVpcEndpointDetail) SetName(v string) *UpdateVpcEndpointDetail { - s.Name = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *UpdateVpcEndpointDetail) SetSecurityGroupIds(v []*string) *UpdateVpcEndpointDetail { - s.SecurityGroupIds = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateVpcEndpointDetail) SetStatus(v string) *UpdateVpcEndpointDetail { - s.Status = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *UpdateVpcEndpointDetail) SetSubnetIds(v []*string) *UpdateVpcEndpointDetail { - s.SubnetIds = v - return s -} - -type UpdateVpcEndpointInput struct { - _ struct{} `type:"structure"` - - // The unique identifiers of the security groups to add to the endpoint. Security - // groups define the ports, protocols, and sources for inbound traffic that - // you are authorizing into your endpoint. - AddSecurityGroupIds []*string `locationName:"addSecurityGroupIds" min:"1" type:"list"` - - // The ID of one or more subnets to add to the endpoint. - AddSubnetIds []*string `locationName:"addSubnetIds" min:"1" type:"list"` - - // Unique, case-sensitive identifier to ensure idempotency of the request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The unique identifier of the interface endpoint to update. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // The unique identifiers of the security groups to remove from the endpoint. - RemoveSecurityGroupIds []*string `locationName:"removeSecurityGroupIds" min:"1" type:"list"` - - // The unique identifiers of the subnets to remove from the endpoint. - RemoveSubnetIds []*string `locationName:"removeSubnetIds" min:"1" type:"list"` -} - -// 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 UpdateVpcEndpointInput) 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 UpdateVpcEndpointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVpcEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVpcEndpointInput"} - if s.AddSecurityGroupIds != nil && len(s.AddSecurityGroupIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AddSecurityGroupIds", 1)) - } - if s.AddSubnetIds != nil && len(s.AddSubnetIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AddSubnetIds", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.RemoveSecurityGroupIds != nil && len(s.RemoveSecurityGroupIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RemoveSecurityGroupIds", 1)) - } - if s.RemoveSubnetIds != nil && len(s.RemoveSubnetIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RemoveSubnetIds", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddSecurityGroupIds sets the AddSecurityGroupIds field's value. -func (s *UpdateVpcEndpointInput) SetAddSecurityGroupIds(v []*string) *UpdateVpcEndpointInput { - s.AddSecurityGroupIds = v - return s -} - -// SetAddSubnetIds sets the AddSubnetIds field's value. -func (s *UpdateVpcEndpointInput) SetAddSubnetIds(v []*string) *UpdateVpcEndpointInput { - s.AddSubnetIds = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateVpcEndpointInput) SetClientToken(v string) *UpdateVpcEndpointInput { - s.ClientToken = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateVpcEndpointInput) SetId(v string) *UpdateVpcEndpointInput { - s.Id = &v - return s -} - -// SetRemoveSecurityGroupIds sets the RemoveSecurityGroupIds field's value. -func (s *UpdateVpcEndpointInput) SetRemoveSecurityGroupIds(v []*string) *UpdateVpcEndpointInput { - s.RemoveSecurityGroupIds = v - return s -} - -// SetRemoveSubnetIds sets the RemoveSubnetIds field's value. -func (s *UpdateVpcEndpointInput) SetRemoveSubnetIds(v []*string) *UpdateVpcEndpointInput { - s.RemoveSubnetIds = v - return s -} - -type UpdateVpcEndpointOutput struct { - _ struct{} `type:"structure"` - - // Details about the updated VPC endpoint. - UpdateVpcEndpointDetail *UpdateVpcEndpointDetail `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 UpdateVpcEndpointOutput) 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 UpdateVpcEndpointOutput) GoString() string { - return s.String() -} - -// SetUpdateVpcEndpointDetail sets the UpdateVpcEndpointDetail field's value. -func (s *UpdateVpcEndpointOutput) SetUpdateVpcEndpointDetail(v *UpdateVpcEndpointDetail) *UpdateVpcEndpointOutput { - s.UpdateVpcEndpointDetail = v - return s -} - -// Thrown when the HTTP request contains invalid input or is missing required -// input. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Details about an OpenSearch Serverless-managed interface endpoint. -type VpcEndpointDetail struct { - _ struct{} `type:"structure"` - - // The date the endpoint was created. - CreatedDate *int64 `locationName:"createdDate" type:"long"` - - // The unique identifier of the endpoint. - Id *string `locationName:"id" min:"1" type:"string"` - - // The name of the endpoint. - Name *string `locationName:"name" min:"3" type:"string"` - - // The unique identifiers of the security groups that define the ports, protocols, - // and sources for inbound traffic that you are authorizing into your endpoint. - SecurityGroupIds []*string `locationName:"securityGroupIds" min:"1" type:"list"` - - // The current status of the endpoint. - Status *string `locationName:"status" type:"string" enum:"VpcEndpointStatus"` - - // The ID of the subnets from which you access OpenSearch Serverless. - SubnetIds []*string `locationName:"subnetIds" min:"1" type:"list"` - - // The ID of the VPC from which you access OpenSearch Serverless. - VpcId *string `locationName:"vpcId" min:"1" 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 VpcEndpointDetail) 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 VpcEndpointDetail) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *VpcEndpointDetail) SetCreatedDate(v int64) *VpcEndpointDetail { - s.CreatedDate = &v - return s -} - -// SetId sets the Id field's value. -func (s *VpcEndpointDetail) SetId(v string) *VpcEndpointDetail { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *VpcEndpointDetail) SetName(v string) *VpcEndpointDetail { - s.Name = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *VpcEndpointDetail) SetSecurityGroupIds(v []*string) *VpcEndpointDetail { - s.SecurityGroupIds = v - return s -} - -// SetStatus sets the Status field's value. -func (s *VpcEndpointDetail) SetStatus(v string) *VpcEndpointDetail { - s.Status = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *VpcEndpointDetail) SetSubnetIds(v []*string) *VpcEndpointDetail { - s.SubnetIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcEndpointDetail) SetVpcId(v string) *VpcEndpointDetail { - s.VpcId = &v - return s -} - -// Error information for a failed BatchGetVpcEndpoint request. -type VpcEndpointErrorDetail struct { - _ struct{} `type:"structure"` - - // The error code for the failed request. - ErrorCode *string `locationName:"errorCode" type:"string"` - - // An error message describing the reason for the failure. - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // The unique identifier of the VPC endpoint. - Id *string `locationName:"id" min:"1" 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 VpcEndpointErrorDetail) 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 VpcEndpointErrorDetail) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *VpcEndpointErrorDetail) SetErrorCode(v string) *VpcEndpointErrorDetail { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *VpcEndpointErrorDetail) SetErrorMessage(v string) *VpcEndpointErrorDetail { - s.ErrorMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *VpcEndpointErrorDetail) SetId(v string) *VpcEndpointErrorDetail { - s.Id = &v - return s -} - -// Filter the results of a ListVpcEndpoints request. -type VpcEndpointFilters struct { - _ struct{} `type:"structure"` - - // The current status of the endpoint. - Status *string `locationName:"status" type:"string" enum:"VpcEndpointStatus"` -} - -// 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 VpcEndpointFilters) 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 VpcEndpointFilters) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *VpcEndpointFilters) SetStatus(v string) *VpcEndpointFilters { - s.Status = &v - return s -} - -// The VPC endpoint object. -type VpcEndpointSummary struct { - _ struct{} `type:"structure"` - - // The unique identifier of the endpoint. - Id *string `locationName:"id" min:"1" type:"string"` - - // The name of the endpoint. - Name *string `locationName:"name" min:"3" type:"string"` - - // The current status of the endpoint. - Status *string `locationName:"status" type:"string" enum:"VpcEndpointStatus"` -} - -// 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 VpcEndpointSummary) 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 VpcEndpointSummary) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *VpcEndpointSummary) SetId(v string) *VpcEndpointSummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *VpcEndpointSummary) SetName(v string) *VpcEndpointSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VpcEndpointSummary) SetStatus(v string) *VpcEndpointSummary { - s.Status = &v - return s -} - -const ( - // AccessPolicyTypeData is a AccessPolicyType enum value - AccessPolicyTypeData = "data" -) - -// AccessPolicyType_Values returns all elements of the AccessPolicyType enum -func AccessPolicyType_Values() []string { - return []string{ - AccessPolicyTypeData, - } -} - -const ( - // CollectionStatusCreating is a CollectionStatus enum value - CollectionStatusCreating = "CREATING" - - // CollectionStatusDeleting is a CollectionStatus enum value - CollectionStatusDeleting = "DELETING" - - // CollectionStatusActive is a CollectionStatus enum value - CollectionStatusActive = "ACTIVE" - - // CollectionStatusFailed is a CollectionStatus enum value - CollectionStatusFailed = "FAILED" -) - -// CollectionStatus_Values returns all elements of the CollectionStatus enum -func CollectionStatus_Values() []string { - return []string{ - CollectionStatusCreating, - CollectionStatusDeleting, - CollectionStatusActive, - CollectionStatusFailed, - } -} - -const ( - // CollectionTypeSearch is a CollectionType enum value - CollectionTypeSearch = "SEARCH" - - // CollectionTypeTimeseries is a CollectionType enum value - CollectionTypeTimeseries = "TIMESERIES" - - // CollectionTypeVectorsearch is a CollectionType enum value - CollectionTypeVectorsearch = "VECTORSEARCH" -) - -// CollectionType_Values returns all elements of the CollectionType enum -func CollectionType_Values() []string { - return []string{ - CollectionTypeSearch, - CollectionTypeTimeseries, - CollectionTypeVectorsearch, - } -} - -const ( - // LifecyclePolicyTypeRetention is a LifecyclePolicyType enum value - LifecyclePolicyTypeRetention = "retention" -) - -// LifecyclePolicyType_Values returns all elements of the LifecyclePolicyType enum -func LifecyclePolicyType_Values() []string { - return []string{ - LifecyclePolicyTypeRetention, - } -} - -const ( - // ResourceTypeIndex is a ResourceType enum value - ResourceTypeIndex = "index" -) - -// ResourceType_Values returns all elements of the ResourceType enum -func ResourceType_Values() []string { - return []string{ - ResourceTypeIndex, - } -} - -const ( - // SecurityConfigTypeSaml is a SecurityConfigType enum value - SecurityConfigTypeSaml = "saml" -) - -// SecurityConfigType_Values returns all elements of the SecurityConfigType enum -func SecurityConfigType_Values() []string { - return []string{ - SecurityConfigTypeSaml, - } -} - -const ( - // SecurityPolicyTypeEncryption is a SecurityPolicyType enum value - SecurityPolicyTypeEncryption = "encryption" - - // SecurityPolicyTypeNetwork is a SecurityPolicyType enum value - SecurityPolicyTypeNetwork = "network" -) - -// SecurityPolicyType_Values returns all elements of the SecurityPolicyType enum -func SecurityPolicyType_Values() []string { - return []string{ - SecurityPolicyTypeEncryption, - SecurityPolicyTypeNetwork, - } -} - -const ( - // VpcEndpointStatusPending is a VpcEndpointStatus enum value - VpcEndpointStatusPending = "PENDING" - - // VpcEndpointStatusDeleting is a VpcEndpointStatus enum value - VpcEndpointStatusDeleting = "DELETING" - - // VpcEndpointStatusActive is a VpcEndpointStatus enum value - VpcEndpointStatusActive = "ACTIVE" - - // VpcEndpointStatusFailed is a VpcEndpointStatus enum value - VpcEndpointStatusFailed = "FAILED" -) - -// VpcEndpointStatus_Values returns all elements of the VpcEndpointStatus enum -func VpcEndpointStatus_Values() []string { - return []string{ - VpcEndpointStatusPending, - VpcEndpointStatusDeleting, - VpcEndpointStatusActive, - VpcEndpointStatusFailed, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/doc.go deleted file mode 100644 index d01a984337bb..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/doc.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package opensearchserverless provides the client and types for making API -// requests to OpenSearch Service Serverless. -// -// Use the Amazon OpenSearch Serverless API to create, configure, and manage -// OpenSearch Serverless collections and security policies. -// -// OpenSearch Serverless is an on-demand, pre-provisioned serverless configuration -// for Amazon OpenSearch Service. OpenSearch Serverless removes the operational -// complexities of provisioning, configuring, and tuning your OpenSearch clusters. -// It enables you to easily search and analyze petabytes of data without having -// to worry about the underlying infrastructure and data management. -// -// To learn more about OpenSearch Serverless, see What is Amazon OpenSearch -// Serverless? (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-overview.html) -// -// See https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01 for more information on this service. -// -// See opensearchserverless package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/opensearchserverless/ -// -// # Using the Client -// -// To contact OpenSearch Service Serverless with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the OpenSearch Service Serverless client OpenSearchServerless for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/opensearchserverless/#New -package opensearchserverless diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/errors.go deleted file mode 100644 index d3fa4b314f96..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/errors.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package opensearchserverless - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // When creating a resource, thrown when a resource with the same name already - // exists or is being created. When deleting a resource, thrown when the resource - // is not in the ACTIVE or FAILED state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Thrown when an error internal to the service occurs while processing a request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeOcuLimitExceededException for service response error code - // "OcuLimitExceededException". - // - // Thrown when the collection you're attempting to create results in a number - // of search or indexing OCUs that exceeds the account limit. - ErrCodeOcuLimitExceededException = "OcuLimitExceededException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Thrown when accessing or deleting a resource that does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Thrown when you attempt to create more resources than the service allows - // based on service quotas. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Thrown when the HTTP request contains invalid input or is missing required - // input. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "OcuLimitExceededException": newErrorOcuLimitExceededException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/opensearchserverlessiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/opensearchserverlessiface/interface.go deleted file mode 100644 index a8c3272d23c2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/opensearchserverlessiface/interface.go +++ /dev/null @@ -1,230 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package opensearchserverlessiface provides an interface to enable mocking the OpenSearch Service Serverless service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package opensearchserverlessiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless" -) - -// OpenSearchServerlessAPI provides an interface to enable mocking the -// opensearchserverless.OpenSearchServerless service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // OpenSearch Service Serverless. -// func myFunc(svc opensearchserverlessiface.OpenSearchServerlessAPI) bool { -// // Make svc.BatchGetCollection request -// } -// -// func main() { -// sess := session.New() -// svc := opensearchserverless.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockOpenSearchServerlessClient struct { -// opensearchserverlessiface.OpenSearchServerlessAPI -// } -// func (m *mockOpenSearchServerlessClient) BatchGetCollection(input *opensearchserverless.BatchGetCollectionInput) (*opensearchserverless.BatchGetCollectionOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockOpenSearchServerlessClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type OpenSearchServerlessAPI interface { - BatchGetCollection(*opensearchserverless.BatchGetCollectionInput) (*opensearchserverless.BatchGetCollectionOutput, error) - BatchGetCollectionWithContext(aws.Context, *opensearchserverless.BatchGetCollectionInput, ...request.Option) (*opensearchserverless.BatchGetCollectionOutput, error) - BatchGetCollectionRequest(*opensearchserverless.BatchGetCollectionInput) (*request.Request, *opensearchserverless.BatchGetCollectionOutput) - - BatchGetEffectiveLifecyclePolicy(*opensearchserverless.BatchGetEffectiveLifecyclePolicyInput) (*opensearchserverless.BatchGetEffectiveLifecyclePolicyOutput, error) - BatchGetEffectiveLifecyclePolicyWithContext(aws.Context, *opensearchserverless.BatchGetEffectiveLifecyclePolicyInput, ...request.Option) (*opensearchserverless.BatchGetEffectiveLifecyclePolicyOutput, error) - BatchGetEffectiveLifecyclePolicyRequest(*opensearchserverless.BatchGetEffectiveLifecyclePolicyInput) (*request.Request, *opensearchserverless.BatchGetEffectiveLifecyclePolicyOutput) - - BatchGetLifecyclePolicy(*opensearchserverless.BatchGetLifecyclePolicyInput) (*opensearchserverless.BatchGetLifecyclePolicyOutput, error) - BatchGetLifecyclePolicyWithContext(aws.Context, *opensearchserverless.BatchGetLifecyclePolicyInput, ...request.Option) (*opensearchserverless.BatchGetLifecyclePolicyOutput, error) - BatchGetLifecyclePolicyRequest(*opensearchserverless.BatchGetLifecyclePolicyInput) (*request.Request, *opensearchserverless.BatchGetLifecyclePolicyOutput) - - BatchGetVpcEndpoint(*opensearchserverless.BatchGetVpcEndpointInput) (*opensearchserverless.BatchGetVpcEndpointOutput, error) - BatchGetVpcEndpointWithContext(aws.Context, *opensearchserverless.BatchGetVpcEndpointInput, ...request.Option) (*opensearchserverless.BatchGetVpcEndpointOutput, error) - BatchGetVpcEndpointRequest(*opensearchserverless.BatchGetVpcEndpointInput) (*request.Request, *opensearchserverless.BatchGetVpcEndpointOutput) - - CreateAccessPolicy(*opensearchserverless.CreateAccessPolicyInput) (*opensearchserverless.CreateAccessPolicyOutput, error) - CreateAccessPolicyWithContext(aws.Context, *opensearchserverless.CreateAccessPolicyInput, ...request.Option) (*opensearchserverless.CreateAccessPolicyOutput, error) - CreateAccessPolicyRequest(*opensearchserverless.CreateAccessPolicyInput) (*request.Request, *opensearchserverless.CreateAccessPolicyOutput) - - CreateCollection(*opensearchserverless.CreateCollectionInput) (*opensearchserverless.CreateCollectionOutput, error) - CreateCollectionWithContext(aws.Context, *opensearchserverless.CreateCollectionInput, ...request.Option) (*opensearchserverless.CreateCollectionOutput, error) - CreateCollectionRequest(*opensearchserverless.CreateCollectionInput) (*request.Request, *opensearchserverless.CreateCollectionOutput) - - CreateLifecyclePolicy(*opensearchserverless.CreateLifecyclePolicyInput) (*opensearchserverless.CreateLifecyclePolicyOutput, error) - CreateLifecyclePolicyWithContext(aws.Context, *opensearchserverless.CreateLifecyclePolicyInput, ...request.Option) (*opensearchserverless.CreateLifecyclePolicyOutput, error) - CreateLifecyclePolicyRequest(*opensearchserverless.CreateLifecyclePolicyInput) (*request.Request, *opensearchserverless.CreateLifecyclePolicyOutput) - - CreateSecurityConfig(*opensearchserverless.CreateSecurityConfigInput) (*opensearchserverless.CreateSecurityConfigOutput, error) - CreateSecurityConfigWithContext(aws.Context, *opensearchserverless.CreateSecurityConfigInput, ...request.Option) (*opensearchserverless.CreateSecurityConfigOutput, error) - CreateSecurityConfigRequest(*opensearchserverless.CreateSecurityConfigInput) (*request.Request, *opensearchserverless.CreateSecurityConfigOutput) - - CreateSecurityPolicy(*opensearchserverless.CreateSecurityPolicyInput) (*opensearchserverless.CreateSecurityPolicyOutput, error) - CreateSecurityPolicyWithContext(aws.Context, *opensearchserverless.CreateSecurityPolicyInput, ...request.Option) (*opensearchserverless.CreateSecurityPolicyOutput, error) - CreateSecurityPolicyRequest(*opensearchserverless.CreateSecurityPolicyInput) (*request.Request, *opensearchserverless.CreateSecurityPolicyOutput) - - CreateVpcEndpoint(*opensearchserverless.CreateVpcEndpointInput) (*opensearchserverless.CreateVpcEndpointOutput, error) - CreateVpcEndpointWithContext(aws.Context, *opensearchserverless.CreateVpcEndpointInput, ...request.Option) (*opensearchserverless.CreateVpcEndpointOutput, error) - CreateVpcEndpointRequest(*opensearchserverless.CreateVpcEndpointInput) (*request.Request, *opensearchserverless.CreateVpcEndpointOutput) - - DeleteAccessPolicy(*opensearchserverless.DeleteAccessPolicyInput) (*opensearchserverless.DeleteAccessPolicyOutput, error) - DeleteAccessPolicyWithContext(aws.Context, *opensearchserverless.DeleteAccessPolicyInput, ...request.Option) (*opensearchserverless.DeleteAccessPolicyOutput, error) - DeleteAccessPolicyRequest(*opensearchserverless.DeleteAccessPolicyInput) (*request.Request, *opensearchserverless.DeleteAccessPolicyOutput) - - DeleteCollection(*opensearchserverless.DeleteCollectionInput) (*opensearchserverless.DeleteCollectionOutput, error) - DeleteCollectionWithContext(aws.Context, *opensearchserverless.DeleteCollectionInput, ...request.Option) (*opensearchserverless.DeleteCollectionOutput, error) - DeleteCollectionRequest(*opensearchserverless.DeleteCollectionInput) (*request.Request, *opensearchserverless.DeleteCollectionOutput) - - DeleteLifecyclePolicy(*opensearchserverless.DeleteLifecyclePolicyInput) (*opensearchserverless.DeleteLifecyclePolicyOutput, error) - DeleteLifecyclePolicyWithContext(aws.Context, *opensearchserverless.DeleteLifecyclePolicyInput, ...request.Option) (*opensearchserverless.DeleteLifecyclePolicyOutput, error) - DeleteLifecyclePolicyRequest(*opensearchserverless.DeleteLifecyclePolicyInput) (*request.Request, *opensearchserverless.DeleteLifecyclePolicyOutput) - - DeleteSecurityConfig(*opensearchserverless.DeleteSecurityConfigInput) (*opensearchserverless.DeleteSecurityConfigOutput, error) - DeleteSecurityConfigWithContext(aws.Context, *opensearchserverless.DeleteSecurityConfigInput, ...request.Option) (*opensearchserverless.DeleteSecurityConfigOutput, error) - DeleteSecurityConfigRequest(*opensearchserverless.DeleteSecurityConfigInput) (*request.Request, *opensearchserverless.DeleteSecurityConfigOutput) - - DeleteSecurityPolicy(*opensearchserverless.DeleteSecurityPolicyInput) (*opensearchserverless.DeleteSecurityPolicyOutput, error) - DeleteSecurityPolicyWithContext(aws.Context, *opensearchserverless.DeleteSecurityPolicyInput, ...request.Option) (*opensearchserverless.DeleteSecurityPolicyOutput, error) - DeleteSecurityPolicyRequest(*opensearchserverless.DeleteSecurityPolicyInput) (*request.Request, *opensearchserverless.DeleteSecurityPolicyOutput) - - DeleteVpcEndpoint(*opensearchserverless.DeleteVpcEndpointInput) (*opensearchserverless.DeleteVpcEndpointOutput, error) - DeleteVpcEndpointWithContext(aws.Context, *opensearchserverless.DeleteVpcEndpointInput, ...request.Option) (*opensearchserverless.DeleteVpcEndpointOutput, error) - DeleteVpcEndpointRequest(*opensearchserverless.DeleteVpcEndpointInput) (*request.Request, *opensearchserverless.DeleteVpcEndpointOutput) - - GetAccessPolicy(*opensearchserverless.GetAccessPolicyInput) (*opensearchserverless.GetAccessPolicyOutput, error) - GetAccessPolicyWithContext(aws.Context, *opensearchserverless.GetAccessPolicyInput, ...request.Option) (*opensearchserverless.GetAccessPolicyOutput, error) - GetAccessPolicyRequest(*opensearchserverless.GetAccessPolicyInput) (*request.Request, *opensearchserverless.GetAccessPolicyOutput) - - GetAccountSettings(*opensearchserverless.GetAccountSettingsInput) (*opensearchserverless.GetAccountSettingsOutput, error) - GetAccountSettingsWithContext(aws.Context, *opensearchserverless.GetAccountSettingsInput, ...request.Option) (*opensearchserverless.GetAccountSettingsOutput, error) - GetAccountSettingsRequest(*opensearchserverless.GetAccountSettingsInput) (*request.Request, *opensearchserverless.GetAccountSettingsOutput) - - GetPoliciesStats(*opensearchserverless.GetPoliciesStatsInput) (*opensearchserverless.GetPoliciesStatsOutput, error) - GetPoliciesStatsWithContext(aws.Context, *opensearchserverless.GetPoliciesStatsInput, ...request.Option) (*opensearchserverless.GetPoliciesStatsOutput, error) - GetPoliciesStatsRequest(*opensearchserverless.GetPoliciesStatsInput) (*request.Request, *opensearchserverless.GetPoliciesStatsOutput) - - GetSecurityConfig(*opensearchserverless.GetSecurityConfigInput) (*opensearchserverless.GetSecurityConfigOutput, error) - GetSecurityConfigWithContext(aws.Context, *opensearchserverless.GetSecurityConfigInput, ...request.Option) (*opensearchserverless.GetSecurityConfigOutput, error) - GetSecurityConfigRequest(*opensearchserverless.GetSecurityConfigInput) (*request.Request, *opensearchserverless.GetSecurityConfigOutput) - - GetSecurityPolicy(*opensearchserverless.GetSecurityPolicyInput) (*opensearchserverless.GetSecurityPolicyOutput, error) - GetSecurityPolicyWithContext(aws.Context, *opensearchserverless.GetSecurityPolicyInput, ...request.Option) (*opensearchserverless.GetSecurityPolicyOutput, error) - GetSecurityPolicyRequest(*opensearchserverless.GetSecurityPolicyInput) (*request.Request, *opensearchserverless.GetSecurityPolicyOutput) - - ListAccessPolicies(*opensearchserverless.ListAccessPoliciesInput) (*opensearchserverless.ListAccessPoliciesOutput, error) - ListAccessPoliciesWithContext(aws.Context, *opensearchserverless.ListAccessPoliciesInput, ...request.Option) (*opensearchserverless.ListAccessPoliciesOutput, error) - ListAccessPoliciesRequest(*opensearchserverless.ListAccessPoliciesInput) (*request.Request, *opensearchserverless.ListAccessPoliciesOutput) - - ListAccessPoliciesPages(*opensearchserverless.ListAccessPoliciesInput, func(*opensearchserverless.ListAccessPoliciesOutput, bool) bool) error - ListAccessPoliciesPagesWithContext(aws.Context, *opensearchserverless.ListAccessPoliciesInput, func(*opensearchserverless.ListAccessPoliciesOutput, bool) bool, ...request.Option) error - - ListCollections(*opensearchserverless.ListCollectionsInput) (*opensearchserverless.ListCollectionsOutput, error) - ListCollectionsWithContext(aws.Context, *opensearchserverless.ListCollectionsInput, ...request.Option) (*opensearchserverless.ListCollectionsOutput, error) - ListCollectionsRequest(*opensearchserverless.ListCollectionsInput) (*request.Request, *opensearchserverless.ListCollectionsOutput) - - ListCollectionsPages(*opensearchserverless.ListCollectionsInput, func(*opensearchserverless.ListCollectionsOutput, bool) bool) error - ListCollectionsPagesWithContext(aws.Context, *opensearchserverless.ListCollectionsInput, func(*opensearchserverless.ListCollectionsOutput, bool) bool, ...request.Option) error - - ListLifecyclePolicies(*opensearchserverless.ListLifecyclePoliciesInput) (*opensearchserverless.ListLifecyclePoliciesOutput, error) - ListLifecyclePoliciesWithContext(aws.Context, *opensearchserverless.ListLifecyclePoliciesInput, ...request.Option) (*opensearchserverless.ListLifecyclePoliciesOutput, error) - ListLifecyclePoliciesRequest(*opensearchserverless.ListLifecyclePoliciesInput) (*request.Request, *opensearchserverless.ListLifecyclePoliciesOutput) - - ListLifecyclePoliciesPages(*opensearchserverless.ListLifecyclePoliciesInput, func(*opensearchserverless.ListLifecyclePoliciesOutput, bool) bool) error - ListLifecyclePoliciesPagesWithContext(aws.Context, *opensearchserverless.ListLifecyclePoliciesInput, func(*opensearchserverless.ListLifecyclePoliciesOutput, bool) bool, ...request.Option) error - - ListSecurityConfigs(*opensearchserverless.ListSecurityConfigsInput) (*opensearchserverless.ListSecurityConfigsOutput, error) - ListSecurityConfigsWithContext(aws.Context, *opensearchserverless.ListSecurityConfigsInput, ...request.Option) (*opensearchserverless.ListSecurityConfigsOutput, error) - ListSecurityConfigsRequest(*opensearchserverless.ListSecurityConfigsInput) (*request.Request, *opensearchserverless.ListSecurityConfigsOutput) - - ListSecurityConfigsPages(*opensearchserverless.ListSecurityConfigsInput, func(*opensearchserverless.ListSecurityConfigsOutput, bool) bool) error - ListSecurityConfigsPagesWithContext(aws.Context, *opensearchserverless.ListSecurityConfigsInput, func(*opensearchserverless.ListSecurityConfigsOutput, bool) bool, ...request.Option) error - - ListSecurityPolicies(*opensearchserverless.ListSecurityPoliciesInput) (*opensearchserverless.ListSecurityPoliciesOutput, error) - ListSecurityPoliciesWithContext(aws.Context, *opensearchserverless.ListSecurityPoliciesInput, ...request.Option) (*opensearchserverless.ListSecurityPoliciesOutput, error) - ListSecurityPoliciesRequest(*opensearchserverless.ListSecurityPoliciesInput) (*request.Request, *opensearchserverless.ListSecurityPoliciesOutput) - - ListSecurityPoliciesPages(*opensearchserverless.ListSecurityPoliciesInput, func(*opensearchserverless.ListSecurityPoliciesOutput, bool) bool) error - ListSecurityPoliciesPagesWithContext(aws.Context, *opensearchserverless.ListSecurityPoliciesInput, func(*opensearchserverless.ListSecurityPoliciesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*opensearchserverless.ListTagsForResourceInput) (*opensearchserverless.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *opensearchserverless.ListTagsForResourceInput, ...request.Option) (*opensearchserverless.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*opensearchserverless.ListTagsForResourceInput) (*request.Request, *opensearchserverless.ListTagsForResourceOutput) - - ListVpcEndpoints(*opensearchserverless.ListVpcEndpointsInput) (*opensearchserverless.ListVpcEndpointsOutput, error) - ListVpcEndpointsWithContext(aws.Context, *opensearchserverless.ListVpcEndpointsInput, ...request.Option) (*opensearchserverless.ListVpcEndpointsOutput, error) - ListVpcEndpointsRequest(*opensearchserverless.ListVpcEndpointsInput) (*request.Request, *opensearchserverless.ListVpcEndpointsOutput) - - ListVpcEndpointsPages(*opensearchserverless.ListVpcEndpointsInput, func(*opensearchserverless.ListVpcEndpointsOutput, bool) bool) error - ListVpcEndpointsPagesWithContext(aws.Context, *opensearchserverless.ListVpcEndpointsInput, func(*opensearchserverless.ListVpcEndpointsOutput, bool) bool, ...request.Option) error - - TagResource(*opensearchserverless.TagResourceInput) (*opensearchserverless.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *opensearchserverless.TagResourceInput, ...request.Option) (*opensearchserverless.TagResourceOutput, error) - TagResourceRequest(*opensearchserverless.TagResourceInput) (*request.Request, *opensearchserverless.TagResourceOutput) - - UntagResource(*opensearchserverless.UntagResourceInput) (*opensearchserverless.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *opensearchserverless.UntagResourceInput, ...request.Option) (*opensearchserverless.UntagResourceOutput, error) - UntagResourceRequest(*opensearchserverless.UntagResourceInput) (*request.Request, *opensearchserverless.UntagResourceOutput) - - UpdateAccessPolicy(*opensearchserverless.UpdateAccessPolicyInput) (*opensearchserverless.UpdateAccessPolicyOutput, error) - UpdateAccessPolicyWithContext(aws.Context, *opensearchserverless.UpdateAccessPolicyInput, ...request.Option) (*opensearchserverless.UpdateAccessPolicyOutput, error) - UpdateAccessPolicyRequest(*opensearchserverless.UpdateAccessPolicyInput) (*request.Request, *opensearchserverless.UpdateAccessPolicyOutput) - - UpdateAccountSettings(*opensearchserverless.UpdateAccountSettingsInput) (*opensearchserverless.UpdateAccountSettingsOutput, error) - UpdateAccountSettingsWithContext(aws.Context, *opensearchserverless.UpdateAccountSettingsInput, ...request.Option) (*opensearchserverless.UpdateAccountSettingsOutput, error) - UpdateAccountSettingsRequest(*opensearchserverless.UpdateAccountSettingsInput) (*request.Request, *opensearchserverless.UpdateAccountSettingsOutput) - - UpdateCollection(*opensearchserverless.UpdateCollectionInput) (*opensearchserverless.UpdateCollectionOutput, error) - UpdateCollectionWithContext(aws.Context, *opensearchserverless.UpdateCollectionInput, ...request.Option) (*opensearchserverless.UpdateCollectionOutput, error) - UpdateCollectionRequest(*opensearchserverless.UpdateCollectionInput) (*request.Request, *opensearchserverless.UpdateCollectionOutput) - - UpdateLifecyclePolicy(*opensearchserverless.UpdateLifecyclePolicyInput) (*opensearchserverless.UpdateLifecyclePolicyOutput, error) - UpdateLifecyclePolicyWithContext(aws.Context, *opensearchserverless.UpdateLifecyclePolicyInput, ...request.Option) (*opensearchserverless.UpdateLifecyclePolicyOutput, error) - UpdateLifecyclePolicyRequest(*opensearchserverless.UpdateLifecyclePolicyInput) (*request.Request, *opensearchserverless.UpdateLifecyclePolicyOutput) - - UpdateSecurityConfig(*opensearchserverless.UpdateSecurityConfigInput) (*opensearchserverless.UpdateSecurityConfigOutput, error) - UpdateSecurityConfigWithContext(aws.Context, *opensearchserverless.UpdateSecurityConfigInput, ...request.Option) (*opensearchserverless.UpdateSecurityConfigOutput, error) - UpdateSecurityConfigRequest(*opensearchserverless.UpdateSecurityConfigInput) (*request.Request, *opensearchserverless.UpdateSecurityConfigOutput) - - UpdateSecurityPolicy(*opensearchserverless.UpdateSecurityPolicyInput) (*opensearchserverless.UpdateSecurityPolicyOutput, error) - UpdateSecurityPolicyWithContext(aws.Context, *opensearchserverless.UpdateSecurityPolicyInput, ...request.Option) (*opensearchserverless.UpdateSecurityPolicyOutput, error) - UpdateSecurityPolicyRequest(*opensearchserverless.UpdateSecurityPolicyInput) (*request.Request, *opensearchserverless.UpdateSecurityPolicyOutput) - - UpdateVpcEndpoint(*opensearchserverless.UpdateVpcEndpointInput) (*opensearchserverless.UpdateVpcEndpointOutput, error) - UpdateVpcEndpointWithContext(aws.Context, *opensearchserverless.UpdateVpcEndpointInput, ...request.Option) (*opensearchserverless.UpdateVpcEndpointOutput, error) - UpdateVpcEndpointRequest(*opensearchserverless.UpdateVpcEndpointInput) (*request.Request, *opensearchserverless.UpdateVpcEndpointOutput) -} - -var _ OpenSearchServerlessAPI = (*opensearchserverless.OpenSearchServerless)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/service.go deleted file mode 100644 index a5f0f1aead3c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/opensearchserverless/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package opensearchserverless - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// OpenSearchServerless provides the API operation methods for making requests to -// OpenSearch Service Serverless. See this package's package overview docs -// for details on the service. -// -// OpenSearchServerless methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OpenSearchServerless struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "OpenSearchServerless" // Name of service. - EndpointsID = "aoss" // ID to lookup a service endpoint with. - ServiceID = "OpenSearchServerless" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the OpenSearchServerless client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a OpenSearchServerless client from just a session. -// svc := opensearchserverless.New(mySession) -// -// // Create a OpenSearchServerless client with additional configuration -// svc := opensearchserverless.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *OpenSearchServerless { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "aoss" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *OpenSearchServerless { - svc := &OpenSearchServerless{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-11-01", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.0", - TargetPrefix: "OpenSearchServerless", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a OpenSearchServerless operation and runs any -// custom request initialization. -func (c *OpenSearchServerless) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/api.go deleted file mode 100644 index e81589037fa1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/api.go +++ /dev/null @@ -1,4288 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package osis - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreatePipeline = "CreatePipeline" - -// CreatePipelineRequest generates a "aws/request.Request" representing the -// client's request for the CreatePipeline 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 CreatePipeline for more information on using the CreatePipeline -// 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 CreatePipelineRequest method. -// req, resp := client.CreatePipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/CreatePipeline -func (c *OSIS) CreatePipelineRequest(input *CreatePipelineInput) (req *request.Request, output *CreatePipelineOutput) { - op := &request.Operation{ - Name: opCreatePipeline, - HTTPMethod: "POST", - HTTPPath: "/2022-01-01/osis/createPipeline", - } - - if input == nil { - input = &CreatePipelineInput{} - } - - output = &CreatePipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePipeline API operation for Amazon OpenSearch Ingestion. -// -// Creates an OpenSearch Ingestion pipeline. For more information, see Creating -// Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html). -// -// 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 OpenSearch Ingestion's -// API operation CreatePipeline for usage and error information. -// -// Returned Error Types: -// -// - LimitExceededException -// You attempted to create more than the allowed number of tags. -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - ResourceAlreadyExistsException -// You attempted to create a resource that already exists. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/CreatePipeline -func (c *OSIS) CreatePipeline(input *CreatePipelineInput) (*CreatePipelineOutput, error) { - req, out := c.CreatePipelineRequest(input) - return out, req.Send() -} - -// CreatePipelineWithContext is the same as CreatePipeline with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePipeline 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 *OSIS) CreatePipelineWithContext(ctx aws.Context, input *CreatePipelineInput, opts ...request.Option) (*CreatePipelineOutput, error) { - req, out := c.CreatePipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePipeline = "DeletePipeline" - -// DeletePipelineRequest generates a "aws/request.Request" representing the -// client's request for the DeletePipeline 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 DeletePipeline for more information on using the DeletePipeline -// 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 DeletePipelineRequest method. -// req, resp := client.DeletePipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/DeletePipeline -func (c *OSIS) DeletePipelineRequest(input *DeletePipelineInput) (req *request.Request, output *DeletePipelineOutput) { - op := &request.Operation{ - Name: opDeletePipeline, - HTTPMethod: "DELETE", - HTTPPath: "/2022-01-01/osis/deletePipeline/{PipelineName}", - } - - if input == nil { - input = &DeletePipelineInput{} - } - - output = &DeletePipelineOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePipeline API operation for Amazon OpenSearch Ingestion. -// -// Deletes an OpenSearch Ingestion pipeline. For more information, see Deleting -// Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/delete-pipeline.html). -// -// 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 OpenSearch Ingestion's -// API operation DeletePipeline for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// - ConflictException -// The client attempted to remove a resource that is currently in use. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/DeletePipeline -func (c *OSIS) DeletePipeline(input *DeletePipelineInput) (*DeletePipelineOutput, error) { - req, out := c.DeletePipelineRequest(input) - return out, req.Send() -} - -// DeletePipelineWithContext is the same as DeletePipeline with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePipeline 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 *OSIS) DeletePipelineWithContext(ctx aws.Context, input *DeletePipelineInput, opts ...request.Option) (*DeletePipelineOutput, error) { - req, out := c.DeletePipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPipeline = "GetPipeline" - -// GetPipelineRequest generates a "aws/request.Request" representing the -// client's request for the GetPipeline 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 GetPipeline for more information on using the GetPipeline -// 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 GetPipelineRequest method. -// req, resp := client.GetPipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/GetPipeline -func (c *OSIS) GetPipelineRequest(input *GetPipelineInput) (req *request.Request, output *GetPipelineOutput) { - op := &request.Operation{ - Name: opGetPipeline, - HTTPMethod: "GET", - HTTPPath: "/2022-01-01/osis/getPipeline/{PipelineName}", - } - - if input == nil { - input = &GetPipelineInput{} - } - - output = &GetPipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPipeline API operation for Amazon OpenSearch Ingestion. -// -// Retrieves information about an OpenSearch Ingestion pipeline. -// -// 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 OpenSearch Ingestion's -// API operation GetPipeline for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/GetPipeline -func (c *OSIS) GetPipeline(input *GetPipelineInput) (*GetPipelineOutput, error) { - req, out := c.GetPipelineRequest(input) - return out, req.Send() -} - -// GetPipelineWithContext is the same as GetPipeline with the addition of -// the ability to pass a context and additional request options. -// -// See GetPipeline 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 *OSIS) GetPipelineWithContext(ctx aws.Context, input *GetPipelineInput, opts ...request.Option) (*GetPipelineOutput, error) { - req, out := c.GetPipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPipelineBlueprint = "GetPipelineBlueprint" - -// GetPipelineBlueprintRequest generates a "aws/request.Request" representing the -// client's request for the GetPipelineBlueprint 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 GetPipelineBlueprint for more information on using the GetPipelineBlueprint -// 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 GetPipelineBlueprintRequest method. -// req, resp := client.GetPipelineBlueprintRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/GetPipelineBlueprint -func (c *OSIS) GetPipelineBlueprintRequest(input *GetPipelineBlueprintInput) (req *request.Request, output *GetPipelineBlueprintOutput) { - op := &request.Operation{ - Name: opGetPipelineBlueprint, - HTTPMethod: "GET", - HTTPPath: "/2022-01-01/osis/getPipelineBlueprint/{BlueprintName}", - } - - if input == nil { - input = &GetPipelineBlueprintInput{} - } - - output = &GetPipelineBlueprintOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPipelineBlueprint API operation for Amazon OpenSearch Ingestion. -// -// Retrieves information about a specific blueprint for OpenSearch Ingestion. -// Blueprints are templates for the configuration needed for a CreatePipeline -// request. For more information, see Using blueprints to create a pipeline -// (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html#pipeline-blueprint). -// -// 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 OpenSearch Ingestion's -// API operation GetPipelineBlueprint for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/GetPipelineBlueprint -func (c *OSIS) GetPipelineBlueprint(input *GetPipelineBlueprintInput) (*GetPipelineBlueprintOutput, error) { - req, out := c.GetPipelineBlueprintRequest(input) - return out, req.Send() -} - -// GetPipelineBlueprintWithContext is the same as GetPipelineBlueprint with the addition of -// the ability to pass a context and additional request options. -// -// See GetPipelineBlueprint 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 *OSIS) GetPipelineBlueprintWithContext(ctx aws.Context, input *GetPipelineBlueprintInput, opts ...request.Option) (*GetPipelineBlueprintOutput, error) { - req, out := c.GetPipelineBlueprintRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPipelineChangeProgress = "GetPipelineChangeProgress" - -// GetPipelineChangeProgressRequest generates a "aws/request.Request" representing the -// client's request for the GetPipelineChangeProgress 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 GetPipelineChangeProgress for more information on using the GetPipelineChangeProgress -// 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 GetPipelineChangeProgressRequest method. -// req, resp := client.GetPipelineChangeProgressRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/GetPipelineChangeProgress -func (c *OSIS) GetPipelineChangeProgressRequest(input *GetPipelineChangeProgressInput) (req *request.Request, output *GetPipelineChangeProgressOutput) { - op := &request.Operation{ - Name: opGetPipelineChangeProgress, - HTTPMethod: "GET", - HTTPPath: "/2022-01-01/osis/getPipelineChangeProgress/{PipelineName}", - } - - if input == nil { - input = &GetPipelineChangeProgressInput{} - } - - output = &GetPipelineChangeProgressOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPipelineChangeProgress API operation for Amazon OpenSearch Ingestion. -// -// Returns progress information for the current change happening on an OpenSearch -// Ingestion pipeline. Currently, this operation only returns information when -// a pipeline is being created. -// -// For more information, see Tracking the status of pipeline creation (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html#get-pipeline-progress). -// -// 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 OpenSearch Ingestion's -// API operation GetPipelineChangeProgress for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/GetPipelineChangeProgress -func (c *OSIS) GetPipelineChangeProgress(input *GetPipelineChangeProgressInput) (*GetPipelineChangeProgressOutput, error) { - req, out := c.GetPipelineChangeProgressRequest(input) - return out, req.Send() -} - -// GetPipelineChangeProgressWithContext is the same as GetPipelineChangeProgress with the addition of -// the ability to pass a context and additional request options. -// -// See GetPipelineChangeProgress 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 *OSIS) GetPipelineChangeProgressWithContext(ctx aws.Context, input *GetPipelineChangeProgressInput, opts ...request.Option) (*GetPipelineChangeProgressOutput, error) { - req, out := c.GetPipelineChangeProgressRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListPipelineBlueprints = "ListPipelineBlueprints" - -// ListPipelineBlueprintsRequest generates a "aws/request.Request" representing the -// client's request for the ListPipelineBlueprints 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 ListPipelineBlueprints for more information on using the ListPipelineBlueprints -// 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 ListPipelineBlueprintsRequest method. -// req, resp := client.ListPipelineBlueprintsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/ListPipelineBlueprints -func (c *OSIS) ListPipelineBlueprintsRequest(input *ListPipelineBlueprintsInput) (req *request.Request, output *ListPipelineBlueprintsOutput) { - op := &request.Operation{ - Name: opListPipelineBlueprints, - HTTPMethod: "POST", - HTTPPath: "/2022-01-01/osis/listPipelineBlueprints", - } - - if input == nil { - input = &ListPipelineBlueprintsInput{} - } - - output = &ListPipelineBlueprintsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPipelineBlueprints API operation for Amazon OpenSearch Ingestion. -// -// Retrieves a list of all available blueprints for Data Prepper. For more information, -// see Using blueprints to create a pipeline (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html#pipeline-blueprint). -// -// 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 OpenSearch Ingestion's -// API operation ListPipelineBlueprints for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - InvalidPaginationTokenException -// An invalid pagination token provided in the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/ListPipelineBlueprints -func (c *OSIS) ListPipelineBlueprints(input *ListPipelineBlueprintsInput) (*ListPipelineBlueprintsOutput, error) { - req, out := c.ListPipelineBlueprintsRequest(input) - return out, req.Send() -} - -// ListPipelineBlueprintsWithContext is the same as ListPipelineBlueprints with the addition of -// the ability to pass a context and additional request options. -// -// See ListPipelineBlueprints 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 *OSIS) ListPipelineBlueprintsWithContext(ctx aws.Context, input *ListPipelineBlueprintsInput, opts ...request.Option) (*ListPipelineBlueprintsOutput, error) { - req, out := c.ListPipelineBlueprintsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListPipelines = "ListPipelines" - -// ListPipelinesRequest generates a "aws/request.Request" representing the -// client's request for the ListPipelines 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 ListPipelines for more information on using the ListPipelines -// 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 ListPipelinesRequest method. -// req, resp := client.ListPipelinesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/ListPipelines -func (c *OSIS) ListPipelinesRequest(input *ListPipelinesInput) (req *request.Request, output *ListPipelinesOutput) { - op := &request.Operation{ - Name: opListPipelines, - HTTPMethod: "GET", - HTTPPath: "/2022-01-01/osis/listPipelines", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPipelinesInput{} - } - - output = &ListPipelinesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPipelines API operation for Amazon OpenSearch Ingestion. -// -// Lists all OpenSearch Ingestion pipelines in the current Amazon Web Services -// account and Region. For more information, see Viewing Amazon OpenSearch Ingestion -// pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/list-pipeline.html). -// -// 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 OpenSearch Ingestion's -// API operation ListPipelines for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - InvalidPaginationTokenException -// An invalid pagination token provided in the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/ListPipelines -func (c *OSIS) ListPipelines(input *ListPipelinesInput) (*ListPipelinesOutput, error) { - req, out := c.ListPipelinesRequest(input) - return out, req.Send() -} - -// ListPipelinesWithContext is the same as ListPipelines with the addition of -// the ability to pass a context and additional request options. -// -// See ListPipelines 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 *OSIS) ListPipelinesWithContext(ctx aws.Context, input *ListPipelinesInput, opts ...request.Option) (*ListPipelinesOutput, error) { - req, out := c.ListPipelinesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPipelinesPages iterates over the pages of a ListPipelines operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPipelines method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPipelines operation. -// pageNum := 0 -// err := client.ListPipelinesPages(params, -// func(page *osis.ListPipelinesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *OSIS) ListPipelinesPages(input *ListPipelinesInput, fn func(*ListPipelinesOutput, bool) bool) error { - return c.ListPipelinesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPipelinesPagesWithContext same as ListPipelinesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *OSIS) ListPipelinesPagesWithContext(ctx aws.Context, input *ListPipelinesInput, fn func(*ListPipelinesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPipelinesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPipelinesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/ListTagsForResource -func (c *OSIS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/2022-01-01/osis/listTagsForResource/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon OpenSearch Ingestion. -// -// Lists all resource tags associated with an OpenSearch Ingestion pipeline. -// For more information, see Tagging Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-pipeline.html). -// -// 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 OpenSearch Ingestion's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/ListTagsForResource -func (c *OSIS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *OSIS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartPipeline = "StartPipeline" - -// StartPipelineRequest generates a "aws/request.Request" representing the -// client's request for the StartPipeline 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 StartPipeline for more information on using the StartPipeline -// 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 StartPipelineRequest method. -// req, resp := client.StartPipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/StartPipeline -func (c *OSIS) StartPipelineRequest(input *StartPipelineInput) (req *request.Request, output *StartPipelineOutput) { - op := &request.Operation{ - Name: opStartPipeline, - HTTPMethod: "PUT", - HTTPPath: "/2022-01-01/osis/startPipeline/{PipelineName}", - } - - if input == nil { - input = &StartPipelineInput{} - } - - output = &StartPipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartPipeline API operation for Amazon OpenSearch Ingestion. -// -// Starts an OpenSearch Ingestion pipeline. For more information, see Starting -// an OpenSearch Ingestion pipeline (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/pipeline--stop-start.html#pipeline--start). -// -// 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 OpenSearch Ingestion's -// API operation StartPipeline for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - ConflictException -// The client attempted to remove a resource that is currently in use. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/StartPipeline -func (c *OSIS) StartPipeline(input *StartPipelineInput) (*StartPipelineOutput, error) { - req, out := c.StartPipelineRequest(input) - return out, req.Send() -} - -// StartPipelineWithContext is the same as StartPipeline with the addition of -// the ability to pass a context and additional request options. -// -// See StartPipeline 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 *OSIS) StartPipelineWithContext(ctx aws.Context, input *StartPipelineInput, opts ...request.Option) (*StartPipelineOutput, error) { - req, out := c.StartPipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopPipeline = "StopPipeline" - -// StopPipelineRequest generates a "aws/request.Request" representing the -// client's request for the StopPipeline 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 StopPipeline for more information on using the StopPipeline -// 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 StopPipelineRequest method. -// req, resp := client.StopPipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/StopPipeline -func (c *OSIS) StopPipelineRequest(input *StopPipelineInput) (req *request.Request, output *StopPipelineOutput) { - op := &request.Operation{ - Name: opStopPipeline, - HTTPMethod: "PUT", - HTTPPath: "/2022-01-01/osis/stopPipeline/{PipelineName}", - } - - if input == nil { - input = &StopPipelineInput{} - } - - output = &StopPipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopPipeline API operation for Amazon OpenSearch Ingestion. -// -// Stops an OpenSearch Ingestion pipeline. For more information, see Stopping -// an OpenSearch Ingestion pipeline (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/pipeline--stop-start.html#pipeline--stop). -// -// 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 OpenSearch Ingestion's -// API operation StopPipeline for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - ConflictException -// The client attempted to remove a resource that is currently in use. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/StopPipeline -func (c *OSIS) StopPipeline(input *StopPipelineInput) (*StopPipelineOutput, error) { - req, out := c.StopPipelineRequest(input) - return out, req.Send() -} - -// StopPipelineWithContext is the same as StopPipeline with the addition of -// the ability to pass a context and additional request options. -// -// See StopPipeline 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 *OSIS) StopPipelineWithContext(ctx aws.Context, input *StopPipelineInput, opts ...request.Option) (*StopPipelineOutput, error) { - req, out := c.StopPipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/TagResource -func (c *OSIS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/2022-01-01/osis/tagResource/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon OpenSearch Ingestion. -// -// Tags an OpenSearch Ingestion pipeline. For more information, see Tagging -// Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-pipeline.html). -// -// 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 OpenSearch Ingestion's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - LimitExceededException -// You attempted to create more than the allowed number of tags. -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/TagResource -func (c *OSIS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *OSIS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/UntagResource -func (c *OSIS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/2022-01-01/osis/untagResource/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon OpenSearch Ingestion. -// -// Removes one or more tags from an OpenSearch Ingestion pipeline. For more -// information, see Tagging Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/tag-pipeline.html). -// -// 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 OpenSearch Ingestion's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/UntagResource -func (c *OSIS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *OSIS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePipeline = "UpdatePipeline" - -// UpdatePipelineRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePipeline 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 UpdatePipeline for more information on using the UpdatePipeline -// 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 UpdatePipelineRequest method. -// req, resp := client.UpdatePipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/UpdatePipeline -func (c *OSIS) UpdatePipelineRequest(input *UpdatePipelineInput) (req *request.Request, output *UpdatePipelineOutput) { - op := &request.Operation{ - Name: opUpdatePipeline, - HTTPMethod: "PUT", - HTTPPath: "/2022-01-01/osis/updatePipeline/{PipelineName}", - } - - if input == nil { - input = &UpdatePipelineInput{} - } - - output = &UpdatePipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePipeline API operation for Amazon OpenSearch Ingestion. -// -// Updates an OpenSearch Ingestion pipeline. For more information, see Updating -// Amazon OpenSearch Ingestion pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/update-pipeline.html). -// -// 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 OpenSearch Ingestion's -// API operation UpdatePipeline for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - ResourceNotFoundException -// You attempted to access or delete a resource that does not exist. -// -// - ConflictException -// The client attempted to remove a resource that is currently in use. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/UpdatePipeline -func (c *OSIS) UpdatePipeline(input *UpdatePipelineInput) (*UpdatePipelineOutput, error) { - req, out := c.UpdatePipelineRequest(input) - return out, req.Send() -} - -// UpdatePipelineWithContext is the same as UpdatePipeline with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePipeline 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 *OSIS) UpdatePipelineWithContext(ctx aws.Context, input *UpdatePipelineInput, opts ...request.Option) (*UpdatePipelineOutput, error) { - req, out := c.UpdatePipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opValidatePipeline = "ValidatePipeline" - -// ValidatePipelineRequest generates a "aws/request.Request" representing the -// client's request for the ValidatePipeline 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 ValidatePipeline for more information on using the ValidatePipeline -// 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 ValidatePipelineRequest method. -// req, resp := client.ValidatePipelineRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/ValidatePipeline -func (c *OSIS) ValidatePipelineRequest(input *ValidatePipelineInput) (req *request.Request, output *ValidatePipelineOutput) { - op := &request.Operation{ - Name: opValidatePipeline, - HTTPMethod: "POST", - HTTPPath: "/2022-01-01/osis/validatePipeline", - } - - if input == nil { - input = &ValidatePipelineInput{} - } - - output = &ValidatePipelineOutput{} - req = c.newRequest(op, input, output) - return -} - -// ValidatePipeline API operation for Amazon OpenSearch Ingestion. -// -// Checks whether an OpenSearch Ingestion pipeline configuration is valid prior -// to creation. For more information, see Creating Amazon OpenSearch Ingestion -// pipelines (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/creating-pipeline.html). -// -// 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 OpenSearch Ingestion's -// API operation ValidatePipeline for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to access the resource. -// -// - InternalException -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -// -// - ValidationException -// An exception for missing or invalid input fields. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01/ValidatePipeline -func (c *OSIS) ValidatePipeline(input *ValidatePipelineInput) (*ValidatePipelineOutput, error) { - req, out := c.ValidatePipelineRequest(input) - return out, req.Send() -} - -// ValidatePipelineWithContext is the same as ValidatePipeline with the addition of -// the ability to pass a context and additional request options. -// -// See ValidatePipeline 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 *OSIS) ValidatePipelineWithContext(ctx aws.Context, input *ValidatePipelineInput, opts ...request.Option) (*ValidatePipelineOutput, error) { - req, out := c.ValidatePipelineRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have permissions to access the resource. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Options that specify the configuration of a persistent buffer. To configure -// how OpenSearch Ingestion encrypts this data, set the EncryptionAtRestOptions. -type BufferOptions struct { - _ struct{} `type:"structure"` - - // Whether persistent buffering should be enabled. - // - // PersistentBufferEnabled is a required field - PersistentBufferEnabled *bool `type:"boolean" 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 BufferOptions) 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 BufferOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BufferOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BufferOptions"} - if s.PersistentBufferEnabled == nil { - invalidParams.Add(request.NewErrParamRequired("PersistentBufferEnabled")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPersistentBufferEnabled sets the PersistentBufferEnabled field's value. -func (s *BufferOptions) SetPersistentBufferEnabled(v bool) *BufferOptions { - s.PersistentBufferEnabled = &v - return s -} - -// Progress details for a specific stage of a pipeline configuration change. -type ChangeProgressStage struct { - _ struct{} `type:"structure"` - - // A description of the stage. - Description *string `type:"string"` - - // The most recent updated timestamp of the stage. - LastUpdatedAt *time.Time `type:"timestamp"` - - // The name of the stage. - Name *string `type:"string"` - - // The current status of the stage that the change is in. - Status *string `type:"string" enum:"ChangeProgressStageStatuses"` -} - -// 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 ChangeProgressStage) 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 ChangeProgressStage) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ChangeProgressStage) SetDescription(v string) *ChangeProgressStage { - s.Description = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *ChangeProgressStage) SetLastUpdatedAt(v time.Time) *ChangeProgressStage { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *ChangeProgressStage) SetName(v string) *ChangeProgressStage { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ChangeProgressStage) SetStatus(v string) *ChangeProgressStage { - s.Status = &v - return s -} - -// The progress details of a pipeline configuration change. -type ChangeProgressStatus struct { - _ struct{} `type:"structure"` - - // Information about the stages that the pipeline is going through to perform - // the configuration change. - ChangeProgressStages []*ChangeProgressStage `type:"list"` - - // The time at which the configuration change is made on the pipeline. - StartTime *time.Time `type:"timestamp"` - - // The overall status of the pipeline configuration change. - Status *string `type:"string" enum:"ChangeProgressStatuses"` - - // The total number of stages required for the pipeline configuration change. - TotalNumberOfStages *int64 `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 ChangeProgressStatus) 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 ChangeProgressStatus) GoString() string { - return s.String() -} - -// SetChangeProgressStages sets the ChangeProgressStages field's value. -func (s *ChangeProgressStatus) SetChangeProgressStages(v []*ChangeProgressStage) *ChangeProgressStatus { - s.ChangeProgressStages = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ChangeProgressStatus) SetStartTime(v time.Time) *ChangeProgressStatus { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ChangeProgressStatus) SetStatus(v string) *ChangeProgressStatus { - s.Status = &v - return s -} - -// SetTotalNumberOfStages sets the TotalNumberOfStages field's value. -func (s *ChangeProgressStatus) SetTotalNumberOfStages(v int64) *ChangeProgressStatus { - s.TotalNumberOfStages = &v - return s -} - -// The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch. -type CloudWatchLogDestination struct { - _ struct{} `type:"structure"` - - // The name of the CloudWatch Logs group to send pipeline logs to. You can specify - // an existing log group or create a new one. For example, /aws/OpenSearchService/IngestionService/my-pipeline. - // - // LogGroup is a required field - LogGroup *string `min:"1" 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 CloudWatchLogDestination) 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 CloudWatchLogDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloudWatchLogDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudWatchLogDestination"} - if s.LogGroup == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroup")) - } - if s.LogGroup != nil && len(*s.LogGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroup", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroup sets the LogGroup field's value. -func (s *CloudWatchLogDestination) SetLogGroup(v string) *CloudWatchLogDestination { - s.LogGroup = &v - return s -} - -// The client attempted to remove a resource that is currently in use. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreatePipelineInput struct { - _ struct{} `type:"structure"` - - // Key-value pairs to configure persistent buffering for the pipeline. - BufferOptions *BufferOptions `type:"structure"` - - // Key-value pairs to configure encryption for data that is written to a persistent - // buffer. - EncryptionAtRestOptions *EncryptionAtRestOptions `type:"structure"` - - // Key-value pairs to configure log publishing. - LogPublishingOptions *LogPublishingOptions `type:"structure"` - - // The maximum pipeline capacity, in Ingestion Compute Units (ICUs). - // - // MaxUnits is a required field - MaxUnits *int64 `min:"1" type:"integer" required:"true"` - - // The minimum pipeline capacity, in Ingestion Compute Units (ICUs). - // - // MinUnits is a required field - MinUnits *int64 `min:"1" type:"integer" required:"true"` - - // The pipeline configuration in YAML format. The command accepts the pipeline - // configuration as a string or within a .yaml file. If you provide the configuration - // as a string, each new line must be escaped with \n. - // - // PipelineConfigurationBody is a required field - PipelineConfigurationBody *string `min:"1" type:"string" required:"true"` - - // The name of the OpenSearch Ingestion pipeline to create. Pipeline names are - // unique across the pipelines owned by an account within an Amazon Web Services - // Region. - // - // PipelineName is a required field - PipelineName *string `min:"3" type:"string" required:"true"` - - // List of tags to add to the pipeline upon creation. - Tags []*Tag `type:"list"` - - // Container for the values required to configure VPC access for the pipeline. - // If you don't specify these values, OpenSearch Ingestion creates the pipeline - // with a public endpoint. - VpcOptions *VpcOptions `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 CreatePipelineInput) 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 CreatePipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePipelineInput"} - if s.MaxUnits == nil { - invalidParams.Add(request.NewErrParamRequired("MaxUnits")) - } - if s.MaxUnits != nil && *s.MaxUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxUnits", 1)) - } - if s.MinUnits == nil { - invalidParams.Add(request.NewErrParamRequired("MinUnits")) - } - if s.MinUnits != nil && *s.MinUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("MinUnits", 1)) - } - if s.PipelineConfigurationBody == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineConfigurationBody")) - } - if s.PipelineConfigurationBody != nil && len(*s.PipelineConfigurationBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineConfigurationBody", 1)) - } - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 3)) - } - if s.BufferOptions != nil { - if err := s.BufferOptions.Validate(); err != nil { - invalidParams.AddNested("BufferOptions", err.(request.ErrInvalidParams)) - } - } - if s.EncryptionAtRestOptions != nil { - if err := s.EncryptionAtRestOptions.Validate(); err != nil { - invalidParams.AddNested("EncryptionAtRestOptions", err.(request.ErrInvalidParams)) - } - } - if s.LogPublishingOptions != nil { - if err := s.LogPublishingOptions.Validate(); err != nil { - invalidParams.AddNested("LogPublishingOptions", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - if s.VpcOptions != nil { - if err := s.VpcOptions.Validate(); err != nil { - invalidParams.AddNested("VpcOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBufferOptions sets the BufferOptions field's value. -func (s *CreatePipelineInput) SetBufferOptions(v *BufferOptions) *CreatePipelineInput { - s.BufferOptions = v - return s -} - -// SetEncryptionAtRestOptions sets the EncryptionAtRestOptions field's value. -func (s *CreatePipelineInput) SetEncryptionAtRestOptions(v *EncryptionAtRestOptions) *CreatePipelineInput { - s.EncryptionAtRestOptions = v - return s -} - -// SetLogPublishingOptions sets the LogPublishingOptions field's value. -func (s *CreatePipelineInput) SetLogPublishingOptions(v *LogPublishingOptions) *CreatePipelineInput { - s.LogPublishingOptions = v - return s -} - -// SetMaxUnits sets the MaxUnits field's value. -func (s *CreatePipelineInput) SetMaxUnits(v int64) *CreatePipelineInput { - s.MaxUnits = &v - return s -} - -// SetMinUnits sets the MinUnits field's value. -func (s *CreatePipelineInput) SetMinUnits(v int64) *CreatePipelineInput { - s.MinUnits = &v - return s -} - -// SetPipelineConfigurationBody sets the PipelineConfigurationBody field's value. -func (s *CreatePipelineInput) SetPipelineConfigurationBody(v string) *CreatePipelineInput { - s.PipelineConfigurationBody = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *CreatePipelineInput) SetPipelineName(v string) *CreatePipelineInput { - s.PipelineName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreatePipelineInput) SetTags(v []*Tag) *CreatePipelineInput { - s.Tags = v - return s -} - -// SetVpcOptions sets the VpcOptions field's value. -func (s *CreatePipelineInput) SetVpcOptions(v *VpcOptions) *CreatePipelineInput { - s.VpcOptions = v - return s -} - -type CreatePipelineOutput struct { - _ struct{} `type:"structure"` - - // Container for information about the created pipeline. - Pipeline *Pipeline `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 CreatePipelineOutput) 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 CreatePipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *CreatePipelineOutput) SetPipeline(v *Pipeline) *CreatePipelineOutput { - s.Pipeline = v - return s -} - -type DeletePipelineInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipeline to delete. - // - // PipelineName is a required field - PipelineName *string `location:"uri" locationName:"PipelineName" min:"3" 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 DeletePipelineInput) 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 DeletePipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePipelineInput"} - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineName sets the PipelineName field's value. -func (s *DeletePipelineInput) SetPipelineName(v string) *DeletePipelineInput { - s.PipelineName = &v - return s -} - -type DeletePipelineOutput 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 DeletePipelineOutput) 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 DeletePipelineOutput) GoString() string { - return s.String() -} - -// Options to control how OpenSearch encrypts all data-at-rest. -type EncryptionAtRestOptions struct { - _ struct{} `type:"structure"` - - // The ARN of the KMS key used to encrypt data-at-rest in OpenSearch Ingestion. - // By default, data is encrypted using an AWS owned key. - // - // KmsKeyArn is a required field - KmsKeyArn *string `min:"7" 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 EncryptionAtRestOptions) 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 EncryptionAtRestOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptionAtRestOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptionAtRestOptions"} - if s.KmsKeyArn == nil { - invalidParams.Add(request.NewErrParamRequired("KmsKeyArn")) - } - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *EncryptionAtRestOptions) SetKmsKeyArn(v string) *EncryptionAtRestOptions { - s.KmsKeyArn = &v - return s -} - -type GetPipelineBlueprintInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the blueprint to retrieve. - // - // BlueprintName is a required field - BlueprintName *string `location:"uri" locationName:"BlueprintName" 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 GetPipelineBlueprintInput) 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 GetPipelineBlueprintInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPipelineBlueprintInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPipelineBlueprintInput"} - if s.BlueprintName == nil { - invalidParams.Add(request.NewErrParamRequired("BlueprintName")) - } - if s.BlueprintName != nil && len(*s.BlueprintName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BlueprintName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlueprintName sets the BlueprintName field's value. -func (s *GetPipelineBlueprintInput) SetBlueprintName(v string) *GetPipelineBlueprintInput { - s.BlueprintName = &v - return s -} - -type GetPipelineBlueprintOutput struct { - _ struct{} `type:"structure"` - - // The requested blueprint in YAML format. - Blueprint *PipelineBlueprint `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 GetPipelineBlueprintOutput) 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 GetPipelineBlueprintOutput) GoString() string { - return s.String() -} - -// SetBlueprint sets the Blueprint field's value. -func (s *GetPipelineBlueprintOutput) SetBlueprint(v *PipelineBlueprint) *GetPipelineBlueprintOutput { - s.Blueprint = v - return s -} - -type GetPipelineChangeProgressInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipeline. - // - // PipelineName is a required field - PipelineName *string `location:"uri" locationName:"PipelineName" min:"3" 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 GetPipelineChangeProgressInput) 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 GetPipelineChangeProgressInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPipelineChangeProgressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPipelineChangeProgressInput"} - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineName sets the PipelineName field's value. -func (s *GetPipelineChangeProgressInput) SetPipelineName(v string) *GetPipelineChangeProgressInput { - s.PipelineName = &v - return s -} - -type GetPipelineChangeProgressOutput struct { - _ struct{} `type:"structure"` - - // The current status of the change happening on the pipeline. - ChangeProgressStatuses []*ChangeProgressStatus `type:"list"` -} - -// 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 GetPipelineChangeProgressOutput) 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 GetPipelineChangeProgressOutput) GoString() string { - return s.String() -} - -// SetChangeProgressStatuses sets the ChangeProgressStatuses field's value. -func (s *GetPipelineChangeProgressOutput) SetChangeProgressStatuses(v []*ChangeProgressStatus) *GetPipelineChangeProgressOutput { - s.ChangeProgressStatuses = v - return s -} - -type GetPipelineInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipeline to get information about. - // - // PipelineName is a required field - PipelineName *string `location:"uri" locationName:"PipelineName" min:"3" 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 GetPipelineInput) 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 GetPipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPipelineInput"} - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineName sets the PipelineName field's value. -func (s *GetPipelineInput) SetPipelineName(v string) *GetPipelineInput { - s.PipelineName = &v - return s -} - -type GetPipelineOutput struct { - _ struct{} `type:"structure"` - - // Detailed information about the requested pipeline. - Pipeline *Pipeline `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 GetPipelineOutput) 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 GetPipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *GetPipelineOutput) SetPipeline(v *Pipeline) *GetPipelineOutput { - s.Pipeline = v - return s -} - -// The request failed because of an unknown error, exception, or failure (the -// failure is internal to the service). -type InternalException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalException) 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 InternalException) GoString() string { - return s.String() -} - -func newErrorInternalException(v protocol.ResponseMetadata) error { - return &InternalException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalException) Code() string { - return "InternalException" -} - -// Message returns the exception's message. -func (s *InternalException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalException) OrigErr() error { - return nil -} - -func (s *InternalException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An invalid pagination token provided in the request. -type InvalidPaginationTokenException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InvalidPaginationTokenException) 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 InvalidPaginationTokenException) GoString() string { - return s.String() -} - -func newErrorInvalidPaginationTokenException(v protocol.ResponseMetadata) error { - return &InvalidPaginationTokenException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidPaginationTokenException) Code() string { - return "InvalidPaginationTokenException" -} - -// Message returns the exception's message. -func (s *InvalidPaginationTokenException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidPaginationTokenException) OrigErr() error { - return nil -} - -func (s *InvalidPaginationTokenException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidPaginationTokenException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidPaginationTokenException) RequestID() string { - return s.RespMetadata.RequestID -} - -// You attempted to create more than the allowed number of tags. -type LimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 LimitExceededException) 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 LimitExceededException) GoString() string { - return s.String() -} - -func newErrorLimitExceededException(v protocol.ResponseMetadata) error { - return &LimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *LimitExceededException) Code() string { - return "LimitExceededException" -} - -// Message returns the exception's message. -func (s *LimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *LimitExceededException) OrigErr() error { - return nil -} - -func (s *LimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *LimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *LimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListPipelineBlueprintsInput struct { - _ struct{} `type:"structure" nopayload:"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 ListPipelineBlueprintsInput) 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 ListPipelineBlueprintsInput) GoString() string { - return s.String() -} - -type ListPipelineBlueprintsOutput struct { - _ struct{} `type:"structure"` - - // A list of available blueprints for Data Prepper. - Blueprints []*PipelineBlueprintSummary `type:"list"` -} - -// 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 ListPipelineBlueprintsOutput) 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 ListPipelineBlueprintsOutput) GoString() string { - return s.String() -} - -// SetBlueprints sets the Blueprints field's value. -func (s *ListPipelineBlueprintsOutput) SetBlueprints(v []*PipelineBlueprintSummary) *ListPipelineBlueprintsOutput { - s.Blueprints = v - return s -} - -type ListPipelinesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to get the next page of results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListPipelines operation returns a nextToken, you can include - // the returned nextToken in subsequent ListPipelines operations, which returns - // results in the next page. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListPipelinesInput) 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 ListPipelinesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPipelinesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPipelinesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPipelinesInput) SetMaxResults(v int64) *ListPipelinesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPipelinesInput) SetNextToken(v string) *ListPipelinesInput { - s.NextToken = &v - return s -} - -type ListPipelinesOutput struct { - _ struct{} `type:"structure"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `type:"string"` - - // A list of all existing Data Prepper pipelines. - Pipelines []*PipelineSummary `type:"list"` -} - -// 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 ListPipelinesOutput) 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 ListPipelinesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPipelinesOutput) SetNextToken(v string) *ListPipelinesOutput { - s.NextToken = &v - return s -} - -// SetPipelines sets the Pipelines field's value. -func (s *ListPipelinesOutput) SetPipelines(v []*PipelineSummary) *ListPipelinesOutput { - s.Pipelines = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the pipeline to retrieve tags for. - // - // Arn is a required field - Arn *string `location:"querystring" locationName:"arn" min:"46" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 46 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 46)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *ListTagsForResourceInput) SetArn(v string) *ListTagsForResourceInput { - s.Arn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of tags associated with the given pipeline. - Tags []*Tag `type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Container for the values required to configure logging for the pipeline. -// If you don't specify these values, OpenSearch Ingestion will not publish -// logs from your application to CloudWatch Logs. -type LogPublishingOptions struct { - _ struct{} `type:"structure"` - - // The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. - // This parameter is required if IsLoggingEnabled is set to true. - CloudWatchLogDestination *CloudWatchLogDestination `type:"structure"` - - // Whether logs should be published. - IsLoggingEnabled *bool `type:"boolean"` -} - -// 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 LogPublishingOptions) 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 LogPublishingOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LogPublishingOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LogPublishingOptions"} - if s.CloudWatchLogDestination != nil { - if err := s.CloudWatchLogDestination.Validate(); err != nil { - invalidParams.AddNested("CloudWatchLogDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchLogDestination sets the CloudWatchLogDestination field's value. -func (s *LogPublishingOptions) SetCloudWatchLogDestination(v *CloudWatchLogDestination) *LogPublishingOptions { - s.CloudWatchLogDestination = v - return s -} - -// SetIsLoggingEnabled sets the IsLoggingEnabled field's value. -func (s *LogPublishingOptions) SetIsLoggingEnabled(v bool) *LogPublishingOptions { - s.IsLoggingEnabled = &v - return s -} - -// Information about an existing OpenSearch Ingestion pipeline. -type Pipeline struct { - _ struct{} `type:"structure"` - - // Options that specify the configuration of a persistent buffer. To configure - // how OpenSearch Ingestion encrypts this data, set the EncryptionAtRestOptions. - BufferOptions *BufferOptions `type:"structure"` - - // The date and time when the pipeline was created. - CreatedAt *time.Time `type:"timestamp"` - - // Options to control how OpenSearch encrypts all data-at-rest. - EncryptionAtRestOptions *EncryptionAtRestOptions `type:"structure"` - - // The ingestion endpoints for the pipeline, which you can send data to. - IngestEndpointUrls []*string `type:"list"` - - // The date and time when the pipeline was last updated. - LastUpdatedAt *time.Time `type:"timestamp"` - - // Key-value pairs that represent log publishing settings. - LogPublishingOptions *LogPublishingOptions `type:"structure"` - - // The maximum pipeline capacity, in Ingestion Compute Units (ICUs). - MaxUnits *int64 `type:"integer"` - - // The minimum pipeline capacity, in Ingestion Compute Units (ICUs). - MinUnits *int64 `type:"integer"` - - // The Amazon Resource Name (ARN) of the pipeline. - PipelineArn *string `type:"string"` - - // The Data Prepper pipeline configuration in YAML format. - PipelineConfigurationBody *string `type:"string"` - - // The name of the pipeline. - PipelineName *string `type:"string"` - - // A list of VPC endpoints that OpenSearch Ingestion has created to other AWS - // services. - ServiceVpcEndpoints []*ServiceVpcEndpoint `type:"list"` - - // The current status of the pipeline. - Status *string `type:"string" enum:"PipelineStatus"` - - // The reason for the current status of the pipeline. - StatusReason *PipelineStatusReason `type:"structure"` - - // A list of tags associated with the given pipeline. - Tags []*Tag `type:"list"` - - // The VPC interface endpoints that have access to the pipeline. - VpcEndpoints []*VpcEndpoint `type:"list"` -} - -// 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 Pipeline) 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 Pipeline) GoString() string { - return s.String() -} - -// SetBufferOptions sets the BufferOptions field's value. -func (s *Pipeline) SetBufferOptions(v *BufferOptions) *Pipeline { - s.BufferOptions = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Pipeline) SetCreatedAt(v time.Time) *Pipeline { - s.CreatedAt = &v - return s -} - -// SetEncryptionAtRestOptions sets the EncryptionAtRestOptions field's value. -func (s *Pipeline) SetEncryptionAtRestOptions(v *EncryptionAtRestOptions) *Pipeline { - s.EncryptionAtRestOptions = v - return s -} - -// SetIngestEndpointUrls sets the IngestEndpointUrls field's value. -func (s *Pipeline) SetIngestEndpointUrls(v []*string) *Pipeline { - s.IngestEndpointUrls = v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *Pipeline) SetLastUpdatedAt(v time.Time) *Pipeline { - s.LastUpdatedAt = &v - return s -} - -// SetLogPublishingOptions sets the LogPublishingOptions field's value. -func (s *Pipeline) SetLogPublishingOptions(v *LogPublishingOptions) *Pipeline { - s.LogPublishingOptions = v - return s -} - -// SetMaxUnits sets the MaxUnits field's value. -func (s *Pipeline) SetMaxUnits(v int64) *Pipeline { - s.MaxUnits = &v - return s -} - -// SetMinUnits sets the MinUnits field's value. -func (s *Pipeline) SetMinUnits(v int64) *Pipeline { - s.MinUnits = &v - return s -} - -// SetPipelineArn sets the PipelineArn field's value. -func (s *Pipeline) SetPipelineArn(v string) *Pipeline { - s.PipelineArn = &v - return s -} - -// SetPipelineConfigurationBody sets the PipelineConfigurationBody field's value. -func (s *Pipeline) SetPipelineConfigurationBody(v string) *Pipeline { - s.PipelineConfigurationBody = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *Pipeline) SetPipelineName(v string) *Pipeline { - s.PipelineName = &v - return s -} - -// SetServiceVpcEndpoints sets the ServiceVpcEndpoints field's value. -func (s *Pipeline) SetServiceVpcEndpoints(v []*ServiceVpcEndpoint) *Pipeline { - s.ServiceVpcEndpoints = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Pipeline) SetStatus(v string) *Pipeline { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *Pipeline) SetStatusReason(v *PipelineStatusReason) *Pipeline { - s.StatusReason = v - return s -} - -// SetTags sets the Tags field's value. -func (s *Pipeline) SetTags(v []*Tag) *Pipeline { - s.Tags = v - return s -} - -// SetVpcEndpoints sets the VpcEndpoints field's value. -func (s *Pipeline) SetVpcEndpoints(v []*VpcEndpoint) *Pipeline { - s.VpcEndpoints = v - return s -} - -// Container for information about an OpenSearch Ingestion blueprint. -type PipelineBlueprint struct { - _ struct{} `type:"structure"` - - // The name of the blueprint. - BlueprintName *string `type:"string"` - - // The YAML configuration of the blueprint. - PipelineConfigurationBody *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 PipelineBlueprint) 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 PipelineBlueprint) GoString() string { - return s.String() -} - -// SetBlueprintName sets the BlueprintName field's value. -func (s *PipelineBlueprint) SetBlueprintName(v string) *PipelineBlueprint { - s.BlueprintName = &v - return s -} - -// SetPipelineConfigurationBody sets the PipelineConfigurationBody field's value. -func (s *PipelineBlueprint) SetPipelineConfigurationBody(v string) *PipelineBlueprint { - s.PipelineConfigurationBody = &v - return s -} - -// A summary of an OpenSearch Ingestion blueprint. -type PipelineBlueprintSummary struct { - _ struct{} `type:"structure"` - - // The name of the blueprint. - BlueprintName *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 PipelineBlueprintSummary) 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 PipelineBlueprintSummary) GoString() string { - return s.String() -} - -// SetBlueprintName sets the BlueprintName field's value. -func (s *PipelineBlueprintSummary) SetBlueprintName(v string) *PipelineBlueprintSummary { - s.BlueprintName = &v - return s -} - -// Information about a pipeline's current status. -type PipelineStatusReason struct { - _ struct{} `type:"structure"` - - // A description of why a pipeline has a certain status. - Description *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 PipelineStatusReason) 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 PipelineStatusReason) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *PipelineStatusReason) SetDescription(v string) *PipelineStatusReason { - s.Description = &v - return s -} - -// Summary information for an OpenSearch Ingestion pipeline. -type PipelineSummary struct { - _ struct{} `type:"structure"` - - // The date and time when the pipeline was created. - CreatedAt *time.Time `type:"timestamp"` - - // The date and time when the pipeline was last updated. - LastUpdatedAt *time.Time `type:"timestamp"` - - // The maximum pipeline capacity, in Ingestion Compute Units (ICUs). - MaxUnits *int64 `min:"1" type:"integer"` - - // The minimum pipeline capacity, in Ingestion Compute Units (ICUs). - MinUnits *int64 `min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the pipeline. - PipelineArn *string `min:"46" type:"string"` - - // The name of the pipeline. - PipelineName *string `min:"3" type:"string"` - - // The current status of the pipeline. - Status *string `type:"string" enum:"PipelineStatus"` - - // Information about a pipeline's current status. - StatusReason *PipelineStatusReason `type:"structure"` - - // A list of tags associated with the given pipeline. - Tags []*Tag `type:"list"` -} - -// 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 PipelineSummary) 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 PipelineSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *PipelineSummary) SetCreatedAt(v time.Time) *PipelineSummary { - s.CreatedAt = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *PipelineSummary) SetLastUpdatedAt(v time.Time) *PipelineSummary { - s.LastUpdatedAt = &v - return s -} - -// SetMaxUnits sets the MaxUnits field's value. -func (s *PipelineSummary) SetMaxUnits(v int64) *PipelineSummary { - s.MaxUnits = &v - return s -} - -// SetMinUnits sets the MinUnits field's value. -func (s *PipelineSummary) SetMinUnits(v int64) *PipelineSummary { - s.MinUnits = &v - return s -} - -// SetPipelineArn sets the PipelineArn field's value. -func (s *PipelineSummary) SetPipelineArn(v string) *PipelineSummary { - s.PipelineArn = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *PipelineSummary) SetPipelineName(v string) *PipelineSummary { - s.PipelineName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *PipelineSummary) SetStatus(v string) *PipelineSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *PipelineSummary) SetStatusReason(v *PipelineStatusReason) *PipelineSummary { - s.StatusReason = v - return s -} - -// SetTags sets the Tags field's value. -func (s *PipelineSummary) SetTags(v []*Tag) *PipelineSummary { - s.Tags = v - return s -} - -// You attempted to create a resource that already exists. -type ResourceAlreadyExistsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceAlreadyExistsException) 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 ResourceAlreadyExistsException) GoString() string { - return s.String() -} - -func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { - return &ResourceAlreadyExistsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceAlreadyExistsException) Code() string { - return "ResourceAlreadyExistsException" -} - -// Message returns the exception's message. -func (s *ResourceAlreadyExistsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceAlreadyExistsException) OrigErr() error { - return nil -} - -func (s *ResourceAlreadyExistsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceAlreadyExistsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceAlreadyExistsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// You attempted to access or delete a resource that does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A container for information about VPC endpoints that were created to other -// services -type ServiceVpcEndpoint struct { - _ struct{} `type:"structure"` - - // The name of the service for which a VPC endpoint was created. - ServiceName *string `type:"string" enum:"VpcEndpointServiceName"` - - // The ID of the VPC endpoint that was created. - VpcEndpointId *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 ServiceVpcEndpoint) 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 ServiceVpcEndpoint) GoString() string { - return s.String() -} - -// SetServiceName sets the ServiceName field's value. -func (s *ServiceVpcEndpoint) SetServiceName(v string) *ServiceVpcEndpoint { - s.ServiceName = &v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *ServiceVpcEndpoint) SetVpcEndpointId(v string) *ServiceVpcEndpoint { - s.VpcEndpointId = &v - return s -} - -type StartPipelineInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipeline to start. - // - // PipelineName is a required field - PipelineName *string `location:"uri" locationName:"PipelineName" min:"3" 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 StartPipelineInput) 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 StartPipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartPipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartPipelineInput"} - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineName sets the PipelineName field's value. -func (s *StartPipelineInput) SetPipelineName(v string) *StartPipelineInput { - s.PipelineName = &v - return s -} - -type StartPipelineOutput struct { - _ struct{} `type:"structure"` - - // Information about an existing OpenSearch Ingestion pipeline. - Pipeline *Pipeline `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 StartPipelineOutput) 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 StartPipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *StartPipelineOutput) SetPipeline(v *Pipeline) *StartPipelineOutput { - s.Pipeline = v - return s -} - -type StopPipelineInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipeline to stop. - // - // PipelineName is a required field - PipelineName *string `location:"uri" locationName:"PipelineName" min:"3" 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 StopPipelineInput) 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 StopPipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopPipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopPipelineInput"} - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineName sets the PipelineName field's value. -func (s *StopPipelineInput) SetPipelineName(v string) *StopPipelineInput { - s.PipelineName = &v - return s -} - -type StopPipelineOutput struct { - _ struct{} `type:"structure"` - - // Information about an existing OpenSearch Ingestion pipeline. - Pipeline *Pipeline `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 StopPipelineOutput) 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 StopPipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *StopPipelineOutput) SetPipeline(v *Pipeline) *StopPipelineOutput { - s.Pipeline = v - return s -} - -// A tag (key-value pair) for an OpenSearch Ingestion pipeline. -type Tag struct { - _ struct{} `type:"structure"` - - // The tag key. Tag keys must be unique for the pipeline to which they are attached. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value assigned to the corresponding tag key. Tag values can be null and - // don't have to be unique in a tag set. For example, you can have a key value - // pair in a tag set of project : Trinity and cost-center : Trinity - // - // Value is a required field - Value *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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the pipeline to tag. - // - // Arn is a required field - Arn *string `location:"querystring" locationName:"arn" min:"46" type:"string" required:"true"` - - // The list of key-value tags to add to the pipeline. - // - // Tags is a required field - Tags []*Tag `type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 46 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 46)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *TagResourceInput) SetArn(v string) *TagResourceInput { - s.Arn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the pipeline to remove tags from. - // - // Arn is a required field - Arn *string `location:"querystring" locationName:"arn" min:"46" type:"string" required:"true"` - - // The tag keys to remove. - // - // TagKeys is a required field - TagKeys []*string `type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 46 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 46)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *UntagResourceInput) SetArn(v string) *UntagResourceInput { - s.Arn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdatePipelineInput struct { - _ struct{} `type:"structure"` - - // Key-value pairs to configure persistent buffering for the pipeline. - BufferOptions *BufferOptions `type:"structure"` - - // Key-value pairs to configure encryption for data that is written to a persistent - // buffer. - EncryptionAtRestOptions *EncryptionAtRestOptions `type:"structure"` - - // Key-value pairs to configure log publishing. - LogPublishingOptions *LogPublishingOptions `type:"structure"` - - // The maximum pipeline capacity, in Ingestion Compute Units (ICUs) - MaxUnits *int64 `min:"1" type:"integer"` - - // The minimum pipeline capacity, in Ingestion Compute Units (ICUs). - MinUnits *int64 `min:"1" type:"integer"` - - // The pipeline configuration in YAML format. The command accepts the pipeline - // configuration as a string or within a .yaml file. If you provide the configuration - // as a string, each new line must be escaped with \n. - PipelineConfigurationBody *string `min:"1" type:"string"` - - // The name of the pipeline to update. - // - // PipelineName is a required field - PipelineName *string `location:"uri" locationName:"PipelineName" min:"3" 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 UpdatePipelineInput) 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 UpdatePipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipelineInput"} - if s.MaxUnits != nil && *s.MaxUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxUnits", 1)) - } - if s.MinUnits != nil && *s.MinUnits < 1 { - invalidParams.Add(request.NewErrParamMinValue("MinUnits", 1)) - } - if s.PipelineConfigurationBody != nil && len(*s.PipelineConfigurationBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineConfigurationBody", 1)) - } - if s.PipelineName == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineName")) - } - if s.PipelineName != nil && len(*s.PipelineName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("PipelineName", 3)) - } - if s.BufferOptions != nil { - if err := s.BufferOptions.Validate(); err != nil { - invalidParams.AddNested("BufferOptions", err.(request.ErrInvalidParams)) - } - } - if s.EncryptionAtRestOptions != nil { - if err := s.EncryptionAtRestOptions.Validate(); err != nil { - invalidParams.AddNested("EncryptionAtRestOptions", err.(request.ErrInvalidParams)) - } - } - if s.LogPublishingOptions != nil { - if err := s.LogPublishingOptions.Validate(); err != nil { - invalidParams.AddNested("LogPublishingOptions", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBufferOptions sets the BufferOptions field's value. -func (s *UpdatePipelineInput) SetBufferOptions(v *BufferOptions) *UpdatePipelineInput { - s.BufferOptions = v - return s -} - -// SetEncryptionAtRestOptions sets the EncryptionAtRestOptions field's value. -func (s *UpdatePipelineInput) SetEncryptionAtRestOptions(v *EncryptionAtRestOptions) *UpdatePipelineInput { - s.EncryptionAtRestOptions = v - return s -} - -// SetLogPublishingOptions sets the LogPublishingOptions field's value. -func (s *UpdatePipelineInput) SetLogPublishingOptions(v *LogPublishingOptions) *UpdatePipelineInput { - s.LogPublishingOptions = v - return s -} - -// SetMaxUnits sets the MaxUnits field's value. -func (s *UpdatePipelineInput) SetMaxUnits(v int64) *UpdatePipelineInput { - s.MaxUnits = &v - return s -} - -// SetMinUnits sets the MinUnits field's value. -func (s *UpdatePipelineInput) SetMinUnits(v int64) *UpdatePipelineInput { - s.MinUnits = &v - return s -} - -// SetPipelineConfigurationBody sets the PipelineConfigurationBody field's value. -func (s *UpdatePipelineInput) SetPipelineConfigurationBody(v string) *UpdatePipelineInput { - s.PipelineConfigurationBody = &v - return s -} - -// SetPipelineName sets the PipelineName field's value. -func (s *UpdatePipelineInput) SetPipelineName(v string) *UpdatePipelineInput { - s.PipelineName = &v - return s -} - -type UpdatePipelineOutput struct { - _ struct{} `type:"structure"` - - // Container for information about the updated pipeline. - Pipeline *Pipeline `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 UpdatePipelineOutput) 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 UpdatePipelineOutput) GoString() string { - return s.String() -} - -// SetPipeline sets the Pipeline field's value. -func (s *UpdatePipelineOutput) SetPipeline(v *Pipeline) *UpdatePipelineOutput { - s.Pipeline = v - return s -} - -type ValidatePipelineInput struct { - _ struct{} `type:"structure"` - - // The pipeline configuration in YAML format. The command accepts the pipeline - // configuration as a string or within a .yaml file. If you provide the configuration - // as a string, each new line must be escaped with \n. - // - // PipelineConfigurationBody is a required field - PipelineConfigurationBody *string `min:"1" 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 ValidatePipelineInput) 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 ValidatePipelineInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidatePipelineInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidatePipelineInput"} - if s.PipelineConfigurationBody == nil { - invalidParams.Add(request.NewErrParamRequired("PipelineConfigurationBody")) - } - if s.PipelineConfigurationBody != nil && len(*s.PipelineConfigurationBody) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PipelineConfigurationBody", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineConfigurationBody sets the PipelineConfigurationBody field's value. -func (s *ValidatePipelineInput) SetPipelineConfigurationBody(v string) *ValidatePipelineInput { - s.PipelineConfigurationBody = &v - return s -} - -type ValidatePipelineOutput struct { - _ struct{} `type:"structure"` - - // A list of errors if the configuration is invalid. - Errors []*ValidationMessage `type:"list"` - - // A boolean indicating whether or not the pipeline configuration is valid. - IsValid *bool `locationName:"isValid" type:"boolean"` -} - -// 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 ValidatePipelineOutput) 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 ValidatePipelineOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *ValidatePipelineOutput) SetErrors(v []*ValidationMessage) *ValidatePipelineOutput { - s.Errors = v - return s -} - -// SetIsValid sets the IsValid field's value. -func (s *ValidatePipelineOutput) SetIsValid(v bool) *ValidatePipelineOutput { - s.IsValid = &v - return s -} - -// An exception for missing or invalid input fields. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A validation message associated with a ValidatePipeline request in OpenSearch -// Ingestion. -type ValidationMessage struct { - _ struct{} `type:"structure"` - - // The validation message. - Message *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 ValidationMessage) 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 ValidationMessage) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationMessage) SetMessage(v string) *ValidationMessage { - s.Message = &v - return s -} - -// An OpenSearch Ingestion-managed VPC endpoint that will access one or more -// pipelines. -type VpcEndpoint struct { - _ struct{} `type:"structure"` - - // The unique identifier of the endpoint. - VpcEndpointId *string `type:"string"` - - // The ID for your VPC. Amazon Web Services PrivateLink generates this value - // when you create a VPC. - VpcId *string `type:"string"` - - // Information about the VPC, including associated subnets and security groups. - VpcOptions *VpcOptions `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 VpcEndpoint) 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 VpcEndpoint) GoString() string { - return s.String() -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *VpcEndpoint) SetVpcEndpointId(v string) *VpcEndpoint { - s.VpcEndpointId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcEndpoint) SetVpcId(v string) *VpcEndpoint { - s.VpcId = &v - return s -} - -// SetVpcOptions sets the VpcOptions field's value. -func (s *VpcEndpoint) SetVpcOptions(v *VpcOptions) *VpcEndpoint { - s.VpcOptions = v - return s -} - -// Options that specify the subnets and security groups for an OpenSearch Ingestion -// VPC endpoint. -type VpcOptions struct { - _ struct{} `type:"structure"` - - // A list of security groups associated with the VPC endpoint. - SecurityGroupIds []*string `min:"1" type:"list"` - - // A list of subnet IDs associated with the VPC endpoint. - // - // SubnetIds is a required field - SubnetIds []*string `min:"1" type:"list" 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 VpcOptions) 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 VpcOptions) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VpcOptions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VpcOptions"} - if s.SecurityGroupIds != nil && len(s.SecurityGroupIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroupIds", 1)) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - if s.SubnetIds != nil && len(s.SubnetIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubnetIds", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *VpcOptions) SetSecurityGroupIds(v []*string) *VpcOptions { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *VpcOptions) SetSubnetIds(v []*string) *VpcOptions { - s.SubnetIds = v - return s -} - -const ( - // ChangeProgressStageStatusesPending is a ChangeProgressStageStatuses enum value - ChangeProgressStageStatusesPending = "PENDING" - - // ChangeProgressStageStatusesInProgress is a ChangeProgressStageStatuses enum value - ChangeProgressStageStatusesInProgress = "IN_PROGRESS" - - // ChangeProgressStageStatusesCompleted is a ChangeProgressStageStatuses enum value - ChangeProgressStageStatusesCompleted = "COMPLETED" - - // ChangeProgressStageStatusesFailed is a ChangeProgressStageStatuses enum value - ChangeProgressStageStatusesFailed = "FAILED" -) - -// ChangeProgressStageStatuses_Values returns all elements of the ChangeProgressStageStatuses enum -func ChangeProgressStageStatuses_Values() []string { - return []string{ - ChangeProgressStageStatusesPending, - ChangeProgressStageStatusesInProgress, - ChangeProgressStageStatusesCompleted, - ChangeProgressStageStatusesFailed, - } -} - -const ( - // ChangeProgressStatusesPending is a ChangeProgressStatuses enum value - ChangeProgressStatusesPending = "PENDING" - - // ChangeProgressStatusesInProgress is a ChangeProgressStatuses enum value - ChangeProgressStatusesInProgress = "IN_PROGRESS" - - // ChangeProgressStatusesCompleted is a ChangeProgressStatuses enum value - ChangeProgressStatusesCompleted = "COMPLETED" - - // ChangeProgressStatusesFailed is a ChangeProgressStatuses enum value - ChangeProgressStatusesFailed = "FAILED" -) - -// ChangeProgressStatuses_Values returns all elements of the ChangeProgressStatuses enum -func ChangeProgressStatuses_Values() []string { - return []string{ - ChangeProgressStatusesPending, - ChangeProgressStatusesInProgress, - ChangeProgressStatusesCompleted, - ChangeProgressStatusesFailed, - } -} - -const ( - // PipelineStatusCreating is a PipelineStatus enum value - PipelineStatusCreating = "CREATING" - - // PipelineStatusActive is a PipelineStatus enum value - PipelineStatusActive = "ACTIVE" - - // PipelineStatusUpdating is a PipelineStatus enum value - PipelineStatusUpdating = "UPDATING" - - // PipelineStatusDeleting is a PipelineStatus enum value - PipelineStatusDeleting = "DELETING" - - // PipelineStatusCreateFailed is a PipelineStatus enum value - PipelineStatusCreateFailed = "CREATE_FAILED" - - // PipelineStatusUpdateFailed is a PipelineStatus enum value - PipelineStatusUpdateFailed = "UPDATE_FAILED" - - // PipelineStatusStarting is a PipelineStatus enum value - PipelineStatusStarting = "STARTING" - - // PipelineStatusStartFailed is a PipelineStatus enum value - PipelineStatusStartFailed = "START_FAILED" - - // PipelineStatusStopping is a PipelineStatus enum value - PipelineStatusStopping = "STOPPING" - - // PipelineStatusStopped is a PipelineStatus enum value - PipelineStatusStopped = "STOPPED" -) - -// PipelineStatus_Values returns all elements of the PipelineStatus enum -func PipelineStatus_Values() []string { - return []string{ - PipelineStatusCreating, - PipelineStatusActive, - PipelineStatusUpdating, - PipelineStatusDeleting, - PipelineStatusCreateFailed, - PipelineStatusUpdateFailed, - PipelineStatusStarting, - PipelineStatusStartFailed, - PipelineStatusStopping, - PipelineStatusStopped, - } -} - -const ( - // VpcEndpointServiceNameOpensearchServerless is a VpcEndpointServiceName enum value - VpcEndpointServiceNameOpensearchServerless = "OPENSEARCH_SERVERLESS" -) - -// VpcEndpointServiceName_Values returns all elements of the VpcEndpointServiceName enum -func VpcEndpointServiceName_Values() []string { - return []string{ - VpcEndpointServiceNameOpensearchServerless, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/doc.go deleted file mode 100644 index 075607c170c0..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package osis provides the client and types for making API -// requests to Amazon OpenSearch Ingestion. -// -// Use the Amazon OpenSearch Ingestion API to create and manage ingestion pipelines. -// OpenSearch Ingestion is a fully managed data collector that delivers real-time -// log and trace data to OpenSearch Service domains. For more information, see -// Getting data into your cluster using OpenSearch Ingestion (https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ingestion.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/osis-2022-01-01 for more information on this service. -// -// See osis package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/osis/ -// -// # Using the Client -// -// To contact Amazon OpenSearch Ingestion with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon OpenSearch Ingestion client OSIS for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/osis/#New -package osis diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/errors.go deleted file mode 100644 index aba3b18cab1d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/errors.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package osis - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have permissions to access the resource. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The client attempted to remove a resource that is currently in use. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalException for service response error code - // "InternalException". - // - // The request failed because of an unknown error, exception, or failure (the - // failure is internal to the service). - ErrCodeInternalException = "InternalException" - - // ErrCodeInvalidPaginationTokenException for service response error code - // "InvalidPaginationTokenException". - // - // An invalid pagination token provided in the request. - ErrCodeInvalidPaginationTokenException = "InvalidPaginationTokenException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // You attempted to create more than the allowed number of tags. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeResourceAlreadyExistsException for service response error code - // "ResourceAlreadyExistsException". - // - // You attempted to create a resource that already exists. - ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // You attempted to access or delete a resource that does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // An exception for missing or invalid input fields. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalException": newErrorInternalException, - "InvalidPaginationTokenException": newErrorInvalidPaginationTokenException, - "LimitExceededException": newErrorLimitExceededException, - "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/osisiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/osisiface/interface.go deleted file mode 100644 index 398af3bb8226..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/osisiface/interface.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package osisiface provides an interface to enable mocking the Amazon OpenSearch Ingestion service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package osisiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis" -) - -// OSISAPI provides an interface to enable mocking the -// osis.OSIS service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon OpenSearch Ingestion. -// func myFunc(svc osisiface.OSISAPI) bool { -// // Make svc.CreatePipeline request -// } -// -// func main() { -// sess := session.New() -// svc := osis.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockOSISClient struct { -// osisiface.OSISAPI -// } -// func (m *mockOSISClient) CreatePipeline(input *osis.CreatePipelineInput) (*osis.CreatePipelineOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockOSISClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type OSISAPI interface { - CreatePipeline(*osis.CreatePipelineInput) (*osis.CreatePipelineOutput, error) - CreatePipelineWithContext(aws.Context, *osis.CreatePipelineInput, ...request.Option) (*osis.CreatePipelineOutput, error) - CreatePipelineRequest(*osis.CreatePipelineInput) (*request.Request, *osis.CreatePipelineOutput) - - DeletePipeline(*osis.DeletePipelineInput) (*osis.DeletePipelineOutput, error) - DeletePipelineWithContext(aws.Context, *osis.DeletePipelineInput, ...request.Option) (*osis.DeletePipelineOutput, error) - DeletePipelineRequest(*osis.DeletePipelineInput) (*request.Request, *osis.DeletePipelineOutput) - - GetPipeline(*osis.GetPipelineInput) (*osis.GetPipelineOutput, error) - GetPipelineWithContext(aws.Context, *osis.GetPipelineInput, ...request.Option) (*osis.GetPipelineOutput, error) - GetPipelineRequest(*osis.GetPipelineInput) (*request.Request, *osis.GetPipelineOutput) - - GetPipelineBlueprint(*osis.GetPipelineBlueprintInput) (*osis.GetPipelineBlueprintOutput, error) - GetPipelineBlueprintWithContext(aws.Context, *osis.GetPipelineBlueprintInput, ...request.Option) (*osis.GetPipelineBlueprintOutput, error) - GetPipelineBlueprintRequest(*osis.GetPipelineBlueprintInput) (*request.Request, *osis.GetPipelineBlueprintOutput) - - GetPipelineChangeProgress(*osis.GetPipelineChangeProgressInput) (*osis.GetPipelineChangeProgressOutput, error) - GetPipelineChangeProgressWithContext(aws.Context, *osis.GetPipelineChangeProgressInput, ...request.Option) (*osis.GetPipelineChangeProgressOutput, error) - GetPipelineChangeProgressRequest(*osis.GetPipelineChangeProgressInput) (*request.Request, *osis.GetPipelineChangeProgressOutput) - - ListPipelineBlueprints(*osis.ListPipelineBlueprintsInput) (*osis.ListPipelineBlueprintsOutput, error) - ListPipelineBlueprintsWithContext(aws.Context, *osis.ListPipelineBlueprintsInput, ...request.Option) (*osis.ListPipelineBlueprintsOutput, error) - ListPipelineBlueprintsRequest(*osis.ListPipelineBlueprintsInput) (*request.Request, *osis.ListPipelineBlueprintsOutput) - - ListPipelines(*osis.ListPipelinesInput) (*osis.ListPipelinesOutput, error) - ListPipelinesWithContext(aws.Context, *osis.ListPipelinesInput, ...request.Option) (*osis.ListPipelinesOutput, error) - ListPipelinesRequest(*osis.ListPipelinesInput) (*request.Request, *osis.ListPipelinesOutput) - - ListPipelinesPages(*osis.ListPipelinesInput, func(*osis.ListPipelinesOutput, bool) bool) error - ListPipelinesPagesWithContext(aws.Context, *osis.ListPipelinesInput, func(*osis.ListPipelinesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*osis.ListTagsForResourceInput) (*osis.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *osis.ListTagsForResourceInput, ...request.Option) (*osis.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*osis.ListTagsForResourceInput) (*request.Request, *osis.ListTagsForResourceOutput) - - StartPipeline(*osis.StartPipelineInput) (*osis.StartPipelineOutput, error) - StartPipelineWithContext(aws.Context, *osis.StartPipelineInput, ...request.Option) (*osis.StartPipelineOutput, error) - StartPipelineRequest(*osis.StartPipelineInput) (*request.Request, *osis.StartPipelineOutput) - - StopPipeline(*osis.StopPipelineInput) (*osis.StopPipelineOutput, error) - StopPipelineWithContext(aws.Context, *osis.StopPipelineInput, ...request.Option) (*osis.StopPipelineOutput, error) - StopPipelineRequest(*osis.StopPipelineInput) (*request.Request, *osis.StopPipelineOutput) - - TagResource(*osis.TagResourceInput) (*osis.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *osis.TagResourceInput, ...request.Option) (*osis.TagResourceOutput, error) - TagResourceRequest(*osis.TagResourceInput) (*request.Request, *osis.TagResourceOutput) - - UntagResource(*osis.UntagResourceInput) (*osis.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *osis.UntagResourceInput, ...request.Option) (*osis.UntagResourceOutput, error) - UntagResourceRequest(*osis.UntagResourceInput) (*request.Request, *osis.UntagResourceOutput) - - UpdatePipeline(*osis.UpdatePipelineInput) (*osis.UpdatePipelineOutput, error) - UpdatePipelineWithContext(aws.Context, *osis.UpdatePipelineInput, ...request.Option) (*osis.UpdatePipelineOutput, error) - UpdatePipelineRequest(*osis.UpdatePipelineInput) (*request.Request, *osis.UpdatePipelineOutput) - - ValidatePipeline(*osis.ValidatePipelineInput) (*osis.ValidatePipelineOutput, error) - ValidatePipelineWithContext(aws.Context, *osis.ValidatePipelineInput, ...request.Option) (*osis.ValidatePipelineOutput, error) - ValidatePipelineRequest(*osis.ValidatePipelineInput) (*request.Request, *osis.ValidatePipelineOutput) -} - -var _ OSISAPI = (*osis.OSIS)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/service.go deleted file mode 100644 index 877e04accc74..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/osis/service.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package osis - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// OSIS provides the API operation methods for making requests to -// Amazon OpenSearch Ingestion. See this package's package overview docs -// for details on the service. -// -// OSIS methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type OSIS struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "OSIS" // Name of service. - EndpointsID = "osis" // ID to lookup a service endpoint with. - ServiceID = "OSIS" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the OSIS client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a OSIS client from just a session. -// svc := osis.New(mySession) -// -// // Create a OSIS client with additional configuration -// svc := osis.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *OSIS { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = EndpointsID - // No Fallback - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *OSIS { - svc := &OSIS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-01-01", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a OSIS operation and runs any -// custom request initialization. -func (c *OSIS) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/api.go deleted file mode 100644 index 0bd23f3d2fc0..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/api.go +++ /dev/null @@ -1,6915 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package paymentcryptography - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opCreateAlias = "CreateAlias" - -// CreateAliasRequest generates a "aws/request.Request" representing the -// client's request for the CreateAlias 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 CreateAlias for more information on using the CreateAlias -// 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 CreateAliasRequest method. -// req, resp := client.CreateAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/CreateAlias -func (c *PaymentCryptography) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput) { - op := &request.Operation{ - Name: opCreateAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAliasInput{} - } - - output = &CreateAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAlias API operation for Payment Cryptography Control Plane. -// -// Creates an alias, or a friendly name, for an Amazon Web Services Payment -// Cryptography key. You can use an alias to identify a key in the console and -// when you call cryptographic operations such as EncryptData (https://docs.aws.amazon.com/payment-cryptography/latest/DataAPIReference/API_EncryptData.html) -// or DecryptData (https://docs.aws.amazon.com/payment-cryptography/latest/DataAPIReference/API_DecryptData.html). -// -// You can associate the alias with any key in the same Amazon Web Services -// Region. Each alias is associated with only one key at a time, but a key can -// have multiple aliases. You can't create an alias without a key. The alias -// must be unique in the account and Amazon Web Services Region, but you can -// create another alias with the same name in a different Amazon Web Services -// Region. -// -// To change the key that's associated with the alias, call UpdateAlias. To -// delete the alias, call DeleteAlias. These operations don't affect the underlying -// key. To get the alias that you created, call ListAliases. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - DeleteAlias -// -// - GetAlias -// -// - ListAliases -// -// - UpdateAlias -// -// 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 Payment Cryptography Control Plane's -// API operation CreateAlias for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/CreateAlias -func (c *PaymentCryptography) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { - req, out := c.CreateAliasRequest(input) - return out, req.Send() -} - -// CreateAliasWithContext is the same as CreateAlias with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAlias 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 *PaymentCryptography) CreateAliasWithContext(ctx aws.Context, input *CreateAliasInput, opts ...request.Option) (*CreateAliasOutput, error) { - req, out := c.CreateAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateKey = "CreateKey" - -// CreateKeyRequest generates a "aws/request.Request" representing the -// client's request for the CreateKey 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 CreateKey for more information on using the CreateKey -// 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 CreateKeyRequest method. -// req, resp := client.CreateKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/CreateKey -func (c *PaymentCryptography) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput) { - op := &request.Operation{ - Name: opCreateKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateKeyInput{} - } - - output = &CreateKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateKey API operation for Payment Cryptography Control Plane. -// -// Creates an Amazon Web Services Payment Cryptography key, a logical representation -// of a cryptographic key, that is unique in your account and Amazon Web Services -// Region. You use keys for cryptographic functions such as encryption and decryption. -// -// In addition to the key material used in cryptographic operations, an Amazon -// Web Services Payment Cryptography key includes metadata such as the key ARN, -// key usage, key origin, creation date, description, and key state. -// -// When you create a key, you specify both immutable and mutable data about -// the key. The immutable data contains key attributes that defines the scope -// and cryptographic operations that you can perform using the key, for example -// key class (example: SYMMETRIC_KEY), key algorithm (example: TDES_2KEY), key -// usage (example: TR31_P0_PIN_ENCRYPTION_KEY) and key modes of use (example: -// Encrypt). For information about valid combinations of key attributes, see -// Understanding key attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// in the Amazon Web Services Payment Cryptography User Guide. The mutable data -// contained within a key includes usage timestamp and key deletion timestamp -// and can be modified after creation. -// -// Amazon Web Services Payment Cryptography binds key attributes to keys using -// key blocks when you store or export them. Amazon Web Services Payment Cryptography -// stores the key contents wrapped and never stores or transmits them in the -// clear. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - DeleteKey -// -// - GetKey -// -// - ListKeys -// -// 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 Payment Cryptography Control Plane's -// API operation CreateKey for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/CreateKey -func (c *PaymentCryptography) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error) { - req, out := c.CreateKeyRequest(input) - return out, req.Send() -} - -// CreateKeyWithContext is the same as CreateKey with the addition of -// the ability to pass a context and additional request options. -// -// See CreateKey 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 *PaymentCryptography) CreateKeyWithContext(ctx aws.Context, input *CreateKeyInput, opts ...request.Option) (*CreateKeyOutput, error) { - req, out := c.CreateKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAlias = "DeleteAlias" - -// DeleteAliasRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAlias 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 DeleteAlias for more information on using the DeleteAlias -// 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 DeleteAliasRequest method. -// req, resp := client.DeleteAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/DeleteAlias -func (c *PaymentCryptography) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) { - op := &request.Operation{ - Name: opDeleteAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteAliasInput{} - } - - output = &DeleteAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAlias API operation for Payment Cryptography Control Plane. -// -// Deletes the alias, but doesn't affect the underlying key. -// -// Each key can have multiple aliases. To get the aliases of all keys, use the -// ListAliases operation. To change the alias of a key, first use DeleteAlias -// to delete the current alias and then use CreateAlias to create a new alias. -// To associate an existing alias with a different key, call UpdateAlias. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - CreateAlias -// -// - GetAlias -// -// - ListAliases -// -// - UpdateAlias -// -// 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 Payment Cryptography Control Plane's -// API operation DeleteAlias for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/DeleteAlias -func (c *PaymentCryptography) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { - req, out := c.DeleteAliasRequest(input) - return out, req.Send() -} - -// DeleteAliasWithContext is the same as DeleteAlias with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAlias 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 *PaymentCryptography) DeleteAliasWithContext(ctx aws.Context, input *DeleteAliasInput, opts ...request.Option) (*DeleteAliasOutput, error) { - req, out := c.DeleteAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteKey = "DeleteKey" - -// DeleteKeyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteKey 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 DeleteKey for more information on using the DeleteKey -// 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 DeleteKeyRequest method. -// req, resp := client.DeleteKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/DeleteKey -func (c *PaymentCryptography) DeleteKeyRequest(input *DeleteKeyInput) (req *request.Request, output *DeleteKeyOutput) { - op := &request.Operation{ - Name: opDeleteKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteKeyInput{} - } - - output = &DeleteKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteKey API operation for Payment Cryptography Control Plane. -// -// Deletes the key material and all metadata associated with Amazon Web Services -// Payment Cryptography key. -// -// Key deletion is irreversible. After a key is deleted, you can't perform cryptographic -// operations using the key. For example, you can't decrypt data that was encrypted -// by a deleted Amazon Web Services Payment Cryptography key, and the data may -// become unrecoverable. Because key deletion is destructive, Amazon Web Services -// Payment Cryptography has a safety mechanism to prevent accidental deletion -// of a key. When you call this operation, Amazon Web Services Payment Cryptography -// disables the specified key but doesn't delete it until after a waiting period. -// The default waiting period is 7 days. To set a different waiting period, -// set DeleteKeyInDays. During the waiting period, the KeyState is DELETE_PENDING. -// After the key is deleted, the KeyState is DELETE_COMPLETE. -// -// If you delete key material, you can use ImportKey to reimport the same key -// material into the Amazon Web Services Payment Cryptography key. -// -// You should delete a key only when you are sure that you don't need to use -// it anymore and no other parties are utilizing this key. If you aren't sure, -// consider deactivating it instead by calling StopKeyUsage. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - RestoreKey -// -// - StartKeyUsage -// -// - StopKeyUsage -// -// 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 Payment Cryptography Control Plane's -// API operation DeleteKey for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/DeleteKey -func (c *PaymentCryptography) DeleteKey(input *DeleteKeyInput) (*DeleteKeyOutput, error) { - req, out := c.DeleteKeyRequest(input) - return out, req.Send() -} - -// DeleteKeyWithContext is the same as DeleteKey with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteKey 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 *PaymentCryptography) DeleteKeyWithContext(ctx aws.Context, input *DeleteKeyInput, opts ...request.Option) (*DeleteKeyOutput, error) { - req, out := c.DeleteKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExportKey = "ExportKey" - -// ExportKeyRequest generates a "aws/request.Request" representing the -// client's request for the ExportKey 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 ExportKey for more information on using the ExportKey -// 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 ExportKeyRequest method. -// req, resp := client.ExportKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ExportKey -func (c *PaymentCryptography) ExportKeyRequest(input *ExportKeyInput) (req *request.Request, output *ExportKeyOutput) { - op := &request.Operation{ - Name: opExportKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ExportKeyInput{} - } - - output = &ExportKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExportKey API operation for Payment Cryptography Control Plane. -// -// Exports a key from Amazon Web Services Payment Cryptography using either -// ANSI X9 TR-34 or TR-31 key export standard. -// -// Amazon Web Services Payment Cryptography simplifies main or root key exchange -// process by eliminating the need of a paper-based key exchange process. It -// takes a modern and secure approach based of the ANSI X9 TR-34 key exchange -// standard. -// -// You can use ExportKey to export main or root keys such as KEK (Key Encryption -// Key), using asymmetric key exchange technique following ANSI X9 TR-34 standard. -// The ANSI X9 TR-34 standard uses asymmetric keys to establishes bi-directional -// trust between the two parties exchanging keys. After which you can export -// working keys using the ANSI X9 TR-31 symmetric key exchange standard as mandated -// by PCI PIN. Using this operation, you can share your Amazon Web Services -// Payment Cryptography generated keys with other service partners to perform -// cryptographic operations outside of Amazon Web Services Payment Cryptography -// -// # TR-34 key export -// -// Amazon Web Services Payment Cryptography uses TR-34 asymmetric key exchange -// standard to export main keys such as KEK. In TR-34 terminology, the sending -// party of the key is called Key Distribution Host (KDH) and the receiving -// party of the key is called Key Receiving Host (KRH). In key export process, -// KDH is Amazon Web Services Payment Cryptography which initiates key export. -// KRH is the user receiving the key. Before you initiate TR-34 key export, -// you must obtain an export token by calling GetParametersForExport. This operation -// also returns the signing key certificate that KDH uses to sign the wrapped -// key to generate a TR-34 wrapped key block. The export token expires after -// 7 days. -// -// Set the following parameters: -// -// # CertificateAuthorityPublicKeyIdentifier -// -// The KeyARN of the certificate chain that will sign the wrapping key certificate. -// This must exist within Amazon Web Services Payment Cryptography before you -// initiate TR-34 key export. If it does not exist, you can import it by calling -// ImportKey for RootCertificatePublicKey. -// -// # ExportToken -// -// Obtained from KDH by calling GetParametersForExport. -// -// # WrappingKeyCertificate -// -// Amazon Web Services Payment Cryptography uses this to wrap the key under -// export. -// -// When this operation is successful, Amazon Web Services Payment Cryptography -// returns the TR-34 wrapped key block. -// -// # TR-31 key export -// -// Amazon Web Services Payment Cryptography uses TR-31 symmetric key exchange -// standard to export working keys. In TR-31, you must use a main key such as -// KEK to encrypt or wrap the key under export. To establish a KEK, you can -// use CreateKey or ImportKey. When this operation is successful, Amazon Web -// Services Payment Cryptography returns a TR-31 wrapped key block. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - GetParametersForExport -// -// - ImportKey -// -// 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 Payment Cryptography Control Plane's -// API operation ExportKey for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ExportKey -func (c *PaymentCryptography) ExportKey(input *ExportKeyInput) (*ExportKeyOutput, error) { - req, out := c.ExportKeyRequest(input) - return out, req.Send() -} - -// ExportKeyWithContext is the same as ExportKey with the addition of -// the ability to pass a context and additional request options. -// -// See ExportKey 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 *PaymentCryptography) ExportKeyWithContext(ctx aws.Context, input *ExportKeyInput, opts ...request.Option) (*ExportKeyOutput, error) { - req, out := c.ExportKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAlias = "GetAlias" - -// GetAliasRequest generates a "aws/request.Request" representing the -// client's request for the GetAlias 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 GetAlias for more information on using the GetAlias -// 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 GetAliasRequest method. -// req, resp := client.GetAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetAlias -func (c *PaymentCryptography) GetAliasRequest(input *GetAliasInput) (req *request.Request, output *GetAliasOutput) { - op := &request.Operation{ - Name: opGetAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetAliasInput{} - } - - output = &GetAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAlias API operation for Payment Cryptography Control Plane. -// -// Gets the Amazon Web Services Payment Cryptography key associated with the -// alias. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - CreateAlias -// -// - DeleteAlias -// -// - ListAliases -// -// - UpdateAlias -// -// 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 Payment Cryptography Control Plane's -// API operation GetAlias for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetAlias -func (c *PaymentCryptography) GetAlias(input *GetAliasInput) (*GetAliasOutput, error) { - req, out := c.GetAliasRequest(input) - return out, req.Send() -} - -// GetAliasWithContext is the same as GetAlias with the addition of -// the ability to pass a context and additional request options. -// -// See GetAlias 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 *PaymentCryptography) GetAliasWithContext(ctx aws.Context, input *GetAliasInput, opts ...request.Option) (*GetAliasOutput, error) { - req, out := c.GetAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetKey = "GetKey" - -// GetKeyRequest generates a "aws/request.Request" representing the -// client's request for the GetKey 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 GetKey for more information on using the GetKey -// 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 GetKeyRequest method. -// req, resp := client.GetKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetKey -func (c *PaymentCryptography) GetKeyRequest(input *GetKeyInput) (req *request.Request, output *GetKeyOutput) { - op := &request.Operation{ - Name: opGetKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetKeyInput{} - } - - output = &GetKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetKey API operation for Payment Cryptography Control Plane. -// -// Gets the key material for an Amazon Web Services Payment Cryptography key, -// including the immutable and mutable data specified when the key was created. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - CreateKey -// -// - DeleteKey -// -// - ListKeys -// -// 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 Payment Cryptography Control Plane's -// API operation GetKey for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetKey -func (c *PaymentCryptography) GetKey(input *GetKeyInput) (*GetKeyOutput, error) { - req, out := c.GetKeyRequest(input) - return out, req.Send() -} - -// GetKeyWithContext is the same as GetKey with the addition of -// the ability to pass a context and additional request options. -// -// See GetKey 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 *PaymentCryptography) GetKeyWithContext(ctx aws.Context, input *GetKeyInput, opts ...request.Option) (*GetKeyOutput, error) { - req, out := c.GetKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetParametersForExport = "GetParametersForExport" - -// GetParametersForExportRequest generates a "aws/request.Request" representing the -// client's request for the GetParametersForExport 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 GetParametersForExport for more information on using the GetParametersForExport -// 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 GetParametersForExportRequest method. -// req, resp := client.GetParametersForExportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetParametersForExport -func (c *PaymentCryptography) GetParametersForExportRequest(input *GetParametersForExportInput) (req *request.Request, output *GetParametersForExportOutput) { - op := &request.Operation{ - Name: opGetParametersForExport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetParametersForExportInput{} - } - - output = &GetParametersForExportOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetParametersForExport API operation for Payment Cryptography Control Plane. -// -// Gets the export token and the signing key certificate to initiate a TR-34 -// key export from Amazon Web Services Payment Cryptography. -// -// The signing key certificate signs the wrapped key under export within the -// TR-34 key payload. The export token and signing key certificate must be in -// place and operational before calling ExportKey. The export token expires -// in 7 days. You can use the same export token to export multiple keys from -// your service account. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - ExportKey -// -// - GetParametersForImport -// -// 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 Payment Cryptography Control Plane's -// API operation GetParametersForExport for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetParametersForExport -func (c *PaymentCryptography) GetParametersForExport(input *GetParametersForExportInput) (*GetParametersForExportOutput, error) { - req, out := c.GetParametersForExportRequest(input) - return out, req.Send() -} - -// GetParametersForExportWithContext is the same as GetParametersForExport with the addition of -// the ability to pass a context and additional request options. -// -// See GetParametersForExport 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 *PaymentCryptography) GetParametersForExportWithContext(ctx aws.Context, input *GetParametersForExportInput, opts ...request.Option) (*GetParametersForExportOutput, error) { - req, out := c.GetParametersForExportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetParametersForImport = "GetParametersForImport" - -// GetParametersForImportRequest generates a "aws/request.Request" representing the -// client's request for the GetParametersForImport 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 GetParametersForImport for more information on using the GetParametersForImport -// 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 GetParametersForImportRequest method. -// req, resp := client.GetParametersForImportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetParametersForImport -func (c *PaymentCryptography) GetParametersForImportRequest(input *GetParametersForImportInput) (req *request.Request, output *GetParametersForImportOutput) { - op := &request.Operation{ - Name: opGetParametersForImport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetParametersForImportInput{} - } - - output = &GetParametersForImportOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetParametersForImport API operation for Payment Cryptography Control Plane. -// -// Gets the import token and the wrapping key certificate to initiate a TR-34 -// key import into Amazon Web Services Payment Cryptography. -// -// The wrapping key certificate wraps the key under import within the TR-34 -// key payload. The import token and wrapping key certificate must be in place -// and operational before calling ImportKey. The import token expires in 7 days. -// The same import token can be used to import multiple keys into your service -// account. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - GetParametersForExport -// -// - ImportKey -// -// 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 Payment Cryptography Control Plane's -// API operation GetParametersForImport for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetParametersForImport -func (c *PaymentCryptography) GetParametersForImport(input *GetParametersForImportInput) (*GetParametersForImportOutput, error) { - req, out := c.GetParametersForImportRequest(input) - return out, req.Send() -} - -// GetParametersForImportWithContext is the same as GetParametersForImport with the addition of -// the ability to pass a context and additional request options. -// -// See GetParametersForImport 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 *PaymentCryptography) GetParametersForImportWithContext(ctx aws.Context, input *GetParametersForImportInput, opts ...request.Option) (*GetParametersForImportOutput, error) { - req, out := c.GetParametersForImportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPublicKeyCertificate = "GetPublicKeyCertificate" - -// GetPublicKeyCertificateRequest generates a "aws/request.Request" representing the -// client's request for the GetPublicKeyCertificate 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 GetPublicKeyCertificate for more information on using the GetPublicKeyCertificate -// 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 GetPublicKeyCertificateRequest method. -// req, resp := client.GetPublicKeyCertificateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetPublicKeyCertificate -func (c *PaymentCryptography) GetPublicKeyCertificateRequest(input *GetPublicKeyCertificateInput) (req *request.Request, output *GetPublicKeyCertificateOutput) { - op := &request.Operation{ - Name: opGetPublicKeyCertificate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPublicKeyCertificateInput{} - } - - output = &GetPublicKeyCertificateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPublicKeyCertificate API operation for Payment Cryptography Control Plane. -// -// Gets the public key certificate of the asymmetric key pair that exists within -// Amazon Web Services Payment Cryptography. -// -// Unlike the private key of an asymmetric key, which never leaves Amazon Web -// Services Payment Cryptography unencrypted, callers with GetPublicKeyCertificate -// permission can download the public key certificate of the asymmetric key. -// You can share the public key certificate to allow others to encrypt messages -// and verify signatures outside of Amazon Web Services Payment Cryptography -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// 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 Payment Cryptography Control Plane's -// API operation GetPublicKeyCertificate for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/GetPublicKeyCertificate -func (c *PaymentCryptography) GetPublicKeyCertificate(input *GetPublicKeyCertificateInput) (*GetPublicKeyCertificateOutput, error) { - req, out := c.GetPublicKeyCertificateRequest(input) - return out, req.Send() -} - -// GetPublicKeyCertificateWithContext is the same as GetPublicKeyCertificate with the addition of -// the ability to pass a context and additional request options. -// -// See GetPublicKeyCertificate 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 *PaymentCryptography) GetPublicKeyCertificateWithContext(ctx aws.Context, input *GetPublicKeyCertificateInput, opts ...request.Option) (*GetPublicKeyCertificateOutput, error) { - req, out := c.GetPublicKeyCertificateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportKey = "ImportKey" - -// ImportKeyRequest generates a "aws/request.Request" representing the -// client's request for the ImportKey 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 ImportKey for more information on using the ImportKey -// 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 ImportKeyRequest method. -// req, resp := client.ImportKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ImportKey -func (c *PaymentCryptography) ImportKeyRequest(input *ImportKeyInput) (req *request.Request, output *ImportKeyOutput) { - op := &request.Operation{ - Name: opImportKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ImportKeyInput{} - } - - output = &ImportKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportKey API operation for Payment Cryptography Control Plane. -// -// Imports keys and public key certificates into Amazon Web Services Payment -// Cryptography. -// -// Amazon Web Services Payment Cryptography simplifies main or root key exchange -// process by eliminating the need of a paper-based key exchange process. It -// takes a modern and secure approach based of the ANSI X9 TR-34 key exchange -// standard. -// -// You can use ImportKey to import main or root keys such as KEK (Key Encryption -// Key) using asymmetric key exchange technique following the ANSI X9 TR-34 -// standard. The ANSI X9 TR-34 standard uses asymmetric keys to establishes -// bi-directional trust between the two parties exchanging keys. -// -// After you have imported a main or root key, you can import working keys to -// perform various cryptographic operations within Amazon Web Services Payment -// Cryptography using the ANSI X9 TR-31 symmetric key exchange standard as mandated -// by PCI PIN. -// -// You can also import a root public key certificate, a self-signed certificate -// used to sign other public key certificates, or a trusted public key certificate -// under an already established root public key certificate. -// -// # To import a public root key certificate -// -// Using this operation, you can import the public component (in PEM cerificate -// format) of your private root key. You can use the imported public root key -// certificate for digital signatures, for example signing wrapping key or signing -// key in TR-34, within your Amazon Web Services Payment Cryptography account. -// -// Set the following parameters: -// -// - KeyMaterial: RootCertificatePublicKey -// -// - KeyClass: PUBLIC_KEY -// -// - KeyModesOfUse: Verify -// -// - KeyUsage: TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE -// -// - PublicKeyCertificate: The certificate authority used to sign the root -// public key certificate. -// -// # To import a trusted public key certificate -// -// The root public key certificate must be in place and operational before you -// import a trusted public key certificate. Set the following parameters: -// -// - KeyMaterial: TrustedCertificatePublicKey -// -// - CertificateAuthorityPublicKeyIdentifier: KeyArn of the RootCertificatePublicKey. -// -// - KeyModesOfUse and KeyUsage: Corresponding to the cryptographic operations -// such as wrap, sign, or encrypt that you will allow the trusted public -// key certificate to perform. -// -// - PublicKeyCertificate: The certificate authority used to sign the trusted -// public key certificate. -// -// # Import main keys -// -// Amazon Web Services Payment Cryptography uses TR-34 asymmetric key exchange -// standard to import main keys such as KEK. In TR-34 terminology, the sending -// party of the key is called Key Distribution Host (KDH) and the receiving -// party of the key is called Key Receiving Host (KRH). During the key import -// process, KDH is the user who initiates the key import and KRH is Amazon Web -// Services Payment Cryptography who receives the key. Before initiating TR-34 -// key import, you must obtain an import token by calling GetParametersForImport. -// This operation also returns the wrapping key certificate that KDH uses wrap -// key under import to generate a TR-34 wrapped key block. The import token -// expires after 7 days. -// -// Set the following parameters: -// -// - CertificateAuthorityPublicKeyIdentifier: The KeyArn of the certificate -// chain that will sign the signing key certificate and should exist within -// Amazon Web Services Payment Cryptography before initiating TR-34 key import. -// If it does not exist, you can import it by calling by calling ImportKey -// for RootCertificatePublicKey. -// -// - ImportToken: Obtained from KRH by calling GetParametersForImport. -// -// - WrappedKeyBlock: The TR-34 wrapped key block from KDH. It contains the -// KDH key under import, wrapped with KRH provided wrapping key certificate -// and signed by the KDH private signing key. This TR-34 key block is generated -// by the KDH Hardware Security Module (HSM) outside of Amazon Web Services -// Payment Cryptography. -// -// - SigningKeyCertificate: The public component of the private key that -// signed the KDH TR-34 wrapped key block. In PEM certificate format. -// -// TR-34 is intended primarily to exchange 3DES keys. Your ability to export -// AES-128 and larger AES keys may be dependent on your source system. -// -// # Import working keys -// -// Amazon Web Services Payment Cryptography uses TR-31 symmetric key exchange -// standard to import working keys. A KEK must be established within Amazon -// Web Services Payment Cryptography by using TR-34 key import. To initiate -// a TR-31 key import, set the following parameters: -// -// - WrappedKeyBlock: The key under import and encrypted using KEK. The TR-31 -// key block generated by your HSM outside of Amazon Web Services Payment -// Cryptography. -// -// - WrappingKeyIdentifier: The KeyArn of the KEK that Amazon Web Services -// Payment Cryptography uses to decrypt or unwrap the key under import. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - ExportKey -// -// - GetParametersForImport -// -// 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 Payment Cryptography Control Plane's -// API operation ImportKey for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ImportKey -func (c *PaymentCryptography) ImportKey(input *ImportKeyInput) (*ImportKeyOutput, error) { - req, out := c.ImportKeyRequest(input) - return out, req.Send() -} - -// ImportKeyWithContext is the same as ImportKey with the addition of -// the ability to pass a context and additional request options. -// -// See ImportKey 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 *PaymentCryptography) ImportKeyWithContext(ctx aws.Context, input *ImportKeyInput, opts ...request.Option) (*ImportKeyOutput, error) { - req, out := c.ImportKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAliases = "ListAliases" - -// ListAliasesRequest generates a "aws/request.Request" representing the -// client's request for the ListAliases 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 ListAliases for more information on using the ListAliases -// 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 ListAliasesRequest method. -// req, resp := client.ListAliasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ListAliases -func (c *PaymentCryptography) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) { - op := &request.Operation{ - Name: opListAliases, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAliasesInput{} - } - - output = &ListAliasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAliases API operation for Payment Cryptography Control Plane. -// -// Lists the aliases for all keys in the caller's Amazon Web Services account -// and Amazon Web Services Region. You can filter the list of aliases. For more -// information, see Using aliases (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-managealias.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// This is a paginated operation, which means that each response might contain -// only a subset of all the aliases. When the response contains only a subset -// of aliases, it includes a NextToken value. Use this value in a subsequent -// ListAliases request to get more aliases. When you receive a response with -// no NextToken (or an empty or null value), that means there are no more aliases -// to get. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - CreateAlias -// -// - DeleteAlias -// -// - GetAlias -// -// - UpdateAlias -// -// 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 Payment Cryptography Control Plane's -// API operation ListAliases for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ListAliases -func (c *PaymentCryptography) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { - req, out := c.ListAliasesRequest(input) - return out, req.Send() -} - -// ListAliasesWithContext is the same as ListAliases with the addition of -// the ability to pass a context and additional request options. -// -// See ListAliases 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 *PaymentCryptography) ListAliasesWithContext(ctx aws.Context, input *ListAliasesInput, opts ...request.Option) (*ListAliasesOutput, error) { - req, out := c.ListAliasesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAliasesPages iterates over the pages of a ListAliases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAliases method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAliases operation. -// pageNum := 0 -// err := client.ListAliasesPages(params, -// func(page *paymentcryptography.ListAliasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PaymentCryptography) ListAliasesPages(input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool) error { - return c.ListAliasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAliasesPagesWithContext same as ListAliasesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PaymentCryptography) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAliasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAliasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListKeys = "ListKeys" - -// ListKeysRequest generates a "aws/request.Request" representing the -// client's request for the ListKeys 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 ListKeys for more information on using the ListKeys -// 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 ListKeysRequest method. -// req, resp := client.ListKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ListKeys -func (c *PaymentCryptography) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput) { - op := &request.Operation{ - Name: opListKeys, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListKeysInput{} - } - - output = &ListKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListKeys API operation for Payment Cryptography Control Plane. -// -// Lists the keys in the caller's Amazon Web Services account and Amazon Web -// Services Region. You can filter the list of keys. -// -// This is a paginated operation, which means that each response might contain -// only a subset of all the keys. When the response contains only a subset of -// keys, it includes a NextToken value. Use this value in a subsequent ListKeys -// request to get more keys. When you receive a response with no NextToken (or -// an empty or null value), that means there are no more keys to get. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - CreateKey -// -// - DeleteKey -// -// - GetKey -// -// 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 Payment Cryptography Control Plane's -// API operation ListKeys for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ListKeys -func (c *PaymentCryptography) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) { - req, out := c.ListKeysRequest(input) - return out, req.Send() -} - -// ListKeysWithContext is the same as ListKeys with the addition of -// the ability to pass a context and additional request options. -// -// See ListKeys 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 *PaymentCryptography) ListKeysWithContext(ctx aws.Context, input *ListKeysInput, opts ...request.Option) (*ListKeysOutput, error) { - req, out := c.ListKeysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListKeysPages iterates over the pages of a ListKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListKeys method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListKeys operation. -// pageNum := 0 -// err := client.ListKeysPages(params, -// func(page *paymentcryptography.ListKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PaymentCryptography) ListKeysPages(input *ListKeysInput, fn func(*ListKeysOutput, bool) bool) error { - return c.ListKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListKeysPagesWithContext same as ListKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PaymentCryptography) ListKeysPagesWithContext(ctx aws.Context, input *ListKeysInput, fn func(*ListKeysOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ListTagsForResource -func (c *PaymentCryptography) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Payment Cryptography Control Plane. -// -// Lists the tags for an Amazon Web Services resource. -// -// This is a paginated operation, which means that each response might contain -// only a subset of all the tags. When the response contains only a subset of -// tags, it includes a NextToken value. Use this value in a subsequent ListTagsForResource -// request to get more tags. When you receive a response with no NextToken (or -// an empty or null value), that means there are no more tags to get. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - TagResource -// -// - UntagResource -// -// 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 Payment Cryptography Control Plane's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/ListTagsForResource -func (c *PaymentCryptography) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *PaymentCryptography) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTagsForResourcePages iterates over the pages of a ListTagsForResource operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTagsForResource method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTagsForResource operation. -// pageNum := 0 -// err := client.ListTagsForResourcePages(params, -// func(page *paymentcryptography.ListTagsForResourceOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PaymentCryptography) ListTagsForResourcePages(input *ListTagsForResourceInput, fn func(*ListTagsForResourceOutput, bool) bool) error { - return c.ListTagsForResourcePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagsForResourcePagesWithContext same as ListTagsForResourcePages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PaymentCryptography) ListTagsForResourcePagesWithContext(ctx aws.Context, input *ListTagsForResourceInput, fn func(*ListTagsForResourceOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTagsForResourceInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTagsForResourceRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opRestoreKey = "RestoreKey" - -// RestoreKeyRequest generates a "aws/request.Request" representing the -// client's request for the RestoreKey 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 RestoreKey for more information on using the RestoreKey -// 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 RestoreKeyRequest method. -// req, resp := client.RestoreKeyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/RestoreKey -func (c *PaymentCryptography) RestoreKeyRequest(input *RestoreKeyInput) (req *request.Request, output *RestoreKeyOutput) { - op := &request.Operation{ - Name: opRestoreKey, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreKeyInput{} - } - - output = &RestoreKeyOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreKey API operation for Payment Cryptography Control Plane. -// -// Cancels a scheduled key deletion during the waiting period. Use this operation -// to restore a Key that is scheduled for deletion. -// -// During the waiting period, the KeyState is DELETE_PENDING and deletePendingTimestamp -// contains the date and time after which the Key will be deleted. After Key -// is restored, the KeyState is CREATE_COMPLETE, and the value for deletePendingTimestamp -// is removed. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - DeleteKey -// -// - StartKeyUsage -// -// - StopKeyUsage -// -// 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 Payment Cryptography Control Plane's -// API operation RestoreKey for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/RestoreKey -func (c *PaymentCryptography) RestoreKey(input *RestoreKeyInput) (*RestoreKeyOutput, error) { - req, out := c.RestoreKeyRequest(input) - return out, req.Send() -} - -// RestoreKeyWithContext is the same as RestoreKey with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreKey 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 *PaymentCryptography) RestoreKeyWithContext(ctx aws.Context, input *RestoreKeyInput, opts ...request.Option) (*RestoreKeyOutput, error) { - req, out := c.RestoreKeyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartKeyUsage = "StartKeyUsage" - -// StartKeyUsageRequest generates a "aws/request.Request" representing the -// client's request for the StartKeyUsage 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 StartKeyUsage for more information on using the StartKeyUsage -// 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 StartKeyUsageRequest method. -// req, resp := client.StartKeyUsageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/StartKeyUsage -func (c *PaymentCryptography) StartKeyUsageRequest(input *StartKeyUsageInput) (req *request.Request, output *StartKeyUsageOutput) { - op := &request.Operation{ - Name: opStartKeyUsage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartKeyUsageInput{} - } - - output = &StartKeyUsageOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartKeyUsage API operation for Payment Cryptography Control Plane. -// -// Enables an Amazon Web Services Payment Cryptography key, which makes it active -// for cryptographic operations within Amazon Web Services Payment Cryptography -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - StopKeyUsage -// -// 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 Payment Cryptography Control Plane's -// API operation StartKeyUsage for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/StartKeyUsage -func (c *PaymentCryptography) StartKeyUsage(input *StartKeyUsageInput) (*StartKeyUsageOutput, error) { - req, out := c.StartKeyUsageRequest(input) - return out, req.Send() -} - -// StartKeyUsageWithContext is the same as StartKeyUsage with the addition of -// the ability to pass a context and additional request options. -// -// See StartKeyUsage 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 *PaymentCryptography) StartKeyUsageWithContext(ctx aws.Context, input *StartKeyUsageInput, opts ...request.Option) (*StartKeyUsageOutput, error) { - req, out := c.StartKeyUsageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopKeyUsage = "StopKeyUsage" - -// StopKeyUsageRequest generates a "aws/request.Request" representing the -// client's request for the StopKeyUsage 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 StopKeyUsage for more information on using the StopKeyUsage -// 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 StopKeyUsageRequest method. -// req, resp := client.StopKeyUsageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/StopKeyUsage -func (c *PaymentCryptography) StopKeyUsageRequest(input *StopKeyUsageInput) (req *request.Request, output *StopKeyUsageOutput) { - op := &request.Operation{ - Name: opStopKeyUsage, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopKeyUsageInput{} - } - - output = &StopKeyUsageOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopKeyUsage API operation for Payment Cryptography Control Plane. -// -// Disables an Amazon Web Services Payment Cryptography key, which makes it -// inactive within Amazon Web Services Payment Cryptography. -// -// You can use this operation instead of DeleteKey to deactivate a key. You -// can enable the key in the future by calling StartKeyUsage. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - DeleteKey -// -// - StartKeyUsage -// -// 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 Payment Cryptography Control Plane's -// API operation StopKeyUsage for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/StopKeyUsage -func (c *PaymentCryptography) StopKeyUsage(input *StopKeyUsageInput) (*StopKeyUsageOutput, error) { - req, out := c.StopKeyUsageRequest(input) - return out, req.Send() -} - -// StopKeyUsageWithContext is the same as StopKeyUsage with the addition of -// the ability to pass a context and additional request options. -// -// See StopKeyUsage 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 *PaymentCryptography) StopKeyUsageWithContext(ctx aws.Context, input *StopKeyUsageInput, opts ...request.Option) (*StopKeyUsageOutput, error) { - req, out := c.StopKeyUsageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/TagResource -func (c *PaymentCryptography) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Payment Cryptography Control Plane. -// -// Adds or edits tags on an Amazon Web Services Payment Cryptography key. -// -// Tagging or untagging an Amazon Web Services Payment Cryptography key can -// allow or deny permission to the key. -// -// Each tag consists of a tag key and a tag value, both of which are case-sensitive -// strings. The tag value can be an empty (null) string. To add a tag, specify -// a new tag key and a tag value. To edit a tag, specify an existing tag key -// and a new tag value. You can also add tags to an Amazon Web Services Payment -// Cryptography key when you create it with CreateKey. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - ListTagsForResource -// -// - UntagResource -// -// 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 Payment Cryptography Control Plane's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// This request would cause a service quota to be exceeded. -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/TagResource -func (c *PaymentCryptography) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *PaymentCryptography) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/UntagResource -func (c *PaymentCryptography) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Payment Cryptography Control Plane. -// -// Deletes a tag from an Amazon Web Services Payment Cryptography key. -// -// Tagging or untagging an Amazon Web Services Payment Cryptography key can -// allow or deny permission to the key. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - ListTagsForResource -// -// - TagResource -// -// 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 Payment Cryptography Control Plane's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/UntagResource -func (c *PaymentCryptography) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *PaymentCryptography) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAlias = "UpdateAlias" - -// UpdateAliasRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAlias 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 UpdateAlias for more information on using the UpdateAlias -// 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 UpdateAliasRequest method. -// req, resp := client.UpdateAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/UpdateAlias -func (c *PaymentCryptography) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) { - op := &request.Operation{ - Name: opUpdateAlias, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateAliasInput{} - } - - output = &UpdateAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAlias API operation for Payment Cryptography Control Plane. -// -// Associates an existing Amazon Web Services Payment Cryptography alias with -// a different key. Each alias is associated with only one Amazon Web Services -// Payment Cryptography key at a time, although a key can have multiple aliases. -// The alias and the Amazon Web Services Payment Cryptography key must be in -// the same Amazon Web Services account and Amazon Web Services Region -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - CreateAlias -// -// - DeleteAlias -// -// - GetAlias -// -// - ListAliases -// -// 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 Payment Cryptography Control Plane's -// API operation UpdateAlias for usage and error information. -// -// Returned Error Types: -// -// - ServiceUnavailableException -// The service cannot complete the request. -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - ConflictException -// This request can cause an inconsistent state for the resource. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14/UpdateAlias -func (c *PaymentCryptography) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) { - req, out := c.UpdateAliasRequest(input) - return out, req.Send() -} - -// UpdateAliasWithContext is the same as UpdateAlias with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAlias 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 *PaymentCryptography) UpdateAliasWithContext(ctx aws.Context, input *UpdateAliasInput, opts ...request.Option) (*UpdateAliasOutput, error) { - req, out := c.UpdateAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about an alias. -type Alias struct { - _ struct{} `type:"structure"` - - // A friendly name that you can use to refer to a key. The value must begin - // with alias/. - // - // Do not include confidential or sensitive information in this field. This - // field may be displayed in plaintext in CloudTrail logs and other output. - // - // AliasName is a required field - AliasName *string `min:"7" type:"string" required:"true"` - - // The KeyARN of the key associated with the alias. - KeyArn *string `min:"70" 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 Alias) 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 Alias) GoString() string { - return s.String() -} - -// SetAliasName sets the AliasName field's value. -func (s *Alias) SetAliasName(v string) *Alias { - s.AliasName = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *Alias) SetKeyArn(v string) *Alias { - s.KeyArn = &v - return s -} - -// This request can cause an inconsistent state for the resource. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateAliasInput struct { - _ struct{} `type:"structure"` - - // A friendly name that you can use to refer a key. An alias must begin with - // alias/ followed by a name, for example alias/ExampleAlias. It can contain - // only alphanumeric characters, forward slashes (/), underscores (_), and dashes - // (-). - // - // Don't include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // AliasName is a required field - AliasName *string `min:"7" type:"string" required:"true"` - - // The KeyARN of the key to associate with the alias. - KeyArn *string `min:"70" 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 CreateAliasInput) 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 CreateAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"} - if s.AliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AliasName")) - } - if s.AliasName != nil && len(*s.AliasName) < 7 { - invalidParams.Add(request.NewErrParamMinLen("AliasName", 7)) - } - if s.KeyArn != nil && len(*s.KeyArn) < 70 { - invalidParams.Add(request.NewErrParamMinLen("KeyArn", 70)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliasName sets the AliasName field's value. -func (s *CreateAliasInput) SetAliasName(v string) *CreateAliasInput { - s.AliasName = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *CreateAliasInput) SetKeyArn(v string) *CreateAliasInput { - s.KeyArn = &v - return s -} - -type CreateAliasOutput struct { - _ struct{} `type:"structure"` - - // The alias for the key. - // - // Alias is a required field - Alias *Alias `type:"structure" 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 CreateAliasOutput) 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 CreateAliasOutput) GoString() string { - return s.String() -} - -// SetAlias sets the Alias field's value. -func (s *CreateAliasOutput) SetAlias(v *Alias) *CreateAliasOutput { - s.Alias = v - return s -} - -type CreateKeyInput struct { - _ struct{} `type:"structure"` - - // Specifies whether to enable the key. If the key is enabled, it is activated - // for use within the service. If the key not enabled, then it is created but - // not activated. The default value is enabled. - Enabled *bool `type:"boolean"` - - // Specifies whether the key is exportable from the service. - // - // Exportable is a required field - Exportable *bool `type:"boolean" required:"true"` - - // The role of the key, the algorithm it supports, and the cryptographic operations - // allowed with the key. This data is immutable after the key is created. - // - // KeyAttributes is a required field - KeyAttributes *KeyAttributes `type:"structure" required:"true"` - - // The algorithm that Amazon Web Services Payment Cryptography uses to calculate - // the key check value (KCV) for DES and AES keys. - // - // For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', - // with the key to be checked and retaining the 3 highest order bytes of the - // encrypted result. For AES key, the KCV is computed by encrypting 8 bytes, - // each with value '01', with the key to be checked and retaining the 3 highest - // order bytes of the encrypted result. - KeyCheckValueAlgorithm *string `type:"string" enum:"KeyCheckValueAlgorithm"` - - // The tags to attach to the key. Each tag consists of a tag key and a tag value. - // Both the tag key and the tag value are required, but the tag value can be - // an empty (null) string. You can't have more than one tag on an Amazon Web - // Services Payment Cryptography key with the same tag key. - // - // To use this parameter, you must have TagResource permission. - // - // Don't include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // Tagging or untagging an Amazon Web Services Payment Cryptography key can - // allow or deny permission to the key. - Tags []*Tag `type:"list"` -} - -// 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 CreateKeyInput) 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 CreateKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateKeyInput"} - if s.Exportable == nil { - invalidParams.Add(request.NewErrParamRequired("Exportable")) - } - if s.KeyAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("KeyAttributes")) - } - if s.KeyAttributes != nil { - if err := s.KeyAttributes.Validate(); err != nil { - invalidParams.AddNested("KeyAttributes", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *CreateKeyInput) SetEnabled(v bool) *CreateKeyInput { - s.Enabled = &v - return s -} - -// SetExportable sets the Exportable field's value. -func (s *CreateKeyInput) SetExportable(v bool) *CreateKeyInput { - s.Exportable = &v - return s -} - -// SetKeyAttributes sets the KeyAttributes field's value. -func (s *CreateKeyInput) SetKeyAttributes(v *KeyAttributes) *CreateKeyInput { - s.KeyAttributes = v - return s -} - -// SetKeyCheckValueAlgorithm sets the KeyCheckValueAlgorithm field's value. -func (s *CreateKeyInput) SetKeyCheckValueAlgorithm(v string) *CreateKeyInput { - s.KeyCheckValueAlgorithm = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateKeyInput) SetTags(v []*Tag) *CreateKeyInput { - s.Tags = v - return s -} - -type CreateKeyOutput struct { - _ struct{} `type:"structure"` - - // The key material that contains all the key attributes. - // - // Key is a required field - Key *Key `type:"structure" 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 CreateKeyOutput) 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 CreateKeyOutput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *CreateKeyOutput) SetKey(v *Key) *CreateKeyOutput { - s.Key = v - return s -} - -type DeleteAliasInput struct { - _ struct{} `type:"structure"` - - // A friendly name that you can use to refer Amazon Web Services Payment Cryptography - // key. This value must begin with alias/ followed by a name, such as alias/ExampleAlias. - // - // AliasName is a required field - AliasName *string `min:"7" 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 DeleteAliasInput) 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 DeleteAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"} - if s.AliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AliasName")) - } - if s.AliasName != nil && len(*s.AliasName) < 7 { - invalidParams.Add(request.NewErrParamMinLen("AliasName", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliasName sets the AliasName field's value. -func (s *DeleteAliasInput) SetAliasName(v string) *DeleteAliasInput { - s.AliasName = &v - return s -} - -type DeleteAliasOutput 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 DeleteAliasOutput) 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 DeleteAliasOutput) GoString() string { - return s.String() -} - -type DeleteKeyInput struct { - _ struct{} `type:"structure"` - - // The waiting period for key deletion. The default value is seven days. - DeleteKeyInDays *int64 `min:"3" type:"integer"` - - // The KeyARN of the key that is scheduled for deletion. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" 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 DeleteKeyInput) 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 DeleteKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteKeyInput"} - if s.DeleteKeyInDays != nil && *s.DeleteKeyInDays < 3 { - invalidParams.Add(request.NewErrParamMinValue("DeleteKeyInDays", 3)) - } - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeleteKeyInDays sets the DeleteKeyInDays field's value. -func (s *DeleteKeyInput) SetDeleteKeyInDays(v int64) *DeleteKeyInput { - s.DeleteKeyInDays = &v - return s -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *DeleteKeyInput) SetKeyIdentifier(v string) *DeleteKeyInput { - s.KeyIdentifier = &v - return s -} - -type DeleteKeyOutput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the key that is scheduled for deletion. - // - // Key is a required field - Key *Key `type:"structure" 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 DeleteKeyOutput) 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 DeleteKeyOutput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *DeleteKeyOutput) SetKey(v *Key) *DeleteKeyOutput { - s.Key = v - return s -} - -type ExportKeyInput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the key under export from Amazon Web Services Payment Cryptography. - // - // ExportKeyIdentifier is a required field - ExportKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The key block format type, for example, TR-34 or TR-31, to use during key - // material export. - // - // KeyMaterial is a required field - KeyMaterial *ExportKeyMaterial `type:"structure" 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 ExportKeyInput) 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 ExportKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportKeyInput"} - if s.ExportKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ExportKeyIdentifier")) - } - if s.ExportKeyIdentifier != nil && len(*s.ExportKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("ExportKeyIdentifier", 7)) - } - if s.KeyMaterial == nil { - invalidParams.Add(request.NewErrParamRequired("KeyMaterial")) - } - if s.KeyMaterial != nil { - if err := s.KeyMaterial.Validate(); err != nil { - invalidParams.AddNested("KeyMaterial", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExportKeyIdentifier sets the ExportKeyIdentifier field's value. -func (s *ExportKeyInput) SetExportKeyIdentifier(v string) *ExportKeyInput { - s.ExportKeyIdentifier = &v - return s -} - -// SetKeyMaterial sets the KeyMaterial field's value. -func (s *ExportKeyInput) SetKeyMaterial(v *ExportKeyMaterial) *ExportKeyInput { - s.KeyMaterial = v - return s -} - -// Parameter information for key material export from Amazon Web Services Payment -// Cryptography. -type ExportKeyMaterial struct { - _ struct{} `type:"structure"` - - // Parameter information for key material export using TR-31 standard. - Tr31KeyBlock *ExportTr31KeyBlock `type:"structure"` - - // Parameter information for key material export using TR-34 standard. - Tr34KeyBlock *ExportTr34KeyBlock `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 ExportKeyMaterial) 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 ExportKeyMaterial) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportKeyMaterial) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportKeyMaterial"} - if s.Tr31KeyBlock != nil { - if err := s.Tr31KeyBlock.Validate(); err != nil { - invalidParams.AddNested("Tr31KeyBlock", err.(request.ErrInvalidParams)) - } - } - if s.Tr34KeyBlock != nil { - if err := s.Tr34KeyBlock.Validate(); err != nil { - invalidParams.AddNested("Tr34KeyBlock", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTr31KeyBlock sets the Tr31KeyBlock field's value. -func (s *ExportKeyMaterial) SetTr31KeyBlock(v *ExportTr31KeyBlock) *ExportKeyMaterial { - s.Tr31KeyBlock = v - return s -} - -// SetTr34KeyBlock sets the Tr34KeyBlock field's value. -func (s *ExportKeyMaterial) SetTr34KeyBlock(v *ExportTr34KeyBlock) *ExportKeyMaterial { - s.Tr34KeyBlock = v - return s -} - -type ExportKeyOutput struct { - _ struct{} `type:"structure"` - - // The key material under export as a TR-34 or TR-31 wrapped key block. - WrappedKey *WrappedKey `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 ExportKeyOutput) 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 ExportKeyOutput) GoString() string { - return s.String() -} - -// SetWrappedKey sets the WrappedKey field's value. -func (s *ExportKeyOutput) SetWrappedKey(v *WrappedKey) *ExportKeyOutput { - s.WrappedKey = v - return s -} - -// Parameter information for key material export using TR-31 standard. -type ExportTr31KeyBlock struct { - _ struct{} `type:"structure"` - - // The KeyARN of the the wrapping key. This key encrypts or wraps the key under - // export for TR-31 key block generation. - // - // WrappingKeyIdentifier is a required field - WrappingKeyIdentifier *string `min:"7" 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 ExportTr31KeyBlock) 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 ExportTr31KeyBlock) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportTr31KeyBlock) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportTr31KeyBlock"} - if s.WrappingKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("WrappingKeyIdentifier")) - } - if s.WrappingKeyIdentifier != nil && len(*s.WrappingKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("WrappingKeyIdentifier", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWrappingKeyIdentifier sets the WrappingKeyIdentifier field's value. -func (s *ExportTr31KeyBlock) SetWrappingKeyIdentifier(v string) *ExportTr31KeyBlock { - s.WrappingKeyIdentifier = &v - return s -} - -// Parameter information for key material export using TR-34 standard. -type ExportTr34KeyBlock struct { - _ struct{} `type:"structure"` - - // The KeyARN of the certificate chain that signs the wrapping key certificate - // during TR-34 key export. - // - // CertificateAuthorityPublicKeyIdentifier is a required field - CertificateAuthorityPublicKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The export token to initiate key export from Amazon Web Services Payment - // Cryptography. It also contains the signing key certificate that will sign - // the wrapped key during TR-34 key block generation. Call GetParametersForExport - // to receive an export token. It expires after 7 days. You can use the same - // export token to export multiple keys from the same service account. - // - // ExportToken is a required field - ExportToken *string `type:"string" required:"true"` - - // The format of key block that Amazon Web Services Payment Cryptography will - // use during key export. - // - // KeyBlockFormat is a required field - KeyBlockFormat *string `type:"string" required:"true" enum:"Tr34KeyBlockFormat"` - - // A random number value that is unique to the TR-34 key block generated using - // 2 pass. The operation will fail, if a random nonce value is not provided - // for a TR-34 key block generated using 2 pass. - RandomNonce *string `min:"16" type:"string"` - - // The KeyARN of the wrapping key certificate. Amazon Web Services Payment Cryptography - // uses this certificate to wrap the key under export. - // - // WrappingKeyCertificate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ExportTr34KeyBlock's - // String and GoString methods. - // - // WrappingKeyCertificate is a required field - WrappingKeyCertificate *string `min:"1" type:"string" required:"true" sensitive:"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 ExportTr34KeyBlock) 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 ExportTr34KeyBlock) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportTr34KeyBlock) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportTr34KeyBlock"} - if s.CertificateAuthorityPublicKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateAuthorityPublicKeyIdentifier")) - } - if s.CertificateAuthorityPublicKeyIdentifier != nil && len(*s.CertificateAuthorityPublicKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("CertificateAuthorityPublicKeyIdentifier", 7)) - } - if s.ExportToken == nil { - invalidParams.Add(request.NewErrParamRequired("ExportToken")) - } - if s.KeyBlockFormat == nil { - invalidParams.Add(request.NewErrParamRequired("KeyBlockFormat")) - } - if s.RandomNonce != nil && len(*s.RandomNonce) < 16 { - invalidParams.Add(request.NewErrParamMinLen("RandomNonce", 16)) - } - if s.WrappingKeyCertificate == nil { - invalidParams.Add(request.NewErrParamRequired("WrappingKeyCertificate")) - } - if s.WrappingKeyCertificate != nil && len(*s.WrappingKeyCertificate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WrappingKeyCertificate", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateAuthorityPublicKeyIdentifier sets the CertificateAuthorityPublicKeyIdentifier field's value. -func (s *ExportTr34KeyBlock) SetCertificateAuthorityPublicKeyIdentifier(v string) *ExportTr34KeyBlock { - s.CertificateAuthorityPublicKeyIdentifier = &v - return s -} - -// SetExportToken sets the ExportToken field's value. -func (s *ExportTr34KeyBlock) SetExportToken(v string) *ExportTr34KeyBlock { - s.ExportToken = &v - return s -} - -// SetKeyBlockFormat sets the KeyBlockFormat field's value. -func (s *ExportTr34KeyBlock) SetKeyBlockFormat(v string) *ExportTr34KeyBlock { - s.KeyBlockFormat = &v - return s -} - -// SetRandomNonce sets the RandomNonce field's value. -func (s *ExportTr34KeyBlock) SetRandomNonce(v string) *ExportTr34KeyBlock { - s.RandomNonce = &v - return s -} - -// SetWrappingKeyCertificate sets the WrappingKeyCertificate field's value. -func (s *ExportTr34KeyBlock) SetWrappingKeyCertificate(v string) *ExportTr34KeyBlock { - s.WrappingKeyCertificate = &v - return s -} - -type GetAliasInput struct { - _ struct{} `type:"structure"` - - // The alias of the Amazon Web Services Payment Cryptography key. - // - // AliasName is a required field - AliasName *string `min:"7" 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 GetAliasInput) 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 GetAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAliasInput"} - if s.AliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AliasName")) - } - if s.AliasName != nil && len(*s.AliasName) < 7 { - invalidParams.Add(request.NewErrParamMinLen("AliasName", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliasName sets the AliasName field's value. -func (s *GetAliasInput) SetAliasName(v string) *GetAliasInput { - s.AliasName = &v - return s -} - -type GetAliasOutput struct { - _ struct{} `type:"structure"` - - // The alias of the Amazon Web Services Payment Cryptography key. - // - // Alias is a required field - Alias *Alias `type:"structure" 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 GetAliasOutput) 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 GetAliasOutput) GoString() string { - return s.String() -} - -// SetAlias sets the Alias field's value. -func (s *GetAliasOutput) SetAlias(v *Alias) *GetAliasOutput { - s.Alias = v - return s -} - -type GetKeyInput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the Amazon Web Services Payment Cryptography key. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" 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 GetKeyInput) 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 GetKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetKeyInput"} - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *GetKeyInput) SetKeyIdentifier(v string) *GetKeyInput { - s.KeyIdentifier = &v - return s -} - -type GetKeyOutput struct { - _ struct{} `type:"structure"` - - // The key material, including the immutable and mutable data for the key. - // - // Key is a required field - Key *Key `type:"structure" 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 GetKeyOutput) 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 GetKeyOutput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *GetKeyOutput) SetKey(v *Key) *GetKeyOutput { - s.Key = v - return s -} - -type GetParametersForExportInput struct { - _ struct{} `type:"structure"` - - // The key block format type (for example, TR-34 or TR-31) to use during key - // material export. Export token is only required for a TR-34 key export, TR34_KEY_BLOCK. - // Export token is not required for TR-31 key export. - // - // KeyMaterialType is a required field - KeyMaterialType *string `type:"string" required:"true" enum:"KeyMaterialType"` - - // The signing key algorithm to generate a signing key certificate. This certificate - // signs the wrapped key under export within the TR-34 key block cryptogram. - // RSA_2048 is the only signing key algorithm allowed. - // - // SigningKeyAlgorithm is a required field - SigningKeyAlgorithm *string `type:"string" required:"true" enum:"KeyAlgorithm"` -} - -// 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 GetParametersForExportInput) 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 GetParametersForExportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetParametersForExportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetParametersForExportInput"} - if s.KeyMaterialType == nil { - invalidParams.Add(request.NewErrParamRequired("KeyMaterialType")) - } - if s.SigningKeyAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("SigningKeyAlgorithm")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyMaterialType sets the KeyMaterialType field's value. -func (s *GetParametersForExportInput) SetKeyMaterialType(v string) *GetParametersForExportInput { - s.KeyMaterialType = &v - return s -} - -// SetSigningKeyAlgorithm sets the SigningKeyAlgorithm field's value. -func (s *GetParametersForExportInput) SetSigningKeyAlgorithm(v string) *GetParametersForExportInput { - s.SigningKeyAlgorithm = &v - return s -} - -type GetParametersForExportOutput struct { - _ struct{} `type:"structure"` - - // The export token to initiate key export from Amazon Web Services Payment - // Cryptography. The export token expires after 7 days. You can use the same - // export token to export multiple keys from the same service account. - // - // ExportToken is a required field - ExportToken *string `type:"string" required:"true"` - - // The validity period of the export token. - // - // ParametersValidUntilTimestamp is a required field - ParametersValidUntilTimestamp *time.Time `type:"timestamp" required:"true"` - - // The algorithm of the signing key certificate for use in TR-34 key block generation. - // RSA_2048 is the only signing key algorithm allowed. - // - // SigningKeyAlgorithm is a required field - SigningKeyAlgorithm *string `type:"string" required:"true" enum:"KeyAlgorithm"` - - // The signing key certificate of the public key for signature within the TR-34 - // key block cryptogram. The certificate expires after 7 days. - // - // SigningKeyCertificate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetParametersForExportOutput's - // String and GoString methods. - // - // SigningKeyCertificate is a required field - SigningKeyCertificate *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The certificate chain that signed the signing key certificate. This is the - // root certificate authority (CA) within your service account. - // - // SigningKeyCertificateChain is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetParametersForExportOutput's - // String and GoString methods. - // - // SigningKeyCertificateChain is a required field - SigningKeyCertificateChain *string `min:"1" type:"string" required:"true" sensitive:"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 GetParametersForExportOutput) 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 GetParametersForExportOutput) GoString() string { - return s.String() -} - -// SetExportToken sets the ExportToken field's value. -func (s *GetParametersForExportOutput) SetExportToken(v string) *GetParametersForExportOutput { - s.ExportToken = &v - return s -} - -// SetParametersValidUntilTimestamp sets the ParametersValidUntilTimestamp field's value. -func (s *GetParametersForExportOutput) SetParametersValidUntilTimestamp(v time.Time) *GetParametersForExportOutput { - s.ParametersValidUntilTimestamp = &v - return s -} - -// SetSigningKeyAlgorithm sets the SigningKeyAlgorithm field's value. -func (s *GetParametersForExportOutput) SetSigningKeyAlgorithm(v string) *GetParametersForExportOutput { - s.SigningKeyAlgorithm = &v - return s -} - -// SetSigningKeyCertificate sets the SigningKeyCertificate field's value. -func (s *GetParametersForExportOutput) SetSigningKeyCertificate(v string) *GetParametersForExportOutput { - s.SigningKeyCertificate = &v - return s -} - -// SetSigningKeyCertificateChain sets the SigningKeyCertificateChain field's value. -func (s *GetParametersForExportOutput) SetSigningKeyCertificateChain(v string) *GetParametersForExportOutput { - s.SigningKeyCertificateChain = &v - return s -} - -type GetParametersForImportInput struct { - _ struct{} `type:"structure"` - - // The key block format type such as TR-34 or TR-31 to use during key material - // import. Import token is only required for TR-34 key import TR34_KEY_BLOCK. - // Import token is not required for TR-31 key import. - // - // KeyMaterialType is a required field - KeyMaterialType *string `type:"string" required:"true" enum:"KeyMaterialType"` - - // The wrapping key algorithm to generate a wrapping key certificate. This certificate - // wraps the key under import within the TR-34 key block cryptogram. RSA_2048 - // is the only wrapping key algorithm allowed. - // - // WrappingKeyAlgorithm is a required field - WrappingKeyAlgorithm *string `type:"string" required:"true" enum:"KeyAlgorithm"` -} - -// 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 GetParametersForImportInput) 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 GetParametersForImportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetParametersForImportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetParametersForImportInput"} - if s.KeyMaterialType == nil { - invalidParams.Add(request.NewErrParamRequired("KeyMaterialType")) - } - if s.WrappingKeyAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("WrappingKeyAlgorithm")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyMaterialType sets the KeyMaterialType field's value. -func (s *GetParametersForImportInput) SetKeyMaterialType(v string) *GetParametersForImportInput { - s.KeyMaterialType = &v - return s -} - -// SetWrappingKeyAlgorithm sets the WrappingKeyAlgorithm field's value. -func (s *GetParametersForImportInput) SetWrappingKeyAlgorithm(v string) *GetParametersForImportInput { - s.WrappingKeyAlgorithm = &v - return s -} - -type GetParametersForImportOutput struct { - _ struct{} `type:"structure"` - - // The import token to initiate key import into Amazon Web Services Payment - // Cryptography. The import token expires after 7 days. You can use the same - // import token to import multiple keys to the same service account. - // - // ImportToken is a required field - ImportToken *string `type:"string" required:"true"` - - // The validity period of the import token. - // - // ParametersValidUntilTimestamp is a required field - ParametersValidUntilTimestamp *time.Time `type:"timestamp" required:"true"` - - // The algorithm of the wrapping key for use within TR-34 key block. RSA_2048 - // is the only wrapping key algorithm allowed. - // - // WrappingKeyAlgorithm is a required field - WrappingKeyAlgorithm *string `type:"string" required:"true" enum:"KeyAlgorithm"` - - // The wrapping key certificate of the wrapping key for use within the TR-34 - // key block. The certificate expires in 7 days. - // - // WrappingKeyCertificate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetParametersForImportOutput's - // String and GoString methods. - // - // WrappingKeyCertificate is a required field - WrappingKeyCertificate *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The Amazon Web Services Payment Cryptography certificate chain that signed - // the wrapping key certificate. This is the root certificate authority (CA) - // within your service account. - // - // WrappingKeyCertificateChain is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetParametersForImportOutput's - // String and GoString methods. - // - // WrappingKeyCertificateChain is a required field - WrappingKeyCertificateChain *string `min:"1" type:"string" required:"true" sensitive:"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 GetParametersForImportOutput) 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 GetParametersForImportOutput) GoString() string { - return s.String() -} - -// SetImportToken sets the ImportToken field's value. -func (s *GetParametersForImportOutput) SetImportToken(v string) *GetParametersForImportOutput { - s.ImportToken = &v - return s -} - -// SetParametersValidUntilTimestamp sets the ParametersValidUntilTimestamp field's value. -func (s *GetParametersForImportOutput) SetParametersValidUntilTimestamp(v time.Time) *GetParametersForImportOutput { - s.ParametersValidUntilTimestamp = &v - return s -} - -// SetWrappingKeyAlgorithm sets the WrappingKeyAlgorithm field's value. -func (s *GetParametersForImportOutput) SetWrappingKeyAlgorithm(v string) *GetParametersForImportOutput { - s.WrappingKeyAlgorithm = &v - return s -} - -// SetWrappingKeyCertificate sets the WrappingKeyCertificate field's value. -func (s *GetParametersForImportOutput) SetWrappingKeyCertificate(v string) *GetParametersForImportOutput { - s.WrappingKeyCertificate = &v - return s -} - -// SetWrappingKeyCertificateChain sets the WrappingKeyCertificateChain field's value. -func (s *GetParametersForImportOutput) SetWrappingKeyCertificateChain(v string) *GetParametersForImportOutput { - s.WrappingKeyCertificateChain = &v - return s -} - -type GetPublicKeyCertificateInput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the asymmetric key pair. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" 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 GetPublicKeyCertificateInput) 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 GetPublicKeyCertificateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPublicKeyCertificateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPublicKeyCertificateInput"} - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *GetPublicKeyCertificateInput) SetKeyIdentifier(v string) *GetPublicKeyCertificateInput { - s.KeyIdentifier = &v - return s -} - -type GetPublicKeyCertificateOutput struct { - _ struct{} `type:"structure"` - - // The public key component of the asymmetric key pair in a certificate (PEM) - // format. It is signed by the root certificate authority (CA) within your service - // account. The certificate expires in 90 days. - // - // KeyCertificate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetPublicKeyCertificateOutput's - // String and GoString methods. - // - // KeyCertificate is a required field - KeyCertificate *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The certificate chain that signed the public key certificate of the asymmetric - // key pair. This is the root certificate authority (CA) within your service - // account. - // - // KeyCertificateChain is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetPublicKeyCertificateOutput's - // String and GoString methods. - // - // KeyCertificateChain is a required field - KeyCertificateChain *string `min:"1" type:"string" required:"true" sensitive:"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 GetPublicKeyCertificateOutput) 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 GetPublicKeyCertificateOutput) GoString() string { - return s.String() -} - -// SetKeyCertificate sets the KeyCertificate field's value. -func (s *GetPublicKeyCertificateOutput) SetKeyCertificate(v string) *GetPublicKeyCertificateOutput { - s.KeyCertificate = &v - return s -} - -// SetKeyCertificateChain sets the KeyCertificateChain field's value. -func (s *GetPublicKeyCertificateOutput) SetKeyCertificateChain(v string) *GetPublicKeyCertificateOutput { - s.KeyCertificateChain = &v - return s -} - -type ImportKeyInput struct { - _ struct{} `type:"structure"` - - // Specifies whether import key is enabled. - Enabled *bool `type:"boolean"` - - // The algorithm that Amazon Web Services Payment Cryptography uses to calculate - // the key check value (KCV) for DES and AES keys. - // - // For DES key, the KCV is computed by encrypting 8 bytes, each with value '00', - // with the key to be checked and retaining the 3 highest order bytes of the - // encrypted result. For AES key, the KCV is computed by encrypting 8 bytes, - // each with value '01', with the key to be checked and retaining the 3 highest - // order bytes of the encrypted result. - KeyCheckValueAlgorithm *string `type:"string" enum:"KeyCheckValueAlgorithm"` - - // The key or public key certificate type to use during key material import, - // for example TR-34 or RootCertificatePublicKey. - // - // KeyMaterial is a required field - KeyMaterial *ImportKeyMaterial `type:"structure" required:"true"` - - // The tags to attach to the key. Each tag consists of a tag key and a tag value. - // Both the tag key and the tag value are required, but the tag value can be - // an empty (null) string. You can't have more than one tag on an Amazon Web - // Services Payment Cryptography key with the same tag key. - // - // You can't have more than one tag on an Amazon Web Services Payment Cryptography - // key with the same tag key. If you specify an existing tag key with a different - // tag value, Amazon Web Services Payment Cryptography replaces the current - // tag value with the specified one. - // - // To use this parameter, you must have TagResource permission. - // - // Don't include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // Tagging or untagging an Amazon Web Services Payment Cryptography key can - // allow or deny permission to the key. - Tags []*Tag `type:"list"` -} - -// 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 ImportKeyInput) 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 ImportKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportKeyInput"} - if s.KeyMaterial == nil { - invalidParams.Add(request.NewErrParamRequired("KeyMaterial")) - } - if s.KeyMaterial != nil { - if err := s.KeyMaterial.Validate(); err != nil { - invalidParams.AddNested("KeyMaterial", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *ImportKeyInput) SetEnabled(v bool) *ImportKeyInput { - s.Enabled = &v - return s -} - -// SetKeyCheckValueAlgorithm sets the KeyCheckValueAlgorithm field's value. -func (s *ImportKeyInput) SetKeyCheckValueAlgorithm(v string) *ImportKeyInput { - s.KeyCheckValueAlgorithm = &v - return s -} - -// SetKeyMaterial sets the KeyMaterial field's value. -func (s *ImportKeyInput) SetKeyMaterial(v *ImportKeyMaterial) *ImportKeyInput { - s.KeyMaterial = v - return s -} - -// SetTags sets the Tags field's value. -func (s *ImportKeyInput) SetTags(v []*Tag) *ImportKeyInput { - s.Tags = v - return s -} - -// Parameter information for key material import. -type ImportKeyMaterial struct { - _ struct{} `type:"structure"` - - // Parameter information for root public key certificate import. - RootCertificatePublicKey *RootCertificatePublicKey `type:"structure"` - - // Parameter information for key material import using TR-31 standard. - Tr31KeyBlock *ImportTr31KeyBlock `type:"structure"` - - // Parameter information for key material import using TR-34 standard. - Tr34KeyBlock *ImportTr34KeyBlock `type:"structure"` - - // Parameter information for trusted public key certificate import. - TrustedCertificatePublicKey *TrustedCertificatePublicKey `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 ImportKeyMaterial) 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 ImportKeyMaterial) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportKeyMaterial) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportKeyMaterial"} - if s.RootCertificatePublicKey != nil { - if err := s.RootCertificatePublicKey.Validate(); err != nil { - invalidParams.AddNested("RootCertificatePublicKey", err.(request.ErrInvalidParams)) - } - } - if s.Tr31KeyBlock != nil { - if err := s.Tr31KeyBlock.Validate(); err != nil { - invalidParams.AddNested("Tr31KeyBlock", err.(request.ErrInvalidParams)) - } - } - if s.Tr34KeyBlock != nil { - if err := s.Tr34KeyBlock.Validate(); err != nil { - invalidParams.AddNested("Tr34KeyBlock", err.(request.ErrInvalidParams)) - } - } - if s.TrustedCertificatePublicKey != nil { - if err := s.TrustedCertificatePublicKey.Validate(); err != nil { - invalidParams.AddNested("TrustedCertificatePublicKey", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRootCertificatePublicKey sets the RootCertificatePublicKey field's value. -func (s *ImportKeyMaterial) SetRootCertificatePublicKey(v *RootCertificatePublicKey) *ImportKeyMaterial { - s.RootCertificatePublicKey = v - return s -} - -// SetTr31KeyBlock sets the Tr31KeyBlock field's value. -func (s *ImportKeyMaterial) SetTr31KeyBlock(v *ImportTr31KeyBlock) *ImportKeyMaterial { - s.Tr31KeyBlock = v - return s -} - -// SetTr34KeyBlock sets the Tr34KeyBlock field's value. -func (s *ImportKeyMaterial) SetTr34KeyBlock(v *ImportTr34KeyBlock) *ImportKeyMaterial { - s.Tr34KeyBlock = v - return s -} - -// SetTrustedCertificatePublicKey sets the TrustedCertificatePublicKey field's value. -func (s *ImportKeyMaterial) SetTrustedCertificatePublicKey(v *TrustedCertificatePublicKey) *ImportKeyMaterial { - s.TrustedCertificatePublicKey = v - return s -} - -type ImportKeyOutput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the key material imported within Amazon Web Services Payment - // Cryptography. - // - // Key is a required field - Key *Key `type:"structure" 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 ImportKeyOutput) 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 ImportKeyOutput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *ImportKeyOutput) SetKey(v *Key) *ImportKeyOutput { - s.Key = v - return s -} - -// Parameter information for key material import using TR-31 standard. -type ImportTr31KeyBlock struct { - _ struct{} `type:"structure"` - - // The TR-34 wrapped key block to import. - // - // WrappedKeyBlock is a required field - WrappedKeyBlock *string `min:"56" type:"string" required:"true"` - - // The KeyARN of the key that will decrypt or unwrap a TR-31 key block during - // import. - // - // WrappingKeyIdentifier is a required field - WrappingKeyIdentifier *string `min:"7" 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 ImportTr31KeyBlock) 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 ImportTr31KeyBlock) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportTr31KeyBlock) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportTr31KeyBlock"} - if s.WrappedKeyBlock == nil { - invalidParams.Add(request.NewErrParamRequired("WrappedKeyBlock")) - } - if s.WrappedKeyBlock != nil && len(*s.WrappedKeyBlock) < 56 { - invalidParams.Add(request.NewErrParamMinLen("WrappedKeyBlock", 56)) - } - if s.WrappingKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("WrappingKeyIdentifier")) - } - if s.WrappingKeyIdentifier != nil && len(*s.WrappingKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("WrappingKeyIdentifier", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWrappedKeyBlock sets the WrappedKeyBlock field's value. -func (s *ImportTr31KeyBlock) SetWrappedKeyBlock(v string) *ImportTr31KeyBlock { - s.WrappedKeyBlock = &v - return s -} - -// SetWrappingKeyIdentifier sets the WrappingKeyIdentifier field's value. -func (s *ImportTr31KeyBlock) SetWrappingKeyIdentifier(v string) *ImportTr31KeyBlock { - s.WrappingKeyIdentifier = &v - return s -} - -// Parameter information for key material import using TR-34 standard. -type ImportTr34KeyBlock struct { - _ struct{} `type:"structure"` - - // The KeyARN of the certificate chain that signs the signing key certificate - // during TR-34 key import. - // - // CertificateAuthorityPublicKeyIdentifier is a required field - CertificateAuthorityPublicKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The import token that initiates key import into Amazon Web Services Payment - // Cryptography. It expires after 7 days. You can use the same import token - // to import multiple keys to the same service account. - // - // ImportToken is a required field - ImportToken *string `type:"string" required:"true"` - - // The key block format to use during key import. The only value allowed is - // X9_TR34_2012. - // - // KeyBlockFormat is a required field - KeyBlockFormat *string `type:"string" required:"true" enum:"Tr34KeyBlockFormat"` - - // A random number value that is unique to the TR-34 key block generated using - // 2 pass. The operation will fail, if a random nonce value is not provided - // for a TR-34 key block generated using 2 pass. - RandomNonce *string `min:"16" type:"string"` - - // The public key component in PEM certificate format of the private key that - // signs the KDH TR-34 wrapped key block. - // - // SigningKeyCertificate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ImportTr34KeyBlock's - // String and GoString methods. - // - // SigningKeyCertificate is a required field - SigningKeyCertificate *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The TR-34 wrapped key block to import. - // - // WrappedKeyBlock is a required field - WrappedKeyBlock *string `min:"2" 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 ImportTr34KeyBlock) 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 ImportTr34KeyBlock) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportTr34KeyBlock) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportTr34KeyBlock"} - if s.CertificateAuthorityPublicKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateAuthorityPublicKeyIdentifier")) - } - if s.CertificateAuthorityPublicKeyIdentifier != nil && len(*s.CertificateAuthorityPublicKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("CertificateAuthorityPublicKeyIdentifier", 7)) - } - if s.ImportToken == nil { - invalidParams.Add(request.NewErrParamRequired("ImportToken")) - } - if s.KeyBlockFormat == nil { - invalidParams.Add(request.NewErrParamRequired("KeyBlockFormat")) - } - if s.RandomNonce != nil && len(*s.RandomNonce) < 16 { - invalidParams.Add(request.NewErrParamMinLen("RandomNonce", 16)) - } - if s.SigningKeyCertificate == nil { - invalidParams.Add(request.NewErrParamRequired("SigningKeyCertificate")) - } - if s.SigningKeyCertificate != nil && len(*s.SigningKeyCertificate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SigningKeyCertificate", 1)) - } - if s.WrappedKeyBlock == nil { - invalidParams.Add(request.NewErrParamRequired("WrappedKeyBlock")) - } - if s.WrappedKeyBlock != nil && len(*s.WrappedKeyBlock) < 2 { - invalidParams.Add(request.NewErrParamMinLen("WrappedKeyBlock", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateAuthorityPublicKeyIdentifier sets the CertificateAuthorityPublicKeyIdentifier field's value. -func (s *ImportTr34KeyBlock) SetCertificateAuthorityPublicKeyIdentifier(v string) *ImportTr34KeyBlock { - s.CertificateAuthorityPublicKeyIdentifier = &v - return s -} - -// SetImportToken sets the ImportToken field's value. -func (s *ImportTr34KeyBlock) SetImportToken(v string) *ImportTr34KeyBlock { - s.ImportToken = &v - return s -} - -// SetKeyBlockFormat sets the KeyBlockFormat field's value. -func (s *ImportTr34KeyBlock) SetKeyBlockFormat(v string) *ImportTr34KeyBlock { - s.KeyBlockFormat = &v - return s -} - -// SetRandomNonce sets the RandomNonce field's value. -func (s *ImportTr34KeyBlock) SetRandomNonce(v string) *ImportTr34KeyBlock { - s.RandomNonce = &v - return s -} - -// SetSigningKeyCertificate sets the SigningKeyCertificate field's value. -func (s *ImportTr34KeyBlock) SetSigningKeyCertificate(v string) *ImportTr34KeyBlock { - s.SigningKeyCertificate = &v - return s -} - -// SetWrappedKeyBlock sets the WrappedKeyBlock field's value. -func (s *ImportTr34KeyBlock) SetWrappedKeyBlock(v string) *ImportTr34KeyBlock { - s.WrappedKeyBlock = &v - return s -} - -// The request processing has failed because of an unknown error, exception, -// or failure. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Metadata about an Amazon Web Services Payment Cryptography key. -type Key struct { - _ struct{} `type:"structure"` - - // The date and time when the key was created. - // - // CreateTimestamp is a required field - CreateTimestamp *time.Time `type:"timestamp" required:"true"` - - // The date and time after which Amazon Web Services Payment Cryptography will - // delete the key. This value is present only when KeyState is DELETE_PENDING - // and the key is scheduled for deletion. - DeletePendingTimestamp *time.Time `type:"timestamp"` - - // The date and time after which Amazon Web Services Payment Cryptography will - // delete the key. This value is present only when when the KeyState is DELETE_COMPLETE - // and the Amazon Web Services Payment Cryptography key is deleted. - DeleteTimestamp *time.Time `type:"timestamp"` - - // Specifies whether the key is enabled. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // Specifies whether the key is exportable. This data is immutable after the - // key is created. - // - // Exportable is a required field - Exportable *bool `type:"boolean" required:"true"` - - // The Amazon Resource Name (ARN) of the key. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The role of the key, the algorithm it supports, and the cryptographic operations - // allowed with the key. This data is immutable after the key is created. - // - // KeyAttributes is a required field - KeyAttributes *KeyAttributes `type:"structure" required:"true"` - - // The key check value (KCV) is used to check if all parties holding a given - // key have the same key or to detect that a key has changed. Amazon Web Services - // Payment Cryptography calculates the KCV by using standard algorithms, typically - // by encrypting 8 or 16 bytes or "00" or "01" and then truncating the result - // to the first 3 bytes, or 6 hex digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The algorithm used for calculating key check value (KCV) for DES and AES - // keys. For a DES key, Amazon Web Services Payment Cryptography computes the - // KCV by encrypting 8 bytes, each with value '00', with the key to be checked - // and retaining the 3 highest order bytes of the encrypted result. For an AES - // key, Amazon Web Services Payment Cryptography computes the KCV by encrypting - // 8 bytes, each with value '01', with the key to be checked and retaining the - // 3 highest order bytes of the encrypted result. - // - // KeyCheckValueAlgorithm is a required field - KeyCheckValueAlgorithm *string `type:"string" required:"true" enum:"KeyCheckValueAlgorithm"` - - // The source of the key material. For keys created within Amazon Web Services - // Payment Cryptography, the value is AWS_PAYMENT_CRYPTOGRAPHY. For keys imported - // into Amazon Web Services Payment Cryptography, the value is EXTERNAL. - // - // KeyOrigin is a required field - KeyOrigin *string `type:"string" required:"true" enum:"KeyOrigin"` - - // The state of key that is being created or deleted. - // - // KeyState is a required field - KeyState *string `type:"string" required:"true" enum:"KeyState"` - - // The date and time after which Amazon Web Services Payment Cryptography will - // start using the key material for cryptographic operations. - UsageStartTimestamp *time.Time `type:"timestamp"` - - // The date and time after which Amazon Web Services Payment Cryptography will - // stop using the key material for cryptographic operations. - UsageStopTimestamp *time.Time `type:"timestamp"` -} - -// 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 Key) 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 Key) GoString() string { - return s.String() -} - -// SetCreateTimestamp sets the CreateTimestamp field's value. -func (s *Key) SetCreateTimestamp(v time.Time) *Key { - s.CreateTimestamp = &v - return s -} - -// SetDeletePendingTimestamp sets the DeletePendingTimestamp field's value. -func (s *Key) SetDeletePendingTimestamp(v time.Time) *Key { - s.DeletePendingTimestamp = &v - return s -} - -// SetDeleteTimestamp sets the DeleteTimestamp field's value. -func (s *Key) SetDeleteTimestamp(v time.Time) *Key { - s.DeleteTimestamp = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *Key) SetEnabled(v bool) *Key { - s.Enabled = &v - return s -} - -// SetExportable sets the Exportable field's value. -func (s *Key) SetExportable(v bool) *Key { - s.Exportable = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *Key) SetKeyArn(v string) *Key { - s.KeyArn = &v - return s -} - -// SetKeyAttributes sets the KeyAttributes field's value. -func (s *Key) SetKeyAttributes(v *KeyAttributes) *Key { - s.KeyAttributes = v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *Key) SetKeyCheckValue(v string) *Key { - s.KeyCheckValue = &v - return s -} - -// SetKeyCheckValueAlgorithm sets the KeyCheckValueAlgorithm field's value. -func (s *Key) SetKeyCheckValueAlgorithm(v string) *Key { - s.KeyCheckValueAlgorithm = &v - return s -} - -// SetKeyOrigin sets the KeyOrigin field's value. -func (s *Key) SetKeyOrigin(v string) *Key { - s.KeyOrigin = &v - return s -} - -// SetKeyState sets the KeyState field's value. -func (s *Key) SetKeyState(v string) *Key { - s.KeyState = &v - return s -} - -// SetUsageStartTimestamp sets the UsageStartTimestamp field's value. -func (s *Key) SetUsageStartTimestamp(v time.Time) *Key { - s.UsageStartTimestamp = &v - return s -} - -// SetUsageStopTimestamp sets the UsageStopTimestamp field's value. -func (s *Key) SetUsageStopTimestamp(v time.Time) *Key { - s.UsageStopTimestamp = &v - return s -} - -// The role of the key, the algorithm it supports, and the cryptographic operations -// allowed with the key. This data is immutable after the key is created. -type KeyAttributes struct { - _ struct{} `type:"structure"` - - // The key algorithm to be use during creation of an Amazon Web Services Payment - // Cryptography key. - // - // For symmetric keys, Amazon Web Services Payment Cryptography supports AES - // and TDES algorithms. For asymmetric keys, Amazon Web Services Payment Cryptography - // supports RSA and ECC_NIST algorithms. - // - // KeyAlgorithm is a required field - KeyAlgorithm *string `type:"string" required:"true" enum:"KeyAlgorithm"` - - // The type of Amazon Web Services Payment Cryptography key to create, which - // determines the classification of the cryptographic method and whether Amazon - // Web Services Payment Cryptography key contains a symmetric key or an asymmetric - // key pair. - // - // KeyClass is a required field - KeyClass *string `type:"string" required:"true" enum:"KeyClass"` - - // The list of cryptographic operations that you can perform using the key. - // - // KeyModesOfUse is a required field - KeyModesOfUse *KeyModesOfUse `type:"structure" required:"true"` - - // The cryptographic usage of an Amazon Web Services Payment Cryptography key - // as defined in section A.5.2 of the TR-31 spec. - // - // KeyUsage is a required field - KeyUsage *string `type:"string" required:"true" enum:"KeyUsage"` -} - -// 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 KeyAttributes) 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 KeyAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KeyAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KeyAttributes"} - if s.KeyAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("KeyAlgorithm")) - } - if s.KeyClass == nil { - invalidParams.Add(request.NewErrParamRequired("KeyClass")) - } - if s.KeyModesOfUse == nil { - invalidParams.Add(request.NewErrParamRequired("KeyModesOfUse")) - } - if s.KeyUsage == nil { - invalidParams.Add(request.NewErrParamRequired("KeyUsage")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyAlgorithm sets the KeyAlgorithm field's value. -func (s *KeyAttributes) SetKeyAlgorithm(v string) *KeyAttributes { - s.KeyAlgorithm = &v - return s -} - -// SetKeyClass sets the KeyClass field's value. -func (s *KeyAttributes) SetKeyClass(v string) *KeyAttributes { - s.KeyClass = &v - return s -} - -// SetKeyModesOfUse sets the KeyModesOfUse field's value. -func (s *KeyAttributes) SetKeyModesOfUse(v *KeyModesOfUse) *KeyAttributes { - s.KeyModesOfUse = v - return s -} - -// SetKeyUsage sets the KeyUsage field's value. -func (s *KeyAttributes) SetKeyUsage(v string) *KeyAttributes { - s.KeyUsage = &v - return s -} - -// The list of cryptographic operations that you can perform using the key. -// The modes of use are defined in section A.5.3 of the TR-31 spec. -type KeyModesOfUse struct { - _ struct{} `type:"structure"` - - // Specifies whether an Amazon Web Services Payment Cryptography key can be - // used to decrypt data. - Decrypt *bool `type:"boolean"` - - // Specifies whether an Amazon Web Services Payment Cryptography key can be - // used to derive new keys. - DeriveKey *bool `type:"boolean"` - - // Specifies whether an Amazon Web Services Payment Cryptography key can be - // used to encrypt data. - Encrypt *bool `type:"boolean"` - - // Specifies whether an Amazon Web Services Payment Cryptography key can be - // used to generate and verify other card and PIN verification keys. - Generate *bool `type:"boolean"` - - // Specifies whether an Amazon Web Services Payment Cryptography key has no - // special restrictions other than the restrictions implied by KeyUsage. - NoRestrictions *bool `type:"boolean"` - - // Specifies whether an Amazon Web Services Payment Cryptography key can be - // used for signing. - Sign *bool `type:"boolean"` - - // Specifies whether an Amazon Web Services Payment Cryptography key can be - // used to unwrap other keys. - Unwrap *bool `type:"boolean"` - - // Specifies whether an Amazon Web Services Payment Cryptography key can be - // used to verify signatures. - Verify *bool `type:"boolean"` - - // Specifies whether an Amazon Web Services Payment Cryptography key can be - // used to wrap other keys. - Wrap *bool `type:"boolean"` -} - -// 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 KeyModesOfUse) 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 KeyModesOfUse) GoString() string { - return s.String() -} - -// SetDecrypt sets the Decrypt field's value. -func (s *KeyModesOfUse) SetDecrypt(v bool) *KeyModesOfUse { - s.Decrypt = &v - return s -} - -// SetDeriveKey sets the DeriveKey field's value. -func (s *KeyModesOfUse) SetDeriveKey(v bool) *KeyModesOfUse { - s.DeriveKey = &v - return s -} - -// SetEncrypt sets the Encrypt field's value. -func (s *KeyModesOfUse) SetEncrypt(v bool) *KeyModesOfUse { - s.Encrypt = &v - return s -} - -// SetGenerate sets the Generate field's value. -func (s *KeyModesOfUse) SetGenerate(v bool) *KeyModesOfUse { - s.Generate = &v - return s -} - -// SetNoRestrictions sets the NoRestrictions field's value. -func (s *KeyModesOfUse) SetNoRestrictions(v bool) *KeyModesOfUse { - s.NoRestrictions = &v - return s -} - -// SetSign sets the Sign field's value. -func (s *KeyModesOfUse) SetSign(v bool) *KeyModesOfUse { - s.Sign = &v - return s -} - -// SetUnwrap sets the Unwrap field's value. -func (s *KeyModesOfUse) SetUnwrap(v bool) *KeyModesOfUse { - s.Unwrap = &v - return s -} - -// SetVerify sets the Verify field's value. -func (s *KeyModesOfUse) SetVerify(v bool) *KeyModesOfUse { - s.Verify = &v - return s -} - -// SetWrap sets the Wrap field's value. -func (s *KeyModesOfUse) SetWrap(v bool) *KeyModesOfUse { - s.Wrap = &v - return s -} - -// Metadata about an Amazon Web Services Payment Cryptography key. -type KeySummary struct { - _ struct{} `type:"structure"` - - // Specifies whether the key is enabled. - // - // Enabled is a required field - Enabled *bool `type:"boolean" required:"true"` - - // Specifies whether the key is exportable. This data is immutable after the - // key is created. - // - // Exportable is a required field - Exportable *bool `type:"boolean" required:"true"` - - // The Amazon Resource Name (ARN) of the key. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The role of the key, the algorithm it supports, and the cryptographic operations - // allowed with the key. This data is immutable after the key is created. - // - // KeyAttributes is a required field - KeyAttributes *KeyAttributes `type:"structure" required:"true"` - - // The key check value (KCV) is used to check if all parties holding a given - // key have the same key or to detect that a key has changed. Amazon Web Services - // Payment Cryptography calculates the KCV by using standard algorithms, typically - // by encrypting 8 or 16 bytes or "00" or "01" and then truncating the result - // to the first 3 bytes, or 6 hex digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The state of an Amazon Web Services Payment Cryptography that is being created - // or deleted. - // - // KeyState is a required field - KeyState *string `type:"string" required:"true" enum:"KeyState"` -} - -// 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 KeySummary) 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 KeySummary) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *KeySummary) SetEnabled(v bool) *KeySummary { - s.Enabled = &v - return s -} - -// SetExportable sets the Exportable field's value. -func (s *KeySummary) SetExportable(v bool) *KeySummary { - s.Exportable = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *KeySummary) SetKeyArn(v string) *KeySummary { - s.KeyArn = &v - return s -} - -// SetKeyAttributes sets the KeyAttributes field's value. -func (s *KeySummary) SetKeyAttributes(v *KeyAttributes) *KeySummary { - s.KeyAttributes = v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *KeySummary) SetKeyCheckValue(v string) *KeySummary { - s.KeyCheckValue = &v - return s -} - -// SetKeyState sets the KeyState field's value. -func (s *KeySummary) SetKeyState(v string) *KeySummary { - s.KeyState = &v - return s -} - -type ListAliasesInput struct { - _ struct{} `type:"structure"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, Amazon Web Services Payment Cryptography does not - // return more than the specified number of items, but it might return fewer. - // - // This value is optional. If you include a value, it must be between 1 and - // 100, inclusive. If you do not include a value, it defaults to 50. - MaxResults *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextToken from the truncated response - // you just received. - NextToken *string `min:"1" 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 ListAliasesInput) 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 ListAliasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAliasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAliasesInput) SetMaxResults(v int64) *ListAliasesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAliasesInput) SetNextToken(v string) *ListAliasesInput { - s.NextToken = &v - return s -} - -type ListAliasesOutput struct { - _ struct{} `type:"structure"` - - // The list of aliases. Each alias describes the KeyArn contained within. - // - // Aliases is a required field - Aliases []*Alias `type:"list" required:"true"` - - // The token for the next set of results, or an empty or null value if there - // are no more results. - NextToken *string `min:"1" 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 ListAliasesOutput) 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 ListAliasesOutput) GoString() string { - return s.String() -} - -// SetAliases sets the Aliases field's value. -func (s *ListAliasesOutput) SetAliases(v []*Alias) *ListAliasesOutput { - s.Aliases = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAliasesOutput) SetNextToken(v string) *ListAliasesOutput { - s.NextToken = &v - return s -} - -type ListKeysInput struct { - _ struct{} `type:"structure"` - - // The key state of the keys you want to list. - KeyState *string `type:"string" enum:"KeyState"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, Amazon Web Services Payment Cryptography does not - // return more than the specified number of items, but it might return fewer. - MaxResults *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextToken from the truncated response - // you just received. - NextToken *string `min:"1" 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 ListKeysInput) 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 ListKeysInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListKeysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListKeysInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyState sets the KeyState field's value. -func (s *ListKeysInput) SetKeyState(v string) *ListKeysInput { - s.KeyState = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListKeysInput) SetMaxResults(v int64) *ListKeysInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListKeysInput) SetNextToken(v string) *ListKeysInput { - s.NextToken = &v - return s -} - -type ListKeysOutput struct { - _ struct{} `type:"structure"` - - // The list of keys created within the caller's Amazon Web Services account - // and Amazon Web Services Region. - // - // Keys is a required field - Keys []*KeySummary `type:"list" required:"true"` - - // The token for the next set of results, or an empty or null value if there - // are no more results. - NextToken *string `min:"1" 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 ListKeysOutput) 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 ListKeysOutput) GoString() string { - return s.String() -} - -// SetKeys sets the Keys field's value. -func (s *ListKeysOutput) SetKeys(v []*KeySummary) *ListKeysOutput { - s.Keys = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListKeysOutput) SetNextToken(v string) *ListKeysOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // Use this parameter to specify the maximum number of items to return. When - // this value is present, Amazon Web Services Payment Cryptography does not - // return more than the specified number of items, but it might return fewer. - MaxResults *int64 `min:"1" type:"integer"` - - // Use this parameter in a subsequent request after you receive a response with - // truncated results. Set it to the value of NextToken from the truncated response - // you just received. - NextToken *string `min:"1" type:"string"` - - // The KeyARN of the key whose tags you are getting. - // - // ResourceArn is a required field - ResourceArn *string `min:"70" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 70 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 70)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTagsForResourceInput) SetMaxResults(v int64) *ListTagsForResourceInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { - s.NextToken = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results, or an empty or null value if there - // are no more results. - NextToken *string `min:"1" type:"string"` - - // The list of tags associated with a ResourceArn. Each tag will list the key-value - // pair contained within that tag. - // - // Tags is a required field - Tags []*Tag `type:"list" 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { - s.NextToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// The request was denied due to an invalid resource error. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The string for the exception. - ResourceId *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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type RestoreKeyInput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the key to be restored within Amazon Web Services Payment Cryptography. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" 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 RestoreKeyInput) 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 RestoreKeyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreKeyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreKeyInput"} - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *RestoreKeyInput) SetKeyIdentifier(v string) *RestoreKeyInput { - s.KeyIdentifier = &v - return s -} - -type RestoreKeyOutput struct { - _ struct{} `type:"structure"` - - // The key material of the restored key. The KeyState will change to CREATE_COMPLETE - // and value for DeletePendingTimestamp gets removed. - // - // Key is a required field - Key *Key `type:"structure" 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 RestoreKeyOutput) 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 RestoreKeyOutput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *RestoreKeyOutput) SetKey(v *Key) *RestoreKeyOutput { - s.Key = v - return s -} - -// Parameter information for root public key certificate import. -type RootCertificatePublicKey struct { - _ struct{} `type:"structure"` - - // The role of the key, the algorithm it supports, and the cryptographic operations - // allowed with the key. This data is immutable after the root public key is - // imported. - // - // KeyAttributes is a required field - KeyAttributes *KeyAttributes `type:"structure" required:"true"` - - // Parameter information for root public key certificate import. - // - // PublicKeyCertificate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RootCertificatePublicKey's - // String and GoString methods. - // - // PublicKeyCertificate is a required field - PublicKeyCertificate *string `min:"1" type:"string" required:"true" sensitive:"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 RootCertificatePublicKey) 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 RootCertificatePublicKey) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RootCertificatePublicKey) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RootCertificatePublicKey"} - if s.KeyAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("KeyAttributes")) - } - if s.PublicKeyCertificate == nil { - invalidParams.Add(request.NewErrParamRequired("PublicKeyCertificate")) - } - if s.PublicKeyCertificate != nil && len(*s.PublicKeyCertificate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PublicKeyCertificate", 1)) - } - if s.KeyAttributes != nil { - if err := s.KeyAttributes.Validate(); err != nil { - invalidParams.AddNested("KeyAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyAttributes sets the KeyAttributes field's value. -func (s *RootCertificatePublicKey) SetKeyAttributes(v *KeyAttributes) *RootCertificatePublicKey { - s.KeyAttributes = v - return s -} - -// SetPublicKeyCertificate sets the PublicKeyCertificate field's value. -func (s *RootCertificatePublicKey) SetPublicKeyCertificate(v string) *RootCertificatePublicKey { - s.PublicKeyCertificate = &v - return s -} - -// This request would cause a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The service cannot complete the request. -type ServiceUnavailableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ServiceUnavailableException) 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 ServiceUnavailableException) GoString() string { - return s.String() -} - -func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { - return &ServiceUnavailableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceUnavailableException) Code() string { - return "ServiceUnavailableException" -} - -// Message returns the exception's message. -func (s *ServiceUnavailableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceUnavailableException) OrigErr() error { - return nil -} - -func (s *ServiceUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceUnavailableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceUnavailableException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartKeyUsageInput struct { - _ struct{} `type:"structure"` - - // The KeyArn of the key. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" 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 StartKeyUsageInput) 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 StartKeyUsageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartKeyUsageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartKeyUsageInput"} - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *StartKeyUsageInput) SetKeyIdentifier(v string) *StartKeyUsageInput { - s.KeyIdentifier = &v - return s -} - -type StartKeyUsageOutput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the Amazon Web Services Payment Cryptography key activated - // for use. - // - // Key is a required field - Key *Key `type:"structure" 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 StartKeyUsageOutput) 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 StartKeyUsageOutput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *StartKeyUsageOutput) SetKey(v *Key) *StartKeyUsageOutput { - s.Key = v - return s -} - -type StopKeyUsageInput struct { - _ struct{} `type:"structure"` - - // The KeyArn of the key. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" 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 StopKeyUsageInput) 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 StopKeyUsageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopKeyUsageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopKeyUsageInput"} - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *StopKeyUsageInput) SetKeyIdentifier(v string) *StopKeyUsageInput { - s.KeyIdentifier = &v - return s -} - -type StopKeyUsageOutput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the key. - // - // Key is a required field - Key *Key `type:"structure" 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 StopKeyUsageOutput) 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 StopKeyUsageOutput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *StopKeyUsageOutput) SetKey(v *Key) *StopKeyUsageOutput { - s.Key = v - return s -} - -// A structure that contains information about a tag. -type Tag struct { - _ struct{} `type:"structure"` - - // The key of the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value of the tag. - Value *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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the key whose tags are being updated. - // - // ResourceArn is a required field - ResourceArn *string `min:"70" type:"string" required:"true"` - - // One or more tags. Each tag consists of a tag key and a tag value. The tag - // value can be an empty (null) string. You can't have more than one tag on - // an Amazon Web Services Payment Cryptography key with the same tag key. If - // you specify an existing tag key with a different tag value, Amazon Web Services - // Payment Cryptography replaces the current tag value with the new one. - // - // Don't include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // To use this parameter, you must have TagResource permission in an IAM policy. - // - // Don't include confidential or sensitive information in this field. This field - // may be displayed in plaintext in CloudTrail logs and other output. - // - // Tags is a required field - Tags []*Tag `type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 70 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 70)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Parameter information for trusted public key certificate import. -type TrustedCertificatePublicKey struct { - _ struct{} `type:"structure"` - - // The KeyARN of the root public key certificate or certificate chain that signs - // the trusted public key certificate import. - // - // CertificateAuthorityPublicKeyIdentifier is a required field - CertificateAuthorityPublicKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The role of the key, the algorithm it supports, and the cryptographic operations - // allowed with the key. This data is immutable after a trusted public key is - // imported. - // - // KeyAttributes is a required field - KeyAttributes *KeyAttributes `type:"structure" required:"true"` - - // Parameter information for trusted public key certificate import. - // - // PublicKeyCertificate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TrustedCertificatePublicKey's - // String and GoString methods. - // - // PublicKeyCertificate is a required field - PublicKeyCertificate *string `min:"1" type:"string" required:"true" sensitive:"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 TrustedCertificatePublicKey) 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 TrustedCertificatePublicKey) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TrustedCertificatePublicKey) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TrustedCertificatePublicKey"} - if s.CertificateAuthorityPublicKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateAuthorityPublicKeyIdentifier")) - } - if s.CertificateAuthorityPublicKeyIdentifier != nil && len(*s.CertificateAuthorityPublicKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("CertificateAuthorityPublicKeyIdentifier", 7)) - } - if s.KeyAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("KeyAttributes")) - } - if s.PublicKeyCertificate == nil { - invalidParams.Add(request.NewErrParamRequired("PublicKeyCertificate")) - } - if s.PublicKeyCertificate != nil && len(*s.PublicKeyCertificate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PublicKeyCertificate", 1)) - } - if s.KeyAttributes != nil { - if err := s.KeyAttributes.Validate(); err != nil { - invalidParams.AddNested("KeyAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateAuthorityPublicKeyIdentifier sets the CertificateAuthorityPublicKeyIdentifier field's value. -func (s *TrustedCertificatePublicKey) SetCertificateAuthorityPublicKeyIdentifier(v string) *TrustedCertificatePublicKey { - s.CertificateAuthorityPublicKeyIdentifier = &v - return s -} - -// SetKeyAttributes sets the KeyAttributes field's value. -func (s *TrustedCertificatePublicKey) SetKeyAttributes(v *KeyAttributes) *TrustedCertificatePublicKey { - s.KeyAttributes = v - return s -} - -// SetPublicKeyCertificate sets the PublicKeyCertificate field's value. -func (s *TrustedCertificatePublicKey) SetPublicKeyCertificate(v string) *TrustedCertificatePublicKey { - s.PublicKeyCertificate = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The KeyARN of the key whose tags are being removed. - // - // ResourceArn is a required field - ResourceArn *string `min:"70" type:"string" required:"true"` - - // One or more tag keys. Don't include the tag values. - // - // If the Amazon Web Services Payment Cryptography key doesn't have the specified - // tag key, Amazon Web Services Payment Cryptography doesn't throw an exception - // or return a response. To confirm that the operation succeeded, use the ListTagsForResource - // operation. - // - // TagKeys is a required field - TagKeys []*string `type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 70 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 70)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateAliasInput struct { - _ struct{} `type:"structure"` - - // The alias whose associated key is changing. - // - // AliasName is a required field - AliasName *string `min:"7" type:"string" required:"true"` - - // The KeyARN for the key that you are updating or removing from the alias. - KeyArn *string `min:"70" 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 UpdateAliasInput) 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 UpdateAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"} - if s.AliasName == nil { - invalidParams.Add(request.NewErrParamRequired("AliasName")) - } - if s.AliasName != nil && len(*s.AliasName) < 7 { - invalidParams.Add(request.NewErrParamMinLen("AliasName", 7)) - } - if s.KeyArn != nil && len(*s.KeyArn) < 70 { - invalidParams.Add(request.NewErrParamMinLen("KeyArn", 70)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAliasName sets the AliasName field's value. -func (s *UpdateAliasInput) SetAliasName(v string) *UpdateAliasInput { - s.AliasName = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *UpdateAliasInput) SetKeyArn(v string) *UpdateAliasInput { - s.KeyArn = &v - return s -} - -type UpdateAliasOutput struct { - _ struct{} `type:"structure"` - - // The alias name. - // - // Alias is a required field - Alias *Alias `type:"structure" 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 UpdateAliasOutput) 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 UpdateAliasOutput) GoString() string { - return s.String() -} - -// SetAlias sets the Alias field's value. -func (s *UpdateAliasOutput) SetAlias(v *Alias) *UpdateAliasOutput { - s.Alias = v - return s -} - -// The request was denied due to an invalid request error. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Parameter information for generating a wrapped key using TR-31 or TR-34 standard. -type WrappedKey struct { - _ struct{} `type:"structure"` - - // Parameter information for generating a wrapped key using TR-31 or TR-34 standard. - // - // KeyMaterial is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by WrappedKey's - // String and GoString methods. - // - // KeyMaterial is a required field - KeyMaterial *string `min:"48" type:"string" required:"true" sensitive:"true"` - - // The key block format of a wrapped key. - // - // WrappedKeyMaterialFormat is a required field - WrappedKeyMaterialFormat *string `type:"string" required:"true" enum:"WrappedKeyMaterialFormat"` - - // The KeyARN of the wrapped key. - // - // WrappingKeyArn is a required field - WrappingKeyArn *string `min:"70" 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 WrappedKey) 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 WrappedKey) GoString() string { - return s.String() -} - -// SetKeyMaterial sets the KeyMaterial field's value. -func (s *WrappedKey) SetKeyMaterial(v string) *WrappedKey { - s.KeyMaterial = &v - return s -} - -// SetWrappedKeyMaterialFormat sets the WrappedKeyMaterialFormat field's value. -func (s *WrappedKey) SetWrappedKeyMaterialFormat(v string) *WrappedKey { - s.WrappedKeyMaterialFormat = &v - return s -} - -// SetWrappingKeyArn sets the WrappingKeyArn field's value. -func (s *WrappedKey) SetWrappingKeyArn(v string) *WrappedKey { - s.WrappingKeyArn = &v - return s -} - -const ( - // KeyAlgorithmTdes2key is a KeyAlgorithm enum value - KeyAlgorithmTdes2key = "TDES_2KEY" - - // KeyAlgorithmTdes3key is a KeyAlgorithm enum value - KeyAlgorithmTdes3key = "TDES_3KEY" - - // KeyAlgorithmAes128 is a KeyAlgorithm enum value - KeyAlgorithmAes128 = "AES_128" - - // KeyAlgorithmAes192 is a KeyAlgorithm enum value - KeyAlgorithmAes192 = "AES_192" - - // KeyAlgorithmAes256 is a KeyAlgorithm enum value - KeyAlgorithmAes256 = "AES_256" - - // KeyAlgorithmRsa2048 is a KeyAlgorithm enum value - KeyAlgorithmRsa2048 = "RSA_2048" - - // KeyAlgorithmRsa3072 is a KeyAlgorithm enum value - KeyAlgorithmRsa3072 = "RSA_3072" - - // KeyAlgorithmRsa4096 is a KeyAlgorithm enum value - KeyAlgorithmRsa4096 = "RSA_4096" -) - -// KeyAlgorithm_Values returns all elements of the KeyAlgorithm enum -func KeyAlgorithm_Values() []string { - return []string{ - KeyAlgorithmTdes2key, - KeyAlgorithmTdes3key, - KeyAlgorithmAes128, - KeyAlgorithmAes192, - KeyAlgorithmAes256, - KeyAlgorithmRsa2048, - KeyAlgorithmRsa3072, - KeyAlgorithmRsa4096, - } -} - -const ( - // KeyCheckValueAlgorithmCmac is a KeyCheckValueAlgorithm enum value - KeyCheckValueAlgorithmCmac = "CMAC" - - // KeyCheckValueAlgorithmAnsiX924 is a KeyCheckValueAlgorithm enum value - KeyCheckValueAlgorithmAnsiX924 = "ANSI_X9_24" -) - -// KeyCheckValueAlgorithm_Values returns all elements of the KeyCheckValueAlgorithm enum -func KeyCheckValueAlgorithm_Values() []string { - return []string{ - KeyCheckValueAlgorithmCmac, - KeyCheckValueAlgorithmAnsiX924, - } -} - -const ( - // KeyClassSymmetricKey is a KeyClass enum value - KeyClassSymmetricKey = "SYMMETRIC_KEY" - - // KeyClassAsymmetricKeyPair is a KeyClass enum value - KeyClassAsymmetricKeyPair = "ASYMMETRIC_KEY_PAIR" - - // KeyClassPrivateKey is a KeyClass enum value - KeyClassPrivateKey = "PRIVATE_KEY" - - // KeyClassPublicKey is a KeyClass enum value - KeyClassPublicKey = "PUBLIC_KEY" -) - -// KeyClass_Values returns all elements of the KeyClass enum -func KeyClass_Values() []string { - return []string{ - KeyClassSymmetricKey, - KeyClassAsymmetricKeyPair, - KeyClassPrivateKey, - KeyClassPublicKey, - } -} - -const ( - // KeyMaterialTypeTr34KeyBlock is a KeyMaterialType enum value - KeyMaterialTypeTr34KeyBlock = "TR34_KEY_BLOCK" - - // KeyMaterialTypeTr31KeyBlock is a KeyMaterialType enum value - KeyMaterialTypeTr31KeyBlock = "TR31_KEY_BLOCK" - - // KeyMaterialTypeRootPublicKeyCertificate is a KeyMaterialType enum value - KeyMaterialTypeRootPublicKeyCertificate = "ROOT_PUBLIC_KEY_CERTIFICATE" - - // KeyMaterialTypeTrustedPublicKeyCertificate is a KeyMaterialType enum value - KeyMaterialTypeTrustedPublicKeyCertificate = "TRUSTED_PUBLIC_KEY_CERTIFICATE" -) - -// KeyMaterialType_Values returns all elements of the KeyMaterialType enum -func KeyMaterialType_Values() []string { - return []string{ - KeyMaterialTypeTr34KeyBlock, - KeyMaterialTypeTr31KeyBlock, - KeyMaterialTypeRootPublicKeyCertificate, - KeyMaterialTypeTrustedPublicKeyCertificate, - } -} - -// Defines the source of a key -const ( - // KeyOriginExternal is a KeyOrigin enum value - KeyOriginExternal = "EXTERNAL" - - // KeyOriginAwsPaymentCryptography is a KeyOrigin enum value - KeyOriginAwsPaymentCryptography = "AWS_PAYMENT_CRYPTOGRAPHY" -) - -// KeyOrigin_Values returns all elements of the KeyOrigin enum -func KeyOrigin_Values() []string { - return []string{ - KeyOriginExternal, - KeyOriginAwsPaymentCryptography, - } -} - -// Defines the state of a key -const ( - // KeyStateCreateInProgress is a KeyState enum value - KeyStateCreateInProgress = "CREATE_IN_PROGRESS" - - // KeyStateCreateComplete is a KeyState enum value - KeyStateCreateComplete = "CREATE_COMPLETE" - - // KeyStateDeletePending is a KeyState enum value - KeyStateDeletePending = "DELETE_PENDING" - - // KeyStateDeleteComplete is a KeyState enum value - KeyStateDeleteComplete = "DELETE_COMPLETE" -) - -// KeyState_Values returns all elements of the KeyState enum -func KeyState_Values() []string { - return []string{ - KeyStateCreateInProgress, - KeyStateCreateComplete, - KeyStateDeletePending, - KeyStateDeleteComplete, - } -} - -const ( - // KeyUsageTr31B0BaseDerivationKey is a KeyUsage enum value - KeyUsageTr31B0BaseDerivationKey = "TR31_B0_BASE_DERIVATION_KEY" - - // KeyUsageTr31C0CardVerificationKey is a KeyUsage enum value - KeyUsageTr31C0CardVerificationKey = "TR31_C0_CARD_VERIFICATION_KEY" - - // KeyUsageTr31D0SymmetricDataEncryptionKey is a KeyUsage enum value - KeyUsageTr31D0SymmetricDataEncryptionKey = "TR31_D0_SYMMETRIC_DATA_ENCRYPTION_KEY" - - // KeyUsageTr31D1AsymmetricKeyForDataEncryption is a KeyUsage enum value - KeyUsageTr31D1AsymmetricKeyForDataEncryption = "TR31_D1_ASYMMETRIC_KEY_FOR_DATA_ENCRYPTION" - - // KeyUsageTr31E0EmvMkeyAppCryptograms is a KeyUsage enum value - KeyUsageTr31E0EmvMkeyAppCryptograms = "TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS" - - // KeyUsageTr31E1EmvMkeyConfidentiality is a KeyUsage enum value - KeyUsageTr31E1EmvMkeyConfidentiality = "TR31_E1_EMV_MKEY_CONFIDENTIALITY" - - // KeyUsageTr31E2EmvMkeyIntegrity is a KeyUsage enum value - KeyUsageTr31E2EmvMkeyIntegrity = "TR31_E2_EMV_MKEY_INTEGRITY" - - // KeyUsageTr31E4EmvMkeyDynamicNumbers is a KeyUsage enum value - KeyUsageTr31E4EmvMkeyDynamicNumbers = "TR31_E4_EMV_MKEY_DYNAMIC_NUMBERS" - - // KeyUsageTr31E5EmvMkeyCardPersonalization is a KeyUsage enum value - KeyUsageTr31E5EmvMkeyCardPersonalization = "TR31_E5_EMV_MKEY_CARD_PERSONALIZATION" - - // KeyUsageTr31E6EmvMkeyOther is a KeyUsage enum value - KeyUsageTr31E6EmvMkeyOther = "TR31_E6_EMV_MKEY_OTHER" - - // KeyUsageTr31K0KeyEncryptionKey is a KeyUsage enum value - KeyUsageTr31K0KeyEncryptionKey = "TR31_K0_KEY_ENCRYPTION_KEY" - - // KeyUsageTr31K1KeyBlockProtectionKey is a KeyUsage enum value - KeyUsageTr31K1KeyBlockProtectionKey = "TR31_K1_KEY_BLOCK_PROTECTION_KEY" - - // KeyUsageTr31K3AsymmetricKeyForKeyAgreement is a KeyUsage enum value - KeyUsageTr31K3AsymmetricKeyForKeyAgreement = "TR31_K3_ASYMMETRIC_KEY_FOR_KEY_AGREEMENT" - - // KeyUsageTr31M3Iso97973MacKey is a KeyUsage enum value - KeyUsageTr31M3Iso97973MacKey = "TR31_M3_ISO_9797_3_MAC_KEY" - - // KeyUsageTr31M6Iso97975CmacKey is a KeyUsage enum value - KeyUsageTr31M6Iso97975CmacKey = "TR31_M6_ISO_9797_5_CMAC_KEY" - - // KeyUsageTr31M7HmacKey is a KeyUsage enum value - KeyUsageTr31M7HmacKey = "TR31_M7_HMAC_KEY" - - // KeyUsageTr31P0PinEncryptionKey is a KeyUsage enum value - KeyUsageTr31P0PinEncryptionKey = "TR31_P0_PIN_ENCRYPTION_KEY" - - // KeyUsageTr31P1PinGenerationKey is a KeyUsage enum value - KeyUsageTr31P1PinGenerationKey = "TR31_P1_PIN_GENERATION_KEY" - - // KeyUsageTr31S0AsymmetricKeyForDigitalSignature is a KeyUsage enum value - KeyUsageTr31S0AsymmetricKeyForDigitalSignature = "TR31_S0_ASYMMETRIC_KEY_FOR_DIGITAL_SIGNATURE" - - // KeyUsageTr31V1Ibm3624PinVerificationKey is a KeyUsage enum value - KeyUsageTr31V1Ibm3624PinVerificationKey = "TR31_V1_IBM3624_PIN_VERIFICATION_KEY" - - // KeyUsageTr31V2VisaPinVerificationKey is a KeyUsage enum value - KeyUsageTr31V2VisaPinVerificationKey = "TR31_V2_VISA_PIN_VERIFICATION_KEY" - - // KeyUsageTr31K2Tr34AsymmetricKey is a KeyUsage enum value - KeyUsageTr31K2Tr34AsymmetricKey = "TR31_K2_TR34_ASYMMETRIC_KEY" -) - -// KeyUsage_Values returns all elements of the KeyUsage enum -func KeyUsage_Values() []string { - return []string{ - KeyUsageTr31B0BaseDerivationKey, - KeyUsageTr31C0CardVerificationKey, - KeyUsageTr31D0SymmetricDataEncryptionKey, - KeyUsageTr31D1AsymmetricKeyForDataEncryption, - KeyUsageTr31E0EmvMkeyAppCryptograms, - KeyUsageTr31E1EmvMkeyConfidentiality, - KeyUsageTr31E2EmvMkeyIntegrity, - KeyUsageTr31E4EmvMkeyDynamicNumbers, - KeyUsageTr31E5EmvMkeyCardPersonalization, - KeyUsageTr31E6EmvMkeyOther, - KeyUsageTr31K0KeyEncryptionKey, - KeyUsageTr31K1KeyBlockProtectionKey, - KeyUsageTr31K3AsymmetricKeyForKeyAgreement, - KeyUsageTr31M3Iso97973MacKey, - KeyUsageTr31M6Iso97975CmacKey, - KeyUsageTr31M7HmacKey, - KeyUsageTr31P0PinEncryptionKey, - KeyUsageTr31P1PinGenerationKey, - KeyUsageTr31S0AsymmetricKeyForDigitalSignature, - KeyUsageTr31V1Ibm3624PinVerificationKey, - KeyUsageTr31V2VisaPinVerificationKey, - KeyUsageTr31K2Tr34AsymmetricKey, - } -} - -const ( - // Tr34KeyBlockFormatX9Tr342012 is a Tr34KeyBlockFormat enum value - Tr34KeyBlockFormatX9Tr342012 = "X9_TR34_2012" -) - -// Tr34KeyBlockFormat_Values returns all elements of the Tr34KeyBlockFormat enum -func Tr34KeyBlockFormat_Values() []string { - return []string{ - Tr34KeyBlockFormatX9Tr342012, - } -} - -const ( - // WrappedKeyMaterialFormatKeyCryptogram is a WrappedKeyMaterialFormat enum value - WrappedKeyMaterialFormatKeyCryptogram = "KEY_CRYPTOGRAM" - - // WrappedKeyMaterialFormatTr31KeyBlock is a WrappedKeyMaterialFormat enum value - WrappedKeyMaterialFormatTr31KeyBlock = "TR31_KEY_BLOCK" - - // WrappedKeyMaterialFormatTr34KeyBlock is a WrappedKeyMaterialFormat enum value - WrappedKeyMaterialFormatTr34KeyBlock = "TR34_KEY_BLOCK" -) - -// WrappedKeyMaterialFormat_Values returns all elements of the WrappedKeyMaterialFormat enum -func WrappedKeyMaterialFormat_Values() []string { - return []string{ - WrappedKeyMaterialFormatKeyCryptogram, - WrappedKeyMaterialFormatTr31KeyBlock, - WrappedKeyMaterialFormatTr34KeyBlock, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/doc.go deleted file mode 100644 index 218eddc705e9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/doc.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package paymentcryptography provides the client and types for making API -// requests to Payment Cryptography Control Plane. -// -// You use the Amazon Web Services Payment Cryptography Control Plane to manage -// the encryption keys you use for payment-related cryptographic operations. -// You can create, import, export, share, manage, and delete keys. You can also -// manage Identity and Access Management (IAM) policies for keys. For more information, -// see Identity and access management (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/security-iam.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// To use encryption keys for payment-related transaction processing and associated -// cryptographic operations, you use the Amazon Web Services Payment Cryptography -// Data Plane (https://docs.aws.amazon.com/payment-cryptography/latest/DataAPIReference/Welcome.html). -// You can encrypt, decrypt, generate, verify, and translate payment-related -// cryptographic operations. -// -// All Amazon Web Services Payment Cryptography API calls must be signed and -// transmitted using Transport Layer Security (TLS). We recommend you always -// use the latest supported TLS version for logging API requests. -// -// Amazon Web Services Payment Cryptography supports CloudTrail, a service that -// logs Amazon Web Services API calls and related events for your Amazon Web -// Services account and delivers them to an Amazon S3 bucket that you specify. -// By using the information collected by CloudTrail, you can determine what -// requests were made to Amazon Web Services Payment Cryptography, who made -// the request, when it was made, and so on. If you don't configure a trail, -// you can still view the most recent events in the CloudTrail console. For -// more information, see the CloudTrail User Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/). -// -// See https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-2021-09-14 for more information on this service. -// -// See paymentcryptography package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/paymentcryptography/ -// -// # Using the Client -// -// To contact Payment Cryptography Control Plane with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Payment Cryptography Control Plane client PaymentCryptography for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/paymentcryptography/#New -package paymentcryptography diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/errors.go deleted file mode 100644 index cf6862ade1dd..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/errors.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package paymentcryptography - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // This request can cause an inconsistent state for the resource. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request processing has failed because of an unknown error, exception, - // or failure. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request was denied due to an invalid resource error. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // This request would cause a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeServiceUnavailableException for service response error code - // "ServiceUnavailableException". - // - // The service cannot complete the request. - ErrCodeServiceUnavailableException = "ServiceUnavailableException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The request was denied due to an invalid request error. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ServiceUnavailableException": newErrorServiceUnavailableException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/paymentcryptographyiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/paymentcryptographyiface/interface.go deleted file mode 100644 index 9c25c55487b0..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/paymentcryptographyiface/interface.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package paymentcryptographyiface provides an interface to enable mocking the Payment Cryptography Control Plane service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package paymentcryptographyiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography" -) - -// PaymentCryptographyAPI provides an interface to enable mocking the -// paymentcryptography.PaymentCryptography service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Payment Cryptography Control Plane. -// func myFunc(svc paymentcryptographyiface.PaymentCryptographyAPI) bool { -// // Make svc.CreateAlias request -// } -// -// func main() { -// sess := session.New() -// svc := paymentcryptography.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockPaymentCryptographyClient struct { -// paymentcryptographyiface.PaymentCryptographyAPI -// } -// func (m *mockPaymentCryptographyClient) CreateAlias(input *paymentcryptography.CreateAliasInput) (*paymentcryptography.CreateAliasOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockPaymentCryptographyClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type PaymentCryptographyAPI interface { - CreateAlias(*paymentcryptography.CreateAliasInput) (*paymentcryptography.CreateAliasOutput, error) - CreateAliasWithContext(aws.Context, *paymentcryptography.CreateAliasInput, ...request.Option) (*paymentcryptography.CreateAliasOutput, error) - CreateAliasRequest(*paymentcryptography.CreateAliasInput) (*request.Request, *paymentcryptography.CreateAliasOutput) - - CreateKey(*paymentcryptography.CreateKeyInput) (*paymentcryptography.CreateKeyOutput, error) - CreateKeyWithContext(aws.Context, *paymentcryptography.CreateKeyInput, ...request.Option) (*paymentcryptography.CreateKeyOutput, error) - CreateKeyRequest(*paymentcryptography.CreateKeyInput) (*request.Request, *paymentcryptography.CreateKeyOutput) - - DeleteAlias(*paymentcryptography.DeleteAliasInput) (*paymentcryptography.DeleteAliasOutput, error) - DeleteAliasWithContext(aws.Context, *paymentcryptography.DeleteAliasInput, ...request.Option) (*paymentcryptography.DeleteAliasOutput, error) - DeleteAliasRequest(*paymentcryptography.DeleteAliasInput) (*request.Request, *paymentcryptography.DeleteAliasOutput) - - DeleteKey(*paymentcryptography.DeleteKeyInput) (*paymentcryptography.DeleteKeyOutput, error) - DeleteKeyWithContext(aws.Context, *paymentcryptography.DeleteKeyInput, ...request.Option) (*paymentcryptography.DeleteKeyOutput, error) - DeleteKeyRequest(*paymentcryptography.DeleteKeyInput) (*request.Request, *paymentcryptography.DeleteKeyOutput) - - ExportKey(*paymentcryptography.ExportKeyInput) (*paymentcryptography.ExportKeyOutput, error) - ExportKeyWithContext(aws.Context, *paymentcryptography.ExportKeyInput, ...request.Option) (*paymentcryptography.ExportKeyOutput, error) - ExportKeyRequest(*paymentcryptography.ExportKeyInput) (*request.Request, *paymentcryptography.ExportKeyOutput) - - GetAlias(*paymentcryptography.GetAliasInput) (*paymentcryptography.GetAliasOutput, error) - GetAliasWithContext(aws.Context, *paymentcryptography.GetAliasInput, ...request.Option) (*paymentcryptography.GetAliasOutput, error) - GetAliasRequest(*paymentcryptography.GetAliasInput) (*request.Request, *paymentcryptography.GetAliasOutput) - - GetKey(*paymentcryptography.GetKeyInput) (*paymentcryptography.GetKeyOutput, error) - GetKeyWithContext(aws.Context, *paymentcryptography.GetKeyInput, ...request.Option) (*paymentcryptography.GetKeyOutput, error) - GetKeyRequest(*paymentcryptography.GetKeyInput) (*request.Request, *paymentcryptography.GetKeyOutput) - - GetParametersForExport(*paymentcryptography.GetParametersForExportInput) (*paymentcryptography.GetParametersForExportOutput, error) - GetParametersForExportWithContext(aws.Context, *paymentcryptography.GetParametersForExportInput, ...request.Option) (*paymentcryptography.GetParametersForExportOutput, error) - GetParametersForExportRequest(*paymentcryptography.GetParametersForExportInput) (*request.Request, *paymentcryptography.GetParametersForExportOutput) - - GetParametersForImport(*paymentcryptography.GetParametersForImportInput) (*paymentcryptography.GetParametersForImportOutput, error) - GetParametersForImportWithContext(aws.Context, *paymentcryptography.GetParametersForImportInput, ...request.Option) (*paymentcryptography.GetParametersForImportOutput, error) - GetParametersForImportRequest(*paymentcryptography.GetParametersForImportInput) (*request.Request, *paymentcryptography.GetParametersForImportOutput) - - GetPublicKeyCertificate(*paymentcryptography.GetPublicKeyCertificateInput) (*paymentcryptography.GetPublicKeyCertificateOutput, error) - GetPublicKeyCertificateWithContext(aws.Context, *paymentcryptography.GetPublicKeyCertificateInput, ...request.Option) (*paymentcryptography.GetPublicKeyCertificateOutput, error) - GetPublicKeyCertificateRequest(*paymentcryptography.GetPublicKeyCertificateInput) (*request.Request, *paymentcryptography.GetPublicKeyCertificateOutput) - - ImportKey(*paymentcryptography.ImportKeyInput) (*paymentcryptography.ImportKeyOutput, error) - ImportKeyWithContext(aws.Context, *paymentcryptography.ImportKeyInput, ...request.Option) (*paymentcryptography.ImportKeyOutput, error) - ImportKeyRequest(*paymentcryptography.ImportKeyInput) (*request.Request, *paymentcryptography.ImportKeyOutput) - - ListAliases(*paymentcryptography.ListAliasesInput) (*paymentcryptography.ListAliasesOutput, error) - ListAliasesWithContext(aws.Context, *paymentcryptography.ListAliasesInput, ...request.Option) (*paymentcryptography.ListAliasesOutput, error) - ListAliasesRequest(*paymentcryptography.ListAliasesInput) (*request.Request, *paymentcryptography.ListAliasesOutput) - - ListAliasesPages(*paymentcryptography.ListAliasesInput, func(*paymentcryptography.ListAliasesOutput, bool) bool) error - ListAliasesPagesWithContext(aws.Context, *paymentcryptography.ListAliasesInput, func(*paymentcryptography.ListAliasesOutput, bool) bool, ...request.Option) error - - ListKeys(*paymentcryptography.ListKeysInput) (*paymentcryptography.ListKeysOutput, error) - ListKeysWithContext(aws.Context, *paymentcryptography.ListKeysInput, ...request.Option) (*paymentcryptography.ListKeysOutput, error) - ListKeysRequest(*paymentcryptography.ListKeysInput) (*request.Request, *paymentcryptography.ListKeysOutput) - - ListKeysPages(*paymentcryptography.ListKeysInput, func(*paymentcryptography.ListKeysOutput, bool) bool) error - ListKeysPagesWithContext(aws.Context, *paymentcryptography.ListKeysInput, func(*paymentcryptography.ListKeysOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*paymentcryptography.ListTagsForResourceInput) (*paymentcryptography.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *paymentcryptography.ListTagsForResourceInput, ...request.Option) (*paymentcryptography.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*paymentcryptography.ListTagsForResourceInput) (*request.Request, *paymentcryptography.ListTagsForResourceOutput) - - ListTagsForResourcePages(*paymentcryptography.ListTagsForResourceInput, func(*paymentcryptography.ListTagsForResourceOutput, bool) bool) error - ListTagsForResourcePagesWithContext(aws.Context, *paymentcryptography.ListTagsForResourceInput, func(*paymentcryptography.ListTagsForResourceOutput, bool) bool, ...request.Option) error - - RestoreKey(*paymentcryptography.RestoreKeyInput) (*paymentcryptography.RestoreKeyOutput, error) - RestoreKeyWithContext(aws.Context, *paymentcryptography.RestoreKeyInput, ...request.Option) (*paymentcryptography.RestoreKeyOutput, error) - RestoreKeyRequest(*paymentcryptography.RestoreKeyInput) (*request.Request, *paymentcryptography.RestoreKeyOutput) - - StartKeyUsage(*paymentcryptography.StartKeyUsageInput) (*paymentcryptography.StartKeyUsageOutput, error) - StartKeyUsageWithContext(aws.Context, *paymentcryptography.StartKeyUsageInput, ...request.Option) (*paymentcryptography.StartKeyUsageOutput, error) - StartKeyUsageRequest(*paymentcryptography.StartKeyUsageInput) (*request.Request, *paymentcryptography.StartKeyUsageOutput) - - StopKeyUsage(*paymentcryptography.StopKeyUsageInput) (*paymentcryptography.StopKeyUsageOutput, error) - StopKeyUsageWithContext(aws.Context, *paymentcryptography.StopKeyUsageInput, ...request.Option) (*paymentcryptography.StopKeyUsageOutput, error) - StopKeyUsageRequest(*paymentcryptography.StopKeyUsageInput) (*request.Request, *paymentcryptography.StopKeyUsageOutput) - - TagResource(*paymentcryptography.TagResourceInput) (*paymentcryptography.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *paymentcryptography.TagResourceInput, ...request.Option) (*paymentcryptography.TagResourceOutput, error) - TagResourceRequest(*paymentcryptography.TagResourceInput) (*request.Request, *paymentcryptography.TagResourceOutput) - - UntagResource(*paymentcryptography.UntagResourceInput) (*paymentcryptography.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *paymentcryptography.UntagResourceInput, ...request.Option) (*paymentcryptography.UntagResourceOutput, error) - UntagResourceRequest(*paymentcryptography.UntagResourceInput) (*request.Request, *paymentcryptography.UntagResourceOutput) - - UpdateAlias(*paymentcryptography.UpdateAliasInput) (*paymentcryptography.UpdateAliasOutput, error) - UpdateAliasWithContext(aws.Context, *paymentcryptography.UpdateAliasInput, ...request.Option) (*paymentcryptography.UpdateAliasOutput, error) - UpdateAliasRequest(*paymentcryptography.UpdateAliasInput) (*request.Request, *paymentcryptography.UpdateAliasOutput) -} - -var _ PaymentCryptographyAPI = (*paymentcryptography.PaymentCryptography)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/service.go deleted file mode 100644 index 5b6a3f7a6b5a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptography/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package paymentcryptography - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// PaymentCryptography provides the API operation methods for making requests to -// Payment Cryptography Control Plane. See this package's package overview docs -// for details on the service. -// -// PaymentCryptography methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type PaymentCryptography struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Payment Cryptography" // Name of service. - EndpointsID = "controlplane.payment-cryptography" // ID to lookup a service endpoint with. - ServiceID = "Payment Cryptography" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the PaymentCryptography client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a PaymentCryptography client from just a session. -// svc := paymentcryptography.New(mySession) -// -// // Create a PaymentCryptography client with additional configuration -// svc := paymentcryptography.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *PaymentCryptography { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "payment-cryptography" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *PaymentCryptography { - svc := &PaymentCryptography{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-09-14", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.0", - TargetPrefix: "PaymentCryptographyControlPlane", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a PaymentCryptography operation and runs any -// custom request initialization. -func (c *PaymentCryptography) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/api.go deleted file mode 100644 index fd56028f2f5e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/api.go +++ /dev/null @@ -1,7676 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package paymentcryptographydata - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const opDecryptData = "DecryptData" - -// DecryptDataRequest generates a "aws/request.Request" representing the -// client's request for the DecryptData 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 DecryptData for more information on using the DecryptData -// 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 DecryptDataRequest method. -// req, resp := client.DecryptDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/DecryptData -func (c *PaymentCryptographyData) DecryptDataRequest(input *DecryptDataInput) (req *request.Request, output *DecryptDataOutput) { - op := &request.Operation{ - Name: opDecryptData, - HTTPMethod: "POST", - HTTPPath: "/keys/{KeyIdentifier}/decrypt", - } - - if input == nil { - input = &DecryptDataInput{} - } - - output = &DecryptDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// DecryptData API operation for Payment Cryptography Data Plane. -// -// Decrypts ciphertext data to plaintext using symmetric, asymmetric, or DUKPT -// data encryption key. For more information, see Decrypt data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/decrypt-data.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// You can use an encryption key generated within Amazon Web Services Payment -// Cryptography, or you can import your own encryption key by calling ImportKey -// (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html). -// For this operation, the key must have KeyModesOfUse set to Decrypt. In asymmetric -// decryption, Amazon Web Services Payment Cryptography decrypts the ciphertext -// using the private component of the asymmetric encryption key pair. For data -// encryption outside of Amazon Web Services Payment Cryptography, you can export -// the public component of the asymmetric key pair by calling GetPublicCertificate -// (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html). -// -// For symmetric and DUKPT decryption, Amazon Web Services Payment Cryptography -// supports TDES and AES algorithms. For asymmetric decryption, Amazon Web Services -// Payment Cryptography supports RSA. When you use DUKPT, for TDES algorithm, -// the ciphertext data length must be a multiple of 16 bytes. For AES algorithm, -// the ciphertext data length must be a multiple of 32 bytes. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - EncryptData -// -// - GetPublicCertificate (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html) -// -// - ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) -// -// 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 Payment Cryptography Data Plane's -// API operation DecryptData for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/DecryptData -func (c *PaymentCryptographyData) DecryptData(input *DecryptDataInput) (*DecryptDataOutput, error) { - req, out := c.DecryptDataRequest(input) - return out, req.Send() -} - -// DecryptDataWithContext is the same as DecryptData with the addition of -// the ability to pass a context and additional request options. -// -// See DecryptData 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 *PaymentCryptographyData) DecryptDataWithContext(ctx aws.Context, input *DecryptDataInput, opts ...request.Option) (*DecryptDataOutput, error) { - req, out := c.DecryptDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEncryptData = "EncryptData" - -// EncryptDataRequest generates a "aws/request.Request" representing the -// client's request for the EncryptData 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 EncryptData for more information on using the EncryptData -// 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 EncryptDataRequest method. -// req, resp := client.EncryptDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/EncryptData -func (c *PaymentCryptographyData) EncryptDataRequest(input *EncryptDataInput) (req *request.Request, output *EncryptDataOutput) { - op := &request.Operation{ - Name: opEncryptData, - HTTPMethod: "POST", - HTTPPath: "/keys/{KeyIdentifier}/encrypt", - } - - if input == nil { - input = &EncryptDataInput{} - } - - output = &EncryptDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// EncryptData API operation for Payment Cryptography Data Plane. -// -// Encrypts plaintext data to ciphertext using symmetric, asymmetric, or DUKPT -// data encryption key. For more information, see Encrypt data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// You can generate an encryption key within Amazon Web Services Payment Cryptography -// by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html). -// You can import your own encryption key by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html). -// For this operation, the key must have KeyModesOfUse set to Encrypt. In asymmetric -// encryption, plaintext is encrypted using public component. You can import -// the public component of an asymmetric key pair created outside Amazon Web -// Services Payment Cryptography by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html)). -// -// for symmetric and DUKPT encryption, Amazon Web Services Payment Cryptography -// supports TDES and AES algorithms. For asymmetric encryption, Amazon Web Services -// Payment Cryptography supports RSA. To encrypt using DUKPT, you must already -// have a DUKPT key in your account with KeyModesOfUse set to DeriveKey, or -// you can generate a new DUKPT key by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html). -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - DecryptData -// -// - GetPublicCertificate (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html) -// -// - ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) -// -// - ReEncryptData -// -// 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 Payment Cryptography Data Plane's -// API operation EncryptData for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/EncryptData -func (c *PaymentCryptographyData) EncryptData(input *EncryptDataInput) (*EncryptDataOutput, error) { - req, out := c.EncryptDataRequest(input) - return out, req.Send() -} - -// EncryptDataWithContext is the same as EncryptData with the addition of -// the ability to pass a context and additional request options. -// -// See EncryptData 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 *PaymentCryptographyData) EncryptDataWithContext(ctx aws.Context, input *EncryptDataInput, opts ...request.Option) (*EncryptDataOutput, error) { - req, out := c.EncryptDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGenerateCardValidationData = "GenerateCardValidationData" - -// GenerateCardValidationDataRequest generates a "aws/request.Request" representing the -// client's request for the GenerateCardValidationData 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 GenerateCardValidationData for more information on using the GenerateCardValidationData -// 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 GenerateCardValidationDataRequest method. -// req, resp := client.GenerateCardValidationDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GenerateCardValidationData -func (c *PaymentCryptographyData) GenerateCardValidationDataRequest(input *GenerateCardValidationDataInput) (req *request.Request, output *GenerateCardValidationDataOutput) { - op := &request.Operation{ - Name: opGenerateCardValidationData, - HTTPMethod: "POST", - HTTPPath: "/cardvalidationdata/generate", - } - - if input == nil { - input = &GenerateCardValidationDataInput{} - } - - output = &GenerateCardValidationDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// GenerateCardValidationData API operation for Payment Cryptography Data Plane. -// -// Generates card-related validation data using algorithms such as Card Verification -// Values (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2), or Card -// Security Codes (CSC). For more information, see Generate card data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/generate-card-data.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// This operation generates a CVV or CSC value that is printed on a payment -// credit or debit card during card production. The CVV or CSC, PAN (Primary -// Account Number) and expiration date of the card are required to check its -// validity during transaction processing. To begin this operation, a CVK (Card -// Verification Key) encryption key is required. You can use CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html) -// or ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) -// to establish a CVK within Amazon Web Services Payment Cryptography. The KeyModesOfUse -// should be set to Generate and Verify for a CVK encryption key. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) -// -// - VerifyCardValidationData -// -// 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 Payment Cryptography Data Plane's -// API operation GenerateCardValidationData for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GenerateCardValidationData -func (c *PaymentCryptographyData) GenerateCardValidationData(input *GenerateCardValidationDataInput) (*GenerateCardValidationDataOutput, error) { - req, out := c.GenerateCardValidationDataRequest(input) - return out, req.Send() -} - -// GenerateCardValidationDataWithContext is the same as GenerateCardValidationData with the addition of -// the ability to pass a context and additional request options. -// -// See GenerateCardValidationData 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 *PaymentCryptographyData) GenerateCardValidationDataWithContext(ctx aws.Context, input *GenerateCardValidationDataInput, opts ...request.Option) (*GenerateCardValidationDataOutput, error) { - req, out := c.GenerateCardValidationDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGenerateMac = "GenerateMac" - -// GenerateMacRequest generates a "aws/request.Request" representing the -// client's request for the GenerateMac 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 GenerateMac for more information on using the GenerateMac -// 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 GenerateMacRequest method. -// req, resp := client.GenerateMacRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GenerateMac -func (c *PaymentCryptographyData) GenerateMacRequest(input *GenerateMacInput) (req *request.Request, output *GenerateMacOutput) { - op := &request.Operation{ - Name: opGenerateMac, - HTTPMethod: "POST", - HTTPPath: "/mac/generate", - } - - if input == nil { - input = &GenerateMacInput{} - } - - output = &GenerateMacOutput{} - req = c.newRequest(op, input, output) - return -} - -// GenerateMac API operation for Payment Cryptography Data Plane. -// -// Generates a Message Authentication Code (MAC) cryptogram within Amazon Web -// Services Payment Cryptography. -// -// You can use this operation when keys won't be shared but mutual data is present -// on both ends for validation. In this case, known data values are used to -// generate a MAC on both ends for comparision without sending or receiving -// data in ciphertext or plaintext. You can use this operation to generate a -// DUPKT, HMAC or EMV MAC by setting generation attributes and algorithm to -// the associated values. The MAC generation encryption key must have valid -// values for KeyUsage such as TR31_M7_HMAC_KEY for HMAC generation, and they -// key must have KeyModesOfUse set to Generate and Verify. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - VerifyMac -// -// 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 Payment Cryptography Data Plane's -// API operation GenerateMac for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GenerateMac -func (c *PaymentCryptographyData) GenerateMac(input *GenerateMacInput) (*GenerateMacOutput, error) { - req, out := c.GenerateMacRequest(input) - return out, req.Send() -} - -// GenerateMacWithContext is the same as GenerateMac with the addition of -// the ability to pass a context and additional request options. -// -// See GenerateMac 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 *PaymentCryptographyData) GenerateMacWithContext(ctx aws.Context, input *GenerateMacInput, opts ...request.Option) (*GenerateMacOutput, error) { - req, out := c.GenerateMacRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGeneratePinData = "GeneratePinData" - -// GeneratePinDataRequest generates a "aws/request.Request" representing the -// client's request for the GeneratePinData 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 GeneratePinData for more information on using the GeneratePinData -// 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 GeneratePinDataRequest method. -// req, resp := client.GeneratePinDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GeneratePinData -func (c *PaymentCryptographyData) GeneratePinDataRequest(input *GeneratePinDataInput) (req *request.Request, output *GeneratePinDataOutput) { - op := &request.Operation{ - Name: opGeneratePinData, - HTTPMethod: "POST", - HTTPPath: "/pindata/generate", - } - - if input == nil { - input = &GeneratePinDataInput{} - } - - output = &GeneratePinDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// GeneratePinData API operation for Payment Cryptography Data Plane. -// -// Generates pin-related data such as PIN, PIN Verification Value (PVV), PIN -// Block, and PIN Offset during new card issuance or reissuance. For more information, -// see Generate PIN data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/generate-pin-data.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// PIN data is never transmitted in clear to or from Amazon Web Services Payment -// Cryptography. This operation generates PIN, PVV, or PIN Offset and then encrypts -// it using Pin Encryption Key (PEK) to create an EncryptedPinBlock for transmission -// from Amazon Web Services Payment Cryptography. This operation uses a separate -// Pin Verification Key (PVK) for VISA PVV generation. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - GenerateCardValidationData -// -// - TranslatePinData -// -// - VerifyPinData -// -// 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 Payment Cryptography Data Plane's -// API operation GeneratePinData for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/GeneratePinData -func (c *PaymentCryptographyData) GeneratePinData(input *GeneratePinDataInput) (*GeneratePinDataOutput, error) { - req, out := c.GeneratePinDataRequest(input) - return out, req.Send() -} - -// GeneratePinDataWithContext is the same as GeneratePinData with the addition of -// the ability to pass a context and additional request options. -// -// See GeneratePinData 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 *PaymentCryptographyData) GeneratePinDataWithContext(ctx aws.Context, input *GeneratePinDataInput, opts ...request.Option) (*GeneratePinDataOutput, error) { - req, out := c.GeneratePinDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReEncryptData = "ReEncryptData" - -// ReEncryptDataRequest generates a "aws/request.Request" representing the -// client's request for the ReEncryptData 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 ReEncryptData for more information on using the ReEncryptData -// 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 ReEncryptDataRequest method. -// req, resp := client.ReEncryptDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/ReEncryptData -func (c *PaymentCryptographyData) ReEncryptDataRequest(input *ReEncryptDataInput) (req *request.Request, output *ReEncryptDataOutput) { - op := &request.Operation{ - Name: opReEncryptData, - HTTPMethod: "POST", - HTTPPath: "/keys/{IncomingKeyIdentifier}/reencrypt", - } - - if input == nil { - input = &ReEncryptDataInput{} - } - - output = &ReEncryptDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// ReEncryptData API operation for Payment Cryptography Data Plane. -// -// Re-encrypt ciphertext using DUKPT, Symmetric and Asymmetric Data Encryption -// Keys. -// -// You can either generate an encryption key within Amazon Web Services Payment -// Cryptography by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html) -// or import your own encryption key by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html). -// The KeyArn for use with this operation must be in a compatible key state -// with KeyModesOfUse set to Encrypt. In asymmetric encryption, ciphertext is -// encrypted using public component (imported by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html)) -// of the asymmetric key pair created outside of Amazon Web Services Payment -// Cryptography. -// -// For symmetric and DUKPT encryption, Amazon Web Services Payment Cryptography -// supports TDES and AES algorithms. For asymmetric encryption, Amazon Web Services -// Payment Cryptography supports RSA. To encrypt using DUKPT, a DUKPT key must -// already exist within your account with KeyModesOfUse set to DeriveKey or -// a new DUKPT can be generated by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html). -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - DecryptData -// -// - EncryptData -// -// - GetPublicCertificate (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html) -// -// - ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) -// -// 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 Payment Cryptography Data Plane's -// API operation ReEncryptData for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/ReEncryptData -func (c *PaymentCryptographyData) ReEncryptData(input *ReEncryptDataInput) (*ReEncryptDataOutput, error) { - req, out := c.ReEncryptDataRequest(input) - return out, req.Send() -} - -// ReEncryptDataWithContext is the same as ReEncryptData with the addition of -// the ability to pass a context and additional request options. -// -// See ReEncryptData 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 *PaymentCryptographyData) ReEncryptDataWithContext(ctx aws.Context, input *ReEncryptDataInput, opts ...request.Option) (*ReEncryptDataOutput, error) { - req, out := c.ReEncryptDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTranslatePinData = "TranslatePinData" - -// TranslatePinDataRequest generates a "aws/request.Request" representing the -// client's request for the TranslatePinData 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 TranslatePinData for more information on using the TranslatePinData -// 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 TranslatePinDataRequest method. -// req, resp := client.TranslatePinDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/TranslatePinData -func (c *PaymentCryptographyData) TranslatePinDataRequest(input *TranslatePinDataInput) (req *request.Request, output *TranslatePinDataOutput) { - op := &request.Operation{ - Name: opTranslatePinData, - HTTPMethod: "POST", - HTTPPath: "/pindata/translate", - } - - if input == nil { - input = &TranslatePinDataInput{} - } - - output = &TranslatePinDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// TranslatePinData API operation for Payment Cryptography Data Plane. -// -// Translates encrypted PIN block from and to ISO 9564 formats 0,1,3,4. For -// more information, see Translate PIN data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/translate-pin-data.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// PIN block translation involves changing the encrytion of PIN block from one -// encryption key to another encryption key and changing PIN block format from -// one to another without PIN block data leaving Amazon Web Services Payment -// Cryptography. The encryption key transformation can be from PEK (Pin Encryption -// Key) to BDK (Base Derivation Key) for DUKPT or from BDK for DUKPT to PEK. -// Amazon Web Services Payment Cryptography supports TDES and AES key derivation -// type for DUKPT tranlations. You can use this operation for P2PE (Point to -// Point Encryption) use cases where the encryption keys should change but the -// processing system either does not need to, or is not permitted to, decrypt -// the data. -// -// The allowed combinations of PIN block format translations are guided by PCI. -// It is important to note that not all encrypted PIN block formats (example, -// format 1) require PAN (Primary Account Number) as input. And as such, PIN -// block format that requires PAN (example, formats 0,3,4) cannot be translated -// to a format (format 1) that does not require a PAN for generation. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// At this time, Amazon Web Services Payment Cryptography does not support translations -// to PIN format 4. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - GeneratePinData -// -// - VerifyPinData -// -// 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 Payment Cryptography Data Plane's -// API operation TranslatePinData for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/TranslatePinData -func (c *PaymentCryptographyData) TranslatePinData(input *TranslatePinDataInput) (*TranslatePinDataOutput, error) { - req, out := c.TranslatePinDataRequest(input) - return out, req.Send() -} - -// TranslatePinDataWithContext is the same as TranslatePinData with the addition of -// the ability to pass a context and additional request options. -// -// See TranslatePinData 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 *PaymentCryptographyData) TranslatePinDataWithContext(ctx aws.Context, input *TranslatePinDataInput, opts ...request.Option) (*TranslatePinDataOutput, error) { - req, out := c.TranslatePinDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opVerifyAuthRequestCryptogram = "VerifyAuthRequestCryptogram" - -// VerifyAuthRequestCryptogramRequest generates a "aws/request.Request" representing the -// client's request for the VerifyAuthRequestCryptogram 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 VerifyAuthRequestCryptogram for more information on using the VerifyAuthRequestCryptogram -// 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 VerifyAuthRequestCryptogramRequest method. -// req, resp := client.VerifyAuthRequestCryptogramRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram -func (c *PaymentCryptographyData) VerifyAuthRequestCryptogramRequest(input *VerifyAuthRequestCryptogramInput) (req *request.Request, output *VerifyAuthRequestCryptogramOutput) { - op := &request.Operation{ - Name: opVerifyAuthRequestCryptogram, - HTTPMethod: "POST", - HTTPPath: "/cryptogram/verify", - } - - if input == nil { - input = &VerifyAuthRequestCryptogramInput{} - } - - output = &VerifyAuthRequestCryptogramOutput{} - req = c.newRequest(op, input, output) - return -} - -// VerifyAuthRequestCryptogram API operation for Payment Cryptography Data Plane. -// -// Verifies Authorization Request Cryptogram (ARQC) for a EMV chip payment card -// authorization. For more information, see Verify auth request cryptogram (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/data-operations.verifyauthrequestcryptogram.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// ARQC generation is done outside of Amazon Web Services Payment Cryptography -// and is typically generated on a point of sale terminal for an EMV chip card -// to obtain payment authorization during transaction time. For ARQC verification, -// you must first import the ARQC generated outside of Amazon Web Services Payment -// Cryptography by calling ImportKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html). -// This operation uses the imported ARQC and an major encryption key (DUKPT) -// created by calling CreateKey (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html) -// to either provide a boolean ARQC verification result or provide an APRC (Authorization -// Response Cryptogram) response using Method 1 or Method 2. The ARPC_METHOD_1 -// uses AuthResponseCode to generate ARPC and ARPC_METHOD_2 uses CardStatusUpdate -// to generate ARPC. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - VerifyCardValidationData -// -// - VerifyPinData -// -// 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 Payment Cryptography Data Plane's -// API operation VerifyAuthRequestCryptogram for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - VerificationFailedException -// This request failed verification. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram -func (c *PaymentCryptographyData) VerifyAuthRequestCryptogram(input *VerifyAuthRequestCryptogramInput) (*VerifyAuthRequestCryptogramOutput, error) { - req, out := c.VerifyAuthRequestCryptogramRequest(input) - return out, req.Send() -} - -// VerifyAuthRequestCryptogramWithContext is the same as VerifyAuthRequestCryptogram with the addition of -// the ability to pass a context and additional request options. -// -// See VerifyAuthRequestCryptogram 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 *PaymentCryptographyData) VerifyAuthRequestCryptogramWithContext(ctx aws.Context, input *VerifyAuthRequestCryptogramInput, opts ...request.Option) (*VerifyAuthRequestCryptogramOutput, error) { - req, out := c.VerifyAuthRequestCryptogramRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opVerifyCardValidationData = "VerifyCardValidationData" - -// VerifyCardValidationDataRequest generates a "aws/request.Request" representing the -// client's request for the VerifyCardValidationData 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 VerifyCardValidationData for more information on using the VerifyCardValidationData -// 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 VerifyCardValidationDataRequest method. -// req, resp := client.VerifyCardValidationDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyCardValidationData -func (c *PaymentCryptographyData) VerifyCardValidationDataRequest(input *VerifyCardValidationDataInput) (req *request.Request, output *VerifyCardValidationDataOutput) { - op := &request.Operation{ - Name: opVerifyCardValidationData, - HTTPMethod: "POST", - HTTPPath: "/cardvalidationdata/verify", - } - - if input == nil { - input = &VerifyCardValidationDataInput{} - } - - output = &VerifyCardValidationDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// VerifyCardValidationData API operation for Payment Cryptography Data Plane. -// -// Verifies card-related validation data using algorithms such as Card Verification -// Values (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2) and Card -// Security Codes (CSC). For more information, see Verify card data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/verify-card-data.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// This operation validates the CVV or CSC codes that is printed on a payment -// credit or debit card during card payment transaction. The input values are -// typically provided as part of an inbound transaction to an issuer or supporting -// platform partner. Amazon Web Services Payment Cryptography uses CVV or CSC, -// PAN (Primary Account Number) and expiration date of the card to check its -// validity during transaction processing. In this operation, the CVK (Card -// Verification Key) encryption key for use with card data verification is same -// as the one in used for GenerateCardValidationData. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - GenerateCardValidationData -// -// - VerifyAuthRequestCryptogram -// -// - VerifyPinData -// -// 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 Payment Cryptography Data Plane's -// API operation VerifyCardValidationData for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - VerificationFailedException -// This request failed verification. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyCardValidationData -func (c *PaymentCryptographyData) VerifyCardValidationData(input *VerifyCardValidationDataInput) (*VerifyCardValidationDataOutput, error) { - req, out := c.VerifyCardValidationDataRequest(input) - return out, req.Send() -} - -// VerifyCardValidationDataWithContext is the same as VerifyCardValidationData with the addition of -// the ability to pass a context and additional request options. -// -// See VerifyCardValidationData 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 *PaymentCryptographyData) VerifyCardValidationDataWithContext(ctx aws.Context, input *VerifyCardValidationDataInput, opts ...request.Option) (*VerifyCardValidationDataOutput, error) { - req, out := c.VerifyCardValidationDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opVerifyMac = "VerifyMac" - -// VerifyMacRequest generates a "aws/request.Request" representing the -// client's request for the VerifyMac 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 VerifyMac for more information on using the VerifyMac -// 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 VerifyMacRequest method. -// req, resp := client.VerifyMacRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyMac -func (c *PaymentCryptographyData) VerifyMacRequest(input *VerifyMacInput) (req *request.Request, output *VerifyMacOutput) { - op := &request.Operation{ - Name: opVerifyMac, - HTTPMethod: "POST", - HTTPPath: "/mac/verify", - } - - if input == nil { - input = &VerifyMacInput{} - } - - output = &VerifyMacOutput{} - req = c.newRequest(op, input, output) - return -} - -// VerifyMac API operation for Payment Cryptography Data Plane. -// -// Verifies a Message Authentication Code (MAC). -// -// You can use this operation when keys won't be shared but mutual data is present -// on both ends for validation. In this case, known data values are used to -// generate a MAC on both ends for verification without sending or receiving -// data in ciphertext or plaintext. You can use this operation to verify a DUPKT, -// HMAC or EMV MAC by setting generation attributes and algorithm to the associated -// values. Use the same encryption key for MAC verification as you use for GenerateMac. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - GenerateMac -// -// 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 Payment Cryptography Data Plane's -// API operation VerifyMac for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - VerificationFailedException -// This request failed verification. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyMac -func (c *PaymentCryptographyData) VerifyMac(input *VerifyMacInput) (*VerifyMacOutput, error) { - req, out := c.VerifyMacRequest(input) - return out, req.Send() -} - -// VerifyMacWithContext is the same as VerifyMac with the addition of -// the ability to pass a context and additional request options. -// -// See VerifyMac 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 *PaymentCryptographyData) VerifyMacWithContext(ctx aws.Context, input *VerifyMacInput, opts ...request.Option) (*VerifyMacOutput, error) { - req, out := c.VerifyMacRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opVerifyPinData = "VerifyPinData" - -// VerifyPinDataRequest generates a "aws/request.Request" representing the -// client's request for the VerifyPinData 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 VerifyPinData for more information on using the VerifyPinData -// 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 VerifyPinDataRequest method. -// req, resp := client.VerifyPinDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyPinData -func (c *PaymentCryptographyData) VerifyPinDataRequest(input *VerifyPinDataInput) (req *request.Request, output *VerifyPinDataOutput) { - op := &request.Operation{ - Name: opVerifyPinData, - HTTPMethod: "POST", - HTTPPath: "/pindata/verify", - } - - if input == nil { - input = &VerifyPinDataInput{} - } - - output = &VerifyPinDataOutput{} - req = c.newRequest(op, input, output) - return -} - -// VerifyPinData API operation for Payment Cryptography Data Plane. -// -// Verifies pin-related data such as PIN and PIN Offset using algorithms including -// VISA PVV and IBM3624. For more information, see Verify PIN data (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/verify-pin-data.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// This operation verifies PIN data for user payment card. A card holder PIN -// data is never transmitted in clear to or from Amazon Web Services Payment -// Cryptography. This operation uses PIN Verification Key (PVK) for PIN or PIN -// Offset generation and then encrypts it using PIN Encryption Key (PEK) to -// create an EncryptedPinBlock for transmission from Amazon Web Services Payment -// Cryptography. -// -// For information about valid keys for this operation, see Understanding key -// attributes (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) -// and Key types for specific data operations (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// Cross-account use: This operation can't be used across different Amazon Web -// Services accounts. -// -// Related operations: -// -// - GeneratePinData -// -// - TranslatePinData -// -// 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 Payment Cryptography Data Plane's -// API operation VerifyPinData for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request was denied due to an invalid request error. -// -// - VerificationFailedException -// This request failed verification. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request was denied due to an invalid resource error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03/VerifyPinData -func (c *PaymentCryptographyData) VerifyPinData(input *VerifyPinDataInput) (*VerifyPinDataOutput, error) { - req, out := c.VerifyPinDataRequest(input) - return out, req.Send() -} - -// VerifyPinDataWithContext is the same as VerifyPinData with the addition of -// the ability to pass a context and additional request options. -// -// See VerifyPinData 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 *PaymentCryptographyData) VerifyPinDataWithContext(ctx aws.Context, input *VerifyPinDataInput, opts ...request.Option) (*VerifyPinDataOutput, error) { - req, out := c.VerifyPinDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Card data parameters that are required to generate a Card Security Code (CSC2) -// for an AMEX payment card. -type AmexCardSecurityCodeVersion1 struct { - _ struct{} `type:"structure"` - - // The expiry date of a payment card. - // - // CardExpiryDate is a required field - CardExpiryDate *string `min:"4" 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 AmexCardSecurityCodeVersion1) 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 AmexCardSecurityCodeVersion1) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AmexCardSecurityCodeVersion1) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AmexCardSecurityCodeVersion1"} - if s.CardExpiryDate == nil { - invalidParams.Add(request.NewErrParamRequired("CardExpiryDate")) - } - if s.CardExpiryDate != nil && len(*s.CardExpiryDate) < 4 { - invalidParams.Add(request.NewErrParamMinLen("CardExpiryDate", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCardExpiryDate sets the CardExpiryDate field's value. -func (s *AmexCardSecurityCodeVersion1) SetCardExpiryDate(v string) *AmexCardSecurityCodeVersion1 { - s.CardExpiryDate = &v - return s -} - -// Card data parameters that are required to generate a Card Security Code (CSC2) -// for an AMEX payment card. -type AmexCardSecurityCodeVersion2 struct { - _ struct{} `type:"structure"` - - // The expiry date of a payment card. - // - // CardExpiryDate is a required field - CardExpiryDate *string `min:"4" type:"string" required:"true"` - - // The service code of the AMEX payment card. This is different from the Card - // Security Code (CSC). - // - // ServiceCode is a required field - ServiceCode *string `min:"3" 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 AmexCardSecurityCodeVersion2) 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 AmexCardSecurityCodeVersion2) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AmexCardSecurityCodeVersion2) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AmexCardSecurityCodeVersion2"} - if s.CardExpiryDate == nil { - invalidParams.Add(request.NewErrParamRequired("CardExpiryDate")) - } - if s.CardExpiryDate != nil && len(*s.CardExpiryDate) < 4 { - invalidParams.Add(request.NewErrParamMinLen("CardExpiryDate", 4)) - } - if s.ServiceCode == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceCode")) - } - if s.ServiceCode != nil && len(*s.ServiceCode) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceCode", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCardExpiryDate sets the CardExpiryDate field's value. -func (s *AmexCardSecurityCodeVersion2) SetCardExpiryDate(v string) *AmexCardSecurityCodeVersion2 { - s.CardExpiryDate = &v - return s -} - -// SetServiceCode sets the ServiceCode field's value. -func (s *AmexCardSecurityCodeVersion2) SetServiceCode(v string) *AmexCardSecurityCodeVersion2 { - s.ServiceCode = &v - return s -} - -// Parameters for plaintext encryption using asymmetric keys. -type AsymmetricEncryptionAttributes struct { - _ struct{} `type:"structure"` - - // The padding to be included with the data. - PaddingType *string `type:"string" enum:"PaddingType"` -} - -// 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 AsymmetricEncryptionAttributes) 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 AsymmetricEncryptionAttributes) GoString() string { - return s.String() -} - -// SetPaddingType sets the PaddingType field's value. -func (s *AsymmetricEncryptionAttributes) SetPaddingType(v string) *AsymmetricEncryptionAttributes { - s.PaddingType = &v - return s -} - -// Card data parameters that are required to generate Card Verification Values -// (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2), or Card Security -// Codes (CSC). -type CardGenerationAttributes struct { - _ struct{} `type:"structure"` - - // Card data parameters that are required to generate a Card Security Code (CSC2) - // for an AMEX payment card. - AmexCardSecurityCodeVersion1 *AmexCardSecurityCodeVersion1 `type:"structure"` - - // Card data parameters that are required to generate a Card Security Code (CSC2) - // for an AMEX payment card. - AmexCardSecurityCodeVersion2 *AmexCardSecurityCodeVersion2 `type:"structure"` - - // Card data parameters that are required to generate a cardholder verification - // value for the payment card. - CardHolderVerificationValue *CardHolderVerificationValue `type:"structure"` - - // Card data parameters that are required to generate Card Verification Value - // (CVV) for the payment card. - CardVerificationValue1 *CardVerificationValue1 `type:"structure"` - - // Card data parameters that are required to generate Card Verification Value - // (CVV2) for the payment card. - CardVerificationValue2 *CardVerificationValue2 `type:"structure"` - - // Card data parameters that are required to generate CDynamic Card Verification - // Code (dCVC) for the payment card. - DynamicCardVerificationCode *DynamicCardVerificationCode `type:"structure"` - - // Card data parameters that are required to generate CDynamic Card Verification - // Value (dCVV) for the payment card. - DynamicCardVerificationValue *DynamicCardVerificationValue `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 CardGenerationAttributes) 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 CardGenerationAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CardGenerationAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CardGenerationAttributes"} - if s.AmexCardSecurityCodeVersion1 != nil { - if err := s.AmexCardSecurityCodeVersion1.Validate(); err != nil { - invalidParams.AddNested("AmexCardSecurityCodeVersion1", err.(request.ErrInvalidParams)) - } - } - if s.AmexCardSecurityCodeVersion2 != nil { - if err := s.AmexCardSecurityCodeVersion2.Validate(); err != nil { - invalidParams.AddNested("AmexCardSecurityCodeVersion2", err.(request.ErrInvalidParams)) - } - } - if s.CardHolderVerificationValue != nil { - if err := s.CardHolderVerificationValue.Validate(); err != nil { - invalidParams.AddNested("CardHolderVerificationValue", err.(request.ErrInvalidParams)) - } - } - if s.CardVerificationValue1 != nil { - if err := s.CardVerificationValue1.Validate(); err != nil { - invalidParams.AddNested("CardVerificationValue1", err.(request.ErrInvalidParams)) - } - } - if s.CardVerificationValue2 != nil { - if err := s.CardVerificationValue2.Validate(); err != nil { - invalidParams.AddNested("CardVerificationValue2", err.(request.ErrInvalidParams)) - } - } - if s.DynamicCardVerificationCode != nil { - if err := s.DynamicCardVerificationCode.Validate(); err != nil { - invalidParams.AddNested("DynamicCardVerificationCode", err.(request.ErrInvalidParams)) - } - } - if s.DynamicCardVerificationValue != nil { - if err := s.DynamicCardVerificationValue.Validate(); err != nil { - invalidParams.AddNested("DynamicCardVerificationValue", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmexCardSecurityCodeVersion1 sets the AmexCardSecurityCodeVersion1 field's value. -func (s *CardGenerationAttributes) SetAmexCardSecurityCodeVersion1(v *AmexCardSecurityCodeVersion1) *CardGenerationAttributes { - s.AmexCardSecurityCodeVersion1 = v - return s -} - -// SetAmexCardSecurityCodeVersion2 sets the AmexCardSecurityCodeVersion2 field's value. -func (s *CardGenerationAttributes) SetAmexCardSecurityCodeVersion2(v *AmexCardSecurityCodeVersion2) *CardGenerationAttributes { - s.AmexCardSecurityCodeVersion2 = v - return s -} - -// SetCardHolderVerificationValue sets the CardHolderVerificationValue field's value. -func (s *CardGenerationAttributes) SetCardHolderVerificationValue(v *CardHolderVerificationValue) *CardGenerationAttributes { - s.CardHolderVerificationValue = v - return s -} - -// SetCardVerificationValue1 sets the CardVerificationValue1 field's value. -func (s *CardGenerationAttributes) SetCardVerificationValue1(v *CardVerificationValue1) *CardGenerationAttributes { - s.CardVerificationValue1 = v - return s -} - -// SetCardVerificationValue2 sets the CardVerificationValue2 field's value. -func (s *CardGenerationAttributes) SetCardVerificationValue2(v *CardVerificationValue2) *CardGenerationAttributes { - s.CardVerificationValue2 = v - return s -} - -// SetDynamicCardVerificationCode sets the DynamicCardVerificationCode field's value. -func (s *CardGenerationAttributes) SetDynamicCardVerificationCode(v *DynamicCardVerificationCode) *CardGenerationAttributes { - s.DynamicCardVerificationCode = v - return s -} - -// SetDynamicCardVerificationValue sets the DynamicCardVerificationValue field's value. -func (s *CardGenerationAttributes) SetDynamicCardVerificationValue(v *DynamicCardVerificationValue) *CardGenerationAttributes { - s.DynamicCardVerificationValue = v - return s -} - -// Card data parameters that are required to generate a cardholder verification -// value for the payment card. -type CardHolderVerificationValue struct { - _ struct{} `type:"structure"` - - // The transaction counter value that comes from a point of sale terminal. - // - // ApplicationTransactionCounter is a required field - ApplicationTransactionCounter *string `min:"2" type:"string" required:"true"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // A random number generated by the issuer. - // - // UnpredictableNumber is a required field - UnpredictableNumber *string `min:"2" 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 CardHolderVerificationValue) 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 CardHolderVerificationValue) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CardHolderVerificationValue) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CardHolderVerificationValue"} - if s.ApplicationTransactionCounter == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationTransactionCounter")) - } - if s.ApplicationTransactionCounter != nil && len(*s.ApplicationTransactionCounter) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationTransactionCounter", 2)) - } - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.UnpredictableNumber == nil { - invalidParams.Add(request.NewErrParamRequired("UnpredictableNumber")) - } - if s.UnpredictableNumber != nil && len(*s.UnpredictableNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("UnpredictableNumber", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationTransactionCounter sets the ApplicationTransactionCounter field's value. -func (s *CardHolderVerificationValue) SetApplicationTransactionCounter(v string) *CardHolderVerificationValue { - s.ApplicationTransactionCounter = &v - return s -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *CardHolderVerificationValue) SetPanSequenceNumber(v string) *CardHolderVerificationValue { - s.PanSequenceNumber = &v - return s -} - -// SetUnpredictableNumber sets the UnpredictableNumber field's value. -func (s *CardHolderVerificationValue) SetUnpredictableNumber(v string) *CardHolderVerificationValue { - s.UnpredictableNumber = &v - return s -} - -// Card data parameters that are requried to verify Card Verification Values -// (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2), or Card Security -// Codes (CSC). -type CardVerificationAttributes struct { - _ struct{} `type:"structure"` - - // Card data parameters that are required to generate a Card Security Code (CSC2) - // for an AMEX payment card. - AmexCardSecurityCodeVersion1 *AmexCardSecurityCodeVersion1 `type:"structure"` - - // Card data parameters that are required to verify a Card Security Code (CSC2) - // for an AMEX payment card. - AmexCardSecurityCodeVersion2 *AmexCardSecurityCodeVersion2 `type:"structure"` - - // Card data parameters that are required to verify a cardholder verification - // value for the payment card. - CardHolderVerificationValue *CardHolderVerificationValue `type:"structure"` - - // Card data parameters that are required to verify Card Verification Value - // (CVV) for the payment card. - CardVerificationValue1 *CardVerificationValue1 `type:"structure"` - - // Card data parameters that are required to verify Card Verification Value - // (CVV2) for the payment card. - CardVerificationValue2 *CardVerificationValue2 `type:"structure"` - - // Card data parameters that are required to verify CDynamic Card Verification - // Code (dCVC) for the payment card. - DiscoverDynamicCardVerificationCode *DiscoverDynamicCardVerificationCode `type:"structure"` - - // Card data parameters that are required to verify CDynamic Card Verification - // Code (dCVC) for the payment card. - DynamicCardVerificationCode *DynamicCardVerificationCode `type:"structure"` - - // Card data parameters that are required to verify CDynamic Card Verification - // Value (dCVV) for the payment card. - DynamicCardVerificationValue *DynamicCardVerificationValue `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 CardVerificationAttributes) 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 CardVerificationAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CardVerificationAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CardVerificationAttributes"} - if s.AmexCardSecurityCodeVersion1 != nil { - if err := s.AmexCardSecurityCodeVersion1.Validate(); err != nil { - invalidParams.AddNested("AmexCardSecurityCodeVersion1", err.(request.ErrInvalidParams)) - } - } - if s.AmexCardSecurityCodeVersion2 != nil { - if err := s.AmexCardSecurityCodeVersion2.Validate(); err != nil { - invalidParams.AddNested("AmexCardSecurityCodeVersion2", err.(request.ErrInvalidParams)) - } - } - if s.CardHolderVerificationValue != nil { - if err := s.CardHolderVerificationValue.Validate(); err != nil { - invalidParams.AddNested("CardHolderVerificationValue", err.(request.ErrInvalidParams)) - } - } - if s.CardVerificationValue1 != nil { - if err := s.CardVerificationValue1.Validate(); err != nil { - invalidParams.AddNested("CardVerificationValue1", err.(request.ErrInvalidParams)) - } - } - if s.CardVerificationValue2 != nil { - if err := s.CardVerificationValue2.Validate(); err != nil { - invalidParams.AddNested("CardVerificationValue2", err.(request.ErrInvalidParams)) - } - } - if s.DiscoverDynamicCardVerificationCode != nil { - if err := s.DiscoverDynamicCardVerificationCode.Validate(); err != nil { - invalidParams.AddNested("DiscoverDynamicCardVerificationCode", err.(request.ErrInvalidParams)) - } - } - if s.DynamicCardVerificationCode != nil { - if err := s.DynamicCardVerificationCode.Validate(); err != nil { - invalidParams.AddNested("DynamicCardVerificationCode", err.(request.ErrInvalidParams)) - } - } - if s.DynamicCardVerificationValue != nil { - if err := s.DynamicCardVerificationValue.Validate(); err != nil { - invalidParams.AddNested("DynamicCardVerificationValue", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmexCardSecurityCodeVersion1 sets the AmexCardSecurityCodeVersion1 field's value. -func (s *CardVerificationAttributes) SetAmexCardSecurityCodeVersion1(v *AmexCardSecurityCodeVersion1) *CardVerificationAttributes { - s.AmexCardSecurityCodeVersion1 = v - return s -} - -// SetAmexCardSecurityCodeVersion2 sets the AmexCardSecurityCodeVersion2 field's value. -func (s *CardVerificationAttributes) SetAmexCardSecurityCodeVersion2(v *AmexCardSecurityCodeVersion2) *CardVerificationAttributes { - s.AmexCardSecurityCodeVersion2 = v - return s -} - -// SetCardHolderVerificationValue sets the CardHolderVerificationValue field's value. -func (s *CardVerificationAttributes) SetCardHolderVerificationValue(v *CardHolderVerificationValue) *CardVerificationAttributes { - s.CardHolderVerificationValue = v - return s -} - -// SetCardVerificationValue1 sets the CardVerificationValue1 field's value. -func (s *CardVerificationAttributes) SetCardVerificationValue1(v *CardVerificationValue1) *CardVerificationAttributes { - s.CardVerificationValue1 = v - return s -} - -// SetCardVerificationValue2 sets the CardVerificationValue2 field's value. -func (s *CardVerificationAttributes) SetCardVerificationValue2(v *CardVerificationValue2) *CardVerificationAttributes { - s.CardVerificationValue2 = v - return s -} - -// SetDiscoverDynamicCardVerificationCode sets the DiscoverDynamicCardVerificationCode field's value. -func (s *CardVerificationAttributes) SetDiscoverDynamicCardVerificationCode(v *DiscoverDynamicCardVerificationCode) *CardVerificationAttributes { - s.DiscoverDynamicCardVerificationCode = v - return s -} - -// SetDynamicCardVerificationCode sets the DynamicCardVerificationCode field's value. -func (s *CardVerificationAttributes) SetDynamicCardVerificationCode(v *DynamicCardVerificationCode) *CardVerificationAttributes { - s.DynamicCardVerificationCode = v - return s -} - -// SetDynamicCardVerificationValue sets the DynamicCardVerificationValue field's value. -func (s *CardVerificationAttributes) SetDynamicCardVerificationValue(v *DynamicCardVerificationValue) *CardVerificationAttributes { - s.DynamicCardVerificationValue = v - return s -} - -// Card data parameters that are required to verify CVV (Card Verification Value) -// for the payment card. -type CardVerificationValue1 struct { - _ struct{} `type:"structure"` - - // The expiry date of a payment card. - // - // CardExpiryDate is a required field - CardExpiryDate *string `min:"4" type:"string" required:"true"` - - // The service code of the payment card. This is different from Card Security - // Code (CSC). - // - // ServiceCode is a required field - ServiceCode *string `min:"3" 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 CardVerificationValue1) 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 CardVerificationValue1) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CardVerificationValue1) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CardVerificationValue1"} - if s.CardExpiryDate == nil { - invalidParams.Add(request.NewErrParamRequired("CardExpiryDate")) - } - if s.CardExpiryDate != nil && len(*s.CardExpiryDate) < 4 { - invalidParams.Add(request.NewErrParamMinLen("CardExpiryDate", 4)) - } - if s.ServiceCode == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceCode")) - } - if s.ServiceCode != nil && len(*s.ServiceCode) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceCode", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCardExpiryDate sets the CardExpiryDate field's value. -func (s *CardVerificationValue1) SetCardExpiryDate(v string) *CardVerificationValue1 { - s.CardExpiryDate = &v - return s -} - -// SetServiceCode sets the ServiceCode field's value. -func (s *CardVerificationValue1) SetServiceCode(v string) *CardVerificationValue1 { - s.ServiceCode = &v - return s -} - -// Card data parameters that are required to verify Card Verification Value -// (CVV2) for the payment card. -type CardVerificationValue2 struct { - _ struct{} `type:"structure"` - - // The expiry date of a payment card. - // - // CardExpiryDate is a required field - CardExpiryDate *string `min:"4" 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 CardVerificationValue2) 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 CardVerificationValue2) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CardVerificationValue2) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CardVerificationValue2"} - if s.CardExpiryDate == nil { - invalidParams.Add(request.NewErrParamRequired("CardExpiryDate")) - } - if s.CardExpiryDate != nil && len(*s.CardExpiryDate) < 4 { - invalidParams.Add(request.NewErrParamMinLen("CardExpiryDate", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCardExpiryDate sets the CardExpiryDate field's value. -func (s *CardVerificationValue2) SetCardExpiryDate(v string) *CardVerificationValue2 { - s.CardExpiryDate = &v - return s -} - -// Parameters that are required for Authorization Response Cryptogram (ARPC) -// generation after Authorization Request Cryptogram (ARQC) verification is -// successful. -type CryptogramAuthResponse struct { - _ struct{} `type:"structure"` - - // Parameters that are required for ARPC response generation using method1 after - // ARQC verification is successful. - ArpcMethod1 *CryptogramVerificationArpcMethod1 `type:"structure"` - - // Parameters that are required for ARPC response generation using method2 after - // ARQC verification is successful. - ArpcMethod2 *CryptogramVerificationArpcMethod2 `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 CryptogramAuthResponse) 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 CryptogramAuthResponse) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CryptogramAuthResponse) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CryptogramAuthResponse"} - if s.ArpcMethod1 != nil { - if err := s.ArpcMethod1.Validate(); err != nil { - invalidParams.AddNested("ArpcMethod1", err.(request.ErrInvalidParams)) - } - } - if s.ArpcMethod2 != nil { - if err := s.ArpcMethod2.Validate(); err != nil { - invalidParams.AddNested("ArpcMethod2", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArpcMethod1 sets the ArpcMethod1 field's value. -func (s *CryptogramAuthResponse) SetArpcMethod1(v *CryptogramVerificationArpcMethod1) *CryptogramAuthResponse { - s.ArpcMethod1 = v - return s -} - -// SetArpcMethod2 sets the ArpcMethod2 field's value. -func (s *CryptogramAuthResponse) SetArpcMethod2(v *CryptogramVerificationArpcMethod2) *CryptogramAuthResponse { - s.ArpcMethod2 = v - return s -} - -// Parameters that are required for ARPC response generation using method1 after -// ARQC verification is successful. -type CryptogramVerificationArpcMethod1 struct { - _ struct{} `type:"structure"` - - // The auth code used to calculate APRC after ARQC verification is successful. - // This is the same auth code used for ARQC generation outside of Amazon Web - // Services Payment Cryptography. - // - // AuthResponseCode is a required field - AuthResponseCode *string `min:"4" 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 CryptogramVerificationArpcMethod1) 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 CryptogramVerificationArpcMethod1) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CryptogramVerificationArpcMethod1) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CryptogramVerificationArpcMethod1"} - if s.AuthResponseCode == nil { - invalidParams.Add(request.NewErrParamRequired("AuthResponseCode")) - } - if s.AuthResponseCode != nil && len(*s.AuthResponseCode) < 4 { - invalidParams.Add(request.NewErrParamMinLen("AuthResponseCode", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthResponseCode sets the AuthResponseCode field's value. -func (s *CryptogramVerificationArpcMethod1) SetAuthResponseCode(v string) *CryptogramVerificationArpcMethod1 { - s.AuthResponseCode = &v - return s -} - -// Parameters that are required for ARPC response generation using method2 after -// ARQC verification is successful. -type CryptogramVerificationArpcMethod2 struct { - _ struct{} `type:"structure"` - - // The data indicating whether the issuer approves or declines an online transaction - // using an EMV chip card. - // - // CardStatusUpdate is a required field - CardStatusUpdate *string `min:"8" type:"string" required:"true"` - - // The proprietary authentication data used by issuer for communication during - // online transaction using an EMV chip card. - ProprietaryAuthenticationData *string `min:"1" 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 CryptogramVerificationArpcMethod2) 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 CryptogramVerificationArpcMethod2) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CryptogramVerificationArpcMethod2) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CryptogramVerificationArpcMethod2"} - if s.CardStatusUpdate == nil { - invalidParams.Add(request.NewErrParamRequired("CardStatusUpdate")) - } - if s.CardStatusUpdate != nil && len(*s.CardStatusUpdate) < 8 { - invalidParams.Add(request.NewErrParamMinLen("CardStatusUpdate", 8)) - } - if s.ProprietaryAuthenticationData != nil && len(*s.ProprietaryAuthenticationData) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProprietaryAuthenticationData", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCardStatusUpdate sets the CardStatusUpdate field's value. -func (s *CryptogramVerificationArpcMethod2) SetCardStatusUpdate(v string) *CryptogramVerificationArpcMethod2 { - s.CardStatusUpdate = &v - return s -} - -// SetProprietaryAuthenticationData sets the ProprietaryAuthenticationData field's value. -func (s *CryptogramVerificationArpcMethod2) SetProprietaryAuthenticationData(v string) *CryptogramVerificationArpcMethod2 { - s.ProprietaryAuthenticationData = &v - return s -} - -type DecryptDataInput struct { - _ struct{} `type:"structure"` - - // The ciphertext to decrypt. - // - // CipherText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DecryptDataInput's - // String and GoString methods. - // - // CipherText is a required field - CipherText *string `min:"16" type:"string" required:"true" sensitive:"true"` - - // The encryption key type and attributes for ciphertext decryption. - // - // DecryptionAttributes is a required field - DecryptionAttributes *EncryptionDecryptionAttributes `type:"structure" required:"true"` - - // The keyARN of the encryption key that Amazon Web Services Payment Cryptography - // uses for ciphertext decryption. - // - // KeyIdentifier is a required field - KeyIdentifier *string `location:"uri" locationName:"KeyIdentifier" min:"7" 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 DecryptDataInput) 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 DecryptDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DecryptDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DecryptDataInput"} - if s.CipherText == nil { - invalidParams.Add(request.NewErrParamRequired("CipherText")) - } - if s.CipherText != nil && len(*s.CipherText) < 16 { - invalidParams.Add(request.NewErrParamMinLen("CipherText", 16)) - } - if s.DecryptionAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("DecryptionAttributes")) - } - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - if s.DecryptionAttributes != nil { - if err := s.DecryptionAttributes.Validate(); err != nil { - invalidParams.AddNested("DecryptionAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCipherText sets the CipherText field's value. -func (s *DecryptDataInput) SetCipherText(v string) *DecryptDataInput { - s.CipherText = &v - return s -} - -// SetDecryptionAttributes sets the DecryptionAttributes field's value. -func (s *DecryptDataInput) SetDecryptionAttributes(v *EncryptionDecryptionAttributes) *DecryptDataInput { - s.DecryptionAttributes = v - return s -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *DecryptDataInput) SetKeyIdentifier(v string) *DecryptDataInput { - s.KeyIdentifier = &v - return s -} - -type DecryptDataOutput struct { - _ struct{} `type:"structure"` - - // The keyARN of the encryption key that Amazon Web Services Payment Cryptography - // uses for ciphertext decryption. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The decrypted plaintext data. - // - // PlainText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DecryptDataOutput's - // String and GoString methods. - // - // PlainText is a required field - PlainText *string `min:"16" type:"string" required:"true" sensitive:"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 DecryptDataOutput) 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 DecryptDataOutput) GoString() string { - return s.String() -} - -// SetKeyArn sets the KeyArn field's value. -func (s *DecryptDataOutput) SetKeyArn(v string) *DecryptDataOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *DecryptDataOutput) SetKeyCheckValue(v string) *DecryptDataOutput { - s.KeyCheckValue = &v - return s -} - -// SetPlainText sets the PlainText field's value. -func (s *DecryptDataOutput) SetPlainText(v string) *DecryptDataOutput { - s.PlainText = &v - return s -} - -// Parameters that are required to generate or verify dCVC (Dynamic Card Verification -// Code). -type DiscoverDynamicCardVerificationCode struct { - _ struct{} `type:"structure"` - - // The transaction counter value that comes from the terminal. - // - // ApplicationTransactionCounter is a required field - ApplicationTransactionCounter *string `min:"2" type:"string" required:"true"` - - // The expiry date of a payment card. - // - // CardExpiryDate is a required field - CardExpiryDate *string `min:"4" type:"string" required:"true"` - - // A random number that is generated by the issuer. - // - // UnpredictableNumber is a required field - UnpredictableNumber *string `min:"2" 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 DiscoverDynamicCardVerificationCode) 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 DiscoverDynamicCardVerificationCode) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DiscoverDynamicCardVerificationCode) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DiscoverDynamicCardVerificationCode"} - if s.ApplicationTransactionCounter == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationTransactionCounter")) - } - if s.ApplicationTransactionCounter != nil && len(*s.ApplicationTransactionCounter) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationTransactionCounter", 2)) - } - if s.CardExpiryDate == nil { - invalidParams.Add(request.NewErrParamRequired("CardExpiryDate")) - } - if s.CardExpiryDate != nil && len(*s.CardExpiryDate) < 4 { - invalidParams.Add(request.NewErrParamMinLen("CardExpiryDate", 4)) - } - if s.UnpredictableNumber == nil { - invalidParams.Add(request.NewErrParamRequired("UnpredictableNumber")) - } - if s.UnpredictableNumber != nil && len(*s.UnpredictableNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("UnpredictableNumber", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationTransactionCounter sets the ApplicationTransactionCounter field's value. -func (s *DiscoverDynamicCardVerificationCode) SetApplicationTransactionCounter(v string) *DiscoverDynamicCardVerificationCode { - s.ApplicationTransactionCounter = &v - return s -} - -// SetCardExpiryDate sets the CardExpiryDate field's value. -func (s *DiscoverDynamicCardVerificationCode) SetCardExpiryDate(v string) *DiscoverDynamicCardVerificationCode { - s.CardExpiryDate = &v - return s -} - -// SetUnpredictableNumber sets the UnpredictableNumber field's value. -func (s *DiscoverDynamicCardVerificationCode) SetUnpredictableNumber(v string) *DiscoverDynamicCardVerificationCode { - s.UnpredictableNumber = &v - return s -} - -// Parameters that are used for Derived Unique Key Per Transaction (DUKPT) derivation -// algorithm. -type DukptAttributes struct { - _ struct{} `type:"structure"` - - // The key type derived using DUKPT from a Base Derivation Key (BDK) and Key - // Serial Number (KSN). This must be less than or equal to the strength of the - // BDK. For example, you can't use AES_128 as a derivation type for a BDK of - // AES_128 or TDES_2KEY. - // - // DukptDerivationType is a required field - DukptDerivationType *string `type:"string" required:"true" enum:"DukptDerivationType"` - - // The unique identifier known as Key Serial Number (KSN) that comes from an - // encrypting device using DUKPT encryption method. The KSN is derived from - // the encrypting device unique identifier and an internal transaction counter. - // - // KeySerialNumber is a required field - KeySerialNumber *string `min:"10" 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 DukptAttributes) 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 DukptAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DukptAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DukptAttributes"} - if s.DukptDerivationType == nil { - invalidParams.Add(request.NewErrParamRequired("DukptDerivationType")) - } - if s.KeySerialNumber == nil { - invalidParams.Add(request.NewErrParamRequired("KeySerialNumber")) - } - if s.KeySerialNumber != nil && len(*s.KeySerialNumber) < 10 { - invalidParams.Add(request.NewErrParamMinLen("KeySerialNumber", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDukptDerivationType sets the DukptDerivationType field's value. -func (s *DukptAttributes) SetDukptDerivationType(v string) *DukptAttributes { - s.DukptDerivationType = &v - return s -} - -// SetKeySerialNumber sets the KeySerialNumber field's value. -func (s *DukptAttributes) SetKeySerialNumber(v string) *DukptAttributes { - s.KeySerialNumber = &v - return s -} - -// Parameters required for encryption or decryption of data using DUKPT. -type DukptDerivationAttributes struct { - _ struct{} `type:"structure"` - - // The key type derived using DUKPT from a Base Derivation Key (BDK) and Key - // Serial Number (KSN). This must be less than or equal to the strength of the - // BDK. For example, you can't use AES_128 as a derivation type for a BDK of - // AES_128 or TDES_2KEY - DukptKeyDerivationType *string `type:"string" enum:"DukptDerivationType"` - - // The type of use of DUKPT, which can be for incoming data decryption, outgoing - // data encryption, or both. - DukptKeyVariant *string `type:"string" enum:"DukptKeyVariant"` - - // The unique identifier known as Key Serial Number (KSN) that comes from an - // encrypting device using DUKPT encryption method. The KSN is derived from - // the encrypting device unique identifier and an internal transaction counter. - // - // KeySerialNumber is a required field - KeySerialNumber *string `min:"10" 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 DukptDerivationAttributes) 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 DukptDerivationAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DukptDerivationAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DukptDerivationAttributes"} - if s.KeySerialNumber == nil { - invalidParams.Add(request.NewErrParamRequired("KeySerialNumber")) - } - if s.KeySerialNumber != nil && len(*s.KeySerialNumber) < 10 { - invalidParams.Add(request.NewErrParamMinLen("KeySerialNumber", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDukptKeyDerivationType sets the DukptKeyDerivationType field's value. -func (s *DukptDerivationAttributes) SetDukptKeyDerivationType(v string) *DukptDerivationAttributes { - s.DukptKeyDerivationType = &v - return s -} - -// SetDukptKeyVariant sets the DukptKeyVariant field's value. -func (s *DukptDerivationAttributes) SetDukptKeyVariant(v string) *DukptDerivationAttributes { - s.DukptKeyVariant = &v - return s -} - -// SetKeySerialNumber sets the KeySerialNumber field's value. -func (s *DukptDerivationAttributes) SetKeySerialNumber(v string) *DukptDerivationAttributes { - s.KeySerialNumber = &v - return s -} - -// Parameters that are required to encrypt plaintext data using DUKPT. -type DukptEncryptionAttributes struct { - _ struct{} `type:"structure"` - - // The key type encrypted using DUKPT from a Base Derivation Key (BDK) and Key - // Serial Number (KSN). This must be less than or equal to the strength of the - // BDK. For example, you can't use AES_128 as a derivation type for a BDK of - // AES_128 or TDES_2KEY - DukptKeyDerivationType *string `type:"string" enum:"DukptDerivationType"` - - // The type of use of DUKPT, which can be incoming data decryption, outgoing - // data encryption, or both. - DukptKeyVariant *string `type:"string" enum:"DukptKeyVariant"` - - // An input to cryptographic primitive used to provide the intial state. Typically - // the InitializationVector must have a random or psuedo-random value, but sometimes - // it only needs to be unpredictable or unique. If you don't provide a value, - // Amazon Web Services Payment Cryptography generates a random value. - // - // InitializationVector is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DukptEncryptionAttributes's - // String and GoString methods. - InitializationVector *string `min:"16" type:"string" sensitive:"true"` - - // The unique identifier known as Key Serial Number (KSN) that comes from an - // encrypting device using DUKPT encryption method. The KSN is derived from - // the encrypting device unique identifier and an internal transaction counter. - // - // KeySerialNumber is a required field - KeySerialNumber *string `min:"10" type:"string" required:"true"` - - // The block cipher mode of operation. Block ciphers are designed to encrypt - // a block of data of fixed size, for example, 128 bits. The size of the input - // block is usually same as the size of the encrypted output block, while the - // key length can be different. A mode of operation describes how to repeatedly - // apply a cipher's single-block operation to securely transform amounts of - // data larger than a block. - // - // The default is CBC. - Mode *string `type:"string" enum:"DukptEncryptionMode"` -} - -// 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 DukptEncryptionAttributes) 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 DukptEncryptionAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DukptEncryptionAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DukptEncryptionAttributes"} - if s.InitializationVector != nil && len(*s.InitializationVector) < 16 { - invalidParams.Add(request.NewErrParamMinLen("InitializationVector", 16)) - } - if s.KeySerialNumber == nil { - invalidParams.Add(request.NewErrParamRequired("KeySerialNumber")) - } - if s.KeySerialNumber != nil && len(*s.KeySerialNumber) < 10 { - invalidParams.Add(request.NewErrParamMinLen("KeySerialNumber", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDukptKeyDerivationType sets the DukptKeyDerivationType field's value. -func (s *DukptEncryptionAttributes) SetDukptKeyDerivationType(v string) *DukptEncryptionAttributes { - s.DukptKeyDerivationType = &v - return s -} - -// SetDukptKeyVariant sets the DukptKeyVariant field's value. -func (s *DukptEncryptionAttributes) SetDukptKeyVariant(v string) *DukptEncryptionAttributes { - s.DukptKeyVariant = &v - return s -} - -// SetInitializationVector sets the InitializationVector field's value. -func (s *DukptEncryptionAttributes) SetInitializationVector(v string) *DukptEncryptionAttributes { - s.InitializationVector = &v - return s -} - -// SetKeySerialNumber sets the KeySerialNumber field's value. -func (s *DukptEncryptionAttributes) SetKeySerialNumber(v string) *DukptEncryptionAttributes { - s.KeySerialNumber = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *DukptEncryptionAttributes) SetMode(v string) *DukptEncryptionAttributes { - s.Mode = &v - return s -} - -// Parameters that are required to generate or verify Dynamic Card Verification -// Value (dCVV). -type DynamicCardVerificationCode struct { - _ struct{} `type:"structure"` - - // The transaction counter value that comes from the terminal. - // - // ApplicationTransactionCounter is a required field - ApplicationTransactionCounter *string `min:"2" type:"string" required:"true"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // The data on the two tracks of magnetic cards used for financial transactions. - // This includes the cardholder name, PAN, expiration date, bank ID (BIN) and - // several other numbers the issuing bank uses to validate the data received. - // - // TrackData is a required field - TrackData *string `min:"2" type:"string" required:"true"` - - // A random number generated by the issuer. - // - // UnpredictableNumber is a required field - UnpredictableNumber *string `min:"2" 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 DynamicCardVerificationCode) 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 DynamicCardVerificationCode) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DynamicCardVerificationCode) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DynamicCardVerificationCode"} - if s.ApplicationTransactionCounter == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationTransactionCounter")) - } - if s.ApplicationTransactionCounter != nil && len(*s.ApplicationTransactionCounter) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationTransactionCounter", 2)) - } - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.TrackData == nil { - invalidParams.Add(request.NewErrParamRequired("TrackData")) - } - if s.TrackData != nil && len(*s.TrackData) < 2 { - invalidParams.Add(request.NewErrParamMinLen("TrackData", 2)) - } - if s.UnpredictableNumber == nil { - invalidParams.Add(request.NewErrParamRequired("UnpredictableNumber")) - } - if s.UnpredictableNumber != nil && len(*s.UnpredictableNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("UnpredictableNumber", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationTransactionCounter sets the ApplicationTransactionCounter field's value. -func (s *DynamicCardVerificationCode) SetApplicationTransactionCounter(v string) *DynamicCardVerificationCode { - s.ApplicationTransactionCounter = &v - return s -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *DynamicCardVerificationCode) SetPanSequenceNumber(v string) *DynamicCardVerificationCode { - s.PanSequenceNumber = &v - return s -} - -// SetTrackData sets the TrackData field's value. -func (s *DynamicCardVerificationCode) SetTrackData(v string) *DynamicCardVerificationCode { - s.TrackData = &v - return s -} - -// SetUnpredictableNumber sets the UnpredictableNumber field's value. -func (s *DynamicCardVerificationCode) SetUnpredictableNumber(v string) *DynamicCardVerificationCode { - s.UnpredictableNumber = &v - return s -} - -// Parameters that are required to generate or verify Dynamic Card Verification -// Value (dCVV). -type DynamicCardVerificationValue struct { - _ struct{} `type:"structure"` - - // The transaction counter value that comes from the terminal. - // - // ApplicationTransactionCounter is a required field - ApplicationTransactionCounter *string `min:"2" type:"string" required:"true"` - - // The expiry date of a payment card. - // - // CardExpiryDate is a required field - CardExpiryDate *string `min:"4" type:"string" required:"true"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // The service code of the payment card. This is different from Card Security - // Code (CSC). - // - // ServiceCode is a required field - ServiceCode *string `min:"3" 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 DynamicCardVerificationValue) 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 DynamicCardVerificationValue) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DynamicCardVerificationValue) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DynamicCardVerificationValue"} - if s.ApplicationTransactionCounter == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationTransactionCounter")) - } - if s.ApplicationTransactionCounter != nil && len(*s.ApplicationTransactionCounter) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationTransactionCounter", 2)) - } - if s.CardExpiryDate == nil { - invalidParams.Add(request.NewErrParamRequired("CardExpiryDate")) - } - if s.CardExpiryDate != nil && len(*s.CardExpiryDate) < 4 { - invalidParams.Add(request.NewErrParamMinLen("CardExpiryDate", 4)) - } - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.ServiceCode == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceCode")) - } - if s.ServiceCode != nil && len(*s.ServiceCode) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceCode", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationTransactionCounter sets the ApplicationTransactionCounter field's value. -func (s *DynamicCardVerificationValue) SetApplicationTransactionCounter(v string) *DynamicCardVerificationValue { - s.ApplicationTransactionCounter = &v - return s -} - -// SetCardExpiryDate sets the CardExpiryDate field's value. -func (s *DynamicCardVerificationValue) SetCardExpiryDate(v string) *DynamicCardVerificationValue { - s.CardExpiryDate = &v - return s -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *DynamicCardVerificationValue) SetPanSequenceNumber(v string) *DynamicCardVerificationValue { - s.PanSequenceNumber = &v - return s -} - -// SetServiceCode sets the ServiceCode field's value. -func (s *DynamicCardVerificationValue) SetServiceCode(v string) *DynamicCardVerificationValue { - s.ServiceCode = &v - return s -} - -type EncryptDataInput struct { - _ struct{} `type:"structure"` - - // The encryption key type and attributes for plaintext encryption. - // - // EncryptionAttributes is a required field - EncryptionAttributes *EncryptionDecryptionAttributes `type:"structure" required:"true"` - - // The keyARN of the encryption key that Amazon Web Services Payment Cryptography - // uses for plaintext encryption. - // - // KeyIdentifier is a required field - KeyIdentifier *string `location:"uri" locationName:"KeyIdentifier" min:"7" type:"string" required:"true"` - - // The plaintext to be encrypted. - // - // PlainText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EncryptDataInput's - // String and GoString methods. - // - // PlainText is a required field - PlainText *string `min:"16" type:"string" required:"true" sensitive:"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 EncryptDataInput) 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 EncryptDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptDataInput"} - if s.EncryptionAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionAttributes")) - } - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - if s.PlainText == nil { - invalidParams.Add(request.NewErrParamRequired("PlainText")) - } - if s.PlainText != nil && len(*s.PlainText) < 16 { - invalidParams.Add(request.NewErrParamMinLen("PlainText", 16)) - } - if s.EncryptionAttributes != nil { - if err := s.EncryptionAttributes.Validate(); err != nil { - invalidParams.AddNested("EncryptionAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionAttributes sets the EncryptionAttributes field's value. -func (s *EncryptDataInput) SetEncryptionAttributes(v *EncryptionDecryptionAttributes) *EncryptDataInput { - s.EncryptionAttributes = v - return s -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *EncryptDataInput) SetKeyIdentifier(v string) *EncryptDataInput { - s.KeyIdentifier = &v - return s -} - -// SetPlainText sets the PlainText field's value. -func (s *EncryptDataInput) SetPlainText(v string) *EncryptDataInput { - s.PlainText = &v - return s -} - -type EncryptDataOutput struct { - _ struct{} `type:"structure"` - - // The encrypted ciphertext. - // - // CipherText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EncryptDataOutput's - // String and GoString methods. - // - // CipherText is a required field - CipherText *string `min:"16" type:"string" required:"true" sensitive:"true"` - - // The keyARN of the encryption key that Amazon Web Services Payment Cryptography - // uses for plaintext encryption. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - KeyCheckValue *string `min:"4" 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 EncryptDataOutput) 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 EncryptDataOutput) GoString() string { - return s.String() -} - -// SetCipherText sets the CipherText field's value. -func (s *EncryptDataOutput) SetCipherText(v string) *EncryptDataOutput { - s.CipherText = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *EncryptDataOutput) SetKeyArn(v string) *EncryptDataOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *EncryptDataOutput) SetKeyCheckValue(v string) *EncryptDataOutput { - s.KeyCheckValue = &v - return s -} - -// Parameters that are required to perform encryption and decryption operations. -type EncryptionDecryptionAttributes struct { - _ struct{} `type:"structure"` - - // Parameters for plaintext encryption using asymmetric keys. - Asymmetric *AsymmetricEncryptionAttributes `type:"structure"` - - // Parameters that are required to encrypt plaintext data using DUKPT. - Dukpt *DukptEncryptionAttributes `type:"structure"` - - // Parameters that are required to perform encryption and decryption using symmetric - // keys. - Symmetric *SymmetricEncryptionAttributes `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 EncryptionDecryptionAttributes) 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 EncryptionDecryptionAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptionDecryptionAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptionDecryptionAttributes"} - if s.Dukpt != nil { - if err := s.Dukpt.Validate(); err != nil { - invalidParams.AddNested("Dukpt", err.(request.ErrInvalidParams)) - } - } - if s.Symmetric != nil { - if err := s.Symmetric.Validate(); err != nil { - invalidParams.AddNested("Symmetric", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAsymmetric sets the Asymmetric field's value. -func (s *EncryptionDecryptionAttributes) SetAsymmetric(v *AsymmetricEncryptionAttributes) *EncryptionDecryptionAttributes { - s.Asymmetric = v - return s -} - -// SetDukpt sets the Dukpt field's value. -func (s *EncryptionDecryptionAttributes) SetDukpt(v *DukptEncryptionAttributes) *EncryptionDecryptionAttributes { - s.Dukpt = v - return s -} - -// SetSymmetric sets the Symmetric field's value. -func (s *EncryptionDecryptionAttributes) SetSymmetric(v *SymmetricEncryptionAttributes) *EncryptionDecryptionAttributes { - s.Symmetric = v - return s -} - -type GenerateCardValidationDataInput struct { - _ struct{} `type:"structure"` - - // The algorithm for generating CVV or CSC values for the card within Amazon - // Web Services Payment Cryptography. - // - // GenerationAttributes is a required field - GenerationAttributes *CardGenerationAttributes `type:"structure" required:"true"` - - // The keyARN of the CVK encryption key that Amazon Web Services Payment Cryptography - // uses to generate card data. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The Primary Account Number (PAN), a unique identifier for a payment credit - // or debit card that associates the card with a specific account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GenerateCardValidationDataInput's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"true"` - - // The length of the CVV or CSC to be generated. The default value is 3. - ValidationDataLength *int64 `min:"3" 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 GenerateCardValidationDataInput) 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 GenerateCardValidationDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GenerateCardValidationDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GenerateCardValidationDataInput"} - if s.GenerationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("GenerationAttributes")) - } - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - if s.ValidationDataLength != nil && *s.ValidationDataLength < 3 { - invalidParams.Add(request.NewErrParamMinValue("ValidationDataLength", 3)) - } - if s.GenerationAttributes != nil { - if err := s.GenerationAttributes.Validate(); err != nil { - invalidParams.AddNested("GenerationAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGenerationAttributes sets the GenerationAttributes field's value. -func (s *GenerateCardValidationDataInput) SetGenerationAttributes(v *CardGenerationAttributes) *GenerateCardValidationDataInput { - s.GenerationAttributes = v - return s -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *GenerateCardValidationDataInput) SetKeyIdentifier(v string) *GenerateCardValidationDataInput { - s.KeyIdentifier = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *GenerateCardValidationDataInput) SetPrimaryAccountNumber(v string) *GenerateCardValidationDataInput { - s.PrimaryAccountNumber = &v - return s -} - -// SetValidationDataLength sets the ValidationDataLength field's value. -func (s *GenerateCardValidationDataInput) SetValidationDataLength(v int64) *GenerateCardValidationDataInput { - s.ValidationDataLength = &v - return s -} - -type GenerateCardValidationDataOutput struct { - _ struct{} `type:"structure"` - - // The keyARN of the CVK encryption key that Amazon Web Services Payment Cryptography - // uses to generate CVV or CSC. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The CVV or CSC value that Amazon Web Services Payment Cryptography generates - // for the card. - // - // ValidationData is a required field - ValidationData *string `min:"3" 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 GenerateCardValidationDataOutput) 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 GenerateCardValidationDataOutput) GoString() string { - return s.String() -} - -// SetKeyArn sets the KeyArn field's value. -func (s *GenerateCardValidationDataOutput) SetKeyArn(v string) *GenerateCardValidationDataOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *GenerateCardValidationDataOutput) SetKeyCheckValue(v string) *GenerateCardValidationDataOutput { - s.KeyCheckValue = &v - return s -} - -// SetValidationData sets the ValidationData field's value. -func (s *GenerateCardValidationDataOutput) SetValidationData(v string) *GenerateCardValidationDataOutput { - s.ValidationData = &v - return s -} - -type GenerateMacInput struct { - _ struct{} `type:"structure"` - - // The attributes and data values to use for MAC generation within Amazon Web - // Services Payment Cryptography. - // - // GenerationAttributes is a required field - GenerationAttributes *MacAttributes `type:"structure" required:"true"` - - // The keyARN of the MAC generation encryption key. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The length of a MAC under generation. - MacLength *int64 `min:"4" type:"integer"` - - // The data for which a MAC is under generation. - // - // MessageData is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GenerateMacInput's - // String and GoString methods. - // - // MessageData is a required field - MessageData *string `min:"2" type:"string" required:"true" sensitive:"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 GenerateMacInput) 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 GenerateMacInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GenerateMacInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GenerateMacInput"} - if s.GenerationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("GenerationAttributes")) - } - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - if s.MacLength != nil && *s.MacLength < 4 { - invalidParams.Add(request.NewErrParamMinValue("MacLength", 4)) - } - if s.MessageData == nil { - invalidParams.Add(request.NewErrParamRequired("MessageData")) - } - if s.MessageData != nil && len(*s.MessageData) < 2 { - invalidParams.Add(request.NewErrParamMinLen("MessageData", 2)) - } - if s.GenerationAttributes != nil { - if err := s.GenerationAttributes.Validate(); err != nil { - invalidParams.AddNested("GenerationAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGenerationAttributes sets the GenerationAttributes field's value. -func (s *GenerateMacInput) SetGenerationAttributes(v *MacAttributes) *GenerateMacInput { - s.GenerationAttributes = v - return s -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *GenerateMacInput) SetKeyIdentifier(v string) *GenerateMacInput { - s.KeyIdentifier = &v - return s -} - -// SetMacLength sets the MacLength field's value. -func (s *GenerateMacInput) SetMacLength(v int64) *GenerateMacInput { - s.MacLength = &v - return s -} - -// SetMessageData sets the MessageData field's value. -func (s *GenerateMacInput) SetMessageData(v string) *GenerateMacInput { - s.MessageData = &v - return s -} - -type GenerateMacOutput struct { - _ struct{} `type:"structure"` - - // The keyARN of the encryption key that Amazon Web Services Payment Cryptography - // uses for MAC generation. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The MAC cryptogram generated within Amazon Web Services Payment Cryptography. - // - // Mac is a required field - Mac *string `min:"4" 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 GenerateMacOutput) 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 GenerateMacOutput) GoString() string { - return s.String() -} - -// SetKeyArn sets the KeyArn field's value. -func (s *GenerateMacOutput) SetKeyArn(v string) *GenerateMacOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *GenerateMacOutput) SetKeyCheckValue(v string) *GenerateMacOutput { - s.KeyCheckValue = &v - return s -} - -// SetMac sets the Mac field's value. -func (s *GenerateMacOutput) SetMac(v string) *GenerateMacOutput { - s.Mac = &v - return s -} - -type GeneratePinDataInput struct { - _ struct{} `type:"structure"` - - // The keyARN of the PEK that Amazon Web Services Payment Cryptography uses - // to encrypt the PIN Block. - // - // EncryptionKeyIdentifier is a required field - EncryptionKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The attributes and values to use for PIN, PVV, or PIN Offset generation. - // - // GenerationAttributes is a required field - GenerationAttributes *PinGenerationAttributes `type:"structure" required:"true"` - - // The keyARN of the PEK that Amazon Web Services Payment Cryptography uses - // for pin data generation. - // - // GenerationKeyIdentifier is a required field - GenerationKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The PIN encoding format for pin data generation as specified in ISO 9564. - // Amazon Web Services Payment Cryptography supports ISO_Format_0 and ISO_Format_3. - // - // The ISO_Format_0 PIN block format is equivalent to the ANSI X9.8, VISA-1, - // and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. - // It supports a PIN from 4 to 12 digits in length. - // - // The ISO_Format_3 PIN block format is the same as ISO_Format_0 except that - // the fill digits are random values from 10 to 15. - // - // PinBlockFormat is a required field - PinBlockFormat *string `type:"string" required:"true" enum:"PinBlockFormatForPinData"` - - // The length of PIN under generation. - PinDataLength *int64 `min:"4" type:"integer"` - - // The Primary Account Number (PAN), a unique identifier for a payment credit - // or debit card that associates the card with a specific account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GeneratePinDataInput's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"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 GeneratePinDataInput) 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 GeneratePinDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GeneratePinDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GeneratePinDataInput"} - if s.EncryptionKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionKeyIdentifier")) - } - if s.EncryptionKeyIdentifier != nil && len(*s.EncryptionKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("EncryptionKeyIdentifier", 7)) - } - if s.GenerationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("GenerationAttributes")) - } - if s.GenerationKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GenerationKeyIdentifier")) - } - if s.GenerationKeyIdentifier != nil && len(*s.GenerationKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("GenerationKeyIdentifier", 7)) - } - if s.PinBlockFormat == nil { - invalidParams.Add(request.NewErrParamRequired("PinBlockFormat")) - } - if s.PinDataLength != nil && *s.PinDataLength < 4 { - invalidParams.Add(request.NewErrParamMinValue("PinDataLength", 4)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - if s.GenerationAttributes != nil { - if err := s.GenerationAttributes.Validate(); err != nil { - invalidParams.AddNested("GenerationAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionKeyIdentifier sets the EncryptionKeyIdentifier field's value. -func (s *GeneratePinDataInput) SetEncryptionKeyIdentifier(v string) *GeneratePinDataInput { - s.EncryptionKeyIdentifier = &v - return s -} - -// SetGenerationAttributes sets the GenerationAttributes field's value. -func (s *GeneratePinDataInput) SetGenerationAttributes(v *PinGenerationAttributes) *GeneratePinDataInput { - s.GenerationAttributes = v - return s -} - -// SetGenerationKeyIdentifier sets the GenerationKeyIdentifier field's value. -func (s *GeneratePinDataInput) SetGenerationKeyIdentifier(v string) *GeneratePinDataInput { - s.GenerationKeyIdentifier = &v - return s -} - -// SetPinBlockFormat sets the PinBlockFormat field's value. -func (s *GeneratePinDataInput) SetPinBlockFormat(v string) *GeneratePinDataInput { - s.PinBlockFormat = &v - return s -} - -// SetPinDataLength sets the PinDataLength field's value. -func (s *GeneratePinDataInput) SetPinDataLength(v int64) *GeneratePinDataInput { - s.PinDataLength = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *GeneratePinDataInput) SetPrimaryAccountNumber(v string) *GeneratePinDataInput { - s.PrimaryAccountNumber = &v - return s -} - -type GeneratePinDataOutput struct { - _ struct{} `type:"structure"` - - // The PIN block encrypted under PEK from Amazon Web Services Payment Cryptography. - // The encrypted PIN block is a composite of PAN (Primary Account Number) and - // PIN (Personal Identification Number), generated in accordance with ISO 9564 - // standard. - // - // EncryptedPinBlock is a required field - EncryptedPinBlock *string `min:"16" type:"string" required:"true"` - - // The keyARN of the PEK that Amazon Web Services Payment Cryptography uses - // for encrypted pin block generation. - // - // EncryptionKeyArn is a required field - EncryptionKeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // EncryptionKeyCheckValue is a required field - EncryptionKeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The keyARN of the pin data generation key that Amazon Web Services Payment - // Cryptography uses for PIN, PVV or PIN Offset generation. - // - // GenerationKeyArn is a required field - GenerationKeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // GenerationKeyCheckValue is a required field - GenerationKeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The attributes and values Amazon Web Services Payment Cryptography uses for - // pin data generation. - // - // PinData is a required field - PinData *PinData `type:"structure" 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 GeneratePinDataOutput) 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 GeneratePinDataOutput) GoString() string { - return s.String() -} - -// SetEncryptedPinBlock sets the EncryptedPinBlock field's value. -func (s *GeneratePinDataOutput) SetEncryptedPinBlock(v string) *GeneratePinDataOutput { - s.EncryptedPinBlock = &v - return s -} - -// SetEncryptionKeyArn sets the EncryptionKeyArn field's value. -func (s *GeneratePinDataOutput) SetEncryptionKeyArn(v string) *GeneratePinDataOutput { - s.EncryptionKeyArn = &v - return s -} - -// SetEncryptionKeyCheckValue sets the EncryptionKeyCheckValue field's value. -func (s *GeneratePinDataOutput) SetEncryptionKeyCheckValue(v string) *GeneratePinDataOutput { - s.EncryptionKeyCheckValue = &v - return s -} - -// SetGenerationKeyArn sets the GenerationKeyArn field's value. -func (s *GeneratePinDataOutput) SetGenerationKeyArn(v string) *GeneratePinDataOutput { - s.GenerationKeyArn = &v - return s -} - -// SetGenerationKeyCheckValue sets the GenerationKeyCheckValue field's value. -func (s *GeneratePinDataOutput) SetGenerationKeyCheckValue(v string) *GeneratePinDataOutput { - s.GenerationKeyCheckValue = &v - return s -} - -// SetPinData sets the PinData field's value. -func (s *GeneratePinDataOutput) SetPinData(v *PinData) *GeneratePinDataOutput { - s.PinData = v - return s -} - -// Parameters that are required to generate or verify Ibm3624 natural PIN. -type Ibm3624NaturalPin struct { - _ struct{} `type:"structure"` - - // The decimalization table to use for IBM 3624 PIN algorithm. The table is - // used to convert the algorithm intermediate result from hexadecimal characters - // to decimal. - // - // DecimalizationTable is a required field - DecimalizationTable *string `min:"16" type:"string" required:"true"` - - // The unique data for cardholder identification. - // - // PinValidationData is a required field - PinValidationData *string `min:"4" type:"string" required:"true"` - - // The padding character for validation data. - // - // PinValidationDataPadCharacter is a required field - PinValidationDataPadCharacter *string `min:"1" 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 Ibm3624NaturalPin) 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 Ibm3624NaturalPin) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Ibm3624NaturalPin) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ibm3624NaturalPin"} - if s.DecimalizationTable == nil { - invalidParams.Add(request.NewErrParamRequired("DecimalizationTable")) - } - if s.DecimalizationTable != nil && len(*s.DecimalizationTable) < 16 { - invalidParams.Add(request.NewErrParamMinLen("DecimalizationTable", 16)) - } - if s.PinValidationData == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationData")) - } - if s.PinValidationData != nil && len(*s.PinValidationData) < 4 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationData", 4)) - } - if s.PinValidationDataPadCharacter == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationDataPadCharacter")) - } - if s.PinValidationDataPadCharacter != nil && len(*s.PinValidationDataPadCharacter) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationDataPadCharacter", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDecimalizationTable sets the DecimalizationTable field's value. -func (s *Ibm3624NaturalPin) SetDecimalizationTable(v string) *Ibm3624NaturalPin { - s.DecimalizationTable = &v - return s -} - -// SetPinValidationData sets the PinValidationData field's value. -func (s *Ibm3624NaturalPin) SetPinValidationData(v string) *Ibm3624NaturalPin { - s.PinValidationData = &v - return s -} - -// SetPinValidationDataPadCharacter sets the PinValidationDataPadCharacter field's value. -func (s *Ibm3624NaturalPin) SetPinValidationDataPadCharacter(v string) *Ibm3624NaturalPin { - s.PinValidationDataPadCharacter = &v - return s -} - -// Parameters that are required to generate or verify Ibm3624 PIN from offset -// PIN. -type Ibm3624PinFromOffset struct { - _ struct{} `type:"structure"` - - // The decimalization table to use for IBM 3624 PIN algorithm. The table is - // used to convert the algorithm intermediate result from hexadecimal characters - // to decimal. - // - // DecimalizationTable is a required field - DecimalizationTable *string `min:"16" type:"string" required:"true"` - - // The PIN offset value. - // - // PinOffset is a required field - PinOffset *string `min:"4" type:"string" required:"true"` - - // The unique data for cardholder identification. - // - // PinValidationData is a required field - PinValidationData *string `min:"4" type:"string" required:"true"` - - // The padding character for validation data. - // - // PinValidationDataPadCharacter is a required field - PinValidationDataPadCharacter *string `min:"1" 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 Ibm3624PinFromOffset) 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 Ibm3624PinFromOffset) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Ibm3624PinFromOffset) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ibm3624PinFromOffset"} - if s.DecimalizationTable == nil { - invalidParams.Add(request.NewErrParamRequired("DecimalizationTable")) - } - if s.DecimalizationTable != nil && len(*s.DecimalizationTable) < 16 { - invalidParams.Add(request.NewErrParamMinLen("DecimalizationTable", 16)) - } - if s.PinOffset == nil { - invalidParams.Add(request.NewErrParamRequired("PinOffset")) - } - if s.PinOffset != nil && len(*s.PinOffset) < 4 { - invalidParams.Add(request.NewErrParamMinLen("PinOffset", 4)) - } - if s.PinValidationData == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationData")) - } - if s.PinValidationData != nil && len(*s.PinValidationData) < 4 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationData", 4)) - } - if s.PinValidationDataPadCharacter == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationDataPadCharacter")) - } - if s.PinValidationDataPadCharacter != nil && len(*s.PinValidationDataPadCharacter) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationDataPadCharacter", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDecimalizationTable sets the DecimalizationTable field's value. -func (s *Ibm3624PinFromOffset) SetDecimalizationTable(v string) *Ibm3624PinFromOffset { - s.DecimalizationTable = &v - return s -} - -// SetPinOffset sets the PinOffset field's value. -func (s *Ibm3624PinFromOffset) SetPinOffset(v string) *Ibm3624PinFromOffset { - s.PinOffset = &v - return s -} - -// SetPinValidationData sets the PinValidationData field's value. -func (s *Ibm3624PinFromOffset) SetPinValidationData(v string) *Ibm3624PinFromOffset { - s.PinValidationData = &v - return s -} - -// SetPinValidationDataPadCharacter sets the PinValidationDataPadCharacter field's value. -func (s *Ibm3624PinFromOffset) SetPinValidationDataPadCharacter(v string) *Ibm3624PinFromOffset { - s.PinValidationDataPadCharacter = &v - return s -} - -// Pparameters that are required to generate or verify Ibm3624 PIN offset PIN. -type Ibm3624PinOffset struct { - _ struct{} `type:"structure"` - - // The decimalization table to use for IBM 3624 PIN algorithm. The table is - // used to convert the algorithm intermediate result from hexadecimal characters - // to decimal. - // - // DecimalizationTable is a required field - DecimalizationTable *string `min:"16" type:"string" required:"true"` - - // The encrypted PIN block data. According to ISO 9564 standard, a PIN Block - // is an encoded representation of a payment card Personal Account Number (PAN) - // and the cardholder Personal Identification Number (PIN). - // - // EncryptedPinBlock is a required field - EncryptedPinBlock *string `min:"16" type:"string" required:"true"` - - // The unique data for cardholder identification. - // - // PinValidationData is a required field - PinValidationData *string `min:"4" type:"string" required:"true"` - - // The padding character for validation data. - // - // PinValidationDataPadCharacter is a required field - PinValidationDataPadCharacter *string `min:"1" 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 Ibm3624PinOffset) 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 Ibm3624PinOffset) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Ibm3624PinOffset) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ibm3624PinOffset"} - if s.DecimalizationTable == nil { - invalidParams.Add(request.NewErrParamRequired("DecimalizationTable")) - } - if s.DecimalizationTable != nil && len(*s.DecimalizationTable) < 16 { - invalidParams.Add(request.NewErrParamMinLen("DecimalizationTable", 16)) - } - if s.EncryptedPinBlock == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptedPinBlock")) - } - if s.EncryptedPinBlock != nil && len(*s.EncryptedPinBlock) < 16 { - invalidParams.Add(request.NewErrParamMinLen("EncryptedPinBlock", 16)) - } - if s.PinValidationData == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationData")) - } - if s.PinValidationData != nil && len(*s.PinValidationData) < 4 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationData", 4)) - } - if s.PinValidationDataPadCharacter == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationDataPadCharacter")) - } - if s.PinValidationDataPadCharacter != nil && len(*s.PinValidationDataPadCharacter) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationDataPadCharacter", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDecimalizationTable sets the DecimalizationTable field's value. -func (s *Ibm3624PinOffset) SetDecimalizationTable(v string) *Ibm3624PinOffset { - s.DecimalizationTable = &v - return s -} - -// SetEncryptedPinBlock sets the EncryptedPinBlock field's value. -func (s *Ibm3624PinOffset) SetEncryptedPinBlock(v string) *Ibm3624PinOffset { - s.EncryptedPinBlock = &v - return s -} - -// SetPinValidationData sets the PinValidationData field's value. -func (s *Ibm3624PinOffset) SetPinValidationData(v string) *Ibm3624PinOffset { - s.PinValidationData = &v - return s -} - -// SetPinValidationDataPadCharacter sets the PinValidationDataPadCharacter field's value. -func (s *Ibm3624PinOffset) SetPinValidationDataPadCharacter(v string) *Ibm3624PinOffset { - s.PinValidationDataPadCharacter = &v - return s -} - -// Parameters that are required to generate or verify Ibm3624 PIN verification -// PIN. -type Ibm3624PinVerification struct { - _ struct{} `type:"structure"` - - // The decimalization table to use for IBM 3624 PIN algorithm. The table is - // used to convert the algorithm intermediate result from hexadecimal characters - // to decimal. - // - // DecimalizationTable is a required field - DecimalizationTable *string `min:"16" type:"string" required:"true"` - - // The PIN offset value. - // - // PinOffset is a required field - PinOffset *string `min:"4" type:"string" required:"true"` - - // The unique data for cardholder identification. - // - // PinValidationData is a required field - PinValidationData *string `min:"4" type:"string" required:"true"` - - // The padding character for validation data. - // - // PinValidationDataPadCharacter is a required field - PinValidationDataPadCharacter *string `min:"1" 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 Ibm3624PinVerification) 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 Ibm3624PinVerification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Ibm3624PinVerification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ibm3624PinVerification"} - if s.DecimalizationTable == nil { - invalidParams.Add(request.NewErrParamRequired("DecimalizationTable")) - } - if s.DecimalizationTable != nil && len(*s.DecimalizationTable) < 16 { - invalidParams.Add(request.NewErrParamMinLen("DecimalizationTable", 16)) - } - if s.PinOffset == nil { - invalidParams.Add(request.NewErrParamRequired("PinOffset")) - } - if s.PinOffset != nil && len(*s.PinOffset) < 4 { - invalidParams.Add(request.NewErrParamMinLen("PinOffset", 4)) - } - if s.PinValidationData == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationData")) - } - if s.PinValidationData != nil && len(*s.PinValidationData) < 4 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationData", 4)) - } - if s.PinValidationDataPadCharacter == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationDataPadCharacter")) - } - if s.PinValidationDataPadCharacter != nil && len(*s.PinValidationDataPadCharacter) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationDataPadCharacter", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDecimalizationTable sets the DecimalizationTable field's value. -func (s *Ibm3624PinVerification) SetDecimalizationTable(v string) *Ibm3624PinVerification { - s.DecimalizationTable = &v - return s -} - -// SetPinOffset sets the PinOffset field's value. -func (s *Ibm3624PinVerification) SetPinOffset(v string) *Ibm3624PinVerification { - s.PinOffset = &v - return s -} - -// SetPinValidationData sets the PinValidationData field's value. -func (s *Ibm3624PinVerification) SetPinValidationData(v string) *Ibm3624PinVerification { - s.PinValidationData = &v - return s -} - -// SetPinValidationDataPadCharacter sets the PinValidationDataPadCharacter field's value. -func (s *Ibm3624PinVerification) SetPinValidationDataPadCharacter(v string) *Ibm3624PinVerification { - s.PinValidationDataPadCharacter = &v - return s -} - -// Parameters that are required to generate or verify Ibm3624 random PIN. -type Ibm3624RandomPin struct { - _ struct{} `type:"structure"` - - // The decimalization table to use for IBM 3624 PIN algorithm. The table is - // used to convert the algorithm intermediate result from hexadecimal characters - // to decimal. - // - // DecimalizationTable is a required field - DecimalizationTable *string `min:"16" type:"string" required:"true"` - - // The unique data for cardholder identification. - // - // PinValidationData is a required field - PinValidationData *string `min:"4" type:"string" required:"true"` - - // The padding character for validation data. - // - // PinValidationDataPadCharacter is a required field - PinValidationDataPadCharacter *string `min:"1" 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 Ibm3624RandomPin) 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 Ibm3624RandomPin) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Ibm3624RandomPin) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ibm3624RandomPin"} - if s.DecimalizationTable == nil { - invalidParams.Add(request.NewErrParamRequired("DecimalizationTable")) - } - if s.DecimalizationTable != nil && len(*s.DecimalizationTable) < 16 { - invalidParams.Add(request.NewErrParamMinLen("DecimalizationTable", 16)) - } - if s.PinValidationData == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationData")) - } - if s.PinValidationData != nil && len(*s.PinValidationData) < 4 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationData", 4)) - } - if s.PinValidationDataPadCharacter == nil { - invalidParams.Add(request.NewErrParamRequired("PinValidationDataPadCharacter")) - } - if s.PinValidationDataPadCharacter != nil && len(*s.PinValidationDataPadCharacter) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PinValidationDataPadCharacter", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDecimalizationTable sets the DecimalizationTable field's value. -func (s *Ibm3624RandomPin) SetDecimalizationTable(v string) *Ibm3624RandomPin { - s.DecimalizationTable = &v - return s -} - -// SetPinValidationData sets the PinValidationData field's value. -func (s *Ibm3624RandomPin) SetPinValidationData(v string) *Ibm3624RandomPin { - s.PinValidationData = &v - return s -} - -// SetPinValidationDataPadCharacter sets the PinValidationDataPadCharacter field's value. -func (s *Ibm3624RandomPin) SetPinValidationDataPadCharacter(v string) *Ibm3624RandomPin { - s.PinValidationDataPadCharacter = &v - return s -} - -// The request processing has failed because of an unknown error, exception, -// or failure. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Parameters required for DUKPT MAC generation and verification. -type MacAlgorithmDukpt struct { - _ struct{} `type:"structure"` - - // The key type derived using DUKPT from a Base Derivation Key (BDK) and Key - // Serial Number (KSN). This must be less than or equal to the strength of the - // BDK. For example, you can't use AES_128 as a derivation type for a BDK of - // AES_128 or TDES_2KEY. - DukptDerivationType *string `type:"string" enum:"DukptDerivationType"` - - // The type of use of DUKPT, which can be MAC generation, MAC verification, - // or both. - // - // DukptKeyVariant is a required field - DukptKeyVariant *string `type:"string" required:"true" enum:"DukptKeyVariant"` - - // The unique identifier known as Key Serial Number (KSN) that comes from an - // encrypting device using DUKPT encryption method. The KSN is derived from - // the encrypting device unique identifier and an internal transaction counter. - // - // KeySerialNumber is a required field - KeySerialNumber *string `min:"10" 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 MacAlgorithmDukpt) 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 MacAlgorithmDukpt) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MacAlgorithmDukpt) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MacAlgorithmDukpt"} - if s.DukptKeyVariant == nil { - invalidParams.Add(request.NewErrParamRequired("DukptKeyVariant")) - } - if s.KeySerialNumber == nil { - invalidParams.Add(request.NewErrParamRequired("KeySerialNumber")) - } - if s.KeySerialNumber != nil && len(*s.KeySerialNumber) < 10 { - invalidParams.Add(request.NewErrParamMinLen("KeySerialNumber", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDukptDerivationType sets the DukptDerivationType field's value. -func (s *MacAlgorithmDukpt) SetDukptDerivationType(v string) *MacAlgorithmDukpt { - s.DukptDerivationType = &v - return s -} - -// SetDukptKeyVariant sets the DukptKeyVariant field's value. -func (s *MacAlgorithmDukpt) SetDukptKeyVariant(v string) *MacAlgorithmDukpt { - s.DukptKeyVariant = &v - return s -} - -// SetKeySerialNumber sets the KeySerialNumber field's value. -func (s *MacAlgorithmDukpt) SetKeySerialNumber(v string) *MacAlgorithmDukpt { - s.KeySerialNumber = &v - return s -} - -// Parameters that are required for EMV MAC generation and verification. -type MacAlgorithmEmv struct { - _ struct{} `type:"structure"` - - // The method to use when deriving the master key for EMV MAC generation or - // verification. - // - // MajorKeyDerivationMode is a required field - MajorKeyDerivationMode *string `type:"string" required:"true" enum:"MajorKeyDerivationMode"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // The Primary Account Number (PAN), a unique identifier for a payment credit - // or debit card and associates the card to a specific account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by MacAlgorithmEmv's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"true"` - - // The method of deriving a session key for EMV MAC generation or verification. - // - // SessionKeyDerivationMode is a required field - SessionKeyDerivationMode *string `type:"string" required:"true" enum:"SessionKeyDerivationMode"` - - // Parameters that are required to generate session key for EMV generation and - // verification. - // - // SessionKeyDerivationValue is a required field - SessionKeyDerivationValue *SessionKeyDerivationValue `type:"structure" 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 MacAlgorithmEmv) 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 MacAlgorithmEmv) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MacAlgorithmEmv) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MacAlgorithmEmv"} - if s.MajorKeyDerivationMode == nil { - invalidParams.Add(request.NewErrParamRequired("MajorKeyDerivationMode")) - } - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - if s.SessionKeyDerivationMode == nil { - invalidParams.Add(request.NewErrParamRequired("SessionKeyDerivationMode")) - } - if s.SessionKeyDerivationValue == nil { - invalidParams.Add(request.NewErrParamRequired("SessionKeyDerivationValue")) - } - if s.SessionKeyDerivationValue != nil { - if err := s.SessionKeyDerivationValue.Validate(); err != nil { - invalidParams.AddNested("SessionKeyDerivationValue", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMajorKeyDerivationMode sets the MajorKeyDerivationMode field's value. -func (s *MacAlgorithmEmv) SetMajorKeyDerivationMode(v string) *MacAlgorithmEmv { - s.MajorKeyDerivationMode = &v - return s -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *MacAlgorithmEmv) SetPanSequenceNumber(v string) *MacAlgorithmEmv { - s.PanSequenceNumber = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *MacAlgorithmEmv) SetPrimaryAccountNumber(v string) *MacAlgorithmEmv { - s.PrimaryAccountNumber = &v - return s -} - -// SetSessionKeyDerivationMode sets the SessionKeyDerivationMode field's value. -func (s *MacAlgorithmEmv) SetSessionKeyDerivationMode(v string) *MacAlgorithmEmv { - s.SessionKeyDerivationMode = &v - return s -} - -// SetSessionKeyDerivationValue sets the SessionKeyDerivationValue field's value. -func (s *MacAlgorithmEmv) SetSessionKeyDerivationValue(v *SessionKeyDerivationValue) *MacAlgorithmEmv { - s.SessionKeyDerivationValue = v - return s -} - -// Parameters that are required for DUKPT, HMAC, or EMV MAC generation or verification. -type MacAttributes struct { - _ struct{} `type:"structure"` - - // The encryption algorithm for MAC generation or verification. - Algorithm *string `type:"string" enum:"MacAlgorithm"` - - // Parameters that are required for MAC generation or verification using DUKPT - // CMAC algorithm. - DukptCmac *MacAlgorithmDukpt `type:"structure"` - - // Parameters that are required for MAC generation or verification using DUKPT - // ISO 9797 algorithm1. - DukptIso9797Algorithm1 *MacAlgorithmDukpt `type:"structure"` - - // Parameters that are required for MAC generation or verification using DUKPT - // ISO 9797 algorithm2. - DukptIso9797Algorithm3 *MacAlgorithmDukpt `type:"structure"` - - // Parameters that are required for MAC generation or verification using EMV - // MAC algorithm. - EmvMac *MacAlgorithmEmv `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 MacAttributes) 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 MacAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MacAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MacAttributes"} - if s.DukptCmac != nil { - if err := s.DukptCmac.Validate(); err != nil { - invalidParams.AddNested("DukptCmac", err.(request.ErrInvalidParams)) - } - } - if s.DukptIso9797Algorithm1 != nil { - if err := s.DukptIso9797Algorithm1.Validate(); err != nil { - invalidParams.AddNested("DukptIso9797Algorithm1", err.(request.ErrInvalidParams)) - } - } - if s.DukptIso9797Algorithm3 != nil { - if err := s.DukptIso9797Algorithm3.Validate(); err != nil { - invalidParams.AddNested("DukptIso9797Algorithm3", err.(request.ErrInvalidParams)) - } - } - if s.EmvMac != nil { - if err := s.EmvMac.Validate(); err != nil { - invalidParams.AddNested("EmvMac", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlgorithm sets the Algorithm field's value. -func (s *MacAttributes) SetAlgorithm(v string) *MacAttributes { - s.Algorithm = &v - return s -} - -// SetDukptCmac sets the DukptCmac field's value. -func (s *MacAttributes) SetDukptCmac(v *MacAlgorithmDukpt) *MacAttributes { - s.DukptCmac = v - return s -} - -// SetDukptIso9797Algorithm1 sets the DukptIso9797Algorithm1 field's value. -func (s *MacAttributes) SetDukptIso9797Algorithm1(v *MacAlgorithmDukpt) *MacAttributes { - s.DukptIso9797Algorithm1 = v - return s -} - -// SetDukptIso9797Algorithm3 sets the DukptIso9797Algorithm3 field's value. -func (s *MacAttributes) SetDukptIso9797Algorithm3(v *MacAlgorithmDukpt) *MacAttributes { - s.DukptIso9797Algorithm3 = v - return s -} - -// SetEmvMac sets the EmvMac field's value. -func (s *MacAttributes) SetEmvMac(v *MacAlgorithmEmv) *MacAttributes { - s.EmvMac = v - return s -} - -// Parameters that are required to generate, translate, or verify PIN data. -type PinData struct { - _ struct{} `type:"structure"` - - // The PIN offset value. - PinOffset *string `min:"4" type:"string"` - - // The unique data to identify a cardholder. In most cases, this is the same - // as cardholder's Primary Account Number (PAN). If a value is not provided, - // it defaults to PAN. - VerificationValue *string `min:"4" 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 PinData) 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 PinData) GoString() string { - return s.String() -} - -// SetPinOffset sets the PinOffset field's value. -func (s *PinData) SetPinOffset(v string) *PinData { - s.PinOffset = &v - return s -} - -// SetVerificationValue sets the VerificationValue field's value. -func (s *PinData) SetVerificationValue(v string) *PinData { - s.VerificationValue = &v - return s -} - -// Parameters that are required for PIN data generation. -type PinGenerationAttributes struct { - _ struct{} `type:"structure"` - - // Parameters that are required to generate or verify Ibm3624 natural PIN. - Ibm3624NaturalPin *Ibm3624NaturalPin `type:"structure"` - - // Parameters that are required to generate or verify Ibm3624 PIN from offset - // PIN. - Ibm3624PinFromOffset *Ibm3624PinFromOffset `type:"structure"` - - // Parameters that are required to generate or verify Ibm3624 PIN offset PIN. - Ibm3624PinOffset *Ibm3624PinOffset `type:"structure"` - - // Parameters that are required to generate or verify Ibm3624 random PIN. - Ibm3624RandomPin *Ibm3624RandomPin `type:"structure"` - - // Parameters that are required to generate or verify Visa PIN. - VisaPin *VisaPin `type:"structure"` - - // Parameters that are required to generate or verify Visa PIN Verification - // Value (PVV). - VisaPinVerificationValue *VisaPinVerificationValue `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 PinGenerationAttributes) 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 PinGenerationAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PinGenerationAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PinGenerationAttributes"} - if s.Ibm3624NaturalPin != nil { - if err := s.Ibm3624NaturalPin.Validate(); err != nil { - invalidParams.AddNested("Ibm3624NaturalPin", err.(request.ErrInvalidParams)) - } - } - if s.Ibm3624PinFromOffset != nil { - if err := s.Ibm3624PinFromOffset.Validate(); err != nil { - invalidParams.AddNested("Ibm3624PinFromOffset", err.(request.ErrInvalidParams)) - } - } - if s.Ibm3624PinOffset != nil { - if err := s.Ibm3624PinOffset.Validate(); err != nil { - invalidParams.AddNested("Ibm3624PinOffset", err.(request.ErrInvalidParams)) - } - } - if s.Ibm3624RandomPin != nil { - if err := s.Ibm3624RandomPin.Validate(); err != nil { - invalidParams.AddNested("Ibm3624RandomPin", err.(request.ErrInvalidParams)) - } - } - if s.VisaPin != nil { - if err := s.VisaPin.Validate(); err != nil { - invalidParams.AddNested("VisaPin", err.(request.ErrInvalidParams)) - } - } - if s.VisaPinVerificationValue != nil { - if err := s.VisaPinVerificationValue.Validate(); err != nil { - invalidParams.AddNested("VisaPinVerificationValue", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIbm3624NaturalPin sets the Ibm3624NaturalPin field's value. -func (s *PinGenerationAttributes) SetIbm3624NaturalPin(v *Ibm3624NaturalPin) *PinGenerationAttributes { - s.Ibm3624NaturalPin = v - return s -} - -// SetIbm3624PinFromOffset sets the Ibm3624PinFromOffset field's value. -func (s *PinGenerationAttributes) SetIbm3624PinFromOffset(v *Ibm3624PinFromOffset) *PinGenerationAttributes { - s.Ibm3624PinFromOffset = v - return s -} - -// SetIbm3624PinOffset sets the Ibm3624PinOffset field's value. -func (s *PinGenerationAttributes) SetIbm3624PinOffset(v *Ibm3624PinOffset) *PinGenerationAttributes { - s.Ibm3624PinOffset = v - return s -} - -// SetIbm3624RandomPin sets the Ibm3624RandomPin field's value. -func (s *PinGenerationAttributes) SetIbm3624RandomPin(v *Ibm3624RandomPin) *PinGenerationAttributes { - s.Ibm3624RandomPin = v - return s -} - -// SetVisaPin sets the VisaPin field's value. -func (s *PinGenerationAttributes) SetVisaPin(v *VisaPin) *PinGenerationAttributes { - s.VisaPin = v - return s -} - -// SetVisaPinVerificationValue sets the VisaPinVerificationValue field's value. -func (s *PinGenerationAttributes) SetVisaPinVerificationValue(v *VisaPinVerificationValue) *PinGenerationAttributes { - s.VisaPinVerificationValue = v - return s -} - -// Parameters that are required for PIN data verification. -type PinVerificationAttributes struct { - _ struct{} `type:"structure"` - - // Parameters that are required to generate or verify Ibm3624 PIN. - Ibm3624Pin *Ibm3624PinVerification `type:"structure"` - - // Parameters that are required to generate or verify Visa PIN. - VisaPin *VisaPinVerification `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 PinVerificationAttributes) 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 PinVerificationAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PinVerificationAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PinVerificationAttributes"} - if s.Ibm3624Pin != nil { - if err := s.Ibm3624Pin.Validate(); err != nil { - invalidParams.AddNested("Ibm3624Pin", err.(request.ErrInvalidParams)) - } - } - if s.VisaPin != nil { - if err := s.VisaPin.Validate(); err != nil { - invalidParams.AddNested("VisaPin", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIbm3624Pin sets the Ibm3624Pin field's value. -func (s *PinVerificationAttributes) SetIbm3624Pin(v *Ibm3624PinVerification) *PinVerificationAttributes { - s.Ibm3624Pin = v - return s -} - -// SetVisaPin sets the VisaPin field's value. -func (s *PinVerificationAttributes) SetVisaPin(v *VisaPinVerification) *PinVerificationAttributes { - s.VisaPin = v - return s -} - -type ReEncryptDataInput struct { - _ struct{} `type:"structure"` - - // Ciphertext to be encrypted. The minimum allowed length is 16 bytes and maximum - // allowed length is 4096 bytes. - // - // CipherText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ReEncryptDataInput's - // String and GoString methods. - // - // CipherText is a required field - CipherText *string `min:"16" type:"string" required:"true" sensitive:"true"` - - // The attributes and values for incoming ciphertext. - // - // IncomingEncryptionAttributes is a required field - IncomingEncryptionAttributes *ReEncryptionAttributes `type:"structure" required:"true"` - - // The keyARN of the encryption key of incoming ciphertext data. - // - // IncomingKeyIdentifier is a required field - IncomingKeyIdentifier *string `location:"uri" locationName:"IncomingKeyIdentifier" min:"7" type:"string" required:"true"` - - // The attributes and values for outgoing ciphertext data after encryption by - // Amazon Web Services Payment Cryptography. - // - // OutgoingEncryptionAttributes is a required field - OutgoingEncryptionAttributes *ReEncryptionAttributes `type:"structure" required:"true"` - - // The keyARN of the encryption key of outgoing ciphertext data after encryption - // by Amazon Web Services Payment Cryptography. - // - // OutgoingKeyIdentifier is a required field - OutgoingKeyIdentifier *string `min:"7" 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 ReEncryptDataInput) 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 ReEncryptDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReEncryptDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReEncryptDataInput"} - if s.CipherText == nil { - invalidParams.Add(request.NewErrParamRequired("CipherText")) - } - if s.CipherText != nil && len(*s.CipherText) < 16 { - invalidParams.Add(request.NewErrParamMinLen("CipherText", 16)) - } - if s.IncomingEncryptionAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("IncomingEncryptionAttributes")) - } - if s.IncomingKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IncomingKeyIdentifier")) - } - if s.IncomingKeyIdentifier != nil && len(*s.IncomingKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("IncomingKeyIdentifier", 7)) - } - if s.OutgoingEncryptionAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("OutgoingEncryptionAttributes")) - } - if s.OutgoingKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OutgoingKeyIdentifier")) - } - if s.OutgoingKeyIdentifier != nil && len(*s.OutgoingKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("OutgoingKeyIdentifier", 7)) - } - if s.IncomingEncryptionAttributes != nil { - if err := s.IncomingEncryptionAttributes.Validate(); err != nil { - invalidParams.AddNested("IncomingEncryptionAttributes", err.(request.ErrInvalidParams)) - } - } - if s.OutgoingEncryptionAttributes != nil { - if err := s.OutgoingEncryptionAttributes.Validate(); err != nil { - invalidParams.AddNested("OutgoingEncryptionAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCipherText sets the CipherText field's value. -func (s *ReEncryptDataInput) SetCipherText(v string) *ReEncryptDataInput { - s.CipherText = &v - return s -} - -// SetIncomingEncryptionAttributes sets the IncomingEncryptionAttributes field's value. -func (s *ReEncryptDataInput) SetIncomingEncryptionAttributes(v *ReEncryptionAttributes) *ReEncryptDataInput { - s.IncomingEncryptionAttributes = v - return s -} - -// SetIncomingKeyIdentifier sets the IncomingKeyIdentifier field's value. -func (s *ReEncryptDataInput) SetIncomingKeyIdentifier(v string) *ReEncryptDataInput { - s.IncomingKeyIdentifier = &v - return s -} - -// SetOutgoingEncryptionAttributes sets the OutgoingEncryptionAttributes field's value. -func (s *ReEncryptDataInput) SetOutgoingEncryptionAttributes(v *ReEncryptionAttributes) *ReEncryptDataInput { - s.OutgoingEncryptionAttributes = v - return s -} - -// SetOutgoingKeyIdentifier sets the OutgoingKeyIdentifier field's value. -func (s *ReEncryptDataInput) SetOutgoingKeyIdentifier(v string) *ReEncryptDataInput { - s.OutgoingKeyIdentifier = &v - return s -} - -type ReEncryptDataOutput struct { - _ struct{} `type:"structure"` - - // The encrypted ciphertext. - // - // CipherText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ReEncryptDataOutput's - // String and GoString methods. - // - // CipherText is a required field - CipherText *string `min:"16" type:"string" required:"true" sensitive:"true"` - - // The keyARN (Amazon Resource Name) of the encryption key that Amazon Web Services - // Payment Cryptography uses for plaintext encryption. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" 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 ReEncryptDataOutput) 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 ReEncryptDataOutput) GoString() string { - return s.String() -} - -// SetCipherText sets the CipherText field's value. -func (s *ReEncryptDataOutput) SetCipherText(v string) *ReEncryptDataOutput { - s.CipherText = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *ReEncryptDataOutput) SetKeyArn(v string) *ReEncryptDataOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *ReEncryptDataOutput) SetKeyCheckValue(v string) *ReEncryptDataOutput { - s.KeyCheckValue = &v - return s -} - -// Parameters that are required to perform reencryption operation. -type ReEncryptionAttributes struct { - _ struct{} `type:"structure"` - - // Parameters that are required to encrypt plaintext data using DUKPT. - Dukpt *DukptEncryptionAttributes `type:"structure"` - - // Parameters that are required to encrypt data using symmetric keys. - Symmetric *SymmetricEncryptionAttributes `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 ReEncryptionAttributes) 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 ReEncryptionAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReEncryptionAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReEncryptionAttributes"} - if s.Dukpt != nil { - if err := s.Dukpt.Validate(); err != nil { - invalidParams.AddNested("Dukpt", err.(request.ErrInvalidParams)) - } - } - if s.Symmetric != nil { - if err := s.Symmetric.Validate(); err != nil { - invalidParams.AddNested("Symmetric", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDukpt sets the Dukpt field's value. -func (s *ReEncryptionAttributes) SetDukpt(v *DukptEncryptionAttributes) *ReEncryptionAttributes { - s.Dukpt = v - return s -} - -// SetSymmetric sets the Symmetric field's value. -func (s *ReEncryptionAttributes) SetSymmetric(v *SymmetricEncryptionAttributes) *ReEncryptionAttributes { - s.Symmetric = v - return s -} - -// The request was denied due to an invalid resource error. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The resource that is missing. - ResourceId *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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Parameters to derive session key for an Amex payment card. -type SessionKeyAmex struct { - _ struct{} `type:"structure"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier - // for a payment credit or debit card and associates the card to a specific - // account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SessionKeyAmex's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"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 SessionKeyAmex) 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 SessionKeyAmex) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SessionKeyAmex) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SessionKeyAmex"} - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *SessionKeyAmex) SetPanSequenceNumber(v string) *SessionKeyAmex { - s.PanSequenceNumber = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *SessionKeyAmex) SetPrimaryAccountNumber(v string) *SessionKeyAmex { - s.PrimaryAccountNumber = &v - return s -} - -// Parameters to derive a session key for Authorization Response Cryptogram -// (ARQC) verification. -type SessionKeyDerivation struct { - _ struct{} `type:"structure"` - - // Parameters to derive session key for an Amex payment card for ARQC verification. - Amex *SessionKeyAmex `type:"structure"` - - // Parameters to derive session key for an Emv2000 payment card for ARQC verification. - Emv2000 *SessionKeyEmv2000 `type:"structure"` - - // Parameters to derive session key for an Emv common payment card for ARQC - // verification. - EmvCommon *SessionKeyEmvCommon `type:"structure"` - - // Parameters to derive session key for a Mastercard payment card for ARQC verification. - Mastercard *SessionKeyMastercard `type:"structure"` - - // Parameters to derive session key for a Visa payment cardfor ARQC verification. - Visa *SessionKeyVisa `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 SessionKeyDerivation) 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 SessionKeyDerivation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SessionKeyDerivation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SessionKeyDerivation"} - if s.Amex != nil { - if err := s.Amex.Validate(); err != nil { - invalidParams.AddNested("Amex", err.(request.ErrInvalidParams)) - } - } - if s.Emv2000 != nil { - if err := s.Emv2000.Validate(); err != nil { - invalidParams.AddNested("Emv2000", err.(request.ErrInvalidParams)) - } - } - if s.EmvCommon != nil { - if err := s.EmvCommon.Validate(); err != nil { - invalidParams.AddNested("EmvCommon", err.(request.ErrInvalidParams)) - } - } - if s.Mastercard != nil { - if err := s.Mastercard.Validate(); err != nil { - invalidParams.AddNested("Mastercard", err.(request.ErrInvalidParams)) - } - } - if s.Visa != nil { - if err := s.Visa.Validate(); err != nil { - invalidParams.AddNested("Visa", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmex sets the Amex field's value. -func (s *SessionKeyDerivation) SetAmex(v *SessionKeyAmex) *SessionKeyDerivation { - s.Amex = v - return s -} - -// SetEmv2000 sets the Emv2000 field's value. -func (s *SessionKeyDerivation) SetEmv2000(v *SessionKeyEmv2000) *SessionKeyDerivation { - s.Emv2000 = v - return s -} - -// SetEmvCommon sets the EmvCommon field's value. -func (s *SessionKeyDerivation) SetEmvCommon(v *SessionKeyEmvCommon) *SessionKeyDerivation { - s.EmvCommon = v - return s -} - -// SetMastercard sets the Mastercard field's value. -func (s *SessionKeyDerivation) SetMastercard(v *SessionKeyMastercard) *SessionKeyDerivation { - s.Mastercard = v - return s -} - -// SetVisa sets the Visa field's value. -func (s *SessionKeyDerivation) SetVisa(v *SessionKeyVisa) *SessionKeyDerivation { - s.Visa = v - return s -} - -// Parameters to derive session key value using a MAC EMV algorithm. -type SessionKeyDerivationValue struct { - _ struct{} `type:"structure"` - - // The cryptogram provided by the terminal during transaction processing. - ApplicationCryptogram *string `min:"16" type:"string"` - - // The transaction counter that is provided by the terminal during transaction - // processing. - ApplicationTransactionCounter *string `min:"2" 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 SessionKeyDerivationValue) 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 SessionKeyDerivationValue) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SessionKeyDerivationValue) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SessionKeyDerivationValue"} - if s.ApplicationCryptogram != nil && len(*s.ApplicationCryptogram) < 16 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationCryptogram", 16)) - } - if s.ApplicationTransactionCounter != nil && len(*s.ApplicationTransactionCounter) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationTransactionCounter", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationCryptogram sets the ApplicationCryptogram field's value. -func (s *SessionKeyDerivationValue) SetApplicationCryptogram(v string) *SessionKeyDerivationValue { - s.ApplicationCryptogram = &v - return s -} - -// SetApplicationTransactionCounter sets the ApplicationTransactionCounter field's value. -func (s *SessionKeyDerivationValue) SetApplicationTransactionCounter(v string) *SessionKeyDerivationValue { - s.ApplicationTransactionCounter = &v - return s -} - -// Parameters to derive session key for an Emv2000 payment card for ARQC verification. -type SessionKeyEmv2000 struct { - _ struct{} `type:"structure"` - - // The transaction counter that is provided by the terminal during transaction - // processing. - // - // ApplicationTransactionCounter is a required field - ApplicationTransactionCounter *string `min:"2" type:"string" required:"true"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier - // for a payment credit or debit card and associates the card to a specific - // account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SessionKeyEmv2000's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"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 SessionKeyEmv2000) 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 SessionKeyEmv2000) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SessionKeyEmv2000) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SessionKeyEmv2000"} - if s.ApplicationTransactionCounter == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationTransactionCounter")) - } - if s.ApplicationTransactionCounter != nil && len(*s.ApplicationTransactionCounter) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationTransactionCounter", 2)) - } - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationTransactionCounter sets the ApplicationTransactionCounter field's value. -func (s *SessionKeyEmv2000) SetApplicationTransactionCounter(v string) *SessionKeyEmv2000 { - s.ApplicationTransactionCounter = &v - return s -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *SessionKeyEmv2000) SetPanSequenceNumber(v string) *SessionKeyEmv2000 { - s.PanSequenceNumber = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *SessionKeyEmv2000) SetPrimaryAccountNumber(v string) *SessionKeyEmv2000 { - s.PrimaryAccountNumber = &v - return s -} - -// Parameters to derive session key for an Emv common payment card for ARQC -// verification. -type SessionKeyEmvCommon struct { - _ struct{} `type:"structure"` - - // The transaction counter that is provided by the terminal during transaction - // processing. - // - // ApplicationTransactionCounter is a required field - ApplicationTransactionCounter *string `min:"2" type:"string" required:"true"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier - // for a payment credit or debit card and associates the card to a specific - // account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SessionKeyEmvCommon's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"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 SessionKeyEmvCommon) 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 SessionKeyEmvCommon) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SessionKeyEmvCommon) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SessionKeyEmvCommon"} - if s.ApplicationTransactionCounter == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationTransactionCounter")) - } - if s.ApplicationTransactionCounter != nil && len(*s.ApplicationTransactionCounter) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationTransactionCounter", 2)) - } - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationTransactionCounter sets the ApplicationTransactionCounter field's value. -func (s *SessionKeyEmvCommon) SetApplicationTransactionCounter(v string) *SessionKeyEmvCommon { - s.ApplicationTransactionCounter = &v - return s -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *SessionKeyEmvCommon) SetPanSequenceNumber(v string) *SessionKeyEmvCommon { - s.PanSequenceNumber = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *SessionKeyEmvCommon) SetPrimaryAccountNumber(v string) *SessionKeyEmvCommon { - s.PrimaryAccountNumber = &v - return s -} - -// Parameters to derive session key for Mastercard payment card for ARQC verification. -type SessionKeyMastercard struct { - _ struct{} `type:"structure"` - - // The transaction counter that is provided by the terminal during transaction - // processing. - // - // ApplicationTransactionCounter is a required field - ApplicationTransactionCounter *string `min:"2" type:"string" required:"true"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier - // for a payment credit or debit card and associates the card to a specific - // account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SessionKeyMastercard's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"true"` - - // A random number generated by the issuer. - // - // UnpredictableNumber is a required field - UnpredictableNumber *string `min:"2" 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 SessionKeyMastercard) 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 SessionKeyMastercard) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SessionKeyMastercard) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SessionKeyMastercard"} - if s.ApplicationTransactionCounter == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationTransactionCounter")) - } - if s.ApplicationTransactionCounter != nil && len(*s.ApplicationTransactionCounter) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationTransactionCounter", 2)) - } - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - if s.UnpredictableNumber == nil { - invalidParams.Add(request.NewErrParamRequired("UnpredictableNumber")) - } - if s.UnpredictableNumber != nil && len(*s.UnpredictableNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("UnpredictableNumber", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationTransactionCounter sets the ApplicationTransactionCounter field's value. -func (s *SessionKeyMastercard) SetApplicationTransactionCounter(v string) *SessionKeyMastercard { - s.ApplicationTransactionCounter = &v - return s -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *SessionKeyMastercard) SetPanSequenceNumber(v string) *SessionKeyMastercard { - s.PanSequenceNumber = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *SessionKeyMastercard) SetPrimaryAccountNumber(v string) *SessionKeyMastercard { - s.PrimaryAccountNumber = &v - return s -} - -// SetUnpredictableNumber sets the UnpredictableNumber field's value. -func (s *SessionKeyMastercard) SetUnpredictableNumber(v string) *SessionKeyMastercard { - s.UnpredictableNumber = &v - return s -} - -// Parameters to derive session key for Visa payment card for ARQC verification. -type SessionKeyVisa struct { - _ struct{} `type:"structure"` - - // A number that identifies and differentiates payment cards with the same Primary - // Account Number (PAN). - // - // PanSequenceNumber is a required field - PanSequenceNumber *string `min:"2" type:"string" required:"true"` - - // The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier - // for a payment credit or debit card and associates the card to a specific - // account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SessionKeyVisa's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"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 SessionKeyVisa) 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 SessionKeyVisa) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SessionKeyVisa) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SessionKeyVisa"} - if s.PanSequenceNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PanSequenceNumber")) - } - if s.PanSequenceNumber != nil && len(*s.PanSequenceNumber) < 2 { - invalidParams.Add(request.NewErrParamMinLen("PanSequenceNumber", 2)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPanSequenceNumber sets the PanSequenceNumber field's value. -func (s *SessionKeyVisa) SetPanSequenceNumber(v string) *SessionKeyVisa { - s.PanSequenceNumber = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *SessionKeyVisa) SetPrimaryAccountNumber(v string) *SessionKeyVisa { - s.PrimaryAccountNumber = &v - return s -} - -// Parameters requried to encrypt plaintext data using symmetric keys. -type SymmetricEncryptionAttributes struct { - _ struct{} `type:"structure"` - - // An input to cryptographic primitive used to provide the intial state. The - // InitializationVector is typically required have a random or psuedo-random - // value, but sometimes it only needs to be unpredictable or unique. If a value - // is not provided, Amazon Web Services Payment Cryptography generates a random - // value. - // - // InitializationVector is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SymmetricEncryptionAttributes's - // String and GoString methods. - InitializationVector *string `min:"16" type:"string" sensitive:"true"` - - // The block cipher mode of operation. Block ciphers are designed to encrypt - // a block of data of fixed size (for example, 128 bits). The size of the input - // block is usually same as the size of the encrypted output block, while the - // key length can be different. A mode of operation describes how to repeatedly - // apply a cipher's single-block operation to securely transform amounts of - // data larger than a block. - // - // Mode is a required field - Mode *string `type:"string" required:"true" enum:"EncryptionMode"` - - // The padding to be included with the data. - PaddingType *string `type:"string" enum:"PaddingType"` -} - -// 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 SymmetricEncryptionAttributes) 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 SymmetricEncryptionAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SymmetricEncryptionAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SymmetricEncryptionAttributes"} - if s.InitializationVector != nil && len(*s.InitializationVector) < 16 { - invalidParams.Add(request.NewErrParamMinLen("InitializationVector", 16)) - } - if s.Mode == nil { - invalidParams.Add(request.NewErrParamRequired("Mode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInitializationVector sets the InitializationVector field's value. -func (s *SymmetricEncryptionAttributes) SetInitializationVector(v string) *SymmetricEncryptionAttributes { - s.InitializationVector = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *SymmetricEncryptionAttributes) SetMode(v string) *SymmetricEncryptionAttributes { - s.Mode = &v - return s -} - -// SetPaddingType sets the PaddingType field's value. -func (s *SymmetricEncryptionAttributes) SetPaddingType(v string) *SymmetricEncryptionAttributes { - s.PaddingType = &v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type TranslatePinDataInput struct { - _ struct{} `type:"structure"` - - // The encrypted PIN block data that Amazon Web Services Payment Cryptography - // translates. - // - // EncryptedPinBlock is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TranslatePinDataInput's - // String and GoString methods. - // - // EncryptedPinBlock is a required field - EncryptedPinBlock *string `min:"16" type:"string" required:"true" sensitive:"true"` - - // The attributes and values to use for incoming DUKPT encryption key for PIN - // block tranlation. - IncomingDukptAttributes *DukptDerivationAttributes `type:"structure"` - - // The keyARN of the encryption key under which incoming PIN block data is encrypted. - // This key type can be PEK or BDK. - // - // IncomingKeyIdentifier is a required field - IncomingKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The format of the incoming PIN block data for tranlation within Amazon Web - // Services Payment Cryptography. - // - // IncomingTranslationAttributes is a required field - IncomingTranslationAttributes *TranslationIsoFormats `type:"structure" required:"true"` - - // The attributes and values to use for outgoing DUKPT encryption key after - // PIN block translation. - OutgoingDukptAttributes *DukptDerivationAttributes `type:"structure"` - - // The keyARN of the encryption key for encrypting outgoing PIN block data. - // This key type can be PEK or BDK. - // - // OutgoingKeyIdentifier is a required field - OutgoingKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The format of the outgoing PIN block data after tranlation by Amazon Web - // Services Payment Cryptography. - // - // OutgoingTranslationAttributes is a required field - OutgoingTranslationAttributes *TranslationIsoFormats `type:"structure" 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 TranslatePinDataInput) 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 TranslatePinDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TranslatePinDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TranslatePinDataInput"} - if s.EncryptedPinBlock == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptedPinBlock")) - } - if s.EncryptedPinBlock != nil && len(*s.EncryptedPinBlock) < 16 { - invalidParams.Add(request.NewErrParamMinLen("EncryptedPinBlock", 16)) - } - if s.IncomingKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("IncomingKeyIdentifier")) - } - if s.IncomingKeyIdentifier != nil && len(*s.IncomingKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("IncomingKeyIdentifier", 7)) - } - if s.IncomingTranslationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("IncomingTranslationAttributes")) - } - if s.OutgoingKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OutgoingKeyIdentifier")) - } - if s.OutgoingKeyIdentifier != nil && len(*s.OutgoingKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("OutgoingKeyIdentifier", 7)) - } - if s.OutgoingTranslationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("OutgoingTranslationAttributes")) - } - if s.IncomingDukptAttributes != nil { - if err := s.IncomingDukptAttributes.Validate(); err != nil { - invalidParams.AddNested("IncomingDukptAttributes", err.(request.ErrInvalidParams)) - } - } - if s.IncomingTranslationAttributes != nil { - if err := s.IncomingTranslationAttributes.Validate(); err != nil { - invalidParams.AddNested("IncomingTranslationAttributes", err.(request.ErrInvalidParams)) - } - } - if s.OutgoingDukptAttributes != nil { - if err := s.OutgoingDukptAttributes.Validate(); err != nil { - invalidParams.AddNested("OutgoingDukptAttributes", err.(request.ErrInvalidParams)) - } - } - if s.OutgoingTranslationAttributes != nil { - if err := s.OutgoingTranslationAttributes.Validate(); err != nil { - invalidParams.AddNested("OutgoingTranslationAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptedPinBlock sets the EncryptedPinBlock field's value. -func (s *TranslatePinDataInput) SetEncryptedPinBlock(v string) *TranslatePinDataInput { - s.EncryptedPinBlock = &v - return s -} - -// SetIncomingDukptAttributes sets the IncomingDukptAttributes field's value. -func (s *TranslatePinDataInput) SetIncomingDukptAttributes(v *DukptDerivationAttributes) *TranslatePinDataInput { - s.IncomingDukptAttributes = v - return s -} - -// SetIncomingKeyIdentifier sets the IncomingKeyIdentifier field's value. -func (s *TranslatePinDataInput) SetIncomingKeyIdentifier(v string) *TranslatePinDataInput { - s.IncomingKeyIdentifier = &v - return s -} - -// SetIncomingTranslationAttributes sets the IncomingTranslationAttributes field's value. -func (s *TranslatePinDataInput) SetIncomingTranslationAttributes(v *TranslationIsoFormats) *TranslatePinDataInput { - s.IncomingTranslationAttributes = v - return s -} - -// SetOutgoingDukptAttributes sets the OutgoingDukptAttributes field's value. -func (s *TranslatePinDataInput) SetOutgoingDukptAttributes(v *DukptDerivationAttributes) *TranslatePinDataInput { - s.OutgoingDukptAttributes = v - return s -} - -// SetOutgoingKeyIdentifier sets the OutgoingKeyIdentifier field's value. -func (s *TranslatePinDataInput) SetOutgoingKeyIdentifier(v string) *TranslatePinDataInput { - s.OutgoingKeyIdentifier = &v - return s -} - -// SetOutgoingTranslationAttributes sets the OutgoingTranslationAttributes field's value. -func (s *TranslatePinDataInput) SetOutgoingTranslationAttributes(v *TranslationIsoFormats) *TranslatePinDataInput { - s.OutgoingTranslationAttributes = v - return s -} - -type TranslatePinDataOutput struct { - _ struct{} `type:"structure"` - - // The keyARN of the encryption key that Amazon Web Services Payment Cryptography - // uses to encrypt outgoing PIN block data after translation. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The ougoing encrypted PIN block data after tranlation. - // - // PinBlock is a required field - PinBlock *string `min:"16" 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 TranslatePinDataOutput) 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 TranslatePinDataOutput) GoString() string { - return s.String() -} - -// SetKeyArn sets the KeyArn field's value. -func (s *TranslatePinDataOutput) SetKeyArn(v string) *TranslatePinDataOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *TranslatePinDataOutput) SetKeyCheckValue(v string) *TranslatePinDataOutput { - s.KeyCheckValue = &v - return s -} - -// SetPinBlock sets the PinBlock field's value. -func (s *TranslatePinDataOutput) SetPinBlock(v string) *TranslatePinDataOutput { - s.PinBlock = &v - return s -} - -// Parameters that are required for translation between ISO9564 PIN block formats -// 0,1,3,4. -type TranslationIsoFormats struct { - _ struct{} `type:"structure"` - - // Parameters that are required for ISO9564 PIN format 0 tranlation. - IsoFormat0 *TranslationPinDataIsoFormat034 `type:"structure"` - - // Parameters that are required for ISO9564 PIN format 1 tranlation. - IsoFormat1 *TranslationPinDataIsoFormat1 `type:"structure"` - - // Parameters that are required for ISO9564 PIN format 3 tranlation. - IsoFormat3 *TranslationPinDataIsoFormat034 `type:"structure"` - - // Parameters that are required for ISO9564 PIN format 4 tranlation. - IsoFormat4 *TranslationPinDataIsoFormat034 `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 TranslationIsoFormats) 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 TranslationIsoFormats) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TranslationIsoFormats) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TranslationIsoFormats"} - if s.IsoFormat0 != nil { - if err := s.IsoFormat0.Validate(); err != nil { - invalidParams.AddNested("IsoFormat0", err.(request.ErrInvalidParams)) - } - } - if s.IsoFormat3 != nil { - if err := s.IsoFormat3.Validate(); err != nil { - invalidParams.AddNested("IsoFormat3", err.(request.ErrInvalidParams)) - } - } - if s.IsoFormat4 != nil { - if err := s.IsoFormat4.Validate(); err != nil { - invalidParams.AddNested("IsoFormat4", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIsoFormat0 sets the IsoFormat0 field's value. -func (s *TranslationIsoFormats) SetIsoFormat0(v *TranslationPinDataIsoFormat034) *TranslationIsoFormats { - s.IsoFormat0 = v - return s -} - -// SetIsoFormat1 sets the IsoFormat1 field's value. -func (s *TranslationIsoFormats) SetIsoFormat1(v *TranslationPinDataIsoFormat1) *TranslationIsoFormats { - s.IsoFormat1 = v - return s -} - -// SetIsoFormat3 sets the IsoFormat3 field's value. -func (s *TranslationIsoFormats) SetIsoFormat3(v *TranslationPinDataIsoFormat034) *TranslationIsoFormats { - s.IsoFormat3 = v - return s -} - -// SetIsoFormat4 sets the IsoFormat4 field's value. -func (s *TranslationIsoFormats) SetIsoFormat4(v *TranslationPinDataIsoFormat034) *TranslationIsoFormats { - s.IsoFormat4 = v - return s -} - -// Parameters that are required for tranlation between ISO9564 PIN format 0,3,4 -// tranlation. -type TranslationPinDataIsoFormat034 struct { - _ struct{} `type:"structure"` - - // The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier - // for a payment credit or debit card and associates the card to a specific - // account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TranslationPinDataIsoFormat034's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"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 TranslationPinDataIsoFormat034) 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 TranslationPinDataIsoFormat034) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TranslationPinDataIsoFormat034) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TranslationPinDataIsoFormat034"} - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *TranslationPinDataIsoFormat034) SetPrimaryAccountNumber(v string) *TranslationPinDataIsoFormat034 { - s.PrimaryAccountNumber = &v - return s -} - -// Parameters that are required for ISO9564 PIN format 1 tranlation. -type TranslationPinDataIsoFormat1 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 TranslationPinDataIsoFormat1) 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 TranslationPinDataIsoFormat1) GoString() string { - return s.String() -} - -// The request was denied due to an invalid request error. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The request was denied due to an invalid request error. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request was denied due to an invalid request error. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // The request was denied due to an invalid request error. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The request was denied due to an invalid request error. - // - // Path is a required field - Path *string `locationName:"path" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetPath sets the Path field's value. -func (s *ValidationExceptionField) SetPath(v string) *ValidationExceptionField { - s.Path = &v - return s -} - -// This request failed verification. -type VerificationFailedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The reason for the exception. - // - // Reason is a required field - Reason *string `type:"string" required:"true" enum:"VerificationFailedReason"` -} - -// 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 VerificationFailedException) 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 VerificationFailedException) GoString() string { - return s.String() -} - -func newErrorVerificationFailedException(v protocol.ResponseMetadata) error { - return &VerificationFailedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *VerificationFailedException) Code() string { - return "VerificationFailedException" -} - -// Message returns the exception's message. -func (s *VerificationFailedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *VerificationFailedException) OrigErr() error { - return nil -} - -func (s *VerificationFailedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *VerificationFailedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *VerificationFailedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type VerifyAuthRequestCryptogramInput struct { - _ struct{} `type:"structure"` - - // The auth request cryptogram imported into Amazon Web Services Payment Cryptography - // for ARQC verification using a major encryption key and transaction data. - // - // AuthRequestCryptogram is a required field - AuthRequestCryptogram *string `min:"16" type:"string" required:"true"` - - // The attributes and values for auth request cryptogram verification. These - // parameters are required in case using ARPC Method 1 or Method 2 for ARQC - // verification. - AuthResponseAttributes *CryptogramAuthResponse `type:"structure"` - - // The keyARN of the major encryption key that Amazon Web Services Payment Cryptography - // uses for ARQC verification. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The method to use when deriving the major encryption key for ARQC verification - // within Amazon Web Services Payment Cryptography. The same key derivation - // mode was used for ARQC generation outside of Amazon Web Services Payment - // Cryptography. - // - // MajorKeyDerivationMode is a required field - MajorKeyDerivationMode *string `type:"string" required:"true" enum:"MajorKeyDerivationMode"` - - // The attributes and values to use for deriving a session key for ARQC verification - // within Amazon Web Services Payment Cryptography. The same attributes were - // used for ARQC generation outside of Amazon Web Services Payment Cryptography. - // - // SessionKeyDerivationAttributes is a required field - SessionKeyDerivationAttributes *SessionKeyDerivation `type:"structure" required:"true"` - - // The transaction data that Amazon Web Services Payment Cryptography uses for - // ARQC verification. The same transaction is used for ARQC generation outside - // of Amazon Web Services Payment Cryptography. - // - // TransactionData is a required field - TransactionData *string `min:"2" 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 VerifyAuthRequestCryptogramInput) 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 VerifyAuthRequestCryptogramInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyAuthRequestCryptogramInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyAuthRequestCryptogramInput"} - if s.AuthRequestCryptogram == nil { - invalidParams.Add(request.NewErrParamRequired("AuthRequestCryptogram")) - } - if s.AuthRequestCryptogram != nil && len(*s.AuthRequestCryptogram) < 16 { - invalidParams.Add(request.NewErrParamMinLen("AuthRequestCryptogram", 16)) - } - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - if s.MajorKeyDerivationMode == nil { - invalidParams.Add(request.NewErrParamRequired("MajorKeyDerivationMode")) - } - if s.SessionKeyDerivationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("SessionKeyDerivationAttributes")) - } - if s.TransactionData == nil { - invalidParams.Add(request.NewErrParamRequired("TransactionData")) - } - if s.TransactionData != nil && len(*s.TransactionData) < 2 { - invalidParams.Add(request.NewErrParamMinLen("TransactionData", 2)) - } - if s.AuthResponseAttributes != nil { - if err := s.AuthResponseAttributes.Validate(); err != nil { - invalidParams.AddNested("AuthResponseAttributes", err.(request.ErrInvalidParams)) - } - } - if s.SessionKeyDerivationAttributes != nil { - if err := s.SessionKeyDerivationAttributes.Validate(); err != nil { - invalidParams.AddNested("SessionKeyDerivationAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthRequestCryptogram sets the AuthRequestCryptogram field's value. -func (s *VerifyAuthRequestCryptogramInput) SetAuthRequestCryptogram(v string) *VerifyAuthRequestCryptogramInput { - s.AuthRequestCryptogram = &v - return s -} - -// SetAuthResponseAttributes sets the AuthResponseAttributes field's value. -func (s *VerifyAuthRequestCryptogramInput) SetAuthResponseAttributes(v *CryptogramAuthResponse) *VerifyAuthRequestCryptogramInput { - s.AuthResponseAttributes = v - return s -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *VerifyAuthRequestCryptogramInput) SetKeyIdentifier(v string) *VerifyAuthRequestCryptogramInput { - s.KeyIdentifier = &v - return s -} - -// SetMajorKeyDerivationMode sets the MajorKeyDerivationMode field's value. -func (s *VerifyAuthRequestCryptogramInput) SetMajorKeyDerivationMode(v string) *VerifyAuthRequestCryptogramInput { - s.MajorKeyDerivationMode = &v - return s -} - -// SetSessionKeyDerivationAttributes sets the SessionKeyDerivationAttributes field's value. -func (s *VerifyAuthRequestCryptogramInput) SetSessionKeyDerivationAttributes(v *SessionKeyDerivation) *VerifyAuthRequestCryptogramInput { - s.SessionKeyDerivationAttributes = v - return s -} - -// SetTransactionData sets the TransactionData field's value. -func (s *VerifyAuthRequestCryptogramInput) SetTransactionData(v string) *VerifyAuthRequestCryptogramInput { - s.TransactionData = &v - return s -} - -type VerifyAuthRequestCryptogramOutput struct { - _ struct{} `type:"structure"` - - // The result for ARQC verification or ARPC generation within Amazon Web Services - // Payment Cryptography. - AuthResponseValue *string `min:"1" type:"string"` - - // The keyARN of the major encryption key that Amazon Web Services Payment Cryptography - // uses for ARQC verification. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" 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 VerifyAuthRequestCryptogramOutput) 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 VerifyAuthRequestCryptogramOutput) GoString() string { - return s.String() -} - -// SetAuthResponseValue sets the AuthResponseValue field's value. -func (s *VerifyAuthRequestCryptogramOutput) SetAuthResponseValue(v string) *VerifyAuthRequestCryptogramOutput { - s.AuthResponseValue = &v - return s -} - -// SetKeyArn sets the KeyArn field's value. -func (s *VerifyAuthRequestCryptogramOutput) SetKeyArn(v string) *VerifyAuthRequestCryptogramOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *VerifyAuthRequestCryptogramOutput) SetKeyCheckValue(v string) *VerifyAuthRequestCryptogramOutput { - s.KeyCheckValue = &v - return s -} - -type VerifyCardValidationDataInput struct { - _ struct{} `type:"structure"` - - // The keyARN of the CVK encryption key that Amazon Web Services Payment Cryptography - // uses to verify card data. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The Primary Account Number (PAN), a unique identifier for a payment credit - // or debit card that associates the card with a specific account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by VerifyCardValidationDataInput's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"true"` - - // The CVV or CSC value for use for card data verification within Amazon Web - // Services Payment Cryptography. - // - // ValidationData is a required field - ValidationData *string `min:"3" type:"string" required:"true"` - - // The algorithm to use for verification of card data within Amazon Web Services - // Payment Cryptography. - // - // VerificationAttributes is a required field - VerificationAttributes *CardVerificationAttributes `type:"structure" 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 VerifyCardValidationDataInput) 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 VerifyCardValidationDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyCardValidationDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyCardValidationDataInput"} - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - if s.ValidationData == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationData")) - } - if s.ValidationData != nil && len(*s.ValidationData) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ValidationData", 3)) - } - if s.VerificationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("VerificationAttributes")) - } - if s.VerificationAttributes != nil { - if err := s.VerificationAttributes.Validate(); err != nil { - invalidParams.AddNested("VerificationAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *VerifyCardValidationDataInput) SetKeyIdentifier(v string) *VerifyCardValidationDataInput { - s.KeyIdentifier = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *VerifyCardValidationDataInput) SetPrimaryAccountNumber(v string) *VerifyCardValidationDataInput { - s.PrimaryAccountNumber = &v - return s -} - -// SetValidationData sets the ValidationData field's value. -func (s *VerifyCardValidationDataInput) SetValidationData(v string) *VerifyCardValidationDataInput { - s.ValidationData = &v - return s -} - -// SetVerificationAttributes sets the VerificationAttributes field's value. -func (s *VerifyCardValidationDataInput) SetVerificationAttributes(v *CardVerificationAttributes) *VerifyCardValidationDataInput { - s.VerificationAttributes = v - return s -} - -type VerifyCardValidationDataOutput struct { - _ struct{} `type:"structure"` - - // The keyARN of the CVK encryption key that Amazon Web Services Payment Cryptography - // uses to verify CVV or CSC. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" 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 VerifyCardValidationDataOutput) 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 VerifyCardValidationDataOutput) GoString() string { - return s.String() -} - -// SetKeyArn sets the KeyArn field's value. -func (s *VerifyCardValidationDataOutput) SetKeyArn(v string) *VerifyCardValidationDataOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *VerifyCardValidationDataOutput) SetKeyCheckValue(v string) *VerifyCardValidationDataOutput { - s.KeyCheckValue = &v - return s -} - -type VerifyMacInput struct { - _ struct{} `type:"structure"` - - // The keyARN of the encryption key that Amazon Web Services Payment Cryptography - // uses to verify MAC data. - // - // KeyIdentifier is a required field - KeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The MAC being verified. - // - // Mac is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by VerifyMacInput's - // String and GoString methods. - // - // Mac is a required field - Mac *string `min:"4" type:"string" required:"true" sensitive:"true"` - - // The length of the MAC. - MacLength *int64 `min:"4" type:"integer"` - - // The data on for which MAC is under verification. - // - // MessageData is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by VerifyMacInput's - // String and GoString methods. - // - // MessageData is a required field - MessageData *string `min:"2" type:"string" required:"true" sensitive:"true"` - - // The attributes and data values to use for MAC verification within Amazon - // Web Services Payment Cryptography. - // - // VerificationAttributes is a required field - VerificationAttributes *MacAttributes `type:"structure" 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 VerifyMacInput) 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 VerifyMacInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyMacInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyMacInput"} - if s.KeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("KeyIdentifier")) - } - if s.KeyIdentifier != nil && len(*s.KeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("KeyIdentifier", 7)) - } - if s.Mac == nil { - invalidParams.Add(request.NewErrParamRequired("Mac")) - } - if s.Mac != nil && len(*s.Mac) < 4 { - invalidParams.Add(request.NewErrParamMinLen("Mac", 4)) - } - if s.MacLength != nil && *s.MacLength < 4 { - invalidParams.Add(request.NewErrParamMinValue("MacLength", 4)) - } - if s.MessageData == nil { - invalidParams.Add(request.NewErrParamRequired("MessageData")) - } - if s.MessageData != nil && len(*s.MessageData) < 2 { - invalidParams.Add(request.NewErrParamMinLen("MessageData", 2)) - } - if s.VerificationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("VerificationAttributes")) - } - if s.VerificationAttributes != nil { - if err := s.VerificationAttributes.Validate(); err != nil { - invalidParams.AddNested("VerificationAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyIdentifier sets the KeyIdentifier field's value. -func (s *VerifyMacInput) SetKeyIdentifier(v string) *VerifyMacInput { - s.KeyIdentifier = &v - return s -} - -// SetMac sets the Mac field's value. -func (s *VerifyMacInput) SetMac(v string) *VerifyMacInput { - s.Mac = &v - return s -} - -// SetMacLength sets the MacLength field's value. -func (s *VerifyMacInput) SetMacLength(v int64) *VerifyMacInput { - s.MacLength = &v - return s -} - -// SetMessageData sets the MessageData field's value. -func (s *VerifyMacInput) SetMessageData(v string) *VerifyMacInput { - s.MessageData = &v - return s -} - -// SetVerificationAttributes sets the VerificationAttributes field's value. -func (s *VerifyMacInput) SetVerificationAttributes(v *MacAttributes) *VerifyMacInput { - s.VerificationAttributes = v - return s -} - -type VerifyMacOutput struct { - _ struct{} `type:"structure"` - - // The keyARN of the encryption key that Amazon Web Services Payment Cryptography - // uses for MAC verification. - // - // KeyArn is a required field - KeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // KeyCheckValue is a required field - KeyCheckValue *string `min:"4" 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 VerifyMacOutput) 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 VerifyMacOutput) GoString() string { - return s.String() -} - -// SetKeyArn sets the KeyArn field's value. -func (s *VerifyMacOutput) SetKeyArn(v string) *VerifyMacOutput { - s.KeyArn = &v - return s -} - -// SetKeyCheckValue sets the KeyCheckValue field's value. -func (s *VerifyMacOutput) SetKeyCheckValue(v string) *VerifyMacOutput { - s.KeyCheckValue = &v - return s -} - -type VerifyPinDataInput struct { - _ struct{} `type:"structure"` - - // The attributes and values for the DUKPT encrypted PIN block data. - DukptAttributes *DukptAttributes `type:"structure"` - - // The encrypted PIN block data that Amazon Web Services Payment Cryptography - // verifies. - // - // EncryptedPinBlock is a required field - EncryptedPinBlock *string `min:"16" type:"string" required:"true"` - - // The keyARN of the encryption key under which the PIN block data is encrypted. - // This key type can be PEK or BDK. - // - // EncryptionKeyIdentifier is a required field - EncryptionKeyIdentifier *string `min:"7" type:"string" required:"true"` - - // The PIN encoding format for pin data generation as specified in ISO 9564. - // Amazon Web Services Payment Cryptography supports ISO_Format_0 and ISO_Format_3. - // - // The ISO_Format_0 PIN block format is equivalent to the ANSI X9.8, VISA-1, - // and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. - // It supports a PIN from 4 to 12 digits in length. - // - // The ISO_Format_3 PIN block format is the same as ISO_Format_0 except that - // the fill digits are random values from 10 to 15. - // - // PinBlockFormat is a required field - PinBlockFormat *string `type:"string" required:"true" enum:"PinBlockFormatForPinData"` - - // The length of PIN being verified. - PinDataLength *int64 `min:"4" type:"integer"` - - // The Primary Account Number (PAN), a unique identifier for a payment credit - // or debit card that associates the card with a specific account holder. - // - // PrimaryAccountNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by VerifyPinDataInput's - // String and GoString methods. - // - // PrimaryAccountNumber is a required field - PrimaryAccountNumber *string `min:"12" type:"string" required:"true" sensitive:"true"` - - // The attributes and values for PIN data verification. - // - // VerificationAttributes is a required field - VerificationAttributes *PinVerificationAttributes `type:"structure" required:"true"` - - // The keyARN of the PIN verification key. - // - // VerificationKeyIdentifier is a required field - VerificationKeyIdentifier *string `min:"7" 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 VerifyPinDataInput) 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 VerifyPinDataInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VerifyPinDataInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VerifyPinDataInput"} - if s.EncryptedPinBlock == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptedPinBlock")) - } - if s.EncryptedPinBlock != nil && len(*s.EncryptedPinBlock) < 16 { - invalidParams.Add(request.NewErrParamMinLen("EncryptedPinBlock", 16)) - } - if s.EncryptionKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionKeyIdentifier")) - } - if s.EncryptionKeyIdentifier != nil && len(*s.EncryptionKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("EncryptionKeyIdentifier", 7)) - } - if s.PinBlockFormat == nil { - invalidParams.Add(request.NewErrParamRequired("PinBlockFormat")) - } - if s.PinDataLength != nil && *s.PinDataLength < 4 { - invalidParams.Add(request.NewErrParamMinValue("PinDataLength", 4)) - } - if s.PrimaryAccountNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PrimaryAccountNumber")) - } - if s.PrimaryAccountNumber != nil && len(*s.PrimaryAccountNumber) < 12 { - invalidParams.Add(request.NewErrParamMinLen("PrimaryAccountNumber", 12)) - } - if s.VerificationAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("VerificationAttributes")) - } - if s.VerificationKeyIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("VerificationKeyIdentifier")) - } - if s.VerificationKeyIdentifier != nil && len(*s.VerificationKeyIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("VerificationKeyIdentifier", 7)) - } - if s.DukptAttributes != nil { - if err := s.DukptAttributes.Validate(); err != nil { - invalidParams.AddNested("DukptAttributes", err.(request.ErrInvalidParams)) - } - } - if s.VerificationAttributes != nil { - if err := s.VerificationAttributes.Validate(); err != nil { - invalidParams.AddNested("VerificationAttributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDukptAttributes sets the DukptAttributes field's value. -func (s *VerifyPinDataInput) SetDukptAttributes(v *DukptAttributes) *VerifyPinDataInput { - s.DukptAttributes = v - return s -} - -// SetEncryptedPinBlock sets the EncryptedPinBlock field's value. -func (s *VerifyPinDataInput) SetEncryptedPinBlock(v string) *VerifyPinDataInput { - s.EncryptedPinBlock = &v - return s -} - -// SetEncryptionKeyIdentifier sets the EncryptionKeyIdentifier field's value. -func (s *VerifyPinDataInput) SetEncryptionKeyIdentifier(v string) *VerifyPinDataInput { - s.EncryptionKeyIdentifier = &v - return s -} - -// SetPinBlockFormat sets the PinBlockFormat field's value. -func (s *VerifyPinDataInput) SetPinBlockFormat(v string) *VerifyPinDataInput { - s.PinBlockFormat = &v - return s -} - -// SetPinDataLength sets the PinDataLength field's value. -func (s *VerifyPinDataInput) SetPinDataLength(v int64) *VerifyPinDataInput { - s.PinDataLength = &v - return s -} - -// SetPrimaryAccountNumber sets the PrimaryAccountNumber field's value. -func (s *VerifyPinDataInput) SetPrimaryAccountNumber(v string) *VerifyPinDataInput { - s.PrimaryAccountNumber = &v - return s -} - -// SetVerificationAttributes sets the VerificationAttributes field's value. -func (s *VerifyPinDataInput) SetVerificationAttributes(v *PinVerificationAttributes) *VerifyPinDataInput { - s.VerificationAttributes = v - return s -} - -// SetVerificationKeyIdentifier sets the VerificationKeyIdentifier field's value. -func (s *VerifyPinDataInput) SetVerificationKeyIdentifier(v string) *VerifyPinDataInput { - s.VerificationKeyIdentifier = &v - return s -} - -type VerifyPinDataOutput struct { - _ struct{} `type:"structure"` - - // The keyARN of the PEK that Amazon Web Services Payment Cryptography uses - // for encrypted pin block generation. - // - // EncryptionKeyArn is a required field - EncryptionKeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // EncryptionKeyCheckValue is a required field - EncryptionKeyCheckValue *string `min:"4" type:"string" required:"true"` - - // The keyARN of the PIN encryption key that Amazon Web Services Payment Cryptography - // uses for PIN or PIN Offset verification. - // - // VerificationKeyArn is a required field - VerificationKeyArn *string `min:"70" type:"string" required:"true"` - - // The key check value (KCV) of the encryption key. The KCV is used to check - // if all parties holding a given key have the same key or to detect that a - // key has changed. Amazon Web Services Payment Cryptography calculates the - // KCV by using standard algorithms, typically by encrypting 8 or 16 bytes or - // "00" or "01" and then truncating the result to the first 3 bytes, or 6 hex - // digits, of the resulting cryptogram. - // - // VerificationKeyCheckValue is a required field - VerificationKeyCheckValue *string `min:"4" 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 VerifyPinDataOutput) 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 VerifyPinDataOutput) GoString() string { - return s.String() -} - -// SetEncryptionKeyArn sets the EncryptionKeyArn field's value. -func (s *VerifyPinDataOutput) SetEncryptionKeyArn(v string) *VerifyPinDataOutput { - s.EncryptionKeyArn = &v - return s -} - -// SetEncryptionKeyCheckValue sets the EncryptionKeyCheckValue field's value. -func (s *VerifyPinDataOutput) SetEncryptionKeyCheckValue(v string) *VerifyPinDataOutput { - s.EncryptionKeyCheckValue = &v - return s -} - -// SetVerificationKeyArn sets the VerificationKeyArn field's value. -func (s *VerifyPinDataOutput) SetVerificationKeyArn(v string) *VerifyPinDataOutput { - s.VerificationKeyArn = &v - return s -} - -// SetVerificationKeyCheckValue sets the VerificationKeyCheckValue field's value. -func (s *VerifyPinDataOutput) SetVerificationKeyCheckValue(v string) *VerifyPinDataOutput { - s.VerificationKeyCheckValue = &v - return s -} - -// Parameters that are required to generate or verify Visa PIN. -type VisaPin struct { - _ struct{} `type:"structure"` - - // The value for PIN verification index. It is used in the Visa PIN algorithm - // to calculate the PVV (PIN Verification Value). - // - // PinVerificationKeyIndex is a required field - PinVerificationKeyIndex *int64 `type:"integer" 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 VisaPin) 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 VisaPin) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VisaPin) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VisaPin"} - if s.PinVerificationKeyIndex == nil { - invalidParams.Add(request.NewErrParamRequired("PinVerificationKeyIndex")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPinVerificationKeyIndex sets the PinVerificationKeyIndex field's value. -func (s *VisaPin) SetPinVerificationKeyIndex(v int64) *VisaPin { - s.PinVerificationKeyIndex = &v - return s -} - -// Parameters that are required to generate or verify Visa PIN. -type VisaPinVerification struct { - _ struct{} `type:"structure"` - - // The value for PIN verification index. It is used in the Visa PIN algorithm - // to calculate the PVV (PIN Verification Value). - // - // PinVerificationKeyIndex is a required field - PinVerificationKeyIndex *int64 `type:"integer" required:"true"` - - // Parameters that are required to generate or verify Visa PVV (PIN Verification - // Value). - // - // VerificationValue is a required field - VerificationValue *string `min:"4" 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 VisaPinVerification) 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 VisaPinVerification) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VisaPinVerification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VisaPinVerification"} - if s.PinVerificationKeyIndex == nil { - invalidParams.Add(request.NewErrParamRequired("PinVerificationKeyIndex")) - } - if s.VerificationValue == nil { - invalidParams.Add(request.NewErrParamRequired("VerificationValue")) - } - if s.VerificationValue != nil && len(*s.VerificationValue) < 4 { - invalidParams.Add(request.NewErrParamMinLen("VerificationValue", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPinVerificationKeyIndex sets the PinVerificationKeyIndex field's value. -func (s *VisaPinVerification) SetPinVerificationKeyIndex(v int64) *VisaPinVerification { - s.PinVerificationKeyIndex = &v - return s -} - -// SetVerificationValue sets the VerificationValue field's value. -func (s *VisaPinVerification) SetVerificationValue(v string) *VisaPinVerification { - s.VerificationValue = &v - return s -} - -// Parameters that are required to generate or verify Visa PVV (PIN Verification -// Value). -type VisaPinVerificationValue struct { - _ struct{} `type:"structure"` - - // The encrypted PIN block data to verify. - // - // EncryptedPinBlock is a required field - EncryptedPinBlock *string `min:"16" type:"string" required:"true"` - - // The value for PIN verification index. It is used in the Visa PIN algorithm - // to calculate the PVV (PIN Verification Value). - // - // PinVerificationKeyIndex is a required field - PinVerificationKeyIndex *int64 `type:"integer" 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 VisaPinVerificationValue) 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 VisaPinVerificationValue) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VisaPinVerificationValue) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VisaPinVerificationValue"} - if s.EncryptedPinBlock == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptedPinBlock")) - } - if s.EncryptedPinBlock != nil && len(*s.EncryptedPinBlock) < 16 { - invalidParams.Add(request.NewErrParamMinLen("EncryptedPinBlock", 16)) - } - if s.PinVerificationKeyIndex == nil { - invalidParams.Add(request.NewErrParamRequired("PinVerificationKeyIndex")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptedPinBlock sets the EncryptedPinBlock field's value. -func (s *VisaPinVerificationValue) SetEncryptedPinBlock(v string) *VisaPinVerificationValue { - s.EncryptedPinBlock = &v - return s -} - -// SetPinVerificationKeyIndex sets the PinVerificationKeyIndex field's value. -func (s *VisaPinVerificationValue) SetPinVerificationKeyIndex(v int64) *VisaPinVerificationValue { - s.PinVerificationKeyIndex = &v - return s -} - -const ( - // DukptDerivationTypeTdes2key is a DukptDerivationType enum value - DukptDerivationTypeTdes2key = "TDES_2KEY" - - // DukptDerivationTypeTdes3key is a DukptDerivationType enum value - DukptDerivationTypeTdes3key = "TDES_3KEY" - - // DukptDerivationTypeAes128 is a DukptDerivationType enum value - DukptDerivationTypeAes128 = "AES_128" - - // DukptDerivationTypeAes192 is a DukptDerivationType enum value - DukptDerivationTypeAes192 = "AES_192" - - // DukptDerivationTypeAes256 is a DukptDerivationType enum value - DukptDerivationTypeAes256 = "AES_256" -) - -// DukptDerivationType_Values returns all elements of the DukptDerivationType enum -func DukptDerivationType_Values() []string { - return []string{ - DukptDerivationTypeTdes2key, - DukptDerivationTypeTdes3key, - DukptDerivationTypeAes128, - DukptDerivationTypeAes192, - DukptDerivationTypeAes256, - } -} - -const ( - // DukptEncryptionModeEcb is a DukptEncryptionMode enum value - DukptEncryptionModeEcb = "ECB" - - // DukptEncryptionModeCbc is a DukptEncryptionMode enum value - DukptEncryptionModeCbc = "CBC" -) - -// DukptEncryptionMode_Values returns all elements of the DukptEncryptionMode enum -func DukptEncryptionMode_Values() []string { - return []string{ - DukptEncryptionModeEcb, - DukptEncryptionModeCbc, - } -} - -const ( - // DukptKeyVariantBidirectional is a DukptKeyVariant enum value - DukptKeyVariantBidirectional = "BIDIRECTIONAL" - - // DukptKeyVariantRequest is a DukptKeyVariant enum value - DukptKeyVariantRequest = "REQUEST" - - // DukptKeyVariantResponse is a DukptKeyVariant enum value - DukptKeyVariantResponse = "RESPONSE" -) - -// DukptKeyVariant_Values returns all elements of the DukptKeyVariant enum -func DukptKeyVariant_Values() []string { - return []string{ - DukptKeyVariantBidirectional, - DukptKeyVariantRequest, - DukptKeyVariantResponse, - } -} - -const ( - // EncryptionModeEcb is a EncryptionMode enum value - EncryptionModeEcb = "ECB" - - // EncryptionModeCbc is a EncryptionMode enum value - EncryptionModeCbc = "CBC" - - // EncryptionModeCfb is a EncryptionMode enum value - EncryptionModeCfb = "CFB" - - // EncryptionModeCfb1 is a EncryptionMode enum value - EncryptionModeCfb1 = "CFB1" - - // EncryptionModeCfb8 is a EncryptionMode enum value - EncryptionModeCfb8 = "CFB8" - - // EncryptionModeCfb64 is a EncryptionMode enum value - EncryptionModeCfb64 = "CFB64" - - // EncryptionModeCfb128 is a EncryptionMode enum value - EncryptionModeCfb128 = "CFB128" - - // EncryptionModeOfb is a EncryptionMode enum value - EncryptionModeOfb = "OFB" -) - -// EncryptionMode_Values returns all elements of the EncryptionMode enum -func EncryptionMode_Values() []string { - return []string{ - EncryptionModeEcb, - EncryptionModeCbc, - EncryptionModeCfb, - EncryptionModeCfb1, - EncryptionModeCfb8, - EncryptionModeCfb64, - EncryptionModeCfb128, - EncryptionModeOfb, - } -} - -const ( - // MacAlgorithmIso9797Algorithm1 is a MacAlgorithm enum value - MacAlgorithmIso9797Algorithm1 = "ISO9797_ALGORITHM1" - - // MacAlgorithmIso9797Algorithm3 is a MacAlgorithm enum value - MacAlgorithmIso9797Algorithm3 = "ISO9797_ALGORITHM3" - - // MacAlgorithmCmac is a MacAlgorithm enum value - MacAlgorithmCmac = "CMAC" - - // MacAlgorithmHmacSha224 is a MacAlgorithm enum value - MacAlgorithmHmacSha224 = "HMAC_SHA224" - - // MacAlgorithmHmacSha256 is a MacAlgorithm enum value - MacAlgorithmHmacSha256 = "HMAC_SHA256" - - // MacAlgorithmHmacSha384 is a MacAlgorithm enum value - MacAlgorithmHmacSha384 = "HMAC_SHA384" - - // MacAlgorithmHmacSha512 is a MacAlgorithm enum value - MacAlgorithmHmacSha512 = "HMAC_SHA512" -) - -// MacAlgorithm_Values returns all elements of the MacAlgorithm enum -func MacAlgorithm_Values() []string { - return []string{ - MacAlgorithmIso9797Algorithm1, - MacAlgorithmIso9797Algorithm3, - MacAlgorithmCmac, - MacAlgorithmHmacSha224, - MacAlgorithmHmacSha256, - MacAlgorithmHmacSha384, - MacAlgorithmHmacSha512, - } -} - -const ( - // MajorKeyDerivationModeEmvOptionA is a MajorKeyDerivationMode enum value - MajorKeyDerivationModeEmvOptionA = "EMV_OPTION_A" - - // MajorKeyDerivationModeEmvOptionB is a MajorKeyDerivationMode enum value - MajorKeyDerivationModeEmvOptionB = "EMV_OPTION_B" -) - -// MajorKeyDerivationMode_Values returns all elements of the MajorKeyDerivationMode enum -func MajorKeyDerivationMode_Values() []string { - return []string{ - MajorKeyDerivationModeEmvOptionA, - MajorKeyDerivationModeEmvOptionB, - } -} - -const ( - // PaddingTypePkcs1 is a PaddingType enum value - PaddingTypePkcs1 = "PKCS1" - - // PaddingTypeOaepSha1 is a PaddingType enum value - PaddingTypeOaepSha1 = "OAEP_SHA1" - - // PaddingTypeOaepSha256 is a PaddingType enum value - PaddingTypeOaepSha256 = "OAEP_SHA256" - - // PaddingTypeOaepSha512 is a PaddingType enum value - PaddingTypeOaepSha512 = "OAEP_SHA512" -) - -// PaddingType_Values returns all elements of the PaddingType enum -func PaddingType_Values() []string { - return []string{ - PaddingTypePkcs1, - PaddingTypeOaepSha1, - PaddingTypeOaepSha256, - PaddingTypeOaepSha512, - } -} - -const ( - // PinBlockFormatForPinDataIsoFormat0 is a PinBlockFormatForPinData enum value - PinBlockFormatForPinDataIsoFormat0 = "ISO_FORMAT_0" - - // PinBlockFormatForPinDataIsoFormat3 is a PinBlockFormatForPinData enum value - PinBlockFormatForPinDataIsoFormat3 = "ISO_FORMAT_3" -) - -// PinBlockFormatForPinData_Values returns all elements of the PinBlockFormatForPinData enum -func PinBlockFormatForPinData_Values() []string { - return []string{ - PinBlockFormatForPinDataIsoFormat0, - PinBlockFormatForPinDataIsoFormat3, - } -} - -const ( - // SessionKeyDerivationModeEmvCommonSessionKey is a SessionKeyDerivationMode enum value - SessionKeyDerivationModeEmvCommonSessionKey = "EMV_COMMON_SESSION_KEY" - - // SessionKeyDerivationModeEmv2000 is a SessionKeyDerivationMode enum value - SessionKeyDerivationModeEmv2000 = "EMV2000" - - // SessionKeyDerivationModeAmex is a SessionKeyDerivationMode enum value - SessionKeyDerivationModeAmex = "AMEX" - - // SessionKeyDerivationModeMastercardSessionKey is a SessionKeyDerivationMode enum value - SessionKeyDerivationModeMastercardSessionKey = "MASTERCARD_SESSION_KEY" - - // SessionKeyDerivationModeVisa is a SessionKeyDerivationMode enum value - SessionKeyDerivationModeVisa = "VISA" -) - -// SessionKeyDerivationMode_Values returns all elements of the SessionKeyDerivationMode enum -func SessionKeyDerivationMode_Values() []string { - return []string{ - SessionKeyDerivationModeEmvCommonSessionKey, - SessionKeyDerivationModeEmv2000, - SessionKeyDerivationModeAmex, - SessionKeyDerivationModeMastercardSessionKey, - SessionKeyDerivationModeVisa, - } -} - -const ( - // VerificationFailedReasonInvalidMac is a VerificationFailedReason enum value - VerificationFailedReasonInvalidMac = "INVALID_MAC" - - // VerificationFailedReasonInvalidPin is a VerificationFailedReason enum value - VerificationFailedReasonInvalidPin = "INVALID_PIN" - - // VerificationFailedReasonInvalidValidationData is a VerificationFailedReason enum value - VerificationFailedReasonInvalidValidationData = "INVALID_VALIDATION_DATA" - - // VerificationFailedReasonInvalidAuthRequestCryptogram is a VerificationFailedReason enum value - VerificationFailedReasonInvalidAuthRequestCryptogram = "INVALID_AUTH_REQUEST_CRYPTOGRAM" -) - -// VerificationFailedReason_Values returns all elements of the VerificationFailedReason enum -func VerificationFailedReason_Values() []string { - return []string{ - VerificationFailedReasonInvalidMac, - VerificationFailedReasonInvalidPin, - VerificationFailedReasonInvalidValidationData, - VerificationFailedReasonInvalidAuthRequestCryptogram, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/doc.go deleted file mode 100644 index 1867979efcc3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/doc.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package paymentcryptographydata provides the client and types for making API -// requests to Payment Cryptography Data Plane. -// -// You use the Amazon Web Services Payment Cryptography Data Plane to manage -// how encryption keys are used for payment-related transaction processing and -// associated cryptographic operations. You can encrypt, decrypt, generate, -// verify, and translate payment-related cryptographic operations in Amazon -// Web Services Payment Cryptography. For more information, see Data operations -// (https://docs.aws.amazon.com/payment-cryptography/latest/userguide/data-operations.html) -// in the Amazon Web Services Payment Cryptography User Guide. -// -// To manage your encryption keys, you use the Amazon Web Services Payment Cryptography -// Control Plane (https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/Welcome.html). -// You can create, import, export, share, manage, and delete keys. You can also -// manage Identity and Access Management (IAM) policies for keys. -// -// See https://docs.aws.amazon.com/goto/WebAPI/payment-cryptography-data-2022-02-03 for more information on this service. -// -// See paymentcryptographydata package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/paymentcryptographydata/ -// -// # Using the Client -// -// To contact Payment Cryptography Data Plane with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Payment Cryptography Data Plane client PaymentCryptographyData for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/paymentcryptographydata/#New -package paymentcryptographydata diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/errors.go deleted file mode 100644 index aa1472386dde..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/errors.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package paymentcryptographydata - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request processing has failed because of an unknown error, exception, - // or failure. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request was denied due to an invalid resource error. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The request was denied due to an invalid request error. - ErrCodeValidationException = "ValidationException" - - // ErrCodeVerificationFailedException for service response error code - // "VerificationFailedException". - // - // This request failed verification. - ErrCodeVerificationFailedException = "VerificationFailedException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, - "VerificationFailedException": newErrorVerificationFailedException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/paymentcryptographydataiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/paymentcryptographydataiface/interface.go deleted file mode 100644 index 7f241bb139fc..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/paymentcryptographydataiface/interface.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package paymentcryptographydataiface provides an interface to enable mocking the Payment Cryptography Data Plane service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package paymentcryptographydataiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata" -) - -// PaymentCryptographyDataAPI provides an interface to enable mocking the -// paymentcryptographydata.PaymentCryptographyData service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Payment Cryptography Data Plane. -// func myFunc(svc paymentcryptographydataiface.PaymentCryptographyDataAPI) bool { -// // Make svc.DecryptData request -// } -// -// func main() { -// sess := session.New() -// svc := paymentcryptographydata.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockPaymentCryptographyDataClient struct { -// paymentcryptographydataiface.PaymentCryptographyDataAPI -// } -// func (m *mockPaymentCryptographyDataClient) DecryptData(input *paymentcryptographydata.DecryptDataInput) (*paymentcryptographydata.DecryptDataOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockPaymentCryptographyDataClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type PaymentCryptographyDataAPI interface { - DecryptData(*paymentcryptographydata.DecryptDataInput) (*paymentcryptographydata.DecryptDataOutput, error) - DecryptDataWithContext(aws.Context, *paymentcryptographydata.DecryptDataInput, ...request.Option) (*paymentcryptographydata.DecryptDataOutput, error) - DecryptDataRequest(*paymentcryptographydata.DecryptDataInput) (*request.Request, *paymentcryptographydata.DecryptDataOutput) - - EncryptData(*paymentcryptographydata.EncryptDataInput) (*paymentcryptographydata.EncryptDataOutput, error) - EncryptDataWithContext(aws.Context, *paymentcryptographydata.EncryptDataInput, ...request.Option) (*paymentcryptographydata.EncryptDataOutput, error) - EncryptDataRequest(*paymentcryptographydata.EncryptDataInput) (*request.Request, *paymentcryptographydata.EncryptDataOutput) - - GenerateCardValidationData(*paymentcryptographydata.GenerateCardValidationDataInput) (*paymentcryptographydata.GenerateCardValidationDataOutput, error) - GenerateCardValidationDataWithContext(aws.Context, *paymentcryptographydata.GenerateCardValidationDataInput, ...request.Option) (*paymentcryptographydata.GenerateCardValidationDataOutput, error) - GenerateCardValidationDataRequest(*paymentcryptographydata.GenerateCardValidationDataInput) (*request.Request, *paymentcryptographydata.GenerateCardValidationDataOutput) - - GenerateMac(*paymentcryptographydata.GenerateMacInput) (*paymentcryptographydata.GenerateMacOutput, error) - GenerateMacWithContext(aws.Context, *paymentcryptographydata.GenerateMacInput, ...request.Option) (*paymentcryptographydata.GenerateMacOutput, error) - GenerateMacRequest(*paymentcryptographydata.GenerateMacInput) (*request.Request, *paymentcryptographydata.GenerateMacOutput) - - GeneratePinData(*paymentcryptographydata.GeneratePinDataInput) (*paymentcryptographydata.GeneratePinDataOutput, error) - GeneratePinDataWithContext(aws.Context, *paymentcryptographydata.GeneratePinDataInput, ...request.Option) (*paymentcryptographydata.GeneratePinDataOutput, error) - GeneratePinDataRequest(*paymentcryptographydata.GeneratePinDataInput) (*request.Request, *paymentcryptographydata.GeneratePinDataOutput) - - ReEncryptData(*paymentcryptographydata.ReEncryptDataInput) (*paymentcryptographydata.ReEncryptDataOutput, error) - ReEncryptDataWithContext(aws.Context, *paymentcryptographydata.ReEncryptDataInput, ...request.Option) (*paymentcryptographydata.ReEncryptDataOutput, error) - ReEncryptDataRequest(*paymentcryptographydata.ReEncryptDataInput) (*request.Request, *paymentcryptographydata.ReEncryptDataOutput) - - TranslatePinData(*paymentcryptographydata.TranslatePinDataInput) (*paymentcryptographydata.TranslatePinDataOutput, error) - TranslatePinDataWithContext(aws.Context, *paymentcryptographydata.TranslatePinDataInput, ...request.Option) (*paymentcryptographydata.TranslatePinDataOutput, error) - TranslatePinDataRequest(*paymentcryptographydata.TranslatePinDataInput) (*request.Request, *paymentcryptographydata.TranslatePinDataOutput) - - VerifyAuthRequestCryptogram(*paymentcryptographydata.VerifyAuthRequestCryptogramInput) (*paymentcryptographydata.VerifyAuthRequestCryptogramOutput, error) - VerifyAuthRequestCryptogramWithContext(aws.Context, *paymentcryptographydata.VerifyAuthRequestCryptogramInput, ...request.Option) (*paymentcryptographydata.VerifyAuthRequestCryptogramOutput, error) - VerifyAuthRequestCryptogramRequest(*paymentcryptographydata.VerifyAuthRequestCryptogramInput) (*request.Request, *paymentcryptographydata.VerifyAuthRequestCryptogramOutput) - - VerifyCardValidationData(*paymentcryptographydata.VerifyCardValidationDataInput) (*paymentcryptographydata.VerifyCardValidationDataOutput, error) - VerifyCardValidationDataWithContext(aws.Context, *paymentcryptographydata.VerifyCardValidationDataInput, ...request.Option) (*paymentcryptographydata.VerifyCardValidationDataOutput, error) - VerifyCardValidationDataRequest(*paymentcryptographydata.VerifyCardValidationDataInput) (*request.Request, *paymentcryptographydata.VerifyCardValidationDataOutput) - - VerifyMac(*paymentcryptographydata.VerifyMacInput) (*paymentcryptographydata.VerifyMacOutput, error) - VerifyMacWithContext(aws.Context, *paymentcryptographydata.VerifyMacInput, ...request.Option) (*paymentcryptographydata.VerifyMacOutput, error) - VerifyMacRequest(*paymentcryptographydata.VerifyMacInput) (*request.Request, *paymentcryptographydata.VerifyMacOutput) - - VerifyPinData(*paymentcryptographydata.VerifyPinDataInput) (*paymentcryptographydata.VerifyPinDataOutput, error) - VerifyPinDataWithContext(aws.Context, *paymentcryptographydata.VerifyPinDataInput, ...request.Option) (*paymentcryptographydata.VerifyPinDataOutput, error) - VerifyPinDataRequest(*paymentcryptographydata.VerifyPinDataInput) (*request.Request, *paymentcryptographydata.VerifyPinDataOutput) -} - -var _ PaymentCryptographyDataAPI = (*paymentcryptographydata.PaymentCryptographyData)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/service.go deleted file mode 100644 index e967a208737a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/paymentcryptographydata/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package paymentcryptographydata - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// PaymentCryptographyData provides the API operation methods for making requests to -// Payment Cryptography Data Plane. See this package's package overview docs -// for details on the service. -// -// PaymentCryptographyData methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type PaymentCryptographyData struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Payment Cryptography Data" // Name of service. - EndpointsID = "dataplane.payment-cryptography" // ID to lookup a service endpoint with. - ServiceID = "Payment Cryptography Data" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the PaymentCryptographyData client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a PaymentCryptographyData client from just a session. -// svc := paymentcryptographydata.New(mySession) -// -// // Create a PaymentCryptographyData client with additional configuration -// svc := paymentcryptographydata.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *PaymentCryptographyData { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "payment-cryptography" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *PaymentCryptographyData { - svc := &PaymentCryptographyData{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-02-03", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a PaymentCryptographyData operation and runs any -// custom request initialization. -func (c *PaymentCryptographyData) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/api.go deleted file mode 100644 index a68d4126f40a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/api.go +++ /dev/null @@ -1,10202 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package pcaconnectorad - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateConnector = "CreateConnector" - -// CreateConnectorRequest generates a "aws/request.Request" representing the -// client's request for the CreateConnector 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 CreateConnector for more information on using the CreateConnector -// 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 CreateConnectorRequest method. -// req, resp := client.CreateConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateConnector -func (c *PcaConnectorAd) CreateConnectorRequest(input *CreateConnectorInput) (req *request.Request, output *CreateConnectorOutput) { - op := &request.Operation{ - Name: opCreateConnector, - HTTPMethod: "POST", - HTTPPath: "/connectors", - } - - if input == nil { - input = &CreateConnectorInput{} - } - - output = &CreateConnectorOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateConnector API operation for PcaConnectorAd. -// -// Creates a connector between Amazon Web Services Private CA and an Active -// Directory. You must specify the private CA, directory ID, and security groups. -// -// 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 PcaConnectorAd's -// API operation CreateConnector for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ServiceQuotaExceededException -// Request would cause a service quota to be exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateConnector -func (c *PcaConnectorAd) CreateConnector(input *CreateConnectorInput) (*CreateConnectorOutput, error) { - req, out := c.CreateConnectorRequest(input) - return out, req.Send() -} - -// CreateConnectorWithContext is the same as CreateConnector with the addition of -// the ability to pass a context and additional request options. -// -// See CreateConnector 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 *PcaConnectorAd) CreateConnectorWithContext(ctx aws.Context, input *CreateConnectorInput, opts ...request.Option) (*CreateConnectorOutput, error) { - req, out := c.CreateConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDirectoryRegistration = "CreateDirectoryRegistration" - -// CreateDirectoryRegistrationRequest generates a "aws/request.Request" representing the -// client's request for the CreateDirectoryRegistration 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 CreateDirectoryRegistration for more information on using the CreateDirectoryRegistration -// 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 CreateDirectoryRegistrationRequest method. -// req, resp := client.CreateDirectoryRegistrationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateDirectoryRegistration -func (c *PcaConnectorAd) CreateDirectoryRegistrationRequest(input *CreateDirectoryRegistrationInput) (req *request.Request, output *CreateDirectoryRegistrationOutput) { - op := &request.Operation{ - Name: opCreateDirectoryRegistration, - HTTPMethod: "POST", - HTTPPath: "/directoryRegistrations", - } - - if input == nil { - input = &CreateDirectoryRegistrationInput{} - } - - output = &CreateDirectoryRegistrationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDirectoryRegistration API operation for PcaConnectorAd. -// -// Creates a directory registration that authorizes communication between Amazon -// Web Services Private CA and an Active Directory -// -// 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 PcaConnectorAd's -// API operation CreateDirectoryRegistration for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateDirectoryRegistration -func (c *PcaConnectorAd) CreateDirectoryRegistration(input *CreateDirectoryRegistrationInput) (*CreateDirectoryRegistrationOutput, error) { - req, out := c.CreateDirectoryRegistrationRequest(input) - return out, req.Send() -} - -// CreateDirectoryRegistrationWithContext is the same as CreateDirectoryRegistration with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDirectoryRegistration 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 *PcaConnectorAd) CreateDirectoryRegistrationWithContext(ctx aws.Context, input *CreateDirectoryRegistrationInput, opts ...request.Option) (*CreateDirectoryRegistrationOutput, error) { - req, out := c.CreateDirectoryRegistrationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateServicePrincipalName = "CreateServicePrincipalName" - -// CreateServicePrincipalNameRequest generates a "aws/request.Request" representing the -// client's request for the CreateServicePrincipalName 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 CreateServicePrincipalName for more information on using the CreateServicePrincipalName -// 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 CreateServicePrincipalNameRequest method. -// req, resp := client.CreateServicePrincipalNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateServicePrincipalName -func (c *PcaConnectorAd) CreateServicePrincipalNameRequest(input *CreateServicePrincipalNameInput) (req *request.Request, output *CreateServicePrincipalNameOutput) { - op := &request.Operation{ - Name: opCreateServicePrincipalName, - HTTPMethod: "POST", - HTTPPath: "/directoryRegistrations/{DirectoryRegistrationArn}/servicePrincipalNames/{ConnectorArn}", - } - - if input == nil { - input = &CreateServicePrincipalNameInput{} - } - - output = &CreateServicePrincipalNameOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateServicePrincipalName API operation for PcaConnectorAd. -// -// Creates a service principal name (SPN) for the service account in Active -// Directory. Kerberos authentication uses SPNs to associate a service instance -// with a service sign-in account. -// -// 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 PcaConnectorAd's -// API operation CreateServicePrincipalName for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateServicePrincipalName -func (c *PcaConnectorAd) CreateServicePrincipalName(input *CreateServicePrincipalNameInput) (*CreateServicePrincipalNameOutput, error) { - req, out := c.CreateServicePrincipalNameRequest(input) - return out, req.Send() -} - -// CreateServicePrincipalNameWithContext is the same as CreateServicePrincipalName with the addition of -// the ability to pass a context and additional request options. -// -// See CreateServicePrincipalName 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 *PcaConnectorAd) CreateServicePrincipalNameWithContext(ctx aws.Context, input *CreateServicePrincipalNameInput, opts ...request.Option) (*CreateServicePrincipalNameOutput, error) { - req, out := c.CreateServicePrincipalNameRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTemplate = "CreateTemplate" - -// CreateTemplateRequest generates a "aws/request.Request" representing the -// client's request for the CreateTemplate 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 CreateTemplate for more information on using the CreateTemplate -// 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 CreateTemplateRequest method. -// req, resp := client.CreateTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateTemplate -func (c *PcaConnectorAd) CreateTemplateRequest(input *CreateTemplateInput) (req *request.Request, output *CreateTemplateOutput) { - op := &request.Operation{ - Name: opCreateTemplate, - HTTPMethod: "POST", - HTTPPath: "/templates", - } - - if input == nil { - input = &CreateTemplateInput{} - } - - output = &CreateTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTemplate API operation for PcaConnectorAd. -// -// Creates an Active Directory compatible certificate template. The connectors -// issues certificates using these templates based on the requester’s Active -// Directory group membership. -// -// 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 PcaConnectorAd's -// API operation CreateTemplate for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ServiceQuotaExceededException -// Request would cause a service quota to be exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateTemplate -func (c *PcaConnectorAd) CreateTemplate(input *CreateTemplateInput) (*CreateTemplateOutput, error) { - req, out := c.CreateTemplateRequest(input) - return out, req.Send() -} - -// CreateTemplateWithContext is the same as CreateTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTemplate 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 *PcaConnectorAd) CreateTemplateWithContext(ctx aws.Context, input *CreateTemplateInput, opts ...request.Option) (*CreateTemplateOutput, error) { - req, out := c.CreateTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTemplateGroupAccessControlEntry = "CreateTemplateGroupAccessControlEntry" - -// CreateTemplateGroupAccessControlEntryRequest generates a "aws/request.Request" representing the -// client's request for the CreateTemplateGroupAccessControlEntry 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 CreateTemplateGroupAccessControlEntry for more information on using the CreateTemplateGroupAccessControlEntry -// 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 CreateTemplateGroupAccessControlEntryRequest method. -// req, resp := client.CreateTemplateGroupAccessControlEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateTemplateGroupAccessControlEntry -func (c *PcaConnectorAd) CreateTemplateGroupAccessControlEntryRequest(input *CreateTemplateGroupAccessControlEntryInput) (req *request.Request, output *CreateTemplateGroupAccessControlEntryOutput) { - op := &request.Operation{ - Name: opCreateTemplateGroupAccessControlEntry, - HTTPMethod: "POST", - HTTPPath: "/templates/{TemplateArn}/accessControlEntries", - } - - if input == nil { - input = &CreateTemplateGroupAccessControlEntryInput{} - } - - output = &CreateTemplateGroupAccessControlEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateTemplateGroupAccessControlEntry API operation for PcaConnectorAd. -// -// Create a group access control entry. Allow or deny Active Directory groups -// from enrolling and/or autoenrolling with the template based on the group -// security identifiers (SIDs). -// -// 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 PcaConnectorAd's -// API operation CreateTemplateGroupAccessControlEntry for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ServiceQuotaExceededException -// Request would cause a service quota to be exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/CreateTemplateGroupAccessControlEntry -func (c *PcaConnectorAd) CreateTemplateGroupAccessControlEntry(input *CreateTemplateGroupAccessControlEntryInput) (*CreateTemplateGroupAccessControlEntryOutput, error) { - req, out := c.CreateTemplateGroupAccessControlEntryRequest(input) - return out, req.Send() -} - -// CreateTemplateGroupAccessControlEntryWithContext is the same as CreateTemplateGroupAccessControlEntry with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTemplateGroupAccessControlEntry 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 *PcaConnectorAd) CreateTemplateGroupAccessControlEntryWithContext(ctx aws.Context, input *CreateTemplateGroupAccessControlEntryInput, opts ...request.Option) (*CreateTemplateGroupAccessControlEntryOutput, error) { - req, out := c.CreateTemplateGroupAccessControlEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteConnector = "DeleteConnector" - -// DeleteConnectorRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConnector 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 DeleteConnector for more information on using the DeleteConnector -// 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 DeleteConnectorRequest method. -// req, resp := client.DeleteConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteConnector -func (c *PcaConnectorAd) DeleteConnectorRequest(input *DeleteConnectorInput) (req *request.Request, output *DeleteConnectorOutput) { - op := &request.Operation{ - Name: opDeleteConnector, - HTTPMethod: "DELETE", - HTTPPath: "/connectors/{ConnectorArn}", - } - - if input == nil { - input = &DeleteConnectorInput{} - } - - output = &DeleteConnectorOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConnector API operation for PcaConnectorAd. -// -// Deletes a connector for Active Directory. You must provide the Amazon Resource -// Name (ARN) of the connector that you want to delete. You can find the ARN -// by calling the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_ListConnectors -// (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_ListConnectors) -// action. Deleting a connector does not deregister your directory with Amazon -// Web Services Private CA. You can deregister your directory by calling the -// https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_DeleteDirectoryRegistration -// (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_DeleteDirectoryRegistration) -// action. -// -// 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 PcaConnectorAd's -// API operation DeleteConnector for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteConnector -func (c *PcaConnectorAd) DeleteConnector(input *DeleteConnectorInput) (*DeleteConnectorOutput, error) { - req, out := c.DeleteConnectorRequest(input) - return out, req.Send() -} - -// DeleteConnectorWithContext is the same as DeleteConnector with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteConnector 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 *PcaConnectorAd) DeleteConnectorWithContext(ctx aws.Context, input *DeleteConnectorInput, opts ...request.Option) (*DeleteConnectorOutput, error) { - req, out := c.DeleteConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDirectoryRegistration = "DeleteDirectoryRegistration" - -// DeleteDirectoryRegistrationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDirectoryRegistration 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 DeleteDirectoryRegistration for more information on using the DeleteDirectoryRegistration -// 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 DeleteDirectoryRegistrationRequest method. -// req, resp := client.DeleteDirectoryRegistrationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteDirectoryRegistration -func (c *PcaConnectorAd) DeleteDirectoryRegistrationRequest(input *DeleteDirectoryRegistrationInput) (req *request.Request, output *DeleteDirectoryRegistrationOutput) { - op := &request.Operation{ - Name: opDeleteDirectoryRegistration, - HTTPMethod: "DELETE", - HTTPPath: "/directoryRegistrations/{DirectoryRegistrationArn}", - } - - if input == nil { - input = &DeleteDirectoryRegistrationInput{} - } - - output = &DeleteDirectoryRegistrationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDirectoryRegistration API operation for PcaConnectorAd. -// -// Deletes a directory registration. Deleting a directory registration deauthorizes -// Amazon Web Services Private CA with the directory. -// -// 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 PcaConnectorAd's -// API operation DeleteDirectoryRegistration for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteDirectoryRegistration -func (c *PcaConnectorAd) DeleteDirectoryRegistration(input *DeleteDirectoryRegistrationInput) (*DeleteDirectoryRegistrationOutput, error) { - req, out := c.DeleteDirectoryRegistrationRequest(input) - return out, req.Send() -} - -// DeleteDirectoryRegistrationWithContext is the same as DeleteDirectoryRegistration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDirectoryRegistration 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 *PcaConnectorAd) DeleteDirectoryRegistrationWithContext(ctx aws.Context, input *DeleteDirectoryRegistrationInput, opts ...request.Option) (*DeleteDirectoryRegistrationOutput, error) { - req, out := c.DeleteDirectoryRegistrationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteServicePrincipalName = "DeleteServicePrincipalName" - -// DeleteServicePrincipalNameRequest generates a "aws/request.Request" representing the -// client's request for the DeleteServicePrincipalName 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 DeleteServicePrincipalName for more information on using the DeleteServicePrincipalName -// 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 DeleteServicePrincipalNameRequest method. -// req, resp := client.DeleteServicePrincipalNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteServicePrincipalName -func (c *PcaConnectorAd) DeleteServicePrincipalNameRequest(input *DeleteServicePrincipalNameInput) (req *request.Request, output *DeleteServicePrincipalNameOutput) { - op := &request.Operation{ - Name: opDeleteServicePrincipalName, - HTTPMethod: "DELETE", - HTTPPath: "/directoryRegistrations/{DirectoryRegistrationArn}/servicePrincipalNames/{ConnectorArn}", - } - - if input == nil { - input = &DeleteServicePrincipalNameInput{} - } - - output = &DeleteServicePrincipalNameOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteServicePrincipalName API operation for PcaConnectorAd. -// -// Deletes the service principal name (SPN) used by a connector to authenticate -// with your Active Directory. -// -// 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 PcaConnectorAd's -// API operation DeleteServicePrincipalName for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteServicePrincipalName -func (c *PcaConnectorAd) DeleteServicePrincipalName(input *DeleteServicePrincipalNameInput) (*DeleteServicePrincipalNameOutput, error) { - req, out := c.DeleteServicePrincipalNameRequest(input) - return out, req.Send() -} - -// DeleteServicePrincipalNameWithContext is the same as DeleteServicePrincipalName with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteServicePrincipalName 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 *PcaConnectorAd) DeleteServicePrincipalNameWithContext(ctx aws.Context, input *DeleteServicePrincipalNameInput, opts ...request.Option) (*DeleteServicePrincipalNameOutput, error) { - req, out := c.DeleteServicePrincipalNameRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTemplate = "DeleteTemplate" - -// DeleteTemplateRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTemplate 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 DeleteTemplate for more information on using the DeleteTemplate -// 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 DeleteTemplateRequest method. -// req, resp := client.DeleteTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteTemplate -func (c *PcaConnectorAd) DeleteTemplateRequest(input *DeleteTemplateInput) (req *request.Request, output *DeleteTemplateOutput) { - op := &request.Operation{ - Name: opDeleteTemplate, - HTTPMethod: "DELETE", - HTTPPath: "/templates/{TemplateArn}", - } - - if input == nil { - input = &DeleteTemplateInput{} - } - - output = &DeleteTemplateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTemplate API operation for PcaConnectorAd. -// -// Deletes a template. Certificates issued using the template are still valid -// until they are revoked or expired. -// -// 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 PcaConnectorAd's -// API operation DeleteTemplate for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteTemplate -func (c *PcaConnectorAd) DeleteTemplate(input *DeleteTemplateInput) (*DeleteTemplateOutput, error) { - req, out := c.DeleteTemplateRequest(input) - return out, req.Send() -} - -// DeleteTemplateWithContext is the same as DeleteTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTemplate 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 *PcaConnectorAd) DeleteTemplateWithContext(ctx aws.Context, input *DeleteTemplateInput, opts ...request.Option) (*DeleteTemplateOutput, error) { - req, out := c.DeleteTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTemplateGroupAccessControlEntry = "DeleteTemplateGroupAccessControlEntry" - -// DeleteTemplateGroupAccessControlEntryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTemplateGroupAccessControlEntry 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 DeleteTemplateGroupAccessControlEntry for more information on using the DeleteTemplateGroupAccessControlEntry -// 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 DeleteTemplateGroupAccessControlEntryRequest method. -// req, resp := client.DeleteTemplateGroupAccessControlEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteTemplateGroupAccessControlEntry -func (c *PcaConnectorAd) DeleteTemplateGroupAccessControlEntryRequest(input *DeleteTemplateGroupAccessControlEntryInput) (req *request.Request, output *DeleteTemplateGroupAccessControlEntryOutput) { - op := &request.Operation{ - Name: opDeleteTemplateGroupAccessControlEntry, - HTTPMethod: "DELETE", - HTTPPath: "/templates/{TemplateArn}/accessControlEntries/{GroupSecurityIdentifier}", - } - - if input == nil { - input = &DeleteTemplateGroupAccessControlEntryInput{} - } - - output = &DeleteTemplateGroupAccessControlEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTemplateGroupAccessControlEntry API operation for PcaConnectorAd. -// -// Deletes a group access control entry. -// -// 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 PcaConnectorAd's -// API operation DeleteTemplateGroupAccessControlEntry for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/DeleteTemplateGroupAccessControlEntry -func (c *PcaConnectorAd) DeleteTemplateGroupAccessControlEntry(input *DeleteTemplateGroupAccessControlEntryInput) (*DeleteTemplateGroupAccessControlEntryOutput, error) { - req, out := c.DeleteTemplateGroupAccessControlEntryRequest(input) - return out, req.Send() -} - -// DeleteTemplateGroupAccessControlEntryWithContext is the same as DeleteTemplateGroupAccessControlEntry with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTemplateGroupAccessControlEntry 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 *PcaConnectorAd) DeleteTemplateGroupAccessControlEntryWithContext(ctx aws.Context, input *DeleteTemplateGroupAccessControlEntryInput, opts ...request.Option) (*DeleteTemplateGroupAccessControlEntryOutput, error) { - req, out := c.DeleteTemplateGroupAccessControlEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetConnector = "GetConnector" - -// GetConnectorRequest generates a "aws/request.Request" representing the -// client's request for the GetConnector 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 GetConnector for more information on using the GetConnector -// 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 GetConnectorRequest method. -// req, resp := client.GetConnectorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetConnector -func (c *PcaConnectorAd) GetConnectorRequest(input *GetConnectorInput) (req *request.Request, output *GetConnectorOutput) { - op := &request.Operation{ - Name: opGetConnector, - HTTPMethod: "GET", - HTTPPath: "/connectors/{ConnectorArn}", - } - - if input == nil { - input = &GetConnectorInput{} - } - - output = &GetConnectorOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetConnector API operation for PcaConnectorAd. -// -// Lists information about your connector. You specify the connector on input -// by its ARN (Amazon Resource Name). -// -// 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 PcaConnectorAd's -// API operation GetConnector for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetConnector -func (c *PcaConnectorAd) GetConnector(input *GetConnectorInput) (*GetConnectorOutput, error) { - req, out := c.GetConnectorRequest(input) - return out, req.Send() -} - -// GetConnectorWithContext is the same as GetConnector with the addition of -// the ability to pass a context and additional request options. -// -// See GetConnector 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 *PcaConnectorAd) GetConnectorWithContext(ctx aws.Context, input *GetConnectorInput, opts ...request.Option) (*GetConnectorOutput, error) { - req, out := c.GetConnectorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDirectoryRegistration = "GetDirectoryRegistration" - -// GetDirectoryRegistrationRequest generates a "aws/request.Request" representing the -// client's request for the GetDirectoryRegistration 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 GetDirectoryRegistration for more information on using the GetDirectoryRegistration -// 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 GetDirectoryRegistrationRequest method. -// req, resp := client.GetDirectoryRegistrationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetDirectoryRegistration -func (c *PcaConnectorAd) GetDirectoryRegistrationRequest(input *GetDirectoryRegistrationInput) (req *request.Request, output *GetDirectoryRegistrationOutput) { - op := &request.Operation{ - Name: opGetDirectoryRegistration, - HTTPMethod: "GET", - HTTPPath: "/directoryRegistrations/{DirectoryRegistrationArn}", - } - - if input == nil { - input = &GetDirectoryRegistrationInput{} - } - - output = &GetDirectoryRegistrationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDirectoryRegistration API operation for PcaConnectorAd. -// -// A structure that contains information about your directory registration. -// -// 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 PcaConnectorAd's -// API operation GetDirectoryRegistration for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetDirectoryRegistration -func (c *PcaConnectorAd) GetDirectoryRegistration(input *GetDirectoryRegistrationInput) (*GetDirectoryRegistrationOutput, error) { - req, out := c.GetDirectoryRegistrationRequest(input) - return out, req.Send() -} - -// GetDirectoryRegistrationWithContext is the same as GetDirectoryRegistration with the addition of -// the ability to pass a context and additional request options. -// -// See GetDirectoryRegistration 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 *PcaConnectorAd) GetDirectoryRegistrationWithContext(ctx aws.Context, input *GetDirectoryRegistrationInput, opts ...request.Option) (*GetDirectoryRegistrationOutput, error) { - req, out := c.GetDirectoryRegistrationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetServicePrincipalName = "GetServicePrincipalName" - -// GetServicePrincipalNameRequest generates a "aws/request.Request" representing the -// client's request for the GetServicePrincipalName 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 GetServicePrincipalName for more information on using the GetServicePrincipalName -// 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 GetServicePrincipalNameRequest method. -// req, resp := client.GetServicePrincipalNameRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetServicePrincipalName -func (c *PcaConnectorAd) GetServicePrincipalNameRequest(input *GetServicePrincipalNameInput) (req *request.Request, output *GetServicePrincipalNameOutput) { - op := &request.Operation{ - Name: opGetServicePrincipalName, - HTTPMethod: "GET", - HTTPPath: "/directoryRegistrations/{DirectoryRegistrationArn}/servicePrincipalNames/{ConnectorArn}", - } - - if input == nil { - input = &GetServicePrincipalNameInput{} - } - - output = &GetServicePrincipalNameOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetServicePrincipalName API operation for PcaConnectorAd. -// -// Lists the service principal name that the connector uses to authenticate -// with Active Directory. -// -// 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 PcaConnectorAd's -// API operation GetServicePrincipalName for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetServicePrincipalName -func (c *PcaConnectorAd) GetServicePrincipalName(input *GetServicePrincipalNameInput) (*GetServicePrincipalNameOutput, error) { - req, out := c.GetServicePrincipalNameRequest(input) - return out, req.Send() -} - -// GetServicePrincipalNameWithContext is the same as GetServicePrincipalName with the addition of -// the ability to pass a context and additional request options. -// -// See GetServicePrincipalName 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 *PcaConnectorAd) GetServicePrincipalNameWithContext(ctx aws.Context, input *GetServicePrincipalNameInput, opts ...request.Option) (*GetServicePrincipalNameOutput, error) { - req, out := c.GetServicePrincipalNameRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTemplate = "GetTemplate" - -// GetTemplateRequest generates a "aws/request.Request" representing the -// client's request for the GetTemplate 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 GetTemplate for more information on using the GetTemplate -// 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 GetTemplateRequest method. -// req, resp := client.GetTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetTemplate -func (c *PcaConnectorAd) GetTemplateRequest(input *GetTemplateInput) (req *request.Request, output *GetTemplateOutput) { - op := &request.Operation{ - Name: opGetTemplate, - HTTPMethod: "GET", - HTTPPath: "/templates/{TemplateArn}", - } - - if input == nil { - input = &GetTemplateInput{} - } - - output = &GetTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTemplate API operation for PcaConnectorAd. -// -// Retrieves a certificate template that the connector uses to issue certificates -// from a private CA. -// -// 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 PcaConnectorAd's -// API operation GetTemplate for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetTemplate -func (c *PcaConnectorAd) GetTemplate(input *GetTemplateInput) (*GetTemplateOutput, error) { - req, out := c.GetTemplateRequest(input) - return out, req.Send() -} - -// GetTemplateWithContext is the same as GetTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See GetTemplate 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 *PcaConnectorAd) GetTemplateWithContext(ctx aws.Context, input *GetTemplateInput, opts ...request.Option) (*GetTemplateOutput, error) { - req, out := c.GetTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTemplateGroupAccessControlEntry = "GetTemplateGroupAccessControlEntry" - -// GetTemplateGroupAccessControlEntryRequest generates a "aws/request.Request" representing the -// client's request for the GetTemplateGroupAccessControlEntry 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 GetTemplateGroupAccessControlEntry for more information on using the GetTemplateGroupAccessControlEntry -// 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 GetTemplateGroupAccessControlEntryRequest method. -// req, resp := client.GetTemplateGroupAccessControlEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetTemplateGroupAccessControlEntry -func (c *PcaConnectorAd) GetTemplateGroupAccessControlEntryRequest(input *GetTemplateGroupAccessControlEntryInput) (req *request.Request, output *GetTemplateGroupAccessControlEntryOutput) { - op := &request.Operation{ - Name: opGetTemplateGroupAccessControlEntry, - HTTPMethod: "GET", - HTTPPath: "/templates/{TemplateArn}/accessControlEntries/{GroupSecurityIdentifier}", - } - - if input == nil { - input = &GetTemplateGroupAccessControlEntryInput{} - } - - output = &GetTemplateGroupAccessControlEntryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTemplateGroupAccessControlEntry API operation for PcaConnectorAd. -// -// Retrieves the group access control entries for a template. -// -// 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 PcaConnectorAd's -// API operation GetTemplateGroupAccessControlEntry for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/GetTemplateGroupAccessControlEntry -func (c *PcaConnectorAd) GetTemplateGroupAccessControlEntry(input *GetTemplateGroupAccessControlEntryInput) (*GetTemplateGroupAccessControlEntryOutput, error) { - req, out := c.GetTemplateGroupAccessControlEntryRequest(input) - return out, req.Send() -} - -// GetTemplateGroupAccessControlEntryWithContext is the same as GetTemplateGroupAccessControlEntry with the addition of -// the ability to pass a context and additional request options. -// -// See GetTemplateGroupAccessControlEntry 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 *PcaConnectorAd) GetTemplateGroupAccessControlEntryWithContext(ctx aws.Context, input *GetTemplateGroupAccessControlEntryInput, opts ...request.Option) (*GetTemplateGroupAccessControlEntryOutput, error) { - req, out := c.GetTemplateGroupAccessControlEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListConnectors = "ListConnectors" - -// ListConnectorsRequest generates a "aws/request.Request" representing the -// client's request for the ListConnectors 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 ListConnectors for more information on using the ListConnectors -// 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 ListConnectorsRequest method. -// req, resp := client.ListConnectorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListConnectors -func (c *PcaConnectorAd) ListConnectorsRequest(input *ListConnectorsInput) (req *request.Request, output *ListConnectorsOutput) { - op := &request.Operation{ - Name: opListConnectors, - HTTPMethod: "GET", - HTTPPath: "/connectors", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListConnectorsInput{} - } - - output = &ListConnectorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListConnectors API operation for PcaConnectorAd. -// -// Lists the connectors that you created by using the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector -// (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector) -// action. -// -// 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 PcaConnectorAd's -// API operation ListConnectors for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListConnectors -func (c *PcaConnectorAd) ListConnectors(input *ListConnectorsInput) (*ListConnectorsOutput, error) { - req, out := c.ListConnectorsRequest(input) - return out, req.Send() -} - -// ListConnectorsWithContext is the same as ListConnectors with the addition of -// the ability to pass a context and additional request options. -// -// See ListConnectors 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 *PcaConnectorAd) ListConnectorsWithContext(ctx aws.Context, input *ListConnectorsInput, opts ...request.Option) (*ListConnectorsOutput, error) { - req, out := c.ListConnectorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListConnectorsPages iterates over the pages of a ListConnectors operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListConnectors method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListConnectors operation. -// pageNum := 0 -// err := client.ListConnectorsPages(params, -// func(page *pcaconnectorad.ListConnectorsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PcaConnectorAd) ListConnectorsPages(input *ListConnectorsInput, fn func(*ListConnectorsOutput, bool) bool) error { - return c.ListConnectorsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListConnectorsPagesWithContext same as ListConnectorsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PcaConnectorAd) ListConnectorsPagesWithContext(ctx aws.Context, input *ListConnectorsInput, fn func(*ListConnectorsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListConnectorsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListConnectorsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListConnectorsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDirectoryRegistrations = "ListDirectoryRegistrations" - -// ListDirectoryRegistrationsRequest generates a "aws/request.Request" representing the -// client's request for the ListDirectoryRegistrations 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 ListDirectoryRegistrations for more information on using the ListDirectoryRegistrations -// 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 ListDirectoryRegistrationsRequest method. -// req, resp := client.ListDirectoryRegistrationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListDirectoryRegistrations -func (c *PcaConnectorAd) ListDirectoryRegistrationsRequest(input *ListDirectoryRegistrationsInput) (req *request.Request, output *ListDirectoryRegistrationsOutput) { - op := &request.Operation{ - Name: opListDirectoryRegistrations, - HTTPMethod: "GET", - HTTPPath: "/directoryRegistrations", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDirectoryRegistrationsInput{} - } - - output = &ListDirectoryRegistrationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDirectoryRegistrations API operation for PcaConnectorAd. -// -// Lists the directory registrations that you created by using the https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration -// (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration) -// action. -// -// 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 PcaConnectorAd's -// API operation ListDirectoryRegistrations for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListDirectoryRegistrations -func (c *PcaConnectorAd) ListDirectoryRegistrations(input *ListDirectoryRegistrationsInput) (*ListDirectoryRegistrationsOutput, error) { - req, out := c.ListDirectoryRegistrationsRequest(input) - return out, req.Send() -} - -// ListDirectoryRegistrationsWithContext is the same as ListDirectoryRegistrations with the addition of -// the ability to pass a context and additional request options. -// -// See ListDirectoryRegistrations 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 *PcaConnectorAd) ListDirectoryRegistrationsWithContext(ctx aws.Context, input *ListDirectoryRegistrationsInput, opts ...request.Option) (*ListDirectoryRegistrationsOutput, error) { - req, out := c.ListDirectoryRegistrationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDirectoryRegistrationsPages iterates over the pages of a ListDirectoryRegistrations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDirectoryRegistrations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDirectoryRegistrations operation. -// pageNum := 0 -// err := client.ListDirectoryRegistrationsPages(params, -// func(page *pcaconnectorad.ListDirectoryRegistrationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PcaConnectorAd) ListDirectoryRegistrationsPages(input *ListDirectoryRegistrationsInput, fn func(*ListDirectoryRegistrationsOutput, bool) bool) error { - return c.ListDirectoryRegistrationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDirectoryRegistrationsPagesWithContext same as ListDirectoryRegistrationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PcaConnectorAd) ListDirectoryRegistrationsPagesWithContext(ctx aws.Context, input *ListDirectoryRegistrationsInput, fn func(*ListDirectoryRegistrationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDirectoryRegistrationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDirectoryRegistrationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDirectoryRegistrationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListServicePrincipalNames = "ListServicePrincipalNames" - -// ListServicePrincipalNamesRequest generates a "aws/request.Request" representing the -// client's request for the ListServicePrincipalNames 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 ListServicePrincipalNames for more information on using the ListServicePrincipalNames -// 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 ListServicePrincipalNamesRequest method. -// req, resp := client.ListServicePrincipalNamesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListServicePrincipalNames -func (c *PcaConnectorAd) ListServicePrincipalNamesRequest(input *ListServicePrincipalNamesInput) (req *request.Request, output *ListServicePrincipalNamesOutput) { - op := &request.Operation{ - Name: opListServicePrincipalNames, - HTTPMethod: "GET", - HTTPPath: "/directoryRegistrations/{DirectoryRegistrationArn}/servicePrincipalNames", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListServicePrincipalNamesInput{} - } - - output = &ListServicePrincipalNamesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServicePrincipalNames API operation for PcaConnectorAd. -// -// Lists the service principal names that the connector uses to authenticate -// with Active Directory. -// -// 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 PcaConnectorAd's -// API operation ListServicePrincipalNames for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListServicePrincipalNames -func (c *PcaConnectorAd) ListServicePrincipalNames(input *ListServicePrincipalNamesInput) (*ListServicePrincipalNamesOutput, error) { - req, out := c.ListServicePrincipalNamesRequest(input) - return out, req.Send() -} - -// ListServicePrincipalNamesWithContext is the same as ListServicePrincipalNames with the addition of -// the ability to pass a context and additional request options. -// -// See ListServicePrincipalNames 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 *PcaConnectorAd) ListServicePrincipalNamesWithContext(ctx aws.Context, input *ListServicePrincipalNamesInput, opts ...request.Option) (*ListServicePrincipalNamesOutput, error) { - req, out := c.ListServicePrincipalNamesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListServicePrincipalNamesPages iterates over the pages of a ListServicePrincipalNames operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServicePrincipalNames method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListServicePrincipalNames operation. -// pageNum := 0 -// err := client.ListServicePrincipalNamesPages(params, -// func(page *pcaconnectorad.ListServicePrincipalNamesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PcaConnectorAd) ListServicePrincipalNamesPages(input *ListServicePrincipalNamesInput, fn func(*ListServicePrincipalNamesOutput, bool) bool) error { - return c.ListServicePrincipalNamesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServicePrincipalNamesPagesWithContext same as ListServicePrincipalNamesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PcaConnectorAd) ListServicePrincipalNamesPagesWithContext(ctx aws.Context, input *ListServicePrincipalNamesInput, fn func(*ListServicePrincipalNamesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListServicePrincipalNamesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListServicePrincipalNamesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListServicePrincipalNamesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListTagsForResource -func (c *PcaConnectorAd) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for PcaConnectorAd. -// -// Lists the tags, if any, that are associated with your resource. -// -// 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 PcaConnectorAd's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListTagsForResource -func (c *PcaConnectorAd) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *PcaConnectorAd) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTemplateGroupAccessControlEntries = "ListTemplateGroupAccessControlEntries" - -// ListTemplateGroupAccessControlEntriesRequest generates a "aws/request.Request" representing the -// client's request for the ListTemplateGroupAccessControlEntries 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 ListTemplateGroupAccessControlEntries for more information on using the ListTemplateGroupAccessControlEntries -// 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 ListTemplateGroupAccessControlEntriesRequest method. -// req, resp := client.ListTemplateGroupAccessControlEntriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListTemplateGroupAccessControlEntries -func (c *PcaConnectorAd) ListTemplateGroupAccessControlEntriesRequest(input *ListTemplateGroupAccessControlEntriesInput) (req *request.Request, output *ListTemplateGroupAccessControlEntriesOutput) { - op := &request.Operation{ - Name: opListTemplateGroupAccessControlEntries, - HTTPMethod: "GET", - HTTPPath: "/templates/{TemplateArn}/accessControlEntries", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTemplateGroupAccessControlEntriesInput{} - } - - output = &ListTemplateGroupAccessControlEntriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTemplateGroupAccessControlEntries API operation for PcaConnectorAd. -// -// Lists group access control entries you created. -// -// 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 PcaConnectorAd's -// API operation ListTemplateGroupAccessControlEntries for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListTemplateGroupAccessControlEntries -func (c *PcaConnectorAd) ListTemplateGroupAccessControlEntries(input *ListTemplateGroupAccessControlEntriesInput) (*ListTemplateGroupAccessControlEntriesOutput, error) { - req, out := c.ListTemplateGroupAccessControlEntriesRequest(input) - return out, req.Send() -} - -// ListTemplateGroupAccessControlEntriesWithContext is the same as ListTemplateGroupAccessControlEntries with the addition of -// the ability to pass a context and additional request options. -// -// See ListTemplateGroupAccessControlEntries 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 *PcaConnectorAd) ListTemplateGroupAccessControlEntriesWithContext(ctx aws.Context, input *ListTemplateGroupAccessControlEntriesInput, opts ...request.Option) (*ListTemplateGroupAccessControlEntriesOutput, error) { - req, out := c.ListTemplateGroupAccessControlEntriesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTemplateGroupAccessControlEntriesPages iterates over the pages of a ListTemplateGroupAccessControlEntries operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTemplateGroupAccessControlEntries method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTemplateGroupAccessControlEntries operation. -// pageNum := 0 -// err := client.ListTemplateGroupAccessControlEntriesPages(params, -// func(page *pcaconnectorad.ListTemplateGroupAccessControlEntriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PcaConnectorAd) ListTemplateGroupAccessControlEntriesPages(input *ListTemplateGroupAccessControlEntriesInput, fn func(*ListTemplateGroupAccessControlEntriesOutput, bool) bool) error { - return c.ListTemplateGroupAccessControlEntriesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTemplateGroupAccessControlEntriesPagesWithContext same as ListTemplateGroupAccessControlEntriesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PcaConnectorAd) ListTemplateGroupAccessControlEntriesPagesWithContext(ctx aws.Context, input *ListTemplateGroupAccessControlEntriesInput, fn func(*ListTemplateGroupAccessControlEntriesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTemplateGroupAccessControlEntriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTemplateGroupAccessControlEntriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTemplateGroupAccessControlEntriesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTemplates = "ListTemplates" - -// ListTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the ListTemplates 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 ListTemplates for more information on using the ListTemplates -// 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 ListTemplatesRequest method. -// req, resp := client.ListTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListTemplates -func (c *PcaConnectorAd) ListTemplatesRequest(input *ListTemplatesInput) (req *request.Request, output *ListTemplatesOutput) { - op := &request.Operation{ - Name: opListTemplates, - HTTPMethod: "GET", - HTTPPath: "/templates", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTemplatesInput{} - } - - output = &ListTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTemplates API operation for PcaConnectorAd. -// -// Lists the templates, if any, that are associated with a connector. -// -// 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 PcaConnectorAd's -// API operation ListTemplates for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/ListTemplates -func (c *PcaConnectorAd) ListTemplates(input *ListTemplatesInput) (*ListTemplatesOutput, error) { - req, out := c.ListTemplatesRequest(input) - return out, req.Send() -} - -// ListTemplatesWithContext is the same as ListTemplates with the addition of -// the ability to pass a context and additional request options. -// -// See ListTemplates 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 *PcaConnectorAd) ListTemplatesWithContext(ctx aws.Context, input *ListTemplatesInput, opts ...request.Option) (*ListTemplatesOutput, error) { - req, out := c.ListTemplatesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTemplatesPages iterates over the pages of a ListTemplates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTemplates method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTemplates operation. -// pageNum := 0 -// err := client.ListTemplatesPages(params, -// func(page *pcaconnectorad.ListTemplatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PcaConnectorAd) ListTemplatesPages(input *ListTemplatesInput, fn func(*ListTemplatesOutput, bool) bool) error { - return c.ListTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTemplatesPagesWithContext same as ListTemplatesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PcaConnectorAd) ListTemplatesPagesWithContext(ctx aws.Context, input *ListTemplatesInput, fn func(*ListTemplatesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTemplatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTemplatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTemplatesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/TagResource -func (c *PcaConnectorAd) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for PcaConnectorAd. -// -// Adds one or more tags to your resource. -// -// 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 PcaConnectorAd's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/TagResource -func (c *PcaConnectorAd) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *PcaConnectorAd) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/UntagResource -func (c *PcaConnectorAd) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for PcaConnectorAd. -// -// Removes one or more tags from your resource. -// -// 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 PcaConnectorAd's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/UntagResource -func (c *PcaConnectorAd) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *PcaConnectorAd) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTemplate = "UpdateTemplate" - -// UpdateTemplateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTemplate 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 UpdateTemplate for more information on using the UpdateTemplate -// 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 UpdateTemplateRequest method. -// req, resp := client.UpdateTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/UpdateTemplate -func (c *PcaConnectorAd) UpdateTemplateRequest(input *UpdateTemplateInput) (req *request.Request, output *UpdateTemplateOutput) { - op := &request.Operation{ - Name: opUpdateTemplate, - HTTPMethod: "PATCH", - HTTPPath: "/templates/{TemplateArn}", - } - - if input == nil { - input = &UpdateTemplateInput{} - } - - output = &UpdateTemplateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateTemplate API operation for PcaConnectorAd. -// -// Update template configuration to define the information included in certificates. -// -// 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 PcaConnectorAd's -// API operation UpdateTemplate for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/UpdateTemplate -func (c *PcaConnectorAd) UpdateTemplate(input *UpdateTemplateInput) (*UpdateTemplateOutput, error) { - req, out := c.UpdateTemplateRequest(input) - return out, req.Send() -} - -// UpdateTemplateWithContext is the same as UpdateTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTemplate 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 *PcaConnectorAd) UpdateTemplateWithContext(ctx aws.Context, input *UpdateTemplateInput, opts ...request.Option) (*UpdateTemplateOutput, error) { - req, out := c.UpdateTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTemplateGroupAccessControlEntry = "UpdateTemplateGroupAccessControlEntry" - -// UpdateTemplateGroupAccessControlEntryRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTemplateGroupAccessControlEntry 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 UpdateTemplateGroupAccessControlEntry for more information on using the UpdateTemplateGroupAccessControlEntry -// 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 UpdateTemplateGroupAccessControlEntryRequest method. -// req, resp := client.UpdateTemplateGroupAccessControlEntryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/UpdateTemplateGroupAccessControlEntry -func (c *PcaConnectorAd) UpdateTemplateGroupAccessControlEntryRequest(input *UpdateTemplateGroupAccessControlEntryInput) (req *request.Request, output *UpdateTemplateGroupAccessControlEntryOutput) { - op := &request.Operation{ - Name: opUpdateTemplateGroupAccessControlEntry, - HTTPMethod: "PATCH", - HTTPPath: "/templates/{TemplateArn}/accessControlEntries/{GroupSecurityIdentifier}", - } - - if input == nil { - input = &UpdateTemplateGroupAccessControlEntryInput{} - } - - output = &UpdateTemplateGroupAccessControlEntryOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateTemplateGroupAccessControlEntry API operation for PcaConnectorAd. -// -// Update a group access control entry you created using CreateTemplateGroupAccessControlEntry -// (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplateGroupAccessControlEntry.html). -// -// 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 PcaConnectorAd's -// API operation UpdateTemplateGroupAccessControlEntry for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -// -// - ValidationException -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -// -// - ResourceNotFoundException -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -// -// - ConflictException -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10/UpdateTemplateGroupAccessControlEntry -func (c *PcaConnectorAd) UpdateTemplateGroupAccessControlEntry(input *UpdateTemplateGroupAccessControlEntryInput) (*UpdateTemplateGroupAccessControlEntryOutput, error) { - req, out := c.UpdateTemplateGroupAccessControlEntryRequest(input) - return out, req.Send() -} - -// UpdateTemplateGroupAccessControlEntryWithContext is the same as UpdateTemplateGroupAccessControlEntry with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTemplateGroupAccessControlEntry 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 *PcaConnectorAd) UpdateTemplateGroupAccessControlEntryWithContext(ctx aws.Context, input *UpdateTemplateGroupAccessControlEntryInput, opts ...request.Option) (*UpdateTemplateGroupAccessControlEntryOutput, error) { - req, out := c.UpdateTemplateGroupAccessControlEntryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// An access control entry allows or denies Active Directory groups based on -// their security identifiers (SIDs) from enrolling and/or autoenrolling with -// the template. -type AccessControlEntry struct { - _ struct{} `type:"structure"` - - // Permissions to allow or deny an Active Directory group to enroll or autoenroll - // certificates issued against a template. - AccessRights *AccessRights `type:"structure"` - - // The date and time that the Access Control Entry was created. - CreatedAt *time.Time `type:"timestamp"` - - // Name of the Active Directory group. This name does not need to match the - // group name in Active Directory. - GroupDisplayName *string `type:"string"` - - // Security identifier (SID) of the group object from Active Directory. The - // SID starts with "S-". - GroupSecurityIdentifier *string `min:"7" type:"string"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - TemplateArn *string `min:"5" type:"string"` - - // The date and time that the Access Control Entry was updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 AccessControlEntry) 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 AccessControlEntry) GoString() string { - return s.String() -} - -// SetAccessRights sets the AccessRights field's value. -func (s *AccessControlEntry) SetAccessRights(v *AccessRights) *AccessControlEntry { - s.AccessRights = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AccessControlEntry) SetCreatedAt(v time.Time) *AccessControlEntry { - s.CreatedAt = &v - return s -} - -// SetGroupDisplayName sets the GroupDisplayName field's value. -func (s *AccessControlEntry) SetGroupDisplayName(v string) *AccessControlEntry { - s.GroupDisplayName = &v - return s -} - -// SetGroupSecurityIdentifier sets the GroupSecurityIdentifier field's value. -func (s *AccessControlEntry) SetGroupSecurityIdentifier(v string) *AccessControlEntry { - s.GroupSecurityIdentifier = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *AccessControlEntry) SetTemplateArn(v string) *AccessControlEntry { - s.TemplateArn = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AccessControlEntry) SetUpdatedAt(v time.Time) *AccessControlEntry { - s.UpdatedAt = &v - return s -} - -// Summary of group access control entries that allow or deny Active Directory -// groups based on their security identifiers (SIDs) from enrolling and/or autofenrolling -// with the template. -type AccessControlEntrySummary struct { - _ struct{} `type:"structure"` - - // Allow or deny an Active Directory group from enrolling and autoenrolling - // certificates issued against a template. - AccessRights *AccessRights `type:"structure"` - - // The date and time that the Access Control Entry was created. - CreatedAt *time.Time `type:"timestamp"` - - // Name of the Active Directory group. This name does not need to match the - // group name in Active Directory. - GroupDisplayName *string `type:"string"` - - // Security identifier (SID) of the group object from Active Directory. The - // SID starts with "S-". - GroupSecurityIdentifier *string `min:"7" type:"string"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - TemplateArn *string `min:"5" type:"string"` - - // The date and time that the Access Control Entry was updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 AccessControlEntrySummary) 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 AccessControlEntrySummary) GoString() string { - return s.String() -} - -// SetAccessRights sets the AccessRights field's value. -func (s *AccessControlEntrySummary) SetAccessRights(v *AccessRights) *AccessControlEntrySummary { - s.AccessRights = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AccessControlEntrySummary) SetCreatedAt(v time.Time) *AccessControlEntrySummary { - s.CreatedAt = &v - return s -} - -// SetGroupDisplayName sets the GroupDisplayName field's value. -func (s *AccessControlEntrySummary) SetGroupDisplayName(v string) *AccessControlEntrySummary { - s.GroupDisplayName = &v - return s -} - -// SetGroupSecurityIdentifier sets the GroupSecurityIdentifier field's value. -func (s *AccessControlEntrySummary) SetGroupSecurityIdentifier(v string) *AccessControlEntrySummary { - s.GroupSecurityIdentifier = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *AccessControlEntrySummary) SetTemplateArn(v string) *AccessControlEntrySummary { - s.TemplateArn = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AccessControlEntrySummary) SetUpdatedAt(v time.Time) *AccessControlEntrySummary { - s.UpdatedAt = &v - return s -} - -// You can receive this error if you attempt to create a resource share when -// you don't have the required permissions. This can be caused by insufficient -// permissions in policies attached to your Amazon Web Services Identity and -// Access Management (IAM) principal. It can also happen because of restrictions -// in place from an Amazon Web Services Organizations service control policy -// (SCP) that affects your Amazon Web Services account. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Allow or deny permissions for an Active Directory group to enroll or autoenroll -// certificates for a template. -type AccessRights struct { - _ struct{} `type:"structure"` - - // Allow or deny an Active Directory group from autoenrolling certificates issued - // against a template. The Active Directory group must be allowed to enroll - // to allow autoenrollment - AutoEnroll *string `type:"string" enum:"AccessRight"` - - // Allow or deny an Active Directory group from enrolling certificates issued - // against a template. - Enroll *string `type:"string" enum:"AccessRight"` -} - -// 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 AccessRights) 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 AccessRights) GoString() string { - return s.String() -} - -// SetAutoEnroll sets the AutoEnroll field's value. -func (s *AccessRights) SetAutoEnroll(v string) *AccessRights { - s.AutoEnroll = &v - return s -} - -// SetEnroll sets the Enroll field's value. -func (s *AccessRights) SetEnroll(v string) *AccessRights { - s.Enroll = &v - return s -} - -// Application policies describe what the certificate can be used for. -type ApplicationPolicies struct { - _ struct{} `type:"structure"` - - // Marks the application policy extension as critical. - Critical *bool `type:"boolean"` - - // Application policies describe what the certificate can be used for. - // - // Policies is a required field - Policies []*ApplicationPolicy `min:"1" type:"list" 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 ApplicationPolicies) 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 ApplicationPolicies) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApplicationPolicies) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplicationPolicies"} - if s.Policies == nil { - invalidParams.Add(request.NewErrParamRequired("Policies")) - } - if s.Policies != nil && len(s.Policies) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policies", 1)) - } - if s.Policies != nil { - for i, v := range s.Policies { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Policies", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCritical sets the Critical field's value. -func (s *ApplicationPolicies) SetCritical(v bool) *ApplicationPolicies { - s.Critical = &v - return s -} - -// SetPolicies sets the Policies field's value. -func (s *ApplicationPolicies) SetPolicies(v []*ApplicationPolicy) *ApplicationPolicies { - s.Policies = v - return s -} - -// Application policies describe what the certificate can be used for. -type ApplicationPolicy struct { - _ struct{} `type:"structure"` - - // The object identifier (OID) of an application policy. - PolicyObjectIdentifier *string `min:"1" type:"string"` - - // The type of application policy - PolicyType *string `type:"string" enum:"ApplicationPolicyType"` -} - -// 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 ApplicationPolicy) 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 ApplicationPolicy) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApplicationPolicy) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplicationPolicy"} - if s.PolicyObjectIdentifier != nil && len(*s.PolicyObjectIdentifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyObjectIdentifier", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyObjectIdentifier sets the PolicyObjectIdentifier field's value. -func (s *ApplicationPolicy) SetPolicyObjectIdentifier(v string) *ApplicationPolicy { - s.PolicyObjectIdentifier = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *ApplicationPolicy) SetPolicyType(v string) *ApplicationPolicy { - s.PolicyType = &v - return s -} - -// Information describing the end of the validity period of the certificate. -// This parameter sets the “Not After” date for the certificate. Certificate -// validity is the period of time during which a certificate is valid. Validity -// can be expressed as an explicit date and time when the certificate expires, -// or as a span of time after issuance, stated in days, months, or years. For -// more information, see Validity in RFC 5280. This value is unaffected when -// ValidityNotBefore is also specified. For example, if Validity is set to 20 -// days in the future, the certificate will expire 20 days from issuance time -// regardless of the ValidityNotBefore value. -type CertificateValidity struct { - _ struct{} `type:"structure"` - - // Renewal period is the period of time before certificate expiration when a - // new certificate will be requested. - // - // RenewalPeriod is a required field - RenewalPeriod *ValidityPeriod `type:"structure" required:"true"` - - // Information describing the end of the validity period of the certificate. - // This parameter sets the “Not After” date for the certificate. Certificate - // validity is the period of time during which a certificate is valid. Validity - // can be expressed as an explicit date and time when the certificate expires, - // or as a span of time after issuance, stated in days, months, or years. For - // more information, see Validity in RFC 5280. This value is unaffected when - // ValidityNotBefore is also specified. For example, if Validity is set to 20 - // days in the future, the certificate will expire 20 days from issuance time - // regardless of the ValidityNotBefore value. - // - // ValidityPeriod is a required field - ValidityPeriod *ValidityPeriod `type:"structure" 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 CertificateValidity) 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 CertificateValidity) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CertificateValidity) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CertificateValidity"} - if s.RenewalPeriod == nil { - invalidParams.Add(request.NewErrParamRequired("RenewalPeriod")) - } - if s.ValidityPeriod == nil { - invalidParams.Add(request.NewErrParamRequired("ValidityPeriod")) - } - if s.RenewalPeriod != nil { - if err := s.RenewalPeriod.Validate(); err != nil { - invalidParams.AddNested("RenewalPeriod", err.(request.ErrInvalidParams)) - } - } - if s.ValidityPeriod != nil { - if err := s.ValidityPeriod.Validate(); err != nil { - invalidParams.AddNested("ValidityPeriod", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRenewalPeriod sets the RenewalPeriod field's value. -func (s *CertificateValidity) SetRenewalPeriod(v *ValidityPeriod) *CertificateValidity { - s.RenewalPeriod = v - return s -} - -// SetValidityPeriod sets the ValidityPeriod field's value. -func (s *CertificateValidity) SetValidityPeriod(v *ValidityPeriod) *CertificateValidity { - s.ValidityPeriod = v - return s -} - -// This request cannot be completed for one of the following reasons because -// the requested resource was being concurrently modified by another request. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The identifier of the Amazon Web Services resource. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // The resource type, which can be one of Connector, Template, TemplateGroupAccessControlEntry, - // ServicePrincipalName, or DirectoryRegistration. - // - // ResourceType is a required field - ResourceType *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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Amazon Web Services Private CA Connector for Active Directory is a service -// that links your Active Directory with Amazon Web Services Private CA. The -// connector brokers the exchange of certificates from Amazon Web Services Private -// CA to domain-joined users and machines managed with Active Directory. -type Connector struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - Arn *string `min:"5" type:"string"` - - // The Amazon Resource Name (ARN) of the certificate authority being used. - CertificateAuthorityArn *string `min:"5" type:"string"` - - // Certificate enrollment endpoint for Active Directory domain-joined objects - // reach out to when requesting certificates. - CertificateEnrollmentPolicyServerEndpoint *string `type:"string"` - - // The date and time that the connector was created. - CreatedAt *time.Time `type:"timestamp"` - - // The identifier of the Active Directory. - DirectoryId *string `type:"string"` - - // Status of the connector. Status can be creating, active, deleting, or failed. - Status *string `type:"string" enum:"ConnectorStatus"` - - // Additional information about the connector status if the status is failed. - StatusReason *string `type:"string" enum:"ConnectorStatusReason"` - - // The date and time that the connector was updated. - UpdatedAt *time.Time `type:"timestamp"` - - // Information of the VPC and security group(s) used with the connector. - VpcInformation *VpcInformation `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 Connector) 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 Connector) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Connector) SetArn(v string) *Connector { - s.Arn = &v - return s -} - -// SetCertificateAuthorityArn sets the CertificateAuthorityArn field's value. -func (s *Connector) SetCertificateAuthorityArn(v string) *Connector { - s.CertificateAuthorityArn = &v - return s -} - -// SetCertificateEnrollmentPolicyServerEndpoint sets the CertificateEnrollmentPolicyServerEndpoint field's value. -func (s *Connector) SetCertificateEnrollmentPolicyServerEndpoint(v string) *Connector { - s.CertificateEnrollmentPolicyServerEndpoint = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Connector) SetCreatedAt(v time.Time) *Connector { - s.CreatedAt = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *Connector) SetDirectoryId(v string) *Connector { - s.DirectoryId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Connector) SetStatus(v string) *Connector { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *Connector) SetStatusReason(v string) *Connector { - s.StatusReason = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Connector) SetUpdatedAt(v time.Time) *Connector { - s.UpdatedAt = &v - return s -} - -// SetVpcInformation sets the VpcInformation field's value. -func (s *Connector) SetVpcInformation(v *VpcInformation) *Connector { - s.VpcInformation = v - return s -} - -// Summary description of the Amazon Web Services Private CA AD connectors belonging -// to an Amazon Web Services account. -type ConnectorSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - Arn *string `min:"5" type:"string"` - - // The Amazon Resource Name (ARN) of the certificate authority being used. - CertificateAuthorityArn *string `min:"5" type:"string"` - - // Certificate enrollment endpoint for Active Directory domain-joined objects - // to request certificates. - CertificateEnrollmentPolicyServerEndpoint *string `type:"string"` - - // The date and time that the connector was created. - CreatedAt *time.Time `type:"timestamp"` - - // The identifier of the Active Directory. - DirectoryId *string `type:"string"` - - // Status of the connector. Status can be creating, active, deleting, or failed. - Status *string `type:"string" enum:"ConnectorStatus"` - - // Additional information about the connector status if the status is failed. - StatusReason *string `type:"string" enum:"ConnectorStatusReason"` - - // The date and time that the connector was updated. - UpdatedAt *time.Time `type:"timestamp"` - - // Information of the VPC and security group(s) used with the connector. - VpcInformation *VpcInformation `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 ConnectorSummary) 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 ConnectorSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ConnectorSummary) SetArn(v string) *ConnectorSummary { - s.Arn = &v - return s -} - -// SetCertificateAuthorityArn sets the CertificateAuthorityArn field's value. -func (s *ConnectorSummary) SetCertificateAuthorityArn(v string) *ConnectorSummary { - s.CertificateAuthorityArn = &v - return s -} - -// SetCertificateEnrollmentPolicyServerEndpoint sets the CertificateEnrollmentPolicyServerEndpoint field's value. -func (s *ConnectorSummary) SetCertificateEnrollmentPolicyServerEndpoint(v string) *ConnectorSummary { - s.CertificateEnrollmentPolicyServerEndpoint = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ConnectorSummary) SetCreatedAt(v time.Time) *ConnectorSummary { - s.CreatedAt = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *ConnectorSummary) SetDirectoryId(v string) *ConnectorSummary { - s.DirectoryId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ConnectorSummary) SetStatus(v string) *ConnectorSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *ConnectorSummary) SetStatusReason(v string) *ConnectorSummary { - s.StatusReason = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ConnectorSummary) SetUpdatedAt(v time.Time) *ConnectorSummary { - s.UpdatedAt = &v - return s -} - -// SetVpcInformation sets the VpcInformation field's value. -func (s *ConnectorSummary) SetVpcInformation(v *VpcInformation) *ConnectorSummary { - s.VpcInformation = v - return s -} - -type CreateConnectorInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the certificate authority being used. - // - // CertificateAuthorityArn is a required field - CertificateAuthorityArn *string `min:"5" type:"string" required:"true"` - - // Idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // The identifier of the Active Directory. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // Metadata assigned to a connector consisting of a key-value pair. - Tags map[string]*string `type:"map"` - - // Security group IDs that describe the inbound and outbound rules. - // - // VpcInformation is a required field - VpcInformation *VpcInformation `type:"structure" 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 CreateConnectorInput) 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 CreateConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateConnectorInput"} - if s.CertificateAuthorityArn == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateAuthorityArn")) - } - if s.CertificateAuthorityArn != nil && len(*s.CertificateAuthorityArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("CertificateAuthorityArn", 5)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - if s.VpcInformation == nil { - invalidParams.Add(request.NewErrParamRequired("VpcInformation")) - } - if s.VpcInformation != nil { - if err := s.VpcInformation.Validate(); err != nil { - invalidParams.AddNested("VpcInformation", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateAuthorityArn sets the CertificateAuthorityArn field's value. -func (s *CreateConnectorInput) SetCertificateAuthorityArn(v string) *CreateConnectorInput { - s.CertificateAuthorityArn = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateConnectorInput) SetClientToken(v string) *CreateConnectorInput { - s.ClientToken = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateConnectorInput) SetDirectoryId(v string) *CreateConnectorInput { - s.DirectoryId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateConnectorInput) SetTags(v map[string]*string) *CreateConnectorInput { - s.Tags = v - return s -} - -// SetVpcInformation sets the VpcInformation field's value. -func (s *CreateConnectorInput) SetVpcInformation(v *VpcInformation) *CreateConnectorInput { - s.VpcInformation = v - return s -} - -type CreateConnectorOutput struct { - _ struct{} `type:"structure"` - - // If successful, the Amazon Resource Name (ARN) of the connector for Active - // Directory. - ConnectorArn *string `min:"5" 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 CreateConnectorOutput) 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 CreateConnectorOutput) GoString() string { - return s.String() -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *CreateConnectorOutput) SetConnectorArn(v string) *CreateConnectorOutput { - s.ConnectorArn = &v - return s -} - -type CreateDirectoryRegistrationInput struct { - _ struct{} `type:"structure"` - - // Idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // The identifier of the Active Directory. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // Metadata assigned to a directory registration consisting of a key-value pair. - Tags map[string]*string `type:"map"` -} - -// 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 CreateDirectoryRegistrationInput) 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 CreateDirectoryRegistrationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDirectoryRegistrationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDirectoryRegistrationInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDirectoryRegistrationInput) SetClientToken(v string) *CreateDirectoryRegistrationInput { - s.ClientToken = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateDirectoryRegistrationInput) SetDirectoryId(v string) *CreateDirectoryRegistrationInput { - s.DirectoryId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDirectoryRegistrationInput) SetTags(v map[string]*string) *CreateDirectoryRegistrationInput { - s.Tags = v - return s -} - -type CreateDirectoryRegistrationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - DirectoryRegistrationArn *string `min:"5" 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 CreateDirectoryRegistrationOutput) 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 CreateDirectoryRegistrationOutput) GoString() string { - return s.String() -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *CreateDirectoryRegistrationOutput) SetDirectoryRegistrationArn(v string) *CreateDirectoryRegistrationOutput { - s.DirectoryRegistrationArn = &v - return s -} - -type CreateServicePrincipalNameInput struct { - _ struct{} `type:"structure"` - - // Idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - // - // ConnectorArn is a required field - ConnectorArn *string `location:"uri" locationName:"ConnectorArn" min:"5" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - // - // DirectoryRegistrationArn is a required field - DirectoryRegistrationArn *string `location:"uri" locationName:"DirectoryRegistrationArn" min:"5" 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 CreateServicePrincipalNameInput) 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 CreateServicePrincipalNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateServicePrincipalNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateServicePrincipalNameInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ConnectorArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectorArn")) - } - if s.ConnectorArn != nil && len(*s.ConnectorArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("ConnectorArn", 5)) - } - if s.DirectoryRegistrationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryRegistrationArn")) - } - if s.DirectoryRegistrationArn != nil && len(*s.DirectoryRegistrationArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("DirectoryRegistrationArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateServicePrincipalNameInput) SetClientToken(v string) *CreateServicePrincipalNameInput { - s.ClientToken = &v - return s -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *CreateServicePrincipalNameInput) SetConnectorArn(v string) *CreateServicePrincipalNameInput { - s.ConnectorArn = &v - return s -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *CreateServicePrincipalNameInput) SetDirectoryRegistrationArn(v string) *CreateServicePrincipalNameInput { - s.DirectoryRegistrationArn = &v - return s -} - -type CreateServicePrincipalNameOutput 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 CreateServicePrincipalNameOutput) 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 CreateServicePrincipalNameOutput) GoString() string { - return s.String() -} - -type CreateTemplateGroupAccessControlEntryInput struct { - _ struct{} `type:"structure"` - - // Allow or deny permissions for an Active Directory group to enroll or autoenroll - // certificates for a template. - // - // AccessRights is a required field - AccessRights *AccessRights `type:"structure" required:"true"` - - // Idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // Name of the Active Directory group. This name does not need to match the - // group name in Active Directory. - // - // GroupDisplayName is a required field - GroupDisplayName *string `type:"string" required:"true"` - - // Security identifier (SID) of the group object from Active Directory. The - // SID starts with "S-". - // - // GroupSecurityIdentifier is a required field - GroupSecurityIdentifier *string `min:"7" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - // - // TemplateArn is a required field - TemplateArn *string `location:"uri" locationName:"TemplateArn" min:"5" 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 CreateTemplateGroupAccessControlEntryInput) 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 CreateTemplateGroupAccessControlEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTemplateGroupAccessControlEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTemplateGroupAccessControlEntryInput"} - if s.AccessRights == nil { - invalidParams.Add(request.NewErrParamRequired("AccessRights")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.GroupDisplayName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupDisplayName")) - } - if s.GroupSecurityIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GroupSecurityIdentifier")) - } - if s.GroupSecurityIdentifier != nil && len(*s.GroupSecurityIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("GroupSecurityIdentifier", 7)) - } - if s.TemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateArn")) - } - if s.TemplateArn != nil && len(*s.TemplateArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("TemplateArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessRights sets the AccessRights field's value. -func (s *CreateTemplateGroupAccessControlEntryInput) SetAccessRights(v *AccessRights) *CreateTemplateGroupAccessControlEntryInput { - s.AccessRights = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateTemplateGroupAccessControlEntryInput) SetClientToken(v string) *CreateTemplateGroupAccessControlEntryInput { - s.ClientToken = &v - return s -} - -// SetGroupDisplayName sets the GroupDisplayName field's value. -func (s *CreateTemplateGroupAccessControlEntryInput) SetGroupDisplayName(v string) *CreateTemplateGroupAccessControlEntryInput { - s.GroupDisplayName = &v - return s -} - -// SetGroupSecurityIdentifier sets the GroupSecurityIdentifier field's value. -func (s *CreateTemplateGroupAccessControlEntryInput) SetGroupSecurityIdentifier(v string) *CreateTemplateGroupAccessControlEntryInput { - s.GroupSecurityIdentifier = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *CreateTemplateGroupAccessControlEntryInput) SetTemplateArn(v string) *CreateTemplateGroupAccessControlEntryInput { - s.TemplateArn = &v - return s -} - -type CreateTemplateGroupAccessControlEntryOutput 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 CreateTemplateGroupAccessControlEntryOutput) 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 CreateTemplateGroupAccessControlEntryOutput) GoString() string { - return s.String() -} - -type CreateTemplateInput struct { - _ struct{} `type:"structure"` - - // Idempotency token. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - // - // ConnectorArn is a required field - ConnectorArn *string `min:"5" type:"string" required:"true"` - - // Template configuration to define the information included in certificates. - // Define certificate validity and renewal periods, certificate request handling - // and enrollment options, key usage extensions, application policies, and cryptography - // settings. - // - // Definition is a required field - Definition *TemplateDefinition `type:"structure" required:"true"` - - // Name of the template. The template name must be unique. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Metadata assigned to a template consisting of a key-value pair. - Tags map[string]*string `type:"map"` -} - -// 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 CreateTemplateInput) 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 CreateTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTemplateInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ConnectorArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectorArn")) - } - if s.ConnectorArn != nil && len(*s.ConnectorArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("ConnectorArn", 5)) - } - if s.Definition == nil { - invalidParams.Add(request.NewErrParamRequired("Definition")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Definition != nil { - if err := s.Definition.Validate(); err != nil { - invalidParams.AddNested("Definition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateTemplateInput) SetClientToken(v string) *CreateTemplateInput { - s.ClientToken = &v - return s -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *CreateTemplateInput) SetConnectorArn(v string) *CreateTemplateInput { - s.ConnectorArn = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *CreateTemplateInput) SetDefinition(v *TemplateDefinition) *CreateTemplateInput { - s.Definition = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTemplateInput) SetName(v string) *CreateTemplateInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateTemplateInput) SetTags(v map[string]*string) *CreateTemplateInput { - s.Tags = v - return s -} - -type CreateTemplateOutput struct { - _ struct{} `type:"structure"` - - // If successful, the Amazon Resource Name (ARN) of the template. - TemplateArn *string `min:"5" 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 CreateTemplateOutput) 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 CreateTemplateOutput) GoString() string { - return s.String() -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *CreateTemplateOutput) SetTemplateArn(v string) *CreateTemplateOutput { - s.TemplateArn = &v - return s -} - -type DeleteConnectorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - // - // ConnectorArn is a required field - ConnectorArn *string `location:"uri" locationName:"ConnectorArn" min:"5" 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 DeleteConnectorInput) 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 DeleteConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConnectorInput"} - if s.ConnectorArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectorArn")) - } - if s.ConnectorArn != nil && len(*s.ConnectorArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("ConnectorArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *DeleteConnectorInput) SetConnectorArn(v string) *DeleteConnectorInput { - s.ConnectorArn = &v - return s -} - -type DeleteConnectorOutput 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 DeleteConnectorOutput) 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 DeleteConnectorOutput) GoString() string { - return s.String() -} - -type DeleteDirectoryRegistrationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - // - // DirectoryRegistrationArn is a required field - DirectoryRegistrationArn *string `location:"uri" locationName:"DirectoryRegistrationArn" min:"5" 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 DeleteDirectoryRegistrationInput) 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 DeleteDirectoryRegistrationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDirectoryRegistrationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDirectoryRegistrationInput"} - if s.DirectoryRegistrationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryRegistrationArn")) - } - if s.DirectoryRegistrationArn != nil && len(*s.DirectoryRegistrationArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("DirectoryRegistrationArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *DeleteDirectoryRegistrationInput) SetDirectoryRegistrationArn(v string) *DeleteDirectoryRegistrationInput { - s.DirectoryRegistrationArn = &v - return s -} - -type DeleteDirectoryRegistrationOutput 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 DeleteDirectoryRegistrationOutput) 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 DeleteDirectoryRegistrationOutput) GoString() string { - return s.String() -} - -type DeleteServicePrincipalNameInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - // - // ConnectorArn is a required field - ConnectorArn *string `location:"uri" locationName:"ConnectorArn" min:"5" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - // - // DirectoryRegistrationArn is a required field - DirectoryRegistrationArn *string `location:"uri" locationName:"DirectoryRegistrationArn" min:"5" 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 DeleteServicePrincipalNameInput) 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 DeleteServicePrincipalNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServicePrincipalNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServicePrincipalNameInput"} - if s.ConnectorArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectorArn")) - } - if s.ConnectorArn != nil && len(*s.ConnectorArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("ConnectorArn", 5)) - } - if s.DirectoryRegistrationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryRegistrationArn")) - } - if s.DirectoryRegistrationArn != nil && len(*s.DirectoryRegistrationArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("DirectoryRegistrationArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *DeleteServicePrincipalNameInput) SetConnectorArn(v string) *DeleteServicePrincipalNameInput { - s.ConnectorArn = &v - return s -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *DeleteServicePrincipalNameInput) SetDirectoryRegistrationArn(v string) *DeleteServicePrincipalNameInput { - s.DirectoryRegistrationArn = &v - return s -} - -type DeleteServicePrincipalNameOutput 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 DeleteServicePrincipalNameOutput) 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 DeleteServicePrincipalNameOutput) GoString() string { - return s.String() -} - -type DeleteTemplateGroupAccessControlEntryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Security identifier (SID) of the group object from Active Directory. The - // SID starts with "S-". - // - // GroupSecurityIdentifier is a required field - GroupSecurityIdentifier *string `location:"uri" locationName:"GroupSecurityIdentifier" min:"7" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - // - // TemplateArn is a required field - TemplateArn *string `location:"uri" locationName:"TemplateArn" min:"5" 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 DeleteTemplateGroupAccessControlEntryInput) 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 DeleteTemplateGroupAccessControlEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTemplateGroupAccessControlEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTemplateGroupAccessControlEntryInput"} - if s.GroupSecurityIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GroupSecurityIdentifier")) - } - if s.GroupSecurityIdentifier != nil && len(*s.GroupSecurityIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("GroupSecurityIdentifier", 7)) - } - if s.TemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateArn")) - } - if s.TemplateArn != nil && len(*s.TemplateArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("TemplateArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupSecurityIdentifier sets the GroupSecurityIdentifier field's value. -func (s *DeleteTemplateGroupAccessControlEntryInput) SetGroupSecurityIdentifier(v string) *DeleteTemplateGroupAccessControlEntryInput { - s.GroupSecurityIdentifier = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *DeleteTemplateGroupAccessControlEntryInput) SetTemplateArn(v string) *DeleteTemplateGroupAccessControlEntryInput { - s.TemplateArn = &v - return s -} - -type DeleteTemplateGroupAccessControlEntryOutput 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 DeleteTemplateGroupAccessControlEntryOutput) 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 DeleteTemplateGroupAccessControlEntryOutput) GoString() string { - return s.String() -} - -type DeleteTemplateInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - // - // TemplateArn is a required field - TemplateArn *string `location:"uri" locationName:"TemplateArn" min:"5" 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 DeleteTemplateInput) 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 DeleteTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTemplateInput"} - if s.TemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateArn")) - } - if s.TemplateArn != nil && len(*s.TemplateArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("TemplateArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *DeleteTemplateInput) SetTemplateArn(v string) *DeleteTemplateInput { - s.TemplateArn = &v - return s -} - -type DeleteTemplateOutput 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 DeleteTemplateOutput) 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 DeleteTemplateOutput) GoString() string { - return s.String() -} - -// The directory registration represents the authorization of the connector -// service with a directory. -type DirectoryRegistration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration. - Arn *string `min:"5" type:"string"` - - // The date and time that the directory registration was created. - CreatedAt *time.Time `type:"timestamp"` - - // The identifier of the Active Directory. - DirectoryId *string `type:"string"` - - // Status of the directory registration. - Status *string `type:"string" enum:"DirectoryRegistrationStatus"` - - // Additional information about the directory registration status if the status - // is failed. - StatusReason *string `type:"string" enum:"DirectoryRegistrationStatusReason"` - - // The date and time that the directory registration was updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 DirectoryRegistration) 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 DirectoryRegistration) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DirectoryRegistration) SetArn(v string) *DirectoryRegistration { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DirectoryRegistration) SetCreatedAt(v time.Time) *DirectoryRegistration { - s.CreatedAt = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DirectoryRegistration) SetDirectoryId(v string) *DirectoryRegistration { - s.DirectoryId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DirectoryRegistration) SetStatus(v string) *DirectoryRegistration { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *DirectoryRegistration) SetStatusReason(v string) *DirectoryRegistration { - s.StatusReason = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DirectoryRegistration) SetUpdatedAt(v time.Time) *DirectoryRegistration { - s.UpdatedAt = &v - return s -} - -// The directory registration represents the authorization of the connector -// service with the Active Directory. -type DirectoryRegistrationSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - Arn *string `min:"5" type:"string"` - - // The date and time that the directory registration was created. - CreatedAt *time.Time `type:"timestamp"` - - // The identifier of the Active Directory. - DirectoryId *string `type:"string"` - - // Status of the directory registration. - Status *string `type:"string" enum:"DirectoryRegistrationStatus"` - - // Additional information about the directory registration status if the status - // is failed. - StatusReason *string `type:"string" enum:"DirectoryRegistrationStatusReason"` - - // The date and time that the directory registration was updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 DirectoryRegistrationSummary) 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 DirectoryRegistrationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DirectoryRegistrationSummary) SetArn(v string) *DirectoryRegistrationSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DirectoryRegistrationSummary) SetCreatedAt(v time.Time) *DirectoryRegistrationSummary { - s.CreatedAt = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DirectoryRegistrationSummary) SetDirectoryId(v string) *DirectoryRegistrationSummary { - s.DirectoryId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DirectoryRegistrationSummary) SetStatus(v string) *DirectoryRegistrationSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *DirectoryRegistrationSummary) SetStatusReason(v string) *DirectoryRegistrationSummary { - s.StatusReason = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DirectoryRegistrationSummary) SetUpdatedAt(v time.Time) *DirectoryRegistrationSummary { - s.UpdatedAt = &v - return s -} - -// Template configurations for v2 template schema. -type EnrollmentFlagsV2 struct { - _ struct{} `type:"structure"` - - // Allow renewal using the same key. - EnableKeyReuseOnNtTokenKeysetStorageFull *bool `type:"boolean"` - - // Include symmetric algorithms allowed by the subject. - IncludeSymmetricAlgorithms *bool `type:"boolean"` - - // This flag instructs the CA to not include the security extension szOID_NTDS_CA_SECURITY_EXT - // (OID:1.3.6.1.4.1.311.25.2), as specified in [MS-WCCE] sections 2.2.2.7.7.4 - // and 3.2.2.6.2.1.4.5.9, in the issued certificate. This addresses a Windows - // Kerberos elevation-of-privilege vulnerability. - NoSecurityExtension *bool `type:"boolean"` - - // Delete expired or revoked certificates instead of archiving them. - RemoveInvalidCertificateFromPersonalStore *bool `type:"boolean"` - - // Require user interaction when the subject is enrolled and the private key - // associated with the certificate is used. - UserInteractionRequired *bool `type:"boolean"` -} - -// 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 EnrollmentFlagsV2) 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 EnrollmentFlagsV2) GoString() string { - return s.String() -} - -// SetEnableKeyReuseOnNtTokenKeysetStorageFull sets the EnableKeyReuseOnNtTokenKeysetStorageFull field's value. -func (s *EnrollmentFlagsV2) SetEnableKeyReuseOnNtTokenKeysetStorageFull(v bool) *EnrollmentFlagsV2 { - s.EnableKeyReuseOnNtTokenKeysetStorageFull = &v - return s -} - -// SetIncludeSymmetricAlgorithms sets the IncludeSymmetricAlgorithms field's value. -func (s *EnrollmentFlagsV2) SetIncludeSymmetricAlgorithms(v bool) *EnrollmentFlagsV2 { - s.IncludeSymmetricAlgorithms = &v - return s -} - -// SetNoSecurityExtension sets the NoSecurityExtension field's value. -func (s *EnrollmentFlagsV2) SetNoSecurityExtension(v bool) *EnrollmentFlagsV2 { - s.NoSecurityExtension = &v - return s -} - -// SetRemoveInvalidCertificateFromPersonalStore sets the RemoveInvalidCertificateFromPersonalStore field's value. -func (s *EnrollmentFlagsV2) SetRemoveInvalidCertificateFromPersonalStore(v bool) *EnrollmentFlagsV2 { - s.RemoveInvalidCertificateFromPersonalStore = &v - return s -} - -// SetUserInteractionRequired sets the UserInteractionRequired field's value. -func (s *EnrollmentFlagsV2) SetUserInteractionRequired(v bool) *EnrollmentFlagsV2 { - s.UserInteractionRequired = &v - return s -} - -// Template configurations for v3 template schema. -type EnrollmentFlagsV3 struct { - _ struct{} `type:"structure"` - - // Allow renewal using the same key. - EnableKeyReuseOnNtTokenKeysetStorageFull *bool `type:"boolean"` - - // Include symmetric algorithms allowed by the subject. - IncludeSymmetricAlgorithms *bool `type:"boolean"` - - // This flag instructs the CA to not include the security extension szOID_NTDS_CA_SECURITY_EXT - // (OID:1.3.6.1.4.1.311.25.2), as specified in [MS-WCCE] sections 2.2.2.7.7.4 - // and 3.2.2.6.2.1.4.5.9, in the issued certificate. This addresses a Windows - // Kerberos elevation-of-privilege vulnerability. - NoSecurityExtension *bool `type:"boolean"` - - // Delete expired or revoked certificates instead of archiving them. - RemoveInvalidCertificateFromPersonalStore *bool `type:"boolean"` - - // Require user interaction when the subject is enrolled and the private key - // associated with the certificate is used. - UserInteractionRequired *bool `type:"boolean"` -} - -// 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 EnrollmentFlagsV3) 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 EnrollmentFlagsV3) GoString() string { - return s.String() -} - -// SetEnableKeyReuseOnNtTokenKeysetStorageFull sets the EnableKeyReuseOnNtTokenKeysetStorageFull field's value. -func (s *EnrollmentFlagsV3) SetEnableKeyReuseOnNtTokenKeysetStorageFull(v bool) *EnrollmentFlagsV3 { - s.EnableKeyReuseOnNtTokenKeysetStorageFull = &v - return s -} - -// SetIncludeSymmetricAlgorithms sets the IncludeSymmetricAlgorithms field's value. -func (s *EnrollmentFlagsV3) SetIncludeSymmetricAlgorithms(v bool) *EnrollmentFlagsV3 { - s.IncludeSymmetricAlgorithms = &v - return s -} - -// SetNoSecurityExtension sets the NoSecurityExtension field's value. -func (s *EnrollmentFlagsV3) SetNoSecurityExtension(v bool) *EnrollmentFlagsV3 { - s.NoSecurityExtension = &v - return s -} - -// SetRemoveInvalidCertificateFromPersonalStore sets the RemoveInvalidCertificateFromPersonalStore field's value. -func (s *EnrollmentFlagsV3) SetRemoveInvalidCertificateFromPersonalStore(v bool) *EnrollmentFlagsV3 { - s.RemoveInvalidCertificateFromPersonalStore = &v - return s -} - -// SetUserInteractionRequired sets the UserInteractionRequired field's value. -func (s *EnrollmentFlagsV3) SetUserInteractionRequired(v bool) *EnrollmentFlagsV3 { - s.UserInteractionRequired = &v - return s -} - -// Template configurations for v4 template schema. -type EnrollmentFlagsV4 struct { - _ struct{} `type:"structure"` - - // Allow renewal using the same key. - EnableKeyReuseOnNtTokenKeysetStorageFull *bool `type:"boolean"` - - // Include symmetric algorithms allowed by the subject. - IncludeSymmetricAlgorithms *bool `type:"boolean"` - - // This flag instructs the CA to not include the security extension szOID_NTDS_CA_SECURITY_EXT - // (OID:1.3.6.1.4.1.311.25.2), as specified in [MS-WCCE] sections 2.2.2.7.7.4 - // and 3.2.2.6.2.1.4.5.9, in the issued certificate. This addresses a Windows - // Kerberos elevation-of-privilege vulnerability. - NoSecurityExtension *bool `type:"boolean"` - - // Delete expired or revoked certificates instead of archiving them. - RemoveInvalidCertificateFromPersonalStore *bool `type:"boolean"` - - // Require user interaction when the subject is enrolled and the private key - // associated with the certificate is used. - UserInteractionRequired *bool `type:"boolean"` -} - -// 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 EnrollmentFlagsV4) 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 EnrollmentFlagsV4) GoString() string { - return s.String() -} - -// SetEnableKeyReuseOnNtTokenKeysetStorageFull sets the EnableKeyReuseOnNtTokenKeysetStorageFull field's value. -func (s *EnrollmentFlagsV4) SetEnableKeyReuseOnNtTokenKeysetStorageFull(v bool) *EnrollmentFlagsV4 { - s.EnableKeyReuseOnNtTokenKeysetStorageFull = &v - return s -} - -// SetIncludeSymmetricAlgorithms sets the IncludeSymmetricAlgorithms field's value. -func (s *EnrollmentFlagsV4) SetIncludeSymmetricAlgorithms(v bool) *EnrollmentFlagsV4 { - s.IncludeSymmetricAlgorithms = &v - return s -} - -// SetNoSecurityExtension sets the NoSecurityExtension field's value. -func (s *EnrollmentFlagsV4) SetNoSecurityExtension(v bool) *EnrollmentFlagsV4 { - s.NoSecurityExtension = &v - return s -} - -// SetRemoveInvalidCertificateFromPersonalStore sets the RemoveInvalidCertificateFromPersonalStore field's value. -func (s *EnrollmentFlagsV4) SetRemoveInvalidCertificateFromPersonalStore(v bool) *EnrollmentFlagsV4 { - s.RemoveInvalidCertificateFromPersonalStore = &v - return s -} - -// SetUserInteractionRequired sets the UserInteractionRequired field's value. -func (s *EnrollmentFlagsV4) SetUserInteractionRequired(v bool) *EnrollmentFlagsV4 { - s.UserInteractionRequired = &v - return s -} - -// Certificate extensions for v2 template schema -type ExtensionsV2 struct { - _ struct{} `type:"structure"` - - // Application policies specify what the certificate is used for and its purpose. - ApplicationPolicies *ApplicationPolicies `type:"structure"` - - // The key usage extension defines the purpose (e.g., encipherment, signature, - // certificate signing) of the key contained in the certificate. - // - // KeyUsage is a required field - KeyUsage *KeyUsage `type:"structure" 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 ExtensionsV2) 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 ExtensionsV2) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExtensionsV2) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExtensionsV2"} - if s.KeyUsage == nil { - invalidParams.Add(request.NewErrParamRequired("KeyUsage")) - } - if s.ApplicationPolicies != nil { - if err := s.ApplicationPolicies.Validate(); err != nil { - invalidParams.AddNested("ApplicationPolicies", err.(request.ErrInvalidParams)) - } - } - if s.KeyUsage != nil { - if err := s.KeyUsage.Validate(); err != nil { - invalidParams.AddNested("KeyUsage", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationPolicies sets the ApplicationPolicies field's value. -func (s *ExtensionsV2) SetApplicationPolicies(v *ApplicationPolicies) *ExtensionsV2 { - s.ApplicationPolicies = v - return s -} - -// SetKeyUsage sets the KeyUsage field's value. -func (s *ExtensionsV2) SetKeyUsage(v *KeyUsage) *ExtensionsV2 { - s.KeyUsage = v - return s -} - -// Certificate extensions for v3 template schema -type ExtensionsV3 struct { - _ struct{} `type:"structure"` - - // Application policies specify what the certificate is used for and its purpose. - ApplicationPolicies *ApplicationPolicies `type:"structure"` - - // The key usage extension defines the purpose (e.g., encipherment, signature, - // certificate signing) of the key contained in the certificate. - // - // KeyUsage is a required field - KeyUsage *KeyUsage `type:"structure" 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 ExtensionsV3) 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 ExtensionsV3) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExtensionsV3) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExtensionsV3"} - if s.KeyUsage == nil { - invalidParams.Add(request.NewErrParamRequired("KeyUsage")) - } - if s.ApplicationPolicies != nil { - if err := s.ApplicationPolicies.Validate(); err != nil { - invalidParams.AddNested("ApplicationPolicies", err.(request.ErrInvalidParams)) - } - } - if s.KeyUsage != nil { - if err := s.KeyUsage.Validate(); err != nil { - invalidParams.AddNested("KeyUsage", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationPolicies sets the ApplicationPolicies field's value. -func (s *ExtensionsV3) SetApplicationPolicies(v *ApplicationPolicies) *ExtensionsV3 { - s.ApplicationPolicies = v - return s -} - -// SetKeyUsage sets the KeyUsage field's value. -func (s *ExtensionsV3) SetKeyUsage(v *KeyUsage) *ExtensionsV3 { - s.KeyUsage = v - return s -} - -// Certificate extensions for v4 template schema -type ExtensionsV4 struct { - _ struct{} `type:"structure"` - - // Application policies specify what the certificate is used for and its purpose. - ApplicationPolicies *ApplicationPolicies `type:"structure"` - - // The key usage extension defines the purpose (e.g., encipherment, signature) - // of the key contained in the certificate. - // - // KeyUsage is a required field - KeyUsage *KeyUsage `type:"structure" 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 ExtensionsV4) 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 ExtensionsV4) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExtensionsV4) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExtensionsV4"} - if s.KeyUsage == nil { - invalidParams.Add(request.NewErrParamRequired("KeyUsage")) - } - if s.ApplicationPolicies != nil { - if err := s.ApplicationPolicies.Validate(); err != nil { - invalidParams.AddNested("ApplicationPolicies", err.(request.ErrInvalidParams)) - } - } - if s.KeyUsage != nil { - if err := s.KeyUsage.Validate(); err != nil { - invalidParams.AddNested("KeyUsage", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationPolicies sets the ApplicationPolicies field's value. -func (s *ExtensionsV4) SetApplicationPolicies(v *ApplicationPolicies) *ExtensionsV4 { - s.ApplicationPolicies = v - return s -} - -// SetKeyUsage sets the KeyUsage field's value. -func (s *ExtensionsV4) SetKeyUsage(v *KeyUsage) *ExtensionsV4 { - s.KeyUsage = v - return s -} - -// General flags for v2 template schema that defines if the template is for -// a machine or a user and if the template can be issued using autoenrollment. -type GeneralFlagsV2 struct { - _ struct{} `type:"structure"` - - // Allows certificate issuance using autoenrollment. Set to TRUE to allow autoenrollment. - AutoEnrollment *bool `type:"boolean"` - - // Defines if the template is for machines or users. Set to TRUE if the template - // is for machines. Set to FALSE if the template is for users. - MachineType *bool `type:"boolean"` -} - -// 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 GeneralFlagsV2) 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 GeneralFlagsV2) GoString() string { - return s.String() -} - -// SetAutoEnrollment sets the AutoEnrollment field's value. -func (s *GeneralFlagsV2) SetAutoEnrollment(v bool) *GeneralFlagsV2 { - s.AutoEnrollment = &v - return s -} - -// SetMachineType sets the MachineType field's value. -func (s *GeneralFlagsV2) SetMachineType(v bool) *GeneralFlagsV2 { - s.MachineType = &v - return s -} - -// General flags for v3 template schema that defines if the template is for -// a machine or a user and if the template can be issued using autoenrollment. -type GeneralFlagsV3 struct { - _ struct{} `type:"structure"` - - // Allows certificate issuance using autoenrollment. Set to TRUE to allow autoenrollment. - AutoEnrollment *bool `type:"boolean"` - - // Defines if the template is for machines or users. Set to TRUE if the template - // is for machines. Set to FALSE if the template is for users - MachineType *bool `type:"boolean"` -} - -// 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 GeneralFlagsV3) 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 GeneralFlagsV3) GoString() string { - return s.String() -} - -// SetAutoEnrollment sets the AutoEnrollment field's value. -func (s *GeneralFlagsV3) SetAutoEnrollment(v bool) *GeneralFlagsV3 { - s.AutoEnrollment = &v - return s -} - -// SetMachineType sets the MachineType field's value. -func (s *GeneralFlagsV3) SetMachineType(v bool) *GeneralFlagsV3 { - s.MachineType = &v - return s -} - -// General flags for v4 template schema that defines if the template is for -// a machine or a user and if the template can be issued using autoenrollment. -type GeneralFlagsV4 struct { - _ struct{} `type:"structure"` - - // Allows certificate issuance using autoenrollment. Set to TRUE to allow autoenrollment. - AutoEnrollment *bool `type:"boolean"` - - // Defines if the template is for machines or users. Set to TRUE if the template - // is for machines. Set to FALSE if the template is for users - MachineType *bool `type:"boolean"` -} - -// 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 GeneralFlagsV4) 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 GeneralFlagsV4) GoString() string { - return s.String() -} - -// SetAutoEnrollment sets the AutoEnrollment field's value. -func (s *GeneralFlagsV4) SetAutoEnrollment(v bool) *GeneralFlagsV4 { - s.AutoEnrollment = &v - return s -} - -// SetMachineType sets the MachineType field's value. -func (s *GeneralFlagsV4) SetMachineType(v bool) *GeneralFlagsV4 { - s.MachineType = &v - return s -} - -type GetConnectorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - // - // ConnectorArn is a required field - ConnectorArn *string `location:"uri" locationName:"ConnectorArn" min:"5" 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 GetConnectorInput) 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 GetConnectorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetConnectorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetConnectorInput"} - if s.ConnectorArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectorArn")) - } - if s.ConnectorArn != nil && len(*s.ConnectorArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("ConnectorArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *GetConnectorInput) SetConnectorArn(v string) *GetConnectorInput { - s.ConnectorArn = &v - return s -} - -type GetConnectorOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains information about your connector. - Connector *Connector `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 GetConnectorOutput) 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 GetConnectorOutput) GoString() string { - return s.String() -} - -// SetConnector sets the Connector field's value. -func (s *GetConnectorOutput) SetConnector(v *Connector) *GetConnectorOutput { - s.Connector = v - return s -} - -type GetDirectoryRegistrationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - // - // DirectoryRegistrationArn is a required field - DirectoryRegistrationArn *string `location:"uri" locationName:"DirectoryRegistrationArn" min:"5" 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 GetDirectoryRegistrationInput) 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 GetDirectoryRegistrationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDirectoryRegistrationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDirectoryRegistrationInput"} - if s.DirectoryRegistrationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryRegistrationArn")) - } - if s.DirectoryRegistrationArn != nil && len(*s.DirectoryRegistrationArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("DirectoryRegistrationArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *GetDirectoryRegistrationInput) SetDirectoryRegistrationArn(v string) *GetDirectoryRegistrationInput { - s.DirectoryRegistrationArn = &v - return s -} - -type GetDirectoryRegistrationOutput struct { - _ struct{} `type:"structure"` - - // The directory registration represents the authorization of the connector - // service with a directory. - DirectoryRegistration *DirectoryRegistration `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 GetDirectoryRegistrationOutput) 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 GetDirectoryRegistrationOutput) GoString() string { - return s.String() -} - -// SetDirectoryRegistration sets the DirectoryRegistration field's value. -func (s *GetDirectoryRegistrationOutput) SetDirectoryRegistration(v *DirectoryRegistration) *GetDirectoryRegistrationOutput { - s.DirectoryRegistration = v - return s -} - -type GetServicePrincipalNameInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - // - // ConnectorArn is a required field - ConnectorArn *string `location:"uri" locationName:"ConnectorArn" min:"5" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - // - // DirectoryRegistrationArn is a required field - DirectoryRegistrationArn *string `location:"uri" locationName:"DirectoryRegistrationArn" min:"5" 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 GetServicePrincipalNameInput) 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 GetServicePrincipalNameInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetServicePrincipalNameInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetServicePrincipalNameInput"} - if s.ConnectorArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectorArn")) - } - if s.ConnectorArn != nil && len(*s.ConnectorArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("ConnectorArn", 5)) - } - if s.DirectoryRegistrationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryRegistrationArn")) - } - if s.DirectoryRegistrationArn != nil && len(*s.DirectoryRegistrationArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("DirectoryRegistrationArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *GetServicePrincipalNameInput) SetConnectorArn(v string) *GetServicePrincipalNameInput { - s.ConnectorArn = &v - return s -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *GetServicePrincipalNameInput) SetDirectoryRegistrationArn(v string) *GetServicePrincipalNameInput { - s.DirectoryRegistrationArn = &v - return s -} - -type GetServicePrincipalNameOutput struct { - _ struct{} `type:"structure"` - - // The service principal name that the connector uses to authenticate with Active - // Directory. - ServicePrincipalName *ServicePrincipalName `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 GetServicePrincipalNameOutput) 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 GetServicePrincipalNameOutput) GoString() string { - return s.String() -} - -// SetServicePrincipalName sets the ServicePrincipalName field's value. -func (s *GetServicePrincipalNameOutput) SetServicePrincipalName(v *ServicePrincipalName) *GetServicePrincipalNameOutput { - s.ServicePrincipalName = v - return s -} - -type GetTemplateGroupAccessControlEntryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Security identifier (SID) of the group object from Active Directory. The - // SID starts with "S-". - // - // GroupSecurityIdentifier is a required field - GroupSecurityIdentifier *string `location:"uri" locationName:"GroupSecurityIdentifier" min:"7" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - // - // TemplateArn is a required field - TemplateArn *string `location:"uri" locationName:"TemplateArn" min:"5" 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 GetTemplateGroupAccessControlEntryInput) 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 GetTemplateGroupAccessControlEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateGroupAccessControlEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateGroupAccessControlEntryInput"} - if s.GroupSecurityIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GroupSecurityIdentifier")) - } - if s.GroupSecurityIdentifier != nil && len(*s.GroupSecurityIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("GroupSecurityIdentifier", 7)) - } - if s.TemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateArn")) - } - if s.TemplateArn != nil && len(*s.TemplateArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("TemplateArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupSecurityIdentifier sets the GroupSecurityIdentifier field's value. -func (s *GetTemplateGroupAccessControlEntryInput) SetGroupSecurityIdentifier(v string) *GetTemplateGroupAccessControlEntryInput { - s.GroupSecurityIdentifier = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *GetTemplateGroupAccessControlEntryInput) SetTemplateArn(v string) *GetTemplateGroupAccessControlEntryInput { - s.TemplateArn = &v - return s -} - -type GetTemplateGroupAccessControlEntryOutput struct { - _ struct{} `type:"structure"` - - // An access control entry allows or denies an Active Directory group from enrolling - // and/or autoenrolling with a template. - AccessControlEntry *AccessControlEntry `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 GetTemplateGroupAccessControlEntryOutput) 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 GetTemplateGroupAccessControlEntryOutput) GoString() string { - return s.String() -} - -// SetAccessControlEntry sets the AccessControlEntry field's value. -func (s *GetTemplateGroupAccessControlEntryOutput) SetAccessControlEntry(v *AccessControlEntry) *GetTemplateGroupAccessControlEntryOutput { - s.AccessControlEntry = v - return s -} - -type GetTemplateInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - // - // TemplateArn is a required field - TemplateArn *string `location:"uri" locationName:"TemplateArn" min:"5" 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 GetTemplateInput) 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 GetTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTemplateInput"} - if s.TemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateArn")) - } - if s.TemplateArn != nil && len(*s.TemplateArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("TemplateArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *GetTemplateInput) SetTemplateArn(v string) *GetTemplateInput { - s.TemplateArn = &v - return s -} - -type GetTemplateOutput struct { - _ struct{} `type:"structure"` - - // A certificate template that the connector uses to issue certificates from - // a private CA. - Template *Template `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 GetTemplateOutput) 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 GetTemplateOutput) GoString() string { - return s.String() -} - -// SetTemplate sets the Template field's value. -func (s *GetTemplateOutput) SetTemplate(v *Template) *GetTemplateOutput { - s.Template = v - return s -} - -// The request processing has failed because of an unknown error, exception -// or failure with an internal server. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The key usage extension defines the purpose (e.g., encipherment, signature) -// of the key contained in the certificate. -type KeyUsage struct { - _ struct{} `type:"structure"` - - // Sets the key usage extension to critical. - Critical *bool `type:"boolean"` - - // The key usage flags represent the purpose (e.g., encipherment, signature) - // of the key contained in the certificate. - // - // UsageFlags is a required field - UsageFlags *KeyUsageFlags `type:"structure" 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 KeyUsage) 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 KeyUsage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KeyUsage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KeyUsage"} - if s.UsageFlags == nil { - invalidParams.Add(request.NewErrParamRequired("UsageFlags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCritical sets the Critical field's value. -func (s *KeyUsage) SetCritical(v bool) *KeyUsage { - s.Critical = &v - return s -} - -// SetUsageFlags sets the UsageFlags field's value. -func (s *KeyUsage) SetUsageFlags(v *KeyUsageFlags) *KeyUsage { - s.UsageFlags = v - return s -} - -// The key usage flags represent the purpose (e.g., encipherment, signature) -// of the key contained in the certificate. -type KeyUsageFlags struct { - _ struct{} `type:"structure"` - - // DataEncipherment is asserted when the subject public key is used for directly - // enciphering raw user data without the use of an intermediate symmetric cipher. - DataEncipherment *bool `type:"boolean"` - - // The digitalSignature is asserted when the subject public key is used for - // verifying digital signatures. - DigitalSignature *bool `type:"boolean"` - - // KeyAgreement is asserted when the subject public key is used for key agreement. - KeyAgreement *bool `type:"boolean"` - - // KeyEncipherment is asserted when the subject public key is used for enciphering - // private or secret keys, i.e., for key transport. - KeyEncipherment *bool `type:"boolean"` - - // NonRepudiation is asserted when the subject public key is used to verify - // digital signatures. - NonRepudiation *bool `type:"boolean"` -} - -// 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 KeyUsageFlags) 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 KeyUsageFlags) GoString() string { - return s.String() -} - -// SetDataEncipherment sets the DataEncipherment field's value. -func (s *KeyUsageFlags) SetDataEncipherment(v bool) *KeyUsageFlags { - s.DataEncipherment = &v - return s -} - -// SetDigitalSignature sets the DigitalSignature field's value. -func (s *KeyUsageFlags) SetDigitalSignature(v bool) *KeyUsageFlags { - s.DigitalSignature = &v - return s -} - -// SetKeyAgreement sets the KeyAgreement field's value. -func (s *KeyUsageFlags) SetKeyAgreement(v bool) *KeyUsageFlags { - s.KeyAgreement = &v - return s -} - -// SetKeyEncipherment sets the KeyEncipherment field's value. -func (s *KeyUsageFlags) SetKeyEncipherment(v bool) *KeyUsageFlags { - s.KeyEncipherment = &v - return s -} - -// SetNonRepudiation sets the NonRepudiation field's value. -func (s *KeyUsageFlags) SetNonRepudiation(v bool) *KeyUsageFlags { - s.NonRepudiation = &v - return s -} - -// The key usage property defines the purpose of the private key contained in -// the certificate. You can specify specific purposes using property flags or -// all by using property type ALL. -type KeyUsageProperty struct { - _ struct{} `type:"structure"` - - // You can specify key usage for encryption, key agreement, and signature. You - // can use property flags or property type but not both. - PropertyFlags *KeyUsagePropertyFlags `type:"structure"` - - // You can specify all key usages using property type ALL. You can use property - // type or property flags but not both. - PropertyType *string `type:"string" enum:"KeyUsagePropertyType"` -} - -// 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 KeyUsageProperty) 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 KeyUsageProperty) GoString() string { - return s.String() -} - -// SetPropertyFlags sets the PropertyFlags field's value. -func (s *KeyUsageProperty) SetPropertyFlags(v *KeyUsagePropertyFlags) *KeyUsageProperty { - s.PropertyFlags = v - return s -} - -// SetPropertyType sets the PropertyType field's value. -func (s *KeyUsageProperty) SetPropertyType(v string) *KeyUsageProperty { - s.PropertyType = &v - return s -} - -// Specifies key usage. -type KeyUsagePropertyFlags struct { - _ struct{} `type:"structure"` - - // Allows key for encryption and decryption. - Decrypt *bool `type:"boolean"` - - // Allows key exchange without encryption. - KeyAgreement *bool `type:"boolean"` - - // Allow key use for digital signature. - Sign *bool `type:"boolean"` -} - -// 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 KeyUsagePropertyFlags) 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 KeyUsagePropertyFlags) GoString() string { - return s.String() -} - -// SetDecrypt sets the Decrypt field's value. -func (s *KeyUsagePropertyFlags) SetDecrypt(v bool) *KeyUsagePropertyFlags { - s.Decrypt = &v - return s -} - -// SetKeyAgreement sets the KeyAgreement field's value. -func (s *KeyUsagePropertyFlags) SetKeyAgreement(v bool) *KeyUsagePropertyFlags { - s.KeyAgreement = &v - return s -} - -// SetSign sets the Sign field's value. -func (s *KeyUsagePropertyFlags) SetSign(v bool) *KeyUsagePropertyFlags { - s.Sign = &v - return s -} - -type ListConnectorsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Use this parameter when paginating results to specify the maximum number - // of items to return in the response on each page. If additional items exist - // beyond the number you specify, the NextToken element is sent in the response. - // Use this NextToken value in a subsequent request to retrieve additional items. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `location:"querystring" locationName:"NextToken" min:"1" 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 ListConnectorsInput) 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 ListConnectorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListConnectorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListConnectorsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListConnectorsInput) SetMaxResults(v int64) *ListConnectorsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConnectorsInput) SetNextToken(v string) *ListConnectorsInput { - s.NextToken = &v - return s -} - -type ListConnectorsOutput struct { - _ struct{} `type:"structure"` - - // Summary information about each connector you have created. - Connectors []*ConnectorSummary `type:"list"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `min:"1" 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 ListConnectorsOutput) 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 ListConnectorsOutput) GoString() string { - return s.String() -} - -// SetConnectors sets the Connectors field's value. -func (s *ListConnectorsOutput) SetConnectors(v []*ConnectorSummary) *ListConnectorsOutput { - s.Connectors = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConnectorsOutput) SetNextToken(v string) *ListConnectorsOutput { - s.NextToken = &v - return s -} - -type ListDirectoryRegistrationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Use this parameter when paginating results to specify the maximum number - // of items to return in the response on each page. If additional items exist - // beyond the number you specify, the NextToken element is sent in the response. - // Use this NextToken value in a subsequent request to retrieve additional items. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `location:"querystring" locationName:"NextToken" min:"1" 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 ListDirectoryRegistrationsInput) 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 ListDirectoryRegistrationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDirectoryRegistrationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDirectoryRegistrationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDirectoryRegistrationsInput) SetMaxResults(v int64) *ListDirectoryRegistrationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDirectoryRegistrationsInput) SetNextToken(v string) *ListDirectoryRegistrationsInput { - s.NextToken = &v - return s -} - -type ListDirectoryRegistrationsOutput struct { - _ struct{} `type:"structure"` - - // Summary information about each directory registration you have created. - DirectoryRegistrations []*DirectoryRegistrationSummary `type:"list"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `min:"1" 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 ListDirectoryRegistrationsOutput) 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 ListDirectoryRegistrationsOutput) GoString() string { - return s.String() -} - -// SetDirectoryRegistrations sets the DirectoryRegistrations field's value. -func (s *ListDirectoryRegistrationsOutput) SetDirectoryRegistrations(v []*DirectoryRegistrationSummary) *ListDirectoryRegistrationsOutput { - s.DirectoryRegistrations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDirectoryRegistrationsOutput) SetNextToken(v string) *ListDirectoryRegistrationsOutput { - s.NextToken = &v - return s -} - -type ListServicePrincipalNamesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - // - // DirectoryRegistrationArn is a required field - DirectoryRegistrationArn *string `location:"uri" locationName:"DirectoryRegistrationArn" min:"5" type:"string" required:"true"` - - // Use this parameter when paginating results to specify the maximum number - // of items to return in the response on each page. If additional items exist - // beyond the number you specify, the NextToken element is sent in the response. - // Use this NextToken value in a subsequent request to retrieve additional items. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `location:"querystring" locationName:"NextToken" min:"1" 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 ListServicePrincipalNamesInput) 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 ListServicePrincipalNamesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListServicePrincipalNamesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListServicePrincipalNamesInput"} - if s.DirectoryRegistrationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryRegistrationArn")) - } - if s.DirectoryRegistrationArn != nil && len(*s.DirectoryRegistrationArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("DirectoryRegistrationArn", 5)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *ListServicePrincipalNamesInput) SetDirectoryRegistrationArn(v string) *ListServicePrincipalNamesInput { - s.DirectoryRegistrationArn = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListServicePrincipalNamesInput) SetMaxResults(v int64) *ListServicePrincipalNamesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServicePrincipalNamesInput) SetNextToken(v string) *ListServicePrincipalNamesInput { - s.NextToken = &v - return s -} - -type ListServicePrincipalNamesOutput struct { - _ struct{} `type:"structure"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `min:"1" type:"string"` - - // The service principal name, if any, that the connector uses to authenticate - // with Active Directory. - ServicePrincipalNames []*ServicePrincipalNameSummary `type:"list"` -} - -// 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 ListServicePrincipalNamesOutput) 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 ListServicePrincipalNamesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServicePrincipalNamesOutput) SetNextToken(v string) *ListServicePrincipalNamesOutput { - s.NextToken = &v - return s -} - -// SetServicePrincipalNames sets the ServicePrincipalNames field's value. -func (s *ListServicePrincipalNamesOutput) SetServicePrincipalNames(v []*ServicePrincipalNameSummary) *ListServicePrincipalNamesOutput { - s.ServicePrincipalNames = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you created the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags, if any, that are associated with your resource. - Tags map[string]*string `type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListTemplateGroupAccessControlEntriesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Use this parameter when paginating results to specify the maximum number - // of items to return in the response on each page. If additional items exist - // beyond the number you specify, the NextToken element is sent in the response. - // Use this NextToken value in a subsequent request to retrieve additional items. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `location:"querystring" locationName:"NextToken" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - // - // TemplateArn is a required field - TemplateArn *string `location:"uri" locationName:"TemplateArn" min:"5" 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 ListTemplateGroupAccessControlEntriesInput) 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 ListTemplateGroupAccessControlEntriesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTemplateGroupAccessControlEntriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTemplateGroupAccessControlEntriesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.TemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateArn")) - } - if s.TemplateArn != nil && len(*s.TemplateArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("TemplateArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTemplateGroupAccessControlEntriesInput) SetMaxResults(v int64) *ListTemplateGroupAccessControlEntriesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplateGroupAccessControlEntriesInput) SetNextToken(v string) *ListTemplateGroupAccessControlEntriesInput { - s.NextToken = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *ListTemplateGroupAccessControlEntriesInput) SetTemplateArn(v string) *ListTemplateGroupAccessControlEntriesInput { - s.TemplateArn = &v - return s -} - -type ListTemplateGroupAccessControlEntriesOutput struct { - _ struct{} `type:"structure"` - - // An access control entry grants or denies permission to an Active Directory - // group to enroll certificates for a template. - AccessControlEntries []*AccessControlEntrySummary `type:"list"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `min:"1" 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 ListTemplateGroupAccessControlEntriesOutput) 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 ListTemplateGroupAccessControlEntriesOutput) GoString() string { - return s.String() -} - -// SetAccessControlEntries sets the AccessControlEntries field's value. -func (s *ListTemplateGroupAccessControlEntriesOutput) SetAccessControlEntries(v []*AccessControlEntrySummary) *ListTemplateGroupAccessControlEntriesOutput { - s.AccessControlEntries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplateGroupAccessControlEntriesOutput) SetNextToken(v string) *ListTemplateGroupAccessControlEntriesOutput { - s.NextToken = &v - return s -} - -type ListTemplatesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - // - // ConnectorArn is a required field - ConnectorArn *string `location:"querystring" locationName:"ConnectorArn" min:"5" type:"string" required:"true"` - - // Use this parameter when paginating results to specify the maximum number - // of items to return in the response on each page. If additional items exist - // beyond the number you specify, the NextToken element is sent in the response. - // Use this NextToken value in a subsequent request to retrieve additional items. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `location:"querystring" locationName:"NextToken" min:"1" 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 ListTemplatesInput) 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 ListTemplatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTemplatesInput"} - if s.ConnectorArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectorArn")) - } - if s.ConnectorArn != nil && len(*s.ConnectorArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("ConnectorArn", 5)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *ListTemplatesInput) SetConnectorArn(v string) *ListTemplatesInput { - s.ConnectorArn = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTemplatesInput) SetMaxResults(v int64) *ListTemplatesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplatesInput) SetNextToken(v string) *ListTemplatesInput { - s.NextToken = &v - return s -} - -type ListTemplatesOutput struct { - _ struct{} `type:"structure"` - - // Use this parameter when paginating results in a subsequent request after - // you receive a response with truncated results. Set it to the value of the - // NextToken parameter from the response you just received. - NextToken *string `min:"1" type:"string"` - - // Custom configuration templates used when issuing a certificate. - Templates []*TemplateSummary `type:"list"` -} - -// 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 ListTemplatesOutput) 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 ListTemplatesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTemplatesOutput) SetNextToken(v string) *ListTemplatesOutput { - s.NextToken = &v - return s -} - -// SetTemplates sets the Templates field's value. -func (s *ListTemplatesOutput) SetTemplates(v []*TemplateSummary) *ListTemplatesOutput { - s.Templates = v - return s -} - -// Defines the attributes of the private key. -type PrivateKeyAttributesV2 struct { - _ struct{} `type:"structure"` - - // Defines the cryptographic providers used to generate the private key. - CryptoProviders []*string `min:"1" type:"list"` - - // Defines the purpose of the private key. Set it to "KEY_EXCHANGE" or "SIGNATURE" - // value. - // - // KeySpec is a required field - KeySpec *string `type:"string" required:"true" enum:"KeySpec"` - - // Set the minimum key length of the private key. - // - // MinimalKeyLength is a required field - MinimalKeyLength *int64 `min:"1" type:"integer" 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 PrivateKeyAttributesV2) 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 PrivateKeyAttributesV2) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrivateKeyAttributesV2) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrivateKeyAttributesV2"} - if s.CryptoProviders != nil && len(s.CryptoProviders) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CryptoProviders", 1)) - } - if s.KeySpec == nil { - invalidParams.Add(request.NewErrParamRequired("KeySpec")) - } - if s.MinimalKeyLength == nil { - invalidParams.Add(request.NewErrParamRequired("MinimalKeyLength")) - } - if s.MinimalKeyLength != nil && *s.MinimalKeyLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("MinimalKeyLength", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCryptoProviders sets the CryptoProviders field's value. -func (s *PrivateKeyAttributesV2) SetCryptoProviders(v []*string) *PrivateKeyAttributesV2 { - s.CryptoProviders = v - return s -} - -// SetKeySpec sets the KeySpec field's value. -func (s *PrivateKeyAttributesV2) SetKeySpec(v string) *PrivateKeyAttributesV2 { - s.KeySpec = &v - return s -} - -// SetMinimalKeyLength sets the MinimalKeyLength field's value. -func (s *PrivateKeyAttributesV2) SetMinimalKeyLength(v int64) *PrivateKeyAttributesV2 { - s.MinimalKeyLength = &v - return s -} - -// Defines the attributes of the private key. -type PrivateKeyAttributesV3 struct { - _ struct{} `type:"structure"` - - // Defines the algorithm used to generate the private key. - // - // Algorithm is a required field - Algorithm *string `type:"string" required:"true" enum:"PrivateKeyAlgorithm"` - - // Defines the cryptographic providers used to generate the private key. - CryptoProviders []*string `min:"1" type:"list"` - - // Defines the purpose of the private key. Set it to "KEY_EXCHANGE" or "SIGNATURE" - // value. - // - // KeySpec is a required field - KeySpec *string `type:"string" required:"true" enum:"KeySpec"` - - // The key usage property defines the purpose of the private key contained in - // the certificate. You can specify specific purposes using property flags or - // all by using property type ALL. - // - // KeyUsageProperty is a required field - KeyUsageProperty *KeyUsageProperty `type:"structure" required:"true"` - - // Set the minimum key length of the private key. - // - // MinimalKeyLength is a required field - MinimalKeyLength *int64 `min:"1" type:"integer" 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 PrivateKeyAttributesV3) 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 PrivateKeyAttributesV3) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrivateKeyAttributesV3) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrivateKeyAttributesV3"} - if s.Algorithm == nil { - invalidParams.Add(request.NewErrParamRequired("Algorithm")) - } - if s.CryptoProviders != nil && len(s.CryptoProviders) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CryptoProviders", 1)) - } - if s.KeySpec == nil { - invalidParams.Add(request.NewErrParamRequired("KeySpec")) - } - if s.KeyUsageProperty == nil { - invalidParams.Add(request.NewErrParamRequired("KeyUsageProperty")) - } - if s.MinimalKeyLength == nil { - invalidParams.Add(request.NewErrParamRequired("MinimalKeyLength")) - } - if s.MinimalKeyLength != nil && *s.MinimalKeyLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("MinimalKeyLength", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlgorithm sets the Algorithm field's value. -func (s *PrivateKeyAttributesV3) SetAlgorithm(v string) *PrivateKeyAttributesV3 { - s.Algorithm = &v - return s -} - -// SetCryptoProviders sets the CryptoProviders field's value. -func (s *PrivateKeyAttributesV3) SetCryptoProviders(v []*string) *PrivateKeyAttributesV3 { - s.CryptoProviders = v - return s -} - -// SetKeySpec sets the KeySpec field's value. -func (s *PrivateKeyAttributesV3) SetKeySpec(v string) *PrivateKeyAttributesV3 { - s.KeySpec = &v - return s -} - -// SetKeyUsageProperty sets the KeyUsageProperty field's value. -func (s *PrivateKeyAttributesV3) SetKeyUsageProperty(v *KeyUsageProperty) *PrivateKeyAttributesV3 { - s.KeyUsageProperty = v - return s -} - -// SetMinimalKeyLength sets the MinimalKeyLength field's value. -func (s *PrivateKeyAttributesV3) SetMinimalKeyLength(v int64) *PrivateKeyAttributesV3 { - s.MinimalKeyLength = &v - return s -} - -// Defines the attributes of the private key. -type PrivateKeyAttributesV4 struct { - _ struct{} `type:"structure"` - - // Defines the algorithm used to generate the private key. - Algorithm *string `type:"string" enum:"PrivateKeyAlgorithm"` - - // Defines the cryptographic providers used to generate the private key. - CryptoProviders []*string `min:"1" type:"list"` - - // Defines the purpose of the private key. Set it to "KEY_EXCHANGE" or "SIGNATURE" - // value. - // - // KeySpec is a required field - KeySpec *string `type:"string" required:"true" enum:"KeySpec"` - - // The key usage property defines the purpose of the private key contained in - // the certificate. You can specify specific purposes using property flags or - // all by using property type ALL. - KeyUsageProperty *KeyUsageProperty `type:"structure"` - - // Set the minimum key length of the private key. - // - // MinimalKeyLength is a required field - MinimalKeyLength *int64 `min:"1" type:"integer" 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 PrivateKeyAttributesV4) 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 PrivateKeyAttributesV4) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrivateKeyAttributesV4) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrivateKeyAttributesV4"} - if s.CryptoProviders != nil && len(s.CryptoProviders) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CryptoProviders", 1)) - } - if s.KeySpec == nil { - invalidParams.Add(request.NewErrParamRequired("KeySpec")) - } - if s.MinimalKeyLength == nil { - invalidParams.Add(request.NewErrParamRequired("MinimalKeyLength")) - } - if s.MinimalKeyLength != nil && *s.MinimalKeyLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("MinimalKeyLength", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlgorithm sets the Algorithm field's value. -func (s *PrivateKeyAttributesV4) SetAlgorithm(v string) *PrivateKeyAttributesV4 { - s.Algorithm = &v - return s -} - -// SetCryptoProviders sets the CryptoProviders field's value. -func (s *PrivateKeyAttributesV4) SetCryptoProviders(v []*string) *PrivateKeyAttributesV4 { - s.CryptoProviders = v - return s -} - -// SetKeySpec sets the KeySpec field's value. -func (s *PrivateKeyAttributesV4) SetKeySpec(v string) *PrivateKeyAttributesV4 { - s.KeySpec = &v - return s -} - -// SetKeyUsageProperty sets the KeyUsageProperty field's value. -func (s *PrivateKeyAttributesV4) SetKeyUsageProperty(v *KeyUsageProperty) *PrivateKeyAttributesV4 { - s.KeyUsageProperty = v - return s -} - -// SetMinimalKeyLength sets the MinimalKeyLength field's value. -func (s *PrivateKeyAttributesV4) SetMinimalKeyLength(v int64) *PrivateKeyAttributesV4 { - s.MinimalKeyLength = &v - return s -} - -// Private key flags for v2 templates specify the client compatibility, if the -// private key can be exported, and if user input is required when using a private -// key. -type PrivateKeyFlagsV2 struct { - _ struct{} `type:"structure"` - - // Defines the minimum client compatibility. - // - // ClientVersion is a required field - ClientVersion *string `type:"string" required:"true" enum:"ClientCompatibilityV2"` - - // Allows the private key to be exported. - ExportableKey *bool `type:"boolean"` - - // Require user input when using the private key for enrollment. - StrongKeyProtectionRequired *bool `type:"boolean"` -} - -// 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 PrivateKeyFlagsV2) 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 PrivateKeyFlagsV2) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrivateKeyFlagsV2) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrivateKeyFlagsV2"} - if s.ClientVersion == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVersion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientVersion sets the ClientVersion field's value. -func (s *PrivateKeyFlagsV2) SetClientVersion(v string) *PrivateKeyFlagsV2 { - s.ClientVersion = &v - return s -} - -// SetExportableKey sets the ExportableKey field's value. -func (s *PrivateKeyFlagsV2) SetExportableKey(v bool) *PrivateKeyFlagsV2 { - s.ExportableKey = &v - return s -} - -// SetStrongKeyProtectionRequired sets the StrongKeyProtectionRequired field's value. -func (s *PrivateKeyFlagsV2) SetStrongKeyProtectionRequired(v bool) *PrivateKeyFlagsV2 { - s.StrongKeyProtectionRequired = &v - return s -} - -// Private key flags for v3 templates specify the client compatibility, if the -// private key can be exported, if user input is required when using a private -// key, and if an alternate signature algorithm should be used. -type PrivateKeyFlagsV3 struct { - _ struct{} `type:"structure"` - - // Defines the minimum client compatibility. - // - // ClientVersion is a required field - ClientVersion *string `type:"string" required:"true" enum:"ClientCompatibilityV3"` - - // Allows the private key to be exported. - ExportableKey *bool `type:"boolean"` - - // Reguires the PKCS #1 v2.1 signature format for certificates. You should verify - // that your CA, objects, and applications can accept this signature format. - RequireAlternateSignatureAlgorithm *bool `type:"boolean"` - - // Requirer user input when using the private key for enrollment. - StrongKeyProtectionRequired *bool `type:"boolean"` -} - -// 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 PrivateKeyFlagsV3) 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 PrivateKeyFlagsV3) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrivateKeyFlagsV3) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrivateKeyFlagsV3"} - if s.ClientVersion == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVersion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientVersion sets the ClientVersion field's value. -func (s *PrivateKeyFlagsV3) SetClientVersion(v string) *PrivateKeyFlagsV3 { - s.ClientVersion = &v - return s -} - -// SetExportableKey sets the ExportableKey field's value. -func (s *PrivateKeyFlagsV3) SetExportableKey(v bool) *PrivateKeyFlagsV3 { - s.ExportableKey = &v - return s -} - -// SetRequireAlternateSignatureAlgorithm sets the RequireAlternateSignatureAlgorithm field's value. -func (s *PrivateKeyFlagsV3) SetRequireAlternateSignatureAlgorithm(v bool) *PrivateKeyFlagsV3 { - s.RequireAlternateSignatureAlgorithm = &v - return s -} - -// SetStrongKeyProtectionRequired sets the StrongKeyProtectionRequired field's value. -func (s *PrivateKeyFlagsV3) SetStrongKeyProtectionRequired(v bool) *PrivateKeyFlagsV3 { - s.StrongKeyProtectionRequired = &v - return s -} - -// Private key flags for v4 templates specify the client compatibility, if the -// private key can be exported, if user input is required when using a private -// key, if an alternate signature algorithm should be used, and if certificates -// are renewed using the same private key. -type PrivateKeyFlagsV4 struct { - _ struct{} `type:"structure"` - - // Defines the minimum client compatibility. - // - // ClientVersion is a required field - ClientVersion *string `type:"string" required:"true" enum:"ClientCompatibilityV4"` - - // Allows the private key to be exported. - ExportableKey *bool `type:"boolean"` - - // Requires the PKCS #1 v2.1 signature format for certificates. You should verify - // that your CA, objects, and applications can accept this signature format. - RequireAlternateSignatureAlgorithm *bool `type:"boolean"` - - // Renew certificate using the same private key. - RequireSameKeyRenewal *bool `type:"boolean"` - - // Require user input when using the private key for enrollment. - StrongKeyProtectionRequired *bool `type:"boolean"` - - // Specifies the cryptographic service provider category used to generate private - // keys. Set to TRUE to use Legacy Cryptographic Service Providers and FALSE - // to use Key Storage Providers. - UseLegacyProvider *bool `type:"boolean"` -} - -// 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 PrivateKeyFlagsV4) 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 PrivateKeyFlagsV4) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrivateKeyFlagsV4) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrivateKeyFlagsV4"} - if s.ClientVersion == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVersion")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientVersion sets the ClientVersion field's value. -func (s *PrivateKeyFlagsV4) SetClientVersion(v string) *PrivateKeyFlagsV4 { - s.ClientVersion = &v - return s -} - -// SetExportableKey sets the ExportableKey field's value. -func (s *PrivateKeyFlagsV4) SetExportableKey(v bool) *PrivateKeyFlagsV4 { - s.ExportableKey = &v - return s -} - -// SetRequireAlternateSignatureAlgorithm sets the RequireAlternateSignatureAlgorithm field's value. -func (s *PrivateKeyFlagsV4) SetRequireAlternateSignatureAlgorithm(v bool) *PrivateKeyFlagsV4 { - s.RequireAlternateSignatureAlgorithm = &v - return s -} - -// SetRequireSameKeyRenewal sets the RequireSameKeyRenewal field's value. -func (s *PrivateKeyFlagsV4) SetRequireSameKeyRenewal(v bool) *PrivateKeyFlagsV4 { - s.RequireSameKeyRenewal = &v - return s -} - -// SetStrongKeyProtectionRequired sets the StrongKeyProtectionRequired field's value. -func (s *PrivateKeyFlagsV4) SetStrongKeyProtectionRequired(v bool) *PrivateKeyFlagsV4 { - s.StrongKeyProtectionRequired = &v - return s -} - -// SetUseLegacyProvider sets the UseLegacyProvider field's value. -func (s *PrivateKeyFlagsV4) SetUseLegacyProvider(v bool) *PrivateKeyFlagsV4 { - s.UseLegacyProvider = &v - return s -} - -// The operation tried to access a nonexistent resource. The resource might -// not be specified correctly, or its status might not be ACTIVE. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The identifier of the Amazon Web Services resource. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // The resource type, which can be one of Connector, Template, TemplateGroupAccessControlEntry, - // ServicePrincipalName, or DirectoryRegistration. - // - // ResourceType is a required field - ResourceType *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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The service principal name that the connector uses to authenticate with Active -// Directory. -type ServicePrincipalName struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector.html - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - ConnectorArn *string `min:"5" type:"string"` - - // The date and time that the service principal name was created. - CreatedAt *time.Time `type:"timestamp"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - DirectoryRegistrationArn *string `min:"5" type:"string"` - - // The status of a service principal name. - Status *string `type:"string" enum:"ServicePrincipalNameStatus"` - - // Additional information for the status of a service principal name if the - // status is failed. - StatusReason *string `type:"string" enum:"ServicePrincipalNameStatusReason"` - - // The date and time that the service principal name was updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 ServicePrincipalName) 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 ServicePrincipalName) GoString() string { - return s.String() -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *ServicePrincipalName) SetConnectorArn(v string) *ServicePrincipalName { - s.ConnectorArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServicePrincipalName) SetCreatedAt(v time.Time) *ServicePrincipalName { - s.CreatedAt = &v - return s -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *ServicePrincipalName) SetDirectoryRegistrationArn(v string) *ServicePrincipalName { - s.DirectoryRegistrationArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ServicePrincipalName) SetStatus(v string) *ServicePrincipalName { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *ServicePrincipalName) SetStatusReason(v string) *ServicePrincipalName { - s.StatusReason = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ServicePrincipalName) SetUpdatedAt(v time.Time) *ServicePrincipalName { - s.UpdatedAt = &v - return s -} - -// The service principal name that the connector uses to authenticate with Active -// Directory. -type ServicePrincipalNameSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - ConnectorArn *string `min:"5" type:"string"` - - // The date and time that the service principal name was created. - CreatedAt *time.Time `type:"timestamp"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateDirectoryRegistration - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateDirectoryRegistration.html). - DirectoryRegistrationArn *string `min:"5" type:"string"` - - // The status of a service principal name. - Status *string `type:"string" enum:"ServicePrincipalNameStatus"` - - // Additional information for the status of a service principal name if the - // status is failed. - StatusReason *string `type:"string" enum:"ServicePrincipalNameStatusReason"` - - // Time when the service principal name was updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 ServicePrincipalNameSummary) 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 ServicePrincipalNameSummary) GoString() string { - return s.String() -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *ServicePrincipalNameSummary) SetConnectorArn(v string) *ServicePrincipalNameSummary { - s.ConnectorArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServicePrincipalNameSummary) SetCreatedAt(v time.Time) *ServicePrincipalNameSummary { - s.CreatedAt = &v - return s -} - -// SetDirectoryRegistrationArn sets the DirectoryRegistrationArn field's value. -func (s *ServicePrincipalNameSummary) SetDirectoryRegistrationArn(v string) *ServicePrincipalNameSummary { - s.DirectoryRegistrationArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ServicePrincipalNameSummary) SetStatus(v string) *ServicePrincipalNameSummary { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *ServicePrincipalNameSummary) SetStatusReason(v string) *ServicePrincipalNameSummary { - s.StatusReason = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ServicePrincipalNameSummary) SetUpdatedAt(v time.Time) *ServicePrincipalNameSummary { - s.UpdatedAt = &v - return s -} - -// Request would cause a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The code associated with the service quota. - // - // QuotaCode is a required field - QuotaCode *string `type:"string" required:"true"` - - // The identifier of the Amazon Web Services resource. - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // The resource type, which can be one of Connector, Template, TemplateGroupAccessControlEntry, - // ServicePrincipalName, or DirectoryRegistration. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true"` - - // Identifies the originating service. - // - // ServiceCode is a required field - ServiceCode *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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information to include in the subject name and alternate subject name of -// the certificate. The subject name can be common name, directory path, DNS -// as common name, or left blank. You can optionally include email to the subject -// name for user templates. If you leave the subject name blank then you must -// set a subject alternate name. The subject alternate name (SAN) can include -// globally unique identifier (GUID), DNS, domain DNS, email, service principal -// name (SPN), and user principal name (UPN). You can leave the SAN blank. If -// you leave the SAN blank, then you must set a subject name. -type SubjectNameFlagsV2 struct { - _ struct{} `type:"structure"` - - // Include the common name in the subject name. - RequireCommonName *bool `type:"boolean"` - - // Include the directory path in the subject name. - RequireDirectoryPath *bool `type:"boolean"` - - // Include the DNS as common name in the subject name. - RequireDnsAsCn *bool `type:"boolean"` - - // Include the subject's email in the subject name. - RequireEmail *bool `type:"boolean"` - - // Include the globally unique identifier (GUID) in the subject alternate name. - SanRequireDirectoryGuid *bool `type:"boolean"` - - // Include the DNS in the subject alternate name. - SanRequireDns *bool `type:"boolean"` - - // Include the domain DNS in the subject alternate name. - SanRequireDomainDns *bool `type:"boolean"` - - // Include the subject's email in the subject alternate name. - SanRequireEmail *bool `type:"boolean"` - - // Include the service principal name (SPN) in the subject alternate name. - SanRequireSpn *bool `type:"boolean"` - - // Include the user principal name (UPN) in the subject alternate name. - SanRequireUpn *bool `type:"boolean"` -} - -// 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 SubjectNameFlagsV2) 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 SubjectNameFlagsV2) GoString() string { - return s.String() -} - -// SetRequireCommonName sets the RequireCommonName field's value. -func (s *SubjectNameFlagsV2) SetRequireCommonName(v bool) *SubjectNameFlagsV2 { - s.RequireCommonName = &v - return s -} - -// SetRequireDirectoryPath sets the RequireDirectoryPath field's value. -func (s *SubjectNameFlagsV2) SetRequireDirectoryPath(v bool) *SubjectNameFlagsV2 { - s.RequireDirectoryPath = &v - return s -} - -// SetRequireDnsAsCn sets the RequireDnsAsCn field's value. -func (s *SubjectNameFlagsV2) SetRequireDnsAsCn(v bool) *SubjectNameFlagsV2 { - s.RequireDnsAsCn = &v - return s -} - -// SetRequireEmail sets the RequireEmail field's value. -func (s *SubjectNameFlagsV2) SetRequireEmail(v bool) *SubjectNameFlagsV2 { - s.RequireEmail = &v - return s -} - -// SetSanRequireDirectoryGuid sets the SanRequireDirectoryGuid field's value. -func (s *SubjectNameFlagsV2) SetSanRequireDirectoryGuid(v bool) *SubjectNameFlagsV2 { - s.SanRequireDirectoryGuid = &v - return s -} - -// SetSanRequireDns sets the SanRequireDns field's value. -func (s *SubjectNameFlagsV2) SetSanRequireDns(v bool) *SubjectNameFlagsV2 { - s.SanRequireDns = &v - return s -} - -// SetSanRequireDomainDns sets the SanRequireDomainDns field's value. -func (s *SubjectNameFlagsV2) SetSanRequireDomainDns(v bool) *SubjectNameFlagsV2 { - s.SanRequireDomainDns = &v - return s -} - -// SetSanRequireEmail sets the SanRequireEmail field's value. -func (s *SubjectNameFlagsV2) SetSanRequireEmail(v bool) *SubjectNameFlagsV2 { - s.SanRequireEmail = &v - return s -} - -// SetSanRequireSpn sets the SanRequireSpn field's value. -func (s *SubjectNameFlagsV2) SetSanRequireSpn(v bool) *SubjectNameFlagsV2 { - s.SanRequireSpn = &v - return s -} - -// SetSanRequireUpn sets the SanRequireUpn field's value. -func (s *SubjectNameFlagsV2) SetSanRequireUpn(v bool) *SubjectNameFlagsV2 { - s.SanRequireUpn = &v - return s -} - -// Information to include in the subject name and alternate subject name of -// the certificate. The subject name can be common name, directory path, DNS -// as common name, or left blank. You can optionally include email to the subject -// name for user templates. If you leave the subject name blank then you must -// set a subject alternate name. The subject alternate name (SAN) can include -// globally unique identifier (GUID), DNS, domain DNS, email, service principal -// name (SPN), and user principal name (UPN). You can leave the SAN blank. If -// you leave the SAN blank, then you must set a subject name. -type SubjectNameFlagsV3 struct { - _ struct{} `type:"structure"` - - // Include the common name in the subject name. - RequireCommonName *bool `type:"boolean"` - - // Include the directory path in the subject name. - RequireDirectoryPath *bool `type:"boolean"` - - // Include the DNS as common name in the subject name. - RequireDnsAsCn *bool `type:"boolean"` - - // Include the subject's email in the subject name. - RequireEmail *bool `type:"boolean"` - - // Include the globally unique identifier (GUID) in the subject alternate name. - SanRequireDirectoryGuid *bool `type:"boolean"` - - // Include the DNS in the subject alternate name. - SanRequireDns *bool `type:"boolean"` - - // Include the domain DNS in the subject alternate name. - SanRequireDomainDns *bool `type:"boolean"` - - // Include the subject's email in the subject alternate name. - SanRequireEmail *bool `type:"boolean"` - - // Include the service principal name (SPN) in the subject alternate name. - SanRequireSpn *bool `type:"boolean"` - - // Include the user principal name (UPN) in the subject alternate name. - SanRequireUpn *bool `type:"boolean"` -} - -// 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 SubjectNameFlagsV3) 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 SubjectNameFlagsV3) GoString() string { - return s.String() -} - -// SetRequireCommonName sets the RequireCommonName field's value. -func (s *SubjectNameFlagsV3) SetRequireCommonName(v bool) *SubjectNameFlagsV3 { - s.RequireCommonName = &v - return s -} - -// SetRequireDirectoryPath sets the RequireDirectoryPath field's value. -func (s *SubjectNameFlagsV3) SetRequireDirectoryPath(v bool) *SubjectNameFlagsV3 { - s.RequireDirectoryPath = &v - return s -} - -// SetRequireDnsAsCn sets the RequireDnsAsCn field's value. -func (s *SubjectNameFlagsV3) SetRequireDnsAsCn(v bool) *SubjectNameFlagsV3 { - s.RequireDnsAsCn = &v - return s -} - -// SetRequireEmail sets the RequireEmail field's value. -func (s *SubjectNameFlagsV3) SetRequireEmail(v bool) *SubjectNameFlagsV3 { - s.RequireEmail = &v - return s -} - -// SetSanRequireDirectoryGuid sets the SanRequireDirectoryGuid field's value. -func (s *SubjectNameFlagsV3) SetSanRequireDirectoryGuid(v bool) *SubjectNameFlagsV3 { - s.SanRequireDirectoryGuid = &v - return s -} - -// SetSanRequireDns sets the SanRequireDns field's value. -func (s *SubjectNameFlagsV3) SetSanRequireDns(v bool) *SubjectNameFlagsV3 { - s.SanRequireDns = &v - return s -} - -// SetSanRequireDomainDns sets the SanRequireDomainDns field's value. -func (s *SubjectNameFlagsV3) SetSanRequireDomainDns(v bool) *SubjectNameFlagsV3 { - s.SanRequireDomainDns = &v - return s -} - -// SetSanRequireEmail sets the SanRequireEmail field's value. -func (s *SubjectNameFlagsV3) SetSanRequireEmail(v bool) *SubjectNameFlagsV3 { - s.SanRequireEmail = &v - return s -} - -// SetSanRequireSpn sets the SanRequireSpn field's value. -func (s *SubjectNameFlagsV3) SetSanRequireSpn(v bool) *SubjectNameFlagsV3 { - s.SanRequireSpn = &v - return s -} - -// SetSanRequireUpn sets the SanRequireUpn field's value. -func (s *SubjectNameFlagsV3) SetSanRequireUpn(v bool) *SubjectNameFlagsV3 { - s.SanRequireUpn = &v - return s -} - -// Information to include in the subject name and alternate subject name of -// the certificate. The subject name can be common name, directory path, DNS -// as common name, or left blank. You can optionally include email to the subject -// name for user templates. If you leave the subject name blank then you must -// set a subject alternate name. The subject alternate name (SAN) can include -// globally unique identifier (GUID), DNS, domain DNS, email, service principal -// name (SPN), and user principal name (UPN). You can leave the SAN blank. If -// you leave the SAN blank, then you must set a subject name. -type SubjectNameFlagsV4 struct { - _ struct{} `type:"structure"` - - // Include the common name in the subject name. - RequireCommonName *bool `type:"boolean"` - - // Include the directory path in the subject name. - RequireDirectoryPath *bool `type:"boolean"` - - // Include the DNS as common name in the subject name. - RequireDnsAsCn *bool `type:"boolean"` - - // Include the subject's email in the subject name. - RequireEmail *bool `type:"boolean"` - - // Include the globally unique identifier (GUID) in the subject alternate name. - SanRequireDirectoryGuid *bool `type:"boolean"` - - // Include the DNS in the subject alternate name. - SanRequireDns *bool `type:"boolean"` - - // Include the domain DNS in the subject alternate name. - SanRequireDomainDns *bool `type:"boolean"` - - // Include the subject's email in the subject alternate name. - SanRequireEmail *bool `type:"boolean"` - - // Include the service principal name (SPN) in the subject alternate name. - SanRequireSpn *bool `type:"boolean"` - - // Include the user principal name (UPN) in the subject alternate name. - SanRequireUpn *bool `type:"boolean"` -} - -// 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 SubjectNameFlagsV4) 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 SubjectNameFlagsV4) GoString() string { - return s.String() -} - -// SetRequireCommonName sets the RequireCommonName field's value. -func (s *SubjectNameFlagsV4) SetRequireCommonName(v bool) *SubjectNameFlagsV4 { - s.RequireCommonName = &v - return s -} - -// SetRequireDirectoryPath sets the RequireDirectoryPath field's value. -func (s *SubjectNameFlagsV4) SetRequireDirectoryPath(v bool) *SubjectNameFlagsV4 { - s.RequireDirectoryPath = &v - return s -} - -// SetRequireDnsAsCn sets the RequireDnsAsCn field's value. -func (s *SubjectNameFlagsV4) SetRequireDnsAsCn(v bool) *SubjectNameFlagsV4 { - s.RequireDnsAsCn = &v - return s -} - -// SetRequireEmail sets the RequireEmail field's value. -func (s *SubjectNameFlagsV4) SetRequireEmail(v bool) *SubjectNameFlagsV4 { - s.RequireEmail = &v - return s -} - -// SetSanRequireDirectoryGuid sets the SanRequireDirectoryGuid field's value. -func (s *SubjectNameFlagsV4) SetSanRequireDirectoryGuid(v bool) *SubjectNameFlagsV4 { - s.SanRequireDirectoryGuid = &v - return s -} - -// SetSanRequireDns sets the SanRequireDns field's value. -func (s *SubjectNameFlagsV4) SetSanRequireDns(v bool) *SubjectNameFlagsV4 { - s.SanRequireDns = &v - return s -} - -// SetSanRequireDomainDns sets the SanRequireDomainDns field's value. -func (s *SubjectNameFlagsV4) SetSanRequireDomainDns(v bool) *SubjectNameFlagsV4 { - s.SanRequireDomainDns = &v - return s -} - -// SetSanRequireEmail sets the SanRequireEmail field's value. -func (s *SubjectNameFlagsV4) SetSanRequireEmail(v bool) *SubjectNameFlagsV4 { - s.SanRequireEmail = &v - return s -} - -// SetSanRequireSpn sets the SanRequireSpn field's value. -func (s *SubjectNameFlagsV4) SetSanRequireSpn(v bool) *SubjectNameFlagsV4 { - s.SanRequireSpn = &v - return s -} - -// SetSanRequireUpn sets the SanRequireUpn field's value. -func (s *SubjectNameFlagsV4) SetSanRequireUpn(v bool) *SubjectNameFlagsV4 { - s.SanRequireUpn = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you created the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - - // Metadata assigned to a directory registration consisting of a key-value pair. - // - // Tags is a required field - Tags map[string]*string `type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// An Active Directory compatible certificate template. Connectors issue certificates -// against these templates based on the requestor's Active Directory group membership. -type Template struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - Arn *string `min:"5" type:"string"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - ConnectorArn *string `min:"5" type:"string"` - - // The date and time that the template was created. - CreatedAt *time.Time `type:"timestamp"` - - // Template configuration to define the information included in certificates. - // Define certificate validity and renewal periods, certificate request handling - // and enrollment options, key usage extensions, application policies, and cryptography - // settings. - Definition *TemplateDefinition `type:"structure"` - - // Name of the templates. Template names must be unique. - Name *string `min:"1" type:"string"` - - // Object identifier of a template. - ObjectIdentifier *string `min:"1" type:"string"` - - // The template schema version. Template schema versions can be v2, v3, or v4. - // The template configuration options change based on the template schema version. - PolicySchema *int64 `type:"integer"` - - // The version of the template. Template updates will increment the minor revision. - // Re-enrolling all certificate holders will increment the major revision. - Revision *TemplateRevision `type:"structure"` - - // Status of the template. Status can be creating, active, deleting, or failed. - Status *string `type:"string" enum:"TemplateStatus"` - - // The date and time that the template was updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 Template) 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 Template) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Template) SetArn(v string) *Template { - s.Arn = &v - return s -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *Template) SetConnectorArn(v string) *Template { - s.ConnectorArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Template) SetCreatedAt(v time.Time) *Template { - s.CreatedAt = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *Template) SetDefinition(v *TemplateDefinition) *Template { - s.Definition = v - return s -} - -// SetName sets the Name field's value. -func (s *Template) SetName(v string) *Template { - s.Name = &v - return s -} - -// SetObjectIdentifier sets the ObjectIdentifier field's value. -func (s *Template) SetObjectIdentifier(v string) *Template { - s.ObjectIdentifier = &v - return s -} - -// SetPolicySchema sets the PolicySchema field's value. -func (s *Template) SetPolicySchema(v int64) *Template { - s.PolicySchema = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *Template) SetRevision(v *TemplateRevision) *Template { - s.Revision = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Template) SetStatus(v string) *Template { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Template) SetUpdatedAt(v time.Time) *Template { - s.UpdatedAt = &v - return s -} - -// Template configuration to define the information included in certificates. -// Define certificate validity and renewal periods, certificate request handling -// and enrollment options, key usage extensions, application policies, and cryptography -// settings. -type TemplateDefinition struct { - _ struct{} `type:"structure"` - - // Template configuration to define the information included in certificates. - // Define certificate validity and renewal periods, certificate request handling - // and enrollment options, key usage extensions, application policies, and cryptography - // settings. - TemplateV2 *TemplateV2 `type:"structure"` - - // Template configuration to define the information included in certificates. - // Define certificate validity and renewal periods, certificate request handling - // and enrollment options, key usage extensions, application policies, and cryptography - // settings. - TemplateV3 *TemplateV3 `type:"structure"` - - // Template configuration to define the information included in certificates. - // Define certificate validity and renewal periods, certificate request handling - // and enrollment options, key usage extensions, application policies, and cryptography - // settings. - TemplateV4 *TemplateV4 `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 TemplateDefinition) 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 TemplateDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TemplateDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TemplateDefinition"} - if s.TemplateV2 != nil { - if err := s.TemplateV2.Validate(); err != nil { - invalidParams.AddNested("TemplateV2", err.(request.ErrInvalidParams)) - } - } - if s.TemplateV3 != nil { - if err := s.TemplateV3.Validate(); err != nil { - invalidParams.AddNested("TemplateV3", err.(request.ErrInvalidParams)) - } - } - if s.TemplateV4 != nil { - if err := s.TemplateV4.Validate(); err != nil { - invalidParams.AddNested("TemplateV4", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTemplateV2 sets the TemplateV2 field's value. -func (s *TemplateDefinition) SetTemplateV2(v *TemplateV2) *TemplateDefinition { - s.TemplateV2 = v - return s -} - -// SetTemplateV3 sets the TemplateV3 field's value. -func (s *TemplateDefinition) SetTemplateV3(v *TemplateV3) *TemplateDefinition { - s.TemplateV3 = v - return s -} - -// SetTemplateV4 sets the TemplateV4 field's value. -func (s *TemplateDefinition) SetTemplateV4(v *TemplateV4) *TemplateDefinition { - s.TemplateV4 = v - return s -} - -// The revision version of the template. Template updates will increment the -// minor revision. Re-enrolling all certificate holders will increment the major -// revision. -type TemplateRevision struct { - _ struct{} `type:"structure"` - - // The revision version of the template. Re-enrolling all certificate holders - // will increment the major revision. - // - // MajorRevision is a required field - MajorRevision *int64 `type:"integer" required:"true"` - - // The revision version of the template. Re-enrolling all certificate holders - // will increment the major revision. - // - // MinorRevision is a required field - MinorRevision *int64 `type:"integer" 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 TemplateRevision) 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 TemplateRevision) GoString() string { - return s.String() -} - -// SetMajorRevision sets the MajorRevision field's value. -func (s *TemplateRevision) SetMajorRevision(v int64) *TemplateRevision { - s.MajorRevision = &v - return s -} - -// SetMinorRevision sets the MinorRevision field's value. -func (s *TemplateRevision) SetMinorRevision(v int64) *TemplateRevision { - s.MinorRevision = &v - return s -} - -// An Active Directory compatible certificate template. Connectors issue certificates -// against these templates based on the requestor's Active Directory group membership. -type TemplateSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - Arn *string `min:"5" type:"string"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateConnector - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateConnector.html). - ConnectorArn *string `min:"5" type:"string"` - - // The date and time that the template was created. - CreatedAt *time.Time `type:"timestamp"` - - // Template configuration to define the information included in certificates. - // Define certificate validity and renewal periods, certificate request handling - // and enrollment options, key usage extensions, application policies, and cryptography - // settings. - Definition *TemplateDefinition `type:"structure"` - - // Name of the template. The template name must be unique. - Name *string `min:"1" type:"string"` - - // Object identifier of a template. - ObjectIdentifier *string `min:"1" type:"string"` - - // The template schema version. Template schema versions can be v2, v3, or v4. - // The template configuration options change based on the template schema version. - PolicySchema *int64 `type:"integer"` - - // The revision version of the template. Template updates will increment the - // minor revision. Re-enrolling all certificate holders will increment the major - // revision. - Revision *TemplateRevision `type:"structure"` - - // Status of the template. Status can be creating, active, deleting, or failed. - Status *string `type:"string" enum:"TemplateStatus"` - - // The date and time that the template was updated. - UpdatedAt *time.Time `type:"timestamp"` -} - -// 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 TemplateSummary) 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 TemplateSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *TemplateSummary) SetArn(v string) *TemplateSummary { - s.Arn = &v - return s -} - -// SetConnectorArn sets the ConnectorArn field's value. -func (s *TemplateSummary) SetConnectorArn(v string) *TemplateSummary { - s.ConnectorArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *TemplateSummary) SetCreatedAt(v time.Time) *TemplateSummary { - s.CreatedAt = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *TemplateSummary) SetDefinition(v *TemplateDefinition) *TemplateSummary { - s.Definition = v - return s -} - -// SetName sets the Name field's value. -func (s *TemplateSummary) SetName(v string) *TemplateSummary { - s.Name = &v - return s -} - -// SetObjectIdentifier sets the ObjectIdentifier field's value. -func (s *TemplateSummary) SetObjectIdentifier(v string) *TemplateSummary { - s.ObjectIdentifier = &v - return s -} - -// SetPolicySchema sets the PolicySchema field's value. -func (s *TemplateSummary) SetPolicySchema(v int64) *TemplateSummary { - s.PolicySchema = &v - return s -} - -// SetRevision sets the Revision field's value. -func (s *TemplateSummary) SetRevision(v *TemplateRevision) *TemplateSummary { - s.Revision = v - return s -} - -// SetStatus sets the Status field's value. -func (s *TemplateSummary) SetStatus(v string) *TemplateSummary { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *TemplateSummary) SetUpdatedAt(v time.Time) *TemplateSummary { - s.UpdatedAt = &v - return s -} - -// v2 template schema that uses Legacy Cryptographic Providers. -type TemplateV2 struct { - _ struct{} `type:"structure"` - - // Certificate validity describes the validity and renewal periods of a certificate. - // - // CertificateValidity is a required field - CertificateValidity *CertificateValidity `type:"structure" required:"true"` - - // Enrollment flags describe the enrollment settings for certificates such as - // using the existing private key and deleting expired or revoked certificates. - // - // EnrollmentFlags is a required field - EnrollmentFlags *EnrollmentFlagsV2 `type:"structure" required:"true"` - - // Extensions describe the key usage extensions and application policies for - // a template. - // - // Extensions is a required field - Extensions *ExtensionsV2 `type:"structure" required:"true"` - - // General flags describe whether the template is used for computers or users - // and if the template can be used with autoenrollment. - // - // GeneralFlags is a required field - GeneralFlags *GeneralFlagsV2 `type:"structure" required:"true"` - - // Private key attributes allow you to specify the minimal key length, key spec, - // and cryptographic providers for the private key of a certificate for v2 templates. - // V2 templates allow you to use Legacy Cryptographic Service Providers. - // - // PrivateKeyAttributes is a required field - PrivateKeyAttributes *PrivateKeyAttributesV2 `type:"structure" required:"true"` - - // Private key flags for v2 templates specify the client compatibility, if the - // private key can be exported, and if user input is required when using a private - // key. - // - // PrivateKeyFlags is a required field - PrivateKeyFlags *PrivateKeyFlagsV2 `type:"structure" required:"true"` - - // Subject name flags describe the subject name and subject alternate name that - // is included in a certificate. - // - // SubjectNameFlags is a required field - SubjectNameFlags *SubjectNameFlagsV2 `type:"structure" required:"true"` - - // List of templates in Active Directory that are superseded by this template. - SupersededTemplates []*string `min:"1" type:"list"` -} - -// 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 TemplateV2) 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 TemplateV2) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TemplateV2) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TemplateV2"} - if s.CertificateValidity == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateValidity")) - } - if s.EnrollmentFlags == nil { - invalidParams.Add(request.NewErrParamRequired("EnrollmentFlags")) - } - if s.Extensions == nil { - invalidParams.Add(request.NewErrParamRequired("Extensions")) - } - if s.GeneralFlags == nil { - invalidParams.Add(request.NewErrParamRequired("GeneralFlags")) - } - if s.PrivateKeyAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKeyAttributes")) - } - if s.PrivateKeyFlags == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKeyFlags")) - } - if s.SubjectNameFlags == nil { - invalidParams.Add(request.NewErrParamRequired("SubjectNameFlags")) - } - if s.SupersededTemplates != nil && len(s.SupersededTemplates) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SupersededTemplates", 1)) - } - if s.CertificateValidity != nil { - if err := s.CertificateValidity.Validate(); err != nil { - invalidParams.AddNested("CertificateValidity", err.(request.ErrInvalidParams)) - } - } - if s.Extensions != nil { - if err := s.Extensions.Validate(); err != nil { - invalidParams.AddNested("Extensions", err.(request.ErrInvalidParams)) - } - } - if s.PrivateKeyAttributes != nil { - if err := s.PrivateKeyAttributes.Validate(); err != nil { - invalidParams.AddNested("PrivateKeyAttributes", err.(request.ErrInvalidParams)) - } - } - if s.PrivateKeyFlags != nil { - if err := s.PrivateKeyFlags.Validate(); err != nil { - invalidParams.AddNested("PrivateKeyFlags", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateValidity sets the CertificateValidity field's value. -func (s *TemplateV2) SetCertificateValidity(v *CertificateValidity) *TemplateV2 { - s.CertificateValidity = v - return s -} - -// SetEnrollmentFlags sets the EnrollmentFlags field's value. -func (s *TemplateV2) SetEnrollmentFlags(v *EnrollmentFlagsV2) *TemplateV2 { - s.EnrollmentFlags = v - return s -} - -// SetExtensions sets the Extensions field's value. -func (s *TemplateV2) SetExtensions(v *ExtensionsV2) *TemplateV2 { - s.Extensions = v - return s -} - -// SetGeneralFlags sets the GeneralFlags field's value. -func (s *TemplateV2) SetGeneralFlags(v *GeneralFlagsV2) *TemplateV2 { - s.GeneralFlags = v - return s -} - -// SetPrivateKeyAttributes sets the PrivateKeyAttributes field's value. -func (s *TemplateV2) SetPrivateKeyAttributes(v *PrivateKeyAttributesV2) *TemplateV2 { - s.PrivateKeyAttributes = v - return s -} - -// SetPrivateKeyFlags sets the PrivateKeyFlags field's value. -func (s *TemplateV2) SetPrivateKeyFlags(v *PrivateKeyFlagsV2) *TemplateV2 { - s.PrivateKeyFlags = v - return s -} - -// SetSubjectNameFlags sets the SubjectNameFlags field's value. -func (s *TemplateV2) SetSubjectNameFlags(v *SubjectNameFlagsV2) *TemplateV2 { - s.SubjectNameFlags = v - return s -} - -// SetSupersededTemplates sets the SupersededTemplates field's value. -func (s *TemplateV2) SetSupersededTemplates(v []*string) *TemplateV2 { - s.SupersededTemplates = v - return s -} - -// v3 template schema that uses Key Storage Providers. -type TemplateV3 struct { - _ struct{} `type:"structure"` - - // Certificate validity describes the validity and renewal periods of a certificate. - // - // CertificateValidity is a required field - CertificateValidity *CertificateValidity `type:"structure" required:"true"` - - // Enrollment flags describe the enrollment settings for certificates such as - // using the existing private key and deleting expired or revoked certificates. - // - // EnrollmentFlags is a required field - EnrollmentFlags *EnrollmentFlagsV3 `type:"structure" required:"true"` - - // Extensions describe the key usage extensions and application policies for - // a template. - // - // Extensions is a required field - Extensions *ExtensionsV3 `type:"structure" required:"true"` - - // General flags describe whether the template is used for computers or users - // and if the template can be used with autoenrollment. - // - // GeneralFlags is a required field - GeneralFlags *GeneralFlagsV3 `type:"structure" required:"true"` - - // Specifies the hash algorithm used to hash the private key. - // - // HashAlgorithm is a required field - HashAlgorithm *string `type:"string" required:"true" enum:"HashAlgorithm"` - - // Private key attributes allow you to specify the algorithm, minimal key length, - // key spec, key usage, and cryptographic providers for the private key of a - // certificate for v3 templates. V3 templates allow you to use Key Storage Providers. - // - // PrivateKeyAttributes is a required field - PrivateKeyAttributes *PrivateKeyAttributesV3 `type:"structure" required:"true"` - - // Private key flags for v3 templates specify the client compatibility, if the - // private key can be exported, if user input is required when using a private - // key, and if an alternate signature algorithm should be used. - // - // PrivateKeyFlags is a required field - PrivateKeyFlags *PrivateKeyFlagsV3 `type:"structure" required:"true"` - - // Subject name flags describe the subject name and subject alternate name that - // is included in a certificate. - // - // SubjectNameFlags is a required field - SubjectNameFlags *SubjectNameFlagsV3 `type:"structure" required:"true"` - - // List of templates in Active Directory that are superseded by this template. - SupersededTemplates []*string `min:"1" type:"list"` -} - -// 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 TemplateV3) 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 TemplateV3) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TemplateV3) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TemplateV3"} - if s.CertificateValidity == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateValidity")) - } - if s.EnrollmentFlags == nil { - invalidParams.Add(request.NewErrParamRequired("EnrollmentFlags")) - } - if s.Extensions == nil { - invalidParams.Add(request.NewErrParamRequired("Extensions")) - } - if s.GeneralFlags == nil { - invalidParams.Add(request.NewErrParamRequired("GeneralFlags")) - } - if s.HashAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("HashAlgorithm")) - } - if s.PrivateKeyAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKeyAttributes")) - } - if s.PrivateKeyFlags == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKeyFlags")) - } - if s.SubjectNameFlags == nil { - invalidParams.Add(request.NewErrParamRequired("SubjectNameFlags")) - } - if s.SupersededTemplates != nil && len(s.SupersededTemplates) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SupersededTemplates", 1)) - } - if s.CertificateValidity != nil { - if err := s.CertificateValidity.Validate(); err != nil { - invalidParams.AddNested("CertificateValidity", err.(request.ErrInvalidParams)) - } - } - if s.Extensions != nil { - if err := s.Extensions.Validate(); err != nil { - invalidParams.AddNested("Extensions", err.(request.ErrInvalidParams)) - } - } - if s.PrivateKeyAttributes != nil { - if err := s.PrivateKeyAttributes.Validate(); err != nil { - invalidParams.AddNested("PrivateKeyAttributes", err.(request.ErrInvalidParams)) - } - } - if s.PrivateKeyFlags != nil { - if err := s.PrivateKeyFlags.Validate(); err != nil { - invalidParams.AddNested("PrivateKeyFlags", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateValidity sets the CertificateValidity field's value. -func (s *TemplateV3) SetCertificateValidity(v *CertificateValidity) *TemplateV3 { - s.CertificateValidity = v - return s -} - -// SetEnrollmentFlags sets the EnrollmentFlags field's value. -func (s *TemplateV3) SetEnrollmentFlags(v *EnrollmentFlagsV3) *TemplateV3 { - s.EnrollmentFlags = v - return s -} - -// SetExtensions sets the Extensions field's value. -func (s *TemplateV3) SetExtensions(v *ExtensionsV3) *TemplateV3 { - s.Extensions = v - return s -} - -// SetGeneralFlags sets the GeneralFlags field's value. -func (s *TemplateV3) SetGeneralFlags(v *GeneralFlagsV3) *TemplateV3 { - s.GeneralFlags = v - return s -} - -// SetHashAlgorithm sets the HashAlgorithm field's value. -func (s *TemplateV3) SetHashAlgorithm(v string) *TemplateV3 { - s.HashAlgorithm = &v - return s -} - -// SetPrivateKeyAttributes sets the PrivateKeyAttributes field's value. -func (s *TemplateV3) SetPrivateKeyAttributes(v *PrivateKeyAttributesV3) *TemplateV3 { - s.PrivateKeyAttributes = v - return s -} - -// SetPrivateKeyFlags sets the PrivateKeyFlags field's value. -func (s *TemplateV3) SetPrivateKeyFlags(v *PrivateKeyFlagsV3) *TemplateV3 { - s.PrivateKeyFlags = v - return s -} - -// SetSubjectNameFlags sets the SubjectNameFlags field's value. -func (s *TemplateV3) SetSubjectNameFlags(v *SubjectNameFlagsV3) *TemplateV3 { - s.SubjectNameFlags = v - return s -} - -// SetSupersededTemplates sets the SupersededTemplates field's value. -func (s *TemplateV3) SetSupersededTemplates(v []*string) *TemplateV3 { - s.SupersededTemplates = v - return s -} - -// v4 template schema that can use either Legacy Cryptographic Providers or -// Key Storage Providers. -type TemplateV4 struct { - _ struct{} `type:"structure"` - - // Certificate validity describes the validity and renewal periods of a certificate. - // - // CertificateValidity is a required field - CertificateValidity *CertificateValidity `type:"structure" required:"true"` - - // Enrollment flags describe the enrollment settings for certificates using - // the existing private key and deleting expired or revoked certificates. - // - // EnrollmentFlags is a required field - EnrollmentFlags *EnrollmentFlagsV4 `type:"structure" required:"true"` - - // Extensions describe the key usage extensions and application policies for - // a template. - // - // Extensions is a required field - Extensions *ExtensionsV4 `type:"structure" required:"true"` - - // General flags describe whether the template is used for computers or users - // and if the template can be used with autoenrollment. - // - // GeneralFlags is a required field - GeneralFlags *GeneralFlagsV4 `type:"structure" required:"true"` - - // Specifies the hash algorithm used to hash the private key. Hash algorithm - // can only be specified when using Key Storage Providers. - HashAlgorithm *string `type:"string" enum:"HashAlgorithm"` - - // Private key attributes allow you to specify the minimal key length, key spec, - // key usage, and cryptographic providers for the private key of a certificate - // for v4 templates. V4 templates allow you to use either Key Storage Providers - // or Legacy Cryptographic Service Providers. You specify the cryptography provider - // category in private key flags. - // - // PrivateKeyAttributes is a required field - PrivateKeyAttributes *PrivateKeyAttributesV4 `type:"structure" required:"true"` - - // Private key flags for v4 templates specify the client compatibility, if the - // private key can be exported, if user input is required when using a private - // key, if an alternate signature algorithm should be used, and if certificates - // are renewed using the same private key. - // - // PrivateKeyFlags is a required field - PrivateKeyFlags *PrivateKeyFlagsV4 `type:"structure" required:"true"` - - // Subject name flags describe the subject name and subject alternate name that - // is included in a certificate. - // - // SubjectNameFlags is a required field - SubjectNameFlags *SubjectNameFlagsV4 `type:"structure" required:"true"` - - // List of templates in Active Directory that are superseded by this template. - SupersededTemplates []*string `min:"1" type:"list"` -} - -// 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 TemplateV4) 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 TemplateV4) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TemplateV4) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TemplateV4"} - if s.CertificateValidity == nil { - invalidParams.Add(request.NewErrParamRequired("CertificateValidity")) - } - if s.EnrollmentFlags == nil { - invalidParams.Add(request.NewErrParamRequired("EnrollmentFlags")) - } - if s.Extensions == nil { - invalidParams.Add(request.NewErrParamRequired("Extensions")) - } - if s.GeneralFlags == nil { - invalidParams.Add(request.NewErrParamRequired("GeneralFlags")) - } - if s.PrivateKeyAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKeyAttributes")) - } - if s.PrivateKeyFlags == nil { - invalidParams.Add(request.NewErrParamRequired("PrivateKeyFlags")) - } - if s.SubjectNameFlags == nil { - invalidParams.Add(request.NewErrParamRequired("SubjectNameFlags")) - } - if s.SupersededTemplates != nil && len(s.SupersededTemplates) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SupersededTemplates", 1)) - } - if s.CertificateValidity != nil { - if err := s.CertificateValidity.Validate(); err != nil { - invalidParams.AddNested("CertificateValidity", err.(request.ErrInvalidParams)) - } - } - if s.Extensions != nil { - if err := s.Extensions.Validate(); err != nil { - invalidParams.AddNested("Extensions", err.(request.ErrInvalidParams)) - } - } - if s.PrivateKeyAttributes != nil { - if err := s.PrivateKeyAttributes.Validate(); err != nil { - invalidParams.AddNested("PrivateKeyAttributes", err.(request.ErrInvalidParams)) - } - } - if s.PrivateKeyFlags != nil { - if err := s.PrivateKeyFlags.Validate(); err != nil { - invalidParams.AddNested("PrivateKeyFlags", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCertificateValidity sets the CertificateValidity field's value. -func (s *TemplateV4) SetCertificateValidity(v *CertificateValidity) *TemplateV4 { - s.CertificateValidity = v - return s -} - -// SetEnrollmentFlags sets the EnrollmentFlags field's value. -func (s *TemplateV4) SetEnrollmentFlags(v *EnrollmentFlagsV4) *TemplateV4 { - s.EnrollmentFlags = v - return s -} - -// SetExtensions sets the Extensions field's value. -func (s *TemplateV4) SetExtensions(v *ExtensionsV4) *TemplateV4 { - s.Extensions = v - return s -} - -// SetGeneralFlags sets the GeneralFlags field's value. -func (s *TemplateV4) SetGeneralFlags(v *GeneralFlagsV4) *TemplateV4 { - s.GeneralFlags = v - return s -} - -// SetHashAlgorithm sets the HashAlgorithm field's value. -func (s *TemplateV4) SetHashAlgorithm(v string) *TemplateV4 { - s.HashAlgorithm = &v - return s -} - -// SetPrivateKeyAttributes sets the PrivateKeyAttributes field's value. -func (s *TemplateV4) SetPrivateKeyAttributes(v *PrivateKeyAttributesV4) *TemplateV4 { - s.PrivateKeyAttributes = v - return s -} - -// SetPrivateKeyFlags sets the PrivateKeyFlags field's value. -func (s *TemplateV4) SetPrivateKeyFlags(v *PrivateKeyFlagsV4) *TemplateV4 { - s.PrivateKeyFlags = v - return s -} - -// SetSubjectNameFlags sets the SubjectNameFlags field's value. -func (s *TemplateV4) SetSubjectNameFlags(v *SubjectNameFlagsV4) *TemplateV4 { - s.SubjectNameFlags = v - return s -} - -// SetSupersededTemplates sets the SupersededTemplates field's value. -func (s *TemplateV4) SetSupersededTemplates(v []*string) *TemplateV4 { - s.SupersededTemplates = v - return s -} - -// The limit on the number of requests per second was exceeded. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The code associated with the quota. - QuotaCode *string `type:"string"` - - // Identifies the originating service. - ServiceCode *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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) that was returned when you created the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - - // Specifies a list of tag keys that you want to remove from the specified resources. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateTemplateGroupAccessControlEntryInput struct { - _ struct{} `type:"structure"` - - // Allow or deny permissions for an Active Directory group to enroll or autoenroll - // certificates for a template. - AccessRights *AccessRights `type:"structure"` - - // Name of the Active Directory group. This name does not need to match the - // group name in Active Directory. - GroupDisplayName *string `type:"string"` - - // Security identifier (SID) of the group object from Active Directory. The - // SID starts with "S-". - // - // GroupSecurityIdentifier is a required field - GroupSecurityIdentifier *string `location:"uri" locationName:"GroupSecurityIdentifier" min:"7" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - // - // TemplateArn is a required field - TemplateArn *string `location:"uri" locationName:"TemplateArn" min:"5" 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 UpdateTemplateGroupAccessControlEntryInput) 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 UpdateTemplateGroupAccessControlEntryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTemplateGroupAccessControlEntryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTemplateGroupAccessControlEntryInput"} - if s.GroupSecurityIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("GroupSecurityIdentifier")) - } - if s.GroupSecurityIdentifier != nil && len(*s.GroupSecurityIdentifier) < 7 { - invalidParams.Add(request.NewErrParamMinLen("GroupSecurityIdentifier", 7)) - } - if s.TemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateArn")) - } - if s.TemplateArn != nil && len(*s.TemplateArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("TemplateArn", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessRights sets the AccessRights field's value. -func (s *UpdateTemplateGroupAccessControlEntryInput) SetAccessRights(v *AccessRights) *UpdateTemplateGroupAccessControlEntryInput { - s.AccessRights = v - return s -} - -// SetGroupDisplayName sets the GroupDisplayName field's value. -func (s *UpdateTemplateGroupAccessControlEntryInput) SetGroupDisplayName(v string) *UpdateTemplateGroupAccessControlEntryInput { - s.GroupDisplayName = &v - return s -} - -// SetGroupSecurityIdentifier sets the GroupSecurityIdentifier field's value. -func (s *UpdateTemplateGroupAccessControlEntryInput) SetGroupSecurityIdentifier(v string) *UpdateTemplateGroupAccessControlEntryInput { - s.GroupSecurityIdentifier = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *UpdateTemplateGroupAccessControlEntryInput) SetTemplateArn(v string) *UpdateTemplateGroupAccessControlEntryInput { - s.TemplateArn = &v - return s -} - -type UpdateTemplateGroupAccessControlEntryOutput 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 UpdateTemplateGroupAccessControlEntryOutput) 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 UpdateTemplateGroupAccessControlEntryOutput) GoString() string { - return s.String() -} - -type UpdateTemplateInput struct { - _ struct{} `type:"structure"` - - // Template configuration to define the information included in certificates. - // Define certificate validity and renewal periods, certificate request handling - // and enrollment options, key usage extensions, application policies, and cryptography - // settings. - Definition *TemplateDefinition `type:"structure"` - - // This setting allows the major version of a template to be increased automatically. - // All members of Active Directory groups that are allowed to enroll with a - // template will receive a new certificate issued using that template. - ReenrollAllCertificateHolders *bool `type:"boolean"` - - // The Amazon Resource Name (ARN) that was returned when you called CreateTemplate - // (https://docs.aws.amazon.com/pca-connector-ad/latest/APIReference/API_CreateTemplate.html). - // - // TemplateArn is a required field - TemplateArn *string `location:"uri" locationName:"TemplateArn" min:"5" 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 UpdateTemplateInput) 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 UpdateTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTemplateInput"} - if s.TemplateArn == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateArn")) - } - if s.TemplateArn != nil && len(*s.TemplateArn) < 5 { - invalidParams.Add(request.NewErrParamMinLen("TemplateArn", 5)) - } - if s.Definition != nil { - if err := s.Definition.Validate(); err != nil { - invalidParams.AddNested("Definition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefinition sets the Definition field's value. -func (s *UpdateTemplateInput) SetDefinition(v *TemplateDefinition) *UpdateTemplateInput { - s.Definition = v - return s -} - -// SetReenrollAllCertificateHolders sets the ReenrollAllCertificateHolders field's value. -func (s *UpdateTemplateInput) SetReenrollAllCertificateHolders(v bool) *UpdateTemplateInput { - s.ReenrollAllCertificateHolders = &v - return s -} - -// SetTemplateArn sets the TemplateArn field's value. -func (s *UpdateTemplateInput) SetTemplateArn(v string) *UpdateTemplateInput { - s.TemplateArn = &v - return s -} - -type UpdateTemplateOutput 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 UpdateTemplateOutput) 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 UpdateTemplateOutput) GoString() string { - return s.String() -} - -// An input validation error occurred. For example, invalid characters in a -// template name, or if a pagination token is invalid. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The reason for the validation error. This won't be return for every validation - // exception. - Reason *string `type:"string" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information describing the end of the validity period of the certificate. -// This parameter sets the “Not After” date for the certificate. Certificate -// validity is the period of time during which a certificate is valid. Validity -// can be expressed as an explicit date and time when the certificate expires, -// or as a span of time after issuance, stated in hours, days, months, or years. -// For more information, see Validity in RFC 5280. This value is unaffected -// when ValidityNotBefore is also specified. For example, if Validity is set -// to 20 days in the future, the certificate will expire 20 days from issuance -// time regardless of the ValidityNotBefore value. -type ValidityPeriod struct { - _ struct{} `type:"structure"` - - // The numeric value for the validity period. - // - // Period is a required field - Period *int64 `min:"1" type:"long" required:"true"` - - // The unit of time. You can select hours, days, weeks, months, and years. - // - // PeriodType is a required field - PeriodType *string `type:"string" required:"true" enum:"ValidityPeriodType"` -} - -// 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 ValidityPeriod) 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 ValidityPeriod) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidityPeriod) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidityPeriod"} - if s.Period == nil { - invalidParams.Add(request.NewErrParamRequired("Period")) - } - if s.Period != nil && *s.Period < 1 { - invalidParams.Add(request.NewErrParamMinValue("Period", 1)) - } - if s.PeriodType == nil { - invalidParams.Add(request.NewErrParamRequired("PeriodType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPeriod sets the Period field's value. -func (s *ValidityPeriod) SetPeriod(v int64) *ValidityPeriod { - s.Period = &v - return s -} - -// SetPeriodType sets the PeriodType field's value. -func (s *ValidityPeriod) SetPeriodType(v string) *ValidityPeriod { - s.PeriodType = &v - return s -} - -// Information about your VPC and security groups used with the connector. -type VpcInformation struct { - _ struct{} `type:"structure"` - - // The security groups used with the connector. You can use a maximum of 4 security - // groups with a connector. - // - // SecurityGroupIds is a required field - SecurityGroupIds []*string `min:"1" type:"list" 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 VpcInformation) 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 VpcInformation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VpcInformation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VpcInformation"} - if s.SecurityGroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityGroupIds")) - } - if s.SecurityGroupIds != nil && len(s.SecurityGroupIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroupIds", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *VpcInformation) SetSecurityGroupIds(v []*string) *VpcInformation { - s.SecurityGroupIds = v - return s -} - -const ( - // AccessRightAllow is a AccessRight enum value - AccessRightAllow = "ALLOW" - - // AccessRightDeny is a AccessRight enum value - AccessRightDeny = "DENY" -) - -// AccessRight_Values returns all elements of the AccessRight enum -func AccessRight_Values() []string { - return []string{ - AccessRightAllow, - AccessRightDeny, - } -} - -const ( - // ApplicationPolicyTypeAllApplicationPolicies is a ApplicationPolicyType enum value - ApplicationPolicyTypeAllApplicationPolicies = "ALL_APPLICATION_POLICIES" - - // ApplicationPolicyTypeAnyPurpose is a ApplicationPolicyType enum value - ApplicationPolicyTypeAnyPurpose = "ANY_PURPOSE" - - // ApplicationPolicyTypeAttestationIdentityKeyCertificate is a ApplicationPolicyType enum value - ApplicationPolicyTypeAttestationIdentityKeyCertificate = "ATTESTATION_IDENTITY_KEY_CERTIFICATE" - - // ApplicationPolicyTypeCertificateRequestAgent is a ApplicationPolicyType enum value - ApplicationPolicyTypeCertificateRequestAgent = "CERTIFICATE_REQUEST_AGENT" - - // ApplicationPolicyTypeClientAuthentication is a ApplicationPolicyType enum value - ApplicationPolicyTypeClientAuthentication = "CLIENT_AUTHENTICATION" - - // ApplicationPolicyTypeCodeSigning is a ApplicationPolicyType enum value - ApplicationPolicyTypeCodeSigning = "CODE_SIGNING" - - // ApplicationPolicyTypeCtlUsage is a ApplicationPolicyType enum value - ApplicationPolicyTypeCtlUsage = "CTL_USAGE" - - // ApplicationPolicyTypeDigitalRights is a ApplicationPolicyType enum value - ApplicationPolicyTypeDigitalRights = "DIGITAL_RIGHTS" - - // ApplicationPolicyTypeDirectoryServiceEmailReplication is a ApplicationPolicyType enum value - ApplicationPolicyTypeDirectoryServiceEmailReplication = "DIRECTORY_SERVICE_EMAIL_REPLICATION" - - // ApplicationPolicyTypeDisallowedList is a ApplicationPolicyType enum value - ApplicationPolicyTypeDisallowedList = "DISALLOWED_LIST" - - // ApplicationPolicyTypeDnsServerTrust is a ApplicationPolicyType enum value - ApplicationPolicyTypeDnsServerTrust = "DNS_SERVER_TRUST" - - // ApplicationPolicyTypeDocumentEncryption is a ApplicationPolicyType enum value - ApplicationPolicyTypeDocumentEncryption = "DOCUMENT_ENCRYPTION" - - // ApplicationPolicyTypeDocumentSigning is a ApplicationPolicyType enum value - ApplicationPolicyTypeDocumentSigning = "DOCUMENT_SIGNING" - - // ApplicationPolicyTypeDynamicCodeGenerator is a ApplicationPolicyType enum value - ApplicationPolicyTypeDynamicCodeGenerator = "DYNAMIC_CODE_GENERATOR" - - // ApplicationPolicyTypeEarlyLaunchAntimalwareDriver is a ApplicationPolicyType enum value - ApplicationPolicyTypeEarlyLaunchAntimalwareDriver = "EARLY_LAUNCH_ANTIMALWARE_DRIVER" - - // ApplicationPolicyTypeEmbeddedWindowsSystemComponentVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeEmbeddedWindowsSystemComponentVerification = "EMBEDDED_WINDOWS_SYSTEM_COMPONENT_VERIFICATION" - - // ApplicationPolicyTypeEnclave is a ApplicationPolicyType enum value - ApplicationPolicyTypeEnclave = "ENCLAVE" - - // ApplicationPolicyTypeEncryptingFileSystem is a ApplicationPolicyType enum value - ApplicationPolicyTypeEncryptingFileSystem = "ENCRYPTING_FILE_SYSTEM" - - // ApplicationPolicyTypeEndorsementKeyCertificate is a ApplicationPolicyType enum value - ApplicationPolicyTypeEndorsementKeyCertificate = "ENDORSEMENT_KEY_CERTIFICATE" - - // ApplicationPolicyTypeFileRecovery is a ApplicationPolicyType enum value - ApplicationPolicyTypeFileRecovery = "FILE_RECOVERY" - - // ApplicationPolicyTypeHalExtension is a ApplicationPolicyType enum value - ApplicationPolicyTypeHalExtension = "HAL_EXTENSION" - - // ApplicationPolicyTypeIpSecurityEndSystem is a ApplicationPolicyType enum value - ApplicationPolicyTypeIpSecurityEndSystem = "IP_SECURITY_END_SYSTEM" - - // ApplicationPolicyTypeIpSecurityIkeIntermediate is a ApplicationPolicyType enum value - ApplicationPolicyTypeIpSecurityIkeIntermediate = "IP_SECURITY_IKE_INTERMEDIATE" - - // ApplicationPolicyTypeIpSecurityTunnelTermination is a ApplicationPolicyType enum value - ApplicationPolicyTypeIpSecurityTunnelTermination = "IP_SECURITY_TUNNEL_TERMINATION" - - // ApplicationPolicyTypeIpSecurityUser is a ApplicationPolicyType enum value - ApplicationPolicyTypeIpSecurityUser = "IP_SECURITY_USER" - - // ApplicationPolicyTypeIsolatedUserMode is a ApplicationPolicyType enum value - ApplicationPolicyTypeIsolatedUserMode = "ISOLATED_USER_MODE" - - // ApplicationPolicyTypeKdcAuthentication is a ApplicationPolicyType enum value - ApplicationPolicyTypeKdcAuthentication = "KDC_AUTHENTICATION" - - // ApplicationPolicyTypeKernelModeCodeSigning is a ApplicationPolicyType enum value - ApplicationPolicyTypeKernelModeCodeSigning = "KERNEL_MODE_CODE_SIGNING" - - // ApplicationPolicyTypeKeyPackLicenses is a ApplicationPolicyType enum value - ApplicationPolicyTypeKeyPackLicenses = "KEY_PACK_LICENSES" - - // ApplicationPolicyTypeKeyRecovery is a ApplicationPolicyType enum value - ApplicationPolicyTypeKeyRecovery = "KEY_RECOVERY" - - // ApplicationPolicyTypeKeyRecoveryAgent is a ApplicationPolicyType enum value - ApplicationPolicyTypeKeyRecoveryAgent = "KEY_RECOVERY_AGENT" - - // ApplicationPolicyTypeLicenseServerVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeLicenseServerVerification = "LICENSE_SERVER_VERIFICATION" - - // ApplicationPolicyTypeLifetimeSigning is a ApplicationPolicyType enum value - ApplicationPolicyTypeLifetimeSigning = "LIFETIME_SIGNING" - - // ApplicationPolicyTypeMicrosoftPublisher is a ApplicationPolicyType enum value - ApplicationPolicyTypeMicrosoftPublisher = "MICROSOFT_PUBLISHER" - - // ApplicationPolicyTypeMicrosoftTimeStamping is a ApplicationPolicyType enum value - ApplicationPolicyTypeMicrosoftTimeStamping = "MICROSOFT_TIME_STAMPING" - - // ApplicationPolicyTypeMicrosoftTrustListSigning is a ApplicationPolicyType enum value - ApplicationPolicyTypeMicrosoftTrustListSigning = "MICROSOFT_TRUST_LIST_SIGNING" - - // ApplicationPolicyTypeOcspSigning is a ApplicationPolicyType enum value - ApplicationPolicyTypeOcspSigning = "OCSP_SIGNING" - - // ApplicationPolicyTypeOemWindowsSystemComponentVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeOemWindowsSystemComponentVerification = "OEM_WINDOWS_SYSTEM_COMPONENT_VERIFICATION" - - // ApplicationPolicyTypePlatformCertificate is a ApplicationPolicyType enum value - ApplicationPolicyTypePlatformCertificate = "PLATFORM_CERTIFICATE" - - // ApplicationPolicyTypePreviewBuildSigning is a ApplicationPolicyType enum value - ApplicationPolicyTypePreviewBuildSigning = "PREVIEW_BUILD_SIGNING" - - // ApplicationPolicyTypePrivateKeyArchival is a ApplicationPolicyType enum value - ApplicationPolicyTypePrivateKeyArchival = "PRIVATE_KEY_ARCHIVAL" - - // ApplicationPolicyTypeProtectedProcessLightVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeProtectedProcessLightVerification = "PROTECTED_PROCESS_LIGHT_VERIFICATION" - - // ApplicationPolicyTypeProtectedProcessVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeProtectedProcessVerification = "PROTECTED_PROCESS_VERIFICATION" - - // ApplicationPolicyTypeQualifiedSubordination is a ApplicationPolicyType enum value - ApplicationPolicyTypeQualifiedSubordination = "QUALIFIED_SUBORDINATION" - - // ApplicationPolicyTypeRevokedListSigner is a ApplicationPolicyType enum value - ApplicationPolicyTypeRevokedListSigner = "REVOKED_LIST_SIGNER" - - // ApplicationPolicyTypeRootProgramAutoUpdateCaRevocation is a ApplicationPolicyType enum value - ApplicationPolicyTypeRootProgramAutoUpdateCaRevocation = "ROOT_PROGRAM_AUTO_UPDATE_CA_REVOCATION" - - // ApplicationPolicyTypeRootProgramAutoUpdateEndRevocation is a ApplicationPolicyType enum value - ApplicationPolicyTypeRootProgramAutoUpdateEndRevocation = "ROOT_PROGRAM_AUTO_UPDATE_END_REVOCATION" - - // ApplicationPolicyTypeRootProgramNoOscpFailoverToCrl is a ApplicationPolicyType enum value - ApplicationPolicyTypeRootProgramNoOscpFailoverToCrl = "ROOT_PROGRAM_NO_OSCP_FAILOVER_TO_CRL" - - // ApplicationPolicyTypeRootListSigner is a ApplicationPolicyType enum value - ApplicationPolicyTypeRootListSigner = "ROOT_LIST_SIGNER" - - // ApplicationPolicyTypeSecureEmail is a ApplicationPolicyType enum value - ApplicationPolicyTypeSecureEmail = "SECURE_EMAIL" - - // ApplicationPolicyTypeServerAuthentication is a ApplicationPolicyType enum value - ApplicationPolicyTypeServerAuthentication = "SERVER_AUTHENTICATION" - - // ApplicationPolicyTypeSmartCardLogin is a ApplicationPolicyType enum value - ApplicationPolicyTypeSmartCardLogin = "SMART_CARD_LOGIN" - - // ApplicationPolicyTypeSpcEncryptedDigestRetryCount is a ApplicationPolicyType enum value - ApplicationPolicyTypeSpcEncryptedDigestRetryCount = "SPC_ENCRYPTED_DIGEST_RETRY_COUNT" - - // ApplicationPolicyTypeSpcRelaxedPeMarkerCheck is a ApplicationPolicyType enum value - ApplicationPolicyTypeSpcRelaxedPeMarkerCheck = "SPC_RELAXED_PE_MARKER_CHECK" - - // ApplicationPolicyTypeTimeStamping is a ApplicationPolicyType enum value - ApplicationPolicyTypeTimeStamping = "TIME_STAMPING" - - // ApplicationPolicyTypeWindowsHardwareDriverAttestedVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsHardwareDriverAttestedVerification = "WINDOWS_HARDWARE_DRIVER_ATTESTED_VERIFICATION" - - // ApplicationPolicyTypeWindowsHardwareDriverExtendedVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsHardwareDriverExtendedVerification = "WINDOWS_HARDWARE_DRIVER_EXTENDED_VERIFICATION" - - // ApplicationPolicyTypeWindowsHardwareDriverVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsHardwareDriverVerification = "WINDOWS_HARDWARE_DRIVER_VERIFICATION" - - // ApplicationPolicyTypeWindowsHelloRecoveryKeyEncryption is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsHelloRecoveryKeyEncryption = "WINDOWS_HELLO_RECOVERY_KEY_ENCRYPTION" - - // ApplicationPolicyTypeWindowsKitsComponent is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsKitsComponent = "WINDOWS_KITS_COMPONENT" - - // ApplicationPolicyTypeWindowsRtVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsRtVerification = "WINDOWS_RT_VERIFICATION" - - // ApplicationPolicyTypeWindowsSoftwareExtensionVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsSoftwareExtensionVerification = "WINDOWS_SOFTWARE_EXTENSION_VERIFICATION" - - // ApplicationPolicyTypeWindowsStore is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsStore = "WINDOWS_STORE" - - // ApplicationPolicyTypeWindowsSystemComponentVerification is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsSystemComponentVerification = "WINDOWS_SYSTEM_COMPONENT_VERIFICATION" - - // ApplicationPolicyTypeWindowsTcbComponent is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsTcbComponent = "WINDOWS_TCB_COMPONENT" - - // ApplicationPolicyTypeWindowsThirdPartyApplicationComponent is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsThirdPartyApplicationComponent = "WINDOWS_THIRD_PARTY_APPLICATION_COMPONENT" - - // ApplicationPolicyTypeWindowsUpdate is a ApplicationPolicyType enum value - ApplicationPolicyTypeWindowsUpdate = "WINDOWS_UPDATE" -) - -// ApplicationPolicyType_Values returns all elements of the ApplicationPolicyType enum -func ApplicationPolicyType_Values() []string { - return []string{ - ApplicationPolicyTypeAllApplicationPolicies, - ApplicationPolicyTypeAnyPurpose, - ApplicationPolicyTypeAttestationIdentityKeyCertificate, - ApplicationPolicyTypeCertificateRequestAgent, - ApplicationPolicyTypeClientAuthentication, - ApplicationPolicyTypeCodeSigning, - ApplicationPolicyTypeCtlUsage, - ApplicationPolicyTypeDigitalRights, - ApplicationPolicyTypeDirectoryServiceEmailReplication, - ApplicationPolicyTypeDisallowedList, - ApplicationPolicyTypeDnsServerTrust, - ApplicationPolicyTypeDocumentEncryption, - ApplicationPolicyTypeDocumentSigning, - ApplicationPolicyTypeDynamicCodeGenerator, - ApplicationPolicyTypeEarlyLaunchAntimalwareDriver, - ApplicationPolicyTypeEmbeddedWindowsSystemComponentVerification, - ApplicationPolicyTypeEnclave, - ApplicationPolicyTypeEncryptingFileSystem, - ApplicationPolicyTypeEndorsementKeyCertificate, - ApplicationPolicyTypeFileRecovery, - ApplicationPolicyTypeHalExtension, - ApplicationPolicyTypeIpSecurityEndSystem, - ApplicationPolicyTypeIpSecurityIkeIntermediate, - ApplicationPolicyTypeIpSecurityTunnelTermination, - ApplicationPolicyTypeIpSecurityUser, - ApplicationPolicyTypeIsolatedUserMode, - ApplicationPolicyTypeKdcAuthentication, - ApplicationPolicyTypeKernelModeCodeSigning, - ApplicationPolicyTypeKeyPackLicenses, - ApplicationPolicyTypeKeyRecovery, - ApplicationPolicyTypeKeyRecoveryAgent, - ApplicationPolicyTypeLicenseServerVerification, - ApplicationPolicyTypeLifetimeSigning, - ApplicationPolicyTypeMicrosoftPublisher, - ApplicationPolicyTypeMicrosoftTimeStamping, - ApplicationPolicyTypeMicrosoftTrustListSigning, - ApplicationPolicyTypeOcspSigning, - ApplicationPolicyTypeOemWindowsSystemComponentVerification, - ApplicationPolicyTypePlatformCertificate, - ApplicationPolicyTypePreviewBuildSigning, - ApplicationPolicyTypePrivateKeyArchival, - ApplicationPolicyTypeProtectedProcessLightVerification, - ApplicationPolicyTypeProtectedProcessVerification, - ApplicationPolicyTypeQualifiedSubordination, - ApplicationPolicyTypeRevokedListSigner, - ApplicationPolicyTypeRootProgramAutoUpdateCaRevocation, - ApplicationPolicyTypeRootProgramAutoUpdateEndRevocation, - ApplicationPolicyTypeRootProgramNoOscpFailoverToCrl, - ApplicationPolicyTypeRootListSigner, - ApplicationPolicyTypeSecureEmail, - ApplicationPolicyTypeServerAuthentication, - ApplicationPolicyTypeSmartCardLogin, - ApplicationPolicyTypeSpcEncryptedDigestRetryCount, - ApplicationPolicyTypeSpcRelaxedPeMarkerCheck, - ApplicationPolicyTypeTimeStamping, - ApplicationPolicyTypeWindowsHardwareDriverAttestedVerification, - ApplicationPolicyTypeWindowsHardwareDriverExtendedVerification, - ApplicationPolicyTypeWindowsHardwareDriverVerification, - ApplicationPolicyTypeWindowsHelloRecoveryKeyEncryption, - ApplicationPolicyTypeWindowsKitsComponent, - ApplicationPolicyTypeWindowsRtVerification, - ApplicationPolicyTypeWindowsSoftwareExtensionVerification, - ApplicationPolicyTypeWindowsStore, - ApplicationPolicyTypeWindowsSystemComponentVerification, - ApplicationPolicyTypeWindowsTcbComponent, - ApplicationPolicyTypeWindowsThirdPartyApplicationComponent, - ApplicationPolicyTypeWindowsUpdate, - } -} - -const ( - // ClientCompatibilityV2WindowsServer2003 is a ClientCompatibilityV2 enum value - ClientCompatibilityV2WindowsServer2003 = "WINDOWS_SERVER_2003" - - // ClientCompatibilityV2WindowsServer2008 is a ClientCompatibilityV2 enum value - ClientCompatibilityV2WindowsServer2008 = "WINDOWS_SERVER_2008" - - // ClientCompatibilityV2WindowsServer2008R2 is a ClientCompatibilityV2 enum value - ClientCompatibilityV2WindowsServer2008R2 = "WINDOWS_SERVER_2008_R2" - - // ClientCompatibilityV2WindowsServer2012 is a ClientCompatibilityV2 enum value - ClientCompatibilityV2WindowsServer2012 = "WINDOWS_SERVER_2012" - - // ClientCompatibilityV2WindowsServer2012R2 is a ClientCompatibilityV2 enum value - ClientCompatibilityV2WindowsServer2012R2 = "WINDOWS_SERVER_2012_R2" - - // ClientCompatibilityV2WindowsServer2016 is a ClientCompatibilityV2 enum value - ClientCompatibilityV2WindowsServer2016 = "WINDOWS_SERVER_2016" -) - -// ClientCompatibilityV2_Values returns all elements of the ClientCompatibilityV2 enum -func ClientCompatibilityV2_Values() []string { - return []string{ - ClientCompatibilityV2WindowsServer2003, - ClientCompatibilityV2WindowsServer2008, - ClientCompatibilityV2WindowsServer2008R2, - ClientCompatibilityV2WindowsServer2012, - ClientCompatibilityV2WindowsServer2012R2, - ClientCompatibilityV2WindowsServer2016, - } -} - -const ( - // ClientCompatibilityV3WindowsServer2008 is a ClientCompatibilityV3 enum value - ClientCompatibilityV3WindowsServer2008 = "WINDOWS_SERVER_2008" - - // ClientCompatibilityV3WindowsServer2008R2 is a ClientCompatibilityV3 enum value - ClientCompatibilityV3WindowsServer2008R2 = "WINDOWS_SERVER_2008_R2" - - // ClientCompatibilityV3WindowsServer2012 is a ClientCompatibilityV3 enum value - ClientCompatibilityV3WindowsServer2012 = "WINDOWS_SERVER_2012" - - // ClientCompatibilityV3WindowsServer2012R2 is a ClientCompatibilityV3 enum value - ClientCompatibilityV3WindowsServer2012R2 = "WINDOWS_SERVER_2012_R2" - - // ClientCompatibilityV3WindowsServer2016 is a ClientCompatibilityV3 enum value - ClientCompatibilityV3WindowsServer2016 = "WINDOWS_SERVER_2016" -) - -// ClientCompatibilityV3_Values returns all elements of the ClientCompatibilityV3 enum -func ClientCompatibilityV3_Values() []string { - return []string{ - ClientCompatibilityV3WindowsServer2008, - ClientCompatibilityV3WindowsServer2008R2, - ClientCompatibilityV3WindowsServer2012, - ClientCompatibilityV3WindowsServer2012R2, - ClientCompatibilityV3WindowsServer2016, - } -} - -const ( - // ClientCompatibilityV4WindowsServer2012 is a ClientCompatibilityV4 enum value - ClientCompatibilityV4WindowsServer2012 = "WINDOWS_SERVER_2012" - - // ClientCompatibilityV4WindowsServer2012R2 is a ClientCompatibilityV4 enum value - ClientCompatibilityV4WindowsServer2012R2 = "WINDOWS_SERVER_2012_R2" - - // ClientCompatibilityV4WindowsServer2016 is a ClientCompatibilityV4 enum value - ClientCompatibilityV4WindowsServer2016 = "WINDOWS_SERVER_2016" -) - -// ClientCompatibilityV4_Values returns all elements of the ClientCompatibilityV4 enum -func ClientCompatibilityV4_Values() []string { - return []string{ - ClientCompatibilityV4WindowsServer2012, - ClientCompatibilityV4WindowsServer2012R2, - ClientCompatibilityV4WindowsServer2016, - } -} - -const ( - // ConnectorStatusCreating is a ConnectorStatus enum value - ConnectorStatusCreating = "CREATING" - - // ConnectorStatusActive is a ConnectorStatus enum value - ConnectorStatusActive = "ACTIVE" - - // ConnectorStatusDeleting is a ConnectorStatus enum value - ConnectorStatusDeleting = "DELETING" - - // ConnectorStatusFailed is a ConnectorStatus enum value - ConnectorStatusFailed = "FAILED" -) - -// ConnectorStatus_Values returns all elements of the ConnectorStatus enum -func ConnectorStatus_Values() []string { - return []string{ - ConnectorStatusCreating, - ConnectorStatusActive, - ConnectorStatusDeleting, - ConnectorStatusFailed, - } -} - -const ( - // ConnectorStatusReasonDirectoryAccessDenied is a ConnectorStatusReason enum value - ConnectorStatusReasonDirectoryAccessDenied = "DIRECTORY_ACCESS_DENIED" - - // ConnectorStatusReasonInternalFailure is a ConnectorStatusReason enum value - ConnectorStatusReasonInternalFailure = "INTERNAL_FAILURE" - - // ConnectorStatusReasonPrivatecaAccessDenied is a ConnectorStatusReason enum value - ConnectorStatusReasonPrivatecaAccessDenied = "PRIVATECA_ACCESS_DENIED" - - // ConnectorStatusReasonPrivatecaResourceNotFound is a ConnectorStatusReason enum value - ConnectorStatusReasonPrivatecaResourceNotFound = "PRIVATECA_RESOURCE_NOT_FOUND" - - // ConnectorStatusReasonSecurityGroupNotInVpc is a ConnectorStatusReason enum value - ConnectorStatusReasonSecurityGroupNotInVpc = "SECURITY_GROUP_NOT_IN_VPC" - - // ConnectorStatusReasonVpcAccessDenied is a ConnectorStatusReason enum value - ConnectorStatusReasonVpcAccessDenied = "VPC_ACCESS_DENIED" - - // ConnectorStatusReasonVpcEndpointLimitExceeded is a ConnectorStatusReason enum value - ConnectorStatusReasonVpcEndpointLimitExceeded = "VPC_ENDPOINT_LIMIT_EXCEEDED" - - // ConnectorStatusReasonVpcResourceNotFound is a ConnectorStatusReason enum value - ConnectorStatusReasonVpcResourceNotFound = "VPC_RESOURCE_NOT_FOUND" -) - -// ConnectorStatusReason_Values returns all elements of the ConnectorStatusReason enum -func ConnectorStatusReason_Values() []string { - return []string{ - ConnectorStatusReasonDirectoryAccessDenied, - ConnectorStatusReasonInternalFailure, - ConnectorStatusReasonPrivatecaAccessDenied, - ConnectorStatusReasonPrivatecaResourceNotFound, - ConnectorStatusReasonSecurityGroupNotInVpc, - ConnectorStatusReasonVpcAccessDenied, - ConnectorStatusReasonVpcEndpointLimitExceeded, - ConnectorStatusReasonVpcResourceNotFound, - } -} - -const ( - // DirectoryRegistrationStatusCreating is a DirectoryRegistrationStatus enum value - DirectoryRegistrationStatusCreating = "CREATING" - - // DirectoryRegistrationStatusActive is a DirectoryRegistrationStatus enum value - DirectoryRegistrationStatusActive = "ACTIVE" - - // DirectoryRegistrationStatusDeleting is a DirectoryRegistrationStatus enum value - DirectoryRegistrationStatusDeleting = "DELETING" - - // DirectoryRegistrationStatusFailed is a DirectoryRegistrationStatus enum value - DirectoryRegistrationStatusFailed = "FAILED" -) - -// DirectoryRegistrationStatus_Values returns all elements of the DirectoryRegistrationStatus enum -func DirectoryRegistrationStatus_Values() []string { - return []string{ - DirectoryRegistrationStatusCreating, - DirectoryRegistrationStatusActive, - DirectoryRegistrationStatusDeleting, - DirectoryRegistrationStatusFailed, - } -} - -const ( - // DirectoryRegistrationStatusReasonDirectoryAccessDenied is a DirectoryRegistrationStatusReason enum value - DirectoryRegistrationStatusReasonDirectoryAccessDenied = "DIRECTORY_ACCESS_DENIED" - - // DirectoryRegistrationStatusReasonDirectoryResourceNotFound is a DirectoryRegistrationStatusReason enum value - DirectoryRegistrationStatusReasonDirectoryResourceNotFound = "DIRECTORY_RESOURCE_NOT_FOUND" - - // DirectoryRegistrationStatusReasonDirectoryNotActive is a DirectoryRegistrationStatusReason enum value - DirectoryRegistrationStatusReasonDirectoryNotActive = "DIRECTORY_NOT_ACTIVE" - - // DirectoryRegistrationStatusReasonDirectoryNotReachable is a DirectoryRegistrationStatusReason enum value - DirectoryRegistrationStatusReasonDirectoryNotReachable = "DIRECTORY_NOT_REACHABLE" - - // DirectoryRegistrationStatusReasonDirectoryTypeNotSupported is a DirectoryRegistrationStatusReason enum value - DirectoryRegistrationStatusReasonDirectoryTypeNotSupported = "DIRECTORY_TYPE_NOT_SUPPORTED" - - // DirectoryRegistrationStatusReasonInternalFailure is a DirectoryRegistrationStatusReason enum value - DirectoryRegistrationStatusReasonInternalFailure = "INTERNAL_FAILURE" -) - -// DirectoryRegistrationStatusReason_Values returns all elements of the DirectoryRegistrationStatusReason enum -func DirectoryRegistrationStatusReason_Values() []string { - return []string{ - DirectoryRegistrationStatusReasonDirectoryAccessDenied, - DirectoryRegistrationStatusReasonDirectoryResourceNotFound, - DirectoryRegistrationStatusReasonDirectoryNotActive, - DirectoryRegistrationStatusReasonDirectoryNotReachable, - DirectoryRegistrationStatusReasonDirectoryTypeNotSupported, - DirectoryRegistrationStatusReasonInternalFailure, - } -} - -const ( - // HashAlgorithmSha256 is a HashAlgorithm enum value - HashAlgorithmSha256 = "SHA256" - - // HashAlgorithmSha384 is a HashAlgorithm enum value - HashAlgorithmSha384 = "SHA384" - - // HashAlgorithmSha512 is a HashAlgorithm enum value - HashAlgorithmSha512 = "SHA512" -) - -// HashAlgorithm_Values returns all elements of the HashAlgorithm enum -func HashAlgorithm_Values() []string { - return []string{ - HashAlgorithmSha256, - HashAlgorithmSha384, - HashAlgorithmSha512, - } -} - -const ( - // KeySpecKeyExchange is a KeySpec enum value - KeySpecKeyExchange = "KEY_EXCHANGE" - - // KeySpecSignature is a KeySpec enum value - KeySpecSignature = "SIGNATURE" -) - -// KeySpec_Values returns all elements of the KeySpec enum -func KeySpec_Values() []string { - return []string{ - KeySpecKeyExchange, - KeySpecSignature, - } -} - -const ( - // KeyUsagePropertyTypeAll is a KeyUsagePropertyType enum value - KeyUsagePropertyTypeAll = "ALL" -) - -// KeyUsagePropertyType_Values returns all elements of the KeyUsagePropertyType enum -func KeyUsagePropertyType_Values() []string { - return []string{ - KeyUsagePropertyTypeAll, - } -} - -const ( - // PrivateKeyAlgorithmRsa is a PrivateKeyAlgorithm enum value - PrivateKeyAlgorithmRsa = "RSA" - - // PrivateKeyAlgorithmEcdhP256 is a PrivateKeyAlgorithm enum value - PrivateKeyAlgorithmEcdhP256 = "ECDH_P256" - - // PrivateKeyAlgorithmEcdhP384 is a PrivateKeyAlgorithm enum value - PrivateKeyAlgorithmEcdhP384 = "ECDH_P384" - - // PrivateKeyAlgorithmEcdhP521 is a PrivateKeyAlgorithm enum value - PrivateKeyAlgorithmEcdhP521 = "ECDH_P521" -) - -// PrivateKeyAlgorithm_Values returns all elements of the PrivateKeyAlgorithm enum -func PrivateKeyAlgorithm_Values() []string { - return []string{ - PrivateKeyAlgorithmRsa, - PrivateKeyAlgorithmEcdhP256, - PrivateKeyAlgorithmEcdhP384, - PrivateKeyAlgorithmEcdhP521, - } -} - -const ( - // ServicePrincipalNameStatusCreating is a ServicePrincipalNameStatus enum value - ServicePrincipalNameStatusCreating = "CREATING" - - // ServicePrincipalNameStatusActive is a ServicePrincipalNameStatus enum value - ServicePrincipalNameStatusActive = "ACTIVE" - - // ServicePrincipalNameStatusDeleting is a ServicePrincipalNameStatus enum value - ServicePrincipalNameStatusDeleting = "DELETING" - - // ServicePrincipalNameStatusFailed is a ServicePrincipalNameStatus enum value - ServicePrincipalNameStatusFailed = "FAILED" -) - -// ServicePrincipalNameStatus_Values returns all elements of the ServicePrincipalNameStatus enum -func ServicePrincipalNameStatus_Values() []string { - return []string{ - ServicePrincipalNameStatusCreating, - ServicePrincipalNameStatusActive, - ServicePrincipalNameStatusDeleting, - ServicePrincipalNameStatusFailed, - } -} - -const ( - // ServicePrincipalNameStatusReasonDirectoryAccessDenied is a ServicePrincipalNameStatusReason enum value - ServicePrincipalNameStatusReasonDirectoryAccessDenied = "DIRECTORY_ACCESS_DENIED" - - // ServicePrincipalNameStatusReasonDirectoryNotReachable is a ServicePrincipalNameStatusReason enum value - ServicePrincipalNameStatusReasonDirectoryNotReachable = "DIRECTORY_NOT_REACHABLE" - - // ServicePrincipalNameStatusReasonDirectoryResourceNotFound is a ServicePrincipalNameStatusReason enum value - ServicePrincipalNameStatusReasonDirectoryResourceNotFound = "DIRECTORY_RESOURCE_NOT_FOUND" - - // ServicePrincipalNameStatusReasonSpnExistsOnDifferentAdObject is a ServicePrincipalNameStatusReason enum value - ServicePrincipalNameStatusReasonSpnExistsOnDifferentAdObject = "SPN_EXISTS_ON_DIFFERENT_AD_OBJECT" - - // ServicePrincipalNameStatusReasonInternalFailure is a ServicePrincipalNameStatusReason enum value - ServicePrincipalNameStatusReasonInternalFailure = "INTERNAL_FAILURE" -) - -// ServicePrincipalNameStatusReason_Values returns all elements of the ServicePrincipalNameStatusReason enum -func ServicePrincipalNameStatusReason_Values() []string { - return []string{ - ServicePrincipalNameStatusReasonDirectoryAccessDenied, - ServicePrincipalNameStatusReasonDirectoryNotReachable, - ServicePrincipalNameStatusReasonDirectoryResourceNotFound, - ServicePrincipalNameStatusReasonSpnExistsOnDifferentAdObject, - ServicePrincipalNameStatusReasonInternalFailure, - } -} - -const ( - // TemplateStatusActive is a TemplateStatus enum value - TemplateStatusActive = "ACTIVE" - - // TemplateStatusDeleting is a TemplateStatus enum value - TemplateStatusDeleting = "DELETING" -) - -// TemplateStatus_Values returns all elements of the TemplateStatus enum -func TemplateStatus_Values() []string { - return []string{ - TemplateStatusActive, - TemplateStatusDeleting, - } -} - -const ( - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "FIELD_VALIDATION_FAILED" - - // ValidationExceptionReasonInvalidPermission is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidPermission = "INVALID_PERMISSION" - - // ValidationExceptionReasonInvalidState is a ValidationExceptionReason enum value - ValidationExceptionReasonInvalidState = "INVALID_STATE" - - // ValidationExceptionReasonMismatchedConnector is a ValidationExceptionReason enum value - ValidationExceptionReasonMismatchedConnector = "MISMATCHED_CONNECTOR" - - // ValidationExceptionReasonMismatchedVpc is a ValidationExceptionReason enum value - ValidationExceptionReasonMismatchedVpc = "MISMATCHED_VPC" - - // ValidationExceptionReasonNoClientToken is a ValidationExceptionReason enum value - ValidationExceptionReasonNoClientToken = "NO_CLIENT_TOKEN" - - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "UNKNOWN_OPERATION" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "OTHER" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonInvalidPermission, - ValidationExceptionReasonInvalidState, - ValidationExceptionReasonMismatchedConnector, - ValidationExceptionReasonMismatchedVpc, - ValidationExceptionReasonNoClientToken, - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonOther, - } -} - -const ( - // ValidityPeriodTypeHours is a ValidityPeriodType enum value - ValidityPeriodTypeHours = "HOURS" - - // ValidityPeriodTypeDays is a ValidityPeriodType enum value - ValidityPeriodTypeDays = "DAYS" - - // ValidityPeriodTypeWeeks is a ValidityPeriodType enum value - ValidityPeriodTypeWeeks = "WEEKS" - - // ValidityPeriodTypeMonths is a ValidityPeriodType enum value - ValidityPeriodTypeMonths = "MONTHS" - - // ValidityPeriodTypeYears is a ValidityPeriodType enum value - ValidityPeriodTypeYears = "YEARS" -) - -// ValidityPeriodType_Values returns all elements of the ValidityPeriodType enum -func ValidityPeriodType_Values() []string { - return []string{ - ValidityPeriodTypeHours, - ValidityPeriodTypeDays, - ValidityPeriodTypeWeeks, - ValidityPeriodTypeMonths, - ValidityPeriodTypeYears, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/doc.go deleted file mode 100644 index bec90a3516d5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package pcaconnectorad provides the client and types for making API -// requests to PcaConnectorAd. -// -// Amazon Web Services Private CA Connector for Active Directory creates a connector -// between Amazon Web Services Private CA and Active Directory (AD) that enables -// you to provision security certificates for AD signed by a private CA that -// you own. For more information, see Amazon Web Services Private CA Connector -// for Active Directory (https://docs.aws.amazon.com/privateca/latest/userguide/ad-connector.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/pca-connector-ad-2018-05-10 for more information on this service. -// -// See pcaconnectorad package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/pcaconnectorad/ -// -// # Using the Client -// -// To contact PcaConnectorAd with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the PcaConnectorAd client PcaConnectorAd for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/pcaconnectorad/#New -package pcaconnectorad diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/errors.go deleted file mode 100644 index 32cfbfac6d96..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/errors.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package pcaconnectorad - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You can receive this error if you attempt to create a resource share when - // you don't have the required permissions. This can be caused by insufficient - // permissions in policies attached to your Amazon Web Services Identity and - // Access Management (IAM) principal. It can also happen because of restrictions - // in place from an Amazon Web Services Organizations service control policy - // (SCP) that affects your Amazon Web Services account. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // This request cannot be completed for one of the following reasons because - // the requested resource was being concurrently modified by another request. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request processing has failed because of an unknown error, exception - // or failure with an internal server. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The operation tried to access a nonexistent resource. The resource might - // not be specified correctly, or its status might not be ACTIVE. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Request would cause a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The limit on the number of requests per second was exceeded. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // An input validation error occurred. For example, invalid characters in a - // template name, or if a pagination token is invalid. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/pcaconnectoradiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/pcaconnectoradiface/interface.go deleted file mode 100644 index e77e6698c9aa..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/pcaconnectoradiface/interface.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package pcaconnectoradiface provides an interface to enable mocking the PcaConnectorAd service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package pcaconnectoradiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad" -) - -// PcaConnectorAdAPI provides an interface to enable mocking the -// pcaconnectorad.PcaConnectorAd service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // PcaConnectorAd. -// func myFunc(svc pcaconnectoradiface.PcaConnectorAdAPI) bool { -// // Make svc.CreateConnector request -// } -// -// func main() { -// sess := session.New() -// svc := pcaconnectorad.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockPcaConnectorAdClient struct { -// pcaconnectoradiface.PcaConnectorAdAPI -// } -// func (m *mockPcaConnectorAdClient) CreateConnector(input *pcaconnectorad.CreateConnectorInput) (*pcaconnectorad.CreateConnectorOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockPcaConnectorAdClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type PcaConnectorAdAPI interface { - CreateConnector(*pcaconnectorad.CreateConnectorInput) (*pcaconnectorad.CreateConnectorOutput, error) - CreateConnectorWithContext(aws.Context, *pcaconnectorad.CreateConnectorInput, ...request.Option) (*pcaconnectorad.CreateConnectorOutput, error) - CreateConnectorRequest(*pcaconnectorad.CreateConnectorInput) (*request.Request, *pcaconnectorad.CreateConnectorOutput) - - CreateDirectoryRegistration(*pcaconnectorad.CreateDirectoryRegistrationInput) (*pcaconnectorad.CreateDirectoryRegistrationOutput, error) - CreateDirectoryRegistrationWithContext(aws.Context, *pcaconnectorad.CreateDirectoryRegistrationInput, ...request.Option) (*pcaconnectorad.CreateDirectoryRegistrationOutput, error) - CreateDirectoryRegistrationRequest(*pcaconnectorad.CreateDirectoryRegistrationInput) (*request.Request, *pcaconnectorad.CreateDirectoryRegistrationOutput) - - CreateServicePrincipalName(*pcaconnectorad.CreateServicePrincipalNameInput) (*pcaconnectorad.CreateServicePrincipalNameOutput, error) - CreateServicePrincipalNameWithContext(aws.Context, *pcaconnectorad.CreateServicePrincipalNameInput, ...request.Option) (*pcaconnectorad.CreateServicePrincipalNameOutput, error) - CreateServicePrincipalNameRequest(*pcaconnectorad.CreateServicePrincipalNameInput) (*request.Request, *pcaconnectorad.CreateServicePrincipalNameOutput) - - CreateTemplate(*pcaconnectorad.CreateTemplateInput) (*pcaconnectorad.CreateTemplateOutput, error) - CreateTemplateWithContext(aws.Context, *pcaconnectorad.CreateTemplateInput, ...request.Option) (*pcaconnectorad.CreateTemplateOutput, error) - CreateTemplateRequest(*pcaconnectorad.CreateTemplateInput) (*request.Request, *pcaconnectorad.CreateTemplateOutput) - - CreateTemplateGroupAccessControlEntry(*pcaconnectorad.CreateTemplateGroupAccessControlEntryInput) (*pcaconnectorad.CreateTemplateGroupAccessControlEntryOutput, error) - CreateTemplateGroupAccessControlEntryWithContext(aws.Context, *pcaconnectorad.CreateTemplateGroupAccessControlEntryInput, ...request.Option) (*pcaconnectorad.CreateTemplateGroupAccessControlEntryOutput, error) - CreateTemplateGroupAccessControlEntryRequest(*pcaconnectorad.CreateTemplateGroupAccessControlEntryInput) (*request.Request, *pcaconnectorad.CreateTemplateGroupAccessControlEntryOutput) - - DeleteConnector(*pcaconnectorad.DeleteConnectorInput) (*pcaconnectorad.DeleteConnectorOutput, error) - DeleteConnectorWithContext(aws.Context, *pcaconnectorad.DeleteConnectorInput, ...request.Option) (*pcaconnectorad.DeleteConnectorOutput, error) - DeleteConnectorRequest(*pcaconnectorad.DeleteConnectorInput) (*request.Request, *pcaconnectorad.DeleteConnectorOutput) - - DeleteDirectoryRegistration(*pcaconnectorad.DeleteDirectoryRegistrationInput) (*pcaconnectorad.DeleteDirectoryRegistrationOutput, error) - DeleteDirectoryRegistrationWithContext(aws.Context, *pcaconnectorad.DeleteDirectoryRegistrationInput, ...request.Option) (*pcaconnectorad.DeleteDirectoryRegistrationOutput, error) - DeleteDirectoryRegistrationRequest(*pcaconnectorad.DeleteDirectoryRegistrationInput) (*request.Request, *pcaconnectorad.DeleteDirectoryRegistrationOutput) - - DeleteServicePrincipalName(*pcaconnectorad.DeleteServicePrincipalNameInput) (*pcaconnectorad.DeleteServicePrincipalNameOutput, error) - DeleteServicePrincipalNameWithContext(aws.Context, *pcaconnectorad.DeleteServicePrincipalNameInput, ...request.Option) (*pcaconnectorad.DeleteServicePrincipalNameOutput, error) - DeleteServicePrincipalNameRequest(*pcaconnectorad.DeleteServicePrincipalNameInput) (*request.Request, *pcaconnectorad.DeleteServicePrincipalNameOutput) - - DeleteTemplate(*pcaconnectorad.DeleteTemplateInput) (*pcaconnectorad.DeleteTemplateOutput, error) - DeleteTemplateWithContext(aws.Context, *pcaconnectorad.DeleteTemplateInput, ...request.Option) (*pcaconnectorad.DeleteTemplateOutput, error) - DeleteTemplateRequest(*pcaconnectorad.DeleteTemplateInput) (*request.Request, *pcaconnectorad.DeleteTemplateOutput) - - DeleteTemplateGroupAccessControlEntry(*pcaconnectorad.DeleteTemplateGroupAccessControlEntryInput) (*pcaconnectorad.DeleteTemplateGroupAccessControlEntryOutput, error) - DeleteTemplateGroupAccessControlEntryWithContext(aws.Context, *pcaconnectorad.DeleteTemplateGroupAccessControlEntryInput, ...request.Option) (*pcaconnectorad.DeleteTemplateGroupAccessControlEntryOutput, error) - DeleteTemplateGroupAccessControlEntryRequest(*pcaconnectorad.DeleteTemplateGroupAccessControlEntryInput) (*request.Request, *pcaconnectorad.DeleteTemplateGroupAccessControlEntryOutput) - - GetConnector(*pcaconnectorad.GetConnectorInput) (*pcaconnectorad.GetConnectorOutput, error) - GetConnectorWithContext(aws.Context, *pcaconnectorad.GetConnectorInput, ...request.Option) (*pcaconnectorad.GetConnectorOutput, error) - GetConnectorRequest(*pcaconnectorad.GetConnectorInput) (*request.Request, *pcaconnectorad.GetConnectorOutput) - - GetDirectoryRegistration(*pcaconnectorad.GetDirectoryRegistrationInput) (*pcaconnectorad.GetDirectoryRegistrationOutput, error) - GetDirectoryRegistrationWithContext(aws.Context, *pcaconnectorad.GetDirectoryRegistrationInput, ...request.Option) (*pcaconnectorad.GetDirectoryRegistrationOutput, error) - GetDirectoryRegistrationRequest(*pcaconnectorad.GetDirectoryRegistrationInput) (*request.Request, *pcaconnectorad.GetDirectoryRegistrationOutput) - - GetServicePrincipalName(*pcaconnectorad.GetServicePrincipalNameInput) (*pcaconnectorad.GetServicePrincipalNameOutput, error) - GetServicePrincipalNameWithContext(aws.Context, *pcaconnectorad.GetServicePrincipalNameInput, ...request.Option) (*pcaconnectorad.GetServicePrincipalNameOutput, error) - GetServicePrincipalNameRequest(*pcaconnectorad.GetServicePrincipalNameInput) (*request.Request, *pcaconnectorad.GetServicePrincipalNameOutput) - - GetTemplate(*pcaconnectorad.GetTemplateInput) (*pcaconnectorad.GetTemplateOutput, error) - GetTemplateWithContext(aws.Context, *pcaconnectorad.GetTemplateInput, ...request.Option) (*pcaconnectorad.GetTemplateOutput, error) - GetTemplateRequest(*pcaconnectorad.GetTemplateInput) (*request.Request, *pcaconnectorad.GetTemplateOutput) - - GetTemplateGroupAccessControlEntry(*pcaconnectorad.GetTemplateGroupAccessControlEntryInput) (*pcaconnectorad.GetTemplateGroupAccessControlEntryOutput, error) - GetTemplateGroupAccessControlEntryWithContext(aws.Context, *pcaconnectorad.GetTemplateGroupAccessControlEntryInput, ...request.Option) (*pcaconnectorad.GetTemplateGroupAccessControlEntryOutput, error) - GetTemplateGroupAccessControlEntryRequest(*pcaconnectorad.GetTemplateGroupAccessControlEntryInput) (*request.Request, *pcaconnectorad.GetTemplateGroupAccessControlEntryOutput) - - ListConnectors(*pcaconnectorad.ListConnectorsInput) (*pcaconnectorad.ListConnectorsOutput, error) - ListConnectorsWithContext(aws.Context, *pcaconnectorad.ListConnectorsInput, ...request.Option) (*pcaconnectorad.ListConnectorsOutput, error) - ListConnectorsRequest(*pcaconnectorad.ListConnectorsInput) (*request.Request, *pcaconnectorad.ListConnectorsOutput) - - ListConnectorsPages(*pcaconnectorad.ListConnectorsInput, func(*pcaconnectorad.ListConnectorsOutput, bool) bool) error - ListConnectorsPagesWithContext(aws.Context, *pcaconnectorad.ListConnectorsInput, func(*pcaconnectorad.ListConnectorsOutput, bool) bool, ...request.Option) error - - ListDirectoryRegistrations(*pcaconnectorad.ListDirectoryRegistrationsInput) (*pcaconnectorad.ListDirectoryRegistrationsOutput, error) - ListDirectoryRegistrationsWithContext(aws.Context, *pcaconnectorad.ListDirectoryRegistrationsInput, ...request.Option) (*pcaconnectorad.ListDirectoryRegistrationsOutput, error) - ListDirectoryRegistrationsRequest(*pcaconnectorad.ListDirectoryRegistrationsInput) (*request.Request, *pcaconnectorad.ListDirectoryRegistrationsOutput) - - ListDirectoryRegistrationsPages(*pcaconnectorad.ListDirectoryRegistrationsInput, func(*pcaconnectorad.ListDirectoryRegistrationsOutput, bool) bool) error - ListDirectoryRegistrationsPagesWithContext(aws.Context, *pcaconnectorad.ListDirectoryRegistrationsInput, func(*pcaconnectorad.ListDirectoryRegistrationsOutput, bool) bool, ...request.Option) error - - ListServicePrincipalNames(*pcaconnectorad.ListServicePrincipalNamesInput) (*pcaconnectorad.ListServicePrincipalNamesOutput, error) - ListServicePrincipalNamesWithContext(aws.Context, *pcaconnectorad.ListServicePrincipalNamesInput, ...request.Option) (*pcaconnectorad.ListServicePrincipalNamesOutput, error) - ListServicePrincipalNamesRequest(*pcaconnectorad.ListServicePrincipalNamesInput) (*request.Request, *pcaconnectorad.ListServicePrincipalNamesOutput) - - ListServicePrincipalNamesPages(*pcaconnectorad.ListServicePrincipalNamesInput, func(*pcaconnectorad.ListServicePrincipalNamesOutput, bool) bool) error - ListServicePrincipalNamesPagesWithContext(aws.Context, *pcaconnectorad.ListServicePrincipalNamesInput, func(*pcaconnectorad.ListServicePrincipalNamesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*pcaconnectorad.ListTagsForResourceInput) (*pcaconnectorad.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *pcaconnectorad.ListTagsForResourceInput, ...request.Option) (*pcaconnectorad.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*pcaconnectorad.ListTagsForResourceInput) (*request.Request, *pcaconnectorad.ListTagsForResourceOutput) - - ListTemplateGroupAccessControlEntries(*pcaconnectorad.ListTemplateGroupAccessControlEntriesInput) (*pcaconnectorad.ListTemplateGroupAccessControlEntriesOutput, error) - ListTemplateGroupAccessControlEntriesWithContext(aws.Context, *pcaconnectorad.ListTemplateGroupAccessControlEntriesInput, ...request.Option) (*pcaconnectorad.ListTemplateGroupAccessControlEntriesOutput, error) - ListTemplateGroupAccessControlEntriesRequest(*pcaconnectorad.ListTemplateGroupAccessControlEntriesInput) (*request.Request, *pcaconnectorad.ListTemplateGroupAccessControlEntriesOutput) - - ListTemplateGroupAccessControlEntriesPages(*pcaconnectorad.ListTemplateGroupAccessControlEntriesInput, func(*pcaconnectorad.ListTemplateGroupAccessControlEntriesOutput, bool) bool) error - ListTemplateGroupAccessControlEntriesPagesWithContext(aws.Context, *pcaconnectorad.ListTemplateGroupAccessControlEntriesInput, func(*pcaconnectorad.ListTemplateGroupAccessControlEntriesOutput, bool) bool, ...request.Option) error - - ListTemplates(*pcaconnectorad.ListTemplatesInput) (*pcaconnectorad.ListTemplatesOutput, error) - ListTemplatesWithContext(aws.Context, *pcaconnectorad.ListTemplatesInput, ...request.Option) (*pcaconnectorad.ListTemplatesOutput, error) - ListTemplatesRequest(*pcaconnectorad.ListTemplatesInput) (*request.Request, *pcaconnectorad.ListTemplatesOutput) - - ListTemplatesPages(*pcaconnectorad.ListTemplatesInput, func(*pcaconnectorad.ListTemplatesOutput, bool) bool) error - ListTemplatesPagesWithContext(aws.Context, *pcaconnectorad.ListTemplatesInput, func(*pcaconnectorad.ListTemplatesOutput, bool) bool, ...request.Option) error - - TagResource(*pcaconnectorad.TagResourceInput) (*pcaconnectorad.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *pcaconnectorad.TagResourceInput, ...request.Option) (*pcaconnectorad.TagResourceOutput, error) - TagResourceRequest(*pcaconnectorad.TagResourceInput) (*request.Request, *pcaconnectorad.TagResourceOutput) - - UntagResource(*pcaconnectorad.UntagResourceInput) (*pcaconnectorad.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *pcaconnectorad.UntagResourceInput, ...request.Option) (*pcaconnectorad.UntagResourceOutput, error) - UntagResourceRequest(*pcaconnectorad.UntagResourceInput) (*request.Request, *pcaconnectorad.UntagResourceOutput) - - UpdateTemplate(*pcaconnectorad.UpdateTemplateInput) (*pcaconnectorad.UpdateTemplateOutput, error) - UpdateTemplateWithContext(aws.Context, *pcaconnectorad.UpdateTemplateInput, ...request.Option) (*pcaconnectorad.UpdateTemplateOutput, error) - UpdateTemplateRequest(*pcaconnectorad.UpdateTemplateInput) (*request.Request, *pcaconnectorad.UpdateTemplateOutput) - - UpdateTemplateGroupAccessControlEntry(*pcaconnectorad.UpdateTemplateGroupAccessControlEntryInput) (*pcaconnectorad.UpdateTemplateGroupAccessControlEntryOutput, error) - UpdateTemplateGroupAccessControlEntryWithContext(aws.Context, *pcaconnectorad.UpdateTemplateGroupAccessControlEntryInput, ...request.Option) (*pcaconnectorad.UpdateTemplateGroupAccessControlEntryOutput, error) - UpdateTemplateGroupAccessControlEntryRequest(*pcaconnectorad.UpdateTemplateGroupAccessControlEntryInput) (*request.Request, *pcaconnectorad.UpdateTemplateGroupAccessControlEntryOutput) -} - -var _ PcaConnectorAdAPI = (*pcaconnectorad.PcaConnectorAd)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/service.go deleted file mode 100644 index 161bb83642c2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pcaconnectorad/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package pcaconnectorad - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// PcaConnectorAd provides the API operation methods for making requests to -// PcaConnectorAd. See this package's package overview docs -// for details on the service. -// -// PcaConnectorAd methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type PcaConnectorAd struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Pca Connector Ad" // Name of service. - EndpointsID = "pca-connector-ad" // ID to lookup a service endpoint with. - ServiceID = "Pca Connector Ad" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the PcaConnectorAd client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a PcaConnectorAd client from just a session. -// svc := pcaconnectorad.New(mySession) -// -// // Create a PcaConnectorAd client with additional configuration -// svc := pcaconnectorad.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *PcaConnectorAd { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "pca-connector-ad" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *PcaConnectorAd { - svc := &PcaConnectorAd{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a PcaConnectorAd operation and runs any -// custom request initialization. -func (c *PcaConnectorAd) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/api.go deleted file mode 100644 index 5f69f02a23c7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/api.go +++ /dev/null @@ -1,8920 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package pipes - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreatePipe = "CreatePipe" - -// CreatePipeRequest generates a "aws/request.Request" representing the -// client's request for the CreatePipe 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 CreatePipe for more information on using the CreatePipe -// 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 CreatePipeRequest method. -// req, resp := client.CreatePipeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/CreatePipe -func (c *Pipes) CreatePipeRequest(input *CreatePipeInput) (req *request.Request, output *CreatePipeOutput) { - op := &request.Operation{ - Name: opCreatePipe, - HTTPMethod: "POST", - HTTPPath: "/v1/pipes/{Name}", - } - - if input == nil { - input = &CreatePipeInput{} - } - - output = &CreatePipeOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePipe API operation for Amazon EventBridge Pipes. -// -// Create a pipe. Amazon EventBridge Pipes connect event sources to targets -// and reduces the need for specialized knowledge and integration code. -// -// 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 EventBridge Pipes's -// API operation CreatePipe for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - ThrottlingException -// An action was throttled. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// - ConflictException -// An action you attempted resulted in an exception. -// -// - ServiceQuotaExceededException -// A quota has been exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/CreatePipe -func (c *Pipes) CreatePipe(input *CreatePipeInput) (*CreatePipeOutput, error) { - req, out := c.CreatePipeRequest(input) - return out, req.Send() -} - -// CreatePipeWithContext is the same as CreatePipe with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePipe 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 *Pipes) CreatePipeWithContext(ctx aws.Context, input *CreatePipeInput, opts ...request.Option) (*CreatePipeOutput, error) { - req, out := c.CreatePipeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePipe = "DeletePipe" - -// DeletePipeRequest generates a "aws/request.Request" representing the -// client's request for the DeletePipe 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 DeletePipe for more information on using the DeletePipe -// 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 DeletePipeRequest method. -// req, resp := client.DeletePipeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/DeletePipe -func (c *Pipes) DeletePipeRequest(input *DeletePipeInput) (req *request.Request, output *DeletePipeOutput) { - op := &request.Operation{ - Name: opDeletePipe, - HTTPMethod: "DELETE", - HTTPPath: "/v1/pipes/{Name}", - } - - if input == nil { - input = &DeletePipeInput{} - } - - output = &DeletePipeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeletePipe API operation for Amazon EventBridge Pipes. -// -// Delete an existing pipe. For more information about pipes, see Amazon EventBridge -// Pipes (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html) -// in the Amazon EventBridge User Guide. -// -// 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 EventBridge Pipes's -// API operation DeletePipe for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - ThrottlingException -// An action was throttled. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// - ConflictException -// An action you attempted resulted in an exception. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/DeletePipe -func (c *Pipes) DeletePipe(input *DeletePipeInput) (*DeletePipeOutput, error) { - req, out := c.DeletePipeRequest(input) - return out, req.Send() -} - -// DeletePipeWithContext is the same as DeletePipe with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePipe 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 *Pipes) DeletePipeWithContext(ctx aws.Context, input *DeletePipeInput, opts ...request.Option) (*DeletePipeOutput, error) { - req, out := c.DeletePipeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribePipe = "DescribePipe" - -// DescribePipeRequest generates a "aws/request.Request" representing the -// client's request for the DescribePipe 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 DescribePipe for more information on using the DescribePipe -// 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 DescribePipeRequest method. -// req, resp := client.DescribePipeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/DescribePipe -func (c *Pipes) DescribePipeRequest(input *DescribePipeInput) (req *request.Request, output *DescribePipeOutput) { - op := &request.Operation{ - Name: opDescribePipe, - HTTPMethod: "GET", - HTTPPath: "/v1/pipes/{Name}", - } - - if input == nil { - input = &DescribePipeInput{} - } - - output = &DescribePipeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePipe API operation for Amazon EventBridge Pipes. -// -// Get the information about an existing pipe. For more information about pipes, -// see Amazon EventBridge Pipes (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html) -// in the Amazon EventBridge User Guide. -// -// 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 EventBridge Pipes's -// API operation DescribePipe for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - ThrottlingException -// An action was throttled. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/DescribePipe -func (c *Pipes) DescribePipe(input *DescribePipeInput) (*DescribePipeOutput, error) { - req, out := c.DescribePipeRequest(input) - return out, req.Send() -} - -// DescribePipeWithContext is the same as DescribePipe with the addition of -// the ability to pass a context and additional request options. -// -// See DescribePipe 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 *Pipes) DescribePipeWithContext(ctx aws.Context, input *DescribePipeInput, opts ...request.Option) (*DescribePipeOutput, error) { - req, out := c.DescribePipeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListPipes = "ListPipes" - -// ListPipesRequest generates a "aws/request.Request" representing the -// client's request for the ListPipes 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 ListPipes for more information on using the ListPipes -// 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 ListPipesRequest method. -// req, resp := client.ListPipesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/ListPipes -func (c *Pipes) ListPipesRequest(input *ListPipesInput) (req *request.Request, output *ListPipesOutput) { - op := &request.Operation{ - Name: opListPipes, - HTTPMethod: "GET", - HTTPPath: "/v1/pipes", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "Limit", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPipesInput{} - } - - output = &ListPipesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPipes API operation for Amazon EventBridge Pipes. -// -// Get the pipes associated with this account. For more information about pipes, -// see Amazon EventBridge Pipes (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html) -// in the Amazon EventBridge User Guide. -// -// 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 EventBridge Pipes's -// API operation ListPipes for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - ThrottlingException -// An action was throttled. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/ListPipes -func (c *Pipes) ListPipes(input *ListPipesInput) (*ListPipesOutput, error) { - req, out := c.ListPipesRequest(input) - return out, req.Send() -} - -// ListPipesWithContext is the same as ListPipes with the addition of -// the ability to pass a context and additional request options. -// -// See ListPipes 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 *Pipes) ListPipesWithContext(ctx aws.Context, input *ListPipesInput, opts ...request.Option) (*ListPipesOutput, error) { - req, out := c.ListPipesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPipesPages iterates over the pages of a ListPipes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPipes method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPipes operation. -// pageNum := 0 -// err := client.ListPipesPages(params, -// func(page *pipes.ListPipesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Pipes) ListPipesPages(input *ListPipesInput, fn func(*ListPipesOutput, bool) bool) error { - return c.ListPipesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPipesPagesWithContext same as ListPipesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Pipes) ListPipesPagesWithContext(ctx aws.Context, input *ListPipesInput, fn func(*ListPipesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPipesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPipesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPipesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/ListTagsForResource -func (c *Pipes) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon EventBridge Pipes. -// -// Displays the tags associated with a pipe. -// -// 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 EventBridge Pipes's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/ListTagsForResource -func (c *Pipes) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *Pipes) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartPipe = "StartPipe" - -// StartPipeRequest generates a "aws/request.Request" representing the -// client's request for the StartPipe 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 StartPipe for more information on using the StartPipe -// 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 StartPipeRequest method. -// req, resp := client.StartPipeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/StartPipe -func (c *Pipes) StartPipeRequest(input *StartPipeInput) (req *request.Request, output *StartPipeOutput) { - op := &request.Operation{ - Name: opStartPipe, - HTTPMethod: "POST", - HTTPPath: "/v1/pipes/{Name}/start", - } - - if input == nil { - input = &StartPipeInput{} - } - - output = &StartPipeOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartPipe API operation for Amazon EventBridge Pipes. -// -// Start an existing pipe. -// -// 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 EventBridge Pipes's -// API operation StartPipe for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - ThrottlingException -// An action was throttled. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// - ConflictException -// An action you attempted resulted in an exception. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/StartPipe -func (c *Pipes) StartPipe(input *StartPipeInput) (*StartPipeOutput, error) { - req, out := c.StartPipeRequest(input) - return out, req.Send() -} - -// StartPipeWithContext is the same as StartPipe with the addition of -// the ability to pass a context and additional request options. -// -// See StartPipe 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 *Pipes) StartPipeWithContext(ctx aws.Context, input *StartPipeInput, opts ...request.Option) (*StartPipeOutput, error) { - req, out := c.StartPipeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopPipe = "StopPipe" - -// StopPipeRequest generates a "aws/request.Request" representing the -// client's request for the StopPipe 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 StopPipe for more information on using the StopPipe -// 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 StopPipeRequest method. -// req, resp := client.StopPipeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/StopPipe -func (c *Pipes) StopPipeRequest(input *StopPipeInput) (req *request.Request, output *StopPipeOutput) { - op := &request.Operation{ - Name: opStopPipe, - HTTPMethod: "POST", - HTTPPath: "/v1/pipes/{Name}/stop", - } - - if input == nil { - input = &StopPipeInput{} - } - - output = &StopPipeOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopPipe API operation for Amazon EventBridge Pipes. -// -// Stop an existing pipe. -// -// 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 EventBridge Pipes's -// API operation StopPipe for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - ThrottlingException -// An action was throttled. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// - ConflictException -// An action you attempted resulted in an exception. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/StopPipe -func (c *Pipes) StopPipe(input *StopPipeInput) (*StopPipeOutput, error) { - req, out := c.StopPipeRequest(input) - return out, req.Send() -} - -// StopPipeWithContext is the same as StopPipe with the addition of -// the ability to pass a context and additional request options. -// -// See StopPipe 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 *Pipes) StopPipeWithContext(ctx aws.Context, input *StopPipeInput, opts ...request.Option) (*StopPipeOutput, error) { - req, out := c.StopPipeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/TagResource -func (c *Pipes) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon EventBridge Pipes. -// -// Assigns one or more tags (key-value pairs) to the specified pipe. Tags can -// help you organize and categorize your resources. You can also use them to -// scope user permissions by granting a user permission to access or change -// only resources with certain tag values. -// -// Tags don't have any semantic meaning to Amazon Web Services and are interpreted -// strictly as strings of characters. -// -// You can use the TagResource action with a pipe that already has tags. If -// you specify a new tag key, this tag is appended to the list of tags associated -// with the pipe. If you specify a tag key that is already associated with the -// pipe, the new tag value that you specify replaces the previous value for -// that tag. -// -// You can associate as many as 50 tags with a pipe. -// -// 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 EventBridge Pipes's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/TagResource -func (c *Pipes) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *Pipes) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/UntagResource -func (c *Pipes) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon EventBridge Pipes. -// -// Removes one or more tags from the specified pipes. -// -// 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 EventBridge Pipes's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/UntagResource -func (c *Pipes) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *Pipes) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePipe = "UpdatePipe" - -// UpdatePipeRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePipe 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 UpdatePipe for more information on using the UpdatePipe -// 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 UpdatePipeRequest method. -// req, resp := client.UpdatePipeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/UpdatePipe -func (c *Pipes) UpdatePipeRequest(input *UpdatePipeInput) (req *request.Request, output *UpdatePipeOutput) { - op := &request.Operation{ - Name: opUpdatePipe, - HTTPMethod: "PUT", - HTTPPath: "/v1/pipes/{Name}", - } - - if input == nil { - input = &UpdatePipeInput{} - } - - output = &UpdatePipeOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePipe API operation for Amazon EventBridge Pipes. -// -// Update an existing pipe. When you call UpdatePipe, EventBridge only the updates -// fields you have specified in the request; the rest remain unchanged. The -// exception to this is if you modify any Amazon Web Services-service specific -// fields in the SourceParameters, EnrichmentParameters, or TargetParameters -// objects. For example, DynamoDBStreamParameters or EventBridgeEventBusParameters. -// EventBridge updates the fields in these objects atomically as one and overrides -// existing values. This is by design, and means that if you don't specify an -// optional field in one of these Parameters objects, EventBridge sets that -// field to its system-default value during the update. -// -// For more information about pipes, see Amazon EventBridge Pipes (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html) -// in the Amazon EventBridge User Guide. -// -// 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 EventBridge Pipes's -// API operation UpdatePipe for usage and error information. -// -// Returned Error Types: -// -// - InternalException -// This exception occurs due to unexpected causes. -// -// - ValidationException -// Indicates that an error has occurred while performing a validate operation. -// -// - ThrottlingException -// An action was throttled. -// -// - NotFoundException -// An entity that you specified does not exist. -// -// - ConflictException -// An action you attempted resulted in an exception. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07/UpdatePipe -func (c *Pipes) UpdatePipe(input *UpdatePipeInput) (*UpdatePipeOutput, error) { - req, out := c.UpdatePipeRequest(input) - return out, req.Send() -} - -// UpdatePipeWithContext is the same as UpdatePipe with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePipe 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 *Pipes) UpdatePipeWithContext(ctx aws.Context, input *UpdatePipeInput, opts ...request.Option) (*UpdatePipeOutput, error) { - req, out := c.UpdatePipeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// This structure specifies the VPC subnets and security groups for the task, -// and whether a public IP address is to be used. This structure is relevant -// only for ECS tasks that use the awsvpc network mode. -type AwsVpcConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies whether the task's elastic network interface receives a public - // IP address. You can specify ENABLED only when LaunchType in EcsParameters - // is set to FARGATE. - AssignPublicIp *string `type:"string" enum:"AssignPublicIp"` - - // Specifies the security groups associated with the task. These security groups - // must all be in the same VPC. You can specify as many as five security groups. - // If you do not specify a security group, the default security group for the - // VPC is used. - SecurityGroups []*string `type:"list"` - - // Specifies the subnets associated with the task. These subnets must all be - // in the same VPC. You can specify as many as 16 subnets. - // - // Subnets is a required field - Subnets []*string `type:"list" 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 AwsVpcConfiguration) 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 AwsVpcConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AwsVpcConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AwsVpcConfiguration"} - if s.Subnets == nil { - invalidParams.Add(request.NewErrParamRequired("Subnets")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssignPublicIp sets the AssignPublicIp field's value. -func (s *AwsVpcConfiguration) SetAssignPublicIp(v string) *AwsVpcConfiguration { - s.AssignPublicIp = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *AwsVpcConfiguration) SetSecurityGroups(v []*string) *AwsVpcConfiguration { - s.SecurityGroups = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *AwsVpcConfiguration) SetSubnets(v []*string) *AwsVpcConfiguration { - s.Subnets = v - return s -} - -// The array properties for the submitted job, such as the size of the array. -// The array size can be between 2 and 10,000. If you specify array properties -// for a job, it becomes an array job. This parameter is used only if the target -// is an Batch job. -type BatchArrayProperties struct { - _ struct{} `type:"structure"` - - // The size of the array, if this is an array batch job. - Size *int64 `min:"2" 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 BatchArrayProperties) 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 BatchArrayProperties) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchArrayProperties) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchArrayProperties"} - if s.Size != nil && *s.Size < 2 { - invalidParams.Add(request.NewErrParamMinValue("Size", 2)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSize sets the Size field's value. -func (s *BatchArrayProperties) SetSize(v int64) *BatchArrayProperties { - s.Size = &v - return s -} - -// The overrides that are sent to a container. -type BatchContainerOverrides struct { - _ struct{} `type:"structure"` - - // The command to send to the container that overrides the default command from - // the Docker image or the task definition. - Command []*string `type:"list"` - - // The environment variables to send to the container. You can add new environment - // variables, which are added to the container at launch, or you can override - // the existing environment variables from the Docker image or the task definition. - // - // Environment variables cannot start with "Batch". This naming convention is - // reserved for variables that Batch sets. - Environment []*BatchEnvironmentVariable `type:"list"` - - // The instance type to use for a multi-node parallel job. - // - // This parameter isn't applicable to single-node container jobs or jobs that - // run on Fargate resources, and shouldn't be provided. - InstanceType *string `type:"string"` - - // The type and amount of resources to assign to a container. This overrides - // the settings in the job definition. The supported resources include GPU, - // MEMORY, and VCPU. - ResourceRequirements []*BatchResourceRequirement `type:"list"` -} - -// 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 BatchContainerOverrides) 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 BatchContainerOverrides) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchContainerOverrides) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchContainerOverrides"} - if s.ResourceRequirements != nil { - for i, v := range s.ResourceRequirements { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceRequirements", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommand sets the Command field's value. -func (s *BatchContainerOverrides) SetCommand(v []*string) *BatchContainerOverrides { - s.Command = v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *BatchContainerOverrides) SetEnvironment(v []*BatchEnvironmentVariable) *BatchContainerOverrides { - s.Environment = v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *BatchContainerOverrides) SetInstanceType(v string) *BatchContainerOverrides { - s.InstanceType = &v - return s -} - -// SetResourceRequirements sets the ResourceRequirements field's value. -func (s *BatchContainerOverrides) SetResourceRequirements(v []*BatchResourceRequirement) *BatchContainerOverrides { - s.ResourceRequirements = v - return s -} - -// The environment variables to send to the container. You can add new environment -// variables, which are added to the container at launch, or you can override -// the existing environment variables from the Docker image or the task definition. -// -// Environment variables cannot start with "Batch". This naming convention is -// reserved for variables that Batch sets. -type BatchEnvironmentVariable struct { - _ struct{} `type:"structure"` - - // The name of the key-value pair. For environment variables, this is the name - // of the environment variable. - Name *string `type:"string"` - - // The value of the key-value pair. For environment variables, this is the value - // of the environment variable. - Value *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 BatchEnvironmentVariable) 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 BatchEnvironmentVariable) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *BatchEnvironmentVariable) SetName(v string) *BatchEnvironmentVariable { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *BatchEnvironmentVariable) SetValue(v string) *BatchEnvironmentVariable { - s.Value = &v - return s -} - -// An object that represents an Batch job dependency. -type BatchJobDependency struct { - _ struct{} `type:"structure"` - - // The job ID of the Batch job that's associated with this dependency. - JobId *string `type:"string"` - - // The type of the job dependency. - Type *string `type:"string" enum:"BatchJobDependencyType"` -} - -// 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 BatchJobDependency) 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 BatchJobDependency) GoString() string { - return s.String() -} - -// SetJobId sets the JobId field's value. -func (s *BatchJobDependency) SetJobId(v string) *BatchJobDependency { - s.JobId = &v - return s -} - -// SetType sets the Type field's value. -func (s *BatchJobDependency) SetType(v string) *BatchJobDependency { - s.Type = &v - return s -} - -// The type and amount of a resource to assign to a container. The supported -// resources include GPU, MEMORY, and VCPU. -type BatchResourceRequirement struct { - _ struct{} `type:"structure"` - - // The type of resource to assign to a container. The supported resources include - // GPU, MEMORY, and VCPU. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"BatchResourceRequirementType"` - - // The quantity of the specified resource to reserve for the container. The - // values vary based on the type specified. - // - // type="GPU" - // - // The number of physical GPUs to reserve for the container. Make sure that - // the number of GPUs reserved for all containers in a job doesn't exceed the - // number of available GPUs on the compute resource that the job is launched - // on. - // - // GPUs aren't available for jobs that are running on Fargate resources. - // - // type="MEMORY" - // - // The memory hard limit (in MiB) present to the container. This parameter is - // supported for jobs that are running on EC2 resources. If your container attempts - // to exceed the memory specified, the container is terminated. This parameter - // maps to Memory in the Create a container (https://docs.docker.com/engine/api/v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.23/) - // and the --memory option to docker run (https://docs.docker.com/engine/reference/run/). - // You must specify at least 4 MiB of memory for a job. This is required but - // can be specified in several places for multi-node parallel (MNP) jobs. It - // must be specified for each node at least once. This parameter maps to Memory - // in the Create a container (https://docs.docker.com/engine/api/v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.23/) - // and the --memory option to docker run (https://docs.docker.com/engine/reference/run/). - // - // If you're trying to maximize your resource utilization by providing your - // jobs as much memory as possible for a particular instance type, see Memory - // management (https://docs.aws.amazon.com/batch/latest/userguide/memory-management.html) - // in the Batch User Guide. - // - // For jobs that are running on Fargate resources, then value is the hard limit - // (in MiB), and must match one of the supported values and the VCPU values - // must be one of the values supported for that memory value. - // - // value = 512 - // - // VCPU = 0.25 - // - // value = 1024 - // - // VCPU = 0.25 or 0.5 - // - // value = 2048 - // - // VCPU = 0.25, 0.5, or 1 - // - // value = 3072 - // - // VCPU = 0.5, or 1 - // - // value = 4096 - // - // VCPU = 0.5, 1, or 2 - // - // value = 5120, 6144, or 7168 - // - // VCPU = 1 or 2 - // - // value = 8192 - // - // VCPU = 1, 2, 4, or 8 - // - // value = 9216, 10240, 11264, 12288, 13312, 14336, or 15360 - // - // VCPU = 2 or 4 - // - // value = 16384 - // - // VCPU = 2, 4, or 8 - // - // value = 17408, 18432, 19456, 21504, 22528, 23552, 25600, 26624, 27648, 29696, - // or 30720 - // - // VCPU = 4 - // - // value = 20480, 24576, or 28672 - // - // VCPU = 4 or 8 - // - // value = 36864, 45056, 53248, or 61440 - // - // VCPU = 8 - // - // value = 32768, 40960, 49152, or 57344 - // - // VCPU = 8 or 16 - // - // value = 65536, 73728, 81920, 90112, 98304, 106496, 114688, or 122880 - // - // VCPU = 16 - // - // type="VCPU" - // - // The number of vCPUs reserved for the container. This parameter maps to CpuShares - // in the Create a container (https://docs.docker.com/engine/api/v1.23/#create-a-container) - // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.23/) - // and the --cpu-shares option to docker run (https://docs.docker.com/engine/reference/run/). - // Each vCPU is equivalent to 1,024 CPU shares. For EC2 resources, you must - // specify at least one vCPU. This is required but can be specified in several - // places; it must be specified for each node at least once. - // - // The default for the Fargate On-Demand vCPU resource count quota is 6 vCPUs. - // For more information about Fargate quotas, see Fargate quotas (https://docs.aws.amazon.com/general/latest/gr/ecs-service.html#service-quotas-fargate) - // in the Amazon Web Services General Reference. - // - // For jobs that are running on Fargate resources, then value must match one - // of the supported values and the MEMORY values must be one of the values supported - // for that VCPU value. The supported values are 0.25, 0.5, 1, 2, 4, 8, and - // 16 - // - // value = 0.25 - // - // MEMORY = 512, 1024, or 2048 - // - // value = 0.5 - // - // MEMORY = 1024, 2048, 3072, or 4096 - // - // value = 1 - // - // MEMORY = 2048, 3072, 4096, 5120, 6144, 7168, or 8192 - // - // value = 2 - // - // MEMORY = 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, - // 14336, 15360, or 16384 - // - // value = 4 - // - // MEMORY = 8192, 9216, 10240, 11264, 12288, 13312, 14336, 15360, 16384, 17408, - // 18432, 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, - // 29696, or 30720 - // - // value = 8 - // - // MEMORY = 16384, 20480, 24576, 28672, 32768, 36864, 40960, 45056, 49152, 53248, - // 57344, or 61440 - // - // value = 16 - // - // MEMORY = 32768, 40960, 49152, 57344, 65536, 73728, 81920, 90112, 98304, 106496, - // 114688, or 122880 - // - // Value is a required field - Value *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 BatchResourceRequirement) 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 BatchResourceRequirement) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchResourceRequirement) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchResourceRequirement"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetType sets the Type field's value. -func (s *BatchResourceRequirement) SetType(v string) *BatchResourceRequirement { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *BatchResourceRequirement) SetValue(v string) *BatchResourceRequirement { - s.Value = &v - return s -} - -// The retry strategy that's associated with a job. For more information, see -// Automated job retries (https://docs.aws.amazon.com/batch/latest/userguide/job_retries.html) -// in the Batch User Guide. -type BatchRetryStrategy struct { - _ struct{} `type:"structure"` - - // The number of times to move a job to the RUNNABLE status. If the value of - // attempts is greater than one, the job is retried on failure the same number - // of attempts as the value. - Attempts *int64 `min:"1" 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 BatchRetryStrategy) 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 BatchRetryStrategy) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchRetryStrategy) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchRetryStrategy"} - if s.Attempts != nil && *s.Attempts < 1 { - invalidParams.Add(request.NewErrParamMinValue("Attempts", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttempts sets the Attempts field's value. -func (s *BatchRetryStrategy) SetAttempts(v int64) *BatchRetryStrategy { - s.Attempts = &v - return s -} - -// The details of a capacity provider strategy. To learn more, see CapacityProviderStrategyItem -// (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CapacityProviderStrategyItem.html) -// in the Amazon ECS API Reference. -type CapacityProviderStrategyItem struct { - _ struct{} `type:"structure"` - - // The base value designates how many tasks, at a minimum, to run on the specified - // capacity provider. Only one capacity provider in a capacity provider strategy - // can have a base defined. If no value is specified, the default value of 0 - // is used. - Base *int64 `locationName:"base" type:"integer"` - - // The short name of the capacity provider. - // - // CapacityProvider is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CapacityProviderStrategyItem's - // String and GoString methods. - // - // CapacityProvider is a required field - CapacityProvider *string `locationName:"capacityProvider" min:"1" type:"string" required:"true" sensitive:"true"` - - // The weight value designates the relative percentage of the total number of - // tasks launched that should use the specified capacity provider. The weight - // value is taken into consideration after the base value, if defined, is satisfied. - Weight *int64 `locationName:"weight" 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 CapacityProviderStrategyItem) 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 CapacityProviderStrategyItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CapacityProviderStrategyItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CapacityProviderStrategyItem"} - if s.CapacityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("CapacityProvider")) - } - if s.CapacityProvider != nil && len(*s.CapacityProvider) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CapacityProvider", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBase sets the Base field's value. -func (s *CapacityProviderStrategyItem) SetBase(v int64) *CapacityProviderStrategyItem { - s.Base = &v - return s -} - -// SetCapacityProvider sets the CapacityProvider field's value. -func (s *CapacityProviderStrategyItem) SetCapacityProvider(v string) *CapacityProviderStrategyItem { - s.CapacityProvider = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *CapacityProviderStrategyItem) SetWeight(v int64) *CapacityProviderStrategyItem { - s.Weight = &v - return s -} - -// The Amazon CloudWatch Logs logging configuration settings for the pipe. -type CloudwatchLogsLogDestination struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services Resource Name (ARN) for the CloudWatch log group - // to which EventBridge sends the log records. - LogGroupArn *string `min:"1" 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 CloudwatchLogsLogDestination) 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 CloudwatchLogsLogDestination) GoString() string { - return s.String() -} - -// SetLogGroupArn sets the LogGroupArn field's value. -func (s *CloudwatchLogsLogDestination) SetLogGroupArn(v string) *CloudwatchLogsLogDestination { - s.LogGroupArn = &v - return s -} - -// The Amazon CloudWatch Logs logging configuration settings for the pipe. -type CloudwatchLogsLogDestinationParameters struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services Resource Name (ARN) for the CloudWatch log group - // to which EventBridge sends the log records. - // - // LogGroupArn is a required field - LogGroupArn *string `min:"1" 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 CloudwatchLogsLogDestinationParameters) 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 CloudwatchLogsLogDestinationParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloudwatchLogsLogDestinationParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudwatchLogsLogDestinationParameters"} - if s.LogGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupArn")) - } - if s.LogGroupArn != nil && len(*s.LogGroupArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogGroupArn sets the LogGroupArn field's value. -func (s *CloudwatchLogsLogDestinationParameters) SetLogGroupArn(v string) *CloudwatchLogsLogDestinationParameters { - s.LogGroupArn = &v - return s -} - -// An action you attempted resulted in an exception. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the resource that caused the exception. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of resource that caused the exception. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreatePipeInput struct { - _ struct{} `type:"structure"` - - // A description of the pipe. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreatePipeInput's - // String and GoString methods. - Description *string `type:"string" sensitive:"true"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeState"` - - // The ARN of the enrichment resource. - Enrichment *string `type:"string"` - - // The parameters required to set up enrichment on your pipe. - EnrichmentParameters *PipeEnrichmentParameters `type:"structure"` - - // The logging configuration settings for the pipe. - LogConfiguration *PipeLogConfigurationParameters `type:"structure"` - - // The name of the pipe. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` - - // The ARN of the role that allows the pipe to send data to the target. - // - // RoleArn is a required field - RoleArn *string `min:"1" type:"string" required:"true"` - - // The ARN of the source resource. - // - // Source is a required field - Source *string `min:"1" type:"string" required:"true"` - - // The parameters required to set up a source for your pipe. - SourceParameters *PipeSourceParameters `type:"structure"` - - // The list of key-value pairs to associate with the pipe. - Tags map[string]*string `min:"1" type:"map"` - - // The ARN of the target resource. - // - // Target is a required field - Target *string `min:"1" type:"string" required:"true"` - - // The parameters required to set up a target for your pipe. - // - // For more information about pipe target parameters, including how to use dynamic - // path parameters, see Target parameters (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-target.html) - // in the Amazon EventBridge User Guide. - TargetParameters *PipeTargetParameters `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 CreatePipeInput) 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 CreatePipeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePipeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePipeInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.Source != nil && len(*s.Source) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Source", 1)) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.Target == nil { - invalidParams.Add(request.NewErrParamRequired("Target")) - } - if s.Target != nil && len(*s.Target) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Target", 1)) - } - if s.LogConfiguration != nil { - if err := s.LogConfiguration.Validate(); err != nil { - invalidParams.AddNested("LogConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.SourceParameters != nil { - if err := s.SourceParameters.Validate(); err != nil { - invalidParams.AddNested("SourceParameters", err.(request.ErrInvalidParams)) - } - } - if s.TargetParameters != nil { - if err := s.TargetParameters.Validate(); err != nil { - invalidParams.AddNested("TargetParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreatePipeInput) SetDescription(v string) *CreatePipeInput { - s.Description = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *CreatePipeInput) SetDesiredState(v string) *CreatePipeInput { - s.DesiredState = &v - return s -} - -// SetEnrichment sets the Enrichment field's value. -func (s *CreatePipeInput) SetEnrichment(v string) *CreatePipeInput { - s.Enrichment = &v - return s -} - -// SetEnrichmentParameters sets the EnrichmentParameters field's value. -func (s *CreatePipeInput) SetEnrichmentParameters(v *PipeEnrichmentParameters) *CreatePipeInput { - s.EnrichmentParameters = v - return s -} - -// SetLogConfiguration sets the LogConfiguration field's value. -func (s *CreatePipeInput) SetLogConfiguration(v *PipeLogConfigurationParameters) *CreatePipeInput { - s.LogConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePipeInput) SetName(v string) *CreatePipeInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreatePipeInput) SetRoleArn(v string) *CreatePipeInput { - s.RoleArn = &v - return s -} - -// SetSource sets the Source field's value. -func (s *CreatePipeInput) SetSource(v string) *CreatePipeInput { - s.Source = &v - return s -} - -// SetSourceParameters sets the SourceParameters field's value. -func (s *CreatePipeInput) SetSourceParameters(v *PipeSourceParameters) *CreatePipeInput { - s.SourceParameters = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreatePipeInput) SetTags(v map[string]*string) *CreatePipeInput { - s.Tags = v - return s -} - -// SetTarget sets the Target field's value. -func (s *CreatePipeInput) SetTarget(v string) *CreatePipeInput { - s.Target = &v - return s -} - -// SetTargetParameters sets the TargetParameters field's value. -func (s *CreatePipeInput) SetTargetParameters(v *PipeTargetParameters) *CreatePipeInput { - s.TargetParameters = v - return s -} - -type CreatePipeOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the pipe. - Arn *string `min:"1" type:"string"` - - // The time the pipe was created. - CreationTime *time.Time `type:"timestamp"` - - // The state the pipe is in. - CurrentState *string `type:"string" enum:"PipeState"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeState"` - - // When the pipe was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime) - // (YYYY-MM-DDThh:mm:ss.sTZD). - LastModifiedTime *time.Time `type:"timestamp"` - - // The name of the pipe. - Name *string `min:"1" 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 CreatePipeOutput) 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 CreatePipeOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreatePipeOutput) SetArn(v string) *CreatePipeOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *CreatePipeOutput) SetCreationTime(v time.Time) *CreatePipeOutput { - s.CreationTime = &v - return s -} - -// SetCurrentState sets the CurrentState field's value. -func (s *CreatePipeOutput) SetCurrentState(v string) *CreatePipeOutput { - s.CurrentState = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *CreatePipeOutput) SetDesiredState(v string) *CreatePipeOutput { - s.DesiredState = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *CreatePipeOutput) SetLastModifiedTime(v time.Time) *CreatePipeOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePipeOutput) SetName(v string) *CreatePipeOutput { - s.Name = &v - return s -} - -// A DeadLetterConfig object that contains information about a dead-letter queue -// configuration. -type DeadLetterConfig struct { - _ struct{} `type:"structure"` - - // The ARN of the specified target for the dead-letter queue. - // - // For Amazon Kinesis stream and Amazon DynamoDB stream sources, specify either - // an Amazon SNS topic or Amazon SQS queue ARN. - Arn *string `min:"1" 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 DeadLetterConfig) 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 DeadLetterConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeadLetterConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeadLetterConfig"} - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *DeadLetterConfig) SetArn(v string) *DeadLetterConfig { - s.Arn = &v - return s -} - -type DeletePipeInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipe. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" 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 DeletePipeInput) 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 DeletePipeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePipeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePipeInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeletePipeInput) SetName(v string) *DeletePipeInput { - s.Name = &v - return s -} - -type DeletePipeOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the pipe. - Arn *string `min:"1" type:"string"` - - // The time the pipe was created. - CreationTime *time.Time `type:"timestamp"` - - // The state the pipe is in. - CurrentState *string `type:"string" enum:"PipeState"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeStateDescribeResponse"` - - // When the pipe was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime) - // (YYYY-MM-DDThh:mm:ss.sTZD). - LastModifiedTime *time.Time `type:"timestamp"` - - // The name of the pipe. - Name *string `min:"1" 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 DeletePipeOutput) 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 DeletePipeOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeletePipeOutput) SetArn(v string) *DeletePipeOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DeletePipeOutput) SetCreationTime(v time.Time) *DeletePipeOutput { - s.CreationTime = &v - return s -} - -// SetCurrentState sets the CurrentState field's value. -func (s *DeletePipeOutput) SetCurrentState(v string) *DeletePipeOutput { - s.CurrentState = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *DeletePipeOutput) SetDesiredState(v string) *DeletePipeOutput { - s.DesiredState = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DeletePipeOutput) SetLastModifiedTime(v time.Time) *DeletePipeOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeletePipeOutput) SetName(v string) *DeletePipeOutput { - s.Name = &v - return s -} - -type DescribePipeInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipe. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" 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 DescribePipeInput) 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 DescribePipeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribePipeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribePipeInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DescribePipeInput) SetName(v string) *DescribePipeInput { - s.Name = &v - return s -} - -type DescribePipeOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the pipe. - Arn *string `min:"1" type:"string"` - - // The time the pipe was created. - CreationTime *time.Time `type:"timestamp"` - - // The state the pipe is in. - CurrentState *string `type:"string" enum:"PipeState"` - - // A description of the pipe. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DescribePipeOutput's - // String and GoString methods. - Description *string `type:"string" sensitive:"true"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeStateDescribeResponse"` - - // The ARN of the enrichment resource. - Enrichment *string `type:"string"` - - // The parameters required to set up enrichment on your pipe. - EnrichmentParameters *PipeEnrichmentParameters `type:"structure"` - - // When the pipe was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime) - // (YYYY-MM-DDThh:mm:ss.sTZD). - LastModifiedTime *time.Time `type:"timestamp"` - - // The logging configuration settings for the pipe. - LogConfiguration *PipeLogConfiguration `type:"structure"` - - // The name of the pipe. - Name *string `min:"1" type:"string"` - - // The ARN of the role that allows the pipe to send data to the target. - RoleArn *string `min:"1" type:"string"` - - // The ARN of the source resource. - Source *string `min:"1" type:"string"` - - // The parameters required to set up a source for your pipe. - SourceParameters *PipeSourceParameters `type:"structure"` - - // The reason the pipe is in its current state. - StateReason *string `type:"string"` - - // The list of key-value pairs to associate with the pipe. - Tags map[string]*string `min:"1" type:"map"` - - // The ARN of the target resource. - Target *string `min:"1" type:"string"` - - // The parameters required to set up a target for your pipe. - // - // For more information about pipe target parameters, including how to use dynamic - // path parameters, see Target parameters (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-target.html) - // in the Amazon EventBridge User Guide. - TargetParameters *PipeTargetParameters `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 DescribePipeOutput) 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 DescribePipeOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DescribePipeOutput) SetArn(v string) *DescribePipeOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DescribePipeOutput) SetCreationTime(v time.Time) *DescribePipeOutput { - s.CreationTime = &v - return s -} - -// SetCurrentState sets the CurrentState field's value. -func (s *DescribePipeOutput) SetCurrentState(v string) *DescribePipeOutput { - s.CurrentState = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribePipeOutput) SetDescription(v string) *DescribePipeOutput { - s.Description = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *DescribePipeOutput) SetDesiredState(v string) *DescribePipeOutput { - s.DesiredState = &v - return s -} - -// SetEnrichment sets the Enrichment field's value. -func (s *DescribePipeOutput) SetEnrichment(v string) *DescribePipeOutput { - s.Enrichment = &v - return s -} - -// SetEnrichmentParameters sets the EnrichmentParameters field's value. -func (s *DescribePipeOutput) SetEnrichmentParameters(v *PipeEnrichmentParameters) *DescribePipeOutput { - s.EnrichmentParameters = v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribePipeOutput) SetLastModifiedTime(v time.Time) *DescribePipeOutput { - s.LastModifiedTime = &v - return s -} - -// SetLogConfiguration sets the LogConfiguration field's value. -func (s *DescribePipeOutput) SetLogConfiguration(v *PipeLogConfiguration) *DescribePipeOutput { - s.LogConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *DescribePipeOutput) SetName(v string) *DescribePipeOutput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *DescribePipeOutput) SetRoleArn(v string) *DescribePipeOutput { - s.RoleArn = &v - return s -} - -// SetSource sets the Source field's value. -func (s *DescribePipeOutput) SetSource(v string) *DescribePipeOutput { - s.Source = &v - return s -} - -// SetSourceParameters sets the SourceParameters field's value. -func (s *DescribePipeOutput) SetSourceParameters(v *PipeSourceParameters) *DescribePipeOutput { - s.SourceParameters = v - return s -} - -// SetStateReason sets the StateReason field's value. -func (s *DescribePipeOutput) SetStateReason(v string) *DescribePipeOutput { - s.StateReason = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DescribePipeOutput) SetTags(v map[string]*string) *DescribePipeOutput { - s.Tags = v - return s -} - -// SetTarget sets the Target field's value. -func (s *DescribePipeOutput) SetTarget(v string) *DescribePipeOutput { - s.Target = &v - return s -} - -// SetTargetParameters sets the TargetParameters field's value. -func (s *DescribePipeOutput) SetTargetParameters(v *PipeTargetParameters) *DescribePipeOutput { - s.TargetParameters = v - return s -} - -// The overrides that are sent to a container. An empty container override can -// be passed in. An example of an empty container override is {"containerOverrides": -// [ ] }. If a non-empty container override is specified, the name parameter -// must be included. -type EcsContainerOverride struct { - _ struct{} `type:"structure"` - - // The command to send to the container that overrides the default command from - // the Docker image or the task definition. You must also specify a container - // name. - Command []*string `type:"list"` - - // The number of cpu units reserved for the container, instead of the default - // value from the task definition. You must also specify a container name. - Cpu *int64 `type:"integer"` - - // The environment variables to send to the container. You can add new environment - // variables, which are added to the container at launch, or you can override - // the existing environment variables from the Docker image or the task definition. - // You must also specify a container name. - Environment []*EcsEnvironmentVariable `type:"list"` - - // A list of files containing the environment variables to pass to a container, - // instead of the value from the container definition. - EnvironmentFiles []*EcsEnvironmentFile `type:"list"` - - // The hard limit (in MiB) of memory to present to the container, instead of - // the default value from the task definition. If your container attempts to - // exceed the memory specified here, the container is killed. You must also - // specify a container name. - Memory *int64 `type:"integer"` - - // The soft limit (in MiB) of memory to reserve for the container, instead of - // the default value from the task definition. You must also specify a container - // name. - MemoryReservation *int64 `type:"integer"` - - // The name of the container that receives the override. This parameter is required - // if any override is specified. - Name *string `type:"string"` - - // The type and amount of a resource to assign to a container, instead of the - // default value from the task definition. The only supported resource is a - // GPU. - ResourceRequirements []*EcsResourceRequirement `type:"list"` -} - -// 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 EcsContainerOverride) 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 EcsContainerOverride) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EcsContainerOverride) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EcsContainerOverride"} - if s.EnvironmentFiles != nil { - for i, v := range s.EnvironmentFiles { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "EnvironmentFiles", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ResourceRequirements != nil { - for i, v := range s.ResourceRequirements { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceRequirements", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommand sets the Command field's value. -func (s *EcsContainerOverride) SetCommand(v []*string) *EcsContainerOverride { - s.Command = v - return s -} - -// SetCpu sets the Cpu field's value. -func (s *EcsContainerOverride) SetCpu(v int64) *EcsContainerOverride { - s.Cpu = &v - return s -} - -// SetEnvironment sets the Environment field's value. -func (s *EcsContainerOverride) SetEnvironment(v []*EcsEnvironmentVariable) *EcsContainerOverride { - s.Environment = v - return s -} - -// SetEnvironmentFiles sets the EnvironmentFiles field's value. -func (s *EcsContainerOverride) SetEnvironmentFiles(v []*EcsEnvironmentFile) *EcsContainerOverride { - s.EnvironmentFiles = v - return s -} - -// SetMemory sets the Memory field's value. -func (s *EcsContainerOverride) SetMemory(v int64) *EcsContainerOverride { - s.Memory = &v - return s -} - -// SetMemoryReservation sets the MemoryReservation field's value. -func (s *EcsContainerOverride) SetMemoryReservation(v int64) *EcsContainerOverride { - s.MemoryReservation = &v - return s -} - -// SetName sets the Name field's value. -func (s *EcsContainerOverride) SetName(v string) *EcsContainerOverride { - s.Name = &v - return s -} - -// SetResourceRequirements sets the ResourceRequirements field's value. -func (s *EcsContainerOverride) SetResourceRequirements(v []*EcsResourceRequirement) *EcsContainerOverride { - s.ResourceRequirements = v - return s -} - -// A list of files containing the environment variables to pass to a container. -// You can specify up to ten environment files. The file must have a .env file -// extension. Each line in an environment file should contain an environment -// variable in VARIABLE=VALUE format. Lines beginning with # are treated as -// comments and are ignored. For more information about the environment variable -// file syntax, see Declare default environment variables in file (https://docs.docker.com/compose/env-file/). -// -// If there are environment variables specified using the environment parameter -// in a container definition, they take precedence over the variables contained -// within an environment file. If multiple environment files are specified that -// contain the same variable, they're processed from the top down. We recommend -// that you use unique variable names. For more information, see Specifying -// environment variables (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) -// in the Amazon Elastic Container Service Developer Guide. -// -// This parameter is only supported for tasks hosted on Fargate using the following -// platform versions: -// -// - Linux platform version 1.4.0 or later. -// -// - Windows platform version 1.0.0 or later. -type EcsEnvironmentFile struct { - _ struct{} `type:"structure"` - - // The file type to use. The only supported value is s3. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"EcsEnvironmentFileType"` - - // The Amazon Resource Name (ARN) of the Amazon S3 object containing the environment - // variable file. - // - // Value is a required field - Value *string `locationName:"value" 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 EcsEnvironmentFile) 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 EcsEnvironmentFile) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EcsEnvironmentFile) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EcsEnvironmentFile"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetType sets the Type field's value. -func (s *EcsEnvironmentFile) SetType(v string) *EcsEnvironmentFile { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *EcsEnvironmentFile) SetValue(v string) *EcsEnvironmentFile { - s.Value = &v - return s -} - -// The environment variables to send to the container. You can add new environment -// variables, which are added to the container at launch, or you can override -// the existing environment variables from the Docker image or the task definition. -// You must also specify a container name. -type EcsEnvironmentVariable struct { - _ struct{} `type:"structure"` - - // The name of the key-value pair. For environment variables, this is the name - // of the environment variable. - Name *string `locationName:"name" type:"string"` - - // The value of the key-value pair. For environment variables, this is the value - // of the environment variable. - Value *string `locationName:"value" 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 EcsEnvironmentVariable) 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 EcsEnvironmentVariable) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *EcsEnvironmentVariable) SetName(v string) *EcsEnvironmentVariable { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *EcsEnvironmentVariable) SetValue(v string) *EcsEnvironmentVariable { - s.Value = &v - return s -} - -// The amount of ephemeral storage to allocate for the task. This parameter -// is used to expand the total amount of ephemeral storage available, beyond -// the default amount, for tasks hosted on Fargate. For more information, see -// Fargate task storage (https://docs.aws.amazon.com/AmazonECS/latest/userguide/using_data_volumes.html) -// in the Amazon ECS User Guide for Fargate. -// -// This parameter is only supported for tasks hosted on Fargate using Linux -// platform version 1.4.0 or later. This parameter is not supported for Windows -// containers on Fargate. -type EcsEphemeralStorage struct { - _ struct{} `type:"structure"` - - // The total amount, in GiB, of ephemeral storage to set for the task. The minimum - // supported value is 21 GiB and the maximum supported value is 200 GiB. - // - // SizeInGiB is a required field - SizeInGiB *int64 `locationName:"sizeInGiB" min:"21" type:"integer" 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 EcsEphemeralStorage) 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 EcsEphemeralStorage) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EcsEphemeralStorage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EcsEphemeralStorage"} - if s.SizeInGiB == nil { - invalidParams.Add(request.NewErrParamRequired("SizeInGiB")) - } - if s.SizeInGiB != nil && *s.SizeInGiB < 21 { - invalidParams.Add(request.NewErrParamMinValue("SizeInGiB", 21)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSizeInGiB sets the SizeInGiB field's value. -func (s *EcsEphemeralStorage) SetSizeInGiB(v int64) *EcsEphemeralStorage { - s.SizeInGiB = &v - return s -} - -// Details on an Elastic Inference accelerator task override. This parameter -// is used to override the Elastic Inference accelerator specified in the task -// definition. For more information, see Working with Amazon Elastic Inference -// on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs-inference.html) -// in the Amazon Elastic Container Service Developer Guide. -type EcsInferenceAcceleratorOverride struct { - _ struct{} `type:"structure"` - - // The Elastic Inference accelerator device name to override for the task. This - // parameter must match a deviceName specified in the task definition. - DeviceName *string `locationName:"deviceName" type:"string"` - - // The Elastic Inference accelerator type to use. - DeviceType *string `locationName:"deviceType" 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 EcsInferenceAcceleratorOverride) 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 EcsInferenceAcceleratorOverride) GoString() string { - return s.String() -} - -// SetDeviceName sets the DeviceName field's value. -func (s *EcsInferenceAcceleratorOverride) SetDeviceName(v string) *EcsInferenceAcceleratorOverride { - s.DeviceName = &v - return s -} - -// SetDeviceType sets the DeviceType field's value. -func (s *EcsInferenceAcceleratorOverride) SetDeviceType(v string) *EcsInferenceAcceleratorOverride { - s.DeviceType = &v - return s -} - -// The type and amount of a resource to assign to a container. The supported -// resource types are GPUs and Elastic Inference accelerators. For more information, -// see Working with GPUs on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html) -// or Working with Amazon Elastic Inference on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-inference.html) -// in the Amazon Elastic Container Service Developer Guide -type EcsResourceRequirement struct { - _ struct{} `type:"structure"` - - // The type of resource to assign to a container. The supported values are GPU - // or InferenceAccelerator. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"EcsResourceRequirementType"` - - // The value for the specified resource type. - // - // If the GPU type is used, the value is the number of physical GPUs the Amazon - // ECS container agent reserves for the container. The number of GPUs that's - // reserved for all containers in a task can't exceed the number of available - // GPUs on the container instance that the task is launched on. - // - // If the InferenceAccelerator type is used, the value matches the deviceName - // for an InferenceAccelerator specified in a task definition. - // - // Value is a required field - Value *string `locationName:"value" 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 EcsResourceRequirement) 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 EcsResourceRequirement) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EcsResourceRequirement) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EcsResourceRequirement"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetType sets the Type field's value. -func (s *EcsResourceRequirement) SetType(v string) *EcsResourceRequirement { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *EcsResourceRequirement) SetValue(v string) *EcsResourceRequirement { - s.Value = &v - return s -} - -// The overrides that are associated with a task. -type EcsTaskOverride struct { - _ struct{} `type:"structure"` - - // One or more container overrides that are sent to a task. - ContainerOverrides []*EcsContainerOverride `type:"list"` - - // The cpu override for the task. - Cpu *string `type:"string"` - - // The ephemeral storage setting override for the task. - // - // This parameter is only supported for tasks hosted on Fargate that use the - // following platform versions: - // - // * Linux platform version 1.4.0 or later. - // - // * Windows platform version 1.0.0 or later. - EphemeralStorage *EcsEphemeralStorage `type:"structure"` - - // The Amazon Resource Name (ARN) of the task execution IAM role override for - // the task. For more information, see Amazon ECS task execution IAM role (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html) - // in the Amazon Elastic Container Service Developer Guide. - ExecutionRoleArn *string `min:"1" type:"string"` - - // The Elastic Inference accelerator override for the task. - InferenceAcceleratorOverrides []*EcsInferenceAcceleratorOverride `type:"list"` - - // The memory override for the task. - Memory *string `type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role that containers in this task - // can assume. All containers in this task are granted the permissions that - // are specified in this role. For more information, see IAM Role for Tasks - // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) - // in the Amazon Elastic Container Service Developer Guide. - TaskRoleArn *string `min:"1" 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 EcsTaskOverride) 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 EcsTaskOverride) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EcsTaskOverride) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EcsTaskOverride"} - if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 1)) - } - if s.TaskRoleArn != nil && len(*s.TaskRoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskRoleArn", 1)) - } - if s.ContainerOverrides != nil { - for i, v := range s.ContainerOverrides { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContainerOverrides", i), err.(request.ErrInvalidParams)) - } - } - } - if s.EphemeralStorage != nil { - if err := s.EphemeralStorage.Validate(); err != nil { - invalidParams.AddNested("EphemeralStorage", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContainerOverrides sets the ContainerOverrides field's value. -func (s *EcsTaskOverride) SetContainerOverrides(v []*EcsContainerOverride) *EcsTaskOverride { - s.ContainerOverrides = v - return s -} - -// SetCpu sets the Cpu field's value. -func (s *EcsTaskOverride) SetCpu(v string) *EcsTaskOverride { - s.Cpu = &v - return s -} - -// SetEphemeralStorage sets the EphemeralStorage field's value. -func (s *EcsTaskOverride) SetEphemeralStorage(v *EcsEphemeralStorage) *EcsTaskOverride { - s.EphemeralStorage = v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *EcsTaskOverride) SetExecutionRoleArn(v string) *EcsTaskOverride { - s.ExecutionRoleArn = &v - return s -} - -// SetInferenceAcceleratorOverrides sets the InferenceAcceleratorOverrides field's value. -func (s *EcsTaskOverride) SetInferenceAcceleratorOverrides(v []*EcsInferenceAcceleratorOverride) *EcsTaskOverride { - s.InferenceAcceleratorOverrides = v - return s -} - -// SetMemory sets the Memory field's value. -func (s *EcsTaskOverride) SetMemory(v string) *EcsTaskOverride { - s.Memory = &v - return s -} - -// SetTaskRoleArn sets the TaskRoleArn field's value. -func (s *EcsTaskOverride) SetTaskRoleArn(v string) *EcsTaskOverride { - s.TaskRoleArn = &v - return s -} - -// Filter events using an event pattern. For more information, see Events and -// Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) -// in the Amazon EventBridge User Guide. -type Filter struct { - _ struct{} `type:"structure"` - - // The event pattern. - // - // Pattern is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Filter's - // String and GoString methods. - Pattern *string `type:"string" sensitive:"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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// SetPattern sets the Pattern field's value. -func (s *Filter) SetPattern(v string) *Filter { - s.Pattern = &v - return s -} - -// The collection of event patterns used to filter events. -// -// To remove a filter, specify a FilterCriteria object with an empty array of -// Filter objects. -// -// For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) -// in the Amazon EventBridge User Guide. -type FilterCriteria struct { - _ struct{} `type:"structure"` - - // The event patterns. - Filters []*Filter `type:"list"` -} - -// 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 FilterCriteria) 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 FilterCriteria) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *FilterCriteria) SetFilters(v []*Filter) *FilterCriteria { - s.Filters = v - return s -} - -// The Amazon Kinesis Data Firehose logging configuration settings for the pipe. -type FirehoseLogDestination struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Kinesis Data Firehose delivery stream - // to which EventBridge delivers the pipe log records. - DeliveryStreamArn *string `min:"1" 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 FirehoseLogDestination) 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 FirehoseLogDestination) GoString() string { - return s.String() -} - -// SetDeliveryStreamArn sets the DeliveryStreamArn field's value. -func (s *FirehoseLogDestination) SetDeliveryStreamArn(v string) *FirehoseLogDestination { - s.DeliveryStreamArn = &v - return s -} - -// The Amazon Kinesis Data Firehose logging configuration settings for the pipe. -type FirehoseLogDestinationParameters struct { - _ struct{} `type:"structure"` - - // Specifies the Amazon Resource Name (ARN) of the Kinesis Data Firehose delivery - // stream to which EventBridge delivers the pipe log records. - // - // DeliveryStreamArn is a required field - DeliveryStreamArn *string `min:"1" 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 FirehoseLogDestinationParameters) 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 FirehoseLogDestinationParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FirehoseLogDestinationParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FirehoseLogDestinationParameters"} - if s.DeliveryStreamArn == nil { - invalidParams.Add(request.NewErrParamRequired("DeliveryStreamArn")) - } - if s.DeliveryStreamArn != nil && len(*s.DeliveryStreamArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeliveryStreamArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryStreamArn sets the DeliveryStreamArn field's value. -func (s *FirehoseLogDestinationParameters) SetDeliveryStreamArn(v string) *FirehoseLogDestinationParameters { - s.DeliveryStreamArn = &v - return s -} - -// This exception occurs due to unexpected causes. -type InternalException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The number of seconds to wait before retrying the action that caused the - // exception. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalException) 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 InternalException) GoString() string { - return s.String() -} - -func newErrorInternalException(v protocol.ResponseMetadata) error { - return &InternalException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalException) Code() string { - return "InternalException" -} - -// Message returns the exception's message. -func (s *InternalException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalException) OrigErr() error { - return nil -} - -func (s *InternalException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListPipesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The state the pipe is in. - CurrentState *string `location:"querystring" locationName:"CurrentState" type:"string" enum:"PipeState"` - - // The state the pipe should be in. - DesiredState *string `location:"querystring" locationName:"DesiredState" type:"string" enum:"RequestedPipeState"` - - // The maximum number of pipes to include in the response. - Limit *int64 `location:"querystring" locationName:"Limit" min:"1" type:"integer"` - - // A value that will return a subset of the pipes associated with this account. - // For example, "NamePrefix": "ABC" will return all endpoints with "ABC" in - // the name. - NamePrefix *string `location:"querystring" locationName:"NamePrefix" min:"1" type:"string"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListPipesInput's - // String and GoString methods. - NextToken *string `location:"querystring" locationName:"NextToken" min:"1" type:"string" sensitive:"true"` - - // The prefix matching the pipe source. - SourcePrefix *string `location:"querystring" locationName:"SourcePrefix" min:"1" type:"string"` - - // The prefix matching the pipe target. - TargetPrefix *string `location:"querystring" locationName:"TargetPrefix" min:"1" 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 ListPipesInput) 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 ListPipesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPipesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPipesInput"} - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SourcePrefix != nil && len(*s.SourcePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourcePrefix", 1)) - } - if s.TargetPrefix != nil && len(*s.TargetPrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetPrefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCurrentState sets the CurrentState field's value. -func (s *ListPipesInput) SetCurrentState(v string) *ListPipesInput { - s.CurrentState = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *ListPipesInput) SetDesiredState(v string) *ListPipesInput { - s.DesiredState = &v - return s -} - -// SetLimit sets the Limit field's value. -func (s *ListPipesInput) SetLimit(v int64) *ListPipesInput { - s.Limit = &v - return s -} - -// SetNamePrefix sets the NamePrefix field's value. -func (s *ListPipesInput) SetNamePrefix(v string) *ListPipesInput { - s.NamePrefix = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPipesInput) SetNextToken(v string) *ListPipesInput { - s.NextToken = &v - return s -} - -// SetSourcePrefix sets the SourcePrefix field's value. -func (s *ListPipesInput) SetSourcePrefix(v string) *ListPipesInput { - s.SourcePrefix = &v - return s -} - -// SetTargetPrefix sets the TargetPrefix field's value. -func (s *ListPipesInput) SetTargetPrefix(v string) *ListPipesInput { - s.TargetPrefix = &v - return s -} - -type ListPipesOutput struct { - _ struct{} `type:"structure"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListPipesOutput's - // String and GoString methods. - NextToken *string `min:"1" type:"string" sensitive:"true"` - - // The pipes returned by the call. - Pipes []*Pipe `type:"list"` -} - -// 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 ListPipesOutput) 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 ListPipesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPipesOutput) SetNextToken(v string) *ListPipesOutput { - s.NextToken = &v - return s -} - -// SetPipes sets the Pipes field's value. -func (s *ListPipesOutput) SetPipes(v []*Pipe) *ListPipesOutput { - s.Pipes = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the pipe for which you want to view tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The list of key-value pairs to associate with the pipe. - Tags map[string]*string `locationName:"tags" min:"1" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// The Secrets Manager secret that stores your broker credentials. -type MQBrokerAccessCredentials struct { - _ struct{} `type:"structure"` - - // The ARN of the Secrets Manager secret. - BasicAuth *string `min:"1" 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 MQBrokerAccessCredentials) 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 MQBrokerAccessCredentials) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MQBrokerAccessCredentials) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MQBrokerAccessCredentials"} - if s.BasicAuth != nil && len(*s.BasicAuth) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BasicAuth", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasicAuth sets the BasicAuth field's value. -func (s *MQBrokerAccessCredentials) SetBasicAuth(v string) *MQBrokerAccessCredentials { - s.BasicAuth = &v - return s -} - -// The Secrets Manager secret that stores your stream credentials. -type MSKAccessCredentials struct { - _ struct{} `type:"structure"` - - // The ARN of the Secrets Manager secret. - ClientCertificateTlsAuth *string `min:"1" type:"string"` - - // The ARN of the Secrets Manager secret. - SaslScram512Auth *string `min:"1" 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 MSKAccessCredentials) 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 MSKAccessCredentials) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MSKAccessCredentials) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MSKAccessCredentials"} - if s.ClientCertificateTlsAuth != nil && len(*s.ClientCertificateTlsAuth) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientCertificateTlsAuth", 1)) - } - if s.SaslScram512Auth != nil && len(*s.SaslScram512Auth) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SaslScram512Auth", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientCertificateTlsAuth sets the ClientCertificateTlsAuth field's value. -func (s *MSKAccessCredentials) SetClientCertificateTlsAuth(v string) *MSKAccessCredentials { - s.ClientCertificateTlsAuth = &v - return s -} - -// SetSaslScram512Auth sets the SaslScram512Auth field's value. -func (s *MSKAccessCredentials) SetSaslScram512Auth(v string) *MSKAccessCredentials { - s.SaslScram512Auth = &v - return s -} - -// This structure specifies the network configuration for an Amazon ECS task. -type NetworkConfiguration struct { - _ struct{} `type:"structure"` - - // Use this structure to specify the VPC subnets and security groups for the - // task, and whether a public IP address is to be used. This structure is relevant - // only for ECS tasks that use the awsvpc network mode. - AwsvpcConfiguration *AwsVpcConfiguration `locationName:"awsvpcConfiguration" 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 NetworkConfiguration) 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 NetworkConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NetworkConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NetworkConfiguration"} - if s.AwsvpcConfiguration != nil { - if err := s.AwsvpcConfiguration.Validate(); err != nil { - invalidParams.AddNested("AwsvpcConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsvpcConfiguration sets the AwsvpcConfiguration field's value. -func (s *NetworkConfiguration) SetAwsvpcConfiguration(v *AwsVpcConfiguration) *NetworkConfiguration { - s.AwsvpcConfiguration = v - return s -} - -// An entity that you specified does not exist. -type NotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 NotFoundException) 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 NotFoundException) GoString() string { - return s.String() -} - -func newErrorNotFoundException(v protocol.ResponseMetadata) error { - return &NotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *NotFoundException) Code() string { - return "NotFoundException" -} - -// Message returns the exception's message. -func (s *NotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *NotFoundException) OrigErr() error { - return nil -} - -func (s *NotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *NotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *NotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An object that represents a pipe. Amazon EventBridgePipes connect event sources -// to targets and reduces the need for specialized knowledge and integration -// code. -type Pipe struct { - _ struct{} `type:"structure"` - - // The ARN of the pipe. - Arn *string `min:"1" type:"string"` - - // The time the pipe was created. - CreationTime *time.Time `type:"timestamp"` - - // The state the pipe is in. - CurrentState *string `type:"string" enum:"PipeState"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeState"` - - // The ARN of the enrichment resource. - Enrichment *string `type:"string"` - - // When the pipe was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime) - // (YYYY-MM-DDThh:mm:ss.sTZD). - LastModifiedTime *time.Time `type:"timestamp"` - - // The name of the pipe. - Name *string `min:"1" type:"string"` - - // The ARN of the source resource. - Source *string `min:"1" type:"string"` - - // The reason the pipe is in its current state. - StateReason *string `type:"string"` - - // The ARN of the target resource. - Target *string `min:"1" 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 Pipe) 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 Pipe) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Pipe) SetArn(v string) *Pipe { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *Pipe) SetCreationTime(v time.Time) *Pipe { - s.CreationTime = &v - return s -} - -// SetCurrentState sets the CurrentState field's value. -func (s *Pipe) SetCurrentState(v string) *Pipe { - s.CurrentState = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *Pipe) SetDesiredState(v string) *Pipe { - s.DesiredState = &v - return s -} - -// SetEnrichment sets the Enrichment field's value. -func (s *Pipe) SetEnrichment(v string) *Pipe { - s.Enrichment = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *Pipe) SetLastModifiedTime(v time.Time) *Pipe { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *Pipe) SetName(v string) *Pipe { - s.Name = &v - return s -} - -// SetSource sets the Source field's value. -func (s *Pipe) SetSource(v string) *Pipe { - s.Source = &v - return s -} - -// SetStateReason sets the StateReason field's value. -func (s *Pipe) SetStateReason(v string) *Pipe { - s.StateReason = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *Pipe) SetTarget(v string) *Pipe { - s.Target = &v - return s -} - -// These are custom parameter to be used when the target is an API Gateway REST -// APIs or EventBridge ApiDestinations. In the latter case, these are merged -// with any InvocationParameters specified on the Connection, with any values -// from the Connection taking precedence. -type PipeEnrichmentHttpParameters struct { - _ struct{} `type:"structure"` - - // The headers that need to be sent as part of request invoking the API Gateway - // REST API or EventBridge ApiDestination. - HeaderParameters map[string]*string `type:"map"` - - // The path parameter values to be used to populate API Gateway REST API or - // EventBridge ApiDestination path wildcards ("*"). - PathParameterValues []*string `type:"list"` - - // The query string keys/values that need to be sent as part of request invoking - // the API Gateway REST API or EventBridge ApiDestination. - QueryStringParameters map[string]*string `type:"map"` -} - -// 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 PipeEnrichmentHttpParameters) 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 PipeEnrichmentHttpParameters) GoString() string { - return s.String() -} - -// SetHeaderParameters sets the HeaderParameters field's value. -func (s *PipeEnrichmentHttpParameters) SetHeaderParameters(v map[string]*string) *PipeEnrichmentHttpParameters { - s.HeaderParameters = v - return s -} - -// SetPathParameterValues sets the PathParameterValues field's value. -func (s *PipeEnrichmentHttpParameters) SetPathParameterValues(v []*string) *PipeEnrichmentHttpParameters { - s.PathParameterValues = v - return s -} - -// SetQueryStringParameters sets the QueryStringParameters field's value. -func (s *PipeEnrichmentHttpParameters) SetQueryStringParameters(v map[string]*string) *PipeEnrichmentHttpParameters { - s.QueryStringParameters = v - return s -} - -// The parameters required to set up enrichment on your pipe. -type PipeEnrichmentParameters struct { - _ struct{} `type:"structure"` - - // Contains the HTTP parameters to use when the target is a API Gateway REST - // endpoint or EventBridge ApiDestination. - // - // If you specify an API Gateway REST API or EventBridge ApiDestination as a - // target, you can use this parameter to specify headers, path parameters, and - // query string keys/values as part of your target invoking request. If you're - // using ApiDestinations, the corresponding Connection can also have these values - // configured. In case of any conflicting keys, values from the Connection take - // precedence. - HttpParameters *PipeEnrichmentHttpParameters `type:"structure"` - - // Valid JSON text passed to the enrichment. In this case, nothing from the - // event itself is passed to the enrichment. For more information, see The JavaScript - // Object Notation (JSON) Data Interchange Format (http://www.rfc-editor.org/rfc/rfc7159.txt). - // - // To remove an input template, specify an empty string. - // - // InputTemplate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeEnrichmentParameters's - // String and GoString methods. - InputTemplate *string `type:"string" sensitive:"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 PipeEnrichmentParameters) 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 PipeEnrichmentParameters) GoString() string { - return s.String() -} - -// SetHttpParameters sets the HttpParameters field's value. -func (s *PipeEnrichmentParameters) SetHttpParameters(v *PipeEnrichmentHttpParameters) *PipeEnrichmentParameters { - s.HttpParameters = v - return s -} - -// SetInputTemplate sets the InputTemplate field's value. -func (s *PipeEnrichmentParameters) SetInputTemplate(v string) *PipeEnrichmentParameters { - s.InputTemplate = &v - return s -} - -// The logging configuration settings for the pipe. -type PipeLogConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon CloudWatch Logs logging configuration settings for the pipe. - CloudwatchLogsLogDestination *CloudwatchLogsLogDestination `type:"structure"` - - // The Amazon Kinesis Data Firehose logging configuration settings for the pipe. - FirehoseLogDestination *FirehoseLogDestination `type:"structure"` - - // Whether the execution data (specifically, the payload, awsRequest, and awsResponse - // fields) is included in the log messages for this pipe. - // - // This applies to all log destinations for the pipe. - // - // For more information, see Including execution data in logs (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-execution-data) - // in the Amazon EventBridge User Guide. - IncludeExecutionData []*string `type:"list" enum:"IncludeExecutionDataOption"` - - // The level of logging detail to include. This applies to all log destinations - // for the pipe. - Level *string `type:"string" enum:"LogLevel"` - - // The Amazon S3 logging configuration settings for the pipe. - S3LogDestination *S3LogDestination `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 PipeLogConfiguration) 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 PipeLogConfiguration) GoString() string { - return s.String() -} - -// SetCloudwatchLogsLogDestination sets the CloudwatchLogsLogDestination field's value. -func (s *PipeLogConfiguration) SetCloudwatchLogsLogDestination(v *CloudwatchLogsLogDestination) *PipeLogConfiguration { - s.CloudwatchLogsLogDestination = v - return s -} - -// SetFirehoseLogDestination sets the FirehoseLogDestination field's value. -func (s *PipeLogConfiguration) SetFirehoseLogDestination(v *FirehoseLogDestination) *PipeLogConfiguration { - s.FirehoseLogDestination = v - return s -} - -// SetIncludeExecutionData sets the IncludeExecutionData field's value. -func (s *PipeLogConfiguration) SetIncludeExecutionData(v []*string) *PipeLogConfiguration { - s.IncludeExecutionData = v - return s -} - -// SetLevel sets the Level field's value. -func (s *PipeLogConfiguration) SetLevel(v string) *PipeLogConfiguration { - s.Level = &v - return s -} - -// SetS3LogDestination sets the S3LogDestination field's value. -func (s *PipeLogConfiguration) SetS3LogDestination(v *S3LogDestination) *PipeLogConfiguration { - s.S3LogDestination = v - return s -} - -// Specifies the logging configuration settings for the pipe. -// -// When you call UpdatePipe, EventBridge updates the fields in the PipeLogConfigurationParameters -// object atomically as one and overrides existing values. This is by design. -// If you don't specify an optional field in any of the Amazon Web Services -// service parameters objects (CloudwatchLogsLogDestinationParameters, FirehoseLogDestinationParameters, -// or S3LogDestinationParameters), EventBridge sets that field to its system-default -// value during the update. -// -// For example, suppose when you created the pipe you specified a Kinesis Data -// Firehose stream log destination. You then update the pipe to add an Amazon -// S3 log destination. In addition to specifying the S3LogDestinationParameters -// for the new log destination, you must also specify the fields in the FirehoseLogDestinationParameters -// object in order to retain the Kinesis Data Firehose stream log destination. -// -// For more information on generating pipe log records, see Log EventBridge -// Pipes (eventbridge/latest/userguide/eb-pipes-logs.html) in the Amazon EventBridge -// User Guide. -type PipeLogConfigurationParameters struct { - _ struct{} `type:"structure"` - - // The Amazon CloudWatch Logs logging configuration settings for the pipe. - CloudwatchLogsLogDestination *CloudwatchLogsLogDestinationParameters `type:"structure"` - - // The Amazon Kinesis Data Firehose logging configuration settings for the pipe. - FirehoseLogDestination *FirehoseLogDestinationParameters `type:"structure"` - - // Specify ON to include the execution data (specifically, the payload and awsRequest - // fields) in the log messages for this pipe. - // - // This applies to all log destinations for the pipe. - // - // For more information, see Including execution data in logs (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-execution-data) - // in the Amazon EventBridge User Guide. - // - // The default is OFF. - IncludeExecutionData []*string `type:"list" enum:"IncludeExecutionDataOption"` - - // The level of logging detail to include. This applies to all log destinations - // for the pipe. - // - // For more information, see Specifying EventBridge Pipes log level (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-level) - // in the Amazon EventBridge User Guide. - // - // Level is a required field - Level *string `type:"string" required:"true" enum:"LogLevel"` - - // The Amazon S3 logging configuration settings for the pipe. - S3LogDestination *S3LogDestinationParameters `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 PipeLogConfigurationParameters) 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 PipeLogConfigurationParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeLogConfigurationParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeLogConfigurationParameters"} - if s.Level == nil { - invalidParams.Add(request.NewErrParamRequired("Level")) - } - if s.CloudwatchLogsLogDestination != nil { - if err := s.CloudwatchLogsLogDestination.Validate(); err != nil { - invalidParams.AddNested("CloudwatchLogsLogDestination", err.(request.ErrInvalidParams)) - } - } - if s.FirehoseLogDestination != nil { - if err := s.FirehoseLogDestination.Validate(); err != nil { - invalidParams.AddNested("FirehoseLogDestination", err.(request.ErrInvalidParams)) - } - } - if s.S3LogDestination != nil { - if err := s.S3LogDestination.Validate(); err != nil { - invalidParams.AddNested("S3LogDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudwatchLogsLogDestination sets the CloudwatchLogsLogDestination field's value. -func (s *PipeLogConfigurationParameters) SetCloudwatchLogsLogDestination(v *CloudwatchLogsLogDestinationParameters) *PipeLogConfigurationParameters { - s.CloudwatchLogsLogDestination = v - return s -} - -// SetFirehoseLogDestination sets the FirehoseLogDestination field's value. -func (s *PipeLogConfigurationParameters) SetFirehoseLogDestination(v *FirehoseLogDestinationParameters) *PipeLogConfigurationParameters { - s.FirehoseLogDestination = v - return s -} - -// SetIncludeExecutionData sets the IncludeExecutionData field's value. -func (s *PipeLogConfigurationParameters) SetIncludeExecutionData(v []*string) *PipeLogConfigurationParameters { - s.IncludeExecutionData = v - return s -} - -// SetLevel sets the Level field's value. -func (s *PipeLogConfigurationParameters) SetLevel(v string) *PipeLogConfigurationParameters { - s.Level = &v - return s -} - -// SetS3LogDestination sets the S3LogDestination field's value. -func (s *PipeLogConfigurationParameters) SetS3LogDestination(v *S3LogDestinationParameters) *PipeLogConfigurationParameters { - s.S3LogDestination = v - return s -} - -// The parameters for using an Active MQ broker as a source. -type PipeSourceActiveMQBrokerParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The credentials needed to access the resource. - // - // Credentials is a required field - Credentials *MQBrokerAccessCredentials `type:"structure" required:"true"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // The name of the destination queue to consume. - // - // QueueName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeSourceActiveMQBrokerParameters's - // String and GoString methods. - // - // QueueName is a required field - QueueName *string `min:"1" type:"string" required:"true" sensitive:"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 PipeSourceActiveMQBrokerParameters) 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 PipeSourceActiveMQBrokerParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeSourceActiveMQBrokerParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeSourceActiveMQBrokerParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.Credentials == nil { - invalidParams.Add(request.NewErrParamRequired("Credentials")) - } - if s.QueueName == nil { - invalidParams.Add(request.NewErrParamRequired("QueueName")) - } - if s.QueueName != nil && len(*s.QueueName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueueName", 1)) - } - if s.Credentials != nil { - if err := s.Credentials.Validate(); err != nil { - invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *PipeSourceActiveMQBrokerParameters) SetBatchSize(v int64) *PipeSourceActiveMQBrokerParameters { - s.BatchSize = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *PipeSourceActiveMQBrokerParameters) SetCredentials(v *MQBrokerAccessCredentials) *PipeSourceActiveMQBrokerParameters { - s.Credentials = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *PipeSourceActiveMQBrokerParameters) SetMaximumBatchingWindowInSeconds(v int64) *PipeSourceActiveMQBrokerParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetQueueName sets the QueueName field's value. -func (s *PipeSourceActiveMQBrokerParameters) SetQueueName(v string) *PipeSourceActiveMQBrokerParameters { - s.QueueName = &v - return s -} - -// The parameters for using a DynamoDB stream as a source. -type PipeSourceDynamoDBStreamParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // Define the target queue to send dead-letter queue events to. - DeadLetterConfig *DeadLetterConfig `type:"structure"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // (Streams only) Discard records older than the specified age. The default - // value is -1, which sets the maximum age to infinite. When the value is set - // to infinite, EventBridge never discards old records. - MaximumRecordAgeInSeconds *int64 `type:"integer"` - - // (Streams only) Discard records after the specified number of retries. The - // default value is -1, which sets the maximum number of retries to infinite. - // When MaximumRetryAttempts is infinite, EventBridge retries failed records - // until the record expires in the event source. - MaximumRetryAttempts *int64 `type:"integer"` - - // (Streams only) Define how to handle item process failures. AUTOMATIC_BISECT - // halves each batch and retry each half until all the records are processed - // or there is one failed message left in the batch. - OnPartialBatchItemFailure *string `type:"string" enum:"OnPartialBatchItemFailureStreams"` - - // (Streams only) The number of batches to process concurrently from each shard. - // The default value is 1. - ParallelizationFactor *int64 `min:"1" type:"integer"` - - // (Streams only) The position in a stream from which to start reading. - // - // StartingPosition is a required field - StartingPosition *string `type:"string" required:"true" enum:"DynamoDBStreamStartPosition"` -} - -// 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 PipeSourceDynamoDBStreamParameters) 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 PipeSourceDynamoDBStreamParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeSourceDynamoDBStreamParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeSourceDynamoDBStreamParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.MaximumRecordAgeInSeconds != nil && *s.MaximumRecordAgeInSeconds < -1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumRecordAgeInSeconds", -1)) - } - if s.MaximumRetryAttempts != nil && *s.MaximumRetryAttempts < -1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumRetryAttempts", -1)) - } - if s.ParallelizationFactor != nil && *s.ParallelizationFactor < 1 { - invalidParams.Add(request.NewErrParamMinValue("ParallelizationFactor", 1)) - } - if s.StartingPosition == nil { - invalidParams.Add(request.NewErrParamRequired("StartingPosition")) - } - if s.DeadLetterConfig != nil { - if err := s.DeadLetterConfig.Validate(); err != nil { - invalidParams.AddNested("DeadLetterConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *PipeSourceDynamoDBStreamParameters) SetBatchSize(v int64) *PipeSourceDynamoDBStreamParameters { - s.BatchSize = &v - return s -} - -// SetDeadLetterConfig sets the DeadLetterConfig field's value. -func (s *PipeSourceDynamoDBStreamParameters) SetDeadLetterConfig(v *DeadLetterConfig) *PipeSourceDynamoDBStreamParameters { - s.DeadLetterConfig = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *PipeSourceDynamoDBStreamParameters) SetMaximumBatchingWindowInSeconds(v int64) *PipeSourceDynamoDBStreamParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetMaximumRecordAgeInSeconds sets the MaximumRecordAgeInSeconds field's value. -func (s *PipeSourceDynamoDBStreamParameters) SetMaximumRecordAgeInSeconds(v int64) *PipeSourceDynamoDBStreamParameters { - s.MaximumRecordAgeInSeconds = &v - return s -} - -// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. -func (s *PipeSourceDynamoDBStreamParameters) SetMaximumRetryAttempts(v int64) *PipeSourceDynamoDBStreamParameters { - s.MaximumRetryAttempts = &v - return s -} - -// SetOnPartialBatchItemFailure sets the OnPartialBatchItemFailure field's value. -func (s *PipeSourceDynamoDBStreamParameters) SetOnPartialBatchItemFailure(v string) *PipeSourceDynamoDBStreamParameters { - s.OnPartialBatchItemFailure = &v - return s -} - -// SetParallelizationFactor sets the ParallelizationFactor field's value. -func (s *PipeSourceDynamoDBStreamParameters) SetParallelizationFactor(v int64) *PipeSourceDynamoDBStreamParameters { - s.ParallelizationFactor = &v - return s -} - -// SetStartingPosition sets the StartingPosition field's value. -func (s *PipeSourceDynamoDBStreamParameters) SetStartingPosition(v string) *PipeSourceDynamoDBStreamParameters { - s.StartingPosition = &v - return s -} - -// The parameters for using a Kinesis stream as a source. -type PipeSourceKinesisStreamParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // Define the target queue to send dead-letter queue events to. - DeadLetterConfig *DeadLetterConfig `type:"structure"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // (Streams only) Discard records older than the specified age. The default - // value is -1, which sets the maximum age to infinite. When the value is set - // to infinite, EventBridge never discards old records. - MaximumRecordAgeInSeconds *int64 `type:"integer"` - - // (Streams only) Discard records after the specified number of retries. The - // default value is -1, which sets the maximum number of retries to infinite. - // When MaximumRetryAttempts is infinite, EventBridge retries failed records - // until the record expires in the event source. - MaximumRetryAttempts *int64 `type:"integer"` - - // (Streams only) Define how to handle item process failures. AUTOMATIC_BISECT - // halves each batch and retry each half until all the records are processed - // or there is one failed message left in the batch. - OnPartialBatchItemFailure *string `type:"string" enum:"OnPartialBatchItemFailureStreams"` - - // (Streams only) The number of batches to process concurrently from each shard. - // The default value is 1. - ParallelizationFactor *int64 `min:"1" type:"integer"` - - // (Streams only) The position in a stream from which to start reading. - // - // StartingPosition is a required field - StartingPosition *string `type:"string" required:"true" enum:"KinesisStreamStartPosition"` - - // With StartingPosition set to AT_TIMESTAMP, the time from which to start reading, - // in Unix time seconds. - StartingPositionTimestamp *time.Time `type:"timestamp"` -} - -// 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 PipeSourceKinesisStreamParameters) 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 PipeSourceKinesisStreamParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeSourceKinesisStreamParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeSourceKinesisStreamParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.MaximumRecordAgeInSeconds != nil && *s.MaximumRecordAgeInSeconds < -1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumRecordAgeInSeconds", -1)) - } - if s.MaximumRetryAttempts != nil && *s.MaximumRetryAttempts < -1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumRetryAttempts", -1)) - } - if s.ParallelizationFactor != nil && *s.ParallelizationFactor < 1 { - invalidParams.Add(request.NewErrParamMinValue("ParallelizationFactor", 1)) - } - if s.StartingPosition == nil { - invalidParams.Add(request.NewErrParamRequired("StartingPosition")) - } - if s.DeadLetterConfig != nil { - if err := s.DeadLetterConfig.Validate(); err != nil { - invalidParams.AddNested("DeadLetterConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *PipeSourceKinesisStreamParameters) SetBatchSize(v int64) *PipeSourceKinesisStreamParameters { - s.BatchSize = &v - return s -} - -// SetDeadLetterConfig sets the DeadLetterConfig field's value. -func (s *PipeSourceKinesisStreamParameters) SetDeadLetterConfig(v *DeadLetterConfig) *PipeSourceKinesisStreamParameters { - s.DeadLetterConfig = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *PipeSourceKinesisStreamParameters) SetMaximumBatchingWindowInSeconds(v int64) *PipeSourceKinesisStreamParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetMaximumRecordAgeInSeconds sets the MaximumRecordAgeInSeconds field's value. -func (s *PipeSourceKinesisStreamParameters) SetMaximumRecordAgeInSeconds(v int64) *PipeSourceKinesisStreamParameters { - s.MaximumRecordAgeInSeconds = &v - return s -} - -// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. -func (s *PipeSourceKinesisStreamParameters) SetMaximumRetryAttempts(v int64) *PipeSourceKinesisStreamParameters { - s.MaximumRetryAttempts = &v - return s -} - -// SetOnPartialBatchItemFailure sets the OnPartialBatchItemFailure field's value. -func (s *PipeSourceKinesisStreamParameters) SetOnPartialBatchItemFailure(v string) *PipeSourceKinesisStreamParameters { - s.OnPartialBatchItemFailure = &v - return s -} - -// SetParallelizationFactor sets the ParallelizationFactor field's value. -func (s *PipeSourceKinesisStreamParameters) SetParallelizationFactor(v int64) *PipeSourceKinesisStreamParameters { - s.ParallelizationFactor = &v - return s -} - -// SetStartingPosition sets the StartingPosition field's value. -func (s *PipeSourceKinesisStreamParameters) SetStartingPosition(v string) *PipeSourceKinesisStreamParameters { - s.StartingPosition = &v - return s -} - -// SetStartingPositionTimestamp sets the StartingPositionTimestamp field's value. -func (s *PipeSourceKinesisStreamParameters) SetStartingPositionTimestamp(v time.Time) *PipeSourceKinesisStreamParameters { - s.StartingPositionTimestamp = &v - return s -} - -// The parameters for using an MSK stream as a source. -type PipeSourceManagedStreamingKafkaParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The name of the destination queue to consume. - // - // ConsumerGroupID is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeSourceManagedStreamingKafkaParameters's - // String and GoString methods. - ConsumerGroupID *string `min:"1" type:"string" sensitive:"true"` - - // The credentials needed to access the resource. - Credentials *MSKAccessCredentials `type:"structure"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // (Streams only) The position in a stream from which to start reading. - StartingPosition *string `type:"string" enum:"MSKStartPosition"` - - // The name of the topic that the pipe will read from. - // - // TopicName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeSourceManagedStreamingKafkaParameters's - // String and GoString methods. - // - // TopicName is a required field - TopicName *string `min:"1" type:"string" required:"true" sensitive:"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 PipeSourceManagedStreamingKafkaParameters) 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 PipeSourceManagedStreamingKafkaParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeSourceManagedStreamingKafkaParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeSourceManagedStreamingKafkaParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.ConsumerGroupID != nil && len(*s.ConsumerGroupID) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConsumerGroupID", 1)) - } - if s.TopicName == nil { - invalidParams.Add(request.NewErrParamRequired("TopicName")) - } - if s.TopicName != nil && len(*s.TopicName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicName", 1)) - } - if s.Credentials != nil { - if err := s.Credentials.Validate(); err != nil { - invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *PipeSourceManagedStreamingKafkaParameters) SetBatchSize(v int64) *PipeSourceManagedStreamingKafkaParameters { - s.BatchSize = &v - return s -} - -// SetConsumerGroupID sets the ConsumerGroupID field's value. -func (s *PipeSourceManagedStreamingKafkaParameters) SetConsumerGroupID(v string) *PipeSourceManagedStreamingKafkaParameters { - s.ConsumerGroupID = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *PipeSourceManagedStreamingKafkaParameters) SetCredentials(v *MSKAccessCredentials) *PipeSourceManagedStreamingKafkaParameters { - s.Credentials = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *PipeSourceManagedStreamingKafkaParameters) SetMaximumBatchingWindowInSeconds(v int64) *PipeSourceManagedStreamingKafkaParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetStartingPosition sets the StartingPosition field's value. -func (s *PipeSourceManagedStreamingKafkaParameters) SetStartingPosition(v string) *PipeSourceManagedStreamingKafkaParameters { - s.StartingPosition = &v - return s -} - -// SetTopicName sets the TopicName field's value. -func (s *PipeSourceManagedStreamingKafkaParameters) SetTopicName(v string) *PipeSourceManagedStreamingKafkaParameters { - s.TopicName = &v - return s -} - -// The parameters required to set up a source for your pipe. -type PipeSourceParameters struct { - _ struct{} `type:"structure"` - - // The parameters for using an Active MQ broker as a source. - ActiveMQBrokerParameters *PipeSourceActiveMQBrokerParameters `type:"structure"` - - // The parameters for using a DynamoDB stream as a source. - DynamoDBStreamParameters *PipeSourceDynamoDBStreamParameters `type:"structure"` - - // The collection of event patterns used to filter events. - // - // To remove a filter, specify a FilterCriteria object with an empty array of - // Filter objects. - // - // For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) - // in the Amazon EventBridge User Guide. - FilterCriteria *FilterCriteria `type:"structure"` - - // The parameters for using a Kinesis stream as a source. - KinesisStreamParameters *PipeSourceKinesisStreamParameters `type:"structure"` - - // The parameters for using an MSK stream as a source. - ManagedStreamingKafkaParameters *PipeSourceManagedStreamingKafkaParameters `type:"structure"` - - // The parameters for using a Rabbit MQ broker as a source. - RabbitMQBrokerParameters *PipeSourceRabbitMQBrokerParameters `type:"structure"` - - // The parameters for using a self-managed Apache Kafka stream as a source. - SelfManagedKafkaParameters *PipeSourceSelfManagedKafkaParameters `type:"structure"` - - // The parameters for using a Amazon SQS stream as a source. - SqsQueueParameters *PipeSourceSqsQueueParameters `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 PipeSourceParameters) 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 PipeSourceParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeSourceParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeSourceParameters"} - if s.ActiveMQBrokerParameters != nil { - if err := s.ActiveMQBrokerParameters.Validate(); err != nil { - invalidParams.AddNested("ActiveMQBrokerParameters", err.(request.ErrInvalidParams)) - } - } - if s.DynamoDBStreamParameters != nil { - if err := s.DynamoDBStreamParameters.Validate(); err != nil { - invalidParams.AddNested("DynamoDBStreamParameters", err.(request.ErrInvalidParams)) - } - } - if s.KinesisStreamParameters != nil { - if err := s.KinesisStreamParameters.Validate(); err != nil { - invalidParams.AddNested("KinesisStreamParameters", err.(request.ErrInvalidParams)) - } - } - if s.ManagedStreamingKafkaParameters != nil { - if err := s.ManagedStreamingKafkaParameters.Validate(); err != nil { - invalidParams.AddNested("ManagedStreamingKafkaParameters", err.(request.ErrInvalidParams)) - } - } - if s.RabbitMQBrokerParameters != nil { - if err := s.RabbitMQBrokerParameters.Validate(); err != nil { - invalidParams.AddNested("RabbitMQBrokerParameters", err.(request.ErrInvalidParams)) - } - } - if s.SelfManagedKafkaParameters != nil { - if err := s.SelfManagedKafkaParameters.Validate(); err != nil { - invalidParams.AddNested("SelfManagedKafkaParameters", err.(request.ErrInvalidParams)) - } - } - if s.SqsQueueParameters != nil { - if err := s.SqsQueueParameters.Validate(); err != nil { - invalidParams.AddNested("SqsQueueParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActiveMQBrokerParameters sets the ActiveMQBrokerParameters field's value. -func (s *PipeSourceParameters) SetActiveMQBrokerParameters(v *PipeSourceActiveMQBrokerParameters) *PipeSourceParameters { - s.ActiveMQBrokerParameters = v - return s -} - -// SetDynamoDBStreamParameters sets the DynamoDBStreamParameters field's value. -func (s *PipeSourceParameters) SetDynamoDBStreamParameters(v *PipeSourceDynamoDBStreamParameters) *PipeSourceParameters { - s.DynamoDBStreamParameters = v - return s -} - -// SetFilterCriteria sets the FilterCriteria field's value. -func (s *PipeSourceParameters) SetFilterCriteria(v *FilterCriteria) *PipeSourceParameters { - s.FilterCriteria = v - return s -} - -// SetKinesisStreamParameters sets the KinesisStreamParameters field's value. -func (s *PipeSourceParameters) SetKinesisStreamParameters(v *PipeSourceKinesisStreamParameters) *PipeSourceParameters { - s.KinesisStreamParameters = v - return s -} - -// SetManagedStreamingKafkaParameters sets the ManagedStreamingKafkaParameters field's value. -func (s *PipeSourceParameters) SetManagedStreamingKafkaParameters(v *PipeSourceManagedStreamingKafkaParameters) *PipeSourceParameters { - s.ManagedStreamingKafkaParameters = v - return s -} - -// SetRabbitMQBrokerParameters sets the RabbitMQBrokerParameters field's value. -func (s *PipeSourceParameters) SetRabbitMQBrokerParameters(v *PipeSourceRabbitMQBrokerParameters) *PipeSourceParameters { - s.RabbitMQBrokerParameters = v - return s -} - -// SetSelfManagedKafkaParameters sets the SelfManagedKafkaParameters field's value. -func (s *PipeSourceParameters) SetSelfManagedKafkaParameters(v *PipeSourceSelfManagedKafkaParameters) *PipeSourceParameters { - s.SelfManagedKafkaParameters = v - return s -} - -// SetSqsQueueParameters sets the SqsQueueParameters field's value. -func (s *PipeSourceParameters) SetSqsQueueParameters(v *PipeSourceSqsQueueParameters) *PipeSourceParameters { - s.SqsQueueParameters = v - return s -} - -// The parameters for using a Rabbit MQ broker as a source. -type PipeSourceRabbitMQBrokerParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The credentials needed to access the resource. - // - // Credentials is a required field - Credentials *MQBrokerAccessCredentials `type:"structure" required:"true"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // The name of the destination queue to consume. - // - // QueueName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeSourceRabbitMQBrokerParameters's - // String and GoString methods. - // - // QueueName is a required field - QueueName *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The name of the virtual host associated with the source broker. - // - // VirtualHost is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeSourceRabbitMQBrokerParameters's - // String and GoString methods. - VirtualHost *string `min:"1" type:"string" sensitive:"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 PipeSourceRabbitMQBrokerParameters) 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 PipeSourceRabbitMQBrokerParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeSourceRabbitMQBrokerParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeSourceRabbitMQBrokerParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.Credentials == nil { - invalidParams.Add(request.NewErrParamRequired("Credentials")) - } - if s.QueueName == nil { - invalidParams.Add(request.NewErrParamRequired("QueueName")) - } - if s.QueueName != nil && len(*s.QueueName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueueName", 1)) - } - if s.VirtualHost != nil && len(*s.VirtualHost) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VirtualHost", 1)) - } - if s.Credentials != nil { - if err := s.Credentials.Validate(); err != nil { - invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *PipeSourceRabbitMQBrokerParameters) SetBatchSize(v int64) *PipeSourceRabbitMQBrokerParameters { - s.BatchSize = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *PipeSourceRabbitMQBrokerParameters) SetCredentials(v *MQBrokerAccessCredentials) *PipeSourceRabbitMQBrokerParameters { - s.Credentials = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *PipeSourceRabbitMQBrokerParameters) SetMaximumBatchingWindowInSeconds(v int64) *PipeSourceRabbitMQBrokerParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetQueueName sets the QueueName field's value. -func (s *PipeSourceRabbitMQBrokerParameters) SetQueueName(v string) *PipeSourceRabbitMQBrokerParameters { - s.QueueName = &v - return s -} - -// SetVirtualHost sets the VirtualHost field's value. -func (s *PipeSourceRabbitMQBrokerParameters) SetVirtualHost(v string) *PipeSourceRabbitMQBrokerParameters { - s.VirtualHost = &v - return s -} - -// The parameters for using a self-managed Apache Kafka stream as a source. -type PipeSourceSelfManagedKafkaParameters struct { - _ struct{} `type:"structure"` - - // An array of server URLs. - AdditionalBootstrapServers []*string `type:"list"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The name of the destination queue to consume. - // - // ConsumerGroupID is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeSourceSelfManagedKafkaParameters's - // String and GoString methods. - ConsumerGroupID *string `min:"1" type:"string" sensitive:"true"` - - // The credentials needed to access the resource. - Credentials *SelfManagedKafkaAccessConfigurationCredentials `type:"structure"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // The ARN of the Secrets Manager secret used for certification. - ServerRootCaCertificate *string `min:"1" type:"string"` - - // (Streams only) The position in a stream from which to start reading. - StartingPosition *string `type:"string" enum:"SelfManagedKafkaStartPosition"` - - // The name of the topic that the pipe will read from. - // - // TopicName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeSourceSelfManagedKafkaParameters's - // String and GoString methods. - // - // TopicName is a required field - TopicName *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // This structure specifies the VPC subnets and security groups for the stream, - // and whether a public IP address is to be used. - Vpc *SelfManagedKafkaAccessConfigurationVpc `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 PipeSourceSelfManagedKafkaParameters) 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 PipeSourceSelfManagedKafkaParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeSourceSelfManagedKafkaParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeSourceSelfManagedKafkaParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.ConsumerGroupID != nil && len(*s.ConsumerGroupID) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConsumerGroupID", 1)) - } - if s.ServerRootCaCertificate != nil && len(*s.ServerRootCaCertificate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServerRootCaCertificate", 1)) - } - if s.TopicName == nil { - invalidParams.Add(request.NewErrParamRequired("TopicName")) - } - if s.TopicName != nil && len(*s.TopicName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TopicName", 1)) - } - if s.Credentials != nil { - if err := s.Credentials.Validate(); err != nil { - invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdditionalBootstrapServers sets the AdditionalBootstrapServers field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetAdditionalBootstrapServers(v []*string) *PipeSourceSelfManagedKafkaParameters { - s.AdditionalBootstrapServers = v - return s -} - -// SetBatchSize sets the BatchSize field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetBatchSize(v int64) *PipeSourceSelfManagedKafkaParameters { - s.BatchSize = &v - return s -} - -// SetConsumerGroupID sets the ConsumerGroupID field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetConsumerGroupID(v string) *PipeSourceSelfManagedKafkaParameters { - s.ConsumerGroupID = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetCredentials(v *SelfManagedKafkaAccessConfigurationCredentials) *PipeSourceSelfManagedKafkaParameters { - s.Credentials = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetMaximumBatchingWindowInSeconds(v int64) *PipeSourceSelfManagedKafkaParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetServerRootCaCertificate sets the ServerRootCaCertificate field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetServerRootCaCertificate(v string) *PipeSourceSelfManagedKafkaParameters { - s.ServerRootCaCertificate = &v - return s -} - -// SetStartingPosition sets the StartingPosition field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetStartingPosition(v string) *PipeSourceSelfManagedKafkaParameters { - s.StartingPosition = &v - return s -} - -// SetTopicName sets the TopicName field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetTopicName(v string) *PipeSourceSelfManagedKafkaParameters { - s.TopicName = &v - return s -} - -// SetVpc sets the Vpc field's value. -func (s *PipeSourceSelfManagedKafkaParameters) SetVpc(v *SelfManagedKafkaAccessConfigurationVpc) *PipeSourceSelfManagedKafkaParameters { - s.Vpc = v - return s -} - -// The parameters for using a Amazon SQS stream as a source. -type PipeSourceSqsQueueParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `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 PipeSourceSqsQueueParameters) 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 PipeSourceSqsQueueParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeSourceSqsQueueParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeSourceSqsQueueParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *PipeSourceSqsQueueParameters) SetBatchSize(v int64) *PipeSourceSqsQueueParameters { - s.BatchSize = &v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *PipeSourceSqsQueueParameters) SetMaximumBatchingWindowInSeconds(v int64) *PipeSourceSqsQueueParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// The parameters for using an Batch job as a target. -type PipeTargetBatchJobParameters struct { - _ struct{} `type:"structure"` - - // The array properties for the submitted job, such as the size of the array. - // The array size can be between 2 and 10,000. If you specify array properties - // for a job, it becomes an array job. This parameter is used only if the target - // is an Batch job. - ArrayProperties *BatchArrayProperties `type:"structure"` - - // The overrides that are sent to a container. - ContainerOverrides *BatchContainerOverrides `type:"structure"` - - // A list of dependencies for the job. A job can depend upon a maximum of 20 - // jobs. You can specify a SEQUENTIAL type dependency without specifying a job - // ID for array jobs so that each child array job completes sequentially, starting - // at index 0. You can also specify an N_TO_N type dependency with a job ID - // for array jobs. In that case, each index child of this job must wait for - // the corresponding index child of each dependency to complete before it can - // begin. - DependsOn []*BatchJobDependency `type:"list"` - - // The job definition used by this job. This value can be one of name, name:revision, - // or the Amazon Resource Name (ARN) for the job definition. If name is specified - // without a revision then the latest active revision is used. - // - // JobDefinition is a required field - JobDefinition *string `type:"string" required:"true"` - - // The name of the job. It can be up to 128 letters long. The first character - // must be alphanumeric, can contain uppercase and lowercase letters, numbers, - // hyphens (-), and underscores (_). - // - // JobName is a required field - JobName *string `type:"string" required:"true"` - - // Additional parameters passed to the job that replace parameter substitution - // placeholders that are set in the job definition. Parameters are specified - // as a key and value pair mapping. Parameters included here override any corresponding - // parameter defaults from the job definition. - Parameters map[string]*string `type:"map"` - - // The retry strategy to use for failed jobs. When a retry strategy is specified - // here, it overrides the retry strategy defined in the job definition. - RetryStrategy *BatchRetryStrategy `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 PipeTargetBatchJobParameters) 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 PipeTargetBatchJobParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeTargetBatchJobParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeTargetBatchJobParameters"} - if s.JobDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("JobDefinition")) - } - if s.JobName == nil { - invalidParams.Add(request.NewErrParamRequired("JobName")) - } - if s.ArrayProperties != nil { - if err := s.ArrayProperties.Validate(); err != nil { - invalidParams.AddNested("ArrayProperties", err.(request.ErrInvalidParams)) - } - } - if s.ContainerOverrides != nil { - if err := s.ContainerOverrides.Validate(); err != nil { - invalidParams.AddNested("ContainerOverrides", err.(request.ErrInvalidParams)) - } - } - if s.RetryStrategy != nil { - if err := s.RetryStrategy.Validate(); err != nil { - invalidParams.AddNested("RetryStrategy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArrayProperties sets the ArrayProperties field's value. -func (s *PipeTargetBatchJobParameters) SetArrayProperties(v *BatchArrayProperties) *PipeTargetBatchJobParameters { - s.ArrayProperties = v - return s -} - -// SetContainerOverrides sets the ContainerOverrides field's value. -func (s *PipeTargetBatchJobParameters) SetContainerOverrides(v *BatchContainerOverrides) *PipeTargetBatchJobParameters { - s.ContainerOverrides = v - return s -} - -// SetDependsOn sets the DependsOn field's value. -func (s *PipeTargetBatchJobParameters) SetDependsOn(v []*BatchJobDependency) *PipeTargetBatchJobParameters { - s.DependsOn = v - return s -} - -// SetJobDefinition sets the JobDefinition field's value. -func (s *PipeTargetBatchJobParameters) SetJobDefinition(v string) *PipeTargetBatchJobParameters { - s.JobDefinition = &v - return s -} - -// SetJobName sets the JobName field's value. -func (s *PipeTargetBatchJobParameters) SetJobName(v string) *PipeTargetBatchJobParameters { - s.JobName = &v - return s -} - -// SetParameters sets the Parameters field's value. -func (s *PipeTargetBatchJobParameters) SetParameters(v map[string]*string) *PipeTargetBatchJobParameters { - s.Parameters = v - return s -} - -// SetRetryStrategy sets the RetryStrategy field's value. -func (s *PipeTargetBatchJobParameters) SetRetryStrategy(v *BatchRetryStrategy) *PipeTargetBatchJobParameters { - s.RetryStrategy = v - return s -} - -// The parameters for using an CloudWatch Logs log stream as a target. -type PipeTargetCloudWatchLogsParameters struct { - _ struct{} `type:"structure"` - - // The name of the log stream. - LogStreamName *string `min:"1" type:"string"` - - // The time the event occurred, expressed as the number of milliseconds after - // Jan 1, 1970 00:00:00 UTC. - Timestamp *string `min:"1" 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 PipeTargetCloudWatchLogsParameters) 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 PipeTargetCloudWatchLogsParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeTargetCloudWatchLogsParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeTargetCloudWatchLogsParameters"} - if s.LogStreamName != nil && len(*s.LogStreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogStreamName", 1)) - } - if s.Timestamp != nil && len(*s.Timestamp) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Timestamp", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogStreamName sets the LogStreamName field's value. -func (s *PipeTargetCloudWatchLogsParameters) SetLogStreamName(v string) *PipeTargetCloudWatchLogsParameters { - s.LogStreamName = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *PipeTargetCloudWatchLogsParameters) SetTimestamp(v string) *PipeTargetCloudWatchLogsParameters { - s.Timestamp = &v - return s -} - -// The parameters for using an Amazon ECS task as a target. -type PipeTargetEcsTaskParameters struct { - _ struct{} `type:"structure"` - - // The capacity provider strategy to use for the task. - // - // If a capacityProviderStrategy is specified, the launchType parameter must - // be omitted. If no capacityProviderStrategy or launchType is specified, the - // defaultCapacityProviderStrategy for the cluster is used. - CapacityProviderStrategy []*CapacityProviderStrategyItem `type:"list"` - - // Specifies whether to enable Amazon ECS managed tags for the task. For more - // information, see Tagging Your Amazon ECS Resources (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) - // in the Amazon Elastic Container Service Developer Guide. - EnableECSManagedTags *bool `type:"boolean"` - - // Whether or not to enable the execute command functionality for the containers - // in this task. If true, this enables execute command functionality on all - // containers in the task. - EnableExecuteCommand *bool `type:"boolean"` - - // Specifies an Amazon ECS task group for the task. The maximum length is 255 - // characters. - Group *string `type:"string"` - - // Specifies the launch type on which your task is running. The launch type - // that you specify here must match one of the launch type (compatibilities) - // of the target task. The FARGATE value is supported only in the Regions where - // Fargate with Amazon ECS is supported. For more information, see Fargate on - // Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS-Fargate.html) - // in the Amazon Elastic Container Service Developer Guide. - LaunchType *string `type:"string" enum:"LaunchType"` - - // Use this structure if the Amazon ECS task uses the awsvpc network mode. This - // structure specifies the VPC subnets and security groups associated with the - // task, and whether a public IP address is to be used. This structure is required - // if LaunchType is FARGATE because the awsvpc mode is required for Fargate - // tasks. - // - // If you specify NetworkConfiguration when the target ECS task does not use - // the awsvpc network mode, the task fails. - NetworkConfiguration *NetworkConfiguration `type:"structure"` - - // The overrides that are associated with a task. - Overrides *EcsTaskOverride `type:"structure"` - - // An array of placement constraint objects to use for the task. You can specify - // up to 10 constraints per task (including constraints in the task definition - // and those specified at runtime). - PlacementConstraints []*PlacementConstraint `type:"list"` - - // The placement strategy objects to use for the task. You can specify a maximum - // of five strategy rules per task. - PlacementStrategy []*PlacementStrategy `type:"list"` - - // Specifies the platform version for the task. Specify only the numeric portion - // of the platform version, such as 1.1.0. - // - // This structure is used only if LaunchType is FARGATE. For more information - // about valid platform versions, see Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) - // in the Amazon Elastic Container Service Developer Guide. - PlatformVersion *string `type:"string"` - - // Specifies whether to propagate the tags from the task definition to the task. - // If no value is specified, the tags are not propagated. Tags can only be propagated - // to the task during task creation. To add tags to a task after task creation, - // use the TagResource API action. - PropagateTags *string `type:"string" enum:"PropagateTags"` - - // The reference ID to use for the task. - // - // ReferenceId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetEcsTaskParameters's - // String and GoString methods. - ReferenceId *string `type:"string" sensitive:"true"` - - // The metadata that you apply to the task to help you categorize and organize - // them. Each tag consists of a key and an optional value, both of which you - // define. To learn more, see RunTask (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-tags) - // in the Amazon ECS API Reference. - Tags []*Tag `type:"list"` - - // The number of tasks to create based on TaskDefinition. The default is 1. - TaskCount *int64 `min:"1" type:"integer"` - - // The ARN of the task definition to use if the event target is an Amazon ECS - // task. - // - // TaskDefinitionArn is a required field - TaskDefinitionArn *string `min:"1" 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 PipeTargetEcsTaskParameters) 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 PipeTargetEcsTaskParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeTargetEcsTaskParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeTargetEcsTaskParameters"} - if s.TaskCount != nil && *s.TaskCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("TaskCount", 1)) - } - if s.TaskDefinitionArn == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinitionArn")) - } - if s.TaskDefinitionArn != nil && len(*s.TaskDefinitionArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskDefinitionArn", 1)) - } - if s.CapacityProviderStrategy != nil { - for i, v := range s.CapacityProviderStrategy { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CapacityProviderStrategy", i), err.(request.ErrInvalidParams)) - } - } - } - if s.NetworkConfiguration != nil { - if err := s.NetworkConfiguration.Validate(); err != nil { - invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Overrides != nil { - if err := s.Overrides.Validate(); err != nil { - invalidParams.AddNested("Overrides", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. -func (s *PipeTargetEcsTaskParameters) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *PipeTargetEcsTaskParameters { - s.CapacityProviderStrategy = v - return s -} - -// SetEnableECSManagedTags sets the EnableECSManagedTags field's value. -func (s *PipeTargetEcsTaskParameters) SetEnableECSManagedTags(v bool) *PipeTargetEcsTaskParameters { - s.EnableECSManagedTags = &v - return s -} - -// SetEnableExecuteCommand sets the EnableExecuteCommand field's value. -func (s *PipeTargetEcsTaskParameters) SetEnableExecuteCommand(v bool) *PipeTargetEcsTaskParameters { - s.EnableExecuteCommand = &v - return s -} - -// SetGroup sets the Group field's value. -func (s *PipeTargetEcsTaskParameters) SetGroup(v string) *PipeTargetEcsTaskParameters { - s.Group = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *PipeTargetEcsTaskParameters) SetLaunchType(v string) *PipeTargetEcsTaskParameters { - s.LaunchType = &v - return s -} - -// SetNetworkConfiguration sets the NetworkConfiguration field's value. -func (s *PipeTargetEcsTaskParameters) SetNetworkConfiguration(v *NetworkConfiguration) *PipeTargetEcsTaskParameters { - s.NetworkConfiguration = v - return s -} - -// SetOverrides sets the Overrides field's value. -func (s *PipeTargetEcsTaskParameters) SetOverrides(v *EcsTaskOverride) *PipeTargetEcsTaskParameters { - s.Overrides = v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *PipeTargetEcsTaskParameters) SetPlacementConstraints(v []*PlacementConstraint) *PipeTargetEcsTaskParameters { - s.PlacementConstraints = v - return s -} - -// SetPlacementStrategy sets the PlacementStrategy field's value. -func (s *PipeTargetEcsTaskParameters) SetPlacementStrategy(v []*PlacementStrategy) *PipeTargetEcsTaskParameters { - s.PlacementStrategy = v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *PipeTargetEcsTaskParameters) SetPlatformVersion(v string) *PipeTargetEcsTaskParameters { - s.PlatformVersion = &v - return s -} - -// SetPropagateTags sets the PropagateTags field's value. -func (s *PipeTargetEcsTaskParameters) SetPropagateTags(v string) *PipeTargetEcsTaskParameters { - s.PropagateTags = &v - return s -} - -// SetReferenceId sets the ReferenceId field's value. -func (s *PipeTargetEcsTaskParameters) SetReferenceId(v string) *PipeTargetEcsTaskParameters { - s.ReferenceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *PipeTargetEcsTaskParameters) SetTags(v []*Tag) *PipeTargetEcsTaskParameters { - s.Tags = v - return s -} - -// SetTaskCount sets the TaskCount field's value. -func (s *PipeTargetEcsTaskParameters) SetTaskCount(v int64) *PipeTargetEcsTaskParameters { - s.TaskCount = &v - return s -} - -// SetTaskDefinitionArn sets the TaskDefinitionArn field's value. -func (s *PipeTargetEcsTaskParameters) SetTaskDefinitionArn(v string) *PipeTargetEcsTaskParameters { - s.TaskDefinitionArn = &v - return s -} - -// The parameters for using an EventBridge event bus as a target. -type PipeTargetEventBridgeEventBusParameters struct { - _ struct{} `type:"structure"` - - // A free-form string, with a maximum of 128 characters, used to decide what - // fields to expect in the event detail. - // - // DetailType is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetEventBridgeEventBusParameters's - // String and GoString methods. - DetailType *string `min:"1" type:"string" sensitive:"true"` - - // The URL subdomain of the endpoint. For example, if the URL for Endpoint is - // https://abcde.veo.endpoints.event.amazonaws.com, then the EndpointId is abcde.veo. - // - // EndpointId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetEventBridgeEventBusParameters's - // String and GoString methods. - EndpointId *string `min:"1" type:"string" sensitive:"true"` - - // Amazon Web Services resources, identified by Amazon Resource Name (ARN), - // which the event primarily concerns. Any number, including zero, may be present. - Resources []*string `type:"list"` - - // The source of the event. - // - // Source is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetEventBridgeEventBusParameters's - // String and GoString methods. - Source *string `min:"1" type:"string" sensitive:"true"` - - // The time stamp of the event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt). - // If no time stamp is provided, the time stamp of the PutEvents (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) - // call is used. - Time *string `min:"1" 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 PipeTargetEventBridgeEventBusParameters) 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 PipeTargetEventBridgeEventBusParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeTargetEventBridgeEventBusParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeTargetEventBridgeEventBusParameters"} - if s.DetailType != nil && len(*s.DetailType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DetailType", 1)) - } - if s.EndpointId != nil && len(*s.EndpointId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EndpointId", 1)) - } - if s.Source != nil && len(*s.Source) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Source", 1)) - } - if s.Time != nil && len(*s.Time) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Time", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDetailType sets the DetailType field's value. -func (s *PipeTargetEventBridgeEventBusParameters) SetDetailType(v string) *PipeTargetEventBridgeEventBusParameters { - s.DetailType = &v - return s -} - -// SetEndpointId sets the EndpointId field's value. -func (s *PipeTargetEventBridgeEventBusParameters) SetEndpointId(v string) *PipeTargetEventBridgeEventBusParameters { - s.EndpointId = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *PipeTargetEventBridgeEventBusParameters) SetResources(v []*string) *PipeTargetEventBridgeEventBusParameters { - s.Resources = v - return s -} - -// SetSource sets the Source field's value. -func (s *PipeTargetEventBridgeEventBusParameters) SetSource(v string) *PipeTargetEventBridgeEventBusParameters { - s.Source = &v - return s -} - -// SetTime sets the Time field's value. -func (s *PipeTargetEventBridgeEventBusParameters) SetTime(v string) *PipeTargetEventBridgeEventBusParameters { - s.Time = &v - return s -} - -// These are custom parameter to be used when the target is an API Gateway REST -// APIs or EventBridge ApiDestinations. -type PipeTargetHttpParameters struct { - _ struct{} `type:"structure"` - - // The headers that need to be sent as part of request invoking the API Gateway - // REST API or EventBridge ApiDestination. - HeaderParameters map[string]*string `type:"map"` - - // The path parameter values to be used to populate API Gateway REST API or - // EventBridge ApiDestination path wildcards ("*"). - PathParameterValues []*string `type:"list"` - - // The query string keys/values that need to be sent as part of request invoking - // the API Gateway REST API or EventBridge ApiDestination. - QueryStringParameters map[string]*string `type:"map"` -} - -// 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 PipeTargetHttpParameters) 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 PipeTargetHttpParameters) GoString() string { - return s.String() -} - -// SetHeaderParameters sets the HeaderParameters field's value. -func (s *PipeTargetHttpParameters) SetHeaderParameters(v map[string]*string) *PipeTargetHttpParameters { - s.HeaderParameters = v - return s -} - -// SetPathParameterValues sets the PathParameterValues field's value. -func (s *PipeTargetHttpParameters) SetPathParameterValues(v []*string) *PipeTargetHttpParameters { - s.PathParameterValues = v - return s -} - -// SetQueryStringParameters sets the QueryStringParameters field's value. -func (s *PipeTargetHttpParameters) SetQueryStringParameters(v map[string]*string) *PipeTargetHttpParameters { - s.QueryStringParameters = v - return s -} - -// The parameters for using a Kinesis stream as a target. -type PipeTargetKinesisStreamParameters struct { - _ struct{} `type:"structure"` - - // Determines which shard in the stream the data record is assigned to. Partition - // keys are Unicode strings with a maximum length limit of 256 characters for - // each key. Amazon Kinesis Data Streams uses the partition key as input to - // a hash function that maps the partition key and associated data to a specific - // shard. Specifically, an MD5 hash function is used to map partition keys to - // 128-bit integer values and to map associated data records to shards. As a - // result of this hashing mechanism, all data records with the same partition - // key map to the same shard within the stream. - // - // PartitionKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetKinesisStreamParameters's - // String and GoString methods. - // - // PartitionKey is a required field - PartitionKey *string `type:"string" required:"true" sensitive:"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 PipeTargetKinesisStreamParameters) 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 PipeTargetKinesisStreamParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeTargetKinesisStreamParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeTargetKinesisStreamParameters"} - if s.PartitionKey == nil { - invalidParams.Add(request.NewErrParamRequired("PartitionKey")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPartitionKey sets the PartitionKey field's value. -func (s *PipeTargetKinesisStreamParameters) SetPartitionKey(v string) *PipeTargetKinesisStreamParameters { - s.PartitionKey = &v - return s -} - -// The parameters for using a Lambda function as a target. -type PipeTargetLambdaFunctionParameters struct { - _ struct{} `type:"structure"` - - // Specify whether to invoke the function synchronously or asynchronously. - // - // * REQUEST_RESPONSE (default) - Invoke synchronously. This corresponds - // to the RequestResponse option in the InvocationType parameter for the - // Lambda Invoke (https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) - // API. - // - // * FIRE_AND_FORGET - Invoke asynchronously. This corresponds to the Event - // option in the InvocationType parameter for the Lambda Invoke (https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax) - // API. - // - // For more information, see Invocation types (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html#pipes-invocation) - // in the Amazon EventBridge User Guide. - InvocationType *string `type:"string" enum:"PipeTargetInvocationType"` -} - -// 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 PipeTargetLambdaFunctionParameters) 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 PipeTargetLambdaFunctionParameters) GoString() string { - return s.String() -} - -// SetInvocationType sets the InvocationType field's value. -func (s *PipeTargetLambdaFunctionParameters) SetInvocationType(v string) *PipeTargetLambdaFunctionParameters { - s.InvocationType = &v - return s -} - -// The parameters required to set up a target for your pipe. -// -// For more information about pipe target parameters, including how to use dynamic -// path parameters, see Target parameters (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-target.html) -// in the Amazon EventBridge User Guide. -type PipeTargetParameters struct { - _ struct{} `type:"structure"` - - // The parameters for using an Batch job as a target. - BatchJobParameters *PipeTargetBatchJobParameters `type:"structure"` - - // The parameters for using an CloudWatch Logs log stream as a target. - CloudWatchLogsParameters *PipeTargetCloudWatchLogsParameters `type:"structure"` - - // The parameters for using an Amazon ECS task as a target. - EcsTaskParameters *PipeTargetEcsTaskParameters `type:"structure"` - - // The parameters for using an EventBridge event bus as a target. - EventBridgeEventBusParameters *PipeTargetEventBridgeEventBusParameters `type:"structure"` - - // These are custom parameter to be used when the target is an API Gateway REST - // APIs or EventBridge ApiDestinations. - HttpParameters *PipeTargetHttpParameters `type:"structure"` - - // Valid JSON text passed to the target. In this case, nothing from the event - // itself is passed to the target. For more information, see The JavaScript - // Object Notation (JSON) Data Interchange Format (http://www.rfc-editor.org/rfc/rfc7159.txt). - // - // To remove an input template, specify an empty string. - // - // InputTemplate is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetParameters's - // String and GoString methods. - InputTemplate *string `type:"string" sensitive:"true"` - - // The parameters for using a Kinesis stream as a target. - KinesisStreamParameters *PipeTargetKinesisStreamParameters `type:"structure"` - - // The parameters for using a Lambda function as a target. - LambdaFunctionParameters *PipeTargetLambdaFunctionParameters `type:"structure"` - - // These are custom parameters to be used when the target is a Amazon Redshift - // cluster to invoke the Amazon Redshift Data API BatchExecuteStatement. - RedshiftDataParameters *PipeTargetRedshiftDataParameters `type:"structure"` - - // The parameters for using a SageMaker pipeline as a target. - SageMakerPipelineParameters *PipeTargetSageMakerPipelineParameters `type:"structure"` - - // The parameters for using a Amazon SQS stream as a target. - SqsQueueParameters *PipeTargetSqsQueueParameters `type:"structure"` - - // The parameters for using a Step Functions state machine as a target. - StepFunctionStateMachineParameters *PipeTargetStateMachineParameters `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 PipeTargetParameters) 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 PipeTargetParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeTargetParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeTargetParameters"} - if s.BatchJobParameters != nil { - if err := s.BatchJobParameters.Validate(); err != nil { - invalidParams.AddNested("BatchJobParameters", err.(request.ErrInvalidParams)) - } - } - if s.CloudWatchLogsParameters != nil { - if err := s.CloudWatchLogsParameters.Validate(); err != nil { - invalidParams.AddNested("CloudWatchLogsParameters", err.(request.ErrInvalidParams)) - } - } - if s.EcsTaskParameters != nil { - if err := s.EcsTaskParameters.Validate(); err != nil { - invalidParams.AddNested("EcsTaskParameters", err.(request.ErrInvalidParams)) - } - } - if s.EventBridgeEventBusParameters != nil { - if err := s.EventBridgeEventBusParameters.Validate(); err != nil { - invalidParams.AddNested("EventBridgeEventBusParameters", err.(request.ErrInvalidParams)) - } - } - if s.KinesisStreamParameters != nil { - if err := s.KinesisStreamParameters.Validate(); err != nil { - invalidParams.AddNested("KinesisStreamParameters", err.(request.ErrInvalidParams)) - } - } - if s.RedshiftDataParameters != nil { - if err := s.RedshiftDataParameters.Validate(); err != nil { - invalidParams.AddNested("RedshiftDataParameters", err.(request.ErrInvalidParams)) - } - } - if s.SageMakerPipelineParameters != nil { - if err := s.SageMakerPipelineParameters.Validate(); err != nil { - invalidParams.AddNested("SageMakerPipelineParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchJobParameters sets the BatchJobParameters field's value. -func (s *PipeTargetParameters) SetBatchJobParameters(v *PipeTargetBatchJobParameters) *PipeTargetParameters { - s.BatchJobParameters = v - return s -} - -// SetCloudWatchLogsParameters sets the CloudWatchLogsParameters field's value. -func (s *PipeTargetParameters) SetCloudWatchLogsParameters(v *PipeTargetCloudWatchLogsParameters) *PipeTargetParameters { - s.CloudWatchLogsParameters = v - return s -} - -// SetEcsTaskParameters sets the EcsTaskParameters field's value. -func (s *PipeTargetParameters) SetEcsTaskParameters(v *PipeTargetEcsTaskParameters) *PipeTargetParameters { - s.EcsTaskParameters = v - return s -} - -// SetEventBridgeEventBusParameters sets the EventBridgeEventBusParameters field's value. -func (s *PipeTargetParameters) SetEventBridgeEventBusParameters(v *PipeTargetEventBridgeEventBusParameters) *PipeTargetParameters { - s.EventBridgeEventBusParameters = v - return s -} - -// SetHttpParameters sets the HttpParameters field's value. -func (s *PipeTargetParameters) SetHttpParameters(v *PipeTargetHttpParameters) *PipeTargetParameters { - s.HttpParameters = v - return s -} - -// SetInputTemplate sets the InputTemplate field's value. -func (s *PipeTargetParameters) SetInputTemplate(v string) *PipeTargetParameters { - s.InputTemplate = &v - return s -} - -// SetKinesisStreamParameters sets the KinesisStreamParameters field's value. -func (s *PipeTargetParameters) SetKinesisStreamParameters(v *PipeTargetKinesisStreamParameters) *PipeTargetParameters { - s.KinesisStreamParameters = v - return s -} - -// SetLambdaFunctionParameters sets the LambdaFunctionParameters field's value. -func (s *PipeTargetParameters) SetLambdaFunctionParameters(v *PipeTargetLambdaFunctionParameters) *PipeTargetParameters { - s.LambdaFunctionParameters = v - return s -} - -// SetRedshiftDataParameters sets the RedshiftDataParameters field's value. -func (s *PipeTargetParameters) SetRedshiftDataParameters(v *PipeTargetRedshiftDataParameters) *PipeTargetParameters { - s.RedshiftDataParameters = v - return s -} - -// SetSageMakerPipelineParameters sets the SageMakerPipelineParameters field's value. -func (s *PipeTargetParameters) SetSageMakerPipelineParameters(v *PipeTargetSageMakerPipelineParameters) *PipeTargetParameters { - s.SageMakerPipelineParameters = v - return s -} - -// SetSqsQueueParameters sets the SqsQueueParameters field's value. -func (s *PipeTargetParameters) SetSqsQueueParameters(v *PipeTargetSqsQueueParameters) *PipeTargetParameters { - s.SqsQueueParameters = v - return s -} - -// SetStepFunctionStateMachineParameters sets the StepFunctionStateMachineParameters field's value. -func (s *PipeTargetParameters) SetStepFunctionStateMachineParameters(v *PipeTargetStateMachineParameters) *PipeTargetParameters { - s.StepFunctionStateMachineParameters = v - return s -} - -// These are custom parameters to be used when the target is a Amazon Redshift -// cluster to invoke the Amazon Redshift Data API BatchExecuteStatement. -type PipeTargetRedshiftDataParameters struct { - _ struct{} `type:"structure"` - - // The name of the database. Required when authenticating using temporary credentials. - // - // Database is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetRedshiftDataParameters's - // String and GoString methods. - // - // Database is a required field - Database *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The database user name. Required when authenticating using temporary credentials. - // - // DbUser is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetRedshiftDataParameters's - // String and GoString methods. - DbUser *string `min:"1" type:"string" sensitive:"true"` - - // The name or ARN of the secret that enables access to the database. Required - // when authenticating using Secrets Manager. - SecretManagerArn *string `min:"1" type:"string"` - - // The SQL statement text to run. - // - // Sqls is a required field - Sqls []*string `min:"1" type:"list" required:"true"` - - // The name of the SQL statement. You can name the SQL statement when you create - // it to identify the query. - // - // StatementName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetRedshiftDataParameters's - // String and GoString methods. - StatementName *string `min:"1" type:"string" sensitive:"true"` - - // Indicates whether to send an event back to EventBridge after the SQL statement - // runs. - WithEvent *bool `type:"boolean"` -} - -// 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 PipeTargetRedshiftDataParameters) 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 PipeTargetRedshiftDataParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeTargetRedshiftDataParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeTargetRedshiftDataParameters"} - if s.Database == nil { - invalidParams.Add(request.NewErrParamRequired("Database")) - } - if s.Database != nil && len(*s.Database) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Database", 1)) - } - if s.DbUser != nil && len(*s.DbUser) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DbUser", 1)) - } - if s.SecretManagerArn != nil && len(*s.SecretManagerArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecretManagerArn", 1)) - } - if s.Sqls == nil { - invalidParams.Add(request.NewErrParamRequired("Sqls")) - } - if s.Sqls != nil && len(s.Sqls) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Sqls", 1)) - } - if s.StatementName != nil && len(*s.StatementName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StatementName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDatabase sets the Database field's value. -func (s *PipeTargetRedshiftDataParameters) SetDatabase(v string) *PipeTargetRedshiftDataParameters { - s.Database = &v - return s -} - -// SetDbUser sets the DbUser field's value. -func (s *PipeTargetRedshiftDataParameters) SetDbUser(v string) *PipeTargetRedshiftDataParameters { - s.DbUser = &v - return s -} - -// SetSecretManagerArn sets the SecretManagerArn field's value. -func (s *PipeTargetRedshiftDataParameters) SetSecretManagerArn(v string) *PipeTargetRedshiftDataParameters { - s.SecretManagerArn = &v - return s -} - -// SetSqls sets the Sqls field's value. -func (s *PipeTargetRedshiftDataParameters) SetSqls(v []*string) *PipeTargetRedshiftDataParameters { - s.Sqls = v - return s -} - -// SetStatementName sets the StatementName field's value. -func (s *PipeTargetRedshiftDataParameters) SetStatementName(v string) *PipeTargetRedshiftDataParameters { - s.StatementName = &v - return s -} - -// SetWithEvent sets the WithEvent field's value. -func (s *PipeTargetRedshiftDataParameters) SetWithEvent(v bool) *PipeTargetRedshiftDataParameters { - s.WithEvent = &v - return s -} - -// The parameters for using a SageMaker pipeline as a target. -type PipeTargetSageMakerPipelineParameters struct { - _ struct{} `type:"structure"` - - // List of Parameter names and values for SageMaker Model Building Pipeline - // execution. - PipelineParameterList []*SageMakerPipelineParameter `type:"list"` -} - -// 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 PipeTargetSageMakerPipelineParameters) 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 PipeTargetSageMakerPipelineParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PipeTargetSageMakerPipelineParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PipeTargetSageMakerPipelineParameters"} - if s.PipelineParameterList != nil { - for i, v := range s.PipelineParameterList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PipelineParameterList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineParameterList sets the PipelineParameterList field's value. -func (s *PipeTargetSageMakerPipelineParameters) SetPipelineParameterList(v []*SageMakerPipelineParameter) *PipeTargetSageMakerPipelineParameters { - s.PipelineParameterList = v - return s -} - -// The parameters for using a Amazon SQS stream as a target. -type PipeTargetSqsQueueParameters struct { - _ struct{} `type:"structure"` - - // This parameter applies only to FIFO (first-in-first-out) queues. - // - // The token used for deduplication of sent messages. - // - // MessageDeduplicationId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetSqsQueueParameters's - // String and GoString methods. - MessageDeduplicationId *string `type:"string" sensitive:"true"` - - // The FIFO message group ID to use as the target. - // - // MessageGroupId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PipeTargetSqsQueueParameters's - // String and GoString methods. - MessageGroupId *string `type:"string" sensitive:"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 PipeTargetSqsQueueParameters) 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 PipeTargetSqsQueueParameters) GoString() string { - return s.String() -} - -// SetMessageDeduplicationId sets the MessageDeduplicationId field's value. -func (s *PipeTargetSqsQueueParameters) SetMessageDeduplicationId(v string) *PipeTargetSqsQueueParameters { - s.MessageDeduplicationId = &v - return s -} - -// SetMessageGroupId sets the MessageGroupId field's value. -func (s *PipeTargetSqsQueueParameters) SetMessageGroupId(v string) *PipeTargetSqsQueueParameters { - s.MessageGroupId = &v - return s -} - -// The parameters for using a Step Functions state machine as a target. -type PipeTargetStateMachineParameters struct { - _ struct{} `type:"structure"` - - // Specify whether to invoke the Step Functions state machine synchronously - // or asynchronously. - // - // * REQUEST_RESPONSE (default) - Invoke synchronously. For more information, - // see StartSyncExecution (https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartSyncExecution.html) - // in the Step Functions API Reference. REQUEST_RESPONSE is not supported - // for STANDARD state machine workflows. - // - // * FIRE_AND_FORGET - Invoke asynchronously. For more information, see StartExecution - // (https://docs.aws.amazon.com/step-functions/latest/apireference/API_StartExecution.html) - // in the Step Functions API Reference. - // - // For more information, see Invocation types (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html#pipes-invocation) - // in the Amazon EventBridge User Guide. - InvocationType *string `type:"string" enum:"PipeTargetInvocationType"` -} - -// 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 PipeTargetStateMachineParameters) 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 PipeTargetStateMachineParameters) GoString() string { - return s.String() -} - -// SetInvocationType sets the InvocationType field's value. -func (s *PipeTargetStateMachineParameters) SetInvocationType(v string) *PipeTargetStateMachineParameters { - s.InvocationType = &v - return s -} - -// An object representing a constraint on task placement. To learn more, see -// Task Placement Constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) -// in the Amazon Elastic Container Service Developer Guide. -type PlacementConstraint struct { - _ struct{} `type:"structure"` - - // A cluster query language expression to apply to the constraint. You cannot - // specify an expression if the constraint type is distinctInstance. To learn - // more, see Cluster Query Language (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) - // in the Amazon Elastic Container Service Developer Guide. - // - // Expression is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PlacementConstraint's - // String and GoString methods. - Expression *string `locationName:"expression" type:"string" sensitive:"true"` - - // The type of constraint. Use distinctInstance to ensure that each task in - // a particular group is running on a different container instance. Use memberOf - // to restrict the selection to a group of valid candidates. - Type *string `locationName:"type" type:"string" enum:"PlacementConstraintType"` -} - -// 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 PlacementConstraint) 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 PlacementConstraint) GoString() string { - return s.String() -} - -// SetExpression sets the Expression field's value. -func (s *PlacementConstraint) SetExpression(v string) *PlacementConstraint { - s.Expression = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlacementConstraint) SetType(v string) *PlacementConstraint { - s.Type = &v - return s -} - -// The task placement strategy for a task or service. To learn more, see Task -// Placement Strategies (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) -// in the Amazon Elastic Container Service Service Developer Guide. -type PlacementStrategy struct { - _ struct{} `type:"structure"` - - // The field to apply the placement strategy against. For the spread placement - // strategy, valid values are instanceId (or host, which has the same effect), - // or any platform or custom attribute that is applied to a container instance, - // such as attribute:ecs.availability-zone. For the binpack placement strategy, - // valid values are cpu and memory. For the random placement strategy, this - // field is not used. - // - // Field is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PlacementStrategy's - // String and GoString methods. - Field *string `locationName:"field" type:"string" sensitive:"true"` - - // The type of placement strategy. The random placement strategy randomly places - // tasks on available candidates. The spread placement strategy spreads placement - // across available candidates evenly based on the field parameter. The binpack - // strategy places tasks on available candidates that have the least available - // amount of the resource that is specified with the field parameter. For example, - // if you binpack on memory, a task is placed on the instance with the least - // amount of remaining memory (but still enough to run the task). - Type *string `locationName:"type" type:"string" enum:"PlacementStrategyType"` -} - -// 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 PlacementStrategy) 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 PlacementStrategy) GoString() string { - return s.String() -} - -// SetField sets the Field field's value. -func (s *PlacementStrategy) SetField(v string) *PlacementStrategy { - s.Field = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlacementStrategy) SetType(v string) *PlacementStrategy { - s.Type = &v - return s -} - -// The Amazon S3 logging configuration settings for the pipe. -type S3LogDestination struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket to which EventBridge delivers the log records - // for the pipe. - BucketName *string `type:"string"` - - // The Amazon Web Services account that owns the Amazon S3 bucket to which EventBridge - // delivers the log records for the pipe. - BucketOwner *string `type:"string"` - - // The format EventBridge uses for the log records. - // - // * json: JSON - // - // * plain: Plain text - // - // * w3c: W3C extended logging file format (https://www.w3.org/TR/WD-logfile) - OutputFormat *string `type:"string" enum:"S3OutputFormat"` - - // The prefix text with which to begin Amazon S3 log object names. - // - // For more information, see Organizing objects using prefixes (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html) - // in the Amazon Simple Storage Service User Guide. - Prefix *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 S3LogDestination) 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 S3LogDestination) GoString() string { - return s.String() -} - -// SetBucketName sets the BucketName field's value. -func (s *S3LogDestination) SetBucketName(v string) *S3LogDestination { - s.BucketName = &v - return s -} - -// SetBucketOwner sets the BucketOwner field's value. -func (s *S3LogDestination) SetBucketOwner(v string) *S3LogDestination { - s.BucketOwner = &v - return s -} - -// SetOutputFormat sets the OutputFormat field's value. -func (s *S3LogDestination) SetOutputFormat(v string) *S3LogDestination { - s.OutputFormat = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3LogDestination) SetPrefix(v string) *S3LogDestination { - s.Prefix = &v - return s -} - -// The Amazon S3 logging configuration settings for the pipe. -type S3LogDestinationParameters struct { - _ struct{} `type:"structure"` - - // Specifies the name of the Amazon S3 bucket to which EventBridge delivers - // the log records for the pipe. - // - // BucketName is a required field - BucketName *string `min:"3" type:"string" required:"true"` - - // Specifies the Amazon Web Services account that owns the Amazon S3 bucket - // to which EventBridge delivers the log records for the pipe. - // - // BucketOwner is a required field - BucketOwner *string `type:"string" required:"true"` - - // How EventBridge should format the log records. - // - // * json: JSON - // - // * plain: Plain text - // - // * w3c: W3C extended logging file format (https://www.w3.org/TR/WD-logfile) - OutputFormat *string `type:"string" enum:"S3OutputFormat"` - - // Specifies any prefix text with which to begin Amazon S3 log object names. - // - // You can use prefixes to organize the data that you store in Amazon S3 buckets. - // A prefix is a string of characters at the beginning of the object key name. - // A prefix can be any length, subject to the maximum length of the object key - // name (1,024 bytes). For more information, see Organizing objects using prefixes - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html) - // in the Amazon Simple Storage Service User Guide. - Prefix *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 S3LogDestinationParameters) 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 S3LogDestinationParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3LogDestinationParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3LogDestinationParameters"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - if s.BucketName != nil && len(*s.BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BucketName", 3)) - } - if s.BucketOwner == nil { - invalidParams.Add(request.NewErrParamRequired("BucketOwner")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3LogDestinationParameters) SetBucketName(v string) *S3LogDestinationParameters { - s.BucketName = &v - return s -} - -// SetBucketOwner sets the BucketOwner field's value. -func (s *S3LogDestinationParameters) SetBucketOwner(v string) *S3LogDestinationParameters { - s.BucketOwner = &v - return s -} - -// SetOutputFormat sets the OutputFormat field's value. -func (s *S3LogDestinationParameters) SetOutputFormat(v string) *S3LogDestinationParameters { - s.OutputFormat = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *S3LogDestinationParameters) SetPrefix(v string) *S3LogDestinationParameters { - s.Prefix = &v - return s -} - -// Name/Value pair of a parameter to start execution of a SageMaker Model Building -// Pipeline. -type SageMakerPipelineParameter struct { - _ struct{} `type:"structure"` - - // Name of parameter to start execution of a SageMaker Model Building Pipeline. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SageMakerPipelineParameter's - // String and GoString methods. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // Value of parameter to start execution of a SageMaker Model Building Pipeline. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SageMakerPipelineParameter's - // String and GoString methods. - // - // Value is a required field - Value *string `type:"string" required:"true" sensitive:"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 SageMakerPipelineParameter) 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 SageMakerPipelineParameter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SageMakerPipelineParameter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SageMakerPipelineParameter"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *SageMakerPipelineParameter) SetName(v string) *SageMakerPipelineParameter { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *SageMakerPipelineParameter) SetValue(v string) *SageMakerPipelineParameter { - s.Value = &v - return s -} - -// The Secrets Manager secret that stores your stream credentials. -type SelfManagedKafkaAccessConfigurationCredentials struct { - _ struct{} `type:"structure"` - - // The ARN of the Secrets Manager secret. - BasicAuth *string `min:"1" type:"string"` - - // The ARN of the Secrets Manager secret. - ClientCertificateTlsAuth *string `min:"1" type:"string"` - - // The ARN of the Secrets Manager secret. - SaslScram256Auth *string `min:"1" type:"string"` - - // The ARN of the Secrets Manager secret. - SaslScram512Auth *string `min:"1" 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 SelfManagedKafkaAccessConfigurationCredentials) 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 SelfManagedKafkaAccessConfigurationCredentials) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SelfManagedKafkaAccessConfigurationCredentials) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SelfManagedKafkaAccessConfigurationCredentials"} - if s.BasicAuth != nil && len(*s.BasicAuth) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BasicAuth", 1)) - } - if s.ClientCertificateTlsAuth != nil && len(*s.ClientCertificateTlsAuth) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientCertificateTlsAuth", 1)) - } - if s.SaslScram256Auth != nil && len(*s.SaslScram256Auth) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SaslScram256Auth", 1)) - } - if s.SaslScram512Auth != nil && len(*s.SaslScram512Auth) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SaslScram512Auth", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasicAuth sets the BasicAuth field's value. -func (s *SelfManagedKafkaAccessConfigurationCredentials) SetBasicAuth(v string) *SelfManagedKafkaAccessConfigurationCredentials { - s.BasicAuth = &v - return s -} - -// SetClientCertificateTlsAuth sets the ClientCertificateTlsAuth field's value. -func (s *SelfManagedKafkaAccessConfigurationCredentials) SetClientCertificateTlsAuth(v string) *SelfManagedKafkaAccessConfigurationCredentials { - s.ClientCertificateTlsAuth = &v - return s -} - -// SetSaslScram256Auth sets the SaslScram256Auth field's value. -func (s *SelfManagedKafkaAccessConfigurationCredentials) SetSaslScram256Auth(v string) *SelfManagedKafkaAccessConfigurationCredentials { - s.SaslScram256Auth = &v - return s -} - -// SetSaslScram512Auth sets the SaslScram512Auth field's value. -func (s *SelfManagedKafkaAccessConfigurationCredentials) SetSaslScram512Auth(v string) *SelfManagedKafkaAccessConfigurationCredentials { - s.SaslScram512Auth = &v - return s -} - -// This structure specifies the VPC subnets and security groups for the stream, -// and whether a public IP address is to be used. -type SelfManagedKafkaAccessConfigurationVpc struct { - _ struct{} `type:"structure"` - - // Specifies the security groups associated with the stream. These security - // groups must all be in the same VPC. You can specify as many as five security - // groups. If you do not specify a security group, the default security group - // for the VPC is used. - SecurityGroup []*string `type:"list"` - - // Specifies the subnets associated with the stream. These subnets must all - // be in the same VPC. You can specify as many as 16 subnets. - Subnets []*string `type:"list"` -} - -// 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 SelfManagedKafkaAccessConfigurationVpc) 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 SelfManagedKafkaAccessConfigurationVpc) GoString() string { - return s.String() -} - -// SetSecurityGroup sets the SecurityGroup field's value. -func (s *SelfManagedKafkaAccessConfigurationVpc) SetSecurityGroup(v []*string) *SelfManagedKafkaAccessConfigurationVpc { - s.SecurityGroup = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *SelfManagedKafkaAccessConfigurationVpc) SetSubnets(v []*string) *SelfManagedKafkaAccessConfigurationVpc { - s.Subnets = v - return s -} - -// A quota has been exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The identifier of the quota that caused the exception. - // - // QuotaCode is a required field - QuotaCode *string `locationName:"quotaCode" type:"string" required:"true"` - - // The ID of the resource that caused the exception. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of resource that caused the exception. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true"` - - // The identifier of the service that caused the exception. - // - // ServiceCode is a required field - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartPipeInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipe. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" 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 StartPipeInput) 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 StartPipeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartPipeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartPipeInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *StartPipeInput) SetName(v string) *StartPipeInput { - s.Name = &v - return s -} - -type StartPipeOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the pipe. - Arn *string `min:"1" type:"string"` - - // The time the pipe was created. - CreationTime *time.Time `type:"timestamp"` - - // The state the pipe is in. - CurrentState *string `type:"string" enum:"PipeState"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeState"` - - // When the pipe was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime) - // (YYYY-MM-DDThh:mm:ss.sTZD). - LastModifiedTime *time.Time `type:"timestamp"` - - // The name of the pipe. - Name *string `min:"1" 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 StartPipeOutput) 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 StartPipeOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartPipeOutput) SetArn(v string) *StartPipeOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StartPipeOutput) SetCreationTime(v time.Time) *StartPipeOutput { - s.CreationTime = &v - return s -} - -// SetCurrentState sets the CurrentState field's value. -func (s *StartPipeOutput) SetCurrentState(v string) *StartPipeOutput { - s.CurrentState = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *StartPipeOutput) SetDesiredState(v string) *StartPipeOutput { - s.DesiredState = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *StartPipeOutput) SetLastModifiedTime(v time.Time) *StartPipeOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartPipeOutput) SetName(v string) *StartPipeOutput { - s.Name = &v - return s -} - -type StopPipeInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the pipe. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" 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 StopPipeInput) 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 StopPipeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopPipeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopPipeInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *StopPipeInput) SetName(v string) *StopPipeInput { - s.Name = &v - return s -} - -type StopPipeOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the pipe. - Arn *string `min:"1" type:"string"` - - // The time the pipe was created. - CreationTime *time.Time `type:"timestamp"` - - // The state the pipe is in. - CurrentState *string `type:"string" enum:"PipeState"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeState"` - - // When the pipe was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime) - // (YYYY-MM-DDThh:mm:ss.sTZD). - LastModifiedTime *time.Time `type:"timestamp"` - - // The name of the pipe. - Name *string `min:"1" 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 StopPipeOutput) 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 StopPipeOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StopPipeOutput) SetArn(v string) *StopPipeOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StopPipeOutput) SetCreationTime(v time.Time) *StopPipeOutput { - s.CreationTime = &v - return s -} - -// SetCurrentState sets the CurrentState field's value. -func (s *StopPipeOutput) SetCurrentState(v string) *StopPipeOutput { - s.CurrentState = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *StopPipeOutput) SetDesiredState(v string) *StopPipeOutput { - s.DesiredState = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *StopPipeOutput) SetLastModifiedTime(v time.Time) *StopPipeOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *StopPipeOutput) SetName(v string) *StopPipeOutput { - s.Name = &v - return s -} - -// A key-value pair associated with an Amazon Web Services resource. In EventBridge, -// rules and event buses support tagging. -type Tag struct { - _ struct{} `type:"structure"` - - // A string you can use to assign a value. The combination of tag keys and values - // can help you organize and categorize your resources. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value for the specified tag key. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Tag's - // String and GoString methods. - // - // Value is a required field - Value *string `type:"string" required:"true" sensitive:"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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the pipe. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The list of key-value pairs associated with the pipe. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" min:"1" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// An action was throttled. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The identifier of the quota that caused the exception. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The number of seconds to wait before retrying the action that caused the - // exception. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The identifier of the service that caused the exception. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the pipe. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The list of tag keys to remove from the pipe. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdatePipeInput struct { - _ struct{} `type:"structure"` - - // A description of the pipe. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePipeInput's - // String and GoString methods. - Description *string `type:"string" sensitive:"true"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeState"` - - // The ARN of the enrichment resource. - Enrichment *string `type:"string"` - - // The parameters required to set up enrichment on your pipe. - EnrichmentParameters *PipeEnrichmentParameters `type:"structure"` - - // The logging configuration settings for the pipe. - LogConfiguration *PipeLogConfigurationParameters `type:"structure"` - - // The name of the pipe. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` - - // The ARN of the role that allows the pipe to send data to the target. - // - // RoleArn is a required field - RoleArn *string `min:"1" type:"string" required:"true"` - - // The parameters required to set up a source for your pipe. - SourceParameters *UpdatePipeSourceParameters `type:"structure"` - - // The ARN of the target resource. - Target *string `min:"1" type:"string"` - - // The parameters required to set up a target for your pipe. - // - // For more information about pipe target parameters, including how to use dynamic - // path parameters, see Target parameters (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-event-target.html) - // in the Amazon EventBridge User Guide. - TargetParameters *PipeTargetParameters `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 UpdatePipeInput) 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 UpdatePipeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - if s.Target != nil && len(*s.Target) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Target", 1)) - } - if s.LogConfiguration != nil { - if err := s.LogConfiguration.Validate(); err != nil { - invalidParams.AddNested("LogConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.SourceParameters != nil { - if err := s.SourceParameters.Validate(); err != nil { - invalidParams.AddNested("SourceParameters", err.(request.ErrInvalidParams)) - } - } - if s.TargetParameters != nil { - if err := s.TargetParameters.Validate(); err != nil { - invalidParams.AddNested("TargetParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdatePipeInput) SetDescription(v string) *UpdatePipeInput { - s.Description = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *UpdatePipeInput) SetDesiredState(v string) *UpdatePipeInput { - s.DesiredState = &v - return s -} - -// SetEnrichment sets the Enrichment field's value. -func (s *UpdatePipeInput) SetEnrichment(v string) *UpdatePipeInput { - s.Enrichment = &v - return s -} - -// SetEnrichmentParameters sets the EnrichmentParameters field's value. -func (s *UpdatePipeInput) SetEnrichmentParameters(v *PipeEnrichmentParameters) *UpdatePipeInput { - s.EnrichmentParameters = v - return s -} - -// SetLogConfiguration sets the LogConfiguration field's value. -func (s *UpdatePipeInput) SetLogConfiguration(v *PipeLogConfigurationParameters) *UpdatePipeInput { - s.LogConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePipeInput) SetName(v string) *UpdatePipeInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdatePipeInput) SetRoleArn(v string) *UpdatePipeInput { - s.RoleArn = &v - return s -} - -// SetSourceParameters sets the SourceParameters field's value. -func (s *UpdatePipeInput) SetSourceParameters(v *UpdatePipeSourceParameters) *UpdatePipeInput { - s.SourceParameters = v - return s -} - -// SetTarget sets the Target field's value. -func (s *UpdatePipeInput) SetTarget(v string) *UpdatePipeInput { - s.Target = &v - return s -} - -// SetTargetParameters sets the TargetParameters field's value. -func (s *UpdatePipeInput) SetTargetParameters(v *PipeTargetParameters) *UpdatePipeInput { - s.TargetParameters = v - return s -} - -type UpdatePipeOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the pipe. - Arn *string `min:"1" type:"string"` - - // The time the pipe was created. - CreationTime *time.Time `type:"timestamp"` - - // The state the pipe is in. - CurrentState *string `type:"string" enum:"PipeState"` - - // The state the pipe should be in. - DesiredState *string `type:"string" enum:"RequestedPipeState"` - - // When the pipe was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime) - // (YYYY-MM-DDThh:mm:ss.sTZD). - LastModifiedTime *time.Time `type:"timestamp"` - - // The name of the pipe. - Name *string `min:"1" 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 UpdatePipeOutput) 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 UpdatePipeOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdatePipeOutput) SetArn(v string) *UpdatePipeOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *UpdatePipeOutput) SetCreationTime(v time.Time) *UpdatePipeOutput { - s.CreationTime = &v - return s -} - -// SetCurrentState sets the CurrentState field's value. -func (s *UpdatePipeOutput) SetCurrentState(v string) *UpdatePipeOutput { - s.CurrentState = &v - return s -} - -// SetDesiredState sets the DesiredState field's value. -func (s *UpdatePipeOutput) SetDesiredState(v string) *UpdatePipeOutput { - s.DesiredState = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *UpdatePipeOutput) SetLastModifiedTime(v time.Time) *UpdatePipeOutput { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePipeOutput) SetName(v string) *UpdatePipeOutput { - s.Name = &v - return s -} - -// The parameters for using an Active MQ broker as a source. -type UpdatePipeSourceActiveMQBrokerParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The credentials needed to access the resource. - // - // Credentials is a required field - Credentials *MQBrokerAccessCredentials `type:"structure" required:"true"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `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 UpdatePipeSourceActiveMQBrokerParameters) 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 UpdatePipeSourceActiveMQBrokerParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeSourceActiveMQBrokerParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeSourceActiveMQBrokerParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.Credentials == nil { - invalidParams.Add(request.NewErrParamRequired("Credentials")) - } - if s.Credentials != nil { - if err := s.Credentials.Validate(); err != nil { - invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *UpdatePipeSourceActiveMQBrokerParameters) SetBatchSize(v int64) *UpdatePipeSourceActiveMQBrokerParameters { - s.BatchSize = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *UpdatePipeSourceActiveMQBrokerParameters) SetCredentials(v *MQBrokerAccessCredentials) *UpdatePipeSourceActiveMQBrokerParameters { - s.Credentials = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *UpdatePipeSourceActiveMQBrokerParameters) SetMaximumBatchingWindowInSeconds(v int64) *UpdatePipeSourceActiveMQBrokerParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// The parameters for using a DynamoDB stream as a source. -type UpdatePipeSourceDynamoDBStreamParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // Define the target queue to send dead-letter queue events to. - DeadLetterConfig *DeadLetterConfig `type:"structure"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // (Streams only) Discard records older than the specified age. The default - // value is -1, which sets the maximum age to infinite. When the value is set - // to infinite, EventBridge never discards old records. - MaximumRecordAgeInSeconds *int64 `type:"integer"` - - // (Streams only) Discard records after the specified number of retries. The - // default value is -1, which sets the maximum number of retries to infinite. - // When MaximumRetryAttempts is infinite, EventBridge retries failed records - // until the record expires in the event source. - MaximumRetryAttempts *int64 `type:"integer"` - - // (Streams only) Define how to handle item process failures. AUTOMATIC_BISECT - // halves each batch and retry each half until all the records are processed - // or there is one failed message left in the batch. - OnPartialBatchItemFailure *string `type:"string" enum:"OnPartialBatchItemFailureStreams"` - - // (Streams only) The number of batches to process concurrently from each shard. - // The default value is 1. - ParallelizationFactor *int64 `min:"1" 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 UpdatePipeSourceDynamoDBStreamParameters) 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 UpdatePipeSourceDynamoDBStreamParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeSourceDynamoDBStreamParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeSourceDynamoDBStreamParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.MaximumRecordAgeInSeconds != nil && *s.MaximumRecordAgeInSeconds < -1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumRecordAgeInSeconds", -1)) - } - if s.MaximumRetryAttempts != nil && *s.MaximumRetryAttempts < -1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumRetryAttempts", -1)) - } - if s.ParallelizationFactor != nil && *s.ParallelizationFactor < 1 { - invalidParams.Add(request.NewErrParamMinValue("ParallelizationFactor", 1)) - } - if s.DeadLetterConfig != nil { - if err := s.DeadLetterConfig.Validate(); err != nil { - invalidParams.AddNested("DeadLetterConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *UpdatePipeSourceDynamoDBStreamParameters) SetBatchSize(v int64) *UpdatePipeSourceDynamoDBStreamParameters { - s.BatchSize = &v - return s -} - -// SetDeadLetterConfig sets the DeadLetterConfig field's value. -func (s *UpdatePipeSourceDynamoDBStreamParameters) SetDeadLetterConfig(v *DeadLetterConfig) *UpdatePipeSourceDynamoDBStreamParameters { - s.DeadLetterConfig = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *UpdatePipeSourceDynamoDBStreamParameters) SetMaximumBatchingWindowInSeconds(v int64) *UpdatePipeSourceDynamoDBStreamParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetMaximumRecordAgeInSeconds sets the MaximumRecordAgeInSeconds field's value. -func (s *UpdatePipeSourceDynamoDBStreamParameters) SetMaximumRecordAgeInSeconds(v int64) *UpdatePipeSourceDynamoDBStreamParameters { - s.MaximumRecordAgeInSeconds = &v - return s -} - -// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. -func (s *UpdatePipeSourceDynamoDBStreamParameters) SetMaximumRetryAttempts(v int64) *UpdatePipeSourceDynamoDBStreamParameters { - s.MaximumRetryAttempts = &v - return s -} - -// SetOnPartialBatchItemFailure sets the OnPartialBatchItemFailure field's value. -func (s *UpdatePipeSourceDynamoDBStreamParameters) SetOnPartialBatchItemFailure(v string) *UpdatePipeSourceDynamoDBStreamParameters { - s.OnPartialBatchItemFailure = &v - return s -} - -// SetParallelizationFactor sets the ParallelizationFactor field's value. -func (s *UpdatePipeSourceDynamoDBStreamParameters) SetParallelizationFactor(v int64) *UpdatePipeSourceDynamoDBStreamParameters { - s.ParallelizationFactor = &v - return s -} - -// The parameters for using a Kinesis stream as a source. -type UpdatePipeSourceKinesisStreamParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // Define the target queue to send dead-letter queue events to. - DeadLetterConfig *DeadLetterConfig `type:"structure"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // (Streams only) Discard records older than the specified age. The default - // value is -1, which sets the maximum age to infinite. When the value is set - // to infinite, EventBridge never discards old records. - MaximumRecordAgeInSeconds *int64 `type:"integer"` - - // (Streams only) Discard records after the specified number of retries. The - // default value is -1, which sets the maximum number of retries to infinite. - // When MaximumRetryAttempts is infinite, EventBridge retries failed records - // until the record expires in the event source. - MaximumRetryAttempts *int64 `type:"integer"` - - // (Streams only) Define how to handle item process failures. AUTOMATIC_BISECT - // halves each batch and retry each half until all the records are processed - // or there is one failed message left in the batch. - OnPartialBatchItemFailure *string `type:"string" enum:"OnPartialBatchItemFailureStreams"` - - // (Streams only) The number of batches to process concurrently from each shard. - // The default value is 1. - ParallelizationFactor *int64 `min:"1" 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 UpdatePipeSourceKinesisStreamParameters) 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 UpdatePipeSourceKinesisStreamParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeSourceKinesisStreamParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeSourceKinesisStreamParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.MaximumRecordAgeInSeconds != nil && *s.MaximumRecordAgeInSeconds < -1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumRecordAgeInSeconds", -1)) - } - if s.MaximumRetryAttempts != nil && *s.MaximumRetryAttempts < -1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumRetryAttempts", -1)) - } - if s.ParallelizationFactor != nil && *s.ParallelizationFactor < 1 { - invalidParams.Add(request.NewErrParamMinValue("ParallelizationFactor", 1)) - } - if s.DeadLetterConfig != nil { - if err := s.DeadLetterConfig.Validate(); err != nil { - invalidParams.AddNested("DeadLetterConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *UpdatePipeSourceKinesisStreamParameters) SetBatchSize(v int64) *UpdatePipeSourceKinesisStreamParameters { - s.BatchSize = &v - return s -} - -// SetDeadLetterConfig sets the DeadLetterConfig field's value. -func (s *UpdatePipeSourceKinesisStreamParameters) SetDeadLetterConfig(v *DeadLetterConfig) *UpdatePipeSourceKinesisStreamParameters { - s.DeadLetterConfig = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *UpdatePipeSourceKinesisStreamParameters) SetMaximumBatchingWindowInSeconds(v int64) *UpdatePipeSourceKinesisStreamParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetMaximumRecordAgeInSeconds sets the MaximumRecordAgeInSeconds field's value. -func (s *UpdatePipeSourceKinesisStreamParameters) SetMaximumRecordAgeInSeconds(v int64) *UpdatePipeSourceKinesisStreamParameters { - s.MaximumRecordAgeInSeconds = &v - return s -} - -// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. -func (s *UpdatePipeSourceKinesisStreamParameters) SetMaximumRetryAttempts(v int64) *UpdatePipeSourceKinesisStreamParameters { - s.MaximumRetryAttempts = &v - return s -} - -// SetOnPartialBatchItemFailure sets the OnPartialBatchItemFailure field's value. -func (s *UpdatePipeSourceKinesisStreamParameters) SetOnPartialBatchItemFailure(v string) *UpdatePipeSourceKinesisStreamParameters { - s.OnPartialBatchItemFailure = &v - return s -} - -// SetParallelizationFactor sets the ParallelizationFactor field's value. -func (s *UpdatePipeSourceKinesisStreamParameters) SetParallelizationFactor(v int64) *UpdatePipeSourceKinesisStreamParameters { - s.ParallelizationFactor = &v - return s -} - -// The parameters for using an MSK stream as a source. -type UpdatePipeSourceManagedStreamingKafkaParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The credentials needed to access the resource. - Credentials *MSKAccessCredentials `type:"structure"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `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 UpdatePipeSourceManagedStreamingKafkaParameters) 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 UpdatePipeSourceManagedStreamingKafkaParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeSourceManagedStreamingKafkaParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeSourceManagedStreamingKafkaParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.Credentials != nil { - if err := s.Credentials.Validate(); err != nil { - invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *UpdatePipeSourceManagedStreamingKafkaParameters) SetBatchSize(v int64) *UpdatePipeSourceManagedStreamingKafkaParameters { - s.BatchSize = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *UpdatePipeSourceManagedStreamingKafkaParameters) SetCredentials(v *MSKAccessCredentials) *UpdatePipeSourceManagedStreamingKafkaParameters { - s.Credentials = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *UpdatePipeSourceManagedStreamingKafkaParameters) SetMaximumBatchingWindowInSeconds(v int64) *UpdatePipeSourceManagedStreamingKafkaParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// The parameters required to set up a source for your pipe. -type UpdatePipeSourceParameters struct { - _ struct{} `type:"structure"` - - // The parameters for using an Active MQ broker as a source. - ActiveMQBrokerParameters *UpdatePipeSourceActiveMQBrokerParameters `type:"structure"` - - // The parameters for using a DynamoDB stream as a source. - DynamoDBStreamParameters *UpdatePipeSourceDynamoDBStreamParameters `type:"structure"` - - // The collection of event patterns used to filter events. - // - // To remove a filter, specify a FilterCriteria object with an empty array of - // Filter objects. - // - // For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) - // in the Amazon EventBridge User Guide. - FilterCriteria *FilterCriteria `type:"structure"` - - // The parameters for using a Kinesis stream as a source. - KinesisStreamParameters *UpdatePipeSourceKinesisStreamParameters `type:"structure"` - - // The parameters for using an MSK stream as a source. - ManagedStreamingKafkaParameters *UpdatePipeSourceManagedStreamingKafkaParameters `type:"structure"` - - // The parameters for using a Rabbit MQ broker as a source. - RabbitMQBrokerParameters *UpdatePipeSourceRabbitMQBrokerParameters `type:"structure"` - - // The parameters for using a self-managed Apache Kafka stream as a source. - SelfManagedKafkaParameters *UpdatePipeSourceSelfManagedKafkaParameters `type:"structure"` - - // The parameters for using a Amazon SQS stream as a source. - SqsQueueParameters *UpdatePipeSourceSqsQueueParameters `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 UpdatePipeSourceParameters) 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 UpdatePipeSourceParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeSourceParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeSourceParameters"} - if s.ActiveMQBrokerParameters != nil { - if err := s.ActiveMQBrokerParameters.Validate(); err != nil { - invalidParams.AddNested("ActiveMQBrokerParameters", err.(request.ErrInvalidParams)) - } - } - if s.DynamoDBStreamParameters != nil { - if err := s.DynamoDBStreamParameters.Validate(); err != nil { - invalidParams.AddNested("DynamoDBStreamParameters", err.(request.ErrInvalidParams)) - } - } - if s.KinesisStreamParameters != nil { - if err := s.KinesisStreamParameters.Validate(); err != nil { - invalidParams.AddNested("KinesisStreamParameters", err.(request.ErrInvalidParams)) - } - } - if s.ManagedStreamingKafkaParameters != nil { - if err := s.ManagedStreamingKafkaParameters.Validate(); err != nil { - invalidParams.AddNested("ManagedStreamingKafkaParameters", err.(request.ErrInvalidParams)) - } - } - if s.RabbitMQBrokerParameters != nil { - if err := s.RabbitMQBrokerParameters.Validate(); err != nil { - invalidParams.AddNested("RabbitMQBrokerParameters", err.(request.ErrInvalidParams)) - } - } - if s.SelfManagedKafkaParameters != nil { - if err := s.SelfManagedKafkaParameters.Validate(); err != nil { - invalidParams.AddNested("SelfManagedKafkaParameters", err.(request.ErrInvalidParams)) - } - } - if s.SqsQueueParameters != nil { - if err := s.SqsQueueParameters.Validate(); err != nil { - invalidParams.AddNested("SqsQueueParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActiveMQBrokerParameters sets the ActiveMQBrokerParameters field's value. -func (s *UpdatePipeSourceParameters) SetActiveMQBrokerParameters(v *UpdatePipeSourceActiveMQBrokerParameters) *UpdatePipeSourceParameters { - s.ActiveMQBrokerParameters = v - return s -} - -// SetDynamoDBStreamParameters sets the DynamoDBStreamParameters field's value. -func (s *UpdatePipeSourceParameters) SetDynamoDBStreamParameters(v *UpdatePipeSourceDynamoDBStreamParameters) *UpdatePipeSourceParameters { - s.DynamoDBStreamParameters = v - return s -} - -// SetFilterCriteria sets the FilterCriteria field's value. -func (s *UpdatePipeSourceParameters) SetFilterCriteria(v *FilterCriteria) *UpdatePipeSourceParameters { - s.FilterCriteria = v - return s -} - -// SetKinesisStreamParameters sets the KinesisStreamParameters field's value. -func (s *UpdatePipeSourceParameters) SetKinesisStreamParameters(v *UpdatePipeSourceKinesisStreamParameters) *UpdatePipeSourceParameters { - s.KinesisStreamParameters = v - return s -} - -// SetManagedStreamingKafkaParameters sets the ManagedStreamingKafkaParameters field's value. -func (s *UpdatePipeSourceParameters) SetManagedStreamingKafkaParameters(v *UpdatePipeSourceManagedStreamingKafkaParameters) *UpdatePipeSourceParameters { - s.ManagedStreamingKafkaParameters = v - return s -} - -// SetRabbitMQBrokerParameters sets the RabbitMQBrokerParameters field's value. -func (s *UpdatePipeSourceParameters) SetRabbitMQBrokerParameters(v *UpdatePipeSourceRabbitMQBrokerParameters) *UpdatePipeSourceParameters { - s.RabbitMQBrokerParameters = v - return s -} - -// SetSelfManagedKafkaParameters sets the SelfManagedKafkaParameters field's value. -func (s *UpdatePipeSourceParameters) SetSelfManagedKafkaParameters(v *UpdatePipeSourceSelfManagedKafkaParameters) *UpdatePipeSourceParameters { - s.SelfManagedKafkaParameters = v - return s -} - -// SetSqsQueueParameters sets the SqsQueueParameters field's value. -func (s *UpdatePipeSourceParameters) SetSqsQueueParameters(v *UpdatePipeSourceSqsQueueParameters) *UpdatePipeSourceParameters { - s.SqsQueueParameters = v - return s -} - -// The parameters for using a Rabbit MQ broker as a source. -type UpdatePipeSourceRabbitMQBrokerParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The credentials needed to access the resource. - // - // Credentials is a required field - Credentials *MQBrokerAccessCredentials `type:"structure" required:"true"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `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 UpdatePipeSourceRabbitMQBrokerParameters) 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 UpdatePipeSourceRabbitMQBrokerParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeSourceRabbitMQBrokerParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeSourceRabbitMQBrokerParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.Credentials == nil { - invalidParams.Add(request.NewErrParamRequired("Credentials")) - } - if s.Credentials != nil { - if err := s.Credentials.Validate(); err != nil { - invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *UpdatePipeSourceRabbitMQBrokerParameters) SetBatchSize(v int64) *UpdatePipeSourceRabbitMQBrokerParameters { - s.BatchSize = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *UpdatePipeSourceRabbitMQBrokerParameters) SetCredentials(v *MQBrokerAccessCredentials) *UpdatePipeSourceRabbitMQBrokerParameters { - s.Credentials = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *UpdatePipeSourceRabbitMQBrokerParameters) SetMaximumBatchingWindowInSeconds(v int64) *UpdatePipeSourceRabbitMQBrokerParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// The parameters for using a self-managed Apache Kafka stream as a source. -type UpdatePipeSourceSelfManagedKafkaParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The credentials needed to access the resource. - Credentials *SelfManagedKafkaAccessConfigurationCredentials `type:"structure"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `type:"integer"` - - // The ARN of the Secrets Manager secret used for certification. - ServerRootCaCertificate *string `min:"1" type:"string"` - - // This structure specifies the VPC subnets and security groups for the stream, - // and whether a public IP address is to be used. - Vpc *SelfManagedKafkaAccessConfigurationVpc `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 UpdatePipeSourceSelfManagedKafkaParameters) 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 UpdatePipeSourceSelfManagedKafkaParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeSourceSelfManagedKafkaParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeSourceSelfManagedKafkaParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - if s.ServerRootCaCertificate != nil && len(*s.ServerRootCaCertificate) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServerRootCaCertificate", 1)) - } - if s.Credentials != nil { - if err := s.Credentials.Validate(); err != nil { - invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *UpdatePipeSourceSelfManagedKafkaParameters) SetBatchSize(v int64) *UpdatePipeSourceSelfManagedKafkaParameters { - s.BatchSize = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *UpdatePipeSourceSelfManagedKafkaParameters) SetCredentials(v *SelfManagedKafkaAccessConfigurationCredentials) *UpdatePipeSourceSelfManagedKafkaParameters { - s.Credentials = v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *UpdatePipeSourceSelfManagedKafkaParameters) SetMaximumBatchingWindowInSeconds(v int64) *UpdatePipeSourceSelfManagedKafkaParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// SetServerRootCaCertificate sets the ServerRootCaCertificate field's value. -func (s *UpdatePipeSourceSelfManagedKafkaParameters) SetServerRootCaCertificate(v string) *UpdatePipeSourceSelfManagedKafkaParameters { - s.ServerRootCaCertificate = &v - return s -} - -// SetVpc sets the Vpc field's value. -func (s *UpdatePipeSourceSelfManagedKafkaParameters) SetVpc(v *SelfManagedKafkaAccessConfigurationVpc) *UpdatePipeSourceSelfManagedKafkaParameters { - s.Vpc = v - return s -} - -// The parameters for using a Amazon SQS stream as a source. -type UpdatePipeSourceSqsQueueParameters struct { - _ struct{} `type:"structure"` - - // The maximum number of records to include in each batch. - BatchSize *int64 `min:"1" type:"integer"` - - // The maximum length of a time to wait for events. - MaximumBatchingWindowInSeconds *int64 `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 UpdatePipeSourceSqsQueueParameters) 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 UpdatePipeSourceSqsQueueParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePipeSourceSqsQueueParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePipeSourceSqsQueueParameters"} - if s.BatchSize != nil && *s.BatchSize < 1 { - invalidParams.Add(request.NewErrParamMinValue("BatchSize", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchSize sets the BatchSize field's value. -func (s *UpdatePipeSourceSqsQueueParameters) SetBatchSize(v int64) *UpdatePipeSourceSqsQueueParameters { - s.BatchSize = &v - return s -} - -// SetMaximumBatchingWindowInSeconds sets the MaximumBatchingWindowInSeconds field's value. -func (s *UpdatePipeSourceSqsQueueParameters) SetMaximumBatchingWindowInSeconds(v int64) *UpdatePipeSourceSqsQueueParameters { - s.MaximumBatchingWindowInSeconds = &v - return s -} - -// Indicates that an error has occurred while performing a validate operation. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The list of fields for which validation failed and the corresponding failure - // messages. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Indicates that an error has occurred while performing a validate operation. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // The message of the exception. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the exception. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // AssignPublicIpEnabled is a AssignPublicIp enum value - AssignPublicIpEnabled = "ENABLED" - - // AssignPublicIpDisabled is a AssignPublicIp enum value - AssignPublicIpDisabled = "DISABLED" -) - -// AssignPublicIp_Values returns all elements of the AssignPublicIp enum -func AssignPublicIp_Values() []string { - return []string{ - AssignPublicIpEnabled, - AssignPublicIpDisabled, - } -} - -const ( - // BatchJobDependencyTypeNToN is a BatchJobDependencyType enum value - BatchJobDependencyTypeNToN = "N_TO_N" - - // BatchJobDependencyTypeSequential is a BatchJobDependencyType enum value - BatchJobDependencyTypeSequential = "SEQUENTIAL" -) - -// BatchJobDependencyType_Values returns all elements of the BatchJobDependencyType enum -func BatchJobDependencyType_Values() []string { - return []string{ - BatchJobDependencyTypeNToN, - BatchJobDependencyTypeSequential, - } -} - -const ( - // BatchResourceRequirementTypeGpu is a BatchResourceRequirementType enum value - BatchResourceRequirementTypeGpu = "GPU" - - // BatchResourceRequirementTypeMemory is a BatchResourceRequirementType enum value - BatchResourceRequirementTypeMemory = "MEMORY" - - // BatchResourceRequirementTypeVcpu is a BatchResourceRequirementType enum value - BatchResourceRequirementTypeVcpu = "VCPU" -) - -// BatchResourceRequirementType_Values returns all elements of the BatchResourceRequirementType enum -func BatchResourceRequirementType_Values() []string { - return []string{ - BatchResourceRequirementTypeGpu, - BatchResourceRequirementTypeMemory, - BatchResourceRequirementTypeVcpu, - } -} - -const ( - // DynamoDBStreamStartPositionTrimHorizon is a DynamoDBStreamStartPosition enum value - DynamoDBStreamStartPositionTrimHorizon = "TRIM_HORIZON" - - // DynamoDBStreamStartPositionLatest is a DynamoDBStreamStartPosition enum value - DynamoDBStreamStartPositionLatest = "LATEST" -) - -// DynamoDBStreamStartPosition_Values returns all elements of the DynamoDBStreamStartPosition enum -func DynamoDBStreamStartPosition_Values() []string { - return []string{ - DynamoDBStreamStartPositionTrimHorizon, - DynamoDBStreamStartPositionLatest, - } -} - -const ( - // EcsEnvironmentFileTypeS3 is a EcsEnvironmentFileType enum value - EcsEnvironmentFileTypeS3 = "s3" -) - -// EcsEnvironmentFileType_Values returns all elements of the EcsEnvironmentFileType enum -func EcsEnvironmentFileType_Values() []string { - return []string{ - EcsEnvironmentFileTypeS3, - } -} - -const ( - // EcsResourceRequirementTypeGpu is a EcsResourceRequirementType enum value - EcsResourceRequirementTypeGpu = "GPU" - - // EcsResourceRequirementTypeInferenceAccelerator is a EcsResourceRequirementType enum value - EcsResourceRequirementTypeInferenceAccelerator = "InferenceAccelerator" -) - -// EcsResourceRequirementType_Values returns all elements of the EcsResourceRequirementType enum -func EcsResourceRequirementType_Values() []string { - return []string{ - EcsResourceRequirementTypeGpu, - EcsResourceRequirementTypeInferenceAccelerator, - } -} - -const ( - // IncludeExecutionDataOptionAll is a IncludeExecutionDataOption enum value - IncludeExecutionDataOptionAll = "ALL" -) - -// IncludeExecutionDataOption_Values returns all elements of the IncludeExecutionDataOption enum -func IncludeExecutionDataOption_Values() []string { - return []string{ - IncludeExecutionDataOptionAll, - } -} - -const ( - // KinesisStreamStartPositionTrimHorizon is a KinesisStreamStartPosition enum value - KinesisStreamStartPositionTrimHorizon = "TRIM_HORIZON" - - // KinesisStreamStartPositionLatest is a KinesisStreamStartPosition enum value - KinesisStreamStartPositionLatest = "LATEST" - - // KinesisStreamStartPositionAtTimestamp is a KinesisStreamStartPosition enum value - KinesisStreamStartPositionAtTimestamp = "AT_TIMESTAMP" -) - -// KinesisStreamStartPosition_Values returns all elements of the KinesisStreamStartPosition enum -func KinesisStreamStartPosition_Values() []string { - return []string{ - KinesisStreamStartPositionTrimHorizon, - KinesisStreamStartPositionLatest, - KinesisStreamStartPositionAtTimestamp, - } -} - -const ( - // LaunchTypeEc2 is a LaunchType enum value - LaunchTypeEc2 = "EC2" - - // LaunchTypeFargate is a LaunchType enum value - LaunchTypeFargate = "FARGATE" - - // LaunchTypeExternal is a LaunchType enum value - LaunchTypeExternal = "EXTERNAL" -) - -// LaunchType_Values returns all elements of the LaunchType enum -func LaunchType_Values() []string { - return []string{ - LaunchTypeEc2, - LaunchTypeFargate, - LaunchTypeExternal, - } -} - -const ( - // LogLevelOff is a LogLevel enum value - LogLevelOff = "OFF" - - // LogLevelError is a LogLevel enum value - LogLevelError = "ERROR" - - // LogLevelInfo is a LogLevel enum value - LogLevelInfo = "INFO" - - // LogLevelTrace is a LogLevel enum value - LogLevelTrace = "TRACE" -) - -// LogLevel_Values returns all elements of the LogLevel enum -func LogLevel_Values() []string { - return []string{ - LogLevelOff, - LogLevelError, - LogLevelInfo, - LogLevelTrace, - } -} - -const ( - // MSKStartPositionTrimHorizon is a MSKStartPosition enum value - MSKStartPositionTrimHorizon = "TRIM_HORIZON" - - // MSKStartPositionLatest is a MSKStartPosition enum value - MSKStartPositionLatest = "LATEST" -) - -// MSKStartPosition_Values returns all elements of the MSKStartPosition enum -func MSKStartPosition_Values() []string { - return []string{ - MSKStartPositionTrimHorizon, - MSKStartPositionLatest, - } -} - -const ( - // OnPartialBatchItemFailureStreamsAutomaticBisect is a OnPartialBatchItemFailureStreams enum value - OnPartialBatchItemFailureStreamsAutomaticBisect = "AUTOMATIC_BISECT" -) - -// OnPartialBatchItemFailureStreams_Values returns all elements of the OnPartialBatchItemFailureStreams enum -func OnPartialBatchItemFailureStreams_Values() []string { - return []string{ - OnPartialBatchItemFailureStreamsAutomaticBisect, - } -} - -const ( - // PipeStateRunning is a PipeState enum value - PipeStateRunning = "RUNNING" - - // PipeStateStopped is a PipeState enum value - PipeStateStopped = "STOPPED" - - // PipeStateCreating is a PipeState enum value - PipeStateCreating = "CREATING" - - // PipeStateUpdating is a PipeState enum value - PipeStateUpdating = "UPDATING" - - // PipeStateDeleting is a PipeState enum value - PipeStateDeleting = "DELETING" - - // PipeStateStarting is a PipeState enum value - PipeStateStarting = "STARTING" - - // PipeStateStopping is a PipeState enum value - PipeStateStopping = "STOPPING" - - // PipeStateCreateFailed is a PipeState enum value - PipeStateCreateFailed = "CREATE_FAILED" - - // PipeStateUpdateFailed is a PipeState enum value - PipeStateUpdateFailed = "UPDATE_FAILED" - - // PipeStateStartFailed is a PipeState enum value - PipeStateStartFailed = "START_FAILED" - - // PipeStateStopFailed is a PipeState enum value - PipeStateStopFailed = "STOP_FAILED" - - // PipeStateDeleteFailed is a PipeState enum value - PipeStateDeleteFailed = "DELETE_FAILED" - - // PipeStateCreateRollbackFailed is a PipeState enum value - PipeStateCreateRollbackFailed = "CREATE_ROLLBACK_FAILED" - - // PipeStateDeleteRollbackFailed is a PipeState enum value - PipeStateDeleteRollbackFailed = "DELETE_ROLLBACK_FAILED" - - // PipeStateUpdateRollbackFailed is a PipeState enum value - PipeStateUpdateRollbackFailed = "UPDATE_ROLLBACK_FAILED" -) - -// PipeState_Values returns all elements of the PipeState enum -func PipeState_Values() []string { - return []string{ - PipeStateRunning, - PipeStateStopped, - PipeStateCreating, - PipeStateUpdating, - PipeStateDeleting, - PipeStateStarting, - PipeStateStopping, - PipeStateCreateFailed, - PipeStateUpdateFailed, - PipeStateStartFailed, - PipeStateStopFailed, - PipeStateDeleteFailed, - PipeStateCreateRollbackFailed, - PipeStateDeleteRollbackFailed, - PipeStateUpdateRollbackFailed, - } -} - -const ( - // PipeTargetInvocationTypeRequestResponse is a PipeTargetInvocationType enum value - PipeTargetInvocationTypeRequestResponse = "REQUEST_RESPONSE" - - // PipeTargetInvocationTypeFireAndForget is a PipeTargetInvocationType enum value - PipeTargetInvocationTypeFireAndForget = "FIRE_AND_FORGET" -) - -// PipeTargetInvocationType_Values returns all elements of the PipeTargetInvocationType enum -func PipeTargetInvocationType_Values() []string { - return []string{ - PipeTargetInvocationTypeRequestResponse, - PipeTargetInvocationTypeFireAndForget, - } -} - -const ( - // PlacementConstraintTypeDistinctInstance is a PlacementConstraintType enum value - PlacementConstraintTypeDistinctInstance = "distinctInstance" - - // PlacementConstraintTypeMemberOf is a PlacementConstraintType enum value - PlacementConstraintTypeMemberOf = "memberOf" -) - -// PlacementConstraintType_Values returns all elements of the PlacementConstraintType enum -func PlacementConstraintType_Values() []string { - return []string{ - PlacementConstraintTypeDistinctInstance, - PlacementConstraintTypeMemberOf, - } -} - -const ( - // PlacementStrategyTypeRandom is a PlacementStrategyType enum value - PlacementStrategyTypeRandom = "random" - - // PlacementStrategyTypeSpread is a PlacementStrategyType enum value - PlacementStrategyTypeSpread = "spread" - - // PlacementStrategyTypeBinpack is a PlacementStrategyType enum value - PlacementStrategyTypeBinpack = "binpack" -) - -// PlacementStrategyType_Values returns all elements of the PlacementStrategyType enum -func PlacementStrategyType_Values() []string { - return []string{ - PlacementStrategyTypeRandom, - PlacementStrategyTypeSpread, - PlacementStrategyTypeBinpack, - } -} - -const ( - // PropagateTagsTaskDefinition is a PropagateTags enum value - PropagateTagsTaskDefinition = "TASK_DEFINITION" -) - -// PropagateTags_Values returns all elements of the PropagateTags enum -func PropagateTags_Values() []string { - return []string{ - PropagateTagsTaskDefinition, - } -} - -const ( - // RequestedPipeStateRunning is a RequestedPipeState enum value - RequestedPipeStateRunning = "RUNNING" - - // RequestedPipeStateStopped is a RequestedPipeState enum value - RequestedPipeStateStopped = "STOPPED" -) - -// RequestedPipeState_Values returns all elements of the RequestedPipeState enum -func RequestedPipeState_Values() []string { - return []string{ - RequestedPipeStateRunning, - RequestedPipeStateStopped, - } -} - -const ( - // RequestedPipeStateDescribeResponseRunning is a RequestedPipeStateDescribeResponse enum value - RequestedPipeStateDescribeResponseRunning = "RUNNING" - - // RequestedPipeStateDescribeResponseStopped is a RequestedPipeStateDescribeResponse enum value - RequestedPipeStateDescribeResponseStopped = "STOPPED" - - // RequestedPipeStateDescribeResponseDeleted is a RequestedPipeStateDescribeResponse enum value - RequestedPipeStateDescribeResponseDeleted = "DELETED" -) - -// RequestedPipeStateDescribeResponse_Values returns all elements of the RequestedPipeStateDescribeResponse enum -func RequestedPipeStateDescribeResponse_Values() []string { - return []string{ - RequestedPipeStateDescribeResponseRunning, - RequestedPipeStateDescribeResponseStopped, - RequestedPipeStateDescribeResponseDeleted, - } -} - -const ( - // S3OutputFormatJson is a S3OutputFormat enum value - S3OutputFormatJson = "json" - - // S3OutputFormatPlain is a S3OutputFormat enum value - S3OutputFormatPlain = "plain" - - // S3OutputFormatW3c is a S3OutputFormat enum value - S3OutputFormatW3c = "w3c" -) - -// S3OutputFormat_Values returns all elements of the S3OutputFormat enum -func S3OutputFormat_Values() []string { - return []string{ - S3OutputFormatJson, - S3OutputFormatPlain, - S3OutputFormatW3c, - } -} - -const ( - // SelfManagedKafkaStartPositionTrimHorizon is a SelfManagedKafkaStartPosition enum value - SelfManagedKafkaStartPositionTrimHorizon = "TRIM_HORIZON" - - // SelfManagedKafkaStartPositionLatest is a SelfManagedKafkaStartPosition enum value - SelfManagedKafkaStartPositionLatest = "LATEST" -) - -// SelfManagedKafkaStartPosition_Values returns all elements of the SelfManagedKafkaStartPosition enum -func SelfManagedKafkaStartPosition_Values() []string { - return []string{ - SelfManagedKafkaStartPositionTrimHorizon, - SelfManagedKafkaStartPositionLatest, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/doc.go deleted file mode 100644 index 9df7bb077ae1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/doc.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package pipes provides the client and types for making API -// requests to Amazon EventBridge Pipes. -// -// Amazon EventBridge Pipes connects event sources to targets. Pipes reduces -// the need for specialized knowledge and integration code when developing event -// driven architectures. This helps ensures consistency across your company’s -// applications. With Pipes, the target can be any available EventBridge target. -// To set up a pipe, you select the event source, add optional event filtering, -// define optional enrichment, and select the target for the event data. -// -// See https://docs.aws.amazon.com/goto/WebAPI/pipes-2015-10-07 for more information on this service. -// -// See pipes package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/pipes/ -// -// # Using the Client -// -// To contact Amazon EventBridge Pipes with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon EventBridge Pipes client Pipes for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/pipes/#New -package pipes diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/errors.go deleted file mode 100644 index d77a7dbee142..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/errors.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package pipes - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // An action you attempted resulted in an exception. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalException for service response error code - // "InternalException". - // - // This exception occurs due to unexpected causes. - ErrCodeInternalException = "InternalException" - - // ErrCodeNotFoundException for service response error code - // "NotFoundException". - // - // An entity that you specified does not exist. - ErrCodeNotFoundException = "NotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // A quota has been exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // An action was throttled. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Indicates that an error has occurred while performing a validate operation. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "ConflictException": newErrorConflictException, - "InternalException": newErrorInternalException, - "NotFoundException": newErrorNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/pipesiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/pipesiface/interface.go deleted file mode 100644 index 32f5aa7e4141..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/pipesiface/interface.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package pipesiface provides an interface to enable mocking the Amazon EventBridge Pipes service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package pipesiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes" -) - -// PipesAPI provides an interface to enable mocking the -// pipes.Pipes service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon EventBridge Pipes. -// func myFunc(svc pipesiface.PipesAPI) bool { -// // Make svc.CreatePipe request -// } -// -// func main() { -// sess := session.New() -// svc := pipes.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockPipesClient struct { -// pipesiface.PipesAPI -// } -// func (m *mockPipesClient) CreatePipe(input *pipes.CreatePipeInput) (*pipes.CreatePipeOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockPipesClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type PipesAPI interface { - CreatePipe(*pipes.CreatePipeInput) (*pipes.CreatePipeOutput, error) - CreatePipeWithContext(aws.Context, *pipes.CreatePipeInput, ...request.Option) (*pipes.CreatePipeOutput, error) - CreatePipeRequest(*pipes.CreatePipeInput) (*request.Request, *pipes.CreatePipeOutput) - - DeletePipe(*pipes.DeletePipeInput) (*pipes.DeletePipeOutput, error) - DeletePipeWithContext(aws.Context, *pipes.DeletePipeInput, ...request.Option) (*pipes.DeletePipeOutput, error) - DeletePipeRequest(*pipes.DeletePipeInput) (*request.Request, *pipes.DeletePipeOutput) - - DescribePipe(*pipes.DescribePipeInput) (*pipes.DescribePipeOutput, error) - DescribePipeWithContext(aws.Context, *pipes.DescribePipeInput, ...request.Option) (*pipes.DescribePipeOutput, error) - DescribePipeRequest(*pipes.DescribePipeInput) (*request.Request, *pipes.DescribePipeOutput) - - ListPipes(*pipes.ListPipesInput) (*pipes.ListPipesOutput, error) - ListPipesWithContext(aws.Context, *pipes.ListPipesInput, ...request.Option) (*pipes.ListPipesOutput, error) - ListPipesRequest(*pipes.ListPipesInput) (*request.Request, *pipes.ListPipesOutput) - - ListPipesPages(*pipes.ListPipesInput, func(*pipes.ListPipesOutput, bool) bool) error - ListPipesPagesWithContext(aws.Context, *pipes.ListPipesInput, func(*pipes.ListPipesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*pipes.ListTagsForResourceInput) (*pipes.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *pipes.ListTagsForResourceInput, ...request.Option) (*pipes.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*pipes.ListTagsForResourceInput) (*request.Request, *pipes.ListTagsForResourceOutput) - - StartPipe(*pipes.StartPipeInput) (*pipes.StartPipeOutput, error) - StartPipeWithContext(aws.Context, *pipes.StartPipeInput, ...request.Option) (*pipes.StartPipeOutput, error) - StartPipeRequest(*pipes.StartPipeInput) (*request.Request, *pipes.StartPipeOutput) - - StopPipe(*pipes.StopPipeInput) (*pipes.StopPipeOutput, error) - StopPipeWithContext(aws.Context, *pipes.StopPipeInput, ...request.Option) (*pipes.StopPipeOutput, error) - StopPipeRequest(*pipes.StopPipeInput) (*request.Request, *pipes.StopPipeOutput) - - TagResource(*pipes.TagResourceInput) (*pipes.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *pipes.TagResourceInput, ...request.Option) (*pipes.TagResourceOutput, error) - TagResourceRequest(*pipes.TagResourceInput) (*request.Request, *pipes.TagResourceOutput) - - UntagResource(*pipes.UntagResourceInput) (*pipes.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *pipes.UntagResourceInput, ...request.Option) (*pipes.UntagResourceOutput, error) - UntagResourceRequest(*pipes.UntagResourceInput) (*request.Request, *pipes.UntagResourceOutput) - - UpdatePipe(*pipes.UpdatePipeInput) (*pipes.UpdatePipeOutput, error) - UpdatePipeWithContext(aws.Context, *pipes.UpdatePipeInput, ...request.Option) (*pipes.UpdatePipeOutput, error) - UpdatePipeRequest(*pipes.UpdatePipeInput) (*request.Request, *pipes.UpdatePipeOutput) -} - -var _ PipesAPI = (*pipes.Pipes)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/service.go deleted file mode 100644 index c7a4d4b12426..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/pipes/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package pipes - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// Pipes provides the API operation methods for making requests to -// Amazon EventBridge Pipes. See this package's package overview docs -// for details on the service. -// -// Pipes methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type Pipes struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Pipes" // Name of service. - EndpointsID = "pipes" // ID to lookup a service endpoint with. - ServiceID = "Pipes" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the Pipes client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a Pipes client from just a session. -// svc := pipes.New(mySession) -// -// // Create a Pipes client with additional configuration -// svc := pipes.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Pipes { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "pipes" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *Pipes { - svc := &Pipes{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2015-10-07", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Pipes operation and runs any -// custom request initialization. -func (c *Pipes) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/api.go deleted file mode 100644 index 514867942bb3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/api.go +++ /dev/null @@ -1,7643 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package privatenetworks - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opAcknowledgeOrderReceipt = "AcknowledgeOrderReceipt" - -// AcknowledgeOrderReceiptRequest generates a "aws/request.Request" representing the -// client's request for the AcknowledgeOrderReceipt 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 AcknowledgeOrderReceipt for more information on using the AcknowledgeOrderReceipt -// 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 AcknowledgeOrderReceiptRequest method. -// req, resp := client.AcknowledgeOrderReceiptRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/AcknowledgeOrderReceipt -func (c *PrivateNetworks) AcknowledgeOrderReceiptRequest(input *AcknowledgeOrderReceiptInput) (req *request.Request, output *AcknowledgeOrderReceiptOutput) { - op := &request.Operation{ - Name: opAcknowledgeOrderReceipt, - HTTPMethod: "POST", - HTTPPath: "/v1/orders/acknowledge", - } - - if input == nil { - input = &AcknowledgeOrderReceiptInput{} - } - - output = &AcknowledgeOrderReceiptOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcknowledgeOrderReceipt API operation for AWS Private 5G. -// -// Acknowledges that the specified network order was received. -// -// 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 AWS Private 5G's -// API operation AcknowledgeOrderReceipt for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/AcknowledgeOrderReceipt -func (c *PrivateNetworks) AcknowledgeOrderReceipt(input *AcknowledgeOrderReceiptInput) (*AcknowledgeOrderReceiptOutput, error) { - req, out := c.AcknowledgeOrderReceiptRequest(input) - return out, req.Send() -} - -// AcknowledgeOrderReceiptWithContext is the same as AcknowledgeOrderReceipt with the addition of -// the ability to pass a context and additional request options. -// -// See AcknowledgeOrderReceipt 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 *PrivateNetworks) AcknowledgeOrderReceiptWithContext(ctx aws.Context, input *AcknowledgeOrderReceiptInput, opts ...request.Option) (*AcknowledgeOrderReceiptOutput, error) { - req, out := c.AcknowledgeOrderReceiptRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opActivateDeviceIdentifier = "ActivateDeviceIdentifier" - -// ActivateDeviceIdentifierRequest generates a "aws/request.Request" representing the -// client's request for the ActivateDeviceIdentifier 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 ActivateDeviceIdentifier for more information on using the ActivateDeviceIdentifier -// 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 ActivateDeviceIdentifierRequest method. -// req, resp := client.ActivateDeviceIdentifierRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ActivateDeviceIdentifier -func (c *PrivateNetworks) ActivateDeviceIdentifierRequest(input *ActivateDeviceIdentifierInput) (req *request.Request, output *ActivateDeviceIdentifierOutput) { - op := &request.Operation{ - Name: opActivateDeviceIdentifier, - HTTPMethod: "POST", - HTTPPath: "/v1/device-identifiers/activate", - } - - if input == nil { - input = &ActivateDeviceIdentifierInput{} - } - - output = &ActivateDeviceIdentifierOutput{} - req = c.newRequest(op, input, output) - return -} - -// ActivateDeviceIdentifier API operation for AWS Private 5G. -// -// Activates the specified device identifier. -// -// 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 AWS Private 5G's -// API operation ActivateDeviceIdentifier for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ActivateDeviceIdentifier -func (c *PrivateNetworks) ActivateDeviceIdentifier(input *ActivateDeviceIdentifierInput) (*ActivateDeviceIdentifierOutput, error) { - req, out := c.ActivateDeviceIdentifierRequest(input) - return out, req.Send() -} - -// ActivateDeviceIdentifierWithContext is the same as ActivateDeviceIdentifier with the addition of -// the ability to pass a context and additional request options. -// -// See ActivateDeviceIdentifier 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 *PrivateNetworks) ActivateDeviceIdentifierWithContext(ctx aws.Context, input *ActivateDeviceIdentifierInput, opts ...request.Option) (*ActivateDeviceIdentifierOutput, error) { - req, out := c.ActivateDeviceIdentifierRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opActivateNetworkSite = "ActivateNetworkSite" - -// ActivateNetworkSiteRequest generates a "aws/request.Request" representing the -// client's request for the ActivateNetworkSite 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 ActivateNetworkSite for more information on using the ActivateNetworkSite -// 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 ActivateNetworkSiteRequest method. -// req, resp := client.ActivateNetworkSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ActivateNetworkSite -func (c *PrivateNetworks) ActivateNetworkSiteRequest(input *ActivateNetworkSiteInput) (req *request.Request, output *ActivateNetworkSiteOutput) { - op := &request.Operation{ - Name: opActivateNetworkSite, - HTTPMethod: "POST", - HTTPPath: "/v1/network-sites/activate", - } - - if input == nil { - input = &ActivateNetworkSiteInput{} - } - - output = &ActivateNetworkSiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// ActivateNetworkSite API operation for AWS Private 5G. -// -// Activates the specified network site. -// -// 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 AWS Private 5G's -// API operation ActivateNetworkSite for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ActivateNetworkSite -func (c *PrivateNetworks) ActivateNetworkSite(input *ActivateNetworkSiteInput) (*ActivateNetworkSiteOutput, error) { - req, out := c.ActivateNetworkSiteRequest(input) - return out, req.Send() -} - -// ActivateNetworkSiteWithContext is the same as ActivateNetworkSite with the addition of -// the ability to pass a context and additional request options. -// -// See ActivateNetworkSite 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 *PrivateNetworks) ActivateNetworkSiteWithContext(ctx aws.Context, input *ActivateNetworkSiteInput, opts ...request.Option) (*ActivateNetworkSiteOutput, error) { - req, out := c.ActivateNetworkSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opConfigureAccessPoint = "ConfigureAccessPoint" - -// ConfigureAccessPointRequest generates a "aws/request.Request" representing the -// client's request for the ConfigureAccessPoint 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 ConfigureAccessPoint for more information on using the ConfigureAccessPoint -// 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 ConfigureAccessPointRequest method. -// req, resp := client.ConfigureAccessPointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ConfigureAccessPoint -func (c *PrivateNetworks) ConfigureAccessPointRequest(input *ConfigureAccessPointInput) (req *request.Request, output *ConfigureAccessPointOutput) { - op := &request.Operation{ - Name: opConfigureAccessPoint, - HTTPMethod: "POST", - HTTPPath: "/v1/network-resources/configure", - } - - if input == nil { - input = &ConfigureAccessPointInput{} - } - - output = &ConfigureAccessPointOutput{} - req = c.newRequest(op, input, output) - return -} - -// ConfigureAccessPoint API operation for AWS Private 5G. -// -// Configures the specified network resource. -// -// Use this action to specify the geographic position of the hardware. You must -// provide Certified Professional Installer (CPI) credentials in the request -// so that we can obtain spectrum grants. For more information, see Radio units -// (https://docs.aws.amazon.com/private-networks/latest/userguide/radio-units.html) -// in the Amazon Web Services Private 5G User Guide. -// -// 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 AWS Private 5G's -// API operation ConfigureAccessPoint for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ConfigureAccessPoint -func (c *PrivateNetworks) ConfigureAccessPoint(input *ConfigureAccessPointInput) (*ConfigureAccessPointOutput, error) { - req, out := c.ConfigureAccessPointRequest(input) - return out, req.Send() -} - -// ConfigureAccessPointWithContext is the same as ConfigureAccessPoint with the addition of -// the ability to pass a context and additional request options. -// -// See ConfigureAccessPoint 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 *PrivateNetworks) ConfigureAccessPointWithContext(ctx aws.Context, input *ConfigureAccessPointInput, opts ...request.Option) (*ConfigureAccessPointOutput, error) { - req, out := c.ConfigureAccessPointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetwork = "CreateNetwork" - -// CreateNetworkRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetwork 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 CreateNetwork for more information on using the CreateNetwork -// 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 CreateNetworkRequest method. -// req, resp := client.CreateNetworkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/CreateNetwork -func (c *PrivateNetworks) CreateNetworkRequest(input *CreateNetworkInput) (req *request.Request, output *CreateNetworkOutput) { - op := &request.Operation{ - Name: opCreateNetwork, - HTTPMethod: "POST", - HTTPPath: "/v1/networks", - } - - if input == nil { - input = &CreateNetworkInput{} - } - - output = &CreateNetworkOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNetwork API operation for AWS Private 5G. -// -// Creates a network. -// -// 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 AWS Private 5G's -// API operation CreateNetwork for usage and error information. -// -// Returned Error Types: -// -// - LimitExceededException -// The limit was exceeded. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/CreateNetwork -func (c *PrivateNetworks) CreateNetwork(input *CreateNetworkInput) (*CreateNetworkOutput, error) { - req, out := c.CreateNetworkRequest(input) - return out, req.Send() -} - -// CreateNetworkWithContext is the same as CreateNetwork with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetwork 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 *PrivateNetworks) CreateNetworkWithContext(ctx aws.Context, input *CreateNetworkInput, opts ...request.Option) (*CreateNetworkOutput, error) { - req, out := c.CreateNetworkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNetworkSite = "CreateNetworkSite" - -// CreateNetworkSiteRequest generates a "aws/request.Request" representing the -// client's request for the CreateNetworkSite 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 CreateNetworkSite for more information on using the CreateNetworkSite -// 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 CreateNetworkSiteRequest method. -// req, resp := client.CreateNetworkSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/CreateNetworkSite -func (c *PrivateNetworks) CreateNetworkSiteRequest(input *CreateNetworkSiteInput) (req *request.Request, output *CreateNetworkSiteOutput) { - op := &request.Operation{ - Name: opCreateNetworkSite, - HTTPMethod: "POST", - HTTPPath: "/v1/network-sites", - } - - if input == nil { - input = &CreateNetworkSiteInput{} - } - - output = &CreateNetworkSiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNetworkSite API operation for AWS Private 5G. -// -// Creates a network site. -// -// 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 AWS Private 5G's -// API operation CreateNetworkSite for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/CreateNetworkSite -func (c *PrivateNetworks) CreateNetworkSite(input *CreateNetworkSiteInput) (*CreateNetworkSiteOutput, error) { - req, out := c.CreateNetworkSiteRequest(input) - return out, req.Send() -} - -// CreateNetworkSiteWithContext is the same as CreateNetworkSite with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNetworkSite 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 *PrivateNetworks) CreateNetworkSiteWithContext(ctx aws.Context, input *CreateNetworkSiteInput, opts ...request.Option) (*CreateNetworkSiteOutput, error) { - req, out := c.CreateNetworkSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeactivateDeviceIdentifier = "DeactivateDeviceIdentifier" - -// DeactivateDeviceIdentifierRequest generates a "aws/request.Request" representing the -// client's request for the DeactivateDeviceIdentifier 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 DeactivateDeviceIdentifier for more information on using the DeactivateDeviceIdentifier -// 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 DeactivateDeviceIdentifierRequest method. -// req, resp := client.DeactivateDeviceIdentifierRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/DeactivateDeviceIdentifier -func (c *PrivateNetworks) DeactivateDeviceIdentifierRequest(input *DeactivateDeviceIdentifierInput) (req *request.Request, output *DeactivateDeviceIdentifierOutput) { - op := &request.Operation{ - Name: opDeactivateDeviceIdentifier, - HTTPMethod: "POST", - HTTPPath: "/v1/device-identifiers/deactivate", - } - - if input == nil { - input = &DeactivateDeviceIdentifierInput{} - } - - output = &DeactivateDeviceIdentifierOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeactivateDeviceIdentifier API operation for AWS Private 5G. -// -// Deactivates the specified device identifier. -// -// 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 AWS Private 5G's -// API operation DeactivateDeviceIdentifier for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/DeactivateDeviceIdentifier -func (c *PrivateNetworks) DeactivateDeviceIdentifier(input *DeactivateDeviceIdentifierInput) (*DeactivateDeviceIdentifierOutput, error) { - req, out := c.DeactivateDeviceIdentifierRequest(input) - return out, req.Send() -} - -// DeactivateDeviceIdentifierWithContext is the same as DeactivateDeviceIdentifier with the addition of -// the ability to pass a context and additional request options. -// -// See DeactivateDeviceIdentifier 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 *PrivateNetworks) DeactivateDeviceIdentifierWithContext(ctx aws.Context, input *DeactivateDeviceIdentifierInput, opts ...request.Option) (*DeactivateDeviceIdentifierOutput, error) { - req, out := c.DeactivateDeviceIdentifierRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetwork = "DeleteNetwork" - -// DeleteNetworkRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetwork 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 DeleteNetwork for more information on using the DeleteNetwork -// 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 DeleteNetworkRequest method. -// req, resp := client.DeleteNetworkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/DeleteNetwork -func (c *PrivateNetworks) DeleteNetworkRequest(input *DeleteNetworkInput) (req *request.Request, output *DeleteNetworkOutput) { - op := &request.Operation{ - Name: opDeleteNetwork, - HTTPMethod: "DELETE", - HTTPPath: "/v1/networks/{networkArn}", - } - - if input == nil { - input = &DeleteNetworkInput{} - } - - output = &DeleteNetworkOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteNetwork API operation for AWS Private 5G. -// -// Deletes the specified network. You must delete network sites before you delete -// the network. For more information, see DeleteNetworkSite (https://docs.aws.amazon.com/private-networks/latest/APIReference/API_DeleteNetworkSite.html) -// in the API Reference for Amazon Web Services Private 5G. -// -// 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 AWS Private 5G's -// API operation DeleteNetwork for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// You do not have permission to perform this operation. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/DeleteNetwork -func (c *PrivateNetworks) DeleteNetwork(input *DeleteNetworkInput) (*DeleteNetworkOutput, error) { - req, out := c.DeleteNetworkRequest(input) - return out, req.Send() -} - -// DeleteNetworkWithContext is the same as DeleteNetwork with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetwork 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 *PrivateNetworks) DeleteNetworkWithContext(ctx aws.Context, input *DeleteNetworkInput, opts ...request.Option) (*DeleteNetworkOutput, error) { - req, out := c.DeleteNetworkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNetworkSite = "DeleteNetworkSite" - -// DeleteNetworkSiteRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNetworkSite 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 DeleteNetworkSite for more information on using the DeleteNetworkSite -// 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 DeleteNetworkSiteRequest method. -// req, resp := client.DeleteNetworkSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/DeleteNetworkSite -func (c *PrivateNetworks) DeleteNetworkSiteRequest(input *DeleteNetworkSiteInput) (req *request.Request, output *DeleteNetworkSiteOutput) { - op := &request.Operation{ - Name: opDeleteNetworkSite, - HTTPMethod: "DELETE", - HTTPPath: "/v1/network-sites/{networkSiteArn}", - } - - if input == nil { - input = &DeleteNetworkSiteInput{} - } - - output = &DeleteNetworkSiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteNetworkSite API operation for AWS Private 5G. -// -// Deletes the specified network site. Return the hardware after you delete -// the network site. You are responsible for minimum charges. For more information, -// see Hardware returns (https://docs.aws.amazon.com/private-networks/latest/userguide/hardware-maintenance.html) -// in the Amazon Web Services Private 5G User Guide. -// -// 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 AWS Private 5G's -// API operation DeleteNetworkSite for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// You do not have permission to perform this operation. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/DeleteNetworkSite -func (c *PrivateNetworks) DeleteNetworkSite(input *DeleteNetworkSiteInput) (*DeleteNetworkSiteOutput, error) { - req, out := c.DeleteNetworkSiteRequest(input) - return out, req.Send() -} - -// DeleteNetworkSiteWithContext is the same as DeleteNetworkSite with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNetworkSite 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 *PrivateNetworks) DeleteNetworkSiteWithContext(ctx aws.Context, input *DeleteNetworkSiteInput, opts ...request.Option) (*DeleteNetworkSiteOutput, error) { - req, out := c.DeleteNetworkSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDeviceIdentifier = "GetDeviceIdentifier" - -// GetDeviceIdentifierRequest generates a "aws/request.Request" representing the -// client's request for the GetDeviceIdentifier 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 GetDeviceIdentifier for more information on using the GetDeviceIdentifier -// 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 GetDeviceIdentifierRequest method. -// req, resp := client.GetDeviceIdentifierRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetDeviceIdentifier -func (c *PrivateNetworks) GetDeviceIdentifierRequest(input *GetDeviceIdentifierInput) (req *request.Request, output *GetDeviceIdentifierOutput) { - op := &request.Operation{ - Name: opGetDeviceIdentifier, - HTTPMethod: "GET", - HTTPPath: "/v1/device-identifiers/{deviceIdentifierArn}", - } - - if input == nil { - input = &GetDeviceIdentifierInput{} - } - - output = &GetDeviceIdentifierOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDeviceIdentifier API operation for AWS Private 5G. -// -// Gets the specified device identifier. -// -// 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 AWS Private 5G's -// API operation GetDeviceIdentifier for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetDeviceIdentifier -func (c *PrivateNetworks) GetDeviceIdentifier(input *GetDeviceIdentifierInput) (*GetDeviceIdentifierOutput, error) { - req, out := c.GetDeviceIdentifierRequest(input) - return out, req.Send() -} - -// GetDeviceIdentifierWithContext is the same as GetDeviceIdentifier with the addition of -// the ability to pass a context and additional request options. -// -// See GetDeviceIdentifier 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 *PrivateNetworks) GetDeviceIdentifierWithContext(ctx aws.Context, input *GetDeviceIdentifierInput, opts ...request.Option) (*GetDeviceIdentifierOutput, error) { - req, out := c.GetDeviceIdentifierRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetNetwork = "GetNetwork" - -// GetNetworkRequest generates a "aws/request.Request" representing the -// client's request for the GetNetwork 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 GetNetwork for more information on using the GetNetwork -// 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 GetNetworkRequest method. -// req, resp := client.GetNetworkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetNetwork -func (c *PrivateNetworks) GetNetworkRequest(input *GetNetworkInput) (req *request.Request, output *GetNetworkOutput) { - op := &request.Operation{ - Name: opGetNetwork, - HTTPMethod: "GET", - HTTPPath: "/v1/networks/{networkArn}", - } - - if input == nil { - input = &GetNetworkInput{} - } - - output = &GetNetworkOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetNetwork API operation for AWS Private 5G. -// -// Gets the specified network. -// -// 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 AWS Private 5G's -// API operation GetNetwork for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetNetwork -func (c *PrivateNetworks) GetNetwork(input *GetNetworkInput) (*GetNetworkOutput, error) { - req, out := c.GetNetworkRequest(input) - return out, req.Send() -} - -// GetNetworkWithContext is the same as GetNetwork with the addition of -// the ability to pass a context and additional request options. -// -// See GetNetwork 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 *PrivateNetworks) GetNetworkWithContext(ctx aws.Context, input *GetNetworkInput, opts ...request.Option) (*GetNetworkOutput, error) { - req, out := c.GetNetworkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetNetworkResource = "GetNetworkResource" - -// GetNetworkResourceRequest generates a "aws/request.Request" representing the -// client's request for the GetNetworkResource 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 GetNetworkResource for more information on using the GetNetworkResource -// 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 GetNetworkResourceRequest method. -// req, resp := client.GetNetworkResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetNetworkResource -func (c *PrivateNetworks) GetNetworkResourceRequest(input *GetNetworkResourceInput) (req *request.Request, output *GetNetworkResourceOutput) { - op := &request.Operation{ - Name: opGetNetworkResource, - HTTPMethod: "GET", - HTTPPath: "/v1/network-resources/{networkResourceArn}", - } - - if input == nil { - input = &GetNetworkResourceInput{} - } - - output = &GetNetworkResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetNetworkResource API operation for AWS Private 5G. -// -// Gets the specified network resource. -// -// 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 AWS Private 5G's -// API operation GetNetworkResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetNetworkResource -func (c *PrivateNetworks) GetNetworkResource(input *GetNetworkResourceInput) (*GetNetworkResourceOutput, error) { - req, out := c.GetNetworkResourceRequest(input) - return out, req.Send() -} - -// GetNetworkResourceWithContext is the same as GetNetworkResource with the addition of -// the ability to pass a context and additional request options. -// -// See GetNetworkResource 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 *PrivateNetworks) GetNetworkResourceWithContext(ctx aws.Context, input *GetNetworkResourceInput, opts ...request.Option) (*GetNetworkResourceOutput, error) { - req, out := c.GetNetworkResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetNetworkSite = "GetNetworkSite" - -// GetNetworkSiteRequest generates a "aws/request.Request" representing the -// client's request for the GetNetworkSite 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 GetNetworkSite for more information on using the GetNetworkSite -// 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 GetNetworkSiteRequest method. -// req, resp := client.GetNetworkSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetNetworkSite -func (c *PrivateNetworks) GetNetworkSiteRequest(input *GetNetworkSiteInput) (req *request.Request, output *GetNetworkSiteOutput) { - op := &request.Operation{ - Name: opGetNetworkSite, - HTTPMethod: "GET", - HTTPPath: "/v1/network-sites/{networkSiteArn}", - } - - if input == nil { - input = &GetNetworkSiteInput{} - } - - output = &GetNetworkSiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetNetworkSite API operation for AWS Private 5G. -// -// Gets the specified network site. -// -// 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 AWS Private 5G's -// API operation GetNetworkSite for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetNetworkSite -func (c *PrivateNetworks) GetNetworkSite(input *GetNetworkSiteInput) (*GetNetworkSiteOutput, error) { - req, out := c.GetNetworkSiteRequest(input) - return out, req.Send() -} - -// GetNetworkSiteWithContext is the same as GetNetworkSite with the addition of -// the ability to pass a context and additional request options. -// -// See GetNetworkSite 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 *PrivateNetworks) GetNetworkSiteWithContext(ctx aws.Context, input *GetNetworkSiteInput, opts ...request.Option) (*GetNetworkSiteOutput, error) { - req, out := c.GetNetworkSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetOrder = "GetOrder" - -// GetOrderRequest generates a "aws/request.Request" representing the -// client's request for the GetOrder 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 GetOrder for more information on using the GetOrder -// 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 GetOrderRequest method. -// req, resp := client.GetOrderRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetOrder -func (c *PrivateNetworks) GetOrderRequest(input *GetOrderInput) (req *request.Request, output *GetOrderOutput) { - op := &request.Operation{ - Name: opGetOrder, - HTTPMethod: "GET", - HTTPPath: "/v1/orders/{orderArn}", - } - - if input == nil { - input = &GetOrderInput{} - } - - output = &GetOrderOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOrder API operation for AWS Private 5G. -// -// Gets the specified order. -// -// 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 AWS Private 5G's -// API operation GetOrder for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/GetOrder -func (c *PrivateNetworks) GetOrder(input *GetOrderInput) (*GetOrderOutput, error) { - req, out := c.GetOrderRequest(input) - return out, req.Send() -} - -// GetOrderWithContext is the same as GetOrder with the addition of -// the ability to pass a context and additional request options. -// -// See GetOrder 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 *PrivateNetworks) GetOrderWithContext(ctx aws.Context, input *GetOrderInput, opts ...request.Option) (*GetOrderOutput, error) { - req, out := c.GetOrderRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListDeviceIdentifiers = "ListDeviceIdentifiers" - -// ListDeviceIdentifiersRequest generates a "aws/request.Request" representing the -// client's request for the ListDeviceIdentifiers 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 ListDeviceIdentifiers for more information on using the ListDeviceIdentifiers -// 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 ListDeviceIdentifiersRequest method. -// req, resp := client.ListDeviceIdentifiersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListDeviceIdentifiers -func (c *PrivateNetworks) ListDeviceIdentifiersRequest(input *ListDeviceIdentifiersInput) (req *request.Request, output *ListDeviceIdentifiersOutput) { - op := &request.Operation{ - Name: opListDeviceIdentifiers, - HTTPMethod: "POST", - HTTPPath: "/v1/device-identifiers/list", - Paginator: &request.Paginator{ - InputTokens: []string{"startToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDeviceIdentifiersInput{} - } - - output = &ListDeviceIdentifiersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDeviceIdentifiers API operation for AWS Private 5G. -// -// Lists device identifiers. Add filters to your request to return a more specific -// list of results. Use filters to match the Amazon Resource Name (ARN) of an -// order, the status of device identifiers, or the ARN of the traffic group. -// -// If you specify multiple filters, filters are joined with an OR, and the request -// returns results that match all of the specified filters. -// -// 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 AWS Private 5G's -// API operation ListDeviceIdentifiers for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListDeviceIdentifiers -func (c *PrivateNetworks) ListDeviceIdentifiers(input *ListDeviceIdentifiersInput) (*ListDeviceIdentifiersOutput, error) { - req, out := c.ListDeviceIdentifiersRequest(input) - return out, req.Send() -} - -// ListDeviceIdentifiersWithContext is the same as ListDeviceIdentifiers with the addition of -// the ability to pass a context and additional request options. -// -// See ListDeviceIdentifiers 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 *PrivateNetworks) ListDeviceIdentifiersWithContext(ctx aws.Context, input *ListDeviceIdentifiersInput, opts ...request.Option) (*ListDeviceIdentifiersOutput, error) { - req, out := c.ListDeviceIdentifiersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDeviceIdentifiersPages iterates over the pages of a ListDeviceIdentifiers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDeviceIdentifiers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDeviceIdentifiers operation. -// pageNum := 0 -// err := client.ListDeviceIdentifiersPages(params, -// func(page *privatenetworks.ListDeviceIdentifiersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PrivateNetworks) ListDeviceIdentifiersPages(input *ListDeviceIdentifiersInput, fn func(*ListDeviceIdentifiersOutput, bool) bool) error { - return c.ListDeviceIdentifiersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDeviceIdentifiersPagesWithContext same as ListDeviceIdentifiersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PrivateNetworks) ListDeviceIdentifiersPagesWithContext(ctx aws.Context, input *ListDeviceIdentifiersInput, fn func(*ListDeviceIdentifiersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDeviceIdentifiersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDeviceIdentifiersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDeviceIdentifiersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListNetworkResources = "ListNetworkResources" - -// ListNetworkResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListNetworkResources 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 ListNetworkResources for more information on using the ListNetworkResources -// 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 ListNetworkResourcesRequest method. -// req, resp := client.ListNetworkResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListNetworkResources -func (c *PrivateNetworks) ListNetworkResourcesRequest(input *ListNetworkResourcesInput) (req *request.Request, output *ListNetworkResourcesOutput) { - op := &request.Operation{ - Name: opListNetworkResources, - HTTPMethod: "POST", - HTTPPath: "/v1/network-resources", - Paginator: &request.Paginator{ - InputTokens: []string{"startToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListNetworkResourcesInput{} - } - - output = &ListNetworkResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListNetworkResources API operation for AWS Private 5G. -// -// Lists network resources. Add filters to your request to return a more specific -// list of results. Use filters to match the Amazon Resource Name (ARN) of an -// order or the status of network resources. -// -// If you specify multiple filters, filters are joined with an OR, and the request -// returns results that match all of the specified filters. -// -// 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 AWS Private 5G's -// API operation ListNetworkResources for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListNetworkResources -func (c *PrivateNetworks) ListNetworkResources(input *ListNetworkResourcesInput) (*ListNetworkResourcesOutput, error) { - req, out := c.ListNetworkResourcesRequest(input) - return out, req.Send() -} - -// ListNetworkResourcesWithContext is the same as ListNetworkResources with the addition of -// the ability to pass a context and additional request options. -// -// See ListNetworkResources 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 *PrivateNetworks) ListNetworkResourcesWithContext(ctx aws.Context, input *ListNetworkResourcesInput, opts ...request.Option) (*ListNetworkResourcesOutput, error) { - req, out := c.ListNetworkResourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListNetworkResourcesPages iterates over the pages of a ListNetworkResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNetworkResources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListNetworkResources operation. -// pageNum := 0 -// err := client.ListNetworkResourcesPages(params, -// func(page *privatenetworks.ListNetworkResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PrivateNetworks) ListNetworkResourcesPages(input *ListNetworkResourcesInput, fn func(*ListNetworkResourcesOutput, bool) bool) error { - return c.ListNetworkResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNetworkResourcesPagesWithContext same as ListNetworkResourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PrivateNetworks) ListNetworkResourcesPagesWithContext(ctx aws.Context, input *ListNetworkResourcesInput, fn func(*ListNetworkResourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListNetworkResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListNetworkResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListNetworkResourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListNetworkSites = "ListNetworkSites" - -// ListNetworkSitesRequest generates a "aws/request.Request" representing the -// client's request for the ListNetworkSites 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 ListNetworkSites for more information on using the ListNetworkSites -// 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 ListNetworkSitesRequest method. -// req, resp := client.ListNetworkSitesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListNetworkSites -func (c *PrivateNetworks) ListNetworkSitesRequest(input *ListNetworkSitesInput) (req *request.Request, output *ListNetworkSitesOutput) { - op := &request.Operation{ - Name: opListNetworkSites, - HTTPMethod: "POST", - HTTPPath: "/v1/network-sites/list", - Paginator: &request.Paginator{ - InputTokens: []string{"startToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListNetworkSitesInput{} - } - - output = &ListNetworkSitesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListNetworkSites API operation for AWS Private 5G. -// -// Lists network sites. Add filters to your request to return a more specific -// list of results. Use filters to match the status of the network site. -// -// 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 AWS Private 5G's -// API operation ListNetworkSites for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListNetworkSites -func (c *PrivateNetworks) ListNetworkSites(input *ListNetworkSitesInput) (*ListNetworkSitesOutput, error) { - req, out := c.ListNetworkSitesRequest(input) - return out, req.Send() -} - -// ListNetworkSitesWithContext is the same as ListNetworkSites with the addition of -// the ability to pass a context and additional request options. -// -// See ListNetworkSites 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 *PrivateNetworks) ListNetworkSitesWithContext(ctx aws.Context, input *ListNetworkSitesInput, opts ...request.Option) (*ListNetworkSitesOutput, error) { - req, out := c.ListNetworkSitesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListNetworkSitesPages iterates over the pages of a ListNetworkSites operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNetworkSites method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListNetworkSites operation. -// pageNum := 0 -// err := client.ListNetworkSitesPages(params, -// func(page *privatenetworks.ListNetworkSitesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PrivateNetworks) ListNetworkSitesPages(input *ListNetworkSitesInput, fn func(*ListNetworkSitesOutput, bool) bool) error { - return c.ListNetworkSitesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNetworkSitesPagesWithContext same as ListNetworkSitesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PrivateNetworks) ListNetworkSitesPagesWithContext(ctx aws.Context, input *ListNetworkSitesInput, fn func(*ListNetworkSitesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListNetworkSitesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListNetworkSitesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListNetworkSitesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListNetworks = "ListNetworks" - -// ListNetworksRequest generates a "aws/request.Request" representing the -// client's request for the ListNetworks 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 ListNetworks for more information on using the ListNetworks -// 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 ListNetworksRequest method. -// req, resp := client.ListNetworksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListNetworks -func (c *PrivateNetworks) ListNetworksRequest(input *ListNetworksInput) (req *request.Request, output *ListNetworksOutput) { - op := &request.Operation{ - Name: opListNetworks, - HTTPMethod: "POST", - HTTPPath: "/v1/networks/list", - Paginator: &request.Paginator{ - InputTokens: []string{"startToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListNetworksInput{} - } - - output = &ListNetworksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListNetworks API operation for AWS Private 5G. -// -// Lists networks. Add filters to your request to return a more specific list -// of results. Use filters to match the status of the network. -// -// 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 AWS Private 5G's -// API operation ListNetworks for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListNetworks -func (c *PrivateNetworks) ListNetworks(input *ListNetworksInput) (*ListNetworksOutput, error) { - req, out := c.ListNetworksRequest(input) - return out, req.Send() -} - -// ListNetworksWithContext is the same as ListNetworks with the addition of -// the ability to pass a context and additional request options. -// -// See ListNetworks 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 *PrivateNetworks) ListNetworksWithContext(ctx aws.Context, input *ListNetworksInput, opts ...request.Option) (*ListNetworksOutput, error) { - req, out := c.ListNetworksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListNetworksPages iterates over the pages of a ListNetworks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNetworks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListNetworks operation. -// pageNum := 0 -// err := client.ListNetworksPages(params, -// func(page *privatenetworks.ListNetworksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PrivateNetworks) ListNetworksPages(input *ListNetworksInput, fn func(*ListNetworksOutput, bool) bool) error { - return c.ListNetworksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNetworksPagesWithContext same as ListNetworksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PrivateNetworks) ListNetworksPagesWithContext(ctx aws.Context, input *ListNetworksInput, fn func(*ListNetworksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListNetworksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListNetworksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListNetworksOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListOrders = "ListOrders" - -// ListOrdersRequest generates a "aws/request.Request" representing the -// client's request for the ListOrders 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 ListOrders for more information on using the ListOrders -// 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 ListOrdersRequest method. -// req, resp := client.ListOrdersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListOrders -func (c *PrivateNetworks) ListOrdersRequest(input *ListOrdersInput) (req *request.Request, output *ListOrdersOutput) { - op := &request.Operation{ - Name: opListOrders, - HTTPMethod: "POST", - HTTPPath: "/v1/orders/list", - Paginator: &request.Paginator{ - InputTokens: []string{"startToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListOrdersInput{} - } - - output = &ListOrdersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOrders API operation for AWS Private 5G. -// -// Lists orders. Add filters to your request to return a more specific list -// of results. Use filters to match the Amazon Resource Name (ARN) of the network -// site or the status of the order. -// -// If you specify multiple filters, filters are joined with an OR, and the request -// returns results that match all of the specified filters. -// -// 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 AWS Private 5G's -// API operation ListOrders for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListOrders -func (c *PrivateNetworks) ListOrders(input *ListOrdersInput) (*ListOrdersOutput, error) { - req, out := c.ListOrdersRequest(input) - return out, req.Send() -} - -// ListOrdersWithContext is the same as ListOrders with the addition of -// the ability to pass a context and additional request options. -// -// See ListOrders 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 *PrivateNetworks) ListOrdersWithContext(ctx aws.Context, input *ListOrdersInput, opts ...request.Option) (*ListOrdersOutput, error) { - req, out := c.ListOrdersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListOrdersPages iterates over the pages of a ListOrders operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOrders method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListOrders operation. -// pageNum := 0 -// err := client.ListOrdersPages(params, -// func(page *privatenetworks.ListOrdersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *PrivateNetworks) ListOrdersPages(input *ListOrdersInput, fn func(*ListOrdersOutput, bool) bool) error { - return c.ListOrdersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOrdersPagesWithContext same as ListOrdersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *PrivateNetworks) ListOrdersPagesWithContext(ctx aws.Context, input *ListOrdersInput, fn func(*ListOrdersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListOrdersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListOrdersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListOrdersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListTagsForResource -func (c *PrivateNetworks) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Private 5G. -// -// Lists the tags for the specified resource. -// -// 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 AWS Private 5G's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// You do not have permission to perform this operation. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/ListTagsForResource -func (c *PrivateNetworks) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *PrivateNetworks) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPing = "Ping" - -// PingRequest generates a "aws/request.Request" representing the -// client's request for the Ping 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 Ping for more information on using the Ping -// 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 PingRequest method. -// req, resp := client.PingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/Ping -func (c *PrivateNetworks) PingRequest(input *PingInput) (req *request.Request, output *PingOutput) { - op := &request.Operation{ - Name: opPing, - HTTPMethod: "GET", - HTTPPath: "/ping", - } - - if input == nil { - input = &PingInput{} - } - - output = &PingOutput{} - req = c.newRequest(op, input, output) - return -} - -// Ping API operation for AWS Private 5G. -// -// Checks the health of the 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 AWS Private 5G's -// API operation Ping for usage and error information. -// -// Returned Error Types: -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/Ping -func (c *PrivateNetworks) Ping(input *PingInput) (*PingOutput, error) { - req, out := c.PingRequest(input) - return out, req.Send() -} - -// PingWithContext is the same as Ping with the addition of -// the ability to pass a context and additional request options. -// -// See Ping 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 *PrivateNetworks) PingWithContext(ctx aws.Context, input *PingInput, opts ...request.Option) (*PingOutput, error) { - req, out := c.PingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartNetworkResourceUpdate = "StartNetworkResourceUpdate" - -// StartNetworkResourceUpdateRequest generates a "aws/request.Request" representing the -// client's request for the StartNetworkResourceUpdate 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 StartNetworkResourceUpdate for more information on using the StartNetworkResourceUpdate -// 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 StartNetworkResourceUpdateRequest method. -// req, resp := client.StartNetworkResourceUpdateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/StartNetworkResourceUpdate -func (c *PrivateNetworks) StartNetworkResourceUpdateRequest(input *StartNetworkResourceUpdateInput) (req *request.Request, output *StartNetworkResourceUpdateOutput) { - op := &request.Operation{ - Name: opStartNetworkResourceUpdate, - HTTPMethod: "POST", - HTTPPath: "/v1/network-resources/update", - } - - if input == nil { - input = &StartNetworkResourceUpdateInput{} - } - - output = &StartNetworkResourceUpdateOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartNetworkResourceUpdate API operation for AWS Private 5G. -// -// Use this action to do the following tasks: -// -// - Update the duration and renewal status of the commitment period for -// a radio unit. The update goes into effect immediately. -// -// - Request a replacement for a network resource. -// -// - Request that you return a network resource. -// -// After you submit a request to replace or return a network resource, the status -// of the network resource changes to CREATING_SHIPPING_LABEL. The shipping -// label is available when the status of the network resource is PENDING_RETURN. -// After the network resource is successfully returned, its status changes to -// DELETED. For more information, see Return a radio unit (https://docs.aws.amazon.com/private-networks/latest/userguide/radio-units.html#return-radio-unit). -// -// 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 AWS Private 5G's -// API operation StartNetworkResourceUpdate for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/StartNetworkResourceUpdate -func (c *PrivateNetworks) StartNetworkResourceUpdate(input *StartNetworkResourceUpdateInput) (*StartNetworkResourceUpdateOutput, error) { - req, out := c.StartNetworkResourceUpdateRequest(input) - return out, req.Send() -} - -// StartNetworkResourceUpdateWithContext is the same as StartNetworkResourceUpdate with the addition of -// the ability to pass a context and additional request options. -// -// See StartNetworkResourceUpdate 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 *PrivateNetworks) StartNetworkResourceUpdateWithContext(ctx aws.Context, input *StartNetworkResourceUpdateInput, opts ...request.Option) (*StartNetworkResourceUpdateOutput, error) { - req, out := c.StartNetworkResourceUpdateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/TagResource -func (c *PrivateNetworks) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Private 5G. -// -// Adds tags to the specified resource. -// -// 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 AWS Private 5G's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// You do not have permission to perform this operation. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/TagResource -func (c *PrivateNetworks) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *PrivateNetworks) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/UntagResource -func (c *PrivateNetworks) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Private 5G. -// -// Removes tags from the specified resource. -// -// 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 AWS Private 5G's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - AccessDeniedException -// You do not have permission to perform this operation. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/UntagResource -func (c *PrivateNetworks) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *PrivateNetworks) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateNetworkSite = "UpdateNetworkSite" - -// UpdateNetworkSiteRequest generates a "aws/request.Request" representing the -// client's request for the UpdateNetworkSite 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 UpdateNetworkSite for more information on using the UpdateNetworkSite -// 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 UpdateNetworkSiteRequest method. -// req, resp := client.UpdateNetworkSiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/UpdateNetworkSite -func (c *PrivateNetworks) UpdateNetworkSiteRequest(input *UpdateNetworkSiteInput) (req *request.Request, output *UpdateNetworkSiteOutput) { - op := &request.Operation{ - Name: opUpdateNetworkSite, - HTTPMethod: "PUT", - HTTPPath: "/v1/network-sites/site", - } - - if input == nil { - input = &UpdateNetworkSiteInput{} - } - - output = &UpdateNetworkSiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateNetworkSite API operation for AWS Private 5G. -// -// Updates the specified network site. -// -// 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 AWS Private 5G's -// API operation UpdateNetworkSite for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/UpdateNetworkSite -func (c *PrivateNetworks) UpdateNetworkSite(input *UpdateNetworkSiteInput) (*UpdateNetworkSiteOutput, error) { - req, out := c.UpdateNetworkSiteRequest(input) - return out, req.Send() -} - -// UpdateNetworkSiteWithContext is the same as UpdateNetworkSite with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateNetworkSite 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 *PrivateNetworks) UpdateNetworkSiteWithContext(ctx aws.Context, input *UpdateNetworkSiteInput, opts ...request.Option) (*UpdateNetworkSiteOutput, error) { - req, out := c.UpdateNetworkSiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateNetworkSitePlan = "UpdateNetworkSitePlan" - -// UpdateNetworkSitePlanRequest generates a "aws/request.Request" representing the -// client's request for the UpdateNetworkSitePlan 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 UpdateNetworkSitePlan for more information on using the UpdateNetworkSitePlan -// 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 UpdateNetworkSitePlanRequest method. -// req, resp := client.UpdateNetworkSitePlanRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/UpdateNetworkSitePlan -func (c *PrivateNetworks) UpdateNetworkSitePlanRequest(input *UpdateNetworkSitePlanInput) (req *request.Request, output *UpdateNetworkSitePlanOutput) { - op := &request.Operation{ - Name: opUpdateNetworkSitePlan, - HTTPMethod: "PUT", - HTTPPath: "/v1/network-sites/plan", - } - - if input == nil { - input = &UpdateNetworkSitePlanInput{} - } - - output = &UpdateNetworkSitePlanOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateNetworkSitePlan API operation for AWS Private 5G. -// -// Updates the specified network site plan. -// -// 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 AWS Private 5G's -// API operation UpdateNetworkSitePlan for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource was not found. -// -// - ValidationException -// The request failed validation. -// -// - InternalServerException -// Information about an internal error. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03/UpdateNetworkSitePlan -func (c *PrivateNetworks) UpdateNetworkSitePlan(input *UpdateNetworkSitePlanInput) (*UpdateNetworkSitePlanOutput, error) { - req, out := c.UpdateNetworkSitePlanRequest(input) - return out, req.Send() -} - -// UpdateNetworkSitePlanWithContext is the same as UpdateNetworkSitePlan with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateNetworkSitePlan 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 *PrivateNetworks) UpdateNetworkSitePlanWithContext(ctx aws.Context, input *UpdateNetworkSitePlanInput, opts ...request.Option) (*UpdateNetworkSitePlanOutput, error) { - req, out := c.UpdateNetworkSitePlanRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have permission to perform this operation. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type AcknowledgeOrderReceiptInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the order. - // - // OrderArn is a required field - OrderArn *string `locationName:"orderArn" 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 AcknowledgeOrderReceiptInput) 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 AcknowledgeOrderReceiptInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcknowledgeOrderReceiptInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcknowledgeOrderReceiptInput"} - if s.OrderArn == nil { - invalidParams.Add(request.NewErrParamRequired("OrderArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOrderArn sets the OrderArn field's value. -func (s *AcknowledgeOrderReceiptInput) SetOrderArn(v string) *AcknowledgeOrderReceiptInput { - s.OrderArn = &v - return s -} - -type AcknowledgeOrderReceiptOutput struct { - _ struct{} `type:"structure"` - - // Information about the order. - // - // Order is a required field - Order *Order `locationName:"order" type:"structure" 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 AcknowledgeOrderReceiptOutput) 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 AcknowledgeOrderReceiptOutput) GoString() string { - return s.String() -} - -// SetOrder sets the Order field's value. -func (s *AcknowledgeOrderReceiptOutput) SetOrder(v *Order) *AcknowledgeOrderReceiptOutput { - s.Order = v - return s -} - -type ActivateDeviceIdentifierInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the device identifier. - // - // DeviceIdentifierArn is a required field - DeviceIdentifierArn *string `locationName:"deviceIdentifierArn" 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 ActivateDeviceIdentifierInput) 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 ActivateDeviceIdentifierInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActivateDeviceIdentifierInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActivateDeviceIdentifierInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DeviceIdentifierArn == nil { - invalidParams.Add(request.NewErrParamRequired("DeviceIdentifierArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *ActivateDeviceIdentifierInput) SetClientToken(v string) *ActivateDeviceIdentifierInput { - s.ClientToken = &v - return s -} - -// SetDeviceIdentifierArn sets the DeviceIdentifierArn field's value. -func (s *ActivateDeviceIdentifierInput) SetDeviceIdentifierArn(v string) *ActivateDeviceIdentifierInput { - s.DeviceIdentifierArn = &v - return s -} - -type ActivateDeviceIdentifierOutput struct { - _ struct{} `type:"structure"` - - // Information about the device identifier. - // - // DeviceIdentifier is a required field - DeviceIdentifier *DeviceIdentifier `locationName:"deviceIdentifier" type:"structure" required:"true"` - - // The tags on the device identifier. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ActivateDeviceIdentifierOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 ActivateDeviceIdentifierOutput) 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 ActivateDeviceIdentifierOutput) GoString() string { - return s.String() -} - -// SetDeviceIdentifier sets the DeviceIdentifier field's value. -func (s *ActivateDeviceIdentifierOutput) SetDeviceIdentifier(v *DeviceIdentifier) *ActivateDeviceIdentifierOutput { - s.DeviceIdentifier = v - return s -} - -// SetTags sets the Tags field's value. -func (s *ActivateDeviceIdentifierOutput) SetTags(v map[string]*string) *ActivateDeviceIdentifierOutput { - s.Tags = v - return s -} - -type ActivateNetworkSiteInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // Determines the duration and renewal status of the commitment period for all - // pending radio units. - // - // If you include commitmentConfiguration in the ActivateNetworkSiteRequest - // action, you must specify the following: - // - // * The commitment period for the radio unit. You can choose a 60-day, 1-year, - // or 3-year period. - // - // * Whether you want your commitment period to automatically renew for one - // more year after your current commitment period expires. - // - // For pricing, see Amazon Web Services Private 5G Pricing (http://aws.amazon.com/private5g/pricing). - // - // If you do not include commitmentConfiguration in the ActivateNetworkSiteRequest - // action, the commitment period is set to 60-days. - CommitmentConfiguration *CommitmentConfiguration `locationName:"commitmentConfiguration" type:"structure"` - - // The Amazon Resource Name (ARN) of the network site. - // - // NetworkSiteArn is a required field - NetworkSiteArn *string `locationName:"networkSiteArn" type:"string" required:"true"` - - // The shipping address of the network site. - // - // ShippingAddress is a required field - ShippingAddress *Address `locationName:"shippingAddress" type:"structure" 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 ActivateNetworkSiteInput) 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 ActivateNetworkSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActivateNetworkSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActivateNetworkSiteInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.NetworkSiteArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkSiteArn")) - } - if s.ShippingAddress == nil { - invalidParams.Add(request.NewErrParamRequired("ShippingAddress")) - } - if s.CommitmentConfiguration != nil { - if err := s.CommitmentConfiguration.Validate(); err != nil { - invalidParams.AddNested("CommitmentConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ShippingAddress != nil { - if err := s.ShippingAddress.Validate(); err != nil { - invalidParams.AddNested("ShippingAddress", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *ActivateNetworkSiteInput) SetClientToken(v string) *ActivateNetworkSiteInput { - s.ClientToken = &v - return s -} - -// SetCommitmentConfiguration sets the CommitmentConfiguration field's value. -func (s *ActivateNetworkSiteInput) SetCommitmentConfiguration(v *CommitmentConfiguration) *ActivateNetworkSiteInput { - s.CommitmentConfiguration = v - return s -} - -// SetNetworkSiteArn sets the NetworkSiteArn field's value. -func (s *ActivateNetworkSiteInput) SetNetworkSiteArn(v string) *ActivateNetworkSiteInput { - s.NetworkSiteArn = &v - return s -} - -// SetShippingAddress sets the ShippingAddress field's value. -func (s *ActivateNetworkSiteInput) SetShippingAddress(v *Address) *ActivateNetworkSiteInput { - s.ShippingAddress = v - return s -} - -type ActivateNetworkSiteOutput struct { - _ struct{} `type:"structure"` - - // Information about the network site. - NetworkSite *NetworkSite `locationName:"networkSite" 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 ActivateNetworkSiteOutput) 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 ActivateNetworkSiteOutput) GoString() string { - return s.String() -} - -// SetNetworkSite sets the NetworkSite field's value. -func (s *ActivateNetworkSiteOutput) SetNetworkSite(v *NetworkSite) *ActivateNetworkSiteOutput { - s.NetworkSite = v - return s -} - -// Information about an address. -type Address struct { - _ struct{} `type:"structure"` - - // The city for this address. - // - // City is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - // - // City is a required field - City *string `locationName:"city" min:"1" type:"string" required:"true" sensitive:"true"` - - // The company name for this address. - // - // Company is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - Company *string `locationName:"company" min:"1" type:"string" sensitive:"true"` - - // The country for this address. - // - // Country is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - // - // Country is a required field - Country *string `locationName:"country" min:"1" type:"string" required:"true" sensitive:"true"` - - // The recipient's email address. - // - // EmailAddress is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - EmailAddress *string `locationName:"emailAddress" min:"1" type:"string" sensitive:"true"` - - // The recipient's name for this address. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The recipient's phone number. - // - // PhoneNumber is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - PhoneNumber *string `locationName:"phoneNumber" min:"1" type:"string" sensitive:"true"` - - // The postal code for this address. - // - // PostalCode is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - // - // PostalCode is a required field - PostalCode *string `locationName:"postalCode" min:"1" type:"string" required:"true" sensitive:"true"` - - // The state or province for this address. - // - // StateOrProvince is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - // - // StateOrProvince is a required field - StateOrProvince *string `locationName:"stateOrProvince" min:"1" type:"string" required:"true" sensitive:"true"` - - // The first line of the street address. - // - // Street1 is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - // - // Street1 is a required field - Street1 *string `locationName:"street1" min:"1" type:"string" required:"true" sensitive:"true"` - - // The second line of the street address. - // - // Street2 is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - Street2 *string `locationName:"street2" min:"1" type:"string" sensitive:"true"` - - // The third line of the street address. - // - // Street3 is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Address's - // String and GoString methods. - Street3 *string `locationName:"street3" min:"1" type:"string" sensitive:"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 Address) 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 Address) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Address) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Address"} - if s.City == nil { - invalidParams.Add(request.NewErrParamRequired("City")) - } - if s.City != nil && len(*s.City) < 1 { - invalidParams.Add(request.NewErrParamMinLen("City", 1)) - } - if s.Company != nil && len(*s.Company) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Company", 1)) - } - if s.Country == nil { - invalidParams.Add(request.NewErrParamRequired("Country")) - } - if s.Country != nil && len(*s.Country) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Country", 1)) - } - if s.EmailAddress != nil && len(*s.EmailAddress) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EmailAddress", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.PhoneNumber != nil && len(*s.PhoneNumber) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PhoneNumber", 1)) - } - if s.PostalCode == nil { - invalidParams.Add(request.NewErrParamRequired("PostalCode")) - } - if s.PostalCode != nil && len(*s.PostalCode) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PostalCode", 1)) - } - if s.StateOrProvince == nil { - invalidParams.Add(request.NewErrParamRequired("StateOrProvince")) - } - if s.StateOrProvince != nil && len(*s.StateOrProvince) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StateOrProvince", 1)) - } - if s.Street1 == nil { - invalidParams.Add(request.NewErrParamRequired("Street1")) - } - if s.Street1 != nil && len(*s.Street1) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Street1", 1)) - } - if s.Street2 != nil && len(*s.Street2) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Street2", 1)) - } - if s.Street3 != nil && len(*s.Street3) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Street3", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCity sets the City field's value. -func (s *Address) SetCity(v string) *Address { - s.City = &v - return s -} - -// SetCompany sets the Company field's value. -func (s *Address) SetCompany(v string) *Address { - s.Company = &v - return s -} - -// SetCountry sets the Country field's value. -func (s *Address) SetCountry(v string) *Address { - s.Country = &v - return s -} - -// SetEmailAddress sets the EmailAddress field's value. -func (s *Address) SetEmailAddress(v string) *Address { - s.EmailAddress = &v - return s -} - -// SetName sets the Name field's value. -func (s *Address) SetName(v string) *Address { - s.Name = &v - return s -} - -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *Address) SetPhoneNumber(v string) *Address { - s.PhoneNumber = &v - return s -} - -// SetPostalCode sets the PostalCode field's value. -func (s *Address) SetPostalCode(v string) *Address { - s.PostalCode = &v - return s -} - -// SetStateOrProvince sets the StateOrProvince field's value. -func (s *Address) SetStateOrProvince(v string) *Address { - s.StateOrProvince = &v - return s -} - -// SetStreet1 sets the Street1 field's value. -func (s *Address) SetStreet1(v string) *Address { - s.Street1 = &v - return s -} - -// SetStreet2 sets the Street2 field's value. -func (s *Address) SetStreet2(v string) *Address { - s.Street2 = &v - return s -} - -// SetStreet3 sets the Street3 field's value. -func (s *Address) SetStreet3(v string) *Address { - s.Street3 = &v - return s -} - -// Determines the duration and renewal status of the commitment period for a -// radio unit. -// -// For pricing, see Amazon Web Services Private 5G Pricing (http://aws.amazon.com/private5g/pricing). -type CommitmentConfiguration struct { - _ struct{} `type:"structure"` - - // Determines whether the commitment period for a radio unit is set to automatically - // renew for an additional 1 year after your current commitment period expires. - // - // Set to True, if you want your commitment period to automatically renew. Set - // to False if you do not want your commitment to automatically renew. - // - // You can do the following: - // - // * Set a 1-year commitment to automatically renew for an additional 1 year. - // The hourly rate for the additional year will continue to be the same as - // your existing 1-year rate. - // - // * Set a 3-year commitment to automatically renew for an additional 1 year. - // The hourly rate for the additional year will continue to be the same as - // your existing 3-year rate. - // - // * Turn off a previously-enabled automatic renewal on a 1-year or 3-year - // commitment. - // - // You cannot use the automatic-renewal option for a 60-day commitment. - // - // AutomaticRenewal is a required field - AutomaticRenewal *bool `locationName:"automaticRenewal" type:"boolean" required:"true"` - - // The duration of the commitment period for the radio unit. You can choose - // a 60-day, 1-year, or 3-year period. - // - // CommitmentLength is a required field - CommitmentLength *string `locationName:"commitmentLength" type:"string" required:"true" enum:"CommitmentLength"` -} - -// 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 CommitmentConfiguration) 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 CommitmentConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CommitmentConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CommitmentConfiguration"} - if s.AutomaticRenewal == nil { - invalidParams.Add(request.NewErrParamRequired("AutomaticRenewal")) - } - if s.CommitmentLength == nil { - invalidParams.Add(request.NewErrParamRequired("CommitmentLength")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutomaticRenewal sets the AutomaticRenewal field's value. -func (s *CommitmentConfiguration) SetAutomaticRenewal(v bool) *CommitmentConfiguration { - s.AutomaticRenewal = &v - return s -} - -// SetCommitmentLength sets the CommitmentLength field's value. -func (s *CommitmentConfiguration) SetCommitmentLength(v string) *CommitmentConfiguration { - s.CommitmentLength = &v - return s -} - -// Shows the duration, the date and time that the contract started and ends, -// and the renewal status of the commitment period for the radio unit. -type CommitmentInformation struct { - _ struct{} `type:"structure"` - - // The duration and renewal status of the commitment period for the radio unit. - // - // CommitmentConfiguration is a required field - CommitmentConfiguration *CommitmentConfiguration `locationName:"commitmentConfiguration" type:"structure" required:"true"` - - // The date and time that the commitment period ends. If you do not cancel or - // renew the commitment before the expiration date, you will be billed at the - // 60-day-commitment rate. - ExpiresOn *time.Time `locationName:"expiresOn" type:"timestamp" timestampFormat:"iso8601"` - - // The date and time that the commitment period started. - StartAt *time.Time `locationName:"startAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 CommitmentInformation) 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 CommitmentInformation) GoString() string { - return s.String() -} - -// SetCommitmentConfiguration sets the CommitmentConfiguration field's value. -func (s *CommitmentInformation) SetCommitmentConfiguration(v *CommitmentConfiguration) *CommitmentInformation { - s.CommitmentConfiguration = v - return s -} - -// SetExpiresOn sets the ExpiresOn field's value. -func (s *CommitmentInformation) SetExpiresOn(v time.Time) *CommitmentInformation { - s.ExpiresOn = &v - return s -} - -// SetStartAt sets the StartAt field's value. -func (s *CommitmentInformation) SetStartAt(v time.Time) *CommitmentInformation { - s.StartAt = &v - return s -} - -type ConfigureAccessPointInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the network resource. - // - // AccessPointArn is a required field - AccessPointArn *string `locationName:"accessPointArn" type:"string" required:"true"` - - // A Base64 encoded string of the CPI certificate associated with the CPI user - // who is certifying the coordinates of the network resource. - // - // CpiSecretKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ConfigureAccessPointInput's - // String and GoString methods. - CpiSecretKey *string `locationName:"cpiSecretKey" min:"1" type:"string" sensitive:"true"` - - // The CPI user ID of the CPI user who is certifying the coordinates of the - // network resource. - // - // CpiUserId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ConfigureAccessPointInput's - // String and GoString methods. - CpiUserId *string `locationName:"cpiUserId" min:"1" type:"string" sensitive:"true"` - - // The CPI password associated with the CPI certificate in cpiSecretKey. - // - // CpiUserPassword is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ConfigureAccessPointInput's - // String and GoString methods. - CpiUserPassword *string `locationName:"cpiUserPassword" min:"1" type:"string" sensitive:"true"` - - // The CPI user name of the CPI user who is certifying the coordinates of the - // radio unit. - // - // CpiUsername is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ConfigureAccessPointInput's - // String and GoString methods. - CpiUsername *string `locationName:"cpiUsername" min:"1" type:"string" sensitive:"true"` - - // The position of the network resource. - Position *Position `locationName:"position" 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 ConfigureAccessPointInput) 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 ConfigureAccessPointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfigureAccessPointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfigureAccessPointInput"} - if s.AccessPointArn == nil { - invalidParams.Add(request.NewErrParamRequired("AccessPointArn")) - } - if s.CpiSecretKey != nil && len(*s.CpiSecretKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CpiSecretKey", 1)) - } - if s.CpiUserId != nil && len(*s.CpiUserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CpiUserId", 1)) - } - if s.CpiUserPassword != nil && len(*s.CpiUserPassword) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CpiUserPassword", 1)) - } - if s.CpiUsername != nil && len(*s.CpiUsername) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CpiUsername", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessPointArn sets the AccessPointArn field's value. -func (s *ConfigureAccessPointInput) SetAccessPointArn(v string) *ConfigureAccessPointInput { - s.AccessPointArn = &v - return s -} - -// SetCpiSecretKey sets the CpiSecretKey field's value. -func (s *ConfigureAccessPointInput) SetCpiSecretKey(v string) *ConfigureAccessPointInput { - s.CpiSecretKey = &v - return s -} - -// SetCpiUserId sets the CpiUserId field's value. -func (s *ConfigureAccessPointInput) SetCpiUserId(v string) *ConfigureAccessPointInput { - s.CpiUserId = &v - return s -} - -// SetCpiUserPassword sets the CpiUserPassword field's value. -func (s *ConfigureAccessPointInput) SetCpiUserPassword(v string) *ConfigureAccessPointInput { - s.CpiUserPassword = &v - return s -} - -// SetCpiUsername sets the CpiUsername field's value. -func (s *ConfigureAccessPointInput) SetCpiUsername(v string) *ConfigureAccessPointInput { - s.CpiUsername = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *ConfigureAccessPointInput) SetPosition(v *Position) *ConfigureAccessPointInput { - s.Position = v - return s -} - -type ConfigureAccessPointOutput struct { - _ struct{} `type:"structure"` - - // Information about the network resource. - // - // AccessPoint is a required field - AccessPoint *NetworkResource `locationName:"accessPoint" type:"structure" 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 ConfigureAccessPointOutput) 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 ConfigureAccessPointOutput) GoString() string { - return s.String() -} - -// SetAccessPoint sets the AccessPoint field's value. -func (s *ConfigureAccessPointOutput) SetAccessPoint(v *NetworkResource) *ConfigureAccessPointOutput { - s.AccessPoint = v - return s -} - -type CreateNetworkInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The description of the network. - Description *string `locationName:"description" type:"string"` - - // The name of the network. You can't change the name after you create the network. - // - // NetworkName is a required field - NetworkName *string `locationName:"networkName" min:"1" type:"string" required:"true"` - - // The tags to apply to the network. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateNetworkInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 CreateNetworkInput) 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 CreateNetworkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.NetworkName == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkName")) - } - if s.NetworkName != nil && len(*s.NetworkName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkName", 1)) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateNetworkInput) SetClientToken(v string) *CreateNetworkInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateNetworkInput) SetDescription(v string) *CreateNetworkInput { - s.Description = &v - return s -} - -// SetNetworkName sets the NetworkName field's value. -func (s *CreateNetworkInput) SetNetworkName(v string) *CreateNetworkInput { - s.NetworkName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateNetworkInput) SetTags(v map[string]*string) *CreateNetworkInput { - s.Tags = v - return s -} - -type CreateNetworkOutput struct { - _ struct{} `type:"structure"` - - // Information about the network. - // - // Network is a required field - Network *Network `locationName:"network" type:"structure" required:"true"` - - // The network tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateNetworkOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 CreateNetworkOutput) 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 CreateNetworkOutput) GoString() string { - return s.String() -} - -// SetNetwork sets the Network field's value. -func (s *CreateNetworkOutput) SetNetwork(v *Network) *CreateNetworkOutput { - s.Network = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateNetworkOutput) SetTags(v map[string]*string) *CreateNetworkOutput { - s.Tags = v - return s -} - -type CreateNetworkSiteInput struct { - _ struct{} `type:"structure"` - - // The Availability Zone that is the parent of this site. You can't change the - // Availability Zone after you create the site. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The ID of the Availability Zone that is the parent of this site. You can't - // change the Availability Zone after you create the site. - AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The description of the site. - Description *string `locationName:"description" type:"string"` - - // The Amazon Resource Name (ARN) of the network. - // - // NetworkArn is a required field - NetworkArn *string `locationName:"networkArn" type:"string" required:"true"` - - // The name of the site. You can't change the name after you create the site. - // - // NetworkSiteName is a required field - NetworkSiteName *string `locationName:"networkSiteName" min:"1" type:"string" required:"true"` - - // Information about the pending plan for this site. - PendingPlan *SitePlan `locationName:"pendingPlan" type:"structure"` - - // The tags to apply to the network site. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateNetworkSiteInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 CreateNetworkSiteInput) 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 CreateNetworkSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkSiteInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.NetworkArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkArn")) - } - if s.NetworkSiteName == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkSiteName")) - } - if s.NetworkSiteName != nil && len(*s.NetworkSiteName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkSiteName", 1)) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.PendingPlan != nil { - if err := s.PendingPlan.Validate(); err != nil { - invalidParams.AddNested("PendingPlan", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateNetworkSiteInput) SetAvailabilityZone(v string) *CreateNetworkSiteInput { - s.AvailabilityZone = &v - return s -} - -// SetAvailabilityZoneId sets the AvailabilityZoneId field's value. -func (s *CreateNetworkSiteInput) SetAvailabilityZoneId(v string) *CreateNetworkSiteInput { - s.AvailabilityZoneId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateNetworkSiteInput) SetClientToken(v string) *CreateNetworkSiteInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateNetworkSiteInput) SetDescription(v string) *CreateNetworkSiteInput { - s.Description = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *CreateNetworkSiteInput) SetNetworkArn(v string) *CreateNetworkSiteInput { - s.NetworkArn = &v - return s -} - -// SetNetworkSiteName sets the NetworkSiteName field's value. -func (s *CreateNetworkSiteInput) SetNetworkSiteName(v string) *CreateNetworkSiteInput { - s.NetworkSiteName = &v - return s -} - -// SetPendingPlan sets the PendingPlan field's value. -func (s *CreateNetworkSiteInput) SetPendingPlan(v *SitePlan) *CreateNetworkSiteInput { - s.PendingPlan = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateNetworkSiteInput) SetTags(v map[string]*string) *CreateNetworkSiteInput { - s.Tags = v - return s -} - -type CreateNetworkSiteOutput struct { - _ struct{} `type:"structure"` - - // Information about the network site. - NetworkSite *NetworkSite `locationName:"networkSite" type:"structure"` - - // The network site tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateNetworkSiteOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 CreateNetworkSiteOutput) 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 CreateNetworkSiteOutput) GoString() string { - return s.String() -} - -// SetNetworkSite sets the NetworkSite field's value. -func (s *CreateNetworkSiteOutput) SetNetworkSite(v *NetworkSite) *CreateNetworkSiteOutput { - s.NetworkSite = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateNetworkSiteOutput) SetTags(v map[string]*string) *CreateNetworkSiteOutput { - s.Tags = v - return s -} - -type DeactivateDeviceIdentifierInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the device identifier. - // - // DeviceIdentifierArn is a required field - DeviceIdentifierArn *string `locationName:"deviceIdentifierArn" 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 DeactivateDeviceIdentifierInput) 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 DeactivateDeviceIdentifierInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeactivateDeviceIdentifierInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeactivateDeviceIdentifierInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DeviceIdentifierArn == nil { - invalidParams.Add(request.NewErrParamRequired("DeviceIdentifierArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeactivateDeviceIdentifierInput) SetClientToken(v string) *DeactivateDeviceIdentifierInput { - s.ClientToken = &v - return s -} - -// SetDeviceIdentifierArn sets the DeviceIdentifierArn field's value. -func (s *DeactivateDeviceIdentifierInput) SetDeviceIdentifierArn(v string) *DeactivateDeviceIdentifierInput { - s.DeviceIdentifierArn = &v - return s -} - -type DeactivateDeviceIdentifierOutput struct { - _ struct{} `type:"structure"` - - // Information about the device identifier. - // - // DeviceIdentifier is a required field - DeviceIdentifier *DeviceIdentifier `locationName:"deviceIdentifier" type:"structure" 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 DeactivateDeviceIdentifierOutput) 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 DeactivateDeviceIdentifierOutput) GoString() string { - return s.String() -} - -// SetDeviceIdentifier sets the DeviceIdentifier field's value. -func (s *DeactivateDeviceIdentifierOutput) SetDeviceIdentifier(v *DeviceIdentifier) *DeactivateDeviceIdentifierOutput { - s.DeviceIdentifier = v - return s -} - -type DeleteNetworkInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `location:"querystring" locationName:"clientToken" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the network. - // - // NetworkArn is a required field - NetworkArn *string `location:"uri" locationName:"networkArn" 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 DeleteNetworkInput) 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 DeleteNetworkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.NetworkArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkArn")) - } - if s.NetworkArn != nil && len(*s.NetworkArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteNetworkInput) SetClientToken(v string) *DeleteNetworkInput { - s.ClientToken = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *DeleteNetworkInput) SetNetworkArn(v string) *DeleteNetworkInput { - s.NetworkArn = &v - return s -} - -type DeleteNetworkOutput struct { - _ struct{} `type:"structure"` - - // Information about the network. - // - // Network is a required field - Network *Network `locationName:"network" type:"structure" 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 DeleteNetworkOutput) 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 DeleteNetworkOutput) GoString() string { - return s.String() -} - -// SetNetwork sets the Network field's value. -func (s *DeleteNetworkOutput) SetNetwork(v *Network) *DeleteNetworkOutput { - s.Network = v - return s -} - -type DeleteNetworkSiteInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `location:"querystring" locationName:"clientToken" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the network site. - // - // NetworkSiteArn is a required field - NetworkSiteArn *string `location:"uri" locationName:"networkSiteArn" 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 DeleteNetworkSiteInput) 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 DeleteNetworkSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkSiteInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.NetworkSiteArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkSiteArn")) - } - if s.NetworkSiteArn != nil && len(*s.NetworkSiteArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkSiteArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteNetworkSiteInput) SetClientToken(v string) *DeleteNetworkSiteInput { - s.ClientToken = &v - return s -} - -// SetNetworkSiteArn sets the NetworkSiteArn field's value. -func (s *DeleteNetworkSiteInput) SetNetworkSiteArn(v string) *DeleteNetworkSiteInput { - s.NetworkSiteArn = &v - return s -} - -type DeleteNetworkSiteOutput struct { - _ struct{} `type:"structure"` - - // Information about the network site. - NetworkSite *NetworkSite `locationName:"networkSite" 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 DeleteNetworkSiteOutput) 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 DeleteNetworkSiteOutput) GoString() string { - return s.String() -} - -// SetNetworkSite sets the NetworkSite field's value. -func (s *DeleteNetworkSiteOutput) SetNetworkSite(v *NetworkSite) *DeleteNetworkSiteOutput { - s.NetworkSite = v - return s -} - -// Information about a subscriber of a device that can use a network. -type DeviceIdentifier struct { - _ struct{} `type:"structure"` - - // The creation time of this device identifier. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Resource Name (ARN) of the device identifier. - DeviceIdentifierArn *string `locationName:"deviceIdentifierArn" type:"string"` - - // The Integrated Circuit Card Identifier of the device identifier. - Iccid *string `locationName:"iccid" type:"string"` - - // The International Mobile Subscriber Identity of the device identifier. - // - // Imsi is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DeviceIdentifier's - // String and GoString methods. - Imsi *string `locationName:"imsi" type:"string" sensitive:"true"` - - // The Amazon Resource Name (ARN) of the network on which the device identifier - // appears. - NetworkArn *string `locationName:"networkArn" type:"string"` - - // The Amazon Resource Name (ARN) of the order used to purchase the device identifier. - OrderArn *string `locationName:"orderArn" type:"string"` - - // The status of the device identifier. - Status *string `locationName:"status" type:"string" enum:"DeviceIdentifierStatus"` - - // The Amazon Resource Name (ARN) of the traffic group to which the device identifier - // belongs. - TrafficGroupArn *string `locationName:"trafficGroupArn" type:"string"` - - // The vendor of the device identifier. - Vendor *string `locationName:"vendor" 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 DeviceIdentifier) 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 DeviceIdentifier) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DeviceIdentifier) SetCreatedAt(v time.Time) *DeviceIdentifier { - s.CreatedAt = &v - return s -} - -// SetDeviceIdentifierArn sets the DeviceIdentifierArn field's value. -func (s *DeviceIdentifier) SetDeviceIdentifierArn(v string) *DeviceIdentifier { - s.DeviceIdentifierArn = &v - return s -} - -// SetIccid sets the Iccid field's value. -func (s *DeviceIdentifier) SetIccid(v string) *DeviceIdentifier { - s.Iccid = &v - return s -} - -// SetImsi sets the Imsi field's value. -func (s *DeviceIdentifier) SetImsi(v string) *DeviceIdentifier { - s.Imsi = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *DeviceIdentifier) SetNetworkArn(v string) *DeviceIdentifier { - s.NetworkArn = &v - return s -} - -// SetOrderArn sets the OrderArn field's value. -func (s *DeviceIdentifier) SetOrderArn(v string) *DeviceIdentifier { - s.OrderArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeviceIdentifier) SetStatus(v string) *DeviceIdentifier { - s.Status = &v - return s -} - -// SetTrafficGroupArn sets the TrafficGroupArn field's value. -func (s *DeviceIdentifier) SetTrafficGroupArn(v string) *DeviceIdentifier { - s.TrafficGroupArn = &v - return s -} - -// SetVendor sets the Vendor field's value. -func (s *DeviceIdentifier) SetVendor(v string) *DeviceIdentifier { - s.Vendor = &v - return s -} - -type GetDeviceIdentifierInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the device identifier. - // - // DeviceIdentifierArn is a required field - DeviceIdentifierArn *string `location:"uri" locationName:"deviceIdentifierArn" 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 GetDeviceIdentifierInput) 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 GetDeviceIdentifierInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeviceIdentifierInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeviceIdentifierInput"} - if s.DeviceIdentifierArn == nil { - invalidParams.Add(request.NewErrParamRequired("DeviceIdentifierArn")) - } - if s.DeviceIdentifierArn != nil && len(*s.DeviceIdentifierArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeviceIdentifierArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeviceIdentifierArn sets the DeviceIdentifierArn field's value. -func (s *GetDeviceIdentifierInput) SetDeviceIdentifierArn(v string) *GetDeviceIdentifierInput { - s.DeviceIdentifierArn = &v - return s -} - -type GetDeviceIdentifierOutput struct { - _ struct{} `type:"structure"` - - // Information about the device identifier. - DeviceIdentifier *DeviceIdentifier `locationName:"deviceIdentifier" type:"structure"` - - // The device identifier tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetDeviceIdentifierOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 GetDeviceIdentifierOutput) 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 GetDeviceIdentifierOutput) GoString() string { - return s.String() -} - -// SetDeviceIdentifier sets the DeviceIdentifier field's value. -func (s *GetDeviceIdentifierOutput) SetDeviceIdentifier(v *DeviceIdentifier) *GetDeviceIdentifierOutput { - s.DeviceIdentifier = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetDeviceIdentifierOutput) SetTags(v map[string]*string) *GetDeviceIdentifierOutput { - s.Tags = v - return s -} - -type GetNetworkInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the network. - // - // NetworkArn is a required field - NetworkArn *string `location:"uri" locationName:"networkArn" 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 GetNetworkInput) 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 GetNetworkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetNetworkInput"} - if s.NetworkArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkArn")) - } - if s.NetworkArn != nil && len(*s.NetworkArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *GetNetworkInput) SetNetworkArn(v string) *GetNetworkInput { - s.NetworkArn = &v - return s -} - -type GetNetworkOutput struct { - _ struct{} `type:"structure"` - - // Information about the network. - // - // Network is a required field - Network *Network `locationName:"network" type:"structure" required:"true"` - - // The network tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetNetworkOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 GetNetworkOutput) 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 GetNetworkOutput) GoString() string { - return s.String() -} - -// SetNetwork sets the Network field's value. -func (s *GetNetworkOutput) SetNetwork(v *Network) *GetNetworkOutput { - s.Network = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetNetworkOutput) SetTags(v map[string]*string) *GetNetworkOutput { - s.Tags = v - return s -} - -type GetNetworkResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the network resource. - // - // NetworkResourceArn is a required field - NetworkResourceArn *string `location:"uri" locationName:"networkResourceArn" 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 GetNetworkResourceInput) 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 GetNetworkResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetNetworkResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetNetworkResourceInput"} - if s.NetworkResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkResourceArn")) - } - if s.NetworkResourceArn != nil && len(*s.NetworkResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNetworkResourceArn sets the NetworkResourceArn field's value. -func (s *GetNetworkResourceInput) SetNetworkResourceArn(v string) *GetNetworkResourceInput { - s.NetworkResourceArn = &v - return s -} - -type GetNetworkResourceOutput struct { - _ struct{} `type:"structure"` - - // Information about the network resource. - // - // NetworkResource is a required field - NetworkResource *NetworkResource `locationName:"networkResource" type:"structure" required:"true"` - - // The network resource tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetNetworkResourceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 GetNetworkResourceOutput) 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 GetNetworkResourceOutput) GoString() string { - return s.String() -} - -// SetNetworkResource sets the NetworkResource field's value. -func (s *GetNetworkResourceOutput) SetNetworkResource(v *NetworkResource) *GetNetworkResourceOutput { - s.NetworkResource = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetNetworkResourceOutput) SetTags(v map[string]*string) *GetNetworkResourceOutput { - s.Tags = v - return s -} - -type GetNetworkSiteInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the network site. - // - // NetworkSiteArn is a required field - NetworkSiteArn *string `location:"uri" locationName:"networkSiteArn" 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 GetNetworkSiteInput) 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 GetNetworkSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetNetworkSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetNetworkSiteInput"} - if s.NetworkSiteArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkSiteArn")) - } - if s.NetworkSiteArn != nil && len(*s.NetworkSiteArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkSiteArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNetworkSiteArn sets the NetworkSiteArn field's value. -func (s *GetNetworkSiteInput) SetNetworkSiteArn(v string) *GetNetworkSiteInput { - s.NetworkSiteArn = &v - return s -} - -type GetNetworkSiteOutput struct { - _ struct{} `type:"structure"` - - // Information about the network site. - NetworkSite *NetworkSite `locationName:"networkSite" type:"structure"` - - // The network site tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetNetworkSiteOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 GetNetworkSiteOutput) 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 GetNetworkSiteOutput) GoString() string { - return s.String() -} - -// SetNetworkSite sets the NetworkSite field's value. -func (s *GetNetworkSiteOutput) SetNetworkSite(v *NetworkSite) *GetNetworkSiteOutput { - s.NetworkSite = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetNetworkSiteOutput) SetTags(v map[string]*string) *GetNetworkSiteOutput { - s.Tags = v - return s -} - -type GetOrderInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the order. - // - // OrderArn is a required field - OrderArn *string `location:"uri" locationName:"orderArn" 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 GetOrderInput) 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 GetOrderInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOrderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOrderInput"} - if s.OrderArn == nil { - invalidParams.Add(request.NewErrParamRequired("OrderArn")) - } - if s.OrderArn != nil && len(*s.OrderArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OrderArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOrderArn sets the OrderArn field's value. -func (s *GetOrderInput) SetOrderArn(v string) *GetOrderInput { - s.OrderArn = &v - return s -} - -type GetOrderOutput struct { - _ struct{} `type:"structure"` - - // Information about the order. - // - // Order is a required field - Order *Order `locationName:"order" type:"structure" required:"true"` - - // The order tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetOrderOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 GetOrderOutput) 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 GetOrderOutput) GoString() string { - return s.String() -} - -// SetOrder sets the Order field's value. -func (s *GetOrderOutput) SetOrder(v *Order) *GetOrderOutput { - s.Order = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetOrderOutput) SetTags(v map[string]*string) *GetOrderOutput { - s.Tags = v - return s -} - -// Information about an internal error. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // Advice to clients on when the call can be safely retried. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The limit was exceeded. -type LimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 LimitExceededException) 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 LimitExceededException) GoString() string { - return s.String() -} - -func newErrorLimitExceededException(v protocol.ResponseMetadata) error { - return &LimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *LimitExceededException) Code() string { - return "LimitExceededException" -} - -// Message returns the exception's message. -func (s *LimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *LimitExceededException) OrigErr() error { - return nil -} - -func (s *LimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *LimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *LimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListDeviceIdentifiersInput struct { - _ struct{} `type:"structure"` - - // The filters. - // - // * ORDER - The Amazon Resource Name (ARN) of the order. - // - // * STATUS - The status (ACTIVE | INACTIVE). - // - // * TRAFFIC_GROUP - The Amazon Resource Name (ARN) of the traffic group. - // - // Filter values are case sensitive. If you specify multiple values for a filter, - // the values are joined with an OR, and the request returns all results that - // match any of the specified values. - Filters map[string][]*string `locationName:"filters" type:"map"` - - // The maximum number of results to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the network. - // - // NetworkArn is a required field - NetworkArn *string `locationName:"networkArn" type:"string" required:"true"` - - // The token for the next page of results. - StartToken *string `locationName:"startToken" 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 ListDeviceIdentifiersInput) 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 ListDeviceIdentifiersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDeviceIdentifiersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDeviceIdentifiersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NetworkArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListDeviceIdentifiersInput) SetFilters(v map[string][]*string) *ListDeviceIdentifiersInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDeviceIdentifiersInput) SetMaxResults(v int64) *ListDeviceIdentifiersInput { - s.MaxResults = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *ListDeviceIdentifiersInput) SetNetworkArn(v string) *ListDeviceIdentifiersInput { - s.NetworkArn = &v - return s -} - -// SetStartToken sets the StartToken field's value. -func (s *ListDeviceIdentifiersInput) SetStartToken(v string) *ListDeviceIdentifiersInput { - s.StartToken = &v - return s -} - -type ListDeviceIdentifiersOutput struct { - _ struct{} `type:"structure"` - - // Information about the device identifiers. - DeviceIdentifiers []*DeviceIdentifier `locationName:"deviceIdentifiers" type:"list"` - - // The token for the next page of results. - NextToken *string `locationName:"nextToken" 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 ListDeviceIdentifiersOutput) 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 ListDeviceIdentifiersOutput) GoString() string { - return s.String() -} - -// SetDeviceIdentifiers sets the DeviceIdentifiers field's value. -func (s *ListDeviceIdentifiersOutput) SetDeviceIdentifiers(v []*DeviceIdentifier) *ListDeviceIdentifiersOutput { - s.DeviceIdentifiers = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDeviceIdentifiersOutput) SetNextToken(v string) *ListDeviceIdentifiersOutput { - s.NextToken = &v - return s -} - -type ListNetworkResourcesInput struct { - _ struct{} `type:"structure"` - - // The filters. - // - // * ORDER - The Amazon Resource Name (ARN) of the order. - // - // * STATUS - The status (AVAILABLE | DELETED | DELETING | PENDING | PENDING_RETURN - // | PROVISIONING | SHIPPED). - // - // Filter values are case sensitive. If you specify multiple values for a filter, - // the values are joined with an OR, and the request returns all results that - // match any of the specified values. - Filters map[string][]*string `locationName:"filters" type:"map"` - - // The maximum number of results to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the network. - // - // NetworkArn is a required field - NetworkArn *string `locationName:"networkArn" type:"string" required:"true"` - - // The token for the next page of results. - StartToken *string `locationName:"startToken" 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 ListNetworkResourcesInput) 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 ListNetworkResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListNetworkResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListNetworkResourcesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NetworkArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListNetworkResourcesInput) SetFilters(v map[string][]*string) *ListNetworkResourcesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListNetworkResourcesInput) SetMaxResults(v int64) *ListNetworkResourcesInput { - s.MaxResults = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *ListNetworkResourcesInput) SetNetworkArn(v string) *ListNetworkResourcesInput { - s.NetworkArn = &v - return s -} - -// SetStartToken sets the StartToken field's value. -func (s *ListNetworkResourcesInput) SetStartToken(v string) *ListNetworkResourcesInput { - s.StartToken = &v - return s -} - -type ListNetworkResourcesOutput struct { - _ struct{} `type:"structure"` - - // Information about network resources. - NetworkResources []*NetworkResource `locationName:"networkResources" type:"list"` - - // The token for the next page of results. - NextToken *string `locationName:"nextToken" 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 ListNetworkResourcesOutput) 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 ListNetworkResourcesOutput) GoString() string { - return s.String() -} - -// SetNetworkResources sets the NetworkResources field's value. -func (s *ListNetworkResourcesOutput) SetNetworkResources(v []*NetworkResource) *ListNetworkResourcesOutput { - s.NetworkResources = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListNetworkResourcesOutput) SetNextToken(v string) *ListNetworkResourcesOutput { - s.NextToken = &v - return s -} - -type ListNetworkSitesInput struct { - _ struct{} `type:"structure"` - - // The filters. Add filters to your request to return a more specific list of - // results. Use filters to match the status of the network sites. - // - // * STATUS - The status (AVAILABLE | CREATED | DELETED | DEPROVISIONING - // | PROVISIONING). - // - // Filter values are case sensitive. If you specify multiple values for a filter, - // the values are joined with an OR, and the request returns all results that - // match any of the specified values. - Filters map[string][]*string `locationName:"filters" type:"map"` - - // The maximum number of results to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the network. - // - // NetworkArn is a required field - NetworkArn *string `locationName:"networkArn" type:"string" required:"true"` - - // The token for the next page of results. - StartToken *string `locationName:"startToken" 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 ListNetworkSitesInput) 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 ListNetworkSitesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListNetworkSitesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListNetworkSitesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NetworkArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListNetworkSitesInput) SetFilters(v map[string][]*string) *ListNetworkSitesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListNetworkSitesInput) SetMaxResults(v int64) *ListNetworkSitesInput { - s.MaxResults = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *ListNetworkSitesInput) SetNetworkArn(v string) *ListNetworkSitesInput { - s.NetworkArn = &v - return s -} - -// SetStartToken sets the StartToken field's value. -func (s *ListNetworkSitesInput) SetStartToken(v string) *ListNetworkSitesInput { - s.StartToken = &v - return s -} - -type ListNetworkSitesOutput struct { - _ struct{} `type:"structure"` - - // Information about the network sites. - NetworkSites []*NetworkSite `locationName:"networkSites" type:"list"` - - // The token for the next page of results. - NextToken *string `locationName:"nextToken" 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 ListNetworkSitesOutput) 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 ListNetworkSitesOutput) GoString() string { - return s.String() -} - -// SetNetworkSites sets the NetworkSites field's value. -func (s *ListNetworkSitesOutput) SetNetworkSites(v []*NetworkSite) *ListNetworkSitesOutput { - s.NetworkSites = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListNetworkSitesOutput) SetNextToken(v string) *ListNetworkSitesOutput { - s.NextToken = &v - return s -} - -type ListNetworksInput struct { - _ struct{} `type:"structure"` - - // The filters. - // - // * STATUS - The status (AVAILABLE | CREATED | DELETED | DEPROVISIONING - // | PROVISIONING). - // - // Filter values are case sensitive. If you specify multiple values for a filter, - // the values are joined with an OR, and the request returns all results that - // match any of the specified values. - Filters map[string][]*string `locationName:"filters" type:"map"` - - // The maximum number of results to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next page of results. - StartToken *string `locationName:"startToken" 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 ListNetworksInput) 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 ListNetworksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListNetworksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListNetworksInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListNetworksInput) SetFilters(v map[string][]*string) *ListNetworksInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListNetworksInput) SetMaxResults(v int64) *ListNetworksInput { - s.MaxResults = &v - return s -} - -// SetStartToken sets the StartToken field's value. -func (s *ListNetworksInput) SetStartToken(v string) *ListNetworksInput { - s.StartToken = &v - return s -} - -type ListNetworksOutput struct { - _ struct{} `type:"structure"` - - // The networks. - Networks []*Network `locationName:"networks" type:"list"` - - // The token for the next page of results. - NextToken *string `locationName:"nextToken" 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 ListNetworksOutput) 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 ListNetworksOutput) GoString() string { - return s.String() -} - -// SetNetworks sets the Networks field's value. -func (s *ListNetworksOutput) SetNetworks(v []*Network) *ListNetworksOutput { - s.Networks = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListNetworksOutput) SetNextToken(v string) *ListNetworksOutput { - s.NextToken = &v - return s -} - -type ListOrdersInput struct { - _ struct{} `type:"structure"` - - // The filters. - // - // * NETWORK_SITE - The Amazon Resource Name (ARN) of the network site. - // - // * STATUS - The status (ACKNOWLEDGING | ACKNOWLEDGED | UNACKNOWLEDGED). - // - // Filter values are case sensitive. If you specify multiple values for a filter, - // the values are joined with an OR, and the request returns all results that - // match any of the specified values. - Filters map[string][]*string `locationName:"filters" type:"map"` - - // The maximum number of results to return. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the network. - // - // NetworkArn is a required field - NetworkArn *string `locationName:"networkArn" type:"string" required:"true"` - - // The token for the next page of results. - StartToken *string `locationName:"startToken" 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 ListOrdersInput) 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 ListOrdersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListOrdersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOrdersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NetworkArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListOrdersInput) SetFilters(v map[string][]*string) *ListOrdersInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListOrdersInput) SetMaxResults(v int64) *ListOrdersInput { - s.MaxResults = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *ListOrdersInput) SetNetworkArn(v string) *ListOrdersInput { - s.NetworkArn = &v - return s -} - -// SetStartToken sets the StartToken field's value. -func (s *ListOrdersInput) SetStartToken(v string) *ListOrdersInput { - s.StartToken = &v - return s -} - -type ListOrdersOutput struct { - _ struct{} `type:"structure"` - - // The token for the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` - - // Information about the orders. - Orders []*Order `locationName:"orders" type:"list"` -} - -// 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 ListOrdersOutput) 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 ListOrdersOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrdersOutput) SetNextToken(v string) *ListOrdersOutput { - s.NextToken = &v - return s -} - -// SetOrders sets the Orders field's value. -func (s *ListOrdersOutput) SetOrders(v []*Order) *ListOrdersOutput { - s.Orders = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The resource tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListTagsForResourceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Information about a name/value pair. -type NameValuePair struct { - _ struct{} `type:"structure"` - - // The name of the pair. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The value of the pair. - Value *string `locationName:"value" 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 NameValuePair) 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 NameValuePair) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NameValuePair) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NameValuePair"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *NameValuePair) SetName(v string) *NameValuePair { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *NameValuePair) SetValue(v string) *NameValuePair { - s.Value = &v - return s -} - -// Information about a network. -type Network struct { - _ struct{} `type:"structure"` - - // The creation time of the network. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The description of the network. - Description *string `locationName:"description" type:"string"` - - // The Amazon Resource Name (ARN) of the network. - // - // NetworkArn is a required field - NetworkArn *string `locationName:"networkArn" type:"string" required:"true"` - - // The name of the network. - // - // NetworkName is a required field - NetworkName *string `locationName:"networkName" min:"1" type:"string" required:"true"` - - // The status of the network. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"NetworkStatus"` - - // The status reason of the network. - StatusReason *string `locationName:"statusReason" 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 Network) 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 Network) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Network) SetCreatedAt(v time.Time) *Network { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Network) SetDescription(v string) *Network { - s.Description = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *Network) SetNetworkArn(v string) *Network { - s.NetworkArn = &v - return s -} - -// SetNetworkName sets the NetworkName field's value. -func (s *Network) SetNetworkName(v string) *Network { - s.NetworkName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Network) SetStatus(v string) *Network { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *Network) SetStatusReason(v string) *Network { - s.StatusReason = &v - return s -} - -// Information about a network resource. -type NetworkResource struct { - _ struct{} `type:"structure"` - - // The attributes of the network resource. - Attributes []*NameValuePair `locationName:"attributes" type:"list"` - - // Information about the commitment period for the radio unit. Shows the duration, - // the date and time that the contract started and ends, and the renewal status - // of the commitment period. - CommitmentInformation *CommitmentInformation `locationName:"commitmentInformation" type:"structure"` - - // The creation time of the network resource. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The description of the network resource. - Description *string `locationName:"description" type:"string"` - - // The health of the network resource. - Health *string `locationName:"health" type:"string" enum:"HealthStatus"` - - // The model of the network resource. - Model *string `locationName:"model" type:"string"` - - // The Amazon Resource Name (ARN) of the network on which this network resource - // appears. - NetworkArn *string `locationName:"networkArn" type:"string"` - - // The Amazon Resource Name (ARN) of the network resource. - NetworkResourceArn *string `locationName:"networkResourceArn" type:"string"` - - // The Amazon Resource Name (ARN) of the network site on which this network - // resource appears. - NetworkSiteArn *string `locationName:"networkSiteArn" type:"string"` - - // The Amazon Resource Name (ARN) of the order used to purchase this network - // resource. - OrderArn *string `locationName:"orderArn" type:"string"` - - // The position of the network resource. - Position *Position `locationName:"position" type:"structure"` - - // Information about a request to return the network resource. - ReturnInformation *ReturnInformation `locationName:"returnInformation" type:"structure"` - - // The serial number of the network resource. - SerialNumber *string `locationName:"serialNumber" type:"string"` - - // The status of the network resource. - Status *string `locationName:"status" type:"string" enum:"NetworkResourceStatus"` - - // The status reason of the network resource. - StatusReason *string `locationName:"statusReason" type:"string"` - - // The type of the network resource. - Type *string `locationName:"type" type:"string" enum:"NetworkResourceType"` - - // The vendor of the network resource. - Vendor *string `locationName:"vendor" 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 NetworkResource) 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 NetworkResource) GoString() string { - return s.String() -} - -// SetAttributes sets the Attributes field's value. -func (s *NetworkResource) SetAttributes(v []*NameValuePair) *NetworkResource { - s.Attributes = v - return s -} - -// SetCommitmentInformation sets the CommitmentInformation field's value. -func (s *NetworkResource) SetCommitmentInformation(v *CommitmentInformation) *NetworkResource { - s.CommitmentInformation = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *NetworkResource) SetCreatedAt(v time.Time) *NetworkResource { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *NetworkResource) SetDescription(v string) *NetworkResource { - s.Description = &v - return s -} - -// SetHealth sets the Health field's value. -func (s *NetworkResource) SetHealth(v string) *NetworkResource { - s.Health = &v - return s -} - -// SetModel sets the Model field's value. -func (s *NetworkResource) SetModel(v string) *NetworkResource { - s.Model = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *NetworkResource) SetNetworkArn(v string) *NetworkResource { - s.NetworkArn = &v - return s -} - -// SetNetworkResourceArn sets the NetworkResourceArn field's value. -func (s *NetworkResource) SetNetworkResourceArn(v string) *NetworkResource { - s.NetworkResourceArn = &v - return s -} - -// SetNetworkSiteArn sets the NetworkSiteArn field's value. -func (s *NetworkResource) SetNetworkSiteArn(v string) *NetworkResource { - s.NetworkSiteArn = &v - return s -} - -// SetOrderArn sets the OrderArn field's value. -func (s *NetworkResource) SetOrderArn(v string) *NetworkResource { - s.OrderArn = &v - return s -} - -// SetPosition sets the Position field's value. -func (s *NetworkResource) SetPosition(v *Position) *NetworkResource { - s.Position = v - return s -} - -// SetReturnInformation sets the ReturnInformation field's value. -func (s *NetworkResource) SetReturnInformation(v *ReturnInformation) *NetworkResource { - s.ReturnInformation = v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *NetworkResource) SetSerialNumber(v string) *NetworkResource { - s.SerialNumber = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *NetworkResource) SetStatus(v string) *NetworkResource { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *NetworkResource) SetStatusReason(v string) *NetworkResource { - s.StatusReason = &v - return s -} - -// SetType sets the Type field's value. -func (s *NetworkResource) SetType(v string) *NetworkResource { - s.Type = &v - return s -} - -// SetVendor sets the Vendor field's value. -func (s *NetworkResource) SetVendor(v string) *NetworkResource { - s.Vendor = &v - return s -} - -// Information about a network resource definition. -type NetworkResourceDefinition struct { - _ struct{} `type:"structure"` - - // The count in the network resource definition. - // - // Count is a required field - Count *int64 `locationName:"count" type:"integer" required:"true"` - - // The options in the network resource definition. - Options []*NameValuePair `locationName:"options" type:"list"` - - // The type in the network resource definition. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"NetworkResourceDefinitionType"` -} - -// 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 NetworkResourceDefinition) 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 NetworkResourceDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NetworkResourceDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NetworkResourceDefinition"} - if s.Count == nil { - invalidParams.Add(request.NewErrParamRequired("Count")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Options != nil { - for i, v := range s.Options { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Options", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCount sets the Count field's value. -func (s *NetworkResourceDefinition) SetCount(v int64) *NetworkResourceDefinition { - s.Count = &v - return s -} - -// SetOptions sets the Options field's value. -func (s *NetworkResourceDefinition) SetOptions(v []*NameValuePair) *NetworkResourceDefinition { - s.Options = v - return s -} - -// SetType sets the Type field's value. -func (s *NetworkResourceDefinition) SetType(v string) *NetworkResourceDefinition { - s.Type = &v - return s -} - -// Information about a network site. -type NetworkSite struct { - _ struct{} `type:"structure"` - - // The parent Availability Zone for the network site. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The parent Availability Zone ID for the network site. - AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"` - - // The creation time of the network site. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The current plan of the network site. - CurrentPlan *SitePlan `locationName:"currentPlan" type:"structure"` - - // The description of the network site. - Description *string `locationName:"description" type:"string"` - - // The Amazon Resource Name (ARN) of the network to which the network site belongs. - // - // NetworkArn is a required field - NetworkArn *string `locationName:"networkArn" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the network site. - // - // NetworkSiteArn is a required field - NetworkSiteArn *string `locationName:"networkSiteArn" type:"string" required:"true"` - - // The name of the network site. - // - // NetworkSiteName is a required field - NetworkSiteName *string `locationName:"networkSiteName" min:"1" type:"string" required:"true"` - - // The pending plan of the network site. - PendingPlan *SitePlan `locationName:"pendingPlan" type:"structure"` - - // The status of the network site. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"NetworkSiteStatus"` - - // The status reason of the network site. - StatusReason *string `locationName:"statusReason" 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 NetworkSite) 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 NetworkSite) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *NetworkSite) SetAvailabilityZone(v string) *NetworkSite { - s.AvailabilityZone = &v - return s -} - -// SetAvailabilityZoneId sets the AvailabilityZoneId field's value. -func (s *NetworkSite) SetAvailabilityZoneId(v string) *NetworkSite { - s.AvailabilityZoneId = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *NetworkSite) SetCreatedAt(v time.Time) *NetworkSite { - s.CreatedAt = &v - return s -} - -// SetCurrentPlan sets the CurrentPlan field's value. -func (s *NetworkSite) SetCurrentPlan(v *SitePlan) *NetworkSite { - s.CurrentPlan = v - return s -} - -// SetDescription sets the Description field's value. -func (s *NetworkSite) SetDescription(v string) *NetworkSite { - s.Description = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *NetworkSite) SetNetworkArn(v string) *NetworkSite { - s.NetworkArn = &v - return s -} - -// SetNetworkSiteArn sets the NetworkSiteArn field's value. -func (s *NetworkSite) SetNetworkSiteArn(v string) *NetworkSite { - s.NetworkSiteArn = &v - return s -} - -// SetNetworkSiteName sets the NetworkSiteName field's value. -func (s *NetworkSite) SetNetworkSiteName(v string) *NetworkSite { - s.NetworkSiteName = &v - return s -} - -// SetPendingPlan sets the PendingPlan field's value. -func (s *NetworkSite) SetPendingPlan(v *SitePlan) *NetworkSite { - s.PendingPlan = v - return s -} - -// SetStatus sets the Status field's value. -func (s *NetworkSite) SetStatus(v string) *NetworkSite { - s.Status = &v - return s -} - -// SetStatusReason sets the StatusReason field's value. -func (s *NetworkSite) SetStatusReason(v string) *NetworkSite { - s.StatusReason = &v - return s -} - -// Information about an order. -type Order struct { - _ struct{} `type:"structure"` - - // The acknowledgement status of the order. - AcknowledgmentStatus *string `locationName:"acknowledgmentStatus" type:"string" enum:"AcknowledgmentStatus"` - - // The creation time of the order. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Resource Name (ARN) of the network associated with this order. - NetworkArn *string `locationName:"networkArn" type:"string"` - - // The Amazon Resource Name (ARN) of the network site associated with this order. - NetworkSiteArn *string `locationName:"networkSiteArn" type:"string"` - - // The Amazon Resource Name (ARN) of the order. - OrderArn *string `locationName:"orderArn" type:"string"` - - // A list of the network resources placed in the order. - OrderedResources []*OrderedResourceDefinition `locationName:"orderedResources" type:"list"` - - // The shipping address of the order. - ShippingAddress *Address `locationName:"shippingAddress" type:"structure"` - - // The tracking information of the order. - TrackingInformation []*TrackingInformation `locationName:"trackingInformation" type:"list"` -} - -// 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 Order) 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 Order) GoString() string { - return s.String() -} - -// SetAcknowledgmentStatus sets the AcknowledgmentStatus field's value. -func (s *Order) SetAcknowledgmentStatus(v string) *Order { - s.AcknowledgmentStatus = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Order) SetCreatedAt(v time.Time) *Order { - s.CreatedAt = &v - return s -} - -// SetNetworkArn sets the NetworkArn field's value. -func (s *Order) SetNetworkArn(v string) *Order { - s.NetworkArn = &v - return s -} - -// SetNetworkSiteArn sets the NetworkSiteArn field's value. -func (s *Order) SetNetworkSiteArn(v string) *Order { - s.NetworkSiteArn = &v - return s -} - -// SetOrderArn sets the OrderArn field's value. -func (s *Order) SetOrderArn(v string) *Order { - s.OrderArn = &v - return s -} - -// SetOrderedResources sets the OrderedResources field's value. -func (s *Order) SetOrderedResources(v []*OrderedResourceDefinition) *Order { - s.OrderedResources = v - return s -} - -// SetShippingAddress sets the ShippingAddress field's value. -func (s *Order) SetShippingAddress(v *Address) *Order { - s.ShippingAddress = v - return s -} - -// SetTrackingInformation sets the TrackingInformation field's value. -func (s *Order) SetTrackingInformation(v []*TrackingInformation) *Order { - s.TrackingInformation = v - return s -} - -// Details of the network resources in the order. -type OrderedResourceDefinition struct { - _ struct{} `type:"structure"` - - // The duration and renewal status of the commitment period for each radio unit - // in the order. Does not show details if the resource type is DEVICE_IDENTIFIER. - CommitmentConfiguration *CommitmentConfiguration `locationName:"commitmentConfiguration" type:"structure"` - - // The number of network resources in the order. - // - // Count is a required field - Count *int64 `locationName:"count" type:"integer" required:"true"` - - // The type of network resource in the order. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"NetworkResourceDefinitionType"` -} - -// 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 OrderedResourceDefinition) 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 OrderedResourceDefinition) GoString() string { - return s.String() -} - -// SetCommitmentConfiguration sets the CommitmentConfiguration field's value. -func (s *OrderedResourceDefinition) SetCommitmentConfiguration(v *CommitmentConfiguration) *OrderedResourceDefinition { - s.CommitmentConfiguration = v - return s -} - -// SetCount sets the Count field's value. -func (s *OrderedResourceDefinition) SetCount(v int64) *OrderedResourceDefinition { - s.Count = &v - return s -} - -// SetType sets the Type field's value. -func (s *OrderedResourceDefinition) SetType(v string) *OrderedResourceDefinition { - s.Type = &v - return s -} - -type PingInput struct { - _ struct{} `type:"structure" nopayload:"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 PingInput) 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 PingInput) GoString() string { - return s.String() -} - -type PingOutput struct { - _ struct{} `type:"structure"` - - // Information about the health of the service. - Status *string `locationName:"status" 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 PingOutput) 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 PingOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *PingOutput) SetStatus(v string) *PingOutput { - s.Status = &v - return s -} - -// Information about a position. -type Position struct { - _ struct{} `type:"structure"` - - // The elevation of the equipment at this position. - Elevation *float64 `locationName:"elevation" type:"double"` - - // The reference point from which elevation is reported. - ElevationReference *string `locationName:"elevationReference" type:"string" enum:"ElevationReference"` - - // The units used to measure the elevation of the position. - ElevationUnit *string `locationName:"elevationUnit" type:"string" enum:"ElevationUnit"` - - // The latitude of the position. - Latitude *float64 `locationName:"latitude" type:"double"` - - // The longitude of the position. - Longitude *float64 `locationName:"longitude" type:"double"` -} - -// 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 Position) 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 Position) GoString() string { - return s.String() -} - -// SetElevation sets the Elevation field's value. -func (s *Position) SetElevation(v float64) *Position { - s.Elevation = &v - return s -} - -// SetElevationReference sets the ElevationReference field's value. -func (s *Position) SetElevationReference(v string) *Position { - s.ElevationReference = &v - return s -} - -// SetElevationUnit sets the ElevationUnit field's value. -func (s *Position) SetElevationUnit(v string) *Position { - s.ElevationUnit = &v - return s -} - -// SetLatitude sets the Latitude field's value. -func (s *Position) SetLatitude(v float64) *Position { - s.Latitude = &v - return s -} - -// SetLongitude sets the Longitude field's value. -func (s *Position) SetLongitude(v float64) *Position { - s.Longitude = &v - return s -} - -// The resource was not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // Identifier of the affected resource. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // Type of the affected resource. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about a request to return a network resource. -type ReturnInformation struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the replacement order. - ReplacementOrderArn *string `locationName:"replacementOrderArn" type:"string"` - - // The reason for the return. If the return request did not include a reason - // for the return, this value is null. - ReturnReason *string `locationName:"returnReason" type:"string"` - - // The shipping address. - ShippingAddress *Address `locationName:"shippingAddress" type:"structure"` - - // The URL of the shipping label. The shipping label is available for download - // only if the status of the network resource is PENDING_RETURN. For more information, - // see Return a radio unit (https://docs.aws.amazon.com/private-networks/latest/userguide/radio-units.html#return-radio-unit). - ShippingLabel *string `locationName:"shippingLabel" 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 ReturnInformation) 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 ReturnInformation) GoString() string { - return s.String() -} - -// SetReplacementOrderArn sets the ReplacementOrderArn field's value. -func (s *ReturnInformation) SetReplacementOrderArn(v string) *ReturnInformation { - s.ReplacementOrderArn = &v - return s -} - -// SetReturnReason sets the ReturnReason field's value. -func (s *ReturnInformation) SetReturnReason(v string) *ReturnInformation { - s.ReturnReason = &v - return s -} - -// SetShippingAddress sets the ShippingAddress field's value. -func (s *ReturnInformation) SetShippingAddress(v *Address) *ReturnInformation { - s.ShippingAddress = v - return s -} - -// SetShippingLabel sets the ShippingLabel field's value. -func (s *ReturnInformation) SetShippingLabel(v string) *ReturnInformation { - s.ShippingLabel = &v - return s -} - -// Information about a site plan. -type SitePlan struct { - _ struct{} `type:"structure"` - - // The options of the plan. - Options []*NameValuePair `locationName:"options" type:"list"` - - // The resource definitions of the plan. - ResourceDefinitions []*NetworkResourceDefinition `locationName:"resourceDefinitions" type:"list"` -} - -// 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 SitePlan) 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 SitePlan) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SitePlan) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SitePlan"} - if s.Options != nil { - for i, v := range s.Options { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Options", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ResourceDefinitions != nil { - for i, v := range s.ResourceDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOptions sets the Options field's value. -func (s *SitePlan) SetOptions(v []*NameValuePair) *SitePlan { - s.Options = v - return s -} - -// SetResourceDefinitions sets the ResourceDefinitions field's value. -func (s *SitePlan) SetResourceDefinitions(v []*NetworkResourceDefinition) *SitePlan { - s.ResourceDefinitions = v - return s -} - -type StartNetworkResourceUpdateInput struct { - _ struct{} `type:"structure"` - - // Use this action to extend and automatically renew the commitment period for - // the radio unit. You can do the following: - // - // * Change a 60-day commitment to a 1-year or 3-year commitment. The change - // is immediate and the hourly rate decreases to the rate for the new commitment - // period. - // - // * Change a 1-year commitment to a 3-year commitment. The change is immediate - // and the hourly rate decreases to the rate for the 3-year commitment period. - // - // * Set a 1-year commitment to automatically renew for an additional 1 year. - // The hourly rate for the additional year will continue to be the same as - // your existing 1-year rate. - // - // * Set a 3-year commitment to automatically renew for an additional 1 year. - // The hourly rate for the additional year will continue to be the same as - // your existing 3-year rate. - // - // * Turn off a previously-enabled automatic renewal on a 1-year or 3-year - // commitment. You cannot use the automatic-renewal option for a 60-day commitment. - // - // For pricing, see Amazon Web Services Private 5G Pricing (http://aws.amazon.com/private5g/pricing). - CommitmentConfiguration *CommitmentConfiguration `locationName:"commitmentConfiguration" type:"structure"` - - // The Amazon Resource Name (ARN) of the network resource. - // - // NetworkResourceArn is a required field - NetworkResourceArn *string `locationName:"networkResourceArn" type:"string" required:"true"` - - // The reason for the return. Providing a reason for a return is optional. - ReturnReason *string `locationName:"returnReason" type:"string"` - - // The shipping address. If you don't provide a shipping address when replacing - // or returning a network resource, we use the address from the original order - // for the network resource. - ShippingAddress *Address `locationName:"shippingAddress" type:"structure"` - - // The update type. - // - // * REPLACE - Submits a request to replace a defective radio unit. We provide - // a shipping label that you can use for the return process and we ship a - // replacement radio unit to you. - // - // * RETURN - Submits a request to return a radio unit that you no longer - // need. We provide a shipping label that you can use for the return process. - // - // * COMMITMENT - Submits a request to change or renew the commitment period. - // If you choose this value, then you must set commitmentConfiguration (https://docs.aws.amazon.com/private-networks/latest/APIReference/API_StartNetworkResourceUpdate.html#privatenetworks-StartNetworkResourceUpdate-request-commitmentConfiguration). - // - // UpdateType is a required field - UpdateType *string `locationName:"updateType" type:"string" required:"true" enum:"UpdateType"` -} - -// 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 StartNetworkResourceUpdateInput) 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 StartNetworkResourceUpdateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartNetworkResourceUpdateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartNetworkResourceUpdateInput"} - if s.NetworkResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkResourceArn")) - } - if s.UpdateType == nil { - invalidParams.Add(request.NewErrParamRequired("UpdateType")) - } - if s.CommitmentConfiguration != nil { - if err := s.CommitmentConfiguration.Validate(); err != nil { - invalidParams.AddNested("CommitmentConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ShippingAddress != nil { - if err := s.ShippingAddress.Validate(); err != nil { - invalidParams.AddNested("ShippingAddress", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCommitmentConfiguration sets the CommitmentConfiguration field's value. -func (s *StartNetworkResourceUpdateInput) SetCommitmentConfiguration(v *CommitmentConfiguration) *StartNetworkResourceUpdateInput { - s.CommitmentConfiguration = v - return s -} - -// SetNetworkResourceArn sets the NetworkResourceArn field's value. -func (s *StartNetworkResourceUpdateInput) SetNetworkResourceArn(v string) *StartNetworkResourceUpdateInput { - s.NetworkResourceArn = &v - return s -} - -// SetReturnReason sets the ReturnReason field's value. -func (s *StartNetworkResourceUpdateInput) SetReturnReason(v string) *StartNetworkResourceUpdateInput { - s.ReturnReason = &v - return s -} - -// SetShippingAddress sets the ShippingAddress field's value. -func (s *StartNetworkResourceUpdateInput) SetShippingAddress(v *Address) *StartNetworkResourceUpdateInput { - s.ShippingAddress = v - return s -} - -// SetUpdateType sets the UpdateType field's value. -func (s *StartNetworkResourceUpdateInput) SetUpdateType(v string) *StartNetworkResourceUpdateInput { - s.UpdateType = &v - return s -} - -type StartNetworkResourceUpdateOutput struct { - _ struct{} `type:"structure"` - - // The network resource. - NetworkResource *NetworkResource `locationName:"networkResource" 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 StartNetworkResourceUpdateOutput) 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 StartNetworkResourceUpdateOutput) GoString() string { - return s.String() -} - -// SetNetworkResource sets the NetworkResource field's value. -func (s *StartNetworkResourceUpdateOutput) SetNetworkResource(v *NetworkResource) *StartNetworkResourceUpdateOutput { - s.NetworkResource = v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tags to add to the resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TagResourceInput's - // String and GoString methods. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" min:"1" type:"map" required:"true" sensitive:"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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about tracking a shipment. -type TrackingInformation struct { - _ struct{} `type:"structure"` - - // The tracking number of the shipment. - TrackingNumber *string `locationName:"trackingNumber" 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 TrackingInformation) 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 TrackingInformation) GoString() string { - return s.String() -} - -// SetTrackingNumber sets the TrackingNumber field's value. -func (s *TrackingInformation) SetTrackingNumber(v string) *TrackingInformation { - s.TrackingNumber = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tag keys. - // - // TagKeys is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UntagResourceInput's - // String and GoString methods. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" type:"list" required:"true" sensitive:"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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateNetworkSiteInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The description. - Description *string `locationName:"description" type:"string"` - - // The Amazon Resource Name (ARN) of the network site. - // - // NetworkSiteArn is a required field - NetworkSiteArn *string `locationName:"networkSiteArn" 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 UpdateNetworkSiteInput) 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 UpdateNetworkSiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateNetworkSiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateNetworkSiteInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.NetworkSiteArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkSiteArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateNetworkSiteInput) SetClientToken(v string) *UpdateNetworkSiteInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateNetworkSiteInput) SetDescription(v string) *UpdateNetworkSiteInput { - s.Description = &v - return s -} - -// SetNetworkSiteArn sets the NetworkSiteArn field's value. -func (s *UpdateNetworkSiteInput) SetNetworkSiteArn(v string) *UpdateNetworkSiteInput { - s.NetworkSiteArn = &v - return s -} - -type UpdateNetworkSiteOutput struct { - _ struct{} `type:"structure"` - - // Information about the network site. - NetworkSite *NetworkSite `locationName:"networkSite" type:"structure"` - - // The network site tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateNetworkSiteOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 UpdateNetworkSiteOutput) 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 UpdateNetworkSiteOutput) GoString() string { - return s.String() -} - -// SetNetworkSite sets the NetworkSite field's value. -func (s *UpdateNetworkSiteOutput) SetNetworkSite(v *NetworkSite) *UpdateNetworkSiteOutput { - s.NetworkSite = v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateNetworkSiteOutput) SetTags(v map[string]*string) *UpdateNetworkSiteOutput { - s.Tags = v - return s -} - -type UpdateNetworkSitePlanInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to ensure idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the network site. - // - // NetworkSiteArn is a required field - NetworkSiteArn *string `locationName:"networkSiteArn" type:"string" required:"true"` - - // The pending plan. - // - // PendingPlan is a required field - PendingPlan *SitePlan `locationName:"pendingPlan" type:"structure" 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 UpdateNetworkSitePlanInput) 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 UpdateNetworkSitePlanInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateNetworkSitePlanInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateNetworkSitePlanInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.NetworkSiteArn == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkSiteArn")) - } - if s.PendingPlan == nil { - invalidParams.Add(request.NewErrParamRequired("PendingPlan")) - } - if s.PendingPlan != nil { - if err := s.PendingPlan.Validate(); err != nil { - invalidParams.AddNested("PendingPlan", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateNetworkSitePlanInput) SetClientToken(v string) *UpdateNetworkSitePlanInput { - s.ClientToken = &v - return s -} - -// SetNetworkSiteArn sets the NetworkSiteArn field's value. -func (s *UpdateNetworkSitePlanInput) SetNetworkSiteArn(v string) *UpdateNetworkSitePlanInput { - s.NetworkSiteArn = &v - return s -} - -// SetPendingPlan sets the PendingPlan field's value. -func (s *UpdateNetworkSitePlanInput) SetPendingPlan(v *SitePlan) *UpdateNetworkSitePlanInput { - s.PendingPlan = v - return s -} - -type UpdateNetworkSitePlanOutput struct { - _ struct{} `type:"structure"` - - // Information about the network site. - NetworkSite *NetworkSite `locationName:"networkSite" type:"structure"` - - // The network site tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateNetworkSitePlanOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" min:"1" type:"map" sensitive:"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 UpdateNetworkSitePlanOutput) 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 UpdateNetworkSitePlanOutput) GoString() string { - return s.String() -} - -// SetNetworkSite sets the NetworkSite field's value. -func (s *UpdateNetworkSitePlanOutput) SetNetworkSite(v *NetworkSite) *UpdateNetworkSitePlanOutput { - s.NetworkSite = v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateNetworkSitePlanOutput) SetTags(v map[string]*string) *UpdateNetworkSitePlanOutput { - s.Tags = v - return s -} - -// The request failed validation. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The list of fields that caused the error, if applicable. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - // Description of the error. - Message_ *string `locationName:"message" type:"string"` - - // Reason the request failed validation. - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about a field that failed validation. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // The message about the validation failure. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The field name that failed validation. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // AcknowledgmentStatusAcknowledging is a AcknowledgmentStatus enum value - AcknowledgmentStatusAcknowledging = "ACKNOWLEDGING" - - // AcknowledgmentStatusAcknowledged is a AcknowledgmentStatus enum value - AcknowledgmentStatusAcknowledged = "ACKNOWLEDGED" - - // AcknowledgmentStatusUnacknowledged is a AcknowledgmentStatus enum value - AcknowledgmentStatusUnacknowledged = "UNACKNOWLEDGED" -) - -// AcknowledgmentStatus_Values returns all elements of the AcknowledgmentStatus enum -func AcknowledgmentStatus_Values() []string { - return []string{ - AcknowledgmentStatusAcknowledging, - AcknowledgmentStatusAcknowledged, - AcknowledgmentStatusUnacknowledged, - } -} - -const ( - // CommitmentLengthSixtyDays is a CommitmentLength enum value - CommitmentLengthSixtyDays = "SIXTY_DAYS" - - // CommitmentLengthOneYear is a CommitmentLength enum value - CommitmentLengthOneYear = "ONE_YEAR" - - // CommitmentLengthThreeYears is a CommitmentLength enum value - CommitmentLengthThreeYears = "THREE_YEARS" -) - -// CommitmentLength_Values returns all elements of the CommitmentLength enum -func CommitmentLength_Values() []string { - return []string{ - CommitmentLengthSixtyDays, - CommitmentLengthOneYear, - CommitmentLengthThreeYears, - } -} - -const ( - // DeviceIdentifierFilterKeysStatus is a DeviceIdentifierFilterKeys enum value - DeviceIdentifierFilterKeysStatus = "STATUS" - - // DeviceIdentifierFilterKeysOrder is a DeviceIdentifierFilterKeys enum value - DeviceIdentifierFilterKeysOrder = "ORDER" - - // DeviceIdentifierFilterKeysTrafficGroup is a DeviceIdentifierFilterKeys enum value - DeviceIdentifierFilterKeysTrafficGroup = "TRAFFIC_GROUP" -) - -// DeviceIdentifierFilterKeys_Values returns all elements of the DeviceIdentifierFilterKeys enum -func DeviceIdentifierFilterKeys_Values() []string { - return []string{ - DeviceIdentifierFilterKeysStatus, - DeviceIdentifierFilterKeysOrder, - DeviceIdentifierFilterKeysTrafficGroup, - } -} - -const ( - // DeviceIdentifierStatusActive is a DeviceIdentifierStatus enum value - DeviceIdentifierStatusActive = "ACTIVE" - - // DeviceIdentifierStatusInactive is a DeviceIdentifierStatus enum value - DeviceIdentifierStatusInactive = "INACTIVE" -) - -// DeviceIdentifierStatus_Values returns all elements of the DeviceIdentifierStatus enum -func DeviceIdentifierStatus_Values() []string { - return []string{ - DeviceIdentifierStatusActive, - DeviceIdentifierStatusInactive, - } -} - -const ( - // ElevationReferenceAgl is a ElevationReference enum value - ElevationReferenceAgl = "AGL" - - // ElevationReferenceAmsl is a ElevationReference enum value - ElevationReferenceAmsl = "AMSL" -) - -// ElevationReference_Values returns all elements of the ElevationReference enum -func ElevationReference_Values() []string { - return []string{ - ElevationReferenceAgl, - ElevationReferenceAmsl, - } -} - -const ( - // ElevationUnitFeet is a ElevationUnit enum value - ElevationUnitFeet = "FEET" -) - -// ElevationUnit_Values returns all elements of the ElevationUnit enum -func ElevationUnit_Values() []string { - return []string{ - ElevationUnitFeet, - } -} - -const ( - // HealthStatusInitial is a HealthStatus enum value - HealthStatusInitial = "INITIAL" - - // HealthStatusHealthy is a HealthStatus enum value - HealthStatusHealthy = "HEALTHY" - - // HealthStatusUnhealthy is a HealthStatus enum value - HealthStatusUnhealthy = "UNHEALTHY" -) - -// HealthStatus_Values returns all elements of the HealthStatus enum -func HealthStatus_Values() []string { - return []string{ - HealthStatusInitial, - HealthStatusHealthy, - HealthStatusUnhealthy, - } -} - -const ( - // NetworkFilterKeysStatus is a NetworkFilterKeys enum value - NetworkFilterKeysStatus = "STATUS" -) - -// NetworkFilterKeys_Values returns all elements of the NetworkFilterKeys enum -func NetworkFilterKeys_Values() []string { - return []string{ - NetworkFilterKeysStatus, - } -} - -const ( - // NetworkResourceDefinitionTypeRadioUnit is a NetworkResourceDefinitionType enum value - NetworkResourceDefinitionTypeRadioUnit = "RADIO_UNIT" - - // NetworkResourceDefinitionTypeDeviceIdentifier is a NetworkResourceDefinitionType enum value - NetworkResourceDefinitionTypeDeviceIdentifier = "DEVICE_IDENTIFIER" -) - -// NetworkResourceDefinitionType_Values returns all elements of the NetworkResourceDefinitionType enum -func NetworkResourceDefinitionType_Values() []string { - return []string{ - NetworkResourceDefinitionTypeRadioUnit, - NetworkResourceDefinitionTypeDeviceIdentifier, - } -} - -const ( - // NetworkResourceFilterKeysOrder is a NetworkResourceFilterKeys enum value - NetworkResourceFilterKeysOrder = "ORDER" - - // NetworkResourceFilterKeysStatus is a NetworkResourceFilterKeys enum value - NetworkResourceFilterKeysStatus = "STATUS" -) - -// NetworkResourceFilterKeys_Values returns all elements of the NetworkResourceFilterKeys enum -func NetworkResourceFilterKeys_Values() []string { - return []string{ - NetworkResourceFilterKeysOrder, - NetworkResourceFilterKeysStatus, - } -} - -const ( - // NetworkResourceStatusPending is a NetworkResourceStatus enum value - NetworkResourceStatusPending = "PENDING" - - // NetworkResourceStatusShipped is a NetworkResourceStatus enum value - NetworkResourceStatusShipped = "SHIPPED" - - // NetworkResourceStatusProvisioning is a NetworkResourceStatus enum value - NetworkResourceStatusProvisioning = "PROVISIONING" - - // NetworkResourceStatusProvisioned is a NetworkResourceStatus enum value - NetworkResourceStatusProvisioned = "PROVISIONED" - - // NetworkResourceStatusAvailable is a NetworkResourceStatus enum value - NetworkResourceStatusAvailable = "AVAILABLE" - - // NetworkResourceStatusDeleting is a NetworkResourceStatus enum value - NetworkResourceStatusDeleting = "DELETING" - - // NetworkResourceStatusPendingReturn is a NetworkResourceStatus enum value - NetworkResourceStatusPendingReturn = "PENDING_RETURN" - - // NetworkResourceStatusDeleted is a NetworkResourceStatus enum value - NetworkResourceStatusDeleted = "DELETED" - - // NetworkResourceStatusCreatingShippingLabel is a NetworkResourceStatus enum value - NetworkResourceStatusCreatingShippingLabel = "CREATING_SHIPPING_LABEL" -) - -// NetworkResourceStatus_Values returns all elements of the NetworkResourceStatus enum -func NetworkResourceStatus_Values() []string { - return []string{ - NetworkResourceStatusPending, - NetworkResourceStatusShipped, - NetworkResourceStatusProvisioning, - NetworkResourceStatusProvisioned, - NetworkResourceStatusAvailable, - NetworkResourceStatusDeleting, - NetworkResourceStatusPendingReturn, - NetworkResourceStatusDeleted, - NetworkResourceStatusCreatingShippingLabel, - } -} - -const ( - // NetworkResourceTypeRadioUnit is a NetworkResourceType enum value - NetworkResourceTypeRadioUnit = "RADIO_UNIT" -) - -// NetworkResourceType_Values returns all elements of the NetworkResourceType enum -func NetworkResourceType_Values() []string { - return []string{ - NetworkResourceTypeRadioUnit, - } -} - -const ( - // NetworkSiteFilterKeysStatus is a NetworkSiteFilterKeys enum value - NetworkSiteFilterKeysStatus = "STATUS" -) - -// NetworkSiteFilterKeys_Values returns all elements of the NetworkSiteFilterKeys enum -func NetworkSiteFilterKeys_Values() []string { - return []string{ - NetworkSiteFilterKeysStatus, - } -} - -const ( - // NetworkSiteStatusCreated is a NetworkSiteStatus enum value - NetworkSiteStatusCreated = "CREATED" - - // NetworkSiteStatusProvisioning is a NetworkSiteStatus enum value - NetworkSiteStatusProvisioning = "PROVISIONING" - - // NetworkSiteStatusAvailable is a NetworkSiteStatus enum value - NetworkSiteStatusAvailable = "AVAILABLE" - - // NetworkSiteStatusDeprovisioning is a NetworkSiteStatus enum value - NetworkSiteStatusDeprovisioning = "DEPROVISIONING" - - // NetworkSiteStatusDeleted is a NetworkSiteStatus enum value - NetworkSiteStatusDeleted = "DELETED" -) - -// NetworkSiteStatus_Values returns all elements of the NetworkSiteStatus enum -func NetworkSiteStatus_Values() []string { - return []string{ - NetworkSiteStatusCreated, - NetworkSiteStatusProvisioning, - NetworkSiteStatusAvailable, - NetworkSiteStatusDeprovisioning, - NetworkSiteStatusDeleted, - } -} - -const ( - // NetworkStatusCreated is a NetworkStatus enum value - NetworkStatusCreated = "CREATED" - - // NetworkStatusProvisioning is a NetworkStatus enum value - NetworkStatusProvisioning = "PROVISIONING" - - // NetworkStatusAvailable is a NetworkStatus enum value - NetworkStatusAvailable = "AVAILABLE" - - // NetworkStatusDeprovisioning is a NetworkStatus enum value - NetworkStatusDeprovisioning = "DEPROVISIONING" - - // NetworkStatusDeleted is a NetworkStatus enum value - NetworkStatusDeleted = "DELETED" -) - -// NetworkStatus_Values returns all elements of the NetworkStatus enum -func NetworkStatus_Values() []string { - return []string{ - NetworkStatusCreated, - NetworkStatusProvisioning, - NetworkStatusAvailable, - NetworkStatusDeprovisioning, - NetworkStatusDeleted, - } -} - -const ( - // OrderFilterKeysStatus is a OrderFilterKeys enum value - OrderFilterKeysStatus = "STATUS" - - // OrderFilterKeysNetworkSite is a OrderFilterKeys enum value - OrderFilterKeysNetworkSite = "NETWORK_SITE" -) - -// OrderFilterKeys_Values returns all elements of the OrderFilterKeys enum -func OrderFilterKeys_Values() []string { - return []string{ - OrderFilterKeysStatus, - OrderFilterKeysNetworkSite, - } -} - -const ( - // UpdateTypeReplace is a UpdateType enum value - UpdateTypeReplace = "REPLACE" - - // UpdateTypeReturn is a UpdateType enum value - UpdateTypeReturn = "RETURN" - - // UpdateTypeCommitment is a UpdateType enum value - UpdateTypeCommitment = "COMMITMENT" -) - -// UpdateType_Values returns all elements of the UpdateType enum -func UpdateType_Values() []string { - return []string{ - UpdateTypeReplace, - UpdateTypeReturn, - UpdateTypeCommitment, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "UNKNOWN_OPERATION" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "CANNOT_PARSE" - - // ValidationExceptionReasonCannotAssumeRole is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotAssumeRole = "CANNOT_ASSUME_ROLE" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "FIELD_VALIDATION_FAILED" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "OTHER" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonCannotAssumeRole, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/doc.go deleted file mode 100644 index 73f97914e720..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package privatenetworks provides the client and types for making API -// requests to AWS Private 5G. -// -// Amazon Web Services Private 5G is a managed service that makes it easy to -// deploy, operate, and scale your own private mobile network at your on-premises -// location. Private 5G provides the pre-configured hardware and software for -// mobile networks, helps automate setup, and scales capacity on demand to support -// additional devices as needed. -// -// See https://docs.aws.amazon.com/goto/WebAPI/privatenetworks-2021-12-03 for more information on this service. -// -// See privatenetworks package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/privatenetworks/ -// -// # Using the Client -// -// To contact AWS Private 5G with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Private 5G client PrivateNetworks for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/privatenetworks/#New -package privatenetworks diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/errors.go deleted file mode 100644 index dd4d747b73e1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/errors.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package privatenetworks - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have permission to perform this operation. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Information about an internal error. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeLimitExceededException for service response error code - // "LimitExceededException". - // - // The limit was exceeded. - ErrCodeLimitExceededException = "LimitExceededException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The request failed validation. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "InternalServerException": newErrorInternalServerException, - "LimitExceededException": newErrorLimitExceededException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/privatenetworksiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/privatenetworksiface/interface.go deleted file mode 100644 index 28f23e2537d1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/privatenetworksiface/interface.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package privatenetworksiface provides an interface to enable mocking the AWS Private 5G service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package privatenetworksiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks" -) - -// PrivateNetworksAPI provides an interface to enable mocking the -// privatenetworks.PrivateNetworks service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Private 5G. -// func myFunc(svc privatenetworksiface.PrivateNetworksAPI) bool { -// // Make svc.AcknowledgeOrderReceipt request -// } -// -// func main() { -// sess := session.New() -// svc := privatenetworks.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockPrivateNetworksClient struct { -// privatenetworksiface.PrivateNetworksAPI -// } -// func (m *mockPrivateNetworksClient) AcknowledgeOrderReceipt(input *privatenetworks.AcknowledgeOrderReceiptInput) (*privatenetworks.AcknowledgeOrderReceiptOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockPrivateNetworksClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type PrivateNetworksAPI interface { - AcknowledgeOrderReceipt(*privatenetworks.AcknowledgeOrderReceiptInput) (*privatenetworks.AcknowledgeOrderReceiptOutput, error) - AcknowledgeOrderReceiptWithContext(aws.Context, *privatenetworks.AcknowledgeOrderReceiptInput, ...request.Option) (*privatenetworks.AcknowledgeOrderReceiptOutput, error) - AcknowledgeOrderReceiptRequest(*privatenetworks.AcknowledgeOrderReceiptInput) (*request.Request, *privatenetworks.AcknowledgeOrderReceiptOutput) - - ActivateDeviceIdentifier(*privatenetworks.ActivateDeviceIdentifierInput) (*privatenetworks.ActivateDeviceIdentifierOutput, error) - ActivateDeviceIdentifierWithContext(aws.Context, *privatenetworks.ActivateDeviceIdentifierInput, ...request.Option) (*privatenetworks.ActivateDeviceIdentifierOutput, error) - ActivateDeviceIdentifierRequest(*privatenetworks.ActivateDeviceIdentifierInput) (*request.Request, *privatenetworks.ActivateDeviceIdentifierOutput) - - ActivateNetworkSite(*privatenetworks.ActivateNetworkSiteInput) (*privatenetworks.ActivateNetworkSiteOutput, error) - ActivateNetworkSiteWithContext(aws.Context, *privatenetworks.ActivateNetworkSiteInput, ...request.Option) (*privatenetworks.ActivateNetworkSiteOutput, error) - ActivateNetworkSiteRequest(*privatenetworks.ActivateNetworkSiteInput) (*request.Request, *privatenetworks.ActivateNetworkSiteOutput) - - ConfigureAccessPoint(*privatenetworks.ConfigureAccessPointInput) (*privatenetworks.ConfigureAccessPointOutput, error) - ConfigureAccessPointWithContext(aws.Context, *privatenetworks.ConfigureAccessPointInput, ...request.Option) (*privatenetworks.ConfigureAccessPointOutput, error) - ConfigureAccessPointRequest(*privatenetworks.ConfigureAccessPointInput) (*request.Request, *privatenetworks.ConfigureAccessPointOutput) - - CreateNetwork(*privatenetworks.CreateNetworkInput) (*privatenetworks.CreateNetworkOutput, error) - CreateNetworkWithContext(aws.Context, *privatenetworks.CreateNetworkInput, ...request.Option) (*privatenetworks.CreateNetworkOutput, error) - CreateNetworkRequest(*privatenetworks.CreateNetworkInput) (*request.Request, *privatenetworks.CreateNetworkOutput) - - CreateNetworkSite(*privatenetworks.CreateNetworkSiteInput) (*privatenetworks.CreateNetworkSiteOutput, error) - CreateNetworkSiteWithContext(aws.Context, *privatenetworks.CreateNetworkSiteInput, ...request.Option) (*privatenetworks.CreateNetworkSiteOutput, error) - CreateNetworkSiteRequest(*privatenetworks.CreateNetworkSiteInput) (*request.Request, *privatenetworks.CreateNetworkSiteOutput) - - DeactivateDeviceIdentifier(*privatenetworks.DeactivateDeviceIdentifierInput) (*privatenetworks.DeactivateDeviceIdentifierOutput, error) - DeactivateDeviceIdentifierWithContext(aws.Context, *privatenetworks.DeactivateDeviceIdentifierInput, ...request.Option) (*privatenetworks.DeactivateDeviceIdentifierOutput, error) - DeactivateDeviceIdentifierRequest(*privatenetworks.DeactivateDeviceIdentifierInput) (*request.Request, *privatenetworks.DeactivateDeviceIdentifierOutput) - - DeleteNetwork(*privatenetworks.DeleteNetworkInput) (*privatenetworks.DeleteNetworkOutput, error) - DeleteNetworkWithContext(aws.Context, *privatenetworks.DeleteNetworkInput, ...request.Option) (*privatenetworks.DeleteNetworkOutput, error) - DeleteNetworkRequest(*privatenetworks.DeleteNetworkInput) (*request.Request, *privatenetworks.DeleteNetworkOutput) - - DeleteNetworkSite(*privatenetworks.DeleteNetworkSiteInput) (*privatenetworks.DeleteNetworkSiteOutput, error) - DeleteNetworkSiteWithContext(aws.Context, *privatenetworks.DeleteNetworkSiteInput, ...request.Option) (*privatenetworks.DeleteNetworkSiteOutput, error) - DeleteNetworkSiteRequest(*privatenetworks.DeleteNetworkSiteInput) (*request.Request, *privatenetworks.DeleteNetworkSiteOutput) - - GetDeviceIdentifier(*privatenetworks.GetDeviceIdentifierInput) (*privatenetworks.GetDeviceIdentifierOutput, error) - GetDeviceIdentifierWithContext(aws.Context, *privatenetworks.GetDeviceIdentifierInput, ...request.Option) (*privatenetworks.GetDeviceIdentifierOutput, error) - GetDeviceIdentifierRequest(*privatenetworks.GetDeviceIdentifierInput) (*request.Request, *privatenetworks.GetDeviceIdentifierOutput) - - GetNetwork(*privatenetworks.GetNetworkInput) (*privatenetworks.GetNetworkOutput, error) - GetNetworkWithContext(aws.Context, *privatenetworks.GetNetworkInput, ...request.Option) (*privatenetworks.GetNetworkOutput, error) - GetNetworkRequest(*privatenetworks.GetNetworkInput) (*request.Request, *privatenetworks.GetNetworkOutput) - - GetNetworkResource(*privatenetworks.GetNetworkResourceInput) (*privatenetworks.GetNetworkResourceOutput, error) - GetNetworkResourceWithContext(aws.Context, *privatenetworks.GetNetworkResourceInput, ...request.Option) (*privatenetworks.GetNetworkResourceOutput, error) - GetNetworkResourceRequest(*privatenetworks.GetNetworkResourceInput) (*request.Request, *privatenetworks.GetNetworkResourceOutput) - - GetNetworkSite(*privatenetworks.GetNetworkSiteInput) (*privatenetworks.GetNetworkSiteOutput, error) - GetNetworkSiteWithContext(aws.Context, *privatenetworks.GetNetworkSiteInput, ...request.Option) (*privatenetworks.GetNetworkSiteOutput, error) - GetNetworkSiteRequest(*privatenetworks.GetNetworkSiteInput) (*request.Request, *privatenetworks.GetNetworkSiteOutput) - - GetOrder(*privatenetworks.GetOrderInput) (*privatenetworks.GetOrderOutput, error) - GetOrderWithContext(aws.Context, *privatenetworks.GetOrderInput, ...request.Option) (*privatenetworks.GetOrderOutput, error) - GetOrderRequest(*privatenetworks.GetOrderInput) (*request.Request, *privatenetworks.GetOrderOutput) - - ListDeviceIdentifiers(*privatenetworks.ListDeviceIdentifiersInput) (*privatenetworks.ListDeviceIdentifiersOutput, error) - ListDeviceIdentifiersWithContext(aws.Context, *privatenetworks.ListDeviceIdentifiersInput, ...request.Option) (*privatenetworks.ListDeviceIdentifiersOutput, error) - ListDeviceIdentifiersRequest(*privatenetworks.ListDeviceIdentifiersInput) (*request.Request, *privatenetworks.ListDeviceIdentifiersOutput) - - ListDeviceIdentifiersPages(*privatenetworks.ListDeviceIdentifiersInput, func(*privatenetworks.ListDeviceIdentifiersOutput, bool) bool) error - ListDeviceIdentifiersPagesWithContext(aws.Context, *privatenetworks.ListDeviceIdentifiersInput, func(*privatenetworks.ListDeviceIdentifiersOutput, bool) bool, ...request.Option) error - - ListNetworkResources(*privatenetworks.ListNetworkResourcesInput) (*privatenetworks.ListNetworkResourcesOutput, error) - ListNetworkResourcesWithContext(aws.Context, *privatenetworks.ListNetworkResourcesInput, ...request.Option) (*privatenetworks.ListNetworkResourcesOutput, error) - ListNetworkResourcesRequest(*privatenetworks.ListNetworkResourcesInput) (*request.Request, *privatenetworks.ListNetworkResourcesOutput) - - ListNetworkResourcesPages(*privatenetworks.ListNetworkResourcesInput, func(*privatenetworks.ListNetworkResourcesOutput, bool) bool) error - ListNetworkResourcesPagesWithContext(aws.Context, *privatenetworks.ListNetworkResourcesInput, func(*privatenetworks.ListNetworkResourcesOutput, bool) bool, ...request.Option) error - - ListNetworkSites(*privatenetworks.ListNetworkSitesInput) (*privatenetworks.ListNetworkSitesOutput, error) - ListNetworkSitesWithContext(aws.Context, *privatenetworks.ListNetworkSitesInput, ...request.Option) (*privatenetworks.ListNetworkSitesOutput, error) - ListNetworkSitesRequest(*privatenetworks.ListNetworkSitesInput) (*request.Request, *privatenetworks.ListNetworkSitesOutput) - - ListNetworkSitesPages(*privatenetworks.ListNetworkSitesInput, func(*privatenetworks.ListNetworkSitesOutput, bool) bool) error - ListNetworkSitesPagesWithContext(aws.Context, *privatenetworks.ListNetworkSitesInput, func(*privatenetworks.ListNetworkSitesOutput, bool) bool, ...request.Option) error - - ListNetworks(*privatenetworks.ListNetworksInput) (*privatenetworks.ListNetworksOutput, error) - ListNetworksWithContext(aws.Context, *privatenetworks.ListNetworksInput, ...request.Option) (*privatenetworks.ListNetworksOutput, error) - ListNetworksRequest(*privatenetworks.ListNetworksInput) (*request.Request, *privatenetworks.ListNetworksOutput) - - ListNetworksPages(*privatenetworks.ListNetworksInput, func(*privatenetworks.ListNetworksOutput, bool) bool) error - ListNetworksPagesWithContext(aws.Context, *privatenetworks.ListNetworksInput, func(*privatenetworks.ListNetworksOutput, bool) bool, ...request.Option) error - - ListOrders(*privatenetworks.ListOrdersInput) (*privatenetworks.ListOrdersOutput, error) - ListOrdersWithContext(aws.Context, *privatenetworks.ListOrdersInput, ...request.Option) (*privatenetworks.ListOrdersOutput, error) - ListOrdersRequest(*privatenetworks.ListOrdersInput) (*request.Request, *privatenetworks.ListOrdersOutput) - - ListOrdersPages(*privatenetworks.ListOrdersInput, func(*privatenetworks.ListOrdersOutput, bool) bool) error - ListOrdersPagesWithContext(aws.Context, *privatenetworks.ListOrdersInput, func(*privatenetworks.ListOrdersOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*privatenetworks.ListTagsForResourceInput) (*privatenetworks.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *privatenetworks.ListTagsForResourceInput, ...request.Option) (*privatenetworks.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*privatenetworks.ListTagsForResourceInput) (*request.Request, *privatenetworks.ListTagsForResourceOutput) - - Ping(*privatenetworks.PingInput) (*privatenetworks.PingOutput, error) - PingWithContext(aws.Context, *privatenetworks.PingInput, ...request.Option) (*privatenetworks.PingOutput, error) - PingRequest(*privatenetworks.PingInput) (*request.Request, *privatenetworks.PingOutput) - - StartNetworkResourceUpdate(*privatenetworks.StartNetworkResourceUpdateInput) (*privatenetworks.StartNetworkResourceUpdateOutput, error) - StartNetworkResourceUpdateWithContext(aws.Context, *privatenetworks.StartNetworkResourceUpdateInput, ...request.Option) (*privatenetworks.StartNetworkResourceUpdateOutput, error) - StartNetworkResourceUpdateRequest(*privatenetworks.StartNetworkResourceUpdateInput) (*request.Request, *privatenetworks.StartNetworkResourceUpdateOutput) - - TagResource(*privatenetworks.TagResourceInput) (*privatenetworks.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *privatenetworks.TagResourceInput, ...request.Option) (*privatenetworks.TagResourceOutput, error) - TagResourceRequest(*privatenetworks.TagResourceInput) (*request.Request, *privatenetworks.TagResourceOutput) - - UntagResource(*privatenetworks.UntagResourceInput) (*privatenetworks.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *privatenetworks.UntagResourceInput, ...request.Option) (*privatenetworks.UntagResourceOutput, error) - UntagResourceRequest(*privatenetworks.UntagResourceInput) (*request.Request, *privatenetworks.UntagResourceOutput) - - UpdateNetworkSite(*privatenetworks.UpdateNetworkSiteInput) (*privatenetworks.UpdateNetworkSiteOutput, error) - UpdateNetworkSiteWithContext(aws.Context, *privatenetworks.UpdateNetworkSiteInput, ...request.Option) (*privatenetworks.UpdateNetworkSiteOutput, error) - UpdateNetworkSiteRequest(*privatenetworks.UpdateNetworkSiteInput) (*request.Request, *privatenetworks.UpdateNetworkSiteOutput) - - UpdateNetworkSitePlan(*privatenetworks.UpdateNetworkSitePlanInput) (*privatenetworks.UpdateNetworkSitePlanOutput, error) - UpdateNetworkSitePlanWithContext(aws.Context, *privatenetworks.UpdateNetworkSitePlanInput, ...request.Option) (*privatenetworks.UpdateNetworkSitePlanOutput, error) - UpdateNetworkSitePlanRequest(*privatenetworks.UpdateNetworkSitePlanInput) (*request.Request, *privatenetworks.UpdateNetworkSitePlanOutput) -} - -var _ PrivateNetworksAPI = (*privatenetworks.PrivateNetworks)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/service.go deleted file mode 100644 index 888690308786..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/privatenetworks/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package privatenetworks - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// PrivateNetworks provides the API operation methods for making requests to -// AWS Private 5G. See this package's package overview docs -// for details on the service. -// -// PrivateNetworks methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type PrivateNetworks struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "PrivateNetworks" // Name of service. - EndpointsID = "private-networks" // ID to lookup a service endpoint with. - ServiceID = "PrivateNetworks" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the PrivateNetworks client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a PrivateNetworks client from just a session. -// svc := privatenetworks.New(mySession) -// -// // Create a PrivateNetworks client with additional configuration -// svc := privatenetworks.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *PrivateNetworks { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "private-networks" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *PrivateNetworks { - svc := &PrivateNetworks{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-12-03", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a PrivateNetworks operation and runs any -// custom request initialization. -func (c *PrivateNetworks) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/api.go deleted file mode 100644 index da0c660ce1bb..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/api.go +++ /dev/null @@ -1,19624 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package qbusiness - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opBatchDeleteDocument = "BatchDeleteDocument" - -// BatchDeleteDocumentRequest generates a "aws/request.Request" representing the -// client's request for the BatchDeleteDocument 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 BatchDeleteDocument for more information on using the BatchDeleteDocument -// 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 BatchDeleteDocumentRequest method. -// req, resp := client.BatchDeleteDocumentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/BatchDeleteDocument -func (c *QBusiness) BatchDeleteDocumentRequest(input *BatchDeleteDocumentInput) (req *request.Request, output *BatchDeleteDocumentOutput) { - op := &request.Operation{ - Name: opBatchDeleteDocument, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/documents/delete", - } - - if input == nil { - input = &BatchDeleteDocumentInput{} - } - - output = &BatchDeleteDocumentOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchDeleteDocument API operation for QBusiness. -// -// Asynchronously deletes one or more documents added using the BatchPutDocument -// API from an Amazon Q index. -// -// You can see the progress of the deletion, and any error messages related -// to the process, by using CloudWatch. -// -// 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 QBusiness's -// API operation BatchDeleteDocument for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/BatchDeleteDocument -func (c *QBusiness) BatchDeleteDocument(input *BatchDeleteDocumentInput) (*BatchDeleteDocumentOutput, error) { - req, out := c.BatchDeleteDocumentRequest(input) - return out, req.Send() -} - -// BatchDeleteDocumentWithContext is the same as BatchDeleteDocument with the addition of -// the ability to pass a context and additional request options. -// -// See BatchDeleteDocument 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 *QBusiness) BatchDeleteDocumentWithContext(ctx aws.Context, input *BatchDeleteDocumentInput, opts ...request.Option) (*BatchDeleteDocumentOutput, error) { - req, out := c.BatchDeleteDocumentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchPutDocument = "BatchPutDocument" - -// BatchPutDocumentRequest generates a "aws/request.Request" representing the -// client's request for the BatchPutDocument 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 BatchPutDocument for more information on using the BatchPutDocument -// 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 BatchPutDocumentRequest method. -// req, resp := client.BatchPutDocumentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/BatchPutDocument -func (c *QBusiness) BatchPutDocumentRequest(input *BatchPutDocumentInput) (req *request.Request, output *BatchPutDocumentOutput) { - op := &request.Operation{ - Name: opBatchPutDocument, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/documents", - } - - if input == nil { - input = &BatchPutDocumentInput{} - } - - output = &BatchPutDocumentOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchPutDocument API operation for QBusiness. -// -// Adds one or more documents to an Amazon Q index. -// -// You use this API to: -// -// - ingest your structured and unstructured documents and documents stored -// in an Amazon S3 bucket into an Amazon Q index. -// -// - add custom attributes to documents in an Amazon Q index. -// -// - attach an access control list to the documents added to an Amazon Q -// index. -// -// You can see the progress of the deletion, and any error messages related -// to the process, by using CloudWatch. -// -// 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 QBusiness's -// API operation BatchPutDocument for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/BatchPutDocument -func (c *QBusiness) BatchPutDocument(input *BatchPutDocumentInput) (*BatchPutDocumentOutput, error) { - req, out := c.BatchPutDocumentRequest(input) - return out, req.Send() -} - -// BatchPutDocumentWithContext is the same as BatchPutDocument with the addition of -// the ability to pass a context and additional request options. -// -// See BatchPutDocument 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 *QBusiness) BatchPutDocumentWithContext(ctx aws.Context, input *BatchPutDocumentInput, opts ...request.Option) (*BatchPutDocumentOutput, error) { - req, out := c.BatchPutDocumentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opChatSync = "ChatSync" - -// ChatSyncRequest generates a "aws/request.Request" representing the -// client's request for the ChatSync 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 ChatSync for more information on using the ChatSync -// 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 ChatSyncRequest method. -// req, resp := client.ChatSyncRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ChatSync -func (c *QBusiness) ChatSyncRequest(input *ChatSyncInput) (req *request.Request, output *ChatSyncOutput) { - op := &request.Operation{ - Name: opChatSync, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/conversations?sync", - } - - if input == nil { - input = &ChatSyncInput{} - } - - output = &ChatSyncOutput{} - req = c.newRequest(op, input, output) - return -} - -// ChatSync API operation for QBusiness. -// -// Starts or continues a non-streaming Amazon Q conversation. -// -// 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 QBusiness's -// API operation ChatSync for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - LicenseNotFoundException -// You don't have permissions to perform the action because your license is -// inactive. Ask your admin to activate your license and try again after your -// licence is active. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ChatSync -func (c *QBusiness) ChatSync(input *ChatSyncInput) (*ChatSyncOutput, error) { - req, out := c.ChatSyncRequest(input) - return out, req.Send() -} - -// ChatSyncWithContext is the same as ChatSync with the addition of -// the ability to pass a context and additional request options. -// -// See ChatSync 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 *QBusiness) ChatSyncWithContext(ctx aws.Context, input *ChatSyncInput, opts ...request.Option) (*ChatSyncOutput, error) { - req, out := c.ChatSyncRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateApplication = "CreateApplication" - -// CreateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the CreateApplication 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 CreateApplication for more information on using the CreateApplication -// 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 CreateApplicationRequest method. -// req, resp := client.CreateApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateApplication -func (c *QBusiness) CreateApplicationRequest(input *CreateApplicationInput) (req *request.Request, output *CreateApplicationOutput) { - op := &request.Operation{ - Name: opCreateApplication, - HTTPMethod: "POST", - HTTPPath: "/applications", - } - - if input == nil { - input = &CreateApplicationInput{} - } - - output = &CreateApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateApplication API operation for QBusiness. -// -// Creates an Amazon Q application. -// -// 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 QBusiness's -// API operation CreateApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateApplication -func (c *QBusiness) CreateApplication(input *CreateApplicationInput) (*CreateApplicationOutput, error) { - req, out := c.CreateApplicationRequest(input) - return out, req.Send() -} - -// CreateApplicationWithContext is the same as CreateApplication with the addition of -// the ability to pass a context and additional request options. -// -// See CreateApplication 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 *QBusiness) CreateApplicationWithContext(ctx aws.Context, input *CreateApplicationInput, opts ...request.Option) (*CreateApplicationOutput, error) { - req, out := c.CreateApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateIndex = "CreateIndex" - -// CreateIndexRequest generates a "aws/request.Request" representing the -// client's request for the CreateIndex 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 CreateIndex for more information on using the CreateIndex -// 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 CreateIndexRequest method. -// req, resp := client.CreateIndexRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateIndex -func (c *QBusiness) CreateIndexRequest(input *CreateIndexInput) (req *request.Request, output *CreateIndexOutput) { - op := &request.Operation{ - Name: opCreateIndex, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/indices", - } - - if input == nil { - input = &CreateIndexInput{} - } - - output = &CreateIndexOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateIndex API operation for QBusiness. -// -// Creates an Amazon Q index. -// -// To determine if index creation has completed, check the Status field returned -// from a call to DescribeIndex. The Status field is set to ACTIVE when the -// index is ready to use. -// -// Once the index is active, you can index your documents using the BatchPutDocument -// (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_BatchPutDocument.html) -// API or the CreateDataSource (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_CreateDataSource.html) -// API. -// -// 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 QBusiness's -// API operation CreateIndex for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateIndex -func (c *QBusiness) CreateIndex(input *CreateIndexInput) (*CreateIndexOutput, error) { - req, out := c.CreateIndexRequest(input) - return out, req.Send() -} - -// CreateIndexWithContext is the same as CreateIndex with the addition of -// the ability to pass a context and additional request options. -// -// See CreateIndex 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 *QBusiness) CreateIndexWithContext(ctx aws.Context, input *CreateIndexInput, opts ...request.Option) (*CreateIndexOutput, error) { - req, out := c.CreateIndexRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePlugin = "CreatePlugin" - -// CreatePluginRequest generates a "aws/request.Request" representing the -// client's request for the CreatePlugin 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 CreatePlugin for more information on using the CreatePlugin -// 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 CreatePluginRequest method. -// req, resp := client.CreatePluginRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreatePlugin -func (c *QBusiness) CreatePluginRequest(input *CreatePluginInput) (req *request.Request, output *CreatePluginOutput) { - op := &request.Operation{ - Name: opCreatePlugin, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/plugins", - } - - if input == nil { - input = &CreatePluginInput{} - } - - output = &CreatePluginOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePlugin API operation for QBusiness. -// -// Creates an Amazon Q plugin. -// -// 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 QBusiness's -// API operation CreatePlugin for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreatePlugin -func (c *QBusiness) CreatePlugin(input *CreatePluginInput) (*CreatePluginOutput, error) { - req, out := c.CreatePluginRequest(input) - return out, req.Send() -} - -// CreatePluginWithContext is the same as CreatePlugin with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePlugin 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 *QBusiness) CreatePluginWithContext(ctx aws.Context, input *CreatePluginInput, opts ...request.Option) (*CreatePluginOutput, error) { - req, out := c.CreatePluginRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRetriever = "CreateRetriever" - -// CreateRetrieverRequest generates a "aws/request.Request" representing the -// client's request for the CreateRetriever 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 CreateRetriever for more information on using the CreateRetriever -// 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 CreateRetrieverRequest method. -// req, resp := client.CreateRetrieverRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateRetriever -func (c *QBusiness) CreateRetrieverRequest(input *CreateRetrieverInput) (req *request.Request, output *CreateRetrieverOutput) { - op := &request.Operation{ - Name: opCreateRetriever, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/retrievers", - } - - if input == nil { - input = &CreateRetrieverInput{} - } - - output = &CreateRetrieverOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRetriever API operation for QBusiness. -// -// Adds a retriever to your Amazon Q application. -// -// 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 QBusiness's -// API operation CreateRetriever for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateRetriever -func (c *QBusiness) CreateRetriever(input *CreateRetrieverInput) (*CreateRetrieverOutput, error) { - req, out := c.CreateRetrieverRequest(input) - return out, req.Send() -} - -// CreateRetrieverWithContext is the same as CreateRetriever with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRetriever 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 *QBusiness) CreateRetrieverWithContext(ctx aws.Context, input *CreateRetrieverInput, opts ...request.Option) (*CreateRetrieverOutput, error) { - req, out := c.CreateRetrieverRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateUser = "CreateUser" - -// CreateUserRequest generates a "aws/request.Request" representing the -// client's request for the CreateUser 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 CreateUser for more information on using the CreateUser -// 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 CreateUserRequest method. -// req, resp := client.CreateUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateUser -func (c *QBusiness) CreateUserRequest(input *CreateUserInput) (req *request.Request, output *CreateUserOutput) { - op := &request.Operation{ - Name: opCreateUser, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/users", - } - - if input == nil { - input = &CreateUserInput{} - } - - output = &CreateUserOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateUser API operation for QBusiness. -// -// Creates a universally unique identifier (UUID) mapped to a list of local -// user ids within an application. -// -// 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 QBusiness's -// API operation CreateUser for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateUser -func (c *QBusiness) CreateUser(input *CreateUserInput) (*CreateUserOutput, error) { - req, out := c.CreateUserRequest(input) - return out, req.Send() -} - -// CreateUserWithContext is the same as CreateUser with the addition of -// the ability to pass a context and additional request options. -// -// See CreateUser 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 *QBusiness) CreateUserWithContext(ctx aws.Context, input *CreateUserInput, opts ...request.Option) (*CreateUserOutput, error) { - req, out := c.CreateUserRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateWebExperience = "CreateWebExperience" - -// CreateWebExperienceRequest generates a "aws/request.Request" representing the -// client's request for the CreateWebExperience 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 CreateWebExperience for more information on using the CreateWebExperience -// 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 CreateWebExperienceRequest method. -// req, resp := client.CreateWebExperienceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateWebExperience -func (c *QBusiness) CreateWebExperienceRequest(input *CreateWebExperienceInput) (req *request.Request, output *CreateWebExperienceOutput) { - op := &request.Operation{ - Name: opCreateWebExperience, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/experiences", - } - - if input == nil { - input = &CreateWebExperienceInput{} - } - - output = &CreateWebExperienceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWebExperience API operation for QBusiness. -// -// Creates an Amazon Q web experience. -// -// 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 QBusiness's -// API operation CreateWebExperience for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/CreateWebExperience -func (c *QBusiness) CreateWebExperience(input *CreateWebExperienceInput) (*CreateWebExperienceOutput, error) { - req, out := c.CreateWebExperienceRequest(input) - return out, req.Send() -} - -// CreateWebExperienceWithContext is the same as CreateWebExperience with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWebExperience 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 *QBusiness) CreateWebExperienceWithContext(ctx aws.Context, input *CreateWebExperienceInput, opts ...request.Option) (*CreateWebExperienceOutput, error) { - req, out := c.CreateWebExperienceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteApplication = "DeleteApplication" - -// DeleteApplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApplication 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 DeleteApplication for more information on using the DeleteApplication -// 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 DeleteApplicationRequest method. -// req, resp := client.DeleteApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteApplication -func (c *QBusiness) DeleteApplicationRequest(input *DeleteApplicationInput) (req *request.Request, output *DeleteApplicationOutput) { - op := &request.Operation{ - Name: opDeleteApplication, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}", - } - - if input == nil { - input = &DeleteApplicationInput{} - } - - output = &DeleteApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApplication API operation for QBusiness. -// -// Deletes an Amazon Q application. -// -// 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 QBusiness's -// API operation DeleteApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteApplication -func (c *QBusiness) DeleteApplication(input *DeleteApplicationInput) (*DeleteApplicationOutput, error) { - req, out := c.DeleteApplicationRequest(input) - return out, req.Send() -} - -// DeleteApplicationWithContext is the same as DeleteApplication with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteApplication 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 *QBusiness) DeleteApplicationWithContext(ctx aws.Context, input *DeleteApplicationInput, opts ...request.Option) (*DeleteApplicationOutput, error) { - req, out := c.DeleteApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteChatControlsConfiguration = "DeleteChatControlsConfiguration" - -// DeleteChatControlsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteChatControlsConfiguration 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 DeleteChatControlsConfiguration for more information on using the DeleteChatControlsConfiguration -// 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 DeleteChatControlsConfigurationRequest method. -// req, resp := client.DeleteChatControlsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteChatControlsConfiguration -func (c *QBusiness) DeleteChatControlsConfigurationRequest(input *DeleteChatControlsConfigurationInput) (req *request.Request, output *DeleteChatControlsConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteChatControlsConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/chatcontrols", - } - - if input == nil { - input = &DeleteChatControlsConfigurationInput{} - } - - output = &DeleteChatControlsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteChatControlsConfiguration API operation for QBusiness. -// -// Deletes chat controls configured for an existing Amazon Q application. -// -// 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 QBusiness's -// API operation DeleteChatControlsConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteChatControlsConfiguration -func (c *QBusiness) DeleteChatControlsConfiguration(input *DeleteChatControlsConfigurationInput) (*DeleteChatControlsConfigurationOutput, error) { - req, out := c.DeleteChatControlsConfigurationRequest(input) - return out, req.Send() -} - -// DeleteChatControlsConfigurationWithContext is the same as DeleteChatControlsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteChatControlsConfiguration 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 *QBusiness) DeleteChatControlsConfigurationWithContext(ctx aws.Context, input *DeleteChatControlsConfigurationInput, opts ...request.Option) (*DeleteChatControlsConfigurationOutput, error) { - req, out := c.DeleteChatControlsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteConversation = "DeleteConversation" - -// DeleteConversationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteConversation 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 DeleteConversation for more information on using the DeleteConversation -// 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 DeleteConversationRequest method. -// req, resp := client.DeleteConversationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteConversation -func (c *QBusiness) DeleteConversationRequest(input *DeleteConversationInput) (req *request.Request, output *DeleteConversationOutput) { - op := &request.Operation{ - Name: opDeleteConversation, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/conversations/{conversationId}", - } - - if input == nil { - input = &DeleteConversationInput{} - } - - output = &DeleteConversationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteConversation API operation for QBusiness. -// -// Deletes an Amazon Q web experience conversation. -// -// 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 QBusiness's -// API operation DeleteConversation for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - LicenseNotFoundException -// You don't have permissions to perform the action because your license is -// inactive. Ask your admin to activate your license and try again after your -// licence is active. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteConversation -func (c *QBusiness) DeleteConversation(input *DeleteConversationInput) (*DeleteConversationOutput, error) { - req, out := c.DeleteConversationRequest(input) - return out, req.Send() -} - -// DeleteConversationWithContext is the same as DeleteConversation with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteConversation 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 *QBusiness) DeleteConversationWithContext(ctx aws.Context, input *DeleteConversationInput, opts ...request.Option) (*DeleteConversationOutput, error) { - req, out := c.DeleteConversationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDataSource = "DeleteDataSource" - -// DeleteDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDataSource 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 DeleteDataSource for more information on using the DeleteDataSource -// 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 DeleteDataSourceRequest method. -// req, resp := client.DeleteDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteDataSource -func (c *QBusiness) DeleteDataSourceRequest(input *DeleteDataSourceInput) (req *request.Request, output *DeleteDataSourceOutput) { - op := &request.Operation{ - Name: opDeleteDataSource, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", - } - - if input == nil { - input = &DeleteDataSourceInput{} - } - - output = &DeleteDataSourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDataSource API operation for QBusiness. -// -// Deletes an Amazon Q data source connector. While the data source is being -// deleted, the Status field returned by a call to the DescribeDataSource API -// is set to DELETING. -// -// 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 QBusiness's -// API operation DeleteDataSource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteDataSource -func (c *QBusiness) DeleteDataSource(input *DeleteDataSourceInput) (*DeleteDataSourceOutput, error) { - req, out := c.DeleteDataSourceRequest(input) - return out, req.Send() -} - -// DeleteDataSourceWithContext is the same as DeleteDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDataSource 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 *QBusiness) DeleteDataSourceWithContext(ctx aws.Context, input *DeleteDataSourceInput, opts ...request.Option) (*DeleteDataSourceOutput, error) { - req, out := c.DeleteDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteGroup = "DeleteGroup" - -// DeleteGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGroup 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 DeleteGroup for more information on using the DeleteGroup -// 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 DeleteGroupRequest method. -// req, resp := client.DeleteGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteGroup -func (c *QBusiness) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) { - op := &request.Operation{ - Name: opDeleteGroup, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/groups/{groupName}", - } - - if input == nil { - input = &DeleteGroupInput{} - } - - output = &DeleteGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteGroup API operation for QBusiness. -// -// Deletes a group so that all users and sub groups that belong to the group -// can no longer access documents only available to that group. For example, -// after deleting the group "Summer Interns", all interns who belonged to that -// group no longer see intern-only documents in their chat results. -// -// If you want to delete, update, or replace users or sub groups of a group, -// you need to use the PutGroup operation. For example, if a user in the group -// "Engineering" leaves the engineering team and another user takes their place, -// you provide an updated list of users or sub groups that belong to the "Engineering" -// group when calling PutGroup. -// -// 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 QBusiness's -// API operation DeleteGroup for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteGroup -func (c *QBusiness) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { - req, out := c.DeleteGroupRequest(input) - return out, req.Send() -} - -// DeleteGroupWithContext is the same as DeleteGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteGroup 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 *QBusiness) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) { - req, out := c.DeleteGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteIndex = "DeleteIndex" - -// DeleteIndexRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIndex 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 DeleteIndex for more information on using the DeleteIndex -// 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 DeleteIndexRequest method. -// req, resp := client.DeleteIndexRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteIndex -func (c *QBusiness) DeleteIndexRequest(input *DeleteIndexInput) (req *request.Request, output *DeleteIndexOutput) { - op := &request.Operation{ - Name: opDeleteIndex, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/indices/{indexId}", - } - - if input == nil { - input = &DeleteIndexInput{} - } - - output = &DeleteIndexOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteIndex API operation for QBusiness. -// -// Deletes an Amazon Q index. -// -// 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 QBusiness's -// API operation DeleteIndex for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteIndex -func (c *QBusiness) DeleteIndex(input *DeleteIndexInput) (*DeleteIndexOutput, error) { - req, out := c.DeleteIndexRequest(input) - return out, req.Send() -} - -// DeleteIndexWithContext is the same as DeleteIndex with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteIndex 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 *QBusiness) DeleteIndexWithContext(ctx aws.Context, input *DeleteIndexInput, opts ...request.Option) (*DeleteIndexOutput, error) { - req, out := c.DeleteIndexRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePlugin = "DeletePlugin" - -// DeletePluginRequest generates a "aws/request.Request" representing the -// client's request for the DeletePlugin 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 DeletePlugin for more information on using the DeletePlugin -// 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 DeletePluginRequest method. -// req, resp := client.DeletePluginRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeletePlugin -func (c *QBusiness) DeletePluginRequest(input *DeletePluginInput) (req *request.Request, output *DeletePluginOutput) { - op := &request.Operation{ - Name: opDeletePlugin, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/plugins/{pluginId}", - } - - if input == nil { - input = &DeletePluginInput{} - } - - output = &DeletePluginOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePlugin API operation for QBusiness. -// -// Deletes an Amazon Q plugin. -// -// 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 QBusiness's -// API operation DeletePlugin for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeletePlugin -func (c *QBusiness) DeletePlugin(input *DeletePluginInput) (*DeletePluginOutput, error) { - req, out := c.DeletePluginRequest(input) - return out, req.Send() -} - -// DeletePluginWithContext is the same as DeletePlugin with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePlugin 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 *QBusiness) DeletePluginWithContext(ctx aws.Context, input *DeletePluginInput, opts ...request.Option) (*DeletePluginOutput, error) { - req, out := c.DeletePluginRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRetriever = "DeleteRetriever" - -// DeleteRetrieverRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRetriever 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 DeleteRetriever for more information on using the DeleteRetriever -// 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 DeleteRetrieverRequest method. -// req, resp := client.DeleteRetrieverRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteRetriever -func (c *QBusiness) DeleteRetrieverRequest(input *DeleteRetrieverInput) (req *request.Request, output *DeleteRetrieverOutput) { - op := &request.Operation{ - Name: opDeleteRetriever, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/retrievers/{retrieverId}", - } - - if input == nil { - input = &DeleteRetrieverInput{} - } - - output = &DeleteRetrieverOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRetriever API operation for QBusiness. -// -// Deletes the retriever used by an Amazon Q application. -// -// 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 QBusiness's -// API operation DeleteRetriever for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteRetriever -func (c *QBusiness) DeleteRetriever(input *DeleteRetrieverInput) (*DeleteRetrieverOutput, error) { - req, out := c.DeleteRetrieverRequest(input) - return out, req.Send() -} - -// DeleteRetrieverWithContext is the same as DeleteRetriever with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRetriever 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 *QBusiness) DeleteRetrieverWithContext(ctx aws.Context, input *DeleteRetrieverInput, opts ...request.Option) (*DeleteRetrieverOutput, error) { - req, out := c.DeleteRetrieverRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteUser = "DeleteUser" - -// DeleteUserRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUser 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 DeleteUser for more information on using the DeleteUser -// 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 DeleteUserRequest method. -// req, resp := client.DeleteUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteUser -func (c *QBusiness) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, output *DeleteUserOutput) { - op := &request.Operation{ - Name: opDeleteUser, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/users/{userId}", - } - - if input == nil { - input = &DeleteUserInput{} - } - - output = &DeleteUserOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteUser API operation for QBusiness. -// -// Deletes a user by email id. -// -// 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 QBusiness's -// API operation DeleteUser for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteUser -func (c *QBusiness) DeleteUser(input *DeleteUserInput) (*DeleteUserOutput, error) { - req, out := c.DeleteUserRequest(input) - return out, req.Send() -} - -// DeleteUserWithContext is the same as DeleteUser with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteUser 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 *QBusiness) DeleteUserWithContext(ctx aws.Context, input *DeleteUserInput, opts ...request.Option) (*DeleteUserOutput, error) { - req, out := c.DeleteUserRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWebExperience = "DeleteWebExperience" - -// DeleteWebExperienceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWebExperience 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 DeleteWebExperience for more information on using the DeleteWebExperience -// 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 DeleteWebExperienceRequest method. -// req, resp := client.DeleteWebExperienceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteWebExperience -func (c *QBusiness) DeleteWebExperienceRequest(input *DeleteWebExperienceInput) (req *request.Request, output *DeleteWebExperienceOutput) { - op := &request.Operation{ - Name: opDeleteWebExperience, - HTTPMethod: "DELETE", - HTTPPath: "/applications/{applicationId}/experiences/{webExperienceId}", - } - - if input == nil { - input = &DeleteWebExperienceInput{} - } - - output = &DeleteWebExperienceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteWebExperience API operation for QBusiness. -// -// Deletes an Amazon Q web experience. -// -// 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 QBusiness's -// API operation DeleteWebExperience for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/DeleteWebExperience -func (c *QBusiness) DeleteWebExperience(input *DeleteWebExperienceInput) (*DeleteWebExperienceOutput, error) { - req, out := c.DeleteWebExperienceRequest(input) - return out, req.Send() -} - -// DeleteWebExperienceWithContext is the same as DeleteWebExperience with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWebExperience 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 *QBusiness) DeleteWebExperienceWithContext(ctx aws.Context, input *DeleteWebExperienceInput, opts ...request.Option) (*DeleteWebExperienceOutput, error) { - req, out := c.DeleteWebExperienceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetApplication = "GetApplication" - -// GetApplicationRequest generates a "aws/request.Request" representing the -// client's request for the GetApplication 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 GetApplication for more information on using the GetApplication -// 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 GetApplicationRequest method. -// req, resp := client.GetApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetApplication -func (c *QBusiness) GetApplicationRequest(input *GetApplicationInput) (req *request.Request, output *GetApplicationOutput) { - op := &request.Operation{ - Name: opGetApplication, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}", - } - - if input == nil { - input = &GetApplicationInput{} - } - - output = &GetApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetApplication API operation for QBusiness. -// -// Gets information about an existing Amazon Q application. -// -// 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 QBusiness's -// API operation GetApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetApplication -func (c *QBusiness) GetApplication(input *GetApplicationInput) (*GetApplicationOutput, error) { - req, out := c.GetApplicationRequest(input) - return out, req.Send() -} - -// GetApplicationWithContext is the same as GetApplication with the addition of -// the ability to pass a context and additional request options. -// -// See GetApplication 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 *QBusiness) GetApplicationWithContext(ctx aws.Context, input *GetApplicationInput, opts ...request.Option) (*GetApplicationOutput, error) { - req, out := c.GetApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetChatControlsConfiguration = "GetChatControlsConfiguration" - -// GetChatControlsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetChatControlsConfiguration 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 GetChatControlsConfiguration for more information on using the GetChatControlsConfiguration -// 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 GetChatControlsConfigurationRequest method. -// req, resp := client.GetChatControlsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetChatControlsConfiguration -func (c *QBusiness) GetChatControlsConfigurationRequest(input *GetChatControlsConfigurationInput) (req *request.Request, output *GetChatControlsConfigurationOutput) { - op := &request.Operation{ - Name: opGetChatControlsConfiguration, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/chatcontrols", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetChatControlsConfigurationInput{} - } - - output = &GetChatControlsConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChatControlsConfiguration API operation for QBusiness. -// -// Gets information about an chat controls configured for an existing Amazon -// Q application. -// -// 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 QBusiness's -// API operation GetChatControlsConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetChatControlsConfiguration -func (c *QBusiness) GetChatControlsConfiguration(input *GetChatControlsConfigurationInput) (*GetChatControlsConfigurationOutput, error) { - req, out := c.GetChatControlsConfigurationRequest(input) - return out, req.Send() -} - -// GetChatControlsConfigurationWithContext is the same as GetChatControlsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetChatControlsConfiguration 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 *QBusiness) GetChatControlsConfigurationWithContext(ctx aws.Context, input *GetChatControlsConfigurationInput, opts ...request.Option) (*GetChatControlsConfigurationOutput, error) { - req, out := c.GetChatControlsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetChatControlsConfigurationPages iterates over the pages of a GetChatControlsConfiguration operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetChatControlsConfiguration method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetChatControlsConfiguration operation. -// pageNum := 0 -// err := client.GetChatControlsConfigurationPages(params, -// func(page *qbusiness.GetChatControlsConfigurationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) GetChatControlsConfigurationPages(input *GetChatControlsConfigurationInput, fn func(*GetChatControlsConfigurationOutput, bool) bool) error { - return c.GetChatControlsConfigurationPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetChatControlsConfigurationPagesWithContext same as GetChatControlsConfigurationPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) GetChatControlsConfigurationPagesWithContext(ctx aws.Context, input *GetChatControlsConfigurationInput, fn func(*GetChatControlsConfigurationOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetChatControlsConfigurationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetChatControlsConfigurationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetChatControlsConfigurationOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetDataSource = "GetDataSource" - -// GetDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the GetDataSource 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 GetDataSource for more information on using the GetDataSource -// 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 GetDataSourceRequest method. -// req, resp := client.GetDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetDataSource -func (c *QBusiness) GetDataSourceRequest(input *GetDataSourceInput) (req *request.Request, output *GetDataSourceOutput) { - op := &request.Operation{ - Name: opGetDataSource, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", - } - - if input == nil { - input = &GetDataSourceInput{} - } - - output = &GetDataSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataSource API operation for QBusiness. -// -// Gets information about an existing Amazon Q data source connector. -// -// 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 QBusiness's -// API operation GetDataSource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetDataSource -func (c *QBusiness) GetDataSource(input *GetDataSourceInput) (*GetDataSourceOutput, error) { - req, out := c.GetDataSourceRequest(input) - return out, req.Send() -} - -// GetDataSourceWithContext is the same as GetDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataSource 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 *QBusiness) GetDataSourceWithContext(ctx aws.Context, input *GetDataSourceInput, opts ...request.Option) (*GetDataSourceOutput, error) { - req, out := c.GetDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetGroup = "GetGroup" - -// GetGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetGroup 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 GetGroup for more information on using the GetGroup -// 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 GetGroupRequest method. -// req, resp := client.GetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetGroup -func (c *QBusiness) GetGroupRequest(input *GetGroupInput) (req *request.Request, output *GetGroupOutput) { - op := &request.Operation{ - Name: opGetGroup, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/groups/{groupName}", - } - - if input == nil { - input = &GetGroupInput{} - } - - output = &GetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetGroup API operation for QBusiness. -// -// Describes a group by group name. -// -// 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 QBusiness's -// API operation GetGroup for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetGroup -func (c *QBusiness) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) { - req, out := c.GetGroupRequest(input) - return out, req.Send() -} - -// GetGroupWithContext is the same as GetGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetGroup 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 *QBusiness) GetGroupWithContext(ctx aws.Context, input *GetGroupInput, opts ...request.Option) (*GetGroupOutput, error) { - req, out := c.GetGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIndex = "GetIndex" - -// GetIndexRequest generates a "aws/request.Request" representing the -// client's request for the GetIndex 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 GetIndex for more information on using the GetIndex -// 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 GetIndexRequest method. -// req, resp := client.GetIndexRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetIndex -func (c *QBusiness) GetIndexRequest(input *GetIndexInput) (req *request.Request, output *GetIndexOutput) { - op := &request.Operation{ - Name: opGetIndex, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/indices/{indexId}", - } - - if input == nil { - input = &GetIndexInput{} - } - - output = &GetIndexOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIndex API operation for QBusiness. -// -// Gets information about an existing Amazon Q index. -// -// 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 QBusiness's -// API operation GetIndex for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetIndex -func (c *QBusiness) GetIndex(input *GetIndexInput) (*GetIndexOutput, error) { - req, out := c.GetIndexRequest(input) - return out, req.Send() -} - -// GetIndexWithContext is the same as GetIndex with the addition of -// the ability to pass a context and additional request options. -// -// See GetIndex 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 *QBusiness) GetIndexWithContext(ctx aws.Context, input *GetIndexInput, opts ...request.Option) (*GetIndexOutput, error) { - req, out := c.GetIndexRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPlugin = "GetPlugin" - -// GetPluginRequest generates a "aws/request.Request" representing the -// client's request for the GetPlugin 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 GetPlugin for more information on using the GetPlugin -// 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 GetPluginRequest method. -// req, resp := client.GetPluginRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetPlugin -func (c *QBusiness) GetPluginRequest(input *GetPluginInput) (req *request.Request, output *GetPluginOutput) { - op := &request.Operation{ - Name: opGetPlugin, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/plugins/{pluginId}", - } - - if input == nil { - input = &GetPluginInput{} - } - - output = &GetPluginOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPlugin API operation for QBusiness. -// -// Gets information about an existing Amazon Q plugin. -// -// 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 QBusiness's -// API operation GetPlugin for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetPlugin -func (c *QBusiness) GetPlugin(input *GetPluginInput) (*GetPluginOutput, error) { - req, out := c.GetPluginRequest(input) - return out, req.Send() -} - -// GetPluginWithContext is the same as GetPlugin with the addition of -// the ability to pass a context and additional request options. -// -// See GetPlugin 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 *QBusiness) GetPluginWithContext(ctx aws.Context, input *GetPluginInput, opts ...request.Option) (*GetPluginOutput, error) { - req, out := c.GetPluginRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRetriever = "GetRetriever" - -// GetRetrieverRequest generates a "aws/request.Request" representing the -// client's request for the GetRetriever 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 GetRetriever for more information on using the GetRetriever -// 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 GetRetrieverRequest method. -// req, resp := client.GetRetrieverRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetRetriever -func (c *QBusiness) GetRetrieverRequest(input *GetRetrieverInput) (req *request.Request, output *GetRetrieverOutput) { - op := &request.Operation{ - Name: opGetRetriever, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/retrievers/{retrieverId}", - } - - if input == nil { - input = &GetRetrieverInput{} - } - - output = &GetRetrieverOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRetriever API operation for QBusiness. -// -// Gets information about an existing retriever used by an Amazon Q application. -// -// 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 QBusiness's -// API operation GetRetriever for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetRetriever -func (c *QBusiness) GetRetriever(input *GetRetrieverInput) (*GetRetrieverOutput, error) { - req, out := c.GetRetrieverRequest(input) - return out, req.Send() -} - -// GetRetrieverWithContext is the same as GetRetriever with the addition of -// the ability to pass a context and additional request options. -// -// See GetRetriever 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 *QBusiness) GetRetrieverWithContext(ctx aws.Context, input *GetRetrieverInput, opts ...request.Option) (*GetRetrieverOutput, error) { - req, out := c.GetRetrieverRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetUser = "GetUser" - -// GetUserRequest generates a "aws/request.Request" representing the -// client's request for the GetUser 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 GetUser for more information on using the GetUser -// 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 GetUserRequest method. -// req, resp := client.GetUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetUser -func (c *QBusiness) GetUserRequest(input *GetUserInput) (req *request.Request, output *GetUserOutput) { - op := &request.Operation{ - Name: opGetUser, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/users/{userId}", - } - - if input == nil { - input = &GetUserInput{} - } - - output = &GetUserOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetUser API operation for QBusiness. -// -// Describes the universally unique identifier (UUID) associated with a local -// user in a data source. -// -// 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 QBusiness's -// API operation GetUser for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetUser -func (c *QBusiness) GetUser(input *GetUserInput) (*GetUserOutput, error) { - req, out := c.GetUserRequest(input) - return out, req.Send() -} - -// GetUserWithContext is the same as GetUser with the addition of -// the ability to pass a context and additional request options. -// -// See GetUser 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 *QBusiness) GetUserWithContext(ctx aws.Context, input *GetUserInput, opts ...request.Option) (*GetUserOutput, error) { - req, out := c.GetUserRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWebExperience = "GetWebExperience" - -// GetWebExperienceRequest generates a "aws/request.Request" representing the -// client's request for the GetWebExperience 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 GetWebExperience for more information on using the GetWebExperience -// 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 GetWebExperienceRequest method. -// req, resp := client.GetWebExperienceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetWebExperience -func (c *QBusiness) GetWebExperienceRequest(input *GetWebExperienceInput) (req *request.Request, output *GetWebExperienceOutput) { - op := &request.Operation{ - Name: opGetWebExperience, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/experiences/{webExperienceId}", - } - - if input == nil { - input = &GetWebExperienceInput{} - } - - output = &GetWebExperienceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWebExperience API operation for QBusiness. -// -// Gets information about an existing Amazon Q web experience. -// -// 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 QBusiness's -// API operation GetWebExperience for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/GetWebExperience -func (c *QBusiness) GetWebExperience(input *GetWebExperienceInput) (*GetWebExperienceOutput, error) { - req, out := c.GetWebExperienceRequest(input) - return out, req.Send() -} - -// GetWebExperienceWithContext is the same as GetWebExperience with the addition of -// the ability to pass a context and additional request options. -// -// See GetWebExperience 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 *QBusiness) GetWebExperienceWithContext(ctx aws.Context, input *GetWebExperienceInput, opts ...request.Option) (*GetWebExperienceOutput, error) { - req, out := c.GetWebExperienceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListApplications = "ListApplications" - -// ListApplicationsRequest generates a "aws/request.Request" representing the -// client's request for the ListApplications 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 ListApplications for more information on using the ListApplications -// 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 ListApplicationsRequest method. -// req, resp := client.ListApplicationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListApplications -func (c *QBusiness) ListApplicationsRequest(input *ListApplicationsInput) (req *request.Request, output *ListApplicationsOutput) { - op := &request.Operation{ - Name: opListApplications, - HTTPMethod: "GET", - HTTPPath: "/applications", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListApplicationsInput{} - } - - output = &ListApplicationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListApplications API operation for QBusiness. -// -// Lists Amazon Q applications. -// -// 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 QBusiness's -// API operation ListApplications for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListApplications -func (c *QBusiness) ListApplications(input *ListApplicationsInput) (*ListApplicationsOutput, error) { - req, out := c.ListApplicationsRequest(input) - return out, req.Send() -} - -// ListApplicationsWithContext is the same as ListApplications with the addition of -// the ability to pass a context and additional request options. -// -// See ListApplications 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 *QBusiness) ListApplicationsWithContext(ctx aws.Context, input *ListApplicationsInput, opts ...request.Option) (*ListApplicationsOutput, error) { - req, out := c.ListApplicationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListApplicationsPages iterates over the pages of a ListApplications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApplications method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListApplications operation. -// pageNum := 0 -// err := client.ListApplicationsPages(params, -// func(page *qbusiness.ListApplicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListApplicationsPages(input *ListApplicationsInput, fn func(*ListApplicationsOutput, bool) bool) error { - return c.ListApplicationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListApplicationsPagesWithContext same as ListApplicationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListApplicationsPagesWithContext(ctx aws.Context, input *ListApplicationsInput, fn func(*ListApplicationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListApplicationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListApplicationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListConversations = "ListConversations" - -// ListConversationsRequest generates a "aws/request.Request" representing the -// client's request for the ListConversations 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 ListConversations for more information on using the ListConversations -// 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 ListConversationsRequest method. -// req, resp := client.ListConversationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListConversations -func (c *QBusiness) ListConversationsRequest(input *ListConversationsInput) (req *request.Request, output *ListConversationsOutput) { - op := &request.Operation{ - Name: opListConversations, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/conversations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListConversationsInput{} - } - - output = &ListConversationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListConversations API operation for QBusiness. -// -// Lists one or more Amazon Q conversations. -// -// 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 QBusiness's -// API operation ListConversations for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - LicenseNotFoundException -// You don't have permissions to perform the action because your license is -// inactive. Ask your admin to activate your license and try again after your -// licence is active. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListConversations -func (c *QBusiness) ListConversations(input *ListConversationsInput) (*ListConversationsOutput, error) { - req, out := c.ListConversationsRequest(input) - return out, req.Send() -} - -// ListConversationsWithContext is the same as ListConversations with the addition of -// the ability to pass a context and additional request options. -// -// See ListConversations 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 *QBusiness) ListConversationsWithContext(ctx aws.Context, input *ListConversationsInput, opts ...request.Option) (*ListConversationsOutput, error) { - req, out := c.ListConversationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListConversationsPages iterates over the pages of a ListConversations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListConversations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListConversations operation. -// pageNum := 0 -// err := client.ListConversationsPages(params, -// func(page *qbusiness.ListConversationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListConversationsPages(input *ListConversationsInput, fn func(*ListConversationsOutput, bool) bool) error { - return c.ListConversationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListConversationsPagesWithContext same as ListConversationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListConversationsPagesWithContext(ctx aws.Context, input *ListConversationsInput, fn func(*ListConversationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListConversationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListConversationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListConversationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataSourceSyncJobs = "ListDataSourceSyncJobs" - -// ListDataSourceSyncJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListDataSourceSyncJobs 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 ListDataSourceSyncJobs for more information on using the ListDataSourceSyncJobs -// 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 ListDataSourceSyncJobsRequest method. -// req, resp := client.ListDataSourceSyncJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListDataSourceSyncJobs -func (c *QBusiness) ListDataSourceSyncJobsRequest(input *ListDataSourceSyncJobsInput) (req *request.Request, output *ListDataSourceSyncJobsOutput) { - op := &request.Operation{ - Name: opListDataSourceSyncJobs, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/syncjobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataSourceSyncJobsInput{} - } - - output = &ListDataSourceSyncJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataSourceSyncJobs API operation for QBusiness. -// -// Get information about an Amazon Q data source connector synchronization. -// -// 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 QBusiness's -// API operation ListDataSourceSyncJobs for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListDataSourceSyncJobs -func (c *QBusiness) ListDataSourceSyncJobs(input *ListDataSourceSyncJobsInput) (*ListDataSourceSyncJobsOutput, error) { - req, out := c.ListDataSourceSyncJobsRequest(input) - return out, req.Send() -} - -// ListDataSourceSyncJobsWithContext is the same as ListDataSourceSyncJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataSourceSyncJobs 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 *QBusiness) ListDataSourceSyncJobsWithContext(ctx aws.Context, input *ListDataSourceSyncJobsInput, opts ...request.Option) (*ListDataSourceSyncJobsOutput, error) { - req, out := c.ListDataSourceSyncJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataSourceSyncJobsPages iterates over the pages of a ListDataSourceSyncJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataSourceSyncJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataSourceSyncJobs operation. -// pageNum := 0 -// err := client.ListDataSourceSyncJobsPages(params, -// func(page *qbusiness.ListDataSourceSyncJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListDataSourceSyncJobsPages(input *ListDataSourceSyncJobsInput, fn func(*ListDataSourceSyncJobsOutput, bool) bool) error { - return c.ListDataSourceSyncJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataSourceSyncJobsPagesWithContext same as ListDataSourceSyncJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListDataSourceSyncJobsPagesWithContext(ctx aws.Context, input *ListDataSourceSyncJobsInput, fn func(*ListDataSourceSyncJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataSourceSyncJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataSourceSyncJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataSourceSyncJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataSources = "ListDataSources" - -// ListDataSourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListDataSources 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 ListDataSources for more information on using the ListDataSources -// 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 ListDataSourcesRequest method. -// req, resp := client.ListDataSourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListDataSources -func (c *QBusiness) ListDataSourcesRequest(input *ListDataSourcesInput) (req *request.Request, output *ListDataSourcesOutput) { - op := &request.Operation{ - Name: opListDataSources, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/datasources", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataSourcesInput{} - } - - output = &ListDataSourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataSources API operation for QBusiness. -// -// Lists the Amazon Q data source connectors that you have created. -// -// 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 QBusiness's -// API operation ListDataSources for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListDataSources -func (c *QBusiness) ListDataSources(input *ListDataSourcesInput) (*ListDataSourcesOutput, error) { - req, out := c.ListDataSourcesRequest(input) - return out, req.Send() -} - -// ListDataSourcesWithContext is the same as ListDataSources with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataSources 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 *QBusiness) ListDataSourcesWithContext(ctx aws.Context, input *ListDataSourcesInput, opts ...request.Option) (*ListDataSourcesOutput, error) { - req, out := c.ListDataSourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataSourcesPages iterates over the pages of a ListDataSources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataSources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataSources operation. -// pageNum := 0 -// err := client.ListDataSourcesPages(params, -// func(page *qbusiness.ListDataSourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListDataSourcesPages(input *ListDataSourcesInput, fn func(*ListDataSourcesOutput, bool) bool) error { - return c.ListDataSourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataSourcesPagesWithContext same as ListDataSourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListDataSourcesPagesWithContext(ctx aws.Context, input *ListDataSourcesInput, fn func(*ListDataSourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataSourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataSourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataSourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDocuments = "ListDocuments" - -// ListDocumentsRequest generates a "aws/request.Request" representing the -// client's request for the ListDocuments 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 ListDocuments for more information on using the ListDocuments -// 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 ListDocumentsRequest method. -// req, resp := client.ListDocumentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListDocuments -func (c *QBusiness) ListDocumentsRequest(input *ListDocumentsInput) (req *request.Request, output *ListDocumentsOutput) { - op := &request.Operation{ - Name: opListDocuments, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/index/{indexId}/documents", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDocumentsInput{} - } - - output = &ListDocumentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDocuments API operation for QBusiness. -// -// A list of documents attached to an index. -// -// 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 QBusiness's -// API operation ListDocuments for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListDocuments -func (c *QBusiness) ListDocuments(input *ListDocumentsInput) (*ListDocumentsOutput, error) { - req, out := c.ListDocumentsRequest(input) - return out, req.Send() -} - -// ListDocumentsWithContext is the same as ListDocuments with the addition of -// the ability to pass a context and additional request options. -// -// See ListDocuments 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 *QBusiness) ListDocumentsWithContext(ctx aws.Context, input *ListDocumentsInput, opts ...request.Option) (*ListDocumentsOutput, error) { - req, out := c.ListDocumentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDocumentsPages iterates over the pages of a ListDocuments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDocuments method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDocuments operation. -// pageNum := 0 -// err := client.ListDocumentsPages(params, -// func(page *qbusiness.ListDocumentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListDocumentsPages(input *ListDocumentsInput, fn func(*ListDocumentsOutput, bool) bool) error { - return c.ListDocumentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDocumentsPagesWithContext same as ListDocumentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListDocumentsPagesWithContext(ctx aws.Context, input *ListDocumentsInput, fn func(*ListDocumentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDocumentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDocumentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDocumentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListGroups = "ListGroups" - -// ListGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListGroups 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 ListGroups for more information on using the ListGroups -// 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 ListGroupsRequest method. -// req, resp := client.ListGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListGroups -func (c *QBusiness) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput) { - op := &request.Operation{ - Name: opListGroups, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/groups", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListGroupsInput{} - } - - output = &ListGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListGroups API operation for QBusiness. -// -// Provides a list of groups that are mapped to users. -// -// 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 QBusiness's -// API operation ListGroups for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListGroups -func (c *QBusiness) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { - req, out := c.ListGroupsRequest(input) - return out, req.Send() -} - -// ListGroupsWithContext is the same as ListGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListGroups 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 *QBusiness) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error) { - req, out := c.ListGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListGroupsPages iterates over the pages of a ListGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListGroups operation. -// pageNum := 0 -// err := client.ListGroupsPages(params, -// func(page *qbusiness.ListGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListGroupsPages(input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool) error { - return c.ListGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListGroupsPagesWithContext same as ListGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListIndices = "ListIndices" - -// ListIndicesRequest generates a "aws/request.Request" representing the -// client's request for the ListIndices 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 ListIndices for more information on using the ListIndices -// 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 ListIndicesRequest method. -// req, resp := client.ListIndicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListIndices -func (c *QBusiness) ListIndicesRequest(input *ListIndicesInput) (req *request.Request, output *ListIndicesOutput) { - op := &request.Operation{ - Name: opListIndices, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/indices", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIndicesInput{} - } - - output = &ListIndicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIndices API operation for QBusiness. -// -// Lists the Amazon Q indices you have created. -// -// 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 QBusiness's -// API operation ListIndices for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListIndices -func (c *QBusiness) ListIndices(input *ListIndicesInput) (*ListIndicesOutput, error) { - req, out := c.ListIndicesRequest(input) - return out, req.Send() -} - -// ListIndicesWithContext is the same as ListIndices with the addition of -// the ability to pass a context and additional request options. -// -// See ListIndices 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 *QBusiness) ListIndicesWithContext(ctx aws.Context, input *ListIndicesInput, opts ...request.Option) (*ListIndicesOutput, error) { - req, out := c.ListIndicesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIndicesPages iterates over the pages of a ListIndices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIndices method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIndices operation. -// pageNum := 0 -// err := client.ListIndicesPages(params, -// func(page *qbusiness.ListIndicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListIndicesPages(input *ListIndicesInput, fn func(*ListIndicesOutput, bool) bool) error { - return c.ListIndicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIndicesPagesWithContext same as ListIndicesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListIndicesPagesWithContext(ctx aws.Context, input *ListIndicesInput, fn func(*ListIndicesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIndicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIndicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIndicesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListMessages = "ListMessages" - -// ListMessagesRequest generates a "aws/request.Request" representing the -// client's request for the ListMessages 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 ListMessages for more information on using the ListMessages -// 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 ListMessagesRequest method. -// req, resp := client.ListMessagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListMessages -func (c *QBusiness) ListMessagesRequest(input *ListMessagesInput) (req *request.Request, output *ListMessagesOutput) { - op := &request.Operation{ - Name: opListMessages, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/conversations/{conversationId}", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListMessagesInput{} - } - - output = &ListMessagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMessages API operation for QBusiness. -// -// Gets a list of messages associated with an Amazon Q web experience. -// -// 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 QBusiness's -// API operation ListMessages for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - LicenseNotFoundException -// You don't have permissions to perform the action because your license is -// inactive. Ask your admin to activate your license and try again after your -// licence is active. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListMessages -func (c *QBusiness) ListMessages(input *ListMessagesInput) (*ListMessagesOutput, error) { - req, out := c.ListMessagesRequest(input) - return out, req.Send() -} - -// ListMessagesWithContext is the same as ListMessages with the addition of -// the ability to pass a context and additional request options. -// -// See ListMessages 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 *QBusiness) ListMessagesWithContext(ctx aws.Context, input *ListMessagesInput, opts ...request.Option) (*ListMessagesOutput, error) { - req, out := c.ListMessagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMessagesPages iterates over the pages of a ListMessages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMessages method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMessages operation. -// pageNum := 0 -// err := client.ListMessagesPages(params, -// func(page *qbusiness.ListMessagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListMessagesPages(input *ListMessagesInput, fn func(*ListMessagesOutput, bool) bool) error { - return c.ListMessagesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMessagesPagesWithContext same as ListMessagesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListMessagesPagesWithContext(ctx aws.Context, input *ListMessagesInput, fn func(*ListMessagesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMessagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMessagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListMessagesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPlugins = "ListPlugins" - -// ListPluginsRequest generates a "aws/request.Request" representing the -// client's request for the ListPlugins 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 ListPlugins for more information on using the ListPlugins -// 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 ListPluginsRequest method. -// req, resp := client.ListPluginsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListPlugins -func (c *QBusiness) ListPluginsRequest(input *ListPluginsInput) (req *request.Request, output *ListPluginsOutput) { - op := &request.Operation{ - Name: opListPlugins, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/plugins", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPluginsInput{} - } - - output = &ListPluginsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPlugins API operation for QBusiness. -// -// Lists configured Amazon Q plugins. -// -// 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 QBusiness's -// API operation ListPlugins for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListPlugins -func (c *QBusiness) ListPlugins(input *ListPluginsInput) (*ListPluginsOutput, error) { - req, out := c.ListPluginsRequest(input) - return out, req.Send() -} - -// ListPluginsWithContext is the same as ListPlugins with the addition of -// the ability to pass a context and additional request options. -// -// See ListPlugins 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 *QBusiness) ListPluginsWithContext(ctx aws.Context, input *ListPluginsInput, opts ...request.Option) (*ListPluginsOutput, error) { - req, out := c.ListPluginsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPluginsPages iterates over the pages of a ListPlugins operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPlugins method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPlugins operation. -// pageNum := 0 -// err := client.ListPluginsPages(params, -// func(page *qbusiness.ListPluginsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListPluginsPages(input *ListPluginsInput, fn func(*ListPluginsOutput, bool) bool) error { - return c.ListPluginsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPluginsPagesWithContext same as ListPluginsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListPluginsPagesWithContext(ctx aws.Context, input *ListPluginsInput, fn func(*ListPluginsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPluginsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPluginsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPluginsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRetrievers = "ListRetrievers" - -// ListRetrieversRequest generates a "aws/request.Request" representing the -// client's request for the ListRetrievers 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 ListRetrievers for more information on using the ListRetrievers -// 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 ListRetrieversRequest method. -// req, resp := client.ListRetrieversRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListRetrievers -func (c *QBusiness) ListRetrieversRequest(input *ListRetrieversInput) (req *request.Request, output *ListRetrieversOutput) { - op := &request.Operation{ - Name: opListRetrievers, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/retrievers", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRetrieversInput{} - } - - output = &ListRetrieversOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRetrievers API operation for QBusiness. -// -// Lists the retriever used by an Amazon Q application. -// -// 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 QBusiness's -// API operation ListRetrievers for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListRetrievers -func (c *QBusiness) ListRetrievers(input *ListRetrieversInput) (*ListRetrieversOutput, error) { - req, out := c.ListRetrieversRequest(input) - return out, req.Send() -} - -// ListRetrieversWithContext is the same as ListRetrievers with the addition of -// the ability to pass a context and additional request options. -// -// See ListRetrievers 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 *QBusiness) ListRetrieversWithContext(ctx aws.Context, input *ListRetrieversInput, opts ...request.Option) (*ListRetrieversOutput, error) { - req, out := c.ListRetrieversRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRetrieversPages iterates over the pages of a ListRetrievers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRetrievers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRetrievers operation. -// pageNum := 0 -// err := client.ListRetrieversPages(params, -// func(page *qbusiness.ListRetrieversOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListRetrieversPages(input *ListRetrieversInput, fn func(*ListRetrieversOutput, bool) bool) error { - return c.ListRetrieversPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRetrieversPagesWithContext same as ListRetrieversPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListRetrieversPagesWithContext(ctx aws.Context, input *ListRetrieversInput, fn func(*ListRetrieversOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRetrieversInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRetrieversRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRetrieversOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListTagsForResource -func (c *QBusiness) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/v1/tags/{resourceARN}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for QBusiness. -// -// Gets a list of tags associated with a specified resource. Amazon Q applications -// and data sources can have tags associated with them. -// -// 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 QBusiness's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListTagsForResource -func (c *QBusiness) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *QBusiness) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListWebExperiences = "ListWebExperiences" - -// ListWebExperiencesRequest generates a "aws/request.Request" representing the -// client's request for the ListWebExperiences 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 ListWebExperiences for more information on using the ListWebExperiences -// 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 ListWebExperiencesRequest method. -// req, resp := client.ListWebExperiencesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListWebExperiences -func (c *QBusiness) ListWebExperiencesRequest(input *ListWebExperiencesInput) (req *request.Request, output *ListWebExperiencesOutput) { - op := &request.Operation{ - Name: opListWebExperiences, - HTTPMethod: "GET", - HTTPPath: "/applications/{applicationId}/experiences", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWebExperiencesInput{} - } - - output = &ListWebExperiencesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWebExperiences API operation for QBusiness. -// -// Lists one or more Amazon Q Web Experiences. -// -// 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 QBusiness's -// API operation ListWebExperiences for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/ListWebExperiences -func (c *QBusiness) ListWebExperiences(input *ListWebExperiencesInput) (*ListWebExperiencesOutput, error) { - req, out := c.ListWebExperiencesRequest(input) - return out, req.Send() -} - -// ListWebExperiencesWithContext is the same as ListWebExperiences with the addition of -// the ability to pass a context and additional request options. -// -// See ListWebExperiences 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 *QBusiness) ListWebExperiencesWithContext(ctx aws.Context, input *ListWebExperiencesInput, opts ...request.Option) (*ListWebExperiencesOutput, error) { - req, out := c.ListWebExperiencesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWebExperiencesPages iterates over the pages of a ListWebExperiences operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWebExperiences method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWebExperiences operation. -// pageNum := 0 -// err := client.ListWebExperiencesPages(params, -// func(page *qbusiness.ListWebExperiencesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QBusiness) ListWebExperiencesPages(input *ListWebExperiencesInput, fn func(*ListWebExperiencesOutput, bool) bool) error { - return c.ListWebExperiencesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWebExperiencesPagesWithContext same as ListWebExperiencesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QBusiness) ListWebExperiencesPagesWithContext(ctx aws.Context, input *ListWebExperiencesInput, fn func(*ListWebExperiencesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWebExperiencesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWebExperiencesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWebExperiencesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutFeedback = "PutFeedback" - -// PutFeedbackRequest generates a "aws/request.Request" representing the -// client's request for the PutFeedback 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 PutFeedback for more information on using the PutFeedback -// 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 PutFeedbackRequest method. -// req, resp := client.PutFeedbackRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/PutFeedback -func (c *QBusiness) PutFeedbackRequest(input *PutFeedbackInput) (req *request.Request, output *PutFeedbackOutput) { - op := &request.Operation{ - Name: opPutFeedback, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/feedback", - } - - if input == nil { - input = &PutFeedbackInput{} - } - - output = &PutFeedbackOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutFeedback API operation for QBusiness. -// -// Enables your end user to to provide feedback on their Amazon Q generated -// chat responses. -// -// 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 QBusiness's -// API operation PutFeedback for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/PutFeedback -func (c *QBusiness) PutFeedback(input *PutFeedbackInput) (*PutFeedbackOutput, error) { - req, out := c.PutFeedbackRequest(input) - return out, req.Send() -} - -// PutFeedbackWithContext is the same as PutFeedback with the addition of -// the ability to pass a context and additional request options. -// -// See PutFeedback 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 *QBusiness) PutFeedbackWithContext(ctx aws.Context, input *PutFeedbackInput, opts ...request.Option) (*PutFeedbackOutput, error) { - req, out := c.PutFeedbackRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutGroup = "PutGroup" - -// PutGroupRequest generates a "aws/request.Request" representing the -// client's request for the PutGroup 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 PutGroup for more information on using the PutGroup -// 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 PutGroupRequest method. -// req, resp := client.PutGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/PutGroup -func (c *QBusiness) PutGroupRequest(input *PutGroupInput) (req *request.Request, output *PutGroupOutput) { - op := &request.Operation{ - Name: opPutGroup, - HTTPMethod: "PUT", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/groups", - } - - if input == nil { - input = &PutGroupInput{} - } - - output = &PutGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutGroup API operation for QBusiness. -// -// Create, or updates, a mapping of users—who have access to a document—to -// groups. -// -// You can also map sub groups to groups. For example, the group "Company Intellectual -// Property Teams" includes sub groups "Research" and "Engineering". These sub -// groups include their own list of users or people who work in these teams. -// Only users who work in research and engineering, and therefore belong in -// the intellectual property group, can see top-secret company documents in -// their Amazon Q chat results. -// -// 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 QBusiness's -// API operation PutGroup for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/PutGroup -func (c *QBusiness) PutGroup(input *PutGroupInput) (*PutGroupOutput, error) { - req, out := c.PutGroupRequest(input) - return out, req.Send() -} - -// PutGroupWithContext is the same as PutGroup with the addition of -// the ability to pass a context and additional request options. -// -// See PutGroup 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 *QBusiness) PutGroupWithContext(ctx aws.Context, input *PutGroupInput, opts ...request.Option) (*PutGroupOutput, error) { - req, out := c.PutGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartDataSourceSyncJob = "StartDataSourceSyncJob" - -// StartDataSourceSyncJobRequest generates a "aws/request.Request" representing the -// client's request for the StartDataSourceSyncJob 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 StartDataSourceSyncJob for more information on using the StartDataSourceSyncJob -// 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 StartDataSourceSyncJobRequest method. -// req, resp := client.StartDataSourceSyncJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/StartDataSourceSyncJob -func (c *QBusiness) StartDataSourceSyncJobRequest(input *StartDataSourceSyncJobInput) (req *request.Request, output *StartDataSourceSyncJobOutput) { - op := &request.Operation{ - Name: opStartDataSourceSyncJob, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/startsync", - } - - if input == nil { - input = &StartDataSourceSyncJobInput{} - } - - output = &StartDataSourceSyncJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartDataSourceSyncJob API operation for QBusiness. -// -// Starts a data source connector synchronization job. If a synchronization -// job is already in progress, Amazon Q returns a ConflictException. -// -// 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 QBusiness's -// API operation StartDataSourceSyncJob for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/StartDataSourceSyncJob -func (c *QBusiness) StartDataSourceSyncJob(input *StartDataSourceSyncJobInput) (*StartDataSourceSyncJobOutput, error) { - req, out := c.StartDataSourceSyncJobRequest(input) - return out, req.Send() -} - -// StartDataSourceSyncJobWithContext is the same as StartDataSourceSyncJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartDataSourceSyncJob 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 *QBusiness) StartDataSourceSyncJobWithContext(ctx aws.Context, input *StartDataSourceSyncJobInput, opts ...request.Option) (*StartDataSourceSyncJobOutput, error) { - req, out := c.StartDataSourceSyncJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopDataSourceSyncJob = "StopDataSourceSyncJob" - -// StopDataSourceSyncJobRequest generates a "aws/request.Request" representing the -// client's request for the StopDataSourceSyncJob 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 StopDataSourceSyncJob for more information on using the StopDataSourceSyncJob -// 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 StopDataSourceSyncJobRequest method. -// req, resp := client.StopDataSourceSyncJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/StopDataSourceSyncJob -func (c *QBusiness) StopDataSourceSyncJobRequest(input *StopDataSourceSyncJobInput) (req *request.Request, output *StopDataSourceSyncJobOutput) { - op := &request.Operation{ - Name: opStopDataSourceSyncJob, - HTTPMethod: "POST", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/stopsync", - } - - if input == nil { - input = &StopDataSourceSyncJobInput{} - } - - output = &StopDataSourceSyncJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopDataSourceSyncJob API operation for QBusiness. -// -// Stops an Amazon Q data source connector synchronization job already in progress. -// -// 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 QBusiness's -// API operation StopDataSourceSyncJob for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/StopDataSourceSyncJob -func (c *QBusiness) StopDataSourceSyncJob(input *StopDataSourceSyncJobInput) (*StopDataSourceSyncJobOutput, error) { - req, out := c.StopDataSourceSyncJobRequest(input) - return out, req.Send() -} - -// StopDataSourceSyncJobWithContext is the same as StopDataSourceSyncJob with the addition of -// the ability to pass a context and additional request options. -// -// See StopDataSourceSyncJob 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 *QBusiness) StopDataSourceSyncJobWithContext(ctx aws.Context, input *StopDataSourceSyncJobInput, opts ...request.Option) (*StopDataSourceSyncJobOutput, error) { - req, out := c.StopDataSourceSyncJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/TagResource -func (c *QBusiness) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/v1/tags/{resourceARN}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for QBusiness. -// -// Adds the specified tag to the specified Amazon Q application or data source -// resource. If the tag already exists, the existing value is replaced with -// the new value. -// -// 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 QBusiness's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/TagResource -func (c *QBusiness) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *QBusiness) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UntagResource -func (c *QBusiness) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/v1/tags/{resourceARN}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for QBusiness. -// -// Removes a tag from an Amazon Q application or a data source. -// -// 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 QBusiness's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UntagResource -func (c *QBusiness) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *QBusiness) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateApplication = "UpdateApplication" - -// UpdateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplication 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 UpdateApplication for more information on using the UpdateApplication -// 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 UpdateApplicationRequest method. -// req, resp := client.UpdateApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateApplication -func (c *QBusiness) UpdateApplicationRequest(input *UpdateApplicationInput) (req *request.Request, output *UpdateApplicationOutput) { - op := &request.Operation{ - Name: opUpdateApplication, - HTTPMethod: "PUT", - HTTPPath: "/applications/{applicationId}", - } - - if input == nil { - input = &UpdateApplicationInput{} - } - - output = &UpdateApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateApplication API operation for QBusiness. -// -// Updates an existing Amazon Q application. -// -// 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 QBusiness's -// API operation UpdateApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateApplication -func (c *QBusiness) UpdateApplication(input *UpdateApplicationInput) (*UpdateApplicationOutput, error) { - req, out := c.UpdateApplicationRequest(input) - return out, req.Send() -} - -// UpdateApplicationWithContext is the same as UpdateApplication with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateApplication 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 *QBusiness) UpdateApplicationWithContext(ctx aws.Context, input *UpdateApplicationInput, opts ...request.Option) (*UpdateApplicationOutput, error) { - req, out := c.UpdateApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateChatControlsConfiguration = "UpdateChatControlsConfiguration" - -// UpdateChatControlsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateChatControlsConfiguration 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 UpdateChatControlsConfiguration for more information on using the UpdateChatControlsConfiguration -// 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 UpdateChatControlsConfigurationRequest method. -// req, resp := client.UpdateChatControlsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateChatControlsConfiguration -func (c *QBusiness) UpdateChatControlsConfigurationRequest(input *UpdateChatControlsConfigurationInput) (req *request.Request, output *UpdateChatControlsConfigurationOutput) { - op := &request.Operation{ - Name: opUpdateChatControlsConfiguration, - HTTPMethod: "PATCH", - HTTPPath: "/applications/{applicationId}/chatcontrols", - } - - if input == nil { - input = &UpdateChatControlsConfigurationInput{} - } - - output = &UpdateChatControlsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateChatControlsConfiguration API operation for QBusiness. -// -// Updates an set of chat controls configured for an existing Amazon Q application. -// -// 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 QBusiness's -// API operation UpdateChatControlsConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateChatControlsConfiguration -func (c *QBusiness) UpdateChatControlsConfiguration(input *UpdateChatControlsConfigurationInput) (*UpdateChatControlsConfigurationOutput, error) { - req, out := c.UpdateChatControlsConfigurationRequest(input) - return out, req.Send() -} - -// UpdateChatControlsConfigurationWithContext is the same as UpdateChatControlsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateChatControlsConfiguration 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 *QBusiness) UpdateChatControlsConfigurationWithContext(ctx aws.Context, input *UpdateChatControlsConfigurationInput, opts ...request.Option) (*UpdateChatControlsConfigurationOutput, error) { - req, out := c.UpdateChatControlsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDataSource = "UpdateDataSource" - -// UpdateDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDataSource 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 UpdateDataSource for more information on using the UpdateDataSource -// 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 UpdateDataSourceRequest method. -// req, resp := client.UpdateDataSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateDataSource -func (c *QBusiness) UpdateDataSourceRequest(input *UpdateDataSourceInput) (req *request.Request, output *UpdateDataSourceOutput) { - op := &request.Operation{ - Name: opUpdateDataSource, - HTTPMethod: "PUT", - HTTPPath: "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", - } - - if input == nil { - input = &UpdateDataSourceInput{} - } - - output = &UpdateDataSourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateDataSource API operation for QBusiness. -// -// Updates an existing Amazon Q data source connector. -// -// 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 QBusiness's -// API operation UpdateDataSource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateDataSource -func (c *QBusiness) UpdateDataSource(input *UpdateDataSourceInput) (*UpdateDataSourceOutput, error) { - req, out := c.UpdateDataSourceRequest(input) - return out, req.Send() -} - -// UpdateDataSourceWithContext is the same as UpdateDataSource with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDataSource 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 *QBusiness) UpdateDataSourceWithContext(ctx aws.Context, input *UpdateDataSourceInput, opts ...request.Option) (*UpdateDataSourceOutput, error) { - req, out := c.UpdateDataSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateIndex = "UpdateIndex" - -// UpdateIndexRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIndex 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 UpdateIndex for more information on using the UpdateIndex -// 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 UpdateIndexRequest method. -// req, resp := client.UpdateIndexRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateIndex -func (c *QBusiness) UpdateIndexRequest(input *UpdateIndexInput) (req *request.Request, output *UpdateIndexOutput) { - op := &request.Operation{ - Name: opUpdateIndex, - HTTPMethod: "PUT", - HTTPPath: "/applications/{applicationId}/indices/{indexId}", - } - - if input == nil { - input = &UpdateIndexInput{} - } - - output = &UpdateIndexOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateIndex API operation for QBusiness. -// -// Updates an Amazon Q index. -// -// 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 QBusiness's -// API operation UpdateIndex for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateIndex -func (c *QBusiness) UpdateIndex(input *UpdateIndexInput) (*UpdateIndexOutput, error) { - req, out := c.UpdateIndexRequest(input) - return out, req.Send() -} - -// UpdateIndexWithContext is the same as UpdateIndex with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateIndex 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 *QBusiness) UpdateIndexWithContext(ctx aws.Context, input *UpdateIndexInput, opts ...request.Option) (*UpdateIndexOutput, error) { - req, out := c.UpdateIndexRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePlugin = "UpdatePlugin" - -// UpdatePluginRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePlugin 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 UpdatePlugin for more information on using the UpdatePlugin -// 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 UpdatePluginRequest method. -// req, resp := client.UpdatePluginRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdatePlugin -func (c *QBusiness) UpdatePluginRequest(input *UpdatePluginInput) (req *request.Request, output *UpdatePluginOutput) { - op := &request.Operation{ - Name: opUpdatePlugin, - HTTPMethod: "PUT", - HTTPPath: "/applications/{applicationId}/plugins/{pluginId}", - } - - if input == nil { - input = &UpdatePluginInput{} - } - - output = &UpdatePluginOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdatePlugin API operation for QBusiness. -// -// Updates an Amazon Q plugin. -// -// 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 QBusiness's -// API operation UpdatePlugin for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdatePlugin -func (c *QBusiness) UpdatePlugin(input *UpdatePluginInput) (*UpdatePluginOutput, error) { - req, out := c.UpdatePluginRequest(input) - return out, req.Send() -} - -// UpdatePluginWithContext is the same as UpdatePlugin with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePlugin 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 *QBusiness) UpdatePluginWithContext(ctx aws.Context, input *UpdatePluginInput, opts ...request.Option) (*UpdatePluginOutput, error) { - req, out := c.UpdatePluginRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateRetriever = "UpdateRetriever" - -// UpdateRetrieverRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRetriever 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 UpdateRetriever for more information on using the UpdateRetriever -// 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 UpdateRetrieverRequest method. -// req, resp := client.UpdateRetrieverRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateRetriever -func (c *QBusiness) UpdateRetrieverRequest(input *UpdateRetrieverInput) (req *request.Request, output *UpdateRetrieverOutput) { - op := &request.Operation{ - Name: opUpdateRetriever, - HTTPMethod: "PUT", - HTTPPath: "/applications/{applicationId}/retrievers/{retrieverId}", - } - - if input == nil { - input = &UpdateRetrieverInput{} - } - - output = &UpdateRetrieverOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateRetriever API operation for QBusiness. -// -// Updates the retriever used for your Amazon Q application. -// -// 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 QBusiness's -// API operation UpdateRetriever for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateRetriever -func (c *QBusiness) UpdateRetriever(input *UpdateRetrieverInput) (*UpdateRetrieverOutput, error) { - req, out := c.UpdateRetrieverRequest(input) - return out, req.Send() -} - -// UpdateRetrieverWithContext is the same as UpdateRetriever with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateRetriever 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 *QBusiness) UpdateRetrieverWithContext(ctx aws.Context, input *UpdateRetrieverInput, opts ...request.Option) (*UpdateRetrieverOutput, error) { - req, out := c.UpdateRetrieverRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateUser = "UpdateUser" - -// UpdateUserRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUser 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 UpdateUser for more information on using the UpdateUser -// 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 UpdateUserRequest method. -// req, resp := client.UpdateUserRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateUser -func (c *QBusiness) UpdateUserRequest(input *UpdateUserInput) (req *request.Request, output *UpdateUserOutput) { - op := &request.Operation{ - Name: opUpdateUser, - HTTPMethod: "PUT", - HTTPPath: "/applications/{applicationId}/users/{userId}", - } - - if input == nil { - input = &UpdateUserInput{} - } - - output = &UpdateUserOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateUser API operation for QBusiness. -// -// Updates a information associated with a user id. -// -// 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 QBusiness's -// API operation UpdateUser for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// - ServiceQuotaExceededException -// You have exceeded the set limits for your Amazon Q service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateUser -func (c *QBusiness) UpdateUser(input *UpdateUserInput) (*UpdateUserOutput, error) { - req, out := c.UpdateUserRequest(input) - return out, req.Send() -} - -// UpdateUserWithContext is the same as UpdateUser with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateUser 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 *QBusiness) UpdateUserWithContext(ctx aws.Context, input *UpdateUserInput, opts ...request.Option) (*UpdateUserOutput, error) { - req, out := c.UpdateUserRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWebExperience = "UpdateWebExperience" - -// UpdateWebExperienceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWebExperience 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 UpdateWebExperience for more information on using the UpdateWebExperience -// 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 UpdateWebExperienceRequest method. -// req, resp := client.UpdateWebExperienceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateWebExperience -func (c *QBusiness) UpdateWebExperienceRequest(input *UpdateWebExperienceInput) (req *request.Request, output *UpdateWebExperienceOutput) { - op := &request.Operation{ - Name: opUpdateWebExperience, - HTTPMethod: "PUT", - HTTPPath: "/applications/{applicationId}/experiences/{webExperienceId}", - } - - if input == nil { - input = &UpdateWebExperienceInput{} - } - - output = &UpdateWebExperienceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateWebExperience API operation for QBusiness. -// -// Updates an Amazon Q web experience. -// -// 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 QBusiness's -// API operation UpdateWebExperience for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -// -// - InternalServerException -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -// -// - ConflictException -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -// -// - ThrottlingException -// The request was denied due to throttling. Reduce the number of requests and -// try again. -// -// - ValidationException -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -// -// - AccessDeniedException -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27/UpdateWebExperience -func (c *QBusiness) UpdateWebExperience(input *UpdateWebExperienceInput) (*UpdateWebExperienceOutput, error) { - req, out := c.UpdateWebExperienceRequest(input) - return out, req.Send() -} - -// UpdateWebExperienceWithContext is the same as UpdateWebExperience with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWebExperience 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 *QBusiness) UpdateWebExperienceWithContext(ctx aws.Context, input *UpdateWebExperienceInput, opts ...request.Option) (*UpdateWebExperienceOutput, error) { - req, out := c.UpdateWebExperienceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Used to configure access permissions for a document. -type AccessConfiguration struct { - _ struct{} `type:"structure"` - - // A list of AccessControlList objects. - // - // AccessControls is a required field - AccessControls []*AccessControl `locationName:"accessControls" type:"list" required:"true"` - - // Describes the member relation within the AccessControlList object. - MemberRelation *string `locationName:"memberRelation" type:"string" enum:"MemberRelation"` -} - -// 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 AccessConfiguration) 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 AccessConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AccessConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AccessConfiguration"} - if s.AccessControls == nil { - invalidParams.Add(request.NewErrParamRequired("AccessControls")) - } - if s.AccessControls != nil { - for i, v := range s.AccessControls { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AccessControls", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessControls sets the AccessControls field's value. -func (s *AccessConfiguration) SetAccessControls(v []*AccessControl) *AccessConfiguration { - s.AccessControls = v - return s -} - -// SetMemberRelation sets the MemberRelation field's value. -func (s *AccessConfiguration) SetMemberRelation(v string) *AccessConfiguration { - s.MemberRelation = &v - return s -} - -// A list of principals. Each principal can be either a USER or a GROUP and -// can be designated document access permissions of either ALLOW or DENY. -type AccessControl struct { - _ struct{} `type:"structure"` - - // Describes the member relation within a principal list. - MemberRelation *string `locationName:"memberRelation" type:"string" enum:"MemberRelation"` - - // Contains a list of principals, where a principal can be either a USER or - // a GROUP. Each principal can be have the following type of document access: - // ALLOW or DENY. - // - // Principals is a required field - Principals []*Principal `locationName:"principals" type:"list" 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 AccessControl) 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 AccessControl) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AccessControl) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AccessControl"} - if s.Principals == nil { - invalidParams.Add(request.NewErrParamRequired("Principals")) - } - if s.Principals != nil { - for i, v := range s.Principals { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Principals", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMemberRelation sets the MemberRelation field's value. -func (s *AccessControl) SetMemberRelation(v string) *AccessControl { - s.MemberRelation = &v - return s -} - -// SetPrincipals sets the Principals field's value. -func (s *AccessControl) SetPrincipals(v []*Principal) *AccessControl { - s.Principals = v - return s -} - -// You don't have access to perform this action. Make sure you have the required -// permission policies and user accounts and try again. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An output event that Amazon Q returns to an user who wants to perform a plugin -// action during a non-streaming chat conversation. It contains information -// about the selected action with a list of possible user input fields, some -// pre-populated by Amazon Q. -type ActionReview struct { - _ struct{} `type:"structure"` - - // Field values that an end user needs to provide to Amazon Q for Amazon Q to - // perform the requested plugin action. - Payload map[string]*ActionReviewPayloadField `locationName:"payload" type:"map"` - - // A string used to retain information about the hierarchical contexts within - // an action review payload. - PayloadFieldNameSeparator *string `locationName:"payloadFieldNameSeparator" min:"1" type:"string"` - - // The identifier of the plugin associated with the action review. - PluginId *string `locationName:"pluginId" min:"36" type:"string"` - - // The type of plugin. - PluginType *string `locationName:"pluginType" type:"string" enum:"PluginType"` -} - -// 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 ActionReview) 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 ActionReview) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *ActionReview) SetPayload(v map[string]*ActionReviewPayloadField) *ActionReview { - s.Payload = v - return s -} - -// SetPayloadFieldNameSeparator sets the PayloadFieldNameSeparator field's value. -func (s *ActionReview) SetPayloadFieldNameSeparator(v string) *ActionReview { - s.PayloadFieldNameSeparator = &v - return s -} - -// SetPluginId sets the PluginId field's value. -func (s *ActionReview) SetPluginId(v string) *ActionReview { - s.PluginId = &v - return s -} - -// SetPluginType sets the PluginType field's value. -func (s *ActionReview) SetPluginType(v string) *ActionReview { - s.PluginType = &v - return s -} - -// A user input field in an plugin action review payload. -type ActionReviewPayloadField struct { - _ struct{} `type:"structure"` - - // Information about the field values that an end user can use to provide to - // Amazon Q for Amazon Q to perform the requested plugin action. - AllowedValues []*ActionReviewPayloadFieldAllowedValue `locationName:"allowedValues" type:"list"` - - // The name of the field. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The display order of fields in a payload. - DisplayOrder *int64 `locationName:"displayOrder" type:"integer"` - - // Information about whether the field is required. - Required *bool `locationName:"required" type:"boolean"` - - // The type of field. - Type *string `locationName:"type" type:"string" enum:"ActionPayloadFieldType"` -} - -// 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 ActionReviewPayloadField) 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 ActionReviewPayloadField) GoString() string { - return s.String() -} - -// SetAllowedValues sets the AllowedValues field's value. -func (s *ActionReviewPayloadField) SetAllowedValues(v []*ActionReviewPayloadFieldAllowedValue) *ActionReviewPayloadField { - s.AllowedValues = v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *ActionReviewPayloadField) SetDisplayName(v string) *ActionReviewPayloadField { - s.DisplayName = &v - return s -} - -// SetDisplayOrder sets the DisplayOrder field's value. -func (s *ActionReviewPayloadField) SetDisplayOrder(v int64) *ActionReviewPayloadField { - s.DisplayOrder = &v - return s -} - -// SetRequired sets the Required field's value. -func (s *ActionReviewPayloadField) SetRequired(v bool) *ActionReviewPayloadField { - s.Required = &v - return s -} - -// SetType sets the Type field's value. -func (s *ActionReviewPayloadField) SetType(v string) *ActionReviewPayloadField { - s.Type = &v - return s -} - -// Information about the field values that an end user can use to provide to -// Amazon Q for Amazon Q to perform the requested plugin action. -type ActionReviewPayloadFieldAllowedValue 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 ActionReviewPayloadFieldAllowedValue) 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 ActionReviewPayloadFieldAllowedValue) GoString() string { - return s.String() -} - -// Summary information for an Amazon Q application. -type Application struct { - _ struct{} `type:"structure"` - - // The identifier for the Amazon Q application. - ApplicationId *string `locationName:"applicationId" min:"36" type:"string"` - - // The Unix timestamp when the Amazon Q application was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The name of the Amazon Q application. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The status of the Amazon Q application. The application is ready to use when - // the status is ACTIVE. - Status *string `locationName:"status" type:"string" enum:"ApplicationStatus"` - - // The Unix timestamp when the Amazon Q application was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 Application) 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 Application) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *Application) SetApplicationId(v string) *Application { - s.ApplicationId = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Application) SetCreatedAt(v time.Time) *Application { - s.CreatedAt = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Application) SetDisplayName(v string) *Application { - s.DisplayName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Application) SetStatus(v string) *Application { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Application) SetUpdatedAt(v time.Time) *Application { - s.UpdatedAt = &v - return s -} - -// Configuration information about the file upload during chat feature for your -// application. -type AppliedAttachmentsConfiguration struct { - _ struct{} `type:"structure"` - - // Information about whether file upload during chat functionality is activated - // for your application. - AttachmentsControlMode *string `locationName:"attachmentsControlMode" type:"string" enum:"AttachmentsControlMode"` -} - -// 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 AppliedAttachmentsConfiguration) 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 AppliedAttachmentsConfiguration) GoString() string { - return s.String() -} - -// SetAttachmentsControlMode sets the AttachmentsControlMode field's value. -func (s *AppliedAttachmentsConfiguration) SetAttachmentsControlMode(v string) *AppliedAttachmentsConfiguration { - s.AttachmentsControlMode = &v - return s -} - -// A file directly uploaded into a web experience chat. -type AttachmentInput_ struct { - _ struct{} `type:"structure"` - - // The data contained within the uploaded file. - // Data is automatically base64 encoded/decoded by the SDK. - // - // Data is a required field - Data []byte `locationName:"data" type:"blob" required:"true"` - - // The name of the file. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 AttachmentInput_) 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 AttachmentInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachmentInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachmentInput_"} - if s.Data == nil { - invalidParams.Add(request.NewErrParamRequired("Data")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetData sets the Data field's value. -func (s *AttachmentInput_) SetData(v []byte) *AttachmentInput_ { - s.Data = v - return s -} - -// SetName sets the Name field's value. -func (s *AttachmentInput_) SetName(v string) *AttachmentInput_ { - s.Name = &v - return s -} - -// The details of a file uploaded during chat. -type AttachmentOutput_ struct { - _ struct{} `type:"structure"` - - // An error associated with a file uploaded during chat. - Error *ErrorDetail `locationName:"error" type:"structure"` - - // The name of a file uploaded during chat. - Name *string `locationName:"name" min:"1" type:"string"` - - // The status of a file uploaded during chat. - Status *string `locationName:"status" type:"string" enum:"AttachmentStatus"` -} - -// 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 AttachmentOutput_) 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 AttachmentOutput_) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *AttachmentOutput_) SetError(v *ErrorDetail) *AttachmentOutput_ { - s.Error = v - return s -} - -// SetName sets the Name field's value. -func (s *AttachmentOutput_) SetName(v string) *AttachmentOutput_ { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AttachmentOutput_) SetStatus(v string) *AttachmentOutput_ { - s.Status = &v - return s -} - -// Configuration information for the file upload during chat feature. -type AttachmentsConfiguration struct { - _ struct{} `type:"structure"` - - // Status information about whether file upload functionality is activated or - // deactivated for your end user. - // - // AttachmentsControlMode is a required field - AttachmentsControlMode *string `locationName:"attachmentsControlMode" type:"string" required:"true" enum:"AttachmentsControlMode"` -} - -// 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 AttachmentsConfiguration) 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 AttachmentsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachmentsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachmentsConfiguration"} - if s.AttachmentsControlMode == nil { - invalidParams.Add(request.NewErrParamRequired("AttachmentsControlMode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttachmentsControlMode sets the AttachmentsControlMode field's value. -func (s *AttachmentsConfiguration) SetAttachmentsControlMode(v string) *AttachmentsConfiguration { - s.AttachmentsControlMode = &v - return s -} - -// Enables filtering of Amazon Q web experience responses based on document -// attributes or metadata fields. -type AttributeFilter struct { - _ struct{} `type:"structure"` - - // Performs a logical AND operation on all supplied filters. - AndAllFilters []*AttributeFilter `locationName:"andAllFilters" type:"list"` - - // Returns true when a document contains all the specified document attributes - // or metadata fields. - ContainsAll *DocumentAttribute `locationName:"containsAll" type:"structure"` - - // Returns true when a document contains any of the specified document attributes - // or metadata fields. - ContainsAny *DocumentAttribute `locationName:"containsAny" type:"structure"` - - // Performs an equals operation on two document attributes or metadata fields. - EqualsTo *DocumentAttribute `locationName:"equalsTo" type:"structure"` - - // Performs a greater than operation on two document attributes or metadata - // fields. Use with a document attribute of type Date or Long. - GreaterThan *DocumentAttribute `locationName:"greaterThan" type:"structure"` - - // Performs a greater or equals than operation on two document attributes or - // metadata fields. Use with a document attribute of type Date or Long. - GreaterThanOrEquals *DocumentAttribute `locationName:"greaterThanOrEquals" type:"structure"` - - // Performs a less than operation on two document attributes or metadata fields. - // Use with a document attribute of type Date or Long. - LessThan *DocumentAttribute `locationName:"lessThan" type:"structure"` - - // Performs a less than or equals operation on two document attributes or metadata - // fields. Use with a document attribute of type Date or Long. - LessThanOrEquals *DocumentAttribute `locationName:"lessThanOrEquals" type:"structure"` - - // Performs a logical NOT operation on all supplied filters. - NotFilter *AttributeFilter `locationName:"notFilter" type:"structure"` - - // Performs a logical OR operation on all supplied filters. - OrAllFilters []*AttributeFilter `locationName:"orAllFilters" type:"list"` -} - -// 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 AttributeFilter) 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 AttributeFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttributeFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttributeFilter"} - if s.ContainsAll != nil { - if err := s.ContainsAll.Validate(); err != nil { - invalidParams.AddNested("ContainsAll", err.(request.ErrInvalidParams)) - } - } - if s.ContainsAny != nil { - if err := s.ContainsAny.Validate(); err != nil { - invalidParams.AddNested("ContainsAny", err.(request.ErrInvalidParams)) - } - } - if s.EqualsTo != nil { - if err := s.EqualsTo.Validate(); err != nil { - invalidParams.AddNested("EqualsTo", err.(request.ErrInvalidParams)) - } - } - if s.GreaterThan != nil { - if err := s.GreaterThan.Validate(); err != nil { - invalidParams.AddNested("GreaterThan", err.(request.ErrInvalidParams)) - } - } - if s.GreaterThanOrEquals != nil { - if err := s.GreaterThanOrEquals.Validate(); err != nil { - invalidParams.AddNested("GreaterThanOrEquals", err.(request.ErrInvalidParams)) - } - } - if s.LessThan != nil { - if err := s.LessThan.Validate(); err != nil { - invalidParams.AddNested("LessThan", err.(request.ErrInvalidParams)) - } - } - if s.LessThanOrEquals != nil { - if err := s.LessThanOrEquals.Validate(); err != nil { - invalidParams.AddNested("LessThanOrEquals", err.(request.ErrInvalidParams)) - } - } - if s.NotFilter != nil { - if err := s.NotFilter.Validate(); err != nil { - invalidParams.AddNested("NotFilter", err.(request.ErrInvalidParams)) - } - } - if s.OrAllFilters != nil { - for i, v := range s.OrAllFilters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OrAllFilters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAndAllFilters sets the AndAllFilters field's value. -func (s *AttributeFilter) SetAndAllFilters(v []*AttributeFilter) *AttributeFilter { - s.AndAllFilters = v - return s -} - -// SetContainsAll sets the ContainsAll field's value. -func (s *AttributeFilter) SetContainsAll(v *DocumentAttribute) *AttributeFilter { - s.ContainsAll = v - return s -} - -// SetContainsAny sets the ContainsAny field's value. -func (s *AttributeFilter) SetContainsAny(v *DocumentAttribute) *AttributeFilter { - s.ContainsAny = v - return s -} - -// SetEqualsTo sets the EqualsTo field's value. -func (s *AttributeFilter) SetEqualsTo(v *DocumentAttribute) *AttributeFilter { - s.EqualsTo = v - return s -} - -// SetGreaterThan sets the GreaterThan field's value. -func (s *AttributeFilter) SetGreaterThan(v *DocumentAttribute) *AttributeFilter { - s.GreaterThan = v - return s -} - -// SetGreaterThanOrEquals sets the GreaterThanOrEquals field's value. -func (s *AttributeFilter) SetGreaterThanOrEquals(v *DocumentAttribute) *AttributeFilter { - s.GreaterThanOrEquals = v - return s -} - -// SetLessThan sets the LessThan field's value. -func (s *AttributeFilter) SetLessThan(v *DocumentAttribute) *AttributeFilter { - s.LessThan = v - return s -} - -// SetLessThanOrEquals sets the LessThanOrEquals field's value. -func (s *AttributeFilter) SetLessThanOrEquals(v *DocumentAttribute) *AttributeFilter { - s.LessThanOrEquals = v - return s -} - -// SetNotFilter sets the NotFilter field's value. -func (s *AttributeFilter) SetNotFilter(v *AttributeFilter) *AttributeFilter { - s.NotFilter = v - return s -} - -// SetOrAllFilters sets the OrAllFilters field's value. -func (s *AttributeFilter) SetOrAllFilters(v []*AttributeFilter) *AttributeFilter { - s.OrAllFilters = v - return s -} - -// Information about the basic authentication credentials used to configure -// a plugin. -type BasicAuthConfiguration struct { - _ struct{} `type:"structure"` - - // The ARN of an IAM role used by Amazon Q to access the basic authentication - // credentials stored in a Secrets Manager secret. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The ARN of the Secrets Manager secret that stores the basic authentication - // credentials used for plugin configuration.. - // - // SecretArn is a required field - SecretArn *string `locationName:"secretArn" 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 BasicAuthConfiguration) 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 BasicAuthConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BasicAuthConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BasicAuthConfiguration"} - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.SecretArn == nil { - invalidParams.Add(request.NewErrParamRequired("SecretArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRoleArn sets the RoleArn field's value. -func (s *BasicAuthConfiguration) SetRoleArn(v string) *BasicAuthConfiguration { - s.RoleArn = &v - return s -} - -// SetSecretArn sets the SecretArn field's value. -func (s *BasicAuthConfiguration) SetSecretArn(v string) *BasicAuthConfiguration { - s.SecretArn = &v - return s -} - -type BatchDeleteDocumentInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source sync during which the documents were deleted. - DataSourceSyncId *string `locationName:"dataSourceSyncId" min:"36" type:"string"` - - // Documents deleted from the Amazon Q index. - // - // Documents is a required field - Documents []*DeleteDocument `locationName:"documents" type:"list" required:"true"` - - // The identifier of the Amazon Q index that contains the documents to delete. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 BatchDeleteDocumentInput) 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 BatchDeleteDocumentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchDeleteDocumentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchDeleteDocumentInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceSyncId != nil && len(*s.DataSourceSyncId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceSyncId", 36)) - } - if s.Documents == nil { - invalidParams.Add(request.NewErrParamRequired("Documents")) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.Documents != nil { - for i, v := range s.Documents { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Documents", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *BatchDeleteDocumentInput) SetApplicationId(v string) *BatchDeleteDocumentInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceSyncId sets the DataSourceSyncId field's value. -func (s *BatchDeleteDocumentInput) SetDataSourceSyncId(v string) *BatchDeleteDocumentInput { - s.DataSourceSyncId = &v - return s -} - -// SetDocuments sets the Documents field's value. -func (s *BatchDeleteDocumentInput) SetDocuments(v []*DeleteDocument) *BatchDeleteDocumentInput { - s.Documents = v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *BatchDeleteDocumentInput) SetIndexId(v string) *BatchDeleteDocumentInput { - s.IndexId = &v - return s -} - -type BatchDeleteDocumentOutput struct { - _ struct{} `type:"structure"` - - // A list of documents that couldn't be removed from the Amazon Q index. Each - // entry contains an error message that indicates why the document couldn't - // be removed from the index. - FailedDocuments []*FailedDocument `locationName:"failedDocuments" type:"list"` -} - -// 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 BatchDeleteDocumentOutput) 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 BatchDeleteDocumentOutput) GoString() string { - return s.String() -} - -// SetFailedDocuments sets the FailedDocuments field's value. -func (s *BatchDeleteDocumentOutput) SetFailedDocuments(v []*FailedDocument) *BatchDeleteDocumentOutput { - s.FailedDocuments = v - return s -} - -type BatchPutDocumentInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source sync during which the documents were added. - DataSourceSyncId *string `locationName:"dataSourceSyncId" min:"36" type:"string"` - - // One or more documents to add to the index. - // - // Documents is a required field - Documents []*Document `locationName:"documents" min:"1" type:"list" required:"true"` - - // The identifier of the Amazon Q index to add the documents to. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of an IAM role with permission to access your - // S3 bucket. - RoleArn *string `locationName:"roleArn" 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 BatchPutDocumentInput) 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 BatchPutDocumentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchPutDocumentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchPutDocumentInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceSyncId != nil && len(*s.DataSourceSyncId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceSyncId", 36)) - } - if s.Documents == nil { - invalidParams.Add(request.NewErrParamRequired("Documents")) - } - if s.Documents != nil && len(s.Documents) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Documents", 1)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.Documents != nil { - for i, v := range s.Documents { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Documents", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *BatchPutDocumentInput) SetApplicationId(v string) *BatchPutDocumentInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceSyncId sets the DataSourceSyncId field's value. -func (s *BatchPutDocumentInput) SetDataSourceSyncId(v string) *BatchPutDocumentInput { - s.DataSourceSyncId = &v - return s -} - -// SetDocuments sets the Documents field's value. -func (s *BatchPutDocumentInput) SetDocuments(v []*Document) *BatchPutDocumentInput { - s.Documents = v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *BatchPutDocumentInput) SetIndexId(v string) *BatchPutDocumentInput { - s.IndexId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *BatchPutDocumentInput) SetRoleArn(v string) *BatchPutDocumentInput { - s.RoleArn = &v - return s -} - -type BatchPutDocumentOutput struct { - _ struct{} `type:"structure"` - - // A list of documents that were not added to the Amazon Q index because the - // document failed a validation check. Each document contains an error message - // that indicates why the document couldn't be added to the index. - FailedDocuments []*FailedDocument `locationName:"failedDocuments" type:"list"` -} - -// 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 BatchPutDocumentOutput) 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 BatchPutDocumentOutput) GoString() string { - return s.String() -} - -// SetFailedDocuments sets the FailedDocuments field's value. -func (s *BatchPutDocumentOutput) SetFailedDocuments(v []*FailedDocument) *BatchPutDocumentOutput { - s.FailedDocuments = v - return s -} - -// Provides information about the phrases blocked from chat by your chat control -// configuration. -type BlockedPhrasesConfiguration struct { - _ struct{} `type:"structure"` - - // A list of phrases blocked from a Amazon Q web experience chat. - BlockedPhrases []*string `locationName:"blockedPhrases" type:"list"` - - // The configured custom message displayed to an end user informing them that - // they've used a blocked phrase during chat. - SystemMessageOverride *string `locationName:"systemMessageOverride" 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 BlockedPhrasesConfiguration) 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 BlockedPhrasesConfiguration) GoString() string { - return s.String() -} - -// SetBlockedPhrases sets the BlockedPhrases field's value. -func (s *BlockedPhrasesConfiguration) SetBlockedPhrases(v []*string) *BlockedPhrasesConfiguration { - s.BlockedPhrases = v - return s -} - -// SetSystemMessageOverride sets the SystemMessageOverride field's value. -func (s *BlockedPhrasesConfiguration) SetSystemMessageOverride(v string) *BlockedPhrasesConfiguration { - s.SystemMessageOverride = &v - return s -} - -// Updates a blocked phrases configuration in your Amazon Q application. -type BlockedPhrasesConfigurationUpdate struct { - _ struct{} `type:"structure"` - - // Creates or updates a blocked phrases configuration in your Amazon Q application. - BlockedPhrasesToCreateOrUpdate []*string `locationName:"blockedPhrasesToCreateOrUpdate" type:"list"` - - // Deletes a blocked phrases configuration in your Amazon Q application. - BlockedPhrasesToDelete []*string `locationName:"blockedPhrasesToDelete" type:"list"` - - // The configured custom message displayed to your end user when they use blocked - // phrase during chat. - SystemMessageOverride *string `locationName:"systemMessageOverride" 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 BlockedPhrasesConfigurationUpdate) 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 BlockedPhrasesConfigurationUpdate) GoString() string { - return s.String() -} - -// SetBlockedPhrasesToCreateOrUpdate sets the BlockedPhrasesToCreateOrUpdate field's value. -func (s *BlockedPhrasesConfigurationUpdate) SetBlockedPhrasesToCreateOrUpdate(v []*string) *BlockedPhrasesConfigurationUpdate { - s.BlockedPhrasesToCreateOrUpdate = v - return s -} - -// SetBlockedPhrasesToDelete sets the BlockedPhrasesToDelete field's value. -func (s *BlockedPhrasesConfigurationUpdate) SetBlockedPhrasesToDelete(v []*string) *BlockedPhrasesConfigurationUpdate { - s.BlockedPhrasesToDelete = v - return s -} - -// SetSystemMessageOverride sets the SystemMessageOverride field's value. -func (s *BlockedPhrasesConfigurationUpdate) SetSystemMessageOverride(v string) *BlockedPhrasesConfigurationUpdate { - s.SystemMessageOverride = &v - return s -} - -type ChatSyncInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application linked to the Amazon Q conversation. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // A list of files uploaded directly during chat. You can upload a maximum of - // 5 files of upto 10 MB each. - Attachments []*AttachmentInput_ `locationName:"attachments" min:"1" type:"list"` - - // Enables filtering of Amazon Q web experience responses based on document - // attributes or metadata fields. - AttributeFilter *AttributeFilter `locationName:"attributeFilter" type:"structure"` - - // A token that you provide to identify a chat request. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The identifier of the Amazon Q conversation. - ConversationId *string `locationName:"conversationId" min:"36" type:"string"` - - // The identifier of the previous end user text input message in a conversation. - ParentMessageId *string `locationName:"parentMessageId" min:"36" type:"string"` - - // The groups that a user associated with the chat input belongs to. - UserGroups []*string `location:"querystring" locationName:"userGroups" type:"list"` - - // The identifier of the user attached to the chat input. - // - // UserId is a required field - UserId *string `location:"querystring" locationName:"userId" min:"1" type:"string" required:"true"` - - // A end user message in a conversation. - UserMessage *string `locationName:"userMessage" min:"1" 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 ChatSyncInput) 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 ChatSyncInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChatSyncInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChatSyncInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.Attachments != nil && len(s.Attachments) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Attachments", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ConversationId != nil && len(*s.ConversationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConversationId", 36)) - } - if s.ParentMessageId != nil && len(*s.ParentMessageId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ParentMessageId", 36)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - if s.UserMessage != nil && len(*s.UserMessage) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserMessage", 1)) - } - if s.Attachments != nil { - for i, v := range s.Attachments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attachments", i), err.(request.ErrInvalidParams)) - } - } - } - if s.AttributeFilter != nil { - if err := s.AttributeFilter.Validate(); err != nil { - invalidParams.AddNested("AttributeFilter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ChatSyncInput) SetApplicationId(v string) *ChatSyncInput { - s.ApplicationId = &v - return s -} - -// SetAttachments sets the Attachments field's value. -func (s *ChatSyncInput) SetAttachments(v []*AttachmentInput_) *ChatSyncInput { - s.Attachments = v - return s -} - -// SetAttributeFilter sets the AttributeFilter field's value. -func (s *ChatSyncInput) SetAttributeFilter(v *AttributeFilter) *ChatSyncInput { - s.AttributeFilter = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *ChatSyncInput) SetClientToken(v string) *ChatSyncInput { - s.ClientToken = &v - return s -} - -// SetConversationId sets the ConversationId field's value. -func (s *ChatSyncInput) SetConversationId(v string) *ChatSyncInput { - s.ConversationId = &v - return s -} - -// SetParentMessageId sets the ParentMessageId field's value. -func (s *ChatSyncInput) SetParentMessageId(v string) *ChatSyncInput { - s.ParentMessageId = &v - return s -} - -// SetUserGroups sets the UserGroups field's value. -func (s *ChatSyncInput) SetUserGroups(v []*string) *ChatSyncInput { - s.UserGroups = v - return s -} - -// SetUserId sets the UserId field's value. -func (s *ChatSyncInput) SetUserId(v string) *ChatSyncInput { - s.UserId = &v - return s -} - -// SetUserMessage sets the UserMessage field's value. -func (s *ChatSyncInput) SetUserMessage(v string) *ChatSyncInput { - s.UserMessage = &v - return s -} - -type ChatSyncOutput struct { - _ struct{} `type:"structure"` - - // A request from Amazon Q to the end user for information Amazon Q needs to - // successfully complete a requested plugin action. - ActionReview *ActionReview `locationName:"actionReview" type:"structure"` - - // The identifier of the Amazon Q conversation. - ConversationId *string `locationName:"conversationId" min:"36" type:"string"` - - // A list of files which failed to upload during chat. - FailedAttachments []*AttachmentOutput_ `locationName:"failedAttachments" type:"list"` - - // The source documents used to generate the conversation response. - SourceAttributions []*SourceAttribution `locationName:"sourceAttributions" type:"list"` - - // An AI-generated message in a conversation. - SystemMessage *string `locationName:"systemMessage" min:"1" type:"string"` - - // The identifier of an Amazon Q AI generated message within the conversation. - SystemMessageId *string `locationName:"systemMessageId" min:"36" type:"string"` - - // The identifier of an Amazon Q end user text input message within the conversation. - UserMessageId *string `locationName:"userMessageId" min:"36" 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 ChatSyncOutput) 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 ChatSyncOutput) GoString() string { - return s.String() -} - -// SetActionReview sets the ActionReview field's value. -func (s *ChatSyncOutput) SetActionReview(v *ActionReview) *ChatSyncOutput { - s.ActionReview = v - return s -} - -// SetConversationId sets the ConversationId field's value. -func (s *ChatSyncOutput) SetConversationId(v string) *ChatSyncOutput { - s.ConversationId = &v - return s -} - -// SetFailedAttachments sets the FailedAttachments field's value. -func (s *ChatSyncOutput) SetFailedAttachments(v []*AttachmentOutput_) *ChatSyncOutput { - s.FailedAttachments = v - return s -} - -// SetSourceAttributions sets the SourceAttributions field's value. -func (s *ChatSyncOutput) SetSourceAttributions(v []*SourceAttribution) *ChatSyncOutput { - s.SourceAttributions = v - return s -} - -// SetSystemMessage sets the SystemMessage field's value. -func (s *ChatSyncOutput) SetSystemMessage(v string) *ChatSyncOutput { - s.SystemMessage = &v - return s -} - -// SetSystemMessageId sets the SystemMessageId field's value. -func (s *ChatSyncOutput) SetSystemMessageId(v string) *ChatSyncOutput { - s.SystemMessageId = &v - return s -} - -// SetUserMessageId sets the UserMessageId field's value. -func (s *ChatSyncOutput) SetUserMessageId(v string) *ChatSyncOutput { - s.UserMessageId = &v - return s -} - -// You are trying to perform an action that conflicts with the current status -// of your resource. Fix any inconsistences with your resources and try again. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The message describing a ConflictException. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The identifier of the resource affected. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" min:"1" type:"string" required:"true"` - - // The type of the resource affected. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" min:"1" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A rule for configuring how Amazon Q responds when it encounters a a blocked -// topic. You can configure a custom message to inform your end users that they -// have asked about a restricted topic and suggest any next steps they should -// take. -type ContentBlockerRule struct { - _ struct{} `type:"structure"` - - // The configured custom message displayed to an end user informing them that - // they've used a blocked phrase during chat. - SystemMessageOverride *string `locationName:"systemMessageOverride" 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 ContentBlockerRule) 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 ContentBlockerRule) GoString() string { - return s.String() -} - -// SetSystemMessageOverride sets the SystemMessageOverride field's value. -func (s *ContentBlockerRule) SetSystemMessageOverride(v string) *ContentBlockerRule { - s.SystemMessageOverride = &v - return s -} - -// Rules for retrieving content from data sources connected to a Amazon Q application -// for a specific topic control configuration. -type ContentRetrievalRule struct { - _ struct{} `type:"structure"` - - // Specifies data sources in a Amazon Q application to use for content generation. - EligibleDataSources []*EligibleDataSource `locationName:"eligibleDataSources" type:"list"` -} - -// 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 ContentRetrievalRule) 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 ContentRetrievalRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContentRetrievalRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContentRetrievalRule"} - if s.EligibleDataSources != nil { - for i, v := range s.EligibleDataSources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "EligibleDataSources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEligibleDataSources sets the EligibleDataSources field's value. -func (s *ContentRetrievalRule) SetEligibleDataSources(v []*EligibleDataSource) *ContentRetrievalRule { - s.EligibleDataSources = v - return s -} - -// A conversation in an Amazon Q application. -type Conversation struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q conversation. - ConversationId *string `locationName:"conversationId" min:"36" type:"string"` - - // The start time of the conversation. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` - - // The title of the conversation. - Title *string `locationName:"title" 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 Conversation) 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 Conversation) GoString() string { - return s.String() -} - -// SetConversationId sets the ConversationId field's value. -func (s *Conversation) SetConversationId(v string) *Conversation { - s.ConversationId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Conversation) SetStartTime(v time.Time) *Conversation { - s.StartTime = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *Conversation) SetTitle(v string) *Conversation { - s.Title = &v - return s -} - -type CreateApplicationInput struct { - _ struct{} `type:"structure"` - - // An option to allow end users to upload files directly during chat. - AttachmentsConfiguration *AttachmentsConfiguration `locationName:"attachmentsConfiguration" type:"structure"` - - // A token that you provide to identify the request to create your Amazon Q - // application. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description for the Amazon Q application. - Description *string `locationName:"description" type:"string"` - - // A name for the Amazon Q application. - // - // DisplayName is a required field - DisplayName *string `locationName:"displayName" min:"1" type:"string" required:"true"` - - // The identifier of the KMS key that is used to encrypt your data. Amazon Q - // doesn't support asymmetric keys. - EncryptionConfiguration *EncryptionConfiguration `locationName:"encryptionConfiguration" type:"structure"` - - // The Amazon Resource Name (ARN) of an IAM role with permissions to access - // your Amazon CloudWatch logs and metrics. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // A list of key-value pairs that identify or categorize your Amazon Q application. - // You can also use tags to help control access to the application. Tag keys - // and values can consist of Unicode letters, digits, white space, and any of - // the following symbols: _ . : / = + - @. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateApplicationInput) 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 CreateApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateApplicationInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DisplayName == nil { - invalidParams.Add(request.NewErrParamRequired("DisplayName")) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.AttachmentsConfiguration != nil { - if err := s.AttachmentsConfiguration.Validate(); err != nil { - invalidParams.AddNested("AttachmentsConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.EncryptionConfiguration != nil { - if err := s.EncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("EncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttachmentsConfiguration sets the AttachmentsConfiguration field's value. -func (s *CreateApplicationInput) SetAttachmentsConfiguration(v *AttachmentsConfiguration) *CreateApplicationInput { - s.AttachmentsConfiguration = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateApplicationInput) SetClientToken(v string) *CreateApplicationInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateApplicationInput) SetDescription(v string) *CreateApplicationInput { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *CreateApplicationInput) SetDisplayName(v string) *CreateApplicationInput { - s.DisplayName = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *CreateApplicationInput) SetEncryptionConfiguration(v *EncryptionConfiguration) *CreateApplicationInput { - s.EncryptionConfiguration = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateApplicationInput) SetRoleArn(v string) *CreateApplicationInput { - s.RoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateApplicationInput) SetTags(v []*Tag) *CreateApplicationInput { - s.Tags = v - return s -} - -type CreateApplicationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q application. - ApplicationArn *string `locationName:"applicationArn" type:"string"` - - // The identifier of the Amazon Q application. - ApplicationId *string `locationName:"applicationId" min:"36" 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 CreateApplicationOutput) 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 CreateApplicationOutput) GoString() string { - return s.String() -} - -// SetApplicationArn sets the ApplicationArn field's value. -func (s *CreateApplicationOutput) SetApplicationArn(v string) *CreateApplicationOutput { - s.ApplicationArn = &v - return s -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateApplicationOutput) SetApplicationId(v string) *CreateApplicationOutput { - s.ApplicationId = &v - return s -} - -type CreateIndexInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application using the index. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The capacity units you want to provision for your index. You can add and - // remove capacity to fit your usage needs. - CapacityConfiguration *IndexCapacityConfiguration `locationName:"capacityConfiguration" type:"structure"` - - // A token that you provide to identify the request to create an index. Multiple - // calls to the CreateIndex API with the same client token will create only - // one index. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A description for the Amazon Q index. - Description *string `locationName:"description" type:"string"` - - // A name for the Amazon Q index. - // - // DisplayName is a required field - DisplayName *string `locationName:"displayName" min:"1" type:"string" required:"true"` - - // A list of key-value pairs that identify or categorize the index. You can - // also use tags to help control access to the index. Tag keys and values can - // consist of Unicode letters, digits, white space, and any of the following - // symbols: _ . : / = + - @. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateIndexInput) 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 CreateIndexInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateIndexInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateIndexInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DisplayName == nil { - invalidParams.Add(request.NewErrParamRequired("DisplayName")) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.CapacityConfiguration != nil { - if err := s.CapacityConfiguration.Validate(); err != nil { - invalidParams.AddNested("CapacityConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateIndexInput) SetApplicationId(v string) *CreateIndexInput { - s.ApplicationId = &v - return s -} - -// SetCapacityConfiguration sets the CapacityConfiguration field's value. -func (s *CreateIndexInput) SetCapacityConfiguration(v *IndexCapacityConfiguration) *CreateIndexInput { - s.CapacityConfiguration = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateIndexInput) SetClientToken(v string) *CreateIndexInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateIndexInput) SetDescription(v string) *CreateIndexInput { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *CreateIndexInput) SetDisplayName(v string) *CreateIndexInput { - s.DisplayName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateIndexInput) SetTags(v []*Tag) *CreateIndexInput { - s.Tags = v - return s -} - -type CreateIndexOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of an Amazon Q index. - IndexArn *string `locationName:"indexArn" type:"string"` - - // The identifier for the Amazon Q index. - IndexId *string `locationName:"indexId" min:"36" 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 CreateIndexOutput) 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 CreateIndexOutput) GoString() string { - return s.String() -} - -// SetIndexArn sets the IndexArn field's value. -func (s *CreateIndexOutput) SetIndexArn(v string) *CreateIndexOutput { - s.IndexArn = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *CreateIndexOutput) SetIndexId(v string) *CreateIndexOutput { - s.IndexId = &v - return s -} - -type CreatePluginInput struct { - _ struct{} `type:"structure"` - - // The identifier of the application that will contain the plugin. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // Authentication configuration information for an Amazon Q plugin. - // - // AuthConfiguration is a required field - AuthConfiguration *PluginAuthConfiguration `locationName:"authConfiguration" type:"structure" required:"true"` - - // A token that you provide to identify the request to create your Amazon Q - // plugin. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A the name for your plugin. - // - // DisplayName is a required field - DisplayName *string `locationName:"displayName" min:"1" type:"string" required:"true"` - - // The source URL used for plugin configuration. - // - // ServerUrl is a required field - ServerUrl *string `locationName:"serverUrl" min:"1" type:"string" required:"true"` - - // A list of key-value pairs that identify or categorize the data source connector. - // You can also use tags to help control access to the data source connector. - // Tag keys and values can consist of Unicode letters, digits, white space, - // and any of the following symbols: _ . : / = + - @. - Tags []*Tag `locationName:"tags" type:"list"` - - // The type of plugin you want to create. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"PluginType"` -} - -// 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 CreatePluginInput) 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 CreatePluginInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePluginInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePluginInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.AuthConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("AuthConfiguration")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DisplayName == nil { - invalidParams.Add(request.NewErrParamRequired("DisplayName")) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.ServerUrl == nil { - invalidParams.Add(request.NewErrParamRequired("ServerUrl")) - } - if s.ServerUrl != nil && len(*s.ServerUrl) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServerUrl", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.AuthConfiguration != nil { - if err := s.AuthConfiguration.Validate(); err != nil { - invalidParams.AddNested("AuthConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreatePluginInput) SetApplicationId(v string) *CreatePluginInput { - s.ApplicationId = &v - return s -} - -// SetAuthConfiguration sets the AuthConfiguration field's value. -func (s *CreatePluginInput) SetAuthConfiguration(v *PluginAuthConfiguration) *CreatePluginInput { - s.AuthConfiguration = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreatePluginInput) SetClientToken(v string) *CreatePluginInput { - s.ClientToken = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *CreatePluginInput) SetDisplayName(v string) *CreatePluginInput { - s.DisplayName = &v - return s -} - -// SetServerUrl sets the ServerUrl field's value. -func (s *CreatePluginInput) SetServerUrl(v string) *CreatePluginInput { - s.ServerUrl = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreatePluginInput) SetTags(v []*Tag) *CreatePluginInput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CreatePluginInput) SetType(v string) *CreatePluginInput { - s.Type = &v - return s -} - -type CreatePluginOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of a plugin. - PluginArn *string `locationName:"pluginArn" type:"string"` - - // The identifier of the plugin created. - PluginId *string `locationName:"pluginId" min:"36" 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 CreatePluginOutput) 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 CreatePluginOutput) GoString() string { - return s.String() -} - -// SetPluginArn sets the PluginArn field's value. -func (s *CreatePluginOutput) SetPluginArn(v string) *CreatePluginOutput { - s.PluginArn = &v - return s -} - -// SetPluginId sets the PluginId field's value. -func (s *CreatePluginOutput) SetPluginId(v string) *CreatePluginOutput { - s.PluginId = &v - return s -} - -type CreateRetrieverInput struct { - _ struct{} `type:"structure"` - - // The identifier of your Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // A token that you provide to identify the request to create your Amazon Q - // application retriever. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Provides information on how the retriever used for your Amazon Q application - // is configured. - // - // Configuration is a required field - Configuration *RetrieverConfiguration `locationName:"configuration" type:"structure" required:"true"` - - // The name of your retriever. - // - // DisplayName is a required field - DisplayName *string `locationName:"displayName" min:"1" type:"string" required:"true"` - - // The ARN of an IAM role used by Amazon Q to access the basic authentication - // credentials stored in a Secrets Manager secret. - RoleArn *string `locationName:"roleArn" type:"string"` - - // A list of key-value pairs that identify or categorize the retriever. You - // can also use tags to help control access to the retriever. Tag keys and values - // can consist of Unicode letters, digits, white space, and any of the following - // symbols: _ . : / = + - @. - Tags []*Tag `locationName:"tags" type:"list"` - - // The type of retriever you are using. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RetrieverType"` -} - -// 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 CreateRetrieverInput) 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 CreateRetrieverInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRetrieverInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRetrieverInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Configuration == nil { - invalidParams.Add(request.NewErrParamRequired("Configuration")) - } - if s.DisplayName == nil { - invalidParams.Add(request.NewErrParamRequired("DisplayName")) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateRetrieverInput) SetApplicationId(v string) *CreateRetrieverInput { - s.ApplicationId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateRetrieverInput) SetClientToken(v string) *CreateRetrieverInput { - s.ClientToken = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *CreateRetrieverInput) SetConfiguration(v *RetrieverConfiguration) *CreateRetrieverInput { - s.Configuration = v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *CreateRetrieverInput) SetDisplayName(v string) *CreateRetrieverInput { - s.DisplayName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateRetrieverInput) SetRoleArn(v string) *CreateRetrieverInput { - s.RoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateRetrieverInput) SetTags(v []*Tag) *CreateRetrieverInput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateRetrieverInput) SetType(v string) *CreateRetrieverInput { - s.Type = &v - return s -} - -type CreateRetrieverOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of an IAM role associated with a retriever. - RetrieverArn *string `locationName:"retrieverArn" type:"string"` - - // The identifier of the retriever you are using. - RetrieverId *string `locationName:"retrieverId" min:"36" 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 CreateRetrieverOutput) 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 CreateRetrieverOutput) GoString() string { - return s.String() -} - -// SetRetrieverArn sets the RetrieverArn field's value. -func (s *CreateRetrieverOutput) SetRetrieverArn(v string) *CreateRetrieverOutput { - s.RetrieverArn = &v - return s -} - -// SetRetrieverId sets the RetrieverId field's value. -func (s *CreateRetrieverOutput) SetRetrieverId(v string) *CreateRetrieverOutput { - s.RetrieverId = &v - return s -} - -type CreateUserInput struct { - _ struct{} `type:"structure"` - - // The identifier of the application for which the user mapping will be created. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // A token that you provide to identify the request to create your Amazon Q - // user mapping. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The list of user aliases in the mapping. - UserAliases []*UserAlias `locationName:"userAliases" type:"list"` - - // The user emails attached to a user mapping. - // - // UserId is a required field - UserId *string `locationName:"userId" min:"1" 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 CreateUserInput) 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 CreateUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUserInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - if s.UserAliases != nil { - for i, v := range s.UserAliases { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UserAliases", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateUserInput) SetApplicationId(v string) *CreateUserInput { - s.ApplicationId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateUserInput) SetClientToken(v string) *CreateUserInput { - s.ClientToken = &v - return s -} - -// SetUserAliases sets the UserAliases field's value. -func (s *CreateUserInput) SetUserAliases(v []*UserAlias) *CreateUserInput { - s.UserAliases = v - return s -} - -// SetUserId sets the UserId field's value. -func (s *CreateUserInput) SetUserId(v string) *CreateUserInput { - s.UserId = &v - return s -} - -type CreateUserOutput 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 CreateUserOutput) 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 CreateUserOutput) GoString() string { - return s.String() -} - -type CreateWebExperienceInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q web experience. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // A token you provide to identify a request to create an Amazon Q web experience. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Determines whether sample prompts are enabled in the web experience for an - // end user. - SamplePromptsControlMode *string `locationName:"samplePromptsControlMode" type:"string" enum:"WebExperienceSamplePromptsControlMode"` - - // A subtitle to personalize your Amazon Q web experience. - Subtitle *string `locationName:"subtitle" type:"string"` - - // A list of key-value pairs that identify or categorize your Amazon Q web experience. - // You can also use tags to help control access to the web experience. Tag keys - // and values can consist of Unicode letters, digits, white space, and any of - // the following symbols: _ . : / = + - @. - Tags []*Tag `locationName:"tags" type:"list"` - - // The title for your Amazon Q web experience. - Title *string `locationName:"title" type:"string"` - - // The customized welcome message for end users of an Amazon Q web experience. - WelcomeMessage *string `locationName:"welcomeMessage" 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 CreateWebExperienceInput) 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 CreateWebExperienceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWebExperienceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWebExperienceInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateWebExperienceInput) SetApplicationId(v string) *CreateWebExperienceInput { - s.ApplicationId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateWebExperienceInput) SetClientToken(v string) *CreateWebExperienceInput { - s.ClientToken = &v - return s -} - -// SetSamplePromptsControlMode sets the SamplePromptsControlMode field's value. -func (s *CreateWebExperienceInput) SetSamplePromptsControlMode(v string) *CreateWebExperienceInput { - s.SamplePromptsControlMode = &v - return s -} - -// SetSubtitle sets the Subtitle field's value. -func (s *CreateWebExperienceInput) SetSubtitle(v string) *CreateWebExperienceInput { - s.Subtitle = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateWebExperienceInput) SetTags(v []*Tag) *CreateWebExperienceInput { - s.Tags = v - return s -} - -// SetTitle sets the Title field's value. -func (s *CreateWebExperienceInput) SetTitle(v string) *CreateWebExperienceInput { - s.Title = &v - return s -} - -// SetWelcomeMessage sets the WelcomeMessage field's value. -func (s *CreateWebExperienceInput) SetWelcomeMessage(v string) *CreateWebExperienceInput { - s.WelcomeMessage = &v - return s -} - -type CreateWebExperienceOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of an Amazon Q web experience. - WebExperienceArn *string `locationName:"webExperienceArn" type:"string"` - - // The identifier of the Amazon Q web experience. - WebExperienceId *string `locationName:"webExperienceId" min:"36" 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 CreateWebExperienceOutput) 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 CreateWebExperienceOutput) GoString() string { - return s.String() -} - -// SetWebExperienceArn sets the WebExperienceArn field's value. -func (s *CreateWebExperienceOutput) SetWebExperienceArn(v string) *CreateWebExperienceOutput { - s.WebExperienceArn = &v - return s -} - -// SetWebExperienceId sets the WebExperienceId field's value. -func (s *CreateWebExperienceOutput) SetWebExperienceId(v string) *CreateWebExperienceOutput { - s.WebExperienceId = &v - return s -} - -// A data source in an Amazon Q application. -type DataSource struct { - _ struct{} `type:"structure"` - - // The Unix timestamp when the Amazon Q data source was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The identifier of the Amazon Q data source. - DataSourceId *string `locationName:"dataSourceId" min:"36" type:"string"` - - // The name of the Amazon Q data source. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The status of the Amazon Q data source. - Status *string `locationName:"status" type:"string" enum:"DataSourceStatus"` - - // The type of the Amazon Q data source. - Type *string `locationName:"type" min:"1" type:"string"` - - // The Unix timestamp when the Amazon Q data source was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 DataSource) 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 DataSource) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DataSource) SetCreatedAt(v time.Time) *DataSource { - s.CreatedAt = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DataSource) SetDataSourceId(v string) *DataSource { - s.DataSourceId = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *DataSource) SetDisplayName(v string) *DataSource { - s.DisplayName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DataSource) SetStatus(v string) *DataSource { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *DataSource) SetType(v string) *DataSource { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DataSource) SetUpdatedAt(v time.Time) *DataSource { - s.UpdatedAt = &v - return s -} - -// Provides information about an Amazon Q data source connector synchronization -// job. -type DataSourceSyncJob struct { - _ struct{} `type:"structure"` - - // If the reason that the synchronization failed is due to an error with the - // underlying data source, this field contains a code that identifies the error. - DataSourceErrorCode *string `locationName:"dataSourceErrorCode" min:"1" type:"string"` - - // The Unix timestamp when the synchronization job completed. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // If the Status field is set to FAILED, the ErrorCode field indicates the reason - // the synchronization failed. - Error *ErrorDetail `locationName:"error" type:"structure"` - - // The identifier of a data source synchronization job. - ExecutionId *string `locationName:"executionId" min:"36" type:"string"` - - // Maps a batch delete document request to a specific data source sync job. - // This is optional and should only be supplied when documents are deleted by - // a data source connector. - Metrics *DataSourceSyncJobMetrics `locationName:"metrics" type:"structure"` - - // The Unix time stamp when the data source synchronization job started. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` - - // The status of the synchronization job. When the Status field is set to SUCCEEDED, - // the synchronization job is done. If the status code is FAILED, the ErrorCode - // and ErrorMessage fields give you the reason for the failure. - Status *string `locationName:"status" type:"string" enum:"DataSourceSyncJobStatus"` -} - -// 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 DataSourceSyncJob) 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 DataSourceSyncJob) GoString() string { - return s.String() -} - -// SetDataSourceErrorCode sets the DataSourceErrorCode field's value. -func (s *DataSourceSyncJob) SetDataSourceErrorCode(v string) *DataSourceSyncJob { - s.DataSourceErrorCode = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *DataSourceSyncJob) SetEndTime(v time.Time) *DataSourceSyncJob { - s.EndTime = &v - return s -} - -// SetError sets the Error field's value. -func (s *DataSourceSyncJob) SetError(v *ErrorDetail) *DataSourceSyncJob { - s.Error = v - return s -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *DataSourceSyncJob) SetExecutionId(v string) *DataSourceSyncJob { - s.ExecutionId = &v - return s -} - -// SetMetrics sets the Metrics field's value. -func (s *DataSourceSyncJob) SetMetrics(v *DataSourceSyncJobMetrics) *DataSourceSyncJob { - s.Metrics = v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DataSourceSyncJob) SetStartTime(v time.Time) *DataSourceSyncJob { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DataSourceSyncJob) SetStatus(v string) *DataSourceSyncJob { - s.Status = &v - return s -} - -// Maps a batch delete document request to a specific Amazon Q data source connector -// sync job. -type DataSourceSyncJobMetrics struct { - _ struct{} `type:"structure"` - - // The current count of documents added from the data source during the data - // source sync. - DocumentsAdded *string `locationName:"documentsAdded" type:"string"` - - // The current count of documents deleted from the data source during the data - // source sync. - DocumentsDeleted *string `locationName:"documentsDeleted" type:"string"` - - // The current count of documents that failed to sync from the data source during - // the data source sync. - DocumentsFailed *string `locationName:"documentsFailed" type:"string"` - - // The current count of documents modified in the data source during the data - // source sync. - DocumentsModified *string `locationName:"documentsModified" type:"string"` - - // The current count of documents crawled by the ongoing sync job in the data - // source. - DocumentsScanned *string `locationName:"documentsScanned" 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 DataSourceSyncJobMetrics) 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 DataSourceSyncJobMetrics) GoString() string { - return s.String() -} - -// SetDocumentsAdded sets the DocumentsAdded field's value. -func (s *DataSourceSyncJobMetrics) SetDocumentsAdded(v string) *DataSourceSyncJobMetrics { - s.DocumentsAdded = &v - return s -} - -// SetDocumentsDeleted sets the DocumentsDeleted field's value. -func (s *DataSourceSyncJobMetrics) SetDocumentsDeleted(v string) *DataSourceSyncJobMetrics { - s.DocumentsDeleted = &v - return s -} - -// SetDocumentsFailed sets the DocumentsFailed field's value. -func (s *DataSourceSyncJobMetrics) SetDocumentsFailed(v string) *DataSourceSyncJobMetrics { - s.DocumentsFailed = &v - return s -} - -// SetDocumentsModified sets the DocumentsModified field's value. -func (s *DataSourceSyncJobMetrics) SetDocumentsModified(v string) *DataSourceSyncJobMetrics { - s.DocumentsModified = &v - return s -} - -// SetDocumentsScanned sets the DocumentsScanned field's value. -func (s *DataSourceSyncJobMetrics) SetDocumentsScanned(v string) *DataSourceSyncJobMetrics { - s.DocumentsScanned = &v - return s -} - -// Provides configuration information needed to connect to an Amazon VPC (Virtual -// Private Cloud). -type DataSourceVpcConfiguration struct { - _ struct{} `type:"structure"` - - // A list of identifiers of security groups within your Amazon VPC. The security - // groups should enable Amazon Q to connect to the data source. - // - // SecurityGroupIds is a required field - SecurityGroupIds []*string `locationName:"securityGroupIds" min:"1" type:"list" required:"true"` - - // A list of identifiers for subnets within your Amazon VPC. The subnets should - // be able to connect to each other in the VPC, and they should have outgoing - // access to the Internet through a NAT device. - // - // SubnetIds is a required field - SubnetIds []*string `locationName:"subnetIds" type:"list" 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 DataSourceVpcConfiguration) 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 DataSourceVpcConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataSourceVpcConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataSourceVpcConfiguration"} - if s.SecurityGroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityGroupIds")) - } - if s.SecurityGroupIds != nil && len(s.SecurityGroupIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroupIds", 1)) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *DataSourceVpcConfiguration) SetSecurityGroupIds(v []*string) *DataSourceVpcConfiguration { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *DataSourceVpcConfiguration) SetSubnetIds(v []*string) *DataSourceVpcConfiguration { - s.SubnetIds = v - return s -} - -type DeleteApplicationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" 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 DeleteApplicationInput) 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 DeleteApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteApplicationInput) SetApplicationId(v string) *DeleteApplicationInput { - s.ApplicationId = &v - return s -} - -type DeleteApplicationOutput 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 DeleteApplicationOutput) 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 DeleteApplicationOutput) GoString() string { - return s.String() -} - -type DeleteChatControlsConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application the chat controls have been configured - // for. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" 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 DeleteChatControlsConfigurationInput) 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 DeleteChatControlsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteChatControlsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteChatControlsConfigurationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteChatControlsConfigurationInput) SetApplicationId(v string) *DeleteChatControlsConfigurationInput { - s.ApplicationId = &v - return s -} - -type DeleteChatControlsConfigurationOutput 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 DeleteChatControlsConfigurationOutput) 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 DeleteChatControlsConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteConversationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application associated with the conversation. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the Amazon Q web experience conversation being deleted. - // - // ConversationId is a required field - ConversationId *string `location:"uri" locationName:"conversationId" min:"36" type:"string" required:"true"` - - // The identifier of the user who is deleting the conversation. - // - // UserId is a required field - UserId *string `location:"querystring" locationName:"userId" min:"1" 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 DeleteConversationInput) 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 DeleteConversationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConversationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConversationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.ConversationId == nil { - invalidParams.Add(request.NewErrParamRequired("ConversationId")) - } - if s.ConversationId != nil && len(*s.ConversationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConversationId", 36)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteConversationInput) SetApplicationId(v string) *DeleteConversationInput { - s.ApplicationId = &v - return s -} - -// SetConversationId sets the ConversationId field's value. -func (s *DeleteConversationInput) SetConversationId(v string) *DeleteConversationInput { - s.ConversationId = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *DeleteConversationInput) SetUserId(v string) *DeleteConversationInput { - s.UserId = &v - return s -} - -type DeleteConversationOutput 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 DeleteConversationOutput) 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 DeleteConversationOutput) GoString() string { - return s.String() -} - -type DeleteDataSourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application used with the data source connector. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source connector that you want to delete. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" min:"36" type:"string" required:"true"` - - // The identifier of the index used with the data source connector. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 DeleteDataSourceInput) 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 DeleteDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDataSourceInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteDataSourceInput) SetApplicationId(v string) *DeleteDataSourceInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DeleteDataSourceInput) SetDataSourceId(v string) *DeleteDataSourceInput { - s.DataSourceId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *DeleteDataSourceInput) SetIndexId(v string) *DeleteDataSourceInput { - s.IndexId = &v - return s -} - -type DeleteDataSourceOutput 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 DeleteDataSourceOutput) 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 DeleteDataSourceOutput) GoString() string { - return s.String() -} - -// A document deleted from an Amazon Q data source connector. -type DeleteDocument struct { - _ struct{} `type:"structure"` - - // The identifier of the deleted document. - // - // DocumentId is a required field - DocumentId *string `locationName:"documentId" min:"1" 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 DeleteDocument) 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 DeleteDocument) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDocument) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDocument"} - if s.DocumentId == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentId")) - } - if s.DocumentId != nil && len(*s.DocumentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DocumentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDocumentId sets the DocumentId field's value. -func (s *DeleteDocument) SetDocumentId(v string) *DeleteDocument { - s.DocumentId = &v - return s -} - -type DeleteGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application in which the group mapping belongs. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source linked to the group - // - // A group can be tied to multiple data sources. You can delete a group from - // accessing documents in a certain data source. For example, the groups "Research", - // "Engineering", and "Sales and Marketing" are all tied to the company's documents - // stored in the data sources Confluence and Salesforce. You want to delete - // "Research" and "Engineering" groups from Salesforce, so that these groups - // cannot access customer-related documents stored in Salesforce. Only "Sales - // and Marketing" should access documents in the Salesforce data source. - DataSourceId *string `location:"querystring" locationName:"dataSourceId" min:"36" type:"string"` - - // The name of the group you want to delete. - // - // GroupName is a required field - GroupName *string `location:"uri" locationName:"groupName" min:"1" type:"string" required:"true"` - - // The identifier of the index you want to delete the group from. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 DeleteGroupInput) 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 DeleteGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGroupInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteGroupInput) SetApplicationId(v string) *DeleteGroupInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *DeleteGroupInput) SetDataSourceId(v string) *DeleteGroupInput { - s.DataSourceId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *DeleteGroupInput) SetGroupName(v string) *DeleteGroupInput { - s.GroupName = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *DeleteGroupInput) SetIndexId(v string) *DeleteGroupInput { - s.IndexId = &v - return s -} - -type DeleteGroupOutput 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 DeleteGroupOutput) 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 DeleteGroupOutput) GoString() string { - return s.String() -} - -type DeleteIndexInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application the Amazon Q index is linked to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the Amazon Q index. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 DeleteIndexInput) 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 DeleteIndexInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIndexInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIndexInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteIndexInput) SetApplicationId(v string) *DeleteIndexInput { - s.ApplicationId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *DeleteIndexInput) SetIndexId(v string) *DeleteIndexInput { - s.IndexId = &v - return s -} - -type DeleteIndexOutput 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 DeleteIndexOutput) 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 DeleteIndexOutput) GoString() string { - return s.String() -} - -type DeletePluginInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier the application attached to the Amazon Q plugin. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the plugin being deleted. - // - // PluginId is a required field - PluginId *string `location:"uri" locationName:"pluginId" min:"36" 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 DeletePluginInput) 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 DeletePluginInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePluginInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePluginInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.PluginId == nil { - invalidParams.Add(request.NewErrParamRequired("PluginId")) - } - if s.PluginId != nil && len(*s.PluginId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("PluginId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeletePluginInput) SetApplicationId(v string) *DeletePluginInput { - s.ApplicationId = &v - return s -} - -// SetPluginId sets the PluginId field's value. -func (s *DeletePluginInput) SetPluginId(v string) *DeletePluginInput { - s.PluginId = &v - return s -} - -type DeletePluginOutput 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 DeletePluginOutput) 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 DeletePluginOutput) GoString() string { - return s.String() -} - -type DeleteRetrieverInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application using the retriever. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the retriever being deleted. - // - // RetrieverId is a required field - RetrieverId *string `location:"uri" locationName:"retrieverId" min:"36" 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 DeleteRetrieverInput) 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 DeleteRetrieverInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRetrieverInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRetrieverInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.RetrieverId == nil { - invalidParams.Add(request.NewErrParamRequired("RetrieverId")) - } - if s.RetrieverId != nil && len(*s.RetrieverId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("RetrieverId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteRetrieverInput) SetApplicationId(v string) *DeleteRetrieverInput { - s.ApplicationId = &v - return s -} - -// SetRetrieverId sets the RetrieverId field's value. -func (s *DeleteRetrieverInput) SetRetrieverId(v string) *DeleteRetrieverInput { - s.RetrieverId = &v - return s -} - -type DeleteRetrieverOutput 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 DeleteRetrieverOutput) 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 DeleteRetrieverOutput) GoString() string { - return s.String() -} - -type DeleteUserInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application from which the user is being deleted. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The user email being deleted. - // - // UserId is a required field - UserId *string `location:"uri" locationName:"userId" min:"1" 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 DeleteUserInput) 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 DeleteUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUserInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteUserInput) SetApplicationId(v string) *DeleteUserInput { - s.ApplicationId = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *DeleteUserInput) SetUserId(v string) *DeleteUserInput { - s.UserId = &v - return s -} - -type DeleteUserOutput 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 DeleteUserOutput) 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 DeleteUserOutput) GoString() string { - return s.String() -} - -type DeleteWebExperienceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application linked to the Amazon Q web experience. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the Amazon Q web experience being deleted. - // - // WebExperienceId is a required field - WebExperienceId *string `location:"uri" locationName:"webExperienceId" min:"36" 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 DeleteWebExperienceInput) 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 DeleteWebExperienceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWebExperienceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWebExperienceInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.WebExperienceId == nil { - invalidParams.Add(request.NewErrParamRequired("WebExperienceId")) - } - if s.WebExperienceId != nil && len(*s.WebExperienceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WebExperienceId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteWebExperienceInput) SetApplicationId(v string) *DeleteWebExperienceInput { - s.ApplicationId = &v - return s -} - -// SetWebExperienceId sets the WebExperienceId field's value. -func (s *DeleteWebExperienceInput) SetWebExperienceId(v string) *DeleteWebExperienceInput { - s.WebExperienceId = &v - return s -} - -type DeleteWebExperienceOutput 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 DeleteWebExperienceOutput) 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 DeleteWebExperienceOutput) GoString() string { - return s.String() -} - -// A document in an Amazon Q application. -type Document struct { - _ struct{} `type:"structure"` - - // Configuration information for access permission to a document. - AccessConfiguration *AccessConfiguration `locationName:"accessConfiguration" type:"structure"` - - // Custom attributes to apply to the document for refining Amazon Q web experience - // responses. - Attributes []*DocumentAttribute `locationName:"attributes" min:"1" type:"list"` - - // The contents of the document. - Content *DocumentContent `locationName:"content" type:"structure"` - - // The file type of the document in the Blob field. - // - // If you want to index snippets or subsets of HTML documents instead of the - // entirety of the HTML documents, you add the HTML start and closing tags (content) - // around the content. - ContentType *string `locationName:"contentType" type:"string" enum:"ContentType"` - - // The configuration information for altering document metadata and content - // during the document ingestion process. - DocumentEnrichmentConfiguration *DocumentEnrichmentConfiguration `locationName:"documentEnrichmentConfiguration" type:"structure"` - - // The identifier of the document. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // The title of the document. - Title *string `locationName:"title" min:"1" 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 Document) 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 Document) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Document) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Document"} - if s.Attributes != nil && len(s.Attributes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Attributes", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Title != nil && len(*s.Title) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Title", 1)) - } - if s.AccessConfiguration != nil { - if err := s.AccessConfiguration.Validate(); err != nil { - invalidParams.AddNested("AccessConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Content != nil { - if err := s.Content.Validate(); err != nil { - invalidParams.AddNested("Content", err.(request.ErrInvalidParams)) - } - } - if s.DocumentEnrichmentConfiguration != nil { - if err := s.DocumentEnrichmentConfiguration.Validate(); err != nil { - invalidParams.AddNested("DocumentEnrichmentConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessConfiguration sets the AccessConfiguration field's value. -func (s *Document) SetAccessConfiguration(v *AccessConfiguration) *Document { - s.AccessConfiguration = v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *Document) SetAttributes(v []*DocumentAttribute) *Document { - s.Attributes = v - return s -} - -// SetContent sets the Content field's value. -func (s *Document) SetContent(v *DocumentContent) *Document { - s.Content = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *Document) SetContentType(v string) *Document { - s.ContentType = &v - return s -} - -// SetDocumentEnrichmentConfiguration sets the DocumentEnrichmentConfiguration field's value. -func (s *Document) SetDocumentEnrichmentConfiguration(v *DocumentEnrichmentConfiguration) *Document { - s.DocumentEnrichmentConfiguration = v - return s -} - -// SetId sets the Id field's value. -func (s *Document) SetId(v string) *Document { - s.Id = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *Document) SetTitle(v string) *Document { - s.Title = &v - return s -} - -// A document attribute or metadata field. -type DocumentAttribute struct { - _ struct{} `type:"structure"` - - // The identifier for the attribute. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The value of the attribute. - // - // Value is a required field - Value *DocumentAttributeValue `locationName:"value" type:"structure" 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 DocumentAttribute) 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 DocumentAttribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DocumentAttribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DocumentAttribute"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DocumentAttribute) SetName(v string) *DocumentAttribute { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *DocumentAttribute) SetValue(v *DocumentAttributeValue) *DocumentAttribute { - s.Value = v - return s -} - -// The condition used for the target document attribute or metadata field when -// ingesting documents into Amazon Q. You use this with DocumentAttributeTarget -// (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_DocumentAttributeTarget.html) -// to apply the condition. -// -// For example, you can create the 'Department' target field and have it prefill -// department names associated with the documents based on information in the -// 'Source_URI' field. Set the condition that if the 'Source_URI' field contains -// 'financial' in its URI value, then prefill the target field 'Department' -// with the target value 'Finance' for the document. -// -// Amazon Q can't create a target field if it has not already been created as -// an index field. After you create your index field, you can create a document -// metadata field using DocumentAttributeTarget. Amazon Q then will map your -// newly created metadata field to your index field. -type DocumentAttributeCondition struct { - _ struct{} `type:"structure"` - - // The identifier of the document attribute used for the condition. - // - // For example, 'Source_URI' could be an identifier for the attribute or metadata - // field that contains source URIs associated with the documents. - // - // Amazon Q currently doesn't support _document_body as an attribute key used - // for the condition. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // The identifier of the document attribute used for the condition. - // - // For example, 'Source_URI' could be an identifier for the attribute or metadata - // field that contains source URIs associated with the documents. - // - // Amazon Kendra currently does not support _document_body as an attribute key - // used for the condition. - // - // Operator is a required field - Operator *string `locationName:"operator" type:"string" required:"true" enum:"DocumentEnrichmentConditionOperator"` - - // The value of a document attribute. You can only provide one value for a document - // attribute. - Value *DocumentAttributeValue `locationName:"value" 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 DocumentAttributeCondition) 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 DocumentAttributeCondition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DocumentAttributeCondition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DocumentAttributeCondition"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Operator == nil { - invalidParams.Add(request.NewErrParamRequired("Operator")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *DocumentAttributeCondition) SetKey(v string) *DocumentAttributeCondition { - s.Key = &v - return s -} - -// SetOperator sets the Operator field's value. -func (s *DocumentAttributeCondition) SetOperator(v string) *DocumentAttributeCondition { - s.Operator = &v - return s -} - -// SetValue sets the Value field's value. -func (s *DocumentAttributeCondition) SetValue(v *DocumentAttributeValue) *DocumentAttributeCondition { - s.Value = v - return s -} - -// Configuration information for document attributes. Document attributes are -// metadata or fields associated with your documents. For example, the company -// department name associated with each document. -// -// For more information, see Understanding document attributes (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes.html). -type DocumentAttributeConfiguration struct { - _ struct{} `type:"structure"` - - // The name of the document attribute. - Name *string `locationName:"name" min:"1" type:"string"` - - // Information about whether the document attribute can be used by an end user - // to search for information on their web experience. - Search *string `locationName:"search" type:"string" enum:"Status"` - - // The type of document attribute. - Type *string `locationName:"type" type:"string" enum:"AttributeType"` -} - -// 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 DocumentAttributeConfiguration) 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 DocumentAttributeConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DocumentAttributeConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DocumentAttributeConfiguration"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DocumentAttributeConfiguration) SetName(v string) *DocumentAttributeConfiguration { - s.Name = &v - return s -} - -// SetSearch sets the Search field's value. -func (s *DocumentAttributeConfiguration) SetSearch(v string) *DocumentAttributeConfiguration { - s.Search = &v - return s -} - -// SetType sets the Type field's value. -func (s *DocumentAttributeConfiguration) SetType(v string) *DocumentAttributeConfiguration { - s.Type = &v - return s -} - -// The target document attribute or metadata field you want to alter when ingesting -// documents into Amazon Q. -// -// For example, you can delete all customer identification numbers associated -// with the documents, stored in the document metadata field called 'Customer_ID' -// by setting the target key as 'Customer_ID' and the deletion flag to TRUE. -// This removes all customer ID values in the field 'Customer_ID'. This would -// scrub personally identifiable information from each document's metadata. -// -// Amazon Q can't create a target field if it has not already been created as -// an index field. After you create your index field, you can create a document -// metadata field using DocumentAttributeTarget (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_DocumentAttributeTarget.html). -// Amazon Q will then map your newly created document attribute to your index -// field. -// -// You can also use this with DocumentAttributeCondition (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_DocumentAttributeCondition.html). -type DocumentAttributeTarget struct { - _ struct{} `type:"structure"` - - // TRUE to delete the existing target value for your specified target attribute - // key. You cannot create a target value and set this to TRUE. - AttributeValueOperator *string `locationName:"attributeValueOperator" type:"string" enum:"AttributeValueOperator"` - - // The identifier of the target document attribute or metadata field. For example, - // 'Department' could be an identifier for the target attribute or metadata - // field that includes the department names associated with the documents. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // The value of a document attribute. You can only provide one value for a document - // attribute. - Value *DocumentAttributeValue `locationName:"value" 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 DocumentAttributeTarget) 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 DocumentAttributeTarget) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DocumentAttributeTarget) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DocumentAttributeTarget"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeValueOperator sets the AttributeValueOperator field's value. -func (s *DocumentAttributeTarget) SetAttributeValueOperator(v string) *DocumentAttributeTarget { - s.AttributeValueOperator = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DocumentAttributeTarget) SetKey(v string) *DocumentAttributeTarget { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *DocumentAttributeTarget) SetValue(v *DocumentAttributeValue) *DocumentAttributeTarget { - s.Value = v - return s -} - -// The value of a document attribute. You can only provide one value for a document -// attribute. -type DocumentAttributeValue struct { - _ struct{} `type:"structure"` - - // A date expressed as an ISO 8601 string. - // - // It's important for the time zone to be included in the ISO 8601 date-time - // format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time - // format for March 25th 2012 at 12:30PM (plus 10 seconds) in Central European - // Time. - DateValue *time.Time `locationName:"dateValue" type:"timestamp"` - - // A long integer value. - LongValue *int64 `locationName:"longValue" type:"long"` - - // A list of strings. - StringListValue []*string `locationName:"stringListValue" type:"list"` - - // A string. - StringValue *string `locationName:"stringValue" 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 DocumentAttributeValue) 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 DocumentAttributeValue) GoString() string { - return s.String() -} - -// SetDateValue sets the DateValue field's value. -func (s *DocumentAttributeValue) SetDateValue(v time.Time) *DocumentAttributeValue { - s.DateValue = &v - return s -} - -// SetLongValue sets the LongValue field's value. -func (s *DocumentAttributeValue) SetLongValue(v int64) *DocumentAttributeValue { - s.LongValue = &v - return s -} - -// SetStringListValue sets the StringListValue field's value. -func (s *DocumentAttributeValue) SetStringListValue(v []*string) *DocumentAttributeValue { - s.StringListValue = v - return s -} - -// SetStringValue sets the StringValue field's value. -func (s *DocumentAttributeValue) SetStringValue(v string) *DocumentAttributeValue { - s.StringValue = &v - return s -} - -// The contents of a document. -type DocumentContent struct { - _ struct{} `type:"structure"` - - // The contents of the document. Documents passed to the blob parameter must - // be base64 encoded. Your code might not need to encode the document file bytes - // if you're using an Amazon Web Services SDK to call Amazon Q APIs. If you - // are calling the Amazon Q endpoint directly using REST, you must base64 encode - // the contents before sending. - // Blob is automatically base64 encoded/decoded by the SDK. - Blob []byte `locationName:"blob" type:"blob"` - - // The path to the document in an Amazon S3 bucket. - S3 *S3 `locationName:"s3" 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 DocumentContent) 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 DocumentContent) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DocumentContent) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DocumentContent"} - if s.S3 != nil { - if err := s.S3.Validate(); err != nil { - invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBlob sets the Blob field's value. -func (s *DocumentContent) SetBlob(v []byte) *DocumentContent { - s.Blob = v - return s -} - -// SetS3 sets the S3 field's value. -func (s *DocumentContent) SetS3(v *S3) *DocumentContent { - s.S3 = v - return s -} - -// The details of a document within an Amazon Q index. -type DocumentDetails struct { - _ struct{} `type:"structure"` - - // The timestamp for when the document was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The identifier of the document. - DocumentId *string `locationName:"documentId" min:"1" type:"string"` - - // An error message associated with the document. - Error *ErrorDetail `locationName:"error" type:"structure"` - - // The current status of the document. - Status *string `locationName:"status" type:"string" enum:"DocumentStatus"` - - // The timestamp for when the document was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 DocumentDetails) 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 DocumentDetails) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DocumentDetails) SetCreatedAt(v time.Time) *DocumentDetails { - s.CreatedAt = &v - return s -} - -// SetDocumentId sets the DocumentId field's value. -func (s *DocumentDetails) SetDocumentId(v string) *DocumentDetails { - s.DocumentId = &v - return s -} - -// SetError sets the Error field's value. -func (s *DocumentDetails) SetError(v *ErrorDetail) *DocumentDetails { - s.Error = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DocumentDetails) SetStatus(v string) *DocumentDetails { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DocumentDetails) SetUpdatedAt(v time.Time) *DocumentDetails { - s.UpdatedAt = &v - return s -} - -// Provides the configuration information for altering document metadata and -// content during the document ingestion process. -// -// For more information, see Custom document enrichment (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). -type DocumentEnrichmentConfiguration struct { - _ struct{} `type:"structure"` - - // Configuration information to alter document attributes or metadata fields - // and content when ingesting documents into Amazon Q. - InlineConfigurations []*InlineDocumentEnrichmentConfiguration `locationName:"inlineConfigurations" min:"1" type:"list"` - - // Provides the configuration information for invoking a Lambda function in - // Lambda to alter document metadata and content when ingesting documents into - // Amazon Q. - // - // You can configure your Lambda function using PreExtractionHookConfiguration - // (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_CustomDocumentEnrichmentConfiguration.html) - // if you want to apply advanced alterations on the original or raw documents. - // - // If you want to apply advanced alterations on the Amazon Q structured documents, - // you must configure your Lambda function using PostExtractionHookConfiguration - // (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_CustomDocumentEnrichmentConfiguration.html). - // - // You can only invoke one Lambda function. However, this function can invoke - // other functions it requires. - // - // For more information, see Custom document enrichment (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - PostExtractionHookConfiguration *HookConfiguration `locationName:"postExtractionHookConfiguration" type:"structure"` - - // Provides the configuration information for invoking a Lambda function in - // Lambda to alter document metadata and content when ingesting documents into - // Amazon Q. - // - // You can configure your Lambda function using PreExtractionHookConfiguration - // (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_CustomDocumentEnrichmentConfiguration.html) - // if you want to apply advanced alterations on the original or raw documents. - // - // If you want to apply advanced alterations on the Amazon Q structured documents, - // you must configure your Lambda function using PostExtractionHookConfiguration - // (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_CustomDocumentEnrichmentConfiguration.html). - // - // You can only invoke one Lambda function. However, this function can invoke - // other functions it requires. - // - // For more information, see Custom document enrichment (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - PreExtractionHookConfiguration *HookConfiguration `locationName:"preExtractionHookConfiguration" 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 DocumentEnrichmentConfiguration) 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 DocumentEnrichmentConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DocumentEnrichmentConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DocumentEnrichmentConfiguration"} - if s.InlineConfigurations != nil && len(s.InlineConfigurations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InlineConfigurations", 1)) - } - if s.InlineConfigurations != nil { - for i, v := range s.InlineConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InlineConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - if s.PostExtractionHookConfiguration != nil { - if err := s.PostExtractionHookConfiguration.Validate(); err != nil { - invalidParams.AddNested("PostExtractionHookConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.PreExtractionHookConfiguration != nil { - if err := s.PreExtractionHookConfiguration.Validate(); err != nil { - invalidParams.AddNested("PreExtractionHookConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInlineConfigurations sets the InlineConfigurations field's value. -func (s *DocumentEnrichmentConfiguration) SetInlineConfigurations(v []*InlineDocumentEnrichmentConfiguration) *DocumentEnrichmentConfiguration { - s.InlineConfigurations = v - return s -} - -// SetPostExtractionHookConfiguration sets the PostExtractionHookConfiguration field's value. -func (s *DocumentEnrichmentConfiguration) SetPostExtractionHookConfiguration(v *HookConfiguration) *DocumentEnrichmentConfiguration { - s.PostExtractionHookConfiguration = v - return s -} - -// SetPreExtractionHookConfiguration sets the PreExtractionHookConfiguration field's value. -func (s *DocumentEnrichmentConfiguration) SetPreExtractionHookConfiguration(v *HookConfiguration) *DocumentEnrichmentConfiguration { - s.PreExtractionHookConfiguration = v - return s -} - -// The identifier of the data source Amazon Q will generate responses from. -type EligibleDataSource struct { - _ struct{} `type:"structure"` - - // The identifier of the data source. - DataSourceId *string `locationName:"dataSourceId" min:"36" type:"string"` - - // The identifier of the index the data source is attached to. - IndexId *string `locationName:"indexId" min:"36" 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 EligibleDataSource) 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 EligibleDataSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EligibleDataSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EligibleDataSource"} - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *EligibleDataSource) SetDataSourceId(v string) *EligibleDataSource { - s.DataSourceId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *EligibleDataSource) SetIndexId(v string) *EligibleDataSource { - s.IndexId = &v - return s -} - -// Provides the identifier of the KMS key used to encrypt data indexed by Amazon -// Q. Amazon Q doesn't support asymmetric keys. -type EncryptionConfiguration struct { - _ struct{} `type:"structure"` - - // The identifier of the KMS key. Amazon Q doesn't support asymmetric keys. - // - // KmsKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EncryptionConfiguration's - // String and GoString methods. - KmsKeyId *string `locationName:"kmsKeyId" min:"1" type:"string" sensitive:"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 EncryptionConfiguration) 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 EncryptionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncryptionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncryptionConfiguration"} - if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *EncryptionConfiguration) SetKmsKeyId(v string) *EncryptionConfiguration { - s.KmsKeyId = &v - return s -} - -// Provides information about a data source sync error. -type ErrorDetail struct { - _ struct{} `type:"structure"` - - // The code associated with the data source sync error. - ErrorCode *string `locationName:"errorCode" type:"string" enum:"ErrorCode"` - - // The message explaining the data source sync error. - ErrorMessage *string `locationName:"errorMessage" min:"1" 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 ErrorDetail) 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 ErrorDetail) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *ErrorDetail) SetErrorCode(v string) *ErrorDetail { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *ErrorDetail) SetErrorMessage(v string) *ErrorDetail { - s.ErrorMessage = &v - return s -} - -// A list of documents that could not be removed from an Amazon Q index. Each -// entry contains an error message that indicates why the document couldn't -// be removed from the index. -type FailedDocument struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q data source connector that contains the failed - // document. - DataSourceId *string `locationName:"dataSourceId" min:"36" type:"string"` - - // An explanation for why the document couldn't be removed from the index. - Error *ErrorDetail `locationName:"error" type:"structure"` - - // The identifier of the document that couldn't be removed from the Amazon Q - // index. - Id *string `locationName:"id" min:"1" 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 FailedDocument) 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 FailedDocument) GoString() string { - return s.String() -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *FailedDocument) SetDataSourceId(v string) *FailedDocument { - s.DataSourceId = &v - return s -} - -// SetError sets the Error field's value. -func (s *FailedDocument) SetError(v *ErrorDetail) *FailedDocument { - s.Error = v - return s -} - -// SetId sets the Id field's value. -func (s *FailedDocument) SetId(v string) *FailedDocument { - s.Id = &v - return s -} - -type GetApplicationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" 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 GetApplicationInput) 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 GetApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetApplicationInput) SetApplicationId(v string) *GetApplicationInput { - s.ApplicationId = &v - return s -} - -type GetApplicationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q application. - ApplicationArn *string `locationName:"applicationArn" type:"string"` - - // The identifier of the Amazon Q application. - ApplicationId *string `locationName:"applicationId" min:"36" type:"string"` - - // Settings for whether end users can upload files directly during chat. - AttachmentsConfiguration *AppliedAttachmentsConfiguration `locationName:"attachmentsConfiguration" type:"structure"` - - // The Unix timestamp when the Amazon Q application was last updated. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // A description for the Amazon Q application. - Description *string `locationName:"description" type:"string"` - - // The name of the Amazon Q application. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The identifier of the Amazon Web Services KMS key that is used to encrypt - // your data. Amazon Q doesn't support asymmetric keys. - EncryptionConfiguration *EncryptionConfiguration `locationName:"encryptionConfiguration" type:"structure"` - - // If the Status field is set to ERROR, the ErrorMessage field contains a description - // of the error that caused the synchronization to fail. - Error *ErrorDetail `locationName:"error" type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM with permissions to access your - // CloudWatch logs and metrics. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The status of the Amazon Q application. - Status *string `locationName:"status" type:"string" enum:"ApplicationStatus"` - - // The Unix timestamp when the Amazon Q application was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 GetApplicationOutput) 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 GetApplicationOutput) GoString() string { - return s.String() -} - -// SetApplicationArn sets the ApplicationArn field's value. -func (s *GetApplicationOutput) SetApplicationArn(v string) *GetApplicationOutput { - s.ApplicationArn = &v - return s -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetApplicationOutput) SetApplicationId(v string) *GetApplicationOutput { - s.ApplicationId = &v - return s -} - -// SetAttachmentsConfiguration sets the AttachmentsConfiguration field's value. -func (s *GetApplicationOutput) SetAttachmentsConfiguration(v *AppliedAttachmentsConfiguration) *GetApplicationOutput { - s.AttachmentsConfiguration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetApplicationOutput) SetCreatedAt(v time.Time) *GetApplicationOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetApplicationOutput) SetDescription(v string) *GetApplicationOutput { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *GetApplicationOutput) SetDisplayName(v string) *GetApplicationOutput { - s.DisplayName = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *GetApplicationOutput) SetEncryptionConfiguration(v *EncryptionConfiguration) *GetApplicationOutput { - s.EncryptionConfiguration = v - return s -} - -// SetError sets the Error field's value. -func (s *GetApplicationOutput) SetError(v *ErrorDetail) *GetApplicationOutput { - s.Error = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetApplicationOutput) SetRoleArn(v string) *GetApplicationOutput { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetApplicationOutput) SetStatus(v string) *GetApplicationOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetApplicationOutput) SetUpdatedAt(v time.Time) *GetApplicationOutput { - s.UpdatedAt = &v - return s -} - -type GetChatControlsConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application for which the chat controls are configured. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The maximum number of configured chat controls to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of Amazon Q chat controls configured. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 GetChatControlsConfigurationInput) 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 GetChatControlsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChatControlsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChatControlsConfigurationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetChatControlsConfigurationInput) SetApplicationId(v string) *GetChatControlsConfigurationInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetChatControlsConfigurationInput) SetMaxResults(v int64) *GetChatControlsConfigurationInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetChatControlsConfigurationInput) SetNextToken(v string) *GetChatControlsConfigurationInput { - s.NextToken = &v - return s -} - -type GetChatControlsConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The phrases blocked from chat by your chat control configuration. - BlockedPhrases *BlockedPhrasesConfiguration `locationName:"blockedPhrases" type:"structure"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of Amazon Q chat controls configured. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The response scope configured for a Amazon Q application. This determines - // whether your application uses its retrieval augmented generation (RAG) system - // to generate answers only from your enterprise data, or also uses the large - // language models (LLM) knowledge to respons to end user questions in chat. - ResponseScope *string `locationName:"responseScope" type:"string" enum:"ResponseScope"` - - // The topic specific controls configured for a Amazon Q application. - TopicConfigurations []*TopicConfiguration `locationName:"topicConfigurations" type:"list"` -} - -// 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 GetChatControlsConfigurationOutput) 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 GetChatControlsConfigurationOutput) GoString() string { - return s.String() -} - -// SetBlockedPhrases sets the BlockedPhrases field's value. -func (s *GetChatControlsConfigurationOutput) SetBlockedPhrases(v *BlockedPhrasesConfiguration) *GetChatControlsConfigurationOutput { - s.BlockedPhrases = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetChatControlsConfigurationOutput) SetNextToken(v string) *GetChatControlsConfigurationOutput { - s.NextToken = &v - return s -} - -// SetResponseScope sets the ResponseScope field's value. -func (s *GetChatControlsConfigurationOutput) SetResponseScope(v string) *GetChatControlsConfigurationOutput { - s.ResponseScope = &v - return s -} - -// SetTopicConfigurations sets the TopicConfigurations field's value. -func (s *GetChatControlsConfigurationOutput) SetTopicConfigurations(v []*TopicConfiguration) *GetChatControlsConfigurationOutput { - s.TopicConfigurations = v - return s -} - -type GetDataSourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source connector. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" min:"36" type:"string" required:"true"` - - // The identfier of the index used with the data source connector. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 GetDataSourceInput) 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 GetDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataSourceInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetDataSourceInput) SetApplicationId(v string) *GetDataSourceInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *GetDataSourceInput) SetDataSourceId(v string) *GetDataSourceInput { - s.DataSourceId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *GetDataSourceInput) SetIndexId(v string) *GetDataSourceInput { - s.IndexId = &v - return s -} - -type GetDataSourceOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application. - ApplicationId *string `locationName:"applicationId" min:"36" type:"string"` - - // The Unix timestamp when the data source connector was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The Amazon Resource Name (ARN) of the data source. - DataSourceArn *string `locationName:"dataSourceArn" type:"string"` - - // The identifier of the data source connector. - DataSourceId *string `locationName:"dataSourceId" min:"36" type:"string"` - - // The description for the data source connector. - Description *string `locationName:"description" type:"string"` - - // The name for the data source connector. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // Provides the configuration information for altering document metadata and - // content during the document ingestion process. - // - // For more information, see Custom document enrichment (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - DocumentEnrichmentConfiguration *DocumentEnrichmentConfiguration `locationName:"documentEnrichmentConfiguration" type:"structure"` - - // When the Status field value is FAILED, the ErrorMessage field contains a - // description of the error that caused the data source connector to fail. - Error *ErrorDetail `locationName:"error" type:"structure"` - - // The identifier of the index linked to the data source connector. - IndexId *string `locationName:"indexId" min:"36" type:"string"` - - // The Amazon Resource Name (ARN) of the role with permission to access the - // data source and required resources. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The current status of the data source connector. When the Status field value - // is FAILED, the ErrorMessage field contains a description of the error that - // caused the data source connector to fail. - Status *string `locationName:"status" type:"string" enum:"DataSourceStatus"` - - // The schedule for Amazon Q to update the index. - SyncSchedule *string `locationName:"syncSchedule" type:"string"` - - // The type of the data source connector. For example, S3. - Type *string `locationName:"type" min:"1" type:"string"` - - // The Unix timestamp when the data source connector was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // Configuration information for an Amazon VPC (Virtual Private Cloud) to connect - // to your data source. - VpcConfiguration *DataSourceVpcConfiguration `locationName:"vpcConfiguration" 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 GetDataSourceOutput) 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 GetDataSourceOutput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetDataSourceOutput) SetApplicationId(v string) *GetDataSourceOutput { - s.ApplicationId = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetDataSourceOutput) SetCreatedAt(v time.Time) *GetDataSourceOutput { - s.CreatedAt = &v - return s -} - -// SetDataSourceArn sets the DataSourceArn field's value. -func (s *GetDataSourceOutput) SetDataSourceArn(v string) *GetDataSourceOutput { - s.DataSourceArn = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *GetDataSourceOutput) SetDataSourceId(v string) *GetDataSourceOutput { - s.DataSourceId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetDataSourceOutput) SetDescription(v string) *GetDataSourceOutput { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *GetDataSourceOutput) SetDisplayName(v string) *GetDataSourceOutput { - s.DisplayName = &v - return s -} - -// SetDocumentEnrichmentConfiguration sets the DocumentEnrichmentConfiguration field's value. -func (s *GetDataSourceOutput) SetDocumentEnrichmentConfiguration(v *DocumentEnrichmentConfiguration) *GetDataSourceOutput { - s.DocumentEnrichmentConfiguration = v - return s -} - -// SetError sets the Error field's value. -func (s *GetDataSourceOutput) SetError(v *ErrorDetail) *GetDataSourceOutput { - s.Error = v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *GetDataSourceOutput) SetIndexId(v string) *GetDataSourceOutput { - s.IndexId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetDataSourceOutput) SetRoleArn(v string) *GetDataSourceOutput { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetDataSourceOutput) SetStatus(v string) *GetDataSourceOutput { - s.Status = &v - return s -} - -// SetSyncSchedule sets the SyncSchedule field's value. -func (s *GetDataSourceOutput) SetSyncSchedule(v string) *GetDataSourceOutput { - s.SyncSchedule = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetDataSourceOutput) SetType(v string) *GetDataSourceOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetDataSourceOutput) SetUpdatedAt(v time.Time) *GetDataSourceOutput { - s.UpdatedAt = &v - return s -} - -// SetVpcConfiguration sets the VpcConfiguration field's value. -func (s *GetDataSourceOutput) SetVpcConfiguration(v *DataSourceVpcConfiguration) *GetDataSourceOutput { - s.VpcConfiguration = v - return s -} - -type GetGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application id the group is attached to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source the group is attached to. - DataSourceId *string `location:"querystring" locationName:"dataSourceId" min:"36" type:"string"` - - // The name of the group. - // - // GroupName is a required field - GroupName *string `location:"uri" locationName:"groupName" min:"1" type:"string" required:"true"` - - // The identifier of the index the group is attached to. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 GetGroupInput) 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 GetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGroupInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetGroupInput) SetApplicationId(v string) *GetGroupInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *GetGroupInput) SetDataSourceId(v string) *GetGroupInput { - s.DataSourceId = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GetGroupInput) SetGroupName(v string) *GetGroupInput { - s.GroupName = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *GetGroupInput) SetIndexId(v string) *GetGroupInput { - s.IndexId = &v - return s -} - -type GetGroupOutput struct { - _ struct{} `type:"structure"` - - // The current status of the group. - Status *GroupStatusDetail `locationName:"status" type:"structure"` - - // The status history of the group. - StatusHistory []*GroupStatusDetail `locationName:"statusHistory" type:"list"` -} - -// 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 GetGroupOutput) 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 GetGroupOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *GetGroupOutput) SetStatus(v *GroupStatusDetail) *GetGroupOutput { - s.Status = v - return s -} - -// SetStatusHistory sets the StatusHistory field's value. -func (s *GetGroupOutput) SetStatusHistory(v []*GroupStatusDetail) *GetGroupOutput { - s.StatusHistory = v - return s -} - -type GetIndexInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application connected to the index. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the Amazon Q index you want information on. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 GetIndexInput) 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 GetIndexInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIndexInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIndexInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetIndexInput) SetApplicationId(v string) *GetIndexInput { - s.ApplicationId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *GetIndexInput) SetIndexId(v string) *GetIndexInput { - s.IndexId = &v - return s -} - -type GetIndexOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application associated with the index. - ApplicationId *string `locationName:"applicationId" min:"36" type:"string"` - - // The storage capacity units chosen for your Amazon Q index. - CapacityConfiguration *IndexCapacityConfiguration `locationName:"capacityConfiguration" type:"structure"` - - // The Unix timestamp when the Amazon Q index was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The description for the Amazon Q index. - Description *string `locationName:"description" type:"string"` - - // The name of the Amazon Q index. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // Configuration information for document attributes or metadata. Document metadata - // are fields associated with your documents. For example, the company department - // name associated with each document. For more information, see Understanding - // document attributes (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes). - DocumentAttributeConfigurations []*DocumentAttributeConfiguration `locationName:"documentAttributeConfigurations" min:"1" type:"list"` - - // When the Status field value is FAILED, the ErrorMessage field contains a - // message that explains why. - Error *ErrorDetail `locationName:"error" type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q index. - IndexArn *string `locationName:"indexArn" type:"string"` - - // The identifier of the Amazon Q index. - IndexId *string `locationName:"indexId" min:"36" type:"string"` - - // Provides information about the number of documents indexed. - IndexStatistics *IndexStatistics `locationName:"indexStatistics" type:"structure"` - - // The current status of the index. When the value is ACTIVE, the index is ready - // for use. If the Status field value is FAILED, the ErrorMessage field contains - // a message that explains why. - Status *string `locationName:"status" type:"string" enum:"IndexStatus"` - - // The Unix timestamp when the Amazon Q index was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 GetIndexOutput) 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 GetIndexOutput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetIndexOutput) SetApplicationId(v string) *GetIndexOutput { - s.ApplicationId = &v - return s -} - -// SetCapacityConfiguration sets the CapacityConfiguration field's value. -func (s *GetIndexOutput) SetCapacityConfiguration(v *IndexCapacityConfiguration) *GetIndexOutput { - s.CapacityConfiguration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetIndexOutput) SetCreatedAt(v time.Time) *GetIndexOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetIndexOutput) SetDescription(v string) *GetIndexOutput { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *GetIndexOutput) SetDisplayName(v string) *GetIndexOutput { - s.DisplayName = &v - return s -} - -// SetDocumentAttributeConfigurations sets the DocumentAttributeConfigurations field's value. -func (s *GetIndexOutput) SetDocumentAttributeConfigurations(v []*DocumentAttributeConfiguration) *GetIndexOutput { - s.DocumentAttributeConfigurations = v - return s -} - -// SetError sets the Error field's value. -func (s *GetIndexOutput) SetError(v *ErrorDetail) *GetIndexOutput { - s.Error = v - return s -} - -// SetIndexArn sets the IndexArn field's value. -func (s *GetIndexOutput) SetIndexArn(v string) *GetIndexOutput { - s.IndexArn = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *GetIndexOutput) SetIndexId(v string) *GetIndexOutput { - s.IndexId = &v - return s -} - -// SetIndexStatistics sets the IndexStatistics field's value. -func (s *GetIndexOutput) SetIndexStatistics(v *IndexStatistics) *GetIndexOutput { - s.IndexStatistics = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetIndexOutput) SetStatus(v string) *GetIndexOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetIndexOutput) SetUpdatedAt(v time.Time) *GetIndexOutput { - s.UpdatedAt = &v - return s -} - -type GetPluginInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application which contains the plugin. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the plugin. - // - // PluginId is a required field - PluginId *string `location:"uri" locationName:"pluginId" min:"36" 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 GetPluginInput) 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 GetPluginInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPluginInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPluginInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.PluginId == nil { - invalidParams.Add(request.NewErrParamRequired("PluginId")) - } - if s.PluginId != nil && len(*s.PluginId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("PluginId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetPluginInput) SetApplicationId(v string) *GetPluginInput { - s.ApplicationId = &v - return s -} - -// SetPluginId sets the PluginId field's value. -func (s *GetPluginInput) SetPluginId(v string) *GetPluginInput { - s.PluginId = &v - return s -} - -type GetPluginOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the application which contains the plugin. - ApplicationId *string `locationName:"applicationId" min:"36" type:"string"` - - // Authentication configuration information for an Amazon Q plugin. - AuthConfiguration *PluginAuthConfiguration `locationName:"authConfiguration" type:"structure"` - - // The timestamp for when the plugin was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The name of the plugin. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the role with permission to access resources - // needed to create the plugin. - PluginArn *string `locationName:"pluginArn" type:"string"` - - // The identifier of the plugin. - PluginId *string `locationName:"pluginId" min:"36" type:"string"` - - // The source URL used for plugin configuration. - ServerUrl *string `locationName:"serverUrl" min:"1" type:"string"` - - // The current state of the plugin. - State *string `locationName:"state" type:"string" enum:"PluginState"` - - // The type of the plugin. - Type *string `locationName:"type" type:"string" enum:"PluginType"` - - // The timestamp for when the plugin was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 GetPluginOutput) 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 GetPluginOutput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetPluginOutput) SetApplicationId(v string) *GetPluginOutput { - s.ApplicationId = &v - return s -} - -// SetAuthConfiguration sets the AuthConfiguration field's value. -func (s *GetPluginOutput) SetAuthConfiguration(v *PluginAuthConfiguration) *GetPluginOutput { - s.AuthConfiguration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetPluginOutput) SetCreatedAt(v time.Time) *GetPluginOutput { - s.CreatedAt = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *GetPluginOutput) SetDisplayName(v string) *GetPluginOutput { - s.DisplayName = &v - return s -} - -// SetPluginArn sets the PluginArn field's value. -func (s *GetPluginOutput) SetPluginArn(v string) *GetPluginOutput { - s.PluginArn = &v - return s -} - -// SetPluginId sets the PluginId field's value. -func (s *GetPluginOutput) SetPluginId(v string) *GetPluginOutput { - s.PluginId = &v - return s -} - -// SetServerUrl sets the ServerUrl field's value. -func (s *GetPluginOutput) SetServerUrl(v string) *GetPluginOutput { - s.ServerUrl = &v - return s -} - -// SetState sets the State field's value. -func (s *GetPluginOutput) SetState(v string) *GetPluginOutput { - s.State = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetPluginOutput) SetType(v string) *GetPluginOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetPluginOutput) SetUpdatedAt(v time.Time) *GetPluginOutput { - s.UpdatedAt = &v - return s -} - -type GetRetrieverInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application using the retriever. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the retriever. - // - // RetrieverId is a required field - RetrieverId *string `location:"uri" locationName:"retrieverId" min:"36" 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 GetRetrieverInput) 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 GetRetrieverInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRetrieverInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRetrieverInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.RetrieverId == nil { - invalidParams.Add(request.NewErrParamRequired("RetrieverId")) - } - if s.RetrieverId != nil && len(*s.RetrieverId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("RetrieverId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetRetrieverInput) SetApplicationId(v string) *GetRetrieverInput { - s.ApplicationId = &v - return s -} - -// SetRetrieverId sets the RetrieverId field's value. -func (s *GetRetrieverInput) SetRetrieverId(v string) *GetRetrieverInput { - s.RetrieverId = &v - return s -} - -type GetRetrieverOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application using the retriever. - ApplicationId *string `locationName:"applicationId" min:"36" type:"string"` - - // Provides information on how the retriever used for your Amazon Q application - // is configured. - Configuration *RetrieverConfiguration `locationName:"configuration" type:"structure"` - - // The Unix timestamp when the retriever was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The name of the retriever. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role associated with the retriever. - RetrieverArn *string `locationName:"retrieverArn" type:"string"` - - // The identifier of the retriever. - RetrieverId *string `locationName:"retrieverId" min:"36" type:"string"` - - // The Amazon Resource Name (ARN) of the role with the permission to access - // the retriever and required resources. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The status of the retriever. - Status *string `locationName:"status" type:"string" enum:"RetrieverStatus"` - - // The type of the retriever. - Type *string `locationName:"type" type:"string" enum:"RetrieverType"` - - // The Unix timestamp when the retriever was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 GetRetrieverOutput) 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 GetRetrieverOutput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetRetrieverOutput) SetApplicationId(v string) *GetRetrieverOutput { - s.ApplicationId = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *GetRetrieverOutput) SetConfiguration(v *RetrieverConfiguration) *GetRetrieverOutput { - s.Configuration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetRetrieverOutput) SetCreatedAt(v time.Time) *GetRetrieverOutput { - s.CreatedAt = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *GetRetrieverOutput) SetDisplayName(v string) *GetRetrieverOutput { - s.DisplayName = &v - return s -} - -// SetRetrieverArn sets the RetrieverArn field's value. -func (s *GetRetrieverOutput) SetRetrieverArn(v string) *GetRetrieverOutput { - s.RetrieverArn = &v - return s -} - -// SetRetrieverId sets the RetrieverId field's value. -func (s *GetRetrieverOutput) SetRetrieverId(v string) *GetRetrieverOutput { - s.RetrieverId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *GetRetrieverOutput) SetRoleArn(v string) *GetRetrieverOutput { - s.RoleArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetRetrieverOutput) SetStatus(v string) *GetRetrieverOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetRetrieverOutput) SetType(v string) *GetRetrieverOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetRetrieverOutput) SetUpdatedAt(v time.Time) *GetRetrieverOutput { - s.UpdatedAt = &v - return s -} - -type GetUserInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application connected to the user. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The user email address attached to the user. - // - // UserId is a required field - UserId *string `location:"uri" locationName:"userId" min:"1" 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 GetUserInput) 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 GetUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUserInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetUserInput) SetApplicationId(v string) *GetUserInput { - s.ApplicationId = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *GetUserInput) SetUserId(v string) *GetUserInput { - s.UserId = &v - return s -} - -type GetUserOutput struct { - _ struct{} `type:"structure"` - - // A list of user aliases attached to a user. - UserAliases []*UserAlias `locationName:"userAliases" type:"list"` -} - -// 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 GetUserOutput) 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 GetUserOutput) GoString() string { - return s.String() -} - -// SetUserAliases sets the UserAliases field's value. -func (s *GetUserOutput) SetUserAliases(v []*UserAlias) *GetUserOutput { - s.UserAliases = v - return s -} - -type GetWebExperienceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application linked to the web experience. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the Amazon Q web experience. - // - // WebExperienceId is a required field - WebExperienceId *string `location:"uri" locationName:"webExperienceId" min:"36" 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 GetWebExperienceInput) 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 GetWebExperienceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWebExperienceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWebExperienceInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.WebExperienceId == nil { - invalidParams.Add(request.NewErrParamRequired("WebExperienceId")) - } - if s.WebExperienceId != nil && len(*s.WebExperienceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WebExperienceId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetWebExperienceInput) SetApplicationId(v string) *GetWebExperienceInput { - s.ApplicationId = &v - return s -} - -// SetWebExperienceId sets the WebExperienceId field's value. -func (s *GetWebExperienceInput) SetWebExperienceId(v string) *GetWebExperienceInput { - s.WebExperienceId = &v - return s -} - -type GetWebExperienceOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application linked to the web experience. - ApplicationId *string `locationName:"applicationId" min:"36" type:"string"` - - // The authentication configuration information for your Amazon Q web experience. - AuthenticationConfiguration *WebExperienceAuthConfiguration `locationName:"authenticationConfiguration" type:"structure"` - - // The Unix timestamp when the retriever was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The endpoint of your Amazon Q web experience. - DefaultEndpoint *string `locationName:"defaultEndpoint" min:"1" type:"string"` - - // When the Status field value is FAILED, the ErrorMessage field contains a - // description of the error that caused the data source connector to fail. - Error *ErrorDetail `locationName:"error" type:"structure"` - - // Determines whether sample prompts are enabled in the web experience for an - // end user. - SamplePromptsControlMode *string `locationName:"samplePromptsControlMode" type:"string" enum:"WebExperienceSamplePromptsControlMode"` - - // The current status of the Amazon Q web experience. When the Status field - // value is FAILED, the ErrorMessage field contains a description of the error - // that caused the data source connector to fail. - Status *string `locationName:"status" type:"string" enum:"WebExperienceStatus"` - - // The subtitle for your Amazon Q web experience. - Subtitle *string `locationName:"subtitle" type:"string"` - - // The title for your Amazon Q web experience. - Title *string `locationName:"title" type:"string"` - - // The Unix timestamp when the data source connector was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The Amazon Resource Name (ARN) of the role with the permission to access - // the Amazon Q web experience and required resources. - WebExperienceArn *string `locationName:"webExperienceArn" type:"string"` - - // The identifier of the Amazon Q web experience. - WebExperienceId *string `locationName:"webExperienceId" min:"36" type:"string"` - - // The customized welcome message for end users of an Amazon Q web experience. - WelcomeMessage *string `locationName:"welcomeMessage" 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 GetWebExperienceOutput) 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 GetWebExperienceOutput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetWebExperienceOutput) SetApplicationId(v string) *GetWebExperienceOutput { - s.ApplicationId = &v - return s -} - -// SetAuthenticationConfiguration sets the AuthenticationConfiguration field's value. -func (s *GetWebExperienceOutput) SetAuthenticationConfiguration(v *WebExperienceAuthConfiguration) *GetWebExperienceOutput { - s.AuthenticationConfiguration = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetWebExperienceOutput) SetCreatedAt(v time.Time) *GetWebExperienceOutput { - s.CreatedAt = &v - return s -} - -// SetDefaultEndpoint sets the DefaultEndpoint field's value. -func (s *GetWebExperienceOutput) SetDefaultEndpoint(v string) *GetWebExperienceOutput { - s.DefaultEndpoint = &v - return s -} - -// SetError sets the Error field's value. -func (s *GetWebExperienceOutput) SetError(v *ErrorDetail) *GetWebExperienceOutput { - s.Error = v - return s -} - -// SetSamplePromptsControlMode sets the SamplePromptsControlMode field's value. -func (s *GetWebExperienceOutput) SetSamplePromptsControlMode(v string) *GetWebExperienceOutput { - s.SamplePromptsControlMode = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetWebExperienceOutput) SetStatus(v string) *GetWebExperienceOutput { - s.Status = &v - return s -} - -// SetSubtitle sets the Subtitle field's value. -func (s *GetWebExperienceOutput) SetSubtitle(v string) *GetWebExperienceOutput { - s.Subtitle = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *GetWebExperienceOutput) SetTitle(v string) *GetWebExperienceOutput { - s.Title = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *GetWebExperienceOutput) SetUpdatedAt(v time.Time) *GetWebExperienceOutput { - s.UpdatedAt = &v - return s -} - -// SetWebExperienceArn sets the WebExperienceArn field's value. -func (s *GetWebExperienceOutput) SetWebExperienceArn(v string) *GetWebExperienceOutput { - s.WebExperienceArn = &v - return s -} - -// SetWebExperienceId sets the WebExperienceId field's value. -func (s *GetWebExperienceOutput) SetWebExperienceId(v string) *GetWebExperienceOutput { - s.WebExperienceId = &v - return s -} - -// SetWelcomeMessage sets the WelcomeMessage field's value. -func (s *GetWebExperienceOutput) SetWelcomeMessage(v string) *GetWebExperienceOutput { - s.WelcomeMessage = &v - return s -} - -// A list of users or sub groups that belong to a group. This is for generating -// Amazon Q chat results only from document a user has access to. -type GroupMembers struct { - _ struct{} `type:"structure"` - - // A list of sub groups that belong to a group. For example, the sub groups - // "Research", "Engineering", and "Sales and Marketing" all belong to the group - // "Company". - MemberGroups []*MemberGroup `locationName:"memberGroups" min:"1" type:"list"` - - // A list of users that belong to a group. For example, a list of interns all - // belong to the "Interns" group. - MemberUsers []*MemberUser `locationName:"memberUsers" min:"1" type:"list"` -} - -// 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 GroupMembers) 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 GroupMembers) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GroupMembers) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GroupMembers"} - if s.MemberGroups != nil && len(s.MemberGroups) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MemberGroups", 1)) - } - if s.MemberUsers != nil && len(s.MemberUsers) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MemberUsers", 1)) - } - if s.MemberGroups != nil { - for i, v := range s.MemberGroups { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MemberGroups", i), err.(request.ErrInvalidParams)) - } - } - } - if s.MemberUsers != nil { - for i, v := range s.MemberUsers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MemberUsers", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMemberGroups sets the MemberGroups field's value. -func (s *GroupMembers) SetMemberGroups(v []*MemberGroup) *GroupMembers { - s.MemberGroups = v - return s -} - -// SetMemberUsers sets the MemberUsers field's value. -func (s *GroupMembers) SetMemberUsers(v []*MemberUser) *GroupMembers { - s.MemberUsers = v - return s -} - -// Provides the details of a group's status. -type GroupStatusDetail struct { - _ struct{} `type:"structure"` - - // The details of an error associated a group status. - ErrorDetail *ErrorDetail `locationName:"errorDetail" type:"structure"` - - // The Unix timestamp when the Amazon Q application was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` - - // The status of a group. - Status *string `locationName:"status" type:"string" enum:"GroupStatus"` -} - -// 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 GroupStatusDetail) 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 GroupStatusDetail) GoString() string { - return s.String() -} - -// SetErrorDetail sets the ErrorDetail field's value. -func (s *GroupStatusDetail) SetErrorDetail(v *ErrorDetail) *GroupStatusDetail { - s.ErrorDetail = v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GroupStatusDetail) SetLastUpdatedAt(v time.Time) *GroupStatusDetail { - s.LastUpdatedAt = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GroupStatusDetail) SetStatus(v string) *GroupStatusDetail { - s.Status = &v - return s -} - -// Summary information for groups. -type GroupSummary struct { - _ struct{} `type:"structure"` - - // The name of the group the summary information is for. - GroupName *string `locationName:"groupName" min:"1" 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 GroupSummary) 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 GroupSummary) GoString() string { - return s.String() -} - -// SetGroupName sets the GroupName field's value. -func (s *GroupSummary) SetGroupName(v string) *GroupSummary { - s.GroupName = &v - return s -} - -// Provides the configuration information for invoking a Lambda function in -// Lambda to alter document metadata and content when ingesting documents into -// Amazon Q. -// -// You can configure your Lambda function using PreExtractionHookConfiguration -// (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_CustomDocumentEnrichmentConfiguration.html) -// if you want to apply advanced alterations on the original or raw documents. -// -// If you want to apply advanced alterations on the Amazon Q structured documents, -// you must configure your Lambda function using PostExtractionHookConfiguration -// (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_CustomDocumentEnrichmentConfiguration.html). -// -// You can only invoke one Lambda function. However, this function can invoke -// other functions it requires. -// -// For more information, see Custom document enrichment (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). -type HookConfiguration struct { - _ struct{} `type:"structure"` - - // The condition used for when a Lambda function should be invoked. - // - // For example, you can specify a condition that if there are empty date-time - // values, then Amazon Q should invoke a function that inserts the current date-time. - InvocationCondition *DocumentAttributeCondition `locationName:"invocationCondition" type:"structure"` - - // The Amazon Resource Name (ARN) of a role with permission to run a Lambda - // function during ingestion. For more information, see IAM roles for Custom - // Document Enrichment (CDE) (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/iam-roles.html#cde-iam-role). - LambdaArn *string `locationName:"lambdaArn" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of a role with permission to run PreExtractionHookConfiguration - // and PostExtractionHookConfiguration for altering document metadata and content - // during the document ingestion process. - RoleArn *string `locationName:"roleArn" type:"string"` - - // Stores the original, raw documents or the structured, parsed documents before - // and after altering them. For more information, see Data contracts for Lambda - // functions (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/cde-lambda-operations.html#cde-lambda-operations-data-contracts). - S3BucketName *string `locationName:"s3BucketName" min:"1" 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 HookConfiguration) 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 HookConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HookConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HookConfiguration"} - if s.LambdaArn != nil && len(*s.LambdaArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LambdaArn", 1)) - } - if s.S3BucketName != nil && len(*s.S3BucketName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("S3BucketName", 1)) - } - if s.InvocationCondition != nil { - if err := s.InvocationCondition.Validate(); err != nil { - invalidParams.AddNested("InvocationCondition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInvocationCondition sets the InvocationCondition field's value. -func (s *HookConfiguration) SetInvocationCondition(v *DocumentAttributeCondition) *HookConfiguration { - s.InvocationCondition = v - return s -} - -// SetLambdaArn sets the LambdaArn field's value. -func (s *HookConfiguration) SetLambdaArn(v string) *HookConfiguration { - s.LambdaArn = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *HookConfiguration) SetRoleArn(v string) *HookConfiguration { - s.RoleArn = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *HookConfiguration) SetS3BucketName(v string) *HookConfiguration { - s.S3BucketName = &v - return s -} - -// Summary information for your Amazon Q index. -type Index struct { - _ struct{} `type:"structure"` - - // The Unix timestamp when the index was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The name of the index. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The identifier for the index. - IndexId *string `locationName:"indexId" min:"36" type:"string"` - - // The current status of the index. When the status is ACTIVE, the index is - // ready. - Status *string `locationName:"status" type:"string" enum:"IndexStatus"` - - // The Unix timestamp when the index was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 Index) 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 Index) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Index) SetCreatedAt(v time.Time) *Index { - s.CreatedAt = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Index) SetDisplayName(v string) *Index { - s.DisplayName = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *Index) SetIndexId(v string) *Index { - s.IndexId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Index) SetStatus(v string) *Index { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Index) SetUpdatedAt(v time.Time) *Index { - s.UpdatedAt = &v - return s -} - -// Provides information about index capacity configuration. -type IndexCapacityConfiguration struct { - _ struct{} `type:"structure"` - - // The number of storage units configured for an Amazon Q index. - Units *int64 `locationName:"units" min:"1" 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 IndexCapacityConfiguration) 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 IndexCapacityConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IndexCapacityConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IndexCapacityConfiguration"} - if s.Units != nil && *s.Units < 1 { - invalidParams.Add(request.NewErrParamMinValue("Units", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUnits sets the Units field's value. -func (s *IndexCapacityConfiguration) SetUnits(v int64) *IndexCapacityConfiguration { - s.Units = &v - return s -} - -// Provides information about the number of documents in an index. -type IndexStatistics struct { - _ struct{} `type:"structure"` - - // The number of documents indexed. - TextDocumentStatistics *TextDocumentStatistics `locationName:"textDocumentStatistics" 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 IndexStatistics) 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 IndexStatistics) GoString() string { - return s.String() -} - -// SetTextDocumentStatistics sets the TextDocumentStatistics field's value. -func (s *IndexStatistics) SetTextDocumentStatistics(v *TextDocumentStatistics) *IndexStatistics { - s.TextDocumentStatistics = v - return s -} - -// Provides the configuration information for applying basic logic to alter -// document metadata and content when ingesting documents into Amazon Q. -// -// To apply advanced logic, to go beyond what you can do with basic logic, see -// HookConfiguration (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_HookConfiguration.html). -// -// For more information, see Custom document enrichment (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). -type InlineDocumentEnrichmentConfiguration struct { - _ struct{} `type:"structure"` - - // The condition used for the target document attribute or metadata field when - // ingesting documents into Amazon Q. You use this with DocumentAttributeTarget - // (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_DocumentAttributeTarget.html) - // to apply the condition. - // - // For example, you can create the 'Department' target field and have it prefill - // department names associated with the documents based on information in the - // 'Source_URI' field. Set the condition that if the 'Source_URI' field contains - // 'financial' in its URI value, then prefill the target field 'Department' - // with the target value 'Finance' for the document. - // - // Amazon Q can't create a target field if it has not already been created as - // an index field. After you create your index field, you can create a document - // metadata field using DocumentAttributeTarget. Amazon Q then will map your - // newly created metadata field to your index field. - Condition *DocumentAttributeCondition `locationName:"condition" type:"structure"` - - // TRUE to delete content if the condition used for the target attribute is - // met. - DocumentContentOperator *string `locationName:"documentContentOperator" type:"string" enum:"DocumentContentOperator"` - - // The target document attribute or metadata field you want to alter when ingesting - // documents into Amazon Q. - // - // For example, you can delete all customer identification numbers associated - // with the documents, stored in the document metadata field called 'Customer_ID' - // by setting the target key as 'Customer_ID' and the deletion flag to TRUE. - // This removes all customer ID values in the field 'Customer_ID'. This would - // scrub personally identifiable information from each document's metadata. - // - // Amazon Q can't create a target field if it has not already been created as - // an index field. After you create your index field, you can create a document - // metadata field using DocumentAttributeTarget (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_DocumentAttributeTarget.html). - // Amazon Q will then map your newly created document attribute to your index - // field. - // - // You can also use this with DocumentAttributeCondition (https://docs.aws.amazon.com/enterpriseq/latest/APIReference/API_DocumentAttributeCondition.html). - Target *DocumentAttributeTarget `locationName:"target" 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 InlineDocumentEnrichmentConfiguration) 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 InlineDocumentEnrichmentConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InlineDocumentEnrichmentConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InlineDocumentEnrichmentConfiguration"} - if s.Condition != nil { - if err := s.Condition.Validate(); err != nil { - invalidParams.AddNested("Condition", err.(request.ErrInvalidParams)) - } - } - if s.Target != nil { - if err := s.Target.Validate(); err != nil { - invalidParams.AddNested("Target", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCondition sets the Condition field's value. -func (s *InlineDocumentEnrichmentConfiguration) SetCondition(v *DocumentAttributeCondition) *InlineDocumentEnrichmentConfiguration { - s.Condition = v - return s -} - -// SetDocumentContentOperator sets the DocumentContentOperator field's value. -func (s *InlineDocumentEnrichmentConfiguration) SetDocumentContentOperator(v string) *InlineDocumentEnrichmentConfiguration { - s.DocumentContentOperator = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *InlineDocumentEnrichmentConfiguration) SetTarget(v *DocumentAttributeTarget) *InlineDocumentEnrichmentConfiguration { - s.Target = v - return s -} - -// An issue occurred with the internal server used for your Amazon Q service. -// Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) -// for help. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Stores an Amazon Kendra index as a retriever. -type KendraIndexConfiguration struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Kendra index. - // - // IndexId is a required field - IndexId *string `locationName:"indexId" min:"36" 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 KendraIndexConfiguration) 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 KendraIndexConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KendraIndexConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KendraIndexConfiguration"} - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexId sets the IndexId field's value. -func (s *KendraIndexConfiguration) SetIndexId(v string) *KendraIndexConfiguration { - s.IndexId = &v - return s -} - -// You don't have permissions to perform the action because your license is -// inactive. Ask your admin to activate your license and try again after your -// licence is active. -type LicenseNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 LicenseNotFoundException) 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 LicenseNotFoundException) GoString() string { - return s.String() -} - -func newErrorLicenseNotFoundException(v protocol.ResponseMetadata) error { - return &LicenseNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *LicenseNotFoundException) Code() string { - return "LicenseNotFoundException" -} - -// Message returns the exception's message. -func (s *LicenseNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *LicenseNotFoundException) OrigErr() error { - return nil -} - -func (s *LicenseNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *LicenseNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *LicenseNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListApplicationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of Amazon Q applications to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of Amazon Q applications. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListApplicationsInput) 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 ListApplicationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListApplicationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListApplicationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListApplicationsInput) SetMaxResults(v int64) *ListApplicationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsInput) SetNextToken(v string) *ListApplicationsInput { - s.NextToken = &v - return s -} - -type ListApplicationsOutput struct { - _ struct{} `type:"structure"` - - // An array of summary information on the configuration of one or more Amazon - // Q applications. - Applications []*Application `locationName:"applications" type:"list"` - - // If the response is truncated, Amazon Q returns this token. You can use this - // token in a subsequent request to retrieve the next set of applications. - NextToken *string `locationName:"nextToken" min:"1" 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 ListApplicationsOutput) 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 ListApplicationsOutput) GoString() string { - return s.String() -} - -// SetApplications sets the Applications field's value. -func (s *ListApplicationsOutput) SetApplications(v []*Application) *ListApplicationsOutput { - s.Applications = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsOutput) SetNextToken(v string) *ListApplicationsOutput { - s.NextToken = &v - return s -} - -type ListConversationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The maximum number of Amazon Q conversations to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of Amazon Q conversations. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the user involved in the Amazon Q web experience conversation. - // - // UserId is a required field - UserId *string `location:"querystring" locationName:"userId" min:"1" 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 ListConversationsInput) 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 ListConversationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListConversationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListConversationsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListConversationsInput) SetApplicationId(v string) *ListConversationsInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListConversationsInput) SetMaxResults(v int64) *ListConversationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConversationsInput) SetNextToken(v string) *ListConversationsInput { - s.NextToken = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *ListConversationsInput) SetUserId(v string) *ListConversationsInput { - s.UserId = &v - return s -} - -type ListConversationsOutput struct { - _ struct{} `type:"structure"` - - // An array of summary information on the configuration of one or more Amazon - // Q web experiences. - Conversations []*Conversation `locationName:"conversations" type:"list"` - - // If the response is truncated, Amazon Q returns this token, which you can - // use in a later request to list the next set of messages. - NextToken *string `locationName:"nextToken" min:"1" 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 ListConversationsOutput) 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 ListConversationsOutput) GoString() string { - return s.String() -} - -// SetConversations sets the Conversations field's value. -func (s *ListConversationsOutput) SetConversations(v []*Conversation) *ListConversationsOutput { - s.Conversations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListConversationsOutput) SetNextToken(v string) *ListConversationsOutput { - s.NextToken = &v - return s -} - -type ListDataSourceSyncJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application connected to the data source. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source connector. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" min:"36" type:"string" required:"true"` - - // The end time of the data source connector sync. - EndTime *time.Time `location:"querystring" locationName:"endTime" type:"timestamp"` - - // The identifier of the index used with the Amazon Q data source connector. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" type:"string" required:"true"` - - // The maximum number of synchronization jobs to return in the response. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incpmplete because there is more data to retriever, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of responses. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The start time of the data source connector sync. - StartTime *time.Time `location:"querystring" locationName:"startTime" type:"timestamp"` - - // Only returns synchronization jobs with the Status field equal to the specified - // status. - StatusFilter *string `location:"querystring" locationName:"syncStatus" type:"string" enum:"DataSourceSyncJobStatus"` -} - -// 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 ListDataSourceSyncJobsInput) 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 ListDataSourceSyncJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataSourceSyncJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataSourceSyncJobsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListDataSourceSyncJobsInput) SetApplicationId(v string) *ListDataSourceSyncJobsInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *ListDataSourceSyncJobsInput) SetDataSourceId(v string) *ListDataSourceSyncJobsInput { - s.DataSourceId = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *ListDataSourceSyncJobsInput) SetEndTime(v time.Time) *ListDataSourceSyncJobsInput { - s.EndTime = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *ListDataSourceSyncJobsInput) SetIndexId(v string) *ListDataSourceSyncJobsInput { - s.IndexId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataSourceSyncJobsInput) SetMaxResults(v int64) *ListDataSourceSyncJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourceSyncJobsInput) SetNextToken(v string) *ListDataSourceSyncJobsInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ListDataSourceSyncJobsInput) SetStartTime(v time.Time) *ListDataSourceSyncJobsInput { - s.StartTime = &v - return s -} - -// SetStatusFilter sets the StatusFilter field's value. -func (s *ListDataSourceSyncJobsInput) SetStatusFilter(v string) *ListDataSourceSyncJobsInput { - s.StatusFilter = &v - return s -} - -type ListDataSourceSyncJobsOutput struct { - _ struct{} `type:"structure"` - - // A history of synchronization jobs for the data source connector. - History []*DataSourceSyncJob `locationName:"history" type:"list"` - - // If the response is truncated, Amazon Q returns this token. You can use this - // token in any subsequent request to retrieve the next set of jobs. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDataSourceSyncJobsOutput) 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 ListDataSourceSyncJobsOutput) GoString() string { - return s.String() -} - -// SetHistory sets the History field's value. -func (s *ListDataSourceSyncJobsOutput) SetHistory(v []*DataSourceSyncJob) *ListDataSourceSyncJobsOutput { - s.History = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourceSyncJobsOutput) SetNextToken(v string) *ListDataSourceSyncJobsOutput { - s.NextToken = &v - return s -} - -type ListDataSourcesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application linked to the data source connectors. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the index used with one or more data source connectors. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" type:"string" required:"true"` - - // The maximum number of data source connectors to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of Amazon Q data source connectors. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListDataSourcesInput) 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 ListDataSourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataSourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataSourcesInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListDataSourcesInput) SetApplicationId(v string) *ListDataSourcesInput { - s.ApplicationId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *ListDataSourcesInput) SetIndexId(v string) *ListDataSourcesInput { - s.IndexId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataSourcesInput) SetMaxResults(v int64) *ListDataSourcesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourcesInput) SetNextToken(v string) *ListDataSourcesInput { - s.NextToken = &v - return s -} - -type ListDataSourcesOutput struct { - _ struct{} `type:"structure"` - - // An array of summary information for one or more data source connector. - DataSources []*DataSource `locationName:"dataSources" type:"list"` - - // If the response is truncated, Amazon Q returns this token. You can use this - // token in a subsequent request to retrieve the next set of data source connectors. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDataSourcesOutput) 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 ListDataSourcesOutput) GoString() string { - return s.String() -} - -// SetDataSources sets the DataSources field's value. -func (s *ListDataSourcesOutput) SetDataSources(v []*DataSource) *ListDataSourcesOutput { - s.DataSources = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataSourcesOutput) SetNextToken(v string) *ListDataSourcesOutput { - s.NextToken = &v - return s -} - -type ListDocumentsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application id the documents are attached to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data sources the documents are attached to. - DataSourceIds []*string `location:"querystring" locationName:"dataSourceIds" min:"1" type:"list"` - - // The identifier of the index the documents are attached to. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" type:"string" required:"true"` - - // The maximum number of documents to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of documents. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListDocumentsInput) 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 ListDocumentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDocumentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDocumentsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceIds != nil && len(s.DataSourceIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceIds", 1)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListDocumentsInput) SetApplicationId(v string) *ListDocumentsInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceIds sets the DataSourceIds field's value. -func (s *ListDocumentsInput) SetDataSourceIds(v []*string) *ListDocumentsInput { - s.DataSourceIds = v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *ListDocumentsInput) SetIndexId(v string) *ListDocumentsInput { - s.IndexId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDocumentsInput) SetMaxResults(v int64) *ListDocumentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDocumentsInput) SetNextToken(v string) *ListDocumentsInput { - s.NextToken = &v - return s -} - -type ListDocumentsOutput struct { - _ struct{} `type:"structure"` - - // A list of document details. - DocumentDetailList []*DocumentDetails `locationName:"documentDetailList" type:"list"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of documents. - NextToken *string `locationName:"nextToken" min:"1" 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 ListDocumentsOutput) 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 ListDocumentsOutput) GoString() string { - return s.String() -} - -// SetDocumentDetailList sets the DocumentDetailList field's value. -func (s *ListDocumentsOutput) SetDocumentDetailList(v []*DocumentDetails) *ListDocumentsOutput { - s.DocumentDetailList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDocumentsOutput) SetNextToken(v string) *ListDocumentsOutput { - s.NextToken = &v - return s -} - -type ListGroupsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application for getting a list of groups mapped to - // users. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source for getting a list of groups mapped to - // users. - DataSourceId *string `location:"querystring" locationName:"dataSourceId" min:"36" type:"string"` - - // The identifier of the index for getting a list of groups mapped to users. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" type:"string" required:"true"` - - // The maximum number of returned groups that are mapped to users. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the previous response was incomplete (because there is more data to retrieve), - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of groups that are mapped to users. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The timestamp identifier used for the latest PUT or DELETE action for mapping - // users to their groups. - // - // UpdatedEarlierThan is a required field - UpdatedEarlierThan *time.Time `location:"querystring" locationName:"updatedEarlierThan" type:"timestamp" 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 ListGroupsInput) 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 ListGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGroupsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.UpdatedEarlierThan == nil { - invalidParams.Add(request.NewErrParamRequired("UpdatedEarlierThan")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListGroupsInput) SetApplicationId(v string) *ListGroupsInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *ListGroupsInput) SetDataSourceId(v string) *ListGroupsInput { - s.DataSourceId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *ListGroupsInput) SetIndexId(v string) *ListGroupsInput { - s.IndexId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListGroupsInput) SetMaxResults(v int64) *ListGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListGroupsInput) SetNextToken(v string) *ListGroupsInput { - s.NextToken = &v - return s -} - -// SetUpdatedEarlierThan sets the UpdatedEarlierThan field's value. -func (s *ListGroupsInput) SetUpdatedEarlierThan(v time.Time) *ListGroupsInput { - s.UpdatedEarlierThan = &v - return s -} - -type ListGroupsOutput struct { - _ struct{} `type:"structure"` - - // Summary information for list of groups that are mapped to users. - Items []*GroupSummary `locationName:"items" type:"list"` - - // If the response is truncated, Amazon Q returns this token that you can use - // in the subsequent request to retrieve the next set of groups that are mapped - // to users. - NextToken *string `locationName:"nextToken" min:"1" 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 ListGroupsOutput) 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 ListGroupsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListGroupsOutput) SetItems(v []*GroupSummary) *ListGroupsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListGroupsOutput) SetNextToken(v string) *ListGroupsOutput { - s.NextToken = &v - return s -} - -type ListIndicesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application connected to the index. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The maximum number of indices to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of Amazon Q indices. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListIndicesInput) 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 ListIndicesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIndicesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIndicesInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListIndicesInput) SetApplicationId(v string) *ListIndicesInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIndicesInput) SetMaxResults(v int64) *ListIndicesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIndicesInput) SetNextToken(v string) *ListIndicesInput { - s.NextToken = &v - return s -} - -type ListIndicesOutput struct { - _ struct{} `type:"structure"` - - // An array of information on the items in one or more indexes. - Indices []*Index `locationName:"indices" type:"list"` - - // If the response is truncated, Amazon Q returns this token that you can use - // in the subsequent request to retrieve the next set of indexes. - NextToken *string `locationName:"nextToken" min:"1" 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 ListIndicesOutput) 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 ListIndicesOutput) GoString() string { - return s.String() -} - -// SetIndices sets the Indices field's value. -func (s *ListIndicesOutput) SetIndices(v []*Index) *ListIndicesOutput { - s.Indices = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIndicesOutput) SetNextToken(v string) *ListIndicesOutput { - s.NextToken = &v - return s -} - -type ListMessagesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier for the Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the Amazon Q web experience conversation. - // - // ConversationId is a required field - ConversationId *string `location:"uri" locationName:"conversationId" min:"36" type:"string" required:"true"` - - // The maximum number of messages to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the number of retrievers returned exceeds maxResults, Amazon Q returns - // a next token as a pagination token to retrieve the next set of messages. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The identifier of the user involved in the Amazon Q web experience conversation. - // - // UserId is a required field - UserId *string `location:"querystring" locationName:"userId" min:"1" 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 ListMessagesInput) 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 ListMessagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMessagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMessagesInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.ConversationId == nil { - invalidParams.Add(request.NewErrParamRequired("ConversationId")) - } - if s.ConversationId != nil && len(*s.ConversationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConversationId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListMessagesInput) SetApplicationId(v string) *ListMessagesInput { - s.ApplicationId = &v - return s -} - -// SetConversationId sets the ConversationId field's value. -func (s *ListMessagesInput) SetConversationId(v string) *ListMessagesInput { - s.ConversationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListMessagesInput) SetMaxResults(v int64) *ListMessagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMessagesInput) SetNextToken(v string) *ListMessagesInput { - s.NextToken = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *ListMessagesInput) SetUserId(v string) *ListMessagesInput { - s.UserId = &v - return s -} - -type ListMessagesOutput struct { - _ struct{} `type:"structure"` - - // An array of information on one or more messages. - Messages []*Message `locationName:"messages" type:"list"` - - // If the response is truncated, Amazon Q returns this token, which you can - // use in a later request to list the next set of messages. - NextToken *string `locationName:"nextToken" min:"1" 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 ListMessagesOutput) 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 ListMessagesOutput) GoString() string { - return s.String() -} - -// SetMessages sets the Messages field's value. -func (s *ListMessagesOutput) SetMessages(v []*Message) *ListMessagesOutput { - s.Messages = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListMessagesOutput) SetNextToken(v string) *ListMessagesOutput { - s.NextToken = &v - return s -} - -type ListPluginsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the application the plugin is attached to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The maximum number of documents to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of plugins. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListPluginsInput) 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 ListPluginsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPluginsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPluginsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListPluginsInput) SetApplicationId(v string) *ListPluginsInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPluginsInput) SetMaxResults(v int64) *ListPluginsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPluginsInput) SetNextToken(v string) *ListPluginsInput { - s.NextToken = &v - return s -} - -type ListPluginsOutput struct { - _ struct{} `type:"structure"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of plugins. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Information about a configured plugin. - Plugins []*Plugin `locationName:"plugins" type:"list"` -} - -// 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 ListPluginsOutput) 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 ListPluginsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPluginsOutput) SetNextToken(v string) *ListPluginsOutput { - s.NextToken = &v - return s -} - -// SetPlugins sets the Plugins field's value. -func (s *ListPluginsOutput) SetPlugins(v []*Plugin) *ListPluginsOutput { - s.Plugins = v - return s -} - -type ListRetrieversInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application using the retriever. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The maximum number of retrievers returned. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the number of retrievers returned exceeds maxResults, Amazon Q returns - // a next token as a pagination token to retrieve the next set of retrievers. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListRetrieversInput) 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 ListRetrieversInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRetrieversInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRetrieversInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListRetrieversInput) SetApplicationId(v string) *ListRetrieversInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRetrieversInput) SetMaxResults(v int64) *ListRetrieversInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRetrieversInput) SetNextToken(v string) *ListRetrieversInput { - s.NextToken = &v - return s -} - -type ListRetrieversOutput struct { - _ struct{} `type:"structure"` - - // If the response is truncated, Amazon Q returns this token, which you can - // use in a later request to list the next set of retrievers. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // An array of summary information for one or more retrievers. - Retrievers []*Retriever `locationName:"retrievers" type:"list"` -} - -// 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 ListRetrieversOutput) 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 ListRetrieversOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRetrieversOutput) SetNextToken(v string) *ListRetrieversOutput { - s.NextToken = &v - return s -} - -// SetRetrievers sets the Retrievers field's value. -func (s *ListRetrieversOutput) SetRetrievers(v []*Retriever) *ListRetrieversOutput { - s.Retrievers = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Amazon Q application or data source - // to get a list of tags for. - // - // ResourceARN is a required field - ResourceARN *string `location:"uri" locationName:"resourceARN" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { - s.ResourceARN = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of tags associated with the Amazon Q application or data source. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListWebExperiencesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application linked to the listed web experiences. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The maximum number of Amazon Q Web Experiences to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If the maxResults response was incomplete because there is more data to retrieve, - // Amazon Q returns a pagination token in the response. You can use this pagination - // token to retrieve the next set of Amazon Q conversations. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListWebExperiencesInput) 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 ListWebExperiencesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWebExperiencesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWebExperiencesInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListWebExperiencesInput) SetApplicationId(v string) *ListWebExperiencesInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWebExperiencesInput) SetMaxResults(v int64) *ListWebExperiencesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWebExperiencesInput) SetNextToken(v string) *ListWebExperiencesInput { - s.NextToken = &v - return s -} - -type ListWebExperiencesOutput struct { - _ struct{} `type:"structure"` - - // If the response is truncated, Amazon Q returns this token, which you can - // use in a later request to list the next set of messages. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // An array of summary information for one or more Amazon Q experiences. - WebExperiences []*WebExperience `locationName:"webExperiences" type:"list"` -} - -// 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 ListWebExperiencesOutput) 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 ListWebExperiencesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWebExperiencesOutput) SetNextToken(v string) *ListWebExperiencesOutput { - s.NextToken = &v - return s -} - -// SetWebExperiences sets the WebExperiences field's value. -func (s *ListWebExperiencesOutput) SetWebExperiences(v []*WebExperience) *ListWebExperiencesOutput { - s.WebExperiences = v - return s -} - -// The sub groups that belong to a group. -type MemberGroup struct { - _ struct{} `type:"structure"` - - // The name of the sub group. - // - // GroupName is a required field - GroupName *string `locationName:"groupName" min:"1" type:"string" required:"true"` - - // The type of the sub group. - Type *string `locationName:"type" type:"string" enum:"MembershipType"` -} - -// 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 MemberGroup) 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 MemberGroup) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MemberGroup) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MemberGroup"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *MemberGroup) SetGroupName(v string) *MemberGroup { - s.GroupName = &v - return s -} - -// SetType sets the Type field's value. -func (s *MemberGroup) SetType(v string) *MemberGroup { - s.Type = &v - return s -} - -// The users that belong to a group. -type MemberUser struct { - _ struct{} `type:"structure"` - - // The type of the user. - Type *string `locationName:"type" type:"string" enum:"MembershipType"` - - // The identifier of the user you want to map to a group. - // - // UserId is a required field - UserId *string `locationName:"userId" min:"1" 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 MemberUser) 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 MemberUser) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MemberUser) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MemberUser"} - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetType sets the Type field's value. -func (s *MemberUser) SetType(v string) *MemberUser { - s.Type = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *MemberUser) SetUserId(v string) *MemberUser { - s.UserId = &v - return s -} - -// A message in an Amazon Q web experience. -type Message struct { - _ struct{} `type:"structure"` - - // An output event that Amazon Q returns to an user who wants to perform a plugin - // action during a non-streaming chat conversation. It contains information - // about the selected action with a list of possible user input fields, some - // pre-populated by Amazon Q. - ActionReview *ActionReview `locationName:"actionReview" type:"structure"` - - // A file directly uploaded into an Amazon Q web experience chat. - Attachments []*AttachmentOutput_ `locationName:"attachments" type:"list"` - - // The content of the Amazon Q web experience message. - Body *string `locationName:"body" type:"string"` - - // The identifier of the Amazon Q web experience message. - MessageId *string `locationName:"messageId" min:"1" type:"string"` - - // The source documents used to generate Amazon Q web experience message. - SourceAttribution []*SourceAttribution `locationName:"sourceAttribution" type:"list"` - - // The timestamp of the first Amazon Q web experience message. - Time *time.Time `locationName:"time" type:"timestamp"` - - // The type of Amazon Q message, whether HUMAN or AI generated. - Type *string `locationName:"type" type:"string" enum:"MessageType"` -} - -// 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 Message) 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 Message) GoString() string { - return s.String() -} - -// SetActionReview sets the ActionReview field's value. -func (s *Message) SetActionReview(v *ActionReview) *Message { - s.ActionReview = v - return s -} - -// SetAttachments sets the Attachments field's value. -func (s *Message) SetAttachments(v []*AttachmentOutput_) *Message { - s.Attachments = v - return s -} - -// SetBody sets the Body field's value. -func (s *Message) SetBody(v string) *Message { - s.Body = &v - return s -} - -// SetMessageId sets the MessageId field's value. -func (s *Message) SetMessageId(v string) *Message { - s.MessageId = &v - return s -} - -// SetSourceAttribution sets the SourceAttribution field's value. -func (s *Message) SetSourceAttribution(v []*SourceAttribution) *Message { - s.SourceAttribution = v - return s -} - -// SetTime sets the Time field's value. -func (s *Message) SetTime(v time.Time) *Message { - s.Time = &v - return s -} - -// SetType sets the Type field's value. -func (s *Message) SetType(v string) *Message { - s.Type = &v - return s -} - -// End user feedback on an AI-generated web experience chat message usefulness. -type MessageUsefulnessFeedback struct { - _ struct{} `type:"structure"` - - // A comment given by an end user on the usefulness of an AI-generated chat - // message. - Comment *string `locationName:"comment" type:"string"` - - // The reason for a usefulness rating. - Reason *string `locationName:"reason" type:"string" enum:"MessageUsefulnessReason"` - - // The timestamp for when the feedback was submitted. - // - // SubmittedAt is a required field - SubmittedAt *time.Time `locationName:"submittedAt" type:"timestamp" required:"true"` - - // The usefulness value assigned by an end user to a message. - // - // Usefulness is a required field - Usefulness *string `locationName:"usefulness" type:"string" required:"true" enum:"MessageUsefulness"` -} - -// 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 MessageUsefulnessFeedback) 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 MessageUsefulnessFeedback) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MessageUsefulnessFeedback) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MessageUsefulnessFeedback"} - if s.SubmittedAt == nil { - invalidParams.Add(request.NewErrParamRequired("SubmittedAt")) - } - if s.Usefulness == nil { - invalidParams.Add(request.NewErrParamRequired("Usefulness")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComment sets the Comment field's value. -func (s *MessageUsefulnessFeedback) SetComment(v string) *MessageUsefulnessFeedback { - s.Comment = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *MessageUsefulnessFeedback) SetReason(v string) *MessageUsefulnessFeedback { - s.Reason = &v - return s -} - -// SetSubmittedAt sets the SubmittedAt field's value. -func (s *MessageUsefulnessFeedback) SetSubmittedAt(v time.Time) *MessageUsefulnessFeedback { - s.SubmittedAt = &v - return s -} - -// SetUsefulness sets the Usefulness field's value. -func (s *MessageUsefulnessFeedback) SetUsefulness(v string) *MessageUsefulnessFeedback { - s.Usefulness = &v - return s -} - -// Configuration information for an Amazon Q index. -type NativeIndexConfiguration struct { - _ struct{} `type:"structure"` - - // The identifier for the Amazon Q index. - // - // IndexId is a required field - IndexId *string `locationName:"indexId" min:"36" 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 NativeIndexConfiguration) 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 NativeIndexConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NativeIndexConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NativeIndexConfiguration"} - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIndexId sets the IndexId field's value. -func (s *NativeIndexConfiguration) SetIndexId(v string) *NativeIndexConfiguration { - s.IndexId = &v - return s -} - -// Information about the OAuth 2.0 authentication credential/token used to configure -// a plugin. -type OAuth2ClientCredentialConfiguration struct { - _ struct{} `type:"structure"` - - // The ARN of an IAM role used by Amazon Q to access the OAuth 2.0 authentication - // credentials stored in a Secrets Manager secret. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The ARN of the Secrets Manager secret that stores the OAuth 2.0 credentials/token - // used for plugin configuration. - // - // SecretArn is a required field - SecretArn *string `locationName:"secretArn" 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 OAuth2ClientCredentialConfiguration) 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 OAuth2ClientCredentialConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OAuth2ClientCredentialConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OAuth2ClientCredentialConfiguration"} - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.SecretArn == nil { - invalidParams.Add(request.NewErrParamRequired("SecretArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRoleArn sets the RoleArn field's value. -func (s *OAuth2ClientCredentialConfiguration) SetRoleArn(v string) *OAuth2ClientCredentialConfiguration { - s.RoleArn = &v - return s -} - -// SetSecretArn sets the SecretArn field's value. -func (s *OAuth2ClientCredentialConfiguration) SetSecretArn(v string) *OAuth2ClientCredentialConfiguration { - s.SecretArn = &v - return s -} - -// Information about an Amazon Q plugin and its configuration. -type Plugin struct { - _ struct{} `type:"structure"` - - // The timestamp for when the plugin was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The name of the plugin. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The identifier of the plugin. - PluginId *string `locationName:"pluginId" min:"36" type:"string"` - - // The plugin server URL used for configuration. - ServerUrl *string `locationName:"serverUrl" min:"1" type:"string"` - - // The current status of the plugin. - State *string `locationName:"state" type:"string" enum:"PluginState"` - - // The type of the plugin. - Type *string `locationName:"type" type:"string" enum:"PluginType"` - - // The timestamp for when the plugin was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 Plugin) 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 Plugin) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Plugin) SetCreatedAt(v time.Time) *Plugin { - s.CreatedAt = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Plugin) SetDisplayName(v string) *Plugin { - s.DisplayName = &v - return s -} - -// SetPluginId sets the PluginId field's value. -func (s *Plugin) SetPluginId(v string) *Plugin { - s.PluginId = &v - return s -} - -// SetServerUrl sets the ServerUrl field's value. -func (s *Plugin) SetServerUrl(v string) *Plugin { - s.ServerUrl = &v - return s -} - -// SetState sets the State field's value. -func (s *Plugin) SetState(v string) *Plugin { - s.State = &v - return s -} - -// SetType sets the Type field's value. -func (s *Plugin) SetType(v string) *Plugin { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Plugin) SetUpdatedAt(v time.Time) *Plugin { - s.UpdatedAt = &v - return s -} - -// Authentication configuration information for an Amazon Q plugin. -type PluginAuthConfiguration struct { - _ struct{} `type:"structure"` - - // Information about the basic authentication credentials used to configure - // a plugin. - BasicAuthConfiguration *BasicAuthConfiguration `locationName:"basicAuthConfiguration" type:"structure"` - - // Information about the OAuth 2.0 authentication credential/token used to configure - // a plugin. - OAuth2ClientCredentialConfiguration *OAuth2ClientCredentialConfiguration `locationName:"oAuth2ClientCredentialConfiguration" 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 PluginAuthConfiguration) 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 PluginAuthConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PluginAuthConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PluginAuthConfiguration"} - if s.BasicAuthConfiguration != nil { - if err := s.BasicAuthConfiguration.Validate(); err != nil { - invalidParams.AddNested("BasicAuthConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.OAuth2ClientCredentialConfiguration != nil { - if err := s.OAuth2ClientCredentialConfiguration.Validate(); err != nil { - invalidParams.AddNested("OAuth2ClientCredentialConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBasicAuthConfiguration sets the BasicAuthConfiguration field's value. -func (s *PluginAuthConfiguration) SetBasicAuthConfiguration(v *BasicAuthConfiguration) *PluginAuthConfiguration { - s.BasicAuthConfiguration = v - return s -} - -// SetOAuth2ClientCredentialConfiguration sets the OAuth2ClientCredentialConfiguration field's value. -func (s *PluginAuthConfiguration) SetOAuth2ClientCredentialConfiguration(v *OAuth2ClientCredentialConfiguration) *PluginAuthConfiguration { - s.OAuth2ClientCredentialConfiguration = v - return s -} - -// Provides user and group information used for filtering documents to use for -// generating Amazon Q conversation responses. -type Principal struct { - _ struct{} `type:"structure"` - - // The group associated with the principal. - Group *PrincipalGroup `locationName:"group" type:"structure"` - - // The user associated with the principal. - User *PrincipalUser `locationName:"user" 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 Principal) 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 Principal) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Principal) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Principal"} - if s.Group != nil { - if err := s.Group.Validate(); err != nil { - invalidParams.AddNested("Group", err.(request.ErrInvalidParams)) - } - } - if s.User != nil { - if err := s.User.Validate(); err != nil { - invalidParams.AddNested("User", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroup sets the Group field's value. -func (s *Principal) SetGroup(v *PrincipalGroup) *Principal { - s.Group = v - return s -} - -// SetUser sets the User field's value. -func (s *Principal) SetUser(v *PrincipalUser) *Principal { - s.User = v - return s -} - -// Provides information about a group associated with the principal. -type PrincipalGroup struct { - _ struct{} `type:"structure"` - - // Provides information about whether to allow or deny access to the principal. - // - // Access is a required field - Access *string `locationName:"access" type:"string" required:"true" enum:"ReadAccessType"` - - // The type of group. - MembershipType *string `locationName:"membershipType" type:"string" enum:"MembershipType"` - - // The name of the group. - Name *string `locationName:"name" min:"1" 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 PrincipalGroup) 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 PrincipalGroup) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrincipalGroup) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrincipalGroup"} - if s.Access == nil { - invalidParams.Add(request.NewErrParamRequired("Access")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccess sets the Access field's value. -func (s *PrincipalGroup) SetAccess(v string) *PrincipalGroup { - s.Access = &v - return s -} - -// SetMembershipType sets the MembershipType field's value. -func (s *PrincipalGroup) SetMembershipType(v string) *PrincipalGroup { - s.MembershipType = &v - return s -} - -// SetName sets the Name field's value. -func (s *PrincipalGroup) SetName(v string) *PrincipalGroup { - s.Name = &v - return s -} - -// Provides information about a user associated with a principal. -type PrincipalUser struct { - _ struct{} `type:"structure"` - - // Provides information about whether to allow or deny access to the principal. - // - // Access is a required field - Access *string `locationName:"access" type:"string" required:"true" enum:"ReadAccessType"` - - // The identifier of the user. - Id *string `locationName:"id" min:"1" type:"string"` - - // The type of group. - MembershipType *string `locationName:"membershipType" type:"string" enum:"MembershipType"` -} - -// 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 PrincipalUser) 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 PrincipalUser) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PrincipalUser) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PrincipalUser"} - if s.Access == nil { - invalidParams.Add(request.NewErrParamRequired("Access")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccess sets the Access field's value. -func (s *PrincipalUser) SetAccess(v string) *PrincipalUser { - s.Access = &v - return s -} - -// SetId sets the Id field's value. -func (s *PrincipalUser) SetId(v string) *PrincipalUser { - s.Id = &v - return s -} - -// SetMembershipType sets the MembershipType field's value. -func (s *PrincipalUser) SetMembershipType(v string) *PrincipalUser { - s.MembershipType = &v - return s -} - -type PutFeedbackInput struct { - _ struct{} `type:"structure"` - - // The identifier of the application associated with the feedback. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the conversation the feedback is attached to. - // - // ConversationId is a required field - ConversationId *string `location:"uri" locationName:"conversationId" min:"36" type:"string" required:"true"` - - // The timestamp for when the feedback was recorded. - MessageCopiedAt *time.Time `locationName:"messageCopiedAt" type:"timestamp"` - - // The identifier of the chat message that the feedback was given for. - // - // MessageId is a required field - MessageId *string `location:"uri" locationName:"messageId" min:"36" type:"string" required:"true"` - - // The feedback usefulness value given by the user to the chat message. - MessageUsefulness *MessageUsefulnessFeedback `locationName:"messageUsefulness" type:"structure"` - - // The identifier of the user giving the feedback. - // - // UserId is a required field - UserId *string `location:"querystring" locationName:"userId" min:"1" 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 PutFeedbackInput) 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 PutFeedbackInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutFeedbackInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutFeedbackInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.ConversationId == nil { - invalidParams.Add(request.NewErrParamRequired("ConversationId")) - } - if s.ConversationId != nil && len(*s.ConversationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ConversationId", 36)) - } - if s.MessageId == nil { - invalidParams.Add(request.NewErrParamRequired("MessageId")) - } - if s.MessageId != nil && len(*s.MessageId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("MessageId", 36)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - if s.MessageUsefulness != nil { - if err := s.MessageUsefulness.Validate(); err != nil { - invalidParams.AddNested("MessageUsefulness", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *PutFeedbackInput) SetApplicationId(v string) *PutFeedbackInput { - s.ApplicationId = &v - return s -} - -// SetConversationId sets the ConversationId field's value. -func (s *PutFeedbackInput) SetConversationId(v string) *PutFeedbackInput { - s.ConversationId = &v - return s -} - -// SetMessageCopiedAt sets the MessageCopiedAt field's value. -func (s *PutFeedbackInput) SetMessageCopiedAt(v time.Time) *PutFeedbackInput { - s.MessageCopiedAt = &v - return s -} - -// SetMessageId sets the MessageId field's value. -func (s *PutFeedbackInput) SetMessageId(v string) *PutFeedbackInput { - s.MessageId = &v - return s -} - -// SetMessageUsefulness sets the MessageUsefulness field's value. -func (s *PutFeedbackInput) SetMessageUsefulness(v *MessageUsefulnessFeedback) *PutFeedbackInput { - s.MessageUsefulness = v - return s -} - -// SetUserId sets the UserId field's value. -func (s *PutFeedbackInput) SetUserId(v string) *PutFeedbackInput { - s.UserId = &v - return s -} - -type PutFeedbackOutput 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 PutFeedbackOutput) 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 PutFeedbackOutput) GoString() string { - return s.String() -} - -type PutGroupInput struct { - _ struct{} `type:"structure"` - - // The identifier of the application in which the user and group mapping belongs. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source for which you want to map users to their - // groups. This is useful if a group is tied to multiple data sources, but you - // only want the group to access documents of a certain data source. For example, - // the groups "Research", "Engineering", and "Sales and Marketing" are all tied - // to the company's documents stored in the data sources Confluence and Salesforce. - // However, "Sales and Marketing" team only needs access to customer-related - // documents stored in Salesforce. - DataSourceId *string `locationName:"dataSourceId" min:"36" type:"string"` - - // A list of users or sub groups that belong to a group. This is for generating - // Amazon Q chat results only from document a user has access to. - // - // GroupMembers is a required field - GroupMembers *GroupMembers `locationName:"groupMembers" type:"structure" required:"true"` - - // The list that contains your users or sub groups that belong the same group. - // For example, the group "Company" includes the user "CEO" and the sub groups - // "Research", "Engineering", and "Sales and Marketing". - // - // If you have more than 1000 users and/or sub groups for a single group, you - // need to provide the path to the S3 file that lists your users and sub groups - // for a group. Your sub groups can contain more than 1000 users, but the list - // of sub groups that belong to a group (and/or users) must be no more than - // 1000. - // - // GroupName is a required field - GroupName *string `locationName:"groupName" min:"1" type:"string" required:"true"` - - // The identifier of the index in which you want to map users to their groups. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" type:"string" required:"true"` - - // The type of the group. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"MembershipType"` -} - -// 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 PutGroupInput) 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 PutGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutGroupInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.GroupMembers == nil { - invalidParams.Add(request.NewErrParamRequired("GroupMembers")) - } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.GroupMembers != nil { - if err := s.GroupMembers.Validate(); err != nil { - invalidParams.AddNested("GroupMembers", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *PutGroupInput) SetApplicationId(v string) *PutGroupInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *PutGroupInput) SetDataSourceId(v string) *PutGroupInput { - s.DataSourceId = &v - return s -} - -// SetGroupMembers sets the GroupMembers field's value. -func (s *PutGroupInput) SetGroupMembers(v *GroupMembers) *PutGroupInput { - s.GroupMembers = v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *PutGroupInput) SetGroupName(v string) *PutGroupInput { - s.GroupName = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *PutGroupInput) SetIndexId(v string) *PutGroupInput { - s.IndexId = &v - return s -} - -// SetType sets the Type field's value. -func (s *PutGroupInput) SetType(v string) *PutGroupInput { - s.Type = &v - return s -} - -type PutGroupOutput 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 PutGroupOutput) 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 PutGroupOutput) GoString() string { - return s.String() -} - -// The resource you want to use doesn’t exist. Make sure you have provided -// the correct resource and try again. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The message describing a ResourceNotFoundException. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The identifier of the resource affected. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" min:"1" type:"string" required:"true"` - - // The type of the resource affected. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" min:"1" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Summary information for the retriever used for your Amazon Q application. -type Retriever struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application using the retriever. - ApplicationId *string `locationName:"applicationId" min:"36" type:"string"` - - // The name of your retriever. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The identifier of the retriever used by your Amazon Q application. - RetrieverId *string `locationName:"retrieverId" min:"36" type:"string"` - - // The status of your retriever. - Status *string `locationName:"status" type:"string" enum:"RetrieverStatus"` - - // The type of your retriever. - Type *string `locationName:"type" type:"string" enum:"RetrieverType"` -} - -// 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 Retriever) 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 Retriever) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *Retriever) SetApplicationId(v string) *Retriever { - s.ApplicationId = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Retriever) SetDisplayName(v string) *Retriever { - s.DisplayName = &v - return s -} - -// SetRetrieverId sets the RetrieverId field's value. -func (s *Retriever) SetRetrieverId(v string) *Retriever { - s.RetrieverId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Retriever) SetStatus(v string) *Retriever { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *Retriever) SetType(v string) *Retriever { - s.Type = &v - return s -} - -// Provides information on how the retriever used for your Amazon Q application -// is configured. -type RetrieverConfiguration struct { - _ struct{} `type:"structure"` - - // Provides information on how the Amazon Kendra index used as a retriever for - // your Amazon Q application is configured. - KendraIndexConfiguration *KendraIndexConfiguration `locationName:"kendraIndexConfiguration" type:"structure"` - - // Provides information on how a Amazon Q index used as a retriever for your - // Amazon Q application is configured. - NativeIndexConfiguration *NativeIndexConfiguration `locationName:"nativeIndexConfiguration" 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 RetrieverConfiguration) 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 RetrieverConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetrieverConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetrieverConfiguration"} - if s.KendraIndexConfiguration != nil { - if err := s.KendraIndexConfiguration.Validate(); err != nil { - invalidParams.AddNested("KendraIndexConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.NativeIndexConfiguration != nil { - if err := s.NativeIndexConfiguration.Validate(); err != nil { - invalidParams.AddNested("NativeIndexConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKendraIndexConfiguration sets the KendraIndexConfiguration field's value. -func (s *RetrieverConfiguration) SetKendraIndexConfiguration(v *KendraIndexConfiguration) *RetrieverConfiguration { - s.KendraIndexConfiguration = v - return s -} - -// SetNativeIndexConfiguration sets the NativeIndexConfiguration field's value. -func (s *RetrieverConfiguration) SetNativeIndexConfiguration(v *NativeIndexConfiguration) *RetrieverConfiguration { - s.NativeIndexConfiguration = v - return s -} - -// Guardrail rules for an Amazon Q application. Amazon Q supports only one rule -// at a time. -type Rule struct { - _ struct{} `type:"structure"` - - // Users and groups to be excluded from a rule. - ExcludedUsersAndGroups *UsersAndGroups `locationName:"excludedUsersAndGroups" type:"structure"` - - // Users and groups to be included in a rule. - IncludedUsersAndGroups *UsersAndGroups `locationName:"includedUsersAndGroups" type:"structure"` - - // The configuration information for a rule. - RuleConfiguration *RuleConfiguration `locationName:"ruleConfiguration" type:"structure"` - - // The type fo rule. - // - // RuleType is a required field - RuleType *string `locationName:"ruleType" type:"string" required:"true" enum:"RuleType"` -} - -// 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 Rule) 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 Rule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Rule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Rule"} - if s.RuleType == nil { - invalidParams.Add(request.NewErrParamRequired("RuleType")) - } - if s.RuleConfiguration != nil { - if err := s.RuleConfiguration.Validate(); err != nil { - invalidParams.AddNested("RuleConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExcludedUsersAndGroups sets the ExcludedUsersAndGroups field's value. -func (s *Rule) SetExcludedUsersAndGroups(v *UsersAndGroups) *Rule { - s.ExcludedUsersAndGroups = v - return s -} - -// SetIncludedUsersAndGroups sets the IncludedUsersAndGroups field's value. -func (s *Rule) SetIncludedUsersAndGroups(v *UsersAndGroups) *Rule { - s.IncludedUsersAndGroups = v - return s -} - -// SetRuleConfiguration sets the RuleConfiguration field's value. -func (s *Rule) SetRuleConfiguration(v *RuleConfiguration) *Rule { - s.RuleConfiguration = v - return s -} - -// SetRuleType sets the RuleType field's value. -func (s *Rule) SetRuleType(v string) *Rule { - s.RuleType = &v - return s -} - -// Provides configuration information about a rule. -type RuleConfiguration struct { - _ struct{} `type:"structure"` - - // A rule for configuring how Amazon Q responds when it encounters a a blocked - // topic. - ContentBlockerRule *ContentBlockerRule `locationName:"contentBlockerRule" type:"structure"` - - // Rules for retrieving content from data sources connected to a Amazon Q application - // for a specific topic control configuration. - ContentRetrievalRule *ContentRetrievalRule `locationName:"contentRetrievalRule" 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 RuleConfiguration) 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 RuleConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RuleConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RuleConfiguration"} - if s.ContentRetrievalRule != nil { - if err := s.ContentRetrievalRule.Validate(); err != nil { - invalidParams.AddNested("ContentRetrievalRule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentBlockerRule sets the ContentBlockerRule field's value. -func (s *RuleConfiguration) SetContentBlockerRule(v *ContentBlockerRule) *RuleConfiguration { - s.ContentBlockerRule = v - return s -} - -// SetContentRetrievalRule sets the ContentRetrievalRule field's value. -func (s *RuleConfiguration) SetContentRetrievalRule(v *ContentRetrievalRule) *RuleConfiguration { - s.ContentRetrievalRule = v - return s -} - -// Information required for Amazon Q to find a specific file in an Amazon S3 -// bucket. -type S3 struct { - _ struct{} `type:"structure"` - - // The name of the S3 bucket that contains the file. - // - // Bucket is a required field - Bucket *string `locationName:"bucket" min:"1" type:"string" required:"true"` - - // The name of the file. - // - // Key is a required field - Key *string `locationName:"key" min:"1" 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 S3) 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 S3) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *S3) SetBucket(v string) *S3 { - s.Bucket = &v - return s -} - -// SetKey sets the Key field's value. -func (s *S3) SetKey(v string) *S3 { - s.Key = &v - return s -} - -// Provides the SAML 2.0 compliant identity provider (IdP) configuration information -// Amazon Q needs to deploy a Amazon Q web experience. -type SamlConfiguration struct { - _ struct{} `type:"structure"` - - // The metadata XML that your IdP generated. - // - // MetadataXML is a required field - MetadataXML *string `locationName:"metadataXML" min:"1000" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of an IAM role assumed by users when they - // authenticate into their Amazon Q web experience, containing the relevant - // Amazon Q permissions for conversing with Amazon Q. - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` - - // The group attribute name in your IdP that maps to user groups. - UserGroupAttribute *string `locationName:"userGroupAttribute" min:"1" type:"string"` - - // The user attribute name in your IdP that maps to the user email. - // - // UserIdAttribute is a required field - UserIdAttribute *string `locationName:"userIdAttribute" min:"1" 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 SamlConfiguration) 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 SamlConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SamlConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SamlConfiguration"} - if s.MetadataXML == nil { - invalidParams.Add(request.NewErrParamRequired("MetadataXML")) - } - if s.MetadataXML != nil && len(*s.MetadataXML) < 1000 { - invalidParams.Add(request.NewErrParamMinLen("MetadataXML", 1000)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.UserGroupAttribute != nil && len(*s.UserGroupAttribute) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserGroupAttribute", 1)) - } - if s.UserIdAttribute == nil { - invalidParams.Add(request.NewErrParamRequired("UserIdAttribute")) - } - if s.UserIdAttribute != nil && len(*s.UserIdAttribute) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserIdAttribute", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetadataXML sets the MetadataXML field's value. -func (s *SamlConfiguration) SetMetadataXML(v string) *SamlConfiguration { - s.MetadataXML = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *SamlConfiguration) SetRoleArn(v string) *SamlConfiguration { - s.RoleArn = &v - return s -} - -// SetUserGroupAttribute sets the UserGroupAttribute field's value. -func (s *SamlConfiguration) SetUserGroupAttribute(v string) *SamlConfiguration { - s.UserGroupAttribute = &v - return s -} - -// SetUserIdAttribute sets the UserIdAttribute field's value. -func (s *SamlConfiguration) SetUserIdAttribute(v string) *SamlConfiguration { - s.UserIdAttribute = &v - return s -} - -// You have exceeded the set limits for your Amazon Q service. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The message describing a ServiceQuotaExceededException. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The identifier of the resource affected. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" min:"1" type:"string" required:"true"` - - // The type of the resource affected. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" min:"1" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The documents used to generate an Amazon Q web experience response. -type SourceAttribution struct { - _ struct{} `type:"structure"` - - // The number attached to a citation in an Amazon Q generated response. - CitationNumber *int64 `locationName:"citationNumber" type:"integer"` - - // The content extract from the document on which the generated response is - // based. - Snippet *string `locationName:"snippet" min:"1" type:"string"` - - // A text extract from a source document that is used for source attribution. - TextMessageSegments []*TextSegment `locationName:"textMessageSegments" type:"list"` - - // The title of the document which is the source for the Amazon Q generated - // response. - Title *string `locationName:"title" min:"1" type:"string"` - - // The Unix timestamp when the Amazon Q application was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The URL of the document which is the source for the Amazon Q generated response. - Url *string `locationName:"url" min:"1" 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 SourceAttribution) 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 SourceAttribution) GoString() string { - return s.String() -} - -// SetCitationNumber sets the CitationNumber field's value. -func (s *SourceAttribution) SetCitationNumber(v int64) *SourceAttribution { - s.CitationNumber = &v - return s -} - -// SetSnippet sets the Snippet field's value. -func (s *SourceAttribution) SetSnippet(v string) *SourceAttribution { - s.Snippet = &v - return s -} - -// SetTextMessageSegments sets the TextMessageSegments field's value. -func (s *SourceAttribution) SetTextMessageSegments(v []*TextSegment) *SourceAttribution { - s.TextMessageSegments = v - return s -} - -// SetTitle sets the Title field's value. -func (s *SourceAttribution) SetTitle(v string) *SourceAttribution { - s.Title = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SourceAttribution) SetUpdatedAt(v time.Time) *SourceAttribution { - s.UpdatedAt = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *SourceAttribution) SetUrl(v string) *SourceAttribution { - s.Url = &v - return s -} - -type StartDataSourceSyncJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of Amazon Q application the data source is connected to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source connector. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" min:"36" type:"string" required:"true"` - - // The identifier of the index used with the data source connector. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 StartDataSourceSyncJobInput) 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 StartDataSourceSyncJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartDataSourceSyncJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartDataSourceSyncJobInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *StartDataSourceSyncJobInput) SetApplicationId(v string) *StartDataSourceSyncJobInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *StartDataSourceSyncJobInput) SetDataSourceId(v string) *StartDataSourceSyncJobInput { - s.DataSourceId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *StartDataSourceSyncJobInput) SetIndexId(v string) *StartDataSourceSyncJobInput { - s.IndexId = &v - return s -} - -type StartDataSourceSyncJobOutput struct { - _ struct{} `type:"structure"` - - // The identifier for a particular synchronization job. - ExecutionId *string `locationName:"executionId" min:"36" 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 StartDataSourceSyncJobOutput) 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 StartDataSourceSyncJobOutput) GoString() string { - return s.String() -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *StartDataSourceSyncJobOutput) SetExecutionId(v string) *StartDataSourceSyncJobOutput { - s.ExecutionId = &v - return s -} - -type StopDataSourceSyncJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q application that the data source is connected - // to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source connector. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" min:"36" type:"string" required:"true"` - - // The identifier of the index used with the Amazon Q data source connector. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 StopDataSourceSyncJobInput) 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 StopDataSourceSyncJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopDataSourceSyncJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopDataSourceSyncJobInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *StopDataSourceSyncJobInput) SetApplicationId(v string) *StopDataSourceSyncJobInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *StopDataSourceSyncJobInput) SetDataSourceId(v string) *StopDataSourceSyncJobInput { - s.DataSourceId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *StopDataSourceSyncJobInput) SetIndexId(v string) *StopDataSourceSyncJobInput { - s.IndexId = &v - return s -} - -type StopDataSourceSyncJobOutput 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 StopDataSourceSyncJobOutput) 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 StopDataSourceSyncJobOutput) GoString() string { - return s.String() -} - -// A list of key/value pairs that identify an index, FAQ, or data source. Tag -// keys and values can consist of Unicode letters, digits, white space, and -// any of the following symbols: _ . : / = + - @. -type Tag struct { - _ struct{} `type:"structure"` - - // The key for the tag. Keys are not case sensitive and must be unique for the - // Amazon Q application or data source. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // The value associated with the tag. The value may be an empty string but it - // can't be null. - // - // Value is a required field - Value *string `locationName:"value" 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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q application or data source - // to tag. - // - // ResourceARN is a required field - ResourceARN *string `location:"uri" locationName:"resourceARN" min:"1" type:"string" required:"true"` - - // A list of tag keys to add to the Amazon Q application or data source. If - // a tag already exists, the existing value is replaced with the new value. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Provides information about text documents in an index. -type TextDocumentStatistics struct { - _ struct{} `type:"structure"` - - // The total size, in bytes, of the indexed documents. - IndexedTextBytes *int64 `locationName:"indexedTextBytes" type:"long"` - - // The number of text documents indexed. - IndexedTextDocumentCount *int64 `locationName:"indexedTextDocumentCount" 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 TextDocumentStatistics) 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 TextDocumentStatistics) GoString() string { - return s.String() -} - -// SetIndexedTextBytes sets the IndexedTextBytes field's value. -func (s *TextDocumentStatistics) SetIndexedTextBytes(v int64) *TextDocumentStatistics { - s.IndexedTextBytes = &v - return s -} - -// SetIndexedTextDocumentCount sets the IndexedTextDocumentCount field's value. -func (s *TextDocumentStatistics) SetIndexedTextDocumentCount(v int64) *TextDocumentStatistics { - s.IndexedTextDocumentCount = &v - return s -} - -// Provides information about a text extract in a chat response that can be -// attributed to a source document. -type TextSegment struct { - _ struct{} `type:"structure"` - - // The zero-based location in the response string where the source attribution - // starts. - BeginOffset *int64 `locationName:"beginOffset" type:"integer"` - - // The zero-based location in the response string where the source attribution - // ends. - EndOffset *int64 `locationName:"endOffset" 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 TextSegment) 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 TextSegment) GoString() string { - return s.String() -} - -// SetBeginOffset sets the BeginOffset field's value. -func (s *TextSegment) SetBeginOffset(v int64) *TextSegment { - s.BeginOffset = &v - return s -} - -// SetEndOffset sets the EndOffset field's value. -func (s *TextSegment) SetEndOffset(v int64) *TextSegment { - s.EndOffset = &v - return s -} - -// The request was denied due to throttling. Reduce the number of requests and -// try again. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" min:"1" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The topic specific controls configured for an Amazon Q application. -type TopicConfiguration struct { - _ struct{} `type:"structure"` - - // A description for your topic control configuration. Use this outline how - // the large language model (LLM) should use this topic control configuration. - Description *string `locationName:"description" type:"string"` - - // A list of example phrases that you expect the end user to use in relation - // to the topic. - ExampleChatMessages []*string `locationName:"exampleChatMessages" type:"list"` - - // A name for your topic control configuration. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Rules defined for a topic configuration. - // - // Rules is a required field - Rules []*Rule `locationName:"rules" type:"list" 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 TopicConfiguration) 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 TopicConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TopicConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TopicConfiguration"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *TopicConfiguration) SetDescription(v string) *TopicConfiguration { - s.Description = &v - return s -} - -// SetExampleChatMessages sets the ExampleChatMessages field's value. -func (s *TopicConfiguration) SetExampleChatMessages(v []*string) *TopicConfiguration { - s.ExampleChatMessages = v - return s -} - -// SetName sets the Name field's value. -func (s *TopicConfiguration) SetName(v string) *TopicConfiguration { - s.Name = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *TopicConfiguration) SetRules(v []*Rule) *TopicConfiguration { - s.Rules = v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Amazon Q application, or data source - // to remove the tag from. - // - // ResourceARN is a required field - ResourceARN *string `location:"uri" locationName:"resourceARN" min:"1" type:"string" required:"true"` - - // A list of tag keys to remove from the Amazon Q application or data source. - // If a tag key does not exist on the resource, it is ignored. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *UntagResourceInput) SetResourceARN(v string) *UntagResourceInput { - s.ResourceARN = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateApplicationInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // An option to allow end users to upload files directly during chat. - AttachmentsConfiguration *AttachmentsConfiguration `locationName:"attachmentsConfiguration" type:"structure"` - - // A description for the Amazon Q application. - Description *string `locationName:"description" type:"string"` - - // A name for the Amazon Q application. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // An Amazon Web Services Identity and Access Management (IAM) role that gives - // Amazon Q permission to access Amazon CloudWatch logs and metrics. - RoleArn *string `locationName:"roleArn" 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 UpdateApplicationInput) 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 UpdateApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.AttachmentsConfiguration != nil { - if err := s.AttachmentsConfiguration.Validate(); err != nil { - invalidParams.AddNested("AttachmentsConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateApplicationInput) SetApplicationId(v string) *UpdateApplicationInput { - s.ApplicationId = &v - return s -} - -// SetAttachmentsConfiguration sets the AttachmentsConfiguration field's value. -func (s *UpdateApplicationInput) SetAttachmentsConfiguration(v *AttachmentsConfiguration) *UpdateApplicationInput { - s.AttachmentsConfiguration = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateApplicationInput) SetDescription(v string) *UpdateApplicationInput { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *UpdateApplicationInput) SetDisplayName(v string) *UpdateApplicationInput { - s.DisplayName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateApplicationInput) SetRoleArn(v string) *UpdateApplicationInput { - s.RoleArn = &v - return s -} - -type UpdateApplicationOutput 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 UpdateApplicationOutput) 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 UpdateApplicationOutput) GoString() string { - return s.String() -} - -type UpdateChatControlsConfigurationInput struct { - _ struct{} `type:"structure"` - - // The identifier of the application for which the chat controls are configured. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The phrases blocked from chat by your chat control configuration. - BlockedPhrasesConfigurationUpdate *BlockedPhrasesConfigurationUpdate `locationName:"blockedPhrasesConfigurationUpdate" type:"structure"` - - // A token that you provide to identify the request to update a Amazon Q application - // chat configuration. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The response scope configured for your application. This determines whether - // your application uses its retrieval augmented generation (RAG) system to - // generate answers only from your enterprise data, or also uses the large language - // models (LLM) knowledge to respons to end user questions in chat. - ResponseScope *string `locationName:"responseScope" type:"string" enum:"ResponseScope"` - - // The configured topic specific chat controls you want to update. - TopicConfigurationsToCreateOrUpdate []*TopicConfiguration `locationName:"topicConfigurationsToCreateOrUpdate" type:"list"` - - // The configured topic specific chat controls you want to delete. - TopicConfigurationsToDelete []*TopicConfiguration `locationName:"topicConfigurationsToDelete" type:"list"` -} - -// 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 UpdateChatControlsConfigurationInput) 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 UpdateChatControlsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateChatControlsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateChatControlsConfigurationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.TopicConfigurationsToCreateOrUpdate != nil { - for i, v := range s.TopicConfigurationsToCreateOrUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TopicConfigurationsToCreateOrUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - if s.TopicConfigurationsToDelete != nil { - for i, v := range s.TopicConfigurationsToDelete { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TopicConfigurationsToDelete", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateChatControlsConfigurationInput) SetApplicationId(v string) *UpdateChatControlsConfigurationInput { - s.ApplicationId = &v - return s -} - -// SetBlockedPhrasesConfigurationUpdate sets the BlockedPhrasesConfigurationUpdate field's value. -func (s *UpdateChatControlsConfigurationInput) SetBlockedPhrasesConfigurationUpdate(v *BlockedPhrasesConfigurationUpdate) *UpdateChatControlsConfigurationInput { - s.BlockedPhrasesConfigurationUpdate = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateChatControlsConfigurationInput) SetClientToken(v string) *UpdateChatControlsConfigurationInput { - s.ClientToken = &v - return s -} - -// SetResponseScope sets the ResponseScope field's value. -func (s *UpdateChatControlsConfigurationInput) SetResponseScope(v string) *UpdateChatControlsConfigurationInput { - s.ResponseScope = &v - return s -} - -// SetTopicConfigurationsToCreateOrUpdate sets the TopicConfigurationsToCreateOrUpdate field's value. -func (s *UpdateChatControlsConfigurationInput) SetTopicConfigurationsToCreateOrUpdate(v []*TopicConfiguration) *UpdateChatControlsConfigurationInput { - s.TopicConfigurationsToCreateOrUpdate = v - return s -} - -// SetTopicConfigurationsToDelete sets the TopicConfigurationsToDelete field's value. -func (s *UpdateChatControlsConfigurationInput) SetTopicConfigurationsToDelete(v []*TopicConfiguration) *UpdateChatControlsConfigurationInput { - s.TopicConfigurationsToDelete = v - return s -} - -type UpdateChatControlsConfigurationOutput 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 UpdateChatControlsConfigurationOutput) 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 UpdateChatControlsConfigurationOutput) GoString() string { - return s.String() -} - -type UpdateDataSourceInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application the data source is attached to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The identifier of the data source connector. - // - // DataSourceId is a required field - DataSourceId *string `location:"uri" locationName:"dataSourceId" min:"36" type:"string" required:"true"` - - // The description of the data source connector. - Description *string `locationName:"description" type:"string"` - - // A name of the data source connector. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // Provides the configuration information for altering document metadata and - // content during the document ingestion process. - // - // For more information, see Custom document enrichment (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - DocumentEnrichmentConfiguration *DocumentEnrichmentConfiguration `locationName:"documentEnrichmentConfiguration" type:"structure"` - - // The identifier of the index attached to the data source connector. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of an IAM role with permission to access the - // data source and required resources. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The chosen update frequency for your data source. - SyncSchedule *string `locationName:"syncSchedule" type:"string"` - - // Provides configuration information needed to connect to an Amazon VPC (Virtual - // Private Cloud). - VpcConfiguration *DataSourceVpcConfiguration `locationName:"vpcConfiguration" 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 UpdateDataSourceInput) 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 UpdateDataSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDataSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDataSourceInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DataSourceId == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceId")) - } - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.DocumentEnrichmentConfiguration != nil { - if err := s.DocumentEnrichmentConfiguration.Validate(); err != nil { - invalidParams.AddNested("DocumentEnrichmentConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.VpcConfiguration != nil { - if err := s.VpcConfiguration.Validate(); err != nil { - invalidParams.AddNested("VpcConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateDataSourceInput) SetApplicationId(v string) *UpdateDataSourceInput { - s.ApplicationId = &v - return s -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *UpdateDataSourceInput) SetDataSourceId(v string) *UpdateDataSourceInput { - s.DataSourceId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateDataSourceInput) SetDescription(v string) *UpdateDataSourceInput { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *UpdateDataSourceInput) SetDisplayName(v string) *UpdateDataSourceInput { - s.DisplayName = &v - return s -} - -// SetDocumentEnrichmentConfiguration sets the DocumentEnrichmentConfiguration field's value. -func (s *UpdateDataSourceInput) SetDocumentEnrichmentConfiguration(v *DocumentEnrichmentConfiguration) *UpdateDataSourceInput { - s.DocumentEnrichmentConfiguration = v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *UpdateDataSourceInput) SetIndexId(v string) *UpdateDataSourceInput { - s.IndexId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateDataSourceInput) SetRoleArn(v string) *UpdateDataSourceInput { - s.RoleArn = &v - return s -} - -// SetSyncSchedule sets the SyncSchedule field's value. -func (s *UpdateDataSourceInput) SetSyncSchedule(v string) *UpdateDataSourceInput { - s.SyncSchedule = &v - return s -} - -// SetVpcConfiguration sets the VpcConfiguration field's value. -func (s *UpdateDataSourceInput) SetVpcConfiguration(v *DataSourceVpcConfiguration) *UpdateDataSourceInput { - s.VpcConfiguration = v - return s -} - -type UpdateDataSourceOutput 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 UpdateDataSourceOutput) 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 UpdateDataSourceOutput) GoString() string { - return s.String() -} - -type UpdateIndexInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application connected to the index. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The storage capacity units you want to provision for your Amazon Q index. - // You can add and remove capacity to fit your usage needs. - CapacityConfiguration *IndexCapacityConfiguration `locationName:"capacityConfiguration" type:"structure"` - - // The description of the Amazon Q index. - Description *string `locationName:"description" type:"string"` - - // The name of the Amazon Q index. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // Configuration information for document metadata or fields. Document metadata - // are fields or attributes associated with your documents. For example, the - // company department name associated with each document. For more information, - // see Understanding document attributes (https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes). - DocumentAttributeConfigurations []*DocumentAttributeConfiguration `locationName:"documentAttributeConfigurations" min:"1" type:"list"` - - // The identifier of the Amazon Q index. - // - // IndexId is a required field - IndexId *string `location:"uri" locationName:"indexId" min:"36" 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 UpdateIndexInput) 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 UpdateIndexInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIndexInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIndexInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.DocumentAttributeConfigurations != nil && len(s.DocumentAttributeConfigurations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DocumentAttributeConfigurations", 1)) - } - if s.IndexId == nil { - invalidParams.Add(request.NewErrParamRequired("IndexId")) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.CapacityConfiguration != nil { - if err := s.CapacityConfiguration.Validate(); err != nil { - invalidParams.AddNested("CapacityConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.DocumentAttributeConfigurations != nil { - for i, v := range s.DocumentAttributeConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DocumentAttributeConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateIndexInput) SetApplicationId(v string) *UpdateIndexInput { - s.ApplicationId = &v - return s -} - -// SetCapacityConfiguration sets the CapacityConfiguration field's value. -func (s *UpdateIndexInput) SetCapacityConfiguration(v *IndexCapacityConfiguration) *UpdateIndexInput { - s.CapacityConfiguration = v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateIndexInput) SetDescription(v string) *UpdateIndexInput { - s.Description = &v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *UpdateIndexInput) SetDisplayName(v string) *UpdateIndexInput { - s.DisplayName = &v - return s -} - -// SetDocumentAttributeConfigurations sets the DocumentAttributeConfigurations field's value. -func (s *UpdateIndexInput) SetDocumentAttributeConfigurations(v []*DocumentAttributeConfiguration) *UpdateIndexInput { - s.DocumentAttributeConfigurations = v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *UpdateIndexInput) SetIndexId(v string) *UpdateIndexInput { - s.IndexId = &v - return s -} - -type UpdateIndexOutput 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 UpdateIndexOutput) 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 UpdateIndexOutput) GoString() string { - return s.String() -} - -type UpdatePluginInput struct { - _ struct{} `type:"structure"` - - // The identifier of the application the plugin is attached to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The authentication configuration the plugin is using. - AuthConfiguration *PluginAuthConfiguration `locationName:"authConfiguration" type:"structure"` - - // The name of the plugin. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The identifier of the plugin. - // - // PluginId is a required field - PluginId *string `location:"uri" locationName:"pluginId" min:"36" type:"string" required:"true"` - - // The source URL used for plugin configuration. - ServerUrl *string `locationName:"serverUrl" min:"1" type:"string"` - - // The status of the plugin. - State *string `locationName:"state" type:"string" enum:"PluginState"` -} - -// 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 UpdatePluginInput) 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 UpdatePluginInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePluginInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePluginInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.PluginId == nil { - invalidParams.Add(request.NewErrParamRequired("PluginId")) - } - if s.PluginId != nil && len(*s.PluginId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("PluginId", 36)) - } - if s.ServerUrl != nil && len(*s.ServerUrl) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServerUrl", 1)) - } - if s.AuthConfiguration != nil { - if err := s.AuthConfiguration.Validate(); err != nil { - invalidParams.AddNested("AuthConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdatePluginInput) SetApplicationId(v string) *UpdatePluginInput { - s.ApplicationId = &v - return s -} - -// SetAuthConfiguration sets the AuthConfiguration field's value. -func (s *UpdatePluginInput) SetAuthConfiguration(v *PluginAuthConfiguration) *UpdatePluginInput { - s.AuthConfiguration = v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *UpdatePluginInput) SetDisplayName(v string) *UpdatePluginInput { - s.DisplayName = &v - return s -} - -// SetPluginId sets the PluginId field's value. -func (s *UpdatePluginInput) SetPluginId(v string) *UpdatePluginInput { - s.PluginId = &v - return s -} - -// SetServerUrl sets the ServerUrl field's value. -func (s *UpdatePluginInput) SetServerUrl(v string) *UpdatePluginInput { - s.ServerUrl = &v - return s -} - -// SetState sets the State field's value. -func (s *UpdatePluginInput) SetState(v string) *UpdatePluginInput { - s.State = &v - return s -} - -type UpdatePluginOutput 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 UpdatePluginOutput) 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 UpdatePluginOutput) GoString() string { - return s.String() -} - -type UpdateRetrieverInput struct { - _ struct{} `type:"structure"` - - // The identifier of your Amazon Q application. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // Provides information on how the retriever used for your Amazon Q application - // is configured. - Configuration *RetrieverConfiguration `locationName:"configuration" type:"structure"` - - // The name of your retriever. - DisplayName *string `locationName:"displayName" min:"1" type:"string"` - - // The identifier of your retriever. - // - // RetrieverId is a required field - RetrieverId *string `location:"uri" locationName:"retrieverId" min:"36" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of an IAM role with permission to access the - // retriever and required resources. - RoleArn *string `locationName:"roleArn" 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 UpdateRetrieverInput) 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 UpdateRetrieverInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRetrieverInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRetrieverInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.DisplayName != nil && len(*s.DisplayName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) - } - if s.RetrieverId == nil { - invalidParams.Add(request.NewErrParamRequired("RetrieverId")) - } - if s.RetrieverId != nil && len(*s.RetrieverId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("RetrieverId", 36)) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateRetrieverInput) SetApplicationId(v string) *UpdateRetrieverInput { - s.ApplicationId = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *UpdateRetrieverInput) SetConfiguration(v *RetrieverConfiguration) *UpdateRetrieverInput { - s.Configuration = v - return s -} - -// SetDisplayName sets the DisplayName field's value. -func (s *UpdateRetrieverInput) SetDisplayName(v string) *UpdateRetrieverInput { - s.DisplayName = &v - return s -} - -// SetRetrieverId sets the RetrieverId field's value. -func (s *UpdateRetrieverInput) SetRetrieverId(v string) *UpdateRetrieverInput { - s.RetrieverId = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateRetrieverInput) SetRoleArn(v string) *UpdateRetrieverInput { - s.RoleArn = &v - return s -} - -type UpdateRetrieverOutput 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 UpdateRetrieverOutput) 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 UpdateRetrieverOutput) GoString() string { - return s.String() -} - -type UpdateUserInput struct { - _ struct{} `type:"structure"` - - // The identifier of the application the user is attached to. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The user aliases attached to the user id that are to be deleted. - UserAliasesToDelete []*UserAlias `locationName:"userAliasesToDelete" type:"list"` - - // The user aliases attached to the user id that are to be updated. - UserAliasesToUpdate []*UserAlias `locationName:"userAliasesToUpdate" type:"list"` - - // The email id attached to the user. - // - // UserId is a required field - UserId *string `location:"uri" locationName:"userId" min:"1" 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 UpdateUserInput) 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 UpdateUserInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateUserInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - if s.UserAliasesToDelete != nil { - for i, v := range s.UserAliasesToDelete { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UserAliasesToDelete", i), err.(request.ErrInvalidParams)) - } - } - } - if s.UserAliasesToUpdate != nil { - for i, v := range s.UserAliasesToUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "UserAliasesToUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateUserInput) SetApplicationId(v string) *UpdateUserInput { - s.ApplicationId = &v - return s -} - -// SetUserAliasesToDelete sets the UserAliasesToDelete field's value. -func (s *UpdateUserInput) SetUserAliasesToDelete(v []*UserAlias) *UpdateUserInput { - s.UserAliasesToDelete = v - return s -} - -// SetUserAliasesToUpdate sets the UserAliasesToUpdate field's value. -func (s *UpdateUserInput) SetUserAliasesToUpdate(v []*UserAlias) *UpdateUserInput { - s.UserAliasesToUpdate = v - return s -} - -// SetUserId sets the UserId field's value. -func (s *UpdateUserInput) SetUserId(v string) *UpdateUserInput { - s.UserId = &v - return s -} - -type UpdateUserOutput struct { - _ struct{} `type:"structure"` - - // The user aliases that have been to be added to a user id. - UserAliasesAdded []*UserAlias `locationName:"userAliasesAdded" type:"list"` - - // The user aliases that have been deleted from a user id. - UserAliasesDeleted []*UserAlias `locationName:"userAliasesDeleted" type:"list"` - - // The user aliases attached to a user id that have been updated. - UserAliasesUpdated []*UserAlias `locationName:"userAliasesUpdated" type:"list"` -} - -// 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 UpdateUserOutput) 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 UpdateUserOutput) GoString() string { - return s.String() -} - -// SetUserAliasesAdded sets the UserAliasesAdded field's value. -func (s *UpdateUserOutput) SetUserAliasesAdded(v []*UserAlias) *UpdateUserOutput { - s.UserAliasesAdded = v - return s -} - -// SetUserAliasesDeleted sets the UserAliasesDeleted field's value. -func (s *UpdateUserOutput) SetUserAliasesDeleted(v []*UserAlias) *UpdateUserOutput { - s.UserAliasesDeleted = v - return s -} - -// SetUserAliasesUpdated sets the UserAliasesUpdated field's value. -func (s *UpdateUserOutput) SetUserAliasesUpdated(v []*UserAlias) *UpdateUserOutput { - s.UserAliasesUpdated = v - return s -} - -type UpdateWebExperienceInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q application attached to the web experience. - // - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"applicationId" min:"36" type:"string" required:"true"` - - // The authentication configuration of the Amazon Q web experience. - AuthenticationConfiguration *WebExperienceAuthConfiguration `locationName:"authenticationConfiguration" type:"structure"` - - // Determines whether sample prompts are enabled in the web experience for an - // end user. - SamplePromptsControlMode *string `locationName:"samplePromptsControlMode" type:"string" enum:"WebExperienceSamplePromptsControlMode"` - - // The subtitle of the Amazon Q web experience. - Subtitle *string `locationName:"subtitle" type:"string"` - - // The title of the Amazon Q web experience. - Title *string `locationName:"title" type:"string"` - - // The identifier of the Amazon Q web experience. - // - // WebExperienceId is a required field - WebExperienceId *string `location:"uri" locationName:"webExperienceId" min:"36" type:"string" required:"true"` - - // A customized welcome message for an end user in an Amazon Q web experience. - WelcomeMessage *string `locationName:"welcomeMessage" 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 UpdateWebExperienceInput) 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 UpdateWebExperienceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWebExperienceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWebExperienceInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 36)) - } - if s.WebExperienceId == nil { - invalidParams.Add(request.NewErrParamRequired("WebExperienceId")) - } - if s.WebExperienceId != nil && len(*s.WebExperienceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("WebExperienceId", 36)) - } - if s.AuthenticationConfiguration != nil { - if err := s.AuthenticationConfiguration.Validate(); err != nil { - invalidParams.AddNested("AuthenticationConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateWebExperienceInput) SetApplicationId(v string) *UpdateWebExperienceInput { - s.ApplicationId = &v - return s -} - -// SetAuthenticationConfiguration sets the AuthenticationConfiguration field's value. -func (s *UpdateWebExperienceInput) SetAuthenticationConfiguration(v *WebExperienceAuthConfiguration) *UpdateWebExperienceInput { - s.AuthenticationConfiguration = v - return s -} - -// SetSamplePromptsControlMode sets the SamplePromptsControlMode field's value. -func (s *UpdateWebExperienceInput) SetSamplePromptsControlMode(v string) *UpdateWebExperienceInput { - s.SamplePromptsControlMode = &v - return s -} - -// SetSubtitle sets the Subtitle field's value. -func (s *UpdateWebExperienceInput) SetSubtitle(v string) *UpdateWebExperienceInput { - s.Subtitle = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *UpdateWebExperienceInput) SetTitle(v string) *UpdateWebExperienceInput { - s.Title = &v - return s -} - -// SetWebExperienceId sets the WebExperienceId field's value. -func (s *UpdateWebExperienceInput) SetWebExperienceId(v string) *UpdateWebExperienceInput { - s.WebExperienceId = &v - return s -} - -// SetWelcomeMessage sets the WelcomeMessage field's value. -func (s *UpdateWebExperienceInput) SetWelcomeMessage(v string) *UpdateWebExperienceInput { - s.WelcomeMessage = &v - return s -} - -type UpdateWebExperienceOutput 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 UpdateWebExperienceOutput) 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 UpdateWebExperienceOutput) GoString() string { - return s.String() -} - -// Aliases attached to a user id within an Amazon Q application. -type UserAlias struct { - _ struct{} `type:"structure"` - - // The identifier of the data source that the user aliases are associated with. - DataSourceId *string `locationName:"dataSourceId" min:"36" type:"string"` - - // The identifier of the index that the user aliases are associated with. - IndexId *string `locationName:"indexId" min:"36" type:"string"` - - // The identifier of the user id associated with the user aliases. - // - // UserId is a required field - UserId *string `locationName:"userId" min:"1" 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 UserAlias) 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 UserAlias) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UserAlias) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UserAlias"} - if s.DataSourceId != nil && len(*s.DataSourceId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 36)) - } - if s.IndexId != nil && len(*s.IndexId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("IndexId", 36)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceId sets the DataSourceId field's value. -func (s *UserAlias) SetDataSourceId(v string) *UserAlias { - s.DataSourceId = &v - return s -} - -// SetIndexId sets the IndexId field's value. -func (s *UserAlias) SetIndexId(v string) *UserAlias { - s.IndexId = &v - return s -} - -// SetUserId sets the UserId field's value. -func (s *UserAlias) SetUserId(v string) *UserAlias { - s.UserId = &v - return s -} - -// Provides information about users and groups associated with a topic control -// rule. -type UsersAndGroups struct { - _ struct{} `type:"structure"` - - // The user groups associated with a topic control rule. - UserGroups []*string `locationName:"userGroups" type:"list"` - - // The user ids associated with a topic control rule. - UserIds []*string `locationName:"userIds" type:"list"` -} - -// 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 UsersAndGroups) 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 UsersAndGroups) GoString() string { - return s.String() -} - -// SetUserGroups sets the UserGroups field's value. -func (s *UsersAndGroups) SetUserGroups(v []*string) *UsersAndGroups { - s.UserGroups = v - return s -} - -// SetUserIds sets the UserIds field's value. -func (s *UsersAndGroups) SetUserIds(v []*string) *UsersAndGroups { - s.UserIds = v - return s -} - -// The input doesn't meet the constraints set by the Amazon Q service. Provide -// the correct input and try again. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The input field(s) that failed validation. - Fields []*ValidationExceptionField `locationName:"fields" type:"list"` - - // The message describing the ValidationException. - Message_ *string `locationName:"message" min:"1" type:"string"` - - // The reason for the ValidationException. - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input failed to meet the constraints specified by Amazon Q in a specified -// field. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // A message about the validation exception. - // - // Message is a required field - Message *string `locationName:"message" min:"1" type:"string" required:"true"` - - // The field name where the invalid entry was detected. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -// Provides information for an Amazon Q web experience. -type WebExperience struct { - _ struct{} `type:"structure"` - - // The Unix timestamp when the Amazon Q application was last updated. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The endpoint URLs for your Amazon Q web experience. The URLs are unique and - // fully hosted by Amazon Web Services. - DefaultEndpoint *string `locationName:"defaultEndpoint" min:"1" type:"string"` - - // The status of your Amazon Q web experience. - Status *string `locationName:"status" type:"string" enum:"WebExperienceStatus"` - - // The Unix timestamp when your Amazon Q web experience was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` - - // The identifier of your Amazon Q web experience. - WebExperienceId *string `locationName:"webExperienceId" min:"36" 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 WebExperience) 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 WebExperience) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *WebExperience) SetCreatedAt(v time.Time) *WebExperience { - s.CreatedAt = &v - return s -} - -// SetDefaultEndpoint sets the DefaultEndpoint field's value. -func (s *WebExperience) SetDefaultEndpoint(v string) *WebExperience { - s.DefaultEndpoint = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *WebExperience) SetStatus(v string) *WebExperience { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *WebExperience) SetUpdatedAt(v time.Time) *WebExperience { - s.UpdatedAt = &v - return s -} - -// SetWebExperienceId sets the WebExperienceId field's value. -func (s *WebExperience) SetWebExperienceId(v string) *WebExperience { - s.WebExperienceId = &v - return s -} - -// Provides the authorization configuration information needed to deploy a Amazon -// Q web experience to end users. -type WebExperienceAuthConfiguration struct { - _ struct{} `type:"structure"` - - // Provides the SAML 2.0 compliant identity provider (IdP) configuration information - // Amazon Q needs to deploy a Amazon Q web experience. - SamlConfiguration *SamlConfiguration `locationName:"samlConfiguration" 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 WebExperienceAuthConfiguration) 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 WebExperienceAuthConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WebExperienceAuthConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WebExperienceAuthConfiguration"} - if s.SamlConfiguration != nil { - if err := s.SamlConfiguration.Validate(); err != nil { - invalidParams.AddNested("SamlConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSamlConfiguration sets the SamlConfiguration field's value. -func (s *WebExperienceAuthConfiguration) SetSamlConfiguration(v *SamlConfiguration) *WebExperienceAuthConfiguration { - s.SamlConfiguration = v - return s -} - -const ( - // ActionPayloadFieldTypeString is a ActionPayloadFieldType enum value - ActionPayloadFieldTypeString = "STRING" - - // ActionPayloadFieldTypeNumber is a ActionPayloadFieldType enum value - ActionPayloadFieldTypeNumber = "NUMBER" - - // ActionPayloadFieldTypeArray is a ActionPayloadFieldType enum value - ActionPayloadFieldTypeArray = "ARRAY" - - // ActionPayloadFieldTypeBoolean is a ActionPayloadFieldType enum value - ActionPayloadFieldTypeBoolean = "BOOLEAN" -) - -// ActionPayloadFieldType_Values returns all elements of the ActionPayloadFieldType enum -func ActionPayloadFieldType_Values() []string { - return []string{ - ActionPayloadFieldTypeString, - ActionPayloadFieldTypeNumber, - ActionPayloadFieldTypeArray, - ActionPayloadFieldTypeBoolean, - } -} - -const ( - // ApplicationStatusCreating is a ApplicationStatus enum value - ApplicationStatusCreating = "CREATING" - - // ApplicationStatusActive is a ApplicationStatus enum value - ApplicationStatusActive = "ACTIVE" - - // ApplicationStatusDeleting is a ApplicationStatus enum value - ApplicationStatusDeleting = "DELETING" - - // ApplicationStatusFailed is a ApplicationStatus enum value - ApplicationStatusFailed = "FAILED" - - // ApplicationStatusUpdating is a ApplicationStatus enum value - ApplicationStatusUpdating = "UPDATING" -) - -// ApplicationStatus_Values returns all elements of the ApplicationStatus enum -func ApplicationStatus_Values() []string { - return []string{ - ApplicationStatusCreating, - ApplicationStatusActive, - ApplicationStatusDeleting, - ApplicationStatusFailed, - ApplicationStatusUpdating, - } -} - -const ( - // AttachmentStatusFailed is a AttachmentStatus enum value - AttachmentStatusFailed = "FAILED" - - // AttachmentStatusSucceeded is a AttachmentStatus enum value - AttachmentStatusSucceeded = "SUCCEEDED" -) - -// AttachmentStatus_Values returns all elements of the AttachmentStatus enum -func AttachmentStatus_Values() []string { - return []string{ - AttachmentStatusFailed, - AttachmentStatusSucceeded, - } -} - -const ( - // AttachmentsControlModeEnabled is a AttachmentsControlMode enum value - AttachmentsControlModeEnabled = "ENABLED" - - // AttachmentsControlModeDisabled is a AttachmentsControlMode enum value - AttachmentsControlModeDisabled = "DISABLED" -) - -// AttachmentsControlMode_Values returns all elements of the AttachmentsControlMode enum -func AttachmentsControlMode_Values() []string { - return []string{ - AttachmentsControlModeEnabled, - AttachmentsControlModeDisabled, - } -} - -const ( - // AttributeTypeString is a AttributeType enum value - AttributeTypeString = "STRING" - - // AttributeTypeStringList is a AttributeType enum value - AttributeTypeStringList = "STRING_LIST" - - // AttributeTypeNumber is a AttributeType enum value - AttributeTypeNumber = "NUMBER" - - // AttributeTypeDate is a AttributeType enum value - AttributeTypeDate = "DATE" -) - -// AttributeType_Values returns all elements of the AttributeType enum -func AttributeType_Values() []string { - return []string{ - AttributeTypeString, - AttributeTypeStringList, - AttributeTypeNumber, - AttributeTypeDate, - } -} - -const ( - // AttributeValueOperatorDelete is a AttributeValueOperator enum value - AttributeValueOperatorDelete = "DELETE" -) - -// AttributeValueOperator_Values returns all elements of the AttributeValueOperator enum -func AttributeValueOperator_Values() []string { - return []string{ - AttributeValueOperatorDelete, - } -} - -const ( - // ContentTypePdf is a ContentType enum value - ContentTypePdf = "PDF" - - // ContentTypeHtml is a ContentType enum value - ContentTypeHtml = "HTML" - - // ContentTypeMsWord is a ContentType enum value - ContentTypeMsWord = "MS_WORD" - - // ContentTypePlainText is a ContentType enum value - ContentTypePlainText = "PLAIN_TEXT" - - // ContentTypePpt is a ContentType enum value - ContentTypePpt = "PPT" - - // ContentTypeRtf is a ContentType enum value - ContentTypeRtf = "RTF" - - // ContentTypeXml is a ContentType enum value - ContentTypeXml = "XML" - - // ContentTypeXslt is a ContentType enum value - ContentTypeXslt = "XSLT" - - // ContentTypeMsExcel is a ContentType enum value - ContentTypeMsExcel = "MS_EXCEL" - - // ContentTypeCsv is a ContentType enum value - ContentTypeCsv = "CSV" - - // ContentTypeJson is a ContentType enum value - ContentTypeJson = "JSON" - - // ContentTypeMd is a ContentType enum value - ContentTypeMd = "MD" -) - -// ContentType_Values returns all elements of the ContentType enum -func ContentType_Values() []string { - return []string{ - ContentTypePdf, - ContentTypeHtml, - ContentTypeMsWord, - ContentTypePlainText, - ContentTypePpt, - ContentTypeRtf, - ContentTypeXml, - ContentTypeXslt, - ContentTypeMsExcel, - ContentTypeCsv, - ContentTypeJson, - ContentTypeMd, - } -} - -const ( - // DataSourceStatusPendingCreation is a DataSourceStatus enum value - DataSourceStatusPendingCreation = "PENDING_CREATION" - - // DataSourceStatusCreating is a DataSourceStatus enum value - DataSourceStatusCreating = "CREATING" - - // DataSourceStatusActive is a DataSourceStatus enum value - DataSourceStatusActive = "ACTIVE" - - // DataSourceStatusDeleting is a DataSourceStatus enum value - DataSourceStatusDeleting = "DELETING" - - // DataSourceStatusFailed is a DataSourceStatus enum value - DataSourceStatusFailed = "FAILED" - - // DataSourceStatusUpdating is a DataSourceStatus enum value - DataSourceStatusUpdating = "UPDATING" -) - -// DataSourceStatus_Values returns all elements of the DataSourceStatus enum -func DataSourceStatus_Values() []string { - return []string{ - DataSourceStatusPendingCreation, - DataSourceStatusCreating, - DataSourceStatusActive, - DataSourceStatusDeleting, - DataSourceStatusFailed, - DataSourceStatusUpdating, - } -} - -const ( - // DataSourceSyncJobStatusFailed is a DataSourceSyncJobStatus enum value - DataSourceSyncJobStatusFailed = "FAILED" - - // DataSourceSyncJobStatusSucceeded is a DataSourceSyncJobStatus enum value - DataSourceSyncJobStatusSucceeded = "SUCCEEDED" - - // DataSourceSyncJobStatusSyncing is a DataSourceSyncJobStatus enum value - DataSourceSyncJobStatusSyncing = "SYNCING" - - // DataSourceSyncJobStatusIncomplete is a DataSourceSyncJobStatus enum value - DataSourceSyncJobStatusIncomplete = "INCOMPLETE" - - // DataSourceSyncJobStatusStopping is a DataSourceSyncJobStatus enum value - DataSourceSyncJobStatusStopping = "STOPPING" - - // DataSourceSyncJobStatusAborted is a DataSourceSyncJobStatus enum value - DataSourceSyncJobStatusAborted = "ABORTED" - - // DataSourceSyncJobStatusSyncingIndexing is a DataSourceSyncJobStatus enum value - DataSourceSyncJobStatusSyncingIndexing = "SYNCING_INDEXING" -) - -// DataSourceSyncJobStatus_Values returns all elements of the DataSourceSyncJobStatus enum -func DataSourceSyncJobStatus_Values() []string { - return []string{ - DataSourceSyncJobStatusFailed, - DataSourceSyncJobStatusSucceeded, - DataSourceSyncJobStatusSyncing, - DataSourceSyncJobStatusIncomplete, - DataSourceSyncJobStatusStopping, - DataSourceSyncJobStatusAborted, - DataSourceSyncJobStatusSyncingIndexing, - } -} - -const ( - // DocumentContentOperatorDelete is a DocumentContentOperator enum value - DocumentContentOperatorDelete = "DELETE" -) - -// DocumentContentOperator_Values returns all elements of the DocumentContentOperator enum -func DocumentContentOperator_Values() []string { - return []string{ - DocumentContentOperatorDelete, - } -} - -const ( - // DocumentEnrichmentConditionOperatorGreaterThan is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorGreaterThan = "GREATER_THAN" - - // DocumentEnrichmentConditionOperatorGreaterThanOrEquals is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorGreaterThanOrEquals = "GREATER_THAN_OR_EQUALS" - - // DocumentEnrichmentConditionOperatorLessThan is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorLessThan = "LESS_THAN" - - // DocumentEnrichmentConditionOperatorLessThanOrEquals is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorLessThanOrEquals = "LESS_THAN_OR_EQUALS" - - // DocumentEnrichmentConditionOperatorEquals is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorEquals = "EQUALS" - - // DocumentEnrichmentConditionOperatorNotEquals is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorNotEquals = "NOT_EQUALS" - - // DocumentEnrichmentConditionOperatorContains is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorContains = "CONTAINS" - - // DocumentEnrichmentConditionOperatorNotContains is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorNotContains = "NOT_CONTAINS" - - // DocumentEnrichmentConditionOperatorExists is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorExists = "EXISTS" - - // DocumentEnrichmentConditionOperatorNotExists is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorNotExists = "NOT_EXISTS" - - // DocumentEnrichmentConditionOperatorBeginsWith is a DocumentEnrichmentConditionOperator enum value - DocumentEnrichmentConditionOperatorBeginsWith = "BEGINS_WITH" -) - -// DocumentEnrichmentConditionOperator_Values returns all elements of the DocumentEnrichmentConditionOperator enum -func DocumentEnrichmentConditionOperator_Values() []string { - return []string{ - DocumentEnrichmentConditionOperatorGreaterThan, - DocumentEnrichmentConditionOperatorGreaterThanOrEquals, - DocumentEnrichmentConditionOperatorLessThan, - DocumentEnrichmentConditionOperatorLessThanOrEquals, - DocumentEnrichmentConditionOperatorEquals, - DocumentEnrichmentConditionOperatorNotEquals, - DocumentEnrichmentConditionOperatorContains, - DocumentEnrichmentConditionOperatorNotContains, - DocumentEnrichmentConditionOperatorExists, - DocumentEnrichmentConditionOperatorNotExists, - DocumentEnrichmentConditionOperatorBeginsWith, - } -} - -const ( - // DocumentStatusReceived is a DocumentStatus enum value - DocumentStatusReceived = "RECEIVED" - - // DocumentStatusProcessing is a DocumentStatus enum value - DocumentStatusProcessing = "PROCESSING" - - // DocumentStatusIndexed is a DocumentStatus enum value - DocumentStatusIndexed = "INDEXED" - - // DocumentStatusUpdated is a DocumentStatus enum value - DocumentStatusUpdated = "UPDATED" - - // DocumentStatusFailed is a DocumentStatus enum value - DocumentStatusFailed = "FAILED" - - // DocumentStatusDeleting is a DocumentStatus enum value - DocumentStatusDeleting = "DELETING" - - // DocumentStatusDeleted is a DocumentStatus enum value - DocumentStatusDeleted = "DELETED" - - // DocumentStatusDocumentFailedToIndex is a DocumentStatus enum value - DocumentStatusDocumentFailedToIndex = "DOCUMENT_FAILED_TO_INDEX" -) - -// DocumentStatus_Values returns all elements of the DocumentStatus enum -func DocumentStatus_Values() []string { - return []string{ - DocumentStatusReceived, - DocumentStatusProcessing, - DocumentStatusIndexed, - DocumentStatusUpdated, - DocumentStatusFailed, - DocumentStatusDeleting, - DocumentStatusDeleted, - DocumentStatusDocumentFailedToIndex, - } -} - -const ( - // ErrorCodeInternalError is a ErrorCode enum value - ErrorCodeInternalError = "InternalError" - - // ErrorCodeInvalidRequest is a ErrorCode enum value - ErrorCodeInvalidRequest = "InvalidRequest" - - // ErrorCodeResourceInactive is a ErrorCode enum value - ErrorCodeResourceInactive = "ResourceInactive" - - // ErrorCodeResourceNotFound is a ErrorCode enum value - ErrorCodeResourceNotFound = "ResourceNotFound" -) - -// ErrorCode_Values returns all elements of the ErrorCode enum -func ErrorCode_Values() []string { - return []string{ - ErrorCodeInternalError, - ErrorCodeInvalidRequest, - ErrorCodeResourceInactive, - ErrorCodeResourceNotFound, - } -} - -const ( - // GroupStatusFailed is a GroupStatus enum value - GroupStatusFailed = "FAILED" - - // GroupStatusSucceeded is a GroupStatus enum value - GroupStatusSucceeded = "SUCCEEDED" - - // GroupStatusProcessing is a GroupStatus enum value - GroupStatusProcessing = "PROCESSING" - - // GroupStatusDeleting is a GroupStatus enum value - GroupStatusDeleting = "DELETING" - - // GroupStatusDeleted is a GroupStatus enum value - GroupStatusDeleted = "DELETED" -) - -// GroupStatus_Values returns all elements of the GroupStatus enum -func GroupStatus_Values() []string { - return []string{ - GroupStatusFailed, - GroupStatusSucceeded, - GroupStatusProcessing, - GroupStatusDeleting, - GroupStatusDeleted, - } -} - -const ( - // IndexStatusCreating is a IndexStatus enum value - IndexStatusCreating = "CREATING" - - // IndexStatusActive is a IndexStatus enum value - IndexStatusActive = "ACTIVE" - - // IndexStatusDeleting is a IndexStatus enum value - IndexStatusDeleting = "DELETING" - - // IndexStatusFailed is a IndexStatus enum value - IndexStatusFailed = "FAILED" - - // IndexStatusUpdating is a IndexStatus enum value - IndexStatusUpdating = "UPDATING" -) - -// IndexStatus_Values returns all elements of the IndexStatus enum -func IndexStatus_Values() []string { - return []string{ - IndexStatusCreating, - IndexStatusActive, - IndexStatusDeleting, - IndexStatusFailed, - IndexStatusUpdating, - } -} - -const ( - // MemberRelationAnd is a MemberRelation enum value - MemberRelationAnd = "AND" - - // MemberRelationOr is a MemberRelation enum value - MemberRelationOr = "OR" -) - -// MemberRelation_Values returns all elements of the MemberRelation enum -func MemberRelation_Values() []string { - return []string{ - MemberRelationAnd, - MemberRelationOr, - } -} - -const ( - // MembershipTypeIndex is a MembershipType enum value - MembershipTypeIndex = "INDEX" - - // MembershipTypeDatasource is a MembershipType enum value - MembershipTypeDatasource = "DATASOURCE" -) - -// MembershipType_Values returns all elements of the MembershipType enum -func MembershipType_Values() []string { - return []string{ - MembershipTypeIndex, - MembershipTypeDatasource, - } -} - -const ( - // MessageTypeUser is a MessageType enum value - MessageTypeUser = "USER" - - // MessageTypeSystem is a MessageType enum value - MessageTypeSystem = "SYSTEM" -) - -// MessageType_Values returns all elements of the MessageType enum -func MessageType_Values() []string { - return []string{ - MessageTypeUser, - MessageTypeSystem, - } -} - -const ( - // MessageUsefulnessUseful is a MessageUsefulness enum value - MessageUsefulnessUseful = "USEFUL" - - // MessageUsefulnessNotUseful is a MessageUsefulness enum value - MessageUsefulnessNotUseful = "NOT_USEFUL" -) - -// MessageUsefulness_Values returns all elements of the MessageUsefulness enum -func MessageUsefulness_Values() []string { - return []string{ - MessageUsefulnessUseful, - MessageUsefulnessNotUseful, - } -} - -const ( - // MessageUsefulnessReasonNotFactuallyCorrect is a MessageUsefulnessReason enum value - MessageUsefulnessReasonNotFactuallyCorrect = "NOT_FACTUALLY_CORRECT" - - // MessageUsefulnessReasonHarmfulOrUnsafe is a MessageUsefulnessReason enum value - MessageUsefulnessReasonHarmfulOrUnsafe = "HARMFUL_OR_UNSAFE" - - // MessageUsefulnessReasonIncorrectOrMissingSources is a MessageUsefulnessReason enum value - MessageUsefulnessReasonIncorrectOrMissingSources = "INCORRECT_OR_MISSING_SOURCES" - - // MessageUsefulnessReasonNotHelpful is a MessageUsefulnessReason enum value - MessageUsefulnessReasonNotHelpful = "NOT_HELPFUL" - - // MessageUsefulnessReasonFactuallyCorrect is a MessageUsefulnessReason enum value - MessageUsefulnessReasonFactuallyCorrect = "FACTUALLY_CORRECT" - - // MessageUsefulnessReasonComplete is a MessageUsefulnessReason enum value - MessageUsefulnessReasonComplete = "COMPLETE" - - // MessageUsefulnessReasonRelevantSources is a MessageUsefulnessReason enum value - MessageUsefulnessReasonRelevantSources = "RELEVANT_SOURCES" - - // MessageUsefulnessReasonHelpful is a MessageUsefulnessReason enum value - MessageUsefulnessReasonHelpful = "HELPFUL" -) - -// MessageUsefulnessReason_Values returns all elements of the MessageUsefulnessReason enum -func MessageUsefulnessReason_Values() []string { - return []string{ - MessageUsefulnessReasonNotFactuallyCorrect, - MessageUsefulnessReasonHarmfulOrUnsafe, - MessageUsefulnessReasonIncorrectOrMissingSources, - MessageUsefulnessReasonNotHelpful, - MessageUsefulnessReasonFactuallyCorrect, - MessageUsefulnessReasonComplete, - MessageUsefulnessReasonRelevantSources, - MessageUsefulnessReasonHelpful, - } -} - -const ( - // PluginStateEnabled is a PluginState enum value - PluginStateEnabled = "ENABLED" - - // PluginStateDisabled is a PluginState enum value - PluginStateDisabled = "DISABLED" -) - -// PluginState_Values returns all elements of the PluginState enum -func PluginState_Values() []string { - return []string{ - PluginStateEnabled, - PluginStateDisabled, - } -} - -const ( - // PluginTypeServiceNow is a PluginType enum value - PluginTypeServiceNow = "SERVICE_NOW" - - // PluginTypeSalesforce is a PluginType enum value - PluginTypeSalesforce = "SALESFORCE" - - // PluginTypeJira is a PluginType enum value - PluginTypeJira = "JIRA" - - // PluginTypeZendesk is a PluginType enum value - PluginTypeZendesk = "ZENDESK" -) - -// PluginType_Values returns all elements of the PluginType enum -func PluginType_Values() []string { - return []string{ - PluginTypeServiceNow, - PluginTypeSalesforce, - PluginTypeJira, - PluginTypeZendesk, - } -} - -const ( - // ReadAccessTypeAllow is a ReadAccessType enum value - ReadAccessTypeAllow = "ALLOW" - - // ReadAccessTypeDeny is a ReadAccessType enum value - ReadAccessTypeDeny = "DENY" -) - -// ReadAccessType_Values returns all elements of the ReadAccessType enum -func ReadAccessType_Values() []string { - return []string{ - ReadAccessTypeAllow, - ReadAccessTypeDeny, - } -} - -const ( - // ResponseScopeEnterpriseContentOnly is a ResponseScope enum value - ResponseScopeEnterpriseContentOnly = "ENTERPRISE_CONTENT_ONLY" - - // ResponseScopeExtendedKnowledgeEnabled is a ResponseScope enum value - ResponseScopeExtendedKnowledgeEnabled = "EXTENDED_KNOWLEDGE_ENABLED" -) - -// ResponseScope_Values returns all elements of the ResponseScope enum -func ResponseScope_Values() []string { - return []string{ - ResponseScopeEnterpriseContentOnly, - ResponseScopeExtendedKnowledgeEnabled, - } -} - -const ( - // RetrieverStatusCreating is a RetrieverStatus enum value - RetrieverStatusCreating = "CREATING" - - // RetrieverStatusActive is a RetrieverStatus enum value - RetrieverStatusActive = "ACTIVE" - - // RetrieverStatusFailed is a RetrieverStatus enum value - RetrieverStatusFailed = "FAILED" -) - -// RetrieverStatus_Values returns all elements of the RetrieverStatus enum -func RetrieverStatus_Values() []string { - return []string{ - RetrieverStatusCreating, - RetrieverStatusActive, - RetrieverStatusFailed, - } -} - -const ( - // RetrieverTypeNativeIndex is a RetrieverType enum value - RetrieverTypeNativeIndex = "NATIVE_INDEX" - - // RetrieverTypeKendraIndex is a RetrieverType enum value - RetrieverTypeKendraIndex = "KENDRA_INDEX" -) - -// RetrieverType_Values returns all elements of the RetrieverType enum -func RetrieverType_Values() []string { - return []string{ - RetrieverTypeNativeIndex, - RetrieverTypeKendraIndex, - } -} - -const ( - // RuleTypeContentBlockerRule is a RuleType enum value - RuleTypeContentBlockerRule = "CONTENT_BLOCKER_RULE" - - // RuleTypeContentRetrievalRule is a RuleType enum value - RuleTypeContentRetrievalRule = "CONTENT_RETRIEVAL_RULE" -) - -// RuleType_Values returns all elements of the RuleType enum -func RuleType_Values() []string { - return []string{ - RuleTypeContentBlockerRule, - RuleTypeContentRetrievalRule, - } -} - -const ( - // StatusEnabled is a Status enum value - StatusEnabled = "ENABLED" - - // StatusDisabled is a Status enum value - StatusDisabled = "DISABLED" -) - -// Status_Values returns all elements of the Status enum -func Status_Values() []string { - return []string{ - StatusEnabled, - StatusDisabled, - } -} - -const ( - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "CANNOT_PARSE" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "FIELD_VALIDATION_FAILED" - - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "UNKNOWN_OPERATION" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonUnknownOperation, - } -} - -const ( - // WebExperienceSamplePromptsControlModeEnabled is a WebExperienceSamplePromptsControlMode enum value - WebExperienceSamplePromptsControlModeEnabled = "ENABLED" - - // WebExperienceSamplePromptsControlModeDisabled is a WebExperienceSamplePromptsControlMode enum value - WebExperienceSamplePromptsControlModeDisabled = "DISABLED" -) - -// WebExperienceSamplePromptsControlMode_Values returns all elements of the WebExperienceSamplePromptsControlMode enum -func WebExperienceSamplePromptsControlMode_Values() []string { - return []string{ - WebExperienceSamplePromptsControlModeEnabled, - WebExperienceSamplePromptsControlModeDisabled, - } -} - -const ( - // WebExperienceStatusCreating is a WebExperienceStatus enum value - WebExperienceStatusCreating = "CREATING" - - // WebExperienceStatusActive is a WebExperienceStatus enum value - WebExperienceStatusActive = "ACTIVE" - - // WebExperienceStatusDeleting is a WebExperienceStatus enum value - WebExperienceStatusDeleting = "DELETING" - - // WebExperienceStatusFailed is a WebExperienceStatus enum value - WebExperienceStatusFailed = "FAILED" - - // WebExperienceStatusPendingAuthConfig is a WebExperienceStatus enum value - WebExperienceStatusPendingAuthConfig = "PENDING_AUTH_CONFIG" -) - -// WebExperienceStatus_Values returns all elements of the WebExperienceStatus enum -func WebExperienceStatus_Values() []string { - return []string{ - WebExperienceStatusCreating, - WebExperienceStatusActive, - WebExperienceStatusDeleting, - WebExperienceStatusFailed, - WebExperienceStatusPendingAuthConfig, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/doc.go deleted file mode 100644 index f4bd5ee7632d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package qbusiness provides the client and types for making API -// requests to QBusiness. -// -// See https://docs.aws.amazon.com/goto/WebAPI/qbusiness-2023-11-27 for more information on this service. -// -// See qbusiness package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/qbusiness/ -// -// # Using the Client -// -// To contact QBusiness with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the QBusiness client QBusiness for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/qbusiness/#New -package qbusiness diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/errors.go deleted file mode 100644 index 6adbcbd697ad..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/errors.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package qbusiness - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have access to perform this action. Make sure you have the required - // permission policies and user accounts and try again. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // You are trying to perform an action that conflicts with the current status - // of your resource. Fix any inconsistences with your resources and try again. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An issue occurred with the internal server used for your Amazon Q service. - // Wait some minutes and try again, or contact Support (http://aws.amazon.com/contact-us/) - // for help. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeLicenseNotFoundException for service response error code - // "LicenseNotFoundException". - // - // You don't have permissions to perform the action because your license is - // inactive. Ask your admin to activate your license and try again after your - // licence is active. - ErrCodeLicenseNotFoundException = "LicenseNotFoundException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource you want to use doesn’t exist. Make sure you have provided - // the correct resource and try again. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // You have exceeded the set limits for your Amazon Q service. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to throttling. Reduce the number of requests and - // try again. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input doesn't meet the constraints set by the Amazon Q service. Provide - // the correct input and try again. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "LicenseNotFoundException": newErrorLicenseNotFoundException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/qbusinessiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/qbusinessiface/interface.go deleted file mode 100644 index ca2210f0920d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/qbusinessiface/interface.go +++ /dev/null @@ -1,316 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package qbusinessiface provides an interface to enable mocking the QBusiness service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package qbusinessiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness" -) - -// QBusinessAPI provides an interface to enable mocking the -// qbusiness.QBusiness service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // QBusiness. -// func myFunc(svc qbusinessiface.QBusinessAPI) bool { -// // Make svc.BatchDeleteDocument request -// } -// -// func main() { -// sess := session.New() -// svc := qbusiness.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockQBusinessClient struct { -// qbusinessiface.QBusinessAPI -// } -// func (m *mockQBusinessClient) BatchDeleteDocument(input *qbusiness.BatchDeleteDocumentInput) (*qbusiness.BatchDeleteDocumentOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockQBusinessClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type QBusinessAPI interface { - BatchDeleteDocument(*qbusiness.BatchDeleteDocumentInput) (*qbusiness.BatchDeleteDocumentOutput, error) - BatchDeleteDocumentWithContext(aws.Context, *qbusiness.BatchDeleteDocumentInput, ...request.Option) (*qbusiness.BatchDeleteDocumentOutput, error) - BatchDeleteDocumentRequest(*qbusiness.BatchDeleteDocumentInput) (*request.Request, *qbusiness.BatchDeleteDocumentOutput) - - BatchPutDocument(*qbusiness.BatchPutDocumentInput) (*qbusiness.BatchPutDocumentOutput, error) - BatchPutDocumentWithContext(aws.Context, *qbusiness.BatchPutDocumentInput, ...request.Option) (*qbusiness.BatchPutDocumentOutput, error) - BatchPutDocumentRequest(*qbusiness.BatchPutDocumentInput) (*request.Request, *qbusiness.BatchPutDocumentOutput) - - ChatSync(*qbusiness.ChatSyncInput) (*qbusiness.ChatSyncOutput, error) - ChatSyncWithContext(aws.Context, *qbusiness.ChatSyncInput, ...request.Option) (*qbusiness.ChatSyncOutput, error) - ChatSyncRequest(*qbusiness.ChatSyncInput) (*request.Request, *qbusiness.ChatSyncOutput) - - CreateApplication(*qbusiness.CreateApplicationInput) (*qbusiness.CreateApplicationOutput, error) - CreateApplicationWithContext(aws.Context, *qbusiness.CreateApplicationInput, ...request.Option) (*qbusiness.CreateApplicationOutput, error) - CreateApplicationRequest(*qbusiness.CreateApplicationInput) (*request.Request, *qbusiness.CreateApplicationOutput) - - CreateIndex(*qbusiness.CreateIndexInput) (*qbusiness.CreateIndexOutput, error) - CreateIndexWithContext(aws.Context, *qbusiness.CreateIndexInput, ...request.Option) (*qbusiness.CreateIndexOutput, error) - CreateIndexRequest(*qbusiness.CreateIndexInput) (*request.Request, *qbusiness.CreateIndexOutput) - - CreatePlugin(*qbusiness.CreatePluginInput) (*qbusiness.CreatePluginOutput, error) - CreatePluginWithContext(aws.Context, *qbusiness.CreatePluginInput, ...request.Option) (*qbusiness.CreatePluginOutput, error) - CreatePluginRequest(*qbusiness.CreatePluginInput) (*request.Request, *qbusiness.CreatePluginOutput) - - CreateRetriever(*qbusiness.CreateRetrieverInput) (*qbusiness.CreateRetrieverOutput, error) - CreateRetrieverWithContext(aws.Context, *qbusiness.CreateRetrieverInput, ...request.Option) (*qbusiness.CreateRetrieverOutput, error) - CreateRetrieverRequest(*qbusiness.CreateRetrieverInput) (*request.Request, *qbusiness.CreateRetrieverOutput) - - CreateUser(*qbusiness.CreateUserInput) (*qbusiness.CreateUserOutput, error) - CreateUserWithContext(aws.Context, *qbusiness.CreateUserInput, ...request.Option) (*qbusiness.CreateUserOutput, error) - CreateUserRequest(*qbusiness.CreateUserInput) (*request.Request, *qbusiness.CreateUserOutput) - - CreateWebExperience(*qbusiness.CreateWebExperienceInput) (*qbusiness.CreateWebExperienceOutput, error) - CreateWebExperienceWithContext(aws.Context, *qbusiness.CreateWebExperienceInput, ...request.Option) (*qbusiness.CreateWebExperienceOutput, error) - CreateWebExperienceRequest(*qbusiness.CreateWebExperienceInput) (*request.Request, *qbusiness.CreateWebExperienceOutput) - - DeleteApplication(*qbusiness.DeleteApplicationInput) (*qbusiness.DeleteApplicationOutput, error) - DeleteApplicationWithContext(aws.Context, *qbusiness.DeleteApplicationInput, ...request.Option) (*qbusiness.DeleteApplicationOutput, error) - DeleteApplicationRequest(*qbusiness.DeleteApplicationInput) (*request.Request, *qbusiness.DeleteApplicationOutput) - - DeleteChatControlsConfiguration(*qbusiness.DeleteChatControlsConfigurationInput) (*qbusiness.DeleteChatControlsConfigurationOutput, error) - DeleteChatControlsConfigurationWithContext(aws.Context, *qbusiness.DeleteChatControlsConfigurationInput, ...request.Option) (*qbusiness.DeleteChatControlsConfigurationOutput, error) - DeleteChatControlsConfigurationRequest(*qbusiness.DeleteChatControlsConfigurationInput) (*request.Request, *qbusiness.DeleteChatControlsConfigurationOutput) - - DeleteConversation(*qbusiness.DeleteConversationInput) (*qbusiness.DeleteConversationOutput, error) - DeleteConversationWithContext(aws.Context, *qbusiness.DeleteConversationInput, ...request.Option) (*qbusiness.DeleteConversationOutput, error) - DeleteConversationRequest(*qbusiness.DeleteConversationInput) (*request.Request, *qbusiness.DeleteConversationOutput) - - DeleteDataSource(*qbusiness.DeleteDataSourceInput) (*qbusiness.DeleteDataSourceOutput, error) - DeleteDataSourceWithContext(aws.Context, *qbusiness.DeleteDataSourceInput, ...request.Option) (*qbusiness.DeleteDataSourceOutput, error) - DeleteDataSourceRequest(*qbusiness.DeleteDataSourceInput) (*request.Request, *qbusiness.DeleteDataSourceOutput) - - DeleteGroup(*qbusiness.DeleteGroupInput) (*qbusiness.DeleteGroupOutput, error) - DeleteGroupWithContext(aws.Context, *qbusiness.DeleteGroupInput, ...request.Option) (*qbusiness.DeleteGroupOutput, error) - DeleteGroupRequest(*qbusiness.DeleteGroupInput) (*request.Request, *qbusiness.DeleteGroupOutput) - - DeleteIndex(*qbusiness.DeleteIndexInput) (*qbusiness.DeleteIndexOutput, error) - DeleteIndexWithContext(aws.Context, *qbusiness.DeleteIndexInput, ...request.Option) (*qbusiness.DeleteIndexOutput, error) - DeleteIndexRequest(*qbusiness.DeleteIndexInput) (*request.Request, *qbusiness.DeleteIndexOutput) - - DeletePlugin(*qbusiness.DeletePluginInput) (*qbusiness.DeletePluginOutput, error) - DeletePluginWithContext(aws.Context, *qbusiness.DeletePluginInput, ...request.Option) (*qbusiness.DeletePluginOutput, error) - DeletePluginRequest(*qbusiness.DeletePluginInput) (*request.Request, *qbusiness.DeletePluginOutput) - - DeleteRetriever(*qbusiness.DeleteRetrieverInput) (*qbusiness.DeleteRetrieverOutput, error) - DeleteRetrieverWithContext(aws.Context, *qbusiness.DeleteRetrieverInput, ...request.Option) (*qbusiness.DeleteRetrieverOutput, error) - DeleteRetrieverRequest(*qbusiness.DeleteRetrieverInput) (*request.Request, *qbusiness.DeleteRetrieverOutput) - - DeleteUser(*qbusiness.DeleteUserInput) (*qbusiness.DeleteUserOutput, error) - DeleteUserWithContext(aws.Context, *qbusiness.DeleteUserInput, ...request.Option) (*qbusiness.DeleteUserOutput, error) - DeleteUserRequest(*qbusiness.DeleteUserInput) (*request.Request, *qbusiness.DeleteUserOutput) - - DeleteWebExperience(*qbusiness.DeleteWebExperienceInput) (*qbusiness.DeleteWebExperienceOutput, error) - DeleteWebExperienceWithContext(aws.Context, *qbusiness.DeleteWebExperienceInput, ...request.Option) (*qbusiness.DeleteWebExperienceOutput, error) - DeleteWebExperienceRequest(*qbusiness.DeleteWebExperienceInput) (*request.Request, *qbusiness.DeleteWebExperienceOutput) - - GetApplication(*qbusiness.GetApplicationInput) (*qbusiness.GetApplicationOutput, error) - GetApplicationWithContext(aws.Context, *qbusiness.GetApplicationInput, ...request.Option) (*qbusiness.GetApplicationOutput, error) - GetApplicationRequest(*qbusiness.GetApplicationInput) (*request.Request, *qbusiness.GetApplicationOutput) - - GetChatControlsConfiguration(*qbusiness.GetChatControlsConfigurationInput) (*qbusiness.GetChatControlsConfigurationOutput, error) - GetChatControlsConfigurationWithContext(aws.Context, *qbusiness.GetChatControlsConfigurationInput, ...request.Option) (*qbusiness.GetChatControlsConfigurationOutput, error) - GetChatControlsConfigurationRequest(*qbusiness.GetChatControlsConfigurationInput) (*request.Request, *qbusiness.GetChatControlsConfigurationOutput) - - GetChatControlsConfigurationPages(*qbusiness.GetChatControlsConfigurationInput, func(*qbusiness.GetChatControlsConfigurationOutput, bool) bool) error - GetChatControlsConfigurationPagesWithContext(aws.Context, *qbusiness.GetChatControlsConfigurationInput, func(*qbusiness.GetChatControlsConfigurationOutput, bool) bool, ...request.Option) error - - GetDataSource(*qbusiness.GetDataSourceInput) (*qbusiness.GetDataSourceOutput, error) - GetDataSourceWithContext(aws.Context, *qbusiness.GetDataSourceInput, ...request.Option) (*qbusiness.GetDataSourceOutput, error) - GetDataSourceRequest(*qbusiness.GetDataSourceInput) (*request.Request, *qbusiness.GetDataSourceOutput) - - GetGroup(*qbusiness.GetGroupInput) (*qbusiness.GetGroupOutput, error) - GetGroupWithContext(aws.Context, *qbusiness.GetGroupInput, ...request.Option) (*qbusiness.GetGroupOutput, error) - GetGroupRequest(*qbusiness.GetGroupInput) (*request.Request, *qbusiness.GetGroupOutput) - - GetIndex(*qbusiness.GetIndexInput) (*qbusiness.GetIndexOutput, error) - GetIndexWithContext(aws.Context, *qbusiness.GetIndexInput, ...request.Option) (*qbusiness.GetIndexOutput, error) - GetIndexRequest(*qbusiness.GetIndexInput) (*request.Request, *qbusiness.GetIndexOutput) - - GetPlugin(*qbusiness.GetPluginInput) (*qbusiness.GetPluginOutput, error) - GetPluginWithContext(aws.Context, *qbusiness.GetPluginInput, ...request.Option) (*qbusiness.GetPluginOutput, error) - GetPluginRequest(*qbusiness.GetPluginInput) (*request.Request, *qbusiness.GetPluginOutput) - - GetRetriever(*qbusiness.GetRetrieverInput) (*qbusiness.GetRetrieverOutput, error) - GetRetrieverWithContext(aws.Context, *qbusiness.GetRetrieverInput, ...request.Option) (*qbusiness.GetRetrieverOutput, error) - GetRetrieverRequest(*qbusiness.GetRetrieverInput) (*request.Request, *qbusiness.GetRetrieverOutput) - - GetUser(*qbusiness.GetUserInput) (*qbusiness.GetUserOutput, error) - GetUserWithContext(aws.Context, *qbusiness.GetUserInput, ...request.Option) (*qbusiness.GetUserOutput, error) - GetUserRequest(*qbusiness.GetUserInput) (*request.Request, *qbusiness.GetUserOutput) - - GetWebExperience(*qbusiness.GetWebExperienceInput) (*qbusiness.GetWebExperienceOutput, error) - GetWebExperienceWithContext(aws.Context, *qbusiness.GetWebExperienceInput, ...request.Option) (*qbusiness.GetWebExperienceOutput, error) - GetWebExperienceRequest(*qbusiness.GetWebExperienceInput) (*request.Request, *qbusiness.GetWebExperienceOutput) - - ListApplications(*qbusiness.ListApplicationsInput) (*qbusiness.ListApplicationsOutput, error) - ListApplicationsWithContext(aws.Context, *qbusiness.ListApplicationsInput, ...request.Option) (*qbusiness.ListApplicationsOutput, error) - ListApplicationsRequest(*qbusiness.ListApplicationsInput) (*request.Request, *qbusiness.ListApplicationsOutput) - - ListApplicationsPages(*qbusiness.ListApplicationsInput, func(*qbusiness.ListApplicationsOutput, bool) bool) error - ListApplicationsPagesWithContext(aws.Context, *qbusiness.ListApplicationsInput, func(*qbusiness.ListApplicationsOutput, bool) bool, ...request.Option) error - - ListConversations(*qbusiness.ListConversationsInput) (*qbusiness.ListConversationsOutput, error) - ListConversationsWithContext(aws.Context, *qbusiness.ListConversationsInput, ...request.Option) (*qbusiness.ListConversationsOutput, error) - ListConversationsRequest(*qbusiness.ListConversationsInput) (*request.Request, *qbusiness.ListConversationsOutput) - - ListConversationsPages(*qbusiness.ListConversationsInput, func(*qbusiness.ListConversationsOutput, bool) bool) error - ListConversationsPagesWithContext(aws.Context, *qbusiness.ListConversationsInput, func(*qbusiness.ListConversationsOutput, bool) bool, ...request.Option) error - - ListDataSourceSyncJobs(*qbusiness.ListDataSourceSyncJobsInput) (*qbusiness.ListDataSourceSyncJobsOutput, error) - ListDataSourceSyncJobsWithContext(aws.Context, *qbusiness.ListDataSourceSyncJobsInput, ...request.Option) (*qbusiness.ListDataSourceSyncJobsOutput, error) - ListDataSourceSyncJobsRequest(*qbusiness.ListDataSourceSyncJobsInput) (*request.Request, *qbusiness.ListDataSourceSyncJobsOutput) - - ListDataSourceSyncJobsPages(*qbusiness.ListDataSourceSyncJobsInput, func(*qbusiness.ListDataSourceSyncJobsOutput, bool) bool) error - ListDataSourceSyncJobsPagesWithContext(aws.Context, *qbusiness.ListDataSourceSyncJobsInput, func(*qbusiness.ListDataSourceSyncJobsOutput, bool) bool, ...request.Option) error - - ListDataSources(*qbusiness.ListDataSourcesInput) (*qbusiness.ListDataSourcesOutput, error) - ListDataSourcesWithContext(aws.Context, *qbusiness.ListDataSourcesInput, ...request.Option) (*qbusiness.ListDataSourcesOutput, error) - ListDataSourcesRequest(*qbusiness.ListDataSourcesInput) (*request.Request, *qbusiness.ListDataSourcesOutput) - - ListDataSourcesPages(*qbusiness.ListDataSourcesInput, func(*qbusiness.ListDataSourcesOutput, bool) bool) error - ListDataSourcesPagesWithContext(aws.Context, *qbusiness.ListDataSourcesInput, func(*qbusiness.ListDataSourcesOutput, bool) bool, ...request.Option) error - - ListDocuments(*qbusiness.ListDocumentsInput) (*qbusiness.ListDocumentsOutput, error) - ListDocumentsWithContext(aws.Context, *qbusiness.ListDocumentsInput, ...request.Option) (*qbusiness.ListDocumentsOutput, error) - ListDocumentsRequest(*qbusiness.ListDocumentsInput) (*request.Request, *qbusiness.ListDocumentsOutput) - - ListDocumentsPages(*qbusiness.ListDocumentsInput, func(*qbusiness.ListDocumentsOutput, bool) bool) error - ListDocumentsPagesWithContext(aws.Context, *qbusiness.ListDocumentsInput, func(*qbusiness.ListDocumentsOutput, bool) bool, ...request.Option) error - - ListGroups(*qbusiness.ListGroupsInput) (*qbusiness.ListGroupsOutput, error) - ListGroupsWithContext(aws.Context, *qbusiness.ListGroupsInput, ...request.Option) (*qbusiness.ListGroupsOutput, error) - ListGroupsRequest(*qbusiness.ListGroupsInput) (*request.Request, *qbusiness.ListGroupsOutput) - - ListGroupsPages(*qbusiness.ListGroupsInput, func(*qbusiness.ListGroupsOutput, bool) bool) error - ListGroupsPagesWithContext(aws.Context, *qbusiness.ListGroupsInput, func(*qbusiness.ListGroupsOutput, bool) bool, ...request.Option) error - - ListIndices(*qbusiness.ListIndicesInput) (*qbusiness.ListIndicesOutput, error) - ListIndicesWithContext(aws.Context, *qbusiness.ListIndicesInput, ...request.Option) (*qbusiness.ListIndicesOutput, error) - ListIndicesRequest(*qbusiness.ListIndicesInput) (*request.Request, *qbusiness.ListIndicesOutput) - - ListIndicesPages(*qbusiness.ListIndicesInput, func(*qbusiness.ListIndicesOutput, bool) bool) error - ListIndicesPagesWithContext(aws.Context, *qbusiness.ListIndicesInput, func(*qbusiness.ListIndicesOutput, bool) bool, ...request.Option) error - - ListMessages(*qbusiness.ListMessagesInput) (*qbusiness.ListMessagesOutput, error) - ListMessagesWithContext(aws.Context, *qbusiness.ListMessagesInput, ...request.Option) (*qbusiness.ListMessagesOutput, error) - ListMessagesRequest(*qbusiness.ListMessagesInput) (*request.Request, *qbusiness.ListMessagesOutput) - - ListMessagesPages(*qbusiness.ListMessagesInput, func(*qbusiness.ListMessagesOutput, bool) bool) error - ListMessagesPagesWithContext(aws.Context, *qbusiness.ListMessagesInput, func(*qbusiness.ListMessagesOutput, bool) bool, ...request.Option) error - - ListPlugins(*qbusiness.ListPluginsInput) (*qbusiness.ListPluginsOutput, error) - ListPluginsWithContext(aws.Context, *qbusiness.ListPluginsInput, ...request.Option) (*qbusiness.ListPluginsOutput, error) - ListPluginsRequest(*qbusiness.ListPluginsInput) (*request.Request, *qbusiness.ListPluginsOutput) - - ListPluginsPages(*qbusiness.ListPluginsInput, func(*qbusiness.ListPluginsOutput, bool) bool) error - ListPluginsPagesWithContext(aws.Context, *qbusiness.ListPluginsInput, func(*qbusiness.ListPluginsOutput, bool) bool, ...request.Option) error - - ListRetrievers(*qbusiness.ListRetrieversInput) (*qbusiness.ListRetrieversOutput, error) - ListRetrieversWithContext(aws.Context, *qbusiness.ListRetrieversInput, ...request.Option) (*qbusiness.ListRetrieversOutput, error) - ListRetrieversRequest(*qbusiness.ListRetrieversInput) (*request.Request, *qbusiness.ListRetrieversOutput) - - ListRetrieversPages(*qbusiness.ListRetrieversInput, func(*qbusiness.ListRetrieversOutput, bool) bool) error - ListRetrieversPagesWithContext(aws.Context, *qbusiness.ListRetrieversInput, func(*qbusiness.ListRetrieversOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*qbusiness.ListTagsForResourceInput) (*qbusiness.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *qbusiness.ListTagsForResourceInput, ...request.Option) (*qbusiness.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*qbusiness.ListTagsForResourceInput) (*request.Request, *qbusiness.ListTagsForResourceOutput) - - ListWebExperiences(*qbusiness.ListWebExperiencesInput) (*qbusiness.ListWebExperiencesOutput, error) - ListWebExperiencesWithContext(aws.Context, *qbusiness.ListWebExperiencesInput, ...request.Option) (*qbusiness.ListWebExperiencesOutput, error) - ListWebExperiencesRequest(*qbusiness.ListWebExperiencesInput) (*request.Request, *qbusiness.ListWebExperiencesOutput) - - ListWebExperiencesPages(*qbusiness.ListWebExperiencesInput, func(*qbusiness.ListWebExperiencesOutput, bool) bool) error - ListWebExperiencesPagesWithContext(aws.Context, *qbusiness.ListWebExperiencesInput, func(*qbusiness.ListWebExperiencesOutput, bool) bool, ...request.Option) error - - PutFeedback(*qbusiness.PutFeedbackInput) (*qbusiness.PutFeedbackOutput, error) - PutFeedbackWithContext(aws.Context, *qbusiness.PutFeedbackInput, ...request.Option) (*qbusiness.PutFeedbackOutput, error) - PutFeedbackRequest(*qbusiness.PutFeedbackInput) (*request.Request, *qbusiness.PutFeedbackOutput) - - PutGroup(*qbusiness.PutGroupInput) (*qbusiness.PutGroupOutput, error) - PutGroupWithContext(aws.Context, *qbusiness.PutGroupInput, ...request.Option) (*qbusiness.PutGroupOutput, error) - PutGroupRequest(*qbusiness.PutGroupInput) (*request.Request, *qbusiness.PutGroupOutput) - - StartDataSourceSyncJob(*qbusiness.StartDataSourceSyncJobInput) (*qbusiness.StartDataSourceSyncJobOutput, error) - StartDataSourceSyncJobWithContext(aws.Context, *qbusiness.StartDataSourceSyncJobInput, ...request.Option) (*qbusiness.StartDataSourceSyncJobOutput, error) - StartDataSourceSyncJobRequest(*qbusiness.StartDataSourceSyncJobInput) (*request.Request, *qbusiness.StartDataSourceSyncJobOutput) - - StopDataSourceSyncJob(*qbusiness.StopDataSourceSyncJobInput) (*qbusiness.StopDataSourceSyncJobOutput, error) - StopDataSourceSyncJobWithContext(aws.Context, *qbusiness.StopDataSourceSyncJobInput, ...request.Option) (*qbusiness.StopDataSourceSyncJobOutput, error) - StopDataSourceSyncJobRequest(*qbusiness.StopDataSourceSyncJobInput) (*request.Request, *qbusiness.StopDataSourceSyncJobOutput) - - TagResource(*qbusiness.TagResourceInput) (*qbusiness.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *qbusiness.TagResourceInput, ...request.Option) (*qbusiness.TagResourceOutput, error) - TagResourceRequest(*qbusiness.TagResourceInput) (*request.Request, *qbusiness.TagResourceOutput) - - UntagResource(*qbusiness.UntagResourceInput) (*qbusiness.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *qbusiness.UntagResourceInput, ...request.Option) (*qbusiness.UntagResourceOutput, error) - UntagResourceRequest(*qbusiness.UntagResourceInput) (*request.Request, *qbusiness.UntagResourceOutput) - - UpdateApplication(*qbusiness.UpdateApplicationInput) (*qbusiness.UpdateApplicationOutput, error) - UpdateApplicationWithContext(aws.Context, *qbusiness.UpdateApplicationInput, ...request.Option) (*qbusiness.UpdateApplicationOutput, error) - UpdateApplicationRequest(*qbusiness.UpdateApplicationInput) (*request.Request, *qbusiness.UpdateApplicationOutput) - - UpdateChatControlsConfiguration(*qbusiness.UpdateChatControlsConfigurationInput) (*qbusiness.UpdateChatControlsConfigurationOutput, error) - UpdateChatControlsConfigurationWithContext(aws.Context, *qbusiness.UpdateChatControlsConfigurationInput, ...request.Option) (*qbusiness.UpdateChatControlsConfigurationOutput, error) - UpdateChatControlsConfigurationRequest(*qbusiness.UpdateChatControlsConfigurationInput) (*request.Request, *qbusiness.UpdateChatControlsConfigurationOutput) - - UpdateDataSource(*qbusiness.UpdateDataSourceInput) (*qbusiness.UpdateDataSourceOutput, error) - UpdateDataSourceWithContext(aws.Context, *qbusiness.UpdateDataSourceInput, ...request.Option) (*qbusiness.UpdateDataSourceOutput, error) - UpdateDataSourceRequest(*qbusiness.UpdateDataSourceInput) (*request.Request, *qbusiness.UpdateDataSourceOutput) - - UpdateIndex(*qbusiness.UpdateIndexInput) (*qbusiness.UpdateIndexOutput, error) - UpdateIndexWithContext(aws.Context, *qbusiness.UpdateIndexInput, ...request.Option) (*qbusiness.UpdateIndexOutput, error) - UpdateIndexRequest(*qbusiness.UpdateIndexInput) (*request.Request, *qbusiness.UpdateIndexOutput) - - UpdatePlugin(*qbusiness.UpdatePluginInput) (*qbusiness.UpdatePluginOutput, error) - UpdatePluginWithContext(aws.Context, *qbusiness.UpdatePluginInput, ...request.Option) (*qbusiness.UpdatePluginOutput, error) - UpdatePluginRequest(*qbusiness.UpdatePluginInput) (*request.Request, *qbusiness.UpdatePluginOutput) - - UpdateRetriever(*qbusiness.UpdateRetrieverInput) (*qbusiness.UpdateRetrieverOutput, error) - UpdateRetrieverWithContext(aws.Context, *qbusiness.UpdateRetrieverInput, ...request.Option) (*qbusiness.UpdateRetrieverOutput, error) - UpdateRetrieverRequest(*qbusiness.UpdateRetrieverInput) (*request.Request, *qbusiness.UpdateRetrieverOutput) - - UpdateUser(*qbusiness.UpdateUserInput) (*qbusiness.UpdateUserOutput, error) - UpdateUserWithContext(aws.Context, *qbusiness.UpdateUserInput, ...request.Option) (*qbusiness.UpdateUserOutput, error) - UpdateUserRequest(*qbusiness.UpdateUserInput) (*request.Request, *qbusiness.UpdateUserOutput) - - UpdateWebExperience(*qbusiness.UpdateWebExperienceInput) (*qbusiness.UpdateWebExperienceOutput, error) - UpdateWebExperienceWithContext(aws.Context, *qbusiness.UpdateWebExperienceInput, ...request.Option) (*qbusiness.UpdateWebExperienceOutput, error) - UpdateWebExperienceRequest(*qbusiness.UpdateWebExperienceInput) (*request.Request, *qbusiness.UpdateWebExperienceOutput) -} - -var _ QBusinessAPI = (*qbusiness.QBusiness)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/service.go deleted file mode 100644 index 1a4a05fbc893..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qbusiness/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package qbusiness - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// QBusiness provides the API operation methods for making requests to -// QBusiness. See this package's package overview docs -// for details on the service. -// -// QBusiness methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type QBusiness struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "QBusiness" // Name of service. - EndpointsID = "qbusiness" // ID to lookup a service endpoint with. - ServiceID = "QBusiness" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the QBusiness client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a QBusiness client from just a session. -// svc := qbusiness.New(mySession) -// -// // Create a QBusiness client with additional configuration -// svc := qbusiness.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *QBusiness { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "qbusiness" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *QBusiness { - svc := &QBusiness{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-11-27", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a QBusiness operation and runs any -// custom request initialization. -func (c *QBusiness) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/api.go deleted file mode 100644 index ff8b2682b10b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/api.go +++ /dev/null @@ -1,14744 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package qconnect - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateAssistant = "CreateAssistant" - -// CreateAssistantRequest generates a "aws/request.Request" representing the -// client's request for the CreateAssistant 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 CreateAssistant for more information on using the CreateAssistant -// 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 CreateAssistantRequest method. -// req, resp := client.CreateAssistantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateAssistant -func (c *QConnect) CreateAssistantRequest(input *CreateAssistantInput) (req *request.Request, output *CreateAssistantOutput) { - op := &request.Operation{ - Name: opCreateAssistant, - HTTPMethod: "POST", - HTTPPath: "/assistants", - } - - if input == nil { - input = &CreateAssistantInput{} - } - - output = &CreateAssistantOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAssistant API operation for Amazon Q Connect. -// -// Creates an Amazon Q in Connect assistant. -// -// 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 Q Connect's -// API operation CreateAssistant for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - ServiceQuotaExceededException -// You've exceeded your service quota. To perform the requested action, remove -// some of the relevant resources, or use service quotas to request a service -// quota increase. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateAssistant -func (c *QConnect) CreateAssistant(input *CreateAssistantInput) (*CreateAssistantOutput, error) { - req, out := c.CreateAssistantRequest(input) - return out, req.Send() -} - -// CreateAssistantWithContext is the same as CreateAssistant with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAssistant 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 *QConnect) CreateAssistantWithContext(ctx aws.Context, input *CreateAssistantInput, opts ...request.Option) (*CreateAssistantOutput, error) { - req, out := c.CreateAssistantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAssistantAssociation = "CreateAssistantAssociation" - -// CreateAssistantAssociationRequest generates a "aws/request.Request" representing the -// client's request for the CreateAssistantAssociation 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 CreateAssistantAssociation for more information on using the CreateAssistantAssociation -// 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 CreateAssistantAssociationRequest method. -// req, resp := client.CreateAssistantAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateAssistantAssociation -func (c *QConnect) CreateAssistantAssociationRequest(input *CreateAssistantAssociationInput) (req *request.Request, output *CreateAssistantAssociationOutput) { - op := &request.Operation{ - Name: opCreateAssistantAssociation, - HTTPMethod: "POST", - HTTPPath: "/assistants/{assistantId}/associations", - } - - if input == nil { - input = &CreateAssistantAssociationInput{} - } - - output = &CreateAssistantAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAssistantAssociation API operation for Amazon Q Connect. -// -// Creates an association between an Amazon Q in Connect assistant and another -// resource. Currently, the only supported association is with a knowledge base. -// An assistant can have only a single association. -// -// 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 Q Connect's -// API operation CreateAssistantAssociation for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - ServiceQuotaExceededException -// You've exceeded your service quota. To perform the requested action, remove -// some of the relevant resources, or use service quotas to request a service -// quota increase. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateAssistantAssociation -func (c *QConnect) CreateAssistantAssociation(input *CreateAssistantAssociationInput) (*CreateAssistantAssociationOutput, error) { - req, out := c.CreateAssistantAssociationRequest(input) - return out, req.Send() -} - -// CreateAssistantAssociationWithContext is the same as CreateAssistantAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAssistantAssociation 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 *QConnect) CreateAssistantAssociationWithContext(ctx aws.Context, input *CreateAssistantAssociationInput, opts ...request.Option) (*CreateAssistantAssociationOutput, error) { - req, out := c.CreateAssistantAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateContent = "CreateContent" - -// CreateContentRequest generates a "aws/request.Request" representing the -// client's request for the CreateContent 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 CreateContent for more information on using the CreateContent -// 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 CreateContentRequest method. -// req, resp := client.CreateContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateContent -func (c *QConnect) CreateContentRequest(input *CreateContentInput) (req *request.Request, output *CreateContentOutput) { - op := &request.Operation{ - Name: opCreateContent, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/contents", - } - - if input == nil { - input = &CreateContentInput{} - } - - output = &CreateContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateContent API operation for Amazon Q Connect. -// -// Creates Amazon Q content. Before to calling this API, use StartContentUpload -// (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_StartContentUpload.html) -// to upload an asset. -// -// 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 Q Connect's -// API operation CreateContent for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - ServiceQuotaExceededException -// You've exceeded your service quota. To perform the requested action, remove -// some of the relevant resources, or use service quotas to request a service -// quota increase. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateContent -func (c *QConnect) CreateContent(input *CreateContentInput) (*CreateContentOutput, error) { - req, out := c.CreateContentRequest(input) - return out, req.Send() -} - -// CreateContentWithContext is the same as CreateContent with the addition of -// the ability to pass a context and additional request options. -// -// See CreateContent 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 *QConnect) CreateContentWithContext(ctx aws.Context, input *CreateContentInput, opts ...request.Option) (*CreateContentOutput, error) { - req, out := c.CreateContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateKnowledgeBase = "CreateKnowledgeBase" - -// CreateKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the CreateKnowledgeBase 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 CreateKnowledgeBase for more information on using the CreateKnowledgeBase -// 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 CreateKnowledgeBaseRequest method. -// req, resp := client.CreateKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateKnowledgeBase -func (c *QConnect) CreateKnowledgeBaseRequest(input *CreateKnowledgeBaseInput) (req *request.Request, output *CreateKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opCreateKnowledgeBase, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases", - } - - if input == nil { - input = &CreateKnowledgeBaseInput{} - } - - output = &CreateKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateKnowledgeBase API operation for Amazon Q Connect. -// -// Creates a knowledge base. -// -// When using this API, you cannot reuse Amazon AppIntegrations (https://docs.aws.amazon.com/appintegrations/latest/APIReference/Welcome.html) -// DataIntegrations with external knowledge bases such as Salesforce and ServiceNow. -// If you do, you'll get an InvalidRequestException error. -// -// For example, you're programmatically managing your external knowledge base, -// and you want to add or remove one of the fields that is being ingested from -// Salesforce. Do the following: -// -// Call DeleteKnowledgeBase (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_DeleteKnowledgeBase.html). -// -// Call DeleteDataIntegration (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_DeleteDataIntegration.html). -// -// Call CreateDataIntegration (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) -// to recreate the DataIntegration or a create different one. -// -// Call CreateKnowledgeBase. -// -// 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 Q Connect's -// API operation CreateKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - ServiceQuotaExceededException -// You've exceeded your service quota. To perform the requested action, remove -// some of the relevant resources, or use service quotas to request a service -// quota increase. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateKnowledgeBase -func (c *QConnect) CreateKnowledgeBase(input *CreateKnowledgeBaseInput) (*CreateKnowledgeBaseOutput, error) { - req, out := c.CreateKnowledgeBaseRequest(input) - return out, req.Send() -} - -// CreateKnowledgeBaseWithContext is the same as CreateKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See CreateKnowledgeBase 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 *QConnect) CreateKnowledgeBaseWithContext(ctx aws.Context, input *CreateKnowledgeBaseInput, opts ...request.Option) (*CreateKnowledgeBaseOutput, error) { - req, out := c.CreateKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateQuickResponse = "CreateQuickResponse" - -// CreateQuickResponseRequest generates a "aws/request.Request" representing the -// client's request for the CreateQuickResponse 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 CreateQuickResponse for more information on using the CreateQuickResponse -// 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 CreateQuickResponseRequest method. -// req, resp := client.CreateQuickResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateQuickResponse -func (c *QConnect) CreateQuickResponseRequest(input *CreateQuickResponseInput) (req *request.Request, output *CreateQuickResponseOutput) { - op := &request.Operation{ - Name: opCreateQuickResponse, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/quickResponses", - } - - if input == nil { - input = &CreateQuickResponseInput{} - } - - output = &CreateQuickResponseOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateQuickResponse API operation for Amazon Q Connect. -// -// Creates a Amazon Q quick response. -// -// 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 Q Connect's -// API operation CreateQuickResponse for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - ServiceQuotaExceededException -// You've exceeded your service quota. To perform the requested action, remove -// some of the relevant resources, or use service quotas to request a service -// quota increase. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateQuickResponse -func (c *QConnect) CreateQuickResponse(input *CreateQuickResponseInput) (*CreateQuickResponseOutput, error) { - req, out := c.CreateQuickResponseRequest(input) - return out, req.Send() -} - -// CreateQuickResponseWithContext is the same as CreateQuickResponse with the addition of -// the ability to pass a context and additional request options. -// -// See CreateQuickResponse 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 *QConnect) CreateQuickResponseWithContext(ctx aws.Context, input *CreateQuickResponseInput, opts ...request.Option) (*CreateQuickResponseOutput, error) { - req, out := c.CreateQuickResponseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSession = "CreateSession" - -// CreateSessionRequest generates a "aws/request.Request" representing the -// client's request for the CreateSession 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 CreateSession for more information on using the CreateSession -// 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 CreateSessionRequest method. -// req, resp := client.CreateSessionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateSession -func (c *QConnect) CreateSessionRequest(input *CreateSessionInput) (req *request.Request, output *CreateSessionOutput) { - op := &request.Operation{ - Name: opCreateSession, - HTTPMethod: "POST", - HTTPPath: "/assistants/{assistantId}/sessions", - } - - if input == nil { - input = &CreateSessionInput{} - } - - output = &CreateSessionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSession API operation for Amazon Q Connect. -// -// Creates a session. A session is a contextual container used for generating -// recommendations. Amazon Connect creates a new Amazon Q session for each contact -// on which Amazon Q is enabled. -// -// 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 Q Connect's -// API operation CreateSession for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/CreateSession -func (c *QConnect) CreateSession(input *CreateSessionInput) (*CreateSessionOutput, error) { - req, out := c.CreateSessionRequest(input) - return out, req.Send() -} - -// CreateSessionWithContext is the same as CreateSession with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSession 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 *QConnect) CreateSessionWithContext(ctx aws.Context, input *CreateSessionInput, opts ...request.Option) (*CreateSessionOutput, error) { - req, out := c.CreateSessionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAssistant = "DeleteAssistant" - -// DeleteAssistantRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAssistant 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 DeleteAssistant for more information on using the DeleteAssistant -// 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 DeleteAssistantRequest method. -// req, resp := client.DeleteAssistantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteAssistant -func (c *QConnect) DeleteAssistantRequest(input *DeleteAssistantInput) (req *request.Request, output *DeleteAssistantOutput) { - op := &request.Operation{ - Name: opDeleteAssistant, - HTTPMethod: "DELETE", - HTTPPath: "/assistants/{assistantId}", - } - - if input == nil { - input = &DeleteAssistantInput{} - } - - output = &DeleteAssistantOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAssistant API operation for Amazon Q Connect. -// -// Deletes an assistant. -// -// 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 Q Connect's -// API operation DeleteAssistant for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteAssistant -func (c *QConnect) DeleteAssistant(input *DeleteAssistantInput) (*DeleteAssistantOutput, error) { - req, out := c.DeleteAssistantRequest(input) - return out, req.Send() -} - -// DeleteAssistantWithContext is the same as DeleteAssistant with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAssistant 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 *QConnect) DeleteAssistantWithContext(ctx aws.Context, input *DeleteAssistantInput, opts ...request.Option) (*DeleteAssistantOutput, error) { - req, out := c.DeleteAssistantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAssistantAssociation = "DeleteAssistantAssociation" - -// DeleteAssistantAssociationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAssistantAssociation 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 DeleteAssistantAssociation for more information on using the DeleteAssistantAssociation -// 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 DeleteAssistantAssociationRequest method. -// req, resp := client.DeleteAssistantAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteAssistantAssociation -func (c *QConnect) DeleteAssistantAssociationRequest(input *DeleteAssistantAssociationInput) (req *request.Request, output *DeleteAssistantAssociationOutput) { - op := &request.Operation{ - Name: opDeleteAssistantAssociation, - HTTPMethod: "DELETE", - HTTPPath: "/assistants/{assistantId}/associations/{assistantAssociationId}", - } - - if input == nil { - input = &DeleteAssistantAssociationInput{} - } - - output = &DeleteAssistantAssociationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAssistantAssociation API operation for Amazon Q Connect. -// -// Deletes an assistant association. -// -// 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 Q Connect's -// API operation DeleteAssistantAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteAssistantAssociation -func (c *QConnect) DeleteAssistantAssociation(input *DeleteAssistantAssociationInput) (*DeleteAssistantAssociationOutput, error) { - req, out := c.DeleteAssistantAssociationRequest(input) - return out, req.Send() -} - -// DeleteAssistantAssociationWithContext is the same as DeleteAssistantAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAssistantAssociation 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 *QConnect) DeleteAssistantAssociationWithContext(ctx aws.Context, input *DeleteAssistantAssociationInput, opts ...request.Option) (*DeleteAssistantAssociationOutput, error) { - req, out := c.DeleteAssistantAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteContent = "DeleteContent" - -// DeleteContentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteContent 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 DeleteContent for more information on using the DeleteContent -// 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 DeleteContentRequest method. -// req, resp := client.DeleteContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteContent -func (c *QConnect) DeleteContentRequest(input *DeleteContentInput) (req *request.Request, output *DeleteContentOutput) { - op := &request.Operation{ - Name: opDeleteContent, - HTTPMethod: "DELETE", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}", - } - - if input == nil { - input = &DeleteContentInput{} - } - - output = &DeleteContentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteContent API operation for Amazon Q Connect. -// -// Deletes the content. -// -// 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 Q Connect's -// API operation DeleteContent for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteContent -func (c *QConnect) DeleteContent(input *DeleteContentInput) (*DeleteContentOutput, error) { - req, out := c.DeleteContentRequest(input) - return out, req.Send() -} - -// DeleteContentWithContext is the same as DeleteContent with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteContent 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 *QConnect) DeleteContentWithContext(ctx aws.Context, input *DeleteContentInput, opts ...request.Option) (*DeleteContentOutput, error) { - req, out := c.DeleteContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteImportJob = "DeleteImportJob" - -// DeleteImportJobRequest generates a "aws/request.Request" representing the -// client's request for the DeleteImportJob 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 DeleteImportJob for more information on using the DeleteImportJob -// 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 DeleteImportJobRequest method. -// req, resp := client.DeleteImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteImportJob -func (c *QConnect) DeleteImportJobRequest(input *DeleteImportJobInput) (req *request.Request, output *DeleteImportJobOutput) { - op := &request.Operation{ - Name: opDeleteImportJob, - HTTPMethod: "DELETE", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}", - } - - if input == nil { - input = &DeleteImportJobInput{} - } - - output = &DeleteImportJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteImportJob API operation for Amazon Q Connect. -// -// Deletes the quick response import job. -// -// 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 Q Connect's -// API operation DeleteImportJob for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteImportJob -func (c *QConnect) DeleteImportJob(input *DeleteImportJobInput) (*DeleteImportJobOutput, error) { - req, out := c.DeleteImportJobRequest(input) - return out, req.Send() -} - -// DeleteImportJobWithContext is the same as DeleteImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteImportJob 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 *QConnect) DeleteImportJobWithContext(ctx aws.Context, input *DeleteImportJobInput, opts ...request.Option) (*DeleteImportJobOutput, error) { - req, out := c.DeleteImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteKnowledgeBase = "DeleteKnowledgeBase" - -// DeleteKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the DeleteKnowledgeBase 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 DeleteKnowledgeBase for more information on using the DeleteKnowledgeBase -// 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 DeleteKnowledgeBaseRequest method. -// req, resp := client.DeleteKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteKnowledgeBase -func (c *QConnect) DeleteKnowledgeBaseRequest(input *DeleteKnowledgeBaseInput) (req *request.Request, output *DeleteKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opDeleteKnowledgeBase, - HTTPMethod: "DELETE", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}", - } - - if input == nil { - input = &DeleteKnowledgeBaseInput{} - } - - output = &DeleteKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteKnowledgeBase API operation for Amazon Q Connect. -// -// Deletes the knowledge base. -// -// When you use this API to delete an external knowledge base such as Salesforce -// or ServiceNow, you must also delete the Amazon AppIntegrations (https://docs.aws.amazon.com/appintegrations/latest/APIReference/Welcome.html) -// DataIntegration. This is because you can't reuse the DataIntegration after -// it's been associated with an external knowledge base. However, you can delete -// and recreate it. See DeleteDataIntegration (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_DeleteDataIntegration.html) -// and CreateDataIntegration (https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html) -// in the Amazon AppIntegrations API Reference. -// -// 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 Q Connect's -// API operation DeleteKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteKnowledgeBase -func (c *QConnect) DeleteKnowledgeBase(input *DeleteKnowledgeBaseInput) (*DeleteKnowledgeBaseOutput, error) { - req, out := c.DeleteKnowledgeBaseRequest(input) - return out, req.Send() -} - -// DeleteKnowledgeBaseWithContext is the same as DeleteKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteKnowledgeBase 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 *QConnect) DeleteKnowledgeBaseWithContext(ctx aws.Context, input *DeleteKnowledgeBaseInput, opts ...request.Option) (*DeleteKnowledgeBaseOutput, error) { - req, out := c.DeleteKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteQuickResponse = "DeleteQuickResponse" - -// DeleteQuickResponseRequest generates a "aws/request.Request" representing the -// client's request for the DeleteQuickResponse 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 DeleteQuickResponse for more information on using the DeleteQuickResponse -// 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 DeleteQuickResponseRequest method. -// req, resp := client.DeleteQuickResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteQuickResponse -func (c *QConnect) DeleteQuickResponseRequest(input *DeleteQuickResponseInput) (req *request.Request, output *DeleteQuickResponseOutput) { - op := &request.Operation{ - Name: opDeleteQuickResponse, - HTTPMethod: "DELETE", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}", - } - - if input == nil { - input = &DeleteQuickResponseInput{} - } - - output = &DeleteQuickResponseOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteQuickResponse API operation for Amazon Q Connect. -// -// Deletes a quick response. -// -// 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 Q Connect's -// API operation DeleteQuickResponse for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/DeleteQuickResponse -func (c *QConnect) DeleteQuickResponse(input *DeleteQuickResponseInput) (*DeleteQuickResponseOutput, error) { - req, out := c.DeleteQuickResponseRequest(input) - return out, req.Send() -} - -// DeleteQuickResponseWithContext is the same as DeleteQuickResponse with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteQuickResponse 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 *QConnect) DeleteQuickResponseWithContext(ctx aws.Context, input *DeleteQuickResponseInput, opts ...request.Option) (*DeleteQuickResponseOutput, error) { - req, out := c.DeleteQuickResponseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAssistant = "GetAssistant" - -// GetAssistantRequest generates a "aws/request.Request" representing the -// client's request for the GetAssistant 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 GetAssistant for more information on using the GetAssistant -// 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 GetAssistantRequest method. -// req, resp := client.GetAssistantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetAssistant -func (c *QConnect) GetAssistantRequest(input *GetAssistantInput) (req *request.Request, output *GetAssistantOutput) { - op := &request.Operation{ - Name: opGetAssistant, - HTTPMethod: "GET", - HTTPPath: "/assistants/{assistantId}", - } - - if input == nil { - input = &GetAssistantInput{} - } - - output = &GetAssistantOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAssistant API operation for Amazon Q Connect. -// -// Retrieves information about an assistant. -// -// 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 Q Connect's -// API operation GetAssistant for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetAssistant -func (c *QConnect) GetAssistant(input *GetAssistantInput) (*GetAssistantOutput, error) { - req, out := c.GetAssistantRequest(input) - return out, req.Send() -} - -// GetAssistantWithContext is the same as GetAssistant with the addition of -// the ability to pass a context and additional request options. -// -// See GetAssistant 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 *QConnect) GetAssistantWithContext(ctx aws.Context, input *GetAssistantInput, opts ...request.Option) (*GetAssistantOutput, error) { - req, out := c.GetAssistantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAssistantAssociation = "GetAssistantAssociation" - -// GetAssistantAssociationRequest generates a "aws/request.Request" representing the -// client's request for the GetAssistantAssociation 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 GetAssistantAssociation for more information on using the GetAssistantAssociation -// 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 GetAssistantAssociationRequest method. -// req, resp := client.GetAssistantAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetAssistantAssociation -func (c *QConnect) GetAssistantAssociationRequest(input *GetAssistantAssociationInput) (req *request.Request, output *GetAssistantAssociationOutput) { - op := &request.Operation{ - Name: opGetAssistantAssociation, - HTTPMethod: "GET", - HTTPPath: "/assistants/{assistantId}/associations/{assistantAssociationId}", - } - - if input == nil { - input = &GetAssistantAssociationInput{} - } - - output = &GetAssistantAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAssistantAssociation API operation for Amazon Q Connect. -// -// Retrieves information about an assistant association. -// -// 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 Q Connect's -// API operation GetAssistantAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetAssistantAssociation -func (c *QConnect) GetAssistantAssociation(input *GetAssistantAssociationInput) (*GetAssistantAssociationOutput, error) { - req, out := c.GetAssistantAssociationRequest(input) - return out, req.Send() -} - -// GetAssistantAssociationWithContext is the same as GetAssistantAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See GetAssistantAssociation 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 *QConnect) GetAssistantAssociationWithContext(ctx aws.Context, input *GetAssistantAssociationInput, opts ...request.Option) (*GetAssistantAssociationOutput, error) { - req, out := c.GetAssistantAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetContent = "GetContent" - -// GetContentRequest generates a "aws/request.Request" representing the -// client's request for the GetContent 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 GetContent for more information on using the GetContent -// 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 GetContentRequest method. -// req, resp := client.GetContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetContent -func (c *QConnect) GetContentRequest(input *GetContentInput) (req *request.Request, output *GetContentOutput) { - op := &request.Operation{ - Name: opGetContent, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}", - } - - if input == nil { - input = &GetContentInput{} - } - - output = &GetContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetContent API operation for Amazon Q Connect. -// -// Retrieves content, including a pre-signed URL to download the content. -// -// 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 Q Connect's -// API operation GetContent for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetContent -func (c *QConnect) GetContent(input *GetContentInput) (*GetContentOutput, error) { - req, out := c.GetContentRequest(input) - return out, req.Send() -} - -// GetContentWithContext is the same as GetContent with the addition of -// the ability to pass a context and additional request options. -// -// See GetContent 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 *QConnect) GetContentWithContext(ctx aws.Context, input *GetContentInput, opts ...request.Option) (*GetContentOutput, error) { - req, out := c.GetContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetContentSummary = "GetContentSummary" - -// GetContentSummaryRequest generates a "aws/request.Request" representing the -// client's request for the GetContentSummary 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 GetContentSummary for more information on using the GetContentSummary -// 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 GetContentSummaryRequest method. -// req, resp := client.GetContentSummaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetContentSummary -func (c *QConnect) GetContentSummaryRequest(input *GetContentSummaryInput) (req *request.Request, output *GetContentSummaryOutput) { - op := &request.Operation{ - Name: opGetContentSummary, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}/summary", - } - - if input == nil { - input = &GetContentSummaryInput{} - } - - output = &GetContentSummaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetContentSummary API operation for Amazon Q Connect. -// -// Retrieves summary information about the content. -// -// 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 Q Connect's -// API operation GetContentSummary for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetContentSummary -func (c *QConnect) GetContentSummary(input *GetContentSummaryInput) (*GetContentSummaryOutput, error) { - req, out := c.GetContentSummaryRequest(input) - return out, req.Send() -} - -// GetContentSummaryWithContext is the same as GetContentSummary with the addition of -// the ability to pass a context and additional request options. -// -// See GetContentSummary 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 *QConnect) GetContentSummaryWithContext(ctx aws.Context, input *GetContentSummaryInput, opts ...request.Option) (*GetContentSummaryOutput, error) { - req, out := c.GetContentSummaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetImportJob = "GetImportJob" - -// GetImportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetImportJob 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 GetImportJob for more information on using the GetImportJob -// 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 GetImportJobRequest method. -// req, resp := client.GetImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetImportJob -func (c *QConnect) GetImportJobRequest(input *GetImportJobInput) (req *request.Request, output *GetImportJobOutput) { - op := &request.Operation{ - Name: opGetImportJob, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/importJobs/{importJobId}", - } - - if input == nil { - input = &GetImportJobInput{} - } - - output = &GetImportJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetImportJob API operation for Amazon Q Connect. -// -// Retrieves the started import job. -// -// 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 Q Connect's -// API operation GetImportJob for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetImportJob -func (c *QConnect) GetImportJob(input *GetImportJobInput) (*GetImportJobOutput, error) { - req, out := c.GetImportJobRequest(input) - return out, req.Send() -} - -// GetImportJobWithContext is the same as GetImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetImportJob 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 *QConnect) GetImportJobWithContext(ctx aws.Context, input *GetImportJobInput, opts ...request.Option) (*GetImportJobOutput, error) { - req, out := c.GetImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetKnowledgeBase = "GetKnowledgeBase" - -// GetKnowledgeBaseRequest generates a "aws/request.Request" representing the -// client's request for the GetKnowledgeBase 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 GetKnowledgeBase for more information on using the GetKnowledgeBase -// 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 GetKnowledgeBaseRequest method. -// req, resp := client.GetKnowledgeBaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetKnowledgeBase -func (c *QConnect) GetKnowledgeBaseRequest(input *GetKnowledgeBaseInput) (req *request.Request, output *GetKnowledgeBaseOutput) { - op := &request.Operation{ - Name: opGetKnowledgeBase, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}", - } - - if input == nil { - input = &GetKnowledgeBaseInput{} - } - - output = &GetKnowledgeBaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetKnowledgeBase API operation for Amazon Q Connect. -// -// Retrieves information about the knowledge base. -// -// 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 Q Connect's -// API operation GetKnowledgeBase for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetKnowledgeBase -func (c *QConnect) GetKnowledgeBase(input *GetKnowledgeBaseInput) (*GetKnowledgeBaseOutput, error) { - req, out := c.GetKnowledgeBaseRequest(input) - return out, req.Send() -} - -// GetKnowledgeBaseWithContext is the same as GetKnowledgeBase with the addition of -// the ability to pass a context and additional request options. -// -// See GetKnowledgeBase 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 *QConnect) GetKnowledgeBaseWithContext(ctx aws.Context, input *GetKnowledgeBaseInput, opts ...request.Option) (*GetKnowledgeBaseOutput, error) { - req, out := c.GetKnowledgeBaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetQuickResponse = "GetQuickResponse" - -// GetQuickResponseRequest generates a "aws/request.Request" representing the -// client's request for the GetQuickResponse 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 GetQuickResponse for more information on using the GetQuickResponse -// 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 GetQuickResponseRequest method. -// req, resp := client.GetQuickResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetQuickResponse -func (c *QConnect) GetQuickResponseRequest(input *GetQuickResponseInput) (req *request.Request, output *GetQuickResponseOutput) { - op := &request.Operation{ - Name: opGetQuickResponse, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}", - } - - if input == nil { - input = &GetQuickResponseInput{} - } - - output = &GetQuickResponseOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetQuickResponse API operation for Amazon Q Connect. -// -// Retrieves the quick response. -// -// 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 Q Connect's -// API operation GetQuickResponse for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetQuickResponse -func (c *QConnect) GetQuickResponse(input *GetQuickResponseInput) (*GetQuickResponseOutput, error) { - req, out := c.GetQuickResponseRequest(input) - return out, req.Send() -} - -// GetQuickResponseWithContext is the same as GetQuickResponse with the addition of -// the ability to pass a context and additional request options. -// -// See GetQuickResponse 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 *QConnect) GetQuickResponseWithContext(ctx aws.Context, input *GetQuickResponseInput, opts ...request.Option) (*GetQuickResponseOutput, error) { - req, out := c.GetQuickResponseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRecommendations = "GetRecommendations" - -// GetRecommendationsRequest generates a "aws/request.Request" representing the -// client's request for the GetRecommendations 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 GetRecommendations for more information on using the GetRecommendations -// 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 GetRecommendationsRequest method. -// req, resp := client.GetRecommendationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetRecommendations -func (c *QConnect) GetRecommendationsRequest(input *GetRecommendationsInput) (req *request.Request, output *GetRecommendationsOutput) { - op := &request.Operation{ - Name: opGetRecommendations, - HTTPMethod: "GET", - HTTPPath: "/assistants/{assistantId}/sessions/{sessionId}/recommendations", - } - - if input == nil { - input = &GetRecommendationsInput{} - } - - output = &GetRecommendationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRecommendations API operation for Amazon Q Connect. -// -// Retrieves recommendations for the specified session. To avoid retrieving -// the same recommendations in subsequent calls, use NotifyRecommendationsReceived -// (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_NotifyRecommendationsReceived.html). -// This API supports long-polling behavior with the waitTimeSeconds parameter. -// Short poll is the default behavior and only returns recommendations already -// available. To perform a manual query against an assistant, use QueryAssistant -// (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_QueryAssistant.html). -// -// 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 Q Connect's -// API operation GetRecommendations for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetRecommendations -func (c *QConnect) GetRecommendations(input *GetRecommendationsInput) (*GetRecommendationsOutput, error) { - req, out := c.GetRecommendationsRequest(input) - return out, req.Send() -} - -// GetRecommendationsWithContext is the same as GetRecommendations with the addition of -// the ability to pass a context and additional request options. -// -// See GetRecommendations 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 *QConnect) GetRecommendationsWithContext(ctx aws.Context, input *GetRecommendationsInput, opts ...request.Option) (*GetRecommendationsOutput, error) { - req, out := c.GetRecommendationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSession = "GetSession" - -// GetSessionRequest generates a "aws/request.Request" representing the -// client's request for the GetSession 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 GetSession for more information on using the GetSession -// 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 GetSessionRequest method. -// req, resp := client.GetSessionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetSession -func (c *QConnect) GetSessionRequest(input *GetSessionInput) (req *request.Request, output *GetSessionOutput) { - op := &request.Operation{ - Name: opGetSession, - HTTPMethod: "GET", - HTTPPath: "/assistants/{assistantId}/sessions/{sessionId}", - } - - if input == nil { - input = &GetSessionInput{} - } - - output = &GetSessionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSession API operation for Amazon Q Connect. -// -// Retrieves information for a specified session. -// -// 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 Q Connect's -// API operation GetSession for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/GetSession -func (c *QConnect) GetSession(input *GetSessionInput) (*GetSessionOutput, error) { - req, out := c.GetSessionRequest(input) - return out, req.Send() -} - -// GetSessionWithContext is the same as GetSession with the addition of -// the ability to pass a context and additional request options. -// -// See GetSession 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 *QConnect) GetSessionWithContext(ctx aws.Context, input *GetSessionInput, opts ...request.Option) (*GetSessionOutput, error) { - req, out := c.GetSessionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAssistantAssociations = "ListAssistantAssociations" - -// ListAssistantAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the ListAssistantAssociations 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 ListAssistantAssociations for more information on using the ListAssistantAssociations -// 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 ListAssistantAssociationsRequest method. -// req, resp := client.ListAssistantAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListAssistantAssociations -func (c *QConnect) ListAssistantAssociationsRequest(input *ListAssistantAssociationsInput) (req *request.Request, output *ListAssistantAssociationsOutput) { - op := &request.Operation{ - Name: opListAssistantAssociations, - HTTPMethod: "GET", - HTTPPath: "/assistants/{assistantId}/associations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAssistantAssociationsInput{} - } - - output = &ListAssistantAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssistantAssociations API operation for Amazon Q Connect. -// -// Lists information about assistant associations. -// -// 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 Q Connect's -// API operation ListAssistantAssociations for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListAssistantAssociations -func (c *QConnect) ListAssistantAssociations(input *ListAssistantAssociationsInput) (*ListAssistantAssociationsOutput, error) { - req, out := c.ListAssistantAssociationsRequest(input) - return out, req.Send() -} - -// ListAssistantAssociationsWithContext is the same as ListAssistantAssociations with the addition of -// the ability to pass a context and additional request options. -// -// See ListAssistantAssociations 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 *QConnect) ListAssistantAssociationsWithContext(ctx aws.Context, input *ListAssistantAssociationsInput, opts ...request.Option) (*ListAssistantAssociationsOutput, error) { - req, out := c.ListAssistantAssociationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAssistantAssociationsPages iterates over the pages of a ListAssistantAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssistantAssociations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAssistantAssociations operation. -// pageNum := 0 -// err := client.ListAssistantAssociationsPages(params, -// func(page *qconnect.ListAssistantAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) ListAssistantAssociationsPages(input *ListAssistantAssociationsInput, fn func(*ListAssistantAssociationsOutput, bool) bool) error { - return c.ListAssistantAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssistantAssociationsPagesWithContext same as ListAssistantAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) ListAssistantAssociationsPagesWithContext(ctx aws.Context, input *ListAssistantAssociationsInput, fn func(*ListAssistantAssociationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAssistantAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAssistantAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAssistantAssociationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAssistants = "ListAssistants" - -// ListAssistantsRequest generates a "aws/request.Request" representing the -// client's request for the ListAssistants 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 ListAssistants for more information on using the ListAssistants -// 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 ListAssistantsRequest method. -// req, resp := client.ListAssistantsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListAssistants -func (c *QConnect) ListAssistantsRequest(input *ListAssistantsInput) (req *request.Request, output *ListAssistantsOutput) { - op := &request.Operation{ - Name: opListAssistants, - HTTPMethod: "GET", - HTTPPath: "/assistants", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAssistantsInput{} - } - - output = &ListAssistantsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAssistants API operation for Amazon Q Connect. -// -// Lists information about assistants. -// -// 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 Q Connect's -// API operation ListAssistants for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListAssistants -func (c *QConnect) ListAssistants(input *ListAssistantsInput) (*ListAssistantsOutput, error) { - req, out := c.ListAssistantsRequest(input) - return out, req.Send() -} - -// ListAssistantsWithContext is the same as ListAssistants with the addition of -// the ability to pass a context and additional request options. -// -// See ListAssistants 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 *QConnect) ListAssistantsWithContext(ctx aws.Context, input *ListAssistantsInput, opts ...request.Option) (*ListAssistantsOutput, error) { - req, out := c.ListAssistantsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAssistantsPages iterates over the pages of a ListAssistants operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAssistants method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAssistants operation. -// pageNum := 0 -// err := client.ListAssistantsPages(params, -// func(page *qconnect.ListAssistantsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) ListAssistantsPages(input *ListAssistantsInput, fn func(*ListAssistantsOutput, bool) bool) error { - return c.ListAssistantsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAssistantsPagesWithContext same as ListAssistantsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) ListAssistantsPagesWithContext(ctx aws.Context, input *ListAssistantsInput, fn func(*ListAssistantsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAssistantsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAssistantsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAssistantsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListContents = "ListContents" - -// ListContentsRequest generates a "aws/request.Request" representing the -// client's request for the ListContents 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 ListContents for more information on using the ListContents -// 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 ListContentsRequest method. -// req, resp := client.ListContentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListContents -func (c *QConnect) ListContentsRequest(input *ListContentsInput) (req *request.Request, output *ListContentsOutput) { - op := &request.Operation{ - Name: opListContents, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/contents", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListContentsInput{} - } - - output = &ListContentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListContents API operation for Amazon Q Connect. -// -// Lists the content. -// -// 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 Q Connect's -// API operation ListContents for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListContents -func (c *QConnect) ListContents(input *ListContentsInput) (*ListContentsOutput, error) { - req, out := c.ListContentsRequest(input) - return out, req.Send() -} - -// ListContentsWithContext is the same as ListContents with the addition of -// the ability to pass a context and additional request options. -// -// See ListContents 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 *QConnect) ListContentsWithContext(ctx aws.Context, input *ListContentsInput, opts ...request.Option) (*ListContentsOutput, error) { - req, out := c.ListContentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListContentsPages iterates over the pages of a ListContents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListContents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListContents operation. -// pageNum := 0 -// err := client.ListContentsPages(params, -// func(page *qconnect.ListContentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) ListContentsPages(input *ListContentsInput, fn func(*ListContentsOutput, bool) bool) error { - return c.ListContentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListContentsPagesWithContext same as ListContentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) ListContentsPagesWithContext(ctx aws.Context, input *ListContentsInput, fn func(*ListContentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListContentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListContentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListContentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListImportJobs = "ListImportJobs" - -// ListImportJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListImportJobs 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 ListImportJobs for more information on using the ListImportJobs -// 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 ListImportJobsRequest method. -// req, resp := client.ListImportJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListImportJobs -func (c *QConnect) ListImportJobsRequest(input *ListImportJobsInput) (req *request.Request, output *ListImportJobsOutput) { - op := &request.Operation{ - Name: opListImportJobs, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/importJobs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListImportJobsInput{} - } - - output = &ListImportJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListImportJobs API operation for Amazon Q Connect. -// -// Lists information about import jobs. -// -// 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 Q Connect's -// API operation ListImportJobs for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListImportJobs -func (c *QConnect) ListImportJobs(input *ListImportJobsInput) (*ListImportJobsOutput, error) { - req, out := c.ListImportJobsRequest(input) - return out, req.Send() -} - -// ListImportJobsWithContext is the same as ListImportJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListImportJobs 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 *QConnect) ListImportJobsWithContext(ctx aws.Context, input *ListImportJobsInput, opts ...request.Option) (*ListImportJobsOutput, error) { - req, out := c.ListImportJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListImportJobsPages iterates over the pages of a ListImportJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListImportJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListImportJobs operation. -// pageNum := 0 -// err := client.ListImportJobsPages(params, -// func(page *qconnect.ListImportJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) ListImportJobsPages(input *ListImportJobsInput, fn func(*ListImportJobsOutput, bool) bool) error { - return c.ListImportJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListImportJobsPagesWithContext same as ListImportJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) ListImportJobsPagesWithContext(ctx aws.Context, input *ListImportJobsInput, fn func(*ListImportJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListImportJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListImportJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListImportJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListKnowledgeBases = "ListKnowledgeBases" - -// ListKnowledgeBasesRequest generates a "aws/request.Request" representing the -// client's request for the ListKnowledgeBases 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 ListKnowledgeBases for more information on using the ListKnowledgeBases -// 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 ListKnowledgeBasesRequest method. -// req, resp := client.ListKnowledgeBasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListKnowledgeBases -func (c *QConnect) ListKnowledgeBasesRequest(input *ListKnowledgeBasesInput) (req *request.Request, output *ListKnowledgeBasesOutput) { - op := &request.Operation{ - Name: opListKnowledgeBases, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListKnowledgeBasesInput{} - } - - output = &ListKnowledgeBasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListKnowledgeBases API operation for Amazon Q Connect. -// -// Lists the knowledge bases. -// -// 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 Q Connect's -// API operation ListKnowledgeBases for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListKnowledgeBases -func (c *QConnect) ListKnowledgeBases(input *ListKnowledgeBasesInput) (*ListKnowledgeBasesOutput, error) { - req, out := c.ListKnowledgeBasesRequest(input) - return out, req.Send() -} - -// ListKnowledgeBasesWithContext is the same as ListKnowledgeBases with the addition of -// the ability to pass a context and additional request options. -// -// See ListKnowledgeBases 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 *QConnect) ListKnowledgeBasesWithContext(ctx aws.Context, input *ListKnowledgeBasesInput, opts ...request.Option) (*ListKnowledgeBasesOutput, error) { - req, out := c.ListKnowledgeBasesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListKnowledgeBasesPages iterates over the pages of a ListKnowledgeBases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListKnowledgeBases method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListKnowledgeBases operation. -// pageNum := 0 -// err := client.ListKnowledgeBasesPages(params, -// func(page *qconnect.ListKnowledgeBasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) ListKnowledgeBasesPages(input *ListKnowledgeBasesInput, fn func(*ListKnowledgeBasesOutput, bool) bool) error { - return c.ListKnowledgeBasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListKnowledgeBasesPagesWithContext same as ListKnowledgeBasesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) ListKnowledgeBasesPagesWithContext(ctx aws.Context, input *ListKnowledgeBasesInput, fn func(*ListKnowledgeBasesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListKnowledgeBasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListKnowledgeBasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListKnowledgeBasesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListQuickResponses = "ListQuickResponses" - -// ListQuickResponsesRequest generates a "aws/request.Request" representing the -// client's request for the ListQuickResponses 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 ListQuickResponses for more information on using the ListQuickResponses -// 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 ListQuickResponsesRequest method. -// req, resp := client.ListQuickResponsesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListQuickResponses -func (c *QConnect) ListQuickResponsesRequest(input *ListQuickResponsesInput) (req *request.Request, output *ListQuickResponsesOutput) { - op := &request.Operation{ - Name: opListQuickResponses, - HTTPMethod: "GET", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/quickResponses", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListQuickResponsesInput{} - } - - output = &ListQuickResponsesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListQuickResponses API operation for Amazon Q Connect. -// -// Lists information about quick response. -// -// 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 Q Connect's -// API operation ListQuickResponses for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListQuickResponses -func (c *QConnect) ListQuickResponses(input *ListQuickResponsesInput) (*ListQuickResponsesOutput, error) { - req, out := c.ListQuickResponsesRequest(input) - return out, req.Send() -} - -// ListQuickResponsesWithContext is the same as ListQuickResponses with the addition of -// the ability to pass a context and additional request options. -// -// See ListQuickResponses 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 *QConnect) ListQuickResponsesWithContext(ctx aws.Context, input *ListQuickResponsesInput, opts ...request.Option) (*ListQuickResponsesOutput, error) { - req, out := c.ListQuickResponsesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListQuickResponsesPages iterates over the pages of a ListQuickResponses operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListQuickResponses method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListQuickResponses operation. -// pageNum := 0 -// err := client.ListQuickResponsesPages(params, -// func(page *qconnect.ListQuickResponsesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) ListQuickResponsesPages(input *ListQuickResponsesInput, fn func(*ListQuickResponsesOutput, bool) bool) error { - return c.ListQuickResponsesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListQuickResponsesPagesWithContext same as ListQuickResponsesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) ListQuickResponsesPagesWithContext(ctx aws.Context, input *ListQuickResponsesInput, fn func(*ListQuickResponsesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListQuickResponsesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListQuickResponsesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListQuickResponsesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListTagsForResource -func (c *QConnect) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Q Connect. -// -// Lists the tags for the specified resource. -// -// 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 Q Connect's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/ListTagsForResource -func (c *QConnect) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *QConnect) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opNotifyRecommendationsReceived = "NotifyRecommendationsReceived" - -// NotifyRecommendationsReceivedRequest generates a "aws/request.Request" representing the -// client's request for the NotifyRecommendationsReceived 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 NotifyRecommendationsReceived for more information on using the NotifyRecommendationsReceived -// 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 NotifyRecommendationsReceivedRequest method. -// req, resp := client.NotifyRecommendationsReceivedRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/NotifyRecommendationsReceived -func (c *QConnect) NotifyRecommendationsReceivedRequest(input *NotifyRecommendationsReceivedInput) (req *request.Request, output *NotifyRecommendationsReceivedOutput) { - op := &request.Operation{ - Name: opNotifyRecommendationsReceived, - HTTPMethod: "POST", - HTTPPath: "/assistants/{assistantId}/sessions/{sessionId}/recommendations/notify", - } - - if input == nil { - input = &NotifyRecommendationsReceivedInput{} - } - - output = &NotifyRecommendationsReceivedOutput{} - req = c.newRequest(op, input, output) - return -} - -// NotifyRecommendationsReceived API operation for Amazon Q Connect. -// -// Removes the specified recommendations from the specified assistant's queue -// of newly available recommendations. You can use this API in conjunction with -// GetRecommendations (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_GetRecommendations.html) -// and a waitTimeSeconds input for long-polling behavior and avoiding duplicate -// recommendations. -// -// 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 Q Connect's -// API operation NotifyRecommendationsReceived for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/NotifyRecommendationsReceived -func (c *QConnect) NotifyRecommendationsReceived(input *NotifyRecommendationsReceivedInput) (*NotifyRecommendationsReceivedOutput, error) { - req, out := c.NotifyRecommendationsReceivedRequest(input) - return out, req.Send() -} - -// NotifyRecommendationsReceivedWithContext is the same as NotifyRecommendationsReceived with the addition of -// the ability to pass a context and additional request options. -// -// See NotifyRecommendationsReceived 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 *QConnect) NotifyRecommendationsReceivedWithContext(ctx aws.Context, input *NotifyRecommendationsReceivedInput, opts ...request.Option) (*NotifyRecommendationsReceivedOutput, error) { - req, out := c.NotifyRecommendationsReceivedRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opQueryAssistant = "QueryAssistant" - -// QueryAssistantRequest generates a "aws/request.Request" representing the -// client's request for the QueryAssistant 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 QueryAssistant for more information on using the QueryAssistant -// 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 QueryAssistantRequest method. -// req, resp := client.QueryAssistantRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/QueryAssistant -func (c *QConnect) QueryAssistantRequest(input *QueryAssistantInput) (req *request.Request, output *QueryAssistantOutput) { - op := &request.Operation{ - Name: opQueryAssistant, - HTTPMethod: "POST", - HTTPPath: "/assistants/{assistantId}/query", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &QueryAssistantInput{} - } - - output = &QueryAssistantOutput{} - req = c.newRequest(op, input, output) - return -} - -// QueryAssistant API operation for Amazon Q Connect. -// -// Performs a manual search against the specified assistant. To retrieve recommendations -// for an assistant, use GetRecommendations (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_GetRecommendations.html). -// -// 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 Q Connect's -// API operation QueryAssistant for usage and error information. -// -// Returned Error Types: -// -// - RequestTimeoutException -// The request reached the service more than 15 minutes after the date stamp -// on the request or more than 15 minutes after the request expiration date -// (such as for pre-signed URLs), or the date stamp on the request is more than -// 15 minutes in the future. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/QueryAssistant -func (c *QConnect) QueryAssistant(input *QueryAssistantInput) (*QueryAssistantOutput, error) { - req, out := c.QueryAssistantRequest(input) - return out, req.Send() -} - -// QueryAssistantWithContext is the same as QueryAssistant with the addition of -// the ability to pass a context and additional request options. -// -// See QueryAssistant 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 *QConnect) QueryAssistantWithContext(ctx aws.Context, input *QueryAssistantInput, opts ...request.Option) (*QueryAssistantOutput, error) { - req, out := c.QueryAssistantRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// QueryAssistantPages iterates over the pages of a QueryAssistant operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See QueryAssistant method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a QueryAssistant operation. -// pageNum := 0 -// err := client.QueryAssistantPages(params, -// func(page *qconnect.QueryAssistantOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) QueryAssistantPages(input *QueryAssistantInput, fn func(*QueryAssistantOutput, bool) bool) error { - return c.QueryAssistantPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// QueryAssistantPagesWithContext same as QueryAssistantPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) QueryAssistantPagesWithContext(ctx aws.Context, input *QueryAssistantInput, fn func(*QueryAssistantOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *QueryAssistantInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.QueryAssistantRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*QueryAssistantOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opRemoveKnowledgeBaseTemplateUri = "RemoveKnowledgeBaseTemplateUri" - -// RemoveKnowledgeBaseTemplateUriRequest generates a "aws/request.Request" representing the -// client's request for the RemoveKnowledgeBaseTemplateUri 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 RemoveKnowledgeBaseTemplateUri for more information on using the RemoveKnowledgeBaseTemplateUri -// 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 RemoveKnowledgeBaseTemplateUriRequest method. -// req, resp := client.RemoveKnowledgeBaseTemplateUriRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/RemoveKnowledgeBaseTemplateUri -func (c *QConnect) RemoveKnowledgeBaseTemplateUriRequest(input *RemoveKnowledgeBaseTemplateUriInput) (req *request.Request, output *RemoveKnowledgeBaseTemplateUriOutput) { - op := &request.Operation{ - Name: opRemoveKnowledgeBaseTemplateUri, - HTTPMethod: "DELETE", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/templateUri", - } - - if input == nil { - input = &RemoveKnowledgeBaseTemplateUriInput{} - } - - output = &RemoveKnowledgeBaseTemplateUriOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveKnowledgeBaseTemplateUri API operation for Amazon Q Connect. -// -// Removes a URI template from a knowledge base. -// -// 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 Q Connect's -// API operation RemoveKnowledgeBaseTemplateUri for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/RemoveKnowledgeBaseTemplateUri -func (c *QConnect) RemoveKnowledgeBaseTemplateUri(input *RemoveKnowledgeBaseTemplateUriInput) (*RemoveKnowledgeBaseTemplateUriOutput, error) { - req, out := c.RemoveKnowledgeBaseTemplateUriRequest(input) - return out, req.Send() -} - -// RemoveKnowledgeBaseTemplateUriWithContext is the same as RemoveKnowledgeBaseTemplateUri with the addition of -// the ability to pass a context and additional request options. -// -// See RemoveKnowledgeBaseTemplateUri 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 *QConnect) RemoveKnowledgeBaseTemplateUriWithContext(ctx aws.Context, input *RemoveKnowledgeBaseTemplateUriInput, opts ...request.Option) (*RemoveKnowledgeBaseTemplateUriOutput, error) { - req, out := c.RemoveKnowledgeBaseTemplateUriRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSearchContent = "SearchContent" - -// SearchContentRequest generates a "aws/request.Request" representing the -// client's request for the SearchContent 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 SearchContent for more information on using the SearchContent -// 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 SearchContentRequest method. -// req, resp := client.SearchContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/SearchContent -func (c *QConnect) SearchContentRequest(input *SearchContentInput) (req *request.Request, output *SearchContentOutput) { - op := &request.Operation{ - Name: opSearchContent, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/search", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchContentInput{} - } - - output = &SearchContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchContent API operation for Amazon Q Connect. -// -// Searches for content in a specified knowledge base. Can be used to get a -// specific content resource by its name. -// -// 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 Q Connect's -// API operation SearchContent for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/SearchContent -func (c *QConnect) SearchContent(input *SearchContentInput) (*SearchContentOutput, error) { - req, out := c.SearchContentRequest(input) - return out, req.Send() -} - -// SearchContentWithContext is the same as SearchContent with the addition of -// the ability to pass a context and additional request options. -// -// See SearchContent 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 *QConnect) SearchContentWithContext(ctx aws.Context, input *SearchContentInput, opts ...request.Option) (*SearchContentOutput, error) { - req, out := c.SearchContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchContentPages iterates over the pages of a SearchContent operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchContent method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchContent operation. -// pageNum := 0 -// err := client.SearchContentPages(params, -// func(page *qconnect.SearchContentOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) SearchContentPages(input *SearchContentInput, fn func(*SearchContentOutput, bool) bool) error { - return c.SearchContentPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchContentPagesWithContext same as SearchContentPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) SearchContentPagesWithContext(ctx aws.Context, input *SearchContentInput, fn func(*SearchContentOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchContentInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchContentRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchContentOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearchQuickResponses = "SearchQuickResponses" - -// SearchQuickResponsesRequest generates a "aws/request.Request" representing the -// client's request for the SearchQuickResponses 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 SearchQuickResponses for more information on using the SearchQuickResponses -// 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 SearchQuickResponsesRequest method. -// req, resp := client.SearchQuickResponsesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/SearchQuickResponses -func (c *QConnect) SearchQuickResponsesRequest(input *SearchQuickResponsesInput) (req *request.Request, output *SearchQuickResponsesOutput) { - op := &request.Operation{ - Name: opSearchQuickResponses, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/search/quickResponses", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchQuickResponsesInput{} - } - - output = &SearchQuickResponsesOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchQuickResponses API operation for Amazon Q Connect. -// -// Searches existing Amazon Q quick responses in a Amazon Q knowledge base. -// -// 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 Q Connect's -// API operation SearchQuickResponses for usage and error information. -// -// Returned Error Types: -// -// - RequestTimeoutException -// The request reached the service more than 15 minutes after the date stamp -// on the request or more than 15 minutes after the request expiration date -// (such as for pre-signed URLs), or the date stamp on the request is more than -// 15 minutes in the future. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/SearchQuickResponses -func (c *QConnect) SearchQuickResponses(input *SearchQuickResponsesInput) (*SearchQuickResponsesOutput, error) { - req, out := c.SearchQuickResponsesRequest(input) - return out, req.Send() -} - -// SearchQuickResponsesWithContext is the same as SearchQuickResponses with the addition of -// the ability to pass a context and additional request options. -// -// See SearchQuickResponses 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 *QConnect) SearchQuickResponsesWithContext(ctx aws.Context, input *SearchQuickResponsesInput, opts ...request.Option) (*SearchQuickResponsesOutput, error) { - req, out := c.SearchQuickResponsesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchQuickResponsesPages iterates over the pages of a SearchQuickResponses operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchQuickResponses method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchQuickResponses operation. -// pageNum := 0 -// err := client.SearchQuickResponsesPages(params, -// func(page *qconnect.SearchQuickResponsesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) SearchQuickResponsesPages(input *SearchQuickResponsesInput, fn func(*SearchQuickResponsesOutput, bool) bool) error { - return c.SearchQuickResponsesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchQuickResponsesPagesWithContext same as SearchQuickResponsesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) SearchQuickResponsesPagesWithContext(ctx aws.Context, input *SearchQuickResponsesInput, fn func(*SearchQuickResponsesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchQuickResponsesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchQuickResponsesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchQuickResponsesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearchSessions = "SearchSessions" - -// SearchSessionsRequest generates a "aws/request.Request" representing the -// client's request for the SearchSessions 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 SearchSessions for more information on using the SearchSessions -// 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 SearchSessionsRequest method. -// req, resp := client.SearchSessionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/SearchSessions -func (c *QConnect) SearchSessionsRequest(input *SearchSessionsInput) (req *request.Request, output *SearchSessionsOutput) { - op := &request.Operation{ - Name: opSearchSessions, - HTTPMethod: "POST", - HTTPPath: "/assistants/{assistantId}/searchSessions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchSessionsInput{} - } - - output = &SearchSessionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchSessions API operation for Amazon Q Connect. -// -// Searches for sessions. -// -// 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 Q Connect's -// API operation SearchSessions for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/SearchSessions -func (c *QConnect) SearchSessions(input *SearchSessionsInput) (*SearchSessionsOutput, error) { - req, out := c.SearchSessionsRequest(input) - return out, req.Send() -} - -// SearchSessionsWithContext is the same as SearchSessions with the addition of -// the ability to pass a context and additional request options. -// -// See SearchSessions 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 *QConnect) SearchSessionsWithContext(ctx aws.Context, input *SearchSessionsInput, opts ...request.Option) (*SearchSessionsOutput, error) { - req, out := c.SearchSessionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchSessionsPages iterates over the pages of a SearchSessions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchSessions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchSessions operation. -// pageNum := 0 -// err := client.SearchSessionsPages(params, -// func(page *qconnect.SearchSessionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *QConnect) SearchSessionsPages(input *SearchSessionsInput, fn func(*SearchSessionsOutput, bool) bool) error { - return c.SearchSessionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchSessionsPagesWithContext same as SearchSessionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *QConnect) SearchSessionsPagesWithContext(ctx aws.Context, input *SearchSessionsInput, fn func(*SearchSessionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchSessionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchSessionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchSessionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartContentUpload = "StartContentUpload" - -// StartContentUploadRequest generates a "aws/request.Request" representing the -// client's request for the StartContentUpload 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 StartContentUpload for more information on using the StartContentUpload -// 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 StartContentUploadRequest method. -// req, resp := client.StartContentUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/StartContentUpload -func (c *QConnect) StartContentUploadRequest(input *StartContentUploadInput) (req *request.Request, output *StartContentUploadOutput) { - op := &request.Operation{ - Name: opStartContentUpload, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/upload", - } - - if input == nil { - input = &StartContentUploadInput{} - } - - output = &StartContentUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartContentUpload API operation for Amazon Q Connect. -// -// Get a URL to upload content to a knowledge base. To upload content, first -// make a PUT request to the returned URL with your file, making sure to include -// the required headers. Then use CreateContent (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_CreateContent.html) -// to finalize the content creation process or UpdateContent (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_UpdateContent.html) -// to modify an existing resource. You can only upload content to a knowledge -// base of type CUSTOM. -// -// 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 Q Connect's -// API operation StartContentUpload for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/StartContentUpload -func (c *QConnect) StartContentUpload(input *StartContentUploadInput) (*StartContentUploadOutput, error) { - req, out := c.StartContentUploadRequest(input) - return out, req.Send() -} - -// StartContentUploadWithContext is the same as StartContentUpload with the addition of -// the ability to pass a context and additional request options. -// -// See StartContentUpload 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 *QConnect) StartContentUploadWithContext(ctx aws.Context, input *StartContentUploadInput, opts ...request.Option) (*StartContentUploadOutput, error) { - req, out := c.StartContentUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartImportJob = "StartImportJob" - -// StartImportJobRequest generates a "aws/request.Request" representing the -// client's request for the StartImportJob 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 StartImportJob for more information on using the StartImportJob -// 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 StartImportJobRequest method. -// req, resp := client.StartImportJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/StartImportJob -func (c *QConnect) StartImportJobRequest(input *StartImportJobInput) (req *request.Request, output *StartImportJobOutput) { - op := &request.Operation{ - Name: opStartImportJob, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/importJobs", - } - - if input == nil { - input = &StartImportJobInput{} - } - - output = &StartImportJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartImportJob API operation for Amazon Q Connect. -// -// Start an asynchronous job to import Amazon Q resources from an uploaded source -// file. Before calling this API, use StartContentUpload (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html) -// to upload an asset that contains the resource data. -// -// - For importing Amazon Q quick responses, you need to upload a csv file -// including the quick responses. For information about how to format the -// csv file for importing quick responses, see Import quick responses (https://docs.aws.amazon.com/console/connect/quick-responses/add-data). -// -// 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 Q Connect's -// API operation StartImportJob for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - ServiceQuotaExceededException -// You've exceeded your service quota. To perform the requested action, remove -// some of the relevant resources, or use service quotas to request a service -// quota increase. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/StartImportJob -func (c *QConnect) StartImportJob(input *StartImportJobInput) (*StartImportJobOutput, error) { - req, out := c.StartImportJobRequest(input) - return out, req.Send() -} - -// StartImportJobWithContext is the same as StartImportJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartImportJob 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 *QConnect) StartImportJobWithContext(ctx aws.Context, input *StartImportJobInput, opts ...request.Option) (*StartImportJobOutput, error) { - req, out := c.StartImportJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/TagResource -func (c *QConnect) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon Q Connect. -// -// Adds the specified tags to the specified resource. -// -// 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 Q Connect's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - TooManyTagsException -// Amazon Q in Connect throws this exception if you have too many tags in your -// tag set. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/TagResource -func (c *QConnect) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *QConnect) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/UntagResource -func (c *QConnect) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon Q Connect. -// -// Removes the specified tags from the specified resource. -// -// 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 Q Connect's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/UntagResource -func (c *QConnect) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *QConnect) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateContent = "UpdateContent" - -// UpdateContentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateContent 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 UpdateContent for more information on using the UpdateContent -// 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 UpdateContentRequest method. -// req, resp := client.UpdateContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/UpdateContent -func (c *QConnect) UpdateContentRequest(input *UpdateContentInput) (req *request.Request, output *UpdateContentOutput) { - op := &request.Operation{ - Name: opUpdateContent, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/contents/{contentId}", - } - - if input == nil { - input = &UpdateContentInput{} - } - - output = &UpdateContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateContent API operation for Amazon Q Connect. -// -// Updates information about the content. -// -// 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 Q Connect's -// API operation UpdateContent for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - PreconditionFailedException -// The provided revisionId does not match, indicating the content has been modified -// since it was last read. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/UpdateContent -func (c *QConnect) UpdateContent(input *UpdateContentInput) (*UpdateContentOutput, error) { - req, out := c.UpdateContentRequest(input) - return out, req.Send() -} - -// UpdateContentWithContext is the same as UpdateContent with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateContent 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 *QConnect) UpdateContentWithContext(ctx aws.Context, input *UpdateContentInput, opts ...request.Option) (*UpdateContentOutput, error) { - req, out := c.UpdateContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateKnowledgeBaseTemplateUri = "UpdateKnowledgeBaseTemplateUri" - -// UpdateKnowledgeBaseTemplateUriRequest generates a "aws/request.Request" representing the -// client's request for the UpdateKnowledgeBaseTemplateUri 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 UpdateKnowledgeBaseTemplateUri for more information on using the UpdateKnowledgeBaseTemplateUri -// 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 UpdateKnowledgeBaseTemplateUriRequest method. -// req, resp := client.UpdateKnowledgeBaseTemplateUriRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/UpdateKnowledgeBaseTemplateUri -func (c *QConnect) UpdateKnowledgeBaseTemplateUriRequest(input *UpdateKnowledgeBaseTemplateUriInput) (req *request.Request, output *UpdateKnowledgeBaseTemplateUriOutput) { - op := &request.Operation{ - Name: opUpdateKnowledgeBaseTemplateUri, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/templateUri", - } - - if input == nil { - input = &UpdateKnowledgeBaseTemplateUriInput{} - } - - output = &UpdateKnowledgeBaseTemplateUriOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateKnowledgeBaseTemplateUri API operation for Amazon Q Connect. -// -// Updates the template URI of a knowledge base. This is only supported for -// knowledge bases of type EXTERNAL. Include a single variable in ${variable} -// format; this interpolated by Amazon Q using ingested content. For example, -// if you ingest a Salesforce article, it has an Id value, and you can set the -// template URI to https://myInstanceName.lightning.force.com/lightning/r/Knowledge__kav/*${Id}*/view. -// -// 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 Q Connect's -// API operation UpdateKnowledgeBaseTemplateUri for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/UpdateKnowledgeBaseTemplateUri -func (c *QConnect) UpdateKnowledgeBaseTemplateUri(input *UpdateKnowledgeBaseTemplateUriInput) (*UpdateKnowledgeBaseTemplateUriOutput, error) { - req, out := c.UpdateKnowledgeBaseTemplateUriRequest(input) - return out, req.Send() -} - -// UpdateKnowledgeBaseTemplateUriWithContext is the same as UpdateKnowledgeBaseTemplateUri with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateKnowledgeBaseTemplateUri 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 *QConnect) UpdateKnowledgeBaseTemplateUriWithContext(ctx aws.Context, input *UpdateKnowledgeBaseTemplateUriInput, opts ...request.Option) (*UpdateKnowledgeBaseTemplateUriOutput, error) { - req, out := c.UpdateKnowledgeBaseTemplateUriRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateQuickResponse = "UpdateQuickResponse" - -// UpdateQuickResponseRequest generates a "aws/request.Request" representing the -// client's request for the UpdateQuickResponse 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 UpdateQuickResponse for more information on using the UpdateQuickResponse -// 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 UpdateQuickResponseRequest method. -// req, resp := client.UpdateQuickResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/UpdateQuickResponse -func (c *QConnect) UpdateQuickResponseRequest(input *UpdateQuickResponseInput) (req *request.Request, output *UpdateQuickResponseOutput) { - op := &request.Operation{ - Name: opUpdateQuickResponse, - HTTPMethod: "POST", - HTTPPath: "/knowledgeBases/{knowledgeBaseId}/quickResponses/{quickResponseId}", - } - - if input == nil { - input = &UpdateQuickResponseInput{} - } - - output = &UpdateQuickResponseOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateQuickResponse API operation for Amazon Q Connect. -// -// Updates an existing Amazon Q quick response. -// -// 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 Q Connect's -// API operation UpdateQuickResponse for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -// -// - ValidationException -// The input fails to satisfy the constraints specified by a service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - PreconditionFailedException -// The provided revisionId does not match, indicating the content has been modified -// since it was last read. -// -// - ResourceNotFoundException -// The specified resource does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/UpdateQuickResponse -func (c *QConnect) UpdateQuickResponse(input *UpdateQuickResponseInput) (*UpdateQuickResponseOutput, error) { - req, out := c.UpdateQuickResponseRequest(input) - return out, req.Send() -} - -// UpdateQuickResponseWithContext is the same as UpdateQuickResponse with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateQuickResponse 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 *QConnect) UpdateQuickResponseWithContext(ctx aws.Context, input *UpdateQuickResponseInput, opts ...request.Option) (*UpdateQuickResponseOutput, error) { - req, out := c.UpdateQuickResponseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Configuration information for Amazon AppIntegrations to automatically ingest -// content. -type AppIntegrationsConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the AppIntegrations DataIntegration to - // use for ingesting content. - // - // * For Salesforce (https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/sforce_api_objects_knowledge__kav.htm), - // your AppIntegrations DataIntegration must have an ObjectConfiguration - // if objectFields is not provided, including at least Id, ArticleNumber, - // VersionNumber, Title, PublishStatus, and IsDeleted as source fields. - // - // * For ServiceNow (https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/knowledge-management-api), - // your AppIntegrations DataIntegration must have an ObjectConfiguration - // if objectFields is not provided, including at least number, short_description, - // sys_mod_count, workflow_state, and active as source fields. - // - // * For Zendesk (https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/), - // your AppIntegrations DataIntegration must have an ObjectConfiguration - // if objectFields is not provided, including at least id, title, updated_at, - // and draft as source fields. - // - // * For SharePoint (https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/sharepoint-net-server-csom-jsom-and-rest-api-index), - // your AppIntegrations DataIntegration must have a FileConfiguration, including - // only file extensions that are among docx, pdf, html, htm, and txt. - // - // * For Amazon S3 (https://aws.amazon.com/s3/), the ObjectConfiguration - // and FileConfiguration of your AppIntegrations DataIntegration must be - // null. The SourceURI of your DataIntegration must use the following format: - // s3://your_s3_bucket_name. The bucket policy of the corresponding S3 bucket - // must allow the Amazon Web Services principal app-integrations.amazonaws.com - // to perform s3:ListBucket, s3:GetObject, and s3:GetBucketLocation against - // the bucket. - // - // AppIntegrationArn is a required field - AppIntegrationArn *string `locationName:"appIntegrationArn" min:"1" type:"string" required:"true"` - - // The fields from the source that are made available to your agents in Amazon - // Q. Optional if ObjectConfiguration is included in the provided DataIntegration. - // - // * For Salesforce (https://developer.salesforce.com/docs/atlas.en-us.knowledge_dev.meta/knowledge_dev/sforce_api_objects_knowledge__kav.htm), - // you must include at least Id, ArticleNumber, VersionNumber, Title, PublishStatus, - // and IsDeleted. - // - // * For ServiceNow (https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/knowledge-management-api), - // you must include at least number, short_description, sys_mod_count, workflow_state, - // and active. - // - // * For Zendesk (https://developer.zendesk.com/api-reference/help_center/help-center-api/articles/), - // you must include at least id, title, updated_at, and draft. - // - // Make sure to include additional fields. These fields are indexed and used - // to source recommendations. - ObjectFields []*string `locationName:"objectFields" min:"1" type:"list"` -} - -// 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 AppIntegrationsConfiguration) 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 AppIntegrationsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AppIntegrationsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AppIntegrationsConfiguration"} - if s.AppIntegrationArn == nil { - invalidParams.Add(request.NewErrParamRequired("AppIntegrationArn")) - } - if s.AppIntegrationArn != nil && len(*s.AppIntegrationArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AppIntegrationArn", 1)) - } - if s.ObjectFields != nil && len(s.ObjectFields) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ObjectFields", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppIntegrationArn sets the AppIntegrationArn field's value. -func (s *AppIntegrationsConfiguration) SetAppIntegrationArn(v string) *AppIntegrationsConfiguration { - s.AppIntegrationArn = &v - return s -} - -// SetObjectFields sets the ObjectFields field's value. -func (s *AppIntegrationsConfiguration) SetObjectFields(v []*string) *AppIntegrationsConfiguration { - s.ObjectFields = v - return s -} - -// Information about the assistant association. -type AssistantAssociationData struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q assistant. - // - // AssistantArn is a required field - AssistantArn *string `locationName:"assistantArn" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the assistant association. - // - // AssistantAssociationArn is a required field - AssistantAssociationArn *string `locationName:"assistantAssociationArn" type:"string" required:"true"` - - // The identifier of the assistant association. - // - // AssistantAssociationId is a required field - AssistantAssociationId *string `locationName:"assistantAssociationId" type:"string" required:"true"` - - // The identifier of the Amazon Q assistant. - // - // AssistantId is a required field - AssistantId *string `locationName:"assistantId" type:"string" required:"true"` - - // A union type that currently has a single argument, the knowledge base ID. - // - // AssociationData is a required field - AssociationData *AssistantAssociationOutputData `locationName:"associationData" type:"structure" required:"true"` - - // The type of association. - // - // AssociationType is a required field - AssociationType *string `locationName:"associationType" type:"string" required:"true" enum:"AssociationType"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 AssistantAssociationData) 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 AssistantAssociationData) GoString() string { - return s.String() -} - -// SetAssistantArn sets the AssistantArn field's value. -func (s *AssistantAssociationData) SetAssistantArn(v string) *AssistantAssociationData { - s.AssistantArn = &v - return s -} - -// SetAssistantAssociationArn sets the AssistantAssociationArn field's value. -func (s *AssistantAssociationData) SetAssistantAssociationArn(v string) *AssistantAssociationData { - s.AssistantAssociationArn = &v - return s -} - -// SetAssistantAssociationId sets the AssistantAssociationId field's value. -func (s *AssistantAssociationData) SetAssistantAssociationId(v string) *AssistantAssociationData { - s.AssistantAssociationId = &v - return s -} - -// SetAssistantId sets the AssistantId field's value. -func (s *AssistantAssociationData) SetAssistantId(v string) *AssistantAssociationData { - s.AssistantId = &v - return s -} - -// SetAssociationData sets the AssociationData field's value. -func (s *AssistantAssociationData) SetAssociationData(v *AssistantAssociationOutputData) *AssistantAssociationData { - s.AssociationData = v - return s -} - -// SetAssociationType sets the AssociationType field's value. -func (s *AssistantAssociationData) SetAssociationType(v string) *AssistantAssociationData { - s.AssociationType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AssistantAssociationData) SetTags(v map[string]*string) *AssistantAssociationData { - s.Tags = v - return s -} - -// The data that is input into Amazon Q as a result of the assistant association. -type AssistantAssociationInputData struct { - _ struct{} `type:"structure"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - KnowledgeBaseId *string `locationName:"knowledgeBaseId" 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 AssistantAssociationInputData) 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 AssistantAssociationInputData) GoString() string { - return s.String() -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *AssistantAssociationInputData) SetKnowledgeBaseId(v string) *AssistantAssociationInputData { - s.KnowledgeBaseId = &v - return s -} - -// The data that is output as a result of the assistant association. -type AssistantAssociationOutputData struct { - _ struct{} `type:"structure"` - - // The knowledge base where output data is sent. - KnowledgeBaseAssociation *KnowledgeBaseAssociationData `locationName:"knowledgeBaseAssociation" 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 AssistantAssociationOutputData) 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 AssistantAssociationOutputData) GoString() string { - return s.String() -} - -// SetKnowledgeBaseAssociation sets the KnowledgeBaseAssociation field's value. -func (s *AssistantAssociationOutputData) SetKnowledgeBaseAssociation(v *KnowledgeBaseAssociationData) *AssistantAssociationOutputData { - s.KnowledgeBaseAssociation = v - return s -} - -// Summary information about the assistant association. -type AssistantAssociationSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q assistant. - // - // AssistantArn is a required field - AssistantArn *string `locationName:"assistantArn" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the assistant association. - // - // AssistantAssociationArn is a required field - AssistantAssociationArn *string `locationName:"assistantAssociationArn" type:"string" required:"true"` - - // The identifier of the assistant association. - // - // AssistantAssociationId is a required field - AssistantAssociationId *string `locationName:"assistantAssociationId" type:"string" required:"true"` - - // The identifier of the Amazon Q assistant. - // - // AssistantId is a required field - AssistantId *string `locationName:"assistantId" type:"string" required:"true"` - - // The association data. - // - // AssociationData is a required field - AssociationData *AssistantAssociationOutputData `locationName:"associationData" type:"structure" required:"true"` - - // The type of association. - // - // AssociationType is a required field - AssociationType *string `locationName:"associationType" type:"string" required:"true" enum:"AssociationType"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 AssistantAssociationSummary) 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 AssistantAssociationSummary) GoString() string { - return s.String() -} - -// SetAssistantArn sets the AssistantArn field's value. -func (s *AssistantAssociationSummary) SetAssistantArn(v string) *AssistantAssociationSummary { - s.AssistantArn = &v - return s -} - -// SetAssistantAssociationArn sets the AssistantAssociationArn field's value. -func (s *AssistantAssociationSummary) SetAssistantAssociationArn(v string) *AssistantAssociationSummary { - s.AssistantAssociationArn = &v - return s -} - -// SetAssistantAssociationId sets the AssistantAssociationId field's value. -func (s *AssistantAssociationSummary) SetAssistantAssociationId(v string) *AssistantAssociationSummary { - s.AssistantAssociationId = &v - return s -} - -// SetAssistantId sets the AssistantId field's value. -func (s *AssistantAssociationSummary) SetAssistantId(v string) *AssistantAssociationSummary { - s.AssistantId = &v - return s -} - -// SetAssociationData sets the AssociationData field's value. -func (s *AssistantAssociationSummary) SetAssociationData(v *AssistantAssociationOutputData) *AssistantAssociationSummary { - s.AssociationData = v - return s -} - -// SetAssociationType sets the AssociationType field's value. -func (s *AssistantAssociationSummary) SetAssociationType(v string) *AssistantAssociationSummary { - s.AssociationType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AssistantAssociationSummary) SetTags(v map[string]*string) *AssistantAssociationSummary { - s.Tags = v - return s -} - -// The capability configuration for a Amazon Q assistant. -type AssistantCapabilityConfiguration struct { - _ struct{} `type:"structure"` - - // The type of Amazon Q assistant capability. - Type *string `locationName:"type" type:"string" enum:"AssistantCapabilityType"` -} - -// 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 AssistantCapabilityConfiguration) 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 AssistantCapabilityConfiguration) GoString() string { - return s.String() -} - -// SetType sets the Type field's value. -func (s *AssistantCapabilityConfiguration) SetType(v string) *AssistantCapabilityConfiguration { - s.Type = &v - return s -} - -// The assistant data. -type AssistantData struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q assistant. - // - // AssistantArn is a required field - AssistantArn *string `locationName:"assistantArn" type:"string" required:"true"` - - // The identifier of the Amazon Q assistant. - // - // AssistantId is a required field - AssistantId *string `locationName:"assistantId" type:"string" required:"true"` - - // The configuration information for the Amazon Q assistant capability. - CapabilityConfiguration *AssistantCapabilityConfiguration `locationName:"capabilityConfiguration" type:"structure"` - - // The description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The configuration information for the Amazon Q assistant integration. - IntegrationConfiguration *AssistantIntegrationConfiguration `locationName:"integrationConfiguration" type:"structure"` - - // The name. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The configuration information for the customer managed key used for encryption. - // - // This KMS key must have a policy that allows kms:CreateGrant, kms:DescribeKey, - // kms:Decrypt, and kms:GenerateDataKey* permissions to the IAM identity using - // the key to invoke Amazon Q. To use Amazon Q with chat, the key policy must - // also allow kms:Decrypt, kms:GenerateDataKey*, and kms:DescribeKey permissions - // to the connect.amazonaws.com service principal. - // - // For more information about setting up a customer managed key for Amazon Q, - // see Enable Amazon Q in Connect for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html). - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // The status of the assistant. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"AssistantStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The type of assistant. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AssistantType"` -} - -// 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 AssistantData) 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 AssistantData) GoString() string { - return s.String() -} - -// SetAssistantArn sets the AssistantArn field's value. -func (s *AssistantData) SetAssistantArn(v string) *AssistantData { - s.AssistantArn = &v - return s -} - -// SetAssistantId sets the AssistantId field's value. -func (s *AssistantData) SetAssistantId(v string) *AssistantData { - s.AssistantId = &v - return s -} - -// SetCapabilityConfiguration sets the CapabilityConfiguration field's value. -func (s *AssistantData) SetCapabilityConfiguration(v *AssistantCapabilityConfiguration) *AssistantData { - s.CapabilityConfiguration = v - return s -} - -// SetDescription sets the Description field's value. -func (s *AssistantData) SetDescription(v string) *AssistantData { - s.Description = &v - return s -} - -// SetIntegrationConfiguration sets the IntegrationConfiguration field's value. -func (s *AssistantData) SetIntegrationConfiguration(v *AssistantIntegrationConfiguration) *AssistantData { - s.IntegrationConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *AssistantData) SetName(v string) *AssistantData { - s.Name = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *AssistantData) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *AssistantData { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetStatus sets the Status field's value. -func (s *AssistantData) SetStatus(v string) *AssistantData { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AssistantData) SetTags(v map[string]*string) *AssistantData { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *AssistantData) SetType(v string) *AssistantData { - s.Type = &v - return s -} - -// The configuration information for the Amazon Q assistant integration. -type AssistantIntegrationConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the integrated Amazon SNS topic used for - // streaming chat messages. - TopicIntegrationArn *string `locationName:"topicIntegrationArn" min:"1" 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 AssistantIntegrationConfiguration) 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 AssistantIntegrationConfiguration) GoString() string { - return s.String() -} - -// SetTopicIntegrationArn sets the TopicIntegrationArn field's value. -func (s *AssistantIntegrationConfiguration) SetTopicIntegrationArn(v string) *AssistantIntegrationConfiguration { - s.TopicIntegrationArn = &v - return s -} - -// Summary information about the assistant. -type AssistantSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q assistant. - // - // AssistantArn is a required field - AssistantArn *string `locationName:"assistantArn" type:"string" required:"true"` - - // The identifier of the Amazon Q assistant. - // - // AssistantId is a required field - AssistantId *string `locationName:"assistantId" type:"string" required:"true"` - - // The configuration information for the Amazon Q assistant capability. - CapabilityConfiguration *AssistantCapabilityConfiguration `locationName:"capabilityConfiguration" type:"structure"` - - // The description of the assistant. - Description *string `locationName:"description" min:"1" type:"string"` - - // The configuration information for the Amazon Q assistant integration. - IntegrationConfiguration *AssistantIntegrationConfiguration `locationName:"integrationConfiguration" type:"structure"` - - // The name of the assistant. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The configuration information for the customer managed key used for encryption. - // - // This KMS key must have a policy that allows kms:CreateGrant, kms:DescribeKey, - // kms:Decrypt, and kms:GenerateDataKey* permissions to the IAM identity using - // the key to invoke Amazon Q. To use Amazon Q with chat, the key policy must - // also allow kms:Decrypt, kms:GenerateDataKey*, and kms:DescribeKey permissions - // to the connect.amazonaws.com service principal. - // - // For more information about setting up a customer managed key for Amazon Q, - // see Enable Amazon Q in Connect for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html). - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // The status of the assistant. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"AssistantStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The type of the assistant. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AssistantType"` -} - -// 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 AssistantSummary) 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 AssistantSummary) GoString() string { - return s.String() -} - -// SetAssistantArn sets the AssistantArn field's value. -func (s *AssistantSummary) SetAssistantArn(v string) *AssistantSummary { - s.AssistantArn = &v - return s -} - -// SetAssistantId sets the AssistantId field's value. -func (s *AssistantSummary) SetAssistantId(v string) *AssistantSummary { - s.AssistantId = &v - return s -} - -// SetCapabilityConfiguration sets the CapabilityConfiguration field's value. -func (s *AssistantSummary) SetCapabilityConfiguration(v *AssistantCapabilityConfiguration) *AssistantSummary { - s.CapabilityConfiguration = v - return s -} - -// SetDescription sets the Description field's value. -func (s *AssistantSummary) SetDescription(v string) *AssistantSummary { - s.Description = &v - return s -} - -// SetIntegrationConfiguration sets the IntegrationConfiguration field's value. -func (s *AssistantSummary) SetIntegrationConfiguration(v *AssistantIntegrationConfiguration) *AssistantSummary { - s.IntegrationConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *AssistantSummary) SetName(v string) *AssistantSummary { - s.Name = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *AssistantSummary) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *AssistantSummary { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetStatus sets the Status field's value. -func (s *AssistantSummary) SetStatus(v string) *AssistantSummary { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AssistantSummary) SetTags(v map[string]*string) *AssistantSummary { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *AssistantSummary) SetType(v string) *AssistantSummary { - s.Type = &v - return s -} - -// The configuration information of the external data source. -type Configuration struct { - _ struct{} `type:"structure"` - - // The configuration information of the Amazon Connect data source. - ConnectConfiguration *ConnectConfiguration `locationName:"connectConfiguration" 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 Configuration) 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 Configuration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Configuration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Configuration"} - if s.ConnectConfiguration != nil { - if err := s.ConnectConfiguration.Validate(); err != nil { - invalidParams.AddNested("ConnectConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConnectConfiguration sets the ConnectConfiguration field's value. -func (s *Configuration) SetConnectConfiguration(v *ConnectConfiguration) *Configuration { - s.ConnectConfiguration = v - return s -} - -// The request could not be processed because of conflict in the current state -// of the resource. For example, if you're using a Create API (such as CreateAssistant) -// that accepts name, a conflicting resource (usually with the same name) is -// being created or mutated. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The configuration information of the Amazon Connect data source. -type ConnectConfiguration struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Connect instance. You can find the instanceId - // in the ARN of the instance. - InstanceId *string `locationName:"instanceId" min:"1" 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 ConnectConfiguration) 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 ConnectConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConnectConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConnectConfiguration"} - if s.InstanceId != nil && len(*s.InstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ConnectConfiguration) SetInstanceId(v string) *ConnectConfiguration { - s.InstanceId = &v - return s -} - -// Information about the content. -type ContentData struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the content. - // - // ContentArn is a required field - ContentArn *string `locationName:"contentArn" type:"string" required:"true"` - - // The identifier of the content. - // - // ContentId is a required field - ContentId *string `locationName:"contentId" type:"string" required:"true"` - - // The media type of the content. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The URI of the content. - LinkOutUri *string `locationName:"linkOutUri" min:"1" type:"string"` - - // A key/value map to store attributes without affecting tagging or recommendations. - // For example, when synchronizing data between an external system and Amazon - // Q, you can store an external version identifier as metadata to utilize for - // determining drift. - // - // Metadata is a required field - Metadata map[string]*string `locationName:"metadata" type:"map" required:"true"` - - // The name of the content. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The identifier of the content revision. - // - // RevisionId is a required field - RevisionId *string `locationName:"revisionId" min:"1" type:"string" required:"true"` - - // The status of the content. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ContentStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The title of the content. - // - // Title is a required field - Title *string `locationName:"title" min:"1" type:"string" required:"true"` - - // The URL of the content. - // - // Url is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ContentData's - // String and GoString methods. - // - // Url is a required field - Url *string `locationName:"url" min:"1" type:"string" required:"true" sensitive:"true"` - - // The expiration time of the URL as an epoch timestamp. - // - // UrlExpiry is a required field - UrlExpiry *time.Time `locationName:"urlExpiry" type:"timestamp" timestampFormat:"unixTimestamp" 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 ContentData) 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 ContentData) GoString() string { - return s.String() -} - -// SetContentArn sets the ContentArn field's value. -func (s *ContentData) SetContentArn(v string) *ContentData { - s.ContentArn = &v - return s -} - -// SetContentId sets the ContentId field's value. -func (s *ContentData) SetContentId(v string) *ContentData { - s.ContentId = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *ContentData) SetContentType(v string) *ContentData { - s.ContentType = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *ContentData) SetKnowledgeBaseArn(v string) *ContentData { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ContentData) SetKnowledgeBaseId(v string) *ContentData { - s.KnowledgeBaseId = &v - return s -} - -// SetLinkOutUri sets the LinkOutUri field's value. -func (s *ContentData) SetLinkOutUri(v string) *ContentData { - s.LinkOutUri = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ContentData) SetMetadata(v map[string]*string) *ContentData { - s.Metadata = v - return s -} - -// SetName sets the Name field's value. -func (s *ContentData) SetName(v string) *ContentData { - s.Name = &v - return s -} - -// SetRevisionId sets the RevisionId field's value. -func (s *ContentData) SetRevisionId(v string) *ContentData { - s.RevisionId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ContentData) SetStatus(v string) *ContentData { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ContentData) SetTags(v map[string]*string) *ContentData { - s.Tags = v - return s -} - -// SetTitle sets the Title field's value. -func (s *ContentData) SetTitle(v string) *ContentData { - s.Title = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *ContentData) SetUrl(v string) *ContentData { - s.Url = &v - return s -} - -// SetUrlExpiry sets the UrlExpiry field's value. -func (s *ContentData) SetUrlExpiry(v time.Time) *ContentData { - s.UrlExpiry = &v - return s -} - -// Details about the content data. -type ContentDataDetails struct { - _ struct{} `type:"structure"` - - // Details about the content ranking data. - // - // RankingData is a required field - RankingData *RankingData `locationName:"rankingData" type:"structure" required:"true"` - - // Details about the content text data. - // - // TextData is a required field - TextData *TextData `locationName:"textData" type:"structure" 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 ContentDataDetails) 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 ContentDataDetails) GoString() string { - return s.String() -} - -// SetRankingData sets the RankingData field's value. -func (s *ContentDataDetails) SetRankingData(v *RankingData) *ContentDataDetails { - s.RankingData = v - return s -} - -// SetTextData sets the TextData field's value. -func (s *ContentDataDetails) SetTextData(v *TextData) *ContentDataDetails { - s.TextData = v - return s -} - -// Reference information about the content. -type ContentReference struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the content. - ContentArn *string `locationName:"contentArn" type:"string"` - - // The identifier of the content. - ContentId *string `locationName:"contentId" type:"string"` - - // The Amazon Resource Name (ARN) of the knowledge base. - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - KnowledgeBaseId *string `locationName:"knowledgeBaseId" 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 ContentReference) 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 ContentReference) GoString() string { - return s.String() -} - -// SetContentArn sets the ContentArn field's value. -func (s *ContentReference) SetContentArn(v string) *ContentReference { - s.ContentArn = &v - return s -} - -// SetContentId sets the ContentId field's value. -func (s *ContentReference) SetContentId(v string) *ContentReference { - s.ContentId = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *ContentReference) SetKnowledgeBaseArn(v string) *ContentReference { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ContentReference) SetKnowledgeBaseId(v string) *ContentReference { - s.KnowledgeBaseId = &v - return s -} - -// Summary information about the content. -type ContentSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the content. - // - // ContentArn is a required field - ContentArn *string `locationName:"contentArn" type:"string" required:"true"` - - // The identifier of the content. - // - // ContentId is a required field - ContentId *string `locationName:"contentId" type:"string" required:"true"` - - // The media type of the content. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // A key/value map to store attributes without affecting tagging or recommendations. - // For example, when synchronizing data between an external system and Amazon - // Q, you can store an external version identifier as metadata to utilize for - // determining drift. - // - // Metadata is a required field - Metadata map[string]*string `locationName:"metadata" type:"map" required:"true"` - - // The name of the content. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The identifier of the revision of the content. - // - // RevisionId is a required field - RevisionId *string `locationName:"revisionId" min:"1" type:"string" required:"true"` - - // The status of the content. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ContentStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The title of the content. - // - // Title is a required field - Title *string `locationName:"title" min:"1" 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 ContentSummary) 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 ContentSummary) GoString() string { - return s.String() -} - -// SetContentArn sets the ContentArn field's value. -func (s *ContentSummary) SetContentArn(v string) *ContentSummary { - s.ContentArn = &v - return s -} - -// SetContentId sets the ContentId field's value. -func (s *ContentSummary) SetContentId(v string) *ContentSummary { - s.ContentId = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *ContentSummary) SetContentType(v string) *ContentSummary { - s.ContentType = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *ContentSummary) SetKnowledgeBaseArn(v string) *ContentSummary { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ContentSummary) SetKnowledgeBaseId(v string) *ContentSummary { - s.KnowledgeBaseId = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ContentSummary) SetMetadata(v map[string]*string) *ContentSummary { - s.Metadata = v - return s -} - -// SetName sets the Name field's value. -func (s *ContentSummary) SetName(v string) *ContentSummary { - s.Name = &v - return s -} - -// SetRevisionId sets the RevisionId field's value. -func (s *ContentSummary) SetRevisionId(v string) *ContentSummary { - s.RevisionId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ContentSummary) SetStatus(v string) *ContentSummary { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ContentSummary) SetTags(v map[string]*string) *ContentSummary { - s.Tags = v - return s -} - -// SetTitle sets the Title field's value. -func (s *ContentSummary) SetTitle(v string) *ContentSummary { - s.Title = &v - return s -} - -type CreateAssistantAssociationInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" type:"string" required:"true"` - - // The identifier of the associated resource. - // - // Association is a required field - Association *AssistantAssociationInputData `locationName:"association" type:"structure" required:"true"` - - // The type of association. - // - // AssociationType is a required field - AssociationType *string `locationName:"associationType" type:"string" required:"true" enum:"AssociationType"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If not provided, the Amazon Web Services SDK populates this - // field. For more information about idempotency, see Making retries safe with - // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/). - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateAssistantAssociationInput) 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 CreateAssistantAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssistantAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssistantAssociationInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - if s.Association == nil { - invalidParams.Add(request.NewErrParamRequired("Association")) - } - if s.AssociationType == nil { - invalidParams.Add(request.NewErrParamRequired("AssociationType")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *CreateAssistantAssociationInput) SetAssistantId(v string) *CreateAssistantAssociationInput { - s.AssistantId = &v - return s -} - -// SetAssociation sets the Association field's value. -func (s *CreateAssistantAssociationInput) SetAssociation(v *AssistantAssociationInputData) *CreateAssistantAssociationInput { - s.Association = v - return s -} - -// SetAssociationType sets the AssociationType field's value. -func (s *CreateAssistantAssociationInput) SetAssociationType(v string) *CreateAssistantAssociationInput { - s.AssociationType = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAssistantAssociationInput) SetClientToken(v string) *CreateAssistantAssociationInput { - s.ClientToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAssistantAssociationInput) SetTags(v map[string]*string) *CreateAssistantAssociationInput { - s.Tags = v - return s -} - -type CreateAssistantAssociationOutput struct { - _ struct{} `type:"structure"` - - // The assistant association. - AssistantAssociation *AssistantAssociationData `locationName:"assistantAssociation" 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 CreateAssistantAssociationOutput) 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 CreateAssistantAssociationOutput) GoString() string { - return s.String() -} - -// SetAssistantAssociation sets the AssistantAssociation field's value. -func (s *CreateAssistantAssociationOutput) SetAssistantAssociation(v *AssistantAssociationData) *CreateAssistantAssociationOutput { - s.AssistantAssociation = v - return s -} - -type CreateAssistantInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If not provided, the Amazon Web Services SDK populates this - // field. For more information about idempotency, see Making retries safe with - // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/). - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The description of the assistant. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the assistant. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The configuration information for the customer managed key used for encryption. - // - // The customer managed key must have a policy that allows kms:CreateGrant, - // kms:DescribeKey, kms:Decrypt, and kms:GenerateDataKey* permissions to the - // IAM identity using the key to invoke Amazon Q. To use Amazon Q with chat, - // the key policy must also allow kms:Decrypt, kms:GenerateDataKey*, and kms:DescribeKey - // permissions to the connect.amazonaws.com service principal. - // - // For more information about setting up a customer managed key for Amazon Q, - // see Enable Amazon Q in Connect for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html). - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The type of assistant. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"AssistantType"` -} - -// 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 CreateAssistantInput) 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 CreateAssistantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAssistantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAssistantInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.ServerSideEncryptionConfiguration != nil { - if err := s.ServerSideEncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAssistantInput) SetClientToken(v string) *CreateAssistantInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateAssistantInput) SetDescription(v string) *CreateAssistantInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateAssistantInput) SetName(v string) *CreateAssistantInput { - s.Name = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *CreateAssistantInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *CreateAssistantInput { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAssistantInput) SetTags(v map[string]*string) *CreateAssistantInput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateAssistantInput) SetType(v string) *CreateAssistantInput { - s.Type = &v - return s -} - -type CreateAssistantOutput struct { - _ struct{} `type:"structure"` - - // Information about the assistant. - Assistant *AssistantData `locationName:"assistant" 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 CreateAssistantOutput) 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 CreateAssistantOutput) GoString() string { - return s.String() -} - -// SetAssistant sets the Assistant field's value. -func (s *CreateAssistantOutput) SetAssistant(v *AssistantData) *CreateAssistantOutput { - s.Assistant = v - return s -} - -type CreateContentInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If not provided, the Amazon Web Services SDK populates this - // field. For more information about idempotency, see Making retries safe with - // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/). - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // A key/value map to store attributes without affecting tagging or recommendations. - // For example, when synchronizing data between an external system and Amazon - // Q, you can store an external version identifier as metadata to utilize for - // determining drift. - Metadata map[string]*string `locationName:"metadata" type:"map"` - - // The name of the content. Each piece of content in a knowledge base must have - // a unique name. You can retrieve a piece of content using only its knowledge - // base and its name with the SearchContent (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_SearchContent.html) - // API. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The URI you want to use for the article. If the knowledge base has a templateUri, - // setting this argument overrides it for this piece of content. - OverrideLinkOutUri *string `locationName:"overrideLinkOutUri" min:"1" type:"string"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The title of the content. If not set, the title is equal to the name. - Title *string `locationName:"title" min:"1" type:"string"` - - // A pointer to the uploaded asset. This value is returned by StartContentUpload - // (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_StartContentUpload.html). - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" min:"1" 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 CreateContentInput) 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 CreateContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateContentInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.OverrideLinkOutUri != nil && len(*s.OverrideLinkOutUri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OverrideLinkOutUri", 1)) - } - if s.Title != nil && len(*s.Title) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Title", 1)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.UploadId != nil && len(*s.UploadId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateContentInput) SetClientToken(v string) *CreateContentInput { - s.ClientToken = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *CreateContentInput) SetKnowledgeBaseId(v string) *CreateContentInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *CreateContentInput) SetMetadata(v map[string]*string) *CreateContentInput { - s.Metadata = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateContentInput) SetName(v string) *CreateContentInput { - s.Name = &v - return s -} - -// SetOverrideLinkOutUri sets the OverrideLinkOutUri field's value. -func (s *CreateContentInput) SetOverrideLinkOutUri(v string) *CreateContentInput { - s.OverrideLinkOutUri = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateContentInput) SetTags(v map[string]*string) *CreateContentInput { - s.Tags = v - return s -} - -// SetTitle sets the Title field's value. -func (s *CreateContentInput) SetTitle(v string) *CreateContentInput { - s.Title = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CreateContentInput) SetUploadId(v string) *CreateContentInput { - s.UploadId = &v - return s -} - -type CreateContentOutput struct { - _ struct{} `type:"structure"` - - // The content. - Content *ContentData `locationName:"content" 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 CreateContentOutput) 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 CreateContentOutput) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *CreateContentOutput) SetContent(v *ContentData) *CreateContentOutput { - s.Content = v - return s -} - -type CreateKnowledgeBaseInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If not provided, the Amazon Web Services SDK populates this - // field. For more information about idempotency, see Making retries safe with - // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/). - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The type of knowledge base. Only CUSTOM knowledge bases allow you to upload - // your own content. EXTERNAL knowledge bases support integrations with third-party - // systems whose content is synchronized automatically. - // - // KnowledgeBaseType is a required field - KnowledgeBaseType *string `locationName:"knowledgeBaseType" type:"string" required:"true" enum:"KnowledgeBaseType"` - - // The name of the knowledge base. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Information about how to render the content. - RenderingConfiguration *RenderingConfiguration `locationName:"renderingConfiguration" type:"structure"` - - // The configuration information for the customer managed key used for encryption. - // - // This KMS key must have a policy that allows kms:CreateGrant, kms:DescribeKey, - // kms:Decrypt, and kms:GenerateDataKey* permissions to the IAM identity using - // the key to invoke Amazon Q. - // - // For more information about setting up a customer managed key for Amazon Q, - // see Enable Amazon Q in Connect for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html). - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // The source of the knowledge base content. Only set this argument for EXTERNAL - // knowledge bases. - SourceConfiguration *SourceConfiguration `locationName:"sourceConfiguration" type:"structure"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateKnowledgeBaseInput) 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 CreateKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateKnowledgeBaseInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseType == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseType")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RenderingConfiguration != nil { - if err := s.RenderingConfiguration.Validate(); err != nil { - invalidParams.AddNested("RenderingConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ServerSideEncryptionConfiguration != nil { - if err := s.ServerSideEncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.SourceConfiguration != nil { - if err := s.SourceConfiguration.Validate(); err != nil { - invalidParams.AddNested("SourceConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateKnowledgeBaseInput) SetClientToken(v string) *CreateKnowledgeBaseInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateKnowledgeBaseInput) SetDescription(v string) *CreateKnowledgeBaseInput { - s.Description = &v - return s -} - -// SetKnowledgeBaseType sets the KnowledgeBaseType field's value. -func (s *CreateKnowledgeBaseInput) SetKnowledgeBaseType(v string) *CreateKnowledgeBaseInput { - s.KnowledgeBaseType = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateKnowledgeBaseInput) SetName(v string) *CreateKnowledgeBaseInput { - s.Name = &v - return s -} - -// SetRenderingConfiguration sets the RenderingConfiguration field's value. -func (s *CreateKnowledgeBaseInput) SetRenderingConfiguration(v *RenderingConfiguration) *CreateKnowledgeBaseInput { - s.RenderingConfiguration = v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *CreateKnowledgeBaseInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *CreateKnowledgeBaseInput { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetSourceConfiguration sets the SourceConfiguration field's value. -func (s *CreateKnowledgeBaseInput) SetSourceConfiguration(v *SourceConfiguration) *CreateKnowledgeBaseInput { - s.SourceConfiguration = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateKnowledgeBaseInput) SetTags(v map[string]*string) *CreateKnowledgeBaseInput { - s.Tags = v - return s -} - -type CreateKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // The knowledge base. - KnowledgeBase *KnowledgeBaseData `locationName:"knowledgeBase" 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 CreateKnowledgeBaseOutput) 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 CreateKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBase sets the KnowledgeBase field's value. -func (s *CreateKnowledgeBaseOutput) SetKnowledgeBase(v *KnowledgeBaseData) *CreateKnowledgeBaseOutput { - s.KnowledgeBase = v - return s -} - -type CreateQuickResponseInput struct { - _ struct{} `type:"structure"` - - // The Amazon Connect channels this quick response applies to. - Channels []*string `locationName:"channels" type:"list"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If not provided, the Amazon Web Services SDK populates this - // field. For more information about idempotency, see Making retries safe with - // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/). - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The content of the quick response. - // - // Content is a required field - Content *QuickResponseDataProvider `locationName:"content" type:"structure" required:"true"` - - // The media type of the quick response content. - // - // * Use application/x.quickresponse;format=plain for a quick response written - // in plain text. - // - // * Use application/x.quickresponse;format=markdown for a quick response - // written in richtext. - ContentType *string `locationName:"contentType" type:"string"` - - // The description of the quick response. - Description *string `locationName:"description" min:"1" type:"string"` - - // The configuration information of the user groups that the quick response - // is accessible to. - GroupingConfiguration *GroupingConfiguration `locationName:"groupingConfiguration" type:"structure"` - - // Whether the quick response is active. - IsActive *bool `locationName:"isActive" type:"boolean"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The language code value for the language in which the quick response is written. - // The supported language codes include de_DE, en_US, es_ES, fr_FR, id_ID, it_IT, - // ja_JP, ko_KR, pt_BR, zh_CN, zh_TW - Language *string `locationName:"language" min:"2" type:"string"` - - // The name of the quick response. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The shortcut key of the quick response. The value should be unique across - // the knowledge base. - ShortcutKey *string `locationName:"shortcutKey" min:"1" type:"string"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateQuickResponseInput) 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 CreateQuickResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateQuickResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateQuickResponseInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.Language != nil && len(*s.Language) < 2 { - invalidParams.Add(request.NewErrParamMinLen("Language", 2)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ShortcutKey != nil && len(*s.ShortcutKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShortcutKey", 1)) - } - if s.Content != nil { - if err := s.Content.Validate(); err != nil { - invalidParams.AddNested("Content", err.(request.ErrInvalidParams)) - } - } - if s.GroupingConfiguration != nil { - if err := s.GroupingConfiguration.Validate(); err != nil { - invalidParams.AddNested("GroupingConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannels sets the Channels field's value. -func (s *CreateQuickResponseInput) SetChannels(v []*string) *CreateQuickResponseInput { - s.Channels = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateQuickResponseInput) SetClientToken(v string) *CreateQuickResponseInput { - s.ClientToken = &v - return s -} - -// SetContent sets the Content field's value. -func (s *CreateQuickResponseInput) SetContent(v *QuickResponseDataProvider) *CreateQuickResponseInput { - s.Content = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *CreateQuickResponseInput) SetContentType(v string) *CreateQuickResponseInput { - s.ContentType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateQuickResponseInput) SetDescription(v string) *CreateQuickResponseInput { - s.Description = &v - return s -} - -// SetGroupingConfiguration sets the GroupingConfiguration field's value. -func (s *CreateQuickResponseInput) SetGroupingConfiguration(v *GroupingConfiguration) *CreateQuickResponseInput { - s.GroupingConfiguration = v - return s -} - -// SetIsActive sets the IsActive field's value. -func (s *CreateQuickResponseInput) SetIsActive(v bool) *CreateQuickResponseInput { - s.IsActive = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *CreateQuickResponseInput) SetKnowledgeBaseId(v string) *CreateQuickResponseInput { - s.KnowledgeBaseId = &v - return s -} - -// SetLanguage sets the Language field's value. -func (s *CreateQuickResponseInput) SetLanguage(v string) *CreateQuickResponseInput { - s.Language = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateQuickResponseInput) SetName(v string) *CreateQuickResponseInput { - s.Name = &v - return s -} - -// SetShortcutKey sets the ShortcutKey field's value. -func (s *CreateQuickResponseInput) SetShortcutKey(v string) *CreateQuickResponseInput { - s.ShortcutKey = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateQuickResponseInput) SetTags(v map[string]*string) *CreateQuickResponseInput { - s.Tags = v - return s -} - -type CreateQuickResponseOutput struct { - _ struct{} `type:"structure"` - - // The quick response. - QuickResponse *QuickResponseData `locationName:"quickResponse" 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 CreateQuickResponseOutput) 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 CreateQuickResponseOutput) GoString() string { - return s.String() -} - -// SetQuickResponse sets the QuickResponse field's value. -func (s *CreateQuickResponseOutput) SetQuickResponse(v *QuickResponseData) *CreateQuickResponseOutput { - s.QuickResponse = v - return s -} - -type CreateSessionInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" type:"string" required:"true"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If not provided, the Amazon Web Services SDK populates this - // field. For more information about idempotency, see Making retries safe with - // idempotent APIs (https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/). - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The name of the session. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateSessionInput) 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 CreateSessionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSessionInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *CreateSessionInput) SetAssistantId(v string) *CreateSessionInput { - s.AssistantId = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateSessionInput) SetClientToken(v string) *CreateSessionInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateSessionInput) SetDescription(v string) *CreateSessionInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSessionInput) SetName(v string) *CreateSessionInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSessionInput) SetTags(v map[string]*string) *CreateSessionInput { - s.Tags = v - return s -} - -type CreateSessionOutput struct { - _ struct{} `type:"structure"` - - // The session. - Session *SessionData `locationName:"session" 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 CreateSessionOutput) 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 CreateSessionOutput) GoString() string { - return s.String() -} - -// SetSession sets the Session field's value. -func (s *CreateSessionOutput) SetSession(v *SessionData) *CreateSessionOutput { - s.Session = v - return s -} - -// Details about the data. -type DataDetails struct { - _ struct{} `type:"structure"` - - // Details about the content data. - ContentData *ContentDataDetails `locationName:"contentData" type:"structure"` - - // Details about the generative data. - GenerativeData *GenerativeDataDetails `locationName:"generativeData" type:"structure"` - - // Details about the content data. - SourceContentData *SourceContentDataDetails `locationName:"sourceContentData" 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 DataDetails) 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 DataDetails) GoString() string { - return s.String() -} - -// SetContentData sets the ContentData field's value. -func (s *DataDetails) SetContentData(v *ContentDataDetails) *DataDetails { - s.ContentData = v - return s -} - -// SetGenerativeData sets the GenerativeData field's value. -func (s *DataDetails) SetGenerativeData(v *GenerativeDataDetails) *DataDetails { - s.GenerativeData = v - return s -} - -// SetSourceContentData sets the SourceContentData field's value. -func (s *DataDetails) SetSourceContentData(v *SourceContentDataDetails) *DataDetails { - s.SourceContentData = v - return s -} - -// Reference data. -type DataReference struct { - _ struct{} `type:"structure"` - - // Reference information about the content. - ContentReference *ContentReference `locationName:"contentReference" type:"structure"` - - // Reference information about the generative content. - GenerativeReference *GenerativeReference `locationName:"generativeReference" 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 DataReference) 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 DataReference) GoString() string { - return s.String() -} - -// SetContentReference sets the ContentReference field's value. -func (s *DataReference) SetContentReference(v *ContentReference) *DataReference { - s.ContentReference = v - return s -} - -// SetGenerativeReference sets the GenerativeReference field's value. -func (s *DataReference) SetGenerativeReference(v *GenerativeReference) *DataReference { - s.GenerativeReference = v - return s -} - -// Summary of the data. -type DataSummary struct { - _ struct{} `type:"structure"` - - // Details about the data. - // - // Details is a required field - Details *DataDetails `locationName:"details" type:"structure" required:"true"` - - // Reference information about the content. - // - // Reference is a required field - Reference *DataReference `locationName:"reference" type:"structure" 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 DataSummary) 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 DataSummary) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *DataSummary) SetDetails(v *DataDetails) *DataSummary { - s.Details = v - return s -} - -// SetReference sets the Reference field's value. -func (s *DataSummary) SetReference(v *DataReference) *DataSummary { - s.Reference = v - return s -} - -type DeleteAssistantAssociationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the assistant association. Can be either the ID or the - // ARN. URLs cannot contain the ARN. - // - // AssistantAssociationId is a required field - AssistantAssociationId *string `location:"uri" locationName:"assistantAssociationId" type:"string" required:"true"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" 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 DeleteAssistantAssociationInput) 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 DeleteAssistantAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAssistantAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAssistantAssociationInput"} - if s.AssistantAssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantAssociationId")) - } - if s.AssistantAssociationId != nil && len(*s.AssistantAssociationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantAssociationId", 1)) - } - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantAssociationId sets the AssistantAssociationId field's value. -func (s *DeleteAssistantAssociationInput) SetAssistantAssociationId(v string) *DeleteAssistantAssociationInput { - s.AssistantAssociationId = &v - return s -} - -// SetAssistantId sets the AssistantId field's value. -func (s *DeleteAssistantAssociationInput) SetAssistantId(v string) *DeleteAssistantAssociationInput { - s.AssistantId = &v - return s -} - -type DeleteAssistantAssociationOutput 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 DeleteAssistantAssociationOutput) 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 DeleteAssistantAssociationOutput) GoString() string { - return s.String() -} - -type DeleteAssistantInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" 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 DeleteAssistantInput) 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 DeleteAssistantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAssistantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAssistantInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *DeleteAssistantInput) SetAssistantId(v string) *DeleteAssistantInput { - s.AssistantId = &v - return s -} - -type DeleteAssistantOutput 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 DeleteAssistantOutput) 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 DeleteAssistantOutput) GoString() string { - return s.String() -} - -type DeleteContentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the content. Can be either the ID or the ARN. URLs cannot - // contain the ARN. - // - // ContentId is a required field - ContentId *string `location:"uri" locationName:"contentId" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 DeleteContentInput) 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 DeleteContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteContentInput"} - if s.ContentId == nil { - invalidParams.Add(request.NewErrParamRequired("ContentId")) - } - if s.ContentId != nil && len(*s.ContentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ContentId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentId sets the ContentId field's value. -func (s *DeleteContentInput) SetContentId(v string) *DeleteContentInput { - s.ContentId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DeleteContentInput) SetKnowledgeBaseId(v string) *DeleteContentInput { - s.KnowledgeBaseId = &v - return s -} - -type DeleteContentOutput 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 DeleteContentOutput) 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 DeleteContentOutput) GoString() string { - return s.String() -} - -type DeleteImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the import job to be deleted. - // - // ImportJobId is a required field - ImportJobId *string `location:"uri" locationName:"importJobId" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 DeleteImportJobInput) 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 DeleteImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteImportJobInput"} - if s.ImportJobId == nil { - invalidParams.Add(request.NewErrParamRequired("ImportJobId")) - } - if s.ImportJobId != nil && len(*s.ImportJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImportJobId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImportJobId sets the ImportJobId field's value. -func (s *DeleteImportJobInput) SetImportJobId(v string) *DeleteImportJobInput { - s.ImportJobId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DeleteImportJobInput) SetKnowledgeBaseId(v string) *DeleteImportJobInput { - s.KnowledgeBaseId = &v - return s -} - -type DeleteImportJobOutput 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 DeleteImportJobOutput) 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 DeleteImportJobOutput) GoString() string { - return s.String() -} - -type DeleteKnowledgeBaseInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The knowledge base to delete content from. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 DeleteKnowledgeBaseInput) 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 DeleteKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteKnowledgeBaseInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DeleteKnowledgeBaseInput) SetKnowledgeBaseId(v string) *DeleteKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -type DeleteKnowledgeBaseOutput 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 DeleteKnowledgeBaseOutput) 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 DeleteKnowledgeBaseOutput) GoString() string { - return s.String() -} - -type DeleteQuickResponseInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The knowledge base from which the quick response is deleted. The identifier - // of the knowledge base. This should not be a QUICK_RESPONSES type knowledge - // base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The identifier of the quick response to delete. - // - // QuickResponseId is a required field - QuickResponseId *string `location:"uri" locationName:"quickResponseId" 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 DeleteQuickResponseInput) 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 DeleteQuickResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteQuickResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteQuickResponseInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.QuickResponseId == nil { - invalidParams.Add(request.NewErrParamRequired("QuickResponseId")) - } - if s.QuickResponseId != nil && len(*s.QuickResponseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QuickResponseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *DeleteQuickResponseInput) SetKnowledgeBaseId(v string) *DeleteQuickResponseInput { - s.KnowledgeBaseId = &v - return s -} - -// SetQuickResponseId sets the QuickResponseId field's value. -func (s *DeleteQuickResponseInput) SetQuickResponseId(v string) *DeleteQuickResponseInput { - s.QuickResponseId = &v - return s -} - -type DeleteQuickResponseOutput 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 DeleteQuickResponseOutput) 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 DeleteQuickResponseOutput) GoString() string { - return s.String() -} - -// The document. -type Document struct { - _ struct{} `type:"structure"` - - // A reference to the content resource. - // - // ContentReference is a required field - ContentReference *ContentReference `locationName:"contentReference" type:"structure" required:"true"` - - // The excerpt from the document. - Excerpt *DocumentText `locationName:"excerpt" type:"structure"` - - // The title of the document. - Title *DocumentText `locationName:"title" 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 Document) 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 Document) GoString() string { - return s.String() -} - -// SetContentReference sets the ContentReference field's value. -func (s *Document) SetContentReference(v *ContentReference) *Document { - s.ContentReference = v - return s -} - -// SetExcerpt sets the Excerpt field's value. -func (s *Document) SetExcerpt(v *DocumentText) *Document { - s.Excerpt = v - return s -} - -// SetTitle sets the Title field's value. -func (s *Document) SetTitle(v *DocumentText) *Document { - s.Title = v - return s -} - -// The text of the document. -type DocumentText struct { - _ struct{} `type:"structure"` - - // Highlights in the document text. - Highlights []*Highlight `locationName:"highlights" type:"list"` - - // Text in the document. - // - // Text is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DocumentText's - // String and GoString methods. - Text *string `locationName:"text" type:"string" sensitive:"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 DocumentText) 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 DocumentText) GoString() string { - return s.String() -} - -// SetHighlights sets the Highlights field's value. -func (s *DocumentText) SetHighlights(v []*Highlight) *DocumentText { - s.Highlights = v - return s -} - -// SetText sets the Text field's value. -func (s *DocumentText) SetText(v string) *DocumentText { - s.Text = &v - return s -} - -// The configuration information of the external data source. -type ExternalSourceConfiguration struct { - _ struct{} `type:"structure"` - - // The configuration information of the external data source. - // - // Configuration is a required field - Configuration *Configuration `locationName:"configuration" type:"structure" required:"true"` - - // The type of the external data source. - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true" enum:"ExternalSource"` -} - -// 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 ExternalSourceConfiguration) 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 ExternalSourceConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExternalSourceConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExternalSourceConfiguration"} - if s.Configuration == nil { - invalidParams.Add(request.NewErrParamRequired("Configuration")) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguration sets the Configuration field's value. -func (s *ExternalSourceConfiguration) SetConfiguration(v *Configuration) *ExternalSourceConfiguration { - s.Configuration = v - return s -} - -// SetSource sets the Source field's value. -func (s *ExternalSourceConfiguration) SetSource(v string) *ExternalSourceConfiguration { - s.Source = &v - return s -} - -// A search filter. -type Filter struct { - _ struct{} `type:"structure"` - - // The field on which to filter. - // - // Field is a required field - Field *string `locationName:"field" type:"string" required:"true" enum:"FilterField"` - - // The operator to use for comparing the field’s value with the provided value. - // - // Operator is a required field - Operator *string `locationName:"operator" type:"string" required:"true" enum:"FilterOperator"` - - // The desired field value on which to filter. - // - // Value is a required field - Value *string `locationName:"value" min:"1" 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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Filter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Filter"} - if s.Field == nil { - invalidParams.Add(request.NewErrParamRequired("Field")) - } - if s.Operator == nil { - invalidParams.Add(request.NewErrParamRequired("Operator")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetField sets the Field field's value. -func (s *Filter) SetField(v string) *Filter { - s.Field = &v - return s -} - -// SetOperator sets the Operator field's value. -func (s *Filter) SetOperator(v string) *Filter { - s.Operator = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Filter) SetValue(v string) *Filter { - s.Value = &v - return s -} - -// Details about generative data. -type GenerativeDataDetails struct { - _ struct{} `type:"structure"` - - // The LLM response. - // - // Completion is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GenerativeDataDetails's - // String and GoString methods. - // - // Completion is a required field - Completion *string `locationName:"completion" type:"string" required:"true" sensitive:"true"` - - // Details about the generative content ranking data. - // - // RankingData is a required field - RankingData *RankingData `locationName:"rankingData" type:"structure" required:"true"` - - // The references used to generative the LLM response. - // - // References is a required field - References []*DataSummary `locationName:"references" type:"list" 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 GenerativeDataDetails) 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 GenerativeDataDetails) GoString() string { - return s.String() -} - -// SetCompletion sets the Completion field's value. -func (s *GenerativeDataDetails) SetCompletion(v string) *GenerativeDataDetails { - s.Completion = &v - return s -} - -// SetRankingData sets the RankingData field's value. -func (s *GenerativeDataDetails) SetRankingData(v *RankingData) *GenerativeDataDetails { - s.RankingData = v - return s -} - -// SetReferences sets the References field's value. -func (s *GenerativeDataDetails) SetReferences(v []*DataSummary) *GenerativeDataDetails { - s.References = v - return s -} - -// Reference information about generative content. -type GenerativeReference struct { - _ struct{} `type:"structure"` - - // The identifier of the LLM model. - GenerationId *string `locationName:"generationId" type:"string"` - - // The identifier of the LLM model. - ModelId *string `locationName:"modelId" min:"1" 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 GenerativeReference) 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 GenerativeReference) GoString() string { - return s.String() -} - -// SetGenerationId sets the GenerationId field's value. -func (s *GenerativeReference) SetGenerationId(v string) *GenerativeReference { - s.GenerationId = &v - return s -} - -// SetModelId sets the ModelId field's value. -func (s *GenerativeReference) SetModelId(v string) *GenerativeReference { - s.ModelId = &v - return s -} - -type GetAssistantAssociationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the assistant association. Can be either the ID or the - // ARN. URLs cannot contain the ARN. - // - // AssistantAssociationId is a required field - AssistantAssociationId *string `location:"uri" locationName:"assistantAssociationId" type:"string" required:"true"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" 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 GetAssistantAssociationInput) 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 GetAssistantAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAssistantAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAssistantAssociationInput"} - if s.AssistantAssociationId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantAssociationId")) - } - if s.AssistantAssociationId != nil && len(*s.AssistantAssociationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantAssociationId", 1)) - } - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantAssociationId sets the AssistantAssociationId field's value. -func (s *GetAssistantAssociationInput) SetAssistantAssociationId(v string) *GetAssistantAssociationInput { - s.AssistantAssociationId = &v - return s -} - -// SetAssistantId sets the AssistantId field's value. -func (s *GetAssistantAssociationInput) SetAssistantId(v string) *GetAssistantAssociationInput { - s.AssistantId = &v - return s -} - -type GetAssistantAssociationOutput struct { - _ struct{} `type:"structure"` - - // The assistant association. - AssistantAssociation *AssistantAssociationData `locationName:"assistantAssociation" 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 GetAssistantAssociationOutput) 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 GetAssistantAssociationOutput) GoString() string { - return s.String() -} - -// SetAssistantAssociation sets the AssistantAssociation field's value. -func (s *GetAssistantAssociationOutput) SetAssistantAssociation(v *AssistantAssociationData) *GetAssistantAssociationOutput { - s.AssistantAssociation = v - return s -} - -type GetAssistantInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" 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 GetAssistantInput) 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 GetAssistantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAssistantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAssistantInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *GetAssistantInput) SetAssistantId(v string) *GetAssistantInput { - s.AssistantId = &v - return s -} - -type GetAssistantOutput struct { - _ struct{} `type:"structure"` - - // Information about the assistant. - Assistant *AssistantData `locationName:"assistant" 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 GetAssistantOutput) 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 GetAssistantOutput) GoString() string { - return s.String() -} - -// SetAssistant sets the Assistant field's value. -func (s *GetAssistantOutput) SetAssistant(v *AssistantData) *GetAssistantOutput { - s.Assistant = v - return s -} - -type GetContentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the content. Can be either the ID or the ARN. URLs cannot - // contain the ARN. - // - // ContentId is a required field - ContentId *string `location:"uri" locationName:"contentId" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 GetContentInput) 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 GetContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetContentInput"} - if s.ContentId == nil { - invalidParams.Add(request.NewErrParamRequired("ContentId")) - } - if s.ContentId != nil && len(*s.ContentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ContentId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentId sets the ContentId field's value. -func (s *GetContentInput) SetContentId(v string) *GetContentInput { - s.ContentId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetContentInput) SetKnowledgeBaseId(v string) *GetContentInput { - s.KnowledgeBaseId = &v - return s -} - -type GetContentOutput struct { - _ struct{} `type:"structure"` - - // The content. - Content *ContentData `locationName:"content" 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 GetContentOutput) 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 GetContentOutput) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *GetContentOutput) SetContent(v *ContentData) *GetContentOutput { - s.Content = v - return s -} - -type GetContentSummaryInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the content. Can be either the ID or the ARN. URLs cannot - // contain the ARN. - // - // ContentId is a required field - ContentId *string `location:"uri" locationName:"contentId" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 GetContentSummaryInput) 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 GetContentSummaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetContentSummaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetContentSummaryInput"} - if s.ContentId == nil { - invalidParams.Add(request.NewErrParamRequired("ContentId")) - } - if s.ContentId != nil && len(*s.ContentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ContentId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentId sets the ContentId field's value. -func (s *GetContentSummaryInput) SetContentId(v string) *GetContentSummaryInput { - s.ContentId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetContentSummaryInput) SetKnowledgeBaseId(v string) *GetContentSummaryInput { - s.KnowledgeBaseId = &v - return s -} - -type GetContentSummaryOutput struct { - _ struct{} `type:"structure"` - - // The content summary. - ContentSummary *ContentSummary `locationName:"contentSummary" 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 GetContentSummaryOutput) 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 GetContentSummaryOutput) GoString() string { - return s.String() -} - -// SetContentSummary sets the ContentSummary field's value. -func (s *GetContentSummaryOutput) SetContentSummary(v *ContentSummary) *GetContentSummaryOutput { - s.ContentSummary = v - return s -} - -type GetImportJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the import job to retrieve. - // - // ImportJobId is a required field - ImportJobId *string `location:"uri" locationName:"importJobId" type:"string" required:"true"` - - // The identifier of the knowledge base that the import job belongs to. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 GetImportJobInput) 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 GetImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetImportJobInput"} - if s.ImportJobId == nil { - invalidParams.Add(request.NewErrParamRequired("ImportJobId")) - } - if s.ImportJobId != nil && len(*s.ImportJobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImportJobId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImportJobId sets the ImportJobId field's value. -func (s *GetImportJobInput) SetImportJobId(v string) *GetImportJobInput { - s.ImportJobId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetImportJobInput) SetKnowledgeBaseId(v string) *GetImportJobInput { - s.KnowledgeBaseId = &v - return s -} - -type GetImportJobOutput struct { - _ struct{} `type:"structure"` - - // The import job. - ImportJob *ImportJobData `locationName:"importJob" 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 GetImportJobOutput) 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 GetImportJobOutput) GoString() string { - return s.String() -} - -// SetImportJob sets the ImportJob field's value. -func (s *GetImportJobOutput) SetImportJob(v *ImportJobData) *GetImportJobOutput { - s.ImportJob = v - return s -} - -type GetKnowledgeBaseInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 GetKnowledgeBaseInput) 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 GetKnowledgeBaseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetKnowledgeBaseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetKnowledgeBaseInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetKnowledgeBaseInput) SetKnowledgeBaseId(v string) *GetKnowledgeBaseInput { - s.KnowledgeBaseId = &v - return s -} - -type GetKnowledgeBaseOutput struct { - _ struct{} `type:"structure"` - - // The knowledge base. - KnowledgeBase *KnowledgeBaseData `locationName:"knowledgeBase" 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 GetKnowledgeBaseOutput) 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 GetKnowledgeBaseOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBase sets the KnowledgeBase field's value. -func (s *GetKnowledgeBaseOutput) SetKnowledgeBase(v *KnowledgeBaseData) *GetKnowledgeBaseOutput { - s.KnowledgeBase = v - return s -} - -type GetQuickResponseInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the knowledge base. This should be a QUICK_RESPONSES type - // knowledge base. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The identifier of the quick response. - // - // QuickResponseId is a required field - QuickResponseId *string `location:"uri" locationName:"quickResponseId" 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 GetQuickResponseInput) 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 GetQuickResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetQuickResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetQuickResponseInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.QuickResponseId == nil { - invalidParams.Add(request.NewErrParamRequired("QuickResponseId")) - } - if s.QuickResponseId != nil && len(*s.QuickResponseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QuickResponseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *GetQuickResponseInput) SetKnowledgeBaseId(v string) *GetQuickResponseInput { - s.KnowledgeBaseId = &v - return s -} - -// SetQuickResponseId sets the QuickResponseId field's value. -func (s *GetQuickResponseInput) SetQuickResponseId(v string) *GetQuickResponseInput { - s.QuickResponseId = &v - return s -} - -type GetQuickResponseOutput struct { - _ struct{} `type:"structure"` - - // The quick response. - QuickResponse *QuickResponseData `locationName:"quickResponse" 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 GetQuickResponseOutput) 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 GetQuickResponseOutput) GoString() string { - return s.String() -} - -// SetQuickResponse sets the QuickResponse field's value. -func (s *GetQuickResponseOutput) SetQuickResponse(v *QuickResponseData) *GetQuickResponseOutput { - s.QuickResponse = v - return s -} - -type GetRecommendationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The identifier of the session. Can be either the ID or the ARN. URLs cannot - // contain the ARN. - // - // SessionId is a required field - SessionId *string `location:"uri" locationName:"sessionId" type:"string" required:"true"` - - // The duration (in seconds) for which the call waits for a recommendation to - // be made available before returning. If a recommendation is available, the - // call returns sooner than WaitTimeSeconds. If no messages are available and - // the wait time expires, the call returns successfully with an empty list. - WaitTimeSeconds *int64 `location:"querystring" locationName:"waitTimeSeconds" 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 GetRecommendationsInput) 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 GetRecommendationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRecommendationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRecommendationsInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.SessionId == nil { - invalidParams.Add(request.NewErrParamRequired("SessionId")) - } - if s.SessionId != nil && len(*s.SessionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *GetRecommendationsInput) SetAssistantId(v string) *GetRecommendationsInput { - s.AssistantId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetRecommendationsInput) SetMaxResults(v int64) *GetRecommendationsInput { - s.MaxResults = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *GetRecommendationsInput) SetSessionId(v string) *GetRecommendationsInput { - s.SessionId = &v - return s -} - -// SetWaitTimeSeconds sets the WaitTimeSeconds field's value. -func (s *GetRecommendationsInput) SetWaitTimeSeconds(v int64) *GetRecommendationsInput { - s.WaitTimeSeconds = &v - return s -} - -type GetRecommendationsOutput struct { - _ struct{} `type:"structure"` - - // The recommendations. - // - // Recommendations is a required field - Recommendations []*RecommendationData `locationName:"recommendations" type:"list" required:"true"` - - // The triggers corresponding to recommendations. - Triggers []*RecommendationTrigger `locationName:"triggers" type:"list"` -} - -// 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 GetRecommendationsOutput) 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 GetRecommendationsOutput) GoString() string { - return s.String() -} - -// SetRecommendations sets the Recommendations field's value. -func (s *GetRecommendationsOutput) SetRecommendations(v []*RecommendationData) *GetRecommendationsOutput { - s.Recommendations = v - return s -} - -// SetTriggers sets the Triggers field's value. -func (s *GetRecommendationsOutput) SetTriggers(v []*RecommendationTrigger) *GetRecommendationsOutput { - s.Triggers = v - return s -} - -type GetSessionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" type:"string" required:"true"` - - // The identifier of the session. Can be either the ID or the ARN. URLs cannot - // contain the ARN. - // - // SessionId is a required field - SessionId *string `location:"uri" locationName:"sessionId" 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 GetSessionInput) 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 GetSessionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSessionInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - if s.SessionId == nil { - invalidParams.Add(request.NewErrParamRequired("SessionId")) - } - if s.SessionId != nil && len(*s.SessionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *GetSessionInput) SetAssistantId(v string) *GetSessionInput { - s.AssistantId = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *GetSessionInput) SetSessionId(v string) *GetSessionInput { - s.SessionId = &v - return s -} - -type GetSessionOutput struct { - _ struct{} `type:"structure"` - - // The session. - Session *SessionData `locationName:"session" 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 GetSessionOutput) 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 GetSessionOutput) GoString() string { - return s.String() -} - -// SetSession sets the Session field's value. -func (s *GetSessionOutput) SetSession(v *SessionData) *GetSessionOutput { - s.Session = v - return s -} - -// The configuration information of the grouping of Amazon Q users. -type GroupingConfiguration struct { - _ struct{} `type:"structure"` - - // The criteria used for grouping Amazon Q users. - // - // The following is the list of supported criteria values. - // - // * RoutingProfileArn: Grouping the users by their Amazon Connect routing - // profile ARN (https://docs.aws.amazon.com/connect/latest/APIReference/API_RoutingProfile.html). - // User should have SearchRoutingProfile (https://docs.aws.amazon.com/connect/latest/APIReference/API_SearchRoutingProfiles.html) - // and DescribeRoutingProfile (https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeRoutingProfile.html) - // permissions when setting criteria to this value. - // - // Criteria is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GroupingConfiguration's - // String and GoString methods. - Criteria *string `locationName:"criteria" min:"1" type:"string" sensitive:"true"` - - // The list of values that define different groups of Amazon Q users. - // - // * When setting criteria to RoutingProfileArn, you need to provide a list - // of ARNs of Amazon Connect routing profiles (https://docs.aws.amazon.com/connect/latest/APIReference/API_RoutingProfile.html) - // as values of this parameter. - Values []*string `locationName:"values" type:"list"` -} - -// 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 GroupingConfiguration) 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 GroupingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GroupingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GroupingConfiguration"} - if s.Criteria != nil && len(*s.Criteria) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Criteria", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCriteria sets the Criteria field's value. -func (s *GroupingConfiguration) SetCriteria(v string) *GroupingConfiguration { - s.Criteria = &v - return s -} - -// SetValues sets the Values field's value. -func (s *GroupingConfiguration) SetValues(v []*string) *GroupingConfiguration { - s.Values = v - return s -} - -// Offset specification to describe highlighting of document excerpts for rendering -// search results and recommendations. -type Highlight struct { - _ struct{} `type:"structure"` - - // The offset for the start of the highlight. - BeginOffsetInclusive *int64 `locationName:"beginOffsetInclusive" type:"integer"` - - // The offset for the end of the highlight. - EndOffsetExclusive *int64 `locationName:"endOffsetExclusive" 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 Highlight) 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 Highlight) GoString() string { - return s.String() -} - -// SetBeginOffsetInclusive sets the BeginOffsetInclusive field's value. -func (s *Highlight) SetBeginOffsetInclusive(v int64) *Highlight { - s.BeginOffsetInclusive = &v - return s -} - -// SetEndOffsetExclusive sets the EndOffsetExclusive field's value. -func (s *Highlight) SetEndOffsetExclusive(v int64) *Highlight { - s.EndOffsetExclusive = &v - return s -} - -// Summary information about the import job. -type ImportJobData struct { - _ struct{} `type:"structure"` - - // The timestamp when the import job was created. - // - // CreatedTime is a required field - CreatedTime *time.Time `locationName:"createdTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The configuration information of the external data source. - ExternalSourceConfiguration *ExternalSourceConfiguration `locationName:"externalSourceConfiguration" type:"structure"` - - // The link to donwload the information of resource data that failed to be imported. - // - // FailedRecordReport is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ImportJobData's - // String and GoString methods. - FailedRecordReport *string `locationName:"failedRecordReport" min:"1" type:"string" sensitive:"true"` - - // The identifier of the import job. - // - // ImportJobId is a required field - ImportJobId *string `locationName:"importJobId" type:"string" required:"true"` - - // The type of the import job. - // - // ImportJobType is a required field - ImportJobType *string `locationName:"importJobType" type:"string" required:"true" enum:"ImportJobType"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The timestamp when the import job data was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The metadata fields of the imported Amazon Q resources. - Metadata map[string]*string `locationName:"metadata" type:"map"` - - // The status of the import job. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ImportJobStatus"` - - // A pointer to the uploaded asset. This value is returned by StartContentUpload - // (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html). - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" min:"1" type:"string" required:"true"` - - // The download link to the resource file that is uploaded to the import job. - // - // Url is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ImportJobData's - // String and GoString methods. - // - // Url is a required field - Url *string `locationName:"url" min:"1" type:"string" required:"true" sensitive:"true"` - - // The expiration time of the URL as an epoch timestamp. - // - // UrlExpiry is a required field - UrlExpiry *time.Time `locationName:"urlExpiry" type:"timestamp" timestampFormat:"unixTimestamp" 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 ImportJobData) 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 ImportJobData) GoString() string { - return s.String() -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *ImportJobData) SetCreatedTime(v time.Time) *ImportJobData { - s.CreatedTime = &v - return s -} - -// SetExternalSourceConfiguration sets the ExternalSourceConfiguration field's value. -func (s *ImportJobData) SetExternalSourceConfiguration(v *ExternalSourceConfiguration) *ImportJobData { - s.ExternalSourceConfiguration = v - return s -} - -// SetFailedRecordReport sets the FailedRecordReport field's value. -func (s *ImportJobData) SetFailedRecordReport(v string) *ImportJobData { - s.FailedRecordReport = &v - return s -} - -// SetImportJobId sets the ImportJobId field's value. -func (s *ImportJobData) SetImportJobId(v string) *ImportJobData { - s.ImportJobId = &v - return s -} - -// SetImportJobType sets the ImportJobType field's value. -func (s *ImportJobData) SetImportJobType(v string) *ImportJobData { - s.ImportJobType = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *ImportJobData) SetKnowledgeBaseArn(v string) *ImportJobData { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ImportJobData) SetKnowledgeBaseId(v string) *ImportJobData { - s.KnowledgeBaseId = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *ImportJobData) SetLastModifiedTime(v time.Time) *ImportJobData { - s.LastModifiedTime = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ImportJobData) SetMetadata(v map[string]*string) *ImportJobData { - s.Metadata = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportJobData) SetStatus(v string) *ImportJobData { - s.Status = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *ImportJobData) SetUploadId(v string) *ImportJobData { - s.UploadId = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *ImportJobData) SetUrl(v string) *ImportJobData { - s.Url = &v - return s -} - -// SetUrlExpiry sets the UrlExpiry field's value. -func (s *ImportJobData) SetUrlExpiry(v time.Time) *ImportJobData { - s.UrlExpiry = &v - return s -} - -// Summary information about the import job. -type ImportJobSummary struct { - _ struct{} `type:"structure"` - - // The timestamp when the import job was created. - // - // CreatedTime is a required field - CreatedTime *time.Time `locationName:"createdTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The configuration information of the external source that the resource data - // are imported from. - ExternalSourceConfiguration *ExternalSourceConfiguration `locationName:"externalSourceConfiguration" type:"structure"` - - // The identifier of the import job. - // - // ImportJobId is a required field - ImportJobId *string `locationName:"importJobId" type:"string" required:"true"` - - // The type of import job. - // - // ImportJobType is a required field - ImportJobType *string `locationName:"importJobType" type:"string" required:"true" enum:"ImportJobType"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The timestamp when the import job was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The metadata fields of the imported Amazon Q resources. - Metadata map[string]*string `locationName:"metadata" type:"map"` - - // The status of the import job. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ImportJobStatus"` - - // A pointer to the uploaded asset. This value is returned by StartContentUpload - // (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html). - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" min:"1" 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 ImportJobSummary) 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 ImportJobSummary) GoString() string { - return s.String() -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *ImportJobSummary) SetCreatedTime(v time.Time) *ImportJobSummary { - s.CreatedTime = &v - return s -} - -// SetExternalSourceConfiguration sets the ExternalSourceConfiguration field's value. -func (s *ImportJobSummary) SetExternalSourceConfiguration(v *ExternalSourceConfiguration) *ImportJobSummary { - s.ExternalSourceConfiguration = v - return s -} - -// SetImportJobId sets the ImportJobId field's value. -func (s *ImportJobSummary) SetImportJobId(v string) *ImportJobSummary { - s.ImportJobId = &v - return s -} - -// SetImportJobType sets the ImportJobType field's value. -func (s *ImportJobSummary) SetImportJobType(v string) *ImportJobSummary { - s.ImportJobType = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *ImportJobSummary) SetKnowledgeBaseArn(v string) *ImportJobSummary { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ImportJobSummary) SetKnowledgeBaseId(v string) *ImportJobSummary { - s.KnowledgeBaseId = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *ImportJobSummary) SetLastModifiedTime(v time.Time) *ImportJobSummary { - s.LastModifiedTime = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ImportJobSummary) SetMetadata(v map[string]*string) *ImportJobSummary { - s.Metadata = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportJobSummary) SetStatus(v string) *ImportJobSummary { - s.Status = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *ImportJobSummary) SetUploadId(v string) *ImportJobSummary { - s.UploadId = &v - return s -} - -// Association information about the knowledge base. -type KnowledgeBaseAssociationData struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the knowledge base. - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - KnowledgeBaseId *string `locationName:"knowledgeBaseId" 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 KnowledgeBaseAssociationData) 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 KnowledgeBaseAssociationData) GoString() string { - return s.String() -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *KnowledgeBaseAssociationData) SetKnowledgeBaseArn(v string) *KnowledgeBaseAssociationData { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *KnowledgeBaseAssociationData) SetKnowledgeBaseId(v string) *KnowledgeBaseAssociationData { - s.KnowledgeBaseId = &v - return s -} - -// Information about the knowledge base. -type KnowledgeBaseData struct { - _ struct{} `type:"structure"` - - // The description. - Description *string `locationName:"description" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The type of knowledge base. - // - // KnowledgeBaseType is a required field - KnowledgeBaseType *string `locationName:"knowledgeBaseType" type:"string" required:"true" enum:"KnowledgeBaseType"` - - // An epoch timestamp indicating the most recent content modification inside - // the knowledge base. If no content exists in a knowledge base, this value - // is unset. - LastContentModificationTime *time.Time `locationName:"lastContentModificationTime" type:"timestamp" timestampFormat:"unixTimestamp"` - - // The name of the knowledge base. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Information about how to render the content. - RenderingConfiguration *RenderingConfiguration `locationName:"renderingConfiguration" type:"structure"` - - // The configuration information for the customer managed key used for encryption. - // - // This KMS key must have a policy that allows kms:CreateGrant, kms:DescribeKey, - // kms:Decrypt, and kms:GenerateDataKey* permissions to the IAM identity using - // the key to invoke Amazon Q. - // - // For more information about setting up a customer managed key for Amazon Q, - // see Enable Amazon Q in Connect for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html). - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // Source configuration information about the knowledge base. - SourceConfiguration *SourceConfiguration `locationName:"sourceConfiguration" type:"structure"` - - // The status of the knowledge base. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"KnowledgeBaseStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 KnowledgeBaseData) 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 KnowledgeBaseData) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *KnowledgeBaseData) SetDescription(v string) *KnowledgeBaseData { - s.Description = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *KnowledgeBaseData) SetKnowledgeBaseArn(v string) *KnowledgeBaseData { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *KnowledgeBaseData) SetKnowledgeBaseId(v string) *KnowledgeBaseData { - s.KnowledgeBaseId = &v - return s -} - -// SetKnowledgeBaseType sets the KnowledgeBaseType field's value. -func (s *KnowledgeBaseData) SetKnowledgeBaseType(v string) *KnowledgeBaseData { - s.KnowledgeBaseType = &v - return s -} - -// SetLastContentModificationTime sets the LastContentModificationTime field's value. -func (s *KnowledgeBaseData) SetLastContentModificationTime(v time.Time) *KnowledgeBaseData { - s.LastContentModificationTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *KnowledgeBaseData) SetName(v string) *KnowledgeBaseData { - s.Name = &v - return s -} - -// SetRenderingConfiguration sets the RenderingConfiguration field's value. -func (s *KnowledgeBaseData) SetRenderingConfiguration(v *RenderingConfiguration) *KnowledgeBaseData { - s.RenderingConfiguration = v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *KnowledgeBaseData) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *KnowledgeBaseData { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetSourceConfiguration sets the SourceConfiguration field's value. -func (s *KnowledgeBaseData) SetSourceConfiguration(v *SourceConfiguration) *KnowledgeBaseData { - s.SourceConfiguration = v - return s -} - -// SetStatus sets the Status field's value. -func (s *KnowledgeBaseData) SetStatus(v string) *KnowledgeBaseData { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *KnowledgeBaseData) SetTags(v map[string]*string) *KnowledgeBaseData { - s.Tags = v - return s -} - -// Summary information about the knowledge base. -type KnowledgeBaseSummary struct { - _ struct{} `type:"structure"` - - // The description of the knowledge base. - Description *string `locationName:"description" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The type of knowledge base. - // - // KnowledgeBaseType is a required field - KnowledgeBaseType *string `locationName:"knowledgeBaseType" type:"string" required:"true" enum:"KnowledgeBaseType"` - - // The name of the knowledge base. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Information about how to render the content. - RenderingConfiguration *RenderingConfiguration `locationName:"renderingConfiguration" type:"structure"` - - // The configuration information for the customer managed key used for encryption. - // - // This KMS key must have a policy that allows kms:CreateGrant, kms:DescribeKey, - // kms:Decrypt, and kms:GenerateDataKey* permissions to the IAM identity using - // the key to invoke Amazon Q. - // - // For more information about setting up a customer managed key for Amazon Q, - // see Enable Amazon Q in Connect for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html). - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"serverSideEncryptionConfiguration" type:"structure"` - - // Configuration information about the external data source. - SourceConfiguration *SourceConfiguration `locationName:"sourceConfiguration" type:"structure"` - - // The status of the knowledge base summary. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"KnowledgeBaseStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 KnowledgeBaseSummary) 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 KnowledgeBaseSummary) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *KnowledgeBaseSummary) SetDescription(v string) *KnowledgeBaseSummary { - s.Description = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *KnowledgeBaseSummary) SetKnowledgeBaseArn(v string) *KnowledgeBaseSummary { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *KnowledgeBaseSummary) SetKnowledgeBaseId(v string) *KnowledgeBaseSummary { - s.KnowledgeBaseId = &v - return s -} - -// SetKnowledgeBaseType sets the KnowledgeBaseType field's value. -func (s *KnowledgeBaseSummary) SetKnowledgeBaseType(v string) *KnowledgeBaseSummary { - s.KnowledgeBaseType = &v - return s -} - -// SetName sets the Name field's value. -func (s *KnowledgeBaseSummary) SetName(v string) *KnowledgeBaseSummary { - s.Name = &v - return s -} - -// SetRenderingConfiguration sets the RenderingConfiguration field's value. -func (s *KnowledgeBaseSummary) SetRenderingConfiguration(v *RenderingConfiguration) *KnowledgeBaseSummary { - s.RenderingConfiguration = v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *KnowledgeBaseSummary) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *KnowledgeBaseSummary { - s.ServerSideEncryptionConfiguration = v - return s -} - -// SetSourceConfiguration sets the SourceConfiguration field's value. -func (s *KnowledgeBaseSummary) SetSourceConfiguration(v *SourceConfiguration) *KnowledgeBaseSummary { - s.SourceConfiguration = v - return s -} - -// SetStatus sets the Status field's value. -func (s *KnowledgeBaseSummary) SetStatus(v string) *KnowledgeBaseSummary { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *KnowledgeBaseSummary) SetTags(v map[string]*string) *KnowledgeBaseSummary { - s.Tags = v - return s -} - -type ListAssistantAssociationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListAssistantAssociationsInput) 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 ListAssistantAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssistantAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssistantAssociationsInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *ListAssistantAssociationsInput) SetAssistantId(v string) *ListAssistantAssociationsInput { - s.AssistantId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssistantAssociationsInput) SetMaxResults(v int64) *ListAssistantAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssistantAssociationsInput) SetNextToken(v string) *ListAssistantAssociationsInput { - s.NextToken = &v - return s -} - -type ListAssistantAssociationsOutput struct { - _ struct{} `type:"structure"` - - // Summary information about assistant associations. - // - // AssistantAssociationSummaries is a required field - AssistantAssociationSummaries []*AssistantAssociationSummary `locationName:"assistantAssociationSummaries" type:"list" required:"true"` - - // If there are additional results, this is the token for the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAssistantAssociationsOutput) 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 ListAssistantAssociationsOutput) GoString() string { - return s.String() -} - -// SetAssistantAssociationSummaries sets the AssistantAssociationSummaries field's value. -func (s *ListAssistantAssociationsOutput) SetAssistantAssociationSummaries(v []*AssistantAssociationSummary) *ListAssistantAssociationsOutput { - s.AssistantAssociationSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssistantAssociationsOutput) SetNextToken(v string) *ListAssistantAssociationsOutput { - s.NextToken = &v - return s -} - -type ListAssistantsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListAssistantsInput) 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 ListAssistantsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAssistantsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAssistantsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAssistantsInput) SetMaxResults(v int64) *ListAssistantsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssistantsInput) SetNextToken(v string) *ListAssistantsInput { - s.NextToken = &v - return s -} - -type ListAssistantsOutput struct { - _ struct{} `type:"structure"` - - // Information about the assistants. - // - // AssistantSummaries is a required field - AssistantSummaries []*AssistantSummary `locationName:"assistantSummaries" type:"list" required:"true"` - - // If there are additional results, this is the token for the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAssistantsOutput) 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 ListAssistantsOutput) GoString() string { - return s.String() -} - -// SetAssistantSummaries sets the AssistantSummaries field's value. -func (s *ListAssistantsOutput) SetAssistantSummaries(v []*AssistantSummary) *ListAssistantsOutput { - s.AssistantSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAssistantsOutput) SetNextToken(v string) *ListAssistantsOutput { - s.NextToken = &v - return s -} - -type ListContentsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListContentsInput) 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 ListContentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListContentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListContentsInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ListContentsInput) SetKnowledgeBaseId(v string) *ListContentsInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListContentsInput) SetMaxResults(v int64) *ListContentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListContentsInput) SetNextToken(v string) *ListContentsInput { - s.NextToken = &v - return s -} - -type ListContentsOutput struct { - _ struct{} `type:"structure"` - - // Information about the content. - // - // ContentSummaries is a required field - ContentSummaries []*ContentSummary `locationName:"contentSummaries" type:"list" required:"true"` - - // If there are additional results, this is the token for the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListContentsOutput) 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 ListContentsOutput) GoString() string { - return s.String() -} - -// SetContentSummaries sets the ContentSummaries field's value. -func (s *ListContentsOutput) SetContentSummaries(v []*ContentSummary) *ListContentsOutput { - s.ContentSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListContentsOutput) SetNextToken(v string) *ListContentsOutput { - s.NextToken = &v - return s -} - -type ListImportJobsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListImportJobsInput) 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 ListImportJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListImportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListImportJobsInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ListImportJobsInput) SetKnowledgeBaseId(v string) *ListImportJobsInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListImportJobsInput) SetMaxResults(v int64) *ListImportJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImportJobsInput) SetNextToken(v string) *ListImportJobsInput { - s.NextToken = &v - return s -} - -type ListImportJobsOutput struct { - _ struct{} `type:"structure"` - - // Summary information about the import jobs. - // - // ImportJobSummaries is a required field - ImportJobSummaries []*ImportJobSummary `locationName:"importJobSummaries" type:"list" required:"true"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListImportJobsOutput) 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 ListImportJobsOutput) GoString() string { - return s.String() -} - -// SetImportJobSummaries sets the ImportJobSummaries field's value. -func (s *ListImportJobsOutput) SetImportJobSummaries(v []*ImportJobSummary) *ListImportJobsOutput { - s.ImportJobSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImportJobsOutput) SetNextToken(v string) *ListImportJobsOutput { - s.NextToken = &v - return s -} - -type ListKnowledgeBasesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListKnowledgeBasesInput) 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 ListKnowledgeBasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListKnowledgeBasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListKnowledgeBasesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListKnowledgeBasesInput) SetMaxResults(v int64) *ListKnowledgeBasesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListKnowledgeBasesInput) SetNextToken(v string) *ListKnowledgeBasesInput { - s.NextToken = &v - return s -} - -type ListKnowledgeBasesOutput struct { - _ struct{} `type:"structure"` - - // Information about the knowledge bases. - // - // KnowledgeBaseSummaries is a required field - KnowledgeBaseSummaries []*KnowledgeBaseSummary `locationName:"knowledgeBaseSummaries" type:"list" required:"true"` - - // If there are additional results, this is the token for the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListKnowledgeBasesOutput) 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 ListKnowledgeBasesOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBaseSummaries sets the KnowledgeBaseSummaries field's value. -func (s *ListKnowledgeBasesOutput) SetKnowledgeBaseSummaries(v []*KnowledgeBaseSummary) *ListKnowledgeBasesOutput { - s.KnowledgeBaseSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListKnowledgeBasesOutput) SetNextToken(v string) *ListKnowledgeBasesOutput { - s.NextToken = &v - return s -} - -type ListQuickResponsesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListQuickResponsesInput) 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 ListQuickResponsesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListQuickResponsesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListQuickResponsesInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *ListQuickResponsesInput) SetKnowledgeBaseId(v string) *ListQuickResponsesInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListQuickResponsesInput) SetMaxResults(v int64) *ListQuickResponsesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListQuickResponsesInput) SetNextToken(v string) *ListQuickResponsesInput { - s.NextToken = &v - return s -} - -type ListQuickResponsesOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Summary information about the quick responses. - // - // QuickResponseSummaries is a required field - QuickResponseSummaries []*QuickResponseSummary `locationName:"quickResponseSummaries" type:"list" 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 ListQuickResponsesOutput) 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 ListQuickResponsesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListQuickResponsesOutput) SetNextToken(v string) *ListQuickResponsesOutput { - s.NextToken = &v - return s -} - -// SetQuickResponseSummaries sets the QuickResponseSummaries field's value. -func (s *ListQuickResponsesOutput) SetQuickResponseSummaries(v []*QuickResponseSummary) *ListQuickResponsesOutput { - s.QuickResponseSummaries = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// An error occurred when creating a recommendation. -type NotifyRecommendationsReceivedError struct { - _ struct{} `type:"structure"` - - // A recommendation is causing an error. - Message *string `locationName:"message" type:"string"` - - // The identifier of the recommendation that is in error. - RecommendationId *string `locationName:"recommendationId" min:"1" 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 NotifyRecommendationsReceivedError) 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 NotifyRecommendationsReceivedError) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *NotifyRecommendationsReceivedError) SetMessage(v string) *NotifyRecommendationsReceivedError { - s.Message = &v - return s -} - -// SetRecommendationId sets the RecommendationId field's value. -func (s *NotifyRecommendationsReceivedError) SetRecommendationId(v string) *NotifyRecommendationsReceivedError { - s.RecommendationId = &v - return s -} - -type NotifyRecommendationsReceivedInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" type:"string" required:"true"` - - // The identifiers of the recommendations. - // - // RecommendationIds is a required field - RecommendationIds []*string `locationName:"recommendationIds" type:"list" required:"true"` - - // The identifier of the session. Can be either the ID or the ARN. URLs cannot - // contain the ARN. - // - // SessionId is a required field - SessionId *string `location:"uri" locationName:"sessionId" 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 NotifyRecommendationsReceivedInput) 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 NotifyRecommendationsReceivedInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NotifyRecommendationsReceivedInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NotifyRecommendationsReceivedInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - if s.RecommendationIds == nil { - invalidParams.Add(request.NewErrParamRequired("RecommendationIds")) - } - if s.SessionId == nil { - invalidParams.Add(request.NewErrParamRequired("SessionId")) - } - if s.SessionId != nil && len(*s.SessionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SessionId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *NotifyRecommendationsReceivedInput) SetAssistantId(v string) *NotifyRecommendationsReceivedInput { - s.AssistantId = &v - return s -} - -// SetRecommendationIds sets the RecommendationIds field's value. -func (s *NotifyRecommendationsReceivedInput) SetRecommendationIds(v []*string) *NotifyRecommendationsReceivedInput { - s.RecommendationIds = v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *NotifyRecommendationsReceivedInput) SetSessionId(v string) *NotifyRecommendationsReceivedInput { - s.SessionId = &v - return s -} - -type NotifyRecommendationsReceivedOutput struct { - _ struct{} `type:"structure"` - - // The identifiers of recommendations that are causing errors. - Errors []*NotifyRecommendationsReceivedError `locationName:"errors" type:"list"` - - // The identifiers of the recommendations. - RecommendationIds []*string `locationName:"recommendationIds" type:"list"` -} - -// 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 NotifyRecommendationsReceivedOutput) 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 NotifyRecommendationsReceivedOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *NotifyRecommendationsReceivedOutput) SetErrors(v []*NotifyRecommendationsReceivedError) *NotifyRecommendationsReceivedOutput { - s.Errors = v - return s -} - -// SetRecommendationIds sets the RecommendationIds field's value. -func (s *NotifyRecommendationsReceivedOutput) SetRecommendationIds(v []*string) *NotifyRecommendationsReceivedOutput { - s.RecommendationIds = v - return s -} - -// The provided revisionId does not match, indicating the content has been modified -// since it was last read. -type PreconditionFailedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 PreconditionFailedException) 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 PreconditionFailedException) GoString() string { - return s.String() -} - -func newErrorPreconditionFailedException(v protocol.ResponseMetadata) error { - return &PreconditionFailedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PreconditionFailedException) Code() string { - return "PreconditionFailedException" -} - -// Message returns the exception's message. -func (s *PreconditionFailedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PreconditionFailedException) OrigErr() error { - return nil -} - -func (s *PreconditionFailedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PreconditionFailedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PreconditionFailedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type QueryAssistantInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Information about how to query content. - QueryCondition []*QueryCondition `locationName:"queryCondition" type:"list"` - - // The text to search for. - // - // QueryText is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by QueryAssistantInput's - // String and GoString methods. - // - // QueryText is a required field - QueryText *string `locationName:"queryText" type:"string" required:"true" sensitive:"true"` - - // The identifier of the Amazon Q session. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - SessionId *string `locationName:"sessionId" 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 QueryAssistantInput) 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 QueryAssistantInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueryAssistantInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueryAssistantInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.QueryText == nil { - invalidParams.Add(request.NewErrParamRequired("QueryText")) - } - if s.QueryCondition != nil { - for i, v := range s.QueryCondition { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueryCondition", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *QueryAssistantInput) SetAssistantId(v string) *QueryAssistantInput { - s.AssistantId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *QueryAssistantInput) SetMaxResults(v int64) *QueryAssistantInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *QueryAssistantInput) SetNextToken(v string) *QueryAssistantInput { - s.NextToken = &v - return s -} - -// SetQueryCondition sets the QueryCondition field's value. -func (s *QueryAssistantInput) SetQueryCondition(v []*QueryCondition) *QueryAssistantInput { - s.QueryCondition = v - return s -} - -// SetQueryText sets the QueryText field's value. -func (s *QueryAssistantInput) SetQueryText(v string) *QueryAssistantInput { - s.QueryText = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *QueryAssistantInput) SetSessionId(v string) *QueryAssistantInput { - s.SessionId = &v - return s -} - -type QueryAssistantOutput struct { - _ struct{} `type:"structure"` - - // If there are additional results, this is the token for the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The results of the query. - // - // Results is a required field - Results []*ResultData `locationName:"results" type:"list" 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 QueryAssistantOutput) 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 QueryAssistantOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *QueryAssistantOutput) SetNextToken(v string) *QueryAssistantOutput { - s.NextToken = &v - return s -} - -// SetResults sets the Results field's value. -func (s *QueryAssistantOutput) SetResults(v []*ResultData) *QueryAssistantOutput { - s.Results = v - return s -} - -// Information about how to query content. -type QueryCondition struct { - _ struct{} `type:"structure"` - - // The condition for the query. - Single *QueryConditionItem `locationName:"single" 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 QueryCondition) 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 QueryCondition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueryCondition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueryCondition"} - if s.Single != nil { - if err := s.Single.Validate(); err != nil { - invalidParams.AddNested("Single", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSingle sets the Single field's value. -func (s *QueryCondition) SetSingle(v *QueryConditionItem) *QueryCondition { - s.Single = v - return s -} - -// The condition for the query. -type QueryConditionItem struct { - _ struct{} `type:"structure"` - - // The comparison operator for query condition to query on. - // - // Comparator is a required field - Comparator *string `locationName:"comparator" type:"string" required:"true" enum:"QueryConditionComparisonOperator"` - - // The name of the field for query condition to query on. - // - // Field is a required field - Field *string `locationName:"field" type:"string" required:"true" enum:"QueryConditionFieldName"` - - // The value for the query condition to query on. - // - // Value is a required field - Value *string `locationName:"value" min:"1" 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 QueryConditionItem) 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 QueryConditionItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueryConditionItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueryConditionItem"} - if s.Comparator == nil { - invalidParams.Add(request.NewErrParamRequired("Comparator")) - } - if s.Field == nil { - invalidParams.Add(request.NewErrParamRequired("Field")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComparator sets the Comparator field's value. -func (s *QueryConditionItem) SetComparator(v string) *QueryConditionItem { - s.Comparator = &v - return s -} - -// SetField sets the Field field's value. -func (s *QueryConditionItem) SetField(v string) *QueryConditionItem { - s.Field = &v - return s -} - -// SetValue sets the Value field's value. -func (s *QueryConditionItem) SetValue(v string) *QueryConditionItem { - s.Value = &v - return s -} - -// Data associated with the QUERY RecommendationTriggerType. -type QueryRecommendationTriggerData struct { - _ struct{} `type:"structure"` - - // The text associated with the recommendation trigger. - // - // Text is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by QueryRecommendationTriggerData's - // String and GoString methods. - Text *string `locationName:"text" type:"string" sensitive:"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 QueryRecommendationTriggerData) 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 QueryRecommendationTriggerData) GoString() string { - return s.String() -} - -// SetText sets the Text field's value. -func (s *QueryRecommendationTriggerData) SetText(v string) *QueryRecommendationTriggerData { - s.Text = &v - return s -} - -// The container quick response content. -type QuickResponseContentProvider struct { - _ struct{} `type:"structure"` - - // The content of the quick response. - // - // Content is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by QuickResponseContentProvider's - // String and GoString methods. - Content *string `locationName:"content" min:"1" type:"string" sensitive:"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 QuickResponseContentProvider) 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 QuickResponseContentProvider) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *QuickResponseContentProvider) SetContent(v string) *QuickResponseContentProvider { - s.Content = &v - return s -} - -// The content of the quick response stored in different media types. -type QuickResponseContents struct { - _ struct{} `type:"structure"` - - // The container quick response content. - Markdown *QuickResponseContentProvider `locationName:"markdown" type:"structure"` - - // The container quick response content. - PlainText *QuickResponseContentProvider `locationName:"plainText" 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 QuickResponseContents) 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 QuickResponseContents) GoString() string { - return s.String() -} - -// SetMarkdown sets the Markdown field's value. -func (s *QuickResponseContents) SetMarkdown(v *QuickResponseContentProvider) *QuickResponseContents { - s.Markdown = v - return s -} - -// SetPlainText sets the PlainText field's value. -func (s *QuickResponseContents) SetPlainText(v *QuickResponseContentProvider) *QuickResponseContents { - s.PlainText = v - return s -} - -// Information about the quick response. -type QuickResponseData struct { - _ struct{} `type:"structure"` - - // The Amazon Connect contact channels this quick response applies to. The supported - // contact channel types include Chat. - Channels []*string `locationName:"channels" type:"list"` - - // The media type of the quick response content. - // - // * Use application/x.quickresponse;format=plain for quick response written - // in plain text. - // - // * Use application/x.quickresponse;format=markdown for quick response written - // in richtext. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true"` - - // The contents of the quick response. - Contents *QuickResponseContents `locationName:"contents" type:"structure"` - - // The timestamp when the quick response was created. - // - // CreatedTime is a required field - CreatedTime *time.Time `locationName:"createdTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The description of the quick response. - Description *string `locationName:"description" min:"1" type:"string"` - - // The configuration information of the user groups that the quick response - // is accessible to. - GroupingConfiguration *GroupingConfiguration `locationName:"groupingConfiguration" type:"structure"` - - // Whether the quick response is active. - IsActive *bool `locationName:"isActive" type:"boolean"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The language code value for the language in which the quick response is written. - Language *string `locationName:"language" min:"2" type:"string"` - - // The Amazon Resource Name (ARN) of the user who last updated the quick response - // data. - LastModifiedBy *string `locationName:"lastModifiedBy" min:"1" type:"string"` - - // The timestamp when the quick response data was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The name of the quick response. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the quick response. - // - // QuickResponseArn is a required field - QuickResponseArn *string `locationName:"quickResponseArn" type:"string" required:"true"` - - // The identifier of the quick response. - // - // QuickResponseId is a required field - QuickResponseId *string `locationName:"quickResponseId" type:"string" required:"true"` - - // The shortcut key of the quick response. The value should be unique across - // the knowledge base. - ShortcutKey *string `locationName:"shortcutKey" min:"1" type:"string"` - - // The status of the quick response data. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"QuickResponseStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 QuickResponseData) 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 QuickResponseData) GoString() string { - return s.String() -} - -// SetChannels sets the Channels field's value. -func (s *QuickResponseData) SetChannels(v []*string) *QuickResponseData { - s.Channels = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *QuickResponseData) SetContentType(v string) *QuickResponseData { - s.ContentType = &v - return s -} - -// SetContents sets the Contents field's value. -func (s *QuickResponseData) SetContents(v *QuickResponseContents) *QuickResponseData { - s.Contents = v - return s -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *QuickResponseData) SetCreatedTime(v time.Time) *QuickResponseData { - s.CreatedTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *QuickResponseData) SetDescription(v string) *QuickResponseData { - s.Description = &v - return s -} - -// SetGroupingConfiguration sets the GroupingConfiguration field's value. -func (s *QuickResponseData) SetGroupingConfiguration(v *GroupingConfiguration) *QuickResponseData { - s.GroupingConfiguration = v - return s -} - -// SetIsActive sets the IsActive field's value. -func (s *QuickResponseData) SetIsActive(v bool) *QuickResponseData { - s.IsActive = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *QuickResponseData) SetKnowledgeBaseArn(v string) *QuickResponseData { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *QuickResponseData) SetKnowledgeBaseId(v string) *QuickResponseData { - s.KnowledgeBaseId = &v - return s -} - -// SetLanguage sets the Language field's value. -func (s *QuickResponseData) SetLanguage(v string) *QuickResponseData { - s.Language = &v - return s -} - -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *QuickResponseData) SetLastModifiedBy(v string) *QuickResponseData { - s.LastModifiedBy = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *QuickResponseData) SetLastModifiedTime(v time.Time) *QuickResponseData { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *QuickResponseData) SetName(v string) *QuickResponseData { - s.Name = &v - return s -} - -// SetQuickResponseArn sets the QuickResponseArn field's value. -func (s *QuickResponseData) SetQuickResponseArn(v string) *QuickResponseData { - s.QuickResponseArn = &v - return s -} - -// SetQuickResponseId sets the QuickResponseId field's value. -func (s *QuickResponseData) SetQuickResponseId(v string) *QuickResponseData { - s.QuickResponseId = &v - return s -} - -// SetShortcutKey sets the ShortcutKey field's value. -func (s *QuickResponseData) SetShortcutKey(v string) *QuickResponseData { - s.ShortcutKey = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *QuickResponseData) SetStatus(v string) *QuickResponseData { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *QuickResponseData) SetTags(v map[string]*string) *QuickResponseData { - s.Tags = v - return s -} - -// The container of quick response data. -type QuickResponseDataProvider struct { - _ struct{} `type:"structure"` - - // The content of the quick response. - // - // Content is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by QuickResponseDataProvider's - // String and GoString methods. - Content *string `locationName:"content" min:"1" type:"string" sensitive:"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 QuickResponseDataProvider) 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 QuickResponseDataProvider) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QuickResponseDataProvider) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QuickResponseDataProvider"} - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *QuickResponseDataProvider) SetContent(v string) *QuickResponseDataProvider { - s.Content = &v - return s -} - -// The quick response fields to filter the quick response query results by. -// -// The following is the list of supported field names. -// -// - name -// -// - description -// -// - shortcutKey -// -// - isActive -// -// - channels -// -// - language -// -// - contentType -// -// - createdTime -// -// - lastModifiedTime -// -// - lastModifiedBy -// -// - groupingConfiguration.criteria -// -// - groupingConfiguration.values -type QuickResponseFilterField struct { - _ struct{} `type:"structure"` - - // Whether to treat null value as a match for the attribute field. - IncludeNoExistence *bool `locationName:"includeNoExistence" type:"boolean"` - - // The name of the attribute field to filter the quick responses by. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The operator to use for filtering. - // - // Operator is a required field - Operator *string `locationName:"operator" type:"string" required:"true" enum:"QuickResponseFilterOperator"` - - // The values of attribute field to filter the quick response by. - Values []*string `locationName:"values" min:"1" type:"list"` -} - -// 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 QuickResponseFilterField) 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 QuickResponseFilterField) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QuickResponseFilterField) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QuickResponseFilterField"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Operator == nil { - invalidParams.Add(request.NewErrParamRequired("Operator")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIncludeNoExistence sets the IncludeNoExistence field's value. -func (s *QuickResponseFilterField) SetIncludeNoExistence(v bool) *QuickResponseFilterField { - s.IncludeNoExistence = &v - return s -} - -// SetName sets the Name field's value. -func (s *QuickResponseFilterField) SetName(v string) *QuickResponseFilterField { - s.Name = &v - return s -} - -// SetOperator sets the Operator field's value. -func (s *QuickResponseFilterField) SetOperator(v string) *QuickResponseFilterField { - s.Operator = &v - return s -} - -// SetValues sets the Values field's value. -func (s *QuickResponseFilterField) SetValues(v []*string) *QuickResponseFilterField { - s.Values = v - return s -} - -// The quick response fields to order the quick response query results by. -// -// The following is the list of supported field names. -// -// - name -// -// - description -// -// - shortcutKey -// -// - isActive -// -// - channels -// -// - language -// -// - contentType -// -// - createdTime -// -// - lastModifiedTime -// -// - lastModifiedBy -// -// - groupingConfiguration.criteria -// -// - groupingConfiguration.values -type QuickResponseOrderField struct { - _ struct{} `type:"structure"` - - // The name of the attribute to order the quick response query results by. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The order at which the quick responses are sorted by. - Order *string `locationName:"order" type:"string" enum:"Order"` -} - -// 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 QuickResponseOrderField) 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 QuickResponseOrderField) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QuickResponseOrderField) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QuickResponseOrderField"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *QuickResponseOrderField) SetName(v string) *QuickResponseOrderField { - s.Name = &v - return s -} - -// SetOrder sets the Order field's value. -func (s *QuickResponseOrderField) SetOrder(v string) *QuickResponseOrderField { - s.Order = &v - return s -} - -// The quick response fields to query quick responses by. -// -// The following is the list of supported field names. -// -// - content -// -// - name -// -// - description -// -// - shortcutKey -type QuickResponseQueryField struct { - _ struct{} `type:"structure"` - - // Whether the query expects only exact matches on the attribute field values. - // The results of the query will only include exact matches if this parameter - // is set to false. - AllowFuzziness *bool `locationName:"allowFuzziness" type:"boolean"` - - // The name of the attribute to query the quick responses by. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The operator to use for matching attribute field values in the query. - // - // Operator is a required field - Operator *string `locationName:"operator" type:"string" required:"true" enum:"QuickResponseQueryOperator"` - - // The importance of the attribute field when calculating query result relevancy - // scores. The value set for this parameter affects the ordering of search results. - Priority *string `locationName:"priority" type:"string" enum:"Priority"` - - // The values of the attribute to query the quick responses by. - // - // Values is a required field - Values []*string `locationName:"values" min:"1" type:"list" 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 QuickResponseQueryField) 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 QuickResponseQueryField) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QuickResponseQueryField) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QuickResponseQueryField"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Operator == nil { - invalidParams.Add(request.NewErrParamRequired("Operator")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowFuzziness sets the AllowFuzziness field's value. -func (s *QuickResponseQueryField) SetAllowFuzziness(v bool) *QuickResponseQueryField { - s.AllowFuzziness = &v - return s -} - -// SetName sets the Name field's value. -func (s *QuickResponseQueryField) SetName(v string) *QuickResponseQueryField { - s.Name = &v - return s -} - -// SetOperator sets the Operator field's value. -func (s *QuickResponseQueryField) SetOperator(v string) *QuickResponseQueryField { - s.Operator = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *QuickResponseQueryField) SetPriority(v string) *QuickResponseQueryField { - s.Priority = &v - return s -} - -// SetValues sets the Values field's value. -func (s *QuickResponseQueryField) SetValues(v []*string) *QuickResponseQueryField { - s.Values = v - return s -} - -// Information about the import job. -type QuickResponseSearchExpression struct { - _ struct{} `type:"structure"` - - // The configuration of filtering rules applied to quick response query results. - Filters []*QuickResponseFilterField `locationName:"filters" type:"list"` - - // The quick response attribute fields on which the query results are ordered. - OrderOnField *QuickResponseOrderField `locationName:"orderOnField" type:"structure"` - - // The quick response query expressions. - Queries []*QuickResponseQueryField `locationName:"queries" type:"list"` -} - -// 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 QuickResponseSearchExpression) 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 QuickResponseSearchExpression) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QuickResponseSearchExpression) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QuickResponseSearchExpression"} - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OrderOnField != nil { - if err := s.OrderOnField.Validate(); err != nil { - invalidParams.AddNested("OrderOnField", err.(request.ErrInvalidParams)) - } - } - if s.Queries != nil { - for i, v := range s.Queries { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Queries", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *QuickResponseSearchExpression) SetFilters(v []*QuickResponseFilterField) *QuickResponseSearchExpression { - s.Filters = v - return s -} - -// SetOrderOnField sets the OrderOnField field's value. -func (s *QuickResponseSearchExpression) SetOrderOnField(v *QuickResponseOrderField) *QuickResponseSearchExpression { - s.OrderOnField = v - return s -} - -// SetQueries sets the Queries field's value. -func (s *QuickResponseSearchExpression) SetQueries(v []*QuickResponseQueryField) *QuickResponseSearchExpression { - s.Queries = v - return s -} - -// The result of quick response search. -type QuickResponseSearchResultData struct { - _ struct{} `type:"structure"` - - // The user defined contact attributes that are resolved when the search result - // is returned. - // - // AttributesInterpolated is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by QuickResponseSearchResultData's - // String and GoString methods. - AttributesInterpolated []*string `locationName:"attributesInterpolated" type:"list" sensitive:"true"` - - // The user defined contact attributes that are not resolved when the search - // result is returned. - // - // AttributesNotInterpolated is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by QuickResponseSearchResultData's - // String and GoString methods. - AttributesNotInterpolated []*string `locationName:"attributesNotInterpolated" type:"list" sensitive:"true"` - - // The Amazon Connect contact channels this quick response applies to. The supported - // contact channel types include Chat. - Channels []*string `locationName:"channels" type:"list"` - - // The media type of the quick response content. - // - // * Use application/x.quickresponse;format=plain for quick response written - // in plain text. - // - // * Use application/x.quickresponse;format=markdown for quick response written - // in richtext. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true"` - - // The contents of the quick response. - // - // Contents is a required field - Contents *QuickResponseContents `locationName:"contents" type:"structure" required:"true"` - - // The timestamp when the quick response was created. - // - // CreatedTime is a required field - CreatedTime *time.Time `locationName:"createdTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The description of the quick response. - Description *string `locationName:"description" min:"1" type:"string"` - - // The configuration information of the user groups that the quick response - // is accessible to. - GroupingConfiguration *GroupingConfiguration `locationName:"groupingConfiguration" type:"structure"` - - // Whether the quick response is active. - // - // IsActive is a required field - IsActive *bool `locationName:"isActive" type:"boolean" required:"true"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The language code value for the language in which the quick response is written. - Language *string `locationName:"language" min:"2" type:"string"` - - // The Amazon Resource Name (ARN) of the user who last updated the quick response - // search result data. - LastModifiedBy *string `locationName:"lastModifiedBy" min:"1" type:"string"` - - // The timestamp when the quick response search result data was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The name of the quick response. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the quick response. - // - // QuickResponseArn is a required field - QuickResponseArn *string `locationName:"quickResponseArn" type:"string" required:"true"` - - // The identifier of the quick response. - // - // QuickResponseId is a required field - QuickResponseId *string `locationName:"quickResponseId" type:"string" required:"true"` - - // The shortcut key of the quick response. The value should be unique across - // the knowledge base. - ShortcutKey *string `locationName:"shortcutKey" min:"1" type:"string"` - - // The resource status of the quick response. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"QuickResponseStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 QuickResponseSearchResultData) 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 QuickResponseSearchResultData) GoString() string { - return s.String() -} - -// SetAttributesInterpolated sets the AttributesInterpolated field's value. -func (s *QuickResponseSearchResultData) SetAttributesInterpolated(v []*string) *QuickResponseSearchResultData { - s.AttributesInterpolated = v - return s -} - -// SetAttributesNotInterpolated sets the AttributesNotInterpolated field's value. -func (s *QuickResponseSearchResultData) SetAttributesNotInterpolated(v []*string) *QuickResponseSearchResultData { - s.AttributesNotInterpolated = v - return s -} - -// SetChannels sets the Channels field's value. -func (s *QuickResponseSearchResultData) SetChannels(v []*string) *QuickResponseSearchResultData { - s.Channels = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *QuickResponseSearchResultData) SetContentType(v string) *QuickResponseSearchResultData { - s.ContentType = &v - return s -} - -// SetContents sets the Contents field's value. -func (s *QuickResponseSearchResultData) SetContents(v *QuickResponseContents) *QuickResponseSearchResultData { - s.Contents = v - return s -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *QuickResponseSearchResultData) SetCreatedTime(v time.Time) *QuickResponseSearchResultData { - s.CreatedTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *QuickResponseSearchResultData) SetDescription(v string) *QuickResponseSearchResultData { - s.Description = &v - return s -} - -// SetGroupingConfiguration sets the GroupingConfiguration field's value. -func (s *QuickResponseSearchResultData) SetGroupingConfiguration(v *GroupingConfiguration) *QuickResponseSearchResultData { - s.GroupingConfiguration = v - return s -} - -// SetIsActive sets the IsActive field's value. -func (s *QuickResponseSearchResultData) SetIsActive(v bool) *QuickResponseSearchResultData { - s.IsActive = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *QuickResponseSearchResultData) SetKnowledgeBaseArn(v string) *QuickResponseSearchResultData { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *QuickResponseSearchResultData) SetKnowledgeBaseId(v string) *QuickResponseSearchResultData { - s.KnowledgeBaseId = &v - return s -} - -// SetLanguage sets the Language field's value. -func (s *QuickResponseSearchResultData) SetLanguage(v string) *QuickResponseSearchResultData { - s.Language = &v - return s -} - -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *QuickResponseSearchResultData) SetLastModifiedBy(v string) *QuickResponseSearchResultData { - s.LastModifiedBy = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *QuickResponseSearchResultData) SetLastModifiedTime(v time.Time) *QuickResponseSearchResultData { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *QuickResponseSearchResultData) SetName(v string) *QuickResponseSearchResultData { - s.Name = &v - return s -} - -// SetQuickResponseArn sets the QuickResponseArn field's value. -func (s *QuickResponseSearchResultData) SetQuickResponseArn(v string) *QuickResponseSearchResultData { - s.QuickResponseArn = &v - return s -} - -// SetQuickResponseId sets the QuickResponseId field's value. -func (s *QuickResponseSearchResultData) SetQuickResponseId(v string) *QuickResponseSearchResultData { - s.QuickResponseId = &v - return s -} - -// SetShortcutKey sets the ShortcutKey field's value. -func (s *QuickResponseSearchResultData) SetShortcutKey(v string) *QuickResponseSearchResultData { - s.ShortcutKey = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *QuickResponseSearchResultData) SetStatus(v string) *QuickResponseSearchResultData { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *QuickResponseSearchResultData) SetTags(v map[string]*string) *QuickResponseSearchResultData { - s.Tags = v - return s -} - -// The summary information about the quick response. -type QuickResponseSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Connect contact channels this quick response applies to. The supported - // contact channel types include Chat. - Channels []*string `locationName:"channels" type:"list"` - - // The media type of the quick response content. - // - // * Use application/x.quickresponse;format=plain for quick response written - // in plain text. - // - // * Use application/x.quickresponse;format=markdown for quick response written - // in richtext. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true"` - - // The timestamp when the quick response was created. - // - // CreatedTime is a required field - CreatedTime *time.Time `locationName:"createdTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The description of the quick response. - Description *string `locationName:"description" min:"1" type:"string"` - - // Whether the quick response is active. - IsActive *bool `locationName:"isActive" type:"boolean"` - - // The Amazon Resource Name (ARN) of the knowledge base. - // - // KnowledgeBaseArn is a required field - KnowledgeBaseArn *string `locationName:"knowledgeBaseArn" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the user who last updated the quick response - // data. - LastModifiedBy *string `locationName:"lastModifiedBy" min:"1" type:"string"` - - // The timestamp when the quick response summary was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `locationName:"lastModifiedTime" type:"timestamp" timestampFormat:"unixTimestamp" required:"true"` - - // The name of the quick response. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the quick response. - // - // QuickResponseArn is a required field - QuickResponseArn *string `locationName:"quickResponseArn" type:"string" required:"true"` - - // The identifier of the quick response. - // - // QuickResponseId is a required field - QuickResponseId *string `locationName:"quickResponseId" type:"string" required:"true"` - - // The resource status of the quick response. - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"QuickResponseStatus"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 QuickResponseSummary) 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 QuickResponseSummary) GoString() string { - return s.String() -} - -// SetChannels sets the Channels field's value. -func (s *QuickResponseSummary) SetChannels(v []*string) *QuickResponseSummary { - s.Channels = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *QuickResponseSummary) SetContentType(v string) *QuickResponseSummary { - s.ContentType = &v - return s -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *QuickResponseSummary) SetCreatedTime(v time.Time) *QuickResponseSummary { - s.CreatedTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *QuickResponseSummary) SetDescription(v string) *QuickResponseSummary { - s.Description = &v - return s -} - -// SetIsActive sets the IsActive field's value. -func (s *QuickResponseSummary) SetIsActive(v bool) *QuickResponseSummary { - s.IsActive = &v - return s -} - -// SetKnowledgeBaseArn sets the KnowledgeBaseArn field's value. -func (s *QuickResponseSummary) SetKnowledgeBaseArn(v string) *QuickResponseSummary { - s.KnowledgeBaseArn = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *QuickResponseSummary) SetKnowledgeBaseId(v string) *QuickResponseSummary { - s.KnowledgeBaseId = &v - return s -} - -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *QuickResponseSummary) SetLastModifiedBy(v string) *QuickResponseSummary { - s.LastModifiedBy = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *QuickResponseSummary) SetLastModifiedTime(v time.Time) *QuickResponseSummary { - s.LastModifiedTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *QuickResponseSummary) SetName(v string) *QuickResponseSummary { - s.Name = &v - return s -} - -// SetQuickResponseArn sets the QuickResponseArn field's value. -func (s *QuickResponseSummary) SetQuickResponseArn(v string) *QuickResponseSummary { - s.QuickResponseArn = &v - return s -} - -// SetQuickResponseId sets the QuickResponseId field's value. -func (s *QuickResponseSummary) SetQuickResponseId(v string) *QuickResponseSummary { - s.QuickResponseId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *QuickResponseSummary) SetStatus(v string) *QuickResponseSummary { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *QuickResponseSummary) SetTags(v map[string]*string) *QuickResponseSummary { - s.Tags = v - return s -} - -// Details about the source content ranking data. -type RankingData struct { - _ struct{} `type:"structure"` - - // The relevance score of the content. - RelevanceLevel *string `locationName:"relevanceLevel" type:"string" enum:"RelevanceLevel"` - - // The relevance level of the recommendation. - RelevanceScore *float64 `locationName:"relevanceScore" type:"double"` -} - -// 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 RankingData) 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 RankingData) GoString() string { - return s.String() -} - -// SetRelevanceLevel sets the RelevanceLevel field's value. -func (s *RankingData) SetRelevanceLevel(v string) *RankingData { - s.RelevanceLevel = &v - return s -} - -// SetRelevanceScore sets the RelevanceScore field's value. -func (s *RankingData) SetRelevanceScore(v float64) *RankingData { - s.RelevanceScore = &v - return s -} - -// Information about the recommendation. -type RecommendationData struct { - _ struct{} `type:"structure"` - - // Summary of the recommended content. - Data *DataSummary `locationName:"data" type:"structure"` - - // The recommended document. - Document *Document `locationName:"document" type:"structure"` - - // The identifier of the recommendation. - // - // RecommendationId is a required field - RecommendationId *string `locationName:"recommendationId" min:"1" type:"string" required:"true"` - - // The relevance level of the recommendation. - RelevanceLevel *string `locationName:"relevanceLevel" type:"string" enum:"RelevanceLevel"` - - // The relevance score of the recommendation. - RelevanceScore *float64 `locationName:"relevanceScore" type:"double"` - - // The type of recommendation. - Type *string `locationName:"type" type:"string" enum:"RecommendationType"` -} - -// 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 RecommendationData) 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 RecommendationData) GoString() string { - return s.String() -} - -// SetData sets the Data field's value. -func (s *RecommendationData) SetData(v *DataSummary) *RecommendationData { - s.Data = v - return s -} - -// SetDocument sets the Document field's value. -func (s *RecommendationData) SetDocument(v *Document) *RecommendationData { - s.Document = v - return s -} - -// SetRecommendationId sets the RecommendationId field's value. -func (s *RecommendationData) SetRecommendationId(v string) *RecommendationData { - s.RecommendationId = &v - return s -} - -// SetRelevanceLevel sets the RelevanceLevel field's value. -func (s *RecommendationData) SetRelevanceLevel(v string) *RecommendationData { - s.RelevanceLevel = &v - return s -} - -// SetRelevanceScore sets the RelevanceScore field's value. -func (s *RecommendationData) SetRelevanceScore(v float64) *RecommendationData { - s.RelevanceScore = &v - return s -} - -// SetType sets the Type field's value. -func (s *RecommendationData) SetType(v string) *RecommendationData { - s.Type = &v - return s -} - -// A recommendation trigger provides context on the event that produced the -// referenced recommendations. Recommendations are only referenced in recommendationIds -// by a single RecommendationTrigger. -type RecommendationTrigger struct { - _ struct{} `type:"structure"` - - // A union type containing information related to the trigger. - // - // Data is a required field - Data *RecommendationTriggerData `locationName:"data" type:"structure" required:"true"` - - // The identifier of the recommendation trigger. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The identifiers of the recommendations. - // - // RecommendationIds is a required field - RecommendationIds []*string `locationName:"recommendationIds" type:"list" required:"true"` - - // The source of the recommendation trigger. - // - // * ISSUE_DETECTION: The corresponding recommendations were triggered by - // a Contact Lens issue. - // - // * RULE_EVALUATION: The corresponding recommendations were triggered by - // a Contact Lens rule. - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true" enum:"RecommendationSourceType"` - - // The type of recommendation trigger. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RecommendationTriggerType"` -} - -// 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 RecommendationTrigger) 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 RecommendationTrigger) GoString() string { - return s.String() -} - -// SetData sets the Data field's value. -func (s *RecommendationTrigger) SetData(v *RecommendationTriggerData) *RecommendationTrigger { - s.Data = v - return s -} - -// SetId sets the Id field's value. -func (s *RecommendationTrigger) SetId(v string) *RecommendationTrigger { - s.Id = &v - return s -} - -// SetRecommendationIds sets the RecommendationIds field's value. -func (s *RecommendationTrigger) SetRecommendationIds(v []*string) *RecommendationTrigger { - s.RecommendationIds = v - return s -} - -// SetSource sets the Source field's value. -func (s *RecommendationTrigger) SetSource(v string) *RecommendationTrigger { - s.Source = &v - return s -} - -// SetType sets the Type field's value. -func (s *RecommendationTrigger) SetType(v string) *RecommendationTrigger { - s.Type = &v - return s -} - -// A union type containing information related to the trigger. -type RecommendationTriggerData struct { - _ struct{} `type:"structure"` - - // Data associated with the QUERY RecommendationTriggerType. - Query *QueryRecommendationTriggerData `locationName:"query" 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 RecommendationTriggerData) 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 RecommendationTriggerData) GoString() string { - return s.String() -} - -// SetQuery sets the Query field's value. -func (s *RecommendationTriggerData) SetQuery(v *QueryRecommendationTriggerData) *RecommendationTriggerData { - s.Query = v - return s -} - -type RemoveKnowledgeBaseTemplateUriInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" 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 RemoveKnowledgeBaseTemplateUriInput) 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 RemoveKnowledgeBaseTemplateUriInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveKnowledgeBaseTemplateUriInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveKnowledgeBaseTemplateUriInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *RemoveKnowledgeBaseTemplateUriInput) SetKnowledgeBaseId(v string) *RemoveKnowledgeBaseTemplateUriInput { - s.KnowledgeBaseId = &v - return s -} - -type RemoveKnowledgeBaseTemplateUriOutput 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 RemoveKnowledgeBaseTemplateUriOutput) 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 RemoveKnowledgeBaseTemplateUriOutput) GoString() string { - return s.String() -} - -// Information about how to render the content. -type RenderingConfiguration struct { - _ struct{} `type:"structure"` - - // A URI template containing exactly one variable in ${variableName} format. - // This can only be set for EXTERNAL knowledge bases. For Salesforce, ServiceNow, - // and Zendesk, the variable must be one of the following: - // - // * Salesforce: Id, ArticleNumber, VersionNumber, Title, PublishStatus, - // or IsDeleted - // - // * ServiceNow: number, short_description, sys_mod_count, workflow_state, - // or active - // - // * Zendesk: id, title, updated_at, or draft - // - // The variable is replaced with the actual value for a piece of content when - // calling GetContent (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_GetContent.html). - TemplateUri *string `locationName:"templateUri" min:"1" 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 RenderingConfiguration) 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 RenderingConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RenderingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RenderingConfiguration"} - if s.TemplateUri != nil && len(*s.TemplateUri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateUri", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTemplateUri sets the TemplateUri field's value. -func (s *RenderingConfiguration) SetTemplateUri(v string) *RenderingConfiguration { - s.TemplateUri = &v - return s -} - -// The request reached the service more than 15 minutes after the date stamp -// on the request or more than 15 minutes after the request expiration date -// (such as for pre-signed URLs), or the date stamp on the request is more than -// 15 minutes in the future. -type RequestTimeoutException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 RequestTimeoutException) 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 RequestTimeoutException) GoString() string { - return s.String() -} - -func newErrorRequestTimeoutException(v protocol.ResponseMetadata) error { - return &RequestTimeoutException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *RequestTimeoutException) Code() string { - return "RequestTimeoutException" -} - -// Message returns the exception's message. -func (s *RequestTimeoutException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *RequestTimeoutException) OrigErr() error { - return nil -} - -func (s *RequestTimeoutException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *RequestTimeoutException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *RequestTimeoutException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified resource does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The specified resource name. - ResourceName *string `locationName:"resourceName" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about the result. -type ResultData struct { - _ struct{} `type:"structure"` - - // Summary of the recommended content. - Data *DataSummary `locationName:"data" type:"structure"` - - // The document. - Document *Document `locationName:"document" type:"structure"` - - // The relevance score of the results. - RelevanceScore *float64 `locationName:"relevanceScore" type:"double"` - - // The identifier of the result data. - // - // ResultId is a required field - ResultId *string `locationName:"resultId" type:"string" required:"true"` - - // The type of the query result. - Type *string `locationName:"type" type:"string" enum:"QueryResultType"` -} - -// 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 ResultData) 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 ResultData) GoString() string { - return s.String() -} - -// SetData sets the Data field's value. -func (s *ResultData) SetData(v *DataSummary) *ResultData { - s.Data = v - return s -} - -// SetDocument sets the Document field's value. -func (s *ResultData) SetDocument(v *Document) *ResultData { - s.Document = v - return s -} - -// SetRelevanceScore sets the RelevanceScore field's value. -func (s *ResultData) SetRelevanceScore(v float64) *ResultData { - s.RelevanceScore = &v - return s -} - -// SetResultId sets the ResultId field's value. -func (s *ResultData) SetResultId(v string) *ResultData { - s.ResultId = &v - return s -} - -// SetType sets the Type field's value. -func (s *ResultData) SetType(v string) *ResultData { - s.Type = &v - return s -} - -type SearchContentInput struct { - _ struct{} `type:"structure"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The search expression to filter results. - // - // SearchExpression is a required field - SearchExpression *SearchExpression `locationName:"searchExpression" type:"structure" 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 SearchContentInput) 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 SearchContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchContentInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SearchExpression == nil { - invalidParams.Add(request.NewErrParamRequired("SearchExpression")) - } - if s.SearchExpression != nil { - if err := s.SearchExpression.Validate(); err != nil { - invalidParams.AddNested("SearchExpression", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *SearchContentInput) SetKnowledgeBaseId(v string) *SearchContentInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchContentInput) SetMaxResults(v int64) *SearchContentInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchContentInput) SetNextToken(v string) *SearchContentInput { - s.NextToken = &v - return s -} - -// SetSearchExpression sets the SearchExpression field's value. -func (s *SearchContentInput) SetSearchExpression(v *SearchExpression) *SearchContentInput { - s.SearchExpression = v - return s -} - -type SearchContentOutput struct { - _ struct{} `type:"structure"` - - // Summary information about the content. - // - // ContentSummaries is a required field - ContentSummaries []*ContentSummary `locationName:"contentSummaries" type:"list" required:"true"` - - // If there are additional results, this is the token for the next set of results. - NextToken *string `locationName:"nextToken" min:"1" 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 SearchContentOutput) 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 SearchContentOutput) GoString() string { - return s.String() -} - -// SetContentSummaries sets the ContentSummaries field's value. -func (s *SearchContentOutput) SetContentSummaries(v []*ContentSummary) *SearchContentOutput { - s.ContentSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchContentOutput) SetNextToken(v string) *SearchContentOutput { - s.NextToken = &v - return s -} - -// The search expression. -type SearchExpression struct { - _ struct{} `type:"structure"` - - // The search expression filters. - // - // Filters is a required field - Filters []*Filter `locationName:"filters" type:"list" 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 SearchExpression) 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 SearchExpression) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchExpression) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchExpression"} - if s.Filters == nil { - invalidParams.Add(request.NewErrParamRequired("Filters")) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *SearchExpression) SetFilters(v []*Filter) *SearchExpression { - s.Filters = v - return s -} - -type SearchQuickResponsesInput struct { - _ struct{} `type:"structure"` - - // The user-defined Amazon Connect contact attributes (https://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html#user-defined-attributes) - // to be resolved when search results are returned. - // - // Attributes is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchQuickResponsesInput's - // String and GoString methods. - Attributes map[string]*string `locationName:"attributes" type:"map" sensitive:"true"` - - // The identifier of the knowledge base. This should be a QUICK_RESPONSES type - // knowledge base. Can be either the ID or the ARN. URLs cannot contain the - // ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The search expression for querying the quick response. - // - // SearchExpression is a required field - SearchExpression *QuickResponseSearchExpression `locationName:"searchExpression" type:"structure" 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 SearchQuickResponsesInput) 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 SearchQuickResponsesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchQuickResponsesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchQuickResponsesInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SearchExpression == nil { - invalidParams.Add(request.NewErrParamRequired("SearchExpression")) - } - if s.SearchExpression != nil { - if err := s.SearchExpression.Validate(); err != nil { - invalidParams.AddNested("SearchExpression", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *SearchQuickResponsesInput) SetAttributes(v map[string]*string) *SearchQuickResponsesInput { - s.Attributes = v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *SearchQuickResponsesInput) SetKnowledgeBaseId(v string) *SearchQuickResponsesInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchQuickResponsesInput) SetMaxResults(v int64) *SearchQuickResponsesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchQuickResponsesInput) SetNextToken(v string) *SearchQuickResponsesInput { - s.NextToken = &v - return s -} - -// SetSearchExpression sets the SearchExpression field's value. -func (s *SearchQuickResponsesInput) SetSearchExpression(v *QuickResponseSearchExpression) *SearchQuickResponsesInput { - s.SearchExpression = v - return s -} - -type SearchQuickResponsesOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The results of the quick response search. - // - // Results is a required field - Results []*QuickResponseSearchResultData `locationName:"results" type:"list" 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 SearchQuickResponsesOutput) 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 SearchQuickResponsesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchQuickResponsesOutput) SetNextToken(v string) *SearchQuickResponsesOutput { - s.NextToken = &v - return s -} - -// SetResults sets the Results field's value. -func (s *SearchQuickResponsesOutput) SetResults(v []*QuickResponseSearchResultData) *SearchQuickResponsesOutput { - s.Results = v - return s -} - -type SearchSessionsInput struct { - _ struct{} `type:"structure"` - - // The identifier of the Amazon Q assistant. Can be either the ID or the ARN. - // URLs cannot contain the ARN. - // - // AssistantId is a required field - AssistantId *string `location:"uri" locationName:"assistantId" type:"string" required:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The search expression to filter results. - // - // SearchExpression is a required field - SearchExpression *SearchExpression `locationName:"searchExpression" type:"structure" 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 SearchSessionsInput) 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 SearchSessionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchSessionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchSessionsInput"} - if s.AssistantId == nil { - invalidParams.Add(request.NewErrParamRequired("AssistantId")) - } - if s.AssistantId != nil && len(*s.AssistantId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AssistantId", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.SearchExpression == nil { - invalidParams.Add(request.NewErrParamRequired("SearchExpression")) - } - if s.SearchExpression != nil { - if err := s.SearchExpression.Validate(); err != nil { - invalidParams.AddNested("SearchExpression", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssistantId sets the AssistantId field's value. -func (s *SearchSessionsInput) SetAssistantId(v string) *SearchSessionsInput { - s.AssistantId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchSessionsInput) SetMaxResults(v int64) *SearchSessionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchSessionsInput) SetNextToken(v string) *SearchSessionsInput { - s.NextToken = &v - return s -} - -// SetSearchExpression sets the SearchExpression field's value. -func (s *SearchSessionsInput) SetSearchExpression(v *SearchExpression) *SearchSessionsInput { - s.SearchExpression = v - return s -} - -type SearchSessionsOutput struct { - _ struct{} `type:"structure"` - - // If there are additional results, this is the token for the next set of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Summary information about the sessions. - // - // SessionSummaries is a required field - SessionSummaries []*SessionSummary `locationName:"sessionSummaries" type:"list" 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 SearchSessionsOutput) 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 SearchSessionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchSessionsOutput) SetNextToken(v string) *SearchSessionsOutput { - s.NextToken = &v - return s -} - -// SetSessionSummaries sets the SessionSummaries field's value. -func (s *SearchSessionsOutput) SetSessionSummaries(v []*SessionSummary) *SearchSessionsOutput { - s.SessionSummaries = v - return s -} - -// The configuration information for the customer managed key used for encryption. -type ServerSideEncryptionConfiguration struct { - _ struct{} `type:"structure"` - - // The customer managed key used for encryption. For more information about - // setting up a customer managed key for Amazon Q, see Enable Amazon Q in Connect - // for your instance (https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html). - // For information about valid ID values, see Key identifiers (KeyId) (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id). - KmsKeyId *string `locationName:"kmsKeyId" min:"1" 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 ServerSideEncryptionConfiguration) 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 ServerSideEncryptionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ServerSideEncryptionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionConfiguration"} - if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *ServerSideEncryptionConfiguration) SetKmsKeyId(v string) *ServerSideEncryptionConfiguration { - s.KmsKeyId = &v - return s -} - -// You've exceeded your service quota. To perform the requested action, remove -// some of the relevant resources, or use service quotas to request a service -// quota increase. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about the session. -type SessionData struct { - _ struct{} `type:"structure"` - - // The description of the session. - Description *string `locationName:"description" min:"1" type:"string"` - - // The configuration information for the session integration. - IntegrationConfiguration *SessionIntegrationConfiguration `locationName:"integrationConfiguration" type:"structure"` - - // The name of the session. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the session. - // - // SessionArn is a required field - SessionArn *string `locationName:"sessionArn" type:"string" required:"true"` - - // The identifier of the session. - // - // SessionId is a required field - SessionId *string `locationName:"sessionId" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 SessionData) 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 SessionData) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *SessionData) SetDescription(v string) *SessionData { - s.Description = &v - return s -} - -// SetIntegrationConfiguration sets the IntegrationConfiguration field's value. -func (s *SessionData) SetIntegrationConfiguration(v *SessionIntegrationConfiguration) *SessionData { - s.IntegrationConfiguration = v - return s -} - -// SetName sets the Name field's value. -func (s *SessionData) SetName(v string) *SessionData { - s.Name = &v - return s -} - -// SetSessionArn sets the SessionArn field's value. -func (s *SessionData) SetSessionArn(v string) *SessionData { - s.SessionArn = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *SessionData) SetSessionId(v string) *SessionData { - s.SessionId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SessionData) SetTags(v map[string]*string) *SessionData { - s.Tags = v - return s -} - -// The configuration information for the session integration. -type SessionIntegrationConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the integrated Amazon SNS topic used for - // streaming chat messages. - TopicIntegrationArn *string `locationName:"topicIntegrationArn" min:"1" 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 SessionIntegrationConfiguration) 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 SessionIntegrationConfiguration) GoString() string { - return s.String() -} - -// SetTopicIntegrationArn sets the TopicIntegrationArn field's value. -func (s *SessionIntegrationConfiguration) SetTopicIntegrationArn(v string) *SessionIntegrationConfiguration { - s.TopicIntegrationArn = &v - return s -} - -// Summary information about the session. -type SessionSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Q assistant. - // - // AssistantArn is a required field - AssistantArn *string `locationName:"assistantArn" type:"string" required:"true"` - - // The identifier of the Amazon Q assistant. - // - // AssistantId is a required field - AssistantId *string `locationName:"assistantId" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the session. - // - // SessionArn is a required field - SessionArn *string `locationName:"sessionArn" type:"string" required:"true"` - - // The identifier of the session. - // - // SessionId is a required field - SessionId *string `locationName:"sessionId" 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 SessionSummary) 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 SessionSummary) GoString() string { - return s.String() -} - -// SetAssistantArn sets the AssistantArn field's value. -func (s *SessionSummary) SetAssistantArn(v string) *SessionSummary { - s.AssistantArn = &v - return s -} - -// SetAssistantId sets the AssistantId field's value. -func (s *SessionSummary) SetAssistantId(v string) *SessionSummary { - s.AssistantId = &v - return s -} - -// SetSessionArn sets the SessionArn field's value. -func (s *SessionSummary) SetSessionArn(v string) *SessionSummary { - s.SessionArn = &v - return s -} - -// SetSessionId sets the SessionId field's value. -func (s *SessionSummary) SetSessionId(v string) *SessionSummary { - s.SessionId = &v - return s -} - -// Configuration information about the external data source. -type SourceConfiguration struct { - _ struct{} `type:"structure"` - - // Configuration information for Amazon AppIntegrations to automatically ingest - // content. - AppIntegrations *AppIntegrationsConfiguration `locationName:"appIntegrations" 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 SourceConfiguration) 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 SourceConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceConfiguration"} - if s.AppIntegrations != nil { - if err := s.AppIntegrations.Validate(); err != nil { - invalidParams.AddNested("AppIntegrations", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAppIntegrations sets the AppIntegrations field's value. -func (s *SourceConfiguration) SetAppIntegrations(v *AppIntegrationsConfiguration) *SourceConfiguration { - s.AppIntegrations = v - return s -} - -// Details about the source content data. -type SourceContentDataDetails struct { - _ struct{} `type:"structure"` - - // The identifier of the source content. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Details about the source content ranking data. - // - // RankingData is a required field - RankingData *RankingData `locationName:"rankingData" type:"structure" required:"true"` - - // Details about the source content text data. - // - // TextData is a required field - TextData *TextData `locationName:"textData" type:"structure" required:"true"` - - // The type of the source content. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SourceContentType"` -} - -// 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 SourceContentDataDetails) 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 SourceContentDataDetails) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *SourceContentDataDetails) SetId(v string) *SourceContentDataDetails { - s.Id = &v - return s -} - -// SetRankingData sets the RankingData field's value. -func (s *SourceContentDataDetails) SetRankingData(v *RankingData) *SourceContentDataDetails { - s.RankingData = v - return s -} - -// SetTextData sets the TextData field's value. -func (s *SourceContentDataDetails) SetTextData(v *TextData) *SourceContentDataDetails { - s.TextData = v - return s -} - -// SetType sets the Type field's value. -func (s *SourceContentDataDetails) SetType(v string) *SourceContentDataDetails { - s.Type = &v - return s -} - -type StartContentUploadInput struct { - _ struct{} `type:"structure"` - - // The type of content to upload. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The expected expiration time of the generated presigned URL, specified in - // minutes. - PresignedUrlTimeToLive *int64 `locationName:"presignedUrlTimeToLive" min:"1" 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 StartContentUploadInput) 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 StartContentUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartContentUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartContentUploadInput"} - if s.ContentType == nil { - invalidParams.Add(request.NewErrParamRequired("ContentType")) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.PresignedUrlTimeToLive != nil && *s.PresignedUrlTimeToLive < 1 { - invalidParams.Add(request.NewErrParamMinValue("PresignedUrlTimeToLive", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentType sets the ContentType field's value. -func (s *StartContentUploadInput) SetContentType(v string) *StartContentUploadInput { - s.ContentType = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *StartContentUploadInput) SetKnowledgeBaseId(v string) *StartContentUploadInput { - s.KnowledgeBaseId = &v - return s -} - -// SetPresignedUrlTimeToLive sets the PresignedUrlTimeToLive field's value. -func (s *StartContentUploadInput) SetPresignedUrlTimeToLive(v int64) *StartContentUploadInput { - s.PresignedUrlTimeToLive = &v - return s -} - -type StartContentUploadOutput struct { - _ struct{} `type:"structure"` - - // The headers to include in the upload. - // - // HeadersToInclude is a required field - HeadersToInclude map[string]*string `locationName:"headersToInclude" type:"map" required:"true"` - - // The identifier of the upload. - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" min:"1" type:"string" required:"true"` - - // The URL of the upload. - // - // Url is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StartContentUploadOutput's - // String and GoString methods. - // - // Url is a required field - Url *string `locationName:"url" min:"1" type:"string" required:"true" sensitive:"true"` - - // The expiration time of the URL as an epoch timestamp. - // - // UrlExpiry is a required field - UrlExpiry *time.Time `locationName:"urlExpiry" type:"timestamp" timestampFormat:"unixTimestamp" 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 StartContentUploadOutput) 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 StartContentUploadOutput) GoString() string { - return s.String() -} - -// SetHeadersToInclude sets the HeadersToInclude field's value. -func (s *StartContentUploadOutput) SetHeadersToInclude(v map[string]*string) *StartContentUploadOutput { - s.HeadersToInclude = v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *StartContentUploadOutput) SetUploadId(v string) *StartContentUploadOutput { - s.UploadId = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *StartContentUploadOutput) SetUrl(v string) *StartContentUploadOutput { - s.Url = &v - return s -} - -// SetUrlExpiry sets the UrlExpiry field's value. -func (s *StartContentUploadOutput) SetUrlExpiry(v time.Time) *StartContentUploadOutput { - s.UrlExpiry = &v - return s -} - -type StartImportJobInput struct { - _ struct{} `type:"structure"` - - // The tags used to organize, track, or control access for this resource. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The configuration information of the external source that the resource data - // are imported from. - ExternalSourceConfiguration *ExternalSourceConfiguration `locationName:"externalSourceConfiguration" type:"structure"` - - // The type of the import job. - // - // * For importing quick response resource, set the value to QUICK_RESPONSES. - // - // ImportJobType is a required field - ImportJobType *string `locationName:"importJobType" type:"string" required:"true" enum:"ImportJobType"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // * For importing Amazon Q quick responses, this should be a QUICK_RESPONSES - // type knowledge base. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The metadata fields of the imported Amazon Q resources. - Metadata map[string]*string `locationName:"metadata" type:"map"` - - // A pointer to the uploaded asset. This value is returned by StartContentUpload - // (https://docs.aws.amazon.com/wisdom/latest/APIReference/API_StartContentUpload.html). - // - // UploadId is a required field - UploadId *string `locationName:"uploadId" min:"1" 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 StartImportJobInput) 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 StartImportJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartImportJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ImportJobType == nil { - invalidParams.Add(request.NewErrParamRequired("ImportJobType")) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - if s.UploadId != nil && len(*s.UploadId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 1)) - } - if s.ExternalSourceConfiguration != nil { - if err := s.ExternalSourceConfiguration.Validate(); err != nil { - invalidParams.AddNested("ExternalSourceConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartImportJobInput) SetClientToken(v string) *StartImportJobInput { - s.ClientToken = &v - return s -} - -// SetExternalSourceConfiguration sets the ExternalSourceConfiguration field's value. -func (s *StartImportJobInput) SetExternalSourceConfiguration(v *ExternalSourceConfiguration) *StartImportJobInput { - s.ExternalSourceConfiguration = v - return s -} - -// SetImportJobType sets the ImportJobType field's value. -func (s *StartImportJobInput) SetImportJobType(v string) *StartImportJobInput { - s.ImportJobType = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *StartImportJobInput) SetKnowledgeBaseId(v string) *StartImportJobInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *StartImportJobInput) SetMetadata(v map[string]*string) *StartImportJobInput { - s.Metadata = v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *StartImportJobInput) SetUploadId(v string) *StartImportJobInput { - s.UploadId = &v - return s -} - -type StartImportJobOutput struct { - _ struct{} `type:"structure"` - - // The import job. - ImportJob *ImportJobData `locationName:"importJob" 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 StartImportJobOutput) 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 StartImportJobOutput) GoString() string { - return s.String() -} - -// SetImportJob sets the ImportJob field's value. -func (s *StartImportJobOutput) SetImportJob(v *ImportJobData) *StartImportJobOutput { - s.ImportJob = v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tags used to organize, track, or control access for this resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Details about the source content text data. -type TextData struct { - _ struct{} `type:"structure"` - - // The text of the document. - Excerpt *DocumentText `locationName:"excerpt" type:"structure"` - - // The text of the document. - Title *DocumentText `locationName:"title" 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 TextData) 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 TextData) GoString() string { - return s.String() -} - -// SetExcerpt sets the Excerpt field's value. -func (s *TextData) SetExcerpt(v *DocumentText) *TextData { - s.Excerpt = v - return s -} - -// SetTitle sets the Title field's value. -func (s *TextData) SetTitle(v *DocumentText) *TextData { - s.Title = v - return s -} - -// Amazon Q in Connect throws this exception if you have too many tags in your -// tag set. -type TooManyTagsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The specified resource name. - ResourceName *string `locationName:"resourceName" 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 TooManyTagsException) 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 TooManyTagsException) GoString() string { - return s.String() -} - -func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { - return &TooManyTagsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyTagsException) Code() string { - return "TooManyTagsException" -} - -// Message returns the exception's message. -func (s *TooManyTagsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyTagsException) OrigErr() error { - return nil -} - -func (s *TooManyTagsException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyTagsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyTagsException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tag keys. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateContentInput struct { - _ struct{} `type:"structure"` - - // The identifier of the content. Can be either the ID or the ARN. URLs cannot - // contain the ARN. - // - // ContentId is a required field - ContentId *string `location:"uri" locationName:"contentId" type:"string" required:"true"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // A key/value map to store attributes without affecting tagging or recommendations. - // For example, when synchronizing data between an external system and Amazon - // Q, you can store an external version identifier as metadata to utilize for - // determining drift. - Metadata map[string]*string `locationName:"metadata" type:"map"` - - // The URI for the article. If the knowledge base has a templateUri, setting - // this argument overrides it for this piece of content. To remove an existing - // overrideLinkOurUri, exclude this argument and set removeOverrideLinkOutUri - // to true. - OverrideLinkOutUri *string `locationName:"overrideLinkOutUri" min:"1" type:"string"` - - // Unset the existing overrideLinkOutUri if it exists. - RemoveOverrideLinkOutUri *bool `locationName:"removeOverrideLinkOutUri" type:"boolean"` - - // The revisionId of the content resource to update, taken from an earlier call - // to GetContent, GetContentSummary, SearchContent, or ListContents. If included, - // this argument acts as an optimistic lock to ensure content was not modified - // since it was last read. If it has been modified, this API throws a PreconditionFailedException. - RevisionId *string `locationName:"revisionId" min:"1" type:"string"` - - // The title of the content. - Title *string `locationName:"title" min:"1" type:"string"` - - // A pointer to the uploaded asset. This value is returned by StartContentUpload - // (https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_StartContentUpload.html). - UploadId *string `locationName:"uploadId" min:"1" 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 UpdateContentInput) 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 UpdateContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateContentInput"} - if s.ContentId == nil { - invalidParams.Add(request.NewErrParamRequired("ContentId")) - } - if s.ContentId != nil && len(*s.ContentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ContentId", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.OverrideLinkOutUri != nil && len(*s.OverrideLinkOutUri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OverrideLinkOutUri", 1)) - } - if s.RevisionId != nil && len(*s.RevisionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RevisionId", 1)) - } - if s.Title != nil && len(*s.Title) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Title", 1)) - } - if s.UploadId != nil && len(*s.UploadId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UploadId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentId sets the ContentId field's value. -func (s *UpdateContentInput) SetContentId(v string) *UpdateContentInput { - s.ContentId = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *UpdateContentInput) SetKnowledgeBaseId(v string) *UpdateContentInput { - s.KnowledgeBaseId = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *UpdateContentInput) SetMetadata(v map[string]*string) *UpdateContentInput { - s.Metadata = v - return s -} - -// SetOverrideLinkOutUri sets the OverrideLinkOutUri field's value. -func (s *UpdateContentInput) SetOverrideLinkOutUri(v string) *UpdateContentInput { - s.OverrideLinkOutUri = &v - return s -} - -// SetRemoveOverrideLinkOutUri sets the RemoveOverrideLinkOutUri field's value. -func (s *UpdateContentInput) SetRemoveOverrideLinkOutUri(v bool) *UpdateContentInput { - s.RemoveOverrideLinkOutUri = &v - return s -} - -// SetRevisionId sets the RevisionId field's value. -func (s *UpdateContentInput) SetRevisionId(v string) *UpdateContentInput { - s.RevisionId = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *UpdateContentInput) SetTitle(v string) *UpdateContentInput { - s.Title = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UpdateContentInput) SetUploadId(v string) *UpdateContentInput { - s.UploadId = &v - return s -} - -type UpdateContentOutput struct { - _ struct{} `type:"structure"` - - // The content. - Content *ContentData `locationName:"content" 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 UpdateContentOutput) 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 UpdateContentOutput) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *UpdateContentOutput) SetContent(v *ContentData) *UpdateContentOutput { - s.Content = v - return s -} - -type UpdateKnowledgeBaseTemplateUriInput struct { - _ struct{} `type:"structure"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The template URI to update. - // - // TemplateUri is a required field - TemplateUri *string `locationName:"templateUri" min:"1" 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 UpdateKnowledgeBaseTemplateUriInput) 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 UpdateKnowledgeBaseTemplateUriInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateKnowledgeBaseTemplateUriInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateKnowledgeBaseTemplateUriInput"} - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.TemplateUri == nil { - invalidParams.Add(request.NewErrParamRequired("TemplateUri")) - } - if s.TemplateUri != nil && len(*s.TemplateUri) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TemplateUri", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *UpdateKnowledgeBaseTemplateUriInput) SetKnowledgeBaseId(v string) *UpdateKnowledgeBaseTemplateUriInput { - s.KnowledgeBaseId = &v - return s -} - -// SetTemplateUri sets the TemplateUri field's value. -func (s *UpdateKnowledgeBaseTemplateUriInput) SetTemplateUri(v string) *UpdateKnowledgeBaseTemplateUriInput { - s.TemplateUri = &v - return s -} - -type UpdateKnowledgeBaseTemplateUriOutput struct { - _ struct{} `type:"structure"` - - // The knowledge base to update. - KnowledgeBase *KnowledgeBaseData `locationName:"knowledgeBase" 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 UpdateKnowledgeBaseTemplateUriOutput) 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 UpdateKnowledgeBaseTemplateUriOutput) GoString() string { - return s.String() -} - -// SetKnowledgeBase sets the KnowledgeBase field's value. -func (s *UpdateKnowledgeBaseTemplateUriOutput) SetKnowledgeBase(v *KnowledgeBaseData) *UpdateKnowledgeBaseTemplateUriOutput { - s.KnowledgeBase = v - return s -} - -type UpdateQuickResponseInput struct { - _ struct{} `type:"structure"` - - // The Amazon Connect contact channels this quick response applies to. The supported - // contact channel types include Chat. - Channels []*string `locationName:"channels" type:"list"` - - // The updated content of the quick response. - Content *QuickResponseDataProvider `locationName:"content" type:"structure"` - - // The media type of the quick response content. - // - // * Use application/x.quickresponse;format=plain for quick response written - // in plain text. - // - // * Use application/x.quickresponse;format=markdown for quick response written - // in richtext. - ContentType *string `locationName:"contentType" type:"string"` - - // The updated description of the quick response. - Description *string `locationName:"description" min:"1" type:"string"` - - // The updated grouping configuration of the quick response. - GroupingConfiguration *GroupingConfiguration `locationName:"groupingConfiguration" type:"structure"` - - // Whether the quick response is active. - IsActive *bool `locationName:"isActive" type:"boolean"` - - // The identifier of the knowledge base. This should not be a QUICK_RESPONSES - // type knowledge base if you're storing Amazon Q Content resource to it. Can - // be either the ID or the ARN. URLs cannot contain the ARN. - // - // KnowledgeBaseId is a required field - KnowledgeBaseId *string `location:"uri" locationName:"knowledgeBaseId" type:"string" required:"true"` - - // The language code value for the language in which the quick response is written. - // The supported language codes include de_DE, en_US, es_ES, fr_FR, id_ID, it_IT, - // ja_JP, ko_KR, pt_BR, zh_CN, zh_TW - Language *string `locationName:"language" min:"2" type:"string"` - - // The name of the quick response. - Name *string `locationName:"name" min:"1" type:"string"` - - // The identifier of the quick response. - // - // QuickResponseId is a required field - QuickResponseId *string `location:"uri" locationName:"quickResponseId" type:"string" required:"true"` - - // Whether to remove the description from the quick response. - RemoveDescription *bool `locationName:"removeDescription" type:"boolean"` - - // Whether to remove the grouping configuration of the quick response. - RemoveGroupingConfiguration *bool `locationName:"removeGroupingConfiguration" type:"boolean"` - - // Whether to remove the shortcut key of the quick response. - RemoveShortcutKey *bool `locationName:"removeShortcutKey" type:"boolean"` - - // The shortcut key of the quick response. The value should be unique across - // the knowledge base. - ShortcutKey *string `locationName:"shortcutKey" min:"1" 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 UpdateQuickResponseInput) 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 UpdateQuickResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateQuickResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateQuickResponseInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.KnowledgeBaseId == nil { - invalidParams.Add(request.NewErrParamRequired("KnowledgeBaseId")) - } - if s.KnowledgeBaseId != nil && len(*s.KnowledgeBaseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KnowledgeBaseId", 1)) - } - if s.Language != nil && len(*s.Language) < 2 { - invalidParams.Add(request.NewErrParamMinLen("Language", 2)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.QuickResponseId == nil { - invalidParams.Add(request.NewErrParamRequired("QuickResponseId")) - } - if s.QuickResponseId != nil && len(*s.QuickResponseId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QuickResponseId", 1)) - } - if s.ShortcutKey != nil && len(*s.ShortcutKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ShortcutKey", 1)) - } - if s.Content != nil { - if err := s.Content.Validate(); err != nil { - invalidParams.AddNested("Content", err.(request.ErrInvalidParams)) - } - } - if s.GroupingConfiguration != nil { - if err := s.GroupingConfiguration.Validate(); err != nil { - invalidParams.AddNested("GroupingConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannels sets the Channels field's value. -func (s *UpdateQuickResponseInput) SetChannels(v []*string) *UpdateQuickResponseInput { - s.Channels = v - return s -} - -// SetContent sets the Content field's value. -func (s *UpdateQuickResponseInput) SetContent(v *QuickResponseDataProvider) *UpdateQuickResponseInput { - s.Content = v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *UpdateQuickResponseInput) SetContentType(v string) *UpdateQuickResponseInput { - s.ContentType = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateQuickResponseInput) SetDescription(v string) *UpdateQuickResponseInput { - s.Description = &v - return s -} - -// SetGroupingConfiguration sets the GroupingConfiguration field's value. -func (s *UpdateQuickResponseInput) SetGroupingConfiguration(v *GroupingConfiguration) *UpdateQuickResponseInput { - s.GroupingConfiguration = v - return s -} - -// SetIsActive sets the IsActive field's value. -func (s *UpdateQuickResponseInput) SetIsActive(v bool) *UpdateQuickResponseInput { - s.IsActive = &v - return s -} - -// SetKnowledgeBaseId sets the KnowledgeBaseId field's value. -func (s *UpdateQuickResponseInput) SetKnowledgeBaseId(v string) *UpdateQuickResponseInput { - s.KnowledgeBaseId = &v - return s -} - -// SetLanguage sets the Language field's value. -func (s *UpdateQuickResponseInput) SetLanguage(v string) *UpdateQuickResponseInput { - s.Language = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateQuickResponseInput) SetName(v string) *UpdateQuickResponseInput { - s.Name = &v - return s -} - -// SetQuickResponseId sets the QuickResponseId field's value. -func (s *UpdateQuickResponseInput) SetQuickResponseId(v string) *UpdateQuickResponseInput { - s.QuickResponseId = &v - return s -} - -// SetRemoveDescription sets the RemoveDescription field's value. -func (s *UpdateQuickResponseInput) SetRemoveDescription(v bool) *UpdateQuickResponseInput { - s.RemoveDescription = &v - return s -} - -// SetRemoveGroupingConfiguration sets the RemoveGroupingConfiguration field's value. -func (s *UpdateQuickResponseInput) SetRemoveGroupingConfiguration(v bool) *UpdateQuickResponseInput { - s.RemoveGroupingConfiguration = &v - return s -} - -// SetRemoveShortcutKey sets the RemoveShortcutKey field's value. -func (s *UpdateQuickResponseInput) SetRemoveShortcutKey(v bool) *UpdateQuickResponseInput { - s.RemoveShortcutKey = &v - return s -} - -// SetShortcutKey sets the ShortcutKey field's value. -func (s *UpdateQuickResponseInput) SetShortcutKey(v string) *UpdateQuickResponseInput { - s.ShortcutKey = &v - return s -} - -type UpdateQuickResponseOutput struct { - _ struct{} `type:"structure"` - - // The quick response. - QuickResponse *QuickResponseData `locationName:"quickResponse" 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 UpdateQuickResponseOutput) 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 UpdateQuickResponseOutput) GoString() string { - return s.String() -} - -// SetQuickResponse sets the QuickResponse field's value. -func (s *UpdateQuickResponseOutput) SetQuickResponse(v *QuickResponseData) *UpdateQuickResponseOutput { - s.QuickResponse = v - return s -} - -// The input fails to satisfy the constraints specified by a service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // AssistantCapabilityTypeV1 is a AssistantCapabilityType enum value - AssistantCapabilityTypeV1 = "V1" - - // AssistantCapabilityTypeV2 is a AssistantCapabilityType enum value - AssistantCapabilityTypeV2 = "V2" -) - -// AssistantCapabilityType_Values returns all elements of the AssistantCapabilityType enum -func AssistantCapabilityType_Values() []string { - return []string{ - AssistantCapabilityTypeV1, - AssistantCapabilityTypeV2, - } -} - -const ( - // AssistantStatusCreateInProgress is a AssistantStatus enum value - AssistantStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // AssistantStatusCreateFailed is a AssistantStatus enum value - AssistantStatusCreateFailed = "CREATE_FAILED" - - // AssistantStatusActive is a AssistantStatus enum value - AssistantStatusActive = "ACTIVE" - - // AssistantStatusDeleteInProgress is a AssistantStatus enum value - AssistantStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // AssistantStatusDeleteFailed is a AssistantStatus enum value - AssistantStatusDeleteFailed = "DELETE_FAILED" - - // AssistantStatusDeleted is a AssistantStatus enum value - AssistantStatusDeleted = "DELETED" -) - -// AssistantStatus_Values returns all elements of the AssistantStatus enum -func AssistantStatus_Values() []string { - return []string{ - AssistantStatusCreateInProgress, - AssistantStatusCreateFailed, - AssistantStatusActive, - AssistantStatusDeleteInProgress, - AssistantStatusDeleteFailed, - AssistantStatusDeleted, - } -} - -const ( - // AssistantTypeAgent is a AssistantType enum value - AssistantTypeAgent = "AGENT" -) - -// AssistantType_Values returns all elements of the AssistantType enum -func AssistantType_Values() []string { - return []string{ - AssistantTypeAgent, - } -} - -const ( - // AssociationTypeKnowledgeBase is a AssociationType enum value - AssociationTypeKnowledgeBase = "KNOWLEDGE_BASE" -) - -// AssociationType_Values returns all elements of the AssociationType enum -func AssociationType_Values() []string { - return []string{ - AssociationTypeKnowledgeBase, - } -} - -const ( - // ContentStatusCreateInProgress is a ContentStatus enum value - ContentStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // ContentStatusCreateFailed is a ContentStatus enum value - ContentStatusCreateFailed = "CREATE_FAILED" - - // ContentStatusActive is a ContentStatus enum value - ContentStatusActive = "ACTIVE" - - // ContentStatusDeleteInProgress is a ContentStatus enum value - ContentStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // ContentStatusDeleteFailed is a ContentStatus enum value - ContentStatusDeleteFailed = "DELETE_FAILED" - - // ContentStatusDeleted is a ContentStatus enum value - ContentStatusDeleted = "DELETED" - - // ContentStatusUpdateFailed is a ContentStatus enum value - ContentStatusUpdateFailed = "UPDATE_FAILED" -) - -// ContentStatus_Values returns all elements of the ContentStatus enum -func ContentStatus_Values() []string { - return []string{ - ContentStatusCreateInProgress, - ContentStatusCreateFailed, - ContentStatusActive, - ContentStatusDeleteInProgress, - ContentStatusDeleteFailed, - ContentStatusDeleted, - ContentStatusUpdateFailed, - } -} - -const ( - // ExternalSourceAmazonConnect is a ExternalSource enum value - ExternalSourceAmazonConnect = "AMAZON_CONNECT" -) - -// ExternalSource_Values returns all elements of the ExternalSource enum -func ExternalSource_Values() []string { - return []string{ - ExternalSourceAmazonConnect, - } -} - -const ( - // FilterFieldName is a FilterField enum value - FilterFieldName = "NAME" -) - -// FilterField_Values returns all elements of the FilterField enum -func FilterField_Values() []string { - return []string{ - FilterFieldName, - } -} - -const ( - // FilterOperatorEquals is a FilterOperator enum value - FilterOperatorEquals = "EQUALS" -) - -// FilterOperator_Values returns all elements of the FilterOperator enum -func FilterOperator_Values() []string { - return []string{ - FilterOperatorEquals, - } -} - -const ( - // ImportJobStatusStartInProgress is a ImportJobStatus enum value - ImportJobStatusStartInProgress = "START_IN_PROGRESS" - - // ImportJobStatusFailed is a ImportJobStatus enum value - ImportJobStatusFailed = "FAILED" - - // ImportJobStatusComplete is a ImportJobStatus enum value - ImportJobStatusComplete = "COMPLETE" - - // ImportJobStatusDeleteInProgress is a ImportJobStatus enum value - ImportJobStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // ImportJobStatusDeleteFailed is a ImportJobStatus enum value - ImportJobStatusDeleteFailed = "DELETE_FAILED" - - // ImportJobStatusDeleted is a ImportJobStatus enum value - ImportJobStatusDeleted = "DELETED" -) - -// ImportJobStatus_Values returns all elements of the ImportJobStatus enum -func ImportJobStatus_Values() []string { - return []string{ - ImportJobStatusStartInProgress, - ImportJobStatusFailed, - ImportJobStatusComplete, - ImportJobStatusDeleteInProgress, - ImportJobStatusDeleteFailed, - ImportJobStatusDeleted, - } -} - -const ( - // ImportJobTypeQuickResponses is a ImportJobType enum value - ImportJobTypeQuickResponses = "QUICK_RESPONSES" -) - -// ImportJobType_Values returns all elements of the ImportJobType enum -func ImportJobType_Values() []string { - return []string{ - ImportJobTypeQuickResponses, - } -} - -const ( - // KnowledgeBaseStatusCreateInProgress is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // KnowledgeBaseStatusCreateFailed is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusCreateFailed = "CREATE_FAILED" - - // KnowledgeBaseStatusActive is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusActive = "ACTIVE" - - // KnowledgeBaseStatusDeleteInProgress is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // KnowledgeBaseStatusDeleteFailed is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusDeleteFailed = "DELETE_FAILED" - - // KnowledgeBaseStatusDeleted is a KnowledgeBaseStatus enum value - KnowledgeBaseStatusDeleted = "DELETED" -) - -// KnowledgeBaseStatus_Values returns all elements of the KnowledgeBaseStatus enum -func KnowledgeBaseStatus_Values() []string { - return []string{ - KnowledgeBaseStatusCreateInProgress, - KnowledgeBaseStatusCreateFailed, - KnowledgeBaseStatusActive, - KnowledgeBaseStatusDeleteInProgress, - KnowledgeBaseStatusDeleteFailed, - KnowledgeBaseStatusDeleted, - } -} - -const ( - // KnowledgeBaseTypeExternal is a KnowledgeBaseType enum value - KnowledgeBaseTypeExternal = "EXTERNAL" - - // KnowledgeBaseTypeCustom is a KnowledgeBaseType enum value - KnowledgeBaseTypeCustom = "CUSTOM" - - // KnowledgeBaseTypeQuickResponses is a KnowledgeBaseType enum value - KnowledgeBaseTypeQuickResponses = "QUICK_RESPONSES" -) - -// KnowledgeBaseType_Values returns all elements of the KnowledgeBaseType enum -func KnowledgeBaseType_Values() []string { - return []string{ - KnowledgeBaseTypeExternal, - KnowledgeBaseTypeCustom, - KnowledgeBaseTypeQuickResponses, - } -} - -const ( - // OrderAsc is a Order enum value - OrderAsc = "ASC" - - // OrderDesc is a Order enum value - OrderDesc = "DESC" -) - -// Order_Values returns all elements of the Order enum -func Order_Values() []string { - return []string{ - OrderAsc, - OrderDesc, - } -} - -const ( - // PriorityHigh is a Priority enum value - PriorityHigh = "HIGH" - - // PriorityMedium is a Priority enum value - PriorityMedium = "MEDIUM" - - // PriorityLow is a Priority enum value - PriorityLow = "LOW" -) - -// Priority_Values returns all elements of the Priority enum -func Priority_Values() []string { - return []string{ - PriorityHigh, - PriorityMedium, - PriorityLow, - } -} - -const ( - // QueryConditionComparisonOperatorEquals is a QueryConditionComparisonOperator enum value - QueryConditionComparisonOperatorEquals = "EQUALS" -) - -// QueryConditionComparisonOperator_Values returns all elements of the QueryConditionComparisonOperator enum -func QueryConditionComparisonOperator_Values() []string { - return []string{ - QueryConditionComparisonOperatorEquals, - } -} - -const ( - // QueryConditionFieldNameResultType is a QueryConditionFieldName enum value - QueryConditionFieldNameResultType = "RESULT_TYPE" -) - -// QueryConditionFieldName_Values returns all elements of the QueryConditionFieldName enum -func QueryConditionFieldName_Values() []string { - return []string{ - QueryConditionFieldNameResultType, - } -} - -const ( - // QueryResultTypeKnowledgeContent is a QueryResultType enum value - QueryResultTypeKnowledgeContent = "KNOWLEDGE_CONTENT" - - // QueryResultTypeGenerativeAnswer is a QueryResultType enum value - QueryResultTypeGenerativeAnswer = "GENERATIVE_ANSWER" -) - -// QueryResultType_Values returns all elements of the QueryResultType enum -func QueryResultType_Values() []string { - return []string{ - QueryResultTypeKnowledgeContent, - QueryResultTypeGenerativeAnswer, - } -} - -const ( - // QuickResponseFilterOperatorEquals is a QuickResponseFilterOperator enum value - QuickResponseFilterOperatorEquals = "EQUALS" - - // QuickResponseFilterOperatorPrefix is a QuickResponseFilterOperator enum value - QuickResponseFilterOperatorPrefix = "PREFIX" -) - -// QuickResponseFilterOperator_Values returns all elements of the QuickResponseFilterOperator enum -func QuickResponseFilterOperator_Values() []string { - return []string{ - QuickResponseFilterOperatorEquals, - QuickResponseFilterOperatorPrefix, - } -} - -const ( - // QuickResponseQueryOperatorContains is a QuickResponseQueryOperator enum value - QuickResponseQueryOperatorContains = "CONTAINS" - - // QuickResponseQueryOperatorContainsAndPrefix is a QuickResponseQueryOperator enum value - QuickResponseQueryOperatorContainsAndPrefix = "CONTAINS_AND_PREFIX" -) - -// QuickResponseQueryOperator_Values returns all elements of the QuickResponseQueryOperator enum -func QuickResponseQueryOperator_Values() []string { - return []string{ - QuickResponseQueryOperatorContains, - QuickResponseQueryOperatorContainsAndPrefix, - } -} - -const ( - // QuickResponseStatusCreateInProgress is a QuickResponseStatus enum value - QuickResponseStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // QuickResponseStatusCreateFailed is a QuickResponseStatus enum value - QuickResponseStatusCreateFailed = "CREATE_FAILED" - - // QuickResponseStatusCreated is a QuickResponseStatus enum value - QuickResponseStatusCreated = "CREATED" - - // QuickResponseStatusDeleteInProgress is a QuickResponseStatus enum value - QuickResponseStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // QuickResponseStatusDeleteFailed is a QuickResponseStatus enum value - QuickResponseStatusDeleteFailed = "DELETE_FAILED" - - // QuickResponseStatusDeleted is a QuickResponseStatus enum value - QuickResponseStatusDeleted = "DELETED" - - // QuickResponseStatusUpdateInProgress is a QuickResponseStatus enum value - QuickResponseStatusUpdateInProgress = "UPDATE_IN_PROGRESS" - - // QuickResponseStatusUpdateFailed is a QuickResponseStatus enum value - QuickResponseStatusUpdateFailed = "UPDATE_FAILED" -) - -// QuickResponseStatus_Values returns all elements of the QuickResponseStatus enum -func QuickResponseStatus_Values() []string { - return []string{ - QuickResponseStatusCreateInProgress, - QuickResponseStatusCreateFailed, - QuickResponseStatusCreated, - QuickResponseStatusDeleteInProgress, - QuickResponseStatusDeleteFailed, - QuickResponseStatusDeleted, - QuickResponseStatusUpdateInProgress, - QuickResponseStatusUpdateFailed, - } -} - -const ( - // RecommendationSourceTypeIssueDetection is a RecommendationSourceType enum value - RecommendationSourceTypeIssueDetection = "ISSUE_DETECTION" - - // RecommendationSourceTypeRuleEvaluation is a RecommendationSourceType enum value - RecommendationSourceTypeRuleEvaluation = "RULE_EVALUATION" - - // RecommendationSourceTypeOther is a RecommendationSourceType enum value - RecommendationSourceTypeOther = "OTHER" -) - -// RecommendationSourceType_Values returns all elements of the RecommendationSourceType enum -func RecommendationSourceType_Values() []string { - return []string{ - RecommendationSourceTypeIssueDetection, - RecommendationSourceTypeRuleEvaluation, - RecommendationSourceTypeOther, - } -} - -const ( - // RecommendationTriggerTypeQuery is a RecommendationTriggerType enum value - RecommendationTriggerTypeQuery = "QUERY" - - // RecommendationTriggerTypeGenerative is a RecommendationTriggerType enum value - RecommendationTriggerTypeGenerative = "GENERATIVE" -) - -// RecommendationTriggerType_Values returns all elements of the RecommendationTriggerType enum -func RecommendationTriggerType_Values() []string { - return []string{ - RecommendationTriggerTypeQuery, - RecommendationTriggerTypeGenerative, - } -} - -const ( - // RecommendationTypeKnowledgeContent is a RecommendationType enum value - RecommendationTypeKnowledgeContent = "KNOWLEDGE_CONTENT" - - // RecommendationTypeGenerativeResponse is a RecommendationType enum value - RecommendationTypeGenerativeResponse = "GENERATIVE_RESPONSE" - - // RecommendationTypeGenerativeAnswer is a RecommendationType enum value - RecommendationTypeGenerativeAnswer = "GENERATIVE_ANSWER" -) - -// RecommendationType_Values returns all elements of the RecommendationType enum -func RecommendationType_Values() []string { - return []string{ - RecommendationTypeKnowledgeContent, - RecommendationTypeGenerativeResponse, - RecommendationTypeGenerativeAnswer, - } -} - -const ( - // RelevanceLevelHigh is a RelevanceLevel enum value - RelevanceLevelHigh = "HIGH" - - // RelevanceLevelMedium is a RelevanceLevel enum value - RelevanceLevelMedium = "MEDIUM" - - // RelevanceLevelLow is a RelevanceLevel enum value - RelevanceLevelLow = "LOW" -) - -// RelevanceLevel_Values returns all elements of the RelevanceLevel enum -func RelevanceLevel_Values() []string { - return []string{ - RelevanceLevelHigh, - RelevanceLevelMedium, - RelevanceLevelLow, - } -} - -const ( - // SourceContentTypeKnowledgeContent is a SourceContentType enum value - SourceContentTypeKnowledgeContent = "KNOWLEDGE_CONTENT" -) - -// SourceContentType_Values returns all elements of the SourceContentType enum -func SourceContentType_Values() []string { - return []string{ - SourceContentTypeKnowledgeContent, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/doc.go deleted file mode 100644 index 2e7efbdc25f9..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/doc.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package qconnect provides the client and types for making API -// requests to Amazon Q Connect. -// -// Amazon Q in Connect is a generative AI customer service assistant. It is -// an LLM-enhanced evolution of Amazon Connect Wisdom that delivers real-time -// recommendations to help contact center agents resolve customer issues quickly -// and accurately. -// -// Amazon Q automatically detects customer intent during calls and chats using -// conversational analytics and natural language understanding (NLU). It then -// provides agents with immediate, real-time generative responses and suggested -// actions, and links to relevant documents and articles. Agents can also query -// Amazon Q directly using natural language or keywords to answer customer requests. -// -// Use the Amazon Q in Connect APIs to create an assistant and a knowledge base, -// for example, or manage content by uploading custom files. -// -// For more information, see Use Amazon Q in Connect for generative AI powered -// agent assistance in real-time (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-q-connect.html) -// in the Amazon Connect Administrator Guide. -// -// See https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19 for more information on this service. -// -// See qconnect package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/qconnect/ -// -// # Using the Client -// -// To contact Amazon Q Connect with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Q Connect client QConnect for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/qconnect/#New -package qconnect diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/errors.go deleted file mode 100644 index 797707bbe052..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/errors.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package qconnect - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request could not be processed because of conflict in the current state - // of the resource. For example, if you're using a Create API (such as CreateAssistant) - // that accepts name, a conflicting resource (usually with the same name) is - // being created or mutated. - ErrCodeConflictException = "ConflictException" - - // ErrCodePreconditionFailedException for service response error code - // "PreconditionFailedException". - // - // The provided revisionId does not match, indicating the content has been modified - // since it was last read. - ErrCodePreconditionFailedException = "PreconditionFailedException" - - // ErrCodeRequestTimeoutException for service response error code - // "RequestTimeoutException". - // - // The request reached the service more than 15 minutes after the date stamp - // on the request or more than 15 minutes after the request expiration date - // (such as for pre-signed URLs), or the date stamp on the request is more than - // 15 minutes in the future. - ErrCodeRequestTimeoutException = "RequestTimeoutException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // You've exceeded your service quota. To perform the requested action, remove - // some of the relevant resources, or use service quotas to request a service - // quota increase. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTagsException". - // - // Amazon Q in Connect throws this exception if you have too many tags in your - // tag set. - ErrCodeTooManyTagsException = "TooManyTagsException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by a service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "PreconditionFailedException": newErrorPreconditionFailedException, - "RequestTimeoutException": newErrorRequestTimeoutException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "TooManyTagsException": newErrorTooManyTagsException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/qconnectiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/qconnectiface/interface.go deleted file mode 100644 index ac30ebdf9b33..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/qconnectiface/interface.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package qconnectiface provides an interface to enable mocking the Amazon Q Connect service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package qconnectiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect" -) - -// QConnectAPI provides an interface to enable mocking the -// qconnect.QConnect service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Q Connect. -// func myFunc(svc qconnectiface.QConnectAPI) bool { -// // Make svc.CreateAssistant request -// } -// -// func main() { -// sess := session.New() -// svc := qconnect.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockQConnectClient struct { -// qconnectiface.QConnectAPI -// } -// func (m *mockQConnectClient) CreateAssistant(input *qconnect.CreateAssistantInput) (*qconnect.CreateAssistantOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockQConnectClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type QConnectAPI interface { - CreateAssistant(*qconnect.CreateAssistantInput) (*qconnect.CreateAssistantOutput, error) - CreateAssistantWithContext(aws.Context, *qconnect.CreateAssistantInput, ...request.Option) (*qconnect.CreateAssistantOutput, error) - CreateAssistantRequest(*qconnect.CreateAssistantInput) (*request.Request, *qconnect.CreateAssistantOutput) - - CreateAssistantAssociation(*qconnect.CreateAssistantAssociationInput) (*qconnect.CreateAssistantAssociationOutput, error) - CreateAssistantAssociationWithContext(aws.Context, *qconnect.CreateAssistantAssociationInput, ...request.Option) (*qconnect.CreateAssistantAssociationOutput, error) - CreateAssistantAssociationRequest(*qconnect.CreateAssistantAssociationInput) (*request.Request, *qconnect.CreateAssistantAssociationOutput) - - CreateContent(*qconnect.CreateContentInput) (*qconnect.CreateContentOutput, error) - CreateContentWithContext(aws.Context, *qconnect.CreateContentInput, ...request.Option) (*qconnect.CreateContentOutput, error) - CreateContentRequest(*qconnect.CreateContentInput) (*request.Request, *qconnect.CreateContentOutput) - - CreateKnowledgeBase(*qconnect.CreateKnowledgeBaseInput) (*qconnect.CreateKnowledgeBaseOutput, error) - CreateKnowledgeBaseWithContext(aws.Context, *qconnect.CreateKnowledgeBaseInput, ...request.Option) (*qconnect.CreateKnowledgeBaseOutput, error) - CreateKnowledgeBaseRequest(*qconnect.CreateKnowledgeBaseInput) (*request.Request, *qconnect.CreateKnowledgeBaseOutput) - - CreateQuickResponse(*qconnect.CreateQuickResponseInput) (*qconnect.CreateQuickResponseOutput, error) - CreateQuickResponseWithContext(aws.Context, *qconnect.CreateQuickResponseInput, ...request.Option) (*qconnect.CreateQuickResponseOutput, error) - CreateQuickResponseRequest(*qconnect.CreateQuickResponseInput) (*request.Request, *qconnect.CreateQuickResponseOutput) - - CreateSession(*qconnect.CreateSessionInput) (*qconnect.CreateSessionOutput, error) - CreateSessionWithContext(aws.Context, *qconnect.CreateSessionInput, ...request.Option) (*qconnect.CreateSessionOutput, error) - CreateSessionRequest(*qconnect.CreateSessionInput) (*request.Request, *qconnect.CreateSessionOutput) - - DeleteAssistant(*qconnect.DeleteAssistantInput) (*qconnect.DeleteAssistantOutput, error) - DeleteAssistantWithContext(aws.Context, *qconnect.DeleteAssistantInput, ...request.Option) (*qconnect.DeleteAssistantOutput, error) - DeleteAssistantRequest(*qconnect.DeleteAssistantInput) (*request.Request, *qconnect.DeleteAssistantOutput) - - DeleteAssistantAssociation(*qconnect.DeleteAssistantAssociationInput) (*qconnect.DeleteAssistantAssociationOutput, error) - DeleteAssistantAssociationWithContext(aws.Context, *qconnect.DeleteAssistantAssociationInput, ...request.Option) (*qconnect.DeleteAssistantAssociationOutput, error) - DeleteAssistantAssociationRequest(*qconnect.DeleteAssistantAssociationInput) (*request.Request, *qconnect.DeleteAssistantAssociationOutput) - - DeleteContent(*qconnect.DeleteContentInput) (*qconnect.DeleteContentOutput, error) - DeleteContentWithContext(aws.Context, *qconnect.DeleteContentInput, ...request.Option) (*qconnect.DeleteContentOutput, error) - DeleteContentRequest(*qconnect.DeleteContentInput) (*request.Request, *qconnect.DeleteContentOutput) - - DeleteImportJob(*qconnect.DeleteImportJobInput) (*qconnect.DeleteImportJobOutput, error) - DeleteImportJobWithContext(aws.Context, *qconnect.DeleteImportJobInput, ...request.Option) (*qconnect.DeleteImportJobOutput, error) - DeleteImportJobRequest(*qconnect.DeleteImportJobInput) (*request.Request, *qconnect.DeleteImportJobOutput) - - DeleteKnowledgeBase(*qconnect.DeleteKnowledgeBaseInput) (*qconnect.DeleteKnowledgeBaseOutput, error) - DeleteKnowledgeBaseWithContext(aws.Context, *qconnect.DeleteKnowledgeBaseInput, ...request.Option) (*qconnect.DeleteKnowledgeBaseOutput, error) - DeleteKnowledgeBaseRequest(*qconnect.DeleteKnowledgeBaseInput) (*request.Request, *qconnect.DeleteKnowledgeBaseOutput) - - DeleteQuickResponse(*qconnect.DeleteQuickResponseInput) (*qconnect.DeleteQuickResponseOutput, error) - DeleteQuickResponseWithContext(aws.Context, *qconnect.DeleteQuickResponseInput, ...request.Option) (*qconnect.DeleteQuickResponseOutput, error) - DeleteQuickResponseRequest(*qconnect.DeleteQuickResponseInput) (*request.Request, *qconnect.DeleteQuickResponseOutput) - - GetAssistant(*qconnect.GetAssistantInput) (*qconnect.GetAssistantOutput, error) - GetAssistantWithContext(aws.Context, *qconnect.GetAssistantInput, ...request.Option) (*qconnect.GetAssistantOutput, error) - GetAssistantRequest(*qconnect.GetAssistantInput) (*request.Request, *qconnect.GetAssistantOutput) - - GetAssistantAssociation(*qconnect.GetAssistantAssociationInput) (*qconnect.GetAssistantAssociationOutput, error) - GetAssistantAssociationWithContext(aws.Context, *qconnect.GetAssistantAssociationInput, ...request.Option) (*qconnect.GetAssistantAssociationOutput, error) - GetAssistantAssociationRequest(*qconnect.GetAssistantAssociationInput) (*request.Request, *qconnect.GetAssistantAssociationOutput) - - GetContent(*qconnect.GetContentInput) (*qconnect.GetContentOutput, error) - GetContentWithContext(aws.Context, *qconnect.GetContentInput, ...request.Option) (*qconnect.GetContentOutput, error) - GetContentRequest(*qconnect.GetContentInput) (*request.Request, *qconnect.GetContentOutput) - - GetContentSummary(*qconnect.GetContentSummaryInput) (*qconnect.GetContentSummaryOutput, error) - GetContentSummaryWithContext(aws.Context, *qconnect.GetContentSummaryInput, ...request.Option) (*qconnect.GetContentSummaryOutput, error) - GetContentSummaryRequest(*qconnect.GetContentSummaryInput) (*request.Request, *qconnect.GetContentSummaryOutput) - - GetImportJob(*qconnect.GetImportJobInput) (*qconnect.GetImportJobOutput, error) - GetImportJobWithContext(aws.Context, *qconnect.GetImportJobInput, ...request.Option) (*qconnect.GetImportJobOutput, error) - GetImportJobRequest(*qconnect.GetImportJobInput) (*request.Request, *qconnect.GetImportJobOutput) - - GetKnowledgeBase(*qconnect.GetKnowledgeBaseInput) (*qconnect.GetKnowledgeBaseOutput, error) - GetKnowledgeBaseWithContext(aws.Context, *qconnect.GetKnowledgeBaseInput, ...request.Option) (*qconnect.GetKnowledgeBaseOutput, error) - GetKnowledgeBaseRequest(*qconnect.GetKnowledgeBaseInput) (*request.Request, *qconnect.GetKnowledgeBaseOutput) - - GetQuickResponse(*qconnect.GetQuickResponseInput) (*qconnect.GetQuickResponseOutput, error) - GetQuickResponseWithContext(aws.Context, *qconnect.GetQuickResponseInput, ...request.Option) (*qconnect.GetQuickResponseOutput, error) - GetQuickResponseRequest(*qconnect.GetQuickResponseInput) (*request.Request, *qconnect.GetQuickResponseOutput) - - GetRecommendations(*qconnect.GetRecommendationsInput) (*qconnect.GetRecommendationsOutput, error) - GetRecommendationsWithContext(aws.Context, *qconnect.GetRecommendationsInput, ...request.Option) (*qconnect.GetRecommendationsOutput, error) - GetRecommendationsRequest(*qconnect.GetRecommendationsInput) (*request.Request, *qconnect.GetRecommendationsOutput) - - GetSession(*qconnect.GetSessionInput) (*qconnect.GetSessionOutput, error) - GetSessionWithContext(aws.Context, *qconnect.GetSessionInput, ...request.Option) (*qconnect.GetSessionOutput, error) - GetSessionRequest(*qconnect.GetSessionInput) (*request.Request, *qconnect.GetSessionOutput) - - ListAssistantAssociations(*qconnect.ListAssistantAssociationsInput) (*qconnect.ListAssistantAssociationsOutput, error) - ListAssistantAssociationsWithContext(aws.Context, *qconnect.ListAssistantAssociationsInput, ...request.Option) (*qconnect.ListAssistantAssociationsOutput, error) - ListAssistantAssociationsRequest(*qconnect.ListAssistantAssociationsInput) (*request.Request, *qconnect.ListAssistantAssociationsOutput) - - ListAssistantAssociationsPages(*qconnect.ListAssistantAssociationsInput, func(*qconnect.ListAssistantAssociationsOutput, bool) bool) error - ListAssistantAssociationsPagesWithContext(aws.Context, *qconnect.ListAssistantAssociationsInput, func(*qconnect.ListAssistantAssociationsOutput, bool) bool, ...request.Option) error - - ListAssistants(*qconnect.ListAssistantsInput) (*qconnect.ListAssistantsOutput, error) - ListAssistantsWithContext(aws.Context, *qconnect.ListAssistantsInput, ...request.Option) (*qconnect.ListAssistantsOutput, error) - ListAssistantsRequest(*qconnect.ListAssistantsInput) (*request.Request, *qconnect.ListAssistantsOutput) - - ListAssistantsPages(*qconnect.ListAssistantsInput, func(*qconnect.ListAssistantsOutput, bool) bool) error - ListAssistantsPagesWithContext(aws.Context, *qconnect.ListAssistantsInput, func(*qconnect.ListAssistantsOutput, bool) bool, ...request.Option) error - - ListContents(*qconnect.ListContentsInput) (*qconnect.ListContentsOutput, error) - ListContentsWithContext(aws.Context, *qconnect.ListContentsInput, ...request.Option) (*qconnect.ListContentsOutput, error) - ListContentsRequest(*qconnect.ListContentsInput) (*request.Request, *qconnect.ListContentsOutput) - - ListContentsPages(*qconnect.ListContentsInput, func(*qconnect.ListContentsOutput, bool) bool) error - ListContentsPagesWithContext(aws.Context, *qconnect.ListContentsInput, func(*qconnect.ListContentsOutput, bool) bool, ...request.Option) error - - ListImportJobs(*qconnect.ListImportJobsInput) (*qconnect.ListImportJobsOutput, error) - ListImportJobsWithContext(aws.Context, *qconnect.ListImportJobsInput, ...request.Option) (*qconnect.ListImportJobsOutput, error) - ListImportJobsRequest(*qconnect.ListImportJobsInput) (*request.Request, *qconnect.ListImportJobsOutput) - - ListImportJobsPages(*qconnect.ListImportJobsInput, func(*qconnect.ListImportJobsOutput, bool) bool) error - ListImportJobsPagesWithContext(aws.Context, *qconnect.ListImportJobsInput, func(*qconnect.ListImportJobsOutput, bool) bool, ...request.Option) error - - ListKnowledgeBases(*qconnect.ListKnowledgeBasesInput) (*qconnect.ListKnowledgeBasesOutput, error) - ListKnowledgeBasesWithContext(aws.Context, *qconnect.ListKnowledgeBasesInput, ...request.Option) (*qconnect.ListKnowledgeBasesOutput, error) - ListKnowledgeBasesRequest(*qconnect.ListKnowledgeBasesInput) (*request.Request, *qconnect.ListKnowledgeBasesOutput) - - ListKnowledgeBasesPages(*qconnect.ListKnowledgeBasesInput, func(*qconnect.ListKnowledgeBasesOutput, bool) bool) error - ListKnowledgeBasesPagesWithContext(aws.Context, *qconnect.ListKnowledgeBasesInput, func(*qconnect.ListKnowledgeBasesOutput, bool) bool, ...request.Option) error - - ListQuickResponses(*qconnect.ListQuickResponsesInput) (*qconnect.ListQuickResponsesOutput, error) - ListQuickResponsesWithContext(aws.Context, *qconnect.ListQuickResponsesInput, ...request.Option) (*qconnect.ListQuickResponsesOutput, error) - ListQuickResponsesRequest(*qconnect.ListQuickResponsesInput) (*request.Request, *qconnect.ListQuickResponsesOutput) - - ListQuickResponsesPages(*qconnect.ListQuickResponsesInput, func(*qconnect.ListQuickResponsesOutput, bool) bool) error - ListQuickResponsesPagesWithContext(aws.Context, *qconnect.ListQuickResponsesInput, func(*qconnect.ListQuickResponsesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*qconnect.ListTagsForResourceInput) (*qconnect.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *qconnect.ListTagsForResourceInput, ...request.Option) (*qconnect.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*qconnect.ListTagsForResourceInput) (*request.Request, *qconnect.ListTagsForResourceOutput) - - NotifyRecommendationsReceived(*qconnect.NotifyRecommendationsReceivedInput) (*qconnect.NotifyRecommendationsReceivedOutput, error) - NotifyRecommendationsReceivedWithContext(aws.Context, *qconnect.NotifyRecommendationsReceivedInput, ...request.Option) (*qconnect.NotifyRecommendationsReceivedOutput, error) - NotifyRecommendationsReceivedRequest(*qconnect.NotifyRecommendationsReceivedInput) (*request.Request, *qconnect.NotifyRecommendationsReceivedOutput) - - QueryAssistant(*qconnect.QueryAssistantInput) (*qconnect.QueryAssistantOutput, error) - QueryAssistantWithContext(aws.Context, *qconnect.QueryAssistantInput, ...request.Option) (*qconnect.QueryAssistantOutput, error) - QueryAssistantRequest(*qconnect.QueryAssistantInput) (*request.Request, *qconnect.QueryAssistantOutput) - - QueryAssistantPages(*qconnect.QueryAssistantInput, func(*qconnect.QueryAssistantOutput, bool) bool) error - QueryAssistantPagesWithContext(aws.Context, *qconnect.QueryAssistantInput, func(*qconnect.QueryAssistantOutput, bool) bool, ...request.Option) error - - RemoveKnowledgeBaseTemplateUri(*qconnect.RemoveKnowledgeBaseTemplateUriInput) (*qconnect.RemoveKnowledgeBaseTemplateUriOutput, error) - RemoveKnowledgeBaseTemplateUriWithContext(aws.Context, *qconnect.RemoveKnowledgeBaseTemplateUriInput, ...request.Option) (*qconnect.RemoveKnowledgeBaseTemplateUriOutput, error) - RemoveKnowledgeBaseTemplateUriRequest(*qconnect.RemoveKnowledgeBaseTemplateUriInput) (*request.Request, *qconnect.RemoveKnowledgeBaseTemplateUriOutput) - - SearchContent(*qconnect.SearchContentInput) (*qconnect.SearchContentOutput, error) - SearchContentWithContext(aws.Context, *qconnect.SearchContentInput, ...request.Option) (*qconnect.SearchContentOutput, error) - SearchContentRequest(*qconnect.SearchContentInput) (*request.Request, *qconnect.SearchContentOutput) - - SearchContentPages(*qconnect.SearchContentInput, func(*qconnect.SearchContentOutput, bool) bool) error - SearchContentPagesWithContext(aws.Context, *qconnect.SearchContentInput, func(*qconnect.SearchContentOutput, bool) bool, ...request.Option) error - - SearchQuickResponses(*qconnect.SearchQuickResponsesInput) (*qconnect.SearchQuickResponsesOutput, error) - SearchQuickResponsesWithContext(aws.Context, *qconnect.SearchQuickResponsesInput, ...request.Option) (*qconnect.SearchQuickResponsesOutput, error) - SearchQuickResponsesRequest(*qconnect.SearchQuickResponsesInput) (*request.Request, *qconnect.SearchQuickResponsesOutput) - - SearchQuickResponsesPages(*qconnect.SearchQuickResponsesInput, func(*qconnect.SearchQuickResponsesOutput, bool) bool) error - SearchQuickResponsesPagesWithContext(aws.Context, *qconnect.SearchQuickResponsesInput, func(*qconnect.SearchQuickResponsesOutput, bool) bool, ...request.Option) error - - SearchSessions(*qconnect.SearchSessionsInput) (*qconnect.SearchSessionsOutput, error) - SearchSessionsWithContext(aws.Context, *qconnect.SearchSessionsInput, ...request.Option) (*qconnect.SearchSessionsOutput, error) - SearchSessionsRequest(*qconnect.SearchSessionsInput) (*request.Request, *qconnect.SearchSessionsOutput) - - SearchSessionsPages(*qconnect.SearchSessionsInput, func(*qconnect.SearchSessionsOutput, bool) bool) error - SearchSessionsPagesWithContext(aws.Context, *qconnect.SearchSessionsInput, func(*qconnect.SearchSessionsOutput, bool) bool, ...request.Option) error - - StartContentUpload(*qconnect.StartContentUploadInput) (*qconnect.StartContentUploadOutput, error) - StartContentUploadWithContext(aws.Context, *qconnect.StartContentUploadInput, ...request.Option) (*qconnect.StartContentUploadOutput, error) - StartContentUploadRequest(*qconnect.StartContentUploadInput) (*request.Request, *qconnect.StartContentUploadOutput) - - StartImportJob(*qconnect.StartImportJobInput) (*qconnect.StartImportJobOutput, error) - StartImportJobWithContext(aws.Context, *qconnect.StartImportJobInput, ...request.Option) (*qconnect.StartImportJobOutput, error) - StartImportJobRequest(*qconnect.StartImportJobInput) (*request.Request, *qconnect.StartImportJobOutput) - - TagResource(*qconnect.TagResourceInput) (*qconnect.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *qconnect.TagResourceInput, ...request.Option) (*qconnect.TagResourceOutput, error) - TagResourceRequest(*qconnect.TagResourceInput) (*request.Request, *qconnect.TagResourceOutput) - - UntagResource(*qconnect.UntagResourceInput) (*qconnect.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *qconnect.UntagResourceInput, ...request.Option) (*qconnect.UntagResourceOutput, error) - UntagResourceRequest(*qconnect.UntagResourceInput) (*request.Request, *qconnect.UntagResourceOutput) - - UpdateContent(*qconnect.UpdateContentInput) (*qconnect.UpdateContentOutput, error) - UpdateContentWithContext(aws.Context, *qconnect.UpdateContentInput, ...request.Option) (*qconnect.UpdateContentOutput, error) - UpdateContentRequest(*qconnect.UpdateContentInput) (*request.Request, *qconnect.UpdateContentOutput) - - UpdateKnowledgeBaseTemplateUri(*qconnect.UpdateKnowledgeBaseTemplateUriInput) (*qconnect.UpdateKnowledgeBaseTemplateUriOutput, error) - UpdateKnowledgeBaseTemplateUriWithContext(aws.Context, *qconnect.UpdateKnowledgeBaseTemplateUriInput, ...request.Option) (*qconnect.UpdateKnowledgeBaseTemplateUriOutput, error) - UpdateKnowledgeBaseTemplateUriRequest(*qconnect.UpdateKnowledgeBaseTemplateUriInput) (*request.Request, *qconnect.UpdateKnowledgeBaseTemplateUriOutput) - - UpdateQuickResponse(*qconnect.UpdateQuickResponseInput) (*qconnect.UpdateQuickResponseOutput, error) - UpdateQuickResponseWithContext(aws.Context, *qconnect.UpdateQuickResponseInput, ...request.Option) (*qconnect.UpdateQuickResponseOutput, error) - UpdateQuickResponseRequest(*qconnect.UpdateQuickResponseInput) (*request.Request, *qconnect.UpdateQuickResponseOutput) -} - -var _ QConnectAPI = (*qconnect.QConnect)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/service.go deleted file mode 100644 index ad47547e9a2e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/qconnect/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package qconnect - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// QConnect provides the API operation methods for making requests to -// Amazon Q Connect. See this package's package overview docs -// for details on the service. -// -// QConnect methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type QConnect struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "QConnect" // Name of service. - EndpointsID = "wisdom" // ID to lookup a service endpoint with. - ServiceID = "QConnect" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the QConnect client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a QConnect client from just a session. -// svc := qconnect.New(mySession) -// -// // Create a QConnect client with additional configuration -// svc := qconnect.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *QConnect { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "wisdom" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *QConnect { - svc := &QConnect{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2020-10-19", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a QConnect operation and runs any -// custom request initialization. -func (c *QConnect) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/api.go deleted file mode 100644 index 7cd639102f1d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/api.go +++ /dev/null @@ -1,11858 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package redshiftserverless - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opConvertRecoveryPointToSnapshot = "ConvertRecoveryPointToSnapshot" - -// ConvertRecoveryPointToSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the ConvertRecoveryPointToSnapshot 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 ConvertRecoveryPointToSnapshot for more information on using the ConvertRecoveryPointToSnapshot -// 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 ConvertRecoveryPointToSnapshotRequest method. -// req, resp := client.ConvertRecoveryPointToSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ConvertRecoveryPointToSnapshot -func (c *RedshiftServerless) ConvertRecoveryPointToSnapshotRequest(input *ConvertRecoveryPointToSnapshotInput) (req *request.Request, output *ConvertRecoveryPointToSnapshotOutput) { - op := &request.Operation{ - Name: opConvertRecoveryPointToSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ConvertRecoveryPointToSnapshotInput{} - } - - output = &ConvertRecoveryPointToSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// ConvertRecoveryPointToSnapshot API operation for Redshift Serverless. -// -// Converts a recovery point to a snapshot. For more information about recovery -// points and snapshots, see Working with snapshots and recovery points (https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-snapshots-recovery.html). -// -// 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 Redshift Serverless's -// API operation ConvertRecoveryPointToSnapshot for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - TooManyTagsException -// The request exceeded the number of tags allowed for a resource. -// -// - ServiceQuotaExceededException -// The service limit was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ConvertRecoveryPointToSnapshot -func (c *RedshiftServerless) ConvertRecoveryPointToSnapshot(input *ConvertRecoveryPointToSnapshotInput) (*ConvertRecoveryPointToSnapshotOutput, error) { - req, out := c.ConvertRecoveryPointToSnapshotRequest(input) - return out, req.Send() -} - -// ConvertRecoveryPointToSnapshotWithContext is the same as ConvertRecoveryPointToSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See ConvertRecoveryPointToSnapshot 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 *RedshiftServerless) ConvertRecoveryPointToSnapshotWithContext(ctx aws.Context, input *ConvertRecoveryPointToSnapshotInput, opts ...request.Option) (*ConvertRecoveryPointToSnapshotOutput, error) { - req, out := c.ConvertRecoveryPointToSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateCustomDomainAssociation = "CreateCustomDomainAssociation" - -// CreateCustomDomainAssociationRequest generates a "aws/request.Request" representing the -// client's request for the CreateCustomDomainAssociation 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 CreateCustomDomainAssociation for more information on using the CreateCustomDomainAssociation -// 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 CreateCustomDomainAssociationRequest method. -// req, resp := client.CreateCustomDomainAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateCustomDomainAssociation -func (c *RedshiftServerless) CreateCustomDomainAssociationRequest(input *CreateCustomDomainAssociationInput) (req *request.Request, output *CreateCustomDomainAssociationOutput) { - op := &request.Operation{ - Name: opCreateCustomDomainAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateCustomDomainAssociationInput{} - } - - output = &CreateCustomDomainAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCustomDomainAssociation API operation for Redshift Serverless. -// -// Creates a custom domain association for Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation CreateCustomDomainAssociation for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateCustomDomainAssociation -func (c *RedshiftServerless) CreateCustomDomainAssociation(input *CreateCustomDomainAssociationInput) (*CreateCustomDomainAssociationOutput, error) { - req, out := c.CreateCustomDomainAssociationRequest(input) - return out, req.Send() -} - -// CreateCustomDomainAssociationWithContext is the same as CreateCustomDomainAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCustomDomainAssociation 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 *RedshiftServerless) CreateCustomDomainAssociationWithContext(ctx aws.Context, input *CreateCustomDomainAssociationInput, opts ...request.Option) (*CreateCustomDomainAssociationOutput, error) { - req, out := c.CreateCustomDomainAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateEndpointAccess = "CreateEndpointAccess" - -// CreateEndpointAccessRequest generates a "aws/request.Request" representing the -// client's request for the CreateEndpointAccess 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 CreateEndpointAccess for more information on using the CreateEndpointAccess -// 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 CreateEndpointAccessRequest method. -// req, resp := client.CreateEndpointAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateEndpointAccess -func (c *RedshiftServerless) CreateEndpointAccessRequest(input *CreateEndpointAccessInput) (req *request.Request, output *CreateEndpointAccessOutput) { - op := &request.Operation{ - Name: opCreateEndpointAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateEndpointAccessInput{} - } - - output = &CreateEndpointAccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEndpointAccess API operation for Redshift Serverless. -// -// Creates an Amazon Redshift Serverless managed VPC endpoint. -// -// 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 Redshift Serverless's -// API operation CreateEndpointAccess for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ServiceQuotaExceededException -// The service limit was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateEndpointAccess -func (c *RedshiftServerless) CreateEndpointAccess(input *CreateEndpointAccessInput) (*CreateEndpointAccessOutput, error) { - req, out := c.CreateEndpointAccessRequest(input) - return out, req.Send() -} - -// CreateEndpointAccessWithContext is the same as CreateEndpointAccess with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEndpointAccess 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 *RedshiftServerless) CreateEndpointAccessWithContext(ctx aws.Context, input *CreateEndpointAccessInput, opts ...request.Option) (*CreateEndpointAccessOutput, error) { - req, out := c.CreateEndpointAccessRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateNamespace = "CreateNamespace" - -// CreateNamespaceRequest generates a "aws/request.Request" representing the -// client's request for the CreateNamespace 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 CreateNamespace for more information on using the CreateNamespace -// 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 CreateNamespaceRequest method. -// req, resp := client.CreateNamespaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateNamespace -func (c *RedshiftServerless) CreateNamespaceRequest(input *CreateNamespaceInput) (req *request.Request, output *CreateNamespaceOutput) { - op := &request.Operation{ - Name: opCreateNamespace, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateNamespaceInput{} - } - - output = &CreateNamespaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateNamespace API operation for Redshift Serverless. -// -// Creates a namespace in Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation CreateNamespace for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - TooManyTagsException -// The request exceeded the number of tags allowed for a resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateNamespace -func (c *RedshiftServerless) CreateNamespace(input *CreateNamespaceInput) (*CreateNamespaceOutput, error) { - req, out := c.CreateNamespaceRequest(input) - return out, req.Send() -} - -// CreateNamespaceWithContext is the same as CreateNamespace with the addition of -// the ability to pass a context and additional request options. -// -// See CreateNamespace 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 *RedshiftServerless) CreateNamespaceWithContext(ctx aws.Context, input *CreateNamespaceInput, opts ...request.Option) (*CreateNamespaceOutput, error) { - req, out := c.CreateNamespaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSnapshot = "CreateSnapshot" - -// CreateSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateSnapshot 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 CreateSnapshot for more information on using the CreateSnapshot -// 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 CreateSnapshotRequest method. -// req, resp := client.CreateSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateSnapshot -func (c *RedshiftServerless) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *CreateSnapshotOutput) { - op := &request.Operation{ - Name: opCreateSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateSnapshotInput{} - } - - output = &CreateSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSnapshot API operation for Redshift Serverless. -// -// Creates a snapshot of all databases in a namespace. For more information -// about snapshots, see Working with snapshots and recovery points (https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-snapshots-recovery.html). -// -// 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 Redshift Serverless's -// API operation CreateSnapshot for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - TooManyTagsException -// The request exceeded the number of tags allowed for a resource. -// -// - ServiceQuotaExceededException -// The service limit was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateSnapshot -func (c *RedshiftServerless) CreateSnapshot(input *CreateSnapshotInput) (*CreateSnapshotOutput, error) { - req, out := c.CreateSnapshotRequest(input) - return out, req.Send() -} - -// CreateSnapshotWithContext is the same as CreateSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSnapshot 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 *RedshiftServerless) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*CreateSnapshotOutput, error) { - req, out := c.CreateSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateUsageLimit = "CreateUsageLimit" - -// CreateUsageLimitRequest generates a "aws/request.Request" representing the -// client's request for the CreateUsageLimit 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 CreateUsageLimit for more information on using the CreateUsageLimit -// 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 CreateUsageLimitRequest method. -// req, resp := client.CreateUsageLimitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateUsageLimit -func (c *RedshiftServerless) CreateUsageLimitRequest(input *CreateUsageLimitInput) (req *request.Request, output *CreateUsageLimitOutput) { - op := &request.Operation{ - Name: opCreateUsageLimit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateUsageLimitInput{} - } - - output = &CreateUsageLimitOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateUsageLimit API operation for Redshift Serverless. -// -// Creates a usage limit for a specified Amazon Redshift Serverless usage type. -// The usage limit is identified by the returned usage limit identifier. -// -// 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 Redshift Serverless's -// API operation CreateUsageLimit for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - ServiceQuotaExceededException -// The service limit was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateUsageLimit -func (c *RedshiftServerless) CreateUsageLimit(input *CreateUsageLimitInput) (*CreateUsageLimitOutput, error) { - req, out := c.CreateUsageLimitRequest(input) - return out, req.Send() -} - -// CreateUsageLimitWithContext is the same as CreateUsageLimit with the addition of -// the ability to pass a context and additional request options. -// -// See CreateUsageLimit 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 *RedshiftServerless) CreateUsageLimitWithContext(ctx aws.Context, input *CreateUsageLimitInput, opts ...request.Option) (*CreateUsageLimitOutput, error) { - req, out := c.CreateUsageLimitRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateWorkgroup = "CreateWorkgroup" - -// CreateWorkgroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateWorkgroup 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 CreateWorkgroup for more information on using the CreateWorkgroup -// 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 CreateWorkgroupRequest method. -// req, resp := client.CreateWorkgroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateWorkgroup -func (c *RedshiftServerless) CreateWorkgroupRequest(input *CreateWorkgroupInput) (req *request.Request, output *CreateWorkgroupOutput) { - op := &request.Operation{ - Name: opCreateWorkgroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateWorkgroupInput{} - } - - output = &CreateWorkgroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWorkgroup API operation for Redshift Serverless. -// -// Creates an workgroup in Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation CreateWorkgroup for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - InsufficientCapacityException -// There is an insufficient capacity to perform the action. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - TooManyTagsException -// The request exceeded the number of tags allowed for a resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/CreateWorkgroup -func (c *RedshiftServerless) CreateWorkgroup(input *CreateWorkgroupInput) (*CreateWorkgroupOutput, error) { - req, out := c.CreateWorkgroupRequest(input) - return out, req.Send() -} - -// CreateWorkgroupWithContext is the same as CreateWorkgroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWorkgroup 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 *RedshiftServerless) CreateWorkgroupWithContext(ctx aws.Context, input *CreateWorkgroupInput, opts ...request.Option) (*CreateWorkgroupOutput, error) { - req, out := c.CreateWorkgroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCustomDomainAssociation = "DeleteCustomDomainAssociation" - -// DeleteCustomDomainAssociationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCustomDomainAssociation 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 DeleteCustomDomainAssociation for more information on using the DeleteCustomDomainAssociation -// 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 DeleteCustomDomainAssociationRequest method. -// req, resp := client.DeleteCustomDomainAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteCustomDomainAssociation -func (c *RedshiftServerless) DeleteCustomDomainAssociationRequest(input *DeleteCustomDomainAssociationInput) (req *request.Request, output *DeleteCustomDomainAssociationOutput) { - op := &request.Operation{ - Name: opDeleteCustomDomainAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteCustomDomainAssociationInput{} - } - - output = &DeleteCustomDomainAssociationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCustomDomainAssociation API operation for Redshift Serverless. -// -// Deletes a custom domain association for Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation DeleteCustomDomainAssociation for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteCustomDomainAssociation -func (c *RedshiftServerless) DeleteCustomDomainAssociation(input *DeleteCustomDomainAssociationInput) (*DeleteCustomDomainAssociationOutput, error) { - req, out := c.DeleteCustomDomainAssociationRequest(input) - return out, req.Send() -} - -// DeleteCustomDomainAssociationWithContext is the same as DeleteCustomDomainAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCustomDomainAssociation 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 *RedshiftServerless) DeleteCustomDomainAssociationWithContext(ctx aws.Context, input *DeleteCustomDomainAssociationInput, opts ...request.Option) (*DeleteCustomDomainAssociationOutput, error) { - req, out := c.DeleteCustomDomainAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEndpointAccess = "DeleteEndpointAccess" - -// DeleteEndpointAccessRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEndpointAccess 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 DeleteEndpointAccess for more information on using the DeleteEndpointAccess -// 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 DeleteEndpointAccessRequest method. -// req, resp := client.DeleteEndpointAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteEndpointAccess -func (c *RedshiftServerless) DeleteEndpointAccessRequest(input *DeleteEndpointAccessInput) (req *request.Request, output *DeleteEndpointAccessOutput) { - op := &request.Operation{ - Name: opDeleteEndpointAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEndpointAccessInput{} - } - - output = &DeleteEndpointAccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteEndpointAccess API operation for Redshift Serverless. -// -// Deletes an Amazon Redshift Serverless managed VPC endpoint. -// -// 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 Redshift Serverless's -// API operation DeleteEndpointAccess for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteEndpointAccess -func (c *RedshiftServerless) DeleteEndpointAccess(input *DeleteEndpointAccessInput) (*DeleteEndpointAccessOutput, error) { - req, out := c.DeleteEndpointAccessRequest(input) - return out, req.Send() -} - -// DeleteEndpointAccessWithContext is the same as DeleteEndpointAccess with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEndpointAccess 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 *RedshiftServerless) DeleteEndpointAccessWithContext(ctx aws.Context, input *DeleteEndpointAccessInput, opts ...request.Option) (*DeleteEndpointAccessOutput, error) { - req, out := c.DeleteEndpointAccessRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteNamespace = "DeleteNamespace" - -// DeleteNamespaceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNamespace 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 DeleteNamespace for more information on using the DeleteNamespace -// 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 DeleteNamespaceRequest method. -// req, resp := client.DeleteNamespaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteNamespace -func (c *RedshiftServerless) DeleteNamespaceRequest(input *DeleteNamespaceInput) (req *request.Request, output *DeleteNamespaceOutput) { - op := &request.Operation{ - Name: opDeleteNamespace, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteNamespaceInput{} - } - - output = &DeleteNamespaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteNamespace API operation for Redshift Serverless. -// -// Deletes a namespace from Amazon Redshift Serverless. Before you delete the -// namespace, you can create a final snapshot that has all of the data within -// the namespace. -// -// 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 Redshift Serverless's -// API operation DeleteNamespace for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteNamespace -func (c *RedshiftServerless) DeleteNamespace(input *DeleteNamespaceInput) (*DeleteNamespaceOutput, error) { - req, out := c.DeleteNamespaceRequest(input) - return out, req.Send() -} - -// DeleteNamespaceWithContext is the same as DeleteNamespace with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteNamespace 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 *RedshiftServerless) DeleteNamespaceWithContext(ctx aws.Context, input *DeleteNamespaceInput, opts ...request.Option) (*DeleteNamespaceOutput, error) { - req, out := c.DeleteNamespaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteResourcePolicy = "DeleteResourcePolicy" - -// DeleteResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteResourcePolicy 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 DeleteResourcePolicy for more information on using the DeleteResourcePolicy -// 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 DeleteResourcePolicyRequest method. -// req, resp := client.DeleteResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteResourcePolicy -func (c *RedshiftServerless) DeleteResourcePolicyRequest(input *DeleteResourcePolicyInput) (req *request.Request, output *DeleteResourcePolicyOutput) { - op := &request.Operation{ - Name: opDeleteResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteResourcePolicyInput{} - } - - output = &DeleteResourcePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteResourcePolicy API operation for Redshift Serverless. -// -// Deletes the specified resource policy. -// -// 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 Redshift Serverless's -// API operation DeleteResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteResourcePolicy -func (c *RedshiftServerless) DeleteResourcePolicy(input *DeleteResourcePolicyInput) (*DeleteResourcePolicyOutput, error) { - req, out := c.DeleteResourcePolicyRequest(input) - return out, req.Send() -} - -// DeleteResourcePolicyWithContext is the same as DeleteResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteResourcePolicy 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 *RedshiftServerless) DeleteResourcePolicyWithContext(ctx aws.Context, input *DeleteResourcePolicyInput, opts ...request.Option) (*DeleteResourcePolicyOutput, error) { - req, out := c.DeleteResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSnapshot = "DeleteSnapshot" - -// DeleteSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSnapshot 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 DeleteSnapshot for more information on using the DeleteSnapshot -// 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 DeleteSnapshotRequest method. -// req, resp := client.DeleteSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteSnapshot -func (c *RedshiftServerless) DeleteSnapshotRequest(input *DeleteSnapshotInput) (req *request.Request, output *DeleteSnapshotOutput) { - op := &request.Operation{ - Name: opDeleteSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteSnapshotInput{} - } - - output = &DeleteSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteSnapshot API operation for Redshift Serverless. -// -// Deletes a snapshot from Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation DeleteSnapshot for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteSnapshot -func (c *RedshiftServerless) DeleteSnapshot(input *DeleteSnapshotInput) (*DeleteSnapshotOutput, error) { - req, out := c.DeleteSnapshotRequest(input) - return out, req.Send() -} - -// DeleteSnapshotWithContext is the same as DeleteSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSnapshot 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 *RedshiftServerless) DeleteSnapshotWithContext(ctx aws.Context, input *DeleteSnapshotInput, opts ...request.Option) (*DeleteSnapshotOutput, error) { - req, out := c.DeleteSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteUsageLimit = "DeleteUsageLimit" - -// DeleteUsageLimitRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUsageLimit 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 DeleteUsageLimit for more information on using the DeleteUsageLimit -// 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 DeleteUsageLimitRequest method. -// req, resp := client.DeleteUsageLimitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteUsageLimit -func (c *RedshiftServerless) DeleteUsageLimitRequest(input *DeleteUsageLimitInput) (req *request.Request, output *DeleteUsageLimitOutput) { - op := &request.Operation{ - Name: opDeleteUsageLimit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteUsageLimitInput{} - } - - output = &DeleteUsageLimitOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteUsageLimit API operation for Redshift Serverless. -// -// Deletes a usage limit from Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation DeleteUsageLimit for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteUsageLimit -func (c *RedshiftServerless) DeleteUsageLimit(input *DeleteUsageLimitInput) (*DeleteUsageLimitOutput, error) { - req, out := c.DeleteUsageLimitRequest(input) - return out, req.Send() -} - -// DeleteUsageLimitWithContext is the same as DeleteUsageLimit with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteUsageLimit 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 *RedshiftServerless) DeleteUsageLimitWithContext(ctx aws.Context, input *DeleteUsageLimitInput, opts ...request.Option) (*DeleteUsageLimitOutput, error) { - req, out := c.DeleteUsageLimitRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWorkgroup = "DeleteWorkgroup" - -// DeleteWorkgroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWorkgroup 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 DeleteWorkgroup for more information on using the DeleteWorkgroup -// 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 DeleteWorkgroupRequest method. -// req, resp := client.DeleteWorkgroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteWorkgroup -func (c *RedshiftServerless) DeleteWorkgroupRequest(input *DeleteWorkgroupInput) (req *request.Request, output *DeleteWorkgroupOutput) { - op := &request.Operation{ - Name: opDeleteWorkgroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteWorkgroupInput{} - } - - output = &DeleteWorkgroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteWorkgroup API operation for Redshift Serverless. -// -// Deletes a workgroup. -// -// 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 Redshift Serverless's -// API operation DeleteWorkgroup for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/DeleteWorkgroup -func (c *RedshiftServerless) DeleteWorkgroup(input *DeleteWorkgroupInput) (*DeleteWorkgroupOutput, error) { - req, out := c.DeleteWorkgroupRequest(input) - return out, req.Send() -} - -// DeleteWorkgroupWithContext is the same as DeleteWorkgroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWorkgroup 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 *RedshiftServerless) DeleteWorkgroupWithContext(ctx aws.Context, input *DeleteWorkgroupInput, opts ...request.Option) (*DeleteWorkgroupOutput, error) { - req, out := c.DeleteWorkgroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCredentials = "GetCredentials" - -// GetCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the GetCredentials 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 GetCredentials for more information on using the GetCredentials -// 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 GetCredentialsRequest method. -// req, resp := client.GetCredentialsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetCredentials -func (c *RedshiftServerless) GetCredentialsRequest(input *GetCredentialsInput) (req *request.Request, output *GetCredentialsOutput) { - op := &request.Operation{ - Name: opGetCredentials, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCredentialsInput{} - } - - output = &GetCredentialsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCredentials API operation for Redshift Serverless. -// -// Returns a database user name and temporary password with temporary authorization -// to log in to Amazon Redshift Serverless. -// -// By default, the temporary credentials expire in 900 seconds. You can optionally -// specify a duration between 900 seconds (15 minutes) and 3600 seconds (60 -// minutes). -// -//

The Identity and Access Management (IAM) user or role that runs GetCredentials -// must have an IAM policy attached that allows access to all necessary actions -// and resources.

If the DbName parameter is specified, -// the IAM policy must allow access to the resource dbname for the specified -// database name.

-// -// 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 Redshift Serverless's -// API operation GetCredentials for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetCredentials -func (c *RedshiftServerless) GetCredentials(input *GetCredentialsInput) (*GetCredentialsOutput, error) { - req, out := c.GetCredentialsRequest(input) - return out, req.Send() -} - -// GetCredentialsWithContext is the same as GetCredentials with the addition of -// the ability to pass a context and additional request options. -// -// See GetCredentials 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 *RedshiftServerless) GetCredentialsWithContext(ctx aws.Context, input *GetCredentialsInput, opts ...request.Option) (*GetCredentialsOutput, error) { - req, out := c.GetCredentialsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCustomDomainAssociation = "GetCustomDomainAssociation" - -// GetCustomDomainAssociationRequest generates a "aws/request.Request" representing the -// client's request for the GetCustomDomainAssociation 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 GetCustomDomainAssociation for more information on using the GetCustomDomainAssociation -// 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 GetCustomDomainAssociationRequest method. -// req, resp := client.GetCustomDomainAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetCustomDomainAssociation -func (c *RedshiftServerless) GetCustomDomainAssociationRequest(input *GetCustomDomainAssociationInput) (req *request.Request, output *GetCustomDomainAssociationOutput) { - op := &request.Operation{ - Name: opGetCustomDomainAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetCustomDomainAssociationInput{} - } - - output = &GetCustomDomainAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCustomDomainAssociation API operation for Redshift Serverless. -// -// Gets information about a specific custom domain association. -// -// 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 Redshift Serverless's -// API operation GetCustomDomainAssociation for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetCustomDomainAssociation -func (c *RedshiftServerless) GetCustomDomainAssociation(input *GetCustomDomainAssociationInput) (*GetCustomDomainAssociationOutput, error) { - req, out := c.GetCustomDomainAssociationRequest(input) - return out, req.Send() -} - -// GetCustomDomainAssociationWithContext is the same as GetCustomDomainAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See GetCustomDomainAssociation 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 *RedshiftServerless) GetCustomDomainAssociationWithContext(ctx aws.Context, input *GetCustomDomainAssociationInput, opts ...request.Option) (*GetCustomDomainAssociationOutput, error) { - req, out := c.GetCustomDomainAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEndpointAccess = "GetEndpointAccess" - -// GetEndpointAccessRequest generates a "aws/request.Request" representing the -// client's request for the GetEndpointAccess 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 GetEndpointAccess for more information on using the GetEndpointAccess -// 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 GetEndpointAccessRequest method. -// req, resp := client.GetEndpointAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetEndpointAccess -func (c *RedshiftServerless) GetEndpointAccessRequest(input *GetEndpointAccessInput) (req *request.Request, output *GetEndpointAccessOutput) { - op := &request.Operation{ - Name: opGetEndpointAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetEndpointAccessInput{} - } - - output = &GetEndpointAccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEndpointAccess API operation for Redshift Serverless. -// -// Returns information, such as the name, about a VPC endpoint. -// -// 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 Redshift Serverless's -// API operation GetEndpointAccess for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetEndpointAccess -func (c *RedshiftServerless) GetEndpointAccess(input *GetEndpointAccessInput) (*GetEndpointAccessOutput, error) { - req, out := c.GetEndpointAccessRequest(input) - return out, req.Send() -} - -// GetEndpointAccessWithContext is the same as GetEndpointAccess with the addition of -// the ability to pass a context and additional request options. -// -// See GetEndpointAccess 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 *RedshiftServerless) GetEndpointAccessWithContext(ctx aws.Context, input *GetEndpointAccessInput, opts ...request.Option) (*GetEndpointAccessOutput, error) { - req, out := c.GetEndpointAccessRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetNamespace = "GetNamespace" - -// GetNamespaceRequest generates a "aws/request.Request" representing the -// client's request for the GetNamespace 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 GetNamespace for more information on using the GetNamespace -// 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 GetNamespaceRequest method. -// req, resp := client.GetNamespaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetNamespace -func (c *RedshiftServerless) GetNamespaceRequest(input *GetNamespaceInput) (req *request.Request, output *GetNamespaceOutput) { - op := &request.Operation{ - Name: opGetNamespace, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetNamespaceInput{} - } - - output = &GetNamespaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetNamespace API operation for Redshift Serverless. -// -// Returns information about a namespace in Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation GetNamespace for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetNamespace -func (c *RedshiftServerless) GetNamespace(input *GetNamespaceInput) (*GetNamespaceOutput, error) { - req, out := c.GetNamespaceRequest(input) - return out, req.Send() -} - -// GetNamespaceWithContext is the same as GetNamespace with the addition of -// the ability to pass a context and additional request options. -// -// See GetNamespace 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 *RedshiftServerless) GetNamespaceWithContext(ctx aws.Context, input *GetNamespaceInput, opts ...request.Option) (*GetNamespaceOutput, error) { - req, out := c.GetNamespaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRecoveryPoint = "GetRecoveryPoint" - -// GetRecoveryPointRequest generates a "aws/request.Request" representing the -// client's request for the GetRecoveryPoint 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 GetRecoveryPoint for more information on using the GetRecoveryPoint -// 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 GetRecoveryPointRequest method. -// req, resp := client.GetRecoveryPointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetRecoveryPoint -func (c *RedshiftServerless) GetRecoveryPointRequest(input *GetRecoveryPointInput) (req *request.Request, output *GetRecoveryPointOutput) { - op := &request.Operation{ - Name: opGetRecoveryPoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRecoveryPointInput{} - } - - output = &GetRecoveryPointOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRecoveryPoint API operation for Redshift Serverless. -// -// Returns information about a recovery point. -// -// 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 Redshift Serverless's -// API operation GetRecoveryPoint for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetRecoveryPoint -func (c *RedshiftServerless) GetRecoveryPoint(input *GetRecoveryPointInput) (*GetRecoveryPointOutput, error) { - req, out := c.GetRecoveryPointRequest(input) - return out, req.Send() -} - -// GetRecoveryPointWithContext is the same as GetRecoveryPoint with the addition of -// the ability to pass a context and additional request options. -// -// See GetRecoveryPoint 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 *RedshiftServerless) GetRecoveryPointWithContext(ctx aws.Context, input *GetRecoveryPointInput, opts ...request.Option) (*GetRecoveryPointOutput, error) { - req, out := c.GetRecoveryPointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetResourcePolicy = "GetResourcePolicy" - -// GetResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetResourcePolicy 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 GetResourcePolicy for more information on using the GetResourcePolicy -// 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 GetResourcePolicyRequest method. -// req, resp := client.GetResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetResourcePolicy -func (c *RedshiftServerless) GetResourcePolicyRequest(input *GetResourcePolicyInput) (req *request.Request, output *GetResourcePolicyOutput) { - op := &request.Operation{ - Name: opGetResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetResourcePolicyInput{} - } - - output = &GetResourcePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetResourcePolicy API operation for Redshift Serverless. -// -// Returns a resource policy. -// -// 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 Redshift Serverless's -// API operation GetResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetResourcePolicy -func (c *RedshiftServerless) GetResourcePolicy(input *GetResourcePolicyInput) (*GetResourcePolicyOutput, error) { - req, out := c.GetResourcePolicyRequest(input) - return out, req.Send() -} - -// GetResourcePolicyWithContext is the same as GetResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetResourcePolicy 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 *RedshiftServerless) GetResourcePolicyWithContext(ctx aws.Context, input *GetResourcePolicyInput, opts ...request.Option) (*GetResourcePolicyOutput, error) { - req, out := c.GetResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSnapshot = "GetSnapshot" - -// GetSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the GetSnapshot 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 GetSnapshot for more information on using the GetSnapshot -// 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 GetSnapshotRequest method. -// req, resp := client.GetSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetSnapshot -func (c *RedshiftServerless) GetSnapshotRequest(input *GetSnapshotInput) (req *request.Request, output *GetSnapshotOutput) { - op := &request.Operation{ - Name: opGetSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSnapshotInput{} - } - - output = &GetSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSnapshot API operation for Redshift Serverless. -// -// Returns information about a specific snapshot. -// -// 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 Redshift Serverless's -// API operation GetSnapshot for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetSnapshot -func (c *RedshiftServerless) GetSnapshot(input *GetSnapshotInput) (*GetSnapshotOutput, error) { - req, out := c.GetSnapshotRequest(input) - return out, req.Send() -} - -// GetSnapshotWithContext is the same as GetSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See GetSnapshot 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 *RedshiftServerless) GetSnapshotWithContext(ctx aws.Context, input *GetSnapshotInput, opts ...request.Option) (*GetSnapshotOutput, error) { - req, out := c.GetSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTableRestoreStatus = "GetTableRestoreStatus" - -// GetTableRestoreStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetTableRestoreStatus 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 GetTableRestoreStatus for more information on using the GetTableRestoreStatus -// 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 GetTableRestoreStatusRequest method. -// req, resp := client.GetTableRestoreStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetTableRestoreStatus -func (c *RedshiftServerless) GetTableRestoreStatusRequest(input *GetTableRestoreStatusInput) (req *request.Request, output *GetTableRestoreStatusOutput) { - op := &request.Operation{ - Name: opGetTableRestoreStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTableRestoreStatusInput{} - } - - output = &GetTableRestoreStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTableRestoreStatus API operation for Redshift Serverless. -// -// Returns information about a TableRestoreStatus object. -// -// 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 Redshift Serverless's -// API operation GetTableRestoreStatus for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetTableRestoreStatus -func (c *RedshiftServerless) GetTableRestoreStatus(input *GetTableRestoreStatusInput) (*GetTableRestoreStatusOutput, error) { - req, out := c.GetTableRestoreStatusRequest(input) - return out, req.Send() -} - -// GetTableRestoreStatusWithContext is the same as GetTableRestoreStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetTableRestoreStatus 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 *RedshiftServerless) GetTableRestoreStatusWithContext(ctx aws.Context, input *GetTableRestoreStatusInput, opts ...request.Option) (*GetTableRestoreStatusOutput, error) { - req, out := c.GetTableRestoreStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetUsageLimit = "GetUsageLimit" - -// GetUsageLimitRequest generates a "aws/request.Request" representing the -// client's request for the GetUsageLimit 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 GetUsageLimit for more information on using the GetUsageLimit -// 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 GetUsageLimitRequest method. -// req, resp := client.GetUsageLimitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetUsageLimit -func (c *RedshiftServerless) GetUsageLimitRequest(input *GetUsageLimitInput) (req *request.Request, output *GetUsageLimitOutput) { - op := &request.Operation{ - Name: opGetUsageLimit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetUsageLimitInput{} - } - - output = &GetUsageLimitOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetUsageLimit API operation for Redshift Serverless. -// -// Returns information about a usage limit. -// -// 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 Redshift Serverless's -// API operation GetUsageLimit for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetUsageLimit -func (c *RedshiftServerless) GetUsageLimit(input *GetUsageLimitInput) (*GetUsageLimitOutput, error) { - req, out := c.GetUsageLimitRequest(input) - return out, req.Send() -} - -// GetUsageLimitWithContext is the same as GetUsageLimit with the addition of -// the ability to pass a context and additional request options. -// -// See GetUsageLimit 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 *RedshiftServerless) GetUsageLimitWithContext(ctx aws.Context, input *GetUsageLimitInput, opts ...request.Option) (*GetUsageLimitOutput, error) { - req, out := c.GetUsageLimitRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWorkgroup = "GetWorkgroup" - -// GetWorkgroupRequest generates a "aws/request.Request" representing the -// client's request for the GetWorkgroup 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 GetWorkgroup for more information on using the GetWorkgroup -// 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 GetWorkgroupRequest method. -// req, resp := client.GetWorkgroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetWorkgroup -func (c *RedshiftServerless) GetWorkgroupRequest(input *GetWorkgroupInput) (req *request.Request, output *GetWorkgroupOutput) { - op := &request.Operation{ - Name: opGetWorkgroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetWorkgroupInput{} - } - - output = &GetWorkgroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWorkgroup API operation for Redshift Serverless. -// -// Returns information about a specific workgroup. -// -// 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 Redshift Serverless's -// API operation GetWorkgroup for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/GetWorkgroup -func (c *RedshiftServerless) GetWorkgroup(input *GetWorkgroupInput) (*GetWorkgroupOutput, error) { - req, out := c.GetWorkgroupRequest(input) - return out, req.Send() -} - -// GetWorkgroupWithContext is the same as GetWorkgroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetWorkgroup 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 *RedshiftServerless) GetWorkgroupWithContext(ctx aws.Context, input *GetWorkgroupInput, opts ...request.Option) (*GetWorkgroupOutput, error) { - req, out := c.GetWorkgroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCustomDomainAssociations = "ListCustomDomainAssociations" - -// ListCustomDomainAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the ListCustomDomainAssociations 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 ListCustomDomainAssociations for more information on using the ListCustomDomainAssociations -// 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 ListCustomDomainAssociationsRequest method. -// req, resp := client.ListCustomDomainAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListCustomDomainAssociations -func (c *RedshiftServerless) ListCustomDomainAssociationsRequest(input *ListCustomDomainAssociationsInput) (req *request.Request, output *ListCustomDomainAssociationsOutput) { - op := &request.Operation{ - Name: opListCustomDomainAssociations, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCustomDomainAssociationsInput{} - } - - output = &ListCustomDomainAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCustomDomainAssociations API operation for Redshift Serverless. -// -// Lists custom domain associations for Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation ListCustomDomainAssociations for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - InvalidPaginationException -// The provided pagination token is invalid. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListCustomDomainAssociations -func (c *RedshiftServerless) ListCustomDomainAssociations(input *ListCustomDomainAssociationsInput) (*ListCustomDomainAssociationsOutput, error) { - req, out := c.ListCustomDomainAssociationsRequest(input) - return out, req.Send() -} - -// ListCustomDomainAssociationsWithContext is the same as ListCustomDomainAssociations with the addition of -// the ability to pass a context and additional request options. -// -// See ListCustomDomainAssociations 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 *RedshiftServerless) ListCustomDomainAssociationsWithContext(ctx aws.Context, input *ListCustomDomainAssociationsInput, opts ...request.Option) (*ListCustomDomainAssociationsOutput, error) { - req, out := c.ListCustomDomainAssociationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCustomDomainAssociationsPages iterates over the pages of a ListCustomDomainAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCustomDomainAssociations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCustomDomainAssociations operation. -// pageNum := 0 -// err := client.ListCustomDomainAssociationsPages(params, -// func(page *redshiftserverless.ListCustomDomainAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RedshiftServerless) ListCustomDomainAssociationsPages(input *ListCustomDomainAssociationsInput, fn func(*ListCustomDomainAssociationsOutput, bool) bool) error { - return c.ListCustomDomainAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCustomDomainAssociationsPagesWithContext same as ListCustomDomainAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RedshiftServerless) ListCustomDomainAssociationsPagesWithContext(ctx aws.Context, input *ListCustomDomainAssociationsInput, fn func(*ListCustomDomainAssociationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCustomDomainAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCustomDomainAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCustomDomainAssociationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEndpointAccess = "ListEndpointAccess" - -// ListEndpointAccessRequest generates a "aws/request.Request" representing the -// client's request for the ListEndpointAccess 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 ListEndpointAccess for more information on using the ListEndpointAccess -// 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 ListEndpointAccessRequest method. -// req, resp := client.ListEndpointAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListEndpointAccess -func (c *RedshiftServerless) ListEndpointAccessRequest(input *ListEndpointAccessInput) (req *request.Request, output *ListEndpointAccessOutput) { - op := &request.Operation{ - Name: opListEndpointAccess, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEndpointAccessInput{} - } - - output = &ListEndpointAccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEndpointAccess API operation for Redshift Serverless. -// -// Returns an array of EndpointAccess objects and relevant information. -// -// 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 Redshift Serverless's -// API operation ListEndpointAccess for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListEndpointAccess -func (c *RedshiftServerless) ListEndpointAccess(input *ListEndpointAccessInput) (*ListEndpointAccessOutput, error) { - req, out := c.ListEndpointAccessRequest(input) - return out, req.Send() -} - -// ListEndpointAccessWithContext is the same as ListEndpointAccess with the addition of -// the ability to pass a context and additional request options. -// -// See ListEndpointAccess 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 *RedshiftServerless) ListEndpointAccessWithContext(ctx aws.Context, input *ListEndpointAccessInput, opts ...request.Option) (*ListEndpointAccessOutput, error) { - req, out := c.ListEndpointAccessRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEndpointAccessPages iterates over the pages of a ListEndpointAccess operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEndpointAccess method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEndpointAccess operation. -// pageNum := 0 -// err := client.ListEndpointAccessPages(params, -// func(page *redshiftserverless.ListEndpointAccessOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RedshiftServerless) ListEndpointAccessPages(input *ListEndpointAccessInput, fn func(*ListEndpointAccessOutput, bool) bool) error { - return c.ListEndpointAccessPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEndpointAccessPagesWithContext same as ListEndpointAccessPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RedshiftServerless) ListEndpointAccessPagesWithContext(ctx aws.Context, input *ListEndpointAccessInput, fn func(*ListEndpointAccessOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEndpointAccessInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEndpointAccessRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEndpointAccessOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListNamespaces = "ListNamespaces" - -// ListNamespacesRequest generates a "aws/request.Request" representing the -// client's request for the ListNamespaces 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 ListNamespaces for more information on using the ListNamespaces -// 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 ListNamespacesRequest method. -// req, resp := client.ListNamespacesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListNamespaces -func (c *RedshiftServerless) ListNamespacesRequest(input *ListNamespacesInput) (req *request.Request, output *ListNamespacesOutput) { - op := &request.Operation{ - Name: opListNamespaces, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListNamespacesInput{} - } - - output = &ListNamespacesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListNamespaces API operation for Redshift Serverless. -// -// Returns information about a list of specified namespaces. -// -// 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 Redshift Serverless's -// API operation ListNamespaces for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListNamespaces -func (c *RedshiftServerless) ListNamespaces(input *ListNamespacesInput) (*ListNamespacesOutput, error) { - req, out := c.ListNamespacesRequest(input) - return out, req.Send() -} - -// ListNamespacesWithContext is the same as ListNamespaces with the addition of -// the ability to pass a context and additional request options. -// -// See ListNamespaces 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 *RedshiftServerless) ListNamespacesWithContext(ctx aws.Context, input *ListNamespacesInput, opts ...request.Option) (*ListNamespacesOutput, error) { - req, out := c.ListNamespacesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListNamespacesPages iterates over the pages of a ListNamespaces operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNamespaces method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListNamespaces operation. -// pageNum := 0 -// err := client.ListNamespacesPages(params, -// func(page *redshiftserverless.ListNamespacesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RedshiftServerless) ListNamespacesPages(input *ListNamespacesInput, fn func(*ListNamespacesOutput, bool) bool) error { - return c.ListNamespacesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNamespacesPagesWithContext same as ListNamespacesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RedshiftServerless) ListNamespacesPagesWithContext(ctx aws.Context, input *ListNamespacesInput, fn func(*ListNamespacesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListNamespacesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListNamespacesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListNamespacesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRecoveryPoints = "ListRecoveryPoints" - -// ListRecoveryPointsRequest generates a "aws/request.Request" representing the -// client's request for the ListRecoveryPoints 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 ListRecoveryPoints for more information on using the ListRecoveryPoints -// 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 ListRecoveryPointsRequest method. -// req, resp := client.ListRecoveryPointsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListRecoveryPoints -func (c *RedshiftServerless) ListRecoveryPointsRequest(input *ListRecoveryPointsInput) (req *request.Request, output *ListRecoveryPointsOutput) { - op := &request.Operation{ - Name: opListRecoveryPoints, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRecoveryPointsInput{} - } - - output = &ListRecoveryPointsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRecoveryPoints API operation for Redshift Serverless. -// -// Returns an array of recovery points. -// -// 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 Redshift Serverless's -// API operation ListRecoveryPoints for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListRecoveryPoints -func (c *RedshiftServerless) ListRecoveryPoints(input *ListRecoveryPointsInput) (*ListRecoveryPointsOutput, error) { - req, out := c.ListRecoveryPointsRequest(input) - return out, req.Send() -} - -// ListRecoveryPointsWithContext is the same as ListRecoveryPoints with the addition of -// the ability to pass a context and additional request options. -// -// See ListRecoveryPoints 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 *RedshiftServerless) ListRecoveryPointsWithContext(ctx aws.Context, input *ListRecoveryPointsInput, opts ...request.Option) (*ListRecoveryPointsOutput, error) { - req, out := c.ListRecoveryPointsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRecoveryPointsPages iterates over the pages of a ListRecoveryPoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRecoveryPoints method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRecoveryPoints operation. -// pageNum := 0 -// err := client.ListRecoveryPointsPages(params, -// func(page *redshiftserverless.ListRecoveryPointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RedshiftServerless) ListRecoveryPointsPages(input *ListRecoveryPointsInput, fn func(*ListRecoveryPointsOutput, bool) bool) error { - return c.ListRecoveryPointsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRecoveryPointsPagesWithContext same as ListRecoveryPointsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RedshiftServerless) ListRecoveryPointsPagesWithContext(ctx aws.Context, input *ListRecoveryPointsInput, fn func(*ListRecoveryPointsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRecoveryPointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRecoveryPointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRecoveryPointsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSnapshots = "ListSnapshots" - -// ListSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the ListSnapshots 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 ListSnapshots for more information on using the ListSnapshots -// 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 ListSnapshotsRequest method. -// req, resp := client.ListSnapshotsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListSnapshots -func (c *RedshiftServerless) ListSnapshotsRequest(input *ListSnapshotsInput) (req *request.Request, output *ListSnapshotsOutput) { - op := &request.Operation{ - Name: opListSnapshots, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSnapshotsInput{} - } - - output = &ListSnapshotsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSnapshots API operation for Redshift Serverless. -// -// Returns a list of snapshots. -// -// 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 Redshift Serverless's -// API operation ListSnapshots for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListSnapshots -func (c *RedshiftServerless) ListSnapshots(input *ListSnapshotsInput) (*ListSnapshotsOutput, error) { - req, out := c.ListSnapshotsRequest(input) - return out, req.Send() -} - -// ListSnapshotsWithContext is the same as ListSnapshots with the addition of -// the ability to pass a context and additional request options. -// -// See ListSnapshots 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 *RedshiftServerless) ListSnapshotsWithContext(ctx aws.Context, input *ListSnapshotsInput, opts ...request.Option) (*ListSnapshotsOutput, error) { - req, out := c.ListSnapshotsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSnapshotsPages iterates over the pages of a ListSnapshots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSnapshots method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSnapshots operation. -// pageNum := 0 -// err := client.ListSnapshotsPages(params, -// func(page *redshiftserverless.ListSnapshotsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RedshiftServerless) ListSnapshotsPages(input *ListSnapshotsInput, fn func(*ListSnapshotsOutput, bool) bool) error { - return c.ListSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSnapshotsPagesWithContext same as ListSnapshotsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RedshiftServerless) ListSnapshotsPagesWithContext(ctx aws.Context, input *ListSnapshotsInput, fn func(*ListSnapshotsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSnapshotsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSnapshotsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSnapshotsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTableRestoreStatus = "ListTableRestoreStatus" - -// ListTableRestoreStatusRequest generates a "aws/request.Request" representing the -// client's request for the ListTableRestoreStatus 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 ListTableRestoreStatus for more information on using the ListTableRestoreStatus -// 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 ListTableRestoreStatusRequest method. -// req, resp := client.ListTableRestoreStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListTableRestoreStatus -func (c *RedshiftServerless) ListTableRestoreStatusRequest(input *ListTableRestoreStatusInput) (req *request.Request, output *ListTableRestoreStatusOutput) { - op := &request.Operation{ - Name: opListTableRestoreStatus, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTableRestoreStatusInput{} - } - - output = &ListTableRestoreStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTableRestoreStatus API operation for Redshift Serverless. -// -// Returns information about an array of TableRestoreStatus objects. -// -// 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 Redshift Serverless's -// API operation ListTableRestoreStatus for usage and error information. -// -// Returned Error Types: -// -// - InvalidPaginationException -// The provided pagination token is invalid. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListTableRestoreStatus -func (c *RedshiftServerless) ListTableRestoreStatus(input *ListTableRestoreStatusInput) (*ListTableRestoreStatusOutput, error) { - req, out := c.ListTableRestoreStatusRequest(input) - return out, req.Send() -} - -// ListTableRestoreStatusWithContext is the same as ListTableRestoreStatus with the addition of -// the ability to pass a context and additional request options. -// -// See ListTableRestoreStatus 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 *RedshiftServerless) ListTableRestoreStatusWithContext(ctx aws.Context, input *ListTableRestoreStatusInput, opts ...request.Option) (*ListTableRestoreStatusOutput, error) { - req, out := c.ListTableRestoreStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTableRestoreStatusPages iterates over the pages of a ListTableRestoreStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTableRestoreStatus method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTableRestoreStatus operation. -// pageNum := 0 -// err := client.ListTableRestoreStatusPages(params, -// func(page *redshiftserverless.ListTableRestoreStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RedshiftServerless) ListTableRestoreStatusPages(input *ListTableRestoreStatusInput, fn func(*ListTableRestoreStatusOutput, bool) bool) error { - return c.ListTableRestoreStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTableRestoreStatusPagesWithContext same as ListTableRestoreStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RedshiftServerless) ListTableRestoreStatusPagesWithContext(ctx aws.Context, input *ListTableRestoreStatusInput, fn func(*ListTableRestoreStatusOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTableRestoreStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTableRestoreStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTableRestoreStatusOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListTagsForResource -func (c *RedshiftServerless) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Redshift Serverless. -// -// Lists the tags assigned to a resource. -// -// 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 Redshift Serverless's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListTagsForResource -func (c *RedshiftServerless) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *RedshiftServerless) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListUsageLimits = "ListUsageLimits" - -// ListUsageLimitsRequest generates a "aws/request.Request" representing the -// client's request for the ListUsageLimits 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 ListUsageLimits for more information on using the ListUsageLimits -// 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 ListUsageLimitsRequest method. -// req, resp := client.ListUsageLimitsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListUsageLimits -func (c *RedshiftServerless) ListUsageLimitsRequest(input *ListUsageLimitsInput) (req *request.Request, output *ListUsageLimitsOutput) { - op := &request.Operation{ - Name: opListUsageLimits, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListUsageLimitsInput{} - } - - output = &ListUsageLimitsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListUsageLimits API operation for Redshift Serverless. -// -// Lists all usage limits within Amazon Redshift Serverless. -// -// 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 Redshift Serverless's -// API operation ListUsageLimits for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - InvalidPaginationException -// The provided pagination token is invalid. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListUsageLimits -func (c *RedshiftServerless) ListUsageLimits(input *ListUsageLimitsInput) (*ListUsageLimitsOutput, error) { - req, out := c.ListUsageLimitsRequest(input) - return out, req.Send() -} - -// ListUsageLimitsWithContext is the same as ListUsageLimits with the addition of -// the ability to pass a context and additional request options. -// -// See ListUsageLimits 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 *RedshiftServerless) ListUsageLimitsWithContext(ctx aws.Context, input *ListUsageLimitsInput, opts ...request.Option) (*ListUsageLimitsOutput, error) { - req, out := c.ListUsageLimitsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListUsageLimitsPages iterates over the pages of a ListUsageLimits operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUsageLimits method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListUsageLimits operation. -// pageNum := 0 -// err := client.ListUsageLimitsPages(params, -// func(page *redshiftserverless.ListUsageLimitsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RedshiftServerless) ListUsageLimitsPages(input *ListUsageLimitsInput, fn func(*ListUsageLimitsOutput, bool) bool) error { - return c.ListUsageLimitsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListUsageLimitsPagesWithContext same as ListUsageLimitsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RedshiftServerless) ListUsageLimitsPagesWithContext(ctx aws.Context, input *ListUsageLimitsInput, fn func(*ListUsageLimitsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListUsageLimitsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListUsageLimitsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListUsageLimitsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListWorkgroups = "ListWorkgroups" - -// ListWorkgroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkgroups 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 ListWorkgroups for more information on using the ListWorkgroups -// 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 ListWorkgroupsRequest method. -// req, resp := client.ListWorkgroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListWorkgroups -func (c *RedshiftServerless) ListWorkgroupsRequest(input *ListWorkgroupsInput) (req *request.Request, output *ListWorkgroupsOutput) { - op := &request.Operation{ - Name: opListWorkgroups, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListWorkgroupsInput{} - } - - output = &ListWorkgroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWorkgroups API operation for Redshift Serverless. -// -// Returns information about a list of specified workgroups. -// -// 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 Redshift Serverless's -// API operation ListWorkgroups for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/ListWorkgroups -func (c *RedshiftServerless) ListWorkgroups(input *ListWorkgroupsInput) (*ListWorkgroupsOutput, error) { - req, out := c.ListWorkgroupsRequest(input) - return out, req.Send() -} - -// ListWorkgroupsWithContext is the same as ListWorkgroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListWorkgroups 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 *RedshiftServerless) ListWorkgroupsWithContext(ctx aws.Context, input *ListWorkgroupsInput, opts ...request.Option) (*ListWorkgroupsOutput, error) { - req, out := c.ListWorkgroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListWorkgroupsPages iterates over the pages of a ListWorkgroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListWorkgroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListWorkgroups operation. -// pageNum := 0 -// err := client.ListWorkgroupsPages(params, -// func(page *redshiftserverless.ListWorkgroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RedshiftServerless) ListWorkgroupsPages(input *ListWorkgroupsInput, fn func(*ListWorkgroupsOutput, bool) bool) error { - return c.ListWorkgroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListWorkgroupsPagesWithContext same as ListWorkgroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RedshiftServerless) ListWorkgroupsPagesWithContext(ctx aws.Context, input *ListWorkgroupsInput, fn func(*ListWorkgroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkgroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkgroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListWorkgroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutResourcePolicy = "PutResourcePolicy" - -// PutResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutResourcePolicy 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 PutResourcePolicy for more information on using the PutResourcePolicy -// 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 PutResourcePolicyRequest method. -// req, resp := client.PutResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/PutResourcePolicy -func (c *RedshiftServerless) PutResourcePolicyRequest(input *PutResourcePolicyInput) (req *request.Request, output *PutResourcePolicyOutput) { - op := &request.Operation{ - Name: opPutResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutResourcePolicyInput{} - } - - output = &PutResourcePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutResourcePolicy API operation for Redshift Serverless. -// -// Creates or updates a resource policy. Currently, you can use policies to -// share snapshots across Amazon Web Services accounts. -// -// 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 Redshift Serverless's -// API operation PutResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - ServiceQuotaExceededException -// The service limit was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/PutResourcePolicy -func (c *RedshiftServerless) PutResourcePolicy(input *PutResourcePolicyInput) (*PutResourcePolicyOutput, error) { - req, out := c.PutResourcePolicyRequest(input) - return out, req.Send() -} - -// PutResourcePolicyWithContext is the same as PutResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutResourcePolicy 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 *RedshiftServerless) PutResourcePolicyWithContext(ctx aws.Context, input *PutResourcePolicyInput, opts ...request.Option) (*PutResourcePolicyOutput, error) { - req, out := c.PutResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreFromRecoveryPoint = "RestoreFromRecoveryPoint" - -// RestoreFromRecoveryPointRequest generates a "aws/request.Request" representing the -// client's request for the RestoreFromRecoveryPoint 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 RestoreFromRecoveryPoint for more information on using the RestoreFromRecoveryPoint -// 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 RestoreFromRecoveryPointRequest method. -// req, resp := client.RestoreFromRecoveryPointRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/RestoreFromRecoveryPoint -func (c *RedshiftServerless) RestoreFromRecoveryPointRequest(input *RestoreFromRecoveryPointInput) (req *request.Request, output *RestoreFromRecoveryPointOutput) { - op := &request.Operation{ - Name: opRestoreFromRecoveryPoint, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreFromRecoveryPointInput{} - } - - output = &RestoreFromRecoveryPointOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreFromRecoveryPoint API operation for Redshift Serverless. -// -// Restore the data from a recovery point. -// -// 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 Redshift Serverless's -// API operation RestoreFromRecoveryPoint for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/RestoreFromRecoveryPoint -func (c *RedshiftServerless) RestoreFromRecoveryPoint(input *RestoreFromRecoveryPointInput) (*RestoreFromRecoveryPointOutput, error) { - req, out := c.RestoreFromRecoveryPointRequest(input) - return out, req.Send() -} - -// RestoreFromRecoveryPointWithContext is the same as RestoreFromRecoveryPoint with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreFromRecoveryPoint 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 *RedshiftServerless) RestoreFromRecoveryPointWithContext(ctx aws.Context, input *RestoreFromRecoveryPointInput, opts ...request.Option) (*RestoreFromRecoveryPointOutput, error) { - req, out := c.RestoreFromRecoveryPointRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreFromSnapshot = "RestoreFromSnapshot" - -// RestoreFromSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the RestoreFromSnapshot 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 RestoreFromSnapshot for more information on using the RestoreFromSnapshot -// 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 RestoreFromSnapshotRequest method. -// req, resp := client.RestoreFromSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/RestoreFromSnapshot -func (c *RedshiftServerless) RestoreFromSnapshotRequest(input *RestoreFromSnapshotInput) (req *request.Request, output *RestoreFromSnapshotOutput) { - op := &request.Operation{ - Name: opRestoreFromSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreFromSnapshotInput{} - } - - output = &RestoreFromSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreFromSnapshot API operation for Redshift Serverless. -// -// Restores a namespace from a snapshot. -// -// 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 Redshift Serverless's -// API operation RestoreFromSnapshot for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - ServiceQuotaExceededException -// The service limit was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/RestoreFromSnapshot -func (c *RedshiftServerless) RestoreFromSnapshot(input *RestoreFromSnapshotInput) (*RestoreFromSnapshotOutput, error) { - req, out := c.RestoreFromSnapshotRequest(input) - return out, req.Send() -} - -// RestoreFromSnapshotWithContext is the same as RestoreFromSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreFromSnapshot 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 *RedshiftServerless) RestoreFromSnapshotWithContext(ctx aws.Context, input *RestoreFromSnapshotInput, opts ...request.Option) (*RestoreFromSnapshotOutput, error) { - req, out := c.RestoreFromSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreTableFromSnapshot = "RestoreTableFromSnapshot" - -// RestoreTableFromSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the RestoreTableFromSnapshot 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 RestoreTableFromSnapshot for more information on using the RestoreTableFromSnapshot -// 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 RestoreTableFromSnapshotRequest method. -// req, resp := client.RestoreTableFromSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/RestoreTableFromSnapshot -func (c *RedshiftServerless) RestoreTableFromSnapshotRequest(input *RestoreTableFromSnapshotInput) (req *request.Request, output *RestoreTableFromSnapshotOutput) { - op := &request.Operation{ - Name: opRestoreTableFromSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreTableFromSnapshotInput{} - } - - output = &RestoreTableFromSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreTableFromSnapshot API operation for Redshift Serverless. -// -// Restores a table from a snapshot to your Amazon Redshift Serverless instance. -// You can't use this operation to restore tables with interleaved sort keys -// (https://docs.aws.amazon.com/redshift/latest/dg/t_Sorting_data.html#t_Sorting_data-interleaved). -// -// 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 Redshift Serverless's -// API operation RestoreTableFromSnapshot for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/RestoreTableFromSnapshot -func (c *RedshiftServerless) RestoreTableFromSnapshot(input *RestoreTableFromSnapshotInput) (*RestoreTableFromSnapshotOutput, error) { - req, out := c.RestoreTableFromSnapshotRequest(input) - return out, req.Send() -} - -// RestoreTableFromSnapshotWithContext is the same as RestoreTableFromSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreTableFromSnapshot 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 *RedshiftServerless) RestoreTableFromSnapshotWithContext(ctx aws.Context, input *RestoreTableFromSnapshotInput, opts ...request.Option) (*RestoreTableFromSnapshotOutput, error) { - req, out := c.RestoreTableFromSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/TagResource -func (c *RedshiftServerless) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Redshift Serverless. -// -// Assigns one or more tags to a resource. -// -// 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 Redshift Serverless's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - TooManyTagsException -// The request exceeded the number of tags allowed for a resource. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/TagResource -func (c *RedshiftServerless) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *RedshiftServerless) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UntagResource -func (c *RedshiftServerless) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Redshift Serverless. -// -// Removes a tag or set of tags from a resource. -// -// 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 Redshift Serverless's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UntagResource -func (c *RedshiftServerless) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *RedshiftServerless) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCustomDomainAssociation = "UpdateCustomDomainAssociation" - -// UpdateCustomDomainAssociationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCustomDomainAssociation 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 UpdateCustomDomainAssociation for more information on using the UpdateCustomDomainAssociation -// 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 UpdateCustomDomainAssociationRequest method. -// req, resp := client.UpdateCustomDomainAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateCustomDomainAssociation -func (c *RedshiftServerless) UpdateCustomDomainAssociationRequest(input *UpdateCustomDomainAssociationInput) (req *request.Request, output *UpdateCustomDomainAssociationOutput) { - op := &request.Operation{ - Name: opUpdateCustomDomainAssociation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateCustomDomainAssociationInput{} - } - - output = &UpdateCustomDomainAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateCustomDomainAssociation API operation for Redshift Serverless. -// -// Updates an Amazon Redshift Serverless certificate associated with a custom -// domain. -// -// 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 Redshift Serverless's -// API operation UpdateCustomDomainAssociation for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateCustomDomainAssociation -func (c *RedshiftServerless) UpdateCustomDomainAssociation(input *UpdateCustomDomainAssociationInput) (*UpdateCustomDomainAssociationOutput, error) { - req, out := c.UpdateCustomDomainAssociationRequest(input) - return out, req.Send() -} - -// UpdateCustomDomainAssociationWithContext is the same as UpdateCustomDomainAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCustomDomainAssociation 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 *RedshiftServerless) UpdateCustomDomainAssociationWithContext(ctx aws.Context, input *UpdateCustomDomainAssociationInput, opts ...request.Option) (*UpdateCustomDomainAssociationOutput, error) { - req, out := c.UpdateCustomDomainAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateEndpointAccess = "UpdateEndpointAccess" - -// UpdateEndpointAccessRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEndpointAccess 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 UpdateEndpointAccess for more information on using the UpdateEndpointAccess -// 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 UpdateEndpointAccessRequest method. -// req, resp := client.UpdateEndpointAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateEndpointAccess -func (c *RedshiftServerless) UpdateEndpointAccessRequest(input *UpdateEndpointAccessInput) (req *request.Request, output *UpdateEndpointAccessOutput) { - op := &request.Operation{ - Name: opUpdateEndpointAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateEndpointAccessInput{} - } - - output = &UpdateEndpointAccessOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateEndpointAccess API operation for Redshift Serverless. -// -// Updates an Amazon Redshift Serverless managed endpoint. -// -// 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 Redshift Serverless's -// API operation UpdateEndpointAccess for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateEndpointAccess -func (c *RedshiftServerless) UpdateEndpointAccess(input *UpdateEndpointAccessInput) (*UpdateEndpointAccessOutput, error) { - req, out := c.UpdateEndpointAccessRequest(input) - return out, req.Send() -} - -// UpdateEndpointAccessWithContext is the same as UpdateEndpointAccess with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateEndpointAccess 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 *RedshiftServerless) UpdateEndpointAccessWithContext(ctx aws.Context, input *UpdateEndpointAccessInput, opts ...request.Option) (*UpdateEndpointAccessOutput, error) { - req, out := c.UpdateEndpointAccessRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateNamespace = "UpdateNamespace" - -// UpdateNamespaceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateNamespace 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 UpdateNamespace for more information on using the UpdateNamespace -// 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 UpdateNamespaceRequest method. -// req, resp := client.UpdateNamespaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateNamespace -func (c *RedshiftServerless) UpdateNamespaceRequest(input *UpdateNamespaceInput) (req *request.Request, output *UpdateNamespaceOutput) { - op := &request.Operation{ - Name: opUpdateNamespace, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateNamespaceInput{} - } - - output = &UpdateNamespaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateNamespace API operation for Redshift Serverless. -// -// Updates a namespace with the specified settings. Unless required, you can't -// update multiple parameters in one request. For example, you must specify -// both adminUsername and adminUserPassword to update either field, but you -// can't update both kmsKeyId and logExports in a single request. -// -// 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 Redshift Serverless's -// API operation UpdateNamespace for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateNamespace -func (c *RedshiftServerless) UpdateNamespace(input *UpdateNamespaceInput) (*UpdateNamespaceOutput, error) { - req, out := c.UpdateNamespaceRequest(input) - return out, req.Send() -} - -// UpdateNamespaceWithContext is the same as UpdateNamespace with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateNamespace 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 *RedshiftServerless) UpdateNamespaceWithContext(ctx aws.Context, input *UpdateNamespaceInput, opts ...request.Option) (*UpdateNamespaceOutput, error) { - req, out := c.UpdateNamespaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSnapshot = "UpdateSnapshot" - -// UpdateSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSnapshot 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 UpdateSnapshot for more information on using the UpdateSnapshot -// 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 UpdateSnapshotRequest method. -// req, resp := client.UpdateSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateSnapshot -func (c *RedshiftServerless) UpdateSnapshotRequest(input *UpdateSnapshotInput) (req *request.Request, output *UpdateSnapshotOutput) { - op := &request.Operation{ - Name: opUpdateSnapshot, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSnapshotInput{} - } - - output = &UpdateSnapshotOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSnapshot API operation for Redshift Serverless. -// -// Updates a snapshot. -// -// 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 Redshift Serverless's -// API operation UpdateSnapshot for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateSnapshot -func (c *RedshiftServerless) UpdateSnapshot(input *UpdateSnapshotInput) (*UpdateSnapshotOutput, error) { - req, out := c.UpdateSnapshotRequest(input) - return out, req.Send() -} - -// UpdateSnapshotWithContext is the same as UpdateSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSnapshot 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 *RedshiftServerless) UpdateSnapshotWithContext(ctx aws.Context, input *UpdateSnapshotInput, opts ...request.Option) (*UpdateSnapshotOutput, error) { - req, out := c.UpdateSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateUsageLimit = "UpdateUsageLimit" - -// UpdateUsageLimitRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUsageLimit 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 UpdateUsageLimit for more information on using the UpdateUsageLimit -// 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 UpdateUsageLimitRequest method. -// req, resp := client.UpdateUsageLimitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateUsageLimit -func (c *RedshiftServerless) UpdateUsageLimitRequest(input *UpdateUsageLimitInput) (req *request.Request, output *UpdateUsageLimitOutput) { - op := &request.Operation{ - Name: opUpdateUsageLimit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateUsageLimitInput{} - } - - output = &UpdateUsageLimitOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateUsageLimit API operation for Redshift Serverless. -// -// Update a usage limit in Amazon Redshift Serverless. You can't update the -// usage type or period of a usage limit. -// -// 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 Redshift Serverless's -// API operation UpdateUsageLimit for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateUsageLimit -func (c *RedshiftServerless) UpdateUsageLimit(input *UpdateUsageLimitInput) (*UpdateUsageLimitOutput, error) { - req, out := c.UpdateUsageLimitRequest(input) - return out, req.Send() -} - -// UpdateUsageLimitWithContext is the same as UpdateUsageLimit with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateUsageLimit 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 *RedshiftServerless) UpdateUsageLimitWithContext(ctx aws.Context, input *UpdateUsageLimitInput, opts ...request.Option) (*UpdateUsageLimitOutput, error) { - req, out := c.UpdateUsageLimitRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWorkgroup = "UpdateWorkgroup" - -// UpdateWorkgroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWorkgroup 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 UpdateWorkgroup for more information on using the UpdateWorkgroup -// 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 UpdateWorkgroupRequest method. -// req, resp := client.UpdateWorkgroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateWorkgroup -func (c *RedshiftServerless) UpdateWorkgroupRequest(input *UpdateWorkgroupInput) (req *request.Request, output *UpdateWorkgroupOutput) { - op := &request.Operation{ - Name: opUpdateWorkgroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateWorkgroupInput{} - } - - output = &UpdateWorkgroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateWorkgroup API operation for Redshift Serverless. -// -// Updates a workgroup with the specified configuration settings. You can't -// update multiple parameters in one request. For example, you can update baseCapacity -// or port in a single request, but you can't update both in the same request. -// -// 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 Redshift Serverless's -// API operation UpdateWorkgroup for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception -// or failure. -// -// - InsufficientCapacityException -// There is an insufficient capacity to perform the action. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - ConflictException -// The submitted action has conflicts. -// -// - ValidationException -// The input failed to satisfy the constraints specified by an AWS service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21/UpdateWorkgroup -func (c *RedshiftServerless) UpdateWorkgroup(input *UpdateWorkgroupInput) (*UpdateWorkgroupOutput, error) { - req, out := c.UpdateWorkgroupRequest(input) - return out, req.Send() -} - -// UpdateWorkgroupWithContext is the same as UpdateWorkgroup with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWorkgroup 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 *RedshiftServerless) UpdateWorkgroupWithContext(ctx aws.Context, input *UpdateWorkgroupInput, opts ...request.Option) (*UpdateWorkgroupOutput, error) { - req, out := c.UpdateWorkgroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Code_ *string `locationName:"code" type:"string"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An object that represents the custom domain name association. -type Association struct { - _ struct{} `type:"structure"` - - // The custom domain name’s certificate Amazon resource name (ARN). - CustomDomainCertificateArn *string `locationName:"customDomainCertificateArn" min:"20" type:"string"` - - // The expiration time for the certificate. - CustomDomainCertificateExpiryTime *time.Time `locationName:"customDomainCertificateExpiryTime" type:"timestamp" timestampFormat:"iso8601"` - - // The custom domain name associated with the workgroup. - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string"` - - // The name of the workgroup associated with the database. - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 Association) 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 Association) GoString() string { - return s.String() -} - -// SetCustomDomainCertificateArn sets the CustomDomainCertificateArn field's value. -func (s *Association) SetCustomDomainCertificateArn(v string) *Association { - s.CustomDomainCertificateArn = &v - return s -} - -// SetCustomDomainCertificateExpiryTime sets the CustomDomainCertificateExpiryTime field's value. -func (s *Association) SetCustomDomainCertificateExpiryTime(v time.Time) *Association { - s.CustomDomainCertificateExpiryTime = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *Association) SetCustomDomainName(v string) *Association { - s.CustomDomainName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *Association) SetWorkgroupName(v string) *Association { - s.WorkgroupName = &v - return s -} - -// An array of key-value pairs to set for advanced control over Amazon Redshift -// Serverless. -type ConfigParameter struct { - _ struct{} `type:"structure"` - - // The key of the parameter. The options are auto_mv, datestyle, enable_case_sensitivity_identifier, - // enable_user_activity_logging, query_group, search_path, and query monitoring - // metrics that let you define performance boundaries. For more information - // about query monitoring rules and available metrics, see Query monitoring - // metrics for Amazon Redshift Serverless (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless). - ParameterKey *string `locationName:"parameterKey" type:"string"` - - // The value of the parameter to set. - ParameterValue *string `locationName:"parameterValue" 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 ConfigParameter) 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 ConfigParameter) GoString() string { - return s.String() -} - -// SetParameterKey sets the ParameterKey field's value. -func (s *ConfigParameter) SetParameterKey(v string) *ConfigParameter { - s.ParameterKey = &v - return s -} - -// SetParameterValue sets the ParameterValue field's value. -func (s *ConfigParameter) SetParameterValue(v string) *ConfigParameter { - s.ParameterValue = &v - return s -} - -// The submitted action has conflicts. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ConvertRecoveryPointToSnapshotInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the recovery point. - // - // RecoveryPointId is a required field - RecoveryPointId *string `locationName:"recoveryPointId" type:"string" required:"true"` - - // How long to retain the snapshot. - RetentionPeriod *int64 `locationName:"retentionPeriod" type:"integer"` - - // The name of the snapshot. - // - // SnapshotName is a required field - SnapshotName *string `locationName:"snapshotName" type:"string" required:"true"` - - // An array of Tag objects (https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_Tag.html) - // to associate with the created snapshot. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 ConvertRecoveryPointToSnapshotInput) 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 ConvertRecoveryPointToSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConvertRecoveryPointToSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConvertRecoveryPointToSnapshotInput"} - if s.RecoveryPointId == nil { - invalidParams.Add(request.NewErrParamRequired("RecoveryPointId")) - } - if s.SnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotName")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRecoveryPointId sets the RecoveryPointId field's value. -func (s *ConvertRecoveryPointToSnapshotInput) SetRecoveryPointId(v string) *ConvertRecoveryPointToSnapshotInput { - s.RecoveryPointId = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *ConvertRecoveryPointToSnapshotInput) SetRetentionPeriod(v int64) *ConvertRecoveryPointToSnapshotInput { - s.RetentionPeriod = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *ConvertRecoveryPointToSnapshotInput) SetSnapshotName(v string) *ConvertRecoveryPointToSnapshotInput { - s.SnapshotName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ConvertRecoveryPointToSnapshotInput) SetTags(v []*Tag) *ConvertRecoveryPointToSnapshotInput { - s.Tags = v - return s -} - -type ConvertRecoveryPointToSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The snapshot converted from the recovery point. - Snapshot *Snapshot `locationName:"snapshot" 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 ConvertRecoveryPointToSnapshotOutput) 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 ConvertRecoveryPointToSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *ConvertRecoveryPointToSnapshotOutput) SetSnapshot(v *Snapshot) *ConvertRecoveryPointToSnapshotOutput { - s.Snapshot = v - return s -} - -type CreateCustomDomainAssociationInput struct { - _ struct{} `type:"structure"` - - // The custom domain name’s certificate Amazon resource name (ARN). - // - // CustomDomainCertificateArn is a required field - CustomDomainCertificateArn *string `locationName:"customDomainCertificateArn" min:"20" type:"string" required:"true"` - - // The custom domain name to associate with the workgroup. - // - // CustomDomainName is a required field - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string" required:"true"` - - // The name of the workgroup associated with the database. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 CreateCustomDomainAssociationInput) 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 CreateCustomDomainAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCustomDomainAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCustomDomainAssociationInput"} - if s.CustomDomainCertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CustomDomainCertificateArn")) - } - if s.CustomDomainCertificateArn != nil && len(*s.CustomDomainCertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainCertificateArn", 20)) - } - if s.CustomDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("CustomDomainName")) - } - if s.CustomDomainName != nil && len(*s.CustomDomainName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainName", 1)) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomDomainCertificateArn sets the CustomDomainCertificateArn field's value. -func (s *CreateCustomDomainAssociationInput) SetCustomDomainCertificateArn(v string) *CreateCustomDomainAssociationInput { - s.CustomDomainCertificateArn = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *CreateCustomDomainAssociationInput) SetCustomDomainName(v string) *CreateCustomDomainAssociationInput { - s.CustomDomainName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *CreateCustomDomainAssociationInput) SetWorkgroupName(v string) *CreateCustomDomainAssociationInput { - s.WorkgroupName = &v - return s -} - -type CreateCustomDomainAssociationOutput struct { - _ struct{} `type:"structure"` - - // The custom domain name’s certificate Amazon resource name (ARN). - CustomDomainCertificateArn *string `locationName:"customDomainCertificateArn" min:"20" type:"string"` - - // The expiration time for the certificate. - CustomDomainCertificateExpiryTime *time.Time `locationName:"customDomainCertificateExpiryTime" type:"timestamp" timestampFormat:"iso8601"` - - // The custom domain name to associate with the workgroup. - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string"` - - // The name of the workgroup associated with the database. - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 CreateCustomDomainAssociationOutput) 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 CreateCustomDomainAssociationOutput) GoString() string { - return s.String() -} - -// SetCustomDomainCertificateArn sets the CustomDomainCertificateArn field's value. -func (s *CreateCustomDomainAssociationOutput) SetCustomDomainCertificateArn(v string) *CreateCustomDomainAssociationOutput { - s.CustomDomainCertificateArn = &v - return s -} - -// SetCustomDomainCertificateExpiryTime sets the CustomDomainCertificateExpiryTime field's value. -func (s *CreateCustomDomainAssociationOutput) SetCustomDomainCertificateExpiryTime(v time.Time) *CreateCustomDomainAssociationOutput { - s.CustomDomainCertificateExpiryTime = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *CreateCustomDomainAssociationOutput) SetCustomDomainName(v string) *CreateCustomDomainAssociationOutput { - s.CustomDomainName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *CreateCustomDomainAssociationOutput) SetWorkgroupName(v string) *CreateCustomDomainAssociationOutput { - s.WorkgroupName = &v - return s -} - -type CreateEndpointAccessInput struct { - _ struct{} `type:"structure"` - - // The name of the VPC endpoint. An endpoint name must contain 1-30 characters. - // Valid characters are A-Z, a-z, 0-9, and hyphen(-). The first character must - // be a letter. The name can't contain two consecutive hyphens or end with a - // hyphen. - // - // EndpointName is a required field - EndpointName *string `locationName:"endpointName" type:"string" required:"true"` - - // The unique identifers of subnets from which Amazon Redshift Serverless chooses - // one to deploy a VPC endpoint. - // - // SubnetIds is a required field - SubnetIds []*string `locationName:"subnetIds" type:"list" required:"true"` - - // The unique identifiers of the security group that defines the ports, protocols, - // and sources for inbound traffic that you are authorizing into your endpoint. - VpcSecurityGroupIds []*string `locationName:"vpcSecurityGroupIds" type:"list"` - - // The name of the workgroup to associate with the VPC endpoint. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" 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 CreateEndpointAccessInput) 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 CreateEndpointAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEndpointAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEndpointAccessInput"} - if s.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) - } - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointName sets the EndpointName field's value. -func (s *CreateEndpointAccessInput) SetEndpointName(v string) *CreateEndpointAccessInput { - s.EndpointName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateEndpointAccessInput) SetSubnetIds(v []*string) *CreateEndpointAccessInput { - s.SubnetIds = v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *CreateEndpointAccessInput) SetVpcSecurityGroupIds(v []*string) *CreateEndpointAccessInput { - s.VpcSecurityGroupIds = v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *CreateEndpointAccessInput) SetWorkgroupName(v string) *CreateEndpointAccessInput { - s.WorkgroupName = &v - return s -} - -type CreateEndpointAccessOutput struct { - _ struct{} `type:"structure"` - - // The created VPC endpoint. - Endpoint *EndpointAccess `locationName:"endpoint" 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 CreateEndpointAccessOutput) 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 CreateEndpointAccessOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *CreateEndpointAccessOutput) SetEndpoint(v *EndpointAccess) *CreateEndpointAccessOutput { - s.Endpoint = v - return s -} - -type CreateNamespaceInput struct { - _ struct{} `type:"structure"` - - // The ID of the Key Management Service (KMS) key used to encrypt and store - // the namespace's admin credentials secret. You can only use this parameter - // if manageAdminPassword is true. - AdminPasswordSecretKmsKeyId *string `locationName:"adminPasswordSecretKmsKeyId" type:"string"` - - // The password of the administrator for the first database created in the namespace. - // - // You can't use adminUserPassword if manageAdminPassword is true. - // - // AdminUserPassword is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateNamespaceInput's - // String and GoString methods. - AdminUserPassword *string `locationName:"adminUserPassword" type:"string" sensitive:"true"` - - // The username of the administrator for the first database created in the namespace. - // - // AdminUsername is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateNamespaceInput's - // String and GoString methods. - AdminUsername *string `locationName:"adminUsername" type:"string" sensitive:"true"` - - // The name of the first database created in the namespace. - DbName *string `locationName:"dbName" type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role to set as a default in the - // namespace. - DefaultIamRoleArn *string `locationName:"defaultIamRoleArn" type:"string"` - - // A list of IAM roles to associate with the namespace. - IamRoles []*string `locationName:"iamRoles" type:"list"` - - // The ID of the Amazon Web Services Key Management Service key used to encrypt - // your data. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The types of logs the namespace can export. Available export types are userlog, - // connectionlog, and useractivitylog. - LogExports []*string `locationName:"logExports" type:"list" enum:"LogExport"` - - // If true, Amazon Redshift uses Secrets Manager to manage the namespace's admin - // credentials. You can't use adminUserPassword if manageAdminPassword is true. - // If manageAdminPassword is false or not set, Amazon Redshift uses adminUserPassword - // for the admin user account's password. - ManageAdminPassword *bool `locationName:"manageAdminPassword" type:"boolean"` - - // The name of the namespace. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" min:"3" type:"string" required:"true"` - - // The ARN for the Redshift application that integrates with IAM Identity Center. - RedshiftIdcApplicationArn *string `locationName:"redshiftIdcApplicationArn" min:"1" type:"string"` - - // A list of tag instances. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateNamespaceInput) 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 CreateNamespaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNamespaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNamespaceInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.NamespaceName != nil && len(*s.NamespaceName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("NamespaceName", 3)) - } - if s.RedshiftIdcApplicationArn != nil && len(*s.RedshiftIdcApplicationArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RedshiftIdcApplicationArn", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdminPasswordSecretKmsKeyId sets the AdminPasswordSecretKmsKeyId field's value. -func (s *CreateNamespaceInput) SetAdminPasswordSecretKmsKeyId(v string) *CreateNamespaceInput { - s.AdminPasswordSecretKmsKeyId = &v - return s -} - -// SetAdminUserPassword sets the AdminUserPassword field's value. -func (s *CreateNamespaceInput) SetAdminUserPassword(v string) *CreateNamespaceInput { - s.AdminUserPassword = &v - return s -} - -// SetAdminUsername sets the AdminUsername field's value. -func (s *CreateNamespaceInput) SetAdminUsername(v string) *CreateNamespaceInput { - s.AdminUsername = &v - return s -} - -// SetDbName sets the DbName field's value. -func (s *CreateNamespaceInput) SetDbName(v string) *CreateNamespaceInput { - s.DbName = &v - return s -} - -// SetDefaultIamRoleArn sets the DefaultIamRoleArn field's value. -func (s *CreateNamespaceInput) SetDefaultIamRoleArn(v string) *CreateNamespaceInput { - s.DefaultIamRoleArn = &v - return s -} - -// SetIamRoles sets the IamRoles field's value. -func (s *CreateNamespaceInput) SetIamRoles(v []*string) *CreateNamespaceInput { - s.IamRoles = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateNamespaceInput) SetKmsKeyId(v string) *CreateNamespaceInput { - s.KmsKeyId = &v - return s -} - -// SetLogExports sets the LogExports field's value. -func (s *CreateNamespaceInput) SetLogExports(v []*string) *CreateNamespaceInput { - s.LogExports = v - return s -} - -// SetManageAdminPassword sets the ManageAdminPassword field's value. -func (s *CreateNamespaceInput) SetManageAdminPassword(v bool) *CreateNamespaceInput { - s.ManageAdminPassword = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *CreateNamespaceInput) SetNamespaceName(v string) *CreateNamespaceInput { - s.NamespaceName = &v - return s -} - -// SetRedshiftIdcApplicationArn sets the RedshiftIdcApplicationArn field's value. -func (s *CreateNamespaceInput) SetRedshiftIdcApplicationArn(v string) *CreateNamespaceInput { - s.RedshiftIdcApplicationArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateNamespaceInput) SetTags(v []*Tag) *CreateNamespaceInput { - s.Tags = v - return s -} - -type CreateNamespaceOutput struct { - _ struct{} `type:"structure"` - - // The created namespace object. - Namespace *Namespace `locationName:"namespace" 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 CreateNamespaceOutput) 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 CreateNamespaceOutput) GoString() string { - return s.String() -} - -// SetNamespace sets the Namespace field's value. -func (s *CreateNamespaceOutput) SetNamespace(v *Namespace) *CreateNamespaceOutput { - s.Namespace = v - return s -} - -type CreateSnapshotInput struct { - _ struct{} `type:"structure"` - - // The namespace to create a snapshot for. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" type:"string" required:"true"` - - // How long to retain the created snapshot. - RetentionPeriod *int64 `locationName:"retentionPeriod" type:"integer"` - - // The name of the snapshot. - // - // SnapshotName is a required field - SnapshotName *string `locationName:"snapshotName" type:"string" required:"true"` - - // An array of Tag objects (https://docs.aws.amazon.com/redshift-serverless/latest/APIReference/API_Tag.html) - // to associate with the snapshot. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateSnapshotInput) 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 CreateSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.SnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotName")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *CreateSnapshotInput) SetNamespaceName(v string) *CreateSnapshotInput { - s.NamespaceName = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *CreateSnapshotInput) SetRetentionPeriod(v int64) *CreateSnapshotInput { - s.RetentionPeriod = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *CreateSnapshotInput) SetSnapshotName(v string) *CreateSnapshotInput { - s.SnapshotName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSnapshotInput) SetTags(v []*Tag) *CreateSnapshotInput { - s.Tags = v - return s -} - -type CreateSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The created snapshot object. - Snapshot *Snapshot `locationName:"snapshot" 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 CreateSnapshotOutput) 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 CreateSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *CreateSnapshotOutput) SetSnapshot(v *Snapshot) *CreateSnapshotOutput { - s.Snapshot = v - return s -} - -type CreateUsageLimitInput struct { - _ struct{} `type:"structure"` - - // The limit amount. If time-based, this amount is in Redshift Processing Units - // (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) - // of data transferred between Regions in cross-account sharing. The value must - // be a positive number. - // - // Amount is a required field - Amount *int64 `locationName:"amount" type:"long" required:"true"` - - // The action that Amazon Redshift Serverless takes when the limit is reached. - // The default is log. - BreachAction *string `locationName:"breachAction" type:"string" enum:"UsageLimitBreachAction"` - - // The time period that the amount applies to. A weekly period begins on Sunday. - // The default is monthly. - Period *string `locationName:"period" type:"string" enum:"UsageLimitPeriod"` - - // The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource - // to create the usage limit for. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` - - // The type of Amazon Redshift Serverless usage to create a usage limit for. - // - // UsageType is a required field - UsageType *string `locationName:"usageType" type:"string" required:"true" enum:"UsageLimitUsageType"` -} - -// 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 CreateUsageLimitInput) 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 CreateUsageLimitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUsageLimitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUsageLimitInput"} - if s.Amount == nil { - invalidParams.Add(request.NewErrParamRequired("Amount")) - } - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.UsageType == nil { - invalidParams.Add(request.NewErrParamRequired("UsageType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmount sets the Amount field's value. -func (s *CreateUsageLimitInput) SetAmount(v int64) *CreateUsageLimitInput { - s.Amount = &v - return s -} - -// SetBreachAction sets the BreachAction field's value. -func (s *CreateUsageLimitInput) SetBreachAction(v string) *CreateUsageLimitInput { - s.BreachAction = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *CreateUsageLimitInput) SetPeriod(v string) *CreateUsageLimitInput { - s.Period = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *CreateUsageLimitInput) SetResourceArn(v string) *CreateUsageLimitInput { - s.ResourceArn = &v - return s -} - -// SetUsageType sets the UsageType field's value. -func (s *CreateUsageLimitInput) SetUsageType(v string) *CreateUsageLimitInput { - s.UsageType = &v - return s -} - -type CreateUsageLimitOutput struct { - _ struct{} `type:"structure"` - - // The returned usage limit object. - UsageLimit *UsageLimit `locationName:"usageLimit" 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 CreateUsageLimitOutput) 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 CreateUsageLimitOutput) GoString() string { - return s.String() -} - -// SetUsageLimit sets the UsageLimit field's value. -func (s *CreateUsageLimitOutput) SetUsageLimit(v *UsageLimit) *CreateUsageLimitOutput { - s.UsageLimit = v - return s -} - -type CreateWorkgroupInput struct { - _ struct{} `type:"structure"` - - // The base data warehouse capacity of the workgroup in Redshift Processing - // Units (RPUs). - BaseCapacity *int64 `locationName:"baseCapacity" type:"integer"` - - // An array of parameters to set for advanced control over a database. The options - // are auto_mv, datestyle, enable_case_sensitivity_identifier, enable_user_activity_logging, - // query_group, search_path, and query monitoring metrics that let you define - // performance boundaries. For more information about query monitoring rules - // and available metrics, see Query monitoring metrics for Amazon Redshift Serverless - // (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless). - ConfigParameters []*ConfigParameter `locationName:"configParameters" type:"list"` - - // The value that specifies whether to turn on enhanced virtual private cloud - // (VPC) routing, which forces Amazon Redshift Serverless to route traffic through - // your VPC instead of over the internet. - EnhancedVpcRouting *bool `locationName:"enhancedVpcRouting" type:"boolean"` - - // The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve - // queries. The max capacity is specified in RPUs. - MaxCapacity *int64 `locationName:"maxCapacity" type:"integer"` - - // The name of the namespace to associate with the workgroup. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" min:"3" type:"string" required:"true"` - - // The custom port to use when connecting to a workgroup. Valid port ranges - // are 5431-5455 and 8191-8215. The default is 5439. - Port *int64 `locationName:"port" type:"integer"` - - // A value that specifies whether the workgroup can be accessed from a public - // network. - PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"` - - // An array of security group IDs to associate with the workgroup. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // An array of VPC subnet IDs to associate with the workgroup. - SubnetIds []*string `locationName:"subnetIds" type:"list"` - - // A array of tag instances. - Tags []*Tag `locationName:"tags" type:"list"` - - // The name of the created workgroup. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 CreateWorkgroupInput) 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 CreateWorkgroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkgroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkgroupInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.NamespaceName != nil && len(*s.NamespaceName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("NamespaceName", 3)) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaseCapacity sets the BaseCapacity field's value. -func (s *CreateWorkgroupInput) SetBaseCapacity(v int64) *CreateWorkgroupInput { - s.BaseCapacity = &v - return s -} - -// SetConfigParameters sets the ConfigParameters field's value. -func (s *CreateWorkgroupInput) SetConfigParameters(v []*ConfigParameter) *CreateWorkgroupInput { - s.ConfigParameters = v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *CreateWorkgroupInput) SetEnhancedVpcRouting(v bool) *CreateWorkgroupInput { - s.EnhancedVpcRouting = &v - return s -} - -// SetMaxCapacity sets the MaxCapacity field's value. -func (s *CreateWorkgroupInput) SetMaxCapacity(v int64) *CreateWorkgroupInput { - s.MaxCapacity = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *CreateWorkgroupInput) SetNamespaceName(v string) *CreateWorkgroupInput { - s.NamespaceName = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateWorkgroupInput) SetPort(v int64) *CreateWorkgroupInput { - s.Port = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *CreateWorkgroupInput) SetPubliclyAccessible(v bool) *CreateWorkgroupInput { - s.PubliclyAccessible = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateWorkgroupInput) SetSecurityGroupIds(v []*string) *CreateWorkgroupInput { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateWorkgroupInput) SetSubnetIds(v []*string) *CreateWorkgroupInput { - s.SubnetIds = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateWorkgroupInput) SetTags(v []*Tag) *CreateWorkgroupInput { - s.Tags = v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *CreateWorkgroupInput) SetWorkgroupName(v string) *CreateWorkgroupInput { - s.WorkgroupName = &v - return s -} - -type CreateWorkgroupOutput struct { - _ struct{} `type:"structure"` - - // The created workgroup object. - Workgroup *Workgroup `locationName:"workgroup" 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 CreateWorkgroupOutput) 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 CreateWorkgroupOutput) GoString() string { - return s.String() -} - -// SetWorkgroup sets the Workgroup field's value. -func (s *CreateWorkgroupOutput) SetWorkgroup(v *Workgroup) *CreateWorkgroupOutput { - s.Workgroup = v - return s -} - -type DeleteCustomDomainAssociationInput struct { - _ struct{} `type:"structure"` - - // The custom domain name associated with the workgroup. - // - // CustomDomainName is a required field - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string" required:"true"` - - // The name of the workgroup associated with the database. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 DeleteCustomDomainAssociationInput) 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 DeleteCustomDomainAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCustomDomainAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCustomDomainAssociationInput"} - if s.CustomDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("CustomDomainName")) - } - if s.CustomDomainName != nil && len(*s.CustomDomainName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainName", 1)) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *DeleteCustomDomainAssociationInput) SetCustomDomainName(v string) *DeleteCustomDomainAssociationInput { - s.CustomDomainName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *DeleteCustomDomainAssociationInput) SetWorkgroupName(v string) *DeleteCustomDomainAssociationInput { - s.WorkgroupName = &v - return s -} - -type DeleteCustomDomainAssociationOutput 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 DeleteCustomDomainAssociationOutput) 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 DeleteCustomDomainAssociationOutput) GoString() string { - return s.String() -} - -type DeleteEndpointAccessInput struct { - _ struct{} `type:"structure"` - - // The name of the VPC endpoint to delete. - // - // EndpointName is a required field - EndpointName *string `locationName:"endpointName" 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 DeleteEndpointAccessInput) 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 DeleteEndpointAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEndpointAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointAccessInput"} - if s.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointName sets the EndpointName field's value. -func (s *DeleteEndpointAccessInput) SetEndpointName(v string) *DeleteEndpointAccessInput { - s.EndpointName = &v - return s -} - -type DeleteEndpointAccessOutput struct { - _ struct{} `type:"structure"` - - // The deleted VPC endpoint. - Endpoint *EndpointAccess `locationName:"endpoint" 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 DeleteEndpointAccessOutput) 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 DeleteEndpointAccessOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *DeleteEndpointAccessOutput) SetEndpoint(v *EndpointAccess) *DeleteEndpointAccessOutput { - s.Endpoint = v - return s -} - -type DeleteNamespaceInput struct { - _ struct{} `type:"structure"` - - // The name of the snapshot to be created before the namespace is deleted. - FinalSnapshotName *string `locationName:"finalSnapshotName" type:"string"` - - // How long to retain the final snapshot. - FinalSnapshotRetentionPeriod *int64 `locationName:"finalSnapshotRetentionPeriod" type:"integer"` - - // The name of the namespace to delete. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" min:"3" 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 DeleteNamespaceInput) 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 DeleteNamespaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNamespaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNamespaceInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.NamespaceName != nil && len(*s.NamespaceName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("NamespaceName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFinalSnapshotName sets the FinalSnapshotName field's value. -func (s *DeleteNamespaceInput) SetFinalSnapshotName(v string) *DeleteNamespaceInput { - s.FinalSnapshotName = &v - return s -} - -// SetFinalSnapshotRetentionPeriod sets the FinalSnapshotRetentionPeriod field's value. -func (s *DeleteNamespaceInput) SetFinalSnapshotRetentionPeriod(v int64) *DeleteNamespaceInput { - s.FinalSnapshotRetentionPeriod = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *DeleteNamespaceInput) SetNamespaceName(v string) *DeleteNamespaceInput { - s.NamespaceName = &v - return s -} - -type DeleteNamespaceOutput struct { - _ struct{} `type:"structure"` - - // The deleted namespace object. - // - // Namespace is a required field - Namespace *Namespace `locationName:"namespace" type:"structure" 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 DeleteNamespaceOutput) 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 DeleteNamespaceOutput) GoString() string { - return s.String() -} - -// SetNamespace sets the Namespace field's value. -func (s *DeleteNamespaceOutput) SetNamespace(v *Namespace) *DeleteNamespaceOutput { - s.Namespace = v - return s -} - -type DeleteResourcePolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the policy to delete. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" 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 DeleteResourcePolicyInput) 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 DeleteResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteResourcePolicyInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *DeleteResourcePolicyInput) SetResourceArn(v string) *DeleteResourcePolicyInput { - s.ResourceArn = &v - return s -} - -type DeleteResourcePolicyOutput 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 DeleteResourcePolicyOutput) 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 DeleteResourcePolicyOutput) GoString() string { - return s.String() -} - -type DeleteSnapshotInput struct { - _ struct{} `type:"structure"` - - // The name of the snapshot to be deleted. - // - // SnapshotName is a required field - SnapshotName *string `locationName:"snapshotName" 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 DeleteSnapshotInput) 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 DeleteSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSnapshotInput"} - if s.SnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *DeleteSnapshotInput) SetSnapshotName(v string) *DeleteSnapshotInput { - s.SnapshotName = &v - return s -} - -type DeleteSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The deleted snapshot object. - Snapshot *Snapshot `locationName:"snapshot" 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 DeleteSnapshotOutput) 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 DeleteSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *DeleteSnapshotOutput) SetSnapshot(v *Snapshot) *DeleteSnapshotOutput { - s.Snapshot = v - return s -} - -type DeleteUsageLimitInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the usage limit to delete. - // - // UsageLimitId is a required field - UsageLimitId *string `locationName:"usageLimitId" 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 DeleteUsageLimitInput) 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 DeleteUsageLimitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUsageLimitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUsageLimitInput"} - if s.UsageLimitId == nil { - invalidParams.Add(request.NewErrParamRequired("UsageLimitId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUsageLimitId sets the UsageLimitId field's value. -func (s *DeleteUsageLimitInput) SetUsageLimitId(v string) *DeleteUsageLimitInput { - s.UsageLimitId = &v - return s -} - -type DeleteUsageLimitOutput struct { - _ struct{} `type:"structure"` - - // The deleted usage limit object. - UsageLimit *UsageLimit `locationName:"usageLimit" 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 DeleteUsageLimitOutput) 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 DeleteUsageLimitOutput) GoString() string { - return s.String() -} - -// SetUsageLimit sets the UsageLimit field's value. -func (s *DeleteUsageLimitOutput) SetUsageLimit(v *UsageLimit) *DeleteUsageLimitOutput { - s.UsageLimit = v - return s -} - -type DeleteWorkgroupInput struct { - _ struct{} `type:"structure"` - - // The name of the workgroup to be deleted. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 DeleteWorkgroupInput) 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 DeleteWorkgroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkgroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkgroupInput"} - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *DeleteWorkgroupInput) SetWorkgroupName(v string) *DeleteWorkgroupInput { - s.WorkgroupName = &v - return s -} - -type DeleteWorkgroupOutput struct { - _ struct{} `type:"structure"` - - // The deleted workgroup object. - // - // Workgroup is a required field - Workgroup *Workgroup `locationName:"workgroup" type:"structure" 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 DeleteWorkgroupOutput) 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 DeleteWorkgroupOutput) GoString() string { - return s.String() -} - -// SetWorkgroup sets the Workgroup field's value. -func (s *DeleteWorkgroupOutput) SetWorkgroup(v *Workgroup) *DeleteWorkgroupOutput { - s.Workgroup = v - return s -} - -// The VPC endpoint object. -type Endpoint struct { - _ struct{} `type:"structure"` - - // The DNS address of the VPC endpoint. - Address *string `locationName:"address" type:"string"` - - // The port that Amazon Redshift Serverless listens on. - Port *int64 `locationName:"port" type:"integer"` - - // An array of VpcEndpoint objects. - VpcEndpoints []*VpcEndpoint `locationName:"vpcEndpoints" type:"list"` -} - -// 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 Endpoint) 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 Endpoint) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *Endpoint) SetAddress(v string) *Endpoint { - s.Address = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Endpoint) SetPort(v int64) *Endpoint { - s.Port = &v - return s -} - -// SetVpcEndpoints sets the VpcEndpoints field's value. -func (s *Endpoint) SetVpcEndpoints(v []*VpcEndpoint) *Endpoint { - s.VpcEndpoints = v - return s -} - -// Information about an Amazon Redshift Serverless VPC endpoint. -type EndpointAccess struct { - _ struct{} `type:"structure"` - - // The DNS address of the endpoint. - Address *string `locationName:"address" type:"string"` - - // The Amazon Resource Name (ARN) of the VPC endpoint. - EndpointArn *string `locationName:"endpointArn" type:"string"` - - // The time that the endpoint was created. - EndpointCreateTime *time.Time `locationName:"endpointCreateTime" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the VPC endpoint. - EndpointName *string `locationName:"endpointName" type:"string"` - - // The status of the VPC endpoint. - EndpointStatus *string `locationName:"endpointStatus" type:"string"` - - // The port number on which Amazon Redshift Serverless accepts incoming connections. - Port *int64 `locationName:"port" type:"integer"` - - // The unique identifier of subnets where Amazon Redshift Serverless choose - // to deploy the VPC endpoint. - SubnetIds []*string `locationName:"subnetIds" type:"list"` - - // The connection endpoint for connecting to Amazon Redshift Serverless. - VpcEndpoint *VpcEndpoint `locationName:"vpcEndpoint" type:"structure"` - - // The security groups associated with the endpoint. - VpcSecurityGroups []*VpcSecurityGroupMembership `locationName:"vpcSecurityGroups" type:"list"` - - // The name of the workgroup associated with the endpoint. - WorkgroupName *string `locationName:"workgroupName" 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 EndpointAccess) 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 EndpointAccess) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *EndpointAccess) SetAddress(v string) *EndpointAccess { - s.Address = &v - return s -} - -// SetEndpointArn sets the EndpointArn field's value. -func (s *EndpointAccess) SetEndpointArn(v string) *EndpointAccess { - s.EndpointArn = &v - return s -} - -// SetEndpointCreateTime sets the EndpointCreateTime field's value. -func (s *EndpointAccess) SetEndpointCreateTime(v time.Time) *EndpointAccess { - s.EndpointCreateTime = &v - return s -} - -// SetEndpointName sets the EndpointName field's value. -func (s *EndpointAccess) SetEndpointName(v string) *EndpointAccess { - s.EndpointName = &v - return s -} - -// SetEndpointStatus sets the EndpointStatus field's value. -func (s *EndpointAccess) SetEndpointStatus(v string) *EndpointAccess { - s.EndpointStatus = &v - return s -} - -// SetPort sets the Port field's value. -func (s *EndpointAccess) SetPort(v int64) *EndpointAccess { - s.Port = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *EndpointAccess) SetSubnetIds(v []*string) *EndpointAccess { - s.SubnetIds = v - return s -} - -// SetVpcEndpoint sets the VpcEndpoint field's value. -func (s *EndpointAccess) SetVpcEndpoint(v *VpcEndpoint) *EndpointAccess { - s.VpcEndpoint = v - return s -} - -// SetVpcSecurityGroups sets the VpcSecurityGroups field's value. -func (s *EndpointAccess) SetVpcSecurityGroups(v []*VpcSecurityGroupMembership) *EndpointAccess { - s.VpcSecurityGroups = v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *EndpointAccess) SetWorkgroupName(v string) *EndpointAccess { - s.WorkgroupName = &v - return s -} - -type GetCredentialsInput struct { - _ struct{} `type:"structure"` - - // The custom domain name associated with the workgroup. The custom domain name - // or the workgroup name must be included in the request. - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string"` - - // The name of the database to get temporary authorization to log on to. - // - // Constraints: - // - // * Must be 1 to 64 alphanumeric characters or hyphens. - // - // * Must contain only uppercase or lowercase letters, numbers, underscore, - // plus sign, period (dot), at symbol (@), or hyphen. - // - // * The first character must be a letter. - // - // * Must not contain a colon ( : ) or slash ( / ). - // - // * Cannot be a reserved word. A list of reserved words can be found in - // Reserved Words (https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html) - // in the Amazon Redshift Database Developer Guide - DbName *string `locationName:"dbName" type:"string"` - - // The number of seconds until the returned temporary password expires. The - // minimum is 900 seconds, and the maximum is 3600 seconds. - DurationSeconds *int64 `locationName:"durationSeconds" type:"integer"` - - // The name of the workgroup associated with the database. - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 GetCredentialsInput) 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 GetCredentialsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCredentialsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCredentialsInput"} - if s.CustomDomainName != nil && len(*s.CustomDomainName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainName", 1)) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *GetCredentialsInput) SetCustomDomainName(v string) *GetCredentialsInput { - s.CustomDomainName = &v - return s -} - -// SetDbName sets the DbName field's value. -func (s *GetCredentialsInput) SetDbName(v string) *GetCredentialsInput { - s.DbName = &v - return s -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *GetCredentialsInput) SetDurationSeconds(v int64) *GetCredentialsInput { - s.DurationSeconds = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *GetCredentialsInput) SetWorkgroupName(v string) *GetCredentialsInput { - s.WorkgroupName = &v - return s -} - -type GetCredentialsOutput struct { - _ struct{} `type:"structure"` - - // A temporary password that authorizes the user name returned by DbUser to - // log on to the database DbName. - // - // DbPassword is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetCredentialsOutput's - // String and GoString methods. - DbPassword *string `locationName:"dbPassword" type:"string" sensitive:"true"` - - // A database user name that is authorized to log on to the database DbName - // using the password DbPassword. If the specified DbUser exists in the database, - // the new user name has the same database privileges as the the user named - // in DbUser. By default, the user is added to PUBLIC. - // - // DbUser is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetCredentialsOutput's - // String and GoString methods. - DbUser *string `locationName:"dbUser" type:"string" sensitive:"true"` - - // The date and time the password in DbPassword expires. - Expiration *time.Time `locationName:"expiration" type:"timestamp"` - - // The date and time of when the DbUser and DbPassword authorization refreshes. - NextRefreshTime *time.Time `locationName:"nextRefreshTime" type:"timestamp"` -} - -// 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 GetCredentialsOutput) 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 GetCredentialsOutput) GoString() string { - return s.String() -} - -// SetDbPassword sets the DbPassword field's value. -func (s *GetCredentialsOutput) SetDbPassword(v string) *GetCredentialsOutput { - s.DbPassword = &v - return s -} - -// SetDbUser sets the DbUser field's value. -func (s *GetCredentialsOutput) SetDbUser(v string) *GetCredentialsOutput { - s.DbUser = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *GetCredentialsOutput) SetExpiration(v time.Time) *GetCredentialsOutput { - s.Expiration = &v - return s -} - -// SetNextRefreshTime sets the NextRefreshTime field's value. -func (s *GetCredentialsOutput) SetNextRefreshTime(v time.Time) *GetCredentialsOutput { - s.NextRefreshTime = &v - return s -} - -type GetCustomDomainAssociationInput struct { - _ struct{} `type:"structure"` - - // The custom domain name associated with the workgroup. - // - // CustomDomainName is a required field - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string" required:"true"` - - // The name of the workgroup associated with the database. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 GetCustomDomainAssociationInput) 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 GetCustomDomainAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCustomDomainAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCustomDomainAssociationInput"} - if s.CustomDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("CustomDomainName")) - } - if s.CustomDomainName != nil && len(*s.CustomDomainName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainName", 1)) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *GetCustomDomainAssociationInput) SetCustomDomainName(v string) *GetCustomDomainAssociationInput { - s.CustomDomainName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *GetCustomDomainAssociationInput) SetWorkgroupName(v string) *GetCustomDomainAssociationInput { - s.WorkgroupName = &v - return s -} - -type GetCustomDomainAssociationOutput struct { - _ struct{} `type:"structure"` - - // The custom domain name’s certificate Amazon resource name (ARN). - CustomDomainCertificateArn *string `locationName:"customDomainCertificateArn" min:"20" type:"string"` - - // The expiration time for the certificate. - CustomDomainCertificateExpiryTime *time.Time `locationName:"customDomainCertificateExpiryTime" type:"timestamp" timestampFormat:"iso8601"` - - // The custom domain name associated with the workgroup. - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string"` - - // The name of the workgroup associated with the database. - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 GetCustomDomainAssociationOutput) 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 GetCustomDomainAssociationOutput) GoString() string { - return s.String() -} - -// SetCustomDomainCertificateArn sets the CustomDomainCertificateArn field's value. -func (s *GetCustomDomainAssociationOutput) SetCustomDomainCertificateArn(v string) *GetCustomDomainAssociationOutput { - s.CustomDomainCertificateArn = &v - return s -} - -// SetCustomDomainCertificateExpiryTime sets the CustomDomainCertificateExpiryTime field's value. -func (s *GetCustomDomainAssociationOutput) SetCustomDomainCertificateExpiryTime(v time.Time) *GetCustomDomainAssociationOutput { - s.CustomDomainCertificateExpiryTime = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *GetCustomDomainAssociationOutput) SetCustomDomainName(v string) *GetCustomDomainAssociationOutput { - s.CustomDomainName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *GetCustomDomainAssociationOutput) SetWorkgroupName(v string) *GetCustomDomainAssociationOutput { - s.WorkgroupName = &v - return s -} - -type GetEndpointAccessInput struct { - _ struct{} `type:"structure"` - - // The name of the VPC endpoint to return information for. - // - // EndpointName is a required field - EndpointName *string `locationName:"endpointName" 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 GetEndpointAccessInput) 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 GetEndpointAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEndpointAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEndpointAccessInput"} - if s.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointName sets the EndpointName field's value. -func (s *GetEndpointAccessInput) SetEndpointName(v string) *GetEndpointAccessInput { - s.EndpointName = &v - return s -} - -type GetEndpointAccessOutput struct { - _ struct{} `type:"structure"` - - // The returned VPC endpoint. - Endpoint *EndpointAccess `locationName:"endpoint" 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 GetEndpointAccessOutput) 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 GetEndpointAccessOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *GetEndpointAccessOutput) SetEndpoint(v *EndpointAccess) *GetEndpointAccessOutput { - s.Endpoint = v - return s -} - -type GetNamespaceInput struct { - _ struct{} `type:"structure"` - - // The name of the namespace to retrieve information for. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" min:"3" 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 GetNamespaceInput) 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 GetNamespaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetNamespaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetNamespaceInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.NamespaceName != nil && len(*s.NamespaceName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("NamespaceName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *GetNamespaceInput) SetNamespaceName(v string) *GetNamespaceInput { - s.NamespaceName = &v - return s -} - -type GetNamespaceOutput struct { - _ struct{} `type:"structure"` - - // The returned namespace object. - // - // Namespace is a required field - Namespace *Namespace `locationName:"namespace" type:"structure" 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 GetNamespaceOutput) 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 GetNamespaceOutput) GoString() string { - return s.String() -} - -// SetNamespace sets the Namespace field's value. -func (s *GetNamespaceOutput) SetNamespace(v *Namespace) *GetNamespaceOutput { - s.Namespace = v - return s -} - -type GetRecoveryPointInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the recovery point to return information for. - // - // RecoveryPointId is a required field - RecoveryPointId *string `locationName:"recoveryPointId" 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 GetRecoveryPointInput) 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 GetRecoveryPointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRecoveryPointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRecoveryPointInput"} - if s.RecoveryPointId == nil { - invalidParams.Add(request.NewErrParamRequired("RecoveryPointId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRecoveryPointId sets the RecoveryPointId field's value. -func (s *GetRecoveryPointInput) SetRecoveryPointId(v string) *GetRecoveryPointInput { - s.RecoveryPointId = &v - return s -} - -type GetRecoveryPointOutput struct { - _ struct{} `type:"structure"` - - // The returned recovery point object. - RecoveryPoint *RecoveryPoint `locationName:"recoveryPoint" 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 GetRecoveryPointOutput) 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 GetRecoveryPointOutput) GoString() string { - return s.String() -} - -// SetRecoveryPoint sets the RecoveryPoint field's value. -func (s *GetRecoveryPointOutput) SetRecoveryPoint(v *RecoveryPoint) *GetRecoveryPointOutput { - s.RecoveryPoint = v - return s -} - -type GetResourcePolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource to return. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" 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 GetResourcePolicyInput) 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 GetResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetResourcePolicyInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *GetResourcePolicyInput) SetResourceArn(v string) *GetResourcePolicyInput { - s.ResourceArn = &v - return s -} - -type GetResourcePolicyOutput struct { - _ struct{} `type:"structure"` - - // The returned resource policy. - ResourcePolicy *ResourcePolicy `locationName:"resourcePolicy" 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 GetResourcePolicyOutput) 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 GetResourcePolicyOutput) GoString() string { - return s.String() -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *GetResourcePolicyOutput) SetResourcePolicy(v *ResourcePolicy) *GetResourcePolicyOutput { - s.ResourcePolicy = v - return s -} - -type GetSnapshotInput struct { - _ struct{} `type:"structure"` - - // The owner Amazon Web Services account of a snapshot shared with another user. - OwnerAccount *string `locationName:"ownerAccount" type:"string"` - - // The Amazon Resource Name (ARN) of the snapshot to return. - SnapshotArn *string `locationName:"snapshotArn" type:"string"` - - // The name of the snapshot to return. - SnapshotName *string `locationName:"snapshotName" 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 GetSnapshotInput) 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 GetSnapshotInput) GoString() string { - return s.String() -} - -// SetOwnerAccount sets the OwnerAccount field's value. -func (s *GetSnapshotInput) SetOwnerAccount(v string) *GetSnapshotInput { - s.OwnerAccount = &v - return s -} - -// SetSnapshotArn sets the SnapshotArn field's value. -func (s *GetSnapshotInput) SetSnapshotArn(v string) *GetSnapshotInput { - s.SnapshotArn = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *GetSnapshotInput) SetSnapshotName(v string) *GetSnapshotInput { - s.SnapshotName = &v - return s -} - -type GetSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The returned snapshot object. - Snapshot *Snapshot `locationName:"snapshot" 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 GetSnapshotOutput) 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 GetSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *GetSnapshotOutput) SetSnapshot(v *Snapshot) *GetSnapshotOutput { - s.Snapshot = v - return s -} - -type GetTableRestoreStatusInput struct { - _ struct{} `type:"structure"` - - // The ID of the RestoreTableFromSnapshot request to return status for. - // - // TableRestoreRequestId is a required field - TableRestoreRequestId *string `locationName:"tableRestoreRequestId" 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 GetTableRestoreStatusInput) 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 GetTableRestoreStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTableRestoreStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTableRestoreStatusInput"} - if s.TableRestoreRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("TableRestoreRequestId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTableRestoreRequestId sets the TableRestoreRequestId field's value. -func (s *GetTableRestoreStatusInput) SetTableRestoreRequestId(v string) *GetTableRestoreStatusInput { - s.TableRestoreRequestId = &v - return s -} - -type GetTableRestoreStatusOutput struct { - _ struct{} `type:"structure"` - - // The returned TableRestoreStatus object that contains information about the - // status of your RestoreTableFromSnapshot request. - TableRestoreStatus *TableRestoreStatus `locationName:"tableRestoreStatus" 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 GetTableRestoreStatusOutput) 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 GetTableRestoreStatusOutput) GoString() string { - return s.String() -} - -// SetTableRestoreStatus sets the TableRestoreStatus field's value. -func (s *GetTableRestoreStatusOutput) SetTableRestoreStatus(v *TableRestoreStatus) *GetTableRestoreStatusOutput { - s.TableRestoreStatus = v - return s -} - -type GetUsageLimitInput struct { - _ struct{} `type:"structure"` - - // The unique identifier of the usage limit to return information for. - // - // UsageLimitId is a required field - UsageLimitId *string `locationName:"usageLimitId" 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 GetUsageLimitInput) 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 GetUsageLimitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUsageLimitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUsageLimitInput"} - if s.UsageLimitId == nil { - invalidParams.Add(request.NewErrParamRequired("UsageLimitId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUsageLimitId sets the UsageLimitId field's value. -func (s *GetUsageLimitInput) SetUsageLimitId(v string) *GetUsageLimitInput { - s.UsageLimitId = &v - return s -} - -type GetUsageLimitOutput struct { - _ struct{} `type:"structure"` - - // The returned usage limit object. - UsageLimit *UsageLimit `locationName:"usageLimit" 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 GetUsageLimitOutput) 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 GetUsageLimitOutput) GoString() string { - return s.String() -} - -// SetUsageLimit sets the UsageLimit field's value. -func (s *GetUsageLimitOutput) SetUsageLimit(v *UsageLimit) *GetUsageLimitOutput { - s.UsageLimit = v - return s -} - -type GetWorkgroupInput struct { - _ struct{} `type:"structure"` - - // The name of the workgroup to return information for. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 GetWorkgroupInput) 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 GetWorkgroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetWorkgroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetWorkgroupInput"} - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *GetWorkgroupInput) SetWorkgroupName(v string) *GetWorkgroupInput { - s.WorkgroupName = &v - return s -} - -type GetWorkgroupOutput struct { - _ struct{} `type:"structure"` - - // The returned workgroup object. - // - // Workgroup is a required field - Workgroup *Workgroup `locationName:"workgroup" type:"structure" 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 GetWorkgroupOutput) 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 GetWorkgroupOutput) GoString() string { - return s.String() -} - -// SetWorkgroup sets the Workgroup field's value. -func (s *GetWorkgroupOutput) SetWorkgroup(v *Workgroup) *GetWorkgroupOutput { - s.Workgroup = v - return s -} - -// There is an insufficient capacity to perform the action. -type InsufficientCapacityException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InsufficientCapacityException) 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 InsufficientCapacityException) GoString() string { - return s.String() -} - -func newErrorInsufficientCapacityException(v protocol.ResponseMetadata) error { - return &InsufficientCapacityException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InsufficientCapacityException) Code() string { - return "InsufficientCapacityException" -} - -// Message returns the exception's message. -func (s *InsufficientCapacityException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InsufficientCapacityException) OrigErr() error { - return nil -} - -func (s *InsufficientCapacityException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InsufficientCapacityException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InsufficientCapacityException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request processing has failed because of an unknown error, exception -// or failure. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The provided pagination token is invalid. -type InvalidPaginationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InvalidPaginationException) 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 InvalidPaginationException) GoString() string { - return s.String() -} - -func newErrorInvalidPaginationException(v protocol.ResponseMetadata) error { - return &InvalidPaginationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidPaginationException) Code() string { - return "InvalidPaginationException" -} - -// Message returns the exception's message. -func (s *InvalidPaginationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidPaginationException) OrigErr() error { - return nil -} - -func (s *InvalidPaginationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidPaginationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidPaginationException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListCustomDomainAssociationsInput struct { - _ struct{} `type:"structure"` - - // The custom domain name’s certificate Amazon resource name (ARN). - CustomDomainCertificateArn *string `locationName:"customDomainCertificateArn" min:"20" type:"string"` - - // The custom domain name associated with the workgroup. - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to display the next page of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" min:"8" 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 ListCustomDomainAssociationsInput) 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 ListCustomDomainAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCustomDomainAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCustomDomainAssociationsInput"} - if s.CustomDomainCertificateArn != nil && len(*s.CustomDomainCertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainCertificateArn", 20)) - } - if s.CustomDomainName != nil && len(*s.CustomDomainName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainName", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 8 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 8)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomDomainCertificateArn sets the CustomDomainCertificateArn field's value. -func (s *ListCustomDomainAssociationsInput) SetCustomDomainCertificateArn(v string) *ListCustomDomainAssociationsInput { - s.CustomDomainCertificateArn = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *ListCustomDomainAssociationsInput) SetCustomDomainName(v string) *ListCustomDomainAssociationsInput { - s.CustomDomainName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCustomDomainAssociationsInput) SetMaxResults(v int64) *ListCustomDomainAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCustomDomainAssociationsInput) SetNextToken(v string) *ListCustomDomainAssociationsInput { - s.NextToken = &v - return s -} - -type ListCustomDomainAssociationsOutput struct { - _ struct{} `type:"structure"` - - // A list of Association objects. - Associations []*Association `locationName:"associations" type:"list"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" min:"8" 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 ListCustomDomainAssociationsOutput) 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 ListCustomDomainAssociationsOutput) GoString() string { - return s.String() -} - -// SetAssociations sets the Associations field's value. -func (s *ListCustomDomainAssociationsOutput) SetAssociations(v []*Association) *ListCustomDomainAssociationsOutput { - s.Associations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCustomDomainAssociationsOutput) SetNextToken(v string) *ListCustomDomainAssociationsOutput { - s.NextToken = &v - return s -} - -type ListEndpointAccessInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to display the next page of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListEndpointAccess operation returns a nextToken, you can - // include the returned nextToken in following ListEndpointAccess operations, - // which returns results in the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // The unique identifier of the virtual private cloud with access to Amazon - // Redshift Serverless. - VpcId *string `locationName:"vpcId" type:"string"` - - // The name of the workgroup associated with the VPC endpoint to return. - WorkgroupName *string `locationName:"workgroupName" 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 ListEndpointAccessInput) 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 ListEndpointAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEndpointAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEndpointAccessInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEndpointAccessInput) SetMaxResults(v int64) *ListEndpointAccessInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointAccessInput) SetNextToken(v string) *ListEndpointAccessInput { - s.NextToken = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ListEndpointAccessInput) SetVpcId(v string) *ListEndpointAccessInput { - s.VpcId = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *ListEndpointAccessInput) SetWorkgroupName(v string) *ListEndpointAccessInput { - s.WorkgroupName = &v - return s -} - -type ListEndpointAccessOutput struct { - _ struct{} `type:"structure"` - - // The returned VPC endpoints. - // - // Endpoints is a required field - Endpoints []*EndpointAccess `locationName:"endpoints" type:"list" required:"true"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" 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 ListEndpointAccessOutput) 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 ListEndpointAccessOutput) GoString() string { - return s.String() -} - -// SetEndpoints sets the Endpoints field's value. -func (s *ListEndpointAccessOutput) SetEndpoints(v []*EndpointAccess) *ListEndpointAccessOutput { - s.Endpoints = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointAccessOutput) SetNextToken(v string) *ListEndpointAccessOutput { - s.NextToken = &v - return s -} - -type ListNamespacesInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to display the next page of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListNamespaces operation returns a nextToken, you can include - // the returned nextToken in following ListNamespaces operations, which returns - // results in the next page. - NextToken *string `locationName:"nextToken" 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 ListNamespacesInput) 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 ListNamespacesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListNamespacesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListNamespacesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListNamespacesInput) SetMaxResults(v int64) *ListNamespacesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListNamespacesInput) SetNextToken(v string) *ListNamespacesInput { - s.NextToken = &v - return s -} - -type ListNamespacesOutput struct { - _ struct{} `type:"structure"` - - // The list of returned namespaces. - // - // Namespaces is a required field - Namespaces []*Namespace `locationName:"namespaces" type:"list" required:"true"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" 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 ListNamespacesOutput) 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 ListNamespacesOutput) GoString() string { - return s.String() -} - -// SetNamespaces sets the Namespaces field's value. -func (s *ListNamespacesOutput) SetNamespaces(v []*Namespace) *ListNamespacesOutput { - s.Namespaces = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListNamespacesOutput) SetNextToken(v string) *ListNamespacesOutput { - s.NextToken = &v - return s -} - -type ListRecoveryPointsInput struct { - _ struct{} `type:"structure"` - - // The time when creation of the recovery point finished. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to display the next page of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the namespace from which to list recovery - // points. - NamespaceArn *string `locationName:"namespaceArn" type:"string"` - - // The name of the namespace to list recovery points for. - NamespaceName *string `locationName:"namespaceName" min:"3" type:"string"` - - // If your initial ListRecoveryPoints operation returns a nextToken, you can - // include the returned nextToken in following ListRecoveryPoints operations, - // which returns results in the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // The time when the recovery point's creation was initiated. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` -} - -// 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 ListRecoveryPointsInput) 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 ListRecoveryPointsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRecoveryPointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRecoveryPointsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NamespaceName != nil && len(*s.NamespaceName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("NamespaceName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *ListRecoveryPointsInput) SetEndTime(v time.Time) *ListRecoveryPointsInput { - s.EndTime = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRecoveryPointsInput) SetMaxResults(v int64) *ListRecoveryPointsInput { - s.MaxResults = &v - return s -} - -// SetNamespaceArn sets the NamespaceArn field's value. -func (s *ListRecoveryPointsInput) SetNamespaceArn(v string) *ListRecoveryPointsInput { - s.NamespaceArn = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *ListRecoveryPointsInput) SetNamespaceName(v string) *ListRecoveryPointsInput { - s.NamespaceName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecoveryPointsInput) SetNextToken(v string) *ListRecoveryPointsInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ListRecoveryPointsInput) SetStartTime(v time.Time) *ListRecoveryPointsInput { - s.StartTime = &v - return s -} - -type ListRecoveryPointsOutput struct { - _ struct{} `type:"structure"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // The returned recovery point objects. - RecoveryPoints []*RecoveryPoint `locationName:"recoveryPoints" type:"list"` -} - -// 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 ListRecoveryPointsOutput) 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 ListRecoveryPointsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecoveryPointsOutput) SetNextToken(v string) *ListRecoveryPointsOutput { - s.NextToken = &v - return s -} - -// SetRecoveryPoints sets the RecoveryPoints field's value. -func (s *ListRecoveryPointsOutput) SetRecoveryPoints(v []*RecoveryPoint) *ListRecoveryPointsOutput { - s.RecoveryPoints = v - return s -} - -type ListSnapshotsInput struct { - _ struct{} `type:"structure"` - - // The timestamp showing when the snapshot creation finished. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to display the next page of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the namespace from which to list all snapshots. - NamespaceArn *string `locationName:"namespaceArn" type:"string"` - - // The namespace from which to list all snapshots. - NamespaceName *string `locationName:"namespaceName" type:"string"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // The owner Amazon Web Services account of the snapshot. - OwnerAccount *string `locationName:"ownerAccount" type:"string"` - - // The time when the creation of the snapshot was initiated. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` -} - -// 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 ListSnapshotsInput) 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 ListSnapshotsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSnapshotsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSnapshotsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *ListSnapshotsInput) SetEndTime(v time.Time) *ListSnapshotsInput { - s.EndTime = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSnapshotsInput) SetMaxResults(v int64) *ListSnapshotsInput { - s.MaxResults = &v - return s -} - -// SetNamespaceArn sets the NamespaceArn field's value. -func (s *ListSnapshotsInput) SetNamespaceArn(v string) *ListSnapshotsInput { - s.NamespaceArn = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *ListSnapshotsInput) SetNamespaceName(v string) *ListSnapshotsInput { - s.NamespaceName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSnapshotsInput) SetNextToken(v string) *ListSnapshotsInput { - s.NextToken = &v - return s -} - -// SetOwnerAccount sets the OwnerAccount field's value. -func (s *ListSnapshotsInput) SetOwnerAccount(v string) *ListSnapshotsInput { - s.OwnerAccount = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ListSnapshotsInput) SetStartTime(v time.Time) *ListSnapshotsInput { - s.StartTime = &v - return s -} - -type ListSnapshotsOutput struct { - _ struct{} `type:"structure"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // All of the returned snapshot objects. - Snapshots []*Snapshot `locationName:"snapshots" type:"list"` -} - -// 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 ListSnapshotsOutput) 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 ListSnapshotsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSnapshotsOutput) SetNextToken(v string) *ListSnapshotsOutput { - s.NextToken = &v - return s -} - -// SetSnapshots sets the Snapshots field's value. -func (s *ListSnapshotsOutput) SetSnapshots(v []*Snapshot) *ListSnapshotsOutput { - s.Snapshots = v - return s -} - -type ListTableRestoreStatusInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to display the next page of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The namespace from which to list all of the statuses of RestoreTableFromSnapshot - // operations . - NamespaceName *string `locationName:"namespaceName" type:"string"` - - // If your initial ListTableRestoreStatus operation returns a nextToken, you - // can include the returned nextToken in following ListTableRestoreStatus operations. - // This will return results on the next page. - NextToken *string `locationName:"nextToken" min:"8" type:"string"` - - // The workgroup from which to list all of the statuses of RestoreTableFromSnapshot - // operations. - WorkgroupName *string `locationName:"workgroupName" 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 ListTableRestoreStatusInput) 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 ListTableRestoreStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTableRestoreStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTableRestoreStatusInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 8 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 8)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTableRestoreStatusInput) SetMaxResults(v int64) *ListTableRestoreStatusInput { - s.MaxResults = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *ListTableRestoreStatusInput) SetNamespaceName(v string) *ListTableRestoreStatusInput { - s.NamespaceName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTableRestoreStatusInput) SetNextToken(v string) *ListTableRestoreStatusInput { - s.NextToken = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *ListTableRestoreStatusInput) SetWorkgroupName(v string) *ListTableRestoreStatusInput { - s.WorkgroupName = &v - return s -} - -type ListTableRestoreStatusOutput struct { - _ struct{} `type:"structure"` - - // If your initial ListTableRestoreStatus operation returns a nextToken, you - // can include the returned nextToken in following ListTableRestoreStatus operations. - // This will returns results on the next page. - NextToken *string `locationName:"nextToken" min:"8" type:"string"` - - // The array of returned TableRestoreStatus objects. - TableRestoreStatuses []*TableRestoreStatus `locationName:"tableRestoreStatuses" type:"list"` -} - -// 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 ListTableRestoreStatusOutput) 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 ListTableRestoreStatusOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTableRestoreStatusOutput) SetNextToken(v string) *ListTableRestoreStatusOutput { - s.NextToken = &v - return s -} - -// SetTableRestoreStatuses sets the TableRestoreStatuses field's value. -func (s *ListTableRestoreStatusOutput) SetTableRestoreStatuses(v []*TableRestoreStatus) *ListTableRestoreStatusOutput { - s.TableRestoreStatuses = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource to list tags for. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A map of the key-value pairs assigned to the resource. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListUsageLimitsInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to get the next page of results. The default is 100. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListUsageLimits operation returns a nextToken, you can include - // the returned nextToken in following ListUsageLimits operations, which returns - // results in the next page. - NextToken *string `locationName:"nextToken" min:"8" type:"string"` - - // The Amazon Resource Name (ARN) associated with the resource whose usage limits - // you want to list. - ResourceArn *string `locationName:"resourceArn" type:"string"` - - // The Amazon Redshift Serverless feature whose limits you want to see. - UsageType *string `locationName:"usageType" type:"string" enum:"UsageLimitUsageType"` -} - -// 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 ListUsageLimitsInput) 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 ListUsageLimitsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListUsageLimitsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListUsageLimitsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 8 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 8)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListUsageLimitsInput) SetMaxResults(v int64) *ListUsageLimitsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListUsageLimitsInput) SetNextToken(v string) *ListUsageLimitsInput { - s.NextToken = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListUsageLimitsInput) SetResourceArn(v string) *ListUsageLimitsInput { - s.ResourceArn = &v - return s -} - -// SetUsageType sets the UsageType field's value. -func (s *ListUsageLimitsInput) SetUsageType(v string) *ListUsageLimitsInput { - s.UsageType = &v - return s -} - -type ListUsageLimitsOutput struct { - _ struct{} `type:"structure"` - - // When nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" min:"8" type:"string"` - - // An array of returned usage limit objects. - UsageLimits []*UsageLimit `locationName:"usageLimits" min:"1" type:"list"` -} - -// 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 ListUsageLimitsOutput) 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 ListUsageLimitsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListUsageLimitsOutput) SetNextToken(v string) *ListUsageLimitsOutput { - s.NextToken = &v - return s -} - -// SetUsageLimits sets the UsageLimits field's value. -func (s *ListUsageLimitsOutput) SetUsageLimits(v []*UsageLimit) *ListUsageLimitsOutput { - s.UsageLimits = v - return s -} - -type ListWorkgroupsInput struct { - _ struct{} `type:"structure"` - - // An optional parameter that specifies the maximum number of results to return. - // You can use nextToken to display the next page of results. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If your initial ListWorkgroups operation returns a nextToken, you can include - // the returned nextToken in following ListNamespaces operations, which returns - // results in the next page. - NextToken *string `locationName:"nextToken" 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 ListWorkgroupsInput) 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 ListWorkgroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkgroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkgroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkgroupsInput) SetMaxResults(v int64) *ListWorkgroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkgroupsInput) SetNextToken(v string) *ListWorkgroupsInput { - s.NextToken = &v - return s -} - -type ListWorkgroupsOutput struct { - _ struct{} `type:"structure"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. To retrieve the next - // page, make the call again using the returned token. - NextToken *string `locationName:"nextToken" type:"string"` - - // The returned array of workgroups. - // - // Workgroups is a required field - Workgroups []*Workgroup `locationName:"workgroups" type:"list" 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 ListWorkgroupsOutput) 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 ListWorkgroupsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkgroupsOutput) SetNextToken(v string) *ListWorkgroupsOutput { - s.NextToken = &v - return s -} - -// SetWorkgroups sets the Workgroups field's value. -func (s *ListWorkgroupsOutput) SetWorkgroups(v []*Workgroup) *ListWorkgroupsOutput { - s.Workgroups = v - return s -} - -// A collection of database objects and users. -type Namespace struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the namespace's admin user credentials - // secret. - AdminPasswordSecretArn *string `locationName:"adminPasswordSecretArn" type:"string"` - - // The ID of the Key Management Service (KMS) key used to encrypt and store - // the namespace's admin credentials secret. - AdminPasswordSecretKmsKeyId *string `locationName:"adminPasswordSecretKmsKeyId" type:"string"` - - // The username of the administrator for the first database created in the namespace. - // - // AdminUsername is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Namespace's - // String and GoString methods. - AdminUsername *string `locationName:"adminUsername" type:"string" sensitive:"true"` - - // The date of when the namespace was created. - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the first database created in the namespace. - DbName *string `locationName:"dbName" type:"string"` - - // The Amazon Resource Name (ARN) of the IAM role to set as a default in the - // namespace. - DefaultIamRoleArn *string `locationName:"defaultIamRoleArn" type:"string"` - - // A list of IAM roles to associate with the namespace. - IamRoles []*string `locationName:"iamRoles" type:"list"` - - // The ID of the Amazon Web Services Key Management Service key used to encrypt - // your data. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The types of logs the namespace can export. Available export types are User - // log, Connection log, and User activity log. - LogExports []*string `locationName:"logExports" type:"list" enum:"LogExport"` - - // The Amazon Resource Name (ARN) associated with a namespace. - NamespaceArn *string `locationName:"namespaceArn" type:"string"` - - // The unique identifier of a namespace. - NamespaceId *string `locationName:"namespaceId" type:"string"` - - // The name of the namespace. Must be between 3-64 alphanumeric characters in - // lowercase, and it cannot be a reserved word. A list of reserved words can - // be found in Reserved Words (https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html) - // in the Amazon Redshift Database Developer Guide. - NamespaceName *string `locationName:"namespaceName" min:"3" type:"string"` - - // The status of the namespace. - Status *string `locationName:"status" type:"string" enum:"NamespaceStatus"` -} - -// 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 Namespace) 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 Namespace) GoString() string { - return s.String() -} - -// SetAdminPasswordSecretArn sets the AdminPasswordSecretArn field's value. -func (s *Namespace) SetAdminPasswordSecretArn(v string) *Namespace { - s.AdminPasswordSecretArn = &v - return s -} - -// SetAdminPasswordSecretKmsKeyId sets the AdminPasswordSecretKmsKeyId field's value. -func (s *Namespace) SetAdminPasswordSecretKmsKeyId(v string) *Namespace { - s.AdminPasswordSecretKmsKeyId = &v - return s -} - -// SetAdminUsername sets the AdminUsername field's value. -func (s *Namespace) SetAdminUsername(v string) *Namespace { - s.AdminUsername = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *Namespace) SetCreationDate(v time.Time) *Namespace { - s.CreationDate = &v - return s -} - -// SetDbName sets the DbName field's value. -func (s *Namespace) SetDbName(v string) *Namespace { - s.DbName = &v - return s -} - -// SetDefaultIamRoleArn sets the DefaultIamRoleArn field's value. -func (s *Namespace) SetDefaultIamRoleArn(v string) *Namespace { - s.DefaultIamRoleArn = &v - return s -} - -// SetIamRoles sets the IamRoles field's value. -func (s *Namespace) SetIamRoles(v []*string) *Namespace { - s.IamRoles = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Namespace) SetKmsKeyId(v string) *Namespace { - s.KmsKeyId = &v - return s -} - -// SetLogExports sets the LogExports field's value. -func (s *Namespace) SetLogExports(v []*string) *Namespace { - s.LogExports = v - return s -} - -// SetNamespaceArn sets the NamespaceArn field's value. -func (s *Namespace) SetNamespaceArn(v string) *Namespace { - s.NamespaceArn = &v - return s -} - -// SetNamespaceId sets the NamespaceId field's value. -func (s *Namespace) SetNamespaceId(v string) *Namespace { - s.NamespaceId = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *Namespace) SetNamespaceName(v string) *Namespace { - s.NamespaceName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Namespace) SetStatus(v string) *Namespace { - s.Status = &v - return s -} - -// Contains information about a network interface in an Amazon Redshift Serverless -// managed VPC endpoint. -type NetworkInterface struct { - _ struct{} `type:"structure"` - - // The availability Zone. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The unique identifier of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` - - // The IPv4 address of the network interface within the subnet. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` - - // The unique identifier of the subnet. - SubnetId *string `locationName:"subnetId" 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 NetworkInterface) 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 NetworkInterface) GoString() string { - return s.String() -} - -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *NetworkInterface) SetAvailabilityZone(v string) *NetworkInterface { - s.AvailabilityZone = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *NetworkInterface) SetNetworkInterfaceId(v string) *NetworkInterface { - s.NetworkInterfaceId = &v - return s -} - -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *NetworkInterface) SetPrivateIpAddress(v string) *NetworkInterface { - s.PrivateIpAddress = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NetworkInterface) SetSubnetId(v string) *NetworkInterface { - s.SubnetId = &v - return s -} - -type PutResourcePolicyInput struct { - _ struct{} `type:"structure"` - - // The policy to create or update. For example, the following policy grants - // a user authorization to restore a snapshot. - // - // "{\"Version\": \"2012-10-17\", \"Statement\" : [{ \"Sid\": \"AllowUserRestoreFromSnapshot\", - // \"Principal\":{\"AWS\": [\"739247239426\"]}, \"Action\": [\"redshift-serverless:RestoreFromSnapshot\"] - // , \"Effect\": \"Allow\" }]}" - // - // Policy is a required field - Policy *string `locationName:"policy" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the account to create or update a resource - // policy for. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" 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 PutResourcePolicyInput) 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 PutResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutResourcePolicyInput"} - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicy sets the Policy field's value. -func (s *PutResourcePolicyInput) SetPolicy(v string) *PutResourcePolicyInput { - s.Policy = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *PutResourcePolicyInput) SetResourceArn(v string) *PutResourcePolicyInput { - s.ResourceArn = &v - return s -} - -type PutResourcePolicyOutput struct { - _ struct{} `type:"structure"` - - // The policy that was created or updated. - ResourcePolicy *ResourcePolicy `locationName:"resourcePolicy" 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 PutResourcePolicyOutput) 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 PutResourcePolicyOutput) GoString() string { - return s.String() -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *PutResourcePolicyOutput) SetResourcePolicy(v *ResourcePolicy) *PutResourcePolicyOutput { - s.ResourcePolicy = v - return s -} - -// The automatically created recovery point of a namespace. Recovery points -// are created every 30 minutes and kept for 24 hours. -type RecoveryPoint struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the namespace the recovery point is associated - // with. - NamespaceArn *string `locationName:"namespaceArn" type:"string"` - - // The name of the namespace the recovery point is associated with. - NamespaceName *string `locationName:"namespaceName" min:"3" type:"string"` - - // The time the recovery point is created. - RecoveryPointCreateTime *time.Time `locationName:"recoveryPointCreateTime" type:"timestamp" timestampFormat:"iso8601"` - - // The unique identifier of the recovery point. - RecoveryPointId *string `locationName:"recoveryPointId" type:"string"` - - // The total size of the data in the recovery point in megabytes. - TotalSizeInMegaBytes *float64 `locationName:"totalSizeInMegaBytes" type:"double"` - - // The name of the workgroup the recovery point is associated with. - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 RecoveryPoint) 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 RecoveryPoint) GoString() string { - return s.String() -} - -// SetNamespaceArn sets the NamespaceArn field's value. -func (s *RecoveryPoint) SetNamespaceArn(v string) *RecoveryPoint { - s.NamespaceArn = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *RecoveryPoint) SetNamespaceName(v string) *RecoveryPoint { - s.NamespaceName = &v - return s -} - -// SetRecoveryPointCreateTime sets the RecoveryPointCreateTime field's value. -func (s *RecoveryPoint) SetRecoveryPointCreateTime(v time.Time) *RecoveryPoint { - s.RecoveryPointCreateTime = &v - return s -} - -// SetRecoveryPointId sets the RecoveryPointId field's value. -func (s *RecoveryPoint) SetRecoveryPointId(v string) *RecoveryPoint { - s.RecoveryPointId = &v - return s -} - -// SetTotalSizeInMegaBytes sets the TotalSizeInMegaBytes field's value. -func (s *RecoveryPoint) SetTotalSizeInMegaBytes(v float64) *RecoveryPoint { - s.TotalSizeInMegaBytes = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *RecoveryPoint) SetWorkgroupName(v string) *RecoveryPoint { - s.WorkgroupName = &v - return s -} - -// The resource could not be found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The name of the resource that could not be found. - ResourceName *string `locationName:"resourceName" min:"1" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The resource policy object. Currently, you can use policies to share snapshots -// across Amazon Web Services accounts. -type ResourcePolicy struct { - _ struct{} `type:"structure"` - - // The resource policy. - Policy *string `locationName:"policy" type:"string"` - - // The Amazon Resource Name (ARN) of the policy. - ResourceArn *string `locationName:"resourceArn" 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 ResourcePolicy) 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 ResourcePolicy) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *ResourcePolicy) SetPolicy(v string) *ResourcePolicy { - s.Policy = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ResourcePolicy) SetResourceArn(v string) *ResourcePolicy { - s.ResourceArn = &v - return s -} - -type RestoreFromRecoveryPointInput struct { - _ struct{} `type:"structure"` - - // The name of the namespace to restore data into. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" min:"3" type:"string" required:"true"` - - // The unique identifier of the recovery point to restore from. - // - // RecoveryPointId is a required field - RecoveryPointId *string `locationName:"recoveryPointId" type:"string" required:"true"` - - // The name of the workgroup used to restore data. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 RestoreFromRecoveryPointInput) 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 RestoreFromRecoveryPointInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreFromRecoveryPointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreFromRecoveryPointInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.NamespaceName != nil && len(*s.NamespaceName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("NamespaceName", 3)) - } - if s.RecoveryPointId == nil { - invalidParams.Add(request.NewErrParamRequired("RecoveryPointId")) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *RestoreFromRecoveryPointInput) SetNamespaceName(v string) *RestoreFromRecoveryPointInput { - s.NamespaceName = &v - return s -} - -// SetRecoveryPointId sets the RecoveryPointId field's value. -func (s *RestoreFromRecoveryPointInput) SetRecoveryPointId(v string) *RestoreFromRecoveryPointInput { - s.RecoveryPointId = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *RestoreFromRecoveryPointInput) SetWorkgroupName(v string) *RestoreFromRecoveryPointInput { - s.WorkgroupName = &v - return s -} - -type RestoreFromRecoveryPointOutput struct { - _ struct{} `type:"structure"` - - // The namespace that data was restored into. - Namespace *Namespace `locationName:"namespace" type:"structure"` - - // The unique identifier of the recovery point used for the restore. - RecoveryPointId *string `locationName:"recoveryPointId" 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 RestoreFromRecoveryPointOutput) 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 RestoreFromRecoveryPointOutput) GoString() string { - return s.String() -} - -// SetNamespace sets the Namespace field's value. -func (s *RestoreFromRecoveryPointOutput) SetNamespace(v *Namespace) *RestoreFromRecoveryPointOutput { - s.Namespace = v - return s -} - -// SetRecoveryPointId sets the RecoveryPointId field's value. -func (s *RestoreFromRecoveryPointOutput) SetRecoveryPointId(v string) *RestoreFromRecoveryPointOutput { - s.RecoveryPointId = &v - return s -} - -type RestoreFromSnapshotInput struct { - _ struct{} `type:"structure"` - - // The ID of the Key Management Service (KMS) key used to encrypt and store - // the namespace's admin credentials secret. - AdminPasswordSecretKmsKeyId *string `locationName:"adminPasswordSecretKmsKeyId" type:"string"` - - // If true, Amazon Redshift uses Secrets Manager to manage the restored snapshot's - // admin credentials. If MmanageAdminPassword is false or not set, Amazon Redshift - // uses the admin credentials that the namespace or cluster had at the time - // the snapshot was taken. - ManageAdminPassword *bool `locationName:"manageAdminPassword" type:"boolean"` - - // The name of the namespace to restore the snapshot to. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" min:"3" type:"string" required:"true"` - - // The Amazon Web Services account that owns the snapshot. - OwnerAccount *string `locationName:"ownerAccount" type:"string"` - - // The Amazon Resource Name (ARN) of the snapshot to restore from. Required - // if restoring from Amazon Redshift Serverless to a provisioned cluster. Must - // not be specified at the same time as snapshotName. - // - // The format of the ARN is arn:aws:redshift:::snapshot:/. - SnapshotArn *string `locationName:"snapshotArn" type:"string"` - - // The name of the snapshot to restore from. Must not be specified at the same - // time as snapshotArn. - SnapshotName *string `locationName:"snapshotName" type:"string"` - - // The name of the workgroup used to restore the snapshot. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 RestoreFromSnapshotInput) 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 RestoreFromSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreFromSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreFromSnapshotInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.NamespaceName != nil && len(*s.NamespaceName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("NamespaceName", 3)) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdminPasswordSecretKmsKeyId sets the AdminPasswordSecretKmsKeyId field's value. -func (s *RestoreFromSnapshotInput) SetAdminPasswordSecretKmsKeyId(v string) *RestoreFromSnapshotInput { - s.AdminPasswordSecretKmsKeyId = &v - return s -} - -// SetManageAdminPassword sets the ManageAdminPassword field's value. -func (s *RestoreFromSnapshotInput) SetManageAdminPassword(v bool) *RestoreFromSnapshotInput { - s.ManageAdminPassword = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *RestoreFromSnapshotInput) SetNamespaceName(v string) *RestoreFromSnapshotInput { - s.NamespaceName = &v - return s -} - -// SetOwnerAccount sets the OwnerAccount field's value. -func (s *RestoreFromSnapshotInput) SetOwnerAccount(v string) *RestoreFromSnapshotInput { - s.OwnerAccount = &v - return s -} - -// SetSnapshotArn sets the SnapshotArn field's value. -func (s *RestoreFromSnapshotInput) SetSnapshotArn(v string) *RestoreFromSnapshotInput { - s.SnapshotArn = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *RestoreFromSnapshotInput) SetSnapshotName(v string) *RestoreFromSnapshotInput { - s.SnapshotName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *RestoreFromSnapshotInput) SetWorkgroupName(v string) *RestoreFromSnapshotInput { - s.WorkgroupName = &v - return s -} - -type RestoreFromSnapshotOutput struct { - _ struct{} `type:"structure"` - - // A collection of database objects and users. - Namespace *Namespace `locationName:"namespace" type:"structure"` - - // The owner Amazon Web Services; account of the snapshot that was restored. - OwnerAccount *string `locationName:"ownerAccount" type:"string"` - - // The name of the snapshot used to restore the namespace. - SnapshotName *string `locationName:"snapshotName" 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 RestoreFromSnapshotOutput) 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 RestoreFromSnapshotOutput) GoString() string { - return s.String() -} - -// SetNamespace sets the Namespace field's value. -func (s *RestoreFromSnapshotOutput) SetNamespace(v *Namespace) *RestoreFromSnapshotOutput { - s.Namespace = v - return s -} - -// SetOwnerAccount sets the OwnerAccount field's value. -func (s *RestoreFromSnapshotOutput) SetOwnerAccount(v string) *RestoreFromSnapshotOutput { - s.OwnerAccount = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *RestoreFromSnapshotOutput) SetSnapshotName(v string) *RestoreFromSnapshotOutput { - s.SnapshotName = &v - return s -} - -type RestoreTableFromSnapshotInput struct { - _ struct{} `type:"structure"` - - // Indicates whether name identifiers for database, schema, and table are case - // sensitive. If true, the names are case sensitive. If false, the names are - // not case sensitive. The default is false. - ActivateCaseSensitiveIdentifier *bool `locationName:"activateCaseSensitiveIdentifier" type:"boolean"` - - // The namespace of the snapshot to restore from. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" type:"string" required:"true"` - - // The name of the table to create from the restore operation. - // - // NewTableName is a required field - NewTableName *string `locationName:"newTableName" type:"string" required:"true"` - - // The name of the snapshot to restore the table from. - // - // SnapshotName is a required field - SnapshotName *string `locationName:"snapshotName" type:"string" required:"true"` - - // The name of the source database that contains the table being restored. - // - // SourceDatabaseName is a required field - SourceDatabaseName *string `locationName:"sourceDatabaseName" type:"string" required:"true"` - - // The name of the source schema that contains the table being restored. - SourceSchemaName *string `locationName:"sourceSchemaName" type:"string"` - - // The name of the source table being restored. - // - // SourceTableName is a required field - SourceTableName *string `locationName:"sourceTableName" type:"string" required:"true"` - - // The name of the database to restore the table to. - TargetDatabaseName *string `locationName:"targetDatabaseName" type:"string"` - - // The name of the schema to restore the table to. - TargetSchemaName *string `locationName:"targetSchemaName" type:"string"` - - // The workgroup to restore the table to. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" 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 RestoreTableFromSnapshotInput) 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 RestoreTableFromSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreTableFromSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreTableFromSnapshotInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.NewTableName == nil { - invalidParams.Add(request.NewErrParamRequired("NewTableName")) - } - if s.SnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotName")) - } - if s.SourceDatabaseName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceDatabaseName")) - } - if s.SourceTableName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceTableName")) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActivateCaseSensitiveIdentifier sets the ActivateCaseSensitiveIdentifier field's value. -func (s *RestoreTableFromSnapshotInput) SetActivateCaseSensitiveIdentifier(v bool) *RestoreTableFromSnapshotInput { - s.ActivateCaseSensitiveIdentifier = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *RestoreTableFromSnapshotInput) SetNamespaceName(v string) *RestoreTableFromSnapshotInput { - s.NamespaceName = &v - return s -} - -// SetNewTableName sets the NewTableName field's value. -func (s *RestoreTableFromSnapshotInput) SetNewTableName(v string) *RestoreTableFromSnapshotInput { - s.NewTableName = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *RestoreTableFromSnapshotInput) SetSnapshotName(v string) *RestoreTableFromSnapshotInput { - s.SnapshotName = &v - return s -} - -// SetSourceDatabaseName sets the SourceDatabaseName field's value. -func (s *RestoreTableFromSnapshotInput) SetSourceDatabaseName(v string) *RestoreTableFromSnapshotInput { - s.SourceDatabaseName = &v - return s -} - -// SetSourceSchemaName sets the SourceSchemaName field's value. -func (s *RestoreTableFromSnapshotInput) SetSourceSchemaName(v string) *RestoreTableFromSnapshotInput { - s.SourceSchemaName = &v - return s -} - -// SetSourceTableName sets the SourceTableName field's value. -func (s *RestoreTableFromSnapshotInput) SetSourceTableName(v string) *RestoreTableFromSnapshotInput { - s.SourceTableName = &v - return s -} - -// SetTargetDatabaseName sets the TargetDatabaseName field's value. -func (s *RestoreTableFromSnapshotInput) SetTargetDatabaseName(v string) *RestoreTableFromSnapshotInput { - s.TargetDatabaseName = &v - return s -} - -// SetTargetSchemaName sets the TargetSchemaName field's value. -func (s *RestoreTableFromSnapshotInput) SetTargetSchemaName(v string) *RestoreTableFromSnapshotInput { - s.TargetSchemaName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *RestoreTableFromSnapshotInput) SetWorkgroupName(v string) *RestoreTableFromSnapshotInput { - s.WorkgroupName = &v - return s -} - -type RestoreTableFromSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The TableRestoreStatus object that contains the status of the restore operation. - TableRestoreStatus *TableRestoreStatus `locationName:"tableRestoreStatus" 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 RestoreTableFromSnapshotOutput) 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 RestoreTableFromSnapshotOutput) GoString() string { - return s.String() -} - -// SetTableRestoreStatus sets the TableRestoreStatus field's value. -func (s *RestoreTableFromSnapshotOutput) SetTableRestoreStatus(v *TableRestoreStatus) *RestoreTableFromSnapshotOutput { - s.TableRestoreStatus = v - return s -} - -// The service limit was exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A snapshot object that contains databases. -type Snapshot struct { - _ struct{} `type:"structure"` - - // All of the Amazon Web Services accounts that have access to restore a snapshot - // to a provisioned cluster. - AccountsWithProvisionedRestoreAccess []*string `locationName:"accountsWithProvisionedRestoreAccess" type:"list"` - - // All of the Amazon Web Services accounts that have access to restore a snapshot - // to a namespace. - AccountsWithRestoreAccess []*string `locationName:"accountsWithRestoreAccess" type:"list"` - - // The size of the incremental backup in megabytes. - ActualIncrementalBackupSizeInMegaBytes *float64 `locationName:"actualIncrementalBackupSizeInMegaBytes" type:"double"` - - // The Amazon Resource Name (ARN) for the namespace's admin user credentials - // secret. - AdminPasswordSecretArn *string `locationName:"adminPasswordSecretArn" type:"string"` - - // The ID of the Key Management Service (KMS) key used to encrypt and store - // the namespace's admin credentials secret. - AdminPasswordSecretKmsKeyId *string `locationName:"adminPasswordSecretKmsKeyId" type:"string"` - - // The username of the database within a snapshot. - AdminUsername *string `locationName:"adminUsername" type:"string"` - - // The size in megabytes of the data that has been backed up to a snapshot. - BackupProgressInMegaBytes *float64 `locationName:"backupProgressInMegaBytes" type:"double"` - - // The rate at which data is backed up into a snapshot in megabytes per second. - CurrentBackupRateInMegaBytesPerSecond *float64 `locationName:"currentBackupRateInMegaBytesPerSecond" type:"double"` - - // The amount of time it took to back up data into a snapshot. - ElapsedTimeInSeconds *int64 `locationName:"elapsedTimeInSeconds" type:"long"` - - // The estimated amount of seconds until the snapshot completes backup. - EstimatedSecondsToCompletion *int64 `locationName:"estimatedSecondsToCompletion" type:"long"` - - // The unique identifier of the KMS key used to encrypt the snapshot. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The Amazon Resource Name (ARN) of the namespace the snapshot was created - // from. - NamespaceArn *string `locationName:"namespaceArn" type:"string"` - - // The name of the namepsace. - NamespaceName *string `locationName:"namespaceName" type:"string"` - - // The owner Amazon Web Services; account of the snapshot. - OwnerAccount *string `locationName:"ownerAccount" type:"string"` - - // The Amazon Resource Name (ARN) of the snapshot. - SnapshotArn *string `locationName:"snapshotArn" type:"string"` - - // The timestamp of when the snapshot was created. - SnapshotCreateTime *time.Time `locationName:"snapshotCreateTime" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the snapshot. - SnapshotName *string `locationName:"snapshotName" type:"string"` - - // The amount of days until the snapshot is deleted. - SnapshotRemainingDays *int64 `locationName:"snapshotRemainingDays" type:"integer"` - - // The period of time, in days, of how long the snapshot is retained. - SnapshotRetentionPeriod *int64 `locationName:"snapshotRetentionPeriod" type:"integer"` - - // The timestamp of when data within the snapshot started getting retained. - SnapshotRetentionStartTime *time.Time `locationName:"snapshotRetentionStartTime" type:"timestamp" timestampFormat:"iso8601"` - - // The status of the snapshot. - Status *string `locationName:"status" type:"string" enum:"SnapshotStatus"` - - // The total size, in megabytes, of how big the snapshot is. - TotalBackupSizeInMegaBytes *float64 `locationName:"totalBackupSizeInMegaBytes" type:"double"` -} - -// 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 Snapshot) 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 Snapshot) GoString() string { - return s.String() -} - -// SetAccountsWithProvisionedRestoreAccess sets the AccountsWithProvisionedRestoreAccess field's value. -func (s *Snapshot) SetAccountsWithProvisionedRestoreAccess(v []*string) *Snapshot { - s.AccountsWithProvisionedRestoreAccess = v - return s -} - -// SetAccountsWithRestoreAccess sets the AccountsWithRestoreAccess field's value. -func (s *Snapshot) SetAccountsWithRestoreAccess(v []*string) *Snapshot { - s.AccountsWithRestoreAccess = v - return s -} - -// SetActualIncrementalBackupSizeInMegaBytes sets the ActualIncrementalBackupSizeInMegaBytes field's value. -func (s *Snapshot) SetActualIncrementalBackupSizeInMegaBytes(v float64) *Snapshot { - s.ActualIncrementalBackupSizeInMegaBytes = &v - return s -} - -// SetAdminPasswordSecretArn sets the AdminPasswordSecretArn field's value. -func (s *Snapshot) SetAdminPasswordSecretArn(v string) *Snapshot { - s.AdminPasswordSecretArn = &v - return s -} - -// SetAdminPasswordSecretKmsKeyId sets the AdminPasswordSecretKmsKeyId field's value. -func (s *Snapshot) SetAdminPasswordSecretKmsKeyId(v string) *Snapshot { - s.AdminPasswordSecretKmsKeyId = &v - return s -} - -// SetAdminUsername sets the AdminUsername field's value. -func (s *Snapshot) SetAdminUsername(v string) *Snapshot { - s.AdminUsername = &v - return s -} - -// SetBackupProgressInMegaBytes sets the BackupProgressInMegaBytes field's value. -func (s *Snapshot) SetBackupProgressInMegaBytes(v float64) *Snapshot { - s.BackupProgressInMegaBytes = &v - return s -} - -// SetCurrentBackupRateInMegaBytesPerSecond sets the CurrentBackupRateInMegaBytesPerSecond field's value. -func (s *Snapshot) SetCurrentBackupRateInMegaBytesPerSecond(v float64) *Snapshot { - s.CurrentBackupRateInMegaBytesPerSecond = &v - return s -} - -// SetElapsedTimeInSeconds sets the ElapsedTimeInSeconds field's value. -func (s *Snapshot) SetElapsedTimeInSeconds(v int64) *Snapshot { - s.ElapsedTimeInSeconds = &v - return s -} - -// SetEstimatedSecondsToCompletion sets the EstimatedSecondsToCompletion field's value. -func (s *Snapshot) SetEstimatedSecondsToCompletion(v int64) *Snapshot { - s.EstimatedSecondsToCompletion = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Snapshot) SetKmsKeyId(v string) *Snapshot { - s.KmsKeyId = &v - return s -} - -// SetNamespaceArn sets the NamespaceArn field's value. -func (s *Snapshot) SetNamespaceArn(v string) *Snapshot { - s.NamespaceArn = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *Snapshot) SetNamespaceName(v string) *Snapshot { - s.NamespaceName = &v - return s -} - -// SetOwnerAccount sets the OwnerAccount field's value. -func (s *Snapshot) SetOwnerAccount(v string) *Snapshot { - s.OwnerAccount = &v - return s -} - -// SetSnapshotArn sets the SnapshotArn field's value. -func (s *Snapshot) SetSnapshotArn(v string) *Snapshot { - s.SnapshotArn = &v - return s -} - -// SetSnapshotCreateTime sets the SnapshotCreateTime field's value. -func (s *Snapshot) SetSnapshotCreateTime(v time.Time) *Snapshot { - s.SnapshotCreateTime = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *Snapshot) SetSnapshotName(v string) *Snapshot { - s.SnapshotName = &v - return s -} - -// SetSnapshotRemainingDays sets the SnapshotRemainingDays field's value. -func (s *Snapshot) SetSnapshotRemainingDays(v int64) *Snapshot { - s.SnapshotRemainingDays = &v - return s -} - -// SetSnapshotRetentionPeriod sets the SnapshotRetentionPeriod field's value. -func (s *Snapshot) SetSnapshotRetentionPeriod(v int64) *Snapshot { - s.SnapshotRetentionPeriod = &v - return s -} - -// SetSnapshotRetentionStartTime sets the SnapshotRetentionStartTime field's value. -func (s *Snapshot) SetSnapshotRetentionStartTime(v time.Time) *Snapshot { - s.SnapshotRetentionStartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Snapshot) SetStatus(v string) *Snapshot { - s.Status = &v - return s -} - -// SetTotalBackupSizeInMegaBytes sets the TotalBackupSizeInMegaBytes field's value. -func (s *Snapshot) SetTotalBackupSizeInMegaBytes(v float64) *Snapshot { - s.TotalBackupSizeInMegaBytes = &v - return s -} - -// Contains information about a table restore request. -type TableRestoreStatus struct { - _ struct{} `type:"structure"` - - // A description of the status of the table restore request. Status values include - // SUCCEEDED, FAILED, CANCELED, PENDING, IN_PROGRESS. - Message *string `locationName:"message" type:"string"` - - // The namespace of the table being restored from. - NamespaceName *string `locationName:"namespaceName" type:"string"` - - // The name of the table to create from the restore operation. - NewTableName *string `locationName:"newTableName" type:"string"` - - // The amount of data restored to the new table so far, in megabytes (MB). - ProgressInMegaBytes *int64 `locationName:"progressInMegaBytes" type:"long"` - - // The time that the table restore request was made, in Universal Coordinated - // Time (UTC). - RequestTime *time.Time `locationName:"requestTime" type:"timestamp"` - - // The name of the snapshot being restored from. - SnapshotName *string `locationName:"snapshotName" type:"string"` - - // The name of the source database being restored from. - SourceDatabaseName *string `locationName:"sourceDatabaseName" type:"string"` - - // The name of the source schema being restored from. - SourceSchemaName *string `locationName:"sourceSchemaName" type:"string"` - - // The name of the source table being restored from. - SourceTableName *string `locationName:"sourceTableName" type:"string"` - - // A value that describes the current state of the table restore request. Possible - // values include SUCCEEDED, FAILED, CANCELED, PENDING, IN_PROGRESS. - Status *string `locationName:"status" type:"string"` - - // The ID of the RestoreTableFromSnapshot request. - TableRestoreRequestId *string `locationName:"tableRestoreRequestId" type:"string"` - - // The name of the database to restore to. - TargetDatabaseName *string `locationName:"targetDatabaseName" type:"string"` - - // The name of the schema to restore to. - TargetSchemaName *string `locationName:"targetSchemaName" type:"string"` - - // The total amount of data to restore to the new table, in megabytes (MB). - TotalDataInMegaBytes *int64 `locationName:"totalDataInMegaBytes" type:"long"` - - // The name of the workgroup being restored from. - WorkgroupName *string `locationName:"workgroupName" 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 TableRestoreStatus) 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 TableRestoreStatus) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *TableRestoreStatus) SetMessage(v string) *TableRestoreStatus { - s.Message = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *TableRestoreStatus) SetNamespaceName(v string) *TableRestoreStatus { - s.NamespaceName = &v - return s -} - -// SetNewTableName sets the NewTableName field's value. -func (s *TableRestoreStatus) SetNewTableName(v string) *TableRestoreStatus { - s.NewTableName = &v - return s -} - -// SetProgressInMegaBytes sets the ProgressInMegaBytes field's value. -func (s *TableRestoreStatus) SetProgressInMegaBytes(v int64) *TableRestoreStatus { - s.ProgressInMegaBytes = &v - return s -} - -// SetRequestTime sets the RequestTime field's value. -func (s *TableRestoreStatus) SetRequestTime(v time.Time) *TableRestoreStatus { - s.RequestTime = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *TableRestoreStatus) SetSnapshotName(v string) *TableRestoreStatus { - s.SnapshotName = &v - return s -} - -// SetSourceDatabaseName sets the SourceDatabaseName field's value. -func (s *TableRestoreStatus) SetSourceDatabaseName(v string) *TableRestoreStatus { - s.SourceDatabaseName = &v - return s -} - -// SetSourceSchemaName sets the SourceSchemaName field's value. -func (s *TableRestoreStatus) SetSourceSchemaName(v string) *TableRestoreStatus { - s.SourceSchemaName = &v - return s -} - -// SetSourceTableName sets the SourceTableName field's value. -func (s *TableRestoreStatus) SetSourceTableName(v string) *TableRestoreStatus { - s.SourceTableName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TableRestoreStatus) SetStatus(v string) *TableRestoreStatus { - s.Status = &v - return s -} - -// SetTableRestoreRequestId sets the TableRestoreRequestId field's value. -func (s *TableRestoreStatus) SetTableRestoreRequestId(v string) *TableRestoreStatus { - s.TableRestoreRequestId = &v - return s -} - -// SetTargetDatabaseName sets the TargetDatabaseName field's value. -func (s *TableRestoreStatus) SetTargetDatabaseName(v string) *TableRestoreStatus { - s.TargetDatabaseName = &v - return s -} - -// SetTargetSchemaName sets the TargetSchemaName field's value. -func (s *TableRestoreStatus) SetTargetSchemaName(v string) *TableRestoreStatus { - s.TargetSchemaName = &v - return s -} - -// SetTotalDataInMegaBytes sets the TotalDataInMegaBytes field's value. -func (s *TableRestoreStatus) SetTotalDataInMegaBytes(v int64) *TableRestoreStatus { - s.TotalDataInMegaBytes = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *TableRestoreStatus) SetWorkgroupName(v string) *TableRestoreStatus { - s.WorkgroupName = &v - return s -} - -// A map of key-value pairs. -type Tag struct { - _ struct{} `type:"structure"` - - // The key to use in the tag. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // The value of the tag. - // - // Value is a required field - Value *string `locationName:"value" 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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource to tag. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The map of the key-value pairs used to tag the resource. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Code_ *string `locationName:"code" type:"string"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request exceeded the number of tags allowed for a resource. -type TooManyTagsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The name of the resource that exceeded the number of tags allowed for a resource. - ResourceName *string `locationName:"resourceName" min:"1" 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 TooManyTagsException) 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 TooManyTagsException) GoString() string { - return s.String() -} - -func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { - return &TooManyTagsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyTagsException) Code() string { - return "TooManyTagsException" -} - -// Message returns the exception's message. -func (s *TooManyTagsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyTagsException) OrigErr() error { - return nil -} - -func (s *TooManyTagsException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyTagsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyTagsException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource to remove tags from. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The tag or set of tags to remove from the resource. - // - // TagKeys is a required field - TagKeys []*string `locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateCustomDomainAssociationInput struct { - _ struct{} `type:"structure"` - - // The custom domain name’s certificate Amazon resource name (ARN). This is - // optional. - // - // CustomDomainCertificateArn is a required field - CustomDomainCertificateArn *string `locationName:"customDomainCertificateArn" min:"20" type:"string" required:"true"` - - // The custom domain name associated with the workgroup. - // - // CustomDomainName is a required field - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string" required:"true"` - - // The name of the workgroup associated with the database. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 UpdateCustomDomainAssociationInput) 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 UpdateCustomDomainAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCustomDomainAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCustomDomainAssociationInput"} - if s.CustomDomainCertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("CustomDomainCertificateArn")) - } - if s.CustomDomainCertificateArn != nil && len(*s.CustomDomainCertificateArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainCertificateArn", 20)) - } - if s.CustomDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("CustomDomainName")) - } - if s.CustomDomainName != nil && len(*s.CustomDomainName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainName", 1)) - } - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomDomainCertificateArn sets the CustomDomainCertificateArn field's value. -func (s *UpdateCustomDomainAssociationInput) SetCustomDomainCertificateArn(v string) *UpdateCustomDomainAssociationInput { - s.CustomDomainCertificateArn = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *UpdateCustomDomainAssociationInput) SetCustomDomainName(v string) *UpdateCustomDomainAssociationInput { - s.CustomDomainName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *UpdateCustomDomainAssociationInput) SetWorkgroupName(v string) *UpdateCustomDomainAssociationInput { - s.WorkgroupName = &v - return s -} - -type UpdateCustomDomainAssociationOutput struct { - _ struct{} `type:"structure"` - - // The custom domain name’s certificate Amazon resource name (ARN). - CustomDomainCertificateArn *string `locationName:"customDomainCertificateArn" min:"20" type:"string"` - - // The expiration time for the certificate. - CustomDomainCertificateExpiryTime *time.Time `locationName:"customDomainCertificateExpiryTime" type:"timestamp" timestampFormat:"iso8601"` - - // The custom domain name associated with the workgroup. - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string"` - - // The name of the workgroup associated with the database. - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 UpdateCustomDomainAssociationOutput) 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 UpdateCustomDomainAssociationOutput) GoString() string { - return s.String() -} - -// SetCustomDomainCertificateArn sets the CustomDomainCertificateArn field's value. -func (s *UpdateCustomDomainAssociationOutput) SetCustomDomainCertificateArn(v string) *UpdateCustomDomainAssociationOutput { - s.CustomDomainCertificateArn = &v - return s -} - -// SetCustomDomainCertificateExpiryTime sets the CustomDomainCertificateExpiryTime field's value. -func (s *UpdateCustomDomainAssociationOutput) SetCustomDomainCertificateExpiryTime(v time.Time) *UpdateCustomDomainAssociationOutput { - s.CustomDomainCertificateExpiryTime = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *UpdateCustomDomainAssociationOutput) SetCustomDomainName(v string) *UpdateCustomDomainAssociationOutput { - s.CustomDomainName = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *UpdateCustomDomainAssociationOutput) SetWorkgroupName(v string) *UpdateCustomDomainAssociationOutput { - s.WorkgroupName = &v - return s -} - -type UpdateEndpointAccessInput struct { - _ struct{} `type:"structure"` - - // The name of the VPC endpoint to update. - // - // EndpointName is a required field - EndpointName *string `locationName:"endpointName" type:"string" required:"true"` - - // The list of VPC security groups associated with the endpoint after the endpoint - // is modified. - VpcSecurityGroupIds []*string `locationName:"vpcSecurityGroupIds" type:"list"` -} - -// 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 UpdateEndpointAccessInput) 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 UpdateEndpointAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEndpointAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointAccessInput"} - if s.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointName sets the EndpointName field's value. -func (s *UpdateEndpointAccessInput) SetEndpointName(v string) *UpdateEndpointAccessInput { - s.EndpointName = &v - return s -} - -// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. -func (s *UpdateEndpointAccessInput) SetVpcSecurityGroupIds(v []*string) *UpdateEndpointAccessInput { - s.VpcSecurityGroupIds = v - return s -} - -type UpdateEndpointAccessOutput struct { - _ struct{} `type:"structure"` - - // The updated VPC endpoint. - Endpoint *EndpointAccess `locationName:"endpoint" 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 UpdateEndpointAccessOutput) 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 UpdateEndpointAccessOutput) GoString() string { - return s.String() -} - -// SetEndpoint sets the Endpoint field's value. -func (s *UpdateEndpointAccessOutput) SetEndpoint(v *EndpointAccess) *UpdateEndpointAccessOutput { - s.Endpoint = v - return s -} - -type UpdateNamespaceInput struct { - _ struct{} `type:"structure"` - - // The ID of the Key Management Service (KMS) key used to encrypt and store - // the namespace's admin credentials secret. You can only use this parameter - // if manageAdminPassword is true. - AdminPasswordSecretKmsKeyId *string `locationName:"adminPasswordSecretKmsKeyId" type:"string"` - - // The password of the administrator for the first database created in the namespace. - // This parameter must be updated together with adminUsername. - // - // You can't use adminUserPassword if manageAdminPassword is true. - // - // AdminUserPassword is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateNamespaceInput's - // String and GoString methods. - AdminUserPassword *string `locationName:"adminUserPassword" type:"string" sensitive:"true"` - - // The username of the administrator for the first database created in the namespace. - // This parameter must be updated together with adminUserPassword. - // - // AdminUsername is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateNamespaceInput's - // String and GoString methods. - AdminUsername *string `locationName:"adminUsername" type:"string" sensitive:"true"` - - // The Amazon Resource Name (ARN) of the IAM role to set as a default in the - // namespace. This parameter must be updated together with iamRoles. - DefaultIamRoleArn *string `locationName:"defaultIamRoleArn" type:"string"` - - // A list of IAM roles to associate with the namespace. This parameter must - // be updated together with defaultIamRoleArn. - IamRoles []*string `locationName:"iamRoles" type:"list"` - - // The ID of the Amazon Web Services Key Management Service key used to encrypt - // your data. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // The types of logs the namespace can export. The export types are userlog, - // connectionlog, and useractivitylog. - LogExports []*string `locationName:"logExports" type:"list" enum:"LogExport"` - - // If true, Amazon Redshift uses Secrets Manager to manage the namespace's admin - // credentials. You can't use adminUserPassword if manageAdminPassword is true. - // If manageAdminPassword is false or not set, Amazon Redshift uses adminUserPassword - // for the admin user account's password. - ManageAdminPassword *bool `locationName:"manageAdminPassword" type:"boolean"` - - // The name of the namespace to update. You can't update the name of a namespace - // once it is created. - // - // NamespaceName is a required field - NamespaceName *string `locationName:"namespaceName" min:"3" 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 UpdateNamespaceInput) 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 UpdateNamespaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateNamespaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateNamespaceInput"} - if s.NamespaceName == nil { - invalidParams.Add(request.NewErrParamRequired("NamespaceName")) - } - if s.NamespaceName != nil && len(*s.NamespaceName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("NamespaceName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdminPasswordSecretKmsKeyId sets the AdminPasswordSecretKmsKeyId field's value. -func (s *UpdateNamespaceInput) SetAdminPasswordSecretKmsKeyId(v string) *UpdateNamespaceInput { - s.AdminPasswordSecretKmsKeyId = &v - return s -} - -// SetAdminUserPassword sets the AdminUserPassword field's value. -func (s *UpdateNamespaceInput) SetAdminUserPassword(v string) *UpdateNamespaceInput { - s.AdminUserPassword = &v - return s -} - -// SetAdminUsername sets the AdminUsername field's value. -func (s *UpdateNamespaceInput) SetAdminUsername(v string) *UpdateNamespaceInput { - s.AdminUsername = &v - return s -} - -// SetDefaultIamRoleArn sets the DefaultIamRoleArn field's value. -func (s *UpdateNamespaceInput) SetDefaultIamRoleArn(v string) *UpdateNamespaceInput { - s.DefaultIamRoleArn = &v - return s -} - -// SetIamRoles sets the IamRoles field's value. -func (s *UpdateNamespaceInput) SetIamRoles(v []*string) *UpdateNamespaceInput { - s.IamRoles = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *UpdateNamespaceInput) SetKmsKeyId(v string) *UpdateNamespaceInput { - s.KmsKeyId = &v - return s -} - -// SetLogExports sets the LogExports field's value. -func (s *UpdateNamespaceInput) SetLogExports(v []*string) *UpdateNamespaceInput { - s.LogExports = v - return s -} - -// SetManageAdminPassword sets the ManageAdminPassword field's value. -func (s *UpdateNamespaceInput) SetManageAdminPassword(v bool) *UpdateNamespaceInput { - s.ManageAdminPassword = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *UpdateNamespaceInput) SetNamespaceName(v string) *UpdateNamespaceInput { - s.NamespaceName = &v - return s -} - -type UpdateNamespaceOutput struct { - _ struct{} `type:"structure"` - - // A list of tag instances. - // - // Namespace is a required field - Namespace *Namespace `locationName:"namespace" type:"structure" 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 UpdateNamespaceOutput) 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 UpdateNamespaceOutput) GoString() string { - return s.String() -} - -// SetNamespace sets the Namespace field's value. -func (s *UpdateNamespaceOutput) SetNamespace(v *Namespace) *UpdateNamespaceOutput { - s.Namespace = v - return s -} - -type UpdateSnapshotInput struct { - _ struct{} `type:"structure"` - - // The new retention period of the snapshot. - RetentionPeriod *int64 `locationName:"retentionPeriod" type:"integer"` - - // The name of the snapshot. - // - // SnapshotName is a required field - SnapshotName *string `locationName:"snapshotName" 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 UpdateSnapshotInput) 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 UpdateSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSnapshotInput"} - if s.SnapshotName == nil { - invalidParams.Add(request.NewErrParamRequired("SnapshotName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *UpdateSnapshotInput) SetRetentionPeriod(v int64) *UpdateSnapshotInput { - s.RetentionPeriod = &v - return s -} - -// SetSnapshotName sets the SnapshotName field's value. -func (s *UpdateSnapshotInput) SetSnapshotName(v string) *UpdateSnapshotInput { - s.SnapshotName = &v - return s -} - -type UpdateSnapshotOutput struct { - _ struct{} `type:"structure"` - - // The updated snapshot object. - Snapshot *Snapshot `locationName:"snapshot" 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 UpdateSnapshotOutput) 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 UpdateSnapshotOutput) GoString() string { - return s.String() -} - -// SetSnapshot sets the Snapshot field's value. -func (s *UpdateSnapshotOutput) SetSnapshot(v *Snapshot) *UpdateSnapshotOutput { - s.Snapshot = v - return s -} - -type UpdateUsageLimitInput struct { - _ struct{} `type:"structure"` - - // The new limit amount. If time-based, this amount is in Redshift Processing - // Units (RPU) consumed per hour. If data-based, this amount is in terabytes - // (TB) of data transferred between Regions in cross-account sharing. The value - // must be a positive number. - Amount *int64 `locationName:"amount" type:"long"` - - // The new action that Amazon Redshift Serverless takes when the limit is reached. - BreachAction *string `locationName:"breachAction" type:"string" enum:"UsageLimitBreachAction"` - - // The identifier of the usage limit to update. - // - // UsageLimitId is a required field - UsageLimitId *string `locationName:"usageLimitId" 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 UpdateUsageLimitInput) 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 UpdateUsageLimitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateUsageLimitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateUsageLimitInput"} - if s.UsageLimitId == nil { - invalidParams.Add(request.NewErrParamRequired("UsageLimitId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAmount sets the Amount field's value. -func (s *UpdateUsageLimitInput) SetAmount(v int64) *UpdateUsageLimitInput { - s.Amount = &v - return s -} - -// SetBreachAction sets the BreachAction field's value. -func (s *UpdateUsageLimitInput) SetBreachAction(v string) *UpdateUsageLimitInput { - s.BreachAction = &v - return s -} - -// SetUsageLimitId sets the UsageLimitId field's value. -func (s *UpdateUsageLimitInput) SetUsageLimitId(v string) *UpdateUsageLimitInput { - s.UsageLimitId = &v - return s -} - -type UpdateUsageLimitOutput struct { - _ struct{} `type:"structure"` - - // The updated usage limit object. - UsageLimit *UsageLimit `locationName:"usageLimit" 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 UpdateUsageLimitOutput) 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 UpdateUsageLimitOutput) GoString() string { - return s.String() -} - -// SetUsageLimit sets the UsageLimit field's value. -func (s *UpdateUsageLimitOutput) SetUsageLimit(v *UsageLimit) *UpdateUsageLimitOutput { - s.UsageLimit = v - return s -} - -type UpdateWorkgroupInput struct { - _ struct{} `type:"structure"` - - // The new base data warehouse capacity in Redshift Processing Units (RPUs). - BaseCapacity *int64 `locationName:"baseCapacity" type:"integer"` - - // An array of parameters to set for advanced control over a database. The options - // are auto_mv, datestyle, enable_case_sensitivity_identifier, enable_user_activity_logging, - // query_group, search_path, and query monitoring metrics that let you define - // performance boundaries. For more information about query monitoring rules - // and available metrics, see Query monitoring metrics for Amazon Redshift Serverless - // (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless). - ConfigParameters []*ConfigParameter `locationName:"configParameters" type:"list"` - - // The value that specifies whether to turn on enhanced virtual private cloud - // (VPC) routing, which forces Amazon Redshift Serverless to route traffic through - // your VPC. - EnhancedVpcRouting *bool `locationName:"enhancedVpcRouting" type:"boolean"` - - // The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve - // queries. The max capacity is specified in RPUs. - MaxCapacity *int64 `locationName:"maxCapacity" type:"integer"` - - // The custom port to use when connecting to a workgroup. Valid port ranges - // are 5431-5455 and 8191-8215. The default is 5439. - Port *int64 `locationName:"port" type:"integer"` - - // A value that specifies whether the workgroup can be accessible from a public - // network. - PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"` - - // An array of security group IDs to associate with the workgroup. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // An array of VPC subnet IDs to associate with the workgroup. - SubnetIds []*string `locationName:"subnetIds" type:"list"` - - // The name of the workgroup to update. You can't update the name of a workgroup - // once it is created. - // - // WorkgroupName is a required field - WorkgroupName *string `locationName:"workgroupName" min:"3" 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 UpdateWorkgroupInput) 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 UpdateWorkgroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateWorkgroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateWorkgroupInput"} - if s.WorkgroupName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkgroupName")) - } - if s.WorkgroupName != nil && len(*s.WorkgroupName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("WorkgroupName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBaseCapacity sets the BaseCapacity field's value. -func (s *UpdateWorkgroupInput) SetBaseCapacity(v int64) *UpdateWorkgroupInput { - s.BaseCapacity = &v - return s -} - -// SetConfigParameters sets the ConfigParameters field's value. -func (s *UpdateWorkgroupInput) SetConfigParameters(v []*ConfigParameter) *UpdateWorkgroupInput { - s.ConfigParameters = v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *UpdateWorkgroupInput) SetEnhancedVpcRouting(v bool) *UpdateWorkgroupInput { - s.EnhancedVpcRouting = &v - return s -} - -// SetMaxCapacity sets the MaxCapacity field's value. -func (s *UpdateWorkgroupInput) SetMaxCapacity(v int64) *UpdateWorkgroupInput { - s.MaxCapacity = &v - return s -} - -// SetPort sets the Port field's value. -func (s *UpdateWorkgroupInput) SetPort(v int64) *UpdateWorkgroupInput { - s.Port = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *UpdateWorkgroupInput) SetPubliclyAccessible(v bool) *UpdateWorkgroupInput { - s.PubliclyAccessible = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *UpdateWorkgroupInput) SetSecurityGroupIds(v []*string) *UpdateWorkgroupInput { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *UpdateWorkgroupInput) SetSubnetIds(v []*string) *UpdateWorkgroupInput { - s.SubnetIds = v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *UpdateWorkgroupInput) SetWorkgroupName(v string) *UpdateWorkgroupInput { - s.WorkgroupName = &v - return s -} - -type UpdateWorkgroupOutput struct { - _ struct{} `type:"structure"` - - // The updated workgroup object. - // - // Workgroup is a required field - Workgroup *Workgroup `locationName:"workgroup" type:"structure" 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 UpdateWorkgroupOutput) 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 UpdateWorkgroupOutput) GoString() string { - return s.String() -} - -// SetWorkgroup sets the Workgroup field's value. -func (s *UpdateWorkgroupOutput) SetWorkgroup(v *Workgroup) *UpdateWorkgroupOutput { - s.Workgroup = v - return s -} - -// The usage limit object. -type UsageLimit struct { - _ struct{} `type:"structure"` - - // The limit amount. If time-based, this amount is in RPUs consumed per hour. - // If data-based, this amount is in terabytes (TB). The value must be a positive - // number. - Amount *int64 `locationName:"amount" type:"long"` - - // The action that Amazon Redshift Serverless takes when the limit is reached. - BreachAction *string `locationName:"breachAction" type:"string" enum:"UsageLimitBreachAction"` - - // The time period that the amount applies to. A weekly period begins on Sunday. - // The default is monthly. - Period *string `locationName:"period" type:"string" enum:"UsageLimitPeriod"` - - // The Amazon Resource Name (ARN) that identifies the Amazon Redshift Serverless - // resource. - ResourceArn *string `locationName:"resourceArn" type:"string"` - - // The Amazon Resource Name (ARN) of the resource associated with the usage - // limit. - UsageLimitArn *string `locationName:"usageLimitArn" type:"string"` - - // The identifier of the usage limit. - UsageLimitId *string `locationName:"usageLimitId" type:"string"` - - // The Amazon Redshift Serverless feature to limit. - UsageType *string `locationName:"usageType" type:"string" enum:"UsageLimitUsageType"` -} - -// 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 UsageLimit) 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 UsageLimit) GoString() string { - return s.String() -} - -// SetAmount sets the Amount field's value. -func (s *UsageLimit) SetAmount(v int64) *UsageLimit { - s.Amount = &v - return s -} - -// SetBreachAction sets the BreachAction field's value. -func (s *UsageLimit) SetBreachAction(v string) *UsageLimit { - s.BreachAction = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *UsageLimit) SetPeriod(v string) *UsageLimit { - s.Period = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UsageLimit) SetResourceArn(v string) *UsageLimit { - s.ResourceArn = &v - return s -} - -// SetUsageLimitArn sets the UsageLimitArn field's value. -func (s *UsageLimit) SetUsageLimitArn(v string) *UsageLimit { - s.UsageLimitArn = &v - return s -} - -// SetUsageLimitId sets the UsageLimitId field's value. -func (s *UsageLimit) SetUsageLimitId(v string) *UsageLimit { - s.UsageLimitId = &v - return s -} - -// SetUsageType sets the UsageType field's value. -func (s *UsageLimit) SetUsageType(v string) *UsageLimit { - s.UsageType = &v - return s -} - -// The input failed to satisfy the constraints specified by an AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The connection endpoint for connecting to Amazon Redshift Serverless through -// the proxy. -type VpcEndpoint struct { - _ struct{} `type:"structure"` - - // One or more network interfaces of the endpoint. Also known as an interface - // endpoint. - NetworkInterfaces []*NetworkInterface `locationName:"networkInterfaces" type:"list"` - - // The connection endpoint ID for connecting to Amazon Redshift Serverless. - VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"` - - // The VPC identifier that the endpoint is associated with. - VpcId *string `locationName:"vpcId" 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 VpcEndpoint) 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 VpcEndpoint) GoString() string { - return s.String() -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *VpcEndpoint) SetNetworkInterfaces(v []*NetworkInterface) *VpcEndpoint { - s.NetworkInterfaces = v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *VpcEndpoint) SetVpcEndpointId(v string) *VpcEndpoint { - s.VpcEndpointId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *VpcEndpoint) SetVpcId(v string) *VpcEndpoint { - s.VpcId = &v - return s -} - -// Describes the members of a VPC security group. -type VpcSecurityGroupMembership struct { - _ struct{} `type:"structure"` - - // The status of the VPC security group. - Status *string `locationName:"status" type:"string"` - - // The unique identifier of the VPC security group. - VpcSecurityGroupId *string `locationName:"vpcSecurityGroupId" 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 VpcSecurityGroupMembership) 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 VpcSecurityGroupMembership) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *VpcSecurityGroupMembership) SetStatus(v string) *VpcSecurityGroupMembership { - s.Status = &v - return s -} - -// SetVpcSecurityGroupId sets the VpcSecurityGroupId field's value. -func (s *VpcSecurityGroupMembership) SetVpcSecurityGroupId(v string) *VpcSecurityGroupMembership { - s.VpcSecurityGroupId = &v - return s -} - -// The collection of computing resources from which an endpoint is created. -type Workgroup struct { - _ struct{} `type:"structure"` - - // The base data warehouse capacity of the workgroup in Redshift Processing - // Units (RPUs). - BaseCapacity *int64 `locationName:"baseCapacity" type:"integer"` - - // An array of parameters to set for advanced control over a database. The options - // are auto_mv, datestyle, enable_case_sensitivity_identifier, enable_user_activity_logging, - // query_group, , search_path, and query monitoring metrics that let you define - // performance boundaries. For more information about query monitoring rules - // and available metrics, see Query monitoring metrics for Amazon Redshift Serverless - // (https://docs.aws.amazon.com/redshift/latest/dg/cm-c-wlm-query-monitoring-rules.html#cm-c-wlm-query-monitoring-metrics-serverless). - ConfigParameters []*ConfigParameter `locationName:"configParameters" type:"list"` - - // The creation date of the workgroup. - CreationDate *time.Time `locationName:"creationDate" type:"timestamp" timestampFormat:"iso8601"` - - // The custom domain name’s certificate Amazon resource name (ARN). - CustomDomainCertificateArn *string `locationName:"customDomainCertificateArn" min:"20" type:"string"` - - // The expiration time for the certificate. - CustomDomainCertificateExpiryTime *time.Time `locationName:"customDomainCertificateExpiryTime" type:"timestamp" timestampFormat:"iso8601"` - - // The custom domain name associated with the workgroup. - CustomDomainName *string `locationName:"customDomainName" min:"1" type:"string"` - - // The endpoint that is created from the workgroup. - Endpoint *Endpoint `locationName:"endpoint" type:"structure"` - - // The value that specifies whether to enable enhanced virtual private cloud - // (VPC) routing, which forces Amazon Redshift Serverless to route traffic through - // your VPC. - EnhancedVpcRouting *bool `locationName:"enhancedVpcRouting" type:"boolean"` - - // The maximum data-warehouse capacity Amazon Redshift Serverless uses to serve - // queries. The max capacity is specified in RPUs. - MaxCapacity *int64 `locationName:"maxCapacity" type:"integer"` - - // The namespace the workgroup is associated with. - NamespaceName *string `locationName:"namespaceName" type:"string"` - - // The patch version of your Amazon Redshift Serverless workgroup. For more - // information about patch versions, see Cluster versions for Amazon Redshift - // (https://docs.aws.amazon.com/redshift/latest/mgmt/cluster-versions.html). - PatchVersion *string `locationName:"patchVersion" type:"string"` - - // The custom port to use when connecting to a workgroup. Valid port ranges - // are 5431-5455 and 8191-8215. The default is 5439. - Port *int64 `locationName:"port" type:"integer"` - - // A value that specifies whether the workgroup can be accessible from a public - // network - PubliclyAccessible *bool `locationName:"publiclyAccessible" type:"boolean"` - - // An array of security group IDs to associate with the workgroup. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // The status of the workgroup. - Status *string `locationName:"status" type:"string" enum:"WorkgroupStatus"` - - // An array of subnet IDs the workgroup is associated with. - SubnetIds []*string `locationName:"subnetIds" type:"list"` - - // The Amazon Resource Name (ARN) that links to the workgroup. - WorkgroupArn *string `locationName:"workgroupArn" type:"string"` - - // The unique identifier of the workgroup. - WorkgroupId *string `locationName:"workgroupId" type:"string"` - - // The name of the workgroup. - WorkgroupName *string `locationName:"workgroupName" min:"3" type:"string"` - - // The Amazon Redshift Serverless version of your workgroup. For more information - // about Amazon Redshift Serverless versions, seeCluster versions for Amazon - // Redshift (https://docs.aws.amazon.com/redshift/latest/mgmt/cluster-versions.html). - WorkgroupVersion *string `locationName:"workgroupVersion" 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 Workgroup) 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 Workgroup) GoString() string { - return s.String() -} - -// SetBaseCapacity sets the BaseCapacity field's value. -func (s *Workgroup) SetBaseCapacity(v int64) *Workgroup { - s.BaseCapacity = &v - return s -} - -// SetConfigParameters sets the ConfigParameters field's value. -func (s *Workgroup) SetConfigParameters(v []*ConfigParameter) *Workgroup { - s.ConfigParameters = v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *Workgroup) SetCreationDate(v time.Time) *Workgroup { - s.CreationDate = &v - return s -} - -// SetCustomDomainCertificateArn sets the CustomDomainCertificateArn field's value. -func (s *Workgroup) SetCustomDomainCertificateArn(v string) *Workgroup { - s.CustomDomainCertificateArn = &v - return s -} - -// SetCustomDomainCertificateExpiryTime sets the CustomDomainCertificateExpiryTime field's value. -func (s *Workgroup) SetCustomDomainCertificateExpiryTime(v time.Time) *Workgroup { - s.CustomDomainCertificateExpiryTime = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *Workgroup) SetCustomDomainName(v string) *Workgroup { - s.CustomDomainName = &v - return s -} - -// SetEndpoint sets the Endpoint field's value. -func (s *Workgroup) SetEndpoint(v *Endpoint) *Workgroup { - s.Endpoint = v - return s -} - -// SetEnhancedVpcRouting sets the EnhancedVpcRouting field's value. -func (s *Workgroup) SetEnhancedVpcRouting(v bool) *Workgroup { - s.EnhancedVpcRouting = &v - return s -} - -// SetMaxCapacity sets the MaxCapacity field's value. -func (s *Workgroup) SetMaxCapacity(v int64) *Workgroup { - s.MaxCapacity = &v - return s -} - -// SetNamespaceName sets the NamespaceName field's value. -func (s *Workgroup) SetNamespaceName(v string) *Workgroup { - s.NamespaceName = &v - return s -} - -// SetPatchVersion sets the PatchVersion field's value. -func (s *Workgroup) SetPatchVersion(v string) *Workgroup { - s.PatchVersion = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Workgroup) SetPort(v int64) *Workgroup { - s.Port = &v - return s -} - -// SetPubliclyAccessible sets the PubliclyAccessible field's value. -func (s *Workgroup) SetPubliclyAccessible(v bool) *Workgroup { - s.PubliclyAccessible = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *Workgroup) SetSecurityGroupIds(v []*string) *Workgroup { - s.SecurityGroupIds = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Workgroup) SetStatus(v string) *Workgroup { - s.Status = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *Workgroup) SetSubnetIds(v []*string) *Workgroup { - s.SubnetIds = v - return s -} - -// SetWorkgroupArn sets the WorkgroupArn field's value. -func (s *Workgroup) SetWorkgroupArn(v string) *Workgroup { - s.WorkgroupArn = &v - return s -} - -// SetWorkgroupId sets the WorkgroupId field's value. -func (s *Workgroup) SetWorkgroupId(v string) *Workgroup { - s.WorkgroupId = &v - return s -} - -// SetWorkgroupName sets the WorkgroupName field's value. -func (s *Workgroup) SetWorkgroupName(v string) *Workgroup { - s.WorkgroupName = &v - return s -} - -// SetWorkgroupVersion sets the WorkgroupVersion field's value. -func (s *Workgroup) SetWorkgroupVersion(v string) *Workgroup { - s.WorkgroupVersion = &v - return s -} - -const ( - // LogExportUseractivitylog is a LogExport enum value - LogExportUseractivitylog = "useractivitylog" - - // LogExportUserlog is a LogExport enum value - LogExportUserlog = "userlog" - - // LogExportConnectionlog is a LogExport enum value - LogExportConnectionlog = "connectionlog" -) - -// LogExport_Values returns all elements of the LogExport enum -func LogExport_Values() []string { - return []string{ - LogExportUseractivitylog, - LogExportUserlog, - LogExportConnectionlog, - } -} - -const ( - // NamespaceStatusAvailable is a NamespaceStatus enum value - NamespaceStatusAvailable = "AVAILABLE" - - // NamespaceStatusModifying is a NamespaceStatus enum value - NamespaceStatusModifying = "MODIFYING" - - // NamespaceStatusDeleting is a NamespaceStatus enum value - NamespaceStatusDeleting = "DELETING" -) - -// NamespaceStatus_Values returns all elements of the NamespaceStatus enum -func NamespaceStatus_Values() []string { - return []string{ - NamespaceStatusAvailable, - NamespaceStatusModifying, - NamespaceStatusDeleting, - } -} - -const ( - // SnapshotStatusAvailable is a SnapshotStatus enum value - SnapshotStatusAvailable = "AVAILABLE" - - // SnapshotStatusCreating is a SnapshotStatus enum value - SnapshotStatusCreating = "CREATING" - - // SnapshotStatusDeleted is a SnapshotStatus enum value - SnapshotStatusDeleted = "DELETED" - - // SnapshotStatusCancelled is a SnapshotStatus enum value - SnapshotStatusCancelled = "CANCELLED" - - // SnapshotStatusFailed is a SnapshotStatus enum value - SnapshotStatusFailed = "FAILED" - - // SnapshotStatusCopying is a SnapshotStatus enum value - SnapshotStatusCopying = "COPYING" -) - -// SnapshotStatus_Values returns all elements of the SnapshotStatus enum -func SnapshotStatus_Values() []string { - return []string{ - SnapshotStatusAvailable, - SnapshotStatusCreating, - SnapshotStatusDeleted, - SnapshotStatusCancelled, - SnapshotStatusFailed, - SnapshotStatusCopying, - } -} - -const ( - // UsageLimitBreachActionLog is a UsageLimitBreachAction enum value - UsageLimitBreachActionLog = "log" - - // UsageLimitBreachActionEmitMetric is a UsageLimitBreachAction enum value - UsageLimitBreachActionEmitMetric = "emit-metric" - - // UsageLimitBreachActionDeactivate is a UsageLimitBreachAction enum value - UsageLimitBreachActionDeactivate = "deactivate" -) - -// UsageLimitBreachAction_Values returns all elements of the UsageLimitBreachAction enum -func UsageLimitBreachAction_Values() []string { - return []string{ - UsageLimitBreachActionLog, - UsageLimitBreachActionEmitMetric, - UsageLimitBreachActionDeactivate, - } -} - -const ( - // UsageLimitPeriodDaily is a UsageLimitPeriod enum value - UsageLimitPeriodDaily = "daily" - - // UsageLimitPeriodWeekly is a UsageLimitPeriod enum value - UsageLimitPeriodWeekly = "weekly" - - // UsageLimitPeriodMonthly is a UsageLimitPeriod enum value - UsageLimitPeriodMonthly = "monthly" -) - -// UsageLimitPeriod_Values returns all elements of the UsageLimitPeriod enum -func UsageLimitPeriod_Values() []string { - return []string{ - UsageLimitPeriodDaily, - UsageLimitPeriodWeekly, - UsageLimitPeriodMonthly, - } -} - -const ( - // UsageLimitUsageTypeServerlessCompute is a UsageLimitUsageType enum value - UsageLimitUsageTypeServerlessCompute = "serverless-compute" - - // UsageLimitUsageTypeCrossRegionDatasharing is a UsageLimitUsageType enum value - UsageLimitUsageTypeCrossRegionDatasharing = "cross-region-datasharing" -) - -// UsageLimitUsageType_Values returns all elements of the UsageLimitUsageType enum -func UsageLimitUsageType_Values() []string { - return []string{ - UsageLimitUsageTypeServerlessCompute, - UsageLimitUsageTypeCrossRegionDatasharing, - } -} - -const ( - // WorkgroupStatusCreating is a WorkgroupStatus enum value - WorkgroupStatusCreating = "CREATING" - - // WorkgroupStatusAvailable is a WorkgroupStatus enum value - WorkgroupStatusAvailable = "AVAILABLE" - - // WorkgroupStatusModifying is a WorkgroupStatus enum value - WorkgroupStatusModifying = "MODIFYING" - - // WorkgroupStatusDeleting is a WorkgroupStatus enum value - WorkgroupStatusDeleting = "DELETING" -) - -// WorkgroupStatus_Values returns all elements of the WorkgroupStatus enum -func WorkgroupStatus_Values() []string { - return []string{ - WorkgroupStatusCreating, - WorkgroupStatusAvailable, - WorkgroupStatusModifying, - WorkgroupStatusDeleting, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/doc.go deleted file mode 100644 index 9022b8832ad0..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/doc.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package redshiftserverless provides the client and types for making API -// requests to Redshift Serverless. -// -// This is an interface reference for Amazon Redshift Serverless. It contains -// documentation for one of the programming or command line interfaces you can -// use to manage Amazon Redshift Serverless. -// -// Amazon Redshift Serverless automatically provisions data warehouse capacity -// and intelligently scales the underlying resources based on workload demands. -// Amazon Redshift Serverless adjusts capacity in seconds to deliver consistently -// high performance and simplified operations for even the most demanding and -// volatile workloads. Amazon Redshift Serverless lets you focus on using your -// data to acquire new insights for your business and customers. -// -// To learn more about Amazon Redshift Serverless, see What is Amazon Redshift -// Serverless (https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-whatis.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/redshift-serverless-2021-04-21 for more information on this service. -// -// See redshiftserverless package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/redshiftserverless/ -// -// # Using the Client -// -// To contact Redshift Serverless with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Redshift Serverless client RedshiftServerless for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/redshiftserverless/#New -package redshiftserverless diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/errors.go deleted file mode 100644 index 54ea4cd2b4e7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/errors.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package redshiftserverless - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The submitted action has conflicts. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInsufficientCapacityException for service response error code - // "InsufficientCapacityException". - // - // There is an insufficient capacity to perform the action. - ErrCodeInsufficientCapacityException = "InsufficientCapacityException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request processing has failed because of an unknown error, exception - // or failure. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeInvalidPaginationException for service response error code - // "InvalidPaginationException". - // - // The provided pagination token is invalid. - ErrCodeInvalidPaginationException = "InvalidPaginationException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource could not be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The service limit was exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTagsException". - // - // The request exceeded the number of tags allowed for a resource. - ErrCodeTooManyTagsException = "TooManyTagsException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input failed to satisfy the constraints specified by an AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InsufficientCapacityException": newErrorInsufficientCapacityException, - "InternalServerException": newErrorInternalServerException, - "InvalidPaginationException": newErrorInvalidPaginationException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "TooManyTagsException": newErrorTooManyTagsException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/redshiftserverlessiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/redshiftserverlessiface/interface.go deleted file mode 100644 index e186707e96b6..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/redshiftserverlessiface/interface.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package redshiftserverlessiface provides an interface to enable mocking the Redshift Serverless service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package redshiftserverlessiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless" -) - -// RedshiftServerlessAPI provides an interface to enable mocking the -// redshiftserverless.RedshiftServerless service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Redshift Serverless. -// func myFunc(svc redshiftserverlessiface.RedshiftServerlessAPI) bool { -// // Make svc.ConvertRecoveryPointToSnapshot request -// } -// -// func main() { -// sess := session.New() -// svc := redshiftserverless.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockRedshiftServerlessClient struct { -// redshiftserverlessiface.RedshiftServerlessAPI -// } -// func (m *mockRedshiftServerlessClient) ConvertRecoveryPointToSnapshot(input *redshiftserverless.ConvertRecoveryPointToSnapshotInput) (*redshiftserverless.ConvertRecoveryPointToSnapshotOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockRedshiftServerlessClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type RedshiftServerlessAPI interface { - ConvertRecoveryPointToSnapshot(*redshiftserverless.ConvertRecoveryPointToSnapshotInput) (*redshiftserverless.ConvertRecoveryPointToSnapshotOutput, error) - ConvertRecoveryPointToSnapshotWithContext(aws.Context, *redshiftserverless.ConvertRecoveryPointToSnapshotInput, ...request.Option) (*redshiftserverless.ConvertRecoveryPointToSnapshotOutput, error) - ConvertRecoveryPointToSnapshotRequest(*redshiftserverless.ConvertRecoveryPointToSnapshotInput) (*request.Request, *redshiftserverless.ConvertRecoveryPointToSnapshotOutput) - - CreateCustomDomainAssociation(*redshiftserverless.CreateCustomDomainAssociationInput) (*redshiftserverless.CreateCustomDomainAssociationOutput, error) - CreateCustomDomainAssociationWithContext(aws.Context, *redshiftserverless.CreateCustomDomainAssociationInput, ...request.Option) (*redshiftserverless.CreateCustomDomainAssociationOutput, error) - CreateCustomDomainAssociationRequest(*redshiftserverless.CreateCustomDomainAssociationInput) (*request.Request, *redshiftserverless.CreateCustomDomainAssociationOutput) - - CreateEndpointAccess(*redshiftserverless.CreateEndpointAccessInput) (*redshiftserverless.CreateEndpointAccessOutput, error) - CreateEndpointAccessWithContext(aws.Context, *redshiftserverless.CreateEndpointAccessInput, ...request.Option) (*redshiftserverless.CreateEndpointAccessOutput, error) - CreateEndpointAccessRequest(*redshiftserverless.CreateEndpointAccessInput) (*request.Request, *redshiftserverless.CreateEndpointAccessOutput) - - CreateNamespace(*redshiftserverless.CreateNamespaceInput) (*redshiftserverless.CreateNamespaceOutput, error) - CreateNamespaceWithContext(aws.Context, *redshiftserverless.CreateNamespaceInput, ...request.Option) (*redshiftserverless.CreateNamespaceOutput, error) - CreateNamespaceRequest(*redshiftserverless.CreateNamespaceInput) (*request.Request, *redshiftserverless.CreateNamespaceOutput) - - CreateSnapshot(*redshiftserverless.CreateSnapshotInput) (*redshiftserverless.CreateSnapshotOutput, error) - CreateSnapshotWithContext(aws.Context, *redshiftserverless.CreateSnapshotInput, ...request.Option) (*redshiftserverless.CreateSnapshotOutput, error) - CreateSnapshotRequest(*redshiftserverless.CreateSnapshotInput) (*request.Request, *redshiftserverless.CreateSnapshotOutput) - - CreateUsageLimit(*redshiftserverless.CreateUsageLimitInput) (*redshiftserverless.CreateUsageLimitOutput, error) - CreateUsageLimitWithContext(aws.Context, *redshiftserverless.CreateUsageLimitInput, ...request.Option) (*redshiftserverless.CreateUsageLimitOutput, error) - CreateUsageLimitRequest(*redshiftserverless.CreateUsageLimitInput) (*request.Request, *redshiftserverless.CreateUsageLimitOutput) - - CreateWorkgroup(*redshiftserverless.CreateWorkgroupInput) (*redshiftserverless.CreateWorkgroupOutput, error) - CreateWorkgroupWithContext(aws.Context, *redshiftserverless.CreateWorkgroupInput, ...request.Option) (*redshiftserverless.CreateWorkgroupOutput, error) - CreateWorkgroupRequest(*redshiftserverless.CreateWorkgroupInput) (*request.Request, *redshiftserverless.CreateWorkgroupOutput) - - DeleteCustomDomainAssociation(*redshiftserverless.DeleteCustomDomainAssociationInput) (*redshiftserverless.DeleteCustomDomainAssociationOutput, error) - DeleteCustomDomainAssociationWithContext(aws.Context, *redshiftserverless.DeleteCustomDomainAssociationInput, ...request.Option) (*redshiftserverless.DeleteCustomDomainAssociationOutput, error) - DeleteCustomDomainAssociationRequest(*redshiftserverless.DeleteCustomDomainAssociationInput) (*request.Request, *redshiftserverless.DeleteCustomDomainAssociationOutput) - - DeleteEndpointAccess(*redshiftserverless.DeleteEndpointAccessInput) (*redshiftserverless.DeleteEndpointAccessOutput, error) - DeleteEndpointAccessWithContext(aws.Context, *redshiftserverless.DeleteEndpointAccessInput, ...request.Option) (*redshiftserverless.DeleteEndpointAccessOutput, error) - DeleteEndpointAccessRequest(*redshiftserverless.DeleteEndpointAccessInput) (*request.Request, *redshiftserverless.DeleteEndpointAccessOutput) - - DeleteNamespace(*redshiftserverless.DeleteNamespaceInput) (*redshiftserverless.DeleteNamespaceOutput, error) - DeleteNamespaceWithContext(aws.Context, *redshiftserverless.DeleteNamespaceInput, ...request.Option) (*redshiftserverless.DeleteNamespaceOutput, error) - DeleteNamespaceRequest(*redshiftserverless.DeleteNamespaceInput) (*request.Request, *redshiftserverless.DeleteNamespaceOutput) - - DeleteResourcePolicy(*redshiftserverless.DeleteResourcePolicyInput) (*redshiftserverless.DeleteResourcePolicyOutput, error) - DeleteResourcePolicyWithContext(aws.Context, *redshiftserverless.DeleteResourcePolicyInput, ...request.Option) (*redshiftserverless.DeleteResourcePolicyOutput, error) - DeleteResourcePolicyRequest(*redshiftserverless.DeleteResourcePolicyInput) (*request.Request, *redshiftserverless.DeleteResourcePolicyOutput) - - DeleteSnapshot(*redshiftserverless.DeleteSnapshotInput) (*redshiftserverless.DeleteSnapshotOutput, error) - DeleteSnapshotWithContext(aws.Context, *redshiftserverless.DeleteSnapshotInput, ...request.Option) (*redshiftserverless.DeleteSnapshotOutput, error) - DeleteSnapshotRequest(*redshiftserverless.DeleteSnapshotInput) (*request.Request, *redshiftserverless.DeleteSnapshotOutput) - - DeleteUsageLimit(*redshiftserverless.DeleteUsageLimitInput) (*redshiftserverless.DeleteUsageLimitOutput, error) - DeleteUsageLimitWithContext(aws.Context, *redshiftserverless.DeleteUsageLimitInput, ...request.Option) (*redshiftserverless.DeleteUsageLimitOutput, error) - DeleteUsageLimitRequest(*redshiftserverless.DeleteUsageLimitInput) (*request.Request, *redshiftserverless.DeleteUsageLimitOutput) - - DeleteWorkgroup(*redshiftserverless.DeleteWorkgroupInput) (*redshiftserverless.DeleteWorkgroupOutput, error) - DeleteWorkgroupWithContext(aws.Context, *redshiftserverless.DeleteWorkgroupInput, ...request.Option) (*redshiftserverless.DeleteWorkgroupOutput, error) - DeleteWorkgroupRequest(*redshiftserverless.DeleteWorkgroupInput) (*request.Request, *redshiftserverless.DeleteWorkgroupOutput) - - GetCredentials(*redshiftserverless.GetCredentialsInput) (*redshiftserverless.GetCredentialsOutput, error) - GetCredentialsWithContext(aws.Context, *redshiftserverless.GetCredentialsInput, ...request.Option) (*redshiftserverless.GetCredentialsOutput, error) - GetCredentialsRequest(*redshiftserverless.GetCredentialsInput) (*request.Request, *redshiftserverless.GetCredentialsOutput) - - GetCustomDomainAssociation(*redshiftserverless.GetCustomDomainAssociationInput) (*redshiftserverless.GetCustomDomainAssociationOutput, error) - GetCustomDomainAssociationWithContext(aws.Context, *redshiftserverless.GetCustomDomainAssociationInput, ...request.Option) (*redshiftserverless.GetCustomDomainAssociationOutput, error) - GetCustomDomainAssociationRequest(*redshiftserverless.GetCustomDomainAssociationInput) (*request.Request, *redshiftserverless.GetCustomDomainAssociationOutput) - - GetEndpointAccess(*redshiftserverless.GetEndpointAccessInput) (*redshiftserverless.GetEndpointAccessOutput, error) - GetEndpointAccessWithContext(aws.Context, *redshiftserverless.GetEndpointAccessInput, ...request.Option) (*redshiftserverless.GetEndpointAccessOutput, error) - GetEndpointAccessRequest(*redshiftserverless.GetEndpointAccessInput) (*request.Request, *redshiftserverless.GetEndpointAccessOutput) - - GetNamespace(*redshiftserverless.GetNamespaceInput) (*redshiftserverless.GetNamespaceOutput, error) - GetNamespaceWithContext(aws.Context, *redshiftserverless.GetNamespaceInput, ...request.Option) (*redshiftserverless.GetNamespaceOutput, error) - GetNamespaceRequest(*redshiftserverless.GetNamespaceInput) (*request.Request, *redshiftserverless.GetNamespaceOutput) - - GetRecoveryPoint(*redshiftserverless.GetRecoveryPointInput) (*redshiftserverless.GetRecoveryPointOutput, error) - GetRecoveryPointWithContext(aws.Context, *redshiftserverless.GetRecoveryPointInput, ...request.Option) (*redshiftserverless.GetRecoveryPointOutput, error) - GetRecoveryPointRequest(*redshiftserverless.GetRecoveryPointInput) (*request.Request, *redshiftserverless.GetRecoveryPointOutput) - - GetResourcePolicy(*redshiftserverless.GetResourcePolicyInput) (*redshiftserverless.GetResourcePolicyOutput, error) - GetResourcePolicyWithContext(aws.Context, *redshiftserverless.GetResourcePolicyInput, ...request.Option) (*redshiftserverless.GetResourcePolicyOutput, error) - GetResourcePolicyRequest(*redshiftserverless.GetResourcePolicyInput) (*request.Request, *redshiftserverless.GetResourcePolicyOutput) - - GetSnapshot(*redshiftserverless.GetSnapshotInput) (*redshiftserverless.GetSnapshotOutput, error) - GetSnapshotWithContext(aws.Context, *redshiftserverless.GetSnapshotInput, ...request.Option) (*redshiftserverless.GetSnapshotOutput, error) - GetSnapshotRequest(*redshiftserverless.GetSnapshotInput) (*request.Request, *redshiftserverless.GetSnapshotOutput) - - GetTableRestoreStatus(*redshiftserverless.GetTableRestoreStatusInput) (*redshiftserverless.GetTableRestoreStatusOutput, error) - GetTableRestoreStatusWithContext(aws.Context, *redshiftserverless.GetTableRestoreStatusInput, ...request.Option) (*redshiftserverless.GetTableRestoreStatusOutput, error) - GetTableRestoreStatusRequest(*redshiftserverless.GetTableRestoreStatusInput) (*request.Request, *redshiftserverless.GetTableRestoreStatusOutput) - - GetUsageLimit(*redshiftserverless.GetUsageLimitInput) (*redshiftserverless.GetUsageLimitOutput, error) - GetUsageLimitWithContext(aws.Context, *redshiftserverless.GetUsageLimitInput, ...request.Option) (*redshiftserverless.GetUsageLimitOutput, error) - GetUsageLimitRequest(*redshiftserverless.GetUsageLimitInput) (*request.Request, *redshiftserverless.GetUsageLimitOutput) - - GetWorkgroup(*redshiftserverless.GetWorkgroupInput) (*redshiftserverless.GetWorkgroupOutput, error) - GetWorkgroupWithContext(aws.Context, *redshiftserverless.GetWorkgroupInput, ...request.Option) (*redshiftserverless.GetWorkgroupOutput, error) - GetWorkgroupRequest(*redshiftserverless.GetWorkgroupInput) (*request.Request, *redshiftserverless.GetWorkgroupOutput) - - ListCustomDomainAssociations(*redshiftserverless.ListCustomDomainAssociationsInput) (*redshiftserverless.ListCustomDomainAssociationsOutput, error) - ListCustomDomainAssociationsWithContext(aws.Context, *redshiftserverless.ListCustomDomainAssociationsInput, ...request.Option) (*redshiftserverless.ListCustomDomainAssociationsOutput, error) - ListCustomDomainAssociationsRequest(*redshiftserverless.ListCustomDomainAssociationsInput) (*request.Request, *redshiftserverless.ListCustomDomainAssociationsOutput) - - ListCustomDomainAssociationsPages(*redshiftserverless.ListCustomDomainAssociationsInput, func(*redshiftserverless.ListCustomDomainAssociationsOutput, bool) bool) error - ListCustomDomainAssociationsPagesWithContext(aws.Context, *redshiftserverless.ListCustomDomainAssociationsInput, func(*redshiftserverless.ListCustomDomainAssociationsOutput, bool) bool, ...request.Option) error - - ListEndpointAccess(*redshiftserverless.ListEndpointAccessInput) (*redshiftserverless.ListEndpointAccessOutput, error) - ListEndpointAccessWithContext(aws.Context, *redshiftserverless.ListEndpointAccessInput, ...request.Option) (*redshiftserverless.ListEndpointAccessOutput, error) - ListEndpointAccessRequest(*redshiftserverless.ListEndpointAccessInput) (*request.Request, *redshiftserverless.ListEndpointAccessOutput) - - ListEndpointAccessPages(*redshiftserverless.ListEndpointAccessInput, func(*redshiftserverless.ListEndpointAccessOutput, bool) bool) error - ListEndpointAccessPagesWithContext(aws.Context, *redshiftserverless.ListEndpointAccessInput, func(*redshiftserverless.ListEndpointAccessOutput, bool) bool, ...request.Option) error - - ListNamespaces(*redshiftserverless.ListNamespacesInput) (*redshiftserverless.ListNamespacesOutput, error) - ListNamespacesWithContext(aws.Context, *redshiftserverless.ListNamespacesInput, ...request.Option) (*redshiftserverless.ListNamespacesOutput, error) - ListNamespacesRequest(*redshiftserverless.ListNamespacesInput) (*request.Request, *redshiftserverless.ListNamespacesOutput) - - ListNamespacesPages(*redshiftserverless.ListNamespacesInput, func(*redshiftserverless.ListNamespacesOutput, bool) bool) error - ListNamespacesPagesWithContext(aws.Context, *redshiftserverless.ListNamespacesInput, func(*redshiftserverless.ListNamespacesOutput, bool) bool, ...request.Option) error - - ListRecoveryPoints(*redshiftserverless.ListRecoveryPointsInput) (*redshiftserverless.ListRecoveryPointsOutput, error) - ListRecoveryPointsWithContext(aws.Context, *redshiftserverless.ListRecoveryPointsInput, ...request.Option) (*redshiftserverless.ListRecoveryPointsOutput, error) - ListRecoveryPointsRequest(*redshiftserverless.ListRecoveryPointsInput) (*request.Request, *redshiftserverless.ListRecoveryPointsOutput) - - ListRecoveryPointsPages(*redshiftserverless.ListRecoveryPointsInput, func(*redshiftserverless.ListRecoveryPointsOutput, bool) bool) error - ListRecoveryPointsPagesWithContext(aws.Context, *redshiftserverless.ListRecoveryPointsInput, func(*redshiftserverless.ListRecoveryPointsOutput, bool) bool, ...request.Option) error - - ListSnapshots(*redshiftserverless.ListSnapshotsInput) (*redshiftserverless.ListSnapshotsOutput, error) - ListSnapshotsWithContext(aws.Context, *redshiftserverless.ListSnapshotsInput, ...request.Option) (*redshiftserverless.ListSnapshotsOutput, error) - ListSnapshotsRequest(*redshiftserverless.ListSnapshotsInput) (*request.Request, *redshiftserverless.ListSnapshotsOutput) - - ListSnapshotsPages(*redshiftserverless.ListSnapshotsInput, func(*redshiftserverless.ListSnapshotsOutput, bool) bool) error - ListSnapshotsPagesWithContext(aws.Context, *redshiftserverless.ListSnapshotsInput, func(*redshiftserverless.ListSnapshotsOutput, bool) bool, ...request.Option) error - - ListTableRestoreStatus(*redshiftserverless.ListTableRestoreStatusInput) (*redshiftserverless.ListTableRestoreStatusOutput, error) - ListTableRestoreStatusWithContext(aws.Context, *redshiftserverless.ListTableRestoreStatusInput, ...request.Option) (*redshiftserverless.ListTableRestoreStatusOutput, error) - ListTableRestoreStatusRequest(*redshiftserverless.ListTableRestoreStatusInput) (*request.Request, *redshiftserverless.ListTableRestoreStatusOutput) - - ListTableRestoreStatusPages(*redshiftserverless.ListTableRestoreStatusInput, func(*redshiftserverless.ListTableRestoreStatusOutput, bool) bool) error - ListTableRestoreStatusPagesWithContext(aws.Context, *redshiftserverless.ListTableRestoreStatusInput, func(*redshiftserverless.ListTableRestoreStatusOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*redshiftserverless.ListTagsForResourceInput) (*redshiftserverless.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *redshiftserverless.ListTagsForResourceInput, ...request.Option) (*redshiftserverless.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*redshiftserverless.ListTagsForResourceInput) (*request.Request, *redshiftserverless.ListTagsForResourceOutput) - - ListUsageLimits(*redshiftserverless.ListUsageLimitsInput) (*redshiftserverless.ListUsageLimitsOutput, error) - ListUsageLimitsWithContext(aws.Context, *redshiftserverless.ListUsageLimitsInput, ...request.Option) (*redshiftserverless.ListUsageLimitsOutput, error) - ListUsageLimitsRequest(*redshiftserverless.ListUsageLimitsInput) (*request.Request, *redshiftserverless.ListUsageLimitsOutput) - - ListUsageLimitsPages(*redshiftserverless.ListUsageLimitsInput, func(*redshiftserverless.ListUsageLimitsOutput, bool) bool) error - ListUsageLimitsPagesWithContext(aws.Context, *redshiftserverless.ListUsageLimitsInput, func(*redshiftserverless.ListUsageLimitsOutput, bool) bool, ...request.Option) error - - ListWorkgroups(*redshiftserverless.ListWorkgroupsInput) (*redshiftserverless.ListWorkgroupsOutput, error) - ListWorkgroupsWithContext(aws.Context, *redshiftserverless.ListWorkgroupsInput, ...request.Option) (*redshiftserverless.ListWorkgroupsOutput, error) - ListWorkgroupsRequest(*redshiftserverless.ListWorkgroupsInput) (*request.Request, *redshiftserverless.ListWorkgroupsOutput) - - ListWorkgroupsPages(*redshiftserverless.ListWorkgroupsInput, func(*redshiftserverless.ListWorkgroupsOutput, bool) bool) error - ListWorkgroupsPagesWithContext(aws.Context, *redshiftserverless.ListWorkgroupsInput, func(*redshiftserverless.ListWorkgroupsOutput, bool) bool, ...request.Option) error - - PutResourcePolicy(*redshiftserverless.PutResourcePolicyInput) (*redshiftserverless.PutResourcePolicyOutput, error) - PutResourcePolicyWithContext(aws.Context, *redshiftserverless.PutResourcePolicyInput, ...request.Option) (*redshiftserverless.PutResourcePolicyOutput, error) - PutResourcePolicyRequest(*redshiftserverless.PutResourcePolicyInput) (*request.Request, *redshiftserverless.PutResourcePolicyOutput) - - RestoreFromRecoveryPoint(*redshiftserverless.RestoreFromRecoveryPointInput) (*redshiftserverless.RestoreFromRecoveryPointOutput, error) - RestoreFromRecoveryPointWithContext(aws.Context, *redshiftserverless.RestoreFromRecoveryPointInput, ...request.Option) (*redshiftserverless.RestoreFromRecoveryPointOutput, error) - RestoreFromRecoveryPointRequest(*redshiftserverless.RestoreFromRecoveryPointInput) (*request.Request, *redshiftserverless.RestoreFromRecoveryPointOutput) - - RestoreFromSnapshot(*redshiftserverless.RestoreFromSnapshotInput) (*redshiftserverless.RestoreFromSnapshotOutput, error) - RestoreFromSnapshotWithContext(aws.Context, *redshiftserverless.RestoreFromSnapshotInput, ...request.Option) (*redshiftserverless.RestoreFromSnapshotOutput, error) - RestoreFromSnapshotRequest(*redshiftserverless.RestoreFromSnapshotInput) (*request.Request, *redshiftserverless.RestoreFromSnapshotOutput) - - RestoreTableFromSnapshot(*redshiftserverless.RestoreTableFromSnapshotInput) (*redshiftserverless.RestoreTableFromSnapshotOutput, error) - RestoreTableFromSnapshotWithContext(aws.Context, *redshiftserverless.RestoreTableFromSnapshotInput, ...request.Option) (*redshiftserverless.RestoreTableFromSnapshotOutput, error) - RestoreTableFromSnapshotRequest(*redshiftserverless.RestoreTableFromSnapshotInput) (*request.Request, *redshiftserverless.RestoreTableFromSnapshotOutput) - - TagResource(*redshiftserverless.TagResourceInput) (*redshiftserverless.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *redshiftserverless.TagResourceInput, ...request.Option) (*redshiftserverless.TagResourceOutput, error) - TagResourceRequest(*redshiftserverless.TagResourceInput) (*request.Request, *redshiftserverless.TagResourceOutput) - - UntagResource(*redshiftserverless.UntagResourceInput) (*redshiftserverless.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *redshiftserverless.UntagResourceInput, ...request.Option) (*redshiftserverless.UntagResourceOutput, error) - UntagResourceRequest(*redshiftserverless.UntagResourceInput) (*request.Request, *redshiftserverless.UntagResourceOutput) - - UpdateCustomDomainAssociation(*redshiftserverless.UpdateCustomDomainAssociationInput) (*redshiftserverless.UpdateCustomDomainAssociationOutput, error) - UpdateCustomDomainAssociationWithContext(aws.Context, *redshiftserverless.UpdateCustomDomainAssociationInput, ...request.Option) (*redshiftserverless.UpdateCustomDomainAssociationOutput, error) - UpdateCustomDomainAssociationRequest(*redshiftserverless.UpdateCustomDomainAssociationInput) (*request.Request, *redshiftserverless.UpdateCustomDomainAssociationOutput) - - UpdateEndpointAccess(*redshiftserverless.UpdateEndpointAccessInput) (*redshiftserverless.UpdateEndpointAccessOutput, error) - UpdateEndpointAccessWithContext(aws.Context, *redshiftserverless.UpdateEndpointAccessInput, ...request.Option) (*redshiftserverless.UpdateEndpointAccessOutput, error) - UpdateEndpointAccessRequest(*redshiftserverless.UpdateEndpointAccessInput) (*request.Request, *redshiftserverless.UpdateEndpointAccessOutput) - - UpdateNamespace(*redshiftserverless.UpdateNamespaceInput) (*redshiftserverless.UpdateNamespaceOutput, error) - UpdateNamespaceWithContext(aws.Context, *redshiftserverless.UpdateNamespaceInput, ...request.Option) (*redshiftserverless.UpdateNamespaceOutput, error) - UpdateNamespaceRequest(*redshiftserverless.UpdateNamespaceInput) (*request.Request, *redshiftserverless.UpdateNamespaceOutput) - - UpdateSnapshot(*redshiftserverless.UpdateSnapshotInput) (*redshiftserverless.UpdateSnapshotOutput, error) - UpdateSnapshotWithContext(aws.Context, *redshiftserverless.UpdateSnapshotInput, ...request.Option) (*redshiftserverless.UpdateSnapshotOutput, error) - UpdateSnapshotRequest(*redshiftserverless.UpdateSnapshotInput) (*request.Request, *redshiftserverless.UpdateSnapshotOutput) - - UpdateUsageLimit(*redshiftserverless.UpdateUsageLimitInput) (*redshiftserverless.UpdateUsageLimitOutput, error) - UpdateUsageLimitWithContext(aws.Context, *redshiftserverless.UpdateUsageLimitInput, ...request.Option) (*redshiftserverless.UpdateUsageLimitOutput, error) - UpdateUsageLimitRequest(*redshiftserverless.UpdateUsageLimitInput) (*request.Request, *redshiftserverless.UpdateUsageLimitOutput) - - UpdateWorkgroup(*redshiftserverless.UpdateWorkgroupInput) (*redshiftserverless.UpdateWorkgroupOutput, error) - UpdateWorkgroupWithContext(aws.Context, *redshiftserverless.UpdateWorkgroupInput, ...request.Option) (*redshiftserverless.UpdateWorkgroupOutput, error) - UpdateWorkgroupRequest(*redshiftserverless.UpdateWorkgroupInput) (*request.Request, *redshiftserverless.UpdateWorkgroupOutput) -} - -var _ RedshiftServerlessAPI = (*redshiftserverless.RedshiftServerless)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/service.go deleted file mode 100644 index 368d6f69f27e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/redshiftserverless/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package redshiftserverless - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// RedshiftServerless provides the API operation methods for making requests to -// Redshift Serverless. See this package's package overview docs -// for details on the service. -// -// RedshiftServerless methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type RedshiftServerless struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Redshift Serverless" // Name of service. - EndpointsID = "redshift-serverless" // ID to lookup a service endpoint with. - ServiceID = "Redshift Serverless" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the RedshiftServerless client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a RedshiftServerless client from just a session. -// svc := redshiftserverless.New(mySession) -// -// // Create a RedshiftServerless client with additional configuration -// svc := redshiftserverless.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *RedshiftServerless { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "redshift-serverless" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *RedshiftServerless { - svc := &RedshiftServerless{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-04-21", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.1", - TargetPrefix: "RedshiftServerless", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a RedshiftServerless operation and runs any -// custom request initialization. -func (c *RedshiftServerless) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/api.go deleted file mode 100644 index 236fdfdbf2fd..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/api.go +++ /dev/null @@ -1,3227 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package repostspace - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateSpace = "CreateSpace" - -// CreateSpaceRequest generates a "aws/request.Request" representing the -// client's request for the CreateSpace 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 CreateSpace for more information on using the CreateSpace -// 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 CreateSpaceRequest method. -// req, resp := client.CreateSpaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/CreateSpace -func (c *Repostspace) CreateSpaceRequest(input *CreateSpaceInput) (req *request.Request, output *CreateSpaceOutput) { - op := &request.Operation{ - Name: opCreateSpace, - HTTPMethod: "POST", - HTTPPath: "/spaces", - } - - if input == nil { - input = &CreateSpaceInput{} - } - - output = &CreateSpaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSpace API operation for AWS re:Post Private. -// -// Creates an AWS re:Post Private private re:Post. -// -// 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 AWS re:Post Private's -// API operation CreateSpace for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// Request would cause a service quota to be exceeded. -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/CreateSpace -func (c *Repostspace) CreateSpace(input *CreateSpaceInput) (*CreateSpaceOutput, error) { - req, out := c.CreateSpaceRequest(input) - return out, req.Send() -} - -// CreateSpaceWithContext is the same as CreateSpace with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSpace 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 *Repostspace) CreateSpaceWithContext(ctx aws.Context, input *CreateSpaceInput, opts ...request.Option) (*CreateSpaceOutput, error) { - req, out := c.CreateSpaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSpace = "DeleteSpace" - -// DeleteSpaceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSpace 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 DeleteSpace for more information on using the DeleteSpace -// 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 DeleteSpaceRequest method. -// req, resp := client.DeleteSpaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/DeleteSpace -func (c *Repostspace) DeleteSpaceRequest(input *DeleteSpaceInput) (req *request.Request, output *DeleteSpaceOutput) { - op := &request.Operation{ - Name: opDeleteSpace, - HTTPMethod: "DELETE", - HTTPPath: "/spaces/{spaceId}", - } - - if input == nil { - input = &DeleteSpaceInput{} - } - - output = &DeleteSpaceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSpace API operation for AWS re:Post Private. -// -// Deletes an AWS re:Post Private private re:Post. -// -// 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 AWS re:Post Private's -// API operation DeleteSpace for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/DeleteSpace -func (c *Repostspace) DeleteSpace(input *DeleteSpaceInput) (*DeleteSpaceOutput, error) { - req, out := c.DeleteSpaceRequest(input) - return out, req.Send() -} - -// DeleteSpaceWithContext is the same as DeleteSpace with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSpace 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 *Repostspace) DeleteSpaceWithContext(ctx aws.Context, input *DeleteSpaceInput, opts ...request.Option) (*DeleteSpaceOutput, error) { - req, out := c.DeleteSpaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterAdmin = "DeregisterAdmin" - -// DeregisterAdminRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterAdmin 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 DeregisterAdmin for more information on using the DeregisterAdmin -// 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 DeregisterAdminRequest method. -// req, resp := client.DeregisterAdminRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/DeregisterAdmin -func (c *Repostspace) DeregisterAdminRequest(input *DeregisterAdminInput) (req *request.Request, output *DeregisterAdminOutput) { - op := &request.Operation{ - Name: opDeregisterAdmin, - HTTPMethod: "DELETE", - HTTPPath: "/spaces/{spaceId}/admins/{adminId}", - } - - if input == nil { - input = &DeregisterAdminInput{} - } - - output = &DeregisterAdminOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterAdmin API operation for AWS re:Post Private. -// -// Removes the user or group from the list of administrators of the private -// re:Post. -// -// 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 AWS re:Post Private's -// API operation DeregisterAdmin for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/DeregisterAdmin -func (c *Repostspace) DeregisterAdmin(input *DeregisterAdminInput) (*DeregisterAdminOutput, error) { - req, out := c.DeregisterAdminRequest(input) - return out, req.Send() -} - -// DeregisterAdminWithContext is the same as DeregisterAdmin with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterAdmin 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 *Repostspace) DeregisterAdminWithContext(ctx aws.Context, input *DeregisterAdminInput, opts ...request.Option) (*DeregisterAdminOutput, error) { - req, out := c.DeregisterAdminRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSpace = "GetSpace" - -// GetSpaceRequest generates a "aws/request.Request" representing the -// client's request for the GetSpace 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 GetSpace for more information on using the GetSpace -// 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 GetSpaceRequest method. -// req, resp := client.GetSpaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/GetSpace -func (c *Repostspace) GetSpaceRequest(input *GetSpaceInput) (req *request.Request, output *GetSpaceOutput) { - op := &request.Operation{ - Name: opGetSpace, - HTTPMethod: "GET", - HTTPPath: "/spaces/{spaceId}", - } - - if input == nil { - input = &GetSpaceInput{} - } - - output = &GetSpaceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSpace API operation for AWS re:Post Private. -// -// Displays information about the AWS re:Post Private private re:Post. -// -// 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 AWS re:Post Private's -// API operation GetSpace for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/GetSpace -func (c *Repostspace) GetSpace(input *GetSpaceInput) (*GetSpaceOutput, error) { - req, out := c.GetSpaceRequest(input) - return out, req.Send() -} - -// GetSpaceWithContext is the same as GetSpace with the addition of -// the ability to pass a context and additional request options. -// -// See GetSpace 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 *Repostspace) GetSpaceWithContext(ctx aws.Context, input *GetSpaceInput, opts ...request.Option) (*GetSpaceOutput, error) { - req, out := c.GetSpaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListSpaces = "ListSpaces" - -// ListSpacesRequest generates a "aws/request.Request" representing the -// client's request for the ListSpaces 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 ListSpaces for more information on using the ListSpaces -// 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 ListSpacesRequest method. -// req, resp := client.ListSpacesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/ListSpaces -func (c *Repostspace) ListSpacesRequest(input *ListSpacesInput) (req *request.Request, output *ListSpacesOutput) { - op := &request.Operation{ - Name: opListSpaces, - HTTPMethod: "GET", - HTTPPath: "/spaces", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSpacesInput{} - } - - output = &ListSpacesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSpaces API operation for AWS re:Post Private. -// -// Returns a list of AWS re:Post Private private re:Posts in the account with -// some information about each private re:Post. -// -// 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 AWS re:Post Private's -// API operation ListSpaces for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/ListSpaces -func (c *Repostspace) ListSpaces(input *ListSpacesInput) (*ListSpacesOutput, error) { - req, out := c.ListSpacesRequest(input) - return out, req.Send() -} - -// ListSpacesWithContext is the same as ListSpaces with the addition of -// the ability to pass a context and additional request options. -// -// See ListSpaces 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 *Repostspace) ListSpacesWithContext(ctx aws.Context, input *ListSpacesInput, opts ...request.Option) (*ListSpacesOutput, error) { - req, out := c.ListSpacesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSpacesPages iterates over the pages of a ListSpaces operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSpaces method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSpaces operation. -// pageNum := 0 -// err := client.ListSpacesPages(params, -// func(page *repostspace.ListSpacesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Repostspace) ListSpacesPages(input *ListSpacesInput, fn func(*ListSpacesOutput, bool) bool) error { - return c.ListSpacesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSpacesPagesWithContext same as ListSpacesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Repostspace) ListSpacesPagesWithContext(ctx aws.Context, input *ListSpacesInput, fn func(*ListSpacesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSpacesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSpacesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSpacesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/ListTagsForResource -func (c *Repostspace) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS re:Post Private. -// -// Returns the tags that are associated with the AWS re:Post Private resource -// specified by the resourceArn. The only resource that can be tagged is a private -// re:Post. -// -// 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 AWS re:Post Private's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/ListTagsForResource -func (c *Repostspace) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *Repostspace) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterAdmin = "RegisterAdmin" - -// RegisterAdminRequest generates a "aws/request.Request" representing the -// client's request for the RegisterAdmin 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 RegisterAdmin for more information on using the RegisterAdmin -// 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 RegisterAdminRequest method. -// req, resp := client.RegisterAdminRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/RegisterAdmin -func (c *Repostspace) RegisterAdminRequest(input *RegisterAdminInput) (req *request.Request, output *RegisterAdminOutput) { - op := &request.Operation{ - Name: opRegisterAdmin, - HTTPMethod: "POST", - HTTPPath: "/spaces/{spaceId}/admins/{adminId}", - } - - if input == nil { - input = &RegisterAdminInput{} - } - - output = &RegisterAdminOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// RegisterAdmin API operation for AWS re:Post Private. -// -// Adds a user or group to the list of administrators of the private re:Post. -// -// 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 AWS re:Post Private's -// API operation RegisterAdmin for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/RegisterAdmin -func (c *Repostspace) RegisterAdmin(input *RegisterAdminInput) (*RegisterAdminOutput, error) { - req, out := c.RegisterAdminRequest(input) - return out, req.Send() -} - -// RegisterAdminWithContext is the same as RegisterAdmin with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterAdmin 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 *Repostspace) RegisterAdminWithContext(ctx aws.Context, input *RegisterAdminInput, opts ...request.Option) (*RegisterAdminOutput, error) { - req, out := c.RegisterAdminRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSendInvites = "SendInvites" - -// SendInvitesRequest generates a "aws/request.Request" representing the -// client's request for the SendInvites 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 SendInvites for more information on using the SendInvites -// 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 SendInvitesRequest method. -// req, resp := client.SendInvitesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/SendInvites -func (c *Repostspace) SendInvitesRequest(input *SendInvitesInput) (req *request.Request, output *SendInvitesOutput) { - op := &request.Operation{ - Name: opSendInvites, - HTTPMethod: "POST", - HTTPPath: "/spaces/{spaceId}/invite", - } - - if input == nil { - input = &SendInvitesInput{} - } - - output = &SendInvitesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// SendInvites API operation for AWS re:Post Private. -// -// Sends an invitation email to selected users and groups. -// -// 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 AWS re:Post Private's -// API operation SendInvites for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/SendInvites -func (c *Repostspace) SendInvites(input *SendInvitesInput) (*SendInvitesOutput, error) { - req, out := c.SendInvitesRequest(input) - return out, req.Send() -} - -// SendInvitesWithContext is the same as SendInvites with the addition of -// the ability to pass a context and additional request options. -// -// See SendInvites 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 *Repostspace) SendInvitesWithContext(ctx aws.Context, input *SendInvitesInput, opts ...request.Option) (*SendInvitesOutput, error) { - req, out := c.SendInvitesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/TagResource -func (c *Repostspace) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS re:Post Private. -// -// Associates tags with an AWS re:Post Private resource. Currently, the only -// resource that can be tagged is the private re:Post. If you specify a new -// tag key for the resource, the tag is appended to the list of tags that are -// associated with the resource. If you specify a tag key that’s already associated -// with the resource, the new tag value that you specify replaces the previous -// value for that tag. -// -// 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 AWS re:Post Private's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/TagResource -func (c *Repostspace) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *Repostspace) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/UntagResource -func (c *Repostspace) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS re:Post Private. -// -// Removes the association of the tag with the AWS re:Post Private resource. -// -// 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 AWS re:Post Private's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/UntagResource -func (c *Repostspace) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *Repostspace) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSpace = "UpdateSpace" - -// UpdateSpaceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSpace 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 UpdateSpace for more information on using the UpdateSpace -// 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 UpdateSpaceRequest method. -// req, resp := client.UpdateSpaceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/UpdateSpace -func (c *Repostspace) UpdateSpaceRequest(input *UpdateSpaceInput) (req *request.Request, output *UpdateSpaceOutput) { - op := &request.Operation{ - Name: opUpdateSpace, - HTTPMethod: "PUT", - HTTPPath: "/spaces/{spaceId}", - } - - if input == nil { - input = &UpdateSpaceInput{} - } - - output = &UpdateSpaceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateSpace API operation for AWS re:Post Private. -// -// Modifies an existing AWS re:Post Private private re:Post. -// -// 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 AWS re:Post Private's -// API operation UpdateSpace for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// User does not have sufficient access to perform this action. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ResourceNotFoundException -// Request references a resource which does not exist. -// -// - ThrottlingException -// Request was denied due to request throttling. -// -// - InternalServerException -// Unexpected error during processing of request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13/UpdateSpace -func (c *Repostspace) UpdateSpace(input *UpdateSpaceInput) (*UpdateSpaceOutput, error) { - req, out := c.UpdateSpaceRequest(input) - return out, req.Send() -} - -// UpdateSpaceWithContext is the same as UpdateSpace with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSpace 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 *Repostspace) UpdateSpaceWithContext(ctx aws.Context, input *UpdateSpaceInput, opts ...request.Option) (*UpdateSpaceOutput, error) { - req, out := c.UpdateSpaceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// User does not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Updating or deleting a resource can cause an inconsistent state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the resource. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of the resource. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateSpaceInput struct { - _ struct{} `type:"structure"` - - // A description for the private re:Post. This is used only to help you identify - // this private re:Post. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSpaceInput's - // String and GoString methods. - Description *string `locationName:"description" min:"1" type:"string" sensitive:"true"` - - // The name for the private re:Post. This must be unique in your account. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSpaceInput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The IAM role that grants permissions to the private re:Post to convert unanswered - // questions into AWS support tickets. - RoleArn *string `locationName:"roleArn" min:"20" type:"string"` - - // The subdomain that you use to access your AWS re:Post Private private re:Post. - // All custom subdomains must be approved by AWS before use. In addition to - // your custom subdomain, all private re:Posts are issued an AWS generated subdomain - // for immediate use. - // - // Subdomain is a required field - Subdomain *string `locationName:"subdomain" min:"1" type:"string" required:"true"` - - // The list of tags associated with the private re:Post. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSpaceInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"true"` - - // The pricing tier for the private re:Post. - // - // Tier is a required field - Tier *string `locationName:"tier" type:"string" required:"true" enum:"TierLevel"` - - // The AWS KMS key ARN that’s used for the AWS KMS encryption. If you don't - // provide a key, your data is encrypted by default with a key that AWS owns - // and manages for you. - UserKMSKey *string `locationName:"userKMSKey" 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 CreateSpaceInput) 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 CreateSpaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSpaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSpaceInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.Subdomain == nil { - invalidParams.Add(request.NewErrParamRequired("Subdomain")) - } - if s.Subdomain != nil && len(*s.Subdomain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Subdomain", 1)) - } - if s.Tier == nil { - invalidParams.Add(request.NewErrParamRequired("Tier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateSpaceInput) SetDescription(v string) *CreateSpaceInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateSpaceInput) SetName(v string) *CreateSpaceInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CreateSpaceInput) SetRoleArn(v string) *CreateSpaceInput { - s.RoleArn = &v - return s -} - -// SetSubdomain sets the Subdomain field's value. -func (s *CreateSpaceInput) SetSubdomain(v string) *CreateSpaceInput { - s.Subdomain = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSpaceInput) SetTags(v map[string]*string) *CreateSpaceInput { - s.Tags = v - return s -} - -// SetTier sets the Tier field's value. -func (s *CreateSpaceInput) SetTier(v string) *CreateSpaceInput { - s.Tier = &v - return s -} - -// SetUserKMSKey sets the UserKMSKey field's value. -func (s *CreateSpaceInput) SetUserKMSKey(v string) *CreateSpaceInput { - s.UserKMSKey = &v - return s -} - -type CreateSpaceOutput struct { - _ struct{} `type:"structure"` - - // The unique ID of the private re:Post. - // - // SpaceId is a required field - SpaceId *string `locationName:"spaceId" 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 CreateSpaceOutput) 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 CreateSpaceOutput) GoString() string { - return s.String() -} - -// SetSpaceId sets the SpaceId field's value. -func (s *CreateSpaceOutput) SetSpaceId(v string) *CreateSpaceOutput { - s.SpaceId = &v - return s -} - -type DeleteSpaceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique ID of the private re:Post. - // - // SpaceId is a required field - SpaceId *string `location:"uri" locationName:"spaceId" 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 DeleteSpaceInput) 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 DeleteSpaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSpaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSpaceInput"} - if s.SpaceId == nil { - invalidParams.Add(request.NewErrParamRequired("SpaceId")) - } - if s.SpaceId != nil && len(*s.SpaceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpaceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSpaceId sets the SpaceId field's value. -func (s *DeleteSpaceInput) SetSpaceId(v string) *DeleteSpaceInput { - s.SpaceId = &v - return s -} - -type DeleteSpaceOutput 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 DeleteSpaceOutput) 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 DeleteSpaceOutput) GoString() string { - return s.String() -} - -type DeregisterAdminInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the admin to remove. - // - // AdminId is a required field - AdminId *string `location:"uri" locationName:"adminId" type:"string" required:"true"` - - // The ID of the private re:Post to remove the admin from. - // - // SpaceId is a required field - SpaceId *string `location:"uri" locationName:"spaceId" 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 DeregisterAdminInput) 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 DeregisterAdminInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterAdminInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterAdminInput"} - if s.AdminId == nil { - invalidParams.Add(request.NewErrParamRequired("AdminId")) - } - if s.AdminId != nil && len(*s.AdminId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdminId", 1)) - } - if s.SpaceId == nil { - invalidParams.Add(request.NewErrParamRequired("SpaceId")) - } - if s.SpaceId != nil && len(*s.SpaceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpaceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdminId sets the AdminId field's value. -func (s *DeregisterAdminInput) SetAdminId(v string) *DeregisterAdminInput { - s.AdminId = &v - return s -} - -// SetSpaceId sets the SpaceId field's value. -func (s *DeregisterAdminInput) SetSpaceId(v string) *DeregisterAdminInput { - s.SpaceId = &v - return s -} - -type DeregisterAdminOutput 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 DeregisterAdminOutput) 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 DeregisterAdminOutput) GoString() string { - return s.String() -} - -type GetSpaceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the private re:Post. - // - // SpaceId is a required field - SpaceId *string `location:"uri" locationName:"spaceId" 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 GetSpaceInput) 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 GetSpaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSpaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSpaceInput"} - if s.SpaceId == nil { - invalidParams.Add(request.NewErrParamRequired("SpaceId")) - } - if s.SpaceId != nil && len(*s.SpaceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpaceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSpaceId sets the SpaceId field's value. -func (s *GetSpaceInput) SetSpaceId(v string) *GetSpaceInput { - s.SpaceId = &v - return s -} - -type GetSpaceOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the private re:Post. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The Identity Center identifier for the Application Instance. - // - // ClientId is a required field - ClientId *string `locationName:"clientId" type:"string" required:"true"` - - // The configuration status of the private re:Post. - // - // ConfigurationStatus is a required field - ConfigurationStatus *string `locationName:"configurationStatus" type:"string" required:"true" enum:"ConfigurationStatus"` - - // The content size of the private re:Post. - ContentSize *int64 `locationName:"contentSize" type:"long"` - - // The date when the private re:Post was created. - // - // CreateDateTime is a required field - CreateDateTime *time.Time `locationName:"createDateTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The IAM role that grants permissions to the private re:Post to convert unanswered - // questions into AWS support tickets. - CustomerRoleArn *string `locationName:"customerRoleArn" min:"20" type:"string"` - - // The date when the private re:Post was deleted. - DeleteDateTime *time.Time `locationName:"deleteDateTime" type:"timestamp" timestampFormat:"iso8601"` - - // The description of the private re:Post. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSpaceOutput's - // String and GoString methods. - Description *string `locationName:"description" min:"1" type:"string" sensitive:"true"` - - // The list of groups that are administrators of the private re:Post. - GroupAdmins []*string `locationName:"groupAdmins" type:"list"` - - // The name of the private re:Post. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSpaceOutput's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The AWS generated subdomain of the private re:Post - // - // RandomDomain is a required field - RandomDomain *string `locationName:"randomDomain" type:"string" required:"true"` - - // The unique ID of the private re:Post. - // - // SpaceId is a required field - SpaceId *string `locationName:"spaceId" type:"string" required:"true"` - - // The creation or deletion status of the private re:Post. - // - // Status is a required field - Status *string `locationName:"status" min:"1" type:"string" required:"true"` - - // The storage limit of the private re:Post. - // - // StorageLimit is a required field - StorageLimit *int64 `locationName:"storageLimit" type:"long" required:"true"` - - // The pricing tier of the private re:Post. - // - // Tier is a required field - Tier *string `locationName:"tier" type:"string" required:"true" enum:"TierLevel"` - - // The list of users that are administrators of the private re:Post. - UserAdmins []*string `locationName:"userAdmins" type:"list"` - - // The number of users that have onboarded to the private re:Post. - UserCount *int64 `locationName:"userCount" type:"integer"` - - // The custom AWS KMS key ARN that’s used for the AWS KMS encryption. - UserKMSKey *string `locationName:"userKMSKey" type:"string"` - - // The custom subdomain that you use to access your private re:Post. All custom - // subdomains must be approved by AWS before use. - // - // VanityDomain is a required field - VanityDomain *string `locationName:"vanityDomain" type:"string" required:"true"` - - // The approval status of the custom subdomain. - // - // VanityDomainStatus is a required field - VanityDomainStatus *string `locationName:"vanityDomainStatus" type:"string" required:"true" enum:"VanityDomainStatus"` -} - -// 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 GetSpaceOutput) 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 GetSpaceOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSpaceOutput) SetArn(v string) *GetSpaceOutput { - s.Arn = &v - return s -} - -// SetClientId sets the ClientId field's value. -func (s *GetSpaceOutput) SetClientId(v string) *GetSpaceOutput { - s.ClientId = &v - return s -} - -// SetConfigurationStatus sets the ConfigurationStatus field's value. -func (s *GetSpaceOutput) SetConfigurationStatus(v string) *GetSpaceOutput { - s.ConfigurationStatus = &v - return s -} - -// SetContentSize sets the ContentSize field's value. -func (s *GetSpaceOutput) SetContentSize(v int64) *GetSpaceOutput { - s.ContentSize = &v - return s -} - -// SetCreateDateTime sets the CreateDateTime field's value. -func (s *GetSpaceOutput) SetCreateDateTime(v time.Time) *GetSpaceOutput { - s.CreateDateTime = &v - return s -} - -// SetCustomerRoleArn sets the CustomerRoleArn field's value. -func (s *GetSpaceOutput) SetCustomerRoleArn(v string) *GetSpaceOutput { - s.CustomerRoleArn = &v - return s -} - -// SetDeleteDateTime sets the DeleteDateTime field's value. -func (s *GetSpaceOutput) SetDeleteDateTime(v time.Time) *GetSpaceOutput { - s.DeleteDateTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetSpaceOutput) SetDescription(v string) *GetSpaceOutput { - s.Description = &v - return s -} - -// SetGroupAdmins sets the GroupAdmins field's value. -func (s *GetSpaceOutput) SetGroupAdmins(v []*string) *GetSpaceOutput { - s.GroupAdmins = v - return s -} - -// SetName sets the Name field's value. -func (s *GetSpaceOutput) SetName(v string) *GetSpaceOutput { - s.Name = &v - return s -} - -// SetRandomDomain sets the RandomDomain field's value. -func (s *GetSpaceOutput) SetRandomDomain(v string) *GetSpaceOutput { - s.RandomDomain = &v - return s -} - -// SetSpaceId sets the SpaceId field's value. -func (s *GetSpaceOutput) SetSpaceId(v string) *GetSpaceOutput { - s.SpaceId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetSpaceOutput) SetStatus(v string) *GetSpaceOutput { - s.Status = &v - return s -} - -// SetStorageLimit sets the StorageLimit field's value. -func (s *GetSpaceOutput) SetStorageLimit(v int64) *GetSpaceOutput { - s.StorageLimit = &v - return s -} - -// SetTier sets the Tier field's value. -func (s *GetSpaceOutput) SetTier(v string) *GetSpaceOutput { - s.Tier = &v - return s -} - -// SetUserAdmins sets the UserAdmins field's value. -func (s *GetSpaceOutput) SetUserAdmins(v []*string) *GetSpaceOutput { - s.UserAdmins = v - return s -} - -// SetUserCount sets the UserCount field's value. -func (s *GetSpaceOutput) SetUserCount(v int64) *GetSpaceOutput { - s.UserCount = &v - return s -} - -// SetUserKMSKey sets the UserKMSKey field's value. -func (s *GetSpaceOutput) SetUserKMSKey(v string) *GetSpaceOutput { - s.UserKMSKey = &v - return s -} - -// SetVanityDomain sets the VanityDomain field's value. -func (s *GetSpaceOutput) SetVanityDomain(v string) *GetSpaceOutput { - s.VanityDomain = &v - return s -} - -// SetVanityDomainStatus sets the VanityDomainStatus field's value. -func (s *GetSpaceOutput) SetVanityDomainStatus(v string) *GetSpaceOutput { - s.VanityDomainStatus = &v - return s -} - -// Unexpected error during processing of request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // Advice to clients on when the call can be safely retried. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListSpacesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of private re:Posts to include in the results. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of private re:Posts to return. You receive this - // token from a previous ListSpaces operation. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListSpacesInput) 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 ListSpacesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSpacesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSpacesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSpacesInput) SetMaxResults(v int64) *ListSpacesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSpacesInput) SetNextToken(v string) *ListSpacesInput { - s.NextToken = &v - return s -} - -type ListSpacesOutput struct { - _ struct{} `type:"structure"` - - // The token that you use when you request the next set of private re:Posts. - NextToken *string `locationName:"nextToken" type:"string"` - - // An array of structures that contain some information about the private re:Posts - // in the account. - // - // Spaces is a required field - Spaces []*SpaceData `locationName:"spaces" type:"list" 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 ListSpacesOutput) 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 ListSpacesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSpacesOutput) SetNextToken(v string) *ListSpacesOutput { - s.NextToken = &v - return s -} - -// SetSpaces sets the Spaces field's value. -func (s *ListSpacesOutput) SetSpaces(v []*SpaceData) *ListSpacesOutput { - s.Spaces = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource that the tags are associated with. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The list of tags that are associated with the resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListTagsForResourceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type RegisterAdminInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the administrator. - // - // AdminId is a required field - AdminId *string `location:"uri" locationName:"adminId" type:"string" required:"true"` - - // The ID of the private re:Post. - // - // SpaceId is a required field - SpaceId *string `location:"uri" locationName:"spaceId" 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 RegisterAdminInput) 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 RegisterAdminInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterAdminInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterAdminInput"} - if s.AdminId == nil { - invalidParams.Add(request.NewErrParamRequired("AdminId")) - } - if s.AdminId != nil && len(*s.AdminId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdminId", 1)) - } - if s.SpaceId == nil { - invalidParams.Add(request.NewErrParamRequired("SpaceId")) - } - if s.SpaceId != nil && len(*s.SpaceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpaceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdminId sets the AdminId field's value. -func (s *RegisterAdminInput) SetAdminId(v string) *RegisterAdminInput { - s.AdminId = &v - return s -} - -// SetSpaceId sets the SpaceId field's value. -func (s *RegisterAdminInput) SetSpaceId(v string) *RegisterAdminInput { - s.SpaceId = &v - return s -} - -type RegisterAdminOutput 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 RegisterAdminOutput) 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 RegisterAdminOutput) GoString() string { - return s.String() -} - -// Request references a resource which does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the resource. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of the resource. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type SendInvitesInput struct { - _ struct{} `type:"structure"` - - // The array of identifiers for the users and groups. - // - // AccessorIds is a required field - AccessorIds []*string `locationName:"accessorIds" type:"list" required:"true"` - - // The body of the invite. - // - // Body is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SendInvitesInput's - // String and GoString methods. - // - // Body is a required field - Body *string `locationName:"body" min:"1" type:"string" required:"true" sensitive:"true"` - - // The ID of the private re:Post. - // - // SpaceId is a required field - SpaceId *string `location:"uri" locationName:"spaceId" type:"string" required:"true"` - - // The title of the invite. - // - // Title is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SendInvitesInput's - // String and GoString methods. - // - // Title is a required field - Title *string `locationName:"title" min:"1" type:"string" required:"true" sensitive:"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 SendInvitesInput) 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 SendInvitesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendInvitesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendInvitesInput"} - if s.AccessorIds == nil { - invalidParams.Add(request.NewErrParamRequired("AccessorIds")) - } - if s.Body == nil { - invalidParams.Add(request.NewErrParamRequired("Body")) - } - if s.Body != nil && len(*s.Body) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Body", 1)) - } - if s.SpaceId == nil { - invalidParams.Add(request.NewErrParamRequired("SpaceId")) - } - if s.SpaceId != nil && len(*s.SpaceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpaceId", 1)) - } - if s.Title == nil { - invalidParams.Add(request.NewErrParamRequired("Title")) - } - if s.Title != nil && len(*s.Title) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Title", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessorIds sets the AccessorIds field's value. -func (s *SendInvitesInput) SetAccessorIds(v []*string) *SendInvitesInput { - s.AccessorIds = v - return s -} - -// SetBody sets the Body field's value. -func (s *SendInvitesInput) SetBody(v string) *SendInvitesInput { - s.Body = &v - return s -} - -// SetSpaceId sets the SpaceId field's value. -func (s *SendInvitesInput) SetSpaceId(v string) *SendInvitesInput { - s.SpaceId = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *SendInvitesInput) SetTitle(v string) *SendInvitesInput { - s.Title = &v - return s -} - -type SendInvitesOutput 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 SendInvitesOutput) 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 SendInvitesOutput) GoString() string { - return s.String() -} - -// Request would cause a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The code to identify the quota. - // - // QuotaCode is a required field - QuotaCode *string `locationName:"quotaCode" type:"string" required:"true"` - - // The id of the resource. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of the resource. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true"` - - // The code to identify the service. - // - // ServiceCode is a required field - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A structure that contains some information about a private re:Post in the -// account. -type SpaceData struct { - _ struct{} `type:"structure"` - - // The ARN of the private re:Post. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The configuration status of the private re:Post. - // - // ConfigurationStatus is a required field - ConfigurationStatus *string `locationName:"configurationStatus" type:"string" required:"true" enum:"ConfigurationStatus"` - - // The content size of the private re:Post. - ContentSize *int64 `locationName:"contentSize" type:"long"` - - // The date when the private re:Post was created. - // - // CreateDateTime is a required field - CreateDateTime *time.Time `locationName:"createDateTime" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date when the private re:Post was deleted. - DeleteDateTime *time.Time `locationName:"deleteDateTime" type:"timestamp" timestampFormat:"iso8601"` - - // The description for the private re:Post. This is used only to help you identify - // this private re:Post. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SpaceData's - // String and GoString methods. - Description *string `locationName:"description" min:"1" type:"string" sensitive:"true"` - - // The name for the private re:Post. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SpaceData's - // String and GoString methods. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true" sensitive:"true"` - - // The AWS generated subdomain of the private re:Post. - // - // RandomDomain is a required field - RandomDomain *string `locationName:"randomDomain" type:"string" required:"true"` - - // The unique ID of the private re:Post. - // - // SpaceId is a required field - SpaceId *string `locationName:"spaceId" type:"string" required:"true"` - - // The creation/deletion status of the private re:Post. - // - // Status is a required field - Status *string `locationName:"status" min:"1" type:"string" required:"true"` - - // The storage limit of the private re:Post. - // - // StorageLimit is a required field - StorageLimit *int64 `locationName:"storageLimit" type:"long" required:"true"` - - // The pricing tier of the private re:Post. - // - // Tier is a required field - Tier *string `locationName:"tier" type:"string" required:"true" enum:"TierLevel"` - - // The number of onboarded users to the private re:Post. - UserCount *int64 `locationName:"userCount" type:"integer"` - - // The custom AWS KMS key ARN that’s used for the AWS KMS encryption. - UserKMSKey *string `locationName:"userKMSKey" type:"string"` - - // This custom subdomain that you use to access your private re:Post. All custom - // subdomains must be approved by AWS before use. - // - // VanityDomain is a required field - VanityDomain *string `locationName:"vanityDomain" type:"string" required:"true"` - - // This approval status of the custom subdomain. - // - // VanityDomainStatus is a required field - VanityDomainStatus *string `locationName:"vanityDomainStatus" type:"string" required:"true" enum:"VanityDomainStatus"` -} - -// 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 SpaceData) 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 SpaceData) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *SpaceData) SetArn(v string) *SpaceData { - s.Arn = &v - return s -} - -// SetConfigurationStatus sets the ConfigurationStatus field's value. -func (s *SpaceData) SetConfigurationStatus(v string) *SpaceData { - s.ConfigurationStatus = &v - return s -} - -// SetContentSize sets the ContentSize field's value. -func (s *SpaceData) SetContentSize(v int64) *SpaceData { - s.ContentSize = &v - return s -} - -// SetCreateDateTime sets the CreateDateTime field's value. -func (s *SpaceData) SetCreateDateTime(v time.Time) *SpaceData { - s.CreateDateTime = &v - return s -} - -// SetDeleteDateTime sets the DeleteDateTime field's value. -func (s *SpaceData) SetDeleteDateTime(v time.Time) *SpaceData { - s.DeleteDateTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *SpaceData) SetDescription(v string) *SpaceData { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *SpaceData) SetName(v string) *SpaceData { - s.Name = &v - return s -} - -// SetRandomDomain sets the RandomDomain field's value. -func (s *SpaceData) SetRandomDomain(v string) *SpaceData { - s.RandomDomain = &v - return s -} - -// SetSpaceId sets the SpaceId field's value. -func (s *SpaceData) SetSpaceId(v string) *SpaceData { - s.SpaceId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SpaceData) SetStatus(v string) *SpaceData { - s.Status = &v - return s -} - -// SetStorageLimit sets the StorageLimit field's value. -func (s *SpaceData) SetStorageLimit(v int64) *SpaceData { - s.StorageLimit = &v - return s -} - -// SetTier sets the Tier field's value. -func (s *SpaceData) SetTier(v string) *SpaceData { - s.Tier = &v - return s -} - -// SetUserCount sets the UserCount field's value. -func (s *SpaceData) SetUserCount(v int64) *SpaceData { - s.UserCount = &v - return s -} - -// SetUserKMSKey sets the UserKMSKey field's value. -func (s *SpaceData) SetUserKMSKey(v string) *SpaceData { - s.UserKMSKey = &v - return s -} - -// SetVanityDomain sets the VanityDomain field's value. -func (s *SpaceData) SetVanityDomain(v string) *SpaceData { - s.VanityDomain = &v - return s -} - -// SetVanityDomainStatus sets the VanityDomainStatus field's value. -func (s *SpaceData) SetVanityDomainStatus(v string) *SpaceData { - s.VanityDomainStatus = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource that the tag is associated with. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // The list of tag keys and values that must be associated with the resource. - // You can associate tag keys only, tags (key and values) only, or a combination - // of tag keys and tags. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TagResourceInput's - // String and GoString methods. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true" sensitive:"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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The code to identify the quota. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // Advice to clients on when the call can be safely retried. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The code to identify the service. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // The key values of the tag. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateSpaceInput struct { - _ struct{} `type:"structure"` - - // A description for the private re:Post. This is used only to help you identify - // this private re:Post. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateSpaceInput's - // String and GoString methods. - Description *string `locationName:"description" min:"1" type:"string" sensitive:"true"` - - // The IAM role that grants permissions to the private re:Post to convert unanswered - // questions into AWS support tickets. - RoleArn *string `locationName:"roleArn" min:"20" type:"string"` - - // The unique ID of this private re:Post. - // - // SpaceId is a required field - SpaceId *string `location:"uri" locationName:"spaceId" type:"string" required:"true"` - - // The pricing tier of this private re:Post. - Tier *string `locationName:"tier" type:"string" enum:"TierLevel"` -} - -// 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 UpdateSpaceInput) 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 UpdateSpaceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSpaceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSpaceInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.SpaceId == nil { - invalidParams.Add(request.NewErrParamRequired("SpaceId")) - } - if s.SpaceId != nil && len(*s.SpaceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SpaceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateSpaceInput) SetDescription(v string) *UpdateSpaceInput { - s.Description = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *UpdateSpaceInput) SetRoleArn(v string) *UpdateSpaceInput { - s.RoleArn = &v - return s -} - -// SetSpaceId sets the SpaceId field's value. -func (s *UpdateSpaceInput) SetSpaceId(v string) *UpdateSpaceInput { - s.SpaceId = &v - return s -} - -// SetTier sets the Tier field's value. -func (s *UpdateSpaceInput) SetTier(v string) *UpdateSpaceInput { - s.Tier = &v - return s -} - -type UpdateSpaceOutput 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 UpdateSpaceOutput) 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 UpdateSpaceOutput) GoString() string { - return s.String() -} - -// The input fails to satisfy the constraints specified by an AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The field that caused the error, if applicable. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason why the request failed validation. - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Stores information about a field that’s passed inside a request that resulted -// in an exception. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // The name of the field. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // Message describing why the field failed validation. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // ConfigurationStatusConfigured is a ConfigurationStatus enum value - ConfigurationStatusConfigured = "CONFIGURED" - - // ConfigurationStatusUnconfigured is a ConfigurationStatus enum value - ConfigurationStatusUnconfigured = "UNCONFIGURED" -) - -// ConfigurationStatus_Values returns all elements of the ConfigurationStatus enum -func ConfigurationStatus_Values() []string { - return []string{ - ConfigurationStatusConfigured, - ConfigurationStatusUnconfigured, - } -} - -const ( - // TierLevelBasic is a TierLevel enum value - TierLevelBasic = "BASIC" - - // TierLevelStandard is a TierLevel enum value - TierLevelStandard = "STANDARD" -) - -// TierLevel_Values returns all elements of the TierLevel enum -func TierLevel_Values() []string { - return []string{ - TierLevelBasic, - TierLevelStandard, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} - -const ( - // VanityDomainStatusPending is a VanityDomainStatus enum value - VanityDomainStatusPending = "PENDING" - - // VanityDomainStatusApproved is a VanityDomainStatus enum value - VanityDomainStatusApproved = "APPROVED" - - // VanityDomainStatusUnapproved is a VanityDomainStatus enum value - VanityDomainStatusUnapproved = "UNAPPROVED" -) - -// VanityDomainStatus_Values returns all elements of the VanityDomainStatus enum -func VanityDomainStatus_Values() []string { - return []string{ - VanityDomainStatusPending, - VanityDomainStatusApproved, - VanityDomainStatusUnapproved, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/doc.go deleted file mode 100644 index 7f6b84b8a763..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/doc.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package repostspace provides the client and types for making API -// requests to AWS re:Post Private. -// -// AWS re:Post Private is a private version of AWS re:Post for enterprises with -// Enterprise Support or Enterprise On-Ramp Support plans. It provides access -// to knowledge and experts to accelerate cloud adoption and increase developer -// productivity. With your organization-specific private re:Post, you can build -// an organization-specific developer community that drives efficiencies at -// scale and provides access to valuable knowledge resources. Additionally, -// re:Post Private centralizes trusted AWS technical content and offers private -// discussion forums to improve how your teams collaborate internally and with -// AWS to remove technical obstacles, accelerate innovation, and scale more -// efficiently in the cloud. -// -// See https://docs.aws.amazon.com/goto/WebAPI/repostspace-2022-05-13 for more information on this service. -// -// See repostspace package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/repostspace/ -// -// # Using the Client -// -// To contact AWS re:Post Private with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS re:Post Private client Repostspace for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/repostspace/#New -package repostspace diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/errors.go deleted file mode 100644 index 8233bb383c34..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/errors.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package repostspace - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // User does not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Updating or deleting a resource can cause an inconsistent state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Unexpected error during processing of request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Request references a resource which does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Request would cause a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // Request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/repostspaceiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/repostspaceiface/interface.go deleted file mode 100644 index d1389b40e7a2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/repostspaceiface/interface.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package repostspaceiface provides an interface to enable mocking the AWS re:Post Private service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package repostspaceiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace" -) - -// RepostspaceAPI provides an interface to enable mocking the -// repostspace.Repostspace service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS re:Post Private. -// func myFunc(svc repostspaceiface.RepostspaceAPI) bool { -// // Make svc.CreateSpace request -// } -// -// func main() { -// sess := session.New() -// svc := repostspace.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockRepostspaceClient struct { -// repostspaceiface.RepostspaceAPI -// } -// func (m *mockRepostspaceClient) CreateSpace(input *repostspace.CreateSpaceInput) (*repostspace.CreateSpaceOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockRepostspaceClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type RepostspaceAPI interface { - CreateSpace(*repostspace.CreateSpaceInput) (*repostspace.CreateSpaceOutput, error) - CreateSpaceWithContext(aws.Context, *repostspace.CreateSpaceInput, ...request.Option) (*repostspace.CreateSpaceOutput, error) - CreateSpaceRequest(*repostspace.CreateSpaceInput) (*request.Request, *repostspace.CreateSpaceOutput) - - DeleteSpace(*repostspace.DeleteSpaceInput) (*repostspace.DeleteSpaceOutput, error) - DeleteSpaceWithContext(aws.Context, *repostspace.DeleteSpaceInput, ...request.Option) (*repostspace.DeleteSpaceOutput, error) - DeleteSpaceRequest(*repostspace.DeleteSpaceInput) (*request.Request, *repostspace.DeleteSpaceOutput) - - DeregisterAdmin(*repostspace.DeregisterAdminInput) (*repostspace.DeregisterAdminOutput, error) - DeregisterAdminWithContext(aws.Context, *repostspace.DeregisterAdminInput, ...request.Option) (*repostspace.DeregisterAdminOutput, error) - DeregisterAdminRequest(*repostspace.DeregisterAdminInput) (*request.Request, *repostspace.DeregisterAdminOutput) - - GetSpace(*repostspace.GetSpaceInput) (*repostspace.GetSpaceOutput, error) - GetSpaceWithContext(aws.Context, *repostspace.GetSpaceInput, ...request.Option) (*repostspace.GetSpaceOutput, error) - GetSpaceRequest(*repostspace.GetSpaceInput) (*request.Request, *repostspace.GetSpaceOutput) - - ListSpaces(*repostspace.ListSpacesInput) (*repostspace.ListSpacesOutput, error) - ListSpacesWithContext(aws.Context, *repostspace.ListSpacesInput, ...request.Option) (*repostspace.ListSpacesOutput, error) - ListSpacesRequest(*repostspace.ListSpacesInput) (*request.Request, *repostspace.ListSpacesOutput) - - ListSpacesPages(*repostspace.ListSpacesInput, func(*repostspace.ListSpacesOutput, bool) bool) error - ListSpacesPagesWithContext(aws.Context, *repostspace.ListSpacesInput, func(*repostspace.ListSpacesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*repostspace.ListTagsForResourceInput) (*repostspace.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *repostspace.ListTagsForResourceInput, ...request.Option) (*repostspace.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*repostspace.ListTagsForResourceInput) (*request.Request, *repostspace.ListTagsForResourceOutput) - - RegisterAdmin(*repostspace.RegisterAdminInput) (*repostspace.RegisterAdminOutput, error) - RegisterAdminWithContext(aws.Context, *repostspace.RegisterAdminInput, ...request.Option) (*repostspace.RegisterAdminOutput, error) - RegisterAdminRequest(*repostspace.RegisterAdminInput) (*request.Request, *repostspace.RegisterAdminOutput) - - SendInvites(*repostspace.SendInvitesInput) (*repostspace.SendInvitesOutput, error) - SendInvitesWithContext(aws.Context, *repostspace.SendInvitesInput, ...request.Option) (*repostspace.SendInvitesOutput, error) - SendInvitesRequest(*repostspace.SendInvitesInput) (*request.Request, *repostspace.SendInvitesOutput) - - TagResource(*repostspace.TagResourceInput) (*repostspace.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *repostspace.TagResourceInput, ...request.Option) (*repostspace.TagResourceOutput, error) - TagResourceRequest(*repostspace.TagResourceInput) (*request.Request, *repostspace.TagResourceOutput) - - UntagResource(*repostspace.UntagResourceInput) (*repostspace.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *repostspace.UntagResourceInput, ...request.Option) (*repostspace.UntagResourceOutput, error) - UntagResourceRequest(*repostspace.UntagResourceInput) (*request.Request, *repostspace.UntagResourceOutput) - - UpdateSpace(*repostspace.UpdateSpaceInput) (*repostspace.UpdateSpaceOutput, error) - UpdateSpaceWithContext(aws.Context, *repostspace.UpdateSpaceInput, ...request.Option) (*repostspace.UpdateSpaceOutput, error) - UpdateSpaceRequest(*repostspace.UpdateSpaceInput) (*request.Request, *repostspace.UpdateSpaceOutput) -} - -var _ RepostspaceAPI = (*repostspace.Repostspace)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/service.go deleted file mode 100644 index 32dc5aebd44d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/repostspace/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package repostspace - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// Repostspace provides the API operation methods for making requests to -// AWS re:Post Private. See this package's package overview docs -// for details on the service. -// -// Repostspace methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type Repostspace struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "repostspace" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "repostspace" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the Repostspace client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a Repostspace client from just a session. -// svc := repostspace.New(mySession) -// -// // Create a Repostspace client with additional configuration -// svc := repostspace.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Repostspace { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "repostspace" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *Repostspace { - svc := &Repostspace{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-05-13", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Repostspace operation and runs any -// custom request initialization. -func (c *Repostspace) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/api.go deleted file mode 100644 index 457b01cfbeed..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/api.go +++ /dev/null @@ -1,6042 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package resourceexplorer2 - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opAssociateDefaultView = "AssociateDefaultView" - -// AssociateDefaultViewRequest generates a "aws/request.Request" representing the -// client's request for the AssociateDefaultView 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 AssociateDefaultView for more information on using the AssociateDefaultView -// 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 AssociateDefaultViewRequest method. -// req, resp := client.AssociateDefaultViewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/AssociateDefaultView -func (c *ResourceExplorer2) AssociateDefaultViewRequest(input *AssociateDefaultViewInput) (req *request.Request, output *AssociateDefaultViewOutput) { - op := &request.Operation{ - Name: opAssociateDefaultView, - HTTPMethod: "POST", - HTTPPath: "/AssociateDefaultView", - } - - if input == nil { - input = &AssociateDefaultViewInput{} - } - - output = &AssociateDefaultViewOutput{} - req = c.newRequest(op, input, output) - return -} - -// AssociateDefaultView API operation for AWS Resource Explorer. -// -// Sets the specified view as the default for the Amazon Web Services Region -// in which you call this operation. When a user performs a Search that doesn't -// explicitly specify which view to use, then Amazon Web Services Resource Explorer -// automatically chooses this default view for searches performed in this Amazon -// Web Services Region. -// -// If an Amazon Web Services Region doesn't have a default view configured, -// then users must explicitly specify a view with every Search operation performed -// in that Region. -// -// 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 AWS Resource Explorer's -// API operation AssociateDefaultView for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/AssociateDefaultView -func (c *ResourceExplorer2) AssociateDefaultView(input *AssociateDefaultViewInput) (*AssociateDefaultViewOutput, error) { - req, out := c.AssociateDefaultViewRequest(input) - return out, req.Send() -} - -// AssociateDefaultViewWithContext is the same as AssociateDefaultView with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateDefaultView 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 *ResourceExplorer2) AssociateDefaultViewWithContext(ctx aws.Context, input *AssociateDefaultViewInput, opts ...request.Option) (*AssociateDefaultViewOutput, error) { - req, out := c.AssociateDefaultViewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opBatchGetView = "BatchGetView" - -// BatchGetViewRequest generates a "aws/request.Request" representing the -// client's request for the BatchGetView 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 BatchGetView for more information on using the BatchGetView -// 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 BatchGetViewRequest method. -// req, resp := client.BatchGetViewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/BatchGetView -func (c *ResourceExplorer2) BatchGetViewRequest(input *BatchGetViewInput) (req *request.Request, output *BatchGetViewOutput) { - op := &request.Operation{ - Name: opBatchGetView, - HTTPMethod: "POST", - HTTPPath: "/BatchGetView", - } - - if input == nil { - input = &BatchGetViewInput{} - } - - output = &BatchGetViewOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchGetView API operation for AWS Resource Explorer. -// -// Retrieves details about a list of views. -// -// 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 AWS Resource Explorer's -// API operation BatchGetView for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/BatchGetView -func (c *ResourceExplorer2) BatchGetView(input *BatchGetViewInput) (*BatchGetViewOutput, error) { - req, out := c.BatchGetViewRequest(input) - return out, req.Send() -} - -// BatchGetViewWithContext is the same as BatchGetView with the addition of -// the ability to pass a context and additional request options. -// -// See BatchGetView 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 *ResourceExplorer2) BatchGetViewWithContext(ctx aws.Context, input *BatchGetViewInput, opts ...request.Option) (*BatchGetViewOutput, error) { - req, out := c.BatchGetViewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateIndex = "CreateIndex" - -// CreateIndexRequest generates a "aws/request.Request" representing the -// client's request for the CreateIndex 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 CreateIndex for more information on using the CreateIndex -// 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 CreateIndexRequest method. -// req, resp := client.CreateIndexRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/CreateIndex -func (c *ResourceExplorer2) CreateIndexRequest(input *CreateIndexInput) (req *request.Request, output *CreateIndexOutput) { - op := &request.Operation{ - Name: opCreateIndex, - HTTPMethod: "POST", - HTTPPath: "/CreateIndex", - } - - if input == nil { - input = &CreateIndexInput{} - } - - output = &CreateIndexOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateIndex API operation for AWS Resource Explorer. -// -// Turns on Amazon Web Services Resource Explorer in the Amazon Web Services -// Region in which you called this operation by creating an index. Resource -// Explorer begins discovering the resources in this Region and stores the details -// about the resources in the index so that they can be queried by using the -// Search operation. You can create only one index in a Region. -// -// This operation creates only a local index. To promote the local index in -// one Amazon Web Services Region into the aggregator index for the Amazon Web -// Services account, use the UpdateIndexType operation. For more information, -// see Turning on cross-Region search by creating an aggregator index (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html) -// in the Amazon Web Services Resource Explorer User Guide. -// -// For more details about what happens when you turn on Resource Explorer in -// an Amazon Web Services Region, see Turn on Resource Explorer to index your -// resources in an Amazon Web Services Region (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-service-activate.html) -// in the Amazon Web Services Resource Explorer User Guide. -// -// If this is the first Amazon Web Services Region in which you've created an -// index for Resource Explorer, then this operation also creates a service-linked -// role (https://docs.aws.amazon.com/resource-explorer/latest/userguide/security_iam_service-linked-roles.html) -// in your Amazon Web Services account that allows Resource Explorer to enumerate -// your resources to populate the index. -// -// - Action: resource-explorer-2:CreateIndex Resource: The ARN of the index -// (as it will exist after the operation completes) in the Amazon Web Services -// Region and account in which you're trying to create the index. Use the -// wildcard character (*) at the end of the string to match the eventual -// UUID. For example, the following Resource element restricts the role or -// user to creating an index in only the us-east-2 Region of the specified -// account. "Resource": "arn:aws:resource-explorer-2:us-west-2::index/*" -// Alternatively, you can use "Resource": "*" to allow the role or user to -// create an index in any Region. -// -// - Action: iam:CreateServiceLinkedRole Resource: No specific resource (*). -// This permission is required only the first time you create an index to -// turn on Resource Explorer in the account. Resource Explorer uses this -// to create the service-linked role needed to index the resources in your -// account (https://docs.aws.amazon.com/resource-explorer/latest/userguide/security_iam_service-linked-roles.html). -// Resource Explorer uses the same service-linked role for all additional -// indexes you create afterwards. -// -// 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 AWS Resource Explorer's -// API operation CreateIndex for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ConflictException -// If you attempted to create a view, then the request failed because either -// you specified parameters that didn’t match the original request, or you -// attempted to create a view with a name that already exists in this Amazon -// Web Services Region. -// -// If you attempted to create an index, then the request failed because either -// you specified parameters that didn't match the original request, or an index -// already exists in the current Amazon Web Services Region. -// -// If you attempted to update an index type to AGGREGATOR, then the request -// failed because you already have an AGGREGATOR index in a different Amazon -// Web Services Region. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/CreateIndex -func (c *ResourceExplorer2) CreateIndex(input *CreateIndexInput) (*CreateIndexOutput, error) { - req, out := c.CreateIndexRequest(input) - return out, req.Send() -} - -// CreateIndexWithContext is the same as CreateIndex with the addition of -// the ability to pass a context and additional request options. -// -// See CreateIndex 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 *ResourceExplorer2) CreateIndexWithContext(ctx aws.Context, input *CreateIndexInput, opts ...request.Option) (*CreateIndexOutput, error) { - req, out := c.CreateIndexRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateView = "CreateView" - -// CreateViewRequest generates a "aws/request.Request" representing the -// client's request for the CreateView 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 CreateView for more information on using the CreateView -// 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 CreateViewRequest method. -// req, resp := client.CreateViewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/CreateView -func (c *ResourceExplorer2) CreateViewRequest(input *CreateViewInput) (req *request.Request, output *CreateViewOutput) { - op := &request.Operation{ - Name: opCreateView, - HTTPMethod: "POST", - HTTPPath: "/CreateView", - } - - if input == nil { - input = &CreateViewInput{} - } - - output = &CreateViewOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateView API operation for AWS Resource Explorer. -// -// Creates a view that users can query by using the Search operation. Results -// from queries that you make using this view include only resources that match -// the view's Filters. For more information about Amazon Web Services Resource -// Explorer views, see Managing views (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views.html) -// in the Amazon Web Services Resource Explorer User Guide. -// -// Only the principals with an IAM identity-based policy that grants Allow to -// the Search action on a Resource with the Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) -// of this view can Search using views you create with this operation. -// -// 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 AWS Resource Explorer's -// API operation CreateView for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ConflictException -// If you attempted to create a view, then the request failed because either -// you specified parameters that didn’t match the original request, or you -// attempted to create a view with a name that already exists in this Amazon -// Web Services Region. -// -// If you attempted to create an index, then the request failed because either -// you specified parameters that didn't match the original request, or an index -// already exists in the current Amazon Web Services Region. -// -// If you attempted to update an index type to AGGREGATOR, then the request -// failed because you already have an AGGREGATOR index in a different Amazon -// Web Services Region. -// -// - ServiceQuotaExceededException -// The request failed because it exceeds a service quota. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/CreateView -func (c *ResourceExplorer2) CreateView(input *CreateViewInput) (*CreateViewOutput, error) { - req, out := c.CreateViewRequest(input) - return out, req.Send() -} - -// CreateViewWithContext is the same as CreateView with the addition of -// the ability to pass a context and additional request options. -// -// See CreateView 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 *ResourceExplorer2) CreateViewWithContext(ctx aws.Context, input *CreateViewInput, opts ...request.Option) (*CreateViewOutput, error) { - req, out := c.CreateViewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteIndex = "DeleteIndex" - -// DeleteIndexRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIndex 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 DeleteIndex for more information on using the DeleteIndex -// 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 DeleteIndexRequest method. -// req, resp := client.DeleteIndexRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/DeleteIndex -func (c *ResourceExplorer2) DeleteIndexRequest(input *DeleteIndexInput) (req *request.Request, output *DeleteIndexOutput) { - op := &request.Operation{ - Name: opDeleteIndex, - HTTPMethod: "POST", - HTTPPath: "/DeleteIndex", - } - - if input == nil { - input = &DeleteIndexInput{} - } - - output = &DeleteIndexOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteIndex API operation for AWS Resource Explorer. -// -// Deletes the specified index and turns off Amazon Web Services Resource Explorer -// in the specified Amazon Web Services Region. When you delete an index, Resource -// Explorer stops discovering and indexing resources in that Region. Resource -// Explorer also deletes all views in that Region. These actions occur as asynchronous -// background tasks. You can check to see when the actions are complete by using -// the GetIndex operation and checking the Status response value. -// -// If the index you delete is the aggregator index for the Amazon Web Services -// account, you must wait 24 hours before you can promote another local index -// to be the aggregator index for the account. Users can't perform account-wide -// searches using Resource Explorer until another aggregator index is configured. -// -// 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 AWS Resource Explorer's -// API operation DeleteIndex for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/DeleteIndex -func (c *ResourceExplorer2) DeleteIndex(input *DeleteIndexInput) (*DeleteIndexOutput, error) { - req, out := c.DeleteIndexRequest(input) - return out, req.Send() -} - -// DeleteIndexWithContext is the same as DeleteIndex with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteIndex 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 *ResourceExplorer2) DeleteIndexWithContext(ctx aws.Context, input *DeleteIndexInput, opts ...request.Option) (*DeleteIndexOutput, error) { - req, out := c.DeleteIndexRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteView = "DeleteView" - -// DeleteViewRequest generates a "aws/request.Request" representing the -// client's request for the DeleteView 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 DeleteView for more information on using the DeleteView -// 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 DeleteViewRequest method. -// req, resp := client.DeleteViewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/DeleteView -func (c *ResourceExplorer2) DeleteViewRequest(input *DeleteViewInput) (req *request.Request, output *DeleteViewOutput) { - op := &request.Operation{ - Name: opDeleteView, - HTTPMethod: "POST", - HTTPPath: "/DeleteView", - } - - if input == nil { - input = &DeleteViewInput{} - } - - output = &DeleteViewOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteView API operation for AWS Resource Explorer. -// -// Deletes the specified view. -// -// If the specified view is the default view for its Amazon Web Services Region, -// then all Search operations in that Region must explicitly specify the view -// to use until you configure a new default by calling the AssociateDefaultView -// operation. -// -// 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 AWS Resource Explorer's -// API operation DeleteView for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/DeleteView -func (c *ResourceExplorer2) DeleteView(input *DeleteViewInput) (*DeleteViewOutput, error) { - req, out := c.DeleteViewRequest(input) - return out, req.Send() -} - -// DeleteViewWithContext is the same as DeleteView with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteView 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 *ResourceExplorer2) DeleteViewWithContext(ctx aws.Context, input *DeleteViewInput, opts ...request.Option) (*DeleteViewOutput, error) { - req, out := c.DeleteViewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateDefaultView = "DisassociateDefaultView" - -// DisassociateDefaultViewRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateDefaultView 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 DisassociateDefaultView for more information on using the DisassociateDefaultView -// 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 DisassociateDefaultViewRequest method. -// req, resp := client.DisassociateDefaultViewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/DisassociateDefaultView -func (c *ResourceExplorer2) DisassociateDefaultViewRequest(input *DisassociateDefaultViewInput) (req *request.Request, output *DisassociateDefaultViewOutput) { - op := &request.Operation{ - Name: opDisassociateDefaultView, - HTTPMethod: "POST", - HTTPPath: "/DisassociateDefaultView", - } - - if input == nil { - input = &DisassociateDefaultViewInput{} - } - - output = &DisassociateDefaultViewOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateDefaultView API operation for AWS Resource Explorer. -// -// After you call this operation, the affected Amazon Web Services Region no -// longer has a default view. All Search operations in that Region must explicitly -// specify a view or the operation fails. You can configure a new default by -// calling the AssociateDefaultView operation. -// -// If an Amazon Web Services Region doesn't have a default view configured, -// then users must explicitly specify a view with every Search operation performed -// in that Region. -// -// 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 AWS Resource Explorer's -// API operation DisassociateDefaultView for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/DisassociateDefaultView -func (c *ResourceExplorer2) DisassociateDefaultView(input *DisassociateDefaultViewInput) (*DisassociateDefaultViewOutput, error) { - req, out := c.DisassociateDefaultViewRequest(input) - return out, req.Send() -} - -// DisassociateDefaultViewWithContext is the same as DisassociateDefaultView with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateDefaultView 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 *ResourceExplorer2) DisassociateDefaultViewWithContext(ctx aws.Context, input *DisassociateDefaultViewInput, opts ...request.Option) (*DisassociateDefaultViewOutput, error) { - req, out := c.DisassociateDefaultViewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAccountLevelServiceConfiguration = "GetAccountLevelServiceConfiguration" - -// GetAccountLevelServiceConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetAccountLevelServiceConfiguration 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 GetAccountLevelServiceConfiguration for more information on using the GetAccountLevelServiceConfiguration -// 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 GetAccountLevelServiceConfigurationRequest method. -// req, resp := client.GetAccountLevelServiceConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/GetAccountLevelServiceConfiguration -func (c *ResourceExplorer2) GetAccountLevelServiceConfigurationRequest(input *GetAccountLevelServiceConfigurationInput) (req *request.Request, output *GetAccountLevelServiceConfigurationOutput) { - op := &request.Operation{ - Name: opGetAccountLevelServiceConfiguration, - HTTPMethod: "POST", - HTTPPath: "/GetAccountLevelServiceConfiguration", - } - - if input == nil { - input = &GetAccountLevelServiceConfigurationInput{} - } - - output = &GetAccountLevelServiceConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccountLevelServiceConfiguration API operation for AWS Resource Explorer. -// -// Retrieves the status of your account's Amazon Web Services service access, -// and validates the service linked role required to access the multi-account -// search feature. Only the management account or a delegated administrator -// with service access enabled can invoke this API call. -// -// 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 AWS Resource Explorer's -// API operation GetAccountLevelServiceConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/GetAccountLevelServiceConfiguration -func (c *ResourceExplorer2) GetAccountLevelServiceConfiguration(input *GetAccountLevelServiceConfigurationInput) (*GetAccountLevelServiceConfigurationOutput, error) { - req, out := c.GetAccountLevelServiceConfigurationRequest(input) - return out, req.Send() -} - -// GetAccountLevelServiceConfigurationWithContext is the same as GetAccountLevelServiceConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetAccountLevelServiceConfiguration 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 *ResourceExplorer2) GetAccountLevelServiceConfigurationWithContext(ctx aws.Context, input *GetAccountLevelServiceConfigurationInput, opts ...request.Option) (*GetAccountLevelServiceConfigurationOutput, error) { - req, out := c.GetAccountLevelServiceConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDefaultView = "GetDefaultView" - -// GetDefaultViewRequest generates a "aws/request.Request" representing the -// client's request for the GetDefaultView 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 GetDefaultView for more information on using the GetDefaultView -// 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 GetDefaultViewRequest method. -// req, resp := client.GetDefaultViewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/GetDefaultView -func (c *ResourceExplorer2) GetDefaultViewRequest(input *GetDefaultViewInput) (req *request.Request, output *GetDefaultViewOutput) { - op := &request.Operation{ - Name: opGetDefaultView, - HTTPMethod: "POST", - HTTPPath: "/GetDefaultView", - } - - if input == nil { - input = &GetDefaultViewInput{} - } - - output = &GetDefaultViewOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDefaultView API operation for AWS Resource Explorer. -// -// Retrieves the Amazon Resource Name (ARN) of the view that is the default -// for the Amazon Web Services Region in which you call this operation. You -// can then call GetView to retrieve the details of that view. -// -// 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 AWS Resource Explorer's -// API operation GetDefaultView for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/GetDefaultView -func (c *ResourceExplorer2) GetDefaultView(input *GetDefaultViewInput) (*GetDefaultViewOutput, error) { - req, out := c.GetDefaultViewRequest(input) - return out, req.Send() -} - -// GetDefaultViewWithContext is the same as GetDefaultView with the addition of -// the ability to pass a context and additional request options. -// -// See GetDefaultView 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 *ResourceExplorer2) GetDefaultViewWithContext(ctx aws.Context, input *GetDefaultViewInput, opts ...request.Option) (*GetDefaultViewOutput, error) { - req, out := c.GetDefaultViewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIndex = "GetIndex" - -// GetIndexRequest generates a "aws/request.Request" representing the -// client's request for the GetIndex 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 GetIndex for more information on using the GetIndex -// 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 GetIndexRequest method. -// req, resp := client.GetIndexRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/GetIndex -func (c *ResourceExplorer2) GetIndexRequest(input *GetIndexInput) (req *request.Request, output *GetIndexOutput) { - op := &request.Operation{ - Name: opGetIndex, - HTTPMethod: "POST", - HTTPPath: "/GetIndex", - } - - if input == nil { - input = &GetIndexInput{} - } - - output = &GetIndexOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIndex API operation for AWS Resource Explorer. -// -// Retrieves details about the Amazon Web Services Resource Explorer index in -// the Amazon Web Services Region in which you invoked the operation. -// -// 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 AWS Resource Explorer's -// API operation GetIndex for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/GetIndex -func (c *ResourceExplorer2) GetIndex(input *GetIndexInput) (*GetIndexOutput, error) { - req, out := c.GetIndexRequest(input) - return out, req.Send() -} - -// GetIndexWithContext is the same as GetIndex with the addition of -// the ability to pass a context and additional request options. -// -// See GetIndex 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 *ResourceExplorer2) GetIndexWithContext(ctx aws.Context, input *GetIndexInput, opts ...request.Option) (*GetIndexOutput, error) { - req, out := c.GetIndexRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetView = "GetView" - -// GetViewRequest generates a "aws/request.Request" representing the -// client's request for the GetView 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 GetView for more information on using the GetView -// 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 GetViewRequest method. -// req, resp := client.GetViewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/GetView -func (c *ResourceExplorer2) GetViewRequest(input *GetViewInput) (req *request.Request, output *GetViewOutput) { - op := &request.Operation{ - Name: opGetView, - HTTPMethod: "POST", - HTTPPath: "/GetView", - } - - if input == nil { - input = &GetViewInput{} - } - - output = &GetViewOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetView API operation for AWS Resource Explorer. -// -// Retrieves details of the specified view. -// -// 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 AWS Resource Explorer's -// API operation GetView for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/GetView -func (c *ResourceExplorer2) GetView(input *GetViewInput) (*GetViewOutput, error) { - req, out := c.GetViewRequest(input) - return out, req.Send() -} - -// GetViewWithContext is the same as GetView with the addition of -// the ability to pass a context and additional request options. -// -// See GetView 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 *ResourceExplorer2) GetViewWithContext(ctx aws.Context, input *GetViewInput, opts ...request.Option) (*GetViewOutput, error) { - req, out := c.GetViewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListIndexes = "ListIndexes" - -// ListIndexesRequest generates a "aws/request.Request" representing the -// client's request for the ListIndexes 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 ListIndexes for more information on using the ListIndexes -// 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 ListIndexesRequest method. -// req, resp := client.ListIndexesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListIndexes -func (c *ResourceExplorer2) ListIndexesRequest(input *ListIndexesInput) (req *request.Request, output *ListIndexesOutput) { - op := &request.Operation{ - Name: opListIndexes, - HTTPMethod: "POST", - HTTPPath: "/ListIndexes", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIndexesInput{} - } - - output = &ListIndexesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIndexes API operation for AWS Resource Explorer. -// -// Retrieves a list of all of the indexes in Amazon Web Services Regions that -// are currently collecting resource information for Amazon Web Services Resource -// Explorer. -// -// 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 AWS Resource Explorer's -// API operation ListIndexes for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListIndexes -func (c *ResourceExplorer2) ListIndexes(input *ListIndexesInput) (*ListIndexesOutput, error) { - req, out := c.ListIndexesRequest(input) - return out, req.Send() -} - -// ListIndexesWithContext is the same as ListIndexes with the addition of -// the ability to pass a context and additional request options. -// -// See ListIndexes 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 *ResourceExplorer2) ListIndexesWithContext(ctx aws.Context, input *ListIndexesInput, opts ...request.Option) (*ListIndexesOutput, error) { - req, out := c.ListIndexesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIndexesPages iterates over the pages of a ListIndexes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIndexes method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIndexes operation. -// pageNum := 0 -// err := client.ListIndexesPages(params, -// func(page *resourceexplorer2.ListIndexesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceExplorer2) ListIndexesPages(input *ListIndexesInput, fn func(*ListIndexesOutput, bool) bool) error { - return c.ListIndexesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIndexesPagesWithContext same as ListIndexesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ResourceExplorer2) ListIndexesPagesWithContext(ctx aws.Context, input *ListIndexesInput, fn func(*ListIndexesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIndexesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIndexesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIndexesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListIndexesForMembers = "ListIndexesForMembers" - -// ListIndexesForMembersRequest generates a "aws/request.Request" representing the -// client's request for the ListIndexesForMembers 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 ListIndexesForMembers for more information on using the ListIndexesForMembers -// 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 ListIndexesForMembersRequest method. -// req, resp := client.ListIndexesForMembersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListIndexesForMembers -func (c *ResourceExplorer2) ListIndexesForMembersRequest(input *ListIndexesForMembersInput) (req *request.Request, output *ListIndexesForMembersOutput) { - op := &request.Operation{ - Name: opListIndexesForMembers, - HTTPMethod: "POST", - HTTPPath: "/ListIndexesForMembers", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIndexesForMembersInput{} - } - - output = &ListIndexesForMembersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIndexesForMembers API operation for AWS Resource Explorer. -// -// Retrieves a list of a member's indexes in all Amazon Web Services Regions -// that are currently collecting resource information for Amazon Web Services -// Resource Explorer. Only the management account or a delegated administrator -// with service access enabled can invoke this API call. -// -// 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 AWS Resource Explorer's -// API operation ListIndexesForMembers for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListIndexesForMembers -func (c *ResourceExplorer2) ListIndexesForMembers(input *ListIndexesForMembersInput) (*ListIndexesForMembersOutput, error) { - req, out := c.ListIndexesForMembersRequest(input) - return out, req.Send() -} - -// ListIndexesForMembersWithContext is the same as ListIndexesForMembers with the addition of -// the ability to pass a context and additional request options. -// -// See ListIndexesForMembers 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 *ResourceExplorer2) ListIndexesForMembersWithContext(ctx aws.Context, input *ListIndexesForMembersInput, opts ...request.Option) (*ListIndexesForMembersOutput, error) { - req, out := c.ListIndexesForMembersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIndexesForMembersPages iterates over the pages of a ListIndexesForMembers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIndexesForMembers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIndexesForMembers operation. -// pageNum := 0 -// err := client.ListIndexesForMembersPages(params, -// func(page *resourceexplorer2.ListIndexesForMembersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceExplorer2) ListIndexesForMembersPages(input *ListIndexesForMembersInput, fn func(*ListIndexesForMembersOutput, bool) bool) error { - return c.ListIndexesForMembersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIndexesForMembersPagesWithContext same as ListIndexesForMembersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ResourceExplorer2) ListIndexesForMembersPagesWithContext(ctx aws.Context, input *ListIndexesForMembersInput, fn func(*ListIndexesForMembersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIndexesForMembersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIndexesForMembersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIndexesForMembersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSupportedResourceTypes = "ListSupportedResourceTypes" - -// ListSupportedResourceTypesRequest generates a "aws/request.Request" representing the -// client's request for the ListSupportedResourceTypes 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 ListSupportedResourceTypes for more information on using the ListSupportedResourceTypes -// 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 ListSupportedResourceTypesRequest method. -// req, resp := client.ListSupportedResourceTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListSupportedResourceTypes -func (c *ResourceExplorer2) ListSupportedResourceTypesRequest(input *ListSupportedResourceTypesInput) (req *request.Request, output *ListSupportedResourceTypesOutput) { - op := &request.Operation{ - Name: opListSupportedResourceTypes, - HTTPMethod: "POST", - HTTPPath: "/ListSupportedResourceTypes", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSupportedResourceTypesInput{} - } - - output = &ListSupportedResourceTypesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSupportedResourceTypes API operation for AWS Resource Explorer. -// -// Retrieves a list of all resource types currently supported by Amazon Web -// Services Resource Explorer. -// -// 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 AWS Resource Explorer's -// API operation ListSupportedResourceTypes for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListSupportedResourceTypes -func (c *ResourceExplorer2) ListSupportedResourceTypes(input *ListSupportedResourceTypesInput) (*ListSupportedResourceTypesOutput, error) { - req, out := c.ListSupportedResourceTypesRequest(input) - return out, req.Send() -} - -// ListSupportedResourceTypesWithContext is the same as ListSupportedResourceTypes with the addition of -// the ability to pass a context and additional request options. -// -// See ListSupportedResourceTypes 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 *ResourceExplorer2) ListSupportedResourceTypesWithContext(ctx aws.Context, input *ListSupportedResourceTypesInput, opts ...request.Option) (*ListSupportedResourceTypesOutput, error) { - req, out := c.ListSupportedResourceTypesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSupportedResourceTypesPages iterates over the pages of a ListSupportedResourceTypes operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSupportedResourceTypes method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSupportedResourceTypes operation. -// pageNum := 0 -// err := client.ListSupportedResourceTypesPages(params, -// func(page *resourceexplorer2.ListSupportedResourceTypesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceExplorer2) ListSupportedResourceTypesPages(input *ListSupportedResourceTypesInput, fn func(*ListSupportedResourceTypesOutput, bool) bool) error { - return c.ListSupportedResourceTypesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSupportedResourceTypesPagesWithContext same as ListSupportedResourceTypesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ResourceExplorer2) ListSupportedResourceTypesPagesWithContext(ctx aws.Context, input *ListSupportedResourceTypesInput, fn func(*ListSupportedResourceTypesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSupportedResourceTypesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSupportedResourceTypesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSupportedResourceTypesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListTagsForResource -func (c *ResourceExplorer2) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Resource Explorer. -// -// Lists the tags that are attached to the specified resource. -// -// 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 AWS Resource Explorer's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListTagsForResource -func (c *ResourceExplorer2) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *ResourceExplorer2) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListViews = "ListViews" - -// ListViewsRequest generates a "aws/request.Request" representing the -// client's request for the ListViews 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 ListViews for more information on using the ListViews -// 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 ListViewsRequest method. -// req, resp := client.ListViewsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListViews -func (c *ResourceExplorer2) ListViewsRequest(input *ListViewsInput) (req *request.Request, output *ListViewsOutput) { - op := &request.Operation{ - Name: opListViews, - HTTPMethod: "POST", - HTTPPath: "/ListViews", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListViewsInput{} - } - - output = &ListViewsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListViews API operation for AWS Resource Explorer. -// -// Lists the Amazon resource names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) -// of the views available in the Amazon Web Services Region in which you call -// this operation. -// -// Always check the NextToken response parameter for a null value when calling -// a paginated operation. These operations can occasionally return an empty -// set of results even when there are more results available. The NextToken -// response parameter value is null only when there are no more results to display. -// -// 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 AWS Resource Explorer's -// API operation ListViews for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/ListViews -func (c *ResourceExplorer2) ListViews(input *ListViewsInput) (*ListViewsOutput, error) { - req, out := c.ListViewsRequest(input) - return out, req.Send() -} - -// ListViewsWithContext is the same as ListViews with the addition of -// the ability to pass a context and additional request options. -// -// See ListViews 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 *ResourceExplorer2) ListViewsWithContext(ctx aws.Context, input *ListViewsInput, opts ...request.Option) (*ListViewsOutput, error) { - req, out := c.ListViewsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListViewsPages iterates over the pages of a ListViews operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListViews method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListViews operation. -// pageNum := 0 -// err := client.ListViewsPages(params, -// func(page *resourceexplorer2.ListViewsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceExplorer2) ListViewsPages(input *ListViewsInput, fn func(*ListViewsOutput, bool) bool) error { - return c.ListViewsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListViewsPagesWithContext same as ListViewsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ResourceExplorer2) ListViewsPagesWithContext(ctx aws.Context, input *ListViewsInput, fn func(*ListViewsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListViewsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListViewsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListViewsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearch = "Search" - -// SearchRequest generates a "aws/request.Request" representing the -// client's request for the Search 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 Search for more information on using the Search -// 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 SearchRequest method. -// req, resp := client.SearchRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/Search -func (c *ResourceExplorer2) SearchRequest(input *SearchInput) (req *request.Request, output *SearchOutput) { - op := &request.Operation{ - Name: opSearch, - HTTPMethod: "POST", - HTTPPath: "/Search", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchInput{} - } - - output = &SearchOutput{} - req = c.newRequest(op, input, output) - return -} - -// Search API operation for AWS Resource Explorer. -// -// Searches for resources and displays details about all resources that match -// the specified criteria. You must specify a query string. -// -// All search queries must use a view. If you don't explicitly specify a view, -// then Amazon Web Services Resource Explorer uses the default view for the -// Amazon Web Services Region in which you call this operation. The results -// are the logical intersection of the results that match both the QueryString -// parameter supplied to this operation and the SearchFilter parameter attached -// to the view. -// -// For the complete syntax supported by the QueryString parameter, see Search -// query syntax reference for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/APIReference/about-query-syntax.html). -// -// If your search results are empty, or are missing results that you think should -// be there, see Troubleshooting Resource Explorer search (https://docs.aws.amazon.com/resource-explorer/latest/userguide/troubleshooting_search.html). -// -// 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 AWS Resource Explorer's -// API operation Search for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/Search -func (c *ResourceExplorer2) Search(input *SearchInput) (*SearchOutput, error) { - req, out := c.SearchRequest(input) - return out, req.Send() -} - -// SearchWithContext is the same as Search with the addition of -// the ability to pass a context and additional request options. -// -// See Search 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 *ResourceExplorer2) SearchWithContext(ctx aws.Context, input *SearchInput, opts ...request.Option) (*SearchOutput, error) { - req, out := c.SearchRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchPages iterates over the pages of a Search operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See Search method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a Search operation. -// pageNum := 0 -// err := client.SearchPages(params, -// func(page *resourceexplorer2.SearchOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceExplorer2) SearchPages(input *SearchInput, fn func(*SearchOutput, bool) bool) error { - return c.SearchPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchPagesWithContext same as SearchPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *ResourceExplorer2) SearchPagesWithContext(ctx aws.Context, input *SearchInput, fn func(*SearchOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/TagResource -func (c *ResourceExplorer2) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Resource Explorer. -// -// Adds one or more tag key and value pairs to an Amazon Web Services Resource -// Explorer view or index. -// -// 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 AWS Resource Explorer's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ConflictException -// If you attempted to create a view, then the request failed because either -// you specified parameters that didn’t match the original request, or you -// attempted to create a view with a name that already exists in this Amazon -// Web Services Region. -// -// If you attempted to create an index, then the request failed because either -// you specified parameters that didn't match the original request, or an index -// already exists in the current Amazon Web Services Region. -// -// If you attempted to update an index type to AGGREGATOR, then the request -// failed because you already have an AGGREGATOR index in a different Amazon -// Web Services Region. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/TagResource -func (c *ResourceExplorer2) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *ResourceExplorer2) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/UntagResource -func (c *ResourceExplorer2) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Resource Explorer. -// -// Removes one or more tag key and value pairs from an Amazon Web Services Resource -// Explorer view or index. -// -// 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 AWS Resource Explorer's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/UntagResource -func (c *ResourceExplorer2) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *ResourceExplorer2) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateIndexType = "UpdateIndexType" - -// UpdateIndexTypeRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIndexType 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 UpdateIndexType for more information on using the UpdateIndexType -// 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 UpdateIndexTypeRequest method. -// req, resp := client.UpdateIndexTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/UpdateIndexType -func (c *ResourceExplorer2) UpdateIndexTypeRequest(input *UpdateIndexTypeInput) (req *request.Request, output *UpdateIndexTypeOutput) { - op := &request.Operation{ - Name: opUpdateIndexType, - HTTPMethod: "POST", - HTTPPath: "/UpdateIndexType", - } - - if input == nil { - input = &UpdateIndexTypeInput{} - } - - output = &UpdateIndexTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIndexType API operation for AWS Resource Explorer. -// -// Changes the type of the index from one of the following types to the other. -// For more information about indexes and the role they perform in Amazon Web -// Services Resource Explorer, see Turning on cross-Region search by creating -// an aggregator index (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html) -// in the Amazon Web Services Resource Explorer User Guide. -// -// - AGGREGATOR index type The index contains information about resources -// from all Amazon Web Services Regions in the Amazon Web Services account -// in which you've created a Resource Explorer index. Resource information -// from all other Regions is replicated to this Region's index. When you -// change the index type to AGGREGATOR, Resource Explorer turns on replication -// of all discovered resource information from the other Amazon Web Services -// Regions in your account to this index. You can then, from this Region -// only, perform resource search queries that span all Amazon Web Services -// Regions in the Amazon Web Services account. Turning on replication from -// all other Regions is performed by asynchronous background tasks. You can -// check the status of the asynchronous tasks by using the GetIndex operation. -// When the asynchronous tasks complete, the Status response of that operation -// changes from UPDATING to ACTIVE. After that, you can start to see results -// from other Amazon Web Services Regions in query results. However, it can -// take several hours for replication from all other Regions to complete. -// You can have only one aggregator index per Amazon Web Services account. -// Before you can promote a different index to be the aggregator index for -// the account, you must first demote the existing aggregator index to type -// LOCAL. -// -// - LOCAL index type The index contains information about resources in only -// the Amazon Web Services Region in which the index exists. If an aggregator -// index in another Region exists, then information in this local index is -// replicated to the aggregator index. When you change the index type to -// LOCAL, Resource Explorer turns off the replication of resource information -// from all other Amazon Web Services Regions in the Amazon Web Services -// account to this Region. The aggregator index remains in the UPDATING state -// until all replication with other Regions successfully stops. You can check -// the status of the asynchronous task by using the GetIndex operation. When -// Resource Explorer successfully stops all replication with other Regions, -// the Status response of that operation changes from UPDATING to ACTIVE. -// Separately, the resource information from other Regions that was previously -// stored in the index is deleted within 30 days by another background task. -// Until that asynchronous task completes, some results from other Regions -// can continue to appear in search results. After you demote an aggregator -// index to a local index, you must wait 24 hours before you can promote -// another index to be the new aggregator index for the account. -// -// 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 AWS Resource Explorer's -// API operation UpdateIndexType for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ConflictException -// If you attempted to create a view, then the request failed because either -// you specified parameters that didn’t match the original request, or you -// attempted to create a view with a name that already exists in this Amazon -// Web Services Region. -// -// If you attempted to create an index, then the request failed because either -// you specified parameters that didn't match the original request, or an index -// already exists in the current Amazon Web Services Region. -// -// If you attempted to update an index type to AGGREGATOR, then the request -// failed because you already have an AGGREGATOR index in a different Amazon -// Web Services Region. -// -// - ServiceQuotaExceededException -// The request failed because it exceeds a service quota. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/UpdateIndexType -func (c *ResourceExplorer2) UpdateIndexType(input *UpdateIndexTypeInput) (*UpdateIndexTypeOutput, error) { - req, out := c.UpdateIndexTypeRequest(input) - return out, req.Send() -} - -// UpdateIndexTypeWithContext is the same as UpdateIndexType with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateIndexType 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 *ResourceExplorer2) UpdateIndexTypeWithContext(ctx aws.Context, input *UpdateIndexTypeInput, opts ...request.Option) (*UpdateIndexTypeOutput, error) { - req, out := c.UpdateIndexTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateView = "UpdateView" - -// UpdateViewRequest generates a "aws/request.Request" representing the -// client's request for the UpdateView 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 UpdateView for more information on using the UpdateView -// 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 UpdateViewRequest method. -// req, resp := client.UpdateViewRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/UpdateView -func (c *ResourceExplorer2) UpdateViewRequest(input *UpdateViewInput) (req *request.Request, output *UpdateViewOutput) { - op := &request.Operation{ - Name: opUpdateView, - HTTPMethod: "POST", - HTTPPath: "/UpdateView", - } - - if input == nil { - input = &UpdateViewInput{} - } - - output = &UpdateViewOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateView API operation for AWS Resource Explorer. -// -// Modifies some of the details of a view. You can change the filter string -// and the list of included properties. You can't change the name of the view. -// -// 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 AWS Resource Explorer's -// API operation UpdateView for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// The request failed because of internal service error. Try your request again -// later. -// -// - ValidationException -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -// -// - ServiceQuotaExceededException -// The request failed because it exceeds a service quota. -// -// - UnauthorizedException -// The principal making the request isn't permitted to perform the operation. -// -// - ThrottlingException -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -// -// - AccessDeniedException -// The credentials that you used to call this operation don't have the minimum -// required permissions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28/UpdateView -func (c *ResourceExplorer2) UpdateView(input *UpdateViewInput) (*UpdateViewOutput, error) { - req, out := c.UpdateViewRequest(input) - return out, req.Send() -} - -// UpdateViewWithContext is the same as UpdateView with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateView 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 *ResourceExplorer2) UpdateViewWithContext(ctx aws.Context, input *UpdateViewInput, opts ...request.Option) (*UpdateViewOutput, error) { - req, out := c.UpdateViewRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// The credentials that you used to call this operation don't have the minimum -// required permissions. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type AssociateDefaultViewInput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view to set as the default for the Amazon Web Services Region and - // Amazon Web Services account in which you call this operation. The specified - // view must already exist in the called Region. - // - // ViewArn is a required field - ViewArn *string `min:"1" 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 AssociateDefaultViewInput) 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 AssociateDefaultViewInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateDefaultViewInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateDefaultViewInput"} - if s.ViewArn == nil { - invalidParams.Add(request.NewErrParamRequired("ViewArn")) - } - if s.ViewArn != nil && len(*s.ViewArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ViewArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetViewArn sets the ViewArn field's value. -func (s *AssociateDefaultViewInput) SetViewArn(v string) *AssociateDefaultViewInput { - s.ViewArn = &v - return s -} - -type AssociateDefaultViewOutput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view that the operation set as the default for queries made in the - // Amazon Web Services Region and Amazon Web Services account in which you called - // this operation. - ViewArn *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 AssociateDefaultViewOutput) 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 AssociateDefaultViewOutput) GoString() string { - return s.String() -} - -// SetViewArn sets the ViewArn field's value. -func (s *AssociateDefaultViewOutput) SetViewArn(v string) *AssociateDefaultViewOutput { - s.ViewArn = &v - return s -} - -// A collection of error messages for any views that Amazon Web Services Resource -// Explorer couldn't retrieve details. -type BatchGetViewError struct { - _ struct{} `type:"structure"` - - // The description of the error for the specified view. - // - // ErrorMessage is a required field - ErrorMessage *string `type:"string" required:"true"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view for which Resource Explorer failed to retrieve details. - // - // ViewArn is a required field - ViewArn *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 BatchGetViewError) 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 BatchGetViewError) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *BatchGetViewError) SetErrorMessage(v string) *BatchGetViewError { - s.ErrorMessage = &v - return s -} - -// SetViewArn sets the ViewArn field's value. -func (s *BatchGetViewError) SetViewArn(v string) *BatchGetViewError { - s.ViewArn = &v - return s -} - -type BatchGetViewInput struct { - _ struct{} `type:"structure"` - - // A list of Amazon resource names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // that identify the views you want details for. - ViewArns []*string `min:"1" type:"list"` -} - -// 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 BatchGetViewInput) 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 BatchGetViewInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetViewInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetViewInput"} - if s.ViewArns != nil && len(s.ViewArns) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ViewArns", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetViewArns sets the ViewArns field's value. -func (s *BatchGetViewInput) SetViewArns(v []*string) *BatchGetViewInput { - s.ViewArns = v - return s -} - -type BatchGetViewOutput struct { - _ struct{} `type:"structure"` - - // If any of the specified ARNs result in an error, then this structure describes - // the error. - Errors []*BatchGetViewError `type:"list"` - - // A structure with a list of objects with details for each of the specified - // views. - Views []*View `type:"list"` -} - -// 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 BatchGetViewOutput) 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 BatchGetViewOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchGetViewOutput) SetErrors(v []*BatchGetViewError) *BatchGetViewOutput { - s.Errors = v - return s -} - -// SetViews sets the Views field's value. -func (s *BatchGetViewOutput) SetViews(v []*View) *BatchGetViewOutput { - s.Views = v - return s -} - -// If you attempted to create a view, then the request failed because either -// you specified parameters that didn’t match the original request, or you -// attempted to create a view with a name that already exists in this Amazon -// Web Services Region. -// -// If you attempted to create an index, then the request failed because either -// you specified parameters that didn't match the original request, or an index -// already exists in the current Amazon Web Services Region. -// -// If you attempted to update an index type to AGGREGATOR, then the request -// failed because you already have an AGGREGATOR index in a different Amazon -// Web Services Region. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateIndexInput struct { - _ struct{} `type:"structure"` - - // This value helps ensure idempotency. Resource Explorer uses this value to - // prevent the accidental creation of duplicate versions. We recommend that - // you generate a UUID-type value (https://wikipedia.org/wiki/Universally_unique_identifier) - // to ensure the uniqueness of your index. - ClientToken *string `type:"string" idempotencyToken:"true"` - - // The specified tags are attached only to the index created in this Amazon - // Web Services Region. The tags aren't attached to any of the resources listed - // in the index. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateIndexInput's - // String and GoString methods. - Tags map[string]*string `type:"map" sensitive:"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 CreateIndexInput) 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 CreateIndexInput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateIndexInput) SetClientToken(v string) *CreateIndexInput { - s.ClientToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateIndexInput) SetTags(v map[string]*string) *CreateIndexInput { - s.Tags = v - return s -} - -type CreateIndexOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the new local index for the Region. You can reference this ARN - // in IAM permission policies to authorize the following operations: DeleteIndex - // | GetIndex | UpdateIndexType | CreateView - Arn *string `type:"string"` - - // The date and timestamp when the index was created. - CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates the current state of the index. You can check for changes to the - // state for asynchronous operations by calling the GetIndex operation. - // - // The state can remain in the CREATING or UPDATING state for several hours - // as Resource Explorer discovers the information about your resources and populates - // the index. - State *string `type:"string" enum:"IndexState"` -} - -// 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 CreateIndexOutput) 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 CreateIndexOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateIndexOutput) SetArn(v string) *CreateIndexOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CreateIndexOutput) SetCreatedAt(v time.Time) *CreateIndexOutput { - s.CreatedAt = &v - return s -} - -// SetState sets the State field's value. -func (s *CreateIndexOutput) SetState(v string) *CreateIndexOutput { - s.State = &v - return s -} - -type CreateViewInput struct { - _ struct{} `type:"structure"` - - // This value helps ensure idempotency. Resource Explorer uses this value to - // prevent the accidental creation of duplicate versions. We recommend that - // you generate a UUID-type value (https://wikipedia.org/wiki/Universally_unique_identifier) - // to ensure the uniqueness of your views. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // An array of strings that specify which resources are included in the results - // of queries made using this view. When you use this view in a Search operation, - // the filter string is combined with the search's QueryString parameter using - // a logical AND operator. - // - // For information about the supported syntax, see Search query reference for - // Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html) - // in the Amazon Web Services Resource Explorer User Guide. - // - // This query string in the context of this operation supports only filter prefixes - // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters) - // with optional operators (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators). - // It doesn't support free-form text. For example, the string region:us* service:ec2 - // -tag:stage=prod includes all Amazon EC2 resources in any Amazon Web Services - // Region that begins with the letters us and is not tagged with a key Stage - // that has the value prod. - // - // Filters is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateViewInput's - // String and GoString methods. - Filters *SearchFilter `type:"structure" sensitive:"true"` - - // Specifies optional fields that you want included in search results from this - // view. It is a list of objects that each describe a field to include. - // - // The default is an empty list, with no optional fields included in the results. - IncludedProperties []*IncludedProperty `type:"list"` - - // The root ARN of the account, an organizational unit (OU), or an organization - // ARN. If left empty, the default is account. - Scope *string `min:"1" type:"string"` - - // Tag key and value pairs that are attached to the view. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateViewInput's - // String and GoString methods. - Tags map[string]*string `type:"map" sensitive:"true"` - - // The name of the new view. This name appears in the list of views in Resource - // Explorer. - // - // The name must be no more than 64 characters long, and can include letters, - // digits, and the dash (-) character. The name must be unique within its Amazon - // Web Services Region. - // - // ViewName is a required field - ViewName *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 CreateViewInput) 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 CreateViewInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateViewInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateViewInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Scope != nil && len(*s.Scope) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Scope", 1)) - } - if s.ViewName == nil { - invalidParams.Add(request.NewErrParamRequired("ViewName")) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } - } - if s.IncludedProperties != nil { - for i, v := range s.IncludedProperties { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "IncludedProperties", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateViewInput) SetClientToken(v string) *CreateViewInput { - s.ClientToken = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *CreateViewInput) SetFilters(v *SearchFilter) *CreateViewInput { - s.Filters = v - return s -} - -// SetIncludedProperties sets the IncludedProperties field's value. -func (s *CreateViewInput) SetIncludedProperties(v []*IncludedProperty) *CreateViewInput { - s.IncludedProperties = v - return s -} - -// SetScope sets the Scope field's value. -func (s *CreateViewInput) SetScope(v string) *CreateViewInput { - s.Scope = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateViewInput) SetTags(v map[string]*string) *CreateViewInput { - s.Tags = v - return s -} - -// SetViewName sets the ViewName field's value. -func (s *CreateViewInput) SetViewName(v string) *CreateViewInput { - s.ViewName = &v - return s -} - -type CreateViewOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains the details about the new view. - View *View `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 CreateViewOutput) 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 CreateViewOutput) GoString() string { - return s.String() -} - -// SetView sets the View field's value. -func (s *CreateViewOutput) SetView(v *View) *CreateViewOutput { - s.View = v - return s -} - -type DeleteIndexInput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the index that you want to delete. - // - // Arn is a required field - Arn *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 DeleteIndexInput) 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 DeleteIndexInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIndexInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIndexInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *DeleteIndexInput) SetArn(v string) *DeleteIndexInput { - s.Arn = &v - return s -} - -type DeleteIndexOutput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the index that you successfully started the deletion process. - // - // This operation is asynchronous. To check its status, call the GetIndex operation. - Arn *string `type:"string"` - - // The date and time when you last updated this index. - LastUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates the current state of the index. - State *string `type:"string" enum:"IndexState"` -} - -// 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 DeleteIndexOutput) 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 DeleteIndexOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteIndexOutput) SetArn(v string) *DeleteIndexOutput { - s.Arn = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *DeleteIndexOutput) SetLastUpdatedAt(v time.Time) *DeleteIndexOutput { - s.LastUpdatedAt = &v - return s -} - -// SetState sets the State field's value. -func (s *DeleteIndexOutput) SetState(v string) *DeleteIndexOutput { - s.State = &v - return s -} - -type DeleteViewInput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view that you want to delete. - // - // ViewArn is a required field - ViewArn *string `min:"1" 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 DeleteViewInput) 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 DeleteViewInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteViewInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteViewInput"} - if s.ViewArn == nil { - invalidParams.Add(request.NewErrParamRequired("ViewArn")) - } - if s.ViewArn != nil && len(*s.ViewArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ViewArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetViewArn sets the ViewArn field's value. -func (s *DeleteViewInput) SetViewArn(v string) *DeleteViewInput { - s.ViewArn = &v - return s -} - -type DeleteViewOutput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view that you successfully deleted. - ViewArn *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 DeleteViewOutput) 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 DeleteViewOutput) GoString() string { - return s.String() -} - -// SetViewArn sets the ViewArn field's value. -func (s *DeleteViewOutput) SetViewArn(v string) *DeleteViewOutput { - s.ViewArn = &v - return s -} - -type DisassociateDefaultViewInput struct { - _ struct{} `type:"structure" nopayload:"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 DisassociateDefaultViewInput) 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 DisassociateDefaultViewInput) GoString() string { - return s.String() -} - -type DisassociateDefaultViewOutput 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 DisassociateDefaultViewOutput) 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 DisassociateDefaultViewOutput) GoString() string { - return s.String() -} - -type GetAccountLevelServiceConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"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 GetAccountLevelServiceConfigurationInput) 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 GetAccountLevelServiceConfigurationInput) GoString() string { - return s.String() -} - -type GetAccountLevelServiceConfigurationOutput struct { - _ struct{} `type:"structure"` - - // Details about the organization, and whether configuration is ENABLED or DISABLED. - OrgConfiguration *OrgConfiguration `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 GetAccountLevelServiceConfigurationOutput) 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 GetAccountLevelServiceConfigurationOutput) GoString() string { - return s.String() -} - -// SetOrgConfiguration sets the OrgConfiguration field's value. -func (s *GetAccountLevelServiceConfigurationOutput) SetOrgConfiguration(v *OrgConfiguration) *GetAccountLevelServiceConfigurationOutput { - s.OrgConfiguration = v - return s -} - -type GetDefaultViewInput struct { - _ struct{} `type:"structure" nopayload:"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 GetDefaultViewInput) 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 GetDefaultViewInput) GoString() string { - return s.String() -} - -type GetDefaultViewOutput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view that is the current default for the Amazon Web Services Region - // in which you called this operation. - ViewArn *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 GetDefaultViewOutput) 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 GetDefaultViewOutput) GoString() string { - return s.String() -} - -// SetViewArn sets the ViewArn field's value. -func (s *GetDefaultViewOutput) SetViewArn(v string) *GetDefaultViewOutput { - s.ViewArn = &v - return s -} - -type GetIndexInput struct { - _ struct{} `type:"structure" nopayload:"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 GetIndexInput) 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 GetIndexInput) GoString() string { - return s.String() -} - -type GetIndexOutput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the index. - Arn *string `type:"string"` - - // The date and time when the index was originally created. - CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The date and time when the index was last updated. - LastUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // This response value is present only if this index is Type=AGGREGATOR. - // - // A list of the Amazon Web Services Regions that replicate their content to - // the index in this Region. - ReplicatingFrom []*string `type:"list"` - - // This response value is present only if this index is Type=LOCAL. - // - // The Amazon Web Services Region that contains the aggregator index, if one - // exists. If an aggregator index does exist then the Region in which you called - // this operation replicates its index information to the Region specified in - // this response value. - ReplicatingTo []*string `type:"list"` - - // The current state of the index in this Amazon Web Services Region. - State *string `type:"string" enum:"IndexState"` - - // Tag key and value pairs that are attached to the index. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetIndexOutput's - // String and GoString methods. - Tags map[string]*string `type:"map" sensitive:"true"` - - // The type of the index in this Region. For information about the aggregator - // index and how it differs from a local index, see Turning on cross-Region - // search by creating an aggregator index (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html). - Type *string `type:"string" enum:"IndexType"` -} - -// 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 GetIndexOutput) 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 GetIndexOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetIndexOutput) SetArn(v string) *GetIndexOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetIndexOutput) SetCreatedAt(v time.Time) *GetIndexOutput { - s.CreatedAt = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetIndexOutput) SetLastUpdatedAt(v time.Time) *GetIndexOutput { - s.LastUpdatedAt = &v - return s -} - -// SetReplicatingFrom sets the ReplicatingFrom field's value. -func (s *GetIndexOutput) SetReplicatingFrom(v []*string) *GetIndexOutput { - s.ReplicatingFrom = v - return s -} - -// SetReplicatingTo sets the ReplicatingTo field's value. -func (s *GetIndexOutput) SetReplicatingTo(v []*string) *GetIndexOutput { - s.ReplicatingTo = v - return s -} - -// SetState sets the State field's value. -func (s *GetIndexOutput) SetState(v string) *GetIndexOutput { - s.State = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetIndexOutput) SetTags(v map[string]*string) *GetIndexOutput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *GetIndexOutput) SetType(v string) *GetIndexOutput { - s.Type = &v - return s -} - -type GetViewInput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view that you want information about. - // - // ViewArn is a required field - ViewArn *string `min:"1" 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 GetViewInput) 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 GetViewInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetViewInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetViewInput"} - if s.ViewArn == nil { - invalidParams.Add(request.NewErrParamRequired("ViewArn")) - } - if s.ViewArn != nil && len(*s.ViewArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ViewArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetViewArn sets the ViewArn field's value. -func (s *GetViewInput) SetViewArn(v string) *GetViewInput { - s.ViewArn = &v - return s -} - -type GetViewOutput struct { - _ struct{} `type:"structure"` - - // Tag key and value pairs that are attached to the view. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetViewOutput's - // String and GoString methods. - Tags map[string]*string `type:"map" sensitive:"true"` - - // A structure that contains the details for the requested view. - View *View `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 GetViewOutput) 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 GetViewOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *GetViewOutput) SetTags(v map[string]*string) *GetViewOutput { - s.Tags = v - return s -} - -// SetView sets the View field's value. -func (s *GetViewOutput) SetView(v *View) *GetViewOutput { - s.View = v - return s -} - -// Information about an additional property that describes a resource, that -// you can optionally include in the view. This lets you view that property -// in search results, and filter your search results based on the value of the -// property. -type IncludedProperty struct { - _ struct{} `type:"structure"` - - // The name of the property that is included in this view. - // - // You can specify the following property names for this field: - // - // * Tags - // - // Name is a required field - Name *string `min:"1" 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 IncludedProperty) 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 IncludedProperty) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IncludedProperty) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IncludedProperty"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *IncludedProperty) SetName(v string) *IncludedProperty { - s.Name = &v - return s -} - -// An index is the data store used by Amazon Web Services Resource Explorer -// to hold information about your Amazon Web Services resources that the service -// discovers. Creating an index in an Amazon Web Services Region turns on Resource -// Explorer and lets it discover your resources. -// -// By default, an index is local, meaning that it contains information about -// resources in only the same Region as the index. However, you can promote -// the index of one Region in the account by calling UpdateIndexType to convert -// it into an aggregator index. The aggregator index receives a replicated copy -// of the index information from all other Regions where Resource Explorer is -// turned on. This allows search operations in that Region to return results -// from all Regions in the account. -type Index struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the index. - Arn *string `type:"string"` - - // The Amazon Web Services Region in which the index exists. - Region *string `type:"string"` - - // The type of index. It can be one of the following values: - // - // * LOCAL – The index contains information about resources from only the - // same Amazon Web Services Region. - // - // * AGGREGATOR – Resource Explorer replicates copies of the indexed information - // about resources in all other Amazon Web Services Regions to the aggregator - // index. This lets search results in the Region with the aggregator index - // to include resources from all Regions in the account where Resource Explorer - // is turned on. - Type *string `type:"string" enum:"IndexType"` -} - -// 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 Index) 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 Index) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Index) SetArn(v string) *Index { - s.Arn = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *Index) SetRegion(v string) *Index { - s.Region = &v - return s -} - -// SetType sets the Type field's value. -func (s *Index) SetType(v string) *Index { - s.Type = &v - return s -} - -// The request failed because of internal service error. Try your request again -// later. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListIndexesForMembersInput struct { - _ struct{} `type:"structure"` - - // The account IDs will limit the output to only indexes from these accounts. - // - // AccountIdList is a required field - AccountIdList []*string `min:"1" type:"list" required:"true"` - - // The maximum number of results that you want included on each page of the - // response. If you do not include this parameter, it defaults to a value appropriate - // to the operation. If additional items exist beyond those included in the - // current response, the NextToken response element is present and has a value - // (is not null). Include that value as the NextToken request parameter in the - // next call to the operation to get the next part of the results. - // - // An API operation can return fewer results than the maximum even when there - // are more results available. You should check NextToken after every operation - // to ensure that you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. The - // pagination tokens expire after 24 hours. - NextToken *string `min:"1" 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 ListIndexesForMembersInput) 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 ListIndexesForMembersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIndexesForMembersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIndexesForMembersInput"} - if s.AccountIdList == nil { - invalidParams.Add(request.NewErrParamRequired("AccountIdList")) - } - if s.AccountIdList != nil && len(s.AccountIdList) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AccountIdList", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountIdList sets the AccountIdList field's value. -func (s *ListIndexesForMembersInput) SetAccountIdList(v []*string) *ListIndexesForMembersInput { - s.AccountIdList = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIndexesForMembersInput) SetMaxResults(v int64) *ListIndexesForMembersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIndexesForMembersInput) SetNextToken(v string) *ListIndexesForMembersInput { - s.NextToken = &v - return s -} - -type ListIndexesForMembersOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains the details and status of each index. - Indexes []*MemberIndex `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - // The pagination tokens expire after 24 hours. - NextToken *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 ListIndexesForMembersOutput) 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 ListIndexesForMembersOutput) GoString() string { - return s.String() -} - -// SetIndexes sets the Indexes field's value. -func (s *ListIndexesForMembersOutput) SetIndexes(v []*MemberIndex) *ListIndexesForMembersOutput { - s.Indexes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIndexesForMembersOutput) SetNextToken(v string) *ListIndexesForMembersOutput { - s.NextToken = &v - return s -} - -type ListIndexesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results that you want included on each page of the - // response. If you do not include this parameter, it defaults to a value appropriate - // to the operation. If additional items exist beyond those included in the - // current response, the NextToken response element is present and has a value - // (is not null). Include that value as the NextToken request parameter in the - // next call to the operation to get the next part of the results. - // - // An API operation can return fewer results than the maximum even when there - // are more results available. You should check NextToken after every operation - // to ensure that you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. The - // pagination tokens expire after 24 hours. - NextToken *string `min:"1" type:"string"` - - // If specified, limits the response to only information about the index in - // the specified list of Amazon Web Services Regions. - Regions []*string `type:"list"` - - // If specified, limits the output to only indexes of the specified Type, either - // LOCAL or AGGREGATOR. - // - // Use this option to discover the aggregator index for your account. - Type *string `type:"string" enum:"IndexType"` -} - -// 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 ListIndexesInput) 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 ListIndexesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIndexesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIndexesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIndexesInput) SetMaxResults(v int64) *ListIndexesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIndexesInput) SetNextToken(v string) *ListIndexesInput { - s.NextToken = &v - return s -} - -// SetRegions sets the Regions field's value. -func (s *ListIndexesInput) SetRegions(v []*string) *ListIndexesInput { - s.Regions = v - return s -} - -// SetType sets the Type field's value. -func (s *ListIndexesInput) SetType(v string) *ListIndexesInput { - s.Type = &v - return s -} - -type ListIndexesOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains the details and status of each index. - Indexes []*Index `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - // The pagination tokens expire after 24 hours. - NextToken *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 ListIndexesOutput) 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 ListIndexesOutput) GoString() string { - return s.String() -} - -// SetIndexes sets the Indexes field's value. -func (s *ListIndexesOutput) SetIndexes(v []*Index) *ListIndexesOutput { - s.Indexes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIndexesOutput) SetNextToken(v string) *ListIndexesOutput { - s.NextToken = &v - return s -} - -type ListSupportedResourceTypesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results that you want included on each page of the - // response. If you do not include this parameter, it defaults to a value appropriate - // to the operation. If additional items exist beyond those included in the - // current response, the NextToken response element is present and has a value - // (is not null). Include that value as the NextToken request parameter in the - // next call to the operation to get the next part of the results. - // - // An API operation can return fewer results than the maximum even when there - // are more results available. You should check NextToken after every operation - // to ensure that you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. The - // pagination tokens expire after 24 hours. - NextToken *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 ListSupportedResourceTypesInput) 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 ListSupportedResourceTypesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSupportedResourceTypesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSupportedResourceTypesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSupportedResourceTypesInput) SetMaxResults(v int64) *ListSupportedResourceTypesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSupportedResourceTypesInput) SetNextToken(v string) *ListSupportedResourceTypesInput { - s.NextToken = &v - return s -} - -type ListSupportedResourceTypesOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - // The pagination tokens expire after 24 hours. - NextToken *string `type:"string"` - - // The list of resource types supported by Resource Explorer. - ResourceTypes []*SupportedResourceType `type:"list"` -} - -// 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 ListSupportedResourceTypesOutput) 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 ListSupportedResourceTypesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSupportedResourceTypesOutput) SetNextToken(v string) *ListSupportedResourceTypesOutput { - s.NextToken = &v - return s -} - -// SetResourceTypes sets the ResourceTypes field's value. -func (s *ListSupportedResourceTypesOutput) SetResourceTypes(v []*SupportedResourceType) *ListSupportedResourceTypesOutput { - s.ResourceTypes = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view or index that you want to attach tags to. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tag key and value pairs that you want to attach to the specified view - // or index. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListTagsForResourceOutput's - // String and GoString methods. - Tags map[string]*string `type:"map" sensitive:"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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListViewsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results that you want included on each page of the - // response. If you do not include this parameter, it defaults to a value appropriate - // to the operation. If additional items exist beyond those included in the - // current response, the NextToken response element is present and has a value - // (is not null). Include that value as the NextToken request parameter in the - // next call to the operation to get the next part of the results. - // - // An API operation can return fewer results than the maximum even when there - // are more results available. You should check NextToken after every operation - // to ensure that you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. The - // pagination tokens expire after 24 hours. - NextToken *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 ListViewsInput) 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 ListViewsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListViewsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListViewsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListViewsInput) SetMaxResults(v int64) *ListViewsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListViewsInput) SetNextToken(v string) *ListViewsInput { - s.NextToken = &v - return s -} - -type ListViewsOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - // The pagination tokens expire after 24 hours. - NextToken *string `type:"string"` - - // The list of views available in the Amazon Web Services Region in which you - // called this operation. - Views []*string `type:"list"` -} - -// 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 ListViewsOutput) 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 ListViewsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListViewsOutput) SetNextToken(v string) *ListViewsOutput { - s.NextToken = &v - return s -} - -// SetViews sets the Views field's value. -func (s *ListViewsOutput) SetViews(v []*string) *ListViewsOutput { - s.Views = v - return s -} - -// An index is the data store used by Amazon Web Services Resource Explorer -// to hold information about your Amazon Web Services resources that the service -// discovers. -type MemberIndex struct { - _ struct{} `type:"structure"` - - // The account ID for the index. - AccountId *string `type:"string"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the index. - Arn *string `type:"string"` - - // The Amazon Web Services Region in which the index exists. - Region *string `type:"string"` - - // The type of index. It can be one of the following values: - // - // * LOCAL – The index contains information about resources from only the - // same Amazon Web Services Region. - // - // * AGGREGATOR – Resource Explorer replicates copies of the indexed information - // about resources in all other Amazon Web Services Regions to the aggregator - // index. This lets search results in the Region with the aggregator index - // to include resources from all Regions in the account where Resource Explorer - // is turned on. - Type *string `type:"string" enum:"IndexType"` -} - -// 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 MemberIndex) 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 MemberIndex) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *MemberIndex) SetAccountId(v string) *MemberIndex { - s.AccountId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *MemberIndex) SetArn(v string) *MemberIndex { - s.Arn = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *MemberIndex) SetRegion(v string) *MemberIndex { - s.Region = &v - return s -} - -// SetType sets the Type field's value. -func (s *MemberIndex) SetType(v string) *MemberIndex { - s.Type = &v - return s -} - -// This is a structure that contains the status of Amazon Web Services service -// access, and whether you have a valid service-linked role to enable multi-account -// search for your organization. -type OrgConfiguration struct { - _ struct{} `type:"structure"` - - // This value displays whether your Amazon Web Services service access is ENABLED - // or DISABLED. - // - // AWSServiceAccessStatus is a required field - AWSServiceAccessStatus *string `type:"string" required:"true" enum:"AWSServiceAccessStatus"` - - // This value shows whether or not you have a valid a service-linked role required - // to start the multi-account search feature. - ServiceLinkedRole *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 OrgConfiguration) 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 OrgConfiguration) GoString() string { - return s.String() -} - -// SetAWSServiceAccessStatus sets the AWSServiceAccessStatus field's value. -func (s *OrgConfiguration) SetAWSServiceAccessStatus(v string) *OrgConfiguration { - s.AWSServiceAccessStatus = &v - return s -} - -// SetServiceLinkedRole sets the ServiceLinkedRole field's value. -func (s *OrgConfiguration) SetServiceLinkedRole(v string) *OrgConfiguration { - s.ServiceLinkedRole = &v - return s -} - -// A resource in Amazon Web Services that Amazon Web Services Resource Explorer -// has discovered, and for which it has stored information in the index of the -// Amazon Web Services Region that contains the resource. -type Resource struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the resource. - Arn *string `type:"string"` - - // The date and time that Resource Explorer last queried this resource and updated - // the index with the latest information about the resource. - LastReportedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Web Services account that owns the resource. - OwningAccountId *string `type:"string"` - - // A structure with additional type-specific details about the resource. These - // properties can be added by turning on integration between Resource Explorer - // and other Amazon Web Services services. - Properties []*ResourceProperty `type:"list"` - - // The Amazon Web Services Region in which the resource was created and exists. - Region *string `type:"string"` - - // The type of the resource. - ResourceType *string `type:"string"` - - // The Amazon Web Service that owns the resource and is responsible for creating - // and updating it. - Service *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 Resource) 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 Resource) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Resource) SetArn(v string) *Resource { - s.Arn = &v - return s -} - -// SetLastReportedAt sets the LastReportedAt field's value. -func (s *Resource) SetLastReportedAt(v time.Time) *Resource { - s.LastReportedAt = &v - return s -} - -// SetOwningAccountId sets the OwningAccountId field's value. -func (s *Resource) SetOwningAccountId(v string) *Resource { - s.OwningAccountId = &v - return s -} - -// SetProperties sets the Properties field's value. -func (s *Resource) SetProperties(v []*ResourceProperty) *Resource { - s.Properties = v - return s -} - -// SetRegion sets the Region field's value. -func (s *Resource) SetRegion(v string) *Resource { - s.Region = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Resource) SetResourceType(v string) *Resource { - s.ResourceType = &v - return s -} - -// SetService sets the Service field's value. -func (s *Resource) SetService(v string) *Resource { - s.Service = &v - return s -} - -// Information about the number of results that match the query. At this time, -// Amazon Web Services Resource Explorer doesn't count more than 1,000 matches -// for any query. This structure provides information about whether the query -// exceeded this limit. -// -// This field is included in every page when you paginate the results. -type ResourceCount struct { - _ struct{} `type:"structure"` - - // Indicates whether the TotalResources value represents an exhaustive count - // of search results. - // - // * If True, it indicates that the search was exhaustive. Every resource - // that matches the query was counted. - // - // * If False, then the search reached the limit of 1,000 matching results, - // and stopped counting. - Complete *bool `type:"boolean"` - - // The number of resources that match the search query. This value can't exceed - // 1,000. If there are more than 1,000 resources that match the query, then - // only 1,000 are counted and the Complete field is set to false. We recommend - // that you refine your query to return a smaller number of results. - TotalResources *int64 `type:"long"` -} - -// 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 ResourceCount) 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 ResourceCount) GoString() string { - return s.String() -} - -// SetComplete sets the Complete field's value. -func (s *ResourceCount) SetComplete(v bool) *ResourceCount { - s.Complete = &v - return s -} - -// SetTotalResources sets the TotalResources field's value. -func (s *ResourceCount) SetTotalResources(v int64) *ResourceCount { - s.TotalResources = &v - return s -} - -// You specified a resource that doesn't exist. Check the ID or ARN that you -// used to identity the resource, and try again. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A structure that describes a property of a resource. -type ResourceProperty struct { - _ struct{} `type:"structure"` - - // The date and time that the information about this resource property was last - // updated. - LastReportedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The name of this property of the resource. - Name *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 ResourceProperty) 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 ResourceProperty) GoString() string { - return s.String() -} - -// SetLastReportedAt sets the LastReportedAt field's value. -func (s *ResourceProperty) SetLastReportedAt(v time.Time) *ResourceProperty { - s.LastReportedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *ResourceProperty) SetName(v string) *ResourceProperty { - s.Name = &v - return s -} - -// A search filter defines which resources can be part of a search query result -// set. -type SearchFilter struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The string that contains the search keywords, prefixes, and operators to - // control the results that can be returned by a Search operation. For more - // details, see Search query syntax (https://docs.aws.amazon.com/resource-explorer/latest/APIReference/about-query-syntax.html). - // - // FilterString is a required field - FilterString *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 SearchFilter) 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 SearchFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchFilter"} - if s.FilterString == nil { - invalidParams.Add(request.NewErrParamRequired("FilterString")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilterString sets the FilterString field's value. -func (s *SearchFilter) SetFilterString(v string) *SearchFilter { - s.FilterString = &v - return s -} - -type SearchInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results that you want included on each page of the - // response. If you do not include this parameter, it defaults to a value appropriate - // to the operation. If additional items exist beyond those included in the - // current response, the NextToken response element is present and has a value - // (is not null). Include that value as the NextToken request parameter in the - // next call to the operation to get the next part of the results. - // - // An API operation can return fewer results than the maximum even when there - // are more results available. You should check NextToken after every operation - // to ensure that you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. The - // pagination tokens expire after 24 hours. - NextToken *string `min:"1" type:"string"` - - // A string that includes keywords and filters that specify the resources that - // you want to include in the results. - // - // For the complete syntax supported by the QueryString parameter, see Search - // query syntax reference for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html). - // - // The search is completely case insensitive. You can specify an empty string - // to return all results up to the limit of 1,000 total results. - // - // The operation can return only the first 1,000 results. If the resource you - // want is not included, then use a different value for QueryString to refine - // the results. - // - // QueryString is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchInput's - // String and GoString methods. - // - // QueryString is a required field - QueryString *string `type:"string" required:"true" sensitive:"true"` - - // Specifies the Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view to use for the query. If you don't specify a value for this parameter, - // then the operation automatically uses the default view for the Amazon Web - // Services Region in which you called this operation. If the Region either - // doesn't have a default view or if you don't have permission to use the default - // view, then the operation fails with a 401 Unauthorized exception. - ViewArn *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 SearchInput) 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 SearchInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.QueryString == nil { - invalidParams.Add(request.NewErrParamRequired("QueryString")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *SearchInput) SetMaxResults(v int64) *SearchInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchInput) SetNextToken(v string) *SearchInput { - s.NextToken = &v - return s -} - -// SetQueryString sets the QueryString field's value. -func (s *SearchInput) SetQueryString(v string) *SearchInput { - s.QueryString = &v - return s -} - -// SetViewArn sets the ViewArn field's value. -func (s *SearchInput) SetViewArn(v string) *SearchInput { - s.ViewArn = &v - return s -} - -type SearchOutput struct { - _ struct{} `type:"structure"` - - // The number of resources that match the query. - Count *ResourceCount `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - // The pagination tokens expire after 24 hours. - NextToken *string `min:"1" type:"string"` - - // The list of structures that describe the resources that match the query. - Resources []*Resource `type:"list"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view that this operation used to perform the search. - ViewArn *string `min:"1" 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 SearchOutput) 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 SearchOutput) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *SearchOutput) SetCount(v *ResourceCount) *SearchOutput { - s.Count = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchOutput) SetNextToken(v string) *SearchOutput { - s.NextToken = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *SearchOutput) SetResources(v []*Resource) *SearchOutput { - s.Resources = v - return s -} - -// SetViewArn sets the ViewArn field's value. -func (s *SearchOutput) SetViewArn(v string) *SearchOutput { - s.ViewArn = &v - return s -} - -// The request failed because it exceeds a service quota. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // The name of the service quota that was exceeded by the request. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The current value for the quota that the request tried to exceed. - // - // Value is a required field - Value *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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A structure that describes a resource type supported by Amazon Web Services -// Resource Explorer. -type SupportedResourceType struct { - _ struct{} `type:"structure"` - - // The unique identifier of the resource type. - ResourceType *string `type:"string"` - - // The Amazon Web Service that is associated with the resource type. This is - // the primary service that lets you create and interact with resources of this - // type. - Service *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 SupportedResourceType) 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 SupportedResourceType) GoString() string { - return s.String() -} - -// SetResourceType sets the ResourceType field's value. -func (s *SupportedResourceType) SetResourceType(v string) *SupportedResourceType { - s.ResourceType = &v - return s -} - -// SetService sets the Service field's value. -func (s *SupportedResourceType) SetService(v string) *SupportedResourceType { - s.Service = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the view or index that you want to attach - // tags to. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // A list of tag key and value pairs that you want to attach to the specified - // view or index. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TagResourceInput's - // String and GoString methods. - Tags map[string]*string `type:"map" sensitive:"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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request failed because you exceeded a rate limit for this operation. -// For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The principal making the request isn't permitted to perform the operation. -type UnauthorizedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 UnauthorizedException) 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 UnauthorizedException) GoString() string { - return s.String() -} - -func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { - return &UnauthorizedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnauthorizedException) Code() string { - return "UnauthorizedException" -} - -// Message returns the exception's message. -func (s *UnauthorizedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnauthorizedException) OrigErr() error { - return nil -} - -func (s *UnauthorizedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnauthorizedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnauthorizedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the view or index that you want to remove - // tags from. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // A list of the keys for the tags that you want to remove from the specified - // view or index. - // - // TagKeys is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UntagResourceInput's - // String and GoString methods. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" required:"true" sensitive:"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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateIndexTypeInput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the index that you want to update. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The type of the index. To understand the difference between LOCAL and AGGREGATOR, - // see Turning on cross-Region search (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html) - // in the Amazon Web Services Resource Explorer User Guide. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"IndexType"` -} - -// 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 UpdateIndexTypeInput) 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 UpdateIndexTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIndexTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIndexTypeInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *UpdateIndexTypeInput) SetArn(v string) *UpdateIndexTypeInput { - s.Arn = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateIndexTypeInput) SetType(v string) *UpdateIndexTypeInput { - s.Type = &v - return s -} - -type UpdateIndexTypeOutput struct { - _ struct{} `type:"structure"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the index that you updated. - Arn *string `type:"string"` - - // The date and timestamp when the index was last updated. - LastUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates the state of the request to update the index. This operation is - // asynchronous. Call the GetIndex operation to check for changes. - State *string `type:"string" enum:"IndexState"` - - // Specifies the type of the specified index after the operation completes. - Type *string `type:"string" enum:"IndexType"` -} - -// 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 UpdateIndexTypeOutput) 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 UpdateIndexTypeOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateIndexTypeOutput) SetArn(v string) *UpdateIndexTypeOutput { - s.Arn = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *UpdateIndexTypeOutput) SetLastUpdatedAt(v time.Time) *UpdateIndexTypeOutput { - s.LastUpdatedAt = &v - return s -} - -// SetState sets the State field's value. -func (s *UpdateIndexTypeOutput) SetState(v string) *UpdateIndexTypeOutput { - s.State = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateIndexTypeOutput) SetType(v string) *UpdateIndexTypeOutput { - s.Type = &v - return s -} - -type UpdateViewInput struct { - _ struct{} `type:"structure"` - - // An array of strings that specify which resources are included in the results - // of queries made using this view. When you use this view in a Search operation, - // the filter string is combined with the search's QueryString parameter using - // a logical AND operator. - // - // For information about the supported syntax, see Search query reference for - // Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html) - // in the Amazon Web Services Resource Explorer User Guide. - // - // This query string in the context of this operation supports only filter prefixes - // (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters) - // with optional operators (https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators). - // It doesn't support free-form text. For example, the string region:us* service:ec2 - // -tag:stage=prod includes all Amazon EC2 resources in any Amazon Web Services - // Region that begins with the letters us and is not tagged with a key Stage - // that has the value prod. - // - // Filters is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateViewInput's - // String and GoString methods. - Filters *SearchFilter `type:"structure" sensitive:"true"` - - // Specifies optional fields that you want included in search results from this - // view. It is a list of objects that each describe a field to include. - // - // The default is an empty list, with no optional fields included in the results. - IncludedProperties []*IncludedProperty `type:"list"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view that you want to modify. - // - // ViewArn is a required field - ViewArn *string `min:"1" 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 UpdateViewInput) 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 UpdateViewInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateViewInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateViewInput"} - if s.ViewArn == nil { - invalidParams.Add(request.NewErrParamRequired("ViewArn")) - } - if s.ViewArn != nil && len(*s.ViewArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ViewArn", 1)) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } - } - if s.IncludedProperties != nil { - for i, v := range s.IncludedProperties { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "IncludedProperties", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *UpdateViewInput) SetFilters(v *SearchFilter) *UpdateViewInput { - s.Filters = v - return s -} - -// SetIncludedProperties sets the IncludedProperties field's value. -func (s *UpdateViewInput) SetIncludedProperties(v []*IncludedProperty) *UpdateViewInput { - s.IncludedProperties = v - return s -} - -// SetViewArn sets the ViewArn field's value. -func (s *UpdateViewInput) SetViewArn(v string) *UpdateViewInput { - s.ViewArn = &v - return s -} - -type UpdateViewOutput struct { - _ struct{} `type:"structure"` - - // Details about the view that you changed with this operation. - View *View `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 UpdateViewOutput) 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 UpdateViewOutput) GoString() string { - return s.String() -} - -// SetView sets the View field's value. -func (s *UpdateViewOutput) SetView(v *View) *UpdateViewOutput { - s.View = v - return s -} - -// You provided an invalid value for one of the operation's parameters. Check -// the syntax for the operation, and try again. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // An array of the request fields that had validation errors. - FieldList []*ValidationExceptionField `type:"list"` - - Message_ *string `locationName:"Message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A structure that describes a request field with a validation error. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // The name of the request field that had a validation error. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The validation error caused by the request field. - // - // ValidationIssue is a required field - ValidationIssue *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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -// SetValidationIssue sets the ValidationIssue field's value. -func (s *ValidationExceptionField) SetValidationIssue(v string) *ValidationExceptionField { - s.ValidationIssue = &v - return s -} - -// A view is a structure that defines a set of filters that provide a view into -// the information in the Amazon Web Services Resource Explorer index. The filters -// specify which information from the index is visible to the users of the view. -// For example, you can specify filters that include only resources that are -// tagged with the key "ENV" and the value "DEVELOPMENT" in the results returned -// by this view. You could also create a second view that includes only resources -// that are tagged with "ENV" and "PRODUCTION". -type View struct { - _ struct{} `type:"structure"` - - // An array of SearchFilter objects that specify which resources can be included - // in the results of queries made using this view. - // - // Filters is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by View's - // String and GoString methods. - Filters *SearchFilter `type:"structure" sensitive:"true"` - - // A structure that contains additional information about the view. - IncludedProperties []*IncludedProperty `type:"list"` - - // The date and time when this view was last modified. - LastUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Web Services account that owns this view. - Owner *string `type:"string"` - - // An Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of an Amazon Web Services account, an organization, or an organizational - // unit (OU) that specifies whether this view includes resources from only the - // specified Amazon Web Services account, all accounts in the specified organization, - // or all accounts in the specified OU. - // - // If not specified, the value defaults to the Amazon Web Services account used - // to call this operation. - Scope *string `type:"string"` - - // The Amazon resource name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the view. - ViewArn *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 View) 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 View) GoString() string { - return s.String() -} - -// SetFilters sets the Filters field's value. -func (s *View) SetFilters(v *SearchFilter) *View { - s.Filters = v - return s -} - -// SetIncludedProperties sets the IncludedProperties field's value. -func (s *View) SetIncludedProperties(v []*IncludedProperty) *View { - s.IncludedProperties = v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *View) SetLastUpdatedAt(v time.Time) *View { - s.LastUpdatedAt = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *View) SetOwner(v string) *View { - s.Owner = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *View) SetScope(v string) *View { - s.Scope = &v - return s -} - -// SetViewArn sets the ViewArn field's value. -func (s *View) SetViewArn(v string) *View { - s.ViewArn = &v - return s -} - -const ( - // AWSServiceAccessStatusEnabled is a AWSServiceAccessStatus enum value - AWSServiceAccessStatusEnabled = "ENABLED" - - // AWSServiceAccessStatusDisabled is a AWSServiceAccessStatus enum value - AWSServiceAccessStatusDisabled = "DISABLED" -) - -// AWSServiceAccessStatus_Values returns all elements of the AWSServiceAccessStatus enum -func AWSServiceAccessStatus_Values() []string { - return []string{ - AWSServiceAccessStatusEnabled, - AWSServiceAccessStatusDisabled, - } -} - -const ( - // IndexStateCreating is a IndexState enum value - IndexStateCreating = "CREATING" - - // IndexStateActive is a IndexState enum value - IndexStateActive = "ACTIVE" - - // IndexStateDeleting is a IndexState enum value - IndexStateDeleting = "DELETING" - - // IndexStateDeleted is a IndexState enum value - IndexStateDeleted = "DELETED" - - // IndexStateUpdating is a IndexState enum value - IndexStateUpdating = "UPDATING" -) - -// IndexState_Values returns all elements of the IndexState enum -func IndexState_Values() []string { - return []string{ - IndexStateCreating, - IndexStateActive, - IndexStateDeleting, - IndexStateDeleted, - IndexStateUpdating, - } -} - -const ( - // IndexTypeLocal is a IndexType enum value - IndexTypeLocal = "LOCAL" - - // IndexTypeAggregator is a IndexType enum value - IndexTypeAggregator = "AGGREGATOR" -) - -// IndexType_Values returns all elements of the IndexType enum -func IndexType_Values() []string { - return []string{ - IndexTypeLocal, - IndexTypeAggregator, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/doc.go deleted file mode 100644 index 0a1c4b55ecdd..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/doc.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package resourceexplorer2 provides the client and types for making API -// requests to AWS Resource Explorer. -// -// Amazon Web Services Resource Explorer is a resource search and discovery -// service. By using Resource Explorer, you can explore your resources using -// an internet search engine-like experience. Examples of resources include -// Amazon Relational Database Service (Amazon RDS) instances, Amazon Simple -// Storage Service (Amazon S3) buckets, or Amazon DynamoDB tables. You can search -// for your resources using resource metadata like names, tags, and IDs. Resource -// Explorer can search across all of the Amazon Web Services Regions in your -// account in which you turn the service on, to simplify your cross-Region workloads. -// -// Resource Explorer scans the resources in each of the Amazon Web Services -// Regions in your Amazon Web Services account in which you turn on Resource -// Explorer. Resource Explorer creates and maintains an index (https://docs.aws.amazon.com/resource-explorer/latest/userguide/getting-started-terms-and-concepts.html#term-index) -// in each Region, with the details of that Region's resources. -// -// You can search across all of the indexed Regions in your account (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region.html) -// by designating one of your Amazon Web Services Regions to contain the aggregator -// index for the account. When you promote a local index in a Region to become -// the aggregator index for the account (https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-aggregator-region-turn-on.html), -// Resource Explorer automatically replicates the index information from all -// local indexes in the other Regions to the aggregator index. Therefore, the -// Region with the aggregator index has a copy of all resource information for -// all Regions in the account where you turned on Resource Explorer. As a result, -// views in the aggregator index Region include resources from all of the indexed -// Regions in your account. -// -// For more information about Amazon Web Services Resource Explorer, including -// how to enable and configure the service, see the Amazon Web Services Resource -// Explorer User Guide (https://docs.aws.amazon.com/resource-explorer/latest/userguide/). -// -// See https://docs.aws.amazon.com/goto/WebAPI/resource-explorer-2-2022-07-28 for more information on this service. -// -// See resourceexplorer2 package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/resourceexplorer2/ -// -// # Using the Client -// -// To contact AWS Resource Explorer with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Resource Explorer client ResourceExplorer2 for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/resourceexplorer2/#New -package resourceexplorer2 diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/errors.go deleted file mode 100644 index 76964e6a80c0..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/errors.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package resourceexplorer2 - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // The credentials that you used to call this operation don't have the minimum - // required permissions. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // If you attempted to create a view, then the request failed because either - // you specified parameters that didn’t match the original request, or you - // attempted to create a view with a name that already exists in this Amazon - // Web Services Region. - // - // If you attempted to create an index, then the request failed because either - // you specified parameters that didn't match the original request, or an index - // already exists in the current Amazon Web Services Region. - // - // If you attempted to update an index type to AGGREGATOR, then the request - // failed because you already have an AGGREGATOR index in a different Amazon - // Web Services Region. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request failed because of internal service error. Try your request again - // later. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // You specified a resource that doesn't exist. Check the ID or ARN that you - // used to identity the resource, and try again. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request failed because it exceeds a service quota. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request failed because you exceeded a rate limit for this operation. - // For more information, see Quotas for Resource Explorer (https://docs.aws.amazon.com/resource-explorer/latest/userguide/quotas.html). - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeUnauthorizedException for service response error code - // "UnauthorizedException". - // - // The principal making the request isn't permitted to perform the operation. - ErrCodeUnauthorizedException = "UnauthorizedException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // You provided an invalid value for one of the operation's parameters. Check - // the syntax for the operation, and try again. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "UnauthorizedException": newErrorUnauthorizedException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/resourceexplorer2iface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/resourceexplorer2iface/interface.go deleted file mode 100644 index 1e0c2f6b0818..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/resourceexplorer2iface/interface.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package resourceexplorer2iface provides an interface to enable mocking the AWS Resource Explorer service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package resourceexplorer2iface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2" -) - -// ResourceExplorer2API provides an interface to enable mocking the -// resourceexplorer2.ResourceExplorer2 service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Resource Explorer. -// func myFunc(svc resourceexplorer2iface.ResourceExplorer2API) bool { -// // Make svc.AssociateDefaultView request -// } -// -// func main() { -// sess := session.New() -// svc := resourceexplorer2.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockResourceExplorer2Client struct { -// resourceexplorer2iface.ResourceExplorer2API -// } -// func (m *mockResourceExplorer2Client) AssociateDefaultView(input *resourceexplorer2.AssociateDefaultViewInput) (*resourceexplorer2.AssociateDefaultViewOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockResourceExplorer2Client{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type ResourceExplorer2API interface { - AssociateDefaultView(*resourceexplorer2.AssociateDefaultViewInput) (*resourceexplorer2.AssociateDefaultViewOutput, error) - AssociateDefaultViewWithContext(aws.Context, *resourceexplorer2.AssociateDefaultViewInput, ...request.Option) (*resourceexplorer2.AssociateDefaultViewOutput, error) - AssociateDefaultViewRequest(*resourceexplorer2.AssociateDefaultViewInput) (*request.Request, *resourceexplorer2.AssociateDefaultViewOutput) - - BatchGetView(*resourceexplorer2.BatchGetViewInput) (*resourceexplorer2.BatchGetViewOutput, error) - BatchGetViewWithContext(aws.Context, *resourceexplorer2.BatchGetViewInput, ...request.Option) (*resourceexplorer2.BatchGetViewOutput, error) - BatchGetViewRequest(*resourceexplorer2.BatchGetViewInput) (*request.Request, *resourceexplorer2.BatchGetViewOutput) - - CreateIndex(*resourceexplorer2.CreateIndexInput) (*resourceexplorer2.CreateIndexOutput, error) - CreateIndexWithContext(aws.Context, *resourceexplorer2.CreateIndexInput, ...request.Option) (*resourceexplorer2.CreateIndexOutput, error) - CreateIndexRequest(*resourceexplorer2.CreateIndexInput) (*request.Request, *resourceexplorer2.CreateIndexOutput) - - CreateView(*resourceexplorer2.CreateViewInput) (*resourceexplorer2.CreateViewOutput, error) - CreateViewWithContext(aws.Context, *resourceexplorer2.CreateViewInput, ...request.Option) (*resourceexplorer2.CreateViewOutput, error) - CreateViewRequest(*resourceexplorer2.CreateViewInput) (*request.Request, *resourceexplorer2.CreateViewOutput) - - DeleteIndex(*resourceexplorer2.DeleteIndexInput) (*resourceexplorer2.DeleteIndexOutput, error) - DeleteIndexWithContext(aws.Context, *resourceexplorer2.DeleteIndexInput, ...request.Option) (*resourceexplorer2.DeleteIndexOutput, error) - DeleteIndexRequest(*resourceexplorer2.DeleteIndexInput) (*request.Request, *resourceexplorer2.DeleteIndexOutput) - - DeleteView(*resourceexplorer2.DeleteViewInput) (*resourceexplorer2.DeleteViewOutput, error) - DeleteViewWithContext(aws.Context, *resourceexplorer2.DeleteViewInput, ...request.Option) (*resourceexplorer2.DeleteViewOutput, error) - DeleteViewRequest(*resourceexplorer2.DeleteViewInput) (*request.Request, *resourceexplorer2.DeleteViewOutput) - - DisassociateDefaultView(*resourceexplorer2.DisassociateDefaultViewInput) (*resourceexplorer2.DisassociateDefaultViewOutput, error) - DisassociateDefaultViewWithContext(aws.Context, *resourceexplorer2.DisassociateDefaultViewInput, ...request.Option) (*resourceexplorer2.DisassociateDefaultViewOutput, error) - DisassociateDefaultViewRequest(*resourceexplorer2.DisassociateDefaultViewInput) (*request.Request, *resourceexplorer2.DisassociateDefaultViewOutput) - - GetAccountLevelServiceConfiguration(*resourceexplorer2.GetAccountLevelServiceConfigurationInput) (*resourceexplorer2.GetAccountLevelServiceConfigurationOutput, error) - GetAccountLevelServiceConfigurationWithContext(aws.Context, *resourceexplorer2.GetAccountLevelServiceConfigurationInput, ...request.Option) (*resourceexplorer2.GetAccountLevelServiceConfigurationOutput, error) - GetAccountLevelServiceConfigurationRequest(*resourceexplorer2.GetAccountLevelServiceConfigurationInput) (*request.Request, *resourceexplorer2.GetAccountLevelServiceConfigurationOutput) - - GetDefaultView(*resourceexplorer2.GetDefaultViewInput) (*resourceexplorer2.GetDefaultViewOutput, error) - GetDefaultViewWithContext(aws.Context, *resourceexplorer2.GetDefaultViewInput, ...request.Option) (*resourceexplorer2.GetDefaultViewOutput, error) - GetDefaultViewRequest(*resourceexplorer2.GetDefaultViewInput) (*request.Request, *resourceexplorer2.GetDefaultViewOutput) - - GetIndex(*resourceexplorer2.GetIndexInput) (*resourceexplorer2.GetIndexOutput, error) - GetIndexWithContext(aws.Context, *resourceexplorer2.GetIndexInput, ...request.Option) (*resourceexplorer2.GetIndexOutput, error) - GetIndexRequest(*resourceexplorer2.GetIndexInput) (*request.Request, *resourceexplorer2.GetIndexOutput) - - GetView(*resourceexplorer2.GetViewInput) (*resourceexplorer2.GetViewOutput, error) - GetViewWithContext(aws.Context, *resourceexplorer2.GetViewInput, ...request.Option) (*resourceexplorer2.GetViewOutput, error) - GetViewRequest(*resourceexplorer2.GetViewInput) (*request.Request, *resourceexplorer2.GetViewOutput) - - ListIndexes(*resourceexplorer2.ListIndexesInput) (*resourceexplorer2.ListIndexesOutput, error) - ListIndexesWithContext(aws.Context, *resourceexplorer2.ListIndexesInput, ...request.Option) (*resourceexplorer2.ListIndexesOutput, error) - ListIndexesRequest(*resourceexplorer2.ListIndexesInput) (*request.Request, *resourceexplorer2.ListIndexesOutput) - - ListIndexesPages(*resourceexplorer2.ListIndexesInput, func(*resourceexplorer2.ListIndexesOutput, bool) bool) error - ListIndexesPagesWithContext(aws.Context, *resourceexplorer2.ListIndexesInput, func(*resourceexplorer2.ListIndexesOutput, bool) bool, ...request.Option) error - - ListIndexesForMembers(*resourceexplorer2.ListIndexesForMembersInput) (*resourceexplorer2.ListIndexesForMembersOutput, error) - ListIndexesForMembersWithContext(aws.Context, *resourceexplorer2.ListIndexesForMembersInput, ...request.Option) (*resourceexplorer2.ListIndexesForMembersOutput, error) - ListIndexesForMembersRequest(*resourceexplorer2.ListIndexesForMembersInput) (*request.Request, *resourceexplorer2.ListIndexesForMembersOutput) - - ListIndexesForMembersPages(*resourceexplorer2.ListIndexesForMembersInput, func(*resourceexplorer2.ListIndexesForMembersOutput, bool) bool) error - ListIndexesForMembersPagesWithContext(aws.Context, *resourceexplorer2.ListIndexesForMembersInput, func(*resourceexplorer2.ListIndexesForMembersOutput, bool) bool, ...request.Option) error - - ListSupportedResourceTypes(*resourceexplorer2.ListSupportedResourceTypesInput) (*resourceexplorer2.ListSupportedResourceTypesOutput, error) - ListSupportedResourceTypesWithContext(aws.Context, *resourceexplorer2.ListSupportedResourceTypesInput, ...request.Option) (*resourceexplorer2.ListSupportedResourceTypesOutput, error) - ListSupportedResourceTypesRequest(*resourceexplorer2.ListSupportedResourceTypesInput) (*request.Request, *resourceexplorer2.ListSupportedResourceTypesOutput) - - ListSupportedResourceTypesPages(*resourceexplorer2.ListSupportedResourceTypesInput, func(*resourceexplorer2.ListSupportedResourceTypesOutput, bool) bool) error - ListSupportedResourceTypesPagesWithContext(aws.Context, *resourceexplorer2.ListSupportedResourceTypesInput, func(*resourceexplorer2.ListSupportedResourceTypesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*resourceexplorer2.ListTagsForResourceInput) (*resourceexplorer2.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *resourceexplorer2.ListTagsForResourceInput, ...request.Option) (*resourceexplorer2.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*resourceexplorer2.ListTagsForResourceInput) (*request.Request, *resourceexplorer2.ListTagsForResourceOutput) - - ListViews(*resourceexplorer2.ListViewsInput) (*resourceexplorer2.ListViewsOutput, error) - ListViewsWithContext(aws.Context, *resourceexplorer2.ListViewsInput, ...request.Option) (*resourceexplorer2.ListViewsOutput, error) - ListViewsRequest(*resourceexplorer2.ListViewsInput) (*request.Request, *resourceexplorer2.ListViewsOutput) - - ListViewsPages(*resourceexplorer2.ListViewsInput, func(*resourceexplorer2.ListViewsOutput, bool) bool) error - ListViewsPagesWithContext(aws.Context, *resourceexplorer2.ListViewsInput, func(*resourceexplorer2.ListViewsOutput, bool) bool, ...request.Option) error - - Search(*resourceexplorer2.SearchInput) (*resourceexplorer2.SearchOutput, error) - SearchWithContext(aws.Context, *resourceexplorer2.SearchInput, ...request.Option) (*resourceexplorer2.SearchOutput, error) - SearchRequest(*resourceexplorer2.SearchInput) (*request.Request, *resourceexplorer2.SearchOutput) - - SearchPages(*resourceexplorer2.SearchInput, func(*resourceexplorer2.SearchOutput, bool) bool) error - SearchPagesWithContext(aws.Context, *resourceexplorer2.SearchInput, func(*resourceexplorer2.SearchOutput, bool) bool, ...request.Option) error - - TagResource(*resourceexplorer2.TagResourceInput) (*resourceexplorer2.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *resourceexplorer2.TagResourceInput, ...request.Option) (*resourceexplorer2.TagResourceOutput, error) - TagResourceRequest(*resourceexplorer2.TagResourceInput) (*request.Request, *resourceexplorer2.TagResourceOutput) - - UntagResource(*resourceexplorer2.UntagResourceInput) (*resourceexplorer2.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *resourceexplorer2.UntagResourceInput, ...request.Option) (*resourceexplorer2.UntagResourceOutput, error) - UntagResourceRequest(*resourceexplorer2.UntagResourceInput) (*request.Request, *resourceexplorer2.UntagResourceOutput) - - UpdateIndexType(*resourceexplorer2.UpdateIndexTypeInput) (*resourceexplorer2.UpdateIndexTypeOutput, error) - UpdateIndexTypeWithContext(aws.Context, *resourceexplorer2.UpdateIndexTypeInput, ...request.Option) (*resourceexplorer2.UpdateIndexTypeOutput, error) - UpdateIndexTypeRequest(*resourceexplorer2.UpdateIndexTypeInput) (*request.Request, *resourceexplorer2.UpdateIndexTypeOutput) - - UpdateView(*resourceexplorer2.UpdateViewInput) (*resourceexplorer2.UpdateViewOutput, error) - UpdateViewWithContext(aws.Context, *resourceexplorer2.UpdateViewInput, ...request.Option) (*resourceexplorer2.UpdateViewOutput, error) - UpdateViewRequest(*resourceexplorer2.UpdateViewInput) (*request.Request, *resourceexplorer2.UpdateViewOutput) -} - -var _ ResourceExplorer2API = (*resourceexplorer2.ResourceExplorer2)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/service.go deleted file mode 100644 index 4568723bb6ff..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/resourceexplorer2/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package resourceexplorer2 - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// ResourceExplorer2 provides the API operation methods for making requests to -// AWS Resource Explorer. See this package's package overview docs -// for details on the service. -// -// ResourceExplorer2 methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ResourceExplorer2 struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Resource Explorer 2" // Name of service. - EndpointsID = "resource-explorer-2" // ID to lookup a service endpoint with. - ServiceID = "Resource Explorer 2" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the ResourceExplorer2 client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a ResourceExplorer2 client from just a session. -// svc := resourceexplorer2.New(mySession) -// -// // Create a ResourceExplorer2 client with additional configuration -// svc := resourceexplorer2.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ResourceExplorer2 { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "resource-explorer-2" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ResourceExplorer2 { - svc := &ResourceExplorer2{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-07-28", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ResourceExplorer2 operation and runs any -// custom request initialization. -func (c *ResourceExplorer2) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/api.go deleted file mode 100644 index e05a5132b917..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/api.go +++ /dev/null @@ -1,6753 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package rolesanywhere - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateProfile = "CreateProfile" - -// CreateProfileRequest generates a "aws/request.Request" representing the -// client's request for the CreateProfile 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 CreateProfile for more information on using the CreateProfile -// 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 CreateProfileRequest method. -// req, resp := client.CreateProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/CreateProfile -func (c *RolesAnywhere) CreateProfileRequest(input *CreateProfileInput) (req *request.Request, output *CreateProfileOutput) { - op := &request.Operation{ - Name: opCreateProfile, - HTTPMethod: "POST", - HTTPPath: "/profiles", - } - - if input == nil { - input = &CreateProfileInput{} - } - - output = &CreateProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateProfile API operation for IAM Roles Anywhere. -// -// Creates a profile, a list of the roles that Roles Anywhere service is trusted -// to assume. You use profiles to intersect permissions with IAM managed policies. -// -// Required permissions: rolesanywhere:CreateProfile. -// -// 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 IAM Roles Anywhere's -// API operation CreateProfile for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/CreateProfile -func (c *RolesAnywhere) CreateProfile(input *CreateProfileInput) (*CreateProfileOutput, error) { - req, out := c.CreateProfileRequest(input) - return out, req.Send() -} - -// CreateProfileWithContext is the same as CreateProfile with the addition of -// the ability to pass a context and additional request options. -// -// See CreateProfile 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 *RolesAnywhere) CreateProfileWithContext(ctx aws.Context, input *CreateProfileInput, opts ...request.Option) (*CreateProfileOutput, error) { - req, out := c.CreateProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTrustAnchor = "CreateTrustAnchor" - -// CreateTrustAnchorRequest generates a "aws/request.Request" representing the -// client's request for the CreateTrustAnchor 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 CreateTrustAnchor for more information on using the CreateTrustAnchor -// 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 CreateTrustAnchorRequest method. -// req, resp := client.CreateTrustAnchorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/CreateTrustAnchor -func (c *RolesAnywhere) CreateTrustAnchorRequest(input *CreateTrustAnchorInput) (req *request.Request, output *CreateTrustAnchorOutput) { - op := &request.Operation{ - Name: opCreateTrustAnchor, - HTTPMethod: "POST", - HTTPPath: "/trustanchors", - } - - if input == nil { - input = &CreateTrustAnchorInput{} - } - - output = &CreateTrustAnchorOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTrustAnchor API operation for IAM Roles Anywhere. -// -// Creates a trust anchor to establish trust between IAM Roles Anywhere and -// your certificate authority (CA). You can define a trust anchor as a reference -// to an Private Certificate Authority (Private CA) or by uploading a CA certificate. -// Your Amazon Web Services workloads can authenticate with the trust anchor -// using certificates issued by the CA in exchange for temporary Amazon Web -// Services credentials. -// -// Required permissions: rolesanywhere:CreateTrustAnchor. -// -// 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 IAM Roles Anywhere's -// API operation CreateTrustAnchor for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/CreateTrustAnchor -func (c *RolesAnywhere) CreateTrustAnchor(input *CreateTrustAnchorInput) (*CreateTrustAnchorOutput, error) { - req, out := c.CreateTrustAnchorRequest(input) - return out, req.Send() -} - -// CreateTrustAnchorWithContext is the same as CreateTrustAnchor with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTrustAnchor 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 *RolesAnywhere) CreateTrustAnchorWithContext(ctx aws.Context, input *CreateTrustAnchorInput, opts ...request.Option) (*CreateTrustAnchorOutput, error) { - req, out := c.CreateTrustAnchorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCrl = "DeleteCrl" - -// DeleteCrlRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCrl 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 DeleteCrl for more information on using the DeleteCrl -// 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 DeleteCrlRequest method. -// req, resp := client.DeleteCrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DeleteCrl -func (c *RolesAnywhere) DeleteCrlRequest(input *DeleteCrlInput) (req *request.Request, output *DeleteCrlOutput) { - op := &request.Operation{ - Name: opDeleteCrl, - HTTPMethod: "DELETE", - HTTPPath: "/crl/{crlId}", - } - - if input == nil { - input = &DeleteCrlInput{} - } - - output = &DeleteCrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteCrl API operation for IAM Roles Anywhere. -// -// Deletes a certificate revocation list (CRL). -// -// Required permissions: rolesanywhere:DeleteCrl. -// -// 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 IAM Roles Anywhere's -// API operation DeleteCrl for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DeleteCrl -func (c *RolesAnywhere) DeleteCrl(input *DeleteCrlInput) (*DeleteCrlOutput, error) { - req, out := c.DeleteCrlRequest(input) - return out, req.Send() -} - -// DeleteCrlWithContext is the same as DeleteCrl with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCrl 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 *RolesAnywhere) DeleteCrlWithContext(ctx aws.Context, input *DeleteCrlInput, opts ...request.Option) (*DeleteCrlOutput, error) { - req, out := c.DeleteCrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteProfile = "DeleteProfile" - -// DeleteProfileRequest generates a "aws/request.Request" representing the -// client's request for the DeleteProfile 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 DeleteProfile for more information on using the DeleteProfile -// 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 DeleteProfileRequest method. -// req, resp := client.DeleteProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DeleteProfile -func (c *RolesAnywhere) DeleteProfileRequest(input *DeleteProfileInput) (req *request.Request, output *DeleteProfileOutput) { - op := &request.Operation{ - Name: opDeleteProfile, - HTTPMethod: "DELETE", - HTTPPath: "/profile/{profileId}", - } - - if input == nil { - input = &DeleteProfileInput{} - } - - output = &DeleteProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteProfile API operation for IAM Roles Anywhere. -// -// Deletes a profile. -// -// Required permissions: rolesanywhere:DeleteProfile. -// -// 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 IAM Roles Anywhere's -// API operation DeleteProfile for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DeleteProfile -func (c *RolesAnywhere) DeleteProfile(input *DeleteProfileInput) (*DeleteProfileOutput, error) { - req, out := c.DeleteProfileRequest(input) - return out, req.Send() -} - -// DeleteProfileWithContext is the same as DeleteProfile with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteProfile 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 *RolesAnywhere) DeleteProfileWithContext(ctx aws.Context, input *DeleteProfileInput, opts ...request.Option) (*DeleteProfileOutput, error) { - req, out := c.DeleteProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTrustAnchor = "DeleteTrustAnchor" - -// DeleteTrustAnchorRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTrustAnchor 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 DeleteTrustAnchor for more information on using the DeleteTrustAnchor -// 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 DeleteTrustAnchorRequest method. -// req, resp := client.DeleteTrustAnchorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DeleteTrustAnchor -func (c *RolesAnywhere) DeleteTrustAnchorRequest(input *DeleteTrustAnchorInput) (req *request.Request, output *DeleteTrustAnchorOutput) { - op := &request.Operation{ - Name: opDeleteTrustAnchor, - HTTPMethod: "DELETE", - HTTPPath: "/trustanchor/{trustAnchorId}", - } - - if input == nil { - input = &DeleteTrustAnchorInput{} - } - - output = &DeleteTrustAnchorOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTrustAnchor API operation for IAM Roles Anywhere. -// -// Deletes a trust anchor. -// -// Required permissions: rolesanywhere:DeleteTrustAnchor. -// -// 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 IAM Roles Anywhere's -// API operation DeleteTrustAnchor for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DeleteTrustAnchor -func (c *RolesAnywhere) DeleteTrustAnchor(input *DeleteTrustAnchorInput) (*DeleteTrustAnchorOutput, error) { - req, out := c.DeleteTrustAnchorRequest(input) - return out, req.Send() -} - -// DeleteTrustAnchorWithContext is the same as DeleteTrustAnchor with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTrustAnchor 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 *RolesAnywhere) DeleteTrustAnchorWithContext(ctx aws.Context, input *DeleteTrustAnchorInput, opts ...request.Option) (*DeleteTrustAnchorOutput, error) { - req, out := c.DeleteTrustAnchorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableCrl = "DisableCrl" - -// DisableCrlRequest generates a "aws/request.Request" representing the -// client's request for the DisableCrl 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 DisableCrl for more information on using the DisableCrl -// 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 DisableCrlRequest method. -// req, resp := client.DisableCrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DisableCrl -func (c *RolesAnywhere) DisableCrlRequest(input *DisableCrlInput) (req *request.Request, output *DisableCrlOutput) { - op := &request.Operation{ - Name: opDisableCrl, - HTTPMethod: "POST", - HTTPPath: "/crl/{crlId}/disable", - } - - if input == nil { - input = &DisableCrlInput{} - } - - output = &DisableCrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableCrl API operation for IAM Roles Anywhere. -// -// Disables a certificate revocation list (CRL). -// -// Required permissions: rolesanywhere:DisableCrl. -// -// 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 IAM Roles Anywhere's -// API operation DisableCrl for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DisableCrl -func (c *RolesAnywhere) DisableCrl(input *DisableCrlInput) (*DisableCrlOutput, error) { - req, out := c.DisableCrlRequest(input) - return out, req.Send() -} - -// DisableCrlWithContext is the same as DisableCrl with the addition of -// the ability to pass a context and additional request options. -// -// See DisableCrl 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 *RolesAnywhere) DisableCrlWithContext(ctx aws.Context, input *DisableCrlInput, opts ...request.Option) (*DisableCrlOutput, error) { - req, out := c.DisableCrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableProfile = "DisableProfile" - -// DisableProfileRequest generates a "aws/request.Request" representing the -// client's request for the DisableProfile 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 DisableProfile for more information on using the DisableProfile -// 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 DisableProfileRequest method. -// req, resp := client.DisableProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DisableProfile -func (c *RolesAnywhere) DisableProfileRequest(input *DisableProfileInput) (req *request.Request, output *DisableProfileOutput) { - op := &request.Operation{ - Name: opDisableProfile, - HTTPMethod: "POST", - HTTPPath: "/profile/{profileId}/disable", - } - - if input == nil { - input = &DisableProfileInput{} - } - - output = &DisableProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableProfile API operation for IAM Roles Anywhere. -// -// Disables a profile. When disabled, temporary credential requests with this -// profile fail. -// -// Required permissions: rolesanywhere:DisableProfile. -// -// 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 IAM Roles Anywhere's -// API operation DisableProfile for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DisableProfile -func (c *RolesAnywhere) DisableProfile(input *DisableProfileInput) (*DisableProfileOutput, error) { - req, out := c.DisableProfileRequest(input) - return out, req.Send() -} - -// DisableProfileWithContext is the same as DisableProfile with the addition of -// the ability to pass a context and additional request options. -// -// See DisableProfile 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 *RolesAnywhere) DisableProfileWithContext(ctx aws.Context, input *DisableProfileInput, opts ...request.Option) (*DisableProfileOutput, error) { - req, out := c.DisableProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableTrustAnchor = "DisableTrustAnchor" - -// DisableTrustAnchorRequest generates a "aws/request.Request" representing the -// client's request for the DisableTrustAnchor 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 DisableTrustAnchor for more information on using the DisableTrustAnchor -// 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 DisableTrustAnchorRequest method. -// req, resp := client.DisableTrustAnchorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DisableTrustAnchor -func (c *RolesAnywhere) DisableTrustAnchorRequest(input *DisableTrustAnchorInput) (req *request.Request, output *DisableTrustAnchorOutput) { - op := &request.Operation{ - Name: opDisableTrustAnchor, - HTTPMethod: "POST", - HTTPPath: "/trustanchor/{trustAnchorId}/disable", - } - - if input == nil { - input = &DisableTrustAnchorInput{} - } - - output = &DisableTrustAnchorOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisableTrustAnchor API operation for IAM Roles Anywhere. -// -// Disables a trust anchor. When disabled, temporary credential requests specifying -// this trust anchor are unauthorized. -// -// Required permissions: rolesanywhere:DisableTrustAnchor. -// -// 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 IAM Roles Anywhere's -// API operation DisableTrustAnchor for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/DisableTrustAnchor -func (c *RolesAnywhere) DisableTrustAnchor(input *DisableTrustAnchorInput) (*DisableTrustAnchorOutput, error) { - req, out := c.DisableTrustAnchorRequest(input) - return out, req.Send() -} - -// DisableTrustAnchorWithContext is the same as DisableTrustAnchor with the addition of -// the ability to pass a context and additional request options. -// -// See DisableTrustAnchor 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 *RolesAnywhere) DisableTrustAnchorWithContext(ctx aws.Context, input *DisableTrustAnchorInput, opts ...request.Option) (*DisableTrustAnchorOutput, error) { - req, out := c.DisableTrustAnchorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableCrl = "EnableCrl" - -// EnableCrlRequest generates a "aws/request.Request" representing the -// client's request for the EnableCrl 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 EnableCrl for more information on using the EnableCrl -// 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 EnableCrlRequest method. -// req, resp := client.EnableCrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/EnableCrl -func (c *RolesAnywhere) EnableCrlRequest(input *EnableCrlInput) (req *request.Request, output *EnableCrlOutput) { - op := &request.Operation{ - Name: opEnableCrl, - HTTPMethod: "POST", - HTTPPath: "/crl/{crlId}/enable", - } - - if input == nil { - input = &EnableCrlInput{} - } - - output = &EnableCrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableCrl API operation for IAM Roles Anywhere. -// -// Enables a certificate revocation list (CRL). When enabled, certificates stored -// in the CRL are unauthorized to receive session credentials. -// -// Required permissions: rolesanywhere:EnableCrl. -// -// 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 IAM Roles Anywhere's -// API operation EnableCrl for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/EnableCrl -func (c *RolesAnywhere) EnableCrl(input *EnableCrlInput) (*EnableCrlOutput, error) { - req, out := c.EnableCrlRequest(input) - return out, req.Send() -} - -// EnableCrlWithContext is the same as EnableCrl with the addition of -// the ability to pass a context and additional request options. -// -// See EnableCrl 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 *RolesAnywhere) EnableCrlWithContext(ctx aws.Context, input *EnableCrlInput, opts ...request.Option) (*EnableCrlOutput, error) { - req, out := c.EnableCrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableProfile = "EnableProfile" - -// EnableProfileRequest generates a "aws/request.Request" representing the -// client's request for the EnableProfile 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 EnableProfile for more information on using the EnableProfile -// 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 EnableProfileRequest method. -// req, resp := client.EnableProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/EnableProfile -func (c *RolesAnywhere) EnableProfileRequest(input *EnableProfileInput) (req *request.Request, output *EnableProfileOutput) { - op := &request.Operation{ - Name: opEnableProfile, - HTTPMethod: "POST", - HTTPPath: "/profile/{profileId}/enable", - } - - if input == nil { - input = &EnableProfileInput{} - } - - output = &EnableProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableProfile API operation for IAM Roles Anywhere. -// -// Enables temporary credential requests for a profile. -// -// Required permissions: rolesanywhere:EnableProfile. -// -// 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 IAM Roles Anywhere's -// API operation EnableProfile for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/EnableProfile -func (c *RolesAnywhere) EnableProfile(input *EnableProfileInput) (*EnableProfileOutput, error) { - req, out := c.EnableProfileRequest(input) - return out, req.Send() -} - -// EnableProfileWithContext is the same as EnableProfile with the addition of -// the ability to pass a context and additional request options. -// -// See EnableProfile 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 *RolesAnywhere) EnableProfileWithContext(ctx aws.Context, input *EnableProfileInput, opts ...request.Option) (*EnableProfileOutput, error) { - req, out := c.EnableProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableTrustAnchor = "EnableTrustAnchor" - -// EnableTrustAnchorRequest generates a "aws/request.Request" representing the -// client's request for the EnableTrustAnchor 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 EnableTrustAnchor for more information on using the EnableTrustAnchor -// 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 EnableTrustAnchorRequest method. -// req, resp := client.EnableTrustAnchorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/EnableTrustAnchor -func (c *RolesAnywhere) EnableTrustAnchorRequest(input *EnableTrustAnchorInput) (req *request.Request, output *EnableTrustAnchorOutput) { - op := &request.Operation{ - Name: opEnableTrustAnchor, - HTTPMethod: "POST", - HTTPPath: "/trustanchor/{trustAnchorId}/enable", - } - - if input == nil { - input = &EnableTrustAnchorInput{} - } - - output = &EnableTrustAnchorOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableTrustAnchor API operation for IAM Roles Anywhere. -// -// Enables a trust anchor. When enabled, certificates in the trust anchor chain -// are authorized for trust validation. -// -// Required permissions: rolesanywhere:EnableTrustAnchor. -// -// 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 IAM Roles Anywhere's -// API operation EnableTrustAnchor for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/EnableTrustAnchor -func (c *RolesAnywhere) EnableTrustAnchor(input *EnableTrustAnchorInput) (*EnableTrustAnchorOutput, error) { - req, out := c.EnableTrustAnchorRequest(input) - return out, req.Send() -} - -// EnableTrustAnchorWithContext is the same as EnableTrustAnchor with the addition of -// the ability to pass a context and additional request options. -// -// See EnableTrustAnchor 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 *RolesAnywhere) EnableTrustAnchorWithContext(ctx aws.Context, input *EnableTrustAnchorInput, opts ...request.Option) (*EnableTrustAnchorOutput, error) { - req, out := c.EnableTrustAnchorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetCrl = "GetCrl" - -// GetCrlRequest generates a "aws/request.Request" representing the -// client's request for the GetCrl 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 GetCrl for more information on using the GetCrl -// 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 GetCrlRequest method. -// req, resp := client.GetCrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/GetCrl -func (c *RolesAnywhere) GetCrlRequest(input *GetCrlInput) (req *request.Request, output *GetCrlOutput) { - op := &request.Operation{ - Name: opGetCrl, - HTTPMethod: "GET", - HTTPPath: "/crl/{crlId}", - } - - if input == nil { - input = &GetCrlInput{} - } - - output = &GetCrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetCrl API operation for IAM Roles Anywhere. -// -// Gets a certificate revocation list (CRL). -// -// Required permissions: rolesanywhere:GetCrl. -// -// 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 IAM Roles Anywhere's -// API operation GetCrl for usage and error information. -// -// Returned Error Types: -// - ResourceNotFoundException -// The resource could not be found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/GetCrl -func (c *RolesAnywhere) GetCrl(input *GetCrlInput) (*GetCrlOutput, error) { - req, out := c.GetCrlRequest(input) - return out, req.Send() -} - -// GetCrlWithContext is the same as GetCrl with the addition of -// the ability to pass a context and additional request options. -// -// See GetCrl 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 *RolesAnywhere) GetCrlWithContext(ctx aws.Context, input *GetCrlInput, opts ...request.Option) (*GetCrlOutput, error) { - req, out := c.GetCrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetProfile = "GetProfile" - -// GetProfileRequest generates a "aws/request.Request" representing the -// client's request for the GetProfile 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 GetProfile for more information on using the GetProfile -// 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 GetProfileRequest method. -// req, resp := client.GetProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/GetProfile -func (c *RolesAnywhere) GetProfileRequest(input *GetProfileInput) (req *request.Request, output *GetProfileOutput) { - op := &request.Operation{ - Name: opGetProfile, - HTTPMethod: "GET", - HTTPPath: "/profile/{profileId}", - } - - if input == nil { - input = &GetProfileInput{} - } - - output = &GetProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetProfile API operation for IAM Roles Anywhere. -// -// Gets a profile. -// -// Required permissions: rolesanywhere:GetProfile. -// -// 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 IAM Roles Anywhere's -// API operation GetProfile for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/GetProfile -func (c *RolesAnywhere) GetProfile(input *GetProfileInput) (*GetProfileOutput, error) { - req, out := c.GetProfileRequest(input) - return out, req.Send() -} - -// GetProfileWithContext is the same as GetProfile with the addition of -// the ability to pass a context and additional request options. -// -// See GetProfile 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 *RolesAnywhere) GetProfileWithContext(ctx aws.Context, input *GetProfileInput, opts ...request.Option) (*GetProfileOutput, error) { - req, out := c.GetProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSubject = "GetSubject" - -// GetSubjectRequest generates a "aws/request.Request" representing the -// client's request for the GetSubject 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 GetSubject for more information on using the GetSubject -// 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 GetSubjectRequest method. -// req, resp := client.GetSubjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/GetSubject -func (c *RolesAnywhere) GetSubjectRequest(input *GetSubjectInput) (req *request.Request, output *GetSubjectOutput) { - op := &request.Operation{ - Name: opGetSubject, - HTTPMethod: "GET", - HTTPPath: "/subject/{subjectId}", - } - - if input == nil { - input = &GetSubjectInput{} - } - - output = &GetSubjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSubject API operation for IAM Roles Anywhere. -// -// Gets a subject, which associates a certificate identity with authentication -// attempts. The subject stores auditing information such as the status of the -// last authentication attempt, the certificate data used in the attempt, and -// the last time the associated identity attempted authentication. -// -// Required permissions: rolesanywhere:GetSubject. -// -// 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 IAM Roles Anywhere's -// API operation GetSubject for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/GetSubject -func (c *RolesAnywhere) GetSubject(input *GetSubjectInput) (*GetSubjectOutput, error) { - req, out := c.GetSubjectRequest(input) - return out, req.Send() -} - -// GetSubjectWithContext is the same as GetSubject with the addition of -// the ability to pass a context and additional request options. -// -// See GetSubject 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 *RolesAnywhere) GetSubjectWithContext(ctx aws.Context, input *GetSubjectInput, opts ...request.Option) (*GetSubjectOutput, error) { - req, out := c.GetSubjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTrustAnchor = "GetTrustAnchor" - -// GetTrustAnchorRequest generates a "aws/request.Request" representing the -// client's request for the GetTrustAnchor 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 GetTrustAnchor for more information on using the GetTrustAnchor -// 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 GetTrustAnchorRequest method. -// req, resp := client.GetTrustAnchorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/GetTrustAnchor -func (c *RolesAnywhere) GetTrustAnchorRequest(input *GetTrustAnchorInput) (req *request.Request, output *GetTrustAnchorOutput) { - op := &request.Operation{ - Name: opGetTrustAnchor, - HTTPMethod: "GET", - HTTPPath: "/trustanchor/{trustAnchorId}", - } - - if input == nil { - input = &GetTrustAnchorInput{} - } - - output = &GetTrustAnchorOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTrustAnchor API operation for IAM Roles Anywhere. -// -// Gets a trust anchor. -// -// Required permissions: rolesanywhere:GetTrustAnchor. -// -// 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 IAM Roles Anywhere's -// API operation GetTrustAnchor for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/GetTrustAnchor -func (c *RolesAnywhere) GetTrustAnchor(input *GetTrustAnchorInput) (*GetTrustAnchorOutput, error) { - req, out := c.GetTrustAnchorRequest(input) - return out, req.Send() -} - -// GetTrustAnchorWithContext is the same as GetTrustAnchor with the addition of -// the ability to pass a context and additional request options. -// -// See GetTrustAnchor 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 *RolesAnywhere) GetTrustAnchorWithContext(ctx aws.Context, input *GetTrustAnchorInput, opts ...request.Option) (*GetTrustAnchorOutput, error) { - req, out := c.GetTrustAnchorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportCrl = "ImportCrl" - -// ImportCrlRequest generates a "aws/request.Request" representing the -// client's request for the ImportCrl 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 ImportCrl for more information on using the ImportCrl -// 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 ImportCrlRequest method. -// req, resp := client.ImportCrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ImportCrl -func (c *RolesAnywhere) ImportCrlRequest(input *ImportCrlInput) (req *request.Request, output *ImportCrlOutput) { - op := &request.Operation{ - Name: opImportCrl, - HTTPMethod: "POST", - HTTPPath: "/crls", - } - - if input == nil { - input = &ImportCrlInput{} - } - - output = &ImportCrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// ImportCrl API operation for IAM Roles Anywhere. -// -// Imports the certificate revocation list (CRL). A CRL is a list of certificates -// that have been revoked by the issuing certificate Authority (CA). IAM Roles -// Anywhere validates against the CRL before issuing credentials. -// -// Required permissions: rolesanywhere:ImportCrl. -// -// 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 IAM Roles Anywhere's -// API operation ImportCrl for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ImportCrl -func (c *RolesAnywhere) ImportCrl(input *ImportCrlInput) (*ImportCrlOutput, error) { - req, out := c.ImportCrlRequest(input) - return out, req.Send() -} - -// ImportCrlWithContext is the same as ImportCrl with the addition of -// the ability to pass a context and additional request options. -// -// See ImportCrl 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 *RolesAnywhere) ImportCrlWithContext(ctx aws.Context, input *ImportCrlInput, opts ...request.Option) (*ImportCrlOutput, error) { - req, out := c.ImportCrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListCrls = "ListCrls" - -// ListCrlsRequest generates a "aws/request.Request" representing the -// client's request for the ListCrls 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 ListCrls for more information on using the ListCrls -// 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 ListCrlsRequest method. -// req, resp := client.ListCrlsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListCrls -func (c *RolesAnywhere) ListCrlsRequest(input *ListCrlsInput) (req *request.Request, output *ListCrlsOutput) { - op := &request.Operation{ - Name: opListCrls, - HTTPMethod: "GET", - HTTPPath: "/crls", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCrlsInput{} - } - - output = &ListCrlsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCrls API operation for IAM Roles Anywhere. -// -// Lists all certificate revocation lists (CRL) in the authenticated account -// and Amazon Web Services Region. -// -// Required permissions: rolesanywhere:ListCrls. -// -// 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 IAM Roles Anywhere's -// API operation ListCrls for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListCrls -func (c *RolesAnywhere) ListCrls(input *ListCrlsInput) (*ListCrlsOutput, error) { - req, out := c.ListCrlsRequest(input) - return out, req.Send() -} - -// ListCrlsWithContext is the same as ListCrls with the addition of -// the ability to pass a context and additional request options. -// -// See ListCrls 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 *RolesAnywhere) ListCrlsWithContext(ctx aws.Context, input *ListCrlsInput, opts ...request.Option) (*ListCrlsOutput, error) { - req, out := c.ListCrlsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCrlsPages iterates over the pages of a ListCrls operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCrls method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCrls operation. -// pageNum := 0 -// err := client.ListCrlsPages(params, -// func(page *rolesanywhere.ListCrlsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RolesAnywhere) ListCrlsPages(input *ListCrlsInput, fn func(*ListCrlsOutput, bool) bool) error { - return c.ListCrlsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCrlsPagesWithContext same as ListCrlsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RolesAnywhere) ListCrlsPagesWithContext(ctx aws.Context, input *ListCrlsInput, fn func(*ListCrlsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCrlsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCrlsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCrlsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListProfiles = "ListProfiles" - -// ListProfilesRequest generates a "aws/request.Request" representing the -// client's request for the ListProfiles 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 ListProfiles for more information on using the ListProfiles -// 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 ListProfilesRequest method. -// req, resp := client.ListProfilesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListProfiles -func (c *RolesAnywhere) ListProfilesRequest(input *ListProfilesInput) (req *request.Request, output *ListProfilesOutput) { - op := &request.Operation{ - Name: opListProfiles, - HTTPMethod: "GET", - HTTPPath: "/profiles", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListProfilesInput{} - } - - output = &ListProfilesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListProfiles API operation for IAM Roles Anywhere. -// -// Lists all profiles in the authenticated account and Amazon Web Services Region. -// -// Required permissions: rolesanywhere:ListProfiles. -// -// 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 IAM Roles Anywhere's -// API operation ListProfiles for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListProfiles -func (c *RolesAnywhere) ListProfiles(input *ListProfilesInput) (*ListProfilesOutput, error) { - req, out := c.ListProfilesRequest(input) - return out, req.Send() -} - -// ListProfilesWithContext is the same as ListProfiles with the addition of -// the ability to pass a context and additional request options. -// -// See ListProfiles 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 *RolesAnywhere) ListProfilesWithContext(ctx aws.Context, input *ListProfilesInput, opts ...request.Option) (*ListProfilesOutput, error) { - req, out := c.ListProfilesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListProfilesPages iterates over the pages of a ListProfiles operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListProfiles method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListProfiles operation. -// pageNum := 0 -// err := client.ListProfilesPages(params, -// func(page *rolesanywhere.ListProfilesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RolesAnywhere) ListProfilesPages(input *ListProfilesInput, fn func(*ListProfilesOutput, bool) bool) error { - return c.ListProfilesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListProfilesPagesWithContext same as ListProfilesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RolesAnywhere) ListProfilesPagesWithContext(ctx aws.Context, input *ListProfilesInput, fn func(*ListProfilesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListProfilesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListProfilesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListProfilesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSubjects = "ListSubjects" - -// ListSubjectsRequest generates a "aws/request.Request" representing the -// client's request for the ListSubjects 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 ListSubjects for more information on using the ListSubjects -// 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 ListSubjectsRequest method. -// req, resp := client.ListSubjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListSubjects -func (c *RolesAnywhere) ListSubjectsRequest(input *ListSubjectsInput) (req *request.Request, output *ListSubjectsOutput) { - op := &request.Operation{ - Name: opListSubjects, - HTTPMethod: "GET", - HTTPPath: "/subjects", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSubjectsInput{} - } - - output = &ListSubjectsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSubjects API operation for IAM Roles Anywhere. -// -// Lists the subjects in the authenticated account and Amazon Web Services Region. -// -// Required permissions: rolesanywhere:ListSubjects. -// -// 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 IAM Roles Anywhere's -// API operation ListSubjects for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListSubjects -func (c *RolesAnywhere) ListSubjects(input *ListSubjectsInput) (*ListSubjectsOutput, error) { - req, out := c.ListSubjectsRequest(input) - return out, req.Send() -} - -// ListSubjectsWithContext is the same as ListSubjects with the addition of -// the ability to pass a context and additional request options. -// -// See ListSubjects 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 *RolesAnywhere) ListSubjectsWithContext(ctx aws.Context, input *ListSubjectsInput, opts ...request.Option) (*ListSubjectsOutput, error) { - req, out := c.ListSubjectsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSubjectsPages iterates over the pages of a ListSubjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubjects method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSubjects operation. -// pageNum := 0 -// err := client.ListSubjectsPages(params, -// func(page *rolesanywhere.ListSubjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RolesAnywhere) ListSubjectsPages(input *ListSubjectsInput, fn func(*ListSubjectsOutput, bool) bool) error { - return c.ListSubjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubjectsPagesWithContext same as ListSubjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RolesAnywhere) ListSubjectsPagesWithContext(ctx aws.Context, input *ListSubjectsInput, fn func(*ListSubjectsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSubjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSubjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSubjectsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListTagsForResource -func (c *RolesAnywhere) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/ListTagsForResource", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for IAM Roles Anywhere. -// -// Lists the tags attached to the resource. -// -// Required permissions: rolesanywhere:ListTagsForResource. -// -// 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 IAM Roles Anywhere's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListTagsForResource -func (c *RolesAnywhere) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *RolesAnywhere) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTrustAnchors = "ListTrustAnchors" - -// ListTrustAnchorsRequest generates a "aws/request.Request" representing the -// client's request for the ListTrustAnchors 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 ListTrustAnchors for more information on using the ListTrustAnchors -// 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 ListTrustAnchorsRequest method. -// req, resp := client.ListTrustAnchorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListTrustAnchors -func (c *RolesAnywhere) ListTrustAnchorsRequest(input *ListTrustAnchorsInput) (req *request.Request, output *ListTrustAnchorsOutput) { - op := &request.Operation{ - Name: opListTrustAnchors, - HTTPMethod: "GET", - HTTPPath: "/trustanchors", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTrustAnchorsInput{} - } - - output = &ListTrustAnchorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTrustAnchors API operation for IAM Roles Anywhere. -// -// Lists the trust anchors in the authenticated account and Amazon Web Services -// Region. -// -// Required permissions: rolesanywhere:ListTrustAnchors. -// -// 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 IAM Roles Anywhere's -// API operation ListTrustAnchors for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ListTrustAnchors -func (c *RolesAnywhere) ListTrustAnchors(input *ListTrustAnchorsInput) (*ListTrustAnchorsOutput, error) { - req, out := c.ListTrustAnchorsRequest(input) - return out, req.Send() -} - -// ListTrustAnchorsWithContext is the same as ListTrustAnchors with the addition of -// the ability to pass a context and additional request options. -// -// See ListTrustAnchors 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 *RolesAnywhere) ListTrustAnchorsWithContext(ctx aws.Context, input *ListTrustAnchorsInput, opts ...request.Option) (*ListTrustAnchorsOutput, error) { - req, out := c.ListTrustAnchorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTrustAnchorsPages iterates over the pages of a ListTrustAnchors operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTrustAnchors method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTrustAnchors operation. -// pageNum := 0 -// err := client.ListTrustAnchorsPages(params, -// func(page *rolesanywhere.ListTrustAnchorsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *RolesAnywhere) ListTrustAnchorsPages(input *ListTrustAnchorsInput, fn func(*ListTrustAnchorsOutput, bool) bool) error { - return c.ListTrustAnchorsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTrustAnchorsPagesWithContext same as ListTrustAnchorsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *RolesAnywhere) ListTrustAnchorsPagesWithContext(ctx aws.Context, input *ListTrustAnchorsInput, fn func(*ListTrustAnchorsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTrustAnchorsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTrustAnchorsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTrustAnchorsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutNotificationSettings = "PutNotificationSettings" - -// PutNotificationSettingsRequest generates a "aws/request.Request" representing the -// client's request for the PutNotificationSettings 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 PutNotificationSettings for more information on using the PutNotificationSettings -// 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 PutNotificationSettingsRequest method. -// req, resp := client.PutNotificationSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/PutNotificationSettings -func (c *RolesAnywhere) PutNotificationSettingsRequest(input *PutNotificationSettingsInput) (req *request.Request, output *PutNotificationSettingsOutput) { - op := &request.Operation{ - Name: opPutNotificationSettings, - HTTPMethod: "PATCH", - HTTPPath: "/put-notifications-settings", - } - - if input == nil { - input = &PutNotificationSettingsInput{} - } - - output = &PutNotificationSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutNotificationSettings API operation for IAM Roles Anywhere. -// -// Attaches a list of notification settings to a trust anchor. -// -// A notification setting includes information such as event name, threshold, -// status of the notification setting, and the channel to notify. -// -// Required permissions: rolesanywhere:PutNotificationSettings. -// -// 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 IAM Roles Anywhere's -// API operation PutNotificationSettings for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/PutNotificationSettings -func (c *RolesAnywhere) PutNotificationSettings(input *PutNotificationSettingsInput) (*PutNotificationSettingsOutput, error) { - req, out := c.PutNotificationSettingsRequest(input) - return out, req.Send() -} - -// PutNotificationSettingsWithContext is the same as PutNotificationSettings with the addition of -// the ability to pass a context and additional request options. -// -// See PutNotificationSettings 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 *RolesAnywhere) PutNotificationSettingsWithContext(ctx aws.Context, input *PutNotificationSettingsInput, opts ...request.Option) (*PutNotificationSettingsOutput, error) { - req, out := c.PutNotificationSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opResetNotificationSettings = "ResetNotificationSettings" - -// ResetNotificationSettingsRequest generates a "aws/request.Request" representing the -// client's request for the ResetNotificationSettings 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 ResetNotificationSettings for more information on using the ResetNotificationSettings -// 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 ResetNotificationSettingsRequest method. -// req, resp := client.ResetNotificationSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ResetNotificationSettings -func (c *RolesAnywhere) ResetNotificationSettingsRequest(input *ResetNotificationSettingsInput) (req *request.Request, output *ResetNotificationSettingsOutput) { - op := &request.Operation{ - Name: opResetNotificationSettings, - HTTPMethod: "PATCH", - HTTPPath: "/reset-notifications-settings", - } - - if input == nil { - input = &ResetNotificationSettingsInput{} - } - - output = &ResetNotificationSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ResetNotificationSettings API operation for IAM Roles Anywhere. -// -// Resets the custom notification setting to IAM Roles Anywhere default setting. -// -// Required permissions: rolesanywhere:ResetNotificationSettings. -// -// 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 IAM Roles Anywhere's -// API operation ResetNotificationSettings for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/ResetNotificationSettings -func (c *RolesAnywhere) ResetNotificationSettings(input *ResetNotificationSettingsInput) (*ResetNotificationSettingsOutput, error) { - req, out := c.ResetNotificationSettingsRequest(input) - return out, req.Send() -} - -// ResetNotificationSettingsWithContext is the same as ResetNotificationSettings with the addition of -// the ability to pass a context and additional request options. -// -// See ResetNotificationSettings 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 *RolesAnywhere) ResetNotificationSettingsWithContext(ctx aws.Context, input *ResetNotificationSettingsInput, opts ...request.Option) (*ResetNotificationSettingsOutput, error) { - req, out := c.ResetNotificationSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/TagResource -func (c *RolesAnywhere) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/TagResource", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for IAM Roles Anywhere. -// -// Attaches tags to a resource. -// -// Required permissions: rolesanywhere:TagResource. -// -// 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 IAM Roles Anywhere's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - TooManyTagsException -// Too many tags. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/TagResource -func (c *RolesAnywhere) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *RolesAnywhere) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/UntagResource -func (c *RolesAnywhere) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/UntagResource", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for IAM Roles Anywhere. -// -// Removes tags from the resource. -// -// Required permissions: rolesanywhere:UntagResource. -// -// 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 IAM Roles Anywhere's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/UntagResource -func (c *RolesAnywhere) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *RolesAnywhere) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateCrl = "UpdateCrl" - -// UpdateCrlRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCrl 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 UpdateCrl for more information on using the UpdateCrl -// 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 UpdateCrlRequest method. -// req, resp := client.UpdateCrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/UpdateCrl -func (c *RolesAnywhere) UpdateCrlRequest(input *UpdateCrlInput) (req *request.Request, output *UpdateCrlOutput) { - op := &request.Operation{ - Name: opUpdateCrl, - HTTPMethod: "PATCH", - HTTPPath: "/crl/{crlId}", - } - - if input == nil { - input = &UpdateCrlInput{} - } - - output = &UpdateCrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateCrl API operation for IAM Roles Anywhere. -// -// Updates the certificate revocation list (CRL). A CRL is a list of certificates -// that have been revoked by the issuing certificate authority (CA). IAM Roles -// Anywhere validates against the CRL before issuing credentials. -// -// Required permissions: rolesanywhere:UpdateCrl. -// -// 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 IAM Roles Anywhere's -// API operation UpdateCrl for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/UpdateCrl -func (c *RolesAnywhere) UpdateCrl(input *UpdateCrlInput) (*UpdateCrlOutput, error) { - req, out := c.UpdateCrlRequest(input) - return out, req.Send() -} - -// UpdateCrlWithContext is the same as UpdateCrl with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateCrl 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 *RolesAnywhere) UpdateCrlWithContext(ctx aws.Context, input *UpdateCrlInput, opts ...request.Option) (*UpdateCrlOutput, error) { - req, out := c.UpdateCrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateProfile = "UpdateProfile" - -// UpdateProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProfile 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 UpdateProfile for more information on using the UpdateProfile -// 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 UpdateProfileRequest method. -// req, resp := client.UpdateProfileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/UpdateProfile -func (c *RolesAnywhere) UpdateProfileRequest(input *UpdateProfileInput) (req *request.Request, output *UpdateProfileOutput) { - op := &request.Operation{ - Name: opUpdateProfile, - HTTPMethod: "PATCH", - HTTPPath: "/profile/{profileId}", - } - - if input == nil { - input = &UpdateProfileInput{} - } - - output = &UpdateProfileOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateProfile API operation for IAM Roles Anywhere. -// -// Updates a profile, a list of the roles that IAM Roles Anywhere service is -// trusted to assume. You use profiles to intersect permissions with IAM managed -// policies. -// -// Required permissions: rolesanywhere:UpdateProfile. -// -// 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 IAM Roles Anywhere's -// API operation UpdateProfile for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/UpdateProfile -func (c *RolesAnywhere) UpdateProfile(input *UpdateProfileInput) (*UpdateProfileOutput, error) { - req, out := c.UpdateProfileRequest(input) - return out, req.Send() -} - -// UpdateProfileWithContext is the same as UpdateProfile with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateProfile 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 *RolesAnywhere) UpdateProfileWithContext(ctx aws.Context, input *UpdateProfileInput, opts ...request.Option) (*UpdateProfileOutput, error) { - req, out := c.UpdateProfileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTrustAnchor = "UpdateTrustAnchor" - -// UpdateTrustAnchorRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTrustAnchor 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 UpdateTrustAnchor for more information on using the UpdateTrustAnchor -// 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 UpdateTrustAnchorRequest method. -// req, resp := client.UpdateTrustAnchorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/UpdateTrustAnchor -func (c *RolesAnywhere) UpdateTrustAnchorRequest(input *UpdateTrustAnchorInput) (req *request.Request, output *UpdateTrustAnchorOutput) { - op := &request.Operation{ - Name: opUpdateTrustAnchor, - HTTPMethod: "PATCH", - HTTPPath: "/trustanchor/{trustAnchorId}", - } - - if input == nil { - input = &UpdateTrustAnchorInput{} - } - - output = &UpdateTrustAnchorOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTrustAnchor API operation for IAM Roles Anywhere. -// -// Updates a trust anchor. You establish trust between IAM Roles Anywhere and -// your certificate authority (CA) by configuring a trust anchor. You can define -// a trust anchor as a reference to an Private Certificate Authority (Private -// CA) or by uploading a CA certificate. Your Amazon Web Services workloads -// can authenticate with the trust anchor using certificates issued by the CA -// in exchange for temporary Amazon Web Services credentials. -// -// Required permissions: rolesanywhere:UpdateTrustAnchor. -// -// 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 IAM Roles Anywhere's -// API operation UpdateTrustAnchor for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// Validation exception error. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/UpdateTrustAnchor -func (c *RolesAnywhere) UpdateTrustAnchor(input *UpdateTrustAnchorInput) (*UpdateTrustAnchorOutput, error) { - req, out := c.UpdateTrustAnchorRequest(input) - return out, req.Send() -} - -// UpdateTrustAnchorWithContext is the same as UpdateTrustAnchor with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTrustAnchor 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 *RolesAnywhere) UpdateTrustAnchorWithContext(ctx aws.Context, input *UpdateTrustAnchorInput, opts ...request.Option) (*UpdateTrustAnchorOutput, error) { - req, out := c.UpdateTrustAnchorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateProfileInput struct { - _ struct{} `type:"structure"` - - // The number of seconds the vended session credentials are valid for. - DurationSeconds *int64 `locationName:"durationSeconds" min:"900" type:"integer"` - - // Specifies whether the profile is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // A list of managed policy ARNs that apply to the vended session credentials. - ManagedPolicyArns []*string `locationName:"managedPolicyArns" type:"list"` - - // The name of the profile. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // Specifies whether instance properties are required in temporary credential - // requests with this profile. - RequireInstanceProperties *bool `locationName:"requireInstanceProperties" type:"boolean"` - - // A list of IAM roles that this profile can assume in a temporary credential - // request. - // - // RoleArns is a required field - RoleArns []*string `locationName:"roleArns" type:"list" required:"true"` - - // A session policy that applies to the trust boundary of the vended session - // credentials. - SessionPolicy *string `locationName:"sessionPolicy" type:"string"` - - // The tags to attach to the profile. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateProfileInput) 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 CreateProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateProfileInput"} - if s.DurationSeconds != nil && *s.DurationSeconds < 900 { - invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RoleArns == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArns")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *CreateProfileInput) SetDurationSeconds(v int64) *CreateProfileInput { - s.DurationSeconds = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *CreateProfileInput) SetEnabled(v bool) *CreateProfileInput { - s.Enabled = &v - return s -} - -// SetManagedPolicyArns sets the ManagedPolicyArns field's value. -func (s *CreateProfileInput) SetManagedPolicyArns(v []*string) *CreateProfileInput { - s.ManagedPolicyArns = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateProfileInput) SetName(v string) *CreateProfileInput { - s.Name = &v - return s -} - -// SetRequireInstanceProperties sets the RequireInstanceProperties field's value. -func (s *CreateProfileInput) SetRequireInstanceProperties(v bool) *CreateProfileInput { - s.RequireInstanceProperties = &v - return s -} - -// SetRoleArns sets the RoleArns field's value. -func (s *CreateProfileInput) SetRoleArns(v []*string) *CreateProfileInput { - s.RoleArns = v - return s -} - -// SetSessionPolicy sets the SessionPolicy field's value. -func (s *CreateProfileInput) SetSessionPolicy(v string) *CreateProfileInput { - s.SessionPolicy = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateProfileInput) SetTags(v []*Tag) *CreateProfileInput { - s.Tags = v - return s -} - -type CreateProfileOutput struct { - _ struct{} `type:"structure"` - - // The state of the profile after a read or write operation. - Profile *ProfileDetail `locationName:"profile" 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 CreateProfileOutput) 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 CreateProfileOutput) GoString() string { - return s.String() -} - -// SetProfile sets the Profile field's value. -func (s *CreateProfileOutput) SetProfile(v *ProfileDetail) *CreateProfileOutput { - s.Profile = v - return s -} - -type CreateTrustAnchorInput struct { - _ struct{} `type:"structure"` - - // Specifies whether the trust anchor is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The name of the trust anchor. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of notification settings to be associated to the trust anchor. - NotificationSettings []*NotificationSetting `locationName:"notificationSettings" type:"list"` - - // The trust anchor type and its related certificate data. - // - // Source is a required field - Source *Source `locationName:"source" type:"structure" required:"true"` - - // The tags to attach to the trust anchor. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateTrustAnchorInput) 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 CreateTrustAnchorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrustAnchorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrustAnchorInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.NotificationSettings != nil { - for i, v := range s.NotificationSettings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NotificationSettings", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Source != nil { - if err := s.Source.Validate(); err != nil { - invalidParams.AddNested("Source", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *CreateTrustAnchorInput) SetEnabled(v bool) *CreateTrustAnchorInput { - s.Enabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTrustAnchorInput) SetName(v string) *CreateTrustAnchorInput { - s.Name = &v - return s -} - -// SetNotificationSettings sets the NotificationSettings field's value. -func (s *CreateTrustAnchorInput) SetNotificationSettings(v []*NotificationSetting) *CreateTrustAnchorInput { - s.NotificationSettings = v - return s -} - -// SetSource sets the Source field's value. -func (s *CreateTrustAnchorInput) SetSource(v *Source) *CreateTrustAnchorInput { - s.Source = v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateTrustAnchorInput) SetTags(v []*Tag) *CreateTrustAnchorInput { - s.Tags = v - return s -} - -type CreateTrustAnchorOutput struct { - _ struct{} `type:"structure"` - - // The state of the trust anchor after a read or write operation. - // - // TrustAnchor is a required field - TrustAnchor *TrustAnchorDetail `locationName:"trustAnchor" type:"structure" 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 CreateTrustAnchorOutput) 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 CreateTrustAnchorOutput) GoString() string { - return s.String() -} - -// SetTrustAnchor sets the TrustAnchor field's value. -func (s *CreateTrustAnchorOutput) SetTrustAnchor(v *TrustAnchorDetail) *CreateTrustAnchorOutput { - s.TrustAnchor = v - return s -} - -// A record of a presented X509 credential from a temporary credential request. -type CredentialSummary struct { - _ struct{} `type:"structure"` - - // Indicates whether the credential is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // Indicates whether the temporary credential request was successful. - Failed *bool `locationName:"failed" type:"boolean"` - - // The fully qualified domain name of the issuing certificate for the presented - // end-entity certificate. - Issuer *string `locationName:"issuer" type:"string"` - - // The ISO-8601 time stamp of when the certificate was last used in a temporary - // credential request. - SeenAt *time.Time `locationName:"seenAt" type:"timestamp" timestampFormat:"iso8601"` - - // The serial number of the certificate. - SerialNumber *string `locationName:"serialNumber" type:"string"` - - // The PEM-encoded data of the certificate. - X509CertificateData *string `locationName:"x509CertificateData" 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 CredentialSummary) 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 CredentialSummary) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *CredentialSummary) SetEnabled(v bool) *CredentialSummary { - s.Enabled = &v - return s -} - -// SetFailed sets the Failed field's value. -func (s *CredentialSummary) SetFailed(v bool) *CredentialSummary { - s.Failed = &v - return s -} - -// SetIssuer sets the Issuer field's value. -func (s *CredentialSummary) SetIssuer(v string) *CredentialSummary { - s.Issuer = &v - return s -} - -// SetSeenAt sets the SeenAt field's value. -func (s *CredentialSummary) SetSeenAt(v time.Time) *CredentialSummary { - s.SeenAt = &v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *CredentialSummary) SetSerialNumber(v string) *CredentialSummary { - s.SerialNumber = &v - return s -} - -// SetX509CertificateData sets the X509CertificateData field's value. -func (s *CredentialSummary) SetX509CertificateData(v string) *CredentialSummary { - s.X509CertificateData = &v - return s -} - -// The state of the certificate revocation list (CRL) after a read or write -// operation. -type CrlDetail struct { - _ struct{} `type:"structure"` - - // The ISO-8601 timestamp when the certificate revocation list (CRL) was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ARN of the certificate revocation list (CRL). - CrlArn *string `locationName:"crlArn" type:"string"` - - // The state of the certificate revocation list (CRL) after a read or write - // operation. - // CrlData is automatically base64 encoded/decoded by the SDK. - CrlData []byte `locationName:"crlData" type:"blob"` - - // The unique identifier of the certificate revocation list (CRL). - CrlId *string `locationName:"crlId" min:"36" type:"string"` - - // Indicates whether the certificate revocation list (CRL) is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The name of the certificate revocation list (CRL). - Name *string `locationName:"name" type:"string"` - - // The ARN of the TrustAnchor the certificate revocation list (CRL) will provide - // revocation for. - TrustAnchorArn *string `locationName:"trustAnchorArn" type:"string"` - - // The ISO-8601 timestamp when the certificate revocation list (CRL) was last - // updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 CrlDetail) 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 CrlDetail) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *CrlDetail) SetCreatedAt(v time.Time) *CrlDetail { - s.CreatedAt = &v - return s -} - -// SetCrlArn sets the CrlArn field's value. -func (s *CrlDetail) SetCrlArn(v string) *CrlDetail { - s.CrlArn = &v - return s -} - -// SetCrlData sets the CrlData field's value. -func (s *CrlDetail) SetCrlData(v []byte) *CrlDetail { - s.CrlData = v - return s -} - -// SetCrlId sets the CrlId field's value. -func (s *CrlDetail) SetCrlId(v string) *CrlDetail { - s.CrlId = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *CrlDetail) SetEnabled(v bool) *CrlDetail { - s.Enabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *CrlDetail) SetName(v string) *CrlDetail { - s.Name = &v - return s -} - -// SetTrustAnchorArn sets the TrustAnchorArn field's value. -func (s *CrlDetail) SetTrustAnchorArn(v string) *CrlDetail { - s.TrustAnchorArn = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *CrlDetail) SetUpdatedAt(v time.Time) *CrlDetail { - s.UpdatedAt = &v - return s -} - -type DeleteCrlInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the certificate revocation list (CRL). - // - // CrlId is a required field - CrlId *string `location:"uri" locationName:"crlId" min:"36" 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 DeleteCrlInput) 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 DeleteCrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCrlInput"} - if s.CrlId == nil { - invalidParams.Add(request.NewErrParamRequired("CrlId")) - } - if s.CrlId != nil && len(*s.CrlId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CrlId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCrlId sets the CrlId field's value. -func (s *DeleteCrlInput) SetCrlId(v string) *DeleteCrlInput { - s.CrlId = &v - return s -} - -type DeleteCrlOutput struct { - _ struct{} `type:"structure"` - - // The state of the certificate revocation list (CRL) after a read or write - // operation. - // - // Crl is a required field - Crl *CrlDetail `locationName:"crl" type:"structure" 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 DeleteCrlOutput) 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 DeleteCrlOutput) GoString() string { - return s.String() -} - -// SetCrl sets the Crl field's value. -func (s *DeleteCrlOutput) SetCrl(v *CrlDetail) *DeleteCrlOutput { - s.Crl = v - return s -} - -type DeleteProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the profile. - // - // ProfileId is a required field - ProfileId *string `location:"uri" locationName:"profileId" min:"36" 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 DeleteProfileInput) 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 DeleteProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteProfileInput"} - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProfileId sets the ProfileId field's value. -func (s *DeleteProfileInput) SetProfileId(v string) *DeleteProfileInput { - s.ProfileId = &v - return s -} - -type DeleteProfileOutput struct { - _ struct{} `type:"structure"` - - // The state of the profile after a read or write operation. - Profile *ProfileDetail `locationName:"profile" 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 DeleteProfileOutput) 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 DeleteProfileOutput) GoString() string { - return s.String() -} - -// SetProfile sets the Profile field's value. -func (s *DeleteProfileOutput) SetProfile(v *ProfileDetail) *DeleteProfileOutput { - s.Profile = v - return s -} - -type DeleteTrustAnchorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the trust anchor. - // - // TrustAnchorId is a required field - TrustAnchorId *string `location:"uri" locationName:"trustAnchorId" min:"36" 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 DeleteTrustAnchorInput) 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 DeleteTrustAnchorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrustAnchorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrustAnchorInput"} - if s.TrustAnchorId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustAnchorId")) - } - if s.TrustAnchorId != nil && len(*s.TrustAnchorId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TrustAnchorId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTrustAnchorId sets the TrustAnchorId field's value. -func (s *DeleteTrustAnchorInput) SetTrustAnchorId(v string) *DeleteTrustAnchorInput { - s.TrustAnchorId = &v - return s -} - -type DeleteTrustAnchorOutput struct { - _ struct{} `type:"structure"` - - // The state of the trust anchor after a read or write operation. - // - // TrustAnchor is a required field - TrustAnchor *TrustAnchorDetail `locationName:"trustAnchor" type:"structure" 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 DeleteTrustAnchorOutput) 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 DeleteTrustAnchorOutput) GoString() string { - return s.String() -} - -// SetTrustAnchor sets the TrustAnchor field's value. -func (s *DeleteTrustAnchorOutput) SetTrustAnchor(v *TrustAnchorDetail) *DeleteTrustAnchorOutput { - s.TrustAnchor = v - return s -} - -type DisableCrlInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the certificate revocation list (CRL). - // - // CrlId is a required field - CrlId *string `location:"uri" locationName:"crlId" min:"36" 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 DisableCrlInput) 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 DisableCrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableCrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableCrlInput"} - if s.CrlId == nil { - invalidParams.Add(request.NewErrParamRequired("CrlId")) - } - if s.CrlId != nil && len(*s.CrlId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CrlId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCrlId sets the CrlId field's value. -func (s *DisableCrlInput) SetCrlId(v string) *DisableCrlInput { - s.CrlId = &v - return s -} - -type DisableCrlOutput struct { - _ struct{} `type:"structure"` - - // The state of the certificate revocation list (CRL) after a read or write - // operation. - // - // Crl is a required field - Crl *CrlDetail `locationName:"crl" type:"structure" 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 DisableCrlOutput) 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 DisableCrlOutput) GoString() string { - return s.String() -} - -// SetCrl sets the Crl field's value. -func (s *DisableCrlOutput) SetCrl(v *CrlDetail) *DisableCrlOutput { - s.Crl = v - return s -} - -type DisableProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the profile. - // - // ProfileId is a required field - ProfileId *string `location:"uri" locationName:"profileId" min:"36" 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 DisableProfileInput) 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 DisableProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableProfileInput"} - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProfileId sets the ProfileId field's value. -func (s *DisableProfileInput) SetProfileId(v string) *DisableProfileInput { - s.ProfileId = &v - return s -} - -type DisableProfileOutput struct { - _ struct{} `type:"structure"` - - // The state of the profile after a read or write operation. - Profile *ProfileDetail `locationName:"profile" 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 DisableProfileOutput) 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 DisableProfileOutput) GoString() string { - return s.String() -} - -// SetProfile sets the Profile field's value. -func (s *DisableProfileOutput) SetProfile(v *ProfileDetail) *DisableProfileOutput { - s.Profile = v - return s -} - -type DisableTrustAnchorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the trust anchor. - // - // TrustAnchorId is a required field - TrustAnchorId *string `location:"uri" locationName:"trustAnchorId" min:"36" 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 DisableTrustAnchorInput) 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 DisableTrustAnchorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableTrustAnchorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableTrustAnchorInput"} - if s.TrustAnchorId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustAnchorId")) - } - if s.TrustAnchorId != nil && len(*s.TrustAnchorId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TrustAnchorId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTrustAnchorId sets the TrustAnchorId field's value. -func (s *DisableTrustAnchorInput) SetTrustAnchorId(v string) *DisableTrustAnchorInput { - s.TrustAnchorId = &v - return s -} - -type DisableTrustAnchorOutput struct { - _ struct{} `type:"structure"` - - // The state of the trust anchor after a read or write operation. - // - // TrustAnchor is a required field - TrustAnchor *TrustAnchorDetail `locationName:"trustAnchor" type:"structure" 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 DisableTrustAnchorOutput) 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 DisableTrustAnchorOutput) GoString() string { - return s.String() -} - -// SetTrustAnchor sets the TrustAnchor field's value. -func (s *DisableTrustAnchorOutput) SetTrustAnchor(v *TrustAnchorDetail) *DisableTrustAnchorOutput { - s.TrustAnchor = v - return s -} - -type EnableCrlInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the certificate revocation list (CRL). - // - // CrlId is a required field - CrlId *string `location:"uri" locationName:"crlId" min:"36" 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 EnableCrlInput) 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 EnableCrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableCrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableCrlInput"} - if s.CrlId == nil { - invalidParams.Add(request.NewErrParamRequired("CrlId")) - } - if s.CrlId != nil && len(*s.CrlId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CrlId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCrlId sets the CrlId field's value. -func (s *EnableCrlInput) SetCrlId(v string) *EnableCrlInput { - s.CrlId = &v - return s -} - -type EnableCrlOutput struct { - _ struct{} `type:"structure"` - - // The state of the certificate revocation list (CRL) after a read or write - // operation. - // - // Crl is a required field - Crl *CrlDetail `locationName:"crl" type:"structure" 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 EnableCrlOutput) 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 EnableCrlOutput) GoString() string { - return s.String() -} - -// SetCrl sets the Crl field's value. -func (s *EnableCrlOutput) SetCrl(v *CrlDetail) *EnableCrlOutput { - s.Crl = v - return s -} - -type EnableProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the profile. - // - // ProfileId is a required field - ProfileId *string `location:"uri" locationName:"profileId" min:"36" 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 EnableProfileInput) 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 EnableProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableProfileInput"} - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProfileId sets the ProfileId field's value. -func (s *EnableProfileInput) SetProfileId(v string) *EnableProfileInput { - s.ProfileId = &v - return s -} - -type EnableProfileOutput struct { - _ struct{} `type:"structure"` - - // The state of the profile after a read or write operation. - Profile *ProfileDetail `locationName:"profile" 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 EnableProfileOutput) 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 EnableProfileOutput) GoString() string { - return s.String() -} - -// SetProfile sets the Profile field's value. -func (s *EnableProfileOutput) SetProfile(v *ProfileDetail) *EnableProfileOutput { - s.Profile = v - return s -} - -type EnableTrustAnchorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the trust anchor. - // - // TrustAnchorId is a required field - TrustAnchorId *string `location:"uri" locationName:"trustAnchorId" min:"36" 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 EnableTrustAnchorInput) 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 EnableTrustAnchorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableTrustAnchorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableTrustAnchorInput"} - if s.TrustAnchorId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustAnchorId")) - } - if s.TrustAnchorId != nil && len(*s.TrustAnchorId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TrustAnchorId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTrustAnchorId sets the TrustAnchorId field's value. -func (s *EnableTrustAnchorInput) SetTrustAnchorId(v string) *EnableTrustAnchorInput { - s.TrustAnchorId = &v - return s -} - -type EnableTrustAnchorOutput struct { - _ struct{} `type:"structure"` - - // The state of the trust anchor after a read or write operation. - // - // TrustAnchor is a required field - TrustAnchor *TrustAnchorDetail `locationName:"trustAnchor" type:"structure" 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 EnableTrustAnchorOutput) 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 EnableTrustAnchorOutput) GoString() string { - return s.String() -} - -// SetTrustAnchor sets the TrustAnchor field's value. -func (s *EnableTrustAnchorOutput) SetTrustAnchor(v *TrustAnchorDetail) *EnableTrustAnchorOutput { - s.TrustAnchor = v - return s -} - -type GetCrlInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the certificate revocation list (CRL). - // - // CrlId is a required field - CrlId *string `location:"uri" locationName:"crlId" min:"36" 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 GetCrlInput) 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 GetCrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCrlInput"} - if s.CrlId == nil { - invalidParams.Add(request.NewErrParamRequired("CrlId")) - } - if s.CrlId != nil && len(*s.CrlId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CrlId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCrlId sets the CrlId field's value. -func (s *GetCrlInput) SetCrlId(v string) *GetCrlInput { - s.CrlId = &v - return s -} - -type GetCrlOutput struct { - _ struct{} `type:"structure"` - - // The state of the certificate revocation list (CRL) after a read or write - // operation. - // - // Crl is a required field - Crl *CrlDetail `locationName:"crl" type:"structure" 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 GetCrlOutput) 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 GetCrlOutput) GoString() string { - return s.String() -} - -// SetCrl sets the Crl field's value. -func (s *GetCrlOutput) SetCrl(v *CrlDetail) *GetCrlOutput { - s.Crl = v - return s -} - -type GetProfileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the profile. - // - // ProfileId is a required field - ProfileId *string `location:"uri" locationName:"profileId" min:"36" 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 GetProfileInput) 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 GetProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetProfileInput"} - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProfileId sets the ProfileId field's value. -func (s *GetProfileInput) SetProfileId(v string) *GetProfileInput { - s.ProfileId = &v - return s -} - -type GetProfileOutput struct { - _ struct{} `type:"structure"` - - // The state of the profile after a read or write operation. - Profile *ProfileDetail `locationName:"profile" 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 GetProfileOutput) 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 GetProfileOutput) GoString() string { - return s.String() -} - -// SetProfile sets the Profile field's value. -func (s *GetProfileOutput) SetProfile(v *ProfileDetail) *GetProfileOutput { - s.Profile = v - return s -} - -type GetSubjectInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the subject. - // - // SubjectId is a required field - SubjectId *string `location:"uri" locationName:"subjectId" min:"36" 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 GetSubjectInput) 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 GetSubjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSubjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSubjectInput"} - if s.SubjectId == nil { - invalidParams.Add(request.NewErrParamRequired("SubjectId")) - } - if s.SubjectId != nil && len(*s.SubjectId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("SubjectId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubjectId sets the SubjectId field's value. -func (s *GetSubjectInput) SetSubjectId(v string) *GetSubjectInput { - s.SubjectId = &v - return s -} - -type GetSubjectOutput struct { - _ struct{} `type:"structure"` - - // The state of the subject after a read or write operation. - Subject *SubjectDetail `locationName:"subject" 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 GetSubjectOutput) 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 GetSubjectOutput) GoString() string { - return s.String() -} - -// SetSubject sets the Subject field's value. -func (s *GetSubjectOutput) SetSubject(v *SubjectDetail) *GetSubjectOutput { - s.Subject = v - return s -} - -type GetTrustAnchorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The unique identifier of the trust anchor. - // - // TrustAnchorId is a required field - TrustAnchorId *string `location:"uri" locationName:"trustAnchorId" min:"36" 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 GetTrustAnchorInput) 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 GetTrustAnchorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTrustAnchorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTrustAnchorInput"} - if s.TrustAnchorId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustAnchorId")) - } - if s.TrustAnchorId != nil && len(*s.TrustAnchorId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TrustAnchorId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTrustAnchorId sets the TrustAnchorId field's value. -func (s *GetTrustAnchorInput) SetTrustAnchorId(v string) *GetTrustAnchorInput { - s.TrustAnchorId = &v - return s -} - -type GetTrustAnchorOutput struct { - _ struct{} `type:"structure"` - - // The state of the trust anchor after a read or write operation. - // - // TrustAnchor is a required field - TrustAnchor *TrustAnchorDetail `locationName:"trustAnchor" type:"structure" 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 GetTrustAnchorOutput) 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 GetTrustAnchorOutput) GoString() string { - return s.String() -} - -// SetTrustAnchor sets the TrustAnchor field's value. -func (s *GetTrustAnchorOutput) SetTrustAnchor(v *TrustAnchorDetail) *GetTrustAnchorOutput { - s.TrustAnchor = v - return s -} - -type ImportCrlInput struct { - _ struct{} `type:"structure"` - - // The x509 v3 specified certificate revocation list (CRL). - // CrlData is automatically base64 encoded/decoded by the SDK. - // - // CrlData is a required field - CrlData []byte `locationName:"crlData" min:"1" type:"blob" required:"true"` - - // Specifies whether the certificate revocation list (CRL) is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The name of the certificate revocation list (CRL). - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` - - // A list of tags to attach to the certificate revocation list (CRL). - Tags []*Tag `locationName:"tags" type:"list"` - - // The ARN of the TrustAnchor the certificate revocation list (CRL) will provide - // revocation for. - // - // TrustAnchorArn is a required field - TrustAnchorArn *string `locationName:"trustAnchorArn" min:"1" 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 ImportCrlInput) 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 ImportCrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportCrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportCrlInput"} - if s.CrlData == nil { - invalidParams.Add(request.NewErrParamRequired("CrlData")) - } - if s.CrlData != nil && len(s.CrlData) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CrlData", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TrustAnchorArn == nil { - invalidParams.Add(request.NewErrParamRequired("TrustAnchorArn")) - } - if s.TrustAnchorArn != nil && len(*s.TrustAnchorArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrustAnchorArn", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCrlData sets the CrlData field's value. -func (s *ImportCrlInput) SetCrlData(v []byte) *ImportCrlInput { - s.CrlData = v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *ImportCrlInput) SetEnabled(v bool) *ImportCrlInput { - s.Enabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *ImportCrlInput) SetName(v string) *ImportCrlInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ImportCrlInput) SetTags(v []*Tag) *ImportCrlInput { - s.Tags = v - return s -} - -// SetTrustAnchorArn sets the TrustAnchorArn field's value. -func (s *ImportCrlInput) SetTrustAnchorArn(v string) *ImportCrlInput { - s.TrustAnchorArn = &v - return s -} - -type ImportCrlOutput struct { - _ struct{} `type:"structure"` - - // The state of the certificate revocation list (CRL) after a read or write - // operation. - // - // Crl is a required field - Crl *CrlDetail `locationName:"crl" type:"structure" 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 ImportCrlOutput) 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 ImportCrlOutput) GoString() string { - return s.String() -} - -// SetCrl sets the Crl field's value. -func (s *ImportCrlOutput) SetCrl(v *CrlDetail) *ImportCrlOutput { - s.Crl = v - return s -} - -// A key-value pair you set that identifies a property of the authenticating -// instance. -type InstanceProperty struct { - _ struct{} `type:"structure"` - - // Indicates whether the temporary credential request was successful. - Failed *bool `locationName:"failed" type:"boolean"` - - // A list of instanceProperty objects. - Properties map[string]*string `locationName:"properties" type:"map"` - - // The ISO-8601 time stamp of when the certificate was last used in a temporary - // credential request. - SeenAt *time.Time `locationName:"seenAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 InstanceProperty) 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 InstanceProperty) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *InstanceProperty) SetFailed(v bool) *InstanceProperty { - s.Failed = &v - return s -} - -// SetProperties sets the Properties field's value. -func (s *InstanceProperty) SetProperties(v map[string]*string) *InstanceProperty { - s.Properties = v - return s -} - -// SetSeenAt sets the SeenAt field's value. -func (s *InstanceProperty) SetSeenAt(v time.Time) *InstanceProperty { - s.SeenAt = &v - return s -} - -type ListCrlsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A token that indicates where the output should continue from, if a previous - // request did not show all results. To get the next results, make the request - // again with this value. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The number of resources in the paginated list. - PageSize *int64 `location:"querystring" locationName:"pageSize" 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 ListCrlsInput) 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 ListCrlsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCrlsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCrlsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCrlsInput) SetNextToken(v string) *ListCrlsInput { - s.NextToken = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *ListCrlsInput) SetPageSize(v int64) *ListCrlsInput { - s.PageSize = &v - return s -} - -type ListCrlsOutput struct { - _ struct{} `type:"structure"` - - // A list of certificate revocation lists (CRL). - Crls []*CrlDetail `locationName:"crls" type:"list"` - - // A token that indicates where the output should continue from, if a previous - // request did not show all results. To get the next results, make the request - // again with this value. - NextToken *string `locationName:"nextToken" 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 ListCrlsOutput) 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 ListCrlsOutput) GoString() string { - return s.String() -} - -// SetCrls sets the Crls field's value. -func (s *ListCrlsOutput) SetCrls(v []*CrlDetail) *ListCrlsOutput { - s.Crls = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCrlsOutput) SetNextToken(v string) *ListCrlsOutput { - s.NextToken = &v - return s -} - -type ListProfilesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A token that indicates where the output should continue from, if a previous - // request did not show all results. To get the next results, make the request - // again with this value. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The number of resources in the paginated list. - PageSize *int64 `location:"querystring" locationName:"pageSize" 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 ListProfilesInput) 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 ListProfilesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProfilesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProfilesInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProfilesInput) SetNextToken(v string) *ListProfilesInput { - s.NextToken = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *ListProfilesInput) SetPageSize(v int64) *ListProfilesInput { - s.PageSize = &v - return s -} - -type ListProfilesOutput struct { - _ struct{} `type:"structure"` - - // A token that indicates where the output should continue from, if a previous - // request did not show all results. To get the next results, make the request - // again with this value. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of profiles. - Profiles []*ProfileDetail `locationName:"profiles" type:"list"` -} - -// 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 ListProfilesOutput) 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 ListProfilesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListProfilesOutput) SetNextToken(v string) *ListProfilesOutput { - s.NextToken = &v - return s -} - -// SetProfiles sets the Profiles field's value. -func (s *ListProfilesOutput) SetProfiles(v []*ProfileDetail) *ListProfilesOutput { - s.Profiles = v - return s -} - -type ListSubjectsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A token that indicates where the output should continue from, if a previous - // request did not show all results. To get the next results, make the request - // again with this value. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The number of resources in the paginated list. - PageSize *int64 `location:"querystring" locationName:"pageSize" 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 ListSubjectsInput) 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 ListSubjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSubjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSubjectsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubjectsInput) SetNextToken(v string) *ListSubjectsInput { - s.NextToken = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *ListSubjectsInput) SetPageSize(v int64) *ListSubjectsInput { - s.PageSize = &v - return s -} - -type ListSubjectsOutput struct { - _ struct{} `type:"structure"` - - // A token that indicates where the output should continue from, if a previous - // request did not show all results. To get the next results, make the request - // again with this value. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of subjects. - Subjects []*SubjectSummary `locationName:"subjects" type:"list"` -} - -// 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 ListSubjectsOutput) 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 ListSubjectsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubjectsOutput) SetNextToken(v string) *ListSubjectsOutput { - s.NextToken = &v - return s -} - -// SetSubjects sets the Subjects field's value. -func (s *ListSubjectsOutput) SetSubjects(v []*SubjectSummary) *ListSubjectsOutput { - s.Subjects = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"querystring" locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A list of tags attached to the resource. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListTrustAnchorsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A token that indicates where the output should continue from, if a previous - // request did not show all results. To get the next results, make the request - // again with this value. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The number of resources in the paginated list. - PageSize *int64 `location:"querystring" locationName:"pageSize" 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 ListTrustAnchorsInput) 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 ListTrustAnchorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTrustAnchorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTrustAnchorsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTrustAnchorsInput) SetNextToken(v string) *ListTrustAnchorsInput { - s.NextToken = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *ListTrustAnchorsInput) SetPageSize(v int64) *ListTrustAnchorsInput { - s.PageSize = &v - return s -} - -type ListTrustAnchorsOutput struct { - _ struct{} `type:"structure"` - - // A token that indicates where the output should continue from, if a previous - // request did not show all results. To get the next results, make the request - // again with this value. - NextToken *string `locationName:"nextToken" type:"string"` - - // A list of trust anchors. - TrustAnchors []*TrustAnchorDetail `locationName:"trustAnchors" type:"list"` -} - -// 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 ListTrustAnchorsOutput) 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 ListTrustAnchorsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTrustAnchorsOutput) SetNextToken(v string) *ListTrustAnchorsOutput { - s.NextToken = &v - return s -} - -// SetTrustAnchors sets the TrustAnchors field's value. -func (s *ListTrustAnchorsOutput) SetTrustAnchors(v []*TrustAnchorDetail) *ListTrustAnchorsOutput { - s.TrustAnchors = v - return s -} - -// Customizable notification settings that will be applied to notification events. -// IAM Roles Anywhere consumes these settings while notifying across multiple -// channels - CloudWatch metrics, EventBridge, and Health Dashboard. -type NotificationSetting struct { - _ struct{} `type:"structure"` - - // The specified channel of notification. IAM Roles Anywhere uses CloudWatch - // metrics, EventBridge, and Health Dashboard to notify for an event. - // - // In the absence of a specific channel, IAM Roles Anywhere applies this setting - // to 'ALL' channels. - Channel *string `locationName:"channel" type:"string" enum:"NotificationChannel"` - - // Indicates whether the notification setting is enabled. - // - // Enabled is a required field - Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` - - // The event to which this notification setting is applied. - // - // Event is a required field - Event *string `locationName:"event" type:"string" required:"true" enum:"NotificationEvent"` - - // The number of days before a notification event. This value is required for - // a notification setting that is enabled. - Threshold *int64 `locationName:"threshold" min:"1" 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 NotificationSetting) 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 NotificationSetting) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NotificationSetting) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NotificationSetting"} - if s.Enabled == nil { - invalidParams.Add(request.NewErrParamRequired("Enabled")) - } - if s.Event == nil { - invalidParams.Add(request.NewErrParamRequired("Event")) - } - if s.Threshold != nil && *s.Threshold < 1 { - invalidParams.Add(request.NewErrParamMinValue("Threshold", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannel sets the Channel field's value. -func (s *NotificationSetting) SetChannel(v string) *NotificationSetting { - s.Channel = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *NotificationSetting) SetEnabled(v bool) *NotificationSetting { - s.Enabled = &v - return s -} - -// SetEvent sets the Event field's value. -func (s *NotificationSetting) SetEvent(v string) *NotificationSetting { - s.Event = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *NotificationSetting) SetThreshold(v int64) *NotificationSetting { - s.Threshold = &v - return s -} - -// The state of a notification setting. -// -// A notification setting includes information such as event name, threshold, -// status of the notification setting, and the channel to notify. -type NotificationSettingDetail struct { - _ struct{} `type:"structure"` - - // The specified channel of notification. IAM Roles Anywhere uses CloudWatch - // metrics, EventBridge, and Health Dashboard to notify for an event. - // - // In the absence of a specific channel, IAM Roles Anywhere applies this setting - // to 'ALL' channels. - Channel *string `locationName:"channel" type:"string" enum:"NotificationChannel"` - - // The principal that configured the notification setting. For default settings - // configured by IAM Roles Anywhere, the value is rolesanywhere.amazonaws.com, - // and for customized notifications settings, it is the respective account ID. - ConfiguredBy *string `locationName:"configuredBy" min:"1" type:"string"` - - // Indicates whether the notification setting is enabled. - // - // Enabled is a required field - Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` - - // The event to which this notification setting is applied. - // - // Event is a required field - Event *string `locationName:"event" type:"string" required:"true" enum:"NotificationEvent"` - - // The number of days before a notification event. - Threshold *int64 `locationName:"threshold" min:"1" 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 NotificationSettingDetail) 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 NotificationSettingDetail) GoString() string { - return s.String() -} - -// SetChannel sets the Channel field's value. -func (s *NotificationSettingDetail) SetChannel(v string) *NotificationSettingDetail { - s.Channel = &v - return s -} - -// SetConfiguredBy sets the ConfiguredBy field's value. -func (s *NotificationSettingDetail) SetConfiguredBy(v string) *NotificationSettingDetail { - s.ConfiguredBy = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *NotificationSettingDetail) SetEnabled(v bool) *NotificationSettingDetail { - s.Enabled = &v - return s -} - -// SetEvent sets the Event field's value. -func (s *NotificationSettingDetail) SetEvent(v string) *NotificationSettingDetail { - s.Event = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *NotificationSettingDetail) SetThreshold(v int64) *NotificationSettingDetail { - s.Threshold = &v - return s -} - -// A notification setting key to reset. A notification setting key includes -// the event and the channel. -type NotificationSettingKey struct { - _ struct{} `type:"structure"` - - // The specified channel of notification. - Channel *string `locationName:"channel" type:"string" enum:"NotificationChannel"` - - // The notification setting event to reset. - // - // Event is a required field - Event *string `locationName:"event" type:"string" required:"true" enum:"NotificationEvent"` -} - -// 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 NotificationSettingKey) 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 NotificationSettingKey) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NotificationSettingKey) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NotificationSettingKey"} - if s.Event == nil { - invalidParams.Add(request.NewErrParamRequired("Event")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannel sets the Channel field's value. -func (s *NotificationSettingKey) SetChannel(v string) *NotificationSettingKey { - s.Channel = &v - return s -} - -// SetEvent sets the Event field's value. -func (s *NotificationSettingKey) SetEvent(v string) *NotificationSettingKey { - s.Event = &v - return s -} - -// The state of the profile after a read or write operation. -type ProfileDetail struct { - _ struct{} `type:"structure"` - - // The ISO-8601 timestamp when the profile was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Web Services account that created the profile. - CreatedBy *string `locationName:"createdBy" type:"string"` - - // The number of seconds the vended session credentials are valid for. - DurationSeconds *int64 `locationName:"durationSeconds" type:"integer"` - - // Indicates whether the profile is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // A list of managed policy ARNs that apply to the vended session credentials. - ManagedPolicyArns []*string `locationName:"managedPolicyArns" type:"list"` - - // The name of the profile. - Name *string `locationName:"name" min:"1" type:"string"` - - // The ARN of the profile. - ProfileArn *string `locationName:"profileArn" min:"1" type:"string"` - - // The unique identifier of the profile. - ProfileId *string `locationName:"profileId" min:"36" type:"string"` - - // Specifies whether instance properties are required in temporary credential - // requests with this profile. - RequireInstanceProperties *bool `locationName:"requireInstanceProperties" type:"boolean"` - - // A list of IAM roles that this profile can assume in a temporary credential - // request. - RoleArns []*string `locationName:"roleArns" type:"list"` - - // A session policy that applies to the trust boundary of the vended session - // credentials. - SessionPolicy *string `locationName:"sessionPolicy" type:"string"` - - // The ISO-8601 timestamp when the profile was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 ProfileDetail) 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 ProfileDetail) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ProfileDetail) SetCreatedAt(v time.Time) *ProfileDetail { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *ProfileDetail) SetCreatedBy(v string) *ProfileDetail { - s.CreatedBy = &v - return s -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *ProfileDetail) SetDurationSeconds(v int64) *ProfileDetail { - s.DurationSeconds = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *ProfileDetail) SetEnabled(v bool) *ProfileDetail { - s.Enabled = &v - return s -} - -// SetManagedPolicyArns sets the ManagedPolicyArns field's value. -func (s *ProfileDetail) SetManagedPolicyArns(v []*string) *ProfileDetail { - s.ManagedPolicyArns = v - return s -} - -// SetName sets the Name field's value. -func (s *ProfileDetail) SetName(v string) *ProfileDetail { - s.Name = &v - return s -} - -// SetProfileArn sets the ProfileArn field's value. -func (s *ProfileDetail) SetProfileArn(v string) *ProfileDetail { - s.ProfileArn = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *ProfileDetail) SetProfileId(v string) *ProfileDetail { - s.ProfileId = &v - return s -} - -// SetRequireInstanceProperties sets the RequireInstanceProperties field's value. -func (s *ProfileDetail) SetRequireInstanceProperties(v bool) *ProfileDetail { - s.RequireInstanceProperties = &v - return s -} - -// SetRoleArns sets the RoleArns field's value. -func (s *ProfileDetail) SetRoleArns(v []*string) *ProfileDetail { - s.RoleArns = v - return s -} - -// SetSessionPolicy sets the SessionPolicy field's value. -func (s *ProfileDetail) SetSessionPolicy(v string) *ProfileDetail { - s.SessionPolicy = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ProfileDetail) SetUpdatedAt(v time.Time) *ProfileDetail { - s.UpdatedAt = &v - return s -} - -type PutNotificationSettingsInput struct { - _ struct{} `type:"structure"` - - // A list of notification settings to be associated to the trust anchor. - // - // NotificationSettings is a required field - NotificationSettings []*NotificationSetting `locationName:"notificationSettings" type:"list" required:"true"` - - // The unique identifier of the trust anchor. - // - // TrustAnchorId is a required field - TrustAnchorId *string `locationName:"trustAnchorId" min:"36" 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 PutNotificationSettingsInput) 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 PutNotificationSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutNotificationSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutNotificationSettingsInput"} - if s.NotificationSettings == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationSettings")) - } - if s.TrustAnchorId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustAnchorId")) - } - if s.TrustAnchorId != nil && len(*s.TrustAnchorId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TrustAnchorId", 36)) - } - if s.NotificationSettings != nil { - for i, v := range s.NotificationSettings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NotificationSettings", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNotificationSettings sets the NotificationSettings field's value. -func (s *PutNotificationSettingsInput) SetNotificationSettings(v []*NotificationSetting) *PutNotificationSettingsInput { - s.NotificationSettings = v - return s -} - -// SetTrustAnchorId sets the TrustAnchorId field's value. -func (s *PutNotificationSettingsInput) SetTrustAnchorId(v string) *PutNotificationSettingsInput { - s.TrustAnchorId = &v - return s -} - -type PutNotificationSettingsOutput struct { - _ struct{} `type:"structure"` - - // The state of the trust anchor after a read or write operation. - // - // TrustAnchor is a required field - TrustAnchor *TrustAnchorDetail `locationName:"trustAnchor" type:"structure" 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 PutNotificationSettingsOutput) 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 PutNotificationSettingsOutput) GoString() string { - return s.String() -} - -// SetTrustAnchor sets the TrustAnchor field's value. -func (s *PutNotificationSettingsOutput) SetTrustAnchor(v *TrustAnchorDetail) *PutNotificationSettingsOutput { - s.TrustAnchor = v - return s -} - -type ResetNotificationSettingsInput struct { - _ struct{} `type:"structure"` - - // A list of notification setting keys to reset. A notification setting key - // includes the event and the channel. - // - // NotificationSettingKeys is a required field - NotificationSettingKeys []*NotificationSettingKey `locationName:"notificationSettingKeys" type:"list" required:"true"` - - // The unique identifier of the trust anchor. - // - // TrustAnchorId is a required field - TrustAnchorId *string `locationName:"trustAnchorId" min:"36" 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 ResetNotificationSettingsInput) 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 ResetNotificationSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResetNotificationSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResetNotificationSettingsInput"} - if s.NotificationSettingKeys == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationSettingKeys")) - } - if s.TrustAnchorId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustAnchorId")) - } - if s.TrustAnchorId != nil && len(*s.TrustAnchorId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TrustAnchorId", 36)) - } - if s.NotificationSettingKeys != nil { - for i, v := range s.NotificationSettingKeys { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NotificationSettingKeys", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNotificationSettingKeys sets the NotificationSettingKeys field's value. -func (s *ResetNotificationSettingsInput) SetNotificationSettingKeys(v []*NotificationSettingKey) *ResetNotificationSettingsInput { - s.NotificationSettingKeys = v - return s -} - -// SetTrustAnchorId sets the TrustAnchorId field's value. -func (s *ResetNotificationSettingsInput) SetTrustAnchorId(v string) *ResetNotificationSettingsInput { - s.TrustAnchorId = &v - return s -} - -type ResetNotificationSettingsOutput struct { - _ struct{} `type:"structure"` - - // The state of the trust anchor after a read or write operation. - // - // TrustAnchor is a required field - TrustAnchor *TrustAnchorDetail `locationName:"trustAnchor" type:"structure" 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 ResetNotificationSettingsOutput) 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 ResetNotificationSettingsOutput) GoString() string { - return s.String() -} - -// SetTrustAnchor sets the TrustAnchor field's value. -func (s *ResetNotificationSettingsOutput) SetTrustAnchor(v *TrustAnchorDetail) *ResetNotificationSettingsOutput { - s.TrustAnchor = v - return s -} - -// The resource could not be found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The trust anchor type and its related certificate data. -type Source struct { - _ struct{} `type:"structure"` - - // The data field of the trust anchor depending on its type. - SourceData *SourceData `locationName:"sourceData" type:"structure"` - - // The type of the trust anchor. - SourceType *string `locationName:"sourceType" type:"string" enum:"TrustAnchorType"` -} - -// 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 Source) 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 Source) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Source) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Source"} - if s.SourceData != nil { - if err := s.SourceData.Validate(); err != nil { - invalidParams.AddNested("SourceData", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceData sets the SourceData field's value. -func (s *Source) SetSourceData(v *SourceData) *Source { - s.SourceData = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *Source) SetSourceType(v string) *Source { - s.SourceType = &v - return s -} - -// The data field of the trust anchor depending on its type. -type SourceData struct { - _ struct{} `type:"structure"` - - // The root certificate of the Private Certificate Authority specified by this - // ARN is used in trust validation for temporary credential requests. Included - // for trust anchors of type AWS_ACM_PCA. - AcmPcaArn *string `locationName:"acmPcaArn" type:"string"` - - // The PEM-encoded data for the certificate anchor. Included for trust anchors - // of type CERTIFICATE_BUNDLE. - X509CertificateData *string `locationName:"x509CertificateData" min:"1" 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 SourceData) 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 SourceData) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceData) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceData"} - if s.X509CertificateData != nil && len(*s.X509CertificateData) < 1 { - invalidParams.Add(request.NewErrParamMinLen("X509CertificateData", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAcmPcaArn sets the AcmPcaArn field's value. -func (s *SourceData) SetAcmPcaArn(v string) *SourceData { - s.AcmPcaArn = &v - return s -} - -// SetX509CertificateData sets the X509CertificateData field's value. -func (s *SourceData) SetX509CertificateData(v string) *SourceData { - s.X509CertificateData = &v - return s -} - -// The state of the subject after a read or write operation. -type SubjectDetail struct { - _ struct{} `type:"structure"` - - // The ISO-8601 timestamp when the subject was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The temporary session credentials vended at the last authenticating call - // with this subject. - Credentials []*CredentialSummary `locationName:"credentials" type:"list"` - - // The enabled status of the subject. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The specified instance properties associated with the request. - InstanceProperties []*InstanceProperty `locationName:"instanceProperties" type:"list"` - - // The ISO-8601 timestamp of the last time this subject requested temporary - // session credentials. - LastSeenAt *time.Time `locationName:"lastSeenAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ARN of the resource. - SubjectArn *string `locationName:"subjectArn" type:"string"` - - // The id of the resource - SubjectId *string `locationName:"subjectId" min:"36" type:"string"` - - // The ISO-8601 timestamp when the subject was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The x509 principal identifier of the authenticating certificate. - X509Subject *string `locationName:"x509Subject" 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 SubjectDetail) 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 SubjectDetail) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SubjectDetail) SetCreatedAt(v time.Time) *SubjectDetail { - s.CreatedAt = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *SubjectDetail) SetCredentials(v []*CredentialSummary) *SubjectDetail { - s.Credentials = v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *SubjectDetail) SetEnabled(v bool) *SubjectDetail { - s.Enabled = &v - return s -} - -// SetInstanceProperties sets the InstanceProperties field's value. -func (s *SubjectDetail) SetInstanceProperties(v []*InstanceProperty) *SubjectDetail { - s.InstanceProperties = v - return s -} - -// SetLastSeenAt sets the LastSeenAt field's value. -func (s *SubjectDetail) SetLastSeenAt(v time.Time) *SubjectDetail { - s.LastSeenAt = &v - return s -} - -// SetSubjectArn sets the SubjectArn field's value. -func (s *SubjectDetail) SetSubjectArn(v string) *SubjectDetail { - s.SubjectArn = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *SubjectDetail) SetSubjectId(v string) *SubjectDetail { - s.SubjectId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SubjectDetail) SetUpdatedAt(v time.Time) *SubjectDetail { - s.UpdatedAt = &v - return s -} - -// SetX509Subject sets the X509Subject field's value. -func (s *SubjectDetail) SetX509Subject(v string) *SubjectDetail { - s.X509Subject = &v - return s -} - -// A summary representation of subjects. -type SubjectSummary struct { - _ struct{} `type:"structure"` - - // The ISO-8601 time stamp of when the certificate was first used in a temporary - // credential request. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The enabled status of the subject. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The ISO-8601 time stamp of when the certificate was last used in a temporary - // credential request. - LastSeenAt *time.Time `locationName:"lastSeenAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ARN of the resource. - SubjectArn *string `locationName:"subjectArn" type:"string"` - - // The id of the resource. - SubjectId *string `locationName:"subjectId" min:"36" type:"string"` - - // The ISO-8601 timestamp when the subject was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The x509 principal identifier of the authenticating certificate. - X509Subject *string `locationName:"x509Subject" 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 SubjectSummary) 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 SubjectSummary) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SubjectSummary) SetCreatedAt(v time.Time) *SubjectSummary { - s.CreatedAt = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *SubjectSummary) SetEnabled(v bool) *SubjectSummary { - s.Enabled = &v - return s -} - -// SetLastSeenAt sets the LastSeenAt field's value. -func (s *SubjectSummary) SetLastSeenAt(v time.Time) *SubjectSummary { - s.LastSeenAt = &v - return s -} - -// SetSubjectArn sets the SubjectArn field's value. -func (s *SubjectSummary) SetSubjectArn(v string) *SubjectSummary { - s.SubjectArn = &v - return s -} - -// SetSubjectId sets the SubjectId field's value. -func (s *SubjectSummary) SetSubjectId(v string) *SubjectSummary { - s.SubjectId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SubjectSummary) SetUpdatedAt(v time.Time) *SubjectSummary { - s.UpdatedAt = &v - return s -} - -// SetX509Subject sets the X509Subject field's value. -func (s *SubjectSummary) SetX509Subject(v string) *SubjectSummary { - s.X509Subject = &v - return s -} - -// A label that consists of a key and value you define. -type Tag struct { - _ struct{} `type:"structure"` - - // The tag key. - // - // Key is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Tag's - // String and GoString methods. - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true" sensitive:"true"` - - // The tag value. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Tag's - // String and GoString methods. - // - // Value is a required field - Value *string `locationName:"value" type:"string" required:"true" sensitive:"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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // The tags to attach to the resource. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Too many tags. -type TooManyTagsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 TooManyTagsException) 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 TooManyTagsException) GoString() string { - return s.String() -} - -func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { - return &TooManyTagsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyTagsException) Code() string { - return "TooManyTagsException" -} - -// Message returns the exception's message. -func (s *TooManyTagsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyTagsException) OrigErr() error { - return nil -} - -func (s *TooManyTagsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyTagsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyTagsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The state of the trust anchor after a read or write operation. -type TrustAnchorDetail struct { - _ struct{} `type:"structure"` - - // The ISO-8601 timestamp when the trust anchor was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // Indicates whether the trust anchor is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The name of the trust anchor. - Name *string `locationName:"name" min:"1" type:"string"` - - // A list of notification settings to be associated to the trust anchor. - NotificationSettings []*NotificationSettingDetail `locationName:"notificationSettings" type:"list"` - - // The trust anchor type and its related certificate data. - Source *Source `locationName:"source" type:"structure"` - - // The ARN of the trust anchor. - TrustAnchorArn *string `locationName:"trustAnchorArn" type:"string"` - - // The unique identifier of the trust anchor. - TrustAnchorId *string `locationName:"trustAnchorId" min:"36" type:"string"` - - // The ISO-8601 timestamp when the trust anchor was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 TrustAnchorDetail) 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 TrustAnchorDetail) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *TrustAnchorDetail) SetCreatedAt(v time.Time) *TrustAnchorDetail { - s.CreatedAt = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *TrustAnchorDetail) SetEnabled(v bool) *TrustAnchorDetail { - s.Enabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *TrustAnchorDetail) SetName(v string) *TrustAnchorDetail { - s.Name = &v - return s -} - -// SetNotificationSettings sets the NotificationSettings field's value. -func (s *TrustAnchorDetail) SetNotificationSettings(v []*NotificationSettingDetail) *TrustAnchorDetail { - s.NotificationSettings = v - return s -} - -// SetSource sets the Source field's value. -func (s *TrustAnchorDetail) SetSource(v *Source) *TrustAnchorDetail { - s.Source = v - return s -} - -// SetTrustAnchorArn sets the TrustAnchorArn field's value. -func (s *TrustAnchorDetail) SetTrustAnchorArn(v string) *TrustAnchorDetail { - s.TrustAnchorArn = &v - return s -} - -// SetTrustAnchorId sets the TrustAnchorId field's value. -func (s *TrustAnchorDetail) SetTrustAnchorId(v string) *TrustAnchorDetail { - s.TrustAnchorId = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *TrustAnchorDetail) SetUpdatedAt(v time.Time) *TrustAnchorDetail { - s.UpdatedAt = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The ARN of the resource. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // A list of keys. Tag keys are the unique identifiers of tags. - // - // TagKeys is a required field - TagKeys []*string `locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateCrlInput struct { - _ struct{} `type:"structure"` - - // The x509 v3 specified certificate revocation list (CRL). - // CrlData is automatically base64 encoded/decoded by the SDK. - CrlData []byte `locationName:"crlData" min:"1" type:"blob"` - - // The unique identifier of the certificate revocation list (CRL). - // - // CrlId is a required field - CrlId *string `location:"uri" locationName:"crlId" min:"36" type:"string" required:"true"` - - // The name of the Crl. - Name *string `locationName:"name" min:"1" 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 UpdateCrlInput) 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 UpdateCrlInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCrlInput"} - if s.CrlData != nil && len(s.CrlData) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CrlData", 1)) - } - if s.CrlId == nil { - invalidParams.Add(request.NewErrParamRequired("CrlId")) - } - if s.CrlId != nil && len(*s.CrlId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("CrlId", 36)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCrlData sets the CrlData field's value. -func (s *UpdateCrlInput) SetCrlData(v []byte) *UpdateCrlInput { - s.CrlData = v - return s -} - -// SetCrlId sets the CrlId field's value. -func (s *UpdateCrlInput) SetCrlId(v string) *UpdateCrlInput { - s.CrlId = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateCrlInput) SetName(v string) *UpdateCrlInput { - s.Name = &v - return s -} - -type UpdateCrlOutput struct { - _ struct{} `type:"structure"` - - // The state of the certificate revocation list (CRL) after a read or write - // operation. - // - // Crl is a required field - Crl *CrlDetail `locationName:"crl" type:"structure" 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 UpdateCrlOutput) 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 UpdateCrlOutput) GoString() string { - return s.String() -} - -// SetCrl sets the Crl field's value. -func (s *UpdateCrlOutput) SetCrl(v *CrlDetail) *UpdateCrlOutput { - s.Crl = v - return s -} - -type UpdateProfileInput struct { - _ struct{} `type:"structure"` - - // The number of seconds the vended session credentials are valid for. - DurationSeconds *int64 `locationName:"durationSeconds" min:"900" type:"integer"` - - // A list of managed policy ARNs that apply to the vended session credentials. - ManagedPolicyArns []*string `locationName:"managedPolicyArns" type:"list"` - - // The name of the profile. - Name *string `locationName:"name" min:"1" type:"string"` - - // The unique identifier of the profile. - // - // ProfileId is a required field - ProfileId *string `location:"uri" locationName:"profileId" min:"36" type:"string" required:"true"` - - // A list of IAM roles that this profile can assume in a temporary credential - // request. - RoleArns []*string `locationName:"roleArns" type:"list"` - - // A session policy that applies to the trust boundary of the vended session - // credentials. - SessionPolicy *string `locationName:"sessionPolicy" min:"1" 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 UpdateProfileInput) 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 UpdateProfileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateProfileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateProfileInput"} - if s.DurationSeconds != nil && *s.DurationSeconds < 900 { - invalidParams.Add(request.NewErrParamMinValue("DurationSeconds", 900)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ProfileId == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileId")) - } - if s.ProfileId != nil && len(*s.ProfileId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ProfileId", 36)) - } - if s.SessionPolicy != nil && len(*s.SessionPolicy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SessionPolicy", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDurationSeconds sets the DurationSeconds field's value. -func (s *UpdateProfileInput) SetDurationSeconds(v int64) *UpdateProfileInput { - s.DurationSeconds = &v - return s -} - -// SetManagedPolicyArns sets the ManagedPolicyArns field's value. -func (s *UpdateProfileInput) SetManagedPolicyArns(v []*string) *UpdateProfileInput { - s.ManagedPolicyArns = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateProfileInput) SetName(v string) *UpdateProfileInput { - s.Name = &v - return s -} - -// SetProfileId sets the ProfileId field's value. -func (s *UpdateProfileInput) SetProfileId(v string) *UpdateProfileInput { - s.ProfileId = &v - return s -} - -// SetRoleArns sets the RoleArns field's value. -func (s *UpdateProfileInput) SetRoleArns(v []*string) *UpdateProfileInput { - s.RoleArns = v - return s -} - -// SetSessionPolicy sets the SessionPolicy field's value. -func (s *UpdateProfileInput) SetSessionPolicy(v string) *UpdateProfileInput { - s.SessionPolicy = &v - return s -} - -type UpdateProfileOutput struct { - _ struct{} `type:"structure"` - - // The state of the profile after a read or write operation. - Profile *ProfileDetail `locationName:"profile" 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 UpdateProfileOutput) 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 UpdateProfileOutput) GoString() string { - return s.String() -} - -// SetProfile sets the Profile field's value. -func (s *UpdateProfileOutput) SetProfile(v *ProfileDetail) *UpdateProfileOutput { - s.Profile = v - return s -} - -type UpdateTrustAnchorInput struct { - _ struct{} `type:"structure"` - - // The name of the trust anchor. - Name *string `locationName:"name" min:"1" type:"string"` - - // The trust anchor type and its related certificate data. - Source *Source `locationName:"source" type:"structure"` - - // The unique identifier of the trust anchor. - // - // TrustAnchorId is a required field - TrustAnchorId *string `location:"uri" locationName:"trustAnchorId" min:"36" 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 UpdateTrustAnchorInput) 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 UpdateTrustAnchorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTrustAnchorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTrustAnchorInput"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.TrustAnchorId == nil { - invalidParams.Add(request.NewErrParamRequired("TrustAnchorId")) - } - if s.TrustAnchorId != nil && len(*s.TrustAnchorId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("TrustAnchorId", 36)) - } - if s.Source != nil { - if err := s.Source.Validate(); err != nil { - invalidParams.AddNested("Source", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *UpdateTrustAnchorInput) SetName(v string) *UpdateTrustAnchorInput { - s.Name = &v - return s -} - -// SetSource sets the Source field's value. -func (s *UpdateTrustAnchorInput) SetSource(v *Source) *UpdateTrustAnchorInput { - s.Source = v - return s -} - -// SetTrustAnchorId sets the TrustAnchorId field's value. -func (s *UpdateTrustAnchorInput) SetTrustAnchorId(v string) *UpdateTrustAnchorInput { - s.TrustAnchorId = &v - return s -} - -type UpdateTrustAnchorOutput struct { - _ struct{} `type:"structure"` - - // The state of the trust anchor after a read or write operation. - // - // TrustAnchor is a required field - TrustAnchor *TrustAnchorDetail `locationName:"trustAnchor" type:"structure" 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 UpdateTrustAnchorOutput) 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 UpdateTrustAnchorOutput) GoString() string { - return s.String() -} - -// SetTrustAnchor sets the TrustAnchor field's value. -func (s *UpdateTrustAnchorOutput) SetTrustAnchor(v *TrustAnchorDetail) *UpdateTrustAnchorOutput { - s.TrustAnchor = v - return s -} - -// Validation exception error. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // NotificationChannelAll is a NotificationChannel enum value - NotificationChannelAll = "ALL" -) - -// NotificationChannel_Values returns all elements of the NotificationChannel enum -func NotificationChannel_Values() []string { - return []string{ - NotificationChannelAll, - } -} - -const ( - // NotificationEventCaCertificateExpiry is a NotificationEvent enum value - NotificationEventCaCertificateExpiry = "CA_CERTIFICATE_EXPIRY" - - // NotificationEventEndEntityCertificateExpiry is a NotificationEvent enum value - NotificationEventEndEntityCertificateExpiry = "END_ENTITY_CERTIFICATE_EXPIRY" -) - -// NotificationEvent_Values returns all elements of the NotificationEvent enum -func NotificationEvent_Values() []string { - return []string{ - NotificationEventCaCertificateExpiry, - NotificationEventEndEntityCertificateExpiry, - } -} - -const ( - // TrustAnchorTypeAwsAcmPca is a TrustAnchorType enum value - TrustAnchorTypeAwsAcmPca = "AWS_ACM_PCA" - - // TrustAnchorTypeCertificateBundle is a TrustAnchorType enum value - TrustAnchorTypeCertificateBundle = "CERTIFICATE_BUNDLE" - - // TrustAnchorTypeSelfSignedRepository is a TrustAnchorType enum value - TrustAnchorTypeSelfSignedRepository = "SELF_SIGNED_REPOSITORY" -) - -// TrustAnchorType_Values returns all elements of the TrustAnchorType enum -func TrustAnchorType_Values() []string { - return []string{ - TrustAnchorTypeAwsAcmPca, - TrustAnchorTypeCertificateBundle, - TrustAnchorTypeSelfSignedRepository, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/doc.go deleted file mode 100644 index 816b353d7cb1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/doc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package rolesanywhere provides the client and types for making API -// requests to IAM Roles Anywhere. -// -// Identity and Access Management Roles Anywhere provides a secure way for your -// workloads such as servers, containers, and applications that run outside -// of Amazon Web Services to obtain temporary Amazon Web Services credentials. -// Your workloads can use the same IAM policies and roles you have for native -// Amazon Web Services applications to access Amazon Web Services resources. -// Using IAM Roles Anywhere eliminates the need to manage long-term credentials -// for workloads running outside of Amazon Web Services. -// -// To use IAM Roles Anywhere, your workloads must use X.509 certificates issued -// by their certificate authority (CA). You register the CA with IAM Roles Anywhere -// as a trust anchor to establish trust between your public key infrastructure -// (PKI) and IAM Roles Anywhere. If you don't manage your own PKI system, you -// can use Private Certificate Authority to create a CA and then use that to -// establish trust with IAM Roles Anywhere. -// -// This guide describes the IAM Roles Anywhere operations that you can call -// programmatically. For more information about IAM Roles Anywhere, see the -// IAM Roles Anywhere User Guide (https://docs.aws.amazon.com/rolesanywhere/latest/userguide/introduction.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10 for more information on this service. -// -// See rolesanywhere package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/rolesanywhere/ -// -// # Using the Client -// -// To contact IAM Roles Anywhere with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the IAM Roles Anywhere client RolesAnywhere for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/rolesanywhere/#New -package rolesanywhere diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/errors.go deleted file mode 100644 index 7df1abe403aa..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/errors.go +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package rolesanywhere - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource could not be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTagsException". - // - // Too many tags. - ErrCodeTooManyTagsException = "TooManyTagsException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Validation exception error. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "TooManyTagsException": newErrorTooManyTagsException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/rolesanywhereiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/rolesanywhereiface/interface.go deleted file mode 100644 index 09e915a3332a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/rolesanywhereiface/interface.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package rolesanywhereiface provides an interface to enable mocking the IAM Roles Anywhere service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package rolesanywhereiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere" -) - -// RolesAnywhereAPI provides an interface to enable mocking the -// rolesanywhere.RolesAnywhere service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // IAM Roles Anywhere. -// func myFunc(svc rolesanywhereiface.RolesAnywhereAPI) bool { -// // Make svc.CreateProfile request -// } -// -// func main() { -// sess := session.New() -// svc := rolesanywhere.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockRolesAnywhereClient struct { -// rolesanywhereiface.RolesAnywhereAPI -// } -// func (m *mockRolesAnywhereClient) CreateProfile(input *rolesanywhere.CreateProfileInput) (*rolesanywhere.CreateProfileOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockRolesAnywhereClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type RolesAnywhereAPI interface { - CreateProfile(*rolesanywhere.CreateProfileInput) (*rolesanywhere.CreateProfileOutput, error) - CreateProfileWithContext(aws.Context, *rolesanywhere.CreateProfileInput, ...request.Option) (*rolesanywhere.CreateProfileOutput, error) - CreateProfileRequest(*rolesanywhere.CreateProfileInput) (*request.Request, *rolesanywhere.CreateProfileOutput) - - CreateTrustAnchor(*rolesanywhere.CreateTrustAnchorInput) (*rolesanywhere.CreateTrustAnchorOutput, error) - CreateTrustAnchorWithContext(aws.Context, *rolesanywhere.CreateTrustAnchorInput, ...request.Option) (*rolesanywhere.CreateTrustAnchorOutput, error) - CreateTrustAnchorRequest(*rolesanywhere.CreateTrustAnchorInput) (*request.Request, *rolesanywhere.CreateTrustAnchorOutput) - - DeleteCrl(*rolesanywhere.DeleteCrlInput) (*rolesanywhere.DeleteCrlOutput, error) - DeleteCrlWithContext(aws.Context, *rolesanywhere.DeleteCrlInput, ...request.Option) (*rolesanywhere.DeleteCrlOutput, error) - DeleteCrlRequest(*rolesanywhere.DeleteCrlInput) (*request.Request, *rolesanywhere.DeleteCrlOutput) - - DeleteProfile(*rolesanywhere.DeleteProfileInput) (*rolesanywhere.DeleteProfileOutput, error) - DeleteProfileWithContext(aws.Context, *rolesanywhere.DeleteProfileInput, ...request.Option) (*rolesanywhere.DeleteProfileOutput, error) - DeleteProfileRequest(*rolesanywhere.DeleteProfileInput) (*request.Request, *rolesanywhere.DeleteProfileOutput) - - DeleteTrustAnchor(*rolesanywhere.DeleteTrustAnchorInput) (*rolesanywhere.DeleteTrustAnchorOutput, error) - DeleteTrustAnchorWithContext(aws.Context, *rolesanywhere.DeleteTrustAnchorInput, ...request.Option) (*rolesanywhere.DeleteTrustAnchorOutput, error) - DeleteTrustAnchorRequest(*rolesanywhere.DeleteTrustAnchorInput) (*request.Request, *rolesanywhere.DeleteTrustAnchorOutput) - - DisableCrl(*rolesanywhere.DisableCrlInput) (*rolesanywhere.DisableCrlOutput, error) - DisableCrlWithContext(aws.Context, *rolesanywhere.DisableCrlInput, ...request.Option) (*rolesanywhere.DisableCrlOutput, error) - DisableCrlRequest(*rolesanywhere.DisableCrlInput) (*request.Request, *rolesanywhere.DisableCrlOutput) - - DisableProfile(*rolesanywhere.DisableProfileInput) (*rolesanywhere.DisableProfileOutput, error) - DisableProfileWithContext(aws.Context, *rolesanywhere.DisableProfileInput, ...request.Option) (*rolesanywhere.DisableProfileOutput, error) - DisableProfileRequest(*rolesanywhere.DisableProfileInput) (*request.Request, *rolesanywhere.DisableProfileOutput) - - DisableTrustAnchor(*rolesanywhere.DisableTrustAnchorInput) (*rolesanywhere.DisableTrustAnchorOutput, error) - DisableTrustAnchorWithContext(aws.Context, *rolesanywhere.DisableTrustAnchorInput, ...request.Option) (*rolesanywhere.DisableTrustAnchorOutput, error) - DisableTrustAnchorRequest(*rolesanywhere.DisableTrustAnchorInput) (*request.Request, *rolesanywhere.DisableTrustAnchorOutput) - - EnableCrl(*rolesanywhere.EnableCrlInput) (*rolesanywhere.EnableCrlOutput, error) - EnableCrlWithContext(aws.Context, *rolesanywhere.EnableCrlInput, ...request.Option) (*rolesanywhere.EnableCrlOutput, error) - EnableCrlRequest(*rolesanywhere.EnableCrlInput) (*request.Request, *rolesanywhere.EnableCrlOutput) - - EnableProfile(*rolesanywhere.EnableProfileInput) (*rolesanywhere.EnableProfileOutput, error) - EnableProfileWithContext(aws.Context, *rolesanywhere.EnableProfileInput, ...request.Option) (*rolesanywhere.EnableProfileOutput, error) - EnableProfileRequest(*rolesanywhere.EnableProfileInput) (*request.Request, *rolesanywhere.EnableProfileOutput) - - EnableTrustAnchor(*rolesanywhere.EnableTrustAnchorInput) (*rolesanywhere.EnableTrustAnchorOutput, error) - EnableTrustAnchorWithContext(aws.Context, *rolesanywhere.EnableTrustAnchorInput, ...request.Option) (*rolesanywhere.EnableTrustAnchorOutput, error) - EnableTrustAnchorRequest(*rolesanywhere.EnableTrustAnchorInput) (*request.Request, *rolesanywhere.EnableTrustAnchorOutput) - - GetCrl(*rolesanywhere.GetCrlInput) (*rolesanywhere.GetCrlOutput, error) - GetCrlWithContext(aws.Context, *rolesanywhere.GetCrlInput, ...request.Option) (*rolesanywhere.GetCrlOutput, error) - GetCrlRequest(*rolesanywhere.GetCrlInput) (*request.Request, *rolesanywhere.GetCrlOutput) - - GetProfile(*rolesanywhere.GetProfileInput) (*rolesanywhere.GetProfileOutput, error) - GetProfileWithContext(aws.Context, *rolesanywhere.GetProfileInput, ...request.Option) (*rolesanywhere.GetProfileOutput, error) - GetProfileRequest(*rolesanywhere.GetProfileInput) (*request.Request, *rolesanywhere.GetProfileOutput) - - GetSubject(*rolesanywhere.GetSubjectInput) (*rolesanywhere.GetSubjectOutput, error) - GetSubjectWithContext(aws.Context, *rolesanywhere.GetSubjectInput, ...request.Option) (*rolesanywhere.GetSubjectOutput, error) - GetSubjectRequest(*rolesanywhere.GetSubjectInput) (*request.Request, *rolesanywhere.GetSubjectOutput) - - GetTrustAnchor(*rolesanywhere.GetTrustAnchorInput) (*rolesanywhere.GetTrustAnchorOutput, error) - GetTrustAnchorWithContext(aws.Context, *rolesanywhere.GetTrustAnchorInput, ...request.Option) (*rolesanywhere.GetTrustAnchorOutput, error) - GetTrustAnchorRequest(*rolesanywhere.GetTrustAnchorInput) (*request.Request, *rolesanywhere.GetTrustAnchorOutput) - - ImportCrl(*rolesanywhere.ImportCrlInput) (*rolesanywhere.ImportCrlOutput, error) - ImportCrlWithContext(aws.Context, *rolesanywhere.ImportCrlInput, ...request.Option) (*rolesanywhere.ImportCrlOutput, error) - ImportCrlRequest(*rolesanywhere.ImportCrlInput) (*request.Request, *rolesanywhere.ImportCrlOutput) - - ListCrls(*rolesanywhere.ListCrlsInput) (*rolesanywhere.ListCrlsOutput, error) - ListCrlsWithContext(aws.Context, *rolesanywhere.ListCrlsInput, ...request.Option) (*rolesanywhere.ListCrlsOutput, error) - ListCrlsRequest(*rolesanywhere.ListCrlsInput) (*request.Request, *rolesanywhere.ListCrlsOutput) - - ListCrlsPages(*rolesanywhere.ListCrlsInput, func(*rolesanywhere.ListCrlsOutput, bool) bool) error - ListCrlsPagesWithContext(aws.Context, *rolesanywhere.ListCrlsInput, func(*rolesanywhere.ListCrlsOutput, bool) bool, ...request.Option) error - - ListProfiles(*rolesanywhere.ListProfilesInput) (*rolesanywhere.ListProfilesOutput, error) - ListProfilesWithContext(aws.Context, *rolesanywhere.ListProfilesInput, ...request.Option) (*rolesanywhere.ListProfilesOutput, error) - ListProfilesRequest(*rolesanywhere.ListProfilesInput) (*request.Request, *rolesanywhere.ListProfilesOutput) - - ListProfilesPages(*rolesanywhere.ListProfilesInput, func(*rolesanywhere.ListProfilesOutput, bool) bool) error - ListProfilesPagesWithContext(aws.Context, *rolesanywhere.ListProfilesInput, func(*rolesanywhere.ListProfilesOutput, bool) bool, ...request.Option) error - - ListSubjects(*rolesanywhere.ListSubjectsInput) (*rolesanywhere.ListSubjectsOutput, error) - ListSubjectsWithContext(aws.Context, *rolesanywhere.ListSubjectsInput, ...request.Option) (*rolesanywhere.ListSubjectsOutput, error) - ListSubjectsRequest(*rolesanywhere.ListSubjectsInput) (*request.Request, *rolesanywhere.ListSubjectsOutput) - - ListSubjectsPages(*rolesanywhere.ListSubjectsInput, func(*rolesanywhere.ListSubjectsOutput, bool) bool) error - ListSubjectsPagesWithContext(aws.Context, *rolesanywhere.ListSubjectsInput, func(*rolesanywhere.ListSubjectsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*rolesanywhere.ListTagsForResourceInput) (*rolesanywhere.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *rolesanywhere.ListTagsForResourceInput, ...request.Option) (*rolesanywhere.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*rolesanywhere.ListTagsForResourceInput) (*request.Request, *rolesanywhere.ListTagsForResourceOutput) - - ListTrustAnchors(*rolesanywhere.ListTrustAnchorsInput) (*rolesanywhere.ListTrustAnchorsOutput, error) - ListTrustAnchorsWithContext(aws.Context, *rolesanywhere.ListTrustAnchorsInput, ...request.Option) (*rolesanywhere.ListTrustAnchorsOutput, error) - ListTrustAnchorsRequest(*rolesanywhere.ListTrustAnchorsInput) (*request.Request, *rolesanywhere.ListTrustAnchorsOutput) - - ListTrustAnchorsPages(*rolesanywhere.ListTrustAnchorsInput, func(*rolesanywhere.ListTrustAnchorsOutput, bool) bool) error - ListTrustAnchorsPagesWithContext(aws.Context, *rolesanywhere.ListTrustAnchorsInput, func(*rolesanywhere.ListTrustAnchorsOutput, bool) bool, ...request.Option) error - - PutNotificationSettings(*rolesanywhere.PutNotificationSettingsInput) (*rolesanywhere.PutNotificationSettingsOutput, error) - PutNotificationSettingsWithContext(aws.Context, *rolesanywhere.PutNotificationSettingsInput, ...request.Option) (*rolesanywhere.PutNotificationSettingsOutput, error) - PutNotificationSettingsRequest(*rolesanywhere.PutNotificationSettingsInput) (*request.Request, *rolesanywhere.PutNotificationSettingsOutput) - - ResetNotificationSettings(*rolesanywhere.ResetNotificationSettingsInput) (*rolesanywhere.ResetNotificationSettingsOutput, error) - ResetNotificationSettingsWithContext(aws.Context, *rolesanywhere.ResetNotificationSettingsInput, ...request.Option) (*rolesanywhere.ResetNotificationSettingsOutput, error) - ResetNotificationSettingsRequest(*rolesanywhere.ResetNotificationSettingsInput) (*request.Request, *rolesanywhere.ResetNotificationSettingsOutput) - - TagResource(*rolesanywhere.TagResourceInput) (*rolesanywhere.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *rolesanywhere.TagResourceInput, ...request.Option) (*rolesanywhere.TagResourceOutput, error) - TagResourceRequest(*rolesanywhere.TagResourceInput) (*request.Request, *rolesanywhere.TagResourceOutput) - - UntagResource(*rolesanywhere.UntagResourceInput) (*rolesanywhere.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *rolesanywhere.UntagResourceInput, ...request.Option) (*rolesanywhere.UntagResourceOutput, error) - UntagResourceRequest(*rolesanywhere.UntagResourceInput) (*request.Request, *rolesanywhere.UntagResourceOutput) - - UpdateCrl(*rolesanywhere.UpdateCrlInput) (*rolesanywhere.UpdateCrlOutput, error) - UpdateCrlWithContext(aws.Context, *rolesanywhere.UpdateCrlInput, ...request.Option) (*rolesanywhere.UpdateCrlOutput, error) - UpdateCrlRequest(*rolesanywhere.UpdateCrlInput) (*request.Request, *rolesanywhere.UpdateCrlOutput) - - UpdateProfile(*rolesanywhere.UpdateProfileInput) (*rolesanywhere.UpdateProfileOutput, error) - UpdateProfileWithContext(aws.Context, *rolesanywhere.UpdateProfileInput, ...request.Option) (*rolesanywhere.UpdateProfileOutput, error) - UpdateProfileRequest(*rolesanywhere.UpdateProfileInput) (*request.Request, *rolesanywhere.UpdateProfileOutput) - - UpdateTrustAnchor(*rolesanywhere.UpdateTrustAnchorInput) (*rolesanywhere.UpdateTrustAnchorOutput, error) - UpdateTrustAnchorWithContext(aws.Context, *rolesanywhere.UpdateTrustAnchorInput, ...request.Option) (*rolesanywhere.UpdateTrustAnchorOutput, error) - UpdateTrustAnchorRequest(*rolesanywhere.UpdateTrustAnchorInput) (*request.Request, *rolesanywhere.UpdateTrustAnchorOutput) -} - -var _ RolesAnywhereAPI = (*rolesanywhere.RolesAnywhere)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/service.go deleted file mode 100644 index 1fe2bf5585ae..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/rolesanywhere/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package rolesanywhere - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// RolesAnywhere provides the API operation methods for making requests to -// IAM Roles Anywhere. See this package's package overview docs -// for details on the service. -// -// RolesAnywhere methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type RolesAnywhere struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "RolesAnywhere" // Name of service. - EndpointsID = "rolesanywhere" // ID to lookup a service endpoint with. - ServiceID = "RolesAnywhere" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the RolesAnywhere client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a RolesAnywhere client from just a session. -// svc := rolesanywhere.New(mySession) -// -// // Create a RolesAnywhere client with additional configuration -// svc := rolesanywhere.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *RolesAnywhere { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "rolesanywhere" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *RolesAnywhere { - svc := &RolesAnywhere{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a RolesAnywhere operation and runs any -// custom request initialization. -func (c *RolesAnywhere) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/api.go deleted file mode 100644 index 2a54407ef5a7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/api.go +++ /dev/null @@ -1,9491 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sagemakergeospatial - -import ( - "fmt" - "io" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opDeleteEarthObservationJob = "DeleteEarthObservationJob" - -// DeleteEarthObservationJobRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEarthObservationJob 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 DeleteEarthObservationJob for more information on using the DeleteEarthObservationJob -// 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 DeleteEarthObservationJobRequest method. -// req, resp := client.DeleteEarthObservationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/DeleteEarthObservationJob -func (c *SageMakerGeospatial) DeleteEarthObservationJobRequest(input *DeleteEarthObservationJobInput) (req *request.Request, output *DeleteEarthObservationJobOutput) { - op := &request.Operation{ - Name: opDeleteEarthObservationJob, - HTTPMethod: "DELETE", - HTTPPath: "/earth-observation-jobs/{Arn}", - } - - if input == nil { - input = &DeleteEarthObservationJobInput{} - } - - output = &DeleteEarthObservationJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEarthObservationJob API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to delete an Earth Observation job. -// -// 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 SageMaker geospatial capabilities's -// API operation DeleteEarthObservationJob for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/DeleteEarthObservationJob -func (c *SageMakerGeospatial) DeleteEarthObservationJob(input *DeleteEarthObservationJobInput) (*DeleteEarthObservationJobOutput, error) { - req, out := c.DeleteEarthObservationJobRequest(input) - return out, req.Send() -} - -// DeleteEarthObservationJobWithContext is the same as DeleteEarthObservationJob with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEarthObservationJob 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 *SageMakerGeospatial) DeleteEarthObservationJobWithContext(ctx aws.Context, input *DeleteEarthObservationJobInput, opts ...request.Option) (*DeleteEarthObservationJobOutput, error) { - req, out := c.DeleteEarthObservationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteVectorEnrichmentJob = "DeleteVectorEnrichmentJob" - -// DeleteVectorEnrichmentJobRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVectorEnrichmentJob 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 DeleteVectorEnrichmentJob for more information on using the DeleteVectorEnrichmentJob -// 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 DeleteVectorEnrichmentJobRequest method. -// req, resp := client.DeleteVectorEnrichmentJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/DeleteVectorEnrichmentJob -func (c *SageMakerGeospatial) DeleteVectorEnrichmentJobRequest(input *DeleteVectorEnrichmentJobInput) (req *request.Request, output *DeleteVectorEnrichmentJobOutput) { - op := &request.Operation{ - Name: opDeleteVectorEnrichmentJob, - HTTPMethod: "DELETE", - HTTPPath: "/vector-enrichment-jobs/{Arn}", - } - - if input == nil { - input = &DeleteVectorEnrichmentJobInput{} - } - - output = &DeleteVectorEnrichmentJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteVectorEnrichmentJob API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to delete a Vector Enrichment job. -// -// 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 SageMaker geospatial capabilities's -// API operation DeleteVectorEnrichmentJob for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/DeleteVectorEnrichmentJob -func (c *SageMakerGeospatial) DeleteVectorEnrichmentJob(input *DeleteVectorEnrichmentJobInput) (*DeleteVectorEnrichmentJobOutput, error) { - req, out := c.DeleteVectorEnrichmentJobRequest(input) - return out, req.Send() -} - -// DeleteVectorEnrichmentJobWithContext is the same as DeleteVectorEnrichmentJob with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteVectorEnrichmentJob 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 *SageMakerGeospatial) DeleteVectorEnrichmentJobWithContext(ctx aws.Context, input *DeleteVectorEnrichmentJobInput, opts ...request.Option) (*DeleteVectorEnrichmentJobOutput, error) { - req, out := c.DeleteVectorEnrichmentJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExportEarthObservationJob = "ExportEarthObservationJob" - -// ExportEarthObservationJobRequest generates a "aws/request.Request" representing the -// client's request for the ExportEarthObservationJob 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 ExportEarthObservationJob for more information on using the ExportEarthObservationJob -// 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 ExportEarthObservationJobRequest method. -// req, resp := client.ExportEarthObservationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ExportEarthObservationJob -func (c *SageMakerGeospatial) ExportEarthObservationJobRequest(input *ExportEarthObservationJobInput) (req *request.Request, output *ExportEarthObservationJobOutput) { - op := &request.Operation{ - Name: opExportEarthObservationJob, - HTTPMethod: "POST", - HTTPPath: "/export-earth-observation-job", - } - - if input == nil { - input = &ExportEarthObservationJobInput{} - } - - output = &ExportEarthObservationJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExportEarthObservationJob API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to export results of an Earth Observation job and optionally -// source images used as input to the EOJ to an Amazon S3 location. -// -// 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 SageMaker geospatial capabilities's -// API operation ExportEarthObservationJob for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// You have exceeded the service quota. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ExportEarthObservationJob -func (c *SageMakerGeospatial) ExportEarthObservationJob(input *ExportEarthObservationJobInput) (*ExportEarthObservationJobOutput, error) { - req, out := c.ExportEarthObservationJobRequest(input) - return out, req.Send() -} - -// ExportEarthObservationJobWithContext is the same as ExportEarthObservationJob with the addition of -// the ability to pass a context and additional request options. -// -// See ExportEarthObservationJob 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 *SageMakerGeospatial) ExportEarthObservationJobWithContext(ctx aws.Context, input *ExportEarthObservationJobInput, opts ...request.Option) (*ExportEarthObservationJobOutput, error) { - req, out := c.ExportEarthObservationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExportVectorEnrichmentJob = "ExportVectorEnrichmentJob" - -// ExportVectorEnrichmentJobRequest generates a "aws/request.Request" representing the -// client's request for the ExportVectorEnrichmentJob 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 ExportVectorEnrichmentJob for more information on using the ExportVectorEnrichmentJob -// 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 ExportVectorEnrichmentJobRequest method. -// req, resp := client.ExportVectorEnrichmentJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ExportVectorEnrichmentJob -func (c *SageMakerGeospatial) ExportVectorEnrichmentJobRequest(input *ExportVectorEnrichmentJobInput) (req *request.Request, output *ExportVectorEnrichmentJobOutput) { - op := &request.Operation{ - Name: opExportVectorEnrichmentJob, - HTTPMethod: "POST", - HTTPPath: "/export-vector-enrichment-jobs", - } - - if input == nil { - input = &ExportVectorEnrichmentJobInput{} - } - - output = &ExportVectorEnrichmentJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// ExportVectorEnrichmentJob API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to copy results of a Vector Enrichment job to an Amazon -// S3 location. -// -// 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 SageMaker geospatial capabilities's -// API operation ExportVectorEnrichmentJob for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// You have exceeded the service quota. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ExportVectorEnrichmentJob -func (c *SageMakerGeospatial) ExportVectorEnrichmentJob(input *ExportVectorEnrichmentJobInput) (*ExportVectorEnrichmentJobOutput, error) { - req, out := c.ExportVectorEnrichmentJobRequest(input) - return out, req.Send() -} - -// ExportVectorEnrichmentJobWithContext is the same as ExportVectorEnrichmentJob with the addition of -// the ability to pass a context and additional request options. -// -// See ExportVectorEnrichmentJob 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 *SageMakerGeospatial) ExportVectorEnrichmentJobWithContext(ctx aws.Context, input *ExportVectorEnrichmentJobInput, opts ...request.Option) (*ExportVectorEnrichmentJobOutput, error) { - req, out := c.ExportVectorEnrichmentJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEarthObservationJob = "GetEarthObservationJob" - -// GetEarthObservationJobRequest generates a "aws/request.Request" representing the -// client's request for the GetEarthObservationJob 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 GetEarthObservationJob for more information on using the GetEarthObservationJob -// 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 GetEarthObservationJobRequest method. -// req, resp := client.GetEarthObservationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/GetEarthObservationJob -func (c *SageMakerGeospatial) GetEarthObservationJobRequest(input *GetEarthObservationJobInput) (req *request.Request, output *GetEarthObservationJobOutput) { - op := &request.Operation{ - Name: opGetEarthObservationJob, - HTTPMethod: "GET", - HTTPPath: "/earth-observation-jobs/{Arn}", - } - - if input == nil { - input = &GetEarthObservationJobInput{} - } - - output = &GetEarthObservationJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEarthObservationJob API operation for Amazon SageMaker geospatial capabilities. -// -// Get the details for a previously initiated Earth Observation job. -// -// 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 SageMaker geospatial capabilities's -// API operation GetEarthObservationJob for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/GetEarthObservationJob -func (c *SageMakerGeospatial) GetEarthObservationJob(input *GetEarthObservationJobInput) (*GetEarthObservationJobOutput, error) { - req, out := c.GetEarthObservationJobRequest(input) - return out, req.Send() -} - -// GetEarthObservationJobWithContext is the same as GetEarthObservationJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetEarthObservationJob 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 *SageMakerGeospatial) GetEarthObservationJobWithContext(ctx aws.Context, input *GetEarthObservationJobInput, opts ...request.Option) (*GetEarthObservationJobOutput, error) { - req, out := c.GetEarthObservationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRasterDataCollection = "GetRasterDataCollection" - -// GetRasterDataCollectionRequest generates a "aws/request.Request" representing the -// client's request for the GetRasterDataCollection 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 GetRasterDataCollection for more information on using the GetRasterDataCollection -// 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 GetRasterDataCollectionRequest method. -// req, resp := client.GetRasterDataCollectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/GetRasterDataCollection -func (c *SageMakerGeospatial) GetRasterDataCollectionRequest(input *GetRasterDataCollectionInput) (req *request.Request, output *GetRasterDataCollectionOutput) { - op := &request.Operation{ - Name: opGetRasterDataCollection, - HTTPMethod: "GET", - HTTPPath: "/raster-data-collection/{Arn}", - } - - if input == nil { - input = &GetRasterDataCollectionInput{} - } - - output = &GetRasterDataCollectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRasterDataCollection API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to get details of a specific raster data collection. -// -// 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 SageMaker geospatial capabilities's -// API operation GetRasterDataCollection for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/GetRasterDataCollection -func (c *SageMakerGeospatial) GetRasterDataCollection(input *GetRasterDataCollectionInput) (*GetRasterDataCollectionOutput, error) { - req, out := c.GetRasterDataCollectionRequest(input) - return out, req.Send() -} - -// GetRasterDataCollectionWithContext is the same as GetRasterDataCollection with the addition of -// the ability to pass a context and additional request options. -// -// See GetRasterDataCollection 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 *SageMakerGeospatial) GetRasterDataCollectionWithContext(ctx aws.Context, input *GetRasterDataCollectionInput, opts ...request.Option) (*GetRasterDataCollectionOutput, error) { - req, out := c.GetRasterDataCollectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTile = "GetTile" - -// GetTileRequest generates a "aws/request.Request" representing the -// client's request for the GetTile 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 GetTile for more information on using the GetTile -// 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 GetTileRequest method. -// req, resp := client.GetTileRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/GetTile -func (c *SageMakerGeospatial) GetTileRequest(input *GetTileInput) (req *request.Request, output *GetTileOutput) { - op := &request.Operation{ - Name: opGetTile, - HTTPMethod: "GET", - HTTPPath: "/tile/{z}/{x}/{y}", - } - - if input == nil { - input = &GetTileInput{} - } - - output = &GetTileOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTile API operation for Amazon SageMaker geospatial capabilities. -// -// Gets a web mercator tile for the given Earth Observation job. -// -// 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 SageMaker geospatial capabilities's -// API operation GetTile for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/GetTile -func (c *SageMakerGeospatial) GetTile(input *GetTileInput) (*GetTileOutput, error) { - req, out := c.GetTileRequest(input) - return out, req.Send() -} - -// GetTileWithContext is the same as GetTile with the addition of -// the ability to pass a context and additional request options. -// -// See GetTile 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 *SageMakerGeospatial) GetTileWithContext(ctx aws.Context, input *GetTileInput, opts ...request.Option) (*GetTileOutput, error) { - req, out := c.GetTileRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetVectorEnrichmentJob = "GetVectorEnrichmentJob" - -// GetVectorEnrichmentJobRequest generates a "aws/request.Request" representing the -// client's request for the GetVectorEnrichmentJob 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 GetVectorEnrichmentJob for more information on using the GetVectorEnrichmentJob -// 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 GetVectorEnrichmentJobRequest method. -// req, resp := client.GetVectorEnrichmentJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/GetVectorEnrichmentJob -func (c *SageMakerGeospatial) GetVectorEnrichmentJobRequest(input *GetVectorEnrichmentJobInput) (req *request.Request, output *GetVectorEnrichmentJobOutput) { - op := &request.Operation{ - Name: opGetVectorEnrichmentJob, - HTTPMethod: "GET", - HTTPPath: "/vector-enrichment-jobs/{Arn}", - } - - if input == nil { - input = &GetVectorEnrichmentJobInput{} - } - - output = &GetVectorEnrichmentJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetVectorEnrichmentJob API operation for Amazon SageMaker geospatial capabilities. -// -// Retrieves details of a Vector Enrichment Job for a given job Amazon Resource -// Name (ARN). -// -// 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 SageMaker geospatial capabilities's -// API operation GetVectorEnrichmentJob for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/GetVectorEnrichmentJob -func (c *SageMakerGeospatial) GetVectorEnrichmentJob(input *GetVectorEnrichmentJobInput) (*GetVectorEnrichmentJobOutput, error) { - req, out := c.GetVectorEnrichmentJobRequest(input) - return out, req.Send() -} - -// GetVectorEnrichmentJobWithContext is the same as GetVectorEnrichmentJob with the addition of -// the ability to pass a context and additional request options. -// -// See GetVectorEnrichmentJob 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 *SageMakerGeospatial) GetVectorEnrichmentJobWithContext(ctx aws.Context, input *GetVectorEnrichmentJobInput, opts ...request.Option) (*GetVectorEnrichmentJobOutput, error) { - req, out := c.GetVectorEnrichmentJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListEarthObservationJobs = "ListEarthObservationJobs" - -// ListEarthObservationJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListEarthObservationJobs 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 ListEarthObservationJobs for more information on using the ListEarthObservationJobs -// 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 ListEarthObservationJobsRequest method. -// req, resp := client.ListEarthObservationJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ListEarthObservationJobs -func (c *SageMakerGeospatial) ListEarthObservationJobsRequest(input *ListEarthObservationJobsInput) (req *request.Request, output *ListEarthObservationJobsOutput) { - op := &request.Operation{ - Name: opListEarthObservationJobs, - HTTPMethod: "POST", - HTTPPath: "/list-earth-observation-jobs", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEarthObservationJobsInput{} - } - - output = &ListEarthObservationJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEarthObservationJobs API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to get a list of the Earth Observation jobs associated -// with the calling Amazon Web Services account. -// -// 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 SageMaker geospatial capabilities's -// API operation ListEarthObservationJobs for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ListEarthObservationJobs -func (c *SageMakerGeospatial) ListEarthObservationJobs(input *ListEarthObservationJobsInput) (*ListEarthObservationJobsOutput, error) { - req, out := c.ListEarthObservationJobsRequest(input) - return out, req.Send() -} - -// ListEarthObservationJobsWithContext is the same as ListEarthObservationJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListEarthObservationJobs 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 *SageMakerGeospatial) ListEarthObservationJobsWithContext(ctx aws.Context, input *ListEarthObservationJobsInput, opts ...request.Option) (*ListEarthObservationJobsOutput, error) { - req, out := c.ListEarthObservationJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEarthObservationJobsPages iterates over the pages of a ListEarthObservationJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEarthObservationJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEarthObservationJobs operation. -// pageNum := 0 -// err := client.ListEarthObservationJobsPages(params, -// func(page *sagemakergeospatial.ListEarthObservationJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SageMakerGeospatial) ListEarthObservationJobsPages(input *ListEarthObservationJobsInput, fn func(*ListEarthObservationJobsOutput, bool) bool) error { - return c.ListEarthObservationJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEarthObservationJobsPagesWithContext same as ListEarthObservationJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SageMakerGeospatial) ListEarthObservationJobsPagesWithContext(ctx aws.Context, input *ListEarthObservationJobsInput, fn func(*ListEarthObservationJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEarthObservationJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEarthObservationJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEarthObservationJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRasterDataCollections = "ListRasterDataCollections" - -// ListRasterDataCollectionsRequest generates a "aws/request.Request" representing the -// client's request for the ListRasterDataCollections 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 ListRasterDataCollections for more information on using the ListRasterDataCollections -// 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 ListRasterDataCollectionsRequest method. -// req, resp := client.ListRasterDataCollectionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ListRasterDataCollections -func (c *SageMakerGeospatial) ListRasterDataCollectionsRequest(input *ListRasterDataCollectionsInput) (req *request.Request, output *ListRasterDataCollectionsOutput) { - op := &request.Operation{ - Name: opListRasterDataCollections, - HTTPMethod: "GET", - HTTPPath: "/raster-data-collections", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRasterDataCollectionsInput{} - } - - output = &ListRasterDataCollectionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRasterDataCollections API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to get raster data collections. -// -// 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 SageMaker geospatial capabilities's -// API operation ListRasterDataCollections for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ListRasterDataCollections -func (c *SageMakerGeospatial) ListRasterDataCollections(input *ListRasterDataCollectionsInput) (*ListRasterDataCollectionsOutput, error) { - req, out := c.ListRasterDataCollectionsRequest(input) - return out, req.Send() -} - -// ListRasterDataCollectionsWithContext is the same as ListRasterDataCollections with the addition of -// the ability to pass a context and additional request options. -// -// See ListRasterDataCollections 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 *SageMakerGeospatial) ListRasterDataCollectionsWithContext(ctx aws.Context, input *ListRasterDataCollectionsInput, opts ...request.Option) (*ListRasterDataCollectionsOutput, error) { - req, out := c.ListRasterDataCollectionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRasterDataCollectionsPages iterates over the pages of a ListRasterDataCollections operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRasterDataCollections method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRasterDataCollections operation. -// pageNum := 0 -// err := client.ListRasterDataCollectionsPages(params, -// func(page *sagemakergeospatial.ListRasterDataCollectionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SageMakerGeospatial) ListRasterDataCollectionsPages(input *ListRasterDataCollectionsInput, fn func(*ListRasterDataCollectionsOutput, bool) bool) error { - return c.ListRasterDataCollectionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRasterDataCollectionsPagesWithContext same as ListRasterDataCollectionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SageMakerGeospatial) ListRasterDataCollectionsPagesWithContext(ctx aws.Context, input *ListRasterDataCollectionsInput, fn func(*ListRasterDataCollectionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRasterDataCollectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRasterDataCollectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRasterDataCollectionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ListTagsForResource -func (c *SageMakerGeospatial) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon SageMaker geospatial capabilities. -// -// Lists the tags attached to the resource. -// -// 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 SageMaker geospatial capabilities's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ListTagsForResource -func (c *SageMakerGeospatial) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *SageMakerGeospatial) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListVectorEnrichmentJobs = "ListVectorEnrichmentJobs" - -// ListVectorEnrichmentJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListVectorEnrichmentJobs 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 ListVectorEnrichmentJobs for more information on using the ListVectorEnrichmentJobs -// 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 ListVectorEnrichmentJobsRequest method. -// req, resp := client.ListVectorEnrichmentJobsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ListVectorEnrichmentJobs -func (c *SageMakerGeospatial) ListVectorEnrichmentJobsRequest(input *ListVectorEnrichmentJobsInput) (req *request.Request, output *ListVectorEnrichmentJobsOutput) { - op := &request.Operation{ - Name: opListVectorEnrichmentJobs, - HTTPMethod: "POST", - HTTPPath: "/list-vector-enrichment-jobs", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListVectorEnrichmentJobsInput{} - } - - output = &ListVectorEnrichmentJobsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListVectorEnrichmentJobs API operation for Amazon SageMaker geospatial capabilities. -// -// Retrieves a list of vector enrichment jobs. -// -// 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 SageMaker geospatial capabilities's -// API operation ListVectorEnrichmentJobs for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/ListVectorEnrichmentJobs -func (c *SageMakerGeospatial) ListVectorEnrichmentJobs(input *ListVectorEnrichmentJobsInput) (*ListVectorEnrichmentJobsOutput, error) { - req, out := c.ListVectorEnrichmentJobsRequest(input) - return out, req.Send() -} - -// ListVectorEnrichmentJobsWithContext is the same as ListVectorEnrichmentJobs with the addition of -// the ability to pass a context and additional request options. -// -// See ListVectorEnrichmentJobs 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 *SageMakerGeospatial) ListVectorEnrichmentJobsWithContext(ctx aws.Context, input *ListVectorEnrichmentJobsInput, opts ...request.Option) (*ListVectorEnrichmentJobsOutput, error) { - req, out := c.ListVectorEnrichmentJobsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListVectorEnrichmentJobsPages iterates over the pages of a ListVectorEnrichmentJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListVectorEnrichmentJobs method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListVectorEnrichmentJobs operation. -// pageNum := 0 -// err := client.ListVectorEnrichmentJobsPages(params, -// func(page *sagemakergeospatial.ListVectorEnrichmentJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SageMakerGeospatial) ListVectorEnrichmentJobsPages(input *ListVectorEnrichmentJobsInput, fn func(*ListVectorEnrichmentJobsOutput, bool) bool) error { - return c.ListVectorEnrichmentJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListVectorEnrichmentJobsPagesWithContext same as ListVectorEnrichmentJobsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SageMakerGeospatial) ListVectorEnrichmentJobsPagesWithContext(ctx aws.Context, input *ListVectorEnrichmentJobsInput, fn func(*ListVectorEnrichmentJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListVectorEnrichmentJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListVectorEnrichmentJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListVectorEnrichmentJobsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opSearchRasterDataCollection = "SearchRasterDataCollection" - -// SearchRasterDataCollectionRequest generates a "aws/request.Request" representing the -// client's request for the SearchRasterDataCollection 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 SearchRasterDataCollection for more information on using the SearchRasterDataCollection -// 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 SearchRasterDataCollectionRequest method. -// req, resp := client.SearchRasterDataCollectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/SearchRasterDataCollection -func (c *SageMakerGeospatial) SearchRasterDataCollectionRequest(input *SearchRasterDataCollectionInput) (req *request.Request, output *SearchRasterDataCollectionOutput) { - op := &request.Operation{ - Name: opSearchRasterDataCollection, - HTTPMethod: "POST", - HTTPPath: "/search-raster-data-collection", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &SearchRasterDataCollectionInput{} - } - - output = &SearchRasterDataCollectionOutput{} - req = c.newRequest(op, input, output) - return -} - -// SearchRasterDataCollection API operation for Amazon SageMaker geospatial capabilities. -// -// Allows you run image query on a specific raster data collection to get a -// list of the satellite imagery matching the selected filters. -// -// 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 SageMaker geospatial capabilities's -// API operation SearchRasterDataCollection for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/SearchRasterDataCollection -func (c *SageMakerGeospatial) SearchRasterDataCollection(input *SearchRasterDataCollectionInput) (*SearchRasterDataCollectionOutput, error) { - req, out := c.SearchRasterDataCollectionRequest(input) - return out, req.Send() -} - -// SearchRasterDataCollectionWithContext is the same as SearchRasterDataCollection with the addition of -// the ability to pass a context and additional request options. -// -// See SearchRasterDataCollection 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 *SageMakerGeospatial) SearchRasterDataCollectionWithContext(ctx aws.Context, input *SearchRasterDataCollectionInput, opts ...request.Option) (*SearchRasterDataCollectionOutput, error) { - req, out := c.SearchRasterDataCollectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// SearchRasterDataCollectionPages iterates over the pages of a SearchRasterDataCollection operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See SearchRasterDataCollection method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a SearchRasterDataCollection operation. -// pageNum := 0 -// err := client.SearchRasterDataCollectionPages(params, -// func(page *sagemakergeospatial.SearchRasterDataCollectionOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SageMakerGeospatial) SearchRasterDataCollectionPages(input *SearchRasterDataCollectionInput, fn func(*SearchRasterDataCollectionOutput, bool) bool) error { - return c.SearchRasterDataCollectionPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// SearchRasterDataCollectionPagesWithContext same as SearchRasterDataCollectionPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SageMakerGeospatial) SearchRasterDataCollectionPagesWithContext(ctx aws.Context, input *SearchRasterDataCollectionInput, fn func(*SearchRasterDataCollectionOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *SearchRasterDataCollectionInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.SearchRasterDataCollectionRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*SearchRasterDataCollectionOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartEarthObservationJob = "StartEarthObservationJob" - -// StartEarthObservationJobRequest generates a "aws/request.Request" representing the -// client's request for the StartEarthObservationJob 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 StartEarthObservationJob for more information on using the StartEarthObservationJob -// 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 StartEarthObservationJobRequest method. -// req, resp := client.StartEarthObservationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/StartEarthObservationJob -func (c *SageMakerGeospatial) StartEarthObservationJobRequest(input *StartEarthObservationJobInput) (req *request.Request, output *StartEarthObservationJobOutput) { - op := &request.Operation{ - Name: opStartEarthObservationJob, - HTTPMethod: "POST", - HTTPPath: "/earth-observation-jobs", - } - - if input == nil { - input = &StartEarthObservationJobInput{} - } - - output = &StartEarthObservationJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartEarthObservationJob API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to create an Earth observation job. -// -// 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 SageMaker geospatial capabilities's -// API operation StartEarthObservationJob for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// You have exceeded the service quota. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/StartEarthObservationJob -func (c *SageMakerGeospatial) StartEarthObservationJob(input *StartEarthObservationJobInput) (*StartEarthObservationJobOutput, error) { - req, out := c.StartEarthObservationJobRequest(input) - return out, req.Send() -} - -// StartEarthObservationJobWithContext is the same as StartEarthObservationJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartEarthObservationJob 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 *SageMakerGeospatial) StartEarthObservationJobWithContext(ctx aws.Context, input *StartEarthObservationJobInput, opts ...request.Option) (*StartEarthObservationJobOutput, error) { - req, out := c.StartEarthObservationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartVectorEnrichmentJob = "StartVectorEnrichmentJob" - -// StartVectorEnrichmentJobRequest generates a "aws/request.Request" representing the -// client's request for the StartVectorEnrichmentJob 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 StartVectorEnrichmentJob for more information on using the StartVectorEnrichmentJob -// 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 StartVectorEnrichmentJobRequest method. -// req, resp := client.StartVectorEnrichmentJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/StartVectorEnrichmentJob -func (c *SageMakerGeospatial) StartVectorEnrichmentJobRequest(input *StartVectorEnrichmentJobInput) (req *request.Request, output *StartVectorEnrichmentJobOutput) { - op := &request.Operation{ - Name: opStartVectorEnrichmentJob, - HTTPMethod: "POST", - HTTPPath: "/vector-enrichment-jobs", - } - - if input == nil { - input = &StartVectorEnrichmentJobInput{} - } - - output = &StartVectorEnrichmentJobOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartVectorEnrichmentJob API operation for Amazon SageMaker geospatial capabilities. -// -// Creates a Vector Enrichment job for the supplied job type. Currently, there -// are two supported job types: reverse geocoding and map matching. -// -// 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 SageMaker geospatial capabilities's -// API operation StartVectorEnrichmentJob for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// You have exceeded the service quota. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/StartVectorEnrichmentJob -func (c *SageMakerGeospatial) StartVectorEnrichmentJob(input *StartVectorEnrichmentJobInput) (*StartVectorEnrichmentJobOutput, error) { - req, out := c.StartVectorEnrichmentJobRequest(input) - return out, req.Send() -} - -// StartVectorEnrichmentJobWithContext is the same as StartVectorEnrichmentJob with the addition of -// the ability to pass a context and additional request options. -// -// See StartVectorEnrichmentJob 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 *SageMakerGeospatial) StartVectorEnrichmentJobWithContext(ctx aws.Context, input *StartVectorEnrichmentJobInput, opts ...request.Option) (*StartVectorEnrichmentJobOutput, error) { - req, out := c.StartVectorEnrichmentJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopEarthObservationJob = "StopEarthObservationJob" - -// StopEarthObservationJobRequest generates a "aws/request.Request" representing the -// client's request for the StopEarthObservationJob 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 StopEarthObservationJob for more information on using the StopEarthObservationJob -// 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 StopEarthObservationJobRequest method. -// req, resp := client.StopEarthObservationJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/StopEarthObservationJob -func (c *SageMakerGeospatial) StopEarthObservationJobRequest(input *StopEarthObservationJobInput) (req *request.Request, output *StopEarthObservationJobOutput) { - op := &request.Operation{ - Name: opStopEarthObservationJob, - HTTPMethod: "POST", - HTTPPath: "/earth-observation-jobs/stop", - } - - if input == nil { - input = &StopEarthObservationJobInput{} - } - - output = &StopEarthObservationJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopEarthObservationJob API operation for Amazon SageMaker geospatial capabilities. -// -// Use this operation to stop an existing earth observation job. -// -// 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 SageMaker geospatial capabilities's -// API operation StopEarthObservationJob for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/StopEarthObservationJob -func (c *SageMakerGeospatial) StopEarthObservationJob(input *StopEarthObservationJobInput) (*StopEarthObservationJobOutput, error) { - req, out := c.StopEarthObservationJobRequest(input) - return out, req.Send() -} - -// StopEarthObservationJobWithContext is the same as StopEarthObservationJob with the addition of -// the ability to pass a context and additional request options. -// -// See StopEarthObservationJob 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 *SageMakerGeospatial) StopEarthObservationJobWithContext(ctx aws.Context, input *StopEarthObservationJobInput, opts ...request.Option) (*StopEarthObservationJobOutput, error) { - req, out := c.StopEarthObservationJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopVectorEnrichmentJob = "StopVectorEnrichmentJob" - -// StopVectorEnrichmentJobRequest generates a "aws/request.Request" representing the -// client's request for the StopVectorEnrichmentJob 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 StopVectorEnrichmentJob for more information on using the StopVectorEnrichmentJob -// 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 StopVectorEnrichmentJobRequest method. -// req, resp := client.StopVectorEnrichmentJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/StopVectorEnrichmentJob -func (c *SageMakerGeospatial) StopVectorEnrichmentJobRequest(input *StopVectorEnrichmentJobInput) (req *request.Request, output *StopVectorEnrichmentJobOutput) { - op := &request.Operation{ - Name: opStopVectorEnrichmentJob, - HTTPMethod: "POST", - HTTPPath: "/vector-enrichment-jobs/stop", - } - - if input == nil { - input = &StopVectorEnrichmentJobInput{} - } - - output = &StopVectorEnrichmentJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopVectorEnrichmentJob API operation for Amazon SageMaker geospatial capabilities. -// -// Stops the Vector Enrichment job for a given job ARN. -// -// 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 SageMaker geospatial capabilities's -// API operation StopVectorEnrichmentJob for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ConflictException -// Updating or deleting a resource can cause an inconsistent state. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/StopVectorEnrichmentJob -func (c *SageMakerGeospatial) StopVectorEnrichmentJob(input *StopVectorEnrichmentJobInput) (*StopVectorEnrichmentJobOutput, error) { - req, out := c.StopVectorEnrichmentJobRequest(input) - return out, req.Send() -} - -// StopVectorEnrichmentJobWithContext is the same as StopVectorEnrichmentJob with the addition of -// the ability to pass a context and additional request options. -// -// See StopVectorEnrichmentJob 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 *SageMakerGeospatial) StopVectorEnrichmentJobWithContext(ctx aws.Context, input *StopVectorEnrichmentJobInput, opts ...request.Option) (*StopVectorEnrichmentJobOutput, error) { - req, out := c.StopVectorEnrichmentJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/TagResource -func (c *SageMakerGeospatial) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "PUT", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon SageMaker geospatial capabilities. -// -// The resource you want to tag. -// -// 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 SageMaker geospatial capabilities's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/TagResource -func (c *SageMakerGeospatial) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *SageMakerGeospatial) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/UntagResource -func (c *SageMakerGeospatial) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon SageMaker geospatial capabilities. -// -// The resource you want to untag. -// -// 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 SageMaker geospatial capabilities's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The request processing has failed because of an unknown error, exception, -// or failure. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27/UntagResource -func (c *SageMakerGeospatial) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *SageMakerGeospatial) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The geographic extent of the Earth Observation job. -type AreaOfInterest struct { - _ struct{} `type:"structure"` - - // A GeoJSON object representing the geographic extent in the coordinate space. - AreaOfInterestGeometry *AreaOfInterestGeometry `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 AreaOfInterest) 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 AreaOfInterest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AreaOfInterest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AreaOfInterest"} - if s.AreaOfInterestGeometry != nil { - if err := s.AreaOfInterestGeometry.Validate(); err != nil { - invalidParams.AddNested("AreaOfInterestGeometry", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAreaOfInterestGeometry sets the AreaOfInterestGeometry field's value. -func (s *AreaOfInterest) SetAreaOfInterestGeometry(v *AreaOfInterestGeometry) *AreaOfInterest { - s.AreaOfInterestGeometry = v - return s -} - -// A GeoJSON object representing the geographic extent in the coordinate space. -type AreaOfInterestGeometry struct { - _ struct{} `type:"structure"` - - // The structure representing the MultiPolygon Geometry. - MultiPolygonGeometry *MultiPolygonGeometryInput_ `type:"structure"` - - // The structure representing Polygon Geometry. - PolygonGeometry *PolygonGeometryInput_ `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 AreaOfInterestGeometry) 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 AreaOfInterestGeometry) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AreaOfInterestGeometry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AreaOfInterestGeometry"} - if s.MultiPolygonGeometry != nil { - if err := s.MultiPolygonGeometry.Validate(); err != nil { - invalidParams.AddNested("MultiPolygonGeometry", err.(request.ErrInvalidParams)) - } - } - if s.PolygonGeometry != nil { - if err := s.PolygonGeometry.Validate(); err != nil { - invalidParams.AddNested("PolygonGeometry", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMultiPolygonGeometry sets the MultiPolygonGeometry field's value. -func (s *AreaOfInterestGeometry) SetMultiPolygonGeometry(v *MultiPolygonGeometryInput_) *AreaOfInterestGeometry { - s.MultiPolygonGeometry = v - return s -} - -// SetPolygonGeometry sets the PolygonGeometry field's value. -func (s *AreaOfInterestGeometry) SetPolygonGeometry(v *PolygonGeometryInput_) *AreaOfInterestGeometry { - s.PolygonGeometry = v - return s -} - -// The structure containing the asset properties. -type AssetValue struct { - _ struct{} `type:"structure"` - - // Link to the asset object. - Href *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 AssetValue) 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 AssetValue) GoString() string { - return s.String() -} - -// SetHref sets the Href field's value. -func (s *AssetValue) SetHref(v string) *AssetValue { - s.Href = &v - return s -} - -// Input structure for the BandMath operation type. Defines Predefined and CustomIndices -// to be computed using BandMath. -type BandMathConfigInput_ struct { - _ struct{} `type:"structure"` - - // CustomIndices that are computed. - CustomIndices *CustomIndicesInput_ `type:"structure"` - - // One or many of the supported predefined indices to compute. Allowed values: - // NDVI, EVI2, MSAVI, NDWI, NDMI, NDSI, and WDRVI. - PredefinedIndices []*string `min:"1" type:"list"` -} - -// 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 BandMathConfigInput_) 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 BandMathConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BandMathConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BandMathConfigInput_"} - if s.PredefinedIndices != nil && len(s.PredefinedIndices) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PredefinedIndices", 1)) - } - if s.CustomIndices != nil { - if err := s.CustomIndices.Validate(); err != nil { - invalidParams.AddNested("CustomIndices", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomIndices sets the CustomIndices field's value. -func (s *BandMathConfigInput_) SetCustomIndices(v *CustomIndicesInput_) *BandMathConfigInput_ { - s.CustomIndices = v - return s -} - -// SetPredefinedIndices sets the PredefinedIndices field's value. -func (s *BandMathConfigInput_) SetPredefinedIndices(v []*string) *BandMathConfigInput_ { - s.PredefinedIndices = v - return s -} - -// Input structure for CloudMasking operation type. -type CloudMaskingConfigInput_ 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 CloudMaskingConfigInput_) 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 CloudMaskingConfigInput_) GoString() string { - return s.String() -} - -// Input structure for Cloud Removal Operation type -type CloudRemovalConfigInput_ struct { - _ struct{} `type:"structure"` - - // The name of the algorithm used for cloud removal. - AlgorithmName *string `type:"string" enum:"AlgorithmNameCloudRemoval"` - - // The interpolation value you provide for cloud removal. - InterpolationValue *string `type:"string"` - - // TargetBands to be returned in the output of CloudRemoval operation. - TargetBands []*string `min:"1" type:"list"` -} - -// 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 CloudRemovalConfigInput_) 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 CloudRemovalConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloudRemovalConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudRemovalConfigInput_"} - if s.TargetBands != nil && len(s.TargetBands) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBands", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *CloudRemovalConfigInput_) SetAlgorithmName(v string) *CloudRemovalConfigInput_ { - s.AlgorithmName = &v - return s -} - -// SetInterpolationValue sets the InterpolationValue field's value. -func (s *CloudRemovalConfigInput_) SetInterpolationValue(v string) *CloudRemovalConfigInput_ { - s.InterpolationValue = &v - return s -} - -// SetTargetBands sets the TargetBands field's value. -func (s *CloudRemovalConfigInput_) SetTargetBands(v []*string) *CloudRemovalConfigInput_ { - s.TargetBands = v - return s -} - -// Updating or deleting a resource can cause an inconsistent state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // Identifier of the resource affected. - ResourceId *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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Input object defining the custom BandMath indices to compute. -type CustomIndicesInput_ struct { - _ struct{} `type:"structure"` - - // A list of BandMath indices to compute. - Operations []*Operation `min:"1" type:"list"` -} - -// 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 CustomIndicesInput_) 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 CustomIndicesInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomIndicesInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomIndicesInput_"} - if s.Operations != nil && len(s.Operations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Operations", 1)) - } - if s.Operations != nil { - for i, v := range s.Operations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Operations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOperations sets the Operations field's value. -func (s *CustomIndicesInput_) SetOperations(v []*Operation) *CustomIndicesInput_ { - s.Operations = v - return s -} - -type DeleteEarthObservationJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Earth Observation job being deleted. - // - // Arn is a required field - Arn *string `location:"uri" locationName:"Arn" 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 DeleteEarthObservationJobInput) 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 DeleteEarthObservationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEarthObservationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEarthObservationJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *DeleteEarthObservationJobInput) SetArn(v string) *DeleteEarthObservationJobInput { - s.Arn = &v - return s -} - -type DeleteEarthObservationJobOutput 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 DeleteEarthObservationJobOutput) 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 DeleteEarthObservationJobOutput) GoString() string { - return s.String() -} - -type DeleteVectorEnrichmentJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Vector Enrichment job being deleted. - // - // Arn is a required field - Arn *string `location:"uri" locationName:"Arn" 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 DeleteVectorEnrichmentJobInput) 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 DeleteVectorEnrichmentJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVectorEnrichmentJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVectorEnrichmentJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *DeleteVectorEnrichmentJobInput) SetArn(v string) *DeleteVectorEnrichmentJobInput { - s.Arn = &v - return s -} - -type DeleteVectorEnrichmentJobOutput 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 DeleteVectorEnrichmentJobOutput) 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 DeleteVectorEnrichmentJobOutput) GoString() string { - return s.String() -} - -// The structure representing the errors in an EarthObservationJob. -type EarthObservationJobErrorDetails struct { - _ struct{} `type:"structure"` - - // A detailed message describing the error in an Earth Observation job. - Message *string `type:"string"` - - // The type of error in an Earth Observation job. - Type *string `type:"string" enum:"EarthObservationJobErrorType"` -} - -// 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 EarthObservationJobErrorDetails) 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 EarthObservationJobErrorDetails) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *EarthObservationJobErrorDetails) SetMessage(v string) *EarthObservationJobErrorDetails { - s.Message = &v - return s -} - -// SetType sets the Type field's value. -func (s *EarthObservationJobErrorDetails) SetType(v string) *EarthObservationJobErrorDetails { - s.Type = &v - return s -} - -// The structure representing the EoCloudCover filter. -type EoCloudCoverInput_ struct { - _ struct{} `type:"structure"` - - // Lower bound for EoCloudCover. - // - // LowerBound is a required field - LowerBound *float64 `type:"float" required:"true"` - - // Upper bound for EoCloudCover. - // - // UpperBound is a required field - UpperBound *float64 `type:"float" 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 EoCloudCoverInput_) 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 EoCloudCoverInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EoCloudCoverInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EoCloudCoverInput_"} - if s.LowerBound == nil { - invalidParams.Add(request.NewErrParamRequired("LowerBound")) - } - if s.UpperBound == nil { - invalidParams.Add(request.NewErrParamRequired("UpperBound")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLowerBound sets the LowerBound field's value. -func (s *EoCloudCoverInput_) SetLowerBound(v float64) *EoCloudCoverInput_ { - s.LowerBound = &v - return s -} - -// SetUpperBound sets the UpperBound field's value. -func (s *EoCloudCoverInput_) SetUpperBound(v float64) *EoCloudCoverInput_ { - s.UpperBound = &v - return s -} - -type ExportEarthObservationJobInput struct { - _ struct{} `type:"structure"` - - // The input Amazon Resource Name (ARN) of the Earth Observation job being exported. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // A unique token that guarantees that the call to this API is idempotent. - ClientToken *string `min:"36" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // job. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // The source images provided to the Earth Observation job being exported. - ExportSourceImages *bool `type:"boolean"` - - // An object containing information about the output file. - // - // OutputConfig is a required field - OutputConfig *OutputConfigInput_ `type:"structure" 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 ExportEarthObservationJobInput) 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 ExportEarthObservationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportEarthObservationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportEarthObservationJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 36)) - } - if s.ExecutionRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn")) - } - if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 20)) - } - if s.OutputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputConfig")) - } - if s.OutputConfig != nil { - if err := s.OutputConfig.Validate(); err != nil { - invalidParams.AddNested("OutputConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *ExportEarthObservationJobInput) SetArn(v string) *ExportEarthObservationJobInput { - s.Arn = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *ExportEarthObservationJobInput) SetClientToken(v string) *ExportEarthObservationJobInput { - s.ClientToken = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *ExportEarthObservationJobInput) SetExecutionRoleArn(v string) *ExportEarthObservationJobInput { - s.ExecutionRoleArn = &v - return s -} - -// SetExportSourceImages sets the ExportSourceImages field's value. -func (s *ExportEarthObservationJobInput) SetExportSourceImages(v bool) *ExportEarthObservationJobInput { - s.ExportSourceImages = &v - return s -} - -// SetOutputConfig sets the OutputConfig field's value. -func (s *ExportEarthObservationJobInput) SetOutputConfig(v *OutputConfigInput_) *ExportEarthObservationJobInput { - s.OutputConfig = v - return s -} - -type ExportEarthObservationJobOutput struct { - _ struct{} `type:"structure"` - - // The output Amazon Resource Name (ARN) of the Earth Observation job being - // exported. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The creation time. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // job. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // The source images provided to the Earth Observation job being exported. - ExportSourceImages *bool `type:"boolean"` - - // The status of the results of the Earth Observation job being exported. - // - // ExportStatus is a required field - ExportStatus *string `type:"string" required:"true" enum:"EarthObservationJobExportStatus"` - - // An object containing information about the output file. - // - // OutputConfig is a required field - OutputConfig *OutputConfigInput_ `type:"structure" 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 ExportEarthObservationJobOutput) 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 ExportEarthObservationJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ExportEarthObservationJobOutput) SetArn(v string) *ExportEarthObservationJobOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ExportEarthObservationJobOutput) SetCreationTime(v time.Time) *ExportEarthObservationJobOutput { - s.CreationTime = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *ExportEarthObservationJobOutput) SetExecutionRoleArn(v string) *ExportEarthObservationJobOutput { - s.ExecutionRoleArn = &v - return s -} - -// SetExportSourceImages sets the ExportSourceImages field's value. -func (s *ExportEarthObservationJobOutput) SetExportSourceImages(v bool) *ExportEarthObservationJobOutput { - s.ExportSourceImages = &v - return s -} - -// SetExportStatus sets the ExportStatus field's value. -func (s *ExportEarthObservationJobOutput) SetExportStatus(v string) *ExportEarthObservationJobOutput { - s.ExportStatus = &v - return s -} - -// SetOutputConfig sets the OutputConfig field's value. -func (s *ExportEarthObservationJobOutput) SetOutputConfig(v *OutputConfigInput_) *ExportEarthObservationJobOutput { - s.OutputConfig = v - return s -} - -// The structure for returning the export error details in a GetEarthObservationJob. -type ExportErrorDetails struct { - _ struct{} `type:"structure"` - - // The structure for returning the export error details while exporting results - // of an Earth Observation job. - ExportResults *ExportErrorDetailsOutput_ `type:"structure"` - - // The structure for returning the export error details while exporting the - // source images of an Earth Observation job. - ExportSourceImages *ExportErrorDetailsOutput_ `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 ExportErrorDetails) 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 ExportErrorDetails) GoString() string { - return s.String() -} - -// SetExportResults sets the ExportResults field's value. -func (s *ExportErrorDetails) SetExportResults(v *ExportErrorDetailsOutput_) *ExportErrorDetails { - s.ExportResults = v - return s -} - -// SetExportSourceImages sets the ExportSourceImages field's value. -func (s *ExportErrorDetails) SetExportSourceImages(v *ExportErrorDetailsOutput_) *ExportErrorDetails { - s.ExportSourceImages = v - return s -} - -// The structure representing the errors in an export EarthObservationJob operation. -type ExportErrorDetailsOutput_ struct { - _ struct{} `type:"structure"` - - // A detailed message describing the error in an export EarthObservationJob - // operation. - Message *string `type:"string"` - - // The type of error in an export EarthObservationJob operation. - Type *string `type:"string" enum:"ExportErrorType"` -} - -// 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 ExportErrorDetailsOutput_) 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 ExportErrorDetailsOutput_) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ExportErrorDetailsOutput_) SetMessage(v string) *ExportErrorDetailsOutput_ { - s.Message = &v - return s -} - -// SetType sets the Type field's value. -func (s *ExportErrorDetailsOutput_) SetType(v string) *ExportErrorDetailsOutput_ { - s.Type = &v - return s -} - -// The structure containing the Amazon S3 path to export the Earth Observation -// job output. -type ExportS3DataInput_ struct { - _ struct{} `type:"structure"` - - // The Key Management Service key ID for server-side encryption. - KmsKeyId *string `type:"string"` - - // The URL to the Amazon S3 data input. - // - // S3Uri is a required field - S3Uri *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 ExportS3DataInput_) 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 ExportS3DataInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportS3DataInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportS3DataInput_"} - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *ExportS3DataInput_) SetKmsKeyId(v string) *ExportS3DataInput_ { - s.KmsKeyId = &v - return s -} - -// SetS3Uri sets the S3Uri field's value. -func (s *ExportS3DataInput_) SetS3Uri(v string) *ExportS3DataInput_ { - s.S3Uri = &v - return s -} - -type ExportVectorEnrichmentJobInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Vector Enrichment job. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // A unique token that guarantees that the call to this API is idempotent. - ClientToken *string `min:"36" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) of the IAM rolewith permission to upload to - // the location in OutputConfig. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // Output location information for exporting Vector Enrichment Job results. - // - // OutputConfig is a required field - OutputConfig *ExportVectorEnrichmentJobOutputConfig `type:"structure" 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 ExportVectorEnrichmentJobInput) 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 ExportVectorEnrichmentJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportVectorEnrichmentJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportVectorEnrichmentJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 36)) - } - if s.ExecutionRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn")) - } - if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 20)) - } - if s.OutputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputConfig")) - } - if s.OutputConfig != nil { - if err := s.OutputConfig.Validate(); err != nil { - invalidParams.AddNested("OutputConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *ExportVectorEnrichmentJobInput) SetArn(v string) *ExportVectorEnrichmentJobInput { - s.Arn = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *ExportVectorEnrichmentJobInput) SetClientToken(v string) *ExportVectorEnrichmentJobInput { - s.ClientToken = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *ExportVectorEnrichmentJobInput) SetExecutionRoleArn(v string) *ExportVectorEnrichmentJobInput { - s.ExecutionRoleArn = &v - return s -} - -// SetOutputConfig sets the OutputConfig field's value. -func (s *ExportVectorEnrichmentJobInput) SetOutputConfig(v *ExportVectorEnrichmentJobOutputConfig) *ExportVectorEnrichmentJobInput { - s.OutputConfig = v - return s -} - -type ExportVectorEnrichmentJobOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Vector Enrichment job being exported. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The creation time. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role with permission to upload - // to the location in OutputConfig. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // The status of the results the Vector Enrichment job being exported. - // - // ExportStatus is a required field - ExportStatus *string `type:"string" required:"true" enum:"VectorEnrichmentJobExportStatus"` - - // Output location information for exporting Vector Enrichment Job results. - // - // OutputConfig is a required field - OutputConfig *ExportVectorEnrichmentJobOutputConfig `type:"structure" 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 ExportVectorEnrichmentJobOutput) 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 ExportVectorEnrichmentJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ExportVectorEnrichmentJobOutput) SetArn(v string) *ExportVectorEnrichmentJobOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ExportVectorEnrichmentJobOutput) SetCreationTime(v time.Time) *ExportVectorEnrichmentJobOutput { - s.CreationTime = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *ExportVectorEnrichmentJobOutput) SetExecutionRoleArn(v string) *ExportVectorEnrichmentJobOutput { - s.ExecutionRoleArn = &v - return s -} - -// SetExportStatus sets the ExportStatus field's value. -func (s *ExportVectorEnrichmentJobOutput) SetExportStatus(v string) *ExportVectorEnrichmentJobOutput { - s.ExportStatus = &v - return s -} - -// SetOutputConfig sets the OutputConfig field's value. -func (s *ExportVectorEnrichmentJobOutput) SetOutputConfig(v *ExportVectorEnrichmentJobOutputConfig) *ExportVectorEnrichmentJobOutput { - s.OutputConfig = v - return s -} - -// An object containing information about the output file. -type ExportVectorEnrichmentJobOutputConfig struct { - _ struct{} `type:"structure"` - - // The input structure for Amazon S3 data; representing the Amazon S3 location - // of the input data objects. - // - // S3Data is a required field - S3Data *VectorEnrichmentJobS3Data `type:"structure" 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 ExportVectorEnrichmentJobOutputConfig) 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 ExportVectorEnrichmentJobOutputConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExportVectorEnrichmentJobOutputConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportVectorEnrichmentJobOutputConfig"} - if s.S3Data == nil { - invalidParams.Add(request.NewErrParamRequired("S3Data")) - } - if s.S3Data != nil { - if err := s.S3Data.Validate(); err != nil { - invalidParams.AddNested("S3Data", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Data sets the S3Data field's value. -func (s *ExportVectorEnrichmentJobOutputConfig) SetS3Data(v *VectorEnrichmentJobS3Data) *ExportVectorEnrichmentJobOutputConfig { - s.S3Data = v - return s -} - -// The structure representing the filters supported by a RasterDataCollection. -type Filter struct { - _ struct{} `type:"structure"` - - // The maximum value of the filter. - Maximum *float64 `type:"float"` - - // The minimum value of the filter. - Minimum *float64 `type:"float"` - - // The name of the filter. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The type of the filter being used. - // - // Type is a required field - Type *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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// SetMaximum sets the Maximum field's value. -func (s *Filter) SetMaximum(v float64) *Filter { - s.Maximum = &v - return s -} - -// SetMinimum sets the Minimum field's value. -func (s *Filter) SetMinimum(v float64) *Filter { - s.Minimum = &v - return s -} - -// SetName sets the Name field's value. -func (s *Filter) SetName(v string) *Filter { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *Filter) SetType(v string) *Filter { - s.Type = &v - return s -} - -// Input configuration information for the geomosaic. -type GeoMosaicConfigInput_ struct { - _ struct{} `type:"structure"` - - // The name of the algorithm being used for geomosaic. - AlgorithmName *string `type:"string" enum:"AlgorithmNameGeoMosaic"` - - // The target bands for geomosaic. - TargetBands []*string `min:"1" type:"list"` -} - -// 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 GeoMosaicConfigInput_) 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 GeoMosaicConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GeoMosaicConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GeoMosaicConfigInput_"} - if s.TargetBands != nil && len(s.TargetBands) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBands", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *GeoMosaicConfigInput_) SetAlgorithmName(v string) *GeoMosaicConfigInput_ { - s.AlgorithmName = &v - return s -} - -// SetTargetBands sets the TargetBands field's value. -func (s *GeoMosaicConfigInput_) SetTargetBands(v []*string) *GeoMosaicConfigInput_ { - s.TargetBands = v - return s -} - -// The structure representing a Geometry in terms of Type and Coordinates as -// per GeoJson spec. -type Geometry struct { - _ struct{} `type:"structure"` - - // The coordinates of the GeoJson Geometry. - // - // Coordinates is a required field - Coordinates [][][]*float64 `min:"1" type:"list" required:"true"` - - // GeoJson Geometry types like Polygon and MultiPolygon. - // - // Type is a required field - Type *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 Geometry) 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 Geometry) GoString() string { - return s.String() -} - -// SetCoordinates sets the Coordinates field's value. -func (s *Geometry) SetCoordinates(v [][][]*float64) *Geometry { - s.Coordinates = v - return s -} - -// SetType sets the Type field's value. -func (s *Geometry) SetType(v string) *Geometry { - s.Type = &v - return s -} - -type GetEarthObservationJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Earth Observation job. - // - // Arn is a required field - Arn *string `location:"uri" locationName:"Arn" 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 GetEarthObservationJobInput) 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 GetEarthObservationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEarthObservationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEarthObservationJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *GetEarthObservationJobInput) SetArn(v string) *GetEarthObservationJobInput { - s.Arn = &v - return s -} - -type GetEarthObservationJobOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Earth Observation job. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The creation time of the initiated Earth Observation job. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The duration of Earth Observation job, in seconds. - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `type:"integer" required:"true"` - - // Details about the errors generated during the Earth Observation job. - ErrorDetails *EarthObservationJobErrorDetails `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // job. - ExecutionRoleArn *string `min:"20" type:"string"` - - // Details about the errors generated during ExportEarthObservationJob. - ExportErrorDetails *ExportErrorDetails `type:"structure"` - - // The status of the Earth Observation job. - ExportStatus *string `type:"string" enum:"EarthObservationJobExportStatus"` - - // Input data for the Earth Observation job. - // - // InputConfig is a required field - InputConfig *InputConfigOutput_ `type:"structure" required:"true"` - - // An object containing information about the job configuration. - // - // JobConfig is a required field - JobConfig *JobConfigInput_ `type:"structure" required:"true"` - - // The Key Management Service key ID for server-side encryption. - KmsKeyId *string `type:"string"` - - // The name of the Earth Observation job. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Bands available in the output of an operation. - OutputBands []*OutputBand `type:"list"` - - // The status of a previously initiated Earth Observation job. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"EarthObservationJobStatus"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` -} - -// 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 GetEarthObservationJobOutput) 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 GetEarthObservationJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetEarthObservationJobOutput) SetArn(v string) *GetEarthObservationJobOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetEarthObservationJobOutput) SetCreationTime(v time.Time) *GetEarthObservationJobOutput { - s.CreationTime = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *GetEarthObservationJobOutput) SetDurationInSeconds(v int64) *GetEarthObservationJobOutput { - s.DurationInSeconds = &v - return s -} - -// SetErrorDetails sets the ErrorDetails field's value. -func (s *GetEarthObservationJobOutput) SetErrorDetails(v *EarthObservationJobErrorDetails) *GetEarthObservationJobOutput { - s.ErrorDetails = v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *GetEarthObservationJobOutput) SetExecutionRoleArn(v string) *GetEarthObservationJobOutput { - s.ExecutionRoleArn = &v - return s -} - -// SetExportErrorDetails sets the ExportErrorDetails field's value. -func (s *GetEarthObservationJobOutput) SetExportErrorDetails(v *ExportErrorDetails) *GetEarthObservationJobOutput { - s.ExportErrorDetails = v - return s -} - -// SetExportStatus sets the ExportStatus field's value. -func (s *GetEarthObservationJobOutput) SetExportStatus(v string) *GetEarthObservationJobOutput { - s.ExportStatus = &v - return s -} - -// SetInputConfig sets the InputConfig field's value. -func (s *GetEarthObservationJobOutput) SetInputConfig(v *InputConfigOutput_) *GetEarthObservationJobOutput { - s.InputConfig = v - return s -} - -// SetJobConfig sets the JobConfig field's value. -func (s *GetEarthObservationJobOutput) SetJobConfig(v *JobConfigInput_) *GetEarthObservationJobOutput { - s.JobConfig = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *GetEarthObservationJobOutput) SetKmsKeyId(v string) *GetEarthObservationJobOutput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetEarthObservationJobOutput) SetName(v string) *GetEarthObservationJobOutput { - s.Name = &v - return s -} - -// SetOutputBands sets the OutputBands field's value. -func (s *GetEarthObservationJobOutput) SetOutputBands(v []*OutputBand) *GetEarthObservationJobOutput { - s.OutputBands = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetEarthObservationJobOutput) SetStatus(v string) *GetEarthObservationJobOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetEarthObservationJobOutput) SetTags(v map[string]*string) *GetEarthObservationJobOutput { - s.Tags = v - return s -} - -type GetRasterDataCollectionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the raster data collection. - // - // Arn is a required field - Arn *string `location:"uri" locationName:"Arn" 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 GetRasterDataCollectionInput) 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 GetRasterDataCollectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRasterDataCollectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRasterDataCollectionInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *GetRasterDataCollectionInput) SetArn(v string) *GetRasterDataCollectionInput { - s.Arn = &v - return s -} - -type GetRasterDataCollectionOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the raster data collection. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // A description of the raster data collection. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // The URL of the description page. - // - // DescriptionPageUrl is a required field - DescriptionPageUrl *string `type:"string" required:"true"` - - // The list of image source bands in the raster data collection. - // - // ImageSourceBands is a required field - ImageSourceBands []*string `type:"list" required:"true"` - - // The name of the raster data collection. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The filters supported by the raster data collection. - // - // SupportedFilters is a required field - SupportedFilters []*Filter `type:"list" required:"true"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` - - // The raster data collection type. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"DataCollectionType"` -} - -// 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 GetRasterDataCollectionOutput) 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 GetRasterDataCollectionOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetRasterDataCollectionOutput) SetArn(v string) *GetRasterDataCollectionOutput { - s.Arn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetRasterDataCollectionOutput) SetDescription(v string) *GetRasterDataCollectionOutput { - s.Description = &v - return s -} - -// SetDescriptionPageUrl sets the DescriptionPageUrl field's value. -func (s *GetRasterDataCollectionOutput) SetDescriptionPageUrl(v string) *GetRasterDataCollectionOutput { - s.DescriptionPageUrl = &v - return s -} - -// SetImageSourceBands sets the ImageSourceBands field's value. -func (s *GetRasterDataCollectionOutput) SetImageSourceBands(v []*string) *GetRasterDataCollectionOutput { - s.ImageSourceBands = v - return s -} - -// SetName sets the Name field's value. -func (s *GetRasterDataCollectionOutput) SetName(v string) *GetRasterDataCollectionOutput { - s.Name = &v - return s -} - -// SetSupportedFilters sets the SupportedFilters field's value. -func (s *GetRasterDataCollectionOutput) SetSupportedFilters(v []*Filter) *GetRasterDataCollectionOutput { - s.SupportedFilters = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetRasterDataCollectionOutput) SetTags(v map[string]*string) *GetRasterDataCollectionOutput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *GetRasterDataCollectionOutput) SetType(v string) *GetRasterDataCollectionOutput { - s.Type = &v - return s -} - -type GetTileInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the tile operation. - // - // Arn is a required field - Arn *string `location:"querystring" locationName:"Arn" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role that you specify. - ExecutionRoleArn *string `location:"querystring" locationName:"ExecutionRoleArn" min:"20" type:"string"` - - // The particular assets or bands to tile. - // - // ImageAssets is a required field - ImageAssets []*string `location:"querystring" locationName:"ImageAssets" min:"1" type:"list" required:"true"` - - // Determines whether or not to return a valid data mask. - ImageMask *bool `location:"querystring" locationName:"ImageMask" type:"boolean"` - - // The output data type of the tile operation. - OutputDataType *string `location:"querystring" locationName:"OutputDataType" type:"string" enum:"OutputType"` - - // The data format of the output tile. The formats include .npy, .png and .jpg. - OutputFormat *string `location:"querystring" locationName:"OutputFormat" type:"string"` - - // Property filters for the imagery to tile. - PropertyFilters *string `location:"querystring" locationName:"PropertyFilters" type:"string"` - - // Determines what part of the Earth Observation job to tile. 'INPUT' or 'OUTPUT' - // are the valid options. - // - // Target is a required field - Target *string `location:"querystring" locationName:"Target" type:"string" required:"true" enum:"TargetOptions"` - - // Time range filter applied to imagery to find the images to tile. - TimeRangeFilter *string `location:"querystring" locationName:"TimeRangeFilter" type:"string"` - - // The x coordinate of the tile input. - // - // X is a required field - X *int64 `location:"uri" locationName:"x" type:"integer" required:"true"` - - // The y coordinate of the tile input. - // - // Y is a required field - Y *int64 `location:"uri" locationName:"y" type:"integer" required:"true"` - - // The z coordinate of the tile input. - // - // Z is a required field - Z *int64 `location:"uri" locationName:"z" type:"integer" 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 GetTileInput) 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 GetTileInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTileInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 20)) - } - if s.ImageAssets == nil { - invalidParams.Add(request.NewErrParamRequired("ImageAssets")) - } - if s.ImageAssets != nil && len(s.ImageAssets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageAssets", 1)) - } - if s.Target == nil { - invalidParams.Add(request.NewErrParamRequired("Target")) - } - if s.X == nil { - invalidParams.Add(request.NewErrParamRequired("X")) - } - if s.Y == nil { - invalidParams.Add(request.NewErrParamRequired("Y")) - } - if s.Z == nil { - invalidParams.Add(request.NewErrParamRequired("Z")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *GetTileInput) SetArn(v string) *GetTileInput { - s.Arn = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *GetTileInput) SetExecutionRoleArn(v string) *GetTileInput { - s.ExecutionRoleArn = &v - return s -} - -// SetImageAssets sets the ImageAssets field's value. -func (s *GetTileInput) SetImageAssets(v []*string) *GetTileInput { - s.ImageAssets = v - return s -} - -// SetImageMask sets the ImageMask field's value. -func (s *GetTileInput) SetImageMask(v bool) *GetTileInput { - s.ImageMask = &v - return s -} - -// SetOutputDataType sets the OutputDataType field's value. -func (s *GetTileInput) SetOutputDataType(v string) *GetTileInput { - s.OutputDataType = &v - return s -} - -// SetOutputFormat sets the OutputFormat field's value. -func (s *GetTileInput) SetOutputFormat(v string) *GetTileInput { - s.OutputFormat = &v - return s -} - -// SetPropertyFilters sets the PropertyFilters field's value. -func (s *GetTileInput) SetPropertyFilters(v string) *GetTileInput { - s.PropertyFilters = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *GetTileInput) SetTarget(v string) *GetTileInput { - s.Target = &v - return s -} - -// SetTimeRangeFilter sets the TimeRangeFilter field's value. -func (s *GetTileInput) SetTimeRangeFilter(v string) *GetTileInput { - s.TimeRangeFilter = &v - return s -} - -// SetX sets the X field's value. -func (s *GetTileInput) SetX(v int64) *GetTileInput { - s.X = &v - return s -} - -// SetY sets the Y field's value. -func (s *GetTileInput) SetY(v int64) *GetTileInput { - s.Y = &v - return s -} - -// SetZ sets the Z field's value. -func (s *GetTileInput) SetZ(v int64) *GetTileInput { - s.Z = &v - return s -} - -type GetTileOutput struct { - _ struct{} `type:"structure" payload:"BinaryFile"` - - // The output binary file. - BinaryFile io.ReadCloser `type:"blob"` -} - -// 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 GetTileOutput) 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 GetTileOutput) GoString() string { - return s.String() -} - -// SetBinaryFile sets the BinaryFile field's value. -func (s *GetTileOutput) SetBinaryFile(v io.ReadCloser) *GetTileOutput { - s.BinaryFile = v - return s -} - -type GetVectorEnrichmentJobInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Vector Enrichment job. - // - // Arn is a required field - Arn *string `location:"uri" locationName:"Arn" 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 GetVectorEnrichmentJobInput) 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 GetVectorEnrichmentJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetVectorEnrichmentJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVectorEnrichmentJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *GetVectorEnrichmentJobInput) SetArn(v string) *GetVectorEnrichmentJobInput { - s.Arn = &v - return s -} - -type GetVectorEnrichmentJobOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Vector Enrichment job. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The creation time. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The duration of the Vector Enrichment job, in seconds. - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `type:"integer" required:"true"` - - // Details about the errors generated during the Vector Enrichment job. - ErrorDetails *VectorEnrichmentJobErrorDetails `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // job. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // Details about the errors generated during the ExportVectorEnrichmentJob. - ExportErrorDetails *VectorEnrichmentJobExportErrorDetails `type:"structure"` - - // The export status of the Vector Enrichment job being initiated. - ExportStatus *string `type:"string" enum:"VectorEnrichmentJobExportStatus"` - - // Input configuration information for the Vector Enrichment job. - // - // InputConfig is a required field - InputConfig *VectorEnrichmentJobInputConfig `type:"structure" required:"true"` - - // An object containing information about the job configuration. - // - // JobConfig is a required field - JobConfig *VectorEnrichmentJobConfig `type:"structure" required:"true"` - - // The Key Management Service key ID for server-side encryption. - KmsKeyId *string `type:"string"` - - // The name of the Vector Enrichment job. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The status of the initiated Vector Enrichment job. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"VectorEnrichmentJobStatus"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` - - // The type of the Vector Enrichment job being initiated. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"VectorEnrichmentJobType"` -} - -// 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 GetVectorEnrichmentJobOutput) 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 GetVectorEnrichmentJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetVectorEnrichmentJobOutput) SetArn(v string) *GetVectorEnrichmentJobOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *GetVectorEnrichmentJobOutput) SetCreationTime(v time.Time) *GetVectorEnrichmentJobOutput { - s.CreationTime = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *GetVectorEnrichmentJobOutput) SetDurationInSeconds(v int64) *GetVectorEnrichmentJobOutput { - s.DurationInSeconds = &v - return s -} - -// SetErrorDetails sets the ErrorDetails field's value. -func (s *GetVectorEnrichmentJobOutput) SetErrorDetails(v *VectorEnrichmentJobErrorDetails) *GetVectorEnrichmentJobOutput { - s.ErrorDetails = v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *GetVectorEnrichmentJobOutput) SetExecutionRoleArn(v string) *GetVectorEnrichmentJobOutput { - s.ExecutionRoleArn = &v - return s -} - -// SetExportErrorDetails sets the ExportErrorDetails field's value. -func (s *GetVectorEnrichmentJobOutput) SetExportErrorDetails(v *VectorEnrichmentJobExportErrorDetails) *GetVectorEnrichmentJobOutput { - s.ExportErrorDetails = v - return s -} - -// SetExportStatus sets the ExportStatus field's value. -func (s *GetVectorEnrichmentJobOutput) SetExportStatus(v string) *GetVectorEnrichmentJobOutput { - s.ExportStatus = &v - return s -} - -// SetInputConfig sets the InputConfig field's value. -func (s *GetVectorEnrichmentJobOutput) SetInputConfig(v *VectorEnrichmentJobInputConfig) *GetVectorEnrichmentJobOutput { - s.InputConfig = v - return s -} - -// SetJobConfig sets the JobConfig field's value. -func (s *GetVectorEnrichmentJobOutput) SetJobConfig(v *VectorEnrichmentJobConfig) *GetVectorEnrichmentJobOutput { - s.JobConfig = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *GetVectorEnrichmentJobOutput) SetKmsKeyId(v string) *GetVectorEnrichmentJobOutput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetVectorEnrichmentJobOutput) SetName(v string) *GetVectorEnrichmentJobOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetVectorEnrichmentJobOutput) SetStatus(v string) *GetVectorEnrichmentJobOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetVectorEnrichmentJobOutput) SetTags(v map[string]*string) *GetVectorEnrichmentJobOutput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *GetVectorEnrichmentJobOutput) SetType(v string) *GetVectorEnrichmentJobOutput { - s.Type = &v - return s -} - -// Input configuration information. -type InputConfigInput_ struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the previous Earth Observation job. - PreviousEarthObservationJobArn *string `type:"string"` - - // The structure representing the RasterDataCollection Query consisting of the - // Area of Interest, RasterDataCollectionArn,TimeRange and Property Filters. - RasterDataCollectionQuery *RasterDataCollectionQueryInput_ `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 InputConfigInput_) 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 InputConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputConfigInput_"} - if s.RasterDataCollectionQuery != nil { - if err := s.RasterDataCollectionQuery.Validate(); err != nil { - invalidParams.AddNested("RasterDataCollectionQuery", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPreviousEarthObservationJobArn sets the PreviousEarthObservationJobArn field's value. -func (s *InputConfigInput_) SetPreviousEarthObservationJobArn(v string) *InputConfigInput_ { - s.PreviousEarthObservationJobArn = &v - return s -} - -// SetRasterDataCollectionQuery sets the RasterDataCollectionQuery field's value. -func (s *InputConfigInput_) SetRasterDataCollectionQuery(v *RasterDataCollectionQueryInput_) *InputConfigInput_ { - s.RasterDataCollectionQuery = v - return s -} - -// The InputConfig for an EarthObservationJob response. -type InputConfigOutput_ struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the previous Earth Observation job. - PreviousEarthObservationJobArn *string `type:"string"` - - // The structure representing the RasterDataCollection Query consisting of the - // Area of Interest, RasterDataCollectionArn, RasterDataCollectionName, TimeRange, - // and Property Filters. - RasterDataCollectionQuery *RasterDataCollectionQueryOutput_ `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 InputConfigOutput_) 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 InputConfigOutput_) GoString() string { - return s.String() -} - -// SetPreviousEarthObservationJobArn sets the PreviousEarthObservationJobArn field's value. -func (s *InputConfigOutput_) SetPreviousEarthObservationJobArn(v string) *InputConfigOutput_ { - s.PreviousEarthObservationJobArn = &v - return s -} - -// SetRasterDataCollectionQuery sets the RasterDataCollectionQuery field's value. -func (s *InputConfigOutput_) SetRasterDataCollectionQuery(v *RasterDataCollectionQueryOutput_) *InputConfigOutput_ { - s.RasterDataCollectionQuery = v - return s -} - -// The request processing has failed because of an unknown error, exception, -// or failure. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - ResourceId *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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The structure representing the items in the response for SearchRasterDataCollection. -type ItemSource struct { - _ struct{} `type:"structure"` - - // This is a dictionary of Asset Objects data associated with the Item that - // can be downloaded or streamed, each with a unique key. - Assets map[string]*AssetValue `type:"map"` - - // The searchable date and time of the item, in UTC. - // - // DateTime is a required field - DateTime *time.Time `type:"timestamp" required:"true"` - - // The item Geometry in GeoJson format. - // - // Geometry is a required field - Geometry *Geometry `type:"structure" required:"true"` - - // A unique Id for the source item. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // This field contains additional properties of the item. - Properties *Properties `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 ItemSource) 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 ItemSource) GoString() string { - return s.String() -} - -// SetAssets sets the Assets field's value. -func (s *ItemSource) SetAssets(v map[string]*AssetValue) *ItemSource { - s.Assets = v - return s -} - -// SetDateTime sets the DateTime field's value. -func (s *ItemSource) SetDateTime(v time.Time) *ItemSource { - s.DateTime = &v - return s -} - -// SetGeometry sets the Geometry field's value. -func (s *ItemSource) SetGeometry(v *Geometry) *ItemSource { - s.Geometry = v - return s -} - -// SetId sets the Id field's value. -func (s *ItemSource) SetId(v string) *ItemSource { - s.Id = &v - return s -} - -// SetProperties sets the Properties field's value. -func (s *ItemSource) SetProperties(v *Properties) *ItemSource { - s.Properties = v - return s -} - -// The input structure for the JobConfig in an EarthObservationJob. -type JobConfigInput_ struct { - _ struct{} `type:"structure"` - - // An object containing information about the job configuration for BandMath. - BandMathConfig *BandMathConfigInput_ `type:"structure"` - - // An object containing information about the job configuration for cloud masking. - CloudMaskingConfig *CloudMaskingConfigInput_ `type:"structure"` - - // An object containing information about the job configuration for cloud removal. - CloudRemovalConfig *CloudRemovalConfigInput_ `type:"structure"` - - // An object containing information about the job configuration for geomosaic. - GeoMosaicConfig *GeoMosaicConfigInput_ `type:"structure"` - - // An object containing information about the job configuration for land cover - // segmentation. - LandCoverSegmentationConfig *LandCoverSegmentationConfigInput_ `type:"structure"` - - // An object containing information about the job configuration for resampling. - ResamplingConfig *ResamplingConfigInput_ `type:"structure"` - - // An object containing information about the job configuration for a Stacking - // Earth Observation job. - StackConfig *StackConfigInput_ `type:"structure"` - - // An object containing information about the job configuration for temporal - // statistics. - TemporalStatisticsConfig *TemporalStatisticsConfigInput_ `type:"structure"` - - // An object containing information about the job configuration for zonal statistics. - ZonalStatisticsConfig *ZonalStatisticsConfigInput_ `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 JobConfigInput_) 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 JobConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *JobConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "JobConfigInput_"} - if s.BandMathConfig != nil { - if err := s.BandMathConfig.Validate(); err != nil { - invalidParams.AddNested("BandMathConfig", err.(request.ErrInvalidParams)) - } - } - if s.CloudRemovalConfig != nil { - if err := s.CloudRemovalConfig.Validate(); err != nil { - invalidParams.AddNested("CloudRemovalConfig", err.(request.ErrInvalidParams)) - } - } - if s.GeoMosaicConfig != nil { - if err := s.GeoMosaicConfig.Validate(); err != nil { - invalidParams.AddNested("GeoMosaicConfig", err.(request.ErrInvalidParams)) - } - } - if s.ResamplingConfig != nil { - if err := s.ResamplingConfig.Validate(); err != nil { - invalidParams.AddNested("ResamplingConfig", err.(request.ErrInvalidParams)) - } - } - if s.StackConfig != nil { - if err := s.StackConfig.Validate(); err != nil { - invalidParams.AddNested("StackConfig", err.(request.ErrInvalidParams)) - } - } - if s.TemporalStatisticsConfig != nil { - if err := s.TemporalStatisticsConfig.Validate(); err != nil { - invalidParams.AddNested("TemporalStatisticsConfig", err.(request.ErrInvalidParams)) - } - } - if s.ZonalStatisticsConfig != nil { - if err := s.ZonalStatisticsConfig.Validate(); err != nil { - invalidParams.AddNested("ZonalStatisticsConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBandMathConfig sets the BandMathConfig field's value. -func (s *JobConfigInput_) SetBandMathConfig(v *BandMathConfigInput_) *JobConfigInput_ { - s.BandMathConfig = v - return s -} - -// SetCloudMaskingConfig sets the CloudMaskingConfig field's value. -func (s *JobConfigInput_) SetCloudMaskingConfig(v *CloudMaskingConfigInput_) *JobConfigInput_ { - s.CloudMaskingConfig = v - return s -} - -// SetCloudRemovalConfig sets the CloudRemovalConfig field's value. -func (s *JobConfigInput_) SetCloudRemovalConfig(v *CloudRemovalConfigInput_) *JobConfigInput_ { - s.CloudRemovalConfig = v - return s -} - -// SetGeoMosaicConfig sets the GeoMosaicConfig field's value. -func (s *JobConfigInput_) SetGeoMosaicConfig(v *GeoMosaicConfigInput_) *JobConfigInput_ { - s.GeoMosaicConfig = v - return s -} - -// SetLandCoverSegmentationConfig sets the LandCoverSegmentationConfig field's value. -func (s *JobConfigInput_) SetLandCoverSegmentationConfig(v *LandCoverSegmentationConfigInput_) *JobConfigInput_ { - s.LandCoverSegmentationConfig = v - return s -} - -// SetResamplingConfig sets the ResamplingConfig field's value. -func (s *JobConfigInput_) SetResamplingConfig(v *ResamplingConfigInput_) *JobConfigInput_ { - s.ResamplingConfig = v - return s -} - -// SetStackConfig sets the StackConfig field's value. -func (s *JobConfigInput_) SetStackConfig(v *StackConfigInput_) *JobConfigInput_ { - s.StackConfig = v - return s -} - -// SetTemporalStatisticsConfig sets the TemporalStatisticsConfig field's value. -func (s *JobConfigInput_) SetTemporalStatisticsConfig(v *TemporalStatisticsConfigInput_) *JobConfigInput_ { - s.TemporalStatisticsConfig = v - return s -} - -// SetZonalStatisticsConfig sets the ZonalStatisticsConfig field's value. -func (s *JobConfigInput_) SetZonalStatisticsConfig(v *ZonalStatisticsConfigInput_) *JobConfigInput_ { - s.ZonalStatisticsConfig = v - return s -} - -// The input structure for Land Cover Operation type. -type LandCoverSegmentationConfigInput_ 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 LandCoverSegmentationConfigInput_) 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 LandCoverSegmentationConfigInput_) GoString() string { - return s.String() -} - -// The structure representing Land Cloud Cover property for Landsat data collection. -type LandsatCloudCoverLandInput_ struct { - _ struct{} `type:"structure"` - - // The minimum value for Land Cloud Cover property filter. This will filter - // items having Land Cloud Cover greater than or equal to this value. - // - // LowerBound is a required field - LowerBound *float64 `type:"float" required:"true"` - - // The maximum value for Land Cloud Cover property filter. This will filter - // items having Land Cloud Cover less than or equal to this value. - // - // UpperBound is a required field - UpperBound *float64 `type:"float" 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 LandsatCloudCoverLandInput_) 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 LandsatCloudCoverLandInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LandsatCloudCoverLandInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LandsatCloudCoverLandInput_"} - if s.LowerBound == nil { - invalidParams.Add(request.NewErrParamRequired("LowerBound")) - } - if s.UpperBound == nil { - invalidParams.Add(request.NewErrParamRequired("UpperBound")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLowerBound sets the LowerBound field's value. -func (s *LandsatCloudCoverLandInput_) SetLowerBound(v float64) *LandsatCloudCoverLandInput_ { - s.LowerBound = &v - return s -} - -// SetUpperBound sets the UpperBound field's value. -func (s *LandsatCloudCoverLandInput_) SetUpperBound(v float64) *LandsatCloudCoverLandInput_ { - s.UpperBound = &v - return s -} - -// An object containing information about the output file. -type ListEarthObservationJobOutputConfig struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the list of the Earth Observation jobs. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The creation time. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The duration of the session, in seconds. - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `type:"integer" required:"true"` - - // The names of the Earth Observation jobs in the list. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The operation type for an Earth Observation job. - // - // OperationType is a required field - OperationType *string `type:"string" required:"true"` - - // The status of the list of the Earth Observation jobs. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"EarthObservationJobStatus"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` -} - -// 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 ListEarthObservationJobOutputConfig) 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 ListEarthObservationJobOutputConfig) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListEarthObservationJobOutputConfig) SetArn(v string) *ListEarthObservationJobOutputConfig { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ListEarthObservationJobOutputConfig) SetCreationTime(v time.Time) *ListEarthObservationJobOutputConfig { - s.CreationTime = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *ListEarthObservationJobOutputConfig) SetDurationInSeconds(v int64) *ListEarthObservationJobOutputConfig { - s.DurationInSeconds = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListEarthObservationJobOutputConfig) SetName(v string) *ListEarthObservationJobOutputConfig { - s.Name = &v - return s -} - -// SetOperationType sets the OperationType field's value. -func (s *ListEarthObservationJobOutputConfig) SetOperationType(v string) *ListEarthObservationJobOutputConfig { - s.OperationType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListEarthObservationJobOutputConfig) SetStatus(v string) *ListEarthObservationJobOutputConfig { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListEarthObservationJobOutputConfig) SetTags(v map[string]*string) *ListEarthObservationJobOutputConfig { - s.Tags = v - return s -} - -type ListEarthObservationJobsInput struct { - _ struct{} `type:"structure"` - - // The total number of items to return. - MaxResults *int64 `min:"1" type:"integer"` - - // If the previous response was truncated, you receive this token. Use it in - // your next request to receive the next set of results. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListEarthObservationJobsInput's - // String and GoString methods. - NextToken *string `type:"string" sensitive:"true"` - - // The parameter by which to sort the results. - SortBy *string `type:"string"` - - // An optional value that specifies whether you want the results sorted in Ascending - // or Descending order. - SortOrder *string `type:"string" enum:"SortOrder"` - - // A filter that retrieves only jobs with a specific status. - StatusEquals *string `type:"string" enum:"EarthObservationJobStatus"` -} - -// 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 ListEarthObservationJobsInput) 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 ListEarthObservationJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEarthObservationJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEarthObservationJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEarthObservationJobsInput) SetMaxResults(v int64) *ListEarthObservationJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEarthObservationJobsInput) SetNextToken(v string) *ListEarthObservationJobsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListEarthObservationJobsInput) SetSortBy(v string) *ListEarthObservationJobsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListEarthObservationJobsInput) SetSortOrder(v string) *ListEarthObservationJobsInput { - s.SortOrder = &v - return s -} - -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListEarthObservationJobsInput) SetStatusEquals(v string) *ListEarthObservationJobsInput { - s.StatusEquals = &v - return s -} - -type ListEarthObservationJobsOutput struct { - _ struct{} `type:"structure"` - - // Contains summary information about the Earth Observation jobs. - // - // EarthObservationJobSummaries is a required field - EarthObservationJobSummaries []*ListEarthObservationJobOutputConfig `type:"list" required:"true"` - - // If the previous response was truncated, you receive this token. Use it in - // your next request to receive the next set of results. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListEarthObservationJobsOutput's - // String and GoString methods. - NextToken *string `type:"string" sensitive:"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 ListEarthObservationJobsOutput) 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 ListEarthObservationJobsOutput) GoString() string { - return s.String() -} - -// SetEarthObservationJobSummaries sets the EarthObservationJobSummaries field's value. -func (s *ListEarthObservationJobsOutput) SetEarthObservationJobSummaries(v []*ListEarthObservationJobOutputConfig) *ListEarthObservationJobsOutput { - s.EarthObservationJobSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEarthObservationJobsOutput) SetNextToken(v string) *ListEarthObservationJobsOutput { - s.NextToken = &v - return s -} - -type ListRasterDataCollectionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The total number of items to return. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // If the previous response was truncated, you receive this token. Use it in - // your next request to receive the next set of results. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListRasterDataCollectionsInput's - // String and GoString methods. - NextToken *string `location:"querystring" locationName:"NextToken" type:"string" sensitive:"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 ListRasterDataCollectionsInput) 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 ListRasterDataCollectionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRasterDataCollectionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRasterDataCollectionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRasterDataCollectionsInput) SetMaxResults(v int64) *ListRasterDataCollectionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRasterDataCollectionsInput) SetNextToken(v string) *ListRasterDataCollectionsInput { - s.NextToken = &v - return s -} - -type ListRasterDataCollectionsOutput struct { - _ struct{} `type:"structure"` - - // If the previous response was truncated, you receive this token. Use it in - // your next request to receive the next set of results. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListRasterDataCollectionsOutput's - // String and GoString methods. - NextToken *string `type:"string" sensitive:"true"` - - // Contains summary information about the raster data collection. - // - // RasterDataCollectionSummaries is a required field - RasterDataCollectionSummaries []*RasterDataCollectionMetadata `type:"list" 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 ListRasterDataCollectionsOutput) 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 ListRasterDataCollectionsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRasterDataCollectionsOutput) SetNextToken(v string) *ListRasterDataCollectionsOutput { - s.NextToken = &v - return s -} - -// SetRasterDataCollectionSummaries sets the RasterDataCollectionSummaries field's value. -func (s *ListRasterDataCollectionsOutput) SetRasterDataCollectionSummaries(v []*RasterDataCollectionMetadata) *ListRasterDataCollectionsOutput { - s.RasterDataCollectionSummaries = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource you want to tag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// An object containing information about the output file. -type ListVectorEnrichmentJobOutputConfig struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the list of the Vector Enrichment jobs. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The creation time. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The duration of the session, in seconds. - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `type:"integer" required:"true"` - - // The names of the Vector Enrichment jobs in the list. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The status of the Vector Enrichment jobs list. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"VectorEnrichmentJobStatus"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` - - // The type of the list of Vector Enrichment jobs. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"VectorEnrichmentJobType"` -} - -// 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 ListVectorEnrichmentJobOutputConfig) 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 ListVectorEnrichmentJobOutputConfig) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListVectorEnrichmentJobOutputConfig) SetArn(v string) *ListVectorEnrichmentJobOutputConfig { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *ListVectorEnrichmentJobOutputConfig) SetCreationTime(v time.Time) *ListVectorEnrichmentJobOutputConfig { - s.CreationTime = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *ListVectorEnrichmentJobOutputConfig) SetDurationInSeconds(v int64) *ListVectorEnrichmentJobOutputConfig { - s.DurationInSeconds = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListVectorEnrichmentJobOutputConfig) SetName(v string) *ListVectorEnrichmentJobOutputConfig { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListVectorEnrichmentJobOutputConfig) SetStatus(v string) *ListVectorEnrichmentJobOutputConfig { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListVectorEnrichmentJobOutputConfig) SetTags(v map[string]*string) *ListVectorEnrichmentJobOutputConfig { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *ListVectorEnrichmentJobOutputConfig) SetType(v string) *ListVectorEnrichmentJobOutputConfig { - s.Type = &v - return s -} - -type ListVectorEnrichmentJobsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of items to return. - MaxResults *int64 `min:"1" type:"integer"` - - // If the previous response was truncated, you receive this token. Use it in - // your next request to receive the next set of results. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListVectorEnrichmentJobsInput's - // String and GoString methods. - NextToken *string `type:"string" sensitive:"true"` - - // The parameter by which to sort the results. - SortBy *string `type:"string"` - - // An optional value that specifies whether you want the results sorted in Ascending - // or Descending order. - SortOrder *string `type:"string" enum:"SortOrder"` - - // A filter that retrieves only jobs with a specific status. - StatusEquals *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 ListVectorEnrichmentJobsInput) 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 ListVectorEnrichmentJobsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListVectorEnrichmentJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListVectorEnrichmentJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListVectorEnrichmentJobsInput) SetMaxResults(v int64) *ListVectorEnrichmentJobsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVectorEnrichmentJobsInput) SetNextToken(v string) *ListVectorEnrichmentJobsInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListVectorEnrichmentJobsInput) SetSortBy(v string) *ListVectorEnrichmentJobsInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListVectorEnrichmentJobsInput) SetSortOrder(v string) *ListVectorEnrichmentJobsInput { - s.SortOrder = &v - return s -} - -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListVectorEnrichmentJobsInput) SetStatusEquals(v string) *ListVectorEnrichmentJobsInput { - s.StatusEquals = &v - return s -} - -type ListVectorEnrichmentJobsOutput struct { - _ struct{} `type:"structure"` - - // If the previous response was truncated, you receive this token. Use it in - // your next request to receive the next set of results. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListVectorEnrichmentJobsOutput's - // String and GoString methods. - NextToken *string `type:"string" sensitive:"true"` - - // Contains summary information about the Vector Enrichment jobs. - // - // VectorEnrichmentJobSummaries is a required field - VectorEnrichmentJobSummaries []*ListVectorEnrichmentJobOutputConfig `type:"list" 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 ListVectorEnrichmentJobsOutput) 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 ListVectorEnrichmentJobsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListVectorEnrichmentJobsOutput) SetNextToken(v string) *ListVectorEnrichmentJobsOutput { - s.NextToken = &v - return s -} - -// SetVectorEnrichmentJobSummaries sets the VectorEnrichmentJobSummaries field's value. -func (s *ListVectorEnrichmentJobsOutput) SetVectorEnrichmentJobSummaries(v []*ListVectorEnrichmentJobOutputConfig) *ListVectorEnrichmentJobsOutput { - s.VectorEnrichmentJobSummaries = v - return s -} - -// The input structure for Map Matching operation type. -type MapMatchingConfig struct { - _ struct{} `type:"structure"` - - // The field name for the data that describes the identifier representing a - // collection of GPS points belonging to an individual trace. - // - // IdAttributeName is a required field - IdAttributeName *string `type:"string" required:"true"` - - // The name of the timestamp attribute. - // - // TimestampAttributeName is a required field - TimestampAttributeName *string `type:"string" required:"true"` - - // The name of the X-attribute - // - // XAttributeName is a required field - XAttributeName *string `type:"string" required:"true"` - - // The name of the Y-attribute - // - // YAttributeName is a required field - YAttributeName *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 MapMatchingConfig) 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 MapMatchingConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MapMatchingConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MapMatchingConfig"} - if s.IdAttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("IdAttributeName")) - } - if s.TimestampAttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("TimestampAttributeName")) - } - if s.XAttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("XAttributeName")) - } - if s.YAttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("YAttributeName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdAttributeName sets the IdAttributeName field's value. -func (s *MapMatchingConfig) SetIdAttributeName(v string) *MapMatchingConfig { - s.IdAttributeName = &v - return s -} - -// SetTimestampAttributeName sets the TimestampAttributeName field's value. -func (s *MapMatchingConfig) SetTimestampAttributeName(v string) *MapMatchingConfig { - s.TimestampAttributeName = &v - return s -} - -// SetXAttributeName sets the XAttributeName field's value. -func (s *MapMatchingConfig) SetXAttributeName(v string) *MapMatchingConfig { - s.XAttributeName = &v - return s -} - -// SetYAttributeName sets the YAttributeName field's value. -func (s *MapMatchingConfig) SetYAttributeName(v string) *MapMatchingConfig { - s.YAttributeName = &v - return s -} - -// The structure representing Polygon Geometry based on the GeoJson spec (https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6). -type MultiPolygonGeometryInput_ struct { - _ struct{} `type:"structure"` - - // The coordinates of the multipolygon geometry. - // - // Coordinates is a required field - Coordinates [][][][]*float64 `type:"list" 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 MultiPolygonGeometryInput_) 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 MultiPolygonGeometryInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MultiPolygonGeometryInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MultiPolygonGeometryInput_"} - if s.Coordinates == nil { - invalidParams.Add(request.NewErrParamRequired("Coordinates")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCoordinates sets the Coordinates field's value. -func (s *MultiPolygonGeometryInput_) SetCoordinates(v [][][][]*float64) *MultiPolygonGeometryInput_ { - s.Coordinates = v - return s -} - -// Represents an arithmetic operation to compute spectral index. -type Operation struct { - _ struct{} `type:"structure"` - - // Textual representation of the math operation; Equation used to compute the - // spectral index. - // - // Equation is a required field - Equation *string `type:"string" required:"true"` - - // The name of the operation. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The type of the operation. - OutputType *string `type:"string" enum:"OutputType"` -} - -// 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 Operation) 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 Operation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Operation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Operation"} - if s.Equation == nil { - invalidParams.Add(request.NewErrParamRequired("Equation")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEquation sets the Equation field's value. -func (s *Operation) SetEquation(v string) *Operation { - s.Equation = &v - return s -} - -// SetName sets the Name field's value. -func (s *Operation) SetName(v string) *Operation { - s.Name = &v - return s -} - -// SetOutputType sets the OutputType field's value. -func (s *Operation) SetOutputType(v string) *Operation { - s.OutputType = &v - return s -} - -// A single EarthObservationJob output band. -type OutputBand struct { - _ struct{} `type:"structure"` - - // The name of the band. - // - // BandName is a required field - BandName *string `type:"string" required:"true"` - - // The datatype of the output band. - // - // OutputDataType is a required field - OutputDataType *string `type:"string" required:"true" enum:"OutputType"` -} - -// 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 OutputBand) 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 OutputBand) GoString() string { - return s.String() -} - -// SetBandName sets the BandName field's value. -func (s *OutputBand) SetBandName(v string) *OutputBand { - s.BandName = &v - return s -} - -// SetOutputDataType sets the OutputDataType field's value. -func (s *OutputBand) SetOutputDataType(v string) *OutputBand { - s.OutputDataType = &v - return s -} - -// The response structure for an OutputConfig returned by an ExportEarthObservationJob. -type OutputConfigInput_ struct { - _ struct{} `type:"structure"` - - // Path to Amazon S3 storage location for the output configuration file. - // - // S3Data is a required field - S3Data *ExportS3DataInput_ `type:"structure" 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 OutputConfigInput_) 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 OutputConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutputConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputConfigInput_"} - if s.S3Data == nil { - invalidParams.Add(request.NewErrParamRequired("S3Data")) - } - if s.S3Data != nil { - if err := s.S3Data.Validate(); err != nil { - invalidParams.AddNested("S3Data", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Data sets the S3Data field's value. -func (s *OutputConfigInput_) SetS3Data(v *ExportS3DataInput_) *OutputConfigInput_ { - s.S3Data = v - return s -} - -// OutputResolution Configuration indicating the target resolution for the output -// of Resampling operation. -type OutputResolutionResamplingInput_ struct { - _ struct{} `type:"structure"` - - // User Defined Resolution for the output of Resampling operation defined by - // value and unit. - // - // UserDefined is a required field - UserDefined *UserDefined `type:"structure" 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 OutputResolutionResamplingInput_) 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 OutputResolutionResamplingInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutputResolutionResamplingInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputResolutionResamplingInput_"} - if s.UserDefined == nil { - invalidParams.Add(request.NewErrParamRequired("UserDefined")) - } - if s.UserDefined != nil { - if err := s.UserDefined.Validate(); err != nil { - invalidParams.AddNested("UserDefined", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUserDefined sets the UserDefined field's value. -func (s *OutputResolutionResamplingInput_) SetUserDefined(v *UserDefined) *OutputResolutionResamplingInput_ { - s.UserDefined = v - return s -} - -// The input structure representing Output Resolution for Stacking Operation. -type OutputResolutionStackInput_ struct { - _ struct{} `type:"structure"` - - // A string value representing Predefined Output Resolution for a stacking operation. - // Allowed values are HIGHEST, LOWEST, and AVERAGE. - Predefined *string `type:"string" enum:"PredefinedResolution"` - - // The structure representing User Output Resolution for a Stacking operation - // defined as a value and unit. - UserDefined *UserDefined `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 OutputResolutionStackInput_) 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 OutputResolutionStackInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutputResolutionStackInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputResolutionStackInput_"} - if s.UserDefined != nil { - if err := s.UserDefined.Validate(); err != nil { - invalidParams.AddNested("UserDefined", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPredefined sets the Predefined field's value. -func (s *OutputResolutionStackInput_) SetPredefined(v string) *OutputResolutionStackInput_ { - s.Predefined = &v - return s -} - -// SetUserDefined sets the UserDefined field's value. -func (s *OutputResolutionStackInput_) SetUserDefined(v *UserDefined) *OutputResolutionStackInput_ { - s.UserDefined = v - return s -} - -// The input structure for specifying Platform. Platform refers to the unique -// name of the specific platform the instrument is attached to. For satellites -// it is the name of the satellite, eg. landsat-8 (Landsat-8), sentinel-2a. -type PlatformInput_ struct { - _ struct{} `type:"structure"` - - // The ComparisonOperator to use with PlatformInput. - ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` - - // The value of the platform. - // - // Value is a required field - Value *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 PlatformInput_) 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 PlatformInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PlatformInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PlatformInput_"} - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *PlatformInput_) SetComparisonOperator(v string) *PlatformInput_ { - s.ComparisonOperator = &v - return s -} - -// SetValue sets the Value field's value. -func (s *PlatformInput_) SetValue(v string) *PlatformInput_ { - s.Value = &v - return s -} - -// The structure representing Polygon Geometry based on the GeoJson spec (https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6). -type PolygonGeometryInput_ struct { - _ struct{} `type:"structure"` - - // Coordinates representing a Polygon based on the GeoJson spec (https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6). - // - // Coordinates is a required field - Coordinates [][][]*float64 `min:"1" type:"list" 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 PolygonGeometryInput_) 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 PolygonGeometryInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PolygonGeometryInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PolygonGeometryInput_"} - if s.Coordinates == nil { - invalidParams.Add(request.NewErrParamRequired("Coordinates")) - } - if s.Coordinates != nil && len(s.Coordinates) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Coordinates", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCoordinates sets the Coordinates field's value. -func (s *PolygonGeometryInput_) SetCoordinates(v [][][]*float64) *PolygonGeometryInput_ { - s.Coordinates = v - return s -} - -// Properties associated with the Item. -type Properties struct { - _ struct{} `type:"structure"` - - // Estimate of cloud cover. - EoCloudCover *float64 `type:"float"` - - // Land cloud cover for Landsat Data Collection. - LandsatCloudCoverLand *float64 `type:"float"` - - // Platform property. Platform refers to the unique name of the specific platform - // the instrument is attached to. For satellites it is the name of the satellite, - // eg. landsat-8 (Landsat-8), sentinel-2a. - Platform *string `type:"string"` - - // The angle from the sensor between nadir (straight down) and the scene center. - // Measured in degrees (0-90). - ViewOffNadir *float64 `type:"float"` - - // The sun azimuth angle. From the scene center point on the ground, this is - // the angle between truth north and the sun. Measured clockwise in degrees - // (0-360). - ViewSunAzimuth *float64 `type:"float"` - - // The sun elevation angle. The angle from the tangent of the scene center point - // to the sun. Measured from the horizon in degrees (-90-90). Negative values - // indicate the sun is below the horizon, e.g. sun elevation of -10° means - // the data was captured during nautical twilight (https://www.timeanddate.com/astronomy/different-types-twilight.html). - ViewSunElevation *float64 `type:"float"` -} - -// 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 Properties) 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 Properties) GoString() string { - return s.String() -} - -// SetEoCloudCover sets the EoCloudCover field's value. -func (s *Properties) SetEoCloudCover(v float64) *Properties { - s.EoCloudCover = &v - return s -} - -// SetLandsatCloudCoverLand sets the LandsatCloudCoverLand field's value. -func (s *Properties) SetLandsatCloudCoverLand(v float64) *Properties { - s.LandsatCloudCoverLand = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *Properties) SetPlatform(v string) *Properties { - s.Platform = &v - return s -} - -// SetViewOffNadir sets the ViewOffNadir field's value. -func (s *Properties) SetViewOffNadir(v float64) *Properties { - s.ViewOffNadir = &v - return s -} - -// SetViewSunAzimuth sets the ViewSunAzimuth field's value. -func (s *Properties) SetViewSunAzimuth(v float64) *Properties { - s.ViewSunAzimuth = &v - return s -} - -// SetViewSunElevation sets the ViewSunElevation field's value. -func (s *Properties) SetViewSunElevation(v float64) *Properties { - s.ViewSunElevation = &v - return s -} - -// Represents a single searchable property to search on. -type Property struct { - _ struct{} `type:"structure"` - - // The structure representing EoCloudCover property filter containing a lower - // bound and upper bound. - EoCloudCover *EoCloudCoverInput_ `type:"structure"` - - // The structure representing Land Cloud Cover property filter for Landsat collection - // containing a lower bound and upper bound. - LandsatCloudCoverLand *LandsatCloudCoverLandInput_ `type:"structure"` - - // The structure representing Platform property filter consisting of value and - // comparison operator. - Platform *PlatformInput_ `type:"structure"` - - // The structure representing ViewOffNadir property filter containing a lower - // bound and upper bound. - ViewOffNadir *ViewOffNadirInput_ `type:"structure"` - - // The structure representing ViewSunAzimuth property filter containing a lower - // bound and upper bound. - ViewSunAzimuth *ViewSunAzimuthInput_ `type:"structure"` - - // The structure representing ViewSunElevation property filter containing a - // lower bound and upper bound. - ViewSunElevation *ViewSunElevationInput_ `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 Property) 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 Property) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Property) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Property"} - if s.EoCloudCover != nil { - if err := s.EoCloudCover.Validate(); err != nil { - invalidParams.AddNested("EoCloudCover", err.(request.ErrInvalidParams)) - } - } - if s.LandsatCloudCoverLand != nil { - if err := s.LandsatCloudCoverLand.Validate(); err != nil { - invalidParams.AddNested("LandsatCloudCoverLand", err.(request.ErrInvalidParams)) - } - } - if s.Platform != nil { - if err := s.Platform.Validate(); err != nil { - invalidParams.AddNested("Platform", err.(request.ErrInvalidParams)) - } - } - if s.ViewOffNadir != nil { - if err := s.ViewOffNadir.Validate(); err != nil { - invalidParams.AddNested("ViewOffNadir", err.(request.ErrInvalidParams)) - } - } - if s.ViewSunAzimuth != nil { - if err := s.ViewSunAzimuth.Validate(); err != nil { - invalidParams.AddNested("ViewSunAzimuth", err.(request.ErrInvalidParams)) - } - } - if s.ViewSunElevation != nil { - if err := s.ViewSunElevation.Validate(); err != nil { - invalidParams.AddNested("ViewSunElevation", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEoCloudCover sets the EoCloudCover field's value. -func (s *Property) SetEoCloudCover(v *EoCloudCoverInput_) *Property { - s.EoCloudCover = v - return s -} - -// SetLandsatCloudCoverLand sets the LandsatCloudCoverLand field's value. -func (s *Property) SetLandsatCloudCoverLand(v *LandsatCloudCoverLandInput_) *Property { - s.LandsatCloudCoverLand = v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *Property) SetPlatform(v *PlatformInput_) *Property { - s.Platform = v - return s -} - -// SetViewOffNadir sets the ViewOffNadir field's value. -func (s *Property) SetViewOffNadir(v *ViewOffNadirInput_) *Property { - s.ViewOffNadir = v - return s -} - -// SetViewSunAzimuth sets the ViewSunAzimuth field's value. -func (s *Property) SetViewSunAzimuth(v *ViewSunAzimuthInput_) *Property { - s.ViewSunAzimuth = v - return s -} - -// SetViewSunElevation sets the ViewSunElevation field's value. -func (s *Property) SetViewSunElevation(v *ViewSunElevationInput_) *Property { - s.ViewSunElevation = v - return s -} - -// The structure representing a single PropertyFilter. -type PropertyFilter struct { - _ struct{} `type:"structure"` - - // Represents a single property to match with when searching a raster data collection. - // - // Property is a required field - Property *Property `type:"structure" 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 PropertyFilter) 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 PropertyFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PropertyFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PropertyFilter"} - if s.Property == nil { - invalidParams.Add(request.NewErrParamRequired("Property")) - } - if s.Property != nil { - if err := s.Property.Validate(); err != nil { - invalidParams.AddNested("Property", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetProperty sets the Property field's value. -func (s *PropertyFilter) SetProperty(v *Property) *PropertyFilter { - s.Property = v - return s -} - -// A list of PropertyFilter objects. -type PropertyFilters struct { - _ struct{} `type:"structure"` - - // The Logical Operator used to combine the Property Filters. - LogicalOperator *string `type:"string" enum:"LogicalOperator"` - - // A list of Property Filters. - Properties []*PropertyFilter `type:"list"` -} - -// 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 PropertyFilters) 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 PropertyFilters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PropertyFilters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PropertyFilters"} - if s.Properties != nil { - for i, v := range s.Properties { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Properties", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLogicalOperator sets the LogicalOperator field's value. -func (s *PropertyFilters) SetLogicalOperator(v string) *PropertyFilters { - s.LogicalOperator = &v - return s -} - -// SetProperties sets the Properties field's value. -func (s *PropertyFilters) SetProperties(v []*PropertyFilter) *PropertyFilters { - s.Properties = v - return s -} - -// Response object containing details for a specific RasterDataCollection. -type RasterDataCollectionMetadata struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the raster data collection. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // A description of the raster data collection. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // The description URL of the raster data collection. - DescriptionPageUrl *string `type:"string"` - - // The name of the raster data collection. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The list of filters supported by the raster data collection. - // - // SupportedFilters is a required field - SupportedFilters []*Filter `type:"list" required:"true"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` - - // The type of raster data collection. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"DataCollectionType"` -} - -// 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 RasterDataCollectionMetadata) 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 RasterDataCollectionMetadata) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *RasterDataCollectionMetadata) SetArn(v string) *RasterDataCollectionMetadata { - s.Arn = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *RasterDataCollectionMetadata) SetDescription(v string) *RasterDataCollectionMetadata { - s.Description = &v - return s -} - -// SetDescriptionPageUrl sets the DescriptionPageUrl field's value. -func (s *RasterDataCollectionMetadata) SetDescriptionPageUrl(v string) *RasterDataCollectionMetadata { - s.DescriptionPageUrl = &v - return s -} - -// SetName sets the Name field's value. -func (s *RasterDataCollectionMetadata) SetName(v string) *RasterDataCollectionMetadata { - s.Name = &v - return s -} - -// SetSupportedFilters sets the SupportedFilters field's value. -func (s *RasterDataCollectionMetadata) SetSupportedFilters(v []*Filter) *RasterDataCollectionMetadata { - s.SupportedFilters = v - return s -} - -// SetTags sets the Tags field's value. -func (s *RasterDataCollectionMetadata) SetTags(v map[string]*string) *RasterDataCollectionMetadata { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *RasterDataCollectionMetadata) SetType(v string) *RasterDataCollectionMetadata { - s.Type = &v - return s -} - -// The input structure for Raster Data Collection Query containing the Area -// of Interest, TimeRange Filters, and Property Filters. -type RasterDataCollectionQueryInput_ struct { - _ struct{} `type:"structure"` - - // The area of interest being queried for the raster data collection. - AreaOfInterest *AreaOfInterest `type:"structure"` - - // The list of Property filters used in the Raster Data Collection Query. - PropertyFilters *PropertyFilters `type:"structure"` - - // The Amazon Resource Name (ARN) of the raster data collection. - // - // RasterDataCollectionArn is a required field - RasterDataCollectionArn *string `type:"string" required:"true"` - - // The TimeRange Filter used in the RasterDataCollection Query. - // - // TimeRangeFilter is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RasterDataCollectionQueryInput_'s - // String and GoString methods. - // - // TimeRangeFilter is a required field - TimeRangeFilter *TimeRangeFilterInput_ `type:"structure" required:"true" sensitive:"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 RasterDataCollectionQueryInput_) 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 RasterDataCollectionQueryInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RasterDataCollectionQueryInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RasterDataCollectionQueryInput_"} - if s.RasterDataCollectionArn == nil { - invalidParams.Add(request.NewErrParamRequired("RasterDataCollectionArn")) - } - if s.TimeRangeFilter == nil { - invalidParams.Add(request.NewErrParamRequired("TimeRangeFilter")) - } - if s.AreaOfInterest != nil { - if err := s.AreaOfInterest.Validate(); err != nil { - invalidParams.AddNested("AreaOfInterest", err.(request.ErrInvalidParams)) - } - } - if s.PropertyFilters != nil { - if err := s.PropertyFilters.Validate(); err != nil { - invalidParams.AddNested("PropertyFilters", err.(request.ErrInvalidParams)) - } - } - if s.TimeRangeFilter != nil { - if err := s.TimeRangeFilter.Validate(); err != nil { - invalidParams.AddNested("TimeRangeFilter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAreaOfInterest sets the AreaOfInterest field's value. -func (s *RasterDataCollectionQueryInput_) SetAreaOfInterest(v *AreaOfInterest) *RasterDataCollectionQueryInput_ { - s.AreaOfInterest = v - return s -} - -// SetPropertyFilters sets the PropertyFilters field's value. -func (s *RasterDataCollectionQueryInput_) SetPropertyFilters(v *PropertyFilters) *RasterDataCollectionQueryInput_ { - s.PropertyFilters = v - return s -} - -// SetRasterDataCollectionArn sets the RasterDataCollectionArn field's value. -func (s *RasterDataCollectionQueryInput_) SetRasterDataCollectionArn(v string) *RasterDataCollectionQueryInput_ { - s.RasterDataCollectionArn = &v - return s -} - -// SetTimeRangeFilter sets the TimeRangeFilter field's value. -func (s *RasterDataCollectionQueryInput_) SetTimeRangeFilter(v *TimeRangeFilterInput_) *RasterDataCollectionQueryInput_ { - s.TimeRangeFilter = v - return s -} - -// The output structure contains the Raster Data Collection Query input along -// with some additional metadata. -type RasterDataCollectionQueryOutput_ struct { - _ struct{} `type:"structure"` - - // The Area of Interest used in the search. - AreaOfInterest *AreaOfInterest `type:"structure"` - - // Property filters used in the search. - PropertyFilters *PropertyFilters `type:"structure"` - - // The ARN of the Raster Data Collection against which the search is done. - // - // RasterDataCollectionArn is a required field - RasterDataCollectionArn *string `type:"string" required:"true"` - - // The name of the raster data collection. - // - // RasterDataCollectionName is a required field - RasterDataCollectionName *string `type:"string" required:"true"` - - // The TimeRange filter used in the search. - // - // TimeRangeFilter is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RasterDataCollectionQueryOutput_'s - // String and GoString methods. - // - // TimeRangeFilter is a required field - TimeRangeFilter *TimeRangeFilterOutput_ `type:"structure" required:"true" sensitive:"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 RasterDataCollectionQueryOutput_) 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 RasterDataCollectionQueryOutput_) GoString() string { - return s.String() -} - -// SetAreaOfInterest sets the AreaOfInterest field's value. -func (s *RasterDataCollectionQueryOutput_) SetAreaOfInterest(v *AreaOfInterest) *RasterDataCollectionQueryOutput_ { - s.AreaOfInterest = v - return s -} - -// SetPropertyFilters sets the PropertyFilters field's value. -func (s *RasterDataCollectionQueryOutput_) SetPropertyFilters(v *PropertyFilters) *RasterDataCollectionQueryOutput_ { - s.PropertyFilters = v - return s -} - -// SetRasterDataCollectionArn sets the RasterDataCollectionArn field's value. -func (s *RasterDataCollectionQueryOutput_) SetRasterDataCollectionArn(v string) *RasterDataCollectionQueryOutput_ { - s.RasterDataCollectionArn = &v - return s -} - -// SetRasterDataCollectionName sets the RasterDataCollectionName field's value. -func (s *RasterDataCollectionQueryOutput_) SetRasterDataCollectionName(v string) *RasterDataCollectionQueryOutput_ { - s.RasterDataCollectionName = &v - return s -} - -// SetTimeRangeFilter sets the TimeRangeFilter field's value. -func (s *RasterDataCollectionQueryOutput_) SetTimeRangeFilter(v *TimeRangeFilterOutput_) *RasterDataCollectionQueryOutput_ { - s.TimeRangeFilter = v - return s -} - -// This is a RasterDataCollectionQueryInput containing AreaOfInterest, Time -// Range filter and Property filters. -type RasterDataCollectionQueryWithBandFilterInput_ struct { - _ struct{} `type:"structure"` - - // The Area of interest to be used in the search query. - AreaOfInterest *AreaOfInterest `type:"structure"` - - // The list of Bands to be displayed in the result for each item. - BandFilter []*string `min:"1" type:"list"` - - // The Property Filters used in the search query. - PropertyFilters *PropertyFilters `type:"structure"` - - // The TimeRange Filter used in the search query. - // - // TimeRangeFilter is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by RasterDataCollectionQueryWithBandFilterInput_'s - // String and GoString methods. - // - // TimeRangeFilter is a required field - TimeRangeFilter *TimeRangeFilterInput_ `type:"structure" required:"true" sensitive:"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 RasterDataCollectionQueryWithBandFilterInput_) 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 RasterDataCollectionQueryWithBandFilterInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RasterDataCollectionQueryWithBandFilterInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RasterDataCollectionQueryWithBandFilterInput_"} - if s.BandFilter != nil && len(s.BandFilter) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BandFilter", 1)) - } - if s.TimeRangeFilter == nil { - invalidParams.Add(request.NewErrParamRequired("TimeRangeFilter")) - } - if s.AreaOfInterest != nil { - if err := s.AreaOfInterest.Validate(); err != nil { - invalidParams.AddNested("AreaOfInterest", err.(request.ErrInvalidParams)) - } - } - if s.PropertyFilters != nil { - if err := s.PropertyFilters.Validate(); err != nil { - invalidParams.AddNested("PropertyFilters", err.(request.ErrInvalidParams)) - } - } - if s.TimeRangeFilter != nil { - if err := s.TimeRangeFilter.Validate(); err != nil { - invalidParams.AddNested("TimeRangeFilter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAreaOfInterest sets the AreaOfInterest field's value. -func (s *RasterDataCollectionQueryWithBandFilterInput_) SetAreaOfInterest(v *AreaOfInterest) *RasterDataCollectionQueryWithBandFilterInput_ { - s.AreaOfInterest = v - return s -} - -// SetBandFilter sets the BandFilter field's value. -func (s *RasterDataCollectionQueryWithBandFilterInput_) SetBandFilter(v []*string) *RasterDataCollectionQueryWithBandFilterInput_ { - s.BandFilter = v - return s -} - -// SetPropertyFilters sets the PropertyFilters field's value. -func (s *RasterDataCollectionQueryWithBandFilterInput_) SetPropertyFilters(v *PropertyFilters) *RasterDataCollectionQueryWithBandFilterInput_ { - s.PropertyFilters = v - return s -} - -// SetTimeRangeFilter sets the TimeRangeFilter field's value. -func (s *RasterDataCollectionQueryWithBandFilterInput_) SetTimeRangeFilter(v *TimeRangeFilterInput_) *RasterDataCollectionQueryWithBandFilterInput_ { - s.TimeRangeFilter = v - return s -} - -// The structure representing input for resampling operation. -type ResamplingConfigInput_ struct { - _ struct{} `type:"structure"` - - // The name of the algorithm used for resampling. - AlgorithmName *string `type:"string" enum:"AlgorithmNameResampling"` - - // The structure representing output resolution (in target georeferenced units) - // of the result of resampling operation. - // - // OutputResolution is a required field - OutputResolution *OutputResolutionResamplingInput_ `type:"structure" required:"true"` - - // Bands used in the operation. If no target bands are specified, it uses all - // bands available in the input. - TargetBands []*string `min:"1" type:"list"` -} - -// 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 ResamplingConfigInput_) 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 ResamplingConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ResamplingConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResamplingConfigInput_"} - if s.OutputResolution == nil { - invalidParams.Add(request.NewErrParamRequired("OutputResolution")) - } - if s.TargetBands != nil && len(s.TargetBands) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBands", 1)) - } - if s.OutputResolution != nil { - if err := s.OutputResolution.Validate(); err != nil { - invalidParams.AddNested("OutputResolution", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *ResamplingConfigInput_) SetAlgorithmName(v string) *ResamplingConfigInput_ { - s.AlgorithmName = &v - return s -} - -// SetOutputResolution sets the OutputResolution field's value. -func (s *ResamplingConfigInput_) SetOutputResolution(v *OutputResolutionResamplingInput_) *ResamplingConfigInput_ { - s.OutputResolution = v - return s -} - -// SetTargetBands sets the TargetBands field's value. -func (s *ResamplingConfigInput_) SetTargetBands(v []*string) *ResamplingConfigInput_ { - s.TargetBands = v - return s -} - -// The request references a resource which does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // Identifier of the resource that was not found. - ResourceId *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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input structure for Reverse Geocoding operation type. -type ReverseGeocodingConfig struct { - _ struct{} `type:"structure"` - - // The field name for the data that describes x-axis coordinate, eg. longitude - // of a point. - // - // XAttributeName is a required field - XAttributeName *string `type:"string" required:"true"` - - // The field name for the data that describes y-axis coordinate, eg. latitude - // of a point. - // - // YAttributeName is a required field - YAttributeName *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 ReverseGeocodingConfig) 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 ReverseGeocodingConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReverseGeocodingConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReverseGeocodingConfig"} - if s.XAttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("XAttributeName")) - } - if s.YAttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("YAttributeName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetXAttributeName sets the XAttributeName field's value. -func (s *ReverseGeocodingConfig) SetXAttributeName(v string) *ReverseGeocodingConfig { - s.XAttributeName = &v - return s -} - -// SetYAttributeName sets the YAttributeName field's value. -func (s *ReverseGeocodingConfig) SetYAttributeName(v string) *ReverseGeocodingConfig { - s.YAttributeName = &v - return s -} - -type SearchRasterDataCollectionInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the raster data collection. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // If the previous response was truncated, you receive this token. Use it in - // your next request to receive the next set of results. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchRasterDataCollectionInput's - // String and GoString methods. - NextToken *string `type:"string" sensitive:"true"` - - // RasterDataCollectionQuery consisting of AreaOfInterest(AOI) (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_geospatial_AreaOfInterest.html), - // PropertyFilters (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_geospatial_PropertyFilter.html) - // and TimeRangeFilterInput (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_geospatial_TimeRangeFilterInput.html) - // used in SearchRasterDataCollection (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_geospatial_SearchRasterDataCollection.html). - // - // RasterDataCollectionQuery is a required field - RasterDataCollectionQuery *RasterDataCollectionQueryWithBandFilterInput_ `type:"structure" 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 SearchRasterDataCollectionInput) 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 SearchRasterDataCollectionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SearchRasterDataCollectionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchRasterDataCollectionInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.RasterDataCollectionQuery == nil { - invalidParams.Add(request.NewErrParamRequired("RasterDataCollectionQuery")) - } - if s.RasterDataCollectionQuery != nil { - if err := s.RasterDataCollectionQuery.Validate(); err != nil { - invalidParams.AddNested("RasterDataCollectionQuery", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *SearchRasterDataCollectionInput) SetArn(v string) *SearchRasterDataCollectionInput { - s.Arn = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchRasterDataCollectionInput) SetNextToken(v string) *SearchRasterDataCollectionInput { - s.NextToken = &v - return s -} - -// SetRasterDataCollectionQuery sets the RasterDataCollectionQuery field's value. -func (s *SearchRasterDataCollectionInput) SetRasterDataCollectionQuery(v *RasterDataCollectionQueryWithBandFilterInput_) *SearchRasterDataCollectionInput { - s.RasterDataCollectionQuery = v - return s -} - -type SearchRasterDataCollectionOutput struct { - _ struct{} `type:"structure"` - - // Approximate number of results in the response. - // - // ApproximateResultCount is a required field - ApproximateResultCount *int64 `type:"integer" required:"true"` - - // List of items matching the Raster DataCollectionQuery. - Items []*ItemSource `type:"list"` - - // If the previous response was truncated, you receive this token. Use it in - // your next request to receive the next set of results. - // - // NextToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SearchRasterDataCollectionOutput's - // String and GoString methods. - NextToken *string `type:"string" sensitive:"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 SearchRasterDataCollectionOutput) 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 SearchRasterDataCollectionOutput) GoString() string { - return s.String() -} - -// SetApproximateResultCount sets the ApproximateResultCount field's value. -func (s *SearchRasterDataCollectionOutput) SetApproximateResultCount(v int64) *SearchRasterDataCollectionOutput { - s.ApproximateResultCount = &v - return s -} - -// SetItems sets the Items field's value. -func (s *SearchRasterDataCollectionOutput) SetItems(v []*ItemSource) *SearchRasterDataCollectionOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *SearchRasterDataCollectionOutput) SetNextToken(v string) *SearchRasterDataCollectionOutput { - s.NextToken = &v - return s -} - -// You have exceeded the service quota. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - // Identifier of the resource affected. - ResourceId *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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input structure for Stacking Operation. -type StackConfigInput_ struct { - _ struct{} `type:"structure"` - - // The structure representing output resolution (in target georeferenced units) - // of the result of stacking operation. - OutputResolution *OutputResolutionStackInput_ `type:"structure"` - - // A list of bands to be stacked in the specified order. When the parameter - // is not provided, all the available bands in the data collection are stacked - // in the alphabetical order of their asset names. - TargetBands []*string `min:"1" type:"list"` -} - -// 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 StackConfigInput_) 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 StackConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StackConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StackConfigInput_"} - if s.TargetBands != nil && len(s.TargetBands) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBands", 1)) - } - if s.OutputResolution != nil { - if err := s.OutputResolution.Validate(); err != nil { - invalidParams.AddNested("OutputResolution", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOutputResolution sets the OutputResolution field's value. -func (s *StackConfigInput_) SetOutputResolution(v *OutputResolutionStackInput_) *StackConfigInput_ { - s.OutputResolution = v - return s -} - -// SetTargetBands sets the TargetBands field's value. -func (s *StackConfigInput_) SetTargetBands(v []*string) *StackConfigInput_ { - s.TargetBands = v - return s -} - -type StartEarthObservationJobInput struct { - _ struct{} `type:"structure"` - - // A unique token that guarantees that the call to this API is idempotent. - ClientToken *string `min:"36" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // job. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // Input configuration information for the Earth Observation job. - // - // InputConfig is a required field - InputConfig *InputConfigInput_ `type:"structure" required:"true"` - - // An object containing information about the job configuration. - // - // JobConfig is a required field - JobConfig *JobConfigInput_ `type:"structure" required:"true"` - - // The Key Management Service key ID for server-side encryption. - KmsKeyId *string `type:"string"` - - // The name of the Earth Observation job. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` -} - -// 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 StartEarthObservationJobInput) 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 StartEarthObservationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartEarthObservationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartEarthObservationJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 36)) - } - if s.ExecutionRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn")) - } - if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 20)) - } - if s.InputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputConfig")) - } - if s.JobConfig == nil { - invalidParams.Add(request.NewErrParamRequired("JobConfig")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.InputConfig != nil { - if err := s.InputConfig.Validate(); err != nil { - invalidParams.AddNested("InputConfig", err.(request.ErrInvalidParams)) - } - } - if s.JobConfig != nil { - if err := s.JobConfig.Validate(); err != nil { - invalidParams.AddNested("JobConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartEarthObservationJobInput) SetClientToken(v string) *StartEarthObservationJobInput { - s.ClientToken = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *StartEarthObservationJobInput) SetExecutionRoleArn(v string) *StartEarthObservationJobInput { - s.ExecutionRoleArn = &v - return s -} - -// SetInputConfig sets the InputConfig field's value. -func (s *StartEarthObservationJobInput) SetInputConfig(v *InputConfigInput_) *StartEarthObservationJobInput { - s.InputConfig = v - return s -} - -// SetJobConfig sets the JobConfig field's value. -func (s *StartEarthObservationJobInput) SetJobConfig(v *JobConfigInput_) *StartEarthObservationJobInput { - s.JobConfig = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *StartEarthObservationJobInput) SetKmsKeyId(v string) *StartEarthObservationJobInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartEarthObservationJobInput) SetName(v string) *StartEarthObservationJobInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartEarthObservationJobInput) SetTags(v map[string]*string) *StartEarthObservationJobInput { - s.Tags = v - return s -} - -type StartEarthObservationJobOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Earth Observation job. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The creation time. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The duration of the session, in seconds. - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `type:"integer" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // job. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // Input configuration information for the Earth Observation job. - InputConfig *InputConfigOutput_ `type:"structure"` - - // An object containing information about the job configuration. - // - // JobConfig is a required field - JobConfig *JobConfigInput_ `type:"structure" required:"true"` - - // The Key Management Service key ID for server-side encryption. - KmsKeyId *string `type:"string"` - - // The name of the Earth Observation job. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The status of the Earth Observation job. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"EarthObservationJobStatus"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` -} - -// 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 StartEarthObservationJobOutput) 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 StartEarthObservationJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartEarthObservationJobOutput) SetArn(v string) *StartEarthObservationJobOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StartEarthObservationJobOutput) SetCreationTime(v time.Time) *StartEarthObservationJobOutput { - s.CreationTime = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *StartEarthObservationJobOutput) SetDurationInSeconds(v int64) *StartEarthObservationJobOutput { - s.DurationInSeconds = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *StartEarthObservationJobOutput) SetExecutionRoleArn(v string) *StartEarthObservationJobOutput { - s.ExecutionRoleArn = &v - return s -} - -// SetInputConfig sets the InputConfig field's value. -func (s *StartEarthObservationJobOutput) SetInputConfig(v *InputConfigOutput_) *StartEarthObservationJobOutput { - s.InputConfig = v - return s -} - -// SetJobConfig sets the JobConfig field's value. -func (s *StartEarthObservationJobOutput) SetJobConfig(v *JobConfigInput_) *StartEarthObservationJobOutput { - s.JobConfig = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *StartEarthObservationJobOutput) SetKmsKeyId(v string) *StartEarthObservationJobOutput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartEarthObservationJobOutput) SetName(v string) *StartEarthObservationJobOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartEarthObservationJobOutput) SetStatus(v string) *StartEarthObservationJobOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartEarthObservationJobOutput) SetTags(v map[string]*string) *StartEarthObservationJobOutput { - s.Tags = v - return s -} - -type StartVectorEnrichmentJobInput struct { - _ struct{} `type:"structure"` - - // A unique token that guarantees that the call to this API is idempotent. - ClientToken *string `min:"36" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // job. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // Input configuration information for the Vector Enrichment job. - // - // InputConfig is a required field - InputConfig *VectorEnrichmentJobInputConfig `type:"structure" required:"true"` - - // An object containing information about the job configuration. - // - // JobConfig is a required field - JobConfig *VectorEnrichmentJobConfig `type:"structure" required:"true"` - - // The Key Management Service key ID for server-side encryption. - KmsKeyId *string `type:"string"` - - // The name of the Vector Enrichment job. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` -} - -// 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 StartVectorEnrichmentJobInput) 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 StartVectorEnrichmentJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartVectorEnrichmentJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartVectorEnrichmentJobInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 36)) - } - if s.ExecutionRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn")) - } - if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 20)) - } - if s.InputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputConfig")) - } - if s.JobConfig == nil { - invalidParams.Add(request.NewErrParamRequired("JobConfig")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.InputConfig != nil { - if err := s.InputConfig.Validate(); err != nil { - invalidParams.AddNested("InputConfig", err.(request.ErrInvalidParams)) - } - } - if s.JobConfig != nil { - if err := s.JobConfig.Validate(); err != nil { - invalidParams.AddNested("JobConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartVectorEnrichmentJobInput) SetClientToken(v string) *StartVectorEnrichmentJobInput { - s.ClientToken = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *StartVectorEnrichmentJobInput) SetExecutionRoleArn(v string) *StartVectorEnrichmentJobInput { - s.ExecutionRoleArn = &v - return s -} - -// SetInputConfig sets the InputConfig field's value. -func (s *StartVectorEnrichmentJobInput) SetInputConfig(v *VectorEnrichmentJobInputConfig) *StartVectorEnrichmentJobInput { - s.InputConfig = v - return s -} - -// SetJobConfig sets the JobConfig field's value. -func (s *StartVectorEnrichmentJobInput) SetJobConfig(v *VectorEnrichmentJobConfig) *StartVectorEnrichmentJobInput { - s.JobConfig = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *StartVectorEnrichmentJobInput) SetKmsKeyId(v string) *StartVectorEnrichmentJobInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartVectorEnrichmentJobInput) SetName(v string) *StartVectorEnrichmentJobInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartVectorEnrichmentJobInput) SetTags(v map[string]*string) *StartVectorEnrichmentJobInput { - s.Tags = v - return s -} - -type StartVectorEnrichmentJobOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Vector Enrichment job. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The creation time. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The duration of the Vector Enrichment job, in seconds. - // - // DurationInSeconds is a required field - DurationInSeconds *int64 `type:"integer" required:"true"` - - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // job. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` - - // Input configuration information for starting the Vector Enrichment job. - // - // InputConfig is a required field - InputConfig *VectorEnrichmentJobInputConfig `type:"structure" required:"true"` - - // An object containing information about the job configuration. - // - // JobConfig is a required field - JobConfig *VectorEnrichmentJobConfig `type:"structure" required:"true"` - - // The Key Management Service key ID for server-side encryption. - KmsKeyId *string `type:"string"` - - // The name of the Vector Enrichment job. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // The status of the Vector Enrichment job being started. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"VectorEnrichmentJobStatus"` - - // Each tag consists of a key and a value. - Tags map[string]*string `type:"map"` - - // The type of the Vector Enrichment job. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"VectorEnrichmentJobType"` -} - -// 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 StartVectorEnrichmentJobOutput) 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 StartVectorEnrichmentJobOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartVectorEnrichmentJobOutput) SetArn(v string) *StartVectorEnrichmentJobOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StartVectorEnrichmentJobOutput) SetCreationTime(v time.Time) *StartVectorEnrichmentJobOutput { - s.CreationTime = &v - return s -} - -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *StartVectorEnrichmentJobOutput) SetDurationInSeconds(v int64) *StartVectorEnrichmentJobOutput { - s.DurationInSeconds = &v - return s -} - -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *StartVectorEnrichmentJobOutput) SetExecutionRoleArn(v string) *StartVectorEnrichmentJobOutput { - s.ExecutionRoleArn = &v - return s -} - -// SetInputConfig sets the InputConfig field's value. -func (s *StartVectorEnrichmentJobOutput) SetInputConfig(v *VectorEnrichmentJobInputConfig) *StartVectorEnrichmentJobOutput { - s.InputConfig = v - return s -} - -// SetJobConfig sets the JobConfig field's value. -func (s *StartVectorEnrichmentJobOutput) SetJobConfig(v *VectorEnrichmentJobConfig) *StartVectorEnrichmentJobOutput { - s.JobConfig = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *StartVectorEnrichmentJobOutput) SetKmsKeyId(v string) *StartVectorEnrichmentJobOutput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartVectorEnrichmentJobOutput) SetName(v string) *StartVectorEnrichmentJobOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *StartVectorEnrichmentJobOutput) SetStatus(v string) *StartVectorEnrichmentJobOutput { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartVectorEnrichmentJobOutput) SetTags(v map[string]*string) *StartVectorEnrichmentJobOutput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *StartVectorEnrichmentJobOutput) SetType(v string) *StartVectorEnrichmentJobOutput { - s.Type = &v - return s -} - -type StopEarthObservationJobInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Earth Observation job being stopped. - // - // Arn is a required field - Arn *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 StopEarthObservationJobInput) 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 StopEarthObservationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopEarthObservationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopEarthObservationJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *StopEarthObservationJobInput) SetArn(v string) *StopEarthObservationJobInput { - s.Arn = &v - return s -} - -type StopEarthObservationJobOutput 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 StopEarthObservationJobOutput) 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 StopEarthObservationJobOutput) GoString() string { - return s.String() -} - -type StopVectorEnrichmentJobInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Vector Enrichment job. - // - // Arn is a required field - Arn *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 StopVectorEnrichmentJobInput) 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 StopVectorEnrichmentJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopVectorEnrichmentJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopVectorEnrichmentJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *StopVectorEnrichmentJobInput) SetArn(v string) *StopVectorEnrichmentJobInput { - s.Arn = &v - return s -} - -type StopVectorEnrichmentJobOutput 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 StopVectorEnrichmentJobOutput) 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 StopVectorEnrichmentJobOutput) GoString() string { - return s.String() -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource you want to tag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"1" type:"string" required:"true"` - - // Each tag consists of a key and a value. - // - // Tags is a required field - Tags map[string]*string `type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The structure representing the configuration for Temporal Statistics operation. -type TemporalStatisticsConfigInput_ struct { - _ struct{} `type:"structure"` - - // The input for the temporal statistics grouping by time frequency option. - GroupBy *string `type:"string" enum:"GroupBy"` - - // The list of the statistics method options. - // - // Statistics is a required field - Statistics []*string `min:"1" type:"list" required:"true" enum:"TemporalStatistics"` - - // The list of target band names for the temporal statistic to calculate. - TargetBands []*string `min:"1" type:"list"` -} - -// 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 TemporalStatisticsConfigInput_) 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 TemporalStatisticsConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TemporalStatisticsConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TemporalStatisticsConfigInput_"} - if s.Statistics == nil { - invalidParams.Add(request.NewErrParamRequired("Statistics")) - } - if s.Statistics != nil && len(s.Statistics) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Statistics", 1)) - } - if s.TargetBands != nil && len(s.TargetBands) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBands", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupBy sets the GroupBy field's value. -func (s *TemporalStatisticsConfigInput_) SetGroupBy(v string) *TemporalStatisticsConfigInput_ { - s.GroupBy = &v - return s -} - -// SetStatistics sets the Statistics field's value. -func (s *TemporalStatisticsConfigInput_) SetStatistics(v []*string) *TemporalStatisticsConfigInput_ { - s.Statistics = v - return s -} - -// SetTargetBands sets the TargetBands field's value. -func (s *TemporalStatisticsConfigInput_) SetTargetBands(v []*string) *TemporalStatisticsConfigInput_ { - s.TargetBands = v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - ResourceId *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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The input for the time-range filter. -type TimeRangeFilterInput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The end time for the time-range filter. - // - // EndTime is a required field - EndTime *time.Time `type:"timestamp" required:"true"` - - // The start time for the time-range filter. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" 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 TimeRangeFilterInput_) 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 TimeRangeFilterInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TimeRangeFilterInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TimeRangeFilterInput_"} - if s.EndTime == nil { - invalidParams.Add(request.NewErrParamRequired("EndTime")) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *TimeRangeFilterInput_) SetEndTime(v time.Time) *TimeRangeFilterInput_ { - s.EndTime = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *TimeRangeFilterInput_) SetStartTime(v time.Time) *TimeRangeFilterInput_ { - s.StartTime = &v - return s -} - -// The output structure of the time range filter. -type TimeRangeFilterOutput_ struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The ending time for the time range filter. - // - // EndTime is a required field - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The starting time for the time range filter. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" 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 TimeRangeFilterOutput_) 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 TimeRangeFilterOutput_) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *TimeRangeFilterOutput_) SetEndTime(v time.Time) *TimeRangeFilterOutput_ { - s.EndTime = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *TimeRangeFilterOutput_) SetStartTime(v time.Time) *TimeRangeFilterOutput_ { - s.StartTime = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource you want to untag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"1" type:"string" required:"true"` - - // Keys of the tags you want to remove. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -// The output resolution (in target georeferenced units) of the result of the -// operation -type UserDefined struct { - _ struct{} `type:"structure"` - - // The units for output resolution of the result. - // - // Unit is a required field - Unit *string `type:"string" required:"true" enum:"Unit"` - - // The value for output resolution of the result. - // - // Value is a required field - Value *float64 `type:"float" 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 UserDefined) 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 UserDefined) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UserDefined) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UserDefined"} - if s.Unit == nil { - invalidParams.Add(request.NewErrParamRequired("Unit")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetUnit sets the Unit field's value. -func (s *UserDefined) SetUnit(v string) *UserDefined { - s.Unit = &v - return s -} - -// SetValue sets the Value field's value. -func (s *UserDefined) SetValue(v float64) *UserDefined { - s.Value = &v - return s -} - -// The input fails to satisfy the constraints specified by an Amazon Web Services -// service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - ResourceId *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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// It contains configs such as ReverseGeocodingConfig and MapMatchingConfig. -type VectorEnrichmentJobConfig struct { - _ struct{} `type:"structure"` - - // The input structure for Map Matching operation type. - MapMatchingConfig *MapMatchingConfig `type:"structure"` - - // The input structure for Reverse Geocoding operation type. - ReverseGeocodingConfig *ReverseGeocodingConfig `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 VectorEnrichmentJobConfig) 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 VectorEnrichmentJobConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VectorEnrichmentJobConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VectorEnrichmentJobConfig"} - if s.MapMatchingConfig != nil { - if err := s.MapMatchingConfig.Validate(); err != nil { - invalidParams.AddNested("MapMatchingConfig", err.(request.ErrInvalidParams)) - } - } - if s.ReverseGeocodingConfig != nil { - if err := s.ReverseGeocodingConfig.Validate(); err != nil { - invalidParams.AddNested("ReverseGeocodingConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMapMatchingConfig sets the MapMatchingConfig field's value. -func (s *VectorEnrichmentJobConfig) SetMapMatchingConfig(v *MapMatchingConfig) *VectorEnrichmentJobConfig { - s.MapMatchingConfig = v - return s -} - -// SetReverseGeocodingConfig sets the ReverseGeocodingConfig field's value. -func (s *VectorEnrichmentJobConfig) SetReverseGeocodingConfig(v *ReverseGeocodingConfig) *VectorEnrichmentJobConfig { - s.ReverseGeocodingConfig = v - return s -} - -// The input structure for the data source that represents the storage type -// of the input data objects. -type VectorEnrichmentJobDataSourceConfigInput_ struct { - _ struct{} `type:"structure"` - - // The input structure for the Amazon S3 data that represents the Amazon S3 - // location of the input data objects. - S3Data *VectorEnrichmentJobS3Data `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 VectorEnrichmentJobDataSourceConfigInput_) 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 VectorEnrichmentJobDataSourceConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VectorEnrichmentJobDataSourceConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VectorEnrichmentJobDataSourceConfigInput_"} - if s.S3Data != nil { - if err := s.S3Data.Validate(); err != nil { - invalidParams.AddNested("S3Data", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Data sets the S3Data field's value. -func (s *VectorEnrichmentJobDataSourceConfigInput_) SetS3Data(v *VectorEnrichmentJobS3Data) *VectorEnrichmentJobDataSourceConfigInput_ { - s.S3Data = v - return s -} - -// VectorEnrichmentJob error details in response from GetVectorEnrichmentJob. -type VectorEnrichmentJobErrorDetails struct { - _ struct{} `type:"structure"` - - // A message that you define and then is processed and rendered by the Vector - // Enrichment job when the error occurs. - ErrorMessage *string `type:"string"` - - // The type of error generated during the Vector Enrichment job. - ErrorType *string `type:"string" enum:"VectorEnrichmentJobErrorType"` -} - -// 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 VectorEnrichmentJobErrorDetails) 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 VectorEnrichmentJobErrorDetails) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *VectorEnrichmentJobErrorDetails) SetErrorMessage(v string) *VectorEnrichmentJobErrorDetails { - s.ErrorMessage = &v - return s -} - -// SetErrorType sets the ErrorType field's value. -func (s *VectorEnrichmentJobErrorDetails) SetErrorType(v string) *VectorEnrichmentJobErrorDetails { - s.ErrorType = &v - return s -} - -// VectorEnrichmentJob export error details in response from GetVectorEnrichmentJob. -type VectorEnrichmentJobExportErrorDetails struct { - _ struct{} `type:"structure"` - - // The message providing details about the errors generated during the Vector - // Enrichment job. - Message *string `type:"string"` - - // The output error details for an Export operation on a Vector Enrichment job. - Type *string `type:"string" enum:"VectorEnrichmentJobExportErrorType"` -} - -// 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 VectorEnrichmentJobExportErrorDetails) 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 VectorEnrichmentJobExportErrorDetails) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *VectorEnrichmentJobExportErrorDetails) SetMessage(v string) *VectorEnrichmentJobExportErrorDetails { - s.Message = &v - return s -} - -// SetType sets the Type field's value. -func (s *VectorEnrichmentJobExportErrorDetails) SetType(v string) *VectorEnrichmentJobExportErrorDetails { - s.Type = &v - return s -} - -// The input structure for the InputConfig in a VectorEnrichmentJob. -type VectorEnrichmentJobInputConfig struct { - _ struct{} `type:"structure"` - - // The input structure for the data source that represents the storage type - // of the input data objects. - // - // DataSourceConfig is a required field - DataSourceConfig *VectorEnrichmentJobDataSourceConfigInput_ `type:"structure" required:"true"` - - // The input structure that defines the data source file type. - // - // DocumentType is a required field - DocumentType *string `type:"string" required:"true" enum:"VectorEnrichmentJobDocumentType"` -} - -// 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 VectorEnrichmentJobInputConfig) 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 VectorEnrichmentJobInputConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VectorEnrichmentJobInputConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VectorEnrichmentJobInputConfig"} - if s.DataSourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("DataSourceConfig")) - } - if s.DocumentType == nil { - invalidParams.Add(request.NewErrParamRequired("DocumentType")) - } - if s.DataSourceConfig != nil { - if err := s.DataSourceConfig.Validate(); err != nil { - invalidParams.AddNested("DataSourceConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataSourceConfig sets the DataSourceConfig field's value. -func (s *VectorEnrichmentJobInputConfig) SetDataSourceConfig(v *VectorEnrichmentJobDataSourceConfigInput_) *VectorEnrichmentJobInputConfig { - s.DataSourceConfig = v - return s -} - -// SetDocumentType sets the DocumentType field's value. -func (s *VectorEnrichmentJobInputConfig) SetDocumentType(v string) *VectorEnrichmentJobInputConfig { - s.DocumentType = &v - return s -} - -// The Amazon S3 data for the Vector Enrichment job. -type VectorEnrichmentJobS3Data struct { - _ struct{} `type:"structure"` - - // The Key Management Service key ID for server-side encryption. - KmsKeyId *string `type:"string"` - - // The URL to the Amazon S3 data for the Vector Enrichment job. - // - // S3Uri is a required field - S3Uri *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 VectorEnrichmentJobS3Data) 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 VectorEnrichmentJobS3Data) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *VectorEnrichmentJobS3Data) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "VectorEnrichmentJobS3Data"} - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *VectorEnrichmentJobS3Data) SetKmsKeyId(v string) *VectorEnrichmentJobS3Data { - s.KmsKeyId = &v - return s -} - -// SetS3Uri sets the S3Uri field's value. -func (s *VectorEnrichmentJobS3Data) SetS3Uri(v string) *VectorEnrichmentJobS3Data { - s.S3Uri = &v - return s -} - -// The input structure for specifying ViewOffNadir property filter. ViewOffNadir -// refers to the angle from the sensor between nadir (straight down) and the -// scene center. Measured in degrees (0-90). -type ViewOffNadirInput_ struct { - _ struct{} `type:"structure"` - - // The minimum value for ViewOffNadir property filter. This filters items having - // ViewOffNadir greater than or equal to this value. - // - // LowerBound is a required field - LowerBound *float64 `type:"float" required:"true"` - - // The maximum value for ViewOffNadir property filter. This filters items having - // ViewOffNadir lesser than or equal to this value. - // - // UpperBound is a required field - UpperBound *float64 `type:"float" 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 ViewOffNadirInput_) 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 ViewOffNadirInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ViewOffNadirInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ViewOffNadirInput_"} - if s.LowerBound == nil { - invalidParams.Add(request.NewErrParamRequired("LowerBound")) - } - if s.UpperBound == nil { - invalidParams.Add(request.NewErrParamRequired("UpperBound")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLowerBound sets the LowerBound field's value. -func (s *ViewOffNadirInput_) SetLowerBound(v float64) *ViewOffNadirInput_ { - s.LowerBound = &v - return s -} - -// SetUpperBound sets the UpperBound field's value. -func (s *ViewOffNadirInput_) SetUpperBound(v float64) *ViewOffNadirInput_ { - s.UpperBound = &v - return s -} - -// The input structure for specifying ViewSunAzimuth property filter. ViewSunAzimuth -// refers to the Sun azimuth angle. From the scene center point on the ground, -// this is the angle between truth north and the sun. Measured clockwise in -// degrees (0-360). -type ViewSunAzimuthInput_ struct { - _ struct{} `type:"structure"` - - // The minimum value for ViewSunAzimuth property filter. This filters items - // having ViewSunAzimuth greater than or equal to this value. - // - // LowerBound is a required field - LowerBound *float64 `type:"float" required:"true"` - - // The maximum value for ViewSunAzimuth property filter. This filters items - // having ViewSunAzimuth lesser than or equal to this value. - // - // UpperBound is a required field - UpperBound *float64 `type:"float" 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 ViewSunAzimuthInput_) 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 ViewSunAzimuthInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ViewSunAzimuthInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ViewSunAzimuthInput_"} - if s.LowerBound == nil { - invalidParams.Add(request.NewErrParamRequired("LowerBound")) - } - if s.UpperBound == nil { - invalidParams.Add(request.NewErrParamRequired("UpperBound")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLowerBound sets the LowerBound field's value. -func (s *ViewSunAzimuthInput_) SetLowerBound(v float64) *ViewSunAzimuthInput_ { - s.LowerBound = &v - return s -} - -// SetUpperBound sets the UpperBound field's value. -func (s *ViewSunAzimuthInput_) SetUpperBound(v float64) *ViewSunAzimuthInput_ { - s.UpperBound = &v - return s -} - -// The input structure for specifying ViewSunElevation angle property filter. -type ViewSunElevationInput_ struct { - _ struct{} `type:"structure"` - - // The lower bound to view the sun elevation. - // - // LowerBound is a required field - LowerBound *float64 `type:"float" required:"true"` - - // The upper bound to view the sun elevation. - // - // UpperBound is a required field - UpperBound *float64 `type:"float" 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 ViewSunElevationInput_) 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 ViewSunElevationInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ViewSunElevationInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ViewSunElevationInput_"} - if s.LowerBound == nil { - invalidParams.Add(request.NewErrParamRequired("LowerBound")) - } - if s.UpperBound == nil { - invalidParams.Add(request.NewErrParamRequired("UpperBound")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLowerBound sets the LowerBound field's value. -func (s *ViewSunElevationInput_) SetLowerBound(v float64) *ViewSunElevationInput_ { - s.LowerBound = &v - return s -} - -// SetUpperBound sets the UpperBound field's value. -func (s *ViewSunElevationInput_) SetUpperBound(v float64) *ViewSunElevationInput_ { - s.UpperBound = &v - return s -} - -// The structure representing input configuration of ZonalStatistics operation. -type ZonalStatisticsConfigInput_ struct { - _ struct{} `type:"structure"` - - // List of zonal statistics to compute. - // - // Statistics is a required field - Statistics []*string `min:"1" type:"list" required:"true" enum:"ZonalStatistics"` - - // Bands used in the operation. If no target bands are specified, it uses all - // bands available input. - TargetBands []*string `min:"1" type:"list"` - - // The Amazon S3 path pointing to the GeoJSON containing the polygonal zones. - // - // ZoneS3Path is a required field - ZoneS3Path *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) or an ID of a Amazon Web Services Key Management - // Service (Amazon Web Services KMS) key that Amazon SageMaker uses to decrypt - // your output artifacts with Amazon S3 server-side encryption. The SageMaker - // execution role must have kms:GenerateDataKey permission. - // - // The KmsKeyId can be any of the following formats: - // - // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" - // - // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:::key/" - // - // For more information about key identifiers, see Key identifiers (KeyID) (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id) - // in the Amazon Web Services Key Management Service (Amazon Web Services KMS) - // documentation. - ZoneS3PathKmsKeyId *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 ZonalStatisticsConfigInput_) 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 ZonalStatisticsConfigInput_) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ZonalStatisticsConfigInput_) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ZonalStatisticsConfigInput_"} - if s.Statistics == nil { - invalidParams.Add(request.NewErrParamRequired("Statistics")) - } - if s.Statistics != nil && len(s.Statistics) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Statistics", 1)) - } - if s.TargetBands != nil && len(s.TargetBands) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBands", 1)) - } - if s.ZoneS3Path == nil { - invalidParams.Add(request.NewErrParamRequired("ZoneS3Path")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatistics sets the Statistics field's value. -func (s *ZonalStatisticsConfigInput_) SetStatistics(v []*string) *ZonalStatisticsConfigInput_ { - s.Statistics = v - return s -} - -// SetTargetBands sets the TargetBands field's value. -func (s *ZonalStatisticsConfigInput_) SetTargetBands(v []*string) *ZonalStatisticsConfigInput_ { - s.TargetBands = v - return s -} - -// SetZoneS3Path sets the ZoneS3Path field's value. -func (s *ZonalStatisticsConfigInput_) SetZoneS3Path(v string) *ZonalStatisticsConfigInput_ { - s.ZoneS3Path = &v - return s -} - -// SetZoneS3PathKmsKeyId sets the ZoneS3PathKmsKeyId field's value. -func (s *ZonalStatisticsConfigInput_) SetZoneS3PathKmsKeyId(v string) *ZonalStatisticsConfigInput_ { - s.ZoneS3PathKmsKeyId = &v - return s -} - -const ( - // AlgorithmNameCloudRemovalInterpolation is a AlgorithmNameCloudRemoval enum value - AlgorithmNameCloudRemovalInterpolation = "INTERPOLATION" -) - -// AlgorithmNameCloudRemoval_Values returns all elements of the AlgorithmNameCloudRemoval enum -func AlgorithmNameCloudRemoval_Values() []string { - return []string{ - AlgorithmNameCloudRemovalInterpolation, - } -} - -const ( - // AlgorithmNameGeoMosaicNear is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicNear = "NEAR" - - // AlgorithmNameGeoMosaicBilinear is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicBilinear = "BILINEAR" - - // AlgorithmNameGeoMosaicCubic is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicCubic = "CUBIC" - - // AlgorithmNameGeoMosaicCubicspline is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicCubicspline = "CUBICSPLINE" - - // AlgorithmNameGeoMosaicLanczos is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicLanczos = "LANCZOS" - - // AlgorithmNameGeoMosaicAverage is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicAverage = "AVERAGE" - - // AlgorithmNameGeoMosaicRms is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicRms = "RMS" - - // AlgorithmNameGeoMosaicMode is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicMode = "MODE" - - // AlgorithmNameGeoMosaicMax is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicMax = "MAX" - - // AlgorithmNameGeoMosaicMin is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicMin = "MIN" - - // AlgorithmNameGeoMosaicMed is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicMed = "MED" - - // AlgorithmNameGeoMosaicQ1 is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicQ1 = "Q1" - - // AlgorithmNameGeoMosaicQ3 is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicQ3 = "Q3" - - // AlgorithmNameGeoMosaicSum is a AlgorithmNameGeoMosaic enum value - AlgorithmNameGeoMosaicSum = "SUM" -) - -// AlgorithmNameGeoMosaic_Values returns all elements of the AlgorithmNameGeoMosaic enum -func AlgorithmNameGeoMosaic_Values() []string { - return []string{ - AlgorithmNameGeoMosaicNear, - AlgorithmNameGeoMosaicBilinear, - AlgorithmNameGeoMosaicCubic, - AlgorithmNameGeoMosaicCubicspline, - AlgorithmNameGeoMosaicLanczos, - AlgorithmNameGeoMosaicAverage, - AlgorithmNameGeoMosaicRms, - AlgorithmNameGeoMosaicMode, - AlgorithmNameGeoMosaicMax, - AlgorithmNameGeoMosaicMin, - AlgorithmNameGeoMosaicMed, - AlgorithmNameGeoMosaicQ1, - AlgorithmNameGeoMosaicQ3, - AlgorithmNameGeoMosaicSum, - } -} - -const ( - // AlgorithmNameResamplingNear is a AlgorithmNameResampling enum value - AlgorithmNameResamplingNear = "NEAR" - - // AlgorithmNameResamplingBilinear is a AlgorithmNameResampling enum value - AlgorithmNameResamplingBilinear = "BILINEAR" - - // AlgorithmNameResamplingCubic is a AlgorithmNameResampling enum value - AlgorithmNameResamplingCubic = "CUBIC" - - // AlgorithmNameResamplingCubicspline is a AlgorithmNameResampling enum value - AlgorithmNameResamplingCubicspline = "CUBICSPLINE" - - // AlgorithmNameResamplingLanczos is a AlgorithmNameResampling enum value - AlgorithmNameResamplingLanczos = "LANCZOS" - - // AlgorithmNameResamplingAverage is a AlgorithmNameResampling enum value - AlgorithmNameResamplingAverage = "AVERAGE" - - // AlgorithmNameResamplingRms is a AlgorithmNameResampling enum value - AlgorithmNameResamplingRms = "RMS" - - // AlgorithmNameResamplingMode is a AlgorithmNameResampling enum value - AlgorithmNameResamplingMode = "MODE" - - // AlgorithmNameResamplingMax is a AlgorithmNameResampling enum value - AlgorithmNameResamplingMax = "MAX" - - // AlgorithmNameResamplingMin is a AlgorithmNameResampling enum value - AlgorithmNameResamplingMin = "MIN" - - // AlgorithmNameResamplingMed is a AlgorithmNameResampling enum value - AlgorithmNameResamplingMed = "MED" - - // AlgorithmNameResamplingQ1 is a AlgorithmNameResampling enum value - AlgorithmNameResamplingQ1 = "Q1" - - // AlgorithmNameResamplingQ3 is a AlgorithmNameResampling enum value - AlgorithmNameResamplingQ3 = "Q3" - - // AlgorithmNameResamplingSum is a AlgorithmNameResampling enum value - AlgorithmNameResamplingSum = "SUM" -) - -// AlgorithmNameResampling_Values returns all elements of the AlgorithmNameResampling enum -func AlgorithmNameResampling_Values() []string { - return []string{ - AlgorithmNameResamplingNear, - AlgorithmNameResamplingBilinear, - AlgorithmNameResamplingCubic, - AlgorithmNameResamplingCubicspline, - AlgorithmNameResamplingLanczos, - AlgorithmNameResamplingAverage, - AlgorithmNameResamplingRms, - AlgorithmNameResamplingMode, - AlgorithmNameResamplingMax, - AlgorithmNameResamplingMin, - AlgorithmNameResamplingMed, - AlgorithmNameResamplingQ1, - AlgorithmNameResamplingQ3, - AlgorithmNameResamplingSum, - } -} - -const ( - // ComparisonOperatorEquals is a ComparisonOperator enum value - ComparisonOperatorEquals = "EQUALS" - - // ComparisonOperatorNotEquals is a ComparisonOperator enum value - ComparisonOperatorNotEquals = "NOT_EQUALS" - - // ComparisonOperatorStartsWith is a ComparisonOperator enum value - ComparisonOperatorStartsWith = "STARTS_WITH" -) - -// ComparisonOperator_Values returns all elements of the ComparisonOperator enum -func ComparisonOperator_Values() []string { - return []string{ - ComparisonOperatorEquals, - ComparisonOperatorNotEquals, - ComparisonOperatorStartsWith, - } -} - -const ( - // DataCollectionTypePublic is a DataCollectionType enum value - DataCollectionTypePublic = "PUBLIC" - - // DataCollectionTypePremium is a DataCollectionType enum value - DataCollectionTypePremium = "PREMIUM" - - // DataCollectionTypeUser is a DataCollectionType enum value - DataCollectionTypeUser = "USER" -) - -// DataCollectionType_Values returns all elements of the DataCollectionType enum -func DataCollectionType_Values() []string { - return []string{ - DataCollectionTypePublic, - DataCollectionTypePremium, - DataCollectionTypeUser, - } -} - -const ( - // EarthObservationJobErrorTypeClientError is a EarthObservationJobErrorType enum value - EarthObservationJobErrorTypeClientError = "CLIENT_ERROR" - - // EarthObservationJobErrorTypeServerError is a EarthObservationJobErrorType enum value - EarthObservationJobErrorTypeServerError = "SERVER_ERROR" -) - -// EarthObservationJobErrorType_Values returns all elements of the EarthObservationJobErrorType enum -func EarthObservationJobErrorType_Values() []string { - return []string{ - EarthObservationJobErrorTypeClientError, - EarthObservationJobErrorTypeServerError, - } -} - -const ( - // EarthObservationJobExportStatusInProgress is a EarthObservationJobExportStatus enum value - EarthObservationJobExportStatusInProgress = "IN_PROGRESS" - - // EarthObservationJobExportStatusSucceeded is a EarthObservationJobExportStatus enum value - EarthObservationJobExportStatusSucceeded = "SUCCEEDED" - - // EarthObservationJobExportStatusFailed is a EarthObservationJobExportStatus enum value - EarthObservationJobExportStatusFailed = "FAILED" -) - -// EarthObservationJobExportStatus_Values returns all elements of the EarthObservationJobExportStatus enum -func EarthObservationJobExportStatus_Values() []string { - return []string{ - EarthObservationJobExportStatusInProgress, - EarthObservationJobExportStatusSucceeded, - EarthObservationJobExportStatusFailed, - } -} - -const ( - // EarthObservationJobStatusInitializing is a EarthObservationJobStatus enum value - EarthObservationJobStatusInitializing = "INITIALIZING" - - // EarthObservationJobStatusInProgress is a EarthObservationJobStatus enum value - EarthObservationJobStatusInProgress = "IN_PROGRESS" - - // EarthObservationJobStatusStopping is a EarthObservationJobStatus enum value - EarthObservationJobStatusStopping = "STOPPING" - - // EarthObservationJobStatusCompleted is a EarthObservationJobStatus enum value - EarthObservationJobStatusCompleted = "COMPLETED" - - // EarthObservationJobStatusStopped is a EarthObservationJobStatus enum value - EarthObservationJobStatusStopped = "STOPPED" - - // EarthObservationJobStatusFailed is a EarthObservationJobStatus enum value - EarthObservationJobStatusFailed = "FAILED" - - // EarthObservationJobStatusDeleting is a EarthObservationJobStatus enum value - EarthObservationJobStatusDeleting = "DELETING" - - // EarthObservationJobStatusDeleted is a EarthObservationJobStatus enum value - EarthObservationJobStatusDeleted = "DELETED" -) - -// EarthObservationJobStatus_Values returns all elements of the EarthObservationJobStatus enum -func EarthObservationJobStatus_Values() []string { - return []string{ - EarthObservationJobStatusInitializing, - EarthObservationJobStatusInProgress, - EarthObservationJobStatusStopping, - EarthObservationJobStatusCompleted, - EarthObservationJobStatusStopped, - EarthObservationJobStatusFailed, - EarthObservationJobStatusDeleting, - EarthObservationJobStatusDeleted, - } -} - -const ( - // ExportErrorTypeClientError is a ExportErrorType enum value - ExportErrorTypeClientError = "CLIENT_ERROR" - - // ExportErrorTypeServerError is a ExportErrorType enum value - ExportErrorTypeServerError = "SERVER_ERROR" -) - -// ExportErrorType_Values returns all elements of the ExportErrorType enum -func ExportErrorType_Values() []string { - return []string{ - ExportErrorTypeClientError, - ExportErrorTypeServerError, - } -} - -const ( - // GroupByAll is a GroupBy enum value - GroupByAll = "ALL" - - // GroupByYearly is a GroupBy enum value - GroupByYearly = "YEARLY" -) - -// GroupBy_Values returns all elements of the GroupBy enum -func GroupBy_Values() []string { - return []string{ - GroupByAll, - GroupByYearly, - } -} - -const ( - // LogicalOperatorAnd is a LogicalOperator enum value - LogicalOperatorAnd = "AND" -) - -// LogicalOperator_Values returns all elements of the LogicalOperator enum -func LogicalOperator_Values() []string { - return []string{ - LogicalOperatorAnd, - } -} - -const ( - // OutputTypeInt32 is a OutputType enum value - OutputTypeInt32 = "INT32" - - // OutputTypeFloat32 is a OutputType enum value - OutputTypeFloat32 = "FLOAT32" - - // OutputTypeInt16 is a OutputType enum value - OutputTypeInt16 = "INT16" - - // OutputTypeFloat64 is a OutputType enum value - OutputTypeFloat64 = "FLOAT64" - - // OutputTypeUint16 is a OutputType enum value - OutputTypeUint16 = "UINT16" -) - -// OutputType_Values returns all elements of the OutputType enum -func OutputType_Values() []string { - return []string{ - OutputTypeInt32, - OutputTypeFloat32, - OutputTypeInt16, - OutputTypeFloat64, - OutputTypeUint16, - } -} - -const ( - // PredefinedResolutionHighest is a PredefinedResolution enum value - PredefinedResolutionHighest = "HIGHEST" - - // PredefinedResolutionLowest is a PredefinedResolution enum value - PredefinedResolutionLowest = "LOWEST" - - // PredefinedResolutionAverage is a PredefinedResolution enum value - PredefinedResolutionAverage = "AVERAGE" -) - -// PredefinedResolution_Values returns all elements of the PredefinedResolution enum -func PredefinedResolution_Values() []string { - return []string{ - PredefinedResolutionHighest, - PredefinedResolutionLowest, - PredefinedResolutionAverage, - } -} - -const ( - // SortOrderAscending is a SortOrder enum value - SortOrderAscending = "ASCENDING" - - // SortOrderDescending is a SortOrder enum value - SortOrderDescending = "DESCENDING" -) - -// SortOrder_Values returns all elements of the SortOrder enum -func SortOrder_Values() []string { - return []string{ - SortOrderAscending, - SortOrderDescending, - } -} - -const ( - // TargetOptionsInput is a TargetOptions enum value - TargetOptionsInput = "INPUT" - - // TargetOptionsOutput is a TargetOptions enum value - TargetOptionsOutput = "OUTPUT" -) - -// TargetOptions_Values returns all elements of the TargetOptions enum -func TargetOptions_Values() []string { - return []string{ - TargetOptionsInput, - TargetOptionsOutput, - } -} - -const ( - // TemporalStatisticsMean is a TemporalStatistics enum value - TemporalStatisticsMean = "MEAN" - - // TemporalStatisticsMedian is a TemporalStatistics enum value - TemporalStatisticsMedian = "MEDIAN" - - // TemporalStatisticsStandardDeviation is a TemporalStatistics enum value - TemporalStatisticsStandardDeviation = "STANDARD_DEVIATION" -) - -// TemporalStatistics_Values returns all elements of the TemporalStatistics enum -func TemporalStatistics_Values() []string { - return []string{ - TemporalStatisticsMean, - TemporalStatisticsMedian, - TemporalStatisticsStandardDeviation, - } -} - -const ( - // UnitMeters is a Unit enum value - UnitMeters = "METERS" -) - -// Unit_Values returns all elements of the Unit enum -func Unit_Values() []string { - return []string{ - UnitMeters, - } -} - -const ( - // VectorEnrichmentJobDocumentTypeCsv is a VectorEnrichmentJobDocumentType enum value - VectorEnrichmentJobDocumentTypeCsv = "CSV" -) - -// VectorEnrichmentJobDocumentType_Values returns all elements of the VectorEnrichmentJobDocumentType enum -func VectorEnrichmentJobDocumentType_Values() []string { - return []string{ - VectorEnrichmentJobDocumentTypeCsv, - } -} - -const ( - // VectorEnrichmentJobErrorTypeClientError is a VectorEnrichmentJobErrorType enum value - VectorEnrichmentJobErrorTypeClientError = "CLIENT_ERROR" - - // VectorEnrichmentJobErrorTypeServerError is a VectorEnrichmentJobErrorType enum value - VectorEnrichmentJobErrorTypeServerError = "SERVER_ERROR" -) - -// VectorEnrichmentJobErrorType_Values returns all elements of the VectorEnrichmentJobErrorType enum -func VectorEnrichmentJobErrorType_Values() []string { - return []string{ - VectorEnrichmentJobErrorTypeClientError, - VectorEnrichmentJobErrorTypeServerError, - } -} - -const ( - // VectorEnrichmentJobExportErrorTypeClientError is a VectorEnrichmentJobExportErrorType enum value - VectorEnrichmentJobExportErrorTypeClientError = "CLIENT_ERROR" - - // VectorEnrichmentJobExportErrorTypeServerError is a VectorEnrichmentJobExportErrorType enum value - VectorEnrichmentJobExportErrorTypeServerError = "SERVER_ERROR" -) - -// VectorEnrichmentJobExportErrorType_Values returns all elements of the VectorEnrichmentJobExportErrorType enum -func VectorEnrichmentJobExportErrorType_Values() []string { - return []string{ - VectorEnrichmentJobExportErrorTypeClientError, - VectorEnrichmentJobExportErrorTypeServerError, - } -} - -const ( - // VectorEnrichmentJobExportStatusInProgress is a VectorEnrichmentJobExportStatus enum value - VectorEnrichmentJobExportStatusInProgress = "IN_PROGRESS" - - // VectorEnrichmentJobExportStatusSucceeded is a VectorEnrichmentJobExportStatus enum value - VectorEnrichmentJobExportStatusSucceeded = "SUCCEEDED" - - // VectorEnrichmentJobExportStatusFailed is a VectorEnrichmentJobExportStatus enum value - VectorEnrichmentJobExportStatusFailed = "FAILED" -) - -// VectorEnrichmentJobExportStatus_Values returns all elements of the VectorEnrichmentJobExportStatus enum -func VectorEnrichmentJobExportStatus_Values() []string { - return []string{ - VectorEnrichmentJobExportStatusInProgress, - VectorEnrichmentJobExportStatusSucceeded, - VectorEnrichmentJobExportStatusFailed, - } -} - -const ( - // VectorEnrichmentJobStatusInitializing is a VectorEnrichmentJobStatus enum value - VectorEnrichmentJobStatusInitializing = "INITIALIZING" - - // VectorEnrichmentJobStatusInProgress is a VectorEnrichmentJobStatus enum value - VectorEnrichmentJobStatusInProgress = "IN_PROGRESS" - - // VectorEnrichmentJobStatusStopping is a VectorEnrichmentJobStatus enum value - VectorEnrichmentJobStatusStopping = "STOPPING" - - // VectorEnrichmentJobStatusStopped is a VectorEnrichmentJobStatus enum value - VectorEnrichmentJobStatusStopped = "STOPPED" - - // VectorEnrichmentJobStatusCompleted is a VectorEnrichmentJobStatus enum value - VectorEnrichmentJobStatusCompleted = "COMPLETED" - - // VectorEnrichmentJobStatusFailed is a VectorEnrichmentJobStatus enum value - VectorEnrichmentJobStatusFailed = "FAILED" - - // VectorEnrichmentJobStatusDeleting is a VectorEnrichmentJobStatus enum value - VectorEnrichmentJobStatusDeleting = "DELETING" - - // VectorEnrichmentJobStatusDeleted is a VectorEnrichmentJobStatus enum value - VectorEnrichmentJobStatusDeleted = "DELETED" -) - -// VectorEnrichmentJobStatus_Values returns all elements of the VectorEnrichmentJobStatus enum -func VectorEnrichmentJobStatus_Values() []string { - return []string{ - VectorEnrichmentJobStatusInitializing, - VectorEnrichmentJobStatusInProgress, - VectorEnrichmentJobStatusStopping, - VectorEnrichmentJobStatusStopped, - VectorEnrichmentJobStatusCompleted, - VectorEnrichmentJobStatusFailed, - VectorEnrichmentJobStatusDeleting, - VectorEnrichmentJobStatusDeleted, - } -} - -const ( - // VectorEnrichmentJobTypeReverseGeocoding is a VectorEnrichmentJobType enum value - VectorEnrichmentJobTypeReverseGeocoding = "REVERSE_GEOCODING" - - // VectorEnrichmentJobTypeMapMatching is a VectorEnrichmentJobType enum value - VectorEnrichmentJobTypeMapMatching = "MAP_MATCHING" -) - -// VectorEnrichmentJobType_Values returns all elements of the VectorEnrichmentJobType enum -func VectorEnrichmentJobType_Values() []string { - return []string{ - VectorEnrichmentJobTypeReverseGeocoding, - VectorEnrichmentJobTypeMapMatching, - } -} - -const ( - // ZonalStatisticsMean is a ZonalStatistics enum value - ZonalStatisticsMean = "MEAN" - - // ZonalStatisticsMedian is a ZonalStatistics enum value - ZonalStatisticsMedian = "MEDIAN" - - // ZonalStatisticsStandardDeviation is a ZonalStatistics enum value - ZonalStatisticsStandardDeviation = "STANDARD_DEVIATION" - - // ZonalStatisticsMax is a ZonalStatistics enum value - ZonalStatisticsMax = "MAX" - - // ZonalStatisticsMin is a ZonalStatistics enum value - ZonalStatisticsMin = "MIN" - - // ZonalStatisticsSum is a ZonalStatistics enum value - ZonalStatisticsSum = "SUM" -) - -// ZonalStatistics_Values returns all elements of the ZonalStatistics enum -func ZonalStatistics_Values() []string { - return []string{ - ZonalStatisticsMean, - ZonalStatisticsMedian, - ZonalStatisticsStandardDeviation, - ZonalStatisticsMax, - ZonalStatisticsMin, - ZonalStatisticsSum, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/doc.go deleted file mode 100644 index d24c4eb8aca5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package sagemakergeospatial provides the client and types for making API -// requests to Amazon SageMaker geospatial capabilities. -// -// Provides APIs for creating and managing SageMaker geospatial resources. -// -// See https://docs.aws.amazon.com/goto/WebAPI/sagemaker-geospatial-2020-05-27 for more information on this service. -// -// See sagemakergeospatial package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/sagemakergeospatial/ -// -// # Using the Client -// -// To contact Amazon SageMaker geospatial capabilities with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon SageMaker geospatial capabilities client SageMakerGeospatial for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/sagemakergeospatial/#New -package sagemakergeospatial diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/errors.go deleted file mode 100644 index 2b3c5e95692e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sagemakergeospatial - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Updating or deleting a resource can cause an inconsistent state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request processing has failed because of an unknown error, exception, - // or failure. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request references a resource which does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // You have exceeded the service quota. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an Amazon Web Services - // service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/sagemakergeospatialiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/sagemakergeospatialiface/interface.go deleted file mode 100644 index 5bcdde40fba5..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/sagemakergeospatialiface/interface.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package sagemakergeospatialiface provides an interface to enable mocking the Amazon SageMaker geospatial capabilities service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package sagemakergeospatialiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial" -) - -// SageMakerGeospatialAPI provides an interface to enable mocking the -// sagemakergeospatial.SageMakerGeospatial service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon SageMaker geospatial capabilities. -// func myFunc(svc sagemakergeospatialiface.SageMakerGeospatialAPI) bool { -// // Make svc.DeleteEarthObservationJob request -// } -// -// func main() { -// sess := session.New() -// svc := sagemakergeospatial.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSageMakerGeospatialClient struct { -// sagemakergeospatialiface.SageMakerGeospatialAPI -// } -// func (m *mockSageMakerGeospatialClient) DeleteEarthObservationJob(input *sagemakergeospatial.DeleteEarthObservationJobInput) (*sagemakergeospatial.DeleteEarthObservationJobOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSageMakerGeospatialClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type SageMakerGeospatialAPI interface { - DeleteEarthObservationJob(*sagemakergeospatial.DeleteEarthObservationJobInput) (*sagemakergeospatial.DeleteEarthObservationJobOutput, error) - DeleteEarthObservationJobWithContext(aws.Context, *sagemakergeospatial.DeleteEarthObservationJobInput, ...request.Option) (*sagemakergeospatial.DeleteEarthObservationJobOutput, error) - DeleteEarthObservationJobRequest(*sagemakergeospatial.DeleteEarthObservationJobInput) (*request.Request, *sagemakergeospatial.DeleteEarthObservationJobOutput) - - DeleteVectorEnrichmentJob(*sagemakergeospatial.DeleteVectorEnrichmentJobInput) (*sagemakergeospatial.DeleteVectorEnrichmentJobOutput, error) - DeleteVectorEnrichmentJobWithContext(aws.Context, *sagemakergeospatial.DeleteVectorEnrichmentJobInput, ...request.Option) (*sagemakergeospatial.DeleteVectorEnrichmentJobOutput, error) - DeleteVectorEnrichmentJobRequest(*sagemakergeospatial.DeleteVectorEnrichmentJobInput) (*request.Request, *sagemakergeospatial.DeleteVectorEnrichmentJobOutput) - - ExportEarthObservationJob(*sagemakergeospatial.ExportEarthObservationJobInput) (*sagemakergeospatial.ExportEarthObservationJobOutput, error) - ExportEarthObservationJobWithContext(aws.Context, *sagemakergeospatial.ExportEarthObservationJobInput, ...request.Option) (*sagemakergeospatial.ExportEarthObservationJobOutput, error) - ExportEarthObservationJobRequest(*sagemakergeospatial.ExportEarthObservationJobInput) (*request.Request, *sagemakergeospatial.ExportEarthObservationJobOutput) - - ExportVectorEnrichmentJob(*sagemakergeospatial.ExportVectorEnrichmentJobInput) (*sagemakergeospatial.ExportVectorEnrichmentJobOutput, error) - ExportVectorEnrichmentJobWithContext(aws.Context, *sagemakergeospatial.ExportVectorEnrichmentJobInput, ...request.Option) (*sagemakergeospatial.ExportVectorEnrichmentJobOutput, error) - ExportVectorEnrichmentJobRequest(*sagemakergeospatial.ExportVectorEnrichmentJobInput) (*request.Request, *sagemakergeospatial.ExportVectorEnrichmentJobOutput) - - GetEarthObservationJob(*sagemakergeospatial.GetEarthObservationJobInput) (*sagemakergeospatial.GetEarthObservationJobOutput, error) - GetEarthObservationJobWithContext(aws.Context, *sagemakergeospatial.GetEarthObservationJobInput, ...request.Option) (*sagemakergeospatial.GetEarthObservationJobOutput, error) - GetEarthObservationJobRequest(*sagemakergeospatial.GetEarthObservationJobInput) (*request.Request, *sagemakergeospatial.GetEarthObservationJobOutput) - - GetRasterDataCollection(*sagemakergeospatial.GetRasterDataCollectionInput) (*sagemakergeospatial.GetRasterDataCollectionOutput, error) - GetRasterDataCollectionWithContext(aws.Context, *sagemakergeospatial.GetRasterDataCollectionInput, ...request.Option) (*sagemakergeospatial.GetRasterDataCollectionOutput, error) - GetRasterDataCollectionRequest(*sagemakergeospatial.GetRasterDataCollectionInput) (*request.Request, *sagemakergeospatial.GetRasterDataCollectionOutput) - - GetTile(*sagemakergeospatial.GetTileInput) (*sagemakergeospatial.GetTileOutput, error) - GetTileWithContext(aws.Context, *sagemakergeospatial.GetTileInput, ...request.Option) (*sagemakergeospatial.GetTileOutput, error) - GetTileRequest(*sagemakergeospatial.GetTileInput) (*request.Request, *sagemakergeospatial.GetTileOutput) - - GetVectorEnrichmentJob(*sagemakergeospatial.GetVectorEnrichmentJobInput) (*sagemakergeospatial.GetVectorEnrichmentJobOutput, error) - GetVectorEnrichmentJobWithContext(aws.Context, *sagemakergeospatial.GetVectorEnrichmentJobInput, ...request.Option) (*sagemakergeospatial.GetVectorEnrichmentJobOutput, error) - GetVectorEnrichmentJobRequest(*sagemakergeospatial.GetVectorEnrichmentJobInput) (*request.Request, *sagemakergeospatial.GetVectorEnrichmentJobOutput) - - ListEarthObservationJobs(*sagemakergeospatial.ListEarthObservationJobsInput) (*sagemakergeospatial.ListEarthObservationJobsOutput, error) - ListEarthObservationJobsWithContext(aws.Context, *sagemakergeospatial.ListEarthObservationJobsInput, ...request.Option) (*sagemakergeospatial.ListEarthObservationJobsOutput, error) - ListEarthObservationJobsRequest(*sagemakergeospatial.ListEarthObservationJobsInput) (*request.Request, *sagemakergeospatial.ListEarthObservationJobsOutput) - - ListEarthObservationJobsPages(*sagemakergeospatial.ListEarthObservationJobsInput, func(*sagemakergeospatial.ListEarthObservationJobsOutput, bool) bool) error - ListEarthObservationJobsPagesWithContext(aws.Context, *sagemakergeospatial.ListEarthObservationJobsInput, func(*sagemakergeospatial.ListEarthObservationJobsOutput, bool) bool, ...request.Option) error - - ListRasterDataCollections(*sagemakergeospatial.ListRasterDataCollectionsInput) (*sagemakergeospatial.ListRasterDataCollectionsOutput, error) - ListRasterDataCollectionsWithContext(aws.Context, *sagemakergeospatial.ListRasterDataCollectionsInput, ...request.Option) (*sagemakergeospatial.ListRasterDataCollectionsOutput, error) - ListRasterDataCollectionsRequest(*sagemakergeospatial.ListRasterDataCollectionsInput) (*request.Request, *sagemakergeospatial.ListRasterDataCollectionsOutput) - - ListRasterDataCollectionsPages(*sagemakergeospatial.ListRasterDataCollectionsInput, func(*sagemakergeospatial.ListRasterDataCollectionsOutput, bool) bool) error - ListRasterDataCollectionsPagesWithContext(aws.Context, *sagemakergeospatial.ListRasterDataCollectionsInput, func(*sagemakergeospatial.ListRasterDataCollectionsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*sagemakergeospatial.ListTagsForResourceInput) (*sagemakergeospatial.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *sagemakergeospatial.ListTagsForResourceInput, ...request.Option) (*sagemakergeospatial.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*sagemakergeospatial.ListTagsForResourceInput) (*request.Request, *sagemakergeospatial.ListTagsForResourceOutput) - - ListVectorEnrichmentJobs(*sagemakergeospatial.ListVectorEnrichmentJobsInput) (*sagemakergeospatial.ListVectorEnrichmentJobsOutput, error) - ListVectorEnrichmentJobsWithContext(aws.Context, *sagemakergeospatial.ListVectorEnrichmentJobsInput, ...request.Option) (*sagemakergeospatial.ListVectorEnrichmentJobsOutput, error) - ListVectorEnrichmentJobsRequest(*sagemakergeospatial.ListVectorEnrichmentJobsInput) (*request.Request, *sagemakergeospatial.ListVectorEnrichmentJobsOutput) - - ListVectorEnrichmentJobsPages(*sagemakergeospatial.ListVectorEnrichmentJobsInput, func(*sagemakergeospatial.ListVectorEnrichmentJobsOutput, bool) bool) error - ListVectorEnrichmentJobsPagesWithContext(aws.Context, *sagemakergeospatial.ListVectorEnrichmentJobsInput, func(*sagemakergeospatial.ListVectorEnrichmentJobsOutput, bool) bool, ...request.Option) error - - SearchRasterDataCollection(*sagemakergeospatial.SearchRasterDataCollectionInput) (*sagemakergeospatial.SearchRasterDataCollectionOutput, error) - SearchRasterDataCollectionWithContext(aws.Context, *sagemakergeospatial.SearchRasterDataCollectionInput, ...request.Option) (*sagemakergeospatial.SearchRasterDataCollectionOutput, error) - SearchRasterDataCollectionRequest(*sagemakergeospatial.SearchRasterDataCollectionInput) (*request.Request, *sagemakergeospatial.SearchRasterDataCollectionOutput) - - SearchRasterDataCollectionPages(*sagemakergeospatial.SearchRasterDataCollectionInput, func(*sagemakergeospatial.SearchRasterDataCollectionOutput, bool) bool) error - SearchRasterDataCollectionPagesWithContext(aws.Context, *sagemakergeospatial.SearchRasterDataCollectionInput, func(*sagemakergeospatial.SearchRasterDataCollectionOutput, bool) bool, ...request.Option) error - - StartEarthObservationJob(*sagemakergeospatial.StartEarthObservationJobInput) (*sagemakergeospatial.StartEarthObservationJobOutput, error) - StartEarthObservationJobWithContext(aws.Context, *sagemakergeospatial.StartEarthObservationJobInput, ...request.Option) (*sagemakergeospatial.StartEarthObservationJobOutput, error) - StartEarthObservationJobRequest(*sagemakergeospatial.StartEarthObservationJobInput) (*request.Request, *sagemakergeospatial.StartEarthObservationJobOutput) - - StartVectorEnrichmentJob(*sagemakergeospatial.StartVectorEnrichmentJobInput) (*sagemakergeospatial.StartVectorEnrichmentJobOutput, error) - StartVectorEnrichmentJobWithContext(aws.Context, *sagemakergeospatial.StartVectorEnrichmentJobInput, ...request.Option) (*sagemakergeospatial.StartVectorEnrichmentJobOutput, error) - StartVectorEnrichmentJobRequest(*sagemakergeospatial.StartVectorEnrichmentJobInput) (*request.Request, *sagemakergeospatial.StartVectorEnrichmentJobOutput) - - StopEarthObservationJob(*sagemakergeospatial.StopEarthObservationJobInput) (*sagemakergeospatial.StopEarthObservationJobOutput, error) - StopEarthObservationJobWithContext(aws.Context, *sagemakergeospatial.StopEarthObservationJobInput, ...request.Option) (*sagemakergeospatial.StopEarthObservationJobOutput, error) - StopEarthObservationJobRequest(*sagemakergeospatial.StopEarthObservationJobInput) (*request.Request, *sagemakergeospatial.StopEarthObservationJobOutput) - - StopVectorEnrichmentJob(*sagemakergeospatial.StopVectorEnrichmentJobInput) (*sagemakergeospatial.StopVectorEnrichmentJobOutput, error) - StopVectorEnrichmentJobWithContext(aws.Context, *sagemakergeospatial.StopVectorEnrichmentJobInput, ...request.Option) (*sagemakergeospatial.StopVectorEnrichmentJobOutput, error) - StopVectorEnrichmentJobRequest(*sagemakergeospatial.StopVectorEnrichmentJobInput) (*request.Request, *sagemakergeospatial.StopVectorEnrichmentJobOutput) - - TagResource(*sagemakergeospatial.TagResourceInput) (*sagemakergeospatial.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *sagemakergeospatial.TagResourceInput, ...request.Option) (*sagemakergeospatial.TagResourceOutput, error) - TagResourceRequest(*sagemakergeospatial.TagResourceInput) (*request.Request, *sagemakergeospatial.TagResourceOutput) - - UntagResource(*sagemakergeospatial.UntagResourceInput) (*sagemakergeospatial.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *sagemakergeospatial.UntagResourceInput, ...request.Option) (*sagemakergeospatial.UntagResourceOutput, error) - UntagResourceRequest(*sagemakergeospatial.UntagResourceInput) (*request.Request, *sagemakergeospatial.UntagResourceOutput) -} - -var _ SageMakerGeospatialAPI = (*sagemakergeospatial.SageMakerGeospatial)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/service.go deleted file mode 100644 index 770a1d8e2d63..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakergeospatial/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sagemakergeospatial - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// SageMakerGeospatial provides the API operation methods for making requests to -// Amazon SageMaker geospatial capabilities. See this package's package overview docs -// for details on the service. -// -// SageMakerGeospatial methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type SageMakerGeospatial struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "SageMaker Geospatial" // Name of service. - EndpointsID = "sagemaker-geospatial" // ID to lookup a service endpoint with. - ServiceID = "SageMaker Geospatial" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the SageMakerGeospatial client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a SageMakerGeospatial client from just a session. -// svc := sagemakergeospatial.New(mySession) -// -// // Create a SageMakerGeospatial client with additional configuration -// svc := sagemakergeospatial.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SageMakerGeospatial { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "sagemaker-geospatial" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *SageMakerGeospatial { - svc := &SageMakerGeospatial{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2020-05-27", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SageMakerGeospatial operation and runs any -// custom request initialization. -func (c *SageMakerGeospatial) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/api.go deleted file mode 100644 index b141de40c51a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/api.go +++ /dev/null @@ -1,355 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sagemakermetrics - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" -) - -const opBatchPutMetrics = "BatchPutMetrics" - -// BatchPutMetricsRequest generates a "aws/request.Request" representing the -// client's request for the BatchPutMetrics 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 BatchPutMetrics for more information on using the BatchPutMetrics -// 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 BatchPutMetricsRequest method. -// req, resp := client.BatchPutMetricsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-metrics-2022-09-30/BatchPutMetrics -func (c *SageMakerMetrics) BatchPutMetricsRequest(input *BatchPutMetricsInput) (req *request.Request, output *BatchPutMetricsOutput) { - op := &request.Operation{ - Name: opBatchPutMetrics, - HTTPMethod: "PUT", - HTTPPath: "/BatchPutMetrics", - } - - if input == nil { - input = &BatchPutMetricsInput{} - } - - output = &BatchPutMetricsOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchPutMetrics API operation for Amazon SageMaker Metrics Service. -// -// Used to ingest training metrics into SageMaker. These metrics can be visualized -// in SageMaker Studio and retrieved with the GetMetrics API. -// -// 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 SageMaker Metrics Service's -// API operation BatchPutMetrics for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-metrics-2022-09-30/BatchPutMetrics -func (c *SageMakerMetrics) BatchPutMetrics(input *BatchPutMetricsInput) (*BatchPutMetricsOutput, error) { - req, out := c.BatchPutMetricsRequest(input) - return out, req.Send() -} - -// BatchPutMetricsWithContext is the same as BatchPutMetrics with the addition of -// the ability to pass a context and additional request options. -// -// See BatchPutMetrics 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 *SageMakerMetrics) BatchPutMetricsWithContext(ctx aws.Context, input *BatchPutMetricsInput, opts ...request.Option) (*BatchPutMetricsOutput, error) { - req, out := c.BatchPutMetricsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// An error that occured when putting the metric data. -type BatchPutMetricsError struct { - _ struct{} `type:"structure"` - - // The error code of an error that occured when attempting to put metrics. - // - // * METRIC_LIMIT_EXCEEDED: The maximum amount of metrics per resource is - // exceeded. - // - // * INTERNAL_ERROR: An internal error occured. - // - // * VALIDATION_ERROR: The metric data failed validation. - // - // * CONFLICT_ERROR: Multiple requests attempted to modify the same data - // simultaneously. - Code *string `type:"string" enum:"PutMetricsErrorCode"` - - // An index that corresponds to the metric in the request. - MetricIndex *int64 `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 BatchPutMetricsError) 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 BatchPutMetricsError) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *BatchPutMetricsError) SetCode(v string) *BatchPutMetricsError { - s.Code = &v - return s -} - -// SetMetricIndex sets the MetricIndex field's value. -func (s *BatchPutMetricsError) SetMetricIndex(v int64) *BatchPutMetricsError { - s.MetricIndex = &v - return s -} - -type BatchPutMetricsInput struct { - _ struct{} `type:"structure"` - - // A list of raw metric values to put. - // - // MetricData is a required field - MetricData []*RawMetricData `min:"1" type:"list" required:"true"` - - // The name of the Trial Component to associate with the metrics. - // - // TrialComponentName is a required field - TrialComponentName *string `min:"1" 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 BatchPutMetricsInput) 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 BatchPutMetricsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchPutMetricsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchPutMetricsInput"} - if s.MetricData == nil { - invalidParams.Add(request.NewErrParamRequired("MetricData")) - } - if s.MetricData != nil && len(s.MetricData) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricData", 1)) - } - if s.TrialComponentName == nil { - invalidParams.Add(request.NewErrParamRequired("TrialComponentName")) - } - if s.TrialComponentName != nil && len(*s.TrialComponentName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrialComponentName", 1)) - } - if s.MetricData != nil { - for i, v := range s.MetricData { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricData", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetricData sets the MetricData field's value. -func (s *BatchPutMetricsInput) SetMetricData(v []*RawMetricData) *BatchPutMetricsInput { - s.MetricData = v - return s -} - -// SetTrialComponentName sets the TrialComponentName field's value. -func (s *BatchPutMetricsInput) SetTrialComponentName(v string) *BatchPutMetricsInput { - s.TrialComponentName = &v - return s -} - -type BatchPutMetricsOutput struct { - _ struct{} `type:"structure"` - - // Lists any errors that occur when inserting metric data. - Errors []*BatchPutMetricsError `min:"1" type:"list"` -} - -// 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 BatchPutMetricsOutput) 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 BatchPutMetricsOutput) GoString() string { - return s.String() -} - -// SetErrors sets the Errors field's value. -func (s *BatchPutMetricsOutput) SetErrors(v []*BatchPutMetricsError) *BatchPutMetricsOutput { - s.Errors = v - return s -} - -// The raw metric data to associate with the resource. -type RawMetricData struct { - _ struct{} `type:"structure"` - - // The name of the metric. - // - // MetricName is a required field - MetricName *string `min:"1" type:"string" required:"true"` - - // The metric step (epoch). - Step *int64 `type:"integer"` - - // The time that the metric was recorded. - // - // Timestamp is a required field - Timestamp *time.Time `type:"timestamp" required:"true"` - - // The metric value. - // - // Value is a required field - Value *float64 `type:"double" 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 RawMetricData) 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 RawMetricData) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RawMetricData) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RawMetricData"} - if s.MetricName == nil { - invalidParams.Add(request.NewErrParamRequired("MetricName")) - } - if s.MetricName != nil && len(*s.MetricName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MetricName", 1)) - } - if s.Timestamp == nil { - invalidParams.Add(request.NewErrParamRequired("Timestamp")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetricName sets the MetricName field's value. -func (s *RawMetricData) SetMetricName(v string) *RawMetricData { - s.MetricName = &v - return s -} - -// SetStep sets the Step field's value. -func (s *RawMetricData) SetStep(v int64) *RawMetricData { - s.Step = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *RawMetricData) SetTimestamp(v time.Time) *RawMetricData { - s.Timestamp = &v - return s -} - -// SetValue sets the Value field's value. -func (s *RawMetricData) SetValue(v float64) *RawMetricData { - s.Value = &v - return s -} - -const ( - // PutMetricsErrorCodeMetricLimitExceeded is a PutMetricsErrorCode enum value - PutMetricsErrorCodeMetricLimitExceeded = "METRIC_LIMIT_EXCEEDED" - - // PutMetricsErrorCodeInternalError is a PutMetricsErrorCode enum value - PutMetricsErrorCodeInternalError = "INTERNAL_ERROR" - - // PutMetricsErrorCodeValidationError is a PutMetricsErrorCode enum value - PutMetricsErrorCodeValidationError = "VALIDATION_ERROR" - - // PutMetricsErrorCodeConflictError is a PutMetricsErrorCode enum value - PutMetricsErrorCodeConflictError = "CONFLICT_ERROR" -) - -// PutMetricsErrorCode_Values returns all elements of the PutMetricsErrorCode enum -func PutMetricsErrorCode_Values() []string { - return []string{ - PutMetricsErrorCodeMetricLimitExceeded, - PutMetricsErrorCodeInternalError, - PutMetricsErrorCodeValidationError, - PutMetricsErrorCodeConflictError, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/doc.go deleted file mode 100644 index fcd2a763a04a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package sagemakermetrics provides the client and types for making API -// requests to Amazon SageMaker Metrics Service. -// -// Contains all data plane API operations and data types for Amazon SageMaker -// Metrics. Use these APIs to put and retrieve (get) features related to your -// training run. -// -// - BatchPutMetrics (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_metrics_BatchPutMetrics.html) -// -// See https://docs.aws.amazon.com/goto/WebAPI/sagemaker-metrics-2022-09-30 for more information on this service. -// -// See sagemakermetrics package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/sagemakermetrics/ -// -// # Using the Client -// -// To contact Amazon SageMaker Metrics Service with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon SageMaker Metrics Service client SageMakerMetrics for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/sagemakermetrics/#New -package sagemakermetrics diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/errors.go deleted file mode 100644 index abc9390104e2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/errors.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sagemakermetrics - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/sagemakermetricsiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/sagemakermetricsiface/interface.go deleted file mode 100644 index 6b703d0a805c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/sagemakermetricsiface/interface.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package sagemakermetricsiface provides an interface to enable mocking the Amazon SageMaker Metrics Service service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package sagemakermetricsiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics" -) - -// SageMakerMetricsAPI provides an interface to enable mocking the -// sagemakermetrics.SageMakerMetrics service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon SageMaker Metrics Service. -// func myFunc(svc sagemakermetricsiface.SageMakerMetricsAPI) bool { -// // Make svc.BatchPutMetrics request -// } -// -// func main() { -// sess := session.New() -// svc := sagemakermetrics.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSageMakerMetricsClient struct { -// sagemakermetricsiface.SageMakerMetricsAPI -// } -// func (m *mockSageMakerMetricsClient) BatchPutMetrics(input *sagemakermetrics.BatchPutMetricsInput) (*sagemakermetrics.BatchPutMetricsOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSageMakerMetricsClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type SageMakerMetricsAPI interface { - BatchPutMetrics(*sagemakermetrics.BatchPutMetricsInput) (*sagemakermetrics.BatchPutMetricsOutput, error) - BatchPutMetricsWithContext(aws.Context, *sagemakermetrics.BatchPutMetricsInput, ...request.Option) (*sagemakermetrics.BatchPutMetricsOutput, error) - BatchPutMetricsRequest(*sagemakermetrics.BatchPutMetricsInput) (*request.Request, *sagemakermetrics.BatchPutMetricsOutput) -} - -var _ SageMakerMetricsAPI = (*sagemakermetrics.SageMakerMetrics)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/service.go deleted file mode 100644 index a5df75e21ab4..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/sagemakermetrics/service.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package sagemakermetrics - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// SageMakerMetrics provides the API operation methods for making requests to -// Amazon SageMaker Metrics Service. See this package's package overview docs -// for details on the service. -// -// SageMakerMetrics methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type SageMakerMetrics struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "SageMaker Metrics" // Name of service. - EndpointsID = "metrics.sagemaker" // ID to lookup a service endpoint with. - ServiceID = "SageMaker Metrics" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the SageMakerMetrics client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a SageMakerMetrics client from just a session. -// svc := sagemakermetrics.New(mySession) -// -// // Create a SageMakerMetrics client with additional configuration -// svc := sagemakermetrics.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SageMakerMetrics { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "sagemaker" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *SageMakerMetrics { - svc := &SageMakerMetrics{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-09-30", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SageMakerMetrics operation and runs any -// custom request initialization. -func (c *SageMakerMetrics) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/api.go deleted file mode 100644 index 1c092bf474f3..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/api.go +++ /dev/null @@ -1,4906 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package scheduler - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateSchedule = "CreateSchedule" - -// CreateScheduleRequest generates a "aws/request.Request" representing the -// client's request for the CreateSchedule 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 CreateSchedule for more information on using the CreateSchedule -// 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 CreateScheduleRequest method. -// req, resp := client.CreateScheduleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/CreateSchedule -func (c *Scheduler) CreateScheduleRequest(input *CreateScheduleInput) (req *request.Request, output *CreateScheduleOutput) { - op := &request.Operation{ - Name: opCreateSchedule, - HTTPMethod: "POST", - HTTPPath: "/schedules/{Name}", - } - - if input == nil { - input = &CreateScheduleInput{} - } - - output = &CreateScheduleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSchedule API operation for Amazon EventBridge Scheduler. -// -// Creates the specified schedule. -// -// 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 EventBridge Scheduler's -// API operation CreateSchedule for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/CreateSchedule -func (c *Scheduler) CreateSchedule(input *CreateScheduleInput) (*CreateScheduleOutput, error) { - req, out := c.CreateScheduleRequest(input) - return out, req.Send() -} - -// CreateScheduleWithContext is the same as CreateSchedule with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSchedule 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 *Scheduler) CreateScheduleWithContext(ctx aws.Context, input *CreateScheduleInput, opts ...request.Option) (*CreateScheduleOutput, error) { - req, out := c.CreateScheduleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateScheduleGroup = "CreateScheduleGroup" - -// CreateScheduleGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateScheduleGroup 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 CreateScheduleGroup for more information on using the CreateScheduleGroup -// 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 CreateScheduleGroupRequest method. -// req, resp := client.CreateScheduleGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/CreateScheduleGroup -func (c *Scheduler) CreateScheduleGroupRequest(input *CreateScheduleGroupInput) (req *request.Request, output *CreateScheduleGroupOutput) { - op := &request.Operation{ - Name: opCreateScheduleGroup, - HTTPMethod: "POST", - HTTPPath: "/schedule-groups/{Name}", - } - - if input == nil { - input = &CreateScheduleGroupInput{} - } - - output = &CreateScheduleGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateScheduleGroup API operation for Amazon EventBridge Scheduler. -// -// Creates the specified schedule group. -// -// 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 EventBridge Scheduler's -// API operation CreateScheduleGroup for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// The request exceeds a service quota. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/CreateScheduleGroup -func (c *Scheduler) CreateScheduleGroup(input *CreateScheduleGroupInput) (*CreateScheduleGroupOutput, error) { - req, out := c.CreateScheduleGroupRequest(input) - return out, req.Send() -} - -// CreateScheduleGroupWithContext is the same as CreateScheduleGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateScheduleGroup 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 *Scheduler) CreateScheduleGroupWithContext(ctx aws.Context, input *CreateScheduleGroupInput, opts ...request.Option) (*CreateScheduleGroupOutput, error) { - req, out := c.CreateScheduleGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSchedule = "DeleteSchedule" - -// DeleteScheduleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSchedule 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 DeleteSchedule for more information on using the DeleteSchedule -// 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 DeleteScheduleRequest method. -// req, resp := client.DeleteScheduleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/DeleteSchedule -func (c *Scheduler) DeleteScheduleRequest(input *DeleteScheduleInput) (req *request.Request, output *DeleteScheduleOutput) { - op := &request.Operation{ - Name: opDeleteSchedule, - HTTPMethod: "DELETE", - HTTPPath: "/schedules/{Name}", - } - - if input == nil { - input = &DeleteScheduleInput{} - } - - output = &DeleteScheduleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSchedule API operation for Amazon EventBridge Scheduler. -// -// Deletes the specified schedule. -// -// 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 EventBridge Scheduler's -// API operation DeleteSchedule for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/DeleteSchedule -func (c *Scheduler) DeleteSchedule(input *DeleteScheduleInput) (*DeleteScheduleOutput, error) { - req, out := c.DeleteScheduleRequest(input) - return out, req.Send() -} - -// DeleteScheduleWithContext is the same as DeleteSchedule with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSchedule 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 *Scheduler) DeleteScheduleWithContext(ctx aws.Context, input *DeleteScheduleInput, opts ...request.Option) (*DeleteScheduleOutput, error) { - req, out := c.DeleteScheduleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteScheduleGroup = "DeleteScheduleGroup" - -// DeleteScheduleGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteScheduleGroup 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 DeleteScheduleGroup for more information on using the DeleteScheduleGroup -// 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 DeleteScheduleGroupRequest method. -// req, resp := client.DeleteScheduleGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/DeleteScheduleGroup -func (c *Scheduler) DeleteScheduleGroupRequest(input *DeleteScheduleGroupInput) (req *request.Request, output *DeleteScheduleGroupOutput) { - op := &request.Operation{ - Name: opDeleteScheduleGroup, - HTTPMethod: "DELETE", - HTTPPath: "/schedule-groups/{Name}", - } - - if input == nil { - input = &DeleteScheduleGroupInput{} - } - - output = &DeleteScheduleGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteScheduleGroup API operation for Amazon EventBridge Scheduler. -// -// Deletes the specified schedule group. Deleting a schedule group results in -// EventBridge Scheduler deleting all schedules associated with the group. When -// you delete a group, it remains in a DELETING state until all of its associated -// schedules are deleted. Schedules associated with the group that are set to -// run while the schedule group is in the process of being deleted might continue -// to invoke their targets until the schedule group and its associated schedules -// are deleted. -// -// This operation is eventually consistent. -// -// 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 EventBridge Scheduler's -// API operation DeleteScheduleGroup for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/DeleteScheduleGroup -func (c *Scheduler) DeleteScheduleGroup(input *DeleteScheduleGroupInput) (*DeleteScheduleGroupOutput, error) { - req, out := c.DeleteScheduleGroupRequest(input) - return out, req.Send() -} - -// DeleteScheduleGroupWithContext is the same as DeleteScheduleGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteScheduleGroup 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 *Scheduler) DeleteScheduleGroupWithContext(ctx aws.Context, input *DeleteScheduleGroupInput, opts ...request.Option) (*DeleteScheduleGroupOutput, error) { - req, out := c.DeleteScheduleGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSchedule = "GetSchedule" - -// GetScheduleRequest generates a "aws/request.Request" representing the -// client's request for the GetSchedule 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 GetSchedule for more information on using the GetSchedule -// 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 GetScheduleRequest method. -// req, resp := client.GetScheduleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/GetSchedule -func (c *Scheduler) GetScheduleRequest(input *GetScheduleInput) (req *request.Request, output *GetScheduleOutput) { - op := &request.Operation{ - Name: opGetSchedule, - HTTPMethod: "GET", - HTTPPath: "/schedules/{Name}", - } - - if input == nil { - input = &GetScheduleInput{} - } - - output = &GetScheduleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSchedule API operation for Amazon EventBridge Scheduler. -// -// Retrieves the specified schedule. -// -// 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 EventBridge Scheduler's -// API operation GetSchedule for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/GetSchedule -func (c *Scheduler) GetSchedule(input *GetScheduleInput) (*GetScheduleOutput, error) { - req, out := c.GetScheduleRequest(input) - return out, req.Send() -} - -// GetScheduleWithContext is the same as GetSchedule with the addition of -// the ability to pass a context and additional request options. -// -// See GetSchedule 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 *Scheduler) GetScheduleWithContext(ctx aws.Context, input *GetScheduleInput, opts ...request.Option) (*GetScheduleOutput, error) { - req, out := c.GetScheduleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetScheduleGroup = "GetScheduleGroup" - -// GetScheduleGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetScheduleGroup 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 GetScheduleGroup for more information on using the GetScheduleGroup -// 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 GetScheduleGroupRequest method. -// req, resp := client.GetScheduleGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/GetScheduleGroup -func (c *Scheduler) GetScheduleGroupRequest(input *GetScheduleGroupInput) (req *request.Request, output *GetScheduleGroupOutput) { - op := &request.Operation{ - Name: opGetScheduleGroup, - HTTPMethod: "GET", - HTTPPath: "/schedule-groups/{Name}", - } - - if input == nil { - input = &GetScheduleGroupInput{} - } - - output = &GetScheduleGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetScheduleGroup API operation for Amazon EventBridge Scheduler. -// -// Retrieves the specified schedule group. -// -// 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 EventBridge Scheduler's -// API operation GetScheduleGroup for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/GetScheduleGroup -func (c *Scheduler) GetScheduleGroup(input *GetScheduleGroupInput) (*GetScheduleGroupOutput, error) { - req, out := c.GetScheduleGroupRequest(input) - return out, req.Send() -} - -// GetScheduleGroupWithContext is the same as GetScheduleGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetScheduleGroup 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 *Scheduler) GetScheduleGroupWithContext(ctx aws.Context, input *GetScheduleGroupInput, opts ...request.Option) (*GetScheduleGroupOutput, error) { - req, out := c.GetScheduleGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListScheduleGroups = "ListScheduleGroups" - -// ListScheduleGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListScheduleGroups 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 ListScheduleGroups for more information on using the ListScheduleGroups -// 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 ListScheduleGroupsRequest method. -// req, resp := client.ListScheduleGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/ListScheduleGroups -func (c *Scheduler) ListScheduleGroupsRequest(input *ListScheduleGroupsInput) (req *request.Request, output *ListScheduleGroupsOutput) { - op := &request.Operation{ - Name: opListScheduleGroups, - HTTPMethod: "GET", - HTTPPath: "/schedule-groups", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListScheduleGroupsInput{} - } - - output = &ListScheduleGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListScheduleGroups API operation for Amazon EventBridge Scheduler. -// -// Returns a paginated list of your schedule groups. -// -// 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 EventBridge Scheduler's -// API operation ListScheduleGroups for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/ListScheduleGroups -func (c *Scheduler) ListScheduleGroups(input *ListScheduleGroupsInput) (*ListScheduleGroupsOutput, error) { - req, out := c.ListScheduleGroupsRequest(input) - return out, req.Send() -} - -// ListScheduleGroupsWithContext is the same as ListScheduleGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListScheduleGroups 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 *Scheduler) ListScheduleGroupsWithContext(ctx aws.Context, input *ListScheduleGroupsInput, opts ...request.Option) (*ListScheduleGroupsOutput, error) { - req, out := c.ListScheduleGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListScheduleGroupsPages iterates over the pages of a ListScheduleGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListScheduleGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListScheduleGroups operation. -// pageNum := 0 -// err := client.ListScheduleGroupsPages(params, -// func(page *scheduler.ListScheduleGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Scheduler) ListScheduleGroupsPages(input *ListScheduleGroupsInput, fn func(*ListScheduleGroupsOutput, bool) bool) error { - return c.ListScheduleGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListScheduleGroupsPagesWithContext same as ListScheduleGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Scheduler) ListScheduleGroupsPagesWithContext(ctx aws.Context, input *ListScheduleGroupsInput, fn func(*ListScheduleGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListScheduleGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListScheduleGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListScheduleGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSchedules = "ListSchedules" - -// ListSchedulesRequest generates a "aws/request.Request" representing the -// client's request for the ListSchedules 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 ListSchedules for more information on using the ListSchedules -// 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 ListSchedulesRequest method. -// req, resp := client.ListSchedulesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/ListSchedules -func (c *Scheduler) ListSchedulesRequest(input *ListSchedulesInput) (req *request.Request, output *ListSchedulesOutput) { - op := &request.Operation{ - Name: opListSchedules, - HTTPMethod: "GET", - HTTPPath: "/schedules", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSchedulesInput{} - } - - output = &ListSchedulesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSchedules API operation for Amazon EventBridge Scheduler. -// -// Returns a paginated list of your EventBridge Scheduler schedules. -// -// 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 EventBridge Scheduler's -// API operation ListSchedules for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/ListSchedules -func (c *Scheduler) ListSchedules(input *ListSchedulesInput) (*ListSchedulesOutput, error) { - req, out := c.ListSchedulesRequest(input) - return out, req.Send() -} - -// ListSchedulesWithContext is the same as ListSchedules with the addition of -// the ability to pass a context and additional request options. -// -// See ListSchedules 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 *Scheduler) ListSchedulesWithContext(ctx aws.Context, input *ListSchedulesInput, opts ...request.Option) (*ListSchedulesOutput, error) { - req, out := c.ListSchedulesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSchedulesPages iterates over the pages of a ListSchedules operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSchedules method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSchedules operation. -// pageNum := 0 -// err := client.ListSchedulesPages(params, -// func(page *scheduler.ListSchedulesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Scheduler) ListSchedulesPages(input *ListSchedulesInput, fn func(*ListSchedulesOutput, bool) bool) error { - return c.ListSchedulesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSchedulesPagesWithContext same as ListSchedulesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Scheduler) ListSchedulesPagesWithContext(ctx aws.Context, input *ListSchedulesInput, fn func(*ListSchedulesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSchedulesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSchedulesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSchedulesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/ListTagsForResource -func (c *Scheduler) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon EventBridge Scheduler. -// -// Lists the tags associated with the Scheduler resource. -// -// 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 EventBridge Scheduler's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/ListTagsForResource -func (c *Scheduler) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *Scheduler) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/TagResource -func (c *Scheduler) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon EventBridge Scheduler. -// -// Assigns one or more tags (key-value pairs) to the specified EventBridge Scheduler -// resource. You can only assign tags to schedule groups. -// -// 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 EventBridge Scheduler's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/TagResource -func (c *Scheduler) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *Scheduler) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/UntagResource -func (c *Scheduler) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon EventBridge Scheduler. -// -// Removes one or more tags from the specified EventBridge Scheduler schedule -// group. -// -// 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 EventBridge Scheduler's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/UntagResource -func (c *Scheduler) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *Scheduler) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSchedule = "UpdateSchedule" - -// UpdateScheduleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSchedule 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 UpdateSchedule for more information on using the UpdateSchedule -// 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 UpdateScheduleRequest method. -// req, resp := client.UpdateScheduleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/UpdateSchedule -func (c *Scheduler) UpdateScheduleRequest(input *UpdateScheduleInput) (req *request.Request, output *UpdateScheduleOutput) { - op := &request.Operation{ - Name: opUpdateSchedule, - HTTPMethod: "PUT", - HTTPPath: "/schedules/{Name}", - } - - if input == nil { - input = &UpdateScheduleInput{} - } - - output = &UpdateScheduleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSchedule API operation for Amazon EventBridge Scheduler. -// -// Updates the specified schedule. When you call UpdateSchedule, EventBridge -// Scheduler uses all values, including empty values, specified in the request -// and overrides the existing schedule. This is by design. This means that if -// you do not set an optional field in your request, that field will be set -// to its system-default value after the update. -// -// Before calling this operation, we recommend that you call the GetSchedule -// API operation and make a note of all optional parameters for your UpdateSchedule -// call. -// -// 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 EventBridge Scheduler's -// API operation UpdateSchedule for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// Unexpected error encountered while processing the request. -// -// - ConflictException -// Updating or deleting the resource can cause an inconsistent state. -// -// - ResourceNotFoundException -// The request references a resource which does not exist. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30/UpdateSchedule -func (c *Scheduler) UpdateSchedule(input *UpdateScheduleInput) (*UpdateScheduleOutput, error) { - req, out := c.UpdateScheduleRequest(input) - return out, req.Send() -} - -// UpdateScheduleWithContext is the same as UpdateSchedule with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSchedule 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 *Scheduler) UpdateScheduleWithContext(ctx aws.Context, input *UpdateScheduleInput, opts ...request.Option) (*UpdateScheduleOutput, error) { - req, out := c.UpdateScheduleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// This structure specifies the VPC subnets and security groups for the task, -// and whether a public IP address is to be used. This structure is relevant -// only for ECS tasks that use the awsvpc network mode. -type AwsVpcConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies whether the task's elastic network interface receives a public - // IP address. You can specify ENABLED only when LaunchType in EcsParameters - // is set to FARGATE. - AssignPublicIp *string `type:"string" enum:"AssignPublicIp"` - - // Specifies the security groups associated with the task. These security groups - // must all be in the same VPC. You can specify as many as five security groups. - // If you do not specify a security group, the default security group for the - // VPC is used. - SecurityGroups []*string `min:"1" type:"list"` - - // Specifies the subnets associated with the task. These subnets must all be - // in the same VPC. You can specify as many as 16 subnets. - // - // Subnets is a required field - Subnets []*string `min:"1" type:"list" 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 AwsVpcConfiguration) 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 AwsVpcConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AwsVpcConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AwsVpcConfiguration"} - if s.SecurityGroups != nil && len(s.SecurityGroups) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroups", 1)) - } - if s.Subnets == nil { - invalidParams.Add(request.NewErrParamRequired("Subnets")) - } - if s.Subnets != nil && len(s.Subnets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Subnets", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssignPublicIp sets the AssignPublicIp field's value. -func (s *AwsVpcConfiguration) SetAssignPublicIp(v string) *AwsVpcConfiguration { - s.AssignPublicIp = &v - return s -} - -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *AwsVpcConfiguration) SetSecurityGroups(v []*string) *AwsVpcConfiguration { - s.SecurityGroups = v - return s -} - -// SetSubnets sets the Subnets field's value. -func (s *AwsVpcConfiguration) SetSubnets(v []*string) *AwsVpcConfiguration { - s.Subnets = v - return s -} - -// The details of a capacity provider strategy. -type CapacityProviderStrategyItem struct { - _ struct{} `type:"structure"` - - // The base value designates how many tasks, at a minimum, to run on the specified - // capacity provider. Only one capacity provider in a capacity provider strategy - // can have a base defined. If no value is specified, the default value of 0 - // is used. - Base *int64 `locationName:"base" type:"integer"` - - // The short name of the capacity provider. - // - // CapacityProvider is a required field - CapacityProvider *string `locationName:"capacityProvider" min:"1" type:"string" required:"true"` - - // The weight value designates the relative percentage of the total number of - // tasks launched that should use the specified capacity provider. The weight - // value is taken into consideration after the base value, if defined, is satisfied. - Weight *int64 `locationName:"weight" 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 CapacityProviderStrategyItem) 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 CapacityProviderStrategyItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CapacityProviderStrategyItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CapacityProviderStrategyItem"} - if s.CapacityProvider == nil { - invalidParams.Add(request.NewErrParamRequired("CapacityProvider")) - } - if s.CapacityProvider != nil && len(*s.CapacityProvider) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CapacityProvider", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBase sets the Base field's value. -func (s *CapacityProviderStrategyItem) SetBase(v int64) *CapacityProviderStrategyItem { - s.Base = &v - return s -} - -// SetCapacityProvider sets the CapacityProvider field's value. -func (s *CapacityProviderStrategyItem) SetCapacityProvider(v string) *CapacityProviderStrategyItem { - s.CapacityProvider = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *CapacityProviderStrategyItem) SetWeight(v int64) *CapacityProviderStrategyItem { - s.Weight = &v - return s -} - -// Updating or deleting the resource can cause an inconsistent state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateScheduleGroupInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. If you do not specify a client token, EventBridge Scheduler - // uses a randomly generated token for the request to ensure idempotency. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // The name of the schedule group that you are creating. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` - - // The list of tags to associate with the schedule group. - Tags []*Tag `type:"list"` -} - -// 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 CreateScheduleGroupInput) 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 CreateScheduleGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateScheduleGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateScheduleGroupInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateScheduleGroupInput) SetClientToken(v string) *CreateScheduleGroupInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateScheduleGroupInput) SetName(v string) *CreateScheduleGroupInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateScheduleGroupInput) SetTags(v []*Tag) *CreateScheduleGroupInput { - s.Tags = v - return s -} - -type CreateScheduleGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the schedule group. - // - // ScheduleGroupArn is a required field - ScheduleGroupArn *string `min:"1" 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 CreateScheduleGroupOutput) 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 CreateScheduleGroupOutput) GoString() string { - return s.String() -} - -// SetScheduleGroupArn sets the ScheduleGroupArn field's value. -func (s *CreateScheduleGroupOutput) SetScheduleGroupArn(v string) *CreateScheduleGroupOutput { - s.ScheduleGroupArn = &v - return s -} - -type CreateScheduleInput struct { - _ struct{} `type:"structure"` - - // Specifies the action that EventBridge Scheduler applies to the schedule after - // the schedule completes invoking the target. - ActionAfterCompletion *string `type:"string" enum:"ActionAfterCompletion"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. If you do not specify a client token, EventBridge Scheduler - // uses a randomly generated token for the request to ensure idempotency. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // The description you specify for the schedule. - Description *string `type:"string"` - - // The date, in UTC, before which the schedule can invoke its target. Depending - // on the schedule's recurrence expression, invocations might stop on, or before, - // the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time - // schedules. - EndDate *time.Time `type:"timestamp"` - - // Allows you to configure a time window during which EventBridge Scheduler - // invokes the schedule. - // - // FlexibleTimeWindow is a required field - FlexibleTimeWindow *FlexibleTimeWindow `type:"structure" required:"true"` - - // The name of the schedule group to associate with this schedule. If you omit - // this, the default schedule group is used. - GroupName *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) for the customer managed KMS key that EventBridge - // Scheduler will use to encrypt and decrypt your data. - KmsKeyArn *string `min:"1" type:"string"` - - // The name of the schedule that you are creating. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` - - // The expression that defines when the schedule runs. The following formats - // are supported. - // - // * at expression - at(yyyy-mm-ddThh:mm:ss) - // - // * rate expression - rate(value unit) - // - // * cron expression - cron(fields) - // - // You can use at expressions to create one-time schedules that invoke a target - // once, at the time and in the time zone, that you specify. You can use rate - // and cron expressions to create recurring schedules. Rate-based schedules - // are useful when you want to invoke a target at regular intervals, such as - // every 15 minutes or every five days. Cron-based schedules are useful when - // you want to invoke a target periodically at a specific time, such as at 8:00 - // am (UTC+0) every 1st day of the month. - // - // A cron expression consists of six fields separated by white spaces: (minutes - // hours day_of_month month day_of_week year). - // - // A rate expression consists of a value as a positive integer, and a unit with - // the following options: minute | minutes | hour | hours | day | days - // - // For more information and examples, see Schedule types on EventBridge Scheduler - // (https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html) - // in the EventBridge Scheduler User Guide. - // - // ScheduleExpression is a required field - ScheduleExpression *string `min:"1" type:"string" required:"true"` - - // The timezone in which the scheduling expression is evaluated. - ScheduleExpressionTimezone *string `min:"1" type:"string"` - - // The date, in UTC, after which the schedule can begin invoking its target. - // Depending on the schedule's recurrence expression, invocations might occur - // on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate - // for one-time schedules. - StartDate *time.Time `type:"timestamp"` - - // Specifies whether the schedule is enabled or disabled. - State *string `type:"string" enum:"ScheduleState"` - - // The schedule's target. - // - // Target is a required field - Target *Target `type:"structure" 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 CreateScheduleInput) 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 CreateScheduleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateScheduleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateScheduleInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.FlexibleTimeWindow == nil { - invalidParams.Add(request.NewErrParamRequired("FlexibleTimeWindow")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ScheduleExpression == nil { - invalidParams.Add(request.NewErrParamRequired("ScheduleExpression")) - } - if s.ScheduleExpression != nil && len(*s.ScheduleExpression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduleExpression", 1)) - } - if s.ScheduleExpressionTimezone != nil && len(*s.ScheduleExpressionTimezone) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduleExpressionTimezone", 1)) - } - if s.Target == nil { - invalidParams.Add(request.NewErrParamRequired("Target")) - } - if s.FlexibleTimeWindow != nil { - if err := s.FlexibleTimeWindow.Validate(); err != nil { - invalidParams.AddNested("FlexibleTimeWindow", err.(request.ErrInvalidParams)) - } - } - if s.Target != nil { - if err := s.Target.Validate(); err != nil { - invalidParams.AddNested("Target", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionAfterCompletion sets the ActionAfterCompletion field's value. -func (s *CreateScheduleInput) SetActionAfterCompletion(v string) *CreateScheduleInput { - s.ActionAfterCompletion = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateScheduleInput) SetClientToken(v string) *CreateScheduleInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateScheduleInput) SetDescription(v string) *CreateScheduleInput { - s.Description = &v - return s -} - -// SetEndDate sets the EndDate field's value. -func (s *CreateScheduleInput) SetEndDate(v time.Time) *CreateScheduleInput { - s.EndDate = &v - return s -} - -// SetFlexibleTimeWindow sets the FlexibleTimeWindow field's value. -func (s *CreateScheduleInput) SetFlexibleTimeWindow(v *FlexibleTimeWindow) *CreateScheduleInput { - s.FlexibleTimeWindow = v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreateScheduleInput) SetGroupName(v string) *CreateScheduleInput { - s.GroupName = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *CreateScheduleInput) SetKmsKeyArn(v string) *CreateScheduleInput { - s.KmsKeyArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateScheduleInput) SetName(v string) *CreateScheduleInput { - s.Name = &v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *CreateScheduleInput) SetScheduleExpression(v string) *CreateScheduleInput { - s.ScheduleExpression = &v - return s -} - -// SetScheduleExpressionTimezone sets the ScheduleExpressionTimezone field's value. -func (s *CreateScheduleInput) SetScheduleExpressionTimezone(v string) *CreateScheduleInput { - s.ScheduleExpressionTimezone = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *CreateScheduleInput) SetStartDate(v time.Time) *CreateScheduleInput { - s.StartDate = &v - return s -} - -// SetState sets the State field's value. -func (s *CreateScheduleInput) SetState(v string) *CreateScheduleInput { - s.State = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *CreateScheduleInput) SetTarget(v *Target) *CreateScheduleInput { - s.Target = v - return s -} - -type CreateScheduleOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the schedule. - // - // ScheduleArn is a required field - ScheduleArn *string `min:"1" 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 CreateScheduleOutput) 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 CreateScheduleOutput) GoString() string { - return s.String() -} - -// SetScheduleArn sets the ScheduleArn field's value. -func (s *CreateScheduleOutput) SetScheduleArn(v string) *CreateScheduleOutput { - s.ScheduleArn = &v - return s -} - -// An object that contains information about an Amazon SQS queue that EventBridge -// Scheduler uses as a dead-letter queue for your schedule. If specified, EventBridge -// Scheduler delivers failed events that could not be successfully delivered -// to a target to the queue. -type DeadLetterConfig struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the SQS queue specified as the destination - // for the dead-letter queue. - Arn *string `min:"1" 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 DeadLetterConfig) 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 DeadLetterConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeadLetterConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeadLetterConfig"} - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *DeadLetterConfig) SetArn(v string) *DeadLetterConfig { - s.Arn = &v - return s -} - -type DeleteScheduleGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. If you do not specify a client token, EventBridge Scheduler - // uses a randomly generated token for the request to ensure idempotency. - ClientToken *string `location:"querystring" locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The name of the schedule group to delete. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" 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 DeleteScheduleGroupInput) 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 DeleteScheduleGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteScheduleGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteScheduleGroupInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteScheduleGroupInput) SetClientToken(v string) *DeleteScheduleGroupInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteScheduleGroupInput) SetName(v string) *DeleteScheduleGroupInput { - s.Name = &v - return s -} - -type DeleteScheduleGroupOutput 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 DeleteScheduleGroupOutput) 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 DeleteScheduleGroupOutput) GoString() string { - return s.String() -} - -type DeleteScheduleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. If you do not specify a client token, EventBridge Scheduler - // uses a randomly generated token for the request to ensure idempotency. - ClientToken *string `location:"querystring" locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The name of the schedule group associated with this schedule. If you omit - // this, the default schedule group is used. - GroupName *string `location:"querystring" locationName:"groupName" min:"1" type:"string"` - - // The name of the schedule to delete. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" 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 DeleteScheduleInput) 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 DeleteScheduleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteScheduleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteScheduleInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteScheduleInput) SetClientToken(v string) *DeleteScheduleInput { - s.ClientToken = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *DeleteScheduleInput) SetGroupName(v string) *DeleteScheduleInput { - s.GroupName = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteScheduleInput) SetName(v string) *DeleteScheduleInput { - s.Name = &v - return s -} - -type DeleteScheduleOutput 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 DeleteScheduleOutput) 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 DeleteScheduleOutput) GoString() string { - return s.String() -} - -// The templated target type for the Amazon ECS RunTask (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) -// API operation. -type EcsParameters struct { - _ struct{} `type:"structure"` - - // The capacity provider strategy to use for the task. - CapacityProviderStrategy []*CapacityProviderStrategyItem `type:"list"` - - // Specifies whether to enable Amazon ECS managed tags for the task. For more - // information, see Tagging Your Amazon ECS Resources (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html) - // in the Amazon ECS Developer Guide. - EnableECSManagedTags *bool `type:"boolean"` - - // Whether or not to enable the execute command functionality for the containers - // in this task. If true, this enables execute command functionality on all - // containers in the task. - EnableExecuteCommand *bool `type:"boolean"` - - // Specifies an ECS task group for the task. The maximum length is 255 characters. - Group *string `min:"1" type:"string"` - - // Specifies the launch type on which your task is running. The launch type - // that you specify here must match one of the launch type (compatibilities) - // of the target task. The FARGATE value is supported only in the Regions where - // Fargate with Amazon ECS is supported. For more information, see AWS Fargate - // on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html) - // in the Amazon ECS Developer Guide. - LaunchType *string `type:"string" enum:"LaunchType"` - - // This structure specifies the network configuration for an ECS task. - NetworkConfiguration *NetworkConfiguration `type:"structure"` - - // An array of placement constraint objects to use for the task. You can specify - // up to 10 constraints per task (including constraints in the task definition - // and those specified at runtime). - PlacementConstraints []*PlacementConstraint `type:"list"` - - // The task placement strategy for a task or service. - PlacementStrategy []*PlacementStrategy `type:"list"` - - // Specifies the platform version for the task. Specify only the numeric portion - // of the platform version, such as 1.1.0. - PlatformVersion *string `min:"1" type:"string"` - - // Specifies whether to propagate the tags from the task definition to the task. - // If no value is specified, the tags are not propagated. Tags can only be propagated - // to the task during task creation. To add tags to a task after task creation, - // use Amazon ECS's TagResource (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_TagResource.html) - // API action. - PropagateTags *string `type:"string" enum:"PropagateTags"` - - // The reference ID to use for the task. - ReferenceId *string `type:"string"` - - // The metadata that you apply to the task to help you categorize and organize - // them. Each tag consists of a key and an optional value, both of which you - // define. For more information, see RunTask (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) - // in the Amazon ECS API Reference. - Tags []map[string]*string `type:"list"` - - // The number of tasks to create based on TaskDefinition. The default is 1. - TaskCount *int64 `min:"1" type:"integer"` - - // The Amazon Resource Name (ARN) of the task definition to use if the event - // target is an Amazon ECS task. - // - // TaskDefinitionArn is a required field - TaskDefinitionArn *string `min:"1" 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 EcsParameters) 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 EcsParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EcsParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EcsParameters"} - if s.Group != nil && len(*s.Group) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Group", 1)) - } - if s.PlatformVersion != nil && len(*s.PlatformVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PlatformVersion", 1)) - } - if s.TaskCount != nil && *s.TaskCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("TaskCount", 1)) - } - if s.TaskDefinitionArn == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDefinitionArn")) - } - if s.TaskDefinitionArn != nil && len(*s.TaskDefinitionArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskDefinitionArn", 1)) - } - if s.CapacityProviderStrategy != nil { - for i, v := range s.CapacityProviderStrategy { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CapacityProviderStrategy", i), err.(request.ErrInvalidParams)) - } - } - } - if s.NetworkConfiguration != nil { - if err := s.NetworkConfiguration.Validate(); err != nil { - invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. -func (s *EcsParameters) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *EcsParameters { - s.CapacityProviderStrategy = v - return s -} - -// SetEnableECSManagedTags sets the EnableECSManagedTags field's value. -func (s *EcsParameters) SetEnableECSManagedTags(v bool) *EcsParameters { - s.EnableECSManagedTags = &v - return s -} - -// SetEnableExecuteCommand sets the EnableExecuteCommand field's value. -func (s *EcsParameters) SetEnableExecuteCommand(v bool) *EcsParameters { - s.EnableExecuteCommand = &v - return s -} - -// SetGroup sets the Group field's value. -func (s *EcsParameters) SetGroup(v string) *EcsParameters { - s.Group = &v - return s -} - -// SetLaunchType sets the LaunchType field's value. -func (s *EcsParameters) SetLaunchType(v string) *EcsParameters { - s.LaunchType = &v - return s -} - -// SetNetworkConfiguration sets the NetworkConfiguration field's value. -func (s *EcsParameters) SetNetworkConfiguration(v *NetworkConfiguration) *EcsParameters { - s.NetworkConfiguration = v - return s -} - -// SetPlacementConstraints sets the PlacementConstraints field's value. -func (s *EcsParameters) SetPlacementConstraints(v []*PlacementConstraint) *EcsParameters { - s.PlacementConstraints = v - return s -} - -// SetPlacementStrategy sets the PlacementStrategy field's value. -func (s *EcsParameters) SetPlacementStrategy(v []*PlacementStrategy) *EcsParameters { - s.PlacementStrategy = v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *EcsParameters) SetPlatformVersion(v string) *EcsParameters { - s.PlatformVersion = &v - return s -} - -// SetPropagateTags sets the PropagateTags field's value. -func (s *EcsParameters) SetPropagateTags(v string) *EcsParameters { - s.PropagateTags = &v - return s -} - -// SetReferenceId sets the ReferenceId field's value. -func (s *EcsParameters) SetReferenceId(v string) *EcsParameters { - s.ReferenceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *EcsParameters) SetTags(v []map[string]*string) *EcsParameters { - s.Tags = v - return s -} - -// SetTaskCount sets the TaskCount field's value. -func (s *EcsParameters) SetTaskCount(v int64) *EcsParameters { - s.TaskCount = &v - return s -} - -// SetTaskDefinitionArn sets the TaskDefinitionArn field's value. -func (s *EcsParameters) SetTaskDefinitionArn(v string) *EcsParameters { - s.TaskDefinitionArn = &v - return s -} - -// The templated target type for the EventBridge PutEvents (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) -// API operation. -type EventBridgeParameters struct { - _ struct{} `type:"structure"` - - // A free-form string, with a maximum of 128 characters, used to decide what - // fields to expect in the event detail. - // - // DetailType is a required field - DetailType *string `min:"1" type:"string" required:"true"` - - // The source of the event. - // - // Source is a required field - Source *string `min:"1" 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 EventBridgeParameters) 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 EventBridgeParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EventBridgeParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EventBridgeParameters"} - if s.DetailType == nil { - invalidParams.Add(request.NewErrParamRequired("DetailType")) - } - if s.DetailType != nil && len(*s.DetailType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DetailType", 1)) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.Source != nil && len(*s.Source) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Source", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDetailType sets the DetailType field's value. -func (s *EventBridgeParameters) SetDetailType(v string) *EventBridgeParameters { - s.DetailType = &v - return s -} - -// SetSource sets the Source field's value. -func (s *EventBridgeParameters) SetSource(v string) *EventBridgeParameters { - s.Source = &v - return s -} - -// Allows you to configure a time window during which EventBridge Scheduler -// invokes the schedule. -type FlexibleTimeWindow struct { - _ struct{} `type:"structure"` - - // The maximum time window during which a schedule can be invoked. - MaximumWindowInMinutes *int64 `min:"1" type:"integer"` - - // Determines whether the schedule is invoked within a flexible time window. - // - // Mode is a required field - Mode *string `type:"string" required:"true" enum:"FlexibleTimeWindowMode"` -} - -// 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 FlexibleTimeWindow) 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 FlexibleTimeWindow) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FlexibleTimeWindow) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FlexibleTimeWindow"} - if s.MaximumWindowInMinutes != nil && *s.MaximumWindowInMinutes < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaximumWindowInMinutes", 1)) - } - if s.Mode == nil { - invalidParams.Add(request.NewErrParamRequired("Mode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaximumWindowInMinutes sets the MaximumWindowInMinutes field's value. -func (s *FlexibleTimeWindow) SetMaximumWindowInMinutes(v int64) *FlexibleTimeWindow { - s.MaximumWindowInMinutes = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *FlexibleTimeWindow) SetMode(v string) *FlexibleTimeWindow { - s.Mode = &v - return s -} - -type GetScheduleGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the schedule group to retrieve. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" 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 GetScheduleGroupInput) 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 GetScheduleGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetScheduleGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetScheduleGroupInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetScheduleGroupInput) SetName(v string) *GetScheduleGroupInput { - s.Name = &v - return s -} - -type GetScheduleGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the schedule group. - Arn *string `min:"1" type:"string"` - - // The time at which the schedule group was created. - CreationDate *time.Time `type:"timestamp"` - - // The time at which the schedule group was last modified. - LastModificationDate *time.Time `type:"timestamp"` - - // The name of the schedule group. - Name *string `min:"1" type:"string"` - - // Specifies the state of the schedule group. - State *string `type:"string" enum:"ScheduleGroupState"` -} - -// 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 GetScheduleGroupOutput) 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 GetScheduleGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetScheduleGroupOutput) SetArn(v string) *GetScheduleGroupOutput { - s.Arn = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *GetScheduleGroupOutput) SetCreationDate(v time.Time) *GetScheduleGroupOutput { - s.CreationDate = &v - return s -} - -// SetLastModificationDate sets the LastModificationDate field's value. -func (s *GetScheduleGroupOutput) SetLastModificationDate(v time.Time) *GetScheduleGroupOutput { - s.LastModificationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetScheduleGroupOutput) SetName(v string) *GetScheduleGroupOutput { - s.Name = &v - return s -} - -// SetState sets the State field's value. -func (s *GetScheduleGroupOutput) SetState(v string) *GetScheduleGroupOutput { - s.State = &v - return s -} - -type GetScheduleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the schedule group associated with this schedule. If you omit - // this, EventBridge Scheduler assumes that the schedule is associated with - // the default group. - GroupName *string `location:"querystring" locationName:"groupName" min:"1" type:"string"` - - // The name of the schedule to retrieve. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" 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 GetScheduleInput) 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 GetScheduleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetScheduleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetScheduleInput"} - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *GetScheduleInput) SetGroupName(v string) *GetScheduleInput { - s.GroupName = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetScheduleInput) SetName(v string) *GetScheduleInput { - s.Name = &v - return s -} - -type GetScheduleOutput struct { - _ struct{} `type:"structure"` - - // Indicates the action that EventBridge Scheduler applies to the schedule after - // the schedule completes invoking the target. - ActionAfterCompletion *string `type:"string" enum:"ActionAfterCompletion"` - - // The Amazon Resource Name (ARN) of the schedule. - Arn *string `min:"1" type:"string"` - - // The time at which the schedule was created. - CreationDate *time.Time `type:"timestamp"` - - // The description of the schedule. - Description *string `type:"string"` - - // The date, in UTC, before which the schedule can invoke its target. Depending - // on the schedule's recurrence expression, invocations might stop on, or before, - // the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time - // schedules. - EndDate *time.Time `type:"timestamp"` - - // Allows you to configure a time window during which EventBridge Scheduler - // invokes the schedule. - FlexibleTimeWindow *FlexibleTimeWindow `type:"structure"` - - // The name of the schedule group associated with this schedule. - GroupName *string `min:"1" type:"string"` - - // The ARN for a customer managed KMS Key that is be used to encrypt and decrypt - // your data. - KmsKeyArn *string `min:"1" type:"string"` - - // The time at which the schedule was last modified. - LastModificationDate *time.Time `type:"timestamp"` - - // The name of the schedule. - Name *string `min:"1" type:"string"` - - // The expression that defines when the schedule runs. The following formats - // are supported. - // - // * at expression - at(yyyy-mm-ddThh:mm:ss) - // - // * rate expression - rate(value unit) - // - // * cron expression - cron(fields) - // - // You can use at expressions to create one-time schedules that invoke a target - // once, at the time and in the time zone, that you specify. You can use rate - // and cron expressions to create recurring schedules. Rate-based schedules - // are useful when you want to invoke a target at regular intervals, such as - // every 15 minutes or every five days. Cron-based schedules are useful when - // you want to invoke a target periodically at a specific time, such as at 8:00 - // am (UTC+0) every 1st day of the month. - // - // A cron expression consists of six fields separated by white spaces: (minutes - // hours day_of_month month day_of_week year). - // - // A rate expression consists of a value as a positive integer, and a unit with - // the following options: minute | minutes | hour | hours | day | days - // - // For more information and examples, see Schedule types on EventBridge Scheduler - // (https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html) - // in the EventBridge Scheduler User Guide. - ScheduleExpression *string `min:"1" type:"string"` - - // The timezone in which the scheduling expression is evaluated. - ScheduleExpressionTimezone *string `min:"1" type:"string"` - - // The date, in UTC, after which the schedule can begin invoking its target. - // Depending on the schedule's recurrence expression, invocations might occur - // on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate - // for one-time schedules. - StartDate *time.Time `type:"timestamp"` - - // Specifies whether the schedule is enabled or disabled. - State *string `type:"string" enum:"ScheduleState"` - - // The schedule target. - Target *Target `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 GetScheduleOutput) 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 GetScheduleOutput) GoString() string { - return s.String() -} - -// SetActionAfterCompletion sets the ActionAfterCompletion field's value. -func (s *GetScheduleOutput) SetActionAfterCompletion(v string) *GetScheduleOutput { - s.ActionAfterCompletion = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetScheduleOutput) SetArn(v string) *GetScheduleOutput { - s.Arn = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *GetScheduleOutput) SetCreationDate(v time.Time) *GetScheduleOutput { - s.CreationDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetScheduleOutput) SetDescription(v string) *GetScheduleOutput { - s.Description = &v - return s -} - -// SetEndDate sets the EndDate field's value. -func (s *GetScheduleOutput) SetEndDate(v time.Time) *GetScheduleOutput { - s.EndDate = &v - return s -} - -// SetFlexibleTimeWindow sets the FlexibleTimeWindow field's value. -func (s *GetScheduleOutput) SetFlexibleTimeWindow(v *FlexibleTimeWindow) *GetScheduleOutput { - s.FlexibleTimeWindow = v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *GetScheduleOutput) SetGroupName(v string) *GetScheduleOutput { - s.GroupName = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *GetScheduleOutput) SetKmsKeyArn(v string) *GetScheduleOutput { - s.KmsKeyArn = &v - return s -} - -// SetLastModificationDate sets the LastModificationDate field's value. -func (s *GetScheduleOutput) SetLastModificationDate(v time.Time) *GetScheduleOutput { - s.LastModificationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetScheduleOutput) SetName(v string) *GetScheduleOutput { - s.Name = &v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *GetScheduleOutput) SetScheduleExpression(v string) *GetScheduleOutput { - s.ScheduleExpression = &v - return s -} - -// SetScheduleExpressionTimezone sets the ScheduleExpressionTimezone field's value. -func (s *GetScheduleOutput) SetScheduleExpressionTimezone(v string) *GetScheduleOutput { - s.ScheduleExpressionTimezone = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *GetScheduleOutput) SetStartDate(v time.Time) *GetScheduleOutput { - s.StartDate = &v - return s -} - -// SetState sets the State field's value. -func (s *GetScheduleOutput) SetState(v string) *GetScheduleOutput { - s.State = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *GetScheduleOutput) SetTarget(v *Target) *GetScheduleOutput { - s.Target = v - return s -} - -// Unexpected error encountered while processing the request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The templated target type for the Amazon Kinesis PutRecord (kinesis/latest/APIReference/API_PutRecord.html) -// API operation. -type KinesisParameters struct { - _ struct{} `type:"structure"` - - // Specifies the shard to which EventBridge Scheduler sends the event. For more - // information, see Amazon Kinesis Data Streams terminology and concepts (https://docs.aws.amazon.com/streams/latest/dev/key-concepts.html) - // in the Amazon Kinesis Streams Developer Guide. - // - // PartitionKey is a required field - PartitionKey *string `min:"1" 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 KinesisParameters) 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 KinesisParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *KinesisParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KinesisParameters"} - if s.PartitionKey == nil { - invalidParams.Add(request.NewErrParamRequired("PartitionKey")) - } - if s.PartitionKey != nil && len(*s.PartitionKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PartitionKey", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPartitionKey sets the PartitionKey field's value. -func (s *KinesisParameters) SetPartitionKey(v string) *KinesisParameters { - s.PartitionKey = &v - return s -} - -type ListScheduleGroupsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // If specified, limits the number of results returned by this operation. The - // operation also returns a NextToken which you can use in a subsequent operation - // to retrieve the next set of results. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // The name prefix that you can use to return a filtered list of your schedule - // groups. - NamePrefix *string `location:"querystring" locationName:"NamePrefix" min:"1" type:"string"` - - // The token returned by a previous call to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"NextToken" min:"1" 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 ListScheduleGroupsInput) 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 ListScheduleGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListScheduleGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListScheduleGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListScheduleGroupsInput) SetMaxResults(v int64) *ListScheduleGroupsInput { - s.MaxResults = &v - return s -} - -// SetNamePrefix sets the NamePrefix field's value. -func (s *ListScheduleGroupsInput) SetNamePrefix(v string) *ListScheduleGroupsInput { - s.NamePrefix = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListScheduleGroupsInput) SetNextToken(v string) *ListScheduleGroupsInput { - s.NextToken = &v - return s -} - -type ListScheduleGroupsOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether there are additional results to retrieve. If the value - // is null, there are no more results. - NextToken *string `min:"1" type:"string"` - - // The schedule groups that match the specified criteria. - // - // ScheduleGroups is a required field - ScheduleGroups []*ScheduleGroupSummary `type:"list" 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 ListScheduleGroupsOutput) 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 ListScheduleGroupsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListScheduleGroupsOutput) SetNextToken(v string) *ListScheduleGroupsOutput { - s.NextToken = &v - return s -} - -// SetScheduleGroups sets the ScheduleGroups field's value. -func (s *ListScheduleGroupsOutput) SetScheduleGroups(v []*ScheduleGroupSummary) *ListScheduleGroupsOutput { - s.ScheduleGroups = v - return s -} - -type ListSchedulesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // If specified, only lists the schedules whose associated schedule group matches - // the given filter. - GroupName *string `location:"querystring" locationName:"ScheduleGroup" min:"1" type:"string"` - - // If specified, limits the number of results returned by this operation. The - // operation also returns a NextToken which you can use in a subsequent operation - // to retrieve the next set of results. - MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - - // Schedule name prefix to return the filtered list of resources. - NamePrefix *string `location:"querystring" locationName:"NamePrefix" min:"1" type:"string"` - - // The token returned by a previous call to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"NextToken" min:"1" type:"string"` - - // If specified, only lists the schedules whose current state matches the given - // filter. - State *string `location:"querystring" locationName:"State" type:"string" enum:"ScheduleState"` -} - -// 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 ListSchedulesInput) 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 ListSchedulesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSchedulesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSchedulesInput"} - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NamePrefix != nil && len(*s.NamePrefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NamePrefix", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupName sets the GroupName field's value. -func (s *ListSchedulesInput) SetGroupName(v string) *ListSchedulesInput { - s.GroupName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSchedulesInput) SetMaxResults(v int64) *ListSchedulesInput { - s.MaxResults = &v - return s -} - -// SetNamePrefix sets the NamePrefix field's value. -func (s *ListSchedulesInput) SetNamePrefix(v string) *ListSchedulesInput { - s.NamePrefix = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSchedulesInput) SetNextToken(v string) *ListSchedulesInput { - s.NextToken = &v - return s -} - -// SetState sets the State field's value. -func (s *ListSchedulesInput) SetState(v string) *ListSchedulesInput { - s.State = &v - return s -} - -type ListSchedulesOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether there are additional results to retrieve. If the value - // is null, there are no more results. - NextToken *string `min:"1" type:"string"` - - // The schedules that match the specified criteria. - // - // Schedules is a required field - Schedules []*ScheduleSummary `type:"list" 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 ListSchedulesOutput) 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 ListSchedulesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSchedulesOutput) SetNextToken(v string) *ListSchedulesOutput { - s.NextToken = &v - return s -} - -// SetSchedules sets the Schedules field's value. -func (s *ListSchedulesOutput) SetSchedules(v []*ScheduleSummary) *ListSchedulesOutput { - s.Schedules = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ARN of the EventBridge Scheduler resource for which you want to view - // tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The list of tags associated with the specified resource. - Tags []*Tag `type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Specifies the network configuration for an ECS task. -type NetworkConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies the Amazon VPC subnets and security groups for the task, and whether - // a public IP address is to be used. This structure is relevant only for ECS - // tasks that use the awsvpc network mode. - AwsvpcConfiguration *AwsVpcConfiguration `locationName:"awsvpcConfiguration" 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 NetworkConfiguration) 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 NetworkConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NetworkConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NetworkConfiguration"} - if s.AwsvpcConfiguration != nil { - if err := s.AwsvpcConfiguration.Validate(); err != nil { - invalidParams.AddNested("AwsvpcConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsvpcConfiguration sets the AwsvpcConfiguration field's value. -func (s *NetworkConfiguration) SetAwsvpcConfiguration(v *AwsVpcConfiguration) *NetworkConfiguration { - s.AwsvpcConfiguration = v - return s -} - -// An object representing a constraint on task placement. -type PlacementConstraint struct { - _ struct{} `type:"structure"` - - // A cluster query language expression to apply to the constraint. You cannot - // specify an expression if the constraint type is distinctInstance. For more - // information, see Cluster query language (https://docs.aws.amazon.com/latest/developerguide/cluster-query-language.html) - // in the Amazon ECS Developer Guide. - Expression *string `locationName:"expression" type:"string"` - - // The type of constraint. Use distinctInstance to ensure that each task in - // a particular group is running on a different container instance. Use memberOf - // to restrict the selection to a group of valid candidates. - Type *string `locationName:"type" type:"string" enum:"PlacementConstraintType"` -} - -// 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 PlacementConstraint) 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 PlacementConstraint) GoString() string { - return s.String() -} - -// SetExpression sets the Expression field's value. -func (s *PlacementConstraint) SetExpression(v string) *PlacementConstraint { - s.Expression = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlacementConstraint) SetType(v string) *PlacementConstraint { - s.Type = &v - return s -} - -// The task placement strategy for a task or service. -type PlacementStrategy struct { - _ struct{} `type:"structure"` - - // The field to apply the placement strategy against. For the spread placement - // strategy, valid values are instanceId (or instanceId, which has the same - // effect), or any platform or custom attribute that is applied to a container - // instance, such as attribute:ecs.availability-zone. For the binpack placement - // strategy, valid values are cpu and memory. For the random placement strategy, - // this field is not used. - Field *string `locationName:"field" type:"string"` - - // The type of placement strategy. The random placement strategy randomly places - // tasks on available candidates. The spread placement strategy spreads placement - // across available candidates evenly based on the field parameter. The binpack - // strategy places tasks on available candidates that have the least available - // amount of the resource that is specified with the field parameter. For example, - // if you binpack on memory, a task is placed on the instance with the least - // amount of remaining memory (but still enough to run the task). - Type *string `locationName:"type" type:"string" enum:"PlacementStrategyType"` -} - -// 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 PlacementStrategy) 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 PlacementStrategy) GoString() string { - return s.String() -} - -// SetField sets the Field field's value. -func (s *PlacementStrategy) SetField(v string) *PlacementStrategy { - s.Field = &v - return s -} - -// SetType sets the Type field's value. -func (s *PlacementStrategy) SetType(v string) *PlacementStrategy { - s.Type = &v - return s -} - -// The request references a resource which does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A RetryPolicy object that includes information about the retry policy settings, -// including the maximum age of an event, and the maximum number of times EventBridge -// Scheduler will try to deliver the event to a target. -type RetryPolicy struct { - _ struct{} `type:"structure"` - - // The maximum amount of time, in seconds, to continue to make retry attempts. - MaximumEventAgeInSeconds *int64 `min:"60" type:"integer"` - - // The maximum number of retry attempts to make before the request fails. Retry - // attempts with exponential backoff continue until either the maximum number - // of attempts is made or until the duration of the MaximumEventAgeInSeconds - // is reached. - MaximumRetryAttempts *int64 `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 RetryPolicy) 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 RetryPolicy) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RetryPolicy) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RetryPolicy"} - if s.MaximumEventAgeInSeconds != nil && *s.MaximumEventAgeInSeconds < 60 { - invalidParams.Add(request.NewErrParamMinValue("MaximumEventAgeInSeconds", 60)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaximumEventAgeInSeconds sets the MaximumEventAgeInSeconds field's value. -func (s *RetryPolicy) SetMaximumEventAgeInSeconds(v int64) *RetryPolicy { - s.MaximumEventAgeInSeconds = &v - return s -} - -// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. -func (s *RetryPolicy) SetMaximumRetryAttempts(v int64) *RetryPolicy { - s.MaximumRetryAttempts = &v - return s -} - -// The name and value pair of a parameter to use to start execution of a SageMaker -// Model Building Pipeline. -type SageMakerPipelineParameter struct { - _ struct{} `type:"structure"` - - // Name of parameter to start execution of a SageMaker Model Building Pipeline. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Value of parameter to start execution of a SageMaker Model Building Pipeline. - // - // Value is a required field - Value *string `min:"1" 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 SageMakerPipelineParameter) 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 SageMakerPipelineParameter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SageMakerPipelineParameter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SageMakerPipelineParameter"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *SageMakerPipelineParameter) SetName(v string) *SageMakerPipelineParameter { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *SageMakerPipelineParameter) SetValue(v string) *SageMakerPipelineParameter { - s.Value = &v - return s -} - -// The templated target type for the Amazon SageMaker StartPipelineExecution -// (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html) -// API operation. -type SageMakerPipelineParameters struct { - _ struct{} `type:"structure"` - - // List of parameter names and values to use when executing the SageMaker Model - // Building Pipeline. - PipelineParameterList []*SageMakerPipelineParameter `type:"list"` -} - -// 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 SageMakerPipelineParameters) 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 SageMakerPipelineParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SageMakerPipelineParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SageMakerPipelineParameters"} - if s.PipelineParameterList != nil { - for i, v := range s.PipelineParameterList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PipelineParameterList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPipelineParameterList sets the PipelineParameterList field's value. -func (s *SageMakerPipelineParameters) SetPipelineParameterList(v []*SageMakerPipelineParameter) *SageMakerPipelineParameters { - s.PipelineParameterList = v - return s -} - -// The details of a schedule group. -type ScheduleGroupSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the schedule group. - Arn *string `min:"1" type:"string"` - - // The time at which the schedule group was created. - CreationDate *time.Time `type:"timestamp"` - - // The time at which the schedule group was last modified. - LastModificationDate *time.Time `type:"timestamp"` - - // The name of the schedule group. - Name *string `min:"1" type:"string"` - - // Specifies the state of the schedule group. - State *string `type:"string" enum:"ScheduleGroupState"` -} - -// 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 ScheduleGroupSummary) 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 ScheduleGroupSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ScheduleGroupSummary) SetArn(v string) *ScheduleGroupSummary { - s.Arn = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *ScheduleGroupSummary) SetCreationDate(v time.Time) *ScheduleGroupSummary { - s.CreationDate = &v - return s -} - -// SetLastModificationDate sets the LastModificationDate field's value. -func (s *ScheduleGroupSummary) SetLastModificationDate(v time.Time) *ScheduleGroupSummary { - s.LastModificationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *ScheduleGroupSummary) SetName(v string) *ScheduleGroupSummary { - s.Name = &v - return s -} - -// SetState sets the State field's value. -func (s *ScheduleGroupSummary) SetState(v string) *ScheduleGroupSummary { - s.State = &v - return s -} - -// The details of a schedule. -type ScheduleSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the schedule. - Arn *string `min:"1" type:"string"` - - // The time at which the schedule was created. - CreationDate *time.Time `type:"timestamp"` - - // The name of the schedule group associated with this schedule. - GroupName *string `min:"1" type:"string"` - - // The time at which the schedule was last modified. - LastModificationDate *time.Time `type:"timestamp"` - - // The name of the schedule. - Name *string `min:"1" type:"string"` - - // Specifies whether the schedule is enabled or disabled. - State *string `type:"string" enum:"ScheduleState"` - - // The schedule's target details. - Target *TargetSummary `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 ScheduleSummary) 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 ScheduleSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ScheduleSummary) SetArn(v string) *ScheduleSummary { - s.Arn = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *ScheduleSummary) SetCreationDate(v time.Time) *ScheduleSummary { - s.CreationDate = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *ScheduleSummary) SetGroupName(v string) *ScheduleSummary { - s.GroupName = &v - return s -} - -// SetLastModificationDate sets the LastModificationDate field's value. -func (s *ScheduleSummary) SetLastModificationDate(v time.Time) *ScheduleSummary { - s.LastModificationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *ScheduleSummary) SetName(v string) *ScheduleSummary { - s.Name = &v - return s -} - -// SetState sets the State field's value. -func (s *ScheduleSummary) SetState(v string) *ScheduleSummary { - s.State = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *ScheduleSummary) SetTarget(v *TargetSummary) *ScheduleSummary { - s.Target = v - return s -} - -// The request exceeds a service quota. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The templated target type for the Amazon SQS SendMessage (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) -// API operation. Contains the message group ID to use when the target is a -// FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue -// must have content-based deduplication enabled. For more information, see -// Using the Amazon SQS message deduplication ID (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) -// in the Amazon SQS Developer Guide. -type SqsParameters struct { - _ struct{} `type:"structure"` - - // The FIFO message group ID to use as the target. - MessageGroupId *string `min:"1" 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 SqsParameters) 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 SqsParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SqsParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SqsParameters"} - if s.MessageGroupId != nil && len(*s.MessageGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MessageGroupId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMessageGroupId sets the MessageGroupId field's value. -func (s *SqsParameters) SetMessageGroupId(v string) *SqsParameters { - s.MessageGroupId = &v - return s -} - -// Tag to associate with a schedule group. -type Tag struct { - _ struct{} `type:"structure"` - - // The key for the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value for the tag. - // - // Value is a required field - Value *string `min:"1" 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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the schedule group that you are adding - // tags to. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"1" type:"string" required:"true"` - - // The list of tags to associate with the schedule group. - // - // Tags is a required field - Tags []*Tag `type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The schedule's target. EventBridge Scheduler supports templated target that -// invoke common API operations, as well as universal targets that you can customize -// to invoke over 6,000 API operations across more than 270 services. You can -// only specify one templated or universal target for a schedule. -type Target struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target. - // - // Arn is a required field - Arn *string `min:"1" type:"string" required:"true"` - - // An object that contains information about an Amazon SQS queue that EventBridge - // Scheduler uses as a dead-letter queue for your schedule. If specified, EventBridge - // Scheduler delivers failed events that could not be successfully delivered - // to a target to the queue. - DeadLetterConfig *DeadLetterConfig `type:"structure"` - - // The templated target type for the Amazon ECS RunTask (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html) - // API operation. - EcsParameters *EcsParameters `type:"structure"` - - // The templated target type for the EventBridge PutEvents (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutEvents.html) - // API operation. - EventBridgeParameters *EventBridgeParameters `type:"structure"` - - // The text, or well-formed JSON, passed to the target. If you are configuring - // a templated Lambda, AWS Step Functions, or Amazon EventBridge target, the - // input must be a well-formed JSON. For all other target types, a JSON is not - // required. If you do not specify anything for this field, EventBridge Scheduler - // delivers a default notification to the target. - Input *string `min:"1" type:"string"` - - // The templated target type for the Amazon Kinesis PutRecord (kinesis/latest/APIReference/API_PutRecord.html) - // API operation. - KinesisParameters *KinesisParameters `type:"structure"` - - // A RetryPolicy object that includes information about the retry policy settings, - // including the maximum age of an event, and the maximum number of times EventBridge - // Scheduler will try to deliver the event to a target. - RetryPolicy *RetryPolicy `type:"structure"` - - // The Amazon Resource Name (ARN) of the IAM role that EventBridge Scheduler - // will use for this target when the schedule is invoked. - // - // RoleArn is a required field - RoleArn *string `min:"1" type:"string" required:"true"` - - // The templated target type for the Amazon SageMaker StartPipelineExecution - // (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StartPipelineExecution.html) - // API operation. - SageMakerPipelineParameters *SageMakerPipelineParameters `type:"structure"` - - // The templated target type for the Amazon SQS SendMessage (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html) - // API operation. Contains the message group ID to use when the target is a - // FIFO queue. If you specify an Amazon SQS FIFO queue as a target, the queue - // must have content-based deduplication enabled. For more information, see - // Using the Amazon SQS message deduplication ID (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) - // in the Amazon SQS Developer Guide. - SqsParameters *SqsParameters `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 Target) 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 Target) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Target) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Target"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) - } - if s.Input != nil && len(*s.Input) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Input", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) - } - if s.DeadLetterConfig != nil { - if err := s.DeadLetterConfig.Validate(); err != nil { - invalidParams.AddNested("DeadLetterConfig", err.(request.ErrInvalidParams)) - } - } - if s.EcsParameters != nil { - if err := s.EcsParameters.Validate(); err != nil { - invalidParams.AddNested("EcsParameters", err.(request.ErrInvalidParams)) - } - } - if s.EventBridgeParameters != nil { - if err := s.EventBridgeParameters.Validate(); err != nil { - invalidParams.AddNested("EventBridgeParameters", err.(request.ErrInvalidParams)) - } - } - if s.KinesisParameters != nil { - if err := s.KinesisParameters.Validate(); err != nil { - invalidParams.AddNested("KinesisParameters", err.(request.ErrInvalidParams)) - } - } - if s.RetryPolicy != nil { - if err := s.RetryPolicy.Validate(); err != nil { - invalidParams.AddNested("RetryPolicy", err.(request.ErrInvalidParams)) - } - } - if s.SageMakerPipelineParameters != nil { - if err := s.SageMakerPipelineParameters.Validate(); err != nil { - invalidParams.AddNested("SageMakerPipelineParameters", err.(request.ErrInvalidParams)) - } - } - if s.SqsParameters != nil { - if err := s.SqsParameters.Validate(); err != nil { - invalidParams.AddNested("SqsParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetArn sets the Arn field's value. -func (s *Target) SetArn(v string) *Target { - s.Arn = &v - return s -} - -// SetDeadLetterConfig sets the DeadLetterConfig field's value. -func (s *Target) SetDeadLetterConfig(v *DeadLetterConfig) *Target { - s.DeadLetterConfig = v - return s -} - -// SetEcsParameters sets the EcsParameters field's value. -func (s *Target) SetEcsParameters(v *EcsParameters) *Target { - s.EcsParameters = v - return s -} - -// SetEventBridgeParameters sets the EventBridgeParameters field's value. -func (s *Target) SetEventBridgeParameters(v *EventBridgeParameters) *Target { - s.EventBridgeParameters = v - return s -} - -// SetInput sets the Input field's value. -func (s *Target) SetInput(v string) *Target { - s.Input = &v - return s -} - -// SetKinesisParameters sets the KinesisParameters field's value. -func (s *Target) SetKinesisParameters(v *KinesisParameters) *Target { - s.KinesisParameters = v - return s -} - -// SetRetryPolicy sets the RetryPolicy field's value. -func (s *Target) SetRetryPolicy(v *RetryPolicy) *Target { - s.RetryPolicy = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *Target) SetRoleArn(v string) *Target { - s.RoleArn = &v - return s -} - -// SetSageMakerPipelineParameters sets the SageMakerPipelineParameters field's value. -func (s *Target) SetSageMakerPipelineParameters(v *SageMakerPipelineParameters) *Target { - s.SageMakerPipelineParameters = v - return s -} - -// SetSqsParameters sets the SqsParameters field's value. -func (s *Target) SetSqsParameters(v *SqsParameters) *Target { - s.SqsParameters = v - return s -} - -// The details of a target. -type TargetSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target. - // - // Arn is a required field - Arn *string `min:"1" 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 TargetSummary) 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 TargetSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *TargetSummary) SetArn(v string) *TargetSummary { - s.Arn = &v - return s -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the schedule group from which you are removing - // tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" min:"1" type:"string" required:"true"` - - // The list of tag keys to remove from the resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"TagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateScheduleInput struct { - _ struct{} `type:"structure"` - - // Specifies the action that EventBridge Scheduler applies to the schedule after - // the schedule completes invoking the target. - ActionAfterCompletion *string `type:"string" enum:"ActionAfterCompletion"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. If you do not specify a client token, EventBridge Scheduler - // uses a randomly generated token for the request to ensure idempotency. - ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // The description you specify for the schedule. - Description *string `type:"string"` - - // The date, in UTC, before which the schedule can invoke its target. Depending - // on the schedule's recurrence expression, invocations might stop on, or before, - // the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time - // schedules. - EndDate *time.Time `type:"timestamp"` - - // Allows you to configure a time window during which EventBridge Scheduler - // invokes the schedule. - // - // FlexibleTimeWindow is a required field - FlexibleTimeWindow *FlexibleTimeWindow `type:"structure" required:"true"` - - // The name of the schedule group with which the schedule is associated. You - // must provide this value in order for EventBridge Scheduler to find the schedule - // you want to update. If you omit this value, EventBridge Scheduler assumes - // the group is associated to the default group. - GroupName *string `min:"1" type:"string"` - - // The ARN for the customer managed KMS key that that you want EventBridge Scheduler - // to use to encrypt and decrypt your data. - KmsKeyArn *string `min:"1" type:"string"` - - // The name of the schedule that you are updating. - // - // Name is a required field - Name *string `location:"uri" locationName:"Name" min:"1" type:"string" required:"true"` - - // The expression that defines when the schedule runs. The following formats - // are supported. - // - // * at expression - at(yyyy-mm-ddThh:mm:ss) - // - // * rate expression - rate(value unit) - // - // * cron expression - cron(fields) - // - // You can use at expressions to create one-time schedules that invoke a target - // once, at the time and in the time zone, that you specify. You can use rate - // and cron expressions to create recurring schedules. Rate-based schedules - // are useful when you want to invoke a target at regular intervals, such as - // every 15 minutes or every five days. Cron-based schedules are useful when - // you want to invoke a target periodically at a specific time, such as at 8:00 - // am (UTC+0) every 1st day of the month. - // - // A cron expression consists of six fields separated by white spaces: (minutes - // hours day_of_month month day_of_week year). - // - // A rate expression consists of a value as a positive integer, and a unit with - // the following options: minute | minutes | hour | hours | day | days - // - // For more information and examples, see Schedule types on EventBridge Scheduler - // (https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html) - // in the EventBridge Scheduler User Guide. - // - // ScheduleExpression is a required field - ScheduleExpression *string `min:"1" type:"string" required:"true"` - - // The timezone in which the scheduling expression is evaluated. - ScheduleExpressionTimezone *string `min:"1" type:"string"` - - // The date, in UTC, after which the schedule can begin invoking its target. - // Depending on the schedule's recurrence expression, invocations might occur - // on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate - // for one-time schedules. - StartDate *time.Time `type:"timestamp"` - - // Specifies whether the schedule is enabled or disabled. - State *string `type:"string" enum:"ScheduleState"` - - // The schedule target. You can use this operation to change the target that - // your schedule invokes. - // - // Target is a required field - Target *Target `type:"structure" 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 UpdateScheduleInput) 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 UpdateScheduleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateScheduleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateScheduleInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.FlexibleTimeWindow == nil { - invalidParams.Add(request.NewErrParamRequired("FlexibleTimeWindow")) - } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) - } - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ScheduleExpression == nil { - invalidParams.Add(request.NewErrParamRequired("ScheduleExpression")) - } - if s.ScheduleExpression != nil && len(*s.ScheduleExpression) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduleExpression", 1)) - } - if s.ScheduleExpressionTimezone != nil && len(*s.ScheduleExpressionTimezone) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ScheduleExpressionTimezone", 1)) - } - if s.Target == nil { - invalidParams.Add(request.NewErrParamRequired("Target")) - } - if s.FlexibleTimeWindow != nil { - if err := s.FlexibleTimeWindow.Validate(); err != nil { - invalidParams.AddNested("FlexibleTimeWindow", err.(request.ErrInvalidParams)) - } - } - if s.Target != nil { - if err := s.Target.Validate(); err != nil { - invalidParams.AddNested("Target", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionAfterCompletion sets the ActionAfterCompletion field's value. -func (s *UpdateScheduleInput) SetActionAfterCompletion(v string) *UpdateScheduleInput { - s.ActionAfterCompletion = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *UpdateScheduleInput) SetClientToken(v string) *UpdateScheduleInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdateScheduleInput) SetDescription(v string) *UpdateScheduleInput { - s.Description = &v - return s -} - -// SetEndDate sets the EndDate field's value. -func (s *UpdateScheduleInput) SetEndDate(v time.Time) *UpdateScheduleInput { - s.EndDate = &v - return s -} - -// SetFlexibleTimeWindow sets the FlexibleTimeWindow field's value. -func (s *UpdateScheduleInput) SetFlexibleTimeWindow(v *FlexibleTimeWindow) *UpdateScheduleInput { - s.FlexibleTimeWindow = v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *UpdateScheduleInput) SetGroupName(v string) *UpdateScheduleInput { - s.GroupName = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *UpdateScheduleInput) SetKmsKeyArn(v string) *UpdateScheduleInput { - s.KmsKeyArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateScheduleInput) SetName(v string) *UpdateScheduleInput { - s.Name = &v - return s -} - -// SetScheduleExpression sets the ScheduleExpression field's value. -func (s *UpdateScheduleInput) SetScheduleExpression(v string) *UpdateScheduleInput { - s.ScheduleExpression = &v - return s -} - -// SetScheduleExpressionTimezone sets the ScheduleExpressionTimezone field's value. -func (s *UpdateScheduleInput) SetScheduleExpressionTimezone(v string) *UpdateScheduleInput { - s.ScheduleExpressionTimezone = &v - return s -} - -// SetStartDate sets the StartDate field's value. -func (s *UpdateScheduleInput) SetStartDate(v time.Time) *UpdateScheduleInput { - s.StartDate = &v - return s -} - -// SetState sets the State field's value. -func (s *UpdateScheduleInput) SetState(v string) *UpdateScheduleInput { - s.State = &v - return s -} - -// SetTarget sets the Target field's value. -func (s *UpdateScheduleInput) SetTarget(v *Target) *UpdateScheduleInput { - s.Target = v - return s -} - -type UpdateScheduleOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the schedule that you updated. - // - // ScheduleArn is a required field - ScheduleArn *string `min:"1" 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 UpdateScheduleOutput) 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 UpdateScheduleOutput) GoString() string { - return s.String() -} - -// SetScheduleArn sets the ScheduleArn field's value. -func (s *UpdateScheduleOutput) SetScheduleArn(v string) *UpdateScheduleOutput { - s.ScheduleArn = &v - return s -} - -// The input fails to satisfy the constraints specified by an AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // ActionAfterCompletionNone is a ActionAfterCompletion enum value - ActionAfterCompletionNone = "NONE" - - // ActionAfterCompletionDelete is a ActionAfterCompletion enum value - ActionAfterCompletionDelete = "DELETE" -) - -// ActionAfterCompletion_Values returns all elements of the ActionAfterCompletion enum -func ActionAfterCompletion_Values() []string { - return []string{ - ActionAfterCompletionNone, - ActionAfterCompletionDelete, - } -} - -const ( - // AssignPublicIpEnabled is a AssignPublicIp enum value - AssignPublicIpEnabled = "ENABLED" - - // AssignPublicIpDisabled is a AssignPublicIp enum value - AssignPublicIpDisabled = "DISABLED" -) - -// AssignPublicIp_Values returns all elements of the AssignPublicIp enum -func AssignPublicIp_Values() []string { - return []string{ - AssignPublicIpEnabled, - AssignPublicIpDisabled, - } -} - -const ( - // FlexibleTimeWindowModeOff is a FlexibleTimeWindowMode enum value - FlexibleTimeWindowModeOff = "OFF" - - // FlexibleTimeWindowModeFlexible is a FlexibleTimeWindowMode enum value - FlexibleTimeWindowModeFlexible = "FLEXIBLE" -) - -// FlexibleTimeWindowMode_Values returns all elements of the FlexibleTimeWindowMode enum -func FlexibleTimeWindowMode_Values() []string { - return []string{ - FlexibleTimeWindowModeOff, - FlexibleTimeWindowModeFlexible, - } -} - -const ( - // LaunchTypeEc2 is a LaunchType enum value - LaunchTypeEc2 = "EC2" - - // LaunchTypeFargate is a LaunchType enum value - LaunchTypeFargate = "FARGATE" - - // LaunchTypeExternal is a LaunchType enum value - LaunchTypeExternal = "EXTERNAL" -) - -// LaunchType_Values returns all elements of the LaunchType enum -func LaunchType_Values() []string { - return []string{ - LaunchTypeEc2, - LaunchTypeFargate, - LaunchTypeExternal, - } -} - -const ( - // PlacementConstraintTypeDistinctInstance is a PlacementConstraintType enum value - PlacementConstraintTypeDistinctInstance = "distinctInstance" - - // PlacementConstraintTypeMemberOf is a PlacementConstraintType enum value - PlacementConstraintTypeMemberOf = "memberOf" -) - -// PlacementConstraintType_Values returns all elements of the PlacementConstraintType enum -func PlacementConstraintType_Values() []string { - return []string{ - PlacementConstraintTypeDistinctInstance, - PlacementConstraintTypeMemberOf, - } -} - -const ( - // PlacementStrategyTypeRandom is a PlacementStrategyType enum value - PlacementStrategyTypeRandom = "random" - - // PlacementStrategyTypeSpread is a PlacementStrategyType enum value - PlacementStrategyTypeSpread = "spread" - - // PlacementStrategyTypeBinpack is a PlacementStrategyType enum value - PlacementStrategyTypeBinpack = "binpack" -) - -// PlacementStrategyType_Values returns all elements of the PlacementStrategyType enum -func PlacementStrategyType_Values() []string { - return []string{ - PlacementStrategyTypeRandom, - PlacementStrategyTypeSpread, - PlacementStrategyTypeBinpack, - } -} - -const ( - // PropagateTagsTaskDefinition is a PropagateTags enum value - PropagateTagsTaskDefinition = "TASK_DEFINITION" -) - -// PropagateTags_Values returns all elements of the PropagateTags enum -func PropagateTags_Values() []string { - return []string{ - PropagateTagsTaskDefinition, - } -} - -const ( - // ScheduleGroupStateActive is a ScheduleGroupState enum value - ScheduleGroupStateActive = "ACTIVE" - - // ScheduleGroupStateDeleting is a ScheduleGroupState enum value - ScheduleGroupStateDeleting = "DELETING" -) - -// ScheduleGroupState_Values returns all elements of the ScheduleGroupState enum -func ScheduleGroupState_Values() []string { - return []string{ - ScheduleGroupStateActive, - ScheduleGroupStateDeleting, - } -} - -const ( - // ScheduleStateEnabled is a ScheduleState enum value - ScheduleStateEnabled = "ENABLED" - - // ScheduleStateDisabled is a ScheduleState enum value - ScheduleStateDisabled = "DISABLED" -) - -// ScheduleState_Values returns all elements of the ScheduleState enum -func ScheduleState_Values() []string { - return []string{ - ScheduleStateEnabled, - ScheduleStateDisabled, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/doc.go deleted file mode 100644 index fd7250046dcf..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/doc.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package scheduler provides the client and types for making API -// requests to Amazon EventBridge Scheduler. -// -// Amazon EventBridge Scheduler is a serverless scheduler that allows you to -// create, run, and manage tasks from one central, managed service. EventBridge -// Scheduler delivers your tasks reliably, with built-in mechanisms that adjust -// your schedules based on the availability of downstream targets. The following -// reference lists the available API actions, and data types for EventBridge -// Scheduler. -// -// See https://docs.aws.amazon.com/goto/WebAPI/scheduler-2021-06-30 for more information on this service. -// -// See scheduler package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/scheduler/ -// -// # Using the Client -// -// To contact Amazon EventBridge Scheduler with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon EventBridge Scheduler client Scheduler for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/scheduler/#New -package scheduler diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/errors.go deleted file mode 100644 index d94ef9c82985..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/errors.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package scheduler - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Updating or deleting the resource can cause an inconsistent state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Unexpected error encountered while processing the request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request references a resource which does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request exceeds a service quota. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/scheduleriface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/scheduleriface/interface.go deleted file mode 100644 index ebf726dcaf03..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/scheduleriface/interface.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package scheduleriface provides an interface to enable mocking the Amazon EventBridge Scheduler service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package scheduleriface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler" -) - -// SchedulerAPI provides an interface to enable mocking the -// scheduler.Scheduler service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon EventBridge Scheduler. -// func myFunc(svc scheduleriface.SchedulerAPI) bool { -// // Make svc.CreateSchedule request -// } -// -// func main() { -// sess := session.New() -// svc := scheduler.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSchedulerClient struct { -// scheduleriface.SchedulerAPI -// } -// func (m *mockSchedulerClient) CreateSchedule(input *scheduler.CreateScheduleInput) (*scheduler.CreateScheduleOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSchedulerClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type SchedulerAPI interface { - CreateSchedule(*scheduler.CreateScheduleInput) (*scheduler.CreateScheduleOutput, error) - CreateScheduleWithContext(aws.Context, *scheduler.CreateScheduleInput, ...request.Option) (*scheduler.CreateScheduleOutput, error) - CreateScheduleRequest(*scheduler.CreateScheduleInput) (*request.Request, *scheduler.CreateScheduleOutput) - - CreateScheduleGroup(*scheduler.CreateScheduleGroupInput) (*scheduler.CreateScheduleGroupOutput, error) - CreateScheduleGroupWithContext(aws.Context, *scheduler.CreateScheduleGroupInput, ...request.Option) (*scheduler.CreateScheduleGroupOutput, error) - CreateScheduleGroupRequest(*scheduler.CreateScheduleGroupInput) (*request.Request, *scheduler.CreateScheduleGroupOutput) - - DeleteSchedule(*scheduler.DeleteScheduleInput) (*scheduler.DeleteScheduleOutput, error) - DeleteScheduleWithContext(aws.Context, *scheduler.DeleteScheduleInput, ...request.Option) (*scheduler.DeleteScheduleOutput, error) - DeleteScheduleRequest(*scheduler.DeleteScheduleInput) (*request.Request, *scheduler.DeleteScheduleOutput) - - DeleteScheduleGroup(*scheduler.DeleteScheduleGroupInput) (*scheduler.DeleteScheduleGroupOutput, error) - DeleteScheduleGroupWithContext(aws.Context, *scheduler.DeleteScheduleGroupInput, ...request.Option) (*scheduler.DeleteScheduleGroupOutput, error) - DeleteScheduleGroupRequest(*scheduler.DeleteScheduleGroupInput) (*request.Request, *scheduler.DeleteScheduleGroupOutput) - - GetSchedule(*scheduler.GetScheduleInput) (*scheduler.GetScheduleOutput, error) - GetScheduleWithContext(aws.Context, *scheduler.GetScheduleInput, ...request.Option) (*scheduler.GetScheduleOutput, error) - GetScheduleRequest(*scheduler.GetScheduleInput) (*request.Request, *scheduler.GetScheduleOutput) - - GetScheduleGroup(*scheduler.GetScheduleGroupInput) (*scheduler.GetScheduleGroupOutput, error) - GetScheduleGroupWithContext(aws.Context, *scheduler.GetScheduleGroupInput, ...request.Option) (*scheduler.GetScheduleGroupOutput, error) - GetScheduleGroupRequest(*scheduler.GetScheduleGroupInput) (*request.Request, *scheduler.GetScheduleGroupOutput) - - ListScheduleGroups(*scheduler.ListScheduleGroupsInput) (*scheduler.ListScheduleGroupsOutput, error) - ListScheduleGroupsWithContext(aws.Context, *scheduler.ListScheduleGroupsInput, ...request.Option) (*scheduler.ListScheduleGroupsOutput, error) - ListScheduleGroupsRequest(*scheduler.ListScheduleGroupsInput) (*request.Request, *scheduler.ListScheduleGroupsOutput) - - ListScheduleGroupsPages(*scheduler.ListScheduleGroupsInput, func(*scheduler.ListScheduleGroupsOutput, bool) bool) error - ListScheduleGroupsPagesWithContext(aws.Context, *scheduler.ListScheduleGroupsInput, func(*scheduler.ListScheduleGroupsOutput, bool) bool, ...request.Option) error - - ListSchedules(*scheduler.ListSchedulesInput) (*scheduler.ListSchedulesOutput, error) - ListSchedulesWithContext(aws.Context, *scheduler.ListSchedulesInput, ...request.Option) (*scheduler.ListSchedulesOutput, error) - ListSchedulesRequest(*scheduler.ListSchedulesInput) (*request.Request, *scheduler.ListSchedulesOutput) - - ListSchedulesPages(*scheduler.ListSchedulesInput, func(*scheduler.ListSchedulesOutput, bool) bool) error - ListSchedulesPagesWithContext(aws.Context, *scheduler.ListSchedulesInput, func(*scheduler.ListSchedulesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*scheduler.ListTagsForResourceInput) (*scheduler.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *scheduler.ListTagsForResourceInput, ...request.Option) (*scheduler.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*scheduler.ListTagsForResourceInput) (*request.Request, *scheduler.ListTagsForResourceOutput) - - TagResource(*scheduler.TagResourceInput) (*scheduler.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *scheduler.TagResourceInput, ...request.Option) (*scheduler.TagResourceOutput, error) - TagResourceRequest(*scheduler.TagResourceInput) (*request.Request, *scheduler.TagResourceOutput) - - UntagResource(*scheduler.UntagResourceInput) (*scheduler.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *scheduler.UntagResourceInput, ...request.Option) (*scheduler.UntagResourceOutput, error) - UntagResourceRequest(*scheduler.UntagResourceInput) (*request.Request, *scheduler.UntagResourceOutput) - - UpdateSchedule(*scheduler.UpdateScheduleInput) (*scheduler.UpdateScheduleOutput, error) - UpdateScheduleWithContext(aws.Context, *scheduler.UpdateScheduleInput, ...request.Option) (*scheduler.UpdateScheduleOutput, error) - UpdateScheduleRequest(*scheduler.UpdateScheduleInput) (*request.Request, *scheduler.UpdateScheduleOutput) -} - -var _ SchedulerAPI = (*scheduler.Scheduler)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/service.go deleted file mode 100644 index 33a502bd5a38..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/scheduler/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package scheduler - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// Scheduler provides the API operation methods for making requests to -// Amazon EventBridge Scheduler. See this package's package overview docs -// for details on the service. -// -// Scheduler methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type Scheduler struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Scheduler" // Name of service. - EndpointsID = "scheduler" // ID to lookup a service endpoint with. - ServiceID = "Scheduler" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the Scheduler client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a Scheduler client from just a session. -// svc := scheduler.New(mySession) -// -// // Create a Scheduler client with additional configuration -// svc := scheduler.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Scheduler { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "scheduler" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *Scheduler { - svc := &Scheduler{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-06-30", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Scheduler operation and runs any -// custom request initialization. -func (c *Scheduler) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/api.go deleted file mode 100644 index a92857b8f0df..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/api.go +++ /dev/null @@ -1,8840 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package securitylake - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateAwsLogSource = "CreateAwsLogSource" - -// CreateAwsLogSourceRequest generates a "aws/request.Request" representing the -// client's request for the CreateAwsLogSource 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 CreateAwsLogSource for more information on using the CreateAwsLogSource -// 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 CreateAwsLogSourceRequest method. -// req, resp := client.CreateAwsLogSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateAwsLogSource -func (c *SecurityLake) CreateAwsLogSourceRequest(input *CreateAwsLogSourceInput) (req *request.Request, output *CreateAwsLogSourceOutput) { - op := &request.Operation{ - Name: opCreateAwsLogSource, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/logsources/aws", - } - - if input == nil { - input = &CreateAwsLogSourceInput{} - } - - output = &CreateAwsLogSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAwsLogSource API operation for Amazon Security Lake. -// -// Adds a natively supported Amazon Web Service as an Amazon Security Lake source. -// Enables source types for member accounts in required Amazon Web Services -// Regions, based on the parameters you specify. You can choose any source type -// in any Region for either accounts that are part of a trusted organization -// or standalone accounts. Once you add an Amazon Web Service as a source, Security -// Lake starts collecting logs and events from it. -// -// You can use this API only to enable natively supported Amazon Web Services -// as a source. Use CreateCustomLogSource to enable data collection from a custom -// source. -// -// 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 Security Lake's -// API operation CreateAwsLogSource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateAwsLogSource -func (c *SecurityLake) CreateAwsLogSource(input *CreateAwsLogSourceInput) (*CreateAwsLogSourceOutput, error) { - req, out := c.CreateAwsLogSourceRequest(input) - return out, req.Send() -} - -// CreateAwsLogSourceWithContext is the same as CreateAwsLogSource with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAwsLogSource 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 *SecurityLake) CreateAwsLogSourceWithContext(ctx aws.Context, input *CreateAwsLogSourceInput, opts ...request.Option) (*CreateAwsLogSourceOutput, error) { - req, out := c.CreateAwsLogSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateCustomLogSource = "CreateCustomLogSource" - -// CreateCustomLogSourceRequest generates a "aws/request.Request" representing the -// client's request for the CreateCustomLogSource 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 CreateCustomLogSource for more information on using the CreateCustomLogSource -// 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 CreateCustomLogSourceRequest method. -// req, resp := client.CreateCustomLogSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateCustomLogSource -func (c *SecurityLake) CreateCustomLogSourceRequest(input *CreateCustomLogSourceInput) (req *request.Request, output *CreateCustomLogSourceOutput) { - op := &request.Operation{ - Name: opCreateCustomLogSource, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/logsources/custom", - } - - if input == nil { - input = &CreateCustomLogSourceInput{} - } - - output = &CreateCustomLogSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateCustomLogSource API operation for Amazon Security Lake. -// -// Adds a third-party custom source in Amazon Security Lake, from the Amazon -// Web Services Region where you want to create a custom source. Security Lake -// can collect logs and events from third-party custom sources. After creating -// the appropriate IAM role to invoke Glue crawler, use this API to add a custom -// source name in Security Lake. This operation creates a partition in the Amazon -// S3 bucket for Security Lake as the target location for log files from the -// custom source. In addition, this operation also creates an associated Glue -// table and an Glue crawler. -// -// 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 Security Lake's -// API operation CreateCustomLogSource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateCustomLogSource -func (c *SecurityLake) CreateCustomLogSource(input *CreateCustomLogSourceInput) (*CreateCustomLogSourceOutput, error) { - req, out := c.CreateCustomLogSourceRequest(input) - return out, req.Send() -} - -// CreateCustomLogSourceWithContext is the same as CreateCustomLogSource with the addition of -// the ability to pass a context and additional request options. -// -// See CreateCustomLogSource 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 *SecurityLake) CreateCustomLogSourceWithContext(ctx aws.Context, input *CreateCustomLogSourceInput, opts ...request.Option) (*CreateCustomLogSourceOutput, error) { - req, out := c.CreateCustomLogSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDataLake = "CreateDataLake" - -// CreateDataLakeRequest generates a "aws/request.Request" representing the -// client's request for the CreateDataLake 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 CreateDataLake for more information on using the CreateDataLake -// 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 CreateDataLakeRequest method. -// req, resp := client.CreateDataLakeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateDataLake -func (c *SecurityLake) CreateDataLakeRequest(input *CreateDataLakeInput) (req *request.Request, output *CreateDataLakeOutput) { - op := &request.Operation{ - Name: opCreateDataLake, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake", - } - - if input == nil { - input = &CreateDataLakeInput{} - } - - output = &CreateDataLakeOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateDataLake API operation for Amazon Security Lake. -// -// Initializes an Amazon Security Lake instance with the provided (or default) -// configuration. You can enable Security Lake in Amazon Web Services Regions -// with customized settings before enabling log collection in Regions. To specify -// particular Regions, configure these Regions using the configurations parameter. -// If you have already enabled Security Lake in a Region when you call this -// command, the command will update the Region if you provide new configuration -// parameters. If you have not already enabled Security Lake in the Region when -// you call this API, it will set up the data lake in the Region with the specified -// configurations. -// -// When you enable Security Lake, it starts ingesting security data after the -// CreateAwsLogSource call. This includes ingesting security data from sources, -// storing data, and making data accessible to subscribers. Security Lake also -// enables all the existing settings and resources that it stores or maintains -// for your Amazon Web Services account in the current Region, including security -// log and event data. For more information, see the Amazon Security Lake User -// Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/what-is-security-lake.html). -// -// 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 Security Lake's -// API operation CreateDataLake for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateDataLake -func (c *SecurityLake) CreateDataLake(input *CreateDataLakeInput) (*CreateDataLakeOutput, error) { - req, out := c.CreateDataLakeRequest(input) - return out, req.Send() -} - -// CreateDataLakeWithContext is the same as CreateDataLake with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDataLake 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 *SecurityLake) CreateDataLakeWithContext(ctx aws.Context, input *CreateDataLakeInput, opts ...request.Option) (*CreateDataLakeOutput, error) { - req, out := c.CreateDataLakeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDataLakeExceptionSubscription = "CreateDataLakeExceptionSubscription" - -// CreateDataLakeExceptionSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the CreateDataLakeExceptionSubscription 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 CreateDataLakeExceptionSubscription for more information on using the CreateDataLakeExceptionSubscription -// 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 CreateDataLakeExceptionSubscriptionRequest method. -// req, resp := client.CreateDataLakeExceptionSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateDataLakeExceptionSubscription -func (c *SecurityLake) CreateDataLakeExceptionSubscriptionRequest(input *CreateDataLakeExceptionSubscriptionInput) (req *request.Request, output *CreateDataLakeExceptionSubscriptionOutput) { - op := &request.Operation{ - Name: opCreateDataLakeExceptionSubscription, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/exceptions/subscription", - } - - if input == nil { - input = &CreateDataLakeExceptionSubscriptionInput{} - } - - output = &CreateDataLakeExceptionSubscriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateDataLakeExceptionSubscription API operation for Amazon Security Lake. -// -// Creates the specified notification subscription in Amazon Security Lake for -// the organization you specify. -// -// 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 Security Lake's -// API operation CreateDataLakeExceptionSubscription for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateDataLakeExceptionSubscription -func (c *SecurityLake) CreateDataLakeExceptionSubscription(input *CreateDataLakeExceptionSubscriptionInput) (*CreateDataLakeExceptionSubscriptionOutput, error) { - req, out := c.CreateDataLakeExceptionSubscriptionRequest(input) - return out, req.Send() -} - -// CreateDataLakeExceptionSubscriptionWithContext is the same as CreateDataLakeExceptionSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDataLakeExceptionSubscription 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 *SecurityLake) CreateDataLakeExceptionSubscriptionWithContext(ctx aws.Context, input *CreateDataLakeExceptionSubscriptionInput, opts ...request.Option) (*CreateDataLakeExceptionSubscriptionOutput, error) { - req, out := c.CreateDataLakeExceptionSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDataLakeOrganizationConfiguration = "CreateDataLakeOrganizationConfiguration" - -// CreateDataLakeOrganizationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the CreateDataLakeOrganizationConfiguration 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 CreateDataLakeOrganizationConfiguration for more information on using the CreateDataLakeOrganizationConfiguration -// 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 CreateDataLakeOrganizationConfigurationRequest method. -// req, resp := client.CreateDataLakeOrganizationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateDataLakeOrganizationConfiguration -func (c *SecurityLake) CreateDataLakeOrganizationConfigurationRequest(input *CreateDataLakeOrganizationConfigurationInput) (req *request.Request, output *CreateDataLakeOrganizationConfigurationOutput) { - op := &request.Operation{ - Name: opCreateDataLakeOrganizationConfiguration, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/organization/configuration", - } - - if input == nil { - input = &CreateDataLakeOrganizationConfigurationInput{} - } - - output = &CreateDataLakeOrganizationConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateDataLakeOrganizationConfiguration API operation for Amazon Security Lake. -// -// Automatically enables Amazon Security Lake for new member accounts in your -// organization. Security Lake is not automatically enabled for any existing -// member accounts in your organization. -// -// 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 Security Lake's -// API operation CreateDataLakeOrganizationConfiguration for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateDataLakeOrganizationConfiguration -func (c *SecurityLake) CreateDataLakeOrganizationConfiguration(input *CreateDataLakeOrganizationConfigurationInput) (*CreateDataLakeOrganizationConfigurationOutput, error) { - req, out := c.CreateDataLakeOrganizationConfigurationRequest(input) - return out, req.Send() -} - -// CreateDataLakeOrganizationConfigurationWithContext is the same as CreateDataLakeOrganizationConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDataLakeOrganizationConfiguration 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 *SecurityLake) CreateDataLakeOrganizationConfigurationWithContext(ctx aws.Context, input *CreateDataLakeOrganizationConfigurationInput, opts ...request.Option) (*CreateDataLakeOrganizationConfigurationOutput, error) { - req, out := c.CreateDataLakeOrganizationConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSubscriber = "CreateSubscriber" - -// CreateSubscriberRequest generates a "aws/request.Request" representing the -// client's request for the CreateSubscriber 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 CreateSubscriber for more information on using the CreateSubscriber -// 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 CreateSubscriberRequest method. -// req, resp := client.CreateSubscriberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateSubscriber -func (c *SecurityLake) CreateSubscriberRequest(input *CreateSubscriberInput) (req *request.Request, output *CreateSubscriberOutput) { - op := &request.Operation{ - Name: opCreateSubscriber, - HTTPMethod: "POST", - HTTPPath: "/v1/subscribers", - } - - if input == nil { - input = &CreateSubscriberInput{} - } - - output = &CreateSubscriberOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSubscriber API operation for Amazon Security Lake. -// -// Creates a subscription permission for accounts that are already enabled in -// Amazon Security Lake. You can create a subscriber with access to data in -// the current Amazon Web Services Region. -// -// 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 Security Lake's -// API operation CreateSubscriber for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateSubscriber -func (c *SecurityLake) CreateSubscriber(input *CreateSubscriberInput) (*CreateSubscriberOutput, error) { - req, out := c.CreateSubscriberRequest(input) - return out, req.Send() -} - -// CreateSubscriberWithContext is the same as CreateSubscriber with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSubscriber 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 *SecurityLake) CreateSubscriberWithContext(ctx aws.Context, input *CreateSubscriberInput, opts ...request.Option) (*CreateSubscriberOutput, error) { - req, out := c.CreateSubscriberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSubscriberNotification = "CreateSubscriberNotification" - -// CreateSubscriberNotificationRequest generates a "aws/request.Request" representing the -// client's request for the CreateSubscriberNotification 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 CreateSubscriberNotification for more information on using the CreateSubscriberNotification -// 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 CreateSubscriberNotificationRequest method. -// req, resp := client.CreateSubscriberNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateSubscriberNotification -func (c *SecurityLake) CreateSubscriberNotificationRequest(input *CreateSubscriberNotificationInput) (req *request.Request, output *CreateSubscriberNotificationOutput) { - op := &request.Operation{ - Name: opCreateSubscriberNotification, - HTTPMethod: "POST", - HTTPPath: "/v1/subscribers/{subscriberId}/notification", - } - - if input == nil { - input = &CreateSubscriberNotificationInput{} - } - - output = &CreateSubscriberNotificationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSubscriberNotification API operation for Amazon Security Lake. -// -// Notifies the subscriber when new data is written to the data lake for the -// sources that the subscriber consumes in Security Lake. You can create only -// one subscriber notification per subscriber. -// -// 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 Security Lake's -// API operation CreateSubscriberNotification for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/CreateSubscriberNotification -func (c *SecurityLake) CreateSubscriberNotification(input *CreateSubscriberNotificationInput) (*CreateSubscriberNotificationOutput, error) { - req, out := c.CreateSubscriberNotificationRequest(input) - return out, req.Send() -} - -// CreateSubscriberNotificationWithContext is the same as CreateSubscriberNotification with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSubscriberNotification 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 *SecurityLake) CreateSubscriberNotificationWithContext(ctx aws.Context, input *CreateSubscriberNotificationInput, opts ...request.Option) (*CreateSubscriberNotificationOutput, error) { - req, out := c.CreateSubscriberNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAwsLogSource = "DeleteAwsLogSource" - -// DeleteAwsLogSourceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAwsLogSource 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 DeleteAwsLogSource for more information on using the DeleteAwsLogSource -// 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 DeleteAwsLogSourceRequest method. -// req, resp := client.DeleteAwsLogSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteAwsLogSource -func (c *SecurityLake) DeleteAwsLogSourceRequest(input *DeleteAwsLogSourceInput) (req *request.Request, output *DeleteAwsLogSourceOutput) { - op := &request.Operation{ - Name: opDeleteAwsLogSource, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/logsources/aws/delete", - } - - if input == nil { - input = &DeleteAwsLogSourceInput{} - } - - output = &DeleteAwsLogSourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteAwsLogSource API operation for Amazon Security Lake. -// -// Removes a natively supported Amazon Web Service as an Amazon Security Lake -// source. You can remove a source for one or more Regions. When you remove -// the source, Security Lake stops collecting data from that source in the specified -// Regions and accounts, and subscribers can no longer consume new data from -// the source. However, subscribers can still consume data that Security Lake -// collected from the source before removal. -// -// You can choose any source type in any Amazon Web Services Region for either -// accounts that are part of a trusted organization or standalone accounts. -// -// 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 Security Lake's -// API operation DeleteAwsLogSource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteAwsLogSource -func (c *SecurityLake) DeleteAwsLogSource(input *DeleteAwsLogSourceInput) (*DeleteAwsLogSourceOutput, error) { - req, out := c.DeleteAwsLogSourceRequest(input) - return out, req.Send() -} - -// DeleteAwsLogSourceWithContext is the same as DeleteAwsLogSource with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAwsLogSource 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 *SecurityLake) DeleteAwsLogSourceWithContext(ctx aws.Context, input *DeleteAwsLogSourceInput, opts ...request.Option) (*DeleteAwsLogSourceOutput, error) { - req, out := c.DeleteAwsLogSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteCustomLogSource = "DeleteCustomLogSource" - -// DeleteCustomLogSourceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCustomLogSource 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 DeleteCustomLogSource for more information on using the DeleteCustomLogSource -// 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 DeleteCustomLogSourceRequest method. -// req, resp := client.DeleteCustomLogSourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteCustomLogSource -func (c *SecurityLake) DeleteCustomLogSourceRequest(input *DeleteCustomLogSourceInput) (req *request.Request, output *DeleteCustomLogSourceOutput) { - op := &request.Operation{ - Name: opDeleteCustomLogSource, - HTTPMethod: "DELETE", - HTTPPath: "/v1/datalake/logsources/custom/{sourceName}", - } - - if input == nil { - input = &DeleteCustomLogSourceInput{} - } - - output = &DeleteCustomLogSourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteCustomLogSource API operation for Amazon Security Lake. -// -// Removes a custom log source from Amazon Security Lake, to stop sending data -// from the custom source to Security Lake. -// -// 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 Security Lake's -// API operation DeleteCustomLogSource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteCustomLogSource -func (c *SecurityLake) DeleteCustomLogSource(input *DeleteCustomLogSourceInput) (*DeleteCustomLogSourceOutput, error) { - req, out := c.DeleteCustomLogSourceRequest(input) - return out, req.Send() -} - -// DeleteCustomLogSourceWithContext is the same as DeleteCustomLogSource with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteCustomLogSource 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 *SecurityLake) DeleteCustomLogSourceWithContext(ctx aws.Context, input *DeleteCustomLogSourceInput, opts ...request.Option) (*DeleteCustomLogSourceOutput, error) { - req, out := c.DeleteCustomLogSourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDataLake = "DeleteDataLake" - -// DeleteDataLakeRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDataLake 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 DeleteDataLake for more information on using the DeleteDataLake -// 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 DeleteDataLakeRequest method. -// req, resp := client.DeleteDataLakeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteDataLake -func (c *SecurityLake) DeleteDataLakeRequest(input *DeleteDataLakeInput) (req *request.Request, output *DeleteDataLakeOutput) { - op := &request.Operation{ - Name: opDeleteDataLake, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/delete", - } - - if input == nil { - input = &DeleteDataLakeInput{} - } - - output = &DeleteDataLakeOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDataLake API operation for Amazon Security Lake. -// -// When you disable Amazon Security Lake from your account, Security Lake is -// disabled in all Amazon Web Services Regions and it stops collecting data -// from your sources. Also, this API automatically takes steps to remove the -// account from Security Lake. However, Security Lake retains all of your existing -// settings and the resources that it created in your Amazon Web Services account -// in the current Amazon Web Services Region. -// -// The DeleteDataLake operation does not delete the data that is stored in your -// Amazon S3 bucket, which is owned by your Amazon Web Services account. For -// more information, see the Amazon Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/disable-security-lake.html). -// -// 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 Security Lake's -// API operation DeleteDataLake for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteDataLake -func (c *SecurityLake) DeleteDataLake(input *DeleteDataLakeInput) (*DeleteDataLakeOutput, error) { - req, out := c.DeleteDataLakeRequest(input) - return out, req.Send() -} - -// DeleteDataLakeWithContext is the same as DeleteDataLake with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDataLake 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 *SecurityLake) DeleteDataLakeWithContext(ctx aws.Context, input *DeleteDataLakeInput, opts ...request.Option) (*DeleteDataLakeOutput, error) { - req, out := c.DeleteDataLakeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDataLakeExceptionSubscription = "DeleteDataLakeExceptionSubscription" - -// DeleteDataLakeExceptionSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDataLakeExceptionSubscription 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 DeleteDataLakeExceptionSubscription for more information on using the DeleteDataLakeExceptionSubscription -// 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 DeleteDataLakeExceptionSubscriptionRequest method. -// req, resp := client.DeleteDataLakeExceptionSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteDataLakeExceptionSubscription -func (c *SecurityLake) DeleteDataLakeExceptionSubscriptionRequest(input *DeleteDataLakeExceptionSubscriptionInput) (req *request.Request, output *DeleteDataLakeExceptionSubscriptionOutput) { - op := &request.Operation{ - Name: opDeleteDataLakeExceptionSubscription, - HTTPMethod: "DELETE", - HTTPPath: "/v1/datalake/exceptions/subscription", - } - - if input == nil { - input = &DeleteDataLakeExceptionSubscriptionInput{} - } - - output = &DeleteDataLakeExceptionSubscriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDataLakeExceptionSubscription API operation for Amazon Security Lake. -// -// Deletes the specified notification subscription in Amazon Security Lake for -// the organization you specify. -// -// 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 Security Lake's -// API operation DeleteDataLakeExceptionSubscription for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteDataLakeExceptionSubscription -func (c *SecurityLake) DeleteDataLakeExceptionSubscription(input *DeleteDataLakeExceptionSubscriptionInput) (*DeleteDataLakeExceptionSubscriptionOutput, error) { - req, out := c.DeleteDataLakeExceptionSubscriptionRequest(input) - return out, req.Send() -} - -// DeleteDataLakeExceptionSubscriptionWithContext is the same as DeleteDataLakeExceptionSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDataLakeExceptionSubscription 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 *SecurityLake) DeleteDataLakeExceptionSubscriptionWithContext(ctx aws.Context, input *DeleteDataLakeExceptionSubscriptionInput, opts ...request.Option) (*DeleteDataLakeExceptionSubscriptionOutput, error) { - req, out := c.DeleteDataLakeExceptionSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDataLakeOrganizationConfiguration = "DeleteDataLakeOrganizationConfiguration" - -// DeleteDataLakeOrganizationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDataLakeOrganizationConfiguration 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 DeleteDataLakeOrganizationConfiguration for more information on using the DeleteDataLakeOrganizationConfiguration -// 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 DeleteDataLakeOrganizationConfigurationRequest method. -// req, resp := client.DeleteDataLakeOrganizationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteDataLakeOrganizationConfiguration -func (c *SecurityLake) DeleteDataLakeOrganizationConfigurationRequest(input *DeleteDataLakeOrganizationConfigurationInput) (req *request.Request, output *DeleteDataLakeOrganizationConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteDataLakeOrganizationConfiguration, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/organization/configuration/delete", - } - - if input == nil { - input = &DeleteDataLakeOrganizationConfigurationInput{} - } - - output = &DeleteDataLakeOrganizationConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteDataLakeOrganizationConfiguration API operation for Amazon Security Lake. -// -// Turns off automatic enablement of Amazon Security Lake for member accounts -// that are added to an organization in Organizations. Only the delegated Security -// Lake administrator for an organization can perform this operation. If the -// delegated Security Lake administrator performs this operation, new member -// accounts won't automatically contribute data to the data lake. -// -// 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 Security Lake's -// API operation DeleteDataLakeOrganizationConfiguration for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteDataLakeOrganizationConfiguration -func (c *SecurityLake) DeleteDataLakeOrganizationConfiguration(input *DeleteDataLakeOrganizationConfigurationInput) (*DeleteDataLakeOrganizationConfigurationOutput, error) { - req, out := c.DeleteDataLakeOrganizationConfigurationRequest(input) - return out, req.Send() -} - -// DeleteDataLakeOrganizationConfigurationWithContext is the same as DeleteDataLakeOrganizationConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDataLakeOrganizationConfiguration 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 *SecurityLake) DeleteDataLakeOrganizationConfigurationWithContext(ctx aws.Context, input *DeleteDataLakeOrganizationConfigurationInput, opts ...request.Option) (*DeleteDataLakeOrganizationConfigurationOutput, error) { - req, out := c.DeleteDataLakeOrganizationConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSubscriber = "DeleteSubscriber" - -// DeleteSubscriberRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSubscriber 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 DeleteSubscriber for more information on using the DeleteSubscriber -// 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 DeleteSubscriberRequest method. -// req, resp := client.DeleteSubscriberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteSubscriber -func (c *SecurityLake) DeleteSubscriberRequest(input *DeleteSubscriberInput) (req *request.Request, output *DeleteSubscriberOutput) { - op := &request.Operation{ - Name: opDeleteSubscriber, - HTTPMethod: "DELETE", - HTTPPath: "/v1/subscribers/{subscriberId}", - } - - if input == nil { - input = &DeleteSubscriberInput{} - } - - output = &DeleteSubscriberOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSubscriber API operation for Amazon Security Lake. -// -// Deletes the subscription permission and all notification settings for accounts -// that are already enabled in Amazon Security Lake. When you run DeleteSubscriber, -// the subscriber will no longer consume data from Security Lake and the subscriber -// is removed. This operation deletes the subscriber and removes access to data -// in the current Amazon Web Services Region. -// -// 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 Security Lake's -// API operation DeleteSubscriber for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteSubscriber -func (c *SecurityLake) DeleteSubscriber(input *DeleteSubscriberInput) (*DeleteSubscriberOutput, error) { - req, out := c.DeleteSubscriberRequest(input) - return out, req.Send() -} - -// DeleteSubscriberWithContext is the same as DeleteSubscriber with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSubscriber 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 *SecurityLake) DeleteSubscriberWithContext(ctx aws.Context, input *DeleteSubscriberInput, opts ...request.Option) (*DeleteSubscriberOutput, error) { - req, out := c.DeleteSubscriberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSubscriberNotification = "DeleteSubscriberNotification" - -// DeleteSubscriberNotificationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSubscriberNotification 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 DeleteSubscriberNotification for more information on using the DeleteSubscriberNotification -// 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 DeleteSubscriberNotificationRequest method. -// req, resp := client.DeleteSubscriberNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteSubscriberNotification -func (c *SecurityLake) DeleteSubscriberNotificationRequest(input *DeleteSubscriberNotificationInput) (req *request.Request, output *DeleteSubscriberNotificationOutput) { - op := &request.Operation{ - Name: opDeleteSubscriberNotification, - HTTPMethod: "DELETE", - HTTPPath: "/v1/subscribers/{subscriberId}/notification", - } - - if input == nil { - input = &DeleteSubscriberNotificationInput{} - } - - output = &DeleteSubscriberNotificationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSubscriberNotification API operation for Amazon Security Lake. -// -// Deletes the specified notification subscription in Amazon Security Lake for -// the organization you specify. -// -// 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 Security Lake's -// API operation DeleteSubscriberNotification for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeleteSubscriberNotification -func (c *SecurityLake) DeleteSubscriberNotification(input *DeleteSubscriberNotificationInput) (*DeleteSubscriberNotificationOutput, error) { - req, out := c.DeleteSubscriberNotificationRequest(input) - return out, req.Send() -} - -// DeleteSubscriberNotificationWithContext is the same as DeleteSubscriberNotification with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSubscriberNotification 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 *SecurityLake) DeleteSubscriberNotificationWithContext(ctx aws.Context, input *DeleteSubscriberNotificationInput, opts ...request.Option) (*DeleteSubscriberNotificationOutput, error) { - req, out := c.DeleteSubscriberNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterDataLakeDelegatedAdministrator = "DeregisterDataLakeDelegatedAdministrator" - -// DeregisterDataLakeDelegatedAdministratorRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterDataLakeDelegatedAdministrator 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 DeregisterDataLakeDelegatedAdministrator for more information on using the DeregisterDataLakeDelegatedAdministrator -// 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 DeregisterDataLakeDelegatedAdministratorRequest method. -// req, resp := client.DeregisterDataLakeDelegatedAdministratorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeregisterDataLakeDelegatedAdministrator -func (c *SecurityLake) DeregisterDataLakeDelegatedAdministratorRequest(input *DeregisterDataLakeDelegatedAdministratorInput) (req *request.Request, output *DeregisterDataLakeDelegatedAdministratorOutput) { - op := &request.Operation{ - Name: opDeregisterDataLakeDelegatedAdministrator, - HTTPMethod: "DELETE", - HTTPPath: "/v1/datalake/delegate", - } - - if input == nil { - input = &DeregisterDataLakeDelegatedAdministratorInput{} - } - - output = &DeregisterDataLakeDelegatedAdministratorOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterDataLakeDelegatedAdministrator API operation for Amazon Security Lake. -// -// Deletes the Amazon Security Lake delegated administrator account for the -// organization. This API can only be called by the organization management -// account. The organization management account cannot be the delegated administrator -// account. -// -// 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 Security Lake's -// API operation DeregisterDataLakeDelegatedAdministrator for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/DeregisterDataLakeDelegatedAdministrator -func (c *SecurityLake) DeregisterDataLakeDelegatedAdministrator(input *DeregisterDataLakeDelegatedAdministratorInput) (*DeregisterDataLakeDelegatedAdministratorOutput, error) { - req, out := c.DeregisterDataLakeDelegatedAdministratorRequest(input) - return out, req.Send() -} - -// DeregisterDataLakeDelegatedAdministratorWithContext is the same as DeregisterDataLakeDelegatedAdministrator with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterDataLakeDelegatedAdministrator 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 *SecurityLake) DeregisterDataLakeDelegatedAdministratorWithContext(ctx aws.Context, input *DeregisterDataLakeDelegatedAdministratorInput, opts ...request.Option) (*DeregisterDataLakeDelegatedAdministratorOutput, error) { - req, out := c.DeregisterDataLakeDelegatedAdministratorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDataLakeExceptionSubscription = "GetDataLakeExceptionSubscription" - -// GetDataLakeExceptionSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the GetDataLakeExceptionSubscription 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 GetDataLakeExceptionSubscription for more information on using the GetDataLakeExceptionSubscription -// 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 GetDataLakeExceptionSubscriptionRequest method. -// req, resp := client.GetDataLakeExceptionSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/GetDataLakeExceptionSubscription -func (c *SecurityLake) GetDataLakeExceptionSubscriptionRequest(input *GetDataLakeExceptionSubscriptionInput) (req *request.Request, output *GetDataLakeExceptionSubscriptionOutput) { - op := &request.Operation{ - Name: opGetDataLakeExceptionSubscription, - HTTPMethod: "GET", - HTTPPath: "/v1/datalake/exceptions/subscription", - } - - if input == nil { - input = &GetDataLakeExceptionSubscriptionInput{} - } - - output = &GetDataLakeExceptionSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataLakeExceptionSubscription API operation for Amazon Security Lake. -// -// Retrieves the details of exception notifications for the account in Amazon -// Security Lake. -// -// 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 Security Lake's -// API operation GetDataLakeExceptionSubscription for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/GetDataLakeExceptionSubscription -func (c *SecurityLake) GetDataLakeExceptionSubscription(input *GetDataLakeExceptionSubscriptionInput) (*GetDataLakeExceptionSubscriptionOutput, error) { - req, out := c.GetDataLakeExceptionSubscriptionRequest(input) - return out, req.Send() -} - -// GetDataLakeExceptionSubscriptionWithContext is the same as GetDataLakeExceptionSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataLakeExceptionSubscription 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 *SecurityLake) GetDataLakeExceptionSubscriptionWithContext(ctx aws.Context, input *GetDataLakeExceptionSubscriptionInput, opts ...request.Option) (*GetDataLakeExceptionSubscriptionOutput, error) { - req, out := c.GetDataLakeExceptionSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDataLakeOrganizationConfiguration = "GetDataLakeOrganizationConfiguration" - -// GetDataLakeOrganizationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetDataLakeOrganizationConfiguration 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 GetDataLakeOrganizationConfiguration for more information on using the GetDataLakeOrganizationConfiguration -// 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 GetDataLakeOrganizationConfigurationRequest method. -// req, resp := client.GetDataLakeOrganizationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/GetDataLakeOrganizationConfiguration -func (c *SecurityLake) GetDataLakeOrganizationConfigurationRequest(input *GetDataLakeOrganizationConfigurationInput) (req *request.Request, output *GetDataLakeOrganizationConfigurationOutput) { - op := &request.Operation{ - Name: opGetDataLakeOrganizationConfiguration, - HTTPMethod: "GET", - HTTPPath: "/v1/datalake/organization/configuration", - } - - if input == nil { - input = &GetDataLakeOrganizationConfigurationInput{} - } - - output = &GetDataLakeOrganizationConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataLakeOrganizationConfiguration API operation for Amazon Security Lake. -// -// Retrieves the configuration that will be automatically set up for accounts -// added to the organization after the organization has onboarded to Amazon -// Security Lake. This API does not take input parameters. -// -// 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 Security Lake's -// API operation GetDataLakeOrganizationConfiguration for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/GetDataLakeOrganizationConfiguration -func (c *SecurityLake) GetDataLakeOrganizationConfiguration(input *GetDataLakeOrganizationConfigurationInput) (*GetDataLakeOrganizationConfigurationOutput, error) { - req, out := c.GetDataLakeOrganizationConfigurationRequest(input) - return out, req.Send() -} - -// GetDataLakeOrganizationConfigurationWithContext is the same as GetDataLakeOrganizationConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataLakeOrganizationConfiguration 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 *SecurityLake) GetDataLakeOrganizationConfigurationWithContext(ctx aws.Context, input *GetDataLakeOrganizationConfigurationInput, opts ...request.Option) (*GetDataLakeOrganizationConfigurationOutput, error) { - req, out := c.GetDataLakeOrganizationConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDataLakeSources = "GetDataLakeSources" - -// GetDataLakeSourcesRequest generates a "aws/request.Request" representing the -// client's request for the GetDataLakeSources 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 GetDataLakeSources for more information on using the GetDataLakeSources -// 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 GetDataLakeSourcesRequest method. -// req, resp := client.GetDataLakeSourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/GetDataLakeSources -func (c *SecurityLake) GetDataLakeSourcesRequest(input *GetDataLakeSourcesInput) (req *request.Request, output *GetDataLakeSourcesOutput) { - op := &request.Operation{ - Name: opGetDataLakeSources, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/sources", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetDataLakeSourcesInput{} - } - - output = &GetDataLakeSourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDataLakeSources API operation for Amazon Security Lake. -// -// Retrieves a snapshot of the current Region, including whether Amazon Security -// Lake is enabled for those accounts and which sources Security Lake is collecting -// data from. -// -// 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 Security Lake's -// API operation GetDataLakeSources for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/GetDataLakeSources -func (c *SecurityLake) GetDataLakeSources(input *GetDataLakeSourcesInput) (*GetDataLakeSourcesOutput, error) { - req, out := c.GetDataLakeSourcesRequest(input) - return out, req.Send() -} - -// GetDataLakeSourcesWithContext is the same as GetDataLakeSources with the addition of -// the ability to pass a context and additional request options. -// -// See GetDataLakeSources 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 *SecurityLake) GetDataLakeSourcesWithContext(ctx aws.Context, input *GetDataLakeSourcesInput, opts ...request.Option) (*GetDataLakeSourcesOutput, error) { - req, out := c.GetDataLakeSourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetDataLakeSourcesPages iterates over the pages of a GetDataLakeSources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetDataLakeSources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetDataLakeSources operation. -// pageNum := 0 -// err := client.GetDataLakeSourcesPages(params, -// func(page *securitylake.GetDataLakeSourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SecurityLake) GetDataLakeSourcesPages(input *GetDataLakeSourcesInput, fn func(*GetDataLakeSourcesOutput, bool) bool) error { - return c.GetDataLakeSourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetDataLakeSourcesPagesWithContext same as GetDataLakeSourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SecurityLake) GetDataLakeSourcesPagesWithContext(ctx aws.Context, input *GetDataLakeSourcesInput, fn func(*GetDataLakeSourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetDataLakeSourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetDataLakeSourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetDataLakeSourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetSubscriber = "GetSubscriber" - -// GetSubscriberRequest generates a "aws/request.Request" representing the -// client's request for the GetSubscriber 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 GetSubscriber for more information on using the GetSubscriber -// 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 GetSubscriberRequest method. -// req, resp := client.GetSubscriberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/GetSubscriber -func (c *SecurityLake) GetSubscriberRequest(input *GetSubscriberInput) (req *request.Request, output *GetSubscriberOutput) { - op := &request.Operation{ - Name: opGetSubscriber, - HTTPMethod: "GET", - HTTPPath: "/v1/subscribers/{subscriberId}", - } - - if input == nil { - input = &GetSubscriberInput{} - } - - output = &GetSubscriberOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSubscriber API operation for Amazon Security Lake. -// -// Retrieves the subscription information for the specified subscription ID. -// You can get information about a specific subscriber. -// -// 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 Security Lake's -// API operation GetSubscriber for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/GetSubscriber -func (c *SecurityLake) GetSubscriber(input *GetSubscriberInput) (*GetSubscriberOutput, error) { - req, out := c.GetSubscriberRequest(input) - return out, req.Send() -} - -// GetSubscriberWithContext is the same as GetSubscriber with the addition of -// the ability to pass a context and additional request options. -// -// See GetSubscriber 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 *SecurityLake) GetSubscriberWithContext(ctx aws.Context, input *GetSubscriberInput, opts ...request.Option) (*GetSubscriberOutput, error) { - req, out := c.GetSubscriberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListDataLakeExceptions = "ListDataLakeExceptions" - -// ListDataLakeExceptionsRequest generates a "aws/request.Request" representing the -// client's request for the ListDataLakeExceptions 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 ListDataLakeExceptions for more information on using the ListDataLakeExceptions -// 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 ListDataLakeExceptionsRequest method. -// req, resp := client.ListDataLakeExceptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListDataLakeExceptions -func (c *SecurityLake) ListDataLakeExceptionsRequest(input *ListDataLakeExceptionsInput) (req *request.Request, output *ListDataLakeExceptionsOutput) { - op := &request.Operation{ - Name: opListDataLakeExceptions, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/exceptions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDataLakeExceptionsInput{} - } - - output = &ListDataLakeExceptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataLakeExceptions API operation for Amazon Security Lake. -// -// Lists the Amazon Security Lake exceptions that you can use to find the source -// of problems and fix them. -// -// 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 Security Lake's -// API operation ListDataLakeExceptions for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListDataLakeExceptions -func (c *SecurityLake) ListDataLakeExceptions(input *ListDataLakeExceptionsInput) (*ListDataLakeExceptionsOutput, error) { - req, out := c.ListDataLakeExceptionsRequest(input) - return out, req.Send() -} - -// ListDataLakeExceptionsWithContext is the same as ListDataLakeExceptions with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataLakeExceptions 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 *SecurityLake) ListDataLakeExceptionsWithContext(ctx aws.Context, input *ListDataLakeExceptionsInput, opts ...request.Option) (*ListDataLakeExceptionsOutput, error) { - req, out := c.ListDataLakeExceptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDataLakeExceptionsPages iterates over the pages of a ListDataLakeExceptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDataLakeExceptions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDataLakeExceptions operation. -// pageNum := 0 -// err := client.ListDataLakeExceptionsPages(params, -// func(page *securitylake.ListDataLakeExceptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SecurityLake) ListDataLakeExceptionsPages(input *ListDataLakeExceptionsInput, fn func(*ListDataLakeExceptionsOutput, bool) bool) error { - return c.ListDataLakeExceptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDataLakeExceptionsPagesWithContext same as ListDataLakeExceptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SecurityLake) ListDataLakeExceptionsPagesWithContext(ctx aws.Context, input *ListDataLakeExceptionsInput, fn func(*ListDataLakeExceptionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDataLakeExceptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDataLakeExceptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDataLakeExceptionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDataLakes = "ListDataLakes" - -// ListDataLakesRequest generates a "aws/request.Request" representing the -// client's request for the ListDataLakes 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 ListDataLakes for more information on using the ListDataLakes -// 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 ListDataLakesRequest method. -// req, resp := client.ListDataLakesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListDataLakes -func (c *SecurityLake) ListDataLakesRequest(input *ListDataLakesInput) (req *request.Request, output *ListDataLakesOutput) { - op := &request.Operation{ - Name: opListDataLakes, - HTTPMethod: "GET", - HTTPPath: "/v1/datalakes", - } - - if input == nil { - input = &ListDataLakesInput{} - } - - output = &ListDataLakesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDataLakes API operation for Amazon Security Lake. -// -// Retrieves the Amazon Security Lake configuration object for the specified -// Amazon Web Services Regions. You can use this operation to determine whether -// Security Lake is enabled for a Region. -// -// 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 Security Lake's -// API operation ListDataLakes for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListDataLakes -func (c *SecurityLake) ListDataLakes(input *ListDataLakesInput) (*ListDataLakesOutput, error) { - req, out := c.ListDataLakesRequest(input) - return out, req.Send() -} - -// ListDataLakesWithContext is the same as ListDataLakes with the addition of -// the ability to pass a context and additional request options. -// -// See ListDataLakes 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 *SecurityLake) ListDataLakesWithContext(ctx aws.Context, input *ListDataLakesInput, opts ...request.Option) (*ListDataLakesOutput, error) { - req, out := c.ListDataLakesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListLogSources = "ListLogSources" - -// ListLogSourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListLogSources 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 ListLogSources for more information on using the ListLogSources -// 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 ListLogSourcesRequest method. -// req, resp := client.ListLogSourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListLogSources -func (c *SecurityLake) ListLogSourcesRequest(input *ListLogSourcesInput) (req *request.Request, output *ListLogSourcesOutput) { - op := &request.Operation{ - Name: opListLogSources, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/logsources/list", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListLogSourcesInput{} - } - - output = &ListLogSourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLogSources API operation for Amazon Security Lake. -// -// Retrieves the log sources in the current Amazon Web Services Region. -// -// 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 Security Lake's -// API operation ListLogSources for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListLogSources -func (c *SecurityLake) ListLogSources(input *ListLogSourcesInput) (*ListLogSourcesOutput, error) { - req, out := c.ListLogSourcesRequest(input) - return out, req.Send() -} - -// ListLogSourcesWithContext is the same as ListLogSources with the addition of -// the ability to pass a context and additional request options. -// -// See ListLogSources 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 *SecurityLake) ListLogSourcesWithContext(ctx aws.Context, input *ListLogSourcesInput, opts ...request.Option) (*ListLogSourcesOutput, error) { - req, out := c.ListLogSourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListLogSourcesPages iterates over the pages of a ListLogSources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLogSources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListLogSources operation. -// pageNum := 0 -// err := client.ListLogSourcesPages(params, -// func(page *securitylake.ListLogSourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SecurityLake) ListLogSourcesPages(input *ListLogSourcesInput, fn func(*ListLogSourcesOutput, bool) bool) error { - return c.ListLogSourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLogSourcesPagesWithContext same as ListLogSourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SecurityLake) ListLogSourcesPagesWithContext(ctx aws.Context, input *ListLogSourcesInput, fn func(*ListLogSourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLogSourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLogSourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListLogSourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSubscribers = "ListSubscribers" - -// ListSubscribersRequest generates a "aws/request.Request" representing the -// client's request for the ListSubscribers 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 ListSubscribers for more information on using the ListSubscribers -// 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 ListSubscribersRequest method. -// req, resp := client.ListSubscribersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListSubscribers -func (c *SecurityLake) ListSubscribersRequest(input *ListSubscribersInput) (req *request.Request, output *ListSubscribersOutput) { - op := &request.Operation{ - Name: opListSubscribers, - HTTPMethod: "GET", - HTTPPath: "/v1/subscribers", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSubscribersInput{} - } - - output = &ListSubscribersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSubscribers API operation for Amazon Security Lake. -// -// List all subscribers for the specific Amazon Security Lake account ID. You -// can retrieve a list of subscriptions associated with a specific organization -// or Amazon Web Services account. -// -// 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 Security Lake's -// API operation ListSubscribers for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListSubscribers -func (c *SecurityLake) ListSubscribers(input *ListSubscribersInput) (*ListSubscribersOutput, error) { - req, out := c.ListSubscribersRequest(input) - return out, req.Send() -} - -// ListSubscribersWithContext is the same as ListSubscribers with the addition of -// the ability to pass a context and additional request options. -// -// See ListSubscribers 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 *SecurityLake) ListSubscribersWithContext(ctx aws.Context, input *ListSubscribersInput, opts ...request.Option) (*ListSubscribersOutput, error) { - req, out := c.ListSubscribersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSubscribersPages iterates over the pages of a ListSubscribers operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscribers method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSubscribers operation. -// pageNum := 0 -// err := client.ListSubscribersPages(params, -// func(page *securitylake.ListSubscribersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SecurityLake) ListSubscribersPages(input *ListSubscribersInput, fn func(*ListSubscribersOutput, bool) bool) error { - return c.ListSubscribersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubscribersPagesWithContext same as ListSubscribersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SecurityLake) ListSubscribersPagesWithContext(ctx aws.Context, input *ListSubscribersInput, fn func(*ListSubscribersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSubscribersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSubscribersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSubscribersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListTagsForResource -func (c *SecurityLake) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/v1/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon Security Lake. -// -// Retrieves the tags (keys and values) that are associated with an Amazon Security -// Lake resource: a subscriber, or the data lake configuration for your Amazon -// Web Services account in a particular Amazon Web Services Region. -// -// 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 Security Lake's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/ListTagsForResource -func (c *SecurityLake) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *SecurityLake) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterDataLakeDelegatedAdministrator = "RegisterDataLakeDelegatedAdministrator" - -// RegisterDataLakeDelegatedAdministratorRequest generates a "aws/request.Request" representing the -// client's request for the RegisterDataLakeDelegatedAdministrator 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 RegisterDataLakeDelegatedAdministrator for more information on using the RegisterDataLakeDelegatedAdministrator -// 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 RegisterDataLakeDelegatedAdministratorRequest method. -// req, resp := client.RegisterDataLakeDelegatedAdministratorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/RegisterDataLakeDelegatedAdministrator -func (c *SecurityLake) RegisterDataLakeDelegatedAdministratorRequest(input *RegisterDataLakeDelegatedAdministratorInput) (req *request.Request, output *RegisterDataLakeDelegatedAdministratorOutput) { - op := &request.Operation{ - Name: opRegisterDataLakeDelegatedAdministrator, - HTTPMethod: "POST", - HTTPPath: "/v1/datalake/delegate", - } - - if input == nil { - input = &RegisterDataLakeDelegatedAdministratorInput{} - } - - output = &RegisterDataLakeDelegatedAdministratorOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// RegisterDataLakeDelegatedAdministrator API operation for Amazon Security Lake. -// -// Designates the Amazon Security Lake delegated administrator account for the -// organization. This API can only be called by the organization management -// account. The organization management account cannot be the delegated administrator -// account. -// -// 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 Security Lake's -// API operation RegisterDataLakeDelegatedAdministrator for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/RegisterDataLakeDelegatedAdministrator -func (c *SecurityLake) RegisterDataLakeDelegatedAdministrator(input *RegisterDataLakeDelegatedAdministratorInput) (*RegisterDataLakeDelegatedAdministratorOutput, error) { - req, out := c.RegisterDataLakeDelegatedAdministratorRequest(input) - return out, req.Send() -} - -// RegisterDataLakeDelegatedAdministratorWithContext is the same as RegisterDataLakeDelegatedAdministrator with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterDataLakeDelegatedAdministrator 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 *SecurityLake) RegisterDataLakeDelegatedAdministratorWithContext(ctx aws.Context, input *RegisterDataLakeDelegatedAdministratorInput, opts ...request.Option) (*RegisterDataLakeDelegatedAdministratorOutput, error) { - req, out := c.RegisterDataLakeDelegatedAdministratorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/TagResource -func (c *SecurityLake) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/v1/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon Security Lake. -// -// Adds or updates one or more tags that are associated with an Amazon Security -// Lake resource: a subscriber, or the data lake configuration for your Amazon -// Web Services account in a particular Amazon Web Services Region. A tag is -// a label that you can define and associate with Amazon Web Services resources. -// Each tag consists of a required tag key and an associated tag value. A tag -// key is a general label that acts as a category for a more specific tag value. -// A tag value acts as a descriptor for a tag key. Tags can help you identify, -// categorize, and manage resources in different ways, such as by owner, environment, -// or other criteria. For more information, see Tagging Amazon Security Lake -// resources (https://docs.aws.amazon.com/security-lake/latest/userguide/tagging-resources.html) -// in the Amazon Security Lake User Guide. -// -// 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 Security Lake's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/TagResource -func (c *SecurityLake) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *SecurityLake) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UntagResource -func (c *SecurityLake) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/v1/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon Security Lake. -// -// Removes one or more tags (keys and values) from an Amazon Security Lake resource: -// a subscriber, or the data lake configuration for your Amazon Web Services -// account in a particular Amazon Web Services Region. -// -// 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 Security Lake's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UntagResource -func (c *SecurityLake) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *SecurityLake) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDataLake = "UpdateDataLake" - -// UpdateDataLakeRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDataLake 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 UpdateDataLake for more information on using the UpdateDataLake -// 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 UpdateDataLakeRequest method. -// req, resp := client.UpdateDataLakeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UpdateDataLake -func (c *SecurityLake) UpdateDataLakeRequest(input *UpdateDataLakeInput) (req *request.Request, output *UpdateDataLakeOutput) { - op := &request.Operation{ - Name: opUpdateDataLake, - HTTPMethod: "PUT", - HTTPPath: "/v1/datalake", - } - - if input == nil { - input = &UpdateDataLakeInput{} - } - - output = &UpdateDataLakeOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateDataLake API operation for Amazon Security Lake. -// -// Specifies where to store your security data and for how long. You can add -// a rollup Region to consolidate data from multiple Amazon Web Services Regions. -// -// 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 Security Lake's -// API operation UpdateDataLake for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UpdateDataLake -func (c *SecurityLake) UpdateDataLake(input *UpdateDataLakeInput) (*UpdateDataLakeOutput, error) { - req, out := c.UpdateDataLakeRequest(input) - return out, req.Send() -} - -// UpdateDataLakeWithContext is the same as UpdateDataLake with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDataLake 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 *SecurityLake) UpdateDataLakeWithContext(ctx aws.Context, input *UpdateDataLakeInput, opts ...request.Option) (*UpdateDataLakeOutput, error) { - req, out := c.UpdateDataLakeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDataLakeExceptionSubscription = "UpdateDataLakeExceptionSubscription" - -// UpdateDataLakeExceptionSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDataLakeExceptionSubscription 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 UpdateDataLakeExceptionSubscription for more information on using the UpdateDataLakeExceptionSubscription -// 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 UpdateDataLakeExceptionSubscriptionRequest method. -// req, resp := client.UpdateDataLakeExceptionSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UpdateDataLakeExceptionSubscription -func (c *SecurityLake) UpdateDataLakeExceptionSubscriptionRequest(input *UpdateDataLakeExceptionSubscriptionInput) (req *request.Request, output *UpdateDataLakeExceptionSubscriptionOutput) { - op := &request.Operation{ - Name: opUpdateDataLakeExceptionSubscription, - HTTPMethod: "PUT", - HTTPPath: "/v1/datalake/exceptions/subscription", - } - - if input == nil { - input = &UpdateDataLakeExceptionSubscriptionInput{} - } - - output = &UpdateDataLakeExceptionSubscriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateDataLakeExceptionSubscription API operation for Amazon Security Lake. -// -// Updates the specified notification subscription in Amazon Security Lake for -// the organization you specify. -// -// 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 Security Lake's -// API operation UpdateDataLakeExceptionSubscription for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UpdateDataLakeExceptionSubscription -func (c *SecurityLake) UpdateDataLakeExceptionSubscription(input *UpdateDataLakeExceptionSubscriptionInput) (*UpdateDataLakeExceptionSubscriptionOutput, error) { - req, out := c.UpdateDataLakeExceptionSubscriptionRequest(input) - return out, req.Send() -} - -// UpdateDataLakeExceptionSubscriptionWithContext is the same as UpdateDataLakeExceptionSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDataLakeExceptionSubscription 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 *SecurityLake) UpdateDataLakeExceptionSubscriptionWithContext(ctx aws.Context, input *UpdateDataLakeExceptionSubscriptionInput, opts ...request.Option) (*UpdateDataLakeExceptionSubscriptionOutput, error) { - req, out := c.UpdateDataLakeExceptionSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSubscriber = "UpdateSubscriber" - -// UpdateSubscriberRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSubscriber 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 UpdateSubscriber for more information on using the UpdateSubscriber -// 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 UpdateSubscriberRequest method. -// req, resp := client.UpdateSubscriberRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UpdateSubscriber -func (c *SecurityLake) UpdateSubscriberRequest(input *UpdateSubscriberInput) (req *request.Request, output *UpdateSubscriberOutput) { - op := &request.Operation{ - Name: opUpdateSubscriber, - HTTPMethod: "PUT", - HTTPPath: "/v1/subscribers/{subscriberId}", - } - - if input == nil { - input = &UpdateSubscriberInput{} - } - - output = &UpdateSubscriberOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSubscriber API operation for Amazon Security Lake. -// -// Updates an existing subscription for the given Amazon Security Lake account -// ID. You can update a subscriber by changing the sources that the subscriber -// consumes data from. -// -// 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 Security Lake's -// API operation UpdateSubscriber for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UpdateSubscriber -func (c *SecurityLake) UpdateSubscriber(input *UpdateSubscriberInput) (*UpdateSubscriberOutput, error) { - req, out := c.UpdateSubscriberRequest(input) - return out, req.Send() -} - -// UpdateSubscriberWithContext is the same as UpdateSubscriber with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSubscriber 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 *SecurityLake) UpdateSubscriberWithContext(ctx aws.Context, input *UpdateSubscriberInput, opts ...request.Option) (*UpdateSubscriberOutput, error) { - req, out := c.UpdateSubscriberRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSubscriberNotification = "UpdateSubscriberNotification" - -// UpdateSubscriberNotificationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSubscriberNotification 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 UpdateSubscriberNotification for more information on using the UpdateSubscriberNotification -// 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 UpdateSubscriberNotificationRequest method. -// req, resp := client.UpdateSubscriberNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UpdateSubscriberNotification -func (c *SecurityLake) UpdateSubscriberNotificationRequest(input *UpdateSubscriberNotificationInput) (req *request.Request, output *UpdateSubscriberNotificationOutput) { - op := &request.Operation{ - Name: opUpdateSubscriberNotification, - HTTPMethod: "PUT", - HTTPPath: "/v1/subscribers/{subscriberId}/notification", - } - - if input == nil { - input = &UpdateSubscriberNotificationInput{} - } - - output = &UpdateSubscriberNotificationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSubscriberNotification API operation for Amazon Security Lake. -// -// Updates an existing notification method for the subscription (SQS or HTTPs -// endpoint) or switches the notification subscription endpoint for a subscriber. -// -// 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 Security Lake's -// API operation UpdateSubscriberNotification for usage and error information. -// -// Returned Error Types: -// -// - BadRequestException -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -// -// - ResourceNotFoundException -// The resource could not be found. -// -// - InternalServerException -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -// -// - ConflictException -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10/UpdateSubscriberNotification -func (c *SecurityLake) UpdateSubscriberNotification(input *UpdateSubscriberNotificationInput) (*UpdateSubscriberNotificationOutput, error) { - req, out := c.UpdateSubscriberNotificationRequest(input) - return out, req.Send() -} - -// UpdateSubscriberNotificationWithContext is the same as UpdateSubscriberNotification with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSubscriberNotification 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 *SecurityLake) UpdateSubscriberNotificationWithContext(ctx aws.Context, input *UpdateSubscriberNotificationInput, opts ...request.Option) (*UpdateSubscriberNotificationOutput, error) { - req, out := c.UpdateSubscriberNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. Access denied errors -// appear when Amazon Security Lake explicitly or implicitly denies an authorization -// request. An explicit denial occurs when a policy contains a Deny statement -// for the specific Amazon Web Services action. An implicit denial occurs when -// there is no applicable Deny statement and also no applicable Allow statement. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // A coded string to provide more information about the access denied exception. - // You can use the error code to check the exception type. - ErrorCode *string `locationName:"errorCode" type:"string"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The AWS identity. -type AwsIdentity struct { - _ struct{} `type:"structure"` - - // The external ID used to estalish trust relationship with the AWS identity. - // - // ExternalId is a required field - ExternalId *string `locationName:"externalId" min:"2" type:"string" required:"true"` - - // The AWS identity principal. - // - // Principal is a required field - Principal *string `locationName:"principal" 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 AwsIdentity) 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 AwsIdentity) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AwsIdentity) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AwsIdentity"} - if s.ExternalId == nil { - invalidParams.Add(request.NewErrParamRequired("ExternalId")) - } - if s.ExternalId != nil && len(*s.ExternalId) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ExternalId", 2)) - } - if s.Principal == nil { - invalidParams.Add(request.NewErrParamRequired("Principal")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExternalId sets the ExternalId field's value. -func (s *AwsIdentity) SetExternalId(v string) *AwsIdentity { - s.ExternalId = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *AwsIdentity) SetPrincipal(v string) *AwsIdentity { - s.Principal = &v - return s -} - -// The Security Lake logs source configuration file describes the information -// needed to generate Security Lake logs. -type AwsLogSourceConfiguration struct { - _ struct{} `type:"structure"` - - // Specify the Amazon Web Services account information where you want to enable - // Security Lake. - Accounts []*string `locationName:"accounts" type:"list"` - - // Specify the Regions where you want to enable Security Lake. - // - // Regions is a required field - Regions []*string `locationName:"regions" type:"list" required:"true"` - - // The name for a Amazon Web Services source. This must be a Regionally unique - // value. - // - // SourceName is a required field - SourceName *string `locationName:"sourceName" type:"string" required:"true" enum:"AwsLogSourceName"` - - // The version for a Amazon Web Services source. This must be a Regionally unique - // value. - SourceVersion *string `locationName:"sourceVersion" 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 AwsLogSourceConfiguration) 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 AwsLogSourceConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AwsLogSourceConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AwsLogSourceConfiguration"} - if s.Regions == nil { - invalidParams.Add(request.NewErrParamRequired("Regions")) - } - if s.SourceName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccounts sets the Accounts field's value. -func (s *AwsLogSourceConfiguration) SetAccounts(v []*string) *AwsLogSourceConfiguration { - s.Accounts = v - return s -} - -// SetRegions sets the Regions field's value. -func (s *AwsLogSourceConfiguration) SetRegions(v []*string) *AwsLogSourceConfiguration { - s.Regions = v - return s -} - -// SetSourceName sets the SourceName field's value. -func (s *AwsLogSourceConfiguration) SetSourceName(v string) *AwsLogSourceConfiguration { - s.SourceName = &v - return s -} - -// SetSourceVersion sets the SourceVersion field's value. -func (s *AwsLogSourceConfiguration) SetSourceVersion(v string) *AwsLogSourceConfiguration { - s.SourceVersion = &v - return s -} - -// Amazon Security Lake can collect logs and events from natively-supported -// Amazon Web Services services. -type AwsLogSourceResource struct { - _ struct{} `type:"structure"` - - // The name for a Amazon Web Services source. This must be a Regionally unique - // value. - SourceName *string `locationName:"sourceName" type:"string" enum:"AwsLogSourceName"` - - // The version for a Amazon Web Services source. This must be a Regionally unique - // value. - SourceVersion *string `locationName:"sourceVersion" 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 AwsLogSourceResource) 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 AwsLogSourceResource) GoString() string { - return s.String() -} - -// SetSourceName sets the SourceName field's value. -func (s *AwsLogSourceResource) SetSourceName(v string) *AwsLogSourceResource { - s.SourceName = &v - return s -} - -// SetSourceVersion sets the SourceVersion field's value. -func (s *AwsLogSourceResource) SetSourceVersion(v string) *AwsLogSourceResource { - s.SourceVersion = &v - return s -} - -// The request is malformed or contains an error such as an invalid parameter -// value or a missing required parameter. -type BadRequestException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 BadRequestException) 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 BadRequestException) GoString() string { - return s.String() -} - -func newErrorBadRequestException(v protocol.ResponseMetadata) error { - return &BadRequestException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *BadRequestException) Code() string { - return "BadRequestException" -} - -// Message returns the exception's message. -func (s *BadRequestException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *BadRequestException) OrigErr() error { - return nil -} - -func (s *BadRequestException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *BadRequestException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *BadRequestException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Occurs when a conflict with a previous successful write is detected. This -// generally occurs when the previous write did not have time to propagate to -// the host serving the current request. A retry (with appropriate backoff logic) -// is the recommended response to this exception. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The resource name. - ResourceName *string `locationName:"resourceName" type:"string"` - - // The resource type. - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateAwsLogSourceInput struct { - _ struct{} `type:"structure"` - - // Specify the natively-supported Amazon Web Services service to add as a source - // in Security Lake. - // - // Sources is a required field - Sources []*AwsLogSourceConfiguration `locationName:"sources" type:"list" 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 CreateAwsLogSourceInput) 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 CreateAwsLogSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAwsLogSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAwsLogSourceInput"} - if s.Sources == nil { - invalidParams.Add(request.NewErrParamRequired("Sources")) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSources sets the Sources field's value. -func (s *CreateAwsLogSourceInput) SetSources(v []*AwsLogSourceConfiguration) *CreateAwsLogSourceInput { - s.Sources = v - return s -} - -type CreateAwsLogSourceOutput struct { - _ struct{} `type:"structure"` - - // Lists all accounts in which enabling a natively supported Amazon Web Service - // as a Security Lake source failed. The failure occurred as these accounts - // are not part of an organization. - Failed []*string `locationName:"failed" type:"list"` -} - -// 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 CreateAwsLogSourceOutput) 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 CreateAwsLogSourceOutput) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *CreateAwsLogSourceOutput) SetFailed(v []*string) *CreateAwsLogSourceOutput { - s.Failed = v - return s -} - -type CreateCustomLogSourceInput struct { - _ struct{} `type:"structure"` - - // The configuration for the third-party custom source. - Configuration *CustomLogSourceConfiguration `locationName:"configuration" type:"structure"` - - // The Open Cybersecurity Schema Framework (OCSF) event classes which describes - // the type of data that the custom source will send to Security Lake. The supported - // event classes are: - // - // * ACCESS_ACTIVITY - // - // * FILE_ACTIVITY - // - // * KERNEL_ACTIVITY - // - // * KERNEL_EXTENSION - // - // * MEMORY_ACTIVITY - // - // * MODULE_ACTIVITY - // - // * PROCESS_ACTIVITY - // - // * REGISTRY_KEY_ACTIVITY - // - // * REGISTRY_VALUE_ACTIVITY - // - // * RESOURCE_ACTIVITY - // - // * SCHEDULED_JOB_ACTIVITY - // - // * SECURITY_FINDING - // - // * ACCOUNT_CHANGE - // - // * AUTHENTICATION - // - // * AUTHORIZATION - // - // * ENTITY_MANAGEMENT_AUDIT - // - // * DHCP_ACTIVITY - // - // * NETWORK_ACTIVITY - // - // * DNS_ACTIVITY - // - // * FTP_ACTIVITY - // - // * HTTP_ACTIVITY - // - // * RDP_ACTIVITY - // - // * SMB_ACTIVITY - // - // * SSH_ACTIVITY - // - // * CONFIG_STATE - // - // * INVENTORY_INFO - // - // * EMAIL_ACTIVITY - // - // * API_ACTIVITY - // - // * CLOUD_API - EventClasses []*string `locationName:"eventClasses" type:"list"` - - // Specify the name for a third-party custom source. This must be a Regionally - // unique value. - // - // SourceName is a required field - SourceName *string `locationName:"sourceName" min:"1" type:"string" required:"true"` - - // Specify the source version for the third-party custom source, to limit log - // collection to a specific version of custom data source. - SourceVersion *string `locationName:"sourceVersion" min:"1" 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 CreateCustomLogSourceInput) 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 CreateCustomLogSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCustomLogSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCustomLogSourceInput"} - if s.SourceName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceName")) - } - if s.SourceName != nil && len(*s.SourceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceName", 1)) - } - if s.SourceVersion != nil && len(*s.SourceVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceVersion", 1)) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguration sets the Configuration field's value. -func (s *CreateCustomLogSourceInput) SetConfiguration(v *CustomLogSourceConfiguration) *CreateCustomLogSourceInput { - s.Configuration = v - return s -} - -// SetEventClasses sets the EventClasses field's value. -func (s *CreateCustomLogSourceInput) SetEventClasses(v []*string) *CreateCustomLogSourceInput { - s.EventClasses = v - return s -} - -// SetSourceName sets the SourceName field's value. -func (s *CreateCustomLogSourceInput) SetSourceName(v string) *CreateCustomLogSourceInput { - s.SourceName = &v - return s -} - -// SetSourceVersion sets the SourceVersion field's value. -func (s *CreateCustomLogSourceInput) SetSourceVersion(v string) *CreateCustomLogSourceInput { - s.SourceVersion = &v - return s -} - -type CreateCustomLogSourceOutput struct { - _ struct{} `type:"structure"` - - // The created third-party custom source. - Source *CustomLogSourceResource `locationName:"source" 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 CreateCustomLogSourceOutput) 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 CreateCustomLogSourceOutput) GoString() string { - return s.String() -} - -// SetSource sets the Source field's value. -func (s *CreateCustomLogSourceOutput) SetSource(v *CustomLogSourceResource) *CreateCustomLogSourceOutput { - s.Source = v - return s -} - -type CreateDataLakeExceptionSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The expiration period and time-to-live (TTL). - ExceptionTimeToLive *int64 `locationName:"exceptionTimeToLive" min:"1" type:"long"` - - // The Amazon Web Services account where you want to receive exception notifications. - // - // NotificationEndpoint is a required field - NotificationEndpoint *string `locationName:"notificationEndpoint" type:"string" required:"true"` - - // The subscription protocol to which exception notifications are posted. - // - // SubscriptionProtocol is a required field - SubscriptionProtocol *string `locationName:"subscriptionProtocol" 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 CreateDataLakeExceptionSubscriptionInput) 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 CreateDataLakeExceptionSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDataLakeExceptionSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDataLakeExceptionSubscriptionInput"} - if s.ExceptionTimeToLive != nil && *s.ExceptionTimeToLive < 1 { - invalidParams.Add(request.NewErrParamMinValue("ExceptionTimeToLive", 1)) - } - if s.NotificationEndpoint == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationEndpoint")) - } - if s.SubscriptionProtocol == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionProtocol")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExceptionTimeToLive sets the ExceptionTimeToLive field's value. -func (s *CreateDataLakeExceptionSubscriptionInput) SetExceptionTimeToLive(v int64) *CreateDataLakeExceptionSubscriptionInput { - s.ExceptionTimeToLive = &v - return s -} - -// SetNotificationEndpoint sets the NotificationEndpoint field's value. -func (s *CreateDataLakeExceptionSubscriptionInput) SetNotificationEndpoint(v string) *CreateDataLakeExceptionSubscriptionInput { - s.NotificationEndpoint = &v - return s -} - -// SetSubscriptionProtocol sets the SubscriptionProtocol field's value. -func (s *CreateDataLakeExceptionSubscriptionInput) SetSubscriptionProtocol(v string) *CreateDataLakeExceptionSubscriptionInput { - s.SubscriptionProtocol = &v - return s -} - -type CreateDataLakeExceptionSubscriptionOutput 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 CreateDataLakeExceptionSubscriptionOutput) 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 CreateDataLakeExceptionSubscriptionOutput) GoString() string { - return s.String() -} - -type CreateDataLakeInput struct { - _ struct{} `type:"structure"` - - // Specify the Region or Regions that will contribute data to the rollup region. - // - // Configurations is a required field - Configurations []*DataLakeConfiguration `locationName:"configurations" type:"list" required:"true"` - - // The Amazon Resource Name (ARN) used to create and update the Glue table. - // This table contains partitions generated by the ingestion and normalization - // of Amazon Web Services log sources and custom sources. - // - // MetaStoreManagerRoleArn is a required field - MetaStoreManagerRoleArn *string `locationName:"metaStoreManagerRoleArn" type:"string" required:"true"` - - // An array of objects, one for each tag to associate with the data lake configuration. - // For each tag, you must specify both a tag key and a tag value. A tag value - // cannot be null, but it can be an empty string. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateDataLakeInput) 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 CreateDataLakeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDataLakeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDataLakeInput"} - if s.Configurations == nil { - invalidParams.Add(request.NewErrParamRequired("Configurations")) - } - if s.MetaStoreManagerRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("MetaStoreManagerRoleArn")) - } - if s.Configurations != nil { - for i, v := range s.Configurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Configurations", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurations sets the Configurations field's value. -func (s *CreateDataLakeInput) SetConfigurations(v []*DataLakeConfiguration) *CreateDataLakeInput { - s.Configurations = v - return s -} - -// SetMetaStoreManagerRoleArn sets the MetaStoreManagerRoleArn field's value. -func (s *CreateDataLakeInput) SetMetaStoreManagerRoleArn(v string) *CreateDataLakeInput { - s.MetaStoreManagerRoleArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateDataLakeInput) SetTags(v []*Tag) *CreateDataLakeInput { - s.Tags = v - return s -} - -type CreateDataLakeOrganizationConfigurationInput struct { - _ struct{} `type:"structure"` - - // Enable Security Lake with the specified configuration settings, to begin - // collecting security data for new accounts in your organization. - // - // AutoEnableNewAccount is a required field - AutoEnableNewAccount []*DataLakeAutoEnableNewAccountConfiguration `locationName:"autoEnableNewAccount" type:"list" 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 CreateDataLakeOrganizationConfigurationInput) 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 CreateDataLakeOrganizationConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDataLakeOrganizationConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDataLakeOrganizationConfigurationInput"} - if s.AutoEnableNewAccount == nil { - invalidParams.Add(request.NewErrParamRequired("AutoEnableNewAccount")) - } - if s.AutoEnableNewAccount != nil { - for i, v := range s.AutoEnableNewAccount { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AutoEnableNewAccount", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoEnableNewAccount sets the AutoEnableNewAccount field's value. -func (s *CreateDataLakeOrganizationConfigurationInput) SetAutoEnableNewAccount(v []*DataLakeAutoEnableNewAccountConfiguration) *CreateDataLakeOrganizationConfigurationInput { - s.AutoEnableNewAccount = v - return s -} - -type CreateDataLakeOrganizationConfigurationOutput 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 CreateDataLakeOrganizationConfigurationOutput) 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 CreateDataLakeOrganizationConfigurationOutput) GoString() string { - return s.String() -} - -type CreateDataLakeOutput struct { - _ struct{} `type:"structure"` - - // The created Security Lake configuration object. - DataLakes []*DataLakeResource `locationName:"dataLakes" type:"list"` -} - -// 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 CreateDataLakeOutput) 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 CreateDataLakeOutput) GoString() string { - return s.String() -} - -// SetDataLakes sets the DataLakes field's value. -func (s *CreateDataLakeOutput) SetDataLakes(v []*DataLakeResource) *CreateDataLakeOutput { - s.DataLakes = v - return s -} - -type CreateSubscriberInput struct { - _ struct{} `type:"structure"` - - // The Amazon S3 or Lake Formation access type. - AccessTypes []*string `locationName:"accessTypes" type:"list" enum:"AccessType"` - - // The supported Amazon Web Services from which logs and events are collected. - // Security Lake supports log and event collection for natively supported Amazon - // Web Services. - // - // Sources is a required field - Sources []*LogSourceResource `locationName:"sources" type:"list" required:"true"` - - // The description for your subscriber account in Security Lake. - SubscriberDescription *string `locationName:"subscriberDescription" type:"string"` - - // The AWS identity used to access your data. - // - // SubscriberIdentity is a required field - SubscriberIdentity *AwsIdentity `locationName:"subscriberIdentity" type:"structure" required:"true"` - - // The name of your Security Lake subscriber account. - // - // SubscriberName is a required field - SubscriberName *string `locationName:"subscriberName" type:"string" required:"true"` - - // An array of objects, one for each tag to associate with the subscriber. For - // each tag, you must specify both a tag key and a tag value. A tag value cannot - // be null, but it can be an empty string. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 CreateSubscriberInput) 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 CreateSubscriberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSubscriberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSubscriberInput"} - if s.Sources == nil { - invalidParams.Add(request.NewErrParamRequired("Sources")) - } - if s.SubscriberIdentity == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriberIdentity")) - } - if s.SubscriberName == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriberName")) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SubscriberIdentity != nil { - if err := s.SubscriberIdentity.Validate(); err != nil { - invalidParams.AddNested("SubscriberIdentity", err.(request.ErrInvalidParams)) - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessTypes sets the AccessTypes field's value. -func (s *CreateSubscriberInput) SetAccessTypes(v []*string) *CreateSubscriberInput { - s.AccessTypes = v - return s -} - -// SetSources sets the Sources field's value. -func (s *CreateSubscriberInput) SetSources(v []*LogSourceResource) *CreateSubscriberInput { - s.Sources = v - return s -} - -// SetSubscriberDescription sets the SubscriberDescription field's value. -func (s *CreateSubscriberInput) SetSubscriberDescription(v string) *CreateSubscriberInput { - s.SubscriberDescription = &v - return s -} - -// SetSubscriberIdentity sets the SubscriberIdentity field's value. -func (s *CreateSubscriberInput) SetSubscriberIdentity(v *AwsIdentity) *CreateSubscriberInput { - s.SubscriberIdentity = v - return s -} - -// SetSubscriberName sets the SubscriberName field's value. -func (s *CreateSubscriberInput) SetSubscriberName(v string) *CreateSubscriberInput { - s.SubscriberName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSubscriberInput) SetTags(v []*Tag) *CreateSubscriberInput { - s.Tags = v - return s -} - -type CreateSubscriberNotificationInput struct { - _ struct{} `type:"structure"` - - // Specify the configuration using which you want to create the subscriber notification. - // - // Configuration is a required field - Configuration *NotificationConfiguration `locationName:"configuration" type:"structure" required:"true"` - - // The subscriber ID for the notification subscription. - // - // SubscriberId is a required field - SubscriberId *string `location:"uri" locationName:"subscriberId" 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 CreateSubscriberNotificationInput) 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 CreateSubscriberNotificationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSubscriberNotificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSubscriberNotificationInput"} - if s.Configuration == nil { - invalidParams.Add(request.NewErrParamRequired("Configuration")) - } - if s.SubscriberId == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriberId")) - } - if s.SubscriberId != nil && len(*s.SubscriberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubscriberId", 1)) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguration sets the Configuration field's value. -func (s *CreateSubscriberNotificationInput) SetConfiguration(v *NotificationConfiguration) *CreateSubscriberNotificationInput { - s.Configuration = v - return s -} - -// SetSubscriberId sets the SubscriberId field's value. -func (s *CreateSubscriberNotificationInput) SetSubscriberId(v string) *CreateSubscriberNotificationInput { - s.SubscriberId = &v - return s -} - -type CreateSubscriberNotificationOutput struct { - _ struct{} `type:"structure"` - - // The subscriber endpoint to which exception messages are posted. - SubscriberEndpoint *string `locationName:"subscriberEndpoint" 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 CreateSubscriberNotificationOutput) 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 CreateSubscriberNotificationOutput) GoString() string { - return s.String() -} - -// SetSubscriberEndpoint sets the SubscriberEndpoint field's value. -func (s *CreateSubscriberNotificationOutput) SetSubscriberEndpoint(v string) *CreateSubscriberNotificationOutput { - s.SubscriberEndpoint = &v - return s -} - -type CreateSubscriberOutput struct { - _ struct{} `type:"structure"` - - // Retrieve information about the subscriber created using the CreateSubscriber - // API. - Subscriber *SubscriberResource `locationName:"subscriber" 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 CreateSubscriberOutput) 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 CreateSubscriberOutput) GoString() string { - return s.String() -} - -// SetSubscriber sets the Subscriber field's value. -func (s *CreateSubscriberOutput) SetSubscriber(v *SubscriberResource) *CreateSubscriberOutput { - s.Subscriber = v - return s -} - -// The attributes of a third-party custom source. -type CustomLogSourceAttributes struct { - _ struct{} `type:"structure"` - - // The ARN of the Glue crawler. - CrawlerArn *string `locationName:"crawlerArn" min:"1" type:"string"` - - // The ARN of the Glue database where results are written, such as: arn:aws:daylight:us-east-1::database/sometable/*. - DatabaseArn *string `locationName:"databaseArn" min:"1" type:"string"` - - // The ARN of the Glue table. - TableArn *string `locationName:"tableArn" min:"1" 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 CustomLogSourceAttributes) 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 CustomLogSourceAttributes) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomLogSourceAttributes) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomLogSourceAttributes"} - if s.CrawlerArn != nil && len(*s.CrawlerArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CrawlerArn", 1)) - } - if s.DatabaseArn != nil && len(*s.DatabaseArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatabaseArn", 1)) - } - if s.TableArn != nil && len(*s.TableArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TableArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCrawlerArn sets the CrawlerArn field's value. -func (s *CustomLogSourceAttributes) SetCrawlerArn(v string) *CustomLogSourceAttributes { - s.CrawlerArn = &v - return s -} - -// SetDatabaseArn sets the DatabaseArn field's value. -func (s *CustomLogSourceAttributes) SetDatabaseArn(v string) *CustomLogSourceAttributes { - s.DatabaseArn = &v - return s -} - -// SetTableArn sets the TableArn field's value. -func (s *CustomLogSourceAttributes) SetTableArn(v string) *CustomLogSourceAttributes { - s.TableArn = &v - return s -} - -// The configuration for the third-party custom source. -type CustomLogSourceConfiguration struct { - _ struct{} `type:"structure"` - - // The configuration for the Glue Crawler for the third-party custom source. - // - // CrawlerConfiguration is a required field - CrawlerConfiguration *CustomLogSourceCrawlerConfiguration `locationName:"crawlerConfiguration" type:"structure" required:"true"` - - // The identity of the log provider for the third-party custom source. - // - // ProviderIdentity is a required field - ProviderIdentity *AwsIdentity `locationName:"providerIdentity" type:"structure" 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 CustomLogSourceConfiguration) 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 CustomLogSourceConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomLogSourceConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomLogSourceConfiguration"} - if s.CrawlerConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("CrawlerConfiguration")) - } - if s.ProviderIdentity == nil { - invalidParams.Add(request.NewErrParamRequired("ProviderIdentity")) - } - if s.CrawlerConfiguration != nil { - if err := s.CrawlerConfiguration.Validate(); err != nil { - invalidParams.AddNested("CrawlerConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.ProviderIdentity != nil { - if err := s.ProviderIdentity.Validate(); err != nil { - invalidParams.AddNested("ProviderIdentity", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCrawlerConfiguration sets the CrawlerConfiguration field's value. -func (s *CustomLogSourceConfiguration) SetCrawlerConfiguration(v *CustomLogSourceCrawlerConfiguration) *CustomLogSourceConfiguration { - s.CrawlerConfiguration = v - return s -} - -// SetProviderIdentity sets the ProviderIdentity field's value. -func (s *CustomLogSourceConfiguration) SetProviderIdentity(v *AwsIdentity) *CustomLogSourceConfiguration { - s.ProviderIdentity = v - return s -} - -// The configuration for the Glue Crawler for the third-party custom source. -type CustomLogSourceCrawlerConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) - // role to be used by the Glue crawler. The recommended IAM policies are: - // - // * The managed policy AWSGlueServiceRole - // - // * A custom policy granting access to your Amazon S3 Data Lake - // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" 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 CustomLogSourceCrawlerConfiguration) 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 CustomLogSourceCrawlerConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomLogSourceCrawlerConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomLogSourceCrawlerConfiguration"} - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CustomLogSourceCrawlerConfiguration) SetRoleArn(v string) *CustomLogSourceCrawlerConfiguration { - s.RoleArn = &v - return s -} - -// The details of the log provider for a third-party custom source. -type CustomLogSourceProvider struct { - _ struct{} `type:"structure"` - - // The location of the partition in the Amazon S3 bucket for Security Lake. - Location *string `locationName:"location" type:"string"` - - // The ARN of the IAM role to be used by the entity putting logs into your custom - // source partition. Security Lake will apply the correct access policies to - // this role, but you must first manually create the trust policy for this role. - // The IAM role name must start with the text 'Security Lake'. The IAM role - // must trust the logProviderAccountId to assume the role. - RoleArn *string `locationName:"roleArn" 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 CustomLogSourceProvider) 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 CustomLogSourceProvider) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *CustomLogSourceProvider) SetLocation(v string) *CustomLogSourceProvider { - s.Location = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *CustomLogSourceProvider) SetRoleArn(v string) *CustomLogSourceProvider { - s.RoleArn = &v - return s -} - -// Amazon Security Lake can collect logs and events from third-party custom -// sources. -type CustomLogSourceResource struct { - _ struct{} `type:"structure"` - - // The attributes of a third-party custom source. - Attributes *CustomLogSourceAttributes `locationName:"attributes" type:"structure"` - - // The details of the log provider for a third-party custom source. - Provider *CustomLogSourceProvider `locationName:"provider" type:"structure"` - - // The name for a third-party custom source. This must be a Regionally unique - // value. - SourceName *string `locationName:"sourceName" min:"1" type:"string"` - - // The version for a third-party custom source. This must be a Regionally unique - // value. - SourceVersion *string `locationName:"sourceVersion" min:"1" 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 CustomLogSourceResource) 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 CustomLogSourceResource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomLogSourceResource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomLogSourceResource"} - if s.SourceName != nil && len(*s.SourceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceName", 1)) - } - if s.SourceVersion != nil && len(*s.SourceVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceVersion", 1)) - } - if s.Attributes != nil { - if err := s.Attributes.Validate(); err != nil { - invalidParams.AddNested("Attributes", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *CustomLogSourceResource) SetAttributes(v *CustomLogSourceAttributes) *CustomLogSourceResource { - s.Attributes = v - return s -} - -// SetProvider sets the Provider field's value. -func (s *CustomLogSourceResource) SetProvider(v *CustomLogSourceProvider) *CustomLogSourceResource { - s.Provider = v - return s -} - -// SetSourceName sets the SourceName field's value. -func (s *CustomLogSourceResource) SetSourceName(v string) *CustomLogSourceResource { - s.SourceName = &v - return s -} - -// SetSourceVersion sets the SourceVersion field's value. -func (s *CustomLogSourceResource) SetSourceVersion(v string) *CustomLogSourceResource { - s.SourceVersion = &v - return s -} - -// Automatically enable new organization accounts as member accounts from an -// Amazon Security Lake administrator account. -type DataLakeAutoEnableNewAccountConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services Regions where Security Lake is automatically enabled. - // - // Region is a required field - Region *string `locationName:"region" type:"string" required:"true"` - - // The Amazon Web Services sources that are automatically enabled in Security - // Lake. - // - // Sources is a required field - Sources []*AwsLogSourceResource `locationName:"sources" type:"list" 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 DataLakeAutoEnableNewAccountConfiguration) 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 DataLakeAutoEnableNewAccountConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataLakeAutoEnableNewAccountConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataLakeAutoEnableNewAccountConfiguration"} - if s.Region == nil { - invalidParams.Add(request.NewErrParamRequired("Region")) - } - if s.Sources == nil { - invalidParams.Add(request.NewErrParamRequired("Sources")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegion sets the Region field's value. -func (s *DataLakeAutoEnableNewAccountConfiguration) SetRegion(v string) *DataLakeAutoEnableNewAccountConfiguration { - s.Region = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *DataLakeAutoEnableNewAccountConfiguration) SetSources(v []*AwsLogSourceResource) *DataLakeAutoEnableNewAccountConfiguration { - s.Sources = v - return s -} - -// Provides details of Amazon Security Lake object. -type DataLakeConfiguration struct { - _ struct{} `type:"structure"` - - // Provides encryption details of Amazon Security Lake object. - EncryptionConfiguration *DataLakeEncryptionConfiguration `locationName:"encryptionConfiguration" type:"structure"` - - // Provides lifecycle details of Amazon Security Lake object. - LifecycleConfiguration *DataLakeLifecycleConfiguration `locationName:"lifecycleConfiguration" type:"structure"` - - // The Amazon Web Services Regions where Security Lake is automatically enabled. - // - // Region is a required field - Region *string `locationName:"region" type:"string" required:"true"` - - // Provides replication details of Amazon Security Lake object. - ReplicationConfiguration *DataLakeReplicationConfiguration `locationName:"replicationConfiguration" 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 DataLakeConfiguration) 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 DataLakeConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataLakeConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataLakeConfiguration"} - if s.Region == nil { - invalidParams.Add(request.NewErrParamRequired("Region")) - } - if s.LifecycleConfiguration != nil { - if err := s.LifecycleConfiguration.Validate(); err != nil { - invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *DataLakeConfiguration) SetEncryptionConfiguration(v *DataLakeEncryptionConfiguration) *DataLakeConfiguration { - s.EncryptionConfiguration = v - return s -} - -// SetLifecycleConfiguration sets the LifecycleConfiguration field's value. -func (s *DataLakeConfiguration) SetLifecycleConfiguration(v *DataLakeLifecycleConfiguration) *DataLakeConfiguration { - s.LifecycleConfiguration = v - return s -} - -// SetRegion sets the Region field's value. -func (s *DataLakeConfiguration) SetRegion(v string) *DataLakeConfiguration { - s.Region = &v - return s -} - -// SetReplicationConfiguration sets the ReplicationConfiguration field's value. -func (s *DataLakeConfiguration) SetReplicationConfiguration(v *DataLakeReplicationConfiguration) *DataLakeConfiguration { - s.ReplicationConfiguration = v - return s -} - -// Provides encryption details of Amazon Security Lake object. -type DataLakeEncryptionConfiguration struct { - _ struct{} `type:"structure"` - - // The id of KMS encryption key used by Amazon Security Lake to encrypt the - // Security Lake object. - KmsKeyId *string `locationName:"kmsKeyId" 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 DataLakeEncryptionConfiguration) 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 DataLakeEncryptionConfiguration) GoString() string { - return s.String() -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *DataLakeEncryptionConfiguration) SetKmsKeyId(v string) *DataLakeEncryptionConfiguration { - s.KmsKeyId = &v - return s -} - -// The details for an Amazon Security Lake exception. -type DataLakeException struct { - _ struct{} `type:"structure"` - - // The underlying exception of a Security Lake exception. - Exception *string `locationName:"exception" type:"string"` - - // The Amazon Web Services Regions where the exception occurred. - Region *string `locationName:"region" type:"string"` - - // List of all remediation steps for a Security Lake exception. - Remediation *string `locationName:"remediation" type:"string"` - - // This error can occur if you configure the wrong timestamp format, or if the - // subset of entries used for validation had errors or missing values. - Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 DataLakeException) 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 DataLakeException) GoString() string { - return s.String() -} - -// SetException sets the Exception field's value. -func (s *DataLakeException) SetException(v string) *DataLakeException { - s.Exception = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *DataLakeException) SetRegion(v string) *DataLakeException { - s.Region = &v - return s -} - -// SetRemediation sets the Remediation field's value. -func (s *DataLakeException) SetRemediation(v string) *DataLakeException { - s.Remediation = &v - return s -} - -// SetTimestamp sets the Timestamp field's value. -func (s *DataLakeException) SetTimestamp(v time.Time) *DataLakeException { - s.Timestamp = &v - return s -} - -// Provides lifecycle details of Amazon Security Lake object. -type DataLakeLifecycleConfiguration struct { - _ struct{} `type:"structure"` - - // Provides data expiration details of Amazon Security Lake object. - Expiration *DataLakeLifecycleExpiration `locationName:"expiration" type:"structure"` - - // Provides data storage transition details of Amazon Security Lake object. - Transitions []*DataLakeLifecycleTransition `locationName:"transitions" type:"list"` -} - -// 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 DataLakeLifecycleConfiguration) 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 DataLakeLifecycleConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataLakeLifecycleConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataLakeLifecycleConfiguration"} - if s.Expiration != nil { - if err := s.Expiration.Validate(); err != nil { - invalidParams.AddNested("Expiration", err.(request.ErrInvalidParams)) - } - } - if s.Transitions != nil { - for i, v := range s.Transitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Transitions", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExpiration sets the Expiration field's value. -func (s *DataLakeLifecycleConfiguration) SetExpiration(v *DataLakeLifecycleExpiration) *DataLakeLifecycleConfiguration { - s.Expiration = v - return s -} - -// SetTransitions sets the Transitions field's value. -func (s *DataLakeLifecycleConfiguration) SetTransitions(v []*DataLakeLifecycleTransition) *DataLakeLifecycleConfiguration { - s.Transitions = v - return s -} - -// Provide expiration lifecycle details of Amazon Security Lake object. -type DataLakeLifecycleExpiration struct { - _ struct{} `type:"structure"` - - // Number of days before data expires in the Amazon Security Lake object. - Days *int64 `locationName:"days" min:"1" 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 DataLakeLifecycleExpiration) 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 DataLakeLifecycleExpiration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataLakeLifecycleExpiration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataLakeLifecycleExpiration"} - if s.Days != nil && *s.Days < 1 { - invalidParams.Add(request.NewErrParamMinValue("Days", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDays sets the Days field's value. -func (s *DataLakeLifecycleExpiration) SetDays(v int64) *DataLakeLifecycleExpiration { - s.Days = &v - return s -} - -// Provide transition lifecycle details of Amazon Security Lake object. -type DataLakeLifecycleTransition struct { - _ struct{} `type:"structure"` - - // Number of days before data transitions to a different S3 Storage Class in - // the Amazon Security Lake object. - Days *int64 `locationName:"days" min:"1" type:"integer"` - - // The range of storage classes that you can choose from based on the data access, - // resiliency, and cost requirements of your workloads. - StorageClass *string `locationName:"storageClass" 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 DataLakeLifecycleTransition) 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 DataLakeLifecycleTransition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DataLakeLifecycleTransition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataLakeLifecycleTransition"} - if s.Days != nil && *s.Days < 1 { - invalidParams.Add(request.NewErrParamMinValue("Days", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDays sets the Days field's value. -func (s *DataLakeLifecycleTransition) SetDays(v int64) *DataLakeLifecycleTransition { - s.Days = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *DataLakeLifecycleTransition) SetStorageClass(v string) *DataLakeLifecycleTransition { - s.StorageClass = &v - return s -} - -// Provides replication details of Amazon Security Lake object. -type DataLakeReplicationConfiguration struct { - _ struct{} `type:"structure"` - - // Replication enables automatic, asynchronous copying of objects across Amazon - // S3 buckets. Amazon S3 buckets that are configured for object replication - // can be owned by the same Amazon Web Services account or by different accounts. - // You can replicate objects to a single destination bucket or to multiple destination - // buckets. The destination buckets can be in different Amazon Web Services - // Regions or within the same Region as the source bucket. - // - // Set up one or more rollup Regions by providing the Region or Regions that - // should contribute to the central rollup Region. - Regions []*string `locationName:"regions" type:"list"` - - // Replication settings for the Amazon S3 buckets. This parameter uses the Identity - // and Access Management (IAM) role you created that is managed by Security - // Lake, to ensure the replication setting is correct. - RoleArn *string `locationName:"roleArn" 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 DataLakeReplicationConfiguration) 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 DataLakeReplicationConfiguration) GoString() string { - return s.String() -} - -// SetRegions sets the Regions field's value. -func (s *DataLakeReplicationConfiguration) SetRegions(v []*string) *DataLakeReplicationConfiguration { - s.Regions = v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *DataLakeReplicationConfiguration) SetRoleArn(v string) *DataLakeReplicationConfiguration { - s.RoleArn = &v - return s -} - -// Provides details of Amazon Security Lake object. -type DataLakeResource struct { - _ struct{} `type:"structure"` - - // Retrieves the status of the configuration operation for an account in Amazon - // Security Lake. - CreateStatus *string `locationName:"createStatus" type:"string" enum:"DataLakeStatus"` - - // The Amazon Resource Name (ARN) created by you to provide to the subscriber. - // For more information about ARNs and how to use them in policies, see the - // Amazon Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html). - // - // DataLakeArn is a required field - DataLakeArn *string `locationName:"dataLakeArn" min:"1" type:"string" required:"true"` - - // Provides encryption details of Amazon Security Lake object. - EncryptionConfiguration *DataLakeEncryptionConfiguration `locationName:"encryptionConfiguration" type:"structure"` - - // Provides lifecycle details of Amazon Security Lake object. - LifecycleConfiguration *DataLakeLifecycleConfiguration `locationName:"lifecycleConfiguration" type:"structure"` - - // The Amazon Web Services Regions where Security Lake is enabled. - // - // Region is a required field - Region *string `locationName:"region" type:"string" required:"true"` - - // Provides replication details of Amazon Security Lake object. - ReplicationConfiguration *DataLakeReplicationConfiguration `locationName:"replicationConfiguration" type:"structure"` - - // The ARN for the Amazon Security Lake Amazon S3 bucket. - S3BucketArn *string `locationName:"s3BucketArn" type:"string"` - - // The status of the last UpdateDataLake or DeleteDataLake API request. - UpdateStatus *DataLakeUpdateStatus `locationName:"updateStatus" 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 DataLakeResource) 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 DataLakeResource) GoString() string { - return s.String() -} - -// SetCreateStatus sets the CreateStatus field's value. -func (s *DataLakeResource) SetCreateStatus(v string) *DataLakeResource { - s.CreateStatus = &v - return s -} - -// SetDataLakeArn sets the DataLakeArn field's value. -func (s *DataLakeResource) SetDataLakeArn(v string) *DataLakeResource { - s.DataLakeArn = &v - return s -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *DataLakeResource) SetEncryptionConfiguration(v *DataLakeEncryptionConfiguration) *DataLakeResource { - s.EncryptionConfiguration = v - return s -} - -// SetLifecycleConfiguration sets the LifecycleConfiguration field's value. -func (s *DataLakeResource) SetLifecycleConfiguration(v *DataLakeLifecycleConfiguration) *DataLakeResource { - s.LifecycleConfiguration = v - return s -} - -// SetRegion sets the Region field's value. -func (s *DataLakeResource) SetRegion(v string) *DataLakeResource { - s.Region = &v - return s -} - -// SetReplicationConfiguration sets the ReplicationConfiguration field's value. -func (s *DataLakeResource) SetReplicationConfiguration(v *DataLakeReplicationConfiguration) *DataLakeResource { - s.ReplicationConfiguration = v - return s -} - -// SetS3BucketArn sets the S3BucketArn field's value. -func (s *DataLakeResource) SetS3BucketArn(v string) *DataLakeResource { - s.S3BucketArn = &v - return s -} - -// SetUpdateStatus sets the UpdateStatus field's value. -func (s *DataLakeResource) SetUpdateStatus(v *DataLakeUpdateStatus) *DataLakeResource { - s.UpdateStatus = v - return s -} - -// Amazon Security Lake collects logs and events from supported Amazon Web Services -// and custom sources. For the list of supported Amazon Web Services, see the -// Amazon Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html). -type DataLakeSource struct { - _ struct{} `type:"structure"` - - // The ID of the Security Lake account for which logs are collected. - Account *string `locationName:"account" type:"string"` - - // The Open Cybersecurity Schema Framework (OCSF) event classes which describes - // the type of data that the custom source will send to Security Lake. The supported - // event classes are: - // - // * ACCESS_ACTIVITY - // - // * FILE_ACTIVITY - // - // * KERNEL_ACTIVITY - // - // * KERNEL_EXTENSION - // - // * MEMORY_ACTIVITY - // - // * MODULE_ACTIVITY - // - // * PROCESS_ACTIVITY - // - // * REGISTRY_KEY_ACTIVITY - // - // * REGISTRY_VALUE_ACTIVITY - // - // * RESOURCE_ACTIVITY - // - // * SCHEDULED_JOB_ACTIVITY - // - // * SECURITY_FINDING - // - // * ACCOUNT_CHANGE - // - // * AUTHENTICATION - // - // * AUTHORIZATION - // - // * ENTITY_MANAGEMENT_AUDIT - // - // * DHCP_ACTIVITY - // - // * NETWORK_ACTIVITY - // - // * DNS_ACTIVITY - // - // * FTP_ACTIVITY - // - // * HTTP_ACTIVITY - // - // * RDP_ACTIVITY - // - // * SMB_ACTIVITY - // - // * SSH_ACTIVITY - // - // * CONFIG_STATE - // - // * INVENTORY_INFO - // - // * EMAIL_ACTIVITY - // - // * API_ACTIVITY - // - // * CLOUD_API - EventClasses []*string `locationName:"eventClasses" type:"list"` - - // The supported Amazon Web Services from which logs and events are collected. - // Amazon Security Lake supports log and event collection for natively supported - // Amazon Web Services. - SourceName *string `locationName:"sourceName" type:"string"` - - // The log status for the Security Lake account. - SourceStatuses []*DataLakeSourceStatus `locationName:"sourceStatuses" type:"list"` -} - -// 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 DataLakeSource) 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 DataLakeSource) GoString() string { - return s.String() -} - -// SetAccount sets the Account field's value. -func (s *DataLakeSource) SetAccount(v string) *DataLakeSource { - s.Account = &v - return s -} - -// SetEventClasses sets the EventClasses field's value. -func (s *DataLakeSource) SetEventClasses(v []*string) *DataLakeSource { - s.EventClasses = v - return s -} - -// SetSourceName sets the SourceName field's value. -func (s *DataLakeSource) SetSourceName(v string) *DataLakeSource { - s.SourceName = &v - return s -} - -// SetSourceStatuses sets the SourceStatuses field's value. -func (s *DataLakeSource) SetSourceStatuses(v []*DataLakeSourceStatus) *DataLakeSource { - s.SourceStatuses = v - return s -} - -// Retrieves the Logs status for the Amazon Security Lake account. -type DataLakeSourceStatus struct { - _ struct{} `type:"structure"` - - // Defines path the stored logs are available which has information on your - // systems, applications, and services. - Resource *string `locationName:"resource" type:"string"` - - // The health status of services, including error codes and patterns. - Status *string `locationName:"status" type:"string" enum:"SourceCollectionStatus"` -} - -// 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 DataLakeSourceStatus) 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 DataLakeSourceStatus) GoString() string { - return s.String() -} - -// SetResource sets the Resource field's value. -func (s *DataLakeSourceStatus) SetResource(v string) *DataLakeSourceStatus { - s.Resource = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DataLakeSourceStatus) SetStatus(v string) *DataLakeSourceStatus { - s.Status = &v - return s -} - -// The details of the last UpdateDataLake or DeleteDataLake API request which -// failed. -type DataLakeUpdateException struct { - _ struct{} `type:"structure"` - - // The reason code for the exception of the last UpdateDataLake or DeleteDataLake - // API request. - Code *string `locationName:"code" type:"string"` - - // The reason for the exception of the last UpdateDataLakeor DeleteDataLake - // API request. - Reason *string `locationName:"reason" 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 DataLakeUpdateException) 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 DataLakeUpdateException) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *DataLakeUpdateException) SetCode(v string) *DataLakeUpdateException { - s.Code = &v - return s -} - -// SetReason sets the Reason field's value. -func (s *DataLakeUpdateException) SetReason(v string) *DataLakeUpdateException { - s.Reason = &v - return s -} - -// The status of the last UpdateDataLake or DeleteDataLake API request. This -// is set to Completed after the configuration is updated, or removed if deletion -// of the data lake is successful. -type DataLakeUpdateStatus struct { - _ struct{} `type:"structure"` - - // The details of the last UpdateDataLakeor DeleteDataLake API request which - // failed. - Exception *DataLakeUpdateException `locationName:"exception" type:"structure"` - - // The unique ID for the last UpdateDataLake or DeleteDataLake API request. - RequestId *string `locationName:"requestId" type:"string"` - - // The status of the last UpdateDataLake or DeleteDataLake API request that - // was requested. - Status *string `locationName:"status" type:"string" enum:"DataLakeStatus"` -} - -// 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 DataLakeUpdateStatus) 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 DataLakeUpdateStatus) GoString() string { - return s.String() -} - -// SetException sets the Exception field's value. -func (s *DataLakeUpdateStatus) SetException(v *DataLakeUpdateException) *DataLakeUpdateStatus { - s.Exception = v - return s -} - -// SetRequestId sets the RequestId field's value. -func (s *DataLakeUpdateStatus) SetRequestId(v string) *DataLakeUpdateStatus { - s.RequestId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DataLakeUpdateStatus) SetStatus(v string) *DataLakeUpdateStatus { - s.Status = &v - return s -} - -type DeleteAwsLogSourceInput struct { - _ struct{} `type:"structure"` - - // Specify the natively-supported Amazon Web Services service to remove as a - // source in Security Lake. - // - // Sources is a required field - Sources []*AwsLogSourceConfiguration `locationName:"sources" type:"list" 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 DeleteAwsLogSourceInput) 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 DeleteAwsLogSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAwsLogSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAwsLogSourceInput"} - if s.Sources == nil { - invalidParams.Add(request.NewErrParamRequired("Sources")) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSources sets the Sources field's value. -func (s *DeleteAwsLogSourceInput) SetSources(v []*AwsLogSourceConfiguration) *DeleteAwsLogSourceInput { - s.Sources = v - return s -} - -type DeleteAwsLogSourceOutput struct { - _ struct{} `type:"structure"` - - // Deletion of the Amazon Web Services sources failed as the account is not - // a part of the organization. - Failed []*string `locationName:"failed" type:"list"` -} - -// 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 DeleteAwsLogSourceOutput) 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 DeleteAwsLogSourceOutput) GoString() string { - return s.String() -} - -// SetFailed sets the Failed field's value. -func (s *DeleteAwsLogSourceOutput) SetFailed(v []*string) *DeleteAwsLogSourceOutput { - s.Failed = v - return s -} - -type DeleteCustomLogSourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The source name of custom log source that you want to delete. - // - // SourceName is a required field - SourceName *string `location:"uri" locationName:"sourceName" min:"1" type:"string" required:"true"` - - // The source version for the third-party custom source. You can limit the custom - // source removal to the specified source version. - SourceVersion *string `location:"querystring" locationName:"sourceVersion" min:"1" 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 DeleteCustomLogSourceInput) 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 DeleteCustomLogSourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCustomLogSourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCustomLogSourceInput"} - if s.SourceName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceName")) - } - if s.SourceName != nil && len(*s.SourceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceName", 1)) - } - if s.SourceVersion != nil && len(*s.SourceVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceVersion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSourceName sets the SourceName field's value. -func (s *DeleteCustomLogSourceInput) SetSourceName(v string) *DeleteCustomLogSourceInput { - s.SourceName = &v - return s -} - -// SetSourceVersion sets the SourceVersion field's value. -func (s *DeleteCustomLogSourceInput) SetSourceVersion(v string) *DeleteCustomLogSourceInput { - s.SourceVersion = &v - return s -} - -type DeleteCustomLogSourceOutput 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 DeleteCustomLogSourceOutput) 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 DeleteCustomLogSourceOutput) GoString() string { - return s.String() -} - -type DeleteDataLakeExceptionSubscriptionInput struct { - _ struct{} `type:"structure" nopayload:"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 DeleteDataLakeExceptionSubscriptionInput) 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 DeleteDataLakeExceptionSubscriptionInput) GoString() string { - return s.String() -} - -type DeleteDataLakeExceptionSubscriptionOutput 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 DeleteDataLakeExceptionSubscriptionOutput) 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 DeleteDataLakeExceptionSubscriptionOutput) GoString() string { - return s.String() -} - -type DeleteDataLakeInput struct { - _ struct{} `type:"structure"` - - // The list of Regions where Security Lake is enabled. - // - // Regions is a required field - Regions []*string `locationName:"regions" type:"list" 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 DeleteDataLakeInput) 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 DeleteDataLakeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDataLakeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDataLakeInput"} - if s.Regions == nil { - invalidParams.Add(request.NewErrParamRequired("Regions")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRegions sets the Regions field's value. -func (s *DeleteDataLakeInput) SetRegions(v []*string) *DeleteDataLakeInput { - s.Regions = v - return s -} - -type DeleteDataLakeOrganizationConfigurationInput struct { - _ struct{} `type:"structure"` - - // Turns off automatic enablement of Security Lake for member accounts that - // are added to an organization. - // - // AutoEnableNewAccount is a required field - AutoEnableNewAccount []*DataLakeAutoEnableNewAccountConfiguration `locationName:"autoEnableNewAccount" type:"list" 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 DeleteDataLakeOrganizationConfigurationInput) 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 DeleteDataLakeOrganizationConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDataLakeOrganizationConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDataLakeOrganizationConfigurationInput"} - if s.AutoEnableNewAccount == nil { - invalidParams.Add(request.NewErrParamRequired("AutoEnableNewAccount")) - } - if s.AutoEnableNewAccount != nil { - for i, v := range s.AutoEnableNewAccount { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AutoEnableNewAccount", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAutoEnableNewAccount sets the AutoEnableNewAccount field's value. -func (s *DeleteDataLakeOrganizationConfigurationInput) SetAutoEnableNewAccount(v []*DataLakeAutoEnableNewAccountConfiguration) *DeleteDataLakeOrganizationConfigurationInput { - s.AutoEnableNewAccount = v - return s -} - -type DeleteDataLakeOrganizationConfigurationOutput 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 DeleteDataLakeOrganizationConfigurationOutput) 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 DeleteDataLakeOrganizationConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteDataLakeOutput 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 DeleteDataLakeOutput) 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 DeleteDataLakeOutput) GoString() string { - return s.String() -} - -type DeleteSubscriberInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A value created by Security Lake that uniquely identifies your DeleteSubscriber - // API request. - // - // SubscriberId is a required field - SubscriberId *string `location:"uri" locationName:"subscriberId" 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 DeleteSubscriberInput) 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 DeleteSubscriberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSubscriberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriberInput"} - if s.SubscriberId == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriberId")) - } - if s.SubscriberId != nil && len(*s.SubscriberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubscriberId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubscriberId sets the SubscriberId field's value. -func (s *DeleteSubscriberInput) SetSubscriberId(v string) *DeleteSubscriberInput { - s.SubscriberId = &v - return s -} - -type DeleteSubscriberNotificationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the Security Lake subscriber account. - // - // SubscriberId is a required field - SubscriberId *string `location:"uri" locationName:"subscriberId" 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 DeleteSubscriberNotificationInput) 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 DeleteSubscriberNotificationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSubscriberNotificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriberNotificationInput"} - if s.SubscriberId == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriberId")) - } - if s.SubscriberId != nil && len(*s.SubscriberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubscriberId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubscriberId sets the SubscriberId field's value. -func (s *DeleteSubscriberNotificationInput) SetSubscriberId(v string) *DeleteSubscriberNotificationInput { - s.SubscriberId = &v - return s -} - -type DeleteSubscriberNotificationOutput 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 DeleteSubscriberNotificationOutput) 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 DeleteSubscriberNotificationOutput) GoString() string { - return s.String() -} - -type DeleteSubscriberOutput 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 DeleteSubscriberOutput) 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 DeleteSubscriberOutput) GoString() string { - return s.String() -} - -type DeregisterDataLakeDelegatedAdministratorInput struct { - _ struct{} `type:"structure" nopayload:"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 DeregisterDataLakeDelegatedAdministratorInput) 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 DeregisterDataLakeDelegatedAdministratorInput) GoString() string { - return s.String() -} - -type DeregisterDataLakeDelegatedAdministratorOutput 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 DeregisterDataLakeDelegatedAdministratorOutput) 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 DeregisterDataLakeDelegatedAdministratorOutput) GoString() string { - return s.String() -} - -type GetDataLakeExceptionSubscriptionInput struct { - _ struct{} `type:"structure" nopayload:"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 GetDataLakeExceptionSubscriptionInput) 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 GetDataLakeExceptionSubscriptionInput) GoString() string { - return s.String() -} - -type GetDataLakeExceptionSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The expiration period and time-to-live (TTL). - ExceptionTimeToLive *int64 `locationName:"exceptionTimeToLive" type:"long"` - - // The Amazon Web Services account where you receive exception notifications. - NotificationEndpoint *string `locationName:"notificationEndpoint" type:"string"` - - // The subscription protocol to which exception notifications are posted. - SubscriptionProtocol *string `locationName:"subscriptionProtocol" 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 GetDataLakeExceptionSubscriptionOutput) 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 GetDataLakeExceptionSubscriptionOutput) GoString() string { - return s.String() -} - -// SetExceptionTimeToLive sets the ExceptionTimeToLive field's value. -func (s *GetDataLakeExceptionSubscriptionOutput) SetExceptionTimeToLive(v int64) *GetDataLakeExceptionSubscriptionOutput { - s.ExceptionTimeToLive = &v - return s -} - -// SetNotificationEndpoint sets the NotificationEndpoint field's value. -func (s *GetDataLakeExceptionSubscriptionOutput) SetNotificationEndpoint(v string) *GetDataLakeExceptionSubscriptionOutput { - s.NotificationEndpoint = &v - return s -} - -// SetSubscriptionProtocol sets the SubscriptionProtocol field's value. -func (s *GetDataLakeExceptionSubscriptionOutput) SetSubscriptionProtocol(v string) *GetDataLakeExceptionSubscriptionOutput { - s.SubscriptionProtocol = &v - return s -} - -type GetDataLakeOrganizationConfigurationInput struct { - _ struct{} `type:"structure" nopayload:"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 GetDataLakeOrganizationConfigurationInput) 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 GetDataLakeOrganizationConfigurationInput) GoString() string { - return s.String() -} - -type GetDataLakeOrganizationConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The configuration for new accounts. - AutoEnableNewAccount []*DataLakeAutoEnableNewAccountConfiguration `locationName:"autoEnableNewAccount" type:"list"` -} - -// 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 GetDataLakeOrganizationConfigurationOutput) 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 GetDataLakeOrganizationConfigurationOutput) GoString() string { - return s.String() -} - -// SetAutoEnableNewAccount sets the AutoEnableNewAccount field's value. -func (s *GetDataLakeOrganizationConfigurationOutput) SetAutoEnableNewAccount(v []*DataLakeAutoEnableNewAccountConfiguration) *GetDataLakeOrganizationConfigurationOutput { - s.AutoEnableNewAccount = v - return s -} - -type GetDataLakeSourcesInput struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account ID for which a static snapshot of the current - // Amazon Web Services Region, including enabled accounts and log sources, is - // retrieved. - Accounts []*string `locationName:"accounts" type:"list"` - - // The maximum limit of accounts for which the static snapshot of the current - // Region, including enabled accounts and log sources, is retrieved. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Lists if there are more results available. The value of nextToken is a unique - // pagination token for each page. Repeat the call using the returned token - // to retrieve the next page. Keep all other arguments unchanged. - // - // Each pagination token expires after 24 hours. Using an expired pagination - // token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" 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 GetDataLakeSourcesInput) 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 GetDataLakeSourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataLakeSourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataLakeSourcesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccounts sets the Accounts field's value. -func (s *GetDataLakeSourcesInput) SetAccounts(v []*string) *GetDataLakeSourcesInput { - s.Accounts = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetDataLakeSourcesInput) SetMaxResults(v int64) *GetDataLakeSourcesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetDataLakeSourcesInput) SetNextToken(v string) *GetDataLakeSourcesInput { - s.NextToken = &v - return s -} - -type GetDataLakeSourcesOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) created by you to provide to the subscriber. - // For more information about ARNs and how to use them in policies, see the - // Amazon Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html). - DataLakeArn *string `locationName:"dataLakeArn" min:"1" type:"string"` - - // The list of enabled accounts and enabled sources. - DataLakeSources []*DataLakeSource `locationName:"dataLakeSources" type:"list"` - - // Lists if there are more results available. The value of nextToken is a unique - // pagination token for each page. Repeat the call using the returned token - // to retrieve the next page. Keep all other arguments unchanged. - // - // Each pagination token expires after 24 hours. Using an expired pagination - // token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" 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 GetDataLakeSourcesOutput) 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 GetDataLakeSourcesOutput) GoString() string { - return s.String() -} - -// SetDataLakeArn sets the DataLakeArn field's value. -func (s *GetDataLakeSourcesOutput) SetDataLakeArn(v string) *GetDataLakeSourcesOutput { - s.DataLakeArn = &v - return s -} - -// SetDataLakeSources sets the DataLakeSources field's value. -func (s *GetDataLakeSourcesOutput) SetDataLakeSources(v []*DataLakeSource) *GetDataLakeSourcesOutput { - s.DataLakeSources = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetDataLakeSourcesOutput) SetNextToken(v string) *GetDataLakeSourcesOutput { - s.NextToken = &v - return s -} - -type GetSubscriberInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // A value created by Amazon Security Lake that uniquely identifies your GetSubscriber - // API request. - // - // SubscriberId is a required field - SubscriberId *string `location:"uri" locationName:"subscriberId" 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 GetSubscriberInput) 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 GetSubscriberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSubscriberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSubscriberInput"} - if s.SubscriberId == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriberId")) - } - if s.SubscriberId != nil && len(*s.SubscriberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubscriberId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSubscriberId sets the SubscriberId field's value. -func (s *GetSubscriberInput) SetSubscriberId(v string) *GetSubscriberInput { - s.SubscriberId = &v - return s -} - -type GetSubscriberOutput struct { - _ struct{} `type:"structure"` - - // The subscriber information for the specified subscriber ID. - Subscriber *SubscriberResource `locationName:"subscriber" 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 GetSubscriberOutput) 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 GetSubscriberOutput) GoString() string { - return s.String() -} - -// SetSubscriber sets the Subscriber field's value. -func (s *GetSubscriberOutput) SetSubscriber(v *SubscriberResource) *GetSubscriberOutput { - s.Subscriber = v - return s -} - -// The configurations for HTTPS subscriber notification. -type HttpsNotificationConfiguration struct { - _ struct{} `type:"structure"` - - // The key name for the notification subscription. - AuthorizationApiKeyName *string `locationName:"authorizationApiKeyName" type:"string"` - - // The key value for the notification subscription. - AuthorizationApiKeyValue *string `locationName:"authorizationApiKeyValue" type:"string"` - - // The subscription endpoint in Security Lake. If you prefer notification with - // an HTTPs endpoint, populate this field. - // - // Endpoint is a required field - Endpoint *string `locationName:"endpoint" type:"string" required:"true"` - - // The HTTPS method used for the notification subscription. - HttpMethod *string `locationName:"httpMethod" type:"string" enum:"HttpMethod"` - - // The Amazon Resource Name (ARN) of the EventBridge API destinations IAM role - // that you created. For more information about ARNs and how to use them in - // policies, see Managing data access (https://docs.aws.amazon.com//security-lake/latest/userguide/subscriber-data-access.html) - // and Amazon Web Services Managed Policies (https://docs.aws.amazon.com/security-lake/latest/userguide/security-iam-awsmanpol.html) - // in the Amazon Security Lake User Guide. - // - // TargetRoleArn is a required field - TargetRoleArn *string `locationName:"targetRoleArn" 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 HttpsNotificationConfiguration) 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 HttpsNotificationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HttpsNotificationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HttpsNotificationConfiguration"} - if s.Endpoint == nil { - invalidParams.Add(request.NewErrParamRequired("Endpoint")) - } - if s.TargetRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("TargetRoleArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthorizationApiKeyName sets the AuthorizationApiKeyName field's value. -func (s *HttpsNotificationConfiguration) SetAuthorizationApiKeyName(v string) *HttpsNotificationConfiguration { - s.AuthorizationApiKeyName = &v - return s -} - -// SetAuthorizationApiKeyValue sets the AuthorizationApiKeyValue field's value. -func (s *HttpsNotificationConfiguration) SetAuthorizationApiKeyValue(v string) *HttpsNotificationConfiguration { - s.AuthorizationApiKeyValue = &v - return s -} - -// SetEndpoint sets the Endpoint field's value. -func (s *HttpsNotificationConfiguration) SetEndpoint(v string) *HttpsNotificationConfiguration { - s.Endpoint = &v - return s -} - -// SetHttpMethod sets the HttpMethod field's value. -func (s *HttpsNotificationConfiguration) SetHttpMethod(v string) *HttpsNotificationConfiguration { - s.HttpMethod = &v - return s -} - -// SetTargetRoleArn sets the TargetRoleArn field's value. -func (s *HttpsNotificationConfiguration) SetTargetRoleArn(v string) *HttpsNotificationConfiguration { - s.TargetRoleArn = &v - return s -} - -// Internal service exceptions are sometimes caused by transient issues. Before -// you start troubleshooting, perform the operation again. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListDataLakeExceptionsInput struct { - _ struct{} `type:"structure"` - - // List the maximum number of failures in Security Lake. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // List if there are more results available. The value of nextToken is a unique - // pagination token for each page. Repeat the call using the returned token - // to retrieve the next page. Keep all other arguments unchanged. - // - // Each pagination token expires after 24 hours. Using an expired pagination - // token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" type:"string"` - - // List the Amazon Web Services Regions from which exceptions are retrieved. - Regions []*string `locationName:"regions" type:"list"` -} - -// 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 ListDataLakeExceptionsInput) 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 ListDataLakeExceptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDataLakeExceptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDataLakeExceptionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDataLakeExceptionsInput) SetMaxResults(v int64) *ListDataLakeExceptionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataLakeExceptionsInput) SetNextToken(v string) *ListDataLakeExceptionsInput { - s.NextToken = &v - return s -} - -// SetRegions sets the Regions field's value. -func (s *ListDataLakeExceptionsInput) SetRegions(v []*string) *ListDataLakeExceptionsInput { - s.Regions = v - return s -} - -type ListDataLakeExceptionsOutput struct { - _ struct{} `type:"structure"` - - // Lists the failures that cannot be retried in the current Region. - Exceptions []*DataLakeException `locationName:"exceptions" type:"list"` - - // List if there are more results available. The value of nextToken is a unique - // pagination token for each page. Repeat the call using the returned token - // to retrieve the next page. Keep all other arguments unchanged. - // - // Each pagination token expires after 24 hours. Using an expired pagination - // token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" 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 ListDataLakeExceptionsOutput) 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 ListDataLakeExceptionsOutput) GoString() string { - return s.String() -} - -// SetExceptions sets the Exceptions field's value. -func (s *ListDataLakeExceptionsOutput) SetExceptions(v []*DataLakeException) *ListDataLakeExceptionsOutput { - s.Exceptions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDataLakeExceptionsOutput) SetNextToken(v string) *ListDataLakeExceptionsOutput { - s.NextToken = &v - return s -} - -type ListDataLakesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The list of regions where Security Lake is enabled. - Regions []*string `location:"querystring" locationName:"regions" type:"list"` -} - -// 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 ListDataLakesInput) 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 ListDataLakesInput) GoString() string { - return s.String() -} - -// SetRegions sets the Regions field's value. -func (s *ListDataLakesInput) SetRegions(v []*string) *ListDataLakesInput { - s.Regions = v - return s -} - -type ListDataLakesOutput struct { - _ struct{} `type:"structure"` - - // Retrieves the Security Lake configuration object. - DataLakes []*DataLakeResource `locationName:"dataLakes" type:"list"` -} - -// 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 ListDataLakesOutput) 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 ListDataLakesOutput) GoString() string { - return s.String() -} - -// SetDataLakes sets the DataLakes field's value. -func (s *ListDataLakesOutput) SetDataLakes(v []*DataLakeResource) *ListDataLakesOutput { - s.DataLakes = v - return s -} - -type ListLogSourcesInput struct { - _ struct{} `type:"structure"` - - // The list of Amazon Web Services accounts for which log sources are displayed. - Accounts []*string `locationName:"accounts" type:"list"` - - // The maximum number of accounts for which the log sources are displayed. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. You can repeat - // the call using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // The list of regions for which log sources are displayed. - Regions []*string `locationName:"regions" type:"list"` - - // The list of sources for which log sources are displayed. - Sources []*LogSourceResource `locationName:"sources" type:"list"` -} - -// 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 ListLogSourcesInput) 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 ListLogSourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListLogSourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLogSourcesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccounts sets the Accounts field's value. -func (s *ListLogSourcesInput) SetAccounts(v []*string) *ListLogSourcesInput { - s.Accounts = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListLogSourcesInput) SetMaxResults(v int64) *ListLogSourcesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLogSourcesInput) SetNextToken(v string) *ListLogSourcesInput { - s.NextToken = &v - return s -} - -// SetRegions sets the Regions field's value. -func (s *ListLogSourcesInput) SetRegions(v []*string) *ListLogSourcesInput { - s.Regions = v - return s -} - -// SetSources sets the Sources field's value. -func (s *ListLogSourcesInput) SetSources(v []*LogSourceResource) *ListLogSourcesInput { - s.Sources = v - return s -} - -type ListLogSourcesOutput struct { - _ struct{} `type:"structure"` - - // If nextToken is returned, there are more results available. You can repeat - // the call using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // The list of log sources in your organization that send data to the data lake. - Sources []*LogSource `locationName:"sources" type:"list"` -} - -// 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 ListLogSourcesOutput) 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 ListLogSourcesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLogSourcesOutput) SetNextToken(v string) *ListLogSourcesOutput { - s.NextToken = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *ListLogSourcesOutput) SetSources(v []*LogSource) *ListLogSourcesOutput { - s.Sources = v - return s -} - -type ListSubscribersInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of accounts for which the configuration is displayed. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. You can repeat - // the call using the returned token to retrieve the next page. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListSubscribersInput) 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 ListSubscribersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSubscribersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSubscribersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSubscribersInput) SetMaxResults(v int64) *ListSubscribersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscribersInput) SetNextToken(v string) *ListSubscribersInput { - s.NextToken = &v - return s -} - -type ListSubscribersOutput struct { - _ struct{} `type:"structure"` - - // If nextToken is returned, there are more results available. You can repeat - // the call using the returned token to retrieve the next page. - NextToken *string `locationName:"nextToken" type:"string"` - - // The subscribers available for the specified Security Lake account ID. - Subscribers []*SubscriberResource `locationName:"subscribers" type:"list"` -} - -// 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 ListSubscribersOutput) 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 ListSubscribersOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSubscribersOutput) SetNextToken(v string) *ListSubscribersOutput { - s.NextToken = &v - return s -} - -// SetSubscribers sets the Subscribers field's value. -func (s *ListSubscribersOutput) SetSubscribers(v []*SubscriberResource) *ListSubscribersOutput { - s.Subscribers = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Amazon Security Lake resource to retrieve - // the tags for. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // An array of objects, one for each tag (key and value) that’s associated - // with the Amazon Security Lake resource. - Tags []*Tag `locationName:"tags" type:"list"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Amazon Security Lake can collect logs and events from natively-supported -// Amazon Web Services services and custom sources. -type LogSource struct { - _ struct{} `type:"structure"` - - // Specify the account from which you want to collect logs. - Account *string `locationName:"account" min:"12" type:"string"` - - // Specify the Regions from which you want to collect logs. - Region *string `locationName:"region" type:"string"` - - // Specify the sources from which you want to collect logs. - Sources []*LogSourceResource `locationName:"sources" type:"list"` -} - -// 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 LogSource) 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 LogSource) GoString() string { - return s.String() -} - -// SetAccount sets the Account field's value. -func (s *LogSource) SetAccount(v string) *LogSource { - s.Account = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *LogSource) SetRegion(v string) *LogSource { - s.Region = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *LogSource) SetSources(v []*LogSourceResource) *LogSource { - s.Sources = v - return s -} - -// The supported source types from which logs and events are collected in Amazon -// Security Lake. For a list of supported Amazon Web Services, see the Amazon -// Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html). -type LogSourceResource struct { - _ struct{} `type:"structure"` - - // Amazon Security Lake supports log and event collection for natively supported - // Amazon Web Services. For more information, see the Amazon Security Lake User - // Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html). - AwsLogSource *AwsLogSourceResource `locationName:"awsLogSource" type:"structure"` - - // Amazon Security Lake supports custom source types. For more information, - // see the Amazon Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/custom-sources.html). - CustomLogSource *CustomLogSourceResource `locationName:"customLogSource" 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 LogSourceResource) 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 LogSourceResource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LogSourceResource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LogSourceResource"} - if s.CustomLogSource != nil { - if err := s.CustomLogSource.Validate(); err != nil { - invalidParams.AddNested("CustomLogSource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsLogSource sets the AwsLogSource field's value. -func (s *LogSourceResource) SetAwsLogSource(v *AwsLogSourceResource) *LogSourceResource { - s.AwsLogSource = v - return s -} - -// SetCustomLogSource sets the CustomLogSource field's value. -func (s *LogSourceResource) SetCustomLogSource(v *CustomLogSourceResource) *LogSourceResource { - s.CustomLogSource = v - return s -} - -// Specify the configurations you want to use for subscriber notification to -// notify the subscriber when new data is written to the data lake for sources -// that the subscriber consumes in Security Lake. -type NotificationConfiguration struct { - _ struct{} `type:"structure"` - - // The configurations for HTTPS subscriber notification. - HttpsNotificationConfiguration *HttpsNotificationConfiguration `locationName:"httpsNotificationConfiguration" type:"structure"` - - // The configurations for SQS subscriber notification. - SqsNotificationConfiguration *SqsNotificationConfiguration `locationName:"sqsNotificationConfiguration" 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 NotificationConfiguration) 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 NotificationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NotificationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NotificationConfiguration"} - if s.HttpsNotificationConfiguration != nil { - if err := s.HttpsNotificationConfiguration.Validate(); err != nil { - invalidParams.AddNested("HttpsNotificationConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpsNotificationConfiguration sets the HttpsNotificationConfiguration field's value. -func (s *NotificationConfiguration) SetHttpsNotificationConfiguration(v *HttpsNotificationConfiguration) *NotificationConfiguration { - s.HttpsNotificationConfiguration = v - return s -} - -// SetSqsNotificationConfiguration sets the SqsNotificationConfiguration field's value. -func (s *NotificationConfiguration) SetSqsNotificationConfiguration(v *SqsNotificationConfiguration) *NotificationConfiguration { - s.SqsNotificationConfiguration = v - return s -} - -type RegisterDataLakeDelegatedAdministratorInput struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services account ID of the Security Lake delegated administrator. - // - // AccountId is a required field - AccountId *string `locationName:"accountId" 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 RegisterDataLakeDelegatedAdministratorInput) 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 RegisterDataLakeDelegatedAdministratorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterDataLakeDelegatedAdministratorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterDataLakeDelegatedAdministratorInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *RegisterDataLakeDelegatedAdministratorInput) SetAccountId(v string) *RegisterDataLakeDelegatedAdministratorInput { - s.AccountId = &v - return s -} - -type RegisterDataLakeDelegatedAdministratorOutput 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 RegisterDataLakeDelegatedAdministratorOutput) 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 RegisterDataLakeDelegatedAdministratorOutput) GoString() string { - return s.String() -} - -// The resource could not be found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The name of the resource that could not be found. - ResourceName *string `locationName:"resourceName" type:"string"` - - // The type of the resource that could not be found. - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The configurations for SQS subscriber notification. -type SqsNotificationConfiguration 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 SqsNotificationConfiguration) 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 SqsNotificationConfiguration) GoString() string { - return s.String() -} - -// Provides details about the Amazon Security Lake account subscription. Subscribers -// are notified of new objects for a source as the data is written to your Amazon -// S3 bucket for Security Lake. -type SubscriberResource struct { - _ struct{} `type:"structure"` - - // You can choose to notify subscribers of new objects with an Amazon Simple - // Queue Service (Amazon SQS) queue or through messaging to an HTTPS endpoint - // provided by the subscriber. - // - // Subscribers can consume data by directly querying Lake Formation tables in - // your Amazon S3 bucket through services like Amazon Athena. This subscription - // type is defined as LAKEFORMATION. - AccessTypes []*string `locationName:"accessTypes" type:"list" enum:"AccessType"` - - // The date and time when the subscriber was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Resource Name (ARN) which uniquely defines the AWS RAM resource - // share. Before accepting the RAM resource share invitation, you can view details - // related to the RAM resource share. - // - // This field is available only for Lake Formation subscribers created after - // March 8, 2023. - ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` - - // The name of the resource share. - ResourceShareName *string `locationName:"resourceShareName" type:"string"` - - // The Amazon Resource Name (ARN) specifying the role of the subscriber. - RoleArn *string `locationName:"roleArn" type:"string"` - - // The ARN for the Amazon S3 bucket. - S3BucketArn *string `locationName:"s3BucketArn" type:"string"` - - // Amazon Security Lake supports log and event collection for natively supported - // Amazon Web Services. For more information, see the Amazon Security Lake User - // Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/source-management.html). - // - // Sources is a required field - Sources []*LogSourceResource `locationName:"sources" type:"list" required:"true"` - - // The subscriber ARN of the Amazon Security Lake subscriber account. - // - // SubscriberArn is a required field - SubscriberArn *string `locationName:"subscriberArn" min:"1" type:"string" required:"true"` - - // The subscriber descriptions for a subscriber account. The description for - // a subscriber includes subscriberName, accountID, externalID, and subscriberId. - SubscriberDescription *string `locationName:"subscriberDescription" type:"string"` - - // The subscriber endpoint to which exception messages are posted. - SubscriberEndpoint *string `locationName:"subscriberEndpoint" type:"string"` - - // The subscriber ID of the Amazon Security Lake subscriber account. - // - // SubscriberId is a required field - SubscriberId *string `locationName:"subscriberId" type:"string" required:"true"` - - // The AWS identity used to access your data. - // - // SubscriberIdentity is a required field - SubscriberIdentity *AwsIdentity `locationName:"subscriberIdentity" type:"structure" required:"true"` - - // The name of your Amazon Security Lake subscriber account. - // - // SubscriberName is a required field - SubscriberName *string `locationName:"subscriberName" type:"string" required:"true"` - - // The subscriber status of the Amazon Security Lake subscriber account. - SubscriberStatus *string `locationName:"subscriberStatus" type:"string" enum:"SubscriberStatus"` - - // The date and time when the subscriber was last updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601"` -} - -// 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 SubscriberResource) 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 SubscriberResource) GoString() string { - return s.String() -} - -// SetAccessTypes sets the AccessTypes field's value. -func (s *SubscriberResource) SetAccessTypes(v []*string) *SubscriberResource { - s.AccessTypes = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SubscriberResource) SetCreatedAt(v time.Time) *SubscriberResource { - s.CreatedAt = &v - return s -} - -// SetResourceShareArn sets the ResourceShareArn field's value. -func (s *SubscriberResource) SetResourceShareArn(v string) *SubscriberResource { - s.ResourceShareArn = &v - return s -} - -// SetResourceShareName sets the ResourceShareName field's value. -func (s *SubscriberResource) SetResourceShareName(v string) *SubscriberResource { - s.ResourceShareName = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *SubscriberResource) SetRoleArn(v string) *SubscriberResource { - s.RoleArn = &v - return s -} - -// SetS3BucketArn sets the S3BucketArn field's value. -func (s *SubscriberResource) SetS3BucketArn(v string) *SubscriberResource { - s.S3BucketArn = &v - return s -} - -// SetSources sets the Sources field's value. -func (s *SubscriberResource) SetSources(v []*LogSourceResource) *SubscriberResource { - s.Sources = v - return s -} - -// SetSubscriberArn sets the SubscriberArn field's value. -func (s *SubscriberResource) SetSubscriberArn(v string) *SubscriberResource { - s.SubscriberArn = &v - return s -} - -// SetSubscriberDescription sets the SubscriberDescription field's value. -func (s *SubscriberResource) SetSubscriberDescription(v string) *SubscriberResource { - s.SubscriberDescription = &v - return s -} - -// SetSubscriberEndpoint sets the SubscriberEndpoint field's value. -func (s *SubscriberResource) SetSubscriberEndpoint(v string) *SubscriberResource { - s.SubscriberEndpoint = &v - return s -} - -// SetSubscriberId sets the SubscriberId field's value. -func (s *SubscriberResource) SetSubscriberId(v string) *SubscriberResource { - s.SubscriberId = &v - return s -} - -// SetSubscriberIdentity sets the SubscriberIdentity field's value. -func (s *SubscriberResource) SetSubscriberIdentity(v *AwsIdentity) *SubscriberResource { - s.SubscriberIdentity = v - return s -} - -// SetSubscriberName sets the SubscriberName field's value. -func (s *SubscriberResource) SetSubscriberName(v string) *SubscriberResource { - s.SubscriberName = &v - return s -} - -// SetSubscriberStatus sets the SubscriberStatus field's value. -func (s *SubscriberResource) SetSubscriberStatus(v string) *SubscriberResource { - s.SubscriberStatus = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SubscriberResource) SetUpdatedAt(v time.Time) *SubscriberResource { - s.UpdatedAt = &v - return s -} - -// A tag is a label that you can define and associate with Amazon Web Services -// resources, including certain types of Amazon Security Lake resources. Tags -// can help you identify, categorize, and manage resources in different ways, -// such as by owner, environment, or other criteria. You can associate tags -// with the following types of Security Lake resources: subscribers, and the -// data lake configuration for your Amazon Web Services account in individual -// Amazon Web Services Regions. -// -// A resource can have up to 50 tags. Each tag consists of a required tag key -// and an associated tag value. A tag key is a general label that acts as a -// category for a more specific tag value. Each tag key must be unique and it -// can have only one tag value. A tag value acts as a descriptor for a tag key. -// Tag keys and values are case sensitive. They can contain letters, numbers, -// spaces, or the following symbols: _ . : / = + @ - -// -// For more information, see Tagging Amazon Security Lake resources (https://docs.aws.amazon.com/security-lake/latest/userguide/tagging-resources.html) -// in the Amazon Security Lake User Guide. -type Tag struct { - _ struct{} `type:"structure"` - - // The name of the tag. This is a general label that acts as a category for - // a more specific tag value (value). - // - // Key is a required field - Key *string `locationName:"key" min:"1" type:"string" required:"true"` - - // The value that’s associated with the specified tag key (key). This value - // acts as a descriptor for the tag key. A tag value cannot be null, but it - // can be an empty string. - // - // Value is a required field - Value *string `locationName:"value" 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 Tag) 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 Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon Security Lake resource to add - // or update the tags for. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // An array of objects, one for each tag (key and value) to associate with the - // Amazon Security Lake resource. For each tag, you must specify both a tag - // key and a tag value. A tag value cannot be null, but it can be an empty string. - // - // Tags is a required field - Tags []*Tag `locationName:"tags" type:"list" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The limit on the number of requests per second was exceeded. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // That the rate of requests to Security Lake is exceeding the request quotas - // for your Amazon Web Services account. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // Retry the request after the specified time. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The code for the service in Service Quotas. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the Amazon Security Lake resource to remove - // one or more tags from. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"1" type:"string" required:"true"` - - // A list of one or more tag keys. For each value in the list, specify the tag - // key for a tag to remove from the Amazon Security Lake resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateDataLakeExceptionSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The time-to-live (TTL) for the exception message to remain. - ExceptionTimeToLive *int64 `locationName:"exceptionTimeToLive" min:"1" type:"long"` - - // The account that is subscribed to receive exception notifications. - // - // NotificationEndpoint is a required field - NotificationEndpoint *string `locationName:"notificationEndpoint" type:"string" required:"true"` - - // The subscription protocol to which exception messages are posted. - // - // SubscriptionProtocol is a required field - SubscriptionProtocol *string `locationName:"subscriptionProtocol" 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 UpdateDataLakeExceptionSubscriptionInput) 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 UpdateDataLakeExceptionSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDataLakeExceptionSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDataLakeExceptionSubscriptionInput"} - if s.ExceptionTimeToLive != nil && *s.ExceptionTimeToLive < 1 { - invalidParams.Add(request.NewErrParamMinValue("ExceptionTimeToLive", 1)) - } - if s.NotificationEndpoint == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationEndpoint")) - } - if s.SubscriptionProtocol == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriptionProtocol")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExceptionTimeToLive sets the ExceptionTimeToLive field's value. -func (s *UpdateDataLakeExceptionSubscriptionInput) SetExceptionTimeToLive(v int64) *UpdateDataLakeExceptionSubscriptionInput { - s.ExceptionTimeToLive = &v - return s -} - -// SetNotificationEndpoint sets the NotificationEndpoint field's value. -func (s *UpdateDataLakeExceptionSubscriptionInput) SetNotificationEndpoint(v string) *UpdateDataLakeExceptionSubscriptionInput { - s.NotificationEndpoint = &v - return s -} - -// SetSubscriptionProtocol sets the SubscriptionProtocol field's value. -func (s *UpdateDataLakeExceptionSubscriptionInput) SetSubscriptionProtocol(v string) *UpdateDataLakeExceptionSubscriptionInput { - s.SubscriptionProtocol = &v - return s -} - -type UpdateDataLakeExceptionSubscriptionOutput 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 UpdateDataLakeExceptionSubscriptionOutput) 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 UpdateDataLakeExceptionSubscriptionOutput) GoString() string { - return s.String() -} - -type UpdateDataLakeInput struct { - _ struct{} `type:"structure"` - - // Specify the Region or Regions that will contribute data to the rollup region. - // - // Configurations is a required field - Configurations []*DataLakeConfiguration `locationName:"configurations" type:"list" 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 UpdateDataLakeInput) 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 UpdateDataLakeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDataLakeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDataLakeInput"} - if s.Configurations == nil { - invalidParams.Add(request.NewErrParamRequired("Configurations")) - } - if s.Configurations != nil { - for i, v := range s.Configurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Configurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfigurations sets the Configurations field's value. -func (s *UpdateDataLakeInput) SetConfigurations(v []*DataLakeConfiguration) *UpdateDataLakeInput { - s.Configurations = v - return s -} - -type UpdateDataLakeOutput struct { - _ struct{} `type:"structure"` - - // The created Security Lake configuration object. - DataLakes []*DataLakeResource `locationName:"dataLakes" type:"list"` -} - -// 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 UpdateDataLakeOutput) 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 UpdateDataLakeOutput) GoString() string { - return s.String() -} - -// SetDataLakes sets the DataLakes field's value. -func (s *UpdateDataLakeOutput) SetDataLakes(v []*DataLakeResource) *UpdateDataLakeOutput { - s.DataLakes = v - return s -} - -type UpdateSubscriberInput struct { - _ struct{} `type:"structure"` - - // The supported Amazon Web Services from which logs and events are collected. - // For the list of supported Amazon Web Services, see the Amazon Security Lake - // User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html). - Sources []*LogSourceResource `locationName:"sources" type:"list"` - - // The description of the Security Lake account subscriber. - SubscriberDescription *string `locationName:"subscriberDescription" type:"string"` - - // A value created by Security Lake that uniquely identifies your subscription. - // - // SubscriberId is a required field - SubscriberId *string `location:"uri" locationName:"subscriberId" type:"string" required:"true"` - - // The AWS identity used to access your data. - SubscriberIdentity *AwsIdentity `locationName:"subscriberIdentity" type:"structure"` - - // The name of the Security Lake account subscriber. - SubscriberName *string `locationName:"subscriberName" 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 UpdateSubscriberInput) 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 UpdateSubscriberInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSubscriberInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSubscriberInput"} - if s.SubscriberId == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriberId")) - } - if s.SubscriberId != nil && len(*s.SubscriberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubscriberId", 1)) - } - if s.Sources != nil { - for i, v := range s.Sources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Sources", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SubscriberIdentity != nil { - if err := s.SubscriberIdentity.Validate(); err != nil { - invalidParams.AddNested("SubscriberIdentity", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSources sets the Sources field's value. -func (s *UpdateSubscriberInput) SetSources(v []*LogSourceResource) *UpdateSubscriberInput { - s.Sources = v - return s -} - -// SetSubscriberDescription sets the SubscriberDescription field's value. -func (s *UpdateSubscriberInput) SetSubscriberDescription(v string) *UpdateSubscriberInput { - s.SubscriberDescription = &v - return s -} - -// SetSubscriberId sets the SubscriberId field's value. -func (s *UpdateSubscriberInput) SetSubscriberId(v string) *UpdateSubscriberInput { - s.SubscriberId = &v - return s -} - -// SetSubscriberIdentity sets the SubscriberIdentity field's value. -func (s *UpdateSubscriberInput) SetSubscriberIdentity(v *AwsIdentity) *UpdateSubscriberInput { - s.SubscriberIdentity = v - return s -} - -// SetSubscriberName sets the SubscriberName field's value. -func (s *UpdateSubscriberInput) SetSubscriberName(v string) *UpdateSubscriberInput { - s.SubscriberName = &v - return s -} - -type UpdateSubscriberNotificationInput struct { - _ struct{} `type:"structure"` - - // The configuration for subscriber notification. - // - // Configuration is a required field - Configuration *NotificationConfiguration `locationName:"configuration" type:"structure" required:"true"` - - // The subscription ID for which the subscription notification is specified. - // - // SubscriberId is a required field - SubscriberId *string `location:"uri" locationName:"subscriberId" 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 UpdateSubscriberNotificationInput) 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 UpdateSubscriberNotificationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSubscriberNotificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSubscriberNotificationInput"} - if s.Configuration == nil { - invalidParams.Add(request.NewErrParamRequired("Configuration")) - } - if s.SubscriberId == nil { - invalidParams.Add(request.NewErrParamRequired("SubscriberId")) - } - if s.SubscriberId != nil && len(*s.SubscriberId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubscriberId", 1)) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConfiguration sets the Configuration field's value. -func (s *UpdateSubscriberNotificationInput) SetConfiguration(v *NotificationConfiguration) *UpdateSubscriberNotificationInput { - s.Configuration = v - return s -} - -// SetSubscriberId sets the SubscriberId field's value. -func (s *UpdateSubscriberNotificationInput) SetSubscriberId(v string) *UpdateSubscriberNotificationInput { - s.SubscriberId = &v - return s -} - -type UpdateSubscriberNotificationOutput struct { - _ struct{} `type:"structure"` - - // The subscriber endpoint to which exception messages are posted. - SubscriberEndpoint *string `locationName:"subscriberEndpoint" 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 UpdateSubscriberNotificationOutput) 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 UpdateSubscriberNotificationOutput) GoString() string { - return s.String() -} - -// SetSubscriberEndpoint sets the SubscriberEndpoint field's value. -func (s *UpdateSubscriberNotificationOutput) SetSubscriberEndpoint(v string) *UpdateSubscriberNotificationOutput { - s.SubscriberEndpoint = &v - return s -} - -type UpdateSubscriberOutput struct { - _ struct{} `type:"structure"` - - // The updated subscriber information. - Subscriber *SubscriberResource `locationName:"subscriber" 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 UpdateSubscriberOutput) 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 UpdateSubscriberOutput) GoString() string { - return s.String() -} - -// SetSubscriber sets the Subscriber field's value. -func (s *UpdateSubscriberOutput) SetSubscriber(v *SubscriberResource) *UpdateSubscriberOutput { - s.Subscriber = v - return s -} - -const ( - // AccessTypeLakeformation is a AccessType enum value - AccessTypeLakeformation = "LAKEFORMATION" - - // AccessTypeS3 is a AccessType enum value - AccessTypeS3 = "S3" -) - -// AccessType_Values returns all elements of the AccessType enum -func AccessType_Values() []string { - return []string{ - AccessTypeLakeformation, - AccessTypeS3, - } -} - -const ( - // AwsLogSourceNameRoute53 is a AwsLogSourceName enum value - AwsLogSourceNameRoute53 = "ROUTE53" - - // AwsLogSourceNameVpcFlow is a AwsLogSourceName enum value - AwsLogSourceNameVpcFlow = "VPC_FLOW" - - // AwsLogSourceNameShFindings is a AwsLogSourceName enum value - AwsLogSourceNameShFindings = "SH_FINDINGS" - - // AwsLogSourceNameCloudTrailMgmt is a AwsLogSourceName enum value - AwsLogSourceNameCloudTrailMgmt = "CLOUD_TRAIL_MGMT" - - // AwsLogSourceNameLambdaExecution is a AwsLogSourceName enum value - AwsLogSourceNameLambdaExecution = "LAMBDA_EXECUTION" - - // AwsLogSourceNameS3Data is a AwsLogSourceName enum value - AwsLogSourceNameS3Data = "S3_DATA" -) - -// AwsLogSourceName_Values returns all elements of the AwsLogSourceName enum -func AwsLogSourceName_Values() []string { - return []string{ - AwsLogSourceNameRoute53, - AwsLogSourceNameVpcFlow, - AwsLogSourceNameShFindings, - AwsLogSourceNameCloudTrailMgmt, - AwsLogSourceNameLambdaExecution, - AwsLogSourceNameS3Data, - } -} - -const ( - // DataLakeStatusInitialized is a DataLakeStatus enum value - DataLakeStatusInitialized = "INITIALIZED" - - // DataLakeStatusPending is a DataLakeStatus enum value - DataLakeStatusPending = "PENDING" - - // DataLakeStatusCompleted is a DataLakeStatus enum value - DataLakeStatusCompleted = "COMPLETED" - - // DataLakeStatusFailed is a DataLakeStatus enum value - DataLakeStatusFailed = "FAILED" -) - -// DataLakeStatus_Values returns all elements of the DataLakeStatus enum -func DataLakeStatus_Values() []string { - return []string{ - DataLakeStatusInitialized, - DataLakeStatusPending, - DataLakeStatusCompleted, - DataLakeStatusFailed, - } -} - -const ( - // HttpMethodPost is a HttpMethod enum value - HttpMethodPost = "POST" - - // HttpMethodPut is a HttpMethod enum value - HttpMethodPut = "PUT" -) - -// HttpMethod_Values returns all elements of the HttpMethod enum -func HttpMethod_Values() []string { - return []string{ - HttpMethodPost, - HttpMethodPut, - } -} - -const ( - // SourceCollectionStatusCollecting is a SourceCollectionStatus enum value - SourceCollectionStatusCollecting = "COLLECTING" - - // SourceCollectionStatusMisconfigured is a SourceCollectionStatus enum value - SourceCollectionStatusMisconfigured = "MISCONFIGURED" - - // SourceCollectionStatusNotCollecting is a SourceCollectionStatus enum value - SourceCollectionStatusNotCollecting = "NOT_COLLECTING" -) - -// SourceCollectionStatus_Values returns all elements of the SourceCollectionStatus enum -func SourceCollectionStatus_Values() []string { - return []string{ - SourceCollectionStatusCollecting, - SourceCollectionStatusMisconfigured, - SourceCollectionStatusNotCollecting, - } -} - -const ( - // SubscriberStatusActive is a SubscriberStatus enum value - SubscriberStatusActive = "ACTIVE" - - // SubscriberStatusDeactivated is a SubscriberStatus enum value - SubscriberStatusDeactivated = "DEACTIVATED" - - // SubscriberStatusPending is a SubscriberStatus enum value - SubscriberStatusPending = "PENDING" - - // SubscriberStatusReady is a SubscriberStatus enum value - SubscriberStatusReady = "READY" -) - -// SubscriberStatus_Values returns all elements of the SubscriberStatus enum -func SubscriberStatus_Values() []string { - return []string{ - SubscriberStatusActive, - SubscriberStatusDeactivated, - SubscriberStatusPending, - SubscriberStatusReady, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/doc.go deleted file mode 100644 index bbb3066a288a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/doc.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package securitylake provides the client and types for making API -// requests to Amazon Security Lake. -// -// Amazon Security Lake is a fully managed security data lake service. You can -// use Security Lake to automatically centralize security data from cloud, on-premises, -// and custom sources into a data lake that's stored in your Amazon Web Services -// account. Amazon Web Services Organizations is an account management service -// that lets you consolidate multiple Amazon Web Services accounts into an organization -// that you create and centrally manage. With Organizations, you can create -// member accounts and invite existing accounts to join your organization. Security -// Lake helps you analyze security data for a more complete understanding of -// your security posture across the entire organization. It can also help you -// improve the protection of your workloads, applications, and data. -// -// The data lake is backed by Amazon Simple Storage Service (Amazon S3) buckets, -// and you retain ownership over your data. -// -// Amazon Security Lake integrates with CloudTrail, a service that provides -// a record of actions taken by a user, role, or an Amazon Web Services service. -// In Security Lake, CloudTrail captures API calls for Security Lake as events. -// The calls captured include calls from the Security Lake console and code -// calls to the Security Lake API operations. If you create a trail, you can -// enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including -// events for Security Lake. If you don't configure a trail, you can still view -// the most recent events in the CloudTrail console in Event history. Using -// the information collected by CloudTrail you can determine the request that -// was made to Security Lake, the IP address from which the request was made, -// who made the request, when it was made, and additional details. To learn -// more about Security Lake information in CloudTrail, see the Amazon Security -// Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/securitylake-cloudtrail.html). -// -// Security Lake automates the collection of security-related log and event -// data from integrated Amazon Web Services and third-party services. It also -// helps you manage the lifecycle of data with customizable retention and replication -// settings. Security Lake converts ingested data into Apache Parquet format -// and a standard open-source schema called the Open Cybersecurity Schema Framework -// (OCSF). -// -// Other Amazon Web Services and third-party services can subscribe to the data -// that's stored in Security Lake for incident response and security data analytics. -// -// See https://docs.aws.amazon.com/goto/WebAPI/securitylake-2018-05-10 for more information on this service. -// -// See securitylake package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/securitylake/ -// -// # Using the Client -// -// To contact Amazon Security Lake with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Security Lake client SecurityLake for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/securitylake/#New -package securitylake diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/errors.go deleted file mode 100644 index 17190a07cab2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package securitylake - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. Access denied errors - // appear when Amazon Security Lake explicitly or implicitly denies an authorization - // request. An explicit denial occurs when a policy contains a Deny statement - // for the specific Amazon Web Services action. An implicit denial occurs when - // there is no applicable Deny statement and also no applicable Allow statement. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeBadRequestException for service response error code - // "BadRequestException". - // - // The request is malformed or contains an error such as an invalid parameter - // value or a missing required parameter. - ErrCodeBadRequestException = "BadRequestException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Occurs when a conflict with a previous successful write is detected. This - // generally occurs when the previous write did not have time to propagate to - // the host serving the current request. A retry (with appropriate backoff logic) - // is the recommended response to this exception. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Internal service exceptions are sometimes caused by transient issues. Before - // you start troubleshooting, perform the operation again. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource could not be found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The limit on the number of requests per second was exceeded. - ErrCodeThrottlingException = "ThrottlingException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "BadRequestException": newErrorBadRequestException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/securitylakeiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/securitylakeiface/interface.go deleted file mode 100644 index 35c45d8bb0e7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/securitylakeiface/interface.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package securitylakeiface provides an interface to enable mocking the Amazon Security Lake service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package securitylakeiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake" -) - -// SecurityLakeAPI provides an interface to enable mocking the -// securitylake.SecurityLake service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Security Lake. -// func myFunc(svc securitylakeiface.SecurityLakeAPI) bool { -// // Make svc.CreateAwsLogSource request -// } -// -// func main() { -// sess := session.New() -// svc := securitylake.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSecurityLakeClient struct { -// securitylakeiface.SecurityLakeAPI -// } -// func (m *mockSecurityLakeClient) CreateAwsLogSource(input *securitylake.CreateAwsLogSourceInput) (*securitylake.CreateAwsLogSourceOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSecurityLakeClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type SecurityLakeAPI interface { - CreateAwsLogSource(*securitylake.CreateAwsLogSourceInput) (*securitylake.CreateAwsLogSourceOutput, error) - CreateAwsLogSourceWithContext(aws.Context, *securitylake.CreateAwsLogSourceInput, ...request.Option) (*securitylake.CreateAwsLogSourceOutput, error) - CreateAwsLogSourceRequest(*securitylake.CreateAwsLogSourceInput) (*request.Request, *securitylake.CreateAwsLogSourceOutput) - - CreateCustomLogSource(*securitylake.CreateCustomLogSourceInput) (*securitylake.CreateCustomLogSourceOutput, error) - CreateCustomLogSourceWithContext(aws.Context, *securitylake.CreateCustomLogSourceInput, ...request.Option) (*securitylake.CreateCustomLogSourceOutput, error) - CreateCustomLogSourceRequest(*securitylake.CreateCustomLogSourceInput) (*request.Request, *securitylake.CreateCustomLogSourceOutput) - - CreateDataLake(*securitylake.CreateDataLakeInput) (*securitylake.CreateDataLakeOutput, error) - CreateDataLakeWithContext(aws.Context, *securitylake.CreateDataLakeInput, ...request.Option) (*securitylake.CreateDataLakeOutput, error) - CreateDataLakeRequest(*securitylake.CreateDataLakeInput) (*request.Request, *securitylake.CreateDataLakeOutput) - - CreateDataLakeExceptionSubscription(*securitylake.CreateDataLakeExceptionSubscriptionInput) (*securitylake.CreateDataLakeExceptionSubscriptionOutput, error) - CreateDataLakeExceptionSubscriptionWithContext(aws.Context, *securitylake.CreateDataLakeExceptionSubscriptionInput, ...request.Option) (*securitylake.CreateDataLakeExceptionSubscriptionOutput, error) - CreateDataLakeExceptionSubscriptionRequest(*securitylake.CreateDataLakeExceptionSubscriptionInput) (*request.Request, *securitylake.CreateDataLakeExceptionSubscriptionOutput) - - CreateDataLakeOrganizationConfiguration(*securitylake.CreateDataLakeOrganizationConfigurationInput) (*securitylake.CreateDataLakeOrganizationConfigurationOutput, error) - CreateDataLakeOrganizationConfigurationWithContext(aws.Context, *securitylake.CreateDataLakeOrganizationConfigurationInput, ...request.Option) (*securitylake.CreateDataLakeOrganizationConfigurationOutput, error) - CreateDataLakeOrganizationConfigurationRequest(*securitylake.CreateDataLakeOrganizationConfigurationInput) (*request.Request, *securitylake.CreateDataLakeOrganizationConfigurationOutput) - - CreateSubscriber(*securitylake.CreateSubscriberInput) (*securitylake.CreateSubscriberOutput, error) - CreateSubscriberWithContext(aws.Context, *securitylake.CreateSubscriberInput, ...request.Option) (*securitylake.CreateSubscriberOutput, error) - CreateSubscriberRequest(*securitylake.CreateSubscriberInput) (*request.Request, *securitylake.CreateSubscriberOutput) - - CreateSubscriberNotification(*securitylake.CreateSubscriberNotificationInput) (*securitylake.CreateSubscriberNotificationOutput, error) - CreateSubscriberNotificationWithContext(aws.Context, *securitylake.CreateSubscriberNotificationInput, ...request.Option) (*securitylake.CreateSubscriberNotificationOutput, error) - CreateSubscriberNotificationRequest(*securitylake.CreateSubscriberNotificationInput) (*request.Request, *securitylake.CreateSubscriberNotificationOutput) - - DeleteAwsLogSource(*securitylake.DeleteAwsLogSourceInput) (*securitylake.DeleteAwsLogSourceOutput, error) - DeleteAwsLogSourceWithContext(aws.Context, *securitylake.DeleteAwsLogSourceInput, ...request.Option) (*securitylake.DeleteAwsLogSourceOutput, error) - DeleteAwsLogSourceRequest(*securitylake.DeleteAwsLogSourceInput) (*request.Request, *securitylake.DeleteAwsLogSourceOutput) - - DeleteCustomLogSource(*securitylake.DeleteCustomLogSourceInput) (*securitylake.DeleteCustomLogSourceOutput, error) - DeleteCustomLogSourceWithContext(aws.Context, *securitylake.DeleteCustomLogSourceInput, ...request.Option) (*securitylake.DeleteCustomLogSourceOutput, error) - DeleteCustomLogSourceRequest(*securitylake.DeleteCustomLogSourceInput) (*request.Request, *securitylake.DeleteCustomLogSourceOutput) - - DeleteDataLake(*securitylake.DeleteDataLakeInput) (*securitylake.DeleteDataLakeOutput, error) - DeleteDataLakeWithContext(aws.Context, *securitylake.DeleteDataLakeInput, ...request.Option) (*securitylake.DeleteDataLakeOutput, error) - DeleteDataLakeRequest(*securitylake.DeleteDataLakeInput) (*request.Request, *securitylake.DeleteDataLakeOutput) - - DeleteDataLakeExceptionSubscription(*securitylake.DeleteDataLakeExceptionSubscriptionInput) (*securitylake.DeleteDataLakeExceptionSubscriptionOutput, error) - DeleteDataLakeExceptionSubscriptionWithContext(aws.Context, *securitylake.DeleteDataLakeExceptionSubscriptionInput, ...request.Option) (*securitylake.DeleteDataLakeExceptionSubscriptionOutput, error) - DeleteDataLakeExceptionSubscriptionRequest(*securitylake.DeleteDataLakeExceptionSubscriptionInput) (*request.Request, *securitylake.DeleteDataLakeExceptionSubscriptionOutput) - - DeleteDataLakeOrganizationConfiguration(*securitylake.DeleteDataLakeOrganizationConfigurationInput) (*securitylake.DeleteDataLakeOrganizationConfigurationOutput, error) - DeleteDataLakeOrganizationConfigurationWithContext(aws.Context, *securitylake.DeleteDataLakeOrganizationConfigurationInput, ...request.Option) (*securitylake.DeleteDataLakeOrganizationConfigurationOutput, error) - DeleteDataLakeOrganizationConfigurationRequest(*securitylake.DeleteDataLakeOrganizationConfigurationInput) (*request.Request, *securitylake.DeleteDataLakeOrganizationConfigurationOutput) - - DeleteSubscriber(*securitylake.DeleteSubscriberInput) (*securitylake.DeleteSubscriberOutput, error) - DeleteSubscriberWithContext(aws.Context, *securitylake.DeleteSubscriberInput, ...request.Option) (*securitylake.DeleteSubscriberOutput, error) - DeleteSubscriberRequest(*securitylake.DeleteSubscriberInput) (*request.Request, *securitylake.DeleteSubscriberOutput) - - DeleteSubscriberNotification(*securitylake.DeleteSubscriberNotificationInput) (*securitylake.DeleteSubscriberNotificationOutput, error) - DeleteSubscriberNotificationWithContext(aws.Context, *securitylake.DeleteSubscriberNotificationInput, ...request.Option) (*securitylake.DeleteSubscriberNotificationOutput, error) - DeleteSubscriberNotificationRequest(*securitylake.DeleteSubscriberNotificationInput) (*request.Request, *securitylake.DeleteSubscriberNotificationOutput) - - DeregisterDataLakeDelegatedAdministrator(*securitylake.DeregisterDataLakeDelegatedAdministratorInput) (*securitylake.DeregisterDataLakeDelegatedAdministratorOutput, error) - DeregisterDataLakeDelegatedAdministratorWithContext(aws.Context, *securitylake.DeregisterDataLakeDelegatedAdministratorInput, ...request.Option) (*securitylake.DeregisterDataLakeDelegatedAdministratorOutput, error) - DeregisterDataLakeDelegatedAdministratorRequest(*securitylake.DeregisterDataLakeDelegatedAdministratorInput) (*request.Request, *securitylake.DeregisterDataLakeDelegatedAdministratorOutput) - - GetDataLakeExceptionSubscription(*securitylake.GetDataLakeExceptionSubscriptionInput) (*securitylake.GetDataLakeExceptionSubscriptionOutput, error) - GetDataLakeExceptionSubscriptionWithContext(aws.Context, *securitylake.GetDataLakeExceptionSubscriptionInput, ...request.Option) (*securitylake.GetDataLakeExceptionSubscriptionOutput, error) - GetDataLakeExceptionSubscriptionRequest(*securitylake.GetDataLakeExceptionSubscriptionInput) (*request.Request, *securitylake.GetDataLakeExceptionSubscriptionOutput) - - GetDataLakeOrganizationConfiguration(*securitylake.GetDataLakeOrganizationConfigurationInput) (*securitylake.GetDataLakeOrganizationConfigurationOutput, error) - GetDataLakeOrganizationConfigurationWithContext(aws.Context, *securitylake.GetDataLakeOrganizationConfigurationInput, ...request.Option) (*securitylake.GetDataLakeOrganizationConfigurationOutput, error) - GetDataLakeOrganizationConfigurationRequest(*securitylake.GetDataLakeOrganizationConfigurationInput) (*request.Request, *securitylake.GetDataLakeOrganizationConfigurationOutput) - - GetDataLakeSources(*securitylake.GetDataLakeSourcesInput) (*securitylake.GetDataLakeSourcesOutput, error) - GetDataLakeSourcesWithContext(aws.Context, *securitylake.GetDataLakeSourcesInput, ...request.Option) (*securitylake.GetDataLakeSourcesOutput, error) - GetDataLakeSourcesRequest(*securitylake.GetDataLakeSourcesInput) (*request.Request, *securitylake.GetDataLakeSourcesOutput) - - GetDataLakeSourcesPages(*securitylake.GetDataLakeSourcesInput, func(*securitylake.GetDataLakeSourcesOutput, bool) bool) error - GetDataLakeSourcesPagesWithContext(aws.Context, *securitylake.GetDataLakeSourcesInput, func(*securitylake.GetDataLakeSourcesOutput, bool) bool, ...request.Option) error - - GetSubscriber(*securitylake.GetSubscriberInput) (*securitylake.GetSubscriberOutput, error) - GetSubscriberWithContext(aws.Context, *securitylake.GetSubscriberInput, ...request.Option) (*securitylake.GetSubscriberOutput, error) - GetSubscriberRequest(*securitylake.GetSubscriberInput) (*request.Request, *securitylake.GetSubscriberOutput) - - ListDataLakeExceptions(*securitylake.ListDataLakeExceptionsInput) (*securitylake.ListDataLakeExceptionsOutput, error) - ListDataLakeExceptionsWithContext(aws.Context, *securitylake.ListDataLakeExceptionsInput, ...request.Option) (*securitylake.ListDataLakeExceptionsOutput, error) - ListDataLakeExceptionsRequest(*securitylake.ListDataLakeExceptionsInput) (*request.Request, *securitylake.ListDataLakeExceptionsOutput) - - ListDataLakeExceptionsPages(*securitylake.ListDataLakeExceptionsInput, func(*securitylake.ListDataLakeExceptionsOutput, bool) bool) error - ListDataLakeExceptionsPagesWithContext(aws.Context, *securitylake.ListDataLakeExceptionsInput, func(*securitylake.ListDataLakeExceptionsOutput, bool) bool, ...request.Option) error - - ListDataLakes(*securitylake.ListDataLakesInput) (*securitylake.ListDataLakesOutput, error) - ListDataLakesWithContext(aws.Context, *securitylake.ListDataLakesInput, ...request.Option) (*securitylake.ListDataLakesOutput, error) - ListDataLakesRequest(*securitylake.ListDataLakesInput) (*request.Request, *securitylake.ListDataLakesOutput) - - ListLogSources(*securitylake.ListLogSourcesInput) (*securitylake.ListLogSourcesOutput, error) - ListLogSourcesWithContext(aws.Context, *securitylake.ListLogSourcesInput, ...request.Option) (*securitylake.ListLogSourcesOutput, error) - ListLogSourcesRequest(*securitylake.ListLogSourcesInput) (*request.Request, *securitylake.ListLogSourcesOutput) - - ListLogSourcesPages(*securitylake.ListLogSourcesInput, func(*securitylake.ListLogSourcesOutput, bool) bool) error - ListLogSourcesPagesWithContext(aws.Context, *securitylake.ListLogSourcesInput, func(*securitylake.ListLogSourcesOutput, bool) bool, ...request.Option) error - - ListSubscribers(*securitylake.ListSubscribersInput) (*securitylake.ListSubscribersOutput, error) - ListSubscribersWithContext(aws.Context, *securitylake.ListSubscribersInput, ...request.Option) (*securitylake.ListSubscribersOutput, error) - ListSubscribersRequest(*securitylake.ListSubscribersInput) (*request.Request, *securitylake.ListSubscribersOutput) - - ListSubscribersPages(*securitylake.ListSubscribersInput, func(*securitylake.ListSubscribersOutput, bool) bool) error - ListSubscribersPagesWithContext(aws.Context, *securitylake.ListSubscribersInput, func(*securitylake.ListSubscribersOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*securitylake.ListTagsForResourceInput) (*securitylake.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *securitylake.ListTagsForResourceInput, ...request.Option) (*securitylake.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*securitylake.ListTagsForResourceInput) (*request.Request, *securitylake.ListTagsForResourceOutput) - - RegisterDataLakeDelegatedAdministrator(*securitylake.RegisterDataLakeDelegatedAdministratorInput) (*securitylake.RegisterDataLakeDelegatedAdministratorOutput, error) - RegisterDataLakeDelegatedAdministratorWithContext(aws.Context, *securitylake.RegisterDataLakeDelegatedAdministratorInput, ...request.Option) (*securitylake.RegisterDataLakeDelegatedAdministratorOutput, error) - RegisterDataLakeDelegatedAdministratorRequest(*securitylake.RegisterDataLakeDelegatedAdministratorInput) (*request.Request, *securitylake.RegisterDataLakeDelegatedAdministratorOutput) - - TagResource(*securitylake.TagResourceInput) (*securitylake.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *securitylake.TagResourceInput, ...request.Option) (*securitylake.TagResourceOutput, error) - TagResourceRequest(*securitylake.TagResourceInput) (*request.Request, *securitylake.TagResourceOutput) - - UntagResource(*securitylake.UntagResourceInput) (*securitylake.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *securitylake.UntagResourceInput, ...request.Option) (*securitylake.UntagResourceOutput, error) - UntagResourceRequest(*securitylake.UntagResourceInput) (*request.Request, *securitylake.UntagResourceOutput) - - UpdateDataLake(*securitylake.UpdateDataLakeInput) (*securitylake.UpdateDataLakeOutput, error) - UpdateDataLakeWithContext(aws.Context, *securitylake.UpdateDataLakeInput, ...request.Option) (*securitylake.UpdateDataLakeOutput, error) - UpdateDataLakeRequest(*securitylake.UpdateDataLakeInput) (*request.Request, *securitylake.UpdateDataLakeOutput) - - UpdateDataLakeExceptionSubscription(*securitylake.UpdateDataLakeExceptionSubscriptionInput) (*securitylake.UpdateDataLakeExceptionSubscriptionOutput, error) - UpdateDataLakeExceptionSubscriptionWithContext(aws.Context, *securitylake.UpdateDataLakeExceptionSubscriptionInput, ...request.Option) (*securitylake.UpdateDataLakeExceptionSubscriptionOutput, error) - UpdateDataLakeExceptionSubscriptionRequest(*securitylake.UpdateDataLakeExceptionSubscriptionInput) (*request.Request, *securitylake.UpdateDataLakeExceptionSubscriptionOutput) - - UpdateSubscriber(*securitylake.UpdateSubscriberInput) (*securitylake.UpdateSubscriberOutput, error) - UpdateSubscriberWithContext(aws.Context, *securitylake.UpdateSubscriberInput, ...request.Option) (*securitylake.UpdateSubscriberOutput, error) - UpdateSubscriberRequest(*securitylake.UpdateSubscriberInput) (*request.Request, *securitylake.UpdateSubscriberOutput) - - UpdateSubscriberNotification(*securitylake.UpdateSubscriberNotificationInput) (*securitylake.UpdateSubscriberNotificationOutput, error) - UpdateSubscriberNotificationWithContext(aws.Context, *securitylake.UpdateSubscriberNotificationInput, ...request.Option) (*securitylake.UpdateSubscriberNotificationOutput, error) - UpdateSubscriberNotificationRequest(*securitylake.UpdateSubscriberNotificationInput) (*request.Request, *securitylake.UpdateSubscriberNotificationOutput) -} - -var _ SecurityLakeAPI = (*securitylake.SecurityLake)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/service.go deleted file mode 100644 index 3eea64c03f1e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/securitylake/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package securitylake - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// SecurityLake provides the API operation methods for making requests to -// Amazon Security Lake. See this package's package overview docs -// for details on the service. -// -// SecurityLake methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type SecurityLake struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "SecurityLake" // Name of service. - EndpointsID = "securitylake" // ID to lookup a service endpoint with. - ServiceID = "SecurityLake" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the SecurityLake client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a SecurityLake client from just a session. -// svc := securitylake.New(mySession) -// -// // Create a SecurityLake client with additional configuration -// svc := securitylake.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SecurityLake { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "securitylake" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *SecurityLake { - svc := &SecurityLake{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SecurityLake operation and runs any -// custom request initialization. -func (c *SecurityLake) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/api.go deleted file mode 100644 index 11e8270da094..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/api.go +++ /dev/null @@ -1,4696 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package simspaceweaver - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateSnapshot = "CreateSnapshot" - -// CreateSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the CreateSnapshot 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 CreateSnapshot for more information on using the CreateSnapshot -// 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 CreateSnapshotRequest method. -// req, resp := client.CreateSnapshotRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/CreateSnapshot -func (c *SimSpaceWeaver) CreateSnapshotRequest(input *CreateSnapshotInput) (req *request.Request, output *CreateSnapshotOutput) { - op := &request.Operation{ - Name: opCreateSnapshot, - HTTPMethod: "POST", - HTTPPath: "/createsnapshot", - } - - if input == nil { - input = &CreateSnapshotInput{} - } - - output = &CreateSnapshotOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateSnapshot API operation for AWS SimSpace Weaver. -// -// Creates a snapshot of the specified simulation. A snapshot is a file that -// contains simulation state data at a specific time. The state data saved in -// a snapshot includes entity data from the State Fabric, the simulation configuration -// specified in the schema, and the clock tick number. You can use the snapshot -// to initialize a new simulation. For more information about snapshots, see -// Snapshots (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/working-with_snapshots.html) -// in the SimSpace Weaver User Guide. -// -// You specify a Destination when you create a snapshot. The Destination is -// the name of an Amazon S3 bucket and an optional ObjectKeyPrefix. The ObjectKeyPrefix -// is usually the name of a folder in the bucket. SimSpace Weaver creates a -// snapshot folder inside the Destination and places the snapshot file there. -// -// The snapshot file is an Amazon S3 object. It has an object key with the form: -// object-key-prefix/snapshot/simulation-name-YYMMdd-HHmm-ss.zip, where: -// -// - YY is the 2-digit year -// -// - MM is the 2-digit month -// -// - dd is the 2-digit day of the month -// -// - HH is the 2-digit hour (24-hour clock) -// -// - mm is the 2-digit minutes -// -// - ss is the 2-digit seconds -// -// 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 AWS SimSpace Weaver's -// API operation CreateSnapshot for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/CreateSnapshot -func (c *SimSpaceWeaver) CreateSnapshot(input *CreateSnapshotInput) (*CreateSnapshotOutput, error) { - req, out := c.CreateSnapshotRequest(input) - return out, req.Send() -} - -// CreateSnapshotWithContext is the same as CreateSnapshot with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSnapshot 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 *SimSpaceWeaver) CreateSnapshotWithContext(ctx aws.Context, input *CreateSnapshotInput, opts ...request.Option) (*CreateSnapshotOutput, error) { - req, out := c.CreateSnapshotRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteApp = "DeleteApp" - -// DeleteAppRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApp 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 DeleteApp for more information on using the DeleteApp -// 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 DeleteAppRequest method. -// req, resp := client.DeleteAppRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/DeleteApp -func (c *SimSpaceWeaver) DeleteAppRequest(input *DeleteAppInput) (req *request.Request, output *DeleteAppOutput) { - op := &request.Operation{ - Name: opDeleteApp, - HTTPMethod: "DELETE", - HTTPPath: "/deleteapp", - } - - if input == nil { - input = &DeleteAppInput{} - } - - output = &DeleteAppOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteApp API operation for AWS SimSpace Weaver. -// -// Deletes the instance of the given custom app. -// -// 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 AWS SimSpace Weaver's -// API operation DeleteApp for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/DeleteApp -func (c *SimSpaceWeaver) DeleteApp(input *DeleteAppInput) (*DeleteAppOutput, error) { - req, out := c.DeleteAppRequest(input) - return out, req.Send() -} - -// DeleteAppWithContext is the same as DeleteApp with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteApp 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 *SimSpaceWeaver) DeleteAppWithContext(ctx aws.Context, input *DeleteAppInput, opts ...request.Option) (*DeleteAppOutput, error) { - req, out := c.DeleteAppRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSimulation = "DeleteSimulation" - -// DeleteSimulationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSimulation 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 DeleteSimulation for more information on using the DeleteSimulation -// 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 DeleteSimulationRequest method. -// req, resp := client.DeleteSimulationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/DeleteSimulation -func (c *SimSpaceWeaver) DeleteSimulationRequest(input *DeleteSimulationInput) (req *request.Request, output *DeleteSimulationOutput) { - op := &request.Operation{ - Name: opDeleteSimulation, - HTTPMethod: "DELETE", - HTTPPath: "/deletesimulation", - } - - if input == nil { - input = &DeleteSimulationInput{} - } - - output = &DeleteSimulationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSimulation API operation for AWS SimSpace Weaver. -// -// Deletes all SimSpace Weaver resources assigned to the given simulation. -// -// Your simulation uses resources in other Amazon Web Services. This API operation -// doesn't delete resources in other Amazon Web Services. -// -// 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 AWS SimSpace Weaver's -// API operation DeleteSimulation for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/DeleteSimulation -func (c *SimSpaceWeaver) DeleteSimulation(input *DeleteSimulationInput) (*DeleteSimulationOutput, error) { - req, out := c.DeleteSimulationRequest(input) - return out, req.Send() -} - -// DeleteSimulationWithContext is the same as DeleteSimulation with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSimulation 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 *SimSpaceWeaver) DeleteSimulationWithContext(ctx aws.Context, input *DeleteSimulationInput, opts ...request.Option) (*DeleteSimulationOutput, error) { - req, out := c.DeleteSimulationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeApp = "DescribeApp" - -// DescribeAppRequest generates a "aws/request.Request" representing the -// client's request for the DescribeApp 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 DescribeApp for more information on using the DescribeApp -// 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 DescribeAppRequest method. -// req, resp := client.DescribeAppRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/DescribeApp -func (c *SimSpaceWeaver) DescribeAppRequest(input *DescribeAppInput) (req *request.Request, output *DescribeAppOutput) { - op := &request.Operation{ - Name: opDescribeApp, - HTTPMethod: "GET", - HTTPPath: "/describeapp", - } - - if input == nil { - input = &DescribeAppInput{} - } - - output = &DescribeAppOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeApp API operation for AWS SimSpace Weaver. -// -// Returns the state of the given custom app. -// -// 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 AWS SimSpace Weaver's -// API operation DescribeApp for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/DescribeApp -func (c *SimSpaceWeaver) DescribeApp(input *DescribeAppInput) (*DescribeAppOutput, error) { - req, out := c.DescribeAppRequest(input) - return out, req.Send() -} - -// DescribeAppWithContext is the same as DescribeApp with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeApp 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 *SimSpaceWeaver) DescribeAppWithContext(ctx aws.Context, input *DescribeAppInput, opts ...request.Option) (*DescribeAppOutput, error) { - req, out := c.DescribeAppRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSimulation = "DescribeSimulation" - -// DescribeSimulationRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSimulation 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 DescribeSimulation for more information on using the DescribeSimulation -// 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 DescribeSimulationRequest method. -// req, resp := client.DescribeSimulationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/DescribeSimulation -func (c *SimSpaceWeaver) DescribeSimulationRequest(input *DescribeSimulationInput) (req *request.Request, output *DescribeSimulationOutput) { - op := &request.Operation{ - Name: opDescribeSimulation, - HTTPMethod: "GET", - HTTPPath: "/describesimulation", - } - - if input == nil { - input = &DescribeSimulationInput{} - } - - output = &DescribeSimulationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeSimulation API operation for AWS SimSpace Weaver. -// -// Returns the current state of the given simulation. -// -// 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 AWS SimSpace Weaver's -// API operation DescribeSimulation for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/DescribeSimulation -func (c *SimSpaceWeaver) DescribeSimulation(input *DescribeSimulationInput) (*DescribeSimulationOutput, error) { - req, out := c.DescribeSimulationRequest(input) - return out, req.Send() -} - -// DescribeSimulationWithContext is the same as DescribeSimulation with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSimulation 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 *SimSpaceWeaver) DescribeSimulationWithContext(ctx aws.Context, input *DescribeSimulationInput, opts ...request.Option) (*DescribeSimulationOutput, error) { - req, out := c.DescribeSimulationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListApps = "ListApps" - -// ListAppsRequest generates a "aws/request.Request" representing the -// client's request for the ListApps 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 ListApps for more information on using the ListApps -// 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 ListAppsRequest method. -// req, resp := client.ListAppsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/ListApps -func (c *SimSpaceWeaver) ListAppsRequest(input *ListAppsInput) (req *request.Request, output *ListAppsOutput) { - op := &request.Operation{ - Name: opListApps, - HTTPMethod: "GET", - HTTPPath: "/listapps", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAppsInput{} - } - - output = &ListAppsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListApps API operation for AWS SimSpace Weaver. -// -// Lists all custom apps or service apps for the given simulation and domain. -// -// 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 AWS SimSpace Weaver's -// API operation ListApps for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/ListApps -func (c *SimSpaceWeaver) ListApps(input *ListAppsInput) (*ListAppsOutput, error) { - req, out := c.ListAppsRequest(input) - return out, req.Send() -} - -// ListAppsWithContext is the same as ListApps with the addition of -// the ability to pass a context and additional request options. -// -// See ListApps 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 *SimSpaceWeaver) ListAppsWithContext(ctx aws.Context, input *ListAppsInput, opts ...request.Option) (*ListAppsOutput, error) { - req, out := c.ListAppsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAppsPages iterates over the pages of a ListApps operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApps method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListApps operation. -// pageNum := 0 -// err := client.ListAppsPages(params, -// func(page *simspaceweaver.ListAppsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SimSpaceWeaver) ListAppsPages(input *ListAppsInput, fn func(*ListAppsOutput, bool) bool) error { - return c.ListAppsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAppsPagesWithContext same as ListAppsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SimSpaceWeaver) ListAppsPagesWithContext(ctx aws.Context, input *ListAppsInput, fn func(*ListAppsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAppsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAppsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAppsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSimulations = "ListSimulations" - -// ListSimulationsRequest generates a "aws/request.Request" representing the -// client's request for the ListSimulations 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 ListSimulations for more information on using the ListSimulations -// 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 ListSimulationsRequest method. -// req, resp := client.ListSimulationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/ListSimulations -func (c *SimSpaceWeaver) ListSimulationsRequest(input *ListSimulationsInput) (req *request.Request, output *ListSimulationsOutput) { - op := &request.Operation{ - Name: opListSimulations, - HTTPMethod: "GET", - HTTPPath: "/listsimulations", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSimulationsInput{} - } - - output = &ListSimulationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSimulations API operation for AWS SimSpace Weaver. -// -// Lists the SimSpace Weaver simulations in the Amazon Web Services account -// used to make the API call. -// -// 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 AWS SimSpace Weaver's -// API operation ListSimulations for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/ListSimulations -func (c *SimSpaceWeaver) ListSimulations(input *ListSimulationsInput) (*ListSimulationsOutput, error) { - req, out := c.ListSimulationsRequest(input) - return out, req.Send() -} - -// ListSimulationsWithContext is the same as ListSimulations with the addition of -// the ability to pass a context and additional request options. -// -// See ListSimulations 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 *SimSpaceWeaver) ListSimulationsWithContext(ctx aws.Context, input *ListSimulationsInput, opts ...request.Option) (*ListSimulationsOutput, error) { - req, out := c.ListSimulationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSimulationsPages iterates over the pages of a ListSimulations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSimulations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSimulations operation. -// pageNum := 0 -// err := client.ListSimulationsPages(params, -// func(page *simspaceweaver.ListSimulationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SimSpaceWeaver) ListSimulationsPages(input *ListSimulationsInput, fn func(*ListSimulationsOutput, bool) bool) error { - return c.ListSimulationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSimulationsPagesWithContext same as ListSimulationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SimSpaceWeaver) ListSimulationsPagesWithContext(ctx aws.Context, input *ListSimulationsInput, fn func(*ListSimulationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSimulationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSimulationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSimulationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/ListTagsForResource -func (c *SimSpaceWeaver) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS SimSpace Weaver. -// -// Lists all tags on a SimSpace Weaver resource. -// -// 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 AWS SimSpace Weaver's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/ListTagsForResource -func (c *SimSpaceWeaver) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *SimSpaceWeaver) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartApp = "StartApp" - -// StartAppRequest generates a "aws/request.Request" representing the -// client's request for the StartApp 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 StartApp for more information on using the StartApp -// 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 StartAppRequest method. -// req, resp := client.StartAppRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StartApp -func (c *SimSpaceWeaver) StartAppRequest(input *StartAppInput) (req *request.Request, output *StartAppOutput) { - op := &request.Operation{ - Name: opStartApp, - HTTPMethod: "POST", - HTTPPath: "/startapp", - } - - if input == nil { - input = &StartAppInput{} - } - - output = &StartAppOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartApp API operation for AWS SimSpace Weaver. -// -// Starts a custom app with the configuration specified in the simulation schema. -// -// 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 AWS SimSpace Weaver's -// API operation StartApp for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StartApp -func (c *SimSpaceWeaver) StartApp(input *StartAppInput) (*StartAppOutput, error) { - req, out := c.StartAppRequest(input) - return out, req.Send() -} - -// StartAppWithContext is the same as StartApp with the addition of -// the ability to pass a context and additional request options. -// -// See StartApp 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 *SimSpaceWeaver) StartAppWithContext(ctx aws.Context, input *StartAppInput, opts ...request.Option) (*StartAppOutput, error) { - req, out := c.StartAppRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartClock = "StartClock" - -// StartClockRequest generates a "aws/request.Request" representing the -// client's request for the StartClock 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 StartClock for more information on using the StartClock -// 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 StartClockRequest method. -// req, resp := client.StartClockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StartClock -func (c *SimSpaceWeaver) StartClockRequest(input *StartClockInput) (req *request.Request, output *StartClockOutput) { - op := &request.Operation{ - Name: opStartClock, - HTTPMethod: "POST", - HTTPPath: "/startclock", - } - - if input == nil { - input = &StartClockInput{} - } - - output = &StartClockOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartClock API operation for AWS SimSpace Weaver. -// -// Starts the simulation clock. -// -// 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 AWS SimSpace Weaver's -// API operation StartClock for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StartClock -func (c *SimSpaceWeaver) StartClock(input *StartClockInput) (*StartClockOutput, error) { - req, out := c.StartClockRequest(input) - return out, req.Send() -} - -// StartClockWithContext is the same as StartClock with the addition of -// the ability to pass a context and additional request options. -// -// See StartClock 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 *SimSpaceWeaver) StartClockWithContext(ctx aws.Context, input *StartClockInput, opts ...request.Option) (*StartClockOutput, error) { - req, out := c.StartClockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartSimulation = "StartSimulation" - -// StartSimulationRequest generates a "aws/request.Request" representing the -// client's request for the StartSimulation 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 StartSimulation for more information on using the StartSimulation -// 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 StartSimulationRequest method. -// req, resp := client.StartSimulationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StartSimulation -func (c *SimSpaceWeaver) StartSimulationRequest(input *StartSimulationInput) (req *request.Request, output *StartSimulationOutput) { - op := &request.Operation{ - Name: opStartSimulation, - HTTPMethod: "POST", - HTTPPath: "/startsimulation", - } - - if input == nil { - input = &StartSimulationInput{} - } - - output = &StartSimulationOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartSimulation API operation for AWS SimSpace Weaver. -// -// Starts a simulation with the given name. You must choose to start your simulation -// from a schema or from a snapshot. For more information about the schema, -// see the schema reference (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/schema-reference.html) -// in the SimSpace Weaver User Guide. For more information about snapshots, -// see Snapshots (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/working-with_snapshots.html) -// in the SimSpace Weaver User Guide. -// -// 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 AWS SimSpace Weaver's -// API operation StartSimulation for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ServiceQuotaExceededException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StartSimulation -func (c *SimSpaceWeaver) StartSimulation(input *StartSimulationInput) (*StartSimulationOutput, error) { - req, out := c.StartSimulationRequest(input) - return out, req.Send() -} - -// StartSimulationWithContext is the same as StartSimulation with the addition of -// the ability to pass a context and additional request options. -// -// See StartSimulation 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 *SimSpaceWeaver) StartSimulationWithContext(ctx aws.Context, input *StartSimulationInput, opts ...request.Option) (*StartSimulationOutput, error) { - req, out := c.StartSimulationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopApp = "StopApp" - -// StopAppRequest generates a "aws/request.Request" representing the -// client's request for the StopApp 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 StopApp for more information on using the StopApp -// 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 StopAppRequest method. -// req, resp := client.StopAppRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StopApp -func (c *SimSpaceWeaver) StopAppRequest(input *StopAppInput) (req *request.Request, output *StopAppOutput) { - op := &request.Operation{ - Name: opStopApp, - HTTPMethod: "POST", - HTTPPath: "/stopapp", - } - - if input == nil { - input = &StopAppInput{} - } - - output = &StopAppOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopApp API operation for AWS SimSpace Weaver. -// -// Stops the given custom app and shuts down all of its allocated compute resources. -// -// 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 AWS SimSpace Weaver's -// API operation StopApp for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StopApp -func (c *SimSpaceWeaver) StopApp(input *StopAppInput) (*StopAppOutput, error) { - req, out := c.StopAppRequest(input) - return out, req.Send() -} - -// StopAppWithContext is the same as StopApp with the addition of -// the ability to pass a context and additional request options. -// -// See StopApp 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 *SimSpaceWeaver) StopAppWithContext(ctx aws.Context, input *StopAppInput, opts ...request.Option) (*StopAppOutput, error) { - req, out := c.StopAppRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopClock = "StopClock" - -// StopClockRequest generates a "aws/request.Request" representing the -// client's request for the StopClock 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 StopClock for more information on using the StopClock -// 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 StopClockRequest method. -// req, resp := client.StopClockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StopClock -func (c *SimSpaceWeaver) StopClockRequest(input *StopClockInput) (req *request.Request, output *StopClockOutput) { - op := &request.Operation{ - Name: opStopClock, - HTTPMethod: "POST", - HTTPPath: "/stopclock", - } - - if input == nil { - input = &StopClockInput{} - } - - output = &StopClockOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopClock API operation for AWS SimSpace Weaver. -// -// Stops the simulation clock. -// -// 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 AWS SimSpace Weaver's -// API operation StopClock for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StopClock -func (c *SimSpaceWeaver) StopClock(input *StopClockInput) (*StopClockOutput, error) { - req, out := c.StopClockRequest(input) - return out, req.Send() -} - -// StopClockWithContext is the same as StopClock with the addition of -// the ability to pass a context and additional request options. -// -// See StopClock 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 *SimSpaceWeaver) StopClockWithContext(ctx aws.Context, input *StopClockInput, opts ...request.Option) (*StopClockOutput, error) { - req, out := c.StopClockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopSimulation = "StopSimulation" - -// StopSimulationRequest generates a "aws/request.Request" representing the -// client's request for the StopSimulation 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 StopSimulation for more information on using the StopSimulation -// 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 StopSimulationRequest method. -// req, resp := client.StopSimulationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StopSimulation -func (c *SimSpaceWeaver) StopSimulationRequest(input *StopSimulationInput) (req *request.Request, output *StopSimulationOutput) { - op := &request.Operation{ - Name: opStopSimulation, - HTTPMethod: "POST", - HTTPPath: "/stopsimulation", - } - - if input == nil { - input = &StopSimulationInput{} - } - - output = &StopSimulationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopSimulation API operation for AWS SimSpace Weaver. -// -// Stops the given simulation. -// -// You can't restart a simulation after you stop it. If you want to restart -// a simulation, then you must stop it, delete it, and start a new instance -// of it. -// -// 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 AWS SimSpace Weaver's -// API operation StopSimulation for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - InternalServerException -// -// - AccessDeniedException -// -// - ValidationException -// -// - ConflictException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/StopSimulation -func (c *SimSpaceWeaver) StopSimulation(input *StopSimulationInput) (*StopSimulationOutput, error) { - req, out := c.StopSimulationRequest(input) - return out, req.Send() -} - -// StopSimulationWithContext is the same as StopSimulation with the addition of -// the ability to pass a context and additional request options. -// -// See StopSimulation 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 *SimSpaceWeaver) StopSimulationWithContext(ctx aws.Context, input *StopSimulationInput, opts ...request.Option) (*StopSimulationOutput, error) { - req, out := c.StopSimulationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/TagResource -func (c *SimSpaceWeaver) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS SimSpace Weaver. -// -// Adds tags to a SimSpace Weaver resource. For more information about tags, -// see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) -// in the Amazon Web Services General Reference. -// -// 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 AWS SimSpace Weaver's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - TooManyTagsException -// -// - ResourceNotFoundException -// -// - ValidationException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/TagResource -func (c *SimSpaceWeaver) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *SimSpaceWeaver) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/UntagResource -func (c *SimSpaceWeaver) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{ResourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS SimSpace Weaver. -// -// Removes tags from a SimSpace Weaver resource. For more information about -// tags, see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) -// in the Amazon Web Services General Reference. -// -// 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 AWS SimSpace Weaver's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// -// - ValidationException -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28/UntagResource -func (c *SimSpaceWeaver) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *SimSpaceWeaver) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The Amazon CloudWatch Logs log group for the simulation. For more information -// about log groups, see Working with log groups and log streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) -// in the Amazon CloudWatch Logs User Guide. -type CloudWatchLogsLogGroup struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log group for - // the simulation. For more information about ARNs, see Amazon Resource Names - // (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. For more information about - // log groups, see Working with log groups and log streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) - // in the Amazon CloudWatch Logs User Guide. - LogGroupArn *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 CloudWatchLogsLogGroup) 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 CloudWatchLogsLogGroup) GoString() string { - return s.String() -} - -// SetLogGroupArn sets the LogGroupArn field's value. -func (s *CloudWatchLogsLogGroup) SetLogGroupArn(v string) *CloudWatchLogsLogGroup { - s.LogGroupArn = &v - return s -} - -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateSnapshotInput struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket and optional folder (object key prefix) where SimSpace - // Weaver creates the snapshot file. - // - // The Amazon S3 bucket must be in the same Amazon Web Services Region as the - // simulation. - // - // Destination is a required field - Destination *S3Destination `type:"structure" required:"true"` - - // The name of the simulation. - // - // Simulation is a required field - Simulation *string `min:"1" 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 CreateSnapshotInput) 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 CreateSnapshotInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSnapshotInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotInput"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - if s.Destination != nil { - if err := s.Destination.Validate(); err != nil { - invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *CreateSnapshotInput) SetDestination(v *S3Destination) *CreateSnapshotInput { - s.Destination = v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *CreateSnapshotInput) SetSimulation(v string) *CreateSnapshotInput { - s.Simulation = &v - return s -} - -type CreateSnapshotOutput 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 CreateSnapshotOutput) 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 CreateSnapshotOutput) GoString() string { - return s.String() -} - -type DeleteAppInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the app. - // - // App is a required field - App *string `location:"querystring" locationName:"app" min:"1" type:"string" required:"true"` - - // The name of the domain of the app. - // - // Domain is a required field - Domain *string `location:"querystring" locationName:"domain" min:"1" type:"string" required:"true"` - - // The name of the simulation of the app. - // - // Simulation is a required field - Simulation *string `location:"querystring" locationName:"simulation" min:"1" 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 DeleteAppInput) 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 DeleteAppInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAppInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAppInput"} - if s.App == nil { - invalidParams.Add(request.NewErrParamRequired("App")) - } - if s.App != nil && len(*s.App) < 1 { - invalidParams.Add(request.NewErrParamMinLen("App", 1)) - } - if s.Domain == nil { - invalidParams.Add(request.NewErrParamRequired("Domain")) - } - if s.Domain != nil && len(*s.Domain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Domain", 1)) - } - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApp sets the App field's value. -func (s *DeleteAppInput) SetApp(v string) *DeleteAppInput { - s.App = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *DeleteAppInput) SetDomain(v string) *DeleteAppInput { - s.Domain = &v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *DeleteAppInput) SetSimulation(v string) *DeleteAppInput { - s.Simulation = &v - return s -} - -type DeleteAppOutput 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 DeleteAppOutput) 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 DeleteAppOutput) GoString() string { - return s.String() -} - -type DeleteSimulationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the simulation. - // - // Simulation is a required field - Simulation *string `location:"querystring" locationName:"simulation" min:"1" 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 DeleteSimulationInput) 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 DeleteSimulationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSimulationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSimulationInput"} - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSimulation sets the Simulation field's value. -func (s *DeleteSimulationInput) SetSimulation(v string) *DeleteSimulationInput { - s.Simulation = &v - return s -} - -type DeleteSimulationOutput 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 DeleteSimulationOutput) 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 DeleteSimulationOutput) GoString() string { - return s.String() -} - -type DescribeAppInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the app. - // - // App is a required field - App *string `location:"querystring" locationName:"app" min:"1" type:"string" required:"true"` - - // The name of the domain of the app. - // - // Domain is a required field - Domain *string `location:"querystring" locationName:"domain" min:"1" type:"string" required:"true"` - - // The name of the simulation of the app. - // - // Simulation is a required field - Simulation *string `location:"querystring" locationName:"simulation" min:"1" 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 DescribeAppInput) 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 DescribeAppInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAppInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAppInput"} - if s.App == nil { - invalidParams.Add(request.NewErrParamRequired("App")) - } - if s.App != nil && len(*s.App) < 1 { - invalidParams.Add(request.NewErrParamMinLen("App", 1)) - } - if s.Domain == nil { - invalidParams.Add(request.NewErrParamRequired("Domain")) - } - if s.Domain != nil && len(*s.Domain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Domain", 1)) - } - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApp sets the App field's value. -func (s *DescribeAppInput) SetApp(v string) *DescribeAppInput { - s.App = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *DescribeAppInput) SetDomain(v string) *DescribeAppInput { - s.Domain = &v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *DescribeAppInput) SetSimulation(v string) *DescribeAppInput { - s.Simulation = &v - return s -} - -type DescribeAppOutput struct { - _ struct{} `type:"structure"` - - // The description of the app. - Description *string `type:"string"` - - // The name of the domain of the app. - Domain *string `min:"1" type:"string"` - - // Information about the network endpoint for the custom app. You can use the - // endpoint to connect to the custom app. - EndpointInfo *SimulationAppEndpointInfo `type:"structure"` - - // Options that apply when the app starts. These options override default behavior. - LaunchOverrides *LaunchOverrides `type:"structure"` - - // The name of the app. - Name *string `min:"1" type:"string"` - - // The name of the simulation of the app. - Simulation *string `min:"1" type:"string"` - - // The current lifecycle state of the custom app. - Status *string `type:"string" enum:"SimulationAppStatus"` - - // The desired lifecycle state of the custom app. - TargetStatus *string `type:"string" enum:"SimulationAppTargetStatus"` -} - -// 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 DescribeAppOutput) 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 DescribeAppOutput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *DescribeAppOutput) SetDescription(v string) *DescribeAppOutput { - s.Description = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *DescribeAppOutput) SetDomain(v string) *DescribeAppOutput { - s.Domain = &v - return s -} - -// SetEndpointInfo sets the EndpointInfo field's value. -func (s *DescribeAppOutput) SetEndpointInfo(v *SimulationAppEndpointInfo) *DescribeAppOutput { - s.EndpointInfo = v - return s -} - -// SetLaunchOverrides sets the LaunchOverrides field's value. -func (s *DescribeAppOutput) SetLaunchOverrides(v *LaunchOverrides) *DescribeAppOutput { - s.LaunchOverrides = v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeAppOutput) SetName(v string) *DescribeAppOutput { - s.Name = &v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *DescribeAppOutput) SetSimulation(v string) *DescribeAppOutput { - s.Simulation = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeAppOutput) SetStatus(v string) *DescribeAppOutput { - s.Status = &v - return s -} - -// SetTargetStatus sets the TargetStatus field's value. -func (s *DescribeAppOutput) SetTargetStatus(v string) *DescribeAppOutput { - s.TargetStatus = &v - return s -} - -type DescribeSimulationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the simulation. - // - // Simulation is a required field - Simulation *string `location:"querystring" locationName:"simulation" min:"1" 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 DescribeSimulationInput) 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 DescribeSimulationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSimulationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSimulationInput"} - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSimulation sets the Simulation field's value. -func (s *DescribeSimulationInput) SetSimulation(v string) *DescribeSimulationInput { - s.Simulation = &v - return s -} - -type DescribeSimulationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the simulation. For more information about - // ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - Arn *string `type:"string"` - - // The time when the simulation was created, expressed as the number of seconds - // and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970). - CreationTime *time.Time `type:"timestamp"` - - // The description of the simulation. - Description *string `type:"string"` - - // A universally unique identifier (UUID) for this simulation. - ExecutionId *string `min:"36" type:"string"` - - // A collection of additional state information, such as domain and clock configuration. - LiveSimulationState *LiveSimulationState `type:"structure"` - - // Settings that control how SimSpace Weaver handles your simulation log data. - LoggingConfiguration *LoggingConfiguration `type:"structure"` - - // The maximum running time of the simulation, specified as a number of minutes - // (m or M), hours (h or H), or days (d or D). The simulation stops when it - // reaches this limit. The maximum value is 14D, or its equivalent in the other - // units. The default value is 14D. A value equivalent to 0 makes the simulation - // immediately transition to Stopping as soon as it reaches Started. - MaximumDuration *string `min:"2" type:"string"` - - // The name of the simulation. - Name *string `min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) - // role that the simulation assumes to perform actions. For more information - // about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. For more information about - // IAM roles, see IAM roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) - // in the Identity and Access Management User Guide. - RoleArn *string `type:"string"` - - // An error message that SimSpace Weaver returns only if there is a problem - // with the simulation schema. - // - // Deprecated: SchemaError is no longer used, check StartError instead. - SchemaError *string `deprecated:"true" type:"string"` - - // The location of the simulation schema in Amazon Simple Storage Service (Amazon - // S3). For more information about Amazon S3, see the Amazon Simple Storage - // Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). - SchemaS3Location *S3Location `type:"structure"` - - // A location in Amazon Simple Storage Service (Amazon S3) where SimSpace Weaver - // stores simulation data, such as your app .zip files and schema file. For - // more information about Amazon S3, see the Amazon Simple Storage Service User - // Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). - SnapshotS3Location *S3Location `type:"structure"` - - // An error message that SimSpace Weaver returns only if a problem occurs when - // the simulation is in the STARTING state. - StartError *string `type:"string"` - - // The current lifecycle state of the simulation. - Status *string `type:"string" enum:"SimulationStatus"` - - // The desired lifecycle state of the simulation. - TargetStatus *string `type:"string" enum:"SimulationTargetStatus"` -} - -// 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 DescribeSimulationOutput) 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 DescribeSimulationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DescribeSimulationOutput) SetArn(v string) *DescribeSimulationOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeSimulationOutput) SetCreationTime(v time.Time) *DescribeSimulationOutput { - s.CreationTime = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *DescribeSimulationOutput) SetDescription(v string) *DescribeSimulationOutput { - s.Description = &v - return s -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *DescribeSimulationOutput) SetExecutionId(v string) *DescribeSimulationOutput { - s.ExecutionId = &v - return s -} - -// SetLiveSimulationState sets the LiveSimulationState field's value. -func (s *DescribeSimulationOutput) SetLiveSimulationState(v *LiveSimulationState) *DescribeSimulationOutput { - s.LiveSimulationState = v - return s -} - -// SetLoggingConfiguration sets the LoggingConfiguration field's value. -func (s *DescribeSimulationOutput) SetLoggingConfiguration(v *LoggingConfiguration) *DescribeSimulationOutput { - s.LoggingConfiguration = v - return s -} - -// SetMaximumDuration sets the MaximumDuration field's value. -func (s *DescribeSimulationOutput) SetMaximumDuration(v string) *DescribeSimulationOutput { - s.MaximumDuration = &v - return s -} - -// SetName sets the Name field's value. -func (s *DescribeSimulationOutput) SetName(v string) *DescribeSimulationOutput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeSimulationOutput) SetRoleArn(v string) *DescribeSimulationOutput { - s.RoleArn = &v - return s -} - -// SetSchemaError sets the SchemaError field's value. -func (s *DescribeSimulationOutput) SetSchemaError(v string) *DescribeSimulationOutput { - s.SchemaError = &v - return s -} - -// SetSchemaS3Location sets the SchemaS3Location field's value. -func (s *DescribeSimulationOutput) SetSchemaS3Location(v *S3Location) *DescribeSimulationOutput { - s.SchemaS3Location = v - return s -} - -// SetSnapshotS3Location sets the SnapshotS3Location field's value. -func (s *DescribeSimulationOutput) SetSnapshotS3Location(v *S3Location) *DescribeSimulationOutput { - s.SnapshotS3Location = v - return s -} - -// SetStartError sets the StartError field's value. -func (s *DescribeSimulationOutput) SetStartError(v string) *DescribeSimulationOutput { - s.StartError = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeSimulationOutput) SetStatus(v string) *DescribeSimulationOutput { - s.Status = &v - return s -} - -// SetTargetStatus sets the TargetStatus field's value. -func (s *DescribeSimulationOutput) SetTargetStatus(v string) *DescribeSimulationOutput { - s.TargetStatus = &v - return s -} - -// A collection of app instances that run the same executable app code and have -// the same launch options and commands. -// -// For more information about domains, see Key concepts: Domains (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/what-is_key-concepts.html#what-is_key-concepts_domains) -// in the SimSpace Weaver User Guide. -type Domain struct { - _ struct{} `type:"structure"` - - // The type of lifecycle management for apps in the domain. Indicates whether - // apps in this domain are managed (SimSpace Weaver starts and stops the apps) - // or unmanaged (you must start and stop the apps). - // - // Lifecycle types - // - // * PerWorker – Managed: SimSpace Weaver starts one app on each worker. - // - // * BySpatialSubdivision – Managed: SimSpace Weaver starts one app for - // each spatial partition. - // - // * ByRequest – Unmanaged: You use the StartApp API to start the apps - // and use the StopApp API to stop the apps. - Lifecycle *string `type:"string" enum:"LifecycleManagementStrategy"` - - // The name of the domain. - Name *string `min:"1" 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 Domain) 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 Domain) GoString() string { - return s.String() -} - -// SetLifecycle sets the Lifecycle field's value. -func (s *Domain) SetLifecycle(v string) *Domain { - s.Lifecycle = &v - return s -} - -// SetName sets the Name field's value. -func (s *Domain) SetName(v string) *Domain { - s.Name = &v - return s -} - -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Options that apply when the app starts. These options override default behavior. -type LaunchOverrides struct { - _ struct{} `type:"structure"` - - // App launch commands and command line parameters that override the launch - // command configured in the simulation schema. - LaunchCommands []*string `type:"list"` -} - -// 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 LaunchOverrides) 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 LaunchOverrides) GoString() string { - return s.String() -} - -// SetLaunchCommands sets the LaunchCommands field's value. -func (s *LaunchOverrides) SetLaunchCommands(v []*string) *LaunchOverrides { - s.LaunchCommands = v - return s -} - -type ListAppsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The name of the domain that you want to list apps for. - Domain *string `location:"querystring" locationName:"domain" min:"1" type:"string"` - - // The maximum number of apps to list. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If SimSpace Weaver returns nextToken, then there are more results available. - // The value of nextToken is a unique pagination token for each page. To retrieve - // the next page, call the operation again using the returned token. Keep all - // other arguments unchanged. If no results remain, then nextToken is set to - // null. Each pagination token expires after 24 hours. If you provide a token - // that isn't valid, then you receive an HTTP 400 ValidationException error. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - // The name of the simulation that you want to list apps for. - // - // Simulation is a required field - Simulation *string `location:"querystring" locationName:"simulation" min:"1" 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 ListAppsInput) 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 ListAppsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAppsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAppsInput"} - if s.Domain != nil && len(*s.Domain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Domain", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDomain sets the Domain field's value. -func (s *ListAppsInput) SetDomain(v string) *ListAppsInput { - s.Domain = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAppsInput) SetMaxResults(v int64) *ListAppsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAppsInput) SetNextToken(v string) *ListAppsInput { - s.NextToken = &v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *ListAppsInput) SetSimulation(v string) *ListAppsInput { - s.Simulation = &v - return s -} - -type ListAppsOutput struct { - _ struct{} `type:"structure"` - - // The list of apps for the given simulation and domain. - Apps []*SimulationAppMetadata `type:"list"` - - // If SimSpace Weaver returns nextToken, then there are more results available. - // The value of nextToken is a unique pagination token for each page. To retrieve - // the next page, call the operation again using the returned token. Keep all - // other arguments unchanged. If no results remain, then nextToken is set to - // null. Each pagination token expires after 24 hours. If you provide a token - // that isn't valid, then you receive an HTTP 400 ValidationException error. - NextToken *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 ListAppsOutput) 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 ListAppsOutput) GoString() string { - return s.String() -} - -// SetApps sets the Apps field's value. -func (s *ListAppsOutput) SetApps(v []*SimulationAppMetadata) *ListAppsOutput { - s.Apps = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAppsOutput) SetNextToken(v string) *ListAppsOutput { - s.NextToken = &v - return s -} - -type ListSimulationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of simulations to list. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If SimSpace Weaver returns nextToken, then there are more results available. - // The value of nextToken is a unique pagination token for each page. To retrieve - // the next page, call the operation again using the returned token. Keep all - // other arguments unchanged. If no results remain, then nextToken is set to - // null. Each pagination token expires after 24 hours. If you provide a token - // that isn't valid, then you receive an HTTP 400 ValidationException error. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListSimulationsInput) 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 ListSimulationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSimulationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSimulationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSimulationsInput) SetMaxResults(v int64) *ListSimulationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSimulationsInput) SetNextToken(v string) *ListSimulationsInput { - s.NextToken = &v - return s -} - -type ListSimulationsOutput struct { - _ struct{} `type:"structure"` - - // If SimSpace Weaver returns nextToken, then there are more results available. - // The value of nextToken is a unique pagination token for each page. To retrieve - // the next page, call the operation again using the returned token. Keep all - // other arguments unchanged. If no results remain, then nextToken is set to - // null. Each pagination token expires after 24 hours. If you provide a token - // that isn't valid, then you receive an HTTP 400 ValidationException error. - NextToken *string `type:"string"` - - // The list of simulations. - Simulations []*SimulationMetadata `type:"list"` -} - -// 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 ListSimulationsOutput) 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 ListSimulationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSimulationsOutput) SetNextToken(v string) *ListSimulationsOutput { - s.NextToken = &v - return s -} - -// SetSimulations sets the Simulations field's value. -func (s *ListSimulationsOutput) SetSimulations(v []*SimulationMetadata) *ListSimulationsOutput { - s.Simulations = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. For more information about - // ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The list of tags for the resource. - Tags map[string]*string `min:"1" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// A collection of additional state information, such as domain and clock configuration. -type LiveSimulationState struct { - _ struct{} `type:"structure"` - - // A list of simulation clocks. - // - // At this time, a simulation has only one clock. - Clocks []*SimulationClock `type:"list"` - - // A list of domains for the simulation. For more information about domains, - // see Key concepts: Domains (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/what-is_key-concepts.html#what-is_key-concepts_domains) - // in the SimSpace Weaver User Guide. - Domains []*Domain `type:"list"` -} - -// 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 LiveSimulationState) 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 LiveSimulationState) GoString() string { - return s.String() -} - -// SetClocks sets the Clocks field's value. -func (s *LiveSimulationState) SetClocks(v []*SimulationClock) *LiveSimulationState { - s.Clocks = v - return s -} - -// SetDomains sets the Domains field's value. -func (s *LiveSimulationState) SetDomains(v []*Domain) *LiveSimulationState { - s.Domains = v - return s -} - -// The location where SimSpace Weaver sends simulation log data. -type LogDestination struct { - _ struct{} `type:"structure"` - - // An Amazon CloudWatch Logs log group that stores simulation log data. For - // more information about log groups, see Working with log groups and log streams - // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) - // in the Amazon CloudWatch Logs User Guide. - CloudWatchLogsLogGroup *CloudWatchLogsLogGroup `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 LogDestination) 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 LogDestination) GoString() string { - return s.String() -} - -// SetCloudWatchLogsLogGroup sets the CloudWatchLogsLogGroup field's value. -func (s *LogDestination) SetCloudWatchLogsLogGroup(v *CloudWatchLogsLogGroup) *LogDestination { - s.CloudWatchLogsLogGroup = v - return s -} - -// The logging configuration for a simulation. -type LoggingConfiguration struct { - _ struct{} `type:"structure"` - - // A list of the locations where SimSpace Weaver sends simulation log data. - Destinations []*LogDestination `type:"list"` -} - -// 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 LoggingConfiguration) 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 LoggingConfiguration) GoString() string { - return s.String() -} - -// SetDestinations sets the Destinations field's value. -func (s *LoggingConfiguration) SetDestinations(v []*LogDestination) *LoggingConfiguration { - s.Destinations = v - return s -} - -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An Amazon S3 bucket and optional folder (object key prefix) where SimSpace -// Weaver creates a file. -type S3Destination struct { - _ struct{} `type:"structure"` - - // The name of an Amazon S3 bucket. For more information about buckets, see - // Creating, configuring, and working with Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html) - // in the Amazon Simple Storage Service User Guide. - // - // BucketName is a required field - BucketName *string `min:"3" type:"string" required:"true"` - - // A string prefix for an Amazon S3 object key. It's usually a folder name. - // For more information about folders in Amazon S3, see Organizing objects in - // the Amazon S3 console using folders (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-folders.html) - // in the Amazon Simple Storage Service User Guide. - ObjectKeyPrefix *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 S3Destination) 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 S3Destination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Destination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Destination"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - if s.BucketName != nil && len(*s.BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BucketName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3Destination) SetBucketName(v string) *S3Destination { - s.BucketName = &v - return s -} - -// SetObjectKeyPrefix sets the ObjectKeyPrefix field's value. -func (s *S3Destination) SetObjectKeyPrefix(v string) *S3Destination { - s.ObjectKeyPrefix = &v - return s -} - -// A location in Amazon Simple Storage Service (Amazon S3) where SimSpace Weaver -// stores simulation data, such as your app .zip files and schema file. For -// more information about Amazon S3, see the Amazon Simple Storage Service User -// Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). -type S3Location struct { - _ struct{} `type:"structure"` - - // The name of an Amazon S3 bucket. For more information about buckets, see - // Creating, configuring, and working with Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html) - // in the Amazon Simple Storage Service User Guide. - // - // BucketName is a required field - BucketName *string `min:"3" type:"string" required:"true"` - - // The key name of an object in Amazon S3. For more information about Amazon - // S3 objects and object keys, see Uploading, downloading, and working with - // objects in Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/userguide/uploading-downloading-objects.html) - // in the Amazon Simple Storage Service User Guide. - // - // ObjectKey is a required field - ObjectKey *string `min:"1" 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 S3Location) 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 S3Location) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3Location) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3Location"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - if s.BucketName != nil && len(*s.BucketName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("BucketName", 3)) - } - if s.ObjectKey == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectKey")) - } - if s.ObjectKey != nil && len(*s.ObjectKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ObjectKey", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucketName sets the BucketName field's value. -func (s *S3Location) SetBucketName(v string) *S3Location { - s.BucketName = &v - return s -} - -// SetObjectKey sets the ObjectKey field's value. -func (s *S3Location) SetObjectKey(v string) *S3Location { - s.ObjectKey = &v - return s -} - -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about the network endpoint that you can use to connect to your -// custom or service app. For more information about SimSpace Weaver apps, see -// Key concepts: Apps (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/what-is_key-concepts.html#what-is_key-concepts_apps) -// in the SimSpace Weaver User Guide.. -type SimulationAppEndpointInfo struct { - _ struct{} `type:"structure"` - - // The IP address of the app. SimSpace Weaver dynamically assigns this IP address - // when the app starts. - Address *string `min:"1" type:"string"` - - // The inbound TCP/UDP port numbers of the app. The combination of an IP address - // and a port number form a network endpoint. - IngressPortMappings []*SimulationAppPortMapping `type:"list"` -} - -// 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 SimulationAppEndpointInfo) 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 SimulationAppEndpointInfo) GoString() string { - return s.String() -} - -// SetAddress sets the Address field's value. -func (s *SimulationAppEndpointInfo) SetAddress(v string) *SimulationAppEndpointInfo { - s.Address = &v - return s -} - -// SetIngressPortMappings sets the IngressPortMappings field's value. -func (s *SimulationAppEndpointInfo) SetIngressPortMappings(v []*SimulationAppPortMapping) *SimulationAppEndpointInfo { - s.IngressPortMappings = v - return s -} - -// A collection of metadata about the app. -type SimulationAppMetadata struct { - _ struct{} `type:"structure"` - - // The domain of the app. For more information about domains, see Key concepts: - // Domains (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/what-is_key-concepts.html#what-is_key-concepts_domains) - // in the SimSpace Weaver User Guide. - Domain *string `min:"1" type:"string"` - - // The name of the app. - Name *string `min:"1" type:"string"` - - // The name of the simulation of the app. - Simulation *string `min:"1" type:"string"` - - // The current status of the app. - Status *string `type:"string" enum:"SimulationAppStatus"` - - // The desired status of the app. - TargetStatus *string `type:"string" enum:"SimulationAppTargetStatus"` -} - -// 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 SimulationAppMetadata) 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 SimulationAppMetadata) GoString() string { - return s.String() -} - -// SetDomain sets the Domain field's value. -func (s *SimulationAppMetadata) SetDomain(v string) *SimulationAppMetadata { - s.Domain = &v - return s -} - -// SetName sets the Name field's value. -func (s *SimulationAppMetadata) SetName(v string) *SimulationAppMetadata { - s.Name = &v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *SimulationAppMetadata) SetSimulation(v string) *SimulationAppMetadata { - s.Simulation = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SimulationAppMetadata) SetStatus(v string) *SimulationAppMetadata { - s.Status = &v - return s -} - -// SetTargetStatus sets the TargetStatus field's value. -func (s *SimulationAppMetadata) SetTargetStatus(v string) *SimulationAppMetadata { - s.TargetStatus = &v - return s -} - -// A collection of TCP/UDP ports for a custom or service app. -type SimulationAppPortMapping struct { - _ struct{} `type:"structure"` - - // The TCP/UDP port number of the running app. SimSpace Weaver dynamically assigns - // this port number when the app starts. SimSpace Weaver maps the Declared port - // to the Actual port. Clients connect to the app using the app's IP address - // and the Actual port number. - Actual *int64 `type:"integer"` - - // The TCP/UDP port number of the app, declared in the simulation schema. SimSpace - // Weaver maps the Declared port to the Actual port. The source code for the - // app should bind to the Declared port. - Declared *int64 `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 SimulationAppPortMapping) 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 SimulationAppPortMapping) GoString() string { - return s.String() -} - -// SetActual sets the Actual field's value. -func (s *SimulationAppPortMapping) SetActual(v int64) *SimulationAppPortMapping { - s.Actual = &v - return s -} - -// SetDeclared sets the Declared field's value. -func (s *SimulationAppPortMapping) SetDeclared(v int64) *SimulationAppPortMapping { - s.Declared = &v - return s -} - -// Status information about the simulation clock. -type SimulationClock struct { - _ struct{} `type:"structure"` - - // The current status of the simulation clock. - Status *string `type:"string" enum:"ClockStatus"` - - // The desired status of the simulation clock. - TargetStatus *string `type:"string" enum:"ClockTargetStatus"` -} - -// 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 SimulationClock) 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 SimulationClock) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *SimulationClock) SetStatus(v string) *SimulationClock { - s.Status = &v - return s -} - -// SetTargetStatus sets the TargetStatus field's value. -func (s *SimulationClock) SetTargetStatus(v string) *SimulationClock { - s.TargetStatus = &v - return s -} - -// A collection of data about the simulation. -type SimulationMetadata struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the simulation. For more information about - // ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - Arn *string `type:"string"` - - // The time when the simulation was created, expressed as the number of seconds - // and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970). - CreationTime *time.Time `type:"timestamp"` - - // The name of the simulation. - Name *string `min:"1" type:"string"` - - // The current status of the simulation. - Status *string `type:"string" enum:"SimulationStatus"` - - // The desired status of the simulation. - TargetStatus *string `type:"string" enum:"SimulationTargetStatus"` -} - -// 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 SimulationMetadata) 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 SimulationMetadata) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *SimulationMetadata) SetArn(v string) *SimulationMetadata { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *SimulationMetadata) SetCreationTime(v time.Time) *SimulationMetadata { - s.CreationTime = &v - return s -} - -// SetName sets the Name field's value. -func (s *SimulationMetadata) SetName(v string) *SimulationMetadata { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SimulationMetadata) SetStatus(v string) *SimulationMetadata { - s.Status = &v - return s -} - -// SetTargetStatus sets the TargetStatus field's value. -func (s *SimulationMetadata) SetTargetStatus(v string) *SimulationMetadata { - s.TargetStatus = &v - return s -} - -type StartAppInput struct { - _ struct{} `type:"structure"` - - // A value that you provide to ensure that repeated calls to this API operation - // using the same parameters complete only once. A ClientToken is also known - // as an idempotency token. A ClientToken expires after 24 hours. - // - // ClientToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StartAppInput's - // String and GoString methods. - ClientToken *string `min:"32" type:"string" idempotencyToken:"true" sensitive:"true"` - - // The description of the app. - Description *string `type:"string"` - - // The name of the domain of the app. - // - // Domain is a required field - Domain *string `min:"1" type:"string" required:"true"` - - // Options that apply when the app starts. These options override default behavior. - LaunchOverrides *LaunchOverrides `type:"structure"` - - // The name of the app. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The name of the simulation of the app. - // - // Simulation is a required field - Simulation *string `min:"1" 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 StartAppInput) 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 StartAppInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartAppInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartAppInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 32 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 32)) - } - if s.Domain == nil { - invalidParams.Add(request.NewErrParamRequired("Domain")) - } - if s.Domain != nil && len(*s.Domain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Domain", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartAppInput) SetClientToken(v string) *StartAppInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *StartAppInput) SetDescription(v string) *StartAppInput { - s.Description = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *StartAppInput) SetDomain(v string) *StartAppInput { - s.Domain = &v - return s -} - -// SetLaunchOverrides sets the LaunchOverrides field's value. -func (s *StartAppInput) SetLaunchOverrides(v *LaunchOverrides) *StartAppInput { - s.LaunchOverrides = v - return s -} - -// SetName sets the Name field's value. -func (s *StartAppInput) SetName(v string) *StartAppInput { - s.Name = &v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *StartAppInput) SetSimulation(v string) *StartAppInput { - s.Simulation = &v - return s -} - -type StartAppOutput struct { - _ struct{} `type:"structure"` - - // The name of the domain of the app. - Domain *string `min:"1" type:"string"` - - // The name of the app. - Name *string `min:"1" type:"string"` - - // The name of the simulation of the app. - Simulation *string `min:"1" 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 StartAppOutput) 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 StartAppOutput) GoString() string { - return s.String() -} - -// SetDomain sets the Domain field's value. -func (s *StartAppOutput) SetDomain(v string) *StartAppOutput { - s.Domain = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartAppOutput) SetName(v string) *StartAppOutput { - s.Name = &v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *StartAppOutput) SetSimulation(v string) *StartAppOutput { - s.Simulation = &v - return s -} - -type StartClockInput struct { - _ struct{} `type:"structure"` - - // The name of the simulation. - // - // Simulation is a required field - Simulation *string `min:"1" 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 StartClockInput) 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 StartClockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartClockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartClockInput"} - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSimulation sets the Simulation field's value. -func (s *StartClockInput) SetSimulation(v string) *StartClockInput { - s.Simulation = &v - return s -} - -type StartClockOutput 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 StartClockOutput) 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 StartClockOutput) GoString() string { - return s.String() -} - -type StartSimulationInput struct { - _ struct{} `type:"structure"` - - // A value that you provide to ensure that repeated calls to this API operation - // using the same parameters complete only once. A ClientToken is also known - // as an idempotency token. A ClientToken expires after 24 hours. - // - // ClientToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StartSimulationInput's - // String and GoString methods. - ClientToken *string `min:"32" type:"string" idempotencyToken:"true" sensitive:"true"` - - // The description of the simulation. - Description *string `type:"string"` - - // The maximum running time of the simulation, specified as a number of minutes - // (m or M), hours (h or H), or days (d or D). The simulation stops when it - // reaches this limit. The maximum value is 14D, or its equivalent in the other - // units. The default value is 14D. A value equivalent to 0 makes the simulation - // immediately transition to Stopping as soon as it reaches Started. - MaximumDuration *string `min:"2" type:"string"` - - // The name of the simulation. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) - // role that the simulation assumes to perform actions. For more information - // about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. For more information about - // IAM roles, see IAM roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) - // in the Identity and Access Management User Guide. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` - - // The location of the simulation schema in Amazon Simple Storage Service (Amazon - // S3). For more information about Amazon S3, see the Amazon Simple Storage - // Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). - // - // Provide a SchemaS3Location to start your simulation from a schema. - // - // If you provide a SchemaS3Location then you can't provide a SnapshotS3Location. - SchemaS3Location *S3Location `type:"structure"` - - // The location of the snapshot .zip file in Amazon Simple Storage Service (Amazon - // S3). For more information about Amazon S3, see the Amazon Simple Storage - // Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html). - // - // Provide a SnapshotS3Location to start your simulation from a snapshot. - // - // The Amazon S3 bucket must be in the same Amazon Web Services Region as the - // simulation. - // - // If you provide a SnapshotS3Location then you can't provide a SchemaS3Location. - SnapshotS3Location *S3Location `type:"structure"` - - // A list of tags for the simulation. For more information about tags, see Tagging - // Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) - // in the Amazon Web Services General Reference. - Tags map[string]*string `min:"1" type:"map"` -} - -// 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 StartSimulationInput) 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 StartSimulationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartSimulationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartSimulationInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 32 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 32)) - } - if s.MaximumDuration != nil && len(*s.MaximumDuration) < 2 { - invalidParams.Add(request.NewErrParamMinLen("MaximumDuration", 2)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.SchemaS3Location != nil { - if err := s.SchemaS3Location.Validate(); err != nil { - invalidParams.AddNested("SchemaS3Location", err.(request.ErrInvalidParams)) - } - } - if s.SnapshotS3Location != nil { - if err := s.SnapshotS3Location.Validate(); err != nil { - invalidParams.AddNested("SnapshotS3Location", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *StartSimulationInput) SetClientToken(v string) *StartSimulationInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *StartSimulationInput) SetDescription(v string) *StartSimulationInput { - s.Description = &v - return s -} - -// SetMaximumDuration sets the MaximumDuration field's value. -func (s *StartSimulationInput) SetMaximumDuration(v string) *StartSimulationInput { - s.MaximumDuration = &v - return s -} - -// SetName sets the Name field's value. -func (s *StartSimulationInput) SetName(v string) *StartSimulationInput { - s.Name = &v - return s -} - -// SetRoleArn sets the RoleArn field's value. -func (s *StartSimulationInput) SetRoleArn(v string) *StartSimulationInput { - s.RoleArn = &v - return s -} - -// SetSchemaS3Location sets the SchemaS3Location field's value. -func (s *StartSimulationInput) SetSchemaS3Location(v *S3Location) *StartSimulationInput { - s.SchemaS3Location = v - return s -} - -// SetSnapshotS3Location sets the SnapshotS3Location field's value. -func (s *StartSimulationInput) SetSnapshotS3Location(v *S3Location) *StartSimulationInput { - s.SnapshotS3Location = v - return s -} - -// SetTags sets the Tags field's value. -func (s *StartSimulationInput) SetTags(v map[string]*string) *StartSimulationInput { - s.Tags = v - return s -} - -type StartSimulationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the simulation. For more information about - // ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - Arn *string `type:"string"` - - // The time when the simulation was created, expressed as the number of seconds - // and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970). - CreationTime *time.Time `type:"timestamp"` - - // A universally unique identifier (UUID) for this simulation. - ExecutionId *string `min:"36" 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 StartSimulationOutput) 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 StartSimulationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *StartSimulationOutput) SetArn(v string) *StartSimulationOutput { - s.Arn = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *StartSimulationOutput) SetCreationTime(v time.Time) *StartSimulationOutput { - s.CreationTime = &v - return s -} - -// SetExecutionId sets the ExecutionId field's value. -func (s *StartSimulationOutput) SetExecutionId(v string) *StartSimulationOutput { - s.ExecutionId = &v - return s -} - -type StopAppInput struct { - _ struct{} `type:"structure"` - - // The name of the app. - // - // App is a required field - App *string `min:"1" type:"string" required:"true"` - - // The name of the domain of the app. - // - // Domain is a required field - Domain *string `min:"1" type:"string" required:"true"` - - // The name of the simulation of the app. - // - // Simulation is a required field - Simulation *string `min:"1" 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 StopAppInput) 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 StopAppInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopAppInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopAppInput"} - if s.App == nil { - invalidParams.Add(request.NewErrParamRequired("App")) - } - if s.App != nil && len(*s.App) < 1 { - invalidParams.Add(request.NewErrParamMinLen("App", 1)) - } - if s.Domain == nil { - invalidParams.Add(request.NewErrParamRequired("Domain")) - } - if s.Domain != nil && len(*s.Domain) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Domain", 1)) - } - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApp sets the App field's value. -func (s *StopAppInput) SetApp(v string) *StopAppInput { - s.App = &v - return s -} - -// SetDomain sets the Domain field's value. -func (s *StopAppInput) SetDomain(v string) *StopAppInput { - s.Domain = &v - return s -} - -// SetSimulation sets the Simulation field's value. -func (s *StopAppInput) SetSimulation(v string) *StopAppInput { - s.Simulation = &v - return s -} - -type StopAppOutput 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 StopAppOutput) 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 StopAppOutput) GoString() string { - return s.String() -} - -type StopClockInput struct { - _ struct{} `type:"structure"` - - // The name of the simulation. - // - // Simulation is a required field - Simulation *string `min:"1" 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 StopClockInput) 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 StopClockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopClockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopClockInput"} - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSimulation sets the Simulation field's value. -func (s *StopClockInput) SetSimulation(v string) *StopClockInput { - s.Simulation = &v - return s -} - -type StopClockOutput 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 StopClockOutput) 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 StopClockOutput) GoString() string { - return s.String() -} - -type StopSimulationInput struct { - _ struct{} `type:"structure"` - - // The name of the simulation. - // - // Simulation is a required field - Simulation *string `min:"1" 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 StopSimulationInput) 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 StopSimulationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopSimulationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopSimulationInput"} - if s.Simulation == nil { - invalidParams.Add(request.NewErrParamRequired("Simulation")) - } - if s.Simulation != nil && len(*s.Simulation) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Simulation", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSimulation sets the Simulation field's value. -func (s *StopSimulationInput) SetSimulation(v string) *StopSimulationInput { - s.Simulation = &v - return s -} - -type StopSimulationOutput 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 StopSimulationOutput) 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 StopSimulationOutput) GoString() string { - return s.String() -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource that you want to add tags - // to. For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - - // A list of tags to apply to the resource. - // - // Tags is a required field - Tags map[string]*string `min:"1" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -type TooManyTagsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 TooManyTagsException) 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 TooManyTagsException) GoString() string { - return s.String() -} - -func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { - return &TooManyTagsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyTagsException) Code() string { - return "TooManyTagsException" -} - -// Message returns the exception's message. -func (s *TooManyTagsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyTagsException) OrigErr() error { - return nil -} - -func (s *TooManyTagsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyTagsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyTagsException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource that you want to remove tags - // from. For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - - // A list of tag keys to remove from the resource. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" min:"1" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // ClockStatusUnknown is a ClockStatus enum value - ClockStatusUnknown = "UNKNOWN" - - // ClockStatusStarting is a ClockStatus enum value - ClockStatusStarting = "STARTING" - - // ClockStatusStarted is a ClockStatus enum value - ClockStatusStarted = "STARTED" - - // ClockStatusStopping is a ClockStatus enum value - ClockStatusStopping = "STOPPING" - - // ClockStatusStopped is a ClockStatus enum value - ClockStatusStopped = "STOPPED" -) - -// ClockStatus_Values returns all elements of the ClockStatus enum -func ClockStatus_Values() []string { - return []string{ - ClockStatusUnknown, - ClockStatusStarting, - ClockStatusStarted, - ClockStatusStopping, - ClockStatusStopped, - } -} - -const ( - // ClockTargetStatusUnknown is a ClockTargetStatus enum value - ClockTargetStatusUnknown = "UNKNOWN" - - // ClockTargetStatusStarted is a ClockTargetStatus enum value - ClockTargetStatusStarted = "STARTED" - - // ClockTargetStatusStopped is a ClockTargetStatus enum value - ClockTargetStatusStopped = "STOPPED" -) - -// ClockTargetStatus_Values returns all elements of the ClockTargetStatus enum -func ClockTargetStatus_Values() []string { - return []string{ - ClockTargetStatusUnknown, - ClockTargetStatusStarted, - ClockTargetStatusStopped, - } -} - -const ( - // LifecycleManagementStrategyUnknown is a LifecycleManagementStrategy enum value - LifecycleManagementStrategyUnknown = "Unknown" - - // LifecycleManagementStrategyPerWorker is a LifecycleManagementStrategy enum value - LifecycleManagementStrategyPerWorker = "PerWorker" - - // LifecycleManagementStrategyBySpatialSubdivision is a LifecycleManagementStrategy enum value - LifecycleManagementStrategyBySpatialSubdivision = "BySpatialSubdivision" - - // LifecycleManagementStrategyByRequest is a LifecycleManagementStrategy enum value - LifecycleManagementStrategyByRequest = "ByRequest" -) - -// LifecycleManagementStrategy_Values returns all elements of the LifecycleManagementStrategy enum -func LifecycleManagementStrategy_Values() []string { - return []string{ - LifecycleManagementStrategyUnknown, - LifecycleManagementStrategyPerWorker, - LifecycleManagementStrategyBySpatialSubdivision, - LifecycleManagementStrategyByRequest, - } -} - -const ( - // SimulationAppStatusStarting is a SimulationAppStatus enum value - SimulationAppStatusStarting = "STARTING" - - // SimulationAppStatusStarted is a SimulationAppStatus enum value - SimulationAppStatusStarted = "STARTED" - - // SimulationAppStatusStopping is a SimulationAppStatus enum value - SimulationAppStatusStopping = "STOPPING" - - // SimulationAppStatusStopped is a SimulationAppStatus enum value - SimulationAppStatusStopped = "STOPPED" - - // SimulationAppStatusError is a SimulationAppStatus enum value - SimulationAppStatusError = "ERROR" - - // SimulationAppStatusUnknown is a SimulationAppStatus enum value - SimulationAppStatusUnknown = "UNKNOWN" -) - -// SimulationAppStatus_Values returns all elements of the SimulationAppStatus enum -func SimulationAppStatus_Values() []string { - return []string{ - SimulationAppStatusStarting, - SimulationAppStatusStarted, - SimulationAppStatusStopping, - SimulationAppStatusStopped, - SimulationAppStatusError, - SimulationAppStatusUnknown, - } -} - -const ( - // SimulationAppTargetStatusUnknown is a SimulationAppTargetStatus enum value - SimulationAppTargetStatusUnknown = "UNKNOWN" - - // SimulationAppTargetStatusStarted is a SimulationAppTargetStatus enum value - SimulationAppTargetStatusStarted = "STARTED" - - // SimulationAppTargetStatusStopped is a SimulationAppTargetStatus enum value - SimulationAppTargetStatusStopped = "STOPPED" -) - -// SimulationAppTargetStatus_Values returns all elements of the SimulationAppTargetStatus enum -func SimulationAppTargetStatus_Values() []string { - return []string{ - SimulationAppTargetStatusUnknown, - SimulationAppTargetStatusStarted, - SimulationAppTargetStatusStopped, - } -} - -const ( - // SimulationStatusUnknown is a SimulationStatus enum value - SimulationStatusUnknown = "UNKNOWN" - - // SimulationStatusStarting is a SimulationStatus enum value - SimulationStatusStarting = "STARTING" - - // SimulationStatusStarted is a SimulationStatus enum value - SimulationStatusStarted = "STARTED" - - // SimulationStatusStopping is a SimulationStatus enum value - SimulationStatusStopping = "STOPPING" - - // SimulationStatusStopped is a SimulationStatus enum value - SimulationStatusStopped = "STOPPED" - - // SimulationStatusFailed is a SimulationStatus enum value - SimulationStatusFailed = "FAILED" - - // SimulationStatusDeleting is a SimulationStatus enum value - SimulationStatusDeleting = "DELETING" - - // SimulationStatusDeleted is a SimulationStatus enum value - SimulationStatusDeleted = "DELETED" - - // SimulationStatusSnapshotInProgress is a SimulationStatus enum value - SimulationStatusSnapshotInProgress = "SNAPSHOT_IN_PROGRESS" -) - -// SimulationStatus_Values returns all elements of the SimulationStatus enum -func SimulationStatus_Values() []string { - return []string{ - SimulationStatusUnknown, - SimulationStatusStarting, - SimulationStatusStarted, - SimulationStatusStopping, - SimulationStatusStopped, - SimulationStatusFailed, - SimulationStatusDeleting, - SimulationStatusDeleted, - SimulationStatusSnapshotInProgress, - } -} - -const ( - // SimulationTargetStatusUnknown is a SimulationTargetStatus enum value - SimulationTargetStatusUnknown = "UNKNOWN" - - // SimulationTargetStatusStarted is a SimulationTargetStatus enum value - SimulationTargetStatusStarted = "STARTED" - - // SimulationTargetStatusStopped is a SimulationTargetStatus enum value - SimulationTargetStatusStopped = "STOPPED" - - // SimulationTargetStatusDeleted is a SimulationTargetStatus enum value - SimulationTargetStatusDeleted = "DELETED" -) - -// SimulationTargetStatus_Values returns all elements of the SimulationTargetStatus enum -func SimulationTargetStatus_Values() []string { - return []string{ - SimulationTargetStatusUnknown, - SimulationTargetStatusStarted, - SimulationTargetStatusStopped, - SimulationTargetStatusDeleted, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/doc.go deleted file mode 100644 index ba82d4212a40..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/doc.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package simspaceweaver provides the client and types for making API -// requests to AWS SimSpace Weaver. -// -// SimSpace Weaver (SimSpace Weaver) is a service that you can use to build -// and run large-scale spatial simulations in the Amazon Web Services Cloud. -// For example, you can create crowd simulations, large real-world environments, -// and immersive and interactive experiences. For more information about SimSpace -// Weaver, see the SimSpace Weaver User Guide (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/) . -// -// This API reference describes the API operations and data types that you can -// use to communicate directly with SimSpace Weaver. -// -// SimSpace Weaver also provides the SimSpace Weaver app SDK, which you use -// for app development. The SimSpace Weaver app SDK API reference is included -// in the SimSpace Weaver app SDK documentation. This documentation is part -// of the SimSpace Weaver app SDK distributable package. -// -// See https://docs.aws.amazon.com/goto/WebAPI/simspaceweaver-2022-10-28 for more information on this service. -// -// See simspaceweaver package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/simspaceweaver/ -// -// # Using the Client -// -// To contact AWS SimSpace Weaver with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS SimSpace Weaver client SimSpaceWeaver for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/simspaceweaver/#New -package simspaceweaver diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/errors.go deleted file mode 100644 index d5ef67d03f49..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/errors.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package simspaceweaver - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeTooManyTagsException for service response error code - // "TooManyTagsException". - ErrCodeTooManyTagsException = "TooManyTagsException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "TooManyTagsException": newErrorTooManyTagsException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/service.go deleted file mode 100644 index e545c15f56fe..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package simspaceweaver - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// SimSpaceWeaver provides the API operation methods for making requests to -// AWS SimSpace Weaver. See this package's package overview docs -// for details on the service. -// -// SimSpaceWeaver methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type SimSpaceWeaver struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "SimSpaceWeaver" // Name of service. - EndpointsID = "simspaceweaver" // ID to lookup a service endpoint with. - ServiceID = "SimSpaceWeaver" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the SimSpaceWeaver client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a SimSpaceWeaver client from just a session. -// svc := simspaceweaver.New(mySession) -// -// // Create a SimSpaceWeaver client with additional configuration -// svc := simspaceweaver.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SimSpaceWeaver { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "simspaceweaver" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *SimSpaceWeaver { - svc := &SimSpaceWeaver{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-10-28", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SimSpaceWeaver operation and runs any -// custom request initialization. -func (c *SimSpaceWeaver) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/simspaceweaveriface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/simspaceweaveriface/interface.go deleted file mode 100644 index 5d834d73298c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver/simspaceweaveriface/interface.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package simspaceweaveriface provides an interface to enable mocking the AWS SimSpace Weaver service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package simspaceweaveriface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/simspaceweaver" -) - -// SimSpaceWeaverAPI provides an interface to enable mocking the -// simspaceweaver.SimSpaceWeaver service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS SimSpace Weaver. -// func myFunc(svc simspaceweaveriface.SimSpaceWeaverAPI) bool { -// // Make svc.CreateSnapshot request -// } -// -// func main() { -// sess := session.New() -// svc := simspaceweaver.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSimSpaceWeaverClient struct { -// simspaceweaveriface.SimSpaceWeaverAPI -// } -// func (m *mockSimSpaceWeaverClient) CreateSnapshot(input *simspaceweaver.CreateSnapshotInput) (*simspaceweaver.CreateSnapshotOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSimSpaceWeaverClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type SimSpaceWeaverAPI interface { - CreateSnapshot(*simspaceweaver.CreateSnapshotInput) (*simspaceweaver.CreateSnapshotOutput, error) - CreateSnapshotWithContext(aws.Context, *simspaceweaver.CreateSnapshotInput, ...request.Option) (*simspaceweaver.CreateSnapshotOutput, error) - CreateSnapshotRequest(*simspaceweaver.CreateSnapshotInput) (*request.Request, *simspaceweaver.CreateSnapshotOutput) - - DeleteApp(*simspaceweaver.DeleteAppInput) (*simspaceweaver.DeleteAppOutput, error) - DeleteAppWithContext(aws.Context, *simspaceweaver.DeleteAppInput, ...request.Option) (*simspaceweaver.DeleteAppOutput, error) - DeleteAppRequest(*simspaceweaver.DeleteAppInput) (*request.Request, *simspaceweaver.DeleteAppOutput) - - DeleteSimulation(*simspaceweaver.DeleteSimulationInput) (*simspaceweaver.DeleteSimulationOutput, error) - DeleteSimulationWithContext(aws.Context, *simspaceweaver.DeleteSimulationInput, ...request.Option) (*simspaceweaver.DeleteSimulationOutput, error) - DeleteSimulationRequest(*simspaceweaver.DeleteSimulationInput) (*request.Request, *simspaceweaver.DeleteSimulationOutput) - - DescribeApp(*simspaceweaver.DescribeAppInput) (*simspaceweaver.DescribeAppOutput, error) - DescribeAppWithContext(aws.Context, *simspaceweaver.DescribeAppInput, ...request.Option) (*simspaceweaver.DescribeAppOutput, error) - DescribeAppRequest(*simspaceweaver.DescribeAppInput) (*request.Request, *simspaceweaver.DescribeAppOutput) - - DescribeSimulation(*simspaceweaver.DescribeSimulationInput) (*simspaceweaver.DescribeSimulationOutput, error) - DescribeSimulationWithContext(aws.Context, *simspaceweaver.DescribeSimulationInput, ...request.Option) (*simspaceweaver.DescribeSimulationOutput, error) - DescribeSimulationRequest(*simspaceweaver.DescribeSimulationInput) (*request.Request, *simspaceweaver.DescribeSimulationOutput) - - ListApps(*simspaceweaver.ListAppsInput) (*simspaceweaver.ListAppsOutput, error) - ListAppsWithContext(aws.Context, *simspaceweaver.ListAppsInput, ...request.Option) (*simspaceweaver.ListAppsOutput, error) - ListAppsRequest(*simspaceweaver.ListAppsInput) (*request.Request, *simspaceweaver.ListAppsOutput) - - ListAppsPages(*simspaceweaver.ListAppsInput, func(*simspaceweaver.ListAppsOutput, bool) bool) error - ListAppsPagesWithContext(aws.Context, *simspaceweaver.ListAppsInput, func(*simspaceweaver.ListAppsOutput, bool) bool, ...request.Option) error - - ListSimulations(*simspaceweaver.ListSimulationsInput) (*simspaceweaver.ListSimulationsOutput, error) - ListSimulationsWithContext(aws.Context, *simspaceweaver.ListSimulationsInput, ...request.Option) (*simspaceweaver.ListSimulationsOutput, error) - ListSimulationsRequest(*simspaceweaver.ListSimulationsInput) (*request.Request, *simspaceweaver.ListSimulationsOutput) - - ListSimulationsPages(*simspaceweaver.ListSimulationsInput, func(*simspaceweaver.ListSimulationsOutput, bool) bool) error - ListSimulationsPagesWithContext(aws.Context, *simspaceweaver.ListSimulationsInput, func(*simspaceweaver.ListSimulationsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*simspaceweaver.ListTagsForResourceInput) (*simspaceweaver.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *simspaceweaver.ListTagsForResourceInput, ...request.Option) (*simspaceweaver.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*simspaceweaver.ListTagsForResourceInput) (*request.Request, *simspaceweaver.ListTagsForResourceOutput) - - StartApp(*simspaceweaver.StartAppInput) (*simspaceweaver.StartAppOutput, error) - StartAppWithContext(aws.Context, *simspaceweaver.StartAppInput, ...request.Option) (*simspaceweaver.StartAppOutput, error) - StartAppRequest(*simspaceweaver.StartAppInput) (*request.Request, *simspaceweaver.StartAppOutput) - - StartClock(*simspaceweaver.StartClockInput) (*simspaceweaver.StartClockOutput, error) - StartClockWithContext(aws.Context, *simspaceweaver.StartClockInput, ...request.Option) (*simspaceweaver.StartClockOutput, error) - StartClockRequest(*simspaceweaver.StartClockInput) (*request.Request, *simspaceweaver.StartClockOutput) - - StartSimulation(*simspaceweaver.StartSimulationInput) (*simspaceweaver.StartSimulationOutput, error) - StartSimulationWithContext(aws.Context, *simspaceweaver.StartSimulationInput, ...request.Option) (*simspaceweaver.StartSimulationOutput, error) - StartSimulationRequest(*simspaceweaver.StartSimulationInput) (*request.Request, *simspaceweaver.StartSimulationOutput) - - StopApp(*simspaceweaver.StopAppInput) (*simspaceweaver.StopAppOutput, error) - StopAppWithContext(aws.Context, *simspaceweaver.StopAppInput, ...request.Option) (*simspaceweaver.StopAppOutput, error) - StopAppRequest(*simspaceweaver.StopAppInput) (*request.Request, *simspaceweaver.StopAppOutput) - - StopClock(*simspaceweaver.StopClockInput) (*simspaceweaver.StopClockOutput, error) - StopClockWithContext(aws.Context, *simspaceweaver.StopClockInput, ...request.Option) (*simspaceweaver.StopClockOutput, error) - StopClockRequest(*simspaceweaver.StopClockInput) (*request.Request, *simspaceweaver.StopClockOutput) - - StopSimulation(*simspaceweaver.StopSimulationInput) (*simspaceweaver.StopSimulationOutput, error) - StopSimulationWithContext(aws.Context, *simspaceweaver.StopSimulationInput, ...request.Option) (*simspaceweaver.StopSimulationOutput, error) - StopSimulationRequest(*simspaceweaver.StopSimulationInput) (*request.Request, *simspaceweaver.StopSimulationOutput) - - TagResource(*simspaceweaver.TagResourceInput) (*simspaceweaver.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *simspaceweaver.TagResourceInput, ...request.Option) (*simspaceweaver.TagResourceOutput, error) - TagResourceRequest(*simspaceweaver.TagResourceInput) (*request.Request, *simspaceweaver.TagResourceOutput) - - UntagResource(*simspaceweaver.UntagResourceInput) (*simspaceweaver.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *simspaceweaver.UntagResourceInput, ...request.Option) (*simspaceweaver.UntagResourceOutput, error) - UntagResourceRequest(*simspaceweaver.UntagResourceInput) (*request.Request, *simspaceweaver.UntagResourceOutput) -} - -var _ SimSpaceWeaverAPI = (*simspaceweaver.SimSpaceWeaver)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/api.go deleted file mode 100644 index f8d2fa1abf52..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/api.go +++ /dev/null @@ -1,5704 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ssmsap - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opDeleteResourcePermission = "DeleteResourcePermission" - -// DeleteResourcePermissionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteResourcePermission 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 DeleteResourcePermission for more information on using the DeleteResourcePermission -// 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 DeleteResourcePermissionRequest method. -// req, resp := client.DeleteResourcePermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/DeleteResourcePermission -func (c *SsmSap) DeleteResourcePermissionRequest(input *DeleteResourcePermissionInput) (req *request.Request, output *DeleteResourcePermissionOutput) { - op := &request.Operation{ - Name: opDeleteResourcePermission, - HTTPMethod: "POST", - HTTPPath: "/delete-resource-permission", - } - - if input == nil { - input = &DeleteResourcePermissionInput{} - } - - output = &DeleteResourcePermissionOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteResourcePermission API operation for AWS Systems Manager for SAP. -// -// Removes permissions associated with the target database. -// -// 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 AWS Systems Manager for SAP's -// API operation DeleteResourcePermission for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/DeleteResourcePermission -func (c *SsmSap) DeleteResourcePermission(input *DeleteResourcePermissionInput) (*DeleteResourcePermissionOutput, error) { - req, out := c.DeleteResourcePermissionRequest(input) - return out, req.Send() -} - -// DeleteResourcePermissionWithContext is the same as DeleteResourcePermission with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteResourcePermission 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 *SsmSap) DeleteResourcePermissionWithContext(ctx aws.Context, input *DeleteResourcePermissionInput, opts ...request.Option) (*DeleteResourcePermissionOutput, error) { - req, out := c.DeleteResourcePermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterApplication = "DeregisterApplication" - -// DeregisterApplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterApplication 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 DeregisterApplication for more information on using the DeregisterApplication -// 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 DeregisterApplicationRequest method. -// req, resp := client.DeregisterApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/DeregisterApplication -func (c *SsmSap) DeregisterApplicationRequest(input *DeregisterApplicationInput) (req *request.Request, output *DeregisterApplicationOutput) { - op := &request.Operation{ - Name: opDeregisterApplication, - HTTPMethod: "POST", - HTTPPath: "/deregister-application", - } - - if input == nil { - input = &DeregisterApplicationInput{} - } - - output = &DeregisterApplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterApplication API operation for AWS Systems Manager for SAP. -// -// Deregister an SAP application with AWS Systems Manager for SAP. This action -// does not affect the existing setup of your SAP workloads on Amazon EC2. -// -// 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 AWS Systems Manager for SAP's -// API operation DeregisterApplication for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedException -// The request is not authorized. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/DeregisterApplication -func (c *SsmSap) DeregisterApplication(input *DeregisterApplicationInput) (*DeregisterApplicationOutput, error) { - req, out := c.DeregisterApplicationRequest(input) - return out, req.Send() -} - -// DeregisterApplicationWithContext is the same as DeregisterApplication with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterApplication 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 *SsmSap) DeregisterApplicationWithContext(ctx aws.Context, input *DeregisterApplicationInput, opts ...request.Option) (*DeregisterApplicationOutput, error) { - req, out := c.DeregisterApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetApplication = "GetApplication" - -// GetApplicationRequest generates a "aws/request.Request" representing the -// client's request for the GetApplication 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 GetApplication for more information on using the GetApplication -// 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 GetApplicationRequest method. -// req, resp := client.GetApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetApplication -func (c *SsmSap) GetApplicationRequest(input *GetApplicationInput) (req *request.Request, output *GetApplicationOutput) { - op := &request.Operation{ - Name: opGetApplication, - HTTPMethod: "POST", - HTTPPath: "/get-application", - } - - if input == nil { - input = &GetApplicationInput{} - } - - output = &GetApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetApplication API operation for AWS Systems Manager for SAP. -// -// Gets an application registered with AWS Systems Manager for SAP. It also -// returns the components of the application. -// -// 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 AWS Systems Manager for SAP's -// API operation GetApplication for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetApplication -func (c *SsmSap) GetApplication(input *GetApplicationInput) (*GetApplicationOutput, error) { - req, out := c.GetApplicationRequest(input) - return out, req.Send() -} - -// GetApplicationWithContext is the same as GetApplication with the addition of -// the ability to pass a context and additional request options. -// -// See GetApplication 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 *SsmSap) GetApplicationWithContext(ctx aws.Context, input *GetApplicationInput, opts ...request.Option) (*GetApplicationOutput, error) { - req, out := c.GetApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetComponent = "GetComponent" - -// GetComponentRequest generates a "aws/request.Request" representing the -// client's request for the GetComponent 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 GetComponent for more information on using the GetComponent -// 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 GetComponentRequest method. -// req, resp := client.GetComponentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetComponent -func (c *SsmSap) GetComponentRequest(input *GetComponentInput) (req *request.Request, output *GetComponentOutput) { - op := &request.Operation{ - Name: opGetComponent, - HTTPMethod: "POST", - HTTPPath: "/get-component", - } - - if input == nil { - input = &GetComponentInput{} - } - - output = &GetComponentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetComponent API operation for AWS Systems Manager for SAP. -// -// Gets the component of an application registered with AWS Systems Manager -// for SAP. -// -// 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 AWS Systems Manager for SAP's -// API operation GetComponent for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedException -// The request is not authorized. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetComponent -func (c *SsmSap) GetComponent(input *GetComponentInput) (*GetComponentOutput, error) { - req, out := c.GetComponentRequest(input) - return out, req.Send() -} - -// GetComponentWithContext is the same as GetComponent with the addition of -// the ability to pass a context and additional request options. -// -// See GetComponent 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 *SsmSap) GetComponentWithContext(ctx aws.Context, input *GetComponentInput, opts ...request.Option) (*GetComponentOutput, error) { - req, out := c.GetComponentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDatabase = "GetDatabase" - -// GetDatabaseRequest generates a "aws/request.Request" representing the -// client's request for the GetDatabase 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 GetDatabase for more information on using the GetDatabase -// 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 GetDatabaseRequest method. -// req, resp := client.GetDatabaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetDatabase -func (c *SsmSap) GetDatabaseRequest(input *GetDatabaseInput) (req *request.Request, output *GetDatabaseOutput) { - op := &request.Operation{ - Name: opGetDatabase, - HTTPMethod: "POST", - HTTPPath: "/get-database", - } - - if input == nil { - input = &GetDatabaseInput{} - } - - output = &GetDatabaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetDatabase API operation for AWS Systems Manager for SAP. -// -// Gets the SAP HANA database of an application registered with AWS Systems -// Manager for SAP. -// -// 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 AWS Systems Manager for SAP's -// API operation GetDatabase for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetDatabase -func (c *SsmSap) GetDatabase(input *GetDatabaseInput) (*GetDatabaseOutput, error) { - req, out := c.GetDatabaseRequest(input) - return out, req.Send() -} - -// GetDatabaseWithContext is the same as GetDatabase with the addition of -// the ability to pass a context and additional request options. -// -// See GetDatabase 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 *SsmSap) GetDatabaseWithContext(ctx aws.Context, input *GetDatabaseInput, opts ...request.Option) (*GetDatabaseOutput, error) { - req, out := c.GetDatabaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetOperation = "GetOperation" - -// GetOperationRequest generates a "aws/request.Request" representing the -// client's request for the GetOperation 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 GetOperation for more information on using the GetOperation -// 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 GetOperationRequest method. -// req, resp := client.GetOperationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetOperation -func (c *SsmSap) GetOperationRequest(input *GetOperationInput) (req *request.Request, output *GetOperationOutput) { - op := &request.Operation{ - Name: opGetOperation, - HTTPMethod: "POST", - HTTPPath: "/get-operation", - } - - if input == nil { - input = &GetOperationInput{} - } - - output = &GetOperationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOperation API operation for AWS Systems Manager for SAP. -// -// Gets the details of an operation by specifying the operation ID. -// -// 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 AWS Systems Manager for SAP's -// API operation GetOperation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetOperation -func (c *SsmSap) GetOperation(input *GetOperationInput) (*GetOperationOutput, error) { - req, out := c.GetOperationRequest(input) - return out, req.Send() -} - -// GetOperationWithContext is the same as GetOperation with the addition of -// the ability to pass a context and additional request options. -// -// See GetOperation 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 *SsmSap) GetOperationWithContext(ctx aws.Context, input *GetOperationInput, opts ...request.Option) (*GetOperationOutput, error) { - req, out := c.GetOperationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetResourcePermission = "GetResourcePermission" - -// GetResourcePermissionRequest generates a "aws/request.Request" representing the -// client's request for the GetResourcePermission 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 GetResourcePermission for more information on using the GetResourcePermission -// 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 GetResourcePermissionRequest method. -// req, resp := client.GetResourcePermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetResourcePermission -func (c *SsmSap) GetResourcePermissionRequest(input *GetResourcePermissionInput) (req *request.Request, output *GetResourcePermissionOutput) { - op := &request.Operation{ - Name: opGetResourcePermission, - HTTPMethod: "POST", - HTTPPath: "/get-resource-permission", - } - - if input == nil { - input = &GetResourcePermissionInput{} - } - - output = &GetResourcePermissionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetResourcePermission API operation for AWS Systems Manager for SAP. -// -// Gets permissions associated with the target database. -// -// 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 AWS Systems Manager for SAP's -// API operation GetResourcePermission for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/GetResourcePermission -func (c *SsmSap) GetResourcePermission(input *GetResourcePermissionInput) (*GetResourcePermissionOutput, error) { - req, out := c.GetResourcePermissionRequest(input) - return out, req.Send() -} - -// GetResourcePermissionWithContext is the same as GetResourcePermission with the addition of -// the ability to pass a context and additional request options. -// -// See GetResourcePermission 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 *SsmSap) GetResourcePermissionWithContext(ctx aws.Context, input *GetResourcePermissionInput, opts ...request.Option) (*GetResourcePermissionOutput, error) { - req, out := c.GetResourcePermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListApplications = "ListApplications" - -// ListApplicationsRequest generates a "aws/request.Request" representing the -// client's request for the ListApplications 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 ListApplications for more information on using the ListApplications -// 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 ListApplicationsRequest method. -// req, resp := client.ListApplicationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListApplications -func (c *SsmSap) ListApplicationsRequest(input *ListApplicationsInput) (req *request.Request, output *ListApplicationsOutput) { - op := &request.Operation{ - Name: opListApplications, - HTTPMethod: "POST", - HTTPPath: "/list-applications", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListApplicationsInput{} - } - - output = &ListApplicationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListApplications API operation for AWS Systems Manager for SAP. -// -// Lists all the applications registered with AWS Systems Manager for SAP. -// -// 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 AWS Systems Manager for SAP's -// API operation ListApplications for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListApplications -func (c *SsmSap) ListApplications(input *ListApplicationsInput) (*ListApplicationsOutput, error) { - req, out := c.ListApplicationsRequest(input) - return out, req.Send() -} - -// ListApplicationsWithContext is the same as ListApplications with the addition of -// the ability to pass a context and additional request options. -// -// See ListApplications 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 *SsmSap) ListApplicationsWithContext(ctx aws.Context, input *ListApplicationsInput, opts ...request.Option) (*ListApplicationsOutput, error) { - req, out := c.ListApplicationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListApplicationsPages iterates over the pages of a ListApplications operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListApplications method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListApplications operation. -// pageNum := 0 -// err := client.ListApplicationsPages(params, -// func(page *ssmsap.ListApplicationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SsmSap) ListApplicationsPages(input *ListApplicationsInput, fn func(*ListApplicationsOutput, bool) bool) error { - return c.ListApplicationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListApplicationsPagesWithContext same as ListApplicationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SsmSap) ListApplicationsPagesWithContext(ctx aws.Context, input *ListApplicationsInput, fn func(*ListApplicationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListApplicationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListApplicationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListComponents = "ListComponents" - -// ListComponentsRequest generates a "aws/request.Request" representing the -// client's request for the ListComponents 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 ListComponents for more information on using the ListComponents -// 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 ListComponentsRequest method. -// req, resp := client.ListComponentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListComponents -func (c *SsmSap) ListComponentsRequest(input *ListComponentsInput) (req *request.Request, output *ListComponentsOutput) { - op := &request.Operation{ - Name: opListComponents, - HTTPMethod: "POST", - HTTPPath: "/list-components", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListComponentsInput{} - } - - output = &ListComponentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListComponents API operation for AWS Systems Manager for SAP. -// -// Lists all the components registered with AWS Systems Manager for SAP. -// -// 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 AWS Systems Manager for SAP's -// API operation ListComponents for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedException -// The request is not authorized. -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListComponents -func (c *SsmSap) ListComponents(input *ListComponentsInput) (*ListComponentsOutput, error) { - req, out := c.ListComponentsRequest(input) - return out, req.Send() -} - -// ListComponentsWithContext is the same as ListComponents with the addition of -// the ability to pass a context and additional request options. -// -// See ListComponents 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 *SsmSap) ListComponentsWithContext(ctx aws.Context, input *ListComponentsInput, opts ...request.Option) (*ListComponentsOutput, error) { - req, out := c.ListComponentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListComponentsPages iterates over the pages of a ListComponents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListComponents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListComponents operation. -// pageNum := 0 -// err := client.ListComponentsPages(params, -// func(page *ssmsap.ListComponentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SsmSap) ListComponentsPages(input *ListComponentsInput, fn func(*ListComponentsOutput, bool) bool) error { - return c.ListComponentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListComponentsPagesWithContext same as ListComponentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SsmSap) ListComponentsPagesWithContext(ctx aws.Context, input *ListComponentsInput, fn func(*ListComponentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListComponentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListComponentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListComponentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDatabases = "ListDatabases" - -// ListDatabasesRequest generates a "aws/request.Request" representing the -// client's request for the ListDatabases 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 ListDatabases for more information on using the ListDatabases -// 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 ListDatabasesRequest method. -// req, resp := client.ListDatabasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListDatabases -func (c *SsmSap) ListDatabasesRequest(input *ListDatabasesInput) (req *request.Request, output *ListDatabasesOutput) { - op := &request.Operation{ - Name: opListDatabases, - HTTPMethod: "POST", - HTTPPath: "/list-databases", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDatabasesInput{} - } - - output = &ListDatabasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDatabases API operation for AWS Systems Manager for SAP. -// -// Lists the SAP HANA databases of an application registered with AWS Systems -// Manager for SAP. -// -// 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 AWS Systems Manager for SAP's -// API operation ListDatabases for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListDatabases -func (c *SsmSap) ListDatabases(input *ListDatabasesInput) (*ListDatabasesOutput, error) { - req, out := c.ListDatabasesRequest(input) - return out, req.Send() -} - -// ListDatabasesWithContext is the same as ListDatabases with the addition of -// the ability to pass a context and additional request options. -// -// See ListDatabases 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 *SsmSap) ListDatabasesWithContext(ctx aws.Context, input *ListDatabasesInput, opts ...request.Option) (*ListDatabasesOutput, error) { - req, out := c.ListDatabasesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDatabasesPages iterates over the pages of a ListDatabases operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDatabases method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDatabases operation. -// pageNum := 0 -// err := client.ListDatabasesPages(params, -// func(page *ssmsap.ListDatabasesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SsmSap) ListDatabasesPages(input *ListDatabasesInput, fn func(*ListDatabasesOutput, bool) bool) error { - return c.ListDatabasesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDatabasesPagesWithContext same as ListDatabasesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SsmSap) ListDatabasesPagesWithContext(ctx aws.Context, input *ListDatabasesInput, fn func(*ListDatabasesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDatabasesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDatabasesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDatabasesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListOperations = "ListOperations" - -// ListOperationsRequest generates a "aws/request.Request" representing the -// client's request for the ListOperations 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 ListOperations for more information on using the ListOperations -// 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 ListOperationsRequest method. -// req, resp := client.ListOperationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListOperations -func (c *SsmSap) ListOperationsRequest(input *ListOperationsInput) (req *request.Request, output *ListOperationsOutput) { - op := &request.Operation{ - Name: opListOperations, - HTTPMethod: "POST", - HTTPPath: "/list-operations", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListOperationsInput{} - } - - output = &ListOperationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOperations API operation for AWS Systems Manager for SAP. -// -// Lists the operations performed by AWS Systems Manager for SAP. -// -// 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 AWS Systems Manager for SAP's -// API operation ListOperations for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListOperations -func (c *SsmSap) ListOperations(input *ListOperationsInput) (*ListOperationsOutput, error) { - req, out := c.ListOperationsRequest(input) - return out, req.Send() -} - -// ListOperationsWithContext is the same as ListOperations with the addition of -// the ability to pass a context and additional request options. -// -// See ListOperations 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 *SsmSap) ListOperationsWithContext(ctx aws.Context, input *ListOperationsInput, opts ...request.Option) (*ListOperationsOutput, error) { - req, out := c.ListOperationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListOperationsPages iterates over the pages of a ListOperations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOperations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListOperations operation. -// pageNum := 0 -// err := client.ListOperationsPages(params, -// func(page *ssmsap.ListOperationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SsmSap) ListOperationsPages(input *ListOperationsInput, fn func(*ListOperationsOutput, bool) bool) error { - return c.ListOperationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOperationsPagesWithContext same as ListOperationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SsmSap) ListOperationsPagesWithContext(ctx aws.Context, input *ListOperationsInput, fn func(*ListOperationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListOperationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListOperationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListOperationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListTagsForResource -func (c *SsmSap) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Systems Manager for SAP. -// -// Lists all tags on an SAP HANA application and/or database registered with -// AWS Systems Manager for SAP. -// -// 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 AWS Systems Manager for SAP's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// A conflict has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/ListTagsForResource -func (c *SsmSap) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *SsmSap) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutResourcePermission = "PutResourcePermission" - -// PutResourcePermissionRequest generates a "aws/request.Request" representing the -// client's request for the PutResourcePermission 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 PutResourcePermission for more information on using the PutResourcePermission -// 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 PutResourcePermissionRequest method. -// req, resp := client.PutResourcePermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/PutResourcePermission -func (c *SsmSap) PutResourcePermissionRequest(input *PutResourcePermissionInput) (req *request.Request, output *PutResourcePermissionOutput) { - op := &request.Operation{ - Name: opPutResourcePermission, - HTTPMethod: "POST", - HTTPPath: "/put-resource-permission", - } - - if input == nil { - input = &PutResourcePermissionInput{} - } - - output = &PutResourcePermissionOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutResourcePermission API operation for AWS Systems Manager for SAP. -// -// Adds permissions to the target database. -// -// 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 AWS Systems Manager for SAP's -// API operation PutResourcePermission for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/PutResourcePermission -func (c *SsmSap) PutResourcePermission(input *PutResourcePermissionInput) (*PutResourcePermissionOutput, error) { - req, out := c.PutResourcePermissionRequest(input) - return out, req.Send() -} - -// PutResourcePermissionWithContext is the same as PutResourcePermission with the addition of -// the ability to pass a context and additional request options. -// -// See PutResourcePermission 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 *SsmSap) PutResourcePermissionWithContext(ctx aws.Context, input *PutResourcePermissionInput, opts ...request.Option) (*PutResourcePermissionOutput, error) { - req, out := c.PutResourcePermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterApplication = "RegisterApplication" - -// RegisterApplicationRequest generates a "aws/request.Request" representing the -// client's request for the RegisterApplication 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 RegisterApplication for more information on using the RegisterApplication -// 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 RegisterApplicationRequest method. -// req, resp := client.RegisterApplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/RegisterApplication -func (c *SsmSap) RegisterApplicationRequest(input *RegisterApplicationInput) (req *request.Request, output *RegisterApplicationOutput) { - op := &request.Operation{ - Name: opRegisterApplication, - HTTPMethod: "POST", - HTTPPath: "/register-application", - } - - if input == nil { - input = &RegisterApplicationInput{} - } - - output = &RegisterApplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterApplication API operation for AWS Systems Manager for SAP. -// -// Register an SAP application with AWS Systems Manager for SAP. You must meet -// the following requirements before registering. -// -// The SAP application you want to register with AWS Systems Manager for SAP -// is running on Amazon EC2. -// -// AWS Systems Manager Agent must be setup on an Amazon EC2 instance along with -// the required IAM permissions. -// -// Amazon EC2 instance(s) must have access to the secrets created in AWS Secrets -// Manager to manage SAP applications and components. -// -// 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 AWS Systems Manager for SAP's -// API operation RegisterApplication for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// A conflict has occurred. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/RegisterApplication -func (c *SsmSap) RegisterApplication(input *RegisterApplicationInput) (*RegisterApplicationOutput, error) { - req, out := c.RegisterApplicationRequest(input) - return out, req.Send() -} - -// RegisterApplicationWithContext is the same as RegisterApplication with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterApplication 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 *SsmSap) RegisterApplicationWithContext(ctx aws.Context, input *RegisterApplicationInput, opts ...request.Option) (*RegisterApplicationOutput, error) { - req, out := c.RegisterApplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartApplicationRefresh = "StartApplicationRefresh" - -// StartApplicationRefreshRequest generates a "aws/request.Request" representing the -// client's request for the StartApplicationRefresh 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 StartApplicationRefresh for more information on using the StartApplicationRefresh -// 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 StartApplicationRefreshRequest method. -// req, resp := client.StartApplicationRefreshRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/StartApplicationRefresh -func (c *SsmSap) StartApplicationRefreshRequest(input *StartApplicationRefreshInput) (req *request.Request, output *StartApplicationRefreshOutput) { - op := &request.Operation{ - Name: opStartApplicationRefresh, - HTTPMethod: "POST", - HTTPPath: "/start-application-refresh", - } - - if input == nil { - input = &StartApplicationRefreshInput{} - } - - output = &StartApplicationRefreshOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartApplicationRefresh API operation for AWS Systems Manager for SAP. -// -// Refreshes a registered application. -// -// 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 AWS Systems Manager for SAP's -// API operation StartApplicationRefresh for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedException -// The request is not authorized. -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// A conflict has occurred. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/StartApplicationRefresh -func (c *SsmSap) StartApplicationRefresh(input *StartApplicationRefreshInput) (*StartApplicationRefreshOutput, error) { - req, out := c.StartApplicationRefreshRequest(input) - return out, req.Send() -} - -// StartApplicationRefreshWithContext is the same as StartApplicationRefresh with the addition of -// the ability to pass a context and additional request options. -// -// See StartApplicationRefresh 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 *SsmSap) StartApplicationRefreshWithContext(ctx aws.Context, input *StartApplicationRefreshInput, opts ...request.Option) (*StartApplicationRefreshOutput, error) { - req, out := c.StartApplicationRefreshRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/TagResource -func (c *SsmSap) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Systems Manager for SAP. -// -// Creates tag for a resource by specifying the ARN. -// -// 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 AWS Systems Manager for SAP's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// A conflict has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/TagResource -func (c *SsmSap) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *SsmSap) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/UntagResource -func (c *SsmSap) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Systems Manager for SAP. -// -// Delete the tags for a resource. -// -// 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 AWS Systems Manager for SAP's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// A conflict has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/UntagResource -func (c *SsmSap) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *SsmSap) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateApplicationSettings = "UpdateApplicationSettings" - -// UpdateApplicationSettingsRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplicationSettings 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 UpdateApplicationSettings for more information on using the UpdateApplicationSettings -// 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 UpdateApplicationSettingsRequest method. -// req, resp := client.UpdateApplicationSettingsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/UpdateApplicationSettings -func (c *SsmSap) UpdateApplicationSettingsRequest(input *UpdateApplicationSettingsInput) (req *request.Request, output *UpdateApplicationSettingsOutput) { - op := &request.Operation{ - Name: opUpdateApplicationSettings, - HTTPMethod: "POST", - HTTPPath: "/update-application-settings", - } - - if input == nil { - input = &UpdateApplicationSettingsInput{} - } - - output = &UpdateApplicationSettingsOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateApplicationSettings API operation for AWS Systems Manager for SAP. -// -// Updates the settings of an application registered with AWS Systems Manager -// for SAP. -// -// 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 AWS Systems Manager for SAP's -// API operation UpdateApplicationSettings for usage and error information. -// -// Returned Error Types: -// -// - UnauthorizedException -// The request is not authorized. -// -// - ResourceNotFoundException -// The resource is not available. -// -// - ValidationException -// The input fails to satisfy the constraints specified by an AWS service. -// -// - ConflictException -// A conflict has occurred. -// -// - InternalServerException -// An internal error has occurred. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10/UpdateApplicationSettings -func (c *SsmSap) UpdateApplicationSettings(input *UpdateApplicationSettingsInput) (*UpdateApplicationSettingsOutput, error) { - req, out := c.UpdateApplicationSettingsRequest(input) - return out, req.Send() -} - -// UpdateApplicationSettingsWithContext is the same as UpdateApplicationSettings with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateApplicationSettings 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 *SsmSap) UpdateApplicationSettingsWithContext(ctx aws.Context, input *UpdateApplicationSettingsInput, opts ...request.Option) (*UpdateApplicationSettingsOutput, error) { - req, out := c.UpdateApplicationSettingsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// An SAP application registered with AWS Systems Manager for SAP. -type Application struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Application Registry. - AppRegistryArn *string `type:"string"` - - // The Amazon Resource Name (ARN) of the application. - Arn *string `type:"string"` - - // The components of the application. - Components []*string `type:"list"` - - // The latest discovery result for the application. - DiscoveryStatus *string `type:"string" enum:"ApplicationDiscoveryStatus"` - - // The ID of the application. - Id *string `type:"string"` - - // The time at which the application was last updated. - LastUpdated *time.Time `type:"timestamp"` - - // The status of the application. - Status *string `type:"string" enum:"ApplicationStatus"` - - // The status message. - StatusMessage *string `type:"string"` - - // The type of the application. - Type *string `type:"string" enum:"ApplicationType"` -} - -// 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 Application) 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 Application) GoString() string { - return s.String() -} - -// SetAppRegistryArn sets the AppRegistryArn field's value. -func (s *Application) SetAppRegistryArn(v string) *Application { - s.AppRegistryArn = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Application) SetArn(v string) *Application { - s.Arn = &v - return s -} - -// SetComponents sets the Components field's value. -func (s *Application) SetComponents(v []*string) *Application { - s.Components = v - return s -} - -// SetDiscoveryStatus sets the DiscoveryStatus field's value. -func (s *Application) SetDiscoveryStatus(v string) *Application { - s.DiscoveryStatus = &v - return s -} - -// SetId sets the Id field's value. -func (s *Application) SetId(v string) *Application { - s.Id = &v - return s -} - -// SetLastUpdated sets the LastUpdated field's value. -func (s *Application) SetLastUpdated(v time.Time) *Application { - s.LastUpdated = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Application) SetStatus(v string) *Application { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *Application) SetStatusMessage(v string) *Application { - s.StatusMessage = &v - return s -} - -// SetType sets the Type field's value. -func (s *Application) SetType(v string) *Application { - s.Type = &v - return s -} - -// The credentials of your SAP application. -type ApplicationCredential struct { - _ struct{} `type:"structure"` - - // The type of the application credentials. - // - // CredentialType is a required field - CredentialType *string `type:"string" required:"true" enum:"CredentialType"` - - // The name of the SAP HANA database. - // - // DatabaseName is a required field - DatabaseName *string `min:"1" type:"string" required:"true"` - - // The secret ID created in AWS Secrets Manager to store the credentials of - // the SAP application. - // - // SecretId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ApplicationCredential's - // String and GoString methods. - // - // SecretId is a required field - SecretId *string `min:"1" type:"string" required:"true" sensitive:"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 ApplicationCredential) 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 ApplicationCredential) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ApplicationCredential) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplicationCredential"} - if s.CredentialType == nil { - invalidParams.Add(request.NewErrParamRequired("CredentialType")) - } - if s.DatabaseName == nil { - invalidParams.Add(request.NewErrParamRequired("DatabaseName")) - } - if s.DatabaseName != nil && len(*s.DatabaseName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DatabaseName", 1)) - } - if s.SecretId == nil { - invalidParams.Add(request.NewErrParamRequired("SecretId")) - } - if s.SecretId != nil && len(*s.SecretId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecretId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCredentialType sets the CredentialType field's value. -func (s *ApplicationCredential) SetCredentialType(v string) *ApplicationCredential { - s.CredentialType = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *ApplicationCredential) SetDatabaseName(v string) *ApplicationCredential { - s.DatabaseName = &v - return s -} - -// SetSecretId sets the SecretId field's value. -func (s *ApplicationCredential) SetSecretId(v string) *ApplicationCredential { - s.SecretId = &v - return s -} - -// The summary of the SAP application registered with AWS Systems Manager for -// SAP. -type ApplicationSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the application. - Arn *string `type:"string"` - - // The status of the latest discovery. - DiscoveryStatus *string `type:"string" enum:"ApplicationDiscoveryStatus"` - - // The ID of the application. - Id *string `type:"string"` - - // The tags on the application. - Tags map[string]*string `type:"map"` - - // The type of the application. - Type *string `type:"string" enum:"ApplicationType"` -} - -// 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 ApplicationSummary) 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 ApplicationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ApplicationSummary) SetArn(v string) *ApplicationSummary { - s.Arn = &v - return s -} - -// SetDiscoveryStatus sets the DiscoveryStatus field's value. -func (s *ApplicationSummary) SetDiscoveryStatus(v string) *ApplicationSummary { - s.DiscoveryStatus = &v - return s -} - -// SetId sets the Id field's value. -func (s *ApplicationSummary) SetId(v string) *ApplicationSummary { - s.Id = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ApplicationSummary) SetTags(v map[string]*string) *ApplicationSummary { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *ApplicationSummary) SetType(v string) *ApplicationSummary { - s.Type = &v - return s -} - -// Describes the properties of the associated host. -type AssociatedHost struct { - _ struct{} `type:"structure"` - - // The ID of the Amazon EC2 instance. - Ec2InstanceId *string `type:"string"` - - // The name of the host. - Hostname *string `type:"string"` - - // The IP addresses of the associated host. - IpAddresses []*IpAddressMember `type:"list"` - - // The version of the operating system. - OsVersion *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 AssociatedHost) 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 AssociatedHost) GoString() string { - return s.String() -} - -// SetEc2InstanceId sets the Ec2InstanceId field's value. -func (s *AssociatedHost) SetEc2InstanceId(v string) *AssociatedHost { - s.Ec2InstanceId = &v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *AssociatedHost) SetHostname(v string) *AssociatedHost { - s.Hostname = &v - return s -} - -// SetIpAddresses sets the IpAddresses field's value. -func (s *AssociatedHost) SetIpAddresses(v []*IpAddressMember) *AssociatedHost { - s.IpAddresses = v - return s -} - -// SetOsVersion sets the OsVersion field's value. -func (s *AssociatedHost) SetOsVersion(v string) *AssociatedHost { - s.OsVersion = &v - return s -} - -// Configuration parameters for AWS Backint Agent for SAP HANA. You can backup -// your SAP HANA database with AWS Backup or Amazon S3. -type BackintConfig struct { - _ struct{} `type:"structure"` - - // AWS service for your database backup. - // - // BackintMode is a required field - BackintMode *string `type:"string" required:"true" enum:"BackintMode"` - - // EnsureNoBackupInProcess is a required field - EnsureNoBackupInProcess *bool `type:"boolean" 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 BackintConfig) 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 BackintConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BackintConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BackintConfig"} - if s.BackintMode == nil { - invalidParams.Add(request.NewErrParamRequired("BackintMode")) - } - if s.EnsureNoBackupInProcess == nil { - invalidParams.Add(request.NewErrParamRequired("EnsureNoBackupInProcess")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBackintMode sets the BackintMode field's value. -func (s *BackintConfig) SetBackintMode(v string) *BackintConfig { - s.BackintMode = &v - return s -} - -// SetEnsureNoBackupInProcess sets the EnsureNoBackupInProcess field's value. -func (s *BackintConfig) SetEnsureNoBackupInProcess(v bool) *BackintConfig { - s.EnsureNoBackupInProcess = &v - return s -} - -// The SAP component of your application. -type Component struct { - _ struct{} `type:"structure"` - - // The ID of the application. - ApplicationId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the component. - Arn *string `type:"string"` - - // The associated host of the component. - AssociatedHost *AssociatedHost `type:"structure"` - - // The child components of a highly available environment. For example, in a - // highly available SAP on AWS workload, the child component consists of the - // primary and secondar instances. - ChildComponents []*string `type:"list"` - - // The ID of the component. - ComponentId *string `type:"string"` - - // The type of the component. - ComponentType *string `type:"string" enum:"ComponentType"` - - // The connection specifications for the database of the component. - DatabaseConnection *DatabaseConnection `type:"structure"` - - // The SAP HANA databases of the component. - Databases []*string `type:"list"` - - // The SAP HANA version of the component. - HdbVersion *string `type:"string"` - - // The hosts of the component. - // - // Deprecated: This shape is no longer used. Please use AssociatedHost. - Hosts []*Host `deprecated:"true" type:"list"` - - // The time at which the component was last updated. - LastUpdated *time.Time `type:"timestamp"` - - // The parent component of a highly available environment. For example, in a - // highly available SAP on AWS workload, the parent component consists of the - // entire setup, including the child components. - ParentComponent *string `type:"string"` - - // The primary host of the component. - // - // Deprecated: This shape is no longer used. Please use AssociatedHost. - PrimaryHost *string `deprecated:"true" type:"string"` - - // Details of the SAP HANA system replication for the component. - Resilience *Resilience `type:"structure"` - - // The SAP feature of the component. - SapFeature *string `type:"string"` - - // The hostname of the component. - SapHostname *string `type:"string"` - - // The kernel version of the component. - SapKernelVersion *string `type:"string"` - - // The SAP System Identifier of the application component. - Sid *string `type:"string"` - - // The status of the component. - // - // * ACTIVATED - this status has been deprecated. - // - // * STARTING - the component is in the process of being started. - // - // * STOPPED - the component is not running. - // - // * STOPPING - the component is in the process of being stopped. - // - // * RUNNING - the component is running. - // - // * RUNNING_WITH_ERROR - one or more child component(s) of the parent component - // is not running. Call GetComponent (https://docs.aws.amazon.com/ssmsap/latest/APIReference/API_GetComponent.html) - // to review the status of each child component. - // - // * UNDEFINED - AWS Systems Manager for SAP cannot provide the component - // status based on the discovered information. Verify your SAP application. - Status *string `type:"string" enum:"ComponentStatus"` - - // The SAP system number of the application component. - SystemNumber *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 Component) 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 Component) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *Component) SetApplicationId(v string) *Component { - s.ApplicationId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Component) SetArn(v string) *Component { - s.Arn = &v - return s -} - -// SetAssociatedHost sets the AssociatedHost field's value. -func (s *Component) SetAssociatedHost(v *AssociatedHost) *Component { - s.AssociatedHost = v - return s -} - -// SetChildComponents sets the ChildComponents field's value. -func (s *Component) SetChildComponents(v []*string) *Component { - s.ChildComponents = v - return s -} - -// SetComponentId sets the ComponentId field's value. -func (s *Component) SetComponentId(v string) *Component { - s.ComponentId = &v - return s -} - -// SetComponentType sets the ComponentType field's value. -func (s *Component) SetComponentType(v string) *Component { - s.ComponentType = &v - return s -} - -// SetDatabaseConnection sets the DatabaseConnection field's value. -func (s *Component) SetDatabaseConnection(v *DatabaseConnection) *Component { - s.DatabaseConnection = v - return s -} - -// SetDatabases sets the Databases field's value. -func (s *Component) SetDatabases(v []*string) *Component { - s.Databases = v - return s -} - -// SetHdbVersion sets the HdbVersion field's value. -func (s *Component) SetHdbVersion(v string) *Component { - s.HdbVersion = &v - return s -} - -// SetHosts sets the Hosts field's value. -func (s *Component) SetHosts(v []*Host) *Component { - s.Hosts = v - return s -} - -// SetLastUpdated sets the LastUpdated field's value. -func (s *Component) SetLastUpdated(v time.Time) *Component { - s.LastUpdated = &v - return s -} - -// SetParentComponent sets the ParentComponent field's value. -func (s *Component) SetParentComponent(v string) *Component { - s.ParentComponent = &v - return s -} - -// SetPrimaryHost sets the PrimaryHost field's value. -func (s *Component) SetPrimaryHost(v string) *Component { - s.PrimaryHost = &v - return s -} - -// SetResilience sets the Resilience field's value. -func (s *Component) SetResilience(v *Resilience) *Component { - s.Resilience = v - return s -} - -// SetSapFeature sets the SapFeature field's value. -func (s *Component) SetSapFeature(v string) *Component { - s.SapFeature = &v - return s -} - -// SetSapHostname sets the SapHostname field's value. -func (s *Component) SetSapHostname(v string) *Component { - s.SapHostname = &v - return s -} - -// SetSapKernelVersion sets the SapKernelVersion field's value. -func (s *Component) SetSapKernelVersion(v string) *Component { - s.SapKernelVersion = &v - return s -} - -// SetSid sets the Sid field's value. -func (s *Component) SetSid(v string) *Component { - s.Sid = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Component) SetStatus(v string) *Component { - s.Status = &v - return s -} - -// SetSystemNumber sets the SystemNumber field's value. -func (s *Component) SetSystemNumber(v string) *Component { - s.SystemNumber = &v - return s -} - -// The summary of the component. -type ComponentSummary struct { - _ struct{} `type:"structure"` - - // The ID of the application. - ApplicationId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the component summary. - Arn *string `type:"string"` - - // The ID of the component. - ComponentId *string `type:"string"` - - // The type of the component. - ComponentType *string `type:"string" enum:"ComponentType"` - - // The tags of the component. - Tags map[string]*string `type:"map"` -} - -// 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 ComponentSummary) 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 ComponentSummary) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ComponentSummary) SetApplicationId(v string) *ComponentSummary { - s.ApplicationId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *ComponentSummary) SetArn(v string) *ComponentSummary { - s.Arn = &v - return s -} - -// SetComponentId sets the ComponentId field's value. -func (s *ComponentSummary) SetComponentId(v string) *ComponentSummary { - s.ComponentId = &v - return s -} - -// SetComponentType sets the ComponentType field's value. -func (s *ComponentSummary) SetComponentType(v string) *ComponentSummary { - s.ComponentType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ComponentSummary) SetTags(v map[string]*string) *ComponentSummary { - s.Tags = v - return s -} - -// A conflict has occurred. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The SAP HANA database of the application registered with AWS Systems Manager -// for SAP. -type Database struct { - _ struct{} `type:"structure"` - - // The ID of the application. - ApplicationId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the database. - Arn *string `type:"string"` - - // The ID of the component. - ComponentId *string `type:"string"` - - // The credentials of the database. - Credentials []*ApplicationCredential `type:"list"` - - // The ID of the SAP HANA database. - DatabaseId *string `type:"string"` - - // The name of the database. - DatabaseName *string `type:"string"` - - // The type of the database. - DatabaseType *string `type:"string" enum:"DatabaseType"` - - // The time at which the database was last updated. - LastUpdated *time.Time `type:"timestamp"` - - // The primary host of the database. - PrimaryHost *string `type:"string"` - - // The SQL port of the database. - SQLPort *int64 `type:"integer"` - - // The status of the database. - Status *string `type:"string" enum:"DatabaseStatus"` -} - -// 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 Database) 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 Database) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *Database) SetApplicationId(v string) *Database { - s.ApplicationId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Database) SetArn(v string) *Database { - s.Arn = &v - return s -} - -// SetComponentId sets the ComponentId field's value. -func (s *Database) SetComponentId(v string) *Database { - s.ComponentId = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *Database) SetCredentials(v []*ApplicationCredential) *Database { - s.Credentials = v - return s -} - -// SetDatabaseId sets the DatabaseId field's value. -func (s *Database) SetDatabaseId(v string) *Database { - s.DatabaseId = &v - return s -} - -// SetDatabaseName sets the DatabaseName field's value. -func (s *Database) SetDatabaseName(v string) *Database { - s.DatabaseName = &v - return s -} - -// SetDatabaseType sets the DatabaseType field's value. -func (s *Database) SetDatabaseType(v string) *Database { - s.DatabaseType = &v - return s -} - -// SetLastUpdated sets the LastUpdated field's value. -func (s *Database) SetLastUpdated(v time.Time) *Database { - s.LastUpdated = &v - return s -} - -// SetPrimaryHost sets the PrimaryHost field's value. -func (s *Database) SetPrimaryHost(v string) *Database { - s.PrimaryHost = &v - return s -} - -// SetSQLPort sets the SQLPort field's value. -func (s *Database) SetSQLPort(v int64) *Database { - s.SQLPort = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Database) SetStatus(v string) *Database { - s.Status = &v - return s -} - -// The connection specifications for the database. -type DatabaseConnection struct { - _ struct{} `type:"structure"` - - // The IP address for connection. - ConnectionIp *string `type:"string"` - - // The Amazon Resource Name of the connected SAP HANA database. - DatabaseArn *string `type:"string"` - - // The method of connection. - DatabaseConnectionMethod *string `type:"string" enum:"DatabaseConnectionMethod"` -} - -// 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 DatabaseConnection) 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 DatabaseConnection) GoString() string { - return s.String() -} - -// SetConnectionIp sets the ConnectionIp field's value. -func (s *DatabaseConnection) SetConnectionIp(v string) *DatabaseConnection { - s.ConnectionIp = &v - return s -} - -// SetDatabaseArn sets the DatabaseArn field's value. -func (s *DatabaseConnection) SetDatabaseArn(v string) *DatabaseConnection { - s.DatabaseArn = &v - return s -} - -// SetDatabaseConnectionMethod sets the DatabaseConnectionMethod field's value. -func (s *DatabaseConnection) SetDatabaseConnectionMethod(v string) *DatabaseConnection { - s.DatabaseConnectionMethod = &v - return s -} - -// The summary of the database. -type DatabaseSummary struct { - _ struct{} `type:"structure"` - - // The ID of the application. - ApplicationId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the database. - Arn *string `type:"string"` - - // The ID of the component. - ComponentId *string `type:"string"` - - // The ID of the database. - DatabaseId *string `type:"string"` - - // The type of the database. - DatabaseType *string `type:"string" enum:"DatabaseType"` - - // The tags of the database. - Tags map[string]*string `type:"map"` -} - -// 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 DatabaseSummary) 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 DatabaseSummary) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DatabaseSummary) SetApplicationId(v string) *DatabaseSummary { - s.ApplicationId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *DatabaseSummary) SetArn(v string) *DatabaseSummary { - s.Arn = &v - return s -} - -// SetComponentId sets the ComponentId field's value. -func (s *DatabaseSummary) SetComponentId(v string) *DatabaseSummary { - s.ComponentId = &v - return s -} - -// SetDatabaseId sets the DatabaseId field's value. -func (s *DatabaseSummary) SetDatabaseId(v string) *DatabaseSummary { - s.DatabaseId = &v - return s -} - -// SetDatabaseType sets the DatabaseType field's value. -func (s *DatabaseSummary) SetDatabaseType(v string) *DatabaseSummary { - s.DatabaseType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DatabaseSummary) SetTags(v map[string]*string) *DatabaseSummary { - s.Tags = v - return s -} - -type DeleteResourcePermissionInput struct { - _ struct{} `type:"structure"` - - // Delete or restore the permissions on the target database. - ActionType *string `type:"string" enum:"PermissionActionType"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the source resource. - SourceResourceArn *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 DeleteResourcePermissionInput) 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 DeleteResourcePermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteResourcePermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteResourcePermissionInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionType sets the ActionType field's value. -func (s *DeleteResourcePermissionInput) SetActionType(v string) *DeleteResourcePermissionInput { - s.ActionType = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *DeleteResourcePermissionInput) SetResourceArn(v string) *DeleteResourcePermissionInput { - s.ResourceArn = &v - return s -} - -// SetSourceResourceArn sets the SourceResourceArn field's value. -func (s *DeleteResourcePermissionInput) SetSourceResourceArn(v string) *DeleteResourcePermissionInput { - s.SourceResourceArn = &v - return s -} - -type DeleteResourcePermissionOutput struct { - _ struct{} `type:"structure"` - - // The policy that removes permissions on the target database. - Policy *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 DeleteResourcePermissionOutput) 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 DeleteResourcePermissionOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *DeleteResourcePermissionOutput) SetPolicy(v string) *DeleteResourcePermissionOutput { - s.Policy = &v - return s -} - -type DeregisterApplicationInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - // - // ApplicationId is a required field - ApplicationId *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 DeregisterApplicationInput) 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 DeregisterApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeregisterApplicationInput) SetApplicationId(v string) *DeregisterApplicationInput { - s.ApplicationId = &v - return s -} - -type DeregisterApplicationOutput 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 DeregisterApplicationOutput) 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 DeregisterApplicationOutput) GoString() string { - return s.String() -} - -// A specific result obtained by specifying the name, value, and operator. -type Filter struct { - _ struct{} `type:"structure"` - - // The name of the filter. Filter names are case-sensitive. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The operator for the filter. - // - // Operator is a required field - Operator *string `type:"string" required:"true" enum:"FilterOperator"` - - // The filter values. Filter values are case-sensitive. If you specify multiple - // values for a filter, the values are joined with an OR, and the request returns - // all results that match any of the specified values - // - // Value is a required field - Value *string `min:"1" 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 Filter) 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 Filter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Filter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Filter"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Operator == nil { - invalidParams.Add(request.NewErrParamRequired("Operator")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *Filter) SetName(v string) *Filter { - s.Name = &v - return s -} - -// SetOperator sets the Operator field's value. -func (s *Filter) SetOperator(v string) *Filter { - s.Operator = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Filter) SetValue(v string) *Filter { - s.Value = &v - return s -} - -type GetApplicationInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the application registry. - AppRegistryArn *string `type:"string"` - - // The Amazon Resource Name (ARN) of the application. - ApplicationArn *string `type:"string"` - - // The ID of the application. - ApplicationId *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 GetApplicationInput) 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 GetApplicationInput) GoString() string { - return s.String() -} - -// SetAppRegistryArn sets the AppRegistryArn field's value. -func (s *GetApplicationInput) SetAppRegistryArn(v string) *GetApplicationInput { - s.AppRegistryArn = &v - return s -} - -// SetApplicationArn sets the ApplicationArn field's value. -func (s *GetApplicationInput) SetApplicationArn(v string) *GetApplicationInput { - s.ApplicationArn = &v - return s -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetApplicationInput) SetApplicationId(v string) *GetApplicationInput { - s.ApplicationId = &v - return s -} - -type GetApplicationOutput struct { - _ struct{} `type:"structure"` - - // Returns all of the metadata of an application registered with AWS Systems - // Manager for SAP. - Application *Application `type:"structure"` - - // The tags of a registered application. - Tags map[string]*string `type:"map"` -} - -// 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 GetApplicationOutput) 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 GetApplicationOutput) GoString() string { - return s.String() -} - -// SetApplication sets the Application field's value. -func (s *GetApplicationOutput) SetApplication(v *Application) *GetApplicationOutput { - s.Application = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetApplicationOutput) SetTags(v map[string]*string) *GetApplicationOutput { - s.Tags = v - return s -} - -type GetComponentInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // The ID of the component. - // - // ComponentId is a required field - ComponentId *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 GetComponentInput) 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 GetComponentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetComponentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetComponentInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ComponentId == nil { - invalidParams.Add(request.NewErrParamRequired("ComponentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetComponentInput) SetApplicationId(v string) *GetComponentInput { - s.ApplicationId = &v - return s -} - -// SetComponentId sets the ComponentId field's value. -func (s *GetComponentInput) SetComponentId(v string) *GetComponentInput { - s.ComponentId = &v - return s -} - -type GetComponentOutput struct { - _ struct{} `type:"structure"` - - // The component of an application registered with AWS Systems Manager for SAP. - Component *Component `type:"structure"` - - // The tags of a component. - Tags map[string]*string `type:"map"` -} - -// 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 GetComponentOutput) 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 GetComponentOutput) GoString() string { - return s.String() -} - -// SetComponent sets the Component field's value. -func (s *GetComponentOutput) SetComponent(v *Component) *GetComponentOutput { - s.Component = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetComponentOutput) SetTags(v map[string]*string) *GetComponentOutput { - s.Tags = v - return s -} - -type GetDatabaseInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - ApplicationId *string `type:"string"` - - // The ID of the component. - ComponentId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the database. - DatabaseArn *string `type:"string"` - - // The ID of the database. - DatabaseId *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 GetDatabaseInput) 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 GetDatabaseInput) GoString() string { - return s.String() -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetDatabaseInput) SetApplicationId(v string) *GetDatabaseInput { - s.ApplicationId = &v - return s -} - -// SetComponentId sets the ComponentId field's value. -func (s *GetDatabaseInput) SetComponentId(v string) *GetDatabaseInput { - s.ComponentId = &v - return s -} - -// SetDatabaseArn sets the DatabaseArn field's value. -func (s *GetDatabaseInput) SetDatabaseArn(v string) *GetDatabaseInput { - s.DatabaseArn = &v - return s -} - -// SetDatabaseId sets the DatabaseId field's value. -func (s *GetDatabaseInput) SetDatabaseId(v string) *GetDatabaseInput { - s.DatabaseId = &v - return s -} - -type GetDatabaseOutput struct { - _ struct{} `type:"structure"` - - // The SAP HANA database of an application registered with AWS Systems Manager - // for SAP. - Database *Database `type:"structure"` - - // The tags of a database. - Tags map[string]*string `type:"map"` -} - -// 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 GetDatabaseOutput) 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 GetDatabaseOutput) GoString() string { - return s.String() -} - -// SetDatabase sets the Database field's value. -func (s *GetDatabaseOutput) SetDatabase(v *Database) *GetDatabaseOutput { - s.Database = v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetDatabaseOutput) SetTags(v map[string]*string) *GetDatabaseOutput { - s.Tags = v - return s -} - -type GetOperationInput struct { - _ struct{} `type:"structure"` - - // The ID of the operation. - // - // OperationId is a required field - OperationId *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 GetOperationInput) 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 GetOperationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOperationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOperationInput"} - if s.OperationId == nil { - invalidParams.Add(request.NewErrParamRequired("OperationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOperationId sets the OperationId field's value. -func (s *GetOperationInput) SetOperationId(v string) *GetOperationInput { - s.OperationId = &v - return s -} - -type GetOperationOutput struct { - _ struct{} `type:"structure"` - - // Returns the details of an operation. - Operation *Operation `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 GetOperationOutput) 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 GetOperationOutput) GoString() string { - return s.String() -} - -// SetOperation sets the Operation field's value. -func (s *GetOperationOutput) SetOperation(v *Operation) *GetOperationOutput { - s.Operation = v - return s -} - -type GetResourcePermissionInput struct { - _ struct{} `type:"structure"` - - ActionType *string `type:"string" enum:"PermissionActionType"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *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 GetResourcePermissionInput) 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 GetResourcePermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetResourcePermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetResourcePermissionInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionType sets the ActionType field's value. -func (s *GetResourcePermissionInput) SetActionType(v string) *GetResourcePermissionInput { - s.ActionType = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *GetResourcePermissionInput) SetResourceArn(v string) *GetResourcePermissionInput { - s.ResourceArn = &v - return s -} - -type GetResourcePermissionOutput struct { - _ struct{} `type:"structure"` - - Policy *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 GetResourcePermissionOutput) 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 GetResourcePermissionOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetResourcePermissionOutput) SetPolicy(v string) *GetResourcePermissionOutput { - s.Policy = &v - return s -} - -// Describes the properties of the Dedicated Host. -type Host struct { - _ struct{} `type:"structure"` - - // The ID of Amazon EC2 instance. - EC2InstanceId *string `type:"string"` - - // The IP address of the Dedicated Host. - HostIp *string `type:"string"` - - // The name of the Dedicated Host. - HostName *string `type:"string"` - - // The role of the Dedicated Host. - HostRole *string `type:"string" enum:"HostRole"` - - // The instance ID of the instance on the Dedicated Host. - InstanceId *string `type:"string"` - - // The version of the operating system. - OsVersion *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 Host) 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 Host) GoString() string { - return s.String() -} - -// SetEC2InstanceId sets the EC2InstanceId field's value. -func (s *Host) SetEC2InstanceId(v string) *Host { - s.EC2InstanceId = &v - return s -} - -// SetHostIp sets the HostIp field's value. -func (s *Host) SetHostIp(v string) *Host { - s.HostIp = &v - return s -} - -// SetHostName sets the HostName field's value. -func (s *Host) SetHostName(v string) *Host { - s.HostName = &v - return s -} - -// SetHostRole sets the HostRole field's value. -func (s *Host) SetHostRole(v string) *Host { - s.HostRole = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *Host) SetInstanceId(v string) *Host { - s.InstanceId = &v - return s -} - -// SetOsVersion sets the OsVersion field's value. -func (s *Host) SetOsVersion(v string) *Host { - s.OsVersion = &v - return s -} - -// An internal error has occurred. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Provides information of the IP address. -type IpAddressMember struct { - _ struct{} `type:"structure"` - - // The type of allocation for the IP address. - AllocationType *string `type:"string" enum:"AllocationType"` - - // The IP address. - IpAddress *string `type:"string"` - - // The primary IP address. - Primary *bool `type:"boolean"` -} - -// 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 IpAddressMember) 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 IpAddressMember) GoString() string { - return s.String() -} - -// SetAllocationType sets the AllocationType field's value. -func (s *IpAddressMember) SetAllocationType(v string) *IpAddressMember { - s.AllocationType = &v - return s -} - -// SetIpAddress sets the IpAddress field's value. -func (s *IpAddressMember) SetIpAddress(v string) *IpAddressMember { - s.IpAddress = &v - return s -} - -// SetPrimary sets the Primary field's value. -func (s *IpAddressMember) SetPrimary(v bool) *IpAddressMember { - s.Primary = &v - return s -} - -type ListApplicationsInput struct { - _ struct{} `type:"structure"` - - // The filter of name, value, and operator. - Filters []*Filter `min:"1" type:"list"` - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *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 ListApplicationsInput) 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 ListApplicationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListApplicationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListApplicationsInput"} - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListApplicationsInput) SetFilters(v []*Filter) *ListApplicationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListApplicationsInput) SetMaxResults(v int64) *ListApplicationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsInput) SetNextToken(v string) *ListApplicationsInput { - s.NextToken = &v - return s -} - -type ListApplicationsOutput struct { - _ struct{} `type:"structure"` - - // The applications registered with AWS Systems Manager for SAP. - Applications []*ApplicationSummary `type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *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 ListApplicationsOutput) 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 ListApplicationsOutput) GoString() string { - return s.String() -} - -// SetApplications sets the Applications field's value. -func (s *ListApplicationsOutput) SetApplications(v []*ApplicationSummary) *ListApplicationsOutput { - s.Applications = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsOutput) SetNextToken(v string) *ListApplicationsOutput { - s.NextToken = &v - return s -} - -type ListComponentsInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - ApplicationId *string `type:"string"` - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - // - // If you do not specify a value for MaxResults, the request returns 50 items - // per page by default. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *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 ListComponentsInput) 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 ListComponentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListComponentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListComponentsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListComponentsInput) SetApplicationId(v string) *ListComponentsInput { - s.ApplicationId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListComponentsInput) SetMaxResults(v int64) *ListComponentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListComponentsInput) SetNextToken(v string) *ListComponentsInput { - s.NextToken = &v - return s -} - -type ListComponentsOutput struct { - _ struct{} `type:"structure"` - - // List of components registered with AWS System Manager for SAP. - Components []*ComponentSummary `type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *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 ListComponentsOutput) 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 ListComponentsOutput) GoString() string { - return s.String() -} - -// SetComponents sets the Components field's value. -func (s *ListComponentsOutput) SetComponents(v []*ComponentSummary) *ListComponentsOutput { - s.Components = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListComponentsOutput) SetNextToken(v string) *ListComponentsOutput { - s.NextToken = &v - return s -} - -type ListDatabasesInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - ApplicationId *string `type:"string"` - - // The ID of the component. - ComponentId *string `type:"string"` - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. If - // you do not specify a value for MaxResults, the request returns 50 items per - // page by default. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *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 ListDatabasesInput) 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 ListDatabasesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDatabasesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDatabasesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListDatabasesInput) SetApplicationId(v string) *ListDatabasesInput { - s.ApplicationId = &v - return s -} - -// SetComponentId sets the ComponentId field's value. -func (s *ListDatabasesInput) SetComponentId(v string) *ListDatabasesInput { - s.ComponentId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDatabasesInput) SetMaxResults(v int64) *ListDatabasesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDatabasesInput) SetNextToken(v string) *ListDatabasesInput { - s.NextToken = &v - return s -} - -type ListDatabasesOutput struct { - _ struct{} `type:"structure"` - - // The SAP HANA databases of an application. - Databases []*DatabaseSummary `type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *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 ListDatabasesOutput) 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 ListDatabasesOutput) GoString() string { - return s.String() -} - -// SetDatabases sets the Databases field's value. -func (s *ListDatabasesOutput) SetDatabases(v []*DatabaseSummary) *ListDatabasesOutput { - s.Databases = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDatabasesOutput) SetNextToken(v string) *ListDatabasesOutput { - s.NextToken = &v - return s -} - -type ListOperationsInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // The filters of an operation. - Filters []*Filter `min:"1" type:"list"` - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. If - // you do not specify a value for MaxResults, the request returns 50 items per - // page by default. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *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 ListOperationsInput) 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 ListOperationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListOperationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOperationsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *ListOperationsInput) SetApplicationId(v string) *ListOperationsInput { - s.ApplicationId = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *ListOperationsInput) SetFilters(v []*Filter) *ListOperationsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListOperationsInput) SetMaxResults(v int64) *ListOperationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOperationsInput) SetNextToken(v string) *ListOperationsInput { - s.NextToken = &v - return s -} - -type ListOperationsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `type:"string"` - - // List of operations performed by AWS Systems Manager for SAP. - Operations []*Operation `type:"list"` -} - -// 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 ListOperationsOutput) 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 ListOperationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOperationsOutput) SetNextToken(v string) *ListOperationsOutput { - s.NextToken = &v - return s -} - -// SetOperations sets the Operations field's value. -func (s *ListOperationsOutput) SetOperations(v []*Operation) *ListOperationsOutput { - s.Operations = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// The operations performed by AWS Systems Manager for SAP. -type Operation struct { - _ struct{} `type:"structure"` - - // The end time of the operation. - EndTime *time.Time `type:"timestamp"` - - // The ID of the operation. - Id *string `type:"string"` - - // The time at which the operation was last updated. - LastUpdatedTime *time.Time `type:"timestamp"` - - // The properties of the operation. - Properties map[string]*string `type:"map"` - - // The Amazon Resource Name (ARN) of the operation. - ResourceArn *string `type:"string"` - - // The resource ID of the operation. - ResourceId *string `min:"1" type:"string"` - - // The resource type of the operation. - ResourceType *string `min:"1" type:"string"` - - // The start time of the operation. - StartTime *time.Time `type:"timestamp"` - - // The status of the operation. - Status *string `type:"string" enum:"OperationStatus"` - - // The status message of the operation. - StatusMessage *string `type:"string"` - - // The type of the operation. - Type *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 Operation) 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 Operation) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *Operation) SetEndTime(v time.Time) *Operation { - s.EndTime = &v - return s -} - -// SetId sets the Id field's value. -func (s *Operation) SetId(v string) *Operation { - s.Id = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *Operation) SetLastUpdatedTime(v time.Time) *Operation { - s.LastUpdatedTime = &v - return s -} - -// SetProperties sets the Properties field's value. -func (s *Operation) SetProperties(v map[string]*string) *Operation { - s.Properties = v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *Operation) SetResourceArn(v string) *Operation { - s.ResourceArn = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *Operation) SetResourceId(v string) *Operation { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Operation) SetResourceType(v string) *Operation { - s.ResourceType = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *Operation) SetStartTime(v time.Time) *Operation { - s.StartTime = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Operation) SetStatus(v string) *Operation { - s.Status = &v - return s -} - -// SetStatusMessage sets the StatusMessage field's value. -func (s *Operation) SetStatusMessage(v string) *Operation { - s.StatusMessage = &v - return s -} - -// SetType sets the Type field's value. -func (s *Operation) SetType(v string) *Operation { - s.Type = &v - return s -} - -type PutResourcePermissionInput struct { - _ struct{} `type:"structure"` - - // ActionType is a required field - ActionType *string `type:"string" required:"true" enum:"PermissionActionType"` - - // ResourceArn is a required field - ResourceArn *string `type:"string" required:"true"` - - // SourceResourceArn is a required field - SourceResourceArn *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 PutResourcePermissionInput) 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 PutResourcePermissionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutResourcePermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutResourcePermissionInput"} - if s.ActionType == nil { - invalidParams.Add(request.NewErrParamRequired("ActionType")) - } - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.SourceResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("SourceResourceArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionType sets the ActionType field's value. -func (s *PutResourcePermissionInput) SetActionType(v string) *PutResourcePermissionInput { - s.ActionType = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *PutResourcePermissionInput) SetResourceArn(v string) *PutResourcePermissionInput { - s.ResourceArn = &v - return s -} - -// SetSourceResourceArn sets the SourceResourceArn field's value. -func (s *PutResourcePermissionInput) SetSourceResourceArn(v string) *PutResourcePermissionInput { - s.SourceResourceArn = &v - return s -} - -type PutResourcePermissionOutput struct { - _ struct{} `type:"structure"` - - Policy *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 PutResourcePermissionOutput) 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 PutResourcePermissionOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *PutResourcePermissionOutput) SetPolicy(v string) *PutResourcePermissionOutput { - s.Policy = &v - return s -} - -type RegisterApplicationInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // The type of the application. - // - // ApplicationType is a required field - ApplicationType *string `type:"string" required:"true" enum:"ApplicationType"` - - // The credentials of the SAP application. - Credentials []*ApplicationCredential `type:"list"` - - // The Amazon Resource Name of the SAP HANA database. - DatabaseArn *string `type:"string"` - - // The Amazon EC2 instances on which your SAP application is running. - // - // Instances is a required field - Instances []*string `min:"1" type:"list" required:"true"` - - // The SAP instance number of the application. - SapInstanceNumber *string `type:"string"` - - // The System ID of the application. - Sid *string `type:"string"` - - // The tags to be attached to the SAP application. - Tags map[string]*string `type:"map"` -} - -// 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 RegisterApplicationInput) 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 RegisterApplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterApplicationInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationType == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationType")) - } - if s.Instances == nil { - invalidParams.Add(request.NewErrParamRequired("Instances")) - } - if s.Instances != nil && len(s.Instances) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Instances", 1)) - } - if s.Credentials != nil { - for i, v := range s.Credentials { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Credentials", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *RegisterApplicationInput) SetApplicationId(v string) *RegisterApplicationInput { - s.ApplicationId = &v - return s -} - -// SetApplicationType sets the ApplicationType field's value. -func (s *RegisterApplicationInput) SetApplicationType(v string) *RegisterApplicationInput { - s.ApplicationType = &v - return s -} - -// SetCredentials sets the Credentials field's value. -func (s *RegisterApplicationInput) SetCredentials(v []*ApplicationCredential) *RegisterApplicationInput { - s.Credentials = v - return s -} - -// SetDatabaseArn sets the DatabaseArn field's value. -func (s *RegisterApplicationInput) SetDatabaseArn(v string) *RegisterApplicationInput { - s.DatabaseArn = &v - return s -} - -// SetInstances sets the Instances field's value. -func (s *RegisterApplicationInput) SetInstances(v []*string) *RegisterApplicationInput { - s.Instances = v - return s -} - -// SetSapInstanceNumber sets the SapInstanceNumber field's value. -func (s *RegisterApplicationInput) SetSapInstanceNumber(v string) *RegisterApplicationInput { - s.SapInstanceNumber = &v - return s -} - -// SetSid sets the Sid field's value. -func (s *RegisterApplicationInput) SetSid(v string) *RegisterApplicationInput { - s.Sid = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *RegisterApplicationInput) SetTags(v map[string]*string) *RegisterApplicationInput { - s.Tags = v - return s -} - -type RegisterApplicationOutput struct { - _ struct{} `type:"structure"` - - // The application registered with AWS Systems Manager for SAP. - Application *Application `type:"structure"` - - // The ID of the operation. - OperationId *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 RegisterApplicationOutput) 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 RegisterApplicationOutput) GoString() string { - return s.String() -} - -// SetApplication sets the Application field's value. -func (s *RegisterApplicationOutput) SetApplication(v *Application) *RegisterApplicationOutput { - s.Application = v - return s -} - -// SetOperationId sets the OperationId field's value. -func (s *RegisterApplicationOutput) SetOperationId(v string) *RegisterApplicationOutput { - s.OperationId = &v - return s -} - -// Details of the SAP HANA system replication for the instance. -type Resilience struct { - _ struct{} `type:"structure"` - - // The cluster status of the component. - ClusterStatus *string `type:"string" enum:"ClusterStatus"` - - // Indicates if or not enqueue replication is enabled for the ASCS component. - EnqueueReplication *bool `type:"boolean"` - - // The operation mode of the component. - HsrOperationMode *string `type:"string" enum:"OperationMode"` - - // The replication mode of the component. - HsrReplicationMode *string `type:"string" enum:"ReplicationMode"` - - // The tier of the component. - HsrTier *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 Resilience) 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 Resilience) GoString() string { - return s.String() -} - -// SetClusterStatus sets the ClusterStatus field's value. -func (s *Resilience) SetClusterStatus(v string) *Resilience { - s.ClusterStatus = &v - return s -} - -// SetEnqueueReplication sets the EnqueueReplication field's value. -func (s *Resilience) SetEnqueueReplication(v bool) *Resilience { - s.EnqueueReplication = &v - return s -} - -// SetHsrOperationMode sets the HsrOperationMode field's value. -func (s *Resilience) SetHsrOperationMode(v string) *Resilience { - s.HsrOperationMode = &v - return s -} - -// SetHsrReplicationMode sets the HsrReplicationMode field's value. -func (s *Resilience) SetHsrReplicationMode(v string) *Resilience { - s.HsrReplicationMode = &v - return s -} - -// SetHsrTier sets the HsrTier field's value. -func (s *Resilience) SetHsrTier(v string) *Resilience { - s.HsrTier = &v - return s -} - -// The resource is not available. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type StartApplicationRefreshInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - // - // ApplicationId is a required field - ApplicationId *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 StartApplicationRefreshInput) 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 StartApplicationRefreshInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartApplicationRefreshInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartApplicationRefreshInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *StartApplicationRefreshInput) SetApplicationId(v string) *StartApplicationRefreshInput { - s.ApplicationId = &v - return s -} - -type StartApplicationRefreshOutput struct { - _ struct{} `type:"structure"` - - // The ID of the operation. - OperationId *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 StartApplicationRefreshOutput) 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 StartApplicationRefreshOutput) GoString() string { - return s.String() -} - -// SetOperationId sets the OperationId field's value. -func (s *StartApplicationRefreshOutput) SetOperationId(v string) *StartApplicationRefreshOutput { - s.OperationId = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tags on a resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request is not authorized. -type UnauthorizedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 UnauthorizedException) 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 UnauthorizedException) GoString() string { - return s.String() -} - -func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { - return &UnauthorizedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnauthorizedException) Code() string { - return "UnauthorizedException" -} - -// Message returns the exception's message. -func (s *UnauthorizedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnauthorizedException) OrigErr() error { - return nil -} - -func (s *UnauthorizedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnauthorizedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnauthorizedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // Adds/updates or removes credentials for applications registered with AWS - // Systems Manager for SAP. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateApplicationSettingsInput struct { - _ struct{} `type:"structure"` - - // The ID of the application. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // Installation of AWS Backint Agent for SAP HANA. - Backint *BackintConfig `type:"structure"` - - // The credentials to be added or updated. - CredentialsToAddOrUpdate []*ApplicationCredential `type:"list"` - - // The credentials to be removed. - CredentialsToRemove []*ApplicationCredential `type:"list"` - - // The Amazon Resource Name of the SAP HANA database that replaces the current - // SAP HANA connection with the SAP_ABAP application. - DatabaseArn *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 UpdateApplicationSettingsInput) 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 UpdateApplicationSettingsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApplicationSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationSettingsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.Backint != nil { - if err := s.Backint.Validate(); err != nil { - invalidParams.AddNested("Backint", err.(request.ErrInvalidParams)) - } - } - if s.CredentialsToAddOrUpdate != nil { - for i, v := range s.CredentialsToAddOrUpdate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CredentialsToAddOrUpdate", i), err.(request.ErrInvalidParams)) - } - } - } - if s.CredentialsToRemove != nil { - for i, v := range s.CredentialsToRemove { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CredentialsToRemove", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateApplicationSettingsInput) SetApplicationId(v string) *UpdateApplicationSettingsInput { - s.ApplicationId = &v - return s -} - -// SetBackint sets the Backint field's value. -func (s *UpdateApplicationSettingsInput) SetBackint(v *BackintConfig) *UpdateApplicationSettingsInput { - s.Backint = v - return s -} - -// SetCredentialsToAddOrUpdate sets the CredentialsToAddOrUpdate field's value. -func (s *UpdateApplicationSettingsInput) SetCredentialsToAddOrUpdate(v []*ApplicationCredential) *UpdateApplicationSettingsInput { - s.CredentialsToAddOrUpdate = v - return s -} - -// SetCredentialsToRemove sets the CredentialsToRemove field's value. -func (s *UpdateApplicationSettingsInput) SetCredentialsToRemove(v []*ApplicationCredential) *UpdateApplicationSettingsInput { - s.CredentialsToRemove = v - return s -} - -// SetDatabaseArn sets the DatabaseArn field's value. -func (s *UpdateApplicationSettingsInput) SetDatabaseArn(v string) *UpdateApplicationSettingsInput { - s.DatabaseArn = &v - return s -} - -type UpdateApplicationSettingsOutput struct { - _ struct{} `type:"structure"` - - // The update message. - Message *string `type:"string"` - - // The IDs of the operations. - OperationIds []*string `type:"list"` -} - -// 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 UpdateApplicationSettingsOutput) 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 UpdateApplicationSettingsOutput) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *UpdateApplicationSettingsOutput) SetMessage(v string) *UpdateApplicationSettingsOutput { - s.Message = &v - return s -} - -// SetOperationIds sets the OperationIds field's value. -func (s *UpdateApplicationSettingsOutput) SetOperationIds(v []*string) *UpdateApplicationSettingsOutput { - s.OperationIds = v - return s -} - -// The input fails to satisfy the constraints specified by an AWS service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // AllocationTypeVpcSubnet is a AllocationType enum value - AllocationTypeVpcSubnet = "VPC_SUBNET" - - // AllocationTypeElasticIp is a AllocationType enum value - AllocationTypeElasticIp = "ELASTIC_IP" - - // AllocationTypeOverlay is a AllocationType enum value - AllocationTypeOverlay = "OVERLAY" - - // AllocationTypeUnknown is a AllocationType enum value - AllocationTypeUnknown = "UNKNOWN" -) - -// AllocationType_Values returns all elements of the AllocationType enum -func AllocationType_Values() []string { - return []string{ - AllocationTypeVpcSubnet, - AllocationTypeElasticIp, - AllocationTypeOverlay, - AllocationTypeUnknown, - } -} - -const ( - // ApplicationDiscoveryStatusSuccess is a ApplicationDiscoveryStatus enum value - ApplicationDiscoveryStatusSuccess = "SUCCESS" - - // ApplicationDiscoveryStatusRegistrationFailed is a ApplicationDiscoveryStatus enum value - ApplicationDiscoveryStatusRegistrationFailed = "REGISTRATION_FAILED" - - // ApplicationDiscoveryStatusRefreshFailed is a ApplicationDiscoveryStatus enum value - ApplicationDiscoveryStatusRefreshFailed = "REFRESH_FAILED" - - // ApplicationDiscoveryStatusRegistering is a ApplicationDiscoveryStatus enum value - ApplicationDiscoveryStatusRegistering = "REGISTERING" - - // ApplicationDiscoveryStatusDeleting is a ApplicationDiscoveryStatus enum value - ApplicationDiscoveryStatusDeleting = "DELETING" -) - -// ApplicationDiscoveryStatus_Values returns all elements of the ApplicationDiscoveryStatus enum -func ApplicationDiscoveryStatus_Values() []string { - return []string{ - ApplicationDiscoveryStatusSuccess, - ApplicationDiscoveryStatusRegistrationFailed, - ApplicationDiscoveryStatusRefreshFailed, - ApplicationDiscoveryStatusRegistering, - ApplicationDiscoveryStatusDeleting, - } -} - -const ( - // ApplicationStatusActivated is a ApplicationStatus enum value - ApplicationStatusActivated = "ACTIVATED" - - // ApplicationStatusStarting is a ApplicationStatus enum value - ApplicationStatusStarting = "STARTING" - - // ApplicationStatusStopped is a ApplicationStatus enum value - ApplicationStatusStopped = "STOPPED" - - // ApplicationStatusStopping is a ApplicationStatus enum value - ApplicationStatusStopping = "STOPPING" - - // ApplicationStatusFailed is a ApplicationStatus enum value - ApplicationStatusFailed = "FAILED" - - // ApplicationStatusRegistering is a ApplicationStatus enum value - ApplicationStatusRegistering = "REGISTERING" - - // ApplicationStatusDeleting is a ApplicationStatus enum value - ApplicationStatusDeleting = "DELETING" - - // ApplicationStatusUnknown is a ApplicationStatus enum value - ApplicationStatusUnknown = "UNKNOWN" -) - -// ApplicationStatus_Values returns all elements of the ApplicationStatus enum -func ApplicationStatus_Values() []string { - return []string{ - ApplicationStatusActivated, - ApplicationStatusStarting, - ApplicationStatusStopped, - ApplicationStatusStopping, - ApplicationStatusFailed, - ApplicationStatusRegistering, - ApplicationStatusDeleting, - ApplicationStatusUnknown, - } -} - -const ( - // ApplicationTypeHana is a ApplicationType enum value - ApplicationTypeHana = "HANA" - - // ApplicationTypeSapAbap is a ApplicationType enum value - ApplicationTypeSapAbap = "SAP_ABAP" -) - -// ApplicationType_Values returns all elements of the ApplicationType enum -func ApplicationType_Values() []string { - return []string{ - ApplicationTypeHana, - ApplicationTypeSapAbap, - } -} - -const ( - // BackintModeAwsbackup is a BackintMode enum value - BackintModeAwsbackup = "AWSBackup" -) - -// BackintMode_Values returns all elements of the BackintMode enum -func BackintMode_Values() []string { - return []string{ - BackintModeAwsbackup, - } -} - -const ( - // ClusterStatusOnline is a ClusterStatus enum value - ClusterStatusOnline = "ONLINE" - - // ClusterStatusStandby is a ClusterStatus enum value - ClusterStatusStandby = "STANDBY" - - // ClusterStatusMaintenance is a ClusterStatus enum value - ClusterStatusMaintenance = "MAINTENANCE" - - // ClusterStatusOffline is a ClusterStatus enum value - ClusterStatusOffline = "OFFLINE" - - // ClusterStatusNone is a ClusterStatus enum value - ClusterStatusNone = "NONE" -) - -// ClusterStatus_Values returns all elements of the ClusterStatus enum -func ClusterStatus_Values() []string { - return []string{ - ClusterStatusOnline, - ClusterStatusStandby, - ClusterStatusMaintenance, - ClusterStatusOffline, - ClusterStatusNone, - } -} - -const ( - // ComponentStatusActivated is a ComponentStatus enum value - ComponentStatusActivated = "ACTIVATED" - - // ComponentStatusStarting is a ComponentStatus enum value - ComponentStatusStarting = "STARTING" - - // ComponentStatusStopped is a ComponentStatus enum value - ComponentStatusStopped = "STOPPED" - - // ComponentStatusStopping is a ComponentStatus enum value - ComponentStatusStopping = "STOPPING" - - // ComponentStatusRunning is a ComponentStatus enum value - ComponentStatusRunning = "RUNNING" - - // ComponentStatusRunningWithError is a ComponentStatus enum value - ComponentStatusRunningWithError = "RUNNING_WITH_ERROR" - - // ComponentStatusUndefined is a ComponentStatus enum value - ComponentStatusUndefined = "UNDEFINED" -) - -// ComponentStatus_Values returns all elements of the ComponentStatus enum -func ComponentStatus_Values() []string { - return []string{ - ComponentStatusActivated, - ComponentStatusStarting, - ComponentStatusStopped, - ComponentStatusStopping, - ComponentStatusRunning, - ComponentStatusRunningWithError, - ComponentStatusUndefined, - } -} - -const ( - // ComponentTypeHana is a ComponentType enum value - ComponentTypeHana = "HANA" - - // ComponentTypeHanaNode is a ComponentType enum value - ComponentTypeHanaNode = "HANA_NODE" - - // ComponentTypeAbap is a ComponentType enum value - ComponentTypeAbap = "ABAP" - - // ComponentTypeAscs is a ComponentType enum value - ComponentTypeAscs = "ASCS" - - // ComponentTypeDialog is a ComponentType enum value - ComponentTypeDialog = "DIALOG" - - // ComponentTypeWebdisp is a ComponentType enum value - ComponentTypeWebdisp = "WEBDISP" - - // ComponentTypeWd is a ComponentType enum value - ComponentTypeWd = "WD" - - // ComponentTypeErs is a ComponentType enum value - ComponentTypeErs = "ERS" -) - -// ComponentType_Values returns all elements of the ComponentType enum -func ComponentType_Values() []string { - return []string{ - ComponentTypeHana, - ComponentTypeHanaNode, - ComponentTypeAbap, - ComponentTypeAscs, - ComponentTypeDialog, - ComponentTypeWebdisp, - ComponentTypeWd, - ComponentTypeErs, - } -} - -const ( - // CredentialTypeAdmin is a CredentialType enum value - CredentialTypeAdmin = "ADMIN" -) - -// CredentialType_Values returns all elements of the CredentialType enum -func CredentialType_Values() []string { - return []string{ - CredentialTypeAdmin, - } -} - -const ( - // DatabaseConnectionMethodDirect is a DatabaseConnectionMethod enum value - DatabaseConnectionMethodDirect = "DIRECT" - - // DatabaseConnectionMethodOverlay is a DatabaseConnectionMethod enum value - DatabaseConnectionMethodOverlay = "OVERLAY" -) - -// DatabaseConnectionMethod_Values returns all elements of the DatabaseConnectionMethod enum -func DatabaseConnectionMethod_Values() []string { - return []string{ - DatabaseConnectionMethodDirect, - DatabaseConnectionMethodOverlay, - } -} - -const ( - // DatabaseStatusRunning is a DatabaseStatus enum value - DatabaseStatusRunning = "RUNNING" - - // DatabaseStatusStarting is a DatabaseStatus enum value - DatabaseStatusStarting = "STARTING" - - // DatabaseStatusStopped is a DatabaseStatus enum value - DatabaseStatusStopped = "STOPPED" - - // DatabaseStatusWarning is a DatabaseStatus enum value - DatabaseStatusWarning = "WARNING" - - // DatabaseStatusUnknown is a DatabaseStatus enum value - DatabaseStatusUnknown = "UNKNOWN" - - // DatabaseStatusError is a DatabaseStatus enum value - DatabaseStatusError = "ERROR" -) - -// DatabaseStatus_Values returns all elements of the DatabaseStatus enum -func DatabaseStatus_Values() []string { - return []string{ - DatabaseStatusRunning, - DatabaseStatusStarting, - DatabaseStatusStopped, - DatabaseStatusWarning, - DatabaseStatusUnknown, - DatabaseStatusError, - } -} - -const ( - // DatabaseTypeSystem is a DatabaseType enum value - DatabaseTypeSystem = "SYSTEM" - - // DatabaseTypeTenant is a DatabaseType enum value - DatabaseTypeTenant = "TENANT" -) - -// DatabaseType_Values returns all elements of the DatabaseType enum -func DatabaseType_Values() []string { - return []string{ - DatabaseTypeSystem, - DatabaseTypeTenant, - } -} - -const ( - // FilterOperatorEquals is a FilterOperator enum value - FilterOperatorEquals = "Equals" - - // FilterOperatorGreaterThanOrEquals is a FilterOperator enum value - FilterOperatorGreaterThanOrEquals = "GreaterThanOrEquals" - - // FilterOperatorLessThanOrEquals is a FilterOperator enum value - FilterOperatorLessThanOrEquals = "LessThanOrEquals" -) - -// FilterOperator_Values returns all elements of the FilterOperator enum -func FilterOperator_Values() []string { - return []string{ - FilterOperatorEquals, - FilterOperatorGreaterThanOrEquals, - FilterOperatorLessThanOrEquals, - } -} - -const ( - // HostRoleLeader is a HostRole enum value - HostRoleLeader = "LEADER" - - // HostRoleWorker is a HostRole enum value - HostRoleWorker = "WORKER" - - // HostRoleStandby is a HostRole enum value - HostRoleStandby = "STANDBY" - - // HostRoleUnknown is a HostRole enum value - HostRoleUnknown = "UNKNOWN" -) - -// HostRole_Values returns all elements of the HostRole enum -func HostRole_Values() []string { - return []string{ - HostRoleLeader, - HostRoleWorker, - HostRoleStandby, - HostRoleUnknown, - } -} - -const ( - // OperationModePrimary is a OperationMode enum value - OperationModePrimary = "PRIMARY" - - // OperationModeLogreplay is a OperationMode enum value - OperationModeLogreplay = "LOGREPLAY" - - // OperationModeDeltaDatashipping is a OperationMode enum value - OperationModeDeltaDatashipping = "DELTA_DATASHIPPING" - - // OperationModeLogreplayReadaccess is a OperationMode enum value - OperationModeLogreplayReadaccess = "LOGREPLAY_READACCESS" - - // OperationModeNone is a OperationMode enum value - OperationModeNone = "NONE" -) - -// OperationMode_Values returns all elements of the OperationMode enum -func OperationMode_Values() []string { - return []string{ - OperationModePrimary, - OperationModeLogreplay, - OperationModeDeltaDatashipping, - OperationModeLogreplayReadaccess, - OperationModeNone, - } -} - -const ( - // OperationStatusInprogress is a OperationStatus enum value - OperationStatusInprogress = "INPROGRESS" - - // OperationStatusSuccess is a OperationStatus enum value - OperationStatusSuccess = "SUCCESS" - - // OperationStatusError is a OperationStatus enum value - OperationStatusError = "ERROR" -) - -// OperationStatus_Values returns all elements of the OperationStatus enum -func OperationStatus_Values() []string { - return []string{ - OperationStatusInprogress, - OperationStatusSuccess, - OperationStatusError, - } -} - -const ( - // PermissionActionTypeRestore is a PermissionActionType enum value - PermissionActionTypeRestore = "RESTORE" -) - -// PermissionActionType_Values returns all elements of the PermissionActionType enum -func PermissionActionType_Values() []string { - return []string{ - PermissionActionTypeRestore, - } -} - -const ( - // ReplicationModePrimary is a ReplicationMode enum value - ReplicationModePrimary = "PRIMARY" - - // ReplicationModeNone is a ReplicationMode enum value - ReplicationModeNone = "NONE" - - // ReplicationModeSync is a ReplicationMode enum value - ReplicationModeSync = "SYNC" - - // ReplicationModeSyncmem is a ReplicationMode enum value - ReplicationModeSyncmem = "SYNCMEM" - - // ReplicationModeAsync is a ReplicationMode enum value - ReplicationModeAsync = "ASYNC" -) - -// ReplicationMode_Values returns all elements of the ReplicationMode enum -func ReplicationMode_Values() []string { - return []string{ - ReplicationModePrimary, - ReplicationModeNone, - ReplicationModeSync, - ReplicationModeSyncmem, - ReplicationModeAsync, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/doc.go deleted file mode 100644 index 22c32adf1cb1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/doc.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ssmsap provides the client and types for making API -// requests to AWS Systems Manager for SAP. -// -// This API reference provides descriptions, syntax, and other details about -// each of the actions and data types for AWS Systems Manager for SAP. The topic -// for each action shows the API request parameters and responses. -// -// See https://docs.aws.amazon.com/goto/WebAPI/ssm-sap-2018-05-10 for more information on this service. -// -// See ssmsap package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/ssmsap/ -// -// # Using the Client -// -// To contact AWS Systems Manager for SAP with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Systems Manager for SAP client SsmSap for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/ssmsap/#New -package ssmsap diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/errors.go deleted file mode 100644 index 5bb0d72c7705..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/errors.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ssmsap - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // A conflict has occurred. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An internal error has occurred. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource is not available. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeUnauthorizedException for service response error code - // "UnauthorizedException". - // - // The request is not authorized. - ErrCodeUnauthorizedException = "UnauthorizedException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the constraints specified by an AWS service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "UnauthorizedException": newErrorUnauthorizedException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/service.go deleted file mode 100644 index c7450af631d6..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ssmsap - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// SsmSap provides the API operation methods for making requests to -// AWS Systems Manager for SAP. See this package's package overview docs -// for details on the service. -// -// SsmSap methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type SsmSap struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Ssm Sap" // Name of service. - EndpointsID = "ssm-sap" // ID to lookup a service endpoint with. - ServiceID = "Ssm Sap" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the SsmSap client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a SsmSap client from just a session. -// svc := ssmsap.New(mySession) -// -// // Create a SsmSap client with additional configuration -// svc := ssmsap.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SsmSap { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "ssm-sap" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *SsmSap { - svc := &SsmSap{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2018-05-10", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SsmSap operation and runs any -// custom request initialization. -func (c *SsmSap) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/ssmsapiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/ssmsapiface/interface.go deleted file mode 100644 index 0440e520d86b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap/ssmsapiface/interface.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ssmsapiface provides an interface to enable mocking the AWS Systems Manager for SAP service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package ssmsapiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/ssmsap" -) - -// SsmSapAPI provides an interface to enable mocking the -// ssmsap.SsmSap service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Systems Manager for SAP. -// func myFunc(svc ssmsapiface.SsmSapAPI) bool { -// // Make svc.DeleteResourcePermission request -// } -// -// func main() { -// sess := session.New() -// svc := ssmsap.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSsmSapClient struct { -// ssmsapiface.SsmSapAPI -// } -// func (m *mockSsmSapClient) DeleteResourcePermission(input *ssmsap.DeleteResourcePermissionInput) (*ssmsap.DeleteResourcePermissionOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSsmSapClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type SsmSapAPI interface { - DeleteResourcePermission(*ssmsap.DeleteResourcePermissionInput) (*ssmsap.DeleteResourcePermissionOutput, error) - DeleteResourcePermissionWithContext(aws.Context, *ssmsap.DeleteResourcePermissionInput, ...request.Option) (*ssmsap.DeleteResourcePermissionOutput, error) - DeleteResourcePermissionRequest(*ssmsap.DeleteResourcePermissionInput) (*request.Request, *ssmsap.DeleteResourcePermissionOutput) - - DeregisterApplication(*ssmsap.DeregisterApplicationInput) (*ssmsap.DeregisterApplicationOutput, error) - DeregisterApplicationWithContext(aws.Context, *ssmsap.DeregisterApplicationInput, ...request.Option) (*ssmsap.DeregisterApplicationOutput, error) - DeregisterApplicationRequest(*ssmsap.DeregisterApplicationInput) (*request.Request, *ssmsap.DeregisterApplicationOutput) - - GetApplication(*ssmsap.GetApplicationInput) (*ssmsap.GetApplicationOutput, error) - GetApplicationWithContext(aws.Context, *ssmsap.GetApplicationInput, ...request.Option) (*ssmsap.GetApplicationOutput, error) - GetApplicationRequest(*ssmsap.GetApplicationInput) (*request.Request, *ssmsap.GetApplicationOutput) - - GetComponent(*ssmsap.GetComponentInput) (*ssmsap.GetComponentOutput, error) - GetComponentWithContext(aws.Context, *ssmsap.GetComponentInput, ...request.Option) (*ssmsap.GetComponentOutput, error) - GetComponentRequest(*ssmsap.GetComponentInput) (*request.Request, *ssmsap.GetComponentOutput) - - GetDatabase(*ssmsap.GetDatabaseInput) (*ssmsap.GetDatabaseOutput, error) - GetDatabaseWithContext(aws.Context, *ssmsap.GetDatabaseInput, ...request.Option) (*ssmsap.GetDatabaseOutput, error) - GetDatabaseRequest(*ssmsap.GetDatabaseInput) (*request.Request, *ssmsap.GetDatabaseOutput) - - GetOperation(*ssmsap.GetOperationInput) (*ssmsap.GetOperationOutput, error) - GetOperationWithContext(aws.Context, *ssmsap.GetOperationInput, ...request.Option) (*ssmsap.GetOperationOutput, error) - GetOperationRequest(*ssmsap.GetOperationInput) (*request.Request, *ssmsap.GetOperationOutput) - - GetResourcePermission(*ssmsap.GetResourcePermissionInput) (*ssmsap.GetResourcePermissionOutput, error) - GetResourcePermissionWithContext(aws.Context, *ssmsap.GetResourcePermissionInput, ...request.Option) (*ssmsap.GetResourcePermissionOutput, error) - GetResourcePermissionRequest(*ssmsap.GetResourcePermissionInput) (*request.Request, *ssmsap.GetResourcePermissionOutput) - - ListApplications(*ssmsap.ListApplicationsInput) (*ssmsap.ListApplicationsOutput, error) - ListApplicationsWithContext(aws.Context, *ssmsap.ListApplicationsInput, ...request.Option) (*ssmsap.ListApplicationsOutput, error) - ListApplicationsRequest(*ssmsap.ListApplicationsInput) (*request.Request, *ssmsap.ListApplicationsOutput) - - ListApplicationsPages(*ssmsap.ListApplicationsInput, func(*ssmsap.ListApplicationsOutput, bool) bool) error - ListApplicationsPagesWithContext(aws.Context, *ssmsap.ListApplicationsInput, func(*ssmsap.ListApplicationsOutput, bool) bool, ...request.Option) error - - ListComponents(*ssmsap.ListComponentsInput) (*ssmsap.ListComponentsOutput, error) - ListComponentsWithContext(aws.Context, *ssmsap.ListComponentsInput, ...request.Option) (*ssmsap.ListComponentsOutput, error) - ListComponentsRequest(*ssmsap.ListComponentsInput) (*request.Request, *ssmsap.ListComponentsOutput) - - ListComponentsPages(*ssmsap.ListComponentsInput, func(*ssmsap.ListComponentsOutput, bool) bool) error - ListComponentsPagesWithContext(aws.Context, *ssmsap.ListComponentsInput, func(*ssmsap.ListComponentsOutput, bool) bool, ...request.Option) error - - ListDatabases(*ssmsap.ListDatabasesInput) (*ssmsap.ListDatabasesOutput, error) - ListDatabasesWithContext(aws.Context, *ssmsap.ListDatabasesInput, ...request.Option) (*ssmsap.ListDatabasesOutput, error) - ListDatabasesRequest(*ssmsap.ListDatabasesInput) (*request.Request, *ssmsap.ListDatabasesOutput) - - ListDatabasesPages(*ssmsap.ListDatabasesInput, func(*ssmsap.ListDatabasesOutput, bool) bool) error - ListDatabasesPagesWithContext(aws.Context, *ssmsap.ListDatabasesInput, func(*ssmsap.ListDatabasesOutput, bool) bool, ...request.Option) error - - ListOperations(*ssmsap.ListOperationsInput) (*ssmsap.ListOperationsOutput, error) - ListOperationsWithContext(aws.Context, *ssmsap.ListOperationsInput, ...request.Option) (*ssmsap.ListOperationsOutput, error) - ListOperationsRequest(*ssmsap.ListOperationsInput) (*request.Request, *ssmsap.ListOperationsOutput) - - ListOperationsPages(*ssmsap.ListOperationsInput, func(*ssmsap.ListOperationsOutput, bool) bool) error - ListOperationsPagesWithContext(aws.Context, *ssmsap.ListOperationsInput, func(*ssmsap.ListOperationsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*ssmsap.ListTagsForResourceInput) (*ssmsap.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *ssmsap.ListTagsForResourceInput, ...request.Option) (*ssmsap.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*ssmsap.ListTagsForResourceInput) (*request.Request, *ssmsap.ListTagsForResourceOutput) - - PutResourcePermission(*ssmsap.PutResourcePermissionInput) (*ssmsap.PutResourcePermissionOutput, error) - PutResourcePermissionWithContext(aws.Context, *ssmsap.PutResourcePermissionInput, ...request.Option) (*ssmsap.PutResourcePermissionOutput, error) - PutResourcePermissionRequest(*ssmsap.PutResourcePermissionInput) (*request.Request, *ssmsap.PutResourcePermissionOutput) - - RegisterApplication(*ssmsap.RegisterApplicationInput) (*ssmsap.RegisterApplicationOutput, error) - RegisterApplicationWithContext(aws.Context, *ssmsap.RegisterApplicationInput, ...request.Option) (*ssmsap.RegisterApplicationOutput, error) - RegisterApplicationRequest(*ssmsap.RegisterApplicationInput) (*request.Request, *ssmsap.RegisterApplicationOutput) - - StartApplicationRefresh(*ssmsap.StartApplicationRefreshInput) (*ssmsap.StartApplicationRefreshOutput, error) - StartApplicationRefreshWithContext(aws.Context, *ssmsap.StartApplicationRefreshInput, ...request.Option) (*ssmsap.StartApplicationRefreshOutput, error) - StartApplicationRefreshRequest(*ssmsap.StartApplicationRefreshInput) (*request.Request, *ssmsap.StartApplicationRefreshOutput) - - TagResource(*ssmsap.TagResourceInput) (*ssmsap.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *ssmsap.TagResourceInput, ...request.Option) (*ssmsap.TagResourceOutput, error) - TagResourceRequest(*ssmsap.TagResourceInput) (*request.Request, *ssmsap.TagResourceOutput) - - UntagResource(*ssmsap.UntagResourceInput) (*ssmsap.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *ssmsap.UntagResourceInput, ...request.Option) (*ssmsap.UntagResourceOutput, error) - UntagResourceRequest(*ssmsap.UntagResourceInput) (*request.Request, *ssmsap.UntagResourceOutput) - - UpdateApplicationSettings(*ssmsap.UpdateApplicationSettingsInput) (*ssmsap.UpdateApplicationSettingsOutput, error) - UpdateApplicationSettingsWithContext(aws.Context, *ssmsap.UpdateApplicationSettingsInput, ...request.Option) (*ssmsap.UpdateApplicationSettingsOutput, error) - UpdateApplicationSettingsRequest(*ssmsap.UpdateApplicationSettingsInput) (*request.Request, *ssmsap.UpdateApplicationSettingsOutput) -} - -var _ SsmSapAPI = (*ssmsap.SsmSap)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/api.go deleted file mode 100644 index 97fc80aaad0d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/api.go +++ /dev/null @@ -1,2820 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package supportapp - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateSlackChannelConfiguration = "CreateSlackChannelConfiguration" - -// CreateSlackChannelConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the CreateSlackChannelConfiguration 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 CreateSlackChannelConfiguration for more information on using the CreateSlackChannelConfiguration -// 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 CreateSlackChannelConfigurationRequest method. -// req, resp := client.CreateSlackChannelConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/CreateSlackChannelConfiguration -func (c *SupportApp) CreateSlackChannelConfigurationRequest(input *CreateSlackChannelConfigurationInput) (req *request.Request, output *CreateSlackChannelConfigurationOutput) { - op := &request.Operation{ - Name: opCreateSlackChannelConfiguration, - HTTPMethod: "POST", - HTTPPath: "/control/create-slack-channel-configuration", - } - - if input == nil { - input = &CreateSlackChannelConfigurationInput{} - } - - output = &CreateSlackChannelConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CreateSlackChannelConfiguration API operation for AWS Support App. -// -// Creates a Slack channel configuration for your Amazon Web Services account. -// -// - You can add up to 5 Slack workspaces for your account. -// -// - You can add up to 20 Slack channels for your account. -// -// A Slack channel can have up to 100 Amazon Web Services accounts. This means -// that only 100 accounts can add the same Slack channel to the Amazon Web Services -// Support App. We recommend that you only add the accounts that you need to -// manage support cases for your organization. This can reduce the notifications -// about case updates that you receive in the Slack channel. -// -// We recommend that you choose a private Slack channel so that only members -// in that channel have read and write access to your support cases. Anyone -// in your Slack channel can create, update, or resolve support cases for your -// account. Users require an invitation to join private channels. -// -// 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 AWS Support App's -// API operation CreateSlackChannelConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// Your Service Quotas request exceeds the quota for the service. For example, -// your Service Quotas request to Amazon Web Services Support App might exceed -// the maximum number of workspaces or channels per account, or the maximum -// number of accounts per Slack channel. -// -// - ConflictException -// Your request has a conflict. For example, you might receive this error if -// you try the following: -// -// - Add, update, or delete a Slack channel configuration before you add -// a Slack workspace to your Amazon Web Services account. -// -// - Add a Slack channel configuration that already exists in your Amazon -// Web Services account. -// -// - Delete a Slack channel configuration for a live chat channel. -// -// - Delete a Slack workspace from your Amazon Web Services account that -// has an active live chat channel. -// -// - Call the RegisterSlackWorkspaceForOrganization API from an Amazon Web -// Services account that doesn't belong to an organization. -// -// - Call the RegisterSlackWorkspaceForOrganization API from a member account, -// but the management account hasn't registered that workspace yet for the -// organization. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// - ValidationException -// Your request input doesn't meet the constraints that the Amazon Web Services -// Support App specifies. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/CreateSlackChannelConfiguration -func (c *SupportApp) CreateSlackChannelConfiguration(input *CreateSlackChannelConfigurationInput) (*CreateSlackChannelConfigurationOutput, error) { - req, out := c.CreateSlackChannelConfigurationRequest(input) - return out, req.Send() -} - -// CreateSlackChannelConfigurationWithContext is the same as CreateSlackChannelConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSlackChannelConfiguration 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 *SupportApp) CreateSlackChannelConfigurationWithContext(ctx aws.Context, input *CreateSlackChannelConfigurationInput, opts ...request.Option) (*CreateSlackChannelConfigurationOutput, error) { - req, out := c.CreateSlackChannelConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAccountAlias = "DeleteAccountAlias" - -// DeleteAccountAliasRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAccountAlias 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 DeleteAccountAlias for more information on using the DeleteAccountAlias -// 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 DeleteAccountAliasRequest method. -// req, resp := client.DeleteAccountAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/DeleteAccountAlias -func (c *SupportApp) DeleteAccountAliasRequest(input *DeleteAccountAliasInput) (req *request.Request, output *DeleteAccountAliasOutput) { - op := &request.Operation{ - Name: opDeleteAccountAlias, - HTTPMethod: "POST", - HTTPPath: "/control/delete-account-alias", - } - - if input == nil { - input = &DeleteAccountAliasInput{} - } - - output = &DeleteAccountAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAccountAlias API operation for AWS Support App. -// -// Deletes an alias for an Amazon Web Services account ID. The alias appears -// in the Amazon Web Services Support App page of the Amazon Web Services Support -// Center. The alias also appears in Slack messages from the Amazon Web Services -// Support App. -// -// 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 AWS Support App's -// API operation DeleteAccountAlias for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// The specified resource is missing or doesn't exist, such as an account alias, -// Slack channel configuration, or Slack workspace configuration. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/DeleteAccountAlias -func (c *SupportApp) DeleteAccountAlias(input *DeleteAccountAliasInput) (*DeleteAccountAliasOutput, error) { - req, out := c.DeleteAccountAliasRequest(input) - return out, req.Send() -} - -// DeleteAccountAliasWithContext is the same as DeleteAccountAlias with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAccountAlias 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 *SupportApp) DeleteAccountAliasWithContext(ctx aws.Context, input *DeleteAccountAliasInput, opts ...request.Option) (*DeleteAccountAliasOutput, error) { - req, out := c.DeleteAccountAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSlackChannelConfiguration = "DeleteSlackChannelConfiguration" - -// DeleteSlackChannelConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSlackChannelConfiguration 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 DeleteSlackChannelConfiguration for more information on using the DeleteSlackChannelConfiguration -// 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 DeleteSlackChannelConfigurationRequest method. -// req, resp := client.DeleteSlackChannelConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/DeleteSlackChannelConfiguration -func (c *SupportApp) DeleteSlackChannelConfigurationRequest(input *DeleteSlackChannelConfigurationInput) (req *request.Request, output *DeleteSlackChannelConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteSlackChannelConfiguration, - HTTPMethod: "POST", - HTTPPath: "/control/delete-slack-channel-configuration", - } - - if input == nil { - input = &DeleteSlackChannelConfigurationInput{} - } - - output = &DeleteSlackChannelConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSlackChannelConfiguration API operation for AWS Support App. -// -// Deletes a Slack channel configuration from your Amazon Web Services account. -// This operation doesn't delete your Slack channel. -// -// 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 AWS Support App's -// API operation DeleteSlackChannelConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Your request has a conflict. For example, you might receive this error if -// you try the following: -// -// - Add, update, or delete a Slack channel configuration before you add -// a Slack workspace to your Amazon Web Services account. -// -// - Add a Slack channel configuration that already exists in your Amazon -// Web Services account. -// -// - Delete a Slack channel configuration for a live chat channel. -// -// - Delete a Slack workspace from your Amazon Web Services account that -// has an active live chat channel. -// -// - Call the RegisterSlackWorkspaceForOrganization API from an Amazon Web -// Services account that doesn't belong to an organization. -// -// - Call the RegisterSlackWorkspaceForOrganization API from a member account, -// but the management account hasn't registered that workspace yet for the -// organization. -// -// - ResourceNotFoundException -// The specified resource is missing or doesn't exist, such as an account alias, -// Slack channel configuration, or Slack workspace configuration. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// - ValidationException -// Your request input doesn't meet the constraints that the Amazon Web Services -// Support App specifies. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/DeleteSlackChannelConfiguration -func (c *SupportApp) DeleteSlackChannelConfiguration(input *DeleteSlackChannelConfigurationInput) (*DeleteSlackChannelConfigurationOutput, error) { - req, out := c.DeleteSlackChannelConfigurationRequest(input) - return out, req.Send() -} - -// DeleteSlackChannelConfigurationWithContext is the same as DeleteSlackChannelConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSlackChannelConfiguration 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 *SupportApp) DeleteSlackChannelConfigurationWithContext(ctx aws.Context, input *DeleteSlackChannelConfigurationInput, opts ...request.Option) (*DeleteSlackChannelConfigurationOutput, error) { - req, out := c.DeleteSlackChannelConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSlackWorkspaceConfiguration = "DeleteSlackWorkspaceConfiguration" - -// DeleteSlackWorkspaceConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSlackWorkspaceConfiguration 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 DeleteSlackWorkspaceConfiguration for more information on using the DeleteSlackWorkspaceConfiguration -// 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 DeleteSlackWorkspaceConfigurationRequest method. -// req, resp := client.DeleteSlackWorkspaceConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/DeleteSlackWorkspaceConfiguration -func (c *SupportApp) DeleteSlackWorkspaceConfigurationRequest(input *DeleteSlackWorkspaceConfigurationInput) (req *request.Request, output *DeleteSlackWorkspaceConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteSlackWorkspaceConfiguration, - HTTPMethod: "POST", - HTTPPath: "/control/delete-slack-workspace-configuration", - } - - if input == nil { - input = &DeleteSlackWorkspaceConfigurationInput{} - } - - output = &DeleteSlackWorkspaceConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSlackWorkspaceConfiguration API operation for AWS Support App. -// -// Deletes a Slack workspace configuration from your Amazon Web Services account. -// This operation doesn't delete your Slack workspace. -// -// 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 AWS Support App's -// API operation DeleteSlackWorkspaceConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Your request has a conflict. For example, you might receive this error if -// you try the following: -// -// - Add, update, or delete a Slack channel configuration before you add -// a Slack workspace to your Amazon Web Services account. -// -// - Add a Slack channel configuration that already exists in your Amazon -// Web Services account. -// -// - Delete a Slack channel configuration for a live chat channel. -// -// - Delete a Slack workspace from your Amazon Web Services account that -// has an active live chat channel. -// -// - Call the RegisterSlackWorkspaceForOrganization API from an Amazon Web -// Services account that doesn't belong to an organization. -// -// - Call the RegisterSlackWorkspaceForOrganization API from a member account, -// but the management account hasn't registered that workspace yet for the -// organization. -// -// - ResourceNotFoundException -// The specified resource is missing or doesn't exist, such as an account alias, -// Slack channel configuration, or Slack workspace configuration. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// - ValidationException -// Your request input doesn't meet the constraints that the Amazon Web Services -// Support App specifies. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/DeleteSlackWorkspaceConfiguration -func (c *SupportApp) DeleteSlackWorkspaceConfiguration(input *DeleteSlackWorkspaceConfigurationInput) (*DeleteSlackWorkspaceConfigurationOutput, error) { - req, out := c.DeleteSlackWorkspaceConfigurationRequest(input) - return out, req.Send() -} - -// DeleteSlackWorkspaceConfigurationWithContext is the same as DeleteSlackWorkspaceConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSlackWorkspaceConfiguration 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 *SupportApp) DeleteSlackWorkspaceConfigurationWithContext(ctx aws.Context, input *DeleteSlackWorkspaceConfigurationInput, opts ...request.Option) (*DeleteSlackWorkspaceConfigurationOutput, error) { - req, out := c.DeleteSlackWorkspaceConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAccountAlias = "GetAccountAlias" - -// GetAccountAliasRequest generates a "aws/request.Request" representing the -// client's request for the GetAccountAlias 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 GetAccountAlias for more information on using the GetAccountAlias -// 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 GetAccountAliasRequest method. -// req, resp := client.GetAccountAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/GetAccountAlias -func (c *SupportApp) GetAccountAliasRequest(input *GetAccountAliasInput) (req *request.Request, output *GetAccountAliasOutput) { - op := &request.Operation{ - Name: opGetAccountAlias, - HTTPMethod: "POST", - HTTPPath: "/control/get-account-alias", - } - - if input == nil { - input = &GetAccountAliasInput{} - } - - output = &GetAccountAliasOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccountAlias API operation for AWS Support App. -// -// Retrieves the alias from an Amazon Web Services account ID. The alias appears -// in the Amazon Web Services Support App page of the Amazon Web Services Support -// Center. The alias also appears in Slack messages from the Amazon Web Services -// Support App. -// -// 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 AWS Support App's -// API operation GetAccountAlias for usage and error information. -// -// Returned Error Types: -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/GetAccountAlias -func (c *SupportApp) GetAccountAlias(input *GetAccountAliasInput) (*GetAccountAliasOutput, error) { - req, out := c.GetAccountAliasRequest(input) - return out, req.Send() -} - -// GetAccountAliasWithContext is the same as GetAccountAlias with the addition of -// the ability to pass a context and additional request options. -// -// See GetAccountAlias 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 *SupportApp) GetAccountAliasWithContext(ctx aws.Context, input *GetAccountAliasInput, opts ...request.Option) (*GetAccountAliasOutput, error) { - req, out := c.GetAccountAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListSlackChannelConfigurations = "ListSlackChannelConfigurations" - -// ListSlackChannelConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListSlackChannelConfigurations 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 ListSlackChannelConfigurations for more information on using the ListSlackChannelConfigurations -// 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 ListSlackChannelConfigurationsRequest method. -// req, resp := client.ListSlackChannelConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/ListSlackChannelConfigurations -func (c *SupportApp) ListSlackChannelConfigurationsRequest(input *ListSlackChannelConfigurationsInput) (req *request.Request, output *ListSlackChannelConfigurationsOutput) { - op := &request.Operation{ - Name: opListSlackChannelConfigurations, - HTTPMethod: "POST", - HTTPPath: "/control/list-slack-channel-configurations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSlackChannelConfigurationsInput{} - } - - output = &ListSlackChannelConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSlackChannelConfigurations API operation for AWS Support App. -// -// Lists the Slack channel configurations for an Amazon Web Services account. -// -// 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 AWS Support App's -// API operation ListSlackChannelConfigurations for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/ListSlackChannelConfigurations -func (c *SupportApp) ListSlackChannelConfigurations(input *ListSlackChannelConfigurationsInput) (*ListSlackChannelConfigurationsOutput, error) { - req, out := c.ListSlackChannelConfigurationsRequest(input) - return out, req.Send() -} - -// ListSlackChannelConfigurationsWithContext is the same as ListSlackChannelConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListSlackChannelConfigurations 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 *SupportApp) ListSlackChannelConfigurationsWithContext(ctx aws.Context, input *ListSlackChannelConfigurationsInput, opts ...request.Option) (*ListSlackChannelConfigurationsOutput, error) { - req, out := c.ListSlackChannelConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSlackChannelConfigurationsPages iterates over the pages of a ListSlackChannelConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSlackChannelConfigurations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSlackChannelConfigurations operation. -// pageNum := 0 -// err := client.ListSlackChannelConfigurationsPages(params, -// func(page *supportapp.ListSlackChannelConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SupportApp) ListSlackChannelConfigurationsPages(input *ListSlackChannelConfigurationsInput, fn func(*ListSlackChannelConfigurationsOutput, bool) bool) error { - return c.ListSlackChannelConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSlackChannelConfigurationsPagesWithContext same as ListSlackChannelConfigurationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SupportApp) ListSlackChannelConfigurationsPagesWithContext(ctx aws.Context, input *ListSlackChannelConfigurationsInput, fn func(*ListSlackChannelConfigurationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSlackChannelConfigurationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSlackChannelConfigurationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSlackChannelConfigurationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSlackWorkspaceConfigurations = "ListSlackWorkspaceConfigurations" - -// ListSlackWorkspaceConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListSlackWorkspaceConfigurations 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 ListSlackWorkspaceConfigurations for more information on using the ListSlackWorkspaceConfigurations -// 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 ListSlackWorkspaceConfigurationsRequest method. -// req, resp := client.ListSlackWorkspaceConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/ListSlackWorkspaceConfigurations -func (c *SupportApp) ListSlackWorkspaceConfigurationsRequest(input *ListSlackWorkspaceConfigurationsInput) (req *request.Request, output *ListSlackWorkspaceConfigurationsOutput) { - op := &request.Operation{ - Name: opListSlackWorkspaceConfigurations, - HTTPMethod: "POST", - HTTPPath: "/control/list-slack-workspace-configurations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSlackWorkspaceConfigurationsInput{} - } - - output = &ListSlackWorkspaceConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSlackWorkspaceConfigurations API operation for AWS Support App. -// -// Lists the Slack workspace configurations for an Amazon Web Services account. -// -// 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 AWS Support App's -// API operation ListSlackWorkspaceConfigurations for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/ListSlackWorkspaceConfigurations -func (c *SupportApp) ListSlackWorkspaceConfigurations(input *ListSlackWorkspaceConfigurationsInput) (*ListSlackWorkspaceConfigurationsOutput, error) { - req, out := c.ListSlackWorkspaceConfigurationsRequest(input) - return out, req.Send() -} - -// ListSlackWorkspaceConfigurationsWithContext is the same as ListSlackWorkspaceConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListSlackWorkspaceConfigurations 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 *SupportApp) ListSlackWorkspaceConfigurationsWithContext(ctx aws.Context, input *ListSlackWorkspaceConfigurationsInput, opts ...request.Option) (*ListSlackWorkspaceConfigurationsOutput, error) { - req, out := c.ListSlackWorkspaceConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSlackWorkspaceConfigurationsPages iterates over the pages of a ListSlackWorkspaceConfigurations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSlackWorkspaceConfigurations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSlackWorkspaceConfigurations operation. -// pageNum := 0 -// err := client.ListSlackWorkspaceConfigurationsPages(params, -// func(page *supportapp.ListSlackWorkspaceConfigurationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *SupportApp) ListSlackWorkspaceConfigurationsPages(input *ListSlackWorkspaceConfigurationsInput, fn func(*ListSlackWorkspaceConfigurationsOutput, bool) bool) error { - return c.ListSlackWorkspaceConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSlackWorkspaceConfigurationsPagesWithContext same as ListSlackWorkspaceConfigurationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *SupportApp) ListSlackWorkspaceConfigurationsPagesWithContext(ctx aws.Context, input *ListSlackWorkspaceConfigurationsInput, fn func(*ListSlackWorkspaceConfigurationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSlackWorkspaceConfigurationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSlackWorkspaceConfigurationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSlackWorkspaceConfigurationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutAccountAlias = "PutAccountAlias" - -// PutAccountAliasRequest generates a "aws/request.Request" representing the -// client's request for the PutAccountAlias 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 PutAccountAlias for more information on using the PutAccountAlias -// 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 PutAccountAliasRequest method. -// req, resp := client.PutAccountAliasRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/PutAccountAlias -func (c *SupportApp) PutAccountAliasRequest(input *PutAccountAliasInput) (req *request.Request, output *PutAccountAliasOutput) { - op := &request.Operation{ - Name: opPutAccountAlias, - HTTPMethod: "POST", - HTTPPath: "/control/put-account-alias", - } - - if input == nil { - input = &PutAccountAliasInput{} - } - - output = &PutAccountAliasOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutAccountAlias API operation for AWS Support App. -// -// Creates or updates an individual alias for each Amazon Web Services account -// ID. The alias appears in the Amazon Web Services Support App page of the -// Amazon Web Services Support Center. The alias also appears in Slack messages -// from the Amazon Web Services Support App. -// -// 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 AWS Support App's -// API operation PutAccountAlias for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// - ValidationException -// Your request input doesn't meet the constraints that the Amazon Web Services -// Support App specifies. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/PutAccountAlias -func (c *SupportApp) PutAccountAlias(input *PutAccountAliasInput) (*PutAccountAliasOutput, error) { - req, out := c.PutAccountAliasRequest(input) - return out, req.Send() -} - -// PutAccountAliasWithContext is the same as PutAccountAlias with the addition of -// the ability to pass a context and additional request options. -// -// See PutAccountAlias 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 *SupportApp) PutAccountAliasWithContext(ctx aws.Context, input *PutAccountAliasInput, opts ...request.Option) (*PutAccountAliasOutput, error) { - req, out := c.PutAccountAliasRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterSlackWorkspaceForOrganization = "RegisterSlackWorkspaceForOrganization" - -// RegisterSlackWorkspaceForOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the RegisterSlackWorkspaceForOrganization 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 RegisterSlackWorkspaceForOrganization for more information on using the RegisterSlackWorkspaceForOrganization -// 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 RegisterSlackWorkspaceForOrganizationRequest method. -// req, resp := client.RegisterSlackWorkspaceForOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/RegisterSlackWorkspaceForOrganization -func (c *SupportApp) RegisterSlackWorkspaceForOrganizationRequest(input *RegisterSlackWorkspaceForOrganizationInput) (req *request.Request, output *RegisterSlackWorkspaceForOrganizationOutput) { - op := &request.Operation{ - Name: opRegisterSlackWorkspaceForOrganization, - HTTPMethod: "POST", - HTTPPath: "/control/register-slack-workspace-for-organization", - } - - if input == nil { - input = &RegisterSlackWorkspaceForOrganizationInput{} - } - - output = &RegisterSlackWorkspaceForOrganizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterSlackWorkspaceForOrganization API operation for AWS Support App. -// -// Registers a Slack workspace for your Amazon Web Services account. To call -// this API, your account must be part of an organization in Organizations. -// -// If you're the management account and you want to register Slack workspaces -// for your organization, you must complete the following tasks: -// -// Sign in to the Amazon Web Services Support Center (https://console.aws.amazon.com/support/app) -// and authorize the Slack workspaces where you want your organization to have -// access to. See Authorize a Slack workspace (https://docs.aws.amazon.com/awssupport/latest/user/authorize-slack-workspace.html) -// in the Amazon Web Services Support User Guide. -// -// Call the RegisterSlackWorkspaceForOrganization API to authorize each Slack -// workspace for the organization. -// -// After the management account authorizes the Slack workspace, member accounts -// can call this API to authorize the same Slack workspace for their individual -// accounts. Member accounts don't need to authorize the Slack workspace manually -// through the Amazon Web Services Support Center (https://console.aws.amazon.com/support/app). -// -// To use the Amazon Web Services Support App, each account must then complete -// the following tasks: -// -// - Create an Identity and Access Management (IAM) role with the required -// permission. For more information, see Managing access to the Amazon Web -// Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html). -// -// - Configure a Slack channel to use the Amazon Web Services Support App -// for support cases for that account. For more information, see Configuring -// a Slack channel (https://docs.aws.amazon.com/awssupport/latest/user/add-your-slack-channel.html). -// -// 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 AWS Support App's -// API operation RegisterSlackWorkspaceForOrganization for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Your request has a conflict. For example, you might receive this error if -// you try the following: -// -// - Add, update, or delete a Slack channel configuration before you add -// a Slack workspace to your Amazon Web Services account. -// -// - Add a Slack channel configuration that already exists in your Amazon -// Web Services account. -// -// - Delete a Slack channel configuration for a live chat channel. -// -// - Delete a Slack workspace from your Amazon Web Services account that -// has an active live chat channel. -// -// - Call the RegisterSlackWorkspaceForOrganization API from an Amazon Web -// Services account that doesn't belong to an organization. -// -// - Call the RegisterSlackWorkspaceForOrganization API from a member account, -// but the management account hasn't registered that workspace yet for the -// organization. -// -// - ResourceNotFoundException -// The specified resource is missing or doesn't exist, such as an account alias, -// Slack channel configuration, or Slack workspace configuration. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// - ValidationException -// Your request input doesn't meet the constraints that the Amazon Web Services -// Support App specifies. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/RegisterSlackWorkspaceForOrganization -func (c *SupportApp) RegisterSlackWorkspaceForOrganization(input *RegisterSlackWorkspaceForOrganizationInput) (*RegisterSlackWorkspaceForOrganizationOutput, error) { - req, out := c.RegisterSlackWorkspaceForOrganizationRequest(input) - return out, req.Send() -} - -// RegisterSlackWorkspaceForOrganizationWithContext is the same as RegisterSlackWorkspaceForOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterSlackWorkspaceForOrganization 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 *SupportApp) RegisterSlackWorkspaceForOrganizationWithContext(ctx aws.Context, input *RegisterSlackWorkspaceForOrganizationInput, opts ...request.Option) (*RegisterSlackWorkspaceForOrganizationOutput, error) { - req, out := c.RegisterSlackWorkspaceForOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSlackChannelConfiguration = "UpdateSlackChannelConfiguration" - -// UpdateSlackChannelConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSlackChannelConfiguration 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 UpdateSlackChannelConfiguration for more information on using the UpdateSlackChannelConfiguration -// 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 UpdateSlackChannelConfigurationRequest method. -// req, resp := client.UpdateSlackChannelConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/UpdateSlackChannelConfiguration -func (c *SupportApp) UpdateSlackChannelConfigurationRequest(input *UpdateSlackChannelConfigurationInput) (req *request.Request, output *UpdateSlackChannelConfigurationOutput) { - op := &request.Operation{ - Name: opUpdateSlackChannelConfiguration, - HTTPMethod: "POST", - HTTPPath: "/control/update-slack-channel-configuration", - } - - if input == nil { - input = &UpdateSlackChannelConfigurationInput{} - } - - output = &UpdateSlackChannelConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSlackChannelConfiguration API operation for AWS Support App. -// -// Updates the configuration for a Slack channel, such as case update notifications. -// -// 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 AWS Support App's -// API operation UpdateSlackChannelConfiguration for usage and error information. -// -// Returned Error Types: -// -// - ConflictException -// Your request has a conflict. For example, you might receive this error if -// you try the following: -// -// - Add, update, or delete a Slack channel configuration before you add -// a Slack workspace to your Amazon Web Services account. -// -// - Add a Slack channel configuration that already exists in your Amazon -// Web Services account. -// -// - Delete a Slack channel configuration for a live chat channel. -// -// - Delete a Slack workspace from your Amazon Web Services account that -// has an active live chat channel. -// -// - Call the RegisterSlackWorkspaceForOrganization API from an Amazon Web -// Services account that doesn't belong to an organization. -// -// - Call the RegisterSlackWorkspaceForOrganization API from a member account, -// but the management account hasn't registered that workspace yet for the -// organization. -// -// - ResourceNotFoundException -// The specified resource is missing or doesn't exist, such as an account alias, -// Slack channel configuration, or Slack workspace configuration. -// -// - AccessDeniedException -// You don't have sufficient permission to perform this action. -// -// - InternalServerException -// We can’t process your request right now because of a server issue. Try -// again later. -// -// - ValidationException -// Your request input doesn't meet the constraints that the Amazon Web Services -// Support App specifies. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20/UpdateSlackChannelConfiguration -func (c *SupportApp) UpdateSlackChannelConfiguration(input *UpdateSlackChannelConfigurationInput) (*UpdateSlackChannelConfigurationOutput, error) { - req, out := c.UpdateSlackChannelConfigurationRequest(input) - return out, req.Send() -} - -// UpdateSlackChannelConfigurationWithContext is the same as UpdateSlackChannelConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSlackChannelConfiguration 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 *SupportApp) UpdateSlackChannelConfigurationWithContext(ctx aws.Context, input *UpdateSlackChannelConfigurationInput, opts ...request.Option) (*UpdateSlackChannelConfigurationOutput, error) { - req, out := c.UpdateSlackChannelConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have sufficient permission to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Your request has a conflict. For example, you might receive this error if -// you try the following: -// -// - Add, update, or delete a Slack channel configuration before you add -// a Slack workspace to your Amazon Web Services account. -// -// - Add a Slack channel configuration that already exists in your Amazon -// Web Services account. -// -// - Delete a Slack channel configuration for a live chat channel. -// -// - Delete a Slack workspace from your Amazon Web Services account that -// has an active live chat channel. -// -// - Call the RegisterSlackWorkspaceForOrganization API from an Amazon Web -// Services account that doesn't belong to an organization. -// -// - Call the RegisterSlackWorkspaceForOrganization API from a member account, -// but the management account hasn't registered that workspace yet for the -// organization. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateSlackChannelConfigurationInput struct { - _ struct{} `type:"structure"` - - // The channel ID in Slack. This ID identifies a channel within a Slack workspace. - // - // ChannelId is a required field - ChannelId *string `locationName:"channelId" min:"1" type:"string" required:"true"` - - // The name of the Slack channel that you configure for the Amazon Web Services - // Support App. - ChannelName *string `locationName:"channelName" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of an IAM role that you want to use to perform - // operations on Amazon Web Services. For more information, see Managing access - // to the Amazon Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html) - // in the Amazon Web Services Support User Guide. - // - // ChannelRoleArn is a required field - ChannelRoleArn *string `locationName:"channelRoleArn" min:"31" type:"string" required:"true"` - - // Whether you want to get notified when a support case has a new correspondence. - NotifyOnAddCorrespondenceToCase *bool `locationName:"notifyOnAddCorrespondenceToCase" type:"boolean"` - - // The case severity for a support case that you want to receive notifications. - // - // If you specify high or all, you must specify true for at least one of the - // following parameters: - // - // * notifyOnAddCorrespondenceToCase - // - // * notifyOnCreateOrReopenCase - // - // * notifyOnResolveCase - // - // If you specify none, the following parameters must be null or false: - // - // * notifyOnAddCorrespondenceToCase - // - // * notifyOnCreateOrReopenCase - // - // * notifyOnResolveCase - // - // If you don't specify these parameters in your request, they default to false. - // - // NotifyOnCaseSeverity is a required field - NotifyOnCaseSeverity *string `locationName:"notifyOnCaseSeverity" type:"string" required:"true" enum:"NotificationSeverityLevel"` - - // Whether you want to get notified when a support case is created or reopened. - NotifyOnCreateOrReopenCase *bool `locationName:"notifyOnCreateOrReopenCase" type:"boolean"` - - // Whether you want to get notified when a support case is resolved. - NotifyOnResolveCase *bool `locationName:"notifyOnResolveCase" type:"boolean"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. - // - // TeamId is a required field - TeamId *string `locationName:"teamId" min:"1" 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 CreateSlackChannelConfigurationInput) 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 CreateSlackChannelConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSlackChannelConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSlackChannelConfigurationInput"} - if s.ChannelId == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelId")) - } - if s.ChannelId != nil && len(*s.ChannelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.ChannelRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelRoleArn")) - } - if s.ChannelRoleArn != nil && len(*s.ChannelRoleArn) < 31 { - invalidParams.Add(request.NewErrParamMinLen("ChannelRoleArn", 31)) - } - if s.NotifyOnCaseSeverity == nil { - invalidParams.Add(request.NewErrParamRequired("NotifyOnCaseSeverity")) - } - if s.TeamId == nil { - invalidParams.Add(request.NewErrParamRequired("TeamId")) - } - if s.TeamId != nil && len(*s.TeamId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TeamId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelId sets the ChannelId field's value. -func (s *CreateSlackChannelConfigurationInput) SetChannelId(v string) *CreateSlackChannelConfigurationInput { - s.ChannelId = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *CreateSlackChannelConfigurationInput) SetChannelName(v string) *CreateSlackChannelConfigurationInput { - s.ChannelName = &v - return s -} - -// SetChannelRoleArn sets the ChannelRoleArn field's value. -func (s *CreateSlackChannelConfigurationInput) SetChannelRoleArn(v string) *CreateSlackChannelConfigurationInput { - s.ChannelRoleArn = &v - return s -} - -// SetNotifyOnAddCorrespondenceToCase sets the NotifyOnAddCorrespondenceToCase field's value. -func (s *CreateSlackChannelConfigurationInput) SetNotifyOnAddCorrespondenceToCase(v bool) *CreateSlackChannelConfigurationInput { - s.NotifyOnAddCorrespondenceToCase = &v - return s -} - -// SetNotifyOnCaseSeverity sets the NotifyOnCaseSeverity field's value. -func (s *CreateSlackChannelConfigurationInput) SetNotifyOnCaseSeverity(v string) *CreateSlackChannelConfigurationInput { - s.NotifyOnCaseSeverity = &v - return s -} - -// SetNotifyOnCreateOrReopenCase sets the NotifyOnCreateOrReopenCase field's value. -func (s *CreateSlackChannelConfigurationInput) SetNotifyOnCreateOrReopenCase(v bool) *CreateSlackChannelConfigurationInput { - s.NotifyOnCreateOrReopenCase = &v - return s -} - -// SetNotifyOnResolveCase sets the NotifyOnResolveCase field's value. -func (s *CreateSlackChannelConfigurationInput) SetNotifyOnResolveCase(v bool) *CreateSlackChannelConfigurationInput { - s.NotifyOnResolveCase = &v - return s -} - -// SetTeamId sets the TeamId field's value. -func (s *CreateSlackChannelConfigurationInput) SetTeamId(v string) *CreateSlackChannelConfigurationInput { - s.TeamId = &v - return s -} - -type CreateSlackChannelConfigurationOutput 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 CreateSlackChannelConfigurationOutput) 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 CreateSlackChannelConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteAccountAliasInput struct { - _ struct{} `type:"structure" nopayload:"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 DeleteAccountAliasInput) 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 DeleteAccountAliasInput) GoString() string { - return s.String() -} - -type DeleteAccountAliasOutput 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 DeleteAccountAliasOutput) 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 DeleteAccountAliasOutput) GoString() string { - return s.String() -} - -type DeleteSlackChannelConfigurationInput struct { - _ struct{} `type:"structure"` - - // The channel ID in Slack. This ID identifies a channel within a Slack workspace. - // - // ChannelId is a required field - ChannelId *string `locationName:"channelId" min:"1" type:"string" required:"true"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. - // - // TeamId is a required field - TeamId *string `locationName:"teamId" min:"1" 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 DeleteSlackChannelConfigurationInput) 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 DeleteSlackChannelConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSlackChannelConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSlackChannelConfigurationInput"} - if s.ChannelId == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelId")) - } - if s.ChannelId != nil && len(*s.ChannelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) - } - if s.TeamId == nil { - invalidParams.Add(request.NewErrParamRequired("TeamId")) - } - if s.TeamId != nil && len(*s.TeamId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TeamId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelId sets the ChannelId field's value. -func (s *DeleteSlackChannelConfigurationInput) SetChannelId(v string) *DeleteSlackChannelConfigurationInput { - s.ChannelId = &v - return s -} - -// SetTeamId sets the TeamId field's value. -func (s *DeleteSlackChannelConfigurationInput) SetTeamId(v string) *DeleteSlackChannelConfigurationInput { - s.TeamId = &v - return s -} - -type DeleteSlackChannelConfigurationOutput 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 DeleteSlackChannelConfigurationOutput) 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 DeleteSlackChannelConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteSlackWorkspaceConfigurationInput struct { - _ struct{} `type:"structure"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. - // - // TeamId is a required field - TeamId *string `locationName:"teamId" min:"1" 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 DeleteSlackWorkspaceConfigurationInput) 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 DeleteSlackWorkspaceConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSlackWorkspaceConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSlackWorkspaceConfigurationInput"} - if s.TeamId == nil { - invalidParams.Add(request.NewErrParamRequired("TeamId")) - } - if s.TeamId != nil && len(*s.TeamId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TeamId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTeamId sets the TeamId field's value. -func (s *DeleteSlackWorkspaceConfigurationInput) SetTeamId(v string) *DeleteSlackWorkspaceConfigurationInput { - s.TeamId = &v - return s -} - -type DeleteSlackWorkspaceConfigurationOutput 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 DeleteSlackWorkspaceConfigurationOutput) 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 DeleteSlackWorkspaceConfigurationOutput) GoString() string { - return s.String() -} - -type GetAccountAliasInput struct { - _ struct{} `type:"structure" nopayload:"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 GetAccountAliasInput) 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 GetAccountAliasInput) GoString() string { - return s.String() -} - -type GetAccountAliasOutput struct { - _ struct{} `type:"structure"` - - // An alias or short name for an Amazon Web Services account. - AccountAlias *string `locationName:"accountAlias" min:"1" 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 GetAccountAliasOutput) 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 GetAccountAliasOutput) GoString() string { - return s.String() -} - -// SetAccountAlias sets the AccountAlias field's value. -func (s *GetAccountAliasOutput) SetAccountAlias(v string) *GetAccountAliasOutput { - s.AccountAlias = &v - return s -} - -// We can’t process your request right now because of a server issue. Try -// again later. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListSlackChannelConfigurationsInput struct { - _ struct{} `type:"structure"` - - // If the results of a search are large, the API only returns a portion of the - // results and includes a nextToken pagination token in the response. To retrieve - // the next batch of results, reissue the search request and include the returned - // token. When the API returns the last set of results, the response doesn't - // include a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListSlackChannelConfigurationsInput) 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 ListSlackChannelConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSlackChannelConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSlackChannelConfigurationsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSlackChannelConfigurationsInput) SetNextToken(v string) *ListSlackChannelConfigurationsInput { - s.NextToken = &v - return s -} - -type ListSlackChannelConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The point where pagination should resume when the response returns only partial - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The configurations for a Slack channel. - // - // SlackChannelConfigurations is a required field - SlackChannelConfigurations []*SlackChannelConfiguration `locationName:"slackChannelConfigurations" type:"list" 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 ListSlackChannelConfigurationsOutput) 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 ListSlackChannelConfigurationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSlackChannelConfigurationsOutput) SetNextToken(v string) *ListSlackChannelConfigurationsOutput { - s.NextToken = &v - return s -} - -// SetSlackChannelConfigurations sets the SlackChannelConfigurations field's value. -func (s *ListSlackChannelConfigurationsOutput) SetSlackChannelConfigurations(v []*SlackChannelConfiguration) *ListSlackChannelConfigurationsOutput { - s.SlackChannelConfigurations = v - return s -} - -type ListSlackWorkspaceConfigurationsInput struct { - _ struct{} `type:"structure"` - - // If the results of a search are large, the API only returns a portion of the - // results and includes a nextToken pagination token in the response. To retrieve - // the next batch of results, reissue the search request and include the returned - // token. When the API returns the last set of results, the response doesn't - // include a pagination token value. - NextToken *string `locationName:"nextToken" min:"1" 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 ListSlackWorkspaceConfigurationsInput) 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 ListSlackWorkspaceConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSlackWorkspaceConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSlackWorkspaceConfigurationsInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSlackWorkspaceConfigurationsInput) SetNextToken(v string) *ListSlackWorkspaceConfigurationsInput { - s.NextToken = &v - return s -} - -type ListSlackWorkspaceConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The point where pagination should resume when the response returns only partial - // results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The configurations for a Slack workspace. - SlackWorkspaceConfigurations []*SlackWorkspaceConfiguration `locationName:"slackWorkspaceConfigurations" type:"list"` -} - -// 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 ListSlackWorkspaceConfigurationsOutput) 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 ListSlackWorkspaceConfigurationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSlackWorkspaceConfigurationsOutput) SetNextToken(v string) *ListSlackWorkspaceConfigurationsOutput { - s.NextToken = &v - return s -} - -// SetSlackWorkspaceConfigurations sets the SlackWorkspaceConfigurations field's value. -func (s *ListSlackWorkspaceConfigurationsOutput) SetSlackWorkspaceConfigurations(v []*SlackWorkspaceConfiguration) *ListSlackWorkspaceConfigurationsOutput { - s.SlackWorkspaceConfigurations = v - return s -} - -type PutAccountAliasInput struct { - _ struct{} `type:"structure"` - - // An alias or short name for an Amazon Web Services account. - // - // AccountAlias is a required field - AccountAlias *string `locationName:"accountAlias" min:"1" 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 PutAccountAliasInput) 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 PutAccountAliasInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutAccountAliasInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutAccountAliasInput"} - if s.AccountAlias == nil { - invalidParams.Add(request.NewErrParamRequired("AccountAlias")) - } - if s.AccountAlias != nil && len(*s.AccountAlias) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AccountAlias", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountAlias sets the AccountAlias field's value. -func (s *PutAccountAliasInput) SetAccountAlias(v string) *PutAccountAliasInput { - s.AccountAlias = &v - return s -} - -type PutAccountAliasOutput 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 PutAccountAliasOutput) 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 PutAccountAliasOutput) GoString() string { - return s.String() -} - -type RegisterSlackWorkspaceForOrganizationInput struct { - _ struct{} `type:"structure"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. Specify the Slack workspace that you want to use for your - // organization. - // - // TeamId is a required field - TeamId *string `locationName:"teamId" min:"1" 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 RegisterSlackWorkspaceForOrganizationInput) 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 RegisterSlackWorkspaceForOrganizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterSlackWorkspaceForOrganizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterSlackWorkspaceForOrganizationInput"} - if s.TeamId == nil { - invalidParams.Add(request.NewErrParamRequired("TeamId")) - } - if s.TeamId != nil && len(*s.TeamId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TeamId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTeamId sets the TeamId field's value. -func (s *RegisterSlackWorkspaceForOrganizationInput) SetTeamId(v string) *RegisterSlackWorkspaceForOrganizationInput { - s.TeamId = &v - return s -} - -type RegisterSlackWorkspaceForOrganizationOutput struct { - _ struct{} `type:"structure"` - - // Whether the Amazon Web Services account is a management or member account - // that's part of an organization in Organizations. - AccountType *string `locationName:"accountType" type:"string" enum:"AccountType"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. - TeamId *string `locationName:"teamId" min:"1" type:"string"` - - // The name of the Slack workspace. - TeamName *string `locationName:"teamName" min:"1" 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 RegisterSlackWorkspaceForOrganizationOutput) 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 RegisterSlackWorkspaceForOrganizationOutput) GoString() string { - return s.String() -} - -// SetAccountType sets the AccountType field's value. -func (s *RegisterSlackWorkspaceForOrganizationOutput) SetAccountType(v string) *RegisterSlackWorkspaceForOrganizationOutput { - s.AccountType = &v - return s -} - -// SetTeamId sets the TeamId field's value. -func (s *RegisterSlackWorkspaceForOrganizationOutput) SetTeamId(v string) *RegisterSlackWorkspaceForOrganizationOutput { - s.TeamId = &v - return s -} - -// SetTeamName sets the TeamName field's value. -func (s *RegisterSlackWorkspaceForOrganizationOutput) SetTeamName(v string) *RegisterSlackWorkspaceForOrganizationOutput { - s.TeamName = &v - return s -} - -// The specified resource is missing or doesn't exist, such as an account alias, -// Slack channel configuration, or Slack workspace configuration. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Your Service Quotas request exceeds the quota for the service. For example, -// your Service Quotas request to Amazon Web Services Support App might exceed -// the maximum number of workspaces or channels per account, or the maximum -// number of accounts per Slack channel. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The configuration for a Slack channel that you added for your Amazon Web -// Services account. -type SlackChannelConfiguration struct { - _ struct{} `type:"structure"` - - // The channel ID in Slack. This ID identifies a channel within a Slack workspace. - // - // ChannelId is a required field - ChannelId *string `locationName:"channelId" min:"1" type:"string" required:"true"` - - // The name of the Slack channel that you configured with the Amazon Web Services - // Support App for your Amazon Web Services account. - ChannelName *string `locationName:"channelName" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of an IAM role that you want to use to perform - // operations on Amazon Web Services. For more information, see Managing access - // to the Amazon Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html) - // in the Amazon Web Services Support User Guide. - ChannelRoleArn *string `locationName:"channelRoleArn" min:"31" type:"string"` - - // Whether you want to get notified when a support case has a new correspondence. - NotifyOnAddCorrespondenceToCase *bool `locationName:"notifyOnAddCorrespondenceToCase" type:"boolean"` - - // The case severity for a support case that you want to receive notifications. - NotifyOnCaseSeverity *string `locationName:"notifyOnCaseSeverity" type:"string" enum:"NotificationSeverityLevel"` - - // Whether you want to get notified when a support case is created or reopened. - NotifyOnCreateOrReopenCase *bool `locationName:"notifyOnCreateOrReopenCase" type:"boolean"` - - // Whether you want to get notified when a support case is resolved. - NotifyOnResolveCase *bool `locationName:"notifyOnResolveCase" type:"boolean"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. - // - // TeamId is a required field - TeamId *string `locationName:"teamId" min:"1" 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 SlackChannelConfiguration) 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 SlackChannelConfiguration) GoString() string { - return s.String() -} - -// SetChannelId sets the ChannelId field's value. -func (s *SlackChannelConfiguration) SetChannelId(v string) *SlackChannelConfiguration { - s.ChannelId = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *SlackChannelConfiguration) SetChannelName(v string) *SlackChannelConfiguration { - s.ChannelName = &v - return s -} - -// SetChannelRoleArn sets the ChannelRoleArn field's value. -func (s *SlackChannelConfiguration) SetChannelRoleArn(v string) *SlackChannelConfiguration { - s.ChannelRoleArn = &v - return s -} - -// SetNotifyOnAddCorrespondenceToCase sets the NotifyOnAddCorrespondenceToCase field's value. -func (s *SlackChannelConfiguration) SetNotifyOnAddCorrespondenceToCase(v bool) *SlackChannelConfiguration { - s.NotifyOnAddCorrespondenceToCase = &v - return s -} - -// SetNotifyOnCaseSeverity sets the NotifyOnCaseSeverity field's value. -func (s *SlackChannelConfiguration) SetNotifyOnCaseSeverity(v string) *SlackChannelConfiguration { - s.NotifyOnCaseSeverity = &v - return s -} - -// SetNotifyOnCreateOrReopenCase sets the NotifyOnCreateOrReopenCase field's value. -func (s *SlackChannelConfiguration) SetNotifyOnCreateOrReopenCase(v bool) *SlackChannelConfiguration { - s.NotifyOnCreateOrReopenCase = &v - return s -} - -// SetNotifyOnResolveCase sets the NotifyOnResolveCase field's value. -func (s *SlackChannelConfiguration) SetNotifyOnResolveCase(v bool) *SlackChannelConfiguration { - s.NotifyOnResolveCase = &v - return s -} - -// SetTeamId sets the TeamId field's value. -func (s *SlackChannelConfiguration) SetTeamId(v string) *SlackChannelConfiguration { - s.TeamId = &v - return s -} - -// The configuration for a Slack workspace that you added to an Amazon Web Services -// account. -type SlackWorkspaceConfiguration struct { - _ struct{} `type:"structure"` - - // Whether to allow member accounts to authorize Slack workspaces. Member accounts - // must be part of an organization in Organizations. - AllowOrganizationMemberAccount *bool `locationName:"allowOrganizationMemberAccount" type:"boolean"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. - // - // TeamId is a required field - TeamId *string `locationName:"teamId" min:"1" type:"string" required:"true"` - - // The name of the Slack workspace. - TeamName *string `locationName:"teamName" min:"1" 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 SlackWorkspaceConfiguration) 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 SlackWorkspaceConfiguration) GoString() string { - return s.String() -} - -// SetAllowOrganizationMemberAccount sets the AllowOrganizationMemberAccount field's value. -func (s *SlackWorkspaceConfiguration) SetAllowOrganizationMemberAccount(v bool) *SlackWorkspaceConfiguration { - s.AllowOrganizationMemberAccount = &v - return s -} - -// SetTeamId sets the TeamId field's value. -func (s *SlackWorkspaceConfiguration) SetTeamId(v string) *SlackWorkspaceConfiguration { - s.TeamId = &v - return s -} - -// SetTeamName sets the TeamName field's value. -func (s *SlackWorkspaceConfiguration) SetTeamName(v string) *SlackWorkspaceConfiguration { - s.TeamName = &v - return s -} - -type UpdateSlackChannelConfigurationInput struct { - _ struct{} `type:"structure"` - - // The channel ID in Slack. This ID identifies a channel within a Slack workspace. - // - // ChannelId is a required field - ChannelId *string `locationName:"channelId" min:"1" type:"string" required:"true"` - - // The Slack channel name that you want to update. - ChannelName *string `locationName:"channelName" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of an IAM role that you want to use to perform - // operations on Amazon Web Services. For more information, see Managing access - // to the Amazon Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html) - // in the Amazon Web Services Support User Guide. - ChannelRoleArn *string `locationName:"channelRoleArn" min:"31" type:"string"` - - // Whether you want to get notified when a support case has a new correspondence. - NotifyOnAddCorrespondenceToCase *bool `locationName:"notifyOnAddCorrespondenceToCase" type:"boolean"` - - // The case severity for a support case that you want to receive notifications. - // - // If you specify high or all, at least one of the following parameters must - // be true: - // - // * notifyOnAddCorrespondenceToCase - // - // * notifyOnCreateOrReopenCase - // - // * notifyOnResolveCase - // - // If you specify none, any of the following parameters that you specify in - // your request must be false: - // - // * notifyOnAddCorrespondenceToCase - // - // * notifyOnCreateOrReopenCase - // - // * notifyOnResolveCase - // - // If you don't specify these parameters in your request, the Amazon Web Services - // Support App uses the current values by default. - NotifyOnCaseSeverity *string `locationName:"notifyOnCaseSeverity" type:"string" enum:"NotificationSeverityLevel"` - - // Whether you want to get notified when a support case is created or reopened. - NotifyOnCreateOrReopenCase *bool `locationName:"notifyOnCreateOrReopenCase" type:"boolean"` - - // Whether you want to get notified when a support case is resolved. - NotifyOnResolveCase *bool `locationName:"notifyOnResolveCase" type:"boolean"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. - // - // TeamId is a required field - TeamId *string `locationName:"teamId" min:"1" 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 UpdateSlackChannelConfigurationInput) 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 UpdateSlackChannelConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSlackChannelConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSlackChannelConfigurationInput"} - if s.ChannelId == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelId")) - } - if s.ChannelId != nil && len(*s.ChannelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.ChannelRoleArn != nil && len(*s.ChannelRoleArn) < 31 { - invalidParams.Add(request.NewErrParamMinLen("ChannelRoleArn", 31)) - } - if s.TeamId == nil { - invalidParams.Add(request.NewErrParamRequired("TeamId")) - } - if s.TeamId != nil && len(*s.TeamId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TeamId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannelId sets the ChannelId field's value. -func (s *UpdateSlackChannelConfigurationInput) SetChannelId(v string) *UpdateSlackChannelConfigurationInput { - s.ChannelId = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *UpdateSlackChannelConfigurationInput) SetChannelName(v string) *UpdateSlackChannelConfigurationInput { - s.ChannelName = &v - return s -} - -// SetChannelRoleArn sets the ChannelRoleArn field's value. -func (s *UpdateSlackChannelConfigurationInput) SetChannelRoleArn(v string) *UpdateSlackChannelConfigurationInput { - s.ChannelRoleArn = &v - return s -} - -// SetNotifyOnAddCorrespondenceToCase sets the NotifyOnAddCorrespondenceToCase field's value. -func (s *UpdateSlackChannelConfigurationInput) SetNotifyOnAddCorrespondenceToCase(v bool) *UpdateSlackChannelConfigurationInput { - s.NotifyOnAddCorrespondenceToCase = &v - return s -} - -// SetNotifyOnCaseSeverity sets the NotifyOnCaseSeverity field's value. -func (s *UpdateSlackChannelConfigurationInput) SetNotifyOnCaseSeverity(v string) *UpdateSlackChannelConfigurationInput { - s.NotifyOnCaseSeverity = &v - return s -} - -// SetNotifyOnCreateOrReopenCase sets the NotifyOnCreateOrReopenCase field's value. -func (s *UpdateSlackChannelConfigurationInput) SetNotifyOnCreateOrReopenCase(v bool) *UpdateSlackChannelConfigurationInput { - s.NotifyOnCreateOrReopenCase = &v - return s -} - -// SetNotifyOnResolveCase sets the NotifyOnResolveCase field's value. -func (s *UpdateSlackChannelConfigurationInput) SetNotifyOnResolveCase(v bool) *UpdateSlackChannelConfigurationInput { - s.NotifyOnResolveCase = &v - return s -} - -// SetTeamId sets the TeamId field's value. -func (s *UpdateSlackChannelConfigurationInput) SetTeamId(v string) *UpdateSlackChannelConfigurationInput { - s.TeamId = &v - return s -} - -type UpdateSlackChannelConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The channel ID in Slack. This ID identifies a channel within a Slack workspace. - ChannelId *string `locationName:"channelId" min:"1" type:"string"` - - // The name of the Slack channel that you configure for the Amazon Web Services - // Support App. - ChannelName *string `locationName:"channelName" min:"1" type:"string"` - - // The Amazon Resource Name (ARN) of an IAM role that you want to use to perform - // operations on Amazon Web Services. For more information, see Managing access - // to the Amazon Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html) - // in the Amazon Web Services Support User Guide. - ChannelRoleArn *string `locationName:"channelRoleArn" min:"31" type:"string"` - - // Whether you want to get notified when a support case has a new correspondence. - NotifyOnAddCorrespondenceToCase *bool `locationName:"notifyOnAddCorrespondenceToCase" type:"boolean"` - - // The case severity for a support case that you want to receive notifications. - NotifyOnCaseSeverity *string `locationName:"notifyOnCaseSeverity" type:"string" enum:"NotificationSeverityLevel"` - - // Whether you want to get notified when a support case is created or reopened. - NotifyOnCreateOrReopenCase *bool `locationName:"notifyOnCreateOrReopenCase" type:"boolean"` - - // Whether you want to get notified when a support case is resolved. - NotifyOnResolveCase *bool `locationName:"notifyOnResolveCase" type:"boolean"` - - // The team ID in Slack. This ID uniquely identifies a Slack workspace, such - // as T012ABCDEFG. - TeamId *string `locationName:"teamId" min:"1" 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 UpdateSlackChannelConfigurationOutput) 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 UpdateSlackChannelConfigurationOutput) GoString() string { - return s.String() -} - -// SetChannelId sets the ChannelId field's value. -func (s *UpdateSlackChannelConfigurationOutput) SetChannelId(v string) *UpdateSlackChannelConfigurationOutput { - s.ChannelId = &v - return s -} - -// SetChannelName sets the ChannelName field's value. -func (s *UpdateSlackChannelConfigurationOutput) SetChannelName(v string) *UpdateSlackChannelConfigurationOutput { - s.ChannelName = &v - return s -} - -// SetChannelRoleArn sets the ChannelRoleArn field's value. -func (s *UpdateSlackChannelConfigurationOutput) SetChannelRoleArn(v string) *UpdateSlackChannelConfigurationOutput { - s.ChannelRoleArn = &v - return s -} - -// SetNotifyOnAddCorrespondenceToCase sets the NotifyOnAddCorrespondenceToCase field's value. -func (s *UpdateSlackChannelConfigurationOutput) SetNotifyOnAddCorrespondenceToCase(v bool) *UpdateSlackChannelConfigurationOutput { - s.NotifyOnAddCorrespondenceToCase = &v - return s -} - -// SetNotifyOnCaseSeverity sets the NotifyOnCaseSeverity field's value. -func (s *UpdateSlackChannelConfigurationOutput) SetNotifyOnCaseSeverity(v string) *UpdateSlackChannelConfigurationOutput { - s.NotifyOnCaseSeverity = &v - return s -} - -// SetNotifyOnCreateOrReopenCase sets the NotifyOnCreateOrReopenCase field's value. -func (s *UpdateSlackChannelConfigurationOutput) SetNotifyOnCreateOrReopenCase(v bool) *UpdateSlackChannelConfigurationOutput { - s.NotifyOnCreateOrReopenCase = &v - return s -} - -// SetNotifyOnResolveCase sets the NotifyOnResolveCase field's value. -func (s *UpdateSlackChannelConfigurationOutput) SetNotifyOnResolveCase(v bool) *UpdateSlackChannelConfigurationOutput { - s.NotifyOnResolveCase = &v - return s -} - -// SetTeamId sets the TeamId field's value. -func (s *UpdateSlackChannelConfigurationOutput) SetTeamId(v string) *UpdateSlackChannelConfigurationOutput { - s.TeamId = &v - return s -} - -// Your request input doesn't meet the constraints that the Amazon Web Services -// Support App specifies. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // AccountTypeManagement is a AccountType enum value - AccountTypeManagement = "management" - - // AccountTypeMember is a AccountType enum value - AccountTypeMember = "member" -) - -// AccountType_Values returns all elements of the AccountType enum -func AccountType_Values() []string { - return []string{ - AccountTypeManagement, - AccountTypeMember, - } -} - -const ( - // NotificationSeverityLevelNone is a NotificationSeverityLevel enum value - NotificationSeverityLevelNone = "none" - - // NotificationSeverityLevelAll is a NotificationSeverityLevel enum value - NotificationSeverityLevelAll = "all" - - // NotificationSeverityLevelHigh is a NotificationSeverityLevel enum value - NotificationSeverityLevelHigh = "high" -) - -// NotificationSeverityLevel_Values returns all elements of the NotificationSeverityLevel enum -func NotificationSeverityLevel_Values() []string { - return []string{ - NotificationSeverityLevelNone, - NotificationSeverityLevelAll, - NotificationSeverityLevelHigh, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/doc.go deleted file mode 100644 index 3beb19026049..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/doc.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package supportapp provides the client and types for making API -// requests to AWS Support App. -// -// You can use the Amazon Web Services Support App in Slack API to manage your -// support cases in Slack for your Amazon Web Services account. After you configure -// your Slack workspace and channel with the Amazon Web Services Support App, -// you can perform the following tasks directly in your Slack channel: -// -// - Create, search, update, and resolve your support cases -// -// - Request service quota increases for your account -// -// - Invite Amazon Web Services Support agents to your channel so that you -// can chat directly about your support cases -// -// For more information about how to perform these actions in Slack, see the -// following documentation in the Amazon Web Services Support User Guide: -// -// - Amazon Web Services Support App in Slack (https://docs.aws.amazon.com/awssupport/latest/user/aws-support-app-for-slack.html) -// -// - Joining a live chat session with Amazon Web Services Support (https://docs.aws.amazon.com/awssupport/latest/user/joining-a-live-chat-session.html) -// -// - Requesting service quota increases (https://docs.aws.amazon.com/awssupport/latest/user/service-quota-increase.html) -// -// - Amazon Web Services Support App commands in Slack (https://docs.aws.amazon.com/awssupport/latest/user/support-app-commands.html) -// -// You can also use the Amazon Web Services Management Console instead of the -// Amazon Web Services Support App API to manage your Slack configurations. -// For more information, see Authorize a Slack workspace to enable the Amazon -// Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/authorize-slack-workspace.html). -// -// - You must have a Business or Enterprise Support plan to use the Amazon -// Web Services Support App API. -// -// - For more information about the Amazon Web Services Support App endpoints, -// see the Amazon Web Services Support App in Slack endpoints (https://docs.aws.amazon.com/general/latest/gr/awssupport.html#awssupport_app_region) -// in the Amazon Web Services General Reference. -// -// See https://docs.aws.amazon.com/goto/WebAPI/support-app-2021-08-20 for more information on this service. -// -// See supportapp package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/supportapp/ -// -// # Using the Client -// -// To contact AWS Support App with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Support App client SupportApp for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/supportapp/#New -package supportapp diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/errors.go deleted file mode 100644 index cdf6b173dba1..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/errors.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package supportapp - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have sufficient permission to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Your request has a conflict. For example, you might receive this error if - // you try the following: - // - // * Add, update, or delete a Slack channel configuration before you add - // a Slack workspace to your Amazon Web Services account. - // - // * Add a Slack channel configuration that already exists in your Amazon - // Web Services account. - // - // * Delete a Slack channel configuration for a live chat channel. - // - // * Delete a Slack workspace from your Amazon Web Services account that - // has an active live chat channel. - // - // * Call the RegisterSlackWorkspaceForOrganization API from an Amazon Web - // Services account that doesn't belong to an organization. - // - // * Call the RegisterSlackWorkspaceForOrganization API from a member account, - // but the management account hasn't registered that workspace yet for the - // organization. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // We can’t process your request right now because of a server issue. Try - // again later. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The specified resource is missing or doesn't exist, such as an account alias, - // Slack channel configuration, or Slack workspace configuration. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Your Service Quotas request exceeds the quota for the service. For example, - // your Service Quotas request to Amazon Web Services Support App might exceed - // the maximum number of workspaces or channels per account, or the maximum - // number of accounts per Slack channel. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Your request input doesn't meet the constraints that the Amazon Web Services - // Support App specifies. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/service.go deleted file mode 100644 index e3e806b81fea..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package supportapp - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// SupportApp provides the API operation methods for making requests to -// AWS Support App. See this package's package overview docs -// for details on the service. -// -// SupportApp methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type SupportApp struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "Support App" // Name of service. - EndpointsID = "supportapp" // ID to lookup a service endpoint with. - ServiceID = "Support App" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the SupportApp client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a SupportApp client from just a session. -// svc := supportapp.New(mySession) -// -// // Create a SupportApp client with additional configuration -// svc := supportapp.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *SupportApp { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "supportapp" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *SupportApp { - svc := &SupportApp{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-08-20", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a SupportApp operation and runs any -// custom request initialization. -func (c *SupportApp) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/supportappiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/supportappiface/interface.go deleted file mode 100644 index e8e385f4ae0b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp/supportappiface/interface.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package supportappiface provides an interface to enable mocking the AWS Support App service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package supportappiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/supportapp" -) - -// SupportAppAPI provides an interface to enable mocking the -// supportapp.SupportApp service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Support App. -// func myFunc(svc supportappiface.SupportAppAPI) bool { -// // Make svc.CreateSlackChannelConfiguration request -// } -// -// func main() { -// sess := session.New() -// svc := supportapp.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockSupportAppClient struct { -// supportappiface.SupportAppAPI -// } -// func (m *mockSupportAppClient) CreateSlackChannelConfiguration(input *supportapp.CreateSlackChannelConfigurationInput) (*supportapp.CreateSlackChannelConfigurationOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockSupportAppClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type SupportAppAPI interface { - CreateSlackChannelConfiguration(*supportapp.CreateSlackChannelConfigurationInput) (*supportapp.CreateSlackChannelConfigurationOutput, error) - CreateSlackChannelConfigurationWithContext(aws.Context, *supportapp.CreateSlackChannelConfigurationInput, ...request.Option) (*supportapp.CreateSlackChannelConfigurationOutput, error) - CreateSlackChannelConfigurationRequest(*supportapp.CreateSlackChannelConfigurationInput) (*request.Request, *supportapp.CreateSlackChannelConfigurationOutput) - - DeleteAccountAlias(*supportapp.DeleteAccountAliasInput) (*supportapp.DeleteAccountAliasOutput, error) - DeleteAccountAliasWithContext(aws.Context, *supportapp.DeleteAccountAliasInput, ...request.Option) (*supportapp.DeleteAccountAliasOutput, error) - DeleteAccountAliasRequest(*supportapp.DeleteAccountAliasInput) (*request.Request, *supportapp.DeleteAccountAliasOutput) - - DeleteSlackChannelConfiguration(*supportapp.DeleteSlackChannelConfigurationInput) (*supportapp.DeleteSlackChannelConfigurationOutput, error) - DeleteSlackChannelConfigurationWithContext(aws.Context, *supportapp.DeleteSlackChannelConfigurationInput, ...request.Option) (*supportapp.DeleteSlackChannelConfigurationOutput, error) - DeleteSlackChannelConfigurationRequest(*supportapp.DeleteSlackChannelConfigurationInput) (*request.Request, *supportapp.DeleteSlackChannelConfigurationOutput) - - DeleteSlackWorkspaceConfiguration(*supportapp.DeleteSlackWorkspaceConfigurationInput) (*supportapp.DeleteSlackWorkspaceConfigurationOutput, error) - DeleteSlackWorkspaceConfigurationWithContext(aws.Context, *supportapp.DeleteSlackWorkspaceConfigurationInput, ...request.Option) (*supportapp.DeleteSlackWorkspaceConfigurationOutput, error) - DeleteSlackWorkspaceConfigurationRequest(*supportapp.DeleteSlackWorkspaceConfigurationInput) (*request.Request, *supportapp.DeleteSlackWorkspaceConfigurationOutput) - - GetAccountAlias(*supportapp.GetAccountAliasInput) (*supportapp.GetAccountAliasOutput, error) - GetAccountAliasWithContext(aws.Context, *supportapp.GetAccountAliasInput, ...request.Option) (*supportapp.GetAccountAliasOutput, error) - GetAccountAliasRequest(*supportapp.GetAccountAliasInput) (*request.Request, *supportapp.GetAccountAliasOutput) - - ListSlackChannelConfigurations(*supportapp.ListSlackChannelConfigurationsInput) (*supportapp.ListSlackChannelConfigurationsOutput, error) - ListSlackChannelConfigurationsWithContext(aws.Context, *supportapp.ListSlackChannelConfigurationsInput, ...request.Option) (*supportapp.ListSlackChannelConfigurationsOutput, error) - ListSlackChannelConfigurationsRequest(*supportapp.ListSlackChannelConfigurationsInput) (*request.Request, *supportapp.ListSlackChannelConfigurationsOutput) - - ListSlackChannelConfigurationsPages(*supportapp.ListSlackChannelConfigurationsInput, func(*supportapp.ListSlackChannelConfigurationsOutput, bool) bool) error - ListSlackChannelConfigurationsPagesWithContext(aws.Context, *supportapp.ListSlackChannelConfigurationsInput, func(*supportapp.ListSlackChannelConfigurationsOutput, bool) bool, ...request.Option) error - - ListSlackWorkspaceConfigurations(*supportapp.ListSlackWorkspaceConfigurationsInput) (*supportapp.ListSlackWorkspaceConfigurationsOutput, error) - ListSlackWorkspaceConfigurationsWithContext(aws.Context, *supportapp.ListSlackWorkspaceConfigurationsInput, ...request.Option) (*supportapp.ListSlackWorkspaceConfigurationsOutput, error) - ListSlackWorkspaceConfigurationsRequest(*supportapp.ListSlackWorkspaceConfigurationsInput) (*request.Request, *supportapp.ListSlackWorkspaceConfigurationsOutput) - - ListSlackWorkspaceConfigurationsPages(*supportapp.ListSlackWorkspaceConfigurationsInput, func(*supportapp.ListSlackWorkspaceConfigurationsOutput, bool) bool) error - ListSlackWorkspaceConfigurationsPagesWithContext(aws.Context, *supportapp.ListSlackWorkspaceConfigurationsInput, func(*supportapp.ListSlackWorkspaceConfigurationsOutput, bool) bool, ...request.Option) error - - PutAccountAlias(*supportapp.PutAccountAliasInput) (*supportapp.PutAccountAliasOutput, error) - PutAccountAliasWithContext(aws.Context, *supportapp.PutAccountAliasInput, ...request.Option) (*supportapp.PutAccountAliasOutput, error) - PutAccountAliasRequest(*supportapp.PutAccountAliasInput) (*request.Request, *supportapp.PutAccountAliasOutput) - - RegisterSlackWorkspaceForOrganization(*supportapp.RegisterSlackWorkspaceForOrganizationInput) (*supportapp.RegisterSlackWorkspaceForOrganizationOutput, error) - RegisterSlackWorkspaceForOrganizationWithContext(aws.Context, *supportapp.RegisterSlackWorkspaceForOrganizationInput, ...request.Option) (*supportapp.RegisterSlackWorkspaceForOrganizationOutput, error) - RegisterSlackWorkspaceForOrganizationRequest(*supportapp.RegisterSlackWorkspaceForOrganizationInput) (*request.Request, *supportapp.RegisterSlackWorkspaceForOrganizationOutput) - - UpdateSlackChannelConfiguration(*supportapp.UpdateSlackChannelConfigurationInput) (*supportapp.UpdateSlackChannelConfigurationOutput, error) - UpdateSlackChannelConfigurationWithContext(aws.Context, *supportapp.UpdateSlackChannelConfigurationInput, ...request.Option) (*supportapp.UpdateSlackChannelConfigurationOutput, error) - UpdateSlackChannelConfigurationRequest(*supportapp.UpdateSlackChannelConfigurationInput) (*request.Request, *supportapp.UpdateSlackChannelConfigurationOutput) -} - -var _ SupportAppAPI = (*supportapp.SupportApp)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/api.go deleted file mode 100644 index fa2a814c7be8..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/api.go +++ /dev/null @@ -1,9960 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package tnb - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCancelSolNetworkOperation = "CancelSolNetworkOperation" - -// CancelSolNetworkOperationRequest generates a "aws/request.Request" representing the -// client's request for the CancelSolNetworkOperation 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 CancelSolNetworkOperation for more information on using the CancelSolNetworkOperation -// 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 CancelSolNetworkOperationRequest method. -// req, resp := client.CancelSolNetworkOperationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/CancelSolNetworkOperation -func (c *Tnb) CancelSolNetworkOperationRequest(input *CancelSolNetworkOperationInput) (req *request.Request, output *CancelSolNetworkOperationOutput) { - op := &request.Operation{ - Name: opCancelSolNetworkOperation, - HTTPMethod: "POST", - HTTPPath: "/sol/nslcm/v1/ns_lcm_op_occs/{nsLcmOpOccId}/cancel", - } - - if input == nil { - input = &CancelSolNetworkOperationInput{} - } - - output = &CancelSolNetworkOperationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CancelSolNetworkOperation API operation for AWS Telco Network Builder. -// -// Cancels a network operation. -// -// A network operation is any operation that is done to your network, such as -// network instance instantiation or termination. -// -// 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 AWS Telco Network Builder's -// API operation CancelSolNetworkOperation for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/CancelSolNetworkOperation -func (c *Tnb) CancelSolNetworkOperation(input *CancelSolNetworkOperationInput) (*CancelSolNetworkOperationOutput, error) { - req, out := c.CancelSolNetworkOperationRequest(input) - return out, req.Send() -} - -// CancelSolNetworkOperationWithContext is the same as CancelSolNetworkOperation with the addition of -// the ability to pass a context and additional request options. -// -// See CancelSolNetworkOperation 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 *Tnb) CancelSolNetworkOperationWithContext(ctx aws.Context, input *CancelSolNetworkOperationInput, opts ...request.Option) (*CancelSolNetworkOperationOutput, error) { - req, out := c.CancelSolNetworkOperationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSolFunctionPackage = "CreateSolFunctionPackage" - -// CreateSolFunctionPackageRequest generates a "aws/request.Request" representing the -// client's request for the CreateSolFunctionPackage 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 CreateSolFunctionPackage for more information on using the CreateSolFunctionPackage -// 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 CreateSolFunctionPackageRequest method. -// req, resp := client.CreateSolFunctionPackageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/CreateSolFunctionPackage -func (c *Tnb) CreateSolFunctionPackageRequest(input *CreateSolFunctionPackageInput) (req *request.Request, output *CreateSolFunctionPackageOutput) { - op := &request.Operation{ - Name: opCreateSolFunctionPackage, - HTTPMethod: "POST", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages", - } - - if input == nil { - input = &CreateSolFunctionPackageInput{} - } - - output = &CreateSolFunctionPackageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSolFunctionPackage API operation for AWS Telco Network Builder. -// -// Creates a function package. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. For more information, -// see Function packages (https://docs.aws.amazon.com/tnb/latest/ug/function-packages.html) -// in the Amazon Web Services Telco Network Builder User Guide. -// -// Creating a function package is the first step for creating a network in AWS -// TNB. This request creates an empty container with an ID. The next step is -// to upload the actual CSAR zip file into that empty container. To upload function -// package content, see PutSolFunctionPackageContent (https://docs.aws.amazon.com/tnb/latest/APIReference/API_PutSolFunctionPackageContent.html). -// -// 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 AWS Telco Network Builder's -// API operation CreateSolFunctionPackage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ServiceQuotaExceededException -// Service quotas have been exceeded. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/CreateSolFunctionPackage -func (c *Tnb) CreateSolFunctionPackage(input *CreateSolFunctionPackageInput) (*CreateSolFunctionPackageOutput, error) { - req, out := c.CreateSolFunctionPackageRequest(input) - return out, req.Send() -} - -// CreateSolFunctionPackageWithContext is the same as CreateSolFunctionPackage with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSolFunctionPackage 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 *Tnb) CreateSolFunctionPackageWithContext(ctx aws.Context, input *CreateSolFunctionPackageInput, opts ...request.Option) (*CreateSolFunctionPackageOutput, error) { - req, out := c.CreateSolFunctionPackageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSolNetworkInstance = "CreateSolNetworkInstance" - -// CreateSolNetworkInstanceRequest generates a "aws/request.Request" representing the -// client's request for the CreateSolNetworkInstance 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 CreateSolNetworkInstance for more information on using the CreateSolNetworkInstance -// 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 CreateSolNetworkInstanceRequest method. -// req, resp := client.CreateSolNetworkInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/CreateSolNetworkInstance -func (c *Tnb) CreateSolNetworkInstanceRequest(input *CreateSolNetworkInstanceInput) (req *request.Request, output *CreateSolNetworkInstanceOutput) { - op := &request.Operation{ - Name: opCreateSolNetworkInstance, - HTTPMethod: "POST", - HTTPPath: "/sol/nslcm/v1/ns_instances", - } - - if input == nil { - input = &CreateSolNetworkInstanceInput{} - } - - output = &CreateSolNetworkInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSolNetworkInstance API operation for AWS Telco Network Builder. -// -// Creates a network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. Creating a network instance is the -// third step after creating a network package. For more information about network -// instances, Network instances (https://docs.aws.amazon.com/tnb/latest/ug/network-instances.html) -// in the Amazon Web Services Telco Network Builder User Guide. -// -// Once you create a network instance, you can instantiate it. To instantiate -// a network, see InstantiateSolNetworkInstance (https://docs.aws.amazon.com/tnb/latest/APIReference/API_InstantiateSolNetworkInstance.html). -// -// 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 AWS Telco Network Builder's -// API operation CreateSolNetworkInstance for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ServiceQuotaExceededException -// Service quotas have been exceeded. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/CreateSolNetworkInstance -func (c *Tnb) CreateSolNetworkInstance(input *CreateSolNetworkInstanceInput) (*CreateSolNetworkInstanceOutput, error) { - req, out := c.CreateSolNetworkInstanceRequest(input) - return out, req.Send() -} - -// CreateSolNetworkInstanceWithContext is the same as CreateSolNetworkInstance with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSolNetworkInstance 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 *Tnb) CreateSolNetworkInstanceWithContext(ctx aws.Context, input *CreateSolNetworkInstanceInput, opts ...request.Option) (*CreateSolNetworkInstanceOutput, error) { - req, out := c.CreateSolNetworkInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateSolNetworkPackage = "CreateSolNetworkPackage" - -// CreateSolNetworkPackageRequest generates a "aws/request.Request" representing the -// client's request for the CreateSolNetworkPackage 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 CreateSolNetworkPackage for more information on using the CreateSolNetworkPackage -// 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 CreateSolNetworkPackageRequest method. -// req, resp := client.CreateSolNetworkPackageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/CreateSolNetworkPackage -func (c *Tnb) CreateSolNetworkPackageRequest(input *CreateSolNetworkPackageInput) (req *request.Request, output *CreateSolNetworkPackageOutput) { - op := &request.Operation{ - Name: opCreateSolNetworkPackage, - HTTPMethod: "POST", - HTTPPath: "/sol/nsd/v1/ns_descriptors", - } - - if input == nil { - input = &CreateSolNetworkPackageInput{} - } - - output = &CreateSolNetworkPackageOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateSolNetworkPackage API operation for AWS Telco Network Builder. -// -// Creates a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. For more information, see Network instances (https://docs.aws.amazon.com/tnb/latest/ug/network-instances.html) -// in the Amazon Web Services Telco Network Builder User Guide. -// -// A network package consists of a network service descriptor (NSD) file (required) -// and any additional files (optional), such as scripts specific to your needs. -// For example, if you have multiple function packages in your network package, -// you can use the NSD to define which network functions should run in certain -// VPCs, subnets, or EKS clusters. -// -// This request creates an empty network package container with an ID. Once -// you create a network package, you can upload the network package content -// using PutSolNetworkPackageContent (https://docs.aws.amazon.com/tnb/latest/APIReference/API_PutSolNetworkPackageContent.html). -// -// 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 AWS Telco Network Builder's -// API operation CreateSolNetworkPackage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ServiceQuotaExceededException -// Service quotas have been exceeded. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/CreateSolNetworkPackage -func (c *Tnb) CreateSolNetworkPackage(input *CreateSolNetworkPackageInput) (*CreateSolNetworkPackageOutput, error) { - req, out := c.CreateSolNetworkPackageRequest(input) - return out, req.Send() -} - -// CreateSolNetworkPackageWithContext is the same as CreateSolNetworkPackage with the addition of -// the ability to pass a context and additional request options. -// -// See CreateSolNetworkPackage 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 *Tnb) CreateSolNetworkPackageWithContext(ctx aws.Context, input *CreateSolNetworkPackageInput, opts ...request.Option) (*CreateSolNetworkPackageOutput, error) { - req, out := c.CreateSolNetworkPackageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSolFunctionPackage = "DeleteSolFunctionPackage" - -// DeleteSolFunctionPackageRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSolFunctionPackage 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 DeleteSolFunctionPackage for more information on using the DeleteSolFunctionPackage -// 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 DeleteSolFunctionPackageRequest method. -// req, resp := client.DeleteSolFunctionPackageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/DeleteSolFunctionPackage -func (c *Tnb) DeleteSolFunctionPackageRequest(input *DeleteSolFunctionPackageInput) (req *request.Request, output *DeleteSolFunctionPackageOutput) { - op := &request.Operation{ - Name: opDeleteSolFunctionPackage, - HTTPMethod: "DELETE", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}", - } - - if input == nil { - input = &DeleteSolFunctionPackageInput{} - } - - output = &DeleteSolFunctionPackageOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSolFunctionPackage API operation for AWS Telco Network Builder. -// -// Deletes a function package. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -// -// To delete a function package, the package must be in a disabled state. To -// disable a function package, see UpdateSolFunctionPackage (https://docs.aws.amazon.com/tnb/latest/APIReference/API_UpdateSolFunctionPackage.html). -// -// 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 AWS Telco Network Builder's -// API operation DeleteSolFunctionPackage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/DeleteSolFunctionPackage -func (c *Tnb) DeleteSolFunctionPackage(input *DeleteSolFunctionPackageInput) (*DeleteSolFunctionPackageOutput, error) { - req, out := c.DeleteSolFunctionPackageRequest(input) - return out, req.Send() -} - -// DeleteSolFunctionPackageWithContext is the same as DeleteSolFunctionPackage with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSolFunctionPackage 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 *Tnb) DeleteSolFunctionPackageWithContext(ctx aws.Context, input *DeleteSolFunctionPackageInput, opts ...request.Option) (*DeleteSolFunctionPackageOutput, error) { - req, out := c.DeleteSolFunctionPackageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSolNetworkInstance = "DeleteSolNetworkInstance" - -// DeleteSolNetworkInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSolNetworkInstance 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 DeleteSolNetworkInstance for more information on using the DeleteSolNetworkInstance -// 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 DeleteSolNetworkInstanceRequest method. -// req, resp := client.DeleteSolNetworkInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/DeleteSolNetworkInstance -func (c *Tnb) DeleteSolNetworkInstanceRequest(input *DeleteSolNetworkInstanceInput) (req *request.Request, output *DeleteSolNetworkInstanceOutput) { - op := &request.Operation{ - Name: opDeleteSolNetworkInstance, - HTTPMethod: "DELETE", - HTTPPath: "/sol/nslcm/v1/ns_instances/{nsInstanceId}", - } - - if input == nil { - input = &DeleteSolNetworkInstanceInput{} - } - - output = &DeleteSolNetworkInstanceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSolNetworkInstance API operation for AWS Telco Network Builder. -// -// Deletes a network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -// -// To delete a network instance, the instance must be in a stopped or terminated -// state. To terminate a network instance, see TerminateSolNetworkInstance (https://docs.aws.amazon.com/tnb/latest/APIReference/API_TerminateSolNetworkInstance.html). -// -// 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 AWS Telco Network Builder's -// API operation DeleteSolNetworkInstance for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/DeleteSolNetworkInstance -func (c *Tnb) DeleteSolNetworkInstance(input *DeleteSolNetworkInstanceInput) (*DeleteSolNetworkInstanceOutput, error) { - req, out := c.DeleteSolNetworkInstanceRequest(input) - return out, req.Send() -} - -// DeleteSolNetworkInstanceWithContext is the same as DeleteSolNetworkInstance with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSolNetworkInstance 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 *Tnb) DeleteSolNetworkInstanceWithContext(ctx aws.Context, input *DeleteSolNetworkInstanceInput, opts ...request.Option) (*DeleteSolNetworkInstanceOutput, error) { - req, out := c.DeleteSolNetworkInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteSolNetworkPackage = "DeleteSolNetworkPackage" - -// DeleteSolNetworkPackageRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSolNetworkPackage 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 DeleteSolNetworkPackage for more information on using the DeleteSolNetworkPackage -// 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 DeleteSolNetworkPackageRequest method. -// req, resp := client.DeleteSolNetworkPackageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/DeleteSolNetworkPackage -func (c *Tnb) DeleteSolNetworkPackageRequest(input *DeleteSolNetworkPackageInput) (req *request.Request, output *DeleteSolNetworkPackageOutput) { - op := &request.Operation{ - Name: opDeleteSolNetworkPackage, - HTTPMethod: "DELETE", - HTTPPath: "/sol/nsd/v1/ns_descriptors/{nsdInfoId}", - } - - if input == nil { - input = &DeleteSolNetworkPackageInput{} - } - - output = &DeleteSolNetworkPackageOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteSolNetworkPackage API operation for AWS Telco Network Builder. -// -// Deletes network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -// -// To delete a network package, the package must be in a disable state. To disable -// a network package, see UpdateSolNetworkPackage (https://docs.aws.amazon.com/tnb/latest/APIReference/API_UpdateSolNetworkPackage.html). -// -// 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 AWS Telco Network Builder's -// API operation DeleteSolNetworkPackage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/DeleteSolNetworkPackage -func (c *Tnb) DeleteSolNetworkPackage(input *DeleteSolNetworkPackageInput) (*DeleteSolNetworkPackageOutput, error) { - req, out := c.DeleteSolNetworkPackageRequest(input) - return out, req.Send() -} - -// DeleteSolNetworkPackageWithContext is the same as DeleteSolNetworkPackage with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteSolNetworkPackage 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 *Tnb) DeleteSolNetworkPackageWithContext(ctx aws.Context, input *DeleteSolNetworkPackageInput, opts ...request.Option) (*DeleteSolNetworkPackageOutput, error) { - req, out := c.DeleteSolNetworkPackageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolFunctionInstance = "GetSolFunctionInstance" - -// GetSolFunctionInstanceRequest generates a "aws/request.Request" representing the -// client's request for the GetSolFunctionInstance 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 GetSolFunctionInstance for more information on using the GetSolFunctionInstance -// 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 GetSolFunctionInstanceRequest method. -// req, resp := client.GetSolFunctionInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolFunctionInstance -func (c *Tnb) GetSolFunctionInstanceRequest(input *GetSolFunctionInstanceInput) (req *request.Request, output *GetSolFunctionInstanceOutput) { - op := &request.Operation{ - Name: opGetSolFunctionInstance, - HTTPMethod: "GET", - HTTPPath: "/sol/vnflcm/v1/vnf_instances/{vnfInstanceId}", - } - - if input == nil { - input = &GetSolFunctionInstanceInput{} - } - - output = &GetSolFunctionInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolFunctionInstance API operation for AWS Telco Network Builder. -// -// Gets the details of a network function instance, including the instantation -// state and metadata from the function package descriptor in the network function -// package. -// -// A network function instance is a function in a function package . -// -// 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 AWS Telco Network Builder's -// API operation GetSolFunctionInstance for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolFunctionInstance -func (c *Tnb) GetSolFunctionInstance(input *GetSolFunctionInstanceInput) (*GetSolFunctionInstanceOutput, error) { - req, out := c.GetSolFunctionInstanceRequest(input) - return out, req.Send() -} - -// GetSolFunctionInstanceWithContext is the same as GetSolFunctionInstance with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolFunctionInstance 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 *Tnb) GetSolFunctionInstanceWithContext(ctx aws.Context, input *GetSolFunctionInstanceInput, opts ...request.Option) (*GetSolFunctionInstanceOutput, error) { - req, out := c.GetSolFunctionInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolFunctionPackage = "GetSolFunctionPackage" - -// GetSolFunctionPackageRequest generates a "aws/request.Request" representing the -// client's request for the GetSolFunctionPackage 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 GetSolFunctionPackage for more information on using the GetSolFunctionPackage -// 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 GetSolFunctionPackageRequest method. -// req, resp := client.GetSolFunctionPackageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolFunctionPackage -func (c *Tnb) GetSolFunctionPackageRequest(input *GetSolFunctionPackageInput) (req *request.Request, output *GetSolFunctionPackageOutput) { - op := &request.Operation{ - Name: opGetSolFunctionPackage, - HTTPMethod: "GET", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}", - } - - if input == nil { - input = &GetSolFunctionPackageInput{} - } - - output = &GetSolFunctionPackageOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolFunctionPackage API operation for AWS Telco Network Builder. -// -// Gets the details of an individual function package, such as the operational -// state and whether the package is in use. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network.. -// -// 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 AWS Telco Network Builder's -// API operation GetSolFunctionPackage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolFunctionPackage -func (c *Tnb) GetSolFunctionPackage(input *GetSolFunctionPackageInput) (*GetSolFunctionPackageOutput, error) { - req, out := c.GetSolFunctionPackageRequest(input) - return out, req.Send() -} - -// GetSolFunctionPackageWithContext is the same as GetSolFunctionPackage with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolFunctionPackage 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 *Tnb) GetSolFunctionPackageWithContext(ctx aws.Context, input *GetSolFunctionPackageInput, opts ...request.Option) (*GetSolFunctionPackageOutput, error) { - req, out := c.GetSolFunctionPackageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolFunctionPackageContent = "GetSolFunctionPackageContent" - -// GetSolFunctionPackageContentRequest generates a "aws/request.Request" representing the -// client's request for the GetSolFunctionPackageContent 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 GetSolFunctionPackageContent for more information on using the GetSolFunctionPackageContent -// 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 GetSolFunctionPackageContentRequest method. -// req, resp := client.GetSolFunctionPackageContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolFunctionPackageContent -func (c *Tnb) GetSolFunctionPackageContentRequest(input *GetSolFunctionPackageContentInput) (req *request.Request, output *GetSolFunctionPackageContentOutput) { - op := &request.Operation{ - Name: opGetSolFunctionPackageContent, - HTTPMethod: "GET", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content", - } - - if input == nil { - input = &GetSolFunctionPackageContentInput{} - } - - output = &GetSolFunctionPackageContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolFunctionPackageContent API operation for AWS Telco Network Builder. -// -// Gets the contents of a function package. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -// -// 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 AWS Telco Network Builder's -// API operation GetSolFunctionPackageContent for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolFunctionPackageContent -func (c *Tnb) GetSolFunctionPackageContent(input *GetSolFunctionPackageContentInput) (*GetSolFunctionPackageContentOutput, error) { - req, out := c.GetSolFunctionPackageContentRequest(input) - return out, req.Send() -} - -// GetSolFunctionPackageContentWithContext is the same as GetSolFunctionPackageContent with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolFunctionPackageContent 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 *Tnb) GetSolFunctionPackageContentWithContext(ctx aws.Context, input *GetSolFunctionPackageContentInput, opts ...request.Option) (*GetSolFunctionPackageContentOutput, error) { - req, out := c.GetSolFunctionPackageContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolFunctionPackageDescriptor = "GetSolFunctionPackageDescriptor" - -// GetSolFunctionPackageDescriptorRequest generates a "aws/request.Request" representing the -// client's request for the GetSolFunctionPackageDescriptor 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 GetSolFunctionPackageDescriptor for more information on using the GetSolFunctionPackageDescriptor -// 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 GetSolFunctionPackageDescriptorRequest method. -// req, resp := client.GetSolFunctionPackageDescriptorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolFunctionPackageDescriptor -func (c *Tnb) GetSolFunctionPackageDescriptorRequest(input *GetSolFunctionPackageDescriptorInput) (req *request.Request, output *GetSolFunctionPackageDescriptorOutput) { - op := &request.Operation{ - Name: opGetSolFunctionPackageDescriptor, - HTTPMethod: "GET", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}/vnfd", - } - - if input == nil { - input = &GetSolFunctionPackageDescriptorInput{} - } - - output = &GetSolFunctionPackageDescriptorOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolFunctionPackageDescriptor API operation for AWS Telco Network Builder. -// -// Gets a function package descriptor in a function package. -// -// A function package descriptor is a .yaml file in a function package that -// uses the TOSCA standard to describe how the network function in the function -// package should run on your network. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -// -// 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 AWS Telco Network Builder's -// API operation GetSolFunctionPackageDescriptor for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolFunctionPackageDescriptor -func (c *Tnb) GetSolFunctionPackageDescriptor(input *GetSolFunctionPackageDescriptorInput) (*GetSolFunctionPackageDescriptorOutput, error) { - req, out := c.GetSolFunctionPackageDescriptorRequest(input) - return out, req.Send() -} - -// GetSolFunctionPackageDescriptorWithContext is the same as GetSolFunctionPackageDescriptor with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolFunctionPackageDescriptor 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 *Tnb) GetSolFunctionPackageDescriptorWithContext(ctx aws.Context, input *GetSolFunctionPackageDescriptorInput, opts ...request.Option) (*GetSolFunctionPackageDescriptorOutput, error) { - req, out := c.GetSolFunctionPackageDescriptorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolNetworkInstance = "GetSolNetworkInstance" - -// GetSolNetworkInstanceRequest generates a "aws/request.Request" representing the -// client's request for the GetSolNetworkInstance 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 GetSolNetworkInstance for more information on using the GetSolNetworkInstance -// 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 GetSolNetworkInstanceRequest method. -// req, resp := client.GetSolNetworkInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkInstance -func (c *Tnb) GetSolNetworkInstanceRequest(input *GetSolNetworkInstanceInput) (req *request.Request, output *GetSolNetworkInstanceOutput) { - op := &request.Operation{ - Name: opGetSolNetworkInstance, - HTTPMethod: "GET", - HTTPPath: "/sol/nslcm/v1/ns_instances/{nsInstanceId}", - } - - if input == nil { - input = &GetSolNetworkInstanceInput{} - } - - output = &GetSolNetworkInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolNetworkInstance API operation for AWS Telco Network Builder. -// -// Gets the details of the network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -// -// 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 AWS Telco Network Builder's -// API operation GetSolNetworkInstance for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkInstance -func (c *Tnb) GetSolNetworkInstance(input *GetSolNetworkInstanceInput) (*GetSolNetworkInstanceOutput, error) { - req, out := c.GetSolNetworkInstanceRequest(input) - return out, req.Send() -} - -// GetSolNetworkInstanceWithContext is the same as GetSolNetworkInstance with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolNetworkInstance 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 *Tnb) GetSolNetworkInstanceWithContext(ctx aws.Context, input *GetSolNetworkInstanceInput, opts ...request.Option) (*GetSolNetworkInstanceOutput, error) { - req, out := c.GetSolNetworkInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolNetworkOperation = "GetSolNetworkOperation" - -// GetSolNetworkOperationRequest generates a "aws/request.Request" representing the -// client's request for the GetSolNetworkOperation 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 GetSolNetworkOperation for more information on using the GetSolNetworkOperation -// 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 GetSolNetworkOperationRequest method. -// req, resp := client.GetSolNetworkOperationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkOperation -func (c *Tnb) GetSolNetworkOperationRequest(input *GetSolNetworkOperationInput) (req *request.Request, output *GetSolNetworkOperationOutput) { - op := &request.Operation{ - Name: opGetSolNetworkOperation, - HTTPMethod: "GET", - HTTPPath: "/sol/nslcm/v1/ns_lcm_op_occs/{nsLcmOpOccId}", - } - - if input == nil { - input = &GetSolNetworkOperationInput{} - } - - output = &GetSolNetworkOperationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolNetworkOperation API operation for AWS Telco Network Builder. -// -// Gets the details of a network operation, including the tasks involved in -// the network operation and the status of the tasks. -// -// A network operation is any operation that is done to your network, such as -// network instance instantiation or termination. -// -// 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 AWS Telco Network Builder's -// API operation GetSolNetworkOperation for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkOperation -func (c *Tnb) GetSolNetworkOperation(input *GetSolNetworkOperationInput) (*GetSolNetworkOperationOutput, error) { - req, out := c.GetSolNetworkOperationRequest(input) - return out, req.Send() -} - -// GetSolNetworkOperationWithContext is the same as GetSolNetworkOperation with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolNetworkOperation 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 *Tnb) GetSolNetworkOperationWithContext(ctx aws.Context, input *GetSolNetworkOperationInput, opts ...request.Option) (*GetSolNetworkOperationOutput, error) { - req, out := c.GetSolNetworkOperationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolNetworkPackage = "GetSolNetworkPackage" - -// GetSolNetworkPackageRequest generates a "aws/request.Request" representing the -// client's request for the GetSolNetworkPackage 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 GetSolNetworkPackage for more information on using the GetSolNetworkPackage -// 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 GetSolNetworkPackageRequest method. -// req, resp := client.GetSolNetworkPackageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkPackage -func (c *Tnb) GetSolNetworkPackageRequest(input *GetSolNetworkPackageInput) (req *request.Request, output *GetSolNetworkPackageOutput) { - op := &request.Operation{ - Name: opGetSolNetworkPackage, - HTTPMethod: "GET", - HTTPPath: "/sol/nsd/v1/ns_descriptors/{nsdInfoId}", - } - - if input == nil { - input = &GetSolNetworkPackageInput{} - } - - output = &GetSolNetworkPackageOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolNetworkPackage API operation for AWS Telco Network Builder. -// -// Gets the details of a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -// -// 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 AWS Telco Network Builder's -// API operation GetSolNetworkPackage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkPackage -func (c *Tnb) GetSolNetworkPackage(input *GetSolNetworkPackageInput) (*GetSolNetworkPackageOutput, error) { - req, out := c.GetSolNetworkPackageRequest(input) - return out, req.Send() -} - -// GetSolNetworkPackageWithContext is the same as GetSolNetworkPackage with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolNetworkPackage 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 *Tnb) GetSolNetworkPackageWithContext(ctx aws.Context, input *GetSolNetworkPackageInput, opts ...request.Option) (*GetSolNetworkPackageOutput, error) { - req, out := c.GetSolNetworkPackageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolNetworkPackageContent = "GetSolNetworkPackageContent" - -// GetSolNetworkPackageContentRequest generates a "aws/request.Request" representing the -// client's request for the GetSolNetworkPackageContent 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 GetSolNetworkPackageContent for more information on using the GetSolNetworkPackageContent -// 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 GetSolNetworkPackageContentRequest method. -// req, resp := client.GetSolNetworkPackageContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkPackageContent -func (c *Tnb) GetSolNetworkPackageContentRequest(input *GetSolNetworkPackageContentInput) (req *request.Request, output *GetSolNetworkPackageContentOutput) { - op := &request.Operation{ - Name: opGetSolNetworkPackageContent, - HTTPMethod: "GET", - HTTPPath: "/sol/nsd/v1/ns_descriptors/{nsdInfoId}/nsd_content", - } - - if input == nil { - input = &GetSolNetworkPackageContentInput{} - } - - output = &GetSolNetworkPackageContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolNetworkPackageContent API operation for AWS Telco Network Builder. -// -// Gets the contents of a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -// -// 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 AWS Telco Network Builder's -// API operation GetSolNetworkPackageContent for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkPackageContent -func (c *Tnb) GetSolNetworkPackageContent(input *GetSolNetworkPackageContentInput) (*GetSolNetworkPackageContentOutput, error) { - req, out := c.GetSolNetworkPackageContentRequest(input) - return out, req.Send() -} - -// GetSolNetworkPackageContentWithContext is the same as GetSolNetworkPackageContent with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolNetworkPackageContent 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 *Tnb) GetSolNetworkPackageContentWithContext(ctx aws.Context, input *GetSolNetworkPackageContentInput, opts ...request.Option) (*GetSolNetworkPackageContentOutput, error) { - req, out := c.GetSolNetworkPackageContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSolNetworkPackageDescriptor = "GetSolNetworkPackageDescriptor" - -// GetSolNetworkPackageDescriptorRequest generates a "aws/request.Request" representing the -// client's request for the GetSolNetworkPackageDescriptor 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 GetSolNetworkPackageDescriptor for more information on using the GetSolNetworkPackageDescriptor -// 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 GetSolNetworkPackageDescriptorRequest method. -// req, resp := client.GetSolNetworkPackageDescriptorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkPackageDescriptor -func (c *Tnb) GetSolNetworkPackageDescriptorRequest(input *GetSolNetworkPackageDescriptorInput) (req *request.Request, output *GetSolNetworkPackageDescriptorOutput) { - op := &request.Operation{ - Name: opGetSolNetworkPackageDescriptor, - HTTPMethod: "GET", - HTTPPath: "/sol/nsd/v1/ns_descriptors/{nsdInfoId}/nsd", - } - - if input == nil { - input = &GetSolNetworkPackageDescriptorInput{} - } - - output = &GetSolNetworkPackageDescriptorOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSolNetworkPackageDescriptor API operation for AWS Telco Network Builder. -// -// Gets the content of the network service descriptor. -// -// A network service descriptor is a .yaml file in a network package that uses -// the TOSCA standard to describe the network functions you want to deploy and -// the Amazon Web Services infrastructure you want to deploy the network functions -// on. -// -// 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 AWS Telco Network Builder's -// API operation GetSolNetworkPackageDescriptor for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/GetSolNetworkPackageDescriptor -func (c *Tnb) GetSolNetworkPackageDescriptor(input *GetSolNetworkPackageDescriptorInput) (*GetSolNetworkPackageDescriptorOutput, error) { - req, out := c.GetSolNetworkPackageDescriptorRequest(input) - return out, req.Send() -} - -// GetSolNetworkPackageDescriptorWithContext is the same as GetSolNetworkPackageDescriptor with the addition of -// the ability to pass a context and additional request options. -// -// See GetSolNetworkPackageDescriptor 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 *Tnb) GetSolNetworkPackageDescriptorWithContext(ctx aws.Context, input *GetSolNetworkPackageDescriptorInput, opts ...request.Option) (*GetSolNetworkPackageDescriptorOutput, error) { - req, out := c.GetSolNetworkPackageDescriptorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInstantiateSolNetworkInstance = "InstantiateSolNetworkInstance" - -// InstantiateSolNetworkInstanceRequest generates a "aws/request.Request" representing the -// client's request for the InstantiateSolNetworkInstance 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 InstantiateSolNetworkInstance for more information on using the InstantiateSolNetworkInstance -// 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 InstantiateSolNetworkInstanceRequest method. -// req, resp := client.InstantiateSolNetworkInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/InstantiateSolNetworkInstance -func (c *Tnb) InstantiateSolNetworkInstanceRequest(input *InstantiateSolNetworkInstanceInput) (req *request.Request, output *InstantiateSolNetworkInstanceOutput) { - op := &request.Operation{ - Name: opInstantiateSolNetworkInstance, - HTTPMethod: "POST", - HTTPPath: "/sol/nslcm/v1/ns_instances/{nsInstanceId}/instantiate", - } - - if input == nil { - input = &InstantiateSolNetworkInstanceInput{} - } - - output = &InstantiateSolNetworkInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// InstantiateSolNetworkInstance API operation for AWS Telco Network Builder. -// -// Instantiates a network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -// -// Before you can instantiate a network instance, you have to create a network -// instance. For more information, see CreateSolNetworkInstance (https://docs.aws.amazon.com/tnb/latest/APIReference/API_CreateSolNetworkInstance.html). -// -// 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 AWS Telco Network Builder's -// API operation InstantiateSolNetworkInstance for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ServiceQuotaExceededException -// Service quotas have been exceeded. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/InstantiateSolNetworkInstance -func (c *Tnb) InstantiateSolNetworkInstance(input *InstantiateSolNetworkInstanceInput) (*InstantiateSolNetworkInstanceOutput, error) { - req, out := c.InstantiateSolNetworkInstanceRequest(input) - return out, req.Send() -} - -// InstantiateSolNetworkInstanceWithContext is the same as InstantiateSolNetworkInstance with the addition of -// the ability to pass a context and additional request options. -// -// See InstantiateSolNetworkInstance 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 *Tnb) InstantiateSolNetworkInstanceWithContext(ctx aws.Context, input *InstantiateSolNetworkInstanceInput, opts ...request.Option) (*InstantiateSolNetworkInstanceOutput, error) { - req, out := c.InstantiateSolNetworkInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListSolFunctionInstances = "ListSolFunctionInstances" - -// ListSolFunctionInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListSolFunctionInstances 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 ListSolFunctionInstances for more information on using the ListSolFunctionInstances -// 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 ListSolFunctionInstancesRequest method. -// req, resp := client.ListSolFunctionInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolFunctionInstances -func (c *Tnb) ListSolFunctionInstancesRequest(input *ListSolFunctionInstancesInput) (req *request.Request, output *ListSolFunctionInstancesOutput) { - op := &request.Operation{ - Name: opListSolFunctionInstances, - HTTPMethod: "GET", - HTTPPath: "/sol/vnflcm/v1/vnf_instances", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSolFunctionInstancesInput{} - } - - output = &ListSolFunctionInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSolFunctionInstances API operation for AWS Telco Network Builder. -// -// Lists network function instances. -// -// A network function instance is a function in a function package . -// -// 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 AWS Telco Network Builder's -// API operation ListSolFunctionInstances for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolFunctionInstances -func (c *Tnb) ListSolFunctionInstances(input *ListSolFunctionInstancesInput) (*ListSolFunctionInstancesOutput, error) { - req, out := c.ListSolFunctionInstancesRequest(input) - return out, req.Send() -} - -// ListSolFunctionInstancesWithContext is the same as ListSolFunctionInstances with the addition of -// the ability to pass a context and additional request options. -// -// See ListSolFunctionInstances 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 *Tnb) ListSolFunctionInstancesWithContext(ctx aws.Context, input *ListSolFunctionInstancesInput, opts ...request.Option) (*ListSolFunctionInstancesOutput, error) { - req, out := c.ListSolFunctionInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSolFunctionInstancesPages iterates over the pages of a ListSolFunctionInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSolFunctionInstances method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSolFunctionInstances operation. -// pageNum := 0 -// err := client.ListSolFunctionInstancesPages(params, -// func(page *tnb.ListSolFunctionInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Tnb) ListSolFunctionInstancesPages(input *ListSolFunctionInstancesInput, fn func(*ListSolFunctionInstancesOutput, bool) bool) error { - return c.ListSolFunctionInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSolFunctionInstancesPagesWithContext same as ListSolFunctionInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Tnb) ListSolFunctionInstancesPagesWithContext(ctx aws.Context, input *ListSolFunctionInstancesInput, fn func(*ListSolFunctionInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSolFunctionInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSolFunctionInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSolFunctionInstancesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSolFunctionPackages = "ListSolFunctionPackages" - -// ListSolFunctionPackagesRequest generates a "aws/request.Request" representing the -// client's request for the ListSolFunctionPackages 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 ListSolFunctionPackages for more information on using the ListSolFunctionPackages -// 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 ListSolFunctionPackagesRequest method. -// req, resp := client.ListSolFunctionPackagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolFunctionPackages -func (c *Tnb) ListSolFunctionPackagesRequest(input *ListSolFunctionPackagesInput) (req *request.Request, output *ListSolFunctionPackagesOutput) { - op := &request.Operation{ - Name: opListSolFunctionPackages, - HTTPMethod: "GET", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSolFunctionPackagesInput{} - } - - output = &ListSolFunctionPackagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSolFunctionPackages API operation for AWS Telco Network Builder. -// -// Lists information about function packages. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -// -// 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 AWS Telco Network Builder's -// API operation ListSolFunctionPackages for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolFunctionPackages -func (c *Tnb) ListSolFunctionPackages(input *ListSolFunctionPackagesInput) (*ListSolFunctionPackagesOutput, error) { - req, out := c.ListSolFunctionPackagesRequest(input) - return out, req.Send() -} - -// ListSolFunctionPackagesWithContext is the same as ListSolFunctionPackages with the addition of -// the ability to pass a context and additional request options. -// -// See ListSolFunctionPackages 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 *Tnb) ListSolFunctionPackagesWithContext(ctx aws.Context, input *ListSolFunctionPackagesInput, opts ...request.Option) (*ListSolFunctionPackagesOutput, error) { - req, out := c.ListSolFunctionPackagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSolFunctionPackagesPages iterates over the pages of a ListSolFunctionPackages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSolFunctionPackages method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSolFunctionPackages operation. -// pageNum := 0 -// err := client.ListSolFunctionPackagesPages(params, -// func(page *tnb.ListSolFunctionPackagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Tnb) ListSolFunctionPackagesPages(input *ListSolFunctionPackagesInput, fn func(*ListSolFunctionPackagesOutput, bool) bool) error { - return c.ListSolFunctionPackagesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSolFunctionPackagesPagesWithContext same as ListSolFunctionPackagesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Tnb) ListSolFunctionPackagesPagesWithContext(ctx aws.Context, input *ListSolFunctionPackagesInput, fn func(*ListSolFunctionPackagesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSolFunctionPackagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSolFunctionPackagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSolFunctionPackagesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSolNetworkInstances = "ListSolNetworkInstances" - -// ListSolNetworkInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListSolNetworkInstances 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 ListSolNetworkInstances for more information on using the ListSolNetworkInstances -// 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 ListSolNetworkInstancesRequest method. -// req, resp := client.ListSolNetworkInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolNetworkInstances -func (c *Tnb) ListSolNetworkInstancesRequest(input *ListSolNetworkInstancesInput) (req *request.Request, output *ListSolNetworkInstancesOutput) { - op := &request.Operation{ - Name: opListSolNetworkInstances, - HTTPMethod: "GET", - HTTPPath: "/sol/nslcm/v1/ns_instances", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSolNetworkInstancesInput{} - } - - output = &ListSolNetworkInstancesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSolNetworkInstances API operation for AWS Telco Network Builder. -// -// Lists your network instances. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -// -// 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 AWS Telco Network Builder's -// API operation ListSolNetworkInstances for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolNetworkInstances -func (c *Tnb) ListSolNetworkInstances(input *ListSolNetworkInstancesInput) (*ListSolNetworkInstancesOutput, error) { - req, out := c.ListSolNetworkInstancesRequest(input) - return out, req.Send() -} - -// ListSolNetworkInstancesWithContext is the same as ListSolNetworkInstances with the addition of -// the ability to pass a context and additional request options. -// -// See ListSolNetworkInstances 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 *Tnb) ListSolNetworkInstancesWithContext(ctx aws.Context, input *ListSolNetworkInstancesInput, opts ...request.Option) (*ListSolNetworkInstancesOutput, error) { - req, out := c.ListSolNetworkInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSolNetworkInstancesPages iterates over the pages of a ListSolNetworkInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSolNetworkInstances method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSolNetworkInstances operation. -// pageNum := 0 -// err := client.ListSolNetworkInstancesPages(params, -// func(page *tnb.ListSolNetworkInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Tnb) ListSolNetworkInstancesPages(input *ListSolNetworkInstancesInput, fn func(*ListSolNetworkInstancesOutput, bool) bool) error { - return c.ListSolNetworkInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSolNetworkInstancesPagesWithContext same as ListSolNetworkInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Tnb) ListSolNetworkInstancesPagesWithContext(ctx aws.Context, input *ListSolNetworkInstancesInput, fn func(*ListSolNetworkInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSolNetworkInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSolNetworkInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSolNetworkInstancesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSolNetworkOperations = "ListSolNetworkOperations" - -// ListSolNetworkOperationsRequest generates a "aws/request.Request" representing the -// client's request for the ListSolNetworkOperations 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 ListSolNetworkOperations for more information on using the ListSolNetworkOperations -// 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 ListSolNetworkOperationsRequest method. -// req, resp := client.ListSolNetworkOperationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolNetworkOperations -func (c *Tnb) ListSolNetworkOperationsRequest(input *ListSolNetworkOperationsInput) (req *request.Request, output *ListSolNetworkOperationsOutput) { - op := &request.Operation{ - Name: opListSolNetworkOperations, - HTTPMethod: "GET", - HTTPPath: "/sol/nslcm/v1/ns_lcm_op_occs", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSolNetworkOperationsInput{} - } - - output = &ListSolNetworkOperationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSolNetworkOperations API operation for AWS Telco Network Builder. -// -// Lists details for a network operation, including when the operation started -// and the status of the operation. -// -// A network operation is any operation that is done to your network, such as -// network instance instantiation or termination. -// -// 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 AWS Telco Network Builder's -// API operation ListSolNetworkOperations for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolNetworkOperations -func (c *Tnb) ListSolNetworkOperations(input *ListSolNetworkOperationsInput) (*ListSolNetworkOperationsOutput, error) { - req, out := c.ListSolNetworkOperationsRequest(input) - return out, req.Send() -} - -// ListSolNetworkOperationsWithContext is the same as ListSolNetworkOperations with the addition of -// the ability to pass a context and additional request options. -// -// See ListSolNetworkOperations 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 *Tnb) ListSolNetworkOperationsWithContext(ctx aws.Context, input *ListSolNetworkOperationsInput, opts ...request.Option) (*ListSolNetworkOperationsOutput, error) { - req, out := c.ListSolNetworkOperationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSolNetworkOperationsPages iterates over the pages of a ListSolNetworkOperations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSolNetworkOperations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSolNetworkOperations operation. -// pageNum := 0 -// err := client.ListSolNetworkOperationsPages(params, -// func(page *tnb.ListSolNetworkOperationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Tnb) ListSolNetworkOperationsPages(input *ListSolNetworkOperationsInput, fn func(*ListSolNetworkOperationsOutput, bool) bool) error { - return c.ListSolNetworkOperationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSolNetworkOperationsPagesWithContext same as ListSolNetworkOperationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Tnb) ListSolNetworkOperationsPagesWithContext(ctx aws.Context, input *ListSolNetworkOperationsInput, fn func(*ListSolNetworkOperationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSolNetworkOperationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSolNetworkOperationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSolNetworkOperationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSolNetworkPackages = "ListSolNetworkPackages" - -// ListSolNetworkPackagesRequest generates a "aws/request.Request" representing the -// client's request for the ListSolNetworkPackages 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 ListSolNetworkPackages for more information on using the ListSolNetworkPackages -// 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 ListSolNetworkPackagesRequest method. -// req, resp := client.ListSolNetworkPackagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolNetworkPackages -func (c *Tnb) ListSolNetworkPackagesRequest(input *ListSolNetworkPackagesInput) (req *request.Request, output *ListSolNetworkPackagesOutput) { - op := &request.Operation{ - Name: opListSolNetworkPackages, - HTTPMethod: "GET", - HTTPPath: "/sol/nsd/v1/ns_descriptors", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSolNetworkPackagesInput{} - } - - output = &ListSolNetworkPackagesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListSolNetworkPackages API operation for AWS Telco Network Builder. -// -// Lists network packages. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -// -// 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 AWS Telco Network Builder's -// API operation ListSolNetworkPackages for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListSolNetworkPackages -func (c *Tnb) ListSolNetworkPackages(input *ListSolNetworkPackagesInput) (*ListSolNetworkPackagesOutput, error) { - req, out := c.ListSolNetworkPackagesRequest(input) - return out, req.Send() -} - -// ListSolNetworkPackagesWithContext is the same as ListSolNetworkPackages with the addition of -// the ability to pass a context and additional request options. -// -// See ListSolNetworkPackages 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 *Tnb) ListSolNetworkPackagesWithContext(ctx aws.Context, input *ListSolNetworkPackagesInput, opts ...request.Option) (*ListSolNetworkPackagesOutput, error) { - req, out := c.ListSolNetworkPackagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSolNetworkPackagesPages iterates over the pages of a ListSolNetworkPackages operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSolNetworkPackages method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSolNetworkPackages operation. -// pageNum := 0 -// err := client.ListSolNetworkPackagesPages(params, -// func(page *tnb.ListSolNetworkPackagesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Tnb) ListSolNetworkPackagesPages(input *ListSolNetworkPackagesInput, fn func(*ListSolNetworkPackagesOutput, bool) bool) error { - return c.ListSolNetworkPackagesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSolNetworkPackagesPagesWithContext same as ListSolNetworkPackagesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *Tnb) ListSolNetworkPackagesPagesWithContext(ctx aws.Context, input *ListSolNetworkPackagesInput, fn func(*ListSolNetworkPackagesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSolNetworkPackagesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSolNetworkPackagesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSolNetworkPackagesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListTagsForResource -func (c *Tnb) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Telco Network Builder. -// -// Lists tags for AWS TNB resources. -// -// 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 AWS Telco Network Builder's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ListTagsForResource -func (c *Tnb) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *Tnb) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutSolFunctionPackageContent = "PutSolFunctionPackageContent" - -// PutSolFunctionPackageContentRequest generates a "aws/request.Request" representing the -// client's request for the PutSolFunctionPackageContent 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 PutSolFunctionPackageContent for more information on using the PutSolFunctionPackageContent -// 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 PutSolFunctionPackageContentRequest method. -// req, resp := client.PutSolFunctionPackageContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/PutSolFunctionPackageContent -func (c *Tnb) PutSolFunctionPackageContentRequest(input *PutSolFunctionPackageContentInput) (req *request.Request, output *PutSolFunctionPackageContentOutput) { - op := &request.Operation{ - Name: opPutSolFunctionPackageContent, - HTTPMethod: "PUT", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content", - } - - if input == nil { - input = &PutSolFunctionPackageContentInput{} - } - - output = &PutSolFunctionPackageContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutSolFunctionPackageContent API operation for AWS Telco Network Builder. -// -// Uploads the contents of a function package. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -// -// 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 AWS Telco Network Builder's -// API operation PutSolFunctionPackageContent for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/PutSolFunctionPackageContent -func (c *Tnb) PutSolFunctionPackageContent(input *PutSolFunctionPackageContentInput) (*PutSolFunctionPackageContentOutput, error) { - req, out := c.PutSolFunctionPackageContentRequest(input) - return out, req.Send() -} - -// PutSolFunctionPackageContentWithContext is the same as PutSolFunctionPackageContent with the addition of -// the ability to pass a context and additional request options. -// -// See PutSolFunctionPackageContent 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 *Tnb) PutSolFunctionPackageContentWithContext(ctx aws.Context, input *PutSolFunctionPackageContentInput, opts ...request.Option) (*PutSolFunctionPackageContentOutput, error) { - req, out := c.PutSolFunctionPackageContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutSolNetworkPackageContent = "PutSolNetworkPackageContent" - -// PutSolNetworkPackageContentRequest generates a "aws/request.Request" representing the -// client's request for the PutSolNetworkPackageContent 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 PutSolNetworkPackageContent for more information on using the PutSolNetworkPackageContent -// 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 PutSolNetworkPackageContentRequest method. -// req, resp := client.PutSolNetworkPackageContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/PutSolNetworkPackageContent -func (c *Tnb) PutSolNetworkPackageContentRequest(input *PutSolNetworkPackageContentInput) (req *request.Request, output *PutSolNetworkPackageContentOutput) { - op := &request.Operation{ - Name: opPutSolNetworkPackageContent, - HTTPMethod: "PUT", - HTTPPath: "/sol/nsd/v1/ns_descriptors/{nsdInfoId}/nsd_content", - } - - if input == nil { - input = &PutSolNetworkPackageContentInput{} - } - - output = &PutSolNetworkPackageContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutSolNetworkPackageContent API operation for AWS Telco Network Builder. -// -// Uploads the contents of a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -// -// 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 AWS Telco Network Builder's -// API operation PutSolNetworkPackageContent for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/PutSolNetworkPackageContent -func (c *Tnb) PutSolNetworkPackageContent(input *PutSolNetworkPackageContentInput) (*PutSolNetworkPackageContentOutput, error) { - req, out := c.PutSolNetworkPackageContentRequest(input) - return out, req.Send() -} - -// PutSolNetworkPackageContentWithContext is the same as PutSolNetworkPackageContent with the addition of -// the ability to pass a context and additional request options. -// -// See PutSolNetworkPackageContent 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 *Tnb) PutSolNetworkPackageContentWithContext(ctx aws.Context, input *PutSolNetworkPackageContentInput, opts ...request.Option) (*PutSolNetworkPackageContentOutput, error) { - req, out := c.PutSolNetworkPackageContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/TagResource -func (c *Tnb) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Telco Network Builder. -// -// Tags an AWS TNB resource. -// -// A tag is a label that you assign to an Amazon Web Services resource. Each -// tag consists of a key and an optional value. You can use tags to search and -// filter your resources or track your Amazon Web Services costs. -// -// 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 AWS Telco Network Builder's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/TagResource -func (c *Tnb) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *Tnb) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTerminateSolNetworkInstance = "TerminateSolNetworkInstance" - -// TerminateSolNetworkInstanceRequest generates a "aws/request.Request" representing the -// client's request for the TerminateSolNetworkInstance 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 TerminateSolNetworkInstance for more information on using the TerminateSolNetworkInstance -// 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 TerminateSolNetworkInstanceRequest method. -// req, resp := client.TerminateSolNetworkInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/TerminateSolNetworkInstance -func (c *Tnb) TerminateSolNetworkInstanceRequest(input *TerminateSolNetworkInstanceInput) (req *request.Request, output *TerminateSolNetworkInstanceOutput) { - op := &request.Operation{ - Name: opTerminateSolNetworkInstance, - HTTPMethod: "POST", - HTTPPath: "/sol/nslcm/v1/ns_instances/{nsInstanceId}/terminate", - } - - if input == nil { - input = &TerminateSolNetworkInstanceInput{} - } - - output = &TerminateSolNetworkInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// TerminateSolNetworkInstance API operation for AWS Telco Network Builder. -// -// Terminates a network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -// -// You must terminate a network instance before you can delete it. -// -// 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 AWS Telco Network Builder's -// API operation TerminateSolNetworkInstance for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ServiceQuotaExceededException -// Service quotas have been exceeded. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/TerminateSolNetworkInstance -func (c *Tnb) TerminateSolNetworkInstance(input *TerminateSolNetworkInstanceInput) (*TerminateSolNetworkInstanceOutput, error) { - req, out := c.TerminateSolNetworkInstanceRequest(input) - return out, req.Send() -} - -// TerminateSolNetworkInstanceWithContext is the same as TerminateSolNetworkInstance with the addition of -// the ability to pass a context and additional request options. -// -// See TerminateSolNetworkInstance 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 *Tnb) TerminateSolNetworkInstanceWithContext(ctx aws.Context, input *TerminateSolNetworkInstanceInput, opts ...request.Option) (*TerminateSolNetworkInstanceOutput, error) { - req, out := c.TerminateSolNetworkInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/UntagResource -func (c *Tnb) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Telco Network Builder. -// -// Untags an AWS TNB resource. -// -// A tag is a label that you assign to an Amazon Web Services resource. Each -// tag consists of a key and an optional value. You can use tags to search and -// filter your resources or track your Amazon Web Services costs. -// -// 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 AWS Telco Network Builder's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/UntagResource -func (c *Tnb) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *Tnb) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSolFunctionPackage = "UpdateSolFunctionPackage" - -// UpdateSolFunctionPackageRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSolFunctionPackage 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 UpdateSolFunctionPackage for more information on using the UpdateSolFunctionPackage -// 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 UpdateSolFunctionPackageRequest method. -// req, resp := client.UpdateSolFunctionPackageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/UpdateSolFunctionPackage -func (c *Tnb) UpdateSolFunctionPackageRequest(input *UpdateSolFunctionPackageInput) (req *request.Request, output *UpdateSolFunctionPackageOutput) { - op := &request.Operation{ - Name: opUpdateSolFunctionPackage, - HTTPMethod: "PATCH", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}", - } - - if input == nil { - input = &UpdateSolFunctionPackageInput{} - } - - output = &UpdateSolFunctionPackageOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSolFunctionPackage API operation for AWS Telco Network Builder. -// -// Updates the operational state of function package. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -// -// 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 AWS Telco Network Builder's -// API operation UpdateSolFunctionPackage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/UpdateSolFunctionPackage -func (c *Tnb) UpdateSolFunctionPackage(input *UpdateSolFunctionPackageInput) (*UpdateSolFunctionPackageOutput, error) { - req, out := c.UpdateSolFunctionPackageRequest(input) - return out, req.Send() -} - -// UpdateSolFunctionPackageWithContext is the same as UpdateSolFunctionPackage with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSolFunctionPackage 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 *Tnb) UpdateSolFunctionPackageWithContext(ctx aws.Context, input *UpdateSolFunctionPackageInput, opts ...request.Option) (*UpdateSolFunctionPackageOutput, error) { - req, out := c.UpdateSolFunctionPackageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSolNetworkInstance = "UpdateSolNetworkInstance" - -// UpdateSolNetworkInstanceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSolNetworkInstance 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 UpdateSolNetworkInstance for more information on using the UpdateSolNetworkInstance -// 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 UpdateSolNetworkInstanceRequest method. -// req, resp := client.UpdateSolNetworkInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/UpdateSolNetworkInstance -func (c *Tnb) UpdateSolNetworkInstanceRequest(input *UpdateSolNetworkInstanceInput) (req *request.Request, output *UpdateSolNetworkInstanceOutput) { - op := &request.Operation{ - Name: opUpdateSolNetworkInstance, - HTTPMethod: "POST", - HTTPPath: "/sol/nslcm/v1/ns_instances/{nsInstanceId}/update", - } - - if input == nil { - input = &UpdateSolNetworkInstanceInput{} - } - - output = &UpdateSolNetworkInstanceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSolNetworkInstance API operation for AWS Telco Network Builder. -// -// Update a network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -// -// 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 AWS Telco Network Builder's -// API operation UpdateSolNetworkInstance for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ServiceQuotaExceededException -// Service quotas have been exceeded. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/UpdateSolNetworkInstance -func (c *Tnb) UpdateSolNetworkInstance(input *UpdateSolNetworkInstanceInput) (*UpdateSolNetworkInstanceOutput, error) { - req, out := c.UpdateSolNetworkInstanceRequest(input) - return out, req.Send() -} - -// UpdateSolNetworkInstanceWithContext is the same as UpdateSolNetworkInstance with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSolNetworkInstance 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 *Tnb) UpdateSolNetworkInstanceWithContext(ctx aws.Context, input *UpdateSolNetworkInstanceInput, opts ...request.Option) (*UpdateSolNetworkInstanceOutput, error) { - req, out := c.UpdateSolNetworkInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSolNetworkPackage = "UpdateSolNetworkPackage" - -// UpdateSolNetworkPackageRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSolNetworkPackage 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 UpdateSolNetworkPackage for more information on using the UpdateSolNetworkPackage -// 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 UpdateSolNetworkPackageRequest method. -// req, resp := client.UpdateSolNetworkPackageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/UpdateSolNetworkPackage -func (c *Tnb) UpdateSolNetworkPackageRequest(input *UpdateSolNetworkPackageInput) (req *request.Request, output *UpdateSolNetworkPackageOutput) { - op := &request.Operation{ - Name: opUpdateSolNetworkPackage, - HTTPMethod: "PATCH", - HTTPPath: "/sol/nsd/v1/ns_descriptors/{nsdInfoId}", - } - - if input == nil { - input = &UpdateSolNetworkPackageInput{} - } - - output = &UpdateSolNetworkPackageOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateSolNetworkPackage API operation for AWS Telco Network Builder. -// -// Updates the operational state of a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -// -// A network service descriptor is a .yaml file in a network package that uses -// the TOSCA standard to describe the network functions you want to deploy and -// the Amazon Web Services infrastructure you want to deploy the network functions -// on. -// -// 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 AWS Telco Network Builder's -// API operation UpdateSolNetworkPackage for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/UpdateSolNetworkPackage -func (c *Tnb) UpdateSolNetworkPackage(input *UpdateSolNetworkPackageInput) (*UpdateSolNetworkPackageOutput, error) { - req, out := c.UpdateSolNetworkPackageRequest(input) - return out, req.Send() -} - -// UpdateSolNetworkPackageWithContext is the same as UpdateSolNetworkPackage with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSolNetworkPackage 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 *Tnb) UpdateSolNetworkPackageWithContext(ctx aws.Context, input *UpdateSolNetworkPackageInput, opts ...request.Option) (*UpdateSolNetworkPackageOutput, error) { - req, out := c.UpdateSolNetworkPackageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opValidateSolFunctionPackageContent = "ValidateSolFunctionPackageContent" - -// ValidateSolFunctionPackageContentRequest generates a "aws/request.Request" representing the -// client's request for the ValidateSolFunctionPackageContent 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 ValidateSolFunctionPackageContent for more information on using the ValidateSolFunctionPackageContent -// 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 ValidateSolFunctionPackageContentRequest method. -// req, resp := client.ValidateSolFunctionPackageContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ValidateSolFunctionPackageContent -func (c *Tnb) ValidateSolFunctionPackageContentRequest(input *ValidateSolFunctionPackageContentInput) (req *request.Request, output *ValidateSolFunctionPackageContentOutput) { - op := &request.Operation{ - Name: opValidateSolFunctionPackageContent, - HTTPMethod: "PUT", - HTTPPath: "/sol/vnfpkgm/v1/vnf_packages/{vnfPkgId}/package_content/validate", - } - - if input == nil { - input = &ValidateSolFunctionPackageContentInput{} - } - - output = &ValidateSolFunctionPackageContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// ValidateSolFunctionPackageContent API operation for AWS Telco Network Builder. -// -// Validates function package content. This can be used as a dry run before -// uploading function package content with PutSolFunctionPackageContent (https://docs.aws.amazon.com/tnb/latest/APIReference/API_PutSolFunctionPackageContent.html). -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -// -// 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 AWS Telco Network Builder's -// API operation ValidateSolFunctionPackageContent for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ValidateSolFunctionPackageContent -func (c *Tnb) ValidateSolFunctionPackageContent(input *ValidateSolFunctionPackageContentInput) (*ValidateSolFunctionPackageContentOutput, error) { - req, out := c.ValidateSolFunctionPackageContentRequest(input) - return out, req.Send() -} - -// ValidateSolFunctionPackageContentWithContext is the same as ValidateSolFunctionPackageContent with the addition of -// the ability to pass a context and additional request options. -// -// See ValidateSolFunctionPackageContent 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 *Tnb) ValidateSolFunctionPackageContentWithContext(ctx aws.Context, input *ValidateSolFunctionPackageContentInput, opts ...request.Option) (*ValidateSolFunctionPackageContentOutput, error) { - req, out := c.ValidateSolFunctionPackageContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opValidateSolNetworkPackageContent = "ValidateSolNetworkPackageContent" - -// ValidateSolNetworkPackageContentRequest generates a "aws/request.Request" representing the -// client's request for the ValidateSolNetworkPackageContent 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 ValidateSolNetworkPackageContent for more information on using the ValidateSolNetworkPackageContent -// 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 ValidateSolNetworkPackageContentRequest method. -// req, resp := client.ValidateSolNetworkPackageContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ValidateSolNetworkPackageContent -func (c *Tnb) ValidateSolNetworkPackageContentRequest(input *ValidateSolNetworkPackageContentInput) (req *request.Request, output *ValidateSolNetworkPackageContentOutput) { - op := &request.Operation{ - Name: opValidateSolNetworkPackageContent, - HTTPMethod: "PUT", - HTTPPath: "/sol/nsd/v1/ns_descriptors/{nsdInfoId}/nsd_content/validate", - } - - if input == nil { - input = &ValidateSolNetworkPackageContentInput{} - } - - output = &ValidateSolNetworkPackageContentOutput{} - req = c.newRequest(op, input, output) - return -} - -// ValidateSolNetworkPackageContent API operation for AWS Telco Network Builder. -// -// Validates network package content. This can be used as a dry run before uploading -// network package content with PutSolNetworkPackageContent (https://docs.aws.amazon.com/tnb/latest/APIReference/API_PutSolNetworkPackageContent.html). -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -// -// 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 AWS Telco Network Builder's -// API operation ValidateSolNetworkPackageContent for usage and error information. -// -// Returned Error Types: -// -// - InternalServerException -// Unexpected error occurred. Problem on the server. -// -// - ThrottlingException -// Exception caused by throttling. -// -// - ValidationException -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -// -// - ResourceNotFoundException -// Request references a resource that doesn't exist. -// -// - AccessDeniedException -// Insufficient permissions to make request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21/ValidateSolNetworkPackageContent -func (c *Tnb) ValidateSolNetworkPackageContent(input *ValidateSolNetworkPackageContentInput) (*ValidateSolNetworkPackageContentOutput, error) { - req, out := c.ValidateSolNetworkPackageContentRequest(input) - return out, req.Send() -} - -// ValidateSolNetworkPackageContentWithContext is the same as ValidateSolNetworkPackageContent with the addition of -// the ability to pass a context and additional request options. -// -// See ValidateSolNetworkPackageContent 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 *Tnb) ValidateSolNetworkPackageContentWithContext(ctx aws.Context, input *ValidateSolNetworkPackageContentInput, opts ...request.Option) (*ValidateSolNetworkPackageContentOutput, error) { - req, out := c.ValidateSolNetworkPackageContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Insufficient permissions to make request. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CancelSolNetworkOperationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the network operation. - // - // NsLcmOpOccId is a required field - NsLcmOpOccId *string `location:"uri" locationName:"nsLcmOpOccId" 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 CancelSolNetworkOperationInput) 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 CancelSolNetworkOperationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelSolNetworkOperationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelSolNetworkOperationInput"} - if s.NsLcmOpOccId == nil { - invalidParams.Add(request.NewErrParamRequired("NsLcmOpOccId")) - } - if s.NsLcmOpOccId != nil && len(*s.NsLcmOpOccId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsLcmOpOccId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsLcmOpOccId sets the NsLcmOpOccId field's value. -func (s *CancelSolNetworkOperationInput) SetNsLcmOpOccId(v string) *CancelSolNetworkOperationInput { - s.NsLcmOpOccId = &v - return s -} - -type CancelSolNetworkOperationOutput 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 CancelSolNetworkOperationOutput) 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 CancelSolNetworkOperationOutput) GoString() string { - return s.String() -} - -type CreateSolFunctionPackageInput struct { - _ struct{} `type:"structure"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSolFunctionPackageInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 CreateSolFunctionPackageInput) 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 CreateSolFunctionPackageInput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *CreateSolFunctionPackageInput) SetTags(v map[string]*string) *CreateSolFunctionPackageInput { - s.Tags = v - return s -} - -type CreateSolFunctionPackageOutput struct { - _ struct{} `type:"structure"` - - // Function package ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // ID of the function package. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Onboarding state of the function package. - // - // OnboardingState is a required field - OnboardingState *string `locationName:"onboardingState" type:"string" required:"true" enum:"OnboardingState"` - - // Operational state of the function package. - // - // OperationalState is a required field - OperationalState *string `locationName:"operationalState" type:"string" required:"true" enum:"OperationalState"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSolFunctionPackageOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"true"` - - // Usage state of the function package. - // - // UsageState is a required field - UsageState *string `locationName:"usageState" type:"string" required:"true" enum:"UsageState"` -} - -// 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 CreateSolFunctionPackageOutput) 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 CreateSolFunctionPackageOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateSolFunctionPackageOutput) SetArn(v string) *CreateSolFunctionPackageOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSolFunctionPackageOutput) SetId(v string) *CreateSolFunctionPackageOutput { - s.Id = &v - return s -} - -// SetOnboardingState sets the OnboardingState field's value. -func (s *CreateSolFunctionPackageOutput) SetOnboardingState(v string) *CreateSolFunctionPackageOutput { - s.OnboardingState = &v - return s -} - -// SetOperationalState sets the OperationalState field's value. -func (s *CreateSolFunctionPackageOutput) SetOperationalState(v string) *CreateSolFunctionPackageOutput { - s.OperationalState = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSolFunctionPackageOutput) SetTags(v map[string]*string) *CreateSolFunctionPackageOutput { - s.Tags = v - return s -} - -// SetUsageState sets the UsageState field's value. -func (s *CreateSolFunctionPackageOutput) SetUsageState(v string) *CreateSolFunctionPackageOutput { - s.UsageState = &v - return s -} - -type CreateSolNetworkInstanceInput struct { - _ struct{} `type:"structure"` - - // Network instance description. - NsDescription *string `locationName:"nsDescription" type:"string"` - - // Network instance name. - // - // NsName is a required field - NsName *string `locationName:"nsName" min:"1" type:"string" required:"true"` - - // ID for network service descriptor. - // - // NsdInfoId is a required field - NsdInfoId *string `locationName:"nsdInfoId" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSolNetworkInstanceInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 CreateSolNetworkInstanceInput) 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 CreateSolNetworkInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSolNetworkInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSolNetworkInstanceInput"} - if s.NsName == nil { - invalidParams.Add(request.NewErrParamRequired("NsName")) - } - if s.NsName != nil && len(*s.NsName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsName", 1)) - } - if s.NsdInfoId == nil { - invalidParams.Add(request.NewErrParamRequired("NsdInfoId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsDescription sets the NsDescription field's value. -func (s *CreateSolNetworkInstanceInput) SetNsDescription(v string) *CreateSolNetworkInstanceInput { - s.NsDescription = &v - return s -} - -// SetNsName sets the NsName field's value. -func (s *CreateSolNetworkInstanceInput) SetNsName(v string) *CreateSolNetworkInstanceInput { - s.NsName = &v - return s -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *CreateSolNetworkInstanceInput) SetNsdInfoId(v string) *CreateSolNetworkInstanceInput { - s.NsdInfoId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSolNetworkInstanceInput) SetTags(v map[string]*string) *CreateSolNetworkInstanceInput { - s.Tags = v - return s -} - -type CreateSolNetworkInstanceOutput struct { - _ struct{} `type:"structure"` - - // Network instance ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Network instance ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Network instance name. - // - // NsInstanceName is a required field - NsInstanceName *string `locationName:"nsInstanceName" type:"string" required:"true"` - - // Network service descriptor ID. - // - // NsdInfoId is a required field - NsdInfoId *string `locationName:"nsdInfoId" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSolNetworkInstanceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 CreateSolNetworkInstanceOutput) 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 CreateSolNetworkInstanceOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateSolNetworkInstanceOutput) SetArn(v string) *CreateSolNetworkInstanceOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSolNetworkInstanceOutput) SetId(v string) *CreateSolNetworkInstanceOutput { - s.Id = &v - return s -} - -// SetNsInstanceName sets the NsInstanceName field's value. -func (s *CreateSolNetworkInstanceOutput) SetNsInstanceName(v string) *CreateSolNetworkInstanceOutput { - s.NsInstanceName = &v - return s -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *CreateSolNetworkInstanceOutput) SetNsdInfoId(v string) *CreateSolNetworkInstanceOutput { - s.NsdInfoId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSolNetworkInstanceOutput) SetTags(v map[string]*string) *CreateSolNetworkInstanceOutput { - s.Tags = v - return s -} - -type CreateSolNetworkPackageInput struct { - _ struct{} `type:"structure"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSolNetworkPackageInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 CreateSolNetworkPackageInput) 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 CreateSolNetworkPackageInput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *CreateSolNetworkPackageInput) SetTags(v map[string]*string) *CreateSolNetworkPackageInput { - s.Tags = v - return s -} - -type CreateSolNetworkPackageOutput struct { - _ struct{} `type:"structure"` - - // Network package ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // ID of the network package. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Onboarding state of the network service descriptor in the network package. - // - // NsdOnboardingState is a required field - NsdOnboardingState *string `locationName:"nsdOnboardingState" type:"string" required:"true" enum:"NsdOnboardingState"` - - // Operational state of the network service descriptor in the network package. - // - // NsdOperationalState is a required field - NsdOperationalState *string `locationName:"nsdOperationalState" type:"string" required:"true" enum:"NsdOperationalState"` - - // Usage state of the network service descriptor in the network package. - // - // NsdUsageState is a required field - NsdUsageState *string `locationName:"nsdUsageState" type:"string" required:"true" enum:"NsdUsageState"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateSolNetworkPackageOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 CreateSolNetworkPackageOutput) 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 CreateSolNetworkPackageOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateSolNetworkPackageOutput) SetArn(v string) *CreateSolNetworkPackageOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateSolNetworkPackageOutput) SetId(v string) *CreateSolNetworkPackageOutput { - s.Id = &v - return s -} - -// SetNsdOnboardingState sets the NsdOnboardingState field's value. -func (s *CreateSolNetworkPackageOutput) SetNsdOnboardingState(v string) *CreateSolNetworkPackageOutput { - s.NsdOnboardingState = &v - return s -} - -// SetNsdOperationalState sets the NsdOperationalState field's value. -func (s *CreateSolNetworkPackageOutput) SetNsdOperationalState(v string) *CreateSolNetworkPackageOutput { - s.NsdOperationalState = &v - return s -} - -// SetNsdUsageState sets the NsdUsageState field's value. -func (s *CreateSolNetworkPackageOutput) SetNsdUsageState(v string) *CreateSolNetworkPackageOutput { - s.NsdUsageState = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateSolNetworkPackageOutput) SetTags(v map[string]*string) *CreateSolNetworkPackageOutput { - s.Tags = v - return s -} - -type DeleteSolFunctionPackageInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ID of the function package. - // - // VnfPkgId is a required field - VnfPkgId *string `location:"uri" locationName:"vnfPkgId" 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 DeleteSolFunctionPackageInput) 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 DeleteSolFunctionPackageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSolFunctionPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSolFunctionPackageInput"} - if s.VnfPkgId == nil { - invalidParams.Add(request.NewErrParamRequired("VnfPkgId")) - } - if s.VnfPkgId != nil && len(*s.VnfPkgId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VnfPkgId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *DeleteSolFunctionPackageInput) SetVnfPkgId(v string) *DeleteSolFunctionPackageInput { - s.VnfPkgId = &v - return s -} - -type DeleteSolFunctionPackageOutput 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 DeleteSolFunctionPackageOutput) 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 DeleteSolFunctionPackageOutput) GoString() string { - return s.String() -} - -type DeleteSolNetworkInstanceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Network instance ID. - // - // NsInstanceId is a required field - NsInstanceId *string `location:"uri" locationName:"nsInstanceId" 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 DeleteSolNetworkInstanceInput) 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 DeleteSolNetworkInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSolNetworkInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSolNetworkInstanceInput"} - if s.NsInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("NsInstanceId")) - } - if s.NsInstanceId != nil && len(*s.NsInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *DeleteSolNetworkInstanceInput) SetNsInstanceId(v string) *DeleteSolNetworkInstanceInput { - s.NsInstanceId = &v - return s -} - -type DeleteSolNetworkInstanceOutput 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 DeleteSolNetworkInstanceOutput) 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 DeleteSolNetworkInstanceOutput) GoString() string { - return s.String() -} - -type DeleteSolNetworkPackageInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ID of the network service descriptor in the network package. - // - // NsdInfoId is a required field - NsdInfoId *string `location:"uri" locationName:"nsdInfoId" 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 DeleteSolNetworkPackageInput) 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 DeleteSolNetworkPackageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSolNetworkPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSolNetworkPackageInput"} - if s.NsdInfoId == nil { - invalidParams.Add(request.NewErrParamRequired("NsdInfoId")) - } - if s.NsdInfoId != nil && len(*s.NsdInfoId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsdInfoId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *DeleteSolNetworkPackageInput) SetNsdInfoId(v string) *DeleteSolNetworkPackageInput { - s.NsdInfoId = &v - return s -} - -type DeleteSolNetworkPackageOutput 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 DeleteSolNetworkPackageOutput) 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 DeleteSolNetworkPackageOutput) GoString() string { - return s.String() -} - -// Provides error information. -type ErrorInfo struct { - _ struct{} `type:"structure"` - - // Error cause. - Cause *string `locationName:"cause" min:"1" type:"string"` - - // Error details. - Details *string `locationName:"details" 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 ErrorInfo) 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 ErrorInfo) GoString() string { - return s.String() -} - -// SetCause sets the Cause field's value. -func (s *ErrorInfo) SetCause(v string) *ErrorInfo { - s.Cause = &v - return s -} - -// SetDetails sets the Details field's value. -func (s *ErrorInfo) SetDetails(v string) *ErrorInfo { - s.Details = &v - return s -} - -// Metadata for function package artifacts. -// -// Artifacts are the contents of the package descriptor file and the state of -// the package. -type FunctionArtifactMeta struct { - _ struct{} `type:"structure"` - - // Lists of function package overrides. - Overrides []*ToscaOverride `locationName:"overrides" type:"list"` -} - -// 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 FunctionArtifactMeta) 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 FunctionArtifactMeta) GoString() string { - return s.String() -} - -// SetOverrides sets the Overrides field's value. -func (s *FunctionArtifactMeta) SetOverrides(v []*ToscaOverride) *FunctionArtifactMeta { - s.Overrides = v - return s -} - -type GetSolFunctionInstanceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ID of the network function. - // - // VnfInstanceId is a required field - VnfInstanceId *string `location:"uri" locationName:"vnfInstanceId" 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 GetSolFunctionInstanceInput) 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 GetSolFunctionInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolFunctionInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolFunctionInstanceInput"} - if s.VnfInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("VnfInstanceId")) - } - if s.VnfInstanceId != nil && len(*s.VnfInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VnfInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVnfInstanceId sets the VnfInstanceId field's value. -func (s *GetSolFunctionInstanceInput) SetVnfInstanceId(v string) *GetSolFunctionInstanceInput { - s.VnfInstanceId = &v - return s -} - -// The metadata of a network function instance. -// -// A network function instance is a function in a function package . -type GetSolFunctionInstanceMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" 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 GetSolFunctionInstanceMetadata) 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 GetSolFunctionInstanceMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSolFunctionInstanceMetadata) SetCreatedAt(v time.Time) *GetSolFunctionInstanceMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *GetSolFunctionInstanceMetadata) SetLastModified(v time.Time) *GetSolFunctionInstanceMetadata { - s.LastModified = &v - return s -} - -type GetSolFunctionInstanceOutput struct { - _ struct{} `type:"structure"` - - // Network function instance ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Network function instance ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Information about the network function. - // - // A network function instance is a function in a function package . - InstantiatedVnfInfo *GetSolVnfInfo `locationName:"instantiatedVnfInfo" type:"structure"` - - // Network function instantiation state. - // - // InstantiationState is a required field - InstantiationState *string `locationName:"instantiationState" type:"string" required:"true" enum:"VnfInstantiationState"` - - // The metadata of a network function instance. - // - // A network function instance is a function in a function package . - // - // Metadata is a required field - Metadata *GetSolFunctionInstanceMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Network instance ID. - // - // NsInstanceId is a required field - NsInstanceId *string `locationName:"nsInstanceId" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSolFunctionInstanceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"true"` - - // Function package ID. - // - // VnfPkgId is a required field - VnfPkgId *string `locationName:"vnfPkgId" type:"string" required:"true"` - - // Network function product name. - VnfProductName *string `locationName:"vnfProductName" type:"string"` - - // Network function provider. - VnfProvider *string `locationName:"vnfProvider" type:"string"` - - // Function package descriptor ID. - // - // VnfdId is a required field - VnfdId *string `locationName:"vnfdId" type:"string" required:"true"` - - // Function package descriptor version. - VnfdVersion *string `locationName:"vnfdVersion" 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 GetSolFunctionInstanceOutput) 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 GetSolFunctionInstanceOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSolFunctionInstanceOutput) SetArn(v string) *GetSolFunctionInstanceOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSolFunctionInstanceOutput) SetId(v string) *GetSolFunctionInstanceOutput { - s.Id = &v - return s -} - -// SetInstantiatedVnfInfo sets the InstantiatedVnfInfo field's value. -func (s *GetSolFunctionInstanceOutput) SetInstantiatedVnfInfo(v *GetSolVnfInfo) *GetSolFunctionInstanceOutput { - s.InstantiatedVnfInfo = v - return s -} - -// SetInstantiationState sets the InstantiationState field's value. -func (s *GetSolFunctionInstanceOutput) SetInstantiationState(v string) *GetSolFunctionInstanceOutput { - s.InstantiationState = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetSolFunctionInstanceOutput) SetMetadata(v *GetSolFunctionInstanceMetadata) *GetSolFunctionInstanceOutput { - s.Metadata = v - return s -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *GetSolFunctionInstanceOutput) SetNsInstanceId(v string) *GetSolFunctionInstanceOutput { - s.NsInstanceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetSolFunctionInstanceOutput) SetTags(v map[string]*string) *GetSolFunctionInstanceOutput { - s.Tags = v - return s -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *GetSolFunctionInstanceOutput) SetVnfPkgId(v string) *GetSolFunctionInstanceOutput { - s.VnfPkgId = &v - return s -} - -// SetVnfProductName sets the VnfProductName field's value. -func (s *GetSolFunctionInstanceOutput) SetVnfProductName(v string) *GetSolFunctionInstanceOutput { - s.VnfProductName = &v - return s -} - -// SetVnfProvider sets the VnfProvider field's value. -func (s *GetSolFunctionInstanceOutput) SetVnfProvider(v string) *GetSolFunctionInstanceOutput { - s.VnfProvider = &v - return s -} - -// SetVnfdId sets the VnfdId field's value. -func (s *GetSolFunctionInstanceOutput) SetVnfdId(v string) *GetSolFunctionInstanceOutput { - s.VnfdId = &v - return s -} - -// SetVnfdVersion sets the VnfdVersion field's value. -func (s *GetSolFunctionInstanceOutput) SetVnfdVersion(v string) *GetSolFunctionInstanceOutput { - s.VnfdVersion = &v - return s -} - -type GetSolFunctionPackageContentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The format of the package that you want to download from the function packages. - // - // Accept is a required field - Accept *string `location:"header" locationName:"Accept" type:"string" required:"true" enum:"PackageContentType"` - - // ID of the function package. - // - // VnfPkgId is a required field - VnfPkgId *string `location:"uri" locationName:"vnfPkgId" 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 GetSolFunctionPackageContentInput) 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 GetSolFunctionPackageContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolFunctionPackageContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolFunctionPackageContentInput"} - if s.Accept == nil { - invalidParams.Add(request.NewErrParamRequired("Accept")) - } - if s.VnfPkgId == nil { - invalidParams.Add(request.NewErrParamRequired("VnfPkgId")) - } - if s.VnfPkgId != nil && len(*s.VnfPkgId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VnfPkgId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccept sets the Accept field's value. -func (s *GetSolFunctionPackageContentInput) SetAccept(v string) *GetSolFunctionPackageContentInput { - s.Accept = &v - return s -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *GetSolFunctionPackageContentInput) SetVnfPkgId(v string) *GetSolFunctionPackageContentInput { - s.VnfPkgId = &v - return s -} - -type GetSolFunctionPackageContentOutput struct { - _ struct{} `type:"structure" payload:"PackageContent"` - - // Indicates the media type of the resource. - ContentType *string `location:"header" locationName:"Content-Type" type:"string" enum:"PackageContentType"` - - // Contents of the function package. - PackageContent []byte `locationName:"packageContent" type:"blob"` -} - -// 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 GetSolFunctionPackageContentOutput) 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 GetSolFunctionPackageContentOutput) GoString() string { - return s.String() -} - -// SetContentType sets the ContentType field's value. -func (s *GetSolFunctionPackageContentOutput) SetContentType(v string) *GetSolFunctionPackageContentOutput { - s.ContentType = &v - return s -} - -// SetPackageContent sets the PackageContent field's value. -func (s *GetSolFunctionPackageContentOutput) SetPackageContent(v []byte) *GetSolFunctionPackageContentOutput { - s.PackageContent = v - return s -} - -type GetSolFunctionPackageDescriptorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Indicates which content types, expressed as MIME types, the client is able - // to understand. - // - // Accept is a required field - Accept *string `location:"header" locationName:"Accept" type:"string" required:"true" enum:"DescriptorContentType"` - - // ID of the function package. - // - // VnfPkgId is a required field - VnfPkgId *string `location:"uri" locationName:"vnfPkgId" 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 GetSolFunctionPackageDescriptorInput) 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 GetSolFunctionPackageDescriptorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolFunctionPackageDescriptorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolFunctionPackageDescriptorInput"} - if s.Accept == nil { - invalidParams.Add(request.NewErrParamRequired("Accept")) - } - if s.VnfPkgId == nil { - invalidParams.Add(request.NewErrParamRequired("VnfPkgId")) - } - if s.VnfPkgId != nil && len(*s.VnfPkgId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VnfPkgId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccept sets the Accept field's value. -func (s *GetSolFunctionPackageDescriptorInput) SetAccept(v string) *GetSolFunctionPackageDescriptorInput { - s.Accept = &v - return s -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *GetSolFunctionPackageDescriptorInput) SetVnfPkgId(v string) *GetSolFunctionPackageDescriptorInput { - s.VnfPkgId = &v - return s -} - -type GetSolFunctionPackageDescriptorOutput struct { - _ struct{} `type:"structure" payload:"Vnfd"` - - // Indicates the media type of the resource. - ContentType *string `location:"header" locationName:"Content-Type" type:"string" enum:"DescriptorContentType"` - - // Contents of the function package descriptor. - Vnfd []byte `locationName:"vnfd" type:"blob"` -} - -// 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 GetSolFunctionPackageDescriptorOutput) 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 GetSolFunctionPackageDescriptorOutput) GoString() string { - return s.String() -} - -// SetContentType sets the ContentType field's value. -func (s *GetSolFunctionPackageDescriptorOutput) SetContentType(v string) *GetSolFunctionPackageDescriptorOutput { - s.ContentType = &v - return s -} - -// SetVnfd sets the Vnfd field's value. -func (s *GetSolFunctionPackageDescriptorOutput) SetVnfd(v []byte) *GetSolFunctionPackageDescriptorOutput { - s.Vnfd = v - return s -} - -type GetSolFunctionPackageInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ID of the function package. - // - // VnfPkgId is a required field - VnfPkgId *string `location:"uri" locationName:"vnfPkgId" 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 GetSolFunctionPackageInput) 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 GetSolFunctionPackageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolFunctionPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolFunctionPackageInput"} - if s.VnfPkgId == nil { - invalidParams.Add(request.NewErrParamRequired("VnfPkgId")) - } - if s.VnfPkgId != nil && len(*s.VnfPkgId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VnfPkgId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *GetSolFunctionPackageInput) SetVnfPkgId(v string) *GetSolFunctionPackageInput { - s.VnfPkgId = &v - return s -} - -// Metadata related to the function package. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -type GetSolFunctionPackageMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Metadata related to the function package descriptor of the function package. - Vnfd *FunctionArtifactMeta `locationName:"vnfd" 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 GetSolFunctionPackageMetadata) 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 GetSolFunctionPackageMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSolFunctionPackageMetadata) SetCreatedAt(v time.Time) *GetSolFunctionPackageMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *GetSolFunctionPackageMetadata) SetLastModified(v time.Time) *GetSolFunctionPackageMetadata { - s.LastModified = &v - return s -} - -// SetVnfd sets the Vnfd field's value. -func (s *GetSolFunctionPackageMetadata) SetVnfd(v *FunctionArtifactMeta) *GetSolFunctionPackageMetadata { - s.Vnfd = v - return s -} - -type GetSolFunctionPackageOutput struct { - _ struct{} `type:"structure"` - - // Function package ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Function package ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Metadata related to the function package. - // - // A function package is a .zip file in CSAR (Cloud Service Archive) format - // that contains a network function (an ETSI standard telecommunication application) - // and function package descriptor that uses the TOSCA standard to describe - // how the network functions should run on your network. - Metadata *GetSolFunctionPackageMetadata `locationName:"metadata" type:"structure"` - - // Function package onboarding state. - // - // OnboardingState is a required field - OnboardingState *string `locationName:"onboardingState" type:"string" required:"true" enum:"OnboardingState"` - - // Function package operational state. - // - // OperationalState is a required field - OperationalState *string `locationName:"operationalState" type:"string" required:"true" enum:"OperationalState"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSolFunctionPackageOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"true"` - - // Function package usage state. - // - // UsageState is a required field - UsageState *string `locationName:"usageState" type:"string" required:"true" enum:"UsageState"` - - // Network function product name. - VnfProductName *string `locationName:"vnfProductName" type:"string"` - - // Network function provider. - VnfProvider *string `locationName:"vnfProvider" type:"string"` - - // Function package descriptor ID. - VnfdId *string `locationName:"vnfdId" type:"string"` - - // Function package descriptor version. - VnfdVersion *string `locationName:"vnfdVersion" 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 GetSolFunctionPackageOutput) 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 GetSolFunctionPackageOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSolFunctionPackageOutput) SetArn(v string) *GetSolFunctionPackageOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSolFunctionPackageOutput) SetId(v string) *GetSolFunctionPackageOutput { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetSolFunctionPackageOutput) SetMetadata(v *GetSolFunctionPackageMetadata) *GetSolFunctionPackageOutput { - s.Metadata = v - return s -} - -// SetOnboardingState sets the OnboardingState field's value. -func (s *GetSolFunctionPackageOutput) SetOnboardingState(v string) *GetSolFunctionPackageOutput { - s.OnboardingState = &v - return s -} - -// SetOperationalState sets the OperationalState field's value. -func (s *GetSolFunctionPackageOutput) SetOperationalState(v string) *GetSolFunctionPackageOutput { - s.OperationalState = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetSolFunctionPackageOutput) SetTags(v map[string]*string) *GetSolFunctionPackageOutput { - s.Tags = v - return s -} - -// SetUsageState sets the UsageState field's value. -func (s *GetSolFunctionPackageOutput) SetUsageState(v string) *GetSolFunctionPackageOutput { - s.UsageState = &v - return s -} - -// SetVnfProductName sets the VnfProductName field's value. -func (s *GetSolFunctionPackageOutput) SetVnfProductName(v string) *GetSolFunctionPackageOutput { - s.VnfProductName = &v - return s -} - -// SetVnfProvider sets the VnfProvider field's value. -func (s *GetSolFunctionPackageOutput) SetVnfProvider(v string) *GetSolFunctionPackageOutput { - s.VnfProvider = &v - return s -} - -// SetVnfdId sets the VnfdId field's value. -func (s *GetSolFunctionPackageOutput) SetVnfdId(v string) *GetSolFunctionPackageOutput { - s.VnfdId = &v - return s -} - -// SetVnfdVersion sets the VnfdVersion field's value. -func (s *GetSolFunctionPackageOutput) SetVnfdVersion(v string) *GetSolFunctionPackageOutput { - s.VnfdVersion = &v - return s -} - -// Information about a network function. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -type GetSolInstantiatedVnfInfo struct { - _ struct{} `type:"structure"` - - // State of the network function. - VnfState *string `locationName:"vnfState" type:"string" enum:"VnfOperationalState"` -} - -// 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 GetSolInstantiatedVnfInfo) 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 GetSolInstantiatedVnfInfo) GoString() string { - return s.String() -} - -// SetVnfState sets the VnfState field's value. -func (s *GetSolInstantiatedVnfInfo) SetVnfState(v string) *GetSolInstantiatedVnfInfo { - s.VnfState = &v - return s -} - -type GetSolNetworkInstanceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ID of the network instance. - // - // NsInstanceId is a required field - NsInstanceId *string `location:"uri" locationName:"nsInstanceId" 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 GetSolNetworkInstanceInput) 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 GetSolNetworkInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolNetworkInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolNetworkInstanceInput"} - if s.NsInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("NsInstanceId")) - } - if s.NsInstanceId != nil && len(*s.NsInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *GetSolNetworkInstanceInput) SetNsInstanceId(v string) *GetSolNetworkInstanceInput { - s.NsInstanceId = &v - return s -} - -// The metadata of a network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -type GetSolNetworkInstanceMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" 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 GetSolNetworkInstanceMetadata) 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 GetSolNetworkInstanceMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSolNetworkInstanceMetadata) SetCreatedAt(v time.Time) *GetSolNetworkInstanceMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *GetSolNetworkInstanceMetadata) SetLastModified(v time.Time) *GetSolNetworkInstanceMetadata { - s.LastModified = &v - return s -} - -type GetSolNetworkInstanceOutput struct { - _ struct{} `type:"structure"` - - // Network instance ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Network instance ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Lifecycle management operation details on the network instance. - // - // Lifecycle management operations are deploy, update, or delete operations. - LcmOpInfo *LcmOperationInfo `locationName:"lcmOpInfo" type:"structure"` - - // The metadata of a network instance. - // - // A network instance is a single network created in Amazon Web Services TNB - // that can be deployed and on which life-cycle operations (like terminate, - // update, and delete) can be performed. - // - // Metadata is a required field - Metadata *GetSolNetworkInstanceMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Network instance description. - // - // NsInstanceDescription is a required field - NsInstanceDescription *string `locationName:"nsInstanceDescription" type:"string" required:"true"` - - // Network instance name. - // - // NsInstanceName is a required field - NsInstanceName *string `locationName:"nsInstanceName" type:"string" required:"true"` - - // Network instance state. - NsState *string `locationName:"nsState" type:"string" enum:"NsState"` - - // Network service descriptor ID. - // - // NsdId is a required field - NsdId *string `locationName:"nsdId" type:"string" required:"true"` - - // Network service descriptor info ID. - // - // NsdInfoId is a required field - NsdInfoId *string `locationName:"nsdInfoId" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSolNetworkInstanceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 GetSolNetworkInstanceOutput) 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 GetSolNetworkInstanceOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSolNetworkInstanceOutput) SetArn(v string) *GetSolNetworkInstanceOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSolNetworkInstanceOutput) SetId(v string) *GetSolNetworkInstanceOutput { - s.Id = &v - return s -} - -// SetLcmOpInfo sets the LcmOpInfo field's value. -func (s *GetSolNetworkInstanceOutput) SetLcmOpInfo(v *LcmOperationInfo) *GetSolNetworkInstanceOutput { - s.LcmOpInfo = v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetSolNetworkInstanceOutput) SetMetadata(v *GetSolNetworkInstanceMetadata) *GetSolNetworkInstanceOutput { - s.Metadata = v - return s -} - -// SetNsInstanceDescription sets the NsInstanceDescription field's value. -func (s *GetSolNetworkInstanceOutput) SetNsInstanceDescription(v string) *GetSolNetworkInstanceOutput { - s.NsInstanceDescription = &v - return s -} - -// SetNsInstanceName sets the NsInstanceName field's value. -func (s *GetSolNetworkInstanceOutput) SetNsInstanceName(v string) *GetSolNetworkInstanceOutput { - s.NsInstanceName = &v - return s -} - -// SetNsState sets the NsState field's value. -func (s *GetSolNetworkInstanceOutput) SetNsState(v string) *GetSolNetworkInstanceOutput { - s.NsState = &v - return s -} - -// SetNsdId sets the NsdId field's value. -func (s *GetSolNetworkInstanceOutput) SetNsdId(v string) *GetSolNetworkInstanceOutput { - s.NsdId = &v - return s -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *GetSolNetworkInstanceOutput) SetNsdInfoId(v string) *GetSolNetworkInstanceOutput { - s.NsdInfoId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetSolNetworkInstanceOutput) SetTags(v map[string]*string) *GetSolNetworkInstanceOutput { - s.Tags = v - return s -} - -type GetSolNetworkOperationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The identifier of the network operation. - // - // NsLcmOpOccId is a required field - NsLcmOpOccId *string `location:"uri" locationName:"nsLcmOpOccId" 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 GetSolNetworkOperationInput) 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 GetSolNetworkOperationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolNetworkOperationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolNetworkOperationInput"} - if s.NsLcmOpOccId == nil { - invalidParams.Add(request.NewErrParamRequired("NsLcmOpOccId")) - } - if s.NsLcmOpOccId != nil && len(*s.NsLcmOpOccId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsLcmOpOccId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsLcmOpOccId sets the NsLcmOpOccId field's value. -func (s *GetSolNetworkOperationInput) SetNsLcmOpOccId(v string) *GetSolNetworkOperationInput { - s.NsLcmOpOccId = &v - return s -} - -// Metadata related to a network operation occurrence. -// -// A network operation is any operation that is done to your network, such as -// network instance instantiation or termination. -type GetSolNetworkOperationMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" 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 GetSolNetworkOperationMetadata) 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 GetSolNetworkOperationMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSolNetworkOperationMetadata) SetCreatedAt(v time.Time) *GetSolNetworkOperationMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *GetSolNetworkOperationMetadata) SetLastModified(v time.Time) *GetSolNetworkOperationMetadata { - s.LastModified = &v - return s -} - -type GetSolNetworkOperationOutput struct { - _ struct{} `type:"structure"` - - // Network operation ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Error related to this specific network operation occurrence. - Error *ProblemDetails `locationName:"error" type:"structure"` - - // ID of this network operation occurrence. - Id *string `locationName:"id" type:"string"` - - // Type of the operation represented by this occurrence. - LcmOperationType *string `locationName:"lcmOperationType" type:"string" enum:"LcmOperationType"` - - // Metadata of this network operation occurrence. - Metadata *GetSolNetworkOperationMetadata `locationName:"metadata" type:"structure"` - - // ID of the network operation instance. - NsInstanceId *string `locationName:"nsInstanceId" type:"string"` - - // The state of the network operation. - OperationState *string `locationName:"operationState" type:"string" enum:"NsLcmOperationState"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSolNetworkOperationOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"true"` - - // All tasks associated with this operation occurrence. - Tasks []*GetSolNetworkOperationTaskDetails `locationName:"tasks" type:"list"` -} - -// 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 GetSolNetworkOperationOutput) 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 GetSolNetworkOperationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSolNetworkOperationOutput) SetArn(v string) *GetSolNetworkOperationOutput { - s.Arn = &v - return s -} - -// SetError sets the Error field's value. -func (s *GetSolNetworkOperationOutput) SetError(v *ProblemDetails) *GetSolNetworkOperationOutput { - s.Error = v - return s -} - -// SetId sets the Id field's value. -func (s *GetSolNetworkOperationOutput) SetId(v string) *GetSolNetworkOperationOutput { - s.Id = &v - return s -} - -// SetLcmOperationType sets the LcmOperationType field's value. -func (s *GetSolNetworkOperationOutput) SetLcmOperationType(v string) *GetSolNetworkOperationOutput { - s.LcmOperationType = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetSolNetworkOperationOutput) SetMetadata(v *GetSolNetworkOperationMetadata) *GetSolNetworkOperationOutput { - s.Metadata = v - return s -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *GetSolNetworkOperationOutput) SetNsInstanceId(v string) *GetSolNetworkOperationOutput { - s.NsInstanceId = &v - return s -} - -// SetOperationState sets the OperationState field's value. -func (s *GetSolNetworkOperationOutput) SetOperationState(v string) *GetSolNetworkOperationOutput { - s.OperationState = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetSolNetworkOperationOutput) SetTags(v map[string]*string) *GetSolNetworkOperationOutput { - s.Tags = v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *GetSolNetworkOperationOutput) SetTasks(v []*GetSolNetworkOperationTaskDetails) *GetSolNetworkOperationOutput { - s.Tasks = v - return s -} - -// Gets the details of a network operation. -// -// A network operation is any operation that is done to your network, such as -// network instance instantiation or termination. -type GetSolNetworkOperationTaskDetails struct { - _ struct{} `type:"structure"` - - // Context for the network operation task. - TaskContext map[string]*string `locationName:"taskContext" type:"map"` - - // Task end time. - TaskEndTime *time.Time `locationName:"taskEndTime" type:"timestamp" timestampFormat:"iso8601"` - - // Task error details. - TaskErrorDetails *ErrorInfo `locationName:"taskErrorDetails" type:"structure"` - - // Task name. - TaskName *string `locationName:"taskName" type:"string"` - - // Task start time. - TaskStartTime *time.Time `locationName:"taskStartTime" type:"timestamp" timestampFormat:"iso8601"` - - // Task status. - TaskStatus *string `locationName:"taskStatus" type:"string" enum:"TaskStatus"` -} - -// 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 GetSolNetworkOperationTaskDetails) 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 GetSolNetworkOperationTaskDetails) GoString() string { - return s.String() -} - -// SetTaskContext sets the TaskContext field's value. -func (s *GetSolNetworkOperationTaskDetails) SetTaskContext(v map[string]*string) *GetSolNetworkOperationTaskDetails { - s.TaskContext = v - return s -} - -// SetTaskEndTime sets the TaskEndTime field's value. -func (s *GetSolNetworkOperationTaskDetails) SetTaskEndTime(v time.Time) *GetSolNetworkOperationTaskDetails { - s.TaskEndTime = &v - return s -} - -// SetTaskErrorDetails sets the TaskErrorDetails field's value. -func (s *GetSolNetworkOperationTaskDetails) SetTaskErrorDetails(v *ErrorInfo) *GetSolNetworkOperationTaskDetails { - s.TaskErrorDetails = v - return s -} - -// SetTaskName sets the TaskName field's value. -func (s *GetSolNetworkOperationTaskDetails) SetTaskName(v string) *GetSolNetworkOperationTaskDetails { - s.TaskName = &v - return s -} - -// SetTaskStartTime sets the TaskStartTime field's value. -func (s *GetSolNetworkOperationTaskDetails) SetTaskStartTime(v time.Time) *GetSolNetworkOperationTaskDetails { - s.TaskStartTime = &v - return s -} - -// SetTaskStatus sets the TaskStatus field's value. -func (s *GetSolNetworkOperationTaskDetails) SetTaskStatus(v string) *GetSolNetworkOperationTaskDetails { - s.TaskStatus = &v - return s -} - -type GetSolNetworkPackageContentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The format of the package you want to download from the network package. - // - // Accept is a required field - Accept *string `location:"header" locationName:"Accept" type:"string" required:"true" enum:"PackageContentType"` - - // ID of the network service descriptor in the network package. - // - // NsdInfoId is a required field - NsdInfoId *string `location:"uri" locationName:"nsdInfoId" 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 GetSolNetworkPackageContentInput) 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 GetSolNetworkPackageContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolNetworkPackageContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolNetworkPackageContentInput"} - if s.Accept == nil { - invalidParams.Add(request.NewErrParamRequired("Accept")) - } - if s.NsdInfoId == nil { - invalidParams.Add(request.NewErrParamRequired("NsdInfoId")) - } - if s.NsdInfoId != nil && len(*s.NsdInfoId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsdInfoId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccept sets the Accept field's value. -func (s *GetSolNetworkPackageContentInput) SetAccept(v string) *GetSolNetworkPackageContentInput { - s.Accept = &v - return s -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *GetSolNetworkPackageContentInput) SetNsdInfoId(v string) *GetSolNetworkPackageContentInput { - s.NsdInfoId = &v - return s -} - -type GetSolNetworkPackageContentOutput struct { - _ struct{} `type:"structure" payload:"NsdContent"` - - // Indicates the media type of the resource. - ContentType *string `location:"header" locationName:"Content-Type" type:"string" enum:"PackageContentType"` - - // Content of the network service descriptor in the network package. - NsdContent []byte `locationName:"nsdContent" type:"blob"` -} - -// 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 GetSolNetworkPackageContentOutput) 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 GetSolNetworkPackageContentOutput) GoString() string { - return s.String() -} - -// SetContentType sets the ContentType field's value. -func (s *GetSolNetworkPackageContentOutput) SetContentType(v string) *GetSolNetworkPackageContentOutput { - s.ContentType = &v - return s -} - -// SetNsdContent sets the NsdContent field's value. -func (s *GetSolNetworkPackageContentOutput) SetNsdContent(v []byte) *GetSolNetworkPackageContentOutput { - s.NsdContent = v - return s -} - -type GetSolNetworkPackageDescriptorInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ID of the network service descriptor in the network package. - // - // NsdInfoId is a required field - NsdInfoId *string `location:"uri" locationName:"nsdInfoId" 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 GetSolNetworkPackageDescriptorInput) 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 GetSolNetworkPackageDescriptorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolNetworkPackageDescriptorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolNetworkPackageDescriptorInput"} - if s.NsdInfoId == nil { - invalidParams.Add(request.NewErrParamRequired("NsdInfoId")) - } - if s.NsdInfoId != nil && len(*s.NsdInfoId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsdInfoId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *GetSolNetworkPackageDescriptorInput) SetNsdInfoId(v string) *GetSolNetworkPackageDescriptorInput { - s.NsdInfoId = &v - return s -} - -type GetSolNetworkPackageDescriptorOutput struct { - _ struct{} `type:"structure" payload:"Nsd"` - - // Indicates the media type of the resource. - ContentType *string `location:"header" locationName:"Content-Type" type:"string" enum:"DescriptorContentType"` - - // Contents of the network service descriptor in the network package. - Nsd []byte `locationName:"nsd" type:"blob"` -} - -// 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 GetSolNetworkPackageDescriptorOutput) 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 GetSolNetworkPackageDescriptorOutput) GoString() string { - return s.String() -} - -// SetContentType sets the ContentType field's value. -func (s *GetSolNetworkPackageDescriptorOutput) SetContentType(v string) *GetSolNetworkPackageDescriptorOutput { - s.ContentType = &v - return s -} - -// SetNsd sets the Nsd field's value. -func (s *GetSolNetworkPackageDescriptorOutput) SetNsd(v []byte) *GetSolNetworkPackageDescriptorOutput { - s.Nsd = v - return s -} - -type GetSolNetworkPackageInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // ID of the network service descriptor in the network package. - // - // NsdInfoId is a required field - NsdInfoId *string `location:"uri" locationName:"nsdInfoId" 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 GetSolNetworkPackageInput) 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 GetSolNetworkPackageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSolNetworkPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSolNetworkPackageInput"} - if s.NsdInfoId == nil { - invalidParams.Add(request.NewErrParamRequired("NsdInfoId")) - } - if s.NsdInfoId != nil && len(*s.NsdInfoId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsdInfoId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *GetSolNetworkPackageInput) SetNsdInfoId(v string) *GetSolNetworkPackageInput { - s.NsdInfoId = &v - return s -} - -// Metadata associated with a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -type GetSolNetworkPackageMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Metadata related to the onboarded network service descriptor in the network - // package. - Nsd *NetworkArtifactMeta `locationName:"nsd" 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 GetSolNetworkPackageMetadata) 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 GetSolNetworkPackageMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetSolNetworkPackageMetadata) SetCreatedAt(v time.Time) *GetSolNetworkPackageMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *GetSolNetworkPackageMetadata) SetLastModified(v time.Time) *GetSolNetworkPackageMetadata { - s.LastModified = &v - return s -} - -// SetNsd sets the Nsd field's value. -func (s *GetSolNetworkPackageMetadata) SetNsd(v *NetworkArtifactMeta) *GetSolNetworkPackageMetadata { - s.Nsd = v - return s -} - -type GetSolNetworkPackageOutput struct { - _ struct{} `type:"structure"` - - // Network package ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Network package ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Metadata associated with a network package. - // - // A network package is a .zip file in CSAR (Cloud Service Archive) format defines - // the function packages you want to deploy and the Amazon Web Services infrastructure - // you want to deploy them on. - // - // Metadata is a required field - Metadata *GetSolNetworkPackageMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Network service descriptor ID. - // - // NsdId is a required field - NsdId *string `locationName:"nsdId" type:"string" required:"true"` - - // Network service descriptor name. - // - // NsdName is a required field - NsdName *string `locationName:"nsdName" type:"string" required:"true"` - - // Network service descriptor onboarding state. - // - // NsdOnboardingState is a required field - NsdOnboardingState *string `locationName:"nsdOnboardingState" type:"string" required:"true" enum:"NsdOnboardingState"` - - // Network service descriptor operational state. - // - // NsdOperationalState is a required field - NsdOperationalState *string `locationName:"nsdOperationalState" type:"string" required:"true" enum:"NsdOperationalState"` - - // Network service descriptor usage state. - // - // NsdUsageState is a required field - NsdUsageState *string `locationName:"nsdUsageState" type:"string" required:"true" enum:"NsdUsageState"` - - // Network service descriptor version. - // - // NsdVersion is a required field - NsdVersion *string `locationName:"nsdVersion" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSolNetworkPackageOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"true"` - - // Identifies the function package for the function package descriptor referenced - // by the onboarded network package. - // - // VnfPkgIds is a required field - VnfPkgIds []*string `locationName:"vnfPkgIds" type:"list" 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 GetSolNetworkPackageOutput) 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 GetSolNetworkPackageOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetSolNetworkPackageOutput) SetArn(v string) *GetSolNetworkPackageOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetSolNetworkPackageOutput) SetId(v string) *GetSolNetworkPackageOutput { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetSolNetworkPackageOutput) SetMetadata(v *GetSolNetworkPackageMetadata) *GetSolNetworkPackageOutput { - s.Metadata = v - return s -} - -// SetNsdId sets the NsdId field's value. -func (s *GetSolNetworkPackageOutput) SetNsdId(v string) *GetSolNetworkPackageOutput { - s.NsdId = &v - return s -} - -// SetNsdName sets the NsdName field's value. -func (s *GetSolNetworkPackageOutput) SetNsdName(v string) *GetSolNetworkPackageOutput { - s.NsdName = &v - return s -} - -// SetNsdOnboardingState sets the NsdOnboardingState field's value. -func (s *GetSolNetworkPackageOutput) SetNsdOnboardingState(v string) *GetSolNetworkPackageOutput { - s.NsdOnboardingState = &v - return s -} - -// SetNsdOperationalState sets the NsdOperationalState field's value. -func (s *GetSolNetworkPackageOutput) SetNsdOperationalState(v string) *GetSolNetworkPackageOutput { - s.NsdOperationalState = &v - return s -} - -// SetNsdUsageState sets the NsdUsageState field's value. -func (s *GetSolNetworkPackageOutput) SetNsdUsageState(v string) *GetSolNetworkPackageOutput { - s.NsdUsageState = &v - return s -} - -// SetNsdVersion sets the NsdVersion field's value. -func (s *GetSolNetworkPackageOutput) SetNsdVersion(v string) *GetSolNetworkPackageOutput { - s.NsdVersion = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *GetSolNetworkPackageOutput) SetTags(v map[string]*string) *GetSolNetworkPackageOutput { - s.Tags = v - return s -} - -// SetVnfPkgIds sets the VnfPkgIds field's value. -func (s *GetSolNetworkPackageOutput) SetVnfPkgIds(v []*string) *GetSolNetworkPackageOutput { - s.VnfPkgIds = v - return s -} - -// Information about the network function. -// -// A network function instance is a function in a function package . -type GetSolVnfInfo struct { - _ struct{} `type:"structure"` - - // State of the network function instance. - VnfState *string `locationName:"vnfState" type:"string" enum:"VnfOperationalState"` - - // Compute info used by the network function instance. - VnfcResourceInfo []*GetSolVnfcResourceInfo `locationName:"vnfcResourceInfo" type:"list"` -} - -// 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 GetSolVnfInfo) 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 GetSolVnfInfo) GoString() string { - return s.String() -} - -// SetVnfState sets the VnfState field's value. -func (s *GetSolVnfInfo) SetVnfState(v string) *GetSolVnfInfo { - s.VnfState = &v - return s -} - -// SetVnfcResourceInfo sets the VnfcResourceInfo field's value. -func (s *GetSolVnfInfo) SetVnfcResourceInfo(v []*GetSolVnfcResourceInfo) *GetSolVnfInfo { - s.VnfcResourceInfo = v - return s -} - -// Details of resource associated with a network function. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -type GetSolVnfcResourceInfo struct { - _ struct{} `type:"structure"` - - // The metadata of the network function compute. - Metadata *GetSolVnfcResourceInfoMetadata `locationName:"metadata" 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 GetSolVnfcResourceInfo) 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 GetSolVnfcResourceInfo) GoString() string { - return s.String() -} - -// SetMetadata sets the Metadata field's value. -func (s *GetSolVnfcResourceInfo) SetMetadata(v *GetSolVnfcResourceInfoMetadata) *GetSolVnfcResourceInfo { - s.Metadata = v - return s -} - -// The metadata of a network function. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -type GetSolVnfcResourceInfoMetadata struct { - _ struct{} `type:"structure"` - - // Information about the cluster. - Cluster *string `locationName:"cluster" type:"string"` - - // Information about the helm chart. - HelmChart *string `locationName:"helmChart" type:"string"` - - // Information about the node group. - NodeGroup *string `locationName:"nodeGroup" 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 GetSolVnfcResourceInfoMetadata) 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 GetSolVnfcResourceInfoMetadata) GoString() string { - return s.String() -} - -// SetCluster sets the Cluster field's value. -func (s *GetSolVnfcResourceInfoMetadata) SetCluster(v string) *GetSolVnfcResourceInfoMetadata { - s.Cluster = &v - return s -} - -// SetHelmChart sets the HelmChart field's value. -func (s *GetSolVnfcResourceInfoMetadata) SetHelmChart(v string) *GetSolVnfcResourceInfoMetadata { - s.HelmChart = &v - return s -} - -// SetNodeGroup sets the NodeGroup field's value. -func (s *GetSolVnfcResourceInfoMetadata) SetNodeGroup(v string) *GetSolVnfcResourceInfoMetadata { - s.NodeGroup = &v - return s -} - -type InstantiateSolNetworkInstanceInput struct { - _ struct{} `type:"structure"` - - // A check for whether you have the required permissions for the action without - // actually making the request and provides an error response. If you have the - // required permissions, the error response is DryRunOperation. Otherwise, it - // is UnauthorizedOperation. - DryRun *bool `location:"querystring" locationName:"dry_run" type:"boolean"` - - // ID of the network instance. - // - // NsInstanceId is a required field - NsInstanceId *string `location:"uri" locationName:"nsInstanceId" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. When you use this API, the tags - // are transferred to the network operation that is created. Use tags to search - // and filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InstantiateSolNetworkInstanceInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 InstantiateSolNetworkInstanceInput) 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 InstantiateSolNetworkInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InstantiateSolNetworkInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InstantiateSolNetworkInstanceInput"} - if s.NsInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("NsInstanceId")) - } - if s.NsInstanceId != nil && len(*s.NsInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *InstantiateSolNetworkInstanceInput) SetDryRun(v bool) *InstantiateSolNetworkInstanceInput { - s.DryRun = &v - return s -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *InstantiateSolNetworkInstanceInput) SetNsInstanceId(v string) *InstantiateSolNetworkInstanceInput { - s.NsInstanceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *InstantiateSolNetworkInstanceInput) SetTags(v map[string]*string) *InstantiateSolNetworkInstanceInput { - s.Tags = v - return s -} - -type InstantiateSolNetworkInstanceOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the network operation. - // - // NsLcmOpOccId is a required field - NsLcmOpOccId *string `locationName:"nsLcmOpOccId" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. When you use this API, the tags - // are transferred to the network operation that is created. Use tags to search - // and filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InstantiateSolNetworkInstanceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 InstantiateSolNetworkInstanceOutput) 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 InstantiateSolNetworkInstanceOutput) GoString() string { - return s.String() -} - -// SetNsLcmOpOccId sets the NsLcmOpOccId field's value. -func (s *InstantiateSolNetworkInstanceOutput) SetNsLcmOpOccId(v string) *InstantiateSolNetworkInstanceOutput { - s.NsLcmOpOccId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *InstantiateSolNetworkInstanceOutput) SetTags(v map[string]*string) *InstantiateSolNetworkInstanceOutput { - s.Tags = v - return s -} - -// Unexpected error occurred. Problem on the server. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Lifecycle management operation details on the network instance. -// -// Lifecycle management operations are deploy, update, or delete operations. -type LcmOperationInfo struct { - _ struct{} `type:"structure"` - - // The identifier of the network operation. - // - // NsLcmOpOccId is a required field - NsLcmOpOccId *string `locationName:"nsLcmOpOccId" 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 LcmOperationInfo) 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 LcmOperationInfo) GoString() string { - return s.String() -} - -// SetNsLcmOpOccId sets the NsLcmOpOccId field's value. -func (s *LcmOperationInfo) SetNsLcmOpOccId(v string) *LcmOperationInfo { - s.NsLcmOpOccId = &v - return s -} - -// Lists information about a network function instance. -// -// A network function instance is a function in a function package . -type ListSolFunctionInstanceInfo struct { - _ struct{} `type:"structure"` - - // Network function instance ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Network function instance ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Information about a network function. - // - // A network instance is a single network created in Amazon Web Services TNB - // that can be deployed and on which life-cycle operations (like terminate, - // update, and delete) can be performed. - InstantiatedVnfInfo *GetSolInstantiatedVnfInfo `locationName:"instantiatedVnfInfo" type:"structure"` - - // Network function instance instantiation state. - // - // InstantiationState is a required field - InstantiationState *string `locationName:"instantiationState" type:"string" required:"true" enum:"VnfInstantiationState"` - - // Network function instance metadata. - // - // Metadata is a required field - Metadata *ListSolFunctionInstanceMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Network instance ID. - // - // NsInstanceId is a required field - NsInstanceId *string `locationName:"nsInstanceId" type:"string" required:"true"` - - // Function package ID. - // - // VnfPkgId is a required field - VnfPkgId *string `locationName:"vnfPkgId" type:"string" required:"true"` - - // Function package name. - VnfPkgName *string `locationName:"vnfPkgName" 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 ListSolFunctionInstanceInfo) 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 ListSolFunctionInstanceInfo) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListSolFunctionInstanceInfo) SetArn(v string) *ListSolFunctionInstanceInfo { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ListSolFunctionInstanceInfo) SetId(v string) *ListSolFunctionInstanceInfo { - s.Id = &v - return s -} - -// SetInstantiatedVnfInfo sets the InstantiatedVnfInfo field's value. -func (s *ListSolFunctionInstanceInfo) SetInstantiatedVnfInfo(v *GetSolInstantiatedVnfInfo) *ListSolFunctionInstanceInfo { - s.InstantiatedVnfInfo = v - return s -} - -// SetInstantiationState sets the InstantiationState field's value. -func (s *ListSolFunctionInstanceInfo) SetInstantiationState(v string) *ListSolFunctionInstanceInfo { - s.InstantiationState = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ListSolFunctionInstanceInfo) SetMetadata(v *ListSolFunctionInstanceMetadata) *ListSolFunctionInstanceInfo { - s.Metadata = v - return s -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *ListSolFunctionInstanceInfo) SetNsInstanceId(v string) *ListSolFunctionInstanceInfo { - s.NsInstanceId = &v - return s -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *ListSolFunctionInstanceInfo) SetVnfPkgId(v string) *ListSolFunctionInstanceInfo { - s.VnfPkgId = &v - return s -} - -// SetVnfPkgName sets the VnfPkgName field's value. -func (s *ListSolFunctionInstanceInfo) SetVnfPkgName(v string) *ListSolFunctionInstanceInfo { - s.VnfPkgName = &v - return s -} - -// Lists network function instance metadata. -// -// A network function instance is a function in a function package . -type ListSolFunctionInstanceMetadata struct { - _ struct{} `type:"structure"` - - // When the network function instance was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // When the network function instance was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" 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 ListSolFunctionInstanceMetadata) 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 ListSolFunctionInstanceMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ListSolFunctionInstanceMetadata) SetCreatedAt(v time.Time) *ListSolFunctionInstanceMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *ListSolFunctionInstanceMetadata) SetLastModified(v time.Time) *ListSolFunctionInstanceMetadata { - s.LastModified = &v - return s -} - -type ListSolFunctionInstancesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to include in the response. - MaxResults *int64 `location:"querystring" locationName:"max_results" min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextpage_opaque_marker" 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 ListSolFunctionInstancesInput) 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 ListSolFunctionInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSolFunctionInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSolFunctionInstancesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSolFunctionInstancesInput) SetMaxResults(v int64) *ListSolFunctionInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolFunctionInstancesInput) SetNextToken(v string) *ListSolFunctionInstancesInput { - s.NextToken = &v - return s -} - -type ListSolFunctionInstancesOutput struct { - _ struct{} `type:"structure"` - - // Network function instances. - FunctionInstances []*ListSolFunctionInstanceInfo `locationName:"functionInstances" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" 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 ListSolFunctionInstancesOutput) 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 ListSolFunctionInstancesOutput) GoString() string { - return s.String() -} - -// SetFunctionInstances sets the FunctionInstances field's value. -func (s *ListSolFunctionInstancesOutput) SetFunctionInstances(v []*ListSolFunctionInstanceInfo) *ListSolFunctionInstancesOutput { - s.FunctionInstances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolFunctionInstancesOutput) SetNextToken(v string) *ListSolFunctionInstancesOutput { - s.NextToken = &v - return s -} - -// Information about a function package. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -type ListSolFunctionPackageInfo struct { - _ struct{} `type:"structure"` - - // Function package ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // ID of the function package. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The metadata of the function package. - Metadata *ListSolFunctionPackageMetadata `locationName:"metadata" type:"structure"` - - // Onboarding state of the function package. - // - // OnboardingState is a required field - OnboardingState *string `locationName:"onboardingState" type:"string" required:"true" enum:"OnboardingState"` - - // Operational state of the function package. - // - // OperationalState is a required field - OperationalState *string `locationName:"operationalState" type:"string" required:"true" enum:"OperationalState"` - - // Usage state of the function package. - // - // UsageState is a required field - UsageState *string `locationName:"usageState" type:"string" required:"true" enum:"UsageState"` - - // The product name for the network function. - VnfProductName *string `locationName:"vnfProductName" type:"string"` - - // Provider of the function package and the function package descriptor. - VnfProvider *string `locationName:"vnfProvider" type:"string"` - - // Identifies the function package and the function package descriptor. - VnfdId *string `locationName:"vnfdId" type:"string"` - - // Identifies the version of the function package descriptor. - VnfdVersion *string `locationName:"vnfdVersion" 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 ListSolFunctionPackageInfo) 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 ListSolFunctionPackageInfo) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListSolFunctionPackageInfo) SetArn(v string) *ListSolFunctionPackageInfo { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ListSolFunctionPackageInfo) SetId(v string) *ListSolFunctionPackageInfo { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ListSolFunctionPackageInfo) SetMetadata(v *ListSolFunctionPackageMetadata) *ListSolFunctionPackageInfo { - s.Metadata = v - return s -} - -// SetOnboardingState sets the OnboardingState field's value. -func (s *ListSolFunctionPackageInfo) SetOnboardingState(v string) *ListSolFunctionPackageInfo { - s.OnboardingState = &v - return s -} - -// SetOperationalState sets the OperationalState field's value. -func (s *ListSolFunctionPackageInfo) SetOperationalState(v string) *ListSolFunctionPackageInfo { - s.OperationalState = &v - return s -} - -// SetUsageState sets the UsageState field's value. -func (s *ListSolFunctionPackageInfo) SetUsageState(v string) *ListSolFunctionPackageInfo { - s.UsageState = &v - return s -} - -// SetVnfProductName sets the VnfProductName field's value. -func (s *ListSolFunctionPackageInfo) SetVnfProductName(v string) *ListSolFunctionPackageInfo { - s.VnfProductName = &v - return s -} - -// SetVnfProvider sets the VnfProvider field's value. -func (s *ListSolFunctionPackageInfo) SetVnfProvider(v string) *ListSolFunctionPackageInfo { - s.VnfProvider = &v - return s -} - -// SetVnfdId sets the VnfdId field's value. -func (s *ListSolFunctionPackageInfo) SetVnfdId(v string) *ListSolFunctionPackageInfo { - s.VnfdId = &v - return s -} - -// SetVnfdVersion sets the VnfdVersion field's value. -func (s *ListSolFunctionPackageInfo) SetVnfdVersion(v string) *ListSolFunctionPackageInfo { - s.VnfdVersion = &v - return s -} - -// Details for the function package metadata. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -type ListSolFunctionPackageMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" 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 ListSolFunctionPackageMetadata) 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 ListSolFunctionPackageMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ListSolFunctionPackageMetadata) SetCreatedAt(v time.Time) *ListSolFunctionPackageMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *ListSolFunctionPackageMetadata) SetLastModified(v time.Time) *ListSolFunctionPackageMetadata { - s.LastModified = &v - return s -} - -type ListSolFunctionPackagesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to include in the response. - MaxResults *int64 `location:"querystring" locationName:"max_results" min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextpage_opaque_marker" 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 ListSolFunctionPackagesInput) 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 ListSolFunctionPackagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSolFunctionPackagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSolFunctionPackagesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSolFunctionPackagesInput) SetMaxResults(v int64) *ListSolFunctionPackagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolFunctionPackagesInput) SetNextToken(v string) *ListSolFunctionPackagesInput { - s.NextToken = &v - return s -} - -type ListSolFunctionPackagesOutput struct { - _ struct{} `type:"structure"` - - // Function packages. A function package is a .zip file in CSAR (Cloud Service - // Archive) format that contains a network function (an ETSI standard telecommunication - // application) and function package descriptor that uses the TOSCA standard - // to describe how the network functions should run on your network. - // - // FunctionPackages is a required field - FunctionPackages []*ListSolFunctionPackageInfo `locationName:"functionPackages" type:"list" required:"true"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" 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 ListSolFunctionPackagesOutput) 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 ListSolFunctionPackagesOutput) GoString() string { - return s.String() -} - -// SetFunctionPackages sets the FunctionPackages field's value. -func (s *ListSolFunctionPackagesOutput) SetFunctionPackages(v []*ListSolFunctionPackageInfo) *ListSolFunctionPackagesOutput { - s.FunctionPackages = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolFunctionPackagesOutput) SetNextToken(v string) *ListSolFunctionPackagesOutput { - s.NextToken = &v - return s -} - -// Info about the specific network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -type ListSolNetworkInstanceInfo struct { - _ struct{} `type:"structure"` - - // Network instance ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // ID of the network instance. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The metadata of the network instance. - // - // Metadata is a required field - Metadata *ListSolNetworkInstanceMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Human-readable description of the network instance. - // - // NsInstanceDescription is a required field - NsInstanceDescription *string `locationName:"nsInstanceDescription" type:"string" required:"true"` - - // Human-readable name of the network instance. - // - // NsInstanceName is a required field - NsInstanceName *string `locationName:"nsInstanceName" type:"string" required:"true"` - - // The state of the network instance. - // - // NsState is a required field - NsState *string `locationName:"nsState" type:"string" required:"true" enum:"NsState"` - - // ID of the network service descriptor in the network package. - // - // NsdId is a required field - NsdId *string `locationName:"nsdId" type:"string" required:"true"` - - // ID of the network service descriptor in the network package. - // - // NsdInfoId is a required field - NsdInfoId *string `locationName:"nsdInfoId" 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 ListSolNetworkInstanceInfo) 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 ListSolNetworkInstanceInfo) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListSolNetworkInstanceInfo) SetArn(v string) *ListSolNetworkInstanceInfo { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ListSolNetworkInstanceInfo) SetId(v string) *ListSolNetworkInstanceInfo { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ListSolNetworkInstanceInfo) SetMetadata(v *ListSolNetworkInstanceMetadata) *ListSolNetworkInstanceInfo { - s.Metadata = v - return s -} - -// SetNsInstanceDescription sets the NsInstanceDescription field's value. -func (s *ListSolNetworkInstanceInfo) SetNsInstanceDescription(v string) *ListSolNetworkInstanceInfo { - s.NsInstanceDescription = &v - return s -} - -// SetNsInstanceName sets the NsInstanceName field's value. -func (s *ListSolNetworkInstanceInfo) SetNsInstanceName(v string) *ListSolNetworkInstanceInfo { - s.NsInstanceName = &v - return s -} - -// SetNsState sets the NsState field's value. -func (s *ListSolNetworkInstanceInfo) SetNsState(v string) *ListSolNetworkInstanceInfo { - s.NsState = &v - return s -} - -// SetNsdId sets the NsdId field's value. -func (s *ListSolNetworkInstanceInfo) SetNsdId(v string) *ListSolNetworkInstanceInfo { - s.NsdId = &v - return s -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *ListSolNetworkInstanceInfo) SetNsdInfoId(v string) *ListSolNetworkInstanceInfo { - s.NsdInfoId = &v - return s -} - -// Metadata details for a network instance. -// -// A network instance is a single network created in Amazon Web Services TNB -// that can be deployed and on which life-cycle operations (like terminate, -// update, and delete) can be performed. -type ListSolNetworkInstanceMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" 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 ListSolNetworkInstanceMetadata) 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 ListSolNetworkInstanceMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ListSolNetworkInstanceMetadata) SetCreatedAt(v time.Time) *ListSolNetworkInstanceMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *ListSolNetworkInstanceMetadata) SetLastModified(v time.Time) *ListSolNetworkInstanceMetadata { - s.LastModified = &v - return s -} - -type ListSolNetworkInstancesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to include in the response. - MaxResults *int64 `location:"querystring" locationName:"max_results" min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextpage_opaque_marker" 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 ListSolNetworkInstancesInput) 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 ListSolNetworkInstancesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSolNetworkInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSolNetworkInstancesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSolNetworkInstancesInput) SetMaxResults(v int64) *ListSolNetworkInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolNetworkInstancesInput) SetNextToken(v string) *ListSolNetworkInstancesInput { - s.NextToken = &v - return s -} - -type ListSolNetworkInstancesOutput struct { - _ struct{} `type:"structure"` - - // Lists network instances. - NetworkInstances []*ListSolNetworkInstanceInfo `locationName:"networkInstances" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" 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 ListSolNetworkInstancesOutput) 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 ListSolNetworkInstancesOutput) GoString() string { - return s.String() -} - -// SetNetworkInstances sets the NetworkInstances field's value. -func (s *ListSolNetworkInstancesOutput) SetNetworkInstances(v []*ListSolNetworkInstanceInfo) *ListSolNetworkInstancesOutput { - s.NetworkInstances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolNetworkInstancesOutput) SetNextToken(v string) *ListSolNetworkInstancesOutput { - s.NextToken = &v - return s -} - -// Information parameters for a network operation. -type ListSolNetworkOperationsInfo struct { - _ struct{} `type:"structure"` - - // Network operation ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Error related to this specific network operation. - Error *ProblemDetails `locationName:"error" type:"structure"` - - // ID of this network operation. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Type of lifecycle management network operation. - // - // LcmOperationType is a required field - LcmOperationType *string `locationName:"lcmOperationType" type:"string" required:"true" enum:"LcmOperationType"` - - // Metadata related to this network operation. - Metadata *ListSolNetworkOperationsMetadata `locationName:"metadata" type:"structure"` - - // ID of the network instance related to this operation. - // - // NsInstanceId is a required field - NsInstanceId *string `locationName:"nsInstanceId" type:"string" required:"true"` - - // The state of the network operation. - // - // OperationState is a required field - OperationState *string `locationName:"operationState" type:"string" required:"true" enum:"NsLcmOperationState"` -} - -// 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 ListSolNetworkOperationsInfo) 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 ListSolNetworkOperationsInfo) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListSolNetworkOperationsInfo) SetArn(v string) *ListSolNetworkOperationsInfo { - s.Arn = &v - return s -} - -// SetError sets the Error field's value. -func (s *ListSolNetworkOperationsInfo) SetError(v *ProblemDetails) *ListSolNetworkOperationsInfo { - s.Error = v - return s -} - -// SetId sets the Id field's value. -func (s *ListSolNetworkOperationsInfo) SetId(v string) *ListSolNetworkOperationsInfo { - s.Id = &v - return s -} - -// SetLcmOperationType sets the LcmOperationType field's value. -func (s *ListSolNetworkOperationsInfo) SetLcmOperationType(v string) *ListSolNetworkOperationsInfo { - s.LcmOperationType = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ListSolNetworkOperationsInfo) SetMetadata(v *ListSolNetworkOperationsMetadata) *ListSolNetworkOperationsInfo { - s.Metadata = v - return s -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *ListSolNetworkOperationsInfo) SetNsInstanceId(v string) *ListSolNetworkOperationsInfo { - s.NsInstanceId = &v - return s -} - -// SetOperationState sets the OperationState field's value. -func (s *ListSolNetworkOperationsInfo) SetOperationState(v string) *ListSolNetworkOperationsInfo { - s.OperationState = &v - return s -} - -type ListSolNetworkOperationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to include in the response. - MaxResults *int64 `location:"querystring" locationName:"max_results" min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextpage_opaque_marker" 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 ListSolNetworkOperationsInput) 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 ListSolNetworkOperationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSolNetworkOperationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSolNetworkOperationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSolNetworkOperationsInput) SetMaxResults(v int64) *ListSolNetworkOperationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolNetworkOperationsInput) SetNextToken(v string) *ListSolNetworkOperationsInput { - s.NextToken = &v - return s -} - -// Metadata related to a network operation. -// -// A network operation is any operation that is done to your network, such as -// network instance instantiation or termination. -type ListSolNetworkOperationsMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" 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 ListSolNetworkOperationsMetadata) 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 ListSolNetworkOperationsMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ListSolNetworkOperationsMetadata) SetCreatedAt(v time.Time) *ListSolNetworkOperationsMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *ListSolNetworkOperationsMetadata) SetLastModified(v time.Time) *ListSolNetworkOperationsMetadata { - s.LastModified = &v - return s -} - -type ListSolNetworkOperationsOutput struct { - _ struct{} `type:"structure"` - - // Lists network operation occurrences. Lifecycle management operations are - // deploy, update, or delete operations. - NetworkOperations []*ListSolNetworkOperationsInfo `locationName:"networkOperations" type:"list"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" 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 ListSolNetworkOperationsOutput) 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 ListSolNetworkOperationsOutput) GoString() string { - return s.String() -} - -// SetNetworkOperations sets the NetworkOperations field's value. -func (s *ListSolNetworkOperationsOutput) SetNetworkOperations(v []*ListSolNetworkOperationsInfo) *ListSolNetworkOperationsOutput { - s.NetworkOperations = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolNetworkOperationsOutput) SetNextToken(v string) *ListSolNetworkOperationsOutput { - s.NextToken = &v - return s -} - -// Details of a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -type ListSolNetworkPackageInfo struct { - _ struct{} `type:"structure"` - - // Network package ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // ID of the individual network package. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The metadata of the network package. - // - // Metadata is a required field - Metadata *ListSolNetworkPackageMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Designer of the onboarded network service descriptor in the network package. - NsdDesigner *string `locationName:"nsdDesigner" type:"string"` - - // ID of the network service descriptor on which the network package is based. - NsdId *string `locationName:"nsdId" type:"string"` - - // Identifies a network service descriptor in a version independent manner. - NsdInvariantId *string `locationName:"nsdInvariantId" type:"string"` - - // Name of the onboarded network service descriptor in the network package. - NsdName *string `locationName:"nsdName" type:"string"` - - // Onboarding state of the network service descriptor in the network package. - // - // NsdOnboardingState is a required field - NsdOnboardingState *string `locationName:"nsdOnboardingState" type:"string" required:"true" enum:"NsdOnboardingState"` - - // Operational state of the network service descriptor in the network package. - // - // NsdOperationalState is a required field - NsdOperationalState *string `locationName:"nsdOperationalState" type:"string" required:"true" enum:"NsdOperationalState"` - - // Usage state of the network service descriptor in the network package. - // - // NsdUsageState is a required field - NsdUsageState *string `locationName:"nsdUsageState" type:"string" required:"true" enum:"NsdUsageState"` - - // Version of the onboarded network service descriptor in the network package. - NsdVersion *string `locationName:"nsdVersion" type:"string"` - - // Identifies the function package for the function package descriptor referenced - // by the onboarded network package. - VnfPkgIds []*string `locationName:"vnfPkgIds" type:"list"` -} - -// 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 ListSolNetworkPackageInfo) 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 ListSolNetworkPackageInfo) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListSolNetworkPackageInfo) SetArn(v string) *ListSolNetworkPackageInfo { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ListSolNetworkPackageInfo) SetId(v string) *ListSolNetworkPackageInfo { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ListSolNetworkPackageInfo) SetMetadata(v *ListSolNetworkPackageMetadata) *ListSolNetworkPackageInfo { - s.Metadata = v - return s -} - -// SetNsdDesigner sets the NsdDesigner field's value. -func (s *ListSolNetworkPackageInfo) SetNsdDesigner(v string) *ListSolNetworkPackageInfo { - s.NsdDesigner = &v - return s -} - -// SetNsdId sets the NsdId field's value. -func (s *ListSolNetworkPackageInfo) SetNsdId(v string) *ListSolNetworkPackageInfo { - s.NsdId = &v - return s -} - -// SetNsdInvariantId sets the NsdInvariantId field's value. -func (s *ListSolNetworkPackageInfo) SetNsdInvariantId(v string) *ListSolNetworkPackageInfo { - s.NsdInvariantId = &v - return s -} - -// SetNsdName sets the NsdName field's value. -func (s *ListSolNetworkPackageInfo) SetNsdName(v string) *ListSolNetworkPackageInfo { - s.NsdName = &v - return s -} - -// SetNsdOnboardingState sets the NsdOnboardingState field's value. -func (s *ListSolNetworkPackageInfo) SetNsdOnboardingState(v string) *ListSolNetworkPackageInfo { - s.NsdOnboardingState = &v - return s -} - -// SetNsdOperationalState sets the NsdOperationalState field's value. -func (s *ListSolNetworkPackageInfo) SetNsdOperationalState(v string) *ListSolNetworkPackageInfo { - s.NsdOperationalState = &v - return s -} - -// SetNsdUsageState sets the NsdUsageState field's value. -func (s *ListSolNetworkPackageInfo) SetNsdUsageState(v string) *ListSolNetworkPackageInfo { - s.NsdUsageState = &v - return s -} - -// SetNsdVersion sets the NsdVersion field's value. -func (s *ListSolNetworkPackageInfo) SetNsdVersion(v string) *ListSolNetworkPackageInfo { - s.NsdVersion = &v - return s -} - -// SetVnfPkgIds sets the VnfPkgIds field's value. -func (s *ListSolNetworkPackageInfo) SetVnfPkgIds(v []*string) *ListSolNetworkPackageInfo { - s.VnfPkgIds = v - return s -} - -// Metadata related to a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -type ListSolNetworkPackageMetadata struct { - _ struct{} `type:"structure"` - - // The date that the resource was created. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date that the resource was last modified. - // - // LastModified is a required field - LastModified *time.Time `locationName:"lastModified" type:"timestamp" timestampFormat:"iso8601" 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 ListSolNetworkPackageMetadata) 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 ListSolNetworkPackageMetadata) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ListSolNetworkPackageMetadata) SetCreatedAt(v time.Time) *ListSolNetworkPackageMetadata { - s.CreatedAt = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *ListSolNetworkPackageMetadata) SetLastModified(v time.Time) *ListSolNetworkPackageMetadata { - s.LastModified = &v - return s -} - -type ListSolNetworkPackagesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to include in the response. - MaxResults *int64 `location:"querystring" locationName:"max_results" min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextpage_opaque_marker" 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 ListSolNetworkPackagesInput) 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 ListSolNetworkPackagesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSolNetworkPackagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSolNetworkPackagesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSolNetworkPackagesInput) SetMaxResults(v int64) *ListSolNetworkPackagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolNetworkPackagesInput) SetNextToken(v string) *ListSolNetworkPackagesInput { - s.NextToken = &v - return s -} - -type ListSolNetworkPackagesOutput struct { - _ struct{} `type:"structure"` - - // Network packages. A network package is a .zip file in CSAR (Cloud Service - // Archive) format defines the function packages you want to deploy and the - // Amazon Web Services infrastructure you want to deploy them on. - // - // NetworkPackages is a required field - NetworkPackages []*ListSolNetworkPackageInfo `locationName:"networkPackages" type:"list" required:"true"` - - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. - NextToken *string `locationName:"nextToken" 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 ListSolNetworkPackagesOutput) 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 ListSolNetworkPackagesOutput) GoString() string { - return s.String() -} - -// SetNetworkPackages sets the NetworkPackages field's value. -func (s *ListSolNetworkPackagesOutput) SetNetworkPackages(v []*ListSolNetworkPackageInfo) *ListSolNetworkPackagesOutput { - s.NetworkPackages = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSolNetworkPackagesOutput) SetNextToken(v string) *ListSolNetworkPackagesOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Resource ARN. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListTagsForResourceOutput's - // String and GoString methods. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true" sensitive:"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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Metadata for network package artifacts. -// -// Artifacts are the contents of the package descriptor file and the state of -// the package. -type NetworkArtifactMeta struct { - _ struct{} `type:"structure"` - - // Lists network package overrides. - Overrides []*ToscaOverride `locationName:"overrides" type:"list"` -} - -// 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 NetworkArtifactMeta) 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 NetworkArtifactMeta) GoString() string { - return s.String() -} - -// SetOverrides sets the Overrides field's value. -func (s *NetworkArtifactMeta) SetOverrides(v []*ToscaOverride) *NetworkArtifactMeta { - s.Overrides = v - return s -} - -// Details related to problems with AWS TNB resources. -type ProblemDetails struct { - _ struct{} `type:"structure"` - - // A human-readable explanation specific to this occurrence of the problem. - // - // Detail is a required field - Detail *string `locationName:"detail" type:"string" required:"true"` - - // A human-readable title of the problem type. - Title *string `locationName:"title" 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 ProblemDetails) 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 ProblemDetails) GoString() string { - return s.String() -} - -// SetDetail sets the Detail field's value. -func (s *ProblemDetails) SetDetail(v string) *ProblemDetails { - s.Detail = &v - return s -} - -// SetTitle sets the Title field's value. -func (s *ProblemDetails) SetTitle(v string) *ProblemDetails { - s.Title = &v - return s -} - -type PutSolFunctionPackageContentInput struct { - _ struct{} `type:"structure" payload:"File"` - - // Function package content type. - ContentType *string `location:"header" locationName:"Content-Type" type:"string" enum:"PackageContentType"` - - // Function package file. - // - // File is a required field - File []byte `locationName:"file" type:"blob" required:"true"` - - // Function package ID. - // - // VnfPkgId is a required field - VnfPkgId *string `location:"uri" locationName:"vnfPkgId" 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 PutSolFunctionPackageContentInput) 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 PutSolFunctionPackageContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutSolFunctionPackageContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutSolFunctionPackageContentInput"} - if s.File == nil { - invalidParams.Add(request.NewErrParamRequired("File")) - } - if s.VnfPkgId == nil { - invalidParams.Add(request.NewErrParamRequired("VnfPkgId")) - } - if s.VnfPkgId != nil && len(*s.VnfPkgId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VnfPkgId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentType sets the ContentType field's value. -func (s *PutSolFunctionPackageContentInput) SetContentType(v string) *PutSolFunctionPackageContentInput { - s.ContentType = &v - return s -} - -// SetFile sets the File field's value. -func (s *PutSolFunctionPackageContentInput) SetFile(v []byte) *PutSolFunctionPackageContentInput { - s.File = v - return s -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *PutSolFunctionPackageContentInput) SetVnfPkgId(v string) *PutSolFunctionPackageContentInput { - s.VnfPkgId = &v - return s -} - -// Update metadata in a function package. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -type PutSolFunctionPackageContentMetadata struct { - _ struct{} `type:"structure"` - - // Metadata for function package artifacts. - // - // Artifacts are the contents of the package descriptor file and the state of - // the package. - Vnfd *FunctionArtifactMeta `locationName:"vnfd" 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 PutSolFunctionPackageContentMetadata) 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 PutSolFunctionPackageContentMetadata) GoString() string { - return s.String() -} - -// SetVnfd sets the Vnfd field's value. -func (s *PutSolFunctionPackageContentMetadata) SetVnfd(v *FunctionArtifactMeta) *PutSolFunctionPackageContentMetadata { - s.Vnfd = v - return s -} - -type PutSolFunctionPackageContentOutput struct { - _ struct{} `type:"structure"` - - // Function package ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Function package metadata. - // - // Metadata is a required field - Metadata *PutSolFunctionPackageContentMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Function product name. - // - // VnfProductName is a required field - VnfProductName *string `locationName:"vnfProductName" type:"string" required:"true"` - - // Function provider. - // - // VnfProvider is a required field - VnfProvider *string `locationName:"vnfProvider" type:"string" required:"true"` - - // Function package descriptor ID. - // - // VnfdId is a required field - VnfdId *string `locationName:"vnfdId" type:"string" required:"true"` - - // Function package descriptor version. - // - // VnfdVersion is a required field - VnfdVersion *string `locationName:"vnfdVersion" 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 PutSolFunctionPackageContentOutput) 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 PutSolFunctionPackageContentOutput) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *PutSolFunctionPackageContentOutput) SetId(v string) *PutSolFunctionPackageContentOutput { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *PutSolFunctionPackageContentOutput) SetMetadata(v *PutSolFunctionPackageContentMetadata) *PutSolFunctionPackageContentOutput { - s.Metadata = v - return s -} - -// SetVnfProductName sets the VnfProductName field's value. -func (s *PutSolFunctionPackageContentOutput) SetVnfProductName(v string) *PutSolFunctionPackageContentOutput { - s.VnfProductName = &v - return s -} - -// SetVnfProvider sets the VnfProvider field's value. -func (s *PutSolFunctionPackageContentOutput) SetVnfProvider(v string) *PutSolFunctionPackageContentOutput { - s.VnfProvider = &v - return s -} - -// SetVnfdId sets the VnfdId field's value. -func (s *PutSolFunctionPackageContentOutput) SetVnfdId(v string) *PutSolFunctionPackageContentOutput { - s.VnfdId = &v - return s -} - -// SetVnfdVersion sets the VnfdVersion field's value. -func (s *PutSolFunctionPackageContentOutput) SetVnfdVersion(v string) *PutSolFunctionPackageContentOutput { - s.VnfdVersion = &v - return s -} - -type PutSolNetworkPackageContentInput struct { - _ struct{} `type:"structure" payload:"File"` - - // Network package content type. - ContentType *string `location:"header" locationName:"Content-Type" type:"string" enum:"PackageContentType"` - - // Network package file. - // - // File is a required field - File []byte `locationName:"file" type:"blob" required:"true"` - - // Network service descriptor info ID. - // - // NsdInfoId is a required field - NsdInfoId *string `location:"uri" locationName:"nsdInfoId" 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 PutSolNetworkPackageContentInput) 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 PutSolNetworkPackageContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutSolNetworkPackageContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutSolNetworkPackageContentInput"} - if s.File == nil { - invalidParams.Add(request.NewErrParamRequired("File")) - } - if s.NsdInfoId == nil { - invalidParams.Add(request.NewErrParamRequired("NsdInfoId")) - } - if s.NsdInfoId != nil && len(*s.NsdInfoId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsdInfoId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentType sets the ContentType field's value. -func (s *PutSolNetworkPackageContentInput) SetContentType(v string) *PutSolNetworkPackageContentInput { - s.ContentType = &v - return s -} - -// SetFile sets the File field's value. -func (s *PutSolNetworkPackageContentInput) SetFile(v []byte) *PutSolNetworkPackageContentInput { - s.File = v - return s -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *PutSolNetworkPackageContentInput) SetNsdInfoId(v string) *PutSolNetworkPackageContentInput { - s.NsdInfoId = &v - return s -} - -// Update metadata in a network package. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -type PutSolNetworkPackageContentMetadata struct { - _ struct{} `type:"structure"` - - // Metadata for network package artifacts. - // - // Artifacts are the contents of the package descriptor file and the state of - // the package. - Nsd *NetworkArtifactMeta `locationName:"nsd" 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 PutSolNetworkPackageContentMetadata) 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 PutSolNetworkPackageContentMetadata) GoString() string { - return s.String() -} - -// SetNsd sets the Nsd field's value. -func (s *PutSolNetworkPackageContentMetadata) SetNsd(v *NetworkArtifactMeta) *PutSolNetworkPackageContentMetadata { - s.Nsd = v - return s -} - -type PutSolNetworkPackageContentOutput struct { - _ struct{} `type:"structure"` - - // Network package ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Network package ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Network package metadata. - // - // Metadata is a required field - Metadata *PutSolNetworkPackageContentMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Network service descriptor ID. - // - // NsdId is a required field - NsdId *string `locationName:"nsdId" type:"string" required:"true"` - - // Network service descriptor name. - // - // NsdName is a required field - NsdName *string `locationName:"nsdName" type:"string" required:"true"` - - // Network service descriptor version. - // - // NsdVersion is a required field - NsdVersion *string `locationName:"nsdVersion" type:"string" required:"true"` - - // Function package IDs. - // - // VnfPkgIds is a required field - VnfPkgIds []*string `locationName:"vnfPkgIds" type:"list" 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 PutSolNetworkPackageContentOutput) 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 PutSolNetworkPackageContentOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *PutSolNetworkPackageContentOutput) SetArn(v string) *PutSolNetworkPackageContentOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *PutSolNetworkPackageContentOutput) SetId(v string) *PutSolNetworkPackageContentOutput { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *PutSolNetworkPackageContentOutput) SetMetadata(v *PutSolNetworkPackageContentMetadata) *PutSolNetworkPackageContentOutput { - s.Metadata = v - return s -} - -// SetNsdId sets the NsdId field's value. -func (s *PutSolNetworkPackageContentOutput) SetNsdId(v string) *PutSolNetworkPackageContentOutput { - s.NsdId = &v - return s -} - -// SetNsdName sets the NsdName field's value. -func (s *PutSolNetworkPackageContentOutput) SetNsdName(v string) *PutSolNetworkPackageContentOutput { - s.NsdName = &v - return s -} - -// SetNsdVersion sets the NsdVersion field's value. -func (s *PutSolNetworkPackageContentOutput) SetNsdVersion(v string) *PutSolNetworkPackageContentOutput { - s.NsdVersion = &v - return s -} - -// SetVnfPkgIds sets the VnfPkgIds field's value. -func (s *PutSolNetworkPackageContentOutput) SetVnfPkgIds(v []*string) *PutSolNetworkPackageContentOutput { - s.VnfPkgIds = v - return s -} - -// Request references a resource that doesn't exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Service quotas have been exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // Resource ARN. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. You can use tags to search and - // filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TagResourceInput's - // String and GoString methods. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true" sensitive:"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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -type TerminateSolNetworkInstanceInput struct { - _ struct{} `type:"structure"` - - // ID of the network instance. - // - // NsInstanceId is a required field - NsInstanceId *string `location:"uri" locationName:"nsInstanceId" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. When you use this API, the tags - // are transferred to the network operation that is created. Use tags to search - // and filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TerminateSolNetworkInstanceInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 TerminateSolNetworkInstanceInput) 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 TerminateSolNetworkInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TerminateSolNetworkInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TerminateSolNetworkInstanceInput"} - if s.NsInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("NsInstanceId")) - } - if s.NsInstanceId != nil && len(*s.NsInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsInstanceId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *TerminateSolNetworkInstanceInput) SetNsInstanceId(v string) *TerminateSolNetworkInstanceInput { - s.NsInstanceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TerminateSolNetworkInstanceInput) SetTags(v map[string]*string) *TerminateSolNetworkInstanceInput { - s.Tags = v - return s -} - -type TerminateSolNetworkInstanceOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the network operation. - NsLcmOpOccId *string `locationName:"nsLcmOpOccId" type:"string"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. When you use this API, the tags - // are transferred to the network operation that is created. Use tags to search - // and filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TerminateSolNetworkInstanceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 TerminateSolNetworkInstanceOutput) 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 TerminateSolNetworkInstanceOutput) GoString() string { - return s.String() -} - -// SetNsLcmOpOccId sets the NsLcmOpOccId field's value. -func (s *TerminateSolNetworkInstanceOutput) SetNsLcmOpOccId(v string) *TerminateSolNetworkInstanceOutput { - s.NsLcmOpOccId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TerminateSolNetworkInstanceOutput) SetTags(v map[string]*string) *TerminateSolNetworkInstanceOutput { - s.Tags = v - return s -} - -// Exception caused by throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Overrides of the TOSCA node. -type ToscaOverride struct { - _ struct{} `type:"structure"` - - // Default value for the override. - DefaultValue *string `locationName:"defaultValue" type:"string"` - - // Name of the TOSCA override. - Name *string `locationName:"name" 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 ToscaOverride) 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 ToscaOverride) GoString() string { - return s.String() -} - -// SetDefaultValue sets the DefaultValue field's value. -func (s *ToscaOverride) SetDefaultValue(v string) *ToscaOverride { - s.DefaultValue = &v - return s -} - -// SetName sets the Name field's value. -func (s *ToscaOverride) SetName(v string) *ToscaOverride { - s.Name = &v - return s -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Resource ARN. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // Tag keys. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateSolFunctionPackageInput struct { - _ struct{} `type:"structure"` - - // Operational state of the function package. - // - // OperationalState is a required field - OperationalState *string `locationName:"operationalState" type:"string" required:"true" enum:"OperationalState"` - - // ID of the function package. - // - // VnfPkgId is a required field - VnfPkgId *string `location:"uri" locationName:"vnfPkgId" 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 UpdateSolFunctionPackageInput) 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 UpdateSolFunctionPackageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSolFunctionPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSolFunctionPackageInput"} - if s.OperationalState == nil { - invalidParams.Add(request.NewErrParamRequired("OperationalState")) - } - if s.VnfPkgId == nil { - invalidParams.Add(request.NewErrParamRequired("VnfPkgId")) - } - if s.VnfPkgId != nil && len(*s.VnfPkgId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VnfPkgId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOperationalState sets the OperationalState field's value. -func (s *UpdateSolFunctionPackageInput) SetOperationalState(v string) *UpdateSolFunctionPackageInput { - s.OperationalState = &v - return s -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *UpdateSolFunctionPackageInput) SetVnfPkgId(v string) *UpdateSolFunctionPackageInput { - s.VnfPkgId = &v - return s -} - -type UpdateSolFunctionPackageOutput struct { - _ struct{} `type:"structure"` - - // Operational state of the function package. - // - // OperationalState is a required field - OperationalState *string `locationName:"operationalState" type:"string" required:"true" enum:"OperationalState"` -} - -// 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 UpdateSolFunctionPackageOutput) 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 UpdateSolFunctionPackageOutput) GoString() string { - return s.String() -} - -// SetOperationalState sets the OperationalState field's value. -func (s *UpdateSolFunctionPackageOutput) SetOperationalState(v string) *UpdateSolFunctionPackageOutput { - s.OperationalState = &v - return s -} - -type UpdateSolNetworkInstanceInput struct { - _ struct{} `type:"structure"` - - // ID of the network instance. - // - // NsInstanceId is a required field - NsInstanceId *string `location:"uri" locationName:"nsInstanceId" type:"string" required:"true"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. When you use this API, the tags - // are transferred to the network operation that is created. Use tags to search - // and filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateSolNetworkInstanceInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"true"` - - // The type of update. - // - // UpdateType is a required field - UpdateType *string `locationName:"updateType" type:"string" required:"true" enum:"UpdateSolNetworkType"` -} - -// 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 UpdateSolNetworkInstanceInput) 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 UpdateSolNetworkInstanceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSolNetworkInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSolNetworkInstanceInput"} - if s.NsInstanceId == nil { - invalidParams.Add(request.NewErrParamRequired("NsInstanceId")) - } - if s.NsInstanceId != nil && len(*s.NsInstanceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsInstanceId", 1)) - } - if s.UpdateType == nil { - invalidParams.Add(request.NewErrParamRequired("UpdateType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsInstanceId sets the NsInstanceId field's value. -func (s *UpdateSolNetworkInstanceInput) SetNsInstanceId(v string) *UpdateSolNetworkInstanceInput { - s.NsInstanceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateSolNetworkInstanceInput) SetTags(v map[string]*string) *UpdateSolNetworkInstanceInput { - s.Tags = v - return s -} - -// SetUpdateType sets the UpdateType field's value. -func (s *UpdateSolNetworkInstanceInput) SetUpdateType(v string) *UpdateSolNetworkInstanceInput { - s.UpdateType = &v - return s -} - -type UpdateSolNetworkInstanceOutput struct { - _ struct{} `type:"structure"` - - // The identifier of the network operation. - NsLcmOpOccId *string `locationName:"nsLcmOpOccId" type:"string"` - - // A tag is a label that you assign to an Amazon Web Services resource. Each - // tag consists of a key and an optional value. When you use this API, the tags - // are transferred to the network operation that is created. Use tags to search - // and filter your resources or track your Amazon Web Services costs. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateSolNetworkInstanceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 UpdateSolNetworkInstanceOutput) 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 UpdateSolNetworkInstanceOutput) GoString() string { - return s.String() -} - -// SetNsLcmOpOccId sets the NsLcmOpOccId field's value. -func (s *UpdateSolNetworkInstanceOutput) SetNsLcmOpOccId(v string) *UpdateSolNetworkInstanceOutput { - s.NsLcmOpOccId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *UpdateSolNetworkInstanceOutput) SetTags(v map[string]*string) *UpdateSolNetworkInstanceOutput { - s.Tags = v - return s -} - -type UpdateSolNetworkPackageInput struct { - _ struct{} `type:"structure"` - - // ID of the network service descriptor in the network package. - // - // NsdInfoId is a required field - NsdInfoId *string `location:"uri" locationName:"nsdInfoId" type:"string" required:"true"` - - // Operational state of the network service descriptor in the network package. - // - // NsdOperationalState is a required field - NsdOperationalState *string `locationName:"nsdOperationalState" type:"string" required:"true" enum:"NsdOperationalState"` -} - -// 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 UpdateSolNetworkPackageInput) 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 UpdateSolNetworkPackageInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSolNetworkPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSolNetworkPackageInput"} - if s.NsdInfoId == nil { - invalidParams.Add(request.NewErrParamRequired("NsdInfoId")) - } - if s.NsdInfoId != nil && len(*s.NsdInfoId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsdInfoId", 1)) - } - if s.NsdOperationalState == nil { - invalidParams.Add(request.NewErrParamRequired("NsdOperationalState")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *UpdateSolNetworkPackageInput) SetNsdInfoId(v string) *UpdateSolNetworkPackageInput { - s.NsdInfoId = &v - return s -} - -// SetNsdOperationalState sets the NsdOperationalState field's value. -func (s *UpdateSolNetworkPackageInput) SetNsdOperationalState(v string) *UpdateSolNetworkPackageInput { - s.NsdOperationalState = &v - return s -} - -type UpdateSolNetworkPackageOutput struct { - _ struct{} `type:"structure"` - - // Operational state of the network service descriptor in the network package. - // - // NsdOperationalState is a required field - NsdOperationalState *string `locationName:"nsdOperationalState" type:"string" required:"true" enum:"NsdOperationalState"` -} - -// 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 UpdateSolNetworkPackageOutput) 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 UpdateSolNetworkPackageOutput) GoString() string { - return s.String() -} - -// SetNsdOperationalState sets the NsdOperationalState field's value. -func (s *UpdateSolNetworkPackageOutput) SetNsdOperationalState(v string) *UpdateSolNetworkPackageOutput { - s.NsdOperationalState = &v - return s -} - -type ValidateSolFunctionPackageContentInput struct { - _ struct{} `type:"structure" payload:"File"` - - // Function package content type. - ContentType *string `location:"header" locationName:"Content-Type" type:"string" enum:"PackageContentType"` - - // Function package file. - // - // File is a required field - File []byte `locationName:"file" type:"blob" required:"true"` - - // Function package ID. - // - // VnfPkgId is a required field - VnfPkgId *string `location:"uri" locationName:"vnfPkgId" 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 ValidateSolFunctionPackageContentInput) 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 ValidateSolFunctionPackageContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidateSolFunctionPackageContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidateSolFunctionPackageContentInput"} - if s.File == nil { - invalidParams.Add(request.NewErrParamRequired("File")) - } - if s.VnfPkgId == nil { - invalidParams.Add(request.NewErrParamRequired("VnfPkgId")) - } - if s.VnfPkgId != nil && len(*s.VnfPkgId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VnfPkgId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentType sets the ContentType field's value. -func (s *ValidateSolFunctionPackageContentInput) SetContentType(v string) *ValidateSolFunctionPackageContentInput { - s.ContentType = &v - return s -} - -// SetFile sets the File field's value. -func (s *ValidateSolFunctionPackageContentInput) SetFile(v []byte) *ValidateSolFunctionPackageContentInput { - s.File = v - return s -} - -// SetVnfPkgId sets the VnfPkgId field's value. -func (s *ValidateSolFunctionPackageContentInput) SetVnfPkgId(v string) *ValidateSolFunctionPackageContentInput { - s.VnfPkgId = &v - return s -} - -// Validates function package content metadata. -// -// A function package is a .zip file in CSAR (Cloud Service Archive) format -// that contains a network function (an ETSI standard telecommunication application) -// and function package descriptor that uses the TOSCA standard to describe -// how the network functions should run on your network. -type ValidateSolFunctionPackageContentMetadata struct { - _ struct{} `type:"structure"` - - // Metadata for function package artifacts. - // - // Artifacts are the contents of the package descriptor file and the state of - // the package. - Vnfd *FunctionArtifactMeta `locationName:"vnfd" 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 ValidateSolFunctionPackageContentMetadata) 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 ValidateSolFunctionPackageContentMetadata) GoString() string { - return s.String() -} - -// SetVnfd sets the Vnfd field's value. -func (s *ValidateSolFunctionPackageContentMetadata) SetVnfd(v *FunctionArtifactMeta) *ValidateSolFunctionPackageContentMetadata { - s.Vnfd = v - return s -} - -type ValidateSolFunctionPackageContentOutput struct { - _ struct{} `type:"structure"` - - // Function package ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Function package metadata. - // - // Metadata is a required field - Metadata *ValidateSolFunctionPackageContentMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Network function product name. - // - // VnfProductName is a required field - VnfProductName *string `locationName:"vnfProductName" type:"string" required:"true"` - - // Network function provider. - // - // VnfProvider is a required field - VnfProvider *string `locationName:"vnfProvider" type:"string" required:"true"` - - // Function package descriptor ID. - // - // VnfdId is a required field - VnfdId *string `locationName:"vnfdId" type:"string" required:"true"` - - // Function package descriptor version. - // - // VnfdVersion is a required field - VnfdVersion *string `locationName:"vnfdVersion" 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 ValidateSolFunctionPackageContentOutput) 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 ValidateSolFunctionPackageContentOutput) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *ValidateSolFunctionPackageContentOutput) SetId(v string) *ValidateSolFunctionPackageContentOutput { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ValidateSolFunctionPackageContentOutput) SetMetadata(v *ValidateSolFunctionPackageContentMetadata) *ValidateSolFunctionPackageContentOutput { - s.Metadata = v - return s -} - -// SetVnfProductName sets the VnfProductName field's value. -func (s *ValidateSolFunctionPackageContentOutput) SetVnfProductName(v string) *ValidateSolFunctionPackageContentOutput { - s.VnfProductName = &v - return s -} - -// SetVnfProvider sets the VnfProvider field's value. -func (s *ValidateSolFunctionPackageContentOutput) SetVnfProvider(v string) *ValidateSolFunctionPackageContentOutput { - s.VnfProvider = &v - return s -} - -// SetVnfdId sets the VnfdId field's value. -func (s *ValidateSolFunctionPackageContentOutput) SetVnfdId(v string) *ValidateSolFunctionPackageContentOutput { - s.VnfdId = &v - return s -} - -// SetVnfdVersion sets the VnfdVersion field's value. -func (s *ValidateSolFunctionPackageContentOutput) SetVnfdVersion(v string) *ValidateSolFunctionPackageContentOutput { - s.VnfdVersion = &v - return s -} - -type ValidateSolNetworkPackageContentInput struct { - _ struct{} `type:"structure" payload:"File"` - - // Network package content type. - ContentType *string `location:"header" locationName:"Content-Type" type:"string" enum:"PackageContentType"` - - // Network package file. - // - // File is a required field - File []byte `locationName:"file" type:"blob" required:"true"` - - // Network service descriptor file. - // - // NsdInfoId is a required field - NsdInfoId *string `location:"uri" locationName:"nsdInfoId" 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 ValidateSolNetworkPackageContentInput) 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 ValidateSolNetworkPackageContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidateSolNetworkPackageContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidateSolNetworkPackageContentInput"} - if s.File == nil { - invalidParams.Add(request.NewErrParamRequired("File")) - } - if s.NsdInfoId == nil { - invalidParams.Add(request.NewErrParamRequired("NsdInfoId")) - } - if s.NsdInfoId != nil && len(*s.NsdInfoId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NsdInfoId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContentType sets the ContentType field's value. -func (s *ValidateSolNetworkPackageContentInput) SetContentType(v string) *ValidateSolNetworkPackageContentInput { - s.ContentType = &v - return s -} - -// SetFile sets the File field's value. -func (s *ValidateSolNetworkPackageContentInput) SetFile(v []byte) *ValidateSolNetworkPackageContentInput { - s.File = v - return s -} - -// SetNsdInfoId sets the NsdInfoId field's value. -func (s *ValidateSolNetworkPackageContentInput) SetNsdInfoId(v string) *ValidateSolNetworkPackageContentInput { - s.NsdInfoId = &v - return s -} - -// Validates network package content metadata. -// -// A network package is a .zip file in CSAR (Cloud Service Archive) format defines -// the function packages you want to deploy and the Amazon Web Services infrastructure -// you want to deploy them on. -type ValidateSolNetworkPackageContentMetadata struct { - _ struct{} `type:"structure"` - - // Metadata for network package artifacts. - // - // Artifacts are the contents of the package descriptor file and the state of - // the package. - Nsd *NetworkArtifactMeta `locationName:"nsd" 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 ValidateSolNetworkPackageContentMetadata) 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 ValidateSolNetworkPackageContentMetadata) GoString() string { - return s.String() -} - -// SetNsd sets the Nsd field's value. -func (s *ValidateSolNetworkPackageContentMetadata) SetNsd(v *NetworkArtifactMeta) *ValidateSolNetworkPackageContentMetadata { - s.Nsd = v - return s -} - -type ValidateSolNetworkPackageContentOutput struct { - _ struct{} `type:"structure"` - - // Network package ARN. - // - // Arn is a required field - Arn *string `locationName:"arn" type:"string" required:"true"` - - // Network package ID. - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // Network package metadata. - // - // Metadata is a required field - Metadata *ValidateSolNetworkPackageContentMetadata `locationName:"metadata" type:"structure" required:"true"` - - // Network service descriptor ID. - // - // NsdId is a required field - NsdId *string `locationName:"nsdId" type:"string" required:"true"` - - // Network service descriptor name. - // - // NsdName is a required field - NsdName *string `locationName:"nsdName" type:"string" required:"true"` - - // Network service descriptor version. - // - // NsdVersion is a required field - NsdVersion *string `locationName:"nsdVersion" type:"string" required:"true"` - - // Function package IDs. - // - // VnfPkgIds is a required field - VnfPkgIds []*string `locationName:"vnfPkgIds" type:"list" 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 ValidateSolNetworkPackageContentOutput) 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 ValidateSolNetworkPackageContentOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ValidateSolNetworkPackageContentOutput) SetArn(v string) *ValidateSolNetworkPackageContentOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ValidateSolNetworkPackageContentOutput) SetId(v string) *ValidateSolNetworkPackageContentOutput { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *ValidateSolNetworkPackageContentOutput) SetMetadata(v *ValidateSolNetworkPackageContentMetadata) *ValidateSolNetworkPackageContentOutput { - s.Metadata = v - return s -} - -// SetNsdId sets the NsdId field's value. -func (s *ValidateSolNetworkPackageContentOutput) SetNsdId(v string) *ValidateSolNetworkPackageContentOutput { - s.NsdId = &v - return s -} - -// SetNsdName sets the NsdName field's value. -func (s *ValidateSolNetworkPackageContentOutput) SetNsdName(v string) *ValidateSolNetworkPackageContentOutput { - s.NsdName = &v - return s -} - -// SetNsdVersion sets the NsdVersion field's value. -func (s *ValidateSolNetworkPackageContentOutput) SetNsdVersion(v string) *ValidateSolNetworkPackageContentOutput { - s.NsdVersion = &v - return s -} - -// SetVnfPkgIds sets the VnfPkgIds field's value. -func (s *ValidateSolNetworkPackageContentOutput) SetVnfPkgIds(v []*string) *ValidateSolNetworkPackageContentOutput { - s.VnfPkgIds = v - return s -} - -// Unable to process the request because the client provided input failed to -// satisfy request constraints. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // DescriptorContentTypeTextPlain is a DescriptorContentType enum value - DescriptorContentTypeTextPlain = "text/plain" -) - -// DescriptorContentType_Values returns all elements of the DescriptorContentType enum -func DescriptorContentType_Values() []string { - return []string{ - DescriptorContentTypeTextPlain, - } -} - -const ( - // LcmOperationTypeInstantiate is a LcmOperationType enum value - LcmOperationTypeInstantiate = "INSTANTIATE" - - // LcmOperationTypeUpdate is a LcmOperationType enum value - LcmOperationTypeUpdate = "UPDATE" - - // LcmOperationTypeTerminate is a LcmOperationType enum value - LcmOperationTypeTerminate = "TERMINATE" -) - -// LcmOperationType_Values returns all elements of the LcmOperationType enum -func LcmOperationType_Values() []string { - return []string{ - LcmOperationTypeInstantiate, - LcmOperationTypeUpdate, - LcmOperationTypeTerminate, - } -} - -const ( - // NsLcmOperationStateProcessing is a NsLcmOperationState enum value - NsLcmOperationStateProcessing = "PROCESSING" - - // NsLcmOperationStateCompleted is a NsLcmOperationState enum value - NsLcmOperationStateCompleted = "COMPLETED" - - // NsLcmOperationStateFailed is a NsLcmOperationState enum value - NsLcmOperationStateFailed = "FAILED" - - // NsLcmOperationStateCancelling is a NsLcmOperationState enum value - NsLcmOperationStateCancelling = "CANCELLING" - - // NsLcmOperationStateCancelled is a NsLcmOperationState enum value - NsLcmOperationStateCancelled = "CANCELLED" -) - -// NsLcmOperationState_Values returns all elements of the NsLcmOperationState enum -func NsLcmOperationState_Values() []string { - return []string{ - NsLcmOperationStateProcessing, - NsLcmOperationStateCompleted, - NsLcmOperationStateFailed, - NsLcmOperationStateCancelling, - NsLcmOperationStateCancelled, - } -} - -const ( - // NsStateInstantiated is a NsState enum value - NsStateInstantiated = "INSTANTIATED" - - // NsStateNotInstantiated is a NsState enum value - NsStateNotInstantiated = "NOT_INSTANTIATED" - - // NsStateImpaired is a NsState enum value - NsStateImpaired = "IMPAIRED" - - // NsStateStopped is a NsState enum value - NsStateStopped = "STOPPED" - - // NsStateDeleted is a NsState enum value - NsStateDeleted = "DELETED" - - // NsStateInstantiateInProgress is a NsState enum value - NsStateInstantiateInProgress = "INSTANTIATE_IN_PROGRESS" - - // NsStateUpdateInProgress is a NsState enum value - NsStateUpdateInProgress = "UPDATE_IN_PROGRESS" - - // NsStateTerminateInProgress is a NsState enum value - NsStateTerminateInProgress = "TERMINATE_IN_PROGRESS" -) - -// NsState_Values returns all elements of the NsState enum -func NsState_Values() []string { - return []string{ - NsStateInstantiated, - NsStateNotInstantiated, - NsStateImpaired, - NsStateStopped, - NsStateDeleted, - NsStateInstantiateInProgress, - NsStateUpdateInProgress, - NsStateTerminateInProgress, - } -} - -const ( - // NsdOnboardingStateCreated is a NsdOnboardingState enum value - NsdOnboardingStateCreated = "CREATED" - - // NsdOnboardingStateOnboarded is a NsdOnboardingState enum value - NsdOnboardingStateOnboarded = "ONBOARDED" - - // NsdOnboardingStateError is a NsdOnboardingState enum value - NsdOnboardingStateError = "ERROR" -) - -// NsdOnboardingState_Values returns all elements of the NsdOnboardingState enum -func NsdOnboardingState_Values() []string { - return []string{ - NsdOnboardingStateCreated, - NsdOnboardingStateOnboarded, - NsdOnboardingStateError, - } -} - -const ( - // NsdOperationalStateEnabled is a NsdOperationalState enum value - NsdOperationalStateEnabled = "ENABLED" - - // NsdOperationalStateDisabled is a NsdOperationalState enum value - NsdOperationalStateDisabled = "DISABLED" -) - -// NsdOperationalState_Values returns all elements of the NsdOperationalState enum -func NsdOperationalState_Values() []string { - return []string{ - NsdOperationalStateEnabled, - NsdOperationalStateDisabled, - } -} - -const ( - // NsdUsageStateInUse is a NsdUsageState enum value - NsdUsageStateInUse = "IN_USE" - - // NsdUsageStateNotInUse is a NsdUsageState enum value - NsdUsageStateNotInUse = "NOT_IN_USE" -) - -// NsdUsageState_Values returns all elements of the NsdUsageState enum -func NsdUsageState_Values() []string { - return []string{ - NsdUsageStateInUse, - NsdUsageStateNotInUse, - } -} - -const ( - // OnboardingStateCreated is a OnboardingState enum value - OnboardingStateCreated = "CREATED" - - // OnboardingStateOnboarded is a OnboardingState enum value - OnboardingStateOnboarded = "ONBOARDED" - - // OnboardingStateError is a OnboardingState enum value - OnboardingStateError = "ERROR" -) - -// OnboardingState_Values returns all elements of the OnboardingState enum -func OnboardingState_Values() []string { - return []string{ - OnboardingStateCreated, - OnboardingStateOnboarded, - OnboardingStateError, - } -} - -const ( - // OperationalStateEnabled is a OperationalState enum value - OperationalStateEnabled = "ENABLED" - - // OperationalStateDisabled is a OperationalState enum value - OperationalStateDisabled = "DISABLED" -) - -// OperationalState_Values returns all elements of the OperationalState enum -func OperationalState_Values() []string { - return []string{ - OperationalStateEnabled, - OperationalStateDisabled, - } -} - -const ( - // PackageContentTypeApplicationZip is a PackageContentType enum value - PackageContentTypeApplicationZip = "application/zip" -) - -// PackageContentType_Values returns all elements of the PackageContentType enum -func PackageContentType_Values() []string { - return []string{ - PackageContentTypeApplicationZip, - } -} - -const ( - // TaskStatusScheduled is a TaskStatus enum value - TaskStatusScheduled = "SCHEDULED" - - // TaskStatusStarted is a TaskStatus enum value - TaskStatusStarted = "STARTED" - - // TaskStatusInProgress is a TaskStatus enum value - TaskStatusInProgress = "IN_PROGRESS" - - // TaskStatusCompleted is a TaskStatus enum value - TaskStatusCompleted = "COMPLETED" - - // TaskStatusError is a TaskStatus enum value - TaskStatusError = "ERROR" - - // TaskStatusSkipped is a TaskStatus enum value - TaskStatusSkipped = "SKIPPED" - - // TaskStatusCancelled is a TaskStatus enum value - TaskStatusCancelled = "CANCELLED" -) - -// TaskStatus_Values returns all elements of the TaskStatus enum -func TaskStatus_Values() []string { - return []string{ - TaskStatusScheduled, - TaskStatusStarted, - TaskStatusInProgress, - TaskStatusCompleted, - TaskStatusError, - TaskStatusSkipped, - TaskStatusCancelled, - } -} - -const ( - // UpdateSolNetworkTypeModifyVnfInformation is a UpdateSolNetworkType enum value - UpdateSolNetworkTypeModifyVnfInformation = "MODIFY_VNF_INFORMATION" -) - -// UpdateSolNetworkType_Values returns all elements of the UpdateSolNetworkType enum -func UpdateSolNetworkType_Values() []string { - return []string{ - UpdateSolNetworkTypeModifyVnfInformation, - } -} - -const ( - // UsageStateInUse is a UsageState enum value - UsageStateInUse = "IN_USE" - - // UsageStateNotInUse is a UsageState enum value - UsageStateNotInUse = "NOT_IN_USE" -) - -// UsageState_Values returns all elements of the UsageState enum -func UsageState_Values() []string { - return []string{ - UsageStateInUse, - UsageStateNotInUse, - } -} - -const ( - // VnfInstantiationStateInstantiated is a VnfInstantiationState enum value - VnfInstantiationStateInstantiated = "INSTANTIATED" - - // VnfInstantiationStateNotInstantiated is a VnfInstantiationState enum value - VnfInstantiationStateNotInstantiated = "NOT_INSTANTIATED" -) - -// VnfInstantiationState_Values returns all elements of the VnfInstantiationState enum -func VnfInstantiationState_Values() []string { - return []string{ - VnfInstantiationStateInstantiated, - VnfInstantiationStateNotInstantiated, - } -} - -const ( - // VnfOperationalStateStarted is a VnfOperationalState enum value - VnfOperationalStateStarted = "STARTED" - - // VnfOperationalStateStopped is a VnfOperationalState enum value - VnfOperationalStateStopped = "STOPPED" -) - -// VnfOperationalState_Values returns all elements of the VnfOperationalState enum -func VnfOperationalState_Values() []string { - return []string{ - VnfOperationalStateStarted, - VnfOperationalStateStopped, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/doc.go deleted file mode 100644 index a80872fd262a..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package tnb provides the client and types for making API -// requests to AWS Telco Network Builder. -// -// Amazon Web Services Telco Network Builder (TNB) is a network automation service -// that helps you deploy and manage telecom networks. AWS TNB helps you with -// the lifecycle management of your telecommunication network functions throughout -// planning, deployment, and post-deployment activities. -// -// See https://docs.aws.amazon.com/goto/WebAPI/tnb-2008-10-21 for more information on this service. -// -// See tnb package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/tnb/ -// -// # Using the Client -// -// To contact AWS Telco Network Builder with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Telco Network Builder client Tnb for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/tnb/#New -package tnb diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/errors.go deleted file mode 100644 index 140a5d7df52d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/errors.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package tnb - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // Insufficient permissions to make request. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Unexpected error occurred. Problem on the server. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Request references a resource that doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Service quotas have been exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // Exception caused by throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Unable to process the request because the client provided input failed to - // satisfy request constraints. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/service.go deleted file mode 100644 index 79907f983ec2..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package tnb - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// Tnb provides the API operation methods for making requests to -// AWS Telco Network Builder. See this package's package overview docs -// for details on the service. -// -// Tnb methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type Tnb struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "tnb" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "tnb" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the Tnb client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a Tnb client from just a session. -// svc := tnb.New(mySession) -// -// // Create a Tnb client with additional configuration -// svc := tnb.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Tnb { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "tnb" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *Tnb { - svc := &Tnb{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2008-10-21", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Tnb operation and runs any -// custom request initialization. -func (c *Tnb) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/tnbiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/tnbiface/interface.go deleted file mode 100644 index 6a0dd3b395ee..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb/tnbiface/interface.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package tnbiface provides an interface to enable mocking the AWS Telco Network Builder service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package tnbiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/tnb" -) - -// TnbAPI provides an interface to enable mocking the -// tnb.Tnb service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // AWS Telco Network Builder. -// func myFunc(svc tnbiface.TnbAPI) bool { -// // Make svc.CancelSolNetworkOperation request -// } -// -// func main() { -// sess := session.New() -// svc := tnb.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockTnbClient struct { -// tnbiface.TnbAPI -// } -// func (m *mockTnbClient) CancelSolNetworkOperation(input *tnb.CancelSolNetworkOperationInput) (*tnb.CancelSolNetworkOperationOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockTnbClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type TnbAPI interface { - CancelSolNetworkOperation(*tnb.CancelSolNetworkOperationInput) (*tnb.CancelSolNetworkOperationOutput, error) - CancelSolNetworkOperationWithContext(aws.Context, *tnb.CancelSolNetworkOperationInput, ...request.Option) (*tnb.CancelSolNetworkOperationOutput, error) - CancelSolNetworkOperationRequest(*tnb.CancelSolNetworkOperationInput) (*request.Request, *tnb.CancelSolNetworkOperationOutput) - - CreateSolFunctionPackage(*tnb.CreateSolFunctionPackageInput) (*tnb.CreateSolFunctionPackageOutput, error) - CreateSolFunctionPackageWithContext(aws.Context, *tnb.CreateSolFunctionPackageInput, ...request.Option) (*tnb.CreateSolFunctionPackageOutput, error) - CreateSolFunctionPackageRequest(*tnb.CreateSolFunctionPackageInput) (*request.Request, *tnb.CreateSolFunctionPackageOutput) - - CreateSolNetworkInstance(*tnb.CreateSolNetworkInstanceInput) (*tnb.CreateSolNetworkInstanceOutput, error) - CreateSolNetworkInstanceWithContext(aws.Context, *tnb.CreateSolNetworkInstanceInput, ...request.Option) (*tnb.CreateSolNetworkInstanceOutput, error) - CreateSolNetworkInstanceRequest(*tnb.CreateSolNetworkInstanceInput) (*request.Request, *tnb.CreateSolNetworkInstanceOutput) - - CreateSolNetworkPackage(*tnb.CreateSolNetworkPackageInput) (*tnb.CreateSolNetworkPackageOutput, error) - CreateSolNetworkPackageWithContext(aws.Context, *tnb.CreateSolNetworkPackageInput, ...request.Option) (*tnb.CreateSolNetworkPackageOutput, error) - CreateSolNetworkPackageRequest(*tnb.CreateSolNetworkPackageInput) (*request.Request, *tnb.CreateSolNetworkPackageOutput) - - DeleteSolFunctionPackage(*tnb.DeleteSolFunctionPackageInput) (*tnb.DeleteSolFunctionPackageOutput, error) - DeleteSolFunctionPackageWithContext(aws.Context, *tnb.DeleteSolFunctionPackageInput, ...request.Option) (*tnb.DeleteSolFunctionPackageOutput, error) - DeleteSolFunctionPackageRequest(*tnb.DeleteSolFunctionPackageInput) (*request.Request, *tnb.DeleteSolFunctionPackageOutput) - - DeleteSolNetworkInstance(*tnb.DeleteSolNetworkInstanceInput) (*tnb.DeleteSolNetworkInstanceOutput, error) - DeleteSolNetworkInstanceWithContext(aws.Context, *tnb.DeleteSolNetworkInstanceInput, ...request.Option) (*tnb.DeleteSolNetworkInstanceOutput, error) - DeleteSolNetworkInstanceRequest(*tnb.DeleteSolNetworkInstanceInput) (*request.Request, *tnb.DeleteSolNetworkInstanceOutput) - - DeleteSolNetworkPackage(*tnb.DeleteSolNetworkPackageInput) (*tnb.DeleteSolNetworkPackageOutput, error) - DeleteSolNetworkPackageWithContext(aws.Context, *tnb.DeleteSolNetworkPackageInput, ...request.Option) (*tnb.DeleteSolNetworkPackageOutput, error) - DeleteSolNetworkPackageRequest(*tnb.DeleteSolNetworkPackageInput) (*request.Request, *tnb.DeleteSolNetworkPackageOutput) - - GetSolFunctionInstance(*tnb.GetSolFunctionInstanceInput) (*tnb.GetSolFunctionInstanceOutput, error) - GetSolFunctionInstanceWithContext(aws.Context, *tnb.GetSolFunctionInstanceInput, ...request.Option) (*tnb.GetSolFunctionInstanceOutput, error) - GetSolFunctionInstanceRequest(*tnb.GetSolFunctionInstanceInput) (*request.Request, *tnb.GetSolFunctionInstanceOutput) - - GetSolFunctionPackage(*tnb.GetSolFunctionPackageInput) (*tnb.GetSolFunctionPackageOutput, error) - GetSolFunctionPackageWithContext(aws.Context, *tnb.GetSolFunctionPackageInput, ...request.Option) (*tnb.GetSolFunctionPackageOutput, error) - GetSolFunctionPackageRequest(*tnb.GetSolFunctionPackageInput) (*request.Request, *tnb.GetSolFunctionPackageOutput) - - GetSolFunctionPackageContent(*tnb.GetSolFunctionPackageContentInput) (*tnb.GetSolFunctionPackageContentOutput, error) - GetSolFunctionPackageContentWithContext(aws.Context, *tnb.GetSolFunctionPackageContentInput, ...request.Option) (*tnb.GetSolFunctionPackageContentOutput, error) - GetSolFunctionPackageContentRequest(*tnb.GetSolFunctionPackageContentInput) (*request.Request, *tnb.GetSolFunctionPackageContentOutput) - - GetSolFunctionPackageDescriptor(*tnb.GetSolFunctionPackageDescriptorInput) (*tnb.GetSolFunctionPackageDescriptorOutput, error) - GetSolFunctionPackageDescriptorWithContext(aws.Context, *tnb.GetSolFunctionPackageDescriptorInput, ...request.Option) (*tnb.GetSolFunctionPackageDescriptorOutput, error) - GetSolFunctionPackageDescriptorRequest(*tnb.GetSolFunctionPackageDescriptorInput) (*request.Request, *tnb.GetSolFunctionPackageDescriptorOutput) - - GetSolNetworkInstance(*tnb.GetSolNetworkInstanceInput) (*tnb.GetSolNetworkInstanceOutput, error) - GetSolNetworkInstanceWithContext(aws.Context, *tnb.GetSolNetworkInstanceInput, ...request.Option) (*tnb.GetSolNetworkInstanceOutput, error) - GetSolNetworkInstanceRequest(*tnb.GetSolNetworkInstanceInput) (*request.Request, *tnb.GetSolNetworkInstanceOutput) - - GetSolNetworkOperation(*tnb.GetSolNetworkOperationInput) (*tnb.GetSolNetworkOperationOutput, error) - GetSolNetworkOperationWithContext(aws.Context, *tnb.GetSolNetworkOperationInput, ...request.Option) (*tnb.GetSolNetworkOperationOutput, error) - GetSolNetworkOperationRequest(*tnb.GetSolNetworkOperationInput) (*request.Request, *tnb.GetSolNetworkOperationOutput) - - GetSolNetworkPackage(*tnb.GetSolNetworkPackageInput) (*tnb.GetSolNetworkPackageOutput, error) - GetSolNetworkPackageWithContext(aws.Context, *tnb.GetSolNetworkPackageInput, ...request.Option) (*tnb.GetSolNetworkPackageOutput, error) - GetSolNetworkPackageRequest(*tnb.GetSolNetworkPackageInput) (*request.Request, *tnb.GetSolNetworkPackageOutput) - - GetSolNetworkPackageContent(*tnb.GetSolNetworkPackageContentInput) (*tnb.GetSolNetworkPackageContentOutput, error) - GetSolNetworkPackageContentWithContext(aws.Context, *tnb.GetSolNetworkPackageContentInput, ...request.Option) (*tnb.GetSolNetworkPackageContentOutput, error) - GetSolNetworkPackageContentRequest(*tnb.GetSolNetworkPackageContentInput) (*request.Request, *tnb.GetSolNetworkPackageContentOutput) - - GetSolNetworkPackageDescriptor(*tnb.GetSolNetworkPackageDescriptorInput) (*tnb.GetSolNetworkPackageDescriptorOutput, error) - GetSolNetworkPackageDescriptorWithContext(aws.Context, *tnb.GetSolNetworkPackageDescriptorInput, ...request.Option) (*tnb.GetSolNetworkPackageDescriptorOutput, error) - GetSolNetworkPackageDescriptorRequest(*tnb.GetSolNetworkPackageDescriptorInput) (*request.Request, *tnb.GetSolNetworkPackageDescriptorOutput) - - InstantiateSolNetworkInstance(*tnb.InstantiateSolNetworkInstanceInput) (*tnb.InstantiateSolNetworkInstanceOutput, error) - InstantiateSolNetworkInstanceWithContext(aws.Context, *tnb.InstantiateSolNetworkInstanceInput, ...request.Option) (*tnb.InstantiateSolNetworkInstanceOutput, error) - InstantiateSolNetworkInstanceRequest(*tnb.InstantiateSolNetworkInstanceInput) (*request.Request, *tnb.InstantiateSolNetworkInstanceOutput) - - ListSolFunctionInstances(*tnb.ListSolFunctionInstancesInput) (*tnb.ListSolFunctionInstancesOutput, error) - ListSolFunctionInstancesWithContext(aws.Context, *tnb.ListSolFunctionInstancesInput, ...request.Option) (*tnb.ListSolFunctionInstancesOutput, error) - ListSolFunctionInstancesRequest(*tnb.ListSolFunctionInstancesInput) (*request.Request, *tnb.ListSolFunctionInstancesOutput) - - ListSolFunctionInstancesPages(*tnb.ListSolFunctionInstancesInput, func(*tnb.ListSolFunctionInstancesOutput, bool) bool) error - ListSolFunctionInstancesPagesWithContext(aws.Context, *tnb.ListSolFunctionInstancesInput, func(*tnb.ListSolFunctionInstancesOutput, bool) bool, ...request.Option) error - - ListSolFunctionPackages(*tnb.ListSolFunctionPackagesInput) (*tnb.ListSolFunctionPackagesOutput, error) - ListSolFunctionPackagesWithContext(aws.Context, *tnb.ListSolFunctionPackagesInput, ...request.Option) (*tnb.ListSolFunctionPackagesOutput, error) - ListSolFunctionPackagesRequest(*tnb.ListSolFunctionPackagesInput) (*request.Request, *tnb.ListSolFunctionPackagesOutput) - - ListSolFunctionPackagesPages(*tnb.ListSolFunctionPackagesInput, func(*tnb.ListSolFunctionPackagesOutput, bool) bool) error - ListSolFunctionPackagesPagesWithContext(aws.Context, *tnb.ListSolFunctionPackagesInput, func(*tnb.ListSolFunctionPackagesOutput, bool) bool, ...request.Option) error - - ListSolNetworkInstances(*tnb.ListSolNetworkInstancesInput) (*tnb.ListSolNetworkInstancesOutput, error) - ListSolNetworkInstancesWithContext(aws.Context, *tnb.ListSolNetworkInstancesInput, ...request.Option) (*tnb.ListSolNetworkInstancesOutput, error) - ListSolNetworkInstancesRequest(*tnb.ListSolNetworkInstancesInput) (*request.Request, *tnb.ListSolNetworkInstancesOutput) - - ListSolNetworkInstancesPages(*tnb.ListSolNetworkInstancesInput, func(*tnb.ListSolNetworkInstancesOutput, bool) bool) error - ListSolNetworkInstancesPagesWithContext(aws.Context, *tnb.ListSolNetworkInstancesInput, func(*tnb.ListSolNetworkInstancesOutput, bool) bool, ...request.Option) error - - ListSolNetworkOperations(*tnb.ListSolNetworkOperationsInput) (*tnb.ListSolNetworkOperationsOutput, error) - ListSolNetworkOperationsWithContext(aws.Context, *tnb.ListSolNetworkOperationsInput, ...request.Option) (*tnb.ListSolNetworkOperationsOutput, error) - ListSolNetworkOperationsRequest(*tnb.ListSolNetworkOperationsInput) (*request.Request, *tnb.ListSolNetworkOperationsOutput) - - ListSolNetworkOperationsPages(*tnb.ListSolNetworkOperationsInput, func(*tnb.ListSolNetworkOperationsOutput, bool) bool) error - ListSolNetworkOperationsPagesWithContext(aws.Context, *tnb.ListSolNetworkOperationsInput, func(*tnb.ListSolNetworkOperationsOutput, bool) bool, ...request.Option) error - - ListSolNetworkPackages(*tnb.ListSolNetworkPackagesInput) (*tnb.ListSolNetworkPackagesOutput, error) - ListSolNetworkPackagesWithContext(aws.Context, *tnb.ListSolNetworkPackagesInput, ...request.Option) (*tnb.ListSolNetworkPackagesOutput, error) - ListSolNetworkPackagesRequest(*tnb.ListSolNetworkPackagesInput) (*request.Request, *tnb.ListSolNetworkPackagesOutput) - - ListSolNetworkPackagesPages(*tnb.ListSolNetworkPackagesInput, func(*tnb.ListSolNetworkPackagesOutput, bool) bool) error - ListSolNetworkPackagesPagesWithContext(aws.Context, *tnb.ListSolNetworkPackagesInput, func(*tnb.ListSolNetworkPackagesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*tnb.ListTagsForResourceInput) (*tnb.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *tnb.ListTagsForResourceInput, ...request.Option) (*tnb.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*tnb.ListTagsForResourceInput) (*request.Request, *tnb.ListTagsForResourceOutput) - - PutSolFunctionPackageContent(*tnb.PutSolFunctionPackageContentInput) (*tnb.PutSolFunctionPackageContentOutput, error) - PutSolFunctionPackageContentWithContext(aws.Context, *tnb.PutSolFunctionPackageContentInput, ...request.Option) (*tnb.PutSolFunctionPackageContentOutput, error) - PutSolFunctionPackageContentRequest(*tnb.PutSolFunctionPackageContentInput) (*request.Request, *tnb.PutSolFunctionPackageContentOutput) - - PutSolNetworkPackageContent(*tnb.PutSolNetworkPackageContentInput) (*tnb.PutSolNetworkPackageContentOutput, error) - PutSolNetworkPackageContentWithContext(aws.Context, *tnb.PutSolNetworkPackageContentInput, ...request.Option) (*tnb.PutSolNetworkPackageContentOutput, error) - PutSolNetworkPackageContentRequest(*tnb.PutSolNetworkPackageContentInput) (*request.Request, *tnb.PutSolNetworkPackageContentOutput) - - TagResource(*tnb.TagResourceInput) (*tnb.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *tnb.TagResourceInput, ...request.Option) (*tnb.TagResourceOutput, error) - TagResourceRequest(*tnb.TagResourceInput) (*request.Request, *tnb.TagResourceOutput) - - TerminateSolNetworkInstance(*tnb.TerminateSolNetworkInstanceInput) (*tnb.TerminateSolNetworkInstanceOutput, error) - TerminateSolNetworkInstanceWithContext(aws.Context, *tnb.TerminateSolNetworkInstanceInput, ...request.Option) (*tnb.TerminateSolNetworkInstanceOutput, error) - TerminateSolNetworkInstanceRequest(*tnb.TerminateSolNetworkInstanceInput) (*request.Request, *tnb.TerminateSolNetworkInstanceOutput) - - UntagResource(*tnb.UntagResourceInput) (*tnb.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *tnb.UntagResourceInput, ...request.Option) (*tnb.UntagResourceOutput, error) - UntagResourceRequest(*tnb.UntagResourceInput) (*request.Request, *tnb.UntagResourceOutput) - - UpdateSolFunctionPackage(*tnb.UpdateSolFunctionPackageInput) (*tnb.UpdateSolFunctionPackageOutput, error) - UpdateSolFunctionPackageWithContext(aws.Context, *tnb.UpdateSolFunctionPackageInput, ...request.Option) (*tnb.UpdateSolFunctionPackageOutput, error) - UpdateSolFunctionPackageRequest(*tnb.UpdateSolFunctionPackageInput) (*request.Request, *tnb.UpdateSolFunctionPackageOutput) - - UpdateSolNetworkInstance(*tnb.UpdateSolNetworkInstanceInput) (*tnb.UpdateSolNetworkInstanceOutput, error) - UpdateSolNetworkInstanceWithContext(aws.Context, *tnb.UpdateSolNetworkInstanceInput, ...request.Option) (*tnb.UpdateSolNetworkInstanceOutput, error) - UpdateSolNetworkInstanceRequest(*tnb.UpdateSolNetworkInstanceInput) (*request.Request, *tnb.UpdateSolNetworkInstanceOutput) - - UpdateSolNetworkPackage(*tnb.UpdateSolNetworkPackageInput) (*tnb.UpdateSolNetworkPackageOutput, error) - UpdateSolNetworkPackageWithContext(aws.Context, *tnb.UpdateSolNetworkPackageInput, ...request.Option) (*tnb.UpdateSolNetworkPackageOutput, error) - UpdateSolNetworkPackageRequest(*tnb.UpdateSolNetworkPackageInput) (*request.Request, *tnb.UpdateSolNetworkPackageOutput) - - ValidateSolFunctionPackageContent(*tnb.ValidateSolFunctionPackageContentInput) (*tnb.ValidateSolFunctionPackageContentOutput, error) - ValidateSolFunctionPackageContentWithContext(aws.Context, *tnb.ValidateSolFunctionPackageContentInput, ...request.Option) (*tnb.ValidateSolFunctionPackageContentOutput, error) - ValidateSolFunctionPackageContentRequest(*tnb.ValidateSolFunctionPackageContentInput) (*request.Request, *tnb.ValidateSolFunctionPackageContentOutput) - - ValidateSolNetworkPackageContent(*tnb.ValidateSolNetworkPackageContentInput) (*tnb.ValidateSolNetworkPackageContentOutput, error) - ValidateSolNetworkPackageContentWithContext(aws.Context, *tnb.ValidateSolNetworkPackageContentInput, ...request.Option) (*tnb.ValidateSolNetworkPackageContentOutput, error) - ValidateSolNetworkPackageContentRequest(*tnb.ValidateSolNetworkPackageContentInput) (*request.Request, *tnb.ValidateSolNetworkPackageContentOutput) -} - -var _ TnbAPI = (*tnb.Tnb)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/api.go deleted file mode 100644 index 765944957c0c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/api.go +++ /dev/null @@ -1,4633 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package trustedadvisor - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opGetOrganizationRecommendation = "GetOrganizationRecommendation" - -// GetOrganizationRecommendationRequest generates a "aws/request.Request" representing the -// client's request for the GetOrganizationRecommendation 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 GetOrganizationRecommendation for more information on using the GetOrganizationRecommendation -// 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 GetOrganizationRecommendationRequest method. -// req, resp := client.GetOrganizationRecommendationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/GetOrganizationRecommendation -func (c *TrustedAdvisor) GetOrganizationRecommendationRequest(input *GetOrganizationRecommendationInput) (req *request.Request, output *GetOrganizationRecommendationOutput) { - op := &request.Operation{ - Name: opGetOrganizationRecommendation, - HTTPMethod: "GET", - HTTPPath: "/v1/organization-recommendations/{organizationRecommendationIdentifier}", - } - - if input == nil { - input = &GetOrganizationRecommendationInput{} - } - - output = &GetOrganizationRecommendationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetOrganizationRecommendation API operation for TrustedAdvisor Public API. -// -// Get a specific recommendation within an AWS Organizations organization. This -// API supports only prioritized recommendations. -// -// 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 TrustedAdvisor Public API's -// API operation GetOrganizationRecommendation for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ResourceNotFoundException -// Exception that the requested resource has not been found -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/GetOrganizationRecommendation -func (c *TrustedAdvisor) GetOrganizationRecommendation(input *GetOrganizationRecommendationInput) (*GetOrganizationRecommendationOutput, error) { - req, out := c.GetOrganizationRecommendationRequest(input) - return out, req.Send() -} - -// GetOrganizationRecommendationWithContext is the same as GetOrganizationRecommendation with the addition of -// the ability to pass a context and additional request options. -// -// See GetOrganizationRecommendation 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 *TrustedAdvisor) GetOrganizationRecommendationWithContext(ctx aws.Context, input *GetOrganizationRecommendationInput, opts ...request.Option) (*GetOrganizationRecommendationOutput, error) { - req, out := c.GetOrganizationRecommendationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRecommendation = "GetRecommendation" - -// GetRecommendationRequest generates a "aws/request.Request" representing the -// client's request for the GetRecommendation 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 GetRecommendation for more information on using the GetRecommendation -// 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 GetRecommendationRequest method. -// req, resp := client.GetRecommendationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/GetRecommendation -func (c *TrustedAdvisor) GetRecommendationRequest(input *GetRecommendationInput) (req *request.Request, output *GetRecommendationOutput) { - op := &request.Operation{ - Name: opGetRecommendation, - HTTPMethod: "GET", - HTTPPath: "/v1/recommendations/{recommendationIdentifier}", - } - - if input == nil { - input = &GetRecommendationInput{} - } - - output = &GetRecommendationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRecommendation API operation for TrustedAdvisor Public API. -// -// # Get a specific Recommendation -// -// 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 TrustedAdvisor Public API's -// API operation GetRecommendation for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ResourceNotFoundException -// Exception that the requested resource has not been found -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/GetRecommendation -func (c *TrustedAdvisor) GetRecommendation(input *GetRecommendationInput) (*GetRecommendationOutput, error) { - req, out := c.GetRecommendationRequest(input) - return out, req.Send() -} - -// GetRecommendationWithContext is the same as GetRecommendation with the addition of -// the ability to pass a context and additional request options. -// -// See GetRecommendation 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 *TrustedAdvisor) GetRecommendationWithContext(ctx aws.Context, input *GetRecommendationInput, opts ...request.Option) (*GetRecommendationOutput, error) { - req, out := c.GetRecommendationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListChecks = "ListChecks" - -// ListChecksRequest generates a "aws/request.Request" representing the -// client's request for the ListChecks 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 ListChecks for more information on using the ListChecks -// 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 ListChecksRequest method. -// req, resp := client.ListChecksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListChecks -func (c *TrustedAdvisor) ListChecksRequest(input *ListChecksInput) (req *request.Request, output *ListChecksOutput) { - op := &request.Operation{ - Name: opListChecks, - HTTPMethod: "GET", - HTTPPath: "/v1/checks", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListChecksInput{} - } - - output = &ListChecksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListChecks API operation for TrustedAdvisor Public API. -// -// # List a filterable set of Checks -// -// 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 TrustedAdvisor Public API's -// API operation ListChecks for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListChecks -func (c *TrustedAdvisor) ListChecks(input *ListChecksInput) (*ListChecksOutput, error) { - req, out := c.ListChecksRequest(input) - return out, req.Send() -} - -// ListChecksWithContext is the same as ListChecks with the addition of -// the ability to pass a context and additional request options. -// -// See ListChecks 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 *TrustedAdvisor) ListChecksWithContext(ctx aws.Context, input *ListChecksInput, opts ...request.Option) (*ListChecksOutput, error) { - req, out := c.ListChecksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListChecksPages iterates over the pages of a ListChecks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChecks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListChecks operation. -// pageNum := 0 -// err := client.ListChecksPages(params, -// func(page *trustedadvisor.ListChecksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *TrustedAdvisor) ListChecksPages(input *ListChecksInput, fn func(*ListChecksOutput, bool) bool) error { - return c.ListChecksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChecksPagesWithContext same as ListChecksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *TrustedAdvisor) ListChecksPagesWithContext(ctx aws.Context, input *ListChecksInput, fn func(*ListChecksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListChecksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListChecksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListChecksOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListOrganizationRecommendationAccounts = "ListOrganizationRecommendationAccounts" - -// ListOrganizationRecommendationAccountsRequest generates a "aws/request.Request" representing the -// client's request for the ListOrganizationRecommendationAccounts 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 ListOrganizationRecommendationAccounts for more information on using the ListOrganizationRecommendationAccounts -// 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 ListOrganizationRecommendationAccountsRequest method. -// req, resp := client.ListOrganizationRecommendationAccountsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListOrganizationRecommendationAccounts -func (c *TrustedAdvisor) ListOrganizationRecommendationAccountsRequest(input *ListOrganizationRecommendationAccountsInput) (req *request.Request, output *ListOrganizationRecommendationAccountsOutput) { - op := &request.Operation{ - Name: opListOrganizationRecommendationAccounts, - HTTPMethod: "GET", - HTTPPath: "/v1/organization-recommendations/{organizationRecommendationIdentifier}/accounts", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListOrganizationRecommendationAccountsInput{} - } - - output = &ListOrganizationRecommendationAccountsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOrganizationRecommendationAccounts API operation for TrustedAdvisor Public API. -// -// Lists the accounts that own the resources for an organization aggregate recommendation. -// This API only supports prioritized recommendations. -// -// 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 TrustedAdvisor Public API's -// API operation ListOrganizationRecommendationAccounts for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ResourceNotFoundException -// Exception that the requested resource has not been found -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListOrganizationRecommendationAccounts -func (c *TrustedAdvisor) ListOrganizationRecommendationAccounts(input *ListOrganizationRecommendationAccountsInput) (*ListOrganizationRecommendationAccountsOutput, error) { - req, out := c.ListOrganizationRecommendationAccountsRequest(input) - return out, req.Send() -} - -// ListOrganizationRecommendationAccountsWithContext is the same as ListOrganizationRecommendationAccounts with the addition of -// the ability to pass a context and additional request options. -// -// See ListOrganizationRecommendationAccounts 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 *TrustedAdvisor) ListOrganizationRecommendationAccountsWithContext(ctx aws.Context, input *ListOrganizationRecommendationAccountsInput, opts ...request.Option) (*ListOrganizationRecommendationAccountsOutput, error) { - req, out := c.ListOrganizationRecommendationAccountsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListOrganizationRecommendationAccountsPages iterates over the pages of a ListOrganizationRecommendationAccounts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOrganizationRecommendationAccounts method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListOrganizationRecommendationAccounts operation. -// pageNum := 0 -// err := client.ListOrganizationRecommendationAccountsPages(params, -// func(page *trustedadvisor.ListOrganizationRecommendationAccountsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *TrustedAdvisor) ListOrganizationRecommendationAccountsPages(input *ListOrganizationRecommendationAccountsInput, fn func(*ListOrganizationRecommendationAccountsOutput, bool) bool) error { - return c.ListOrganizationRecommendationAccountsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOrganizationRecommendationAccountsPagesWithContext same as ListOrganizationRecommendationAccountsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *TrustedAdvisor) ListOrganizationRecommendationAccountsPagesWithContext(ctx aws.Context, input *ListOrganizationRecommendationAccountsInput, fn func(*ListOrganizationRecommendationAccountsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListOrganizationRecommendationAccountsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListOrganizationRecommendationAccountsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListOrganizationRecommendationAccountsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListOrganizationRecommendationResources = "ListOrganizationRecommendationResources" - -// ListOrganizationRecommendationResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListOrganizationRecommendationResources 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 ListOrganizationRecommendationResources for more information on using the ListOrganizationRecommendationResources -// 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 ListOrganizationRecommendationResourcesRequest method. -// req, resp := client.ListOrganizationRecommendationResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListOrganizationRecommendationResources -func (c *TrustedAdvisor) ListOrganizationRecommendationResourcesRequest(input *ListOrganizationRecommendationResourcesInput) (req *request.Request, output *ListOrganizationRecommendationResourcesOutput) { - op := &request.Operation{ - Name: opListOrganizationRecommendationResources, - HTTPMethod: "GET", - HTTPPath: "/v1/organization-recommendations/{organizationRecommendationIdentifier}/resources", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListOrganizationRecommendationResourcesInput{} - } - - output = &ListOrganizationRecommendationResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOrganizationRecommendationResources API operation for TrustedAdvisor Public API. -// -// List Resources of a Recommendation within an Organization. This API only -// supports prioritized recommendations. -// -// 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 TrustedAdvisor Public API's -// API operation ListOrganizationRecommendationResources for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ResourceNotFoundException -// Exception that the requested resource has not been found -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListOrganizationRecommendationResources -func (c *TrustedAdvisor) ListOrganizationRecommendationResources(input *ListOrganizationRecommendationResourcesInput) (*ListOrganizationRecommendationResourcesOutput, error) { - req, out := c.ListOrganizationRecommendationResourcesRequest(input) - return out, req.Send() -} - -// ListOrganizationRecommendationResourcesWithContext is the same as ListOrganizationRecommendationResources with the addition of -// the ability to pass a context and additional request options. -// -// See ListOrganizationRecommendationResources 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 *TrustedAdvisor) ListOrganizationRecommendationResourcesWithContext(ctx aws.Context, input *ListOrganizationRecommendationResourcesInput, opts ...request.Option) (*ListOrganizationRecommendationResourcesOutput, error) { - req, out := c.ListOrganizationRecommendationResourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListOrganizationRecommendationResourcesPages iterates over the pages of a ListOrganizationRecommendationResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOrganizationRecommendationResources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListOrganizationRecommendationResources operation. -// pageNum := 0 -// err := client.ListOrganizationRecommendationResourcesPages(params, -// func(page *trustedadvisor.ListOrganizationRecommendationResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *TrustedAdvisor) ListOrganizationRecommendationResourcesPages(input *ListOrganizationRecommendationResourcesInput, fn func(*ListOrganizationRecommendationResourcesOutput, bool) bool) error { - return c.ListOrganizationRecommendationResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOrganizationRecommendationResourcesPagesWithContext same as ListOrganizationRecommendationResourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *TrustedAdvisor) ListOrganizationRecommendationResourcesPagesWithContext(ctx aws.Context, input *ListOrganizationRecommendationResourcesInput, fn func(*ListOrganizationRecommendationResourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListOrganizationRecommendationResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListOrganizationRecommendationResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListOrganizationRecommendationResourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListOrganizationRecommendations = "ListOrganizationRecommendations" - -// ListOrganizationRecommendationsRequest generates a "aws/request.Request" representing the -// client's request for the ListOrganizationRecommendations 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 ListOrganizationRecommendations for more information on using the ListOrganizationRecommendations -// 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 ListOrganizationRecommendationsRequest method. -// req, resp := client.ListOrganizationRecommendationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListOrganizationRecommendations -func (c *TrustedAdvisor) ListOrganizationRecommendationsRequest(input *ListOrganizationRecommendationsInput) (req *request.Request, output *ListOrganizationRecommendationsOutput) { - op := &request.Operation{ - Name: opListOrganizationRecommendations, - HTTPMethod: "GET", - HTTPPath: "/v1/organization-recommendations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListOrganizationRecommendationsInput{} - } - - output = &ListOrganizationRecommendationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOrganizationRecommendations API operation for TrustedAdvisor Public API. -// -// List a filterable set of Recommendations within an Organization. This API -// only supports prioritized recommendations. -// -// 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 TrustedAdvisor Public API's -// API operation ListOrganizationRecommendations for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListOrganizationRecommendations -func (c *TrustedAdvisor) ListOrganizationRecommendations(input *ListOrganizationRecommendationsInput) (*ListOrganizationRecommendationsOutput, error) { - req, out := c.ListOrganizationRecommendationsRequest(input) - return out, req.Send() -} - -// ListOrganizationRecommendationsWithContext is the same as ListOrganizationRecommendations with the addition of -// the ability to pass a context and additional request options. -// -// See ListOrganizationRecommendations 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 *TrustedAdvisor) ListOrganizationRecommendationsWithContext(ctx aws.Context, input *ListOrganizationRecommendationsInput, opts ...request.Option) (*ListOrganizationRecommendationsOutput, error) { - req, out := c.ListOrganizationRecommendationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListOrganizationRecommendationsPages iterates over the pages of a ListOrganizationRecommendations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOrganizationRecommendations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListOrganizationRecommendations operation. -// pageNum := 0 -// err := client.ListOrganizationRecommendationsPages(params, -// func(page *trustedadvisor.ListOrganizationRecommendationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *TrustedAdvisor) ListOrganizationRecommendationsPages(input *ListOrganizationRecommendationsInput, fn func(*ListOrganizationRecommendationsOutput, bool) bool) error { - return c.ListOrganizationRecommendationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOrganizationRecommendationsPagesWithContext same as ListOrganizationRecommendationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *TrustedAdvisor) ListOrganizationRecommendationsPagesWithContext(ctx aws.Context, input *ListOrganizationRecommendationsInput, fn func(*ListOrganizationRecommendationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListOrganizationRecommendationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListOrganizationRecommendationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListOrganizationRecommendationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRecommendationResources = "ListRecommendationResources" - -// ListRecommendationResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListRecommendationResources 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 ListRecommendationResources for more information on using the ListRecommendationResources -// 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 ListRecommendationResourcesRequest method. -// req, resp := client.ListRecommendationResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListRecommendationResources -func (c *TrustedAdvisor) ListRecommendationResourcesRequest(input *ListRecommendationResourcesInput) (req *request.Request, output *ListRecommendationResourcesOutput) { - op := &request.Operation{ - Name: opListRecommendationResources, - HTTPMethod: "GET", - HTTPPath: "/v1/recommendations/{recommendationIdentifier}/resources", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRecommendationResourcesInput{} - } - - output = &ListRecommendationResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRecommendationResources API operation for TrustedAdvisor Public API. -// -// # List Resources of a Recommendation -// -// 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 TrustedAdvisor Public API's -// API operation ListRecommendationResources for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ResourceNotFoundException -// Exception that the requested resource has not been found -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListRecommendationResources -func (c *TrustedAdvisor) ListRecommendationResources(input *ListRecommendationResourcesInput) (*ListRecommendationResourcesOutput, error) { - req, out := c.ListRecommendationResourcesRequest(input) - return out, req.Send() -} - -// ListRecommendationResourcesWithContext is the same as ListRecommendationResources with the addition of -// the ability to pass a context and additional request options. -// -// See ListRecommendationResources 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 *TrustedAdvisor) ListRecommendationResourcesWithContext(ctx aws.Context, input *ListRecommendationResourcesInput, opts ...request.Option) (*ListRecommendationResourcesOutput, error) { - req, out := c.ListRecommendationResourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRecommendationResourcesPages iterates over the pages of a ListRecommendationResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRecommendationResources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRecommendationResources operation. -// pageNum := 0 -// err := client.ListRecommendationResourcesPages(params, -// func(page *trustedadvisor.ListRecommendationResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *TrustedAdvisor) ListRecommendationResourcesPages(input *ListRecommendationResourcesInput, fn func(*ListRecommendationResourcesOutput, bool) bool) error { - return c.ListRecommendationResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRecommendationResourcesPagesWithContext same as ListRecommendationResourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *TrustedAdvisor) ListRecommendationResourcesPagesWithContext(ctx aws.Context, input *ListRecommendationResourcesInput, fn func(*ListRecommendationResourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRecommendationResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRecommendationResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRecommendationResourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRecommendations = "ListRecommendations" - -// ListRecommendationsRequest generates a "aws/request.Request" representing the -// client's request for the ListRecommendations 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 ListRecommendations for more information on using the ListRecommendations -// 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 ListRecommendationsRequest method. -// req, resp := client.ListRecommendationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListRecommendations -func (c *TrustedAdvisor) ListRecommendationsRequest(input *ListRecommendationsInput) (req *request.Request, output *ListRecommendationsOutput) { - op := &request.Operation{ - Name: opListRecommendations, - HTTPMethod: "GET", - HTTPPath: "/v1/recommendations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRecommendationsInput{} - } - - output = &ListRecommendationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRecommendations API operation for TrustedAdvisor Public API. -// -// # List a filterable set of Recommendations -// -// 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 TrustedAdvisor Public API's -// API operation ListRecommendations for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/ListRecommendations -func (c *TrustedAdvisor) ListRecommendations(input *ListRecommendationsInput) (*ListRecommendationsOutput, error) { - req, out := c.ListRecommendationsRequest(input) - return out, req.Send() -} - -// ListRecommendationsWithContext is the same as ListRecommendations with the addition of -// the ability to pass a context and additional request options. -// -// See ListRecommendations 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 *TrustedAdvisor) ListRecommendationsWithContext(ctx aws.Context, input *ListRecommendationsInput, opts ...request.Option) (*ListRecommendationsOutput, error) { - req, out := c.ListRecommendationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRecommendationsPages iterates over the pages of a ListRecommendations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRecommendations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRecommendations operation. -// pageNum := 0 -// err := client.ListRecommendationsPages(params, -// func(page *trustedadvisor.ListRecommendationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *TrustedAdvisor) ListRecommendationsPages(input *ListRecommendationsInput, fn func(*ListRecommendationsOutput, bool) bool) error { - return c.ListRecommendationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRecommendationsPagesWithContext same as ListRecommendationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *TrustedAdvisor) ListRecommendationsPagesWithContext(ctx aws.Context, input *ListRecommendationsInput, fn func(*ListRecommendationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRecommendationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRecommendationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRecommendationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opUpdateOrganizationRecommendationLifecycle = "UpdateOrganizationRecommendationLifecycle" - -// UpdateOrganizationRecommendationLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateOrganizationRecommendationLifecycle 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 UpdateOrganizationRecommendationLifecycle for more information on using the UpdateOrganizationRecommendationLifecycle -// 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 UpdateOrganizationRecommendationLifecycleRequest method. -// req, resp := client.UpdateOrganizationRecommendationLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/UpdateOrganizationRecommendationLifecycle -func (c *TrustedAdvisor) UpdateOrganizationRecommendationLifecycleRequest(input *UpdateOrganizationRecommendationLifecycleInput) (req *request.Request, output *UpdateOrganizationRecommendationLifecycleOutput) { - op := &request.Operation{ - Name: opUpdateOrganizationRecommendationLifecycle, - HTTPMethod: "PUT", - HTTPPath: "/v1/organization-recommendations/{organizationRecommendationIdentifier}/lifecycle", - } - - if input == nil { - input = &UpdateOrganizationRecommendationLifecycleInput{} - } - - output = &UpdateOrganizationRecommendationLifecycleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateOrganizationRecommendationLifecycle API operation for TrustedAdvisor Public API. -// -// Update the lifecyle of a Recommendation within an Organization. This API -// only supports prioritized recommendations. -// -// 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 TrustedAdvisor Public API's -// API operation UpdateOrganizationRecommendationLifecycle for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - ConflictException -// Exception that the request was denied due to conflictions in state -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ResourceNotFoundException -// Exception that the requested resource has not been found -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/UpdateOrganizationRecommendationLifecycle -func (c *TrustedAdvisor) UpdateOrganizationRecommendationLifecycle(input *UpdateOrganizationRecommendationLifecycleInput) (*UpdateOrganizationRecommendationLifecycleOutput, error) { - req, out := c.UpdateOrganizationRecommendationLifecycleRequest(input) - return out, req.Send() -} - -// UpdateOrganizationRecommendationLifecycleWithContext is the same as UpdateOrganizationRecommendationLifecycle with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateOrganizationRecommendationLifecycle 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 *TrustedAdvisor) UpdateOrganizationRecommendationLifecycleWithContext(ctx aws.Context, input *UpdateOrganizationRecommendationLifecycleInput, opts ...request.Option) (*UpdateOrganizationRecommendationLifecycleOutput, error) { - req, out := c.UpdateOrganizationRecommendationLifecycleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateRecommendationLifecycle = "UpdateRecommendationLifecycle" - -// UpdateRecommendationLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRecommendationLifecycle 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 UpdateRecommendationLifecycle for more information on using the UpdateRecommendationLifecycle -// 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 UpdateRecommendationLifecycleRequest method. -// req, resp := client.UpdateRecommendationLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/UpdateRecommendationLifecycle -func (c *TrustedAdvisor) UpdateRecommendationLifecycleRequest(input *UpdateRecommendationLifecycleInput) (req *request.Request, output *UpdateRecommendationLifecycleOutput) { - op := &request.Operation{ - Name: opUpdateRecommendationLifecycle, - HTTPMethod: "PUT", - HTTPPath: "/v1/recommendations/{recommendationIdentifier}/lifecycle", - } - - if input == nil { - input = &UpdateRecommendationLifecycleInput{} - } - - output = &UpdateRecommendationLifecycleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UpdateRecommendationLifecycle API operation for TrustedAdvisor Public API. -// -// Update the lifecyle of a Recommendation. This API only supports prioritized -// recommendations. -// -// 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 TrustedAdvisor Public API's -// API operation UpdateRecommendationLifecycle for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// Exception that access has been denied due to insufficient access -// -// - ConflictException -// Exception that the request was denied due to conflictions in state -// -// - InternalServerException -// Exception to notify that an unexpected internal error occurred during processing -// of the request -// -// - ValidationException -// Exception that the request failed to satisfy service constraints -// -// - ResourceNotFoundException -// Exception that the requested resource has not been found -// -// - ThrottlingException -// Exception to notify that requests are being throttled -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15/UpdateRecommendationLifecycle -func (c *TrustedAdvisor) UpdateRecommendationLifecycle(input *UpdateRecommendationLifecycleInput) (*UpdateRecommendationLifecycleOutput, error) { - req, out := c.UpdateRecommendationLifecycleRequest(input) - return out, req.Send() -} - -// UpdateRecommendationLifecycleWithContext is the same as UpdateRecommendationLifecycle with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateRecommendationLifecycle 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 *TrustedAdvisor) UpdateRecommendationLifecycleWithContext(ctx aws.Context, input *UpdateRecommendationLifecycleInput, opts ...request.Option) (*UpdateRecommendationLifecycleOutput, error) { - req, out := c.UpdateRecommendationLifecycleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Exception that access has been denied due to insufficient access -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Summary of an AccountRecommendationLifecycle for an Organization Recommendation -type AccountRecommendationLifecycleSummary struct { - _ struct{} `type:"structure"` - - // The AWS account ID - AccountId *string `locationName:"accountId" min:"12" type:"string"` - - // The Recommendation ARN - AccountRecommendationArn *string `locationName:"accountRecommendationArn" min:"20" type:"string"` - - // When the Recommendation was last updated - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The lifecycle stage from AWS Trusted Advisor Priority - LifecycleStage *string `locationName:"lifecycleStage" type:"string" enum:"RecommendationLifecycleStage"` - - // Reason for the lifecycle stage change - // - // UpdateReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AccountRecommendationLifecycleSummary's - // String and GoString methods. - UpdateReason *string `locationName:"updateReason" min:"10" type:"string" sensitive:"true"` - - // Reason code for the lifecycle state change - UpdateReasonCode *string `locationName:"updateReasonCode" type:"string" enum:"UpdateRecommendationLifecycleStageReasonCode"` - - // The person on whose behalf a Technical Account Manager (TAM) updated the - // recommendation. This information is only available when a Technical Account - // Manager takes an action on a recommendation managed by AWS Trusted Advisor - // Priority - UpdatedOnBehalfOf *string `locationName:"updatedOnBehalfOf" type:"string"` - - // The job title of the person on whose behalf a Technical Account Manager (TAM) - // updated the recommendation. This information is only available when a Technical - // Account Manager takes an action on a recommendation managed by AWS Trusted - // Advisor Priority - UpdatedOnBehalfOfJobTitle *string `locationName:"updatedOnBehalfOfJobTitle" 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 AccountRecommendationLifecycleSummary) 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 AccountRecommendationLifecycleSummary) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *AccountRecommendationLifecycleSummary) SetAccountId(v string) *AccountRecommendationLifecycleSummary { - s.AccountId = &v - return s -} - -// SetAccountRecommendationArn sets the AccountRecommendationArn field's value. -func (s *AccountRecommendationLifecycleSummary) SetAccountRecommendationArn(v string) *AccountRecommendationLifecycleSummary { - s.AccountRecommendationArn = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *AccountRecommendationLifecycleSummary) SetLastUpdatedAt(v time.Time) *AccountRecommendationLifecycleSummary { - s.LastUpdatedAt = &v - return s -} - -// SetLifecycleStage sets the LifecycleStage field's value. -func (s *AccountRecommendationLifecycleSummary) SetLifecycleStage(v string) *AccountRecommendationLifecycleSummary { - s.LifecycleStage = &v - return s -} - -// SetUpdateReason sets the UpdateReason field's value. -func (s *AccountRecommendationLifecycleSummary) SetUpdateReason(v string) *AccountRecommendationLifecycleSummary { - s.UpdateReason = &v - return s -} - -// SetUpdateReasonCode sets the UpdateReasonCode field's value. -func (s *AccountRecommendationLifecycleSummary) SetUpdateReasonCode(v string) *AccountRecommendationLifecycleSummary { - s.UpdateReasonCode = &v - return s -} - -// SetUpdatedOnBehalfOf sets the UpdatedOnBehalfOf field's value. -func (s *AccountRecommendationLifecycleSummary) SetUpdatedOnBehalfOf(v string) *AccountRecommendationLifecycleSummary { - s.UpdatedOnBehalfOf = &v - return s -} - -// SetUpdatedOnBehalfOfJobTitle sets the UpdatedOnBehalfOfJobTitle field's value. -func (s *AccountRecommendationLifecycleSummary) SetUpdatedOnBehalfOfJobTitle(v string) *AccountRecommendationLifecycleSummary { - s.UpdatedOnBehalfOfJobTitle = &v - return s -} - -// A summary of an AWS Trusted Advisor Check -type CheckSummary struct { - _ struct{} `type:"structure"` - - // The ARN of the AWS Trusted Advisor Check - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The AWS Services that the Check applies to - // - // AwsServices is a required field - AwsServices []*string `locationName:"awsServices" type:"list" required:"true"` - - // A description of what the AWS Trusted Advisor Check is monitoring - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The unique identifier of the AWS Trusted Advisor Check - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // The column headings for the metadata returned in the resource - // - // Metadata is a required field - Metadata map[string]*string `locationName:"metadata" type:"map" required:"true"` - - // The name of the AWS Trusted Advisor Check - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The Recommendation pillars that the AWS Trusted Advisor Check falls under - // - // Pillars is a required field - Pillars []*string `locationName:"pillars" type:"list" required:"true" enum:"RecommendationPillar"` - - // The source of the Recommendation - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true" enum:"RecommendationSource"` -} - -// 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 CheckSummary) 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 CheckSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CheckSummary) SetArn(v string) *CheckSummary { - s.Arn = &v - return s -} - -// SetAwsServices sets the AwsServices field's value. -func (s *CheckSummary) SetAwsServices(v []*string) *CheckSummary { - s.AwsServices = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CheckSummary) SetDescription(v string) *CheckSummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *CheckSummary) SetId(v string) *CheckSummary { - s.Id = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *CheckSummary) SetMetadata(v map[string]*string) *CheckSummary { - s.Metadata = v - return s -} - -// SetName sets the Name field's value. -func (s *CheckSummary) SetName(v string) *CheckSummary { - s.Name = &v - return s -} - -// SetPillars sets the Pillars field's value. -func (s *CheckSummary) SetPillars(v []*string) *CheckSummary { - s.Pillars = v - return s -} - -// SetSource sets the Source field's value. -func (s *CheckSummary) SetSource(v string) *CheckSummary { - s.Source = &v - return s -} - -// Exception that the request was denied due to conflictions in state -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type GetOrganizationRecommendationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Recommendation identifier - // - // OrganizationRecommendationIdentifier is a required field - OrganizationRecommendationIdentifier *string `location:"uri" locationName:"organizationRecommendationIdentifier" min:"20" 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 GetOrganizationRecommendationInput) 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 GetOrganizationRecommendationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOrganizationRecommendationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOrganizationRecommendationInput"} - if s.OrganizationRecommendationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationRecommendationIdentifier")) - } - if s.OrganizationRecommendationIdentifier != nil && len(*s.OrganizationRecommendationIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OrganizationRecommendationIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOrganizationRecommendationIdentifier sets the OrganizationRecommendationIdentifier field's value. -func (s *GetOrganizationRecommendationInput) SetOrganizationRecommendationIdentifier(v string) *GetOrganizationRecommendationInput { - s.OrganizationRecommendationIdentifier = &v - return s -} - -type GetOrganizationRecommendationOutput struct { - _ struct{} `type:"structure"` - - // The Recommendation - OrganizationRecommendation *OrganizationRecommendation `locationName:"organizationRecommendation" 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 GetOrganizationRecommendationOutput) 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 GetOrganizationRecommendationOutput) GoString() string { - return s.String() -} - -// SetOrganizationRecommendation sets the OrganizationRecommendation field's value. -func (s *GetOrganizationRecommendationOutput) SetOrganizationRecommendation(v *OrganizationRecommendation) *GetOrganizationRecommendationOutput { - s.OrganizationRecommendation = v - return s -} - -type GetRecommendationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Recommendation identifier - // - // RecommendationIdentifier is a required field - RecommendationIdentifier *string `location:"uri" locationName:"recommendationIdentifier" min:"20" 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 GetRecommendationInput) 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 GetRecommendationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRecommendationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRecommendationInput"} - if s.RecommendationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("RecommendationIdentifier")) - } - if s.RecommendationIdentifier != nil && len(*s.RecommendationIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RecommendationIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRecommendationIdentifier sets the RecommendationIdentifier field's value. -func (s *GetRecommendationInput) SetRecommendationIdentifier(v string) *GetRecommendationInput { - s.RecommendationIdentifier = &v - return s -} - -type GetRecommendationOutput struct { - _ struct{} `type:"structure"` - - // The Recommendation - Recommendation *Recommendation `locationName:"recommendation" 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 GetRecommendationOutput) 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 GetRecommendationOutput) GoString() string { - return s.String() -} - -// SetRecommendation sets the Recommendation field's value. -func (s *GetRecommendationOutput) SetRecommendation(v *Recommendation) *GetRecommendationOutput { - s.Recommendation = v - return s -} - -// Exception to notify that an unexpected internal error occurred during processing -// of the request -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListChecksInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The aws service associated with the check - AwsService *string `location:"querystring" locationName:"awsService" min:"2" type:"string"` - - // The ISO 639-1 code for the language that you want your checks to appear in. - Language *string `location:"querystring" locationName:"language" type:"string" enum:"RecommendationLanguage"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"4" type:"string"` - - // The pillar of the check - Pillar *string `location:"querystring" locationName:"pillar" type:"string" enum:"RecommendationPillar"` - - // The source of the check - Source *string `location:"querystring" locationName:"source" type:"string" enum:"RecommendationSource"` -} - -// 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 ListChecksInput) 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 ListChecksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListChecksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChecksInput"} - if s.AwsService != nil && len(*s.AwsService) < 2 { - invalidParams.Add(request.NewErrParamMinLen("AwsService", 2)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAwsService sets the AwsService field's value. -func (s *ListChecksInput) SetAwsService(v string) *ListChecksInput { - s.AwsService = &v - return s -} - -// SetLanguage sets the Language field's value. -func (s *ListChecksInput) SetLanguage(v string) *ListChecksInput { - s.Language = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListChecksInput) SetMaxResults(v int64) *ListChecksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChecksInput) SetNextToken(v string) *ListChecksInput { - s.NextToken = &v - return s -} - -// SetPillar sets the Pillar field's value. -func (s *ListChecksInput) SetPillar(v string) *ListChecksInput { - s.Pillar = &v - return s -} - -// SetSource sets the Source field's value. -func (s *ListChecksInput) SetSource(v string) *ListChecksInput { - s.Source = &v - return s -} - -type ListChecksOutput struct { - _ struct{} `type:"structure"` - - // The list of Checks - // - // CheckSummaries is a required field - CheckSummaries []*CheckSummary `locationName:"checkSummaries" type:"list" required:"true"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"4" 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 ListChecksOutput) 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 ListChecksOutput) GoString() string { - return s.String() -} - -// SetCheckSummaries sets the CheckSummaries field's value. -func (s *ListChecksOutput) SetCheckSummaries(v []*CheckSummary) *ListChecksOutput { - s.CheckSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChecksOutput) SetNextToken(v string) *ListChecksOutput { - s.NextToken = &v - return s -} - -type ListOrganizationRecommendationAccountsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // An account affected by this organization recommendation - AffectedAccountId *string `location:"querystring" locationName:"affectedAccountId" min:"12" type:"string"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"4" type:"string"` - - // The Recommendation identifier - // - // OrganizationRecommendationIdentifier is a required field - OrganizationRecommendationIdentifier *string `location:"uri" locationName:"organizationRecommendationIdentifier" min:"20" 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 ListOrganizationRecommendationAccountsInput) 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 ListOrganizationRecommendationAccountsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListOrganizationRecommendationAccountsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOrganizationRecommendationAccountsInput"} - if s.AffectedAccountId != nil && len(*s.AffectedAccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("AffectedAccountId", 12)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - if s.OrganizationRecommendationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationRecommendationIdentifier")) - } - if s.OrganizationRecommendationIdentifier != nil && len(*s.OrganizationRecommendationIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OrganizationRecommendationIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAffectedAccountId sets the AffectedAccountId field's value. -func (s *ListOrganizationRecommendationAccountsInput) SetAffectedAccountId(v string) *ListOrganizationRecommendationAccountsInput { - s.AffectedAccountId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListOrganizationRecommendationAccountsInput) SetMaxResults(v int64) *ListOrganizationRecommendationAccountsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrganizationRecommendationAccountsInput) SetNextToken(v string) *ListOrganizationRecommendationAccountsInput { - s.NextToken = &v - return s -} - -// SetOrganizationRecommendationIdentifier sets the OrganizationRecommendationIdentifier field's value. -func (s *ListOrganizationRecommendationAccountsInput) SetOrganizationRecommendationIdentifier(v string) *ListOrganizationRecommendationAccountsInput { - s.OrganizationRecommendationIdentifier = &v - return s -} - -type ListOrganizationRecommendationAccountsOutput struct { - _ struct{} `type:"structure"` - - // The account recommendations lifecycles that are applicable to the Recommendation - // - // AccountRecommendationLifecycleSummaries is a required field - AccountRecommendationLifecycleSummaries []*AccountRecommendationLifecycleSummary `locationName:"accountRecommendationLifecycleSummaries" type:"list" required:"true"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"4" 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 ListOrganizationRecommendationAccountsOutput) 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 ListOrganizationRecommendationAccountsOutput) GoString() string { - return s.String() -} - -// SetAccountRecommendationLifecycleSummaries sets the AccountRecommendationLifecycleSummaries field's value. -func (s *ListOrganizationRecommendationAccountsOutput) SetAccountRecommendationLifecycleSummaries(v []*AccountRecommendationLifecycleSummary) *ListOrganizationRecommendationAccountsOutput { - s.AccountRecommendationLifecycleSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrganizationRecommendationAccountsOutput) SetNextToken(v string) *ListOrganizationRecommendationAccountsOutput { - s.NextToken = &v - return s -} - -type ListOrganizationRecommendationResourcesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // An account affected by this organization recommendation - AffectedAccountId *string `location:"querystring" locationName:"affectedAccountId" min:"12" type:"string"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"4" type:"string"` - - // The AWS Organization organization's Recommendation identifier - // - // OrganizationRecommendationIdentifier is a required field - OrganizationRecommendationIdentifier *string `location:"uri" locationName:"organizationRecommendationIdentifier" min:"20" type:"string" required:"true"` - - // The AWS Region code of the resource - RegionCode *string `location:"querystring" locationName:"regionCode" type:"string"` - - // The status of the resource - Status *string `location:"querystring" locationName:"status" type:"string" enum:"ResourceStatus"` -} - -// 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 ListOrganizationRecommendationResourcesInput) 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 ListOrganizationRecommendationResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListOrganizationRecommendationResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOrganizationRecommendationResourcesInput"} - if s.AffectedAccountId != nil && len(*s.AffectedAccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("AffectedAccountId", 12)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - if s.OrganizationRecommendationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationRecommendationIdentifier")) - } - if s.OrganizationRecommendationIdentifier != nil && len(*s.OrganizationRecommendationIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OrganizationRecommendationIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAffectedAccountId sets the AffectedAccountId field's value. -func (s *ListOrganizationRecommendationResourcesInput) SetAffectedAccountId(v string) *ListOrganizationRecommendationResourcesInput { - s.AffectedAccountId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListOrganizationRecommendationResourcesInput) SetMaxResults(v int64) *ListOrganizationRecommendationResourcesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrganizationRecommendationResourcesInput) SetNextToken(v string) *ListOrganizationRecommendationResourcesInput { - s.NextToken = &v - return s -} - -// SetOrganizationRecommendationIdentifier sets the OrganizationRecommendationIdentifier field's value. -func (s *ListOrganizationRecommendationResourcesInput) SetOrganizationRecommendationIdentifier(v string) *ListOrganizationRecommendationResourcesInput { - s.OrganizationRecommendationIdentifier = &v - return s -} - -// SetRegionCode sets the RegionCode field's value. -func (s *ListOrganizationRecommendationResourcesInput) SetRegionCode(v string) *ListOrganizationRecommendationResourcesInput { - s.RegionCode = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListOrganizationRecommendationResourcesInput) SetStatus(v string) *ListOrganizationRecommendationResourcesInput { - s.Status = &v - return s -} - -type ListOrganizationRecommendationResourcesOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"4" type:"string"` - - // A list of Recommendation Resources - // - // OrganizationRecommendationResourceSummaries is a required field - OrganizationRecommendationResourceSummaries []*OrganizationRecommendationResourceSummary `locationName:"organizationRecommendationResourceSummaries" type:"list" 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 ListOrganizationRecommendationResourcesOutput) 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 ListOrganizationRecommendationResourcesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrganizationRecommendationResourcesOutput) SetNextToken(v string) *ListOrganizationRecommendationResourcesOutput { - s.NextToken = &v - return s -} - -// SetOrganizationRecommendationResourceSummaries sets the OrganizationRecommendationResourceSummaries field's value. -func (s *ListOrganizationRecommendationResourcesOutput) SetOrganizationRecommendationResourceSummaries(v []*OrganizationRecommendationResourceSummary) *ListOrganizationRecommendationResourcesOutput { - s.OrganizationRecommendationResourceSummaries = v - return s -} - -type ListOrganizationRecommendationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // After the last update of the Recommendation - AfterLastUpdatedAt *time.Time `location:"querystring" locationName:"afterLastUpdatedAt" type:"timestamp"` - - // The aws service associated with the Recommendation - AwsService *string `location:"querystring" locationName:"awsService" min:"2" type:"string"` - - // Before the last update of the Recommendation - BeforeLastUpdatedAt *time.Time `location:"querystring" locationName:"beforeLastUpdatedAt" type:"timestamp"` - - // The check identifier of the Recommendation - CheckIdentifier *string `location:"querystring" locationName:"checkIdentifier" min:"20" type:"string"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"4" type:"string"` - - // The pillar of the Recommendation - Pillar *string `location:"querystring" locationName:"pillar" type:"string" enum:"RecommendationPillar"` - - // The source of the Recommendation - Source *string `location:"querystring" locationName:"source" type:"string" enum:"RecommendationSource"` - - // The status of the Recommendation - Status *string `location:"querystring" locationName:"status" type:"string" enum:"RecommendationStatus"` - - // The type of the Recommendation - Type *string `location:"querystring" locationName:"type" type:"string" enum:"RecommendationType"` -} - -// 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 ListOrganizationRecommendationsInput) 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 ListOrganizationRecommendationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListOrganizationRecommendationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOrganizationRecommendationsInput"} - if s.AwsService != nil && len(*s.AwsService) < 2 { - invalidParams.Add(request.NewErrParamMinLen("AwsService", 2)) - } - if s.CheckIdentifier != nil && len(*s.CheckIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CheckIdentifier", 20)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAfterLastUpdatedAt sets the AfterLastUpdatedAt field's value. -func (s *ListOrganizationRecommendationsInput) SetAfterLastUpdatedAt(v time.Time) *ListOrganizationRecommendationsInput { - s.AfterLastUpdatedAt = &v - return s -} - -// SetAwsService sets the AwsService field's value. -func (s *ListOrganizationRecommendationsInput) SetAwsService(v string) *ListOrganizationRecommendationsInput { - s.AwsService = &v - return s -} - -// SetBeforeLastUpdatedAt sets the BeforeLastUpdatedAt field's value. -func (s *ListOrganizationRecommendationsInput) SetBeforeLastUpdatedAt(v time.Time) *ListOrganizationRecommendationsInput { - s.BeforeLastUpdatedAt = &v - return s -} - -// SetCheckIdentifier sets the CheckIdentifier field's value. -func (s *ListOrganizationRecommendationsInput) SetCheckIdentifier(v string) *ListOrganizationRecommendationsInput { - s.CheckIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListOrganizationRecommendationsInput) SetMaxResults(v int64) *ListOrganizationRecommendationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrganizationRecommendationsInput) SetNextToken(v string) *ListOrganizationRecommendationsInput { - s.NextToken = &v - return s -} - -// SetPillar sets the Pillar field's value. -func (s *ListOrganizationRecommendationsInput) SetPillar(v string) *ListOrganizationRecommendationsInput { - s.Pillar = &v - return s -} - -// SetSource sets the Source field's value. -func (s *ListOrganizationRecommendationsInput) SetSource(v string) *ListOrganizationRecommendationsInput { - s.Source = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListOrganizationRecommendationsInput) SetStatus(v string) *ListOrganizationRecommendationsInput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *ListOrganizationRecommendationsInput) SetType(v string) *ListOrganizationRecommendationsInput { - s.Type = &v - return s -} - -type ListOrganizationRecommendationsOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"4" type:"string"` - - // The list of Recommendations - // - // OrganizationRecommendationSummaries is a required field - OrganizationRecommendationSummaries []*OrganizationRecommendationSummary `locationName:"organizationRecommendationSummaries" type:"list" 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 ListOrganizationRecommendationsOutput) 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 ListOrganizationRecommendationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrganizationRecommendationsOutput) SetNextToken(v string) *ListOrganizationRecommendationsOutput { - s.NextToken = &v - return s -} - -// SetOrganizationRecommendationSummaries sets the OrganizationRecommendationSummaries field's value. -func (s *ListOrganizationRecommendationsOutput) SetOrganizationRecommendationSummaries(v []*OrganizationRecommendationSummary) *ListOrganizationRecommendationsOutput { - s.OrganizationRecommendationSummaries = v - return s -} - -type ListRecommendationResourcesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"4" type:"string"` - - // The Recommendation identifier - // - // RecommendationIdentifier is a required field - RecommendationIdentifier *string `location:"uri" locationName:"recommendationIdentifier" min:"20" type:"string" required:"true"` - - // The AWS Region code of the resource - RegionCode *string `location:"querystring" locationName:"regionCode" type:"string"` - - // The status of the resource - Status *string `location:"querystring" locationName:"status" type:"string" enum:"ResourceStatus"` -} - -// 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 ListRecommendationResourcesInput) 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 ListRecommendationResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRecommendationResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRecommendationResourcesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - if s.RecommendationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("RecommendationIdentifier")) - } - if s.RecommendationIdentifier != nil && len(*s.RecommendationIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RecommendationIdentifier", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRecommendationResourcesInput) SetMaxResults(v int64) *ListRecommendationResourcesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecommendationResourcesInput) SetNextToken(v string) *ListRecommendationResourcesInput { - s.NextToken = &v - return s -} - -// SetRecommendationIdentifier sets the RecommendationIdentifier field's value. -func (s *ListRecommendationResourcesInput) SetRecommendationIdentifier(v string) *ListRecommendationResourcesInput { - s.RecommendationIdentifier = &v - return s -} - -// SetRegionCode sets the RegionCode field's value. -func (s *ListRecommendationResourcesInput) SetRegionCode(v string) *ListRecommendationResourcesInput { - s.RegionCode = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListRecommendationResourcesInput) SetStatus(v string) *ListRecommendationResourcesInput { - s.Status = &v - return s -} - -type ListRecommendationResourcesOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"4" type:"string"` - - // A list of Recommendation Resources - // - // RecommendationResourceSummaries is a required field - RecommendationResourceSummaries []*RecommendationResourceSummary `locationName:"recommendationResourceSummaries" type:"list" 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 ListRecommendationResourcesOutput) 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 ListRecommendationResourcesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecommendationResourcesOutput) SetNextToken(v string) *ListRecommendationResourcesOutput { - s.NextToken = &v - return s -} - -// SetRecommendationResourceSummaries sets the RecommendationResourceSummaries field's value. -func (s *ListRecommendationResourcesOutput) SetRecommendationResourceSummaries(v []*RecommendationResourceSummary) *ListRecommendationResourcesOutput { - s.RecommendationResourceSummaries = v - return s -} - -type ListRecommendationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // After the last update of the Recommendation - AfterLastUpdatedAt *time.Time `location:"querystring" locationName:"afterLastUpdatedAt" type:"timestamp"` - - // The aws service associated with the Recommendation - AwsService *string `location:"querystring" locationName:"awsService" min:"2" type:"string"` - - // Before the last update of the Recommendation - BeforeLastUpdatedAt *time.Time `location:"querystring" locationName:"beforeLastUpdatedAt" type:"timestamp"` - - // The check identifier of the Recommendation - CheckIdentifier *string `location:"querystring" locationName:"checkIdentifier" min:"20" type:"string"` - - // The maximum number of results to return per page. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"4" type:"string"` - - // The pillar of the Recommendation - Pillar *string `location:"querystring" locationName:"pillar" type:"string" enum:"RecommendationPillar"` - - // The source of the Recommendation - Source *string `location:"querystring" locationName:"source" type:"string" enum:"RecommendationSource"` - - // The status of the Recommendation - Status *string `location:"querystring" locationName:"status" type:"string" enum:"RecommendationStatus"` - - // The type of the Recommendation - Type *string `location:"querystring" locationName:"type" type:"string" enum:"RecommendationType"` -} - -// 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 ListRecommendationsInput) 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 ListRecommendationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRecommendationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRecommendationsInput"} - if s.AwsService != nil && len(*s.AwsService) < 2 { - invalidParams.Add(request.NewErrParamMinLen("AwsService", 2)) - } - if s.CheckIdentifier != nil && len(*s.CheckIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("CheckIdentifier", 20)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAfterLastUpdatedAt sets the AfterLastUpdatedAt field's value. -func (s *ListRecommendationsInput) SetAfterLastUpdatedAt(v time.Time) *ListRecommendationsInput { - s.AfterLastUpdatedAt = &v - return s -} - -// SetAwsService sets the AwsService field's value. -func (s *ListRecommendationsInput) SetAwsService(v string) *ListRecommendationsInput { - s.AwsService = &v - return s -} - -// SetBeforeLastUpdatedAt sets the BeforeLastUpdatedAt field's value. -func (s *ListRecommendationsInput) SetBeforeLastUpdatedAt(v time.Time) *ListRecommendationsInput { - s.BeforeLastUpdatedAt = &v - return s -} - -// SetCheckIdentifier sets the CheckIdentifier field's value. -func (s *ListRecommendationsInput) SetCheckIdentifier(v string) *ListRecommendationsInput { - s.CheckIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRecommendationsInput) SetMaxResults(v int64) *ListRecommendationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecommendationsInput) SetNextToken(v string) *ListRecommendationsInput { - s.NextToken = &v - return s -} - -// SetPillar sets the Pillar field's value. -func (s *ListRecommendationsInput) SetPillar(v string) *ListRecommendationsInput { - s.Pillar = &v - return s -} - -// SetSource sets the Source field's value. -func (s *ListRecommendationsInput) SetSource(v string) *ListRecommendationsInput { - s.Source = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ListRecommendationsInput) SetStatus(v string) *ListRecommendationsInput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *ListRecommendationsInput) SetType(v string) *ListRecommendationsInput { - s.Type = &v - return s -} - -type ListRecommendationsOutput struct { - _ struct{} `type:"structure"` - - // The token for the next set of results. Use the value returned in the previous - // response in the next request to retrieve the next set of results. - NextToken *string `locationName:"nextToken" min:"4" type:"string"` - - // The list of Recommendations - // - // RecommendationSummaries is a required field - RecommendationSummaries []*RecommendationSummary `locationName:"recommendationSummaries" type:"list" 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 ListRecommendationsOutput) 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 ListRecommendationsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRecommendationsOutput) SetNextToken(v string) *ListRecommendationsOutput { - s.NextToken = &v - return s -} - -// SetRecommendationSummaries sets the RecommendationSummaries field's value. -func (s *ListRecommendationsOutput) SetRecommendationSummaries(v []*RecommendationSummary) *ListRecommendationsOutput { - s.RecommendationSummaries = v - return s -} - -// A Recommendation for accounts within an Organization -type OrganizationRecommendation struct { - _ struct{} `type:"structure"` - - // The ARN of the Recommendation - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The AWS Services that the Recommendation applies to - AwsServices []*string `locationName:"awsServices" type:"list"` - - // The AWS Trusted Advisor Check ARN that relates to the Recommendation - CheckArn *string `locationName:"checkArn" type:"string"` - - // When the Recommendation was created, if created by AWS Trusted Advisor Priority - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The creator, if created by AWS Trusted Advisor Priority - CreatedBy *string `locationName:"createdBy" type:"string"` - - // A description for AWS Trusted Advisor recommendations - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The ID which identifies where the Recommendation was produced - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // When the Recommendation was last updated - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The lifecycle stage from AWS Trusted Advisor Priority - LifecycleStage *string `locationName:"lifecycleStage" type:"string" enum:"RecommendationLifecycleStage"` - - // The name of the AWS Trusted Advisor Recommendation - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The pillar aggregations for cost savings - PillarSpecificAggregates *RecommendationPillarSpecificAggregates `locationName:"pillarSpecificAggregates" type:"structure"` - - // The Pillars that the Recommendation is optimizing - // - // Pillars is a required field - Pillars []*string `locationName:"pillars" type:"list" required:"true" enum:"RecommendationPillar"` - - // When the Recommendation was resolved - ResolvedAt *time.Time `locationName:"resolvedAt" type:"timestamp" timestampFormat:"iso8601"` - - // An aggregation of all resources - // - // ResourcesAggregates is a required field - ResourcesAggregates *RecommendationResourcesAggregates `locationName:"resourcesAggregates" type:"structure" required:"true"` - - // The source of the Recommendation - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true" enum:"RecommendationSource"` - - // The status of the Recommendation - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"RecommendationStatus"` - - // Whether the Recommendation was automated or generated by AWS Trusted Advisor - // Priority - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RecommendationType"` - - // Reason for the lifecycle stage change - // - // UpdateReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by OrganizationRecommendation's - // String and GoString methods. - UpdateReason *string `locationName:"updateReason" min:"10" type:"string" sensitive:"true"` - - // Reason code for the lifecycle state change - UpdateReasonCode *string `locationName:"updateReasonCode" type:"string" enum:"UpdateRecommendationLifecycleStageReasonCode"` - - // The person on whose behalf a Technical Account Manager (TAM) updated the - // recommendation. This information is only available when a Technical Account - // Manager takes an action on a recommendation managed by AWS Trusted Advisor - // Priority - UpdatedOnBehalfOf *string `locationName:"updatedOnBehalfOf" type:"string"` - - // The job title of the person on whose behalf a Technical Account Manager (TAM) - // updated the recommendation. This information is only available when a Technical - // Account Manager takes an action on a recommendation managed by AWS Trusted - // Advisor Priority - UpdatedOnBehalfOfJobTitle *string `locationName:"updatedOnBehalfOfJobTitle" 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 OrganizationRecommendation) 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 OrganizationRecommendation) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *OrganizationRecommendation) SetArn(v string) *OrganizationRecommendation { - s.Arn = &v - return s -} - -// SetAwsServices sets the AwsServices field's value. -func (s *OrganizationRecommendation) SetAwsServices(v []*string) *OrganizationRecommendation { - s.AwsServices = v - return s -} - -// SetCheckArn sets the CheckArn field's value. -func (s *OrganizationRecommendation) SetCheckArn(v string) *OrganizationRecommendation { - s.CheckArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *OrganizationRecommendation) SetCreatedAt(v time.Time) *OrganizationRecommendation { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *OrganizationRecommendation) SetCreatedBy(v string) *OrganizationRecommendation { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *OrganizationRecommendation) SetDescription(v string) *OrganizationRecommendation { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *OrganizationRecommendation) SetId(v string) *OrganizationRecommendation { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *OrganizationRecommendation) SetLastUpdatedAt(v time.Time) *OrganizationRecommendation { - s.LastUpdatedAt = &v - return s -} - -// SetLifecycleStage sets the LifecycleStage field's value. -func (s *OrganizationRecommendation) SetLifecycleStage(v string) *OrganizationRecommendation { - s.LifecycleStage = &v - return s -} - -// SetName sets the Name field's value. -func (s *OrganizationRecommendation) SetName(v string) *OrganizationRecommendation { - s.Name = &v - return s -} - -// SetPillarSpecificAggregates sets the PillarSpecificAggregates field's value. -func (s *OrganizationRecommendation) SetPillarSpecificAggregates(v *RecommendationPillarSpecificAggregates) *OrganizationRecommendation { - s.PillarSpecificAggregates = v - return s -} - -// SetPillars sets the Pillars field's value. -func (s *OrganizationRecommendation) SetPillars(v []*string) *OrganizationRecommendation { - s.Pillars = v - return s -} - -// SetResolvedAt sets the ResolvedAt field's value. -func (s *OrganizationRecommendation) SetResolvedAt(v time.Time) *OrganizationRecommendation { - s.ResolvedAt = &v - return s -} - -// SetResourcesAggregates sets the ResourcesAggregates field's value. -func (s *OrganizationRecommendation) SetResourcesAggregates(v *RecommendationResourcesAggregates) *OrganizationRecommendation { - s.ResourcesAggregates = v - return s -} - -// SetSource sets the Source field's value. -func (s *OrganizationRecommendation) SetSource(v string) *OrganizationRecommendation { - s.Source = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *OrganizationRecommendation) SetStatus(v string) *OrganizationRecommendation { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *OrganizationRecommendation) SetType(v string) *OrganizationRecommendation { - s.Type = &v - return s -} - -// SetUpdateReason sets the UpdateReason field's value. -func (s *OrganizationRecommendation) SetUpdateReason(v string) *OrganizationRecommendation { - s.UpdateReason = &v - return s -} - -// SetUpdateReasonCode sets the UpdateReasonCode field's value. -func (s *OrganizationRecommendation) SetUpdateReasonCode(v string) *OrganizationRecommendation { - s.UpdateReasonCode = &v - return s -} - -// SetUpdatedOnBehalfOf sets the UpdatedOnBehalfOf field's value. -func (s *OrganizationRecommendation) SetUpdatedOnBehalfOf(v string) *OrganizationRecommendation { - s.UpdatedOnBehalfOf = &v - return s -} - -// SetUpdatedOnBehalfOfJobTitle sets the UpdatedOnBehalfOfJobTitle field's value. -func (s *OrganizationRecommendation) SetUpdatedOnBehalfOfJobTitle(v string) *OrganizationRecommendation { - s.UpdatedOnBehalfOfJobTitle = &v - return s -} - -// Organization Recommendation Resource Summary -type OrganizationRecommendationResourceSummary struct { - _ struct{} `type:"structure"` - - // The AWS account ID - AccountId *string `locationName:"accountId" min:"12" type:"string"` - - // The ARN of the Recommendation Resource - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The AWS resource identifier - // - // AwsResourceId is a required field - AwsResourceId *string `locationName:"awsResourceId" type:"string" required:"true"` - - // The ID of the Recommendation Resource - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // When the Recommendation Resource was last updated - // - // LastUpdatedAt is a required field - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Metadata associated with the Recommendation Resource - // - // Metadata is a required field - Metadata map[string]*string `locationName:"metadata" type:"map" required:"true"` - - // The Recommendation ARN - // - // RecommendationArn is a required field - RecommendationArn *string `locationName:"recommendationArn" min:"20" type:"string" required:"true"` - - // The AWS Region code that the Recommendation Resource is in - // - // RegionCode is a required field - RegionCode *string `locationName:"regionCode" min:"9" type:"string" required:"true"` - - // The current status of the Recommendation Resource - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ResourceStatus"` -} - -// 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 OrganizationRecommendationResourceSummary) 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 OrganizationRecommendationResourceSummary) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *OrganizationRecommendationResourceSummary) SetAccountId(v string) *OrganizationRecommendationResourceSummary { - s.AccountId = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *OrganizationRecommendationResourceSummary) SetArn(v string) *OrganizationRecommendationResourceSummary { - s.Arn = &v - return s -} - -// SetAwsResourceId sets the AwsResourceId field's value. -func (s *OrganizationRecommendationResourceSummary) SetAwsResourceId(v string) *OrganizationRecommendationResourceSummary { - s.AwsResourceId = &v - return s -} - -// SetId sets the Id field's value. -func (s *OrganizationRecommendationResourceSummary) SetId(v string) *OrganizationRecommendationResourceSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *OrganizationRecommendationResourceSummary) SetLastUpdatedAt(v time.Time) *OrganizationRecommendationResourceSummary { - s.LastUpdatedAt = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *OrganizationRecommendationResourceSummary) SetMetadata(v map[string]*string) *OrganizationRecommendationResourceSummary { - s.Metadata = v - return s -} - -// SetRecommendationArn sets the RecommendationArn field's value. -func (s *OrganizationRecommendationResourceSummary) SetRecommendationArn(v string) *OrganizationRecommendationResourceSummary { - s.RecommendationArn = &v - return s -} - -// SetRegionCode sets the RegionCode field's value. -func (s *OrganizationRecommendationResourceSummary) SetRegionCode(v string) *OrganizationRecommendationResourceSummary { - s.RegionCode = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *OrganizationRecommendationResourceSummary) SetStatus(v string) *OrganizationRecommendationResourceSummary { - s.Status = &v - return s -} - -// Summary of recommendation for accounts within an Organization -type OrganizationRecommendationSummary struct { - _ struct{} `type:"structure"` - - // The ARN of the Recommendation - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The AWS Services that the Recommendation applies to - AwsServices []*string `locationName:"awsServices" type:"list"` - - // The AWS Trusted Advisor Check ARN that relates to the Recommendation - CheckArn *string `locationName:"checkArn" type:"string"` - - // When the Recommendation was created, if created by AWS Trusted Advisor Priority - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID which identifies where the Recommendation was produced - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // When the Recommendation was last updated - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The lifecycle stage from AWS Trusted Advisor Priority - LifecycleStage *string `locationName:"lifecycleStage" type:"string" enum:"RecommendationLifecycleStage"` - - // The name of the AWS Trusted Advisor Recommendation - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The pillar aggregations for cost savings - PillarSpecificAggregates *RecommendationPillarSpecificAggregates `locationName:"pillarSpecificAggregates" type:"structure"` - - // The Pillars that the Recommendation is optimizing - // - // Pillars is a required field - Pillars []*string `locationName:"pillars" type:"list" required:"true" enum:"RecommendationPillar"` - - // An aggregation of all resources - // - // ResourcesAggregates is a required field - ResourcesAggregates *RecommendationResourcesAggregates `locationName:"resourcesAggregates" type:"structure" required:"true"` - - // The source of the Recommendation - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true" enum:"RecommendationSource"` - - // The status of the Recommendation - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"RecommendationStatus"` - - // Whether the Recommendation was automated or generated by AWS Trusted Advisor - // Priority - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RecommendationType"` -} - -// 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 OrganizationRecommendationSummary) 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 OrganizationRecommendationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *OrganizationRecommendationSummary) SetArn(v string) *OrganizationRecommendationSummary { - s.Arn = &v - return s -} - -// SetAwsServices sets the AwsServices field's value. -func (s *OrganizationRecommendationSummary) SetAwsServices(v []*string) *OrganizationRecommendationSummary { - s.AwsServices = v - return s -} - -// SetCheckArn sets the CheckArn field's value. -func (s *OrganizationRecommendationSummary) SetCheckArn(v string) *OrganizationRecommendationSummary { - s.CheckArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *OrganizationRecommendationSummary) SetCreatedAt(v time.Time) *OrganizationRecommendationSummary { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *OrganizationRecommendationSummary) SetId(v string) *OrganizationRecommendationSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *OrganizationRecommendationSummary) SetLastUpdatedAt(v time.Time) *OrganizationRecommendationSummary { - s.LastUpdatedAt = &v - return s -} - -// SetLifecycleStage sets the LifecycleStage field's value. -func (s *OrganizationRecommendationSummary) SetLifecycleStage(v string) *OrganizationRecommendationSummary { - s.LifecycleStage = &v - return s -} - -// SetName sets the Name field's value. -func (s *OrganizationRecommendationSummary) SetName(v string) *OrganizationRecommendationSummary { - s.Name = &v - return s -} - -// SetPillarSpecificAggregates sets the PillarSpecificAggregates field's value. -func (s *OrganizationRecommendationSummary) SetPillarSpecificAggregates(v *RecommendationPillarSpecificAggregates) *OrganizationRecommendationSummary { - s.PillarSpecificAggregates = v - return s -} - -// SetPillars sets the Pillars field's value. -func (s *OrganizationRecommendationSummary) SetPillars(v []*string) *OrganizationRecommendationSummary { - s.Pillars = v - return s -} - -// SetResourcesAggregates sets the ResourcesAggregates field's value. -func (s *OrganizationRecommendationSummary) SetResourcesAggregates(v *RecommendationResourcesAggregates) *OrganizationRecommendationSummary { - s.ResourcesAggregates = v - return s -} - -// SetSource sets the Source field's value. -func (s *OrganizationRecommendationSummary) SetSource(v string) *OrganizationRecommendationSummary { - s.Source = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *OrganizationRecommendationSummary) SetStatus(v string) *OrganizationRecommendationSummary { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *OrganizationRecommendationSummary) SetType(v string) *OrganizationRecommendationSummary { - s.Type = &v - return s -} - -// A Recommendation for an Account -type Recommendation struct { - _ struct{} `type:"structure"` - - // The ARN of the Recommendation - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The AWS Services that the Recommendation applies to - AwsServices []*string `locationName:"awsServices" type:"list"` - - // The AWS Trusted Advisor Check ARN that relates to the Recommendation - CheckArn *string `locationName:"checkArn" type:"string"` - - // When the Recommendation was created, if created by AWS Trusted Advisor Priority - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The creator, if created by AWS Trusted Advisor Priority - CreatedBy *string `locationName:"createdBy" type:"string"` - - // A description for AWS Trusted Advisor recommendations - // - // Description is a required field - Description *string `locationName:"description" type:"string" required:"true"` - - // The ID which identifies where the Recommendation was produced - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // When the Recommendation was last updated - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The lifecycle stage from AWS Trusted Advisor Priority - LifecycleStage *string `locationName:"lifecycleStage" type:"string" enum:"RecommendationLifecycleStage"` - - // The name of the AWS Trusted Advisor Recommendation - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The pillar aggregations for cost savings - PillarSpecificAggregates *RecommendationPillarSpecificAggregates `locationName:"pillarSpecificAggregates" type:"structure"` - - // The Pillars that the Recommendation is optimizing - // - // Pillars is a required field - Pillars []*string `locationName:"pillars" type:"list" required:"true" enum:"RecommendationPillar"` - - // When the Recommendation was resolved - ResolvedAt *time.Time `locationName:"resolvedAt" type:"timestamp" timestampFormat:"iso8601"` - - // An aggregation of all resources - // - // ResourcesAggregates is a required field - ResourcesAggregates *RecommendationResourcesAggregates `locationName:"resourcesAggregates" type:"structure" required:"true"` - - // The source of the Recommendation - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true" enum:"RecommendationSource"` - - // The status of the Recommendation - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"RecommendationStatus"` - - // Whether the Recommendation was automated or generated by AWS Trusted Advisor - // Priority - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RecommendationType"` - - // Reason for the lifecycle stage change - // - // UpdateReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Recommendation's - // String and GoString methods. - UpdateReason *string `locationName:"updateReason" min:"10" type:"string" sensitive:"true"` - - // Reason code for the lifecycle state change - UpdateReasonCode *string `locationName:"updateReasonCode" type:"string" enum:"UpdateRecommendationLifecycleStageReasonCode"` - - // The person on whose behalf a Technical Account Manager (TAM) updated the - // recommendation. This information is only available when a Technical Account - // Manager takes an action on a recommendation managed by AWS Trusted Advisor - // Priority - UpdatedOnBehalfOf *string `locationName:"updatedOnBehalfOf" type:"string"` - - // The job title of the person on whose behalf a Technical Account Manager (TAM) - // updated the recommendation. This information is only available when a Technical - // Account Manager takes an action on a recommendation managed by AWS Trusted - // Advisor Priority - UpdatedOnBehalfOfJobTitle *string `locationName:"updatedOnBehalfOfJobTitle" 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 Recommendation) 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 Recommendation) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Recommendation) SetArn(v string) *Recommendation { - s.Arn = &v - return s -} - -// SetAwsServices sets the AwsServices field's value. -func (s *Recommendation) SetAwsServices(v []*string) *Recommendation { - s.AwsServices = v - return s -} - -// SetCheckArn sets the CheckArn field's value. -func (s *Recommendation) SetCheckArn(v string) *Recommendation { - s.CheckArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Recommendation) SetCreatedAt(v time.Time) *Recommendation { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *Recommendation) SetCreatedBy(v string) *Recommendation { - s.CreatedBy = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *Recommendation) SetDescription(v string) *Recommendation { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *Recommendation) SetId(v string) *Recommendation { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *Recommendation) SetLastUpdatedAt(v time.Time) *Recommendation { - s.LastUpdatedAt = &v - return s -} - -// SetLifecycleStage sets the LifecycleStage field's value. -func (s *Recommendation) SetLifecycleStage(v string) *Recommendation { - s.LifecycleStage = &v - return s -} - -// SetName sets the Name field's value. -func (s *Recommendation) SetName(v string) *Recommendation { - s.Name = &v - return s -} - -// SetPillarSpecificAggregates sets the PillarSpecificAggregates field's value. -func (s *Recommendation) SetPillarSpecificAggregates(v *RecommendationPillarSpecificAggregates) *Recommendation { - s.PillarSpecificAggregates = v - return s -} - -// SetPillars sets the Pillars field's value. -func (s *Recommendation) SetPillars(v []*string) *Recommendation { - s.Pillars = v - return s -} - -// SetResolvedAt sets the ResolvedAt field's value. -func (s *Recommendation) SetResolvedAt(v time.Time) *Recommendation { - s.ResolvedAt = &v - return s -} - -// SetResourcesAggregates sets the ResourcesAggregates field's value. -func (s *Recommendation) SetResourcesAggregates(v *RecommendationResourcesAggregates) *Recommendation { - s.ResourcesAggregates = v - return s -} - -// SetSource sets the Source field's value. -func (s *Recommendation) SetSource(v string) *Recommendation { - s.Source = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Recommendation) SetStatus(v string) *Recommendation { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *Recommendation) SetType(v string) *Recommendation { - s.Type = &v - return s -} - -// SetUpdateReason sets the UpdateReason field's value. -func (s *Recommendation) SetUpdateReason(v string) *Recommendation { - s.UpdateReason = &v - return s -} - -// SetUpdateReasonCode sets the UpdateReasonCode field's value. -func (s *Recommendation) SetUpdateReasonCode(v string) *Recommendation { - s.UpdateReasonCode = &v - return s -} - -// SetUpdatedOnBehalfOf sets the UpdatedOnBehalfOf field's value. -func (s *Recommendation) SetUpdatedOnBehalfOf(v string) *Recommendation { - s.UpdatedOnBehalfOf = &v - return s -} - -// SetUpdatedOnBehalfOfJobTitle sets the UpdatedOnBehalfOfJobTitle field's value. -func (s *Recommendation) SetUpdatedOnBehalfOfJobTitle(v string) *Recommendation { - s.UpdatedOnBehalfOfJobTitle = &v - return s -} - -// Cost optimizing aggregates for a Recommendation -type RecommendationCostOptimizingAggregates struct { - _ struct{} `type:"structure"` - - // The estimated monthly savings - // - // EstimatedMonthlySavings is a required field - EstimatedMonthlySavings *float64 `locationName:"estimatedMonthlySavings" type:"double" required:"true"` - - // The estimated percently monthly savings - // - // EstimatedPercentMonthlySavings is a required field - EstimatedPercentMonthlySavings *float64 `locationName:"estimatedPercentMonthlySavings" type:"double" 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 RecommendationCostOptimizingAggregates) 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 RecommendationCostOptimizingAggregates) GoString() string { - return s.String() -} - -// SetEstimatedMonthlySavings sets the EstimatedMonthlySavings field's value. -func (s *RecommendationCostOptimizingAggregates) SetEstimatedMonthlySavings(v float64) *RecommendationCostOptimizingAggregates { - s.EstimatedMonthlySavings = &v - return s -} - -// SetEstimatedPercentMonthlySavings sets the EstimatedPercentMonthlySavings field's value. -func (s *RecommendationCostOptimizingAggregates) SetEstimatedPercentMonthlySavings(v float64) *RecommendationCostOptimizingAggregates { - s.EstimatedPercentMonthlySavings = &v - return s -} - -// Recommendation pillar aggregates -type RecommendationPillarSpecificAggregates struct { - _ struct{} `type:"structure"` - - // Cost optimizing aggregates - CostOptimizing *RecommendationCostOptimizingAggregates `locationName:"costOptimizing" 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 RecommendationPillarSpecificAggregates) 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 RecommendationPillarSpecificAggregates) GoString() string { - return s.String() -} - -// SetCostOptimizing sets the CostOptimizing field's value. -func (s *RecommendationPillarSpecificAggregates) SetCostOptimizing(v *RecommendationCostOptimizingAggregates) *RecommendationPillarSpecificAggregates { - s.CostOptimizing = v - return s -} - -// Summary of a Recommendation Resource -type RecommendationResourceSummary struct { - _ struct{} `type:"structure"` - - // The ARN of the Recommendation Resource - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The AWS resource identifier - // - // AwsResourceId is a required field - AwsResourceId *string `locationName:"awsResourceId" type:"string" required:"true"` - - // The ID of the Recommendation Resource - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // When the Recommendation Resource was last updated - // - // LastUpdatedAt is a required field - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Metadata associated with the Recommendation Resource - // - // Metadata is a required field - Metadata map[string]*string `locationName:"metadata" type:"map" required:"true"` - - // The Recommendation ARN - // - // RecommendationArn is a required field - RecommendationArn *string `locationName:"recommendationArn" min:"20" type:"string" required:"true"` - - // The AWS Region code that the Recommendation Resource is in - // - // RegionCode is a required field - RegionCode *string `locationName:"regionCode" min:"9" type:"string" required:"true"` - - // The current status of the Recommendation Resource - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"ResourceStatus"` -} - -// 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 RecommendationResourceSummary) 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 RecommendationResourceSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *RecommendationResourceSummary) SetArn(v string) *RecommendationResourceSummary { - s.Arn = &v - return s -} - -// SetAwsResourceId sets the AwsResourceId field's value. -func (s *RecommendationResourceSummary) SetAwsResourceId(v string) *RecommendationResourceSummary { - s.AwsResourceId = &v - return s -} - -// SetId sets the Id field's value. -func (s *RecommendationResourceSummary) SetId(v string) *RecommendationResourceSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *RecommendationResourceSummary) SetLastUpdatedAt(v time.Time) *RecommendationResourceSummary { - s.LastUpdatedAt = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *RecommendationResourceSummary) SetMetadata(v map[string]*string) *RecommendationResourceSummary { - s.Metadata = v - return s -} - -// SetRecommendationArn sets the RecommendationArn field's value. -func (s *RecommendationResourceSummary) SetRecommendationArn(v string) *RecommendationResourceSummary { - s.RecommendationArn = &v - return s -} - -// SetRegionCode sets the RegionCode field's value. -func (s *RecommendationResourceSummary) SetRegionCode(v string) *RecommendationResourceSummary { - s.RegionCode = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RecommendationResourceSummary) SetStatus(v string) *RecommendationResourceSummary { - s.Status = &v - return s -} - -// Aggregation of Recommendation Resources -type RecommendationResourcesAggregates struct { - _ struct{} `type:"structure"` - - // The number of AWS resources that were flagged to have errors according to - // the Trusted Advisor check - // - // ErrorCount is a required field - ErrorCount *int64 `locationName:"errorCount" type:"long" required:"true"` - - // The number of AWS resources that were flagged to be OK according to the Trusted - // Advisor check - // - // OkCount is a required field - OkCount *int64 `locationName:"okCount" type:"long" required:"true"` - - // The number of AWS resources that were flagged to have warning according to - // the Trusted Advisor check - // - // WarningCount is a required field - WarningCount *int64 `locationName:"warningCount" type:"long" 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 RecommendationResourcesAggregates) 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 RecommendationResourcesAggregates) GoString() string { - return s.String() -} - -// SetErrorCount sets the ErrorCount field's value. -func (s *RecommendationResourcesAggregates) SetErrorCount(v int64) *RecommendationResourcesAggregates { - s.ErrorCount = &v - return s -} - -// SetOkCount sets the OkCount field's value. -func (s *RecommendationResourcesAggregates) SetOkCount(v int64) *RecommendationResourcesAggregates { - s.OkCount = &v - return s -} - -// SetWarningCount sets the WarningCount field's value. -func (s *RecommendationResourcesAggregates) SetWarningCount(v int64) *RecommendationResourcesAggregates { - s.WarningCount = &v - return s -} - -// Summary of Recommendation for an Account -type RecommendationSummary struct { - _ struct{} `type:"structure"` - - // The ARN of the Recommendation - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The AWS Services that the Recommendation applies to - AwsServices []*string `locationName:"awsServices" type:"list"` - - // The AWS Trusted Advisor Check ARN that relates to the Recommendation - CheckArn *string `locationName:"checkArn" type:"string"` - - // When the Recommendation was created, if created by AWS Trusted Advisor Priority - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID which identifies where the Recommendation was produced - // - // Id is a required field - Id *string `locationName:"id" type:"string" required:"true"` - - // When the Recommendation was last updated - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The lifecycle stage from AWS Trusted Advisor Priority - LifecycleStage *string `locationName:"lifecycleStage" type:"string" enum:"RecommendationLifecycleStage"` - - // The name of the AWS Trusted Advisor Recommendation - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The pillar aggregations for cost savings - PillarSpecificAggregates *RecommendationPillarSpecificAggregates `locationName:"pillarSpecificAggregates" type:"structure"` - - // The Pillars that the Recommendation is optimizing - // - // Pillars is a required field - Pillars []*string `locationName:"pillars" type:"list" required:"true" enum:"RecommendationPillar"` - - // An aggregation of all resources - // - // ResourcesAggregates is a required field - ResourcesAggregates *RecommendationResourcesAggregates `locationName:"resourcesAggregates" type:"structure" required:"true"` - - // The source of the Recommendation - // - // Source is a required field - Source *string `locationName:"source" type:"string" required:"true" enum:"RecommendationSource"` - - // The status of the Recommendation - // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"RecommendationStatus"` - - // Whether the Recommendation was automated or generated by AWS Trusted Advisor - // Priority - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"RecommendationType"` -} - -// 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 RecommendationSummary) 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 RecommendationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *RecommendationSummary) SetArn(v string) *RecommendationSummary { - s.Arn = &v - return s -} - -// SetAwsServices sets the AwsServices field's value. -func (s *RecommendationSummary) SetAwsServices(v []*string) *RecommendationSummary { - s.AwsServices = v - return s -} - -// SetCheckArn sets the CheckArn field's value. -func (s *RecommendationSummary) SetCheckArn(v string) *RecommendationSummary { - s.CheckArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *RecommendationSummary) SetCreatedAt(v time.Time) *RecommendationSummary { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *RecommendationSummary) SetId(v string) *RecommendationSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *RecommendationSummary) SetLastUpdatedAt(v time.Time) *RecommendationSummary { - s.LastUpdatedAt = &v - return s -} - -// SetLifecycleStage sets the LifecycleStage field's value. -func (s *RecommendationSummary) SetLifecycleStage(v string) *RecommendationSummary { - s.LifecycleStage = &v - return s -} - -// SetName sets the Name field's value. -func (s *RecommendationSummary) SetName(v string) *RecommendationSummary { - s.Name = &v - return s -} - -// SetPillarSpecificAggregates sets the PillarSpecificAggregates field's value. -func (s *RecommendationSummary) SetPillarSpecificAggregates(v *RecommendationPillarSpecificAggregates) *RecommendationSummary { - s.PillarSpecificAggregates = v - return s -} - -// SetPillars sets the Pillars field's value. -func (s *RecommendationSummary) SetPillars(v []*string) *RecommendationSummary { - s.Pillars = v - return s -} - -// SetResourcesAggregates sets the ResourcesAggregates field's value. -func (s *RecommendationSummary) SetResourcesAggregates(v *RecommendationResourcesAggregates) *RecommendationSummary { - s.ResourcesAggregates = v - return s -} - -// SetSource sets the Source field's value. -func (s *RecommendationSummary) SetSource(v string) *RecommendationSummary { - s.Source = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RecommendationSummary) SetStatus(v string) *RecommendationSummary { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *RecommendationSummary) SetType(v string) *RecommendationSummary { - s.Type = &v - return s -} - -// Exception that the requested resource has not been found -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Exception to notify that requests are being throttled -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UpdateOrganizationRecommendationLifecycleInput struct { - _ struct{} `type:"structure"` - - // The new lifecycle stage - // - // LifecycleStage is a required field - LifecycleStage *string `locationName:"lifecycleStage" type:"string" required:"true" enum:"UpdateRecommendationLifecycleStage"` - - // The Recommendation identifier for AWS Trusted Advisor Priority recommendations - // - // OrganizationRecommendationIdentifier is a required field - OrganizationRecommendationIdentifier *string `location:"uri" locationName:"organizationRecommendationIdentifier" min:"20" type:"string" required:"true"` - - // Reason for the lifecycle stage change - // - // UpdateReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateOrganizationRecommendationLifecycleInput's - // String and GoString methods. - UpdateReason *string `locationName:"updateReason" min:"10" type:"string" sensitive:"true"` - - // Reason code for the lifecycle state change - UpdateReasonCode *string `locationName:"updateReasonCode" type:"string" enum:"UpdateRecommendationLifecycleStageReasonCode"` -} - -// 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 UpdateOrganizationRecommendationLifecycleInput) 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 UpdateOrganizationRecommendationLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateOrganizationRecommendationLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateOrganizationRecommendationLifecycleInput"} - if s.LifecycleStage == nil { - invalidParams.Add(request.NewErrParamRequired("LifecycleStage")) - } - if s.OrganizationRecommendationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationRecommendationIdentifier")) - } - if s.OrganizationRecommendationIdentifier != nil && len(*s.OrganizationRecommendationIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("OrganizationRecommendationIdentifier", 20)) - } - if s.UpdateReason != nil && len(*s.UpdateReason) < 10 { - invalidParams.Add(request.NewErrParamMinLen("UpdateReason", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLifecycleStage sets the LifecycleStage field's value. -func (s *UpdateOrganizationRecommendationLifecycleInput) SetLifecycleStage(v string) *UpdateOrganizationRecommendationLifecycleInput { - s.LifecycleStage = &v - return s -} - -// SetOrganizationRecommendationIdentifier sets the OrganizationRecommendationIdentifier field's value. -func (s *UpdateOrganizationRecommendationLifecycleInput) SetOrganizationRecommendationIdentifier(v string) *UpdateOrganizationRecommendationLifecycleInput { - s.OrganizationRecommendationIdentifier = &v - return s -} - -// SetUpdateReason sets the UpdateReason field's value. -func (s *UpdateOrganizationRecommendationLifecycleInput) SetUpdateReason(v string) *UpdateOrganizationRecommendationLifecycleInput { - s.UpdateReason = &v - return s -} - -// SetUpdateReasonCode sets the UpdateReasonCode field's value. -func (s *UpdateOrganizationRecommendationLifecycleInput) SetUpdateReasonCode(v string) *UpdateOrganizationRecommendationLifecycleInput { - s.UpdateReasonCode = &v - return s -} - -type UpdateOrganizationRecommendationLifecycleOutput 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 UpdateOrganizationRecommendationLifecycleOutput) 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 UpdateOrganizationRecommendationLifecycleOutput) GoString() string { - return s.String() -} - -type UpdateRecommendationLifecycleInput struct { - _ struct{} `type:"structure"` - - // The new lifecycle stage - // - // LifecycleStage is a required field - LifecycleStage *string `locationName:"lifecycleStage" type:"string" required:"true" enum:"UpdateRecommendationLifecycleStage"` - - // The Recommendation identifier for AWS Trusted Advisor Priority recommendations - // - // RecommendationIdentifier is a required field - RecommendationIdentifier *string `location:"uri" locationName:"recommendationIdentifier" min:"20" type:"string" required:"true"` - - // Reason for the lifecycle stage change - // - // UpdateReason is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateRecommendationLifecycleInput's - // String and GoString methods. - UpdateReason *string `locationName:"updateReason" min:"10" type:"string" sensitive:"true"` - - // Reason code for the lifecycle state change - UpdateReasonCode *string `locationName:"updateReasonCode" type:"string" enum:"UpdateRecommendationLifecycleStageReasonCode"` -} - -// 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 UpdateRecommendationLifecycleInput) 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 UpdateRecommendationLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRecommendationLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRecommendationLifecycleInput"} - if s.LifecycleStage == nil { - invalidParams.Add(request.NewErrParamRequired("LifecycleStage")) - } - if s.RecommendationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("RecommendationIdentifier")) - } - if s.RecommendationIdentifier != nil && len(*s.RecommendationIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RecommendationIdentifier", 20)) - } - if s.UpdateReason != nil && len(*s.UpdateReason) < 10 { - invalidParams.Add(request.NewErrParamMinLen("UpdateReason", 10)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLifecycleStage sets the LifecycleStage field's value. -func (s *UpdateRecommendationLifecycleInput) SetLifecycleStage(v string) *UpdateRecommendationLifecycleInput { - s.LifecycleStage = &v - return s -} - -// SetRecommendationIdentifier sets the RecommendationIdentifier field's value. -func (s *UpdateRecommendationLifecycleInput) SetRecommendationIdentifier(v string) *UpdateRecommendationLifecycleInput { - s.RecommendationIdentifier = &v - return s -} - -// SetUpdateReason sets the UpdateReason field's value. -func (s *UpdateRecommendationLifecycleInput) SetUpdateReason(v string) *UpdateRecommendationLifecycleInput { - s.UpdateReason = &v - return s -} - -// SetUpdateReasonCode sets the UpdateReasonCode field's value. -func (s *UpdateRecommendationLifecycleInput) SetUpdateReasonCode(v string) *UpdateRecommendationLifecycleInput { - s.UpdateReasonCode = &v - return s -} - -type UpdateRecommendationLifecycleOutput 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 UpdateRecommendationLifecycleOutput) 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 UpdateRecommendationLifecycleOutput) GoString() string { - return s.String() -} - -// Exception that the request failed to satisfy service constraints -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -const ( - // RecommendationLanguageEn is a RecommendationLanguage enum value - RecommendationLanguageEn = "en" - - // RecommendationLanguageJa is a RecommendationLanguage enum value - RecommendationLanguageJa = "ja" - - // RecommendationLanguageZh is a RecommendationLanguage enum value - RecommendationLanguageZh = "zh" - - // RecommendationLanguageFr is a RecommendationLanguage enum value - RecommendationLanguageFr = "fr" - - // RecommendationLanguageDe is a RecommendationLanguage enum value - RecommendationLanguageDe = "de" - - // RecommendationLanguageKo is a RecommendationLanguage enum value - RecommendationLanguageKo = "ko" - - // RecommendationLanguageZhTw is a RecommendationLanguage enum value - RecommendationLanguageZhTw = "zh_TW" - - // RecommendationLanguageIt is a RecommendationLanguage enum value - RecommendationLanguageIt = "it" - - // RecommendationLanguageEs is a RecommendationLanguage enum value - RecommendationLanguageEs = "es" - - // RecommendationLanguagePtBr is a RecommendationLanguage enum value - RecommendationLanguagePtBr = "pt_BR" - - // RecommendationLanguageId is a RecommendationLanguage enum value - RecommendationLanguageId = "id" -) - -// RecommendationLanguage_Values returns all elements of the RecommendationLanguage enum -func RecommendationLanguage_Values() []string { - return []string{ - RecommendationLanguageEn, - RecommendationLanguageJa, - RecommendationLanguageZh, - RecommendationLanguageFr, - RecommendationLanguageDe, - RecommendationLanguageKo, - RecommendationLanguageZhTw, - RecommendationLanguageIt, - RecommendationLanguageEs, - RecommendationLanguagePtBr, - RecommendationLanguageId, - } -} - -const ( - // RecommendationLifecycleStageInProgress is a RecommendationLifecycleStage enum value - RecommendationLifecycleStageInProgress = "in_progress" - - // RecommendationLifecycleStagePendingResponse is a RecommendationLifecycleStage enum value - RecommendationLifecycleStagePendingResponse = "pending_response" - - // RecommendationLifecycleStageDismissed is a RecommendationLifecycleStage enum value - RecommendationLifecycleStageDismissed = "dismissed" - - // RecommendationLifecycleStageResolved is a RecommendationLifecycleStage enum value - RecommendationLifecycleStageResolved = "resolved" -) - -// RecommendationLifecycleStage_Values returns all elements of the RecommendationLifecycleStage enum -func RecommendationLifecycleStage_Values() []string { - return []string{ - RecommendationLifecycleStageInProgress, - RecommendationLifecycleStagePendingResponse, - RecommendationLifecycleStageDismissed, - RecommendationLifecycleStageResolved, - } -} - -const ( - // RecommendationPillarCostOptimizing is a RecommendationPillar enum value - RecommendationPillarCostOptimizing = "cost_optimizing" - - // RecommendationPillarPerformance is a RecommendationPillar enum value - RecommendationPillarPerformance = "performance" - - // RecommendationPillarSecurity is a RecommendationPillar enum value - RecommendationPillarSecurity = "security" - - // RecommendationPillarServiceLimits is a RecommendationPillar enum value - RecommendationPillarServiceLimits = "service_limits" - - // RecommendationPillarFaultTolerance is a RecommendationPillar enum value - RecommendationPillarFaultTolerance = "fault_tolerance" - - // RecommendationPillarOperationalExcellence is a RecommendationPillar enum value - RecommendationPillarOperationalExcellence = "operational_excellence" -) - -// RecommendationPillar_Values returns all elements of the RecommendationPillar enum -func RecommendationPillar_Values() []string { - return []string{ - RecommendationPillarCostOptimizing, - RecommendationPillarPerformance, - RecommendationPillarSecurity, - RecommendationPillarServiceLimits, - RecommendationPillarFaultTolerance, - RecommendationPillarOperationalExcellence, - } -} - -const ( - // RecommendationSourceAwsConfig is a RecommendationSource enum value - RecommendationSourceAwsConfig = "aws_config" - - // RecommendationSourceComputeOptimizer is a RecommendationSource enum value - RecommendationSourceComputeOptimizer = "compute_optimizer" - - // RecommendationSourceCostExplorer is a RecommendationSource enum value - RecommendationSourceCostExplorer = "cost_explorer" - - // RecommendationSourceLse is a RecommendationSource enum value - RecommendationSourceLse = "lse" - - // RecommendationSourceManual is a RecommendationSource enum value - RecommendationSourceManual = "manual" - - // RecommendationSourcePse is a RecommendationSource enum value - RecommendationSourcePse = "pse" - - // RecommendationSourceRds is a RecommendationSource enum value - RecommendationSourceRds = "rds" - - // RecommendationSourceResilience is a RecommendationSource enum value - RecommendationSourceResilience = "resilience" - - // RecommendationSourceResilienceHub is a RecommendationSource enum value - RecommendationSourceResilienceHub = "resilience_hub" - - // RecommendationSourceSecurityHub is a RecommendationSource enum value - RecommendationSourceSecurityHub = "security_hub" - - // RecommendationSourceStir is a RecommendationSource enum value - RecommendationSourceStir = "stir" - - // RecommendationSourceTaCheck is a RecommendationSource enum value - RecommendationSourceTaCheck = "ta_check" - - // RecommendationSourceWellArchitected is a RecommendationSource enum value - RecommendationSourceWellArchitected = "well_architected" -) - -// RecommendationSource_Values returns all elements of the RecommendationSource enum -func RecommendationSource_Values() []string { - return []string{ - RecommendationSourceAwsConfig, - RecommendationSourceComputeOptimizer, - RecommendationSourceCostExplorer, - RecommendationSourceLse, - RecommendationSourceManual, - RecommendationSourcePse, - RecommendationSourceRds, - RecommendationSourceResilience, - RecommendationSourceResilienceHub, - RecommendationSourceSecurityHub, - RecommendationSourceStir, - RecommendationSourceTaCheck, - RecommendationSourceWellArchitected, - } -} - -const ( - // RecommendationStatusOk is a RecommendationStatus enum value - RecommendationStatusOk = "ok" - - // RecommendationStatusWarning is a RecommendationStatus enum value - RecommendationStatusWarning = "warning" - - // RecommendationStatusError is a RecommendationStatus enum value - RecommendationStatusError = "error" -) - -// RecommendationStatus_Values returns all elements of the RecommendationStatus enum -func RecommendationStatus_Values() []string { - return []string{ - RecommendationStatusOk, - RecommendationStatusWarning, - RecommendationStatusError, - } -} - -const ( - // RecommendationTypeStandard is a RecommendationType enum value - RecommendationTypeStandard = "standard" - - // RecommendationTypePriority is a RecommendationType enum value - RecommendationTypePriority = "priority" -) - -// RecommendationType_Values returns all elements of the RecommendationType enum -func RecommendationType_Values() []string { - return []string{ - RecommendationTypeStandard, - RecommendationTypePriority, - } -} - -const ( - // ResourceStatusOk is a ResourceStatus enum value - ResourceStatusOk = "ok" - - // ResourceStatusWarning is a ResourceStatus enum value - ResourceStatusWarning = "warning" - - // ResourceStatusError is a ResourceStatus enum value - ResourceStatusError = "error" -) - -// ResourceStatus_Values returns all elements of the ResourceStatus enum -func ResourceStatus_Values() []string { - return []string{ - ResourceStatusOk, - ResourceStatusWarning, - ResourceStatusError, - } -} - -const ( - // UpdateRecommendationLifecycleStagePendingResponse is a UpdateRecommendationLifecycleStage enum value - UpdateRecommendationLifecycleStagePendingResponse = "pending_response" - - // UpdateRecommendationLifecycleStageInProgress is a UpdateRecommendationLifecycleStage enum value - UpdateRecommendationLifecycleStageInProgress = "in_progress" - - // UpdateRecommendationLifecycleStageDismissed is a UpdateRecommendationLifecycleStage enum value - UpdateRecommendationLifecycleStageDismissed = "dismissed" - - // UpdateRecommendationLifecycleStageResolved is a UpdateRecommendationLifecycleStage enum value - UpdateRecommendationLifecycleStageResolved = "resolved" -) - -// UpdateRecommendationLifecycleStage_Values returns all elements of the UpdateRecommendationLifecycleStage enum -func UpdateRecommendationLifecycleStage_Values() []string { - return []string{ - UpdateRecommendationLifecycleStagePendingResponse, - UpdateRecommendationLifecycleStageInProgress, - UpdateRecommendationLifecycleStageDismissed, - UpdateRecommendationLifecycleStageResolved, - } -} - -const ( - // UpdateRecommendationLifecycleStageReasonCodeNonCriticalAccount is a UpdateRecommendationLifecycleStageReasonCode enum value - UpdateRecommendationLifecycleStageReasonCodeNonCriticalAccount = "non_critical_account" - - // UpdateRecommendationLifecycleStageReasonCodeTemporaryAccount is a UpdateRecommendationLifecycleStageReasonCode enum value - UpdateRecommendationLifecycleStageReasonCodeTemporaryAccount = "temporary_account" - - // UpdateRecommendationLifecycleStageReasonCodeValidBusinessCase is a UpdateRecommendationLifecycleStageReasonCode enum value - UpdateRecommendationLifecycleStageReasonCodeValidBusinessCase = "valid_business_case" - - // UpdateRecommendationLifecycleStageReasonCodeOtherMethodsAvailable is a UpdateRecommendationLifecycleStageReasonCode enum value - UpdateRecommendationLifecycleStageReasonCodeOtherMethodsAvailable = "other_methods_available" - - // UpdateRecommendationLifecycleStageReasonCodeLowPriority is a UpdateRecommendationLifecycleStageReasonCode enum value - UpdateRecommendationLifecycleStageReasonCodeLowPriority = "low_priority" - - // UpdateRecommendationLifecycleStageReasonCodeNotApplicable is a UpdateRecommendationLifecycleStageReasonCode enum value - UpdateRecommendationLifecycleStageReasonCodeNotApplicable = "not_applicable" - - // UpdateRecommendationLifecycleStageReasonCodeOther is a UpdateRecommendationLifecycleStageReasonCode enum value - UpdateRecommendationLifecycleStageReasonCodeOther = "other" -) - -// UpdateRecommendationLifecycleStageReasonCode_Values returns all elements of the UpdateRecommendationLifecycleStageReasonCode enum -func UpdateRecommendationLifecycleStageReasonCode_Values() []string { - return []string{ - UpdateRecommendationLifecycleStageReasonCodeNonCriticalAccount, - UpdateRecommendationLifecycleStageReasonCodeTemporaryAccount, - UpdateRecommendationLifecycleStageReasonCodeValidBusinessCase, - UpdateRecommendationLifecycleStageReasonCodeOtherMethodsAvailable, - UpdateRecommendationLifecycleStageReasonCodeLowPriority, - UpdateRecommendationLifecycleStageReasonCodeNotApplicable, - UpdateRecommendationLifecycleStageReasonCodeOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/doc.go deleted file mode 100644 index c3a7e1660692..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package trustedadvisor provides the client and types for making API -// requests to TrustedAdvisor Public API. -// -// # TrustedAdvisor Public API -// -// See https://docs.aws.amazon.com/goto/WebAPI/trustedadvisor-2022-09-15 for more information on this service. -// -// See trustedadvisor package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/trustedadvisor/ -// -// # Using the Client -// -// To contact TrustedAdvisor Public API with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the TrustedAdvisor Public API client TrustedAdvisor for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/trustedadvisor/#New -package trustedadvisor diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/errors.go deleted file mode 100644 index 58c70577e4f7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/errors.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package trustedadvisor - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // Exception that access has been denied due to insufficient access - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // Exception that the request was denied due to conflictions in state - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // Exception to notify that an unexpected internal error occurred during processing - // of the request - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // Exception that the requested resource has not been found - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // Exception to notify that requests are being throttled - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // Exception that the request failed to satisfy service constraints - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/service.go deleted file mode 100644 index 80992303e51b..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package trustedadvisor - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// TrustedAdvisor provides the API operation methods for making requests to -// TrustedAdvisor Public API. See this package's package overview docs -// for details on the service. -// -// TrustedAdvisor methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type TrustedAdvisor struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "TrustedAdvisor" // Name of service. - EndpointsID = "trustedadvisor" // ID to lookup a service endpoint with. - ServiceID = "TrustedAdvisor" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the TrustedAdvisor client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a TrustedAdvisor client from just a session. -// svc := trustedadvisor.New(mySession) -// -// // Create a TrustedAdvisor client with additional configuration -// svc := trustedadvisor.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *TrustedAdvisor { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "trustedadvisor" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *TrustedAdvisor { - svc := &TrustedAdvisor{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-09-15", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a TrustedAdvisor operation and runs any -// custom request initialization. -func (c *TrustedAdvisor) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/trustedadvisoriface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/trustedadvisoriface/interface.go deleted file mode 100644 index ea4a123ffb23..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor/trustedadvisoriface/interface.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package trustedadvisoriface provides an interface to enable mocking the TrustedAdvisor Public API service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package trustedadvisoriface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/trustedadvisor" -) - -// TrustedAdvisorAPI provides an interface to enable mocking the -// trustedadvisor.TrustedAdvisor service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // TrustedAdvisor Public API. -// func myFunc(svc trustedadvisoriface.TrustedAdvisorAPI) bool { -// // Make svc.GetOrganizationRecommendation request -// } -// -// func main() { -// sess := session.New() -// svc := trustedadvisor.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockTrustedAdvisorClient struct { -// trustedadvisoriface.TrustedAdvisorAPI -// } -// func (m *mockTrustedAdvisorClient) GetOrganizationRecommendation(input *trustedadvisor.GetOrganizationRecommendationInput) (*trustedadvisor.GetOrganizationRecommendationOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockTrustedAdvisorClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type TrustedAdvisorAPI interface { - GetOrganizationRecommendation(*trustedadvisor.GetOrganizationRecommendationInput) (*trustedadvisor.GetOrganizationRecommendationOutput, error) - GetOrganizationRecommendationWithContext(aws.Context, *trustedadvisor.GetOrganizationRecommendationInput, ...request.Option) (*trustedadvisor.GetOrganizationRecommendationOutput, error) - GetOrganizationRecommendationRequest(*trustedadvisor.GetOrganizationRecommendationInput) (*request.Request, *trustedadvisor.GetOrganizationRecommendationOutput) - - GetRecommendation(*trustedadvisor.GetRecommendationInput) (*trustedadvisor.GetRecommendationOutput, error) - GetRecommendationWithContext(aws.Context, *trustedadvisor.GetRecommendationInput, ...request.Option) (*trustedadvisor.GetRecommendationOutput, error) - GetRecommendationRequest(*trustedadvisor.GetRecommendationInput) (*request.Request, *trustedadvisor.GetRecommendationOutput) - - ListChecks(*trustedadvisor.ListChecksInput) (*trustedadvisor.ListChecksOutput, error) - ListChecksWithContext(aws.Context, *trustedadvisor.ListChecksInput, ...request.Option) (*trustedadvisor.ListChecksOutput, error) - ListChecksRequest(*trustedadvisor.ListChecksInput) (*request.Request, *trustedadvisor.ListChecksOutput) - - ListChecksPages(*trustedadvisor.ListChecksInput, func(*trustedadvisor.ListChecksOutput, bool) bool) error - ListChecksPagesWithContext(aws.Context, *trustedadvisor.ListChecksInput, func(*trustedadvisor.ListChecksOutput, bool) bool, ...request.Option) error - - ListOrganizationRecommendationAccounts(*trustedadvisor.ListOrganizationRecommendationAccountsInput) (*trustedadvisor.ListOrganizationRecommendationAccountsOutput, error) - ListOrganizationRecommendationAccountsWithContext(aws.Context, *trustedadvisor.ListOrganizationRecommendationAccountsInput, ...request.Option) (*trustedadvisor.ListOrganizationRecommendationAccountsOutput, error) - ListOrganizationRecommendationAccountsRequest(*trustedadvisor.ListOrganizationRecommendationAccountsInput) (*request.Request, *trustedadvisor.ListOrganizationRecommendationAccountsOutput) - - ListOrganizationRecommendationAccountsPages(*trustedadvisor.ListOrganizationRecommendationAccountsInput, func(*trustedadvisor.ListOrganizationRecommendationAccountsOutput, bool) bool) error - ListOrganizationRecommendationAccountsPagesWithContext(aws.Context, *trustedadvisor.ListOrganizationRecommendationAccountsInput, func(*trustedadvisor.ListOrganizationRecommendationAccountsOutput, bool) bool, ...request.Option) error - - ListOrganizationRecommendationResources(*trustedadvisor.ListOrganizationRecommendationResourcesInput) (*trustedadvisor.ListOrganizationRecommendationResourcesOutput, error) - ListOrganizationRecommendationResourcesWithContext(aws.Context, *trustedadvisor.ListOrganizationRecommendationResourcesInput, ...request.Option) (*trustedadvisor.ListOrganizationRecommendationResourcesOutput, error) - ListOrganizationRecommendationResourcesRequest(*trustedadvisor.ListOrganizationRecommendationResourcesInput) (*request.Request, *trustedadvisor.ListOrganizationRecommendationResourcesOutput) - - ListOrganizationRecommendationResourcesPages(*trustedadvisor.ListOrganizationRecommendationResourcesInput, func(*trustedadvisor.ListOrganizationRecommendationResourcesOutput, bool) bool) error - ListOrganizationRecommendationResourcesPagesWithContext(aws.Context, *trustedadvisor.ListOrganizationRecommendationResourcesInput, func(*trustedadvisor.ListOrganizationRecommendationResourcesOutput, bool) bool, ...request.Option) error - - ListOrganizationRecommendations(*trustedadvisor.ListOrganizationRecommendationsInput) (*trustedadvisor.ListOrganizationRecommendationsOutput, error) - ListOrganizationRecommendationsWithContext(aws.Context, *trustedadvisor.ListOrganizationRecommendationsInput, ...request.Option) (*trustedadvisor.ListOrganizationRecommendationsOutput, error) - ListOrganizationRecommendationsRequest(*trustedadvisor.ListOrganizationRecommendationsInput) (*request.Request, *trustedadvisor.ListOrganizationRecommendationsOutput) - - ListOrganizationRecommendationsPages(*trustedadvisor.ListOrganizationRecommendationsInput, func(*trustedadvisor.ListOrganizationRecommendationsOutput, bool) bool) error - ListOrganizationRecommendationsPagesWithContext(aws.Context, *trustedadvisor.ListOrganizationRecommendationsInput, func(*trustedadvisor.ListOrganizationRecommendationsOutput, bool) bool, ...request.Option) error - - ListRecommendationResources(*trustedadvisor.ListRecommendationResourcesInput) (*trustedadvisor.ListRecommendationResourcesOutput, error) - ListRecommendationResourcesWithContext(aws.Context, *trustedadvisor.ListRecommendationResourcesInput, ...request.Option) (*trustedadvisor.ListRecommendationResourcesOutput, error) - ListRecommendationResourcesRequest(*trustedadvisor.ListRecommendationResourcesInput) (*request.Request, *trustedadvisor.ListRecommendationResourcesOutput) - - ListRecommendationResourcesPages(*trustedadvisor.ListRecommendationResourcesInput, func(*trustedadvisor.ListRecommendationResourcesOutput, bool) bool) error - ListRecommendationResourcesPagesWithContext(aws.Context, *trustedadvisor.ListRecommendationResourcesInput, func(*trustedadvisor.ListRecommendationResourcesOutput, bool) bool, ...request.Option) error - - ListRecommendations(*trustedadvisor.ListRecommendationsInput) (*trustedadvisor.ListRecommendationsOutput, error) - ListRecommendationsWithContext(aws.Context, *trustedadvisor.ListRecommendationsInput, ...request.Option) (*trustedadvisor.ListRecommendationsOutput, error) - ListRecommendationsRequest(*trustedadvisor.ListRecommendationsInput) (*request.Request, *trustedadvisor.ListRecommendationsOutput) - - ListRecommendationsPages(*trustedadvisor.ListRecommendationsInput, func(*trustedadvisor.ListRecommendationsOutput, bool) bool) error - ListRecommendationsPagesWithContext(aws.Context, *trustedadvisor.ListRecommendationsInput, func(*trustedadvisor.ListRecommendationsOutput, bool) bool, ...request.Option) error - - UpdateOrganizationRecommendationLifecycle(*trustedadvisor.UpdateOrganizationRecommendationLifecycleInput) (*trustedadvisor.UpdateOrganizationRecommendationLifecycleOutput, error) - UpdateOrganizationRecommendationLifecycleWithContext(aws.Context, *trustedadvisor.UpdateOrganizationRecommendationLifecycleInput, ...request.Option) (*trustedadvisor.UpdateOrganizationRecommendationLifecycleOutput, error) - UpdateOrganizationRecommendationLifecycleRequest(*trustedadvisor.UpdateOrganizationRecommendationLifecycleInput) (*request.Request, *trustedadvisor.UpdateOrganizationRecommendationLifecycleOutput) - - UpdateRecommendationLifecycle(*trustedadvisor.UpdateRecommendationLifecycleInput) (*trustedadvisor.UpdateRecommendationLifecycleOutput, error) - UpdateRecommendationLifecycleWithContext(aws.Context, *trustedadvisor.UpdateRecommendationLifecycleInput, ...request.Option) (*trustedadvisor.UpdateRecommendationLifecycleOutput, error) - UpdateRecommendationLifecycleRequest(*trustedadvisor.UpdateRecommendationLifecycleInput) (*request.Request, *trustedadvisor.UpdateRecommendationLifecycleOutput) -} - -var _ TrustedAdvisorAPI = (*trustedadvisor.TrustedAdvisor)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/api.go deleted file mode 100644 index 98df4b367db4..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/api.go +++ /dev/null @@ -1,10809 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package verifiedpermissions - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opBatchIsAuthorized = "BatchIsAuthorized" - -// BatchIsAuthorizedRequest generates a "aws/request.Request" representing the -// client's request for the BatchIsAuthorized 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 BatchIsAuthorized for more information on using the BatchIsAuthorized -// 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 BatchIsAuthorizedRequest method. -// req, resp := client.BatchIsAuthorizedRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/BatchIsAuthorized -func (c *VerifiedPermissions) BatchIsAuthorizedRequest(input *BatchIsAuthorizedInput) (req *request.Request, output *BatchIsAuthorizedOutput) { - op := &request.Operation{ - Name: opBatchIsAuthorized, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &BatchIsAuthorizedInput{} - } - - output = &BatchIsAuthorizedOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchIsAuthorized API operation for Amazon Verified Permissions. -// -// Makes a series of decisions about multiple authorization requests for one -// principal or resource. Each request contains the equivalent content of an -// IsAuthorized request: principal, action, resource, and context. Either the -// principal or the resource parameter must be identical across all requests. -// For example, Verified Permissions won't evaluate a pair of requests where -// bob views photo1 and alice views photo2. Authorization of bob to view photo1 -// and photo2, or bob and alice to view photo1, are valid batches. -// -// The request is evaluated against all policies in the specified policy store -// that match the entities that you declare. The result of the decisions is -// a series of Allow or Deny responses, along with the IDs of the policies that -// produced each decision. -// -// The entities of a BatchIsAuthorized API request can contain up to 100 principals -// and up to 100 resources. The requests of a BatchIsAuthorized API request -// can contain up to 30 requests. -// -// 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 Verified Permissions's -// API operation BatchIsAuthorized for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/BatchIsAuthorized -func (c *VerifiedPermissions) BatchIsAuthorized(input *BatchIsAuthorizedInput) (*BatchIsAuthorizedOutput, error) { - req, out := c.BatchIsAuthorizedRequest(input) - return out, req.Send() -} - -// BatchIsAuthorizedWithContext is the same as BatchIsAuthorized with the addition of -// the ability to pass a context and additional request options. -// -// See BatchIsAuthorized 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 *VerifiedPermissions) BatchIsAuthorizedWithContext(ctx aws.Context, input *BatchIsAuthorizedInput, opts ...request.Option) (*BatchIsAuthorizedOutput, error) { - req, out := c.BatchIsAuthorizedRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateIdentitySource = "CreateIdentitySource" - -// CreateIdentitySourceRequest generates a "aws/request.Request" representing the -// client's request for the CreateIdentitySource 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 CreateIdentitySource for more information on using the CreateIdentitySource -// 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 CreateIdentitySourceRequest method. -// req, resp := client.CreateIdentitySourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/CreateIdentitySource -func (c *VerifiedPermissions) CreateIdentitySourceRequest(input *CreateIdentitySourceInput) (req *request.Request, output *CreateIdentitySourceOutput) { - op := &request.Operation{ - Name: opCreateIdentitySource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateIdentitySourceInput{} - } - - output = &CreateIdentitySourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateIdentitySource API operation for Amazon Verified Permissions. -// -// Creates a reference to an Amazon Cognito user pool as an external identity -// provider (IdP). -// -// After you create an identity source, you can use the identities provided -// by the IdP as proxies for the principal in authorization queries that use -// the IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) -// operation. These identities take the form of tokens that contain claims about -// the user, such as IDs, attributes and group memberships. Amazon Cognito provides -// both identity tokens and access tokens, and Verified Permissions can use -// either or both. Any combination of identity and access tokens results in -// the same Cedar principal. Verified Permissions automatically translates the -// information about the identities into the standard Cedar attributes that -// can be evaluated by your policies. Because the Amazon Cognito identity and -// access tokens can contain different information, the tokens you choose to -// use determine which principal attributes are available to access when evaluating -// Cedar policies. -// -// If you delete a Amazon Cognito user pool or user, tokens from that deleted -// pool or that deleted user continue to be usable until they expire. -// -// To reference a user from this identity source in your Cedar policies, use -// the following syntax. -// -// IdentityType::"| -// -// Where IdentityType is the string that you provide to the PrincipalEntityType -// parameter for this operation. The CognitoUserPoolId and CognitoClientId are -// defined by the Amazon Cognito user pool. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation CreateIdentitySource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ServiceQuotaExceededException -// The request failed because it would cause a service quota to be exceeded. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/CreateIdentitySource -func (c *VerifiedPermissions) CreateIdentitySource(input *CreateIdentitySourceInput) (*CreateIdentitySourceOutput, error) { - req, out := c.CreateIdentitySourceRequest(input) - return out, req.Send() -} - -// CreateIdentitySourceWithContext is the same as CreateIdentitySource with the addition of -// the ability to pass a context and additional request options. -// -// See CreateIdentitySource 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 *VerifiedPermissions) CreateIdentitySourceWithContext(ctx aws.Context, input *CreateIdentitySourceInput, opts ...request.Option) (*CreateIdentitySourceOutput, error) { - req, out := c.CreateIdentitySourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePolicy = "CreatePolicy" - -// CreatePolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreatePolicy 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 CreatePolicy for more information on using the CreatePolicy -// 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 CreatePolicyRequest method. -// req, resp := client.CreatePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/CreatePolicy -func (c *VerifiedPermissions) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Request, output *CreatePolicyOutput) { - op := &request.Operation{ - Name: opCreatePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePolicyInput{} - } - - output = &CreatePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePolicy API operation for Amazon Verified Permissions. -// -// Creates a Cedar policy and saves it in the specified policy store. You can -// create either a static policy or a policy linked to a policy template. -// -// - To create a static policy, provide the Cedar policy text in the StaticPolicy -// section of the PolicyDefinition. -// -// - To create a policy that is dynamically linked to a policy template, -// specify the policy template ID and the principal and resource to associate -// with this policy in the templateLinked section of the PolicyDefinition. -// If the policy template is ever updated, any policies linked to the policy -// template automatically use the updated template. -// -// Creating a policy causes it to be validated against the schema in the policy -// store. If the policy doesn't pass validation, the operation fails and the -// policy isn't stored. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation CreatePolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ServiceQuotaExceededException -// The request failed because it would cause a service quota to be exceeded. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/CreatePolicy -func (c *VerifiedPermissions) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) { - req, out := c.CreatePolicyRequest(input) - return out, req.Send() -} - -// CreatePolicyWithContext is the same as CreatePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePolicy 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 *VerifiedPermissions) CreatePolicyWithContext(ctx aws.Context, input *CreatePolicyInput, opts ...request.Option) (*CreatePolicyOutput, error) { - req, out := c.CreatePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePolicyStore = "CreatePolicyStore" - -// CreatePolicyStoreRequest generates a "aws/request.Request" representing the -// client's request for the CreatePolicyStore 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 CreatePolicyStore for more information on using the CreatePolicyStore -// 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 CreatePolicyStoreRequest method. -// req, resp := client.CreatePolicyStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/CreatePolicyStore -func (c *VerifiedPermissions) CreatePolicyStoreRequest(input *CreatePolicyStoreInput) (req *request.Request, output *CreatePolicyStoreOutput) { - op := &request.Operation{ - Name: opCreatePolicyStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePolicyStoreInput{} - } - - output = &CreatePolicyStoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePolicyStore API operation for Amazon Verified Permissions. -// -// Creates a policy store. A policy store is a container for policy resources. -// -// Although Cedar supports multiple namespaces (https://docs.cedarpolicy.com/schema/schema.html#namespace), -// Verified Permissions currently supports only one namespace per policy store. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation CreatePolicyStore for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ServiceQuotaExceededException -// The request failed because it would cause a service quota to be exceeded. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/CreatePolicyStore -func (c *VerifiedPermissions) CreatePolicyStore(input *CreatePolicyStoreInput) (*CreatePolicyStoreOutput, error) { - req, out := c.CreatePolicyStoreRequest(input) - return out, req.Send() -} - -// CreatePolicyStoreWithContext is the same as CreatePolicyStore with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePolicyStore 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 *VerifiedPermissions) CreatePolicyStoreWithContext(ctx aws.Context, input *CreatePolicyStoreInput, opts ...request.Option) (*CreatePolicyStoreOutput, error) { - req, out := c.CreatePolicyStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePolicyTemplate = "CreatePolicyTemplate" - -// CreatePolicyTemplateRequest generates a "aws/request.Request" representing the -// client's request for the CreatePolicyTemplate 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 CreatePolicyTemplate for more information on using the CreatePolicyTemplate -// 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 CreatePolicyTemplateRequest method. -// req, resp := client.CreatePolicyTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/CreatePolicyTemplate -func (c *VerifiedPermissions) CreatePolicyTemplateRequest(input *CreatePolicyTemplateInput) (req *request.Request, output *CreatePolicyTemplateOutput) { - op := &request.Operation{ - Name: opCreatePolicyTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePolicyTemplateInput{} - } - - output = &CreatePolicyTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePolicyTemplate API operation for Amazon Verified Permissions. -// -// Creates a policy template. A template can use placeholders for the principal -// and resource. A template must be instantiated into a policy by associating -// it with specific principals and resources to use for the placeholders. That -// instantiated policy can then be considered in authorization decisions. The -// instantiated policy works identically to any other policy, except that it -// is dynamically linked to the template. If the template changes, then any -// policies that are linked to that template are immediately updated as well. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation CreatePolicyTemplate for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ServiceQuotaExceededException -// The request failed because it would cause a service quota to be exceeded. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/CreatePolicyTemplate -func (c *VerifiedPermissions) CreatePolicyTemplate(input *CreatePolicyTemplateInput) (*CreatePolicyTemplateOutput, error) { - req, out := c.CreatePolicyTemplateRequest(input) - return out, req.Send() -} - -// CreatePolicyTemplateWithContext is the same as CreatePolicyTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePolicyTemplate 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 *VerifiedPermissions) CreatePolicyTemplateWithContext(ctx aws.Context, input *CreatePolicyTemplateInput, opts ...request.Option) (*CreatePolicyTemplateOutput, error) { - req, out := c.CreatePolicyTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteIdentitySource = "DeleteIdentitySource" - -// DeleteIdentitySourceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIdentitySource 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 DeleteIdentitySource for more information on using the DeleteIdentitySource -// 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 DeleteIdentitySourceRequest method. -// req, resp := client.DeleteIdentitySourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/DeleteIdentitySource -func (c *VerifiedPermissions) DeleteIdentitySourceRequest(input *DeleteIdentitySourceInput) (req *request.Request, output *DeleteIdentitySourceOutput) { - op := &request.Operation{ - Name: opDeleteIdentitySource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteIdentitySourceInput{} - } - - output = &DeleteIdentitySourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteIdentitySource API operation for Amazon Verified Permissions. -// -// Deletes an identity source that references an identity provider (IdP) such -// as Amazon Cognito. After you delete the identity source, you can no longer -// use tokens for identities from that identity source to represent principals -// in authorization queries made using IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html). -// operations. -// -// 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 Verified Permissions's -// API operation DeleteIdentitySource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/DeleteIdentitySource -func (c *VerifiedPermissions) DeleteIdentitySource(input *DeleteIdentitySourceInput) (*DeleteIdentitySourceOutput, error) { - req, out := c.DeleteIdentitySourceRequest(input) - return out, req.Send() -} - -// DeleteIdentitySourceWithContext is the same as DeleteIdentitySource with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteIdentitySource 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 *VerifiedPermissions) DeleteIdentitySourceWithContext(ctx aws.Context, input *DeleteIdentitySourceInput, opts ...request.Option) (*DeleteIdentitySourceOutput, error) { - req, out := c.DeleteIdentitySourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePolicy = "DeletePolicy" - -// DeletePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeletePolicy 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 DeletePolicy for more information on using the DeletePolicy -// 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 DeletePolicyRequest method. -// req, resp := client.DeletePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/DeletePolicy -func (c *VerifiedPermissions) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput) { - op := &request.Operation{ - Name: opDeletePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePolicyInput{} - } - - output = &DeletePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePolicy API operation for Amazon Verified Permissions. -// -// Deletes the specified policy from the policy store. -// -// This operation is idempotent; if you specify a policy that doesn't exist, -// the request response returns a successful HTTP 200 status code. -// -// 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 Verified Permissions's -// API operation DeletePolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/DeletePolicy -func (c *VerifiedPermissions) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { - req, out := c.DeletePolicyRequest(input) - return out, req.Send() -} - -// DeletePolicyWithContext is the same as DeletePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePolicy 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 *VerifiedPermissions) DeletePolicyWithContext(ctx aws.Context, input *DeletePolicyInput, opts ...request.Option) (*DeletePolicyOutput, error) { - req, out := c.DeletePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePolicyStore = "DeletePolicyStore" - -// DeletePolicyStoreRequest generates a "aws/request.Request" representing the -// client's request for the DeletePolicyStore 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 DeletePolicyStore for more information on using the DeletePolicyStore -// 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 DeletePolicyStoreRequest method. -// req, resp := client.DeletePolicyStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/DeletePolicyStore -func (c *VerifiedPermissions) DeletePolicyStoreRequest(input *DeletePolicyStoreInput) (req *request.Request, output *DeletePolicyStoreOutput) { - op := &request.Operation{ - Name: opDeletePolicyStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePolicyStoreInput{} - } - - output = &DeletePolicyStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePolicyStore API operation for Amazon Verified Permissions. -// -// Deletes the specified policy store. -// -// This operation is idempotent. If you specify a policy store that does not -// exist, the request response will still return a successful HTTP 200 status -// code. -// -// 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 Verified Permissions's -// API operation DeletePolicyStore for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/DeletePolicyStore -func (c *VerifiedPermissions) DeletePolicyStore(input *DeletePolicyStoreInput) (*DeletePolicyStoreOutput, error) { - req, out := c.DeletePolicyStoreRequest(input) - return out, req.Send() -} - -// DeletePolicyStoreWithContext is the same as DeletePolicyStore with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePolicyStore 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 *VerifiedPermissions) DeletePolicyStoreWithContext(ctx aws.Context, input *DeletePolicyStoreInput, opts ...request.Option) (*DeletePolicyStoreOutput, error) { - req, out := c.DeletePolicyStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePolicyTemplate = "DeletePolicyTemplate" - -// DeletePolicyTemplateRequest generates a "aws/request.Request" representing the -// client's request for the DeletePolicyTemplate 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 DeletePolicyTemplate for more information on using the DeletePolicyTemplate -// 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 DeletePolicyTemplateRequest method. -// req, resp := client.DeletePolicyTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/DeletePolicyTemplate -func (c *VerifiedPermissions) DeletePolicyTemplateRequest(input *DeletePolicyTemplateInput) (req *request.Request, output *DeletePolicyTemplateOutput) { - op := &request.Operation{ - Name: opDeletePolicyTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePolicyTemplateInput{} - } - - output = &DeletePolicyTemplateOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePolicyTemplate API operation for Amazon Verified Permissions. -// -// Deletes the specified policy template from the policy store. -// -// This operation also deletes any policies that were created from the specified -// policy template. Those policies are immediately removed from all future API -// responses, and are asynchronously deleted from the policy store. -// -// 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 Verified Permissions's -// API operation DeletePolicyTemplate for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/DeletePolicyTemplate -func (c *VerifiedPermissions) DeletePolicyTemplate(input *DeletePolicyTemplateInput) (*DeletePolicyTemplateOutput, error) { - req, out := c.DeletePolicyTemplateRequest(input) - return out, req.Send() -} - -// DeletePolicyTemplateWithContext is the same as DeletePolicyTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePolicyTemplate 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 *VerifiedPermissions) DeletePolicyTemplateWithContext(ctx aws.Context, input *DeletePolicyTemplateInput, opts ...request.Option) (*DeletePolicyTemplateOutput, error) { - req, out := c.DeletePolicyTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIdentitySource = "GetIdentitySource" - -// GetIdentitySourceRequest generates a "aws/request.Request" representing the -// client's request for the GetIdentitySource 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 GetIdentitySource for more information on using the GetIdentitySource -// 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 GetIdentitySourceRequest method. -// req, resp := client.GetIdentitySourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetIdentitySource -func (c *VerifiedPermissions) GetIdentitySourceRequest(input *GetIdentitySourceInput) (req *request.Request, output *GetIdentitySourceOutput) { - op := &request.Operation{ - Name: opGetIdentitySource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetIdentitySourceInput{} - } - - output = &GetIdentitySourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIdentitySource API operation for Amazon Verified Permissions. -// -// Retrieves the details about the specified identity source. -// -// 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 Verified Permissions's -// API operation GetIdentitySource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetIdentitySource -func (c *VerifiedPermissions) GetIdentitySource(input *GetIdentitySourceInput) (*GetIdentitySourceOutput, error) { - req, out := c.GetIdentitySourceRequest(input) - return out, req.Send() -} - -// GetIdentitySourceWithContext is the same as GetIdentitySource with the addition of -// the ability to pass a context and additional request options. -// -// See GetIdentitySource 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 *VerifiedPermissions) GetIdentitySourceWithContext(ctx aws.Context, input *GetIdentitySourceInput, opts ...request.Option) (*GetIdentitySourceOutput, error) { - req, out := c.GetIdentitySourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPolicy = "GetPolicy" - -// GetPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetPolicy 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 GetPolicy for more information on using the GetPolicy -// 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 GetPolicyRequest method. -// req, resp := client.GetPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetPolicy -func (c *VerifiedPermissions) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, output *GetPolicyOutput) { - op := &request.Operation{ - Name: opGetPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPolicyInput{} - } - - output = &GetPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPolicy API operation for Amazon Verified Permissions. -// -// Retrieves information about the specified policy. -// -// 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 Verified Permissions's -// API operation GetPolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetPolicy -func (c *VerifiedPermissions) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { - req, out := c.GetPolicyRequest(input) - return out, req.Send() -} - -// GetPolicyWithContext is the same as GetPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetPolicy 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 *VerifiedPermissions) GetPolicyWithContext(ctx aws.Context, input *GetPolicyInput, opts ...request.Option) (*GetPolicyOutput, error) { - req, out := c.GetPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPolicyStore = "GetPolicyStore" - -// GetPolicyStoreRequest generates a "aws/request.Request" representing the -// client's request for the GetPolicyStore 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 GetPolicyStore for more information on using the GetPolicyStore -// 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 GetPolicyStoreRequest method. -// req, resp := client.GetPolicyStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetPolicyStore -func (c *VerifiedPermissions) GetPolicyStoreRequest(input *GetPolicyStoreInput) (req *request.Request, output *GetPolicyStoreOutput) { - op := &request.Operation{ - Name: opGetPolicyStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPolicyStoreInput{} - } - - output = &GetPolicyStoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPolicyStore API operation for Amazon Verified Permissions. -// -// Retrieves details about a policy store. -// -// 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 Verified Permissions's -// API operation GetPolicyStore for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetPolicyStore -func (c *VerifiedPermissions) GetPolicyStore(input *GetPolicyStoreInput) (*GetPolicyStoreOutput, error) { - req, out := c.GetPolicyStoreRequest(input) - return out, req.Send() -} - -// GetPolicyStoreWithContext is the same as GetPolicyStore with the addition of -// the ability to pass a context and additional request options. -// -// See GetPolicyStore 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 *VerifiedPermissions) GetPolicyStoreWithContext(ctx aws.Context, input *GetPolicyStoreInput, opts ...request.Option) (*GetPolicyStoreOutput, error) { - req, out := c.GetPolicyStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPolicyTemplate = "GetPolicyTemplate" - -// GetPolicyTemplateRequest generates a "aws/request.Request" representing the -// client's request for the GetPolicyTemplate 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 GetPolicyTemplate for more information on using the GetPolicyTemplate -// 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 GetPolicyTemplateRequest method. -// req, resp := client.GetPolicyTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetPolicyTemplate -func (c *VerifiedPermissions) GetPolicyTemplateRequest(input *GetPolicyTemplateInput) (req *request.Request, output *GetPolicyTemplateOutput) { - op := &request.Operation{ - Name: opGetPolicyTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPolicyTemplateInput{} - } - - output = &GetPolicyTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPolicyTemplate API operation for Amazon Verified Permissions. -// -// Retrieve the details for the specified policy template in the specified policy -// store. -// -// 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 Verified Permissions's -// API operation GetPolicyTemplate for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetPolicyTemplate -func (c *VerifiedPermissions) GetPolicyTemplate(input *GetPolicyTemplateInput) (*GetPolicyTemplateOutput, error) { - req, out := c.GetPolicyTemplateRequest(input) - return out, req.Send() -} - -// GetPolicyTemplateWithContext is the same as GetPolicyTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See GetPolicyTemplate 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 *VerifiedPermissions) GetPolicyTemplateWithContext(ctx aws.Context, input *GetPolicyTemplateInput, opts ...request.Option) (*GetPolicyTemplateOutput, error) { - req, out := c.GetPolicyTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSchema = "GetSchema" - -// GetSchemaRequest generates a "aws/request.Request" representing the -// client's request for the GetSchema 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 GetSchema for more information on using the GetSchema -// 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 GetSchemaRequest method. -// req, resp := client.GetSchemaRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetSchema -func (c *VerifiedPermissions) GetSchemaRequest(input *GetSchemaInput) (req *request.Request, output *GetSchemaOutput) { - op := &request.Operation{ - Name: opGetSchema, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSchemaInput{} - } - - output = &GetSchemaOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSchema API operation for Amazon Verified Permissions. -// -// Retrieve the details for the specified schema in the specified policy store. -// -// 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 Verified Permissions's -// API operation GetSchema for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/GetSchema -func (c *VerifiedPermissions) GetSchema(input *GetSchemaInput) (*GetSchemaOutput, error) { - req, out := c.GetSchemaRequest(input) - return out, req.Send() -} - -// GetSchemaWithContext is the same as GetSchema with the addition of -// the ability to pass a context and additional request options. -// -// See GetSchema 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 *VerifiedPermissions) GetSchemaWithContext(ctx aws.Context, input *GetSchemaInput, opts ...request.Option) (*GetSchemaOutput, error) { - req, out := c.GetSchemaRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opIsAuthorized = "IsAuthorized" - -// IsAuthorizedRequest generates a "aws/request.Request" representing the -// client's request for the IsAuthorized 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 IsAuthorized for more information on using the IsAuthorized -// 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 IsAuthorizedRequest method. -// req, resp := client.IsAuthorizedRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/IsAuthorized -func (c *VerifiedPermissions) IsAuthorizedRequest(input *IsAuthorizedInput) (req *request.Request, output *IsAuthorizedOutput) { - op := &request.Operation{ - Name: opIsAuthorized, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &IsAuthorizedInput{} - } - - output = &IsAuthorizedOutput{} - req = c.newRequest(op, input, output) - return -} - -// IsAuthorized API operation for Amazon Verified Permissions. -// -// Makes an authorization decision about a service request described in the -// parameters. The information in the parameters can also define additional -// context that Verified Permissions can include in the evaluation. The request -// is evaluated against all matching policies in the specified policy store. -// The result of the decision is either Allow or Deny, along with a list of -// the policies that resulted in the decision. -// -// 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 Verified Permissions's -// API operation IsAuthorized for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/IsAuthorized -func (c *VerifiedPermissions) IsAuthorized(input *IsAuthorizedInput) (*IsAuthorizedOutput, error) { - req, out := c.IsAuthorizedRequest(input) - return out, req.Send() -} - -// IsAuthorizedWithContext is the same as IsAuthorized with the addition of -// the ability to pass a context and additional request options. -// -// See IsAuthorized 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 *VerifiedPermissions) IsAuthorizedWithContext(ctx aws.Context, input *IsAuthorizedInput, opts ...request.Option) (*IsAuthorizedOutput, error) { - req, out := c.IsAuthorizedRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opIsAuthorizedWithToken = "IsAuthorizedWithToken" - -// IsAuthorizedWithTokenRequest generates a "aws/request.Request" representing the -// client's request for the IsAuthorizedWithToken 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 IsAuthorizedWithToken for more information on using the IsAuthorizedWithToken -// 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 IsAuthorizedWithTokenRequest method. -// req, resp := client.IsAuthorizedWithTokenRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/IsAuthorizedWithToken -func (c *VerifiedPermissions) IsAuthorizedWithTokenRequest(input *IsAuthorizedWithTokenInput) (req *request.Request, output *IsAuthorizedWithTokenOutput) { - op := &request.Operation{ - Name: opIsAuthorizedWithToken, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &IsAuthorizedWithTokenInput{} - } - - output = &IsAuthorizedWithTokenOutput{} - req = c.newRequest(op, input, output) - return -} - -// IsAuthorizedWithToken API operation for Amazon Verified Permissions. -// -// Makes an authorization decision about a service request described in the -// parameters. The principal in this request comes from an external identity -// source in the form of an identity token formatted as a JSON web token (JWT) -// (https://wikipedia.org/wiki/JSON_Web_Token). The information in the parameters -// can also define additional context that Verified Permissions can include -// in the evaluation. The request is evaluated against all matching policies -// in the specified policy store. The result of the decision is either Allow -// or Deny, along with a list of the policies that resulted in the decision. -// -// If you specify the identityToken parameter, then this operation derives the -// principal from that token. You must not also include that principal in the -// entities parameter or the operation fails and reports a conflict between -// the two entity sources. -// -// If you provide only an accessToken, then you can include the entity as part -// of the entities parameter to provide additional attributes. -// -// At this time, Verified Permissions accepts tokens from only Amazon Cognito. -// -// Verified Permissions validates each token that is specified in a request -// by checking its expiration date and its signature. -// -// If you delete a Amazon Cognito user pool or user, tokens from that deleted -// pool or that deleted user continue to be usable until they expire. -// -// 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 Verified Permissions's -// API operation IsAuthorizedWithToken for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/IsAuthorizedWithToken -func (c *VerifiedPermissions) IsAuthorizedWithToken(input *IsAuthorizedWithTokenInput) (*IsAuthorizedWithTokenOutput, error) { - req, out := c.IsAuthorizedWithTokenRequest(input) - return out, req.Send() -} - -// IsAuthorizedWithTokenWithContext is the same as IsAuthorizedWithToken with the addition of -// the ability to pass a context and additional request options. -// -// See IsAuthorizedWithToken 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 *VerifiedPermissions) IsAuthorizedWithTokenWithContext(ctx aws.Context, input *IsAuthorizedWithTokenInput, opts ...request.Option) (*IsAuthorizedWithTokenOutput, error) { - req, out := c.IsAuthorizedWithTokenRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListIdentitySources = "ListIdentitySources" - -// ListIdentitySourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListIdentitySources 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 ListIdentitySources for more information on using the ListIdentitySources -// 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 ListIdentitySourcesRequest method. -// req, resp := client.ListIdentitySourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/ListIdentitySources -func (c *VerifiedPermissions) ListIdentitySourcesRequest(input *ListIdentitySourcesInput) (req *request.Request, output *ListIdentitySourcesOutput) { - op := &request.Operation{ - Name: opListIdentitySources, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListIdentitySourcesInput{} - } - - output = &ListIdentitySourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIdentitySources API operation for Amazon Verified Permissions. -// -// Returns a paginated list of all of the identity sources defined in the specified -// policy store. -// -// 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 Verified Permissions's -// API operation ListIdentitySources for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/ListIdentitySources -func (c *VerifiedPermissions) ListIdentitySources(input *ListIdentitySourcesInput) (*ListIdentitySourcesOutput, error) { - req, out := c.ListIdentitySourcesRequest(input) - return out, req.Send() -} - -// ListIdentitySourcesWithContext is the same as ListIdentitySources with the addition of -// the ability to pass a context and additional request options. -// -// See ListIdentitySources 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 *VerifiedPermissions) ListIdentitySourcesWithContext(ctx aws.Context, input *ListIdentitySourcesInput, opts ...request.Option) (*ListIdentitySourcesOutput, error) { - req, out := c.ListIdentitySourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListIdentitySourcesPages iterates over the pages of a ListIdentitySources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListIdentitySources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListIdentitySources operation. -// pageNum := 0 -// err := client.ListIdentitySourcesPages(params, -// func(page *verifiedpermissions.ListIdentitySourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VerifiedPermissions) ListIdentitySourcesPages(input *ListIdentitySourcesInput, fn func(*ListIdentitySourcesOutput, bool) bool) error { - return c.ListIdentitySourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListIdentitySourcesPagesWithContext same as ListIdentitySourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VerifiedPermissions) ListIdentitySourcesPagesWithContext(ctx aws.Context, input *ListIdentitySourcesInput, fn func(*ListIdentitySourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListIdentitySourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListIdentitySourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListIdentitySourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPolicies = "ListPolicies" - -// ListPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListPolicies 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 ListPolicies for more information on using the ListPolicies -// 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 ListPoliciesRequest method. -// req, resp := client.ListPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/ListPolicies -func (c *VerifiedPermissions) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Request, output *ListPoliciesOutput) { - op := &request.Operation{ - Name: opListPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPoliciesInput{} - } - - output = &ListPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPolicies API operation for Amazon Verified Permissions. -// -// Returns a paginated list of all policies stored in the specified policy store. -// -// 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 Verified Permissions's -// API operation ListPolicies for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/ListPolicies -func (c *VerifiedPermissions) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error) { - req, out := c.ListPoliciesRequest(input) - return out, req.Send() -} - -// ListPoliciesWithContext is the same as ListPolicies with the addition of -// the ability to pass a context and additional request options. -// -// See ListPolicies 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 *VerifiedPermissions) ListPoliciesWithContext(ctx aws.Context, input *ListPoliciesInput, opts ...request.Option) (*ListPoliciesOutput, error) { - req, out := c.ListPoliciesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPoliciesPages iterates over the pages of a ListPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicies method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPolicies operation. -// pageNum := 0 -// err := client.ListPoliciesPages(params, -// func(page *verifiedpermissions.ListPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VerifiedPermissions) ListPoliciesPages(input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool) error { - return c.ListPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPoliciesPagesWithContext same as ListPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VerifiedPermissions) ListPoliciesPagesWithContext(ctx aws.Context, input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPolicyStores = "ListPolicyStores" - -// ListPolicyStoresRequest generates a "aws/request.Request" representing the -// client's request for the ListPolicyStores 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 ListPolicyStores for more information on using the ListPolicyStores -// 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 ListPolicyStoresRequest method. -// req, resp := client.ListPolicyStoresRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/ListPolicyStores -func (c *VerifiedPermissions) ListPolicyStoresRequest(input *ListPolicyStoresInput) (req *request.Request, output *ListPolicyStoresOutput) { - op := &request.Operation{ - Name: opListPolicyStores, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPolicyStoresInput{} - } - - output = &ListPolicyStoresOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPolicyStores API operation for Amazon Verified Permissions. -// -// Returns a paginated list of all policy stores in the calling Amazon Web Services -// account. -// -// 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 Verified Permissions's -// API operation ListPolicyStores for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/ListPolicyStores -func (c *VerifiedPermissions) ListPolicyStores(input *ListPolicyStoresInput) (*ListPolicyStoresOutput, error) { - req, out := c.ListPolicyStoresRequest(input) - return out, req.Send() -} - -// ListPolicyStoresWithContext is the same as ListPolicyStores with the addition of -// the ability to pass a context and additional request options. -// -// See ListPolicyStores 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 *VerifiedPermissions) ListPolicyStoresWithContext(ctx aws.Context, input *ListPolicyStoresInput, opts ...request.Option) (*ListPolicyStoresOutput, error) { - req, out := c.ListPolicyStoresRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPolicyStoresPages iterates over the pages of a ListPolicyStores operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicyStores method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPolicyStores operation. -// pageNum := 0 -// err := client.ListPolicyStoresPages(params, -// func(page *verifiedpermissions.ListPolicyStoresOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VerifiedPermissions) ListPolicyStoresPages(input *ListPolicyStoresInput, fn func(*ListPolicyStoresOutput, bool) bool) error { - return c.ListPolicyStoresPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPolicyStoresPagesWithContext same as ListPolicyStoresPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VerifiedPermissions) ListPolicyStoresPagesWithContext(ctx aws.Context, input *ListPolicyStoresInput, fn func(*ListPolicyStoresOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPolicyStoresInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPolicyStoresRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPolicyStoresOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPolicyTemplates = "ListPolicyTemplates" - -// ListPolicyTemplatesRequest generates a "aws/request.Request" representing the -// client's request for the ListPolicyTemplates 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 ListPolicyTemplates for more information on using the ListPolicyTemplates -// 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 ListPolicyTemplatesRequest method. -// req, resp := client.ListPolicyTemplatesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/ListPolicyTemplates -func (c *VerifiedPermissions) ListPolicyTemplatesRequest(input *ListPolicyTemplatesInput) (req *request.Request, output *ListPolicyTemplatesOutput) { - op := &request.Operation{ - Name: opListPolicyTemplates, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPolicyTemplatesInput{} - } - - output = &ListPolicyTemplatesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPolicyTemplates API operation for Amazon Verified Permissions. -// -// Returns a paginated list of all policy templates in the specified policy -// store. -// -// 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 Verified Permissions's -// API operation ListPolicyTemplates for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/ListPolicyTemplates -func (c *VerifiedPermissions) ListPolicyTemplates(input *ListPolicyTemplatesInput) (*ListPolicyTemplatesOutput, error) { - req, out := c.ListPolicyTemplatesRequest(input) - return out, req.Send() -} - -// ListPolicyTemplatesWithContext is the same as ListPolicyTemplates with the addition of -// the ability to pass a context and additional request options. -// -// See ListPolicyTemplates 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 *VerifiedPermissions) ListPolicyTemplatesWithContext(ctx aws.Context, input *ListPolicyTemplatesInput, opts ...request.Option) (*ListPolicyTemplatesOutput, error) { - req, out := c.ListPolicyTemplatesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPolicyTemplatesPages iterates over the pages of a ListPolicyTemplates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicyTemplates method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPolicyTemplates operation. -// pageNum := 0 -// err := client.ListPolicyTemplatesPages(params, -// func(page *verifiedpermissions.ListPolicyTemplatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VerifiedPermissions) ListPolicyTemplatesPages(input *ListPolicyTemplatesInput, fn func(*ListPolicyTemplatesOutput, bool) bool) error { - return c.ListPolicyTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPolicyTemplatesPagesWithContext same as ListPolicyTemplatesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VerifiedPermissions) ListPolicyTemplatesPagesWithContext(ctx aws.Context, input *ListPolicyTemplatesInput, fn func(*ListPolicyTemplatesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPolicyTemplatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPolicyTemplatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPolicyTemplatesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutSchema = "PutSchema" - -// PutSchemaRequest generates a "aws/request.Request" representing the -// client's request for the PutSchema 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 PutSchema for more information on using the PutSchema -// 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 PutSchemaRequest method. -// req, resp := client.PutSchemaRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/PutSchema -func (c *VerifiedPermissions) PutSchemaRequest(input *PutSchemaInput) (req *request.Request, output *PutSchemaOutput) { - op := &request.Operation{ - Name: opPutSchema, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutSchemaInput{} - } - - output = &PutSchemaOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutSchema API operation for Amazon Verified Permissions. -// -// Creates or updates the policy schema in the specified policy store. The schema -// is used to validate any Cedar policies and policy templates submitted to -// the policy store. Any changes to the schema validate only policies and templates -// submitted after the schema change. Existing policies and templates are not -// re-evaluated against the changed schema. If you later update a policy, then -// it is evaluated against the new schema at that time. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation PutSchema for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ServiceQuotaExceededException -// The request failed because it would cause a service quota to be exceeded. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/PutSchema -func (c *VerifiedPermissions) PutSchema(input *PutSchemaInput) (*PutSchemaOutput, error) { - req, out := c.PutSchemaRequest(input) - return out, req.Send() -} - -// PutSchemaWithContext is the same as PutSchema with the addition of -// the ability to pass a context and additional request options. -// -// See PutSchema 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 *VerifiedPermissions) PutSchemaWithContext(ctx aws.Context, input *PutSchemaInput, opts ...request.Option) (*PutSchemaOutput, error) { - req, out := c.PutSchemaRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateIdentitySource = "UpdateIdentitySource" - -// UpdateIdentitySourceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIdentitySource 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 UpdateIdentitySource for more information on using the UpdateIdentitySource -// 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 UpdateIdentitySourceRequest method. -// req, resp := client.UpdateIdentitySourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/UpdateIdentitySource -func (c *VerifiedPermissions) UpdateIdentitySourceRequest(input *UpdateIdentitySourceInput) (req *request.Request, output *UpdateIdentitySourceOutput) { - op := &request.Operation{ - Name: opUpdateIdentitySource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateIdentitySourceInput{} - } - - output = &UpdateIdentitySourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIdentitySource API operation for Amazon Verified Permissions. -// -// Updates the specified identity source to use a new identity provider (IdP) -// source, or to change the mapping of identities from the IdP to a different -// principal entity type. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation UpdateIdentitySource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/UpdateIdentitySource -func (c *VerifiedPermissions) UpdateIdentitySource(input *UpdateIdentitySourceInput) (*UpdateIdentitySourceOutput, error) { - req, out := c.UpdateIdentitySourceRequest(input) - return out, req.Send() -} - -// UpdateIdentitySourceWithContext is the same as UpdateIdentitySource with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateIdentitySource 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 *VerifiedPermissions) UpdateIdentitySourceWithContext(ctx aws.Context, input *UpdateIdentitySourceInput, opts ...request.Option) (*UpdateIdentitySourceOutput, error) { - req, out := c.UpdateIdentitySourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePolicy = "UpdatePolicy" - -// UpdatePolicyRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePolicy 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 UpdatePolicy for more information on using the UpdatePolicy -// 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 UpdatePolicyRequest method. -// req, resp := client.UpdatePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/UpdatePolicy -func (c *VerifiedPermissions) UpdatePolicyRequest(input *UpdatePolicyInput) (req *request.Request, output *UpdatePolicyOutput) { - op := &request.Operation{ - Name: opUpdatePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdatePolicyInput{} - } - - output = &UpdatePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePolicy API operation for Amazon Verified Permissions. -// -// Modifies a Cedar static policy in the specified policy store. You can change -// only certain elements of the UpdatePolicyDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyInput.html#amazonverifiedpermissions-UpdatePolicy-request-UpdatePolicyDefinition) -// parameter. You can directly update only static policies. To change a template-linked -// policy, you must update the template instead, using UpdatePolicyTemplate -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyTemplate.html). -// -// - If policy validation is enabled in the policy store, then updating a -// static policy causes Verified Permissions to validate the policy against -// the schema in the policy store. If the updated static policy doesn't pass -// validation, the operation fails and the update isn't stored. -// -// - When you edit a static policy, You can change only certain elements -// of a static policy: The action referenced by the policy. A condition clause, -// such as when and unless. You can't change these elements of a static policy: -// Changing a policy from a static policy to a template-linked policy. Changing -// the effect of a static policy from permit or forbid. The principal referenced -// by a static policy. The resource referenced by a static policy. -// -// - To update a template-linked policy, you must update the template instead. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation UpdatePolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ServiceQuotaExceededException -// The request failed because it would cause a service quota to be exceeded. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/UpdatePolicy -func (c *VerifiedPermissions) UpdatePolicy(input *UpdatePolicyInput) (*UpdatePolicyOutput, error) { - req, out := c.UpdatePolicyRequest(input) - return out, req.Send() -} - -// UpdatePolicyWithContext is the same as UpdatePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePolicy 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 *VerifiedPermissions) UpdatePolicyWithContext(ctx aws.Context, input *UpdatePolicyInput, opts ...request.Option) (*UpdatePolicyOutput, error) { - req, out := c.UpdatePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePolicyStore = "UpdatePolicyStore" - -// UpdatePolicyStoreRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePolicyStore 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 UpdatePolicyStore for more information on using the UpdatePolicyStore -// 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 UpdatePolicyStoreRequest method. -// req, resp := client.UpdatePolicyStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/UpdatePolicyStore -func (c *VerifiedPermissions) UpdatePolicyStoreRequest(input *UpdatePolicyStoreInput) (req *request.Request, output *UpdatePolicyStoreOutput) { - op := &request.Operation{ - Name: opUpdatePolicyStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdatePolicyStoreInput{} - } - - output = &UpdatePolicyStoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePolicyStore API operation for Amazon Verified Permissions. -// -// Modifies the validation setting for a policy store. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation UpdatePolicyStore for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/UpdatePolicyStore -func (c *VerifiedPermissions) UpdatePolicyStore(input *UpdatePolicyStoreInput) (*UpdatePolicyStoreOutput, error) { - req, out := c.UpdatePolicyStoreRequest(input) - return out, req.Send() -} - -// UpdatePolicyStoreWithContext is the same as UpdatePolicyStore with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePolicyStore 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 *VerifiedPermissions) UpdatePolicyStoreWithContext(ctx aws.Context, input *UpdatePolicyStoreInput, opts ...request.Option) (*UpdatePolicyStoreOutput, error) { - req, out := c.UpdatePolicyStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePolicyTemplate = "UpdatePolicyTemplate" - -// UpdatePolicyTemplateRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePolicyTemplate 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 UpdatePolicyTemplate for more information on using the UpdatePolicyTemplate -// 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 UpdatePolicyTemplateRequest method. -// req, resp := client.UpdatePolicyTemplateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/UpdatePolicyTemplate -func (c *VerifiedPermissions) UpdatePolicyTemplateRequest(input *UpdatePolicyTemplateInput) (req *request.Request, output *UpdatePolicyTemplateOutput) { - op := &request.Operation{ - Name: opUpdatePolicyTemplate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdatePolicyTemplateInput{} - } - - output = &UpdatePolicyTemplateOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePolicyTemplate API operation for Amazon Verified Permissions. -// -// Updates the specified policy template. You can update only the description -// and the some elements of the policyBody (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyTemplate.html#amazonverifiedpermissions-UpdatePolicyTemplate-request-policyBody). -// -// Changes you make to the policy template content are immediately (within the -// constraints of eventual consistency) reflected in authorization decisions -// that involve all template-linked policies instantiated from this template. -// -// Verified Permissions is eventually consistent (https://wikipedia.org/wiki/Eventual_consistency) -// . It can take a few seconds for a new or changed element to be propagate -// through the service and be visible in the results of other Verified Permissions -// operations. -// -// 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 Verified Permissions's -// API operation UpdatePolicyTemplate for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -// -// - ConflictException -// The request failed because another request to modify a resource occurred -// at the same. -// -// - AccessDeniedException -// You don't have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request failed because it references a resource that doesn't exist. -// -// - ThrottlingException -// The request failed because it exceeded a throttling quota. -// -// - InternalServerException -// The request failed because of an internal error. Try your request again later -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01/UpdatePolicyTemplate -func (c *VerifiedPermissions) UpdatePolicyTemplate(input *UpdatePolicyTemplateInput) (*UpdatePolicyTemplateOutput, error) { - req, out := c.UpdatePolicyTemplateRequest(input) - return out, req.Send() -} - -// UpdatePolicyTemplateWithContext is the same as UpdatePolicyTemplate with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePolicyTemplate 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 *VerifiedPermissions) UpdatePolicyTemplateWithContext(ctx aws.Context, input *UpdatePolicyTemplateInput, opts ...request.Option) (*UpdatePolicyTemplateOutput, error) { - req, out := c.UpdatePolicyTemplateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You don't have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about an action for a request for which an authorization -// decision is made. -// -// This data type is used as a request parameter to the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html), -// BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html), -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) -// operations. -// -// Example: { "actionId": "", "actionType": "Action" } -type ActionIdentifier struct { - _ struct{} `type:"structure"` - - // The ID of an action. - // - // ActionId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ActionIdentifier's - // String and GoString methods. - // - // ActionId is a required field - ActionId *string `locationName:"actionId" min:"1" type:"string" required:"true" sensitive:"true"` - - // The type of an action. - // - // ActionType is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ActionIdentifier's - // String and GoString methods. - // - // ActionType is a required field - ActionType *string `locationName:"actionType" min:"1" type:"string" required:"true" sensitive:"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 ActionIdentifier) 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 ActionIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActionIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActionIdentifier"} - if s.ActionId == nil { - invalidParams.Add(request.NewErrParamRequired("ActionId")) - } - if s.ActionId != nil && len(*s.ActionId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionId", 1)) - } - if s.ActionType == nil { - invalidParams.Add(request.NewErrParamRequired("ActionType")) - } - if s.ActionType != nil && len(*s.ActionType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ActionType", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionId sets the ActionId field's value. -func (s *ActionIdentifier) SetActionId(v string) *ActionIdentifier { - s.ActionId = &v - return s -} - -// SetActionType sets the ActionType field's value. -func (s *ActionIdentifier) SetActionType(v string) *ActionIdentifier { - s.ActionType = &v - return s -} - -// The value of an attribute. -// -// Contains information about the runtime context for a request for which an -// authorization decision is made. -// -// This data type is used as a member of the ContextDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ContextDefinition.html) -// structure which is uses as a request parameter for the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html), -// BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html), -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) -// operations. -type AttributeValue struct { - _ struct{} `type:"structure"` - - // An attribute value of Boolean (https://docs.cedarpolicy.com/policies/syntax-datatypes.html#boolean) - // type. - // - // Example: {"boolean": true} - // - // Boolean is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AttributeValue's - // String and GoString methods. - Boolean *bool `locationName:"boolean" type:"boolean" sensitive:"true"` - - // An attribute value of type EntityIdentifier (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_EntityIdentifier.html). - // - // Example: "entityIdentifier": { "entityId": "", "entityType": ""} - EntityIdentifier *EntityIdentifier `locationName:"entityIdentifier" type:"structure"` - - // An attribute value of Long (https://docs.cedarpolicy.com/policies/syntax-datatypes.html#long) - // type. - // - // Example: {"long": 0} - // - // Long is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AttributeValue's - // String and GoString methods. - Long *int64 `locationName:"long" type:"long" sensitive:"true"` - - // An attribute value of Record (https://docs.cedarpolicy.com/policies/syntax-datatypes.html#record) - // type. - // - // Example: {"record": { "keyName": {} } } - Record map[string]*AttributeValue `locationName:"record" type:"map"` - - // An attribute value of Set (https://docs.cedarpolicy.com/policies/syntax-datatypes.html#set) - // type. - // - // Example: {"set": [ {} ] } - Set []*AttributeValue `locationName:"set" type:"list"` - - // An attribute value of String (https://docs.cedarpolicy.com/policies/syntax-datatypes.html#string) - // type. - // - // Example: {"string": "abc"} - // - // String_ is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by AttributeValue's - // String and GoString methods. - String_ *string `locationName:"string" type:"string" sensitive:"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 AttributeValue) 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 AttributeValue) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttributeValue) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttributeValue"} - if s.EntityIdentifier != nil { - if err := s.EntityIdentifier.Validate(); err != nil { - invalidParams.AddNested("EntityIdentifier", err.(request.ErrInvalidParams)) - } - } - if s.Record != nil { - for i, v := range s.Record { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Record", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Set != nil { - for i, v := range s.Set { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Set", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBoolean sets the Boolean field's value. -func (s *AttributeValue) SetBoolean(v bool) *AttributeValue { - s.Boolean = &v - return s -} - -// SetEntityIdentifier sets the EntityIdentifier field's value. -func (s *AttributeValue) SetEntityIdentifier(v *EntityIdentifier) *AttributeValue { - s.EntityIdentifier = v - return s -} - -// SetLong sets the Long field's value. -func (s *AttributeValue) SetLong(v int64) *AttributeValue { - s.Long = &v - return s -} - -// SetRecord sets the Record field's value. -func (s *AttributeValue) SetRecord(v map[string]*AttributeValue) *AttributeValue { - s.Record = v - return s -} - -// SetSet sets the Set field's value. -func (s *AttributeValue) SetSet(v []*AttributeValue) *AttributeValue { - s.Set = v - return s -} - -// SetString_ sets the String_ field's value. -func (s *AttributeValue) SetString_(v string) *AttributeValue { - s.String_ = &v - return s -} - -type BatchIsAuthorizedInput struct { - _ struct{} `type:"structure"` - - // Specifies the list of resources and principals and their associated attributes - // that Verified Permissions can examine when evaluating the policies. - // - // You can include only principal and resource entities in this parameter; you - // can't include actions. You must specify actions in the schema. - Entities *EntitiesDefinition `locationName:"entities" type:"structure"` - - // Specifies the ID of the policy store. Policies in this policy store will - // be used to make the authorization decisions for the input. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // An array of up to 30 requests that you want Verified Permissions to evaluate. - // - // Requests is a required field - Requests []*BatchIsAuthorizedInputItem `locationName:"requests" min:"1" type:"list" 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 BatchIsAuthorizedInput) 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 BatchIsAuthorizedInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchIsAuthorizedInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchIsAuthorizedInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Requests == nil { - invalidParams.Add(request.NewErrParamRequired("Requests")) - } - if s.Requests != nil && len(s.Requests) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Requests", 1)) - } - if s.Entities != nil { - if err := s.Entities.Validate(); err != nil { - invalidParams.AddNested("Entities", err.(request.ErrInvalidParams)) - } - } - if s.Requests != nil { - for i, v := range s.Requests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Requests", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntities sets the Entities field's value. -func (s *BatchIsAuthorizedInput) SetEntities(v *EntitiesDefinition) *BatchIsAuthorizedInput { - s.Entities = v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *BatchIsAuthorizedInput) SetPolicyStoreId(v string) *BatchIsAuthorizedInput { - s.PolicyStoreId = &v - return s -} - -// SetRequests sets the Requests field's value. -func (s *BatchIsAuthorizedInput) SetRequests(v []*BatchIsAuthorizedInputItem) *BatchIsAuthorizedInput { - s.Requests = v - return s -} - -// An authorization request that you include in a BatchIsAuthorized API request. -type BatchIsAuthorizedInputItem struct { - _ struct{} `type:"structure"` - - // Specifies the requested action to be authorized. For example, is the principal - // authorized to perform this action on the resource? - Action *ActionIdentifier `locationName:"action" type:"structure"` - - // Specifies additional context that can be used to make more granular authorization - // decisions. - Context *ContextDefinition `locationName:"context" type:"structure"` - - // Specifies the principal for which the authorization decision is to be made. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // Specifies the resource for which the authorization decision is to be made. - Resource *EntityIdentifier `locationName:"resource" 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 BatchIsAuthorizedInputItem) 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 BatchIsAuthorizedInputItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchIsAuthorizedInputItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchIsAuthorizedInputItem"} - if s.Action != nil { - if err := s.Action.Validate(); err != nil { - invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) - } - } - if s.Context != nil { - if err := s.Context.Validate(); err != nil { - invalidParams.AddNested("Context", err.(request.ErrInvalidParams)) - } - } - if s.Principal != nil { - if err := s.Principal.Validate(); err != nil { - invalidParams.AddNested("Principal", err.(request.ErrInvalidParams)) - } - } - if s.Resource != nil { - if err := s.Resource.Validate(); err != nil { - invalidParams.AddNested("Resource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *BatchIsAuthorizedInputItem) SetAction(v *ActionIdentifier) *BatchIsAuthorizedInputItem { - s.Action = v - return s -} - -// SetContext sets the Context field's value. -func (s *BatchIsAuthorizedInputItem) SetContext(v *ContextDefinition) *BatchIsAuthorizedInputItem { - s.Context = v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *BatchIsAuthorizedInputItem) SetPrincipal(v *EntityIdentifier) *BatchIsAuthorizedInputItem { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *BatchIsAuthorizedInputItem) SetResource(v *EntityIdentifier) *BatchIsAuthorizedInputItem { - s.Resource = v - return s -} - -type BatchIsAuthorizedOutput struct { - _ struct{} `type:"structure"` - - // A series of Allow or Deny decisions for each request, and the policies that - // produced them. - // - // Results is a required field - Results []*BatchIsAuthorizedOutputItem `locationName:"results" type:"list" 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 BatchIsAuthorizedOutput) 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 BatchIsAuthorizedOutput) GoString() string { - return s.String() -} - -// SetResults sets the Results field's value. -func (s *BatchIsAuthorizedOutput) SetResults(v []*BatchIsAuthorizedOutputItem) *BatchIsAuthorizedOutput { - s.Results = v - return s -} - -// The decision, based on policy evaluation, from an individual authorization -// request in a BatchIsAuthorized API request. -type BatchIsAuthorizedOutputItem struct { - _ struct{} `type:"structure"` - - // An authorization decision that indicates if the authorization request should - // be allowed or denied. - // - // Decision is a required field - Decision *string `locationName:"decision" type:"string" required:"true" enum:"Decision"` - - // The list of determining policies used to make the authorization decision. - // For example, if there are two matching policies, where one is a forbid and - // the other is a permit, then the forbid policy will be the determining policy. - // In the case of multiple matching permit policies then there would be multiple - // determining policies. In the case that no policies match, and hence the response - // is DENY, there would be no determining policies. - // - // DeterminingPolicies is a required field - DeterminingPolicies []*DeterminingPolicyItem `locationName:"determiningPolicies" type:"list" required:"true"` - - // Errors that occurred while making an authorization decision, for example, - // a policy references an Entity or entity Attribute that does not exist in - // the slice. - // - // Errors is a required field - Errors []*EvaluationErrorItem `locationName:"errors" type:"list" required:"true"` - - // The authorization request that initiated the decision. - // - // Request is a required field - Request *BatchIsAuthorizedInputItem `locationName:"request" type:"structure" 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 BatchIsAuthorizedOutputItem) 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 BatchIsAuthorizedOutputItem) GoString() string { - return s.String() -} - -// SetDecision sets the Decision field's value. -func (s *BatchIsAuthorizedOutputItem) SetDecision(v string) *BatchIsAuthorizedOutputItem { - s.Decision = &v - return s -} - -// SetDeterminingPolicies sets the DeterminingPolicies field's value. -func (s *BatchIsAuthorizedOutputItem) SetDeterminingPolicies(v []*DeterminingPolicyItem) *BatchIsAuthorizedOutputItem { - s.DeterminingPolicies = v - return s -} - -// SetErrors sets the Errors field's value. -func (s *BatchIsAuthorizedOutputItem) SetErrors(v []*EvaluationErrorItem) *BatchIsAuthorizedOutputItem { - s.Errors = v - return s -} - -// SetRequest sets the Request field's value. -func (s *BatchIsAuthorizedOutputItem) SetRequest(v *BatchIsAuthorizedInputItem) *BatchIsAuthorizedOutputItem { - s.Request = v - return s -} - -// The configuration for an identity source that represents a connection to -// an Amazon Cognito user pool used as an identity provider for Verified Permissions. -// -// This data type is used as a field that is part of an Configuration (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_Configuration.html) -// structure that is used as a parameter to the Configuration (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_Configuration.html). -// -// Example:"CognitoUserPoolConfiguration":{"UserPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","ClientIds": -// ["a1b2c3d4e5f6g7h8i9j0kalbmc"]} -type CognitoUserPoolConfiguration struct { - _ struct{} `type:"structure"` - - // The unique application client IDs that are associated with the specified - // Amazon Cognito user pool. - // - // Example: "ClientIds": ["&ExampleCogClientId;"] - ClientIds []*string `locationName:"clientIds" type:"list"` - - // The Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the Amazon Cognito user pool that contains the identities to be authorized. - // - // Example: "UserPoolArn": "arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5" - // - // UserPoolArn is a required field - UserPoolArn *string `locationName:"userPoolArn" min:"1" 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 CognitoUserPoolConfiguration) 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 CognitoUserPoolConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CognitoUserPoolConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CognitoUserPoolConfiguration"} - if s.UserPoolArn == nil { - invalidParams.Add(request.NewErrParamRequired("UserPoolArn")) - } - if s.UserPoolArn != nil && len(*s.UserPoolArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserPoolArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientIds sets the ClientIds field's value. -func (s *CognitoUserPoolConfiguration) SetClientIds(v []*string) *CognitoUserPoolConfiguration { - s.ClientIds = v - return s -} - -// SetUserPoolArn sets the UserPoolArn field's value. -func (s *CognitoUserPoolConfiguration) SetUserPoolArn(v string) *CognitoUserPoolConfiguration { - s.UserPoolArn = &v - return s -} - -// Contains configuration information used when creating a new identity source. -// -// At this time, the only valid member of this structure is a Amazon Cognito -// user pool configuration. -// -// You must specify a userPoolArn, and optionally, a ClientId. -// -// This data type is used as a request parameter for the CreateIdentitySource -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html) -// operation. -type Configuration struct { - _ struct{} `type:"structure"` - - // Contains configuration details of a Amazon Cognito user pool that Verified - // Permissions can use as a source of authenticated identities as entities. - // It specifies the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of a Amazon Cognito user pool and one or more application client IDs. - // - // Example: "configuration":{"cognitoUserPoolConfiguration":{"userPoolArn":"arn:aws:cognito-idp:us-east-1:123456789012:userpool/us-east-1_1a2b3c4d5","clientIds": - // ["a1b2c3d4e5f6g7h8i9j0kalbmc"]}} - CognitoUserPoolConfiguration *CognitoUserPoolConfiguration `locationName:"cognitoUserPoolConfiguration" 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 Configuration) 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 Configuration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Configuration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Configuration"} - if s.CognitoUserPoolConfiguration != nil { - if err := s.CognitoUserPoolConfiguration.Validate(); err != nil { - invalidParams.AddNested("CognitoUserPoolConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCognitoUserPoolConfiguration sets the CognitoUserPoolConfiguration field's value. -func (s *Configuration) SetCognitoUserPoolConfiguration(v *CognitoUserPoolConfiguration) *Configuration { - s.CognitoUserPoolConfiguration = v - return s -} - -// The request failed because another request to modify a resource occurred -// at the same. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The list of resources referenced with this failed request. - // - // Resources is a required field - Resources []*ResourceConflict `locationName:"resources" type:"list" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains additional details about the context of the request. Verified Permissions -// evaluates this information in an authorization request as part of the when -// and unless clauses in a policy. -// -// This data type is used as a request parameter for the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html), -// BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html), -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) -// operations. -// -// Example: "context":{"contextMap":{"":{"boolean":true},"":{"long":1234}}} -type ContextDefinition struct { - _ struct{} `type:"structure"` - - // An list of attributes that are needed to successfully evaluate an authorization - // request. Each attribute in this array must include a map of a data type and - // its value. - // - // Example: "contextMap":{"":{"boolean":true},"":{"long":1234}} - ContextMap map[string]*AttributeValue `locationName:"contextMap" type:"map"` -} - -// 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 ContextDefinition) 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 ContextDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContextDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContextDefinition"} - if s.ContextMap != nil { - for i, v := range s.ContextMap { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContextMap", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContextMap sets the ContextMap field's value. -func (s *ContextDefinition) SetContextMap(v map[string]*AttributeValue) *ContextDefinition { - s.ContextMap = v - return s -} - -type CreateIdentitySourceInput struct { - _ struct{} `type:"structure"` - - // Specifies a unique, case-sensitive ID that you provide to ensure the idempotency - // of the request. This lets you safely retry the request without accidentally - // performing the same operation a second time. Passing the same value to a - // later call to an operation requires that you also pass the same value for - // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Specifies the details required to communicate with the identity provider - // (IdP) associated with this identity source. - // - // At this time, the only valid member of this structure is a Amazon Cognito - // user pool configuration. - // - // You must specify a UserPoolArn, and optionally, a ClientId. - // - // Configuration is a required field - Configuration *Configuration `locationName:"configuration" type:"structure" required:"true"` - - // Specifies the ID of the policy store in which you want to store this identity - // source. Only policies and requests made using this policy store can reference - // identities from the identity provider configured in the new identity source. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // Specifies the namespace and data type of the principals generated for identities - // authenticated by the new identity source. - // - // PrincipalEntityType is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateIdentitySourceInput's - // String and GoString methods. - PrincipalEntityType *string `locationName:"principalEntityType" min:"1" type:"string" sensitive:"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 CreateIdentitySourceInput) 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 CreateIdentitySourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateIdentitySourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateIdentitySourceInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Configuration == nil { - invalidParams.Add(request.NewErrParamRequired("Configuration")) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.PrincipalEntityType != nil && len(*s.PrincipalEntityType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PrincipalEntityType", 1)) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateIdentitySourceInput) SetClientToken(v string) *CreateIdentitySourceInput { - s.ClientToken = &v - return s -} - -// SetConfiguration sets the Configuration field's value. -func (s *CreateIdentitySourceInput) SetConfiguration(v *Configuration) *CreateIdentitySourceInput { - s.Configuration = v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *CreateIdentitySourceInput) SetPolicyStoreId(v string) *CreateIdentitySourceInput { - s.PolicyStoreId = &v - return s -} - -// SetPrincipalEntityType sets the PrincipalEntityType field's value. -func (s *CreateIdentitySourceInput) SetPrincipalEntityType(v string) *CreateIdentitySourceInput { - s.PrincipalEntityType = &v - return s -} - -type CreateIdentitySourceOutput struct { - _ struct{} `type:"structure"` - - // The date and time the identity source was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The unique ID of the new identity source. - // - // IdentitySourceId is a required field - IdentitySourceId *string `locationName:"identitySourceId" min:"1" type:"string" required:"true"` - - // The date and time the identity source was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy store that contains the identity source. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 CreateIdentitySourceOutput) 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 CreateIdentitySourceOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *CreateIdentitySourceOutput) SetCreatedDate(v time.Time) *CreateIdentitySourceOutput { - s.CreatedDate = &v - return s -} - -// SetIdentitySourceId sets the IdentitySourceId field's value. -func (s *CreateIdentitySourceOutput) SetIdentitySourceId(v string) *CreateIdentitySourceOutput { - s.IdentitySourceId = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *CreateIdentitySourceOutput) SetLastUpdatedDate(v time.Time) *CreateIdentitySourceOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *CreateIdentitySourceOutput) SetPolicyStoreId(v string) *CreateIdentitySourceOutput { - s.PolicyStoreId = &v - return s -} - -type CreatePolicyInput struct { - _ struct{} `type:"structure"` - - // Specifies a unique, case-sensitive ID that you provide to ensure the idempotency - // of the request. This lets you safely retry the request without accidentally - // performing the same operation a second time. Passing the same value to a - // later call to an operation requires that you also pass the same value for - // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // A structure that specifies the policy type and content to use for the new - // policy. You must include either a static or a templateLinked element. The - // policy content must be written in the Cedar policy language. - // - // Definition is a required field - Definition *PolicyDefinition `locationName:"definition" type:"structure" required:"true"` - - // Specifies the PolicyStoreId of the policy store you want to store the policy - // in. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 CreatePolicyInput) 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 CreatePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePolicyInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Definition == nil { - invalidParams.Add(request.NewErrParamRequired("Definition")) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Definition != nil { - if err := s.Definition.Validate(); err != nil { - invalidParams.AddNested("Definition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreatePolicyInput) SetClientToken(v string) *CreatePolicyInput { - s.ClientToken = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *CreatePolicyInput) SetDefinition(v *PolicyDefinition) *CreatePolicyInput { - s.Definition = v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *CreatePolicyInput) SetPolicyStoreId(v string) *CreatePolicyInput { - s.PolicyStoreId = &v - return s -} - -type CreatePolicyOutput struct { - _ struct{} `type:"structure"` - - // The date and time the policy was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time the policy was last updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The unique ID of the new policy. - // - // PolicyId is a required field - PolicyId *string `locationName:"policyId" min:"1" type:"string" required:"true"` - - // The ID of the policy store that contains the new policy. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The policy type of the new policy. - // - // PolicyType is a required field - PolicyType *string `locationName:"policyType" type:"string" required:"true" enum:"PolicyType"` - - // The principal specified in the new policy's scope. This response element - // isn't present when principal isn't specified in the policy content. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // The resource specified in the new policy's scope. This response element isn't - // present when the resource isn't specified in the policy content. - Resource *EntityIdentifier `locationName:"resource" 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 CreatePolicyOutput) 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 CreatePolicyOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *CreatePolicyOutput) SetCreatedDate(v time.Time) *CreatePolicyOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *CreatePolicyOutput) SetLastUpdatedDate(v time.Time) *CreatePolicyOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *CreatePolicyOutput) SetPolicyId(v string) *CreatePolicyOutput { - s.PolicyId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *CreatePolicyOutput) SetPolicyStoreId(v string) *CreatePolicyOutput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *CreatePolicyOutput) SetPolicyType(v string) *CreatePolicyOutput { - s.PolicyType = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *CreatePolicyOutput) SetPrincipal(v *EntityIdentifier) *CreatePolicyOutput { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *CreatePolicyOutput) SetResource(v *EntityIdentifier) *CreatePolicyOutput { - s.Resource = v - return s -} - -type CreatePolicyStoreInput struct { - _ struct{} `type:"structure"` - - // Specifies a unique, case-sensitive ID that you provide to ensure the idempotency - // of the request. This lets you safely retry the request without accidentally - // performing the same operation a second time. Passing the same value to a - // later call to an operation requires that you also pass the same value for - // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Specifies the validation setting for this policy store. - // - // Currently, the only valid and required value is Mode. - // - // We recommend that you turn on STRICT mode only after you define a schema. - // If a schema doesn't exist, then STRICT mode causes any policy to fail validation, - // and Verified Permissions rejects the policy. You can turn off validation - // by using the UpdatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore). - // Then, when you have a schema defined, use UpdatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore) - // again to turn validation back on. - // - // ValidationSettings is a required field - ValidationSettings *ValidationSettings `locationName:"validationSettings" type:"structure" 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 CreatePolicyStoreInput) 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 CreatePolicyStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePolicyStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePolicyStoreInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ValidationSettings == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationSettings")) - } - if s.ValidationSettings != nil { - if err := s.ValidationSettings.Validate(); err != nil { - invalidParams.AddNested("ValidationSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreatePolicyStoreInput) SetClientToken(v string) *CreatePolicyStoreInput { - s.ClientToken = &v - return s -} - -// SetValidationSettings sets the ValidationSettings field's value. -func (s *CreatePolicyStoreInput) SetValidationSettings(v *ValidationSettings) *CreatePolicyStoreInput { - s.ValidationSettings = v - return s -} - -type CreatePolicyStoreOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the new policy store. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The date and time the policy store was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time the policy store was last updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The unique ID of the new policy store. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 CreatePolicyStoreOutput) 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 CreatePolicyStoreOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreatePolicyStoreOutput) SetArn(v string) *CreatePolicyStoreOutput { - s.Arn = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *CreatePolicyStoreOutput) SetCreatedDate(v time.Time) *CreatePolicyStoreOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *CreatePolicyStoreOutput) SetLastUpdatedDate(v time.Time) *CreatePolicyStoreOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *CreatePolicyStoreOutput) SetPolicyStoreId(v string) *CreatePolicyStoreOutput { - s.PolicyStoreId = &v - return s -} - -type CreatePolicyTemplateInput struct { - _ struct{} `type:"structure"` - - // Specifies a unique, case-sensitive ID that you provide to ensure the idempotency - // of the request. This lets you safely retry the request without accidentally - // performing the same operation a second time. Passing the same value to a - // later call to an operation requires that you also pass the same value for - // all other parameters. We recommend that you use a UUID type of value. (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // Specifies a description for the policy template. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreatePolicyTemplateInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The ID of the policy store in which to create the policy template. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // Specifies the content that you want to use for the new policy template, written - // in the Cedar policy language. - // - // Statement is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreatePolicyTemplateInput's - // String and GoString methods. - // - // Statement is a required field - Statement *string `locationName:"statement" min:"1" type:"string" required:"true" sensitive:"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 CreatePolicyTemplateInput) 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 CreatePolicyTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePolicyTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePolicyTemplateInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Statement == nil { - invalidParams.Add(request.NewErrParamRequired("Statement")) - } - if s.Statement != nil && len(*s.Statement) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Statement", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreatePolicyTemplateInput) SetClientToken(v string) *CreatePolicyTemplateInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreatePolicyTemplateInput) SetDescription(v string) *CreatePolicyTemplateInput { - s.Description = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *CreatePolicyTemplateInput) SetPolicyStoreId(v string) *CreatePolicyTemplateInput { - s.PolicyStoreId = &v - return s -} - -// SetStatement sets the Statement field's value. -func (s *CreatePolicyTemplateInput) SetStatement(v string) *CreatePolicyTemplateInput { - s.Statement = &v - return s -} - -type CreatePolicyTemplateOutput struct { - _ struct{} `type:"structure"` - - // The date and time the policy template was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time the policy template was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy store that contains the policy template. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The unique ID of the new policy template. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" 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 CreatePolicyTemplateOutput) 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 CreatePolicyTemplateOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *CreatePolicyTemplateOutput) SetCreatedDate(v time.Time) *CreatePolicyTemplateOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *CreatePolicyTemplateOutput) SetLastUpdatedDate(v time.Time) *CreatePolicyTemplateOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *CreatePolicyTemplateOutput) SetPolicyStoreId(v string) *CreatePolicyTemplateOutput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *CreatePolicyTemplateOutput) SetPolicyTemplateId(v string) *CreatePolicyTemplateOutput { - s.PolicyTemplateId = &v - return s -} - -type DeleteIdentitySourceInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the identity source that you want to delete. - // - // IdentitySourceId is a required field - IdentitySourceId *string `locationName:"identitySourceId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy store that contains the identity source that - // you want to delete. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 DeleteIdentitySourceInput) 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 DeleteIdentitySourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIdentitySourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIdentitySourceInput"} - if s.IdentitySourceId == nil { - invalidParams.Add(request.NewErrParamRequired("IdentitySourceId")) - } - if s.IdentitySourceId != nil && len(*s.IdentitySourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IdentitySourceId", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentitySourceId sets the IdentitySourceId field's value. -func (s *DeleteIdentitySourceInput) SetIdentitySourceId(v string) *DeleteIdentitySourceInput { - s.IdentitySourceId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *DeleteIdentitySourceInput) SetPolicyStoreId(v string) *DeleteIdentitySourceInput { - s.PolicyStoreId = &v - return s -} - -type DeleteIdentitySourceOutput 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 DeleteIdentitySourceOutput) 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 DeleteIdentitySourceOutput) GoString() string { - return s.String() -} - -type DeletePolicyInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the policy that you want to delete. - // - // PolicyId is a required field - PolicyId *string `locationName:"policyId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy store that contains the policy that you want - // to delete. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 DeletePolicyInput) 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 DeletePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePolicyInput"} - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - if s.PolicyId != nil && len(*s.PolicyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyId sets the PolicyId field's value. -func (s *DeletePolicyInput) SetPolicyId(v string) *DeletePolicyInput { - s.PolicyId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *DeletePolicyInput) SetPolicyStoreId(v string) *DeletePolicyInput { - s.PolicyStoreId = &v - return s -} - -type DeletePolicyOutput 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 DeletePolicyOutput) 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 DeletePolicyOutput) GoString() string { - return s.String() -} - -type DeletePolicyStoreInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the policy store that you want to delete. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 DeletePolicyStoreInput) 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 DeletePolicyStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePolicyStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePolicyStoreInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *DeletePolicyStoreInput) SetPolicyStoreId(v string) *DeletePolicyStoreInput { - s.PolicyStoreId = &v - return s -} - -type DeletePolicyStoreOutput 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 DeletePolicyStoreOutput) 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 DeletePolicyStoreOutput) GoString() string { - return s.String() -} - -type DeletePolicyTemplateInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the policy store that contains the policy template that - // you want to delete. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy template that you want to delete. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" 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 DeletePolicyTemplateInput) 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 DeletePolicyTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePolicyTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePolicyTemplateInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.PolicyTemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyTemplateId")) - } - if s.PolicyTemplateId != nil && len(*s.PolicyTemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyTemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *DeletePolicyTemplateInput) SetPolicyStoreId(v string) *DeletePolicyTemplateInput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *DeletePolicyTemplateInput) SetPolicyTemplateId(v string) *DeletePolicyTemplateInput { - s.PolicyTemplateId = &v - return s -} - -type DeletePolicyTemplateOutput 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 DeletePolicyTemplateOutput) 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 DeletePolicyTemplateOutput) GoString() string { - return s.String() -} - -// Contains information about one of the policies that determined an authorization -// decision. -// -// This data type is used as an element in a response parameter for the IsAuthorized -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html), -// BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html), -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) -// operations. -// -// Example: "determiningPolicies":[{"policyId":"SPEXAMPLEabcdefg111111"}] -type DeterminingPolicyItem struct { - _ struct{} `type:"structure"` - - // The Id of a policy that determined to an authorization decision. - // - // Example: "policyId":"SPEXAMPLEabcdefg111111" - // - // PolicyId is a required field - PolicyId *string `locationName:"policyId" min:"1" 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 DeterminingPolicyItem) 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 DeterminingPolicyItem) GoString() string { - return s.String() -} - -// SetPolicyId sets the PolicyId field's value. -func (s *DeterminingPolicyItem) SetPolicyId(v string) *DeterminingPolicyItem { - s.PolicyId = &v - return s -} - -// Contains the list of entities to be considered during an authorization request. -// This includes all principals, resources, and actions required to successfully -// evaluate the request. -// -// This data type is used as a field in the response parameter for the IsAuthorized -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) -// operations. -type EntitiesDefinition struct { - _ struct{} `type:"structure"` - - // An array of entities that are needed to successfully evaluate an authorization - // request. Each entity in this array must include an identifier for the entity, - // the attributes of the entity, and a list of any parent entities. - EntityList []*EntityItem `locationName:"entityList" type:"list"` -} - -// 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 EntitiesDefinition) 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 EntitiesDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EntitiesDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EntitiesDefinition"} - if s.EntityList != nil { - for i, v := range s.EntityList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "EntityList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntityList sets the EntityList field's value. -func (s *EntitiesDefinition) SetEntityList(v []*EntityItem) *EntitiesDefinition { - s.EntityList = v - return s -} - -// Contains the identifier of an entity, including its ID and type. -// -// This data type is used as a request parameter for IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html) -// operation, and as a response parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html), -// GetPolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_GetPolicy.html), -// and UpdatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicy.html) -// operations. -// -// Example: {"entityId":"string","entityType":"string"} -type EntityIdentifier struct { - _ struct{} `type:"structure"` - - // The identifier of an entity. - // - // "entityId":"identifier" - // - // EntityId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EntityIdentifier's - // String and GoString methods. - // - // EntityId is a required field - EntityId *string `locationName:"entityId" min:"1" type:"string" required:"true" sensitive:"true"` - - // The type of an entity. - // - // Example: "entityType":"typeName" - // - // EntityType is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EntityIdentifier's - // String and GoString methods. - // - // EntityType is a required field - EntityType *string `locationName:"entityType" min:"1" type:"string" required:"true" sensitive:"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 EntityIdentifier) 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 EntityIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EntityIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EntityIdentifier"} - if s.EntityId == nil { - invalidParams.Add(request.NewErrParamRequired("EntityId")) - } - if s.EntityId != nil && len(*s.EntityId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EntityId", 1)) - } - if s.EntityType == nil { - invalidParams.Add(request.NewErrParamRequired("EntityType")) - } - if s.EntityType != nil && len(*s.EntityType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EntityType", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEntityId sets the EntityId field's value. -func (s *EntityIdentifier) SetEntityId(v string) *EntityIdentifier { - s.EntityId = &v - return s -} - -// SetEntityType sets the EntityType field's value. -func (s *EntityIdentifier) SetEntityType(v string) *EntityIdentifier { - s.EntityType = &v - return s -} - -// Contains information about an entity that can be referenced in a Cedar policy. -// -// This data type is used as one of the fields in the EntitiesDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_EntitiesDefinition.html) -// structure. -// -// { "identifier": { "entityType": "Photo", "entityId": "VacationPhoto94.jpg" -// }, "attributes": {}, "parents": [ { "entityType": "Album", "entityId": "alice_folder" -// } ] } -type EntityItem struct { - _ struct{} `type:"structure"` - - // A list of attributes for the entity. - Attributes map[string]*AttributeValue `locationName:"attributes" type:"map"` - - // The identifier of the entity. - // - // Identifier is a required field - Identifier *EntityIdentifier `locationName:"identifier" type:"structure" required:"true"` - - // The parents in the hierarchy that contains the entity. - Parents []*EntityIdentifier `locationName:"parents" type:"list"` -} - -// 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 EntityItem) 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 EntityItem) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EntityItem) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EntityItem"} - if s.Identifier == nil { - invalidParams.Add(request.NewErrParamRequired("Identifier")) - } - if s.Attributes != nil { - for i, v := range s.Attributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Identifier != nil { - if err := s.Identifier.Validate(); err != nil { - invalidParams.AddNested("Identifier", err.(request.ErrInvalidParams)) - } - } - if s.Parents != nil { - for i, v := range s.Parents { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Parents", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributes sets the Attributes field's value. -func (s *EntityItem) SetAttributes(v map[string]*AttributeValue) *EntityItem { - s.Attributes = v - return s -} - -// SetIdentifier sets the Identifier field's value. -func (s *EntityItem) SetIdentifier(v *EntityIdentifier) *EntityItem { - s.Identifier = v - return s -} - -// SetParents sets the Parents field's value. -func (s *EntityItem) SetParents(v []*EntityIdentifier) *EntityItem { - s.Parents = v - return s -} - -// Contains information about a principal or resource that can be referenced -// in a Cedar policy. -// -// This data type is used as part of the PolicyFilter (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyFilter.html) -// structure that is used as a request parameter for the ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) -// operation.. -type EntityReference struct { - _ struct{} `type:"structure"` - - // The identifier of the entity. It can consist of either an EntityType and - // EntityId, a principal, or a resource. - Identifier *EntityIdentifier `locationName:"identifier" type:"structure"` - - // Used to indicate that a principal or resource is not specified. This can - // be used to search for policies that are not associated with a specific principal - // or resource. - Unspecified *bool `locationName:"unspecified" type:"boolean"` -} - -// 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 EntityReference) 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 EntityReference) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EntityReference) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EntityReference"} - if s.Identifier != nil { - if err := s.Identifier.Validate(); err != nil { - invalidParams.AddNested("Identifier", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentifier sets the Identifier field's value. -func (s *EntityReference) SetIdentifier(v *EntityIdentifier) *EntityReference { - s.Identifier = v - return s -} - -// SetUnspecified sets the Unspecified field's value. -func (s *EntityReference) SetUnspecified(v bool) *EntityReference { - s.Unspecified = &v - return s -} - -// Contains a description of an evaluation error. -// -// This data type is a response parameter of the IsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorized.html), -// BatchIsAuthorized (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_BatchIsAuthorized.html), -// and IsAuthorizedWithToken (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_IsAuthorizedWithToken.html) -// operations. -type EvaluationErrorItem struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The error description. - // - // ErrorDescription is a required field - ErrorDescription *string `locationName:"errorDescription" 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 EvaluationErrorItem) 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 EvaluationErrorItem) GoString() string { - return s.String() -} - -// SetErrorDescription sets the ErrorDescription field's value. -func (s *EvaluationErrorItem) SetErrorDescription(v string) *EvaluationErrorItem { - s.ErrorDescription = &v - return s -} - -type GetIdentitySourceInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the identity source you want information about. - // - // IdentitySourceId is a required field - IdentitySourceId *string `locationName:"identitySourceId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy store that contains the identity source you - // want information about. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 GetIdentitySourceInput) 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 GetIdentitySourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetIdentitySourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetIdentitySourceInput"} - if s.IdentitySourceId == nil { - invalidParams.Add(request.NewErrParamRequired("IdentitySourceId")) - } - if s.IdentitySourceId != nil && len(*s.IdentitySourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IdentitySourceId", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentitySourceId sets the IdentitySourceId field's value. -func (s *GetIdentitySourceInput) SetIdentitySourceId(v string) *GetIdentitySourceInput { - s.IdentitySourceId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetIdentitySourceInput) SetPolicyStoreId(v string) *GetIdentitySourceInput { - s.PolicyStoreId = &v - return s -} - -type GetIdentitySourceOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the identity source was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // A structure that describes the configuration of the identity source. - // - // Details is a required field - Details *IdentitySourceDetails `locationName:"details" type:"structure" required:"true"` - - // The ID of the identity source. - // - // IdentitySourceId is a required field - IdentitySourceId *string `locationName:"identitySourceId" min:"1" type:"string" required:"true"` - - // The date and time that the identity source was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy store that contains the identity source. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The data type of principals generated for identities authenticated by this - // identity source. - // - // PrincipalEntityType is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetIdentitySourceOutput's - // String and GoString methods. - // - // PrincipalEntityType is a required field - PrincipalEntityType *string `locationName:"principalEntityType" min:"1" type:"string" required:"true" sensitive:"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 GetIdentitySourceOutput) 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 GetIdentitySourceOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *GetIdentitySourceOutput) SetCreatedDate(v time.Time) *GetIdentitySourceOutput { - s.CreatedDate = &v - return s -} - -// SetDetails sets the Details field's value. -func (s *GetIdentitySourceOutput) SetDetails(v *IdentitySourceDetails) *GetIdentitySourceOutput { - s.Details = v - return s -} - -// SetIdentitySourceId sets the IdentitySourceId field's value. -func (s *GetIdentitySourceOutput) SetIdentitySourceId(v string) *GetIdentitySourceOutput { - s.IdentitySourceId = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *GetIdentitySourceOutput) SetLastUpdatedDate(v time.Time) *GetIdentitySourceOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetIdentitySourceOutput) SetPolicyStoreId(v string) *GetIdentitySourceOutput { - s.PolicyStoreId = &v - return s -} - -// SetPrincipalEntityType sets the PrincipalEntityType field's value. -func (s *GetIdentitySourceOutput) SetPrincipalEntityType(v string) *GetIdentitySourceOutput { - s.PrincipalEntityType = &v - return s -} - -type GetPolicyInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the policy you want information about. - // - // PolicyId is a required field - PolicyId *string `locationName:"policyId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy store that contains the policy that you want - // information about. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 GetPolicyInput) 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 GetPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPolicyInput"} - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - if s.PolicyId != nil && len(*s.PolicyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyId sets the PolicyId field's value. -func (s *GetPolicyInput) SetPolicyId(v string) *GetPolicyInput { - s.PolicyId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetPolicyInput) SetPolicyStoreId(v string) *GetPolicyInput { - s.PolicyStoreId = &v - return s -} - -type GetPolicyOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the policy was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The definition of the requested policy. - // - // Definition is a required field - Definition *PolicyDefinitionDetail `locationName:"definition" type:"structure" required:"true"` - - // The date and time that the policy was last updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The unique ID of the policy that you want information about. - // - // PolicyId is a required field - PolicyId *string `locationName:"policyId" min:"1" type:"string" required:"true"` - - // The ID of the policy store that contains the policy that you want information - // about. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The type of the policy. - // - // PolicyType is a required field - PolicyType *string `locationName:"policyType" type:"string" required:"true" enum:"PolicyType"` - - // The principal specified in the policy's scope. This element isn't included - // in the response when Principal isn't present in the policy content. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // The resource specified in the policy's scope. This element isn't included - // in the response when Resource isn't present in the policy content. - Resource *EntityIdentifier `locationName:"resource" 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 GetPolicyOutput) 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 GetPolicyOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *GetPolicyOutput) SetCreatedDate(v time.Time) *GetPolicyOutput { - s.CreatedDate = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *GetPolicyOutput) SetDefinition(v *PolicyDefinitionDetail) *GetPolicyOutput { - s.Definition = v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *GetPolicyOutput) SetLastUpdatedDate(v time.Time) *GetPolicyOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *GetPolicyOutput) SetPolicyId(v string) *GetPolicyOutput { - s.PolicyId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetPolicyOutput) SetPolicyStoreId(v string) *GetPolicyOutput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *GetPolicyOutput) SetPolicyType(v string) *GetPolicyOutput { - s.PolicyType = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *GetPolicyOutput) SetPrincipal(v *EntityIdentifier) *GetPolicyOutput { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *GetPolicyOutput) SetResource(v *EntityIdentifier) *GetPolicyOutput { - s.Resource = v - return s -} - -type GetPolicyStoreInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the policy store that you want information about. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 GetPolicyStoreInput) 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 GetPolicyStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPolicyStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPolicyStoreInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetPolicyStoreInput) SetPolicyStoreId(v string) *GetPolicyStoreInput { - s.PolicyStoreId = &v - return s -} - -type GetPolicyStoreOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the policy store. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The date and time that the policy store was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time that the policy store was last updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy store; - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The current validation settings for the policy store. - // - // ValidationSettings is a required field - ValidationSettings *ValidationSettings `locationName:"validationSettings" type:"structure" 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 GetPolicyStoreOutput) 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 GetPolicyStoreOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetPolicyStoreOutput) SetArn(v string) *GetPolicyStoreOutput { - s.Arn = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *GetPolicyStoreOutput) SetCreatedDate(v time.Time) *GetPolicyStoreOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *GetPolicyStoreOutput) SetLastUpdatedDate(v time.Time) *GetPolicyStoreOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetPolicyStoreOutput) SetPolicyStoreId(v string) *GetPolicyStoreOutput { - s.PolicyStoreId = &v - return s -} - -// SetValidationSettings sets the ValidationSettings field's value. -func (s *GetPolicyStoreOutput) SetValidationSettings(v *ValidationSettings) *GetPolicyStoreOutput { - s.ValidationSettings = v - return s -} - -type GetPolicyTemplateInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the policy store that contains the policy template that - // you want information about. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy template that you want information about. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" 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 GetPolicyTemplateInput) 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 GetPolicyTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPolicyTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPolicyTemplateInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.PolicyTemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyTemplateId")) - } - if s.PolicyTemplateId != nil && len(*s.PolicyTemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyTemplateId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetPolicyTemplateInput) SetPolicyStoreId(v string) *GetPolicyTemplateInput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *GetPolicyTemplateInput) SetPolicyTemplateId(v string) *GetPolicyTemplateInput { - s.PolicyTemplateId = &v - return s -} - -type GetPolicyTemplateOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the policy template was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The description of the policy template. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetPolicyTemplateOutput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The date and time that the policy template was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy store that contains the policy template. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The ID of the policy template. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" type:"string" required:"true"` - - // The content of the body of the policy template written in the Cedar policy - // language. - // - // Statement is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetPolicyTemplateOutput's - // String and GoString methods. - // - // Statement is a required field - Statement *string `locationName:"statement" min:"1" type:"string" required:"true" sensitive:"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 GetPolicyTemplateOutput) 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 GetPolicyTemplateOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *GetPolicyTemplateOutput) SetCreatedDate(v time.Time) *GetPolicyTemplateOutput { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *GetPolicyTemplateOutput) SetDescription(v string) *GetPolicyTemplateOutput { - s.Description = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *GetPolicyTemplateOutput) SetLastUpdatedDate(v time.Time) *GetPolicyTemplateOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetPolicyTemplateOutput) SetPolicyStoreId(v string) *GetPolicyTemplateOutput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *GetPolicyTemplateOutput) SetPolicyTemplateId(v string) *GetPolicyTemplateOutput { - s.PolicyTemplateId = &v - return s -} - -// SetStatement sets the Statement field's value. -func (s *GetPolicyTemplateOutput) SetStatement(v string) *GetPolicyTemplateOutput { - s.Statement = &v - return s -} - -type GetSchemaInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the policy store that contains the schema. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 GetSchemaInput) 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 GetSchemaInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSchemaInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSchemaInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetSchemaInput) SetPolicyStoreId(v string) *GetSchemaInput { - s.PolicyStoreId = &v - return s -} - -type GetSchemaOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the schema was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time that the schema was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy store that contains the schema. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The body of the schema, written in Cedar schema JSON. - // - // Schema is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetSchemaOutput's - // String and GoString methods. - // - // Schema is a required field - Schema *string `locationName:"schema" min:"1" type:"string" required:"true" sensitive:"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 GetSchemaOutput) 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 GetSchemaOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *GetSchemaOutput) SetCreatedDate(v time.Time) *GetSchemaOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *GetSchemaOutput) SetLastUpdatedDate(v time.Time) *GetSchemaOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *GetSchemaOutput) SetPolicyStoreId(v string) *GetSchemaOutput { - s.PolicyStoreId = &v - return s -} - -// SetSchema sets the Schema field's value. -func (s *GetSchemaOutput) SetSchema(v string) *GetSchemaOutput { - s.Schema = &v - return s -} - -// A structure that contains configuration of the identity source. -// -// This data type is used as a response parameter for the CreateIdentitySource -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html) -// operation. -type IdentitySourceDetails struct { - _ struct{} `type:"structure"` - - // The application client IDs associated with the specified Amazon Cognito user - // pool that are enabled for this identity source. - ClientIds []*string `locationName:"clientIds" type:"list"` - - // The well-known URL that points to this user pool's OIDC discovery endpoint. - // This is a URL string in the following format. This URL replaces the placeholders - // for both the Amazon Web Services Region and the user pool identifier with - // those appropriate for this user pool. - // - // https://cognito-idp..amazonaws.com//.well-known/openid-configuration - DiscoveryUrl *string `locationName:"discoveryUrl" min:"1" type:"string"` - - // A string that identifies the type of OIDC service represented by this identity - // source. - // - // At this time, the only valid value is cognito. - OpenIdIssuer *string `locationName:"openIdIssuer" type:"string" enum:"OpenIdIssuer"` - - // The Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the Amazon Cognito user pool whose identities are accessible to this Verified - // Permissions policy store. - UserPoolArn *string `locationName:"userPoolArn" min:"1" 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 IdentitySourceDetails) 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 IdentitySourceDetails) GoString() string { - return s.String() -} - -// SetClientIds sets the ClientIds field's value. -func (s *IdentitySourceDetails) SetClientIds(v []*string) *IdentitySourceDetails { - s.ClientIds = v - return s -} - -// SetDiscoveryUrl sets the DiscoveryUrl field's value. -func (s *IdentitySourceDetails) SetDiscoveryUrl(v string) *IdentitySourceDetails { - s.DiscoveryUrl = &v - return s -} - -// SetOpenIdIssuer sets the OpenIdIssuer field's value. -func (s *IdentitySourceDetails) SetOpenIdIssuer(v string) *IdentitySourceDetails { - s.OpenIdIssuer = &v - return s -} - -// SetUserPoolArn sets the UserPoolArn field's value. -func (s *IdentitySourceDetails) SetUserPoolArn(v string) *IdentitySourceDetails { - s.UserPoolArn = &v - return s -} - -// A structure that defines characteristics of an identity source that you can -// use to filter. -// -// This data type is used as a request parameter for the ListIdentityStores -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListIdentityStores.html) -// operation. -type IdentitySourceFilter struct { - _ struct{} `type:"structure"` - - // The Cedar entity type of the principals returned by the identity provider - // (IdP) associated with this identity source. - // - // PrincipalEntityType is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by IdentitySourceFilter's - // String and GoString methods. - PrincipalEntityType *string `locationName:"principalEntityType" min:"1" type:"string" sensitive:"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 IdentitySourceFilter) 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 IdentitySourceFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IdentitySourceFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IdentitySourceFilter"} - if s.PrincipalEntityType != nil && len(*s.PrincipalEntityType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PrincipalEntityType", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrincipalEntityType sets the PrincipalEntityType field's value. -func (s *IdentitySourceFilter) SetPrincipalEntityType(v string) *IdentitySourceFilter { - s.PrincipalEntityType = &v - return s -} - -// A structure that defines an identity source. -// -// This data type is used as a request parameter for the ListIdentityStores -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListIdentityStores.html) -// operation. -type IdentitySourceItem struct { - _ struct{} `type:"structure"` - - // The date and time the identity source was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // A structure that contains the details of the associated identity provider - // (IdP). - // - // Details is a required field - Details *IdentitySourceItemDetails `locationName:"details" type:"structure" required:"true"` - - // The unique identifier of the identity source. - // - // IdentitySourceId is a required field - IdentitySourceId *string `locationName:"identitySourceId" min:"1" type:"string" required:"true"` - - // The date and time the identity source was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The identifier of the policy store that contains the identity source. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The Cedar entity type of the principals returned from the IdP associated - // with this identity source. - // - // PrincipalEntityType is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by IdentitySourceItem's - // String and GoString methods. - // - // PrincipalEntityType is a required field - PrincipalEntityType *string `locationName:"principalEntityType" min:"1" type:"string" required:"true" sensitive:"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 IdentitySourceItem) 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 IdentitySourceItem) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *IdentitySourceItem) SetCreatedDate(v time.Time) *IdentitySourceItem { - s.CreatedDate = &v - return s -} - -// SetDetails sets the Details field's value. -func (s *IdentitySourceItem) SetDetails(v *IdentitySourceItemDetails) *IdentitySourceItem { - s.Details = v - return s -} - -// SetIdentitySourceId sets the IdentitySourceId field's value. -func (s *IdentitySourceItem) SetIdentitySourceId(v string) *IdentitySourceItem { - s.IdentitySourceId = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *IdentitySourceItem) SetLastUpdatedDate(v time.Time) *IdentitySourceItem { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *IdentitySourceItem) SetPolicyStoreId(v string) *IdentitySourceItem { - s.PolicyStoreId = &v - return s -} - -// SetPrincipalEntityType sets the PrincipalEntityType field's value. -func (s *IdentitySourceItem) SetPrincipalEntityType(v string) *IdentitySourceItem { - s.PrincipalEntityType = &v - return s -} - -// A structure that contains configuration of the identity source. -// -// This data type is used as a response parameter for the CreateIdentitySource -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreateIdentitySource.html) -// operation. -type IdentitySourceItemDetails struct { - _ struct{} `type:"structure"` - - // The application client IDs associated with the specified Amazon Cognito user - // pool that are enabled for this identity source. - ClientIds []*string `locationName:"clientIds" type:"list"` - - // The well-known URL that points to this user pool's OIDC discovery endpoint. - // This is a URL string in the following format. This URL replaces the placeholders - // for both the Amazon Web Services Region and the user pool identifier with - // those appropriate for this user pool. - // - // https://cognito-idp..amazonaws.com//.well-known/openid-configuration - DiscoveryUrl *string `locationName:"discoveryUrl" min:"1" type:"string"` - - // A string that identifies the type of OIDC service represented by this identity - // source. - // - // At this time, the only valid value is cognito. - OpenIdIssuer *string `locationName:"openIdIssuer" type:"string" enum:"OpenIdIssuer"` - - // The Amazon Cognito user pool whose identities are accessible to this Verified - // Permissions policy store. - UserPoolArn *string `locationName:"userPoolArn" min:"1" 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 IdentitySourceItemDetails) 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 IdentitySourceItemDetails) GoString() string { - return s.String() -} - -// SetClientIds sets the ClientIds field's value. -func (s *IdentitySourceItemDetails) SetClientIds(v []*string) *IdentitySourceItemDetails { - s.ClientIds = v - return s -} - -// SetDiscoveryUrl sets the DiscoveryUrl field's value. -func (s *IdentitySourceItemDetails) SetDiscoveryUrl(v string) *IdentitySourceItemDetails { - s.DiscoveryUrl = &v - return s -} - -// SetOpenIdIssuer sets the OpenIdIssuer field's value. -func (s *IdentitySourceItemDetails) SetOpenIdIssuer(v string) *IdentitySourceItemDetails { - s.OpenIdIssuer = &v - return s -} - -// SetUserPoolArn sets the UserPoolArn field's value. -func (s *IdentitySourceItemDetails) SetUserPoolArn(v string) *IdentitySourceItemDetails { - s.UserPoolArn = &v - return s -} - -// The request failed because of an internal error. Try your request again later -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type IsAuthorizedInput struct { - _ struct{} `type:"structure"` - - // Specifies the requested action to be authorized. For example, is the principal - // authorized to perform this action on the resource? - Action *ActionIdentifier `locationName:"action" type:"structure"` - - // Specifies additional context that can be used to make more granular authorization - // decisions. - Context *ContextDefinition `locationName:"context" type:"structure"` - - // Specifies the list of resources and principals and their associated attributes - // that Verified Permissions can examine when evaluating the policies. - // - // You can include only principal and resource entities in this parameter; you - // can't include actions. You must specify actions in the schema. - Entities *EntitiesDefinition `locationName:"entities" type:"structure"` - - // Specifies the ID of the policy store. Policies in this policy store will - // be used to make an authorization decision for the input. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // Specifies the principal for which the authorization decision is to be made. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // Specifies the resource for which the authorization decision is to be made. - Resource *EntityIdentifier `locationName:"resource" 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 IsAuthorizedInput) 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 IsAuthorizedInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IsAuthorizedInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IsAuthorizedInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Action != nil { - if err := s.Action.Validate(); err != nil { - invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) - } - } - if s.Context != nil { - if err := s.Context.Validate(); err != nil { - invalidParams.AddNested("Context", err.(request.ErrInvalidParams)) - } - } - if s.Entities != nil { - if err := s.Entities.Validate(); err != nil { - invalidParams.AddNested("Entities", err.(request.ErrInvalidParams)) - } - } - if s.Principal != nil { - if err := s.Principal.Validate(); err != nil { - invalidParams.AddNested("Principal", err.(request.ErrInvalidParams)) - } - } - if s.Resource != nil { - if err := s.Resource.Validate(); err != nil { - invalidParams.AddNested("Resource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *IsAuthorizedInput) SetAction(v *ActionIdentifier) *IsAuthorizedInput { - s.Action = v - return s -} - -// SetContext sets the Context field's value. -func (s *IsAuthorizedInput) SetContext(v *ContextDefinition) *IsAuthorizedInput { - s.Context = v - return s -} - -// SetEntities sets the Entities field's value. -func (s *IsAuthorizedInput) SetEntities(v *EntitiesDefinition) *IsAuthorizedInput { - s.Entities = v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *IsAuthorizedInput) SetPolicyStoreId(v string) *IsAuthorizedInput { - s.PolicyStoreId = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *IsAuthorizedInput) SetPrincipal(v *EntityIdentifier) *IsAuthorizedInput { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *IsAuthorizedInput) SetResource(v *EntityIdentifier) *IsAuthorizedInput { - s.Resource = v - return s -} - -type IsAuthorizedOutput struct { - _ struct{} `type:"structure"` - - // An authorization decision that indicates if the authorization request should - // be allowed or denied. - // - // Decision is a required field - Decision *string `locationName:"decision" type:"string" required:"true" enum:"Decision"` - - // The list of determining policies used to make the authorization decision. - // For example, if there are two matching policies, where one is a forbid and - // the other is a permit, then the forbid policy will be the determining policy. - // In the case of multiple matching permit policies then there would be multiple - // determining policies. In the case that no policies match, and hence the response - // is DENY, there would be no determining policies. - // - // DeterminingPolicies is a required field - DeterminingPolicies []*DeterminingPolicyItem `locationName:"determiningPolicies" type:"list" required:"true"` - - // Errors that occurred while making an authorization decision, for example, - // a policy references an Entity or entity Attribute that does not exist in - // the slice. - // - // Errors is a required field - Errors []*EvaluationErrorItem `locationName:"errors" type:"list" 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 IsAuthorizedOutput) 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 IsAuthorizedOutput) GoString() string { - return s.String() -} - -// SetDecision sets the Decision field's value. -func (s *IsAuthorizedOutput) SetDecision(v string) *IsAuthorizedOutput { - s.Decision = &v - return s -} - -// SetDeterminingPolicies sets the DeterminingPolicies field's value. -func (s *IsAuthorizedOutput) SetDeterminingPolicies(v []*DeterminingPolicyItem) *IsAuthorizedOutput { - s.DeterminingPolicies = v - return s -} - -// SetErrors sets the Errors field's value. -func (s *IsAuthorizedOutput) SetErrors(v []*EvaluationErrorItem) *IsAuthorizedOutput { - s.Errors = v - return s -} - -type IsAuthorizedWithTokenInput struct { - _ struct{} `type:"structure"` - - // Specifies an access token for the principal to be authorized. This token - // is provided to you by the identity provider (IdP) associated with the specified - // identity source. You must specify either an AccessToken, or an IdentityToken, - // or both. - // - // AccessToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by IsAuthorizedWithTokenInput's - // String and GoString methods. - AccessToken *string `locationName:"accessToken" min:"1" type:"string" sensitive:"true"` - - // Specifies the requested action to be authorized. Is the specified principal - // authorized to perform this action on the specified resource. - Action *ActionIdentifier `locationName:"action" type:"structure"` - - // Specifies additional context that can be used to make more granular authorization - // decisions. - Context *ContextDefinition `locationName:"context" type:"structure"` - - // Specifies the list of resources and their associated attributes that Verified - // Permissions can examine when evaluating the policies. - // - // You can include only resource and action entities in this parameter; you - // can't include principals. - // - // * The IsAuthorizedWithToken operation takes principal attributes from - // only the identityToken or accessToken passed to the operation. - // - // * For action entities, you can include only their Identifier and EntityType. - Entities *EntitiesDefinition `locationName:"entities" type:"structure"` - - // Specifies an identity token for the principal to be authorized. This token - // is provided to you by the identity provider (IdP) associated with the specified - // identity source. You must specify either an AccessToken or an IdentityToken, - // or both. - // - // IdentityToken is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by IsAuthorizedWithTokenInput's - // String and GoString methods. - IdentityToken *string `locationName:"identityToken" min:"1" type:"string" sensitive:"true"` - - // Specifies the ID of the policy store. Policies in this policy store will - // be used to make an authorization decision for the input. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // Specifies the resource for which the authorization decision is made. For - // example, is the principal allowed to perform the action on the resource? - Resource *EntityIdentifier `locationName:"resource" 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 IsAuthorizedWithTokenInput) 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 IsAuthorizedWithTokenInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IsAuthorizedWithTokenInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IsAuthorizedWithTokenInput"} - if s.AccessToken != nil && len(*s.AccessToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AccessToken", 1)) - } - if s.IdentityToken != nil && len(*s.IdentityToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IdentityToken", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Action != nil { - if err := s.Action.Validate(); err != nil { - invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) - } - } - if s.Context != nil { - if err := s.Context.Validate(); err != nil { - invalidParams.AddNested("Context", err.(request.ErrInvalidParams)) - } - } - if s.Entities != nil { - if err := s.Entities.Validate(); err != nil { - invalidParams.AddNested("Entities", err.(request.ErrInvalidParams)) - } - } - if s.Resource != nil { - if err := s.Resource.Validate(); err != nil { - invalidParams.AddNested("Resource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessToken sets the AccessToken field's value. -func (s *IsAuthorizedWithTokenInput) SetAccessToken(v string) *IsAuthorizedWithTokenInput { - s.AccessToken = &v - return s -} - -// SetAction sets the Action field's value. -func (s *IsAuthorizedWithTokenInput) SetAction(v *ActionIdentifier) *IsAuthorizedWithTokenInput { - s.Action = v - return s -} - -// SetContext sets the Context field's value. -func (s *IsAuthorizedWithTokenInput) SetContext(v *ContextDefinition) *IsAuthorizedWithTokenInput { - s.Context = v - return s -} - -// SetEntities sets the Entities field's value. -func (s *IsAuthorizedWithTokenInput) SetEntities(v *EntitiesDefinition) *IsAuthorizedWithTokenInput { - s.Entities = v - return s -} - -// SetIdentityToken sets the IdentityToken field's value. -func (s *IsAuthorizedWithTokenInput) SetIdentityToken(v string) *IsAuthorizedWithTokenInput { - s.IdentityToken = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *IsAuthorizedWithTokenInput) SetPolicyStoreId(v string) *IsAuthorizedWithTokenInput { - s.PolicyStoreId = &v - return s -} - -// SetResource sets the Resource field's value. -func (s *IsAuthorizedWithTokenInput) SetResource(v *EntityIdentifier) *IsAuthorizedWithTokenInput { - s.Resource = v - return s -} - -type IsAuthorizedWithTokenOutput struct { - _ struct{} `type:"structure"` - - // An authorization decision that indicates if the authorization request should - // be allowed or denied. - // - // Decision is a required field - Decision *string `locationName:"decision" type:"string" required:"true" enum:"Decision"` - - // The list of determining policies used to make the authorization decision. - // For example, if there are multiple matching policies, where at least one - // is a forbid policy, then because forbid always overrides permit the forbid - // policies are the determining policies. If all matching policies are permit - // policies, then those policies are the determining policies. When no policies - // match and the response is the default DENY, there are no determining policies. - // - // DeterminingPolicies is a required field - DeterminingPolicies []*DeterminingPolicyItem `locationName:"determiningPolicies" type:"list" required:"true"` - - // Errors that occurred while making an authorization decision. For example, - // a policy references an entity or entity attribute that does not exist in - // the slice. - // - // Errors is a required field - Errors []*EvaluationErrorItem `locationName:"errors" type:"list" 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 IsAuthorizedWithTokenOutput) 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 IsAuthorizedWithTokenOutput) GoString() string { - return s.String() -} - -// SetDecision sets the Decision field's value. -func (s *IsAuthorizedWithTokenOutput) SetDecision(v string) *IsAuthorizedWithTokenOutput { - s.Decision = &v - return s -} - -// SetDeterminingPolicies sets the DeterminingPolicies field's value. -func (s *IsAuthorizedWithTokenOutput) SetDeterminingPolicies(v []*DeterminingPolicyItem) *IsAuthorizedWithTokenOutput { - s.DeterminingPolicies = v - return s -} - -// SetErrors sets the Errors field's value. -func (s *IsAuthorizedWithTokenOutput) SetErrors(v []*EvaluationErrorItem) *IsAuthorizedWithTokenOutput { - s.Errors = v - return s -} - -type ListIdentitySourcesInput struct { - _ struct{} `type:"structure"` - - // Specifies characteristics of an identity source that you can use to limit - // the output to matching identity sources. - Filters []*IdentitySourceFilter `locationName:"filters" type:"list"` - - // Specifies the total number of results that you want included in each response. - // If additional items exist beyond the number you specify, the NextToken response - // element is returned with a value (not null). Include the specified value - // as the NextToken request parameter in the next call to the operation to get - // the next set of results. Note that the service might return fewer results - // than the maximum even when there are more results available. You should check - // NextToken after every operation to ensure that you receive all of the results. - // - // If you do not specify this parameter, the operation defaults to 10 identity - // sources per response. You can specify a maximum of 200 identity sources per - // response. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Specifies that you want to receive the next page of results. Valid only if - // you received a NextToken response in the previous request. If you did, it - // indicates that more output is available. Set this parameter to the value - // provided by the previous call's NextToken response to request the next page - // of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Specifies the ID of the policy store that contains the identity sources that - // you want to list. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 ListIdentitySourcesInput) 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 ListIdentitySourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListIdentitySourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListIdentitySourcesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Filters != nil { - for i, v := range s.Filters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilters sets the Filters field's value. -func (s *ListIdentitySourcesInput) SetFilters(v []*IdentitySourceFilter) *ListIdentitySourcesInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListIdentitySourcesInput) SetMaxResults(v int64) *ListIdentitySourcesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdentitySourcesInput) SetNextToken(v string) *ListIdentitySourcesInput { - s.NextToken = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *ListIdentitySourcesInput) SetPolicyStoreId(v string) *ListIdentitySourcesInput { - s.PolicyStoreId = &v - return s -} - -type ListIdentitySourcesOutput struct { - _ struct{} `type:"structure"` - - // The list of identity sources stored in the specified policy store. - // - // IdentitySources is a required field - IdentitySources []*IdentitySourceItem `locationName:"identitySources" type:"list" required:"true"` - - // If present, this value indicates that more output is available than is included - // in the current response. Use this value in the NextToken request parameter - // in a subsequent call to the operation to get the next part of the output. - // You should repeat this until the NextToken response element comes back as - // null. This indicates that this is the last page of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListIdentitySourcesOutput) 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 ListIdentitySourcesOutput) GoString() string { - return s.String() -} - -// SetIdentitySources sets the IdentitySources field's value. -func (s *ListIdentitySourcesOutput) SetIdentitySources(v []*IdentitySourceItem) *ListIdentitySourcesOutput { - s.IdentitySources = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListIdentitySourcesOutput) SetNextToken(v string) *ListIdentitySourcesOutput { - s.NextToken = &v - return s -} - -type ListPoliciesInput struct { - _ struct{} `type:"structure"` - - // Specifies a filter that limits the response to only policies that match the - // specified criteria. For example, you list only the policies that reference - // a specified principal. - Filter *PolicyFilter `locationName:"filter" type:"structure"` - - // Specifies the total number of results that you want included in each response. - // If additional items exist beyond the number you specify, the NextToken response - // element is returned with a value (not null). Include the specified value - // as the NextToken request parameter in the next call to the operation to get - // the next set of results. Note that the service might return fewer results - // than the maximum even when there are more results available. You should check - // NextToken after every operation to ensure that you receive all of the results. - // - // If you do not specify this parameter, the operation defaults to 10 policies - // per response. You can specify a maximum of 50 policies per response. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Specifies that you want to receive the next page of results. Valid only if - // you received a NextToken response in the previous request. If you did, it - // indicates that more output is available. Set this parameter to the value - // provided by the previous call's NextToken response to request the next page - // of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Specifies the ID of the policy store you want to list policies from. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 ListPoliciesInput) 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 ListPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPoliciesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListPoliciesInput) SetFilter(v *PolicyFilter) *ListPoliciesInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPoliciesInput) SetMaxResults(v int64) *ListPoliciesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPoliciesInput) SetNextToken(v string) *ListPoliciesInput { - s.NextToken = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *ListPoliciesInput) SetPolicyStoreId(v string) *ListPoliciesInput { - s.PolicyStoreId = &v - return s -} - -type ListPoliciesOutput struct { - _ struct{} `type:"structure"` - - // If present, this value indicates that more output is available than is included - // in the current response. Use this value in the NextToken request parameter - // in a subsequent call to the operation to get the next part of the output. - // You should repeat this until the NextToken response element comes back as - // null. This indicates that this is the last page of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Lists all policies that are available in the specified policy store. - // - // Policies is a required field - Policies []*PolicyItem `locationName:"policies" type:"list" 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 ListPoliciesOutput) 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 ListPoliciesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPoliciesOutput) SetNextToken(v string) *ListPoliciesOutput { - s.NextToken = &v - return s -} - -// SetPolicies sets the Policies field's value. -func (s *ListPoliciesOutput) SetPolicies(v []*PolicyItem) *ListPoliciesOutput { - s.Policies = v - return s -} - -type ListPolicyStoresInput struct { - _ struct{} `type:"structure"` - - // Specifies the total number of results that you want included in each response. - // If additional items exist beyond the number you specify, the NextToken response - // element is returned with a value (not null). Include the specified value - // as the NextToken request parameter in the next call to the operation to get - // the next set of results. Note that the service might return fewer results - // than the maximum even when there are more results available. You should check - // NextToken after every operation to ensure that you receive all of the results. - // - // If you do not specify this parameter, the operation defaults to 10 policy - // stores per response. You can specify a maximum of 50 policy stores per response. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Specifies that you want to receive the next page of results. Valid only if - // you received a NextToken response in the previous request. If you did, it - // indicates that more output is available. Set this parameter to the value - // provided by the previous call's NextToken response to request the next page - // of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListPolicyStoresInput) 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 ListPolicyStoresInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPolicyStoresInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPolicyStoresInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPolicyStoresInput) SetMaxResults(v int64) *ListPolicyStoresInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPolicyStoresInput) SetNextToken(v string) *ListPolicyStoresInput { - s.NextToken = &v - return s -} - -type ListPolicyStoresOutput struct { - _ struct{} `type:"structure"` - - // If present, this value indicates that more output is available than is included - // in the current response. Use this value in the NextToken request parameter - // in a subsequent call to the operation to get the next part of the output. - // You should repeat this until the NextToken response element comes back as - // null. This indicates that this is the last page of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The list of policy stores in the account. - // - // PolicyStores is a required field - PolicyStores []*PolicyStoreItem `locationName:"policyStores" type:"list" 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 ListPolicyStoresOutput) 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 ListPolicyStoresOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPolicyStoresOutput) SetNextToken(v string) *ListPolicyStoresOutput { - s.NextToken = &v - return s -} - -// SetPolicyStores sets the PolicyStores field's value. -func (s *ListPolicyStoresOutput) SetPolicyStores(v []*PolicyStoreItem) *ListPolicyStoresOutput { - s.PolicyStores = v - return s -} - -type ListPolicyTemplatesInput struct { - _ struct{} `type:"structure"` - - // Specifies the total number of results that you want included in each response. - // If additional items exist beyond the number you specify, the NextToken response - // element is returned with a value (not null). Include the specified value - // as the NextToken request parameter in the next call to the operation to get - // the next set of results. Note that the service might return fewer results - // than the maximum even when there are more results available. You should check - // NextToken after every operation to ensure that you receive all of the results. - // - // If you do not specify this parameter, the operation defaults to 10 policy - // templates per response. You can specify a maximum of 50 policy templates - // per response. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // Specifies that you want to receive the next page of results. Valid only if - // you received a NextToken response in the previous request. If you did, it - // indicates that more output is available. Set this parameter to the value - // provided by the previous call's NextToken response to request the next page - // of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // Specifies the ID of the policy store that contains the policy templates you - // want to list. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 ListPolicyTemplatesInput) 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 ListPolicyTemplatesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPolicyTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPolicyTemplatesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPolicyTemplatesInput) SetMaxResults(v int64) *ListPolicyTemplatesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPolicyTemplatesInput) SetNextToken(v string) *ListPolicyTemplatesInput { - s.NextToken = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *ListPolicyTemplatesInput) SetPolicyStoreId(v string) *ListPolicyTemplatesInput { - s.PolicyStoreId = &v - return s -} - -type ListPolicyTemplatesOutput struct { - _ struct{} `type:"structure"` - - // If present, this value indicates that more output is available than is included - // in the current response. Use this value in the NextToken request parameter - // in a subsequent call to the operation to get the next part of the output. - // You should repeat this until the NextToken response element comes back as - // null. This indicates that this is the last page of results. - NextToken *string `locationName:"nextToken" min:"1" type:"string"` - - // The list of the policy templates in the specified policy store. - // - // PolicyTemplates is a required field - PolicyTemplates []*PolicyTemplateItem `locationName:"policyTemplates" type:"list" 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 ListPolicyTemplatesOutput) 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 ListPolicyTemplatesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPolicyTemplatesOutput) SetNextToken(v string) *ListPolicyTemplatesOutput { - s.NextToken = &v - return s -} - -// SetPolicyTemplates sets the PolicyTemplates field's value. -func (s *ListPolicyTemplatesOutput) SetPolicyTemplates(v []*PolicyTemplateItem) *ListPolicyTemplatesOutput { - s.PolicyTemplates = v - return s -} - -// A structure that contains the details for a Cedar policy definition. It includes -// the policy type, a description, and a policy body. This is a top level data -// type used to create a policy. -// -// This data type is used as a request parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) -// operation. This structure must always have either an static or a templateLinked -// element. -type PolicyDefinition struct { - _ struct{} `type:"structure"` - - // A structure that describes a static policy. An static policy doesn't use - // a template or allow placeholders for entities. - Static *StaticPolicyDefinition `locationName:"static" type:"structure"` - - // A structure that describes a policy that was instantiated from a template. - // The template can specify placeholders for principal and resource. When you - // use CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) - // to create a policy from a template, you specify the exact principal and resource - // to use for the instantiated policy. - TemplateLinked *TemplateLinkedPolicyDefinition `locationName:"templateLinked" 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 PolicyDefinition) 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 PolicyDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PolicyDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PolicyDefinition"} - if s.Static != nil { - if err := s.Static.Validate(); err != nil { - invalidParams.AddNested("Static", err.(request.ErrInvalidParams)) - } - } - if s.TemplateLinked != nil { - if err := s.TemplateLinked.Validate(); err != nil { - invalidParams.AddNested("TemplateLinked", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatic sets the Static field's value. -func (s *PolicyDefinition) SetStatic(v *StaticPolicyDefinition) *PolicyDefinition { - s.Static = v - return s -} - -// SetTemplateLinked sets the TemplateLinked field's value. -func (s *PolicyDefinition) SetTemplateLinked(v *TemplateLinkedPolicyDefinition) *PolicyDefinition { - s.TemplateLinked = v - return s -} - -// A structure that describes a policy definition. It must always have either -// an static or a templateLinked element. -// -// This data type is used as a response parameter for the GetPolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_GetPolicy.html) -// operation. -type PolicyDefinitionDetail struct { - _ struct{} `type:"structure"` - - // Information about a static policy that wasn't created with a policy template. - Static *StaticPolicyDefinitionDetail `locationName:"static" type:"structure"` - - // Information about a template-linked policy that was created by instantiating - // a policy template. - TemplateLinked *TemplateLinkedPolicyDefinitionDetail `locationName:"templateLinked" 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 PolicyDefinitionDetail) 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 PolicyDefinitionDetail) GoString() string { - return s.String() -} - -// SetStatic sets the Static field's value. -func (s *PolicyDefinitionDetail) SetStatic(v *StaticPolicyDefinitionDetail) *PolicyDefinitionDetail { - s.Static = v - return s -} - -// SetTemplateLinked sets the TemplateLinked field's value. -func (s *PolicyDefinitionDetail) SetTemplateLinked(v *TemplateLinkedPolicyDefinitionDetail) *PolicyDefinitionDetail { - s.TemplateLinked = v - return s -} - -// A structure that describes a PolicyDefinintion (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinintion.html). -// It will always have either an StaticPolicy or a TemplateLinkedPolicy element. -// -// This data type is used as a response parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) -// and ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) -// operations. -type PolicyDefinitionItem struct { - _ struct{} `type:"structure"` - - // Information about a static policy that wasn't created with a policy template. - Static *StaticPolicyDefinitionItem `locationName:"static" type:"structure"` - - // Information about a template-linked policy that was created by instantiating - // a policy template. - TemplateLinked *TemplateLinkedPolicyDefinitionItem `locationName:"templateLinked" 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 PolicyDefinitionItem) 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 PolicyDefinitionItem) GoString() string { - return s.String() -} - -// SetStatic sets the Static field's value. -func (s *PolicyDefinitionItem) SetStatic(v *StaticPolicyDefinitionItem) *PolicyDefinitionItem { - s.Static = v - return s -} - -// SetTemplateLinked sets the TemplateLinked field's value. -func (s *PolicyDefinitionItem) SetTemplateLinked(v *TemplateLinkedPolicyDefinitionItem) *PolicyDefinitionItem { - s.TemplateLinked = v - return s -} - -// Contains information about a filter to refine policies returned in a query. -// -// This data type is used as a response parameter for the ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) -// operation. -type PolicyFilter struct { - _ struct{} `type:"structure"` - - // Filters the output to only template-linked policies that were instantiated - // from the specified policy template. - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" type:"string"` - - // Filters the output to only policies of the specified type. - PolicyType *string `locationName:"policyType" type:"string" enum:"PolicyType"` - - // Filters the output to only policies that reference the specified principal. - Principal *EntityReference `locationName:"principal" type:"structure"` - - // Filters the output to only policies that reference the specified resource. - Resource *EntityReference `locationName:"resource" 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 PolicyFilter) 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 PolicyFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PolicyFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PolicyFilter"} - if s.PolicyTemplateId != nil && len(*s.PolicyTemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyTemplateId", 1)) - } - if s.Principal != nil { - if err := s.Principal.Validate(); err != nil { - invalidParams.AddNested("Principal", err.(request.ErrInvalidParams)) - } - } - if s.Resource != nil { - if err := s.Resource.Validate(); err != nil { - invalidParams.AddNested("Resource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *PolicyFilter) SetPolicyTemplateId(v string) *PolicyFilter { - s.PolicyTemplateId = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *PolicyFilter) SetPolicyType(v string) *PolicyFilter { - s.PolicyType = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *PolicyFilter) SetPrincipal(v *EntityReference) *PolicyFilter { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *PolicyFilter) SetResource(v *EntityReference) *PolicyFilter { - s.Resource = v - return s -} - -// Contains information about a policy. -// -// This data type is used as a response parameter for the ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html) -// operation. -type PolicyItem struct { - _ struct{} `type:"structure"` - - // The date and time the policy was created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The policy definition of an item in the list of policies returned. - // - // Definition is a required field - Definition *PolicyDefinitionItem `locationName:"definition" type:"structure" required:"true"` - - // The date and time the policy was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The identifier of the policy you want information about. - // - // PolicyId is a required field - PolicyId *string `locationName:"policyId" min:"1" type:"string" required:"true"` - - // The identifier of the PolicyStore where the policy you want information about - // is stored. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The type of the policy. This is one of the following values: - // - // * static - // - // * templateLinked - // - // PolicyType is a required field - PolicyType *string `locationName:"policyType" type:"string" required:"true" enum:"PolicyType"` - - // The principal associated with the policy. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // The resource associated with the policy. - Resource *EntityIdentifier `locationName:"resource" 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 PolicyItem) 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 PolicyItem) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *PolicyItem) SetCreatedDate(v time.Time) *PolicyItem { - s.CreatedDate = &v - return s -} - -// SetDefinition sets the Definition field's value. -func (s *PolicyItem) SetDefinition(v *PolicyDefinitionItem) *PolicyItem { - s.Definition = v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *PolicyItem) SetLastUpdatedDate(v time.Time) *PolicyItem { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *PolicyItem) SetPolicyId(v string) *PolicyItem { - s.PolicyId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *PolicyItem) SetPolicyStoreId(v string) *PolicyItem { - s.PolicyStoreId = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *PolicyItem) SetPolicyType(v string) *PolicyItem { - s.PolicyType = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *PolicyItem) SetPrincipal(v *EntityIdentifier) *PolicyItem { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *PolicyItem) SetResource(v *EntityIdentifier) *PolicyItem { - s.Resource = v - return s -} - -// Contains information about a policy store. -// -// This data type is used as a response parameter for the ListPolicyStores (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicyStores.html) -// operation. -type PolicyStoreItem struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the policy store. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The date and time the policy was created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The unique identifier of the policy store. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 PolicyStoreItem) 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 PolicyStoreItem) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *PolicyStoreItem) SetArn(v string) *PolicyStoreItem { - s.Arn = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *PolicyStoreItem) SetCreatedDate(v time.Time) *PolicyStoreItem { - s.CreatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *PolicyStoreItem) SetPolicyStoreId(v string) *PolicyStoreItem { - s.PolicyStoreId = &v - return s -} - -// Contains details about a policy template -// -// This data type is used as a response parameter for the ListPolicyTemplates -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicyTemplates.html) -// operation. -type PolicyTemplateItem struct { - _ struct{} `type:"structure"` - - // The date and time that the policy template was created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The description attached to the policy template. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PolicyTemplateItem's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The date and time that the policy template was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The unique identifier of the policy store that contains the template. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The unique identifier of the policy template. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" 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 PolicyTemplateItem) 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 PolicyTemplateItem) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *PolicyTemplateItem) SetCreatedDate(v time.Time) *PolicyTemplateItem { - s.CreatedDate = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *PolicyTemplateItem) SetDescription(v string) *PolicyTemplateItem { - s.Description = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *PolicyTemplateItem) SetLastUpdatedDate(v time.Time) *PolicyTemplateItem { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *PolicyTemplateItem) SetPolicyStoreId(v string) *PolicyTemplateItem { - s.PolicyStoreId = &v - return s -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *PolicyTemplateItem) SetPolicyTemplateId(v string) *PolicyTemplateItem { - s.PolicyTemplateId = &v - return s -} - -type PutSchemaInput struct { - _ struct{} `type:"structure"` - - // Specifies the definition of the schema to be stored. The schema definition - // must be written in Cedar schema JSON. - // - // Definition is a required field - Definition *SchemaDefinition `locationName:"definition" type:"structure" required:"true"` - - // Specifies the ID of the policy store in which to place the schema. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 PutSchemaInput) 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 PutSchemaInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutSchemaInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutSchemaInput"} - if s.Definition == nil { - invalidParams.Add(request.NewErrParamRequired("Definition")) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Definition != nil { - if err := s.Definition.Validate(); err != nil { - invalidParams.AddNested("Definition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefinition sets the Definition field's value. -func (s *PutSchemaInput) SetDefinition(v *SchemaDefinition) *PutSchemaInput { - s.Definition = v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *PutSchemaInput) SetPolicyStoreId(v string) *PutSchemaInput { - s.PolicyStoreId = &v - return s -} - -type PutSchemaOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the schema was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time that the schema was last updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // Identifies the namespaces of the entities referenced by this schema. - // - // Namespaces is a required field - Namespaces []*string `locationName:"namespaces" type:"list" required:"true"` - - // The unique ID of the policy store that contains the schema. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 PutSchemaOutput) 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 PutSchemaOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *PutSchemaOutput) SetCreatedDate(v time.Time) *PutSchemaOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *PutSchemaOutput) SetLastUpdatedDate(v time.Time) *PutSchemaOutput { - s.LastUpdatedDate = &v - return s -} - -// SetNamespaces sets the Namespaces field's value. -func (s *PutSchemaOutput) SetNamespaces(v []*string) *PutSchemaOutput { - s.Namespaces = v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *PutSchemaOutput) SetPolicyStoreId(v string) *PutSchemaOutput { - s.PolicyStoreId = &v - return s -} - -// Contains information about a resource conflict. -type ResourceConflict struct { - _ struct{} `type:"structure"` - - // The unique identifier of the resource involved in a conflict. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The type of the resource involved in a conflict. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` -} - -// 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 ResourceConflict) 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 ResourceConflict) GoString() string { - return s.String() -} - -// SetResourceId sets the ResourceId field's value. -func (s *ResourceConflict) SetResourceId(v string) *ResourceConflict { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *ResourceConflict) SetResourceType(v string) *ResourceConflict { - s.ResourceType = &v - return s -} - -// The request failed because it references a resource that doesn't exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The unique ID of the resource referenced in the failed request. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resource type of the resource referenced in the failed request. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` -} - -// 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains a list of principal types, resource types, and actions that can -// be specified in policies stored in the same policy store. If the validation -// mode for the policy store is set to STRICT, then policies that can't be validated -// by this schema are rejected by Verified Permissions and can't be stored in -// the policy store. -type SchemaDefinition struct { - _ struct{} `type:"structure"` - - // A JSON string representation of the schema supported by applications that - // use this policy store. For more information, see Policy store schema (https://docs.aws.amazon.com/verifiedpermissions/latest/userguide/schema.html) - // in the Amazon Verified Permissions User Guide. - // - // CedarJson is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SchemaDefinition's - // String and GoString methods. - CedarJson *string `locationName:"cedarJson" min:"1" type:"string" sensitive:"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 SchemaDefinition) 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 SchemaDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SchemaDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SchemaDefinition"} - if s.CedarJson != nil && len(*s.CedarJson) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CedarJson", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCedarJson sets the CedarJson field's value. -func (s *SchemaDefinition) SetCedarJson(v string) *SchemaDefinition { - s.CedarJson = &v - return s -} - -// The request failed because it would cause a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The quota code recognized by the Amazon Web Services Service Quotas service. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The unique ID of the resource referenced in the failed request. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The resource type of the resource referenced in the failed request. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` - - // The code for the Amazon Web Service that owns the quota. - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about a static policy. -// -// This data type is used as a field that is part of the PolicyDefinitionDetail -// (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinitionDetail.html) -// type. -type StaticPolicyDefinition struct { - _ struct{} `type:"structure"` - - // The description of the static policy. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StaticPolicyDefinition's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The policy content of the static policy, written in the Cedar policy language. - // - // Statement is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StaticPolicyDefinition's - // String and GoString methods. - // - // Statement is a required field - Statement *string `locationName:"statement" min:"1" type:"string" required:"true" sensitive:"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 StaticPolicyDefinition) 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 StaticPolicyDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StaticPolicyDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StaticPolicyDefinition"} - if s.Statement == nil { - invalidParams.Add(request.NewErrParamRequired("Statement")) - } - if s.Statement != nil && len(*s.Statement) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Statement", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *StaticPolicyDefinition) SetDescription(v string) *StaticPolicyDefinition { - s.Description = &v - return s -} - -// SetStatement sets the Statement field's value. -func (s *StaticPolicyDefinition) SetStatement(v string) *StaticPolicyDefinition { - s.Statement = &v - return s -} - -// A structure that contains details about a static policy. It includes the -// description and policy body. -// -// This data type is used within a PolicyDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinition.html) -// structure as part of a request parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) -// operation. -type StaticPolicyDefinitionDetail struct { - _ struct{} `type:"structure"` - - // A description of the static policy. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StaticPolicyDefinitionDetail's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // The content of the static policy written in the Cedar policy language. - // - // Statement is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StaticPolicyDefinitionDetail's - // String and GoString methods. - // - // Statement is a required field - Statement *string `locationName:"statement" min:"1" type:"string" required:"true" sensitive:"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 StaticPolicyDefinitionDetail) 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 StaticPolicyDefinitionDetail) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *StaticPolicyDefinitionDetail) SetDescription(v string) *StaticPolicyDefinitionDetail { - s.Description = &v - return s -} - -// SetStatement sets the Statement field's value. -func (s *StaticPolicyDefinitionDetail) SetStatement(v string) *StaticPolicyDefinitionDetail { - s.Statement = &v - return s -} - -// A structure that contains details about a static policy. It includes the -// description and policy statement. -// -// This data type is used within a PolicyDefinition (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_PolicyDefinition.html) -// structure as part of a request parameter for the CreatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicy.html) -// operation. -type StaticPolicyDefinitionItem struct { - _ struct{} `type:"structure"` - - // A description of the static policy. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by StaticPolicyDefinitionItem's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"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 StaticPolicyDefinitionItem) 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 StaticPolicyDefinitionItem) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *StaticPolicyDefinitionItem) SetDescription(v string) *StaticPolicyDefinitionItem { - s.Description = &v - return s -} - -// Contains information about a policy created by instantiating a policy template. -type TemplateLinkedPolicyDefinition struct { - _ struct{} `type:"structure"` - - // The unique identifier of the policy template used to create this policy. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" type:"string" required:"true"` - - // The principal associated with this template-linked policy. Verified Permissions - // substitutes this principal for the ?principal placeholder in the policy template - // when it evaluates an authorization request. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // The resource associated with this template-linked policy. Verified Permissions - // substitutes this resource for the ?resource placeholder in the policy template - // when it evaluates an authorization request. - Resource *EntityIdentifier `locationName:"resource" 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 TemplateLinkedPolicyDefinition) 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 TemplateLinkedPolicyDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TemplateLinkedPolicyDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TemplateLinkedPolicyDefinition"} - if s.PolicyTemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyTemplateId")) - } - if s.PolicyTemplateId != nil && len(*s.PolicyTemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyTemplateId", 1)) - } - if s.Principal != nil { - if err := s.Principal.Validate(); err != nil { - invalidParams.AddNested("Principal", err.(request.ErrInvalidParams)) - } - } - if s.Resource != nil { - if err := s.Resource.Validate(); err != nil { - invalidParams.AddNested("Resource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *TemplateLinkedPolicyDefinition) SetPolicyTemplateId(v string) *TemplateLinkedPolicyDefinition { - s.PolicyTemplateId = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *TemplateLinkedPolicyDefinition) SetPrincipal(v *EntityIdentifier) *TemplateLinkedPolicyDefinition { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *TemplateLinkedPolicyDefinition) SetResource(v *EntityIdentifier) *TemplateLinkedPolicyDefinition { - s.Resource = v - return s -} - -// Contains information about a policy that was -// -// created by instantiating a policy template. -// -// This -type TemplateLinkedPolicyDefinitionDetail struct { - _ struct{} `type:"structure"` - - // The unique identifier of the policy template used to create this policy. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" type:"string" required:"true"` - - // The principal associated with this template-linked policy. Verified Permissions - // substitutes this principal for the ?principal placeholder in the policy template - // when it evaluates an authorization request. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // The resource associated with this template-linked policy. Verified Permissions - // substitutes this resource for the ?resource placeholder in the policy template - // when it evaluates an authorization request. - Resource *EntityIdentifier `locationName:"resource" 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 TemplateLinkedPolicyDefinitionDetail) 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 TemplateLinkedPolicyDefinitionDetail) GoString() string { - return s.String() -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *TemplateLinkedPolicyDefinitionDetail) SetPolicyTemplateId(v string) *TemplateLinkedPolicyDefinitionDetail { - s.PolicyTemplateId = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *TemplateLinkedPolicyDefinitionDetail) SetPrincipal(v *EntityIdentifier) *TemplateLinkedPolicyDefinitionDetail { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *TemplateLinkedPolicyDefinitionDetail) SetResource(v *EntityIdentifier) *TemplateLinkedPolicyDefinitionDetail { - s.Resource = v - return s -} - -// Contains information about a policy created by instantiating a policy template. -// -// This -type TemplateLinkedPolicyDefinitionItem struct { - _ struct{} `type:"structure"` - - // The unique identifier of the policy template used to create this policy. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" type:"string" required:"true"` - - // The principal associated with this template-linked policy. Verified Permissions - // substitutes this principal for the ?principal placeholder in the policy template - // when it evaluates an authorization request. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // The resource associated with this template-linked policy. Verified Permissions - // substitutes this resource for the ?resource placeholder in the policy template - // when it evaluates an authorization request. - Resource *EntityIdentifier `locationName:"resource" 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 TemplateLinkedPolicyDefinitionItem) 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 TemplateLinkedPolicyDefinitionItem) GoString() string { - return s.String() -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *TemplateLinkedPolicyDefinitionItem) SetPolicyTemplateId(v string) *TemplateLinkedPolicyDefinitionItem { - s.PolicyTemplateId = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *TemplateLinkedPolicyDefinitionItem) SetPrincipal(v *EntityIdentifier) *TemplateLinkedPolicyDefinitionItem { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *TemplateLinkedPolicyDefinitionItem) SetResource(v *EntityIdentifier) *TemplateLinkedPolicyDefinitionItem { - s.Resource = v - return s -} - -// The request failed because it exceeded a throttling quota. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The quota code recognized by the Amazon Web Services Service Quotas service. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The code for the Amazon Web Service that owns the quota. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains configuration details of a Amazon Cognito user pool for use with -// an identity source. -type UpdateCognitoUserPoolConfiguration struct { - _ struct{} `type:"structure"` - - // The client ID of an app client that is configured for the specified Amazon - // Cognito user pool. - ClientIds []*string `locationName:"clientIds" type:"list"` - - // The Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the Amazon Cognito user pool associated with this identity source. - // - // UserPoolArn is a required field - UserPoolArn *string `locationName:"userPoolArn" min:"1" 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 UpdateCognitoUserPoolConfiguration) 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 UpdateCognitoUserPoolConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCognitoUserPoolConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCognitoUserPoolConfiguration"} - if s.UserPoolArn == nil { - invalidParams.Add(request.NewErrParamRequired("UserPoolArn")) - } - if s.UserPoolArn != nil && len(*s.UserPoolArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserPoolArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientIds sets the ClientIds field's value. -func (s *UpdateCognitoUserPoolConfiguration) SetClientIds(v []*string) *UpdateCognitoUserPoolConfiguration { - s.ClientIds = v - return s -} - -// SetUserPoolArn sets the UserPoolArn field's value. -func (s *UpdateCognitoUserPoolConfiguration) SetUserPoolArn(v string) *UpdateCognitoUserPoolConfiguration { - s.UserPoolArn = &v - return s -} - -// Contains an updated configuration to replace the configuration in an existing -// identity source. -// -// At this time, the only valid member of this structure is a Amazon Cognito -// user pool configuration. -// -// You must specify a userPoolArn, and optionally, a ClientId. -type UpdateConfiguration struct { - _ struct{} `type:"structure"` - - // Contains configuration details of a Amazon Cognito user pool. - CognitoUserPoolConfiguration *UpdateCognitoUserPoolConfiguration `locationName:"cognitoUserPoolConfiguration" 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 UpdateConfiguration) 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 UpdateConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateConfiguration"} - if s.CognitoUserPoolConfiguration != nil { - if err := s.CognitoUserPoolConfiguration.Validate(); err != nil { - invalidParams.AddNested("CognitoUserPoolConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCognitoUserPoolConfiguration sets the CognitoUserPoolConfiguration field's value. -func (s *UpdateConfiguration) SetCognitoUserPoolConfiguration(v *UpdateCognitoUserPoolConfiguration) *UpdateConfiguration { - s.CognitoUserPoolConfiguration = v - return s -} - -type UpdateIdentitySourceInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the identity source that you want to update. - // - // IdentitySourceId is a required field - IdentitySourceId *string `locationName:"identitySourceId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy store that contains the identity source that - // you want to update. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // Specifies the data type of principals generated for identities authenticated - // by the identity source. - // - // PrincipalEntityType is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateIdentitySourceInput's - // String and GoString methods. - PrincipalEntityType *string `locationName:"principalEntityType" min:"1" type:"string" sensitive:"true"` - - // Specifies the details required to communicate with the identity provider - // (IdP) associated with this identity source. - // - // At this time, the only valid member of this structure is a Amazon Cognito - // user pool configuration. - // - // You must specify a userPoolArn, and optionally, a ClientId. - // - // UpdateConfiguration is a required field - UpdateConfiguration *UpdateConfiguration `locationName:"updateConfiguration" type:"structure" 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 UpdateIdentitySourceInput) 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 UpdateIdentitySourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateIdentitySourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateIdentitySourceInput"} - if s.IdentitySourceId == nil { - invalidParams.Add(request.NewErrParamRequired("IdentitySourceId")) - } - if s.IdentitySourceId != nil && len(*s.IdentitySourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IdentitySourceId", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.PrincipalEntityType != nil && len(*s.PrincipalEntityType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PrincipalEntityType", 1)) - } - if s.UpdateConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("UpdateConfiguration")) - } - if s.UpdateConfiguration != nil { - if err := s.UpdateConfiguration.Validate(); err != nil { - invalidParams.AddNested("UpdateConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetIdentitySourceId sets the IdentitySourceId field's value. -func (s *UpdateIdentitySourceInput) SetIdentitySourceId(v string) *UpdateIdentitySourceInput { - s.IdentitySourceId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *UpdateIdentitySourceInput) SetPolicyStoreId(v string) *UpdateIdentitySourceInput { - s.PolicyStoreId = &v - return s -} - -// SetPrincipalEntityType sets the PrincipalEntityType field's value. -func (s *UpdateIdentitySourceInput) SetPrincipalEntityType(v string) *UpdateIdentitySourceInput { - s.PrincipalEntityType = &v - return s -} - -// SetUpdateConfiguration sets the UpdateConfiguration field's value. -func (s *UpdateIdentitySourceInput) SetUpdateConfiguration(v *UpdateConfiguration) *UpdateIdentitySourceInput { - s.UpdateConfiguration = v - return s -} - -type UpdateIdentitySourceOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the updated identity source was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the updated identity source. - // - // IdentitySourceId is a required field - IdentitySourceId *string `locationName:"identitySourceId" min:"1" type:"string" required:"true"` - - // The date and time that the identity source was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy store that contains the updated identity source. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 UpdateIdentitySourceOutput) 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 UpdateIdentitySourceOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *UpdateIdentitySourceOutput) SetCreatedDate(v time.Time) *UpdateIdentitySourceOutput { - s.CreatedDate = &v - return s -} - -// SetIdentitySourceId sets the IdentitySourceId field's value. -func (s *UpdateIdentitySourceOutput) SetIdentitySourceId(v string) *UpdateIdentitySourceOutput { - s.IdentitySourceId = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *UpdateIdentitySourceOutput) SetLastUpdatedDate(v time.Time) *UpdateIdentitySourceOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *UpdateIdentitySourceOutput) SetPolicyStoreId(v string) *UpdateIdentitySourceOutput { - s.PolicyStoreId = &v - return s -} - -// Contains information about updates to be applied to a policy. -// -// This data type is used as a request parameter in the UpdatePolicy (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicy.html) -// operation. -type UpdatePolicyDefinition struct { - _ struct{} `type:"structure"` - - // Contains details about the updates to be applied to a static policy. - Static *UpdateStaticPolicyDefinition `locationName:"static" 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 UpdatePolicyDefinition) 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 UpdatePolicyDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePolicyDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePolicyDefinition"} - if s.Static != nil { - if err := s.Static.Validate(); err != nil { - invalidParams.AddNested("Static", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatic sets the Static field's value. -func (s *UpdatePolicyDefinition) SetStatic(v *UpdateStaticPolicyDefinition) *UpdatePolicyDefinition { - s.Static = v - return s -} - -type UpdatePolicyInput struct { - _ struct{} `type:"structure"` - - // Specifies the updated policy content that you want to replace on the specified - // policy. The content must be valid Cedar policy language text. - // - // You can change only the following elements from the policy definition: - // - // * The action referenced by the policy. - // - // * Any conditional clauses, such as when or unless clauses. - // - // You can't change the following elements: - // - // * Changing from static to templateLinked. - // - // * Changing the effect of the policy from permit or forbid. - // - // * The principal referenced by the policy. - // - // * The resource referenced by the policy. - // - // Definition is a required field - Definition *UpdatePolicyDefinition `locationName:"definition" type:"structure" required:"true"` - - // Specifies the ID of the policy that you want to update. To find this value, - // you can use ListPolicies (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_ListPolicies.html). - // - // PolicyId is a required field - PolicyId *string `locationName:"policyId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy store that contains the policy that you want - // to update. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 UpdatePolicyInput) 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 UpdatePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePolicyInput"} - if s.Definition == nil { - invalidParams.Add(request.NewErrParamRequired("Definition")) - } - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - if s.PolicyId != nil && len(*s.PolicyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1)) - } - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.Definition != nil { - if err := s.Definition.Validate(); err != nil { - invalidParams.AddNested("Definition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefinition sets the Definition field's value. -func (s *UpdatePolicyInput) SetDefinition(v *UpdatePolicyDefinition) *UpdatePolicyInput { - s.Definition = v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *UpdatePolicyInput) SetPolicyId(v string) *UpdatePolicyInput { - s.PolicyId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *UpdatePolicyInput) SetPolicyStoreId(v string) *UpdatePolicyInput { - s.PolicyStoreId = &v - return s -} - -type UpdatePolicyOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the policy was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time that the policy was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy that was updated. - // - // PolicyId is a required field - PolicyId *string `locationName:"policyId" min:"1" type:"string" required:"true"` - - // The ID of the policy store that contains the policy that was updated. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The type of the policy that was updated. - // - // PolicyType is a required field - PolicyType *string `locationName:"policyType" type:"string" required:"true" enum:"PolicyType"` - - // The principal specified in the policy's scope. This element isn't included - // in the response when Principal isn't present in the policy content. - Principal *EntityIdentifier `locationName:"principal" type:"structure"` - - // The resource specified in the policy's scope. This element isn't included - // in the response when Resource isn't present in the policy content. - Resource *EntityIdentifier `locationName:"resource" 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 UpdatePolicyOutput) 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 UpdatePolicyOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *UpdatePolicyOutput) SetCreatedDate(v time.Time) *UpdatePolicyOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *UpdatePolicyOutput) SetLastUpdatedDate(v time.Time) *UpdatePolicyOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *UpdatePolicyOutput) SetPolicyId(v string) *UpdatePolicyOutput { - s.PolicyId = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *UpdatePolicyOutput) SetPolicyStoreId(v string) *UpdatePolicyOutput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *UpdatePolicyOutput) SetPolicyType(v string) *UpdatePolicyOutput { - s.PolicyType = &v - return s -} - -// SetPrincipal sets the Principal field's value. -func (s *UpdatePolicyOutput) SetPrincipal(v *EntityIdentifier) *UpdatePolicyOutput { - s.Principal = v - return s -} - -// SetResource sets the Resource field's value. -func (s *UpdatePolicyOutput) SetResource(v *EntityIdentifier) *UpdatePolicyOutput { - s.Resource = v - return s -} - -type UpdatePolicyStoreInput struct { - _ struct{} `type:"structure"` - - // Specifies the ID of the policy store that you want to update - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // A structure that defines the validation settings that want to enable for - // the policy store. - // - // ValidationSettings is a required field - ValidationSettings *ValidationSettings `locationName:"validationSettings" type:"structure" 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 UpdatePolicyStoreInput) 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 UpdatePolicyStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePolicyStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePolicyStoreInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.ValidationSettings == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationSettings")) - } - if s.ValidationSettings != nil { - if err := s.ValidationSettings.Validate(); err != nil { - invalidParams.AddNested("ValidationSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *UpdatePolicyStoreInput) SetPolicyStoreId(v string) *UpdatePolicyStoreInput { - s.PolicyStoreId = &v - return s -} - -// SetValidationSettings sets the ValidationSettings field's value. -func (s *UpdatePolicyStoreInput) SetValidationSettings(v *ValidationSettings) *UpdatePolicyStoreInput { - s.ValidationSettings = v - return s -} - -type UpdatePolicyStoreOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // of the updated policy store. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` - - // The date and time that the policy store was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time that the policy store was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the updated policy store. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" 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 UpdatePolicyStoreOutput) 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 UpdatePolicyStoreOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdatePolicyStoreOutput) SetArn(v string) *UpdatePolicyStoreOutput { - s.Arn = &v - return s -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *UpdatePolicyStoreOutput) SetCreatedDate(v time.Time) *UpdatePolicyStoreOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *UpdatePolicyStoreOutput) SetLastUpdatedDate(v time.Time) *UpdatePolicyStoreOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *UpdatePolicyStoreOutput) SetPolicyStoreId(v string) *UpdatePolicyStoreOutput { - s.PolicyStoreId = &v - return s -} - -type UpdatePolicyTemplateInput struct { - _ struct{} `type:"structure"` - - // Specifies a new description to apply to the policy template. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePolicyTemplateInput's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // Specifies the ID of the policy store that contains the policy template that - // you want to update. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // Specifies the ID of the policy template that you want to update. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" type:"string" required:"true"` - - // Specifies new statement content written in Cedar policy language to replace - // the current body of the policy template. - // - // You can change only the following elements of the policy body: - // - // * The action referenced by the policy template. - // - // * Any conditional clauses, such as when or unless clauses. - // - // You can't change the following elements: - // - // * The effect (permit or forbid) of the policy template. - // - // * The principal referenced by the policy template. - // - // * The resource referenced by the policy template. - // - // Statement is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdatePolicyTemplateInput's - // String and GoString methods. - // - // Statement is a required field - Statement *string `locationName:"statement" min:"1" type:"string" required:"true" sensitive:"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 UpdatePolicyTemplateInput) 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 UpdatePolicyTemplateInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePolicyTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePolicyTemplateInput"} - if s.PolicyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyStoreId")) - } - if s.PolicyStoreId != nil && len(*s.PolicyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyStoreId", 1)) - } - if s.PolicyTemplateId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyTemplateId")) - } - if s.PolicyTemplateId != nil && len(*s.PolicyTemplateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PolicyTemplateId", 1)) - } - if s.Statement == nil { - invalidParams.Add(request.NewErrParamRequired("Statement")) - } - if s.Statement != nil && len(*s.Statement) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Statement", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdatePolicyTemplateInput) SetDescription(v string) *UpdatePolicyTemplateInput { - s.Description = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *UpdatePolicyTemplateInput) SetPolicyStoreId(v string) *UpdatePolicyTemplateInput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *UpdatePolicyTemplateInput) SetPolicyTemplateId(v string) *UpdatePolicyTemplateInput { - s.PolicyTemplateId = &v - return s -} - -// SetStatement sets the Statement field's value. -func (s *UpdatePolicyTemplateInput) SetStatement(v string) *UpdatePolicyTemplateInput { - s.Statement = &v - return s -} - -type UpdatePolicyTemplateOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the policy template was originally created. - // - // CreatedDate is a required field - CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The date and time that the policy template was most recently updated. - // - // LastUpdatedDate is a required field - LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The ID of the policy store that contains the updated policy template. - // - // PolicyStoreId is a required field - PolicyStoreId *string `locationName:"policyStoreId" min:"1" type:"string" required:"true"` - - // The ID of the updated policy template. - // - // PolicyTemplateId is a required field - PolicyTemplateId *string `locationName:"policyTemplateId" min:"1" 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 UpdatePolicyTemplateOutput) 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 UpdatePolicyTemplateOutput) GoString() string { - return s.String() -} - -// SetCreatedDate sets the CreatedDate field's value. -func (s *UpdatePolicyTemplateOutput) SetCreatedDate(v time.Time) *UpdatePolicyTemplateOutput { - s.CreatedDate = &v - return s -} - -// SetLastUpdatedDate sets the LastUpdatedDate field's value. -func (s *UpdatePolicyTemplateOutput) SetLastUpdatedDate(v time.Time) *UpdatePolicyTemplateOutput { - s.LastUpdatedDate = &v - return s -} - -// SetPolicyStoreId sets the PolicyStoreId field's value. -func (s *UpdatePolicyTemplateOutput) SetPolicyStoreId(v string) *UpdatePolicyTemplateOutput { - s.PolicyStoreId = &v - return s -} - -// SetPolicyTemplateId sets the PolicyTemplateId field's value. -func (s *UpdatePolicyTemplateOutput) SetPolicyTemplateId(v string) *UpdatePolicyTemplateOutput { - s.PolicyTemplateId = &v - return s -} - -// Contains information about an update to a static policy. -type UpdateStaticPolicyDefinition struct { - _ struct{} `type:"structure"` - - // Specifies the description to be added to or replaced on the static policy. - // - // Description is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateStaticPolicyDefinition's - // String and GoString methods. - Description *string `locationName:"description" type:"string" sensitive:"true"` - - // Specifies the Cedar policy language text to be added to or replaced on the - // static policy. - // - // You can change only the following elements from the original content: - // - // * The action referenced by the policy. - // - // * Any conditional clauses, such as when or unless clauses. - // - // You can't change the following elements: - // - // * Changing from StaticPolicy to TemplateLinkedPolicy. - // - // * The effect (permit or forbid) of the policy. - // - // * The principal referenced by the policy. - // - // * The resource referenced by the policy. - // - // Statement is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateStaticPolicyDefinition's - // String and GoString methods. - // - // Statement is a required field - Statement *string `locationName:"statement" min:"1" type:"string" required:"true" sensitive:"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 UpdateStaticPolicyDefinition) 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 UpdateStaticPolicyDefinition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateStaticPolicyDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateStaticPolicyDefinition"} - if s.Statement == nil { - invalidParams.Add(request.NewErrParamRequired("Statement")) - } - if s.Statement != nil && len(*s.Statement) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Statement", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *UpdateStaticPolicyDefinition) SetDescription(v string) *UpdateStaticPolicyDefinition { - s.Description = &v - return s -} - -// SetStatement sets the Statement field's value. -func (s *UpdateStaticPolicyDefinition) SetStatement(v string) *UpdateStaticPolicyDefinition { - s.Statement = &v - return s -} - -// The request failed because one or more input parameters don't satisfy their -// constraint requirements. The output is provided as a list of fields and a -// reason for each field that isn't valid. -// -// The possible reasons include the following: -// -// - UnrecognizedEntityType The policy includes an entity type that isn't -// found in the schema. -// -// - UnrecognizedActionId The policy includes an action id that isn't found -// in the schema. -// -// - InvalidActionApplication The policy includes an action that, according -// to the schema, doesn't support the specified principal and resource. -// -// - UnexpectedType The policy included an operand that isn't a valid type -// for the specified operation. -// -// - IncompatibleTypes The types of elements included in a set, or the types -// of expressions used in an if...then...else clause aren't compatible in -// this context. -// -// - MissingAttribute The policy attempts to access a record or entity attribute -// that isn't specified in the schema. Test for the existence of the attribute -// first before attempting to access its value. For more information, see -// the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - UnsafeOptionalAttributeAccess The policy attempts to access a record -// or entity attribute that is optional and isn't guaranteed to be present. -// Test for the existence of the attribute first before attempting to access -// its value. For more information, see the has (presence of attribute test) -// operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) -// in the Cedar Policy Language Guide. -// -// - ImpossiblePolicy Cedar has determined that a policy condition always -// evaluates to false. If the policy is always false, it can never apply -// to any query, and so it can never affect an authorization decision. -// -// - WrongNumberArguments The policy references an extension type with the -// wrong number of arguments. -// -// - FunctionArgumentValidationError Cedar couldn't parse the argument passed -// to an extension type. For example, a string that is to be parsed as an -// IPv4 address can contain only digits and the period character. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The list of fields that aren't valid. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Details about a field that failed policy validation. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // Describes the policy validation error. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The path to the specific element that Verified Permissions found to be not - // valid. - // - // Path is a required field - Path *string `locationName:"path" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetPath sets the Path field's value. -func (s *ValidationExceptionField) SetPath(v string) *ValidationExceptionField { - s.Path = &v - return s -} - -// A structure that contains Cedar policy validation settings for the policy -// store. The validation mode determines which validation failures that Cedar -// considers serious enough to block acceptance of a new or edited static policy -// or policy template. -// -// This data type is used as a request parameter in the CreatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_CreatePolicyStore.html) -// and UpdatePolicyStore (https://docs.aws.amazon.com/verifiedpermissions/latest/apireference/API_UpdatePolicyStore.html) -// operations. -type ValidationSettings struct { - _ struct{} `type:"structure"` - - // The validation mode currently configured for this policy store. The valid - // values are: - // - // * OFF – Neither Verified Permissions nor Cedar perform any validation - // on policies. No validation errors are reported by either service. - // - // * STRICT – Requires a schema to be present in the policy store. Cedar - // performs validation on all submitted new or updated static policies and - // policy templates. Any that fail validation are rejected and Cedar doesn't - // store them in the policy store. - // - // If Mode=STRICT and the policy store doesn't contain a schema, Verified Permissions - // rejects all static policies and policy templates because there is no schema - // to validate against. - // - // To submit a static policy or policy template without a schema, you must turn - // off validation. - // - // Mode is a required field - Mode *string `locationName:"mode" type:"string" required:"true" enum:"ValidationMode"` -} - -// 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 ValidationSettings) 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 ValidationSettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ValidationSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ValidationSettings"} - if s.Mode == nil { - invalidParams.Add(request.NewErrParamRequired("Mode")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMode sets the Mode field's value. -func (s *ValidationSettings) SetMode(v string) *ValidationSettings { - s.Mode = &v - return s -} - -const ( - // DecisionAllow is a Decision enum value - DecisionAllow = "ALLOW" - - // DecisionDeny is a Decision enum value - DecisionDeny = "DENY" -) - -// Decision_Values returns all elements of the Decision enum -func Decision_Values() []string { - return []string{ - DecisionAllow, - DecisionDeny, - } -} - -const ( - // OpenIdIssuerCognito is a OpenIdIssuer enum value - OpenIdIssuerCognito = "COGNITO" -) - -// OpenIdIssuer_Values returns all elements of the OpenIdIssuer enum -func OpenIdIssuer_Values() []string { - return []string{ - OpenIdIssuerCognito, - } -} - -const ( - // PolicyTypeStatic is a PolicyType enum value - PolicyTypeStatic = "STATIC" - - // PolicyTypeTemplateLinked is a PolicyType enum value - PolicyTypeTemplateLinked = "TEMPLATE_LINKED" -) - -// PolicyType_Values returns all elements of the PolicyType enum -func PolicyType_Values() []string { - return []string{ - PolicyTypeStatic, - PolicyTypeTemplateLinked, - } -} - -const ( - // ResourceTypeIdentitySource is a ResourceType enum value - ResourceTypeIdentitySource = "IDENTITY_SOURCE" - - // ResourceTypePolicyStore is a ResourceType enum value - ResourceTypePolicyStore = "POLICY_STORE" - - // ResourceTypePolicy is a ResourceType enum value - ResourceTypePolicy = "POLICY" - - // ResourceTypePolicyTemplate is a ResourceType enum value - ResourceTypePolicyTemplate = "POLICY_TEMPLATE" - - // ResourceTypeSchema is a ResourceType enum value - ResourceTypeSchema = "SCHEMA" -) - -// ResourceType_Values returns all elements of the ResourceType enum -func ResourceType_Values() []string { - return []string{ - ResourceTypeIdentitySource, - ResourceTypePolicyStore, - ResourceTypePolicy, - ResourceTypePolicyTemplate, - ResourceTypeSchema, - } -} - -const ( - // ValidationModeOff is a ValidationMode enum value - ValidationModeOff = "OFF" - - // ValidationModeStrict is a ValidationMode enum value - ValidationModeStrict = "STRICT" -) - -// ValidationMode_Values returns all elements of the ValidationMode enum -func ValidationMode_Values() []string { - return []string{ - ValidationModeOff, - ValidationModeStrict, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/doc.go deleted file mode 100644 index 50336cfb4cd7..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/doc.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package verifiedpermissions provides the client and types for making API -// requests to Amazon Verified Permissions. -// -// Amazon Verified Permissions is a permissions management service from Amazon -// Web Services. You can use Verified Permissions to manage permissions for -// your application, and authorize user access based on those permissions. Using -// Verified Permissions, application developers can grant access based on information -// about the users, resources, and requested actions. You can also evaluate -// additional information like group membership, attributes of the resources, -// and session context, such as time of request and IP addresses. Verified Permissions -// manages these permissions by letting you create and store authorization policies -// for your applications, such as consumer-facing web sites and enterprise business -// systems. -// -// Verified Permissions uses Cedar as the policy language to express your permission -// requirements. Cedar supports both role-based access control (RBAC) and attribute-based -// access control (ABAC) authorization models. -// -// For more information about configuring, administering, and using Amazon Verified -// Permissions in your applications, see the Amazon Verified Permissions User -// Guide (https://docs.aws.amazon.com/verifiedpermissions/latest/userguide/). -// -// For more information about the Cedar policy language, see the Cedar Policy -// Language Guide (https://docs.cedarpolicy.com/). -// -// When you write Cedar policies that reference principals, resources and actions, -// you can define the unique identifiers used for each of those elements. We -// strongly recommend that you follow these best practices: -// -// - Use values like universally unique identifiers (UUIDs) for all principal -// and resource identifiers. For example, if user jane leaves the company, -// and you later let someone else use the name jane, then that new user automatically -// gets access to everything granted by policies that still reference User::"jane". -// Cedar can’t distinguish between the new user and the old. This applies -// to both principal and resource identifiers. Always use identifiers that -// are guaranteed unique and never reused to ensure that you don’t unintentionally -// grant access because of the presence of an old identifier in a policy. -// Where you use a UUID for an entity, we recommend that you follow it with -// the // comment specifier and the ‘friendly’ name of your entity. This -// helps to make your policies easier to understand. For example: principal -// == User::"a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111", // alice -// -// - Do not include personally identifying, confidential, or sensitive information -// as part of the unique identifier for your principals or resources. These -// identifiers are included in log entries shared in CloudTrail trails. -// -// Several operations return structures that appear similar, but have different -// purposes. As new functionality is added to the product, the structure used -// in a parameter of one operation might need to change in a way that wouldn't -// make sense for the same parameter in a different operation. To help you understand -// the purpose of each, the following naming convention is used for the structures: -// -// - Parameter type structures that end in Detail are used in Get operations. -// -// - Parameter type structures that end in Item are used in List operations. -// -// - Parameter type structures that use neither suffix are used in the mutating -// (create and update) operations. -// -// See https://docs.aws.amazon.com/goto/WebAPI/verifiedpermissions-2021-12-01 for more information on this service. -// -// See verifiedpermissions package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/verifiedpermissions/ -// -// # Using the Client -// -// To contact Amazon Verified Permissions with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Verified Permissions client VerifiedPermissions for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/verifiedpermissions/#New -package verifiedpermissions diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/errors.go deleted file mode 100644 index 12785ff78627..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/errors.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package verifiedpermissions - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request failed because another request to modify a resource occurred - // at the same. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The request failed because of an internal error. Try your request again later - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request failed because it references a resource that doesn't exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request failed because it would cause a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request failed because it exceeded a throttling quota. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The request failed because one or more input parameters don't satisfy their - // constraint requirements. The output is provided as a list of fields and a - // reason for each field that isn't valid. - // - // The possible reasons include the following: - // - // * UnrecognizedEntityType The policy includes an entity type that isn't - // found in the schema. - // - // * UnrecognizedActionId The policy includes an action id that isn't found - // in the schema. - // - // * InvalidActionApplication The policy includes an action that, according - // to the schema, doesn't support the specified principal and resource. - // - // * UnexpectedType The policy included an operand that isn't a valid type - // for the specified operation. - // - // * IncompatibleTypes The types of elements included in a set, or the types - // of expressions used in an if...then...else clause aren't compatible in - // this context. - // - // * MissingAttribute The policy attempts to access a record or entity attribute - // that isn't specified in the schema. Test for the existence of the attribute - // first before attempting to access its value. For more information, see - // the has (presence of attribute test) operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) - // in the Cedar Policy Language Guide. - // - // * UnsafeOptionalAttributeAccess The policy attempts to access a record - // or entity attribute that is optional and isn't guaranteed to be present. - // Test for the existence of the attribute first before attempting to access - // its value. For more information, see the has (presence of attribute test) - // operator (https://docs.cedarpolicy.com/policies/syntax-operators.html#has-presence-of-attribute-test) - // in the Cedar Policy Language Guide. - // - // * ImpossiblePolicy Cedar has determined that a policy condition always - // evaluates to false. If the policy is always false, it can never apply - // to any query, and so it can never affect an authorization decision. - // - // * WrongNumberArguments The policy references an extension type with the - // wrong number of arguments. - // - // * FunctionArgumentValidationError Cedar couldn't parse the argument passed - // to an extension type. For example, a string that is to be parsed as an - // IPv4 address can contain only digits and the period character. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/service.go deleted file mode 100644 index b3a32535b308..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package verifiedpermissions - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// VerifiedPermissions provides the API operation methods for making requests to -// Amazon Verified Permissions. See this package's package overview docs -// for details on the service. -// -// VerifiedPermissions methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type VerifiedPermissions struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "VerifiedPermissions" // Name of service. - EndpointsID = "verifiedpermissions" // ID to lookup a service endpoint with. - ServiceID = "VerifiedPermissions" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the VerifiedPermissions client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a VerifiedPermissions client from just a session. -// svc := verifiedpermissions.New(mySession) -// -// // Create a VerifiedPermissions client with additional configuration -// svc := verifiedpermissions.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *VerifiedPermissions { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "verifiedpermissions" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *VerifiedPermissions { - svc := &VerifiedPermissions{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2021-12-01", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.0", - TargetPrefix: "VerifiedPermissions", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a VerifiedPermissions operation and runs any -// custom request initialization. -func (c *VerifiedPermissions) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/verifiedpermissionsiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/verifiedpermissionsiface/interface.go deleted file mode 100644 index 8034af1288ff..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions/verifiedpermissionsiface/interface.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package verifiedpermissionsiface provides an interface to enable mocking the Amazon Verified Permissions service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package verifiedpermissionsiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/verifiedpermissions" -) - -// VerifiedPermissionsAPI provides an interface to enable mocking the -// verifiedpermissions.VerifiedPermissions service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon Verified Permissions. -// func myFunc(svc verifiedpermissionsiface.VerifiedPermissionsAPI) bool { -// // Make svc.BatchIsAuthorized request -// } -// -// func main() { -// sess := session.New() -// svc := verifiedpermissions.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockVerifiedPermissionsClient struct { -// verifiedpermissionsiface.VerifiedPermissionsAPI -// } -// func (m *mockVerifiedPermissionsClient) BatchIsAuthorized(input *verifiedpermissions.BatchIsAuthorizedInput) (*verifiedpermissions.BatchIsAuthorizedOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockVerifiedPermissionsClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type VerifiedPermissionsAPI interface { - BatchIsAuthorized(*verifiedpermissions.BatchIsAuthorizedInput) (*verifiedpermissions.BatchIsAuthorizedOutput, error) - BatchIsAuthorizedWithContext(aws.Context, *verifiedpermissions.BatchIsAuthorizedInput, ...request.Option) (*verifiedpermissions.BatchIsAuthorizedOutput, error) - BatchIsAuthorizedRequest(*verifiedpermissions.BatchIsAuthorizedInput) (*request.Request, *verifiedpermissions.BatchIsAuthorizedOutput) - - CreateIdentitySource(*verifiedpermissions.CreateIdentitySourceInput) (*verifiedpermissions.CreateIdentitySourceOutput, error) - CreateIdentitySourceWithContext(aws.Context, *verifiedpermissions.CreateIdentitySourceInput, ...request.Option) (*verifiedpermissions.CreateIdentitySourceOutput, error) - CreateIdentitySourceRequest(*verifiedpermissions.CreateIdentitySourceInput) (*request.Request, *verifiedpermissions.CreateIdentitySourceOutput) - - CreatePolicy(*verifiedpermissions.CreatePolicyInput) (*verifiedpermissions.CreatePolicyOutput, error) - CreatePolicyWithContext(aws.Context, *verifiedpermissions.CreatePolicyInput, ...request.Option) (*verifiedpermissions.CreatePolicyOutput, error) - CreatePolicyRequest(*verifiedpermissions.CreatePolicyInput) (*request.Request, *verifiedpermissions.CreatePolicyOutput) - - CreatePolicyStore(*verifiedpermissions.CreatePolicyStoreInput) (*verifiedpermissions.CreatePolicyStoreOutput, error) - CreatePolicyStoreWithContext(aws.Context, *verifiedpermissions.CreatePolicyStoreInput, ...request.Option) (*verifiedpermissions.CreatePolicyStoreOutput, error) - CreatePolicyStoreRequest(*verifiedpermissions.CreatePolicyStoreInput) (*request.Request, *verifiedpermissions.CreatePolicyStoreOutput) - - CreatePolicyTemplate(*verifiedpermissions.CreatePolicyTemplateInput) (*verifiedpermissions.CreatePolicyTemplateOutput, error) - CreatePolicyTemplateWithContext(aws.Context, *verifiedpermissions.CreatePolicyTemplateInput, ...request.Option) (*verifiedpermissions.CreatePolicyTemplateOutput, error) - CreatePolicyTemplateRequest(*verifiedpermissions.CreatePolicyTemplateInput) (*request.Request, *verifiedpermissions.CreatePolicyTemplateOutput) - - DeleteIdentitySource(*verifiedpermissions.DeleteIdentitySourceInput) (*verifiedpermissions.DeleteIdentitySourceOutput, error) - DeleteIdentitySourceWithContext(aws.Context, *verifiedpermissions.DeleteIdentitySourceInput, ...request.Option) (*verifiedpermissions.DeleteIdentitySourceOutput, error) - DeleteIdentitySourceRequest(*verifiedpermissions.DeleteIdentitySourceInput) (*request.Request, *verifiedpermissions.DeleteIdentitySourceOutput) - - DeletePolicy(*verifiedpermissions.DeletePolicyInput) (*verifiedpermissions.DeletePolicyOutput, error) - DeletePolicyWithContext(aws.Context, *verifiedpermissions.DeletePolicyInput, ...request.Option) (*verifiedpermissions.DeletePolicyOutput, error) - DeletePolicyRequest(*verifiedpermissions.DeletePolicyInput) (*request.Request, *verifiedpermissions.DeletePolicyOutput) - - DeletePolicyStore(*verifiedpermissions.DeletePolicyStoreInput) (*verifiedpermissions.DeletePolicyStoreOutput, error) - DeletePolicyStoreWithContext(aws.Context, *verifiedpermissions.DeletePolicyStoreInput, ...request.Option) (*verifiedpermissions.DeletePolicyStoreOutput, error) - DeletePolicyStoreRequest(*verifiedpermissions.DeletePolicyStoreInput) (*request.Request, *verifiedpermissions.DeletePolicyStoreOutput) - - DeletePolicyTemplate(*verifiedpermissions.DeletePolicyTemplateInput) (*verifiedpermissions.DeletePolicyTemplateOutput, error) - DeletePolicyTemplateWithContext(aws.Context, *verifiedpermissions.DeletePolicyTemplateInput, ...request.Option) (*verifiedpermissions.DeletePolicyTemplateOutput, error) - DeletePolicyTemplateRequest(*verifiedpermissions.DeletePolicyTemplateInput) (*request.Request, *verifiedpermissions.DeletePolicyTemplateOutput) - - GetIdentitySource(*verifiedpermissions.GetIdentitySourceInput) (*verifiedpermissions.GetIdentitySourceOutput, error) - GetIdentitySourceWithContext(aws.Context, *verifiedpermissions.GetIdentitySourceInput, ...request.Option) (*verifiedpermissions.GetIdentitySourceOutput, error) - GetIdentitySourceRequest(*verifiedpermissions.GetIdentitySourceInput) (*request.Request, *verifiedpermissions.GetIdentitySourceOutput) - - GetPolicy(*verifiedpermissions.GetPolicyInput) (*verifiedpermissions.GetPolicyOutput, error) - GetPolicyWithContext(aws.Context, *verifiedpermissions.GetPolicyInput, ...request.Option) (*verifiedpermissions.GetPolicyOutput, error) - GetPolicyRequest(*verifiedpermissions.GetPolicyInput) (*request.Request, *verifiedpermissions.GetPolicyOutput) - - GetPolicyStore(*verifiedpermissions.GetPolicyStoreInput) (*verifiedpermissions.GetPolicyStoreOutput, error) - GetPolicyStoreWithContext(aws.Context, *verifiedpermissions.GetPolicyStoreInput, ...request.Option) (*verifiedpermissions.GetPolicyStoreOutput, error) - GetPolicyStoreRequest(*verifiedpermissions.GetPolicyStoreInput) (*request.Request, *verifiedpermissions.GetPolicyStoreOutput) - - GetPolicyTemplate(*verifiedpermissions.GetPolicyTemplateInput) (*verifiedpermissions.GetPolicyTemplateOutput, error) - GetPolicyTemplateWithContext(aws.Context, *verifiedpermissions.GetPolicyTemplateInput, ...request.Option) (*verifiedpermissions.GetPolicyTemplateOutput, error) - GetPolicyTemplateRequest(*verifiedpermissions.GetPolicyTemplateInput) (*request.Request, *verifiedpermissions.GetPolicyTemplateOutput) - - GetSchema(*verifiedpermissions.GetSchemaInput) (*verifiedpermissions.GetSchemaOutput, error) - GetSchemaWithContext(aws.Context, *verifiedpermissions.GetSchemaInput, ...request.Option) (*verifiedpermissions.GetSchemaOutput, error) - GetSchemaRequest(*verifiedpermissions.GetSchemaInput) (*request.Request, *verifiedpermissions.GetSchemaOutput) - - IsAuthorized(*verifiedpermissions.IsAuthorizedInput) (*verifiedpermissions.IsAuthorizedOutput, error) - IsAuthorizedWithContext(aws.Context, *verifiedpermissions.IsAuthorizedInput, ...request.Option) (*verifiedpermissions.IsAuthorizedOutput, error) - IsAuthorizedRequest(*verifiedpermissions.IsAuthorizedInput) (*request.Request, *verifiedpermissions.IsAuthorizedOutput) - - IsAuthorizedWithToken(*verifiedpermissions.IsAuthorizedWithTokenInput) (*verifiedpermissions.IsAuthorizedWithTokenOutput, error) - IsAuthorizedWithTokenWithContext(aws.Context, *verifiedpermissions.IsAuthorizedWithTokenInput, ...request.Option) (*verifiedpermissions.IsAuthorizedWithTokenOutput, error) - IsAuthorizedWithTokenRequest(*verifiedpermissions.IsAuthorizedWithTokenInput) (*request.Request, *verifiedpermissions.IsAuthorizedWithTokenOutput) - - ListIdentitySources(*verifiedpermissions.ListIdentitySourcesInput) (*verifiedpermissions.ListIdentitySourcesOutput, error) - ListIdentitySourcesWithContext(aws.Context, *verifiedpermissions.ListIdentitySourcesInput, ...request.Option) (*verifiedpermissions.ListIdentitySourcesOutput, error) - ListIdentitySourcesRequest(*verifiedpermissions.ListIdentitySourcesInput) (*request.Request, *verifiedpermissions.ListIdentitySourcesOutput) - - ListIdentitySourcesPages(*verifiedpermissions.ListIdentitySourcesInput, func(*verifiedpermissions.ListIdentitySourcesOutput, bool) bool) error - ListIdentitySourcesPagesWithContext(aws.Context, *verifiedpermissions.ListIdentitySourcesInput, func(*verifiedpermissions.ListIdentitySourcesOutput, bool) bool, ...request.Option) error - - ListPolicies(*verifiedpermissions.ListPoliciesInput) (*verifiedpermissions.ListPoliciesOutput, error) - ListPoliciesWithContext(aws.Context, *verifiedpermissions.ListPoliciesInput, ...request.Option) (*verifiedpermissions.ListPoliciesOutput, error) - ListPoliciesRequest(*verifiedpermissions.ListPoliciesInput) (*request.Request, *verifiedpermissions.ListPoliciesOutput) - - ListPoliciesPages(*verifiedpermissions.ListPoliciesInput, func(*verifiedpermissions.ListPoliciesOutput, bool) bool) error - ListPoliciesPagesWithContext(aws.Context, *verifiedpermissions.ListPoliciesInput, func(*verifiedpermissions.ListPoliciesOutput, bool) bool, ...request.Option) error - - ListPolicyStores(*verifiedpermissions.ListPolicyStoresInput) (*verifiedpermissions.ListPolicyStoresOutput, error) - ListPolicyStoresWithContext(aws.Context, *verifiedpermissions.ListPolicyStoresInput, ...request.Option) (*verifiedpermissions.ListPolicyStoresOutput, error) - ListPolicyStoresRequest(*verifiedpermissions.ListPolicyStoresInput) (*request.Request, *verifiedpermissions.ListPolicyStoresOutput) - - ListPolicyStoresPages(*verifiedpermissions.ListPolicyStoresInput, func(*verifiedpermissions.ListPolicyStoresOutput, bool) bool) error - ListPolicyStoresPagesWithContext(aws.Context, *verifiedpermissions.ListPolicyStoresInput, func(*verifiedpermissions.ListPolicyStoresOutput, bool) bool, ...request.Option) error - - ListPolicyTemplates(*verifiedpermissions.ListPolicyTemplatesInput) (*verifiedpermissions.ListPolicyTemplatesOutput, error) - ListPolicyTemplatesWithContext(aws.Context, *verifiedpermissions.ListPolicyTemplatesInput, ...request.Option) (*verifiedpermissions.ListPolicyTemplatesOutput, error) - ListPolicyTemplatesRequest(*verifiedpermissions.ListPolicyTemplatesInput) (*request.Request, *verifiedpermissions.ListPolicyTemplatesOutput) - - ListPolicyTemplatesPages(*verifiedpermissions.ListPolicyTemplatesInput, func(*verifiedpermissions.ListPolicyTemplatesOutput, bool) bool) error - ListPolicyTemplatesPagesWithContext(aws.Context, *verifiedpermissions.ListPolicyTemplatesInput, func(*verifiedpermissions.ListPolicyTemplatesOutput, bool) bool, ...request.Option) error - - PutSchema(*verifiedpermissions.PutSchemaInput) (*verifiedpermissions.PutSchemaOutput, error) - PutSchemaWithContext(aws.Context, *verifiedpermissions.PutSchemaInput, ...request.Option) (*verifiedpermissions.PutSchemaOutput, error) - PutSchemaRequest(*verifiedpermissions.PutSchemaInput) (*request.Request, *verifiedpermissions.PutSchemaOutput) - - UpdateIdentitySource(*verifiedpermissions.UpdateIdentitySourceInput) (*verifiedpermissions.UpdateIdentitySourceOutput, error) - UpdateIdentitySourceWithContext(aws.Context, *verifiedpermissions.UpdateIdentitySourceInput, ...request.Option) (*verifiedpermissions.UpdateIdentitySourceOutput, error) - UpdateIdentitySourceRequest(*verifiedpermissions.UpdateIdentitySourceInput) (*request.Request, *verifiedpermissions.UpdateIdentitySourceOutput) - - UpdatePolicy(*verifiedpermissions.UpdatePolicyInput) (*verifiedpermissions.UpdatePolicyOutput, error) - UpdatePolicyWithContext(aws.Context, *verifiedpermissions.UpdatePolicyInput, ...request.Option) (*verifiedpermissions.UpdatePolicyOutput, error) - UpdatePolicyRequest(*verifiedpermissions.UpdatePolicyInput) (*request.Request, *verifiedpermissions.UpdatePolicyOutput) - - UpdatePolicyStore(*verifiedpermissions.UpdatePolicyStoreInput) (*verifiedpermissions.UpdatePolicyStoreOutput, error) - UpdatePolicyStoreWithContext(aws.Context, *verifiedpermissions.UpdatePolicyStoreInput, ...request.Option) (*verifiedpermissions.UpdatePolicyStoreOutput, error) - UpdatePolicyStoreRequest(*verifiedpermissions.UpdatePolicyStoreInput) (*request.Request, *verifiedpermissions.UpdatePolicyStoreOutput) - - UpdatePolicyTemplate(*verifiedpermissions.UpdatePolicyTemplateInput) (*verifiedpermissions.UpdatePolicyTemplateOutput, error) - UpdatePolicyTemplateWithContext(aws.Context, *verifiedpermissions.UpdatePolicyTemplateInput, ...request.Option) (*verifiedpermissions.UpdatePolicyTemplateOutput, error) - UpdatePolicyTemplateRequest(*verifiedpermissions.UpdatePolicyTemplateInput) (*request.Request, *verifiedpermissions.UpdatePolicyTemplateOutput) -} - -var _ VerifiedPermissionsAPI = (*verifiedpermissions.VerifiedPermissions)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/api.go deleted file mode 100644 index a99c00a46fd6..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/api.go +++ /dev/null @@ -1,15623 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package vpclattice - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opBatchUpdateRule = "BatchUpdateRule" - -// BatchUpdateRuleRequest generates a "aws/request.Request" representing the -// client's request for the BatchUpdateRule 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 BatchUpdateRule for more information on using the BatchUpdateRule -// 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 BatchUpdateRuleRequest method. -// req, resp := client.BatchUpdateRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/BatchUpdateRule -func (c *VPCLattice) BatchUpdateRuleRequest(input *BatchUpdateRuleInput) (req *request.Request, output *BatchUpdateRuleOutput) { - op := &request.Operation{ - Name: opBatchUpdateRule, - HTTPMethod: "PATCH", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules", - } - - if input == nil { - input = &BatchUpdateRuleInput{} - } - - output = &BatchUpdateRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// BatchUpdateRule API operation for Amazon VPC Lattice. -// -// Updates the listener rules in a batch. You can use this operation to change -// the priority of listener rules. This can be useful when bulk updating or -// swapping rule priority. -// -// 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 VPC Lattice's -// API operation BatchUpdateRule for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/BatchUpdateRule -func (c *VPCLattice) BatchUpdateRule(input *BatchUpdateRuleInput) (*BatchUpdateRuleOutput, error) { - req, out := c.BatchUpdateRuleRequest(input) - return out, req.Send() -} - -// BatchUpdateRuleWithContext is the same as BatchUpdateRule with the addition of -// the ability to pass a context and additional request options. -// -// See BatchUpdateRule 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 *VPCLattice) BatchUpdateRuleWithContext(ctx aws.Context, input *BatchUpdateRuleInput, opts ...request.Option) (*BatchUpdateRuleOutput, error) { - req, out := c.BatchUpdateRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAccessLogSubscription = "CreateAccessLogSubscription" - -// CreateAccessLogSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the CreateAccessLogSubscription 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 CreateAccessLogSubscription for more information on using the CreateAccessLogSubscription -// 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 CreateAccessLogSubscriptionRequest method. -// req, resp := client.CreateAccessLogSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateAccessLogSubscription -func (c *VPCLattice) CreateAccessLogSubscriptionRequest(input *CreateAccessLogSubscriptionInput) (req *request.Request, output *CreateAccessLogSubscriptionOutput) { - op := &request.Operation{ - Name: opCreateAccessLogSubscription, - HTTPMethod: "POST", - HTTPPath: "/accesslogsubscriptions", - } - - if input == nil { - input = &CreateAccessLogSubscriptionInput{} - } - - output = &CreateAccessLogSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAccessLogSubscription API operation for Amazon VPC Lattice. -// -// Enables access logs to be sent to Amazon CloudWatch, Amazon S3, and Amazon -// Kinesis Data Firehose. The service network owner can use the access logs -// to audit the services in the network. The service network owner will only -// see access logs from clients and services that are associated with their -// service network. Access log entries represent traffic originated from VPCs -// associated with that network. For more information, see Access logs (https://docs.aws.amazon.com/vpc-lattice/latest/ug/monitoring-access-logs.html) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation CreateAccessLogSubscription for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateAccessLogSubscription -func (c *VPCLattice) CreateAccessLogSubscription(input *CreateAccessLogSubscriptionInput) (*CreateAccessLogSubscriptionOutput, error) { - req, out := c.CreateAccessLogSubscriptionRequest(input) - return out, req.Send() -} - -// CreateAccessLogSubscriptionWithContext is the same as CreateAccessLogSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAccessLogSubscription 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 *VPCLattice) CreateAccessLogSubscriptionWithContext(ctx aws.Context, input *CreateAccessLogSubscriptionInput, opts ...request.Option) (*CreateAccessLogSubscriptionOutput, error) { - req, out := c.CreateAccessLogSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateListener = "CreateListener" - -// CreateListenerRequest generates a "aws/request.Request" representing the -// client's request for the CreateListener 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 CreateListener for more information on using the CreateListener -// 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 CreateListenerRequest method. -// req, resp := client.CreateListenerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateListener -func (c *VPCLattice) CreateListenerRequest(input *CreateListenerInput) (req *request.Request, output *CreateListenerOutput) { - op := &request.Operation{ - Name: opCreateListener, - HTTPMethod: "POST", - HTTPPath: "/services/{serviceIdentifier}/listeners", - } - - if input == nil { - input = &CreateListenerInput{} - } - - output = &CreateListenerOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateListener API operation for Amazon VPC Lattice. -// -// Creates a listener for a service. Before you start using your Amazon VPC -// Lattice service, you must add one or more listeners. A listener is a process -// that checks for connection requests to your services. For more information, -// see Listeners (https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation CreateListener for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateListener -func (c *VPCLattice) CreateListener(input *CreateListenerInput) (*CreateListenerOutput, error) { - req, out := c.CreateListenerRequest(input) - return out, req.Send() -} - -// CreateListenerWithContext is the same as CreateListener with the addition of -// the ability to pass a context and additional request options. -// -// See CreateListener 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 *VPCLattice) CreateListenerWithContext(ctx aws.Context, input *CreateListenerInput, opts ...request.Option) (*CreateListenerOutput, error) { - req, out := c.CreateListenerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRule = "CreateRule" - -// CreateRuleRequest generates a "aws/request.Request" representing the -// client's request for the CreateRule 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 CreateRule for more information on using the CreateRule -// 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 CreateRuleRequest method. -// req, resp := client.CreateRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateRule -func (c *VPCLattice) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, output *CreateRuleOutput) { - op := &request.Operation{ - Name: opCreateRule, - HTTPMethod: "POST", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules", - } - - if input == nil { - input = &CreateRuleInput{} - } - - output = &CreateRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRule API operation for Amazon VPC Lattice. -// -// Creates a listener rule. Each listener has a default rule for checking connection -// requests, but you can define additional rules. Each rule consists of a priority, -// one or more actions, and one or more conditions. For more information, see -// Listener rules (https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation CreateRule for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateRule -func (c *VPCLattice) CreateRule(input *CreateRuleInput) (*CreateRuleOutput, error) { - req, out := c.CreateRuleRequest(input) - return out, req.Send() -} - -// CreateRuleWithContext is the same as CreateRule with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRule 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 *VPCLattice) CreateRuleWithContext(ctx aws.Context, input *CreateRuleInput, opts ...request.Option) (*CreateRuleOutput, error) { - req, out := c.CreateRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateService = "CreateService" - -// CreateServiceRequest generates a "aws/request.Request" representing the -// client's request for the CreateService 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 CreateService for more information on using the CreateService -// 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 CreateServiceRequest method. -// req, resp := client.CreateServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateService -func (c *VPCLattice) CreateServiceRequest(input *CreateServiceInput) (req *request.Request, output *CreateServiceOutput) { - op := &request.Operation{ - Name: opCreateService, - HTTPMethod: "POST", - HTTPPath: "/services", - } - - if input == nil { - input = &CreateServiceInput{} - } - - output = &CreateServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateService API operation for Amazon VPC Lattice. -// -// Creates a service. A service is any software application that can run on -// instances containers, or serverless functions within an account or virtual -// private cloud (VPC). -// -// For more information, see Services (https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation CreateService for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateService -func (c *VPCLattice) CreateService(input *CreateServiceInput) (*CreateServiceOutput, error) { - req, out := c.CreateServiceRequest(input) - return out, req.Send() -} - -// CreateServiceWithContext is the same as CreateService with the addition of -// the ability to pass a context and additional request options. -// -// See CreateService 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 *VPCLattice) CreateServiceWithContext(ctx aws.Context, input *CreateServiceInput, opts ...request.Option) (*CreateServiceOutput, error) { - req, out := c.CreateServiceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateServiceNetwork = "CreateServiceNetwork" - -// CreateServiceNetworkRequest generates a "aws/request.Request" representing the -// client's request for the CreateServiceNetwork 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 CreateServiceNetwork for more information on using the CreateServiceNetwork -// 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 CreateServiceNetworkRequest method. -// req, resp := client.CreateServiceNetworkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateServiceNetwork -func (c *VPCLattice) CreateServiceNetworkRequest(input *CreateServiceNetworkInput) (req *request.Request, output *CreateServiceNetworkOutput) { - op := &request.Operation{ - Name: opCreateServiceNetwork, - HTTPMethod: "POST", - HTTPPath: "/servicenetworks", - } - - if input == nil { - input = &CreateServiceNetworkInput{} - } - - output = &CreateServiceNetworkOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateServiceNetwork API operation for Amazon VPC Lattice. -// -// Creates a service network. A service network is a logical boundary for a -// collection of services. You can associate services and VPCs with a service -// network. -// -// For more information, see Service networks (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation CreateServiceNetwork for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateServiceNetwork -func (c *VPCLattice) CreateServiceNetwork(input *CreateServiceNetworkInput) (*CreateServiceNetworkOutput, error) { - req, out := c.CreateServiceNetworkRequest(input) - return out, req.Send() -} - -// CreateServiceNetworkWithContext is the same as CreateServiceNetwork with the addition of -// the ability to pass a context and additional request options. -// -// See CreateServiceNetwork 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 *VPCLattice) CreateServiceNetworkWithContext(ctx aws.Context, input *CreateServiceNetworkInput, opts ...request.Option) (*CreateServiceNetworkOutput, error) { - req, out := c.CreateServiceNetworkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateServiceNetworkServiceAssociation = "CreateServiceNetworkServiceAssociation" - -// CreateServiceNetworkServiceAssociationRequest generates a "aws/request.Request" representing the -// client's request for the CreateServiceNetworkServiceAssociation 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 CreateServiceNetworkServiceAssociation for more information on using the CreateServiceNetworkServiceAssociation -// 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 CreateServiceNetworkServiceAssociationRequest method. -// req, resp := client.CreateServiceNetworkServiceAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateServiceNetworkServiceAssociation -func (c *VPCLattice) CreateServiceNetworkServiceAssociationRequest(input *CreateServiceNetworkServiceAssociationInput) (req *request.Request, output *CreateServiceNetworkServiceAssociationOutput) { - op := &request.Operation{ - Name: opCreateServiceNetworkServiceAssociation, - HTTPMethod: "POST", - HTTPPath: "/servicenetworkserviceassociations", - } - - if input == nil { - input = &CreateServiceNetworkServiceAssociationInput{} - } - - output = &CreateServiceNetworkServiceAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateServiceNetworkServiceAssociation API operation for Amazon VPC Lattice. -// -// Associates a service with a service network. -// -// You can't use this operation if the service and service network are already -// associated or if there is a disassociation or deletion in progress. If the -// association fails, you can retry the operation by deleting the association -// and recreating it. -// -// You cannot associate a service and service network that are shared with a -// caller. The caller must own either the service or the service network. -// -// As a result of this operation, the association is created in the service -// network account and the association owner account. -// -// 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 VPC Lattice's -// API operation CreateServiceNetworkServiceAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateServiceNetworkServiceAssociation -func (c *VPCLattice) CreateServiceNetworkServiceAssociation(input *CreateServiceNetworkServiceAssociationInput) (*CreateServiceNetworkServiceAssociationOutput, error) { - req, out := c.CreateServiceNetworkServiceAssociationRequest(input) - return out, req.Send() -} - -// CreateServiceNetworkServiceAssociationWithContext is the same as CreateServiceNetworkServiceAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See CreateServiceNetworkServiceAssociation 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 *VPCLattice) CreateServiceNetworkServiceAssociationWithContext(ctx aws.Context, input *CreateServiceNetworkServiceAssociationInput, opts ...request.Option) (*CreateServiceNetworkServiceAssociationOutput, error) { - req, out := c.CreateServiceNetworkServiceAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateServiceNetworkVpcAssociation = "CreateServiceNetworkVpcAssociation" - -// CreateServiceNetworkVpcAssociationRequest generates a "aws/request.Request" representing the -// client's request for the CreateServiceNetworkVpcAssociation 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 CreateServiceNetworkVpcAssociation for more information on using the CreateServiceNetworkVpcAssociation -// 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 CreateServiceNetworkVpcAssociationRequest method. -// req, resp := client.CreateServiceNetworkVpcAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateServiceNetworkVpcAssociation -func (c *VPCLattice) CreateServiceNetworkVpcAssociationRequest(input *CreateServiceNetworkVpcAssociationInput) (req *request.Request, output *CreateServiceNetworkVpcAssociationOutput) { - op := &request.Operation{ - Name: opCreateServiceNetworkVpcAssociation, - HTTPMethod: "POST", - HTTPPath: "/servicenetworkvpcassociations", - } - - if input == nil { - input = &CreateServiceNetworkVpcAssociationInput{} - } - - output = &CreateServiceNetworkVpcAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateServiceNetworkVpcAssociation API operation for Amazon VPC Lattice. -// -// Associates a VPC with a service network. When you associate a VPC with the -// service network, it enables all the resources within that VPC to be clients -// and communicate with other services in the service network. For more information, -// see Manage VPC associations (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-network-associations.html#service-network-vpc-associations) -// in the Amazon VPC Lattice User Guide. -// -// You can't use this operation if there is a disassociation in progress. If -// the association fails, retry by deleting the association and recreating it. -// -// As a result of this operation, the association gets created in the service -// network account and the VPC owner account. -// -// Once a security group is added to the VPC association it cannot be removed. -// You can add or update the security groups being used for the VPC association -// once a security group is attached. To remove all security groups you must -// reassociate the VPC. -// -// 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 VPC Lattice's -// API operation CreateServiceNetworkVpcAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateServiceNetworkVpcAssociation -func (c *VPCLattice) CreateServiceNetworkVpcAssociation(input *CreateServiceNetworkVpcAssociationInput) (*CreateServiceNetworkVpcAssociationOutput, error) { - req, out := c.CreateServiceNetworkVpcAssociationRequest(input) - return out, req.Send() -} - -// CreateServiceNetworkVpcAssociationWithContext is the same as CreateServiceNetworkVpcAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See CreateServiceNetworkVpcAssociation 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 *VPCLattice) CreateServiceNetworkVpcAssociationWithContext(ctx aws.Context, input *CreateServiceNetworkVpcAssociationInput, opts ...request.Option) (*CreateServiceNetworkVpcAssociationOutput, error) { - req, out := c.CreateServiceNetworkVpcAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTargetGroup = "CreateTargetGroup" - -// CreateTargetGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateTargetGroup 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 CreateTargetGroup for more information on using the CreateTargetGroup -// 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 CreateTargetGroupRequest method. -// req, resp := client.CreateTargetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateTargetGroup -func (c *VPCLattice) CreateTargetGroupRequest(input *CreateTargetGroupInput) (req *request.Request, output *CreateTargetGroupOutput) { - op := &request.Operation{ - Name: opCreateTargetGroup, - HTTPMethod: "POST", - HTTPPath: "/targetgroups", - } - - if input == nil { - input = &CreateTargetGroupInput{} - } - - output = &CreateTargetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTargetGroup API operation for Amazon VPC Lattice. -// -// Creates a target group. A target group is a collection of targets, or compute -// resources, that run your application or service. A target group can only -// be used by a single service. -// -// For more information, see Target groups (https://docs.aws.amazon.com/vpc-lattice/latest/ug/target-groups.html) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation CreateTargetGroup for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateTargetGroup -func (c *VPCLattice) CreateTargetGroup(input *CreateTargetGroupInput) (*CreateTargetGroupOutput, error) { - req, out := c.CreateTargetGroupRequest(input) - return out, req.Send() -} - -// CreateTargetGroupWithContext is the same as CreateTargetGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTargetGroup 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 *VPCLattice) CreateTargetGroupWithContext(ctx aws.Context, input *CreateTargetGroupInput, opts ...request.Option) (*CreateTargetGroupOutput, error) { - req, out := c.CreateTargetGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAccessLogSubscription = "DeleteAccessLogSubscription" - -// DeleteAccessLogSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAccessLogSubscription 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 DeleteAccessLogSubscription for more information on using the DeleteAccessLogSubscription -// 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 DeleteAccessLogSubscriptionRequest method. -// req, resp := client.DeleteAccessLogSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteAccessLogSubscription -func (c *VPCLattice) DeleteAccessLogSubscriptionRequest(input *DeleteAccessLogSubscriptionInput) (req *request.Request, output *DeleteAccessLogSubscriptionOutput) { - op := &request.Operation{ - Name: opDeleteAccessLogSubscription, - HTTPMethod: "DELETE", - HTTPPath: "/accesslogsubscriptions/{accessLogSubscriptionIdentifier}", - } - - if input == nil { - input = &DeleteAccessLogSubscriptionInput{} - } - - output = &DeleteAccessLogSubscriptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAccessLogSubscription API operation for Amazon VPC Lattice. -// -// Deletes the specified access log subscription. -// -// 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 VPC Lattice's -// API operation DeleteAccessLogSubscription for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteAccessLogSubscription -func (c *VPCLattice) DeleteAccessLogSubscription(input *DeleteAccessLogSubscriptionInput) (*DeleteAccessLogSubscriptionOutput, error) { - req, out := c.DeleteAccessLogSubscriptionRequest(input) - return out, req.Send() -} - -// DeleteAccessLogSubscriptionWithContext is the same as DeleteAccessLogSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAccessLogSubscription 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 *VPCLattice) DeleteAccessLogSubscriptionWithContext(ctx aws.Context, input *DeleteAccessLogSubscriptionInput, opts ...request.Option) (*DeleteAccessLogSubscriptionOutput, error) { - req, out := c.DeleteAccessLogSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteAuthPolicy = "DeleteAuthPolicy" - -// DeleteAuthPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAuthPolicy 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 DeleteAuthPolicy for more information on using the DeleteAuthPolicy -// 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 DeleteAuthPolicyRequest method. -// req, resp := client.DeleteAuthPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteAuthPolicy -func (c *VPCLattice) DeleteAuthPolicyRequest(input *DeleteAuthPolicyInput) (req *request.Request, output *DeleteAuthPolicyOutput) { - op := &request.Operation{ - Name: opDeleteAuthPolicy, - HTTPMethod: "DELETE", - HTTPPath: "/authpolicy/{resourceIdentifier}", - } - - if input == nil { - input = &DeleteAuthPolicyInput{} - } - - output = &DeleteAuthPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteAuthPolicy API operation for Amazon VPC Lattice. -// -// Deletes the specified auth policy. If an auth is set to Amazon Web Services_IAM -// and the auth policy is deleted, all requests will be denied by default. If -// you are trying to remove the auth policy completely, you must set the auth_type -// to NONE. If auth is enabled on the resource, but no auth policy is set, all -// requests will be denied. -// -// 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 VPC Lattice's -// API operation DeleteAuthPolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteAuthPolicy -func (c *VPCLattice) DeleteAuthPolicy(input *DeleteAuthPolicyInput) (*DeleteAuthPolicyOutput, error) { - req, out := c.DeleteAuthPolicyRequest(input) - return out, req.Send() -} - -// DeleteAuthPolicyWithContext is the same as DeleteAuthPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteAuthPolicy 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 *VPCLattice) DeleteAuthPolicyWithContext(ctx aws.Context, input *DeleteAuthPolicyInput, opts ...request.Option) (*DeleteAuthPolicyOutput, error) { - req, out := c.DeleteAuthPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteListener = "DeleteListener" - -// DeleteListenerRequest generates a "aws/request.Request" representing the -// client's request for the DeleteListener 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 DeleteListener for more information on using the DeleteListener -// 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 DeleteListenerRequest method. -// req, resp := client.DeleteListenerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteListener -func (c *VPCLattice) DeleteListenerRequest(input *DeleteListenerInput) (req *request.Request, output *DeleteListenerOutput) { - op := &request.Operation{ - Name: opDeleteListener, - HTTPMethod: "DELETE", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}", - } - - if input == nil { - input = &DeleteListenerInput{} - } - - output = &DeleteListenerOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteListener API operation for Amazon VPC Lattice. -// -// Deletes the specified listener. -// -// 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 VPC Lattice's -// API operation DeleteListener for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteListener -func (c *VPCLattice) DeleteListener(input *DeleteListenerInput) (*DeleteListenerOutput, error) { - req, out := c.DeleteListenerRequest(input) - return out, req.Send() -} - -// DeleteListenerWithContext is the same as DeleteListener with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteListener 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 *VPCLattice) DeleteListenerWithContext(ctx aws.Context, input *DeleteListenerInput, opts ...request.Option) (*DeleteListenerOutput, error) { - req, out := c.DeleteListenerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteResourcePolicy = "DeleteResourcePolicy" - -// DeleteResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteResourcePolicy 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 DeleteResourcePolicy for more information on using the DeleteResourcePolicy -// 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 DeleteResourcePolicyRequest method. -// req, resp := client.DeleteResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteResourcePolicy -func (c *VPCLattice) DeleteResourcePolicyRequest(input *DeleteResourcePolicyInput) (req *request.Request, output *DeleteResourcePolicyOutput) { - op := &request.Operation{ - Name: opDeleteResourcePolicy, - HTTPMethod: "DELETE", - HTTPPath: "/resourcepolicy/{resourceArn}", - } - - if input == nil { - input = &DeleteResourcePolicyInput{} - } - - output = &DeleteResourcePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteResourcePolicy API operation for Amazon VPC Lattice. -// -// Deletes the specified resource policy. -// -// 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 VPC Lattice's -// API operation DeleteResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteResourcePolicy -func (c *VPCLattice) DeleteResourcePolicy(input *DeleteResourcePolicyInput) (*DeleteResourcePolicyOutput, error) { - req, out := c.DeleteResourcePolicyRequest(input) - return out, req.Send() -} - -// DeleteResourcePolicyWithContext is the same as DeleteResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteResourcePolicy 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 *VPCLattice) DeleteResourcePolicyWithContext(ctx aws.Context, input *DeleteResourcePolicyInput, opts ...request.Option) (*DeleteResourcePolicyOutput, error) { - req, out := c.DeleteResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRule = "DeleteRule" - -// DeleteRuleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRule 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 DeleteRule for more information on using the DeleteRule -// 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 DeleteRuleRequest method. -// req, resp := client.DeleteRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteRule -func (c *VPCLattice) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, output *DeleteRuleOutput) { - op := &request.Operation{ - Name: opDeleteRule, - HTTPMethod: "DELETE", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}", - } - - if input == nil { - input = &DeleteRuleInput{} - } - - output = &DeleteRuleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRule API operation for Amazon VPC Lattice. -// -// Deletes a listener rule. Each listener has a default rule for checking connection -// requests, but you can define additional rules. Each rule consists of a priority, -// one or more actions, and one or more conditions. You can delete additional -// listener rules, but you cannot delete the default rule. -// -// For more information, see Listener rules (https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation DeleteRule for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteRule -func (c *VPCLattice) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { - req, out := c.DeleteRuleRequest(input) - return out, req.Send() -} - -// DeleteRuleWithContext is the same as DeleteRule with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRule 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 *VPCLattice) DeleteRuleWithContext(ctx aws.Context, input *DeleteRuleInput, opts ...request.Option) (*DeleteRuleOutput, error) { - req, out := c.DeleteRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteService = "DeleteService" - -// DeleteServiceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteService 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 DeleteService for more information on using the DeleteService -// 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 DeleteServiceRequest method. -// req, resp := client.DeleteServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteService -func (c *VPCLattice) DeleteServiceRequest(input *DeleteServiceInput) (req *request.Request, output *DeleteServiceOutput) { - op := &request.Operation{ - Name: opDeleteService, - HTTPMethod: "DELETE", - HTTPPath: "/services/{serviceIdentifier}", - } - - if input == nil { - input = &DeleteServiceInput{} - } - - output = &DeleteServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteService API operation for Amazon VPC Lattice. -// -// Deletes a service. A service can't be deleted if it's associated with a service -// network. If you delete a service, all resources related to the service, such -// as the resource policy, auth policy, listeners, listener rules, and access -// log subscriptions, are also deleted. For more information, see Delete a service -// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/services.html#delete-service) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation DeleteService for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteService -func (c *VPCLattice) DeleteService(input *DeleteServiceInput) (*DeleteServiceOutput, error) { - req, out := c.DeleteServiceRequest(input) - return out, req.Send() -} - -// DeleteServiceWithContext is the same as DeleteService with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteService 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 *VPCLattice) DeleteServiceWithContext(ctx aws.Context, input *DeleteServiceInput, opts ...request.Option) (*DeleteServiceOutput, error) { - req, out := c.DeleteServiceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteServiceNetwork = "DeleteServiceNetwork" - -// DeleteServiceNetworkRequest generates a "aws/request.Request" representing the -// client's request for the DeleteServiceNetwork 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 DeleteServiceNetwork for more information on using the DeleteServiceNetwork -// 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 DeleteServiceNetworkRequest method. -// req, resp := client.DeleteServiceNetworkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteServiceNetwork -func (c *VPCLattice) DeleteServiceNetworkRequest(input *DeleteServiceNetworkInput) (req *request.Request, output *DeleteServiceNetworkOutput) { - op := &request.Operation{ - Name: opDeleteServiceNetwork, - HTTPMethod: "DELETE", - HTTPPath: "/servicenetworks/{serviceNetworkIdentifier}", - } - - if input == nil { - input = &DeleteServiceNetworkInput{} - } - - output = &DeleteServiceNetworkOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteServiceNetwork API operation for Amazon VPC Lattice. -// -// Deletes a service network. You can only delete the service network if there -// is no service or VPC associated with it. If you delete a service network, -// all resources related to the service network, such as the resource policy, -// auth policy, and access log subscriptions, are also deleted. For more information, -// see Delete a service network (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html#delete-service-network) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation DeleteServiceNetwork for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteServiceNetwork -func (c *VPCLattice) DeleteServiceNetwork(input *DeleteServiceNetworkInput) (*DeleteServiceNetworkOutput, error) { - req, out := c.DeleteServiceNetworkRequest(input) - return out, req.Send() -} - -// DeleteServiceNetworkWithContext is the same as DeleteServiceNetwork with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteServiceNetwork 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 *VPCLattice) DeleteServiceNetworkWithContext(ctx aws.Context, input *DeleteServiceNetworkInput, opts ...request.Option) (*DeleteServiceNetworkOutput, error) { - req, out := c.DeleteServiceNetworkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteServiceNetworkServiceAssociation = "DeleteServiceNetworkServiceAssociation" - -// DeleteServiceNetworkServiceAssociationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteServiceNetworkServiceAssociation 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 DeleteServiceNetworkServiceAssociation for more information on using the DeleteServiceNetworkServiceAssociation -// 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 DeleteServiceNetworkServiceAssociationRequest method. -// req, resp := client.DeleteServiceNetworkServiceAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteServiceNetworkServiceAssociation -func (c *VPCLattice) DeleteServiceNetworkServiceAssociationRequest(input *DeleteServiceNetworkServiceAssociationInput) (req *request.Request, output *DeleteServiceNetworkServiceAssociationOutput) { - op := &request.Operation{ - Name: opDeleteServiceNetworkServiceAssociation, - HTTPMethod: "DELETE", - HTTPPath: "/servicenetworkserviceassociations/{serviceNetworkServiceAssociationIdentifier}", - } - - if input == nil { - input = &DeleteServiceNetworkServiceAssociationInput{} - } - - output = &DeleteServiceNetworkServiceAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteServiceNetworkServiceAssociation API operation for Amazon VPC Lattice. -// -// Deletes the association between a specified service and the specific service -// network. This request will fail if an association is still in progress. -// -// 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 VPC Lattice's -// API operation DeleteServiceNetworkServiceAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteServiceNetworkServiceAssociation -func (c *VPCLattice) DeleteServiceNetworkServiceAssociation(input *DeleteServiceNetworkServiceAssociationInput) (*DeleteServiceNetworkServiceAssociationOutput, error) { - req, out := c.DeleteServiceNetworkServiceAssociationRequest(input) - return out, req.Send() -} - -// DeleteServiceNetworkServiceAssociationWithContext is the same as DeleteServiceNetworkServiceAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteServiceNetworkServiceAssociation 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 *VPCLattice) DeleteServiceNetworkServiceAssociationWithContext(ctx aws.Context, input *DeleteServiceNetworkServiceAssociationInput, opts ...request.Option) (*DeleteServiceNetworkServiceAssociationOutput, error) { - req, out := c.DeleteServiceNetworkServiceAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteServiceNetworkVpcAssociation = "DeleteServiceNetworkVpcAssociation" - -// DeleteServiceNetworkVpcAssociationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteServiceNetworkVpcAssociation 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 DeleteServiceNetworkVpcAssociation for more information on using the DeleteServiceNetworkVpcAssociation -// 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 DeleteServiceNetworkVpcAssociationRequest method. -// req, resp := client.DeleteServiceNetworkVpcAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteServiceNetworkVpcAssociation -func (c *VPCLattice) DeleteServiceNetworkVpcAssociationRequest(input *DeleteServiceNetworkVpcAssociationInput) (req *request.Request, output *DeleteServiceNetworkVpcAssociationOutput) { - op := &request.Operation{ - Name: opDeleteServiceNetworkVpcAssociation, - HTTPMethod: "DELETE", - HTTPPath: "/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}", - } - - if input == nil { - input = &DeleteServiceNetworkVpcAssociationInput{} - } - - output = &DeleteServiceNetworkVpcAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteServiceNetworkVpcAssociation API operation for Amazon VPC Lattice. -// -// Disassociates the VPC from the service network. You can't disassociate the -// VPC if there is a create or update association in progress. -// -// 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 VPC Lattice's -// API operation DeleteServiceNetworkVpcAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteServiceNetworkVpcAssociation -func (c *VPCLattice) DeleteServiceNetworkVpcAssociation(input *DeleteServiceNetworkVpcAssociationInput) (*DeleteServiceNetworkVpcAssociationOutput, error) { - req, out := c.DeleteServiceNetworkVpcAssociationRequest(input) - return out, req.Send() -} - -// DeleteServiceNetworkVpcAssociationWithContext is the same as DeleteServiceNetworkVpcAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteServiceNetworkVpcAssociation 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 *VPCLattice) DeleteServiceNetworkVpcAssociationWithContext(ctx aws.Context, input *DeleteServiceNetworkVpcAssociationInput, opts ...request.Option) (*DeleteServiceNetworkVpcAssociationOutput, error) { - req, out := c.DeleteServiceNetworkVpcAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTargetGroup = "DeleteTargetGroup" - -// DeleteTargetGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTargetGroup 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 DeleteTargetGroup for more information on using the DeleteTargetGroup -// 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 DeleteTargetGroupRequest method. -// req, resp := client.DeleteTargetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteTargetGroup -func (c *VPCLattice) DeleteTargetGroupRequest(input *DeleteTargetGroupInput) (req *request.Request, output *DeleteTargetGroupOutput) { - op := &request.Operation{ - Name: opDeleteTargetGroup, - HTTPMethod: "DELETE", - HTTPPath: "/targetgroups/{targetGroupIdentifier}", - } - - if input == nil { - input = &DeleteTargetGroupInput{} - } - - output = &DeleteTargetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteTargetGroup API operation for Amazon VPC Lattice. -// -// Deletes a target group. You can't delete a target group if it is used in -// a listener rule or if the target group creation is in progress. -// -// 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 VPC Lattice's -// API operation DeleteTargetGroup for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeleteTargetGroup -func (c *VPCLattice) DeleteTargetGroup(input *DeleteTargetGroupInput) (*DeleteTargetGroupOutput, error) { - req, out := c.DeleteTargetGroupRequest(input) - return out, req.Send() -} - -// DeleteTargetGroupWithContext is the same as DeleteTargetGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTargetGroup 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 *VPCLattice) DeleteTargetGroupWithContext(ctx aws.Context, input *DeleteTargetGroupInput, opts ...request.Option) (*DeleteTargetGroupOutput, error) { - req, out := c.DeleteTargetGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterTargets = "DeregisterTargets" - -// DeregisterTargetsRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterTargets 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 DeregisterTargets for more information on using the DeregisterTargets -// 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 DeregisterTargetsRequest method. -// req, resp := client.DeregisterTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeregisterTargets -func (c *VPCLattice) DeregisterTargetsRequest(input *DeregisterTargetsInput) (req *request.Request, output *DeregisterTargetsOutput) { - op := &request.Operation{ - Name: opDeregisterTargets, - HTTPMethod: "POST", - HTTPPath: "/targetgroups/{targetGroupIdentifier}/deregistertargets", - } - - if input == nil { - input = &DeregisterTargetsInput{} - } - - output = &DeregisterTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeregisterTargets API operation for Amazon VPC Lattice. -// -// Deregisters the specified targets from the specified target group. -// -// 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 VPC Lattice's -// API operation DeregisterTargets for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/DeregisterTargets -func (c *VPCLattice) DeregisterTargets(input *DeregisterTargetsInput) (*DeregisterTargetsOutput, error) { - req, out := c.DeregisterTargetsRequest(input) - return out, req.Send() -} - -// DeregisterTargetsWithContext is the same as DeregisterTargets with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterTargets 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 *VPCLattice) DeregisterTargetsWithContext(ctx aws.Context, input *DeregisterTargetsInput, opts ...request.Option) (*DeregisterTargetsOutput, error) { - req, out := c.DeregisterTargetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAccessLogSubscription = "GetAccessLogSubscription" - -// GetAccessLogSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the GetAccessLogSubscription 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 GetAccessLogSubscription for more information on using the GetAccessLogSubscription -// 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 GetAccessLogSubscriptionRequest method. -// req, resp := client.GetAccessLogSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetAccessLogSubscription -func (c *VPCLattice) GetAccessLogSubscriptionRequest(input *GetAccessLogSubscriptionInput) (req *request.Request, output *GetAccessLogSubscriptionOutput) { - op := &request.Operation{ - Name: opGetAccessLogSubscription, - HTTPMethod: "GET", - HTTPPath: "/accesslogsubscriptions/{accessLogSubscriptionIdentifier}", - } - - if input == nil { - input = &GetAccessLogSubscriptionInput{} - } - - output = &GetAccessLogSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAccessLogSubscription API operation for Amazon VPC Lattice. -// -// Retrieves information about the specified access log subscription. -// -// 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 VPC Lattice's -// API operation GetAccessLogSubscription for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetAccessLogSubscription -func (c *VPCLattice) GetAccessLogSubscription(input *GetAccessLogSubscriptionInput) (*GetAccessLogSubscriptionOutput, error) { - req, out := c.GetAccessLogSubscriptionRequest(input) - return out, req.Send() -} - -// GetAccessLogSubscriptionWithContext is the same as GetAccessLogSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See GetAccessLogSubscription 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 *VPCLattice) GetAccessLogSubscriptionWithContext(ctx aws.Context, input *GetAccessLogSubscriptionInput, opts ...request.Option) (*GetAccessLogSubscriptionOutput, error) { - req, out := c.GetAccessLogSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetAuthPolicy = "GetAuthPolicy" - -// GetAuthPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetAuthPolicy 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 GetAuthPolicy for more information on using the GetAuthPolicy -// 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 GetAuthPolicyRequest method. -// req, resp := client.GetAuthPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetAuthPolicy -func (c *VPCLattice) GetAuthPolicyRequest(input *GetAuthPolicyInput) (req *request.Request, output *GetAuthPolicyOutput) { - op := &request.Operation{ - Name: opGetAuthPolicy, - HTTPMethod: "GET", - HTTPPath: "/authpolicy/{resourceIdentifier}", - } - - if input == nil { - input = &GetAuthPolicyInput{} - } - - output = &GetAuthPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetAuthPolicy API operation for Amazon VPC Lattice. -// -// Retrieves information about the auth policy for the specified service or -// service network. -// -// 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 VPC Lattice's -// API operation GetAuthPolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetAuthPolicy -func (c *VPCLattice) GetAuthPolicy(input *GetAuthPolicyInput) (*GetAuthPolicyOutput, error) { - req, out := c.GetAuthPolicyRequest(input) - return out, req.Send() -} - -// GetAuthPolicyWithContext is the same as GetAuthPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetAuthPolicy 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 *VPCLattice) GetAuthPolicyWithContext(ctx aws.Context, input *GetAuthPolicyInput, opts ...request.Option) (*GetAuthPolicyOutput, error) { - req, out := c.GetAuthPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetListener = "GetListener" - -// GetListenerRequest generates a "aws/request.Request" representing the -// client's request for the GetListener 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 GetListener for more information on using the GetListener -// 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 GetListenerRequest method. -// req, resp := client.GetListenerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetListener -func (c *VPCLattice) GetListenerRequest(input *GetListenerInput) (req *request.Request, output *GetListenerOutput) { - op := &request.Operation{ - Name: opGetListener, - HTTPMethod: "GET", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}", - } - - if input == nil { - input = &GetListenerInput{} - } - - output = &GetListenerOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetListener API operation for Amazon VPC Lattice. -// -// Retrieves information about the specified listener for the specified 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 VPC Lattice's -// API operation GetListener for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetListener -func (c *VPCLattice) GetListener(input *GetListenerInput) (*GetListenerOutput, error) { - req, out := c.GetListenerRequest(input) - return out, req.Send() -} - -// GetListenerWithContext is the same as GetListener with the addition of -// the ability to pass a context and additional request options. -// -// See GetListener 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 *VPCLattice) GetListenerWithContext(ctx aws.Context, input *GetListenerInput, opts ...request.Option) (*GetListenerOutput, error) { - req, out := c.GetListenerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetResourcePolicy = "GetResourcePolicy" - -// GetResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetResourcePolicy 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 GetResourcePolicy for more information on using the GetResourcePolicy -// 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 GetResourcePolicyRequest method. -// req, resp := client.GetResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetResourcePolicy -func (c *VPCLattice) GetResourcePolicyRequest(input *GetResourcePolicyInput) (req *request.Request, output *GetResourcePolicyOutput) { - op := &request.Operation{ - Name: opGetResourcePolicy, - HTTPMethod: "GET", - HTTPPath: "/resourcepolicy/{resourceArn}", - } - - if input == nil { - input = &GetResourcePolicyInput{} - } - - output = &GetResourcePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetResourcePolicy API operation for Amazon VPC Lattice. -// -// Retrieves information about the resource policy. The resource policy is an -// IAM policy created by AWS RAM on behalf of the resource owner when they share -// a resource. -// -// 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 VPC Lattice's -// API operation GetResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetResourcePolicy -func (c *VPCLattice) GetResourcePolicy(input *GetResourcePolicyInput) (*GetResourcePolicyOutput, error) { - req, out := c.GetResourcePolicyRequest(input) - return out, req.Send() -} - -// GetResourcePolicyWithContext is the same as GetResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetResourcePolicy 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 *VPCLattice) GetResourcePolicyWithContext(ctx aws.Context, input *GetResourcePolicyInput, opts ...request.Option) (*GetResourcePolicyOutput, error) { - req, out := c.GetResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRule = "GetRule" - -// GetRuleRequest generates a "aws/request.Request" representing the -// client's request for the GetRule 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 GetRule for more information on using the GetRule -// 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 GetRuleRequest method. -// req, resp := client.GetRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetRule -func (c *VPCLattice) GetRuleRequest(input *GetRuleInput) (req *request.Request, output *GetRuleOutput) { - op := &request.Operation{ - Name: opGetRule, - HTTPMethod: "GET", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}", - } - - if input == nil { - input = &GetRuleInput{} - } - - output = &GetRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRule API operation for Amazon VPC Lattice. -// -// Retrieves information about listener rules. You can also retrieve information -// about the default listener rule. For more information, see Listener rules -// (https://docs.aws.amazon.com/vpc-lattice/latest/ug/listeners.html#listener-rules) -// in the Amazon VPC Lattice User Guide. -// -// 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 VPC Lattice's -// API operation GetRule for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetRule -func (c *VPCLattice) GetRule(input *GetRuleInput) (*GetRuleOutput, error) { - req, out := c.GetRuleRequest(input) - return out, req.Send() -} - -// GetRuleWithContext is the same as GetRule with the addition of -// the ability to pass a context and additional request options. -// -// See GetRule 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 *VPCLattice) GetRuleWithContext(ctx aws.Context, input *GetRuleInput, opts ...request.Option) (*GetRuleOutput, error) { - req, out := c.GetRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetService = "GetService" - -// GetServiceRequest generates a "aws/request.Request" representing the -// client's request for the GetService 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 GetService for more information on using the GetService -// 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 GetServiceRequest method. -// req, resp := client.GetServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetService -func (c *VPCLattice) GetServiceRequest(input *GetServiceInput) (req *request.Request, output *GetServiceOutput) { - op := &request.Operation{ - Name: opGetService, - HTTPMethod: "GET", - HTTPPath: "/services/{serviceIdentifier}", - } - - if input == nil { - input = &GetServiceInput{} - } - - output = &GetServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetService API operation for Amazon VPC Lattice. -// -// Retrieves information about the specified 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 VPC Lattice's -// API operation GetService for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetService -func (c *VPCLattice) GetService(input *GetServiceInput) (*GetServiceOutput, error) { - req, out := c.GetServiceRequest(input) - return out, req.Send() -} - -// GetServiceWithContext is the same as GetService with the addition of -// the ability to pass a context and additional request options. -// -// See GetService 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 *VPCLattice) GetServiceWithContext(ctx aws.Context, input *GetServiceInput, opts ...request.Option) (*GetServiceOutput, error) { - req, out := c.GetServiceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetServiceNetwork = "GetServiceNetwork" - -// GetServiceNetworkRequest generates a "aws/request.Request" representing the -// client's request for the GetServiceNetwork 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 GetServiceNetwork for more information on using the GetServiceNetwork -// 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 GetServiceNetworkRequest method. -// req, resp := client.GetServiceNetworkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetServiceNetwork -func (c *VPCLattice) GetServiceNetworkRequest(input *GetServiceNetworkInput) (req *request.Request, output *GetServiceNetworkOutput) { - op := &request.Operation{ - Name: opGetServiceNetwork, - HTTPMethod: "GET", - HTTPPath: "/servicenetworks/{serviceNetworkIdentifier}", - } - - if input == nil { - input = &GetServiceNetworkInput{} - } - - output = &GetServiceNetworkOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetServiceNetwork API operation for Amazon VPC Lattice. -// -// Retrieves information about the specified service network. -// -// 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 VPC Lattice's -// API operation GetServiceNetwork for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetServiceNetwork -func (c *VPCLattice) GetServiceNetwork(input *GetServiceNetworkInput) (*GetServiceNetworkOutput, error) { - req, out := c.GetServiceNetworkRequest(input) - return out, req.Send() -} - -// GetServiceNetworkWithContext is the same as GetServiceNetwork with the addition of -// the ability to pass a context and additional request options. -// -// See GetServiceNetwork 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 *VPCLattice) GetServiceNetworkWithContext(ctx aws.Context, input *GetServiceNetworkInput, opts ...request.Option) (*GetServiceNetworkOutput, error) { - req, out := c.GetServiceNetworkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetServiceNetworkServiceAssociation = "GetServiceNetworkServiceAssociation" - -// GetServiceNetworkServiceAssociationRequest generates a "aws/request.Request" representing the -// client's request for the GetServiceNetworkServiceAssociation 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 GetServiceNetworkServiceAssociation for more information on using the GetServiceNetworkServiceAssociation -// 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 GetServiceNetworkServiceAssociationRequest method. -// req, resp := client.GetServiceNetworkServiceAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetServiceNetworkServiceAssociation -func (c *VPCLattice) GetServiceNetworkServiceAssociationRequest(input *GetServiceNetworkServiceAssociationInput) (req *request.Request, output *GetServiceNetworkServiceAssociationOutput) { - op := &request.Operation{ - Name: opGetServiceNetworkServiceAssociation, - HTTPMethod: "GET", - HTTPPath: "/servicenetworkserviceassociations/{serviceNetworkServiceAssociationIdentifier}", - } - - if input == nil { - input = &GetServiceNetworkServiceAssociationInput{} - } - - output = &GetServiceNetworkServiceAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetServiceNetworkServiceAssociation API operation for Amazon VPC Lattice. -// -// Retrieves information about the specified association between a service network -// and a 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 VPC Lattice's -// API operation GetServiceNetworkServiceAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetServiceNetworkServiceAssociation -func (c *VPCLattice) GetServiceNetworkServiceAssociation(input *GetServiceNetworkServiceAssociationInput) (*GetServiceNetworkServiceAssociationOutput, error) { - req, out := c.GetServiceNetworkServiceAssociationRequest(input) - return out, req.Send() -} - -// GetServiceNetworkServiceAssociationWithContext is the same as GetServiceNetworkServiceAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See GetServiceNetworkServiceAssociation 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 *VPCLattice) GetServiceNetworkServiceAssociationWithContext(ctx aws.Context, input *GetServiceNetworkServiceAssociationInput, opts ...request.Option) (*GetServiceNetworkServiceAssociationOutput, error) { - req, out := c.GetServiceNetworkServiceAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetServiceNetworkVpcAssociation = "GetServiceNetworkVpcAssociation" - -// GetServiceNetworkVpcAssociationRequest generates a "aws/request.Request" representing the -// client's request for the GetServiceNetworkVpcAssociation 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 GetServiceNetworkVpcAssociation for more information on using the GetServiceNetworkVpcAssociation -// 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 GetServiceNetworkVpcAssociationRequest method. -// req, resp := client.GetServiceNetworkVpcAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetServiceNetworkVpcAssociation -func (c *VPCLattice) GetServiceNetworkVpcAssociationRequest(input *GetServiceNetworkVpcAssociationInput) (req *request.Request, output *GetServiceNetworkVpcAssociationOutput) { - op := &request.Operation{ - Name: opGetServiceNetworkVpcAssociation, - HTTPMethod: "GET", - HTTPPath: "/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}", - } - - if input == nil { - input = &GetServiceNetworkVpcAssociationInput{} - } - - output = &GetServiceNetworkVpcAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetServiceNetworkVpcAssociation API operation for Amazon VPC Lattice. -// -// Retrieves information about the association between a service network and -// a VPC. -// -// 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 VPC Lattice's -// API operation GetServiceNetworkVpcAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetServiceNetworkVpcAssociation -func (c *VPCLattice) GetServiceNetworkVpcAssociation(input *GetServiceNetworkVpcAssociationInput) (*GetServiceNetworkVpcAssociationOutput, error) { - req, out := c.GetServiceNetworkVpcAssociationRequest(input) - return out, req.Send() -} - -// GetServiceNetworkVpcAssociationWithContext is the same as GetServiceNetworkVpcAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See GetServiceNetworkVpcAssociation 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 *VPCLattice) GetServiceNetworkVpcAssociationWithContext(ctx aws.Context, input *GetServiceNetworkVpcAssociationInput, opts ...request.Option) (*GetServiceNetworkVpcAssociationOutput, error) { - req, out := c.GetServiceNetworkVpcAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTargetGroup = "GetTargetGroup" - -// GetTargetGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetTargetGroup 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 GetTargetGroup for more information on using the GetTargetGroup -// 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 GetTargetGroupRequest method. -// req, resp := client.GetTargetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetTargetGroup -func (c *VPCLattice) GetTargetGroupRequest(input *GetTargetGroupInput) (req *request.Request, output *GetTargetGroupOutput) { - op := &request.Operation{ - Name: opGetTargetGroup, - HTTPMethod: "GET", - HTTPPath: "/targetgroups/{targetGroupIdentifier}", - } - - if input == nil { - input = &GetTargetGroupInput{} - } - - output = &GetTargetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTargetGroup API operation for Amazon VPC Lattice. -// -// Retrieves information about the specified target group. -// -// 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 VPC Lattice's -// API operation GetTargetGroup for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/GetTargetGroup -func (c *VPCLattice) GetTargetGroup(input *GetTargetGroupInput) (*GetTargetGroupOutput, error) { - req, out := c.GetTargetGroupRequest(input) - return out, req.Send() -} - -// GetTargetGroupWithContext is the same as GetTargetGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetTargetGroup 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 *VPCLattice) GetTargetGroupWithContext(ctx aws.Context, input *GetTargetGroupInput, opts ...request.Option) (*GetTargetGroupOutput, error) { - req, out := c.GetTargetGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAccessLogSubscriptions = "ListAccessLogSubscriptions" - -// ListAccessLogSubscriptionsRequest generates a "aws/request.Request" representing the -// client's request for the ListAccessLogSubscriptions 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 ListAccessLogSubscriptions for more information on using the ListAccessLogSubscriptions -// 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 ListAccessLogSubscriptionsRequest method. -// req, resp := client.ListAccessLogSubscriptionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListAccessLogSubscriptions -func (c *VPCLattice) ListAccessLogSubscriptionsRequest(input *ListAccessLogSubscriptionsInput) (req *request.Request, output *ListAccessLogSubscriptionsOutput) { - op := &request.Operation{ - Name: opListAccessLogSubscriptions, - HTTPMethod: "GET", - HTTPPath: "/accesslogsubscriptions", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAccessLogSubscriptionsInput{} - } - - output = &ListAccessLogSubscriptionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAccessLogSubscriptions API operation for Amazon VPC Lattice. -// -// Lists all access log subscriptions for the specified service network or 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 VPC Lattice's -// API operation ListAccessLogSubscriptions for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListAccessLogSubscriptions -func (c *VPCLattice) ListAccessLogSubscriptions(input *ListAccessLogSubscriptionsInput) (*ListAccessLogSubscriptionsOutput, error) { - req, out := c.ListAccessLogSubscriptionsRequest(input) - return out, req.Send() -} - -// ListAccessLogSubscriptionsWithContext is the same as ListAccessLogSubscriptions with the addition of -// the ability to pass a context and additional request options. -// -// See ListAccessLogSubscriptions 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 *VPCLattice) ListAccessLogSubscriptionsWithContext(ctx aws.Context, input *ListAccessLogSubscriptionsInput, opts ...request.Option) (*ListAccessLogSubscriptionsOutput, error) { - req, out := c.ListAccessLogSubscriptionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAccessLogSubscriptionsPages iterates over the pages of a ListAccessLogSubscriptions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccessLogSubscriptions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAccessLogSubscriptions operation. -// pageNum := 0 -// err := client.ListAccessLogSubscriptionsPages(params, -// func(page *vpclattice.ListAccessLogSubscriptionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListAccessLogSubscriptionsPages(input *ListAccessLogSubscriptionsInput, fn func(*ListAccessLogSubscriptionsOutput, bool) bool) error { - return c.ListAccessLogSubscriptionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccessLogSubscriptionsPagesWithContext same as ListAccessLogSubscriptionsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListAccessLogSubscriptionsPagesWithContext(ctx aws.Context, input *ListAccessLogSubscriptionsInput, fn func(*ListAccessLogSubscriptionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAccessLogSubscriptionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAccessLogSubscriptionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAccessLogSubscriptionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListListeners = "ListListeners" - -// ListListenersRequest generates a "aws/request.Request" representing the -// client's request for the ListListeners 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 ListListeners for more information on using the ListListeners -// 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 ListListenersRequest method. -// req, resp := client.ListListenersRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListListeners -func (c *VPCLattice) ListListenersRequest(input *ListListenersInput) (req *request.Request, output *ListListenersOutput) { - op := &request.Operation{ - Name: opListListeners, - HTTPMethod: "GET", - HTTPPath: "/services/{serviceIdentifier}/listeners", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListListenersInput{} - } - - output = &ListListenersOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListListeners API operation for Amazon VPC Lattice. -// -// Lists the listeners for the specified 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 VPC Lattice's -// API operation ListListeners for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListListeners -func (c *VPCLattice) ListListeners(input *ListListenersInput) (*ListListenersOutput, error) { - req, out := c.ListListenersRequest(input) - return out, req.Send() -} - -// ListListenersWithContext is the same as ListListeners with the addition of -// the ability to pass a context and additional request options. -// -// See ListListeners 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 *VPCLattice) ListListenersWithContext(ctx aws.Context, input *ListListenersInput, opts ...request.Option) (*ListListenersOutput, error) { - req, out := c.ListListenersRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListListenersPages iterates over the pages of a ListListeners operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListListeners method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListListeners operation. -// pageNum := 0 -// err := client.ListListenersPages(params, -// func(page *vpclattice.ListListenersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListListenersPages(input *ListListenersInput, fn func(*ListListenersOutput, bool) bool) error { - return c.ListListenersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListListenersPagesWithContext same as ListListenersPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListListenersPagesWithContext(ctx aws.Context, input *ListListenersInput, fn func(*ListListenersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListListenersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListListenersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListListenersOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRules = "ListRules" - -// ListRulesRequest generates a "aws/request.Request" representing the -// client's request for the ListRules 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 ListRules for more information on using the ListRules -// 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 ListRulesRequest method. -// req, resp := client.ListRulesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListRules -func (c *VPCLattice) ListRulesRequest(input *ListRulesInput) (req *request.Request, output *ListRulesOutput) { - op := &request.Operation{ - Name: opListRules, - HTTPMethod: "GET", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRulesInput{} - } - - output = &ListRulesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRules API operation for Amazon VPC Lattice. -// -// Lists the rules for the listener. -// -// 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 VPC Lattice's -// API operation ListRules for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListRules -func (c *VPCLattice) ListRules(input *ListRulesInput) (*ListRulesOutput, error) { - req, out := c.ListRulesRequest(input) - return out, req.Send() -} - -// ListRulesWithContext is the same as ListRules with the addition of -// the ability to pass a context and additional request options. -// -// See ListRules 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 *VPCLattice) ListRulesWithContext(ctx aws.Context, input *ListRulesInput, opts ...request.Option) (*ListRulesOutput, error) { - req, out := c.ListRulesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRulesPages iterates over the pages of a ListRules operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRules method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRules operation. -// pageNum := 0 -// err := client.ListRulesPages(params, -// func(page *vpclattice.ListRulesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListRulesPages(input *ListRulesInput, fn func(*ListRulesOutput, bool) bool) error { - return c.ListRulesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRulesPagesWithContext same as ListRulesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListRulesPagesWithContext(ctx aws.Context, input *ListRulesInput, fn func(*ListRulesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRulesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRulesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRulesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListServiceNetworkServiceAssociations = "ListServiceNetworkServiceAssociations" - -// ListServiceNetworkServiceAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the ListServiceNetworkServiceAssociations 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 ListServiceNetworkServiceAssociations for more information on using the ListServiceNetworkServiceAssociations -// 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 ListServiceNetworkServiceAssociationsRequest method. -// req, resp := client.ListServiceNetworkServiceAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListServiceNetworkServiceAssociations -func (c *VPCLattice) ListServiceNetworkServiceAssociationsRequest(input *ListServiceNetworkServiceAssociationsInput) (req *request.Request, output *ListServiceNetworkServiceAssociationsOutput) { - op := &request.Operation{ - Name: opListServiceNetworkServiceAssociations, - HTTPMethod: "GET", - HTTPPath: "/servicenetworkserviceassociations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListServiceNetworkServiceAssociationsInput{} - } - - output = &ListServiceNetworkServiceAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServiceNetworkServiceAssociations API operation for Amazon VPC Lattice. -// -// Lists the associations between the service network and the service. You can -// filter the list either by service or service network. You must provide either -// the service network identifier or the service identifier. -// -// Every association in Amazon VPC Lattice is given a unique Amazon Resource -// Name (ARN), such as when a service network is associated with a VPC or when -// a service is associated with a service network. If the association is for -// a resource that is shared with another account, the association will include -// the local account ID as the prefix in the ARN for each account the resource -// is shared with. -// -// 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 VPC Lattice's -// API operation ListServiceNetworkServiceAssociations for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListServiceNetworkServiceAssociations -func (c *VPCLattice) ListServiceNetworkServiceAssociations(input *ListServiceNetworkServiceAssociationsInput) (*ListServiceNetworkServiceAssociationsOutput, error) { - req, out := c.ListServiceNetworkServiceAssociationsRequest(input) - return out, req.Send() -} - -// ListServiceNetworkServiceAssociationsWithContext is the same as ListServiceNetworkServiceAssociations with the addition of -// the ability to pass a context and additional request options. -// -// See ListServiceNetworkServiceAssociations 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 *VPCLattice) ListServiceNetworkServiceAssociationsWithContext(ctx aws.Context, input *ListServiceNetworkServiceAssociationsInput, opts ...request.Option) (*ListServiceNetworkServiceAssociationsOutput, error) { - req, out := c.ListServiceNetworkServiceAssociationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListServiceNetworkServiceAssociationsPages iterates over the pages of a ListServiceNetworkServiceAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServiceNetworkServiceAssociations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListServiceNetworkServiceAssociations operation. -// pageNum := 0 -// err := client.ListServiceNetworkServiceAssociationsPages(params, -// func(page *vpclattice.ListServiceNetworkServiceAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListServiceNetworkServiceAssociationsPages(input *ListServiceNetworkServiceAssociationsInput, fn func(*ListServiceNetworkServiceAssociationsOutput, bool) bool) error { - return c.ListServiceNetworkServiceAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServiceNetworkServiceAssociationsPagesWithContext same as ListServiceNetworkServiceAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListServiceNetworkServiceAssociationsPagesWithContext(ctx aws.Context, input *ListServiceNetworkServiceAssociationsInput, fn func(*ListServiceNetworkServiceAssociationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListServiceNetworkServiceAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListServiceNetworkServiceAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListServiceNetworkServiceAssociationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListServiceNetworkVpcAssociations = "ListServiceNetworkVpcAssociations" - -// ListServiceNetworkVpcAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the ListServiceNetworkVpcAssociations 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 ListServiceNetworkVpcAssociations for more information on using the ListServiceNetworkVpcAssociations -// 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 ListServiceNetworkVpcAssociationsRequest method. -// req, resp := client.ListServiceNetworkVpcAssociationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListServiceNetworkVpcAssociations -func (c *VPCLattice) ListServiceNetworkVpcAssociationsRequest(input *ListServiceNetworkVpcAssociationsInput) (req *request.Request, output *ListServiceNetworkVpcAssociationsOutput) { - op := &request.Operation{ - Name: opListServiceNetworkVpcAssociations, - HTTPMethod: "GET", - HTTPPath: "/servicenetworkvpcassociations", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListServiceNetworkVpcAssociationsInput{} - } - - output = &ListServiceNetworkVpcAssociationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServiceNetworkVpcAssociations API operation for Amazon VPC Lattice. -// -// Lists the service network and VPC associations. You can filter the list either -// by VPC or service network. You must provide either the service network identifier -// or the VPC identifier. -// -// 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 VPC Lattice's -// API operation ListServiceNetworkVpcAssociations for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListServiceNetworkVpcAssociations -func (c *VPCLattice) ListServiceNetworkVpcAssociations(input *ListServiceNetworkVpcAssociationsInput) (*ListServiceNetworkVpcAssociationsOutput, error) { - req, out := c.ListServiceNetworkVpcAssociationsRequest(input) - return out, req.Send() -} - -// ListServiceNetworkVpcAssociationsWithContext is the same as ListServiceNetworkVpcAssociations with the addition of -// the ability to pass a context and additional request options. -// -// See ListServiceNetworkVpcAssociations 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 *VPCLattice) ListServiceNetworkVpcAssociationsWithContext(ctx aws.Context, input *ListServiceNetworkVpcAssociationsInput, opts ...request.Option) (*ListServiceNetworkVpcAssociationsOutput, error) { - req, out := c.ListServiceNetworkVpcAssociationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListServiceNetworkVpcAssociationsPages iterates over the pages of a ListServiceNetworkVpcAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServiceNetworkVpcAssociations method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListServiceNetworkVpcAssociations operation. -// pageNum := 0 -// err := client.ListServiceNetworkVpcAssociationsPages(params, -// func(page *vpclattice.ListServiceNetworkVpcAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListServiceNetworkVpcAssociationsPages(input *ListServiceNetworkVpcAssociationsInput, fn func(*ListServiceNetworkVpcAssociationsOutput, bool) bool) error { - return c.ListServiceNetworkVpcAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServiceNetworkVpcAssociationsPagesWithContext same as ListServiceNetworkVpcAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListServiceNetworkVpcAssociationsPagesWithContext(ctx aws.Context, input *ListServiceNetworkVpcAssociationsInput, fn func(*ListServiceNetworkVpcAssociationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListServiceNetworkVpcAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListServiceNetworkVpcAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListServiceNetworkVpcAssociationsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListServiceNetworks = "ListServiceNetworks" - -// ListServiceNetworksRequest generates a "aws/request.Request" representing the -// client's request for the ListServiceNetworks 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 ListServiceNetworks for more information on using the ListServiceNetworks -// 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 ListServiceNetworksRequest method. -// req, resp := client.ListServiceNetworksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListServiceNetworks -func (c *VPCLattice) ListServiceNetworksRequest(input *ListServiceNetworksInput) (req *request.Request, output *ListServiceNetworksOutput) { - op := &request.Operation{ - Name: opListServiceNetworks, - HTTPMethod: "GET", - HTTPPath: "/servicenetworks", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListServiceNetworksInput{} - } - - output = &ListServiceNetworksOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServiceNetworks API operation for Amazon VPC Lattice. -// -// Lists the service networks owned by the caller account or shared with the -// caller account. Also includes the account ID in the ARN to show which account -// owns the service network. -// -// 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 VPC Lattice's -// API operation ListServiceNetworks for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListServiceNetworks -func (c *VPCLattice) ListServiceNetworks(input *ListServiceNetworksInput) (*ListServiceNetworksOutput, error) { - req, out := c.ListServiceNetworksRequest(input) - return out, req.Send() -} - -// ListServiceNetworksWithContext is the same as ListServiceNetworks with the addition of -// the ability to pass a context and additional request options. -// -// See ListServiceNetworks 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 *VPCLattice) ListServiceNetworksWithContext(ctx aws.Context, input *ListServiceNetworksInput, opts ...request.Option) (*ListServiceNetworksOutput, error) { - req, out := c.ListServiceNetworksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListServiceNetworksPages iterates over the pages of a ListServiceNetworks operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServiceNetworks method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListServiceNetworks operation. -// pageNum := 0 -// err := client.ListServiceNetworksPages(params, -// func(page *vpclattice.ListServiceNetworksOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListServiceNetworksPages(input *ListServiceNetworksInput, fn func(*ListServiceNetworksOutput, bool) bool) error { - return c.ListServiceNetworksPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServiceNetworksPagesWithContext same as ListServiceNetworksPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListServiceNetworksPagesWithContext(ctx aws.Context, input *ListServiceNetworksInput, fn func(*ListServiceNetworksOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListServiceNetworksInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListServiceNetworksRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListServiceNetworksOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListServices = "ListServices" - -// ListServicesRequest generates a "aws/request.Request" representing the -// client's request for the ListServices 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 ListServices for more information on using the ListServices -// 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 ListServicesRequest method. -// req, resp := client.ListServicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListServices -func (c *VPCLattice) ListServicesRequest(input *ListServicesInput) (req *request.Request, output *ListServicesOutput) { - op := &request.Operation{ - Name: opListServices, - HTTPMethod: "GET", - HTTPPath: "/services", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListServicesInput{} - } - - output = &ListServicesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListServices API operation for Amazon VPC Lattice. -// -// Lists the services owned by the caller account or shared with the caller -// account. -// -// 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 VPC Lattice's -// API operation ListServices for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListServices -func (c *VPCLattice) ListServices(input *ListServicesInput) (*ListServicesOutput, error) { - req, out := c.ListServicesRequest(input) - return out, req.Send() -} - -// ListServicesWithContext is the same as ListServices with the addition of -// the ability to pass a context and additional request options. -// -// See ListServices 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 *VPCLattice) ListServicesWithContext(ctx aws.Context, input *ListServicesInput, opts ...request.Option) (*ListServicesOutput, error) { - req, out := c.ListServicesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListServicesPages iterates over the pages of a ListServices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListServices method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListServices operation. -// pageNum := 0 -// err := client.ListServicesPages(params, -// func(page *vpclattice.ListServicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListServicesPages(input *ListServicesInput, fn func(*ListServicesOutput, bool) bool) error { - return c.ListServicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListServicesPagesWithContext same as ListServicesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListServicesPagesWithContext(ctx aws.Context, input *ListServicesInput, fn func(*ListServicesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListServicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListServicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListTagsForResource -func (c *VPCLattice) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for Amazon VPC Lattice. -// -// Lists the tags for the specified resource. -// -// 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 VPC Lattice's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListTagsForResource -func (c *VPCLattice) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *VPCLattice) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTargetGroups = "ListTargetGroups" - -// ListTargetGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListTargetGroups 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 ListTargetGroups for more information on using the ListTargetGroups -// 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 ListTargetGroupsRequest method. -// req, resp := client.ListTargetGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListTargetGroups -func (c *VPCLattice) ListTargetGroupsRequest(input *ListTargetGroupsInput) (req *request.Request, output *ListTargetGroupsOutput) { - op := &request.Operation{ - Name: opListTargetGroups, - HTTPMethod: "GET", - HTTPPath: "/targetgroups", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTargetGroupsInput{} - } - - output = &ListTargetGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTargetGroups API operation for Amazon VPC Lattice. -// -// Lists your target groups. You can narrow your search by using the filters -// below in your request. -// -// 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 VPC Lattice's -// API operation ListTargetGroups for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListTargetGroups -func (c *VPCLattice) ListTargetGroups(input *ListTargetGroupsInput) (*ListTargetGroupsOutput, error) { - req, out := c.ListTargetGroupsRequest(input) - return out, req.Send() -} - -// ListTargetGroupsWithContext is the same as ListTargetGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListTargetGroups 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 *VPCLattice) ListTargetGroupsWithContext(ctx aws.Context, input *ListTargetGroupsInput, opts ...request.Option) (*ListTargetGroupsOutput, error) { - req, out := c.ListTargetGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTargetGroupsPages iterates over the pages of a ListTargetGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTargetGroups method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTargetGroups operation. -// pageNum := 0 -// err := client.ListTargetGroupsPages(params, -// func(page *vpclattice.ListTargetGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListTargetGroupsPages(input *ListTargetGroupsInput, fn func(*ListTargetGroupsOutput, bool) bool) error { - return c.ListTargetGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTargetGroupsPagesWithContext same as ListTargetGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListTargetGroupsPagesWithContext(ctx aws.Context, input *ListTargetGroupsInput, fn func(*ListTargetGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTargetGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTargetGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTargetGroupsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTargets = "ListTargets" - -// ListTargetsRequest generates a "aws/request.Request" representing the -// client's request for the ListTargets 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 ListTargets for more information on using the ListTargets -// 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 ListTargetsRequest method. -// req, resp := client.ListTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListTargets -func (c *VPCLattice) ListTargetsRequest(input *ListTargetsInput) (req *request.Request, output *ListTargetsOutput) { - op := &request.Operation{ - Name: opListTargets, - HTTPMethod: "POST", - HTTPPath: "/targetgroups/{targetGroupIdentifier}/listtargets", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTargetsInput{} - } - - output = &ListTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTargets API operation for Amazon VPC Lattice. -// -// Lists the targets for the target group. By default, all targets are included. -// You can use this API to check the health status of targets. You can also -// filter the results by target. -// -// 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 VPC Lattice's -// API operation ListTargets for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/ListTargets -func (c *VPCLattice) ListTargets(input *ListTargetsInput) (*ListTargetsOutput, error) { - req, out := c.ListTargetsRequest(input) - return out, req.Send() -} - -// ListTargetsWithContext is the same as ListTargets with the addition of -// the ability to pass a context and additional request options. -// -// See ListTargets 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 *VPCLattice) ListTargetsWithContext(ctx aws.Context, input *ListTargetsInput, opts ...request.Option) (*ListTargetsOutput, error) { - req, out := c.ListTargetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTargetsPages iterates over the pages of a ListTargets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTargets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTargets operation. -// pageNum := 0 -// err := client.ListTargetsPages(params, -// func(page *vpclattice.ListTargetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *VPCLattice) ListTargetsPages(input *ListTargetsInput, fn func(*ListTargetsOutput, bool) bool) error { - return c.ListTargetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTargetsPagesWithContext same as ListTargetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *VPCLattice) ListTargetsPagesWithContext(ctx aws.Context, input *ListTargetsInput, fn func(*ListTargetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTargetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTargetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTargetsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutAuthPolicy = "PutAuthPolicy" - -// PutAuthPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutAuthPolicy 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 PutAuthPolicy for more information on using the PutAuthPolicy -// 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 PutAuthPolicyRequest method. -// req, resp := client.PutAuthPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/PutAuthPolicy -func (c *VPCLattice) PutAuthPolicyRequest(input *PutAuthPolicyInput) (req *request.Request, output *PutAuthPolicyOutput) { - op := &request.Operation{ - Name: opPutAuthPolicy, - HTTPMethod: "PUT", - HTTPPath: "/authpolicy/{resourceIdentifier}", - } - - if input == nil { - input = &PutAuthPolicyInput{} - } - - output = &PutAuthPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutAuthPolicy API operation for Amazon VPC Lattice. -// -// Creates or updates the auth policy. -// -// 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 VPC Lattice's -// API operation PutAuthPolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/PutAuthPolicy -func (c *VPCLattice) PutAuthPolicy(input *PutAuthPolicyInput) (*PutAuthPolicyOutput, error) { - req, out := c.PutAuthPolicyRequest(input) - return out, req.Send() -} - -// PutAuthPolicyWithContext is the same as PutAuthPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutAuthPolicy 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 *VPCLattice) PutAuthPolicyWithContext(ctx aws.Context, input *PutAuthPolicyInput, opts ...request.Option) (*PutAuthPolicyOutput, error) { - req, out := c.PutAuthPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutResourcePolicy = "PutResourcePolicy" - -// PutResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutResourcePolicy 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 PutResourcePolicy for more information on using the PutResourcePolicy -// 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 PutResourcePolicyRequest method. -// req, resp := client.PutResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/PutResourcePolicy -func (c *VPCLattice) PutResourcePolicyRequest(input *PutResourcePolicyInput) (req *request.Request, output *PutResourcePolicyOutput) { - op := &request.Operation{ - Name: opPutResourcePolicy, - HTTPMethod: "PUT", - HTTPPath: "/resourcepolicy/{resourceArn}", - } - - if input == nil { - input = &PutResourcePolicyInput{} - } - - output = &PutResourcePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutResourcePolicy API operation for Amazon VPC Lattice. -// -// Attaches a resource-based permission policy to a service or service network. -// The policy must contain the same actions and condition statements as the -// Amazon Web Services Resource Access Manager permission for sharing services -// and service networks. -// -// 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 VPC Lattice's -// API operation PutResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/PutResourcePolicy -func (c *VPCLattice) PutResourcePolicy(input *PutResourcePolicyInput) (*PutResourcePolicyOutput, error) { - req, out := c.PutResourcePolicyRequest(input) - return out, req.Send() -} - -// PutResourcePolicyWithContext is the same as PutResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutResourcePolicy 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 *VPCLattice) PutResourcePolicyWithContext(ctx aws.Context, input *PutResourcePolicyInput, opts ...request.Option) (*PutResourcePolicyOutput, error) { - req, out := c.PutResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterTargets = "RegisterTargets" - -// RegisterTargetsRequest generates a "aws/request.Request" representing the -// client's request for the RegisterTargets 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 RegisterTargets for more information on using the RegisterTargets -// 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 RegisterTargetsRequest method. -// req, resp := client.RegisterTargetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/RegisterTargets -func (c *VPCLattice) RegisterTargetsRequest(input *RegisterTargetsInput) (req *request.Request, output *RegisterTargetsOutput) { - op := &request.Operation{ - Name: opRegisterTargets, - HTTPMethod: "POST", - HTTPPath: "/targetgroups/{targetGroupIdentifier}/registertargets", - } - - if input == nil { - input = &RegisterTargetsInput{} - } - - output = &RegisterTargetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// RegisterTargets API operation for Amazon VPC Lattice. -// -// Registers the targets with the target group. If it's a Lambda target, you -// can only have one target in a target group. -// -// 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 VPC Lattice's -// API operation RegisterTargets for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - ServiceQuotaExceededException -// The request would cause a service quota to be exceeded. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/RegisterTargets -func (c *VPCLattice) RegisterTargets(input *RegisterTargetsInput) (*RegisterTargetsOutput, error) { - req, out := c.RegisterTargetsRequest(input) - return out, req.Send() -} - -// RegisterTargetsWithContext is the same as RegisterTargets with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterTargets 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 *VPCLattice) RegisterTargetsWithContext(ctx aws.Context, input *RegisterTargetsInput, opts ...request.Option) (*RegisterTargetsOutput, error) { - req, out := c.RegisterTargetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/TagResource -func (c *VPCLattice) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for Amazon VPC Lattice. -// -// Adds the specified tags to the specified resource. -// -// 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 VPC Lattice's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/TagResource -func (c *VPCLattice) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *VPCLattice) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UntagResource -func (c *VPCLattice) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for Amazon VPC Lattice. -// -// Removes the specified tags from the specified resource. -// -// 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 VPC Lattice's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UntagResource -func (c *VPCLattice) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *VPCLattice) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateAccessLogSubscription = "UpdateAccessLogSubscription" - -// UpdateAccessLogSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAccessLogSubscription 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 UpdateAccessLogSubscription for more information on using the UpdateAccessLogSubscription -// 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 UpdateAccessLogSubscriptionRequest method. -// req, resp := client.UpdateAccessLogSubscriptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateAccessLogSubscription -func (c *VPCLattice) UpdateAccessLogSubscriptionRequest(input *UpdateAccessLogSubscriptionInput) (req *request.Request, output *UpdateAccessLogSubscriptionOutput) { - op := &request.Operation{ - Name: opUpdateAccessLogSubscription, - HTTPMethod: "PATCH", - HTTPPath: "/accesslogsubscriptions/{accessLogSubscriptionIdentifier}", - } - - if input == nil { - input = &UpdateAccessLogSubscriptionInput{} - } - - output = &UpdateAccessLogSubscriptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateAccessLogSubscription API operation for Amazon VPC Lattice. -// -// Updates the specified access log subscription. -// -// 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 VPC Lattice's -// API operation UpdateAccessLogSubscription for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateAccessLogSubscription -func (c *VPCLattice) UpdateAccessLogSubscription(input *UpdateAccessLogSubscriptionInput) (*UpdateAccessLogSubscriptionOutput, error) { - req, out := c.UpdateAccessLogSubscriptionRequest(input) - return out, req.Send() -} - -// UpdateAccessLogSubscriptionWithContext is the same as UpdateAccessLogSubscription with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateAccessLogSubscription 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 *VPCLattice) UpdateAccessLogSubscriptionWithContext(ctx aws.Context, input *UpdateAccessLogSubscriptionInput, opts ...request.Option) (*UpdateAccessLogSubscriptionOutput, error) { - req, out := c.UpdateAccessLogSubscriptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateListener = "UpdateListener" - -// UpdateListenerRequest generates a "aws/request.Request" representing the -// client's request for the UpdateListener 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 UpdateListener for more information on using the UpdateListener -// 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 UpdateListenerRequest method. -// req, resp := client.UpdateListenerRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateListener -func (c *VPCLattice) UpdateListenerRequest(input *UpdateListenerInput) (req *request.Request, output *UpdateListenerOutput) { - op := &request.Operation{ - Name: opUpdateListener, - HTTPMethod: "PATCH", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}", - } - - if input == nil { - input = &UpdateListenerInput{} - } - - output = &UpdateListenerOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateListener API operation for Amazon VPC Lattice. -// -// Updates the specified listener for the specified 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 VPC Lattice's -// API operation UpdateListener for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateListener -func (c *VPCLattice) UpdateListener(input *UpdateListenerInput) (*UpdateListenerOutput, error) { - req, out := c.UpdateListenerRequest(input) - return out, req.Send() -} - -// UpdateListenerWithContext is the same as UpdateListener with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateListener 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 *VPCLattice) UpdateListenerWithContext(ctx aws.Context, input *UpdateListenerInput, opts ...request.Option) (*UpdateListenerOutput, error) { - req, out := c.UpdateListenerRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateRule = "UpdateRule" - -// UpdateRuleRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRule 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 UpdateRule for more information on using the UpdateRule -// 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 UpdateRuleRequest method. -// req, resp := client.UpdateRuleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateRule -func (c *VPCLattice) UpdateRuleRequest(input *UpdateRuleInput) (req *request.Request, output *UpdateRuleOutput) { - op := &request.Operation{ - Name: opUpdateRule, - HTTPMethod: "PATCH", - HTTPPath: "/services/{serviceIdentifier}/listeners/{listenerIdentifier}/rules/{ruleIdentifier}", - } - - if input == nil { - input = &UpdateRuleInput{} - } - - output = &UpdateRuleOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateRule API operation for Amazon VPC Lattice. -// -// Updates a rule for the listener. You can't modify a default listener rule. -// To modify a default listener rule, use UpdateListener. -// -// 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 VPC Lattice's -// API operation UpdateRule for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateRule -func (c *VPCLattice) UpdateRule(input *UpdateRuleInput) (*UpdateRuleOutput, error) { - req, out := c.UpdateRuleRequest(input) - return out, req.Send() -} - -// UpdateRuleWithContext is the same as UpdateRule with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateRule 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 *VPCLattice) UpdateRuleWithContext(ctx aws.Context, input *UpdateRuleInput, opts ...request.Option) (*UpdateRuleOutput, error) { - req, out := c.UpdateRuleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateService = "UpdateService" - -// UpdateServiceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateService 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 UpdateService for more information on using the UpdateService -// 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 UpdateServiceRequest method. -// req, resp := client.UpdateServiceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateService -func (c *VPCLattice) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Request, output *UpdateServiceOutput) { - op := &request.Operation{ - Name: opUpdateService, - HTTPMethod: "PATCH", - HTTPPath: "/services/{serviceIdentifier}", - } - - if input == nil { - input = &UpdateServiceInput{} - } - - output = &UpdateServiceOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateService API operation for Amazon VPC Lattice. -// -// Updates the specified 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 VPC Lattice's -// API operation UpdateService for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateService -func (c *VPCLattice) UpdateService(input *UpdateServiceInput) (*UpdateServiceOutput, error) { - req, out := c.UpdateServiceRequest(input) - return out, req.Send() -} - -// UpdateServiceWithContext is the same as UpdateService with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateService 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 *VPCLattice) UpdateServiceWithContext(ctx aws.Context, input *UpdateServiceInput, opts ...request.Option) (*UpdateServiceOutput, error) { - req, out := c.UpdateServiceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateServiceNetwork = "UpdateServiceNetwork" - -// UpdateServiceNetworkRequest generates a "aws/request.Request" representing the -// client's request for the UpdateServiceNetwork 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 UpdateServiceNetwork for more information on using the UpdateServiceNetwork -// 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 UpdateServiceNetworkRequest method. -// req, resp := client.UpdateServiceNetworkRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateServiceNetwork -func (c *VPCLattice) UpdateServiceNetworkRequest(input *UpdateServiceNetworkInput) (req *request.Request, output *UpdateServiceNetworkOutput) { - op := &request.Operation{ - Name: opUpdateServiceNetwork, - HTTPMethod: "PATCH", - HTTPPath: "/servicenetworks/{serviceNetworkIdentifier}", - } - - if input == nil { - input = &UpdateServiceNetworkInput{} - } - - output = &UpdateServiceNetworkOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateServiceNetwork API operation for Amazon VPC Lattice. -// -// Updates the specified service network. -// -// 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 VPC Lattice's -// API operation UpdateServiceNetwork for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateServiceNetwork -func (c *VPCLattice) UpdateServiceNetwork(input *UpdateServiceNetworkInput) (*UpdateServiceNetworkOutput, error) { - req, out := c.UpdateServiceNetworkRequest(input) - return out, req.Send() -} - -// UpdateServiceNetworkWithContext is the same as UpdateServiceNetwork with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateServiceNetwork 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 *VPCLattice) UpdateServiceNetworkWithContext(ctx aws.Context, input *UpdateServiceNetworkInput, opts ...request.Option) (*UpdateServiceNetworkOutput, error) { - req, out := c.UpdateServiceNetworkRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateServiceNetworkVpcAssociation = "UpdateServiceNetworkVpcAssociation" - -// UpdateServiceNetworkVpcAssociationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateServiceNetworkVpcAssociation 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 UpdateServiceNetworkVpcAssociation for more information on using the UpdateServiceNetworkVpcAssociation -// 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 UpdateServiceNetworkVpcAssociationRequest method. -// req, resp := client.UpdateServiceNetworkVpcAssociationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateServiceNetworkVpcAssociation -func (c *VPCLattice) UpdateServiceNetworkVpcAssociationRequest(input *UpdateServiceNetworkVpcAssociationInput) (req *request.Request, output *UpdateServiceNetworkVpcAssociationOutput) { - op := &request.Operation{ - Name: opUpdateServiceNetworkVpcAssociation, - HTTPMethod: "PATCH", - HTTPPath: "/servicenetworkvpcassociations/{serviceNetworkVpcAssociationIdentifier}", - } - - if input == nil { - input = &UpdateServiceNetworkVpcAssociationInput{} - } - - output = &UpdateServiceNetworkVpcAssociationOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateServiceNetworkVpcAssociation API operation for Amazon VPC Lattice. -// -// Updates the service network and VPC association. Once you add a security -// group, it cannot be removed. -// -// 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 VPC Lattice's -// API operation UpdateServiceNetworkVpcAssociation for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateServiceNetworkVpcAssociation -func (c *VPCLattice) UpdateServiceNetworkVpcAssociation(input *UpdateServiceNetworkVpcAssociationInput) (*UpdateServiceNetworkVpcAssociationOutput, error) { - req, out := c.UpdateServiceNetworkVpcAssociationRequest(input) - return out, req.Send() -} - -// UpdateServiceNetworkVpcAssociationWithContext is the same as UpdateServiceNetworkVpcAssociation with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateServiceNetworkVpcAssociation 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 *VPCLattice) UpdateServiceNetworkVpcAssociationWithContext(ctx aws.Context, input *UpdateServiceNetworkVpcAssociationInput, opts ...request.Option) (*UpdateServiceNetworkVpcAssociationOutput, error) { - req, out := c.UpdateServiceNetworkVpcAssociationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTargetGroup = "UpdateTargetGroup" - -// UpdateTargetGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTargetGroup 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 UpdateTargetGroup for more information on using the UpdateTargetGroup -// 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 UpdateTargetGroupRequest method. -// req, resp := client.UpdateTargetGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateTargetGroup -func (c *VPCLattice) UpdateTargetGroupRequest(input *UpdateTargetGroupInput) (req *request.Request, output *UpdateTargetGroupOutput) { - op := &request.Operation{ - Name: opUpdateTargetGroup, - HTTPMethod: "PATCH", - HTTPPath: "/targetgroups/{targetGroupIdentifier}", - } - - if input == nil { - input = &UpdateTargetGroupInput{} - } - - output = &UpdateTargetGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTargetGroup API operation for Amazon VPC Lattice. -// -// Updates the specified target group. -// -// 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 VPC Lattice's -// API operation UpdateTargetGroup for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -// -// - AccessDeniedException -// The user does not have sufficient access to perform this action. -// -// - ThrottlingException -// The limit on the number of requests per second was exceeded. -// -// - ResourceNotFoundException -// The request references a resource that does not exist. -// -// - ConflictException -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -// -// - InternalServerException -// An unexpected error occurred while processing the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/UpdateTargetGroup -func (c *VPCLattice) UpdateTargetGroup(input *UpdateTargetGroupInput) (*UpdateTargetGroupOutput, error) { - req, out := c.UpdateTargetGroupRequest(input) - return out, req.Send() -} - -// UpdateTargetGroupWithContext is the same as UpdateTargetGroup with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTargetGroup 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 *VPCLattice) UpdateTargetGroupWithContext(ctx aws.Context, input *UpdateTargetGroupInput, opts ...request.Option) (*UpdateTargetGroupOutput, error) { - req, out := c.UpdateTargetGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// The user does not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Summary information about an access log subscription. -type AccessLogSubscriptionSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the access log subscription - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The date and time that the access log subscription was created, specified - // in ISO-8601 format. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Amazon Resource Name (ARN) of the destination. - // - // DestinationArn is a required field - DestinationArn *string `locationName:"destinationArn" min:"20" type:"string" required:"true"` - - // The ID of the access log subscription. - // - // Id is a required field - Id *string `locationName:"id" min:"21" type:"string" required:"true"` - - // The date and time that the access log subscription was last updated, specified - // in ISO-8601 format. - // - // LastUpdatedAt is a required field - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Amazon Resource Name (ARN) of the service or service network. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // The ID of the service or service network. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" min:"20" 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 AccessLogSubscriptionSummary) 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 AccessLogSubscriptionSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *AccessLogSubscriptionSummary) SetArn(v string) *AccessLogSubscriptionSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *AccessLogSubscriptionSummary) SetCreatedAt(v time.Time) *AccessLogSubscriptionSummary { - s.CreatedAt = &v - return s -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *AccessLogSubscriptionSummary) SetDestinationArn(v string) *AccessLogSubscriptionSummary { - s.DestinationArn = &v - return s -} - -// SetId sets the Id field's value. -func (s *AccessLogSubscriptionSummary) SetId(v string) *AccessLogSubscriptionSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *AccessLogSubscriptionSummary) SetLastUpdatedAt(v time.Time) *AccessLogSubscriptionSummary { - s.LastUpdatedAt = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *AccessLogSubscriptionSummary) SetResourceArn(v string) *AccessLogSubscriptionSummary { - s.ResourceArn = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *AccessLogSubscriptionSummary) SetResourceId(v string) *AccessLogSubscriptionSummary { - s.ResourceId = &v - return s -} - -type BatchUpdateRuleInput struct { - _ struct{} `type:"structure"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The rules for the specified listener. - // - // Rules is a required field - Rules []*RuleUpdate `locationName:"rules" min:"1" type:"list" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 BatchUpdateRuleInput) 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 BatchUpdateRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchUpdateRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchUpdateRuleInput"} - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil && len(s.Rules) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Rules", 1)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *BatchUpdateRuleInput) SetListenerIdentifier(v string) *BatchUpdateRuleInput { - s.ListenerIdentifier = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *BatchUpdateRuleInput) SetRules(v []*RuleUpdate) *BatchUpdateRuleInput { - s.Rules = v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *BatchUpdateRuleInput) SetServiceIdentifier(v string) *BatchUpdateRuleInput { - s.ServiceIdentifier = &v - return s -} - -type BatchUpdateRuleOutput struct { - _ struct{} `type:"structure"` - - // The rules that were successfully updated. - Successful []*RuleUpdateSuccess `locationName:"successful" type:"list"` - - // The rules that the operation couldn't update. - Unsuccessful []*RuleUpdateFailure `locationName:"unsuccessful" type:"list"` -} - -// 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 BatchUpdateRuleOutput) 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 BatchUpdateRuleOutput) GoString() string { - return s.String() -} - -// SetSuccessful sets the Successful field's value. -func (s *BatchUpdateRuleOutput) SetSuccessful(v []*RuleUpdateSuccess) *BatchUpdateRuleOutput { - s.Successful = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *BatchUpdateRuleOutput) SetUnsuccessful(v []*RuleUpdateFailure) *BatchUpdateRuleOutput { - s.Unsuccessful = v - return s -} - -// The request conflicts with the current state of the resource. Updating or -// deleting a resource can cause an inconsistent state. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The resource ID. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resource type. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateAccessLogSubscriptionInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If you retry a request that completed successfully using - // the same client token and parameters, the retry succeeds without performing - // any actions. If the parameters aren't identical, the retry fails. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The Amazon Resource Name (ARN) of the destination. The supported destination - // types are CloudWatch Log groups, Kinesis Data Firehose delivery streams, - // and Amazon S3 buckets. - // - // DestinationArn is a required field - DestinationArn *string `locationName:"destinationArn" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service network or service. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `locationName:"resourceIdentifier" min:"17" type:"string" required:"true"` - - // The tags for the access log subscription. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateAccessLogSubscriptionInput) 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 CreateAccessLogSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAccessLogSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAccessLogSubscriptionInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DestinationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationArn")) - } - if s.DestinationArn != nil && len(*s.DestinationArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("DestinationArn", 20)) - } - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - if s.ResourceIdentifier != nil && len(*s.ResourceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateAccessLogSubscriptionInput) SetClientToken(v string) *CreateAccessLogSubscriptionInput { - s.ClientToken = &v - return s -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *CreateAccessLogSubscriptionInput) SetDestinationArn(v string) *CreateAccessLogSubscriptionInput { - s.DestinationArn = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *CreateAccessLogSubscriptionInput) SetResourceIdentifier(v string) *CreateAccessLogSubscriptionInput { - s.ResourceIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAccessLogSubscriptionInput) SetTags(v map[string]*string) *CreateAccessLogSubscriptionInput { - s.Tags = v - return s -} - -type CreateAccessLogSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the access log subscription. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the log destination. - // - // DestinationArn is a required field - DestinationArn *string `locationName:"destinationArn" min:"20" type:"string" required:"true"` - - // The ID of the access log subscription. - // - // Id is a required field - Id *string `locationName:"id" min:"21" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the service network or service. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // The ID of the service network or service. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" min:"20" 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 CreateAccessLogSubscriptionOutput) 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 CreateAccessLogSubscriptionOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateAccessLogSubscriptionOutput) SetArn(v string) *CreateAccessLogSubscriptionOutput { - s.Arn = &v - return s -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *CreateAccessLogSubscriptionOutput) SetDestinationArn(v string) *CreateAccessLogSubscriptionOutput { - s.DestinationArn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateAccessLogSubscriptionOutput) SetId(v string) *CreateAccessLogSubscriptionOutput { - s.Id = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *CreateAccessLogSubscriptionOutput) SetResourceArn(v string) *CreateAccessLogSubscriptionOutput { - s.ResourceArn = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *CreateAccessLogSubscriptionOutput) SetResourceId(v string) *CreateAccessLogSubscriptionOutput { - s.ResourceId = &v - return s -} - -type CreateListenerInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If you retry a request that completed successfully using - // the same client token and parameters, the retry succeeds without performing - // any actions. If the parameters aren't identical, the retry fails. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The action for the default rule. Each listener has a default rule. Each rule - // consists of a priority, one or more actions, and one or more conditions. - // The default rule is the rule that's used if no other rules match. Each rule - // must include exactly one of the following types of actions: forward or fixed-response, - // and it must be the last action to be performed. - // - // DefaultAction is a required field - DefaultAction *RuleAction `locationName:"defaultAction" type:"structure" required:"true"` - - // The name of the listener. A listener name must be unique within a service. - // The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen - // as the first or last character, or immediately after another hyphen. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The listener port. You can specify a value from 1 to 65535. For HTTP, the - // default is 80. For HTTPS, the default is 443. - Port *int64 `locationName:"port" min:"1" type:"integer"` - - // The listener protocol HTTP or HTTPS. - // - // Protocol is a required field - Protocol *string `locationName:"protocol" type:"string" required:"true" enum:"ListenerProtocol"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" type:"string" required:"true"` - - // The tags for the listener. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateListenerInput) 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 CreateListenerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateListenerInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DefaultAction == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultAction")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - if s.DefaultAction != nil { - if err := s.DefaultAction.Validate(); err != nil { - invalidParams.AddNested("DefaultAction", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateListenerInput) SetClientToken(v string) *CreateListenerInput { - s.ClientToken = &v - return s -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *CreateListenerInput) SetDefaultAction(v *RuleAction) *CreateListenerInput { - s.DefaultAction = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateListenerInput) SetName(v string) *CreateListenerInput { - s.Name = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateListenerInput) SetPort(v int64) *CreateListenerInput { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *CreateListenerInput) SetProtocol(v string) *CreateListenerInput { - s.Protocol = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *CreateListenerInput) SetServiceIdentifier(v string) *CreateListenerInput { - s.ServiceIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateListenerInput) SetTags(v map[string]*string) *CreateListenerInput { - s.Tags = v - return s -} - -type CreateListenerOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The action for the default rule. - DefaultAction *RuleAction `locationName:"defaultAction" type:"structure"` - - // The ID of the listener. - Id *string `locationName:"id" min:"26" type:"string"` - - // The name of the listener. - Name *string `locationName:"name" min:"3" type:"string"` - - // The port number of the listener. - Port *int64 `locationName:"port" min:"1" type:"integer"` - - // The protocol of the listener. - Protocol *string `locationName:"protocol" type:"string" enum:"ListenerProtocol"` - - // The Amazon Resource Name (ARN) of the service. - ServiceArn *string `locationName:"serviceArn" min:"20" type:"string"` - - // The ID of the service. - ServiceId *string `locationName:"serviceId" min:"21" 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 CreateListenerOutput) 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 CreateListenerOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateListenerOutput) SetArn(v string) *CreateListenerOutput { - s.Arn = &v - return s -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *CreateListenerOutput) SetDefaultAction(v *RuleAction) *CreateListenerOutput { - s.DefaultAction = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateListenerOutput) SetId(v string) *CreateListenerOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateListenerOutput) SetName(v string) *CreateListenerOutput { - s.Name = &v - return s -} - -// SetPort sets the Port field's value. -func (s *CreateListenerOutput) SetPort(v int64) *CreateListenerOutput { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *CreateListenerOutput) SetProtocol(v string) *CreateListenerOutput { - s.Protocol = &v - return s -} - -// SetServiceArn sets the ServiceArn field's value. -func (s *CreateListenerOutput) SetServiceArn(v string) *CreateListenerOutput { - s.ServiceArn = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *CreateListenerOutput) SetServiceId(v string) *CreateListenerOutput { - s.ServiceId = &v - return s -} - -type CreateRuleInput struct { - _ struct{} `type:"structure"` - - // The action for the default rule. - // - // Action is a required field - Action *RuleAction `locationName:"action" type:"structure" required:"true"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If you retry a request that completed successfully using - // the same client token and parameters, the retry succeeds without performing - // any actions. If the parameters aren't identical, the retry fails. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The rule match. - // - // Match is a required field - Match *RuleMatch `locationName:"match" type:"structure" required:"true"` - - // The name of the rule. The name must be unique within the listener. The valid - // characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first - // or last character, or immediately after another hyphen. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The priority assigned to the rule. Each rule for a specific listener must - // have a unique priority. The lower the priority number the higher the priority. - // - // Priority is a required field - Priority *int64 `locationName:"priority" min:"1" type:"integer" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" type:"string" required:"true"` - - // The tags for the rule. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateRuleInput) 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 CreateRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRuleInput"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.Match == nil { - invalidParams.Add(request.NewErrParamRequired("Match")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Priority == nil { - invalidParams.Add(request.NewErrParamRequired("Priority")) - } - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - if s.Action != nil { - if err := s.Action.Validate(); err != nil { - invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) - } - } - if s.Match != nil { - if err := s.Match.Validate(); err != nil { - invalidParams.AddNested("Match", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *CreateRuleInput) SetAction(v *RuleAction) *CreateRuleInput { - s.Action = v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateRuleInput) SetClientToken(v string) *CreateRuleInput { - s.ClientToken = &v - return s -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *CreateRuleInput) SetListenerIdentifier(v string) *CreateRuleInput { - s.ListenerIdentifier = &v - return s -} - -// SetMatch sets the Match field's value. -func (s *CreateRuleInput) SetMatch(v *RuleMatch) *CreateRuleInput { - s.Match = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateRuleInput) SetName(v string) *CreateRuleInput { - s.Name = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *CreateRuleInput) SetPriority(v int64) *CreateRuleInput { - s.Priority = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *CreateRuleInput) SetServiceIdentifier(v string) *CreateRuleInput { - s.ServiceIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateRuleInput) SetTags(v map[string]*string) *CreateRuleInput { - s.Tags = v - return s -} - -type CreateRuleOutput struct { - _ struct{} `type:"structure"` - - // The rule action. Each rule must include exactly one of the following types - // of actions: forward or fixed-response, and it must be the last action to - // be performed. - Action *RuleAction `locationName:"action" type:"structure"` - - // The Amazon Resource Name (ARN) of the rule. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the rule. - Id *string `locationName:"id" min:"5" type:"string"` - - // The rule match. The RuleMatch must be an HttpMatch. This means that the rule - // should be an exact match on HTTP constraints which are made up of the HTTP - // method, path, and header. - Match *RuleMatch `locationName:"match" type:"structure"` - - // The name of the rule. - Name *string `locationName:"name" min:"3" type:"string"` - - // The priority assigned to the rule. The lower the priority number the higher - // the priority. - Priority *int64 `locationName:"priority" min:"1" 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 CreateRuleOutput) 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 CreateRuleOutput) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *CreateRuleOutput) SetAction(v *RuleAction) *CreateRuleOutput { - s.Action = v - return s -} - -// SetArn sets the Arn field's value. -func (s *CreateRuleOutput) SetArn(v string) *CreateRuleOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateRuleOutput) SetId(v string) *CreateRuleOutput { - s.Id = &v - return s -} - -// SetMatch sets the Match field's value. -func (s *CreateRuleOutput) SetMatch(v *RuleMatch) *CreateRuleOutput { - s.Match = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateRuleOutput) SetName(v string) *CreateRuleOutput { - s.Name = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *CreateRuleOutput) SetPriority(v int64) *CreateRuleOutput { - s.Priority = &v - return s -} - -type CreateServiceInput struct { - _ struct{} `type:"structure"` - - // The type of IAM policy. - // - // * NONE: The resource does not use an IAM policy. This is the default. - // - // * AWS_IAM: The resource uses an IAM policy. When this type is used, auth - // is enabled and an auth policy is required. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // The Amazon Resource Name (ARN) of the certificate. - CertificateArn *string `locationName:"certificateArn" type:"string"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If you retry a request that completed successfully using - // the same client token and parameters, the retry succeeds without performing - // any actions. If the parameters aren't identical, the retry fails. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The custom domain name of the service. - CustomDomainName *string `locationName:"customDomainName" min:"3" type:"string"` - - // The name of the service. The name must be unique within the account. The - // valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as - // the first or last character, or immediately after another hyphen. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The tags for the service. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateServiceInput) 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 CreateServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateServiceInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.CustomDomainName != nil && len(*s.CustomDomainName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("CustomDomainName", 3)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthType sets the AuthType field's value. -func (s *CreateServiceInput) SetAuthType(v string) *CreateServiceInput { - s.AuthType = &v - return s -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *CreateServiceInput) SetCertificateArn(v string) *CreateServiceInput { - s.CertificateArn = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateServiceInput) SetClientToken(v string) *CreateServiceInput { - s.ClientToken = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *CreateServiceInput) SetCustomDomainName(v string) *CreateServiceInput { - s.CustomDomainName = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateServiceInput) SetName(v string) *CreateServiceInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateServiceInput) SetTags(v map[string]*string) *CreateServiceInput { - s.Tags = v - return s -} - -type CreateServiceNetworkInput struct { - _ struct{} `type:"structure"` - - // The type of IAM policy. - // - // * NONE: The resource does not use an IAM policy. This is the default. - // - // * AWS_IAM: The resource uses an IAM policy. When this type is used, auth - // is enabled and an auth policy is required. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If you retry a request that completed successfully using - // the same client token and parameters, the retry succeeds without performing - // any actions. If the parameters aren't identical, the retry fails. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The name of the service network. The name must be unique to the account. - // The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen - // as the first or last character, or immediately after another hyphen. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The tags for the service network. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateServiceNetworkInput) 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 CreateServiceNetworkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateServiceNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateServiceNetworkInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthType sets the AuthType field's value. -func (s *CreateServiceNetworkInput) SetAuthType(v string) *CreateServiceNetworkInput { - s.AuthType = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateServiceNetworkInput) SetClientToken(v string) *CreateServiceNetworkInput { - s.ClientToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateServiceNetworkInput) SetName(v string) *CreateServiceNetworkInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateServiceNetworkInput) SetTags(v map[string]*string) *CreateServiceNetworkInput { - s.Tags = v - return s -} - -type CreateServiceNetworkOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service network. - Arn *string `locationName:"arn" min:"32" type:"string"` - - // The type of IAM policy. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // The ID of the service network. - Id *string `locationName:"id" min:"32" type:"string"` - - // The name of the service network. - Name *string `locationName:"name" min:"3" 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 CreateServiceNetworkOutput) 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 CreateServiceNetworkOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateServiceNetworkOutput) SetArn(v string) *CreateServiceNetworkOutput { - s.Arn = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *CreateServiceNetworkOutput) SetAuthType(v string) *CreateServiceNetworkOutput { - s.AuthType = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateServiceNetworkOutput) SetId(v string) *CreateServiceNetworkOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateServiceNetworkOutput) SetName(v string) *CreateServiceNetworkOutput { - s.Name = &v - return s -} - -type CreateServiceNetworkServiceAssociationInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If you retry a request that completed successfully using - // the same client token and parameters, the retry succeeds without performing - // any actions. If the parameters aren't identical, the retry fails. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `locationName:"serviceIdentifier" min:"17" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service network. You must use - // the ARN if the resources specified in the operation are in different accounts. - // - // ServiceNetworkIdentifier is a required field - ServiceNetworkIdentifier *string `locationName:"serviceNetworkIdentifier" min:"3" type:"string" required:"true"` - - // The tags for the association. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 CreateServiceNetworkServiceAssociationInput) 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 CreateServiceNetworkServiceAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateServiceNetworkServiceAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateServiceNetworkServiceAssociationInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - if s.ServiceNetworkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkIdentifier")) - } - if s.ServiceNetworkIdentifier != nil && len(*s.ServiceNetworkIdentifier) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkIdentifier", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateServiceNetworkServiceAssociationInput) SetClientToken(v string) *CreateServiceNetworkServiceAssociationInput { - s.ClientToken = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *CreateServiceNetworkServiceAssociationInput) SetServiceIdentifier(v string) *CreateServiceNetworkServiceAssociationInput { - s.ServiceIdentifier = &v - return s -} - -// SetServiceNetworkIdentifier sets the ServiceNetworkIdentifier field's value. -func (s *CreateServiceNetworkServiceAssociationInput) SetServiceNetworkIdentifier(v string) *CreateServiceNetworkServiceAssociationInput { - s.ServiceNetworkIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateServiceNetworkServiceAssociationInput) SetTags(v map[string]*string) *CreateServiceNetworkServiceAssociationInput { - s.Tags = v - return s -} - -type CreateServiceNetworkServiceAssociationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The account that created the association. - CreatedBy *string `locationName:"createdBy" min:"1" type:"string"` - - // The custom domain name of the service. - CustomDomainName *string `locationName:"customDomainName" min:"3" type:"string"` - - // The DNS name of the service. - DnsEntry *DnsEntry `locationName:"dnsEntry" type:"structure"` - - // The ID of the association. - Id *string `locationName:"id" min:"17" type:"string"` - - // The operation's status. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkServiceAssociationStatus"` -} - -// 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 CreateServiceNetworkServiceAssociationOutput) 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 CreateServiceNetworkServiceAssociationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateServiceNetworkServiceAssociationOutput) SetArn(v string) *CreateServiceNetworkServiceAssociationOutput { - s.Arn = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateServiceNetworkServiceAssociationOutput) SetCreatedBy(v string) *CreateServiceNetworkServiceAssociationOutput { - s.CreatedBy = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *CreateServiceNetworkServiceAssociationOutput) SetCustomDomainName(v string) *CreateServiceNetworkServiceAssociationOutput { - s.CustomDomainName = &v - return s -} - -// SetDnsEntry sets the DnsEntry field's value. -func (s *CreateServiceNetworkServiceAssociationOutput) SetDnsEntry(v *DnsEntry) *CreateServiceNetworkServiceAssociationOutput { - s.DnsEntry = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateServiceNetworkServiceAssociationOutput) SetId(v string) *CreateServiceNetworkServiceAssociationOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateServiceNetworkServiceAssociationOutput) SetStatus(v string) *CreateServiceNetworkServiceAssociationOutput { - s.Status = &v - return s -} - -type CreateServiceNetworkVpcAssociationInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If you retry a request that completed successfully using - // the same client token and parameters, the retry succeeds without performing - // any actions. If the parameters aren't identical, the retry fails. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The IDs of the security groups. Security groups aren't added by default. - // You can add a security group to apply network level controls to control which - // resources in a VPC are allowed to access the service network and its services. - // For more information, see Control traffic to resources using security groups - // (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) - // in the Amazon VPC User Guide. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // The ID or Amazon Resource Name (ARN) of the service network. You must use - // the ARN when the resources specified in the operation are in different accounts. - // - // ServiceNetworkIdentifier is a required field - ServiceNetworkIdentifier *string `locationName:"serviceNetworkIdentifier" min:"3" type:"string" required:"true"` - - // The tags for the association. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The ID of the VPC. - // - // VpcIdentifier is a required field - VpcIdentifier *string `locationName:"vpcIdentifier" min:"5" 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 CreateServiceNetworkVpcAssociationInput) 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 CreateServiceNetworkVpcAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateServiceNetworkVpcAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateServiceNetworkVpcAssociationInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.ServiceNetworkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkIdentifier")) - } - if s.ServiceNetworkIdentifier != nil && len(*s.ServiceNetworkIdentifier) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkIdentifier", 3)) - } - if s.VpcIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("VpcIdentifier")) - } - if s.VpcIdentifier != nil && len(*s.VpcIdentifier) < 5 { - invalidParams.Add(request.NewErrParamMinLen("VpcIdentifier", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateServiceNetworkVpcAssociationInput) SetClientToken(v string) *CreateServiceNetworkVpcAssociationInput { - s.ClientToken = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateServiceNetworkVpcAssociationInput) SetSecurityGroupIds(v []*string) *CreateServiceNetworkVpcAssociationInput { - s.SecurityGroupIds = v - return s -} - -// SetServiceNetworkIdentifier sets the ServiceNetworkIdentifier field's value. -func (s *CreateServiceNetworkVpcAssociationInput) SetServiceNetworkIdentifier(v string) *CreateServiceNetworkVpcAssociationInput { - s.ServiceNetworkIdentifier = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateServiceNetworkVpcAssociationInput) SetTags(v map[string]*string) *CreateServiceNetworkVpcAssociationInput { - s.Tags = v - return s -} - -// SetVpcIdentifier sets the VpcIdentifier field's value. -func (s *CreateServiceNetworkVpcAssociationInput) SetVpcIdentifier(v string) *CreateServiceNetworkVpcAssociationInput { - s.VpcIdentifier = &v - return s -} - -type CreateServiceNetworkVpcAssociationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The account that created the association. - CreatedBy *string `locationName:"createdBy" min:"1" type:"string"` - - // The ID of the association. - Id *string `locationName:"id" min:"22" type:"string"` - - // The IDs of the security groups. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // The operation's status. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkVpcAssociationStatus"` -} - -// 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 CreateServiceNetworkVpcAssociationOutput) 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 CreateServiceNetworkVpcAssociationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateServiceNetworkVpcAssociationOutput) SetArn(v string) *CreateServiceNetworkVpcAssociationOutput { - s.Arn = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *CreateServiceNetworkVpcAssociationOutput) SetCreatedBy(v string) *CreateServiceNetworkVpcAssociationOutput { - s.CreatedBy = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateServiceNetworkVpcAssociationOutput) SetId(v string) *CreateServiceNetworkVpcAssociationOutput { - s.Id = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateServiceNetworkVpcAssociationOutput) SetSecurityGroupIds(v []*string) *CreateServiceNetworkVpcAssociationOutput { - s.SecurityGroupIds = v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateServiceNetworkVpcAssociationOutput) SetStatus(v string) *CreateServiceNetworkVpcAssociationOutput { - s.Status = &v - return s -} - -type CreateServiceOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The type of IAM policy. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // The Amazon Resource Name (ARN) of the certificate. - CertificateArn *string `locationName:"certificateArn" type:"string"` - - // The custom domain name of the service. - CustomDomainName *string `locationName:"customDomainName" min:"3" type:"string"` - - // The public DNS name of the service. - DnsEntry *DnsEntry `locationName:"dnsEntry" type:"structure"` - - // The ID of the service. - Id *string `locationName:"id" min:"21" type:"string"` - - // The name of the service. - Name *string `locationName:"name" min:"3" type:"string"` - - // The status. If the status is CREATE_FAILED, you will have to delete and recreate - // the service. - Status *string `locationName:"status" type:"string" enum:"ServiceStatus"` -} - -// 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 CreateServiceOutput) 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 CreateServiceOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateServiceOutput) SetArn(v string) *CreateServiceOutput { - s.Arn = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *CreateServiceOutput) SetAuthType(v string) *CreateServiceOutput { - s.AuthType = &v - return s -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *CreateServiceOutput) SetCertificateArn(v string) *CreateServiceOutput { - s.CertificateArn = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *CreateServiceOutput) SetCustomDomainName(v string) *CreateServiceOutput { - s.CustomDomainName = &v - return s -} - -// SetDnsEntry sets the DnsEntry field's value. -func (s *CreateServiceOutput) SetDnsEntry(v *DnsEntry) *CreateServiceOutput { - s.DnsEntry = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateServiceOutput) SetId(v string) *CreateServiceOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateServiceOutput) SetName(v string) *CreateServiceOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateServiceOutput) SetStatus(v string) *CreateServiceOutput { - s.Status = &v - return s -} - -type CreateTargetGroupInput struct { - _ struct{} `type:"structure"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. If you retry a request that completed successfully using - // the same client token and parameters, the retry succeeds without performing - // any actions. If the parameters aren't identical, the retry fails. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The target group configuration. If type is set to LAMBDA, this parameter - // doesn't apply. - Config *TargetGroupConfig `locationName:"config" type:"structure"` - - // The name of the target group. The name must be unique within the account. - // The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen - // as the first or last character, or immediately after another hyphen. - // - // Name is a required field - Name *string `locationName:"name" min:"3" type:"string" required:"true"` - - // The tags for the target group. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The type of target group. - // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"TargetGroupType"` -} - -// 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 CreateTargetGroupInput) 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 CreateTargetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTargetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTargetGroupInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Config != nil { - if err := s.Config.Validate(); err != nil { - invalidParams.AddNested("Config", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateTargetGroupInput) SetClientToken(v string) *CreateTargetGroupInput { - s.ClientToken = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *CreateTargetGroupInput) SetConfig(v *TargetGroupConfig) *CreateTargetGroupInput { - s.Config = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTargetGroupInput) SetName(v string) *CreateTargetGroupInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateTargetGroupInput) SetTags(v map[string]*string) *CreateTargetGroupInput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CreateTargetGroupInput) SetType(v string) *CreateTargetGroupInput { - s.Type = &v - return s -} - -type CreateTargetGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The target group configuration. If type is set to LAMBDA, this parameter - // doesn't apply. - Config *TargetGroupConfig `locationName:"config" type:"structure"` - - // The ID of the target group. - Id *string `locationName:"id" min:"20" type:"string"` - - // The name of the target group. - Name *string `locationName:"name" min:"3" type:"string"` - - // The operation's status. You can retry the operation if the status is CREATE_FAILED. - // However, if you retry it while the status is CREATE_IN_PROGRESS, there is - // no change in the status. - Status *string `locationName:"status" type:"string" enum:"TargetGroupStatus"` - - // The type of target group. - Type *string `locationName:"type" type:"string" enum:"TargetGroupType"` -} - -// 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 CreateTargetGroupOutput) 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 CreateTargetGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *CreateTargetGroupOutput) SetArn(v string) *CreateTargetGroupOutput { - s.Arn = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *CreateTargetGroupOutput) SetConfig(v *TargetGroupConfig) *CreateTargetGroupOutput { - s.Config = v - return s -} - -// SetId sets the Id field's value. -func (s *CreateTargetGroupOutput) SetId(v string) *CreateTargetGroupOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTargetGroupOutput) SetName(v string) *CreateTargetGroupOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateTargetGroupOutput) SetStatus(v string) *CreateTargetGroupOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *CreateTargetGroupOutput) SetType(v string) *CreateTargetGroupOutput { - s.Type = &v - return s -} - -type DeleteAccessLogSubscriptionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the access log subscription. - // - // AccessLogSubscriptionIdentifier is a required field - AccessLogSubscriptionIdentifier *string `location:"uri" locationName:"accessLogSubscriptionIdentifier" min:"17" 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 DeleteAccessLogSubscriptionInput) 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 DeleteAccessLogSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAccessLogSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAccessLogSubscriptionInput"} - if s.AccessLogSubscriptionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AccessLogSubscriptionIdentifier")) - } - if s.AccessLogSubscriptionIdentifier != nil && len(*s.AccessLogSubscriptionIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("AccessLogSubscriptionIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessLogSubscriptionIdentifier sets the AccessLogSubscriptionIdentifier field's value. -func (s *DeleteAccessLogSubscriptionInput) SetAccessLogSubscriptionIdentifier(v string) *DeleteAccessLogSubscriptionInput { - s.AccessLogSubscriptionIdentifier = &v - return s -} - -type DeleteAccessLogSubscriptionOutput 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 DeleteAccessLogSubscriptionOutput) 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 DeleteAccessLogSubscriptionOutput) GoString() string { - return s.String() -} - -type DeleteAuthPolicyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the resource. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `location:"uri" locationName:"resourceIdentifier" min:"17" 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 DeleteAuthPolicyInput) 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 DeleteAuthPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAuthPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAuthPolicyInput"} - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - if s.ResourceIdentifier != nil && len(*s.ResourceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *DeleteAuthPolicyInput) SetResourceIdentifier(v string) *DeleteAuthPolicyInput { - s.ResourceIdentifier = &v - return s -} - -type DeleteAuthPolicyOutput 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 DeleteAuthPolicyOutput) 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 DeleteAuthPolicyOutput) GoString() string { - return s.String() -} - -type DeleteListenerInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 DeleteListenerInput) 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 DeleteListenerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteListenerInput"} - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *DeleteListenerInput) SetListenerIdentifier(v string) *DeleteListenerInput { - s.ListenerIdentifier = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *DeleteListenerInput) SetServiceIdentifier(v string) *DeleteListenerInput { - s.ServiceIdentifier = &v - return s -} - -type DeleteListenerOutput 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 DeleteListenerOutput) 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 DeleteListenerOutput) GoString() string { - return s.String() -} - -type DeleteResourcePolicyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" 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 DeleteResourcePolicyInput) 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 DeleteResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteResourcePolicyInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *DeleteResourcePolicyInput) SetResourceArn(v string) *DeleteResourcePolicyInput { - s.ResourceArn = &v - return s -} - -type DeleteResourcePolicyOutput 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 DeleteResourcePolicyOutput) 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 DeleteResourcePolicyOutput) GoString() string { - return s.String() -} - -type DeleteRuleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the rule. - // - // RuleIdentifier is a required field - RuleIdentifier *string `location:"uri" locationName:"ruleIdentifier" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 DeleteRuleInput) 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 DeleteRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRuleInput"} - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.RuleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("RuleIdentifier")) - } - if s.RuleIdentifier != nil && len(*s.RuleIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RuleIdentifier", 20)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *DeleteRuleInput) SetListenerIdentifier(v string) *DeleteRuleInput { - s.ListenerIdentifier = &v - return s -} - -// SetRuleIdentifier sets the RuleIdentifier field's value. -func (s *DeleteRuleInput) SetRuleIdentifier(v string) *DeleteRuleInput { - s.RuleIdentifier = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *DeleteRuleInput) SetServiceIdentifier(v string) *DeleteRuleInput { - s.ServiceIdentifier = &v - return s -} - -type DeleteRuleOutput 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 DeleteRuleOutput) 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 DeleteRuleOutput) GoString() string { - return s.String() -} - -type DeleteServiceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 DeleteServiceInput) 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 DeleteServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServiceInput"} - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *DeleteServiceInput) SetServiceIdentifier(v string) *DeleteServiceInput { - s.ServiceIdentifier = &v - return s -} - -type DeleteServiceNetworkInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) or ID of the service network. - // - // ServiceNetworkIdentifier is a required field - ServiceNetworkIdentifier *string `location:"uri" locationName:"serviceNetworkIdentifier" min:"3" 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 DeleteServiceNetworkInput) 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 DeleteServiceNetworkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServiceNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServiceNetworkInput"} - if s.ServiceNetworkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkIdentifier")) - } - if s.ServiceNetworkIdentifier != nil && len(*s.ServiceNetworkIdentifier) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkIdentifier", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceNetworkIdentifier sets the ServiceNetworkIdentifier field's value. -func (s *DeleteServiceNetworkInput) SetServiceNetworkIdentifier(v string) *DeleteServiceNetworkInput { - s.ServiceNetworkIdentifier = &v - return s -} - -type DeleteServiceNetworkOutput 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 DeleteServiceNetworkOutput) 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 DeleteServiceNetworkOutput) GoString() string { - return s.String() -} - -type DeleteServiceNetworkServiceAssociationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the association. - // - // ServiceNetworkServiceAssociationIdentifier is a required field - ServiceNetworkServiceAssociationIdentifier *string `location:"uri" locationName:"serviceNetworkServiceAssociationIdentifier" min:"17" 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 DeleteServiceNetworkServiceAssociationInput) 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 DeleteServiceNetworkServiceAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServiceNetworkServiceAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServiceNetworkServiceAssociationInput"} - if s.ServiceNetworkServiceAssociationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkServiceAssociationIdentifier")) - } - if s.ServiceNetworkServiceAssociationIdentifier != nil && len(*s.ServiceNetworkServiceAssociationIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkServiceAssociationIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceNetworkServiceAssociationIdentifier sets the ServiceNetworkServiceAssociationIdentifier field's value. -func (s *DeleteServiceNetworkServiceAssociationInput) SetServiceNetworkServiceAssociationIdentifier(v string) *DeleteServiceNetworkServiceAssociationInput { - s.ServiceNetworkServiceAssociationIdentifier = &v - return s -} - -type DeleteServiceNetworkServiceAssociationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the association. - Id *string `locationName:"id" min:"17" type:"string"` - - // The operation's status. You can retry the operation if the status is DELETE_FAILED. - // However, if you retry it when the status is DELETE_IN_PROGRESS, there is - // no change in the status. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkServiceAssociationStatus"` -} - -// 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 DeleteServiceNetworkServiceAssociationOutput) 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 DeleteServiceNetworkServiceAssociationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteServiceNetworkServiceAssociationOutput) SetArn(v string) *DeleteServiceNetworkServiceAssociationOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteServiceNetworkServiceAssociationOutput) SetId(v string) *DeleteServiceNetworkServiceAssociationOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteServiceNetworkServiceAssociationOutput) SetStatus(v string) *DeleteServiceNetworkServiceAssociationOutput { - s.Status = &v - return s -} - -type DeleteServiceNetworkVpcAssociationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the association. - // - // ServiceNetworkVpcAssociationIdentifier is a required field - ServiceNetworkVpcAssociationIdentifier *string `location:"uri" locationName:"serviceNetworkVpcAssociationIdentifier" min:"17" 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 DeleteServiceNetworkVpcAssociationInput) 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 DeleteServiceNetworkVpcAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteServiceNetworkVpcAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteServiceNetworkVpcAssociationInput"} - if s.ServiceNetworkVpcAssociationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkVpcAssociationIdentifier")) - } - if s.ServiceNetworkVpcAssociationIdentifier != nil && len(*s.ServiceNetworkVpcAssociationIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkVpcAssociationIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceNetworkVpcAssociationIdentifier sets the ServiceNetworkVpcAssociationIdentifier field's value. -func (s *DeleteServiceNetworkVpcAssociationInput) SetServiceNetworkVpcAssociationIdentifier(v string) *DeleteServiceNetworkVpcAssociationInput { - s.ServiceNetworkVpcAssociationIdentifier = &v - return s -} - -type DeleteServiceNetworkVpcAssociationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the association. - Id *string `locationName:"id" min:"22" type:"string"` - - // The status. You can retry the operation if the status is DELETE_FAILED. However, - // if you retry it when the status is DELETE_IN_PROGRESS, there is no change - // in the status. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkVpcAssociationStatus"` -} - -// 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 DeleteServiceNetworkVpcAssociationOutput) 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 DeleteServiceNetworkVpcAssociationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteServiceNetworkVpcAssociationOutput) SetArn(v string) *DeleteServiceNetworkVpcAssociationOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteServiceNetworkVpcAssociationOutput) SetId(v string) *DeleteServiceNetworkVpcAssociationOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteServiceNetworkVpcAssociationOutput) SetStatus(v string) *DeleteServiceNetworkVpcAssociationOutput { - s.Status = &v - return s -} - -type DeleteServiceOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the service. - Id *string `locationName:"id" min:"21" type:"string"` - - // The name of the service. - Name *string `locationName:"name" min:"3" type:"string"` - - // The status. You can retry the operation if the status is DELETE_FAILED. However, - // if you retry it while the status is DELETE_IN_PROGRESS, the status doesn't - // change. - Status *string `locationName:"status" type:"string" enum:"ServiceStatus"` -} - -// 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 DeleteServiceOutput) 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 DeleteServiceOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteServiceOutput) SetArn(v string) *DeleteServiceOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteServiceOutput) SetId(v string) *DeleteServiceOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteServiceOutput) SetName(v string) *DeleteServiceOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteServiceOutput) SetStatus(v string) *DeleteServiceOutput { - s.Status = &v - return s -} - -type DeleteTargetGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the target group. - // - // TargetGroupIdentifier is a required field - TargetGroupIdentifier *string `location:"uri" locationName:"targetGroupIdentifier" min:"17" 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 DeleteTargetGroupInput) 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 DeleteTargetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTargetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTargetGroupInput"} - if s.TargetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupIdentifier")) - } - if s.TargetGroupIdentifier != nil && len(*s.TargetGroupIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroupIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupIdentifier sets the TargetGroupIdentifier field's value. -func (s *DeleteTargetGroupInput) SetTargetGroupIdentifier(v string) *DeleteTargetGroupInput { - s.TargetGroupIdentifier = &v - return s -} - -type DeleteTargetGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the target group. - Id *string `locationName:"id" min:"20" type:"string"` - - // The status. You can retry the operation if the status is DELETE_FAILED. However, - // if you retry it while the status is DELETE_IN_PROGRESS, the status doesn't - // change. - Status *string `locationName:"status" type:"string" enum:"TargetGroupStatus"` -} - -// 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 DeleteTargetGroupOutput) 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 DeleteTargetGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeleteTargetGroupOutput) SetArn(v string) *DeleteTargetGroupOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteTargetGroupOutput) SetId(v string) *DeleteTargetGroupOutput { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeleteTargetGroupOutput) SetStatus(v string) *DeleteTargetGroupOutput { - s.Status = &v - return s -} - -type DeregisterTargetsInput struct { - _ struct{} `type:"structure"` - - // The ID or Amazon Resource Name (ARN) of the target group. - // - // TargetGroupIdentifier is a required field - TargetGroupIdentifier *string `location:"uri" locationName:"targetGroupIdentifier" min:"17" type:"string" required:"true"` - - // The targets to deregister. - // - // Targets is a required field - Targets []*Target `locationName:"targets" min:"1" type:"list" 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 DeregisterTargetsInput) 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 DeregisterTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterTargetsInput"} - if s.TargetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupIdentifier")) - } - if s.TargetGroupIdentifier != nil && len(*s.TargetGroupIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroupIdentifier", 17)) - } - if s.Targets == nil { - invalidParams.Add(request.NewErrParamRequired("Targets")) - } - if s.Targets != nil && len(s.Targets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Targets", 1)) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupIdentifier sets the TargetGroupIdentifier field's value. -func (s *DeregisterTargetsInput) SetTargetGroupIdentifier(v string) *DeregisterTargetsInput { - s.TargetGroupIdentifier = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *DeregisterTargetsInput) SetTargets(v []*Target) *DeregisterTargetsInput { - s.Targets = v - return s -} - -type DeregisterTargetsOutput struct { - _ struct{} `type:"structure"` - - // The targets that were successfully deregistered. - Successful []*Target `locationName:"successful" type:"list"` - - // The targets that the operation couldn't deregister. - Unsuccessful []*TargetFailure `locationName:"unsuccessful" type:"list"` -} - -// 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 DeregisterTargetsOutput) 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 DeregisterTargetsOutput) GoString() string { - return s.String() -} - -// SetSuccessful sets the Successful field's value. -func (s *DeregisterTargetsOutput) SetSuccessful(v []*Target) *DeregisterTargetsOutput { - s.Successful = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeregisterTargetsOutput) SetUnsuccessful(v []*TargetFailure) *DeregisterTargetsOutput { - s.Unsuccessful = v - return s -} - -// Describes the DNS information of a service. -type DnsEntry struct { - _ struct{} `type:"structure"` - - // The domain name of the service. - DomainName *string `locationName:"domainName" type:"string"` - - // The ID of the hosted zone. - HostedZoneId *string `locationName:"hostedZoneId" 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 DnsEntry) 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 DnsEntry) GoString() string { - return s.String() -} - -// SetDomainName sets the DomainName field's value. -func (s *DnsEntry) SetDomainName(v string) *DnsEntry { - s.DomainName = &v - return s -} - -// SetHostedZoneId sets the HostedZoneId field's value. -func (s *DnsEntry) SetHostedZoneId(v string) *DnsEntry { - s.HostedZoneId = &v - return s -} - -// Information about an action that returns a custom HTTP response. -type FixedResponseAction struct { - _ struct{} `type:"structure"` - - // The HTTP response code. - // - // StatusCode is a required field - StatusCode *int64 `locationName:"statusCode" min:"100" type:"integer" 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 FixedResponseAction) 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 FixedResponseAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *FixedResponseAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FixedResponseAction"} - if s.StatusCode == nil { - invalidParams.Add(request.NewErrParamRequired("StatusCode")) - } - if s.StatusCode != nil && *s.StatusCode < 100 { - invalidParams.Add(request.NewErrParamMinValue("StatusCode", 100)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatusCode sets the StatusCode field's value. -func (s *FixedResponseAction) SetStatusCode(v int64) *FixedResponseAction { - s.StatusCode = &v - return s -} - -// Describes a forward action. You can use forward actions to route requests -// to one or more target groups. -type ForwardAction struct { - _ struct{} `type:"structure"` - - // The target groups. Traffic matching the rule is forwarded to the specified - // target groups. With forward actions, you can assign a weight that controls - // the prioritization and selection of each target group. This means that requests - // are distributed to individual target groups based on their weights. For example, - // if two target groups have the same weight, each target group receives half - // of the traffic. - // - // The default value is 1. This means that if only one target group is provided, - // there is no need to set the weight; 100% of traffic will go to that target - // group. - // - // TargetGroups is a required field - TargetGroups []*WeightedTargetGroup `locationName:"targetGroups" min:"1" type:"list" 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 ForwardAction) 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 ForwardAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ForwardAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ForwardAction"} - if s.TargetGroups == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroups")) - } - if s.TargetGroups != nil && len(s.TargetGroups) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroups", 1)) - } - if s.TargetGroups != nil { - for i, v := range s.TargetGroups { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetGroups", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroups sets the TargetGroups field's value. -func (s *ForwardAction) SetTargetGroups(v []*WeightedTargetGroup) *ForwardAction { - s.TargetGroups = v - return s -} - -type GetAccessLogSubscriptionInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the access log subscription. - // - // AccessLogSubscriptionIdentifier is a required field - AccessLogSubscriptionIdentifier *string `location:"uri" locationName:"accessLogSubscriptionIdentifier" min:"17" 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 GetAccessLogSubscriptionInput) 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 GetAccessLogSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAccessLogSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAccessLogSubscriptionInput"} - if s.AccessLogSubscriptionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AccessLogSubscriptionIdentifier")) - } - if s.AccessLogSubscriptionIdentifier != nil && len(*s.AccessLogSubscriptionIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("AccessLogSubscriptionIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessLogSubscriptionIdentifier sets the AccessLogSubscriptionIdentifier field's value. -func (s *GetAccessLogSubscriptionInput) SetAccessLogSubscriptionIdentifier(v string) *GetAccessLogSubscriptionInput { - s.AccessLogSubscriptionIdentifier = &v - return s -} - -type GetAccessLogSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the access log subscription. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The date and time that the access log subscription was created, specified - // in ISO-8601 format. - // - // CreatedAt is a required field - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Amazon Resource Name (ARN) of the access log destination. - // - // DestinationArn is a required field - DestinationArn *string `locationName:"destinationArn" min:"20" type:"string" required:"true"` - - // The ID of the access log subscription. - // - // Id is a required field - Id *string `locationName:"id" min:"21" type:"string" required:"true"` - - // The date and time that the access log subscription was last updated, specified - // in ISO-8601 format. - // - // LastUpdatedAt is a required field - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The Amazon Resource Name (ARN) of the service network or service. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // The ID of the service network or service. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" min:"20" 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 GetAccessLogSubscriptionOutput) 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 GetAccessLogSubscriptionOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetAccessLogSubscriptionOutput) SetArn(v string) *GetAccessLogSubscriptionOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetAccessLogSubscriptionOutput) SetCreatedAt(v time.Time) *GetAccessLogSubscriptionOutput { - s.CreatedAt = &v - return s -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *GetAccessLogSubscriptionOutput) SetDestinationArn(v string) *GetAccessLogSubscriptionOutput { - s.DestinationArn = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetAccessLogSubscriptionOutput) SetId(v string) *GetAccessLogSubscriptionOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetAccessLogSubscriptionOutput) SetLastUpdatedAt(v time.Time) *GetAccessLogSubscriptionOutput { - s.LastUpdatedAt = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *GetAccessLogSubscriptionOutput) SetResourceArn(v string) *GetAccessLogSubscriptionOutput { - s.ResourceArn = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *GetAccessLogSubscriptionOutput) SetResourceId(v string) *GetAccessLogSubscriptionOutput { - s.ResourceId = &v - return s -} - -type GetAuthPolicyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the service network or service. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `location:"uri" locationName:"resourceIdentifier" min:"17" 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 GetAuthPolicyInput) 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 GetAuthPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAuthPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAuthPolicyInput"} - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - if s.ResourceIdentifier != nil && len(*s.ResourceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *GetAuthPolicyInput) SetResourceIdentifier(v string) *GetAuthPolicyInput { - s.ResourceIdentifier = &v - return s -} - -type GetAuthPolicyOutput struct { - _ struct{} `type:"structure"` - - // The date and time that the auth policy was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The date and time that the auth policy was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The auth policy. - Policy *string `locationName:"policy" type:"string"` - - // The state of the auth policy. The auth policy is only active when the auth - // type is set to Amazon Web Services_IAM. If you provide a policy, then authentication - // and authorization decisions are made based on this policy and the client's - // IAM policy. If the auth type is NONE, then any auth policy you provide will - // remain inactive. For more information, see Create a service network (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html#create-service-network) - // in the Amazon VPC Lattice User Guide. - State *string `locationName:"state" type:"string" enum:"AuthPolicyState"` -} - -// 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 GetAuthPolicyOutput) 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 GetAuthPolicyOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetAuthPolicyOutput) SetCreatedAt(v time.Time) *GetAuthPolicyOutput { - s.CreatedAt = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetAuthPolicyOutput) SetLastUpdatedAt(v time.Time) *GetAuthPolicyOutput { - s.LastUpdatedAt = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *GetAuthPolicyOutput) SetPolicy(v string) *GetAuthPolicyOutput { - s.Policy = &v - return s -} - -// SetState sets the State field's value. -func (s *GetAuthPolicyOutput) SetState(v string) *GetAuthPolicyOutput { - s.State = &v - return s -} - -type GetListenerInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 GetListenerInput) 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 GetListenerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetListenerInput"} - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *GetListenerInput) SetListenerIdentifier(v string) *GetListenerInput { - s.ListenerIdentifier = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *GetListenerInput) SetServiceIdentifier(v string) *GetListenerInput { - s.ServiceIdentifier = &v - return s -} - -type GetListenerOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the listener was created, specified in ISO-8601 format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The actions for the default listener rule. - DefaultAction *RuleAction `locationName:"defaultAction" type:"structure"` - - // The ID of the listener. - Id *string `locationName:"id" min:"26" type:"string"` - - // The date and time that the listener was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the listener. - Name *string `locationName:"name" min:"3" type:"string"` - - // The listener port. - Port *int64 `locationName:"port" min:"1" type:"integer"` - - // The listener protocol. - Protocol *string `locationName:"protocol" type:"string" enum:"ListenerProtocol"` - - // The Amazon Resource Name (ARN) of the service. - ServiceArn *string `locationName:"serviceArn" min:"20" type:"string"` - - // The ID of the service. - ServiceId *string `locationName:"serviceId" min:"21" 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 GetListenerOutput) 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 GetListenerOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetListenerOutput) SetArn(v string) *GetListenerOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetListenerOutput) SetCreatedAt(v time.Time) *GetListenerOutput { - s.CreatedAt = &v - return s -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *GetListenerOutput) SetDefaultAction(v *RuleAction) *GetListenerOutput { - s.DefaultAction = v - return s -} - -// SetId sets the Id field's value. -func (s *GetListenerOutput) SetId(v string) *GetListenerOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetListenerOutput) SetLastUpdatedAt(v time.Time) *GetListenerOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetListenerOutput) SetName(v string) *GetListenerOutput { - s.Name = &v - return s -} - -// SetPort sets the Port field's value. -func (s *GetListenerOutput) SetPort(v int64) *GetListenerOutput { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *GetListenerOutput) SetProtocol(v string) *GetListenerOutput { - s.Protocol = &v - return s -} - -// SetServiceArn sets the ServiceArn field's value. -func (s *GetListenerOutput) SetServiceArn(v string) *GetListenerOutput { - s.ServiceArn = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *GetListenerOutput) SetServiceId(v string) *GetListenerOutput { - s.ServiceId = &v - return s -} - -type GetResourcePolicyInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // An IAM policy. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" 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 GetResourcePolicyInput) 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 GetResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetResourcePolicyInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *GetResourcePolicyInput) SetResourceArn(v string) *GetResourcePolicyInput { - s.ResourceArn = &v - return s -} - -type GetResourcePolicyOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service network or service. - Policy *string `locationName:"policy" min:"1" 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 GetResourcePolicyOutput) 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 GetResourcePolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetResourcePolicyOutput) SetPolicy(v string) *GetResourcePolicyOutput { - s.Policy = &v - return s -} - -type GetRuleInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the listener rule. - // - // RuleIdentifier is a required field - RuleIdentifier *string `location:"uri" locationName:"ruleIdentifier" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 GetRuleInput) 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 GetRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetRuleInput"} - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.RuleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("RuleIdentifier")) - } - if s.RuleIdentifier != nil && len(*s.RuleIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RuleIdentifier", 20)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *GetRuleInput) SetListenerIdentifier(v string) *GetRuleInput { - s.ListenerIdentifier = &v - return s -} - -// SetRuleIdentifier sets the RuleIdentifier field's value. -func (s *GetRuleInput) SetRuleIdentifier(v string) *GetRuleInput { - s.RuleIdentifier = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *GetRuleInput) SetServiceIdentifier(v string) *GetRuleInput { - s.ServiceIdentifier = &v - return s -} - -type GetRuleOutput struct { - _ struct{} `type:"structure"` - - // The action for the default rule. - Action *RuleAction `locationName:"action" type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the listener rule was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the listener. - Id *string `locationName:"id" min:"5" type:"string"` - - // Indicates whether this is the default rule. - IsDefault *bool `locationName:"isDefault" type:"boolean"` - - // The date and time that the listener rule was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The rule match. - Match *RuleMatch `locationName:"match" type:"structure"` - - // The name of the listener. - Name *string `locationName:"name" min:"3" type:"string"` - - // The priority level for the specified rule. - Priority *int64 `locationName:"priority" min:"1" 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 GetRuleOutput) 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 GetRuleOutput) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *GetRuleOutput) SetAction(v *RuleAction) *GetRuleOutput { - s.Action = v - return s -} - -// SetArn sets the Arn field's value. -func (s *GetRuleOutput) SetArn(v string) *GetRuleOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetRuleOutput) SetCreatedAt(v time.Time) *GetRuleOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetRuleOutput) SetId(v string) *GetRuleOutput { - s.Id = &v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *GetRuleOutput) SetIsDefault(v bool) *GetRuleOutput { - s.IsDefault = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetRuleOutput) SetLastUpdatedAt(v time.Time) *GetRuleOutput { - s.LastUpdatedAt = &v - return s -} - -// SetMatch sets the Match field's value. -func (s *GetRuleOutput) SetMatch(v *RuleMatch) *GetRuleOutput { - s.Match = v - return s -} - -// SetName sets the Name field's value. -func (s *GetRuleOutput) SetName(v string) *GetRuleOutput { - s.Name = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *GetRuleOutput) SetPriority(v int64) *GetRuleOutput { - s.Priority = &v - return s -} - -type GetServiceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 GetServiceInput) 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 GetServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetServiceInput"} - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *GetServiceInput) SetServiceIdentifier(v string) *GetServiceInput { - s.ServiceIdentifier = &v - return s -} - -type GetServiceNetworkInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the service network. - // - // ServiceNetworkIdentifier is a required field - ServiceNetworkIdentifier *string `location:"uri" locationName:"serviceNetworkIdentifier" min:"3" 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 GetServiceNetworkInput) 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 GetServiceNetworkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetServiceNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetServiceNetworkInput"} - if s.ServiceNetworkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkIdentifier")) - } - if s.ServiceNetworkIdentifier != nil && len(*s.ServiceNetworkIdentifier) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkIdentifier", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceNetworkIdentifier sets the ServiceNetworkIdentifier field's value. -func (s *GetServiceNetworkInput) SetServiceNetworkIdentifier(v string) *GetServiceNetworkInput { - s.ServiceNetworkIdentifier = &v - return s -} - -type GetServiceNetworkOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service network. - Arn *string `locationName:"arn" min:"32" type:"string"` - - // The type of IAM policy. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // The date and time that the service network was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the service network. - Id *string `locationName:"id" min:"32" type:"string"` - - // The date and time of the last update, specified in ISO-8601 format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the service network. - Name *string `locationName:"name" min:"3" type:"string"` - - // The number of services associated with the service network. - NumberOfAssociatedServices *int64 `locationName:"numberOfAssociatedServices" type:"long"` - - // The number of VPCs associated with the service network. - NumberOfAssociatedVPCs *int64 `locationName:"numberOfAssociatedVPCs" type:"long"` -} - -// 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 GetServiceNetworkOutput) 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 GetServiceNetworkOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetServiceNetworkOutput) SetArn(v string) *GetServiceNetworkOutput { - s.Arn = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *GetServiceNetworkOutput) SetAuthType(v string) *GetServiceNetworkOutput { - s.AuthType = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetServiceNetworkOutput) SetCreatedAt(v time.Time) *GetServiceNetworkOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetServiceNetworkOutput) SetId(v string) *GetServiceNetworkOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetServiceNetworkOutput) SetLastUpdatedAt(v time.Time) *GetServiceNetworkOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetServiceNetworkOutput) SetName(v string) *GetServiceNetworkOutput { - s.Name = &v - return s -} - -// SetNumberOfAssociatedServices sets the NumberOfAssociatedServices field's value. -func (s *GetServiceNetworkOutput) SetNumberOfAssociatedServices(v int64) *GetServiceNetworkOutput { - s.NumberOfAssociatedServices = &v - return s -} - -// SetNumberOfAssociatedVPCs sets the NumberOfAssociatedVPCs field's value. -func (s *GetServiceNetworkOutput) SetNumberOfAssociatedVPCs(v int64) *GetServiceNetworkOutput { - s.NumberOfAssociatedVPCs = &v - return s -} - -type GetServiceNetworkServiceAssociationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the association. - // - // ServiceNetworkServiceAssociationIdentifier is a required field - ServiceNetworkServiceAssociationIdentifier *string `location:"uri" locationName:"serviceNetworkServiceAssociationIdentifier" min:"17" 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 GetServiceNetworkServiceAssociationInput) 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 GetServiceNetworkServiceAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetServiceNetworkServiceAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetServiceNetworkServiceAssociationInput"} - if s.ServiceNetworkServiceAssociationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkServiceAssociationIdentifier")) - } - if s.ServiceNetworkServiceAssociationIdentifier != nil && len(*s.ServiceNetworkServiceAssociationIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkServiceAssociationIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceNetworkServiceAssociationIdentifier sets the ServiceNetworkServiceAssociationIdentifier field's value. -func (s *GetServiceNetworkServiceAssociationInput) SetServiceNetworkServiceAssociationIdentifier(v string) *GetServiceNetworkServiceAssociationInput { - s.ServiceNetworkServiceAssociationIdentifier = &v - return s -} - -type GetServiceNetworkServiceAssociationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the association was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The account that created the association. - CreatedBy *string `locationName:"createdBy" min:"1" type:"string"` - - // The custom domain name of the service. - CustomDomainName *string `locationName:"customDomainName" min:"3" type:"string"` - - // The DNS name of the service. - DnsEntry *DnsEntry `locationName:"dnsEntry" type:"structure"` - - // The failure code. - FailureCode *string `locationName:"failureCode" type:"string"` - - // The failure message. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // The ID of the service network and service association. - Id *string `locationName:"id" min:"17" type:"string"` - - // The Amazon Resource Name (ARN) of the service. - ServiceArn *string `locationName:"serviceArn" min:"20" type:"string"` - - // The ID of the service. - ServiceId *string `locationName:"serviceId" min:"21" type:"string"` - - // The name of the service. - ServiceName *string `locationName:"serviceName" min:"3" type:"string"` - - // The Amazon Resource Name (ARN) of the service network. - ServiceNetworkArn *string `locationName:"serviceNetworkArn" min:"32" type:"string"` - - // The ID of the service network. - ServiceNetworkId *string `locationName:"serviceNetworkId" min:"32" type:"string"` - - // The name of the service network. - ServiceNetworkName *string `locationName:"serviceNetworkName" min:"3" type:"string"` - - // The status of the association. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkServiceAssociationStatus"` -} - -// 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 GetServiceNetworkServiceAssociationOutput) 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 GetServiceNetworkServiceAssociationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetArn(v string) *GetServiceNetworkServiceAssociationOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetCreatedAt(v time.Time) *GetServiceNetworkServiceAssociationOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetCreatedBy(v string) *GetServiceNetworkServiceAssociationOutput { - s.CreatedBy = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetCustomDomainName(v string) *GetServiceNetworkServiceAssociationOutput { - s.CustomDomainName = &v - return s -} - -// SetDnsEntry sets the DnsEntry field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetDnsEntry(v *DnsEntry) *GetServiceNetworkServiceAssociationOutput { - s.DnsEntry = v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetFailureCode(v string) *GetServiceNetworkServiceAssociationOutput { - s.FailureCode = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetFailureMessage(v string) *GetServiceNetworkServiceAssociationOutput { - s.FailureMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetId(v string) *GetServiceNetworkServiceAssociationOutput { - s.Id = &v - return s -} - -// SetServiceArn sets the ServiceArn field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetServiceArn(v string) *GetServiceNetworkServiceAssociationOutput { - s.ServiceArn = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetServiceId(v string) *GetServiceNetworkServiceAssociationOutput { - s.ServiceId = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetServiceName(v string) *GetServiceNetworkServiceAssociationOutput { - s.ServiceName = &v - return s -} - -// SetServiceNetworkArn sets the ServiceNetworkArn field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetServiceNetworkArn(v string) *GetServiceNetworkServiceAssociationOutput { - s.ServiceNetworkArn = &v - return s -} - -// SetServiceNetworkId sets the ServiceNetworkId field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetServiceNetworkId(v string) *GetServiceNetworkServiceAssociationOutput { - s.ServiceNetworkId = &v - return s -} - -// SetServiceNetworkName sets the ServiceNetworkName field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetServiceNetworkName(v string) *GetServiceNetworkServiceAssociationOutput { - s.ServiceNetworkName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetServiceNetworkServiceAssociationOutput) SetStatus(v string) *GetServiceNetworkServiceAssociationOutput { - s.Status = &v - return s -} - -type GetServiceNetworkVpcAssociationInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the association. - // - // ServiceNetworkVpcAssociationIdentifier is a required field - ServiceNetworkVpcAssociationIdentifier *string `location:"uri" locationName:"serviceNetworkVpcAssociationIdentifier" min:"17" 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 GetServiceNetworkVpcAssociationInput) 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 GetServiceNetworkVpcAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetServiceNetworkVpcAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetServiceNetworkVpcAssociationInput"} - if s.ServiceNetworkVpcAssociationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkVpcAssociationIdentifier")) - } - if s.ServiceNetworkVpcAssociationIdentifier != nil && len(*s.ServiceNetworkVpcAssociationIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkVpcAssociationIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServiceNetworkVpcAssociationIdentifier sets the ServiceNetworkVpcAssociationIdentifier field's value. -func (s *GetServiceNetworkVpcAssociationInput) SetServiceNetworkVpcAssociationIdentifier(v string) *GetServiceNetworkVpcAssociationInput { - s.ServiceNetworkVpcAssociationIdentifier = &v - return s -} - -type GetServiceNetworkVpcAssociationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the association was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The account that created the association. - CreatedBy *string `locationName:"createdBy" min:"1" type:"string"` - - // The failure code. - FailureCode *string `locationName:"failureCode" type:"string"` - - // The failure message. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // The ID of the specified association between the service network and the VPC. - Id *string `locationName:"id" min:"22" type:"string"` - - // The date and time that the association was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The IDs of the security groups. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // The Amazon Resource Name (ARN) of the service network. - ServiceNetworkArn *string `locationName:"serviceNetworkArn" min:"32" type:"string"` - - // The ID of the service network. - ServiceNetworkId *string `locationName:"serviceNetworkId" min:"32" type:"string"` - - // The name of the service network. - ServiceNetworkName *string `locationName:"serviceNetworkName" min:"3" type:"string"` - - // The status of the association. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkVpcAssociationStatus"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" min:"5" 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 GetServiceNetworkVpcAssociationOutput) 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 GetServiceNetworkVpcAssociationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetArn(v string) *GetServiceNetworkVpcAssociationOutput { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetCreatedAt(v time.Time) *GetServiceNetworkVpcAssociationOutput { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetCreatedBy(v string) *GetServiceNetworkVpcAssociationOutput { - s.CreatedBy = &v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetFailureCode(v string) *GetServiceNetworkVpcAssociationOutput { - s.FailureCode = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetFailureMessage(v string) *GetServiceNetworkVpcAssociationOutput { - s.FailureMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetId(v string) *GetServiceNetworkVpcAssociationOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetLastUpdatedAt(v time.Time) *GetServiceNetworkVpcAssociationOutput { - s.LastUpdatedAt = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetSecurityGroupIds(v []*string) *GetServiceNetworkVpcAssociationOutput { - s.SecurityGroupIds = v - return s -} - -// SetServiceNetworkArn sets the ServiceNetworkArn field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetServiceNetworkArn(v string) *GetServiceNetworkVpcAssociationOutput { - s.ServiceNetworkArn = &v - return s -} - -// SetServiceNetworkId sets the ServiceNetworkId field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetServiceNetworkId(v string) *GetServiceNetworkVpcAssociationOutput { - s.ServiceNetworkId = &v - return s -} - -// SetServiceNetworkName sets the ServiceNetworkName field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetServiceNetworkName(v string) *GetServiceNetworkVpcAssociationOutput { - s.ServiceNetworkName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetStatus(v string) *GetServiceNetworkVpcAssociationOutput { - s.Status = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *GetServiceNetworkVpcAssociationOutput) SetVpcId(v string) *GetServiceNetworkVpcAssociationOutput { - s.VpcId = &v - return s -} - -type GetServiceOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The type of IAM policy. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // The Amazon Resource Name (ARN) of the certificate. - CertificateArn *string `locationName:"certificateArn" type:"string"` - - // The date and time that the service was created, specified in ISO-8601 format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The custom domain name of the service. - CustomDomainName *string `locationName:"customDomainName" min:"3" type:"string"` - - // The DNS name of the service. - DnsEntry *DnsEntry `locationName:"dnsEntry" type:"structure"` - - // The failure code. - FailureCode *string `locationName:"failureCode" type:"string"` - - // The failure message. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // The ID of the service. - Id *string `locationName:"id" min:"21" type:"string"` - - // The date and time that the service was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the service. - Name *string `locationName:"name" min:"3" type:"string"` - - // The status of the service. - Status *string `locationName:"status" type:"string" enum:"ServiceStatus"` -} - -// 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 GetServiceOutput) 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 GetServiceOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetServiceOutput) SetArn(v string) *GetServiceOutput { - s.Arn = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *GetServiceOutput) SetAuthType(v string) *GetServiceOutput { - s.AuthType = &v - return s -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *GetServiceOutput) SetCertificateArn(v string) *GetServiceOutput { - s.CertificateArn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetServiceOutput) SetCreatedAt(v time.Time) *GetServiceOutput { - s.CreatedAt = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *GetServiceOutput) SetCustomDomainName(v string) *GetServiceOutput { - s.CustomDomainName = &v - return s -} - -// SetDnsEntry sets the DnsEntry field's value. -func (s *GetServiceOutput) SetDnsEntry(v *DnsEntry) *GetServiceOutput { - s.DnsEntry = v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *GetServiceOutput) SetFailureCode(v string) *GetServiceOutput { - s.FailureCode = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *GetServiceOutput) SetFailureMessage(v string) *GetServiceOutput { - s.FailureMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetServiceOutput) SetId(v string) *GetServiceOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetServiceOutput) SetLastUpdatedAt(v time.Time) *GetServiceOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetServiceOutput) SetName(v string) *GetServiceOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetServiceOutput) SetStatus(v string) *GetServiceOutput { - s.Status = &v - return s -} - -type GetTargetGroupInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the target group. - // - // TargetGroupIdentifier is a required field - TargetGroupIdentifier *string `location:"uri" locationName:"targetGroupIdentifier" min:"17" 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 GetTargetGroupInput) 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 GetTargetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTargetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTargetGroupInput"} - if s.TargetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupIdentifier")) - } - if s.TargetGroupIdentifier != nil && len(*s.TargetGroupIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroupIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupIdentifier sets the TargetGroupIdentifier field's value. -func (s *GetTargetGroupInput) SetTargetGroupIdentifier(v string) *GetTargetGroupInput { - s.TargetGroupIdentifier = &v - return s -} - -type GetTargetGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The target group configuration. - Config *TargetGroupConfig `locationName:"config" type:"structure"` - - // The date and time that the target group was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The failure code. - FailureCode *string `locationName:"failureCode" type:"string"` - - // The failure message. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // The ID of the target group. - Id *string `locationName:"id" min:"20" type:"string"` - - // The date and time that the target group was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the target group. - Name *string `locationName:"name" min:"3" type:"string"` - - // The Amazon Resource Names (ARNs) of the service. - ServiceArns []*string `locationName:"serviceArns" type:"list"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"TargetGroupStatus"` - - // The target group type. - Type *string `locationName:"type" type:"string" enum:"TargetGroupType"` -} - -// 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 GetTargetGroupOutput) 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 GetTargetGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GetTargetGroupOutput) SetArn(v string) *GetTargetGroupOutput { - s.Arn = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *GetTargetGroupOutput) SetConfig(v *TargetGroupConfig) *GetTargetGroupOutput { - s.Config = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *GetTargetGroupOutput) SetCreatedAt(v time.Time) *GetTargetGroupOutput { - s.CreatedAt = &v - return s -} - -// SetFailureCode sets the FailureCode field's value. -func (s *GetTargetGroupOutput) SetFailureCode(v string) *GetTargetGroupOutput { - s.FailureCode = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *GetTargetGroupOutput) SetFailureMessage(v string) *GetTargetGroupOutput { - s.FailureMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetTargetGroupOutput) SetId(v string) *GetTargetGroupOutput { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *GetTargetGroupOutput) SetLastUpdatedAt(v time.Time) *GetTargetGroupOutput { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetTargetGroupOutput) SetName(v string) *GetTargetGroupOutput { - s.Name = &v - return s -} - -// SetServiceArns sets the ServiceArns field's value. -func (s *GetTargetGroupOutput) SetServiceArns(v []*string) *GetTargetGroupOutput { - s.ServiceArns = v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetTargetGroupOutput) SetStatus(v string) *GetTargetGroupOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *GetTargetGroupOutput) SetType(v string) *GetTargetGroupOutput { - s.Type = &v - return s -} - -// Describes the constraints for a header match. Matches incoming requests with -// rule based on request header value before applying rule action. -type HeaderMatch struct { - _ struct{} `type:"structure"` - - // Indicates whether the match is case sensitive. Defaults to false. - CaseSensitive *bool `locationName:"caseSensitive" type:"boolean"` - - // The header match type. - // - // Match is a required field - Match *HeaderMatchType `locationName:"match" type:"structure" required:"true"` - - // The name of the header. - // - // Name is a required field - Name *string `locationName:"name" min:"1" 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 HeaderMatch) 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 HeaderMatch) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HeaderMatch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HeaderMatch"} - if s.Match == nil { - invalidParams.Add(request.NewErrParamRequired("Match")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Match != nil { - if err := s.Match.Validate(); err != nil { - invalidParams.AddNested("Match", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaseSensitive sets the CaseSensitive field's value. -func (s *HeaderMatch) SetCaseSensitive(v bool) *HeaderMatch { - s.CaseSensitive = &v - return s -} - -// SetMatch sets the Match field's value. -func (s *HeaderMatch) SetMatch(v *HeaderMatchType) *HeaderMatch { - s.Match = v - return s -} - -// SetName sets the Name field's value. -func (s *HeaderMatch) SetName(v string) *HeaderMatch { - s.Name = &v - return s -} - -// Describes a header match type. Only one can be provided. -type HeaderMatchType struct { - _ struct{} `type:"structure"` - - // Specifies a contains type match. - Contains *string `locationName:"contains" min:"1" type:"string"` - - // Specifies an exact type match. - Exact *string `locationName:"exact" min:"1" type:"string"` - - // Specifies a prefix type match. Matches the value with the prefix. - Prefix *string `locationName:"prefix" min:"1" 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 HeaderMatchType) 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 HeaderMatchType) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HeaderMatchType) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HeaderMatchType"} - if s.Contains != nil && len(*s.Contains) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Contains", 1)) - } - if s.Exact != nil && len(*s.Exact) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Exact", 1)) - } - if s.Prefix != nil && len(*s.Prefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Prefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContains sets the Contains field's value. -func (s *HeaderMatchType) SetContains(v string) *HeaderMatchType { - s.Contains = &v - return s -} - -// SetExact sets the Exact field's value. -func (s *HeaderMatchType) SetExact(v string) *HeaderMatchType { - s.Exact = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *HeaderMatchType) SetPrefix(v string) *HeaderMatchType { - s.Prefix = &v - return s -} - -// The health check configuration of a target group. Health check configurations -// aren't used for LAMBDA and ALB target groups. -type HealthCheckConfig struct { - _ struct{} `type:"structure"` - - // Indicates whether health checking is enabled. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The approximate amount of time, in seconds, between health checks of an individual - // target. The range is 5–300 seconds. The default is 30 seconds. - HealthCheckIntervalSeconds *int64 `locationName:"healthCheckIntervalSeconds" type:"integer"` - - // The amount of time, in seconds, to wait before reporting a target as unhealthy. - // The range is 1–120 seconds. The default is 5 seconds. - HealthCheckTimeoutSeconds *int64 `locationName:"healthCheckTimeoutSeconds" type:"integer"` - - // The number of consecutive successful health checks required before considering - // an unhealthy target healthy. The range is 2–10. The default is 5. - HealthyThresholdCount *int64 `locationName:"healthyThresholdCount" type:"integer"` - - // The codes to use when checking for a successful response from a target. These - // are called Success codes in the console. - Matcher *Matcher `locationName:"matcher" type:"structure"` - - // The destination for health checks on the targets. If the protocol version - // is HTTP/1.1 or HTTP/2, specify a valid URI (for example, /path?query). The - // default path is /. Health checks are not supported if the protocol version - // is gRPC, however, you can choose HTTP/1.1 or HTTP/2 and specify a valid URI. - Path *string `locationName:"path" type:"string"` - - // The port used when performing health checks on targets. The default setting - // is the port that a target receives traffic on. - Port *int64 `locationName:"port" type:"integer"` - - // The protocol used when performing health checks on targets. The possible - // protocols are HTTP and HTTPS. The default is HTTP. - Protocol *string `locationName:"protocol" type:"string" enum:"TargetGroupProtocol"` - - // The protocol version used when performing health checks on targets. The possible - // protocol versions are HTTP1 and HTTP2. - ProtocolVersion *string `locationName:"protocolVersion" type:"string" enum:"HealthCheckProtocolVersion"` - - // The number of consecutive failed health checks required before considering - // a target unhealthy. The range is 2–10. The default is 2. - UnhealthyThresholdCount *int64 `locationName:"unhealthyThresholdCount" 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 HealthCheckConfig) 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 HealthCheckConfig) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *HealthCheckConfig) SetEnabled(v bool) *HealthCheckConfig { - s.Enabled = &v - return s -} - -// SetHealthCheckIntervalSeconds sets the HealthCheckIntervalSeconds field's value. -func (s *HealthCheckConfig) SetHealthCheckIntervalSeconds(v int64) *HealthCheckConfig { - s.HealthCheckIntervalSeconds = &v - return s -} - -// SetHealthCheckTimeoutSeconds sets the HealthCheckTimeoutSeconds field's value. -func (s *HealthCheckConfig) SetHealthCheckTimeoutSeconds(v int64) *HealthCheckConfig { - s.HealthCheckTimeoutSeconds = &v - return s -} - -// SetHealthyThresholdCount sets the HealthyThresholdCount field's value. -func (s *HealthCheckConfig) SetHealthyThresholdCount(v int64) *HealthCheckConfig { - s.HealthyThresholdCount = &v - return s -} - -// SetMatcher sets the Matcher field's value. -func (s *HealthCheckConfig) SetMatcher(v *Matcher) *HealthCheckConfig { - s.Matcher = v - return s -} - -// SetPath sets the Path field's value. -func (s *HealthCheckConfig) SetPath(v string) *HealthCheckConfig { - s.Path = &v - return s -} - -// SetPort sets the Port field's value. -func (s *HealthCheckConfig) SetPort(v int64) *HealthCheckConfig { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *HealthCheckConfig) SetProtocol(v string) *HealthCheckConfig { - s.Protocol = &v - return s -} - -// SetProtocolVersion sets the ProtocolVersion field's value. -func (s *HealthCheckConfig) SetProtocolVersion(v string) *HealthCheckConfig { - s.ProtocolVersion = &v - return s -} - -// SetUnhealthyThresholdCount sets the UnhealthyThresholdCount field's value. -func (s *HealthCheckConfig) SetUnhealthyThresholdCount(v int64) *HealthCheckConfig { - s.UnhealthyThresholdCount = &v - return s -} - -// Describes criteria that can be applied to incoming requests. -type HttpMatch struct { - _ struct{} `type:"structure"` - - // The header matches. Matches incoming requests with rule based on request - // header value before applying rule action. - HeaderMatches []*HeaderMatch `locationName:"headerMatches" min:"1" type:"list"` - - // The HTTP method type. - Method *string `locationName:"method" type:"string"` - - // The path match. - PathMatch *PathMatch `locationName:"pathMatch" 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 HttpMatch) 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 HttpMatch) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HttpMatch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HttpMatch"} - if s.HeaderMatches != nil && len(s.HeaderMatches) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HeaderMatches", 1)) - } - if s.HeaderMatches != nil { - for i, v := range s.HeaderMatches { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "HeaderMatches", i), err.(request.ErrInvalidParams)) - } - } - } - if s.PathMatch != nil { - if err := s.PathMatch.Validate(); err != nil { - invalidParams.AddNested("PathMatch", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHeaderMatches sets the HeaderMatches field's value. -func (s *HttpMatch) SetHeaderMatches(v []*HeaderMatch) *HttpMatch { - s.HeaderMatches = v - return s -} - -// SetMethod sets the Method field's value. -func (s *HttpMatch) SetMethod(v string) *HttpMatch { - s.Method = &v - return s -} - -// SetPathMatch sets the PathMatch field's value. -func (s *HttpMatch) SetPathMatch(v *PathMatch) *HttpMatch { - s.PathMatch = v - return s -} - -// An unexpected error occurred while processing the request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The number of seconds to wait before retrying. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListAccessLogSubscriptionsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the service network or service. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `location:"querystring" locationName:"resourceIdentifier" min:"17" 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 ListAccessLogSubscriptionsInput) 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 ListAccessLogSubscriptionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAccessLogSubscriptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAccessLogSubscriptionsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - if s.ResourceIdentifier != nil && len(*s.ResourceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAccessLogSubscriptionsInput) SetMaxResults(v int64) *ListAccessLogSubscriptionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccessLogSubscriptionsInput) SetNextToken(v string) *ListAccessLogSubscriptionsInput { - s.NextToken = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *ListAccessLogSubscriptionsInput) SetResourceIdentifier(v string) *ListAccessLogSubscriptionsInput { - s.ResourceIdentifier = &v - return s -} - -type ListAccessLogSubscriptionsOutput struct { - _ struct{} `type:"structure"` - - // The access log subscriptions. - // - // Items is a required field - Items []*AccessLogSubscriptionSummary `locationName:"items" type:"list" required:"true"` - - // A pagination token for the next page of results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListAccessLogSubscriptionsOutput) 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 ListAccessLogSubscriptionsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListAccessLogSubscriptionsOutput) SetItems(v []*AccessLogSubscriptionSummary) *ListAccessLogSubscriptionsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccessLogSubscriptionsOutput) SetNextToken(v string) *ListAccessLogSubscriptionsOutput { - s.NextToken = &v - return s -} - -type ListListenersInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 ListListenersInput) 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 ListListenersInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListListenersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListListenersInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListListenersInput) SetMaxResults(v int64) *ListListenersInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListListenersInput) SetNextToken(v string) *ListListenersInput { - s.NextToken = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *ListListenersInput) SetServiceIdentifier(v string) *ListListenersInput { - s.ServiceIdentifier = &v - return s -} - -type ListListenersOutput struct { - _ struct{} `type:"structure"` - - // Information about the listeners. - // - // Items is a required field - Items []*ListenerSummary `locationName:"items" type:"list" required:"true"` - - // If there are additional results, a pagination token for the next page of - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListListenersOutput) 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 ListListenersOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListListenersOutput) SetItems(v []*ListenerSummary) *ListListenersOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListListenersOutput) SetNextToken(v string) *ListListenersOutput { - s.NextToken = &v - return s -} - -type ListRulesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 ListRulesInput) 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 ListRulesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRulesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRulesInput"} - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *ListRulesInput) SetListenerIdentifier(v string) *ListRulesInput { - s.ListenerIdentifier = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRulesInput) SetMaxResults(v int64) *ListRulesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRulesInput) SetNextToken(v string) *ListRulesInput { - s.NextToken = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *ListRulesInput) SetServiceIdentifier(v string) *ListRulesInput { - s.ServiceIdentifier = &v - return s -} - -type ListRulesOutput struct { - _ struct{} `type:"structure"` - - // Information about the rules. - // - // Items is a required field - Items []*RuleSummary `locationName:"items" type:"list" required:"true"` - - // If there are additional results, a pagination token for the next page of - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListRulesOutput) 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 ListRulesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListRulesOutput) SetItems(v []*RuleSummary) *ListRulesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRulesOutput) SetNextToken(v string) *ListRulesOutput { - s.NextToken = &v - return s -} - -type ListServiceNetworkServiceAssociationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the service. - ServiceIdentifier *string `location:"querystring" locationName:"serviceIdentifier" min:"17" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the service network. - ServiceNetworkIdentifier *string `location:"querystring" locationName:"serviceNetworkIdentifier" min:"3" 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 ListServiceNetworkServiceAssociationsInput) 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 ListServiceNetworkServiceAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListServiceNetworkServiceAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListServiceNetworkServiceAssociationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - if s.ServiceNetworkIdentifier != nil && len(*s.ServiceNetworkIdentifier) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkIdentifier", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListServiceNetworkServiceAssociationsInput) SetMaxResults(v int64) *ListServiceNetworkServiceAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServiceNetworkServiceAssociationsInput) SetNextToken(v string) *ListServiceNetworkServiceAssociationsInput { - s.NextToken = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *ListServiceNetworkServiceAssociationsInput) SetServiceIdentifier(v string) *ListServiceNetworkServiceAssociationsInput { - s.ServiceIdentifier = &v - return s -} - -// SetServiceNetworkIdentifier sets the ServiceNetworkIdentifier field's value. -func (s *ListServiceNetworkServiceAssociationsInput) SetServiceNetworkIdentifier(v string) *ListServiceNetworkServiceAssociationsInput { - s.ServiceNetworkIdentifier = &v - return s -} - -type ListServiceNetworkServiceAssociationsOutput struct { - _ struct{} `type:"structure"` - - // Information about the associations. - // - // Items is a required field - Items []*ServiceNetworkServiceAssociationSummary `locationName:"items" type:"list" required:"true"` - - // If there are additional results, a pagination token for the next page of - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListServiceNetworkServiceAssociationsOutput) 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 ListServiceNetworkServiceAssociationsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListServiceNetworkServiceAssociationsOutput) SetItems(v []*ServiceNetworkServiceAssociationSummary) *ListServiceNetworkServiceAssociationsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServiceNetworkServiceAssociationsOutput) SetNextToken(v string) *ListServiceNetworkServiceAssociationsOutput { - s.NextToken = &v - return s -} - -type ListServiceNetworkVpcAssociationsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the service network. - ServiceNetworkIdentifier *string `location:"querystring" locationName:"serviceNetworkIdentifier" min:"3" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the VPC. - VpcIdentifier *string `location:"querystring" locationName:"vpcIdentifier" min:"5" 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 ListServiceNetworkVpcAssociationsInput) 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 ListServiceNetworkVpcAssociationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListServiceNetworkVpcAssociationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListServiceNetworkVpcAssociationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.ServiceNetworkIdentifier != nil && len(*s.ServiceNetworkIdentifier) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkIdentifier", 3)) - } - if s.VpcIdentifier != nil && len(*s.VpcIdentifier) < 5 { - invalidParams.Add(request.NewErrParamMinLen("VpcIdentifier", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListServiceNetworkVpcAssociationsInput) SetMaxResults(v int64) *ListServiceNetworkVpcAssociationsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServiceNetworkVpcAssociationsInput) SetNextToken(v string) *ListServiceNetworkVpcAssociationsInput { - s.NextToken = &v - return s -} - -// SetServiceNetworkIdentifier sets the ServiceNetworkIdentifier field's value. -func (s *ListServiceNetworkVpcAssociationsInput) SetServiceNetworkIdentifier(v string) *ListServiceNetworkVpcAssociationsInput { - s.ServiceNetworkIdentifier = &v - return s -} - -// SetVpcIdentifier sets the VpcIdentifier field's value. -func (s *ListServiceNetworkVpcAssociationsInput) SetVpcIdentifier(v string) *ListServiceNetworkVpcAssociationsInput { - s.VpcIdentifier = &v - return s -} - -type ListServiceNetworkVpcAssociationsOutput struct { - _ struct{} `type:"structure"` - - // Information about the associations. - // - // Items is a required field - Items []*ServiceNetworkVpcAssociationSummary `locationName:"items" type:"list" required:"true"` - - // If there are additional results, a pagination token for the next page of - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListServiceNetworkVpcAssociationsOutput) 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 ListServiceNetworkVpcAssociationsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListServiceNetworkVpcAssociationsOutput) SetItems(v []*ServiceNetworkVpcAssociationSummary) *ListServiceNetworkVpcAssociationsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServiceNetworkVpcAssociationsOutput) SetNextToken(v string) *ListServiceNetworkVpcAssociationsOutput { - s.NextToken = &v - return s -} - -type ListServiceNetworksInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListServiceNetworksInput) 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 ListServiceNetworksInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListServiceNetworksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListServiceNetworksInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListServiceNetworksInput) SetMaxResults(v int64) *ListServiceNetworksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServiceNetworksInput) SetNextToken(v string) *ListServiceNetworksInput { - s.NextToken = &v - return s -} - -type ListServiceNetworksOutput struct { - _ struct{} `type:"structure"` - - // Information about the service networks. - // - // Items is a required field - Items []*ServiceNetworkSummary `locationName:"items" type:"list" required:"true"` - - // If there are additional results, a pagination token for the next page of - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListServiceNetworksOutput) 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 ListServiceNetworksOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListServiceNetworksOutput) SetItems(v []*ServiceNetworkSummary) *ListServiceNetworksOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServiceNetworksOutput) SetNextToken(v string) *ListServiceNetworksOutput { - s.NextToken = &v - return s -} - -type ListServicesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" 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 ListServicesInput) 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 ListServicesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListServicesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListServicesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListServicesInput) SetMaxResults(v int64) *ListServicesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServicesInput) SetNextToken(v string) *ListServicesInput { - s.NextToken = &v - return s -} - -type ListServicesOutput struct { - _ struct{} `type:"structure"` - - // The services. - Items []*ServiceSummary `locationName:"items" type:"list"` - - // If there are additional results, a pagination token for the next page of - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListServicesOutput) 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 ListServicesOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListServicesOutput) SetItems(v []*ServiceSummary) *ListServicesOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListServicesOutput) SetNextToken(v string) *ListServicesOutput { - s.NextToken = &v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // The tags. - Tags map[string]*string `locationName:"tags" type:"map"` -} - -// 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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListTargetGroupsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The target group type. - TargetGroupType *string `location:"querystring" locationName:"targetGroupType" type:"string" enum:"TargetGroupType"` - - // The ID or Amazon Resource Name (ARN) of the service. - VpcIdentifier *string `location:"querystring" locationName:"vpcIdentifier" min:"5" 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 ListTargetGroupsInput) 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 ListTargetGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTargetGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTargetGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.VpcIdentifier != nil && len(*s.VpcIdentifier) < 5 { - invalidParams.Add(request.NewErrParamMinLen("VpcIdentifier", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTargetGroupsInput) SetMaxResults(v int64) *ListTargetGroupsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTargetGroupsInput) SetNextToken(v string) *ListTargetGroupsInput { - s.NextToken = &v - return s -} - -// SetTargetGroupType sets the TargetGroupType field's value. -func (s *ListTargetGroupsInput) SetTargetGroupType(v string) *ListTargetGroupsInput { - s.TargetGroupType = &v - return s -} - -// SetVpcIdentifier sets the VpcIdentifier field's value. -func (s *ListTargetGroupsInput) SetVpcIdentifier(v string) *ListTargetGroupsInput { - s.VpcIdentifier = &v - return s -} - -type ListTargetGroupsOutput struct { - _ struct{} `type:"structure"` - - // Information about the target groups. - Items []*TargetGroupSummary `locationName:"items" type:"list"` - - // If there are additional results, a pagination token for the next page of - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListTargetGroupsOutput) 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 ListTargetGroupsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListTargetGroupsOutput) SetItems(v []*TargetGroupSummary) *ListTargetGroupsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTargetGroupsOutput) SetNextToken(v string) *ListTargetGroupsOutput { - s.NextToken = &v - return s -} - -type ListTargetsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // A pagination token for the next page of results. - NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the target group. - // - // TargetGroupIdentifier is a required field - TargetGroupIdentifier *string `location:"uri" locationName:"targetGroupIdentifier" min:"17" type:"string" required:"true"` - - // The targets to list. - Targets []*Target `locationName:"targets" type:"list"` -} - -// 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 ListTargetsInput) 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 ListTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTargetsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.TargetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupIdentifier")) - } - if s.TargetGroupIdentifier != nil && len(*s.TargetGroupIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroupIdentifier", 17)) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTargetsInput) SetMaxResults(v int64) *ListTargetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTargetsInput) SetNextToken(v string) *ListTargetsInput { - s.NextToken = &v - return s -} - -// SetTargetGroupIdentifier sets the TargetGroupIdentifier field's value. -func (s *ListTargetsInput) SetTargetGroupIdentifier(v string) *ListTargetsInput { - s.TargetGroupIdentifier = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *ListTargetsInput) SetTargets(v []*Target) *ListTargetsInput { - s.Targets = v - return s -} - -type ListTargetsOutput struct { - _ struct{} `type:"structure"` - - // Information about the targets. - // - // Items is a required field - Items []*TargetSummary `locationName:"items" type:"list" required:"true"` - - // If there are additional results, a pagination token for the next page of - // results. - NextToken *string `locationName:"nextToken" min:"1" 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 ListTargetsOutput) 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 ListTargetsOutput) GoString() string { - return s.String() -} - -// SetItems sets the Items field's value. -func (s *ListTargetsOutput) SetItems(v []*TargetSummary) *ListTargetsOutput { - s.Items = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTargetsOutput) SetNextToken(v string) *ListTargetsOutput { - s.NextToken = &v - return s -} - -// Summary information about a listener. -type ListenerSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the listener was created, specified in ISO-8601 format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the listener. - Id *string `locationName:"id" min:"26" type:"string"` - - // The date and time that the listener was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the listener. - Name *string `locationName:"name" min:"3" type:"string"` - - // The listener port. - Port *int64 `locationName:"port" min:"1" type:"integer"` - - // The listener protocol. - Protocol *string `locationName:"protocol" type:"string" enum:"ListenerProtocol"` -} - -// 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 ListenerSummary) 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 ListenerSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ListenerSummary) SetArn(v string) *ListenerSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ListenerSummary) SetCreatedAt(v time.Time) *ListenerSummary { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *ListenerSummary) SetId(v string) *ListenerSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *ListenerSummary) SetLastUpdatedAt(v time.Time) *ListenerSummary { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListenerSummary) SetName(v string) *ListenerSummary { - s.Name = &v - return s -} - -// SetPort sets the Port field's value. -func (s *ListenerSummary) SetPort(v int64) *ListenerSummary { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *ListenerSummary) SetProtocol(v string) *ListenerSummary { - s.Protocol = &v - return s -} - -// The codes to use when checking for a successful response from a target for -// health checks. -type Matcher struct { - _ struct{} `type:"structure"` - - // The HTTP code to use when checking for a successful response from a target. - HttpCode *string `locationName:"httpCode" 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 Matcher) 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 Matcher) GoString() string { - return s.String() -} - -// SetHttpCode sets the HttpCode field's value. -func (s *Matcher) SetHttpCode(v string) *Matcher { - s.HttpCode = &v - return s -} - -// Describes the conditions that can be applied when matching a path for incoming -// requests. -type PathMatch struct { - _ struct{} `type:"structure"` - - // Indicates whether the match is case sensitive. Defaults to false. - CaseSensitive *bool `locationName:"caseSensitive" type:"boolean"` - - // The type of path match. - // - // Match is a required field - Match *PathMatchType `locationName:"match" type:"structure" 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 PathMatch) 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 PathMatch) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PathMatch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PathMatch"} - if s.Match == nil { - invalidParams.Add(request.NewErrParamRequired("Match")) - } - if s.Match != nil { - if err := s.Match.Validate(); err != nil { - invalidParams.AddNested("Match", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaseSensitive sets the CaseSensitive field's value. -func (s *PathMatch) SetCaseSensitive(v bool) *PathMatch { - s.CaseSensitive = &v - return s -} - -// SetMatch sets the Match field's value. -func (s *PathMatch) SetMatch(v *PathMatchType) *PathMatch { - s.Match = v - return s -} - -// Describes a path match type. Each rule can include only one of the following -// types of paths. -type PathMatchType struct { - _ struct{} `type:"structure"` - - // An exact match of the path. - Exact *string `locationName:"exact" min:"1" type:"string"` - - // A prefix match of the path. - Prefix *string `locationName:"prefix" min:"1" 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 PathMatchType) 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 PathMatchType) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PathMatchType) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PathMatchType"} - if s.Exact != nil && len(*s.Exact) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Exact", 1)) - } - if s.Prefix != nil && len(*s.Prefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Prefix", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExact sets the Exact field's value. -func (s *PathMatchType) SetExact(v string) *PathMatchType { - s.Exact = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *PathMatchType) SetPrefix(v string) *PathMatchType { - s.Prefix = &v - return s -} - -type PutAuthPolicyInput struct { - _ struct{} `type:"structure"` - - // The auth policy. - // - // Policy is a required field - Policy *string `locationName:"policy" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service network or service for - // which the policy is created. - // - // ResourceIdentifier is a required field - ResourceIdentifier *string `location:"uri" locationName:"resourceIdentifier" min:"17" 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 PutAuthPolicyInput) 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 PutAuthPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutAuthPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutAuthPolicyInput"} - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - if s.ResourceIdentifier != nil && len(*s.ResourceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicy sets the Policy field's value. -func (s *PutAuthPolicyInput) SetPolicy(v string) *PutAuthPolicyInput { - s.Policy = &v - return s -} - -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *PutAuthPolicyInput) SetResourceIdentifier(v string) *PutAuthPolicyInput { - s.ResourceIdentifier = &v - return s -} - -type PutAuthPolicyOutput struct { - _ struct{} `type:"structure"` - - // The auth policy. - Policy *string `locationName:"policy" type:"string"` - - // The state of the auth policy. The auth policy is only active when the auth - // type is set to Amazon Web Services_IAM. If you provide a policy, then authentication - // and authorization decisions are made based on this policy and the client's - // IAM policy. If the Auth type is NONE, then, any auth policy you provide will - // remain inactive. For more information, see Create a service network (https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html#create-service-network) - // in the Amazon VPC Lattice User Guide. - State *string `locationName:"state" type:"string" enum:"AuthPolicyState"` -} - -// 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 PutAuthPolicyOutput) 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 PutAuthPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *PutAuthPolicyOutput) SetPolicy(v string) *PutAuthPolicyOutput { - s.Policy = &v - return s -} - -// SetState sets the State field's value. -func (s *PutAuthPolicyOutput) SetState(v string) *PutAuthPolicyOutput { - s.State = &v - return s -} - -type PutResourcePolicyInput struct { - _ struct{} `type:"structure"` - - // An IAM policy. - // - // Policy is a required field - Policy *string `locationName:"policy" min:"1" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service network or service for - // which the policy is created. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" min:"20" 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 PutResourcePolicyInput) 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 PutResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutResourcePolicyInput"} - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - if s.Policy != nil && len(*s.Policy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) - } - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicy sets the Policy field's value. -func (s *PutResourcePolicyInput) SetPolicy(v string) *PutResourcePolicyInput { - s.Policy = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *PutResourcePolicyInput) SetResourceArn(v string) *PutResourcePolicyInput { - s.ResourceArn = &v - return s -} - -type PutResourcePolicyOutput 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 PutResourcePolicyOutput) 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 PutResourcePolicyOutput) GoString() string { - return s.String() -} - -type RegisterTargetsInput struct { - _ struct{} `type:"structure"` - - // The ID or Amazon Resource Name (ARN) of the target group. - // - // TargetGroupIdentifier is a required field - TargetGroupIdentifier *string `location:"uri" locationName:"targetGroupIdentifier" min:"17" type:"string" required:"true"` - - // The targets. - // - // Targets is a required field - Targets []*Target `locationName:"targets" min:"1" type:"list" 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 RegisterTargetsInput) 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 RegisterTargetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterTargetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterTargetsInput"} - if s.TargetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupIdentifier")) - } - if s.TargetGroupIdentifier != nil && len(*s.TargetGroupIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroupIdentifier", 17)) - } - if s.Targets == nil { - invalidParams.Add(request.NewErrParamRequired("Targets")) - } - if s.Targets != nil && len(s.Targets) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Targets", 1)) - } - if s.Targets != nil { - for i, v := range s.Targets { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Targets", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupIdentifier sets the TargetGroupIdentifier field's value. -func (s *RegisterTargetsInput) SetTargetGroupIdentifier(v string) *RegisterTargetsInput { - s.TargetGroupIdentifier = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *RegisterTargetsInput) SetTargets(v []*Target) *RegisterTargetsInput { - s.Targets = v - return s -} - -type RegisterTargetsOutput struct { - _ struct{} `type:"structure"` - - // The targets that were successfully registered. - Successful []*Target `locationName:"successful" type:"list"` - - // The targets that were not registered. - Unsuccessful []*TargetFailure `locationName:"unsuccessful" type:"list"` -} - -// 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 RegisterTargetsOutput) 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 RegisterTargetsOutput) GoString() string { - return s.String() -} - -// SetSuccessful sets the Successful field's value. -func (s *RegisterTargetsOutput) SetSuccessful(v []*Target) *RegisterTargetsOutput { - s.Successful = v - return s -} - -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *RegisterTargetsOutput) SetUnsuccessful(v []*TargetFailure) *RegisterTargetsOutput { - s.Unsuccessful = v - return s -} - -// The request references a resource that does not exist. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The resource ID. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" type:"string" required:"true"` - - // The resource type. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Describes the action for a rule. Each rule must include exactly one of the -// following types of actions: forward or fixed-response, and it must be the -// last action to be performed. -type RuleAction struct { - _ struct{} `type:"structure"` - - // Describes the rule action that returns a custom HTTP response. - FixedResponse *FixedResponseAction `locationName:"fixedResponse" type:"structure"` - - // The forward action. Traffic that matches the rule is forwarded to the specified - // target groups. - Forward *ForwardAction `locationName:"forward" 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 RuleAction) 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 RuleAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RuleAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RuleAction"} - if s.FixedResponse != nil { - if err := s.FixedResponse.Validate(); err != nil { - invalidParams.AddNested("FixedResponse", err.(request.ErrInvalidParams)) - } - } - if s.Forward != nil { - if err := s.Forward.Validate(); err != nil { - invalidParams.AddNested("Forward", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFixedResponse sets the FixedResponse field's value. -func (s *RuleAction) SetFixedResponse(v *FixedResponseAction) *RuleAction { - s.FixedResponse = v - return s -} - -// SetForward sets the Forward field's value. -func (s *RuleAction) SetForward(v *ForwardAction) *RuleAction { - s.Forward = v - return s -} - -// Describes a rule match. -type RuleMatch struct { - _ struct{} `type:"structure"` - - // The HTTP criteria that a rule must match. - HttpMatch *HttpMatch `locationName:"httpMatch" 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 RuleMatch) 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 RuleMatch) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RuleMatch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RuleMatch"} - if s.HttpMatch != nil { - if err := s.HttpMatch.Validate(); err != nil { - invalidParams.AddNested("HttpMatch", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHttpMatch sets the HttpMatch field's value. -func (s *RuleMatch) SetHttpMatch(v *HttpMatch) *RuleMatch { - s.HttpMatch = v - return s -} - -// Summary information about the listener rule. -type RuleSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rule. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the listener rule was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the rule. - Id *string `locationName:"id" min:"5" type:"string"` - - // Indicates whether this is the default rule. Listener rules are created when - // you create a listener. Each listener has a default rule for checking connection - // requests. - IsDefault *bool `locationName:"isDefault" type:"boolean"` - - // The date and time that the listener rule was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the rule. - Name *string `locationName:"name" min:"3" type:"string"` - - // The priority of the rule. - Priority *int64 `locationName:"priority" min:"1" 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 RuleSummary) 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 RuleSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *RuleSummary) SetArn(v string) *RuleSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *RuleSummary) SetCreatedAt(v time.Time) *RuleSummary { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *RuleSummary) SetId(v string) *RuleSummary { - s.Id = &v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *RuleSummary) SetIsDefault(v bool) *RuleSummary { - s.IsDefault = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *RuleSummary) SetLastUpdatedAt(v time.Time) *RuleSummary { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *RuleSummary) SetName(v string) *RuleSummary { - s.Name = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *RuleSummary) SetPriority(v int64) *RuleSummary { - s.Priority = &v - return s -} - -// Represents an object when updating a rule. -type RuleUpdate struct { - _ struct{} `type:"structure"` - - // The rule action. - Action *RuleAction `locationName:"action" type:"structure"` - - // The rule match. - Match *RuleMatch `locationName:"match" type:"structure"` - - // The rule priority. A listener can't have multiple rules with the same priority. - Priority *int64 `locationName:"priority" min:"1" type:"integer"` - - // The ID or Amazon Resource Name (ARN) of the rule. - // - // RuleIdentifier is a required field - RuleIdentifier *string `locationName:"ruleIdentifier" min:"20" 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 RuleUpdate) 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 RuleUpdate) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RuleUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RuleUpdate"} - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - if s.RuleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("RuleIdentifier")) - } - if s.RuleIdentifier != nil && len(*s.RuleIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RuleIdentifier", 20)) - } - if s.Action != nil { - if err := s.Action.Validate(); err != nil { - invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) - } - } - if s.Match != nil { - if err := s.Match.Validate(); err != nil { - invalidParams.AddNested("Match", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *RuleUpdate) SetAction(v *RuleAction) *RuleUpdate { - s.Action = v - return s -} - -// SetMatch sets the Match field's value. -func (s *RuleUpdate) SetMatch(v *RuleMatch) *RuleUpdate { - s.Match = v - return s -} - -// SetPriority sets the Priority field's value. -func (s *RuleUpdate) SetPriority(v int64) *RuleUpdate { - s.Priority = &v - return s -} - -// SetRuleIdentifier sets the RuleIdentifier field's value. -func (s *RuleUpdate) SetRuleIdentifier(v string) *RuleUpdate { - s.RuleIdentifier = &v - return s -} - -// Describes a rule update that failed. -type RuleUpdateFailure struct { - _ struct{} `type:"structure"` - - // The failure code. - FailureCode *string `locationName:"failureCode" type:"string"` - - // The failure message. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the rule. - RuleIdentifier *string `locationName:"ruleIdentifier" min:"20" 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 RuleUpdateFailure) 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 RuleUpdateFailure) GoString() string { - return s.String() -} - -// SetFailureCode sets the FailureCode field's value. -func (s *RuleUpdateFailure) SetFailureCode(v string) *RuleUpdateFailure { - s.FailureCode = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *RuleUpdateFailure) SetFailureMessage(v string) *RuleUpdateFailure { - s.FailureMessage = &v - return s -} - -// SetRuleIdentifier sets the RuleIdentifier field's value. -func (s *RuleUpdateFailure) SetRuleIdentifier(v string) *RuleUpdateFailure { - s.RuleIdentifier = &v - return s -} - -// Describes a successful rule update. -type RuleUpdateSuccess struct { - _ struct{} `type:"structure"` - - // The action for the default rule. - Action *RuleAction `locationName:"action" type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the listener. - Id *string `locationName:"id" min:"5" type:"string"` - - // Indicates whether this is the default rule. - IsDefault *bool `locationName:"isDefault" type:"boolean"` - - // The rule match. - Match *RuleMatch `locationName:"match" type:"structure"` - - // The name of the listener. - Name *string `locationName:"name" min:"3" type:"string"` - - // The rule priority. - Priority *int64 `locationName:"priority" min:"1" 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 RuleUpdateSuccess) 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 RuleUpdateSuccess) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *RuleUpdateSuccess) SetAction(v *RuleAction) *RuleUpdateSuccess { - s.Action = v - return s -} - -// SetArn sets the Arn field's value. -func (s *RuleUpdateSuccess) SetArn(v string) *RuleUpdateSuccess { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *RuleUpdateSuccess) SetId(v string) *RuleUpdateSuccess { - s.Id = &v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *RuleUpdateSuccess) SetIsDefault(v bool) *RuleUpdateSuccess { - s.IsDefault = &v - return s -} - -// SetMatch sets the Match field's value. -func (s *RuleUpdateSuccess) SetMatch(v *RuleMatch) *RuleUpdateSuccess { - s.Match = v - return s -} - -// SetName sets the Name field's value. -func (s *RuleUpdateSuccess) SetName(v string) *RuleUpdateSuccess { - s.Name = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *RuleUpdateSuccess) SetPriority(v int64) *RuleUpdateSuccess { - s.Priority = &v - return s -} - -// Summary information about the association between a service network and a -// service. -type ServiceNetworkServiceAssociationSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the association was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The account that created the association. - CreatedBy *string `locationName:"createdBy" min:"1" type:"string"` - - // The custom domain name of the service. - CustomDomainName *string `locationName:"customDomainName" min:"3" type:"string"` - - // DNS information about the service. - DnsEntry *DnsEntry `locationName:"dnsEntry" type:"structure"` - - // The ID of the association. - Id *string `locationName:"id" min:"17" type:"string"` - - // The Amazon Resource Name (ARN) of the service. - ServiceArn *string `locationName:"serviceArn" min:"20" type:"string"` - - // The ID of the service. - ServiceId *string `locationName:"serviceId" min:"21" type:"string"` - - // The name of the service. - ServiceName *string `locationName:"serviceName" min:"3" type:"string"` - - // The Amazon Resource Name (ARN) of the service network. - ServiceNetworkArn *string `locationName:"serviceNetworkArn" min:"32" type:"string"` - - // The ID of the service network. - ServiceNetworkId *string `locationName:"serviceNetworkId" min:"32" type:"string"` - - // The name of the service network. - ServiceNetworkName *string `locationName:"serviceNetworkName" min:"3" type:"string"` - - // The status. If the deletion fails, try to delete again. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkServiceAssociationStatus"` -} - -// 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 ServiceNetworkServiceAssociationSummary) 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 ServiceNetworkServiceAssociationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetArn(v string) *ServiceNetworkServiceAssociationSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetCreatedAt(v time.Time) *ServiceNetworkServiceAssociationSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetCreatedBy(v string) *ServiceNetworkServiceAssociationSummary { - s.CreatedBy = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetCustomDomainName(v string) *ServiceNetworkServiceAssociationSummary { - s.CustomDomainName = &v - return s -} - -// SetDnsEntry sets the DnsEntry field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetDnsEntry(v *DnsEntry) *ServiceNetworkServiceAssociationSummary { - s.DnsEntry = v - return s -} - -// SetId sets the Id field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetId(v string) *ServiceNetworkServiceAssociationSummary { - s.Id = &v - return s -} - -// SetServiceArn sets the ServiceArn field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetServiceArn(v string) *ServiceNetworkServiceAssociationSummary { - s.ServiceArn = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetServiceId(v string) *ServiceNetworkServiceAssociationSummary { - s.ServiceId = &v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetServiceName(v string) *ServiceNetworkServiceAssociationSummary { - s.ServiceName = &v - return s -} - -// SetServiceNetworkArn sets the ServiceNetworkArn field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetServiceNetworkArn(v string) *ServiceNetworkServiceAssociationSummary { - s.ServiceNetworkArn = &v - return s -} - -// SetServiceNetworkId sets the ServiceNetworkId field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetServiceNetworkId(v string) *ServiceNetworkServiceAssociationSummary { - s.ServiceNetworkId = &v - return s -} - -// SetServiceNetworkName sets the ServiceNetworkName field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetServiceNetworkName(v string) *ServiceNetworkServiceAssociationSummary { - s.ServiceNetworkName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ServiceNetworkServiceAssociationSummary) SetStatus(v string) *ServiceNetworkServiceAssociationSummary { - s.Status = &v - return s -} - -// Summary information about a service network. -type ServiceNetworkSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service network. - Arn *string `locationName:"arn" min:"32" type:"string"` - - // The date and time that the service network was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the service network. - Id *string `locationName:"id" min:"32" type:"string"` - - // The date and time that the service network was last updated, specified in - // ISO-8601 format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the service network. - Name *string `locationName:"name" min:"3" type:"string"` - - // The number of services associated with the service network. - NumberOfAssociatedServices *int64 `locationName:"numberOfAssociatedServices" type:"long"` - - // The number of VPCs associated with the service network. - NumberOfAssociatedVPCs *int64 `locationName:"numberOfAssociatedVPCs" type:"long"` -} - -// 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 ServiceNetworkSummary) 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 ServiceNetworkSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ServiceNetworkSummary) SetArn(v string) *ServiceNetworkSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServiceNetworkSummary) SetCreatedAt(v time.Time) *ServiceNetworkSummary { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *ServiceNetworkSummary) SetId(v string) *ServiceNetworkSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *ServiceNetworkSummary) SetLastUpdatedAt(v time.Time) *ServiceNetworkSummary { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *ServiceNetworkSummary) SetName(v string) *ServiceNetworkSummary { - s.Name = &v - return s -} - -// SetNumberOfAssociatedServices sets the NumberOfAssociatedServices field's value. -func (s *ServiceNetworkSummary) SetNumberOfAssociatedServices(v int64) *ServiceNetworkSummary { - s.NumberOfAssociatedServices = &v - return s -} - -// SetNumberOfAssociatedVPCs sets the NumberOfAssociatedVPCs field's value. -func (s *ServiceNetworkSummary) SetNumberOfAssociatedVPCs(v int64) *ServiceNetworkSummary { - s.NumberOfAssociatedVPCs = &v - return s -} - -// Summary information about an association between a service network and a -// VPC. -type ServiceNetworkVpcAssociationSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the association was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The account that created the association. - CreatedBy *string `locationName:"createdBy" min:"1" type:"string"` - - // The ID of the association. - Id *string `locationName:"id" min:"22" type:"string"` - - // The date and time that the association was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The Amazon Resource Name (ARN) of the service network. - ServiceNetworkArn *string `locationName:"serviceNetworkArn" min:"32" type:"string"` - - // The ID of the service network. - ServiceNetworkId *string `locationName:"serviceNetworkId" min:"32" type:"string"` - - // The name of the service network. - ServiceNetworkName *string `locationName:"serviceNetworkName" min:"3" type:"string"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkVpcAssociationStatus"` - - // The ID of the VPC. - VpcId *string `locationName:"vpcId" min:"5" 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 ServiceNetworkVpcAssociationSummary) 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 ServiceNetworkVpcAssociationSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetArn(v string) *ServiceNetworkVpcAssociationSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetCreatedAt(v time.Time) *ServiceNetworkVpcAssociationSummary { - s.CreatedAt = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetCreatedBy(v string) *ServiceNetworkVpcAssociationSummary { - s.CreatedBy = &v - return s -} - -// SetId sets the Id field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetId(v string) *ServiceNetworkVpcAssociationSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetLastUpdatedAt(v time.Time) *ServiceNetworkVpcAssociationSummary { - s.LastUpdatedAt = &v - return s -} - -// SetServiceNetworkArn sets the ServiceNetworkArn field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetServiceNetworkArn(v string) *ServiceNetworkVpcAssociationSummary { - s.ServiceNetworkArn = &v - return s -} - -// SetServiceNetworkId sets the ServiceNetworkId field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetServiceNetworkId(v string) *ServiceNetworkVpcAssociationSummary { - s.ServiceNetworkId = &v - return s -} - -// SetServiceNetworkName sets the ServiceNetworkName field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetServiceNetworkName(v string) *ServiceNetworkVpcAssociationSummary { - s.ServiceNetworkName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetStatus(v string) *ServiceNetworkVpcAssociationSummary { - s.Status = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ServiceNetworkVpcAssociationSummary) SetVpcId(v string) *ServiceNetworkVpcAssociationSummary { - s.VpcId = &v - return s -} - -// The request would cause a service quota to be exceeded. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the service quota that was exceeded. - // - // QuotaCode is a required field - QuotaCode *string `locationName:"quotaCode" type:"string" required:"true"` - - // The resource ID. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The resource type. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true"` - - // The service code. - // - // ServiceCode is a required field - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Summary information about a service. -type ServiceSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the service was created, specified in ISO-8601 format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The custom domain name of the service. - CustomDomainName *string `locationName:"customDomainName" min:"3" type:"string"` - - // DNS information about the service. - DnsEntry *DnsEntry `locationName:"dnsEntry" type:"structure"` - - // The ID of the service. - Id *string `locationName:"id" min:"21" type:"string"` - - // The date and time that the service was last updated. The format is ISO-8601. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the service. - Name *string `locationName:"name" min:"3" type:"string"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"ServiceStatus"` -} - -// 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 ServiceSummary) 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 ServiceSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ServiceSummary) SetArn(v string) *ServiceSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ServiceSummary) SetCreatedAt(v time.Time) *ServiceSummary { - s.CreatedAt = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *ServiceSummary) SetCustomDomainName(v string) *ServiceSummary { - s.CustomDomainName = &v - return s -} - -// SetDnsEntry sets the DnsEntry field's value. -func (s *ServiceSummary) SetDnsEntry(v *DnsEntry) *ServiceSummary { - s.DnsEntry = v - return s -} - -// SetId sets the Id field's value. -func (s *ServiceSummary) SetId(v string) *ServiceSummary { - s.Id = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *ServiceSummary) SetLastUpdatedAt(v time.Time) *ServiceSummary { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *ServiceSummary) SetName(v string) *ServiceSummary { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ServiceSummary) SetStatus(v string) *ServiceSummary { - s.Status = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tags for the resource. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" 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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// Describes a target. -type Target struct { - _ struct{} `type:"structure"` - - // The ID of the target. If the target type of the target group is INSTANCE, - // this is an instance ID. If the target type is IP , this is an IP address. - // If the target type is LAMBDA, this is the ARN of the Lambda function. If - // the target type is ALB, this is the ARN of the Application Load Balancer. - // - // Id is a required field - Id *string `locationName:"id" min:"1" type:"string" required:"true"` - - // The port on which the target is listening. For HTTP, the default is 80. For - // HTTPS, the default is 443. - Port *int64 `locationName:"port" min:"1" 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 Target) 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 Target) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Target) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Target"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *Target) SetId(v string) *Target { - s.Id = &v - return s -} - -// SetPort sets the Port field's value. -func (s *Target) SetPort(v int64) *Target { - s.Port = &v - return s -} - -// Describes a target failure. -type TargetFailure struct { - _ struct{} `type:"structure"` - - // The failure code. - FailureCode *string `locationName:"failureCode" type:"string"` - - // The failure message. - FailureMessage *string `locationName:"failureMessage" type:"string"` - - // The ID of the target. If the target type of the target group is INSTANCE, - // this is an instance ID. If the target type is IP , this is an IP address. - // If the target type is LAMBDA, this is the ARN of the Lambda function. If - // the target type is ALB, this is the ARN of the Application Load Balancer. - Id *string `locationName:"id" type:"string"` - - // The port on which the target is listening. This parameter doesn't apply if - // the target is a Lambda function. - Port *int64 `locationName:"port" min:"1" 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 TargetFailure) 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 TargetFailure) GoString() string { - return s.String() -} - -// SetFailureCode sets the FailureCode field's value. -func (s *TargetFailure) SetFailureCode(v string) *TargetFailure { - s.FailureCode = &v - return s -} - -// SetFailureMessage sets the FailureMessage field's value. -func (s *TargetFailure) SetFailureMessage(v string) *TargetFailure { - s.FailureMessage = &v - return s -} - -// SetId sets the Id field's value. -func (s *TargetFailure) SetId(v string) *TargetFailure { - s.Id = &v - return s -} - -// SetPort sets the Port field's value. -func (s *TargetFailure) SetPort(v int64) *TargetFailure { - s.Port = &v - return s -} - -// Describes the configuration of a target group. Lambda functions don't support -// target group configuration. -type TargetGroupConfig struct { - _ struct{} `type:"structure"` - - // The health check configuration. - HealthCheck *HealthCheckConfig `locationName:"healthCheck" type:"structure"` - - // The type of IP address used for the target group. The possible values are - // ipv4 and ipv6. This is an optional parameter. If not specified, the IP address - // type defaults to ipv4. - IpAddressType *string `locationName:"ipAddressType" type:"string" enum:"IpAddressType"` - - // Lambda event structure version - LambdaEventStructureVersion *string `locationName:"lambdaEventStructureVersion" type:"string" enum:"LambdaEventStructureVersion"` - - // The port on which the targets are listening. For HTTP, the default is 80. - // For HTTPS, the default is 443 - Port *int64 `locationName:"port" min:"1" type:"integer"` - - // The protocol to use for routing traffic to the targets. Default is the protocol - // of a target group. - Protocol *string `locationName:"protocol" type:"string" enum:"TargetGroupProtocol"` - - // The protocol version. Default value is HTTP1. - ProtocolVersion *string `locationName:"protocolVersion" type:"string" enum:"TargetGroupProtocolVersion"` - - // The ID of the VPC. - VpcIdentifier *string `locationName:"vpcIdentifier" min:"5" 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 TargetGroupConfig) 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 TargetGroupConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetGroupConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetGroupConfig"} - if s.Port != nil && *s.Port < 1 { - invalidParams.Add(request.NewErrParamMinValue("Port", 1)) - } - if s.VpcIdentifier != nil && len(*s.VpcIdentifier) < 5 { - invalidParams.Add(request.NewErrParamMinLen("VpcIdentifier", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *TargetGroupConfig) SetHealthCheck(v *HealthCheckConfig) *TargetGroupConfig { - s.HealthCheck = v - return s -} - -// SetIpAddressType sets the IpAddressType field's value. -func (s *TargetGroupConfig) SetIpAddressType(v string) *TargetGroupConfig { - s.IpAddressType = &v - return s -} - -// SetLambdaEventStructureVersion sets the LambdaEventStructureVersion field's value. -func (s *TargetGroupConfig) SetLambdaEventStructureVersion(v string) *TargetGroupConfig { - s.LambdaEventStructureVersion = &v - return s -} - -// SetPort sets the Port field's value. -func (s *TargetGroupConfig) SetPort(v int64) *TargetGroupConfig { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *TargetGroupConfig) SetProtocol(v string) *TargetGroupConfig { - s.Protocol = &v - return s -} - -// SetProtocolVersion sets the ProtocolVersion field's value. -func (s *TargetGroupConfig) SetProtocolVersion(v string) *TargetGroupConfig { - s.ProtocolVersion = &v - return s -} - -// SetVpcIdentifier sets the VpcIdentifier field's value. -func (s *TargetGroupConfig) SetVpcIdentifier(v string) *TargetGroupConfig { - s.VpcIdentifier = &v - return s -} - -// Summary information about a target group. -type TargetGroupSummary struct { - _ struct{} `type:"structure"` - - // The ARN (Amazon Resource Name) of the target group. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The date and time that the target group was created, specified in ISO-8601 - // format. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601"` - - // The ID of the target group. - Id *string `locationName:"id" min:"20" type:"string"` - - // The type of IP address used for the target group. The possible values are - // ipv4 and ipv6. This is an optional parameter. If not specified, the IP address - // type defaults to ipv4. - IpAddressType *string `locationName:"ipAddressType" type:"string" enum:"IpAddressType"` - - // Lambda event structure version - LambdaEventStructureVersion *string `locationName:"lambdaEventStructureVersion" type:"string" enum:"LambdaEventStructureVersion"` - - // The date and time that the target group was last updated, specified in ISO-8601 - // format. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp" timestampFormat:"iso8601"` - - // The name of the target group. - Name *string `locationName:"name" min:"3" type:"string"` - - // The port of the target group. - Port *int64 `locationName:"port" min:"1" type:"integer"` - - // The protocol of the target group. - Protocol *string `locationName:"protocol" type:"string" enum:"TargetGroupProtocol"` - - // The list of Amazon Resource Names (ARNs) of the service. - ServiceArns []*string `locationName:"serviceArns" type:"list"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"TargetGroupStatus"` - - // The target group type. - Type *string `locationName:"type" type:"string" enum:"TargetGroupType"` - - // The ID of the VPC of the target group. - VpcIdentifier *string `locationName:"vpcIdentifier" min:"5" 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 TargetGroupSummary) 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 TargetGroupSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *TargetGroupSummary) SetArn(v string) *TargetGroupSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *TargetGroupSummary) SetCreatedAt(v time.Time) *TargetGroupSummary { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *TargetGroupSummary) SetId(v string) *TargetGroupSummary { - s.Id = &v - return s -} - -// SetIpAddressType sets the IpAddressType field's value. -func (s *TargetGroupSummary) SetIpAddressType(v string) *TargetGroupSummary { - s.IpAddressType = &v - return s -} - -// SetLambdaEventStructureVersion sets the LambdaEventStructureVersion field's value. -func (s *TargetGroupSummary) SetLambdaEventStructureVersion(v string) *TargetGroupSummary { - s.LambdaEventStructureVersion = &v - return s -} - -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *TargetGroupSummary) SetLastUpdatedAt(v time.Time) *TargetGroupSummary { - s.LastUpdatedAt = &v - return s -} - -// SetName sets the Name field's value. -func (s *TargetGroupSummary) SetName(v string) *TargetGroupSummary { - s.Name = &v - return s -} - -// SetPort sets the Port field's value. -func (s *TargetGroupSummary) SetPort(v int64) *TargetGroupSummary { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *TargetGroupSummary) SetProtocol(v string) *TargetGroupSummary { - s.Protocol = &v - return s -} - -// SetServiceArns sets the ServiceArns field's value. -func (s *TargetGroupSummary) SetServiceArns(v []*string) *TargetGroupSummary { - s.ServiceArns = v - return s -} - -// SetStatus sets the Status field's value. -func (s *TargetGroupSummary) SetStatus(v string) *TargetGroupSummary { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *TargetGroupSummary) SetType(v string) *TargetGroupSummary { - s.Type = &v - return s -} - -// SetVpcIdentifier sets the VpcIdentifier field's value. -func (s *TargetGroupSummary) SetVpcIdentifier(v string) *TargetGroupSummary { - s.VpcIdentifier = &v - return s -} - -// Summary information about a target. -type TargetSummary struct { - _ struct{} `type:"structure"` - - // The ID of the target. If the target type of the target group is INSTANCE, - // this is an instance ID. If the target type is IP , this is an IP address. - // If the target type is LAMBDA, this is the ARN of the Lambda function. If - // the target type is ALB, this is the ARN of the Application Load Balancer. - Id *string `locationName:"id" type:"string"` - - // The port on which the target is listening. - Port *int64 `locationName:"port" min:"1" type:"integer"` - - // The code for why the target status is what it is. - ReasonCode *string `locationName:"reasonCode" type:"string"` - - // The status of the target. - // - // * Draining: The target is being deregistered. No new connections will - // be sent to this target while current connections are being drained. Default - // draining time is 5 minutes. - // - // * Unavailable: Health checks are unavailable for the target group. - // - // * Healthy: The target is healthy. - // - // * Unhealthy: The target is unhealthy. - // - // * Initial: Initial health checks on the target are being performed. - // - // * Unused: Target group is not used in a service. - Status *string `locationName:"status" type:"string" enum:"TargetStatus"` -} - -// 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 TargetSummary) 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 TargetSummary) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *TargetSummary) SetId(v string) *TargetSummary { - s.Id = &v - return s -} - -// SetPort sets the Port field's value. -func (s *TargetSummary) SetPort(v int64) *TargetSummary { - s.Port = &v - return s -} - -// SetReasonCode sets the ReasonCode field's value. -func (s *TargetSummary) SetReasonCode(v string) *TargetSummary { - s.ReasonCode = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TargetSummary) SetStatus(v string) *TargetSummary { - s.Status = &v - return s -} - -// The limit on the number of requests per second was exceeded. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the service quota that was exceeded. - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The number of seconds to wait before retrying. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The service code. - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The tag keys of the tags to remove. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" 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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateAccessLogSubscriptionInput struct { - _ struct{} `type:"structure"` - - // The ID or Amazon Resource Name (ARN) of the access log subscription. - // - // AccessLogSubscriptionIdentifier is a required field - AccessLogSubscriptionIdentifier *string `location:"uri" locationName:"accessLogSubscriptionIdentifier" min:"17" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the access log destination. - // - // DestinationArn is a required field - DestinationArn *string `locationName:"destinationArn" min:"20" 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 UpdateAccessLogSubscriptionInput) 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 UpdateAccessLogSubscriptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAccessLogSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAccessLogSubscriptionInput"} - if s.AccessLogSubscriptionIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("AccessLogSubscriptionIdentifier")) - } - if s.AccessLogSubscriptionIdentifier != nil && len(*s.AccessLogSubscriptionIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("AccessLogSubscriptionIdentifier", 17)) - } - if s.DestinationArn == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationArn")) - } - if s.DestinationArn != nil && len(*s.DestinationArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("DestinationArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessLogSubscriptionIdentifier sets the AccessLogSubscriptionIdentifier field's value. -func (s *UpdateAccessLogSubscriptionInput) SetAccessLogSubscriptionIdentifier(v string) *UpdateAccessLogSubscriptionInput { - s.AccessLogSubscriptionIdentifier = &v - return s -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *UpdateAccessLogSubscriptionInput) SetDestinationArn(v string) *UpdateAccessLogSubscriptionInput { - s.DestinationArn = &v - return s -} - -type UpdateAccessLogSubscriptionOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the access log subscription. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"20" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the access log destination. - // - // DestinationArn is a required field - DestinationArn *string `locationName:"destinationArn" min:"20" type:"string" required:"true"` - - // The ID of the access log subscription. - // - // Id is a required field - Id *string `locationName:"id" min:"21" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the access log subscription. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" min:"20" type:"string" required:"true"` - - // The ID of the resource. - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" min:"20" 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 UpdateAccessLogSubscriptionOutput) 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 UpdateAccessLogSubscriptionOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateAccessLogSubscriptionOutput) SetArn(v string) *UpdateAccessLogSubscriptionOutput { - s.Arn = &v - return s -} - -// SetDestinationArn sets the DestinationArn field's value. -func (s *UpdateAccessLogSubscriptionOutput) SetDestinationArn(v string) *UpdateAccessLogSubscriptionOutput { - s.DestinationArn = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateAccessLogSubscriptionOutput) SetId(v string) *UpdateAccessLogSubscriptionOutput { - s.Id = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UpdateAccessLogSubscriptionOutput) SetResourceArn(v string) *UpdateAccessLogSubscriptionOutput { - s.ResourceArn = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *UpdateAccessLogSubscriptionOutput) SetResourceId(v string) *UpdateAccessLogSubscriptionOutput { - s.ResourceId = &v - return s -} - -type UpdateListenerInput struct { - _ struct{} `type:"structure"` - - // The action for the default rule. - // - // DefaultAction is a required field - DefaultAction *RuleAction `locationName:"defaultAction" type:"structure" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 UpdateListenerInput) 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 UpdateListenerInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateListenerInput"} - if s.DefaultAction == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultAction")) - } - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - if s.DefaultAction != nil { - if err := s.DefaultAction.Validate(); err != nil { - invalidParams.AddNested("DefaultAction", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *UpdateListenerInput) SetDefaultAction(v *RuleAction) *UpdateListenerInput { - s.DefaultAction = v - return s -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *UpdateListenerInput) SetListenerIdentifier(v string) *UpdateListenerInput { - s.ListenerIdentifier = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *UpdateListenerInput) SetServiceIdentifier(v string) *UpdateListenerInput { - s.ServiceIdentifier = &v - return s -} - -type UpdateListenerOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The action for the default rule. - DefaultAction *RuleAction `locationName:"defaultAction" type:"structure"` - - // The ID of the listener. - Id *string `locationName:"id" min:"26" type:"string"` - - // The name of the listener. - Name *string `locationName:"name" min:"3" type:"string"` - - // The listener port. - Port *int64 `locationName:"port" min:"1" type:"integer"` - - // The protocol of the listener. - Protocol *string `locationName:"protocol" type:"string" enum:"ListenerProtocol"` - - // The Amazon Resource Name (ARN) of the service. - ServiceArn *string `locationName:"serviceArn" min:"20" type:"string"` - - // The ID of the service. - ServiceId *string `locationName:"serviceId" min:"21" 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 UpdateListenerOutput) 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 UpdateListenerOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateListenerOutput) SetArn(v string) *UpdateListenerOutput { - s.Arn = &v - return s -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *UpdateListenerOutput) SetDefaultAction(v *RuleAction) *UpdateListenerOutput { - s.DefaultAction = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateListenerOutput) SetId(v string) *UpdateListenerOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateListenerOutput) SetName(v string) *UpdateListenerOutput { - s.Name = &v - return s -} - -// SetPort sets the Port field's value. -func (s *UpdateListenerOutput) SetPort(v int64) *UpdateListenerOutput { - s.Port = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *UpdateListenerOutput) SetProtocol(v string) *UpdateListenerOutput { - s.Protocol = &v - return s -} - -// SetServiceArn sets the ServiceArn field's value. -func (s *UpdateListenerOutput) SetServiceArn(v string) *UpdateListenerOutput { - s.ServiceArn = &v - return s -} - -// SetServiceId sets the ServiceId field's value. -func (s *UpdateListenerOutput) SetServiceId(v string) *UpdateListenerOutput { - s.ServiceId = &v - return s -} - -type UpdateRuleInput struct { - _ struct{} `type:"structure"` - - // Information about the action for the specified listener rule. - Action *RuleAction `locationName:"action" type:"structure"` - - // The ID or Amazon Resource Name (ARN) of the listener. - // - // ListenerIdentifier is a required field - ListenerIdentifier *string `location:"uri" locationName:"listenerIdentifier" min:"20" type:"string" required:"true"` - - // The rule match. - Match *RuleMatch `locationName:"match" type:"structure"` - - // The rule priority. A listener can't have multiple rules with the same priority. - Priority *int64 `locationName:"priority" min:"1" type:"integer"` - - // The ID or Amazon Resource Name (ARN) of the rule. - // - // RuleIdentifier is a required field - RuleIdentifier *string `location:"uri" locationName:"ruleIdentifier" min:"20" type:"string" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 UpdateRuleInput) 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 UpdateRuleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateRuleInput"} - if s.ListenerIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerIdentifier")) - } - if s.ListenerIdentifier != nil && len(*s.ListenerIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ListenerIdentifier", 20)) - } - if s.Priority != nil && *s.Priority < 1 { - invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) - } - if s.RuleIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("RuleIdentifier")) - } - if s.RuleIdentifier != nil && len(*s.RuleIdentifier) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RuleIdentifier", 20)) - } - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - if s.Action != nil { - if err := s.Action.Validate(); err != nil { - invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) - } - } - if s.Match != nil { - if err := s.Match.Validate(); err != nil { - invalidParams.AddNested("Match", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *UpdateRuleInput) SetAction(v *RuleAction) *UpdateRuleInput { - s.Action = v - return s -} - -// SetListenerIdentifier sets the ListenerIdentifier field's value. -func (s *UpdateRuleInput) SetListenerIdentifier(v string) *UpdateRuleInput { - s.ListenerIdentifier = &v - return s -} - -// SetMatch sets the Match field's value. -func (s *UpdateRuleInput) SetMatch(v *RuleMatch) *UpdateRuleInput { - s.Match = v - return s -} - -// SetPriority sets the Priority field's value. -func (s *UpdateRuleInput) SetPriority(v int64) *UpdateRuleInput { - s.Priority = &v - return s -} - -// SetRuleIdentifier sets the RuleIdentifier field's value. -func (s *UpdateRuleInput) SetRuleIdentifier(v string) *UpdateRuleInput { - s.RuleIdentifier = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *UpdateRuleInput) SetServiceIdentifier(v string) *UpdateRuleInput { - s.ServiceIdentifier = &v - return s -} - -type UpdateRuleOutput struct { - _ struct{} `type:"structure"` - - // Information about the action for the specified listener rule. - Action *RuleAction `locationName:"action" type:"structure"` - - // The Amazon Resource Name (ARN) of the listener. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the listener. - Id *string `locationName:"id" min:"5" type:"string"` - - // Indicates whether this is the default rule. - IsDefault *bool `locationName:"isDefault" type:"boolean"` - - // The rule match. - Match *RuleMatch `locationName:"match" type:"structure"` - - // The name of the listener. - Name *string `locationName:"name" min:"3" type:"string"` - - // The rule priority. - Priority *int64 `locationName:"priority" min:"1" 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 UpdateRuleOutput) 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 UpdateRuleOutput) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *UpdateRuleOutput) SetAction(v *RuleAction) *UpdateRuleOutput { - s.Action = v - return s -} - -// SetArn sets the Arn field's value. -func (s *UpdateRuleOutput) SetArn(v string) *UpdateRuleOutput { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateRuleOutput) SetId(v string) *UpdateRuleOutput { - s.Id = &v - return s -} - -// SetIsDefault sets the IsDefault field's value. -func (s *UpdateRuleOutput) SetIsDefault(v bool) *UpdateRuleOutput { - s.IsDefault = &v - return s -} - -// SetMatch sets the Match field's value. -func (s *UpdateRuleOutput) SetMatch(v *RuleMatch) *UpdateRuleOutput { - s.Match = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateRuleOutput) SetName(v string) *UpdateRuleOutput { - s.Name = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *UpdateRuleOutput) SetPriority(v int64) *UpdateRuleOutput { - s.Priority = &v - return s -} - -type UpdateServiceInput struct { - _ struct{} `type:"structure"` - - // The type of IAM policy. - // - // * NONE: The resource does not use an IAM policy. This is the default. - // - // * AWS_IAM: The resource uses an IAM policy. When this type is used, auth - // is enabled and an auth policy is required. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // The Amazon Resource Name (ARN) of the certificate. - CertificateArn *string `locationName:"certificateArn" type:"string"` - - // The ID or Amazon Resource Name (ARN) of the service. - // - // ServiceIdentifier is a required field - ServiceIdentifier *string `location:"uri" locationName:"serviceIdentifier" min:"17" 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 UpdateServiceInput) 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 UpdateServiceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateServiceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateServiceInput"} - if s.ServiceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIdentifier")) - } - if s.ServiceIdentifier != nil && len(*s.ServiceIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthType sets the AuthType field's value. -func (s *UpdateServiceInput) SetAuthType(v string) *UpdateServiceInput { - s.AuthType = &v - return s -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *UpdateServiceInput) SetCertificateArn(v string) *UpdateServiceInput { - s.CertificateArn = &v - return s -} - -// SetServiceIdentifier sets the ServiceIdentifier field's value. -func (s *UpdateServiceInput) SetServiceIdentifier(v string) *UpdateServiceInput { - s.ServiceIdentifier = &v - return s -} - -type UpdateServiceNetworkInput struct { - _ struct{} `type:"structure"` - - // The type of IAM policy. - // - // * NONE: The resource does not use an IAM policy. This is the default. - // - // * AWS_IAM: The resource uses an IAM policy. When this type is used, auth - // is enabled and an auth policy is required. - // - // AuthType is a required field - AuthType *string `locationName:"authType" type:"string" required:"true" enum:"AuthType"` - - // The ID or Amazon Resource Name (ARN) of the service network. - // - // ServiceNetworkIdentifier is a required field - ServiceNetworkIdentifier *string `location:"uri" locationName:"serviceNetworkIdentifier" min:"3" 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 UpdateServiceNetworkInput) 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 UpdateServiceNetworkInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateServiceNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateServiceNetworkInput"} - if s.AuthType == nil { - invalidParams.Add(request.NewErrParamRequired("AuthType")) - } - if s.ServiceNetworkIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkIdentifier")) - } - if s.ServiceNetworkIdentifier != nil && len(*s.ServiceNetworkIdentifier) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkIdentifier", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthType sets the AuthType field's value. -func (s *UpdateServiceNetworkInput) SetAuthType(v string) *UpdateServiceNetworkInput { - s.AuthType = &v - return s -} - -// SetServiceNetworkIdentifier sets the ServiceNetworkIdentifier field's value. -func (s *UpdateServiceNetworkInput) SetServiceNetworkIdentifier(v string) *UpdateServiceNetworkInput { - s.ServiceNetworkIdentifier = &v - return s -} - -type UpdateServiceNetworkOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service network. - Arn *string `locationName:"arn" min:"32" type:"string"` - - // The type of IAM policy. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // The ID of the service network. - Id *string `locationName:"id" min:"32" type:"string"` - - // The name of the service network. - Name *string `locationName:"name" min:"3" 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 UpdateServiceNetworkOutput) 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 UpdateServiceNetworkOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateServiceNetworkOutput) SetArn(v string) *UpdateServiceNetworkOutput { - s.Arn = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *UpdateServiceNetworkOutput) SetAuthType(v string) *UpdateServiceNetworkOutput { - s.AuthType = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateServiceNetworkOutput) SetId(v string) *UpdateServiceNetworkOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateServiceNetworkOutput) SetName(v string) *UpdateServiceNetworkOutput { - s.Name = &v - return s -} - -type UpdateServiceNetworkVpcAssociationInput struct { - _ struct{} `type:"structure"` - - // The IDs of the security groups. Once you add a security group, it cannot - // be removed. - // - // SecurityGroupIds is a required field - SecurityGroupIds []*string `locationName:"securityGroupIds" min:"1" type:"list" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the association. - // - // ServiceNetworkVpcAssociationIdentifier is a required field - ServiceNetworkVpcAssociationIdentifier *string `location:"uri" locationName:"serviceNetworkVpcAssociationIdentifier" min:"17" 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 UpdateServiceNetworkVpcAssociationInput) 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 UpdateServiceNetworkVpcAssociationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateServiceNetworkVpcAssociationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateServiceNetworkVpcAssociationInput"} - if s.SecurityGroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityGroupIds")) - } - if s.SecurityGroupIds != nil && len(s.SecurityGroupIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecurityGroupIds", 1)) - } - if s.ServiceNetworkVpcAssociationIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceNetworkVpcAssociationIdentifier")) - } - if s.ServiceNetworkVpcAssociationIdentifier != nil && len(*s.ServiceNetworkVpcAssociationIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("ServiceNetworkVpcAssociationIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *UpdateServiceNetworkVpcAssociationInput) SetSecurityGroupIds(v []*string) *UpdateServiceNetworkVpcAssociationInput { - s.SecurityGroupIds = v - return s -} - -// SetServiceNetworkVpcAssociationIdentifier sets the ServiceNetworkVpcAssociationIdentifier field's value. -func (s *UpdateServiceNetworkVpcAssociationInput) SetServiceNetworkVpcAssociationIdentifier(v string) *UpdateServiceNetworkVpcAssociationInput { - s.ServiceNetworkVpcAssociationIdentifier = &v - return s -} - -type UpdateServiceNetworkVpcAssociationOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the association. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The account that created the association. - CreatedBy *string `locationName:"createdBy" min:"1" type:"string"` - - // The ID of the association. - Id *string `locationName:"id" min:"22" type:"string"` - - // The IDs of the security groups. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // The status. You can retry the operation if the status is DELETE_FAILED. However, - // if you retry it while the status is DELETE_IN_PROGRESS, there is no change - // in the status. - Status *string `locationName:"status" type:"string" enum:"ServiceNetworkVpcAssociationStatus"` -} - -// 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 UpdateServiceNetworkVpcAssociationOutput) 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 UpdateServiceNetworkVpcAssociationOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateServiceNetworkVpcAssociationOutput) SetArn(v string) *UpdateServiceNetworkVpcAssociationOutput { - s.Arn = &v - return s -} - -// SetCreatedBy sets the CreatedBy field's value. -func (s *UpdateServiceNetworkVpcAssociationOutput) SetCreatedBy(v string) *UpdateServiceNetworkVpcAssociationOutput { - s.CreatedBy = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateServiceNetworkVpcAssociationOutput) SetId(v string) *UpdateServiceNetworkVpcAssociationOutput { - s.Id = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *UpdateServiceNetworkVpcAssociationOutput) SetSecurityGroupIds(v []*string) *UpdateServiceNetworkVpcAssociationOutput { - s.SecurityGroupIds = v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateServiceNetworkVpcAssociationOutput) SetStatus(v string) *UpdateServiceNetworkVpcAssociationOutput { - s.Status = &v - return s -} - -type UpdateServiceOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the service. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The type of IAM policy. - AuthType *string `locationName:"authType" type:"string" enum:"AuthType"` - - // The Amazon Resource Name (ARN) of the certificate. - CertificateArn *string `locationName:"certificateArn" type:"string"` - - // The custom domain name of the service. - CustomDomainName *string `locationName:"customDomainName" min:"3" type:"string"` - - // The ID of the service. - Id *string `locationName:"id" min:"21" type:"string"` - - // The name of the service. - Name *string `locationName:"name" min:"3" 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 UpdateServiceOutput) 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 UpdateServiceOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateServiceOutput) SetArn(v string) *UpdateServiceOutput { - s.Arn = &v - return s -} - -// SetAuthType sets the AuthType field's value. -func (s *UpdateServiceOutput) SetAuthType(v string) *UpdateServiceOutput { - s.AuthType = &v - return s -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *UpdateServiceOutput) SetCertificateArn(v string) *UpdateServiceOutput { - s.CertificateArn = &v - return s -} - -// SetCustomDomainName sets the CustomDomainName field's value. -func (s *UpdateServiceOutput) SetCustomDomainName(v string) *UpdateServiceOutput { - s.CustomDomainName = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateServiceOutput) SetId(v string) *UpdateServiceOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateServiceOutput) SetName(v string) *UpdateServiceOutput { - s.Name = &v - return s -} - -type UpdateTargetGroupInput struct { - _ struct{} `type:"structure"` - - // The health check configuration. - // - // HealthCheck is a required field - HealthCheck *HealthCheckConfig `locationName:"healthCheck" type:"structure" required:"true"` - - // The ID or Amazon Resource Name (ARN) of the target group. - // - // TargetGroupIdentifier is a required field - TargetGroupIdentifier *string `location:"uri" locationName:"targetGroupIdentifier" min:"17" 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 UpdateTargetGroupInput) 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 UpdateTargetGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTargetGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTargetGroupInput"} - if s.HealthCheck == nil { - invalidParams.Add(request.NewErrParamRequired("HealthCheck")) - } - if s.TargetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupIdentifier")) - } - if s.TargetGroupIdentifier != nil && len(*s.TargetGroupIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroupIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHealthCheck sets the HealthCheck field's value. -func (s *UpdateTargetGroupInput) SetHealthCheck(v *HealthCheckConfig) *UpdateTargetGroupInput { - s.HealthCheck = v - return s -} - -// SetTargetGroupIdentifier sets the TargetGroupIdentifier field's value. -func (s *UpdateTargetGroupInput) SetTargetGroupIdentifier(v string) *UpdateTargetGroupInput { - s.TargetGroupIdentifier = &v - return s -} - -type UpdateTargetGroupOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the target group. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The target group configuration. - Config *TargetGroupConfig `locationName:"config" type:"structure"` - - // The ID of the target group. - Id *string `locationName:"id" min:"20" type:"string"` - - // The name of the target group. - Name *string `locationName:"name" min:"3" type:"string"` - - // The status. - Status *string `locationName:"status" type:"string" enum:"TargetGroupStatus"` - - // The target group type. - Type *string `locationName:"type" type:"string" enum:"TargetGroupType"` -} - -// 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 UpdateTargetGroupOutput) 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 UpdateTargetGroupOutput) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *UpdateTargetGroupOutput) SetArn(v string) *UpdateTargetGroupOutput { - s.Arn = &v - return s -} - -// SetConfig sets the Config field's value. -func (s *UpdateTargetGroupOutput) SetConfig(v *TargetGroupConfig) *UpdateTargetGroupOutput { - s.Config = v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateTargetGroupOutput) SetId(v string) *UpdateTargetGroupOutput { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateTargetGroupOutput) SetName(v string) *UpdateTargetGroupOutput { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateTargetGroupOutput) SetStatus(v string) *UpdateTargetGroupOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *UpdateTargetGroupOutput) SetType(v string) *UpdateTargetGroupOutput { - s.Type = &v - return s -} - -// The input does not satisfy the constraints specified by an Amazon Web Services -// service. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // The fields that failed validation. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason. - // - // Reason is a required field - Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Describes a validation failure. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // Additional details about why the validation failed. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the validation exception. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -// Describes the weight of a target group. -type WeightedTargetGroup struct { - _ struct{} `type:"structure"` - - // The ID or Amazon Resource Name (ARN) of the target group. - // - // TargetGroupIdentifier is a required field - TargetGroupIdentifier *string `locationName:"targetGroupIdentifier" min:"17" type:"string" required:"true"` - - // Only required if you specify multiple target groups for a forward action. - // The "weight" determines how requests are distributed to the target group. - // For example, if you specify two target groups, each with a weight of 10, - // each target group receives half the requests. If you specify two target groups, - // one with a weight of 10 and the other with a weight of 20, the target group - // with a weight of 20 receives twice as many requests as the other target group. - // If there's only one target group specified, then the default value is 100. - Weight *int64 `locationName:"weight" 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 WeightedTargetGroup) 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 WeightedTargetGroup) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WeightedTargetGroup) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WeightedTargetGroup"} - if s.TargetGroupIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("TargetGroupIdentifier")) - } - if s.TargetGroupIdentifier != nil && len(*s.TargetGroupIdentifier) < 17 { - invalidParams.Add(request.NewErrParamMinLen("TargetGroupIdentifier", 17)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetGroupIdentifier sets the TargetGroupIdentifier field's value. -func (s *WeightedTargetGroup) SetTargetGroupIdentifier(v string) *WeightedTargetGroup { - s.TargetGroupIdentifier = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *WeightedTargetGroup) SetWeight(v int64) *WeightedTargetGroup { - s.Weight = &v - return s -} - -const ( - // AuthPolicyStateActive is a AuthPolicyState enum value - AuthPolicyStateActive = "Active" - - // AuthPolicyStateInactive is a AuthPolicyState enum value - AuthPolicyStateInactive = "Inactive" -) - -// AuthPolicyState_Values returns all elements of the AuthPolicyState enum -func AuthPolicyState_Values() []string { - return []string{ - AuthPolicyStateActive, - AuthPolicyStateInactive, - } -} - -const ( - // AuthTypeNone is a AuthType enum value - AuthTypeNone = "NONE" - - // AuthTypeAwsIam is a AuthType enum value - AuthTypeAwsIam = "AWS_IAM" -) - -// AuthType_Values returns all elements of the AuthType enum -func AuthType_Values() []string { - return []string{ - AuthTypeNone, - AuthTypeAwsIam, - } -} - -const ( - // HealthCheckProtocolVersionHttp1 is a HealthCheckProtocolVersion enum value - HealthCheckProtocolVersionHttp1 = "HTTP1" - - // HealthCheckProtocolVersionHttp2 is a HealthCheckProtocolVersion enum value - HealthCheckProtocolVersionHttp2 = "HTTP2" -) - -// HealthCheckProtocolVersion_Values returns all elements of the HealthCheckProtocolVersion enum -func HealthCheckProtocolVersion_Values() []string { - return []string{ - HealthCheckProtocolVersionHttp1, - HealthCheckProtocolVersionHttp2, - } -} - -const ( - // IpAddressTypeIpv4 is a IpAddressType enum value - IpAddressTypeIpv4 = "IPV4" - - // IpAddressTypeIpv6 is a IpAddressType enum value - IpAddressTypeIpv6 = "IPV6" -) - -// IpAddressType_Values returns all elements of the IpAddressType enum -func IpAddressType_Values() []string { - return []string{ - IpAddressTypeIpv4, - IpAddressTypeIpv6, - } -} - -const ( - // LambdaEventStructureVersionV1 is a LambdaEventStructureVersion enum value - LambdaEventStructureVersionV1 = "V1" - - // LambdaEventStructureVersionV2 is a LambdaEventStructureVersion enum value - LambdaEventStructureVersionV2 = "V2" -) - -// LambdaEventStructureVersion_Values returns all elements of the LambdaEventStructureVersion enum -func LambdaEventStructureVersion_Values() []string { - return []string{ - LambdaEventStructureVersionV1, - LambdaEventStructureVersionV2, - } -} - -const ( - // ListenerProtocolHttp is a ListenerProtocol enum value - ListenerProtocolHttp = "HTTP" - - // ListenerProtocolHttps is a ListenerProtocol enum value - ListenerProtocolHttps = "HTTPS" -) - -// ListenerProtocol_Values returns all elements of the ListenerProtocol enum -func ListenerProtocol_Values() []string { - return []string{ - ListenerProtocolHttp, - ListenerProtocolHttps, - } -} - -const ( - // ServiceNetworkServiceAssociationStatusCreateInProgress is a ServiceNetworkServiceAssociationStatus enum value - ServiceNetworkServiceAssociationStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // ServiceNetworkServiceAssociationStatusActive is a ServiceNetworkServiceAssociationStatus enum value - ServiceNetworkServiceAssociationStatusActive = "ACTIVE" - - // ServiceNetworkServiceAssociationStatusDeleteInProgress is a ServiceNetworkServiceAssociationStatus enum value - ServiceNetworkServiceAssociationStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // ServiceNetworkServiceAssociationStatusCreateFailed is a ServiceNetworkServiceAssociationStatus enum value - ServiceNetworkServiceAssociationStatusCreateFailed = "CREATE_FAILED" - - // ServiceNetworkServiceAssociationStatusDeleteFailed is a ServiceNetworkServiceAssociationStatus enum value - ServiceNetworkServiceAssociationStatusDeleteFailed = "DELETE_FAILED" -) - -// ServiceNetworkServiceAssociationStatus_Values returns all elements of the ServiceNetworkServiceAssociationStatus enum -func ServiceNetworkServiceAssociationStatus_Values() []string { - return []string{ - ServiceNetworkServiceAssociationStatusCreateInProgress, - ServiceNetworkServiceAssociationStatusActive, - ServiceNetworkServiceAssociationStatusDeleteInProgress, - ServiceNetworkServiceAssociationStatusCreateFailed, - ServiceNetworkServiceAssociationStatusDeleteFailed, - } -} - -const ( - // ServiceNetworkVpcAssociationStatusCreateInProgress is a ServiceNetworkVpcAssociationStatus enum value - ServiceNetworkVpcAssociationStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // ServiceNetworkVpcAssociationStatusActive is a ServiceNetworkVpcAssociationStatus enum value - ServiceNetworkVpcAssociationStatusActive = "ACTIVE" - - // ServiceNetworkVpcAssociationStatusUpdateInProgress is a ServiceNetworkVpcAssociationStatus enum value - ServiceNetworkVpcAssociationStatusUpdateInProgress = "UPDATE_IN_PROGRESS" - - // ServiceNetworkVpcAssociationStatusDeleteInProgress is a ServiceNetworkVpcAssociationStatus enum value - ServiceNetworkVpcAssociationStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // ServiceNetworkVpcAssociationStatusCreateFailed is a ServiceNetworkVpcAssociationStatus enum value - ServiceNetworkVpcAssociationStatusCreateFailed = "CREATE_FAILED" - - // ServiceNetworkVpcAssociationStatusDeleteFailed is a ServiceNetworkVpcAssociationStatus enum value - ServiceNetworkVpcAssociationStatusDeleteFailed = "DELETE_FAILED" - - // ServiceNetworkVpcAssociationStatusUpdateFailed is a ServiceNetworkVpcAssociationStatus enum value - ServiceNetworkVpcAssociationStatusUpdateFailed = "UPDATE_FAILED" -) - -// ServiceNetworkVpcAssociationStatus_Values returns all elements of the ServiceNetworkVpcAssociationStatus enum -func ServiceNetworkVpcAssociationStatus_Values() []string { - return []string{ - ServiceNetworkVpcAssociationStatusCreateInProgress, - ServiceNetworkVpcAssociationStatusActive, - ServiceNetworkVpcAssociationStatusUpdateInProgress, - ServiceNetworkVpcAssociationStatusDeleteInProgress, - ServiceNetworkVpcAssociationStatusCreateFailed, - ServiceNetworkVpcAssociationStatusDeleteFailed, - ServiceNetworkVpcAssociationStatusUpdateFailed, - } -} - -const ( - // ServiceStatusActive is a ServiceStatus enum value - ServiceStatusActive = "ACTIVE" - - // ServiceStatusCreateInProgress is a ServiceStatus enum value - ServiceStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // ServiceStatusDeleteInProgress is a ServiceStatus enum value - ServiceStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // ServiceStatusCreateFailed is a ServiceStatus enum value - ServiceStatusCreateFailed = "CREATE_FAILED" - - // ServiceStatusDeleteFailed is a ServiceStatus enum value - ServiceStatusDeleteFailed = "DELETE_FAILED" -) - -// ServiceStatus_Values returns all elements of the ServiceStatus enum -func ServiceStatus_Values() []string { - return []string{ - ServiceStatusActive, - ServiceStatusCreateInProgress, - ServiceStatusDeleteInProgress, - ServiceStatusCreateFailed, - ServiceStatusDeleteFailed, - } -} - -const ( - // TargetGroupProtocolHttp is a TargetGroupProtocol enum value - TargetGroupProtocolHttp = "HTTP" - - // TargetGroupProtocolHttps is a TargetGroupProtocol enum value - TargetGroupProtocolHttps = "HTTPS" -) - -// TargetGroupProtocol_Values returns all elements of the TargetGroupProtocol enum -func TargetGroupProtocol_Values() []string { - return []string{ - TargetGroupProtocolHttp, - TargetGroupProtocolHttps, - } -} - -const ( - // TargetGroupProtocolVersionHttp1 is a TargetGroupProtocolVersion enum value - TargetGroupProtocolVersionHttp1 = "HTTP1" - - // TargetGroupProtocolVersionHttp2 is a TargetGroupProtocolVersion enum value - TargetGroupProtocolVersionHttp2 = "HTTP2" - - // TargetGroupProtocolVersionGrpc is a TargetGroupProtocolVersion enum value - TargetGroupProtocolVersionGrpc = "GRPC" -) - -// TargetGroupProtocolVersion_Values returns all elements of the TargetGroupProtocolVersion enum -func TargetGroupProtocolVersion_Values() []string { - return []string{ - TargetGroupProtocolVersionHttp1, - TargetGroupProtocolVersionHttp2, - TargetGroupProtocolVersionGrpc, - } -} - -const ( - // TargetGroupStatusCreateInProgress is a TargetGroupStatus enum value - TargetGroupStatusCreateInProgress = "CREATE_IN_PROGRESS" - - // TargetGroupStatusActive is a TargetGroupStatus enum value - TargetGroupStatusActive = "ACTIVE" - - // TargetGroupStatusDeleteInProgress is a TargetGroupStatus enum value - TargetGroupStatusDeleteInProgress = "DELETE_IN_PROGRESS" - - // TargetGroupStatusCreateFailed is a TargetGroupStatus enum value - TargetGroupStatusCreateFailed = "CREATE_FAILED" - - // TargetGroupStatusDeleteFailed is a TargetGroupStatus enum value - TargetGroupStatusDeleteFailed = "DELETE_FAILED" -) - -// TargetGroupStatus_Values returns all elements of the TargetGroupStatus enum -func TargetGroupStatus_Values() []string { - return []string{ - TargetGroupStatusCreateInProgress, - TargetGroupStatusActive, - TargetGroupStatusDeleteInProgress, - TargetGroupStatusCreateFailed, - TargetGroupStatusDeleteFailed, - } -} - -const ( - // TargetGroupTypeIp is a TargetGroupType enum value - TargetGroupTypeIp = "IP" - - // TargetGroupTypeLambda is a TargetGroupType enum value - TargetGroupTypeLambda = "LAMBDA" - - // TargetGroupTypeInstance is a TargetGroupType enum value - TargetGroupTypeInstance = "INSTANCE" - - // TargetGroupTypeAlb is a TargetGroupType enum value - TargetGroupTypeAlb = "ALB" -) - -// TargetGroupType_Values returns all elements of the TargetGroupType enum -func TargetGroupType_Values() []string { - return []string{ - TargetGroupTypeIp, - TargetGroupTypeLambda, - TargetGroupTypeInstance, - TargetGroupTypeAlb, - } -} - -const ( - // TargetStatusDraining is a TargetStatus enum value - TargetStatusDraining = "DRAINING" - - // TargetStatusUnavailable is a TargetStatus enum value - TargetStatusUnavailable = "UNAVAILABLE" - - // TargetStatusHealthy is a TargetStatus enum value - TargetStatusHealthy = "HEALTHY" - - // TargetStatusUnhealthy is a TargetStatus enum value - TargetStatusUnhealthy = "UNHEALTHY" - - // TargetStatusInitial is a TargetStatus enum value - TargetStatusInitial = "INITIAL" - - // TargetStatusUnused is a TargetStatus enum value - TargetStatusUnused = "UNUSED" -) - -// TargetStatus_Values returns all elements of the TargetStatus enum -func TargetStatus_Values() []string { - return []string{ - TargetStatusDraining, - TargetStatusUnavailable, - TargetStatusHealthy, - TargetStatusUnhealthy, - TargetStatusInitial, - TargetStatusUnused, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/doc.go deleted file mode 100644 index 5bdec6d27a23..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/doc.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package vpclattice provides the client and types for making API -// requests to Amazon VPC Lattice. -// -// Amazon VPC Lattice is a fully managed application networking service that -// you use to connect, secure, and monitor all of your services across multiple -// accounts and virtual private clouds (VPCs). Amazon VPC Lattice interconnects -// your microservices and legacy services within a logical boundary, so that -// you can discover and manage them more efficiently. For more information, -// see the Amazon VPC Lattice User Guide (https://docs.aws.amazon.com/vpc-lattice/latest/ug/) -// -// See https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30 for more information on this service. -// -// See vpclattice package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/vpclattice/ -// -// # Using the Client -// -// To contact Amazon VPC Lattice with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon VPC Lattice client VPCLattice for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/vpclattice/#New -package vpclattice diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/errors.go deleted file mode 100644 index 3c017c0bf70c..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/errors.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package vpclattice - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // The user does not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request conflicts with the current state of the resource. Updating or - // deleting a resource can cause an inconsistent state. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // An unexpected error occurred while processing the request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The request references a resource that does not exist. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // The request would cause a service quota to be exceeded. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The limit on the number of requests per second was exceeded. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input does not satisfy the constraints specified by an Amazon Web Services - // service. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/service.go deleted file mode 100644 index ac17a6f06bfb..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package vpclattice - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// VPCLattice provides the API operation methods for making requests to -// Amazon VPC Lattice. See this package's package overview docs -// for details on the service. -// -// VPCLattice methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type VPCLattice struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "VPC Lattice" // Name of service. - EndpointsID = "vpc-lattice" // ID to lookup a service endpoint with. - ServiceID = "VPC Lattice" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the VPCLattice client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a VPCLattice client from just a session. -// svc := vpclattice.New(mySession) -// -// // Create a VPCLattice client with additional configuration -// svc := vpclattice.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *VPCLattice { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "vpc-lattice" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *VPCLattice { - svc := &VPCLattice{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2022-11-30", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a VPCLattice operation and runs any -// custom request initialization. -func (c *VPCLattice) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/vpclatticeiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/vpclatticeiface/interface.go deleted file mode 100644 index 0761a69fe28d..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice/vpclatticeiface/interface.go +++ /dev/null @@ -1,299 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package vpclatticeiface provides an interface to enable mocking the Amazon VPC Lattice service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package vpclatticeiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/vpclattice" -) - -// VPCLatticeAPI provides an interface to enable mocking the -// vpclattice.VPCLattice service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon VPC Lattice. -// func myFunc(svc vpclatticeiface.VPCLatticeAPI) bool { -// // Make svc.BatchUpdateRule request -// } -// -// func main() { -// sess := session.New() -// svc := vpclattice.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockVPCLatticeClient struct { -// vpclatticeiface.VPCLatticeAPI -// } -// func (m *mockVPCLatticeClient) BatchUpdateRule(input *vpclattice.BatchUpdateRuleInput) (*vpclattice.BatchUpdateRuleOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockVPCLatticeClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type VPCLatticeAPI interface { - BatchUpdateRule(*vpclattice.BatchUpdateRuleInput) (*vpclattice.BatchUpdateRuleOutput, error) - BatchUpdateRuleWithContext(aws.Context, *vpclattice.BatchUpdateRuleInput, ...request.Option) (*vpclattice.BatchUpdateRuleOutput, error) - BatchUpdateRuleRequest(*vpclattice.BatchUpdateRuleInput) (*request.Request, *vpclattice.BatchUpdateRuleOutput) - - CreateAccessLogSubscription(*vpclattice.CreateAccessLogSubscriptionInput) (*vpclattice.CreateAccessLogSubscriptionOutput, error) - CreateAccessLogSubscriptionWithContext(aws.Context, *vpclattice.CreateAccessLogSubscriptionInput, ...request.Option) (*vpclattice.CreateAccessLogSubscriptionOutput, error) - CreateAccessLogSubscriptionRequest(*vpclattice.CreateAccessLogSubscriptionInput) (*request.Request, *vpclattice.CreateAccessLogSubscriptionOutput) - - CreateListener(*vpclattice.CreateListenerInput) (*vpclattice.CreateListenerOutput, error) - CreateListenerWithContext(aws.Context, *vpclattice.CreateListenerInput, ...request.Option) (*vpclattice.CreateListenerOutput, error) - CreateListenerRequest(*vpclattice.CreateListenerInput) (*request.Request, *vpclattice.CreateListenerOutput) - - CreateRule(*vpclattice.CreateRuleInput) (*vpclattice.CreateRuleOutput, error) - CreateRuleWithContext(aws.Context, *vpclattice.CreateRuleInput, ...request.Option) (*vpclattice.CreateRuleOutput, error) - CreateRuleRequest(*vpclattice.CreateRuleInput) (*request.Request, *vpclattice.CreateRuleOutput) - - CreateService(*vpclattice.CreateServiceInput) (*vpclattice.CreateServiceOutput, error) - CreateServiceWithContext(aws.Context, *vpclattice.CreateServiceInput, ...request.Option) (*vpclattice.CreateServiceOutput, error) - CreateServiceRequest(*vpclattice.CreateServiceInput) (*request.Request, *vpclattice.CreateServiceOutput) - - CreateServiceNetwork(*vpclattice.CreateServiceNetworkInput) (*vpclattice.CreateServiceNetworkOutput, error) - CreateServiceNetworkWithContext(aws.Context, *vpclattice.CreateServiceNetworkInput, ...request.Option) (*vpclattice.CreateServiceNetworkOutput, error) - CreateServiceNetworkRequest(*vpclattice.CreateServiceNetworkInput) (*request.Request, *vpclattice.CreateServiceNetworkOutput) - - CreateServiceNetworkServiceAssociation(*vpclattice.CreateServiceNetworkServiceAssociationInput) (*vpclattice.CreateServiceNetworkServiceAssociationOutput, error) - CreateServiceNetworkServiceAssociationWithContext(aws.Context, *vpclattice.CreateServiceNetworkServiceAssociationInput, ...request.Option) (*vpclattice.CreateServiceNetworkServiceAssociationOutput, error) - CreateServiceNetworkServiceAssociationRequest(*vpclattice.CreateServiceNetworkServiceAssociationInput) (*request.Request, *vpclattice.CreateServiceNetworkServiceAssociationOutput) - - CreateServiceNetworkVpcAssociation(*vpclattice.CreateServiceNetworkVpcAssociationInput) (*vpclattice.CreateServiceNetworkVpcAssociationOutput, error) - CreateServiceNetworkVpcAssociationWithContext(aws.Context, *vpclattice.CreateServiceNetworkVpcAssociationInput, ...request.Option) (*vpclattice.CreateServiceNetworkVpcAssociationOutput, error) - CreateServiceNetworkVpcAssociationRequest(*vpclattice.CreateServiceNetworkVpcAssociationInput) (*request.Request, *vpclattice.CreateServiceNetworkVpcAssociationOutput) - - CreateTargetGroup(*vpclattice.CreateTargetGroupInput) (*vpclattice.CreateTargetGroupOutput, error) - CreateTargetGroupWithContext(aws.Context, *vpclattice.CreateTargetGroupInput, ...request.Option) (*vpclattice.CreateTargetGroupOutput, error) - CreateTargetGroupRequest(*vpclattice.CreateTargetGroupInput) (*request.Request, *vpclattice.CreateTargetGroupOutput) - - DeleteAccessLogSubscription(*vpclattice.DeleteAccessLogSubscriptionInput) (*vpclattice.DeleteAccessLogSubscriptionOutput, error) - DeleteAccessLogSubscriptionWithContext(aws.Context, *vpclattice.DeleteAccessLogSubscriptionInput, ...request.Option) (*vpclattice.DeleteAccessLogSubscriptionOutput, error) - DeleteAccessLogSubscriptionRequest(*vpclattice.DeleteAccessLogSubscriptionInput) (*request.Request, *vpclattice.DeleteAccessLogSubscriptionOutput) - - DeleteAuthPolicy(*vpclattice.DeleteAuthPolicyInput) (*vpclattice.DeleteAuthPolicyOutput, error) - DeleteAuthPolicyWithContext(aws.Context, *vpclattice.DeleteAuthPolicyInput, ...request.Option) (*vpclattice.DeleteAuthPolicyOutput, error) - DeleteAuthPolicyRequest(*vpclattice.DeleteAuthPolicyInput) (*request.Request, *vpclattice.DeleteAuthPolicyOutput) - - DeleteListener(*vpclattice.DeleteListenerInput) (*vpclattice.DeleteListenerOutput, error) - DeleteListenerWithContext(aws.Context, *vpclattice.DeleteListenerInput, ...request.Option) (*vpclattice.DeleteListenerOutput, error) - DeleteListenerRequest(*vpclattice.DeleteListenerInput) (*request.Request, *vpclattice.DeleteListenerOutput) - - DeleteResourcePolicy(*vpclattice.DeleteResourcePolicyInput) (*vpclattice.DeleteResourcePolicyOutput, error) - DeleteResourcePolicyWithContext(aws.Context, *vpclattice.DeleteResourcePolicyInput, ...request.Option) (*vpclattice.DeleteResourcePolicyOutput, error) - DeleteResourcePolicyRequest(*vpclattice.DeleteResourcePolicyInput) (*request.Request, *vpclattice.DeleteResourcePolicyOutput) - - DeleteRule(*vpclattice.DeleteRuleInput) (*vpclattice.DeleteRuleOutput, error) - DeleteRuleWithContext(aws.Context, *vpclattice.DeleteRuleInput, ...request.Option) (*vpclattice.DeleteRuleOutput, error) - DeleteRuleRequest(*vpclattice.DeleteRuleInput) (*request.Request, *vpclattice.DeleteRuleOutput) - - DeleteService(*vpclattice.DeleteServiceInput) (*vpclattice.DeleteServiceOutput, error) - DeleteServiceWithContext(aws.Context, *vpclattice.DeleteServiceInput, ...request.Option) (*vpclattice.DeleteServiceOutput, error) - DeleteServiceRequest(*vpclattice.DeleteServiceInput) (*request.Request, *vpclattice.DeleteServiceOutput) - - DeleteServiceNetwork(*vpclattice.DeleteServiceNetworkInput) (*vpclattice.DeleteServiceNetworkOutput, error) - DeleteServiceNetworkWithContext(aws.Context, *vpclattice.DeleteServiceNetworkInput, ...request.Option) (*vpclattice.DeleteServiceNetworkOutput, error) - DeleteServiceNetworkRequest(*vpclattice.DeleteServiceNetworkInput) (*request.Request, *vpclattice.DeleteServiceNetworkOutput) - - DeleteServiceNetworkServiceAssociation(*vpclattice.DeleteServiceNetworkServiceAssociationInput) (*vpclattice.DeleteServiceNetworkServiceAssociationOutput, error) - DeleteServiceNetworkServiceAssociationWithContext(aws.Context, *vpclattice.DeleteServiceNetworkServiceAssociationInput, ...request.Option) (*vpclattice.DeleteServiceNetworkServiceAssociationOutput, error) - DeleteServiceNetworkServiceAssociationRequest(*vpclattice.DeleteServiceNetworkServiceAssociationInput) (*request.Request, *vpclattice.DeleteServiceNetworkServiceAssociationOutput) - - DeleteServiceNetworkVpcAssociation(*vpclattice.DeleteServiceNetworkVpcAssociationInput) (*vpclattice.DeleteServiceNetworkVpcAssociationOutput, error) - DeleteServiceNetworkVpcAssociationWithContext(aws.Context, *vpclattice.DeleteServiceNetworkVpcAssociationInput, ...request.Option) (*vpclattice.DeleteServiceNetworkVpcAssociationOutput, error) - DeleteServiceNetworkVpcAssociationRequest(*vpclattice.DeleteServiceNetworkVpcAssociationInput) (*request.Request, *vpclattice.DeleteServiceNetworkVpcAssociationOutput) - - DeleteTargetGroup(*vpclattice.DeleteTargetGroupInput) (*vpclattice.DeleteTargetGroupOutput, error) - DeleteTargetGroupWithContext(aws.Context, *vpclattice.DeleteTargetGroupInput, ...request.Option) (*vpclattice.DeleteTargetGroupOutput, error) - DeleteTargetGroupRequest(*vpclattice.DeleteTargetGroupInput) (*request.Request, *vpclattice.DeleteTargetGroupOutput) - - DeregisterTargets(*vpclattice.DeregisterTargetsInput) (*vpclattice.DeregisterTargetsOutput, error) - DeregisterTargetsWithContext(aws.Context, *vpclattice.DeregisterTargetsInput, ...request.Option) (*vpclattice.DeregisterTargetsOutput, error) - DeregisterTargetsRequest(*vpclattice.DeregisterTargetsInput) (*request.Request, *vpclattice.DeregisterTargetsOutput) - - GetAccessLogSubscription(*vpclattice.GetAccessLogSubscriptionInput) (*vpclattice.GetAccessLogSubscriptionOutput, error) - GetAccessLogSubscriptionWithContext(aws.Context, *vpclattice.GetAccessLogSubscriptionInput, ...request.Option) (*vpclattice.GetAccessLogSubscriptionOutput, error) - GetAccessLogSubscriptionRequest(*vpclattice.GetAccessLogSubscriptionInput) (*request.Request, *vpclattice.GetAccessLogSubscriptionOutput) - - GetAuthPolicy(*vpclattice.GetAuthPolicyInput) (*vpclattice.GetAuthPolicyOutput, error) - GetAuthPolicyWithContext(aws.Context, *vpclattice.GetAuthPolicyInput, ...request.Option) (*vpclattice.GetAuthPolicyOutput, error) - GetAuthPolicyRequest(*vpclattice.GetAuthPolicyInput) (*request.Request, *vpclattice.GetAuthPolicyOutput) - - GetListener(*vpclattice.GetListenerInput) (*vpclattice.GetListenerOutput, error) - GetListenerWithContext(aws.Context, *vpclattice.GetListenerInput, ...request.Option) (*vpclattice.GetListenerOutput, error) - GetListenerRequest(*vpclattice.GetListenerInput) (*request.Request, *vpclattice.GetListenerOutput) - - GetResourcePolicy(*vpclattice.GetResourcePolicyInput) (*vpclattice.GetResourcePolicyOutput, error) - GetResourcePolicyWithContext(aws.Context, *vpclattice.GetResourcePolicyInput, ...request.Option) (*vpclattice.GetResourcePolicyOutput, error) - GetResourcePolicyRequest(*vpclattice.GetResourcePolicyInput) (*request.Request, *vpclattice.GetResourcePolicyOutput) - - GetRule(*vpclattice.GetRuleInput) (*vpclattice.GetRuleOutput, error) - GetRuleWithContext(aws.Context, *vpclattice.GetRuleInput, ...request.Option) (*vpclattice.GetRuleOutput, error) - GetRuleRequest(*vpclattice.GetRuleInput) (*request.Request, *vpclattice.GetRuleOutput) - - GetService(*vpclattice.GetServiceInput) (*vpclattice.GetServiceOutput, error) - GetServiceWithContext(aws.Context, *vpclattice.GetServiceInput, ...request.Option) (*vpclattice.GetServiceOutput, error) - GetServiceRequest(*vpclattice.GetServiceInput) (*request.Request, *vpclattice.GetServiceOutput) - - GetServiceNetwork(*vpclattice.GetServiceNetworkInput) (*vpclattice.GetServiceNetworkOutput, error) - GetServiceNetworkWithContext(aws.Context, *vpclattice.GetServiceNetworkInput, ...request.Option) (*vpclattice.GetServiceNetworkOutput, error) - GetServiceNetworkRequest(*vpclattice.GetServiceNetworkInput) (*request.Request, *vpclattice.GetServiceNetworkOutput) - - GetServiceNetworkServiceAssociation(*vpclattice.GetServiceNetworkServiceAssociationInput) (*vpclattice.GetServiceNetworkServiceAssociationOutput, error) - GetServiceNetworkServiceAssociationWithContext(aws.Context, *vpclattice.GetServiceNetworkServiceAssociationInput, ...request.Option) (*vpclattice.GetServiceNetworkServiceAssociationOutput, error) - GetServiceNetworkServiceAssociationRequest(*vpclattice.GetServiceNetworkServiceAssociationInput) (*request.Request, *vpclattice.GetServiceNetworkServiceAssociationOutput) - - GetServiceNetworkVpcAssociation(*vpclattice.GetServiceNetworkVpcAssociationInput) (*vpclattice.GetServiceNetworkVpcAssociationOutput, error) - GetServiceNetworkVpcAssociationWithContext(aws.Context, *vpclattice.GetServiceNetworkVpcAssociationInput, ...request.Option) (*vpclattice.GetServiceNetworkVpcAssociationOutput, error) - GetServiceNetworkVpcAssociationRequest(*vpclattice.GetServiceNetworkVpcAssociationInput) (*request.Request, *vpclattice.GetServiceNetworkVpcAssociationOutput) - - GetTargetGroup(*vpclattice.GetTargetGroupInput) (*vpclattice.GetTargetGroupOutput, error) - GetTargetGroupWithContext(aws.Context, *vpclattice.GetTargetGroupInput, ...request.Option) (*vpclattice.GetTargetGroupOutput, error) - GetTargetGroupRequest(*vpclattice.GetTargetGroupInput) (*request.Request, *vpclattice.GetTargetGroupOutput) - - ListAccessLogSubscriptions(*vpclattice.ListAccessLogSubscriptionsInput) (*vpclattice.ListAccessLogSubscriptionsOutput, error) - ListAccessLogSubscriptionsWithContext(aws.Context, *vpclattice.ListAccessLogSubscriptionsInput, ...request.Option) (*vpclattice.ListAccessLogSubscriptionsOutput, error) - ListAccessLogSubscriptionsRequest(*vpclattice.ListAccessLogSubscriptionsInput) (*request.Request, *vpclattice.ListAccessLogSubscriptionsOutput) - - ListAccessLogSubscriptionsPages(*vpclattice.ListAccessLogSubscriptionsInput, func(*vpclattice.ListAccessLogSubscriptionsOutput, bool) bool) error - ListAccessLogSubscriptionsPagesWithContext(aws.Context, *vpclattice.ListAccessLogSubscriptionsInput, func(*vpclattice.ListAccessLogSubscriptionsOutput, bool) bool, ...request.Option) error - - ListListeners(*vpclattice.ListListenersInput) (*vpclattice.ListListenersOutput, error) - ListListenersWithContext(aws.Context, *vpclattice.ListListenersInput, ...request.Option) (*vpclattice.ListListenersOutput, error) - ListListenersRequest(*vpclattice.ListListenersInput) (*request.Request, *vpclattice.ListListenersOutput) - - ListListenersPages(*vpclattice.ListListenersInput, func(*vpclattice.ListListenersOutput, bool) bool) error - ListListenersPagesWithContext(aws.Context, *vpclattice.ListListenersInput, func(*vpclattice.ListListenersOutput, bool) bool, ...request.Option) error - - ListRules(*vpclattice.ListRulesInput) (*vpclattice.ListRulesOutput, error) - ListRulesWithContext(aws.Context, *vpclattice.ListRulesInput, ...request.Option) (*vpclattice.ListRulesOutput, error) - ListRulesRequest(*vpclattice.ListRulesInput) (*request.Request, *vpclattice.ListRulesOutput) - - ListRulesPages(*vpclattice.ListRulesInput, func(*vpclattice.ListRulesOutput, bool) bool) error - ListRulesPagesWithContext(aws.Context, *vpclattice.ListRulesInput, func(*vpclattice.ListRulesOutput, bool) bool, ...request.Option) error - - ListServiceNetworkServiceAssociations(*vpclattice.ListServiceNetworkServiceAssociationsInput) (*vpclattice.ListServiceNetworkServiceAssociationsOutput, error) - ListServiceNetworkServiceAssociationsWithContext(aws.Context, *vpclattice.ListServiceNetworkServiceAssociationsInput, ...request.Option) (*vpclattice.ListServiceNetworkServiceAssociationsOutput, error) - ListServiceNetworkServiceAssociationsRequest(*vpclattice.ListServiceNetworkServiceAssociationsInput) (*request.Request, *vpclattice.ListServiceNetworkServiceAssociationsOutput) - - ListServiceNetworkServiceAssociationsPages(*vpclattice.ListServiceNetworkServiceAssociationsInput, func(*vpclattice.ListServiceNetworkServiceAssociationsOutput, bool) bool) error - ListServiceNetworkServiceAssociationsPagesWithContext(aws.Context, *vpclattice.ListServiceNetworkServiceAssociationsInput, func(*vpclattice.ListServiceNetworkServiceAssociationsOutput, bool) bool, ...request.Option) error - - ListServiceNetworkVpcAssociations(*vpclattice.ListServiceNetworkVpcAssociationsInput) (*vpclattice.ListServiceNetworkVpcAssociationsOutput, error) - ListServiceNetworkVpcAssociationsWithContext(aws.Context, *vpclattice.ListServiceNetworkVpcAssociationsInput, ...request.Option) (*vpclattice.ListServiceNetworkVpcAssociationsOutput, error) - ListServiceNetworkVpcAssociationsRequest(*vpclattice.ListServiceNetworkVpcAssociationsInput) (*request.Request, *vpclattice.ListServiceNetworkVpcAssociationsOutput) - - ListServiceNetworkVpcAssociationsPages(*vpclattice.ListServiceNetworkVpcAssociationsInput, func(*vpclattice.ListServiceNetworkVpcAssociationsOutput, bool) bool) error - ListServiceNetworkVpcAssociationsPagesWithContext(aws.Context, *vpclattice.ListServiceNetworkVpcAssociationsInput, func(*vpclattice.ListServiceNetworkVpcAssociationsOutput, bool) bool, ...request.Option) error - - ListServiceNetworks(*vpclattice.ListServiceNetworksInput) (*vpclattice.ListServiceNetworksOutput, error) - ListServiceNetworksWithContext(aws.Context, *vpclattice.ListServiceNetworksInput, ...request.Option) (*vpclattice.ListServiceNetworksOutput, error) - ListServiceNetworksRequest(*vpclattice.ListServiceNetworksInput) (*request.Request, *vpclattice.ListServiceNetworksOutput) - - ListServiceNetworksPages(*vpclattice.ListServiceNetworksInput, func(*vpclattice.ListServiceNetworksOutput, bool) bool) error - ListServiceNetworksPagesWithContext(aws.Context, *vpclattice.ListServiceNetworksInput, func(*vpclattice.ListServiceNetworksOutput, bool) bool, ...request.Option) error - - ListServices(*vpclattice.ListServicesInput) (*vpclattice.ListServicesOutput, error) - ListServicesWithContext(aws.Context, *vpclattice.ListServicesInput, ...request.Option) (*vpclattice.ListServicesOutput, error) - ListServicesRequest(*vpclattice.ListServicesInput) (*request.Request, *vpclattice.ListServicesOutput) - - ListServicesPages(*vpclattice.ListServicesInput, func(*vpclattice.ListServicesOutput, bool) bool) error - ListServicesPagesWithContext(aws.Context, *vpclattice.ListServicesInput, func(*vpclattice.ListServicesOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*vpclattice.ListTagsForResourceInput) (*vpclattice.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *vpclattice.ListTagsForResourceInput, ...request.Option) (*vpclattice.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*vpclattice.ListTagsForResourceInput) (*request.Request, *vpclattice.ListTagsForResourceOutput) - - ListTargetGroups(*vpclattice.ListTargetGroupsInput) (*vpclattice.ListTargetGroupsOutput, error) - ListTargetGroupsWithContext(aws.Context, *vpclattice.ListTargetGroupsInput, ...request.Option) (*vpclattice.ListTargetGroupsOutput, error) - ListTargetGroupsRequest(*vpclattice.ListTargetGroupsInput) (*request.Request, *vpclattice.ListTargetGroupsOutput) - - ListTargetGroupsPages(*vpclattice.ListTargetGroupsInput, func(*vpclattice.ListTargetGroupsOutput, bool) bool) error - ListTargetGroupsPagesWithContext(aws.Context, *vpclattice.ListTargetGroupsInput, func(*vpclattice.ListTargetGroupsOutput, bool) bool, ...request.Option) error - - ListTargets(*vpclattice.ListTargetsInput) (*vpclattice.ListTargetsOutput, error) - ListTargetsWithContext(aws.Context, *vpclattice.ListTargetsInput, ...request.Option) (*vpclattice.ListTargetsOutput, error) - ListTargetsRequest(*vpclattice.ListTargetsInput) (*request.Request, *vpclattice.ListTargetsOutput) - - ListTargetsPages(*vpclattice.ListTargetsInput, func(*vpclattice.ListTargetsOutput, bool) bool) error - ListTargetsPagesWithContext(aws.Context, *vpclattice.ListTargetsInput, func(*vpclattice.ListTargetsOutput, bool) bool, ...request.Option) error - - PutAuthPolicy(*vpclattice.PutAuthPolicyInput) (*vpclattice.PutAuthPolicyOutput, error) - PutAuthPolicyWithContext(aws.Context, *vpclattice.PutAuthPolicyInput, ...request.Option) (*vpclattice.PutAuthPolicyOutput, error) - PutAuthPolicyRequest(*vpclattice.PutAuthPolicyInput) (*request.Request, *vpclattice.PutAuthPolicyOutput) - - PutResourcePolicy(*vpclattice.PutResourcePolicyInput) (*vpclattice.PutResourcePolicyOutput, error) - PutResourcePolicyWithContext(aws.Context, *vpclattice.PutResourcePolicyInput, ...request.Option) (*vpclattice.PutResourcePolicyOutput, error) - PutResourcePolicyRequest(*vpclattice.PutResourcePolicyInput) (*request.Request, *vpclattice.PutResourcePolicyOutput) - - RegisterTargets(*vpclattice.RegisterTargetsInput) (*vpclattice.RegisterTargetsOutput, error) - RegisterTargetsWithContext(aws.Context, *vpclattice.RegisterTargetsInput, ...request.Option) (*vpclattice.RegisterTargetsOutput, error) - RegisterTargetsRequest(*vpclattice.RegisterTargetsInput) (*request.Request, *vpclattice.RegisterTargetsOutput) - - TagResource(*vpclattice.TagResourceInput) (*vpclattice.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *vpclattice.TagResourceInput, ...request.Option) (*vpclattice.TagResourceOutput, error) - TagResourceRequest(*vpclattice.TagResourceInput) (*request.Request, *vpclattice.TagResourceOutput) - - UntagResource(*vpclattice.UntagResourceInput) (*vpclattice.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *vpclattice.UntagResourceInput, ...request.Option) (*vpclattice.UntagResourceOutput, error) - UntagResourceRequest(*vpclattice.UntagResourceInput) (*request.Request, *vpclattice.UntagResourceOutput) - - UpdateAccessLogSubscription(*vpclattice.UpdateAccessLogSubscriptionInput) (*vpclattice.UpdateAccessLogSubscriptionOutput, error) - UpdateAccessLogSubscriptionWithContext(aws.Context, *vpclattice.UpdateAccessLogSubscriptionInput, ...request.Option) (*vpclattice.UpdateAccessLogSubscriptionOutput, error) - UpdateAccessLogSubscriptionRequest(*vpclattice.UpdateAccessLogSubscriptionInput) (*request.Request, *vpclattice.UpdateAccessLogSubscriptionOutput) - - UpdateListener(*vpclattice.UpdateListenerInput) (*vpclattice.UpdateListenerOutput, error) - UpdateListenerWithContext(aws.Context, *vpclattice.UpdateListenerInput, ...request.Option) (*vpclattice.UpdateListenerOutput, error) - UpdateListenerRequest(*vpclattice.UpdateListenerInput) (*request.Request, *vpclattice.UpdateListenerOutput) - - UpdateRule(*vpclattice.UpdateRuleInput) (*vpclattice.UpdateRuleOutput, error) - UpdateRuleWithContext(aws.Context, *vpclattice.UpdateRuleInput, ...request.Option) (*vpclattice.UpdateRuleOutput, error) - UpdateRuleRequest(*vpclattice.UpdateRuleInput) (*request.Request, *vpclattice.UpdateRuleOutput) - - UpdateService(*vpclattice.UpdateServiceInput) (*vpclattice.UpdateServiceOutput, error) - UpdateServiceWithContext(aws.Context, *vpclattice.UpdateServiceInput, ...request.Option) (*vpclattice.UpdateServiceOutput, error) - UpdateServiceRequest(*vpclattice.UpdateServiceInput) (*request.Request, *vpclattice.UpdateServiceOutput) - - UpdateServiceNetwork(*vpclattice.UpdateServiceNetworkInput) (*vpclattice.UpdateServiceNetworkOutput, error) - UpdateServiceNetworkWithContext(aws.Context, *vpclattice.UpdateServiceNetworkInput, ...request.Option) (*vpclattice.UpdateServiceNetworkOutput, error) - UpdateServiceNetworkRequest(*vpclattice.UpdateServiceNetworkInput) (*request.Request, *vpclattice.UpdateServiceNetworkOutput) - - UpdateServiceNetworkVpcAssociation(*vpclattice.UpdateServiceNetworkVpcAssociationInput) (*vpclattice.UpdateServiceNetworkVpcAssociationOutput, error) - UpdateServiceNetworkVpcAssociationWithContext(aws.Context, *vpclattice.UpdateServiceNetworkVpcAssociationInput, ...request.Option) (*vpclattice.UpdateServiceNetworkVpcAssociationOutput, error) - UpdateServiceNetworkVpcAssociationRequest(*vpclattice.UpdateServiceNetworkVpcAssociationInput) (*request.Request, *vpclattice.UpdateServiceNetworkVpcAssociationOutput) - - UpdateTargetGroup(*vpclattice.UpdateTargetGroupInput) (*vpclattice.UpdateTargetGroupOutput, error) - UpdateTargetGroupWithContext(aws.Context, *vpclattice.UpdateTargetGroupInput, ...request.Option) (*vpclattice.UpdateTargetGroupOutput, error) - UpdateTargetGroupRequest(*vpclattice.UpdateTargetGroupInput) (*request.Request, *vpclattice.UpdateTargetGroupOutput) -} - -var _ VPCLatticeAPI = (*vpclattice.VPCLattice)(nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/api.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/api.go deleted file mode 100644 index f09d31acee0e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/api.go +++ /dev/null @@ -1,5355 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package workspacesthinclient - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -const opCreateEnvironment = "CreateEnvironment" - -// CreateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the CreateEnvironment 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 CreateEnvironment for more information on using the CreateEnvironment -// 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 CreateEnvironmentRequest method. -// req, resp := client.CreateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/CreateEnvironment -func (c *WorkSpacesThinClient) CreateEnvironmentRequest(input *CreateEnvironmentInput) (req *request.Request, output *CreateEnvironmentOutput) { - op := &request.Operation{ - Name: opCreateEnvironment, - HTTPMethod: "POST", - HTTPPath: "/environments", - } - - if input == nil { - input = &CreateEnvironmentInput{} - } - - output = &CreateEnvironmentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// CreateEnvironment API operation for Amazon WorkSpaces Thin Client. -// -// Creates an environment for your thin client devices. -// -// 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 WorkSpaces Thin Client's -// API operation CreateEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ServiceQuotaExceededException -// Your request exceeds a service quota. -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/CreateEnvironment -func (c *WorkSpacesThinClient) CreateEnvironment(input *CreateEnvironmentInput) (*CreateEnvironmentOutput, error) { - req, out := c.CreateEnvironmentRequest(input) - return out, req.Send() -} - -// CreateEnvironmentWithContext is the same as CreateEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEnvironment 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 *WorkSpacesThinClient) CreateEnvironmentWithContext(ctx aws.Context, input *CreateEnvironmentInput, opts ...request.Option) (*CreateEnvironmentOutput, error) { - req, out := c.CreateEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDevice = "DeleteDevice" - -// DeleteDeviceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteDevice 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 DeleteDevice for more information on using the DeleteDevice -// 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 DeleteDeviceRequest method. -// req, resp := client.DeleteDeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/DeleteDevice -func (c *WorkSpacesThinClient) DeleteDeviceRequest(input *DeleteDeviceInput) (req *request.Request, output *DeleteDeviceOutput) { - op := &request.Operation{ - Name: opDeleteDevice, - HTTPMethod: "DELETE", - HTTPPath: "/devices/{id}", - } - - if input == nil { - input = &DeleteDeviceInput{} - } - - output = &DeleteDeviceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteDevice API operation for Amazon WorkSpaces Thin Client. -// -// Deletes a thin client device. -// -// 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 WorkSpaces Thin Client's -// API operation DeleteDevice for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/DeleteDevice -func (c *WorkSpacesThinClient) DeleteDevice(input *DeleteDeviceInput) (*DeleteDeviceOutput, error) { - req, out := c.DeleteDeviceRequest(input) - return out, req.Send() -} - -// DeleteDeviceWithContext is the same as DeleteDevice with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDevice 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 *WorkSpacesThinClient) DeleteDeviceWithContext(ctx aws.Context, input *DeleteDeviceInput, opts ...request.Option) (*DeleteDeviceOutput, error) { - req, out := c.DeleteDeviceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEnvironment = "DeleteEnvironment" - -// DeleteEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEnvironment 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 DeleteEnvironment for more information on using the DeleteEnvironment -// 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 DeleteEnvironmentRequest method. -// req, resp := client.DeleteEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/DeleteEnvironment -func (c *WorkSpacesThinClient) DeleteEnvironmentRequest(input *DeleteEnvironmentInput) (req *request.Request, output *DeleteEnvironmentOutput) { - op := &request.Operation{ - Name: opDeleteEnvironment, - HTTPMethod: "DELETE", - HTTPPath: "/environments/{id}", - } - - if input == nil { - input = &DeleteEnvironmentInput{} - } - - output = &DeleteEnvironmentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeleteEnvironment API operation for Amazon WorkSpaces Thin Client. -// -// Deletes an environment. -// -// 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 WorkSpaces Thin Client's -// API operation DeleteEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/DeleteEnvironment -func (c *WorkSpacesThinClient) DeleteEnvironment(input *DeleteEnvironmentInput) (*DeleteEnvironmentOutput, error) { - req, out := c.DeleteEnvironmentRequest(input) - return out, req.Send() -} - -// DeleteEnvironmentWithContext is the same as DeleteEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEnvironment 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 *WorkSpacesThinClient) DeleteEnvironmentWithContext(ctx aws.Context, input *DeleteEnvironmentInput, opts ...request.Option) (*DeleteEnvironmentOutput, error) { - req, out := c.DeleteEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterDevice = "DeregisterDevice" - -// DeregisterDeviceRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterDevice 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 DeregisterDevice for more information on using the DeregisterDevice -// 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 DeregisterDeviceRequest method. -// req, resp := client.DeregisterDeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/DeregisterDevice -func (c *WorkSpacesThinClient) DeregisterDeviceRequest(input *DeregisterDeviceInput) (req *request.Request, output *DeregisterDeviceOutput) { - op := &request.Operation{ - Name: opDeregisterDevice, - HTTPMethod: "POST", - HTTPPath: "/deregister-device/{id}", - } - - if input == nil { - input = &DeregisterDeviceInput{} - } - - output = &DeregisterDeviceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// DeregisterDevice API operation for Amazon WorkSpaces Thin Client. -// -// Deregisters a thin client device. -// -// 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 WorkSpaces Thin Client's -// API operation DeregisterDevice for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - ConflictException -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/DeregisterDevice -func (c *WorkSpacesThinClient) DeregisterDevice(input *DeregisterDeviceInput) (*DeregisterDeviceOutput, error) { - req, out := c.DeregisterDeviceRequest(input) - return out, req.Send() -} - -// DeregisterDeviceWithContext is the same as DeregisterDevice with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterDevice 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 *WorkSpacesThinClient) DeregisterDeviceWithContext(ctx aws.Context, input *DeregisterDeviceInput, opts ...request.Option) (*DeregisterDeviceOutput, error) { - req, out := c.DeregisterDeviceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetDevice = "GetDevice" - -// GetDeviceRequest generates a "aws/request.Request" representing the -// client's request for the GetDevice 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 GetDevice for more information on using the GetDevice -// 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 GetDeviceRequest method. -// req, resp := client.GetDeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/GetDevice -func (c *WorkSpacesThinClient) GetDeviceRequest(input *GetDeviceInput) (req *request.Request, output *GetDeviceOutput) { - op := &request.Operation{ - Name: opGetDevice, - HTTPMethod: "GET", - HTTPPath: "/devices/{id}", - } - - if input == nil { - input = &GetDeviceInput{} - } - - output = &GetDeviceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetDevice API operation for Amazon WorkSpaces Thin Client. -// -// Returns information for a thin client device. -// -// 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 WorkSpaces Thin Client's -// API operation GetDevice for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/GetDevice -func (c *WorkSpacesThinClient) GetDevice(input *GetDeviceInput) (*GetDeviceOutput, error) { - req, out := c.GetDeviceRequest(input) - return out, req.Send() -} - -// GetDeviceWithContext is the same as GetDevice with the addition of -// the ability to pass a context and additional request options. -// -// See GetDevice 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 *WorkSpacesThinClient) GetDeviceWithContext(ctx aws.Context, input *GetDeviceInput, opts ...request.Option) (*GetDeviceOutput, error) { - req, out := c.GetDeviceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEnvironment = "GetEnvironment" - -// GetEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the GetEnvironment 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 GetEnvironment for more information on using the GetEnvironment -// 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 GetEnvironmentRequest method. -// req, resp := client.GetEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/GetEnvironment -func (c *WorkSpacesThinClient) GetEnvironmentRequest(input *GetEnvironmentInput) (req *request.Request, output *GetEnvironmentOutput) { - op := &request.Operation{ - Name: opGetEnvironment, - HTTPMethod: "GET", - HTTPPath: "/environments/{id}", - } - - if input == nil { - input = &GetEnvironmentInput{} - } - - output = &GetEnvironmentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetEnvironment API operation for Amazon WorkSpaces Thin Client. -// -// Returns information for an environment. -// -// 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 WorkSpaces Thin Client's -// API operation GetEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/GetEnvironment -func (c *WorkSpacesThinClient) GetEnvironment(input *GetEnvironmentInput) (*GetEnvironmentOutput, error) { - req, out := c.GetEnvironmentRequest(input) - return out, req.Send() -} - -// GetEnvironmentWithContext is the same as GetEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See GetEnvironment 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 *WorkSpacesThinClient) GetEnvironmentWithContext(ctx aws.Context, input *GetEnvironmentInput, opts ...request.Option) (*GetEnvironmentOutput, error) { - req, out := c.GetEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSoftwareSet = "GetSoftwareSet" - -// GetSoftwareSetRequest generates a "aws/request.Request" representing the -// client's request for the GetSoftwareSet 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 GetSoftwareSet for more information on using the GetSoftwareSet -// 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 GetSoftwareSetRequest method. -// req, resp := client.GetSoftwareSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/GetSoftwareSet -func (c *WorkSpacesThinClient) GetSoftwareSetRequest(input *GetSoftwareSetInput) (req *request.Request, output *GetSoftwareSetOutput) { - op := &request.Operation{ - Name: opGetSoftwareSet, - HTTPMethod: "GET", - HTTPPath: "/softwaresets/{id}", - } - - if input == nil { - input = &GetSoftwareSetInput{} - } - - output = &GetSoftwareSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// GetSoftwareSet API operation for Amazon WorkSpaces Thin Client. -// -// Returns information for a software set. -// -// 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 WorkSpaces Thin Client's -// API operation GetSoftwareSet for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/GetSoftwareSet -func (c *WorkSpacesThinClient) GetSoftwareSet(input *GetSoftwareSetInput) (*GetSoftwareSetOutput, error) { - req, out := c.GetSoftwareSetRequest(input) - return out, req.Send() -} - -// GetSoftwareSetWithContext is the same as GetSoftwareSet with the addition of -// the ability to pass a context and additional request options. -// -// See GetSoftwareSet 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 *WorkSpacesThinClient) GetSoftwareSetWithContext(ctx aws.Context, input *GetSoftwareSetInput, opts ...request.Option) (*GetSoftwareSetOutput, error) { - req, out := c.GetSoftwareSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListDevices = "ListDevices" - -// ListDevicesRequest generates a "aws/request.Request" representing the -// client's request for the ListDevices 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 ListDevices for more information on using the ListDevices -// 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 ListDevicesRequest method. -// req, resp := client.ListDevicesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/ListDevices -func (c *WorkSpacesThinClient) ListDevicesRequest(input *ListDevicesInput) (req *request.Request, output *ListDevicesOutput) { - op := &request.Operation{ - Name: opListDevices, - HTTPMethod: "GET", - HTTPPath: "/devices", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDevicesInput{} - } - - output = &ListDevicesOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListDevices API operation for Amazon WorkSpaces Thin Client. -// -// Returns a list of thin client devices. -// -// 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 WorkSpaces Thin Client's -// API operation ListDevices for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/ListDevices -func (c *WorkSpacesThinClient) ListDevices(input *ListDevicesInput) (*ListDevicesOutput, error) { - req, out := c.ListDevicesRequest(input) - return out, req.Send() -} - -// ListDevicesWithContext is the same as ListDevices with the addition of -// the ability to pass a context and additional request options. -// -// See ListDevices 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 *WorkSpacesThinClient) ListDevicesWithContext(ctx aws.Context, input *ListDevicesInput, opts ...request.Option) (*ListDevicesOutput, error) { - req, out := c.ListDevicesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDevicesPages iterates over the pages of a ListDevices operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDevices method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDevices operation. -// pageNum := 0 -// err := client.ListDevicesPages(params, -// func(page *workspacesthinclient.ListDevicesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *WorkSpacesThinClient) ListDevicesPages(input *ListDevicesInput, fn func(*ListDevicesOutput, bool) bool) error { - return c.ListDevicesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDevicesPagesWithContext same as ListDevicesPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *WorkSpacesThinClient) ListDevicesPagesWithContext(ctx aws.Context, input *ListDevicesInput, fn func(*ListDevicesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDevicesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDevicesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDevicesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEnvironments = "ListEnvironments" - -// ListEnvironmentsRequest generates a "aws/request.Request" representing the -// client's request for the ListEnvironments 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 ListEnvironments for more information on using the ListEnvironments -// 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 ListEnvironmentsRequest method. -// req, resp := client.ListEnvironmentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/ListEnvironments -func (c *WorkSpacesThinClient) ListEnvironmentsRequest(input *ListEnvironmentsInput) (req *request.Request, output *ListEnvironmentsOutput) { - op := &request.Operation{ - Name: opListEnvironments, - HTTPMethod: "GET", - HTTPPath: "/environments", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEnvironmentsInput{} - } - - output = &ListEnvironmentsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListEnvironments API operation for Amazon WorkSpaces Thin Client. -// -// Returns a list of environments. -// -// 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 WorkSpaces Thin Client's -// API operation ListEnvironments for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/ListEnvironments -func (c *WorkSpacesThinClient) ListEnvironments(input *ListEnvironmentsInput) (*ListEnvironmentsOutput, error) { - req, out := c.ListEnvironmentsRequest(input) - return out, req.Send() -} - -// ListEnvironmentsWithContext is the same as ListEnvironments with the addition of -// the ability to pass a context and additional request options. -// -// See ListEnvironments 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 *WorkSpacesThinClient) ListEnvironmentsWithContext(ctx aws.Context, input *ListEnvironmentsInput, opts ...request.Option) (*ListEnvironmentsOutput, error) { - req, out := c.ListEnvironmentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEnvironmentsPages iterates over the pages of a ListEnvironments operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEnvironments method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEnvironments operation. -// pageNum := 0 -// err := client.ListEnvironmentsPages(params, -// func(page *workspacesthinclient.ListEnvironmentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *WorkSpacesThinClient) ListEnvironmentsPages(input *ListEnvironmentsInput, fn func(*ListEnvironmentsOutput, bool) bool) error { - return c.ListEnvironmentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEnvironmentsPagesWithContext same as ListEnvironmentsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *WorkSpacesThinClient) ListEnvironmentsPagesWithContext(ctx aws.Context, input *ListEnvironmentsInput, fn func(*ListEnvironmentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEnvironmentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEnvironmentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEnvironmentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListSoftwareSets = "ListSoftwareSets" - -// ListSoftwareSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListSoftwareSets 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 ListSoftwareSets for more information on using the ListSoftwareSets -// 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 ListSoftwareSetsRequest method. -// req, resp := client.ListSoftwareSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/ListSoftwareSets -func (c *WorkSpacesThinClient) ListSoftwareSetsRequest(input *ListSoftwareSetsInput) (req *request.Request, output *ListSoftwareSetsOutput) { - op := &request.Operation{ - Name: opListSoftwareSets, - HTTPMethod: "GET", - HTTPPath: "/softwaresets", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListSoftwareSetsInput{} - } - - output = &ListSoftwareSetsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListSoftwareSets API operation for Amazon WorkSpaces Thin Client. -// -// Returns a list of software sets. -// -// 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 WorkSpaces Thin Client's -// API operation ListSoftwareSets for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/ListSoftwareSets -func (c *WorkSpacesThinClient) ListSoftwareSets(input *ListSoftwareSetsInput) (*ListSoftwareSetsOutput, error) { - req, out := c.ListSoftwareSetsRequest(input) - return out, req.Send() -} - -// ListSoftwareSetsWithContext is the same as ListSoftwareSets with the addition of -// the ability to pass a context and additional request options. -// -// See ListSoftwareSets 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 *WorkSpacesThinClient) ListSoftwareSetsWithContext(ctx aws.Context, input *ListSoftwareSetsInput, opts ...request.Option) (*ListSoftwareSetsOutput, error) { - req, out := c.ListSoftwareSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListSoftwareSetsPages iterates over the pages of a ListSoftwareSets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSoftwareSets method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListSoftwareSets operation. -// pageNum := 0 -// err := client.ListSoftwareSetsPages(params, -// func(page *workspacesthinclient.ListSoftwareSetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *WorkSpacesThinClient) ListSoftwareSetsPages(input *ListSoftwareSetsInput, fn func(*ListSoftwareSetsOutput, bool) bool) error { - return c.ListSoftwareSetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSoftwareSetsPagesWithContext same as ListSoftwareSetsPages except -// it takes a Context and allows setting request options on the pages. -// -// 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 *WorkSpacesThinClient) ListSoftwareSetsPagesWithContext(ctx aws.Context, input *ListSoftwareSetsInput, fn func(*ListSoftwareSetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSoftwareSetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSoftwareSetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListSoftwareSetsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource 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 ListTagsForResource for more information on using the ListTagsForResource -// 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 ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/ListTagsForResource -func (c *WorkSpacesThinClient) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// ListTagsForResource API operation for Amazon WorkSpaces Thin Client. -// -// Returns a list of tags for a resource. -// -// 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 WorkSpaces Thin Client's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - InternalServiceException -// Request processing failed due to some unknown error, exception, or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/ListTagsForResource -func (c *WorkSpacesThinClient) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource 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 *WorkSpacesThinClient) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource 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 TagResource for more information on using the TagResource -// 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 TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/TagResource -func (c *WorkSpacesThinClient) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// TagResource API operation for Amazon WorkSpaces Thin Client. -// -// Assigns one or more tags (key-value pairs) to the specified resource. -// -// 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 WorkSpaces Thin Client's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - InternalServiceException -// Request processing failed due to some unknown error, exception, or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/TagResource -func (c *WorkSpacesThinClient) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource 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 *WorkSpacesThinClient) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource 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 UntagResource for more information on using the UntagResource -// 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 UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/UntagResource -func (c *WorkSpacesThinClient) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UntagResource API operation for Amazon WorkSpaces Thin Client. -// -// Removes a tag or tags from a resource. -// -// 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 WorkSpaces Thin Client's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - InternalServiceException -// Request processing failed due to some unknown error, exception, or failure. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/UntagResource -func (c *WorkSpacesThinClient) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource 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 *WorkSpacesThinClient) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateDevice = "UpdateDevice" - -// UpdateDeviceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDevice 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 UpdateDevice for more information on using the UpdateDevice -// 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 UpdateDeviceRequest method. -// req, resp := client.UpdateDeviceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/UpdateDevice -func (c *WorkSpacesThinClient) UpdateDeviceRequest(input *UpdateDeviceInput) (req *request.Request, output *UpdateDeviceOutput) { - op := &request.Operation{ - Name: opUpdateDevice, - HTTPMethod: "PATCH", - HTTPPath: "/devices/{id}", - } - - if input == nil { - input = &UpdateDeviceInput{} - } - - output = &UpdateDeviceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateDevice API operation for Amazon WorkSpaces Thin Client. -// -// Updates a thin client device. -// -// 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 WorkSpaces Thin Client's -// API operation UpdateDevice for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/UpdateDevice -func (c *WorkSpacesThinClient) UpdateDevice(input *UpdateDeviceInput) (*UpdateDeviceOutput, error) { - req, out := c.UpdateDeviceRequest(input) - return out, req.Send() -} - -// UpdateDeviceWithContext is the same as UpdateDevice with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateDevice 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 *WorkSpacesThinClient) UpdateDeviceWithContext(ctx aws.Context, input *UpdateDeviceInput, opts ...request.Option) (*UpdateDeviceOutput, error) { - req, out := c.UpdateDeviceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateEnvironment = "UpdateEnvironment" - -// UpdateEnvironmentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEnvironment 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 UpdateEnvironment for more information on using the UpdateEnvironment -// 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 UpdateEnvironmentRequest method. -// req, resp := client.UpdateEnvironmentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/UpdateEnvironment -func (c *WorkSpacesThinClient) UpdateEnvironmentRequest(input *UpdateEnvironmentInput) (req *request.Request, output *UpdateEnvironmentOutput) { - op := &request.Operation{ - Name: opUpdateEnvironment, - HTTPMethod: "PATCH", - HTTPPath: "/environments/{id}", - } - - if input == nil { - input = &UpdateEnvironmentInput{} - } - - output = &UpdateEnvironmentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateEnvironment API operation for Amazon WorkSpaces Thin Client. -// -// Updates an environment. -// -// 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 WorkSpaces Thin Client's -// API operation UpdateEnvironment for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/UpdateEnvironment -func (c *WorkSpacesThinClient) UpdateEnvironment(input *UpdateEnvironmentInput) (*UpdateEnvironmentOutput, error) { - req, out := c.UpdateEnvironmentRequest(input) - return out, req.Send() -} - -// UpdateEnvironmentWithContext is the same as UpdateEnvironment with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateEnvironment 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 *WorkSpacesThinClient) UpdateEnvironmentWithContext(ctx aws.Context, input *UpdateEnvironmentInput, opts ...request.Option) (*UpdateEnvironmentOutput, error) { - req, out := c.UpdateEnvironmentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSoftwareSet = "UpdateSoftwareSet" - -// UpdateSoftwareSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSoftwareSet 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 UpdateSoftwareSet for more information on using the UpdateSoftwareSet -// 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 UpdateSoftwareSetRequest method. -// req, resp := client.UpdateSoftwareSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/UpdateSoftwareSet -func (c *WorkSpacesThinClient) UpdateSoftwareSetRequest(input *UpdateSoftwareSetInput) (req *request.Request, output *UpdateSoftwareSetOutput) { - op := &request.Operation{ - Name: opUpdateSoftwareSet, - HTTPMethod: "PATCH", - HTTPPath: "/softwaresets/{id}", - } - - if input == nil { - input = &UpdateSoftwareSetInput{} - } - - output = &UpdateSoftwareSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("api.", nil)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// UpdateSoftwareSet API operation for Amazon WorkSpaces Thin Client. -// -// Updates a software set. -// -// 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 WorkSpaces Thin Client's -// API operation UpdateSoftwareSet for usage and error information. -// -// Returned Error Types: -// -// - ValidationException -// The input fails to satisfy the specified constraints. -// -// - AccessDeniedException -// You do not have sufficient access to perform this action. -// -// - ResourceNotFoundException -// The resource specified in the request was not found. -// -// - ThrottlingException -// The request was denied due to request throttling. -// -// - InternalServerException -// The server encountered an internal error and is unable to complete the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22/UpdateSoftwareSet -func (c *WorkSpacesThinClient) UpdateSoftwareSet(input *UpdateSoftwareSetInput) (*UpdateSoftwareSetOutput, error) { - req, out := c.UpdateSoftwareSetRequest(input) - return out, req.Send() -} - -// UpdateSoftwareSetWithContext is the same as UpdateSoftwareSet with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSoftwareSet 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 *WorkSpacesThinClient) UpdateSoftwareSetWithContext(ctx aws.Context, input *UpdateSoftwareSetInput, opts ...request.Option) (*UpdateSoftwareSetOutput, error) { - req, out := c.UpdateSoftwareSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// You do not have sufficient access to perform this action. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" 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 AccessDeniedException) 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 AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The requested operation would cause a conflict with the current state of -// a service resource associated with the request. Resolve the conflict before -// retrying this request. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the resource associated with the request. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of the resource associated with the request. - ResourceType *string `locationName:"resourceType" 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 ConflictException) 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 ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // Specifies a unique, case-sensitive identifier that you provide to ensure - // the idempotency of the request. This lets you safely retry the request without - // accidentally performing the same operation a second time. Passing the same - // value to a later call to an operation requires that you also pass the same - // value for all other parameters. We recommend that you use a UUID type of - // value (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The ID of the software set to apply. - DesiredSoftwareSetId *string `locationName:"desiredSoftwareSetId" type:"string"` - - // The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, - // WorkSpaces Web, or AppStream 2.0. - // - // DesktopArn is a required field - DesktopArn *string `locationName:"desktopArn" min:"20" type:"string" required:"true"` - - // The URL for the identity provider login (only for environments that use AppStream - // 2.0). - // - // DesktopEndpoint is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentInput's - // String and GoString methods. - DesktopEndpoint *string `locationName:"desktopEndpoint" min:"1" type:"string" sensitive:"true"` - - // The Amazon Resource Name (ARN) of the Key Management Service key to use to - // encrypt the environment. - KmsKeyArn *string `locationName:"kmsKeyArn" min:"20" type:"string"` - - // A specification for a time window to apply software updates. - MaintenanceWindow *MaintenanceWindow `locationName:"maintenanceWindow" type:"structure"` - - // The name for the environment. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentInput's - // String and GoString methods. - Name *string `locationName:"name" type:"string" sensitive:"true"` - - // An option to define which software updates to apply. - SoftwareSetUpdateMode *string `locationName:"softwareSetUpdateMode" type:"string" enum:"SoftwareSetUpdateMode"` - - // An option to define if software updates should be applied within a maintenance - // window. - SoftwareSetUpdateSchedule *string `locationName:"softwareSetUpdateSchedule" type:"string" enum:"SoftwareSetUpdateSchedule"` - - // A map of the key-value pairs of the tag or tags to assign to the resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateEnvironmentInput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 CreateEnvironmentInput) 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 CreateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEnvironmentInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.DesktopArn == nil { - invalidParams.Add(request.NewErrParamRequired("DesktopArn")) - } - if s.DesktopArn != nil && len(*s.DesktopArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("DesktopArn", 20)) - } - if s.DesktopEndpoint != nil && len(*s.DesktopEndpoint) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DesktopEndpoint", 1)) - } - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 20)) - } - if s.MaintenanceWindow != nil { - if err := s.MaintenanceWindow.Validate(); err != nil { - invalidParams.AddNested("MaintenanceWindow", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateEnvironmentInput) SetClientToken(v string) *CreateEnvironmentInput { - s.ClientToken = &v - return s -} - -// SetDesiredSoftwareSetId sets the DesiredSoftwareSetId field's value. -func (s *CreateEnvironmentInput) SetDesiredSoftwareSetId(v string) *CreateEnvironmentInput { - s.DesiredSoftwareSetId = &v - return s -} - -// SetDesktopArn sets the DesktopArn field's value. -func (s *CreateEnvironmentInput) SetDesktopArn(v string) *CreateEnvironmentInput { - s.DesktopArn = &v - return s -} - -// SetDesktopEndpoint sets the DesktopEndpoint field's value. -func (s *CreateEnvironmentInput) SetDesktopEndpoint(v string) *CreateEnvironmentInput { - s.DesktopEndpoint = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *CreateEnvironmentInput) SetKmsKeyArn(v string) *CreateEnvironmentInput { - s.KmsKeyArn = &v - return s -} - -// SetMaintenanceWindow sets the MaintenanceWindow field's value. -func (s *CreateEnvironmentInput) SetMaintenanceWindow(v *MaintenanceWindow) *CreateEnvironmentInput { - s.MaintenanceWindow = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateEnvironmentInput) SetName(v string) *CreateEnvironmentInput { - s.Name = &v - return s -} - -// SetSoftwareSetUpdateMode sets the SoftwareSetUpdateMode field's value. -func (s *CreateEnvironmentInput) SetSoftwareSetUpdateMode(v string) *CreateEnvironmentInput { - s.SoftwareSetUpdateMode = &v - return s -} - -// SetSoftwareSetUpdateSchedule sets the SoftwareSetUpdateSchedule field's value. -func (s *CreateEnvironmentInput) SetSoftwareSetUpdateSchedule(v string) *CreateEnvironmentInput { - s.SoftwareSetUpdateSchedule = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateEnvironmentInput) SetTags(v map[string]*string) *CreateEnvironmentInput { - s.Tags = v - return s -} - -type CreateEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // Describes an environment. - Environment *EnvironmentSummary `locationName:"environment" 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 CreateEnvironmentOutput) 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 CreateEnvironmentOutput) GoString() string { - return s.String() -} - -// SetEnvironment sets the Environment field's value. -func (s *CreateEnvironmentOutput) SetEnvironment(v *EnvironmentSummary) *CreateEnvironmentOutput { - s.Environment = v - return s -} - -type DeleteDeviceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Specifies a unique, case-sensitive identifier that you provide to ensure - // the idempotency of the request. This lets you safely retry the request without - // accidentally performing the same operation a second time. Passing the same - // value to a later call to an operation requires that you also pass the same - // value for all other parameters. We recommend that you use a UUID type of - // value (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `location:"querystring" locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The ID of the device to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 DeleteDeviceInput) 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 DeleteDeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteDeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteDeviceInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteDeviceInput) SetClientToken(v string) *DeleteDeviceInput { - s.ClientToken = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteDeviceInput) SetId(v string) *DeleteDeviceInput { - s.Id = &v - return s -} - -type DeleteDeviceOutput 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 DeleteDeviceOutput) 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 DeleteDeviceOutput) GoString() string { - return s.String() -} - -type DeleteEnvironmentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // Specifies a unique, case-sensitive identifier that you provide to ensure - // the idempotency of the request. This lets you safely retry the request without - // accidentally performing the same operation a second time. Passing the same - // value to a later call to an operation requires that you also pass the same - // value for all other parameters. We recommend that you use a UUID type of - // value (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `location:"querystring" locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The ID of the environment to delete. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 DeleteEnvironmentInput) 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 DeleteEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEnvironmentInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeleteEnvironmentInput) SetClientToken(v string) *DeleteEnvironmentInput { - s.ClientToken = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteEnvironmentInput) SetId(v string) *DeleteEnvironmentInput { - s.Id = &v - return s -} - -type DeleteEnvironmentOutput 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 DeleteEnvironmentOutput) 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 DeleteEnvironmentOutput) GoString() string { - return s.String() -} - -type DeregisterDeviceInput struct { - _ struct{} `type:"structure"` - - // Specifies a unique, case-sensitive identifier that you provide to ensure - // the idempotency of the request. This lets you safely retry the request without - // accidentally performing the same operation a second time. Passing the same - // value to a later call to an operation requires that you also pass the same - // value for all other parameters. We recommend that you use a UUID type of - // value (https://wikipedia.org/wiki/Universally_unique_identifier). - // - // If you don't provide this value, then Amazon Web Services generates a random - // one for you. - // - // If you retry the operation with the same ClientToken, but with different - // parameters, the retry fails with an IdempotentParameterMismatch error. - ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` - - // The ID of the device to deregister. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The desired new status for the device. - TargetDeviceStatus *string `locationName:"targetDeviceStatus" type:"string" enum:"TargetDeviceStatus"` -} - -// 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 DeregisterDeviceInput) 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 DeregisterDeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterDeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterDeviceInput"} - if s.ClientToken != nil && len(*s.ClientToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientToken sets the ClientToken field's value. -func (s *DeregisterDeviceInput) SetClientToken(v string) *DeregisterDeviceInput { - s.ClientToken = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeregisterDeviceInput) SetId(v string) *DeregisterDeviceInput { - s.Id = &v - return s -} - -// SetTargetDeviceStatus sets the TargetDeviceStatus field's value. -func (s *DeregisterDeviceInput) SetTargetDeviceStatus(v string) *DeregisterDeviceInput { - s.TargetDeviceStatus = &v - return s -} - -type DeregisterDeviceOutput 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 DeregisterDeviceOutput) 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 DeregisterDeviceOutput) GoString() string { - return s.String() -} - -// Describes a thin client device. -type Device struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the device. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The timestamp of when the device was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The ID of the software set currently installed on the device. - CurrentSoftwareSetId *string `locationName:"currentSoftwareSetId" type:"string"` - - // The version of the software set currently installed on the device. - CurrentSoftwareSetVersion *string `locationName:"currentSoftwareSetVersion" type:"string"` - - // The ID of the software set which the device has been set to. - DesiredSoftwareSetId *string `locationName:"desiredSoftwareSetId" type:"string"` - - // The ID of the environment the device is associated with. - EnvironmentId *string `locationName:"environmentId" type:"string"` - - // The ID of the device. - Id *string `locationName:"id" type:"string"` - - // The Amazon Resource Name (ARN) of the Key Management Service key used to - // encrypt the device. - KmsKeyArn *string `locationName:"kmsKeyArn" min:"20" type:"string"` - - // The timestamp of the most recent session on the device. - LastConnectedAt *time.Time `locationName:"lastConnectedAt" type:"timestamp"` - - // The timestamp of the most recent check-in of the device. - LastPostureAt *time.Time `locationName:"lastPostureAt" type:"timestamp"` - - // The model number of the device. - Model *string `locationName:"model" type:"string"` - - // The name of the device. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Device's - // String and GoString methods. - Name *string `locationName:"name" type:"string" sensitive:"true"` - - // The ID of the software set that is pending to be installed on the device. - PendingSoftwareSetId *string `locationName:"pendingSoftwareSetId" type:"string"` - - // The version of the software set that is pending to be installed on the device. - PendingSoftwareSetVersion *string `locationName:"pendingSoftwareSetVersion" type:"string"` - - // The hardware serial number of the device. - SerialNumber *string `locationName:"serialNumber" type:"string"` - - // Describes if the software currently installed on the device is a supported - // version. - SoftwareSetComplianceStatus *string `locationName:"softwareSetComplianceStatus" type:"string" enum:"DeviceSoftwareSetComplianceStatus"` - - // An option to define if software updates should be applied within a maintenance - // window. - SoftwareSetUpdateSchedule *string `locationName:"softwareSetUpdateSchedule" type:"string" enum:"SoftwareSetUpdateSchedule"` - - // Describes if the device has a supported version of software installed. - SoftwareSetUpdateStatus *string `locationName:"softwareSetUpdateStatus" type:"string" enum:"SoftwareSetUpdateStatus"` - - // The status of the device. - Status *string `locationName:"status" type:"string" enum:"DeviceStatus"` - - // The tag keys and optional values for the resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Device's - // String and GoString methods. - Tags *EmbeddedTag `locationName:"tags" type:"structure" sensitive:"true"` - - // The timestamp of when the device was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 Device) 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 Device) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Device) SetArn(v string) *Device { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Device) SetCreatedAt(v time.Time) *Device { - s.CreatedAt = &v - return s -} - -// SetCurrentSoftwareSetId sets the CurrentSoftwareSetId field's value. -func (s *Device) SetCurrentSoftwareSetId(v string) *Device { - s.CurrentSoftwareSetId = &v - return s -} - -// SetCurrentSoftwareSetVersion sets the CurrentSoftwareSetVersion field's value. -func (s *Device) SetCurrentSoftwareSetVersion(v string) *Device { - s.CurrentSoftwareSetVersion = &v - return s -} - -// SetDesiredSoftwareSetId sets the DesiredSoftwareSetId field's value. -func (s *Device) SetDesiredSoftwareSetId(v string) *Device { - s.DesiredSoftwareSetId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *Device) SetEnvironmentId(v string) *Device { - s.EnvironmentId = &v - return s -} - -// SetId sets the Id field's value. -func (s *Device) SetId(v string) *Device { - s.Id = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *Device) SetKmsKeyArn(v string) *Device { - s.KmsKeyArn = &v - return s -} - -// SetLastConnectedAt sets the LastConnectedAt field's value. -func (s *Device) SetLastConnectedAt(v time.Time) *Device { - s.LastConnectedAt = &v - return s -} - -// SetLastPostureAt sets the LastPostureAt field's value. -func (s *Device) SetLastPostureAt(v time.Time) *Device { - s.LastPostureAt = &v - return s -} - -// SetModel sets the Model field's value. -func (s *Device) SetModel(v string) *Device { - s.Model = &v - return s -} - -// SetName sets the Name field's value. -func (s *Device) SetName(v string) *Device { - s.Name = &v - return s -} - -// SetPendingSoftwareSetId sets the PendingSoftwareSetId field's value. -func (s *Device) SetPendingSoftwareSetId(v string) *Device { - s.PendingSoftwareSetId = &v - return s -} - -// SetPendingSoftwareSetVersion sets the PendingSoftwareSetVersion field's value. -func (s *Device) SetPendingSoftwareSetVersion(v string) *Device { - s.PendingSoftwareSetVersion = &v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *Device) SetSerialNumber(v string) *Device { - s.SerialNumber = &v - return s -} - -// SetSoftwareSetComplianceStatus sets the SoftwareSetComplianceStatus field's value. -func (s *Device) SetSoftwareSetComplianceStatus(v string) *Device { - s.SoftwareSetComplianceStatus = &v - return s -} - -// SetSoftwareSetUpdateSchedule sets the SoftwareSetUpdateSchedule field's value. -func (s *Device) SetSoftwareSetUpdateSchedule(v string) *Device { - s.SoftwareSetUpdateSchedule = &v - return s -} - -// SetSoftwareSetUpdateStatus sets the SoftwareSetUpdateStatus field's value. -func (s *Device) SetSoftwareSetUpdateStatus(v string) *Device { - s.SoftwareSetUpdateStatus = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Device) SetStatus(v string) *Device { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Device) SetTags(v *EmbeddedTag) *Device { - s.Tags = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Device) SetUpdatedAt(v time.Time) *Device { - s.UpdatedAt = &v - return s -} - -// Describes a thin client device. -type DeviceSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the device. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The timestamp of when the device was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The ID of the software set currently installed on the device. - CurrentSoftwareSetId *string `locationName:"currentSoftwareSetId" type:"string"` - - // The ID of the software set which the device has been set to. - DesiredSoftwareSetId *string `locationName:"desiredSoftwareSetId" type:"string"` - - // The ID of the environment the device is associated with. - EnvironmentId *string `locationName:"environmentId" type:"string"` - - // The ID of the device. - Id *string `locationName:"id" type:"string"` - - // The timestamp of the most recent session on the device. - LastConnectedAt *time.Time `locationName:"lastConnectedAt" type:"timestamp"` - - // The timestamp of the most recent check-in of the device. - LastPostureAt *time.Time `locationName:"lastPostureAt" type:"timestamp"` - - // The model number of the device. - Model *string `locationName:"model" type:"string"` - - // The name of the device. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DeviceSummary's - // String and GoString methods. - Name *string `locationName:"name" type:"string" sensitive:"true"` - - // The ID of the software set that is pending to be installed on the device. - PendingSoftwareSetId *string `locationName:"pendingSoftwareSetId" type:"string"` - - // The hardware serial number of the device. - SerialNumber *string `locationName:"serialNumber" type:"string"` - - // An option to define if software updates should be applied within a maintenance - // window. - SoftwareSetUpdateSchedule *string `locationName:"softwareSetUpdateSchedule" type:"string" enum:"SoftwareSetUpdateSchedule"` - - // The status of the device. - Status *string `locationName:"status" type:"string" enum:"DeviceStatus"` - - // The tag keys and optional values for the resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DeviceSummary's - // String and GoString methods. - Tags *EmbeddedTag `locationName:"tags" type:"structure" sensitive:"true"` - - // The timestamp of when the device was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 DeviceSummary) 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 DeviceSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DeviceSummary) SetArn(v string) *DeviceSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DeviceSummary) SetCreatedAt(v time.Time) *DeviceSummary { - s.CreatedAt = &v - return s -} - -// SetCurrentSoftwareSetId sets the CurrentSoftwareSetId field's value. -func (s *DeviceSummary) SetCurrentSoftwareSetId(v string) *DeviceSummary { - s.CurrentSoftwareSetId = &v - return s -} - -// SetDesiredSoftwareSetId sets the DesiredSoftwareSetId field's value. -func (s *DeviceSummary) SetDesiredSoftwareSetId(v string) *DeviceSummary { - s.DesiredSoftwareSetId = &v - return s -} - -// SetEnvironmentId sets the EnvironmentId field's value. -func (s *DeviceSummary) SetEnvironmentId(v string) *DeviceSummary { - s.EnvironmentId = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeviceSummary) SetId(v string) *DeviceSummary { - s.Id = &v - return s -} - -// SetLastConnectedAt sets the LastConnectedAt field's value. -func (s *DeviceSummary) SetLastConnectedAt(v time.Time) *DeviceSummary { - s.LastConnectedAt = &v - return s -} - -// SetLastPostureAt sets the LastPostureAt field's value. -func (s *DeviceSummary) SetLastPostureAt(v time.Time) *DeviceSummary { - s.LastPostureAt = &v - return s -} - -// SetModel sets the Model field's value. -func (s *DeviceSummary) SetModel(v string) *DeviceSummary { - s.Model = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeviceSummary) SetName(v string) *DeviceSummary { - s.Name = &v - return s -} - -// SetPendingSoftwareSetId sets the PendingSoftwareSetId field's value. -func (s *DeviceSummary) SetPendingSoftwareSetId(v string) *DeviceSummary { - s.PendingSoftwareSetId = &v - return s -} - -// SetSerialNumber sets the SerialNumber field's value. -func (s *DeviceSummary) SetSerialNumber(v string) *DeviceSummary { - s.SerialNumber = &v - return s -} - -// SetSoftwareSetUpdateSchedule sets the SoftwareSetUpdateSchedule field's value. -func (s *DeviceSummary) SetSoftwareSetUpdateSchedule(v string) *DeviceSummary { - s.SoftwareSetUpdateSchedule = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DeviceSummary) SetStatus(v string) *DeviceSummary { - s.Status = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *DeviceSummary) SetTags(v *EmbeddedTag) *DeviceSummary { - s.Tags = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *DeviceSummary) SetUpdatedAt(v time.Time) *DeviceSummary { - s.UpdatedAt = &v - return s -} - -// The resource and internal ID of a resource to tag. -type EmbeddedTag struct { - _ struct{} `type:"structure" sensitive:"true"` - - // The internal ID of a resource to tag. - InternalId *string `locationName:"internalId" type:"string"` - - // The Amazon Resource Name (ARN) of a resource to tag. - ResourceArn *string `locationName:"resourceArn" 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 EmbeddedTag) 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 EmbeddedTag) GoString() string { - return s.String() -} - -// SetInternalId sets the InternalId field's value. -func (s *EmbeddedTag) SetInternalId(v string) *EmbeddedTag { - s.InternalId = &v - return s -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *EmbeddedTag) SetResourceArn(v string) *EmbeddedTag { - s.ResourceArn = &v - return s -} - -// Describes an environment. -type Environment struct { - _ struct{} `type:"structure"` - - // The activation code to register a device to the environment. - ActivationCode *string `locationName:"activationCode" type:"string"` - - // The Amazon Resource Name (ARN) of the environment. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The timestamp of when the environment was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The ID of the software set to apply. - DesiredSoftwareSetId *string `locationName:"desiredSoftwareSetId" type:"string"` - - // The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, - // WorkSpaces Web, or AppStream 2.0. - DesktopArn *string `locationName:"desktopArn" min:"20" type:"string"` - - // The URL for the identity provider login (only for environments that use AppStream - // 2.0). - // - // DesktopEndpoint is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Environment's - // String and GoString methods. - DesktopEndpoint *string `locationName:"desktopEndpoint" min:"1" type:"string" sensitive:"true"` - - // The type of streaming desktop for the environment. - DesktopType *string `locationName:"desktopType" type:"string" enum:"DesktopType"` - - // The ID of the environment. - Id *string `locationName:"id" type:"string"` - - // The Amazon Resource Name (ARN) of the Key Management Service key used to - // encrypt the environment. - KmsKeyArn *string `locationName:"kmsKeyArn" min:"20" type:"string"` - - // A specification for a time window to apply software updates. - MaintenanceWindow *MaintenanceWindow `locationName:"maintenanceWindow" type:"structure"` - - // The name of the environment. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Environment's - // String and GoString methods. - Name *string `locationName:"name" type:"string" sensitive:"true"` - - // The ID of the software set that is pending to be installed. - PendingSoftwareSetId *string `locationName:"pendingSoftwareSetId" type:"string"` - - // The version of the software set that is pending to be installed. - PendingSoftwareSetVersion *string `locationName:"pendingSoftwareSetVersion" type:"string"` - - // The number of devices registered to the environment. - RegisteredDevicesCount *int64 `locationName:"registeredDevicesCount" type:"integer"` - - // Describes if the software currently installed on all devices in the environment - // is a supported version. - SoftwareSetComplianceStatus *string `locationName:"softwareSetComplianceStatus" type:"string" enum:"EnvironmentSoftwareSetComplianceStatus"` - - // An option to define which software updates to apply. - SoftwareSetUpdateMode *string `locationName:"softwareSetUpdateMode" type:"string" enum:"SoftwareSetUpdateMode"` - - // An option to define if software updates should be applied within a maintenance - // window. - SoftwareSetUpdateSchedule *string `locationName:"softwareSetUpdateSchedule" type:"string" enum:"SoftwareSetUpdateSchedule"` - - // The tag keys and optional values for the resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Environment's - // String and GoString methods. - Tags *EmbeddedTag `locationName:"tags" type:"structure" sensitive:"true"` - - // The timestamp of when the device was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 Environment) 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 Environment) GoString() string { - return s.String() -} - -// SetActivationCode sets the ActivationCode field's value. -func (s *Environment) SetActivationCode(v string) *Environment { - s.ActivationCode = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Environment) SetArn(v string) *Environment { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *Environment) SetCreatedAt(v time.Time) *Environment { - s.CreatedAt = &v - return s -} - -// SetDesiredSoftwareSetId sets the DesiredSoftwareSetId field's value. -func (s *Environment) SetDesiredSoftwareSetId(v string) *Environment { - s.DesiredSoftwareSetId = &v - return s -} - -// SetDesktopArn sets the DesktopArn field's value. -func (s *Environment) SetDesktopArn(v string) *Environment { - s.DesktopArn = &v - return s -} - -// SetDesktopEndpoint sets the DesktopEndpoint field's value. -func (s *Environment) SetDesktopEndpoint(v string) *Environment { - s.DesktopEndpoint = &v - return s -} - -// SetDesktopType sets the DesktopType field's value. -func (s *Environment) SetDesktopType(v string) *Environment { - s.DesktopType = &v - return s -} - -// SetId sets the Id field's value. -func (s *Environment) SetId(v string) *Environment { - s.Id = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *Environment) SetKmsKeyArn(v string) *Environment { - s.KmsKeyArn = &v - return s -} - -// SetMaintenanceWindow sets the MaintenanceWindow field's value. -func (s *Environment) SetMaintenanceWindow(v *MaintenanceWindow) *Environment { - s.MaintenanceWindow = v - return s -} - -// SetName sets the Name field's value. -func (s *Environment) SetName(v string) *Environment { - s.Name = &v - return s -} - -// SetPendingSoftwareSetId sets the PendingSoftwareSetId field's value. -func (s *Environment) SetPendingSoftwareSetId(v string) *Environment { - s.PendingSoftwareSetId = &v - return s -} - -// SetPendingSoftwareSetVersion sets the PendingSoftwareSetVersion field's value. -func (s *Environment) SetPendingSoftwareSetVersion(v string) *Environment { - s.PendingSoftwareSetVersion = &v - return s -} - -// SetRegisteredDevicesCount sets the RegisteredDevicesCount field's value. -func (s *Environment) SetRegisteredDevicesCount(v int64) *Environment { - s.RegisteredDevicesCount = &v - return s -} - -// SetSoftwareSetComplianceStatus sets the SoftwareSetComplianceStatus field's value. -func (s *Environment) SetSoftwareSetComplianceStatus(v string) *Environment { - s.SoftwareSetComplianceStatus = &v - return s -} - -// SetSoftwareSetUpdateMode sets the SoftwareSetUpdateMode field's value. -func (s *Environment) SetSoftwareSetUpdateMode(v string) *Environment { - s.SoftwareSetUpdateMode = &v - return s -} - -// SetSoftwareSetUpdateSchedule sets the SoftwareSetUpdateSchedule field's value. -func (s *Environment) SetSoftwareSetUpdateSchedule(v string) *Environment { - s.SoftwareSetUpdateSchedule = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *Environment) SetTags(v *EmbeddedTag) *Environment { - s.Tags = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *Environment) SetUpdatedAt(v time.Time) *Environment { - s.UpdatedAt = &v - return s -} - -// Describes an environment. -type EnvironmentSummary struct { - _ struct{} `type:"structure"` - - // The activation code to register a device to the environment. - ActivationCode *string `locationName:"activationCode" type:"string"` - - // The Amazon Resource Name (ARN) of the environment. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The timestamp of when the environment was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - - // The ID of the software set to apply. - DesiredSoftwareSetId *string `locationName:"desiredSoftwareSetId" type:"string"` - - // The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, - // WorkSpaces Web, or AppStream 2.0. - DesktopArn *string `locationName:"desktopArn" min:"20" type:"string"` - - // The URL for the identity provider login (only for environments that use AppStream - // 2.0). - // - // DesktopEndpoint is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EnvironmentSummary's - // String and GoString methods. - DesktopEndpoint *string `locationName:"desktopEndpoint" min:"1" type:"string" sensitive:"true"` - - // The type of streaming desktop for the environment. - DesktopType *string `locationName:"desktopType" type:"string" enum:"DesktopType"` - - // The ID of the environment. - Id *string `locationName:"id" type:"string"` - - // A specification for a time window to apply software updates. - MaintenanceWindow *MaintenanceWindow `locationName:"maintenanceWindow" type:"structure"` - - // The name of the environment. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EnvironmentSummary's - // String and GoString methods. - Name *string `locationName:"name" type:"string" sensitive:"true"` - - // The ID of the software set that is pending to be installed. - PendingSoftwareSetId *string `locationName:"pendingSoftwareSetId" type:"string"` - - // An option to define which software updates to apply. - SoftwareSetUpdateMode *string `locationName:"softwareSetUpdateMode" type:"string" enum:"SoftwareSetUpdateMode"` - - // An option to define if software updates should be applied within a maintenance - // window. - SoftwareSetUpdateSchedule *string `locationName:"softwareSetUpdateSchedule" type:"string" enum:"SoftwareSetUpdateSchedule"` - - // The tag keys and optional values for the resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by EnvironmentSummary's - // String and GoString methods. - Tags *EmbeddedTag `locationName:"tags" type:"structure" sensitive:"true"` - - // The timestamp of when the device was updated. - UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp"` -} - -// 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 EnvironmentSummary) 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 EnvironmentSummary) GoString() string { - return s.String() -} - -// SetActivationCode sets the ActivationCode field's value. -func (s *EnvironmentSummary) SetActivationCode(v string) *EnvironmentSummary { - s.ActivationCode = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *EnvironmentSummary) SetArn(v string) *EnvironmentSummary { - s.Arn = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *EnvironmentSummary) SetCreatedAt(v time.Time) *EnvironmentSummary { - s.CreatedAt = &v - return s -} - -// SetDesiredSoftwareSetId sets the DesiredSoftwareSetId field's value. -func (s *EnvironmentSummary) SetDesiredSoftwareSetId(v string) *EnvironmentSummary { - s.DesiredSoftwareSetId = &v - return s -} - -// SetDesktopArn sets the DesktopArn field's value. -func (s *EnvironmentSummary) SetDesktopArn(v string) *EnvironmentSummary { - s.DesktopArn = &v - return s -} - -// SetDesktopEndpoint sets the DesktopEndpoint field's value. -func (s *EnvironmentSummary) SetDesktopEndpoint(v string) *EnvironmentSummary { - s.DesktopEndpoint = &v - return s -} - -// SetDesktopType sets the DesktopType field's value. -func (s *EnvironmentSummary) SetDesktopType(v string) *EnvironmentSummary { - s.DesktopType = &v - return s -} - -// SetId sets the Id field's value. -func (s *EnvironmentSummary) SetId(v string) *EnvironmentSummary { - s.Id = &v - return s -} - -// SetMaintenanceWindow sets the MaintenanceWindow field's value. -func (s *EnvironmentSummary) SetMaintenanceWindow(v *MaintenanceWindow) *EnvironmentSummary { - s.MaintenanceWindow = v - return s -} - -// SetName sets the Name field's value. -func (s *EnvironmentSummary) SetName(v string) *EnvironmentSummary { - s.Name = &v - return s -} - -// SetPendingSoftwareSetId sets the PendingSoftwareSetId field's value. -func (s *EnvironmentSummary) SetPendingSoftwareSetId(v string) *EnvironmentSummary { - s.PendingSoftwareSetId = &v - return s -} - -// SetSoftwareSetUpdateMode sets the SoftwareSetUpdateMode field's value. -func (s *EnvironmentSummary) SetSoftwareSetUpdateMode(v string) *EnvironmentSummary { - s.SoftwareSetUpdateMode = &v - return s -} - -// SetSoftwareSetUpdateSchedule sets the SoftwareSetUpdateSchedule field's value. -func (s *EnvironmentSummary) SetSoftwareSetUpdateSchedule(v string) *EnvironmentSummary { - s.SoftwareSetUpdateSchedule = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *EnvironmentSummary) SetTags(v *EmbeddedTag) *EnvironmentSummary { - s.Tags = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *EnvironmentSummary) SetUpdatedAt(v time.Time) *EnvironmentSummary { - s.UpdatedAt = &v - return s -} - -type GetDeviceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the device for which to return information. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 GetDeviceInput) 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 GetDeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetDeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDeviceInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetDeviceInput) SetId(v string) *GetDeviceInput { - s.Id = &v - return s -} - -type GetDeviceOutput struct { - _ struct{} `type:"structure"` - - // Describes an device. - Device *Device `locationName:"device" 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 GetDeviceOutput) 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 GetDeviceOutput) GoString() string { - return s.String() -} - -// SetDevice sets the Device field's value. -func (s *GetDeviceOutput) SetDevice(v *Device) *GetDeviceOutput { - s.Device = v - return s -} - -type GetEnvironmentInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the environment for which to return information. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 GetEnvironmentInput) 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 GetEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEnvironmentInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetEnvironmentInput) SetId(v string) *GetEnvironmentInput { - s.Id = &v - return s -} - -type GetEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // Describes an environment. - Environment *Environment `locationName:"environment" 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 GetEnvironmentOutput) 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 GetEnvironmentOutput) GoString() string { - return s.String() -} - -// SetEnvironment sets the Environment field's value. -func (s *GetEnvironmentOutput) SetEnvironment(v *Environment) *GetEnvironmentOutput { - s.Environment = v - return s -} - -type GetSoftwareSetInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The ID of the software set for which to return information. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" 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 GetSoftwareSetInput) 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 GetSoftwareSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSoftwareSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSoftwareSetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *GetSoftwareSetInput) SetId(v string) *GetSoftwareSetInput { - s.Id = &v - return s -} - -type GetSoftwareSetOutput struct { - _ struct{} `type:"structure"` - - // Describes a software set. - SoftwareSet *SoftwareSet `locationName:"softwareSet" 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 GetSoftwareSetOutput) 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 GetSoftwareSetOutput) GoString() string { - return s.String() -} - -// SetSoftwareSet sets the SoftwareSet field's value. -func (s *GetSoftwareSetOutput) SetSoftwareSet(v *SoftwareSet) *GetSoftwareSetOutput { - s.SoftwareSet = v - return s -} - -// The server encountered an internal error and is unable to complete the request. -type InternalServerException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The number of seconds to wait before retrying the next request. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServerException) 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 InternalServerException) GoString() string { - return s.String() -} - -func newErrorInternalServerException(v protocol.ResponseMetadata) error { - return &InternalServerException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServerException) Code() string { - return "InternalServerException" -} - -// Message returns the exception's message. -func (s *InternalServerException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServerException) OrigErr() error { - return nil -} - -func (s *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServerException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServerException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Request processing failed due to some unknown error, exception, or failure. -type InternalServiceException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The number of seconds to wait before retrying the next request. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" 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 InternalServiceException) 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 InternalServiceException) GoString() string { - return s.String() -} - -func newErrorInternalServiceException(v protocol.ResponseMetadata) error { - return &InternalServiceException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServiceException) Code() string { - return "InternalServiceException" -} - -// Message returns the exception's message. -func (s *InternalServiceException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServiceException) OrigErr() error { - return nil -} - -func (s *InternalServiceException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServiceException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServiceException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListDevicesInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that are returned per call. You can use nextToken - // to obtain further pages of results. - // - // This is only an upper limit. The actual number of results returned per call - // might be fewer than the specified maximum. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListDevicesInput) 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 ListDevicesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDevicesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDevicesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDevicesInput) SetMaxResults(v int64) *ListDevicesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDevicesInput) SetNextToken(v string) *ListDevicesInput { - s.NextToken = &v - return s -} - -type ListDevicesOutput struct { - _ struct{} `type:"structure"` - - // Describes devices. - Devices []*DeviceSummary `locationName:"devices" type:"list"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" 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 ListDevicesOutput) 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 ListDevicesOutput) GoString() string { - return s.String() -} - -// SetDevices sets the Devices field's value. -func (s *ListDevicesOutput) SetDevices(v []*DeviceSummary) *ListDevicesOutput { - s.Devices = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDevicesOutput) SetNextToken(v string) *ListDevicesOutput { - s.NextToken = &v - return s -} - -type ListEnvironmentsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that are returned per call. You can use nextToken - // to obtain further pages of results. - // - // This is only an upper limit. The actual number of results returned per call - // might be fewer than the specified maximum. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListEnvironmentsInput) 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 ListEnvironmentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEnvironmentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEnvironmentsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEnvironmentsInput) SetMaxResults(v int64) *ListEnvironmentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentsInput) SetNextToken(v string) *ListEnvironmentsInput { - s.NextToken = &v - return s -} - -type ListEnvironmentsOutput struct { - _ struct{} `type:"structure"` - - // Describes environments. - Environments []*EnvironmentSummary `locationName:"environments" type:"list"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" 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 ListEnvironmentsOutput) 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 ListEnvironmentsOutput) GoString() string { - return s.String() -} - -// SetEnvironments sets the Environments field's value. -func (s *ListEnvironmentsOutput) SetEnvironments(v []*EnvironmentSummary) *ListEnvironmentsOutput { - s.Environments = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEnvironmentsOutput) SetNextToken(v string) *ListEnvironmentsOutput { - s.NextToken = &v - return s -} - -type ListSoftwareSetsInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The maximum number of results that are returned per call. You can use nextToken - // to obtain further pages of results. - // - // This is only an upper limit. The actual number of results returned per call - // might be fewer than the specified maximum. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `location:"querystring" locationName:"nextToken" 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 ListSoftwareSetsInput) 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 ListSoftwareSetsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListSoftwareSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSoftwareSetsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListSoftwareSetsInput) SetMaxResults(v int64) *ListSoftwareSetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSoftwareSetsInput) SetNextToken(v string) *ListSoftwareSetsInput { - s.NextToken = &v - return s -} - -type ListSoftwareSetsOutput struct { - _ struct{} `type:"structure"` - - // If nextToken is returned, there are more results available. The value of - // nextToken is a unique pagination token for each page. Make the call again - // using the returned token to retrieve the next page. Keep all other arguments - // unchanged. Each pagination token expires after 24 hours. Using an expired - // pagination token will return an HTTP 400 InvalidToken error. - NextToken *string `locationName:"nextToken" type:"string"` - - // Describes software sets. - SoftwareSets []*SoftwareSetSummary `locationName:"softwareSets" type:"list"` -} - -// 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 ListSoftwareSetsOutput) 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 ListSoftwareSetsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListSoftwareSetsOutput) SetNextToken(v string) *ListSoftwareSetsOutput { - s.NextToken = &v - return s -} - -// SetSoftwareSets sets the SoftwareSets field's value. -func (s *ListSoftwareSetsOutput) SetSoftwareSets(v []*SoftwareSetSummary) *ListSoftwareSetsOutput { - s.SoftwareSets = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource for which you want to retrieve - // tags. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" 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 ListTagsForResourceInput) 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 ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // A map of the key-value pairs for the tag or tags assigned to the specified - // resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListTagsForResourceOutput's - // String and GoString methods. - Tags map[string]*string `locationName:"tags" type:"map" sensitive:"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 ListTagsForResourceOutput) 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 ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -// Describes the maintenance window for a thin client device. -type MaintenanceWindow struct { - _ struct{} `type:"structure"` - - // The option to set the maintenance window during the device local time or - // Universal Coordinated Time (UTC). - ApplyTimeOf *string `locationName:"applyTimeOf" type:"string" enum:"ApplyTimeOf"` - - // The days of the week during which the maintenance window is open. - DaysOfTheWeek []*string `locationName:"daysOfTheWeek" min:"1" type:"list" enum:"DayOfWeek"` - - // The hour for the maintenance window end (00-23). - EndTimeHour *int64 `locationName:"endTimeHour" type:"integer"` - - // The minutes for the maintenance window end (00-59). - EndTimeMinute *int64 `locationName:"endTimeMinute" type:"integer"` - - // The hour for the maintenance window start (00-23). - StartTimeHour *int64 `locationName:"startTimeHour" type:"integer"` - - // The minutes past the hour for the maintenance window start (00-59). - StartTimeMinute *int64 `locationName:"startTimeMinute" type:"integer"` - - // An option to select the default or custom maintenance window. - Type *string `locationName:"type" type:"string" enum:"MaintenanceWindowType"` -} - -// 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 MaintenanceWindow) 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 MaintenanceWindow) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MaintenanceWindow) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MaintenanceWindow"} - if s.DaysOfTheWeek != nil && len(s.DaysOfTheWeek) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DaysOfTheWeek", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyTimeOf sets the ApplyTimeOf field's value. -func (s *MaintenanceWindow) SetApplyTimeOf(v string) *MaintenanceWindow { - s.ApplyTimeOf = &v - return s -} - -// SetDaysOfTheWeek sets the DaysOfTheWeek field's value. -func (s *MaintenanceWindow) SetDaysOfTheWeek(v []*string) *MaintenanceWindow { - s.DaysOfTheWeek = v - return s -} - -// SetEndTimeHour sets the EndTimeHour field's value. -func (s *MaintenanceWindow) SetEndTimeHour(v int64) *MaintenanceWindow { - s.EndTimeHour = &v - return s -} - -// SetEndTimeMinute sets the EndTimeMinute field's value. -func (s *MaintenanceWindow) SetEndTimeMinute(v int64) *MaintenanceWindow { - s.EndTimeMinute = &v - return s -} - -// SetStartTimeHour sets the StartTimeHour field's value. -func (s *MaintenanceWindow) SetStartTimeHour(v int64) *MaintenanceWindow { - s.StartTimeHour = &v - return s -} - -// SetStartTimeMinute sets the StartTimeMinute field's value. -func (s *MaintenanceWindow) SetStartTimeMinute(v int64) *MaintenanceWindow { - s.StartTimeMinute = &v - return s -} - -// SetType sets the Type field's value. -func (s *MaintenanceWindow) SetType(v string) *MaintenanceWindow { - s.Type = &v - return s -} - -// The resource specified in the request was not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The ID of the resource associated with the request. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of the resource associated with the request. - ResourceType *string `locationName:"resourceType" 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 ResourceNotFoundException) 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 ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Your request exceeds a service quota. -type ServiceQuotaExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The code for the quota in Service Quotas (https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html). - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The ID of the resource that exceeds the service quota. - ResourceId *string `locationName:"resourceId" type:"string"` - - // The type of the resource that exceeds the service quota. - ResourceType *string `locationName:"resourceType" type:"string"` - - // The code for the service in Service Quotas (https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html). - ServiceCode *string `locationName:"serviceCode" 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 ServiceQuotaExceededException) 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 ServiceQuotaExceededException) GoString() string { - return s.String() -} - -func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { - return &ServiceQuotaExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceQuotaExceededException) Code() string { - return "ServiceQuotaExceededException" -} - -// Message returns the exception's message. -func (s *ServiceQuotaExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceQuotaExceededException) OrigErr() error { - return nil -} - -func (s *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceQuotaExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceQuotaExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Describes software. -type Software struct { - _ struct{} `type:"structure"` - - // The name of the software component. - Name *string `locationName:"name" type:"string"` - - // The version of the software component. - Version *string `locationName:"version" 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 Software) 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 Software) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *Software) SetName(v string) *Software { - s.Name = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *Software) SetVersion(v string) *Software { - s.Version = &v - return s -} - -// Describes a software set. -type SoftwareSet struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the software set. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the software set. - Id *string `locationName:"id" type:"string"` - - // The timestamp of when the software set was released. - ReleasedAt *time.Time `locationName:"releasedAt" type:"timestamp"` - - // A list of the software components in the software set. - Software []*Software `locationName:"software" type:"list"` - - // The timestamp of the end of support for the software set. - SupportedUntil *time.Time `locationName:"supportedUntil" type:"timestamp"` - - // An option to define if the software set has been validated. - ValidationStatus *string `locationName:"validationStatus" type:"string" enum:"SoftwareSetValidationStatus"` - - // The version of the software set. - Version *string `locationName:"version" 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 SoftwareSet) 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 SoftwareSet) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *SoftwareSet) SetArn(v string) *SoftwareSet { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *SoftwareSet) SetId(v string) *SoftwareSet { - s.Id = &v - return s -} - -// SetReleasedAt sets the ReleasedAt field's value. -func (s *SoftwareSet) SetReleasedAt(v time.Time) *SoftwareSet { - s.ReleasedAt = &v - return s -} - -// SetSoftware sets the Software field's value. -func (s *SoftwareSet) SetSoftware(v []*Software) *SoftwareSet { - s.Software = v - return s -} - -// SetSupportedUntil sets the SupportedUntil field's value. -func (s *SoftwareSet) SetSupportedUntil(v time.Time) *SoftwareSet { - s.SupportedUntil = &v - return s -} - -// SetValidationStatus sets the ValidationStatus field's value. -func (s *SoftwareSet) SetValidationStatus(v string) *SoftwareSet { - s.ValidationStatus = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *SoftwareSet) SetVersion(v string) *SoftwareSet { - s.Version = &v - return s -} - -// Describes a software set. -type SoftwareSetSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the software set. - Arn *string `locationName:"arn" min:"20" type:"string"` - - // The ID of the software set. - Id *string `locationName:"id" type:"string"` - - // The timestamp of when the software set was released. - ReleasedAt *time.Time `locationName:"releasedAt" type:"timestamp"` - - // The timestamp of the end of support for the software set. - SupportedUntil *time.Time `locationName:"supportedUntil" type:"timestamp"` - - // An option to define if the software set has been validated. - ValidationStatus *string `locationName:"validationStatus" type:"string" enum:"SoftwareSetValidationStatus"` - - // The version of the software set. - Version *string `locationName:"version" 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 SoftwareSetSummary) 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 SoftwareSetSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *SoftwareSetSummary) SetArn(v string) *SoftwareSetSummary { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *SoftwareSetSummary) SetId(v string) *SoftwareSetSummary { - s.Id = &v - return s -} - -// SetReleasedAt sets the ReleasedAt field's value. -func (s *SoftwareSetSummary) SetReleasedAt(v time.Time) *SoftwareSetSummary { - s.ReleasedAt = &v - return s -} - -// SetSupportedUntil sets the SupportedUntil field's value. -func (s *SoftwareSetSummary) SetSupportedUntil(v time.Time) *SoftwareSetSummary { - s.SupportedUntil = &v - return s -} - -// SetValidationStatus sets the ValidationStatus field's value. -func (s *SoftwareSetSummary) SetValidationStatus(v string) *SoftwareSetSummary { - s.ValidationStatus = &v - return s -} - -// SetVersion sets the Version field's value. -func (s *SoftwareSetSummary) SetVersion(v string) *SoftwareSetSummary { - s.Version = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource that you want to tag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // A map of the key-value pairs of the tag or tags to assign to the resource. - // - // Tags is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by TagResourceInput's - // String and GoString methods. - // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true" sensitive:"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 TagResourceInput) 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 TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput 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 TagResourceOutput) 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 TagResourceOutput) GoString() string { - return s.String() -} - -// The request was denied due to request throttling. -type ThrottlingException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` - - // The code for the quota in Service Quotas (https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html). - QuotaCode *string `locationName:"quotaCode" type:"string"` - - // The number of seconds to wait before retrying the next request. - RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` - - // The code for the service in Service Quotas (https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html). - ServiceCode *string `locationName:"serviceCode" 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 ThrottlingException) 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 ThrottlingException) GoString() string { - return s.String() -} - -func newErrorThrottlingException(v protocol.ResponseMetadata) error { - return &ThrottlingException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottlingException) Code() string { - return "ThrottlingException" -} - -// Message returns the exception's message. -func (s *ThrottlingException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottlingException) OrigErr() error { - return nil -} - -func (s *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottlingException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottlingException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure" nopayload:"true"` - - // The Amazon Resource Name (ARN) of the resource that you want to untag. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - - // The keys of the key-value pairs for the tag or tags you want to remove from - // the specified resource. - // - // TagKeys is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UntagResourceInput's - // String and GoString methods. - // - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" required:"true" sensitive:"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 UntagResourceInput) 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 UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput 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 UntagResourceOutput) 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 UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateDeviceInput struct { - _ struct{} `type:"structure"` - - // The ID of the software set to apply. - DesiredSoftwareSetId *string `locationName:"desiredSoftwareSetId" type:"string"` - - // The ID of the device to update. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Key Management Service key to use for - // the update. - KmsKeyArn *string `locationName:"kmsKeyArn" min:"20" type:"string"` - - // The name of the device to update. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateDeviceInput's - // String and GoString methods. - Name *string `locationName:"name" type:"string" sensitive:"true"` - - // An option to define if software updates should be applied within a maintenance - // window. - SoftwareSetUpdateSchedule *string `locationName:"softwareSetUpdateSchedule" type:"string" enum:"SoftwareSetUpdateSchedule"` -} - -// 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 UpdateDeviceInput) 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 UpdateDeviceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateDeviceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateDeviceInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDesiredSoftwareSetId sets the DesiredSoftwareSetId field's value. -func (s *UpdateDeviceInput) SetDesiredSoftwareSetId(v string) *UpdateDeviceInput { - s.DesiredSoftwareSetId = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateDeviceInput) SetId(v string) *UpdateDeviceInput { - s.Id = &v - return s -} - -// SetKmsKeyArn sets the KmsKeyArn field's value. -func (s *UpdateDeviceInput) SetKmsKeyArn(v string) *UpdateDeviceInput { - s.KmsKeyArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateDeviceInput) SetName(v string) *UpdateDeviceInput { - s.Name = &v - return s -} - -// SetSoftwareSetUpdateSchedule sets the SoftwareSetUpdateSchedule field's value. -func (s *UpdateDeviceInput) SetSoftwareSetUpdateSchedule(v string) *UpdateDeviceInput { - s.SoftwareSetUpdateSchedule = &v - return s -} - -type UpdateDeviceOutput struct { - _ struct{} `type:"structure"` - - // Describes a device. - Device *DeviceSummary `locationName:"device" 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 UpdateDeviceOutput) 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 UpdateDeviceOutput) GoString() string { - return s.String() -} - -// SetDevice sets the Device field's value. -func (s *UpdateDeviceOutput) SetDevice(v *DeviceSummary) *UpdateDeviceOutput { - s.Device = v - return s -} - -type UpdateEnvironmentInput struct { - _ struct{} `type:"structure"` - - // The ID of the software set to apply. - DesiredSoftwareSetId *string `locationName:"desiredSoftwareSetId" type:"string"` - - // The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, - // WorkSpaces Web, or AppStream 2.0. - DesktopArn *string `locationName:"desktopArn" min:"20" type:"string"` - - // The URL for the identity provider login (only for environments that use AppStream - // 2.0). - // - // DesktopEndpoint is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateEnvironmentInput's - // String and GoString methods. - DesktopEndpoint *string `locationName:"desktopEndpoint" min:"1" type:"string" sensitive:"true"` - - // The ID of the environment to update. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // A specification for a time window to apply software updates. - MaintenanceWindow *MaintenanceWindow `locationName:"maintenanceWindow" type:"structure"` - - // The name of the environment to update. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UpdateEnvironmentInput's - // String and GoString methods. - Name *string `locationName:"name" type:"string" sensitive:"true"` - - // An option to define which software updates to apply. - SoftwareSetUpdateMode *string `locationName:"softwareSetUpdateMode" type:"string" enum:"SoftwareSetUpdateMode"` - - // An option to define if software updates should be applied within a maintenance - // window. - SoftwareSetUpdateSchedule *string `locationName:"softwareSetUpdateSchedule" type:"string" enum:"SoftwareSetUpdateSchedule"` -} - -// 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 UpdateEnvironmentInput) 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 UpdateEnvironmentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEnvironmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEnvironmentInput"} - if s.DesktopArn != nil && len(*s.DesktopArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("DesktopArn", 20)) - } - if s.DesktopEndpoint != nil && len(*s.DesktopEndpoint) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DesktopEndpoint", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.MaintenanceWindow != nil { - if err := s.MaintenanceWindow.Validate(); err != nil { - invalidParams.AddNested("MaintenanceWindow", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDesiredSoftwareSetId sets the DesiredSoftwareSetId field's value. -func (s *UpdateEnvironmentInput) SetDesiredSoftwareSetId(v string) *UpdateEnvironmentInput { - s.DesiredSoftwareSetId = &v - return s -} - -// SetDesktopArn sets the DesktopArn field's value. -func (s *UpdateEnvironmentInput) SetDesktopArn(v string) *UpdateEnvironmentInput { - s.DesktopArn = &v - return s -} - -// SetDesktopEndpoint sets the DesktopEndpoint field's value. -func (s *UpdateEnvironmentInput) SetDesktopEndpoint(v string) *UpdateEnvironmentInput { - s.DesktopEndpoint = &v - return s -} - -// SetId sets the Id field's value. -func (s *UpdateEnvironmentInput) SetId(v string) *UpdateEnvironmentInput { - s.Id = &v - return s -} - -// SetMaintenanceWindow sets the MaintenanceWindow field's value. -func (s *UpdateEnvironmentInput) SetMaintenanceWindow(v *MaintenanceWindow) *UpdateEnvironmentInput { - s.MaintenanceWindow = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateEnvironmentInput) SetName(v string) *UpdateEnvironmentInput { - s.Name = &v - return s -} - -// SetSoftwareSetUpdateMode sets the SoftwareSetUpdateMode field's value. -func (s *UpdateEnvironmentInput) SetSoftwareSetUpdateMode(v string) *UpdateEnvironmentInput { - s.SoftwareSetUpdateMode = &v - return s -} - -// SetSoftwareSetUpdateSchedule sets the SoftwareSetUpdateSchedule field's value. -func (s *UpdateEnvironmentInput) SetSoftwareSetUpdateSchedule(v string) *UpdateEnvironmentInput { - s.SoftwareSetUpdateSchedule = &v - return s -} - -type UpdateEnvironmentOutput struct { - _ struct{} `type:"structure"` - - // Describes an environment. - Environment *EnvironmentSummary `locationName:"environment" 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 UpdateEnvironmentOutput) 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 UpdateEnvironmentOutput) GoString() string { - return s.String() -} - -// SetEnvironment sets the Environment field's value. -func (s *UpdateEnvironmentOutput) SetEnvironment(v *EnvironmentSummary) *UpdateEnvironmentOutput { - s.Environment = v - return s -} - -type UpdateSoftwareSetInput struct { - _ struct{} `type:"structure"` - - // The ID of the software set to update. - // - // Id is a required field - Id *string `location:"uri" locationName:"id" type:"string" required:"true"` - - // An option to define if the software set has been validated. - // - // ValidationStatus is a required field - ValidationStatus *string `locationName:"validationStatus" type:"string" required:"true" enum:"SoftwareSetValidationStatus"` -} - -// 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 UpdateSoftwareSetInput) 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 UpdateSoftwareSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateSoftwareSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateSoftwareSetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.ValidationStatus == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationStatus")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *UpdateSoftwareSetInput) SetId(v string) *UpdateSoftwareSetInput { - s.Id = &v - return s -} - -// SetValidationStatus sets the ValidationStatus field's value. -func (s *UpdateSoftwareSetInput) SetValidationStatus(v string) *UpdateSoftwareSetInput { - s.ValidationStatus = &v - return s -} - -type UpdateSoftwareSetOutput 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 UpdateSoftwareSetOutput) 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 UpdateSoftwareSetOutput) GoString() string { - return s.String() -} - -// The input fails to satisfy the specified constraints. -type ValidationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - // A list of fields that didn't validate. - FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` - - Message_ *string `locationName:"message" type:"string"` - - // The reason for the exception. - Reason *string `locationName:"reason" type:"string" enum:"ValidationExceptionReason"` -} - -// 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 ValidationException) 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 ValidationException) GoString() string { - return s.String() -} - -func newErrorValidationException(v protocol.ResponseMetadata) error { - return &ValidationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ValidationException) Code() string { - return "ValidationException" -} - -// Message returns the exception's message. -func (s *ValidationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ValidationException) OrigErr() error { - return nil -} - -func (s *ValidationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ValidationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ValidationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Describes a validation exception. -type ValidationExceptionField struct { - _ struct{} `type:"structure"` - - // A message that describes the reason for the exception. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` - - // The name of the exception. - // - // Name is a required field - Name *string `locationName:"name" 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 ValidationExceptionField) 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 ValidationExceptionField) GoString() string { - return s.String() -} - -// SetMessage sets the Message field's value. -func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { - s.Message = &v - return s -} - -// SetName sets the Name field's value. -func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { - s.Name = &v - return s -} - -const ( - // ApplyTimeOfUtc is a ApplyTimeOf enum value - ApplyTimeOfUtc = "UTC" - - // ApplyTimeOfDevice is a ApplyTimeOf enum value - ApplyTimeOfDevice = "DEVICE" -) - -// ApplyTimeOf_Values returns all elements of the ApplyTimeOf enum -func ApplyTimeOf_Values() []string { - return []string{ - ApplyTimeOfUtc, - ApplyTimeOfDevice, - } -} - -const ( - // DayOfWeekMonday is a DayOfWeek enum value - DayOfWeekMonday = "MONDAY" - - // DayOfWeekTuesday is a DayOfWeek enum value - DayOfWeekTuesday = "TUESDAY" - - // DayOfWeekWednesday is a DayOfWeek enum value - DayOfWeekWednesday = "WEDNESDAY" - - // DayOfWeekThursday is a DayOfWeek enum value - DayOfWeekThursday = "THURSDAY" - - // DayOfWeekFriday is a DayOfWeek enum value - DayOfWeekFriday = "FRIDAY" - - // DayOfWeekSaturday is a DayOfWeek enum value - DayOfWeekSaturday = "SATURDAY" - - // DayOfWeekSunday is a DayOfWeek enum value - DayOfWeekSunday = "SUNDAY" -) - -// DayOfWeek_Values returns all elements of the DayOfWeek enum -func DayOfWeek_Values() []string { - return []string{ - DayOfWeekMonday, - DayOfWeekTuesday, - DayOfWeekWednesday, - DayOfWeekThursday, - DayOfWeekFriday, - DayOfWeekSaturday, - DayOfWeekSunday, - } -} - -const ( - // DesktopTypeWorkspaces is a DesktopType enum value - DesktopTypeWorkspaces = "workspaces" - - // DesktopTypeAppstream is a DesktopType enum value - DesktopTypeAppstream = "appstream" - - // DesktopTypeWorkspacesWeb is a DesktopType enum value - DesktopTypeWorkspacesWeb = "workspaces-web" -) - -// DesktopType_Values returns all elements of the DesktopType enum -func DesktopType_Values() []string { - return []string{ - DesktopTypeWorkspaces, - DesktopTypeAppstream, - DesktopTypeWorkspacesWeb, - } -} - -const ( - // DeviceSoftwareSetComplianceStatusNone is a DeviceSoftwareSetComplianceStatus enum value - DeviceSoftwareSetComplianceStatusNone = "NONE" - - // DeviceSoftwareSetComplianceStatusCompliant is a DeviceSoftwareSetComplianceStatus enum value - DeviceSoftwareSetComplianceStatusCompliant = "COMPLIANT" - - // DeviceSoftwareSetComplianceStatusNotCompliant is a DeviceSoftwareSetComplianceStatus enum value - DeviceSoftwareSetComplianceStatusNotCompliant = "NOT_COMPLIANT" -) - -// DeviceSoftwareSetComplianceStatus_Values returns all elements of the DeviceSoftwareSetComplianceStatus enum -func DeviceSoftwareSetComplianceStatus_Values() []string { - return []string{ - DeviceSoftwareSetComplianceStatusNone, - DeviceSoftwareSetComplianceStatusCompliant, - DeviceSoftwareSetComplianceStatusNotCompliant, - } -} - -const ( - // DeviceStatusRegistered is a DeviceStatus enum value - DeviceStatusRegistered = "REGISTERED" - - // DeviceStatusDeregistering is a DeviceStatus enum value - DeviceStatusDeregistering = "DEREGISTERING" - - // DeviceStatusDeregistered is a DeviceStatus enum value - DeviceStatusDeregistered = "DEREGISTERED" - - // DeviceStatusArchived is a DeviceStatus enum value - DeviceStatusArchived = "ARCHIVED" -) - -// DeviceStatus_Values returns all elements of the DeviceStatus enum -func DeviceStatus_Values() []string { - return []string{ - DeviceStatusRegistered, - DeviceStatusDeregistering, - DeviceStatusDeregistered, - DeviceStatusArchived, - } -} - -const ( - // EnvironmentSoftwareSetComplianceStatusNoRegisteredDevices is a EnvironmentSoftwareSetComplianceStatus enum value - EnvironmentSoftwareSetComplianceStatusNoRegisteredDevices = "NO_REGISTERED_DEVICES" - - // EnvironmentSoftwareSetComplianceStatusCompliant is a EnvironmentSoftwareSetComplianceStatus enum value - EnvironmentSoftwareSetComplianceStatusCompliant = "COMPLIANT" - - // EnvironmentSoftwareSetComplianceStatusNotCompliant is a EnvironmentSoftwareSetComplianceStatus enum value - EnvironmentSoftwareSetComplianceStatusNotCompliant = "NOT_COMPLIANT" -) - -// EnvironmentSoftwareSetComplianceStatus_Values returns all elements of the EnvironmentSoftwareSetComplianceStatus enum -func EnvironmentSoftwareSetComplianceStatus_Values() []string { - return []string{ - EnvironmentSoftwareSetComplianceStatusNoRegisteredDevices, - EnvironmentSoftwareSetComplianceStatusCompliant, - EnvironmentSoftwareSetComplianceStatusNotCompliant, - } -} - -const ( - // MaintenanceWindowTypeSystem is a MaintenanceWindowType enum value - MaintenanceWindowTypeSystem = "SYSTEM" - - // MaintenanceWindowTypeCustom is a MaintenanceWindowType enum value - MaintenanceWindowTypeCustom = "CUSTOM" -) - -// MaintenanceWindowType_Values returns all elements of the MaintenanceWindowType enum -func MaintenanceWindowType_Values() []string { - return []string{ - MaintenanceWindowTypeSystem, - MaintenanceWindowTypeCustom, - } -} - -const ( - // SoftwareSetUpdateModeUseLatest is a SoftwareSetUpdateMode enum value - SoftwareSetUpdateModeUseLatest = "USE_LATEST" - - // SoftwareSetUpdateModeUseDesired is a SoftwareSetUpdateMode enum value - SoftwareSetUpdateModeUseDesired = "USE_DESIRED" -) - -// SoftwareSetUpdateMode_Values returns all elements of the SoftwareSetUpdateMode enum -func SoftwareSetUpdateMode_Values() []string { - return []string{ - SoftwareSetUpdateModeUseLatest, - SoftwareSetUpdateModeUseDesired, - } -} - -const ( - // SoftwareSetUpdateScheduleUseMaintenanceWindow is a SoftwareSetUpdateSchedule enum value - SoftwareSetUpdateScheduleUseMaintenanceWindow = "USE_MAINTENANCE_WINDOW" - - // SoftwareSetUpdateScheduleApplyImmediately is a SoftwareSetUpdateSchedule enum value - SoftwareSetUpdateScheduleApplyImmediately = "APPLY_IMMEDIATELY" -) - -// SoftwareSetUpdateSchedule_Values returns all elements of the SoftwareSetUpdateSchedule enum -func SoftwareSetUpdateSchedule_Values() []string { - return []string{ - SoftwareSetUpdateScheduleUseMaintenanceWindow, - SoftwareSetUpdateScheduleApplyImmediately, - } -} - -const ( - // SoftwareSetUpdateStatusAvailable is a SoftwareSetUpdateStatus enum value - SoftwareSetUpdateStatusAvailable = "AVAILABLE" - - // SoftwareSetUpdateStatusInProgress is a SoftwareSetUpdateStatus enum value - SoftwareSetUpdateStatusInProgress = "IN_PROGRESS" - - // SoftwareSetUpdateStatusUpToDate is a SoftwareSetUpdateStatus enum value - SoftwareSetUpdateStatusUpToDate = "UP_TO_DATE" -) - -// SoftwareSetUpdateStatus_Values returns all elements of the SoftwareSetUpdateStatus enum -func SoftwareSetUpdateStatus_Values() []string { - return []string{ - SoftwareSetUpdateStatusAvailable, - SoftwareSetUpdateStatusInProgress, - SoftwareSetUpdateStatusUpToDate, - } -} - -const ( - // SoftwareSetValidationStatusValidated is a SoftwareSetValidationStatus enum value - SoftwareSetValidationStatusValidated = "VALIDATED" - - // SoftwareSetValidationStatusNotValidated is a SoftwareSetValidationStatus enum value - SoftwareSetValidationStatusNotValidated = "NOT_VALIDATED" -) - -// SoftwareSetValidationStatus_Values returns all elements of the SoftwareSetValidationStatus enum -func SoftwareSetValidationStatus_Values() []string { - return []string{ - SoftwareSetValidationStatusValidated, - SoftwareSetValidationStatusNotValidated, - } -} - -const ( - // TargetDeviceStatusDeregistered is a TargetDeviceStatus enum value - TargetDeviceStatusDeregistered = "DEREGISTERED" - - // TargetDeviceStatusArchived is a TargetDeviceStatus enum value - TargetDeviceStatusArchived = "ARCHIVED" -) - -// TargetDeviceStatus_Values returns all elements of the TargetDeviceStatus enum -func TargetDeviceStatus_Values() []string { - return []string{ - TargetDeviceStatusDeregistered, - TargetDeviceStatusArchived, - } -} - -const ( - // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value - ValidationExceptionReasonUnknownOperation = "unknownOperation" - - // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value - ValidationExceptionReasonCannotParse = "cannotParse" - - // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value - ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" - - // ValidationExceptionReasonOther is a ValidationExceptionReason enum value - ValidationExceptionReasonOther = "other" -) - -// ValidationExceptionReason_Values returns all elements of the ValidationExceptionReason enum -func ValidationExceptionReason_Values() []string { - return []string{ - ValidationExceptionReasonUnknownOperation, - ValidationExceptionReasonCannotParse, - ValidationExceptionReasonFieldValidationFailed, - ValidationExceptionReasonOther, - } -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/doc.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/doc.go deleted file mode 100644 index d66fd4fa9382..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/doc.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package workspacesthinclient provides the client and types for making API -// requests to Amazon WorkSpaces Thin Client. -// -// Amazon WorkSpaces Thin Client is a affordable device built to work with Amazon -// Web Services End User Computing (EUC) virtual desktops to provide users with -// a complete cloud desktop solution. WorkSpaces Thin Client is a compact device -// designed to connect up to two monitors and USB devices like a keyboard, mouse, -// headset, and webcam. To maximize endpoint security, WorkSpaces Thin Client -// devices do not allow local data storage or installation of unapproved applications. -// The WorkSpaces Thin Client device ships preloaded with device management -// software. -// -// You can use these APIs to complete WorkSpaces Thin Client tasks, such as -// creating environments or viewing devices. For more information about WorkSpaces -// Thin Client, including the required permissions to use the service, see the -// Amazon WorkSpaces Thin Client Administrator Guide (https://docs.aws.amazon.com/workspaces-thin-client/latest/ag/). -// For more information about using the Command Line Interface (CLI) to manage -// your WorkSpaces Thin Client resources, see the WorkSpaces Thin Client section -// of the CLI Reference (https://docs.aws.amazon.com/cli/latest/reference/workspaces-thin-client/index.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/workspaces-thin-client-2023-08-22 for more information on this service. -// -// See workspacesthinclient package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/workspacesthinclient/ -// -// # Using the Client -// -// To contact Amazon WorkSpaces Thin Client with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon WorkSpaces Thin Client client WorkSpacesThinClient for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/workspacesthinclient/#New -package workspacesthinclient diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/errors.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/errors.go deleted file mode 100644 index a3b5271c8d67..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/errors.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package workspacesthinclient - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You do not have sufficient access to perform this action. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The requested operation would cause a conflict with the current state of - // a service resource associated with the request. Resolve the conflict before - // retrying this request. - ErrCodeConflictException = "ConflictException" - - // ErrCodeInternalServerException for service response error code - // "InternalServerException". - // - // The server encountered an internal error and is unable to complete the request. - ErrCodeInternalServerException = "InternalServerException" - - // ErrCodeInternalServiceException for service response error code - // "InternalServiceException". - // - // Request processing failed due to some unknown error, exception, or failure. - ErrCodeInternalServiceException = "InternalServiceException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // The resource specified in the request was not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeServiceQuotaExceededException for service response error code - // "ServiceQuotaExceededException". - // - // Your request exceeds a service quota. - ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" - - // ErrCodeThrottlingException for service response error code - // "ThrottlingException". - // - // The request was denied due to request throttling. - ErrCodeThrottlingException = "ThrottlingException" - - // ErrCodeValidationException for service response error code - // "ValidationException". - // - // The input fails to satisfy the specified constraints. - ErrCodeValidationException = "ValidationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AccessDeniedException": newErrorAccessDeniedException, - "ConflictException": newErrorConflictException, - "InternalServerException": newErrorInternalServerException, - "InternalServiceException": newErrorInternalServiceException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, - "ThrottlingException": newErrorThrottlingException, - "ValidationException": newErrorValidationException, -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/service.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/service.go deleted file mode 100644 index 4e2dac5cc58e..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/service.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package workspacesthinclient - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/signer/v4" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private/protocol/restjson" -) - -// WorkSpacesThinClient provides the API operation methods for making requests to -// Amazon WorkSpaces Thin Client. See this package's package overview docs -// for details on the service. -// -// WorkSpacesThinClient methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type WorkSpacesThinClient struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "WorkSpaces Thin Client" // Name of service. - EndpointsID = "thinclient" // ID to lookup a service endpoint with. - ServiceID = "WorkSpaces Thin Client" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the WorkSpacesThinClient client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a WorkSpacesThinClient client from just a session. -// svc := workspacesthinclient.New(mySession) -// -// // Create a WorkSpacesThinClient client with additional configuration -// svc := workspacesthinclient.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *WorkSpacesThinClient { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "thinclient" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *WorkSpacesThinClient { - svc := &WorkSpacesThinClient{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2023-08-22", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a WorkSpacesThinClient operation and runs any -// custom request initialization. -func (c *WorkSpacesThinClient) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/workspacesthinclientiface/interface.go b/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/workspacesthinclientiface/interface.go deleted file mode 100644 index 2cc0622f98ce..000000000000 --- a/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient/workspacesthinclientiface/interface.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package workspacesthinclientiface provides an interface to enable mocking the Amazon WorkSpaces Thin Client service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package workspacesthinclientiface - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service/workspacesthinclient" -) - -// WorkSpacesThinClientAPI provides an interface to enable mocking the -// workspacesthinclient.WorkSpacesThinClient service client's API operation, -// paginators, and waiters. This make unit testing your code that calls out -// to the SDK's service client's calls easier. -// -// The best way to use this interface is so the SDK's service client's calls -// can be stubbed out for unit testing your code with the SDK without needing -// to inject custom request handlers into the SDK's request pipeline. -// -// // myFunc uses an SDK service client to make a request to -// // Amazon WorkSpaces Thin Client. -// func myFunc(svc workspacesthinclientiface.WorkSpacesThinClientAPI) bool { -// // Make svc.CreateEnvironment request -// } -// -// func main() { -// sess := session.New() -// svc := workspacesthinclient.New(sess) -// -// myFunc(svc) -// } -// -// In your _test.go file: -// -// // Define a mock struct to be used in your unit tests of myFunc. -// type mockWorkSpacesThinClientClient struct { -// workspacesthinclientiface.WorkSpacesThinClientAPI -// } -// func (m *mockWorkSpacesThinClientClient) CreateEnvironment(input *workspacesthinclient.CreateEnvironmentInput) (*workspacesthinclient.CreateEnvironmentOutput, error) { -// // mock response/functionality -// } -// -// func TestMyFunc(t *testing.T) { -// // Setup Test -// mockSvc := &mockWorkSpacesThinClientClient{} -// -// myfunc(mockSvc) -// -// // Verify myFunc's functionality -// } -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. Its suggested to use the pattern above for testing, or using -// tooling to generate mocks to satisfy the interfaces. -type WorkSpacesThinClientAPI interface { - CreateEnvironment(*workspacesthinclient.CreateEnvironmentInput) (*workspacesthinclient.CreateEnvironmentOutput, error) - CreateEnvironmentWithContext(aws.Context, *workspacesthinclient.CreateEnvironmentInput, ...request.Option) (*workspacesthinclient.CreateEnvironmentOutput, error) - CreateEnvironmentRequest(*workspacesthinclient.CreateEnvironmentInput) (*request.Request, *workspacesthinclient.CreateEnvironmentOutput) - - DeleteDevice(*workspacesthinclient.DeleteDeviceInput) (*workspacesthinclient.DeleteDeviceOutput, error) - DeleteDeviceWithContext(aws.Context, *workspacesthinclient.DeleteDeviceInput, ...request.Option) (*workspacesthinclient.DeleteDeviceOutput, error) - DeleteDeviceRequest(*workspacesthinclient.DeleteDeviceInput) (*request.Request, *workspacesthinclient.DeleteDeviceOutput) - - DeleteEnvironment(*workspacesthinclient.DeleteEnvironmentInput) (*workspacesthinclient.DeleteEnvironmentOutput, error) - DeleteEnvironmentWithContext(aws.Context, *workspacesthinclient.DeleteEnvironmentInput, ...request.Option) (*workspacesthinclient.DeleteEnvironmentOutput, error) - DeleteEnvironmentRequest(*workspacesthinclient.DeleteEnvironmentInput) (*request.Request, *workspacesthinclient.DeleteEnvironmentOutput) - - DeregisterDevice(*workspacesthinclient.DeregisterDeviceInput) (*workspacesthinclient.DeregisterDeviceOutput, error) - DeregisterDeviceWithContext(aws.Context, *workspacesthinclient.DeregisterDeviceInput, ...request.Option) (*workspacesthinclient.DeregisterDeviceOutput, error) - DeregisterDeviceRequest(*workspacesthinclient.DeregisterDeviceInput) (*request.Request, *workspacesthinclient.DeregisterDeviceOutput) - - GetDevice(*workspacesthinclient.GetDeviceInput) (*workspacesthinclient.GetDeviceOutput, error) - GetDeviceWithContext(aws.Context, *workspacesthinclient.GetDeviceInput, ...request.Option) (*workspacesthinclient.GetDeviceOutput, error) - GetDeviceRequest(*workspacesthinclient.GetDeviceInput) (*request.Request, *workspacesthinclient.GetDeviceOutput) - - GetEnvironment(*workspacesthinclient.GetEnvironmentInput) (*workspacesthinclient.GetEnvironmentOutput, error) - GetEnvironmentWithContext(aws.Context, *workspacesthinclient.GetEnvironmentInput, ...request.Option) (*workspacesthinclient.GetEnvironmentOutput, error) - GetEnvironmentRequest(*workspacesthinclient.GetEnvironmentInput) (*request.Request, *workspacesthinclient.GetEnvironmentOutput) - - GetSoftwareSet(*workspacesthinclient.GetSoftwareSetInput) (*workspacesthinclient.GetSoftwareSetOutput, error) - GetSoftwareSetWithContext(aws.Context, *workspacesthinclient.GetSoftwareSetInput, ...request.Option) (*workspacesthinclient.GetSoftwareSetOutput, error) - GetSoftwareSetRequest(*workspacesthinclient.GetSoftwareSetInput) (*request.Request, *workspacesthinclient.GetSoftwareSetOutput) - - ListDevices(*workspacesthinclient.ListDevicesInput) (*workspacesthinclient.ListDevicesOutput, error) - ListDevicesWithContext(aws.Context, *workspacesthinclient.ListDevicesInput, ...request.Option) (*workspacesthinclient.ListDevicesOutput, error) - ListDevicesRequest(*workspacesthinclient.ListDevicesInput) (*request.Request, *workspacesthinclient.ListDevicesOutput) - - ListDevicesPages(*workspacesthinclient.ListDevicesInput, func(*workspacesthinclient.ListDevicesOutput, bool) bool) error - ListDevicesPagesWithContext(aws.Context, *workspacesthinclient.ListDevicesInput, func(*workspacesthinclient.ListDevicesOutput, bool) bool, ...request.Option) error - - ListEnvironments(*workspacesthinclient.ListEnvironmentsInput) (*workspacesthinclient.ListEnvironmentsOutput, error) - ListEnvironmentsWithContext(aws.Context, *workspacesthinclient.ListEnvironmentsInput, ...request.Option) (*workspacesthinclient.ListEnvironmentsOutput, error) - ListEnvironmentsRequest(*workspacesthinclient.ListEnvironmentsInput) (*request.Request, *workspacesthinclient.ListEnvironmentsOutput) - - ListEnvironmentsPages(*workspacesthinclient.ListEnvironmentsInput, func(*workspacesthinclient.ListEnvironmentsOutput, bool) bool) error - ListEnvironmentsPagesWithContext(aws.Context, *workspacesthinclient.ListEnvironmentsInput, func(*workspacesthinclient.ListEnvironmentsOutput, bool) bool, ...request.Option) error - - ListSoftwareSets(*workspacesthinclient.ListSoftwareSetsInput) (*workspacesthinclient.ListSoftwareSetsOutput, error) - ListSoftwareSetsWithContext(aws.Context, *workspacesthinclient.ListSoftwareSetsInput, ...request.Option) (*workspacesthinclient.ListSoftwareSetsOutput, error) - ListSoftwareSetsRequest(*workspacesthinclient.ListSoftwareSetsInput) (*request.Request, *workspacesthinclient.ListSoftwareSetsOutput) - - ListSoftwareSetsPages(*workspacesthinclient.ListSoftwareSetsInput, func(*workspacesthinclient.ListSoftwareSetsOutput, bool) bool) error - ListSoftwareSetsPagesWithContext(aws.Context, *workspacesthinclient.ListSoftwareSetsInput, func(*workspacesthinclient.ListSoftwareSetsOutput, bool) bool, ...request.Option) error - - ListTagsForResource(*workspacesthinclient.ListTagsForResourceInput) (*workspacesthinclient.ListTagsForResourceOutput, error) - ListTagsForResourceWithContext(aws.Context, *workspacesthinclient.ListTagsForResourceInput, ...request.Option) (*workspacesthinclient.ListTagsForResourceOutput, error) - ListTagsForResourceRequest(*workspacesthinclient.ListTagsForResourceInput) (*request.Request, *workspacesthinclient.ListTagsForResourceOutput) - - TagResource(*workspacesthinclient.TagResourceInput) (*workspacesthinclient.TagResourceOutput, error) - TagResourceWithContext(aws.Context, *workspacesthinclient.TagResourceInput, ...request.Option) (*workspacesthinclient.TagResourceOutput, error) - TagResourceRequest(*workspacesthinclient.TagResourceInput) (*request.Request, *workspacesthinclient.TagResourceOutput) - - UntagResource(*workspacesthinclient.UntagResourceInput) (*workspacesthinclient.UntagResourceOutput, error) - UntagResourceWithContext(aws.Context, *workspacesthinclient.UntagResourceInput, ...request.Option) (*workspacesthinclient.UntagResourceOutput, error) - UntagResourceRequest(*workspacesthinclient.UntagResourceInput) (*request.Request, *workspacesthinclient.UntagResourceOutput) - - UpdateDevice(*workspacesthinclient.UpdateDeviceInput) (*workspacesthinclient.UpdateDeviceOutput, error) - UpdateDeviceWithContext(aws.Context, *workspacesthinclient.UpdateDeviceInput, ...request.Option) (*workspacesthinclient.UpdateDeviceOutput, error) - UpdateDeviceRequest(*workspacesthinclient.UpdateDeviceInput) (*request.Request, *workspacesthinclient.UpdateDeviceOutput) - - UpdateEnvironment(*workspacesthinclient.UpdateEnvironmentInput) (*workspacesthinclient.UpdateEnvironmentOutput, error) - UpdateEnvironmentWithContext(aws.Context, *workspacesthinclient.UpdateEnvironmentInput, ...request.Option) (*workspacesthinclient.UpdateEnvironmentOutput, error) - UpdateEnvironmentRequest(*workspacesthinclient.UpdateEnvironmentInput) (*request.Request, *workspacesthinclient.UpdateEnvironmentOutput) - - UpdateSoftwareSet(*workspacesthinclient.UpdateSoftwareSetInput) (*workspacesthinclient.UpdateSoftwareSetOutput, error) - UpdateSoftwareSetWithContext(aws.Context, *workspacesthinclient.UpdateSoftwareSetInput, ...request.Option) (*workspacesthinclient.UpdateSoftwareSetOutput, error) - UpdateSoftwareSetRequest(*workspacesthinclient.UpdateSoftwareSetInput) (*request.Request, *workspacesthinclient.UpdateSoftwareSetOutput) -} - -var _ WorkSpacesThinClientAPI = (*workspacesthinclient.WorkSpacesThinClient)(nil) diff --git a/cluster-autoscaler/cloudprovider/bizflycloud/OWNERS b/cluster-autoscaler/cloudprovider/bizflycloud/OWNERS deleted file mode 100644 index 1af607113f0e..000000000000 --- a/cluster-autoscaler/cloudprovider/bizflycloud/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -labels: -- area/provider/bizflycloud diff --git a/cluster-autoscaler/cloudprovider/builder/builder_kwok.go b/cluster-autoscaler/cloudprovider/builder/builder_kwok.go deleted file mode 100644 index b79f7973b18d..000000000000 --- a/cluster-autoscaler/cloudprovider/builder/builder_kwok.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build kwok -// +build kwok - -/* -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 builder - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/kwok" - "k8s.io/autoscaler/cluster-autoscaler/config" -) - -// AvailableCloudProviders supported by the cloud provider builder. -var AvailableCloudProviders = []string{ - cloudprovider.KwokProviderName, -} - -// DefaultCloudProvider for Kwok-only build is Kwok. -const DefaultCloudProvider = cloudprovider.KwokProviderName - -func buildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider { - switch opts.CloudProviderName { - case cloudprovider.KwokProviderName: - return kwok.BuildKwokCloudProvider(opts, do, rl)(opts, do, rl) - } - - return nil -} diff --git a/cluster-autoscaler/cloudprovider/builder/builder_volcengine.go b/cluster-autoscaler/cloudprovider/builder/builder_volcengine.go deleted file mode 100644 index 78e728dd1d17..000000000000 --- a/cluster-autoscaler/cloudprovider/builder/builder_volcengine.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build volcengine -// +build volcengine - -/* -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 builder - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/config" -) - -// AvailableCloudProviders supported by the cloud provider builder. -var AvailableCloudProviders = []string{ - cloudprovider.VolcengineProviderName, -} - -// DefaultCloudProvider for volcengine-only build is volcengine. -const DefaultCloudProvider = cloudprovider.VolcengineProviderName - -func buildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider { - switch opts.CloudProviderName { - case cloudprovider.VolcengineProviderName: - return volcengine.BuildVolcengine(opts, do, rl) - } - - return nil -} diff --git a/cluster-autoscaler/cloudprovider/civo/civo-cloud-sdk-go/size.go b/cluster-autoscaler/cloudprovider/civo/civo-cloud-sdk-go/size.go deleted file mode 100644 index 5b17cfa87d16..000000000000 --- a/cluster-autoscaler/cloudprovider/civo/civo-cloud-sdk-go/size.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -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 civocloud - -import ( - "bytes" - "encoding/json" - "fmt" - "strings" -) - -// InstanceSize represents an available size for instances to launch -type InstanceSize struct { - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` - NiceName string `json:"nice_name,omitempty"` - CPUCores int `json:"cpu_cores,omitempty"` - GPUCount int `json:"gpu_count,omitempty"` - GPUType string `json:"gpu_type,omitempty"` - RAMMegabytes int `json:"ram_mb,omitempty"` - DiskGigabytes int `json:"disk_gb,omitempty"` - TransferTerabytes int `json:"transfer_tb,omitempty"` - Description string `json:"description,omitempty"` - Selectable bool `json:"selectable,omitempty"` -} - -// ListInstanceSizes returns all available sizes of instances -// TODO: Rename to Size because this return all size (k8s, vm, database, kfaas) -func (c *Client) ListInstanceSizes() ([]InstanceSize, error) { - resp, err := c.SendGetRequest("/v2/sizes") - if err != nil { - return nil, decodeError(err) - } - - sizes := make([]InstanceSize, 0) - if err := json.NewDecoder(bytes.NewReader(resp)).Decode(&sizes); err != nil { - return nil, err - } - - return sizes, nil -} - -// FindInstanceSizes finds a instance size name by either part of the ID or part of the name -func (c *Client) FindInstanceSizes(search string) (*InstanceSize, error) { - instanceSize, err := c.ListInstanceSizes() - if err != nil { - return nil, decodeError(err) - } - - exactMatch := false - partialMatchesCount := 0 - result := InstanceSize{} - - for _, value := range instanceSize { - if value.Name == search { - exactMatch = true - result = value - } else if strings.Contains(value.Name, search) { - if !exactMatch { - result = value - partialMatchesCount++ - } - } - } - - if exactMatch || partialMatchesCount == 1 { - return &result, nil - } else if partialMatchesCount > 1 { - err := fmt.Errorf("unable to find %s because there were multiple matches", search) - return nil, MultipleMatchesError.wrap(err) - } else { - err := fmt.Errorf("unable to find %s, zero matches", search) - return nil, ZeroMatchesError.wrap(err) - } -} diff --git a/cluster-autoscaler/cloudprovider/civo/examples/cluster-autoscaler-node-pool.yaml b/cluster-autoscaler/cloudprovider/civo/examples/cluster-autoscaler-node-pool.yaml deleted file mode 100644 index 4af5239f25de..000000000000 --- a/cluster-autoscaler/cloudprovider/civo/examples/cluster-autoscaler-node-pool.yaml +++ /dev/null @@ -1,181 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler - name: cluster-autoscaler - namespace: kube-system ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: cluster-autoscaler - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -rules: - - apiGroups: ["storage.k8s.io"] - resources: ["csistoragecapacities", "csidrivers"] - verbs: ["get", "list"] - - apiGroups: [""] - resources: ["events", "endpoints"] - verbs: ["create", "patch"] - - apiGroups: [""] - resources: ["pods/eviction"] - verbs: ["create"] - - apiGroups: [""] - resources: ["pods/status"] - verbs: ["update"] - - apiGroups: [""] - resources: ["endpoints"] - resourceNames: ["cluster-autoscaler"] - verbs: ["get", "update"] - - apiGroups: [""] - resources: ["nodes", "namespaces"] - verbs: ["watch", "list", "get", "update"] - - apiGroups: [""] - resources: - - "pods" - - "services" - - "replicationcontrollers" - - "persistentvolumeclaims" - - "persistentvolumes" - verbs: ["watch", "list", "get"] - - apiGroups: ["extensions"] - resources: ["replicasets", "daemonsets"] - verbs: ["watch", "list", "get"] - - apiGroups: ["policy"] - resources: ["poddisruptionbudgets"] - verbs: ["watch", "list"] - - apiGroups: ["apps"] - resources: ["statefulsets", "replicasets", "daemonsets"] - verbs: ["watch", "list", "get"] - - apiGroups: ["storage.k8s.io"] - resources: ["storageclasses", "csinodes"] - verbs: ["watch", "list", "get"] - - apiGroups: ["batch", "extensions"] - resources: ["jobs"] - verbs: ["get", "list", "watch", "patch"] - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["create"] - - apiGroups: ["coordination.k8s.io"] - resourceNames: ["cluster-autoscaler"] - resources: ["leases"] - verbs: ["get", "update"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -rules: - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["create", "list", "watch"] - - apiGroups: [""] - resources: ["configmaps"] - resourceNames: - ["cluster-autoscaler-status", "cluster-autoscaler-priority-expander"] - verbs: ["delete", "get", "update", "watch"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: cluster-autoscaler - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-autoscaler -subjects: - - kind: ServiceAccount - name: cluster-autoscaler - namespace: kube-system ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: cluster-autoscaler -subjects: - - kind: ServiceAccount - name: cluster-autoscaler - namespace: kube-system ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - app: cluster-autoscaler -spec: - replicas: 1 - selector: - matchLabels: - app: cluster-autoscaler - template: - metadata: - labels: - app: cluster-autoscaler - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "8085" - spec: - serviceAccountName: cluster-autoscaler - containers: - - image: registry.k8s.io/autoscaling/cluster-autoscaler:v1.28.0 # or your custom image - name: cluster-autoscaler - imagePullPolicy: Always - resources: - limits: - cpu: 100m - memory: 300Mi - requests: - cpu: 100m - memory: 300Mi - command: - - ./cluster-autoscaler - - --v=4 - - --stderrthreshold=info - - --cloud-provider=civo - - --nodes=1:5: - - --nodes=5:10: - - --skip-nodes-with-local-storage=false - - --skip-nodes-with-system-pods=false - env: - - name: CIVO_API_URL - valueFrom: - secretKeyRef: - key: api-url - name: civo-api-access - - name: CIVO_API_KEY - valueFrom: - secretKeyRef: - key: api-key - name: civo-api-access - - name: CIVO_CLUSTER_ID - valueFrom: - secretKeyRef: - key: cluster-id - name: civo-api-access - - name: CIVO_REGION - valueFrom: - secretKeyRef: - key: region - name: civo-api-access diff --git a/cluster-autoscaler/cloudprovider/hetzner/hack/update-vendor.sh b/cluster-autoscaler/cloudprovider/hetzner/hack/update-vendor.sh deleted file mode 100755 index c7ce398a2da9..000000000000 --- a/cluster-autoscaler/cloudprovider/hetzner/hack/update-vendor.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -set -o pipefail -set -o nounset -set -o errexit - -UPSTREAM_REPO=${UPSTREAM_REPO:-https://github.com/hetznercloud/hcloud-go.git} -UPSTREAM_REF=${UPSTREAM_REF:-main} - -vendor_path=hcloud-go - -original_module_path="github.com/hetznercloud/hcloud-go/v2/" -vendor_module_path=k8s.io/autoscaler/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/ - - -echo "# Removing existing directory." -rm -rf hcloud-go - -echo "# Cloning repo" -git clone --depth=1 --branch "$UPSTREAM_REF" "$UPSTREAM_REPO" "$vendor_path" - -echo "# Removing unnecessary files" -find "$vendor_path" -type f ! -name "*.go" ! -name "LICENSE" -delete -find "$vendor_path" -type f -name "*_test.go" -delete -find "$vendor_path" -type d -empty -delete - -echo "# Rewriting module path" -find "$vendor_path" -type f -exec sed -i "s@${original_module_path}@${vendor_module_path}@g" {} + - diff --git a/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/LICENSE b/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/LICENSE deleted file mode 100644 index 394ce101f08c..000000000000 --- a/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018-2020 Hetzner Cloud GmbH - -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. diff --git a/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/hcloud/deprecation.go b/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/hcloud/deprecation.go deleted file mode 100644 index 17c6949cba37..000000000000 --- a/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/hcloud/deprecation.go +++ /dev/null @@ -1,59 +0,0 @@ -package hcloud - -import "time" - -// Deprecatable is a shared interface implemented by all Resources that have a defined deprecation workflow. -type Deprecatable interface { - // IsDeprecated returns true if the resource is marked as deprecated. - IsDeprecated() bool - - // UnavailableAfter returns the time that the deprecated resource will be removed from the API. - // This only returns a valid value if [Deprecatable.IsDeprecated] returned true. - UnavailableAfter() time.Time - - // DeprecationAnnounced returns the time that the deprecation of this resource was announced. - // This only returns a valid value if [Deprecatable.IsDeprecated] returned true. - DeprecationAnnounced() time.Time -} - -// DeprecationInfo contains the information published when a resource is actually deprecated. -type DeprecationInfo struct { - Announced time.Time - UnavailableAfter time.Time -} - -// DeprecatableResource implements the [Deprecatable] interface and can be embedded in structs for Resources that can be -// deprecated. -type DeprecatableResource struct { - Deprecation *DeprecationInfo -} - -// IsDeprecated returns true if the resource is marked as deprecated. -func (d DeprecatableResource) IsDeprecated() bool { - return d.Deprecation != nil -} - -// UnavailableAfter returns the time that the deprecated resource will be removed from the API. -// This only returns a valid value if [Deprecatable.IsDeprecated] returned true. -func (d DeprecatableResource) UnavailableAfter() time.Time { - if !d.IsDeprecated() { - // Return "null" time if resource is not deprecated - return time.Unix(0, 0) - } - - return d.Deprecation.UnavailableAfter -} - -// DeprecationAnnounced returns the time that the deprecation of this resource was announced. -// This only returns a valid value if [Deprecatable.IsDeprecated] returned true. -func (d DeprecatableResource) DeprecationAnnounced() time.Time { - if !d.IsDeprecated() { - // Return "null" time if resource is not deprecated - return time.Unix(0, 0) - } - - return d.Deprecation.Announced -} - -// Make sure that all expected Resources actually implement the interface. -var _ Deprecatable = ServerType{} diff --git a/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/hcloud/schema/deprecation.go b/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/hcloud/schema/deprecation.go deleted file mode 100644 index 87292f78b53e..000000000000 --- a/cluster-autoscaler/cloudprovider/hetzner/hcloud-go/hcloud/schema/deprecation.go +++ /dev/null @@ -1,12 +0,0 @@ -package schema - -import "time" - -type DeprecationInfo struct { - Announced time.Time `json:"announced"` - UnavailableAfter time.Time `json:"unavailable_after"` -} - -type DeprecatableResource struct { - Deprecation *DeprecationInfo `json:"deprecation"` -} diff --git a/cluster-autoscaler/cloudprovider/kwok/OWNERS b/cluster-autoscaler/cloudprovider/kwok/OWNERS deleted file mode 100644 index 585a63b17faa..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -approvers: -- vadasambar -reviewers: -- vadasambar - -labels: -- area/provider/kwok \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/kwok/README.md b/cluster-autoscaler/cloudprovider/kwok/README.md deleted file mode 100644 index e3d400ae05f7..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/README.md +++ /dev/null @@ -1,266 +0,0 @@ -With `kwok` provider you can: -* Run **CA** (cluster-autoscaler) in your terminal and connect it to a cluster (like a kubebuilder controller). You don't have to run CA in an actual cluster to test things out. -![](./docs/images/run-kwok-locally-1.png) -![](./docs/images/run-kwok-locally-2.png) -* Perform a "dry-run" to test autoscaling behavior of CA without creating actual VMs in your cloud provider. -* Run CA in your local kind cluster with nodes and workloads from a remote cluster (you can also use nodes from the same cluster). -![](./docs/images/kwok-as-dry-run-1.png) -![](./docs/images/kwok-as-dry-run-2.png) -* Test behavior of CA against a large number of fake nodes (of your choice) with metrics. -![](./docs/images/large-number-of-nodes-1.png) -![](./docs/images/large-number-of-nodes-2.png) -* etc., - -## What is `kwok` provider? Why `kwok` provider? -Check the doc around [motivation](./docs/motivation.md). - -## How to use `kwok` provider - -### In a Kubernetes cluster: - -#### 1. Install `kwok` controller - -Follow [the official docs to install `kwok`](https://kwok.sigs.k8s.io/docs/user/kwok-in-cluster/) in a cluster. - -#### 2. Configure cluster-autoscaler to use `kwok` cloud provider - -*Using helm chart*: -```shell -helm upgrade --install charts/cluster-autoscaler \ ---set "serviceMonitor.enabled"=true --set "serviceMonitor.namespace"=default \ ---set "cloudprovider"=kwok --set "image.tag"="" \ ---set "image.repository"="" \ ---set "autoDiscovery.clusterName"="kind-kind" \ ---set "serviceMonitor.selector.release"="prom" -``` -Replace `` with the release name you want. -Replace `` with the image tag you want. Replace `` with the image repo you want -(check [releases](https://github.com/kubernetes/autoscaler/releases) for the official image repos and tags) - -Note that `kwok` provider doesn't use `autoDiscovery.clusterName`. You can use a fake value for `autoDiscovery.clusterName`. - -Replace `"release"="prom"` with the label selector for `ServiceMonitor` in your grafana/prometheus installation. - -For example, if you are using prometheus operator, you can find the service monitor label selector using -```shell -kubectl get prometheus -ojsonpath='{.items[*].spec.serviceMonitorSelector}' | jq # using jq is optional -``` -Here's what it looks like -![](./docs/images/prom-match-labels.png) - -`helm upgrade ...` command above installs cluster-autoscaler with `kwok` cloud provider settings. The helm chart by default installs a default kwok provider configuration (`kwok-provider-config` ConfigMap) and sample template nodes (`kwok-provider-templates` ConfigMap) to get you started. Replace the content of these ConfigMaps according to your need. - -If you already have cluster-autoscaler running and don't want to use `helm ...`, you can make the following changes to get kwok provider working: -1. Create `kwok-provider-config` ConfigMap for kwok provider config -2. Create `kwok-provider-templates` ConfigMap for node templates -3. Set `POD_NAMESPACE` env variable in the CA Deployment (if it is not there already) -4. Set `--cloud-provider=kwok` in the CA Deployment -5. That's all. - -For 1 and 2, you can refer to helm chart for the ConfigMaps. You can render them from the helm chart using: -``` -helm template charts/cluster-autoscaler/ --set "cloudProvider"="kwok" -s templates/configmap.yaml --namespace=default -``` -Replace `--namespace` with namespace where your CA pod is running. - -If you want to temporarily revert back to your previous cloud provider, just change the `--cloud-provider=kwok`. -No other provider uses `kwok-provider-config` and `kwok-provider-templates` ConfigMap (you can keep them in the cluster or delete them if you want to revert completely). `POD_NAMESPACE` is used only by kwok provider (at the time of writing this). - -#### 3. Configure `kwok` cloud provider -Decide if you want to use static template nodes or dynamic template nodes ([check the FAQ](#3-what-is-the-difference-between-static-template-nodes-and-dynamic-template-nodes) to understand the difference). - -If you want to use static template nodes, - -`kwok-provider-config` ConfigMap in the helm chart by default is set to use static template nodes (`readNodesFrom` is set to `configmap`). CA helm chart also installs a `kwok-provider-templates` ConfigMap with sample node yamls by default. If you want to use your own node yamls, -```shell -# delete the existing configmap -kubectl delete configmap kwok-provider-templates -# create a new configmap with your own node yamls -kubectl create configmap kwok-provider-templates --from-file=templates=template-nodes.yaml -``` -Replace `template-nodes.yaml` with path to your template nodes file. - -If you are using your own template nodes in the `kwok-provider-templates` ConfigMap, make sure you have set the correct value for `nodegroups.fromNodeLabelKey`/`nodegroups.fromNodeAnnotation`. Not doing so will make CA not scale up nodes (it won't throw any error either). - -If you want to use dynamic template nodes, - -Set `readNodesFrom` in `kwok-provider-config` ConfigMap to `cluster`. This tells kwok provider to use live nodes from the cluster as template nodes. - -If you are using live nodes from cluster as template nodes in the `kwok-provider-templates` ConfigMap, make sure you have set the correct value for `nodegroups.fromNodeLabelKey`/`nodegroups.fromNodeAnnotation`. Not doing so will make CA not scale up nodes (it won't throw any error either). - -### For local development -1. Point your kubeconfig to the cluster where you want to test your changes -Using [`kubectx`](https://github.com/ahmetb/kubectx): -``` -kubectx -``` -Using `kubectl`: -``` -kubectl config get-contexts - -``` -2. Create `kwok-provider-config` and `kwok-provider-templates` ConfigMap in the cluster you want to test your changes. - -This is important because even if you run CA locally with kwok provider, kwok provider still searches for the `kwok-provider-config` ConfigMap and `kwok-provider-templates` (because by default `kwok-provider-config` has `readNodesFrom` set to `configmap`) in the cluster it connects to. - -You can create both the ConfigMap resources from the helm chart like this: - -```shell -helm template charts/cluster-autoscaler/ --set "cloudProvider"="kwok" -s templates/configmap.yaml --namespace=default | kubectl apply -f - -``` -`--namespace` has to match `POD_NAMESPACE` env variable you set below. - -3. Run CA locally - -```shell -# replace `KUBERNETES_SERVICE_HOST` and `KUBERNETES_SERVICE_PORT` -# with your kubernetes api server url -# you can find it with `kubectl cluster-info` -# example: -# $ kubectl cluster-info -# Kubernetes control plane is running at https://127.0.0.1:36357 -# ... -export KUBERNETES_SERVICE_HOST=https://127.0.0.1 -export KUBERNETES_SERVICE_PORT=36357 -# POD_NAMESPACE is the namespace where you want to look for -# your `kwok-provider-config` and `kwok-provider-templates` ConfigMap -export POD_NAMESPACE=default -# KWOK_PROVIDER_MODE tells kwok provider that we are running CA locally -export KWOK_PROVIDER_MODE=local -# `2>&1` redirects both stdout and stderr to VS Code (remove `| code -` if you don't use VS Code) -go run main.go --kubeconfig=/home/suraj/.kube/config --cloud-provider=kwok --namespace=default --logtostderr=true --stderrthreshold=info --v=5 2>&1 | code - -``` - -This is what it looks like in action: -![](./docs/images/run-kwok-locally-3.png) - -## Tweaking the `kwok` provider -You can change the behavior of `kwok` provider by tweaking the kwok provider configuration in `kwok-provider-config` ConfigMap: - -```yaml -# only v1alpha1 is supported right now -apiVersion: v1alpha1 -# possible values: [cluster,configmap] -# cluster: use nodes from cluster as template nodes -# configmap: use node yamls from a configmap as template nodes -readNodesFrom: configmap -# nodegroups specifies nodegroup level config -nodegroups: - # fromNodeLabelKey's value is used to group nodes together into nodegroups - # For example, say you want to group nodes with same value for `node.kubernetes.io/instance-type` - # label as a nodegroup. Here are the nodes you have: - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # Your nodegroups will look like this: - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "node.kubernetes.io/instance-type" - - # fromNodeAnnotation's value is used to group nodes together into nodegroups - # (basically same as `fromNodeLabelKey` except based on annotation) - # you can specify either of `fromNodeLabelKey` OR `fromNodeAnnotation` - # (both are not allowed) - fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -# nodes specifies node level config -nodes: - # skipTaint is used to enable/disable adding kwok provider taint on the template nodes - # default is false so that even if you run the provider in a production cluster - # you don't have to worry about production workload - # getting accidentally scheduled on the fake nodes - skipTaint: true # default: false - # gpuConfig is used to specify gpu config for the node - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - -# availableGPUTypes is used to specify available GPU types -availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -# configmap specifies config map name and key which stores the kwok provider templates in the cluster -# Only applicable when `readNodesFrom: configmap` -configmap: - name: kwok-provider-templates - key: kwok-config # default: config -``` - -By default, kwok provider looks for `kwok-provider-config` ConfigMap. If you want to use a different ConfigMap name, set the env variable `KWOK_PROVIDER_CONFIGMAP` (e.g., `KWOK_PROVIDER_CONFIGMAP=kpconfig`). You can set this env variable in the helm chart using `kwokConfigMapName` OR you can set it directly in the cluster-autoscaler Deployment with `kubectl edit deployment ...`. - -### FAQ -#### 1. What is the difference between `kwok` and `kwok` provider? -`kwok` is an open source project under `sig-scheduling`. -> KWOK is a toolkit that enables setting up a cluster of thousands of Nodes in seconds. Under the scene, all Nodes are simulated to behave like real ones, so the overall approach employs a pretty low resource footprint that you can easily play around on your laptop. - -https://kwok.sigs.k8s.io/ - -`kwok` provider refers to the cloud provider extension/plugin in cluster-autoscaler which uses `kwok` to create fake nodes. - -#### 2. What does a template node exactly mean? -Template node is the base node yaml `kwok` provider uses to create a new node in the cluster. -#### 3. What is the difference between static template nodes and dynamic template nodes? -Static template nodes are template nodes created using the node yaml specified by the user in `kwok-provider-templates` ConfigMap while dynamic template nodes are template nodes based on the node yaml of the current running nodes in the cluster. -#### 4. Can I use both static and dynamic template nodes together? -As of now, no you can't (but it's an interesting idea). If you have a specific usecase, please create an issue and we can talk more there! - - -#### 5. What is the difference between kwok provider config and template nodes config? -kwok provider config is configuration to change the behavior of kwok provider (and not the underlying `kwok` toolkit) while template nodes config is the ConfigMap you can use to specify static node templates. - - -### Gotchas -1. kwok provider by default taints the template nodes with `kwok-provider: true` taint so that production workloads don't get scheduled on these nodes accidentally. You have to tolerate the taint to schedule your workload on the nodes created by the kwok provider. You can turn this off by setting `nodes.skipTaint: true` in the kwok provider config. -2. Make sure the label/annotation for `fromNodeLabelKey`/`fromNodeAnnotation` in kwok provider config is actually present on the template nodes. If it isn't present on the template nodes, kwok provider will not be able to create new nodes. -3. Note that kwok provider makes the following changes to all the template nodes: -(pseudocode) -``` -node.status.nodeInfo.kubeletVersion = "fake" -node.annotations["kwok.x-k8s.io/node"] = "fake" -node.annotations["cluster-autoscaler.kwok.nodegroup/name"] = "" -node.spec.providerID = "kwok:" -node.spec.taints = append(node.spec.taints, { - key: "kwok-provider", - value: "true", - effect: "NoSchedule", - }) -``` - -## I have a problem/suggestion/question/idea/feature request. What should I do? -Awesome! Please: -* [Create a new issue](https://github.com/kubernetes/autoscaler/issues/new/choose) around it. Mention `@vadasambar` (I try to respond within a working day). -* Start a slack thread aruond it in kubernetes `#sig-autoscaling` channel (for invitation, check [this](https://slack.k8s.io/)). Mention `@vadasambar` (I try to respond within a working day) -* Add it to the [weekly sig-autoscaling meeting agenda](https://docs.google.com/document/d/1RvhQAEIrVLHbyNnuaT99-6u9ZUMp7BfkPupT2LAZK7w/edit) (happens [on Mondays](https://github.com/kubernetes/community/tree/master/sig-autoscaling#meetings)) - -Please don't think too much about creating an issue. We can always close it if it doesn't make sense. - -## What is not supported? -* Creating kwok nodegroups based on `kubernetes/hostname` node label. Why? Imagine you have a `Deployment` (replicas: 2) with pod anti-affinity on the `kubernetes/hostname` label like this: -![](./docs/images/kwok-provider-hostname-label.png) -Imagine you have only 2 unique hostnames values for `kubernetes/hostname` node label in your cluster: - * `hostname1` - * `hostname2` - - If you increase the number of replicas in the `Deployment` to 3, CA creates a fake node internally and runs simulations on it to decide if it should scale up. This fake node has `kubernetes/hostname` set to the name of the fake node which looks like `template-node-xxxx-xxxx` (second `xxxx` is random). Since the value of `kubernetes/hostname` on the fake node is not `hostname1` or `hostname2`, CA thinks it can schedule the `Pending` pod on the fake node and hence keeps on scaling up to infinity (or until it can't). - - - -## Troubleshooting -1. Pods are still stuck in `Running` even after CA has cleaned up all the kwok nodes - * `kwok` provider doesn't drain the nodes when it deletes them. It just deletes the nodes. You should see pods running on these nodes change from `Running` state to `Pending` state in a minute or two. But if you don't, try scaling down your workload and scaling it up again. If the issue persists, please create an issue :pray:. - -## I want to contribute -Thank you ❤️ - -It is expected that you know how to build and run CA locally. If you don't, I recommend starting from the [`Makefile`](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/Makefile). Check the CA [FAQ](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md) to know more about CA in general ([including info around building CA and submitting a PR](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#developer)). CA is a big and complex project. If you have any questions or if you get stuck anywhere, [reach out for help](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/kwok/README.md#reach-out-for-help-if-you-get-stuck). - -### Get yourself familiar with the `kwok` project -Check https://kwok.sigs.k8s.io/ -### Try out the `kwok` provider -Go through [the README](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/kwok/README.md). -### Look for a good first issue -Check [this](https://github.com/kubernetes/autoscaler/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Fprovider%2Fkwok+label%3A%22good+first+issue%22) filter for good first issues around `kwok` provider. -### Reach out for help if you get stuck -You can get help in the following ways: -* Mention `@vadasambar` in the issue/PR you are working on. -* Start a slack thread in `#sig-autoscaling` mentioning `@vadasambar` (to join Kubernetes slack click [here](https://slack.k8s.io/)). -* Add it to the weekly [sig-autoscaling meeting](https://github.com/kubernetes/community/tree/master/sig-autoscaling#meetings) agenda (happens on Mondays) diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-as-dry-run-1.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-as-dry-run-1.png deleted file mode 100644 index 2c6046bd4ab0..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-as-dry-run-1.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-as-dry-run-2.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-as-dry-run-2.png deleted file mode 100644 index 923a6d62e18e..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-as-dry-run-2.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-grafana.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-grafana.png deleted file mode 100644 index 95a550423e8e..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-grafana.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-hostname-label.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-hostname-label.png deleted file mode 100644 index 74e7ce2b7acf..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-hostname-label.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-in-action.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-in-action.png deleted file mode 100644 index bef3a1044a98..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/kwok-provider-in-action.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/large-number-of-nodes-1.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/large-number-of-nodes-1.png deleted file mode 100644 index a9c90ad3ec50..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/large-number-of-nodes-1.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/large-number-of-nodes-2.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/large-number-of-nodes-2.png deleted file mode 100644 index 1317ebf7f2f7..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/large-number-of-nodes-2.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/prom-match-labels.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/prom-match-labels.png deleted file mode 100644 index 68fa2947e2b3..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/prom-match-labels.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-1.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-1.png deleted file mode 100644 index 742016719445..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-1.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-2.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-2.png deleted file mode 100644 index 5bfc201563bc..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-2.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-3.png b/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-3.png deleted file mode 100644 index 39cfd1fd7617..000000000000 Binary files a/cluster-autoscaler/cloudprovider/kwok/docs/images/run-kwok-locally-3.png and /dev/null differ diff --git a/cluster-autoscaler/cloudprovider/kwok/docs/motivation.md b/cluster-autoscaler/cloudprovider/kwok/docs/motivation.md deleted file mode 100644 index c83aadf8fe4c..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/docs/motivation.md +++ /dev/null @@ -1,107 +0,0 @@ -# KWOK (Kubernetes without Kubelet) cloud provider - -*This doc was originally a part of https://github.com/kubernetes/autoscaler/pull/5869* -## Introduction -> [KWOK](https://sigs.k8s.io/kwok) is a toolkit that enables setting up a cluster of thousands of Nodes in seconds. Under the scene, all Nodes are simulated to behave like real ones, so the overall approach employs a pretty low resource footprint that you can easily play around on your laptop. - -https://kwok.sigs.k8s.io/ - -## Problem -### 1. It is hard to reproduce an issue happening at scale on local machine -e.g., https://github.com/kubernetes/autoscaler/issues/5769 - -To reproduce such issues, we have the following options today: -### (a) setup [Kubemark](https://github.com/kubernetes/design-proposals-archive/blob/main/scalability/kubemark.md) on a public cloud provider and try reproducing the issue -You can [setup Kubemark](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-scalability/kubemark-guide.md) ([related](https://github.com/kubernetes/kubernetes/blob/master/test/kubemark/pre-existing/README.md)) and use the [`kubemark` cloudprovider](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/kubemark) (kubemark [proposal](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/proposals/kubemark_integration.md)) directly or [`cluster-api` cloudprovider with kubemark](https://github.com/kubernetes-sigs/cluster-api-provider-kubemark) - -In either case, - -> Every running Kubemark setup looks like the following: -> 1) A running Kubernetes cluster pointed to by the local kubeconfig -> 2) A separate VM where the kubemark master is running -> 3) Some hollow-nodes that run on the Kubernetes Cluster from #1 -> 4) The hollow-nodes are configured to talk with the kubemark master at #2 - -https://github.com/kubernetes/kubernetes/blob/master/test/kubemark/pre-existing/README.md#introduction - -You need to setup a separate VM (Virtual Machine) with master components to get Kubemark running. - -> Currently we're running HollowNode with a limit of 0.09 CPU core/pod and 220MB of memory. However, if we also take into account the resources absorbed by default cluster addons and fluentD running on the 'external' cluster, this limit becomes ~0.1 CPU core/pod, thus allowing ~10 HollowNodes to run per core (on an "n1-standard-8" VM node). - -https://github.com/kubernetes/community/blob/master/contributors/devel/sig-scalability/kubemark-guide.md#starting-a-kubemark-cluster - -Kubemark can mimic 10 nodes with 1 CPU core. - -In reality it might be lesser than 10 nodes, -> Using Kubernetes and [kubemark](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/scalability/kubemark.md) on GCP we have created a following 1000 node cluster setup: ->* 1 master - 1-core VM ->* 17 nodes - 8-core VMs, each core running up to 8 Kubemark nodes. ->* 1 Kubemark master - 32-core VM ->* 1 dedicated VM for Cluster Autoscaler - -https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/proposals/scalability_tests.md#test-setup - -This is a cheaper option than (c) but if you want to setup Kubemark on your local machine you will need a master node and 1 core per 10 fake nodes i.e., if you want to mimic 100 nodes, that's 10 cores of CPU + extra CPU for master node. Unless you have 10-12 free cores on your local machine, it is hard to run scale tests with Kubemark for nodes > 100. - -### (b) try to get as much information from the issue reporter as possible and try to reproduce the issue by tweaking our code tests -This works well if the issue is easy to reproduce by tweaking tests e.g., you want to check why scale down is getting blocked on a particular pod. You can do so by mimicing the pod in the tests by adding an entry [here](https://github.com/kubernetes/autoscaler/blob/1009797f5585d7bf778072ba59fd12eb2b8ab83c/cluster-autoscaler/utils/drain/drain_test.go#L878-L887) and running -``` -cluster-autoscaler/utils/drain$ go test -run TestDrain -``` -But when you want to test an issue related to scale e.g., CA is slow in scaling up, it is hard to do. -### (c) try reproducing the issue using the same CA setup as user with actual nodes in a public cloud provider -e.g., if the issue reporter has a 200 node cluster in AWS, try creating a 200 node cluster in AWS and use the same CA flags as the issue reporter. - -This is a viable option if you already have a cluster running with a similar size but otherwise creating a big cluster just to reproduce the issue is costly. - -### 2. It is hard to confirm behavior of CA at scale -For example, a user with a big Kubernetes cluster (> 100-200 nodes) wants to check if adding scheduling properties to their workloads (node affinity, pod affinity, node selectors etc.,) leads to better utilization of the nodes (which saves cost). To give a more concrete example, imagine a situation like this: -1. There is a cluster with > 100 nodes. cpu to memory ratio for the nodes is 1:1, 1:2, 1:8 and 1:16 -2. It is observed that 1:16 nodes are underutilized on memory -3. It is observed that workloads with cpu to memory ratio of 1:7 are getting scheduled on 1:16 nodes thereby leaving some memory unused -e.g., -1:16 node looks like this: -CPUs: 8 Cores -Memory: 128Gi - -workload (1:7 memory:cpu ratio): -CPUs: 1 Core -Memory: 7 Gi - -resources wasted on the node: 8 % 1 CPU(s) + 128 % 7 Gi -= 0 CPUs + 2 Gi memory = 2Gi of wasted memory - -1:8 node looks like this: -CPUs: 8 Cores -Memory: 64 Gi - -workload (1:7 memory:cpu ratio): -CPUs: 1 Core -Memory: 7 Gi - -resources wasted on the node: 8 % 1 CPU(s) + 64 % 7 Gi -= 0 CPUs + 1 Gi memory = 1Gi of wasted memory - -If 1:7 can somehow be scheduled on 1:8 node using node selector or required node affinity, the wastage would go down. User wants to add required node affinity on 1:7 workloads and see how CA would behave without creating actual nodes in public cloud provider. The goal here is to see if the theory is true and if there are any side-effects. - -This can be done with Kubemark today but a public cloud provider would be needed to mimic the cluster of this size. It can't be done on a local cluster (kind/minikube etc.,). - -### How does it look in action? -You can check it [here](https://github.com/kubernetes/autoscaler/issues/5769#issuecomment-1590541506). - -### FAQ -1. **Will this be patched back to older releases of Kubernetes?** - - As of writing this, the plan is to release it as a part of Kubernetes 1.28 and patch it back to 1.27 and 1.26. -2. **Why did we not use GRPC or cluster-api provider to implement this?** -The idea was to enable users/contributors to be able to scale-test issues around different cloud providers (e.g., https://github.com/kubernetes/autoscaler/issues/5769). Implementing the `kwok` provider in-tree means we are closer to the actual implementation of our most-used cloud providers (adding gRPC communication in between would mean an extra delay which is not there in our in-tree cloud providers). Although only in-tree provider is a part of this proposal, overall plan is to: - * Implement in-tree provider to cover most of the common use-cases - * Implement `kwok` provider for `clusterapi` provider so that we can provision `kwok` nodes using `clusterapi` provider ([someone is already working on this](https://kubernetes.slack.com/archives/C8TSNPY4T/p1685648610609449)) - * Implement gRPC provider if there is user demand -3. **How performant is `kwok` provider really compared to `kubemark` provider?** -`kubemark` provider seems to need 1 core per 8-10 nodes (based on our [last scale tests](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/proposals/scalability_tests.md#test-setup)). This means we need roughly 10 cores to simulate 100 nodes in `kubemark`. -`kwok` provider can simulate 385 nodes for 122m of CPU and 521Mi of memory. This means, CPU wise `kwok` can simulate 385 / 0.122 =~ 3155 nodes per 1 core of CPU. -![](images/kwok-provider-grafana.png) -![](images/kwok-provider-in-action.png) -4. **Can I think of `kwok` as a dry-run for my actual `cloudprovider`?** -That is the goal but note that the definition of what exactly `dry-run` means is not very clear and can mean different things for different users. You can think of it as something similar to a `dry-run`. diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_config.go b/cluster-autoscaler/cloudprovider/kwok/kwok_config.go deleted file mode 100644 index 5b5ab7037f74..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_config.go +++ /dev/null @@ -1,153 +0,0 @@ -/* -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 kwok - -import ( - "context" - "errors" - "fmt" - "os" - "strings" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/yaml" - kubeclient "k8s.io/client-go/kubernetes" - klog "k8s.io/klog/v2" -) - -const ( - defaultConfigName = "kwok-provider-config" - configKey = "config" -) - -// based on https://github.com/kubernetes/kubernetes/pull/63707/files -func getCurrentNamespace() string { - currentNamespace := os.Getenv("POD_NAMESPACE") - if strings.TrimSpace(currentNamespace) == "" { - klog.Info("env variable 'POD_NAMESPACE' is empty") - klog.Info("trying to read current namespace from serviceaccount") - // Fall back to the namespace associated with the service account token, if available - if data, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil { - if ns := strings.TrimSpace(string(data)); len(ns) > 0 { - currentNamespace = ns - } else { - klog.Fatal("couldn't get current namespace from serviceaccount") - } - } else { - klog.Fatal("couldn't read serviceaccount to get current namespace") - } - - } - - klog.Infof("got current pod namespace '%s'", currentNamespace) - - return currentNamespace -} - -func getConfigMapName() string { - configMapName := os.Getenv("KWOK_PROVIDER_CONFIGMAP") - if strings.TrimSpace(configMapName) == "" { - klog.Infof("env variable 'KWOK_PROVIDER_CONFIGMAP' is empty (defaulting to '%s')", defaultConfigName) - configMapName = defaultConfigName - } - - return configMapName -} - -// LoadConfigFile loads kwok provider config from k8s configmap -func LoadConfigFile(kubeClient kubeclient.Interface) (*KwokProviderConfig, error) { - configMapName := getConfigMapName() - - currentNamespace := getCurrentNamespace() - - c, err := kubeClient.CoreV1().ConfigMaps(currentNamespace).Get(context.Background(), configMapName, v1.GetOptions{}) - if err != nil { - return nil, fmt.Errorf("failed to get configmap '%s': %v", configMapName, err) - } - - decoder := yaml.NewYAMLOrJSONDecoder(strings.NewReader(c.Data[configKey]), 4096) - kwokConfig := KwokProviderConfig{} - if err := decoder.Decode(&kwokConfig); err != nil { - return nil, fmt.Errorf("failed to decode kwok config: %v", err) - } - - if kwokConfig.status == nil { - kwokConfig.status = &GroupingConfig{} - } - - switch kwokConfig.ReadNodesFrom { - case nodeTemplatesFromConfigMap: - - if kwokConfig.ConfigMap == nil { - return nil, fmt.Errorf("please specify a value for 'configmap' in kwok config (currently empty or undefined)") - } - if strings.TrimSpace(kwokConfig.ConfigMap.Name) == "" { - return nil, fmt.Errorf("please specify 'configmap.name' in kwok config (currently empty or undefined)") - } - - case nodeTemplatesFromCluster: - default: - return nil, fmt.Errorf("'readNodesFrom' in kwok config is invalid (expected: '%s' or '%s'): %s", - groupNodesByLabel, groupNodesByAnnotation, - kwokConfig.ReadNodesFrom) - } - - if kwokConfig.Nodegroups == nil { - return nil, fmt.Errorf("please specify a value for 'nodegroups' in kwok config (currently empty or undefined)") - } - - if strings.TrimSpace(kwokConfig.Nodegroups.FromNodeLabelKey) == "" && - strings.TrimSpace(kwokConfig.Nodegroups.FromNodeLabelAnnotation) == "" { - return nil, fmt.Errorf("please specify either 'nodegroups.fromNodeLabelKey' or 'nodegroups.fromNodeAnnotation' in kwok provider config (currently empty or undefined)") - } - if strings.TrimSpace(kwokConfig.Nodegroups.FromNodeLabelKey) != "" && - strings.TrimSpace(kwokConfig.Nodegroups.FromNodeLabelAnnotation) != "" { - return nil, fmt.Errorf("please specify either 'nodegroups.fromNodeLabelKey' or 'nodegroups.fromNodeAnnotation' in kwok provider config (you can't use both)") - } - - if strings.TrimSpace(kwokConfig.Nodegroups.FromNodeLabelKey) != "" { - kwokConfig.status.groupNodesBy = groupNodesByLabel - kwokConfig.status.key = kwokConfig.Nodegroups.FromNodeLabelKey - } else { - kwokConfig.status.groupNodesBy = groupNodesByAnnotation - kwokConfig.status.key = kwokConfig.Nodegroups.FromNodeLabelAnnotation - } - - if kwokConfig.Nodes == nil { - kwokConfig.Nodes = &NodeConfig{} - } else { - - if kwokConfig.Nodes.GPUConfig == nil { - klog.Warningf("nodes.gpuConfig is empty or undefined") - } else { - if kwokConfig.Nodes.GPUConfig.GPULabelKey != "" && - kwokConfig.Nodes.GPUConfig.AvailableGPUTypes != nil { - kwokConfig.status.availableGPUTypes = kwokConfig.Nodes.GPUConfig.AvailableGPUTypes - kwokConfig.status.gpuLabel = kwokConfig.Nodes.GPUConfig.GPULabelKey - } else { - return nil, errors.New("nodes.gpuConfig.gpuLabelKey or file.nodes.gpuConfig.availableGPUTypes is empty") - } - } - - } - - if kwokConfig.Kwok == nil { - kwokConfig.Kwok = &KwokConfig{} - } - - return &kwokConfig, nil -} diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_config_test.go b/cluster-autoscaler/cloudprovider/kwok/kwok_config_test.go deleted file mode 100644 index 8029ab6bb811..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_config_test.go +++ /dev/null @@ -1,285 +0,0 @@ -/* -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 kwok - -import ( - "testing" - - "os" - - "github.com/stretchr/testify/assert" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/kubernetes/fake" - core "k8s.io/client-go/testing" -) - -var testConfigs = map[string]string{ - defaultConfigName: testConfig, - "without-kwok": withoutKwok, - "with-static-kwok-release": withStaticKwokRelease, - "skip-kwok-install": skipKwokInstall, -} - -// with node templates from configmap -const testConfig = ` -apiVersion: v1alpha1 -readNodesFrom: configmap # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "kwok-nodegroup" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -nodes: - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -configmap: - name: kwok-provider-templates -kwok: {} -` - -// with node templates from configmap -const testConfigSkipTaint = ` -apiVersion: v1alpha1 -readNodesFrom: configmap # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "kwok-nodegroup" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -nodes: - skipTaint: true - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -configmap: - name: kwok-provider-templates -kwok: {} -` -const testConfigDynamicTemplates = ` -apiVersion: v1alpha1 -readNodesFrom: cluster # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "kwok-nodegroup" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -nodes: - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -configmap: - name: kwok-provider-templates -kwok: {} -` - -const testConfigDynamicTemplatesSkipTaint = ` -apiVersion: v1alpha1 -readNodesFrom: cluster # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "kwok-nodegroup" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -nodes: - skipTaint: true - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -configmap: - name: kwok-provider-templates -kwok: {} -` - -const withoutKwok = ` -apiVersion: v1alpha1 -readNodesFrom: configmap # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "node.kubernetes.io/instance-type" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -nodes: - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -configmap: - name: kwok-provider-templates -` - -const withStaticKwokRelease = ` -apiVersion: v1alpha1 -readNodesFrom: configmap # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "node.kubernetes.io/instance-type" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -nodes: - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -kwok: - release: "v0.2.1" -configmap: - name: kwok-provider-templates -` - -const skipKwokInstall = ` -apiVersion: v1alpha1 -readNodesFrom: configmap # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "node.kubernetes.io/instance-type" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -nodes: - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -configmap: - name: kwok-provider-templates -kwok: - skipInstall: true -` - -func TestLoadConfigFile(t *testing.T) { - defer func() { - os.Unsetenv("KWOK_PROVIDER_CONFIGMAP") - }() - - fakeClient := &fake.Clientset{} - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - cmName := getConfigMapName() - if getAction.GetName() == cmName { - return true, &v1.ConfigMap{ - Data: map[string]string{ - configKey: testConfigs[cmName], - }, - }, nil - } - - return true, nil, errors.NewNotFound(v1.Resource("configmaps"), "whatever") - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - kwokConfig, err := LoadConfigFile(fakeClient) - assert.Nil(t, err) - assert.NotNil(t, kwokConfig) - assert.NotNil(t, kwokConfig.status) - assert.NotEmpty(t, kwokConfig.status.gpuLabel) - - os.Setenv("KWOK_PROVIDER_CONFIGMAP", "without-kwok") - kwokConfig, err = LoadConfigFile(fakeClient) - assert.Nil(t, err) - assert.NotNil(t, kwokConfig) - assert.NotNil(t, kwokConfig.status) - assert.NotEmpty(t, kwokConfig.status.gpuLabel) - - os.Setenv("KWOK_PROVIDER_CONFIGMAP", "with-static-kwok-release") - kwokConfig, err = LoadConfigFile(fakeClient) - assert.Nil(t, err) - assert.NotNil(t, kwokConfig) - assert.NotNil(t, kwokConfig.status) - assert.NotEmpty(t, kwokConfig.status.gpuLabel) - - os.Setenv("KWOK_PROVIDER_CONFIGMAP", "skip-kwok-install") - kwokConfig, err = LoadConfigFile(fakeClient) - assert.Nil(t, err) - assert.NotNil(t, kwokConfig) - assert.NotNil(t, kwokConfig.status) - assert.NotEmpty(t, kwokConfig.status.gpuLabel) -} diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_constants.go b/cluster-autoscaler/cloudprovider/kwok/kwok_constants.go deleted file mode 100644 index a27099cbd23e..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_constants.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -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 kwok - -const ( - // ProviderName is the cloud provider name for kwok - ProviderName = "kwok" - - //NGNameAnnotation is the annotation kwok provider uses to track the nodegroups - NGNameAnnotation = "cluster-autoscaler.kwok.nodegroup/name" - // NGMinSizeAnnotation is annotation on template nodes which specify min size of the nodegroup - NGMinSizeAnnotation = "cluster-autoscaler.kwok.nodegroup/min-count" - // NGMaxSizeAnnotation is annotation on template nodes which specify max size of the nodegroup - NGMaxSizeAnnotation = "cluster-autoscaler.kwok.nodegroup/max-count" - // NGDesiredSizeAnnotation is annotation on template nodes which specify desired size of the nodegroup - NGDesiredSizeAnnotation = "cluster-autoscaler.kwok.nodegroup/desired-count" - - // KwokManagedAnnotation is the default annotation - // that kwok manages to decide if it should manage - // a node it sees in the cluster - KwokManagedAnnotation = "kwok.x-k8s.io/node" - - groupNodesByAnnotation = "annotation" - groupNodesByLabel = "label" - - // // GPULabel is the label added to nodes with GPU resource. - // GPULabel = "cloud.google.com/gke-accelerator" - - // for kwok provider config - nodeTemplatesFromConfigMap = "configmap" - nodeTemplatesFromCluster = "cluster" -) - -const testTemplates = ` -apiVersion: v1 -items: -- apiVersion: v1 - kind: Node - metadata: - annotations: {} - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-worker - kwok-nodegroup: kind-worker - kubernetes.io/os: linux - k8s.amazonaws.com/accelerator: "nvidia-tesla-k80" - name: kind-worker - spec: - podCIDR: 10.244.2.0/24 - podCIDRs: - - 10.244.2.0/24 - providerID: kind://docker/kind/kind-worker - status: - addresses: - - address: 172.18.0.3 - type: InternalIP - - address: kind-worker - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" -- apiVersion: v1 - kind: Node - metadata: - annotations: {} - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-worker-2 - kubernetes.io/os: linux - k8s.amazonaws.com/accelerator: "nvidia-tesla-k80" - name: kind-worker-2 - spec: - podCIDR: 10.244.2.0/24 - podCIDRs: - - 10.244.2.0/24 - providerID: kind://docker/kind/kind-worker-2 - status: - addresses: - - address: 172.18.0.3 - type: InternalIP - - address: kind-worker-2 - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" -kind: List -metadata: - resourceVersion: "" -` - -// yaml version of fakeNode1, fakeNode2 and fakeNode3 -const testTemplatesMinimal = ` -apiVersion: v1 -items: -- apiVersion: v1 - kind: Node - metadata: - annotations: - cluster-autoscaler.kwok.nodegroup/name: ng1 - labels: - kwok-nodegroup: ng1 - name: node1 - spec: {} -- apiVersion: v1 - kind: Node - metadata: - annotations: - cluster-autoscaler.kwok.nodegroup/name: ng2 - labels: - kwok-nodegroup: ng2 - name: node2 - spec: {} -- apiVersion: v1 - kind: Node - metadata: - annotations: {} - labels: {} - name: node3 - spec: {} -kind: List -metadata: - resourceVersion: "" -` diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_helpers.go b/cluster-autoscaler/cloudprovider/kwok/kwok_helpers.go deleted file mode 100644 index f00400711e35..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_helpers.go +++ /dev/null @@ -1,278 +0,0 @@ -/* -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 kwok - -import ( - "bufio" - "context" - "errors" - "fmt" - "io" - "log" - "strconv" - "strings" - "time" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apimachinery/pkg/util/yaml" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/client-go/kubernetes" - clientscheme "k8s.io/client-go/kubernetes/scheme" - v1lister "k8s.io/client-go/listers/core/v1" - klog "k8s.io/klog/v2" -) - -const ( - templatesKey = "templates" - defaultTemplatesConfigName = "kwok-provider-templates" -) - -type listerFn func(lister v1lister.NodeLister, filter func(*apiv1.Node) bool) kube_util.NodeLister - -func loadNodeTemplatesFromCluster(kc *KwokProviderConfig, - kubeClient kubernetes.Interface, - lister kube_util.NodeLister) ([]*apiv1.Node, error) { - - if lister != nil { - return lister.List() - } - - nodeList, err := kubeClient.CoreV1().Nodes().List(context.Background(), metav1.ListOptions{}) - if err != nil { - return nil, err - } - - nos := []*apiv1.Node{} - // note: not using _, node := range nodeList.Items here because it leads to unexpected behavior - // more info: https://stackoverflow.com/a/38693163/6874596 - for i := range nodeList.Items { - nos = append(nos, &(nodeList.Items[i])) - } - - return nos, nil -} - -// LoadNodeTemplatesFromConfigMap loads template nodes from a k8s configmap -// check https://github.com/vadafoss/node-templates for more info on the parsing logic -func LoadNodeTemplatesFromConfigMap(configMapName string, - kubeClient kubernetes.Interface) ([]*apiv1.Node, error) { - currentNamespace := getCurrentNamespace() - nodeTemplates := []*apiv1.Node{} - - c, err := kubeClient.CoreV1().ConfigMaps(currentNamespace).Get(context.Background(), configMapName, v1.GetOptions{}) - if err != nil { - return nil, fmt.Errorf("failed to get configmap '%s': %v", configMapName, err) - } - - if c.Data[templatesKey] == "" { - return nil, fmt.Errorf("configmap '%s' doesn't have 'templates' key", configMapName) - } - - scheme := runtime.NewScheme() - clientscheme.AddToScheme(scheme) - - decoder := serializer.NewCodecFactory(scheme).UniversalDeserializer() - - multiDocReader := yaml.NewYAMLReader(bufio.NewReader(strings.NewReader(c.Data[templatesKey]))) - - objs := []runtime.Object{} - - for { - buf, err := multiDocReader.Read() - if err != nil { - if err == io.EOF { - break - } - return nil, err - } - - obj, _, err := decoder.Decode(buf, nil, nil) - if err != nil { - return nil, err - } - - objs = append(objs, obj) - } - - if len(objs) > 1 { - for _, obj := range objs { - if node, ok := obj.(*apiv1.Node); ok { - nodeTemplates = append(nodeTemplates, node) - } - } - - } else if nodelist, ok := objs[0].(*apiv1.List); ok { - for _, item := range nodelist.Items { - - o, _, err := decoder.Decode(item.Raw, nil, nil) - if err != nil { - return nil, err - } - - if node, ok := o.(*apiv1.Node); ok { - nodeTemplates = append(nodeTemplates, node) - } - } - } else { - return nil, errors.New("invalid templates file (found something other than nodes in the file)") - } - - return nodeTemplates, nil -} - -func createNodegroups(nodes []*apiv1.Node, kubeClient kubernetes.Interface, kc *KwokProviderConfig, initCustomLister listerFn, - allNodeLister v1lister.NodeLister) []*NodeGroup { - ngs := map[string]*NodeGroup{} - - // note: not using _, node := range nodes here because it leads to unexpected behavior - // more info: https://stackoverflow.com/a/38693163/6874596 - for i := range nodes { - - belongsToNg := ((kc.status.groupNodesBy == groupNodesByAnnotation && - nodes[i].GetAnnotations()[kc.status.key] != "") || - (kc.status.groupNodesBy == groupNodesByLabel && - nodes[i].GetLabels()[kc.status.key] != "")) - if !belongsToNg { - continue - } - - ngName := getNGName(nodes[i], kc) - if ngs[ngName] != nil { - ngs[ngName].targetSize += 1 - continue - } - - ng := parseAnnotations(nodes[i], kc) - ng.name = getNGName(nodes[i], kc) - sanitizeNode(nodes[i]) - prepareNode(nodes[i], ng.name) - ng.nodeTemplate = nodes[i] - - filterFn := func(no *apiv1.Node) bool { - return no.GetAnnotations()[NGNameAnnotation] == ng.name - } - - ng.kubeClient = kubeClient - ng.lister = initCustomLister(allNodeLister, filterFn) - - ngs[ngName] = ng - } - - result := []*NodeGroup{} - for i := range ngs { - result = append(result, ngs[i]) - } - return result -} - -// sanitizeNode cleans the node -func sanitizeNode(no *apiv1.Node) { - no.ResourceVersion = "" - no.Generation = 0 - no.UID = "" - no.CreationTimestamp = v1.Time{} - no.Status.NodeInfo.KubeletVersion = "fake" - -} - -// prepareNode prepares node as a kwok template node -func prepareNode(no *apiv1.Node, ngName string) { - // add prefix in the name to make it clear that this node is different - // from the ones already existing in the cluster (in case there is a name clash) - no.Name = fmt.Sprintf("kwok-fake-%s", no.GetName()) - no.Annotations[KwokManagedAnnotation] = "fake" - no.Annotations[NGNameAnnotation] = ngName - no.Spec.ProviderID = getProviderID(no.GetName()) -} - -func getProviderID(nodeName string) string { - return fmt.Sprintf("kwok:%s", nodeName) -} - -func parseAnnotations(no *apiv1.Node, kc *KwokProviderConfig) *NodeGroup { - min := 0 - max := 200 - target := min - if no.GetAnnotations()[NGMinSizeAnnotation] != "" { - if mi, err := strconv.Atoi(no.GetAnnotations()[NGMinSizeAnnotation]); err == nil { - min = mi - } else { - klog.Fatalf("invalid value for annotation key '%s' for node '%s'", NGMinSizeAnnotation, no.GetName()) - } - } - - if no.GetAnnotations()[NGMaxSizeAnnotation] != "" { - if ma, err := strconv.Atoi(no.GetAnnotations()[NGMaxSizeAnnotation]); err == nil { - max = ma - } else { - klog.Fatalf("invalid value for annotation key '%s' for node '%s'", NGMaxSizeAnnotation, no.GetName()) - } - } - - if no.GetAnnotations()[NGDesiredSizeAnnotation] != "" { - if ta, err := strconv.Atoi(no.GetAnnotations()[NGDesiredSizeAnnotation]); err == nil { - target = ta - } else { - klog.Fatalf("invalid value for annotation key '%s' for node '%s'", NGDesiredSizeAnnotation, no.GetName()) - } - } - - if max < min { - log.Fatalf("min-count '%d' cannot be lesser than max-count '%d' for the node '%s'", min, max, no.GetName()) - } - - if target > max || target < min { - log.Fatalf("desired-count '%d' cannot be lesser than min-count '%d' or greater than max-count '%d' for the node '%s'", target, min, max, no.GetName()) - } - - return &NodeGroup{ - minSize: min, - maxSize: max, - targetSize: target, - } -} - -func getNGName(no *apiv1.Node, kc *KwokProviderConfig) string { - - if no.GetAnnotations()[NGNameAnnotation] != "" { - return no.GetAnnotations()[NGNameAnnotation] - } - - var ngName string - switch kc.status.groupNodesBy { - case "annotation": - ngName = no.GetAnnotations()[kc.status.key] - case "label": - ngName = no.GetLabels()[kc.status.key] - default: - klog.Fatal("grouping criteria for nodes is not set (expected: 'annotation' or 'label')") - } - - if ngName == "" { - klog.Fatalf("%s '%s' for node '%s' not present in the manifest", - kc.status.groupNodesBy, kc.status.key, - no.GetName()) - } - - ngName = fmt.Sprintf("%s-%v", ngName, time.Now().Unix()) - - return ngName -} diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_helpers_test.go b/cluster-autoscaler/cloudprovider/kwok/kwok_helpers_test.go deleted file mode 100644 index b32181360b50..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_helpers_test.go +++ /dev/null @@ -1,890 +0,0 @@ -/* -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 kwok - -import ( - "os" - "testing" - - "github.com/stretchr/testify/assert" - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/kubernetes/fake" - core "k8s.io/client-go/testing" -) - -const multipleNodes = ` -apiVersion: v1 -kind: Node -metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:16Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-control-plane - kwok-nodegroup: control-plane - kubernetes.io/os: linux - node-role.kubernetes.io/control-plane: "" - node.kubernetes.io/exclude-from-external-load-balancers: "" - name: kind-control-plane - resourceVersion: "603" - uid: 86716ec7-3071-4091-b055-77b4361d1dca -spec: - podCIDR: 10.244.0.0/24 - podCIDRs: - - 10.244.0.0/24 - providerID: kind://docker/kind/kind-control-plane - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/control-plane -status: - addresses: - - address: 172.18.0.2 - type: InternalIP - - address: kind-control-plane - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:40:29Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:40:29Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:40:29Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:40:29Z" - lastTransitionTime: "2023-05-31T04:39:46Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - - docker.io/kindest/local-path-provisioner@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: 96f8c8b8c8ae4600a3654341f207586e - operatingSystem: linux - osImage: Ubuntu - systemUUID: 111aa932-7f99-4bef-aaf7-36aa7fb9b012 ---- - -apiVersion: v1 -kind: Node -metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:57Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-worker - kwok-nodegroup: kind-worker - kubernetes.io/os: linux - name: kind-worker - resourceVersion: "577" - uid: 2ac0eb71-e5cf-4708-bbbf-476e8f19842b -spec: - podCIDR: 10.244.2.0/24 - podCIDRs: - - 10.244.2.0/24 - providerID: kind://docker/kind/kind-worker -status: - addresses: - - address: 172.18.0.3 - type: InternalIP - - address: kind-worker - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:40:05Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: a98a13ff474d476294935341f1ba9816 - operatingSystem: linux - osImage: Ubuntu - systemUUID: 5f3c1af8-a385-4776-85e4-73d7f4252b44 -` - -const nodeList = ` -apiVersion: v1 -items: -- apiVersion: v1 - kind: Node - metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:16Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-control-plane - kwok-nodegroup: control-plane - kubernetes.io/os: linux - node-role.kubernetes.io/control-plane: "" - node.kubernetes.io/exclude-from-external-load-balancers: "" - name: kind-control-plane - resourceVersion: "506" - uid: 86716ec7-3071-4091-b055-77b4361d1dca - spec: - podCIDR: 10.244.0.0/24 - podCIDRs: - - 10.244.0.0/24 - providerID: kind://docker/kind/kind-control-plane - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/control-plane - status: - addresses: - - address: 172.18.0.2 - type: InternalIP - - address: kind-control-plane - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:39:58Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:39:58Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:39:58Z" - lastTransitionTime: "2023-05-31T04:39:13Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:39:58Z" - lastTransitionTime: "2023-05-31T04:39:46Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: 96f8c8b8c8ae4600a3654341f207586e - operatingSystem: linux - osImage: Ubuntu - systemUUID: 111aa932-7f99-4bef-aaf7-36aa7fb9b012 -- apiVersion: v1 - kind: Node - metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:57Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-worker - kwok-nodegroup: kind-worker - kubernetes.io/os: linux - name: kind-worker - resourceVersion: "577" - uid: 2ac0eb71-e5cf-4708-bbbf-476e8f19842b - spec: - podCIDR: 10.244.2.0/24 - podCIDRs: - - 10.244.2.0/24 - providerID: kind://docker/kind/kind-worker - status: - addresses: - - address: 172.18.0.3 - type: InternalIP - - address: kind-worker - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:40:05Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: a98a13ff474d476294935341f1ba9816 - operatingSystem: linux - osImage: Ubuntu - systemUUID: 5f3c1af8-a385-4776-85e4-73d7f4252b44 -kind: List -metadata: - resourceVersion: "" -` - -const wrongIndentation = ` -apiVersion: v1 - items: - - apiVersion: v1 -# everything below should be in-line with apiVersion above - kind: Node -metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:57Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-worker - kwok-nodegroup: kind-worker - kubernetes.io/os: linux - name: kind-worker - resourceVersion: "577" - uid: 2ac0eb71-e5cf-4708-bbbf-476e8f19842b -spec: - podCIDR: 10.244.2.0/24 - podCIDRs: - - 10.244.2.0/24 - providerID: kind://docker/kind/kind-worker -status: - addresses: - - address: 172.18.0.3 - type: InternalIP - - address: kind-worker - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:40:05Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: a98a13ff474d476294935341f1ba9816 - operatingSystem: linux - osImage: Ubuntu 22.04.2 LTS - systemUUID: 5f3c1af8-a385-4776-85e4-73d7f4252b44 -kind: List -metadata: - resourceVersion: "" -` - -const noGPULabel = ` -apiVersion: v1 -items: -- apiVersion: v1 - kind: Node - metadata: - annotations: - kubeadm.alpha.kubernetes.io/cri-socket: unix:///run/containerd/containerd.sock - node.alpha.kubernetes.io/ttl: "0" - volumes.kubernetes.io/controller-managed-attach-detach: "true" - creationTimestamp: "2023-05-31T04:39:57Z" - labels: - beta.kubernetes.io/arch: amd64 - beta.kubernetes.io/os: linux - kubernetes.io/arch: amd64 - kubernetes.io/hostname: kind-worker - kwok-nodegroup: kind-worker - kubernetes.io/os: linux - name: kind-worker - resourceVersion: "577" - uid: 2ac0eb71-e5cf-4708-bbbf-476e8f19842b - spec: - podCIDR: 10.244.2.0/24 - podCIDRs: - - 10.244.2.0/24 - providerID: kind://docker/kind/kind-worker - status: - addresses: - - address: 172.18.0.3 - type: InternalIP - - address: kind-worker - type: Hostname - allocatable: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - capacity: - cpu: "12" - ephemeral-storage: 959786032Ki - hugepages-1Gi: "0" - hugepages-2Mi: "0" - memory: 32781516Ki - pods: "110" - conditions: - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient memory available - reason: KubeletHasSufficientMemory - status: "False" - type: MemoryPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has no disk pressure - reason: KubeletHasNoDiskPressure - status: "False" - type: DiskPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:39:57Z" - message: kubelet has sufficient PID available - reason: KubeletHasSufficientPID - status: "False" - type: PIDPressure - - lastHeartbeatTime: "2023-05-31T04:40:17Z" - lastTransitionTime: "2023-05-31T04:40:05Z" - message: kubelet is posting ready status - reason: KubeletReady - status: "True" - type: Ready - daemonEndpoints: - kubeletEndpoint: - Port: 10250 - images: - - names: - - registry.k8s.io/etcd:3.5.6-0 - sizeBytes: 102542580 - - names: - - docker.io/library/import-2023-03-30@sha256:ba097b515c8c40689733c0f19de377e9bf8995964b7d7150c2045f3dfd166657 - - registry.k8s.io/kube-apiserver:v1.26.3 - sizeBytes: 80392681 - - names: - - docker.io/library/import-2023-03-30@sha256:8dbb345de79d1c44f59a7895da702a5f71997ae72aea056609445c397b0c10dc - - registry.k8s.io/kube-controller-manager:v1.26.3 - sizeBytes: 68538487 - - names: - - docker.io/library/import-2023-03-30@sha256:44db4d50a5f9c8efbac0d37ea974d1c0419a5928f90748d3d491a041a00c20b5 - - registry.k8s.io/kube-proxy:v1.26.3 - sizeBytes: 67217404 - - names: - - docker.io/library/import-2023-03-30@sha256:3dd2337f70af979c7362b5e52bbdfcb3a5fd39c78d94d02145150cd2db86ba39 - - registry.k8s.io/kube-scheduler:v1.26.3 - sizeBytes: 57761399 - - names: - - docker.io/kindest/kindnetd:v20230330-48f316cd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - - docker.io/kindest/kindnetd@sha256:c19d6362a6a928139820761475a38c24c0cf84d507b9ddf414a078cf627497af - sizeBytes: 27726335 - - names: - - docker.io/kindest/local-path-provisioner:v0.0.23-kind.0@sha256:f2d0a02831ff3a03cf51343226670d5060623b43a4cfc4808bd0875b2c4b9501 - sizeBytes: 18664669 - - names: - - registry.k8s.io/coredns/coredns:v1.9.3 - sizeBytes: 14837849 - - names: - - docker.io/kindest/local-path-helper:v20230330-48f316cd@sha256:135203f2441f916fb13dad1561d27f60a6f11f50ec288b01a7d2ee9947c36270 - sizeBytes: 3052037 - - names: - - registry.k8s.io/pause:3.7 - sizeBytes: 311278 - nodeInfo: - architecture: amd64 - bootID: 2d71b318-5d07-4de2-9e61-2da28cf5bbf0 - containerRuntimeVersion: containerd://1.6.19-46-g941215f49 - kernelVersion: 5.15.0-72-generic - kubeProxyVersion: v1.26.3 - kubeletVersion: v1.26.3 - machineID: a98a13ff474d476294935341f1ba9816 - operatingSystem: linux - osImage: Ubuntu 22.04.2 LTS - systemUUID: 5f3c1af8-a385-4776-85e4-73d7f4252b44 -kind: List -metadata: - resourceVersion: "" -` - -func TestLoadNodeTemplatesFromConfigMap(t *testing.T) { - var testTemplatesMap = map[string]string{ - "wrongIndentation": wrongIndentation, - defaultTemplatesConfigName: testTemplates, - "multipleNodes": multipleNodes, - "nodeList": nodeList, - } - - testTemplateName := defaultTemplatesConfigName - - fakeClient := &fake.Clientset{} - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - if getAction.GetName() == defaultConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - } - - if testTemplatesMap[testTemplateName] != "" { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplatesMap[testTemplateName], - }, - }, nil - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.NodeList{Items: []apiv1.Node{}}, errors.NewNotFound(apiv1.Resource("nodes"), "whatever") - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - kwokConfig, err := LoadConfigFile(fakeClient) - assert.Nil(t, err) - - // happy path - testTemplateName = defaultTemplatesConfigName - nos, err := LoadNodeTemplatesFromConfigMap(kwokConfig.ConfigMap.Name, fakeClient) - assert.Nil(t, err) - assert.NotEmpty(t, nos) - assert.Greater(t, len(nos), 0) - - testTemplateName = "wrongIndentation" - nos, err = LoadNodeTemplatesFromConfigMap(kwokConfig.ConfigMap.Name, fakeClient) - assert.Error(t, err) - assert.Empty(t, nos) - assert.Equal(t, len(nos), 0) - - // multiple nodes is something like []*Node{node1, node2, node3, ...} - testTemplateName = "multipleNodes" - nos, err = LoadNodeTemplatesFromConfigMap(kwokConfig.ConfigMap.Name, fakeClient) - assert.Nil(t, err) - assert.NotEmpty(t, nos) - assert.Greater(t, len(nos), 0) - - // node list is something like []*List{Items:[]*Node{node1, node2, node3, ...}} - testTemplateName = "nodeList" - nos, err = LoadNodeTemplatesFromConfigMap(kwokConfig.ConfigMap.Name, fakeClient) - assert.Nil(t, err) - assert.NotEmpty(t, nos) - assert.Greater(t, len(nos), 0) - - // fake client which returns configmap with wrong key - fakeClient = &fake.Clientset{} - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - "foo": testTemplatesMap[testTemplateName], - }, - }, nil - }) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.NodeList{Items: []apiv1.Node{}}, errors.NewNotFound(apiv1.Resource("nodes"), "whatever") - }) - - // throw error if configmap data key is not `templates` - nos, err = LoadNodeTemplatesFromConfigMap(kwokConfig.ConfigMap.Name, fakeClient) - assert.Error(t, err) - assert.Empty(t, nos) - assert.Equal(t, len(nos), 0) -} diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_nodegroups.go b/cluster-autoscaler/cloudprovider/kwok/kwok_nodegroups.go deleted file mode 100644 index 32db81581cfd..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_nodegroups.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -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 kwok - -import ( - "context" - "fmt" - - apiv1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/rand" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/config" - klog "k8s.io/klog/v2" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" -) - -var ( - sizeIncreaseMustBePositiveErr = "size increase must be positive" - maxSizeReachedErr = "size increase too large" - minSizeReachedErr = "min size reached, nodes will not be deleted" - belowMinSizeErr = "can't delete nodes because nodegroup size would go below min size" - notManagedByKwokErr = "can't delete node '%v' because it is not managed by kwok" - sizeDecreaseMustBeNegativeErr = "size decrease must be negative" - attemptToDeleteExistingNodesErr = "attempt to delete existing nodes" -) - -// MaxSize returns maximum size of the node group. -func (nodeGroup *NodeGroup) MaxSize() int { - return nodeGroup.maxSize -} - -// MinSize returns minimum size of the node group. -func (nodeGroup *NodeGroup) MinSize() int { - return nodeGroup.minSize -} - -// TargetSize returns the current TARGET size of the node group. It is possible that the -// number is different from the number of nodes registered in Kubernetes. -func (nodeGroup *NodeGroup) TargetSize() (int, error) { - return nodeGroup.targetSize, nil -} - -// IncreaseSize increases NodeGroup size. -func (nodeGroup *NodeGroup) IncreaseSize(delta int) error { - if delta <= 0 { - return fmt.Errorf(sizeIncreaseMustBePositiveErr) - } - size := nodeGroup.targetSize - newSize := int(size) + delta - if newSize > nodeGroup.MaxSize() { - return fmt.Errorf("%s, desired: %d max: %d", maxSizeReachedErr, newSize, nodeGroup.MaxSize()) - } - - klog.V(5).Infof("increasing size of nodegroup '%s' to %v (old size: %v, delta: %v)", nodeGroup.name, newSize, size, delta) - - schedNode, err := nodeGroup.TemplateNodeInfo() - if err != nil { - return fmt.Errorf("couldn't create a template node for nodegroup %s", nodeGroup.name) - } - - for i := 0; i < delta; i++ { - node := schedNode.Node() - node.Name = fmt.Sprintf("%s-%s", nodeGroup.name, rand.String(5)) - node.Spec.ProviderID = getProviderID(node.Name) - _, err := nodeGroup.kubeClient.CoreV1().Nodes().Create(context.Background(), node, v1.CreateOptions{}) - if err != nil { - return fmt.Errorf("couldn't create new node '%s': %v", node.Name, err) - } - } - - nodeGroup.targetSize = newSize - - return nil -} - -// DeleteNodes deletes the specified nodes from the node group. -func (nodeGroup *NodeGroup) DeleteNodes(nodes []*apiv1.Node) error { - size := nodeGroup.targetSize - if size <= nodeGroup.MinSize() { - return fmt.Errorf(minSizeReachedErr) - } - - if size-len(nodes) < nodeGroup.MinSize() { - return fmt.Errorf(belowMinSizeErr) - } - - for _, node := range nodes { - // TODO(vadasambar): check if there's a better way than returning an error here - if node.GetAnnotations()[KwokManagedAnnotation] != "fake" { - return fmt.Errorf(notManagedByKwokErr, node.GetName()) - } - - // TODO(vadasambar): proceed to delete the next node if the current node deletion errors - // TODO(vadasambar): collect all the errors and return them after attempting to delete all the nodes to be deleted - err := nodeGroup.kubeClient.CoreV1().Nodes().Delete(context.Background(), node.GetName(), v1.DeleteOptions{}) - if err != nil { - return err - } - } - return nil -} - -// DecreaseTargetSize decreases the target size of the node group. This function -// doesn't permit to delete any existing node and can be used only to reduce the -// request for new nodes that have not been yet fulfilled. Delta should be negative. -func (nodeGroup *NodeGroup) DecreaseTargetSize(delta int) error { - if delta >= 0 { - return fmt.Errorf(sizeDecreaseMustBeNegativeErr) - } - size := nodeGroup.targetSize - nodes, err := nodeGroup.getNodeNamesForNodeGroup() - if err != nil { - return err - } - newSize := int(size) + delta - if newSize < len(nodes) { - return fmt.Errorf("%s, targetSize: %d delta: %d existingNodes: %d", - attemptToDeleteExistingNodesErr, size, delta, len(nodes)) - } - - nodeGroup.targetSize = newSize - - return nil -} - -// getNodeNamesForNodeGroup returns list of nodes belonging to the nodegroup -func (nodeGroup *NodeGroup) getNodeNamesForNodeGroup() ([]string, error) { - names := []string{} - - nodeList, err := nodeGroup.lister.List() - if err != nil { - return names, err - } - - for _, no := range nodeList { - names = append(names, no.GetName()) - } - - return names, nil -} - -// Id returns nodegroup name. -func (nodeGroup *NodeGroup) Id() string { - return nodeGroup.name -} - -// Debug returns a debug string for the nodegroup. -func (nodeGroup *NodeGroup) Debug() string { - return fmt.Sprintf("%s (%d:%d)", nodeGroup.Id(), nodeGroup.MinSize(), nodeGroup.MaxSize()) -} - -// Nodes returns a list of all nodes that belong to this node group. -func (nodeGroup *NodeGroup) Nodes() ([]cloudprovider.Instance, error) { - instances := make([]cloudprovider.Instance, 0) - nodeNames, err := nodeGroup.getNodeNamesForNodeGroup() - if err != nil { - return instances, err - } - for _, nodeName := range nodeNames { - instances = append(instances, cloudprovider.Instance{Id: getProviderID(nodeName), Status: &cloudprovider.InstanceStatus{ - State: cloudprovider.InstanceRunning, - ErrorInfo: nil, - }}) - } - return instances, nil -} - -// TemplateNodeInfo returns a node template for this node group. -func (nodeGroup *NodeGroup) TemplateNodeInfo() (*schedulerframework.NodeInfo, error) { - nodeInfo := schedulerframework.NewNodeInfo(cloudprovider.BuildKubeProxy(nodeGroup.Id())) - nodeInfo.SetNode(nodeGroup.nodeTemplate) - - return nodeInfo, nil -} - -// Exist checks if the node group really exists on the cloud provider side. -// Since kwok nodegroup is not backed by anything on cloud provider side -// We can safely return `true` here -func (nodeGroup *NodeGroup) Exist() bool { - return true -} - -// Create creates the node group on the cloud provider side. -// Left unimplemented because Create is not used anywhere -// in the core autoscaler as of writing this -func (nodeGroup *NodeGroup) Create() (cloudprovider.NodeGroup, error) { - return nil, cloudprovider.ErrNotImplemented -} - -// Delete deletes the node group on the cloud provider side. -// Left unimplemented because Delete is not used anywhere -// in the core autoscaler as of writing this -func (nodeGroup *NodeGroup) Delete() error { - return cloudprovider.ErrNotImplemented -} - -// Autoprovisioned returns true if the node group is autoprovisioned. -func (nodeGroup *NodeGroup) Autoprovisioned() bool { - return false -} - -// GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular -// NodeGroup. Returning a nil will result in using default options. -func (nodeGroup *NodeGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) { - return &defaults, nil -} diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_nodegroups_test.go b/cluster-autoscaler/cloudprovider/kwok/kwok_nodegroups_test.go deleted file mode 100644 index 5604f1bac6a7..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_nodegroups_test.go +++ /dev/null @@ -1,360 +0,0 @@ -/* -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 kwok - -import ( - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/assert" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/config" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/client-go/kubernetes/fake" - core "k8s.io/client-go/testing" -) - -func TestIncreaseSize(t *testing.T) { - fakeClient := &fake.Clientset{} - - nodes := []*apiv1.Node{} - - fakeClient.Fake.AddReactor("create", "nodes", - func(action core.Action) (bool, runtime.Object, error) { - createAction := action.(core.CreateAction) - if createAction == nil { - return false, nil, nil - } - - nodes = append(nodes, createAction.GetObject().(*apiv1.Node)) - - return true, nil, nil - }) - - ng := NodeGroup{ - name: "ng", - kubeClient: fakeClient, - lister: kube_util.NewTestNodeLister(nil), - nodeTemplate: &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "template-node-ng", - }, - }, - minSize: 0, - targetSize: 2, - maxSize: 3, - } - - // usual case - err := ng.IncreaseSize(1) - assert.Nil(t, err) - assert.Len(t, nodes, 1) - assert.Equal(t, 3, ng.targetSize) - for _, n := range nodes { - assert.Contains(t, n.Spec.ProviderID, "kwok") - assert.Contains(t, n.GetName(), ng.name) - } - - // delta is negative - nodes = []*apiv1.Node{} - err = ng.IncreaseSize(-1) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), sizeIncreaseMustBePositiveErr) - assert.Len(t, nodes, 0) - - // delta is greater than max size - nodes = []*apiv1.Node{} - err = ng.IncreaseSize(ng.maxSize + 1) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), maxSizeReachedErr) - assert.Len(t, nodes, 0) - -} - -func TestDeleteNodes(t *testing.T) { - fakeClient := &fake.Clientset{} - - deletedNodes := make(map[string]bool) - fakeClient.Fake.AddReactor("delete", "nodes", func(action core.Action) (bool, runtime.Object, error) { - deleteAction := action.(core.DeleteAction) - - if deleteAction == nil { - return false, nil, nil - } - - deletedNodes[deleteAction.GetName()] = true - - return true, nil, nil - - }) - - ng := NodeGroup{ - name: "ng", - kubeClient: fakeClient, - lister: kube_util.NewTestNodeLister(nil), - nodeTemplate: &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "template-node-ng", - }, - }, - minSize: 0, - targetSize: 1, - maxSize: 3, - } - - nodeToDelete1 := &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "node-to-delete-1", - Annotations: map[string]string{ - KwokManagedAnnotation: "fake", - }, - }, - } - - nodeToDelete2 := &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "node-to-delete-2", - Annotations: map[string]string{ - KwokManagedAnnotation: "fake", - }, - }, - } - - nodeWithoutKwokAnnotation := &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "node-to-delete-3", - Annotations: map[string]string{}, - }, - } - - // usual case - err := ng.DeleteNodes([]*apiv1.Node{nodeToDelete1}) - assert.Nil(t, err) - assert.True(t, deletedNodes[nodeToDelete1.GetName()]) - - // min size reached - deletedNodes = make(map[string]bool) - ng.targetSize = 0 - err = ng.DeleteNodes([]*apiv1.Node{nodeToDelete1}) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), minSizeReachedErr) - assert.False(t, deletedNodes[nodeToDelete1.GetName()]) - ng.targetSize = 1 - - // too many nodes to delete - goes below ng's minSize - deletedNodes = make(map[string]bool) - err = ng.DeleteNodes([]*apiv1.Node{nodeToDelete1, nodeToDelete2}) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), belowMinSizeErr) - assert.False(t, deletedNodes[nodeToDelete1.GetName()]) - assert.False(t, deletedNodes[nodeToDelete2.GetName()]) - - // kwok annotation is not present on the node to delete - deletedNodes = make(map[string]bool) - err = ng.DeleteNodes([]*apiv1.Node{nodeWithoutKwokAnnotation}) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), "not managed by kwok") - assert.False(t, deletedNodes[nodeWithoutKwokAnnotation.GetName()]) - -} - -func TestDecreaseTargetSize(t *testing.T) { - fakeClient := &fake.Clientset{} - - fakeNodes := []*apiv1.Node{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "node-1", - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "node-2", - }, - }, - } - - ng := NodeGroup{ - name: "ng", - kubeClient: fakeClient, - lister: kube_util.NewTestNodeLister(fakeNodes), - nodeTemplate: &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "template-node-ng", - }, - }, - minSize: 0, - targetSize: 3, - maxSize: 4, - } - - // usual case - err := ng.DecreaseTargetSize(-1) - assert.Nil(t, err) - assert.Equal(t, 2, ng.targetSize) - - // delta is positive - ng.targetSize = 3 - err = ng.DecreaseTargetSize(1) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), sizeDecreaseMustBeNegativeErr) - assert.Equal(t, 3, ng.targetSize) - - // attempt to delete existing nodes - err = ng.DecreaseTargetSize(-2) - assert.NotNil(t, err) - assert.Contains(t, err.Error(), attemptToDeleteExistingNodesErr) - assert.Equal(t, 3, ng.targetSize) - - // error from lister - ng.lister = &ErroneousNodeLister{} - err = ng.DecreaseTargetSize(-1) - assert.NotNil(t, err) - assert.Equal(t, cloudprovider.ErrNotImplemented.Error(), err.Error()) - assert.Equal(t, 3, ng.targetSize) - ng.lister = kube_util.NewTestNodeLister(fakeNodes) -} - -func TestNodes(t *testing.T) { - fakeClient := &fake.Clientset{} - - fakeNodes := []*apiv1.Node{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "node-1", - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Name: "node-2", - }, - }, - } - - ng := NodeGroup{ - name: "ng", - kubeClient: fakeClient, - lister: kube_util.NewTestNodeLister(fakeNodes), - nodeTemplate: &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "template-node-ng", - }, - }, - minSize: 0, - targetSize: 2, - maxSize: 3, - } - - // usual case - cpInstances, err := ng.Nodes() - assert.Nil(t, err) - assert.Len(t, cpInstances, 2) - for i := range cpInstances { - assert.Contains(t, cpInstances[i].Id, fakeNodes[i].GetName()) - assert.Equal(t, &cloudprovider.InstanceStatus{ - State: cloudprovider.InstanceRunning, - ErrorInfo: nil, - }, cpInstances[i].Status) - } - - // error from lister - ng.lister = &ErroneousNodeLister{} - cpInstances, err = ng.Nodes() - assert.NotNil(t, err) - assert.Len(t, cpInstances, 0) - assert.Equal(t, cloudprovider.ErrNotImplemented.Error(), err.Error()) - -} - -func TestTemplateNodeInfo(t *testing.T) { - fakeClient := &fake.Clientset{} - - ng := NodeGroup{ - name: "ng", - kubeClient: fakeClient, - lister: kube_util.NewTestNodeLister(nil), - nodeTemplate: &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "template-node-ng", - }, - }, - minSize: 0, - targetSize: 2, - maxSize: 3, - } - - // usual case - ti, err := ng.TemplateNodeInfo() - assert.Nil(t, err) - assert.NotNil(t, ti) - assert.Len(t, ti.Pods, 1) - assert.Contains(t, ti.Pods[0].Pod.Name, fmt.Sprintf("kube-proxy-%s", ng.name)) - assert.Equal(t, ng.nodeTemplate, ti.Node()) - -} - -func TestGetOptions(t *testing.T) { - fakeClient := &fake.Clientset{} - - ng := NodeGroup{ - name: "ng", - kubeClient: fakeClient, - lister: kube_util.NewTestNodeLister(nil), - nodeTemplate: &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Name: "template-node-ng", - }, - }, - minSize: 0, - targetSize: 2, - maxSize: 3, - } - - // dummy values - autoscalingOptions := config.NodeGroupAutoscalingOptions{ - ScaleDownUtilizationThreshold: 50.0, - ScaleDownGpuUtilizationThreshold: 50.0, - ScaleDownUnneededTime: time.Minute * 5, - ScaleDownUnreadyTime: time.Minute * 5, - MaxNodeProvisionTime: time.Minute * 5, - ZeroOrMaxNodeScaling: true, - IgnoreDaemonSetsUtilization: true, - } - - // usual case - opts, err := ng.GetOptions(autoscalingOptions) - assert.Nil(t, err) - assert.Equal(t, autoscalingOptions, *opts) - -} - -// ErroneousNodeLister is used to check if the caller function throws an error -// if lister throws an error -type ErroneousNodeLister struct { -} - -func (e *ErroneousNodeLister) List() ([]*apiv1.Node, error) { - return nil, cloudprovider.ErrNotImplemented -} - -func (e *ErroneousNodeLister) Get(name string) (*apiv1.Node, error) { - return nil, cloudprovider.ErrNotImplemented -} diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_provider.go b/cluster-autoscaler/cloudprovider/kwok/kwok_provider.go deleted file mode 100644 index 76be214f1314..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_provider.go +++ /dev/null @@ -1,257 +0,0 @@ -/* -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 kwok - -import ( - "context" - "fmt" - "os" - "strings" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/config" - "k8s.io/autoscaler/cluster-autoscaler/utils/errors" - "k8s.io/autoscaler/cluster-autoscaler/utils/gpu" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/client-go/informers" - kubeclient "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - klog "k8s.io/klog/v2" -) - -// Name returns name of the cloud provider. -func (kwok *KwokCloudProvider) Name() string { - return ProviderName -} - -// NodeGroups returns all node groups configured for this cloud provider. -func (kwok *KwokCloudProvider) NodeGroups() []cloudprovider.NodeGroup { - result := make([]cloudprovider.NodeGroup, 0, len(kwok.nodeGroups)) - for _, nodegroup := range kwok.nodeGroups { - result = append(result, nodegroup) - } - return result -} - -// NodeGroupForNode returns the node group for the given node. -func (kwok *KwokCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error) { - // Skip nodes that are not managed by kwok cloud provider. - if !strings.HasPrefix(node.Spec.ProviderID, ProviderName) { - klog.V(2).Infof("ignoring node '%s' because it is not managed by kwok", node.GetName()) - return nil, nil - } - - for _, nodeGroup := range kwok.nodeGroups { - if nodeGroup.name == getNGName(node, kwok.config) { - klog.V(5).Infof("found nodegroup '%s' for node '%s'", nodeGroup.name, node.GetName()) - return nodeGroup, nil - } - } - return nil, nil -} - -// HasInstance returns whether a given node has a corresponding instance in this cloud provider -// Since there is no underlying cloud provider instance, return true -func (kwok *KwokCloudProvider) HasInstance(node *apiv1.Node) (bool, error) { - return true, nil -} - -// Pricing returns pricing model for this cloud provider or error if not available. -func (kwok *KwokCloudProvider) Pricing() (cloudprovider.PricingModel, errors.AutoscalerError) { - return nil, cloudprovider.ErrNotImplemented -} - -// GetAvailableMachineTypes get all machine types that can be requested from the cloud provider. -// Implementation optional. -func (kwok *KwokCloudProvider) GetAvailableMachineTypes() ([]string, error) { - return []string{}, cloudprovider.ErrNotImplemented -} - -// NewNodeGroup builds a theoretical node group based on the node definition provided. -func (kwok *KwokCloudProvider) NewNodeGroup(machineType string, labels map[string]string, systemLabels map[string]string, - taints []apiv1.Taint, - extraResources map[string]resource.Quantity) (cloudprovider.NodeGroup, error) { - return nil, cloudprovider.ErrNotImplemented -} - -// GetResourceLimiter returns struct containing limits (max, min) for resources (cores, memory etc.). -func (kwok *KwokCloudProvider) GetResourceLimiter() (*cloudprovider.ResourceLimiter, error) { - return kwok.resourceLimiter, nil -} - -// GPULabel returns the label added to nodes with GPU resource. -func (kwok *KwokCloudProvider) GPULabel() string { - // GPULabel() might get called before the config is loaded - if kwok.config == nil || kwok.config.status == nil { - return "" - } - return kwok.config.status.gpuLabel -} - -// GetAvailableGPUTypes return all available GPU types cloud provider supports -func (kwok *KwokCloudProvider) GetAvailableGPUTypes() map[string]struct{} { - // GetAvailableGPUTypes() might get called before the config is loaded - if kwok.config == nil || kwok.config.status == nil { - return map[string]struct{}{} - } - return kwok.config.status.availableGPUTypes -} - -// GetNodeGpuConfig returns the label, type and resource name for the GPU added to node. If node doesn't have -// any GPUs, it returns nil. -func (kwok *KwokCloudProvider) GetNodeGpuConfig(node *apiv1.Node) *cloudprovider.GpuConfig { - return gpu.GetNodeGPUFromCloudProvider(kwok, node) -} - -// Refresh is called before every main loop and can be used to dynamically update cloud provider state. -// In particular the list of node groups returned by NodeGroups can change as a result of CloudProvider.Refresh(). -// TODO(vadasambar): implement this -func (kwok *KwokCloudProvider) Refresh() error { - - // TODO(vadasambar): causes CA to not recognize kwok nodegroups - // needs better implementation - // nodeList, err := kwok.lister.List() - // if err != nil { - // return err - // } - - // ngs := []*NodeGroup{} - // for _, no := range nodeList { - // ng := parseAnnotationsToNodegroup(no) - // ng.kubeClient = kwok.kubeClient - // ngs = append(ngs, ng) - // } - - // kwok.nodeGroups = ngs - - return nil -} - -// Cleanup cleans up all resources before the cloud provider is removed -func (kwok *KwokCloudProvider) Cleanup() error { - for _, ng := range kwok.nodeGroups { - nodeNames, err := ng.getNodeNamesForNodeGroup() - if err != nil { - return fmt.Errorf("error cleaning up: %v", err) - } - - for _, node := range nodeNames { - err := kwok.kubeClient.CoreV1().Nodes().Delete(context.Background(), node, v1.DeleteOptions{}) - if err != nil { - klog.Errorf("error cleaning up kwok provider nodes '%v'", node) - } - } - } - - return nil -} - -// BuildKwok builds kwok cloud provider. -func BuildKwok(opts config.AutoscalingOptions, - do cloudprovider.NodeGroupDiscoveryOptions, - rl *cloudprovider.ResourceLimiter, - informerFactory informers.SharedInformerFactory) cloudprovider.CloudProvider { - - var restConfig *rest.Config - var err error - if os.Getenv("KWOK_PROVIDER_MODE") == "local" { - // Check and load kubeconfig from the path set - // in KUBECONFIG env variable (if not use default path of ~/.kube/config) - apiConfig, err := clientcmd.NewDefaultClientConfigLoadingRules().Load() - if err != nil { - klog.Fatal(err) - } - - // Create rest config from kubeconfig - restConfig, err = clientcmd.NewDefaultClientConfig(*apiConfig, &clientcmd.ConfigOverrides{}).ClientConfig() - if err != nil { - klog.Fatal(err) - } - } else { - restConfig, err = rest.InClusterConfig() - if err != nil { - klog.Fatalf("failed to get kubeclient config for cluster: %v", err) - } - } - - // TODO: switch to using the same kube/rest config as the core CA after - // https://github.com/kubernetes/autoscaler/pull/6180/files is merged - kubeClient := kubeclient.NewForConfigOrDie(restConfig) - - p, err := BuildKwokProvider(&kwokOptions{ - kubeClient: kubeClient, - autoscalingOpts: &opts, - discoveryOpts: &do, - resourceLimiter: rl, - ngNodeListerFn: kube_util.NewNodeLister, - allNodesLister: informerFactory.Core().V1().Nodes().Lister()}) - - if err != nil { - klog.Fatal(err) - } - - return p -} - -// BuildKwokProvider builds the kwok provider -func BuildKwokProvider(ko *kwokOptions) (*KwokCloudProvider, error) { - - kwokConfig, err := LoadConfigFile(ko.kubeClient) - if err != nil { - return nil, fmt.Errorf("failed to load kwok provider config: %v", err) - } - - var nodegroups []*NodeGroup - var nodeTemplates []*apiv1.Node - switch kwokConfig.ReadNodesFrom { - case nodeTemplatesFromConfigMap: - if nodeTemplates, err = LoadNodeTemplatesFromConfigMap(kwokConfig.ConfigMap.Name, ko.kubeClient); err != nil { - return nil, err - } - case nodeTemplatesFromCluster: - if nodeTemplates, err = loadNodeTemplatesFromCluster(kwokConfig, ko.kubeClient, nil); err != nil { - return nil, err - } - } - - if !kwokConfig.Nodes.SkipTaint { - for _, no := range nodeTemplates { - no.Spec.Taints = append(no.Spec.Taints, kwokProviderTaint()) - } - } - - nodegroups = createNodegroups(nodeTemplates, ko.kubeClient, kwokConfig, ko.ngNodeListerFn, ko.allNodesLister) - - return &KwokCloudProvider{ - nodeGroups: nodegroups, - kubeClient: ko.kubeClient, - resourceLimiter: ko.resourceLimiter, - config: kwokConfig, - }, nil -} - -func kwokProviderTaint() apiv1.Taint { - return apiv1.Taint{ - Key: "kwok-provider", - Value: "true", - Effect: apiv1.TaintEffectNoSchedule, - } -} diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_provider_test.go b/cluster-autoscaler/cloudprovider/kwok/kwok_provider_test.go deleted file mode 100644 index 50e46a9d88a9..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_provider_test.go +++ /dev/null @@ -1,1100 +0,0 @@ -/* -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 kwok - -import ( - "os" - "testing" - - "github.com/stretchr/testify/assert" - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/config" - "k8s.io/autoscaler/cluster-autoscaler/utils/gpu" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/client-go/kubernetes/fake" - v1lister "k8s.io/client-go/listers/core/v1" - core "k8s.io/client-go/testing" -) - -func TestNodeGroups(t *testing.T) { - fakeClient := &fake.Clientset{} - var nodesFrom string - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - if getAction.GetName() == defaultConfigName { - if nodesFrom == "configmap" { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - } - - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfigDynamicTemplates, - }, - }, nil - - } - - if getAction.GetName() == defaultTemplatesConfigName { - if nodesFrom == "configmap" { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplates, - }, - }, nil - } - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - t.Run("use template nodes from the configmap", func(t *testing.T) { - nodesFrom = "configmap" - fakeNodeLister := newTestAllNodeLister(map[string]*apiv1.Node{}) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - - ngs := p.NodeGroups() - assert.NotNil(t, ngs) - assert.NotEmpty(t, ngs) - assert.Len(t, ngs, 1) - assert.Contains(t, ngs[0].Id(), "kind-worker") - }) - - t.Run("use template nodes from the cluster (aka get them using kube client)", func(t *testing.T) { - nodesFrom = "cluster" - fakeNode := &apiv1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{}, - Labels: map[string]string{ - "kwok-nodegroup": "kind-worker", - }, - }, - Spec: apiv1.NodeSpec{}, - } - fakeNodeLister := newTestAllNodeLister(map[string]*apiv1.Node{ - "kind-worker": fakeNode, - }) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.ListAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.NodeList{Items: []apiv1.Node{*fakeNode}}, nil - }) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - - ngs := p.NodeGroups() - assert.NotNil(t, ngs) - assert.NotEmpty(t, ngs) - assert.Len(t, ngs, 1) - assert.Contains(t, ngs[0].Id(), "kind-worker") - }) -} - -func TestGetResourceLimiter(t *testing.T) { - fakeClient := &fake.Clientset{} - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - if getAction.GetName() == defaultConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - } - - if getAction.GetName() == defaultTemplatesConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplates, - }, - }, nil - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.NodeList{Items: []apiv1.Node{}}, errors.NewNotFound(apiv1.Resource("nodes"), "whatever") - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - fakeNodeLister := newTestAllNodeLister(map[string]*apiv1.Node{}) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - - // usual case - cp, err := p.GetResourceLimiter() - assert.Nil(t, err) - assert.NotNil(t, cp) - - // resource limiter is nil - ko.resourceLimiter = nil - p, err = BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - - cp, err = p.GetResourceLimiter() - assert.Nil(t, err) - assert.Nil(t, cp) - -} - -func TestGetAvailableGPUTypes(t *testing.T) { - fakeClient := &fake.Clientset{} - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - if getAction.GetName() == defaultConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - } - - if getAction.GetName() == defaultTemplatesConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplates, - }, - }, nil - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.NodeList{Items: []apiv1.Node{}}, errors.NewNotFound(apiv1.Resource("nodes"), "whatever") - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - fakeNodeLister := newTestAllNodeLister(map[string]*apiv1.Node{}) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - - // usual case - l := p.GetAvailableGPUTypes() - assert.NotNil(t, l) - assert.Equal(t, map[string]struct{}{ - "nvidia-tesla-k80": {}, - "nvidia-tesla-p100": {}}, l) - - // kwok provider config is nil - kwokProviderConfigBackup := p.config - p.config = nil - l = p.GetAvailableGPUTypes() - assert.Empty(t, l) - - // kwok provider config.status is nil - p.config = kwokProviderConfigBackup - statusBackup := p.config.status - p.config.status = nil - l = p.GetAvailableGPUTypes() - assert.Empty(t, l) - p.config.status = statusBackup -} - -func TestGetNodeGpuConfig(t *testing.T) { - fakeClient := &fake.Clientset{} - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - if getAction.GetName() == defaultConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - } - - if getAction.GetName() == defaultTemplatesConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplates, - }, - }, nil - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.NodeList{Items: []apiv1.Node{}}, errors.NewNotFound(apiv1.Resource("nodes"), "whatever") - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - fakeNodeLister := newTestAllNodeLister(map[string]*apiv1.Node{}) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - - nodeWithGPU := &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "k8s.amazonaws.com/accelerator": "nvidia-tesla-k80", - }, - }, - Status: apiv1.NodeStatus{ - Allocatable: apiv1.ResourceList{ - gpu.ResourceNvidiaGPU: resource.MustParse("2Gi"), - }, - }, - } - l := p.GetNodeGpuConfig(nodeWithGPU) - assert.NotNil(t, l) - assert.Equal(t, "k8s.amazonaws.com/accelerator", l.Label) - assert.Equal(t, gpu.ResourceNvidiaGPU, string(l.ResourceName)) - assert.Equal(t, "nvidia-tesla-k80", l.Type) - - nodeWithNoAllocatableGPU := &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "k8s.amazonaws.com/accelerator": "nvidia-tesla-k80", - }, - }, - } - l = p.GetNodeGpuConfig(nodeWithNoAllocatableGPU) - assert.NotNil(t, l) - assert.Equal(t, "k8s.amazonaws.com/accelerator", l.Label) - assert.Equal(t, gpu.ResourceNvidiaGPU, string(l.ResourceName)) - assert.Equal(t, "nvidia-tesla-k80", l.Type) - - nodeWithNoGPULabel := &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{}, - }, - Status: apiv1.NodeStatus{ - Allocatable: apiv1.ResourceList{ - gpu.ResourceNvidiaGPU: resource.MustParse("2Gi"), - }, - }, - } - l = p.GetNodeGpuConfig(nodeWithNoGPULabel) - assert.NotNil(t, l) - assert.Equal(t, "k8s.amazonaws.com/accelerator", l.Label) - assert.Equal(t, gpu.ResourceNvidiaGPU, string(l.ResourceName)) - assert.Equal(t, "", l.Type) - -} - -func TestGPULabel(t *testing.T) { - fakeClient := &fake.Clientset{} - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - if getAction.GetName() == defaultConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - } - - if getAction.GetName() == defaultTemplatesConfigName { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplates, - }, - }, nil - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.NodeList{Items: []apiv1.Node{}}, errors.NewNotFound(apiv1.Resource("nodes"), "whatever") - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - fakeNodeLister := newTestAllNodeLister(map[string]*apiv1.Node{}) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - - // usual case - l := p.GPULabel() - assert.Equal(t, "k8s.amazonaws.com/accelerator", l) - - // kwok provider config is nil - kwokProviderConfigBackup := p.config - p.config = nil - l = p.GPULabel() - assert.Empty(t, l) - - // kwok provider config.status is nil - p.config = kwokProviderConfigBackup - statusBackup := p.config.status - p.config.status = nil - l = p.GPULabel() - assert.Empty(t, l) - p.config.status = statusBackup - -} - -func TestNodeGroupForNode(t *testing.T) { - fakeClient := &fake.Clientset{} - var nodesFrom string - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - if getAction.GetName() == defaultConfigName { - if nodesFrom == "configmap" { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - } - - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfigDynamicTemplates, - }, - }, nil - - } - - if getAction.GetName() == defaultTemplatesConfigName { - if nodesFrom == "configmap" { - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplates, - }, - }, nil - } - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - t.Run("use template nodes from the configmap", func(t *testing.T) { - nodesFrom = "configmap" - fakeNodeLister := newTestAllNodeLister(map[string]*apiv1.Node{}) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - assert.Len(t, p.nodeGroups, 1) - assert.Contains(t, p.nodeGroups[0].Id(), "kind-worker") - - testNode := &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "kubernetes.io/hostname": "kind-worker", - "k8s.amazonaws.com/accelerator": "nvidia-tesla-k80", - "kwok-nodegroup": "kind-worker", - }, - Name: "kind-worker", - }, - Spec: apiv1.NodeSpec{ - ProviderID: "kwok:kind-worker-m24xz", - }, - } - ng, err := p.NodeGroupForNode(testNode) - assert.NoError(t, err) - assert.NotNil(t, ng) - assert.Contains(t, ng.Id(), "kind-worker") - }) - - t.Run("use template nodes from the cluster (aka get them using kube client)", func(t *testing.T) { - nodesFrom = "cluster" - fakeNode := &apiv1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{}, - Labels: map[string]string{ - "kwok-nodegroup": "kind-worker", - }, - }, - Spec: apiv1.NodeSpec{}, - } - fakeNodeLister := newTestAllNodeLister(map[string]*apiv1.Node{ - "kind-worker": fakeNode, - }) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.ListAction) - - if getAction == nil { - return false, nil, nil - } - - return true, &apiv1.NodeList{Items: []apiv1.Node{*fakeNode}}, nil - }) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - assert.Len(t, p.nodeGroups, 1) - assert.Contains(t, p.nodeGroups[0].Id(), "kind-worker") - - testNode := &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - "kubernetes.io/hostname": "kind-worker", - "k8s.amazonaws.com/accelerator": "nvidia-tesla-k80", - "kwok-nodegroup": "kind-worker", - }, - Name: "kind-worker", - }, - Spec: apiv1.NodeSpec{ - ProviderID: "kwok:kind-worker-m24xz", - }, - } - ng, err := p.NodeGroupForNode(testNode) - assert.NoError(t, err) - assert.NotNil(t, ng) - assert.Contains(t, ng.Id(), "kind-worker") - }) - -} - -func TestBuildKwokProvider(t *testing.T) { - defer func() { - os.Unsetenv("KWOK_PROVIDER_CONFIGMAP") - }() - - fakeClient := &fake.Clientset{} - - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - switch getAction.GetName() { - case defaultConfigName: - // for nodesFrom: configmap - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - case "testConfigDynamicTemplatesSkipTaint": - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfigDynamicTemplatesSkipTaint, - }, - }, nil - case "testConfigDynamicTemplates": - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfigDynamicTemplates, - }, - }, nil - - case "testConfigSkipTaint": - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfigSkipTaint, - }, - }, nil - - case defaultTemplatesConfigName: - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplatesMinimal, - }, - }, nil - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - fakeNode1 := apiv1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "node1", - Annotations: map[string]string{ - NGNameAnnotation: "ng1", - }, - Labels: map[string]string{ - "kwok-nodegroup": "ng1", - }, - }, - } - - fakeNode2 := apiv1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "node2", - Annotations: map[string]string{ - NGNameAnnotation: "ng2", - }, - Labels: map[string]string{ - "kwok-nodegroup": "ng2", - }, - }, - } - - fakeNode3 := apiv1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "node3", - Annotations: map[string]string{}, - // not a node that should be managed by kwok provider - Labels: map[string]string{}, - }, - } - - fakeNodes := make(map[string]*apiv1.Node) - fakeNodeLister := newTestAllNodeLister(fakeNodes) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - listAction := action.(core.ListAction) - if listAction == nil { - return false, nil, nil - } - - nodes := []apiv1.Node{} - for _, node := range fakeNodes { - nodes = append(nodes, *node) - } - return true, &apiv1.NodeList{Items: nodes}, nil - }) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: testNodeLister, - } - - os.Setenv("POD_NAMESPACE", "kube-system") - - t.Run("(don't skip adding taint) use template nodes from the cluster (aka get them using kube client)", func(t *testing.T) { - // use template nodes from the cluster (aka get them using kube client) - fakeNodes = map[string]*apiv1.Node{fakeNode1.Name: &fakeNode1, fakeNode2.Name: &fakeNode2, fakeNode3.Name: &fakeNode3} - fakeNodeLister.setNodesMap(fakeNodes) - os.Setenv("KWOK_PROVIDER_CONFIGMAP", "testConfigDynamicTemplates") - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - assert.NotNil(t, p.nodeGroups) - assert.Len(t, p.nodeGroups, 2) - assert.NotNil(t, p.kubeClient) - assert.NotNil(t, p.resourceLimiter) - assert.NotNil(t, p.config) - - for i := range p.nodeGroups { - assert.NotNil(t, p.nodeGroups[i].nodeTemplate) - assert.Equal(t, kwokProviderTaint(), p.nodeGroups[i].nodeTemplate.Spec.Taints[0]) - } - }) - - t.Run("(skip adding taint) use template nodes from the cluster (aka get them using kube client)", func(t *testing.T) { - // use template nodes from the cluster (aka get them using kube client) - fakeNodes = map[string]*apiv1.Node{fakeNode1.Name: &fakeNode1, fakeNode2.Name: &fakeNode2, fakeNode3.Name: &fakeNode3} - fakeNodeLister.setNodesMap(fakeNodes) - os.Setenv("KWOK_PROVIDER_CONFIGMAP", "testConfigDynamicTemplatesSkipTaint") - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - assert.NotNil(t, p.nodeGroups) - assert.Len(t, p.nodeGroups, 2) - assert.NotNil(t, p.kubeClient) - assert.NotNil(t, p.resourceLimiter) - assert.NotNil(t, p.config) - - for i := range p.nodeGroups { - assert.NotNil(t, p.nodeGroups[i].nodeTemplate) - assert.Empty(t, p.nodeGroups[i].nodeTemplate.Spec.Taints) - } - }) - - t.Run("(don't skip adding taint) use template nodes from the configmap", func(t *testing.T) { - // use template nodes from the configmap - fakeNodes = map[string]*apiv1.Node{} - - nos, err := LoadNodeTemplatesFromConfigMap(defaultTemplatesConfigName, fakeClient) - assert.NoError(t, err) - assert.NotEmpty(t, nos) - - for i := range nos { - fakeNodes[nos[i].GetName()] = nos[i] - } - fakeNodeLister = newTestAllNodeLister(fakeNodes) - - // fallback to default configmap name - os.Unsetenv("KWOK_PROVIDER_CONFIGMAP") - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - assert.NotNil(t, p.nodeGroups) - assert.Len(t, p.nodeGroups, 2) - assert.NotNil(t, p.kubeClient) - assert.NotNil(t, p.resourceLimiter) - assert.NotNil(t, p.config) - - for i := range p.nodeGroups { - assert.NotNil(t, p.nodeGroups[i].nodeTemplate) - assert.Equal(t, kwokProviderTaint(), p.nodeGroups[i].nodeTemplate.Spec.Taints[0]) - } - }) - - t.Run("(skip adding taint) use template nodes from the configmap", func(t *testing.T) { - // use template nodes from the configmap - fakeNodes = map[string]*apiv1.Node{} - - nos, err := LoadNodeTemplatesFromConfigMap(defaultTemplatesConfigName, fakeClient) - assert.NoError(t, err) - assert.NotEmpty(t, nos) - - for i := range nos { - fakeNodes[nos[i].GetName()] = nos[i] - } - - os.Setenv("KWOK_PROVIDER_CONFIGMAP", "testConfigSkipTaint") - - fakeNodeLister = newTestAllNodeLister(fakeNodes) - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - assert.NotNil(t, p.nodeGroups) - assert.Len(t, p.nodeGroups, 2) - assert.NotNil(t, p.kubeClient) - assert.NotNil(t, p.resourceLimiter) - assert.NotNil(t, p.config) - - for i := range p.nodeGroups { - assert.NotNil(t, p.nodeGroups[i].nodeTemplate) - assert.Empty(t, p.nodeGroups[i].nodeTemplate.Spec.Taints) - } - }) -} - -func TestCleanup(t *testing.T) { - - defer func() { - os.Unsetenv("KWOK_PROVIDER_CONFIGMAP") - }() - - fakeClient := &fake.Clientset{} - fakeClient.Fake.AddReactor("get", "configmaps", func(action core.Action) (bool, runtime.Object, error) { - getAction := action.(core.GetAction) - - if getAction == nil { - return false, nil, nil - } - - switch getAction.GetName() { - case defaultConfigName: - // for nodesFrom: configmap - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfig, - }, - }, nil - case "testConfigDynamicTemplates": - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - configKey: testConfigDynamicTemplates, - }, - }, nil - case defaultTemplatesConfigName: - return true, &apiv1.ConfigMap{ - Data: map[string]string{ - templatesKey: testTemplatesMinimal, - }, - }, nil - - } - - return true, nil, errors.NewNotFound(apiv1.Resource("configmaps"), "whatever") - }) - - fakeNode1 := apiv1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "node1", - Annotations: map[string]string{ - NGNameAnnotation: "ng1", - }, - Labels: map[string]string{ - "kwok-nodegroup": "ng1", - }, - }, - } - - fakeNode2 := apiv1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "node2", - Annotations: map[string]string{ - NGNameAnnotation: "ng2", - }, - Labels: map[string]string{ - "kwok-nodegroup": "ng2", - }, - }, - } - - fakeNode3 := apiv1.Node{ - TypeMeta: metav1.TypeMeta{ - Kind: "Node", - APIVersion: "v1", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "node3", - Annotations: map[string]string{}, - // not a node that should be managed by kwok provider - Labels: map[string]string{}, - }, - } - - fakeNodes := make(map[string]*apiv1.Node) - fakeNodeLister := newTestAllNodeLister(fakeNodes) - - fakeClient.Fake.AddReactor("list", "nodes", func(action core.Action) (bool, runtime.Object, error) { - listAction := action.(core.ListAction) - if listAction == nil { - return false, nil, nil - } - - nodes := []apiv1.Node{} - for _, node := range fakeNodes { - nodes = append(nodes, *node) - } - return true, &apiv1.NodeList{Items: nodes}, nil - }) - - fakeClient.Fake.AddReactor("delete", "nodes", func(action core.Action) (bool, runtime.Object, error) { - deleteAction := action.(core.DeleteAction) - - if deleteAction == nil { - return false, nil, nil - } - - if fakeNodes[deleteAction.GetName()] != nil { - delete(fakeNodes, deleteAction.GetName()) - } - - fakeNodeLister.setNodesMap(fakeNodes) - - return false, nil, errors.NewNotFound(apiv1.Resource("nodes"), deleteAction.GetName()) - - }) - - os.Setenv("POD_NAMESPACE", "kube-system") - - t.Run("use template nodes from the cluster (aka get them using kube client)", func(t *testing.T) { - // use template nodes from the cluster (aka get them using kube client) - fakeNodes = map[string]*apiv1.Node{fakeNode1.Name: &fakeNode1, fakeNode2.Name: &fakeNode2, fakeNode3.Name: &fakeNode3} - fakeNodeLister.setNodesMap(fakeNodes) - os.Setenv("KWOK_PROVIDER_CONFIGMAP", "testConfigDynamicTemplates") - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: kube_util.NewNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - assert.NotEmpty(t, p.nodeGroups) - - err = p.Cleanup() - assert.NoError(t, err) - nodeList, err := fakeNodeLister.List(labels.NewSelector()) - assert.NoError(t, err) - assert.Len(t, nodeList, 1) - assert.Equal(t, fakeNode3, *nodeList[0]) - }) - - t.Run("use template nodes from the configmap", func(t *testing.T) { - // use template nodes from the configmap - fakeNodes = map[string]*apiv1.Node{} - - nos, err := LoadNodeTemplatesFromConfigMap(defaultTemplatesConfigName, fakeClient) - assert.NoError(t, err) - assert.NotEmpty(t, nos) - - for i := range nos { - fakeNodes[nos[i].GetName()] = nos[i] - } - - // fallback to default configmap name - os.Unsetenv("KWOK_PROVIDER_CONFIGMAP") - fakeNodeLister = newTestAllNodeLister(fakeNodes) - - ko := &kwokOptions{ - kubeClient: fakeClient, - autoscalingOpts: &config.AutoscalingOptions{}, - discoveryOpts: &cloudprovider.NodeGroupDiscoveryOptions{}, - resourceLimiter: cloudprovider.NewResourceLimiter( - map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, - map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}), - allNodesLister: fakeNodeLister, - ngNodeListerFn: kube_util.NewNodeLister, - } - - p, err := BuildKwokProvider(ko) - assert.NoError(t, err) - assert.NotNil(t, p) - assert.NotEmpty(t, p.nodeGroups) - - err = p.Cleanup() - assert.NoError(t, err) - nodeList, err := fakeNodeLister.List(labels.NewSelector()) - assert.NoError(t, err) - assert.Len(t, nodeList, 1) - assert.Equal(t, fakeNode3, *nodeList[0]) - }) - -} - -func testNodeLister(lister v1lister.NodeLister, filter func(*apiv1.Node) bool) kube_util.NodeLister { - return kube_util.NewTestNodeLister(nil) -} - -// fakeAllNodeLister implements v1lister.NodeLister interface -type fakeAllNodeLister struct { - nodesMap map[string]*apiv1.Node -} - -func newTestAllNodeLister(nodesMap map[string]*apiv1.Node) *fakeAllNodeLister { - return &fakeAllNodeLister{nodesMap: nodesMap} -} - -func (f *fakeAllNodeLister) List(_ labels.Selector) (ret []*apiv1.Node, err error) { - n := []*apiv1.Node{} - - for _, node := range f.nodesMap { - n = append(n, node) - } - - return n, nil -} - -func (f *fakeAllNodeLister) Get(name string) (*apiv1.Node, error) { - if f.nodesMap[name] == nil { - return nil, errors.NewNotFound(apiv1.Resource("nodes"), name) - } - return f.nodesMap[name], nil -} - -func (f *fakeAllNodeLister) setNodesMap(nodesMap map[string]*apiv1.Node) { - f.nodesMap = nodesMap -} diff --git a/cluster-autoscaler/cloudprovider/kwok/kwok_types.go b/cluster-autoscaler/cloudprovider/kwok/kwok_types.go deleted file mode 100644 index 25ed7dae6fbf..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/kwok_types.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -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 kwok - -import ( - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/config" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/client-go/kubernetes" - listersv1 "k8s.io/client-go/listers/core/v1" -) - -// KwokCloudProvider implements CloudProvider interface for kwok -type KwokCloudProvider struct { - nodeGroups []*NodeGroup - config *KwokProviderConfig - resourceLimiter *cloudprovider.ResourceLimiter - // kubeClient is to be used only for create, delete and update - kubeClient kubernetes.Interface -} - -type kwokOptions struct { - kubeClient kubernetes.Interface - autoscalingOpts *config.AutoscalingOptions - discoveryOpts *cloudprovider.NodeGroupDiscoveryOptions - resourceLimiter *cloudprovider.ResourceLimiter - // TODO(vadasambar): look into abstracting kubeClient - // and lister into a single client - // allNodeLister lists all the nodes in the cluster - allNodesLister listersv1.NodeLister - // nodeLister lists all nodes managed by kwok for a specific nodegroup - ngNodeListerFn listerFn -} - -// NodeGroup implements NodeGroup interface. -type NodeGroup struct { - name string - kubeClient kubernetes.Interface - lister kube_util.NodeLister - nodeTemplate *apiv1.Node - minSize int - targetSize int - maxSize int -} - -// NodegroupsConfig defines options for creating nodegroups -type NodegroupsConfig struct { - FromNodeLabelKey string `json:"fromNodeLabelKey" yaml:"fromNodeLabelKey"` - FromNodeLabelAnnotation string `json:"fromNodeLabelAnnotation" yaml:"fromNodeLabelAnnotation"` -} - -// NodeConfig defines config options for the nodes -type NodeConfig struct { - GPUConfig *GPUConfig `json:"gpuConfig" yaml:"gpuConfig"` - SkipTaint bool `json:"skipTaint" yaml:"skipTaint"` -} - -// ConfigMapConfig allows setting the kwok provider configmap name -type ConfigMapConfig struct { - Name string `json:"name" yaml:"name"` - Key string `json:"key" yaml:"key"` -} - -// GPUConfig defines GPU related config for the node -type GPUConfig struct { - GPULabelKey string `json:"gpuLabelKey" yaml:"gpuLabelKey"` - AvailableGPUTypes map[string]struct{} `json:"availableGPUTypes" yaml:"availableGPUTypes"` -} - -// KwokConfig is the struct to define kwok specific config -// (needs to be implemented; currently empty) -type KwokConfig struct { -} - -// KwokProviderConfig is the struct to hold kwok provider config -type KwokProviderConfig struct { - APIVersion string `json:"apiVersion" yaml:"apiVersion"` - ReadNodesFrom string `json:"readNodesFrom" yaml:"readNodesFrom"` - Nodegroups *NodegroupsConfig `json:"nodegroups" yaml:"nodegroups"` - Nodes *NodeConfig `json:"nodes" yaml:"nodes"` - ConfigMap *ConfigMapConfig `json:"configmap" yaml:"configmap"` - Kwok *KwokConfig `json:"kwok" yaml:"kwok"` - status *GroupingConfig -} - -// GroupingConfig defines different -type GroupingConfig struct { - groupNodesBy string // [annotation, label] - key string // annotation or label key - gpuLabel string // gpu label key - availableGPUTypes map[string]struct{} // available gpu types -} diff --git a/cluster-autoscaler/cloudprovider/kwok/samples/dynamic_nodegroups_config.yaml b/cluster-autoscaler/cloudprovider/kwok/samples/dynamic_nodegroups_config.yaml deleted file mode 100644 index 4af16add09ff..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/samples/dynamic_nodegroups_config.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1alpha1 -readNodesFrom: cluster # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "node.kubernetes.io/instance-type" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" - -nodes: - # kwok provider adds a taint on the template nodes - # so that even if you run the provider in a production cluster - # you don't have to worry about production workload - # getting accidentally scheduled on the fake nodes - # use skipTaint: true to disable this behavior (false by default) - # skipTaint: false (default) - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} diff --git a/cluster-autoscaler/cloudprovider/kwok/samples/static_nodegroups_config.yaml b/cluster-autoscaler/cloudprovider/kwok/samples/static_nodegroups_config.yaml deleted file mode 100644 index eba6cde17c58..000000000000 --- a/cluster-autoscaler/cloudprovider/kwok/samples/static_nodegroups_config.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: v1alpha1 -readNodesFrom: configmap # possible values: [cluster,configmap] -nodegroups: - # to specify how to group nodes into a nodegroup - # e.g., you want to treat nodes with same instance type as a nodegroup - # node1: m5.xlarge - # node2: c5.xlarge - # node3: m5.xlarge - # nodegroup1: [node1,node3] - # nodegroup2: [node2] - fromNodeLabelKey: "node.kubernetes.io/instance-type" - # you can either specify fromNodeLabelKey OR fromNodeAnnotation - # (both are not allowed) - # fromNodeAnnotation: "eks.amazonaws.com/nodegroup" -nodes: - # kwok provider adds a taint on the template nodes - # so that even if you run the provider in a production cluster - # you don't have to worry about production workload - # getting accidentally scheduled on the fake nodes - # use skipTaint: true to disable this behavior (false by default) - # skipTaint: false (default) - gpuConfig: - # to tell kwok provider what label should be considered as GPU label - gpuLabelKey: "k8s.amazonaws.com/accelerator" - availableGPUTypes: - "nvidia-tesla-k80": {} - "nvidia-tesla-p100": {} -configmap: - name: kwok-provider-templates - key: kwok-config # default: config diff --git a/cluster-autoscaler/cloudprovider/linode/OWNERS b/cluster-autoscaler/cloudprovider/linode/OWNERS deleted file mode 100644 index a8a368986ed1..000000000000 --- a/cluster-autoscaler/cloudprovider/linode/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ - -labels: -- area/provider/linode diff --git a/cluster-autoscaler/cloudprovider/ovhcloud/OWNERS b/cluster-autoscaler/cloudprovider/ovhcloud/OWNERS deleted file mode 100644 index 167d61951dab..000000000000 --- a/cluster-autoscaler/cloudprovider/ovhcloud/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ - -labels: -- area/provider/ovhcloud diff --git a/cluster-autoscaler/cloudprovider/packet/examples/cloud-init-template.sh b/cluster-autoscaler/cloudprovider/packet/examples/cloud-init-template.sh deleted file mode 100644 index 1f50c988ddf7..000000000000 --- a/cluster-autoscaler/cloudprovider/packet/examples/cloud-init-template.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash -# 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. - -#This is a template of cloud-init script for cluster-autoscaler/cloudprovider/packet -#This gets base64'd and put into the example cluster-autoscaler-secret.yaml file -sleep 10 -sed -ri '/\sswap\s/s/^#?/#/' /etc/fstab -swapoff -a -mount -a -cat < /dev/null -apt-get update -apt-get install -y containerd.io kubelet=1.28.1-00 kubeadm=1.28.1-00 kubectl=1.28.1-00 -apt-mark hold kubelet kubeadm kubectl -containerd config default > /etc/containerd/config.toml -sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml -sed -i "s,sandbox_image.*$,sandbox_image = \"$(kubeadm config images list | grep pause | sort -r | head -n1)\"," /etc/containerd/config.toml -systemctl restart containerd -systemctl enable kubelet.service -echo "source <(kubectl completion bash)" >> /root/.bashrc -echo "alias k=kubectl" >> /root/.bashrc -echo "complete -o default -F __start_kubectl k" >> /root/.bashrc -cat < - //
  • SCALE_OUT:扩容活动
  • SCALE_IN:缩容活动
  • ATTACH_INSTANCES:添加实例
  • REMOVE_INSTANCES:销毁实例
  • DETACH_INSTANCES:移出实例
  • TERMINATE_INSTANCES_UNEXPECTEDLY:实例在CVM控制台被销毁
  • REPLACE_UNHEALTHY_INSTANCE:替换不健康实例 - //
  • START_INSTANCES:开启实例 - //
  • STOP_INSTANCES:关闭实例 - //
  • INVOKE_COMMAND:执行命令 - ActivityType *string `json:"ActivityType,omitempty" name:"ActivityType"` - - // 伸缩活动状态。取值如下:
    - //
  • INIT:初始化中 - //
  • RUNNING:运行中 - //
  • SUCCESSFUL:活动成功 - //
  • PARTIALLY_SUCCESSFUL:活动部分成功 - //
  • FAILED:活动失败 - //
  • CANCELLED:活动取消 - StatusCode *string `json:"StatusCode,omitempty" name:"StatusCode"` - - // 伸缩活动状态描述。 - StatusMessage *string `json:"StatusMessage,omitempty" name:"StatusMessage"` - - // 伸缩活动起因。 - Cause *string `json:"Cause,omitempty" name:"Cause"` - - // 伸缩活动描述。 - Description *string `json:"Description,omitempty" name:"Description"` - - // 伸缩活动开始时间。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 伸缩活动结束时间。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 伸缩活动创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 该参数已废弃,请勿使用。 - // - // Deprecated: ActivityRelatedInstanceSet is deprecated. - ActivityRelatedInstanceSet []*ActivtyRelatedInstance `json:"ActivityRelatedInstanceSet,omitempty" name:"ActivityRelatedInstanceSet"` - - // 伸缩活动状态简要描述。 - StatusMessageSimplified *string `json:"StatusMessageSimplified,omitempty" name:"StatusMessageSimplified"` - - // 伸缩活动中生命周期挂钩的执行结果。 - LifecycleActionResultSet []*LifecycleActionResultInfo `json:"LifecycleActionResultSet,omitempty" name:"LifecycleActionResultSet"` - - // 伸缩活动状态详细描述。 - DetailedStatusMessageSet []*DetailedStatusMessage `json:"DetailedStatusMessageSet,omitempty" name:"DetailedStatusMessageSet"` - - // 执行命令结果。 - InvocationResultSet []*InvocationResult `json:"InvocationResultSet,omitempty" name:"InvocationResultSet"` - - // 伸缩活动相关实例信息集合。 - RelatedInstanceSet []*RelatedInstance `json:"RelatedInstanceSet,omitempty" name:"RelatedInstanceSet"` -} - -type ActivtyRelatedInstance struct { - // 实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例在伸缩活动中的状态。取值如下: - //
  • INIT:初始化中 - //
  • RUNNING:实例操作中 - //
  • SUCCESSFUL:活动成功 - //
  • FAILED:活动失败 - InstanceStatus *string `json:"InstanceStatus,omitempty" name:"InstanceStatus"` -} - -type Advice struct { - // 问题描述。 - Problem *string `json:"Problem,omitempty" name:"Problem"` - - // 问题详情。 - Detail *string `json:"Detail,omitempty" name:"Detail"` - - // 建议解决方案。 - Solution *string `json:"Solution,omitempty" name:"Solution"` - - // 伸缩建议警告级别。取值范围:
    - //
  • WARNING:警告级别
    - //
  • CRITICAL:严重级别
    - Level *string `json:"Level,omitempty" name:"Level"` -} - -// Predefined struct for user -type AttachInstancesRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type AttachInstancesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *AttachInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AttachInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachInstancesResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AttachInstancesResponse struct { - *tchttp.BaseResponse - Response *AttachInstancesResponseParams `json:"Response"` -} - -func (r *AttachInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachLoadBalancersRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 传统型负载均衡器ID列表,每个伸缩组绑定传统型负载均衡器数量上限为20,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - LoadBalancerIds []*string `json:"LoadBalancerIds,omitempty" name:"LoadBalancerIds"` - - // 应用型负载均衡器列表,每个伸缩组绑定应用型负载均衡器数量上限为100,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - ForwardLoadBalancers []*ForwardLoadBalancer `json:"ForwardLoadBalancers,omitempty" name:"ForwardLoadBalancers"` -} - -type AttachLoadBalancersRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 传统型负载均衡器ID列表,每个伸缩组绑定传统型负载均衡器数量上限为20,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - LoadBalancerIds []*string `json:"LoadBalancerIds,omitempty" name:"LoadBalancerIds"` - - // 应用型负载均衡器列表,每个伸缩组绑定应用型负载均衡器数量上限为100,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - ForwardLoadBalancers []*ForwardLoadBalancer `json:"ForwardLoadBalancers,omitempty" name:"ForwardLoadBalancers"` -} - -func (r *AttachLoadBalancersRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachLoadBalancersRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "LoadBalancerIds") - delete(f, "ForwardLoadBalancers") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AttachLoadBalancersRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachLoadBalancersResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AttachLoadBalancersResponse struct { - *tchttp.BaseResponse - Response *AttachLoadBalancersResponseParams `json:"Response"` -} - -func (r *AttachLoadBalancersResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachLoadBalancersResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type AutoScalingAdvice struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 伸缩组警告级别。取值范围:
    - //
  • NORMAL:正常
    - //
  • WARNING:警告级别
    - //
  • CRITICAL:严重级别
    - Level *string `json:"Level,omitempty" name:"Level"` - - // 伸缩组配置建议集合。 - Advices []*Advice `json:"Advices,omitempty" name:"Advices"` -} - -type AutoScalingGroup struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 伸缩组名称 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` - - // 伸缩组当前状态。取值范围:
    - //
  • NORMAL:正常
    - //
  • CVM_ABNORMAL:启动配置异常
    - //
  • LB_ABNORMAL:负载均衡器异常
    - //
  • LB_LISTENER_ABNORMAL:负载均衡器监听器异常
    - //
  • LB_LOCATION_ABNORMAL:负载均衡器监听器转发配置异常
    - //
  • VPC_ABNORMAL:VPC网络异常
    - //
  • SUBNET_ABNORMAL:VPC子网异常
    - //
  • INSUFFICIENT_BALANCE:余额不足
    - //
  • LB_BACKEND_REGION_NOT_MATCH:CLB实例后端地域与AS服务所在地域不匹配
    - //
  • LB_BACKEND_VPC_NOT_MATCH:CLB实例VPC与伸缩组VPC不匹配 - AutoScalingGroupStatus *string `json:"AutoScalingGroupStatus,omitempty" name:"AutoScalingGroupStatus"` - - // 创建时间,采用UTC标准计时 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 默认冷却时间,单位秒 - DefaultCooldown *int64 `json:"DefaultCooldown,omitempty" name:"DefaultCooldown"` - - // 期望实例数 - DesiredCapacity *int64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 启用状态,取值包括`ENABLED`和`DISABLED` - EnabledStatus *string `json:"EnabledStatus,omitempty" name:"EnabledStatus"` - - // 应用型负载均衡器列表 - ForwardLoadBalancerSet []*ForwardLoadBalancer `json:"ForwardLoadBalancerSet,omitempty" name:"ForwardLoadBalancerSet"` - - // 实例数量 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 状态为`IN_SERVICE`实例的数量 - InServiceInstanceCount *int64 `json:"InServiceInstanceCount,omitempty" name:"InServiceInstanceCount"` - - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 启动配置名称 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 传统型负载均衡器ID列表 - LoadBalancerIdSet []*string `json:"LoadBalancerIdSet,omitempty" name:"LoadBalancerIdSet"` - - // 最大实例数 - MaxSize *int64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 最小实例数 - MinSize *int64 `json:"MinSize,omitempty" name:"MinSize"` - - // 项目ID - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 子网ID列表 - SubnetIdSet []*string `json:"SubnetIdSet,omitempty" name:"SubnetIdSet"` - - // 销毁策略 - TerminationPolicySet []*string `json:"TerminationPolicySet,omitempty" name:"TerminationPolicySet"` - - // VPC标识 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 可用区列表 - ZoneSet []*string `json:"ZoneSet,omitempty" name:"ZoneSet"` - - // 重试策略 - RetryPolicy *string `json:"RetryPolicy,omitempty" name:"RetryPolicy"` - - // 伸缩组是否处于伸缩活动中,`IN_ACTIVITY`表示处于伸缩活动中,`NOT_IN_ACTIVITY`表示不处于伸缩活动中。 - InActivityStatus *string `json:"InActivityStatus,omitempty" name:"InActivityStatus"` - - // 伸缩组标签列表 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 服务设置 - ServiceSettings *ServiceSettings `json:"ServiceSettings,omitempty" name:"ServiceSettings"` - - // 实例具有IPv6地址数量的配置 - Ipv6AddressCount *int64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` - - // 多可用区/子网策略。 - //
  • PRIORITY,按照可用区/子网列表的顺序,作为优先级来尝试创建实例,如果优先级最高的可用区/子网可以创建成功,则总在该可用区/子网创建。 - //
  • EQUALITY:每次选择当前实例数最少的可用区/子网进行扩容,使得每个可用区/子网都有机会发生扩容,多次扩容出的实例会打散到多个可用区/子网。 - MultiZoneSubnetPolicy *string `json:"MultiZoneSubnetPolicy,omitempty" name:"MultiZoneSubnetPolicy"` - - // 伸缩组实例健康检查类型,取值如下:
  • CVM:根据实例网络状态判断实例是否处于不健康状态,不健康的网络状态即发生实例 PING 不可达事件,详细判断标准可参考[实例健康检查](https://cloud.tencent.com/document/product/377/8553)
  • CLB:根据 CLB 的健康检查状态判断实例是否处于不健康状态,CLB健康检查原理可参考[健康检查](https://cloud.tencent.com/document/product/214/6097) - HealthCheckType *string `json:"HealthCheckType,omitempty" name:"HealthCheckType"` - - // CLB健康检查宽限期 - LoadBalancerHealthCheckGracePeriod *uint64 `json:"LoadBalancerHealthCheckGracePeriod,omitempty" name:"LoadBalancerHealthCheckGracePeriod"` - - // 实例分配策略,取值包括 LAUNCH_CONFIGURATION 和 SPOT_MIXED。 - //
  • LAUNCH_CONFIGURATION,代表传统的按照启动配置模式。 - //
  • SPOT_MIXED,代表竞价混合模式。目前仅支持启动配置为按量计费模式时使用混合模式,混合模式下,伸缩组将根据设定扩容按量或竞价机型。使用混合模式时,关联的启动配置的计费类型不可被修改。 - InstanceAllocationPolicy *string `json:"InstanceAllocationPolicy,omitempty" name:"InstanceAllocationPolicy"` - - // 竞价混合模式下,各计费类型实例的分配策略。 - // 仅当 InstanceAllocationPolicy 取 SPOT_MIXED 时才会返回有效值。 - SpotMixedAllocationPolicy *SpotMixedAllocationPolicy `json:"SpotMixedAllocationPolicy,omitempty" name:"SpotMixedAllocationPolicy"` - - // 容量重平衡功能,仅对伸缩组内的竞价实例有效。取值范围: - //
  • TRUE,开启该功能,当伸缩组内的竞价实例即将被竞价实例服务自动回收前,AS 主动发起竞价实例销毁流程,如果有配置过缩容 hook,则销毁前 hook 会生效。销毁流程启动后,AS 会异步开启一个扩容活动,用于补齐期望实例数。 - //
  • FALSE,不开启该功能,则 AS 等待竞价实例被销毁后才会去扩容补齐伸缩组期望实例数。 - CapacityRebalance *bool `json:"CapacityRebalance,omitempty" name:"CapacityRebalance"` -} - -type AutoScalingGroupAbstract struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 伸缩组名称。 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` -} - -type AutoScalingNotification struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 用户组ID列表。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` - - // 通知事件列表。 - NotificationTypes []*string `json:"NotificationTypes,omitempty" name:"NotificationTypes"` - - // 事件通知ID。 - AutoScalingNotificationId *string `json:"AutoScalingNotificationId,omitempty" name:"AutoScalingNotificationId"` - - // 通知接收端类型。 - TargetType *string `json:"TargetType,omitempty" name:"TargetType"` - - // CMQ 队列名。 - QueueName *string `json:"QueueName,omitempty" name:"QueueName"` - - // CMQ 主题名。 - TopicName *string `json:"TopicName,omitempty" name:"TopicName"` -} - -// Predefined struct for user -type ClearLaunchConfigurationAttributesRequestParams struct { - // 启动配置ID。 - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 是否清空数据盘信息,非必填,默认为 false。 - // 填 true 代表清空“数据盘”信息,清空后基于此新创建的云主机将不含有任何数据盘。 - ClearDataDisks *bool `json:"ClearDataDisks,omitempty" name:"ClearDataDisks"` - - // 是否清空云服务器主机名相关设置信息,非必填,默认为 false。 - // 填 true 代表清空主机名设置信息,清空后基于此新创建的云主机将不设置主机名。 - ClearHostNameSettings *bool `json:"ClearHostNameSettings,omitempty" name:"ClearHostNameSettings"` - - // 是否清空云服务器实例名相关设置信息,非必填,默认为 false。 - // 填 true 代表清空主机名设置信息,清空后基于此新创建的云主机将按照“as-{{ 伸缩组AutoScalingGroupName }}”进行设置。 - ClearInstanceNameSettings *bool `json:"ClearInstanceNameSettings,omitempty" name:"ClearInstanceNameSettings"` - - // 是否清空置放群组信息,非必填,默认为 false。 - // 填 true 代表清空置放群组信息,清空后基于此新创建的云主机将不指定任何置放群组。 - ClearDisasterRecoverGroupIds *bool `json:"ClearDisasterRecoverGroupIds,omitempty" name:"ClearDisasterRecoverGroupIds"` -} - -type ClearLaunchConfigurationAttributesRequest struct { - *tchttp.BaseRequest - - // 启动配置ID。 - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 是否清空数据盘信息,非必填,默认为 false。 - // 填 true 代表清空“数据盘”信息,清空后基于此新创建的云主机将不含有任何数据盘。 - ClearDataDisks *bool `json:"ClearDataDisks,omitempty" name:"ClearDataDisks"` - - // 是否清空云服务器主机名相关设置信息,非必填,默认为 false。 - // 填 true 代表清空主机名设置信息,清空后基于此新创建的云主机将不设置主机名。 - ClearHostNameSettings *bool `json:"ClearHostNameSettings,omitempty" name:"ClearHostNameSettings"` - - // 是否清空云服务器实例名相关设置信息,非必填,默认为 false。 - // 填 true 代表清空主机名设置信息,清空后基于此新创建的云主机将按照“as-{{ 伸缩组AutoScalingGroupName }}”进行设置。 - ClearInstanceNameSettings *bool `json:"ClearInstanceNameSettings,omitempty" name:"ClearInstanceNameSettings"` - - // 是否清空置放群组信息,非必填,默认为 false。 - // 填 true 代表清空置放群组信息,清空后基于此新创建的云主机将不指定任何置放群组。 - ClearDisasterRecoverGroupIds *bool `json:"ClearDisasterRecoverGroupIds,omitempty" name:"ClearDisasterRecoverGroupIds"` -} - -func (r *ClearLaunchConfigurationAttributesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ClearLaunchConfigurationAttributesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchConfigurationId") - delete(f, "ClearDataDisks") - delete(f, "ClearHostNameSettings") - delete(f, "ClearInstanceNameSettings") - delete(f, "ClearDisasterRecoverGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ClearLaunchConfigurationAttributesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ClearLaunchConfigurationAttributesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ClearLaunchConfigurationAttributesResponse struct { - *tchttp.BaseResponse - Response *ClearLaunchConfigurationAttributesResponseParams `json:"Response"` -} - -func (r *ClearLaunchConfigurationAttributesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ClearLaunchConfigurationAttributesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CompleteLifecycleActionRequestParams struct { - // 生命周期挂钩ID - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 生命周期动作的结果,取值范围为“CONTINUE”或“ABANDON” - LifecycleActionResult *string `json:"LifecycleActionResult,omitempty" name:"LifecycleActionResult"` - - // 实例ID,“InstanceId”和“LifecycleActionToken”必须填充其中一个 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // “InstanceId”和“LifecycleActionToken”必须填充其中一个 - LifecycleActionToken *string `json:"LifecycleActionToken,omitempty" name:"LifecycleActionToken"` -} - -type CompleteLifecycleActionRequest struct { - *tchttp.BaseRequest - - // 生命周期挂钩ID - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 生命周期动作的结果,取值范围为“CONTINUE”或“ABANDON” - LifecycleActionResult *string `json:"LifecycleActionResult,omitempty" name:"LifecycleActionResult"` - - // 实例ID,“InstanceId”和“LifecycleActionToken”必须填充其中一个 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // “InstanceId”和“LifecycleActionToken”必须填充其中一个 - LifecycleActionToken *string `json:"LifecycleActionToken,omitempty" name:"LifecycleActionToken"` -} - -func (r *CompleteLifecycleActionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CompleteLifecycleActionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LifecycleHookId") - delete(f, "LifecycleActionResult") - delete(f, "InstanceId") - delete(f, "LifecycleActionToken") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CompleteLifecycleActionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CompleteLifecycleActionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CompleteLifecycleActionResponse struct { - *tchttp.BaseResponse - Response *CompleteLifecycleActionResponseParams `json:"Response"` -} - -func (r *CompleteLifecycleActionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CompleteLifecycleActionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAutoScalingGroupFromInstanceRequestParams struct { - // 伸缩组名称,在您账号中必须唯一。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超55个字节。 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` - - // 实例ID - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 最小实例数,取值范围为0-2000。 - MinSize *int64 `json:"MinSize,omitempty" name:"MinSize"` - - // 最大实例数,取值范围为0-2000。 - MaxSize *int64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 期望实例数,大小介于最小实例数和最大实例数之间。 - DesiredCapacity *int64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 是否继承实例标签,默认值为False - InheritInstanceTag *bool `json:"InheritInstanceTag,omitempty" name:"InheritInstanceTag"` -} - -type CreateAutoScalingGroupFromInstanceRequest struct { - *tchttp.BaseRequest - - // 伸缩组名称,在您账号中必须唯一。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超55个字节。 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` - - // 实例ID - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 最小实例数,取值范围为0-2000。 - MinSize *int64 `json:"MinSize,omitempty" name:"MinSize"` - - // 最大实例数,取值范围为0-2000。 - MaxSize *int64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 期望实例数,大小介于最小实例数和最大实例数之间。 - DesiredCapacity *int64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 是否继承实例标签,默认值为False - InheritInstanceTag *bool `json:"InheritInstanceTag,omitempty" name:"InheritInstanceTag"` -} - -func (r *CreateAutoScalingGroupFromInstanceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAutoScalingGroupFromInstanceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupName") - delete(f, "InstanceId") - delete(f, "MinSize") - delete(f, "MaxSize") - delete(f, "DesiredCapacity") - delete(f, "InheritInstanceTag") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAutoScalingGroupFromInstanceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAutoScalingGroupFromInstanceResponseParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateAutoScalingGroupFromInstanceResponse struct { - *tchttp.BaseResponse - Response *CreateAutoScalingGroupFromInstanceResponseParams `json:"Response"` -} - -func (r *CreateAutoScalingGroupFromInstanceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAutoScalingGroupFromInstanceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAutoScalingGroupRequestParams struct { - // 伸缩组名称,在您账号中必须唯一。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超55个字节。 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` - - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 最大实例数,取值范围为0-2000。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 最小实例数,取值范围为0-2000。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // VPC ID,基础网络则填空字符串 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 默认冷却时间,单位秒,默认值为300 - DefaultCooldown *uint64 `json:"DefaultCooldown,omitempty" name:"DefaultCooldown"` - - // 期望实例数,大小介于最小实例数和最大实例数之间 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 传统负载均衡器ID列表,目前长度上限为20,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - LoadBalancerIds []*string `json:"LoadBalancerIds,omitempty" name:"LoadBalancerIds"` - - // 伸缩组内实例所属项目ID。不填为默认项目。 - ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 应用型负载均衡器列表,目前长度上限为100,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - ForwardLoadBalancers []*ForwardLoadBalancer `json:"ForwardLoadBalancers,omitempty" name:"ForwardLoadBalancers"` - - // 子网ID列表,VPC场景下必须指定子网。多个子网以填写顺序为优先级,依次进行尝试,直至可以成功创建实例。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` - - // 销毁策略,目前长度上限为1。取值包括 OLDEST_INSTANCE 和 NEWEST_INSTANCE,默认取值为 OLDEST_INSTANCE。 - //
  • OLDEST_INSTANCE 优先销毁伸缩组中最旧的实例。 - //
  • NEWEST_INSTANCE,优先销毁伸缩组中最新的实例。 - TerminationPolicies []*string `json:"TerminationPolicies,omitempty" name:"TerminationPolicies"` - - // 可用区列表,基础网络场景下必须指定可用区。多个可用区以填写顺序为优先级,依次进行尝试,直至可以成功创建实例。 - Zones []*string `json:"Zones,omitempty" name:"Zones"` - - // 重试策略,取值包括 IMMEDIATE_RETRY、 INCREMENTAL_INTERVALS、NO_RETRY,默认取值为 IMMEDIATE_RETRY。部分成功的伸缩活动判定为一次失败活动。 - //
  • IMMEDIATE_RETRY,立即重试,在较短时间内快速重试,连续失败超过一定次数(5次)后不再重试。 - //
  • INCREMENTAL_INTERVALS,间隔递增重试,随着连续失败次数的增加,重试间隔逐渐增大,重试间隔从秒级到1天不等。 - //
  • NO_RETRY,不进行重试,直到再次收到用户调用或者告警信息后才会重试。 - RetryPolicy *string `json:"RetryPolicy,omitempty" name:"RetryPolicy"` - - // 可用区校验策略,取值包括 ALL 和 ANY,默认取值为ANY。 - //
  • ALL,所有可用区(Zone)或子网(SubnetId)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个可用区(Zone)或子网(SubnetId)可用则通过校验,否则校验报错。 - // - // 可用区或子网不可用的常见原因包括该可用区CVM实例类型售罄、该可用区CBS云盘售罄、该可用区配额不足、该子网IP不足等。 - // 如果 Zones/SubnetIds 中可用区或者子网不存在,则无论 ZonesCheckPolicy 采用何种取值,都会校验报错。 - ZonesCheckPolicy *string `json:"ZonesCheckPolicy,omitempty" name:"ZonesCheckPolicy"` - - // 标签描述列表。通过指定该参数可以支持绑定标签到伸缩组。同时绑定标签到相应的资源实例。每个伸缩组最多支持30个标签。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 服务设置,包括云监控不健康替换等服务设置。 - ServiceSettings *ServiceSettings `json:"ServiceSettings,omitempty" name:"ServiceSettings"` - - // 实例具有IPv6地址数量的配置,取值包括 0、1,默认值为0。 - Ipv6AddressCount *int64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` - - // 多可用区/子网策略,取值包括 PRIORITY 和 EQUALITY,默认为 PRIORITY。 - //
  • PRIORITY,按照可用区/子网列表的顺序,作为优先级来尝试创建实例,如果优先级最高的可用区/子网可以创建成功,则总在该可用区/子网创建。 - //
  • EQUALITY:扩容出的实例会打散到多个可用区/子网,保证扩容后的各个可用区/子网实例数相对均衡。 - // - // 与本策略相关的注意点: - //
  • 当伸缩组为基础网络时,本策略适用于多可用区;当伸缩组为VPC网络时,本策略适用于多子网,此时不再考虑可用区因素,例如四个子网ABCD,其中ABC处于可用区1,D处于可用区2,此时考虑子网ABCD进行排序,而不考虑可用区1、2。 - //
  • 本策略适用于多可用区/子网,不适用于启动配置的多机型。多机型按照优先级策略进行选择。 - //
  • 按照 PRIORITY 策略创建实例时,先保证多机型的策略,后保证多可用区/子网的策略。例如多机型A、B,多子网1、2、3,会按照A1、A2、A3、B1、B2、B3 进行尝试,如果A1售罄,会尝试A2(而非B1)。 - MultiZoneSubnetPolicy *string `json:"MultiZoneSubnetPolicy,omitempty" name:"MultiZoneSubnetPolicy"` - - // 伸缩组实例健康检查类型,取值如下:
  • CVM:根据实例网络状态判断实例是否处于不健康状态,不健康的网络状态即发生实例 PING 不可达事件,详细判断标准可参考[实例健康检查](https://cloud.tencent.com/document/product/377/8553)
  • CLB:根据 CLB 的健康检查状态判断实例是否处于不健康状态,CLB健康检查原理可参考[健康检查](https://cloud.tencent.com/document/product/214/6097)
    如果选择了`CLB`类型,伸缩组将同时检查实例网络状态与CLB健康检查状态,如果出现实例网络状态不健康,实例将被标记为 UNHEALTHY 状态;如果出现 CLB 健康检查状态异常,实例将被标记为CLB_UNHEALTHY 状态,如果两个异常状态同时出现,实例`HealthStatus`字段将返回 UNHEALTHY|CLB_UNHEALTHY。默认值:CLB - HealthCheckType *string `json:"HealthCheckType,omitempty" name:"HealthCheckType"` - - // CLB健康检查宽限期,当扩容的实例进入`IN_SERVICE`后,在宽限期时间范围内将不会被标记为不健康`CLB_UNHEALTHY`。
    默认值:0。取值范围[0, 7200],单位:秒。 - LoadBalancerHealthCheckGracePeriod *uint64 `json:"LoadBalancerHealthCheckGracePeriod,omitempty" name:"LoadBalancerHealthCheckGracePeriod"` - - // 实例分配策略,取值包括 LAUNCH_CONFIGURATION 和 SPOT_MIXED,默认取 LAUNCH_CONFIGURATION。 - //
  • LAUNCH_CONFIGURATION,代表传统的按照启动配置模式。 - //
  • SPOT_MIXED,代表竞价混合模式。目前仅支持启动配置为按量计费模式时使用混合模式,混合模式下,伸缩组将根据设定扩容按量或竞价机型。使用混合模式时,关联的启动配置的计费类型不可被修改。 - InstanceAllocationPolicy *string `json:"InstanceAllocationPolicy,omitempty" name:"InstanceAllocationPolicy"` - - // 竞价混合模式下,各计费类型实例的分配策略。 - // 仅当 InstanceAllocationPolicy 取 SPOT_MIXED 时可用。 - SpotMixedAllocationPolicy *SpotMixedAllocationPolicy `json:"SpotMixedAllocationPolicy,omitempty" name:"SpotMixedAllocationPolicy"` - - // 容量重平衡功能,仅对伸缩组内的竞价实例有效。取值范围: - //
  • TRUE,开启该功能,当伸缩组内的竞价实例即将被竞价实例服务自动回收前,AS 主动发起竞价实例销毁流程,如果有配置过缩容 hook,则销毁前 hook 会生效。销毁流程启动后,AS 会异步开启一个扩容活动,用于补齐期望实例数。 - //
  • FALSE,不开启该功能,则 AS 等待竞价实例被销毁后才会去扩容补齐伸缩组期望实例数。 - // - // 默认取 FALSE。 - CapacityRebalance *bool `json:"CapacityRebalance,omitempty" name:"CapacityRebalance"` -} - -type CreateAutoScalingGroupRequest struct { - *tchttp.BaseRequest - - // 伸缩组名称,在您账号中必须唯一。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超55个字节。 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` - - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 最大实例数,取值范围为0-2000。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 最小实例数,取值范围为0-2000。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // VPC ID,基础网络则填空字符串 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 默认冷却时间,单位秒,默认值为300 - DefaultCooldown *uint64 `json:"DefaultCooldown,omitempty" name:"DefaultCooldown"` - - // 期望实例数,大小介于最小实例数和最大实例数之间 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 传统负载均衡器ID列表,目前长度上限为20,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - LoadBalancerIds []*string `json:"LoadBalancerIds,omitempty" name:"LoadBalancerIds"` - - // 伸缩组内实例所属项目ID。不填为默认项目。 - ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 应用型负载均衡器列表,目前长度上限为100,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - ForwardLoadBalancers []*ForwardLoadBalancer `json:"ForwardLoadBalancers,omitempty" name:"ForwardLoadBalancers"` - - // 子网ID列表,VPC场景下必须指定子网。多个子网以填写顺序为优先级,依次进行尝试,直至可以成功创建实例。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` - - // 销毁策略,目前长度上限为1。取值包括 OLDEST_INSTANCE 和 NEWEST_INSTANCE,默认取值为 OLDEST_INSTANCE。 - //
  • OLDEST_INSTANCE 优先销毁伸缩组中最旧的实例。 - //
  • NEWEST_INSTANCE,优先销毁伸缩组中最新的实例。 - TerminationPolicies []*string `json:"TerminationPolicies,omitempty" name:"TerminationPolicies"` - - // 可用区列表,基础网络场景下必须指定可用区。多个可用区以填写顺序为优先级,依次进行尝试,直至可以成功创建实例。 - Zones []*string `json:"Zones,omitempty" name:"Zones"` - - // 重试策略,取值包括 IMMEDIATE_RETRY、 INCREMENTAL_INTERVALS、NO_RETRY,默认取值为 IMMEDIATE_RETRY。部分成功的伸缩活动判定为一次失败活动。 - //
  • IMMEDIATE_RETRY,立即重试,在较短时间内快速重试,连续失败超过一定次数(5次)后不再重试。 - //
  • INCREMENTAL_INTERVALS,间隔递增重试,随着连续失败次数的增加,重试间隔逐渐增大,重试间隔从秒级到1天不等。 - //
  • NO_RETRY,不进行重试,直到再次收到用户调用或者告警信息后才会重试。 - RetryPolicy *string `json:"RetryPolicy,omitempty" name:"RetryPolicy"` - - // 可用区校验策略,取值包括 ALL 和 ANY,默认取值为ANY。 - //
  • ALL,所有可用区(Zone)或子网(SubnetId)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个可用区(Zone)或子网(SubnetId)可用则通过校验,否则校验报错。 - // - // 可用区或子网不可用的常见原因包括该可用区CVM实例类型售罄、该可用区CBS云盘售罄、该可用区配额不足、该子网IP不足等。 - // 如果 Zones/SubnetIds 中可用区或者子网不存在,则无论 ZonesCheckPolicy 采用何种取值,都会校验报错。 - ZonesCheckPolicy *string `json:"ZonesCheckPolicy,omitempty" name:"ZonesCheckPolicy"` - - // 标签描述列表。通过指定该参数可以支持绑定标签到伸缩组。同时绑定标签到相应的资源实例。每个伸缩组最多支持30个标签。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 服务设置,包括云监控不健康替换等服务设置。 - ServiceSettings *ServiceSettings `json:"ServiceSettings,omitempty" name:"ServiceSettings"` - - // 实例具有IPv6地址数量的配置,取值包括 0、1,默认值为0。 - Ipv6AddressCount *int64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` - - // 多可用区/子网策略,取值包括 PRIORITY 和 EQUALITY,默认为 PRIORITY。 - //
  • PRIORITY,按照可用区/子网列表的顺序,作为优先级来尝试创建实例,如果优先级最高的可用区/子网可以创建成功,则总在该可用区/子网创建。 - //
  • EQUALITY:扩容出的实例会打散到多个可用区/子网,保证扩容后的各个可用区/子网实例数相对均衡。 - // - // 与本策略相关的注意点: - //
  • 当伸缩组为基础网络时,本策略适用于多可用区;当伸缩组为VPC网络时,本策略适用于多子网,此时不再考虑可用区因素,例如四个子网ABCD,其中ABC处于可用区1,D处于可用区2,此时考虑子网ABCD进行排序,而不考虑可用区1、2。 - //
  • 本策略适用于多可用区/子网,不适用于启动配置的多机型。多机型按照优先级策略进行选择。 - //
  • 按照 PRIORITY 策略创建实例时,先保证多机型的策略,后保证多可用区/子网的策略。例如多机型A、B,多子网1、2、3,会按照A1、A2、A3、B1、B2、B3 进行尝试,如果A1售罄,会尝试A2(而非B1)。 - MultiZoneSubnetPolicy *string `json:"MultiZoneSubnetPolicy,omitempty" name:"MultiZoneSubnetPolicy"` - - // 伸缩组实例健康检查类型,取值如下:
  • CVM:根据实例网络状态判断实例是否处于不健康状态,不健康的网络状态即发生实例 PING 不可达事件,详细判断标准可参考[实例健康检查](https://cloud.tencent.com/document/product/377/8553)
  • CLB:根据 CLB 的健康检查状态判断实例是否处于不健康状态,CLB健康检查原理可参考[健康检查](https://cloud.tencent.com/document/product/214/6097)
    如果选择了`CLB`类型,伸缩组将同时检查实例网络状态与CLB健康检查状态,如果出现实例网络状态不健康,实例将被标记为 UNHEALTHY 状态;如果出现 CLB 健康检查状态异常,实例将被标记为CLB_UNHEALTHY 状态,如果两个异常状态同时出现,实例`HealthStatus`字段将返回 UNHEALTHY|CLB_UNHEALTHY。默认值:CLB - HealthCheckType *string `json:"HealthCheckType,omitempty" name:"HealthCheckType"` - - // CLB健康检查宽限期,当扩容的实例进入`IN_SERVICE`后,在宽限期时间范围内将不会被标记为不健康`CLB_UNHEALTHY`。
    默认值:0。取值范围[0, 7200],单位:秒。 - LoadBalancerHealthCheckGracePeriod *uint64 `json:"LoadBalancerHealthCheckGracePeriod,omitempty" name:"LoadBalancerHealthCheckGracePeriod"` - - // 实例分配策略,取值包括 LAUNCH_CONFIGURATION 和 SPOT_MIXED,默认取 LAUNCH_CONFIGURATION。 - //
  • LAUNCH_CONFIGURATION,代表传统的按照启动配置模式。 - //
  • SPOT_MIXED,代表竞价混合模式。目前仅支持启动配置为按量计费模式时使用混合模式,混合模式下,伸缩组将根据设定扩容按量或竞价机型。使用混合模式时,关联的启动配置的计费类型不可被修改。 - InstanceAllocationPolicy *string `json:"InstanceAllocationPolicy,omitempty" name:"InstanceAllocationPolicy"` - - // 竞价混合模式下,各计费类型实例的分配策略。 - // 仅当 InstanceAllocationPolicy 取 SPOT_MIXED 时可用。 - SpotMixedAllocationPolicy *SpotMixedAllocationPolicy `json:"SpotMixedAllocationPolicy,omitempty" name:"SpotMixedAllocationPolicy"` - - // 容量重平衡功能,仅对伸缩组内的竞价实例有效。取值范围: - //
  • TRUE,开启该功能,当伸缩组内的竞价实例即将被竞价实例服务自动回收前,AS 主动发起竞价实例销毁流程,如果有配置过缩容 hook,则销毁前 hook 会生效。销毁流程启动后,AS 会异步开启一个扩容活动,用于补齐期望实例数。 - //
  • FALSE,不开启该功能,则 AS 等待竞价实例被销毁后才会去扩容补齐伸缩组期望实例数。 - // - // 默认取 FALSE。 - CapacityRebalance *bool `json:"CapacityRebalance,omitempty" name:"CapacityRebalance"` -} - -func (r *CreateAutoScalingGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAutoScalingGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupName") - delete(f, "LaunchConfigurationId") - delete(f, "MaxSize") - delete(f, "MinSize") - delete(f, "VpcId") - delete(f, "DefaultCooldown") - delete(f, "DesiredCapacity") - delete(f, "LoadBalancerIds") - delete(f, "ProjectId") - delete(f, "ForwardLoadBalancers") - delete(f, "SubnetIds") - delete(f, "TerminationPolicies") - delete(f, "Zones") - delete(f, "RetryPolicy") - delete(f, "ZonesCheckPolicy") - delete(f, "Tags") - delete(f, "ServiceSettings") - delete(f, "Ipv6AddressCount") - delete(f, "MultiZoneSubnetPolicy") - delete(f, "HealthCheckType") - delete(f, "LoadBalancerHealthCheckGracePeriod") - delete(f, "InstanceAllocationPolicy") - delete(f, "SpotMixedAllocationPolicy") - delete(f, "CapacityRebalance") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAutoScalingGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAutoScalingGroupResponseParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateAutoScalingGroupResponse struct { - *tchttp.BaseResponse - Response *CreateAutoScalingGroupResponseParams `json:"Response"` -} - -func (r *CreateAutoScalingGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAutoScalingGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLaunchConfigurationRequestParams struct { - // 启动配置显示名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-8toqc6s3`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 启动配置所属项目ID。不填为默认项目。 - // 注意:伸缩组内实例所属项目ID取伸缩组项目ID,与这里取值无关。 - ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 实例机型。不同实例机型指定了不同的资源规格,具体取值可通过调用接口 [DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749) 来获得最新的规格表或参见[实例类型](https://cloud.tencent.com/document/product/213/11518)描述。 - // `InstanceType`和`InstanceTypes`参数互斥,二者必填一个且只能填写一个。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘,最多支持指定11块数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的`SecurityGroupId`字段来获取。若不指定该参数,则默认不绑定安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 经过 Base64 编码后的自定义数据,最大长度不超过16KB。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 实例计费类型,CVM默认值按照POSTPAID_BY_HOUR处理。 - //
  • POSTPAID_BY_HOUR:按小时后付费 - //
  • SPOTPAID:竞价付费 - //
  • PREPAID:预付费,即包年包月 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 实例机型列表,不同实例机型指定了不同的资源规格,最多支持10种实例机型。 - // `InstanceType`和`InstanceTypes`参数互斥,二者必填一个且只能填写一个。 - InstanceTypes []*string `json:"InstanceTypes,omitempty" name:"InstanceTypes"` - - // CAM角色名称。可通过DescribeRoleList接口返回值中的roleName获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 实例类型校验策略,取值包括 ALL 和 ANY,默认取值为ANY。 - //
  • ALL,所有实例类型(InstanceType)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个实例类型(InstanceType)可用则通过校验,否则校验报错。 - // - // 实例类型不可用的常见原因包括该实例类型售罄、对应云盘售罄等。 - // 如果 InstanceTypes 中一款机型不存在或者已下线,则无论 InstanceTypesCheckPolicy 采用何种取值,都会校验报错。 - InstanceTypesCheckPolicy *string `json:"InstanceTypesCheckPolicy,omitempty" name:"InstanceTypesCheckPolicy"` - - // 标签列表。通过指定该参数,可以为扩容的实例绑定标签。最多支持指定10个标签。 - InstanceTags []*InstanceTag `json:"InstanceTags,omitempty" name:"InstanceTags"` - - // 标签描述列表。通过指定该参数可以支持绑定标签到启动配置。每个启动配置最多支持30个标签。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 云服务器主机名(HostName)的相关设置。 - HostNameSettings *HostNameSettings `json:"HostNameSettings,omitempty" name:"HostNameSettings"` - - // 云服务器实例名(InstanceName)的相关设置。 - // 如果用户在启动配置中设置此字段,则伸缩组创建出的实例 InstanceName 参照此字段进行设置,并传递给 CVM;如果用户未在启动配置中设置此字段,则伸缩组创建出的实例 InstanceName 按照“as-{{ 伸缩组AutoScalingGroupName }}”进行设置,并传递给 CVM。 - InstanceNameSettings *InstanceNameSettings `json:"InstanceNameSettings,omitempty" name:"InstanceNameSettings"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 云盘类型选择策略,默认取值 ORIGINAL,取值范围: - //
  • ORIGINAL:使用设置的云盘类型 - //
  • AUTOMATIC:自动选择当前可用的云盘类型 - DiskTypePolicy *string `json:"DiskTypePolicy,omitempty" name:"DiskTypePolicy"` - - // 高性能计算集群ID。
    - // 注意:此字段默认为空。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // IPv6公网带宽相关信息设置。若新建实例包含IPv6地址,该参数可为新建实例的IPv6地址分配公网带宽。关联启动配置的伸缩组Ipv6AddressCount参数为0时,该参数不会生效。 - IPv6InternetAccessible *IPv6InternetAccessible `json:"IPv6InternetAccessible,omitempty" name:"IPv6InternetAccessible"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` -} - -type CreateLaunchConfigurationRequest struct { - *tchttp.BaseRequest - - // 启动配置显示名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-8toqc6s3`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 启动配置所属项目ID。不填为默认项目。 - // 注意:伸缩组内实例所属项目ID取伸缩组项目ID,与这里取值无关。 - ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 实例机型。不同实例机型指定了不同的资源规格,具体取值可通过调用接口 [DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749) 来获得最新的规格表或参见[实例类型](https://cloud.tencent.com/document/product/213/11518)描述。 - // `InstanceType`和`InstanceTypes`参数互斥,二者必填一个且只能填写一个。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘,最多支持指定11块数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的`SecurityGroupId`字段来获取。若不指定该参数,则默认不绑定安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 经过 Base64 编码后的自定义数据,最大长度不超过16KB。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 实例计费类型,CVM默认值按照POSTPAID_BY_HOUR处理。 - //
  • POSTPAID_BY_HOUR:按小时后付费 - //
  • SPOTPAID:竞价付费 - //
  • PREPAID:预付费,即包年包月 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 实例机型列表,不同实例机型指定了不同的资源规格,最多支持10种实例机型。 - // `InstanceType`和`InstanceTypes`参数互斥,二者必填一个且只能填写一个。 - InstanceTypes []*string `json:"InstanceTypes,omitempty" name:"InstanceTypes"` - - // CAM角色名称。可通过DescribeRoleList接口返回值中的roleName获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 实例类型校验策略,取值包括 ALL 和 ANY,默认取值为ANY。 - //
  • ALL,所有实例类型(InstanceType)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个实例类型(InstanceType)可用则通过校验,否则校验报错。 - // - // 实例类型不可用的常见原因包括该实例类型售罄、对应云盘售罄等。 - // 如果 InstanceTypes 中一款机型不存在或者已下线,则无论 InstanceTypesCheckPolicy 采用何种取值,都会校验报错。 - InstanceTypesCheckPolicy *string `json:"InstanceTypesCheckPolicy,omitempty" name:"InstanceTypesCheckPolicy"` - - // 标签列表。通过指定该参数,可以为扩容的实例绑定标签。最多支持指定10个标签。 - InstanceTags []*InstanceTag `json:"InstanceTags,omitempty" name:"InstanceTags"` - - // 标签描述列表。通过指定该参数可以支持绑定标签到启动配置。每个启动配置最多支持30个标签。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 云服务器主机名(HostName)的相关设置。 - HostNameSettings *HostNameSettings `json:"HostNameSettings,omitempty" name:"HostNameSettings"` - - // 云服务器实例名(InstanceName)的相关设置。 - // 如果用户在启动配置中设置此字段,则伸缩组创建出的实例 InstanceName 参照此字段进行设置,并传递给 CVM;如果用户未在启动配置中设置此字段,则伸缩组创建出的实例 InstanceName 按照“as-{{ 伸缩组AutoScalingGroupName }}”进行设置,并传递给 CVM。 - InstanceNameSettings *InstanceNameSettings `json:"InstanceNameSettings,omitempty" name:"InstanceNameSettings"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 云盘类型选择策略,默认取值 ORIGINAL,取值范围: - //
  • ORIGINAL:使用设置的云盘类型 - //
  • AUTOMATIC:自动选择当前可用的云盘类型 - DiskTypePolicy *string `json:"DiskTypePolicy,omitempty" name:"DiskTypePolicy"` - - // 高性能计算集群ID。
    - // 注意:此字段默认为空。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // IPv6公网带宽相关信息设置。若新建实例包含IPv6地址,该参数可为新建实例的IPv6地址分配公网带宽。关联启动配置的伸缩组Ipv6AddressCount参数为0时,该参数不会生效。 - IPv6InternetAccessible *IPv6InternetAccessible `json:"IPv6InternetAccessible,omitempty" name:"IPv6InternetAccessible"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` -} - -func (r *CreateLaunchConfigurationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLaunchConfigurationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchConfigurationName") - delete(f, "ImageId") - delete(f, "ProjectId") - delete(f, "InstanceType") - delete(f, "SystemDisk") - delete(f, "DataDisks") - delete(f, "InternetAccessible") - delete(f, "LoginSettings") - delete(f, "SecurityGroupIds") - delete(f, "EnhancedService") - delete(f, "UserData") - delete(f, "InstanceChargeType") - delete(f, "InstanceMarketOptions") - delete(f, "InstanceTypes") - delete(f, "CamRoleName") - delete(f, "InstanceTypesCheckPolicy") - delete(f, "InstanceTags") - delete(f, "Tags") - delete(f, "HostNameSettings") - delete(f, "InstanceNameSettings") - delete(f, "InstanceChargePrepaid") - delete(f, "DiskTypePolicy") - delete(f, "HpcClusterId") - delete(f, "IPv6InternetAccessible") - delete(f, "DisasterRecoverGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateLaunchConfigurationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLaunchConfigurationResponseParams struct { - // 当通过本接口来创建启动配置时会返回该参数,表示启动配置ID。 - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateLaunchConfigurationResponse struct { - *tchttp.BaseResponse - Response *CreateLaunchConfigurationResponseParams `json:"Response"` -} - -func (r *CreateLaunchConfigurationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLaunchConfigurationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLifecycleHookRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 生命周期挂钩名称。名称仅支持中文、英文、数字、下划线(_)、短横线(-)、小数点(.),最大长度不能超128个字节。 - LifecycleHookName *string `json:"LifecycleHookName,omitempty" name:"LifecycleHookName"` - - // 进行生命周期挂钩的场景,取值范围包括 INSTANCE_LAUNCHING 和 INSTANCE_TERMINATING - LifecycleTransition *string `json:"LifecycleTransition,omitempty" name:"LifecycleTransition"` - - // 定义伸缩组在生命周期挂钩超时的情况下应采取的操作,取值范围是 CONTINUE 或 ABANDON,默认值为 CONTINUE - DefaultResult *string `json:"DefaultResult,omitempty" name:"DefaultResult"` - - // 生命周期挂钩超时之前可以经过的最长时间(以秒为单位),范围从30到7200秒,默认值为300秒 - HeartbeatTimeout *int64 `json:"HeartbeatTimeout,omitempty" name:"HeartbeatTimeout"` - - // 弹性伸缩向通知目标发送的附加信息,配置通知时使用,默认值为空字符串""。最大长度不能超过1024个字节。 - NotificationMetadata *string `json:"NotificationMetadata,omitempty" name:"NotificationMetadata"` - - // 通知目标。NotificationTarget和LifecycleCommand参数互斥,二者不可同时指定。 - NotificationTarget *NotificationTarget `json:"NotificationTarget,omitempty" name:"NotificationTarget"` - - // 进行生命周期挂钩的场景类型,取值范围包括NORMAL 和 EXTENSION。说明:设置为EXTENSION值,在AttachInstances、DetachInstances、RemoveInstaces接口时会触发生命周期挂钩操作,值为NORMAL则不会在这些接口中触发生命周期挂钩。 - LifecycleTransitionType *string `json:"LifecycleTransitionType,omitempty" name:"LifecycleTransitionType"` - - // 远程命令执行对象。NotificationTarget和LifecycleCommand参数互斥,二者不可同时指定。 - LifecycleCommand *LifecycleCommand `json:"LifecycleCommand,omitempty" name:"LifecycleCommand"` -} - -type CreateLifecycleHookRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 生命周期挂钩名称。名称仅支持中文、英文、数字、下划线(_)、短横线(-)、小数点(.),最大长度不能超128个字节。 - LifecycleHookName *string `json:"LifecycleHookName,omitempty" name:"LifecycleHookName"` - - // 进行生命周期挂钩的场景,取值范围包括 INSTANCE_LAUNCHING 和 INSTANCE_TERMINATING - LifecycleTransition *string `json:"LifecycleTransition,omitempty" name:"LifecycleTransition"` - - // 定义伸缩组在生命周期挂钩超时的情况下应采取的操作,取值范围是 CONTINUE 或 ABANDON,默认值为 CONTINUE - DefaultResult *string `json:"DefaultResult,omitempty" name:"DefaultResult"` - - // 生命周期挂钩超时之前可以经过的最长时间(以秒为单位),范围从30到7200秒,默认值为300秒 - HeartbeatTimeout *int64 `json:"HeartbeatTimeout,omitempty" name:"HeartbeatTimeout"` - - // 弹性伸缩向通知目标发送的附加信息,配置通知时使用,默认值为空字符串""。最大长度不能超过1024个字节。 - NotificationMetadata *string `json:"NotificationMetadata,omitempty" name:"NotificationMetadata"` - - // 通知目标。NotificationTarget和LifecycleCommand参数互斥,二者不可同时指定。 - NotificationTarget *NotificationTarget `json:"NotificationTarget,omitempty" name:"NotificationTarget"` - - // 进行生命周期挂钩的场景类型,取值范围包括NORMAL 和 EXTENSION。说明:设置为EXTENSION值,在AttachInstances、DetachInstances、RemoveInstaces接口时会触发生命周期挂钩操作,值为NORMAL则不会在这些接口中触发生命周期挂钩。 - LifecycleTransitionType *string `json:"LifecycleTransitionType,omitempty" name:"LifecycleTransitionType"` - - // 远程命令执行对象。NotificationTarget和LifecycleCommand参数互斥,二者不可同时指定。 - LifecycleCommand *LifecycleCommand `json:"LifecycleCommand,omitempty" name:"LifecycleCommand"` -} - -func (r *CreateLifecycleHookRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLifecycleHookRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "LifecycleHookName") - delete(f, "LifecycleTransition") - delete(f, "DefaultResult") - delete(f, "HeartbeatTimeout") - delete(f, "NotificationMetadata") - delete(f, "NotificationTarget") - delete(f, "LifecycleTransitionType") - delete(f, "LifecycleCommand") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateLifecycleHookRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLifecycleHookResponseParams struct { - // 生命周期挂钩ID - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateLifecycleHookResponse struct { - *tchttp.BaseResponse - Response *CreateLifecycleHookResponseParams `json:"Response"` -} - -func (r *CreateLifecycleHookResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLifecycleHookResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNotificationConfigurationRequestParams struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 通知类型,即为需要订阅的通知类型集合,取值范围如下: - //
  • SCALE_OUT_SUCCESSFUL:扩容成功
  • - //
  • SCALE_OUT_FAILED:扩容失败
  • - //
  • SCALE_IN_SUCCESSFUL:缩容成功
  • - //
  • SCALE_IN_FAILED:缩容失败
  • - //
  • REPLACE_UNHEALTHY_INSTANCE_SUCCESSFUL:替换不健康子机成功
  • - //
  • REPLACE_UNHEALTHY_INSTANCE_FAILED:替换不健康子机失败
  • - NotificationTypes []*string `json:"NotificationTypes,omitempty" name:"NotificationTypes"` - - // 通知组ID,即为用户组ID集合,用户组ID可以通过[ListGroups](https://cloud.tencent.com/document/product/598/34589)查询。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` - - // 通知接收端类型,取值如下 - //
  • USER_GROUP:用户组 - //
  • CMQ_QUEUE:CMQ 队列 - //
  • CMQ_TOPIC:CMQ 主题 - //
  • TDMQ_CMQ_TOPIC:TDMQ CMQ 主题 - //
  • TDMQ_CMQ_QUEUE:TDMQ CMQ 队列 - // - // 默认值为:`USER_GROUP`。 - TargetType *string `json:"TargetType,omitempty" name:"TargetType"` - - // CMQ 队列名称,如 TargetType 取值为 `CMQ_QUEUE` 或 `TDMQ_CMQ_QUEUE` 时,该字段必填。 - QueueName *string `json:"QueueName,omitempty" name:"QueueName"` - - // CMQ 主题名称,如 TargetType 取值为 `CMQ_TOPIC` 或 `TDMQ_CMQ_TOPIC` 时,该字段必填。 - TopicName *string `json:"TopicName,omitempty" name:"TopicName"` -} - -type CreateNotificationConfigurationRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 通知类型,即为需要订阅的通知类型集合,取值范围如下: - //
  • SCALE_OUT_SUCCESSFUL:扩容成功
  • - //
  • SCALE_OUT_FAILED:扩容失败
  • - //
  • SCALE_IN_SUCCESSFUL:缩容成功
  • - //
  • SCALE_IN_FAILED:缩容失败
  • - //
  • REPLACE_UNHEALTHY_INSTANCE_SUCCESSFUL:替换不健康子机成功
  • - //
  • REPLACE_UNHEALTHY_INSTANCE_FAILED:替换不健康子机失败
  • - NotificationTypes []*string `json:"NotificationTypes,omitempty" name:"NotificationTypes"` - - // 通知组ID,即为用户组ID集合,用户组ID可以通过[ListGroups](https://cloud.tencent.com/document/product/598/34589)查询。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` - - // 通知接收端类型,取值如下 - //
  • USER_GROUP:用户组 - //
  • CMQ_QUEUE:CMQ 队列 - //
  • CMQ_TOPIC:CMQ 主题 - //
  • TDMQ_CMQ_TOPIC:TDMQ CMQ 主题 - //
  • TDMQ_CMQ_QUEUE:TDMQ CMQ 队列 - // - // 默认值为:`USER_GROUP`。 - TargetType *string `json:"TargetType,omitempty" name:"TargetType"` - - // CMQ 队列名称,如 TargetType 取值为 `CMQ_QUEUE` 或 `TDMQ_CMQ_QUEUE` 时,该字段必填。 - QueueName *string `json:"QueueName,omitempty" name:"QueueName"` - - // CMQ 主题名称,如 TargetType 取值为 `CMQ_TOPIC` 或 `TDMQ_CMQ_TOPIC` 时,该字段必填。 - TopicName *string `json:"TopicName,omitempty" name:"TopicName"` -} - -func (r *CreateNotificationConfigurationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNotificationConfigurationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "NotificationTypes") - delete(f, "NotificationUserGroupIds") - delete(f, "TargetType") - delete(f, "QueueName") - delete(f, "TopicName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateNotificationConfigurationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNotificationConfigurationResponseParams struct { - // 通知ID。 - AutoScalingNotificationId *string `json:"AutoScalingNotificationId,omitempty" name:"AutoScalingNotificationId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateNotificationConfigurationResponse struct { - *tchttp.BaseResponse - Response *CreateNotificationConfigurationResponseParams `json:"Response"` -} - -func (r *CreateNotificationConfigurationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNotificationConfigurationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateScalingPolicyRequestParams struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 告警触发策略名称。 - ScalingPolicyName *string `json:"ScalingPolicyName,omitempty" name:"ScalingPolicyName"` - - // 告警触发策略类型,默认类型为SIMPLE。取值范围:
  • SIMPLE:简单策略
  • TARGET_TRACKING:目标追踪策略
  • - ScalingPolicyType *string `json:"ScalingPolicyType,omitempty" name:"ScalingPolicyType"` - - // 告警触发后,期望实例数修改方式,仅适用于简单策略。取值范围:
  • CHANGE_IN_CAPACITY:增加或减少若干期望实例数
  • EXACT_CAPACITY:调整至指定期望实例数
  • PERCENT_CHANGE_IN_CAPACITY:按百分比调整期望实例数
  • - AdjustmentType *string `json:"AdjustmentType,omitempty" name:"AdjustmentType"` - - // 告警触发后,期望实例数的调整值,仅适用于简单策略。
  • 当 AdjustmentType 为 CHANGE_IN_CAPACITY 时,AdjustmentValue 为正数表示告警触发后增加实例,为负数表示告警触发后减少实例
  • 当 AdjustmentType 为 EXACT_CAPACITY 时,AdjustmentValue 的值即为告警触发后新的期望实例数,需要大于或等于0
  • 当 AdjustmentType 为 PERCENT_CHANGE_IN_CAPACITY 时,AdjusmentValue 为正数表示告警触发后按百分比增加实例,为负数表示告警触发后按百分比减少实例,单位是:%。 - AdjustmentValue *int64 `json:"AdjustmentValue,omitempty" name:"AdjustmentValue"` - - // 冷却时间,单位为秒,仅适用于简单策略。默认冷却时间300秒。 - Cooldown *uint64 `json:"Cooldown,omitempty" name:"Cooldown"` - - // 告警监控指标,仅适用于简单策略。 - MetricAlarm *MetricAlarm `json:"MetricAlarm,omitempty" name:"MetricAlarm"` - - // 预定义监控项,仅适用于目标追踪策略。取值范围:
  • ASG_AVG_CPU_UTILIZATION:平均CPU使用率
  • ASG_AVG_LAN_TRAFFIC_OUT:平均内网出带宽
  • ASG_AVG_LAN_TRAFFIC_IN:平均内网入带宽
  • ASG_AVG_WAN_TRAFFIC_OUT:平均外网出带宽
  • ASG_AVG_WAN_TRAFFIC_IN:平均外网出带宽
  • - PredefinedMetricType *string `json:"PredefinedMetricType,omitempty" name:"PredefinedMetricType"` - - // 目标值,仅适用于目标追踪策略。
  • ASG_AVG_CPU_UTILIZATION:[1, 100),单位:%
  • ASG_AVG_LAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_LAN_TRAFFIC_IN:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_IN:>0,单位:Mbps
  • - TargetValue *uint64 `json:"TargetValue,omitempty" name:"TargetValue"` - - // 实例预热时间,单位为秒,仅适用于目标追踪策略。取值范围为0-3600,默认预热时间300秒。 - EstimatedInstanceWarmup *uint64 `json:"EstimatedInstanceWarmup,omitempty" name:"EstimatedInstanceWarmup"` - - // 是否禁用缩容,仅适用于目标追踪策略,默认值为 false。取值范围:
  • true:目标追踪策略仅触发扩容
  • false:目标追踪策略触发扩容和缩容
  • - DisableScaleIn *bool `json:"DisableScaleIn,omitempty" name:"DisableScaleIn"` - - // 此参数已不再生效,请使用[创建通知](https://cloud.tencent.com/document/api/377/33185)。 - // 通知组ID,即为用户组ID集合。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` -} - -type CreateScalingPolicyRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 告警触发策略名称。 - ScalingPolicyName *string `json:"ScalingPolicyName,omitempty" name:"ScalingPolicyName"` - - // 告警触发策略类型,默认类型为SIMPLE。取值范围:
  • SIMPLE:简单策略
  • TARGET_TRACKING:目标追踪策略
  • - ScalingPolicyType *string `json:"ScalingPolicyType,omitempty" name:"ScalingPolicyType"` - - // 告警触发后,期望实例数修改方式,仅适用于简单策略。取值范围:
  • CHANGE_IN_CAPACITY:增加或减少若干期望实例数
  • EXACT_CAPACITY:调整至指定期望实例数
  • PERCENT_CHANGE_IN_CAPACITY:按百分比调整期望实例数
  • - AdjustmentType *string `json:"AdjustmentType,omitempty" name:"AdjustmentType"` - - // 告警触发后,期望实例数的调整值,仅适用于简单策略。
  • 当 AdjustmentType 为 CHANGE_IN_CAPACITY 时,AdjustmentValue 为正数表示告警触发后增加实例,为负数表示告警触发后减少实例
  • 当 AdjustmentType 为 EXACT_CAPACITY 时,AdjustmentValue 的值即为告警触发后新的期望实例数,需要大于或等于0
  • 当 AdjustmentType 为 PERCENT_CHANGE_IN_CAPACITY 时,AdjusmentValue 为正数表示告警触发后按百分比增加实例,为负数表示告警触发后按百分比减少实例,单位是:%。 - AdjustmentValue *int64 `json:"AdjustmentValue,omitempty" name:"AdjustmentValue"` - - // 冷却时间,单位为秒,仅适用于简单策略。默认冷却时间300秒。 - Cooldown *uint64 `json:"Cooldown,omitempty" name:"Cooldown"` - - // 告警监控指标,仅适用于简单策略。 - MetricAlarm *MetricAlarm `json:"MetricAlarm,omitempty" name:"MetricAlarm"` - - // 预定义监控项,仅适用于目标追踪策略。取值范围:
  • ASG_AVG_CPU_UTILIZATION:平均CPU使用率
  • ASG_AVG_LAN_TRAFFIC_OUT:平均内网出带宽
  • ASG_AVG_LAN_TRAFFIC_IN:平均内网入带宽
  • ASG_AVG_WAN_TRAFFIC_OUT:平均外网出带宽
  • ASG_AVG_WAN_TRAFFIC_IN:平均外网出带宽
  • - PredefinedMetricType *string `json:"PredefinedMetricType,omitempty" name:"PredefinedMetricType"` - - // 目标值,仅适用于目标追踪策略。
  • ASG_AVG_CPU_UTILIZATION:[1, 100),单位:%
  • ASG_AVG_LAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_LAN_TRAFFIC_IN:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_IN:>0,单位:Mbps
  • - TargetValue *uint64 `json:"TargetValue,omitempty" name:"TargetValue"` - - // 实例预热时间,单位为秒,仅适用于目标追踪策略。取值范围为0-3600,默认预热时间300秒。 - EstimatedInstanceWarmup *uint64 `json:"EstimatedInstanceWarmup,omitempty" name:"EstimatedInstanceWarmup"` - - // 是否禁用缩容,仅适用于目标追踪策略,默认值为 false。取值范围:
  • true:目标追踪策略仅触发扩容
  • false:目标追踪策略触发扩容和缩容
  • - DisableScaleIn *bool `json:"DisableScaleIn,omitempty" name:"DisableScaleIn"` - - // 此参数已不再生效,请使用[创建通知](https://cloud.tencent.com/document/api/377/33185)。 - // 通知组ID,即为用户组ID集合。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` -} - -func (r *CreateScalingPolicyRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateScalingPolicyRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "ScalingPolicyName") - delete(f, "ScalingPolicyType") - delete(f, "AdjustmentType") - delete(f, "AdjustmentValue") - delete(f, "Cooldown") - delete(f, "MetricAlarm") - delete(f, "PredefinedMetricType") - delete(f, "TargetValue") - delete(f, "EstimatedInstanceWarmup") - delete(f, "DisableScaleIn") - delete(f, "NotificationUserGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateScalingPolicyRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateScalingPolicyResponseParams struct { - // 告警触发策略ID。 - AutoScalingPolicyId *string `json:"AutoScalingPolicyId,omitempty" name:"AutoScalingPolicyId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateScalingPolicyResponse struct { - *tchttp.BaseResponse - Response *CreateScalingPolicyResponseParams `json:"Response"` -} - -func (r *CreateScalingPolicyResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateScalingPolicyResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateScheduledActionRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 定时任务名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。同一伸缩组下必须唯一。 - ScheduledActionName *string `json:"ScheduledActionName,omitempty" name:"ScheduledActionName"` - - // 当定时任务触发时,设置的伸缩组最大实例数。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 当定时任务触发时,设置的伸缩组最小实例数。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 当定时任务触发时,设置的伸缩组期望实例数。 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 定时任务的首次触发时间,取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 定时任务的结束时间,取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。

    此参数与`Recurrence`需要同时指定,到达结束时间之后,定时任务将不再生效。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 定时任务的重复方式。为标准 Cron 格式

    此参数与`EndTime`需要同时指定。 - Recurrence *string `json:"Recurrence,omitempty" name:"Recurrence"` -} - -type CreateScheduledActionRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 定时任务名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。同一伸缩组下必须唯一。 - ScheduledActionName *string `json:"ScheduledActionName,omitempty" name:"ScheduledActionName"` - - // 当定时任务触发时,设置的伸缩组最大实例数。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 当定时任务触发时,设置的伸缩组最小实例数。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 当定时任务触发时,设置的伸缩组期望实例数。 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 定时任务的首次触发时间,取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 定时任务的结束时间,取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。

    此参数与`Recurrence`需要同时指定,到达结束时间之后,定时任务将不再生效。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 定时任务的重复方式。为标准 Cron 格式

    此参数与`EndTime`需要同时指定。 - Recurrence *string `json:"Recurrence,omitempty" name:"Recurrence"` -} - -func (r *CreateScheduledActionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateScheduledActionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "ScheduledActionName") - delete(f, "MaxSize") - delete(f, "MinSize") - delete(f, "DesiredCapacity") - delete(f, "StartTime") - delete(f, "EndTime") - delete(f, "Recurrence") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateScheduledActionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateScheduledActionResponseParams struct { - // 定时任务ID - ScheduledActionId *string `json:"ScheduledActionId,omitempty" name:"ScheduledActionId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateScheduledActionResponse struct { - *tchttp.BaseResponse - Response *CreateScheduledActionResponseParams `json:"Response"` -} - -func (r *CreateScheduledActionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateScheduledActionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type DataDisk struct { - // 数据盘类型。数据盘类型限制详见[云硬盘类型](https://cloud.tencent.com/document/product/362/2353)。取值范围:
  • LOCAL_BASIC:本地硬盘
  • LOCAL_SSD:本地SSD硬盘
  • CLOUD_BASIC:普通云硬盘
  • CLOUD_PREMIUM:高性能云硬盘
  • CLOUD_SSD:SSD云硬盘
  • CLOUD_HSSD:增强型SSD云硬盘
  • CLOUD_TSSD:极速型SSD云硬盘

    默认取值与系统盘类型(SystemDisk.DiskType)保持一致。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiskType *string `json:"DiskType,omitempty" name:"DiskType"` - - // 数据盘大小,单位:GB。最小调整步长为10G,不同数据盘类型取值范围不同,具体限制详见:[CVM实例配置](https://cloud.tencent.com/document/product/213/2177)。默认值为0,表示不购买数据盘。更多限制详见产品文档。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiskSize *uint64 `json:"DiskSize,omitempty" name:"DiskSize"` - - // 数据盘快照 ID,类似 `snap-l8psqwnt`。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SnapshotId *string `json:"SnapshotId,omitempty" name:"SnapshotId"` - - // 数据盘是否随子机销毁。取值范围:
  • TRUE:子机销毁时,销毁数据盘,只支持按小时后付费云盘
  • FALSE:子机销毁时,保留数据盘 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeleteWithInstance *bool `json:"DeleteWithInstance,omitempty" name:"DeleteWithInstance"` - - // 数据盘是否加密。取值范围:
  • TRUE:加密
  • FALSE:不加密 - // 注意:此字段可能返回 null,表示取不到有效值。 - Encrypt *bool `json:"Encrypt,omitempty" name:"Encrypt"` - - // 云硬盘性能,单位:MB/s。使用此参数可给云硬盘购买额外的性能,功能介绍和类型限制详见:[增强型 SSD 云硬盘额外性能说明](https://cloud.tencent.com/document/product/362/51896#.E5.A2.9E.E5.BC.BA.E5.9E.8B-ssd-.E4.BA.91.E7.A1.AC.E7.9B.98.E9.A2.9D.E5.A4.96.E6.80.A7.E8.83.BD)。 - // 当前仅支持极速型云盘(CLOUD_TSSD)和增强型SSD云硬盘(CLOUD_HSSD)且 需容量 > 460GB。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ThroughputPerformance *uint64 `json:"ThroughputPerformance,omitempty" name:"ThroughputPerformance"` -} - -// Predefined struct for user -type DeleteAutoScalingGroupRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` -} - -type DeleteAutoScalingGroupRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` -} - -func (r *DeleteAutoScalingGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteAutoScalingGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteAutoScalingGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteAutoScalingGroupResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteAutoScalingGroupResponse struct { - *tchttp.BaseResponse - Response *DeleteAutoScalingGroupResponseParams `json:"Response"` -} - -func (r *DeleteAutoScalingGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteAutoScalingGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLaunchConfigurationRequestParams struct { - // 需要删除的启动配置ID。 - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` -} - -type DeleteLaunchConfigurationRequest struct { - *tchttp.BaseRequest - - // 需要删除的启动配置ID。 - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` -} - -func (r *DeleteLaunchConfigurationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLaunchConfigurationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchConfigurationId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteLaunchConfigurationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLaunchConfigurationResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteLaunchConfigurationResponse struct { - *tchttp.BaseResponse - Response *DeleteLaunchConfigurationResponseParams `json:"Response"` -} - -func (r *DeleteLaunchConfigurationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLaunchConfigurationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLifecycleHookRequestParams struct { - // 生命周期挂钩ID - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` -} - -type DeleteLifecycleHookRequest struct { - *tchttp.BaseRequest - - // 生命周期挂钩ID - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` -} - -func (r *DeleteLifecycleHookRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLifecycleHookRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LifecycleHookId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteLifecycleHookRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLifecycleHookResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteLifecycleHookResponse struct { - *tchttp.BaseResponse - Response *DeleteLifecycleHookResponseParams `json:"Response"` -} - -func (r *DeleteLifecycleHookResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLifecycleHookResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNotificationConfigurationRequestParams struct { - // 待删除的通知ID。 - AutoScalingNotificationId *string `json:"AutoScalingNotificationId,omitempty" name:"AutoScalingNotificationId"` -} - -type DeleteNotificationConfigurationRequest struct { - *tchttp.BaseRequest - - // 待删除的通知ID。 - AutoScalingNotificationId *string `json:"AutoScalingNotificationId,omitempty" name:"AutoScalingNotificationId"` -} - -func (r *DeleteNotificationConfigurationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNotificationConfigurationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingNotificationId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNotificationConfigurationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNotificationConfigurationResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteNotificationConfigurationResponse struct { - *tchttp.BaseResponse - Response *DeleteNotificationConfigurationResponseParams `json:"Response"` -} - -func (r *DeleteNotificationConfigurationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNotificationConfigurationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteScalingPolicyRequestParams struct { - // 待删除的告警策略ID。 - AutoScalingPolicyId *string `json:"AutoScalingPolicyId,omitempty" name:"AutoScalingPolicyId"` -} - -type DeleteScalingPolicyRequest struct { - *tchttp.BaseRequest - - // 待删除的告警策略ID。 - AutoScalingPolicyId *string `json:"AutoScalingPolicyId,omitempty" name:"AutoScalingPolicyId"` -} - -func (r *DeleteScalingPolicyRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteScalingPolicyRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingPolicyId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteScalingPolicyRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteScalingPolicyResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteScalingPolicyResponse struct { - *tchttp.BaseResponse - Response *DeleteScalingPolicyResponseParams `json:"Response"` -} - -func (r *DeleteScalingPolicyResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteScalingPolicyResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteScheduledActionRequestParams struct { - // 待删除的定时任务ID。 - ScheduledActionId *string `json:"ScheduledActionId,omitempty" name:"ScheduledActionId"` -} - -type DeleteScheduledActionRequest struct { - *tchttp.BaseRequest - - // 待删除的定时任务ID。 - ScheduledActionId *string `json:"ScheduledActionId,omitempty" name:"ScheduledActionId"` -} - -func (r *DeleteScheduledActionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteScheduledActionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ScheduledActionId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteScheduledActionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteScheduledActionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteScheduledActionResponse struct { - *tchttp.BaseResponse - Response *DeleteScheduledActionResponseParams `json:"Response"` -} - -func (r *DeleteScheduledActionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteScheduledActionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAccountLimitsRequestParams struct { -} - -type DescribeAccountLimitsRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeAccountLimitsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAccountLimitsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAccountLimitsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAccountLimitsResponseParams struct { - // 用户账户被允许创建的启动配置最大数量 - MaxNumberOfLaunchConfigurations *int64 `json:"MaxNumberOfLaunchConfigurations,omitempty" name:"MaxNumberOfLaunchConfigurations"` - - // 用户账户启动配置的当前数量 - NumberOfLaunchConfigurations *int64 `json:"NumberOfLaunchConfigurations,omitempty" name:"NumberOfLaunchConfigurations"` - - // 用户账户被允许创建的伸缩组最大数量 - MaxNumberOfAutoScalingGroups *int64 `json:"MaxNumberOfAutoScalingGroups,omitempty" name:"MaxNumberOfAutoScalingGroups"` - - // 用户账户伸缩组的当前数量 - NumberOfAutoScalingGroups *int64 `json:"NumberOfAutoScalingGroups,omitempty" name:"NumberOfAutoScalingGroups"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAccountLimitsResponse struct { - *tchttp.BaseResponse - Response *DescribeAccountLimitsResponseParams `json:"Response"` -} - -func (r *DescribeAccountLimitsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAccountLimitsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingActivitiesRequestParams struct { - // 按照一个或者多个伸缩活动ID查询。伸缩活动ID形如:`asa-5l2ejpfo`。每次请求的上限为100。参数不支持同时指定`ActivityIds`和`Filters`。 - ActivityIds []*string `json:"ActivityIds,omitempty" name:"ActivityIds"` - - // 过滤条件。 - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - //
  • activity-status-code - String - 是否必填:否 -(过滤条件)按照伸缩活动状态过滤。(INIT:初始化中|RUNNING:运行中|SUCCESSFUL:活动成功|PARTIALLY_SUCCESSFUL:活动部分成功|FAILED:活动失败|CANCELLED:活动取消)
  • - //
  • activity-type - String - 是否必填:否 -(过滤条件)按照伸缩活动类型过滤。(SCALE_OUT:扩容活动|SCALE_IN:缩容活动|ATTACH_INSTANCES:添加实例|REMOVE_INSTANCES:销毁实例|DETACH_INSTANCES:移出实例|TERMINATE_INSTANCES_UNEXPECTEDLY:实例在CVM控制台被销毁|REPLACE_UNHEALTHY_INSTANCE:替换不健康实例|UPDATE_LOAD_BALANCERS:更新负载均衡器)
  • - //
  • activity-id - String - 是否必填:否 -(过滤条件)按照伸缩活动ID过滤。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`ActivityIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 伸缩活动最早的开始时间,如果指定了ActivityIds,此参数将被忽略。取值为`UTC`时间,按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ssZ`。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 伸缩活动最晚的结束时间,如果指定了ActivityIds,此参数将被忽略。取值为`UTC`时间,按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ssZ`。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -type DescribeAutoScalingActivitiesRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个伸缩活动ID查询。伸缩活动ID形如:`asa-5l2ejpfo`。每次请求的上限为100。参数不支持同时指定`ActivityIds`和`Filters`。 - ActivityIds []*string `json:"ActivityIds,omitempty" name:"ActivityIds"` - - // 过滤条件。 - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - //
  • activity-status-code - String - 是否必填:否 -(过滤条件)按照伸缩活动状态过滤。(INIT:初始化中|RUNNING:运行中|SUCCESSFUL:活动成功|PARTIALLY_SUCCESSFUL:活动部分成功|FAILED:活动失败|CANCELLED:活动取消)
  • - //
  • activity-type - String - 是否必填:否 -(过滤条件)按照伸缩活动类型过滤。(SCALE_OUT:扩容活动|SCALE_IN:缩容活动|ATTACH_INSTANCES:添加实例|REMOVE_INSTANCES:销毁实例|DETACH_INSTANCES:移出实例|TERMINATE_INSTANCES_UNEXPECTEDLY:实例在CVM控制台被销毁|REPLACE_UNHEALTHY_INSTANCE:替换不健康实例|UPDATE_LOAD_BALANCERS:更新负载均衡器)
  • - //
  • activity-id - String - 是否必填:否 -(过滤条件)按照伸缩活动ID过滤。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`ActivityIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 伸缩活动最早的开始时间,如果指定了ActivityIds,此参数将被忽略。取值为`UTC`时间,按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ssZ`。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 伸缩活动最晚的结束时间,如果指定了ActivityIds,此参数将被忽略。取值为`UTC`时间,按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ssZ`。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -func (r *DescribeAutoScalingActivitiesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingActivitiesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ActivityIds") - delete(f, "Filters") - delete(f, "Limit") - delete(f, "Offset") - delete(f, "StartTime") - delete(f, "EndTime") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAutoScalingActivitiesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingActivitiesResponseParams struct { - // 符合条件的伸缩活动数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 符合条件的伸缩活动信息集合。 - ActivitySet []*Activity `json:"ActivitySet,omitempty" name:"ActivitySet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAutoScalingActivitiesResponse struct { - *tchttp.BaseResponse - Response *DescribeAutoScalingActivitiesResponseParams `json:"Response"` -} - -func (r *DescribeAutoScalingActivitiesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingActivitiesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingAdvicesRequestParams struct { - // 待查询的伸缩组列表,上限100。 - AutoScalingGroupIds []*string `json:"AutoScalingGroupIds,omitempty" name:"AutoScalingGroupIds"` -} - -type DescribeAutoScalingAdvicesRequest struct { - *tchttp.BaseRequest - - // 待查询的伸缩组列表,上限100。 - AutoScalingGroupIds []*string `json:"AutoScalingGroupIds,omitempty" name:"AutoScalingGroupIds"` -} - -func (r *DescribeAutoScalingAdvicesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingAdvicesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAutoScalingAdvicesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingAdvicesResponseParams struct { - // 伸缩组配置建议集合。 - AutoScalingAdviceSet []*AutoScalingAdvice `json:"AutoScalingAdviceSet,omitempty" name:"AutoScalingAdviceSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAutoScalingAdvicesResponse struct { - *tchttp.BaseResponse - Response *DescribeAutoScalingAdvicesResponseParams `json:"Response"` -} - -func (r *DescribeAutoScalingAdvicesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingAdvicesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingGroupLastActivitiesRequestParams struct { - // 伸缩组ID列表 - AutoScalingGroupIds []*string `json:"AutoScalingGroupIds,omitempty" name:"AutoScalingGroupIds"` -} - -type DescribeAutoScalingGroupLastActivitiesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID列表 - AutoScalingGroupIds []*string `json:"AutoScalingGroupIds,omitempty" name:"AutoScalingGroupIds"` -} - -func (r *DescribeAutoScalingGroupLastActivitiesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingGroupLastActivitiesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAutoScalingGroupLastActivitiesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingGroupLastActivitiesResponseParams struct { - // 符合条件的伸缩活动信息集合。说明:伸缩组伸缩活动不存在的则不返回,如传50个伸缩组ID,返回45条数据,说明其中有5个伸缩组伸缩活动不存在。 - ActivitySet []*Activity `json:"ActivitySet,omitempty" name:"ActivitySet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAutoScalingGroupLastActivitiesResponse struct { - *tchttp.BaseResponse - Response *DescribeAutoScalingGroupLastActivitiesResponseParams `json:"Response"` -} - -func (r *DescribeAutoScalingGroupLastActivitiesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingGroupLastActivitiesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingGroupsRequestParams struct { - // 按照一个或者多个伸缩组ID查询。伸缩组ID形如:`asg-nkdwoui0`。每次请求的上限为100。参数不支持同时指定`AutoScalingGroupIds`和`Filters`。 - AutoScalingGroupIds []*string `json:"AutoScalingGroupIds,omitempty" name:"AutoScalingGroupIds"` - - // 过滤条件。 - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - //
  • auto-scaling-group-name - String - 是否必填:否 -(过滤条件)按照伸缩组名称过滤。
  • - //
  • vague-auto-scaling-group-name - String - 是否必填:否 -(过滤条件)按照伸缩组名称模糊搜索。
  • - //
  • launch-configuration-id - String - 是否必填:否 -(过滤条件)按照启动配置ID过滤。
  • - //
  • tag-key - String - 是否必填:否 -(过滤条件)按照标签键进行过滤。
  • - //
  • tag-value - String - 是否必填:否 -(过滤条件)按照标签值进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AutoScalingGroupIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -type DescribeAutoScalingGroupsRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个伸缩组ID查询。伸缩组ID形如:`asg-nkdwoui0`。每次请求的上限为100。参数不支持同时指定`AutoScalingGroupIds`和`Filters`。 - AutoScalingGroupIds []*string `json:"AutoScalingGroupIds,omitempty" name:"AutoScalingGroupIds"` - - // 过滤条件。 - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - //
  • auto-scaling-group-name - String - 是否必填:否 -(过滤条件)按照伸缩组名称过滤。
  • - //
  • vague-auto-scaling-group-name - String - 是否必填:否 -(过滤条件)按照伸缩组名称模糊搜索。
  • - //
  • launch-configuration-id - String - 是否必填:否 -(过滤条件)按照启动配置ID过滤。
  • - //
  • tag-key - String - 是否必填:否 -(过滤条件)按照标签键进行过滤。
  • - //
  • tag-value - String - 是否必填:否 -(过滤条件)按照标签值进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AutoScalingGroupIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -func (r *DescribeAutoScalingGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupIds") - delete(f, "Filters") - delete(f, "Limit") - delete(f, "Offset") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAutoScalingGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingGroupsResponseParams struct { - // 伸缩组详细信息列表。 - AutoScalingGroupSet []*AutoScalingGroup `json:"AutoScalingGroupSet,omitempty" name:"AutoScalingGroupSet"` - - // 符合条件的伸缩组数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAutoScalingGroupsResponse struct { - *tchttp.BaseResponse - Response *DescribeAutoScalingGroupsResponseParams `json:"Response"` -} - -func (r *DescribeAutoScalingGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingInstancesRequestParams struct { - // 待查询云服务器(CVM)的实例ID。每次请求的上限为100。参数不支持同时指定InstanceIds和Filters。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 过滤条件。 - //
  • instance-id - String - 是否必填:否 -(过滤条件)按照实例ID过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`InstanceIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeAutoScalingInstancesRequest struct { - *tchttp.BaseRequest - - // 待查询云服务器(CVM)的实例ID。每次请求的上限为100。参数不支持同时指定InstanceIds和Filters。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 过滤条件。 - //
  • instance-id - String - 是否必填:否 -(过滤条件)按照实例ID过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`InstanceIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeAutoScalingInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAutoScalingInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAutoScalingInstancesResponseParams struct { - // 实例详细信息列表。 - AutoScalingInstanceSet []*Instance `json:"AutoScalingInstanceSet,omitempty" name:"AutoScalingInstanceSet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAutoScalingInstancesResponse struct { - *tchttp.BaseResponse - Response *DescribeAutoScalingInstancesResponseParams `json:"Response"` -} - -func (r *DescribeAutoScalingInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAutoScalingInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLaunchConfigurationsRequestParams struct { - // 按照一个或者多个启动配置ID查询。启动配置ID形如:`asc-ouy1ax38`。每次请求的上限为100。参数不支持同时指定`LaunchConfigurationIds`和`Filters` - LaunchConfigurationIds []*string `json:"LaunchConfigurationIds,omitempty" name:"LaunchConfigurationIds"` - - // 过滤条件。 - //
  • launch-configuration-id - String - 是否必填:否 -(过滤条件)按照启动配置ID过滤。
  • - //
  • launch-configuration-name - String - 是否必填:否 -(过滤条件)按照启动配置名称过滤。
  • - //
  • vague-launch-configuration-name - String - 是否必填:否 -(过滤条件)按照启动配置名称模糊搜索。
  • - //
  • tag-key - String - 是否必填:否 -(过滤条件)按照标签键进行过滤。
  • - //
  • tag-value - String - 是否必填:否 -(过滤条件)按照标签值进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例3 - //
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`LaunchConfigurationIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -type DescribeLaunchConfigurationsRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个启动配置ID查询。启动配置ID形如:`asc-ouy1ax38`。每次请求的上限为100。参数不支持同时指定`LaunchConfigurationIds`和`Filters` - LaunchConfigurationIds []*string `json:"LaunchConfigurationIds,omitempty" name:"LaunchConfigurationIds"` - - // 过滤条件。 - //
  • launch-configuration-id - String - 是否必填:否 -(过滤条件)按照启动配置ID过滤。
  • - //
  • launch-configuration-name - String - 是否必填:否 -(过滤条件)按照启动配置名称过滤。
  • - //
  • vague-launch-configuration-name - String - 是否必填:否 -(过滤条件)按照启动配置名称模糊搜索。
  • - //
  • tag-key - String - 是否必填:否 -(过滤条件)按照标签键进行过滤。
  • - //
  • tag-value - String - 是否必填:否 -(过滤条件)按照标签值进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例3 - //
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`LaunchConfigurationIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -func (r *DescribeLaunchConfigurationsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLaunchConfigurationsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchConfigurationIds") - delete(f, "Filters") - delete(f, "Limit") - delete(f, "Offset") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeLaunchConfigurationsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLaunchConfigurationsResponseParams struct { - // 符合条件的启动配置数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 启动配置详细信息列表。 - LaunchConfigurationSet []*LaunchConfiguration `json:"LaunchConfigurationSet,omitempty" name:"LaunchConfigurationSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeLaunchConfigurationsResponse struct { - *tchttp.BaseResponse - Response *DescribeLaunchConfigurationsResponseParams `json:"Response"` -} - -func (r *DescribeLaunchConfigurationsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLaunchConfigurationsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLifecycleHooksRequestParams struct { - // 按照一个或者多个生命周期挂钩ID查询。生命周期挂钩ID形如:`ash-8azjzxcl`。每次请求的上限为100。参数不支持同时指定`LifecycleHookIds`和`Filters`。 - LifecycleHookIds []*string `json:"LifecycleHookIds,omitempty" name:"LifecycleHookIds"` - - // 过滤条件。 - //
  • lifecycle-hook-id - String - 是否必填:否 -(过滤条件)按照生命周期挂钩ID过滤。
  • - //
  • lifecycle-hook-name - String - 是否必填:否 -(过滤条件)按照生命周期挂钩名称过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`LifecycleHookIds `和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -type DescribeLifecycleHooksRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个生命周期挂钩ID查询。生命周期挂钩ID形如:`ash-8azjzxcl`。每次请求的上限为100。参数不支持同时指定`LifecycleHookIds`和`Filters`。 - LifecycleHookIds []*string `json:"LifecycleHookIds,omitempty" name:"LifecycleHookIds"` - - // 过滤条件。 - //
  • lifecycle-hook-id - String - 是否必填:否 -(过滤条件)按照生命周期挂钩ID过滤。
  • - //
  • lifecycle-hook-name - String - 是否必填:否 -(过滤条件)按照生命周期挂钩名称过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`LifecycleHookIds `和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -func (r *DescribeLifecycleHooksRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLifecycleHooksRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LifecycleHookIds") - delete(f, "Filters") - delete(f, "Limit") - delete(f, "Offset") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeLifecycleHooksRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLifecycleHooksResponseParams struct { - // 生命周期挂钩数组 - LifecycleHookSet []*LifecycleHook `json:"LifecycleHookSet,omitempty" name:"LifecycleHookSet"` - - // 总体数量 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeLifecycleHooksResponse struct { - *tchttp.BaseResponse - Response *DescribeLifecycleHooksResponseParams `json:"Response"` -} - -func (r *DescribeLifecycleHooksResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLifecycleHooksResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNotificationConfigurationsRequestParams struct { - // 按照一个或者多个通知ID查询。实例ID形如:asn-2sestqbr。每次请求的实例的上限为100。参数不支持同时指定`AutoScalingNotificationIds`和`Filters`。 - AutoScalingNotificationIds []*string `json:"AutoScalingNotificationIds,omitempty" name:"AutoScalingNotificationIds"` - - // 过滤条件。 - //
  • auto-scaling-notification-id - String - 是否必填:否 -(过滤条件)按照通知ID过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AutoScalingNotificationIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -type DescribeNotificationConfigurationsRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个通知ID查询。实例ID形如:asn-2sestqbr。每次请求的实例的上限为100。参数不支持同时指定`AutoScalingNotificationIds`和`Filters`。 - AutoScalingNotificationIds []*string `json:"AutoScalingNotificationIds,omitempty" name:"AutoScalingNotificationIds"` - - // 过滤条件。 - //
  • auto-scaling-notification-id - String - 是否必填:否 -(过滤条件)按照通知ID过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AutoScalingNotificationIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -func (r *DescribeNotificationConfigurationsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNotificationConfigurationsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingNotificationIds") - delete(f, "Filters") - delete(f, "Limit") - delete(f, "Offset") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNotificationConfigurationsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNotificationConfigurationsResponseParams struct { - // 符合条件的通知数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 弹性伸缩事件通知详细信息列表。 - AutoScalingNotificationSet []*AutoScalingNotification `json:"AutoScalingNotificationSet,omitempty" name:"AutoScalingNotificationSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNotificationConfigurationsResponse struct { - *tchttp.BaseResponse - Response *DescribeNotificationConfigurationsResponseParams `json:"Response"` -} - -func (r *DescribeNotificationConfigurationsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNotificationConfigurationsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeScalingPoliciesRequestParams struct { - // 按照一个或者多个告警策略ID查询。告警策略ID形如:asp-i9vkg894。每次请求的实例的上限为100。参数不支持同时指定`AutoScalingPolicyIds`和`Filters`。 - AutoScalingPolicyIds []*string `json:"AutoScalingPolicyIds,omitempty" name:"AutoScalingPolicyIds"` - - // 过滤条件。 - //
  • auto-scaling-policy-id - String - 是否必填:否 -(过滤条件)按照告警策略ID过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - //
  • scaling-policy-name - String - 是否必填:否 -(过滤条件)按照告警策略名称过滤。
  • - //
  • scaling-policy-type - String - 是否必填:否 -(过滤条件)按照告警策略类型过滤,取值范围为SIMPLE,TARGET_TRACKING。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AutoScalingPolicyIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -type DescribeScalingPoliciesRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个告警策略ID查询。告警策略ID形如:asp-i9vkg894。每次请求的实例的上限为100。参数不支持同时指定`AutoScalingPolicyIds`和`Filters`。 - AutoScalingPolicyIds []*string `json:"AutoScalingPolicyIds,omitempty" name:"AutoScalingPolicyIds"` - - // 过滤条件。 - //
  • auto-scaling-policy-id - String - 是否必填:否 -(过滤条件)按照告警策略ID过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 -(过滤条件)按照伸缩组ID过滤。
  • - //
  • scaling-policy-name - String - 是否必填:否 -(过滤条件)按照告警策略名称过滤。
  • - //
  • scaling-policy-type - String - 是否必填:否 -(过滤条件)按照告警策略类型过滤,取值范围为SIMPLE,TARGET_TRACKING。
  • - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AutoScalingPolicyIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` -} - -func (r *DescribeScalingPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeScalingPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingPolicyIds") - delete(f, "Filters") - delete(f, "Limit") - delete(f, "Offset") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeScalingPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeScalingPoliciesResponseParams struct { - // 弹性伸缩告警触发策略详细信息列表。 - ScalingPolicySet []*ScalingPolicy `json:"ScalingPolicySet,omitempty" name:"ScalingPolicySet"` - - // 符合条件的通知数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeScalingPoliciesResponse struct { - *tchttp.BaseResponse - Response *DescribeScalingPoliciesResponseParams `json:"Response"` -} - -func (r *DescribeScalingPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeScalingPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeScheduledActionsRequestParams struct { - // 按照一个或者多个定时任务ID查询。实例ID形如:asst-am691zxo。每次请求的实例的上限为100。参数不支持同时指定ScheduledActionIds和Filters。 - ScheduledActionIds []*string `json:"ScheduledActionIds,omitempty" name:"ScheduledActionIds"` - - // 过滤条件。 - //
  • scheduled-action-id - String - 是否必填:否 -(过滤条件)按照定时任务ID过滤。
  • - //
  • scheduled-action-name - String - 是否必填:否 - (过滤条件) 按照定时任务名称过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 - (过滤条件) 按照伸缩组ID过滤。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于Offset的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于Limit的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeScheduledActionsRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个定时任务ID查询。实例ID形如:asst-am691zxo。每次请求的实例的上限为100。参数不支持同时指定ScheduledActionIds和Filters。 - ScheduledActionIds []*string `json:"ScheduledActionIds,omitempty" name:"ScheduledActionIds"` - - // 过滤条件。 - //
  • scheduled-action-id - String - 是否必填:否 -(过滤条件)按照定时任务ID过滤。
  • - //
  • scheduled-action-name - String - 是否必填:否 - (过滤条件) 按照定时任务名称过滤。
  • - //
  • auto-scaling-group-id - String - 是否必填:否 - (过滤条件) 按照伸缩组ID过滤。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于Offset的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于Limit的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeScheduledActionsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeScheduledActionsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ScheduledActionIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeScheduledActionsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeScheduledActionsResponseParams struct { - // 符合条件的定时任务数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 定时任务详细信息列表。 - ScheduledActionSet []*ScheduledAction `json:"ScheduledActionSet,omitempty" name:"ScheduledActionSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeScheduledActionsResponse struct { - *tchttp.BaseResponse - Response *DescribeScheduledActionsResponseParams `json:"Response"` -} - -func (r *DescribeScheduledActionsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeScheduledActionsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachInstancesRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type DetachInstancesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *DetachInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DetachInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachInstancesResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DetachInstancesResponse struct { - *tchttp.BaseResponse - Response *DetachInstancesResponseParams `json:"Response"` -} - -func (r *DetachInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachLoadBalancersRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 传统负载均衡器ID列表,列表长度上限为20,LoadBalancerIds 和 ForwardLoadBalancerIdentifications 二者同时最多只能指定一个 - LoadBalancerIds []*string `json:"LoadBalancerIds,omitempty" name:"LoadBalancerIds"` - - // 应用型负载均衡器标识信息列表,列表长度上限为100,LoadBalancerIds 和 ForwardLoadBalancerIdentifications二者同时最多只能指定一个 - ForwardLoadBalancerIdentifications []*ForwardLoadBalancerIdentification `json:"ForwardLoadBalancerIdentifications,omitempty" name:"ForwardLoadBalancerIdentifications"` -} - -type DetachLoadBalancersRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 传统负载均衡器ID列表,列表长度上限为20,LoadBalancerIds 和 ForwardLoadBalancerIdentifications 二者同时最多只能指定一个 - LoadBalancerIds []*string `json:"LoadBalancerIds,omitempty" name:"LoadBalancerIds"` - - // 应用型负载均衡器标识信息列表,列表长度上限为100,LoadBalancerIds 和 ForwardLoadBalancerIdentifications二者同时最多只能指定一个 - ForwardLoadBalancerIdentifications []*ForwardLoadBalancerIdentification `json:"ForwardLoadBalancerIdentifications,omitempty" name:"ForwardLoadBalancerIdentifications"` -} - -func (r *DetachLoadBalancersRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachLoadBalancersRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "LoadBalancerIds") - delete(f, "ForwardLoadBalancerIdentifications") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DetachLoadBalancersRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachLoadBalancersResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DetachLoadBalancersResponse struct { - *tchttp.BaseResponse - Response *DetachLoadBalancersResponseParams `json:"Response"` -} - -func (r *DetachLoadBalancersResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachLoadBalancersResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type DetailedStatusMessage struct { - // 错误类型。 - Code *string `json:"Code,omitempty" name:"Code"` - - // 可用区信息。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例计费类型。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 子网ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 错误描述。 - Message *string `json:"Message,omitempty" name:"Message"` - - // 实例类型。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` -} - -// Predefined struct for user -type DisableAutoScalingGroupRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` -} - -type DisableAutoScalingGroupRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` -} - -func (r *DisableAutoScalingGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableAutoScalingGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableAutoScalingGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableAutoScalingGroupResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisableAutoScalingGroupResponse struct { - *tchttp.BaseResponse - Response *DisableAutoScalingGroupResponseParams `json:"Response"` -} - -func (r *DisableAutoScalingGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableAutoScalingGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableAutoScalingGroupRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` -} - -type EnableAutoScalingGroupRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` -} - -func (r *EnableAutoScalingGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableAutoScalingGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableAutoScalingGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableAutoScalingGroupResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type EnableAutoScalingGroupResponse struct { - *tchttp.BaseResponse - Response *EnableAutoScalingGroupResponseParams `json:"Response"` -} - -func (r *EnableAutoScalingGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableAutoScalingGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type EnhancedService struct { - // 开启云安全服务。若不指定该参数,则默认开启云安全服务。 - SecurityService *RunSecurityServiceEnabled `json:"SecurityService,omitempty" name:"SecurityService"` - - // 开启云监控服务。若不指定该参数,则默认开启云监控服务。 - MonitorService *RunMonitorServiceEnabled `json:"MonitorService,omitempty" name:"MonitorService"` - - // 该参数已废弃,查询时会返回空值,请勿使用。 - // - // Deprecated: AutomationService is deprecated. - AutomationService []*RunAutomationServiceEnabled `json:"AutomationService,omitempty" name:"AutomationService"` - - // 开启自动化助手服务。若不指定该参数,则默认逻辑与CVM保持一致。注意:此字段可能返回 null,表示取不到有效值。 - AutomationToolsService *RunAutomationServiceEnabled `json:"AutomationToolsService,omitempty" name:"AutomationToolsService"` -} - -// Predefined struct for user -type ExecuteScalingPolicyRequestParams struct { - // 告警伸缩策略ID,不支持目标追踪策略。 - AutoScalingPolicyId *string `json:"AutoScalingPolicyId,omitempty" name:"AutoScalingPolicyId"` - - // 是否检查伸缩组活动处于冷却时间内,默认值为false - HonorCooldown *bool `json:"HonorCooldown,omitempty" name:"HonorCooldown"` - - // 执行伸缩策略的触发来源,取值包括 API 和 CLOUD_MONITOR,默认值为 API。CLOUD_MONITOR 专门供云监控触发调用。 - TriggerSource *string `json:"TriggerSource,omitempty" name:"TriggerSource"` -} - -type ExecuteScalingPolicyRequest struct { - *tchttp.BaseRequest - - // 告警伸缩策略ID,不支持目标追踪策略。 - AutoScalingPolicyId *string `json:"AutoScalingPolicyId,omitempty" name:"AutoScalingPolicyId"` - - // 是否检查伸缩组活动处于冷却时间内,默认值为false - HonorCooldown *bool `json:"HonorCooldown,omitempty" name:"HonorCooldown"` - - // 执行伸缩策略的触发来源,取值包括 API 和 CLOUD_MONITOR,默认值为 API。CLOUD_MONITOR 专门供云监控触发调用。 - TriggerSource *string `json:"TriggerSource,omitempty" name:"TriggerSource"` -} - -func (r *ExecuteScalingPolicyRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ExecuteScalingPolicyRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingPolicyId") - delete(f, "HonorCooldown") - delete(f, "TriggerSource") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ExecuteScalingPolicyRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ExecuteScalingPolicyResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ExecuteScalingPolicyResponse struct { - *tchttp.BaseResponse - Response *ExecuteScalingPolicyResponseParams `json:"Response"` -} - -func (r *ExecuteScalingPolicyResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ExecuteScalingPolicyResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type Filter struct { - // 需要过滤的字段。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 字段的过滤值。 - Values []*string `json:"Values,omitempty" name:"Values"` -} - -type ForwardLoadBalancer struct { - // 负载均衡器ID - LoadBalancerId *string `json:"LoadBalancerId,omitempty" name:"LoadBalancerId"` - - // 应用型负载均衡监听器 ID - ListenerId *string `json:"ListenerId,omitempty" name:"ListenerId"` - - // 目标规则属性列表 - TargetAttributes []*TargetAttribute `json:"TargetAttributes,omitempty" name:"TargetAttributes"` - - // 转发规则ID,注意:针对七层监听器此参数必填 - LocationId *string `json:"LocationId,omitempty" name:"LocationId"` - - // 负载均衡实例所属地域,默认取AS服务所在地域。格式与公共参数Region相同,如:"ap-guangzhou"。 - Region *string `json:"Region,omitempty" name:"Region"` -} - -type ForwardLoadBalancerIdentification struct { - // 负载均衡器ID - LoadBalancerId *string `json:"LoadBalancerId,omitempty" name:"LoadBalancerId"` - - // 应用型负载均衡监听器 ID - ListenerId *string `json:"ListenerId,omitempty" name:"ListenerId"` - - // 转发规则ID,注意:针对七层监听器此参数必填 - LocationId *string `json:"LocationId,omitempty" name:"LocationId"` -} - -type HostNameSettings struct { - // 云服务器的主机名。 - //
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。 - //
  • 不支持 Windows 实例。 - //
  • 其他类型(Linux 等)实例:字符长度为[2, 40],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。不允许为纯数字。 - // 注意:此字段可能返回 null,表示取不到有效值。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 云服务器主机名的风格,取值范围包括 ORIGINAL 和 UNIQUE,默认为 ORIGINAL。 - //
  • ORIGINAL,AS 直接将入参中所填的 HostName 传递给 CVM,CVM 可能会对 HostName 追加序列号,伸缩组中实例的 HostName 会出现冲突的情况。 - //
  • UNIQUE,入参所填的 HostName 相当于主机名前缀,AS 和 CVM 会对其进行拓展,伸缩组中实例的 HostName 可以保证唯一。 - // 注意:此字段可能返回 null,表示取不到有效值。 - HostNameStyle *string `json:"HostNameStyle,omitempty" name:"HostNameStyle"` -} - -type IPv6InternetAccessible struct { - // 网络计费模式。取值包括TRAFFIC_POSTPAID_BY_HOUR、BANDWIDTH_PACKAGE,默认取值为TRAFFIC_POSTPAID_BY_HOUR。查看当前账户类型可参考[账户类型说明](https://cloud.tencent.com/document/product/1199/49090#judge)。 - //
  • IPv6对标准账户类型支持TRAFFIC_POSTPAID_BY_HOUR。 - //
  • IPv6对传统账户类型支持BANDWIDTH_PACKAGE。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 公网出带宽上限,单位:Mbps。
    默认值:0,此时不为IPv6分配公网带宽。不同机型、可用区、计费模式的带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 带宽包ID。可通过[DescribeBandwidthPackages](https://cloud.tencent.com/document/api/215/19209)接口返回值中的`BandwidthPackageId`获取。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -type Instance struct { - // 实例ID - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 启动配置名称 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 生命周期状态,取值如下:
    - //
  • IN_SERVICE:运行中 - //
  • CREATING:创建中 - //
  • CREATION_FAILED:创建失败 - //
  • TERMINATING:中止中 - //
  • TERMINATION_FAILED:中止失败 - //
  • ATTACHING:绑定中 - //
  • ATTACH_FAILED:绑定失败 - //
  • DETACHING:解绑中 - //
  • DETACH_FAILED:解绑失败 - //
  • ATTACHING_LB:绑定LB中 - //
  • DETACHING_LB:解绑LB中 - //
  • MODIFYING_LB:修改LB中 - //
  • STARTING:开机中 - //
  • START_FAILED:开机失败 - //
  • STOPPING:关机中 - //
  • STOP_FAILED:关机失败 - //
  • STOPPED:已关机 - //
  • IN_LAUNCHING_HOOK:扩容生命周期挂钩中 - //
  • IN_TERMINATING_HOOK:缩容生命周期挂钩中 - LifeCycleState *string `json:"LifeCycleState,omitempty" name:"LifeCycleState"` - - // 健康状态,取值包括HEALTHY和UNHEALTHY - HealthStatus *string `json:"HealthStatus,omitempty" name:"HealthStatus"` - - // 是否加入缩容保护 - ProtectedFromScaleIn *bool `json:"ProtectedFromScaleIn,omitempty" name:"ProtectedFromScaleIn"` - - // 可用区 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 创建类型,取值包括AUTO_CREATION, MANUAL_ATTACHING。 - CreationType *string `json:"CreationType,omitempty" name:"CreationType"` - - // 实例加入时间 - AddTime *string `json:"AddTime,omitempty" name:"AddTime"` - - // 实例类型 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 版本号 - VersionNumber *int64 `json:"VersionNumber,omitempty" name:"VersionNumber"` - - // 伸缩组名称 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` - - // 预热状态,取值如下: - //
  • WAITING_ENTER_WARMUP:等待进入预热 - //
  • NO_NEED_WARMUP:无需预热 - //
  • IN_WARMUP:预热中 - //
  • AFTER_WARMUP:完成预热 - WarmupStatus *string `json:"WarmupStatus,omitempty" name:"WarmupStatus"` - - // 置放群组id,仅支持指定一个。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` -} - -type InstanceChargePrepaid struct { - // 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36。 - Period *int64 `json:"Period,omitempty" name:"Period"` - - // 自动续费标识。取值范围:
  • NOTIFY_AND_AUTO_RENEW:通知过期且自动续费
  • NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费
  • DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费

    默认取值:NOTIFY_AND_MANUAL_RENEW。若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` -} - -type InstanceMarketOptionsRequest struct { - // 竞价相关选项 - SpotOptions *SpotMarketOptions `json:"SpotOptions,omitempty" name:"SpotOptions"` - - // 市场选项类型,当前只支持取值:spot - // 注意:此字段可能返回 null,表示取不到有效值。 - MarketType *string `json:"MarketType,omitempty" name:"MarketType"` -} - -type InstanceNameSettings struct { - // 云服务器的实例名。 - // - // 点号(.)和短横线(-)不能作为 InstanceName 的首尾字符,不能连续使用。 - // 字符长度为[2, 40],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。不允许为纯数字。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 云服务器实例名的风格,取值范围包括 ORIGINAL 和 UNIQUE,默认为 ORIGINAL。 - // - // ORIGINAL,AS 直接将入参中所填的 InstanceName 传递给 CVM,CVM 可能会对 InstanceName 追加序列号,伸缩组中实例的 InstanceName 会出现冲突的情况。 - // - // UNIQUE,入参所填的 InstanceName 相当于实例名前缀,AS 和 CVM 会对其进行拓展,伸缩组中实例的 InstanceName 可以保证唯一。 - InstanceNameStyle *string `json:"InstanceNameStyle,omitempty" name:"InstanceNameStyle"` -} - -type InstanceTag struct { - // 标签键 - Key *string `json:"Key,omitempty" name:"Key"` - - // 标签值 - Value *string `json:"Value,omitempty" name:"Value"` -} - -type InternetAccessible struct { - // 网络计费类型。取值范围:
  • BANDWIDTH_PREPAID:预付费按带宽结算
  • TRAFFIC_POSTPAID_BY_HOUR:流量按小时后付费
  • BANDWIDTH_POSTPAID_BY_HOUR:带宽按小时后付费
  • BANDWIDTH_PACKAGE:带宽包用户
    默认取值:TRAFFIC_POSTPAID_BY_HOUR。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 公网出带宽上限,单位:Mbps。默认值:0Mbps。不同机型带宽上限范围不一致,具体限制详见[购买网络带宽](https://cloud.tencent.com/document/product/213/509)。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 是否分配公网IP。取值范围:
  • TRUE:表示分配公网IP
  • FALSE:表示不分配公网IP

    当公网带宽大于0Mbps时,可自由选择开通与否,默认开通公网IP;当公网带宽为0,则不允许分配公网IP。 - // 注意:此字段可能返回 null,表示取不到有效值。 - PublicIpAssigned *bool `json:"PublicIpAssigned,omitempty" name:"PublicIpAssigned"` - - // 带宽包ID。可通过[DescribeBandwidthPackages](https://cloud.tencent.com/document/api/215/19209)接口返回值中的`BandwidthPackageId`获取。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -type InvocationResult struct { - // 实例ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 执行活动ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InvocationId *string `json:"InvocationId,omitempty" name:"InvocationId"` - - // 执行任务ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InvocationTaskId *string `json:"InvocationTaskId,omitempty" name:"InvocationTaskId"` - - // 命令ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CommandId *string `json:"CommandId,omitempty" name:"CommandId"` - - // 执行任务状态。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TaskStatus *string `json:"TaskStatus,omitempty" name:"TaskStatus"` - - // 执行异常信息。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ErrorMessage *string `json:"ErrorMessage,omitempty" name:"ErrorMessage"` -} - -type LaunchConfiguration struct { - // 实例所属项目ID。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 启动配置ID。 - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 启动配置名称。 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 实例机型。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例系统盘配置信息。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 实例登录设置。 - LoginSettings *LimitedLoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 公网带宽相关信息设置。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 实例所属安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 启动配置关联的伸缩组。 - AutoScalingGroupAbstractSet []*AutoScalingGroupAbstract `json:"AutoScalingGroupAbstractSet,omitempty" name:"AutoScalingGroupAbstractSet"` - - // 自定义数据。 - // 注意:此字段可能返回 null,表示取不到有效值。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 启动配置创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 实例的增强服务启用情况与其设置。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 镜像ID。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 启动配置当前状态。取值范围:
  • NORMAL:正常
  • IMAGE_ABNORMAL:启动配置镜像异常
  • CBS_SNAP_ABNORMAL:启动配置数据盘快照异常
  • SECURITY_GROUP_ABNORMAL:启动配置安全组异常
    - LaunchConfigurationStatus *string `json:"LaunchConfigurationStatus,omitempty" name:"LaunchConfigurationStatus"` - - // 实例计费类型,CVM默认值按照POSTPAID_BY_HOUR处理。 - //
  • POSTPAID_BY_HOUR:按小时后付费 - //
  • SPOTPAID:竞价付费 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 实例机型列表。 - InstanceTypes []*string `json:"InstanceTypes,omitempty" name:"InstanceTypes"` - - // 实例标签列表。扩容出来的实例会自动带上标签,最多支持10个标签。 - InstanceTags []*InstanceTag `json:"InstanceTags,omitempty" name:"InstanceTags"` - - // 标签列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 版本号。 - VersionNumber *int64 `json:"VersionNumber,omitempty" name:"VersionNumber"` - - // 更新时间。 - UpdatedTime *string `json:"UpdatedTime,omitempty" name:"UpdatedTime"` - - // CAM角色名称。可通过DescribeRoleList接口返回值中的roleName获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 上次操作时,InstanceTypesCheckPolicy 取值。 - LastOperationInstanceTypesCheckPolicy *string `json:"LastOperationInstanceTypesCheckPolicy,omitempty" name:"LastOperationInstanceTypesCheckPolicy"` - - // 云服务器主机名(HostName)的相关设置。 - HostNameSettings *HostNameSettings `json:"HostNameSettings,omitempty" name:"HostNameSettings"` - - // 云服务器实例名(InstanceName)的相关设置。 - InstanceNameSettings *InstanceNameSettings `json:"InstanceNameSettings,omitempty" name:"InstanceNameSettings"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 云盘类型选择策略。取值范围: - //
  • ORIGINAL:使用设置的云盘类型 - //
  • AUTOMATIC:自动选择当前可用区下可用的云盘类型 - DiskTypePolicy *string `json:"DiskTypePolicy,omitempty" name:"DiskTypePolicy"` - - // 高性能计算集群ID。
    - // 注意:此字段默认为空。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // IPv6公网带宽相关信息设置。 - IPv6InternetAccessible *IPv6InternetAccessible `json:"IPv6InternetAccessible,omitempty" name:"IPv6InternetAccessible"` -} - -type LifecycleActionResultInfo struct { - // 生命周期挂钩标识。 - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 实例标识。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 执行活动ID。可通过TAT的[查询执行活动](https://cloud.tencent.com/document/api/1340/52679)API查询具体的执行结果。 - InvocationId *string `json:"InvocationId,omitempty" name:"InvocationId"` - - // 命令调用的结果,表示执行TAT命令是否成功。
    - //
  • SUCCESSFUL 命令调用成功,不代表命令执行成功,执行的具体情况可根据InvocationId进行查询
  • - //
  • FAILED 命令调用失败
  • - //
  • NONE
  • - InvokeCommandResult *string `json:"InvokeCommandResult,omitempty" name:"InvokeCommandResult"` - - // 通知的结果,表示通知CMQ/TDMQ是否成功。
    - //
  • SUCCESSFUL 通知成功
  • - //
  • FAILED 通知失败
  • - //
  • NONE
  • - NotificationResult *string `json:"NotificationResult,omitempty" name:"NotificationResult"` - - // 生命周期挂钩动作的执行结果,取值包括 CONTINUE、ABANDON。 - LifecycleActionResult *string `json:"LifecycleActionResult,omitempty" name:"LifecycleActionResult"` - - // 结果的原因。
    - //
  • HEARTBEAT_TIMEOUT 由于心跳超时,结果根据DefaultResult设置。
  • - //
  • NOTIFICATION_FAILURE 由于发送通知失败,结果根据DefaultResult设置。
  • - //
  • CALL_INTERFACE 调用了接口CompleteLifecycleAction设置结果。
  • - //
  • ANOTHER_ACTION_ABANDON 另一个生命周期操作的结果已设置为“ABANDON”。
  • - //
  • COMMAND_CALL_FAILURE 由于命令调用失败,结果根据DefaultResult设置。
  • - //
  • COMMAND_EXEC_FINISH 命令执行完成。
  • - //
  • COMMAND_EXEC_FAILURE 由于命令执行失败,结果根据DefaultResult设置。
  • - //
  • COMMAND_EXEC_RESULT_CHECK_FAILURE 由于命令结果检查失败,结果根据DefaultResult设置。
  • - ResultReason *string `json:"ResultReason,omitempty" name:"ResultReason"` -} - -type LifecycleCommand struct { - // 远程命令ID。若选择执行命令,则此项必填。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CommandId *string `json:"CommandId,omitempty" name:"CommandId"` - - // 自定义参数。字段类型为 json encoded string。如:{"varA": "222"}。 - // key为自定义参数名称,value为该参数的默认取值。kv均为字符串型。 - // 如果未提供该参数取值,将使用 Command 的 DefaultParameters 进行替换。 - // 自定义参数最多20个。自定义参数名称需符合以下规范:字符数目上限64,可选范围【a-zA-Z0-9-_】。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Parameters *string `json:"Parameters,omitempty" name:"Parameters"` -} - -type LifecycleHook struct { - // 生命周期挂钩ID - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 生命周期挂钩名称 - LifecycleHookName *string `json:"LifecycleHookName,omitempty" name:"LifecycleHookName"` - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 生命周期挂钩默认结果 - DefaultResult *string `json:"DefaultResult,omitempty" name:"DefaultResult"` - - // 生命周期挂钩等待超时时间 - HeartbeatTimeout *int64 `json:"HeartbeatTimeout,omitempty" name:"HeartbeatTimeout"` - - // 生命周期挂钩适用场景 - LifecycleTransition *string `json:"LifecycleTransition,omitempty" name:"LifecycleTransition"` - - // 通知目标的附加信息 - NotificationMetadata *string `json:"NotificationMetadata,omitempty" name:"NotificationMetadata"` - - // 创建时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 通知目标 - NotificationTarget *NotificationTarget `json:"NotificationTarget,omitempty" name:"NotificationTarget"` - - // 生命周期挂钩适用场景 - LifecycleTransitionType *string `json:"LifecycleTransitionType,omitempty" name:"LifecycleTransitionType"` - - // 远程命令执行对象 - // 注意:此字段可能返回 null,表示取不到有效值。 - LifecycleCommand *LifecycleCommand `json:"LifecycleCommand,omitempty" name:"LifecycleCommand"` -} - -type LimitedLoginSettings struct { - // 密钥ID列表。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` -} - -type LoginSettings struct { - // 实例登录密码。不同操作系统类型密码复杂度限制不一样,具体如下:
  • Linux实例密码必须8到16位,至少包括两项[a-z,A-Z]、[0-9] 和 [( ) ` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' , . ? / ]中的特殊符号。
  • Windows实例密码必须12到16位,至少包括三项[a-z],[A-Z],[0-9] 和 [( ) ` ~ ! @ # $ % ^ & * - + = { } [ ] : ; ' , . ? /]中的特殊符号。

    若不指定该参数,则由系统随机生成密码,并通过站内信方式通知到用户。 - Password *string `json:"Password,omitempty" name:"Password"` - - // 密钥ID列表。关联密钥后,就可以通过对应的私钥来访问实例;KeyId可通过接口DescribeKeyPairs获取,密钥与密码不能同时指定,同时Windows操作系统不支持指定密钥。当前仅支持购买的时候指定一个密钥。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` - - // 保持镜像的原始设置。该参数与Password或KeyIds.N不能同时指定。只有使用自定义镜像、共享镜像或外部导入镜像创建实例时才能指定该参数为TRUE。取值范围:
  • TRUE:表示保持镜像的登录设置
  • FALSE:表示不保持镜像的登录设置

    默认取值:FALSE。 - KeepImageLogin *bool `json:"KeepImageLogin,omitempty" name:"KeepImageLogin"` -} - -type MetricAlarm struct { - // 比较运算符,可选值:
  • GREATER_THAN:大于
  • GREATER_THAN_OR_EQUAL_TO:大于或等于
  • LESS_THAN:小于
  • LESS_THAN_OR_EQUAL_TO:小于或等于
  • EQUAL_TO:等于
  • NOT_EQUAL_TO:不等于
  • - ComparisonOperator *string `json:"ComparisonOperator,omitempty" name:"ComparisonOperator"` - - // 指标名称,可选字段如下:
  • CPU_UTILIZATION:CPU利用率
  • MEM_UTILIZATION:内存利用率
  • LAN_TRAFFIC_OUT:内网出带宽
  • LAN_TRAFFIC_IN:内网入带宽
  • WAN_TRAFFIC_OUT:外网出带宽
  • WAN_TRAFFIC_IN:外网入带宽
  • - MetricName *string `json:"MetricName,omitempty" name:"MetricName"` - - // 告警阈值:
  • CPU_UTILIZATION:[1, 100],单位:%
  • MEM_UTILIZATION:[1, 100],单位:%
  • LAN_TRAFFIC_OUT:>0,单位:Mbps
  • LAN_TRAFFIC_IN:>0,单位:Mbps
  • WAN_TRAFFIC_OUT:>0,单位:Mbps
  • WAN_TRAFFIC_IN:>0,单位:Mbps
  • - Threshold *uint64 `json:"Threshold,omitempty" name:"Threshold"` - - // 时间周期,单位:秒,取值枚举值为60、300。 - Period *uint64 `json:"Period,omitempty" name:"Period"` - - // 重复次数。取值范围 [1, 10] - ContinuousTime *uint64 `json:"ContinuousTime,omitempty" name:"ContinuousTime"` - - // 统计类型,可选字段如下:
  • AVERAGE:平均值
  • MAXIMUM:最大值
  • MINIMUM:最小值

  • 默认取值:AVERAGE - Statistic *string `json:"Statistic,omitempty" name:"Statistic"` - - // 精确告警阈值,本参数不作为入参输入,仅用作查询接口出参:
  • CPU_UTILIZATION:(0, 100],单位:%
  • MEM_UTILIZATION:(0, 100],单位:%
  • LAN_TRAFFIC_OUT:>0,单位:Mbps
  • LAN_TRAFFIC_IN:>0,单位:Mbps
  • WAN_TRAFFIC_OUT:>0,单位:Mbps
  • WAN_TRAFFIC_IN:>0,单位:Mbps
  • - PreciseThreshold *float64 `json:"PreciseThreshold,omitempty" name:"PreciseThreshold"` -} - -// Predefined struct for user -type ModifyAutoScalingGroupRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 伸缩组名称,在您账号中必须唯一。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超55个字节。 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` - - // 默认冷却时间,单位秒,默认值为300 - DefaultCooldown *uint64 `json:"DefaultCooldown,omitempty" name:"DefaultCooldown"` - - // 期望实例数,大小介于最小实例数和最大实例数之间 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 最大实例数,取值范围为0-2000。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 最小实例数,取值范围为0-2000。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 项目ID - ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 子网ID列表 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` - - // 销毁策略,目前长度上限为1。取值包括 OLDEST_INSTANCE 和 NEWEST_INSTANCE。 - //
  • OLDEST_INSTANCE 优先销毁伸缩组中最旧的实例。 - //
  • NEWEST_INSTANCE,优先销毁伸缩组中最新的实例。 - TerminationPolicies []*string `json:"TerminationPolicies,omitempty" name:"TerminationPolicies"` - - // VPC ID,基础网络则填空字符串。修改为具体VPC ID时,需指定相应的SubnetIds;修改为基础网络时,需指定相应的Zones。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 可用区列表 - Zones []*string `json:"Zones,omitempty" name:"Zones"` - - // 重试策略,取值包括 IMMEDIATE_RETRY、 INCREMENTAL_INTERVALS、NO_RETRY,默认取值为 IMMEDIATE_RETRY。部分成功的伸缩活动判定为一次失败活动。 - //
  • - // IMMEDIATE_RETRY,立即重试,在较短时间内快速重试,连续失败超过一定次数(5次)后不再重试。 - //
  • - // INCREMENTAL_INTERVALS,间隔递增重试,随着连续失败次数的增加,重试间隔逐渐增大,重试间隔从秒级到1天不等。 - //
  • NO_RETRY,不进行重试,直到再次收到用户调用或者告警信息后才会重试。 - RetryPolicy *string `json:"RetryPolicy,omitempty" name:"RetryPolicy"` - - // 可用区校验策略,取值包括 ALL 和 ANY,默认取值为ANY。在伸缩组实际变更资源相关字段时(启动配置、可用区、子网)发挥作用。 - //
  • ALL,所有可用区(Zone)或子网(SubnetId)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个可用区(Zone)或子网(SubnetId)可用则通过校验,否则校验报错。 - // - // 可用区或子网不可用的常见原因包括该可用区CVM实例类型售罄、该可用区CBS云盘售罄、该可用区配额不足、该子网IP不足等。 - // 如果 Zones/SubnetIds 中可用区或者子网不存在,则无论 ZonesCheckPolicy 采用何种取值,都会校验报错。 - ZonesCheckPolicy *string `json:"ZonesCheckPolicy,omitempty" name:"ZonesCheckPolicy"` - - // 服务设置,包括云监控不健康替换等服务设置。 - ServiceSettings *ServiceSettings `json:"ServiceSettings,omitempty" name:"ServiceSettings"` - - // 实例具有IPv6地址数量的配置,取值包括0、1。 - Ipv6AddressCount *int64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` - - // 多可用区/子网策略,取值包括 PRIORITY 和 EQUALITY,默认为 PRIORITY。 - //
  • PRIORITY,按照可用区/子网列表的顺序,作为优先级来尝试创建实例,如果优先级最高的可用区/子网可以创建成功,则总在该可用区/子网创建。 - //
  • EQUALITY:扩容出的实例会打散到多个可用区/子网,保证扩容后的各个可用区/子网实例数相对均衡。 - // - // 与本策略相关的注意点: - //
  • 当伸缩组为基础网络时,本策略适用于多可用区;当伸缩组为VPC网络时,本策略适用于多子网,此时不再考虑可用区因素,例如四个子网ABCD,其中ABC处于可用区1,D处于可用区2,此时考虑子网ABCD进行排序,而不考虑可用区1、2。 - //
  • 本策略适用于多可用区/子网,不适用于启动配置的多机型。多机型按照优先级策略进行选择。 - //
  • 按照 PRIORITY 策略创建实例时,先保证多机型的策略,后保证多可用区/子网的策略。例如多机型A、B,多子网1、2、3,会按照A1、A2、A3、B1、B2、B3 进行尝试,如果A1售罄,会尝试A2(而非B1)。 - MultiZoneSubnetPolicy *string `json:"MultiZoneSubnetPolicy,omitempty" name:"MultiZoneSubnetPolicy"` - - // 伸缩组实例健康检查类型,取值如下:
  • CVM:根据实例网络状态判断实例是否处于不健康状态,不健康的网络状态即发生实例 PING 不可达事件,详细判断标准可参考[实例健康检查](https://cloud.tencent.com/document/product/377/8553)
  • CLB:根据 CLB 的健康检查状态判断实例是否处于不健康状态,CLB健康检查原理可参考[健康检查](https://cloud.tencent.com/document/product/214/6097) - HealthCheckType *string `json:"HealthCheckType,omitempty" name:"HealthCheckType"` - - // CLB健康检查宽限期。 - LoadBalancerHealthCheckGracePeriod *uint64 `json:"LoadBalancerHealthCheckGracePeriod,omitempty" name:"LoadBalancerHealthCheckGracePeriod"` - - // 实例分配策略,取值包括 LAUNCH_CONFIGURATION 和 SPOT_MIXED。 - //
  • LAUNCH_CONFIGURATION,代表传统的按照启动配置模式。 - //
  • SPOT_MIXED,代表竞价混合模式。目前仅支持启动配置为按量计费模式时使用混合模式,混合模式下,伸缩组将根据设定扩容按量或竞价机型。使用混合模式时,关联的启动配置的计费类型不可被修改。 - InstanceAllocationPolicy *string `json:"InstanceAllocationPolicy,omitempty" name:"InstanceAllocationPolicy"` - - // 竞价混合模式下,各计费类型实例的分配策略。 - // 仅当 InstanceAllocationPolicy 取 SPOT_MIXED 时可用。 - SpotMixedAllocationPolicy *SpotMixedAllocationPolicy `json:"SpotMixedAllocationPolicy,omitempty" name:"SpotMixedAllocationPolicy"` - - // 容量重平衡功能,仅对伸缩组内的竞价实例有效。取值范围: - //
  • TRUE,开启该功能,当伸缩组内的竞价实例即将被竞价实例服务自动回收前,AS 主动发起竞价实例销毁流程,如果有配置过缩容 hook,则销毁前 hook 会生效。销毁流程启动后,AS 会异步开启一个扩容活动,用于补齐期望实例数。 - //
  • FALSE,不开启该功能,则 AS 等待竞价实例被销毁后才会去扩容补齐伸缩组期望实例数。 - CapacityRebalance *bool `json:"CapacityRebalance,omitempty" name:"CapacityRebalance"` -} - -type ModifyAutoScalingGroupRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 伸缩组名称,在您账号中必须唯一。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超55个字节。 - AutoScalingGroupName *string `json:"AutoScalingGroupName,omitempty" name:"AutoScalingGroupName"` - - // 默认冷却时间,单位秒,默认值为300 - DefaultCooldown *uint64 `json:"DefaultCooldown,omitempty" name:"DefaultCooldown"` - - // 期望实例数,大小介于最小实例数和最大实例数之间 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 最大实例数,取值范围为0-2000。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 最小实例数,取值范围为0-2000。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 项目ID - ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 子网ID列表 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` - - // 销毁策略,目前长度上限为1。取值包括 OLDEST_INSTANCE 和 NEWEST_INSTANCE。 - //
  • OLDEST_INSTANCE 优先销毁伸缩组中最旧的实例。 - //
  • NEWEST_INSTANCE,优先销毁伸缩组中最新的实例。 - TerminationPolicies []*string `json:"TerminationPolicies,omitempty" name:"TerminationPolicies"` - - // VPC ID,基础网络则填空字符串。修改为具体VPC ID时,需指定相应的SubnetIds;修改为基础网络时,需指定相应的Zones。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 可用区列表 - Zones []*string `json:"Zones,omitempty" name:"Zones"` - - // 重试策略,取值包括 IMMEDIATE_RETRY、 INCREMENTAL_INTERVALS、NO_RETRY,默认取值为 IMMEDIATE_RETRY。部分成功的伸缩活动判定为一次失败活动。 - //
  • - // IMMEDIATE_RETRY,立即重试,在较短时间内快速重试,连续失败超过一定次数(5次)后不再重试。 - //
  • - // INCREMENTAL_INTERVALS,间隔递增重试,随着连续失败次数的增加,重试间隔逐渐增大,重试间隔从秒级到1天不等。 - //
  • NO_RETRY,不进行重试,直到再次收到用户调用或者告警信息后才会重试。 - RetryPolicy *string `json:"RetryPolicy,omitempty" name:"RetryPolicy"` - - // 可用区校验策略,取值包括 ALL 和 ANY,默认取值为ANY。在伸缩组实际变更资源相关字段时(启动配置、可用区、子网)发挥作用。 - //
  • ALL,所有可用区(Zone)或子网(SubnetId)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个可用区(Zone)或子网(SubnetId)可用则通过校验,否则校验报错。 - // - // 可用区或子网不可用的常见原因包括该可用区CVM实例类型售罄、该可用区CBS云盘售罄、该可用区配额不足、该子网IP不足等。 - // 如果 Zones/SubnetIds 中可用区或者子网不存在,则无论 ZonesCheckPolicy 采用何种取值,都会校验报错。 - ZonesCheckPolicy *string `json:"ZonesCheckPolicy,omitempty" name:"ZonesCheckPolicy"` - - // 服务设置,包括云监控不健康替换等服务设置。 - ServiceSettings *ServiceSettings `json:"ServiceSettings,omitempty" name:"ServiceSettings"` - - // 实例具有IPv6地址数量的配置,取值包括0、1。 - Ipv6AddressCount *int64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` - - // 多可用区/子网策略,取值包括 PRIORITY 和 EQUALITY,默认为 PRIORITY。 - //
  • PRIORITY,按照可用区/子网列表的顺序,作为优先级来尝试创建实例,如果优先级最高的可用区/子网可以创建成功,则总在该可用区/子网创建。 - //
  • EQUALITY:扩容出的实例会打散到多个可用区/子网,保证扩容后的各个可用区/子网实例数相对均衡。 - // - // 与本策略相关的注意点: - //
  • 当伸缩组为基础网络时,本策略适用于多可用区;当伸缩组为VPC网络时,本策略适用于多子网,此时不再考虑可用区因素,例如四个子网ABCD,其中ABC处于可用区1,D处于可用区2,此时考虑子网ABCD进行排序,而不考虑可用区1、2。 - //
  • 本策略适用于多可用区/子网,不适用于启动配置的多机型。多机型按照优先级策略进行选择。 - //
  • 按照 PRIORITY 策略创建实例时,先保证多机型的策略,后保证多可用区/子网的策略。例如多机型A、B,多子网1、2、3,会按照A1、A2、A3、B1、B2、B3 进行尝试,如果A1售罄,会尝试A2(而非B1)。 - MultiZoneSubnetPolicy *string `json:"MultiZoneSubnetPolicy,omitempty" name:"MultiZoneSubnetPolicy"` - - // 伸缩组实例健康检查类型,取值如下:
  • CVM:根据实例网络状态判断实例是否处于不健康状态,不健康的网络状态即发生实例 PING 不可达事件,详细判断标准可参考[实例健康检查](https://cloud.tencent.com/document/product/377/8553)
  • CLB:根据 CLB 的健康检查状态判断实例是否处于不健康状态,CLB健康检查原理可参考[健康检查](https://cloud.tencent.com/document/product/214/6097) - HealthCheckType *string `json:"HealthCheckType,omitempty" name:"HealthCheckType"` - - // CLB健康检查宽限期。 - LoadBalancerHealthCheckGracePeriod *uint64 `json:"LoadBalancerHealthCheckGracePeriod,omitempty" name:"LoadBalancerHealthCheckGracePeriod"` - - // 实例分配策略,取值包括 LAUNCH_CONFIGURATION 和 SPOT_MIXED。 - //
  • LAUNCH_CONFIGURATION,代表传统的按照启动配置模式。 - //
  • SPOT_MIXED,代表竞价混合模式。目前仅支持启动配置为按量计费模式时使用混合模式,混合模式下,伸缩组将根据设定扩容按量或竞价机型。使用混合模式时,关联的启动配置的计费类型不可被修改。 - InstanceAllocationPolicy *string `json:"InstanceAllocationPolicy,omitempty" name:"InstanceAllocationPolicy"` - - // 竞价混合模式下,各计费类型实例的分配策略。 - // 仅当 InstanceAllocationPolicy 取 SPOT_MIXED 时可用。 - SpotMixedAllocationPolicy *SpotMixedAllocationPolicy `json:"SpotMixedAllocationPolicy,omitempty" name:"SpotMixedAllocationPolicy"` - - // 容量重平衡功能,仅对伸缩组内的竞价实例有效。取值范围: - //
  • TRUE,开启该功能,当伸缩组内的竞价实例即将被竞价实例服务自动回收前,AS 主动发起竞价实例销毁流程,如果有配置过缩容 hook,则销毁前 hook 会生效。销毁流程启动后,AS 会异步开启一个扩容活动,用于补齐期望实例数。 - //
  • FALSE,不开启该功能,则 AS 等待竞价实例被销毁后才会去扩容补齐伸缩组期望实例数。 - CapacityRebalance *bool `json:"CapacityRebalance,omitempty" name:"CapacityRebalance"` -} - -func (r *ModifyAutoScalingGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAutoScalingGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "AutoScalingGroupName") - delete(f, "DefaultCooldown") - delete(f, "DesiredCapacity") - delete(f, "LaunchConfigurationId") - delete(f, "MaxSize") - delete(f, "MinSize") - delete(f, "ProjectId") - delete(f, "SubnetIds") - delete(f, "TerminationPolicies") - delete(f, "VpcId") - delete(f, "Zones") - delete(f, "RetryPolicy") - delete(f, "ZonesCheckPolicy") - delete(f, "ServiceSettings") - delete(f, "Ipv6AddressCount") - delete(f, "MultiZoneSubnetPolicy") - delete(f, "HealthCheckType") - delete(f, "LoadBalancerHealthCheckGracePeriod") - delete(f, "InstanceAllocationPolicy") - delete(f, "SpotMixedAllocationPolicy") - delete(f, "CapacityRebalance") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAutoScalingGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAutoScalingGroupResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyAutoScalingGroupResponse struct { - *tchttp.BaseResponse - Response *ModifyAutoScalingGroupResponseParams `json:"Response"` -} - -func (r *ModifyAutoScalingGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAutoScalingGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyDesiredCapacityRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 期望实例数 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 最小实例数,取值范围为0-2000。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 最大实例数,取值范围为0-2000。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` -} - -type ModifyDesiredCapacityRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 期望实例数 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 最小实例数,取值范围为0-2000。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 最大实例数,取值范围为0-2000。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` -} - -func (r *ModifyDesiredCapacityRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyDesiredCapacityRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "DesiredCapacity") - delete(f, "MinSize") - delete(f, "MaxSize") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDesiredCapacityRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyDesiredCapacityResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyDesiredCapacityResponse struct { - *tchttp.BaseResponse - Response *ModifyDesiredCapacityResponseParams `json:"Response"` -} - -func (r *ModifyDesiredCapacityResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyDesiredCapacityResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLaunchConfigurationAttributesRequestParams struct { - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-8toqc6s3`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例类型列表,不同实例机型指定了不同的资源规格,最多支持10种实例机型。 - // InstanceType 指定单一实例类型,通过设置 InstanceTypes可以指定多实例类型,并使原有的InstanceType失效。 - InstanceTypes []*string `json:"InstanceTypes,omitempty" name:"InstanceTypes"` - - // 实例类型校验策略,在实际修改 InstanceTypes 时发挥作用,取值包括 ALL 和 ANY,默认取值为ANY。 - //
  • ALL,所有实例类型(InstanceType)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个实例类型(InstanceType)可用则通过校验,否则校验报错。 - // - // 实例类型不可用的常见原因包括该实例类型售罄、对应云盘售罄等。 - // 如果 InstanceTypes 中一款机型不存在或者已下线,则无论 InstanceTypesCheckPolicy 采用何种取值,都会校验报错。 - InstanceTypesCheckPolicy *string `json:"InstanceTypesCheckPolicy,omitempty" name:"InstanceTypesCheckPolicy"` - - // 启动配置显示名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 经过 Base64 编码后的自定义数据,最大长度不超过16KB。如果要清空UserData,则指定其为空字符串。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的`SecurityGroupId`字段来获取。 - // 若指定该参数,请至少提供一个安全组,列表顺序有先后。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 公网带宽相关信息设置。 - // 当公网出带宽上限为0Mbps时,不支持修改为开通分配公网IP;相应的,当前为开通分配公网IP时,修改的公网出带宽上限值必须大于0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 实例计费类型。具体取值范围如下: - //
  • POSTPAID_BY_HOUR:按小时后付费 - //
  • SPOTPAID:竞价付费 - //
  • PREPAID:预付费,即包年包月 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。 - // 若修改实例的付费模式为预付费,则该参数必传;从预付费修改为其他付费模式时,本字段原信息会自动丢弃。 - // 当新增该字段时,必须传递购买实例的时长,其它未传递字段会设置为默认值。 - // 当修改本字段时,当前付费模式必须为预付费。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例的市场相关选项,如竞价实例相关参数。 - // 若修改实例的付费模式为竞价付费,则该参数必传;从竞价付费修改为其他付费模式时,本字段原信息会自动丢弃。 - // 当新增该字段时,必须传递竞价相关选项下的竞价出价,其它未传递字段会设置为默认值。 - // 当修改本字段时,当前付费模式必须为竞价付费。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 云盘类型选择策略,取值范围: - //
  • ORIGINAL:使用设置的云盘类型。 - //
  • AUTOMATIC:自动选择当前可用的云盘类型。 - DiskTypePolicy *string `json:"DiskTypePolicy,omitempty" name:"DiskTypePolicy"` - - // 实例系统盘配置信息。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。 - // 最多支持指定11块数据盘。采取整体修改,因此请提供修改后的全部值。 - // 数据盘类型默认与系统盘类型保持一致。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 云服务器主机名(HostName)的相关设置。 - // 不支持windows实例设置主机名。 - // 新增该属性时,必须传递云服务器的主机名,其它未传递字段会设置为默认值。 - HostNameSettings *HostNameSettings `json:"HostNameSettings,omitempty" name:"HostNameSettings"` - - // 云服务器(InstanceName)实例名的相关设置。 - // 如果用户在启动配置中设置此字段,则伸缩组创建出的实例 InstanceName 参照此字段进行设置,并传递给 CVM;如果用户未在启动配置中设置此字段,则伸缩组创建出的实例 InstanceName 按照“as-{{ 伸缩组AutoScalingGroupName }}”进行设置,并传递给 CVM。 - // 新增该属性时,必须传递云服务器的实例名称,其它未传递字段会设置为默认值。 - InstanceNameSettings *InstanceNameSettings `json:"InstanceNameSettings,omitempty" name:"InstanceNameSettings"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // CAM角色名称。可通过DescribeRoleList接口返回值中的roleName获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群ID。
    - // 注意:此字段默认为空。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // IPv6公网带宽相关信息设置。若新建实例包含IPv6地址,该参数可为新建实例的IPv6地址分配公网带宽。关联启动配置的伸缩组Ipv6AddressCount参数为0时,该参数不会生效。 - IPv6InternetAccessible *IPv6InternetAccessible `json:"IPv6InternetAccessible,omitempty" name:"IPv6InternetAccessible"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` -} - -type ModifyLaunchConfigurationAttributesRequest struct { - *tchttp.BaseRequest - - // 启动配置ID - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-8toqc6s3`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例类型列表,不同实例机型指定了不同的资源规格,最多支持10种实例机型。 - // InstanceType 指定单一实例类型,通过设置 InstanceTypes可以指定多实例类型,并使原有的InstanceType失效。 - InstanceTypes []*string `json:"InstanceTypes,omitempty" name:"InstanceTypes"` - - // 实例类型校验策略,在实际修改 InstanceTypes 时发挥作用,取值包括 ALL 和 ANY,默认取值为ANY。 - //
  • ALL,所有实例类型(InstanceType)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个实例类型(InstanceType)可用则通过校验,否则校验报错。 - // - // 实例类型不可用的常见原因包括该实例类型售罄、对应云盘售罄等。 - // 如果 InstanceTypes 中一款机型不存在或者已下线,则无论 InstanceTypesCheckPolicy 采用何种取值,都会校验报错。 - InstanceTypesCheckPolicy *string `json:"InstanceTypesCheckPolicy,omitempty" name:"InstanceTypesCheckPolicy"` - - // 启动配置显示名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 经过 Base64 编码后的自定义数据,最大长度不超过16KB。如果要清空UserData,则指定其为空字符串。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的`SecurityGroupId`字段来获取。 - // 若指定该参数,请至少提供一个安全组,列表顺序有先后。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 公网带宽相关信息设置。 - // 当公网出带宽上限为0Mbps时,不支持修改为开通分配公网IP;相应的,当前为开通分配公网IP时,修改的公网出带宽上限值必须大于0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 实例计费类型。具体取值范围如下: - //
  • POSTPAID_BY_HOUR:按小时后付费 - //
  • SPOTPAID:竞价付费 - //
  • PREPAID:预付费,即包年包月 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。 - // 若修改实例的付费模式为预付费,则该参数必传;从预付费修改为其他付费模式时,本字段原信息会自动丢弃。 - // 当新增该字段时,必须传递购买实例的时长,其它未传递字段会设置为默认值。 - // 当修改本字段时,当前付费模式必须为预付费。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例的市场相关选项,如竞价实例相关参数。 - // 若修改实例的付费模式为竞价付费,则该参数必传;从竞价付费修改为其他付费模式时,本字段原信息会自动丢弃。 - // 当新增该字段时,必须传递竞价相关选项下的竞价出价,其它未传递字段会设置为默认值。 - // 当修改本字段时,当前付费模式必须为竞价付费。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 云盘类型选择策略,取值范围: - //
  • ORIGINAL:使用设置的云盘类型。 - //
  • AUTOMATIC:自动选择当前可用的云盘类型。 - DiskTypePolicy *string `json:"DiskTypePolicy,omitempty" name:"DiskTypePolicy"` - - // 实例系统盘配置信息。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。 - // 最多支持指定11块数据盘。采取整体修改,因此请提供修改后的全部值。 - // 数据盘类型默认与系统盘类型保持一致。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 云服务器主机名(HostName)的相关设置。 - // 不支持windows实例设置主机名。 - // 新增该属性时,必须传递云服务器的主机名,其它未传递字段会设置为默认值。 - HostNameSettings *HostNameSettings `json:"HostNameSettings,omitempty" name:"HostNameSettings"` - - // 云服务器(InstanceName)实例名的相关设置。 - // 如果用户在启动配置中设置此字段,则伸缩组创建出的实例 InstanceName 参照此字段进行设置,并传递给 CVM;如果用户未在启动配置中设置此字段,则伸缩组创建出的实例 InstanceName 按照“as-{{ 伸缩组AutoScalingGroupName }}”进行设置,并传递给 CVM。 - // 新增该属性时,必须传递云服务器的实例名称,其它未传递字段会设置为默认值。 - InstanceNameSettings *InstanceNameSettings `json:"InstanceNameSettings,omitempty" name:"InstanceNameSettings"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // CAM角色名称。可通过DescribeRoleList接口返回值中的roleName获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群ID。
    - // 注意:此字段默认为空。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // IPv6公网带宽相关信息设置。若新建实例包含IPv6地址,该参数可为新建实例的IPv6地址分配公网带宽。关联启动配置的伸缩组Ipv6AddressCount参数为0时,该参数不会生效。 - IPv6InternetAccessible *IPv6InternetAccessible `json:"IPv6InternetAccessible,omitempty" name:"IPv6InternetAccessible"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` -} - -func (r *ModifyLaunchConfigurationAttributesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLaunchConfigurationAttributesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchConfigurationId") - delete(f, "ImageId") - delete(f, "InstanceTypes") - delete(f, "InstanceTypesCheckPolicy") - delete(f, "LaunchConfigurationName") - delete(f, "UserData") - delete(f, "SecurityGroupIds") - delete(f, "InternetAccessible") - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "InstanceMarketOptions") - delete(f, "DiskTypePolicy") - delete(f, "SystemDisk") - delete(f, "DataDisks") - delete(f, "HostNameSettings") - delete(f, "InstanceNameSettings") - delete(f, "EnhancedService") - delete(f, "CamRoleName") - delete(f, "HpcClusterId") - delete(f, "IPv6InternetAccessible") - delete(f, "DisasterRecoverGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyLaunchConfigurationAttributesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLaunchConfigurationAttributesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyLaunchConfigurationAttributesResponse struct { - *tchttp.BaseResponse - Response *ModifyLaunchConfigurationAttributesResponseParams `json:"Response"` -} - -func (r *ModifyLaunchConfigurationAttributesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLaunchConfigurationAttributesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLifecycleHookRequestParams struct { - // 生命周期挂钩ID。 - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 生命周期挂钩名称。 - LifecycleHookName *string `json:"LifecycleHookName,omitempty" name:"LifecycleHookName"` - - // 进入生命周期挂钩场景,取值包括: - //
  • INSTANCE_LAUNCHING:实例启动后 - //
  • INSTANCE_TERMINATING:实例销毁前 - LifecycleTransition *string `json:"LifecycleTransition,omitempty" name:"LifecycleTransition"` - - // 定义伸缩组在生命周期挂钩超时的情况下应采取的操作,取值包括: - //
  • CONTINUE: 超时后继续伸缩活动 - //
  • ABANDON:超时后终止伸缩活动 - DefaultResult *string `json:"DefaultResult,omitempty" name:"DefaultResult"` - - // 生命周期挂钩超时之前可以经过的最长时间(以秒为单位),范围从 30 到 7200 秒。 - HeartbeatTimeout *uint64 `json:"HeartbeatTimeout,omitempty" name:"HeartbeatTimeout"` - - // 弹性伸缩向通知目标发送的附加信息。 - NotificationMetadata *string `json:"NotificationMetadata,omitempty" name:"NotificationMetadata"` - - // 进行生命周期挂钩的场景类型,取值范围包括`NORMAL`和 `EXTENSION`。说明:设置为`EXTENSION`值,在AttachInstances、DetachInstances、RemoveInstances 接口时会触发生命周期挂钩操作,值为`NORMAL`则不会在这些接口中触发生命周期挂钩。 - LifecycleTransitionType *string `json:"LifecycleTransitionType,omitempty" name:"LifecycleTransitionType"` - - // 通知目标信息。 - NotificationTarget *NotificationTarget `json:"NotificationTarget,omitempty" name:"NotificationTarget"` - - // 远程命令执行对象。 - LifecycleCommand *LifecycleCommand `json:"LifecycleCommand,omitempty" name:"LifecycleCommand"` -} - -type ModifyLifecycleHookRequest struct { - *tchttp.BaseRequest - - // 生命周期挂钩ID。 - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 生命周期挂钩名称。 - LifecycleHookName *string `json:"LifecycleHookName,omitempty" name:"LifecycleHookName"` - - // 进入生命周期挂钩场景,取值包括: - //
  • INSTANCE_LAUNCHING:实例启动后 - //
  • INSTANCE_TERMINATING:实例销毁前 - LifecycleTransition *string `json:"LifecycleTransition,omitempty" name:"LifecycleTransition"` - - // 定义伸缩组在生命周期挂钩超时的情况下应采取的操作,取值包括: - //
  • CONTINUE: 超时后继续伸缩活动 - //
  • ABANDON:超时后终止伸缩活动 - DefaultResult *string `json:"DefaultResult,omitempty" name:"DefaultResult"` - - // 生命周期挂钩超时之前可以经过的最长时间(以秒为单位),范围从 30 到 7200 秒。 - HeartbeatTimeout *uint64 `json:"HeartbeatTimeout,omitempty" name:"HeartbeatTimeout"` - - // 弹性伸缩向通知目标发送的附加信息。 - NotificationMetadata *string `json:"NotificationMetadata,omitempty" name:"NotificationMetadata"` - - // 进行生命周期挂钩的场景类型,取值范围包括`NORMAL`和 `EXTENSION`。说明:设置为`EXTENSION`值,在AttachInstances、DetachInstances、RemoveInstances 接口时会触发生命周期挂钩操作,值为`NORMAL`则不会在这些接口中触发生命周期挂钩。 - LifecycleTransitionType *string `json:"LifecycleTransitionType,omitempty" name:"LifecycleTransitionType"` - - // 通知目标信息。 - NotificationTarget *NotificationTarget `json:"NotificationTarget,omitempty" name:"NotificationTarget"` - - // 远程命令执行对象。 - LifecycleCommand *LifecycleCommand `json:"LifecycleCommand,omitempty" name:"LifecycleCommand"` -} - -func (r *ModifyLifecycleHookRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLifecycleHookRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LifecycleHookId") - delete(f, "LifecycleHookName") - delete(f, "LifecycleTransition") - delete(f, "DefaultResult") - delete(f, "HeartbeatTimeout") - delete(f, "NotificationMetadata") - delete(f, "LifecycleTransitionType") - delete(f, "NotificationTarget") - delete(f, "LifecycleCommand") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyLifecycleHookRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLifecycleHookResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyLifecycleHookResponse struct { - *tchttp.BaseResponse - Response *ModifyLifecycleHookResponseParams `json:"Response"` -} - -func (r *ModifyLifecycleHookResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLifecycleHookResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLoadBalancerTargetAttributesRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 需修改目标规则属性的应用型负载均衡器列表,列表长度上限为100 - ForwardLoadBalancers []*ForwardLoadBalancer `json:"ForwardLoadBalancers,omitempty" name:"ForwardLoadBalancers"` -} - -type ModifyLoadBalancerTargetAttributesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 需修改目标规则属性的应用型负载均衡器列表,列表长度上限为100 - ForwardLoadBalancers []*ForwardLoadBalancer `json:"ForwardLoadBalancers,omitempty" name:"ForwardLoadBalancers"` -} - -func (r *ModifyLoadBalancerTargetAttributesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLoadBalancerTargetAttributesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "ForwardLoadBalancers") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyLoadBalancerTargetAttributesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLoadBalancerTargetAttributesResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyLoadBalancerTargetAttributesResponse struct { - *tchttp.BaseResponse - Response *ModifyLoadBalancerTargetAttributesResponseParams `json:"Response"` -} - -func (r *ModifyLoadBalancerTargetAttributesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLoadBalancerTargetAttributesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLoadBalancersRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 传统负载均衡器ID列表,目前长度上限为20,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - LoadBalancerIds []*string `json:"LoadBalancerIds,omitempty" name:"LoadBalancerIds"` - - // 应用型负载均衡器列表,目前长度上限为100,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - ForwardLoadBalancers []*ForwardLoadBalancer `json:"ForwardLoadBalancers,omitempty" name:"ForwardLoadBalancers"` - - // 负载均衡器校验策略,取值包括 ALL 和 DIFF,默认取值为 ALL。 - //
  • ALL,所有负载均衡器都合法则通过校验,否则校验报错。 - //
  • DIFF,仅校验负载均衡器参数中实际变化的部分,如果合法则通过校验,否则校验报错。 - LoadBalancersCheckPolicy *string `json:"LoadBalancersCheckPolicy,omitempty" name:"LoadBalancersCheckPolicy"` -} - -type ModifyLoadBalancersRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 传统负载均衡器ID列表,目前长度上限为20,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - LoadBalancerIds []*string `json:"LoadBalancerIds,omitempty" name:"LoadBalancerIds"` - - // 应用型负载均衡器列表,目前长度上限为100,LoadBalancerIds 和 ForwardLoadBalancers 二者同时最多只能指定一个 - ForwardLoadBalancers []*ForwardLoadBalancer `json:"ForwardLoadBalancers,omitempty" name:"ForwardLoadBalancers"` - - // 负载均衡器校验策略,取值包括 ALL 和 DIFF,默认取值为 ALL。 - //
  • ALL,所有负载均衡器都合法则通过校验,否则校验报错。 - //
  • DIFF,仅校验负载均衡器参数中实际变化的部分,如果合法则通过校验,否则校验报错。 - LoadBalancersCheckPolicy *string `json:"LoadBalancersCheckPolicy,omitempty" name:"LoadBalancersCheckPolicy"` -} - -func (r *ModifyLoadBalancersRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLoadBalancersRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "LoadBalancerIds") - delete(f, "ForwardLoadBalancers") - delete(f, "LoadBalancersCheckPolicy") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyLoadBalancersRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLoadBalancersResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyLoadBalancersResponse struct { - *tchttp.BaseResponse - Response *ModifyLoadBalancersResponseParams `json:"Response"` -} - -func (r *ModifyLoadBalancersResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLoadBalancersResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNotificationConfigurationRequestParams struct { - // 待修改的通知ID。 - AutoScalingNotificationId *string `json:"AutoScalingNotificationId,omitempty" name:"AutoScalingNotificationId"` - - // 通知类型,即为需要订阅的通知类型集合,取值范围如下: - //
  • SCALE_OUT_SUCCESSFUL:扩容成功
  • - //
  • SCALE_OUT_FAILED:扩容失败
  • - //
  • SCALE_IN_SUCCESSFUL:缩容成功
  • - //
  • SCALE_IN_FAILED:缩容失败
  • - //
  • REPLACE_UNHEALTHY_INSTANCE_SUCCESSFUL:替换不健康子机成功
  • - //
  • REPLACE_UNHEALTHY_INSTANCE_FAILED:替换不健康子机失败
  • - NotificationTypes []*string `json:"NotificationTypes,omitempty" name:"NotificationTypes"` - - // 通知组ID,即为用户组ID集合,用户组ID可以通过[ListGroups](https://cloud.tencent.com/document/product/598/34589)查询。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` - - // CMQ 队列或 TDMQ CMQ 队列名。 - QueueName *string `json:"QueueName,omitempty" name:"QueueName"` - - // CMQ 主题或 TDMQ CMQ 主题名。 - TopicName *string `json:"TopicName,omitempty" name:"TopicName"` -} - -type ModifyNotificationConfigurationRequest struct { - *tchttp.BaseRequest - - // 待修改的通知ID。 - AutoScalingNotificationId *string `json:"AutoScalingNotificationId,omitempty" name:"AutoScalingNotificationId"` - - // 通知类型,即为需要订阅的通知类型集合,取值范围如下: - //
  • SCALE_OUT_SUCCESSFUL:扩容成功
  • - //
  • SCALE_OUT_FAILED:扩容失败
  • - //
  • SCALE_IN_SUCCESSFUL:缩容成功
  • - //
  • SCALE_IN_FAILED:缩容失败
  • - //
  • REPLACE_UNHEALTHY_INSTANCE_SUCCESSFUL:替换不健康子机成功
  • - //
  • REPLACE_UNHEALTHY_INSTANCE_FAILED:替换不健康子机失败
  • - NotificationTypes []*string `json:"NotificationTypes,omitempty" name:"NotificationTypes"` - - // 通知组ID,即为用户组ID集合,用户组ID可以通过[ListGroups](https://cloud.tencent.com/document/product/598/34589)查询。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` - - // CMQ 队列或 TDMQ CMQ 队列名。 - QueueName *string `json:"QueueName,omitempty" name:"QueueName"` - - // CMQ 主题或 TDMQ CMQ 主题名。 - TopicName *string `json:"TopicName,omitempty" name:"TopicName"` -} - -func (r *ModifyNotificationConfigurationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNotificationConfigurationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingNotificationId") - delete(f, "NotificationTypes") - delete(f, "NotificationUserGroupIds") - delete(f, "QueueName") - delete(f, "TopicName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNotificationConfigurationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNotificationConfigurationResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNotificationConfigurationResponse struct { - *tchttp.BaseResponse - Response *ModifyNotificationConfigurationResponseParams `json:"Response"` -} - -func (r *ModifyNotificationConfigurationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNotificationConfigurationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyScalingPolicyRequestParams struct { - // 告警策略ID。 - AutoScalingPolicyId *string `json:"AutoScalingPolicyId,omitempty" name:"AutoScalingPolicyId"` - - // 告警策略名称。 - ScalingPolicyName *string `json:"ScalingPolicyName,omitempty" name:"ScalingPolicyName"` - - // 告警触发后,期望实例数修改方式,仅适用于简单策略。取值范围:
  • CHANGE_IN_CAPACITY:增加或减少若干期望实例数
  • EXACT_CAPACITY:调整至指定期望实例数
  • PERCENT_CHANGE_IN_CAPACITY:按百分比调整期望实例数
  • - AdjustmentType *string `json:"AdjustmentType,omitempty" name:"AdjustmentType"` - - // 告警触发后,期望实例数的调整值,仅适用于简单策略。
  • 当 AdjustmentType 为 CHANGE_IN_CAPACITY 时,AdjustmentValue 为正数表示告警触发后增加实例,为负数表示告警触发后减少实例
  • 当 AdjustmentType 为 EXACT_CAPACITY 时,AdjustmentValue 的值即为告警触发后新的期望实例数,需要大于或等于0
  • 当 AdjustmentType 为 PERCENT_CHANGE_IN_CAPACITY 时,AdjusmentValue 为正数表示告警触发后按百分比增加实例,为负数表示告警触发后按百分比减少实例,单位是:%。 - AdjustmentValue *int64 `json:"AdjustmentValue,omitempty" name:"AdjustmentValue"` - - // 冷却时间,仅适用于简单策略,单位为秒。 - Cooldown *uint64 `json:"Cooldown,omitempty" name:"Cooldown"` - - // 告警监控指标,仅适用于简单策略。 - MetricAlarm *MetricAlarm `json:"MetricAlarm,omitempty" name:"MetricAlarm"` - - // 预定义监控项,仅适用于目标追踪策略。取值范围:
  • ASG_AVG_CPU_UTILIZATION:平均CPU使用率
  • ASG_AVG_LAN_TRAFFIC_OUT:平均内网出带宽
  • ASG_AVG_LAN_TRAFFIC_IN:平均内网入带宽
  • ASG_AVG_WAN_TRAFFIC_OUT:平均外网出带宽
  • ASG_AVG_WAN_TRAFFIC_IN:平均外网出带宽
  • - PredefinedMetricType *string `json:"PredefinedMetricType,omitempty" name:"PredefinedMetricType"` - - // 目标值,仅适用于目标追踪策略。
  • ASG_AVG_CPU_UTILIZATION:[1, 100),单位:%
  • ASG_AVG_LAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_LAN_TRAFFIC_IN:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_IN:>0,单位:Mbps
  • - TargetValue *uint64 `json:"TargetValue,omitempty" name:"TargetValue"` - - // 实例预热时间,单位为秒,仅适用于目标追踪策略。取值范围为0-3600。 - EstimatedInstanceWarmup *uint64 `json:"EstimatedInstanceWarmup,omitempty" name:"EstimatedInstanceWarmup"` - - // 是否禁用缩容,仅适用于目标追踪策略。取值范围:
  • true:目标追踪策略仅触发扩容
  • false:目标追踪策略触发扩容和缩容
  • - DisableScaleIn *bool `json:"DisableScaleIn,omitempty" name:"DisableScaleIn"` - - // 此参数已不再生效,请使用[创建通知](https://cloud.tencent.com/document/api/377/33185)。 - // 通知组ID,即为用户组ID集合。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` -} - -type ModifyScalingPolicyRequest struct { - *tchttp.BaseRequest - - // 告警策略ID。 - AutoScalingPolicyId *string `json:"AutoScalingPolicyId,omitempty" name:"AutoScalingPolicyId"` - - // 告警策略名称。 - ScalingPolicyName *string `json:"ScalingPolicyName,omitempty" name:"ScalingPolicyName"` - - // 告警触发后,期望实例数修改方式,仅适用于简单策略。取值范围:
  • CHANGE_IN_CAPACITY:增加或减少若干期望实例数
  • EXACT_CAPACITY:调整至指定期望实例数
  • PERCENT_CHANGE_IN_CAPACITY:按百分比调整期望实例数
  • - AdjustmentType *string `json:"AdjustmentType,omitempty" name:"AdjustmentType"` - - // 告警触发后,期望实例数的调整值,仅适用于简单策略。
  • 当 AdjustmentType 为 CHANGE_IN_CAPACITY 时,AdjustmentValue 为正数表示告警触发后增加实例,为负数表示告警触发后减少实例
  • 当 AdjustmentType 为 EXACT_CAPACITY 时,AdjustmentValue 的值即为告警触发后新的期望实例数,需要大于或等于0
  • 当 AdjustmentType 为 PERCENT_CHANGE_IN_CAPACITY 时,AdjusmentValue 为正数表示告警触发后按百分比增加实例,为负数表示告警触发后按百分比减少实例,单位是:%。 - AdjustmentValue *int64 `json:"AdjustmentValue,omitempty" name:"AdjustmentValue"` - - // 冷却时间,仅适用于简单策略,单位为秒。 - Cooldown *uint64 `json:"Cooldown,omitempty" name:"Cooldown"` - - // 告警监控指标,仅适用于简单策略。 - MetricAlarm *MetricAlarm `json:"MetricAlarm,omitempty" name:"MetricAlarm"` - - // 预定义监控项,仅适用于目标追踪策略。取值范围:
  • ASG_AVG_CPU_UTILIZATION:平均CPU使用率
  • ASG_AVG_LAN_TRAFFIC_OUT:平均内网出带宽
  • ASG_AVG_LAN_TRAFFIC_IN:平均内网入带宽
  • ASG_AVG_WAN_TRAFFIC_OUT:平均外网出带宽
  • ASG_AVG_WAN_TRAFFIC_IN:平均外网出带宽
  • - PredefinedMetricType *string `json:"PredefinedMetricType,omitempty" name:"PredefinedMetricType"` - - // 目标值,仅适用于目标追踪策略。
  • ASG_AVG_CPU_UTILIZATION:[1, 100),单位:%
  • ASG_AVG_LAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_LAN_TRAFFIC_IN:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_IN:>0,单位:Mbps
  • - TargetValue *uint64 `json:"TargetValue,omitempty" name:"TargetValue"` - - // 实例预热时间,单位为秒,仅适用于目标追踪策略。取值范围为0-3600。 - EstimatedInstanceWarmup *uint64 `json:"EstimatedInstanceWarmup,omitempty" name:"EstimatedInstanceWarmup"` - - // 是否禁用缩容,仅适用于目标追踪策略。取值范围:
  • true:目标追踪策略仅触发扩容
  • false:目标追踪策略触发扩容和缩容
  • - DisableScaleIn *bool `json:"DisableScaleIn,omitempty" name:"DisableScaleIn"` - - // 此参数已不再生效,请使用[创建通知](https://cloud.tencent.com/document/api/377/33185)。 - // 通知组ID,即为用户组ID集合。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` -} - -func (r *ModifyScalingPolicyRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyScalingPolicyRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingPolicyId") - delete(f, "ScalingPolicyName") - delete(f, "AdjustmentType") - delete(f, "AdjustmentValue") - delete(f, "Cooldown") - delete(f, "MetricAlarm") - delete(f, "PredefinedMetricType") - delete(f, "TargetValue") - delete(f, "EstimatedInstanceWarmup") - delete(f, "DisableScaleIn") - delete(f, "NotificationUserGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyScalingPolicyRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyScalingPolicyResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyScalingPolicyResponse struct { - *tchttp.BaseResponse - Response *ModifyScalingPolicyResponseParams `json:"Response"` -} - -func (r *ModifyScalingPolicyResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyScalingPolicyResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyScheduledActionRequestParams struct { - // 待修改的定时任务ID - ScheduledActionId *string `json:"ScheduledActionId,omitempty" name:"ScheduledActionId"` - - // 定时任务名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。同一伸缩组下必须唯一。 - ScheduledActionName *string `json:"ScheduledActionName,omitempty" name:"ScheduledActionName"` - - // 当定时任务触发时,设置的伸缩组最大实例数。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 当定时任务触发时,设置的伸缩组最小实例数。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 当定时任务触发时,设置的伸缩组期望实例数。 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 定时任务的首次触发时间,取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 定时任务的结束时间,取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。
    此参数与`Recurrence`需要同时指定,到达结束时间之后,定时任务将不再生效。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 定时任务的重复方式。为标准 Cron 格式
    此参数与`EndTime`需要同时指定。 - Recurrence *string `json:"Recurrence,omitempty" name:"Recurrence"` -} - -type ModifyScheduledActionRequest struct { - *tchttp.BaseRequest - - // 待修改的定时任务ID - ScheduledActionId *string `json:"ScheduledActionId,omitempty" name:"ScheduledActionId"` - - // 定时任务名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。同一伸缩组下必须唯一。 - ScheduledActionName *string `json:"ScheduledActionName,omitempty" name:"ScheduledActionName"` - - // 当定时任务触发时,设置的伸缩组最大实例数。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 当定时任务触发时,设置的伸缩组最小实例数。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 当定时任务触发时,设置的伸缩组期望实例数。 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 定时任务的首次触发时间,取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 定时任务的结束时间,取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。
    此参数与`Recurrence`需要同时指定,到达结束时间之后,定时任务将不再生效。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 定时任务的重复方式。为标准 Cron 格式
    此参数与`EndTime`需要同时指定。 - Recurrence *string `json:"Recurrence,omitempty" name:"Recurrence"` -} - -func (r *ModifyScheduledActionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyScheduledActionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ScheduledActionId") - delete(f, "ScheduledActionName") - delete(f, "MaxSize") - delete(f, "MinSize") - delete(f, "DesiredCapacity") - delete(f, "StartTime") - delete(f, "EndTime") - delete(f, "Recurrence") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyScheduledActionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyScheduledActionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyScheduledActionResponse struct { - *tchttp.BaseResponse - Response *ModifyScheduledActionResponseParams `json:"Response"` -} - -func (r *ModifyScheduledActionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyScheduledActionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type NotificationTarget struct { - // 目标类型,取值范围包括`CMQ_QUEUE`、`CMQ_TOPIC`、`TDMQ_CMQ_QUEUE`、`TDMQ_CMQ_TOPIC`。 - //
  • CMQ_QUEUE,指腾讯云消息队列-队列模型。
  • - //
  • CMQ_TOPIC,指腾讯云消息队列-主题模型。
  • - //
  • TDMQ_CMQ_QUEUE,指腾讯云 TDMQ 消息队列-队列模型。
  • - //
  • TDMQ_CMQ_TOPIC,指腾讯云 TDMQ 消息队列-主题模型。
  • - TargetType *string `json:"TargetType,omitempty" name:"TargetType"` - - // 队列名称,如果`TargetType`取值为`CMQ_QUEUE` 或 `TDMQ_CMQ_QUEUE`,则本字段必填。 - QueueName *string `json:"QueueName,omitempty" name:"QueueName"` - - // 主题名称,如果`TargetType`取值为`CMQ_TOPIC` 或 `TDMQ_CMQ_TOPIC`,则本字段必填。 - TopicName *string `json:"TopicName,omitempty" name:"TopicName"` -} - -type RelatedInstance struct { - // 实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例在伸缩活动中的状态。取值如下: - // INIT:初始化中 - // RUNNING:实例操作中 - // SUCCESSFUL:活动成功 - // FAILED:活动失败 - InstanceStatus *string `json:"InstanceStatus,omitempty" name:"InstanceStatus"` -} - -// Predefined struct for user -type RemoveInstancesRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type RemoveInstancesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *RemoveInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RemoveInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RemoveInstancesResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RemoveInstancesResponse struct { - *tchttp.BaseResponse - Response *RemoveInstancesResponseParams `json:"Response"` -} - -func (r *RemoveInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type RunAutomationServiceEnabled struct { - // 是否开启[自动化助手](https://cloud.tencent.com/document/product/1340)服务。取值范围:
  • TRUE:表示开启自动化助手服务
  • FALSE:表示不开启自动化助手服务 - // 注意:此字段可能返回 null,表示取不到有效值。 - Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` -} - -type RunMonitorServiceEnabled struct { - // 是否开启[云监控](https://cloud.tencent.com/document/product/248)服务。取值范围:
  • TRUE:表示开启云监控服务
  • FALSE:表示不开启云监控服务

    默认取值:TRUE。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` -} - -type RunSecurityServiceEnabled struct { - // 是否开启[云安全](https://cloud.tencent.com/document/product/296)服务。取值范围:
  • TRUE:表示开启云安全服务
  • FALSE:表示不开启云安全服务

    默认取值:TRUE。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` -} - -// Predefined struct for user -type ScaleInInstancesRequestParams struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 希望缩容的实例数量。 - ScaleInNumber *uint64 `json:"ScaleInNumber,omitempty" name:"ScaleInNumber"` -} - -type ScaleInInstancesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 希望缩容的实例数量。 - ScaleInNumber *uint64 `json:"ScaleInNumber,omitempty" name:"ScaleInNumber"` -} - -func (r *ScaleInInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ScaleInInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "ScaleInNumber") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ScaleInInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ScaleInInstancesResponseParams struct { - // 伸缩活动ID。 - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ScaleInInstancesResponse struct { - *tchttp.BaseResponse - Response *ScaleInInstancesResponseParams `json:"Response"` -} - -func (r *ScaleInInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ScaleInInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ScaleOutInstancesRequestParams struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 希望扩容的实例数量。 - ScaleOutNumber *uint64 `json:"ScaleOutNumber,omitempty" name:"ScaleOutNumber"` -} - -type ScaleOutInstancesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 希望扩容的实例数量。 - ScaleOutNumber *uint64 `json:"ScaleOutNumber,omitempty" name:"ScaleOutNumber"` -} - -func (r *ScaleOutInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ScaleOutInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "ScaleOutNumber") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ScaleOutInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ScaleOutInstancesResponseParams struct { - // 伸缩活动ID。 - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ScaleOutInstancesResponse struct { - *tchttp.BaseResponse - Response *ScaleOutInstancesResponseParams `json:"Response"` -} - -func (r *ScaleOutInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ScaleOutInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type ScalingPolicy struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 告警触发策略ID。 - AutoScalingPolicyId *string `json:"AutoScalingPolicyId,omitempty" name:"AutoScalingPolicyId"` - - // 告警触发策略类型。取值: - // - SIMPLE:简单策略 - // - TARGET_TRACKING:目标追踪策略 - ScalingPolicyType *string `json:"ScalingPolicyType,omitempty" name:"ScalingPolicyType"` - - // 告警触发策略名称。 - ScalingPolicyName *string `json:"ScalingPolicyName,omitempty" name:"ScalingPolicyName"` - - // 告警触发后,期望实例数修改方式,仅适用于简单策略。取值范围:
  • CHANGE_IN_CAPACITY:增加或减少若干期望实例数
  • EXACT_CAPACITY:调整至指定期望实例数
  • PERCENT_CHANGE_IN_CAPACITY:按百分比调整期望实例数
  • - AdjustmentType *string `json:"AdjustmentType,omitempty" name:"AdjustmentType"` - - // 告警触发后,期望实例数的调整值,仅适用于简单策略。 - AdjustmentValue *int64 `json:"AdjustmentValue,omitempty" name:"AdjustmentValue"` - - // 冷却时间,仅适用于简单策略。 - Cooldown *uint64 `json:"Cooldown,omitempty" name:"Cooldown"` - - // 简单告警触发策略告警监控指标,仅适用于简单策略。 - MetricAlarm *MetricAlarm `json:"MetricAlarm,omitempty" name:"MetricAlarm"` - - // 预定义监控项,仅适用于目标追踪策略。取值范围:
  • ASG_AVG_CPU_UTILIZATION:平均CPU使用率
  • ASG_AVG_LAN_TRAFFIC_OUT:平均内网出带宽
  • ASG_AVG_LAN_TRAFFIC_IN:平均内网入带宽
  • ASG_AVG_WAN_TRAFFIC_OUT:平均外网出带宽
  • ASG_AVG_WAN_TRAFFIC_IN:平均外网出带宽
  • - // 注意:此字段可能返回 null,表示取不到有效值。 - PredefinedMetricType *string `json:"PredefinedMetricType,omitempty" name:"PredefinedMetricType"` - - // 目标值,仅适用于目标追踪策略。
  • ASG_AVG_CPU_UTILIZATION:[1, 100),单位:%
  • ASG_AVG_LAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_LAN_TRAFFIC_IN:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_OUT:>0,单位:Mbps
  • ASG_AVG_WAN_TRAFFIC_IN:>0,单位:Mbps
  • - // 注意:此字段可能返回 null,表示取不到有效值。 - TargetValue *uint64 `json:"TargetValue,omitempty" name:"TargetValue"` - - // 实例预热时间,单位为秒,仅适用于目标追踪策略。取值范围为0-3600。 - // 注意:此字段可能返回 null,表示取不到有效值。 - EstimatedInstanceWarmup *uint64 `json:"EstimatedInstanceWarmup,omitempty" name:"EstimatedInstanceWarmup"` - - // 是否禁用缩容,仅适用于目标追踪策略。取值范围:
  • true:目标追踪策略仅触发扩容
  • false:目标追踪策略触发扩容和缩容
  • - // 注意:此字段可能返回 null,表示取不到有效值。 - DisableScaleIn *bool `json:"DisableScaleIn,omitempty" name:"DisableScaleIn"` - - // 告警监控指标列表,仅适用于目标追踪策略。 - // 注意:此字段可能返回 null,表示取不到有效值。 - MetricAlarms []*MetricAlarm `json:"MetricAlarms,omitempty" name:"MetricAlarms"` - - // 通知组ID,即为用户组ID集合。 - NotificationUserGroupIds []*string `json:"NotificationUserGroupIds,omitempty" name:"NotificationUserGroupIds"` -} - -type ScheduledAction struct { - // 定时任务ID。 - ScheduledActionId *string `json:"ScheduledActionId,omitempty" name:"ScheduledActionId"` - - // 定时任务名称。 - ScheduledActionName *string `json:"ScheduledActionName,omitempty" name:"ScheduledActionName"` - - // 定时任务所在伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 定时任务的开始时间。取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 定时任务的重复方式。 - Recurrence *string `json:"Recurrence,omitempty" name:"Recurrence"` - - // 定时任务的结束时间。取值为`北京时间`(UTC+8),按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ss+08:00`。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 定时任务设置的最大实例数。 - MaxSize *uint64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 定时任务设置的期望实例数。 - DesiredCapacity *uint64 `json:"DesiredCapacity,omitempty" name:"DesiredCapacity"` - - // 定时任务设置的最小实例数。 - MinSize *uint64 `json:"MinSize,omitempty" name:"MinSize"` - - // 定时任务的创建时间。取值为`UTC`时间,按照`ISO8601`标准,格式:`YYYY-MM-DDThh:mm:ssZ`。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 定时任务的执行类型。取值范围:
  • CRONTAB:代表定时任务为重复执行。
  • ONCE:代表定时任务为单次执行。 - ScheduledType *string `json:"ScheduledType,omitempty" name:"ScheduledType"` -} - -type ServiceSettings struct { - // 开启监控不健康替换服务。若开启则对于云监控标记为不健康的实例,弹性伸缩服务会进行替换。若不指定该参数,则默认为 False。 - ReplaceMonitorUnhealthy *bool `json:"ReplaceMonitorUnhealthy,omitempty" name:"ReplaceMonitorUnhealthy"` - - // 取值范围: - // CLASSIC_SCALING:经典方式,使用创建、销毁实例来实现扩缩容; - // WAKE_UP_STOPPED_SCALING:扩容优先开机。扩容时优先对已关机的实例执行开机操作,若开机后实例数仍低于期望实例数,则创建实例,缩容仍采用销毁实例的方式。用户可以使用StopAutoScalingInstances接口来关闭伸缩组内的实例。监控告警触发的扩容仍将创建实例 - // 默认取值:CLASSIC_SCALING - ScalingMode *string `json:"ScalingMode,omitempty" name:"ScalingMode"` - - // 开启负载均衡不健康替换服务。若开启则对于负载均衡健康检查判断不健康的实例,弹性伸缩服务会进行替换。若不指定该参数,则默认为 False。 - ReplaceLoadBalancerUnhealthy *bool `json:"ReplaceLoadBalancerUnhealthy,omitempty" name:"ReplaceLoadBalancerUnhealthy"` -} - -// Predefined struct for user -type SetInstancesProtectionRequestParams struct { - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 实例ID。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例是否需要设置保护。 - ProtectedFromScaleIn *bool `json:"ProtectedFromScaleIn,omitempty" name:"ProtectedFromScaleIn"` -} - -type SetInstancesProtectionRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID。 - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 实例ID。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例是否需要设置保护。 - ProtectedFromScaleIn *bool `json:"ProtectedFromScaleIn,omitempty" name:"ProtectedFromScaleIn"` -} - -func (r *SetInstancesProtectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *SetInstancesProtectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "InstanceIds") - delete(f, "ProtectedFromScaleIn") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SetInstancesProtectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type SetInstancesProtectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type SetInstancesProtectionResponse struct { - *tchttp.BaseResponse - Response *SetInstancesProtectionResponseParams `json:"Response"` -} - -func (r *SetInstancesProtectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *SetInstancesProtectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type SpotMarketOptions struct { - // 竞价出价,例如“1.05” - MaxPrice *string `json:"MaxPrice,omitempty" name:"MaxPrice"` - - // 竞价请求类型,当前仅支持类型:one-time,默认值为one-time - // 注意:此字段可能返回 null,表示取不到有效值。 - SpotInstanceType *string `json:"SpotInstanceType,omitempty" name:"SpotInstanceType"` -} - -type SpotMixedAllocationPolicy struct { - // 混合模式下,基础容量的大小,基础容量部分固定为按量计费实例。默认值 0,最大不可超过伸缩组的最大实例数。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BaseCapacity *uint64 `json:"BaseCapacity,omitempty" name:"BaseCapacity"` - - // 超出基础容量部分,按量计费实例所占的比例。取值范围 [0, 100],0 代表超出基础容量的部分仅生产竞价实例,100 代表仅生产按量实例,默认值为 70。按百分比计算按量实例数时,向上取整。 - // 比如,总期望实例数取 3,基础容量取 1,超基础部分按量百分比取 1,则最终按量 2 台(1 台来自基础容量,1 台按百分比向上取整得到),竞价 1台。 - // 注意:此字段可能返回 null,表示取不到有效值。 - OnDemandPercentageAboveBaseCapacity *uint64 `json:"OnDemandPercentageAboveBaseCapacity,omitempty" name:"OnDemandPercentageAboveBaseCapacity"` - - // 混合模式下,竞价实例的分配策略。取值包括 COST_OPTIMIZED 和 CAPACITY_OPTIMIZED,默认取 COST_OPTIMIZED。 - //
  • COST_OPTIMIZED,成本优化策略。对于启动配置内的所有机型,按照各机型在各可用区的每核单价由小到大依次尝试。优先尝试购买每核单价最便宜的,如果购买失败则尝试购买次便宜的,以此类推。 - //
  • CAPACITY_OPTIMIZED,容量优化策略。对于启动配置内的所有机型,按照各机型在各可用区的库存情况由大到小依次尝试。优先尝试购买剩余库存最大的机型,这样可尽量降低竞价实例被动回收的发生概率。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SpotAllocationStrategy *string `json:"SpotAllocationStrategy,omitempty" name:"SpotAllocationStrategy"` - - // 按量实例替补功能。取值范围: - //
  • TRUE,开启该功能,当所有竞价机型因库存不足等原因全部购买失败后,尝试购买按量实例。 - //
  • FALSE,不开启该功能,伸缩组在需要扩容竞价实例时仅尝试所配置的竞价机型。 - // - // 默认取值: TRUE。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CompensateWithBaseInstance *bool `json:"CompensateWithBaseInstance,omitempty" name:"CompensateWithBaseInstance"` -} - -// Predefined struct for user -type StartAutoScalingInstancesRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 待开启的CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type StartAutoScalingInstancesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 待开启的CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *StartAutoScalingInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *StartAutoScalingInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "StartAutoScalingInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type StartAutoScalingInstancesResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type StartAutoScalingInstancesResponse struct { - *tchttp.BaseResponse - Response *StartAutoScalingInstancesResponseParams `json:"Response"` -} - -func (r *StartAutoScalingInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *StartAutoScalingInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type StopAutoScalingInstancesRequestParams struct { - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 待关闭的CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 关闭的实例是否收费,取值为: - // KEEP_CHARGING:关机继续收费 - // STOP_CHARGING:关机停止收费 - // 默认为 KEEP_CHARGING - StoppedMode *string `json:"StoppedMode,omitempty" name:"StoppedMode"` -} - -type StopAutoScalingInstancesRequest struct { - *tchttp.BaseRequest - - // 伸缩组ID - AutoScalingGroupId *string `json:"AutoScalingGroupId,omitempty" name:"AutoScalingGroupId"` - - // 待关闭的CVM实例ID列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 关闭的实例是否收费,取值为: - // KEEP_CHARGING:关机继续收费 - // STOP_CHARGING:关机停止收费 - // 默认为 KEEP_CHARGING - StoppedMode *string `json:"StoppedMode,omitempty" name:"StoppedMode"` -} - -func (r *StopAutoScalingInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *StopAutoScalingInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AutoScalingGroupId") - delete(f, "InstanceIds") - delete(f, "StoppedMode") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "StopAutoScalingInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type StopAutoScalingInstancesResponseParams struct { - // 伸缩活动ID - ActivityId *string `json:"ActivityId,omitempty" name:"ActivityId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type StopAutoScalingInstancesResponse struct { - *tchttp.BaseResponse - Response *StopAutoScalingInstancesResponseParams `json:"Response"` -} - -func (r *StopAutoScalingInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *StopAutoScalingInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type SystemDisk struct { - // 系统盘类型。系统盘类型限制详见[云硬盘类型](https://cloud.tencent.com/document/product/362/2353)。取值范围:
  • LOCAL_BASIC:本地硬盘
  • LOCAL_SSD:本地SSD硬盘
  • CLOUD_BASIC:普通云硬盘
  • CLOUD_PREMIUM:高性能云硬盘
  • CLOUD_SSD:SSD云硬盘

    默认取值:CLOUD_PREMIUM。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiskType *string `json:"DiskType,omitempty" name:"DiskType"` - - // 系统盘大小,单位:GB。默认值为 50 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiskSize *uint64 `json:"DiskSize,omitempty" name:"DiskSize"` -} - -type Tag struct { - // 标签键 - Key *string `json:"Key,omitempty" name:"Key"` - - // 标签值 - Value *string `json:"Value,omitempty" name:"Value"` - - // 标签绑定的资源类型,当前支持类型:"auto-scaling-group - // 注意:此字段可能返回 null,表示取不到有效值。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` -} - -type TargetAttribute struct { - // 端口 - Port *uint64 `json:"Port,omitempty" name:"Port"` - - // 权重 - Weight *uint64 `json:"Weight,omitempty" name:"Weight"` -} - -// Predefined struct for user -type UpgradeLaunchConfigurationRequestParams struct { - // 启动配置ID。 - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-8toqc6s3`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例机型列表,不同实例机型指定了不同的资源规格,最多支持5种实例机型。 - InstanceTypes []*string `json:"InstanceTypes,omitempty" name:"InstanceTypes"` - - // 启动配置显示名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘,最多支持指定11块数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 实例计费类型,CVM默认值按照POSTPAID_BY_HOUR处理。 - //
  • POSTPAID_BY_HOUR:按小时后付费 - //
  • SPOTPAID:竞价付费 - //
  • PREPAID:预付费,即包年包月 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 实例类型校验策略,取值包括 ALL 和 ANY,默认取值为ANY。 - //
  • ALL,所有实例类型(InstanceType)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个实例类型(InstanceType)可用则通过校验,否则校验报错。 - // - // 实例类型不可用的常见原因包括该实例类型售罄、对应云盘售罄等。 - // 如果 InstanceTypes 中一款机型不存在或者已下线,则无论 InstanceTypesCheckPolicy 采用何种取值,都会校验报错。 - InstanceTypesCheckPolicy *string `json:"InstanceTypesCheckPolicy,omitempty" name:"InstanceTypesCheckPolicy"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 该参数已失效,请勿使用。升级启动配置接口无法修改或覆盖 LoginSettings 参数,升级后 LoginSettings 不会发生变化。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属项目ID。不填为默认项目。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的`SecurityGroupId`字段来获取。若不指定该参数,则默认不绑定安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 经过 Base64 编码后的自定义数据,最大长度不超过16KB。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 标签列表。通过指定该参数,可以为扩容的实例绑定标签。最多支持指定10个标签。 - InstanceTags []*InstanceTag `json:"InstanceTags,omitempty" name:"InstanceTags"` - - // CAM角色名称。可通过DescribeRoleList接口返回值中的roleName获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 云服务器主机名(HostName)的相关设置。 - HostNameSettings *HostNameSettings `json:"HostNameSettings,omitempty" name:"HostNameSettings"` - - // 云服务器实例名(InstanceName)的相关设置。 - InstanceNameSettings *InstanceNameSettings `json:"InstanceNameSettings,omitempty" name:"InstanceNameSettings"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 云盘类型选择策略,取值范围: - //
  • ORIGINAL:使用设置的云盘类型 - //
  • AUTOMATIC:自动选择当前可用的云盘类型 - DiskTypePolicy *string `json:"DiskTypePolicy,omitempty" name:"DiskTypePolicy"` - - // IPv6公网带宽相关信息设置。若新建实例包含IPv6地址,该参数可为新建实例的IPv6地址分配公网带宽。关联启动配置的伸缩组Ipv6AddressCount参数为0时,该参数不会生效。 - IPv6InternetAccessible *IPv6InternetAccessible `json:"IPv6InternetAccessible,omitempty" name:"IPv6InternetAccessible"` -} - -type UpgradeLaunchConfigurationRequest struct { - *tchttp.BaseRequest - - // 启动配置ID。 - LaunchConfigurationId *string `json:"LaunchConfigurationId,omitempty" name:"LaunchConfigurationId"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-8toqc6s3`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例机型列表,不同实例机型指定了不同的资源规格,最多支持5种实例机型。 - InstanceTypes []*string `json:"InstanceTypes,omitempty" name:"InstanceTypes"` - - // 启动配置显示名称。名称仅支持中文、英文、数字、下划线、分隔符"-"、小数点,最大长度不能超60个字节。 - LaunchConfigurationName *string `json:"LaunchConfigurationName,omitempty" name:"LaunchConfigurationName"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘,最多支持指定11块数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 实例计费类型,CVM默认值按照POSTPAID_BY_HOUR处理。 - //
  • POSTPAID_BY_HOUR:按小时后付费 - //
  • SPOTPAID:竞价付费 - //
  • PREPAID:预付费,即包年包月 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 实例类型校验策略,取值包括 ALL 和 ANY,默认取值为ANY。 - //
  • ALL,所有实例类型(InstanceType)都可用则通过校验,否则校验报错。 - //
  • ANY,存在任何一个实例类型(InstanceType)可用则通过校验,否则校验报错。 - // - // 实例类型不可用的常见原因包括该实例类型售罄、对应云盘售罄等。 - // 如果 InstanceTypes 中一款机型不存在或者已下线,则无论 InstanceTypesCheckPolicy 采用何种取值,都会校验报错。 - InstanceTypesCheckPolicy *string `json:"InstanceTypesCheckPolicy,omitempty" name:"InstanceTypesCheckPolicy"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 该参数已失效,请勿使用。升级启动配置接口无法修改或覆盖 LoginSettings 参数,升级后 LoginSettings 不会发生变化。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属项目ID。不填为默认项目。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的`SecurityGroupId`字段来获取。若不指定该参数,则默认不绑定安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 经过 Base64 编码后的自定义数据,最大长度不超过16KB。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 标签列表。通过指定该参数,可以为扩容的实例绑定标签。最多支持指定10个标签。 - InstanceTags []*InstanceTag `json:"InstanceTags,omitempty" name:"InstanceTags"` - - // CAM角色名称。可通过DescribeRoleList接口返回值中的roleName获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 云服务器主机名(HostName)的相关设置。 - HostNameSettings *HostNameSettings `json:"HostNameSettings,omitempty" name:"HostNameSettings"` - - // 云服务器实例名(InstanceName)的相关设置。 - InstanceNameSettings *InstanceNameSettings `json:"InstanceNameSettings,omitempty" name:"InstanceNameSettings"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 云盘类型选择策略,取值范围: - //
  • ORIGINAL:使用设置的云盘类型 - //
  • AUTOMATIC:自动选择当前可用的云盘类型 - DiskTypePolicy *string `json:"DiskTypePolicy,omitempty" name:"DiskTypePolicy"` - - // IPv6公网带宽相关信息设置。若新建实例包含IPv6地址,该参数可为新建实例的IPv6地址分配公网带宽。关联启动配置的伸缩组Ipv6AddressCount参数为0时,该参数不会生效。 - IPv6InternetAccessible *IPv6InternetAccessible `json:"IPv6InternetAccessible,omitempty" name:"IPv6InternetAccessible"` -} - -func (r *UpgradeLaunchConfigurationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UpgradeLaunchConfigurationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchConfigurationId") - delete(f, "ImageId") - delete(f, "InstanceTypes") - delete(f, "LaunchConfigurationName") - delete(f, "DataDisks") - delete(f, "EnhancedService") - delete(f, "InstanceChargeType") - delete(f, "InstanceMarketOptions") - delete(f, "InstanceTypesCheckPolicy") - delete(f, "InternetAccessible") - delete(f, "LoginSettings") - delete(f, "ProjectId") - delete(f, "SecurityGroupIds") - delete(f, "SystemDisk") - delete(f, "UserData") - delete(f, "InstanceTags") - delete(f, "CamRoleName") - delete(f, "HostNameSettings") - delete(f, "InstanceNameSettings") - delete(f, "InstanceChargePrepaid") - delete(f, "DiskTypePolicy") - delete(f, "IPv6InternetAccessible") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpgradeLaunchConfigurationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UpgradeLaunchConfigurationResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type UpgradeLaunchConfigurationResponse struct { - *tchttp.BaseResponse - Response *UpgradeLaunchConfigurationResponseParams `json:"Response"` -} - -func (r *UpgradeLaunchConfigurationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UpgradeLaunchConfigurationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UpgradeLifecycleHookRequestParams struct { - // 生命周期挂钩ID - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 生命周期挂钩名称 - LifecycleHookName *string `json:"LifecycleHookName,omitempty" name:"LifecycleHookName"` - - // 进行生命周期挂钩的场景,取值范围包括“INSTANCE_LAUNCHING”和“INSTANCE_TERMINATING” - LifecycleTransition *string `json:"LifecycleTransition,omitempty" name:"LifecycleTransition"` - - // 定义伸缩组在生命周期挂钩超时的情况下应采取的操作,取值范围是“CONTINUE”或“ABANDON”,默认值为“CONTINUE” - DefaultResult *string `json:"DefaultResult,omitempty" name:"DefaultResult"` - - // 生命周期挂钩超时之前可以经过的最长时间(以秒为单位),范围从30到7200秒,默认值为300秒 - HeartbeatTimeout *int64 `json:"HeartbeatTimeout,omitempty" name:"HeartbeatTimeout"` - - // 弹性伸缩向通知目标发送的附加信息,配置通知时使用,默认值为空字符串"" - NotificationMetadata *string `json:"NotificationMetadata,omitempty" name:"NotificationMetadata"` - - // 通知目标。NotificationTarget和LifecycleCommand参数互斥,二者不可同时指定。 - NotificationTarget *NotificationTarget `json:"NotificationTarget,omitempty" name:"NotificationTarget"` - - // 进行生命周期挂钩的场景类型,取值范围包括NORMAL 和 EXTENSION。说明:设置为EXTENSION值,在AttachInstances、DetachInstances、RemoveInstaces接口时会触发生命周期挂钩操作,值为NORMAL则不会在这些接口中触发生命周期挂钩。 - LifecycleTransitionType *string `json:"LifecycleTransitionType,omitempty" name:"LifecycleTransitionType"` - - // 远程命令执行对象。NotificationTarget和LifecycleCommand参数互斥,二者不可同时指定。 - LifecycleCommand *LifecycleCommand `json:"LifecycleCommand,omitempty" name:"LifecycleCommand"` -} - -type UpgradeLifecycleHookRequest struct { - *tchttp.BaseRequest - - // 生命周期挂钩ID - LifecycleHookId *string `json:"LifecycleHookId,omitempty" name:"LifecycleHookId"` - - // 生命周期挂钩名称 - LifecycleHookName *string `json:"LifecycleHookName,omitempty" name:"LifecycleHookName"` - - // 进行生命周期挂钩的场景,取值范围包括“INSTANCE_LAUNCHING”和“INSTANCE_TERMINATING” - LifecycleTransition *string `json:"LifecycleTransition,omitempty" name:"LifecycleTransition"` - - // 定义伸缩组在生命周期挂钩超时的情况下应采取的操作,取值范围是“CONTINUE”或“ABANDON”,默认值为“CONTINUE” - DefaultResult *string `json:"DefaultResult,omitempty" name:"DefaultResult"` - - // 生命周期挂钩超时之前可以经过的最长时间(以秒为单位),范围从30到7200秒,默认值为300秒 - HeartbeatTimeout *int64 `json:"HeartbeatTimeout,omitempty" name:"HeartbeatTimeout"` - - // 弹性伸缩向通知目标发送的附加信息,配置通知时使用,默认值为空字符串"" - NotificationMetadata *string `json:"NotificationMetadata,omitempty" name:"NotificationMetadata"` - - // 通知目标。NotificationTarget和LifecycleCommand参数互斥,二者不可同时指定。 - NotificationTarget *NotificationTarget `json:"NotificationTarget,omitempty" name:"NotificationTarget"` - - // 进行生命周期挂钩的场景类型,取值范围包括NORMAL 和 EXTENSION。说明:设置为EXTENSION值,在AttachInstances、DetachInstances、RemoveInstaces接口时会触发生命周期挂钩操作,值为NORMAL则不会在这些接口中触发生命周期挂钩。 - LifecycleTransitionType *string `json:"LifecycleTransitionType,omitempty" name:"LifecycleTransitionType"` - - // 远程命令执行对象。NotificationTarget和LifecycleCommand参数互斥,二者不可同时指定。 - LifecycleCommand *LifecycleCommand `json:"LifecycleCommand,omitempty" name:"LifecycleCommand"` -} - -func (r *UpgradeLifecycleHookRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UpgradeLifecycleHookRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LifecycleHookId") - delete(f, "LifecycleHookName") - delete(f, "LifecycleTransition") - delete(f, "DefaultResult") - delete(f, "HeartbeatTimeout") - delete(f, "NotificationMetadata") - delete(f, "NotificationTarget") - delete(f, "LifecycleTransitionType") - delete(f, "LifecycleCommand") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UpgradeLifecycleHookRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UpgradeLifecycleHookResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type UpgradeLifecycleHookResponse struct { - *tchttp.BaseResponse - Response *UpgradeLifecycleHookResponseParams `json:"Response"` -} - -func (r *UpgradeLifecycleHookResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UpgradeLifecycleHookResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/circuit_breaker.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/circuit_breaker.go deleted file mode 100644 index 4d9e3a205f18..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/circuit_breaker.go +++ /dev/null @@ -1,274 +0,0 @@ -/* -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 common - -import ( - "errors" - "strings" - "sync" - "time" -) - -const ( - defaultBackupEndpoint = "ap-guangzhou.tencentcloudapi.com" - defaultMaxFailNum = 5 - defaultMaxFailPercentage = 75 - defaultWindowLength = 1 * 60 * time.Second - defaultTimeout = 60 * time.Second -) - -var ( - // ErrOpenState is returned when the CB state is open - errOpenState = errors.New("circuit breaker is open") -) - -// counter use atomic operations to ensure consistency -// Atomic operations perform better than mutex -type counter struct { - failures int - all int - consecutiveSuccesses int - consecutiveFailures int -} - -func newRegionCounter() counter { - return counter{ - failures: 0, - all: 0, - consecutiveSuccesses: 0, - consecutiveFailures: 0, - } -} - -func (c *counter) onSuccess() { - c.all++ - c.consecutiveSuccesses++ - c.consecutiveFailures = 0 -} - -func (c *counter) onFailure() { - c.all++ - c.failures++ - c.consecutiveSuccesses = 0 - c.consecutiveSuccesses = 0 -} - -func (c *counter) clear() { - c.all = 0 - c.failures = 0 - c.consecutiveSuccesses = 0 -} - -// State is a type that represents a state of CircuitBreaker. -type state int - -// These constants are states of CircuitBreaker. -const ( - StateClosed state = iota - StateHalfOpen - StateOpen -) - -type breakerSetting struct { - // backupEndpoint - // the default is "ap-guangzhou.tencentcloudapi.com" - backupEndpoint string - // max fail nums - // the default is 5 - maxFailNum int - // max fail percentage - // the default is 75/100 - maxFailPercentage int - // windowInterval decides when to reset counter if the state is StateClosed - // the default is 5minutes - windowInterval time.Duration - // timeout decides when to turn StateOpen to StateHalfOpen - // the default is 60s - timeout time.Duration - // maxRequests decides when to turn StateHalfOpen to StateClosed - maxRequests int -} - -type circuitBreaker struct { - // settings - breakerSetting - // read and write lock - mu sync.Mutex - // the breaker's state: closed, open, half-open - state state - // expiry time determines whether to enter the next generation - // if in StateClosed, it will be now + windowInterval - // if in StateOpen, it will be now + timeout - // if in StateHalfOpen. it will be zero - expiry time.Time - // generation decide whether add the afterRequest's request to counter - generation uint64 - // counter - counter counter -} - -func newRegionBreaker(set breakerSetting) (re *circuitBreaker) { - re = new(circuitBreaker) - re.breakerSetting = set - return -} - -func defaultRegionBreaker() *circuitBreaker { - defaultSet := breakerSetting{ - backupEndpoint: defaultBackupEndpoint, - maxFailNum: defaultMaxFailNum, - maxFailPercentage: defaultMaxFailPercentage, - windowInterval: defaultWindowLength, - timeout: defaultTimeout, - } - return newRegionBreaker(defaultSet) -} - -// currentState return the current state. -// -// if in StateClosed and now is over expiry time, it will turn to a new generation. -// if in StateOpen and now is over expiry time, it will turn to StateHalfOpen -func (s *circuitBreaker) currentState(now time.Time) (state, uint64) { - switch s.state { - case StateClosed: - if s.expiry.Before(now) { - s.toNewGeneration(now) - } - case StateOpen: - if s.expiry.Before(now) { - s.setState(StateHalfOpen, now) - } - } - return s.state, s.generation -} - -// setState set the circuitBreaker's state to newState -// and turn to new generation -func (s *circuitBreaker) setState(newState state, now time.Time) { - if s.state == newState { - return - } - s.state = newState - s.toNewGeneration(now) -} - -// toNewGeneration will increase the generation and clear the counter. -// it also will reset the expiry -func (s *circuitBreaker) toNewGeneration(now time.Time) { - s.generation++ - s.counter.clear() - var zero time.Time - switch s.state { - case StateClosed: - s.expiry = now.Add(s.windowInterval) - case StateOpen: - s.expiry = now.Add(s.timeout) - default: // StateHalfOpen - s.expiry = zero - } -} - -// beforeRequest return the current generation; if the breaker is in StateOpen, it will also return an errOpenState -func (s *circuitBreaker) beforeRequest() (uint64, error) { - s.mu.Lock() - defer s.mu.Unlock() - - now := time.Now() - state, generation := s.currentState(now) - //log.Println(s.counter) - if state == StateOpen { - return generation, errOpenState - } - return generation, nil -} - -func (s *circuitBreaker) afterRequest(before uint64, success bool) { - s.mu.Lock() - defer s.mu.Unlock() - - now := time.Now() - state, generation := s.currentState(now) - // the breaker has entered the next generation, the current results abandon. - if generation != before { - return - } - if success { - s.onSuccess(state, now) - } else { - s.onFailure(state, now) - } -} - -func (s *circuitBreaker) onSuccess(state state, now time.Time) { - switch state { - case StateClosed: - s.counter.onSuccess() - case StateHalfOpen: - s.counter.onSuccess() - // The conditions for closing breaker are met - if s.counter.all-s.counter.failures >= s.maxRequests { - s.setState(StateClosed, now) - } - } -} - -func (s *circuitBreaker) readyToOpen(c counter) bool { - failPre := float64(c.failures) / float64(c.all) - return (c.failures >= s.maxFailNum && failPre >= float64(s.maxFailPercentage)/100.0) || - c.consecutiveFailures > 5 -} - -func (s *circuitBreaker) onFailure(state state, now time.Time) { - switch state { - case StateClosed: - s.counter.onFailure() - if f := s.readyToOpen(s.counter); f { - s.setState(StateOpen, now) - } - case StateHalfOpen: - s.setState(StateOpen, now) - } -} - -// checkEndpoint -// valid: cvm.ap-shanghai.tencentcloudapi.com, cvm.ap-shenzhen-fs.tencentcloudapi.com,cvm.tencentcloudapi.com -// invalid: cvm.tencentcloud.com -func checkEndpoint(endpoint string) bool { - ss := strings.Split(endpoint, ".") - if len(ss) != 4 && len(ss) != 3 { - return false - } - if ss[len(ss)-2] != "tencentcloudapi" { - return false - } - // ap-beijing - if len(ss) == 4 && len(strings.Split(ss[1], "-")) < 2 { - return false - } - return true -} - -func renewUrl(oldDomain, region string) string { - ss := strings.Split(oldDomain, ".") - if len(ss) == 3 { - ss = append([]string{ss[0], region}, ss[1:]...) - } else if len(ss) == 4 { - ss[1] = region - } - newDomain := strings.Join(ss, ".") - return newDomain -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/circuit_breaker_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/circuit_breaker_test.go deleted file mode 100644 index 8cac543c915b..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/circuit_breaker_test.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -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 common - -import "testing" - -func Test_checkDomain(t *testing.T) { - type args struct { - endpoint string - } - tests := []struct { - name string - args args - want bool - }{ - {"valid endpoint", args{endpoint: "cvm.tencentcloudapi.com"}, true}, - {"valid endpoint", args{endpoint: "cvm.ap-beijing.tencentcloudapi.com"}, true}, - {"invalid endpoint", args{endpoint: "cvm.tencentcloud.com"}, false}, - {"invalid endpoint", args{endpoint: "cvm.com"}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := checkEndpoint(tt.args.endpoint); got != tt.want { - t.Errorf("checkEndpoint() = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_renewUrl(t *testing.T) { - type args struct { - oldDomain string - region string - } - tests := []struct { - name string - args args - want string - }{ - {"success3", args{ - oldDomain: "cvm.tencentcloudapi.com", - region: "ap-beijing", - }, "cvm.ap-beijing.tencentcloudapi.com"}, - {"success4", args{ - oldDomain: "cvm.ap-beijing.tencentcloudapi.com", - region: "ap-shanghai", - }, "cvm.ap-shanghai.tencentcloudapi.com", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := renewUrl(tt.args.oldDomain, tt.args.region); got != tt.want { - t.Errorf("renewUrl() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/client.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/client.go deleted file mode 100644 index 7f554f99734e..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/client.go +++ /dev/null @@ -1,613 +0,0 @@ -/* -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 common - -import ( - "encoding/hex" - "encoding/json" - "fmt" - "log" - "net/http" - "net/http/httputil" - "net/url" - "os" - "regexp" - "strconv" - "strings" - "time" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile" -) - -const ( - octetStream = "application/octet-stream" -) - -var DefaultHttpClient *http.Client - -type Client struct { - region string - httpClient *http.Client - httpProfile *profile.HttpProfile - profile *profile.ClientProfile - credential CredentialIface - signMethod string - unsignedPayload bool - debug bool - rb *circuitBreaker - logger Logger - requestClient string -} - -func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err error) { - if request.GetScheme() == "" { - request.SetScheme(c.httpProfile.Scheme) - } - - if request.GetRootDomain() == "" { - request.SetRootDomain(c.httpProfile.RootDomain) - } - - if request.GetDomain() == "" { - domain := c.httpProfile.Endpoint - if domain == "" { - domain = request.GetServiceDomain(request.GetService()) - } - request.SetDomain(domain) - } - - if request.GetHttpMethod() == "" { - request.SetHttpMethod(c.httpProfile.ReqMethod) - } - - tchttp.CompleteCommonParams(request, c.GetRegion(), c.requestClient) - - // reflect to inject client if field ClientToken exists and retry feature is enabled - if c.profile.NetworkFailureMaxRetries > 0 || c.profile.RateLimitExceededMaxRetries > 0 { - safeInjectClientToken(request) - } - - if request.GetSkipSign() { - // Some APIs can skip signature. - return c.sendWithoutSignature(request, response) - } else if c.profile.DisableRegionBreaker == true || c.rb == nil { - return c.sendWithSignature(request, response) - } else { - return c.sendWithRegionBreaker(request, response) - } -} - -func (c *Client) sendWithRegionBreaker(request tchttp.Request, response tchttp.Response) (err error) { - defer func() { - e := recover() - if e != nil { - msg := fmt.Sprintf("%s", e) - err = tcerr.NewTencentCloudSDKError("ClientError.CircuitBreakerError", msg, "") - } - }() - - ge, err := c.rb.beforeRequest() - - if err == errOpenState { - newEndpoint := request.GetService() + "." + c.rb.backupEndpoint - request.SetDomain(newEndpoint) - } - err = c.sendWithSignature(request, response) - isSuccess := false - // Success is considered only when the server returns an effective response (have requestId and the code is not InternalError ) - if e, ok := err.(*tcerr.TencentCloudSDKError); ok { - if e.GetRequestId() != "" && e.GetCode() != "InternalError" { - isSuccess = true - } - } - c.rb.afterRequest(ge, isSuccess) - return err -} - -func (c *Client) sendWithSignature(request tchttp.Request, response tchttp.Response) (err error) { - if c.signMethod == "HmacSHA1" || c.signMethod == "HmacSHA256" { - return c.sendWithSignatureV1(request, response) - } else { - return c.sendWithSignatureV3(request, response) - } -} - -func (c *Client) sendWithoutSignature(request tchttp.Request, response tchttp.Response) error { - headers := map[string]string{ - "Host": request.GetDomain(), - "X-TC-Action": request.GetAction(), - "X-TC-Version": request.GetVersion(), - "X-TC-Timestamp": request.GetParams()["Timestamp"], - "X-TC-RequestClient": request.GetParams()["RequestClient"], - "X-TC-Language": c.profile.Language, - "Authorization": "SKIP", - } - if c.region != "" { - headers["X-TC-Region"] = c.region - } - if c.credential != nil && c.credential.GetToken() != "" { - headers["X-TC-Token"] = c.credential.GetToken() - } - if request.GetHttpMethod() == "GET" { - headers["Content-Type"] = "application/x-www-form-urlencoded" - } else { - headers["Content-Type"] = "application/json" - } - isOctetStream := false - cr := &tchttp.CommonRequest{} - ok := false - var octetStreamBody []byte - if cr, ok = request.(*tchttp.CommonRequest); ok { - if cr.IsOctetStream() { - isOctetStream = true - // custom headers must contain Content-Type : application/octet-stream - // todo:the custom header may overwrite headers - for k, v := range cr.GetHeader() { - headers[k] = v - } - octetStreamBody = cr.GetOctetStreamBody() - } - } - - for k, v := range request.GetHeader() { - switch k { - case "X-TC-Action", "X-TC-Version", "X-TC-Timestamp", "X-TC-RequestClient", - "X-TC-Language", "Content-Type", "X-TC-Region", "X-TC-Token": - c.logger.Printf("Skip header \"%s\": can not specify built-in header", k) - default: - headers[k] = v - } - } - - if !isOctetStream && request.GetContentType() == octetStream { - isOctetStream = true - b, _ := json.Marshal(request) - var m map[string]string - _ = json.Unmarshal(b, &m) - for k, v := range m { - key := "X-" + strings.ToUpper(request.GetService()) + "-" + k - headers[key] = v - } - - headers["Content-Type"] = octetStream - octetStreamBody = request.GetBody() - } - // start signature v3 process - - // build canonical request string - httpRequestMethod := request.GetHttpMethod() - canonicalQueryString := "" - if httpRequestMethod == "GET" { - err := tchttp.ConstructParams(request) - if err != nil { - return err - } - params := make(map[string]string) - for key, value := range request.GetParams() { - params[key] = value - } - delete(params, "Action") - delete(params, "Version") - delete(params, "Nonce") - delete(params, "Region") - delete(params, "RequestClient") - delete(params, "Timestamp") - canonicalQueryString = tchttp.GetUrlQueriesEncoded(params) - } - requestPayload := "" - if httpRequestMethod == "POST" { - if isOctetStream { - // todo Conversion comparison between string and []byte affects performance much - requestPayload = string(octetStreamBody) - } else { - b, err := json.Marshal(request) - if err != nil { - return err - } - requestPayload = string(b) - } - } - if c.unsignedPayload { - headers["X-TC-Content-SHA256"] = "UNSIGNED-PAYLOAD" - } - - url := request.GetScheme() + "://" + request.GetDomain() + request.GetPath() - if canonicalQueryString != "" { - url = url + "?" + canonicalQueryString - } - httpRequest, err := http.NewRequestWithContext(request.GetContext(), httpRequestMethod, url, strings.NewReader(requestPayload)) - if err != nil { - return err - } - for k, v := range headers { - httpRequest.Header[k] = []string{v} - } - httpResponse, err := c.sendWithRateLimitRetry(httpRequest, isRetryable(request)) - if err != nil { - return err - } - err = tchttp.ParseFromHttpResponse(httpResponse, response) - return err -} - -func (c *Client) sendWithSignatureV1(request tchttp.Request, response tchttp.Response) (err error) { - // TODO: not an elegant way, it should be done in common params, but finally it need to refactor - request.GetParams()["Language"] = c.profile.Language - err = tchttp.ConstructParams(request) - if err != nil { - return err - } - err = signRequest(request, c.credential, c.signMethod) - if err != nil { - return err - } - httpRequest, err := http.NewRequestWithContext(request.GetContext(), request.GetHttpMethod(), request.GetUrl(), request.GetBodyReader()) - if err != nil { - return err - } - if request.GetHttpMethod() == "POST" { - httpRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded") - } - - for k, v := range request.GetHeader() { - httpRequest.Header.Set(k, v) - } - - httpResponse, err := c.sendWithRateLimitRetry(httpRequest, isRetryable(request)) - if err != nil { - return err - } - err = tchttp.ParseFromHttpResponse(httpResponse, response) - return err -} - -func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Response) (err error) { - headers := map[string]string{ - "Host": request.GetDomain(), - "X-TC-Action": request.GetAction(), - "X-TC-Version": request.GetVersion(), - "X-TC-Timestamp": request.GetParams()["Timestamp"], - "X-TC-RequestClient": request.GetParams()["RequestClient"], - "X-TC-Language": c.profile.Language, - } - if c.region != "" { - headers["X-TC-Region"] = c.region - } - if c.credential.GetToken() != "" { - headers["X-TC-Token"] = c.credential.GetToken() - } - if request.GetHttpMethod() == "GET" { - headers["Content-Type"] = "application/x-www-form-urlencoded" - } else { - headers["Content-Type"] = "application/json" - } - isOctetStream := false - cr := &tchttp.CommonRequest{} - ok := false - var octetStreamBody []byte - if cr, ok = request.(*tchttp.CommonRequest); ok { - if cr.IsOctetStream() { - isOctetStream = true - // custom headers must contain Content-Type : application/octet-stream - // todo:the custom header may overwrite headers - for k, v := range cr.GetHeader() { - headers[k] = v - } - octetStreamBody = cr.GetOctetStreamBody() - } - } - - for k, v := range request.GetHeader() { - switch k { - case "X-TC-Action", "X-TC-Version", "X-TC-Timestamp", "X-TC-RequestClient", - "X-TC-Language", "X-TC-Region", "X-TC-Token": - c.logger.Printf("Skip header \"%s\": can not specify built-in header", k) - default: - headers[k] = v - } - } - - if !isOctetStream && request.GetContentType() == octetStream { - isOctetStream = true - b, _ := json.Marshal(request) - var m map[string]string - _ = json.Unmarshal(b, &m) - for k, v := range m { - key := "X-" + strings.ToUpper(request.GetService()) + "-" + k - headers[key] = v - } - - headers["Content-Type"] = octetStream - octetStreamBody = request.GetBody() - } - // start signature v3 process - - // build canonical request string - httpRequestMethod := request.GetHttpMethod() - canonicalURI := "/" - canonicalQueryString := "" - if httpRequestMethod == "GET" { - err = tchttp.ConstructParams(request) - if err != nil { - return err - } - params := make(map[string]string) - for key, value := range request.GetParams() { - params[key] = value - } - delete(params, "Action") - delete(params, "Version") - delete(params, "Nonce") - delete(params, "Region") - delete(params, "RequestClient") - delete(params, "Timestamp") - canonicalQueryString = tchttp.GetUrlQueriesEncoded(params) - } - canonicalHeaders := fmt.Sprintf("content-type:%s\nhost:%s\n", headers["Content-Type"], headers["Host"]) - signedHeaders := "content-type;host" - requestPayload := "" - if httpRequestMethod == "POST" { - if isOctetStream { - // todo Conversion comparison between string and []byte affects performance much - requestPayload = string(octetStreamBody) - } else { - b, err := json.Marshal(request) - if err != nil { - return err - } - requestPayload = string(b) - } - } - hashedRequestPayload := "" - if c.unsignedPayload { - hashedRequestPayload = sha256hex("UNSIGNED-PAYLOAD") - headers["X-TC-Content-SHA256"] = "UNSIGNED-PAYLOAD" - } else { - hashedRequestPayload = sha256hex(requestPayload) - } - canonicalRequest := fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s", - httpRequestMethod, - canonicalURI, - canonicalQueryString, - canonicalHeaders, - signedHeaders, - hashedRequestPayload) - //log.Println("canonicalRequest:", canonicalRequest) - - // build string to sign - algorithm := "TC3-HMAC-SHA256" - requestTimestamp := headers["X-TC-Timestamp"] - timestamp, _ := strconv.ParseInt(requestTimestamp, 10, 64) - t := time.Unix(timestamp, 0).UTC() - // must be the format 2006-01-02, ref to package time for more info - date := t.Format("2006-01-02") - credentialScope := fmt.Sprintf("%s/%s/tc3_request", date, request.GetService()) - hashedCanonicalRequest := sha256hex(canonicalRequest) - string2sign := fmt.Sprintf("%s\n%s\n%s\n%s", - algorithm, - requestTimestamp, - credentialScope, - hashedCanonicalRequest) - //log.Println("string2sign", string2sign) - - // sign string - secretDate := hmacsha256(date, "TC3"+c.credential.GetSecretKey()) - secretService := hmacsha256(request.GetService(), secretDate) - secretKey := hmacsha256("tc3_request", secretService) - signature := hex.EncodeToString([]byte(hmacsha256(string2sign, secretKey))) - //log.Println("signature", signature) - - // build authorization - authorization := fmt.Sprintf("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s", - algorithm, - c.credential.GetSecretId(), - credentialScope, - signedHeaders, - signature) - //log.Println("authorization", authorization) - - headers["Authorization"] = authorization - url := request.GetScheme() + "://" + request.GetDomain() + request.GetPath() - if canonicalQueryString != "" { - url = url + "?" + canonicalQueryString - } - httpRequest, err := http.NewRequestWithContext(request.GetContext(), httpRequestMethod, url, strings.NewReader(requestPayload)) - if err != nil { - return err - } - for k, v := range headers { - httpRequest.Header[k] = []string{v} - } - httpResponse, err := c.sendWithRateLimitRetry(httpRequest, isRetryable(request)) - if err != nil { - return err - } - err = tchttp.ParseFromHttpResponse(httpResponse, response) - return err -} - -// send http request -func (c *Client) sendHttp(request *http.Request) (response *http.Response, err error) { - if c.debug && request != nil { - outBytes, err := httputil.DumpRequest(request, true) - if err != nil { - c.logger.Printf("[ERROR] dump request failed: %s", err) - } else { - c.logger.Printf("[DEBUG] http request: %s", outBytes) - } - } - - response, err = c.httpClient.Do(request) - - if c.debug && response != nil { - out, err := httputil.DumpResponse(response, true) - if err != nil { - c.logger.Printf("[ERROR] dump response failed: %s", err) - } else { - c.logger.Printf("[DEBUG] http response: %s", out) - } - } - - return response, err -} - -func (c *Client) GetRegion() string { - return c.region -} - -func (c *Client) Init(region string) *Client { - - if DefaultHttpClient == nil { - // try not to modify http.DefaultTransport if possible - // since we could possibly modify Transport.Proxy - transport := http.DefaultTransport - if ht, ok := transport.(*http.Transport); ok { - transport = ht.Clone() - } - - c.httpClient = &http.Client{Transport: transport} - } else { - c.httpClient = DefaultHttpClient - } - - c.region = region - c.signMethod = "TC3-HMAC-SHA256" - c.debug = false - c.logger = log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile) - return c -} - -func (c *Client) WithSecretId(secretId, secretKey string) *Client { - c.credential = NewCredential(secretId, secretKey) - return c -} - -func (c *Client) WithCredential(cred CredentialIface) *Client { - c.credential = cred - return c -} - -func (c *Client) WithRequestClient(rc string) *Client { - const reRequestClient = "^[0-9a-zA-Z-_ ,;.]+$" - - if len(rc) > 128 { - c.logger.Printf("the length of RequestClient should be within 128 characters, it will be truncated") - rc = rc[:128] - } - - match, err := regexp.MatchString(reRequestClient, rc) - if err != nil { - c.logger.Printf("regexp is wrong: %s", reRequestClient) - return c - } - if !match { - c.logger.Printf("RequestClient not match the regexp: %s, ignored", reRequestClient) - return c - } - - c.requestClient = rc - return c -} - -func (c *Client) GetCredential() CredentialIface { - return c.credential -} - -func (c *Client) WithProfile(clientProfile *profile.ClientProfile) *Client { - c.profile = clientProfile - if c.profile.DisableRegionBreaker == false { - c.withRegionBreaker() - } - c.signMethod = clientProfile.SignMethod - c.unsignedPayload = clientProfile.UnsignedPayload - c.httpProfile = clientProfile.HttpProfile - c.debug = clientProfile.Debug - c.httpClient.Timeout = time.Duration(c.httpProfile.ReqTimeout) * time.Second - if c.httpProfile.Proxy != "" { - u, err := url.Parse(c.httpProfile.Proxy) - if err != nil { - panic(err) - } - - if c.httpClient.Transport == nil { - c.logger.Printf("trying to set proxy when httpClient.Transport is nil") - } - - if _, ok := c.httpClient.Transport.(*http.Transport); ok { - c.httpClient.Transport.(*http.Transport).Proxy = http.ProxyURL(u) - } else { - c.logger.Printf("setting proxy while httpClient.Transport is not a http.Transport is not supported") - } - } - return c -} - -func (c *Client) WithSignatureMethod(method string) *Client { - c.signMethod = method - return c -} - -func (c *Client) WithHttpTransport(transport http.RoundTripper) *Client { - c.httpClient.Transport = transport - return c -} - -func (c *Client) WithDebug(flag bool) *Client { - c.debug = flag - return c -} - -// WithProvider use specify provider to get a credential and use it to build a client -func (c *Client) WithProvider(provider Provider) (*Client, error) { - cred, err := provider.GetCredential() - if err != nil { - return nil, err - } - return c.WithCredential(cred), nil -} - -func (c *Client) withRegionBreaker() *Client { - rb := defaultRegionBreaker() - if c.profile.BackupEndpoint != "" { - rb.backupEndpoint = c.profile.BackupEndpoint - } else if c.profile.BackupEndPoint != "" { - rb.backupEndpoint = c.profile.BackupEndPoint - } - c.rb = rb - return c -} - -func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { - client = &Client{} - client.Init(region).WithSecretId(secretId, secretKey) - return -} - -// NewClientWithProviders build client with your custom providers; -// If you don't specify the providers, it will use the DefaultProviderChain to find credential -func NewClientWithProviders(region string, providers ...Provider) (client *Client, err error) { - client = (&Client{}).Init(region) - var pc Provider - if len(providers) == 0 { - pc = DefaultProviderChain() - } else { - pc = NewProviderChain(providers) - } - return client.WithProvider(pc) -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/client_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/client_test.go deleted file mode 100644 index 532d7a4f9a8d..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/client_test.go +++ /dev/null @@ -1,224 +0,0 @@ -/* -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 common - -import ( - "bytes" - "io/ioutil" - "net/http" - "testing" - - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/regions" -) - -type requestWithClientToken struct { - tchttp.CommonRequest - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` -} - -func newTestRequest() *requestWithClientToken { - var testRequest = &requestWithClientToken{ - CommonRequest: *tchttp.NewCommonRequest("cvm", "2017-03-12", "RunInstances"), - ClientToken: nil, - } - return testRequest -} - -type retryErr struct{} - -func (r retryErr) Error() string { return "retry error" } -func (r retryErr) Timeout() bool { return true } -func (r retryErr) Temporary() bool { return true } - -var ( - successResp = `{"Response": {"RequestId": ""}}` - rateLimitResp = `{"Response": {"RequestId": "", "Error": {"Code": "RequestLimitExceeded"}}}` -) - -type mockRT struct { - NetworkFailures int - RateLimitFailures int - - NetworkTries int - RateLimitTries int -} - -func (s *mockRT) RoundTrip(request *http.Request) (*http.Response, error) { - if s.NetworkTries < s.NetworkFailures { - s.NetworkTries++ - return nil, retryErr{} - } - - if s.RateLimitTries < s.RateLimitFailures { - s.RateLimitTries++ - return &http.Response{StatusCode: 200, Body: ioutil.NopCloser(bytes.NewBufferString(rateLimitResp))}, nil - } - - return &http.Response{StatusCode: 200, Body: ioutil.NopCloser(bytes.NewBufferString(successResp))}, nil -} - -type testCase struct { - msg string - prof *profile.ClientProfile - request tchttp.Request - response tchttp.Response - specific mockRT - expected mockRT - success bool -} - -func TestNormalSucceedRequest(t *testing.T) { - test(t, testCase{ - prof: profile.NewClientProfile(), - request: newTestRequest(), - response: tchttp.NewCommonResponse(), - specific: mockRT{}, - expected: mockRT{}, - success: true, - }) -} - -func TestNetworkFailedButSucceedAfterRetry(t *testing.T) { - prof := profile.NewClientProfile() - prof.NetworkFailureMaxRetries = 1 - prof.NetworkFailureRetryDuration = profile.ConstantDurationFunc(0) - - test(t, testCase{ - prof: prof, - request: newTestRequest(), - response: tchttp.NewCommonResponse(), - specific: mockRT{NetworkFailures: 1}, - expected: mockRT{NetworkTries: 1}, - success: true, - }) -} - -func TestNetworkFailedAndShouldNotRetry(t *testing.T) { - prof := profile.NewClientProfile() - prof.NetworkFailureMaxRetries = 1 - prof.NetworkFailureRetryDuration = profile.ConstantDurationFunc(0) - - test(t, testCase{ - prof: prof, - request: tchttp.NewCommonRequest("cvm", "2017-03-12", "DescribeInstances"), - response: tchttp.NewCommonResponse(), - specific: mockRT{NetworkFailures: 2}, - expected: mockRT{NetworkTries: 1}, - success: false, - }) -} - -func TestNetworkFailedAfterRetry(t *testing.T) { - prof := profile.NewClientProfile() - prof.NetworkFailureMaxRetries = 1 - prof.NetworkFailureRetryDuration = profile.ConstantDurationFunc(0) - - test(t, testCase{ - prof: prof, - request: newTestRequest(), - response: tchttp.NewCommonResponse(), - specific: mockRT{NetworkFailures: 2}, - expected: mockRT{NetworkTries: 2}, - success: false, - }) -} - -func TestRateLimitButSucceedAfterRetry(t *testing.T) { - prof := profile.NewClientProfile() - prof.RateLimitExceededMaxRetries = 1 - prof.RateLimitExceededRetryDuration = profile.ConstantDurationFunc(0) - - test(t, testCase{ - prof: prof, - request: newTestRequest(), - response: tchttp.NewCommonResponse(), - specific: mockRT{RateLimitFailures: 1}, - expected: mockRT{RateLimitTries: 1}, - success: true, - }) -} - -func TestRateLimitExceededAfterRetry(t *testing.T) { - prof := profile.NewClientProfile() - prof.RateLimitExceededMaxRetries = 1 - prof.RateLimitExceededRetryDuration = profile.ConstantDurationFunc(0) - - test(t, testCase{ - prof: prof, - request: newTestRequest(), - response: tchttp.NewCommonResponse(), - specific: mockRT{RateLimitFailures: 3}, - expected: mockRT{RateLimitTries: 2}, - success: false, - }) -} - -func TestBothFailuresOccurredButSucceedAfterRetry(t *testing.T) { - prof := profile.NewClientProfile() - prof.NetworkFailureMaxRetries = 1 - prof.NetworkFailureRetryDuration = profile.ConstantDurationFunc(0) - prof.RateLimitExceededMaxRetries = 1 - prof.RateLimitExceededRetryDuration = profile.ConstantDurationFunc(0) - - test(t, testCase{ - prof: prof, - request: newTestRequest(), - response: tchttp.NewCommonResponse(), - specific: mockRT{RateLimitFailures: 1, NetworkFailures: 1}, - expected: mockRT{RateLimitTries: 1, NetworkTries: 1}, - success: true, - }) -} - -func test(t *testing.T, tc testCase) { - credential := NewCredential("", "") - client := NewCommonClient(credential, regions.Guangzhou, tc.prof) - - client.WithHttpTransport(&tc.specific) - - err := client.Send(tc.request, tc.response) - if tc.success != (err == nil) { - t.Fatalf("unexpected failed on request: %+v", err) - } - - if tc.expected.RateLimitTries != tc.specific.RateLimitTries { - t.Fatalf("unexpected rate limit retry, expected %d, got %d", - tc.expected.RateLimitTries, tc.specific.RateLimitTries) - } - - if tc.expected.NetworkTries != tc.specific.NetworkTries { - t.Fatalf("unexpected network failure retry, expected %d, got %d", - tc.expected.NetworkTries, tc.specific.NetworkTries) - } -} - -func TestClient_withRegionBreaker(t *testing.T) { - cpf := profile.NewClientProfile() - //cpf.Debug =true - cpf.DisableRegionBreaker = false - cpf.BackupEndpoint = "" - c := (&Client{}).Init("") - c.WithProfile(cpf) - if c.rb.backupEndpoint != "ap-guangzhou.tencentcloudapi.com" { - t.Errorf("want %s ,got %s", "ap-beijing", c.rb.backupEndpoint) - } - if c.rb.maxFailNum != defaultMaxFailNum { - t.Errorf("want %d ,got %d", defaultMaxFailNum, c.rb.maxFailNum) - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/clienttoken.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/clienttoken.go deleted file mode 100644 index e1839634903b..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/clienttoken.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -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 common - -import ( - "crypto/rand" - "fmt" - "reflect" -) - -const ( - fieldClientToken = "ClientToken" -) - -func safeInjectClientToken(obj interface{}) { - // obj Must be struct ptr - getType := reflect.TypeOf(obj) - if getType.Kind() != reflect.Ptr || getType.Elem().Kind() != reflect.Struct { - return - } - - // obj Must exist named field - _, ok := getType.Elem().FieldByName(fieldClientToken) - if !ok { - return - } - - field := reflect.ValueOf(obj).Elem().FieldByName(fieldClientToken) - - // field Must be string ptr - if field.Kind() != reflect.Ptr { - return - } - - // Set if ClientToken is nil or empty - if field.IsNil() || (field.Elem().Kind() == reflect.String && field.Elem().Len() == 0) { - uuidVal := randomClientToken() - field.Set(reflect.ValueOf(&uuidVal)) - } -} - -// randomClientToken generate random string as ClientToken -// ref: https://stackoverflow.com/questions/15130321/is-there-a-method-to-generate-a-uuid-with-go-language -func randomClientToken() string { - b := make([]byte, 16) - _, _ = rand.Read(b) - return fmt.Sprintf("%X-%X-%X-%X-%X", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/clienttoken_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/clienttoken_test.go deleted file mode 100644 index f0423efcc1e1..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/clienttoken_test.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -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 common - -import ( - "testing" -) - -type injectable struct { - ClientToken *string -} - -type uninjectable struct { -} - -func TestSafeInjectClientToken(t *testing.T) { - defer func() { - if e := recover(); e != nil { - t.Fatalf("panic on injecting client token: %+v", e) - } - }() - - injectableVal := new(injectable) - safeInjectClientToken(injectableVal) - if injectableVal.ClientToken == nil || len(*injectableVal.ClientToken) == 0 { - t.Fatalf("no client token injected: %+v", injectableVal) - } - - uninjectableVal := new(uninjectable) - safeInjectClientToken(uninjectableVal) -} - -var ( - exists = make(map[string]struct{}) -) - -func BenchmarkGenerateClientToken(b *testing.B) { - for i := 0; i < b.N; i++ { - token := randomClientToken() - if _, conflict := exists[token]; conflict { - b.Fatalf("conflict with generated token: %s, %d", token, i) - } - exists[token] = struct{}{} - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/common_client.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/common_client.go deleted file mode 100644 index 0e0c1681dffa..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/common_client.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -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 common - -import ( - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile" -) - -func NewCommonClient(cred CredentialIface, region string, clientProfile *profile.ClientProfile) (c *Client) { - return new(Client).Init(region).WithCredential(cred).WithProfile(clientProfile) -} - -// SendOctetStream Invoke API with application/octet-stream content-type. -// -// Note: -// 1. only specific API can be invoked in such manner. -// 2. only TC3-HMAC-SHA256 signature method can be specified. -// 3. only POST request method can be specified -// 4. the request Must be a CommonRequest and called SetOctetStreamParameters -func (c *Client) SendOctetStream(request tchttp.Request, response tchttp.Response) (err error) { - if c.profile.SignMethod != "TC3-HMAC-SHA256" { - return tcerr.NewTencentCloudSDKError("ClientError", "Invalid signature method.", "") - } - if c.profile.HttpProfile.ReqMethod != "POST" { - return tcerr.NewTencentCloudSDKError("ClientError", "Invalid request method.", "") - } - //cr, ok := request.(*tchttp.CommonRequest) - //if !ok { - // return tcerr.NewTencentCloudSDKError("ClientError", "Invalid request, must be *CommonRequest!", "") - //} - //if !cr.IsOctetStream() { - // return tcerr.NewTencentCloudSDKError("ClientError", "Invalid request, does not meet the conditions for sending OctetStream", "") - //} - return c.Send(request, response) -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/credentials.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/credentials.go deleted file mode 100644 index 4badafb284ca..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/credentials.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -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 common - -var creErr = "ClientError.CredentialError" - -type CredentialIface interface { - GetSecretId() string - GetToken() string - GetSecretKey() string - // needRefresh() bool - // refresh() -} - -type Credential struct { - SecretId string - SecretKey string - Token string -} - -func (c *Credential) needRefresh() bool { - return false -} - -func (c *Credential) refresh() { -} - -func NewCredential(secretId, secretKey string) *Credential { - return &Credential{ - SecretId: secretId, - SecretKey: secretKey, - } -} - -func NewTokenCredential(secretId, secretKey, token string) *Credential { - return &Credential{ - SecretId: secretId, - SecretKey: secretKey, - Token: token, - } -} - -func (c *Credential) GetSecretKey() string { - return c.SecretKey -} - -func (c *Credential) GetSecretId() string { - return c.SecretId -} - -func (c *Credential) GetToken() string { - return c.Token -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/cvm_role_credential.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/cvm_role_credential.go deleted file mode 100644 index 89603ab1e964..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/cvm_role_credential.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -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 common - -import ( - "log" - "time" -) - -const ExpiredTimeout = 300 - -type CvmRoleCredential struct { - roleName string - expiredTime int64 - tmpSecretId string - tmpSecretKey string - token string - source *CvmRoleProvider -} - -func (c *CvmRoleCredential) GetSecretId() string { - if c.needRefresh() { - c.refresh() - } - return c.tmpSecretId -} - -func (c *CvmRoleCredential) GetToken() string { - if c.needRefresh() { - c.refresh() - } - return c.token -} - -func (c *CvmRoleCredential) GetSecretKey() string { - if c.needRefresh() { - c.refresh() - } - return c.tmpSecretKey -} - -func (c *CvmRoleCredential) needRefresh() bool { - if c.tmpSecretId == "" || c.tmpSecretKey == "" || c.token == "" || c.expiredTime-ExpiredTimeout <= time.Now().Unix() { - return true - } - return false -} - -func (c *CvmRoleCredential) refresh() { - newCre, err := c.source.GetCredential() - if err != nil { - log.Println(err) - return - } - *c = *newCre.(*CvmRoleCredential) -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/cvm_role_provider.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/cvm_role_provider.go deleted file mode 100644 index 77c712762c1b..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/cvm_role_provider.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -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 common - -import ( - "encoding/json" - "errors" - "io/ioutil" - "net/http" - "time" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -const ( - metaUrl = "http://metadata.tencentyun.com/latest/meta-data/" - roleUrl = metaUrl + "cam/security-credentials/" -) - -var roleNotBound = errors.New("get cvm role name failed, Please confirm whether the role is bound") - -type CvmRoleProvider struct { - roleName string -} - -type roleRsp struct { - TmpSecretId string `json:"TmpSecretId"` - TmpSecretKey string `json:"TmpSecretKey"` - ExpiredTime int64 `json:"ExpiredTime"` - Expiration time.Time `json:"Expiration"` - Token string `json:"Token"` - Code string `json:"Code"` -} - -// NewCvmRoleProvider need you to specify the roleName of the cvm currently in use -func NewCvmRoleProvider(roleName string) *CvmRoleProvider { - return &CvmRoleProvider{roleName: roleName} -} - -// DefaultCvmRoleProvider will auto get the cvm role name by accessing the metadata api -// more info please lookup: https://cloud.tencent.com/document/product/213/4934 -func DefaultCvmRoleProvider() *CvmRoleProvider { - return NewCvmRoleProvider("") -} - -func get(url string) ([]byte, error) { - rsp, err := http.Get(url) - if err != nil { - return nil, err - } - - if rsp.StatusCode == http.StatusNotFound { - return nil, roleNotBound - } - - body, err := ioutil.ReadAll(rsp.Body) - if err != nil { - return []byte{}, err - } - return body, nil -} - -func (r *CvmRoleProvider) getRoleName() (string, error) { - if r.roleName != "" { - return r.roleName, nil - } - rn, err := get(roleUrl) - return string(rn), err -} - -func (r *CvmRoleProvider) GetCredential() (CredentialIface, error) { - roleName, err := r.getRoleName() - if err != nil { - return nil, noCvmRole - } - // get the cvm role name by accessing the metadata api - // https://cloud.tencent.com/document/product/213/4934 - body, err := get(roleUrl + roleName) - - if err != nil { - return nil, err - } - rspSt := new(roleRsp) - if err = json.Unmarshal(body, rspSt); err != nil { - return nil, tcerr.NewTencentCloudSDKError(creErr, err.Error(), "") - } - if rspSt.Code != "Success" { - return nil, tcerr.NewTencentCloudSDKError(creErr, "Get credential from metadata server by role name "+roleName+" failed, code="+rspSt.Code, "") - } - cre := &CvmRoleCredential{ - tmpSecretId: rspSt.TmpSecretId, - tmpSecretKey: rspSt.TmpSecretKey, - token: rspSt.Token, - roleName: roleName, - expiredTime: rspSt.ExpiredTime, - source: r, - } - return cre, nil -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/env_provider.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/env_provider.go deleted file mode 100644 index d156d206f4f1..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/env_provider.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -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 common - -import ( - "os" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -type EnvProvider struct { - secretIdENV string - secretKeyENV string -} - -// DefaultEnvProvider return a default provider -// The default environment variable name are TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY -func DefaultEnvProvider() *EnvProvider { - return &EnvProvider{ - secretIdENV: "TENCENTCLOUD_SECRET_ID", - secretKeyENV: "TENCENTCLOUD_SECRET_KEY", - } -} - -// NewEnvProvider uses the name of the environment variable you specified to get the credentials -func NewEnvProvider(secretIdEnvName, secretKeyEnvName string) *EnvProvider { - return &EnvProvider{ - secretIdENV: secretIdEnvName, - secretKeyENV: secretKeyEnvName, - } -} - -func (p *EnvProvider) GetCredential() (CredentialIface, error) { - secretId, ok1 := os.LookupEnv(p.secretIdENV) - secretKey, ok2 := os.LookupEnv(p.secretKeyENV) - if !ok1 || !ok2 { - return nil, envNotSet - } - if secretId == "" || secretKey == "" { - return nil, tcerr.NewTencentCloudSDKError(creErr, "Environmental variable ("+p.secretIdENV+" or "+p.secretKeyENV+") is empty", "") - } - return NewCredential(secretId, secretKey), nil -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/env_provider_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/env_provider_test.go deleted file mode 100644 index 4c4b3bf03485..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/env_provider_test.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -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 common - -import ( - "os" - "reflect" - "testing" -) - -func TestEnvProvider_GetCredential(t *testing.T) { - type fields struct { - secretIdENV string - secretKeyENV string - } - tests := []struct { - name string - fields fields - want CredentialIface - wantErr bool - }{ - {"valid env", fields{ - secretIdENV: "TENCENTCLOUD_SECRET_ID_test", - secretKeyENV: "TENCENTCLOUD_SECRET_KEY_test", - }, - &Credential{ - SecretId: "xxxxxx", - SecretKey: "xxxxxx", - Token: "", - }, - false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - os.Setenv(tt.fields.secretIdENV, tt.want.GetSecretId()) - os.Setenv(tt.fields.secretKeyENV, tt.want.GetSecretKey()) - p := &EnvProvider{ - secretIdENV: tt.fields.secretIdENV, - secretKeyENV: tt.fields.secretKeyENV, - } - got, err := p.GetCredential() - if (err != nil) != tt.wantErr { - t.Errorf("GetCredential() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetCredential() got = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors/errors.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors/errors.go deleted file mode 100644 index 55ad9afca4f8..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors/errors.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -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 errors - -import ( - "fmt" -) - -type TencentCloudSDKError struct { - Code string - Message string - RequestId string -} - -func (e *TencentCloudSDKError) Error() string { - if e.RequestId == "" { - return fmt.Sprintf("[TencentCloudSDKError] Code=%s, Message=%s", e.Code, e.Message) - } - return fmt.Sprintf("[TencentCloudSDKError] Code=%s, Message=%s, RequestId=%s", e.Code, e.Message, e.RequestId) -} - -func NewTencentCloudSDKError(code, message, requestId string) error { - return &TencentCloudSDKError{ - Code: code, - Message: message, - RequestId: requestId, - } -} - -func (e *TencentCloudSDKError) GetCode() string { - return e.Code -} - -func (e *TencentCloudSDKError) GetMessage() string { - return e.Message -} - -func (e *TencentCloudSDKError) GetRequestId() string { - return e.RequestId -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_request.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_request.go deleted file mode 100644 index 8f25f56722d3..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_request.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -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 common - -import ( - "encoding/json" - "fmt" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -const ( - octetStream = "application/octet-stream" -) - -type actionParameters map[string]interface{} - -type CommonRequest struct { - *BaseRequest - actionParameters -} - -func NewCommonRequest(service, version, action string) (request *CommonRequest) { - request = &CommonRequest{ - BaseRequest: &BaseRequest{}, - actionParameters: actionParameters{}, - } - request.Init().WithApiInfo(service, version, action) - return -} - -// SetActionParameters set common request's actionParameters to your data. -// note: your data Must be a json-formatted string or byte array or map[string]interface{} -// note: you could not call SetActionParameters and SetOctetStreamParameters at once -func (cr *CommonRequest) SetActionParameters(data interface{}) error { - if data == nil { - return nil - } - switch data.(type) { - case []byte: - if err := json.Unmarshal(data.([]byte), &cr.actionParameters); err != nil { - msg := fmt.Sprintf("Fail to parse contents %s to json,because: %s", data.([]byte), err) - return tcerr.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") - } - case string: - if err := json.Unmarshal([]byte(data.(string)), &cr.actionParameters); err != nil { - msg := fmt.Sprintf("Fail to parse contents %s to json,because: %s", data.(string), err) - return tcerr.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") - } - case map[string]interface{}: - cr.actionParameters = data.(map[string]interface{}) - default: - msg := fmt.Sprintf("Invalid data type:%T, must be one of the following: []byte, string, map[string]interface{}", data) - return tcerr.NewTencentCloudSDKError("ClientError.InvalidParameter", msg, "") - } - return nil -} - -func (cr *CommonRequest) IsOctetStream() bool { - v, ok := cr.GetHeader()["Content-Type"] - if !ok || v != octetStream { - return false - } - value, ok := cr.actionParameters["OctetStreamBody"] - if !ok { - return false - } - _, ok = value.([]byte) - if !ok { - return false - } - return true -} - -func (cr *CommonRequest) SetHeader(header map[string]string) { - if header == nil { - return - } - if cr.BaseRequest == nil { - cr.BaseRequest = &BaseRequest{} - } - cr.BaseRequest.SetHeader(header) -} - -func (cr *CommonRequest) GetHeader() map[string]string { - if cr.BaseRequest == nil { - return nil - } - return cr.BaseRequest.GetHeader() -} - -// SetOctetStreamParameters set request body to your data, and set head Content-Type to application/octet-stream -// note: you could not call SetActionParameters and SetOctetStreamParameters on the same request -func (cr *CommonRequest) SetOctetStreamParameters(header map[string]string, body []byte) { - parameter := map[string]interface{}{} - if header == nil { - header = map[string]string{} - } - header["Content-Type"] = octetStream - cr.SetHeader(header) - parameter["OctetStreamBody"] = body - cr.actionParameters = parameter -} - -func (cr *CommonRequest) GetOctetStreamBody() []byte { - if cr.IsOctetStream() { - return cr.actionParameters["OctetStreamBody"].([]byte) - } else { - return nil - } -} - -func (cr *CommonRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(cr.actionParameters) -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_request_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_request_test.go deleted file mode 100644 index b7bbb5f35a81..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_request_test.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -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 common - -import ( - "encoding/json" - "testing" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -func TestCommonRequest_SetActionParameters(t *testing.T) { - defer func() { - if e := recover(); e != nil { - t.Fatalf("panic on SetActionParameters: %+v", e) - } - }() - testCase := []struct { - data interface{} - errCode string - }{ - {[]byte("{\"a\":\"1\"}"), ""}, - {"{\"a\":\"1\"}", ""}, - {map[string]interface{}{"a": "1"}, ""}, - {[]byte("{\"a\":\"1\""), "ClientError.ParseJsonError"}, - {123, "ClientError.InvalidParameter"}, - } - cr := &CommonRequest{} - for _, tc := range testCase { - err := cr.SetActionParameters(tc.data) - if err != nil { - if te, ok := err.(*tcerr.TencentCloudSDKError); ok { - if te.GetCode() != tc.errCode { - t.Fatalf("SetActionParameters failed: expected %+v, got %+v", tc.errCode, te.GetCode()) - } - } else { - t.Fatalf("SetActionParameters failed: expected %+v, got %T", "TencentCloudSDKError", err) - } - } else { - if tc.errCode != "" { - t.Fatalf("SetActionParameters failed: expected %+v, got %+v", tc.errCode, "") - } - } - } -} - -func TestCommonRequest_JSONMarshal(t *testing.T) { - crn := NewCommonRequest("cvm", "2017-03-12", "DescribeInstances") - _ = crn.SetActionParameters(map[string]interface{}{ - "a": 1, - "b": map[string]interface{}{ - "b1": 2, - "b2": "b2", - }, - }) - - bytes, err := json.MarshalIndent(crn, "", "\t") - if err != nil || len(bytes) == 0 { - t.Fatal(err) - } -} - -func TestCommonRequest_IsOctetStream(t *testing.T) { - defer func() { - if e := recover(); e != nil { - t.Fatalf("panic on IsOctetStream: %+v", e) - } - }() - cr1 := &CommonRequest{ - BaseRequest: &BaseRequest{ - header: map[string]string{ - "Content-Type": "text/plain", - }, - }} - cr2 := &CommonRequest{ - BaseRequest: &BaseRequest{ - header: map[string]string{ - "Content-Type": octetStream, - }, - }, - actionParameters: map[string]interface{}{ - "octetstreambody": []byte{}, - }, - } - cr3 := &CommonRequest{ - BaseRequest: &BaseRequest{ - header: map[string]string{ - "Content-Type": octetStream, - }, - }, - actionParameters: map[string]interface{}{ - "OctetStreamBody": []string{}, - }, - } - cr4 := &CommonRequest{ - BaseRequest: &BaseRequest{ - header: map[string]string{ - "Content-Type": octetStream, - }, - }, - actionParameters: map[string]interface{}{ - "OctetStreamBody": []byte{}, - }, - } - - testCase := map[*CommonRequest]bool{ - cr1: false, - cr2: false, - cr3: false, - cr4: true, - } - for cr, expected := range testCase { - if val := cr.IsOctetStream(); val != expected { - t.Fatalf("IsOctetStream failed: expected %+v, got %+v", expected, val) - } - } -} - -func TestCommonRequest_SetOctetStreamParameters(t *testing.T) { - defer func() { - if e := recover(); e != nil { - t.Fatalf("panic on SetOctetStreamParameters: %+v", e) - } - }() - type param struct { - header map[string]string - body []byte - } - p1 := ¶m{ - header: map[string]string{ - "Content-Type": "text/plain", - }, - body: []byte{}, - } - p2 := ¶m{ - header: map[string]string{ - "Content-Type": octetStream, - }, - body: []byte{}, - } - testCase := map[*param]bool{ - p1: true, - p2: true, - } - cr := &CommonRequest{} - for p, wanted := range testCase { - cr.SetOctetStreamParameters(p.header, p.body) - if val := cr.IsOctetStream(); val != wanted { - t.Fatalf("SetOctetStreamParameters failed: expected %+v, got %+v", wanted, val) - } - } -} - -func TestCommonRequest_Header(t *testing.T) { - r := &CommonRequest{} - - const ( - traceKey = "X-TC-TraceId" - traceVal = "ffe0c072-8a5d-4e17-8887-a8a60252abca" - ) - - if r.GetHeader() != nil { - t.Fatal("default header MUST be nil") - } - - r.SetHeader(nil) - if r.GetHeader() != nil { - t.Fatal("SetHeader(nil) MUST not replace nil map with empty map") - } - - r.SetHeader(map[string]string{traceKey: traceVal}) - if r.GetHeader()[traceKey] != traceVal { - t.Fatal("SetHeader failed") - } - - r.SetHeader(nil) - if r.GetHeader() == nil { - t.Fatal("SetHeader(nil) MUST not overwrite existing header (for backward compatibility)") - } - - if r.GetHeader()[traceKey] != traceVal { - t.Fatal("SetHeader(nil) MUST not overwrite existing header (for backward compatibility)") - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_response.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_response.go deleted file mode 100644 index 9dfeb23cdb41..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/common_response.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -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 common - -import "encoding/json" - -type actionResult map[string]interface{} -type CommonResponse struct { - *BaseResponse - *actionResult -} - -func NewCommonResponse() (response *CommonResponse) { - response = &CommonResponse{ - BaseResponse: &BaseResponse{}, - actionResult: &actionResult{}, - } - return -} - -func (r *CommonResponse) UnmarshalJSON(data []byte) error { - return json.Unmarshal(data, r.actionResult) -} - -func (r *CommonResponse) GetBody() []byte { - raw, _ := json.Marshal(r.actionResult) - return raw -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/request.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/request.go deleted file mode 100644 index a61b9b449cc2..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/request.go +++ /dev/null @@ -1,365 +0,0 @@ -/* -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 common - -import ( - "context" - "io" - //"log" - "math/rand" - "net/url" - "reflect" - "strconv" - "strings" - "time" -) - -const ( - POST = "POST" - GET = "GET" - - HTTP = "http" - HTTPS = "https" - - RootDomain = "tencentcloudapi.com" - Path = "/" -) - -type Request interface { - GetAction() string - GetBodyReader() io.Reader - GetScheme() string - GetRootDomain() string - GetServiceDomain(string) string - GetDomain() string - GetHttpMethod() string - GetParams() map[string]string - GetBody() []byte - GetPath() string - GetService() string - GetUrl() string - GetVersion() string - GetContentType() string - GetContext() context.Context - GetHeader() map[string]string - GetSkipSign() bool - SetScheme(string) - SetRootDomain(string) - SetDomain(string) - SetHttpMethod(string) - SetPath(string) - SetContentType(string) - SetBody([]byte) - SetContext(context.Context) - SetHeader(header map[string]string) - SetSkipSign(skip bool) -} - -type BaseRequest struct { - context context.Context - httpMethod string - scheme string - rootDomain string - domain string - path string - skipSign bool - params map[string]string - formParams map[string]string - header map[string]string - - service string - version string - action string - - contentType string - body []byte -} - -func (r *BaseRequest) GetAction() string { - return r.action -} - -func (r *BaseRequest) GetHttpMethod() string { - return r.httpMethod -} - -func (r *BaseRequest) GetParams() map[string]string { - return r.params -} - -func (r *BaseRequest) GetPath() string { - return r.path -} - -func (r *BaseRequest) GetDomain() string { - return r.domain -} - -func (r *BaseRequest) GetScheme() string { - return r.scheme -} - -func (r *BaseRequest) GetRootDomain() string { - return r.rootDomain -} - -func (r *BaseRequest) GetServiceDomain(service string) (domain string) { - rootDomain := r.rootDomain - if rootDomain == "" { - rootDomain = RootDomain - } - domain = service + "." + rootDomain - return -} - -func (r *BaseRequest) GetBody() []byte { - return r.body -} - -func (r *BaseRequest) SetBody(body []byte) { - r.body = body -} - -func (r *BaseRequest) GetContentType() string { - return r.contentType -} - -func (r *BaseRequest) SetContentType(contentType string) { - r.contentType = contentType -} - -func (r *BaseRequest) SetDomain(domain string) { - r.domain = domain -} - -func (r *BaseRequest) SetScheme(scheme string) { - scheme = strings.ToLower(scheme) - switch scheme { - case HTTP: - r.scheme = HTTP - default: - r.scheme = HTTPS - } -} - -func (r *BaseRequest) SetRootDomain(rootDomain string) { - r.rootDomain = rootDomain -} - -func (r *BaseRequest) SetHttpMethod(method string) { - switch strings.ToUpper(method) { - case POST: - { - r.httpMethod = POST - } - case GET: - { - r.httpMethod = GET - } - default: - { - r.httpMethod = GET - } - } -} - -func (r *BaseRequest) SetPath(path string) { - r.path = path -} - -func (r *BaseRequest) GetService() string { - return r.service -} - -func (r *BaseRequest) GetUrl() string { - if r.httpMethod == GET { - return r.GetScheme() + "://" + r.domain + r.path + "?" + GetUrlQueriesEncoded(r.params) - } else if r.httpMethod == POST { - return r.GetScheme() + "://" + r.domain + r.path - } else { - return "" - } -} - -func (r *BaseRequest) GetVersion() string { - return r.version -} - -func (r *BaseRequest) GetContext() context.Context { - if r.context == nil { - return context.Background() - } - return r.context -} - -func (r *BaseRequest) SetContext(ctx context.Context) { - r.context = ctx -} - -func (r *BaseRequest) GetHeader() map[string]string { - return r.header -} - -func (r *BaseRequest) SetHeader(header map[string]string) { - if header == nil { - return - } - r.header = header -} - -func (r *BaseRequest) GetSkipSign() bool { - return r.skipSign -} - -func (r *BaseRequest) SetSkipSign(skip bool) { - r.skipSign = skip -} - -func GetUrlQueriesEncoded(params map[string]string) string { - values := url.Values{} - for key, value := range params { - values.Add(key, value) - } - return values.Encode() -} - -func (r *BaseRequest) GetBodyReader() io.Reader { - if r.httpMethod == POST { - s := GetUrlQueriesEncoded(r.params) - return strings.NewReader(s) - } else { - return strings.NewReader("") - } -} - -func (r *BaseRequest) Init() *BaseRequest { - r.domain = "" - r.path = Path - r.params = make(map[string]string) - r.formParams = make(map[string]string) - return r -} - -func (r *BaseRequest) WithApiInfo(service, version, action string) *BaseRequest { - r.service = service - r.version = version - r.action = action - return r -} - -func (r *BaseRequest) WithContentType(contentType string) *BaseRequest { - r.contentType = contentType - return r -} - -// Deprecated, use request.GetServiceDomain instead -func GetServiceDomain(service string) (domain string) { - domain = service + "." + RootDomain - return -} - -func CompleteCommonParams(request Request, region string, requestClient string) { - params := request.GetParams() - params["Region"] = region - if request.GetVersion() != "" { - params["Version"] = request.GetVersion() - } - params["Action"] = request.GetAction() - params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) - params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_1.0.721" - if requestClient != "" { - params["RequestClient"] += ": " + requestClient - } -} - -func ConstructParams(req Request) (err error) { - value := reflect.ValueOf(req).Elem() - err = flatStructure(value, req, "") - //log.Printf("[DEBUG] params=%s", req.GetParams()) - return -} - -func flatStructure(value reflect.Value, request Request, prefix string) (err error) { - //log.Printf("[DEBUG] reflect value: %v", value.Type()) - valueType := value.Type() - for i := 0; i < valueType.NumField(); i++ { - tag := valueType.Field(i).Tag - nameTag, hasNameTag := tag.Lookup("name") - if !hasNameTag { - continue - } - field := value.Field(i) - kind := field.Kind() - if kind == reflect.Ptr && field.IsNil() { - continue - } - if kind == reflect.Ptr { - field = field.Elem() - kind = field.Kind() - } - key := prefix + nameTag - if kind == reflect.String { - s := field.String() - if s != "" { - request.GetParams()[key] = s - } - } else if kind == reflect.Bool { - request.GetParams()[key] = strconv.FormatBool(field.Bool()) - } else if kind == reflect.Int || kind == reflect.Int64 { - request.GetParams()[key] = strconv.FormatInt(field.Int(), 10) - } else if kind == reflect.Uint || kind == reflect.Uint64 { - request.GetParams()[key] = strconv.FormatUint(field.Uint(), 10) - } else if kind == reflect.Float64 { - request.GetParams()[key] = strconv.FormatFloat(field.Float(), 'f', -1, 64) - } else if kind == reflect.Slice { - list := value.Field(i) - for j := 0; j < list.Len(); j++ { - vj := list.Index(j) - key := prefix + nameTag + "." + strconv.Itoa(j) - kind = vj.Kind() - if kind == reflect.Ptr && vj.IsNil() { - continue - } - if kind == reflect.Ptr { - vj = vj.Elem() - kind = vj.Kind() - } - if kind == reflect.String { - request.GetParams()[key] = vj.String() - } else if kind == reflect.Bool { - request.GetParams()[key] = strconv.FormatBool(vj.Bool()) - } else if kind == reflect.Int || kind == reflect.Int64 { - request.GetParams()[key] = strconv.FormatInt(vj.Int(), 10) - } else if kind == reflect.Uint || kind == reflect.Uint64 { - request.GetParams()[key] = strconv.FormatUint(vj.Uint(), 10) - } else if kind == reflect.Float64 { - request.GetParams()[key] = strconv.FormatFloat(vj.Float(), 'f', -1, 64) - } else { - if err = flatStructure(vj, request, key+"."); err != nil { - return - } - } - } - } else { - if err = flatStructure(reflect.ValueOf(field.Interface()), request, prefix+nameTag+"."); err != nil { - return - } - } - } - return -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/request_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/request_test.go deleted file mode 100644 index aa847d577e0d..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/request_test.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -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 common - -import "testing" - -func TestBaseRequest_Header(t *testing.T) { - r := &BaseRequest{} - - const ( - traceKey = "X-TC-TraceId" - traceVal = "ffe0c072-8a5d-4e17-8887-a8a60252abca" - ) - - if r.GetHeader() != nil { - t.Fatal("default header MUST be nil") - } - - r.SetHeader(nil) - if r.GetHeader() != nil { - t.Fatal("SetHeader(nil) MUST not replace nil map with empty map") - } - - r.SetHeader(map[string]string{traceKey: traceVal}) - if r.GetHeader()[traceKey] != traceVal { - t.Fatal("SetHeader failed") - } - - r.SetHeader(nil) - if r.GetHeader() == nil { - t.Fatal("SetHeader(nil) MUST not overwrite existing header (for backward compatibility)") - } - - if r.GetHeader()[traceKey] != traceVal { - t.Fatal("SetHeader(nil) MUST not overwrite existing header (for backward compatibility)") - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/response.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/response.go deleted file mode 100644 index 83d56ee295d1..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http/response.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -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 common - -import ( - "encoding/json" - "fmt" - "io/ioutil" - - //"log" - "net/http" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -type Response interface { - ParseErrorFromHTTPResponse(body []byte) error -} - -type BaseResponse struct { -} - -type ErrorResponse struct { - Response struct { - Error struct { - Code string `json:"Code"` - Message string `json:"Message"` - } `json:"Error,omitempty"` - RequestId string `json:"RequestId"` - } `json:"Response"` -} - -type DeprecatedAPIErrorResponse struct { - Code int `json:"code"` - Message string `json:"message"` - CodeDesc string `json:"codeDesc"` -} - -func (r *BaseResponse) ParseErrorFromHTTPResponse(body []byte) (err error) { - resp := &ErrorResponse{} - err = json.Unmarshal(body, resp) - if err != nil { - msg := fmt.Sprintf("Fail to parse json content: %s, because: %s", body, err) - return errors.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") - } - if resp.Response.Error.Code != "" { - return errors.NewTencentCloudSDKError(resp.Response.Error.Code, resp.Response.Error.Message, resp.Response.RequestId) - } - - deprecated := &DeprecatedAPIErrorResponse{} - err = json.Unmarshal(body, deprecated) - if err != nil { - msg := fmt.Sprintf("Fail to parse json content: %s, because: %s", body, err) - return errors.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") - } - if deprecated.Code != 0 { - return errors.NewTencentCloudSDKError(deprecated.CodeDesc, deprecated.Message, "") - } - return nil -} - -func ParseErrorFromHTTPResponse(body []byte) (err error) { - resp := &ErrorResponse{} - err = json.Unmarshal(body, resp) - if err != nil { - msg := fmt.Sprintf("Fail to parse json content: %s, because: %s", body, err) - return errors.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") - } - if resp.Response.Error.Code != "" { - return errors.NewTencentCloudSDKError(resp.Response.Error.Code, resp.Response.Error.Message, resp.Response.RequestId) - } - - deprecated := &DeprecatedAPIErrorResponse{} - err = json.Unmarshal(body, deprecated) - if err != nil { - msg := fmt.Sprintf("Fail to parse json content: %s, because: %s", body, err) - return errors.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") - } - if deprecated.Code != 0 { - return errors.NewTencentCloudSDKError(deprecated.CodeDesc, deprecated.Message, "") - } - return nil -} - -func ParseFromHttpResponse(hr *http.Response, response Response) (err error) { - defer hr.Body.Close() - body, err := ioutil.ReadAll(hr.Body) - if err != nil { - msg := fmt.Sprintf("Fail to read response body because %s", err) - return errors.NewTencentCloudSDKError("ClientError.IOError", msg, "") - } - if hr.StatusCode != 200 { - msg := fmt.Sprintf("Request fail with http status code: %s, with body: %s", hr.Status, body) - return errors.NewTencentCloudSDKError("ClientError.HttpStatusCodeError", msg, "") - } - //log.Printf("[DEBUG] Response Body=%s", body) - err = response.ParseErrorFromHTTPResponse(body) - if err != nil { - return - } - err = json.Unmarshal(body, &response) - if err != nil { - msg := fmt.Sprintf("Fail to parse json content: %s, because: %s", body, err) - return errors.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") - } - return -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ini.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ini.go deleted file mode 100644 index df04e4d1fb6d..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ini.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -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 common - -import ( - "fmt" - "io/ioutil" - "strings" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -var ( - globalSectionName = "____GLOBAL____" - iniErr = "ClientError.INIError" -) - -func openFile(path string) (data []byte, err error) { - data, err = ioutil.ReadFile(path) - if err != nil { - err = tcerr.NewTencentCloudSDKError(iniErr, err.Error(), "") - } - return -} - -func parse(path string) (*sections, error) { - result := §ions{map[string]*section{}} - buf, err := openFile(path) - if err != nil { - return §ions{}, err - } - content := string(buf) - - lines := strings.Split(content, "\n") - if len(lines) == 0 { - msg := fmt.Sprintf("the result of reading the %s is empty", path) - return §ions{}, tcerr.NewTencentCloudSDKError(iniErr, msg, "") - } - currentSectionName := globalSectionName - currentSection := §ion{make(map[string]*value)} - for i, line := range lines { - line = strings.Replace(line, "\r", "", -1) - line = strings.TrimSpace(line) - if len(line) == 0 { - continue - } - // comments - if strings.HasPrefix(line, "#") || strings.HasPrefix(line, ";") { - continue - } - // section name - if strings.HasPrefix(line, "[") { - if strings.HasSuffix(line, "]") { - tempSection := line[1 : len(line)-1] - if len(tempSection) == 0 { - msg := fmt.Sprintf("INI file %s lien %d is not valid: wrong section", path, i) - return result, tcerr.NewTencentCloudSDKError(iniErr, msg, "") - } - // Save the previous section - result.contains[currentSectionName] = currentSection - // new section - currentSectionName = tempSection - currentSection = §ion{make(map[string]*value, 0)} - continue - } else { - msg := fmt.Sprintf("INI file %s lien %d is not valid: wrong section", path, i) - return result, tcerr.NewTencentCloudSDKError(iniErr, msg, "") - } - } - - pos := strings.Index(line, "=") - if pos > 0 && pos < len(line)-1 { - key := line[:pos] - val := line[pos+1:] - - key = strings.TrimSpace(key) - val = strings.TrimSpace(val) - - v := &value{raw: val} - currentSection.content[key] = v - } - } - - result.contains[currentSectionName] = currentSection - return result, nil -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ini_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ini_test.go deleted file mode 100644 index cd01fde3d797..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ini_test.go +++ /dev/null @@ -1,78 +0,0 @@ -/* -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 common - -import ( - "testing" -) - -func Test_openFile(t *testing.T) { - type args struct { - path string - } - tests := []struct { - name string - args args - wantData []byte - wantErr bool - }{ - { - "invalid path", args{path: "./testdata"}, []byte{}, true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - _, err := openFile(tt.args.path) - if (err != nil) != tt.wantErr { - t.Errorf("openFile() error = %v, wantErr %v", err, tt.wantErr) - return - } - }) - } -} - -func Test_parse(t *testing.T) { - type args struct { - path string - } - tests := []struct { - name string - args args - want *sections - wantErr bool - }{ - {"valid ini", args{path: "./testdata_valid.ini"}, nil, false}, - {"invalid ini", args{"./testdata_invalid.ini"}, nil, true}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got, err := parse(tt.args.path) - if (err != nil) != tt.wantErr { - t.Errorf("parse() error = %v, wantErr %v", err, tt.wantErr) - return - } - if err == nil { - if got.section("default").key("key1").string() == "" { - t.Errorf("parse() error:not get default.key1 value") - } - if _, e := got.section("custom").key("customKey2").bool(); e != nil { - t.Errorf("parse() error:not get custom.customKey2 value") - } - } - }) - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/log.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/log.go deleted file mode 100644 index 12a2384eaa6d..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/log.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -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 common - -type Logger interface { - Printf(format string, args ...interface{}) -} - -func (c *Client) WithLogger(logger Logger) *Client { - c.logger = logger - return c -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/netretry.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/netretry.go deleted file mode 100644 index 719376f919ba..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/netretry.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -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 common - -import ( - "fmt" - "net" - "net/http" - "reflect" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile" -) - -const ( - tplNetworkFailureRetry = "[WARN] temporary network failure, retrying (%d/%d) in %f seconds: %s" -) - -func (c *Client) sendWithNetworkFailureRetry(req *http.Request, retryable bool) (resp *http.Response, err error) { - // make sure maxRetries is more than or equal 0 - var maxRetries int - if retryable { - maxRetries = maxInt(c.profile.NetworkFailureMaxRetries, 0) - } - durationFunc := safeDurationFunc(c.profile.NetworkFailureRetryDuration) - - for idx := 0; idx <= maxRetries; idx++ { - resp, err = c.sendHttp(req) - - // retry when error occurred and retryable and not the last retry - // should not sleep on last retry even if it's retryable - if err != nil && retryable && idx < maxRetries { - if err, ok := err.(net.Error); ok && (err.Timeout() || err.Temporary()) { - duration := durationFunc(idx) - if c.debug { - c.logger.Printf(tplNetworkFailureRetry, idx, maxRetries, duration.Seconds(), err.Error()) - } - - time.Sleep(duration) - continue - } - } - - if err != nil { - msg := fmt.Sprintf("Fail to get response because %s", err) - err = errors.NewTencentCloudSDKError("ClientError.NetworkError", msg, "") - } - - return resp, err - } - - return resp, err -} - -func maxInt(a, b int) int { - if a > b { - return a - } - return b -} - -func safeDurationFunc(durationFunc profile.DurationFunc) profile.DurationFunc { - if durationFunc != nil { - return durationFunc - } - return profile.ExponentialBackoff -} - -// isRetryable means if request is retryable or not, -// depends on if request has a `ClientToken` field or not, -// request with `ClientToken` means it's idempotent and retryable, -// unretryable request SHOULDN'T retry for temporary network failure -func isRetryable(obj interface{}) bool { - // obj Must be struct ptr - getType := reflect.TypeOf(obj) - if getType.Kind() != reflect.Ptr || getType.Elem().Kind() != reflect.Struct { - return false - } - - // obj Must exist named field - _, ok := getType.Elem().FieldByName(fieldClientToken) - return ok -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/netretry_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/netretry_test.go deleted file mode 100644 index 769556376c4a..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/netretry_test.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -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 common - -import ( - "testing" -) - -func TestIsRetryable(t *testing.T) { - examples := map[interface{}]bool{ - new(injectable): true, - new(uninjectable): false, - } - for msg, expected := range examples { - if val := isRetryable(msg); val != expected { - t.Fatalf("retryable failed: expected %+v, got %+v", expected, val) - } - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/oidc_role_arn_provider.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/oidc_role_arn_provider.go deleted file mode 100644 index 27809fab4c87..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/oidc_role_arn_provider.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -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 common - -import ( - "encoding/json" - "errors" - "io/ioutil" - "os" - "strconv" - "time" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile" -) - -type OIDCRoleArnProvider struct { - region string - providerId string - webIdentityToken string - roleArn string - roleSessionName string - durationSeconds int64 -} - -type oidcStsRsp struct { - Response struct { - Credentials struct { - Token string `json:"Token"` - TmpSecretId string `json:"TmpSecretId"` - TmpSecretKey string `json:"TmpSecretKey"` - } `json:"Credentials"` - ExpiredTime int `json:"ExpiredTime"` - Expiration time.Time `json:"Expiration"` - RequestId string `json:"RequestId"` - } `json:"Response"` -} - -func NewOIDCRoleArnProvider(region, providerId, webIdentityToken, roleArn, roleSessionName string, durationSeconds int64) *OIDCRoleArnProvider { - return &OIDCRoleArnProvider{ - region: region, - providerId: providerId, - webIdentityToken: webIdentityToken, - roleArn: roleArn, - roleSessionName: roleSessionName, - durationSeconds: durationSeconds, - } -} - -// DefaultTkeOIDCRoleArnProvider returns a OIDCRoleArnProvider with some default options: -// 1. providerId will be environment var TKE_PROVIDER_ID -// 2. webIdentityToken will be the content of file specified by env TKE_WEB_IDENTITY_TOKEN_FILE -// 3. roleArn will be env TKE_ROLE_ARN -// 4. roleSessionName will be "tencentcloud-go-sdk-" + timestamp -// 5. durationSeconds will be 7200s -func DefaultTkeOIDCRoleArnProvider() (*OIDCRoleArnProvider, error) { - reg := os.Getenv("TKE_REGION") - if reg == "" { - return nil, errors.New("env TKE_REGION not exist") - } - - providerId := os.Getenv("TKE_PROVIDER_ID") - if providerId == "" { - return nil, errors.New("env TKE_PROVIDER_ID not exist") - } - - tokenFile := os.Getenv("TKE_WEB_IDENTITY_TOKEN_FILE") - if tokenFile == "" { - return nil, errors.New("env TKE_WEB_IDENTITY_TOKEN_FILE not exist") - } - tokenBytes, err := ioutil.ReadFile(tokenFile) - if err != nil { - return nil, err - } - - roleArn := os.Getenv("TKE_ROLE_ARN") - if roleArn == "" { - return nil, errors.New("env TKE_ROLE_ARN not exist") - } - - sessionName := defaultSessionName + strconv.FormatInt(time.Now().UnixNano()/1000, 10) - - return NewOIDCRoleArnProvider(reg, providerId, string(tokenBytes), roleArn, sessionName, defaultDurationSeconds), nil -} - -func (r *OIDCRoleArnProvider) GetCredential() (CredentialIface, error) { - const ( - service = "sts" - version = "2018-08-13" - action = "AssumeRoleWithWebIdentity" - ) - if r.durationSeconds > 43200 || r.durationSeconds <= 0 { - return nil, tcerr.NewTencentCloudSDKError(creErr, "AssumeRoleWithWebIdentity durationSeconds should be in the range of 0~43200s", "") - } - cpf := profile.NewClientProfile() - cpf.HttpProfile.Endpoint = endpoint - cpf.HttpProfile.ReqMethod = "POST" - - client := NewCommonClient(nil, r.region, cpf) - request := tchttp.NewCommonRequest(service, version, action) - request.SetSkipSign(true) - - params := map[string]interface{}{ - "ProviderId": r.providerId, - "WebIdentityToken": r.webIdentityToken, - "RoleArn": r.roleArn, - "RoleSessionName": r.roleSessionName, - "DurationSeconds": r.durationSeconds, - } - err := request.SetActionParameters(params) - if err != nil { - return nil, err - } - - response := tchttp.NewCommonResponse() - err = client.Send(request, response) - if err != nil { - return nil, err - } - rspSt := new(oidcStsRsp) - - if err = json.Unmarshal(response.GetBody(), rspSt); err != nil { - return nil, tcerr.NewTencentCloudSDKError(creErr, err.Error(), "") - } - - return &RoleArnCredential{ - roleArn: r.roleArn, - roleSessionName: r.roleSessionName, - durationSeconds: r.durationSeconds, - expiredTime: int64(rspSt.Response.ExpiredTime), - token: rspSt.Response.Credentials.Token, - tmpSecretId: rspSt.Response.Credentials.TmpSecretId, - tmpSecretKey: rspSt.Response.Credentials.TmpSecretKey, - source: r, - }, nil -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/client_profile.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/client_profile.go deleted file mode 100644 index 565244f43937..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/client_profile.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -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 profile - -import ( - "math" - "time" -) - -type DurationFunc func(index int) time.Duration - -func ConstantDurationFunc(duration time.Duration) DurationFunc { - return func(int) time.Duration { - return duration - } -} - -func ExponentialBackoff(index int) time.Duration { - seconds := math.Pow(2, float64(index)) - return time.Duration(seconds) * time.Second -} - -type ClientProfile struct { - HttpProfile *HttpProfile - // Valid choices: HmacSHA1, HmacSHA256, TC3-HMAC-SHA256. - // Default value is TC3-HMAC-SHA256. - SignMethod string - UnsignedPayload bool - // Valid choices: zh-CN, en-US. - // Default value is zh-CN. - Language string - Debug bool - // define Whether to enable Regional auto switch - DisableRegionBreaker bool - - // Deprecated. Use BackupEndpoint instead. - BackupEndPoint string - BackupEndpoint string - - // define how to retry request - NetworkFailureMaxRetries int - NetworkFailureRetryDuration DurationFunc - RateLimitExceededMaxRetries int - RateLimitExceededRetryDuration DurationFunc -} - -func NewClientProfile() *ClientProfile { - return &ClientProfile{ - HttpProfile: NewHttpProfile(), - SignMethod: "TC3-HMAC-SHA256", - UnsignedPayload: false, - Language: "zh-CN", - Debug: false, - // now is true, will become to false in future - DisableRegionBreaker: true, - BackupEndPoint: "", - BackupEndpoint: "", - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/client_profile_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/client_profile_test.go deleted file mode 100644 index 60849f00a175..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/client_profile_test.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -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 profile - -import ( - "math/rand" - "testing" - "time" -) - -func TestExponentialBackoff(t *testing.T) { - expected := []time.Duration{ - 1 * time.Second, - 2 * time.Second, - 4 * time.Second, - 8 * time.Second, - 16 * time.Second, - 32 * time.Second, - 64 * time.Second, - 128 * time.Second, - } - for i := 0; i < len(expected); i++ { - if ExponentialBackoff(i) != expected[i] { - t.Fatalf("unexpected retry time, %+v expected, got %+v", expected[i], ExponentialBackoff(i)) - } - } -} - -func TestConstantDurationFunc(t *testing.T) { - wanted := time.Duration(rand.Int()%100) * time.Second - actual := ConstantDurationFunc(wanted)(rand.Int()) - if actual != wanted { - t.Fatalf("unexpected retry time, %+v expected, got %+v", wanted, actual) - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/http_profile.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/http_profile.go deleted file mode 100644 index 69987ebd4bb3..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile/http_profile.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -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 profile - -type HttpProfile struct { - ReqMethod string - ReqTimeout int - Scheme string - RootDomain string - Endpoint string - // Deprecated, use Scheme instead - Protocol string - Proxy string -} - -func NewHttpProfile() *HttpProfile { - return &HttpProfile{ - ReqMethod: "POST", - ReqTimeout: 60, - Scheme: "HTTPS", - RootDomain: "", - Endpoint: "", - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile_provider.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile_provider.go deleted file mode 100644 index 40b184723ebc..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile_provider.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -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 common - -import ( - "os" - "path/filepath" - "runtime" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -const ( - EnvCredentialFile = "TENCENTCLOUD_CREDENTIALS_FILE" -) - -type ProfileProvider struct { -} - -// DefaultProfileProvider return a default Profile provider -// profile path : -// 1. The value of the environment variable TENCENTCLOUD_CREDENTIALS_FILE -// 2. linux: ~/.tencentcloud/credentials -// windows: \c:\Users\NAME\.tencentcloud\credentials -func DefaultProfileProvider() *ProfileProvider { - return &ProfileProvider{} -} - -// getHomePath return home directory according to the system. -// if the environmental variables does not exist, it will return empty string -func getHomePath() string { - // Windows - if runtime.GOOS == "windows" { - return os.Getenv("USERPROFILE") - } - // *nix - return os.Getenv("HOME") -} - -func getCredentialsFilePath() string { - homePath := getHomePath() - if homePath == "" { - return homePath - } - return filepath.Join(homePath, ".tencentcloud", "credentials") -} - -func checkDefaultFile() (path string, err error) { - path = getCredentialsFilePath() - if path == "" { - return path, nil - } - _, err = os.Stat(path) - if err != nil { - if os.IsNotExist(err) { - return "", nil - } - return "", err - } - return path, nil -} - -func (p *ProfileProvider) GetCredential() (CredentialIface, error) { - path, ok := os.LookupEnv(EnvCredentialFile) - // if not set custom file path, will use the default path - if !ok { - var err error - path, err = checkDefaultFile() - // only when the file exist but failed read it the err is not nil - if err != nil { - return nil, tcerr.NewTencentCloudSDKError(creErr, "Failed to find profile file,"+err.Error(), "") - } - // when the path is "" means the file dose not exist - if path == "" { - return nil, fileDoseNotExist - } - // if the EnvCredentialFile is set to "", will return an error - } else if path == "" { - return nil, tcerr.NewTencentCloudSDKError(creErr, "Environment variable '"+EnvCredentialFile+"' cannot be empty", "") - } - - cfg, err := parse(path) - if err != nil { - return nil, err - } - - sId := cfg.section("default").key("secret_id").string() - sKey := cfg.section("default").key("secret_key").string() - // if sId and sKey is "", but the credential file exist, means an error - if sId == "" || sKey == "" { - return nil, tcerr.NewTencentCloudSDKError(creErr, "Failed to parse profile file,please confirm whether it contains \"secret_id\" and \"secret_key\" in section: \"default\" ", "") - } - return &Credential{ - SecretId: sId, - SecretKey: sKey, - Token: "", - }, nil -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/provider.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/provider.go deleted file mode 100644 index 5c2946a080d2..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/provider.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -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 common - -import tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - -var ( - envNotSet = tcerr.NewTencentCloudSDKError(creErr, "could not find environmental variable", "") - fileDoseNotExist = tcerr.NewTencentCloudSDKError(creErr, "could not find config file", "") - noCvmRole = tcerr.NewTencentCloudSDKError(creErr, "get cvm role name failed, Please confirm whether the role is bound", "") -) - -// Provider provide credential to build client. -// -// Now there are four kinds provider: -// -// EnvProvider : get credential from your Variable environment -// ProfileProvider : get credential from your profile -// CvmRoleProvider : get credential from your cvm role -// RoleArnProvider : get credential from your role arn -type Provider interface { - // GetCredential get the credential interface - GetCredential() (CredentialIface, error) -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/provider_chain.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/provider_chain.go deleted file mode 100644 index e1e1cee13e6e..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/provider_chain.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -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 common - -import ( - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -type ProviderChain struct { - Providers []Provider -} - -// NewProviderChain returns a provider chain in your custom order -func NewProviderChain(providers []Provider) Provider { - return &ProviderChain{ - Providers: providers, - } -} - -// DefaultProviderChain returns a default provider chain and try to get credentials in the following order: -// 1. Environment variable -// 2. Profile -// 3. CvmRole -// -// If you want to customize the search order, please use the function NewProviderChain -func DefaultProviderChain() Provider { - return NewProviderChain([]Provider{DefaultEnvProvider(), DefaultProfileProvider(), DefaultCvmRoleProvider()}) -} - -func (c *ProviderChain) GetCredential() (CredentialIface, error) { - for _, provider := range c.Providers { - cred, err := provider.GetCredential() - if err != nil { - if err == envNotSet || err == fileDoseNotExist || err == noCvmRole { - continue - } else { - return nil, err - } - } - return cred, err - } - return nil, tcerr.NewTencentCloudSDKError(creErr, "no credential found in every providers", "") - -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ratelimitretry.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ratelimitretry.go deleted file mode 100644 index f112ccfe6659..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/ratelimitretry.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -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 common - -import ( - "bytes" - "compress/flate" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "net/http" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" -) - -const ( - codeLimitExceeded = "RequestLimitExceeded" - tplRateLimitRetry = "[WARN] rate limit exceeded, retrying (%d/%d) in %f seconds: %s" -) - -func (c *Client) sendWithRateLimitRetry(req *http.Request, retryable bool) (resp *http.Response, err error) { - // make sure maxRetries is more than 0 - maxRetries := maxInt(c.profile.RateLimitExceededMaxRetries, 0) - durationFunc := safeDurationFunc(c.profile.RateLimitExceededRetryDuration) - - var shadow []byte - for idx := 0; idx <= maxRetries; idx++ { - resp, err = c.sendWithNetworkFailureRetry(req, retryable) - if err != nil { - return - } - - shadow, err = shadowRead(resp) - if err != nil { - return resp, err - } - - err = tchttp.ParseErrorFromHTTPResponse(shadow) - // should not sleep on last request - if err, ok := err.(*errors.TencentCloudSDKError); ok && err.Code == codeLimitExceeded && idx < maxRetries { - duration := durationFunc(idx) - if c.debug { - c.logger.Printf(tplRateLimitRetry, idx, maxRetries, duration.Seconds(), err.Error()) - } - - time.Sleep(duration) - continue - } - - return resp, err - } - - return resp, err -} - -func shadowRead(resp *http.Response) ([]byte, error) { - var reader io.ReadCloser - var err error - var val []byte - - enc := resp.Header.Get("Content-Encoding") - switch enc { - case "": - reader = resp.Body - case "deflate": - reader = flate.NewReader(resp.Body) - case "gzip": - reader, err = gzip.NewReader(resp.Body) - if err != nil { - return nil, err - } - default: - return nil, fmt.Errorf("Content-Encoding not support: %s", enc) - } - - val, err = ioutil.ReadAll(reader) - if err != nil { - return nil, err - } - - err = resp.Body.Close() - if err != nil { - return nil, err - } - - resp.Body = ioutil.NopCloser(bytes.NewReader(val)) - - // delete the header in case the caller mistake the body being encoded - delete(resp.Header, "Content-Encoding") - - return val, nil -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/regions/regions.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/regions/regions.go deleted file mode 100644 index b231e7e631ba..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/regions/regions.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -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 regions - -const ( - // 曼谷 - Bangkok = "ap-bangkok" - // 北京 - Beijing = "ap-beijing" - // 成都 - Chengdu = "ap-chengdu" - // 重庆 - Chongqing = "ap-chongqing" - // 广州 - Guangzhou = "ap-guangzhou" - // 广州Open - GuangzhouOpen = "ap-guangzhou-open" - // 中国香港 - HongKong = "ap-hongkong" - // 雅加达 - Jakarta = "ap-jakarta" - // 孟买 - Mumbai = "ap-mumbai" - // 首尔 - Seoul = "ap-seoul" - // 上海 - Shanghai = "ap-shanghai" - // 南京 - Nanjing = "ap-nanjing" - // 上海金融 - ShanghaiFSI = "ap-shanghai-fsi" - // 深圳金融 - ShenzhenFSI = "ap-shenzhen-fsi" - // 新加坡 - Singapore = "ap-singapore" - // 东京 - Tokyo = "ap-tokyo" - // 法兰克福 - Frankfurt = "eu-frankfurt" - // 莫斯科 - Moscow = "eu-moscow" - // 阿什本 - Ashburn = "na-ashburn" - // 硅谷 - SiliconValley = "na-siliconvalley" - // 多伦多 - Toronto = "na-toronto" - // 圣保罗 - SaoPaulo = "sa-saopaulo" -) diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/role_arn_credential.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/role_arn_credential.go deleted file mode 100644 index 97a66296bdf5..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/role_arn_credential.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -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 common - -import ( - "log" - "time" -) - -type RoleArnCredential struct { - roleArn string - roleSessionName string - durationSeconds int64 - expiredTime int64 - token string - tmpSecretId string - tmpSecretKey string - source Provider -} - -func (c *RoleArnCredential) GetSecretId() string { - if c.needRefresh() { - c.refresh() - } - return c.tmpSecretId -} - -func (c *RoleArnCredential) GetSecretKey() string { - if c.needRefresh() { - c.refresh() - } - return c.tmpSecretKey - -} - -func (c *RoleArnCredential) GetToken() string { - if c.needRefresh() { - c.refresh() - } - return c.token -} - -func (c *RoleArnCredential) needRefresh() bool { - if c.tmpSecretKey == "" || c.tmpSecretId == "" || c.token == "" || c.expiredTime <= time.Now().Unix() { - return true - } - return false -} - -func (c *RoleArnCredential) refresh() { - newCre, err := c.source.GetCredential() - if err != nil { - log.Println(err) - } - *c = *newCre.(*RoleArnCredential) -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/role_arn_provider.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/role_arn_provider.go deleted file mode 100644 index f3569dbaeee0..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/role_arn_provider.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -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 common - -import ( - "encoding/json" - "strconv" - "time" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/regions" -) - -const ( - endpoint = "sts.tencentcloudapi.com" - service = "sts" - version = "2018-08-13" - region = regions.Guangzhou - defaultSessionName = "tencentcloud-go-sdk-" - action = "AssumeRole" - defaultDurationSeconds = 7200 -) - -type RoleArnProvider struct { - longSecretId string - longSecretKey string - roleArn string - roleSessionName string - durationSeconds int64 -} - -type stsRsp struct { - Response struct { - Credentials struct { - Token string `json:"Token"` - TmpSecretId string `json:"TmpSecretId"` - TmpSecretKey string `json:"TmpSecretKey"` - } `json:"Credentials"` - ExpiredTime int `json:"ExpiredTime"` - Expiration time.Time `json:"Expiration"` - RequestId string `json:"RequestId"` - } `json:"Response"` -} - -func NewRoleArnProvider(secretId, secretKey, roleArn, sessionName string, duration int64) *RoleArnProvider { - return &RoleArnProvider{ - longSecretId: secretId, - longSecretKey: secretKey, - roleArn: roleArn, - roleSessionName: sessionName, - durationSeconds: duration, - } -} - -// DefaultRoleArnProvider returns a RoleArnProvider that use some default options: -// 1. roleSessionName will be "tencentcloud-go-sdk-" + timestamp -// 2. durationSeconds will be 7200s -func DefaultRoleArnProvider(secretId, secretKey, roleArn string) *RoleArnProvider { - return NewRoleArnProvider(secretId, secretKey, roleArn, defaultSessionName+strconv.FormatInt(time.Now().UnixNano()/1000, 10), defaultDurationSeconds) -} - -func (r *RoleArnProvider) GetCredential() (CredentialIface, error) { - if r.durationSeconds > 43200 || r.durationSeconds <= 0 { - return nil, tcerr.NewTencentCloudSDKError(creErr, "Assume Role durationSeconds should be in the range of 0~43200s", "") - } - credential := NewCredential(r.longSecretId, r.longSecretKey) - cpf := profile.NewClientProfile() - cpf.HttpProfile.Endpoint = endpoint - cpf.HttpProfile.ReqMethod = "POST" - - client := NewCommonClient(credential, region, cpf) - request := tchttp.NewCommonRequest(service, version, action) - - params := map[string]interface{}{ - "RoleArn": r.roleArn, - "RoleSessionName": r.roleSessionName, - "DurationSeconds": r.durationSeconds, - } - err := request.SetActionParameters(params) - if err != nil { - return nil, err - } - - response := tchttp.NewCommonResponse() - err = client.Send(request, response) - if err != nil { - return nil, err - } - rspSt := new(stsRsp) - - if err = json.Unmarshal(response.GetBody(), rspSt); err != nil { - return nil, tcerr.NewTencentCloudSDKError(creErr, err.Error(), "") - } - - return &RoleArnCredential{ - roleArn: r.roleArn, - roleSessionName: r.roleSessionName, - durationSeconds: r.durationSeconds, - expiredTime: int64(rspSt.Response.ExpiredTime) - r.durationSeconds/10*9, // credential's actual duration time is 1/10 of the original - token: rspSt.Response.Credentials.Token, - tmpSecretId: rspSt.Response.Credentials.TmpSecretId, - tmpSecretKey: rspSt.Response.Credentials.TmpSecretKey, - source: r, - }, nil -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/section.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/section.go deleted file mode 100644 index fbcd2d36eccb..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/section.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -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 common - -type sections struct { - contains map[string]*section -} - -func (ss sections) section(name string) *section { - s, ok := ss.contains[name] - if !ok { - s = new(section) - ss.contains[name] = s - } - return s -} - -type section struct { - content map[string]*value -} - -func (s *section) key(name string) *value { - v, ok := s.content[name] - if !ok { - v = new(value) - s.content[name] = v - } - return v -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/section_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/section_test.go deleted file mode 100644 index 1d64db4cc618..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/section_test.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -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 common - -import ( - "reflect" - "testing" -) - -func Test_section_key(t *testing.T) { - type fields struct { - content map[string]*value - } - type args struct { - name string - } - tests := []struct { - name string - fields fields - args args - want *value - }{ - { - "contain key", - fields{content: map[string]*value{ - "key1": {raw: "value1"}, - }, - }, - args{name: "key1"}, &value{raw: "value1"}, - }, - { - "not contain key", - fields{content: map[string]*value{}}, - args{name: "notkey"}, - &value{}, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - s := §ion{ - content: tt.fields.content, - } - if got := s.key(tt.args.name); !reflect.DeepEqual(got, tt.want) { - t.Errorf("key() = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_sections_section(t *testing.T) { - type fields struct { - contains map[string]*section - } - type args struct { - name string - } - tests := []struct { - name string - fields fields - args args - want *section - }{ - { - "contain key", - fields{contains: map[string]*section{ - "default": {content: map[string]*value{"key1": {raw: "value1"}}}}, - }, - args{name: "default"}, §ion{content: map[string]*value{"key1": {raw: "value1"}}}, - }, - { - "not contain key", - fields{contains: map[string]*section{}}, - args{name: "notkey"}, - §ion{}, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ss := sections{ - contains: tt.fields.contains, - } - if got := ss.section(tt.args.name); !reflect.DeepEqual(got, tt.want) { - t.Errorf("section() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/sign.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/sign.go deleted file mode 100644 index 7ad5906190d9..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/sign.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -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 common - -import ( - "bytes" - "crypto/hmac" - "crypto/sha1" - "crypto/sha256" - "encoding/base64" - "encoding/hex" - "hash" - "sort" - - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" -) - -const ( - SHA256 = "HmacSHA256" - SHA1 = "HmacSHA1" -) - -func Sign(s, secretKey, method string) string { - var hashed hash.Hash - switch method { - case SHA256: - hashed = hmac.New(sha256.New, []byte(secretKey)) - default: - hashed = hmac.New(sha1.New, []byte(secretKey)) - } - hashed.Write([]byte(s)) - - return base64.StdEncoding.EncodeToString(hashed.Sum(nil)) -} - -func sha256hex(s string) string { - b := sha256.Sum256([]byte(s)) - return hex.EncodeToString(b[:]) -} - -func hmacsha256(s, key string) string { - hashed := hmac.New(sha256.New, []byte(key)) - hashed.Write([]byte(s)) - return string(hashed.Sum(nil)) -} - -func signRequest(request tchttp.Request, credential CredentialIface, method string) (err error) { - if method != SHA256 { - method = SHA1 - } - checkAuthParams(request, credential, method) - s := getStringToSign(request) - signature := Sign(s, credential.GetSecretKey(), method) - request.GetParams()["Signature"] = signature - return -} - -func checkAuthParams(request tchttp.Request, credential CredentialIface, method string) { - params := request.GetParams() - params["SecretId"] = credential.GetSecretId() - if token := credential.GetToken(); len(token) != 0 { - params["Token"] = token - } - params["SignatureMethod"] = method - delete(params, "Signature") -} - -func getStringToSign(request tchttp.Request) string { - method := request.GetHttpMethod() - domain := request.GetDomain() - path := request.GetPath() - - var buf bytes.Buffer - buf.WriteString(method) - buf.WriteString(domain) - buf.WriteString(path) - buf.WriteString("?") - - params := request.GetParams() - // sort params - keys := make([]string, 0, len(params)) - for k := range params { - keys = append(keys, k) - } - sort.Strings(keys) - - for i := range keys { - k := keys[i] - buf.WriteString(k) - buf.WriteString("=") - buf.WriteString(params[k]) - buf.WriteString("&") - } - buf.Truncate(buf.Len() - 1) - return buf.String() -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/testdata_invalid.ini b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/testdata_invalid.ini deleted file mode 100644 index c86745867516..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/testdata_invalid.ini +++ /dev/null @@ -1,5 +0,0 @@ -# wrong section name -[] -invalidKey1 = -;wrong section -[default diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/testdata_valid.ini b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/testdata_valid.ini deleted file mode 100644 index 40a6dd3a8c46..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/testdata_valid.ini +++ /dev/null @@ -1,11 +0,0 @@ -app=tencentcloud-sdk-go-go - -# default -[default] -key1 = value1 - key2 = 2 - -;section 2 -[custom] -customKey1 = 3.1415 -customKey2 = true diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/types.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/types.go deleted file mode 100644 index d49468d769a1..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/types.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -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 common - -func IntPtr(v int) *int { - return &v -} - -func Int64Ptr(v int64) *int64 { - return &v -} - -func UintPtr(v uint) *uint { - return &v -} - -func Uint64Ptr(v uint64) *uint64 { - return &v -} - -func Float64Ptr(v float64) *float64 { - return &v -} - -func BoolPtr(v bool) *bool { - return &v -} - -func StringPtr(v string) *string { - return &v -} - -func StringValues(ptrs []*string) []string { - values := make([]string, len(ptrs)) - for i := 0; i < len(ptrs); i++ { - if ptrs[i] != nil { - values[i] = *ptrs[i] - } - } - return values -} - -func IntPtrs(vals []int) []*int { - ptrs := make([]*int, len(vals)) - for i := 0; i < len(vals); i++ { - ptrs[i] = &vals[i] - } - return ptrs -} - -func Int64Ptrs(vals []int64) []*int64 { - ptrs := make([]*int64, len(vals)) - for i := 0; i < len(vals); i++ { - ptrs[i] = &vals[i] - } - return ptrs -} - -func UintPtrs(vals []uint) []*uint { - ptrs := make([]*uint, len(vals)) - for i := 0; i < len(vals); i++ { - ptrs[i] = &vals[i] - } - return ptrs -} - -func Uint64Ptrs(vals []uint64) []*uint64 { - ptrs := make([]*uint64, len(vals)) - for i := 0; i < len(vals); i++ { - ptrs[i] = &vals[i] - } - return ptrs -} - -func Float64Ptrs(vals []float64) []*float64 { - ptrs := make([]*float64, len(vals)) - for i := 0; i < len(vals); i++ { - ptrs[i] = &vals[i] - } - return ptrs -} - -func BoolPtrs(vals []bool) []*bool { - ptrs := make([]*bool, len(vals)) - for i := 0; i < len(vals); i++ { - ptrs[i] = &vals[i] - } - return ptrs -} - -func StringPtrs(vals []string) []*string { - ptrs := make([]*string, len(vals)) - for i := 0; i < len(vals); i++ { - ptrs[i] = &vals[i] - } - return ptrs -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/types_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/types_test.go deleted file mode 100644 index 79c92691fea6..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/types_test.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -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 common - -import ( - "testing" -) - -func TestStringPtrsValues(t *testing.T) { - vals := []string{"a", "b", "c", "d"} - ptrs := StringPtrs(vals) - for i := 0; i < len(vals); i++ { - if *ptrs[i] != vals[i] { - t.Errorf("[ERROR] value %s != ptr value %s", vals[i], *ptrs[i]) - } - } - newVals := StringValues(ptrs) - for i := 0; i < len(vals); i++ { - if newVals[i] != vals[i] { - t.Errorf("[ERROR] new val %s != val %s", newVals[i], vals[i]) - } - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/value.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/value.go deleted file mode 100644 index acdc1534b55b..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/value.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -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 common - -import ( - "fmt" - "strconv" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" -) - -type value struct { - raw string -} - -func (v *value) int() (int, error) { - i, e := strconv.Atoi(v.raw) - if e != nil { - msg := fmt.Sprintf("failed to parsing %s to int: %s", v.raw, e.Error()) - e = tcerr.NewTencentCloudSDKError(iniErr, msg, "") - } - return i, e -} - -func (v *value) int64() (int64, error) { - i, e := strconv.ParseInt(v.raw, 10, 64) - if e != nil { - msg := fmt.Sprintf("failed to parsing %s to int64: %s", v.raw, e.Error()) - e = tcerr.NewTencentCloudSDKError(iniErr, msg, "") - } - return i, e -} - -func (v *value) string() string { - return v.raw -} - -func (v *value) bool() (bool, error) { - switch v.raw { - case "1", "t", "T", "true", "TRUE", "True", "YES", "yes", "Yes", "y", "ON", "on", "On": - return true, nil - case "0", "f", "F", "false", "FALSE", "False", "NO", "no", "No", "n", "OFF", "off", "Off": - return false, nil - } - errorMsg := fmt.Sprintf("failed to parsing \"%s\" to Bool: invalid syntax", v.raw) - return false, tcerr.NewTencentCloudSDKError(iniErr, errorMsg, "") -} - -func (v *value) float32() (float32, error) { - f, e := strconv.ParseFloat(v.raw, 32) - if e != nil { - msg := fmt.Sprintf("failed to parse %s to Float32: %s", v.raw, e.Error()) - e = tcerr.NewTencentCloudSDKError(iniErr, msg, "") - } - return float32(f), e -} -func (v *value) float64() (float64, error) { - f, e := strconv.ParseFloat(v.raw, 64) - if e != nil { - msg := fmt.Sprintf("failed to parse %s to Float64: %s", v.raw, e.Error()) - e = tcerr.NewTencentCloudSDKError(iniErr, msg, "") - } - - return f, e -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/value_test.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/value_test.go deleted file mode 100644 index f72777b76ae4..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/value_test.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -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 common - -import "testing" - -func Test_value_String(t *testing.T) { - type fields struct { - raw string - } - tests := []struct { - name string - fields fields - want string - }{ - {"valid", fields{"valid string"}, "valid string"}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := &value{ - raw: tt.fields.raw, - } - if got := v.string(); got != tt.want { - t.Errorf("String() = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_value_bool(t *testing.T) { - type fields struct { - raw string - } - tests := []struct { - name string - fields fields - want bool - wantErr bool - }{ - {"valid Bool", fields{raw: "true"}, true, false}, - {"valid Bool", fields{raw: "y"}, true, false}, - {"invalid Bool", fields{raw: "TrUe"}, false, true}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := &value{ - raw: tt.fields.raw, - } - got, err := v.bool() - if (err != nil) != tt.wantErr { - t.Errorf("Bool() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf("Bool() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_value_float32(t *testing.T) { - type fields struct { - raw string - } - tests := []struct { - name string - fields fields - want float32 - wantErr bool - }{ - {"valid Float32", fields{raw: "1.23"}, 1.23, false}, - {"valid Float32", fields{raw: "0.33333"}, 0.33333, false}, - {"invalid Float32", fields{raw: "1.23.23"}, 0, true}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := &value{ - raw: tt.fields.raw, - } - got, err := v.float32() - if (err != nil) != tt.wantErr { - t.Errorf("Float32() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf("Float32() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_value_float64(t *testing.T) { - type fields struct { - raw string - } - tests := []struct { - name string - fields fields - want float64 - wantErr bool - }{ - {"valid Float64", fields{raw: "1.23"}, 1.23, false}, - {"valid Float64", fields{raw: "0.33333"}, 0.33333, false}, - {"invalid Float64", fields{raw: "1.23.23"}, 0, true}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := &value{ - raw: tt.fields.raw, - } - got, err := v.float64() - if (err != nil) != tt.wantErr { - t.Errorf("Float64() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf("Float64() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_value_int(t *testing.T) { - type fields struct { - raw string - } - tests := []struct { - name string - fields fields - want int - wantErr bool - }{ - {"valid int", fields{raw: "1"}, 1, false}, - {"valid int", fields{raw: "99887766"}, 99887766, false}, - {"invalid int", fields{raw: "1987a"}, 0, true}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := &value{ - raw: tt.fields.raw, - } - got, err := v.int() - if (err != nil) != tt.wantErr { - t.Errorf("int() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf("int() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_value_int64(t *testing.T) { - type fields struct { - raw string - } - tests := []struct { - name string - fields fields - want int64 - wantErr bool - }{ - // TODO: Add test cases. - {"valid int", fields{raw: "1"}, 1, false}, - {"valid int", fields{raw: "99887766"}, 99887766, false}, - {"invalid int", fields{raw: "1987a"}, 0, true}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := &value{ - raw: tt.fields.raw, - } - got, err := v.int64() - if (err != nil) != tt.wantErr { - t.Errorf("int64() error = %v, wantErr %v", err, tt.wantErr) - return - } - if got != tt.want { - t.Errorf("int64() got = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/doc.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/doc.go deleted file mode 100644 index f0f00fec6d03..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -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 doc diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/client.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/client.go deleted file mode 100644 index 33c8e144f15f..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/client.go +++ /dev/null @@ -1,8590 +0,0 @@ -/* -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 v20170312 - -import ( - "context" - "errors" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile" -) - -const APIVersion = "2017-03-12" - -type Client struct { - common.Client -} - -// Deprecated -func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { - cpf := profile.NewClientProfile() - client = &Client{} - client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf) - return -} - -func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { - client = &Client{} - client.Init(region). - WithCredential(credential). - WithProfile(clientProfile) - return -} - -func NewAllocateHostsRequest() (request *AllocateHostsRequest) { - request = &AllocateHostsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "AllocateHosts") - - return -} - -func NewAllocateHostsResponse() (response *AllocateHostsResponse) { - response = &AllocateHostsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AllocateHosts -// 本接口 (AllocateHosts) 用于创建一个或多个指定配置的CDH实例。 -// -// * 当HostChargeType为PREPAID时,必须指定HostChargePrepaid参数。 -// -// 可能返回的错误码: -// -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCEINSUFFICIENT_ZONESOLDOUTFORSPECIFIEDINSTANCE = "ResourceInsufficient.ZoneSoldOutForSpecifiedInstance" -func (c *Client) AllocateHosts(request *AllocateHostsRequest) (response *AllocateHostsResponse, err error) { - return c.AllocateHostsWithContext(context.Background(), request) -} - -// AllocateHosts -// 本接口 (AllocateHosts) 用于创建一个或多个指定配置的CDH实例。 -// -// * 当HostChargeType为PREPAID时,必须指定HostChargePrepaid参数。 -// -// 可能返回的错误码: -// -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCEINSUFFICIENT_ZONESOLDOUTFORSPECIFIEDINSTANCE = "ResourceInsufficient.ZoneSoldOutForSpecifiedInstance" -func (c *Client) AllocateHostsWithContext(ctx context.Context, request *AllocateHostsRequest) (response *AllocateHostsResponse, err error) { - if request == nil { - request = NewAllocateHostsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AllocateHosts require credential") - } - - request.SetContext(ctx) - - response = NewAllocateHostsResponse() - err = c.Send(request, response) - return -} - -func NewAssociateInstancesKeyPairsRequest() (request *AssociateInstancesKeyPairsRequest) { - request = &AssociateInstancesKeyPairsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "AssociateInstancesKeyPairs") - - return -} - -func NewAssociateInstancesKeyPairsResponse() (response *AssociateInstancesKeyPairsResponse) { - response = &AssociateInstancesKeyPairsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssociateInstancesKeyPairs -// 本接口 (AssociateInstancesKeyPairs) 用于将密钥绑定到实例上。 -// -// * 将密钥的公钥写入到实例的`SSH`配置当中,用户就可以通过该密钥的私钥来登录实例。 -// -// * 如果实例原来绑定过密钥,那么原来的密钥将失效。 -// -// * 如果实例原来是通过密码登录,绑定密钥后无法使用密码登录。 -// -// * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_KEYPAIRNOTSUPPORTED = "InvalidParameterValue.KeyPairNotSupported" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCEOSWINDOWS = "UnsupportedOperation.InstanceOsWindows" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) AssociateInstancesKeyPairs(request *AssociateInstancesKeyPairsRequest) (response *AssociateInstancesKeyPairsResponse, err error) { - return c.AssociateInstancesKeyPairsWithContext(context.Background(), request) -} - -// AssociateInstancesKeyPairs -// 本接口 (AssociateInstancesKeyPairs) 用于将密钥绑定到实例上。 -// -// * 将密钥的公钥写入到实例的`SSH`配置当中,用户就可以通过该密钥的私钥来登录实例。 -// -// * 如果实例原来绑定过密钥,那么原来的密钥将失效。 -// -// * 如果实例原来是通过密码登录,绑定密钥后无法使用密码登录。 -// -// * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_KEYPAIRNOTSUPPORTED = "InvalidParameterValue.KeyPairNotSupported" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCEOSWINDOWS = "UnsupportedOperation.InstanceOsWindows" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) AssociateInstancesKeyPairsWithContext(ctx context.Context, request *AssociateInstancesKeyPairsRequest) (response *AssociateInstancesKeyPairsResponse, err error) { - if request == nil { - request = NewAssociateInstancesKeyPairsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssociateInstancesKeyPairs require credential") - } - - request.SetContext(ctx) - - response = NewAssociateInstancesKeyPairsResponse() - err = c.Send(request, response) - return -} - -func NewAssociateSecurityGroupsRequest() (request *AssociateSecurityGroupsRequest) { - request = &AssociateSecurityGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "AssociateSecurityGroups") - - return -} - -func NewAssociateSecurityGroupsResponse() (response *AssociateSecurityGroupsResponse) { - response = &AssociateSecurityGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssociateSecurityGroups -// 本接口 (AssociateSecurityGroups) 用于绑定安全组到指定实例。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDSGID_MALFORMED = "InvalidSgId.Malformed" -// LIMITEXCEEDED_ASSOCIATEUSGLIMITEXCEEDED = "LimitExceeded.AssociateUSGLimitExceeded" -// LIMITEXCEEDED_CVMSVIFSPERSECGROUPLIMITEXCEEDED = "LimitExceeded.CvmsVifsPerSecGroupLimitExceeded" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// SECGROUPACTIONFAILURE = "SecGroupActionFailure" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -func (c *Client) AssociateSecurityGroups(request *AssociateSecurityGroupsRequest) (response *AssociateSecurityGroupsResponse, err error) { - return c.AssociateSecurityGroupsWithContext(context.Background(), request) -} - -// AssociateSecurityGroups -// 本接口 (AssociateSecurityGroups) 用于绑定安全组到指定实例。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDSGID_MALFORMED = "InvalidSgId.Malformed" -// LIMITEXCEEDED_ASSOCIATEUSGLIMITEXCEEDED = "LimitExceeded.AssociateUSGLimitExceeded" -// LIMITEXCEEDED_CVMSVIFSPERSECGROUPLIMITEXCEEDED = "LimitExceeded.CvmsVifsPerSecGroupLimitExceeded" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// SECGROUPACTIONFAILURE = "SecGroupActionFailure" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -func (c *Client) AssociateSecurityGroupsWithContext(ctx context.Context, request *AssociateSecurityGroupsRequest) (response *AssociateSecurityGroupsResponse, err error) { - if request == nil { - request = NewAssociateSecurityGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssociateSecurityGroups require credential") - } - - request.SetContext(ctx) - - response = NewAssociateSecurityGroupsResponse() - err = c.Send(request, response) - return -} - -func NewConfigureChcAssistVpcRequest() (request *ConfigureChcAssistVpcRequest) { - request = &ConfigureChcAssistVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ConfigureChcAssistVpc") - - return -} - -func NewConfigureChcAssistVpcResponse() (response *ConfigureChcAssistVpcResponse) { - response = &ConfigureChcAssistVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ConfigureChcAssistVpc -// 配置CHC物理服务器的带外和部署网络。传入带外网络和部署网络信息 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_AMOUNTNOTEQUAL = "InvalidParameterValue.AmountNotEqual" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) ConfigureChcAssistVpc(request *ConfigureChcAssistVpcRequest) (response *ConfigureChcAssistVpcResponse, err error) { - return c.ConfigureChcAssistVpcWithContext(context.Background(), request) -} - -// ConfigureChcAssistVpc -// 配置CHC物理服务器的带外和部署网络。传入带外网络和部署网络信息 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_AMOUNTNOTEQUAL = "InvalidParameterValue.AmountNotEqual" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) ConfigureChcAssistVpcWithContext(ctx context.Context, request *ConfigureChcAssistVpcRequest) (response *ConfigureChcAssistVpcResponse, err error) { - if request == nil { - request = NewConfigureChcAssistVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ConfigureChcAssistVpc require credential") - } - - request.SetContext(ctx) - - response = NewConfigureChcAssistVpcResponse() - err = c.Send(request, response) - return -} - -func NewConfigureChcDeployVpcRequest() (request *ConfigureChcDeployVpcRequest) { - request = &ConfigureChcDeployVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ConfigureChcDeployVpc") - - return -} - -func NewConfigureChcDeployVpcResponse() (response *ConfigureChcDeployVpcResponse) { - response = &ConfigureChcDeployVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ConfigureChcDeployVpc -// 配置CHC物理服务器部署网络 -// -// 可能返回的错误码: -// -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_AMOUNTNOTEQUAL = "InvalidParameterValue.AmountNotEqual" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_DEPLOYVPCALREADYEXISTS = "InvalidParameterValue.DeployVpcAlreadyExists" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) ConfigureChcDeployVpc(request *ConfigureChcDeployVpcRequest) (response *ConfigureChcDeployVpcResponse, err error) { - return c.ConfigureChcDeployVpcWithContext(context.Background(), request) -} - -// ConfigureChcDeployVpc -// 配置CHC物理服务器部署网络 -// -// 可能返回的错误码: -// -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_AMOUNTNOTEQUAL = "InvalidParameterValue.AmountNotEqual" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_DEPLOYVPCALREADYEXISTS = "InvalidParameterValue.DeployVpcAlreadyExists" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) ConfigureChcDeployVpcWithContext(ctx context.Context, request *ConfigureChcDeployVpcRequest) (response *ConfigureChcDeployVpcResponse, err error) { - if request == nil { - request = NewConfigureChcDeployVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ConfigureChcDeployVpc require credential") - } - - request.SetContext(ctx) - - response = NewConfigureChcDeployVpcResponse() - err = c.Send(request, response) - return -} - -func NewCreateDisasterRecoverGroupRequest() (request *CreateDisasterRecoverGroupRequest) { - request = &CreateDisasterRecoverGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "CreateDisasterRecoverGroup") - - return -} - -func NewCreateDisasterRecoverGroupResponse() (response *CreateDisasterRecoverGroupResponse) { - response = &CreateDisasterRecoverGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateDisasterRecoverGroup -// 本接口 (CreateDisasterRecoverGroup)用于创建[分散置放群组](https://cloud.tencent.com/document/product/213/15486)。创建好的置放群组,可在[创建实例](https://cloud.tencent.com/document/api/213/15730)时指定。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCEINSUFFICIENT_INSUFFICIENTGROUPQUOTA = "ResourceInsufficient.InsufficientGroupQuota" -func (c *Client) CreateDisasterRecoverGroup(request *CreateDisasterRecoverGroupRequest) (response *CreateDisasterRecoverGroupResponse, err error) { - return c.CreateDisasterRecoverGroupWithContext(context.Background(), request) -} - -// CreateDisasterRecoverGroup -// 本接口 (CreateDisasterRecoverGroup)用于创建[分散置放群组](https://cloud.tencent.com/document/product/213/15486)。创建好的置放群组,可在[创建实例](https://cloud.tencent.com/document/api/213/15730)时指定。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCEINSUFFICIENT_INSUFFICIENTGROUPQUOTA = "ResourceInsufficient.InsufficientGroupQuota" -func (c *Client) CreateDisasterRecoverGroupWithContext(ctx context.Context, request *CreateDisasterRecoverGroupRequest) (response *CreateDisasterRecoverGroupResponse, err error) { - if request == nil { - request = NewCreateDisasterRecoverGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateDisasterRecoverGroup require credential") - } - - request.SetContext(ctx) - - response = NewCreateDisasterRecoverGroupResponse() - err = c.Send(request, response) - return -} - -func NewCreateHpcClusterRequest() (request *CreateHpcClusterRequest) { - request = &CreateHpcClusterRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "CreateHpcCluster") - - return -} - -func NewCreateHpcClusterResponse() (response *CreateHpcClusterResponse) { - response = &CreateHpcClusterResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateHpcCluster -// 创建高性能计算集群 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// LIMITEXCEEDED_HPCCLUSTERQUOTA = "LimitExceeded.HpcClusterQuota" -// UNSUPPORTEDOPERATION_INSUFFICIENTCLUSTERQUOTA = "UnsupportedOperation.InsufficientClusterQuota" -// UNSUPPORTEDOPERATION_INVALIDZONE = "UnsupportedOperation.InvalidZone" -func (c *Client) CreateHpcCluster(request *CreateHpcClusterRequest) (response *CreateHpcClusterResponse, err error) { - return c.CreateHpcClusterWithContext(context.Background(), request) -} - -// CreateHpcCluster -// 创建高性能计算集群 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// LIMITEXCEEDED_HPCCLUSTERQUOTA = "LimitExceeded.HpcClusterQuota" -// UNSUPPORTEDOPERATION_INSUFFICIENTCLUSTERQUOTA = "UnsupportedOperation.InsufficientClusterQuota" -// UNSUPPORTEDOPERATION_INVALIDZONE = "UnsupportedOperation.InvalidZone" -func (c *Client) CreateHpcClusterWithContext(ctx context.Context, request *CreateHpcClusterRequest) (response *CreateHpcClusterResponse, err error) { - if request == nil { - request = NewCreateHpcClusterRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateHpcCluster require credential") - } - - request.SetContext(ctx) - - response = NewCreateHpcClusterResponse() - err = c.Send(request, response) - return -} - -func NewCreateImageRequest() (request *CreateImageRequest) { - request = &CreateImageRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "CreateImage") - - return -} - -func NewCreateImageResponse() (response *CreateImageResponse) { - response = &CreateImageResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateImage -// 本接口(CreateImage)用于将实例的系统盘制作为新镜像,创建后的镜像可以用于创建实例。 -// -// 可能返回的错误码: -// -// IMAGEQUOTALIMITEXCEEDED = "ImageQuotaLimitExceeded" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER_DATADISKIDCONTAINSROOTDISK = "InvalidParameter.DataDiskIdContainsRootDisk" -// INVALIDPARAMETER_DATADISKNOTBELONGSPECIFIEDINSTANCE = "InvalidParameter.DataDiskNotBelongSpecifiedInstance" -// INVALIDPARAMETER_DUPLICATESYSTEMSNAPSHOTS = "InvalidParameter.DuplicateSystemSnapshots" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INVALIDDEPENDENCE = "InvalidParameter.InvalidDependence" -// INVALIDPARAMETER_LOCALDATADISKNOTSUPPORT = "InvalidParameter.LocalDataDiskNotSupport" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETER_SPECIFYONEPARAMETER = "InvalidParameter.SpecifyOneParameter" -// INVALIDPARAMETER_SWAPDISKNOTSUPPORT = "InvalidParameter.SwapDiskNotSupport" -// INVALIDPARAMETER_SYSTEMSNAPSHOTNOTFOUND = "InvalidParameter.SystemSnapshotNotFound" -// INVALIDPARAMETER_VALUETOOLARGE = "InvalidParameter.ValueTooLarge" -// INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_PREHEATNOTSUPPORTEDINSTANCETYPE = "InvalidParameterValue.PreheatNotSupportedInstanceType" -// INVALIDPARAMETERVALUE_PREHEATNOTSUPPORTEDZONE = "InvalidParameterValue.PreheatNotSupportedZone" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_TAGQUOTALIMITEXCEEDED = "InvalidParameterValue.TagQuotaLimitExceeded" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_PREHEATIMAGESNAPSHOTOUTOFQUOTA = "LimitExceeded.PreheatImageSnapshotOutOfQuota" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINUSE_DISKROLLBACKING = "ResourceInUse.DiskRollbacking" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEUNAVAILABLE_SNAPSHOTCREATING = "ResourceUnavailable.SnapshotCreating" -// UNSUPPORTEDOPERATION_ENCRYPTEDIMAGESNOTSUPPORTED = "UnsupportedOperation.EncryptedImagesNotSupported" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDDISKFASTROLLBACK = "UnsupportedOperation.InvalidDiskFastRollback" -// UNSUPPORTEDOPERATION_NOTSUPPORTINSTANCEIMAGE = "UnsupportedOperation.NotSupportInstanceImage" -// UNSUPPORTEDOPERATION_PREHEATIMAGE = "UnsupportedOperation.PreheatImage" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) CreateImage(request *CreateImageRequest) (response *CreateImageResponse, err error) { - return c.CreateImageWithContext(context.Background(), request) -} - -// CreateImage -// 本接口(CreateImage)用于将实例的系统盘制作为新镜像,创建后的镜像可以用于创建实例。 -// -// 可能返回的错误码: -// -// IMAGEQUOTALIMITEXCEEDED = "ImageQuotaLimitExceeded" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER_DATADISKIDCONTAINSROOTDISK = "InvalidParameter.DataDiskIdContainsRootDisk" -// INVALIDPARAMETER_DATADISKNOTBELONGSPECIFIEDINSTANCE = "InvalidParameter.DataDiskNotBelongSpecifiedInstance" -// INVALIDPARAMETER_DUPLICATESYSTEMSNAPSHOTS = "InvalidParameter.DuplicateSystemSnapshots" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INVALIDDEPENDENCE = "InvalidParameter.InvalidDependence" -// INVALIDPARAMETER_LOCALDATADISKNOTSUPPORT = "InvalidParameter.LocalDataDiskNotSupport" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETER_SPECIFYONEPARAMETER = "InvalidParameter.SpecifyOneParameter" -// INVALIDPARAMETER_SWAPDISKNOTSUPPORT = "InvalidParameter.SwapDiskNotSupport" -// INVALIDPARAMETER_SYSTEMSNAPSHOTNOTFOUND = "InvalidParameter.SystemSnapshotNotFound" -// INVALIDPARAMETER_VALUETOOLARGE = "InvalidParameter.ValueTooLarge" -// INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_PREHEATNOTSUPPORTEDINSTANCETYPE = "InvalidParameterValue.PreheatNotSupportedInstanceType" -// INVALIDPARAMETERVALUE_PREHEATNOTSUPPORTEDZONE = "InvalidParameterValue.PreheatNotSupportedZone" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_TAGQUOTALIMITEXCEEDED = "InvalidParameterValue.TagQuotaLimitExceeded" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_PREHEATIMAGESNAPSHOTOUTOFQUOTA = "LimitExceeded.PreheatImageSnapshotOutOfQuota" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINUSE_DISKROLLBACKING = "ResourceInUse.DiskRollbacking" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEUNAVAILABLE_SNAPSHOTCREATING = "ResourceUnavailable.SnapshotCreating" -// UNSUPPORTEDOPERATION_ENCRYPTEDIMAGESNOTSUPPORTED = "UnsupportedOperation.EncryptedImagesNotSupported" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDDISKFASTROLLBACK = "UnsupportedOperation.InvalidDiskFastRollback" -// UNSUPPORTEDOPERATION_NOTSUPPORTINSTANCEIMAGE = "UnsupportedOperation.NotSupportInstanceImage" -// UNSUPPORTEDOPERATION_PREHEATIMAGE = "UnsupportedOperation.PreheatImage" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) CreateImageWithContext(ctx context.Context, request *CreateImageRequest) (response *CreateImageResponse, err error) { - if request == nil { - request = NewCreateImageRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateImage require credential") - } - - request.SetContext(ctx) - - response = NewCreateImageResponse() - err = c.Send(request, response) - return -} - -func NewCreateKeyPairRequest() (request *CreateKeyPairRequest) { - request = &CreateKeyPairRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "CreateKeyPair") - - return -} - -func NewCreateKeyPairResponse() (response *CreateKeyPairResponse) { - response = &CreateKeyPairResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateKeyPair -// 本接口 (CreateKeyPair) 用于创建一个 `OpenSSH RSA` 密钥对,可以用于登录 `Linux` 实例。 -// -// * 开发者只需指定密钥对名称,即可由系统自动创建密钥对,并返回所生成的密钥对的 `ID` 及其公钥、私钥的内容。 -// -// * 密钥对名称不能和已经存在的密钥对的名称重复。 -// -// * 私钥的内容可以保存到文件中作为 `SSH` 的一种认证方式。 -// -// * 腾讯云不会保存用户的私钥,请妥善保管。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" -// INVALIDKEYPAIRNAME_DUPLICATE = "InvalidKeyPairName.Duplicate" -// INVALIDKEYPAIRNAMEEMPTY = "InvalidKeyPairNameEmpty" -// INVALIDKEYPAIRNAMEINCLUDEILLEGALCHAR = "InvalidKeyPairNameIncludeIllegalChar" -// INVALIDKEYPAIRNAMETOOLONG = "InvalidKeyPairNameTooLong" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// LIMITEXCEEDED_TAGRESOURCEQUOTA = "LimitExceeded.TagResourceQuota" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) CreateKeyPair(request *CreateKeyPairRequest) (response *CreateKeyPairResponse, err error) { - return c.CreateKeyPairWithContext(context.Background(), request) -} - -// CreateKeyPair -// 本接口 (CreateKeyPair) 用于创建一个 `OpenSSH RSA` 密钥对,可以用于登录 `Linux` 实例。 -// -// * 开发者只需指定密钥对名称,即可由系统自动创建密钥对,并返回所生成的密钥对的 `ID` 及其公钥、私钥的内容。 -// -// * 密钥对名称不能和已经存在的密钥对的名称重复。 -// -// * 私钥的内容可以保存到文件中作为 `SSH` 的一种认证方式。 -// -// * 腾讯云不会保存用户的私钥,请妥善保管。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" -// INVALIDKEYPAIRNAME_DUPLICATE = "InvalidKeyPairName.Duplicate" -// INVALIDKEYPAIRNAMEEMPTY = "InvalidKeyPairNameEmpty" -// INVALIDKEYPAIRNAMEINCLUDEILLEGALCHAR = "InvalidKeyPairNameIncludeIllegalChar" -// INVALIDKEYPAIRNAMETOOLONG = "InvalidKeyPairNameTooLong" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// LIMITEXCEEDED_TAGRESOURCEQUOTA = "LimitExceeded.TagResourceQuota" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) CreateKeyPairWithContext(ctx context.Context, request *CreateKeyPairRequest) (response *CreateKeyPairResponse, err error) { - if request == nil { - request = NewCreateKeyPairRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateKeyPair require credential") - } - - request.SetContext(ctx) - - response = NewCreateKeyPairResponse() - err = c.Send(request, response) - return -} - -func NewCreateLaunchTemplateRequest() (request *CreateLaunchTemplateRequest) { - request = &CreateLaunchTemplateRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "CreateLaunchTemplate") - - return -} - -func NewCreateLaunchTemplateResponse() (response *CreateLaunchTemplateResponse) { - response = &CreateLaunchTemplateResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateLaunchTemplate -// 本接口(CreateLaunchTemplate)用于创建实例启动模板。 -// -// 实例启动模板是一种配置数据并可用于创建实例,其内容包含创建实例所需的配置,比如实例类型,数据盘和系统盘的类型和大小,以及安全组等信息。 -// -// 初次创建实例模板后,其模板版本为默认版本1,新版本的创建可使用CreateLaunchTemplateVersion创建,版本号递增。默认情况下,在RunInstances中指定实例启动模板,若不指定模板版本号,则使用默认版本。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_NOAVAILABLEIPADDRESSCOUNTINSUBNET = "FailedOperation.NoAvailableIpAddressCountInSubnet" -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// FAILEDOPERATION_SNAPSHOTSIZELARGERTHANDATASIZE = "FailedOperation.SnapshotSizeLargerThanDataSize" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// INSTANCESQUOTALIMITEXCEEDED = "InstancesQuotaLimitExceeded" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INTERNETACCESSIBLENOTSUPPORTED = "InvalidParameter.InternetAccessibleNotSupported" -// INVALIDPARAMETER_INVALIDIPFORMAT = "InvalidParameter.InvalidIpFormat" -// INVALIDPARAMETER_LACKCORECOUNTORTHREADPERCORE = "InvalidParameter.LackCoreCountOrThreadPerCore" -// INVALIDPARAMETER_PASSWORDNOTSUPPORTED = "InvalidParameter.PasswordNotSupported" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" -// INVALIDPARAMETERVALUE_CORECOUNTVALUE = "InvalidParameterValue.CoreCountValue" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" -// INVALIDPARAMETERVALUE_INSTANCETYPEREQUIREDHPCCLUSTER = "InvalidParameterValue.InstanceTypeRequiredHpcCluster" -// INVALIDPARAMETERVALUE_INSUFFICIENTOFFERING = "InvalidParameterValue.InsufficientOffering" -// INVALIDPARAMETERVALUE_INSUFFICIENTPRICE = "InvalidParameterValue.InsufficientPrice" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORGIVENINSTANCETYPE = "InvalidParameterValue.InvalidImageForGivenInstanceType" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateDescription" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATENAME = "InvalidParameterValue.InvalidLaunchTemplateName" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEVERSIONDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateVersionDescription" -// INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" -// INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_SUBNETNOTEXIST = "InvalidParameterValue.SubnetNotExist" -// INVALIDPARAMETERVALUE_THREADPERCOREVALUE = "InvalidParameterValue.ThreadPerCoreValue" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDNOTEXIST = "InvalidParameterValue.VpcIdNotExist" -// INVALIDPARAMETERVALUE_VPCIDZONEIDNOTMATCH = "InvalidParameterValue.VpcIdZoneIdNotMatch" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPASSWORD = "InvalidPassword" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" -// LIMITEXCEEDED_LAUNCHTEMPLATEQUOTA = "LimitExceeded.LaunchTemplateQuota" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" -// LIMITEXCEEDED_USERSPOTQUOTA = "LimitExceeded.UserSpotQuota" -// LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_DPDKINSTANCETYPEREQUIREDVPC = "MissingParameter.DPDKInstanceTypeRequiredVPC" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// RESOURCEINSUFFICIENT_AVAILABILITYZONESOLDOUT = "ResourceInsufficient.AvailabilityZoneSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" -// RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_EIPINSUFFICIENT = "ResourcesSoldOut.EipInsufficient" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_NOTSUPPORTIMPORTINSTANCESACTIONTIMER = "UnsupportedOperation.NotSupportImportInstancesActionTimer" -// UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) CreateLaunchTemplate(request *CreateLaunchTemplateRequest) (response *CreateLaunchTemplateResponse, err error) { - return c.CreateLaunchTemplateWithContext(context.Background(), request) -} - -// CreateLaunchTemplate -// 本接口(CreateLaunchTemplate)用于创建实例启动模板。 -// -// 实例启动模板是一种配置数据并可用于创建实例,其内容包含创建实例所需的配置,比如实例类型,数据盘和系统盘的类型和大小,以及安全组等信息。 -// -// 初次创建实例模板后,其模板版本为默认版本1,新版本的创建可使用CreateLaunchTemplateVersion创建,版本号递增。默认情况下,在RunInstances中指定实例启动模板,若不指定模板版本号,则使用默认版本。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_NOAVAILABLEIPADDRESSCOUNTINSUBNET = "FailedOperation.NoAvailableIpAddressCountInSubnet" -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// FAILEDOPERATION_SNAPSHOTSIZELARGERTHANDATASIZE = "FailedOperation.SnapshotSizeLargerThanDataSize" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// INSTANCESQUOTALIMITEXCEEDED = "InstancesQuotaLimitExceeded" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INTERNETACCESSIBLENOTSUPPORTED = "InvalidParameter.InternetAccessibleNotSupported" -// INVALIDPARAMETER_INVALIDIPFORMAT = "InvalidParameter.InvalidIpFormat" -// INVALIDPARAMETER_LACKCORECOUNTORTHREADPERCORE = "InvalidParameter.LackCoreCountOrThreadPerCore" -// INVALIDPARAMETER_PASSWORDNOTSUPPORTED = "InvalidParameter.PasswordNotSupported" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" -// INVALIDPARAMETERVALUE_CORECOUNTVALUE = "InvalidParameterValue.CoreCountValue" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" -// INVALIDPARAMETERVALUE_INSTANCETYPEREQUIREDHPCCLUSTER = "InvalidParameterValue.InstanceTypeRequiredHpcCluster" -// INVALIDPARAMETERVALUE_INSUFFICIENTOFFERING = "InvalidParameterValue.InsufficientOffering" -// INVALIDPARAMETERVALUE_INSUFFICIENTPRICE = "InvalidParameterValue.InsufficientPrice" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORGIVENINSTANCETYPE = "InvalidParameterValue.InvalidImageForGivenInstanceType" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateDescription" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATENAME = "InvalidParameterValue.InvalidLaunchTemplateName" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEVERSIONDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateVersionDescription" -// INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" -// INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_SUBNETNOTEXIST = "InvalidParameterValue.SubnetNotExist" -// INVALIDPARAMETERVALUE_THREADPERCOREVALUE = "InvalidParameterValue.ThreadPerCoreValue" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDNOTEXIST = "InvalidParameterValue.VpcIdNotExist" -// INVALIDPARAMETERVALUE_VPCIDZONEIDNOTMATCH = "InvalidParameterValue.VpcIdZoneIdNotMatch" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPASSWORD = "InvalidPassword" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" -// LIMITEXCEEDED_LAUNCHTEMPLATEQUOTA = "LimitExceeded.LaunchTemplateQuota" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" -// LIMITEXCEEDED_USERSPOTQUOTA = "LimitExceeded.UserSpotQuota" -// LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_DPDKINSTANCETYPEREQUIREDVPC = "MissingParameter.DPDKInstanceTypeRequiredVPC" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// RESOURCEINSUFFICIENT_AVAILABILITYZONESOLDOUT = "ResourceInsufficient.AvailabilityZoneSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" -// RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_EIPINSUFFICIENT = "ResourcesSoldOut.EipInsufficient" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_NOTSUPPORTIMPORTINSTANCESACTIONTIMER = "UnsupportedOperation.NotSupportImportInstancesActionTimer" -// UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) CreateLaunchTemplateWithContext(ctx context.Context, request *CreateLaunchTemplateRequest) (response *CreateLaunchTemplateResponse, err error) { - if request == nil { - request = NewCreateLaunchTemplateRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateLaunchTemplate require credential") - } - - request.SetContext(ctx) - - response = NewCreateLaunchTemplateResponse() - err = c.Send(request, response) - return -} - -func NewCreateLaunchTemplateVersionRequest() (request *CreateLaunchTemplateVersionRequest) { - request = &CreateLaunchTemplateVersionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "CreateLaunchTemplateVersion") - - return -} - -func NewCreateLaunchTemplateVersionResponse() (response *CreateLaunchTemplateVersionResponse) { - response = &CreateLaunchTemplateVersionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateLaunchTemplateVersion -// 本接口(CreateLaunchTemplateVersion)根据指定的实例模板ID以及对应的模板版本号创建新的实例启动模板,若未指定模板版本号则使用默认版本号。每个实例启动模板最多创建30个版本。 -// -// 可能返回的错误码: -// -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INVALIDIPFORMAT = "InvalidParameter.InvalidIpFormat" -// INVALIDPARAMETER_PASSWORDNOTSUPPORTED = "InvalidParameter.PasswordNotSupported" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEVERSIONDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateVersionDescription" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_SUBNETNOTEXIST = "InvalidParameterValue.SubnetNotExist" -// INVALIDPARAMETERVALUE_THREADPERCOREVALUE = "InvalidParameterValue.ThreadPerCoreValue" -// INVALIDPARAMETERVALUE_VPCIDZONEIDNOTMATCH = "InvalidParameterValue.VpcIdZoneIdNotMatch" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPASSWORD = "InvalidPassword" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" -// LIMITEXCEEDED_LAUNCHTEMPLATEQUOTA = "LimitExceeded.LaunchTemplateQuota" -// LIMITEXCEEDED_LAUNCHTEMPLATEVERSIONQUOTA = "LimitExceeded.LaunchTemplateVersionQuota" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" -// LIMITEXCEEDED_USERSPOTQUOTA = "LimitExceeded.UserSpotQuota" -// LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_DPDKINSTANCETYPEREQUIREDVPC = "MissingParameter.DPDKInstanceTypeRequiredVPC" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" -// RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_EIPINSUFFICIENT = "ResourcesSoldOut.EipInsufficient" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) CreateLaunchTemplateVersion(request *CreateLaunchTemplateVersionRequest) (response *CreateLaunchTemplateVersionResponse, err error) { - return c.CreateLaunchTemplateVersionWithContext(context.Background(), request) -} - -// CreateLaunchTemplateVersion -// 本接口(CreateLaunchTemplateVersion)根据指定的实例模板ID以及对应的模板版本号创建新的实例启动模板,若未指定模板版本号则使用默认版本号。每个实例启动模板最多创建30个版本。 -// -// 可能返回的错误码: -// -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INVALIDIPFORMAT = "InvalidParameter.InvalidIpFormat" -// INVALIDPARAMETER_PASSWORDNOTSUPPORTED = "InvalidParameter.PasswordNotSupported" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEVERSIONDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateVersionDescription" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_SUBNETNOTEXIST = "InvalidParameterValue.SubnetNotExist" -// INVALIDPARAMETERVALUE_THREADPERCOREVALUE = "InvalidParameterValue.ThreadPerCoreValue" -// INVALIDPARAMETERVALUE_VPCIDZONEIDNOTMATCH = "InvalidParameterValue.VpcIdZoneIdNotMatch" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPASSWORD = "InvalidPassword" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" -// LIMITEXCEEDED_LAUNCHTEMPLATEQUOTA = "LimitExceeded.LaunchTemplateQuota" -// LIMITEXCEEDED_LAUNCHTEMPLATEVERSIONQUOTA = "LimitExceeded.LaunchTemplateVersionQuota" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" -// LIMITEXCEEDED_USERSPOTQUOTA = "LimitExceeded.UserSpotQuota" -// LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_DPDKINSTANCETYPEREQUIREDVPC = "MissingParameter.DPDKInstanceTypeRequiredVPC" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" -// RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_EIPINSUFFICIENT = "ResourcesSoldOut.EipInsufficient" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) CreateLaunchTemplateVersionWithContext(ctx context.Context, request *CreateLaunchTemplateVersionRequest) (response *CreateLaunchTemplateVersionResponse, err error) { - if request == nil { - request = NewCreateLaunchTemplateVersionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateLaunchTemplateVersion require credential") - } - - request.SetContext(ctx) - - response = NewCreateLaunchTemplateVersionResponse() - err = c.Send(request, response) - return -} - -func NewDeleteDisasterRecoverGroupsRequest() (request *DeleteDisasterRecoverGroupsRequest) { - request = &DeleteDisasterRecoverGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DeleteDisasterRecoverGroups") - - return -} - -func NewDeleteDisasterRecoverGroupsResponse() (response *DeleteDisasterRecoverGroupsResponse) { - response = &DeleteDisasterRecoverGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteDisasterRecoverGroups -// 本接口 (DeleteDisasterRecoverGroups)用于删除[分散置放群组](https://cloud.tencent.com/document/product/213/15486)。只有空的置放群组才能被删除,非空的群组需要先销毁组内所有云服务器,才能执行删除操作,不然会产生删除置放群组失败的错误。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_PLACEMENTSETNOTEMPTY = "FailedOperation.PlacementSetNotEmpty" -// INVALIDPARAMETERVALUE_DISASTERRECOVERGROUPIDMALFORMED = "InvalidParameterValue.DisasterRecoverGroupIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCENOTFOUND_INVALIDPLACEMENTSET = "ResourceNotFound.InvalidPlacementSet" -func (c *Client) DeleteDisasterRecoverGroups(request *DeleteDisasterRecoverGroupsRequest) (response *DeleteDisasterRecoverGroupsResponse, err error) { - return c.DeleteDisasterRecoverGroupsWithContext(context.Background(), request) -} - -// DeleteDisasterRecoverGroups -// 本接口 (DeleteDisasterRecoverGroups)用于删除[分散置放群组](https://cloud.tencent.com/document/product/213/15486)。只有空的置放群组才能被删除,非空的群组需要先销毁组内所有云服务器,才能执行删除操作,不然会产生删除置放群组失败的错误。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_PLACEMENTSETNOTEMPTY = "FailedOperation.PlacementSetNotEmpty" -// INVALIDPARAMETERVALUE_DISASTERRECOVERGROUPIDMALFORMED = "InvalidParameterValue.DisasterRecoverGroupIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCENOTFOUND_INVALIDPLACEMENTSET = "ResourceNotFound.InvalidPlacementSet" -func (c *Client) DeleteDisasterRecoverGroupsWithContext(ctx context.Context, request *DeleteDisasterRecoverGroupsRequest) (response *DeleteDisasterRecoverGroupsResponse, err error) { - if request == nil { - request = NewDeleteDisasterRecoverGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteDisasterRecoverGroups require credential") - } - - request.SetContext(ctx) - - response = NewDeleteDisasterRecoverGroupsResponse() - err = c.Send(request, response) - return -} - -func NewDeleteHpcClustersRequest() (request *DeleteHpcClustersRequest) { - request = &DeleteHpcClustersRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DeleteHpcClusters") - - return -} - -func NewDeleteHpcClustersResponse() (response *DeleteHpcClustersResponse) { - response = &DeleteHpcClustersResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteHpcClusters -// 当高性能计算集群为空, 即集群内没有任何设备时候, 可以删除该集群。 -// -// 可能返回的错误码: -// -// RESOURCEINUSE_HPCCLUSTER = "ResourceInUse.HpcCluster" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -func (c *Client) DeleteHpcClusters(request *DeleteHpcClustersRequest) (response *DeleteHpcClustersResponse, err error) { - return c.DeleteHpcClustersWithContext(context.Background(), request) -} - -// DeleteHpcClusters -// 当高性能计算集群为空, 即集群内没有任何设备时候, 可以删除该集群。 -// -// 可能返回的错误码: -// -// RESOURCEINUSE_HPCCLUSTER = "ResourceInUse.HpcCluster" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -func (c *Client) DeleteHpcClustersWithContext(ctx context.Context, request *DeleteHpcClustersRequest) (response *DeleteHpcClustersResponse, err error) { - if request == nil { - request = NewDeleteHpcClustersRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteHpcClusters require credential") - } - - request.SetContext(ctx) - - response = NewDeleteHpcClustersResponse() - err = c.Send(request, response) - return -} - -func NewDeleteImagesRequest() (request *DeleteImagesRequest) { - request = &DeleteImagesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DeleteImages") - - return -} - -func NewDeleteImagesResponse() (response *DeleteImagesResponse) { - response = &DeleteImagesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteImages -// 本接口(DeleteImages)用于删除一个或多个镜像。 -// -// * 当[镜像状态](https://cloud.tencent.com/document/product/213/15753#Image)为`创建中`和`使用中`时, 不允许删除。镜像状态可以通过[DescribeImages](https://cloud.tencent.com/document/api/213/9418)获取。 -// -// * 每个地域最多只支持创建10个自定义镜像,删除镜像可以释放账户的配额。 -// -// * 当镜像正在被其它账户分享时,不允许删除。 -// -// 可能返回的错误码: -// -// INVALIDIMAGEID_INSHARED = "InvalidImageId.InShared" -// INVALIDIMAGEID_INCORRECTSTATE = "InvalidImageId.IncorrectState" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEIDISSHARED = "InvalidParameterValue.InvalidImageIdIsShared" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -func (c *Client) DeleteImages(request *DeleteImagesRequest) (response *DeleteImagesResponse, err error) { - return c.DeleteImagesWithContext(context.Background(), request) -} - -// DeleteImages -// 本接口(DeleteImages)用于删除一个或多个镜像。 -// -// * 当[镜像状态](https://cloud.tencent.com/document/product/213/15753#Image)为`创建中`和`使用中`时, 不允许删除。镜像状态可以通过[DescribeImages](https://cloud.tencent.com/document/api/213/9418)获取。 -// -// * 每个地域最多只支持创建10个自定义镜像,删除镜像可以释放账户的配额。 -// -// * 当镜像正在被其它账户分享时,不允许删除。 -// -// 可能返回的错误码: -// -// INVALIDIMAGEID_INSHARED = "InvalidImageId.InShared" -// INVALIDIMAGEID_INCORRECTSTATE = "InvalidImageId.IncorrectState" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEIDISSHARED = "InvalidParameterValue.InvalidImageIdIsShared" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -func (c *Client) DeleteImagesWithContext(ctx context.Context, request *DeleteImagesRequest) (response *DeleteImagesResponse, err error) { - if request == nil { - request = NewDeleteImagesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteImages require credential") - } - - request.SetContext(ctx) - - response = NewDeleteImagesResponse() - err = c.Send(request, response) - return -} - -func NewDeleteKeyPairsRequest() (request *DeleteKeyPairsRequest) { - request = &DeleteKeyPairsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DeleteKeyPairs") - - return -} - -func NewDeleteKeyPairsResponse() (response *DeleteKeyPairsResponse) { - response = &DeleteKeyPairsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteKeyPairs -// 本接口 (DeleteKeyPairs) 用于删除已在腾讯云托管的密钥对。 -// -// * 可以同时删除多个密钥对。 -// -// * 不能删除已被实例或镜像引用的密钥对,所以需要独立判断是否所有密钥对都被成功删除。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_KEYPAIRNOTSUPPORTED = "InvalidParameterValue.KeyPairNotSupported" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DeleteKeyPairs(request *DeleteKeyPairsRequest) (response *DeleteKeyPairsResponse, err error) { - return c.DeleteKeyPairsWithContext(context.Background(), request) -} - -// DeleteKeyPairs -// 本接口 (DeleteKeyPairs) 用于删除已在腾讯云托管的密钥对。 -// -// * 可以同时删除多个密钥对。 -// -// * 不能删除已被实例或镜像引用的密钥对,所以需要独立判断是否所有密钥对都被成功删除。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_KEYPAIRNOTSUPPORTED = "InvalidParameterValue.KeyPairNotSupported" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DeleteKeyPairsWithContext(ctx context.Context, request *DeleteKeyPairsRequest) (response *DeleteKeyPairsResponse, err error) { - if request == nil { - request = NewDeleteKeyPairsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteKeyPairs require credential") - } - - request.SetContext(ctx) - - response = NewDeleteKeyPairsResponse() - err = c.Send(request, response) - return -} - -func NewDeleteLaunchTemplateRequest() (request *DeleteLaunchTemplateRequest) { - request = &DeleteLaunchTemplateRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DeleteLaunchTemplate") - - return -} - -func NewDeleteLaunchTemplateResponse() (response *DeleteLaunchTemplateResponse) { - response = &DeleteLaunchTemplateResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteLaunchTemplate -// 本接口(DeleteLaunchTemplate)用于删除一个实例启动模板。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -func (c *Client) DeleteLaunchTemplate(request *DeleteLaunchTemplateRequest) (response *DeleteLaunchTemplateResponse, err error) { - return c.DeleteLaunchTemplateWithContext(context.Background(), request) -} - -// DeleteLaunchTemplate -// 本接口(DeleteLaunchTemplate)用于删除一个实例启动模板。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -func (c *Client) DeleteLaunchTemplateWithContext(ctx context.Context, request *DeleteLaunchTemplateRequest) (response *DeleteLaunchTemplateResponse, err error) { - if request == nil { - request = NewDeleteLaunchTemplateRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteLaunchTemplate require credential") - } - - request.SetContext(ctx) - - response = NewDeleteLaunchTemplateResponse() - err = c.Send(request, response) - return -} - -func NewDeleteLaunchTemplateVersionsRequest() (request *DeleteLaunchTemplateVersionsRequest) { - request = &DeleteLaunchTemplateVersionsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DeleteLaunchTemplateVersions") - - return -} - -func NewDeleteLaunchTemplateVersionsResponse() (response *DeleteLaunchTemplateVersionsResponse) { - response = &DeleteLaunchTemplateVersionsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteLaunchTemplateVersions -// 本接口(DeleteLaunchTemplateVersions)用于删除一个或者多个实例启动模板版本。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEDEFAULTVERSION = "InvalidParameterValue.LaunchTemplateDefaultVersion" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// MISSINGPARAMETER = "MissingParameter" -// UNKNOWNPARAMETER = "UnknownParameter" -func (c *Client) DeleteLaunchTemplateVersions(request *DeleteLaunchTemplateVersionsRequest) (response *DeleteLaunchTemplateVersionsResponse, err error) { - return c.DeleteLaunchTemplateVersionsWithContext(context.Background(), request) -} - -// DeleteLaunchTemplateVersions -// 本接口(DeleteLaunchTemplateVersions)用于删除一个或者多个实例启动模板版本。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEDEFAULTVERSION = "InvalidParameterValue.LaunchTemplateDefaultVersion" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// MISSINGPARAMETER = "MissingParameter" -// UNKNOWNPARAMETER = "UnknownParameter" -func (c *Client) DeleteLaunchTemplateVersionsWithContext(ctx context.Context, request *DeleteLaunchTemplateVersionsRequest) (response *DeleteLaunchTemplateVersionsResponse, err error) { - if request == nil { - request = NewDeleteLaunchTemplateVersionsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteLaunchTemplateVersions require credential") - } - - request.SetContext(ctx) - - response = NewDeleteLaunchTemplateVersionsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeAccountQuotaRequest() (request *DescribeAccountQuotaRequest) { - request = &DescribeAccountQuotaRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeAccountQuota") - - return -} - -func NewDescribeAccountQuotaResponse() (response *DescribeAccountQuotaResponse) { - response = &DescribeAccountQuotaResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeAccountQuota -// 本接口(DescribeAccountQuota)用于查询用户配额详情。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeAccountQuota(request *DescribeAccountQuotaRequest) (response *DescribeAccountQuotaResponse, err error) { - return c.DescribeAccountQuotaWithContext(context.Background(), request) -} - -// DescribeAccountQuota -// 本接口(DescribeAccountQuota)用于查询用户配额详情。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeAccountQuotaWithContext(ctx context.Context, request *DescribeAccountQuotaRequest) (response *DescribeAccountQuotaResponse, err error) { - if request == nil { - request = NewDescribeAccountQuotaRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeAccountQuota require credential") - } - - request.SetContext(ctx) - - response = NewDescribeAccountQuotaResponse() - err = c.Send(request, response) - return -} - -func NewDescribeChcDeniedActionsRequest() (request *DescribeChcDeniedActionsRequest) { - request = &DescribeChcDeniedActionsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeChcDeniedActions") - - return -} - -func NewDescribeChcDeniedActionsResponse() (response *DescribeChcDeniedActionsResponse) { - response = &DescribeChcDeniedActionsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeChcDeniedActions -// 查询CHC物理服务器禁止做的操作,返回给用户 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -func (c *Client) DescribeChcDeniedActions(request *DescribeChcDeniedActionsRequest) (response *DescribeChcDeniedActionsResponse, err error) { - return c.DescribeChcDeniedActionsWithContext(context.Background(), request) -} - -// DescribeChcDeniedActions -// 查询CHC物理服务器禁止做的操作,返回给用户 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -func (c *Client) DescribeChcDeniedActionsWithContext(ctx context.Context, request *DescribeChcDeniedActionsRequest) (response *DescribeChcDeniedActionsResponse, err error) { - if request == nil { - request = NewDescribeChcDeniedActionsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeChcDeniedActions require credential") - } - - request.SetContext(ctx) - - response = NewDescribeChcDeniedActionsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeChcHostsRequest() (request *DescribeChcHostsRequest) { - request = &DescribeChcHostsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeChcHosts") - - return -} - -func NewDescribeChcHostsResponse() (response *DescribeChcHostsResponse) { - response = &DescribeChcHostsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeChcHosts -// 本接口 (DescribeChcHosts) 用于查询一个或多个CHC物理服务器详细信息。 -// -// * 可以根据实例`ID`、实例名称或者设备类型等信息来查询实例的详细信息。过滤信息详细请见过滤器`Filter`。 -// -// * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的实例。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDPARAMETER_ATMOSTONE = "InvalidParameter.AtMostOne" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_NOTEMPTY = "InvalidParameterValue.NotEmpty" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDPARAMETERVALUELIMIT = "InvalidParameterValueLimit" -// INVALIDPARAMETERVALUEOFFSET = "InvalidParameterValueOffset" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeChcHosts(request *DescribeChcHostsRequest) (response *DescribeChcHostsResponse, err error) { - return c.DescribeChcHostsWithContext(context.Background(), request) -} - -// DescribeChcHosts -// 本接口 (DescribeChcHosts) 用于查询一个或多个CHC物理服务器详细信息。 -// -// * 可以根据实例`ID`、实例名称或者设备类型等信息来查询实例的详细信息。过滤信息详细请见过滤器`Filter`。 -// -// * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的实例。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDPARAMETER_ATMOSTONE = "InvalidParameter.AtMostOne" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_NOTEMPTY = "InvalidParameterValue.NotEmpty" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDPARAMETERVALUELIMIT = "InvalidParameterValueLimit" -// INVALIDPARAMETERVALUEOFFSET = "InvalidParameterValueOffset" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeChcHostsWithContext(ctx context.Context, request *DescribeChcHostsRequest) (response *DescribeChcHostsResponse, err error) { - if request == nil { - request = NewDescribeChcHostsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeChcHosts require credential") - } - - request.SetContext(ctx) - - response = NewDescribeChcHostsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeDisasterRecoverGroupQuotaRequest() (request *DescribeDisasterRecoverGroupQuotaRequest) { - request = &DescribeDisasterRecoverGroupQuotaRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeDisasterRecoverGroupQuota") - - return -} - -func NewDescribeDisasterRecoverGroupQuotaResponse() (response *DescribeDisasterRecoverGroupQuotaResponse) { - response = &DescribeDisasterRecoverGroupQuotaResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeDisasterRecoverGroupQuota -// 本接口 (DescribeDisasterRecoverGroupQuota)用于查询[分散置放群组](https://cloud.tencent.com/document/product/213/15486)配额。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDPARAMETER_ATMOSTONE = "InvalidParameter.AtMostOne" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_NOTEMPTY = "InvalidParameterValue.NotEmpty" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDPARAMETERVALUELIMIT = "InvalidParameterValueLimit" -// INVALIDPARAMETERVALUEOFFSET = "InvalidParameterValueOffset" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeDisasterRecoverGroupQuota(request *DescribeDisasterRecoverGroupQuotaRequest) (response *DescribeDisasterRecoverGroupQuotaResponse, err error) { - return c.DescribeDisasterRecoverGroupQuotaWithContext(context.Background(), request) -} - -// DescribeDisasterRecoverGroupQuota -// 本接口 (DescribeDisasterRecoverGroupQuota)用于查询[分散置放群组](https://cloud.tencent.com/document/product/213/15486)配额。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDPARAMETER_ATMOSTONE = "InvalidParameter.AtMostOne" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_NOTEMPTY = "InvalidParameterValue.NotEmpty" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDPARAMETERVALUELIMIT = "InvalidParameterValueLimit" -// INVALIDPARAMETERVALUEOFFSET = "InvalidParameterValueOffset" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeDisasterRecoverGroupQuotaWithContext(ctx context.Context, request *DescribeDisasterRecoverGroupQuotaRequest) (response *DescribeDisasterRecoverGroupQuotaResponse, err error) { - if request == nil { - request = NewDescribeDisasterRecoverGroupQuotaRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeDisasterRecoverGroupQuota require credential") - } - - request.SetContext(ctx) - - response = NewDescribeDisasterRecoverGroupQuotaResponse() - err = c.Send(request, response) - return -} - -func NewDescribeDisasterRecoverGroupsRequest() (request *DescribeDisasterRecoverGroupsRequest) { - request = &DescribeDisasterRecoverGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeDisasterRecoverGroups") - - return -} - -func NewDescribeDisasterRecoverGroupsResponse() (response *DescribeDisasterRecoverGroupsResponse) { - response = &DescribeDisasterRecoverGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeDisasterRecoverGroups -// 本接口 (DescribeDisasterRecoverGroups)用于查询[分散置放群组](https://cloud.tencent.com/document/product/213/15486)信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DISASTERRECOVERGROUPIDMALFORMED = "InvalidParameterValue.DisasterRecoverGroupIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -func (c *Client) DescribeDisasterRecoverGroups(request *DescribeDisasterRecoverGroupsRequest) (response *DescribeDisasterRecoverGroupsResponse, err error) { - return c.DescribeDisasterRecoverGroupsWithContext(context.Background(), request) -} - -// DescribeDisasterRecoverGroups -// 本接口 (DescribeDisasterRecoverGroups)用于查询[分散置放群组](https://cloud.tencent.com/document/product/213/15486)信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DISASTERRECOVERGROUPIDMALFORMED = "InvalidParameterValue.DisasterRecoverGroupIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -func (c *Client) DescribeDisasterRecoverGroupsWithContext(ctx context.Context, request *DescribeDisasterRecoverGroupsRequest) (response *DescribeDisasterRecoverGroupsResponse, err error) { - if request == nil { - request = NewDescribeDisasterRecoverGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeDisasterRecoverGroups require credential") - } - - request.SetContext(ctx) - - response = NewDescribeDisasterRecoverGroupsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeHostsRequest() (request *DescribeHostsRequest) { - request = &DescribeHostsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeHosts") - - return -} - -func NewDescribeHostsResponse() (response *DescribeHostsResponse) { - response = &DescribeHostsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeHosts -// 本接口 (DescribeHosts) 用于获取一个或多个CDH实例的详细信息。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeHosts(request *DescribeHostsRequest) (response *DescribeHostsResponse, err error) { - return c.DescribeHostsWithContext(context.Background(), request) -} - -// DescribeHosts -// 本接口 (DescribeHosts) 用于获取一个或多个CDH实例的详细信息。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeHostsWithContext(ctx context.Context, request *DescribeHostsRequest) (response *DescribeHostsResponse, err error) { - if request == nil { - request = NewDescribeHostsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeHosts require credential") - } - - request.SetContext(ctx) - - response = NewDescribeHostsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeHpcClustersRequest() (request *DescribeHpcClustersRequest) { - request = &DescribeHpcClustersRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeHpcClusters") - - return -} - -func NewDescribeHpcClustersResponse() (response *DescribeHpcClustersResponse) { - response = &DescribeHpcClustersResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeHpcClusters -// 查询高性能集群信息 -// -// 可能返回的错误码: -// -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNSUPPORTEDOPERATION_INVALIDZONE = "UnsupportedOperation.InvalidZone" -func (c *Client) DescribeHpcClusters(request *DescribeHpcClustersRequest) (response *DescribeHpcClustersResponse, err error) { - return c.DescribeHpcClustersWithContext(context.Background(), request) -} - -// DescribeHpcClusters -// 查询高性能集群信息 -// -// 可能返回的错误码: -// -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNSUPPORTEDOPERATION_INVALIDZONE = "UnsupportedOperation.InvalidZone" -func (c *Client) DescribeHpcClustersWithContext(ctx context.Context, request *DescribeHpcClustersRequest) (response *DescribeHpcClustersResponse, err error) { - if request == nil { - request = NewDescribeHpcClustersRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeHpcClusters require credential") - } - - request.SetContext(ctx) - - response = NewDescribeHpcClustersResponse() - err = c.Send(request, response) - return -} - -func NewDescribeImageQuotaRequest() (request *DescribeImageQuotaRequest) { - request = &DescribeImageQuotaRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeImageQuota") - - return -} - -func NewDescribeImageQuotaResponse() (response *DescribeImageQuotaResponse) { - response = &DescribeImageQuotaResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeImageQuota -// 本接口(DescribeImageQuota)用于查询用户账号的镜像配额。 -// -// 可能返回的错误码: -// -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNSUPPORTEDOPERATION_INVALIDZONE = "UnsupportedOperation.InvalidZone" -func (c *Client) DescribeImageQuota(request *DescribeImageQuotaRequest) (response *DescribeImageQuotaResponse, err error) { - return c.DescribeImageQuotaWithContext(context.Background(), request) -} - -// DescribeImageQuota -// 本接口(DescribeImageQuota)用于查询用户账号的镜像配额。 -// -// 可能返回的错误码: -// -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNSUPPORTEDOPERATION_INVALIDZONE = "UnsupportedOperation.InvalidZone" -func (c *Client) DescribeImageQuotaWithContext(ctx context.Context, request *DescribeImageQuotaRequest) (response *DescribeImageQuotaResponse, err error) { - if request == nil { - request = NewDescribeImageQuotaRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeImageQuota require credential") - } - - request.SetContext(ctx) - - response = NewDescribeImageQuotaResponse() - err = c.Send(request, response) - return -} - -func NewDescribeImageSharePermissionRequest() (request *DescribeImageSharePermissionRequest) { - request = &DescribeImageSharePermissionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeImageSharePermission") - - return -} - -func NewDescribeImageSharePermissionResponse() (response *DescribeImageSharePermissionResponse) { - response = &DescribeImageSharePermissionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeImageSharePermission -// 本接口(DescribeImageSharePermission)用于查询镜像分享信息。 -// -// 可能返回的错误码: -// -// INVALIDACCOUNTID_NOTFOUND = "InvalidAccountId.NotFound" -// INVALIDACCOUNTIS_YOURSELF = "InvalidAccountIs.YourSelf" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// OVERQUOTA = "OverQuota" -// UNAUTHORIZEDOPERATION_IMAGENOTBELONGTOACCOUNT = "UnauthorizedOperation.ImageNotBelongToAccount" -func (c *Client) DescribeImageSharePermission(request *DescribeImageSharePermissionRequest) (response *DescribeImageSharePermissionResponse, err error) { - return c.DescribeImageSharePermissionWithContext(context.Background(), request) -} - -// DescribeImageSharePermission -// 本接口(DescribeImageSharePermission)用于查询镜像分享信息。 -// -// 可能返回的错误码: -// -// INVALIDACCOUNTID_NOTFOUND = "InvalidAccountId.NotFound" -// INVALIDACCOUNTIS_YOURSELF = "InvalidAccountIs.YourSelf" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// OVERQUOTA = "OverQuota" -// UNAUTHORIZEDOPERATION_IMAGENOTBELONGTOACCOUNT = "UnauthorizedOperation.ImageNotBelongToAccount" -func (c *Client) DescribeImageSharePermissionWithContext(ctx context.Context, request *DescribeImageSharePermissionRequest) (response *DescribeImageSharePermissionResponse, err error) { - if request == nil { - request = NewDescribeImageSharePermissionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeImageSharePermission require credential") - } - - request.SetContext(ctx) - - response = NewDescribeImageSharePermissionResponse() - err = c.Send(request, response) - return -} - -func NewDescribeImagesRequest() (request *DescribeImagesRequest) { - request = &DescribeImagesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeImages") - - return -} - -func NewDescribeImagesResponse() (response *DescribeImagesResponse) { - response = &DescribeImagesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeImages -// 本接口(DescribeImages) 用于查看镜像列表。 -// -// * 可以通过指定镜像ID来查询指定镜像的详细信息,或通过设定过滤器来查询满足过滤条件的镜像的详细信息。 -// -// * 指定偏移(Offset)和限制(Limit)来选择结果中的一部分,默认返回满足条件的前20个镜像信息。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INVALIDPARAMETERCOEXISTIMAGEIDSFILTERS = "InvalidParameter.InvalidParameterCoexistImageIdsFilters" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_PERMISSIONDENIED = "UnauthorizedOperation.PermissionDenied" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeImages(request *DescribeImagesRequest) (response *DescribeImagesResponse, err error) { - return c.DescribeImagesWithContext(context.Background(), request) -} - -// DescribeImages -// 本接口(DescribeImages) 用于查看镜像列表。 -// -// * 可以通过指定镜像ID来查询指定镜像的详细信息,或通过设定过滤器来查询满足过滤条件的镜像的详细信息。 -// -// * 指定偏移(Offset)和限制(Limit)来选择结果中的一部分,默认返回满足条件的前20个镜像信息。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INVALIDPARAMETERCOEXISTIMAGEIDSFILTERS = "InvalidParameter.InvalidParameterCoexistImageIdsFilters" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_PERMISSIONDENIED = "UnauthorizedOperation.PermissionDenied" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeImagesWithContext(ctx context.Context, request *DescribeImagesRequest) (response *DescribeImagesResponse, err error) { - if request == nil { - request = NewDescribeImagesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeImages require credential") - } - - request.SetContext(ctx) - - response = NewDescribeImagesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeImportImageOsRequest() (request *DescribeImportImageOsRequest) { - request = &DescribeImportImageOsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeImportImageOs") - - return -} - -func NewDescribeImportImageOsResponse() (response *DescribeImportImageOsResponse) { - response = &DescribeImportImageOsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeImportImageOs -// 查看可以导入的镜像操作系统信息。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INVALIDPARAMETERCOEXISTIMAGEIDSFILTERS = "InvalidParameter.InvalidParameterCoexistImageIdsFilters" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_PERMISSIONDENIED = "UnauthorizedOperation.PermissionDenied" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeImportImageOs(request *DescribeImportImageOsRequest) (response *DescribeImportImageOsResponse, err error) { - return c.DescribeImportImageOsWithContext(context.Background(), request) -} - -// DescribeImportImageOs -// 查看可以导入的镜像操作系统信息。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INVALIDPARAMETERCOEXISTIMAGEIDSFILTERS = "InvalidParameter.InvalidParameterCoexistImageIdsFilters" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_PERMISSIONDENIED = "UnauthorizedOperation.PermissionDenied" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeImportImageOsWithContext(ctx context.Context, request *DescribeImportImageOsRequest) (response *DescribeImportImageOsResponse, err error) { - if request == nil { - request = NewDescribeImportImageOsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeImportImageOs require credential") - } - - request.SetContext(ctx) - - response = NewDescribeImportImageOsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInstanceFamilyConfigsRequest() (request *DescribeInstanceFamilyConfigsRequest) { - request = &DescribeInstanceFamilyConfigsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstanceFamilyConfigs") - - return -} - -func NewDescribeInstanceFamilyConfigsResponse() (response *DescribeInstanceFamilyConfigsResponse) { - response = &DescribeInstanceFamilyConfigsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInstanceFamilyConfigs -// 本接口(DescribeInstanceFamilyConfigs)查询当前用户和地域所支持的机型族列表信息。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -func (c *Client) DescribeInstanceFamilyConfigs(request *DescribeInstanceFamilyConfigsRequest) (response *DescribeInstanceFamilyConfigsResponse, err error) { - return c.DescribeInstanceFamilyConfigsWithContext(context.Background(), request) -} - -// DescribeInstanceFamilyConfigs -// 本接口(DescribeInstanceFamilyConfigs)查询当前用户和地域所支持的机型族列表信息。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -func (c *Client) DescribeInstanceFamilyConfigsWithContext(ctx context.Context, request *DescribeInstanceFamilyConfigsRequest) (response *DescribeInstanceFamilyConfigsResponse, err error) { - if request == nil { - request = NewDescribeInstanceFamilyConfigsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInstanceFamilyConfigs require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInstanceFamilyConfigsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInstanceInternetBandwidthConfigsRequest() (request *DescribeInstanceInternetBandwidthConfigsRequest) { - request = &DescribeInstanceInternetBandwidthConfigsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstanceInternetBandwidthConfigs") - - return -} - -func NewDescribeInstanceInternetBandwidthConfigsResponse() (response *DescribeInstanceInternetBandwidthConfigsResponse) { - response = &DescribeInstanceInternetBandwidthConfigsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInstanceInternetBandwidthConfigs -// 本接口 (DescribeInstanceInternetBandwidthConfigs) 用于查询实例带宽配置。 -// -// * 只支持查询`BANDWIDTH_PREPAID`( 预付费按带宽结算 )计费模式的带宽配置。 -// -// * 接口返回实例的所有带宽配置信息(包含历史的带宽配置信息)。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NOTFOUNDEIP = "FailedOperation.NotFoundEIP" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeInstanceInternetBandwidthConfigs(request *DescribeInstanceInternetBandwidthConfigsRequest) (response *DescribeInstanceInternetBandwidthConfigsResponse, err error) { - return c.DescribeInstanceInternetBandwidthConfigsWithContext(context.Background(), request) -} - -// DescribeInstanceInternetBandwidthConfigs -// 本接口 (DescribeInstanceInternetBandwidthConfigs) 用于查询实例带宽配置。 -// -// * 只支持查询`BANDWIDTH_PREPAID`( 预付费按带宽结算 )计费模式的带宽配置。 -// -// * 接口返回实例的所有带宽配置信息(包含历史的带宽配置信息)。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NOTFOUNDEIP = "FailedOperation.NotFoundEIP" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeInstanceInternetBandwidthConfigsWithContext(ctx context.Context, request *DescribeInstanceInternetBandwidthConfigsRequest) (response *DescribeInstanceInternetBandwidthConfigsResponse, err error) { - if request == nil { - request = NewDescribeInstanceInternetBandwidthConfigsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInstanceInternetBandwidthConfigs require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInstanceInternetBandwidthConfigsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInstanceTypeConfigsRequest() (request *DescribeInstanceTypeConfigsRequest) { - request = &DescribeInstanceTypeConfigsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstanceTypeConfigs") - - return -} - -func NewDescribeInstanceTypeConfigsResponse() (response *DescribeInstanceTypeConfigsResponse) { - response = &DescribeInstanceTypeConfigsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInstanceTypeConfigs -// 本接口 (DescribeInstanceTypeConfigs) 用于查询实例机型配置。 -// -// * 可以根据`zone`、`instance-family`、`instance-type`来查询实例机型配置。过滤条件详见过滤器[`Filter`](https://cloud.tencent.com/document/api/213/15753#Filter)。 -// -// * 如果参数为空,返回指定地域的所有实例机型配置。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeInstanceTypeConfigs(request *DescribeInstanceTypeConfigsRequest) (response *DescribeInstanceTypeConfigsResponse, err error) { - return c.DescribeInstanceTypeConfigsWithContext(context.Background(), request) -} - -// DescribeInstanceTypeConfigs -// 本接口 (DescribeInstanceTypeConfigs) 用于查询实例机型配置。 -// -// * 可以根据`zone`、`instance-family`、`instance-type`来查询实例机型配置。过滤条件详见过滤器[`Filter`](https://cloud.tencent.com/document/api/213/15753#Filter)。 -// -// * 如果参数为空,返回指定地域的所有实例机型配置。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeInstanceTypeConfigsWithContext(ctx context.Context, request *DescribeInstanceTypeConfigsRequest) (response *DescribeInstanceTypeConfigsResponse, err error) { - if request == nil { - request = NewDescribeInstanceTypeConfigsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInstanceTypeConfigs require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInstanceTypeConfigsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInstanceVncUrlRequest() (request *DescribeInstanceVncUrlRequest) { - request = &DescribeInstanceVncUrlRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstanceVncUrl") - - return -} - -func NewDescribeInstanceVncUrlResponse() (response *DescribeInstanceVncUrlResponse) { - response = &DescribeInstanceVncUrlResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInstanceVncUrl -// 本接口 ( DescribeInstanceVncUrl ) 用于查询实例管理终端地址,获取的地址可用于实例的 VNC 登录。 -// -// * 处于 `STOPPED` 状态的机器无法使用此功能。 -// -// * 管理终端地址的有效期为 15 秒,调用接口成功后如果 15 秒内不使用该链接进行访问,管理终端地址自动失效,您需要重新查询。 -// -// * 管理终端地址一旦被访问,将自动失效,您需要重新查询。 -// -// * 如果连接断开,每分钟内重新连接的次数不能超过 30 次。 -// -// 获取到 `InstanceVncUrl` 后,您需要在链接 `https://img.qcloud.com/qcloud/app/active_vnc/index.html?` 末尾加上参数 `InstanceVncUrl=xxxx`。 -// -// - 参数 `InstanceVncUrl` :调用接口成功后会返回的 `InstanceVncUrl` 的值。 -// -// 最后组成的 URL 格式如下: -// -// ``` -// -// https://img.qcloud.com/qcloud/app/active_vnc/index.html?InstanceVncUrl=wss%3A%2F%2Fbjvnc.qcloud.com%3A26789%2Fvnc%3Fs%3DaHpjWnRVMFNhYmxKdDM5MjRHNlVTSVQwajNUSW0wb2tBbmFtREFCTmFrcy8vUUNPMG0wSHZNOUUxRm5PMmUzWmFDcWlOdDJIbUJxSTZDL0RXcHZxYnZZMmRkWWZWcEZia2lyb09XMzdKNmM9 -// -// ``` -// -// 可能返回的错误码: -// -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCESTATE = "InvalidInstanceState" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) DescribeInstanceVncUrl(request *DescribeInstanceVncUrlRequest) (response *DescribeInstanceVncUrlResponse, err error) { - return c.DescribeInstanceVncUrlWithContext(context.Background(), request) -} - -// DescribeInstanceVncUrl -// 本接口 ( DescribeInstanceVncUrl ) 用于查询实例管理终端地址,获取的地址可用于实例的 VNC 登录。 -// -// * 处于 `STOPPED` 状态的机器无法使用此功能。 -// -// * 管理终端地址的有效期为 15 秒,调用接口成功后如果 15 秒内不使用该链接进行访问,管理终端地址自动失效,您需要重新查询。 -// -// * 管理终端地址一旦被访问,将自动失效,您需要重新查询。 -// -// * 如果连接断开,每分钟内重新连接的次数不能超过 30 次。 -// -// 获取到 `InstanceVncUrl` 后,您需要在链接 `https://img.qcloud.com/qcloud/app/active_vnc/index.html?` 末尾加上参数 `InstanceVncUrl=xxxx`。 -// -// - 参数 `InstanceVncUrl` :调用接口成功后会返回的 `InstanceVncUrl` 的值。 -// -// 最后组成的 URL 格式如下: -// -// ``` -// -// https://img.qcloud.com/qcloud/app/active_vnc/index.html?InstanceVncUrl=wss%3A%2F%2Fbjvnc.qcloud.com%3A26789%2Fvnc%3Fs%3DaHpjWnRVMFNhYmxKdDM5MjRHNlVTSVQwajNUSW0wb2tBbmFtREFCTmFrcy8vUUNPMG0wSHZNOUUxRm5PMmUzWmFDcWlOdDJIbUJxSTZDL0RXcHZxYnZZMmRkWWZWcEZia2lyb09XMzdKNmM9 -// -// ``` -// -// 可能返回的错误码: -// -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCESTATE = "InvalidInstanceState" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) DescribeInstanceVncUrlWithContext(ctx context.Context, request *DescribeInstanceVncUrlRequest) (response *DescribeInstanceVncUrlResponse, err error) { - if request == nil { - request = NewDescribeInstanceVncUrlRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInstanceVncUrl require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInstanceVncUrlResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInstancesRequest() (request *DescribeInstancesRequest) { - request = &DescribeInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstances") - - return -} - -func NewDescribeInstancesResponse() (response *DescribeInstancesResponse) { - response = &DescribeInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInstances -// 本接口 (DescribeInstances) 用于查询一个或多个实例的详细信息。 -// -// * 可以根据实例`ID`、实例名称或者实例计费模式等信息来查询实例的详细信息。过滤信息详细请见过滤器`Filter`。 -// -// * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的实例。 -// -// * 支持查询实例的最新操作(LatestOperation)以及最新操作状态(LatestOperationState)。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// FAILEDOPERATION_ILLEGALTAGVALUE = "FailedOperation.IllegalTagValue" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" -// INVALIDPARAMETERVALUE_IPV6ADDRESSMALFORMED = "InvalidParameterValue.IPv6AddressMalformed" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" -// INVALIDPARAMETERVALUE_INVALIDVAGUENAME = "InvalidParameterValue.InvalidVagueName" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_UUIDMALFORMED = "InvalidParameterValue.UuidMalformed" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDSGID_MALFORMED = "InvalidSgId.Malformed" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeInstances(request *DescribeInstancesRequest) (response *DescribeInstancesResponse, err error) { - return c.DescribeInstancesWithContext(context.Background(), request) -} - -// DescribeInstances -// 本接口 (DescribeInstances) 用于查询一个或多个实例的详细信息。 -// -// * 可以根据实例`ID`、实例名称或者实例计费模式等信息来查询实例的详细信息。过滤信息详细请见过滤器`Filter`。 -// -// * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的实例。 -// -// * 支持查询实例的最新操作(LatestOperation)以及最新操作状态(LatestOperationState)。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// FAILEDOPERATION_ILLEGALTAGVALUE = "FailedOperation.IllegalTagValue" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" -// INVALIDPARAMETERVALUE_IPV6ADDRESSMALFORMED = "InvalidParameterValue.IPv6AddressMalformed" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" -// INVALIDPARAMETERVALUE_INVALIDVAGUENAME = "InvalidParameterValue.InvalidVagueName" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_UUIDMALFORMED = "InvalidParameterValue.UuidMalformed" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDSGID_MALFORMED = "InvalidSgId.Malformed" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeInstancesWithContext(ctx context.Context, request *DescribeInstancesRequest) (response *DescribeInstancesResponse, err error) { - if request == nil { - request = NewDescribeInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInstances require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInstancesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInstancesModificationRequest() (request *DescribeInstancesModificationRequest) { - request = &DescribeInstancesModificationRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstancesModification") - - return -} - -func NewDescribeInstancesModificationResponse() (response *DescribeInstancesModificationResponse) { - response = &DescribeInstancesModificationResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInstancesModification -// 本接口 (DescribeInstancesModification) 用于查询指定实例支持调整的机型配置。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceFamily" -func (c *Client) DescribeInstancesModification(request *DescribeInstancesModificationRequest) (response *DescribeInstancesModificationResponse, err error) { - return c.DescribeInstancesModificationWithContext(context.Background(), request) -} - -// DescribeInstancesModification -// 本接口 (DescribeInstancesModification) 用于查询指定实例支持调整的机型配置。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceFamily" -func (c *Client) DescribeInstancesModificationWithContext(ctx context.Context, request *DescribeInstancesModificationRequest) (response *DescribeInstancesModificationResponse, err error) { - if request == nil { - request = NewDescribeInstancesModificationRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInstancesModification require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInstancesModificationResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInstancesOperationLimitRequest() (request *DescribeInstancesOperationLimitRequest) { - request = &DescribeInstancesOperationLimitRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstancesOperationLimit") - - return -} - -func NewDescribeInstancesOperationLimitResponse() (response *DescribeInstancesOperationLimitResponse) { - response = &DescribeInstancesOperationLimitResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInstancesOperationLimit -// 本接口(DescribeInstancesOperationLimit)用于查询实例操作限制。 -// -// * 目前支持调整配置操作限制次数查询。 -// -// 可能返回的错误码: -// -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -func (c *Client) DescribeInstancesOperationLimit(request *DescribeInstancesOperationLimitRequest) (response *DescribeInstancesOperationLimitResponse, err error) { - return c.DescribeInstancesOperationLimitWithContext(context.Background(), request) -} - -// DescribeInstancesOperationLimit -// 本接口(DescribeInstancesOperationLimit)用于查询实例操作限制。 -// -// * 目前支持调整配置操作限制次数查询。 -// -// 可能返回的错误码: -// -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -func (c *Client) DescribeInstancesOperationLimitWithContext(ctx context.Context, request *DescribeInstancesOperationLimitRequest) (response *DescribeInstancesOperationLimitResponse, err error) { - if request == nil { - request = NewDescribeInstancesOperationLimitRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInstancesOperationLimit require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInstancesOperationLimitResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInstancesStatusRequest() (request *DescribeInstancesStatusRequest) { - request = &DescribeInstancesStatusRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstancesStatus") - - return -} - -func NewDescribeInstancesStatusResponse() (response *DescribeInstancesStatusResponse) { - response = &DescribeInstancesStatusResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInstancesStatus -// 本接口 (DescribeInstancesStatus) 用于查询一个或多个实例的状态。 -// -// * 可以根据实例`ID`来查询实例的状态。 -// -// * 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的实例状态。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeInstancesStatus(request *DescribeInstancesStatusRequest) (response *DescribeInstancesStatusResponse, err error) { - return c.DescribeInstancesStatusWithContext(context.Background(), request) -} - -// DescribeInstancesStatus -// 本接口 (DescribeInstancesStatus) 用于查询一个或多个实例的状态。 -// -// * 可以根据实例`ID`来查询实例的状态。 -// -// * 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的实例状态。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeInstancesStatusWithContext(ctx context.Context, request *DescribeInstancesStatusRequest) (response *DescribeInstancesStatusResponse, err error) { - if request == nil { - request = NewDescribeInstancesStatusRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInstancesStatus require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInstancesStatusResponse() - err = c.Send(request, response) - return -} - -func NewDescribeInternetChargeTypeConfigsRequest() (request *DescribeInternetChargeTypeConfigsRequest) { - request = &DescribeInternetChargeTypeConfigsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeInternetChargeTypeConfigs") - - return -} - -func NewDescribeInternetChargeTypeConfigsResponse() (response *DescribeInternetChargeTypeConfigsResponse) { - response = &DescribeInternetChargeTypeConfigsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeInternetChargeTypeConfigs -// 本接口(DescribeInternetChargeTypeConfigs)用于查询网络的计费类型。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeInternetChargeTypeConfigs(request *DescribeInternetChargeTypeConfigsRequest) (response *DescribeInternetChargeTypeConfigsResponse, err error) { - return c.DescribeInternetChargeTypeConfigsWithContext(context.Background(), request) -} - -// DescribeInternetChargeTypeConfigs -// 本接口(DescribeInternetChargeTypeConfigs)用于查询网络的计费类型。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeInternetChargeTypeConfigsWithContext(ctx context.Context, request *DescribeInternetChargeTypeConfigsRequest) (response *DescribeInternetChargeTypeConfigsResponse, err error) { - if request == nil { - request = NewDescribeInternetChargeTypeConfigsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeInternetChargeTypeConfigs require credential") - } - - request.SetContext(ctx) - - response = NewDescribeInternetChargeTypeConfigsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeKeyPairsRequest() (request *DescribeKeyPairsRequest) { - request = &DescribeKeyPairsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeKeyPairs") - - return -} - -func NewDescribeKeyPairsResponse() (response *DescribeKeyPairsResponse) { - response = &DescribeKeyPairsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeKeyPairs -// 本接口 (DescribeKeyPairs) 用于查询密钥对信息。 -// -// * 密钥对是通过一种算法生成的一对密钥,在生成的密钥对中,一个向外界公开,称为公钥;另一个用户自己保留,称为私钥。密钥对的公钥内容可以通过这个接口查询,但私钥内容系统不保留。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUELIMIT = "InvalidParameterValueLimit" -// INVALIDPARAMETERVALUEOFFSET = "InvalidParameterValueOffset" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeKeyPairs(request *DescribeKeyPairsRequest) (response *DescribeKeyPairsResponse, err error) { - return c.DescribeKeyPairsWithContext(context.Background(), request) -} - -// DescribeKeyPairs -// 本接口 (DescribeKeyPairs) 用于查询密钥对信息。 -// -// * 密钥对是通过一种算法生成的一对密钥,在生成的密钥对中,一个向外界公开,称为公钥;另一个用户自己保留,称为私钥。密钥对的公钥内容可以通过这个接口查询,但私钥内容系统不保留。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUELIMIT = "InvalidParameterValueLimit" -// INVALIDPARAMETERVALUEOFFSET = "InvalidParameterValueOffset" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeKeyPairsWithContext(ctx context.Context, request *DescribeKeyPairsRequest) (response *DescribeKeyPairsResponse, err error) { - if request == nil { - request = NewDescribeKeyPairsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeKeyPairs require credential") - } - - request.SetContext(ctx) - - response = NewDescribeKeyPairsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeLaunchTemplateVersionsRequest() (request *DescribeLaunchTemplateVersionsRequest) { - request = &DescribeLaunchTemplateVersionsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeLaunchTemplateVersions") - - return -} - -func NewDescribeLaunchTemplateVersionsResponse() (response *DescribeLaunchTemplateVersionsResponse) { - response = &DescribeLaunchTemplateVersionsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeLaunchTemplateVersions -// 本接口(DescribeLaunchTemplateVersions)用于查询实例模板版本信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported" -// MISSINGPARAMETER = "MissingParameter" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeLaunchTemplateVersions(request *DescribeLaunchTemplateVersionsRequest) (response *DescribeLaunchTemplateVersionsResponse, err error) { - return c.DescribeLaunchTemplateVersionsWithContext(context.Background(), request) -} - -// DescribeLaunchTemplateVersions -// 本接口(DescribeLaunchTemplateVersions)用于查询实例模板版本信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported" -// MISSINGPARAMETER = "MissingParameter" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeLaunchTemplateVersionsWithContext(ctx context.Context, request *DescribeLaunchTemplateVersionsRequest) (response *DescribeLaunchTemplateVersionsResponse, err error) { - if request == nil { - request = NewDescribeLaunchTemplateVersionsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeLaunchTemplateVersions require credential") - } - - request.SetContext(ctx) - - response = NewDescribeLaunchTemplateVersionsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeLaunchTemplatesRequest() (request *DescribeLaunchTemplatesRequest) { - request = &DescribeLaunchTemplatesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeLaunchTemplates") - - return -} - -func NewDescribeLaunchTemplatesResponse() (response *DescribeLaunchTemplatesResponse) { - response = &DescribeLaunchTemplatesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeLaunchTemplates -// 本接口(DescribeLaunchTemplates)用于查询一个或者多个实例启动模板。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATENAME = "InvalidParameterValue.InvalidLaunchTemplateName" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeLaunchTemplates(request *DescribeLaunchTemplatesRequest) (response *DescribeLaunchTemplatesResponse, err error) { - return c.DescribeLaunchTemplatesWithContext(context.Background(), request) -} - -// DescribeLaunchTemplates -// 本接口(DescribeLaunchTemplates)用于查询一个或者多个实例启动模板。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATENAME = "InvalidParameterValue.InvalidLaunchTemplateName" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeLaunchTemplatesWithContext(ctx context.Context, request *DescribeLaunchTemplatesRequest) (response *DescribeLaunchTemplatesResponse, err error) { - if request == nil { - request = NewDescribeLaunchTemplatesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeLaunchTemplates require credential") - } - - request.SetContext(ctx) - - response = NewDescribeLaunchTemplatesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeRegionsRequest() (request *DescribeRegionsRequest) { - request = &DescribeRegionsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeRegions") - - return -} - -func NewDescribeRegionsResponse() (response *DescribeRegionsResponse) { - response = &DescribeRegionsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeRegions -// 本接口(DescribeRegions)用于查询地域信息。因平台策略原因,该接口暂时停止更新,为确保您正常调用,可切换至新链接:https://cloud.tencent.com/document/product/1596/77930。 -// -// 可能返回的错误码: -// -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) { - return c.DescribeRegionsWithContext(context.Background(), request) -} - -// DescribeRegions -// 本接口(DescribeRegions)用于查询地域信息。因平台策略原因,该接口暂时停止更新,为确保您正常调用,可切换至新链接:https://cloud.tencent.com/document/product/1596/77930。 -// -// 可能返回的错误码: -// -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeRegionsWithContext(ctx context.Context, request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) { - if request == nil { - request = NewDescribeRegionsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeRegions require credential") - } - - request.SetContext(ctx) - - response = NewDescribeRegionsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeReservedInstancesRequest() (request *DescribeReservedInstancesRequest) { - request = &DescribeReservedInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeReservedInstances") - - return -} - -func NewDescribeReservedInstancesResponse() (response *DescribeReservedInstancesResponse) { - response = &DescribeReservedInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeReservedInstances -// 本接口(DescribeReservedInstances)可提供列出用户已购买的预留实例 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" -func (c *Client) DescribeReservedInstances(request *DescribeReservedInstancesRequest) (response *DescribeReservedInstancesResponse, err error) { - return c.DescribeReservedInstancesWithContext(context.Background(), request) -} - -// DescribeReservedInstances -// 本接口(DescribeReservedInstances)可提供列出用户已购买的预留实例 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" -func (c *Client) DescribeReservedInstancesWithContext(ctx context.Context, request *DescribeReservedInstancesRequest) (response *DescribeReservedInstancesResponse, err error) { - if request == nil { - request = NewDescribeReservedInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeReservedInstances require credential") - } - - request.SetContext(ctx) - - response = NewDescribeReservedInstancesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeReservedInstancesConfigInfosRequest() (request *DescribeReservedInstancesConfigInfosRequest) { - request = &DescribeReservedInstancesConfigInfosRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeReservedInstancesConfigInfos") - - return -} - -func NewDescribeReservedInstancesConfigInfosResponse() (response *DescribeReservedInstancesConfigInfosResponse) { - response = &DescribeReservedInstancesConfigInfosResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeReservedInstancesConfigInfos -// 本接口(DescribeReservedInstancesConfigInfos)供用户列出可购买预留实例机型配置。预留实例当前只针对国际站白名单用户开放。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" -func (c *Client) DescribeReservedInstancesConfigInfos(request *DescribeReservedInstancesConfigInfosRequest) (response *DescribeReservedInstancesConfigInfosResponse, err error) { - return c.DescribeReservedInstancesConfigInfosWithContext(context.Background(), request) -} - -// DescribeReservedInstancesConfigInfos -// 本接口(DescribeReservedInstancesConfigInfos)供用户列出可购买预留实例机型配置。预留实例当前只针对国际站白名单用户开放。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" -func (c *Client) DescribeReservedInstancesConfigInfosWithContext(ctx context.Context, request *DescribeReservedInstancesConfigInfosRequest) (response *DescribeReservedInstancesConfigInfosResponse, err error) { - if request == nil { - request = NewDescribeReservedInstancesConfigInfosRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeReservedInstancesConfigInfos require credential") - } - - request.SetContext(ctx) - - response = NewDescribeReservedInstancesConfigInfosResponse() - err = c.Send(request, response) - return -} - -func NewDescribeReservedInstancesOfferingsRequest() (request *DescribeReservedInstancesOfferingsRequest) { - request = &DescribeReservedInstancesOfferingsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeReservedInstancesOfferings") - - return -} - -func NewDescribeReservedInstancesOfferingsResponse() (response *DescribeReservedInstancesOfferingsResponse) { - response = &DescribeReservedInstancesOfferingsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeReservedInstancesOfferings -// 本接口(DescribeReservedInstancesOfferings)供用户列出可购买的预留实例配置 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" -func (c *Client) DescribeReservedInstancesOfferings(request *DescribeReservedInstancesOfferingsRequest) (response *DescribeReservedInstancesOfferingsResponse, err error) { - return c.DescribeReservedInstancesOfferingsWithContext(context.Background(), request) -} - -// DescribeReservedInstancesOfferings -// 本接口(DescribeReservedInstancesOfferings)供用户列出可购买的预留实例配置 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" -func (c *Client) DescribeReservedInstancesOfferingsWithContext(ctx context.Context, request *DescribeReservedInstancesOfferingsRequest) (response *DescribeReservedInstancesOfferingsResponse, err error) { - if request == nil { - request = NewDescribeReservedInstancesOfferingsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeReservedInstancesOfferings require credential") - } - - request.SetContext(ctx) - - response = NewDescribeReservedInstancesOfferingsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeTaskInfoRequest() (request *DescribeTaskInfoRequest) { - request = &DescribeTaskInfoRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeTaskInfo") - - return -} - -func NewDescribeTaskInfoResponse() (response *DescribeTaskInfoResponse) { - response = &DescribeTaskInfoResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeTaskInfo -// 本接口 (DescribeTaskInfo) 用于查询云服务器维修任务列表及详细信息。 -// -// - 可以根据实例ID、实例名称或任务状态等信息来查询维修任务列表。过滤信息详情可参考入参说明。 -// -// - 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的维修任务列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -func (c *Client) DescribeTaskInfo(request *DescribeTaskInfoRequest) (response *DescribeTaskInfoResponse, err error) { - return c.DescribeTaskInfoWithContext(context.Background(), request) -} - -// DescribeTaskInfo -// 本接口 (DescribeTaskInfo) 用于查询云服务器维修任务列表及详细信息。 -// -// - 可以根据实例ID、实例名称或任务状态等信息来查询维修任务列表。过滤信息详情可参考入参说明。 -// -// - 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的维修任务列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -func (c *Client) DescribeTaskInfoWithContext(ctx context.Context, request *DescribeTaskInfoRequest) (response *DescribeTaskInfoResponse, err error) { - if request == nil { - request = NewDescribeTaskInfoRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeTaskInfo require credential") - } - - request.SetContext(ctx) - - response = NewDescribeTaskInfoResponse() - err = c.Send(request, response) - return -} - -func NewDescribeZoneInstanceConfigInfosRequest() (request *DescribeZoneInstanceConfigInfosRequest) { - request = &DescribeZoneInstanceConfigInfosRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeZoneInstanceConfigInfos") - - return -} - -func NewDescribeZoneInstanceConfigInfosResponse() (response *DescribeZoneInstanceConfigInfosResponse) { - response = &DescribeZoneInstanceConfigInfosResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeZoneInstanceConfigInfos -// 本接口(DescribeZoneInstanceConfigInfos) 获取可用区的机型信息。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCEINSUFFICIENT_AVAILABILITYZONESOLDOUT = "ResourceInsufficient.AvailabilityZoneSoldOut" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeZoneInstanceConfigInfos(request *DescribeZoneInstanceConfigInfosRequest) (response *DescribeZoneInstanceConfigInfosResponse, err error) { - return c.DescribeZoneInstanceConfigInfosWithContext(context.Background(), request) -} - -// DescribeZoneInstanceConfigInfos -// 本接口(DescribeZoneInstanceConfigInfos) 获取可用区的机型信息。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// RESOURCEINSUFFICIENT_AVAILABILITYZONESOLDOUT = "ResourceInsufficient.AvailabilityZoneSoldOut" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeZoneInstanceConfigInfosWithContext(ctx context.Context, request *DescribeZoneInstanceConfigInfosRequest) (response *DescribeZoneInstanceConfigInfosResponse, err error) { - if request == nil { - request = NewDescribeZoneInstanceConfigInfosRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeZoneInstanceConfigInfos require credential") - } - - request.SetContext(ctx) - - response = NewDescribeZoneInstanceConfigInfosResponse() - err = c.Send(request, response) - return -} - -func NewDescribeZonesRequest() (request *DescribeZonesRequest) { - request = &DescribeZonesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DescribeZones") - - return -} - -func NewDescribeZonesResponse() (response *DescribeZonesResponse) { - response = &DescribeZonesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeZones -// 本接口(DescribeZones)用于查询可用区信息。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeZones(request *DescribeZonesRequest) (response *DescribeZonesResponse, err error) { - return c.DescribeZonesWithContext(context.Background(), request) -} - -// DescribeZones -// 本接口(DescribeZones)用于查询可用区信息。 -// -// 可能返回的错误码: -// -// INVALIDFILTER = "InvalidFilter" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeZonesWithContext(ctx context.Context, request *DescribeZonesRequest) (response *DescribeZonesResponse, err error) { - if request == nil { - request = NewDescribeZonesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeZones require credential") - } - - request.SetContext(ctx) - - response = NewDescribeZonesResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateInstancesKeyPairsRequest() (request *DisassociateInstancesKeyPairsRequest) { - request = &DisassociateInstancesKeyPairsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DisassociateInstancesKeyPairs") - - return -} - -func NewDisassociateInstancesKeyPairsResponse() (response *DisassociateInstancesKeyPairsResponse) { - response = &DisassociateInstancesKeyPairsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateInstancesKeyPairs -// 本接口 (DisassociateInstancesKeyPairs) 用于解除实例的密钥绑定关系。 -// -// * 只支持[`STOPPED`](https://cloud.tencent.com/document/product/213/15753#InstanceStatus)状态的`Linux`操作系统的实例。 -// -// * 解绑密钥后,实例可以通过原来设置的密码登录。 -// -// * 如果原来没有设置密码,解绑后将无法使用 `SSH` 登录。可以调用 [ResetInstancesPassword](https://cloud.tencent.com/document/api/213/15736) 接口来设置登录密码。 -// -// * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCEOSWINDOWS = "UnsupportedOperation.InstanceOsWindows" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) DisassociateInstancesKeyPairs(request *DisassociateInstancesKeyPairsRequest) (response *DisassociateInstancesKeyPairsResponse, err error) { - return c.DisassociateInstancesKeyPairsWithContext(context.Background(), request) -} - -// DisassociateInstancesKeyPairs -// 本接口 (DisassociateInstancesKeyPairs) 用于解除实例的密钥绑定关系。 -// -// * 只支持[`STOPPED`](https://cloud.tencent.com/document/product/213/15753#InstanceStatus)状态的`Linux`操作系统的实例。 -// -// * 解绑密钥后,实例可以通过原来设置的密码登录。 -// -// * 如果原来没有设置密码,解绑后将无法使用 `SSH` 登录。可以调用 [ResetInstancesPassword](https://cloud.tencent.com/document/api/213/15736) 接口来设置登录密码。 -// -// * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCEOSWINDOWS = "UnsupportedOperation.InstanceOsWindows" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) DisassociateInstancesKeyPairsWithContext(ctx context.Context, request *DisassociateInstancesKeyPairsRequest) (response *DisassociateInstancesKeyPairsResponse, err error) { - if request == nil { - request = NewDisassociateInstancesKeyPairsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateInstancesKeyPairs require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateInstancesKeyPairsResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateSecurityGroupsRequest() (request *DisassociateSecurityGroupsRequest) { - request = &DisassociateSecurityGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "DisassociateSecurityGroups") - - return -} - -func NewDisassociateSecurityGroupsResponse() (response *DisassociateSecurityGroupsResponse) { - response = &DisassociateSecurityGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateSecurityGroups -// 本接口 (DisassociateSecurityGroups) 用于解绑实例的指定安全组。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDSGID_MALFORMED = "InvalidSgId.Malformed" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// SECGROUPACTIONFAILURE = "SecGroupActionFailure" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DisassociateSecurityGroups(request *DisassociateSecurityGroupsRequest) (response *DisassociateSecurityGroupsResponse, err error) { - return c.DisassociateSecurityGroupsWithContext(context.Background(), request) -} - -// DisassociateSecurityGroups -// 本接口 (DisassociateSecurityGroups) 用于解绑实例的指定安全组。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDSGID_MALFORMED = "InvalidSgId.Malformed" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// SECGROUPACTIONFAILURE = "SecGroupActionFailure" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DisassociateSecurityGroupsWithContext(ctx context.Context, request *DisassociateSecurityGroupsRequest) (response *DisassociateSecurityGroupsResponse, err error) { - if request == nil { - request = NewDisassociateSecurityGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateSecurityGroups require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateSecurityGroupsResponse() - err = c.Send(request, response) - return -} - -func NewExportImagesRequest() (request *ExportImagesRequest) { - request = &ExportImagesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ExportImages") - - return -} - -func NewExportImagesResponse() (response *ExportImagesResponse) { - response = &ExportImagesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ExportImages -// 提供导出自定义镜像到指定COS存储桶的能力 -// -// 可能返回的错误码: -// -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDPARAMETER_IMAGEIDSSNAPSHOTIDSMUSTONE = "InvalidParameter.ImageIdsSnapshotIdsMustOne" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERVALUE_BUCKETNOTFOUND = "InvalidParameterValue.BucketNotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDBUCKETPERMISSIONFOREXPORT = "InvalidParameterValue.InvalidBucketPermissionForExport" -// INVALIDPARAMETERVALUE_INVALIDFILENAMEPREFIXLIST = "InvalidParameterValue.InvalidFileNamePrefixList" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// LIMITEXCEEDED_EXPORTIMAGETASKLIMITEXCEEDED = "LimitExceeded.ExportImageTaskLimitExceeded" -// UNSUPPORTEDOPERATION_ENCRYPTEDIMAGESNOTSUPPORTED = "UnsupportedOperation.EncryptedImagesNotSupported" -// UNSUPPORTEDOPERATION_IMAGETOOLARGEEXPORTUNSUPPORTED = "UnsupportedOperation.ImageTooLargeExportUnsupported" -// UNSUPPORTEDOPERATION_MARKETIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.MarketImageExportUnsupported" -// UNSUPPORTEDOPERATION_PUBLICIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.PublicImageExportUnsupported" -// UNSUPPORTEDOPERATION_REDHATIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.RedHatImageExportUnsupported" -// UNSUPPORTEDOPERATION_SHAREDIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.SharedImageExportUnsupported" -// UNSUPPORTEDOPERATION_WINDOWSIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.WindowsImageExportUnsupported" -func (c *Client) ExportImages(request *ExportImagesRequest) (response *ExportImagesResponse, err error) { - return c.ExportImagesWithContext(context.Background(), request) -} - -// ExportImages -// 提供导出自定义镜像到指定COS存储桶的能力 -// -// 可能返回的错误码: -// -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDPARAMETER_IMAGEIDSSNAPSHOTIDSMUSTONE = "InvalidParameter.ImageIdsSnapshotIdsMustOne" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERVALUE_BUCKETNOTFOUND = "InvalidParameterValue.BucketNotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDBUCKETPERMISSIONFOREXPORT = "InvalidParameterValue.InvalidBucketPermissionForExport" -// INVALIDPARAMETERVALUE_INVALIDFILENAMEPREFIXLIST = "InvalidParameterValue.InvalidFileNamePrefixList" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// LIMITEXCEEDED_EXPORTIMAGETASKLIMITEXCEEDED = "LimitExceeded.ExportImageTaskLimitExceeded" -// UNSUPPORTEDOPERATION_ENCRYPTEDIMAGESNOTSUPPORTED = "UnsupportedOperation.EncryptedImagesNotSupported" -// UNSUPPORTEDOPERATION_IMAGETOOLARGEEXPORTUNSUPPORTED = "UnsupportedOperation.ImageTooLargeExportUnsupported" -// UNSUPPORTEDOPERATION_MARKETIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.MarketImageExportUnsupported" -// UNSUPPORTEDOPERATION_PUBLICIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.PublicImageExportUnsupported" -// UNSUPPORTEDOPERATION_REDHATIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.RedHatImageExportUnsupported" -// UNSUPPORTEDOPERATION_SHAREDIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.SharedImageExportUnsupported" -// UNSUPPORTEDOPERATION_WINDOWSIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.WindowsImageExportUnsupported" -func (c *Client) ExportImagesWithContext(ctx context.Context, request *ExportImagesRequest) (response *ExportImagesResponse, err error) { - if request == nil { - request = NewExportImagesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ExportImages require credential") - } - - request.SetContext(ctx) - - response = NewExportImagesResponse() - err = c.Send(request, response) - return -} - -func NewImportImageRequest() (request *ImportImageRequest) { - request = &ImportImageRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ImportImage") - - return -} - -func NewImportImageResponse() (response *ImportImageResponse) { - response = &ImportImageResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ImportImage -// 本接口(ImportImage)用于导入镜像,导入后的镜像可用于创建实例。目前支持 RAW、VHD、QCOW2、VMDK 镜像格式。 -// -// 可能返回的错误码: -// -// IMAGEQUOTALIMITEXCEEDED = "ImageQuotaLimitExceeded" -// INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" -// INVALIDIMAGEOSTYPE_UNSUPPORTED = "InvalidImageOsType.Unsupported" -// INVALIDIMAGEOSVERSION_UNSUPPORTED = "InvalidImageOsVersion.Unsupported" -// INVALIDPARAMETER_INVALIDPARAMETERURLERROR = "InvalidParameter.InvalidParameterUrlError" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDBOOTMODE = "InvalidParameterValue.InvalidBootMode" -// INVALIDPARAMETERVALUE_INVALIDLICENSETYPE = "InvalidParameterValue.InvalidLicenseType" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// OPERATIONDENIED_INNERUSERPROHIBITACTION = "OperationDenied.InnerUserProhibitAction" -// REGIONABILITYLIMIT_UNSUPPORTEDTOIMPORTIMAGE = "RegionAbilityLimit.UnsupportedToImportImage" -func (c *Client) ImportImage(request *ImportImageRequest) (response *ImportImageResponse, err error) { - return c.ImportImageWithContext(context.Background(), request) -} - -// ImportImage -// 本接口(ImportImage)用于导入镜像,导入后的镜像可用于创建实例。目前支持 RAW、VHD、QCOW2、VMDK 镜像格式。 -// -// 可能返回的错误码: -// -// IMAGEQUOTALIMITEXCEEDED = "ImageQuotaLimitExceeded" -// INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" -// INVALIDIMAGEOSTYPE_UNSUPPORTED = "InvalidImageOsType.Unsupported" -// INVALIDIMAGEOSVERSION_UNSUPPORTED = "InvalidImageOsVersion.Unsupported" -// INVALIDPARAMETER_INVALIDPARAMETERURLERROR = "InvalidParameter.InvalidParameterUrlError" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDBOOTMODE = "InvalidParameterValue.InvalidBootMode" -// INVALIDPARAMETERVALUE_INVALIDLICENSETYPE = "InvalidParameterValue.InvalidLicenseType" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// OPERATIONDENIED_INNERUSERPROHIBITACTION = "OperationDenied.InnerUserProhibitAction" -// REGIONABILITYLIMIT_UNSUPPORTEDTOIMPORTIMAGE = "RegionAbilityLimit.UnsupportedToImportImage" -func (c *Client) ImportImageWithContext(ctx context.Context, request *ImportImageRequest) (response *ImportImageResponse, err error) { - if request == nil { - request = NewImportImageRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ImportImage require credential") - } - - request.SetContext(ctx) - - response = NewImportImageResponse() - err = c.Send(request, response) - return -} - -func NewImportKeyPairRequest() (request *ImportKeyPairRequest) { - request = &ImportKeyPairRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ImportKeyPair") - - return -} - -func NewImportKeyPairResponse() (response *ImportKeyPairResponse) { - response = &ImportKeyPairResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ImportKeyPair -// 本接口 (ImportKeyPair) 用于导入密钥对。 -// -// * 本接口的功能是将密钥对导入到用户账户,并不会自动绑定到实例。如需绑定可以使用[AssociasteInstancesKeyPair](https://cloud.tencent.com/document/api/213/9404)接口。 -// -// * 需指定密钥对名称以及该密钥对的公钥文本。 -// -// * 如果用户只有私钥,可以通过 `SSL` 工具将私钥转换成公钥后再导入。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" -// INVALIDKEYPAIRNAME_DUPLICATE = "InvalidKeyPairName.Duplicate" -// INVALIDKEYPAIRNAMEEMPTY = "InvalidKeyPairNameEmpty" -// INVALIDKEYPAIRNAMEINCLUDEILLEGALCHAR = "InvalidKeyPairNameIncludeIllegalChar" -// INVALIDKEYPAIRNAMETOOLONG = "InvalidKeyPairNameTooLong" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDPUBLICKEY_DUPLICATE = "InvalidPublicKey.Duplicate" -// INVALIDPUBLICKEY_MALFORMED = "InvalidPublicKey.Malformed" -// LIMITEXCEEDED_TAGRESOURCEQUOTA = "LimitExceeded.TagResourceQuota" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) ImportKeyPair(request *ImportKeyPairRequest) (response *ImportKeyPairResponse, err error) { - return c.ImportKeyPairWithContext(context.Background(), request) -} - -// ImportKeyPair -// 本接口 (ImportKeyPair) 用于导入密钥对。 -// -// * 本接口的功能是将密钥对导入到用户账户,并不会自动绑定到实例。如需绑定可以使用[AssociasteInstancesKeyPair](https://cloud.tencent.com/document/api/213/9404)接口。 -// -// * 需指定密钥对名称以及该密钥对的公钥文本。 -// -// * 如果用户只有私钥,可以通过 `SSL` 工具将私钥转换成公钥后再导入。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" -// INVALIDKEYPAIRNAME_DUPLICATE = "InvalidKeyPairName.Duplicate" -// INVALIDKEYPAIRNAMEEMPTY = "InvalidKeyPairNameEmpty" -// INVALIDKEYPAIRNAMEINCLUDEILLEGALCHAR = "InvalidKeyPairNameIncludeIllegalChar" -// INVALIDKEYPAIRNAMETOOLONG = "InvalidKeyPairNameTooLong" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDPUBLICKEY_DUPLICATE = "InvalidPublicKey.Duplicate" -// INVALIDPUBLICKEY_MALFORMED = "InvalidPublicKey.Malformed" -// LIMITEXCEEDED_TAGRESOURCEQUOTA = "LimitExceeded.TagResourceQuota" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) ImportKeyPairWithContext(ctx context.Context, request *ImportKeyPairRequest) (response *ImportKeyPairResponse, err error) { - if request == nil { - request = NewImportKeyPairRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ImportKeyPair require credential") - } - - request.SetContext(ctx) - - response = NewImportKeyPairResponse() - err = c.Send(request, response) - return -} - -func NewInquirePricePurchaseReservedInstancesOfferingRequest() (request *InquirePricePurchaseReservedInstancesOfferingRequest) { - request = &InquirePricePurchaseReservedInstancesOfferingRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquirePricePurchaseReservedInstancesOffering") - - return -} - -func NewInquirePricePurchaseReservedInstancesOfferingResponse() (response *InquirePricePurchaseReservedInstancesOfferingResponse) { - response = &InquirePricePurchaseReservedInstancesOfferingResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquirePricePurchaseReservedInstancesOffering -// 本接口(InquirePricePurchaseReservedInstancesOffering)用于创建预留实例询价。本接口仅允许针对购买限制范围内的预留实例配置进行询价。预留实例当前只针对国际站白名单用户开放。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -func (c *Client) InquirePricePurchaseReservedInstancesOffering(request *InquirePricePurchaseReservedInstancesOfferingRequest) (response *InquirePricePurchaseReservedInstancesOfferingResponse, err error) { - return c.InquirePricePurchaseReservedInstancesOfferingWithContext(context.Background(), request) -} - -// InquirePricePurchaseReservedInstancesOffering -// 本接口(InquirePricePurchaseReservedInstancesOffering)用于创建预留实例询价。本接口仅允许针对购买限制范围内的预留实例配置进行询价。预留实例当前只针对国际站白名单用户开放。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -func (c *Client) InquirePricePurchaseReservedInstancesOfferingWithContext(ctx context.Context, request *InquirePricePurchaseReservedInstancesOfferingRequest) (response *InquirePricePurchaseReservedInstancesOfferingResponse, err error) { - if request == nil { - request = NewInquirePricePurchaseReservedInstancesOfferingRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquirePricePurchaseReservedInstancesOffering require credential") - } - - request.SetContext(ctx) - - response = NewInquirePricePurchaseReservedInstancesOfferingResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceModifyInstancesChargeTypeRequest() (request *InquiryPriceModifyInstancesChargeTypeRequest) { - request = &InquiryPriceModifyInstancesChargeTypeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceModifyInstancesChargeType") - - return -} - -func NewInquiryPriceModifyInstancesChargeTypeResponse() (response *InquiryPriceModifyInstancesChargeTypeResponse) { - response = &InquiryPriceModifyInstancesChargeTypeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceModifyInstancesChargeType -// 本接口 (InquiryPriceModifyInstancesChargeType) 用于切换实例的计费模式询价。 -// -// * 只支持从 `POSTPAID_BY_HOUR` 计费模式切换为`PREPAID`计费模式。 -// -// * 关机不收费的实例、`BC1`和`BS1`机型族的实例、设置定时销毁的实例、竞价实例不支持该操作。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_INQUIRYREFUNDPRICEFAILED = "FailedOperation.InquiryRefundPriceFailed" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDINSTANCETYPEUNDERWRITE = "InvalidParameterValue.InvalidInstanceTypeUnderwrite" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" -func (c *Client) InquiryPriceModifyInstancesChargeType(request *InquiryPriceModifyInstancesChargeTypeRequest) (response *InquiryPriceModifyInstancesChargeTypeResponse, err error) { - return c.InquiryPriceModifyInstancesChargeTypeWithContext(context.Background(), request) -} - -// InquiryPriceModifyInstancesChargeType -// 本接口 (InquiryPriceModifyInstancesChargeType) 用于切换实例的计费模式询价。 -// -// * 只支持从 `POSTPAID_BY_HOUR` 计费模式切换为`PREPAID`计费模式。 -// -// * 关机不收费的实例、`BC1`和`BS1`机型族的实例、设置定时销毁的实例、竞价实例不支持该操作。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_INQUIRYREFUNDPRICEFAILED = "FailedOperation.InquiryRefundPriceFailed" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDINSTANCETYPEUNDERWRITE = "InvalidParameterValue.InvalidInstanceTypeUnderwrite" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" -func (c *Client) InquiryPriceModifyInstancesChargeTypeWithContext(ctx context.Context, request *InquiryPriceModifyInstancesChargeTypeRequest) (response *InquiryPriceModifyInstancesChargeTypeResponse, err error) { - if request == nil { - request = NewInquiryPriceModifyInstancesChargeTypeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceModifyInstancesChargeType require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceModifyInstancesChargeTypeResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceRenewHostsRequest() (request *InquiryPriceRenewHostsRequest) { - request = &InquiryPriceRenewHostsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceRenewHosts") - - return -} - -func NewInquiryPriceRenewHostsResponse() (response *InquiryPriceRenewHostsResponse) { - response = &InquiryPriceRenewHostsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceRenewHosts -// 本接口 (InquiryPriceRenewHosts) 用于续费包年包月`CDH`实例询价。 -// -// * 只支持查询包年包月`CDH`实例的续费价格。 -// -// 可能返回的错误码: -// -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDPERIOD = "InvalidPeriod" -func (c *Client) InquiryPriceRenewHosts(request *InquiryPriceRenewHostsRequest) (response *InquiryPriceRenewHostsResponse, err error) { - return c.InquiryPriceRenewHostsWithContext(context.Background(), request) -} - -// InquiryPriceRenewHosts -// 本接口 (InquiryPriceRenewHosts) 用于续费包年包月`CDH`实例询价。 -// -// * 只支持查询包年包月`CDH`实例的续费价格。 -// -// 可能返回的错误码: -// -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDPERIOD = "InvalidPeriod" -func (c *Client) InquiryPriceRenewHostsWithContext(ctx context.Context, request *InquiryPriceRenewHostsRequest) (response *InquiryPriceRenewHostsResponse, err error) { - if request == nil { - request = NewInquiryPriceRenewHostsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceRenewHosts require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceRenewHostsResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceRenewInstancesRequest() (request *InquiryPriceRenewInstancesRequest) { - request = &InquiryPriceRenewInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceRenewInstances") - - return -} - -func NewInquiryPriceRenewInstancesResponse() (response *InquiryPriceRenewInstancesResponse) { - response = &InquiryPriceRenewInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceRenewInstances -// 本接口 (InquiryPriceRenewInstances) 用于续费包年包月实例询价。 -// -// * 只支持查询包年包月实例的续费价格。 -// -// 可能返回的错误码: -// -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOTSUPPORTEDMIXPRICINGMODEL = "InvalidParameterValue.InstanceNotSupportedMixPricingModel" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPERIOD = "InvalidPeriod" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" -// UNSUPPORTEDOPERATION_INVALIDDISKBACKUPQUOTA = "UnsupportedOperation.InvalidDiskBackupQuota" -func (c *Client) InquiryPriceRenewInstances(request *InquiryPriceRenewInstancesRequest) (response *InquiryPriceRenewInstancesResponse, err error) { - return c.InquiryPriceRenewInstancesWithContext(context.Background(), request) -} - -// InquiryPriceRenewInstances -// 本接口 (InquiryPriceRenewInstances) 用于续费包年包月实例询价。 -// -// * 只支持查询包年包月实例的续费价格。 -// -// 可能返回的错误码: -// -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOTSUPPORTEDMIXPRICINGMODEL = "InvalidParameterValue.InstanceNotSupportedMixPricingModel" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPERIOD = "InvalidPeriod" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" -// UNSUPPORTEDOPERATION_INVALIDDISKBACKUPQUOTA = "UnsupportedOperation.InvalidDiskBackupQuota" -func (c *Client) InquiryPriceRenewInstancesWithContext(ctx context.Context, request *InquiryPriceRenewInstancesRequest) (response *InquiryPriceRenewInstancesResponse, err error) { - if request == nil { - request = NewInquiryPriceRenewInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceRenewInstances require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceRenewInstancesResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceResetInstanceRequest() (request *InquiryPriceResetInstanceRequest) { - request = &InquiryPriceResetInstanceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceResetInstance") - - return -} - -func NewInquiryPriceResetInstanceResponse() (response *InquiryPriceResetInstanceResponse) { - response = &InquiryPriceResetInstanceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceResetInstance -// 本接口 (InquiryPriceResetInstance) 用于重装实例询价。 -// -// * 如果指定了`ImageId`参数,则使用指定的镜像进行重装询价;否则按照当前实例使用的镜像进行重装询价。 -// -// * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/15753#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口实现`Linux`和`Windows`操作系统切换的重装询价。 -// -// * 目前不支持境外地域的实例使用该接口实现`Linux`和`Windows`操作系统切换的重装询价。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEIDFORRETSETINSTANCE = "InvalidParameterValue.InvalidImageIdForRetsetInstance" -// INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION_INVALIDIMAGELICENSETYPEFORRESET = "UnsupportedOperation.InvalidImageLicenseTypeForReset" -// UNSUPPORTEDOPERATION_MODIFYENCRYPTIONNOTSUPPORTED = "UnsupportedOperation.ModifyEncryptionNotSupported" -// UNSUPPORTEDOPERATION_RAWLOCALDISKINSREINSTALLTOQCOW2 = "UnsupportedOperation.RawLocalDiskInsReinstalltoQcow2" -func (c *Client) InquiryPriceResetInstance(request *InquiryPriceResetInstanceRequest) (response *InquiryPriceResetInstanceResponse, err error) { - return c.InquiryPriceResetInstanceWithContext(context.Background(), request) -} - -// InquiryPriceResetInstance -// 本接口 (InquiryPriceResetInstance) 用于重装实例询价。 -// -// * 如果指定了`ImageId`参数,则使用指定的镜像进行重装询价;否则按照当前实例使用的镜像进行重装询价。 -// -// * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/15753#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口实现`Linux`和`Windows`操作系统切换的重装询价。 -// -// * 目前不支持境外地域的实例使用该接口实现`Linux`和`Windows`操作系统切换的重装询价。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEIDFORRETSETINSTANCE = "InvalidParameterValue.InvalidImageIdForRetsetInstance" -// INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION_INVALIDIMAGELICENSETYPEFORRESET = "UnsupportedOperation.InvalidImageLicenseTypeForReset" -// UNSUPPORTEDOPERATION_MODIFYENCRYPTIONNOTSUPPORTED = "UnsupportedOperation.ModifyEncryptionNotSupported" -// UNSUPPORTEDOPERATION_RAWLOCALDISKINSREINSTALLTOQCOW2 = "UnsupportedOperation.RawLocalDiskInsReinstalltoQcow2" -func (c *Client) InquiryPriceResetInstanceWithContext(ctx context.Context, request *InquiryPriceResetInstanceRequest) (response *InquiryPriceResetInstanceResponse, err error) { - if request == nil { - request = NewInquiryPriceResetInstanceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceResetInstance require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceResetInstanceResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceResetInstancesInternetMaxBandwidthRequest() (request *InquiryPriceResetInstancesInternetMaxBandwidthRequest) { - request = &InquiryPriceResetInstancesInternetMaxBandwidthRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceResetInstancesInternetMaxBandwidth") - - return -} - -func NewInquiryPriceResetInstancesInternetMaxBandwidthResponse() (response *InquiryPriceResetInstancesInternetMaxBandwidthResponse) { - response = &InquiryPriceResetInstancesInternetMaxBandwidthResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceResetInstancesInternetMaxBandwidth -// 本接口 (InquiryPriceResetInstancesInternetMaxBandwidth) 用于调整实例公网带宽上限询价。 -// -// * 不同机型带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。 -// -// * 对于`BANDWIDTH_PREPAID`计费方式的带宽,目前不支持调小带宽,且需要输入参数`StartTime`和`EndTime`,指定调整后的带宽的生效时间段。在这种场景下会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// * 对于 `TRAFFIC_POSTPAID_BY_HOUR`、 `BANDWIDTH_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽,使用该接口调整带宽上限是实时生效的,可以在带宽允许的范围内调大或者调小带宽,不支持输入参数 `StartTime` 和 `EndTime` 。 -// -// * 接口不支持调整`BANDWIDTH_POSTPAID_BY_MONTH`计费方式的带宽。 -// -// * 接口不支持批量调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽。 -// -// * 接口不支持批量调整混合计费方式的带宽。例如不支持同时调整`TRAFFIC_POSTPAID_BY_HOUR`和`BANDWIDTH_PACKAGE`计费方式的带宽。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_NOTFOUNDEIP = "FailedOperation.NotFoundEIP" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPERMISSION = "InvalidPermission" -// MISSINGPARAMETER = "MissingParameter" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -func (c *Client) InquiryPriceResetInstancesInternetMaxBandwidth(request *InquiryPriceResetInstancesInternetMaxBandwidthRequest) (response *InquiryPriceResetInstancesInternetMaxBandwidthResponse, err error) { - return c.InquiryPriceResetInstancesInternetMaxBandwidthWithContext(context.Background(), request) -} - -// InquiryPriceResetInstancesInternetMaxBandwidth -// 本接口 (InquiryPriceResetInstancesInternetMaxBandwidth) 用于调整实例公网带宽上限询价。 -// -// * 不同机型带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。 -// -// * 对于`BANDWIDTH_PREPAID`计费方式的带宽,目前不支持调小带宽,且需要输入参数`StartTime`和`EndTime`,指定调整后的带宽的生效时间段。在这种场景下会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// * 对于 `TRAFFIC_POSTPAID_BY_HOUR`、 `BANDWIDTH_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽,使用该接口调整带宽上限是实时生效的,可以在带宽允许的范围内调大或者调小带宽,不支持输入参数 `StartTime` 和 `EndTime` 。 -// -// * 接口不支持调整`BANDWIDTH_POSTPAID_BY_MONTH`计费方式的带宽。 -// -// * 接口不支持批量调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽。 -// -// * 接口不支持批量调整混合计费方式的带宽。例如不支持同时调整`TRAFFIC_POSTPAID_BY_HOUR`和`BANDWIDTH_PACKAGE`计费方式的带宽。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_NOTFOUNDEIP = "FailedOperation.NotFoundEIP" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPERMISSION = "InvalidPermission" -// MISSINGPARAMETER = "MissingParameter" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -func (c *Client) InquiryPriceResetInstancesInternetMaxBandwidthWithContext(ctx context.Context, request *InquiryPriceResetInstancesInternetMaxBandwidthRequest) (response *InquiryPriceResetInstancesInternetMaxBandwidthResponse, err error) { - if request == nil { - request = NewInquiryPriceResetInstancesInternetMaxBandwidthRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceResetInstancesInternetMaxBandwidth require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceResetInstancesInternetMaxBandwidthResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceResetInstancesTypeRequest() (request *InquiryPriceResetInstancesTypeRequest) { - request = &InquiryPriceResetInstancesTypeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceResetInstancesType") - - return -} - -func NewInquiryPriceResetInstancesTypeResponse() (response *InquiryPriceResetInstancesTypeResponse) { - response = &InquiryPriceResetInstancesTypeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceResetInstancesType -// 本接口 (InquiryPriceResetInstancesType) 用于调整实例的机型询价。 -// -// * 目前只支持[系统盘类型](https://cloud.tencent.com/document/product/213/15753#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行调整机型询价。 -// -// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型询价。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYREFUNDPRICEFAILED = "FailedOperation.InquiryRefundPriceFailed" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BASICNETWORKINSTANCEFAMILY = "InvalidParameterValue.BasicNetworkInstanceFamily" -// INVALIDPARAMETERVALUE_GPUINSTANCEFAMILY = "InvalidParameterValue.GPUInstanceFamily" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDINSTANCESOURCE = "InvalidParameterValue.InvalidInstanceSource" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_EIPNUMLIMIT = "LimitExceeded.EipNumLimit" -// LIMITEXCEEDED_ENINUMLIMIT = "LimitExceeded.EniNumLimit" -// LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION_HETEROGENEOUSCHANGEINSTANCEFAMILY = "UnsupportedOperation.HeterogeneousChangeInstanceFamily" -// UNSUPPORTEDOPERATION_LOCALDATADISKCHANGEINSTANCEFAMILY = "UnsupportedOperation.LocalDataDiskChangeInstanceFamily" -// UNSUPPORTEDOPERATION_ORIGINALINSTANCETYPEINVALID = "UnsupportedOperation.OriginalInstanceTypeInvalid" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGINGSAMEFAMILY = "UnsupportedOperation.StoppedModeStopChargingSameFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDARMCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedARMChangeInstanceFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILYTOARM = "UnsupportedOperation.UnsupportedChangeInstanceFamilyToARM" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCETOTHISINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceToThisInstanceFamily" -func (c *Client) InquiryPriceResetInstancesType(request *InquiryPriceResetInstancesTypeRequest) (response *InquiryPriceResetInstancesTypeResponse, err error) { - return c.InquiryPriceResetInstancesTypeWithContext(context.Background(), request) -} - -// InquiryPriceResetInstancesType -// 本接口 (InquiryPriceResetInstancesType) 用于调整实例的机型询价。 -// -// * 目前只支持[系统盘类型](https://cloud.tencent.com/document/product/213/15753#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行调整机型询价。 -// -// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型询价。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYREFUNDPRICEFAILED = "FailedOperation.InquiryRefundPriceFailed" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BASICNETWORKINSTANCEFAMILY = "InvalidParameterValue.BasicNetworkInstanceFamily" -// INVALIDPARAMETERVALUE_GPUINSTANCEFAMILY = "InvalidParameterValue.GPUInstanceFamily" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDINSTANCESOURCE = "InvalidParameterValue.InvalidInstanceSource" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_EIPNUMLIMIT = "LimitExceeded.EipNumLimit" -// LIMITEXCEEDED_ENINUMLIMIT = "LimitExceeded.EniNumLimit" -// LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION_HETEROGENEOUSCHANGEINSTANCEFAMILY = "UnsupportedOperation.HeterogeneousChangeInstanceFamily" -// UNSUPPORTEDOPERATION_LOCALDATADISKCHANGEINSTANCEFAMILY = "UnsupportedOperation.LocalDataDiskChangeInstanceFamily" -// UNSUPPORTEDOPERATION_ORIGINALINSTANCETYPEINVALID = "UnsupportedOperation.OriginalInstanceTypeInvalid" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGINGSAMEFAMILY = "UnsupportedOperation.StoppedModeStopChargingSameFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDARMCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedARMChangeInstanceFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILYTOARM = "UnsupportedOperation.UnsupportedChangeInstanceFamilyToARM" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCETOTHISINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceToThisInstanceFamily" -func (c *Client) InquiryPriceResetInstancesTypeWithContext(ctx context.Context, request *InquiryPriceResetInstancesTypeRequest) (response *InquiryPriceResetInstancesTypeResponse, err error) { - if request == nil { - request = NewInquiryPriceResetInstancesTypeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceResetInstancesType require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceResetInstancesTypeResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceResizeInstanceDisksRequest() (request *InquiryPriceResizeInstanceDisksRequest) { - request = &InquiryPriceResizeInstanceDisksRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceResizeInstanceDisks") - - return -} - -func NewInquiryPriceResizeInstanceDisksResponse() (response *InquiryPriceResizeInstanceDisksResponse) { - response = &InquiryPriceResizeInstanceDisksResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceResizeInstanceDisks -// 本接口 (InquiryPriceResizeInstanceDisks) 用于扩容实例的数据盘询价。 -// -// * 目前只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性)询价,且[数据盘类型](https://cloud.tencent.com/document/product/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。 -// -// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口扩容数据盘询价。* 仅支持包年包月实例随机器购买的数据盘。* 目前只支持扩容一块数据盘询价。 -// -// 可能返回的错误码: -// -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_LOCALDISKMIGRATINGTOCLOUDDISK = "UnsupportedOperation.LocalDiskMigratingToCloudDisk" -func (c *Client) InquiryPriceResizeInstanceDisks(request *InquiryPriceResizeInstanceDisksRequest) (response *InquiryPriceResizeInstanceDisksResponse, err error) { - return c.InquiryPriceResizeInstanceDisksWithContext(context.Background(), request) -} - -// InquiryPriceResizeInstanceDisks -// 本接口 (InquiryPriceResizeInstanceDisks) 用于扩容实例的数据盘询价。 -// -// * 目前只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性)询价,且[数据盘类型](https://cloud.tencent.com/document/product/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。 -// -// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口扩容数据盘询价。* 仅支持包年包月实例随机器购买的数据盘。* 目前只支持扩容一块数据盘询价。 -// -// 可能返回的错误码: -// -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_LOCALDISKMIGRATINGTOCLOUDDISK = "UnsupportedOperation.LocalDiskMigratingToCloudDisk" -func (c *Client) InquiryPriceResizeInstanceDisksWithContext(ctx context.Context, request *InquiryPriceResizeInstanceDisksRequest) (response *InquiryPriceResizeInstanceDisksResponse, err error) { - if request == nil { - request = NewInquiryPriceResizeInstanceDisksRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceResizeInstanceDisks require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceResizeInstanceDisksResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceRunInstancesRequest() (request *InquiryPriceRunInstancesRequest) { - request = &InquiryPriceRunInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceRunInstances") - - return -} - -func NewInquiryPriceRunInstancesResponse() (response *InquiryPriceRunInstancesResponse) { - response = &InquiryPriceRunInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceRunInstances -// 本接口(InquiryPriceRunInstances)用于创建实例询价。本接口仅允许针对购买限制范围内的实例配置进行询价, 详见:[创建实例](https://cloud.tencent.com/document/api/213/15730)。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// FAILEDOPERATION_ILLEGALTAGVALUE = "FailedOperation.IllegalTagValue" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_SNAPSHOTSIZELARGERTHANDATASIZE = "FailedOperation.SnapshotSizeLargerThanDataSize" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// FAILEDOPERATION_TATAGENTNOTSUPPORT = "FailedOperation.TatAgentNotSupport" -// INSTANCESQUOTALIMITEXCEEDED = "InstancesQuotaLimitExceeded" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INTERNETACCESSIBLENOTSUPPORTED = "InvalidParameter.InternetAccessibleNotSupported" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDNOTFOUND = "InvalidParameterValue.BandwidthPackageIdNotFound" -// INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" -// INVALIDPARAMETERVALUE_DUPLICATETAGS = "InvalidParameterValue.DuplicateTags" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" -// INVALIDPARAMETERVALUE_INSTANCETYPEREQUIREDHPCCLUSTER = "InvalidParameterValue.InstanceTypeRequiredHpcCluster" -// INVALIDPARAMETERVALUE_INSUFFICIENTPRICE = "InvalidParameterValue.InsufficientPrice" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORMAT = "InvalidParameterValue.InvalidImageFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_TAGQUOTALIMITEXCEEDED = "InvalidParameterValue.TagQuotaLimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPASSWORD = "InvalidPassword" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_DISASTERRECOVERGROUP = "LimitExceeded.DisasterRecoverGroup" -// LIMITEXCEEDED_INSTANCEENINUMLIMIT = "LimitExceeded.InstanceEniNumLimit" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" -// RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_INVALIDREGIONDISKENCRYPT = "UnsupportedOperation.InvalidRegionDiskEncrypt" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_NOTSUPPORTIMPORTINSTANCESACTIONTIMER = "UnsupportedOperation.NotSupportImportInstancesActionTimer" -// UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" -// UNSUPPORTEDOPERATION_SPOTUNSUPPORTEDREGION = "UnsupportedOperation.SpotUnsupportedRegion" -// UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" -// UNSUPPORTEDOPERATION_UNSUPPORTEDINTERNATIONALUSER = "UnsupportedOperation.UnsupportedInternationalUser" -func (c *Client) InquiryPriceRunInstances(request *InquiryPriceRunInstancesRequest) (response *InquiryPriceRunInstancesResponse, err error) { - return c.InquiryPriceRunInstancesWithContext(context.Background(), request) -} - -// InquiryPriceRunInstances -// 本接口(InquiryPriceRunInstances)用于创建实例询价。本接口仅允许针对购买限制范围内的实例配置进行询价, 详见:[创建实例](https://cloud.tencent.com/document/api/213/15730)。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// FAILEDOPERATION_ILLEGALTAGVALUE = "FailedOperation.IllegalTagValue" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_SNAPSHOTSIZELARGERTHANDATASIZE = "FailedOperation.SnapshotSizeLargerThanDataSize" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// FAILEDOPERATION_TATAGENTNOTSUPPORT = "FailedOperation.TatAgentNotSupport" -// INSTANCESQUOTALIMITEXCEEDED = "InstancesQuotaLimitExceeded" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INTERNETACCESSIBLENOTSUPPORTED = "InvalidParameter.InternetAccessibleNotSupported" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDNOTFOUND = "InvalidParameterValue.BandwidthPackageIdNotFound" -// INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" -// INVALIDPARAMETERVALUE_DUPLICATETAGS = "InvalidParameterValue.DuplicateTags" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" -// INVALIDPARAMETERVALUE_INSTANCETYPEREQUIREDHPCCLUSTER = "InvalidParameterValue.InstanceTypeRequiredHpcCluster" -// INVALIDPARAMETERVALUE_INSUFFICIENTPRICE = "InvalidParameterValue.InsufficientPrice" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORMAT = "InvalidParameterValue.InvalidImageFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_TAGQUOTALIMITEXCEEDED = "InvalidParameterValue.TagQuotaLimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPASSWORD = "InvalidPassword" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_DISASTERRECOVERGROUP = "LimitExceeded.DisasterRecoverGroup" -// LIMITEXCEEDED_INSTANCEENINUMLIMIT = "LimitExceeded.InstanceEniNumLimit" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" -// RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_INVALIDREGIONDISKENCRYPT = "UnsupportedOperation.InvalidRegionDiskEncrypt" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_NOTSUPPORTIMPORTINSTANCESACTIONTIMER = "UnsupportedOperation.NotSupportImportInstancesActionTimer" -// UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" -// UNSUPPORTEDOPERATION_SPOTUNSUPPORTEDREGION = "UnsupportedOperation.SpotUnsupportedRegion" -// UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" -// UNSUPPORTEDOPERATION_UNSUPPORTEDINTERNATIONALUSER = "UnsupportedOperation.UnsupportedInternationalUser" -func (c *Client) InquiryPriceRunInstancesWithContext(ctx context.Context, request *InquiryPriceRunInstancesRequest) (response *InquiryPriceRunInstancesResponse, err error) { - if request == nil { - request = NewInquiryPriceRunInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceRunInstances require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceRunInstancesResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceTerminateInstancesRequest() (request *InquiryPriceTerminateInstancesRequest) { - request = &InquiryPriceTerminateInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceTerminateInstances") - - return -} - -func NewInquiryPriceTerminateInstancesResponse() (response *InquiryPriceTerminateInstancesResponse) { - response = &InquiryPriceTerminateInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceTerminateInstances -// 本接口 (InquiryPriceTerminateInstances) 用于退还实例询价。 -// -// * 查询退还实例可以返还的费用。 -// -// * 在退还包年包月实例时,使用ReleasePrepaidDataDisks参数,会在返回值中包含退还挂载的包年包月数据盘返还的费用。 -// -// * 支持批量操作,每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYREFUNDPRICEFAILED = "FailedOperation.InquiryRefundPriceFailed" -// FAILEDOPERATION_UNRETURNABLE = "FailedOperation.Unreturnable" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCENOTSUPPORTEDPREPAIDINSTANCE = "InvalidInstanceNotSupportedPrepaidInstance" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDPRICINGMODEL = "UnsupportedOperation.InstanceMixedPricingModel" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_REGION = "UnsupportedOperation.Region" -func (c *Client) InquiryPriceTerminateInstances(request *InquiryPriceTerminateInstancesRequest) (response *InquiryPriceTerminateInstancesResponse, err error) { - return c.InquiryPriceTerminateInstancesWithContext(context.Background(), request) -} - -// InquiryPriceTerminateInstances -// 本接口 (InquiryPriceTerminateInstances) 用于退还实例询价。 -// -// * 查询退还实例可以返还的费用。 -// -// * 在退还包年包月实例时,使用ReleasePrepaidDataDisks参数,会在返回值中包含退还挂载的包年包月数据盘返还的费用。 -// -// * 支持批量操作,每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INQUIRYREFUNDPRICEFAILED = "FailedOperation.InquiryRefundPriceFailed" -// FAILEDOPERATION_UNRETURNABLE = "FailedOperation.Unreturnable" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCENOTSUPPORTEDPREPAIDINSTANCE = "InvalidInstanceNotSupportedPrepaidInstance" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDPRICINGMODEL = "UnsupportedOperation.InstanceMixedPricingModel" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_REGION = "UnsupportedOperation.Region" -func (c *Client) InquiryPriceTerminateInstancesWithContext(ctx context.Context, request *InquiryPriceTerminateInstancesRequest) (response *InquiryPriceTerminateInstancesResponse, err error) { - if request == nil { - request = NewInquiryPriceTerminateInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceTerminateInstances require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceTerminateInstancesResponse() - err = c.Send(request, response) - return -} - -func NewModifyChcAttributeRequest() (request *ModifyChcAttributeRequest) { - request = &ModifyChcAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyChcAttribute") - - return -} - -func NewModifyChcAttributeResponse() (response *ModifyChcAttributeResponse) { - response = &ModifyChcAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyChcAttribute -// 修改CHC物理服务器的属性 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_CHCNETWORKEMPTY = "InvalidParameterValue.ChcNetworkEmpty" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NOTEMPTY = "InvalidParameterValue.NotEmpty" -// INVALIDPASSWORD = "InvalidPassword" -func (c *Client) ModifyChcAttribute(request *ModifyChcAttributeRequest) (response *ModifyChcAttributeResponse, err error) { - return c.ModifyChcAttributeWithContext(context.Background(), request) -} - -// ModifyChcAttribute -// 修改CHC物理服务器的属性 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_CHCNETWORKEMPTY = "InvalidParameterValue.ChcNetworkEmpty" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NOTEMPTY = "InvalidParameterValue.NotEmpty" -// INVALIDPASSWORD = "InvalidPassword" -func (c *Client) ModifyChcAttributeWithContext(ctx context.Context, request *ModifyChcAttributeRequest) (response *ModifyChcAttributeResponse, err error) { - if request == nil { - request = NewModifyChcAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyChcAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyChcAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyDisasterRecoverGroupAttributeRequest() (request *ModifyDisasterRecoverGroupAttributeRequest) { - request = &ModifyDisasterRecoverGroupAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyDisasterRecoverGroupAttribute") - - return -} - -func NewModifyDisasterRecoverGroupAttributeResponse() (response *ModifyDisasterRecoverGroupAttributeResponse) { - response = &ModifyDisasterRecoverGroupAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyDisasterRecoverGroupAttribute -// 本接口 (ModifyDisasterRecoverGroupAttribute)用于修改[分散置放群组](https://cloud.tencent.com/document/product/213/15486)属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCENOTFOUND_INVALIDPLACEMENTSET = "ResourceNotFound.InvalidPlacementSet" -func (c *Client) ModifyDisasterRecoverGroupAttribute(request *ModifyDisasterRecoverGroupAttributeRequest) (response *ModifyDisasterRecoverGroupAttributeResponse, err error) { - return c.ModifyDisasterRecoverGroupAttributeWithContext(context.Background(), request) -} - -// ModifyDisasterRecoverGroupAttribute -// 本接口 (ModifyDisasterRecoverGroupAttribute)用于修改[分散置放群组](https://cloud.tencent.com/document/product/213/15486)属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCENOTFOUND_INVALIDPLACEMENTSET = "ResourceNotFound.InvalidPlacementSet" -func (c *Client) ModifyDisasterRecoverGroupAttributeWithContext(ctx context.Context, request *ModifyDisasterRecoverGroupAttributeRequest) (response *ModifyDisasterRecoverGroupAttributeResponse, err error) { - if request == nil { - request = NewModifyDisasterRecoverGroupAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyDisasterRecoverGroupAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyDisasterRecoverGroupAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyHostsAttributeRequest() (request *ModifyHostsAttributeRequest) { - request = &ModifyHostsAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyHostsAttribute") - - return -} - -func NewModifyHostsAttributeResponse() (response *ModifyHostsAttributeResponse) { - response = &ModifyHostsAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyHostsAttribute -// 本接口(ModifyHostsAttribute)用于修改CDH实例的属性,如实例名称和续费标记等。参数HostName和RenewFlag必须设置其中一个,但不能同时设置。 -// -// 可能返回的错误码: -// -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -func (c *Client) ModifyHostsAttribute(request *ModifyHostsAttributeRequest) (response *ModifyHostsAttributeResponse, err error) { - return c.ModifyHostsAttributeWithContext(context.Background(), request) -} - -// ModifyHostsAttribute -// 本接口(ModifyHostsAttribute)用于修改CDH实例的属性,如实例名称和续费标记等。参数HostName和RenewFlag必须设置其中一个,但不能同时设置。 -// -// 可能返回的错误码: -// -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -func (c *Client) ModifyHostsAttributeWithContext(ctx context.Context, request *ModifyHostsAttributeRequest) (response *ModifyHostsAttributeResponse, err error) { - if request == nil { - request = NewModifyHostsAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyHostsAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyHostsAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyHpcClusterAttributeRequest() (request *ModifyHpcClusterAttributeRequest) { - request = &ModifyHpcClusterAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyHpcClusterAttribute") - - return -} - -func NewModifyHpcClusterAttributeResponse() (response *ModifyHpcClusterAttributeResponse) { - response = &ModifyHpcClusterAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyHpcClusterAttribute -// 修改高性能计算集群属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -func (c *Client) ModifyHpcClusterAttribute(request *ModifyHpcClusterAttributeRequest) (response *ModifyHpcClusterAttributeResponse, err error) { - return c.ModifyHpcClusterAttributeWithContext(context.Background(), request) -} - -// ModifyHpcClusterAttribute -// 修改高性能计算集群属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -func (c *Client) ModifyHpcClusterAttributeWithContext(ctx context.Context, request *ModifyHpcClusterAttributeRequest) (response *ModifyHpcClusterAttributeResponse, err error) { - if request == nil { - request = NewModifyHpcClusterAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyHpcClusterAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyHpcClusterAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyImageAttributeRequest() (request *ModifyImageAttributeRequest) { - request = &ModifyImageAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyImageAttribute") - - return -} - -func NewModifyImageAttributeResponse() (response *ModifyImageAttributeResponse) { - response = &ModifyImageAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyImageAttribute -// 本接口(ModifyImageAttribute)用于修改镜像属性。 -// -// * 已分享的镜像无法修改属性。 -// -// 可能返回的错误码: -// -// INVALIDIMAGEID_INCORRECTSTATE = "InvalidImageId.IncorrectState" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -func (c *Client) ModifyImageAttribute(request *ModifyImageAttributeRequest) (response *ModifyImageAttributeResponse, err error) { - return c.ModifyImageAttributeWithContext(context.Background(), request) -} - -// ModifyImageAttribute -// 本接口(ModifyImageAttribute)用于修改镜像属性。 -// -// * 已分享的镜像无法修改属性。 -// -// 可能返回的错误码: -// -// INVALIDIMAGEID_INCORRECTSTATE = "InvalidImageId.IncorrectState" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -func (c *Client) ModifyImageAttributeWithContext(ctx context.Context, request *ModifyImageAttributeRequest) (response *ModifyImageAttributeResponse, err error) { - if request == nil { - request = NewModifyImageAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyImageAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyImageAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyImageSharePermissionRequest() (request *ModifyImageSharePermissionRequest) { - request = &ModifyImageSharePermissionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyImageSharePermission") - - return -} - -func NewModifyImageSharePermissionResponse() (response *ModifyImageSharePermissionResponse) { - response = &ModifyImageSharePermissionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyImageSharePermission -// 本接口(ModifyImageSharePermission)用于修改镜像分享信息。 -// -// * 分享镜像后,被分享账户可以通过该镜像创建实例。 -// -// * 每个自定义镜像最多可共享给50个账户。 -// -// * 分享镜像无法更改名称,描述,仅可用于创建实例。 -// -// * 只支持分享到对方账户相同地域。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ACCOUNTALREADYEXISTS = "FailedOperation.AccountAlreadyExists" -// FAILEDOPERATION_ACCOUNTISYOURSELF = "FailedOperation.AccountIsYourSelf" -// FAILEDOPERATION_BYOLIMAGESHAREFAILED = "FailedOperation.BYOLImageShareFailed" -// FAILEDOPERATION_NOTMASTERACCOUNT = "FailedOperation.NotMasterAccount" -// FAILEDOPERATION_QIMAGESHAREFAILED = "FailedOperation.QImageShareFailed" -// FAILEDOPERATION_RIMAGESHAREFAILED = "FailedOperation.RImageShareFailed" -// INVALIDACCOUNTID_NOTFOUND = "InvalidAccountId.NotFound" -// INVALIDACCOUNTIS_YOURSELF = "InvalidAccountIs.YourSelf" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// OVERQUOTA = "OverQuota" -// UNAUTHORIZEDOPERATION_IMAGENOTBELONGTOACCOUNT = "UnauthorizedOperation.ImageNotBelongToAccount" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -func (c *Client) ModifyImageSharePermission(request *ModifyImageSharePermissionRequest) (response *ModifyImageSharePermissionResponse, err error) { - return c.ModifyImageSharePermissionWithContext(context.Background(), request) -} - -// ModifyImageSharePermission -// 本接口(ModifyImageSharePermission)用于修改镜像分享信息。 -// -// * 分享镜像后,被分享账户可以通过该镜像创建实例。 -// -// * 每个自定义镜像最多可共享给50个账户。 -// -// * 分享镜像无法更改名称,描述,仅可用于创建实例。 -// -// * 只支持分享到对方账户相同地域。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ACCOUNTALREADYEXISTS = "FailedOperation.AccountAlreadyExists" -// FAILEDOPERATION_ACCOUNTISYOURSELF = "FailedOperation.AccountIsYourSelf" -// FAILEDOPERATION_BYOLIMAGESHAREFAILED = "FailedOperation.BYOLImageShareFailed" -// FAILEDOPERATION_NOTMASTERACCOUNT = "FailedOperation.NotMasterAccount" -// FAILEDOPERATION_QIMAGESHAREFAILED = "FailedOperation.QImageShareFailed" -// FAILEDOPERATION_RIMAGESHAREFAILED = "FailedOperation.RImageShareFailed" -// INVALIDACCOUNTID_NOTFOUND = "InvalidAccountId.NotFound" -// INVALIDACCOUNTIS_YOURSELF = "InvalidAccountIs.YourSelf" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// OVERQUOTA = "OverQuota" -// UNAUTHORIZEDOPERATION_IMAGENOTBELONGTOACCOUNT = "UnauthorizedOperation.ImageNotBelongToAccount" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -func (c *Client) ModifyImageSharePermissionWithContext(ctx context.Context, request *ModifyImageSharePermissionRequest) (response *ModifyImageSharePermissionResponse, err error) { - if request == nil { - request = NewModifyImageSharePermissionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyImageSharePermission require credential") - } - - request.SetContext(ctx) - - response = NewModifyImageSharePermissionResponse() - err = c.Send(request, response) - return -} - -func NewModifyInstanceDiskTypeRequest() (request *ModifyInstanceDiskTypeRequest) { - request = &ModifyInstanceDiskTypeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstanceDiskType") - - return -} - -func NewModifyInstanceDiskTypeResponse() (response *ModifyInstanceDiskTypeResponse) { - response = &ModifyInstanceDiskTypeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyInstanceDiskType -// 本接口 (ModifyInstanceDiskType) 用于修改实例硬盘介质类型。 -// -// * 只支持实例的本地系统盘、本地数据盘转化成指定云硬盘介质。 -// -// * 只支持实例在关机状态下转换成指定云硬盘介质。 -// -// * 不支持竞价实例类型。 -// -// * 若实例同时存在本地系统盘和本地数据盘,需同时调整系统盘和数据盘的介质类型,不支持单独针对本地系统盘或本地数据盘修改介质类型。 -// -// * 修改前请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/378/4397)接口查询账户余额。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_INVALIDCLOUDDISKSOLDOUT = "InvalidParameter.InvalidCloudDiskSoldOut" -// INVALIDPARAMETER_INVALIDINSTANCENOTSUPPORTED = "InvalidParameter.InvalidInstanceNotSupported" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LOCALDISKSIZERANGE = "InvalidParameterValue.LocalDiskSizeRange" -// INVALIDPERMISSION = "InvalidPermission" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// UNSUPPORTEDOPERATION_EDGEZONENOTSUPPORTCLOUDDISK = "UnsupportedOperation.EdgeZoneNotSupportCloudDisk" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ModifyInstanceDiskType(request *ModifyInstanceDiskTypeRequest) (response *ModifyInstanceDiskTypeResponse, err error) { - return c.ModifyInstanceDiskTypeWithContext(context.Background(), request) -} - -// ModifyInstanceDiskType -// 本接口 (ModifyInstanceDiskType) 用于修改实例硬盘介质类型。 -// -// * 只支持实例的本地系统盘、本地数据盘转化成指定云硬盘介质。 -// -// * 只支持实例在关机状态下转换成指定云硬盘介质。 -// -// * 不支持竞价实例类型。 -// -// * 若实例同时存在本地系统盘和本地数据盘,需同时调整系统盘和数据盘的介质类型,不支持单独针对本地系统盘或本地数据盘修改介质类型。 -// -// * 修改前请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/378/4397)接口查询账户余额。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_INVALIDCLOUDDISKSOLDOUT = "InvalidParameter.InvalidCloudDiskSoldOut" -// INVALIDPARAMETER_INVALIDINSTANCENOTSUPPORTED = "InvalidParameter.InvalidInstanceNotSupported" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LOCALDISKSIZERANGE = "InvalidParameterValue.LocalDiskSizeRange" -// INVALIDPERMISSION = "InvalidPermission" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// UNSUPPORTEDOPERATION_EDGEZONENOTSUPPORTCLOUDDISK = "UnsupportedOperation.EdgeZoneNotSupportCloudDisk" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ModifyInstanceDiskTypeWithContext(ctx context.Context, request *ModifyInstanceDiskTypeRequest) (response *ModifyInstanceDiskTypeResponse, err error) { - if request == nil { - request = NewModifyInstanceDiskTypeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyInstanceDiskType require credential") - } - - request.SetContext(ctx) - - response = NewModifyInstanceDiskTypeResponse() - err = c.Send(request, response) - return -} - -func NewModifyInstancesAttributeRequest() (request *ModifyInstancesAttributeRequest) { - request = &ModifyInstancesAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesAttribute") - - return -} - -func NewModifyInstancesAttributeResponse() (response *ModifyInstancesAttributeResponse) { - response = &ModifyInstancesAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyInstancesAttribute -// 本接口 (ModifyInstancesAttribute) 用于修改实例的属性(目前只支持修改实例的名称和关联的安全组)。 -// -// * 每次请求必须指定实例的一种属性用于修改。 -// -// * “实例名称”仅为方便用户自己管理之用,腾讯云并不以此名称作为在线支持或是进行实例管理操作的依据。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 修改关联安全组时,子机原来关联的安全组会被解绑。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDPARAMETER_HOSTNAMEILLEGAL = "InvalidParameter.HostNameIllegal" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CAMROLENAMEMALFORMED = "InvalidParameterValue.CamRoleNameMalformed" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// LIMITEXCEEDED_ASSOCIATEUSGLIMITEXCEEDED = "LimitExceeded.AssociateUSGLimitExceeded" -// LIMITEXCEEDED_CVMSVIFSPERSECGROUPLIMITEXCEEDED = "LimitExceeded.CvmsVifsPerSecGroupLimitExceeded" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDINSTANCENOTSUPPORTEDPROTECTEDINSTANCE = "UnsupportedOperation.InvalidInstanceNotSupportedProtectedInstance" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ModifyInstancesAttribute(request *ModifyInstancesAttributeRequest) (response *ModifyInstancesAttributeResponse, err error) { - return c.ModifyInstancesAttributeWithContext(context.Background(), request) -} - -// ModifyInstancesAttribute -// 本接口 (ModifyInstancesAttribute) 用于修改实例的属性(目前只支持修改实例的名称和关联的安全组)。 -// -// * 每次请求必须指定实例的一种属性用于修改。 -// -// * “实例名称”仅为方便用户自己管理之用,腾讯云并不以此名称作为在线支持或是进行实例管理操作的依据。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 修改关联安全组时,子机原来关联的安全组会被解绑。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDPARAMETER_HOSTNAMEILLEGAL = "InvalidParameter.HostNameIllegal" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CAMROLENAMEMALFORMED = "InvalidParameterValue.CamRoleNameMalformed" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// LIMITEXCEEDED_ASSOCIATEUSGLIMITEXCEEDED = "LimitExceeded.AssociateUSGLimitExceeded" -// LIMITEXCEEDED_CVMSVIFSPERSECGROUPLIMITEXCEEDED = "LimitExceeded.CvmsVifsPerSecGroupLimitExceeded" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDINSTANCENOTSUPPORTEDPROTECTEDINSTANCE = "UnsupportedOperation.InvalidInstanceNotSupportedProtectedInstance" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ModifyInstancesAttributeWithContext(ctx context.Context, request *ModifyInstancesAttributeRequest) (response *ModifyInstancesAttributeResponse, err error) { - if request == nil { - request = NewModifyInstancesAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyInstancesAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyInstancesAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyInstancesChargeTypeRequest() (request *ModifyInstancesChargeTypeRequest) { - request = &ModifyInstancesChargeTypeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesChargeType") - - return -} - -func NewModifyInstancesChargeTypeResponse() (response *ModifyInstancesChargeTypeResponse) { - response = &ModifyInstancesChargeTypeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyInstancesChargeType -// 本接口 (ModifyInstancesChargeType) 用于切换实例的计费模式。 -// -// * 关机不收费的实例、`BC1`和`BS1`机型族的实例、设置定时销毁的实例不支持该操作。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// FAILEDOPERATION_PROMOTIONALPERIORESTRICTION = "FailedOperation.PromotionalPerioRestriction" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" -// LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" -// MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_REDHATINSTANCEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceUnsupported" -// UNSUPPORTEDOPERATION_UNDERWRITEDISCOUNTGREATERTHANPREPAIDDISCOUNT = "UnsupportedOperation.UnderwriteDiscountGreaterThanPrepaidDiscount" -// UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" -func (c *Client) ModifyInstancesChargeType(request *ModifyInstancesChargeTypeRequest) (response *ModifyInstancesChargeTypeResponse, err error) { - return c.ModifyInstancesChargeTypeWithContext(context.Background(), request) -} - -// ModifyInstancesChargeType -// 本接口 (ModifyInstancesChargeType) 用于切换实例的计费模式。 -// -// * 关机不收费的实例、`BC1`和`BS1`机型族的实例、设置定时销毁的实例不支持该操作。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// FAILEDOPERATION_PROMOTIONALPERIORESTRICTION = "FailedOperation.PromotionalPerioRestriction" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" -// LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" -// MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_REDHATINSTANCEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceUnsupported" -// UNSUPPORTEDOPERATION_UNDERWRITEDISCOUNTGREATERTHANPREPAIDDISCOUNT = "UnsupportedOperation.UnderwriteDiscountGreaterThanPrepaidDiscount" -// UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" -func (c *Client) ModifyInstancesChargeTypeWithContext(ctx context.Context, request *ModifyInstancesChargeTypeRequest) (response *ModifyInstancesChargeTypeResponse, err error) { - if request == nil { - request = NewModifyInstancesChargeTypeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyInstancesChargeType require credential") - } - - request.SetContext(ctx) - - response = NewModifyInstancesChargeTypeResponse() - err = c.Send(request, response) - return -} - -func NewModifyInstancesProjectRequest() (request *ModifyInstancesProjectRequest) { - request = &ModifyInstancesProjectRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesProject") - - return -} - -func NewModifyInstancesProjectResponse() (response *ModifyInstancesProjectResponse) { - response = &ModifyInstancesProjectResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyInstancesProject -// 本接口 (ModifyInstancesProject) 用于修改实例所属项目。 -// -// * 项目为一个虚拟概念,用户可以在一个账户下面建立多个项目,每个项目中管理不同的资源;将多个不同实例分属到不同项目中,后续使用 [`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口查询实例,项目ID可用于过滤结果。 -// -// * 绑定负载均衡的实例不支持修改实例所属项目,请先使用[`DeregisterInstancesFromLoadBalancer`](https://cloud.tencent.com/document/api/214/1258)接口解绑负载均衡。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -func (c *Client) ModifyInstancesProject(request *ModifyInstancesProjectRequest) (response *ModifyInstancesProjectResponse, err error) { - return c.ModifyInstancesProjectWithContext(context.Background(), request) -} - -// ModifyInstancesProject -// 本接口 (ModifyInstancesProject) 用于修改实例所属项目。 -// -// * 项目为一个虚拟概念,用户可以在一个账户下面建立多个项目,每个项目中管理不同的资源;将多个不同实例分属到不同项目中,后续使用 [`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口查询实例,项目ID可用于过滤结果。 -// -// * 绑定负载均衡的实例不支持修改实例所属项目,请先使用[`DeregisterInstancesFromLoadBalancer`](https://cloud.tencent.com/document/api/214/1258)接口解绑负载均衡。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -func (c *Client) ModifyInstancesProjectWithContext(ctx context.Context, request *ModifyInstancesProjectRequest) (response *ModifyInstancesProjectResponse, err error) { - if request == nil { - request = NewModifyInstancesProjectRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyInstancesProject require credential") - } - - request.SetContext(ctx) - - response = NewModifyInstancesProjectResponse() - err = c.Send(request, response) - return -} - -func NewModifyInstancesRenewFlagRequest() (request *ModifyInstancesRenewFlagRequest) { - request = &ModifyInstancesRenewFlagRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesRenewFlag") - - return -} - -func NewModifyInstancesRenewFlagResponse() (response *ModifyInstancesRenewFlagResponse) { - response = &ModifyInstancesRenewFlagResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyInstancesRenewFlag -// 本接口 (ModifyInstancesRenewFlag) 用于修改包年包月实例续费标识。 -// -// * 实例被标识为自动续费后,每次在实例到期时,会自动续费一个月。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" -func (c *Client) ModifyInstancesRenewFlag(request *ModifyInstancesRenewFlagRequest) (response *ModifyInstancesRenewFlagResponse, err error) { - return c.ModifyInstancesRenewFlagWithContext(context.Background(), request) -} - -// ModifyInstancesRenewFlag -// 本接口 (ModifyInstancesRenewFlag) 用于修改包年包月实例续费标识。 -// -// * 实例被标识为自动续费后,每次在实例到期时,会自动续费一个月。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" -func (c *Client) ModifyInstancesRenewFlagWithContext(ctx context.Context, request *ModifyInstancesRenewFlagRequest) (response *ModifyInstancesRenewFlagResponse, err error) { - if request == nil { - request = NewModifyInstancesRenewFlagRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyInstancesRenewFlag require credential") - } - - request.SetContext(ctx) - - response = NewModifyInstancesRenewFlagResponse() - err = c.Send(request, response) - return -} - -func NewModifyInstancesVpcAttributeRequest() (request *ModifyInstancesVpcAttributeRequest) { - request = &ModifyInstancesVpcAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesVpcAttribute") - - return -} - -func NewModifyInstancesVpcAttributeResponse() (response *ModifyInstancesVpcAttributeResponse) { - response = &ModifyInstancesVpcAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyInstancesVpcAttribute -// 本接口(ModifyInstancesVpcAttribute)用于修改实例vpc属性,如私有网络IP。 -// -// * 此操作默认会关闭实例,完成后再启动。 -// -// * 当指定私有网络ID和子网ID(子网必须在实例所在的可用区)与指定实例所在私有网络不一致时,会将实例迁移至指定的私有网络的子网下。执行此操作前请确保指定的实例上没有绑定[弹性网卡](https://cloud.tencent.com/document/product/576)和[负载均衡](https://cloud.tencent.com/document/product/214)。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// ENINOTALLOWEDCHANGESUBNET = "EniNotAllowedChangeSubnet" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCESTATE = "InvalidInstanceState" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_EDGEZONEINSTANCE = "UnsupportedOperation.EdgeZoneInstance" -// UNSUPPORTEDOPERATION_ELASTICNETWORKINTERFACE = "UnsupportedOperation.ElasticNetworkInterface" -// UNSUPPORTEDOPERATION_IPV6NOTSUPPORTVPCMIGRATE = "UnsupportedOperation.IPv6NotSupportVpcMigrate" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_MODIFYVPCWITHCLB = "UnsupportedOperation.ModifyVPCWithCLB" -// UNSUPPORTEDOPERATION_MODIFYVPCWITHCLASSLINK = "UnsupportedOperation.ModifyVPCWithClassLink" -// UNSUPPORTEDOPERATION_NOVPCNETWORK = "UnsupportedOperation.NoVpcNetwork" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) ModifyInstancesVpcAttribute(request *ModifyInstancesVpcAttributeRequest) (response *ModifyInstancesVpcAttributeResponse, err error) { - return c.ModifyInstancesVpcAttributeWithContext(context.Background(), request) -} - -// ModifyInstancesVpcAttribute -// 本接口(ModifyInstancesVpcAttribute)用于修改实例vpc属性,如私有网络IP。 -// -// * 此操作默认会关闭实例,完成后再启动。 -// -// * 当指定私有网络ID和子网ID(子网必须在实例所在的可用区)与指定实例所在私有网络不一致时,会将实例迁移至指定的私有网络的子网下。执行此操作前请确保指定的实例上没有绑定[弹性网卡](https://cloud.tencent.com/document/product/576)和[负载均衡](https://cloud.tencent.com/document/product/214)。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// ENINOTALLOWEDCHANGESUBNET = "EniNotAllowedChangeSubnet" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCESTATE = "InvalidInstanceState" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_EDGEZONEINSTANCE = "UnsupportedOperation.EdgeZoneInstance" -// UNSUPPORTEDOPERATION_ELASTICNETWORKINTERFACE = "UnsupportedOperation.ElasticNetworkInterface" -// UNSUPPORTEDOPERATION_IPV6NOTSUPPORTVPCMIGRATE = "UnsupportedOperation.IPv6NotSupportVpcMigrate" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_MODIFYVPCWITHCLB = "UnsupportedOperation.ModifyVPCWithCLB" -// UNSUPPORTEDOPERATION_MODIFYVPCWITHCLASSLINK = "UnsupportedOperation.ModifyVPCWithClassLink" -// UNSUPPORTEDOPERATION_NOVPCNETWORK = "UnsupportedOperation.NoVpcNetwork" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) ModifyInstancesVpcAttributeWithContext(ctx context.Context, request *ModifyInstancesVpcAttributeRequest) (response *ModifyInstancesVpcAttributeResponse, err error) { - if request == nil { - request = NewModifyInstancesVpcAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyInstancesVpcAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyInstancesVpcAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyKeyPairAttributeRequest() (request *ModifyKeyPairAttributeRequest) { - request = &ModifyKeyPairAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyKeyPairAttribute") - - return -} - -func NewModifyKeyPairAttributeResponse() (response *ModifyKeyPairAttributeResponse) { - response = &ModifyKeyPairAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyKeyPairAttribute -// 本接口 (ModifyKeyPairAttribute) 用于修改密钥对属性。 -// -// * 修改密钥对ID所指定的密钥对的名称和描述信息。 -// -// * 密钥对名称不能和已经存在的密钥对的名称重复。 -// -// * 密钥对ID是密钥对的唯一标识,不可修改。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" -// INVALIDKEYPAIRNAME_DUPLICATE = "InvalidKeyPairName.Duplicate" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) ModifyKeyPairAttribute(request *ModifyKeyPairAttributeRequest) (response *ModifyKeyPairAttributeResponse, err error) { - return c.ModifyKeyPairAttributeWithContext(context.Background(), request) -} - -// ModifyKeyPairAttribute -// 本接口 (ModifyKeyPairAttribute) 用于修改密钥对属性。 -// -// * 修改密钥对ID所指定的密钥对的名称和描述信息。 -// -// * 密钥对名称不能和已经存在的密钥对的名称重复。 -// -// * 密钥对ID是密钥对的唯一标识,不可修改。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" -// INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" -// INVALIDKEYPAIRNAME_DUPLICATE = "InvalidKeyPairName.Duplicate" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) ModifyKeyPairAttributeWithContext(ctx context.Context, request *ModifyKeyPairAttributeRequest) (response *ModifyKeyPairAttributeResponse, err error) { - if request == nil { - request = NewModifyKeyPairAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyKeyPairAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyKeyPairAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyLaunchTemplateDefaultVersionRequest() (request *ModifyLaunchTemplateDefaultVersionRequest) { - request = &ModifyLaunchTemplateDefaultVersionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ModifyLaunchTemplateDefaultVersion") - - return -} - -func NewModifyLaunchTemplateDefaultVersionResponse() (response *ModifyLaunchTemplateDefaultVersionResponse) { - response = &ModifyLaunchTemplateDefaultVersionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyLaunchTemplateDefaultVersion -// 本接口(ModifyLaunchTemplateDefaultVersion)用于修改实例启动模板默认版本。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERSETALREADY = "InvalidParameterValue.LaunchTemplateIdVerSetAlready" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// MISSINGPARAMETER = "MissingParameter" -// UNKNOWNPARAMETER = "UnknownParameter" -func (c *Client) ModifyLaunchTemplateDefaultVersion(request *ModifyLaunchTemplateDefaultVersionRequest) (response *ModifyLaunchTemplateDefaultVersionResponse, err error) { - return c.ModifyLaunchTemplateDefaultVersionWithContext(context.Background(), request) -} - -// ModifyLaunchTemplateDefaultVersion -// 本接口(ModifyLaunchTemplateDefaultVersion)用于修改实例启动模板默认版本。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERSETALREADY = "InvalidParameterValue.LaunchTemplateIdVerSetAlready" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// MISSINGPARAMETER = "MissingParameter" -// UNKNOWNPARAMETER = "UnknownParameter" -func (c *Client) ModifyLaunchTemplateDefaultVersionWithContext(ctx context.Context, request *ModifyLaunchTemplateDefaultVersionRequest) (response *ModifyLaunchTemplateDefaultVersionResponse, err error) { - if request == nil { - request = NewModifyLaunchTemplateDefaultVersionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyLaunchTemplateDefaultVersion require credential") - } - - request.SetContext(ctx) - - response = NewModifyLaunchTemplateDefaultVersionResponse() - err = c.Send(request, response) - return -} - -func NewProgramFpgaImageRequest() (request *ProgramFpgaImageRequest) { - request = &ProgramFpgaImageRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ProgramFpgaImage") - - return -} - -func NewProgramFpgaImageResponse() (response *ProgramFpgaImageResponse) { - response = &ProgramFpgaImageResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ProgramFpgaImage -// 本接口(ProgramFpgaImage)用于在线烧录由客户提供的FPGA镜像文件到指定实例的指定FPGA卡上。 -// -// * 只支持对单个实例发起在线烧录FPGA镜像的操作。 -// -// * 支持对单个实例的多块FPGA卡同时烧录FPGA镜像,DBDFs参数为空时,默认对指定实例的所有FPGA卡进行烧录。 -// -// 可能返回的错误码: -// -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_NOTFPGAINSTANCE = "UnsupportedOperation.NotFpgaInstance" -func (c *Client) ProgramFpgaImage(request *ProgramFpgaImageRequest) (response *ProgramFpgaImageResponse, err error) { - return c.ProgramFpgaImageWithContext(context.Background(), request) -} - -// ProgramFpgaImage -// 本接口(ProgramFpgaImage)用于在线烧录由客户提供的FPGA镜像文件到指定实例的指定FPGA卡上。 -// -// * 只支持对单个实例发起在线烧录FPGA镜像的操作。 -// -// * 支持对单个实例的多块FPGA卡同时烧录FPGA镜像,DBDFs参数为空时,默认对指定实例的所有FPGA卡进行烧录。 -// -// 可能返回的错误码: -// -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_NOTFPGAINSTANCE = "UnsupportedOperation.NotFpgaInstance" -func (c *Client) ProgramFpgaImageWithContext(ctx context.Context, request *ProgramFpgaImageRequest) (response *ProgramFpgaImageResponse, err error) { - if request == nil { - request = NewProgramFpgaImageRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ProgramFpgaImage require credential") - } - - request.SetContext(ctx) - - response = NewProgramFpgaImageResponse() - err = c.Send(request, response) - return -} - -func NewPurchaseReservedInstancesOfferingRequest() (request *PurchaseReservedInstancesOfferingRequest) { - request = &PurchaseReservedInstancesOfferingRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "PurchaseReservedInstancesOffering") - - return -} - -func NewPurchaseReservedInstancesOfferingResponse() (response *PurchaseReservedInstancesOfferingResponse) { - response = &PurchaseReservedInstancesOfferingResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// PurchaseReservedInstancesOffering -// 本接口(PurchaseReservedInstancesOffering)用于用户购买一个或者多个指定配置的预留实例 -// -// 可能返回的错误码: -// -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEOUTOFQUATA = "UnsupportedOperation.ReservedInstanceOutofQuata" -func (c *Client) PurchaseReservedInstancesOffering(request *PurchaseReservedInstancesOfferingRequest) (response *PurchaseReservedInstancesOfferingResponse, err error) { - return c.PurchaseReservedInstancesOfferingWithContext(context.Background(), request) -} - -// PurchaseReservedInstancesOffering -// 本接口(PurchaseReservedInstancesOffering)用于用户购买一个或者多个指定配置的预留实例 -// -// 可能返回的错误码: -// -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" -// UNSUPPORTEDOPERATION_RESERVEDINSTANCEOUTOFQUATA = "UnsupportedOperation.ReservedInstanceOutofQuata" -func (c *Client) PurchaseReservedInstancesOfferingWithContext(ctx context.Context, request *PurchaseReservedInstancesOfferingRequest) (response *PurchaseReservedInstancesOfferingResponse, err error) { - if request == nil { - request = NewPurchaseReservedInstancesOfferingRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("PurchaseReservedInstancesOffering require credential") - } - - request.SetContext(ctx) - - response = NewPurchaseReservedInstancesOfferingResponse() - err = c.Send(request, response) - return -} - -func NewRebootInstancesRequest() (request *RebootInstancesRequest) { - request = &RebootInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "RebootInstances") - - return -} - -func NewRebootInstancesResponse() (response *RebootInstancesResponse) { - response = &RebootInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RebootInstances -// 本接口 (RebootInstances) 用于重启实例。 -// -// * 只有状态为`RUNNING`的实例才可以进行此操作。 -// -// * 接口调用成功时,实例会进入`REBOOTING`状态;重启实例成功时,实例会进入`RUNNING`状态。 -// -// * 支持强制重启。强制重启的效果等同于关闭物理计算机的电源开关再重新启动。强制重启可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常重启时使用。 -// -// * 支持批量操作,每次请求批量实例的上限为100。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) RebootInstances(request *RebootInstancesRequest) (response *RebootInstancesResponse, err error) { - return c.RebootInstancesWithContext(context.Background(), request) -} - -// RebootInstances -// 本接口 (RebootInstances) 用于重启实例。 -// -// * 只有状态为`RUNNING`的实例才可以进行此操作。 -// -// * 接口调用成功时,实例会进入`REBOOTING`状态;重启实例成功时,实例会进入`RUNNING`状态。 -// -// * 支持强制重启。强制重启的效果等同于关闭物理计算机的电源开关再重新启动。强制重启可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常重启时使用。 -// -// * 支持批量操作,每次请求批量实例的上限为100。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) RebootInstancesWithContext(ctx context.Context, request *RebootInstancesRequest) (response *RebootInstancesResponse, err error) { - if request == nil { - request = NewRebootInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RebootInstances require credential") - } - - request.SetContext(ctx) - - response = NewRebootInstancesResponse() - err = c.Send(request, response) - return -} - -func NewRemoveChcAssistVpcRequest() (request *RemoveChcAssistVpcRequest) { - request = &RemoveChcAssistVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "RemoveChcAssistVpc") - - return -} - -func NewRemoveChcAssistVpcResponse() (response *RemoveChcAssistVpcResponse) { - response = &RemoveChcAssistVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RemoveChcAssistVpc -// 清理CHC物理服务器的带外网络和部署网络 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -func (c *Client) RemoveChcAssistVpc(request *RemoveChcAssistVpcRequest) (response *RemoveChcAssistVpcResponse, err error) { - return c.RemoveChcAssistVpcWithContext(context.Background(), request) -} - -// RemoveChcAssistVpc -// 清理CHC物理服务器的带外网络和部署网络 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -func (c *Client) RemoveChcAssistVpcWithContext(ctx context.Context, request *RemoveChcAssistVpcRequest) (response *RemoveChcAssistVpcResponse, err error) { - if request == nil { - request = NewRemoveChcAssistVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RemoveChcAssistVpc require credential") - } - - request.SetContext(ctx) - - response = NewRemoveChcAssistVpcResponse() - err = c.Send(request, response) - return -} - -func NewRemoveChcDeployVpcRequest() (request *RemoveChcDeployVpcRequest) { - request = &RemoveChcDeployVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "RemoveChcDeployVpc") - - return -} - -func NewRemoveChcDeployVpcResponse() (response *RemoveChcDeployVpcResponse) { - response = &RemoveChcDeployVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RemoveChcDeployVpc -// 清理CHC物理服务器的部署网络 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -func (c *Client) RemoveChcDeployVpc(request *RemoveChcDeployVpcRequest) (response *RemoveChcDeployVpcResponse, err error) { - return c.RemoveChcDeployVpcWithContext(context.Background(), request) -} - -// RemoveChcDeployVpc -// 清理CHC物理服务器的部署网络 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -func (c *Client) RemoveChcDeployVpcWithContext(ctx context.Context, request *RemoveChcDeployVpcRequest) (response *RemoveChcDeployVpcResponse, err error) { - if request == nil { - request = NewRemoveChcDeployVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RemoveChcDeployVpc require credential") - } - - request.SetContext(ctx) - - response = NewRemoveChcDeployVpcResponse() - err = c.Send(request, response) - return -} - -func NewRenewHostsRequest() (request *RenewHostsRequest) { - request = &RenewHostsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "RenewHosts") - - return -} - -func NewRenewHostsResponse() (response *RenewHostsResponse) { - response = &RenewHostsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RenewHosts -// 本接口 (RenewHosts) 用于续费包年包月CDH实例。 -// -// * 只支持操作包年包月实例,否则操作会以特定[错误码](#6.-.E9.94.99.E8.AF.AF.E7.A0.81)返回。 -// -// * 续费时请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// 可能返回的错误码: -// -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -func (c *Client) RenewHosts(request *RenewHostsRequest) (response *RenewHostsResponse, err error) { - return c.RenewHostsWithContext(context.Background(), request) -} - -// RenewHosts -// 本接口 (RenewHosts) 用于续费包年包月CDH实例。 -// -// * 只支持操作包年包月实例,否则操作会以特定[错误码](#6.-.E9.94.99.E8.AF.AF.E7.A0.81)返回。 -// -// * 续费时请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// 可能返回的错误码: -// -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -func (c *Client) RenewHostsWithContext(ctx context.Context, request *RenewHostsRequest) (response *RenewHostsResponse, err error) { - if request == nil { - request = NewRenewHostsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RenewHosts require credential") - } - - request.SetContext(ctx) - - response = NewRenewHostsResponse() - err = c.Send(request, response) - return -} - -func NewRenewInstancesRequest() (request *RenewInstancesRequest) { - request = &RenewInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "RenewInstances") - - return -} - -func NewRenewInstancesResponse() (response *RenewInstancesResponse) { - response = &RenewInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RenewInstances -// 本接口 (RenewInstances) 用于续费包年包月实例。 -// -// * 只支持操作包年包月实例。 -// -// * 续费时请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOTSUPPORTEDMIXPRICINGMODEL = "InvalidParameterValue.InstanceNotSupportedMixPricingModel" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -// MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -func (c *Client) RenewInstances(request *RenewInstancesRequest) (response *RenewInstancesResponse, err error) { - return c.RenewInstancesWithContext(context.Background(), request) -} - -// RenewInstances -// 本接口 (RenewInstances) 用于续费包年包月实例。 -// -// * 只支持操作包年包月实例。 -// -// * 续费时请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOTSUPPORTEDMIXPRICINGMODEL = "InvalidParameterValue.InstanceNotSupportedMixPricingModel" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPERIOD = "InvalidPeriod" -// MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -func (c *Client) RenewInstancesWithContext(ctx context.Context, request *RenewInstancesRequest) (response *RenewInstancesResponse, err error) { - if request == nil { - request = NewRenewInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RenewInstances require credential") - } - - request.SetContext(ctx) - - response = NewRenewInstancesResponse() - err = c.Send(request, response) - return -} - -func NewRepairTaskControlRequest() (request *RepairTaskControlRequest) { - request = &RepairTaskControlRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "RepairTaskControl") - - return -} - -func NewRepairTaskControlResponse() (response *RepairTaskControlResponse) { - response = &RepairTaskControlResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RepairTaskControl -// 本接口(RepairTaskControl)用于对待授权状态的维修任务进行授权操作。 -// -// - 仅当任务状态处于`待授权`状态时,可通过此接口对待授权的维修任务进行授权。 -// -// - 调用时需指定产品类型、实例ID、维修任务ID、操作类型。 -// -// - 可授权立即处理,或提前预约计划维护时间之前的指定时间进行处理(预约时间需晚于当前时间至少5分钟,且在48小时之内)。 -// -// - 针对不同类型的维修任务,提供的可选授权处理策略可参见 [维修任务类型与处理策略](https://cloud.tencent.com/document/product/213/67789)。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -func (c *Client) RepairTaskControl(request *RepairTaskControlRequest) (response *RepairTaskControlResponse, err error) { - return c.RepairTaskControlWithContext(context.Background(), request) -} - -// RepairTaskControl -// 本接口(RepairTaskControl)用于对待授权状态的维修任务进行授权操作。 -// -// - 仅当任务状态处于`待授权`状态时,可通过此接口对待授权的维修任务进行授权。 -// -// - 调用时需指定产品类型、实例ID、维修任务ID、操作类型。 -// -// - 可授权立即处理,或提前预约计划维护时间之前的指定时间进行处理(预约时间需晚于当前时间至少5分钟,且在48小时之内)。 -// -// - 针对不同类型的维修任务,提供的可选授权处理策略可参见 [维修任务类型与处理策略](https://cloud.tencent.com/document/product/213/67789)。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -func (c *Client) RepairTaskControlWithContext(ctx context.Context, request *RepairTaskControlRequest) (response *RepairTaskControlResponse, err error) { - if request == nil { - request = NewRepairTaskControlRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RepairTaskControl require credential") - } - - request.SetContext(ctx) - - response = NewRepairTaskControlResponse() - err = c.Send(request, response) - return -} - -func NewResetInstanceRequest() (request *ResetInstanceRequest) { - request = &ResetInstanceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ResetInstance") - - return -} - -func NewResetInstanceResponse() (response *ResetInstanceResponse) { - response = &ResetInstanceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetInstance -// 本接口 (ResetInstance) 用于重装指定实例上的操作系统。 -// -// * 如果指定了`ImageId`参数,则使用指定的镜像重装;否则按照当前实例使用的镜像进行重装。 -// -// * 系统盘将会被格式化,并重置;请确保系统盘中无重要文件。 -// -// * `Linux`和`Windows`系统互相切换时,该实例系统盘`ID`将发生变化,系统盘关联快照将无法回滚、恢复数据。 -// -// * 密码不指定将会通过站内信下发随机密码。 -// -// * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/9452#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口实现`Linux`和`Windows`操作系统切换。 -// -// * 目前不支持境外地域的实例使用该接口实现`Linux`和`Windows`操作系统切换。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_HOSTNAMEILLEGAL = "InvalidParameter.HostNameIllegal" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_PARAMETERCONFLICT = "InvalidParameter.ParameterConflict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORGIVENINSTANCETYPE = "InvalidParameterValue.InvalidImageForGivenInstanceType" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORMAT = "InvalidParameterValue.InvalidImageFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEIDFORRETSETINSTANCE = "InvalidParameterValue.InvalidImageIdForRetsetInstance" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_KEYPAIRNOTFOUND = "InvalidParameterValue.KeyPairNotFound" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_CHCINSTALLCLOUDIMAGEWITHOUTDEPLOYNETWORK = "OperationDenied.ChcInstallCloudImageWithoutDeployNetwork" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDIMAGELICENSETYPEFORRESET = "UnsupportedOperation.InvalidImageLicenseTypeForReset" -// UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" -// UNSUPPORTEDOPERATION_MODIFYENCRYPTIONNOTSUPPORTED = "UnsupportedOperation.ModifyEncryptionNotSupported" -// UNSUPPORTEDOPERATION_RAWLOCALDISKINSREINSTALLTOQCOW2 = "UnsupportedOperation.RawLocalDiskInsReinstalltoQcow2" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ResetInstance(request *ResetInstanceRequest) (response *ResetInstanceResponse, err error) { - return c.ResetInstanceWithContext(context.Background(), request) -} - -// ResetInstance -// 本接口 (ResetInstance) 用于重装指定实例上的操作系统。 -// -// * 如果指定了`ImageId`参数,则使用指定的镜像重装;否则按照当前实例使用的镜像进行重装。 -// -// * 系统盘将会被格式化,并重置;请确保系统盘中无重要文件。 -// -// * `Linux`和`Windows`系统互相切换时,该实例系统盘`ID`将发生变化,系统盘关联快照将无法回滚、恢复数据。 -// -// * 密码不指定将会通过站内信下发随机密码。 -// -// * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/9452#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口实现`Linux`和`Windows`操作系统切换。 -// -// * 目前不支持境外地域的实例使用该接口实现`Linux`和`Windows`操作系统切换。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_HOSTNAMEILLEGAL = "InvalidParameter.HostNameIllegal" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_PARAMETERCONFLICT = "InvalidParameter.ParameterConflict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORGIVENINSTANCETYPE = "InvalidParameterValue.InvalidImageForGivenInstanceType" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORMAT = "InvalidParameterValue.InvalidImageFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEIDFORRETSETINSTANCE = "InvalidParameterValue.InvalidImageIdForRetsetInstance" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_KEYPAIRNOTFOUND = "InvalidParameterValue.KeyPairNotFound" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_CHCINSTALLCLOUDIMAGEWITHOUTDEPLOYNETWORK = "OperationDenied.ChcInstallCloudImageWithoutDeployNetwork" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDIMAGELICENSETYPEFORRESET = "UnsupportedOperation.InvalidImageLicenseTypeForReset" -// UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" -// UNSUPPORTEDOPERATION_MODIFYENCRYPTIONNOTSUPPORTED = "UnsupportedOperation.ModifyEncryptionNotSupported" -// UNSUPPORTEDOPERATION_RAWLOCALDISKINSREINSTALLTOQCOW2 = "UnsupportedOperation.RawLocalDiskInsReinstalltoQcow2" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ResetInstanceWithContext(ctx context.Context, request *ResetInstanceRequest) (response *ResetInstanceResponse, err error) { - if request == nil { - request = NewResetInstanceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetInstance require credential") - } - - request.SetContext(ctx) - - response = NewResetInstanceResponse() - err = c.Send(request, response) - return -} - -func NewResetInstancesInternetMaxBandwidthRequest() (request *ResetInstancesInternetMaxBandwidthRequest) { - request = &ResetInstancesInternetMaxBandwidthRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ResetInstancesInternetMaxBandwidth") - - return -} - -func NewResetInstancesInternetMaxBandwidthResponse() (response *ResetInstancesInternetMaxBandwidthResponse) { - response = &ResetInstancesInternetMaxBandwidthResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetInstancesInternetMaxBandwidth -// 本接口 (ResetInstancesInternetMaxBandwidth) 用于调整实例公网带宽上限。 -// -// * 不同机型带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。 -// -// * 对于 `BANDWIDTH_PREPAID` 计费方式的带宽,需要输入参数 `StartTime` 和 `EndTime` ,指定调整后的带宽的生效时间段。在这种场景下目前不支持调小带宽,会涉及扣费,请确保账户余额充足。可通过 [`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253) 接口查询账户余额。 -// -// * 对于 `TRAFFIC_POSTPAID_BY_HOUR` 、 `BANDWIDTH_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽,使用该接口调整带宽上限是实时生效的,可以在带宽允许的范围内调大或者调小带宽,不支持输入参数 `StartTime` 和 `EndTime` 。 -// -// * 接口不支持调整 `BANDWIDTH_POSTPAID_BY_MONTH` 计费方式的带宽。 -// -// * 接口不支持批量调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽。 -// -// * 接口不支持批量调整混合计费方式的带宽。例如不支持同时调整 `TRAFFIC_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NOTFOUNDEIP = "FailedOperation.NotFoundEIP" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPERMISSION = "InvalidPermission" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ResetInstancesInternetMaxBandwidth(request *ResetInstancesInternetMaxBandwidthRequest) (response *ResetInstancesInternetMaxBandwidthResponse, err error) { - return c.ResetInstancesInternetMaxBandwidthWithContext(context.Background(), request) -} - -// ResetInstancesInternetMaxBandwidth -// 本接口 (ResetInstancesInternetMaxBandwidth) 用于调整实例公网带宽上限。 -// -// * 不同机型带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。 -// -// * 对于 `BANDWIDTH_PREPAID` 计费方式的带宽,需要输入参数 `StartTime` 和 `EndTime` ,指定调整后的带宽的生效时间段。在这种场景下目前不支持调小带宽,会涉及扣费,请确保账户余额充足。可通过 [`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253) 接口查询账户余额。 -// -// * 对于 `TRAFFIC_POSTPAID_BY_HOUR` 、 `BANDWIDTH_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽,使用该接口调整带宽上限是实时生效的,可以在带宽允许的范围内调大或者调小带宽,不支持输入参数 `StartTime` 和 `EndTime` 。 -// -// * 接口不支持调整 `BANDWIDTH_POSTPAID_BY_MONTH` 计费方式的带宽。 -// -// * 接口不支持批量调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽。 -// -// * 接口不支持批量调整混合计费方式的带宽。例如不支持同时调整 `TRAFFIC_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NOTFOUNDEIP = "FailedOperation.NotFoundEIP" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPERMISSION = "InvalidPermission" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ResetInstancesInternetMaxBandwidthWithContext(ctx context.Context, request *ResetInstancesInternetMaxBandwidthRequest) (response *ResetInstancesInternetMaxBandwidthResponse, err error) { - if request == nil { - request = NewResetInstancesInternetMaxBandwidthRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetInstancesInternetMaxBandwidth require credential") - } - - request.SetContext(ctx) - - response = NewResetInstancesInternetMaxBandwidthResponse() - err = c.Send(request, response) - return -} - -func NewResetInstancesPasswordRequest() (request *ResetInstancesPasswordRequest) { - request = &ResetInstancesPasswordRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ResetInstancesPassword") - - return -} - -func NewResetInstancesPasswordResponse() (response *ResetInstancesPasswordResponse) { - response = &ResetInstancesPasswordResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetInstancesPassword -// 本接口 (ResetInstancesPassword) 用于将实例操作系统的密码重置为用户指定的密码。 -// -// *如果是修改系统管理云密码:实例的操作系统不同,管理员账号也会不一样(`Windows`为`Administrator`,`Ubuntu`为`ubuntu`,其它系统为`root`)。 -// -// * 重置处于运行中状态的实例密码,需要设置关机参数`ForceStop`为`TRUE`。如果没有显式指定强制关机参数,则只有处于关机状态的实例才允许执行重置密码操作。 -// -// * 支持批量操作。将多个实例操作系统的密码重置为相同的密码。每次请求批量实例的上限为100。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ResetInstancesPassword(request *ResetInstancesPasswordRequest) (response *ResetInstancesPasswordResponse, err error) { - return c.ResetInstancesPasswordWithContext(context.Background(), request) -} - -// ResetInstancesPassword -// 本接口 (ResetInstancesPassword) 用于将实例操作系统的密码重置为用户指定的密码。 -// -// *如果是修改系统管理云密码:实例的操作系统不同,管理员账号也会不一样(`Windows`为`Administrator`,`Ubuntu`为`ubuntu`,其它系统为`root`)。 -// -// * 重置处于运行中状态的实例密码,需要设置关机参数`ForceStop`为`TRUE`。如果没有显式指定强制关机参数,则只有处于关机状态的实例才允许执行重置密码操作。 -// -// * 支持批量操作。将多个实例操作系统的密码重置为相同的密码。每次请求批量实例的上限为100。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ResetInstancesPasswordWithContext(ctx context.Context, request *ResetInstancesPasswordRequest) (response *ResetInstancesPasswordResponse, err error) { - if request == nil { - request = NewResetInstancesPasswordRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetInstancesPassword require credential") - } - - request.SetContext(ctx) - - response = NewResetInstancesPasswordResponse() - err = c.Send(request, response) - return -} - -func NewResetInstancesTypeRequest() (request *ResetInstancesTypeRequest) { - request = &ResetInstancesTypeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ResetInstancesType") - - return -} - -func NewResetInstancesTypeResponse() (response *ResetInstancesTypeResponse) { - response = &ResetInstancesTypeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetInstancesType -// 本接口 (ResetInstancesType) 用于调整实例的机型。 -// -// * 目前只支持[系统盘类型](/document/api/213/9452#block_device)是CLOUD_BASIC、CLOUD_PREMIUM、CLOUD_SSD类型的实例使用该接口进行机型调整。 -// -// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型。对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// * 本接口为异步接口,调整实例配置请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表调整实例配置操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// FAILEDOPERATION_PROMOTIONALPERIORESTRICTION = "FailedOperation.PromotionalPerioRestriction" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_HOSTIDSTATUSNOTSUPPORT = "InvalidParameter.HostIdStatusNotSupport" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BASICNETWORKINSTANCEFAMILY = "InvalidParameterValue.BasicNetworkInstanceFamily" -// INVALIDPARAMETERVALUE_GPUINSTANCEFAMILY = "InvalidParameterValue.GPUInstanceFamily" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDGPUFAMILYCHANGE = "InvalidParameterValue.InvalidGPUFamilyChange" -// INVALIDPARAMETERVALUE_INVALIDINSTANCESOURCE = "InvalidParameterValue.InvalidInstanceSource" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_EIPNUMLIMIT = "LimitExceeded.EipNumLimit" -// LIMITEXCEEDED_ENINUMLIMIT = "LimitExceeded.EniNumLimit" -// LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" -// LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" -// MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCENOTFOUND_INVALIDZONEINSTANCETYPE = "ResourceNotFound.InvalidZoneInstanceType" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_AVAILABLEZONE = "ResourcesSoldOut.AvailableZone" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_DISKSNAPCREATETIMETOOOLD = "UnsupportedOperation.DiskSnapCreateTimeTooOld" -// UNSUPPORTEDOPERATION_HETEROGENEOUSCHANGEINSTANCEFAMILY = "UnsupportedOperation.HeterogeneousChangeInstanceFamily" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDINSTANCEWITHSWAPDISK = "UnsupportedOperation.InvalidInstanceWithSwapDisk" -// UNSUPPORTEDOPERATION_LOCALDATADISKCHANGEINSTANCEFAMILY = "UnsupportedOperation.LocalDataDiskChangeInstanceFamily" -// UNSUPPORTEDOPERATION_LOCALDISKMIGRATINGTOCLOUDDISK = "UnsupportedOperation.LocalDiskMigratingToCloudDisk" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_ORIGINALINSTANCETYPEINVALID = "UnsupportedOperation.OriginalInstanceTypeInvalid" -// UNSUPPORTEDOPERATION_REDHATINSTANCEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceUnsupported" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGINGSAMEFAMILY = "UnsupportedOperation.StoppedModeStopChargingSameFamily" -// UNSUPPORTEDOPERATION_SYSTEMDISKTYPE = "UnsupportedOperation.SystemDiskType" -// UNSUPPORTEDOPERATION_UNSUPPORTEDARMCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedARMChangeInstanceFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILYTOARM = "UnsupportedOperation.UnsupportedChangeInstanceFamilyToARM" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCETOTHISINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceToThisInstanceFamily" -func (c *Client) ResetInstancesType(request *ResetInstancesTypeRequest) (response *ResetInstancesTypeResponse, err error) { - return c.ResetInstancesTypeWithContext(context.Background(), request) -} - -// ResetInstancesType -// 本接口 (ResetInstancesType) 用于调整实例的机型。 -// -// * 目前只支持[系统盘类型](/document/api/213/9452#block_device)是CLOUD_BASIC、CLOUD_PREMIUM、CLOUD_SSD类型的实例使用该接口进行机型调整。 -// -// * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型。对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// * 本接口为异步接口,调整实例配置请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表调整实例配置操作成功。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// FAILEDOPERATION_PROMOTIONALPERIORESTRICTION = "FailedOperation.PromotionalPerioRestriction" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_HOSTIDSTATUSNOTSUPPORT = "InvalidParameter.HostIdStatusNotSupport" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BASICNETWORKINSTANCEFAMILY = "InvalidParameterValue.BasicNetworkInstanceFamily" -// INVALIDPARAMETERVALUE_GPUINSTANCEFAMILY = "InvalidParameterValue.GPUInstanceFamily" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDGPUFAMILYCHANGE = "InvalidParameterValue.InvalidGPUFamilyChange" -// INVALIDPARAMETERVALUE_INVALIDINSTANCESOURCE = "InvalidParameterValue.InvalidInstanceSource" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_EIPNUMLIMIT = "LimitExceeded.EipNumLimit" -// LIMITEXCEEDED_ENINUMLIMIT = "LimitExceeded.EniNumLimit" -// LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" -// LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" -// MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCENOTFOUND_INVALIDZONEINSTANCETYPE = "ResourceNotFound.InvalidZoneInstanceType" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_AVAILABLEZONE = "ResourcesSoldOut.AvailableZone" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_DISKSNAPCREATETIMETOOOLD = "UnsupportedOperation.DiskSnapCreateTimeTooOld" -// UNSUPPORTEDOPERATION_HETEROGENEOUSCHANGEINSTANCEFAMILY = "UnsupportedOperation.HeterogeneousChangeInstanceFamily" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDINSTANCEWITHSWAPDISK = "UnsupportedOperation.InvalidInstanceWithSwapDisk" -// UNSUPPORTEDOPERATION_LOCALDATADISKCHANGEINSTANCEFAMILY = "UnsupportedOperation.LocalDataDiskChangeInstanceFamily" -// UNSUPPORTEDOPERATION_LOCALDISKMIGRATINGTOCLOUDDISK = "UnsupportedOperation.LocalDiskMigratingToCloudDisk" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_ORIGINALINSTANCETYPEINVALID = "UnsupportedOperation.OriginalInstanceTypeInvalid" -// UNSUPPORTEDOPERATION_REDHATINSTANCEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceUnsupported" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGINGSAMEFAMILY = "UnsupportedOperation.StoppedModeStopChargingSameFamily" -// UNSUPPORTEDOPERATION_SYSTEMDISKTYPE = "UnsupportedOperation.SystemDiskType" -// UNSUPPORTEDOPERATION_UNSUPPORTEDARMCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedARMChangeInstanceFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceFamily" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILYTOARM = "UnsupportedOperation.UnsupportedChangeInstanceFamilyToARM" -// UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCETOTHISINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceToThisInstanceFamily" -func (c *Client) ResetInstancesTypeWithContext(ctx context.Context, request *ResetInstancesTypeRequest) (response *ResetInstancesTypeResponse, err error) { - if request == nil { - request = NewResetInstancesTypeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetInstancesType require credential") - } - - request.SetContext(ctx) - - response = NewResetInstancesTypeResponse() - err = c.Send(request, response) - return -} - -func NewResizeInstanceDisksRequest() (request *ResizeInstanceDisksRequest) { - request = &ResizeInstanceDisksRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "ResizeInstanceDisks") - - return -} - -func NewResizeInstanceDisksResponse() (response *ResizeInstanceDisksResponse) { - response = &ResizeInstanceDisksResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResizeInstanceDisks -// 本接口 (ResizeInstanceDisks) 用于扩容实例的数据盘。 -// -// * 目前只支持扩容非弹性盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](https://cloud.tencent.com/document/api/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`和[CDH](https://cloud.tencent.com/document/product/416)实例的`LOCAL_BASIC`、`LOCAL_SSD`类型数据盘。 -// -// * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// * 目前只支持扩容一块数据盘。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// * 如果是系统盘,目前只支持扩容,不支持缩容。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CDHONLYLOCALDATADISKRESIZE = "InvalidParameterValue.CdhOnlyLocalDataDiskResize" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDDATADISK = "UnsupportedOperation.InvalidDataDisk" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ResizeInstanceDisks(request *ResizeInstanceDisksRequest) (response *ResizeInstanceDisksResponse, err error) { - return c.ResizeInstanceDisksWithContext(context.Background(), request) -} - -// ResizeInstanceDisks -// 本接口 (ResizeInstanceDisks) 用于扩容实例的数据盘。 -// -// * 目前只支持扩容非弹性盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](https://cloud.tencent.com/document/api/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`和[CDH](https://cloud.tencent.com/document/product/416)实例的`LOCAL_BASIC`、`LOCAL_SSD`类型数据盘。 -// -// * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 -// -// * 目前只支持扩容一块数据盘。 -// -// * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 -// -// * 如果是系统盘,目前只支持扩容,不支持缩容。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CDHONLYLOCALDATADISKRESIZE = "InvalidParameterValue.CdhOnlyLocalDataDiskResize" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INVALIDDATADISK = "UnsupportedOperation.InvalidDataDisk" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) ResizeInstanceDisksWithContext(ctx context.Context, request *ResizeInstanceDisksRequest) (response *ResizeInstanceDisksResponse, err error) { - if request == nil { - request = NewResizeInstanceDisksRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResizeInstanceDisks require credential") - } - - request.SetContext(ctx) - - response = NewResizeInstanceDisksResponse() - err = c.Send(request, response) - return -} - -func NewRunInstancesRequest() (request *RunInstancesRequest) { - request = &RunInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "RunInstances") - - return -} - -func NewRunInstancesResponse() (response *RunInstancesResponse) { - response = &RunInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RunInstances -// 本接口 (RunInstances) 用于创建一个或多个指定配置的实例。 -// -// * 实例创建成功后将自动开机启动,[实例状态](https://cloud.tencent.com/document/product/213/15753#InstanceStatus)变为“运行中”。 -// -// * 预付费实例的购买会预先扣除本次实例购买所需金额,按小时后付费实例购买会预先冻结本次实例购买一小时内所需金额,在调用本接口前请确保账户余额充足。 -// -// * 调用本接口创建实例,支持代金券自动抵扣(注意,代金券不可用于抵扣后付费冻结金额),详情请参考[代金券选用规则](https://cloud.tencent.com/document/product/555/7428)。 -// -// * 本接口允许购买的实例数量遵循[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664),所创建的实例和官网入口创建的实例共用配额。 -// -// * 本接口为异步接口,当创建实例请求下发成功后会返回一个实例`ID`列表和一个`RequestId`,此时创建实例操作并未立即完成。在此期间实例的状态将会处于“PENDING”,实例创建结果可以通过调用 [DescribeInstancesStatus](https://cloud.tencent.com/document/product/213/15738) 接口查询,如果实例状态(InstanceState)由“PENDING(创建中)”变为“RUNNING(运行中)”,则代表实例创建成功,“LAUNCH_FAILED”代表实例创建失败。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// FAILEDOPERATION_ILLEGALTAGVALUE = "FailedOperation.IllegalTagValue" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_NOAVAILABLEIPADDRESSCOUNTINSUBNET = "FailedOperation.NoAvailableIpAddressCountInSubnet" -// FAILEDOPERATION_PROMOTIONALREGIONRESTRICTION = "FailedOperation.PromotionalRegionRestriction" -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// FAILEDOPERATION_SNAPSHOTSIZELARGERTHANDATASIZE = "FailedOperation.SnapshotSizeLargerThanDataSize" -// FAILEDOPERATION_SNAPSHOTSIZELESSTHANDATASIZE = "FailedOperation.SnapshotSizeLessThanDataSize" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// INSTANCESQUOTALIMITEXCEEDED = "InstancesQuotaLimitExceeded" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_CDCNOTSUPPORTED = "InvalidParameter.CdcNotSupported" -// INVALIDPARAMETER_HOSTIDSTATUSNOTSUPPORT = "InvalidParameter.HostIdStatusNotSupport" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INTERNETACCESSIBLENOTSUPPORTED = "InvalidParameter.InternetAccessibleNotSupported" -// INVALIDPARAMETER_INVALIDIPFORMAT = "InvalidParameter.InvalidIpFormat" -// INVALIDPARAMETER_LACKCORECOUNTORTHREADPERCORE = "InvalidParameter.LackCoreCountOrThreadPerCore" -// INVALIDPARAMETER_PARAMETERCONFLICT = "InvalidParameter.ParameterConflict" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDNOTFOUND = "InvalidParameterValue.BandwidthPackageIdNotFound" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" -// INVALIDPARAMETERVALUE_CORECOUNTVALUE = "InvalidParameterValue.CoreCountValue" -// INVALIDPARAMETERVALUE_DEDICATEDCLUSTERNOTSUPPORTEDCHARGETYPE = "InvalidParameterValue.DedicatedClusterNotSupportedChargeType" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_DUPLICATETAGS = "InvalidParameterValue.DuplicateTags" -// INVALIDPARAMETERVALUE_HPCCLUSTERIDZONEIDNOTMATCH = "InvalidParameterValue.HpcClusterIdZoneIdNotMatch" -// INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" -// INVALIDPARAMETERVALUE_INSTANCETYPEREQUIREDHPCCLUSTER = "InvalidParameterValue.InstanceTypeRequiredHpcCluster" -// INVALIDPARAMETERVALUE_INSUFFICIENTOFFERING = "InvalidParameterValue.InsufficientOffering" -// INVALIDPARAMETERVALUE_INSUFFICIENTPRICE = "InvalidParameterValue.InsufficientPrice" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORGIVENINSTANCETYPE = "InvalidParameterValue.InvalidImageForGivenInstanceType" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORMAT = "InvalidParameterValue.InvalidImageFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" -// INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_KEYPAIRNOTFOUND = "InvalidParameterValue.KeyPairNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_NOTCDCSUBNET = "InvalidParameterValue.NotCdcSubnet" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_SUBNETNOTEXIST = "InvalidParameterValue.SubnetNotExist" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_TAGQUOTALIMITEXCEEDED = "InvalidParameterValue.TagQuotaLimitExceeded" -// INVALIDPARAMETERVALUE_THREADPERCOREVALUE = "InvalidParameterValue.ThreadPerCoreValue" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDNOTEXIST = "InvalidParameterValue.VpcIdNotExist" -// INVALIDPARAMETERVALUE_VPCIDZONEIDNOTMATCH = "InvalidParameterValue.VpcIdZoneIdNotMatch" -// INVALIDPARAMETERVALUE_VPCNOTSUPPORTIPV6ADDRESS = "InvalidParameterValue.VpcNotSupportIpv6Address" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPASSWORD = "InvalidPassword" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_CVMSVIFSPERSECGROUPLIMITEXCEEDED = "LimitExceeded.CvmsVifsPerSecGroupLimitExceeded" -// LIMITEXCEEDED_DISASTERRECOVERGROUP = "LimitExceeded.DisasterRecoverGroup" -// LIMITEXCEEDED_IPV6ADDRESSNUM = "LimitExceeded.IPv6AddressNum" -// LIMITEXCEEDED_INSTANCEENINUMLIMIT = "LimitExceeded.InstanceEniNumLimit" -// LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" -// LIMITEXCEEDED_PREPAYQUOTA = "LimitExceeded.PrepayQuota" -// LIMITEXCEEDED_PREPAYUNDERWRITEQUOTA = "LimitExceeded.PrepayUnderwriteQuota" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" -// LIMITEXCEEDED_USERSPOTQUOTA = "LimitExceeded.UserSpotQuota" -// LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_DPDKINSTANCETYPEREQUIREDVPC = "MissingParameter.DPDKInstanceTypeRequiredVPC" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// OPERATIONDENIED_ACCOUNTNOTSUPPORTED = "OperationDenied.AccountNotSupported" -// OPERATIONDENIED_CHCINSTALLCLOUDIMAGEWITHOUTDEPLOYNETWORK = "OperationDenied.ChcInstallCloudImageWithoutDeployNetwork" -// RESOURCEINSUFFICIENT_AVAILABILITYZONESOLDOUT = "ResourceInsufficient.AvailabilityZoneSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" -// RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_EIPINSUFFICIENT = "ResourcesSoldOut.EipInsufficient" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_HIBERNATIONOSVERSION = "UnsupportedOperation.HibernationOsVersion" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_INVALIDREGIONDISKENCRYPT = "UnsupportedOperation.InvalidRegionDiskEncrypt" -// UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_NOTSUPPORTIMPORTINSTANCESACTIONTIMER = "UnsupportedOperation.NotSupportImportInstancesActionTimer" -// UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" -// UNSUPPORTEDOPERATION_RAWLOCALDISKINSREINSTALLTOQCOW2 = "UnsupportedOperation.RawLocalDiskInsReinstalltoQcow2" -// UNSUPPORTEDOPERATION_SPOTUNSUPPORTEDREGION = "UnsupportedOperation.SpotUnsupportedRegion" -// UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" -// UNSUPPORTEDOPERATION_UNSUPPORTEDINTERNATIONALUSER = "UnsupportedOperation.UnsupportedInternationalUser" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) RunInstances(request *RunInstancesRequest) (response *RunInstancesResponse, err error) { - return c.RunInstancesWithContext(context.Background(), request) -} - -// RunInstances -// 本接口 (RunInstances) 用于创建一个或多个指定配置的实例。 -// -// * 实例创建成功后将自动开机启动,[实例状态](https://cloud.tencent.com/document/product/213/15753#InstanceStatus)变为“运行中”。 -// -// * 预付费实例的购买会预先扣除本次实例购买所需金额,按小时后付费实例购买会预先冻结本次实例购买一小时内所需金额,在调用本接口前请确保账户余额充足。 -// -// * 调用本接口创建实例,支持代金券自动抵扣(注意,代金券不可用于抵扣后付费冻结金额),详情请参考[代金券选用规则](https://cloud.tencent.com/document/product/555/7428)。 -// -// * 本接口允许购买的实例数量遵循[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664),所创建的实例和官网入口创建的实例共用配额。 -// -// * 本接口为异步接口,当创建实例请求下发成功后会返回一个实例`ID`列表和一个`RequestId`,此时创建实例操作并未立即完成。在此期间实例的状态将会处于“PENDING”,实例创建结果可以通过调用 [DescribeInstancesStatus](https://cloud.tencent.com/document/product/213/15738) 接口查询,如果实例状态(InstanceState)由“PENDING(创建中)”变为“RUNNING(运行中)”,则代表实例创建成功,“LAUNCH_FAILED”代表实例创建失败。 -// -// 可能返回的错误码: -// -// ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" -// AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" -// FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" -// FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" -// FAILEDOPERATION_ILLEGALTAGVALUE = "FailedOperation.IllegalTagValue" -// FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" -// FAILEDOPERATION_NOAVAILABLEIPADDRESSCOUNTINSUBNET = "FailedOperation.NoAvailableIpAddressCountInSubnet" -// FAILEDOPERATION_PROMOTIONALREGIONRESTRICTION = "FailedOperation.PromotionalRegionRestriction" -// FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" -// FAILEDOPERATION_SNAPSHOTSIZELARGERTHANDATASIZE = "FailedOperation.SnapshotSizeLargerThanDataSize" -// FAILEDOPERATION_SNAPSHOTSIZELESSTHANDATASIZE = "FailedOperation.SnapshotSizeLessThanDataSize" -// FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" -// INSTANCESQUOTALIMITEXCEEDED = "InstancesQuotaLimitExceeded" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" -// INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" -// INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" -// INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" -// INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" -// INVALIDPARAMETER_CDCNOTSUPPORTED = "InvalidParameter.CdcNotSupported" -// INVALIDPARAMETER_HOSTIDSTATUSNOTSUPPORT = "InvalidParameter.HostIdStatusNotSupport" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETER_INTERNETACCESSIBLENOTSUPPORTED = "InvalidParameter.InternetAccessibleNotSupported" -// INVALIDPARAMETER_INVALIDIPFORMAT = "InvalidParameter.InvalidIpFormat" -// INVALIDPARAMETER_LACKCORECOUNTORTHREADPERCORE = "InvalidParameter.LackCoreCountOrThreadPerCore" -// INVALIDPARAMETER_PARAMETERCONFLICT = "InvalidParameter.ParameterConflict" -// INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDNOTFOUND = "InvalidParameterValue.BandwidthPackageIdNotFound" -// INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" -// INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" -// INVALIDPARAMETERVALUE_CORECOUNTVALUE = "InvalidParameterValue.CoreCountValue" -// INVALIDPARAMETERVALUE_DEDICATEDCLUSTERNOTSUPPORTEDCHARGETYPE = "InvalidParameterValue.DedicatedClusterNotSupportedChargeType" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_DUPLICATETAGS = "InvalidParameterValue.DuplicateTags" -// INVALIDPARAMETERVALUE_HPCCLUSTERIDZONEIDNOTMATCH = "InvalidParameterValue.HpcClusterIdZoneIdNotMatch" -// INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" -// INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" -// INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" -// INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" -// INVALIDPARAMETERVALUE_INSTANCETYPEREQUIREDHPCCLUSTER = "InvalidParameterValue.InstanceTypeRequiredHpcCluster" -// INVALIDPARAMETERVALUE_INSUFFICIENTOFFERING = "InvalidParameterValue.InsufficientOffering" -// INVALIDPARAMETERVALUE_INSUFFICIENTPRICE = "InvalidParameterValue.InsufficientPrice" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORGIVENINSTANCETYPE = "InvalidParameterValue.InvalidImageForGivenInstanceType" -// INVALIDPARAMETERVALUE_INVALIDIMAGEFORMAT = "InvalidParameterValue.InvalidImageFormat" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" -// INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" -// INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" -// INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" -// INVALIDPARAMETERVALUE_KEYPAIRNOTFOUND = "InvalidParameterValue.KeyPairNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" -// INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" -// INVALIDPARAMETERVALUE_NOTCDCSUBNET = "InvalidParameterValue.NotCdcSubnet" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" -// INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" -// INVALIDPARAMETERVALUE_SUBNETNOTEXIST = "InvalidParameterValue.SubnetNotExist" -// INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" -// INVALIDPARAMETERVALUE_TAGQUOTALIMITEXCEEDED = "InvalidParameterValue.TagQuotaLimitExceeded" -// INVALIDPARAMETERVALUE_THREADPERCOREVALUE = "InvalidParameterValue.ThreadPerCoreValue" -// INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" -// INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" -// INVALIDPARAMETERVALUE_VPCIDNOTEXIST = "InvalidParameterValue.VpcIdNotExist" -// INVALIDPARAMETERVALUE_VPCIDZONEIDNOTMATCH = "InvalidParameterValue.VpcIdZoneIdNotMatch" -// INVALIDPARAMETERVALUE_VPCNOTSUPPORTIPV6ADDRESS = "InvalidParameterValue.VpcNotSupportIpv6Address" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// INVALIDPASSWORD = "InvalidPassword" -// INVALIDPERIOD = "InvalidPeriod" -// INVALIDPERMISSION = "InvalidPermission" -// INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" -// INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" -// LIMITEXCEEDED_CVMSVIFSPERSECGROUPLIMITEXCEEDED = "LimitExceeded.CvmsVifsPerSecGroupLimitExceeded" -// LIMITEXCEEDED_DISASTERRECOVERGROUP = "LimitExceeded.DisasterRecoverGroup" -// LIMITEXCEEDED_IPV6ADDRESSNUM = "LimitExceeded.IPv6AddressNum" -// LIMITEXCEEDED_INSTANCEENINUMLIMIT = "LimitExceeded.InstanceEniNumLimit" -// LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" -// LIMITEXCEEDED_PREPAYQUOTA = "LimitExceeded.PrepayQuota" -// LIMITEXCEEDED_PREPAYUNDERWRITEQUOTA = "LimitExceeded.PrepayUnderwriteQuota" -// LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" -// LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" -// LIMITEXCEEDED_USERSPOTQUOTA = "LimitExceeded.UserSpotQuota" -// LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" -// MISSINGPARAMETER = "MissingParameter" -// MISSINGPARAMETER_DPDKINSTANCETYPEREQUIREDVPC = "MissingParameter.DPDKInstanceTypeRequiredVPC" -// MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" -// OPERATIONDENIED_ACCOUNTNOTSUPPORTED = "OperationDenied.AccountNotSupported" -// OPERATIONDENIED_CHCINSTALLCLOUDIMAGEWITHOUTDEPLOYNETWORK = "OperationDenied.ChcInstallCloudImageWithoutDeployNetwork" -// RESOURCEINSUFFICIENT_AVAILABILITYZONESOLDOUT = "ResourceInsufficient.AvailabilityZoneSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" -// RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" -// RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" -// RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" -// RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" -// RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" -// RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" -// RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" -// RESOURCESSOLDOUT_EIPINSUFFICIENT = "ResourcesSoldOut.EipInsufficient" -// RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_HIBERNATIONOSVERSION = "UnsupportedOperation.HibernationOsVersion" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" -// UNSUPPORTEDOPERATION_INVALIDREGIONDISKENCRYPT = "UnsupportedOperation.InvalidRegionDiskEncrypt" -// UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" -// UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" -// UNSUPPORTEDOPERATION_NOTSUPPORTIMPORTINSTANCESACTIONTIMER = "UnsupportedOperation.NotSupportImportInstancesActionTimer" -// UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" -// UNSUPPORTEDOPERATION_RAWLOCALDISKINSREINSTALLTOQCOW2 = "UnsupportedOperation.RawLocalDiskInsReinstalltoQcow2" -// UNSUPPORTEDOPERATION_SPOTUNSUPPORTEDREGION = "UnsupportedOperation.SpotUnsupportedRegion" -// UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" -// UNSUPPORTEDOPERATION_UNSUPPORTEDINTERNATIONALUSER = "UnsupportedOperation.UnsupportedInternationalUser" -// VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" -// VPCIPISUSED = "VpcIpIsUsed" -func (c *Client) RunInstancesWithContext(ctx context.Context, request *RunInstancesRequest) (response *RunInstancesResponse, err error) { - if request == nil { - request = NewRunInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RunInstances require credential") - } - - request.SetContext(ctx) - - response = NewRunInstancesResponse() - err = c.Send(request, response) - return -} - -func NewStartInstancesRequest() (request *StartInstancesRequest) { - request = &StartInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "StartInstances") - - return -} - -func NewStartInstancesResponse() (response *StartInstancesResponse) { - response = &StartInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// StartInstances -// 本接口 (StartInstances) 用于启动一个或多个实例。 -// -// * 只有状态为`STOPPED`的实例才可以进行此操作。 -// -// * 接口调用成功时,实例会进入`STARTING`状态;启动实例成功时,实例会进入`RUNNING`状态。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 本接口为异步接口,启动实例请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表启动实例操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -func (c *Client) StartInstances(request *StartInstancesRequest) (response *StartInstancesResponse, err error) { - return c.StartInstancesWithContext(context.Background(), request) -} - -// StartInstances -// 本接口 (StartInstances) 用于启动一个或多个实例。 -// -// * 只有状态为`STOPPED`的实例才可以进行此操作。 -// -// * 接口调用成功时,实例会进入`STARTING`状态;启动实例成功时,实例会进入`RUNNING`状态。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 本接口为异步接口,启动实例请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表启动实例操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -func (c *Client) StartInstancesWithContext(ctx context.Context, request *StartInstancesRequest) (response *StartInstancesResponse, err error) { - if request == nil { - request = NewStartInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("StartInstances require credential") - } - - request.SetContext(ctx) - - response = NewStartInstancesResponse() - err = c.Send(request, response) - return -} - -func NewStopInstancesRequest() (request *StopInstancesRequest) { - request = &StopInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "StopInstances") - - return -} - -func NewStopInstancesResponse() (response *StopInstancesResponse) { - response = &StopInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// StopInstances -// 本接口 (StopInstances) 用于关闭一个或多个实例。 -// -// * 只有状态为`RUNNING`的实例才可以进行此操作。 -// -// * 接口调用成功时,实例会进入`STOPPING`状态;关闭实例成功时,实例会进入`STOPPED`状态。 -// -// * 支持强制关闭。强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 本接口为异步接口,关闭实例请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表关闭实例操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_HIBERNATIONFORNORMALINSTANCE = "UnsupportedOperation.HibernationForNormalInstance" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) StopInstances(request *StopInstancesRequest) (response *StopInstancesResponse, err error) { - return c.StopInstancesWithContext(context.Background(), request) -} - -// StopInstances -// 本接口 (StopInstances) 用于关闭一个或多个实例。 -// -// * 只有状态为`RUNNING`的实例才可以进行此操作。 -// -// * 接口调用成功时,实例会进入`STOPPING`状态;关闭实例成功时,实例会进入`STOPPED`状态。 -// -// * 支持强制关闭。强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 -// -// * 支持批量操作。每次请求批量实例的上限为100。 -// -// * 本接口为异步接口,关闭实例请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表关闭实例操作成功。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION_HIBERNATIONFORNORMALINSTANCE = "UnsupportedOperation.HibernationForNormalInstance" -// UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" -func (c *Client) StopInstancesWithContext(ctx context.Context, request *StopInstancesRequest) (response *StopInstancesResponse, err error) { - if request == nil { - request = NewStopInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("StopInstances require credential") - } - - request.SetContext(ctx) - - response = NewStopInstancesResponse() - err = c.Send(request, response) - return -} - -func NewSyncImagesRequest() (request *SyncImagesRequest) { - request = &SyncImagesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "SyncImages") - - return -} - -func NewSyncImagesResponse() (response *SyncImagesResponse) { - response = &SyncImagesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// SyncImages -// 本接口(SyncImages)用于将自定义镜像同步到其它地区。 -// -// * 该接口每次调用只支持同步一个镜像。 -// -// * 该接口支持多个同步地域。 -// -// * 单个账号在每个地域最多支持存在10个自定义镜像。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDIMAGESTATE = "FailedOperation.InvalidImageState" -// IMAGEQUOTALIMITEXCEEDED = "ImageQuotaLimitExceeded" -// INVALIDIMAGEID_INCORRECTSTATE = "InvalidImageId.IncorrectState" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDIMAGEID_TOOLARGE = "InvalidImageId.TooLarge" -// INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDREGION = "InvalidParameterValue.InvalidRegion" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDREGION_UNAVAILABLE = "InvalidRegion.Unavailable" -// UNSUPPORTEDOPERATION_ENCRYPTEDIMAGESNOTSUPPORTED = "UnsupportedOperation.EncryptedImagesNotSupported" -// UNSUPPORTEDOPERATION_REGION = "UnsupportedOperation.Region" -func (c *Client) SyncImages(request *SyncImagesRequest) (response *SyncImagesResponse, err error) { - return c.SyncImagesWithContext(context.Background(), request) -} - -// SyncImages -// 本接口(SyncImages)用于将自定义镜像同步到其它地区。 -// -// * 该接口每次调用只支持同步一个镜像。 -// -// * 该接口支持多个同步地域。 -// -// * 单个账号在每个地域最多支持存在10个自定义镜像。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDIMAGESTATE = "FailedOperation.InvalidImageState" -// IMAGEQUOTALIMITEXCEEDED = "ImageQuotaLimitExceeded" -// INVALIDIMAGEID_INCORRECTSTATE = "InvalidImageId.IncorrectState" -// INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" -// INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" -// INVALIDIMAGEID_TOOLARGE = "InvalidImageId.TooLarge" -// INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" -// INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" -// INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" -// INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" -// INVALIDPARAMETERVALUE_INVALIDREGION = "InvalidParameterValue.InvalidRegion" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" -// INVALIDREGION_UNAVAILABLE = "InvalidRegion.Unavailable" -// UNSUPPORTEDOPERATION_ENCRYPTEDIMAGESNOTSUPPORTED = "UnsupportedOperation.EncryptedImagesNotSupported" -// UNSUPPORTEDOPERATION_REGION = "UnsupportedOperation.Region" -func (c *Client) SyncImagesWithContext(ctx context.Context, request *SyncImagesRequest) (response *SyncImagesResponse, err error) { - if request == nil { - request = NewSyncImagesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("SyncImages require credential") - } - - request.SetContext(ctx) - - response = NewSyncImagesResponse() - err = c.Send(request, response) - return -} - -func NewTerminateInstancesRequest() (request *TerminateInstancesRequest) { - request = &TerminateInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("cvm", APIVersion, "TerminateInstances") - - return -} - -func NewTerminateInstancesResponse() (response *TerminateInstancesResponse) { - response = &TerminateInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// TerminateInstances -// 本接口 (TerminateInstances) 用于主动退还实例。 -// -// * 不再使用的实例,可通过本接口主动退还。 -// -// * 按量计费的实例通过本接口可直接退还;包年包月实例如符合[退还规则](https://cloud.tencent.com/document/product/213/9711),也可通过本接口主动退还。 -// -// * 包年包月实例首次调用本接口,实例将被移至回收站,再次调用本接口,实例将被销毁,且不可恢复。按量计费实例调用本接口将被直接销毁。 -// -// * 包年包月实例首次调用本接口,入参中包含ReleasePrepaidDataDisks时,包年包月数据盘同时也会被移至回收站。 -// -// * 支持批量操作,每次请求批量实例的上限为100。 -// -// * 批量操作时,所有实例的付费类型必须一致。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// FAILEDOPERATION_UNRETURNABLE = "FailedOperation.Unreturnable" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCENOTSUPPORTEDPREPAIDINSTANCE = "InvalidInstanceNotSupportedPrepaidInstance" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported" -// LIMITEXCEEDED_USERRETURNQUOTA = "LimitExceeded.UserReturnQuota" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDPRICINGMODEL = "UnsupportedOperation.InstanceMixedPricingModel" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATELAUNCHFAILED = "UnsupportedOperation.InstanceStateLaunchFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INSTANCESPROTECTED = "UnsupportedOperation.InstancesProtected" -// UNSUPPORTEDOPERATION_REDHATINSTANCETERMINATEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceTerminateUnsupported" -// UNSUPPORTEDOPERATION_REDHATINSTANCEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceUnsupported" -// UNSUPPORTEDOPERATION_REGION = "UnsupportedOperation.Region" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_USERLIMITOPERATIONEXCEEDQUOTA = "UnsupportedOperation.UserLimitOperationExceedQuota" -func (c *Client) TerminateInstances(request *TerminateInstancesRequest) (response *TerminateInstancesResponse, err error) { - return c.TerminateInstancesWithContext(context.Background(), request) -} - -// TerminateInstances -// 本接口 (TerminateInstances) 用于主动退还实例。 -// -// * 不再使用的实例,可通过本接口主动退还。 -// -// * 按量计费的实例通过本接口可直接退还;包年包月实例如符合[退还规则](https://cloud.tencent.com/document/product/213/9711),也可通过本接口主动退还。 -// -// * 包年包月实例首次调用本接口,实例将被移至回收站,再次调用本接口,实例将被销毁,且不可恢复。按量计费实例调用本接口将被直接销毁。 -// -// * 包年包月实例首次调用本接口,入参中包含ReleasePrepaidDataDisks时,包年包月数据盘同时也会被移至回收站。 -// -// * 支持批量操作,每次请求批量实例的上限为100。 -// -// * 批量操作时,所有实例的付费类型必须一致。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" -// FAILEDOPERATION_UNRETURNABLE = "FailedOperation.Unreturnable" -// INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDINSTANCENOTSUPPORTEDPREPAIDINSTANCE = "InvalidInstanceNotSupportedPrepaidInstance" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported" -// LIMITEXCEEDED_USERRETURNQUOTA = "LimitExceeded.UserReturnQuota" -// MISSINGPARAMETER = "MissingParameter" -// MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" -// OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" -// UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" -// UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" -// UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" -// UNSUPPORTEDOPERATION_INSTANCEMIXEDPRICINGMODEL = "UnsupportedOperation.InstanceMixedPricingModel" -// UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" -// UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" -// UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" -// UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" -// UNSUPPORTEDOPERATION_INSTANCESTATELAUNCHFAILED = "UnsupportedOperation.InstanceStateLaunchFailed" -// UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" -// UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" -// UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" -// UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" -// UNSUPPORTEDOPERATION_INSTANCESPROTECTED = "UnsupportedOperation.InstancesProtected" -// UNSUPPORTEDOPERATION_REDHATINSTANCETERMINATEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceTerminateUnsupported" -// UNSUPPORTEDOPERATION_REDHATINSTANCEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceUnsupported" -// UNSUPPORTEDOPERATION_REGION = "UnsupportedOperation.Region" -// UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" -// UNSUPPORTEDOPERATION_USERLIMITOPERATIONEXCEEDQUOTA = "UnsupportedOperation.UserLimitOperationExceedQuota" -func (c *Client) TerminateInstancesWithContext(ctx context.Context, request *TerminateInstancesRequest) (response *TerminateInstancesResponse, err error) { - if request == nil { - request = NewTerminateInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("TerminateInstances require credential") - } - - request.SetContext(ctx) - - response = NewTerminateInstancesResponse() - err = c.Send(request, response) - return -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/errors.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/errors.go deleted file mode 100644 index 72af281dabf3..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/errors.go +++ /dev/null @@ -1,1047 +0,0 @@ -/* -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 v20170312 - -const ( - // 此产品的特有错误码 - - // 该请求账户未通过资格审计。 - ACCOUNTQUALIFICATIONRESTRICTIONS = "AccountQualificationRestrictions" - - // 角色名鉴权失败 - AUTHFAILURE_CAMROLENAMEAUTHENTICATEFAILED = "AuthFailure.CamRoleNameAuthenticateFailed" - - // 弹性网卡不允许跨子网操作。 - ENINOTALLOWEDCHANGESUBNET = "EniNotAllowedChangeSubnet" - - // 账号已经存在 - FAILEDOPERATION_ACCOUNTALREADYEXISTS = "FailedOperation.AccountAlreadyExists" - - // 账号为当前用户 - FAILEDOPERATION_ACCOUNTISYOURSELF = "FailedOperation.AccountIsYourSelf" - - // 自带许可镜像暂时不支持共享。 - FAILEDOPERATION_BYOLIMAGESHAREFAILED = "FailedOperation.BYOLImageShareFailed" - - // 未找到指定的容灾组 - FAILEDOPERATION_DISASTERRECOVERGROUPNOTFOUND = "FailedOperation.DisasterRecoverGroupNotFound" - - // 标签键存在不合法字符 - FAILEDOPERATION_ILLEGALTAGKEY = "FailedOperation.IllegalTagKey" - - // 标签值存在不合法字符。 - FAILEDOPERATION_ILLEGALTAGVALUE = "FailedOperation.IllegalTagValue" - - // 询价失败 - FAILEDOPERATION_INQUIRYPRICEFAILED = "FailedOperation.InquiryPriceFailed" - - // 查询退换价格失败,找不到付款订单,请检查设备 `ins-xxxxxxx` 是否已过期。 - FAILEDOPERATION_INQUIRYREFUNDPRICEFAILED = "FailedOperation.InquiryRefundPriceFailed" - - // 镜像状态繁忙,请稍后重试。 - FAILEDOPERATION_INVALIDIMAGESTATE = "FailedOperation.InvalidImageState" - - // 请求不支持`EMR`的实例`ins-xxxxxxxx`。 - FAILEDOPERATION_INVALIDINSTANCEAPPLICATIONROLEEMR = "FailedOperation.InvalidInstanceApplicationRoleEmr" - - // 子网可用IP已耗尽。 - FAILEDOPERATION_NOAVAILABLEIPADDRESSCOUNTINSUBNET = "FailedOperation.NoAvailableIpAddressCountInSubnet" - - // 当前实例没有弹性IP - FAILEDOPERATION_NOTFOUNDEIP = "FailedOperation.NotFoundEIP" - - // 账号为协作者,请填写主账号 - FAILEDOPERATION_NOTMASTERACCOUNT = "FailedOperation.NotMasterAccount" - - // 指定的置放群组非空。 - FAILEDOPERATION_PLACEMENTSETNOTEMPTY = "FailedOperation.PlacementSetNotEmpty" - - // 促销期内购买的实例不允许调整配置或计费模式。 - FAILEDOPERATION_PROMOTIONALPERIORESTRICTION = "FailedOperation.PromotionalPerioRestriction" - - // 暂无法在此国家/地区提供该服务。 - FAILEDOPERATION_PROMOTIONALREGIONRESTRICTION = "FailedOperation.PromotionalRegionRestriction" - - // 镜像共享失败。 - FAILEDOPERATION_QIMAGESHAREFAILED = "FailedOperation.QImageShareFailed" - - // 镜像共享失败。 - FAILEDOPERATION_RIMAGESHAREFAILED = "FailedOperation.RImageShareFailed" - - // 安全组操作失败。 - FAILEDOPERATION_SECURITYGROUPACTIONFAILED = "FailedOperation.SecurityGroupActionFailed" - - // 快照容量大于磁盘大小,请选用更大的磁盘空间。 - FAILEDOPERATION_SNAPSHOTSIZELARGERTHANDATASIZE = "FailedOperation.SnapshotSizeLargerThanDataSize" - - // 不支持快照size小于云盘size。 - FAILEDOPERATION_SNAPSHOTSIZELESSTHANDATASIZE = "FailedOperation.SnapshotSizeLessThanDataSize" - - // 请求中指定的标签键为系统预留标签,禁止创建 - FAILEDOPERATION_TAGKEYRESERVED = "FailedOperation.TagKeyReserved" - - // 镜像是公共镜像并且启用了自动化助手服务,但它不符合 Linux&x86_64。 - FAILEDOPERATION_TATAGENTNOTSUPPORT = "FailedOperation.TatAgentNotSupport" - - // 实例无法退还。 - FAILEDOPERATION_UNRETURNABLE = "FailedOperation.Unreturnable" - - // 镜像配额超过了限制。 - IMAGEQUOTALIMITEXCEEDED = "ImageQuotaLimitExceeded" - - // 表示当前创建的实例个数超过了该账户允许购买的剩余配额数。 - INSTANCESQUOTALIMITEXCEEDED = "InstancesQuotaLimitExceeded" - - // 内部错误。 - INTERNALERROR = "InternalError" - - // 内部错误 - INTERNALERROR_TRADEUNKNOWNERROR = "InternalError.TradeUnknownError" - - // 操作内部错误。 - INTERNALSERVERERROR = "InternalServerError" - - // 账户余额不足。 - INVALIDACCOUNT_INSUFFICIENTBALANCE = "InvalidAccount.InsufficientBalance" - - // 账户有未支付订单。 - INVALIDACCOUNT_UNPAIDORDER = "InvalidAccount.UnpaidOrder" - - // 无效的账户Id。 - INVALIDACCOUNTID_NOTFOUND = "InvalidAccountId.NotFound" - - // 您无法共享镜像给自己。 - INVALIDACCOUNTIS_YOURSELF = "InvalidAccountIs.YourSelf" - - // 指定的ClientToken字符串长度超出限制,必须小于等于64字节。 - INVALIDCLIENTTOKEN_TOOLONG = "InvalidClientToken.TooLong" - - // 无效的过滤器。 - INVALIDFILTER = "InvalidFilter" - - // [`Filter`](/document/api/213/15753#Filter)。 - INVALIDFILTERVALUE_LIMITEXCEEDED = "InvalidFilterValue.LimitExceeded" - - // 不支持该宿主机实例执行指定的操作。 - INVALIDHOST_NOTSUPPORTED = "InvalidHost.NotSupported" - - // 无效[CDH](https://cloud.tencent.com/document/product/416) `ID`。指定的[CDH](https://cloud.tencent.com/document/product/416) `ID`格式错误。例如`ID`长度错误`host-1122`。 - INVALIDHOSTID_MALFORMED = "InvalidHostId.Malformed" - - // 指定的HostId不存在,或不属于该请求账号所有。 - INVALIDHOSTID_NOTFOUND = "InvalidHostId.NotFound" - - // 镜像处于共享中。 - INVALIDIMAGEID_INSHARED = "InvalidImageId.InShared" - - // 镜像状态不合法。 - INVALIDIMAGEID_INCORRECTSTATE = "InvalidImageId.IncorrectState" - - // 错误的镜像Id格式。 - INVALIDIMAGEID_MALFORMED = "InvalidImageId.Malformed" - - // 未找到该镜像。 - INVALIDIMAGEID_NOTFOUND = "InvalidImageId.NotFound" - - // 镜像大小超过限制。 - INVALIDIMAGEID_TOOLARGE = "InvalidImageId.TooLarge" - - // 镜像名称与原有镜像重复。 - INVALIDIMAGENAME_DUPLICATE = "InvalidImageName.Duplicate" - - // 不支持的操作系统类型。 - INVALIDIMAGEOSTYPE_UNSUPPORTED = "InvalidImageOsType.Unsupported" - - // 不支持的操作系统版本。 - INVALIDIMAGEOSVERSION_UNSUPPORTED = "InvalidImageOsVersion.Unsupported" - - // 不被支持的实例。 - INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" - - // 无效实例`ID`。指定的实例`ID`格式错误。例如实例`ID`长度错误`ins-1122`。 - INVALIDINSTANCEID_MALFORMED = "InvalidInstanceId.Malformed" - - // 没有找到相应实例。 - INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" - - // 指定的InstanceName字符串长度超出限制,必须小于等于60字节。 - INVALIDINSTANCENAME_TOOLONG = "InvalidInstanceName.TooLong" - - // 该实例不满足包月[退还规则](https://cloud.tencent.com/document/product/213/9711)。 - INVALIDINSTANCENOTSUPPORTEDPREPAIDINSTANCE = "InvalidInstanceNotSupportedPrepaidInstance" - - // 指定实例的当前状态不能进行该操作。 - INVALIDINSTANCESTATE = "InvalidInstanceState" - - // 指定InstanceType参数格式不合法。 - INVALIDINSTANCETYPE_MALFORMED = "InvalidInstanceType.Malformed" - - // 密钥对数量超过限制。 - INVALIDKEYPAIR_LIMITEXCEEDED = "InvalidKeyPair.LimitExceeded" - - // 无效密钥对ID。指定的密钥对ID格式错误,例如 `ID` 长度错误`skey-1122`。 - INVALIDKEYPAIRID_MALFORMED = "InvalidKeyPairId.Malformed" - - // 无效密钥对ID。指定的密钥对ID不存在。 - INVALIDKEYPAIRID_NOTFOUND = "InvalidKeyPairId.NotFound" - - // 密钥对名称重复。 - INVALIDKEYPAIRNAME_DUPLICATE = "InvalidKeyPairName.Duplicate" - - // 密钥名称为空。 - INVALIDKEYPAIRNAMEEMPTY = "InvalidKeyPairNameEmpty" - - // 密钥名称包含非法字符。密钥名称只支持英文、数字和下划线。 - INVALIDKEYPAIRNAMEINCLUDEILLEGALCHAR = "InvalidKeyPairNameIncludeIllegalChar" - - // 密钥名称超过25个字符。 - INVALIDKEYPAIRNAMETOOLONG = "InvalidKeyPairNameTooLong" - - // 参数错误。 - INVALIDPARAMETER = "InvalidParameter" - - // 最多指定一个参数。 - INVALIDPARAMETER_ATMOSTONE = "InvalidParameter.AtMostOne" - - // 不支持参数CdcId。 - INVALIDPARAMETER_CDCNOTSUPPORTED = "InvalidParameter.CdcNotSupported" - - // DataDiskIds不应该传入RootDisk的Id。 - INVALIDPARAMETER_DATADISKIDCONTAINSROOTDISK = "InvalidParameter.DataDiskIdContainsRootDisk" - - // 指定的数据盘不属于指定的实例。 - INVALIDPARAMETER_DATADISKNOTBELONGSPECIFIEDINSTANCE = "InvalidParameter.DataDiskNotBelongSpecifiedInstance" - - // 只能包含一个系统盘快照。 - INVALIDPARAMETER_DUPLICATESYSTEMSNAPSHOTS = "InvalidParameter.DuplicateSystemSnapshots" - - // 该主机当前状态不支持该操作。 - INVALIDPARAMETER_HOSTIDSTATUSNOTSUPPORT = "InvalidParameter.HostIdStatusNotSupport" - - // 指定的hostName不符合规范。 - INVALIDPARAMETER_HOSTNAMEILLEGAL = "InvalidParameter.HostNameIllegal" - - // 参数ImageIds和SnapshotIds必须有且仅有一个。 - INVALIDPARAMETER_IMAGEIDSSNAPSHOTIDSMUSTONE = "InvalidParameter.ImageIdsSnapshotIdsMustOne" - - // 当前接口不支持实例镜像。 - INVALIDPARAMETER_INSTANCEIMAGENOTSUPPORT = "InvalidParameter.InstanceImageNotSupport" - - // 不支持设置公网带宽相关信息。 - INVALIDPARAMETER_INTERNETACCESSIBLENOTSUPPORTED = "InvalidParameter.InternetAccessibleNotSupported" - - // 云盘资源售罄。 - INVALIDPARAMETER_INVALIDCLOUDDISKSOLDOUT = "InvalidParameter.InvalidCloudDiskSoldOut" - - // 参数依赖不正确。 - INVALIDPARAMETER_INVALIDDEPENDENCE = "InvalidParameter.InvalidDependence" - - // 当前操作不支持该类型实例。 - INVALIDPARAMETER_INVALIDINSTANCENOTSUPPORTED = "InvalidParameter.InvalidInstanceNotSupported" - - // 指定的私有网络ip格式不正确。 - INVALIDPARAMETER_INVALIDIPFORMAT = "InvalidParameter.InvalidIpFormat" - - // 不能同时指定ImageIds和Filters。 - INVALIDPARAMETER_INVALIDPARAMETERCOEXISTIMAGEIDSFILTERS = "InvalidParameter.InvalidParameterCoexistImageIdsFilters" - - // 错误的url地址。 - INVALIDPARAMETER_INVALIDPARAMETERURLERROR = "InvalidParameter.InvalidParameterUrlError" - - // CoreCount和ThreadPerCore必须同时提供。 - INVALIDPARAMETER_LACKCORECOUNTORTHREADPERCORE = "InvalidParameter.LackCoreCountOrThreadPerCore" - - // 本地数据盘不支持创建实例镜像。 - INVALIDPARAMETER_LOCALDATADISKNOTSUPPORT = "InvalidParameter.LocalDataDiskNotSupport" - - // 不支持同时指定密钥登录和保持镜像登录方式。 - INVALIDPARAMETER_PARAMETERCONFLICT = "InvalidParameter.ParameterConflict" - - // 不支持设置登录密码。 - INVALIDPARAMETER_PASSWORDNOTSUPPORTED = "InvalidParameter.PasswordNotSupported" - - // 指定的快照不存在。 - INVALIDPARAMETER_SNAPSHOTNOTFOUND = "InvalidParameter.SnapshotNotFound" - - // 多选一必选参数缺失。 - INVALIDPARAMETER_SPECIFYONEPARAMETER = "InvalidParameter.SpecifyOneParameter" - - // 不支持Swap盘。 - INVALIDPARAMETER_SWAPDISKNOTSUPPORT = "InvalidParameter.SwapDiskNotSupport" - - // 参数不包含系统盘快照。 - INVALIDPARAMETER_SYSTEMSNAPSHOTNOTFOUND = "InvalidParameter.SystemSnapshotNotFound" - - // 参数长度超过限制。 - INVALIDPARAMETER_VALUETOOLARGE = "InvalidParameter.ValueTooLarge" - - // 表示参数组合不正确。 - INVALIDPARAMETERCOMBINATION = "InvalidParameterCombination" - - // 指定的两个参数冲突,不能同时存在。 EIP只能绑定在实例上或指定网卡的指定内网 IP 上。 - INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" - - // 参数取值错误。 - INVALIDPARAMETERVALUE = "InvalidParameterValue" - - // 入参数目不相等。 - INVALIDPARAMETERVALUE_AMOUNTNOTEQUAL = "InvalidParameterValue.AmountNotEqual" - - // 共享带宽包ID不合要求,请提供规范的共享带宽包ID,类似bwp-xxxxxxxx,字母x代表小写字符或者数字。 - INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" - - // 请确认指定的带宽包是否存在。 - INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDNOTFOUND = "InvalidParameterValue.BandwidthPackageIdNotFound" - - // 实例为基础网络实例,目标实例规格仅支持私有网络,不支持调整。 - INVALIDPARAMETERVALUE_BASICNETWORKINSTANCEFAMILY = "InvalidParameterValue.BasicNetworkInstanceFamily" - - // 请确认存储桶是否存在。 - INVALIDPARAMETERVALUE_BUCKETNOTFOUND = "InvalidParameterValue.BucketNotFound" - - // CamRoleName不合要求,只允许包含英文字母、数字或者 +=,.@_- 字符。 - INVALIDPARAMETERVALUE_CAMROLENAMEMALFORMED = "InvalidParameterValue.CamRoleNameMalformed" - - // CDH磁盘扩容只支持LOCAL_BASIC和LOCAL_SSD。 - INVALIDPARAMETERVALUE_CDHONLYLOCALDATADISKRESIZE = "InvalidParameterValue.CdhOnlyLocalDataDiskResize" - - // 找不到对应的CHC物理服务器。 - INVALIDPARAMETERVALUE_CHCHOSTSNOTFOUND = "InvalidParameterValue.ChcHostsNotFound" - - // 该CHC未配置任何网络。 - INVALIDPARAMETERVALUE_CHCNETWORKEMPTY = "InvalidParameterValue.ChcNetworkEmpty" - - // SSD云硬盘为数据盘时,购买大小不得小于100GB - INVALIDPARAMETERVALUE_CLOUDSSDDATADISKSIZETOOSMALL = "InvalidParameterValue.CloudSsdDataDiskSizeTooSmall" - - // 核心计数不合法。 - INVALIDPARAMETERVALUE_CORECOUNTVALUE = "InvalidParameterValue.CoreCountValue" - - // CDC不支持指定的计费模式。 - INVALIDPARAMETERVALUE_DEDICATEDCLUSTERNOTSUPPORTEDCHARGETYPE = "InvalidParameterValue.DedicatedClusterNotSupportedChargeType" - - // 已经存在部署VPC。 - INVALIDPARAMETERVALUE_DEPLOYVPCALREADYEXISTS = "InvalidParameterValue.DeployVpcAlreadyExists" - - // 置放群组ID格式错误。 - INVALIDPARAMETERVALUE_DISASTERRECOVERGROUPIDMALFORMED = "InvalidParameterValue.DisasterRecoverGroupIdMalformed" - - // 参数值重复。 - INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" - - // 重复标签。 - INVALIDPARAMETERVALUE_DUPLICATETAGS = "InvalidParameterValue.DuplicateTags" - - // 非GPU实例不允许转为GPU实例。 - INVALIDPARAMETERVALUE_GPUINSTANCEFAMILY = "InvalidParameterValue.GPUInstanceFamily" - - // 您的高性能计算集群已经绑定其他可用区,不能购买当前可用区机器。 - INVALIDPARAMETERVALUE_HPCCLUSTERIDZONEIDNOTMATCH = "InvalidParameterValue.HpcClusterIdZoneIdNotMatch" - - // IP格式非法。 - INVALIDPARAMETERVALUE_IPADDRESSMALFORMED = "InvalidParameterValue.IPAddressMalformed" - - // ipv6地址无效 - INVALIDPARAMETERVALUE_IPV6ADDRESSMALFORMED = "InvalidParameterValue.IPv6AddressMalformed" - - // HostName参数值不合法 - INVALIDPARAMETERVALUE_ILLEGALHOSTNAME = "InvalidParameterValue.IllegalHostName" - - // 传参格式不对。 - INVALIDPARAMETERVALUE_INCORRECTFORMAT = "InvalidParameterValue.IncorrectFormat" - - // 实例ID不合要求,请提供规范的实例ID,类似ins-xxxxxxxx,字母x代表小写字符或数字。 - INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" - - // 不支持操作不同计费方式的实例。 - INVALIDPARAMETERVALUE_INSTANCENOTSUPPORTEDMIXPRICINGMODEL = "InvalidParameterValue.InstanceNotSupportedMixPricingModel" - - // 指定机型不存在 - INVALIDPARAMETERVALUE_INSTANCETYPENOTFOUND = "InvalidParameterValue.InstanceTypeNotFound" - - // 实例类型不可加入高性能计算集群。 - INVALIDPARAMETERVALUE_INSTANCETYPENOTSUPPORTHPCCLUSTER = "InvalidParameterValue.InstanceTypeNotSupportHpcCluster" - - // 高性能计算实例需指定对应的高性能计算集群。 - INVALIDPARAMETERVALUE_INSTANCETYPEREQUIREDHPCCLUSTER = "InvalidParameterValue.InstanceTypeRequiredHpcCluster" - - // 竞价数量不足。 - INVALIDPARAMETERVALUE_INSUFFICIENTOFFERING = "InvalidParameterValue.InsufficientOffering" - - // 竞价失败。 - INVALIDPARAMETERVALUE_INSUFFICIENTPRICE = "InvalidParameterValue.InsufficientPrice" - - // 无效的appid。 - INVALIDPARAMETERVALUE_INVALIDAPPIDFORMAT = "InvalidParameterValue.InvalidAppIdFormat" - - // 不支持指定的启动模式。 - INVALIDPARAMETERVALUE_INVALIDBOOTMODE = "InvalidParameterValue.InvalidBootMode" - - // 请检查存储桶的写入权限是否已放通。 - INVALIDPARAMETERVALUE_INVALIDBUCKETPERMISSIONFOREXPORT = "InvalidParameterValue.InvalidBucketPermissionForExport" - - // 参数 FileNamePrefixList 的长度与 ImageIds 或 SnapshotIds 不匹配。 - INVALIDPARAMETERVALUE_INVALIDFILENAMEPREFIXLIST = "InvalidParameterValue.InvalidFileNamePrefixList" - - // 不支持转为非GPU或其他类型GPU实例。 - INVALIDPARAMETERVALUE_INVALIDGPUFAMILYCHANGE = "InvalidParameterValue.InvalidGPUFamilyChange" - - // 镜像ID不支持指定的实例机型。 - INVALIDPARAMETERVALUE_INVALIDIMAGEFORGIVENINSTANCETYPE = "InvalidParameterValue.InvalidImageForGivenInstanceType" - - // 当前镜像为RAW格式,无法创建CVM,建议您选择其他镜像。 - INVALIDPARAMETERVALUE_INVALIDIMAGEFORMAT = "InvalidParameterValue.InvalidImageFormat" - - // 镜像不允许执行该操作 - INVALIDPARAMETERVALUE_INVALIDIMAGEID = "InvalidParameterValue.InvalidImageId" - - // 镜像无法用于重装当前实例。 - INVALIDPARAMETERVALUE_INVALIDIMAGEIDFORRETSETINSTANCE = "InvalidParameterValue.InvalidImageIdForRetsetInstance" - - // 指定的镜像ID为共享镜像。 - INVALIDPARAMETERVALUE_INVALIDIMAGEIDISSHARED = "InvalidParameterValue.InvalidImageIdIsShared" - - // 当前地域不支持指定镜像所包含的操作系统。 - INVALIDPARAMETERVALUE_INVALIDIMAGEOSNAME = "InvalidParameterValue.InvalidImageOsName" - - // 镜像被其他操作占用,请检查,并稍后重试。 - INVALIDPARAMETERVALUE_INVALIDIMAGESTATE = "InvalidParameterValue.InvalidImageState" - - // 该实例配置来自免费升配活动,暂不支持3个月内进行降配。 - INVALIDPARAMETERVALUE_INVALIDINSTANCESOURCE = "InvalidParameterValue.InvalidInstanceSource" - - // 指定机型不支持包销付费模式。 - INVALIDPARAMETERVALUE_INVALIDINSTANCETYPEUNDERWRITE = "InvalidParameterValue.InvalidInstanceTypeUnderwrite" - - // IP地址不符合规范 - INVALIDPARAMETERVALUE_INVALIDIPFORMAT = "InvalidParameterValue.InvalidIpFormat" - - // 实例启动模板描述格式错误。 - INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateDescription" - - // 实例启动模板名称格式错误。 - INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATENAME = "InvalidParameterValue.InvalidLaunchTemplateName" - - // 实例启动模板描述格式错误。 - INVALIDPARAMETERVALUE_INVALIDLAUNCHTEMPLATEVERSIONDESCRIPTION = "InvalidParameterValue.InvalidLaunchTemplateVersionDescription" - - // 许可证类型不可用。 - INVALIDPARAMETERVALUE_INVALIDLICENSETYPE = "InvalidParameterValue.InvalidLicenseType" - - // 参数值错误。 - INVALIDPARAMETERVALUE_INVALIDPARAMETERVALUELIMIT = "InvalidParameterValue.InvalidParameterValueLimit" - - // 无效密码。指定的密码不符合密码复杂度限制。例如密码长度不符合限制等。 - INVALIDPARAMETERVALUE_INVALIDPASSWORD = "InvalidParameterValue.InvalidPassword" - - // Region ID不可用。 - INVALIDPARAMETERVALUE_INVALIDREGION = "InvalidParameterValue.InvalidRegion" - - // 时间格式不合法。 - INVALIDPARAMETERVALUE_INVALIDTIMEFORMAT = "InvalidParameterValue.InvalidTimeFormat" - - // UserData格式错误, 需要base64编码格式 - INVALIDPARAMETERVALUE_INVALIDUSERDATAFORMAT = "InvalidParameterValue.InvalidUserDataFormat" - - // 无效的模糊查询字符串。 - INVALIDPARAMETERVALUE_INVALIDVAGUENAME = "InvalidParameterValue.InvalidVagueName" - - // 请确认密钥是否存在。 - INVALIDPARAMETERVALUE_KEYPAIRNOTFOUND = "InvalidParameterValue.KeyPairNotFound" - - // 指定的密钥不支持当前操作。 - INVALIDPARAMETERVALUE_KEYPAIRNOTSUPPORTED = "InvalidParameterValue.KeyPairNotSupported" - - // 不支持删除默认启动模板版本。 - INVALIDPARAMETERVALUE_LAUNCHTEMPLATEDEFAULTVERSION = "InvalidParameterValue.LaunchTemplateDefaultVersion" - - // 实例启动模板ID格式错误。 - INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDMALFORMED = "InvalidParameterValue.LaunchTemplateIdMalformed" - - // 实例启动模板ID不存在。 - INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdNotExisted" - - // 实例启动模板和版本ID组合不存在。 - INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERNOTEXISTED = "InvalidParameterValue.LaunchTemplateIdVerNotExisted" - - // 指定的实例启动模板id不存在。 - INVALIDPARAMETERVALUE_LAUNCHTEMPLATEIDVERSETALREADY = "InvalidParameterValue.LaunchTemplateIdVerSetAlready" - - // 实例启动模板未找到。 - INVALIDPARAMETERVALUE_LAUNCHTEMPLATENOTFOUND = "InvalidParameterValue.LaunchTemplateNotFound" - - // 无效的实例启动模板版本号。 - INVALIDPARAMETERVALUE_LAUNCHTEMPLATEVERSION = "InvalidParameterValue.LaunchTemplateVersion" - - // 参数值数量超过限制。 - INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" - - // 本地盘的限制范围。 - INVALIDPARAMETERVALUE_LOCALDISKSIZERANGE = "InvalidParameterValue.LocalDiskSizeRange" - - // 参数值必须为开启DHCP的VPC - INVALIDPARAMETERVALUE_MUSTDHCPENABLEDVPC = "InvalidParameterValue.MustDhcpEnabledVpc" - - // 子网不属于该cdc集群。 - INVALIDPARAMETERVALUE_NOTCDCSUBNET = "InvalidParameterValue.NotCdcSubnet" - - // 输入参数值不能为空。 - INVALIDPARAMETERVALUE_NOTEMPTY = "InvalidParameterValue.NotEmpty" - - // 不支持的操作。 - INVALIDPARAMETERVALUE_NOTSUPPORTED = "InvalidParameterValue.NotSupported" - - // 该机型不支持预热 - INVALIDPARAMETERVALUE_PREHEATNOTSUPPORTEDINSTANCETYPE = "InvalidParameterValue.PreheatNotSupportedInstanceType" - - // 该可用区目前不支持预热功能 - INVALIDPARAMETERVALUE_PREHEATNOTSUPPORTEDZONE = "InvalidParameterValue.PreheatNotSupportedZone" - - // 无效参数值。参数值取值范围不合法。 - INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" - - // 快照ID不合要求,请提供规范的快照ID,类似snap-xxxxxxxx,字母x代表小写字符或者数字 - INVALIDPARAMETERVALUE_SNAPSHOTIDMALFORMED = "InvalidParameterValue.SnapshotIdMalformed" - - // 子网ID不合要求,请提供规范的子网ID,类似subnet-xxxxxxxx,字母x代表小写字符或者数字 - INVALIDPARAMETERVALUE_SUBNETIDMALFORMED = "InvalidParameterValue.SubnetIdMalformed" - - // 创建失败,您指定的子网不存在,请您重新指定 - INVALIDPARAMETERVALUE_SUBNETNOTEXIST = "InvalidParameterValue.SubnetNotExist" - - // 指定的标签不存在。 - INVALIDPARAMETERVALUE_TAGKEYNOTFOUND = "InvalidParameterValue.TagKeyNotFound" - - // 标签配额超限。 - INVALIDPARAMETERVALUE_TAGQUOTALIMITEXCEEDED = "InvalidParameterValue.TagQuotaLimitExceeded" - - // 每核心线程数不合法。 - INVALIDPARAMETERVALUE_THREADPERCOREVALUE = "InvalidParameterValue.ThreadPerCoreValue" - - // 参数值超过最大限制。 - INVALIDPARAMETERVALUE_TOOLARGE = "InvalidParameterValue.TooLarge" - - // 无效参数值。参数值太长。 - INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" - - // uuid不合要求。 - INVALIDPARAMETERVALUE_UUIDMALFORMED = "InvalidParameterValue.UuidMalformed" - - // VPC ID`xxx`不合要求,请提供规范的Vpc ID, 类似vpc-xxxxxxxx,字母x代表小写字符或者数字。 - INVALIDPARAMETERVALUE_VPCIDMALFORMED = "InvalidParameterValue.VpcIdMalformed" - - // 指定的VpcId不存在。 - INVALIDPARAMETERVALUE_VPCIDNOTEXIST = "InvalidParameterValue.VpcIdNotExist" - - // VPC网络与实例不在同一可用区 - INVALIDPARAMETERVALUE_VPCIDZONEIDNOTMATCH = "InvalidParameterValue.VpcIdZoneIdNotMatch" - - // 该VPC不支持ipv6。 - INVALIDPARAMETERVALUE_VPCNOTSUPPORTIPV6ADDRESS = "InvalidParameterValue.VpcNotSupportIpv6Address" - - // 请求不支持该可用区 - INVALIDPARAMETERVALUE_ZONENOTSUPPORTED = "InvalidParameterValue.ZoneNotSupported" - - // 参数值数量超过限制。 - INVALIDPARAMETERVALUELIMIT = "InvalidParameterValueLimit" - - // 无效参数值。指定的 `Offset` 无效。 - INVALIDPARAMETERVALUEOFFSET = "InvalidParameterValueOffset" - - // 无效密码。指定的密码不符合密码复杂度限制。例如密码长度不符合限制等。 - INVALIDPASSWORD = "InvalidPassword" - - // 无效时长。目前只支持时长:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36],单位:月。 - INVALIDPERIOD = "InvalidPeriod" - - // 账户不支持该操作。 - INVALIDPERMISSION = "InvalidPermission" - - // 无效的项目ID,指定的项目ID不存在。 - INVALIDPROJECTID_NOTFOUND = "InvalidProjectId.NotFound" - - // 无效密钥公钥。指定公钥已经存在。 - INVALIDPUBLICKEY_DUPLICATE = "InvalidPublicKey.Duplicate" - - // 无效密钥公钥。指定公钥格式错误,不符合`OpenSSH RSA`格式要求。 - INVALIDPUBLICKEY_MALFORMED = "InvalidPublicKey.Malformed" - - // 未找到该区域。 - INVALIDREGION_NOTFOUND = "InvalidRegion.NotFound" - - // 该区域目前不支持同步镜像。 - INVALIDREGION_UNAVAILABLE = "InvalidRegion.Unavailable" - - // 指定的`安全组ID`不存在。 - INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupId.NotFound" - - // 指定的`安全组ID`格式错误,例如`实例ID`长度错误`sg-ide32`。 - INVALIDSGID_MALFORMED = "InvalidSgId.Malformed" - - // 指定的`zone`不存在。 - INVALIDZONE_MISMATCHREGION = "InvalidZone.MismatchRegion" - - // 一个实例绑定安全组数量不能超过5个 - LIMITEXCEEDED_ASSOCIATEUSGLIMITEXCEEDED = "LimitExceeded.AssociateUSGLimitExceeded" - - // 安全组关联云主机弹性网卡配额超限。 - LIMITEXCEEDED_CVMSVIFSPERSECGROUPLIMITEXCEEDED = "LimitExceeded.CvmsVifsPerSecGroupLimitExceeded" - - // 指定置放群组配额不足。 - LIMITEXCEEDED_DISASTERRECOVERGROUP = "LimitExceeded.DisasterRecoverGroup" - - // 特定实例包含的某个ENI的EIP数量已超过目标实例类型的EIP允许的最大值,请删除部分EIP后重试。 - LIMITEXCEEDED_EIPNUMLIMIT = "LimitExceeded.EipNumLimit" - - // 特定实例当前ENI数量已超过目标实例类型的ENI允许的最大值,需删除部分ENI后重试。 - LIMITEXCEEDED_ENINUMLIMIT = "LimitExceeded.EniNumLimit" - - // 正在运行中的镜像导出任务已达上限,请等待已有任务完成后,再次发起重试。 - LIMITEXCEEDED_EXPORTIMAGETASKLIMITEXCEEDED = "LimitExceeded.ExportImageTaskLimitExceeded" - - // 已达创建高性能计算集群数的上限。 - LIMITEXCEEDED_HPCCLUSTERQUOTA = "LimitExceeded.HpcClusterQuota" - - // IP数量超过网卡上限。 - LIMITEXCEEDED_IPV6ADDRESSNUM = "LimitExceeded.IPv6AddressNum" - - // 实例指定的弹性网卡数目超过了实例弹性网卡数目配额。 - LIMITEXCEEDED_INSTANCEENINUMLIMIT = "LimitExceeded.InstanceEniNumLimit" - - // 当前配额不足够生产指定数量的实例 - LIMITEXCEEDED_INSTANCEQUOTA = "LimitExceeded.InstanceQuota" - - // 目标实例规格不支持当前规格的外网带宽上限,不支持调整。具体可参考[公网网络带宽上限](https://cloud.tencent.com/document/product/213/12523)。 - LIMITEXCEEDED_INSTANCETYPEBANDWIDTH = "LimitExceeded.InstanceTypeBandwidth" - - // 实例启动模板数量超限。 - LIMITEXCEEDED_LAUNCHTEMPLATEQUOTA = "LimitExceeded.LaunchTemplateQuota" - - // 实例启动模板版本数量超限。 - LIMITEXCEEDED_LAUNCHTEMPLATEVERSIONQUOTA = "LimitExceeded.LaunchTemplateVersionQuota" - - // 您在该可用区的预热额度已达上限,建议取消不再使用的快照预热 - LIMITEXCEEDED_PREHEATIMAGESNAPSHOTOUTOFQUOTA = "LimitExceeded.PreheatImageSnapshotOutOfQuota" - - // 预付费实例已购买数量已达到最大配额,请提升配额后重试。 - LIMITEXCEEDED_PREPAYQUOTA = "LimitExceeded.PrepayQuota" - - // 包销付费实例已购买数量已达到最大配额。 - LIMITEXCEEDED_PREPAYUNDERWRITEQUOTA = "LimitExceeded.PrepayUnderwriteQuota" - - // 安全组限额不足 - LIMITEXCEEDED_SINGLEUSGQUOTA = "LimitExceeded.SingleUSGQuota" - - // 竞价实例类型配额不足 - LIMITEXCEEDED_SPOTQUOTA = "LimitExceeded.SpotQuota" - - // 标签绑定的资源数量已达到配额限制。 - LIMITEXCEEDED_TAGRESOURCEQUOTA = "LimitExceeded.TagResourceQuota" - - // 退还失败,退还配额已达上限。 - LIMITEXCEEDED_USERRETURNQUOTA = "LimitExceeded.UserReturnQuota" - - // 竞价实例配额不足 - LIMITEXCEEDED_USERSPOTQUOTA = "LimitExceeded.UserSpotQuota" - - // 子网IP不足 - LIMITEXCEEDED_VPCSUBNETNUM = "LimitExceeded.VpcSubnetNum" - - // 缺少参数错误。 - MISSINGPARAMETER = "MissingParameter" - - // 缺少必要参数,请至少提供一个参数。 - MISSINGPARAMETER_ATLEASTONE = "MissingParameter.AtLeastOne" - - // DPDK实例机型要求VPC网络 - MISSINGPARAMETER_DPDKINSTANCETYPEREQUIREDVPC = "MissingParameter.DPDKInstanceTypeRequiredVPC" - - // 该实例类型必须开启云监控服务 - MISSINGPARAMETER_MONITORSERVICE = "MissingParameter.MonitorService" - - // 同样的任务正在运行。 - MUTEXOPERATION_TASKRUNNING = "MutexOperation.TaskRunning" - - // 不支持该账户的操作。 - OPERATIONDENIED_ACCOUNTNOTSUPPORTED = "OperationDenied.AccountNotSupported" - - // 不允许未配置部署网络的CHC安装云上镜像。 - OPERATIONDENIED_CHCINSTALLCLOUDIMAGEWITHOUTDEPLOYNETWORK = "OperationDenied.ChcInstallCloudImageWithoutDeployNetwork" - - // 禁止管控账号操作。 - OPERATIONDENIED_INNERUSERPROHIBITACTION = "OperationDenied.InnerUserProhibitAction" - - // 实例正在执行其他操作,请稍后再试。 - OPERATIONDENIED_INSTANCEOPERATIONINPROGRESS = "OperationDenied.InstanceOperationInProgress" - - // 镜像共享超过配额。 - OVERQUOTA = "OverQuota" - - // 该地域不支持导入镜像。 - REGIONABILITYLIMIT_UNSUPPORTEDTOIMPORTIMAGE = "RegionAbilityLimit.UnsupportedToImportImage" - - // 资源被占用。 - RESOURCEINUSE = "ResourceInUse" - - // 磁盘回滚正在执行中,请稍后再试。 - RESOURCEINUSE_DISKROLLBACKING = "ResourceInUse.DiskRollbacking" - - // 高性能计算集群使用中。 - RESOURCEINUSE_HPCCLUSTER = "ResourceInUse.HpcCluster" - - // 该可用区已售罄 - RESOURCEINSUFFICIENT_AVAILABILITYZONESOLDOUT = "ResourceInsufficient.AvailabilityZoneSoldOut" - - // 指定的云盘规格已售罄 - RESOURCEINSUFFICIENT_CLOUDDISKSOLDOUT = "ResourceInsufficient.CloudDiskSoldOut" - - // 云盘参数不符合规范 - RESOURCEINSUFFICIENT_CLOUDDISKUNAVAILABLE = "ResourceInsufficient.CloudDiskUnavailable" - - // 实例个数超过容灾组的配额 - RESOURCEINSUFFICIENT_DISASTERRECOVERGROUPCVMQUOTA = "ResourceInsufficient.DisasterRecoverGroupCvmQuota" - - // 安全组资源配额不足。 - RESOURCEINSUFFICIENT_INSUFFICIENTGROUPQUOTA = "ResourceInsufficient.InsufficientGroupQuota" - - // 指定的实例类型库存不足。 - RESOURCEINSUFFICIENT_SPECIFIEDINSTANCETYPE = "ResourceInsufficient.SpecifiedInstanceType" - - // 指定的实例类型在选择的可用区已售罄。 - RESOURCEINSUFFICIENT_ZONESOLDOUTFORSPECIFIEDINSTANCE = "ResourceInsufficient.ZoneSoldOutForSpecifiedInstance" - - // 高性能计算集群不存在。 - RESOURCENOTFOUND_HPCCLUSTER = "ResourceNotFound.HpcCluster" - - // 指定的置放群组不存在。 - RESOURCENOTFOUND_INVALIDPLACEMENTSET = "ResourceNotFound.InvalidPlacementSet" - - // 可用区不支持此机型。 - RESOURCENOTFOUND_INVALIDZONEINSTANCETYPE = "ResourceNotFound.InvalidZoneInstanceType" - - // 无可用的缺省类型的CBS资源。 - RESOURCENOTFOUND_NODEFAULTCBS = "ResourceNotFound.NoDefaultCbs" - - // 无可用的缺省类型的CBS资源。 - RESOURCENOTFOUND_NODEFAULTCBSWITHREASON = "ResourceNotFound.NoDefaultCbsWithReason" - - // 该可用区不售卖此机型 - RESOURCEUNAVAILABLE_INSTANCETYPE = "ResourceUnavailable.InstanceType" - - // 快照正在创建过程中。 - RESOURCEUNAVAILABLE_SNAPSHOTCREATING = "ResourceUnavailable.SnapshotCreating" - - // 该可用区已售罄 - RESOURCESSOLDOUT_AVAILABLEZONE = "ResourcesSoldOut.AvailableZone" - - // 公网IP已售罄。 - RESOURCESSOLDOUT_EIPINSUFFICIENT = "ResourcesSoldOut.EipInsufficient" - - // 指定的实例类型已售罄。 - RESOURCESSOLDOUT_SPECIFIEDINSTANCETYPE = "ResourcesSoldOut.SpecifiedInstanceType" - - // 安全组服务接口调用通用错误。 - SECGROUPACTIONFAILURE = "SecGroupActionFailure" - - // 未授权操作。 - UNAUTHORIZEDOPERATION = "UnauthorizedOperation" - - // 指定的镜像不属于用户。 - UNAUTHORIZEDOPERATION_IMAGENOTBELONGTOACCOUNT = "UnauthorizedOperation.ImageNotBelongToAccount" - - // 请确认Token是否有效。 - UNAUTHORIZEDOPERATION_INVALIDTOKEN = "UnauthorizedOperation.InvalidToken" - - // 您无法进行当前操作,请确认多因子认证(MFA)是否失效。 - UNAUTHORIZEDOPERATION_MFAEXPIRED = "UnauthorizedOperation.MFAExpired" - - // 没有权限进行此操作,请确认是否存在多因子认证(MFA)。 - UNAUTHORIZEDOPERATION_MFANOTFOUND = "UnauthorizedOperation.MFANotFound" - - // 无权操作指定的资源,请正确配置CAM策略。 - UNAUTHORIZEDOPERATION_PERMISSIONDENIED = "UnauthorizedOperation.PermissionDenied" - - // 未知参数错误。 - UNKNOWNPARAMETER = "UnknownParameter" - - // 操作不支持。 - UNSUPPORTEDOPERATION = "UnsupportedOperation" - - // 指定的实例付费模式或者网络付费模式不支持共享带宽包 - UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" - - // 实例创建快照的时间距今不到24小时。 - UNSUPPORTEDOPERATION_DISKSNAPCREATETIMETOOOLD = "UnsupportedOperation.DiskSnapCreateTimeTooOld" - - // 边缘可用区实例不支持此项操作。 - UNSUPPORTEDOPERATION_EDGEZONEINSTANCE = "UnsupportedOperation.EdgeZoneInstance" - - // 所选择的边缘可用区不支持云盘操作。 - UNSUPPORTEDOPERATION_EDGEZONENOTSUPPORTCLOUDDISK = "UnsupportedOperation.EdgeZoneNotSupportCloudDisk" - - // 云服务器绑定了弹性网卡,请解绑弹性网卡后再切换私有网络。 - UNSUPPORTEDOPERATION_ELASTICNETWORKINTERFACE = "UnsupportedOperation.ElasticNetworkInterface" - - // 不支持加密镜像。 - UNSUPPORTEDOPERATION_ENCRYPTEDIMAGESNOTSUPPORTED = "UnsupportedOperation.EncryptedImagesNotSupported" - - // 异构机型不支持跨机型调整。 - UNSUPPORTEDOPERATION_HETEROGENEOUSCHANGEINSTANCEFAMILY = "UnsupportedOperation.HeterogeneousChangeInstanceFamily" - - // 不支持未开启休眠功能的实例。 - UNSUPPORTEDOPERATION_HIBERNATIONFORNORMALINSTANCE = "UnsupportedOperation.HibernationForNormalInstance" - - // 当前的镜像不支持休眠。 - UNSUPPORTEDOPERATION_HIBERNATIONOSVERSION = "UnsupportedOperation.HibernationOsVersion" - - // IPv6实例不支持VPC迁移 - UNSUPPORTEDOPERATION_IPV6NOTSUPPORTVPCMIGRATE = "UnsupportedOperation.IPv6NotSupportVpcMigrate" - - // 镜像大小超出限制,不支持导出。 - UNSUPPORTEDOPERATION_IMAGETOOLARGEEXPORTUNSUPPORTED = "UnsupportedOperation.ImageTooLargeExportUnsupported" - - // 请求不支持该实例计费模式 - UNSUPPORTEDOPERATION_INSTANCECHARGETYPE = "UnsupportedOperation.InstanceChargeType" - - // 不支持混合付费模式。 - UNSUPPORTEDOPERATION_INSTANCEMIXEDPRICINGMODEL = "UnsupportedOperation.InstanceMixedPricingModel" - - // 中心可用区和边缘可用区实例不能混用批量操作。 - UNSUPPORTEDOPERATION_INSTANCEMIXEDZONETYPE = "UnsupportedOperation.InstanceMixedZoneType" - - // 请求不支持操作系统为`Xserver windows2012cndatacenterx86_64`的实例`ins-xxxxxx` 。 - UNSUPPORTEDOPERATION_INSTANCEOSWINDOWS = "UnsupportedOperation.InstanceOsWindows" - - // 当前实例为重装系统失败状态,不支持此操作;推荐您再次重装系统,也可以销毁/退还实例或提交工单 - UNSUPPORTEDOPERATION_INSTANCEREINSTALLFAILED = "UnsupportedOperation.InstanceReinstallFailed" - - // 该子机处于封禁状态,请联系相关人员处理。 - UNSUPPORTEDOPERATION_INSTANCESTATEBANNING = "UnsupportedOperation.InstanceStateBanning" - - // 请求不支持永久故障的实例。 - UNSUPPORTEDOPERATION_INSTANCESTATECORRUPTED = "UnsupportedOperation.InstanceStateCorrupted" - - // 请求不支持进入救援模式的实例 - UNSUPPORTEDOPERATION_INSTANCESTATEENTERRESCUEMODE = "UnsupportedOperation.InstanceStateEnterRescueMode" - - // 不支持状态为 `ENTER_SERVICE_LIVE_MIGRATE`.的实例 `ins-xxxxxx` 。 - UNSUPPORTEDOPERATION_INSTANCESTATEENTERSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateEnterServiceLiveMigrate" - - // 请求不支持正在退出救援模式的实例 - UNSUPPORTEDOPERATION_INSTANCESTATEEXITRESCUEMODE = "UnsupportedOperation.InstanceStateExitRescueMode" - - // 不支持状态为 `EXIT_SERVICE_LIVE_MIGRATE`.的实例 `ins-xxxxxx` 。 - UNSUPPORTEDOPERATION_INSTANCESTATEEXITSERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateExitServiceLiveMigrate" - - // 操作不支持已冻结的实例。 - UNSUPPORTEDOPERATION_INSTANCESTATEFREEZING = "UnsupportedOperation.InstanceStateFreezing" - - // 请求不支持正在隔离状态的实例。 - UNSUPPORTEDOPERATION_INSTANCESTATEISOLATING = "UnsupportedOperation.InstanceStateIsolating" - - // 不支持操作创建失败的实例。 - UNSUPPORTEDOPERATION_INSTANCESTATELAUNCHFAILED = "UnsupportedOperation.InstanceStateLaunchFailed" - - // 请求不支持创建未完成的实例 - UNSUPPORTEDOPERATION_INSTANCESTATEPENDING = "UnsupportedOperation.InstanceStatePending" - - // 请求不支持正在重启的实例 - UNSUPPORTEDOPERATION_INSTANCESTATEREBOOTING = "UnsupportedOperation.InstanceStateRebooting" - - // 请求不支持救援模式的实例 - UNSUPPORTEDOPERATION_INSTANCESTATERESCUEMODE = "UnsupportedOperation.InstanceStateRescueMode" - - // 请求不支持开机状态的实例 - UNSUPPORTEDOPERATION_INSTANCESTATERUNNING = "UnsupportedOperation.InstanceStateRunning" - - // 不支持正在服务迁移的实例,请稍后再试 - UNSUPPORTEDOPERATION_INSTANCESTATESERVICELIVEMIGRATE = "UnsupportedOperation.InstanceStateServiceLiveMigrate" - - // 请求不支持隔离状态的实例 - UNSUPPORTEDOPERATION_INSTANCESTATESHUTDOWN = "UnsupportedOperation.InstanceStateShutdown" - - // 实例开机中,不允许该操作。 - UNSUPPORTEDOPERATION_INSTANCESTATESTARTING = "UnsupportedOperation.InstanceStateStarting" - - // 请求不支持已关机的实例 - UNSUPPORTEDOPERATION_INSTANCESTATESTOPPED = "UnsupportedOperation.InstanceStateStopped" - - // 请求不支持正在关机的实例 - UNSUPPORTEDOPERATION_INSTANCESTATESTOPPING = "UnsupportedOperation.InstanceStateStopping" - - // 不支持已销毁的实例 - UNSUPPORTEDOPERATION_INSTANCESTATETERMINATED = "UnsupportedOperation.InstanceStateTerminated" - - // 请求不支持正在销毁的实例 - UNSUPPORTEDOPERATION_INSTANCESTATETERMINATING = "UnsupportedOperation.InstanceStateTerminating" - - // 不支持已启用销毁保护的实例,请先到设置实例销毁保护,关闭实例销毁保护,然后重试。 - UNSUPPORTEDOPERATION_INSTANCESPROTECTED = "UnsupportedOperation.InstancesProtected" - - // 用户创建高性能集群配额已达上限。 - UNSUPPORTEDOPERATION_INSUFFICIENTCLUSTERQUOTA = "UnsupportedOperation.InsufficientClusterQuota" - - // 不支持调整数据盘。 - UNSUPPORTEDOPERATION_INVALIDDATADISK = "UnsupportedOperation.InvalidDataDisk" - - // 不支持指定的磁盘 - UNSUPPORTEDOPERATION_INVALIDDISK = "UnsupportedOperation.InvalidDisk" - - // 不支持带有云硬盘备份点。 - UNSUPPORTEDOPERATION_INVALIDDISKBACKUPQUOTA = "UnsupportedOperation.InvalidDiskBackupQuota" - - // 不支持极速回滚。 - UNSUPPORTEDOPERATION_INVALIDDISKFASTROLLBACK = "UnsupportedOperation.InvalidDiskFastRollback" - - // 镜像许可类型与实例不符,请选择其他镜像。 - UNSUPPORTEDOPERATION_INVALIDIMAGELICENSETYPEFORRESET = "UnsupportedOperation.InvalidImageLicenseTypeForReset" - - // 不支持已经设置了释放时间的实例,请在实例详情页撤销实例定时销毁后再试。 - UNSUPPORTEDOPERATION_INVALIDINSTANCENOTSUPPORTEDPROTECTEDINSTANCE = "UnsupportedOperation.InvalidInstanceNotSupportedProtectedInstance" - - // 不支持有swap盘的实例。 - UNSUPPORTEDOPERATION_INVALIDINSTANCEWITHSWAPDISK = "UnsupportedOperation.InvalidInstanceWithSwapDisk" - - // 当前操作只支持国际版用户。 - UNSUPPORTEDOPERATION_INVALIDPERMISSIONNONINTERNATIONALACCOUNT = "UnsupportedOperation.InvalidPermissionNonInternationalAccount" - - // 指定的地域不支持加密盘。 - UNSUPPORTEDOPERATION_INVALIDREGIONDISKENCRYPT = "UnsupportedOperation.InvalidRegionDiskEncrypt" - - // 该可用区不可售卖。 - UNSUPPORTEDOPERATION_INVALIDZONE = "UnsupportedOperation.InvalidZone" - - // 密钥不支持Windows操作系统 - UNSUPPORTEDOPERATION_KEYPAIRUNSUPPORTEDWINDOWS = "UnsupportedOperation.KeyPairUnsupportedWindows" - - // 机型数据盘全为本地盘不支持跨机型调整。 - UNSUPPORTEDOPERATION_LOCALDATADISKCHANGEINSTANCEFAMILY = "UnsupportedOperation.LocalDataDiskChangeInstanceFamily" - - // 不支持正在本地盘转云盘的磁盘,请稍后发起请求。 - UNSUPPORTEDOPERATION_LOCALDISKMIGRATINGTOCLOUDDISK = "UnsupportedOperation.LocalDiskMigratingToCloudDisk" - - // 从市场镜像创建的自定义镜像不支持导出。 - UNSUPPORTEDOPERATION_MARKETIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.MarketImageExportUnsupported" - - // 不支持修改系统盘的加密属性,例如使用非加密镜像重装加密系统盘。 - UNSUPPORTEDOPERATION_MODIFYENCRYPTIONNOTSUPPORTED = "UnsupportedOperation.ModifyEncryptionNotSupported" - - // 绑定负载均衡的实例,不支持修改vpc属性。 - UNSUPPORTEDOPERATION_MODIFYVPCWITHCLB = "UnsupportedOperation.ModifyVPCWithCLB" - - // 实例基础网络已互通VPC网络,请自行解除关联,再进行切换VPC。 - UNSUPPORTEDOPERATION_MODIFYVPCWITHCLASSLINK = "UnsupportedOperation.ModifyVPCWithClassLink" - - // 该实例类型不支持竞价计费 - UNSUPPORTEDOPERATION_NOINSTANCETYPESUPPORTSPOT = "UnsupportedOperation.NoInstanceTypeSupportSpot" - - // 不支持物理网络的实例。 - UNSUPPORTEDOPERATION_NOVPCNETWORK = "UnsupportedOperation.NoVpcNetwork" - - // 当前实例不是FPGA机型。 - UNSUPPORTEDOPERATION_NOTFPGAINSTANCE = "UnsupportedOperation.NotFpgaInstance" - - // 针对当前实例设置定时任务失败。 - UNSUPPORTEDOPERATION_NOTSUPPORTIMPORTINSTANCESACTIONTIMER = "UnsupportedOperation.NotSupportImportInstancesActionTimer" - - // 操作不支持当前实例 - UNSUPPORTEDOPERATION_NOTSUPPORTINSTANCEIMAGE = "UnsupportedOperation.NotSupportInstanceImage" - - // 该操作仅支持预付费账户 - UNSUPPORTEDOPERATION_ONLYFORPREPAIDACCOUNT = "UnsupportedOperation.OnlyForPrepaidAccount" - - // 无效的原机型。 - UNSUPPORTEDOPERATION_ORIGINALINSTANCETYPEINVALID = "UnsupportedOperation.OriginalInstanceTypeInvalid" - - // 您的账户不支持镜像预热 - UNSUPPORTEDOPERATION_PREHEATIMAGE = "UnsupportedOperation.PreheatImage" - - // 公共镜像或市场镜像不支持导出。 - UNSUPPORTEDOPERATION_PUBLICIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.PublicImageExportUnsupported" - - // 当前镜像不支持对该实例的重装操作。 - UNSUPPORTEDOPERATION_RAWLOCALDISKINSREINSTALLTOQCOW2 = "UnsupportedOperation.RawLocalDiskInsReinstalltoQcow2" - - // RedHat镜像不支持导出。 - UNSUPPORTEDOPERATION_REDHATIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.RedHatImageExportUnsupported" - - // 实例使用商业操作系统,不支持退还。 - UNSUPPORTEDOPERATION_REDHATINSTANCETERMINATEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceTerminateUnsupported" - - // 请求不支持操作系统为RedHat的实例。 - UNSUPPORTEDOPERATION_REDHATINSTANCEUNSUPPORTED = "UnsupportedOperation.RedHatInstanceUnsupported" - - // 不支持该地域 - UNSUPPORTEDOPERATION_REGION = "UnsupportedOperation.Region" - - // 当前用户暂不支持购买预留实例计费。 - UNSUPPORTEDOPERATION_RESERVEDINSTANCEINVISIBLEFORUSER = "UnsupportedOperation.ReservedInstanceInvisibleForUser" - - // 用户预留实例计费配额已达上限。 - UNSUPPORTEDOPERATION_RESERVEDINSTANCEOUTOFQUATA = "UnsupportedOperation.ReservedInstanceOutofQuata" - - // 共享镜像不支持导出。 - UNSUPPORTEDOPERATION_SHAREDIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.SharedImageExportUnsupported" - - // 请求不支持特殊机型的实例 - UNSUPPORTEDOPERATION_SPECIALINSTANCETYPE = "UnsupportedOperation.SpecialInstanceType" - - // 该地域不支持竞价实例。 - UNSUPPORTEDOPERATION_SPOTUNSUPPORTEDREGION = "UnsupportedOperation.SpotUnsupportedRegion" - - // 不支持关机不收费特性 - UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGING = "UnsupportedOperation.StoppedModeStopCharging" - - // 不支持关机不收费机器做同类型变配操作。 - UNSUPPORTEDOPERATION_STOPPEDMODESTOPCHARGINGSAMEFAMILY = "UnsupportedOperation.StoppedModeStopChargingSameFamily" - - // 请求不支持该类型系统盘。 - UNSUPPORTEDOPERATION_SYSTEMDISKTYPE = "UnsupportedOperation.SystemDiskType" - - // 包月转包销,不支持包销折扣高于现有包年包月折扣。 - UNSUPPORTEDOPERATION_UNDERWRITEDISCOUNTGREATERTHANPREPAIDDISCOUNT = "UnsupportedOperation.UnderwriteDiscountGreaterThanPrepaidDiscount" - - // 该机型为包销机型,RenewFlag的值只允许设置为NOTIFY_AND_AUTO_RENEW。 - UNSUPPORTEDOPERATION_UNDERWRITINGINSTANCETYPEONLYSUPPORTAUTORENEW = "UnsupportedOperation.UnderwritingInstanceTypeOnlySupportAutoRenew" - - // 当前实例不允许变配到非ARM机型。 - UNSUPPORTEDOPERATION_UNSUPPORTEDARMCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedARMChangeInstanceFamily" - - // 指定机型不支持跨机型调整配置。 - UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceFamily" - - // 非ARM机型不支持调整到ARM机型。 - UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCEFAMILYTOARM = "UnsupportedOperation.UnsupportedChangeInstanceFamilyToARM" - - // 不支持实例变配到此类型机型。 - UNSUPPORTEDOPERATION_UNSUPPORTEDCHANGEINSTANCETOTHISINSTANCEFAMILY = "UnsupportedOperation.UnsupportedChangeInstanceToThisInstanceFamily" - - // 请求不支持国际版账号 - UNSUPPORTEDOPERATION_UNSUPPORTEDINTERNATIONALUSER = "UnsupportedOperation.UnsupportedInternationalUser" - - // 用户限额操作的配额不足。 - UNSUPPORTEDOPERATION_USERLIMITOPERATIONEXCEEDQUOTA = "UnsupportedOperation.UserLimitOperationExceedQuota" - - // Windows镜像不支持导出。 - UNSUPPORTEDOPERATION_WINDOWSIMAGEEXPORTUNSUPPORTED = "UnsupportedOperation.WindowsImageExportUnsupported" - - // 私有网络ip不在子网内。 - VPCADDRNOTINSUBNET = "VpcAddrNotInSubNet" - - // 私有网络ip已经被使用。 - VPCIPISUSED = "VpcIpIsUsed" -) diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/models.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/models.go deleted file mode 100644 index 2d457186e910..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/cvm/v20170312/models.go +++ /dev/null @@ -1,9596 +0,0 @@ -/* -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 v20170312 - -import ( - "encoding/json" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" -) - -type AccountQuota struct { - // 后付费配额列表 - PostPaidQuotaSet []*PostPaidQuota `json:"PostPaidQuotaSet,omitempty" name:"PostPaidQuotaSet"` - - // 预付费配额列表 - PrePaidQuotaSet []*PrePaidQuota `json:"PrePaidQuotaSet,omitempty" name:"PrePaidQuotaSet"` - - // spot配额列表 - SpotPaidQuotaSet []*SpotPaidQuota `json:"SpotPaidQuotaSet,omitempty" name:"SpotPaidQuotaSet"` - - // 镜像配额列表 - ImageQuotaSet []*ImageQuota `json:"ImageQuotaSet,omitempty" name:"ImageQuotaSet"` - - // 置放群组配额列表 - DisasterRecoverGroupQuotaSet []*DisasterRecoverGroupQuota `json:"DisasterRecoverGroupQuotaSet,omitempty" name:"DisasterRecoverGroupQuotaSet"` -} - -type AccountQuotaOverview struct { - // 地域 - Region *string `json:"Region,omitempty" name:"Region"` - - // 配额数据 - AccountQuota *AccountQuota `json:"AccountQuota,omitempty" name:"AccountQuota"` -} - -type ActionTimer struct { - // 定时器动作,目前仅支持销毁一个值:TerminateInstances。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TimerAction *string `json:"TimerAction,omitempty" name:"TimerAction"` - - // 执行时间,按照ISO8601标准表示,并且使用UTC时间。格式为 YYYY-MM-DDThh:mm:ssZ。例如 2018-05-29T11:26:40Z,执行时间必须大于当前时间5分钟。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ActionTime *string `json:"ActionTime,omitempty" name:"ActionTime"` - - // 扩展数据 - // 注意:此字段可能返回 null,表示取不到有效值。 - Externals *Externals `json:"Externals,omitempty" name:"Externals"` -} - -// Predefined struct for user -type AllocateHostsRequestParams struct { - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目等属性。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 用于保证请求幂等性的字符串。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - HostChargePrepaid *ChargePrepaid `json:"HostChargePrepaid,omitempty" name:"HostChargePrepaid"` - - // 实例计费类型。目前仅支持:PREPAID(预付费,即包年包月模式),默认为:'PREPAID'。 - HostChargeType *string `json:"HostChargeType,omitempty" name:"HostChargeType"` - - // CDH实例机型,默认为:'HS1'。 - HostType *string `json:"HostType,omitempty" name:"HostType"` - - // 购买CDH实例数量,默认为:1。 - HostCount *uint64 `json:"HostCount,omitempty" name:"HostCount"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` -} - -type AllocateHostsRequest struct { - *tchttp.BaseRequest - - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目等属性。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 用于保证请求幂等性的字符串。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - HostChargePrepaid *ChargePrepaid `json:"HostChargePrepaid,omitempty" name:"HostChargePrepaid"` - - // 实例计费类型。目前仅支持:PREPAID(预付费,即包年包月模式),默认为:'PREPAID'。 - HostChargeType *string `json:"HostChargeType,omitempty" name:"HostChargeType"` - - // CDH实例机型,默认为:'HS1'。 - HostType *string `json:"HostType,omitempty" name:"HostType"` - - // 购买CDH实例数量,默认为:1。 - HostCount *uint64 `json:"HostCount,omitempty" name:"HostCount"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` -} - -func (r *AllocateHostsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AllocateHostsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Placement") - delete(f, "ClientToken") - delete(f, "HostChargePrepaid") - delete(f, "HostChargeType") - delete(f, "HostType") - delete(f, "HostCount") - delete(f, "TagSpecification") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AllocateHostsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AllocateHostsResponseParams struct { - // 新创建云子机的实例ID列表。 - HostIdSet []*string `json:"HostIdSet,omitempty" name:"HostIdSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AllocateHostsResponse struct { - *tchttp.BaseResponse - Response *AllocateHostsResponseParams `json:"Response"` -} - -func (r *AllocateHostsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AllocateHostsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateInstancesKeyPairsRequestParams struct { - // 一个或多个待操作的实例ID,每次请求批量实例的上限为100。
    可以通过以下方式获取可用的实例ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询实例ID。
  • 通过调用接口 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) ,取返回信息中的`InstanceId`获取实例ID。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 一个或多个待操作的密钥对ID,每次请求批量密钥对的上限为100。密钥对ID形如:`skey-3glfot13`。
    可以通过以下方式获取可用的密钥ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。
  • 通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的`KeyId`获取密钥对ID。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再绑定密钥。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机。
  • FALSE:表示在正常关机失败后不进行强制关机。
    默认取值:FALSE。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -type AssociateInstancesKeyPairsRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID,每次请求批量实例的上限为100。
    可以通过以下方式获取可用的实例ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询实例ID。
  • 通过调用接口 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) ,取返回信息中的`InstanceId`获取实例ID。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 一个或多个待操作的密钥对ID,每次请求批量密钥对的上限为100。密钥对ID形如:`skey-3glfot13`。
    可以通过以下方式获取可用的密钥ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。
  • 通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的`KeyId`获取密钥对ID。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再绑定密钥。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机。
  • FALSE:表示在正常关机失败后不进行强制关机。
    默认取值:FALSE。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -func (r *AssociateInstancesKeyPairsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateInstancesKeyPairsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "KeyIds") - delete(f, "ForceStop") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateInstancesKeyPairsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateInstancesKeyPairsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssociateInstancesKeyPairsResponse struct { - *tchttp.BaseResponse - Response *AssociateInstancesKeyPairsResponseParams `json:"Response"` -} - -func (r *AssociateInstancesKeyPairsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateInstancesKeyPairsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateSecurityGroupsRequestParams struct { - // 要绑定的`安全组ID`,类似sg-efil73jd,只支持绑定单个安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 被绑定的`实例ID`,类似ins-lesecurk,支持指定多个实例,每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type AssociateSecurityGroupsRequest struct { - *tchttp.BaseRequest - - // 要绑定的`安全组ID`,类似sg-efil73jd,只支持绑定单个安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 被绑定的`实例ID`,类似ins-lesecurk,支持指定多个实例,每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *AssociateSecurityGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateSecurityGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupIds") - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateSecurityGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateSecurityGroupsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssociateSecurityGroupsResponse struct { - *tchttp.BaseResponse - Response *AssociateSecurityGroupsResponseParams `json:"Response"` -} - -func (r *AssociateSecurityGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateSecurityGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type ChargePrepaid struct { - // 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36。 - Period *uint64 `json:"Period,omitempty" name:"Period"` - - // 自动续费标识。取值范围:
  • NOTIFY_AND_AUTO_RENEW:通知过期且自动续费
  • NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费
  • DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费

    默认取值:NOTIFY_AND_AUTO_RENEW。若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` -} - -type ChcDeployExtraConfig struct { -} - -type ChcHost struct { - // CHC物理服务器ID。 - ChcId *string `json:"ChcId,omitempty" name:"ChcId"` - - // 实例名称。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 服务器序列号。 - SerialNumber *string `json:"SerialNumber,omitempty" name:"SerialNumber"` - - // CHC的状态
    - //
      - //
    • INIT: 设备已录入。还未配置带外和部署网络
    • - //
    • READY: 已配置带外和部署网络
    • - //
    • PREPARED: 可分配云主机
    • - //
    • ONLINE: 已分配云主机
    • - //
    • OPERATING: 设备操作中,如正在配置带外网络等。
    • - //
    • CLEAR_NETWORK_FAILED: 清理带外和部署网络失败
    • - //
    - InstanceState *string `json:"InstanceState,omitempty" name:"InstanceState"` - - // 设备类型。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeviceType *string `json:"DeviceType,omitempty" name:"DeviceType"` - - // 所属可用区 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 带外网络。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BmcVirtualPrivateCloud *VirtualPrivateCloud `json:"BmcVirtualPrivateCloud,omitempty" name:"BmcVirtualPrivateCloud"` - - // 带外网络Ip。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BmcIp *string `json:"BmcIp,omitempty" name:"BmcIp"` - - // 带外网络安全组Id。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BmcSecurityGroupIds []*string `json:"BmcSecurityGroupIds,omitempty" name:"BmcSecurityGroupIds"` - - // 部署网络。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeployVirtualPrivateCloud *VirtualPrivateCloud `json:"DeployVirtualPrivateCloud,omitempty" name:"DeployVirtualPrivateCloud"` - - // 部署网络Ip。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeployIp *string `json:"DeployIp,omitempty" name:"DeployIp"` - - // 部署网络安全组Id。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeploySecurityGroupIds []*string `json:"DeploySecurityGroupIds,omitempty" name:"DeploySecurityGroupIds"` - - // 关联的云主机Id。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CvmInstanceId *string `json:"CvmInstanceId,omitempty" name:"CvmInstanceId"` - - // 服务器导入的时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 机型的硬件描述,分别为CPU核数,内存容量和磁盘容量 - // 注意:此字段可能返回 null,表示取不到有效值。 - HardwareDescription *string `json:"HardwareDescription,omitempty" name:"HardwareDescription"` - - // CHC物理服务器的CPU核数 - // 注意:此字段可能返回 null,表示取不到有效值。 - CPU *int64 `json:"CPU,omitempty" name:"CPU"` - - // CHC物理服务器的内存大小,单位为GB - // 注意:此字段可能返回 null,表示取不到有效值。 - Memory *int64 `json:"Memory,omitempty" name:"Memory"` - - // CHC物理服务器的磁盘信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - Disk *string `json:"Disk,omitempty" name:"Disk"` - - // 带外网络下分配的MAC地址 - // 注意:此字段可能返回 null,表示取不到有效值。 - BmcMAC *string `json:"BmcMAC,omitempty" name:"BmcMAC"` - - // 部署网络下分配的MAC地址 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeployMAC *string `json:"DeployMAC,omitempty" name:"DeployMAC"` - - // 设备托管类型。 - // HOSTING: 托管 - // TENANT: 租赁 - // 注意:此字段可能返回 null,表示取不到有效值。 - TenantType *string `json:"TenantType,omitempty" name:"TenantType"` - - // chc dhcp选项,用于minios调试 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeployExtraConfig *ChcDeployExtraConfig `json:"DeployExtraConfig,omitempty" name:"DeployExtraConfig"` -} - -type ChcHostDeniedActions struct { - // CHC物理服务器的实例id - ChcId *string `json:"ChcId,omitempty" name:"ChcId"` - - // CHC物理服务器的状态 - State *string `json:"State,omitempty" name:"State"` - - // 当前CHC物理服务器禁止做的操作 - DenyActions []*string `json:"DenyActions,omitempty" name:"DenyActions"` -} - -// Predefined struct for user -type ConfigureChcAssistVpcRequestParams struct { - // CHC物理服务器的实例Id。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - // 带外网络信息。 - BmcVirtualPrivateCloud *VirtualPrivateCloud `json:"BmcVirtualPrivateCloud,omitempty" name:"BmcVirtualPrivateCloud"` - - // 带外网络的安全组列表 - BmcSecurityGroupIds []*string `json:"BmcSecurityGroupIds,omitempty" name:"BmcSecurityGroupIds"` - - // 部署网络信息。 - DeployVirtualPrivateCloud *VirtualPrivateCloud `json:"DeployVirtualPrivateCloud,omitempty" name:"DeployVirtualPrivateCloud"` - - // 部署网络的安全组列表 - DeploySecurityGroupIds []*string `json:"DeploySecurityGroupIds,omitempty" name:"DeploySecurityGroupIds"` -} - -type ConfigureChcAssistVpcRequest struct { - *tchttp.BaseRequest - - // CHC物理服务器的实例Id。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - // 带外网络信息。 - BmcVirtualPrivateCloud *VirtualPrivateCloud `json:"BmcVirtualPrivateCloud,omitempty" name:"BmcVirtualPrivateCloud"` - - // 带外网络的安全组列表 - BmcSecurityGroupIds []*string `json:"BmcSecurityGroupIds,omitempty" name:"BmcSecurityGroupIds"` - - // 部署网络信息。 - DeployVirtualPrivateCloud *VirtualPrivateCloud `json:"DeployVirtualPrivateCloud,omitempty" name:"DeployVirtualPrivateCloud"` - - // 部署网络的安全组列表 - DeploySecurityGroupIds []*string `json:"DeploySecurityGroupIds,omitempty" name:"DeploySecurityGroupIds"` -} - -func (r *ConfigureChcAssistVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ConfigureChcAssistVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ChcIds") - delete(f, "BmcVirtualPrivateCloud") - delete(f, "BmcSecurityGroupIds") - delete(f, "DeployVirtualPrivateCloud") - delete(f, "DeploySecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ConfigureChcAssistVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ConfigureChcAssistVpcResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ConfigureChcAssistVpcResponse struct { - *tchttp.BaseResponse - Response *ConfigureChcAssistVpcResponseParams `json:"Response"` -} - -func (r *ConfigureChcAssistVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ConfigureChcAssistVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ConfigureChcDeployVpcRequestParams struct { - // CHC物理服务器的实例Id。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - // 部署网络信息。 - DeployVirtualPrivateCloud *VirtualPrivateCloud `json:"DeployVirtualPrivateCloud,omitempty" name:"DeployVirtualPrivateCloud"` - - // 部署网络的安全组列表。 - DeploySecurityGroupIds []*string `json:"DeploySecurityGroupIds,omitempty" name:"DeploySecurityGroupIds"` -} - -type ConfigureChcDeployVpcRequest struct { - *tchttp.BaseRequest - - // CHC物理服务器的实例Id。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - // 部署网络信息。 - DeployVirtualPrivateCloud *VirtualPrivateCloud `json:"DeployVirtualPrivateCloud,omitempty" name:"DeployVirtualPrivateCloud"` - - // 部署网络的安全组列表。 - DeploySecurityGroupIds []*string `json:"DeploySecurityGroupIds,omitempty" name:"DeploySecurityGroupIds"` -} - -func (r *ConfigureChcDeployVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ConfigureChcDeployVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ChcIds") - delete(f, "DeployVirtualPrivateCloud") - delete(f, "DeploySecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ConfigureChcDeployVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ConfigureChcDeployVpcResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ConfigureChcDeployVpcResponse struct { - *tchttp.BaseResponse - Response *ConfigureChcDeployVpcResponseParams `json:"Response"` -} - -func (r *ConfigureChcDeployVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ConfigureChcDeployVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDisasterRecoverGroupRequestParams struct { - // 分散置放群组名称,长度1-60个字符,支持中、英文。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 分散置放群组类型,取值范围:
  • HOST:物理机
  • SW:交换机
  • RACK:机架 - Type *string `json:"Type,omitempty" name:"Type"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。
    更多详细信息请参阅:如何保证幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` -} - -type CreateDisasterRecoverGroupRequest struct { - *tchttp.BaseRequest - - // 分散置放群组名称,长度1-60个字符,支持中、英文。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 分散置放群组类型,取值范围:
  • HOST:物理机
  • SW:交换机
  • RACK:机架 - Type *string `json:"Type,omitempty" name:"Type"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。
    更多详细信息请参阅:如何保证幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` -} - -func (r *CreateDisasterRecoverGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDisasterRecoverGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Name") - delete(f, "Type") - delete(f, "ClientToken") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDisasterRecoverGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDisasterRecoverGroupResponseParams struct { - // 分散置放群组ID列表。 - DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` - - // 分散置放群组类型,取值范围:
  • HOST:物理机
  • SW:交换机
  • RACK:机架 - Type *string `json:"Type,omitempty" name:"Type"` - - // 分散置放群组名称,长度1-60个字符,支持中、英文。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 置放群组内可容纳的云服务器数量。 - CvmQuotaTotal *int64 `json:"CvmQuotaTotal,omitempty" name:"CvmQuotaTotal"` - - // 置放群组内已有的云服务器数量。 - CurrentNum *int64 `json:"CurrentNum,omitempty" name:"CurrentNum"` - - // 置放群组创建时间。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateDisasterRecoverGroupResponse struct { - *tchttp.BaseResponse - Response *CreateDisasterRecoverGroupResponseParams `json:"Response"` -} - -func (r *CreateDisasterRecoverGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDisasterRecoverGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateHpcClusterRequestParams struct { - // 可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 高性能计算集群名称。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 高性能计算集群备注。 - Remark *string `json:"Remark,omitempty" name:"Remark"` -} - -type CreateHpcClusterRequest struct { - *tchttp.BaseRequest - - // 可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 高性能计算集群名称。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 高性能计算集群备注。 - Remark *string `json:"Remark,omitempty" name:"Remark"` -} - -func (r *CreateHpcClusterRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateHpcClusterRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Zone") - delete(f, "Name") - delete(f, "Remark") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateHpcClusterRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateHpcClusterResponseParams struct { - // 高性能计算集群信息。 - // 注意:此字段可能返回 null,表示取不到有效值。 - HpcClusterSet []*HpcClusterInfo `json:"HpcClusterSet,omitempty" name:"HpcClusterSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateHpcClusterResponse struct { - *tchttp.BaseResponse - Response *CreateHpcClusterResponseParams `json:"Response"` -} - -func (r *CreateHpcClusterResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateHpcClusterResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateImageRequestParams struct { - // 镜像名称 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 需要制作镜像的实例ID。基于实例创建镜像时,为必填参数。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 镜像描述 - ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` - - // 是否执行强制关机以制作镜像。 - // 取值范围:
  • TRUE:表示关机之后制作镜像
  • FALSE:表示开机状态制作镜像

    默认取值:FALSE。

    开机状态制作镜像,可能导致部分数据未备份,影响数据安全。 - ForcePoweroff *string `json:"ForcePoweroff,omitempty" name:"ForcePoweroff"` - - // 创建Windows镜像时是否启用Sysprep。 - // 取值范围:TRUE或FALSE,默认取值为FALSE。 - // - // 关于Sysprep的详情请参考[链接](https://cloud.tencent.com/document/product/213/43498)。 - Sysprep *string `json:"Sysprep,omitempty" name:"Sysprep"` - - // 基于实例创建整机镜像时,指定包含在镜像里的数据盘ID - DataDiskIds []*string `json:"DataDiskIds,omitempty" name:"DataDiskIds"` - - // 基于快照创建镜像,指定快照ID,必须包含一个系统盘快照。不可与InstanceId同时传入。 - SnapshotIds []*string `json:"SnapshotIds,omitempty" name:"SnapshotIds"` - - // 检测本次请求的是否成功,但不会对操作的资源产生任何影响 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到自定义镜像。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` -} - -type CreateImageRequest struct { - *tchttp.BaseRequest - - // 镜像名称 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 需要制作镜像的实例ID。基于实例创建镜像时,为必填参数。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 镜像描述 - ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` - - // 是否执行强制关机以制作镜像。 - // 取值范围:
  • TRUE:表示关机之后制作镜像
  • FALSE:表示开机状态制作镜像

    默认取值:FALSE。

    开机状态制作镜像,可能导致部分数据未备份,影响数据安全。 - ForcePoweroff *string `json:"ForcePoweroff,omitempty" name:"ForcePoweroff"` - - // 创建Windows镜像时是否启用Sysprep。 - // 取值范围:TRUE或FALSE,默认取值为FALSE。 - // - // 关于Sysprep的详情请参考[链接](https://cloud.tencent.com/document/product/213/43498)。 - Sysprep *string `json:"Sysprep,omitempty" name:"Sysprep"` - - // 基于实例创建整机镜像时,指定包含在镜像里的数据盘ID - DataDiskIds []*string `json:"DataDiskIds,omitempty" name:"DataDiskIds"` - - // 基于快照创建镜像,指定快照ID,必须包含一个系统盘快照。不可与InstanceId同时传入。 - SnapshotIds []*string `json:"SnapshotIds,omitempty" name:"SnapshotIds"` - - // 检测本次请求的是否成功,但不会对操作的资源产生任何影响 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到自定义镜像。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` -} - -func (r *CreateImageRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateImageRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ImageName") - delete(f, "InstanceId") - delete(f, "ImageDescription") - delete(f, "ForcePoweroff") - delete(f, "Sysprep") - delete(f, "DataDiskIds") - delete(f, "SnapshotIds") - delete(f, "DryRun") - delete(f, "TagSpecification") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateImageRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateImageResponseParams struct { - // 镜像ID - // 注意:此字段可能返回 null,表示取不到有效值。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateImageResponse struct { - *tchttp.BaseResponse - Response *CreateImageResponseParams `json:"Response"` -} - -func (r *CreateImageResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateImageResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateKeyPairRequestParams struct { - // 密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 - KeyName *string `json:"KeyName,omitempty" name:"KeyName"` - - // 密钥对创建后所属的项目ID。 - // 可以通过以下方式获取项目ID: - //
  • 通过项目列表查询项目ID。 - //
  • 通过调用接口DescribeProject,取返回信息中的`projectId `获取项目ID。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到密钥对。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` -} - -type CreateKeyPairRequest struct { - *tchttp.BaseRequest - - // 密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 - KeyName *string `json:"KeyName,omitempty" name:"KeyName"` - - // 密钥对创建后所属的项目ID。 - // 可以通过以下方式获取项目ID: - //
  • 通过项目列表查询项目ID。 - //
  • 通过调用接口DescribeProject,取返回信息中的`projectId `获取项目ID。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到密钥对。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` -} - -func (r *CreateKeyPairRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateKeyPairRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "KeyName") - delete(f, "ProjectId") - delete(f, "TagSpecification") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateKeyPairRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateKeyPairResponseParams struct { - // 密钥对信息。 - KeyPair *KeyPair `json:"KeyPair,omitempty" name:"KeyPair"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateKeyPairResponse struct { - *tchttp.BaseResponse - Response *CreateKeyPairResponseParams `json:"Response"` -} - -func (r *CreateKeyPairResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateKeyPairResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLaunchTemplateRequestParams struct { - // 实例启动模板名称。长度为2~128个英文或中文字符。 - LaunchTemplateName *string `json:"LaunchTemplateName,omitempty" name:"LaunchTemplateName"` - - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,传入InstanceType获取当前机型支持的镜像列表,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例启动模板版本描述。长度为2~256个英文或中文字符。 - LaunchTemplateVersionDescription *string `json:"LaunchTemplateVersionDescription,omitempty" name:"LaunchTemplateVersionDescription"` - - // 实例机型。不同实例机型指定了不同的资源规格。 - //
  • 对于付费模式为PREPAID或POSTPAID\_BY\_HOUR的实例创建,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则系统将根据当前地域的资源售卖情况动态指定默认机型。
  • 对于付费模式为CDHPAID的实例创建,该参数以"CDH_"为前缀,根据CPU和内存配置生成,具体形式为:CDH_XCXG,例如对于创建CPU为1核,内存为1G大小的专用宿主机的实例,该参数应该为CDH_1C1G。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若不指定该参数,则默认使用基础网络。若在此参数中指定了私有网络IP,即表示每个实例的主网卡IP;同时,InstanceCount参数必须与私有网络IP的个数一致且不能大于20。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 购买实例数量。包年包月实例取值范围:[1,300],按量计费实例取值范围:[1,100]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。
  • 购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。
  • 最多支持60个字符(包含模式串)。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认公共镜像开启云监控、云安全服务;自定义镜像与镜像市场镜像默认不开启云监控,云安全服务,而使用镜像里保留的服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 云服务器的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 定时任务。通过该参数可以为实例指定定时任务,目前仅支持定时销毁。 - ActionTimer *ActionTimer `json:"ActionTimer,omitempty" name:"ActionTimer"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例,当前仅支持绑定标签到云服务器实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 是否只预检此次请求。 - // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 - // 如果检查不通过,则返回对应错误码; - // 如果检查通过,则返回RequestId. - // false(默认):发送正常请求,通过检查后直接创建实例。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // CAM角色名称。可通过[`DescribeRoleList`](https://cloud.tencent.com/document/product/598/13887)接口返回值中的`roleName`获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群ID。若创建的实例为高性能计算实例,需指定实例放置的集群,否则不可指定。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • CDHPAID:独享子机(基于专用宿主机创建,宿主机部分的资源不收费)
  • SPOTPAID:竞价付费
    默认值:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` -} - -type CreateLaunchTemplateRequest struct { - *tchttp.BaseRequest - - // 实例启动模板名称。长度为2~128个英文或中文字符。 - LaunchTemplateName *string `json:"LaunchTemplateName,omitempty" name:"LaunchTemplateName"` - - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,传入InstanceType获取当前机型支持的镜像列表,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例启动模板版本描述。长度为2~256个英文或中文字符。 - LaunchTemplateVersionDescription *string `json:"LaunchTemplateVersionDescription,omitempty" name:"LaunchTemplateVersionDescription"` - - // 实例机型。不同实例机型指定了不同的资源规格。 - //
  • 对于付费模式为PREPAID或POSTPAID\_BY\_HOUR的实例创建,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则系统将根据当前地域的资源售卖情况动态指定默认机型。
  • 对于付费模式为CDHPAID的实例创建,该参数以"CDH_"为前缀,根据CPU和内存配置生成,具体形式为:CDH_XCXG,例如对于创建CPU为1核,内存为1G大小的专用宿主机的实例,该参数应该为CDH_1C1G。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若不指定该参数,则默认使用基础网络。若在此参数中指定了私有网络IP,即表示每个实例的主网卡IP;同时,InstanceCount参数必须与私有网络IP的个数一致且不能大于20。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 购买实例数量。包年包月实例取值范围:[1,300],按量计费实例取值范围:[1,100]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。
  • 购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。
  • 最多支持60个字符(包含模式串)。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认公共镜像开启云监控、云安全服务;自定义镜像与镜像市场镜像默认不开启云监控,云安全服务,而使用镜像里保留的服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 云服务器的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 定时任务。通过该参数可以为实例指定定时任务,目前仅支持定时销毁。 - ActionTimer *ActionTimer `json:"ActionTimer,omitempty" name:"ActionTimer"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例,当前仅支持绑定标签到云服务器实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 是否只预检此次请求。 - // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 - // 如果检查不通过,则返回对应错误码; - // 如果检查通过,则返回RequestId. - // false(默认):发送正常请求,通过检查后直接创建实例。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // CAM角色名称。可通过[`DescribeRoleList`](https://cloud.tencent.com/document/product/598/13887)接口返回值中的`roleName`获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群ID。若创建的实例为高性能计算实例,需指定实例放置的集群,否则不可指定。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • CDHPAID:独享子机(基于专用宿主机创建,宿主机部分的资源不收费)
  • SPOTPAID:竞价付费
    默认值:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` -} - -func (r *CreateLaunchTemplateRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLaunchTemplateRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchTemplateName") - delete(f, "Placement") - delete(f, "ImageId") - delete(f, "LaunchTemplateVersionDescription") - delete(f, "InstanceType") - delete(f, "SystemDisk") - delete(f, "DataDisks") - delete(f, "VirtualPrivateCloud") - delete(f, "InternetAccessible") - delete(f, "InstanceCount") - delete(f, "InstanceName") - delete(f, "LoginSettings") - delete(f, "SecurityGroupIds") - delete(f, "EnhancedService") - delete(f, "ClientToken") - delete(f, "HostName") - delete(f, "ActionTimer") - delete(f, "DisasterRecoverGroupIds") - delete(f, "TagSpecification") - delete(f, "InstanceMarketOptions") - delete(f, "UserData") - delete(f, "DryRun") - delete(f, "CamRoleName") - delete(f, "HpcClusterId") - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "DisableApiTermination") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateLaunchTemplateRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLaunchTemplateResponseParams struct { - // 当通过本接口来创建实例启动模板时会返回该参数,表示创建成功的实例启动模板`ID`。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateLaunchTemplateResponse struct { - *tchttp.BaseResponse - Response *CreateLaunchTemplateResponseParams `json:"Response"` -} - -func (r *CreateLaunchTemplateResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLaunchTemplateResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLaunchTemplateVersionRequestParams struct { - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 启动模板ID,新版本将基于该实例启动模板ID创建。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 若给定,新实例启动模板将基于给定的版本号创建。若未指定则使用默认版本。 - LaunchTemplateVersion *int64 `json:"LaunchTemplateVersion,omitempty" name:"LaunchTemplateVersion"` - - // 实例启动模板版本描述。长度为2~256个英文或中文字符。 - LaunchTemplateVersionDescription *string `json:"LaunchTemplateVersionDescription,omitempty" name:"LaunchTemplateVersionDescription"` - - // 实例机型。不同实例机型指定了不同的资源规格。 - //
  • 对于付费模式为PREPAID或POSTPAID\_BY\_HOUR的实例创建,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则系统将根据当前地域的资源售卖情况动态指定默认机型。
  • 对于付费模式为CDHPAID的实例创建,该参数以"CDH_"为前缀,根据CPU和内存配置生成,具体形式为:CDH_XCXG,例如对于创建CPU为1核,内存为1G大小的专用宿主机的实例,该参数应该为CDH_1C1G。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,传入InstanceType获取当前机型支持的镜像列表,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若不指定该参数,则默认使用基础网络。若在此参数中指定了私有网络IP,即表示每个实例的主网卡IP;同时,InstanceCount参数必须与私有网络IP的个数一致且不能大于20。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 购买实例数量。包年包月实例取值范围:[1,300],按量计费实例取值范围:[1,100]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。
  • 购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。
  • 最多支持60个字符(包含模式串)。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认公共镜像开启云监控、云安全服务;自定义镜像与镜像市场镜像默认不开启云监控,云安全服务,而使用镜像里保留的服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 云服务器的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 定时任务。通过该参数可以为实例指定定时任务,目前仅支持定时销毁。 - ActionTimer *ActionTimer `json:"ActionTimer,omitempty" name:"ActionTimer"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例,当前仅支持绑定标签到云服务器实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 是否只预检此次请求。 - // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 - // 如果检查不通过,则返回对应错误码; - // 如果检查通过,则返回RequestId. - // false(默认):发送正常请求,通过检查后直接创建实例。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // CAM角色名称。可通过[`DescribeRoleList`](https://cloud.tencent.com/document/product/598/13887)接口返回值中的`roleName`获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群ID。若创建的实例为高性能计算实例,需指定实例放置的集群,否则不可指定。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • CDHPAID:独享子机(基于专用宿主机创建,宿主机部分的资源不收费)
  • SPOTPAID:竞价付费
    默认值:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` -} - -type CreateLaunchTemplateVersionRequest struct { - *tchttp.BaseRequest - - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 启动模板ID,新版本将基于该实例启动模板ID创建。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 若给定,新实例启动模板将基于给定的版本号创建。若未指定则使用默认版本。 - LaunchTemplateVersion *int64 `json:"LaunchTemplateVersion,omitempty" name:"LaunchTemplateVersion"` - - // 实例启动模板版本描述。长度为2~256个英文或中文字符。 - LaunchTemplateVersionDescription *string `json:"LaunchTemplateVersionDescription,omitempty" name:"LaunchTemplateVersionDescription"` - - // 实例机型。不同实例机型指定了不同的资源规格。 - //
  • 对于付费模式为PREPAID或POSTPAID\_BY\_HOUR的实例创建,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则系统将根据当前地域的资源售卖情况动态指定默认机型。
  • 对于付费模式为CDHPAID的实例创建,该参数以"CDH_"为前缀,根据CPU和内存配置生成,具体形式为:CDH_XCXG,例如对于创建CPU为1核,内存为1G大小的专用宿主机的实例,该参数应该为CDH_1C1G。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,传入InstanceType获取当前机型支持的镜像列表,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若不指定该参数,则默认使用基础网络。若在此参数中指定了私有网络IP,即表示每个实例的主网卡IP;同时,InstanceCount参数必须与私有网络IP的个数一致且不能大于20。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 购买实例数量。包年包月实例取值范围:[1,300],按量计费实例取值范围:[1,100]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。
  • 购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。
  • 最多支持60个字符(包含模式串)。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认公共镜像开启云监控、云安全服务;自定义镜像与镜像市场镜像默认不开启云监控,云安全服务,而使用镜像里保留的服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 云服务器的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 定时任务。通过该参数可以为实例指定定时任务,目前仅支持定时销毁。 - ActionTimer *ActionTimer `json:"ActionTimer,omitempty" name:"ActionTimer"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例,当前仅支持绑定标签到云服务器实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 是否只预检此次请求。 - // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 - // 如果检查不通过,则返回对应错误码; - // 如果检查通过,则返回RequestId. - // false(默认):发送正常请求,通过检查后直接创建实例。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // CAM角色名称。可通过[`DescribeRoleList`](https://cloud.tencent.com/document/product/598/13887)接口返回值中的`roleName`获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群ID。若创建的实例为高性能计算实例,需指定实例放置的集群,否则不可指定。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • CDHPAID:独享子机(基于专用宿主机创建,宿主机部分的资源不收费)
  • SPOTPAID:竞价付费
    默认值:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` -} - -func (r *CreateLaunchTemplateVersionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLaunchTemplateVersionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Placement") - delete(f, "LaunchTemplateId") - delete(f, "LaunchTemplateVersion") - delete(f, "LaunchTemplateVersionDescription") - delete(f, "InstanceType") - delete(f, "ImageId") - delete(f, "SystemDisk") - delete(f, "DataDisks") - delete(f, "VirtualPrivateCloud") - delete(f, "InternetAccessible") - delete(f, "InstanceCount") - delete(f, "InstanceName") - delete(f, "LoginSettings") - delete(f, "SecurityGroupIds") - delete(f, "EnhancedService") - delete(f, "ClientToken") - delete(f, "HostName") - delete(f, "ActionTimer") - delete(f, "DisasterRecoverGroupIds") - delete(f, "TagSpecification") - delete(f, "InstanceMarketOptions") - delete(f, "UserData") - delete(f, "DryRun") - delete(f, "CamRoleName") - delete(f, "HpcClusterId") - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "DisableApiTermination") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateLaunchTemplateVersionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLaunchTemplateVersionResponseParams struct { - // 新创建的实例启动模板版本号。 - LaunchTemplateVersionNumber *int64 `json:"LaunchTemplateVersionNumber,omitempty" name:"LaunchTemplateVersionNumber"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateLaunchTemplateVersionResponse struct { - *tchttp.BaseResponse - Response *CreateLaunchTemplateVersionResponseParams `json:"Response"` -} - -func (r *CreateLaunchTemplateVersionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLaunchTemplateVersionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type DataDisk struct { - // 数据盘大小,单位:GB。最小调整步长为10G,不同数据盘类型取值范围不同,具体限制详见:[存储概述](https://cloud.tencent.com/document/product/213/4952)。默认值为0,表示不购买数据盘。更多限制详见产品文档。 - DiskSize *int64 `json:"DiskSize,omitempty" name:"DiskSize"` - - // 数据盘类型。数据盘类型限制详见[存储概述](https://cloud.tencent.com/document/product/213/4952)。取值范围:
  • LOCAL_BASIC:本地硬盘
  • LOCAL_SSD:本地SSD硬盘
  • LOCAL_NVME:本地NVME硬盘,与InstanceType强相关,不支持指定
  • LOCAL_PRO:本地HDD硬盘,与InstanceType强相关,不支持指定
  • CLOUD_BASIC:普通云硬盘
  • CLOUD_PREMIUM:高性能云硬盘
  • CLOUD_SSD:SSD云硬盘
  • CLOUD_HSSD:增强型SSD云硬盘
  • CLOUD_TSSD:极速型SSD云硬盘
  • CLOUD_BSSD:通用型SSD云硬盘

    默认取值:LOCAL_BASIC。

    该参数对`ResizeInstanceDisk`接口无效。 - DiskType *string `json:"DiskType,omitempty" name:"DiskType"` - - // 数据盘ID。LOCAL_BASIC 和 LOCAL_SSD 类型没有ID,暂时不支持该参数。 - // 该参数目前仅用于`DescribeInstances`等查询类接口的返回参数,不可用于`RunInstances`等写接口的入参。 - DiskId *string `json:"DiskId,omitempty" name:"DiskId"` - - // 数据盘是否随子机销毁。取值范围: - //
  • TRUE:子机销毁时,销毁数据盘,只支持按小时后付费云盘 - //
  • FALSE:子机销毁时,保留数据盘
    - // 默认取值:TRUE
    - // 该参数目前仅用于 `RunInstances` 接口。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeleteWithInstance *bool `json:"DeleteWithInstance,omitempty" name:"DeleteWithInstance"` - - // 数据盘快照ID。选择的数据盘快照大小需小于数据盘大小。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SnapshotId *string `json:"SnapshotId,omitempty" name:"SnapshotId"` - - // 数据盘是加密。取值范围: - //
  • TRUE:加密 - //
  • FALSE:不加密
    - // 默认取值:FALSE
    - // 该参数目前仅用于 `RunInstances` 接口。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Encrypt *bool `json:"Encrypt,omitempty" name:"Encrypt"` - - // 自定义CMK对应的ID,取值为UUID或者类似kms-abcd1234。用于加密云盘。 - // - // 该参数目前仅用于 `RunInstances` 接口。 - // 注意:此字段可能返回 null,表示取不到有效值。 - KmsKeyId *string `json:"KmsKeyId,omitempty" name:"KmsKeyId"` - - // 云硬盘性能,单位:MB/s - // 注意:此字段可能返回 null,表示取不到有效值。 - ThroughputPerformance *int64 `json:"ThroughputPerformance,omitempty" name:"ThroughputPerformance"` - - // 所属的独享集群ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` -} - -// Predefined struct for user -type DeleteDisasterRecoverGroupsRequestParams struct { - // 分散置放群组ID列表,可通过[DescribeDisasterRecoverGroups](https://cloud.tencent.com/document/api/213/17810)接口获取。每次请求允许操作的分散置放群组数量上限是100。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` -} - -type DeleteDisasterRecoverGroupsRequest struct { - *tchttp.BaseRequest - - // 分散置放群组ID列表,可通过[DescribeDisasterRecoverGroups](https://cloud.tencent.com/document/api/213/17810)接口获取。每次请求允许操作的分散置放群组数量上限是100。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` -} - -func (r *DeleteDisasterRecoverGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteDisasterRecoverGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DisasterRecoverGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDisasterRecoverGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteDisasterRecoverGroupsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteDisasterRecoverGroupsResponse struct { - *tchttp.BaseResponse - Response *DeleteDisasterRecoverGroupsResponseParams `json:"Response"` -} - -func (r *DeleteDisasterRecoverGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteDisasterRecoverGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteHpcClustersRequestParams struct { - // 高性能计算集群ID列表。 - HpcClusterIds []*string `json:"HpcClusterIds,omitempty" name:"HpcClusterIds"` -} - -type DeleteHpcClustersRequest struct { - *tchttp.BaseRequest - - // 高性能计算集群ID列表。 - HpcClusterIds []*string `json:"HpcClusterIds,omitempty" name:"HpcClusterIds"` -} - -func (r *DeleteHpcClustersRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteHpcClustersRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HpcClusterIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteHpcClustersRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteHpcClustersResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteHpcClustersResponse struct { - *tchttp.BaseResponse - Response *DeleteHpcClustersResponseParams `json:"Response"` -} - -func (r *DeleteHpcClustersResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteHpcClustersResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteImagesRequestParams struct { - // 准备删除的镜像Id列表 - ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds"` - - // 是否删除镜像关联的快照 - DeleteBindedSnap *bool `json:"DeleteBindedSnap,omitempty" name:"DeleteBindedSnap"` - - // 检测是否支持删除镜像 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` -} - -type DeleteImagesRequest struct { - *tchttp.BaseRequest - - // 准备删除的镜像Id列表 - ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds"` - - // 是否删除镜像关联的快照 - DeleteBindedSnap *bool `json:"DeleteBindedSnap,omitempty" name:"DeleteBindedSnap"` - - // 检测是否支持删除镜像 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` -} - -func (r *DeleteImagesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteImagesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ImageIds") - delete(f, "DeleteBindedSnap") - delete(f, "DryRun") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteImagesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteImagesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteImagesResponse struct { - *tchttp.BaseResponse - Response *DeleteImagesResponseParams `json:"Response"` -} - -func (r *DeleteImagesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteImagesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteKeyPairsRequestParams struct { - // 一个或多个待操作的密钥对ID。每次请求批量密钥对的上限为100。
    可以通过以下方式获取可用的密钥ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。
  • 通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的 `KeyId` 获取密钥对ID。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` -} - -type DeleteKeyPairsRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的密钥对ID。每次请求批量密钥对的上限为100。
    可以通过以下方式获取可用的密钥ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。
  • 通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的 `KeyId` 获取密钥对ID。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` -} - -func (r *DeleteKeyPairsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteKeyPairsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "KeyIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteKeyPairsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteKeyPairsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteKeyPairsResponse struct { - *tchttp.BaseResponse - Response *DeleteKeyPairsResponseParams `json:"Response"` -} - -func (r *DeleteKeyPairsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteKeyPairsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLaunchTemplateRequestParams struct { - // 启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` -} - -type DeleteLaunchTemplateRequest struct { - *tchttp.BaseRequest - - // 启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` -} - -func (r *DeleteLaunchTemplateRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLaunchTemplateRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchTemplateId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteLaunchTemplateRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLaunchTemplateResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteLaunchTemplateResponse struct { - *tchttp.BaseResponse - Response *DeleteLaunchTemplateResponseParams `json:"Response"` -} - -func (r *DeleteLaunchTemplateResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLaunchTemplateResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLaunchTemplateVersionsRequestParams struct { - // 启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 实例启动模板版本列表。 - LaunchTemplateVersions []*int64 `json:"LaunchTemplateVersions,omitempty" name:"LaunchTemplateVersions"` -} - -type DeleteLaunchTemplateVersionsRequest struct { - *tchttp.BaseRequest - - // 启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 实例启动模板版本列表。 - LaunchTemplateVersions []*int64 `json:"LaunchTemplateVersions,omitempty" name:"LaunchTemplateVersions"` -} - -func (r *DeleteLaunchTemplateVersionsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLaunchTemplateVersionsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchTemplateId") - delete(f, "LaunchTemplateVersions") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteLaunchTemplateVersionsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLaunchTemplateVersionsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteLaunchTemplateVersionsResponse struct { - *tchttp.BaseResponse - Response *DeleteLaunchTemplateVersionsResponseParams `json:"Response"` -} - -func (r *DeleteLaunchTemplateVersionsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLaunchTemplateVersionsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAccountQuotaRequestParams struct { - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • quota-type
  • - //

    按照【配额类型】进行过滤。配额类型形如:PostPaidQuotaSet。

    类型:String

    必选:否

    可选项:PostPaidQuotaSet,DisasterRecoverGroupQuotaSet,PrePaidQuotaSet,SpotPaidQuotaSet

    - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeAccountQuotaRequest struct { - *tchttp.BaseRequest - - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • quota-type
  • - //

    按照【配额类型】进行过滤。配额类型形如:PostPaidQuotaSet。

    类型:String

    必选:否

    可选项:PostPaidQuotaSet,DisasterRecoverGroupQuotaSet,PrePaidQuotaSet,SpotPaidQuotaSet

    - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeAccountQuotaRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAccountQuotaRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAccountQuotaRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAccountQuotaResponseParams struct { - // 用户appid - AppId *uint64 `json:"AppId,omitempty" name:"AppId"` - - // 配额数据 - AccountQuotaOverview *AccountQuotaOverview `json:"AccountQuotaOverview,omitempty" name:"AccountQuotaOverview"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAccountQuotaResponse struct { - *tchttp.BaseResponse - Response *DescribeAccountQuotaResponseParams `json:"Response"` -} - -func (r *DescribeAccountQuotaResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAccountQuotaResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeChcDeniedActionsRequestParams struct { - // CHC物理服务器实例id - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` -} - -type DescribeChcDeniedActionsRequest struct { - *tchttp.BaseRequest - - // CHC物理服务器实例id - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` -} - -func (r *DescribeChcDeniedActionsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeChcDeniedActionsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ChcIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeChcDeniedActionsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeChcDeniedActionsResponseParams struct { - // CHC实例禁止操作信息 - ChcHostDeniedActionSet []*ChcHostDeniedActions `json:"ChcHostDeniedActionSet,omitempty" name:"ChcHostDeniedActionSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeChcDeniedActionsResponse struct { - *tchttp.BaseResponse - Response *DescribeChcDeniedActionsResponseParams `json:"Response"` -} - -func (r *DescribeChcDeniedActionsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeChcDeniedActionsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeChcHostsRequestParams struct { - // CHC物理服务器实例ID。每次请求的实例的上限为100。参数不支持同时指定`ChcIds`和`Filters`。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • instance-name
  • - //

    按照【实例名称】进行过滤。

    类型:String

    必选:否

    - //
  • instance-state
  • - //

    按照【实例状态】进行过滤。状态类型详见[实例状态表](https://cloud.tencent.com/document/api/213/15753#InstanceStatus)

    类型:String

    必选:否

    - //
  • device-type
  • - //

    按照【设备类型】进行过滤。

    类型:String

    必选:否

    - //
  • vpc-id
  • - //

    按照【私有网络唯一ID】进行过滤。

    类型:String

    必选:否

    - //
  • subnet-id
  • - //

    按照【私有子网唯一ID】进行过滤。

    类型:String

    必选:否

    - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeChcHostsRequest struct { - *tchttp.BaseRequest - - // CHC物理服务器实例ID。每次请求的实例的上限为100。参数不支持同时指定`ChcIds`和`Filters`。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • instance-name
  • - //

    按照【实例名称】进行过滤。

    类型:String

    必选:否

    - //
  • instance-state
  • - //

    按照【实例状态】进行过滤。状态类型详见[实例状态表](https://cloud.tencent.com/document/api/213/15753#InstanceStatus)

    类型:String

    必选:否

    - //
  • device-type
  • - //

    按照【设备类型】进行过滤。

    类型:String

    必选:否

    - //
  • vpc-id
  • - //

    按照【私有网络唯一ID】进行过滤。

    类型:String

    必选:否

    - //
  • subnet-id
  • - //

    按照【私有子网唯一ID】进行过滤。

    类型:String

    必选:否

    - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeChcHostsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeChcHostsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ChcIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeChcHostsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeChcHostsResponseParams struct { - // 符合条件的实例数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 返回的实例列表 - ChcHostSet []*ChcHost `json:"ChcHostSet,omitempty" name:"ChcHostSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeChcHostsResponse struct { - *tchttp.BaseResponse - Response *DescribeChcHostsResponseParams `json:"Response"` -} - -func (r *DescribeChcHostsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeChcHostsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDisasterRecoverGroupQuotaRequestParams struct { -} - -type DescribeDisasterRecoverGroupQuotaRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeDisasterRecoverGroupQuotaRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDisasterRecoverGroupQuotaRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDisasterRecoverGroupQuotaRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDisasterRecoverGroupQuotaResponseParams struct { - // 可创建置放群组数量的上限。 - GroupQuota *int64 `json:"GroupQuota,omitempty" name:"GroupQuota"` - - // 当前用户已经创建的置放群组数量。 - CurrentNum *int64 `json:"CurrentNum,omitempty" name:"CurrentNum"` - - // 物理机类型容灾组内实例的配额数。 - CvmInHostGroupQuota *int64 `json:"CvmInHostGroupQuota,omitempty" name:"CvmInHostGroupQuota"` - - // 交换机类型容灾组内实例的配额数。 - CvmInSwGroupQuota *int64 `json:"CvmInSwGroupQuota,omitempty" name:"CvmInSwGroupQuota"` - - // 机架类型容灾组内实例的配额数。 - CvmInRackGroupQuota *int64 `json:"CvmInRackGroupQuota,omitempty" name:"CvmInRackGroupQuota"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeDisasterRecoverGroupQuotaResponse struct { - *tchttp.BaseResponse - Response *DescribeDisasterRecoverGroupQuotaResponseParams `json:"Response"` -} - -func (r *DescribeDisasterRecoverGroupQuotaResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDisasterRecoverGroupQuotaResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDisasterRecoverGroupsRequestParams struct { - // 分散置放群组ID列表。每次请求允许操作的分散置放群组数量上限是100。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 分散置放群组名称,支持模糊匹配。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeDisasterRecoverGroupsRequest struct { - *tchttp.BaseRequest - - // 分散置放群组ID列表。每次请求允许操作的分散置放群组数量上限是100。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 分散置放群组名称,支持模糊匹配。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeDisasterRecoverGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDisasterRecoverGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DisasterRecoverGroupIds") - delete(f, "Name") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDisasterRecoverGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDisasterRecoverGroupsResponseParams struct { - // 分散置放群组信息列表。 - DisasterRecoverGroupSet []*DisasterRecoverGroup `json:"DisasterRecoverGroupSet,omitempty" name:"DisasterRecoverGroupSet"` - - // 用户置放群组总量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeDisasterRecoverGroupsResponse struct { - *tchttp.BaseResponse - Response *DescribeDisasterRecoverGroupsResponseParams `json:"Response"` -} - -func (r *DescribeDisasterRecoverGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDisasterRecoverGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeHostsRequestParams struct { - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • project-id
  • - //

    按照【项目ID】进行过滤,可通过调用[DescribeProject](https://cloud.tencent.com/document/api/378/4400)查询已创建的项目列表或登录[控制台](https://console.cloud.tencent.com/cvm/index)进行查看;也可以调用[AddProject](https://cloud.tencent.com/document/api/378/4398)创建新的项目。项目ID形如:1002189。

    类型:Integer

    必选:否

    - //
  • host-id
  • - //

    按照【[CDH](https://cloud.tencent.com/document/product/416) ID】进行过滤。[CDH](https://cloud.tencent.com/document/product/416) ID形如:host-xxxxxxxx。

    类型:String

    必选:否

    - //
  • host-name
  • - //

    按照【CDH实例名称】进行过滤。

    类型:String

    必选:否

    - //
  • host-state
  • - //

    按照【CDH实例状态】进行过滤。(PENDING:创建中 | LAUNCH_FAILURE:创建失败 | RUNNING:运行中 | EXPIRED:已过期)

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeHostsRequest struct { - *tchttp.BaseRequest - - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • project-id
  • - //

    按照【项目ID】进行过滤,可通过调用[DescribeProject](https://cloud.tencent.com/document/api/378/4400)查询已创建的项目列表或登录[控制台](https://console.cloud.tencent.com/cvm/index)进行查看;也可以调用[AddProject](https://cloud.tencent.com/document/api/378/4398)创建新的项目。项目ID形如:1002189。

    类型:Integer

    必选:否

    - //
  • host-id
  • - //

    按照【[CDH](https://cloud.tencent.com/document/product/416) ID】进行过滤。[CDH](https://cloud.tencent.com/document/product/416) ID形如:host-xxxxxxxx。

    类型:String

    必选:否

    - //
  • host-name
  • - //

    按照【CDH实例名称】进行过滤。

    类型:String

    必选:否

    - //
  • host-state
  • - //

    按照【CDH实例状态】进行过滤。(PENDING:创建中 | LAUNCH_FAILURE:创建失败 | RUNNING:运行中 | EXPIRED:已过期)

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeHostsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeHostsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeHostsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeHostsResponseParams struct { - // 符合查询条件的cdh实例总数 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // cdh实例详细信息列表 - HostSet []*HostItem `json:"HostSet,omitempty" name:"HostSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeHostsResponse struct { - *tchttp.BaseResponse - Response *DescribeHostsResponseParams `json:"Response"` -} - -func (r *DescribeHostsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeHostsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeHpcClustersRequestParams struct { - // 高性能计算集群ID数组。 - HpcClusterIds []*string `json:"HpcClusterIds,omitempty" name:"HpcClusterIds"` - - // 高性能计算集群名称。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 偏移量, 默认值0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 本次请求量, 默认值20。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeHpcClustersRequest struct { - *tchttp.BaseRequest - - // 高性能计算集群ID数组。 - HpcClusterIds []*string `json:"HpcClusterIds,omitempty" name:"HpcClusterIds"` - - // 高性能计算集群名称。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 偏移量, 默认值0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 本次请求量, 默认值20。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeHpcClustersRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeHpcClustersRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HpcClusterIds") - delete(f, "Name") - delete(f, "Zone") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeHpcClustersRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeHpcClustersResponseParams struct { - // 高性能计算集群信息。 - HpcClusterSet []*HpcClusterInfo `json:"HpcClusterSet,omitempty" name:"HpcClusterSet"` - - // 高性能计算集群总数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeHpcClustersResponse struct { - *tchttp.BaseResponse - Response *DescribeHpcClustersResponseParams `json:"Response"` -} - -func (r *DescribeHpcClustersResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeHpcClustersResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeImageQuotaRequestParams struct { -} - -type DescribeImageQuotaRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeImageQuotaRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeImageQuotaRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeImageQuotaRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeImageQuotaResponseParams struct { - // 账户的镜像配额 - ImageNumQuota *int64 `json:"ImageNumQuota,omitempty" name:"ImageNumQuota"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeImageQuotaResponse struct { - *tchttp.BaseResponse - Response *DescribeImageQuotaResponseParams `json:"Response"` -} - -func (r *DescribeImageQuotaResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeImageQuotaResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeImageSharePermissionRequestParams struct { - // 需要共享的镜像Id - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` -} - -type DescribeImageSharePermissionRequest struct { - *tchttp.BaseRequest - - // 需要共享的镜像Id - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` -} - -func (r *DescribeImageSharePermissionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeImageSharePermissionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ImageId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeImageSharePermissionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeImageSharePermissionResponseParams struct { - // 镜像共享信息 - SharePermissionSet []*SharePermission `json:"SharePermissionSet,omitempty" name:"SharePermissionSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeImageSharePermissionResponse struct { - *tchttp.BaseResponse - Response *DescribeImageSharePermissionResponseParams `json:"Response"` -} - -func (r *DescribeImageSharePermissionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeImageSharePermissionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeImagesRequestParams struct { - // 镜像ID列表 。镜像ID如:`img-gvbnzy6f`。array型参数的格式可以参考[API简介](https://cloud.tencent.com/document/api/213/15688)。镜像ID可以通过如下方式获取:
  • 通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。
  • 通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。 - ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds"` - - // 过滤条件,每次请求的`Filters`的上限为10,`Filters.Values`的上限为5。参数不可以同时指定`ImageIds`和`Filters`。详细的过滤条件如下: - // - //
  • image-id
  • - //

    按照【镜像ID】进行过滤。

    类型:String

    必选:否

    - //
  • image-type
  • - //

    按照【镜像类型】进行过滤。

    类型:String

    必选:否

    可选项:

    PRIVATE_IMAGE: 私有镜像 (本账户创建的镜像)

    PUBLIC_IMAGE: 公共镜像 (腾讯云官方镜像)

    SHARED_IMAGE: 共享镜像(其他账户共享给本账户的镜像)

    - //
  • image-name
  • - //

    按照【镜像名称】进行过滤。

    类型:String

    必选:否

    - //
  • platform
  • - //

    按照【镜像平台】进行过滤,如CentOS。

    类型:String

    必选:否

    - //
  • tag-key
  • - //

    按照【标签键】进行过滤。

    类型:String

    必选:否

    - //
  • tag-value
  • - //

    按照【标签值】进行过滤。

    类型:String

    必选:否

    - //
  • tag:tag-key
  • - //

    按照【标签键值对】进行过滤。tag-key使用具体的标签键进行替换。

    类型:String

    必选:否

    - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于Offset详见[API简介](/document/api/213/568#.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0.E4.B8.8E.E8.BF.94.E5.9B.9E.E5.8F.82.E6.95.B0.E9.87.8A.E4.B9.89)。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 数量限制,默认为20,最大值为100。关于Limit详见[API简介](/document/api/213/568#.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0.E4.B8.8E.E8.BF.94.E5.9B.9E.E5.8F.82.E6.95.B0.E9.87.8A.E4.B9.89)。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 实例类型,如 `S1.SMALL1` - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` -} - -type DescribeImagesRequest struct { - *tchttp.BaseRequest - - // 镜像ID列表 。镜像ID如:`img-gvbnzy6f`。array型参数的格式可以参考[API简介](https://cloud.tencent.com/document/api/213/15688)。镜像ID可以通过如下方式获取:
  • 通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。
  • 通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。 - ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds"` - - // 过滤条件,每次请求的`Filters`的上限为10,`Filters.Values`的上限为5。参数不可以同时指定`ImageIds`和`Filters`。详细的过滤条件如下: - // - //
  • image-id
  • - //

    按照【镜像ID】进行过滤。

    类型:String

    必选:否

    - //
  • image-type
  • - //

    按照【镜像类型】进行过滤。

    类型:String

    必选:否

    可选项:

    PRIVATE_IMAGE: 私有镜像 (本账户创建的镜像)

    PUBLIC_IMAGE: 公共镜像 (腾讯云官方镜像)

    SHARED_IMAGE: 共享镜像(其他账户共享给本账户的镜像)

    - //
  • image-name
  • - //

    按照【镜像名称】进行过滤。

    类型:String

    必选:否

    - //
  • platform
  • - //

    按照【镜像平台】进行过滤,如CentOS。

    类型:String

    必选:否

    - //
  • tag-key
  • - //

    按照【标签键】进行过滤。

    类型:String

    必选:否

    - //
  • tag-value
  • - //

    按照【标签值】进行过滤。

    类型:String

    必选:否

    - //
  • tag:tag-key
  • - //

    按照【标签键值对】进行过滤。tag-key使用具体的标签键进行替换。

    类型:String

    必选:否

    - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于Offset详见[API简介](/document/api/213/568#.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0.E4.B8.8E.E8.BF.94.E5.9B.9E.E5.8F.82.E6.95.B0.E9.87.8A.E4.B9.89)。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 数量限制,默认为20,最大值为100。关于Limit详见[API简介](/document/api/213/568#.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0.E4.B8.8E.E8.BF.94.E5.9B.9E.E5.8F.82.E6.95.B0.E9.87.8A.E4.B9.89)。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 实例类型,如 `S1.SMALL1` - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` -} - -func (r *DescribeImagesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeImagesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ImageIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "InstanceType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeImagesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeImagesResponseParams struct { - // 一个关于镜像详细信息的结构体,主要包括镜像的主要状态与属性。 - ImageSet []*Image `json:"ImageSet,omitempty" name:"ImageSet"` - - // 符合要求的镜像数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeImagesResponse struct { - *tchttp.BaseResponse - Response *DescribeImagesResponseParams `json:"Response"` -} - -func (r *DescribeImagesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeImagesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeImportImageOsRequestParams struct { -} - -type DescribeImportImageOsRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeImportImageOsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeImportImageOsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeImportImageOsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeImportImageOsResponseParams struct { - // 支持的导入镜像的操作系统类型。 - ImportImageOsListSupported *ImageOsList `json:"ImportImageOsListSupported,omitempty" name:"ImportImageOsListSupported"` - - // 支持的导入镜像的操作系统版本。 - ImportImageOsVersionSet []*OsVersion `json:"ImportImageOsVersionSet,omitempty" name:"ImportImageOsVersionSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeImportImageOsResponse struct { - *tchttp.BaseResponse - Response *DescribeImportImageOsResponseParams `json:"Response"` -} - -func (r *DescribeImportImageOsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeImportImageOsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstanceFamilyConfigsRequestParams struct { -} - -type DescribeInstanceFamilyConfigsRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeInstanceFamilyConfigsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstanceFamilyConfigsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstanceFamilyConfigsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstanceFamilyConfigsResponseParams struct { - // 实例机型组配置的列表信息 - InstanceFamilyConfigSet []*InstanceFamilyConfig `json:"InstanceFamilyConfigSet,omitempty" name:"InstanceFamilyConfigSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInstanceFamilyConfigsResponse struct { - *tchttp.BaseResponse - Response *DescribeInstanceFamilyConfigsResponseParams `json:"Response"` -} - -func (r *DescribeInstanceFamilyConfigsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstanceFamilyConfigsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstanceInternetBandwidthConfigsRequestParams struct { - // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -type DescribeInstanceInternetBandwidthConfigsRequest struct { - *tchttp.BaseRequest - - // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -func (r *DescribeInstanceInternetBandwidthConfigsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstanceInternetBandwidthConfigsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstanceInternetBandwidthConfigsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstanceInternetBandwidthConfigsResponseParams struct { - // 带宽配置信息列表。 - InternetBandwidthConfigSet []*InternetBandwidthConfig `json:"InternetBandwidthConfigSet,omitempty" name:"InternetBandwidthConfigSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInstanceInternetBandwidthConfigsResponse struct { - *tchttp.BaseResponse - Response *DescribeInstanceInternetBandwidthConfigsResponseParams `json:"Response"` -} - -func (r *DescribeInstanceInternetBandwidthConfigsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstanceInternetBandwidthConfigsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstanceTypeConfigsRequestParams struct { - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • instance-family
  • - //

    按照【实例机型系列】进行过滤。实例机型系列形如:S1、I1、M1等。

    类型:String

    必选:否

    - //
  • instance-type
  • - //

    按照【实例类型】进行过滤。实例类型形如:S5.12XLARGE128、S5.12XLARGE96等。

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为1。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeInstanceTypeConfigsRequest struct { - *tchttp.BaseRequest - - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • instance-family
  • - //

    按照【实例机型系列】进行过滤。实例机型系列形如:S1、I1、M1等。

    类型:String

    必选:否

    - //
  • instance-type
  • - //

    按照【实例类型】进行过滤。实例类型形如:S5.12XLARGE128、S5.12XLARGE96等。

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为1。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeInstanceTypeConfigsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstanceTypeConfigsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstanceTypeConfigsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstanceTypeConfigsResponseParams struct { - // 实例机型配置列表。 - InstanceTypeConfigSet []*InstanceTypeConfig `json:"InstanceTypeConfigSet,omitempty" name:"InstanceTypeConfigSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInstanceTypeConfigsResponse struct { - *tchttp.BaseResponse - Response *DescribeInstanceTypeConfigsResponseParams `json:"Response"` -} - -func (r *DescribeInstanceTypeConfigsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstanceTypeConfigsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstanceVncUrlRequestParams struct { - // 一个操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -type DescribeInstanceVncUrlRequest struct { - *tchttp.BaseRequest - - // 一个操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -func (r *DescribeInstanceVncUrlRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstanceVncUrlRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstanceVncUrlRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstanceVncUrlResponseParams struct { - // 实例的管理终端地址。 - InstanceVncUrl *string `json:"InstanceVncUrl,omitempty" name:"InstanceVncUrl"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInstanceVncUrlResponse struct { - *tchttp.BaseResponse - Response *DescribeInstanceVncUrlResponseParams `json:"Response"` -} - -func (r *DescribeInstanceVncUrlResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstanceVncUrlResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstancesModificationRequestParams struct { - // 一个或多个待查询的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为20。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - //
  • status
  • - //

    按照【配置规格状态】进行过滤。配置规格状态形如:SELL、UNAVAILABLE。

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为2。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeInstancesModificationRequest struct { - *tchttp.BaseRequest - - // 一个或多个待查询的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为20。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - //
  • status
  • - //

    按照【配置规格状态】进行过滤。配置规格状态形如:SELL、UNAVAILABLE。

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为2。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeInstancesModificationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstancesModificationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstancesModificationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstancesModificationResponseParams struct { - // 实例调整的机型配置的数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 实例支持调整的机型配置列表。 - InstanceTypeConfigStatusSet []*InstanceTypeConfigStatus `json:"InstanceTypeConfigStatusSet,omitempty" name:"InstanceTypeConfigStatusSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInstancesModificationResponse struct { - *tchttp.BaseResponse - Response *DescribeInstancesModificationResponseParams `json:"Response"` -} - -func (r *DescribeInstancesModificationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstancesModificationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstancesOperationLimitRequestParams struct { - // 按照一个或者多个实例ID查询,可通过[DescribeInstances](https://cloud.tencent.com/document/api/213/15728)API返回值中的InstanceId获取。实例ID形如:ins-xxxxxxxx。(此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的ids.N一节)。每次请求的实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例操作。 - //
  • INSTANCE_DEGRADE:实例降配操作
  • - Operation *string `json:"Operation,omitempty" name:"Operation"` -} - -type DescribeInstancesOperationLimitRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个实例ID查询,可通过[DescribeInstances](https://cloud.tencent.com/document/api/213/15728)API返回值中的InstanceId获取。实例ID形如:ins-xxxxxxxx。(此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的ids.N一节)。每次请求的实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例操作。 - //
  • INSTANCE_DEGRADE:实例降配操作
  • - Operation *string `json:"Operation,omitempty" name:"Operation"` -} - -func (r *DescribeInstancesOperationLimitRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstancesOperationLimitRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "Operation") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstancesOperationLimitRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstancesOperationLimitResponseParams struct { - // 该参数表示调整配置操作(降配)限制次数查询。 - InstanceOperationLimitSet []*OperationCountLimit `json:"InstanceOperationLimitSet,omitempty" name:"InstanceOperationLimitSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInstancesOperationLimitResponse struct { - *tchttp.BaseResponse - Response *DescribeInstancesOperationLimitResponseParams `json:"Response"` -} - -func (r *DescribeInstancesOperationLimitResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstancesOperationLimitResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstancesRequestParams struct { - // 按照一个或者多个实例ID查询。实例ID例如:`ins-xxxxxxxx`。(此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的`ids.N`一节)。每次请求的实例的上限为100。参数不支持同时指定`InstanceIds`和`Filters`。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - //
  • zone
  • 按照【可用区】进行过滤。可用区例如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

  • project-id
  • 按照【项目ID】进行过滤,可通过调用[DescribeProjects](https://cloud.tencent.com/document/api/651/78725)查询已创建的项目列表或登录[控制台](https://console.cloud.tencent.com/cvm/index)进行查看;也可以调用[AddProject](https://cloud.tencent.com/document/api/651/81952)创建新的项目。项目ID例如:1002189。

    类型:Integer

    必选:否

  • host-id
  • 按照【[CDH](https://cloud.tencent.com/document/product/416) ID】进行过滤。[CDH](https://cloud.tencent.com/document/product/416) ID例如:host-xxxxxxxx。

    类型:String

    必选:否

  • dedicated-cluster-id
  • 按照【[CDC](https://cloud.tencent.com/document/product/1346) ID】进行过滤。[CDC](https://cloud.tencent.com/document/product/1346) ID例如:cluster-xxxxxxx。

    类型:String

    必选:否

  • vpc-id
  • 按照【VPC ID】进行过滤。VPC ID例如:vpc-xxxxxxxx。

    类型:String

    必选:否

  • subnet-id
  • 按照【子网ID】进行过滤。子网ID例如:subnet-xxxxxxxx。

    类型:String

    必选:否

  • instance-id
  • 按照【实例ID】进行过滤。实例ID例如:ins-xxxxxxxx。

    类型:String

    必选:否

  • uuid
  • 按照【实例UUID】进行过滤。实例UUID例如:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx。

    类型:String

    必选:否

  • security-group-id
  • 按照【安全组ID】进行过滤。安全组ID例如: sg-8jlk3f3r。

    类型:String

    必选:否

  • instance-name
  • 按照【实例名称】进行过滤。

    类型:String

    必选:否

  • instance-charge-type
  • 按照【实例计费模式】进行过滤。(PREPAID:表示预付费,即包年包月 | POSTPAID_BY_HOUR:表示后付费,即按量计费 | CDHPAID:表示[CDH](https://cloud.tencent.com/document/product/416)付费,即只对[CDH](https://cloud.tencent.com/document/product/416)计费,不对[CDH](https://cloud.tencent.com/document/product/416)上的实例计费。)

    类型:String

    必选:否

  • instance-state
  • 按照【实例状态】进行过滤。状态类型详见[实例状态表](https://cloud.tencent.com/document/api/213/15753#InstanceStatus)

    类型:String

    必选:否

  • private-ip-address
  • 按照【实例主网卡的内网IP】进行过滤。

    类型:String

    必选:否

  • public-ip-address
  • 按照【实例主网卡的公网IP】进行过滤,包含实例创建时自动分配的IP和实例创建后手动绑定的弹性IP。

    类型:String

    必选:否

  • ipv6-address
  • 按照【实例的IPv6地址】进行过滤。

    类型:String

    必选:否

  • tag-key
  • 按照【标签键】进行过滤。

    类型:String

    必选:否

  • tag-value
  • 按照【标签值】进行过滤。

    类型:String

    必选:否

  • tag:tag-key
  • 按照【标签键值对】进行过滤。tag-key使用具体的标签键进行替换。使用请参考示例2。

    类型:String

    必选:否

  • creation-start-time
  • 按照【实例创建起始时间】进行过滤。例如:2023-06-01 00:00:00。 - //

    类型:String

    必选:否

    - //
  • creation-end-time
  • 按照【实例创建截止时间】进行过滤。例如:2023-06-01 00:00:00。 - //

    类型:String

    必选:否

    每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`InstanceIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeInstancesRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个实例ID查询。实例ID例如:`ins-xxxxxxxx`。(此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的`ids.N`一节)。每次请求的实例的上限为100。参数不支持同时指定`InstanceIds`和`Filters`。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - //
  • zone
  • 按照【可用区】进行过滤。可用区例如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

  • project-id
  • 按照【项目ID】进行过滤,可通过调用[DescribeProjects](https://cloud.tencent.com/document/api/651/78725)查询已创建的项目列表或登录[控制台](https://console.cloud.tencent.com/cvm/index)进行查看;也可以调用[AddProject](https://cloud.tencent.com/document/api/651/81952)创建新的项目。项目ID例如:1002189。

    类型:Integer

    必选:否

  • host-id
  • 按照【[CDH](https://cloud.tencent.com/document/product/416) ID】进行过滤。[CDH](https://cloud.tencent.com/document/product/416) ID例如:host-xxxxxxxx。

    类型:String

    必选:否

  • dedicated-cluster-id
  • 按照【[CDC](https://cloud.tencent.com/document/product/1346) ID】进行过滤。[CDC](https://cloud.tencent.com/document/product/1346) ID例如:cluster-xxxxxxx。

    类型:String

    必选:否

  • vpc-id
  • 按照【VPC ID】进行过滤。VPC ID例如:vpc-xxxxxxxx。

    类型:String

    必选:否

  • subnet-id
  • 按照【子网ID】进行过滤。子网ID例如:subnet-xxxxxxxx。

    类型:String

    必选:否

  • instance-id
  • 按照【实例ID】进行过滤。实例ID例如:ins-xxxxxxxx。

    类型:String

    必选:否

  • uuid
  • 按照【实例UUID】进行过滤。实例UUID例如:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx。

    类型:String

    必选:否

  • security-group-id
  • 按照【安全组ID】进行过滤。安全组ID例如: sg-8jlk3f3r。

    类型:String

    必选:否

  • instance-name
  • 按照【实例名称】进行过滤。

    类型:String

    必选:否

  • instance-charge-type
  • 按照【实例计费模式】进行过滤。(PREPAID:表示预付费,即包年包月 | POSTPAID_BY_HOUR:表示后付费,即按量计费 | CDHPAID:表示[CDH](https://cloud.tencent.com/document/product/416)付费,即只对[CDH](https://cloud.tencent.com/document/product/416)计费,不对[CDH](https://cloud.tencent.com/document/product/416)上的实例计费。)

    类型:String

    必选:否

  • instance-state
  • 按照【实例状态】进行过滤。状态类型详见[实例状态表](https://cloud.tencent.com/document/api/213/15753#InstanceStatus)

    类型:String

    必选:否

  • private-ip-address
  • 按照【实例主网卡的内网IP】进行过滤。

    类型:String

    必选:否

  • public-ip-address
  • 按照【实例主网卡的公网IP】进行过滤,包含实例创建时自动分配的IP和实例创建后手动绑定的弹性IP。

    类型:String

    必选:否

  • ipv6-address
  • 按照【实例的IPv6地址】进行过滤。

    类型:String

    必选:否

  • tag-key
  • 按照【标签键】进行过滤。

    类型:String

    必选:否

  • tag-value
  • 按照【标签值】进行过滤。

    类型:String

    必选:否

  • tag:tag-key
  • 按照【标签键值对】进行过滤。tag-key使用具体的标签键进行替换。使用请参考示例2。

    类型:String

    必选:否

  • creation-start-time
  • 按照【实例创建起始时间】进行过滤。例如:2023-06-01 00:00:00。 - //

    类型:String

    必选:否

    - //
  • creation-end-time
  • 按照【实例创建截止时间】进行过滤。例如:2023-06-01 00:00:00。 - //

    类型:String

    必选:否

    每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`InstanceIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstancesResponseParams struct { - // 符合条件的实例数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 实例详细信息列表。 - InstanceSet []*Instance `json:"InstanceSet,omitempty" name:"InstanceSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInstancesResponse struct { - *tchttp.BaseResponse - Response *DescribeInstancesResponseParams `json:"Response"` -} - -func (r *DescribeInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstancesStatusRequestParams struct { - // 按照一个或者多个实例ID查询。实例ID形如:`ins-11112222`。此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的`ids.N`一节)。每次请求的实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeInstancesStatusRequest struct { - *tchttp.BaseRequest - - // 按照一个或者多个实例ID查询。实例ID形如:`ins-11112222`。此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的`ids.N`一节)。每次请求的实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeInstancesStatusRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstancesStatusRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInstancesStatusRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInstancesStatusResponseParams struct { - // 符合条件的实例状态数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // [实例状态](https://cloud.tencent.com/document/api/213/15753#InstanceStatus) 列表。 - InstanceStatusSet []*InstanceStatus `json:"InstanceStatusSet,omitempty" name:"InstanceStatusSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInstancesStatusResponse struct { - *tchttp.BaseResponse - Response *DescribeInstancesStatusResponseParams `json:"Response"` -} - -func (r *DescribeInstancesStatusResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInstancesStatusResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInternetChargeTypeConfigsRequestParams struct { -} - -type DescribeInternetChargeTypeConfigsRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeInternetChargeTypeConfigsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInternetChargeTypeConfigsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeInternetChargeTypeConfigsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeInternetChargeTypeConfigsResponseParams struct { - // 网络计费类型配置。 - InternetChargeTypeConfigSet []*InternetChargeTypeConfig `json:"InternetChargeTypeConfigSet,omitempty" name:"InternetChargeTypeConfigSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeInternetChargeTypeConfigsResponse struct { - *tchttp.BaseResponse - Response *DescribeInternetChargeTypeConfigsResponseParams `json:"Response"` -} - -func (r *DescribeInternetChargeTypeConfigsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeInternetChargeTypeConfigsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeKeyPairsRequestParams struct { - // 密钥对ID,密钥对ID形如:`skey-11112222`(此接口支持同时传入多个ID进行过滤。此参数的具体格式可参考 API [简介](https://cloud.tencent.com/document/api/213/15688)的 `id.N` 一节)。参数不支持同时指定 `KeyIds` 和 `Filters`。密钥对ID可以通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` - - // 过滤条件。 - //
  • project-id - Integer - 是否必填:否 -(过滤条件)按照项目ID过滤。可以通过[项目列表](https://console.cloud.tencent.com/project)查询项目ID,或者调用接口 [DescribeProject](https://cloud.tencent.com/document/api/378/4400),取返回信息中的projectId获取项目ID。
  • - //
  • key-name - String - 是否必填:否 -(过滤条件)按照密钥对名称过滤。
  • - //
  • tag-key - String - 是否必填:否 -(过滤条件)按照标签键过滤。
  • - //
  • tag-value - String - 是否必填:否 -(过滤条件)按照标签值过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对过滤。tag-key使用具体的标签键进行替换。
  • - // 参数不支持同时指定 `KeyIds` 和 `Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于 `Offset` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。返回数量,默认为20,最大值为100。关于 `Limit` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于 `Limit` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeKeyPairsRequest struct { - *tchttp.BaseRequest - - // 密钥对ID,密钥对ID形如:`skey-11112222`(此接口支持同时传入多个ID进行过滤。此参数的具体格式可参考 API [简介](https://cloud.tencent.com/document/api/213/15688)的 `id.N` 一节)。参数不支持同时指定 `KeyIds` 和 `Filters`。密钥对ID可以通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` - - // 过滤条件。 - //
  • project-id - Integer - 是否必填:否 -(过滤条件)按照项目ID过滤。可以通过[项目列表](https://console.cloud.tencent.com/project)查询项目ID,或者调用接口 [DescribeProject](https://cloud.tencent.com/document/api/378/4400),取返回信息中的projectId获取项目ID。
  • - //
  • key-name - String - 是否必填:否 -(过滤条件)按照密钥对名称过滤。
  • - //
  • tag-key - String - 是否必填:否 -(过滤条件)按照标签键过滤。
  • - //
  • tag-value - String - 是否必填:否 -(过滤条件)按照标签值过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对过滤。tag-key使用具体的标签键进行替换。
  • - // 参数不支持同时指定 `KeyIds` 和 `Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于 `Offset` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。返回数量,默认为20,最大值为100。关于 `Limit` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于 `Limit` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeKeyPairsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeKeyPairsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "KeyIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeKeyPairsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeKeyPairsResponseParams struct { - // 符合条件的密钥对数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 密钥对详细信息列表。 - KeyPairSet []*KeyPair `json:"KeyPairSet,omitempty" name:"KeyPairSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeKeyPairsResponse struct { - *tchttp.BaseResponse - Response *DescribeKeyPairsResponseParams `json:"Response"` -} - -func (r *DescribeKeyPairsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeKeyPairsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLaunchTemplateVersionsRequestParams struct { - // 启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 实例启动模板列表。 - LaunchTemplateVersions []*uint64 `json:"LaunchTemplateVersions,omitempty" name:"LaunchTemplateVersions"` - - // 通过范围指定版本时的最小版本号,默认为0。 - MinVersion *uint64 `json:"MinVersion,omitempty" name:"MinVersion"` - - // 过范围指定版本时的最大版本号,默认为30。 - MaxVersion *uint64 `json:"MaxVersion,omitempty" name:"MaxVersion"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 是否查询默认版本。该参数不可与LaunchTemplateVersions同时指定。 - DefaultVersion *bool `json:"DefaultVersion,omitempty" name:"DefaultVersion"` -} - -type DescribeLaunchTemplateVersionsRequest struct { - *tchttp.BaseRequest - - // 启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 实例启动模板列表。 - LaunchTemplateVersions []*uint64 `json:"LaunchTemplateVersions,omitempty" name:"LaunchTemplateVersions"` - - // 通过范围指定版本时的最小版本号,默认为0。 - MinVersion *uint64 `json:"MinVersion,omitempty" name:"MinVersion"` - - // 过范围指定版本时的最大版本号,默认为30。 - MaxVersion *uint64 `json:"MaxVersion,omitempty" name:"MaxVersion"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 是否查询默认版本。该参数不可与LaunchTemplateVersions同时指定。 - DefaultVersion *bool `json:"DefaultVersion,omitempty" name:"DefaultVersion"` -} - -func (r *DescribeLaunchTemplateVersionsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLaunchTemplateVersionsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchTemplateId") - delete(f, "LaunchTemplateVersions") - delete(f, "MinVersion") - delete(f, "MaxVersion") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "DefaultVersion") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeLaunchTemplateVersionsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLaunchTemplateVersionsResponseParams struct { - // 实例启动模板总数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 实例启动模板版本集合。 - LaunchTemplateVersionSet []*LaunchTemplateVersionInfo `json:"LaunchTemplateVersionSet,omitempty" name:"LaunchTemplateVersionSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeLaunchTemplateVersionsResponse struct { - *tchttp.BaseResponse - Response *DescribeLaunchTemplateVersionsResponseParams `json:"Response"` -} - -func (r *DescribeLaunchTemplateVersionsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLaunchTemplateVersionsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLaunchTemplatesRequestParams struct { - // 启动模板ID,一个或者多个启动模板ID。若未指定,则显示用户所有模板。 - LaunchTemplateIds []*string `json:"LaunchTemplateIds,omitempty" name:"LaunchTemplateIds"` - - //

    按照【LaunchTemplateName】进行过滤。

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`LaunchTemplateIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeLaunchTemplatesRequest struct { - *tchttp.BaseRequest - - // 启动模板ID,一个或者多个启动模板ID。若未指定,则显示用户所有模板。 - LaunchTemplateIds []*string `json:"LaunchTemplateIds,omitempty" name:"LaunchTemplateIds"` - - //

    按照【LaunchTemplateName】进行过滤。

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`LaunchTemplateIds`和`Filters`。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeLaunchTemplatesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLaunchTemplatesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchTemplateIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeLaunchTemplatesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLaunchTemplatesResponseParams struct { - // 符合条件的实例模板数量。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 实例详细信息列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LaunchTemplateSet []*LaunchTemplateInfo `json:"LaunchTemplateSet,omitempty" name:"LaunchTemplateSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeLaunchTemplatesResponse struct { - *tchttp.BaseResponse - Response *DescribeLaunchTemplatesResponseParams `json:"Response"` -} - -func (r *DescribeLaunchTemplatesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLaunchTemplatesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeRegionsRequestParams struct { -} - -type DescribeRegionsRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeRegionsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeRegionsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeRegionsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeRegionsResponseParams struct { - // 地域数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 地域列表信息。 - RegionSet []*RegionInfo `json:"RegionSet,omitempty" name:"RegionSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeRegionsResponse struct { - *tchttp.BaseResponse - Response *DescribeRegionsResponseParams `json:"Response"` -} - -func (r *DescribeRegionsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeRegionsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeReservedInstancesConfigInfosRequestParams struct { - // zone - // 按照预留实例计费可购买的可用区进行过滤。形如:ap-guangzhou-1。 - // 类型:String - // 必选:否 - // 可选项:各地域可用区列表 - // - // product-description - // 按照预留实例计费的平台描述(即操作系统)进行过滤。形如:linux。 - // 类型:String - // 必选:否 - // 可选项:linux - // - // duration - // 按照预留实例计费有效期,即预留实例计费购买时长进行过滤。形如:31536000。 - // 类型:Integer - // 计量单位:秒 - // 必选:否 - // 可选项:31536000 (1年) - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeReservedInstancesConfigInfosRequest struct { - *tchttp.BaseRequest - - // zone - // 按照预留实例计费可购买的可用区进行过滤。形如:ap-guangzhou-1。 - // 类型:String - // 必选:否 - // 可选项:各地域可用区列表 - // - // product-description - // 按照预留实例计费的平台描述(即操作系统)进行过滤。形如:linux。 - // 类型:String - // 必选:否 - // 可选项:linux - // - // duration - // 按照预留实例计费有效期,即预留实例计费购买时长进行过滤。形如:31536000。 - // 类型:Integer - // 计量单位:秒 - // 必选:否 - // 可选项:31536000 (1年) - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeReservedInstancesConfigInfosRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeReservedInstancesConfigInfosRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeReservedInstancesConfigInfosRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeReservedInstancesConfigInfosResponseParams struct { - // 预留实例静态配置信息列表。 - ReservedInstanceConfigInfos []*ReservedInstanceConfigInfoItem `json:"ReservedInstanceConfigInfos,omitempty" name:"ReservedInstanceConfigInfos"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeReservedInstancesConfigInfosResponse struct { - *tchttp.BaseResponse - Response *DescribeReservedInstancesConfigInfosResponseParams `json:"Response"` -} - -func (r *DescribeReservedInstancesConfigInfosResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeReservedInstancesConfigInfosResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeReservedInstancesOfferingsRequestParams struct { - // 试运行, 默认为 false。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - // 以最大有效期作为过滤参数。 - // 计量单位: 秒 - // 默认为 94608000。 - MaxDuration *int64 `json:"MaxDuration,omitempty" name:"MaxDuration"` - - // 以最小有效期作为过滤参数。 - // 计量单位: 秒 - // 默认为 2592000。 - MinDuration *int64 `json:"MinDuration,omitempty" name:"MinDuration"` - - //
  • zone
  • - //

    按照预留实例计费可购买的【可用区】进行过滤。形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • duration
  • - //

    按照预留实例计费【有效期】即预留实例计费购买时长进行过滤。形如:31536000。

    类型:Integer

    计量单位:秒

    必选:否

    可选项:31536000 (1年) | 94608000(3年)

    - //
  • instance-type
  • - //

    按照【预留实例计费类型】进行过滤。形如:S3.MEDIUM4。

    类型:String

    必选:否

    可选项:预留实例计费类型列表

    - //
  • offering-type
  • - //

    按照【付款类型】进行过滤。形如:All Upfront (预付全部费用)。

    类型:String

    必选:否

    可选项:All Upfront (预付全部费用)

    - //
  • product-description
  • - //

    按照预留实例计费的【平台描述】(即操作系统)进行过滤。形如:linux。

    类型:String

    必选:否

    可选项:linux

    - //
  • reserved-instances-offering-id
  • - //

    按照【预留实例计费配置ID】进行过滤。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeReservedInstancesOfferingsRequest struct { - *tchttp.BaseRequest - - // 试运行, 默认为 false。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - // 以最大有效期作为过滤参数。 - // 计量单位: 秒 - // 默认为 94608000。 - MaxDuration *int64 `json:"MaxDuration,omitempty" name:"MaxDuration"` - - // 以最小有效期作为过滤参数。 - // 计量单位: 秒 - // 默认为 2592000。 - MinDuration *int64 `json:"MinDuration,omitempty" name:"MinDuration"` - - //
  • zone
  • - //

    按照预留实例计费可购买的【可用区】进行过滤。形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • duration
  • - //

    按照预留实例计费【有效期】即预留实例计费购买时长进行过滤。形如:31536000。

    类型:Integer

    计量单位:秒

    必选:否

    可选项:31536000 (1年) | 94608000(3年)

    - //
  • instance-type
  • - //

    按照【预留实例计费类型】进行过滤。形如:S3.MEDIUM4。

    类型:String

    必选:否

    可选项:预留实例计费类型列表

    - //
  • offering-type
  • - //

    按照【付款类型】进行过滤。形如:All Upfront (预付全部费用)。

    类型:String

    必选:否

    可选项:All Upfront (预付全部费用)

    - //
  • product-description
  • - //

    按照预留实例计费的【平台描述】(即操作系统)进行过滤。形如:linux。

    类型:String

    必选:否

    可选项:linux

    - //
  • reserved-instances-offering-id
  • - //

    按照【预留实例计费配置ID】进行过滤。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeReservedInstancesOfferingsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeReservedInstancesOfferingsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DryRun") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "MaxDuration") - delete(f, "MinDuration") - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeReservedInstancesOfferingsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeReservedInstancesOfferingsResponseParams struct { - // 符合条件的预留实例计费数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 符合条件的预留实例计费列表。 - ReservedInstancesOfferingsSet []*ReservedInstancesOffering `json:"ReservedInstancesOfferingsSet,omitempty" name:"ReservedInstancesOfferingsSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeReservedInstancesOfferingsResponse struct { - *tchttp.BaseResponse - Response *DescribeReservedInstancesOfferingsResponseParams `json:"Response"` -} - -func (r *DescribeReservedInstancesOfferingsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeReservedInstancesOfferingsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeReservedInstancesRequestParams struct { - // 试运行。默认为 false。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - //
  • zone
  • - //

    按照预留实例计费可购买的【可用区】进行过滤。形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • duration
  • - //

    按照预留实例计费【有效期】即预留实例计费购买时长进行过滤。形如:31536000。

    类型:Integer

    计量单位:秒

    必选:否

    可选项:31536000 (1年) | 94608000(3年)

    - //
  • instance-type
  • - //

    按照【预留实例规格】进行过滤。形如:S3.MEDIUM4。

    类型:String

    必选:否

    可选项:预留实例规格列表

    - //
  • instance-family
  • - //

    按照【预留实例类型】进行过滤。形如:S3。

    类型:String

    必选:否

    可选项:预留实例类型列表

    - //
  • offering-type
  • - //
  • offering-type
  • - //

    按照【付款类型】进行过滤。形如:All Upfront (全预付)。

    类型:String

    必选:否

    可选项:All Upfront (全预付) | Partial Upfront (部分预付) | No Upfront (零预付)

    - //
  • product-description
  • - //

    按照预留实例计费的【平台描述】(即操作系统)进行过滤。形如:linux。

    类型:String

    必选:否

    可选项:linux

    - //
  • reserved-instances-id
  • - //

    按照已购买【预留实例计费ID】进行过滤。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。

    类型:String

    必选:否

    - //
  • state
  • - //

    按照已购买【预留实例计费状态】进行过滤。形如:active。

    类型:String

    必选:否

    可选项:active (已创建) | pending (等待被创建) | retired (过期)

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeReservedInstancesRequest struct { - *tchttp.BaseRequest - - // 试运行。默认为 false。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - //
  • zone
  • - //

    按照预留实例计费可购买的【可用区】进行过滤。形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • duration
  • - //

    按照预留实例计费【有效期】即预留实例计费购买时长进行过滤。形如:31536000。

    类型:Integer

    计量单位:秒

    必选:否

    可选项:31536000 (1年) | 94608000(3年)

    - //
  • instance-type
  • - //

    按照【预留实例规格】进行过滤。形如:S3.MEDIUM4。

    类型:String

    必选:否

    可选项:预留实例规格列表

    - //
  • instance-family
  • - //

    按照【预留实例类型】进行过滤。形如:S3。

    类型:String

    必选:否

    可选项:预留实例类型列表

    - //
  • offering-type
  • - //
  • offering-type
  • - //

    按照【付款类型】进行过滤。形如:All Upfront (全预付)。

    类型:String

    必选:否

    可选项:All Upfront (全预付) | Partial Upfront (部分预付) | No Upfront (零预付)

    - //
  • product-description
  • - //

    按照预留实例计费的【平台描述】(即操作系统)进行过滤。形如:linux。

    类型:String

    必选:否

    可选项:linux

    - //
  • reserved-instances-id
  • - //

    按照已购买【预留实例计费ID】进行过滤。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。

    类型:String

    必选:否

    - //
  • state
  • - //

    按照已购买【预留实例计费状态】进行过滤。形如:active。

    类型:String

    必选:否

    可选项:active (已创建) | pending (等待被创建) | retired (过期)

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeReservedInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeReservedInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DryRun") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeReservedInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeReservedInstancesResponseParams struct { - // 符合条件的预留实例计费数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 符合条件的预留实例计费列表。 - ReservedInstancesSet []*ReservedInstances `json:"ReservedInstancesSet,omitempty" name:"ReservedInstancesSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeReservedInstancesResponse struct { - *tchttp.BaseResponse - Response *DescribeReservedInstancesResponseParams `json:"Response"` -} - -func (r *DescribeReservedInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeReservedInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTaskInfoRequestParams struct { - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 按照指定的产品类型查询,支持取值: - // - // - `CVM`:云服务器 - // - `CDH`:专用宿主机 - // - `CPM2.0`:裸金属云服务器 - // - // 未传入或为空时,默认查询全部产品类型。 - Product *string `json:"Product,omitempty" name:"Product"` - - // 按照一个或多个任务状态ID进行过滤。 - // `TaskStatus`(任务状态ID)与任务状态中文名的对应关系如下: - // - // - `1`:待授权 - // - `2`:处理中 - // - `3`:已结束 - // - `4`:已预约 - // - `5`:已取消 - // - `6`:已避免 - // - // 各任务状态的具体含义,可参考 [任务状态](https://cloud.tencent.com/document/product/213/67789#.E4.BB.BB.E5.8A.A1.E7.8A.B6.E6.80.81)。 - TaskStatus []*int64 `json:"TaskStatus,omitempty" name:"TaskStatus"` - - // 按照一个或多个任务类型ID进行过滤。 - // - // `TaskTypeId`(任务类型ID)与任务类型中文名的对应关系如下: - // - // - `101`:实例运行隐患 - // - `102`:实例运行异常 - // - `103`:实例硬盘异常 - // - `104`:实例网络连接异常 - // - `105`:实例运行预警 - // - `106`:实例硬盘预警 - // - `107`:实例维护升级 - // - // 各任务类型的具体含义,可参考 [维修任务分类](https://cloud.tencent.com/document/product/213/67789#.E7.BB.B4.E4.BF.AE.E4.BB.BB.E5.8A.A1.E5.88.86.E7.B1.BB)。 - TaskTypeIds []*int64 `json:"TaskTypeIds,omitempty" name:"TaskTypeIds"` - - // 按照一个或者多个任务ID查询。任务ID形如:`rep-xxxxxxxx`。 - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` - - // 按照一个或者多个实例ID查询。实例ID形如:`ins-xxxxxxxx`。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 按照一个或者多个实例名称查询。 - Aliases []*string `json:"Aliases,omitempty" name:"Aliases"` - - // 时间查询区间的起始位置,会根据任务创建时间`CreateTime`进行过滤。未传入时默认为当天`00:00:00`。 - StartDate *string `json:"StartDate,omitempty" name:"StartDate"` - - // 时间查询区间的终止位置,会根据任务创建时间`CreateTime`进行过滤。未传入时默认为当前时刻。 - EndDate *string `json:"EndDate,omitempty" name:"EndDate"` - - // 指定返回维修任务列表的排序字段,目前支持: - // - // - `CreateTime`:任务创建时间 - // - `AuthTime`:任务授权时间 - // - `EndTime`:任务结束时间 - // - // 未传入时或为空时,默认按`CreateTime`字段进行排序。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方式,目前支持: - // - // - `0`:升序(默认) - // - `1`:降序 - // - // 未传入或为空时,默认按升序排序。 - Order *int64 `json:"Order,omitempty" name:"Order"` -} - -type DescribeTaskInfoRequest struct { - *tchttp.BaseRequest - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 按照指定的产品类型查询,支持取值: - // - // - `CVM`:云服务器 - // - `CDH`:专用宿主机 - // - `CPM2.0`:裸金属云服务器 - // - // 未传入或为空时,默认查询全部产品类型。 - Product *string `json:"Product,omitempty" name:"Product"` - - // 按照一个或多个任务状态ID进行过滤。 - // `TaskStatus`(任务状态ID)与任务状态中文名的对应关系如下: - // - // - `1`:待授权 - // - `2`:处理中 - // - `3`:已结束 - // - `4`:已预约 - // - `5`:已取消 - // - `6`:已避免 - // - // 各任务状态的具体含义,可参考 [任务状态](https://cloud.tencent.com/document/product/213/67789#.E4.BB.BB.E5.8A.A1.E7.8A.B6.E6.80.81)。 - TaskStatus []*int64 `json:"TaskStatus,omitempty" name:"TaskStatus"` - - // 按照一个或多个任务类型ID进行过滤。 - // - // `TaskTypeId`(任务类型ID)与任务类型中文名的对应关系如下: - // - // - `101`:实例运行隐患 - // - `102`:实例运行异常 - // - `103`:实例硬盘异常 - // - `104`:实例网络连接异常 - // - `105`:实例运行预警 - // - `106`:实例硬盘预警 - // - `107`:实例维护升级 - // - // 各任务类型的具体含义,可参考 [维修任务分类](https://cloud.tencent.com/document/product/213/67789#.E7.BB.B4.E4.BF.AE.E4.BB.BB.E5.8A.A1.E5.88.86.E7.B1.BB)。 - TaskTypeIds []*int64 `json:"TaskTypeIds,omitempty" name:"TaskTypeIds"` - - // 按照一个或者多个任务ID查询。任务ID形如:`rep-xxxxxxxx`。 - TaskIds []*string `json:"TaskIds,omitempty" name:"TaskIds"` - - // 按照一个或者多个实例ID查询。实例ID形如:`ins-xxxxxxxx`。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 按照一个或者多个实例名称查询。 - Aliases []*string `json:"Aliases,omitempty" name:"Aliases"` - - // 时间查询区间的起始位置,会根据任务创建时间`CreateTime`进行过滤。未传入时默认为当天`00:00:00`。 - StartDate *string `json:"StartDate,omitempty" name:"StartDate"` - - // 时间查询区间的终止位置,会根据任务创建时间`CreateTime`进行过滤。未传入时默认为当前时刻。 - EndDate *string `json:"EndDate,omitempty" name:"EndDate"` - - // 指定返回维修任务列表的排序字段,目前支持: - // - // - `CreateTime`:任务创建时间 - // - `AuthTime`:任务授权时间 - // - `EndTime`:任务结束时间 - // - // 未传入时或为空时,默认按`CreateTime`字段进行排序。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方式,目前支持: - // - // - `0`:升序(默认) - // - `1`:降序 - // - // 未传入或为空时,默认按升序排序。 - Order *int64 `json:"Order,omitempty" name:"Order"` -} - -func (r *DescribeTaskInfoRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTaskInfoRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Limit") - delete(f, "Offset") - delete(f, "Product") - delete(f, "TaskStatus") - delete(f, "TaskTypeIds") - delete(f, "TaskIds") - delete(f, "InstanceIds") - delete(f, "Aliases") - delete(f, "StartDate") - delete(f, "EndDate") - delete(f, "OrderField") - delete(f, "Order") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTaskInfoRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTaskInfoResponseParams struct { - // 查询返回的维修任务总数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 查询返回的维修任务列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RepairTaskInfoSet []*RepairTaskInfo `json:"RepairTaskInfoSet,omitempty" name:"RepairTaskInfoSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeTaskInfoResponse struct { - *tchttp.BaseResponse - Response *DescribeTaskInfoResponseParams `json:"Response"` -} - -func (r *DescribeTaskInfoResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTaskInfoResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeZoneInstanceConfigInfosRequestParams struct { - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • instance-family
  • - //

    按照【实例机型系列】进行过滤。实例机型系列形如:S1、I1、M1等。

    类型:String

    必选:否

    - //
  • instance-type
  • - //

    按照【实例机型】进行过滤。不同实例机型指定了不同的资源规格,具体取值可通过调用接口 [DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/product/213/15749) 来获得最新的规格表或参见[实例类型](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则默认机型为S1.SMALL1。

    类型:String

    必选:否

    - //
  • instance-charge-type
  • - //

    按照【实例计费模式】进行过滤。(PREPAID:表示预付费,即包年包月 | POSTPAID_BY_HOUR:表示后付费,即按量计费 )

    类型:String

    必选:否

    - //
  • sort-keys
  • - //

    按关键字进行排序,格式为排序字段加排序方式,中间用冒号分隔。 例如: 按cpu数逆序排序 "cpu:desc", 按mem大小顺序排序 "mem:asc"

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为100。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeZoneInstanceConfigInfosRequest struct { - *tchttp.BaseRequest - - //
  • zone
  • - //

    按照【可用区】进行过滤。可用区形如:ap-guangzhou-1。

    类型:String

    必选:否

    可选项:可用区列表

    - //
  • instance-family
  • - //

    按照【实例机型系列】进行过滤。实例机型系列形如:S1、I1、M1等。

    类型:String

    必选:否

    - //
  • instance-type
  • - //

    按照【实例机型】进行过滤。不同实例机型指定了不同的资源规格,具体取值可通过调用接口 [DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/product/213/15749) 来获得最新的规格表或参见[实例类型](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则默认机型为S1.SMALL1。

    类型:String

    必选:否

    - //
  • instance-charge-type
  • - //

    按照【实例计费模式】进行过滤。(PREPAID:表示预付费,即包年包月 | POSTPAID_BY_HOUR:表示后付费,即按量计费 )

    类型:String

    必选:否

    - //
  • sort-keys
  • - //

    按关键字进行排序,格式为排序字段加排序方式,中间用冒号分隔。 例如: 按cpu数逆序排序 "cpu:desc", 按mem大小顺序排序 "mem:asc"

    类型:String

    必选:否

    - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为100。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeZoneInstanceConfigInfosRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeZoneInstanceConfigInfosRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeZoneInstanceConfigInfosRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeZoneInstanceConfigInfosResponseParams struct { - // 可用区机型配置列表。 - InstanceTypeQuotaSet []*InstanceTypeQuotaItem `json:"InstanceTypeQuotaSet,omitempty" name:"InstanceTypeQuotaSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeZoneInstanceConfigInfosResponse struct { - *tchttp.BaseResponse - Response *DescribeZoneInstanceConfigInfosResponseParams `json:"Response"` -} - -func (r *DescribeZoneInstanceConfigInfosResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeZoneInstanceConfigInfosResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeZonesRequestParams struct { -} - -type DescribeZonesRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeZonesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeZonesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeZonesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeZonesResponseParams struct { - // 可用区数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 可用区列表信息。 - ZoneSet []*ZoneInfo `json:"ZoneSet,omitempty" name:"ZoneSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeZonesResponse struct { - *tchttp.BaseResponse - Response *DescribeZonesResponseParams `json:"Response"` -} - -func (r *DescribeZonesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeZonesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateInstancesKeyPairsRequestParams struct { - // 一个或多个待操作的实例ID,每次请求批量实例的上限为100。

    可以通过以下方式获取可用的实例ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询实例ID。
  • 通过调用接口 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) ,取返回信息中的 `InstanceId` 获取实例ID。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 密钥对ID列表,每次请求批量密钥对的上限为100。密钥对ID形如:`skey-11112222`。

    可以通过以下方式获取可用的密钥ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。
  • 通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的 `KeyId` 获取密钥对ID。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再解绑密钥。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机。
  • FALSE:表示在正常关机失败后不进行强制关机。

    默认取值:FALSE。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -type DisassociateInstancesKeyPairsRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID,每次请求批量实例的上限为100。

    可以通过以下方式获取可用的实例ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询实例ID。
  • 通过调用接口 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) ,取返回信息中的 `InstanceId` 获取实例ID。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 密钥对ID列表,每次请求批量密钥对的上限为100。密钥对ID形如:`skey-11112222`。

    可以通过以下方式获取可用的密钥ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。
  • 通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的 `KeyId` 获取密钥对ID。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再解绑密钥。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机。
  • FALSE:表示在正常关机失败后不进行强制关机。

    默认取值:FALSE。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -func (r *DisassociateInstancesKeyPairsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateInstancesKeyPairsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "KeyIds") - delete(f, "ForceStop") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateInstancesKeyPairsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateInstancesKeyPairsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateInstancesKeyPairsResponse struct { - *tchttp.BaseResponse - Response *DisassociateInstancesKeyPairsResponseParams `json:"Response"` -} - -func (r *DisassociateInstancesKeyPairsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateInstancesKeyPairsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateSecurityGroupsRequestParams struct { - // 要解绑的`安全组ID`,类似sg-efil73jd,只支持解绑单个安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 被解绑的`实例ID`,类似ins-lesecurk,支持指定多个实例 。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type DisassociateSecurityGroupsRequest struct { - *tchttp.BaseRequest - - // 要解绑的`安全组ID`,类似sg-efil73jd,只支持解绑单个安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 被解绑的`实例ID`,类似ins-lesecurk,支持指定多个实例 。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *DisassociateSecurityGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateSecurityGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupIds") - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateSecurityGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateSecurityGroupsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateSecurityGroupsResponse struct { - *tchttp.BaseResponse - Response *DisassociateSecurityGroupsResponseParams `json:"Response"` -} - -func (r *DisassociateSecurityGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateSecurityGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type DisasterRecoverGroup struct { - // 分散置放群组id。 - DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` - - // 分散置放群组名称,长度1-60个字符。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 分散置放群组类型,取值范围:
  • HOST:物理机
  • SW:交换机
  • RACK:机架 - Type *string `json:"Type,omitempty" name:"Type"` - - // 分散置放群组内最大容纳云服务器数量。 - CvmQuotaTotal *int64 `json:"CvmQuotaTotal,omitempty" name:"CvmQuotaTotal"` - - // 分散置放群组内云服务器当前数量。 - CurrentNum *int64 `json:"CurrentNum,omitempty" name:"CurrentNum"` - - // 分散置放群组内,云服务器id列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 分散置放群组创建时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` -} - -type DisasterRecoverGroupQuota struct { - // 可创建置放群组数量的上限。 - GroupQuota *int64 `json:"GroupQuota,omitempty" name:"GroupQuota"` - - // 当前用户已经创建的置放群组数量。 - CurrentNum *int64 `json:"CurrentNum,omitempty" name:"CurrentNum"` - - // 物理机类型容灾组内实例的配额数。 - CvmInHostGroupQuota *int64 `json:"CvmInHostGroupQuota,omitempty" name:"CvmInHostGroupQuota"` - - // 交换机类型容灾组内实例的配额数。 - CvmInSwitchGroupQuota *int64 `json:"CvmInSwitchGroupQuota,omitempty" name:"CvmInSwitchGroupQuota"` - - // 机架类型容灾组内实例的配额数。 - CvmInRackGroupQuota *int64 `json:"CvmInRackGroupQuota,omitempty" name:"CvmInRackGroupQuota"` -} - -type EnhancedService struct { - // 开启云安全服务。若不指定该参数,则默认开启云安全服务。 - SecurityService *RunSecurityServiceEnabled `json:"SecurityService,omitempty" name:"SecurityService"` - - // 开启云监控服务。若不指定该参数,则默认开启云监控服务。 - MonitorService *RunMonitorServiceEnabled `json:"MonitorService,omitempty" name:"MonitorService"` - - // 开启云自动化助手服务(TencentCloud Automation Tools,TAT)。若不指定该参数,则公共镜像默认开启云自动化助手服务,其他镜像默认不开启云自动化助手服务。 - AutomationService *RunAutomationServiceEnabled `json:"AutomationService,omitempty" name:"AutomationService"` -} - -// Predefined struct for user -type ExportImagesRequestParams struct { - // COS存储桶名称 - BucketName *string `json:"BucketName,omitempty" name:"BucketName"` - - // 镜像ID列表 - ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds"` - - // 镜像文件导出格式。取值范围:RAW,QCOW2,VHD,VMDK。默认为RAW - ExportFormat *string `json:"ExportFormat,omitempty" name:"ExportFormat"` - - // 导出文件的名称前缀列表 - FileNamePrefixList []*string `json:"FileNamePrefixList,omitempty" name:"FileNamePrefixList"` - - // 是否只导出系统盘 - OnlyExportRootDisk *bool `json:"OnlyExportRootDisk,omitempty" name:"OnlyExportRootDisk"` - - // 检测镜像是否支持导出 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 角色名称。默认为CVM_QcsRole,发起请求前请确认是否存在该角色,以及是否已正确配置COS写入权限。 - RoleName *string `json:"RoleName,omitempty" name:"RoleName"` -} - -type ExportImagesRequest struct { - *tchttp.BaseRequest - - // COS存储桶名称 - BucketName *string `json:"BucketName,omitempty" name:"BucketName"` - - // 镜像ID列表 - ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds"` - - // 镜像文件导出格式。取值范围:RAW,QCOW2,VHD,VMDK。默认为RAW - ExportFormat *string `json:"ExportFormat,omitempty" name:"ExportFormat"` - - // 导出文件的名称前缀列表 - FileNamePrefixList []*string `json:"FileNamePrefixList,omitempty" name:"FileNamePrefixList"` - - // 是否只导出系统盘 - OnlyExportRootDisk *bool `json:"OnlyExportRootDisk,omitempty" name:"OnlyExportRootDisk"` - - // 检测镜像是否支持导出 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 角色名称。默认为CVM_QcsRole,发起请求前请确认是否存在该角色,以及是否已正确配置COS写入权限。 - RoleName *string `json:"RoleName,omitempty" name:"RoleName"` -} - -func (r *ExportImagesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ExportImagesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "BucketName") - delete(f, "ImageIds") - delete(f, "ExportFormat") - delete(f, "FileNamePrefixList") - delete(f, "OnlyExportRootDisk") - delete(f, "DryRun") - delete(f, "RoleName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ExportImagesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ExportImagesResponseParams struct { - // 导出镜像任务ID - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 导出镜像的COS文件名列表 - CosPaths []*string `json:"CosPaths,omitempty" name:"CosPaths"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ExportImagesResponse struct { - *tchttp.BaseResponse - Response *ExportImagesResponseParams `json:"Response"` -} - -func (r *ExportImagesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ExportImagesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type Externals struct { - // 释放地址 - // 注意:此字段可能返回 null,表示取不到有效值。 - ReleaseAddress *bool `json:"ReleaseAddress,omitempty" name:"ReleaseAddress"` - - // 不支持的网络类型,取值范围:
  • BASIC:基础网络
  • VPC1.0:私有网络VPC1.0 - // 注意:此字段可能返回 null,表示取不到有效值。 - UnsupportNetworks []*string `json:"UnsupportNetworks,omitempty" name:"UnsupportNetworks"` - - // HDD本地存储属性 - // 注意:此字段可能返回 null,表示取不到有效值。 - StorageBlockAttr *StorageBlock `json:"StorageBlockAttr,omitempty" name:"StorageBlockAttr"` -} - -type Filter struct { - // 需要过滤的字段。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 字段的过滤值。 - Values []*string `json:"Values,omitempty" name:"Values"` -} - -type GPUInfo struct { - // 实例GPU个数。值小于1代表VGPU类型,大于1代表GPU直通类型。 - // 注意:此字段可能返回 null,表示取不到有效值。 - GPUCount *float64 `json:"GPUCount,omitempty" name:"GPUCount"` - - // 实例GPU地址。 - // 注意:此字段可能返回 null,表示取不到有效值。 - GPUId []*string `json:"GPUId,omitempty" name:"GPUId"` - - // 实例GPU类型。 - // 注意:此字段可能返回 null,表示取不到有效值。 - GPUType *string `json:"GPUType,omitempty" name:"GPUType"` -} - -type HostItem struct { - // 专用宿主机实例所在的位置。通过该参数可以指定实例所属可用区,所属项目等属性。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 专用宿主机实例ID - HostId *string `json:"HostId,omitempty" name:"HostId"` - - // 专用宿主机实例类型 - HostType *string `json:"HostType,omitempty" name:"HostType"` - - // 专用宿主机实例名称 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 专用宿主机实例付费模式 - HostChargeType *string `json:"HostChargeType,omitempty" name:"HostChargeType"` - - // 专用宿主机实例自动续费标记 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` - - // 专用宿主机实例创建时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 专用宿主机实例过期时间 - ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` - - // 专用宿主机实例上已创建云子机的实例id列表 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 专用宿主机实例状态 - HostState *string `json:"HostState,omitempty" name:"HostState"` - - // 专用宿主机实例IP - HostIp *string `json:"HostIp,omitempty" name:"HostIp"` - - // 专用宿主机实例资源信息 - HostResource *HostResource `json:"HostResource,omitempty" name:"HostResource"` - - // 专用宿主机所属的围笼ID。该字段仅对金融专区围笼内的专用宿主机有效。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CageId *string `json:"CageId,omitempty" name:"CageId"` -} - -type HostPriceInfo struct { - // 描述了cdh实例相关的价格信息 - HostPrice *ItemPrice `json:"HostPrice,omitempty" name:"HostPrice"` -} - -type HostResource struct { - // 专用宿主机实例总CPU核数 - CpuTotal *uint64 `json:"CpuTotal,omitempty" name:"CpuTotal"` - - // 专用宿主机实例可用CPU核数 - CpuAvailable *uint64 `json:"CpuAvailable,omitempty" name:"CpuAvailable"` - - // 专用宿主机实例总内存大小(单位为:GiB) - MemTotal *float64 `json:"MemTotal,omitempty" name:"MemTotal"` - - // 专用宿主机实例可用内存大小(单位为:GiB) - MemAvailable *float64 `json:"MemAvailable,omitempty" name:"MemAvailable"` - - // 专用宿主机实例总磁盘大小(单位为:GiB) - DiskTotal *uint64 `json:"DiskTotal,omitempty" name:"DiskTotal"` - - // 专用宿主机实例可用磁盘大小(单位为:GiB) - DiskAvailable *uint64 `json:"DiskAvailable,omitempty" name:"DiskAvailable"` - - // 专用宿主机实例磁盘类型 - DiskType *string `json:"DiskType,omitempty" name:"DiskType"` - - // 专用宿主机实例总GPU卡数 - GpuTotal *uint64 `json:"GpuTotal,omitempty" name:"GpuTotal"` - - // 专用宿主机实例可用GPU卡数 - GpuAvailable *uint64 `json:"GpuAvailable,omitempty" name:"GpuAvailable"` -} - -type HpcClusterInfo struct { - // 高性能计算集群ID - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 高性能计算集群名 - // 注意:此字段可能返回 null,表示取不到有效值。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 高性能计算集群备注 - // 注意:此字段可能返回 null,表示取不到有效值。 - Remark *string `json:"Remark,omitempty" name:"Remark"` - - // 集群下设备容量 - CvmQuotaTotal *uint64 `json:"CvmQuotaTotal,omitempty" name:"CvmQuotaTotal"` - - // 集群所在可用区 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 集群当前已有设备量 - CurrentNum *uint64 `json:"CurrentNum,omitempty" name:"CurrentNum"` - - // 集群创建时间 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 集群内实例ID列表 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type Image struct { - // 镜像ID - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 镜像操作系统 - OsName *string `json:"OsName,omitempty" name:"OsName"` - - // 镜像类型 - ImageType *string `json:"ImageType,omitempty" name:"ImageType"` - - // 镜像创建时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 镜像名称 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 镜像描述 - ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` - - // 镜像大小 - ImageSize *int64 `json:"ImageSize,omitempty" name:"ImageSize"` - - // 镜像架构 - Architecture *string `json:"Architecture,omitempty" name:"Architecture"` - - // 镜像状态: - // CREATING-创建中 - // NORMAL-正常 - // CREATEFAILED-创建失败 - // USING-使用中 - // SYNCING-同步中 - // IMPORTING-导入中 - // IMPORTFAILED-导入失败 - ImageState *string `json:"ImageState,omitempty" name:"ImageState"` - - // 镜像来源平台,包括如TencentOS、 CentOS、 Windows、 Ubuntu、 Debian、Fedora等。 - Platform *string `json:"Platform,omitempty" name:"Platform"` - - // 镜像创建者 - ImageCreator *string `json:"ImageCreator,omitempty" name:"ImageCreator"` - - // 镜像来源 - ImageSource *string `json:"ImageSource,omitempty" name:"ImageSource"` - - // 同步百分比 - // 注意:此字段可能返回 null,表示取不到有效值。 - SyncPercent *int64 `json:"SyncPercent,omitempty" name:"SyncPercent"` - - // 镜像是否支持cloud-init - // 注意:此字段可能返回 null,表示取不到有效值。 - IsSupportCloudinit *bool `json:"IsSupportCloudinit,omitempty" name:"IsSupportCloudinit"` - - // 镜像关联的快照信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - SnapshotSet []*Snapshot `json:"SnapshotSet,omitempty" name:"SnapshotSet"` - - // 镜像关联的标签列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 镜像许可类型 - LicenseType *string `json:"LicenseType,omitempty" name:"LicenseType"` -} - -type ImageOsList struct { - // 支持的Windows操作系统。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Windows []*string `json:"Windows,omitempty" name:"Windows"` - - // 支持的Linux操作系统 - // 注意:此字段可能返回 null,表示取不到有效值。 - Linux []*string `json:"Linux,omitempty" name:"Linux"` -} - -type ImageQuota struct { - // 已使用配额 - UsedQuota *uint64 `json:"UsedQuota,omitempty" name:"UsedQuota"` - - // 总配额 - TotalQuota *uint64 `json:"TotalQuota,omitempty" name:"TotalQuota"` -} - -// Predefined struct for user -type ImportImageRequestParams struct { - // 导入镜像的操作系统架构,`x86_64` 或 `i386` - Architecture *string `json:"Architecture,omitempty" name:"Architecture"` - - // 导入镜像的操作系统类型,通过`DescribeImportImageOs`获取 - OsType *string `json:"OsType,omitempty" name:"OsType"` - - // 导入镜像的操作系统版本,通过`DescribeImportImageOs`获取 - OsVersion *string `json:"OsVersion,omitempty" name:"OsVersion"` - - // 导入镜像存放的cos地址 - ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"` - - // 镜像名称 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 镜像描述 - ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` - - // 只检查参数,不执行任务 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 是否强制导入,参考[强制导入镜像](https://cloud.tencent.com/document/product/213/12849) - Force *bool `json:"Force,omitempty" name:"Force"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到自定义镜像。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 导入镜像后,激活操作系统采用的许可证类型。 - // 可选项: - // TencentCloud: 腾讯云官方许可 - // BYOL: 自带许可(Bring Your Own License) - LicenseType *string `json:"LicenseType,omitempty" name:"LicenseType"` - - // 启动模式 - BootMode *string `json:"BootMode,omitempty" name:"BootMode"` -} - -type ImportImageRequest struct { - *tchttp.BaseRequest - - // 导入镜像的操作系统架构,`x86_64` 或 `i386` - Architecture *string `json:"Architecture,omitempty" name:"Architecture"` - - // 导入镜像的操作系统类型,通过`DescribeImportImageOs`获取 - OsType *string `json:"OsType,omitempty" name:"OsType"` - - // 导入镜像的操作系统版本,通过`DescribeImportImageOs`获取 - OsVersion *string `json:"OsVersion,omitempty" name:"OsVersion"` - - // 导入镜像存放的cos地址 - ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"` - - // 镜像名称 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 镜像描述 - ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` - - // 只检查参数,不执行任务 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 是否强制导入,参考[强制导入镜像](https://cloud.tencent.com/document/product/213/12849) - Force *bool `json:"Force,omitempty" name:"Force"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到自定义镜像。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 导入镜像后,激活操作系统采用的许可证类型。 - // 可选项: - // TencentCloud: 腾讯云官方许可 - // BYOL: 自带许可(Bring Your Own License) - LicenseType *string `json:"LicenseType,omitempty" name:"LicenseType"` - - // 启动模式 - BootMode *string `json:"BootMode,omitempty" name:"BootMode"` -} - -func (r *ImportImageRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ImportImageRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Architecture") - delete(f, "OsType") - delete(f, "OsVersion") - delete(f, "ImageUrl") - delete(f, "ImageName") - delete(f, "ImageDescription") - delete(f, "DryRun") - delete(f, "Force") - delete(f, "TagSpecification") - delete(f, "LicenseType") - delete(f, "BootMode") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ImportImageRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ImportImageResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ImportImageResponse struct { - *tchttp.BaseResponse - Response *ImportImageResponseParams `json:"Response"` -} - -func (r *ImportImageResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ImportImageResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ImportKeyPairRequestParams struct { - // 密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 - KeyName *string `json:"KeyName,omitempty" name:"KeyName"` - - // 密钥对创建后所属的[项目](https://cloud.tencent.com/document/product/378/10861)ID。

    可以通过以下方式获取项目ID:
  • 通过[项目列表](https://console.cloud.tencent.com/project)查询项目ID。
  • 通过调用接口 [DescribeProject](https://cloud.tencent.com/document/api/378/4400),取返回信息中的 `projectId ` 获取项目ID。 - // - // 如果是默认项目,直接填0就可以。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 密钥对的公钥内容,`OpenSSH RSA` 格式。 - PublicKey *string `json:"PublicKey,omitempty" name:"PublicKey"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到密钥对。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` -} - -type ImportKeyPairRequest struct { - *tchttp.BaseRequest - - // 密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 - KeyName *string `json:"KeyName,omitempty" name:"KeyName"` - - // 密钥对创建后所属的[项目](https://cloud.tencent.com/document/product/378/10861)ID。

    可以通过以下方式获取项目ID:
  • 通过[项目列表](https://console.cloud.tencent.com/project)查询项目ID。
  • 通过调用接口 [DescribeProject](https://cloud.tencent.com/document/api/378/4400),取返回信息中的 `projectId ` 获取项目ID。 - // - // 如果是默认项目,直接填0就可以。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 密钥对的公钥内容,`OpenSSH RSA` 格式。 - PublicKey *string `json:"PublicKey,omitempty" name:"PublicKey"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到密钥对。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` -} - -func (r *ImportKeyPairRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ImportKeyPairRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "KeyName") - delete(f, "ProjectId") - delete(f, "PublicKey") - delete(f, "TagSpecification") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ImportKeyPairRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ImportKeyPairResponseParams struct { - // 密钥对ID。 - KeyId *string `json:"KeyId,omitempty" name:"KeyId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ImportKeyPairResponse struct { - *tchttp.BaseResponse - Response *ImportKeyPairResponseParams `json:"Response"` -} - -func (r *ImportKeyPairResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ImportKeyPairResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquirePricePurchaseReservedInstancesOfferingRequestParams struct { - // 购买预留实例计费数量 - InstanceCount *uint64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 预留实例计费配置ID - ReservedInstancesOfferingId *string `json:"ReservedInstancesOfferingId,omitempty" name:"ReservedInstancesOfferingId"` - - // 试运行 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。
    更多详细信息请参阅:如何保证幂等性 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 预留实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 最多支持60个字符(包含模式串)。
  • - ReservedInstanceName *string `json:"ReservedInstanceName,omitempty" name:"ReservedInstanceName"` -} - -type InquirePricePurchaseReservedInstancesOfferingRequest struct { - *tchttp.BaseRequest - - // 购买预留实例计费数量 - InstanceCount *uint64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 预留实例计费配置ID - ReservedInstancesOfferingId *string `json:"ReservedInstancesOfferingId,omitempty" name:"ReservedInstancesOfferingId"` - - // 试运行 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。
    更多详细信息请参阅:如何保证幂等性 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 预留实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 最多支持60个字符(包含模式串)。
  • - ReservedInstanceName *string `json:"ReservedInstanceName,omitempty" name:"ReservedInstanceName"` -} - -func (r *InquirePricePurchaseReservedInstancesOfferingRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquirePricePurchaseReservedInstancesOfferingRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceCount") - delete(f, "ReservedInstancesOfferingId") - delete(f, "DryRun") - delete(f, "ClientToken") - delete(f, "ReservedInstanceName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquirePricePurchaseReservedInstancesOfferingRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquirePricePurchaseReservedInstancesOfferingResponseParams struct { - // 该参数表示对应配置预留实例的价格。 - Price *ReservedInstancePrice `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquirePricePurchaseReservedInstancesOfferingResponse struct { - *tchttp.BaseResponse - Response *InquirePricePurchaseReservedInstancesOfferingResponseParams `json:"Response"` -} - -func (r *InquirePricePurchaseReservedInstancesOfferingResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquirePricePurchaseReservedInstancesOfferingResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceModifyInstancesChargeTypeRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月。
  • POSTPAID_BY_HOUR:后付费,即按量付费。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 是否同时切换弹性数据云盘计费模式。取值范围:
  • TRUE:表示切换弹性数据云盘计费模式
  • FALSE:表示不切换弹性数据云盘计费模式

    默认取值:FALSE。 - ModifyPortableDataDisk *bool `json:"ModifyPortableDataDisk,omitempty" name:"ModifyPortableDataDisk"` -} - -type InquiryPriceModifyInstancesChargeTypeRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月。
  • POSTPAID_BY_HOUR:后付费,即按量付费。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 是否同时切换弹性数据云盘计费模式。取值范围:
  • TRUE:表示切换弹性数据云盘计费模式
  • FALSE:表示不切换弹性数据云盘计费模式

    默认取值:FALSE。 - ModifyPortableDataDisk *bool `json:"ModifyPortableDataDisk,omitempty" name:"ModifyPortableDataDisk"` -} - -func (r *InquiryPriceModifyInstancesChargeTypeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceModifyInstancesChargeTypeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "ModifyPortableDataDisk") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceModifyInstancesChargeTypeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceModifyInstancesChargeTypeResponseParams struct { - // 该参数表示对应配置实例转换计费模式的价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceModifyInstancesChargeTypeResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceModifyInstancesChargeTypeResponseParams `json:"Response"` -} - -func (r *InquiryPriceModifyInstancesChargeTypeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceModifyInstancesChargeTypeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceRenewHostsRequestParams struct { - // 一个或多个待操作的`CDH`实例`ID`。可通过[`DescribeHosts`](https://cloud.tencent.com/document/api/213/16474)接口返回值中的`HostId`获取。每次请求批量实例的上限为100。 - HostIds []*string `json:"HostIds,omitempty" name:"HostIds"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。 - HostChargePrepaid *ChargePrepaid `json:"HostChargePrepaid,omitempty" name:"HostChargePrepaid"` - - // 试运行,测试使用,不执行具体逻辑。取值范围:
  • TRUE:跳过执行逻辑
  • FALSE:执行逻辑

    默认取值:FALSE。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` -} - -type InquiryPriceRenewHostsRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的`CDH`实例`ID`。可通过[`DescribeHosts`](https://cloud.tencent.com/document/api/213/16474)接口返回值中的`HostId`获取。每次请求批量实例的上限为100。 - HostIds []*string `json:"HostIds,omitempty" name:"HostIds"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。 - HostChargePrepaid *ChargePrepaid `json:"HostChargePrepaid,omitempty" name:"HostChargePrepaid"` - - // 试运行,测试使用,不执行具体逻辑。取值范围:
  • TRUE:跳过执行逻辑
  • FALSE:执行逻辑

    默认取值:FALSE。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` -} - -func (r *InquiryPriceRenewHostsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceRenewHostsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HostIds") - delete(f, "HostChargePrepaid") - delete(f, "DryRun") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceRenewHostsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceRenewHostsResponseParams struct { - // CDH实例续费价格信息 - Price *HostPriceInfo `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceRenewHostsResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceRenewHostsResponseParams `json:"Response"` -} - -func (r *InquiryPriceRenewHostsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceRenewHostsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceRenewInstancesRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 试运行,测试使用,不执行具体逻辑。取值范围:
  • TRUE:跳过执行逻辑
  • FALSE:执行逻辑

    默认取值:FALSE。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 是否续费弹性数据盘。取值范围:
  • TRUE:表示续费包年包月实例同时续费其挂载的弹性数据盘
  • FALSE:表示续费包年包月实例同时不再续费其挂载的弹性数据盘

    默认取值:TRUE。 - RenewPortableDataDisk *bool `json:"RenewPortableDataDisk,omitempty" name:"RenewPortableDataDisk"` -} - -type InquiryPriceRenewInstancesRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 试运行,测试使用,不执行具体逻辑。取值范围:
  • TRUE:跳过执行逻辑
  • FALSE:执行逻辑

    默认取值:FALSE。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 是否续费弹性数据盘。取值范围:
  • TRUE:表示续费包年包月实例同时续费其挂载的弹性数据盘
  • FALSE:表示续费包年包月实例同时不再续费其挂载的弹性数据盘

    默认取值:TRUE。 - RenewPortableDataDisk *bool `json:"RenewPortableDataDisk,omitempty" name:"RenewPortableDataDisk"` -} - -func (r *InquiryPriceRenewInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceRenewInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InstanceChargePrepaid") - delete(f, "DryRun") - delete(f, "RenewPortableDataDisk") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceRenewInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceRenewInstancesResponseParams struct { - // 该参数表示对应配置实例的价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceRenewInstancesResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceRenewInstancesResponseParams `json:"Response"` -} - -func (r *InquiryPriceRenewInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceRenewInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResetInstanceRequestParams struct { - // 实例ID。可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 指定有效的[镜像](/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例系统盘配置信息。系统盘为云盘的实例可以通过该参数指定重装后的系统盘大小来实现对系统盘的扩容操作,若不指定则默认系统盘大小保持不变。系统盘大小只支持扩容不支持缩容;重装只支持修改系统盘的大小,不能修改系统盘的类型。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` -} - -type InquiryPriceResetInstanceRequest struct { - *tchttp.BaseRequest - - // 实例ID。可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 指定有效的[镜像](/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例系统盘配置信息。系统盘为云盘的实例可以通过该参数指定重装后的系统盘大小来实现对系统盘的扩容操作,若不指定则默认系统盘大小保持不变。系统盘大小只支持扩容不支持缩容;重装只支持修改系统盘的大小,不能修改系统盘的类型。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` -} - -func (r *InquiryPriceResetInstanceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResetInstanceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - delete(f, "ImageId") - delete(f, "SystemDisk") - delete(f, "LoginSettings") - delete(f, "EnhancedService") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceResetInstanceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResetInstanceResponseParams struct { - // 该参数表示重装成对应配置实例的价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceResetInstanceResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceResetInstanceResponseParams `json:"Response"` -} - -func (r *InquiryPriceResetInstanceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResetInstanceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResetInstancesInternetMaxBandwidthRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。当调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽时,只支持一个实例。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 公网出带宽配置。不同机型带宽上限范围不一致,具体限制详见带宽限制对账表。暂时只支持`InternetMaxBandwidthOut`参数。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 带宽生效的起始时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。起始时间不能早于当前时间。如果起始时间是今天则新设置的带宽立即生效。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 带宽生效的终止时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。新设置的带宽的有效期包含终止时间此日期。终止时间不能晚于包年包月实例的到期时间。实例的到期时间可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`ExpiredTime`获取。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -type InquiryPriceResetInstancesInternetMaxBandwidthRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。当调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽时,只支持一个实例。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 公网出带宽配置。不同机型带宽上限范围不一致,具体限制详见带宽限制对账表。暂时只支持`InternetMaxBandwidthOut`参数。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 带宽生效的起始时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。起始时间不能早于当前时间。如果起始时间是今天则新设置的带宽立即生效。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 带宽生效的终止时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。新设置的带宽的有效期包含终止时间此日期。终止时间不能晚于包年包月实例的到期时间。实例的到期时间可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`ExpiredTime`获取。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -func (r *InquiryPriceResetInstancesInternetMaxBandwidthRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResetInstancesInternetMaxBandwidthRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InternetAccessible") - delete(f, "StartTime") - delete(f, "EndTime") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceResetInstancesInternetMaxBandwidthRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResetInstancesInternetMaxBandwidthResponseParams struct { - // 该参数表示带宽调整为对应大小之后的价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceResetInstancesInternetMaxBandwidthResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceResetInstancesInternetMaxBandwidthResponseParams `json:"Response"` -} - -func (r *InquiryPriceResetInstancesInternetMaxBandwidthResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResetInstancesInternetMaxBandwidthResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResetInstancesTypeRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。本接口每次请求批量实例的上限为1。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例机型。不同实例机型指定了不同的资源规格,具体取值可参见附表[实例资源规格](https://cloud.tencent.com/document/product/213/11518)对照表,也可以调用查询[实例资源规格列表](https://cloud.tencent.com/document/product/213/15749)接口获得最新的规格表。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` -} - -type InquiryPriceResetInstancesTypeRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。本接口每次请求批量实例的上限为1。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例机型。不同实例机型指定了不同的资源规格,具体取值可参见附表[实例资源规格](https://cloud.tencent.com/document/product/213/11518)对照表,也可以调用查询[实例资源规格列表](https://cloud.tencent.com/document/product/213/15749)接口获得最新的规格表。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` -} - -func (r *InquiryPriceResetInstancesTypeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResetInstancesTypeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InstanceType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceResetInstancesTypeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResetInstancesTypeResponseParams struct { - // 该参数表示调整成对应机型实例的价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceResetInstancesTypeResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceResetInstancesTypeResponseParams `json:"Response"` -} - -func (r *InquiryPriceResetInstancesTypeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResetInstancesTypeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResizeInstanceDisksRequestParams struct { - // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 待扩容的数据盘配置信息。只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](https://cloud.tencent.com/document/product/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。数据盘容量单位:GB。最小扩容步长:10G。关于数据盘类型的选择请参考硬盘产品简介。可选数据盘类型受到实例类型`InstanceType`限制。另外允许扩容的最大容量也因数据盘类型的不同而有所差异。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机
  • FALSE:表示在正常关机失败后不进行强制关机

    默认取值:FALSE。

    强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -type InquiryPriceResizeInstanceDisksRequest struct { - *tchttp.BaseRequest - - // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 待扩容的数据盘配置信息。只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](https://cloud.tencent.com/document/product/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。数据盘容量单位:GB。最小扩容步长:10G。关于数据盘类型的选择请参考硬盘产品简介。可选数据盘类型受到实例类型`InstanceType`限制。另外允许扩容的最大容量也因数据盘类型的不同而有所差异。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机
  • FALSE:表示在正常关机失败后不进行强制关机

    默认取值:FALSE。

    强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -func (r *InquiryPriceResizeInstanceDisksRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResizeInstanceDisksRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - delete(f, "DataDisks") - delete(f, "ForceStop") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceResizeInstanceDisksRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResizeInstanceDisksResponseParams struct { - // 该参数表示磁盘扩容成对应配置的价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceResizeInstanceDisksResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceResizeInstanceDisksResponseParams `json:"Response"` -} - -func (r *InquiryPriceResizeInstanceDisksResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResizeInstanceDisksResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceRunInstancesRequestParams struct { - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目等属性。 - // 注:如果您不指定LaunchTemplate参数,则Placement为必选参数。若同时传递Placement和LaunchTemplate,则默认覆盖LaunchTemplate中对应的Placement的值。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - // 注:如果您不指定LaunchTemplate参数,则ImageId为必选参数。若同时传递ImageId和LaunchTemplate,则默认覆盖LaunchTemplate中对应的ImageId的值。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • SPOTPAID:竞价付费
    默认值:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例机型。不同实例机型指定了不同的资源规格,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则默认机型为S1.SMALL1。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若不指定该参数,则默认使用基础网络。若在此参数中指定了私有网络IP,那么InstanceCount参数只能为1。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 购买实例数量。取值范围:[1,100]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。
  • 购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。
  • 最多支持60个字符(包含模式串)。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则默认不绑定安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。
    更多详细信息请参阅:如何保证幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 云服务器的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:主机名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:主机名字符长度为[2, 30],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例,当前仅支持绑定标签到云服务器实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例的市场相关选项,如竞价实例相关参数 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 高性能计算集群ID。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` -} - -type InquiryPriceRunInstancesRequest struct { - *tchttp.BaseRequest - - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目等属性。 - // 注:如果您不指定LaunchTemplate参数,则Placement为必选参数。若同时传递Placement和LaunchTemplate,则默认覆盖LaunchTemplate中对应的Placement的值。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - // 注:如果您不指定LaunchTemplate参数,则ImageId为必选参数。若同时传递ImageId和LaunchTemplate,则默认覆盖LaunchTemplate中对应的ImageId的值。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • SPOTPAID:竞价付费
    默认值:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例机型。不同实例机型指定了不同的资源规格,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则默认机型为S1.SMALL1。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若不指定该参数,则默认使用基础网络。若在此参数中指定了私有网络IP,那么InstanceCount参数只能为1。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 购买实例数量。取值范围:[1,100]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。
  • 购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。
  • 最多支持60个字符(包含模式串)。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则默认不绑定安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。
    更多详细信息请参阅:如何保证幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 云服务器的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:主机名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:主机名字符长度为[2, 30],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例,当前仅支持绑定标签到云服务器实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例的市场相关选项,如竞价实例相关参数 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 高性能计算集群ID。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` -} - -func (r *InquiryPriceRunInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceRunInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Placement") - delete(f, "ImageId") - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "InstanceType") - delete(f, "SystemDisk") - delete(f, "DataDisks") - delete(f, "VirtualPrivateCloud") - delete(f, "InternetAccessible") - delete(f, "InstanceCount") - delete(f, "InstanceName") - delete(f, "LoginSettings") - delete(f, "SecurityGroupIds") - delete(f, "EnhancedService") - delete(f, "ClientToken") - delete(f, "HostName") - delete(f, "TagSpecification") - delete(f, "InstanceMarketOptions") - delete(f, "HpcClusterId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceRunInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceRunInstancesResponseParams struct { - // 该参数表示对应配置实例的价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceRunInstancesResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceRunInstancesResponseParams `json:"Response"` -} - -func (r *InquiryPriceRunInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceRunInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceTerminateInstancesRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type InquiryPriceTerminateInstancesRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *InquiryPriceTerminateInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceTerminateInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceTerminateInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceTerminateInstancesResponseParams struct { - // 退款详情。 - InstanceRefundsSet []*InstanceRefund `json:"InstanceRefundsSet,omitempty" name:"InstanceRefundsSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceTerminateInstancesResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceTerminateInstancesResponseParams `json:"Response"` -} - -func (r *InquiryPriceTerminateInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceTerminateInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type Instance struct { - // 实例所在的位置。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 实例`ID`。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例机型。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例的CPU核数,单位:核。 - CPU *int64 `json:"CPU,omitempty" name:"CPU"` - - // 实例内存容量,单位:`GB`。 - Memory *int64 `json:"Memory,omitempty" name:"Memory"` - - // 实例业务状态。取值范围:
  • NORMAL:表示正常状态的实例
  • EXPIRED:表示过期的实例
  • PROTECTIVELY_ISOLATED:表示被安全隔离的实例。 - RestrictState *string `json:"RestrictState,omitempty" name:"RestrictState"` - - // 实例名称。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例计费模式。取值范围:
  • `PREPAID`:表示预付费,即包年包月
  • `POSTPAID_BY_HOUR`:表示后付费,即按量计费
  • `CDHPAID`:`专用宿主机`付费,即只对`专用宿主机`计费,不对`专用宿主机`上的实例计费。
  • `SPOTPAID`:表示竞价实例付费。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 实例系统盘信息。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘信息。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 实例主网卡的内网`IP`列表。 - PrivateIpAddresses []*string `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 实例主网卡的公网`IP`列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses"` - - // 实例带宽信息。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 实例所属虚拟私有网络信息。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 生产实例所使用的镜像`ID`。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 自动续费标识。取值范围:
  • `NOTIFY_AND_MANUAL_RENEW`:表示通知即将过期,但不自动续费
  • `NOTIFY_AND_AUTO_RENEW`:表示通知即将过期,而且自动续费
  • `DISABLE_NOTIFY_AND_MANUAL_RENEW`:表示不通知即将过期,也不自动续费。 - //
  • 注意:后付费模式本项为null - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` - - // 创建时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 到期时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。注意:后付费模式本项为null - ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` - - // 操作系统名称。 - OsName *string `json:"OsName,omitempty" name:"OsName"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 实例登录设置。目前只返回实例所关联的密钥。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例状态。取值范围:
  • PENDING:表示创建中
  • LAUNCH_FAILED:表示创建失败
  • RUNNING:表示运行中
  • STOPPED:表示关机
  • STARTING:表示开机中
  • STOPPING:表示关机中
  • REBOOTING:表示重启中
  • SHUTDOWN:表示停止待销毁
  • TERMINATING:表示销毁中。
  • - InstanceState *string `json:"InstanceState,omitempty" name:"InstanceState"` - - // 实例关联的标签列表。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 实例的关机计费模式。 - // 取值范围:
  • KEEP_CHARGING:关机继续收费
  • STOP_CHARGING:关机停止收费
  • NOT_APPLICABLE:实例处于非关机状态或者不适用关机停止计费的条件
    - StopChargingMode *string `json:"StopChargingMode,omitempty" name:"StopChargingMode"` - - // 实例全局唯一ID - Uuid *string `json:"Uuid,omitempty" name:"Uuid"` - - // 实例的最新操作。例:StopInstances、ResetInstance。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LatestOperation *string `json:"LatestOperation,omitempty" name:"LatestOperation"` - - // 实例的最新操作状态。取值范围:
  • SUCCESS:表示操作成功
  • OPERATING:表示操作执行中
  • FAILED:表示操作失败 - // 注意:此字段可能返回 null,表示取不到有效值。 - LatestOperationState *string `json:"LatestOperationState,omitempty" name:"LatestOperationState"` - - // 实例最新操作的唯一请求 ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LatestOperationRequestId *string `json:"LatestOperationRequestId,omitempty" name:"LatestOperationRequestId"` - - // 分散置放群组ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` - - // 实例的IPv6地址。 - // 注意:此字段可能返回 null,表示取不到有效值。 - IPv6Addresses []*string `json:"IPv6Addresses,omitempty" name:"IPv6Addresses"` - - // CAM角色名。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群`ID`。 - // 注意:此字段可能返回 null,表示取不到有效值。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 高性能计算集群`IP`列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RdmaIpAddresses []*string `json:"RdmaIpAddresses,omitempty" name:"RdmaIpAddresses"` - - // 实例所在的专用集群`ID`。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DedicatedClusterId *string `json:"DedicatedClusterId,omitempty" name:"DedicatedClusterId"` - - // 实例隔离类型。取值范围:
  • ARREAR:表示欠费隔离
  • EXPIRE:表示到期隔离
  • MANMADE:表示主动退还隔离
  • NOTISOLATED:表示未隔离
  • - // 注意:此字段可能返回 null,表示取不到有效值。 - IsolatedSource *string `json:"IsolatedSource,omitempty" name:"IsolatedSource"` - - // GPU信息。如果是gpu类型子机,该值会返回GPU信息,如果是其他类型子机则不返回。 - // 注意:此字段可能返回 null,表示取不到有效值。 - GPUInfo *GPUInfo `json:"GPUInfo,omitempty" name:"GPUInfo"` - - // 实例的操作系统许可类型,默认为TencentCloud - LicenseType *string `json:"LicenseType,omitempty" name:"LicenseType"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` - - // 默认登录用户。 - DefaultLoginUser *string `json:"DefaultLoginUser,omitempty" name:"DefaultLoginUser"` - - // 默认登录端口。 - DefaultLoginPort *int64 `json:"DefaultLoginPort,omitempty" name:"DefaultLoginPort"` - - // 实例的最新操作错误信息。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LatestOperationErrorMsg *string `json:"LatestOperationErrorMsg,omitempty" name:"LatestOperationErrorMsg"` -} - -type InstanceChargePrepaid struct { - // 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36, 48, 60。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Period *int64 `json:"Period,omitempty" name:"Period"` - - // 自动续费标识。取值范围:
  • NOTIFY_AND_AUTO_RENEW:通知过期且自动续费
  • NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费
  • DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费

    默认取值:NOTIFY_AND_MANUAL_RENEW。若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` -} - -type InstanceFamilyConfig struct { - // 机型族名称的中文全称。 - InstanceFamilyName *string `json:"InstanceFamilyName,omitempty" name:"InstanceFamilyName"` - - // 机型族名称的英文简称。 - InstanceFamily *string `json:"InstanceFamily,omitempty" name:"InstanceFamily"` -} - -type InstanceMarketOptionsRequest struct { - // 竞价相关选项 - // 注意:此字段可能返回 null,表示取不到有效值。 - SpotOptions *SpotMarketOptions `json:"SpotOptions,omitempty" name:"SpotOptions"` - - // 市场选项类型,当前只支持取值:spot - // 注意:此字段可能返回 null,表示取不到有效值。 - MarketType *string `json:"MarketType,omitempty" name:"MarketType"` -} - -type InstanceRefund struct { - // 实例Id。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 退款数额。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Refunds *float64 `json:"Refunds,omitempty" name:"Refunds"` - - // 退款详情。 - // 注意:此字段可能返回 null,表示取不到有效值。 - PriceDetail *string `json:"PriceDetail,omitempty" name:"PriceDetail"` -} - -type InstanceStatus struct { - // 实例`ID`。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例状态。取值范围:
  • PENDING:表示创建中
  • LAUNCH_FAILED:表示创建失败
  • RUNNING:表示运行中
  • STOPPED:表示关机
  • STARTING:表示开机中
  • STOPPING:表示关机中
  • REBOOTING:表示重启中
  • SHUTDOWN:表示停止待销毁
  • TERMINATING:表示销毁中。
  • - InstanceState *string `json:"InstanceState,omitempty" name:"InstanceState"` -} - -type InstanceTypeConfig struct { - // 可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 实例机型。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例机型系列。 - InstanceFamily *string `json:"InstanceFamily,omitempty" name:"InstanceFamily"` - - // GPU核数,单位:核。 - GPU *int64 `json:"GPU,omitempty" name:"GPU"` - - // CPU核数,单位:核。 - CPU *int64 `json:"CPU,omitempty" name:"CPU"` - - // 内存容量,单位:`GB`。 - Memory *int64 `json:"Memory,omitempty" name:"Memory"` - - // FPGA核数,单位:核。 - FPGA *int64 `json:"FPGA,omitempty" name:"FPGA"` - - // 实例机型映射的物理GPU卡数,单位:卡。vGPU卡型小于1,直通卡型大于等于1。vGPU是通过分片虚拟化技术,将物理GPU卡重新划分,同一块GPU卡经虚拟化分割后可分配至不同的实例使用。直通卡型会将GPU设备直接挂载给实例使用。 - GpuCount *float64 `json:"GpuCount,omitempty" name:"GpuCount"` -} - -type InstanceTypeConfigStatus struct { - // 状态描述 - Status *string `json:"Status,omitempty" name:"Status"` - - // 状态描述信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - Message *string `json:"Message,omitempty" name:"Message"` - - // 配置信息 - InstanceTypeConfig *InstanceTypeConfig `json:"InstanceTypeConfig,omitempty" name:"InstanceTypeConfig"` -} - -type InstanceTypeQuotaItem struct { - // 可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 实例机型。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例计费模式。取值范围:
  • PREPAID:表示预付费,即包年包月
  • POSTPAID_BY_HOUR:表示后付费,即按量计费
  • CDHPAID:表示[专用宿主机](https://cloud.tencent.com/document/product/416)付费,即只对`专用宿主机`计费,不对`专用宿主机`上的实例计费。
  • `SPOTPAID`:表示竞价实例付费。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 网卡类型,例如:25代表25G网卡 - NetworkCard *int64 `json:"NetworkCard,omitempty" name:"NetworkCard"` - - // 扩展属性。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Externals *Externals `json:"Externals,omitempty" name:"Externals"` - - // 实例的CPU核数,单位:核。 - Cpu *int64 `json:"Cpu,omitempty" name:"Cpu"` - - // 实例内存容量,单位:`GB`。 - Memory *int64 `json:"Memory,omitempty" name:"Memory"` - - // 实例机型系列。 - InstanceFamily *string `json:"InstanceFamily,omitempty" name:"InstanceFamily"` - - // 机型名称。 - TypeName *string `json:"TypeName,omitempty" name:"TypeName"` - - // 本地磁盘规格列表。当该参数返回为空值时,表示当前情况下无法创建本地盘。 - LocalDiskTypeList []*LocalDiskType `json:"LocalDiskTypeList,omitempty" name:"LocalDiskTypeList"` - - // 实例是否售卖。取值范围:
  • SELL:表示实例可购买
  • SOLD_OUT:表示实例已售罄。 - Status *string `json:"Status,omitempty" name:"Status"` - - // 实例的售卖价格。 - Price *ItemPrice `json:"Price,omitempty" name:"Price"` - - // 售罄原因。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SoldOutReason *string `json:"SoldOutReason,omitempty" name:"SoldOutReason"` - - // 内网带宽,单位Gbps。 - InstanceBandwidth *float64 `json:"InstanceBandwidth,omitempty" name:"InstanceBandwidth"` - - // 网络收发包能力,单位万PPS。 - InstancePps *int64 `json:"InstancePps,omitempty" name:"InstancePps"` - - // 本地存储块数量。 - StorageBlockAmount *int64 `json:"StorageBlockAmount,omitempty" name:"StorageBlockAmount"` - - // 处理器型号。 - CpuType *string `json:"CpuType,omitempty" name:"CpuType"` - - // 实例的GPU数量。 - Gpu *int64 `json:"Gpu,omitempty" name:"Gpu"` - - // 实例的FPGA数量。 - Fpga *int64 `json:"Fpga,omitempty" name:"Fpga"` - - // 实例备注信息。 - Remark *string `json:"Remark,omitempty" name:"Remark"` - - // 实例机型映射的物理GPU卡数,单位:卡。vGPU卡型小于1,直通卡型大于等于1。vGPU是通过分片虚拟化技术,将物理GPU卡重新划分,同一块GPU卡经虚拟化分割后可分配至不同的实例使用。直通卡型会将GPU设备直接挂载给实例使用。 - GpuCount *float64 `json:"GpuCount,omitempty" name:"GpuCount"` - - // 实例的CPU主频信息 - Frequency *string `json:"Frequency,omitempty" name:"Frequency"` -} - -type InternetAccessible struct { - // 网络计费类型。取值范围:
  • BANDWIDTH_PREPAID:预付费按带宽结算
  • TRAFFIC_POSTPAID_BY_HOUR:流量按小时后付费
  • BANDWIDTH_POSTPAID_BY_HOUR:带宽按小时后付费
  • BANDWIDTH_PACKAGE:带宽包用户
    默认取值:非带宽包用户默认与子机付费类型保持一致,比如子机付费类型为预付费,网络计费类型默认为预付费;子机付费类型为后付费,网络计费类型默认为后付费。 - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 公网出带宽上限,单位:Mbps。默认值:0Mbps。不同机型带宽上限范围不一致,具体限制详见[购买网络带宽](https://cloud.tencent.com/document/product/213/12523)。 - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 是否分配公网IP。取值范围:
  • TRUE:表示分配公网IP
  • FALSE:表示不分配公网IP

    当公网带宽大于0Mbps时,可自由选择开通与否,默认开通公网IP;当公网带宽为0,则不允许分配公网IP。该参数仅在RunInstances接口中作为入参使用。 - PublicIpAssigned *bool `json:"PublicIpAssigned,omitempty" name:"PublicIpAssigned"` - - // 带宽包ID。可通过[`DescribeBandwidthPackages`](https://cloud.tencent.com/document/api/215/19209)接口返回值中的`BandwidthPackageId`获取。该参数仅在RunInstances接口中作为入参使用。 - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -type InternetBandwidthConfig struct { - // 开始时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 结束时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 实例带宽信息。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` -} - -type InternetChargeTypeConfig struct { - // 网络计费模式。 - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 网络计费模式描述信息。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -type ItemPrice struct { - // 后续合计费用的原价,后付费模式使用,单位:元。
  • 如返回了其他时间区间项,如UnitPriceSecondStep,则本项代表时间区间在(0, 96)小时;若未返回其他时间区间项,则本项代表全时段,即(0, ∞)小时 - // 注意:此字段可能返回 null,表示取不到有效值。 - UnitPrice *float64 `json:"UnitPrice,omitempty" name:"UnitPrice"` - - // 后续计价单元,后付费模式使用,可取值范围:
  • HOUR:表示计价单元是按每小时来计算。当前涉及该计价单元的场景有:实例按小时后付费(POSTPAID_BY_HOUR)、带宽按小时后付费(BANDWIDTH_POSTPAID_BY_HOUR):
  • GB:表示计价单元是按每GB来计算。当前涉及该计价单元的场景有:流量按小时后付费(TRAFFIC_POSTPAID_BY_HOUR)。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ChargeUnit *string `json:"ChargeUnit,omitempty" name:"ChargeUnit"` - - // 预支合计费用的原价,预付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - OriginalPrice *float64 `json:"OriginalPrice,omitempty" name:"OriginalPrice"` - - // 预支合计费用的折扣价,预付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiscountPrice *float64 `json:"DiscountPrice,omitempty" name:"DiscountPrice"` - - // 折扣,如20.0代表2折。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Discount *float64 `json:"Discount,omitempty" name:"Discount"` - - // 后续合计费用的折扣价,后付费模式使用,单位:元
  • 如返回了其他时间区间项,如UnitPriceDiscountSecondStep,则本项代表时间区间在(0, 96)小时;若未返回其他时间区间项,则本项代表全时段,即(0, ∞)小时 - // 注意:此字段可能返回 null,表示取不到有效值。 - UnitPriceDiscount *float64 `json:"UnitPriceDiscount,omitempty" name:"UnitPriceDiscount"` - - // 使用时间区间在(96, 360)小时的后续合计费用的原价,后付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - UnitPriceSecondStep *float64 `json:"UnitPriceSecondStep,omitempty" name:"UnitPriceSecondStep"` - - // 使用时间区间在(96, 360)小时的后续合计费用的折扣价,后付费模式使用,单位:元 - // 注意:此字段可能返回 null,表示取不到有效值。 - UnitPriceDiscountSecondStep *float64 `json:"UnitPriceDiscountSecondStep,omitempty" name:"UnitPriceDiscountSecondStep"` - - // 使用时间区间在(360, ∞)小时的后续合计费用的原价,后付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - UnitPriceThirdStep *float64 `json:"UnitPriceThirdStep,omitempty" name:"UnitPriceThirdStep"` - - // 使用时间区间在(360, ∞)小时的后续合计费用的折扣价,后付费模式使用,单位:元 - // 注意:此字段可能返回 null,表示取不到有效值。 - UnitPriceDiscountThirdStep *float64 `json:"UnitPriceDiscountThirdStep,omitempty" name:"UnitPriceDiscountThirdStep"` - - // 预支三年合计费用的原价,预付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - OriginalPriceThreeYear *float64 `json:"OriginalPriceThreeYear,omitempty" name:"OriginalPriceThreeYear"` - - // 预支三年合计费用的折扣价,预付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiscountPriceThreeYear *float64 `json:"DiscountPriceThreeYear,omitempty" name:"DiscountPriceThreeYear"` - - // 预支三年应用的折扣,如20.0代表2折。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiscountThreeYear *float64 `json:"DiscountThreeYear,omitempty" name:"DiscountThreeYear"` - - // 预支五年合计费用的原价,预付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - OriginalPriceFiveYear *float64 `json:"OriginalPriceFiveYear,omitempty" name:"OriginalPriceFiveYear"` - - // 预支五年合计费用的折扣价,预付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiscountPriceFiveYear *float64 `json:"DiscountPriceFiveYear,omitempty" name:"DiscountPriceFiveYear"` - - // 预支五年应用的折扣,如20.0代表2折。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiscountFiveYear *float64 `json:"DiscountFiveYear,omitempty" name:"DiscountFiveYear"` - - // 预支一年合计费用的原价,预付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - OriginalPriceOneYear *float64 `json:"OriginalPriceOneYear,omitempty" name:"OriginalPriceOneYear"` - - // 预支一年合计费用的折扣价,预付费模式使用,单位:元。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiscountPriceOneYear *float64 `json:"DiscountPriceOneYear,omitempty" name:"DiscountPriceOneYear"` - - // 预支一年应用的折扣,如20.0代表2折。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DiscountOneYear *float64 `json:"DiscountOneYear,omitempty" name:"DiscountOneYear"` -} - -type KeyPair struct { - // 密钥对的`ID`,是密钥对的唯一标识。 - KeyId *string `json:"KeyId,omitempty" name:"KeyId"` - - // 密钥对名称。 - KeyName *string `json:"KeyName,omitempty" name:"KeyName"` - - // 密钥对所属的项目`ID`。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 密钥对描述信息。 - Description *string `json:"Description,omitempty" name:"Description"` - - // 密钥对的纯文本公钥。 - PublicKey *string `json:"PublicKey,omitempty" name:"PublicKey"` - - // 密钥对的纯文本私钥。腾讯云不会保管私钥,请用户自行妥善保存。 - PrivateKey *string `json:"PrivateKey,omitempty" name:"PrivateKey"` - - // 密钥关联的实例`ID`列表。 - AssociatedInstanceIds []*string `json:"AssociatedInstanceIds,omitempty" name:"AssociatedInstanceIds"` - - // 创建时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 密钥关联的标签列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -type LaunchTemplate struct { - // 实例启动模板ID,通过该参数可使用实例模板中的预设参数创建实例。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 实例启动模板版本号,若给定,新实例启动模板将基于给定的版本号创建 - LaunchTemplateVersion *uint64 `json:"LaunchTemplateVersion,omitempty" name:"LaunchTemplateVersion"` -} - -type LaunchTemplateInfo struct { - // 实例启动模版本号。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LatestVersionNumber *uint64 `json:"LatestVersionNumber,omitempty" name:"LatestVersionNumber"` - - // 实例启动模板ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 实例启动模板名。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LaunchTemplateName *string `json:"LaunchTemplateName,omitempty" name:"LaunchTemplateName"` - - // 实例启动模板默认版本号。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DefaultVersionNumber *uint64 `json:"DefaultVersionNumber,omitempty" name:"DefaultVersionNumber"` - - // 实例启动模板包含的版本总数量。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LaunchTemplateVersionCount *uint64 `json:"LaunchTemplateVersionCount,omitempty" name:"LaunchTemplateVersionCount"` - - // 创建该模板的用户UIN。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreatedBy *string `json:"CreatedBy,omitempty" name:"CreatedBy"` - - // 创建该模板的时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreationTime *string `json:"CreationTime,omitempty" name:"CreationTime"` -} - -type LaunchTemplateVersionData struct { - // 实例所在的位置。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 实例机型。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例名称。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例计费模式。取值范围:
  • `PREPAID`:表示预付费,即包年包月
  • `POSTPAID_BY_HOUR`:表示后付费,即按量计费
  • `CDHPAID`:`专用宿主机`付费,即只对`专用宿主机`计费,不对`专用宿主机`上的实例计费。
  • `SPOTPAID`:表示竞价实例付费。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 实例系统盘信息。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘信息。只包含随实例购买的数据盘。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 实例带宽信息。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 实例所属虚拟私有网络信息。 - // 注意:此字段可能返回 null,表示取不到有效值。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 生产实例所使用的镜像`ID`。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 实例登录设置。目前只返回实例所关联的密钥。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // CAM角色名。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群`ID`。 - // 注意:此字段可能返回 null,表示取不到有效值。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 购买实例数量。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceCount *uint64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 增强服务。 - // 注意:此字段可能返回 null,表示取不到有效值。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。 - // 注意:此字段可能返回 null,表示取不到有效值。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 置放群组ID,仅支持指定一个。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 定时任务。通过该参数可以为实例指定定时任务,目前仅支持定时销毁。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ActionTimer *ActionTimer `json:"ActionTimer,omitempty" name:"ActionTimer"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 云服务器的主机名。 - // 注意:此字段可能返回 null,表示取不到有效值。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 用于保证请求幂等性的字符串。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 预付费模式,即包年包月相关参数设置。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的云服务器、云硬盘实例。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围: - // - // TRUE:表示开启实例保护,不允许通过api接口删除实例 - // FALSE:表示关闭实例保护,允许通过api接口删除实例 - // - // 默认取值:FALSE。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` -} - -type LaunchTemplateVersionInfo struct { - // 实例启动模板版本号。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LaunchTemplateVersion *uint64 `json:"LaunchTemplateVersion,omitempty" name:"LaunchTemplateVersion"` - - // 实例启动模板版本数据详情。 - LaunchTemplateVersionData *LaunchTemplateVersionData `json:"LaunchTemplateVersionData,omitempty" name:"LaunchTemplateVersionData"` - - // 实例启动模板版本创建时间。 - CreationTime *string `json:"CreationTime,omitempty" name:"CreationTime"` - - // 实例启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 是否为默认启动模板版本。 - IsDefaultVersion *bool `json:"IsDefaultVersion,omitempty" name:"IsDefaultVersion"` - - // 实例启动模板版本描述信息。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LaunchTemplateVersionDescription *string `json:"LaunchTemplateVersionDescription,omitempty" name:"LaunchTemplateVersionDescription"` - - // 创建者。 - CreatedBy *string `json:"CreatedBy,omitempty" name:"CreatedBy"` -} - -type LocalDiskType struct { - // 本地磁盘类型。 - Type *string `json:"Type,omitempty" name:"Type"` - - // 本地磁盘属性。 - PartitionType *string `json:"PartitionType,omitempty" name:"PartitionType"` - - // 本地磁盘最小值。 - MinSize *int64 `json:"MinSize,omitempty" name:"MinSize"` - - // 本地磁盘最大值。 - MaxSize *int64 `json:"MaxSize,omitempty" name:"MaxSize"` - - // 购买时本地盘是否为必选。取值范围:
  • REQUIRED:表示必选
  • OPTIONAL:表示可选。 - Required *string `json:"Required,omitempty" name:"Required"` -} - -type LoginSettings struct { - // 实例登录密码。不同操作系统类型密码复杂度限制不一样,具体如下:
  • Linux实例密码必须8到30位,至少包括两项[a-z],[A-Z]、[0-9] 和 [( ) \` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' , . ? / ]中的特殊符号。
  • Windows实例密码必须12到30位,至少包括三项[a-z],[A-Z],[0-9] 和 [( ) \` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' , . ? /]中的特殊符号。

    若不指定该参数,则由系统随机生成密码,并通过站内信方式通知到用户。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Password *string `json:"Password,omitempty" name:"Password"` - - // 密钥ID列表。关联密钥后,就可以通过对应的私钥来访问实例;KeyId可通过接口[DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699)获取,密钥与密码不能同时指定,同时Windows操作系统不支持指定密钥。 - // 注意:此字段可能返回 null,表示取不到有效值。 - KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds"` - - // 保持镜像的原始设置。该参数与Password或KeyIds.N不能同时指定。只有使用自定义镜像、共享镜像或外部导入镜像创建实例时才能指定该参数为TRUE。取值范围:
  • TRUE:表示保持镜像的登录设置
  • FALSE:表示不保持镜像的登录设置

    默认取值:FALSE。 - // 注意:此字段可能返回 null,表示取不到有效值。 - KeepImageLogin *string `json:"KeepImageLogin,omitempty" name:"KeepImageLogin"` -} - -// Predefined struct for user -type ModifyChcAttributeRequestParams struct { - // CHC物理服务器ID。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - // CHC物理服务器名称 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 服务器类型 - DeviceType *string `json:"DeviceType,omitempty" name:"DeviceType"` - - // 合法字符为字母,数字, 横线和下划线 - BmcUser *string `json:"BmcUser,omitempty" name:"BmcUser"` - - // 密码8-16位字符, 允许数字,字母, 和特殊字符()`~!@#$%^&*-+=_|{}[]:;'<>,.?/ - Password *string `json:"Password,omitempty" name:"Password"` - - // bmc网络的安全组列表 - BmcSecurityGroupIds []*string `json:"BmcSecurityGroupIds,omitempty" name:"BmcSecurityGroupIds"` -} - -type ModifyChcAttributeRequest struct { - *tchttp.BaseRequest - - // CHC物理服务器ID。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - // CHC物理服务器名称 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 服务器类型 - DeviceType *string `json:"DeviceType,omitempty" name:"DeviceType"` - - // 合法字符为字母,数字, 横线和下划线 - BmcUser *string `json:"BmcUser,omitempty" name:"BmcUser"` - - // 密码8-16位字符, 允许数字,字母, 和特殊字符()`~!@#$%^&*-+=_|{}[]:;'<>,.?/ - Password *string `json:"Password,omitempty" name:"Password"` - - // bmc网络的安全组列表 - BmcSecurityGroupIds []*string `json:"BmcSecurityGroupIds,omitempty" name:"BmcSecurityGroupIds"` -} - -func (r *ModifyChcAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyChcAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ChcIds") - delete(f, "InstanceName") - delete(f, "DeviceType") - delete(f, "BmcUser") - delete(f, "Password") - delete(f, "BmcSecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyChcAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyChcAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyChcAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyChcAttributeResponseParams `json:"Response"` -} - -func (r *ModifyChcAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyChcAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyDisasterRecoverGroupAttributeRequestParams struct { - // 分散置放群组ID,可使用[DescribeDisasterRecoverGroups](https://cloud.tencent.com/document/api/213/17810)接口获取。 - DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` - - // 分散置放群组名称,长度1-60个字符,支持中、英文。 - Name *string `json:"Name,omitempty" name:"Name"` -} - -type ModifyDisasterRecoverGroupAttributeRequest struct { - *tchttp.BaseRequest - - // 分散置放群组ID,可使用[DescribeDisasterRecoverGroups](https://cloud.tencent.com/document/api/213/17810)接口获取。 - DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` - - // 分散置放群组名称,长度1-60个字符,支持中、英文。 - Name *string `json:"Name,omitempty" name:"Name"` -} - -func (r *ModifyDisasterRecoverGroupAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyDisasterRecoverGroupAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DisasterRecoverGroupId") - delete(f, "Name") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDisasterRecoverGroupAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyDisasterRecoverGroupAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyDisasterRecoverGroupAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyDisasterRecoverGroupAttributeResponseParams `json:"Response"` -} - -func (r *ModifyDisasterRecoverGroupAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyDisasterRecoverGroupAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyHostsAttributeRequestParams struct { - // 一个或多个待操作的CDH实例ID。 - HostIds []*string `json:"HostIds,omitempty" name:"HostIds"` - - // CDH实例显示名称。可任意命名,但不得超过60个字符。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 自动续费标识。取值范围:
  • NOTIFY_AND_AUTO_RENEW:通知过期且自动续费
  • NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费
  • DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费

    若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` - - // 项目ID。项目可以使用[AddProject](https://cloud.tencent.com/doc/api/403/4398)接口创建。可通过[`DescribeProject`](https://cloud.tencent.com/document/product/378/4400) API返回值中的`projectId`获取。后续使用[DescribeHosts](https://cloud.tencent.com/document/api/213/16474)接口查询实例时,项目ID可用于过滤结果。 - ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` -} - -type ModifyHostsAttributeRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的CDH实例ID。 - HostIds []*string `json:"HostIds,omitempty" name:"HostIds"` - - // CDH实例显示名称。可任意命名,但不得超过60个字符。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 自动续费标识。取值范围:
  • NOTIFY_AND_AUTO_RENEW:通知过期且自动续费
  • NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费
  • DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费

    若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` - - // 项目ID。项目可以使用[AddProject](https://cloud.tencent.com/doc/api/403/4398)接口创建。可通过[`DescribeProject`](https://cloud.tencent.com/document/product/378/4400) API返回值中的`projectId`获取。后续使用[DescribeHosts](https://cloud.tencent.com/document/api/213/16474)接口查询实例时,项目ID可用于过滤结果。 - ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` -} - -func (r *ModifyHostsAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyHostsAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HostIds") - delete(f, "HostName") - delete(f, "RenewFlag") - delete(f, "ProjectId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyHostsAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyHostsAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyHostsAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyHostsAttributeResponseParams `json:"Response"` -} - -func (r *ModifyHostsAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyHostsAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyHpcClusterAttributeRequestParams struct { - // 高性能计算集群ID。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 高性能计算集群新名称。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 高性能计算集群新备注。 - Remark *string `json:"Remark,omitempty" name:"Remark"` -} - -type ModifyHpcClusterAttributeRequest struct { - *tchttp.BaseRequest - - // 高性能计算集群ID。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 高性能计算集群新名称。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 高性能计算集群新备注。 - Remark *string `json:"Remark,omitempty" name:"Remark"` -} - -func (r *ModifyHpcClusterAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyHpcClusterAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HpcClusterId") - delete(f, "Name") - delete(f, "Remark") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyHpcClusterAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyHpcClusterAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyHpcClusterAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyHpcClusterAttributeResponseParams `json:"Response"` -} - -func (r *ModifyHpcClusterAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyHpcClusterAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyImageAttributeRequestParams struct { - // 镜像ID,形如`img-gvbnzy6f`。镜像ID可以通过如下方式获取:
  • 通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。
  • 通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 设置新的镜像名称;必须满足下列限制:
  • 不得超过60个字符。
  • 镜像名称不能与已有镜像重复。 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 设置新的镜像描述;必须满足下列限制:
  • 不得超过60个字符。 - ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` -} - -type ModifyImageAttributeRequest struct { - *tchttp.BaseRequest - - // 镜像ID,形如`img-gvbnzy6f`。镜像ID可以通过如下方式获取:
  • 通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。
  • 通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 设置新的镜像名称;必须满足下列限制:
  • 不得超过60个字符。
  • 镜像名称不能与已有镜像重复。 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 设置新的镜像描述;必须满足下列限制:
  • 不得超过60个字符。 - ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` -} - -func (r *ModifyImageAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyImageAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ImageId") - delete(f, "ImageName") - delete(f, "ImageDescription") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyImageAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyImageAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyImageAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyImageAttributeResponseParams `json:"Response"` -} - -func (r *ModifyImageAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyImageAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyImageSharePermissionRequestParams struct { - // 镜像ID,形如`img-gvbnzy6f`。镜像Id可以通过如下方式获取:
  • 通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。
  • 通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。
    镜像ID必须指定为状态为`NORMAL`的镜像。镜像状态请参考[镜像数据表](https://cloud.tencent.com/document/product/213/15753#Image)。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 接收分享镜像的账号Id列表,array型参数的格式可以参考[API简介](/document/api/213/568)。帐号ID不同于QQ号,查询用户帐号ID请查看[帐号信息](https://console.cloud.tencent.com/developer)中的帐号ID栏。 - AccountIds []*string `json:"AccountIds,omitempty" name:"AccountIds"` - - // 操作,包括 `SHARE`,`CANCEL`。其中`SHARE`代表分享操作,`CANCEL`代表取消分享操作。 - Permission *string `json:"Permission,omitempty" name:"Permission"` -} - -type ModifyImageSharePermissionRequest struct { - *tchttp.BaseRequest - - // 镜像ID,形如`img-gvbnzy6f`。镜像Id可以通过如下方式获取:
  • 通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。
  • 通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。
    镜像ID必须指定为状态为`NORMAL`的镜像。镜像状态请参考[镜像数据表](https://cloud.tencent.com/document/product/213/15753#Image)。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 接收分享镜像的账号Id列表,array型参数的格式可以参考[API简介](/document/api/213/568)。帐号ID不同于QQ号,查询用户帐号ID请查看[帐号信息](https://console.cloud.tencent.com/developer)中的帐号ID栏。 - AccountIds []*string `json:"AccountIds,omitempty" name:"AccountIds"` - - // 操作,包括 `SHARE`,`CANCEL`。其中`SHARE`代表分享操作,`CANCEL`代表取消分享操作。 - Permission *string `json:"Permission,omitempty" name:"Permission"` -} - -func (r *ModifyImageSharePermissionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyImageSharePermissionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ImageId") - delete(f, "AccountIds") - delete(f, "Permission") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyImageSharePermissionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyImageSharePermissionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyImageSharePermissionResponse struct { - *tchttp.BaseResponse - Response *ModifyImageSharePermissionResponseParams `json:"Response"` -} - -func (r *ModifyImageSharePermissionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyImageSharePermissionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstanceDiskTypeRequestParams struct { - // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/9388)接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例数据盘配置信息,只需要指定要转换的目标云硬盘的介质类型,指定DiskType的值,当前只支持一个数据盘转化。只支持CDHPAID类型实例指定CdcId参数。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 实例系统盘配置信息,只需要指定要转换的目标云硬盘的介质类型,指定DiskType的值。只支持CDHPAID类型实例指定CdcId参数。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` -} - -type ModifyInstanceDiskTypeRequest struct { - *tchttp.BaseRequest - - // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/9388)接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例数据盘配置信息,只需要指定要转换的目标云硬盘的介质类型,指定DiskType的值,当前只支持一个数据盘转化。只支持CDHPAID类型实例指定CdcId参数。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 实例系统盘配置信息,只需要指定要转换的目标云硬盘的介质类型,指定DiskType的值。只支持CDHPAID类型实例指定CdcId参数。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` -} - -func (r *ModifyInstanceDiskTypeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstanceDiskTypeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - delete(f, "DataDisks") - delete(f, "SystemDisk") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyInstanceDiskTypeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstanceDiskTypeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyInstanceDiskTypeResponse struct { - *tchttp.BaseResponse - Response *ModifyInstanceDiskTypeResponseParams `json:"Response"` -} - -func (r *ModifyInstanceDiskTypeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstanceDiskTypeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesAttributeRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例名称。可任意命名,但不得超过60个字符。 - // 必须指定InstanceName与SecurityGroups的其中一个,但不能同时设置 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 指定实例的安全组Id列表,子机将重新关联指定列表的安全组,原本关联的安全组会被解绑。必须指定SecurityGroups与InstanceName的其中一个,但不能同时设置 - SecurityGroups []*string `json:"SecurityGroups,omitempty" name:"SecurityGroups"` - - // 给实例绑定用户角色,传空值为解绑操作 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 实例的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:主机名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:主机名字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` - - // 角色类别,与CamRoleName搭配使用,该值可从CAM DescribeRoleList, GetRole接口返回RoleType字段获取,当前只接受user、system和service_linked三种类别。 - // 举例:一般CamRoleName中包含“LinkedRoleIn”(如TKE_QCSLinkedRoleInPrometheusService)时,DescribeRoleList和GetRole返回的RoleType为service_linked,则本参数也需要传递service_linked。 - // 该参数默认值为user,若CameRoleName为非service_linked类型,本参数可不传递。 - CamRoleType *string `json:"CamRoleType,omitempty" name:"CamRoleType"` -} - -type ModifyInstancesAttributeRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例名称。可任意命名,但不得超过60个字符。 - // 必须指定InstanceName与SecurityGroups的其中一个,但不能同时设置 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 指定实例的安全组Id列表,子机将重新关联指定列表的安全组,原本关联的安全组会被解绑。必须指定SecurityGroups与InstanceName的其中一个,但不能同时设置 - SecurityGroups []*string `json:"SecurityGroups,omitempty" name:"SecurityGroups"` - - // 给实例绑定用户角色,传空值为解绑操作 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 实例的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:主机名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:主机名字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` - - // 角色类别,与CamRoleName搭配使用,该值可从CAM DescribeRoleList, GetRole接口返回RoleType字段获取,当前只接受user、system和service_linked三种类别。 - // 举例:一般CamRoleName中包含“LinkedRoleIn”(如TKE_QCSLinkedRoleInPrometheusService)时,DescribeRoleList和GetRole返回的RoleType为service_linked,则本参数也需要传递service_linked。 - // 该参数默认值为user,若CameRoleName为非service_linked类型,本参数可不传递。 - CamRoleType *string `json:"CamRoleType,omitempty" name:"CamRoleType"` -} - -func (r *ModifyInstancesAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InstanceName") - delete(f, "SecurityGroups") - delete(f, "CamRoleName") - delete(f, "HostName") - delete(f, "DisableApiTermination") - delete(f, "CamRoleType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyInstancesAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyInstancesAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyInstancesAttributeResponseParams `json:"Response"` -} - -func (r *ModifyInstancesAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesChargeTypeRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为30。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月。
  • POSTPAID_BY_HOUR:后付费,即按量付费。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 是否同时切换弹性数据云盘计费模式。取值范围:
  • TRUE:表示切换弹性数据云盘计费模式
  • FALSE:表示不切换弹性数据云盘计费模式

    默认取值:FALSE。 - ModifyPortableDataDisk *bool `json:"ModifyPortableDataDisk,omitempty" name:"ModifyPortableDataDisk"` -} - -type ModifyInstancesChargeTypeRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为30。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月。
  • POSTPAID_BY_HOUR:后付费,即按量付费。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 是否同时切换弹性数据云盘计费模式。取值范围:
  • TRUE:表示切换弹性数据云盘计费模式
  • FALSE:表示不切换弹性数据云盘计费模式

    默认取值:FALSE。 - ModifyPortableDataDisk *bool `json:"ModifyPortableDataDisk,omitempty" name:"ModifyPortableDataDisk"` -} - -func (r *ModifyInstancesChargeTypeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesChargeTypeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "ModifyPortableDataDisk") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyInstancesChargeTypeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesChargeTypeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyInstancesChargeTypeResponse struct { - *tchttp.BaseResponse - Response *ModifyInstancesChargeTypeResponseParams `json:"Response"` -} - -func (r *ModifyInstancesChargeTypeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesChargeTypeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesProjectRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 项目ID。项目可以使用[AddProject](https://cloud.tencent.com/document/product/651/81952)接口创建。可通过[`DescribeProject`](https://cloud.tencent.com/document/product/378/4400) API返回值中的`projectId`获取。后续使用[DescribeInstances](https://cloud.tencent.com/document/api/213/15728)接口查询实例时,项目ID可用于过滤结果。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` -} - -type ModifyInstancesProjectRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 项目ID。项目可以使用[AddProject](https://cloud.tencent.com/document/product/651/81952)接口创建。可通过[`DescribeProject`](https://cloud.tencent.com/document/product/378/4400) API返回值中的`projectId`获取。后续使用[DescribeInstances](https://cloud.tencent.com/document/api/213/15728)接口查询实例时,项目ID可用于过滤结果。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` -} - -func (r *ModifyInstancesProjectRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesProjectRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "ProjectId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyInstancesProjectRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesProjectResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyInstancesProjectResponse struct { - *tchttp.BaseResponse - Response *ModifyInstancesProjectResponseParams `json:"Response"` -} - -func (r *ModifyInstancesProjectResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesProjectResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesRenewFlagRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 自动续费标识。取值范围:
  • NOTIFY_AND_AUTO_RENEW:通知过期且自动续费
  • NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费
  • DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费

    若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` -} - -type ModifyInstancesRenewFlagRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 自动续费标识。取值范围:
  • NOTIFY_AND_AUTO_RENEW:通知过期且自动续费
  • NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费
  • DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费

    若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` -} - -func (r *ModifyInstancesRenewFlagRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesRenewFlagRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "RenewFlag") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyInstancesRenewFlagRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesRenewFlagResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyInstancesRenewFlagResponse struct { - *tchttp.BaseResponse - Response *ModifyInstancesRenewFlagResponseParams `json:"Response"` -} - -func (r *ModifyInstancesRenewFlagResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesRenewFlagResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesVpcAttributeRequestParams struct { - // 待操作的实例ID数组。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 私有网络相关信息配置,通过该参数指定私有网络的ID,子网ID,私有网络ip等信息。
  • 当指定私有网络ID和子网ID(子网必须在实例所在的可用区)与指定实例所在私有网络不一致时,会将实例迁移至指定的私有网络的子网下。
  • 可通过`PrivateIpAddresses`指定私有网络子网IP,若需指定则所有已指定的实例均需要指定子网IP,此时`InstanceIds`与`PrivateIpAddresses`一一对应。
  • 不指定`PrivateIpAddresses`时随机分配私有网络子网IP。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 是否对运行中的实例选择强制关机。默认为TRUE。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` - - // 是否保留主机名。默认为FALSE。 - ReserveHostName *bool `json:"ReserveHostName,omitempty" name:"ReserveHostName"` -} - -type ModifyInstancesVpcAttributeRequest struct { - *tchttp.BaseRequest - - // 待操作的实例ID数组。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 私有网络相关信息配置,通过该参数指定私有网络的ID,子网ID,私有网络ip等信息。
  • 当指定私有网络ID和子网ID(子网必须在实例所在的可用区)与指定实例所在私有网络不一致时,会将实例迁移至指定的私有网络的子网下。
  • 可通过`PrivateIpAddresses`指定私有网络子网IP,若需指定则所有已指定的实例均需要指定子网IP,此时`InstanceIds`与`PrivateIpAddresses`一一对应。
  • 不指定`PrivateIpAddresses`时随机分配私有网络子网IP。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 是否对运行中的实例选择强制关机。默认为TRUE。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` - - // 是否保留主机名。默认为FALSE。 - ReserveHostName *bool `json:"ReserveHostName,omitempty" name:"ReserveHostName"` -} - -func (r *ModifyInstancesVpcAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesVpcAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "VirtualPrivateCloud") - delete(f, "ForceStop") - delete(f, "ReserveHostName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyInstancesVpcAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyInstancesVpcAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyInstancesVpcAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyInstancesVpcAttributeResponseParams `json:"Response"` -} - -func (r *ModifyInstancesVpcAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyInstancesVpcAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyKeyPairAttributeRequestParams struct { - // 密钥对ID,密钥对ID形如:`skey-xxxxxxxx`。

    可以通过以下方式获取可用的密钥 ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥 ID。
  • 通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/9403) ,取返回信息中的 `KeyId` 获取密钥对 ID。 - KeyId *string `json:"KeyId,omitempty" name:"KeyId"` - - // 修改后的密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 - KeyName *string `json:"KeyName,omitempty" name:"KeyName"` - - // 修改后的密钥对描述信息。可任意命名,但不得超过60个字符。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -type ModifyKeyPairAttributeRequest struct { - *tchttp.BaseRequest - - // 密钥对ID,密钥对ID形如:`skey-xxxxxxxx`。

    可以通过以下方式获取可用的密钥 ID:
  • 通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥 ID。
  • 通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/9403) ,取返回信息中的 `KeyId` 获取密钥对 ID。 - KeyId *string `json:"KeyId,omitempty" name:"KeyId"` - - // 修改后的密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 - KeyName *string `json:"KeyName,omitempty" name:"KeyName"` - - // 修改后的密钥对描述信息。可任意命名,但不得超过60个字符。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -func (r *ModifyKeyPairAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyKeyPairAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "KeyId") - delete(f, "KeyName") - delete(f, "Description") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyKeyPairAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyKeyPairAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyKeyPairAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyKeyPairAttributeResponseParams `json:"Response"` -} - -func (r *ModifyKeyPairAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyKeyPairAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLaunchTemplateDefaultVersionRequestParams struct { - // 启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 待设置的默认版本号。 - DefaultVersion *int64 `json:"DefaultVersion,omitempty" name:"DefaultVersion"` -} - -type ModifyLaunchTemplateDefaultVersionRequest struct { - *tchttp.BaseRequest - - // 启动模板ID。 - LaunchTemplateId *string `json:"LaunchTemplateId,omitempty" name:"LaunchTemplateId"` - - // 待设置的默认版本号。 - DefaultVersion *int64 `json:"DefaultVersion,omitempty" name:"DefaultVersion"` -} - -func (r *ModifyLaunchTemplateDefaultVersionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLaunchTemplateDefaultVersionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LaunchTemplateId") - delete(f, "DefaultVersion") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyLaunchTemplateDefaultVersionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLaunchTemplateDefaultVersionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyLaunchTemplateDefaultVersionResponse struct { - *tchttp.BaseResponse - Response *ModifyLaunchTemplateDefaultVersionResponseParams `json:"Response"` -} - -func (r *ModifyLaunchTemplateDefaultVersionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLaunchTemplateDefaultVersionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type OperationCountLimit struct { - // 实例操作。取值范围:
  • `INSTANCE_DEGRADE`:降配操作
  • `INTERNET_CHARGE_TYPE_CHANGE`:修改网络带宽计费模式 - Operation *string `json:"Operation,omitempty" name:"Operation"` - - // 实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 当前已使用次数,如果返回值为-1表示该操作无次数限制。 - CurrentCount *int64 `json:"CurrentCount,omitempty" name:"CurrentCount"` - - // 操作次数最高额度,如果返回值为-1表示该操作无次数限制,如果返回值为0表示不支持调整配置。 - LimitCount *int64 `json:"LimitCount,omitempty" name:"LimitCount"` -} - -type OsVersion struct { - // 操作系统类型 - OsName *string `json:"OsName,omitempty" name:"OsName"` - - // 支持的操作系统版本 - OsVersions []*string `json:"OsVersions,omitempty" name:"OsVersions"` - - // 支持的操作系统架构 - Architecture []*string `json:"Architecture,omitempty" name:"Architecture"` -} - -type Placement struct { - // 实例所属的可用区ID。该参数可以通过调用 [DescribeZones](https://cloud.tencent.com/document/product/213/15707) 的返回值中的Zone字段来获取。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 实例所属项目ID。该参数可以通过调用 [DescribeProject](https://cloud.tencent.com/document/api/651/78725) 的返回值中的 projectId 字段来获取。不填为默认项目。 - ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` - - // 实例所属的专用宿主机ID列表,仅用于入参。如果您有购买专用宿主机并且指定了该参数,则您购买的实例就会随机的部署在这些专用宿主机上。 - HostIds []*string `json:"HostIds,omitempty" name:"HostIds"` - - // 指定母机IP生产子机 - HostIps []*string `json:"HostIps,omitempty" name:"HostIps"` - - // 实例所属的专用宿主机ID,仅用于出参。 - HostId *string `json:"HostId,omitempty" name:"HostId"` -} - -type PostPaidQuota struct { - // 累计已使用配额 - UsedQuota *uint64 `json:"UsedQuota,omitempty" name:"UsedQuota"` - - // 剩余配额 - RemainingQuota *uint64 `json:"RemainingQuota,omitempty" name:"RemainingQuota"` - - // 总配额 - TotalQuota *uint64 `json:"TotalQuota,omitempty" name:"TotalQuota"` - - // 可用区 - Zone *string `json:"Zone,omitempty" name:"Zone"` -} - -type PrePaidQuota struct { - // 当月已使用配额 - UsedQuota *uint64 `json:"UsedQuota,omitempty" name:"UsedQuota"` - - // 单次购买最大数量 - OnceQuota *uint64 `json:"OnceQuota,omitempty" name:"OnceQuota"` - - // 剩余配额 - RemainingQuota *uint64 `json:"RemainingQuota,omitempty" name:"RemainingQuota"` - - // 总配额 - TotalQuota *uint64 `json:"TotalQuota,omitempty" name:"TotalQuota"` - - // 可用区 - Zone *string `json:"Zone,omitempty" name:"Zone"` -} - -type Price struct { - // 描述了实例价格。 - InstancePrice *ItemPrice `json:"InstancePrice,omitempty" name:"InstancePrice"` - - // 描述了网络价格。 - BandwidthPrice *ItemPrice `json:"BandwidthPrice,omitempty" name:"BandwidthPrice"` -} - -// Predefined struct for user -type ProgramFpgaImageRequestParams struct { - // 实例的ID信息。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // FPGA镜像文件的COS URL地址。 - FPGAUrl *string `json:"FPGAUrl,omitempty" name:"FPGAUrl"` - - // 实例上FPGA卡的DBDF号,不填默认烧录FPGA镜像到实例所拥有的所有FPGA卡。 - DBDFs []*string `json:"DBDFs,omitempty" name:"DBDFs"` - - // 试运行,不会执行实际的烧录动作,默认为False。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` -} - -type ProgramFpgaImageRequest struct { - *tchttp.BaseRequest - - // 实例的ID信息。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // FPGA镜像文件的COS URL地址。 - FPGAUrl *string `json:"FPGAUrl,omitempty" name:"FPGAUrl"` - - // 实例上FPGA卡的DBDF号,不填默认烧录FPGA镜像到实例所拥有的所有FPGA卡。 - DBDFs []*string `json:"DBDFs,omitempty" name:"DBDFs"` - - // 试运行,不会执行实际的烧录动作,默认为False。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` -} - -func (r *ProgramFpgaImageRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ProgramFpgaImageRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - delete(f, "FPGAUrl") - delete(f, "DBDFs") - delete(f, "DryRun") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ProgramFpgaImageRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ProgramFpgaImageResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ProgramFpgaImageResponse struct { - *tchttp.BaseResponse - Response *ProgramFpgaImageResponseParams `json:"Response"` -} - -func (r *ProgramFpgaImageResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ProgramFpgaImageResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type PurchaseReservedInstancesOfferingRequestParams struct { - // 购买预留实例计费数量 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 预留实例计费配置ID - ReservedInstancesOfferingId *string `json:"ReservedInstancesOfferingId,omitempty" name:"ReservedInstancesOfferingId"` - - // 试运行 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。
    更多详细信息请参阅:如何保证幂等性 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 预留实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 最多支持60个字符(包含模式串)。
  • - ReservedInstanceName *string `json:"ReservedInstanceName,omitempty" name:"ReservedInstanceName"` -} - -type PurchaseReservedInstancesOfferingRequest struct { - *tchttp.BaseRequest - - // 购买预留实例计费数量 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 预留实例计费配置ID - ReservedInstancesOfferingId *string `json:"ReservedInstancesOfferingId,omitempty" name:"ReservedInstancesOfferingId"` - - // 试运行 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。
    更多详细信息请参阅:如何保证幂等性 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 预留实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 最多支持60个字符(包含模式串)。
  • - ReservedInstanceName *string `json:"ReservedInstanceName,omitempty" name:"ReservedInstanceName"` -} - -func (r *PurchaseReservedInstancesOfferingRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *PurchaseReservedInstancesOfferingRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceCount") - delete(f, "ReservedInstancesOfferingId") - delete(f, "DryRun") - delete(f, "ClientToken") - delete(f, "ReservedInstanceName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "PurchaseReservedInstancesOfferingRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type PurchaseReservedInstancesOfferingResponseParams struct { - // 已购买预留实例计费ID - ReservedInstanceId *string `json:"ReservedInstanceId,omitempty" name:"ReservedInstanceId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type PurchaseReservedInstancesOfferingResponse struct { - *tchttp.BaseResponse - Response *PurchaseReservedInstancesOfferingResponseParams `json:"Response"` -} - -func (r *PurchaseReservedInstancesOfferingResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *PurchaseReservedInstancesOfferingResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RebootInstancesRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 本参数已弃用,推荐使用StopType,不可以与参数StopType同时使用。表示是否在正常重启失败后选择强制重启实例。取值范围:
  • TRUE:表示在正常重启失败后进行强制重启
  • FALSE:表示在正常重启失败后不进行强制重启

    默认取值:FALSE。 - ForceReboot *bool `json:"ForceReboot,omitempty" name:"ForceReboot"` - - // 关机类型。取值范围:
  • SOFT:表示软关机
  • HARD:表示硬关机
  • SOFT_FIRST:表示优先软关机,失败再执行硬关机

    默认取值:SOFT。 - StopType *string `json:"StopType,omitempty" name:"StopType"` -} - -type RebootInstancesRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 本参数已弃用,推荐使用StopType,不可以与参数StopType同时使用。表示是否在正常重启失败后选择强制重启实例。取值范围:
  • TRUE:表示在正常重启失败后进行强制重启
  • FALSE:表示在正常重启失败后不进行强制重启

    默认取值:FALSE。 - ForceReboot *bool `json:"ForceReboot,omitempty" name:"ForceReboot"` - - // 关机类型。取值范围:
  • SOFT:表示软关机
  • HARD:表示硬关机
  • SOFT_FIRST:表示优先软关机,失败再执行硬关机

    默认取值:SOFT。 - StopType *string `json:"StopType,omitempty" name:"StopType"` -} - -func (r *RebootInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RebootInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "ForceReboot") - delete(f, "StopType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RebootInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RebootInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RebootInstancesResponse struct { - *tchttp.BaseResponse - Response *RebootInstancesResponseParams `json:"Response"` -} - -func (r *RebootInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RebootInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type RegionInfo struct { - // 地域名称,例如,ap-guangzhou - Region *string `json:"Region,omitempty" name:"Region"` - - // 地域描述,例如,华南地区(广州) - RegionName *string `json:"RegionName,omitempty" name:"RegionName"` - - // 地域是否可用状态 - RegionState *string `json:"RegionState,omitempty" name:"RegionState"` -} - -// Predefined struct for user -type RemoveChcAssistVpcRequestParams struct { - // CHC物理服务器Id。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` -} - -type RemoveChcAssistVpcRequest struct { - *tchttp.BaseRequest - - // CHC物理服务器Id。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` -} - -func (r *RemoveChcAssistVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveChcAssistVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ChcIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RemoveChcAssistVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RemoveChcAssistVpcResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RemoveChcAssistVpcResponse struct { - *tchttp.BaseResponse - Response *RemoveChcAssistVpcResponseParams `json:"Response"` -} - -func (r *RemoveChcAssistVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveChcAssistVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RemoveChcDeployVpcRequestParams struct { - // CHC物理服务器Id。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` -} - -type RemoveChcDeployVpcRequest struct { - *tchttp.BaseRequest - - // CHC物理服务器Id。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` -} - -func (r *RemoveChcDeployVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveChcDeployVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ChcIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RemoveChcDeployVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RemoveChcDeployVpcResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RemoveChcDeployVpcResponse struct { - *tchttp.BaseResponse - Response *RemoveChcDeployVpcResponseParams `json:"Response"` -} - -func (r *RemoveChcDeployVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveChcDeployVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RenewHostsRequestParams struct { - // 一个或多个待操作的CDH实例ID。每次请求的CDH实例的上限为100。 - HostIds []*string `json:"HostIds,omitempty" name:"HostIds"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - HostChargePrepaid *ChargePrepaid `json:"HostChargePrepaid,omitempty" name:"HostChargePrepaid"` -} - -type RenewHostsRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的CDH实例ID。每次请求的CDH实例的上限为100。 - HostIds []*string `json:"HostIds,omitempty" name:"HostIds"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - HostChargePrepaid *ChargePrepaid `json:"HostChargePrepaid,omitempty" name:"HostChargePrepaid"` -} - -func (r *RenewHostsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RenewHostsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HostIds") - delete(f, "HostChargePrepaid") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RenewHostsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RenewHostsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RenewHostsResponse struct { - *tchttp.BaseResponse - Response *RenewHostsResponseParams `json:"Response"` -} - -func (r *RenewHostsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RenewHostsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RenewInstancesRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。 - // 包年包月实例该参数为必传参数。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 是否续费弹性数据盘。取值范围:
  • TRUE:表示续费包年包月实例同时续费其挂载的弹性数据盘
  • FALSE:表示续费包年包月实例同时不再续费其挂载的弹性数据盘

    默认取值:TRUE。 - RenewPortableDataDisk *bool `json:"RenewPortableDataDisk,omitempty" name:"RenewPortableDataDisk"` -} - -type RenewInstancesRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。 - // 包年包月实例该参数为必传参数。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 是否续费弹性数据盘。取值范围:
  • TRUE:表示续费包年包月实例同时续费其挂载的弹性数据盘
  • FALSE:表示续费包年包月实例同时不再续费其挂载的弹性数据盘

    默认取值:TRUE。 - RenewPortableDataDisk *bool `json:"RenewPortableDataDisk,omitempty" name:"RenewPortableDataDisk"` -} - -func (r *RenewInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RenewInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InstanceChargePrepaid") - delete(f, "RenewPortableDataDisk") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RenewInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RenewInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RenewInstancesResponse struct { - *tchttp.BaseResponse - Response *RenewInstancesResponseParams `json:"Response"` -} - -func (r *RenewInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RenewInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RepairTaskControlRequestParams struct { - // 待授权任务实例对应的产品类型,支持取值: - // - // - `CVM`:云服务器 - // - `CDH`:专用宿主机 - // - `CPM2.0`:裸金属云服务器 - Product *string `json:"Product,omitempty" name:"Product"` - - // 指定待操作的实例ID列表,仅允许对列表中的实例ID相关的维修任务发起授权。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 维修任务ID。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 操作类型,当前只支持传入`AuthorizeRepair`。 - Operate *string `json:"Operate,omitempty" name:"Operate"` - - // 预约授权时间,形如`2023-01-01 12:00:00`。预约时间需晚于当前时间至少5分钟,且在48小时之内。 - OrderAuthTime *string `json:"OrderAuthTime,omitempty" name:"OrderAuthTime"` - - // 附加的授权处理策略。 - TaskSubMethod *string `json:"TaskSubMethod,omitempty" name:"TaskSubMethod"` -} - -type RepairTaskControlRequest struct { - *tchttp.BaseRequest - - // 待授权任务实例对应的产品类型,支持取值: - // - // - `CVM`:云服务器 - // - `CDH`:专用宿主机 - // - `CPM2.0`:裸金属云服务器 - Product *string `json:"Product,omitempty" name:"Product"` - - // 指定待操作的实例ID列表,仅允许对列表中的实例ID相关的维修任务发起授权。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 维修任务ID。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 操作类型,当前只支持传入`AuthorizeRepair`。 - Operate *string `json:"Operate,omitempty" name:"Operate"` - - // 预约授权时间,形如`2023-01-01 12:00:00`。预约时间需晚于当前时间至少5分钟,且在48小时之内。 - OrderAuthTime *string `json:"OrderAuthTime,omitempty" name:"OrderAuthTime"` - - // 附加的授权处理策略。 - TaskSubMethod *string `json:"TaskSubMethod,omitempty" name:"TaskSubMethod"` -} - -func (r *RepairTaskControlRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RepairTaskControlRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Product") - delete(f, "InstanceIds") - delete(f, "TaskId") - delete(f, "Operate") - delete(f, "OrderAuthTime") - delete(f, "TaskSubMethod") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RepairTaskControlRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RepairTaskControlResponseParams struct { - // 已完成授权的维修任务ID。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RepairTaskControlResponse struct { - *tchttp.BaseResponse - Response *RepairTaskControlResponseParams `json:"Response"` -} - -func (r *RepairTaskControlResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RepairTaskControlResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type RepairTaskInfo struct { - // 维修任务ID - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 实例ID - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例名称 - // 注意:此字段可能返回 null,表示取不到有效值。 - Alias *string `json:"Alias,omitempty" name:"Alias"` - - // 任务类型ID,与任务类型中文名的对应关系如下: - // - // - `101`:实例运行隐患 - // - `102`:实例运行异常 - // - `103`:实例硬盘异常 - // - `104`:实例网络连接异常 - // - `105`:实例运行预警 - // - `106`:实例硬盘预警 - // - `107`:实例维护升级 - // - // 各任务类型的具体含义,可参考 [维修任务分类](https://cloud.tencent.com/document/product/213/67789#.E7.BB.B4.E4.BF.AE.E4.BB.BB.E5.8A.A1.E5.88.86.E7.B1.BB)。 - TaskTypeId *uint64 `json:"TaskTypeId,omitempty" name:"TaskTypeId"` - - // 任务类型中文名 - TaskTypeName *string `json:"TaskTypeName,omitempty" name:"TaskTypeName"` - - // 任务状态ID,与任务状态中文名的对应关系如下: - // - // - `1`:待授权 - // - `2`:处理中 - // - `3`:已结束 - // - `4`:已预约 - // - `5`:已取消 - // - `6`:已避免 - // - // 各任务状态的具体含义,可参考 [任务状态](https://cloud.tencent.com/document/product/213/67789#.E4.BB.BB.E5.8A.A1.E7.8A.B6.E6.80.81)。 - TaskStatus *uint64 `json:"TaskStatus,omitempty" name:"TaskStatus"` - - // 设备状态ID,与设备状态中文名的对应关系如下: - // - // - `1`:故障中 - // - `2`:处理中 - // - `3`:正常 - // - `4`:已预约 - // - `5`:已取消 - // - `6`:已避免 - DeviceStatus *uint64 `json:"DeviceStatus,omitempty" name:"DeviceStatus"` - - // 操作状态ID,与操作状态中文名的对应关系如下: - // - // - `1`:未授权 - // - `2`:已授权 - // - `3`:已处理 - // - `4`:已预约 - // - `5`:已取消 - // - `6`:已避免 - OperateStatus *uint64 `json:"OperateStatus,omitempty" name:"OperateStatus"` - - // 任务创建时间 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 任务授权时间 - // 注意:此字段可能返回 null,表示取不到有效值。 - AuthTime *string `json:"AuthTime,omitempty" name:"AuthTime"` - - // 任务结束时间 - // 注意:此字段可能返回 null,表示取不到有效值。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 任务详情 - // 注意:此字段可能返回 null,表示取不到有效值。 - TaskDetail *string `json:"TaskDetail,omitempty" name:"TaskDetail"` - - // 可用区 - // 注意:此字段可能返回 null,表示取不到有效值。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 地域 - // 注意:此字段可能返回 null,表示取不到有效值。 - Region *string `json:"Region,omitempty" name:"Region"` - - // 所在私有网络ID - // 注意:此字段可能返回 null,表示取不到有效值。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 所在私有网络名称 - // 注意:此字段可能返回 null,表示取不到有效值。 - VpcName *string `json:"VpcName,omitempty" name:"VpcName"` - - // 所在子网ID - // 注意:此字段可能返回 null,表示取不到有效值。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 所在子网名称 - // 注意:此字段可能返回 null,表示取不到有效值。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 实例公网IP - // 注意:此字段可能返回 null,表示取不到有效值。 - WanIp *string `json:"WanIp,omitempty" name:"WanIp"` - - // 实例内网IP - // 注意:此字段可能返回 null,表示取不到有效值。 - LanIp *string `json:"LanIp,omitempty" name:"LanIp"` - - // 产品类型,支持取值: - // - // - `CVM`:云服务器 - // - `CDH`:专用宿主机 - // - `CPM2.0`:裸金属云服务器 - // 注意:此字段可能返回 null,表示取不到有效值。 - Product *string `json:"Product,omitempty" name:"Product"` - - // 任务子类型 - // 注意:此字段可能返回 null,表示取不到有效值。 - TaskSubType *string `json:"TaskSubType,omitempty" name:"TaskSubType"` - - // 任务授权类型 - AuthType *uint64 `json:"AuthType,omitempty" name:"AuthType"` - - // 授权渠道,支持取值: - // - // - `Waiting_auth`:待授权 - // - `Customer_auth`:客户操作授权 - // - `System_mandatory_auth`:系统默认授权 - // - `Pre_policy_auth`:预置策略授权 - AuthSource *string `json:"AuthSource,omitempty" name:"AuthSource"` -} - -type ReservedInstanceConfigInfoItem struct { - // 实例规格。 - Type *string `json:"Type,omitempty" name:"Type"` - - // 实例规格名称。 - TypeName *string `json:"TypeName,omitempty" name:"TypeName"` - - // 优先级。 - Order *int64 `json:"Order,omitempty" name:"Order"` - - // 实例族信息列表。 - InstanceFamilies []*ReservedInstanceFamilyItem `json:"InstanceFamilies,omitempty" name:"InstanceFamilies"` -} - -type ReservedInstanceFamilyItem struct { - // 实例族。 - InstanceFamily *string `json:"InstanceFamily,omitempty" name:"InstanceFamily"` - - // 优先级。 - Order *int64 `json:"Order,omitempty" name:"Order"` - - // 实例类型信息列表。 - InstanceTypes []*ReservedInstanceTypeItem `json:"InstanceTypes,omitempty" name:"InstanceTypes"` -} - -type ReservedInstancePrice struct { - // 预支合计费用的原价,单位:元。 - OriginalFixedPrice *float64 `json:"OriginalFixedPrice,omitempty" name:"OriginalFixedPrice"` - - // 预支合计费用的折扣价,单位:元。 - DiscountFixedPrice *float64 `json:"DiscountFixedPrice,omitempty" name:"DiscountFixedPrice"` - - // 后续合计费用的原价,单位:元/小时 - OriginalUsagePrice *float64 `json:"OriginalUsagePrice,omitempty" name:"OriginalUsagePrice"` - - // 后续合计费用的折扣价,单位:元/小时 - DiscountUsagePrice *float64 `json:"DiscountUsagePrice,omitempty" name:"DiscountUsagePrice"` -} - -type ReservedInstancePriceItem struct { - // 付费类型,如:"All Upfront","Partial Upfront","No Upfront" - OfferingType *string `json:"OfferingType,omitempty" name:"OfferingType"` - - // 预支合计费用,单位:元。 - FixedPrice *float64 `json:"FixedPrice,omitempty" name:"FixedPrice"` - - // 后续合计费用,单位:元/小时 - UsagePrice *float64 `json:"UsagePrice,omitempty" name:"UsagePrice"` - - // 预留实例配置ID - ReservedInstancesOfferingId *string `json:"ReservedInstancesOfferingId,omitempty" name:"ReservedInstancesOfferingId"` - - // 预留实例计费可购买的可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 预留实例计费【有效期】即预留实例计费购买时长。形如:31536000。 - // 计量单位:秒 - Duration *uint64 `json:"Duration,omitempty" name:"Duration"` - - // 预留实例计费的平台描述(即操作系统)。形如:Linux。 - // 返回项: Linux 。 - ProductDescription *string `json:"ProductDescription,omitempty" name:"ProductDescription"` -} - -type ReservedInstanceTypeItem struct { - // 实例类型。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // CPU核数。 - Cpu *uint64 `json:"Cpu,omitempty" name:"Cpu"` - - // 内存大小。 - Memory *uint64 `json:"Memory,omitempty" name:"Memory"` - - // GPU数量。 - Gpu *uint64 `json:"Gpu,omitempty" name:"Gpu"` - - // FPGA数量。 - Fpga *uint64 `json:"Fpga,omitempty" name:"Fpga"` - - // 本地存储块数量。 - StorageBlock *uint64 `json:"StorageBlock,omitempty" name:"StorageBlock"` - - // 网卡数。 - NetworkCard *uint64 `json:"NetworkCard,omitempty" name:"NetworkCard"` - - // 最大带宽。 - MaxBandwidth *float64 `json:"MaxBandwidth,omitempty" name:"MaxBandwidth"` - - // 主频。 - Frequency *string `json:"Frequency,omitempty" name:"Frequency"` - - // CPU型号名称。 - CpuModelName *string `json:"CpuModelName,omitempty" name:"CpuModelName"` - - // 包转发率。 - Pps *uint64 `json:"Pps,omitempty" name:"Pps"` - - // 外部信息。 - Externals *Externals `json:"Externals,omitempty" name:"Externals"` - - // 备注信息。 - Remark *string `json:"Remark,omitempty" name:"Remark"` - - // 预留实例配置价格信息。 - Prices []*ReservedInstancePriceItem `json:"Prices,omitempty" name:"Prices"` -} - -type ReservedInstances struct { - // (此字段已废弃,建议使用字段:ReservedInstanceId)已购买的预留实例计费ID。形如:ri-rtbh4han。 - ReservedInstancesId *string `json:"ReservedInstancesId,omitempty" name:"ReservedInstancesId"` - - // 预留实例计费的规格。形如:S3.MEDIUM4。 - // 返回项:预留实例计费规格列表 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 预留实例计费可购买的可用区。形如:ap-guangzhou-1。 - // 返回项:可用区列表 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 预留实例计费开始时间。形如:1949-10-01 00:00:00 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 预留实例计费到期时间。形如:1949-10-01 00:00:00 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 预留实例计费【有效期】即预留实例计费购买时长。形如:31536000。 - // 计量单位:秒。 - Duration *int64 `json:"Duration,omitempty" name:"Duration"` - - // 已购买的预留实例计费个数。形如:10。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 描述预留实例计费的平台描述(即操作系统)。形如:linux。 - // 返回项: linux 。 - ProductDescription *string `json:"ProductDescription,omitempty" name:"ProductDescription"` - - // 预留实例计费购买的状态。形如:active - // 返回项: active (以创建) | pending (等待被创建) | retired (过期)。 - State *string `json:"State,omitempty" name:"State"` - - // 可购买的预留实例计费类型的结算货币,使用ISO 4217标准货币代码。形如:USD。 - // 返回项:USD(美元)。 - CurrencyCode *string `json:"CurrencyCode,omitempty" name:"CurrencyCode"` - - // 预留实例计费的付款类型。形如:All Upfront。 - // 返回项: All Upfront (预付全部费用)。 - OfferingType *string `json:"OfferingType,omitempty" name:"OfferingType"` - - // 预留实例计费的类型。形如:S3。 - // 返回项:预留实例计费类型列表 - InstanceFamily *string `json:"InstanceFamily,omitempty" name:"InstanceFamily"` - - // 已购买的预留实例计费ID。形如:ri-rtbh4han。 - ReservedInstanceId *string `json:"ReservedInstanceId,omitempty" name:"ReservedInstanceId"` - - // 预留实例显示名称。形如:riname-01 - ReservedInstanceName *string `json:"ReservedInstanceName,omitempty" name:"ReservedInstanceName"` -} - -type ReservedInstancesOffering struct { - // 预留实例计费可购买的可用区。形如:ap-guangzhou-1。 - // 返回项:可用区列表 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 可购买的预留实例计费类型的结算货币,使用ISO 4217标准货币代码。 - // 返回项:USD(美元)。 - CurrencyCode *string `json:"CurrencyCode,omitempty" name:"CurrencyCode"` - - // 预留实例计费【有效期】即预留实例计费购买时长。形如:31536000。 - // 计量单位:秒 - Duration *int64 `json:"Duration,omitempty" name:"Duration"` - - // 预留实例计费的购买价格。形如:4000.0。 - // 计量单位:与 currencyCode 一致,目前支持 USD(美元) - FixedPrice *float64 `json:"FixedPrice,omitempty" name:"FixedPrice"` - - // 预留实例计费的实例类型。形如:S3.MEDIUM4。 - // 返回项:预留实例计费类型列表 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 预留实例计费的付款类型。形如:All Upfront。 - // 返回项: All Upfront (预付全部费用)。 - OfferingType *string `json:"OfferingType,omitempty" name:"OfferingType"` - - // 可购买的预留实例计费配置ID。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。 - ReservedInstancesOfferingId *string `json:"ReservedInstancesOfferingId,omitempty" name:"ReservedInstancesOfferingId"` - - // 预留实例计费的平台描述(即操作系统)。形如:linux。 - // 返回项: linux 。 - ProductDescription *string `json:"ProductDescription,omitempty" name:"ProductDescription"` - - // 扣除预付费之后的使用价格 (按小时计费)。形如:0.0。 - // 目前,因为只支持 All Upfront 付款类型,所以默认为 0元/小时。 - // 计量单位:元/小时,货币单位与 currencyCode 一致,目前支持 USD(美元) - UsagePrice *float64 `json:"UsagePrice,omitempty" name:"UsagePrice"` -} - -// Predefined struct for user -type ResetInstanceRequestParams struct { - // 实例ID。可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - //
    默认取值:默认使用当前镜像。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例系统盘配置信息。系统盘为云盘的实例可以通过该参数指定重装后的系统盘大小来实现对系统盘的扩容操作。系统盘大小只支持扩容不支持缩容;重装只支持修改系统盘的大小,不能修改系统盘的类型。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 重装系统时,可以指定修改实例的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:主机名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:主机名字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 - UserData *string `json:"UserData,omitempty" name:"UserData"` -} - -type ResetInstanceRequest struct { - *tchttp.BaseRequest - - // 实例ID。可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。
  • - //
    默认取值:默认使用当前镜像。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例系统盘配置信息。系统盘为云盘的实例可以通过该参数指定重装后的系统盘大小来实现对系统盘的扩容操作。系统盘大小只支持扩容不支持缩容;重装只支持修改系统盘的大小,不能修改系统盘的类型。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 重装系统时,可以指定修改实例的主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:主机名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:主机名字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 - UserData *string `json:"UserData,omitempty" name:"UserData"` -} - -func (r *ResetInstanceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetInstanceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - delete(f, "ImageId") - delete(f, "SystemDisk") - delete(f, "LoginSettings") - delete(f, "EnhancedService") - delete(f, "HostName") - delete(f, "UserData") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetInstanceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetInstanceResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetInstanceResponse struct { - *tchttp.BaseResponse - Response *ResetInstanceResponseParams `json:"Response"` -} - -func (r *ResetInstanceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetInstanceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetInstancesInternetMaxBandwidthRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/9388)接口返回值中的 `InstanceId` 获取。 每次请求批量实例的上限为100。当调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽时,只支持一个实例。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 公网出带宽配置。不同机型带宽上限范围不一致,具体限制详见带宽限制对账表。暂时只支持 `InternetMaxBandwidthOut` 参数。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 带宽生效的起始时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。起始时间不能早于当前时间。如果起始时间是今天则新设置的带宽立即生效。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 带宽生效的终止时间。格式: `YYYY-MM-DD` ,例如:`2016-10-30` 。新设置的带宽的有效期包含终止时间此日期。终止时间不能晚于包年包月实例的到期时间。实例的到期时间可通过 [`DescribeInstances`](https://cloud.tencent.com/document/api/213/9388)接口返回值中的`ExpiredTime`获取。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -type ResetInstancesInternetMaxBandwidthRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/9388)接口返回值中的 `InstanceId` 获取。 每次请求批量实例的上限为100。当调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽时,只支持一个实例。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 公网出带宽配置。不同机型带宽上限范围不一致,具体限制详见带宽限制对账表。暂时只支持 `InternetMaxBandwidthOut` 参数。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 带宽生效的起始时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。起始时间不能早于当前时间。如果起始时间是今天则新设置的带宽立即生效。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 带宽生效的终止时间。格式: `YYYY-MM-DD` ,例如:`2016-10-30` 。新设置的带宽的有效期包含终止时间此日期。终止时间不能晚于包年包月实例的到期时间。实例的到期时间可通过 [`DescribeInstances`](https://cloud.tencent.com/document/api/213/9388)接口返回值中的`ExpiredTime`获取。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -func (r *ResetInstancesInternetMaxBandwidthRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetInstancesInternetMaxBandwidthRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InternetAccessible") - delete(f, "StartTime") - delete(f, "EndTime") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetInstancesInternetMaxBandwidthRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetInstancesInternetMaxBandwidthResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetInstancesInternetMaxBandwidthResponse struct { - *tchttp.BaseResponse - Response *ResetInstancesInternetMaxBandwidthResponseParams `json:"Response"` -} - -func (r *ResetInstancesInternetMaxBandwidthResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetInstancesInternetMaxBandwidthResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetInstancesPasswordRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例登录密码。不同操作系统类型密码复杂度限制不一样,具体如下: - // Linux 实例密码必须8-30位,推荐使用12位以上密码,不能以“/”开头,至少包含以下字符中的三种不同字符,字符种类:
  • 小写字母:[a-z]
  • 大写字母:[A-Z]
  • 数字:0-9
  • 特殊字符: ()\`\~!@#$%^&\*-+=\_|{}[]:;'<>,.?/ - // Windows 实例密码必须12\~30位,不能以“/”开头且不包括用户名,至少包含以下字符中的三种不同字符
  • 小写字母:[a-z]
  • 大写字母:[A-Z]
  • 数字: 0-9
  • 特殊字符:()\`\~!@#$%^&\*-+=\_|{}[]:;' <>,.?/
  • 如果实例即包含 `Linux` 实例又包含 `Windows` 实例,则密码复杂度限制按照 `Windows` 实例的限制。 - Password *string `json:"Password,omitempty" name:"Password"` - - // 待重置密码的实例操作系统的用户名。不得超过64个字符。 - UserName *string `json:"UserName,omitempty" name:"UserName"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机
  • FALSE:表示在正常关机失败后不进行强制关机

    默认取值:FALSE。

    强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -type ResetInstancesPasswordRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例登录密码。不同操作系统类型密码复杂度限制不一样,具体如下: - // Linux 实例密码必须8-30位,推荐使用12位以上密码,不能以“/”开头,至少包含以下字符中的三种不同字符,字符种类:
  • 小写字母:[a-z]
  • 大写字母:[A-Z]
  • 数字:0-9
  • 特殊字符: ()\`\~!@#$%^&\*-+=\_|{}[]:;'<>,.?/ - // Windows 实例密码必须12\~30位,不能以“/”开头且不包括用户名,至少包含以下字符中的三种不同字符
  • 小写字母:[a-z]
  • 大写字母:[A-Z]
  • 数字: 0-9
  • 特殊字符:()\`\~!@#$%^&\*-+=\_|{}[]:;' <>,.?/
  • 如果实例即包含 `Linux` 实例又包含 `Windows` 实例,则密码复杂度限制按照 `Windows` 实例的限制。 - Password *string `json:"Password,omitempty" name:"Password"` - - // 待重置密码的实例操作系统的用户名。不得超过64个字符。 - UserName *string `json:"UserName,omitempty" name:"UserName"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机
  • FALSE:表示在正常关机失败后不进行强制关机

    默认取值:FALSE。

    强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -func (r *ResetInstancesPasswordRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetInstancesPasswordRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "Password") - delete(f, "UserName") - delete(f, "ForceStop") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetInstancesPasswordRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetInstancesPasswordResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetInstancesPasswordResponse struct { - *tchttp.BaseResponse - Response *ResetInstancesPasswordResponseParams `json:"Response"` -} - -func (r *ResetInstancesPasswordResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetInstancesPasswordResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetInstancesTypeRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。本接口目前仅支持每次操作1个实例。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例机型。不同实例机型指定了不同的资源规格,具体取值可通过调用接口[`DescribeInstanceTypeConfigs`](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例类型](https://cloud.tencent.com/document/product/213/11518)描述。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机
  • FALSE:表示在正常关机失败后不进行强制关机

    默认取值:FALSE。

    强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -type ResetInstancesTypeRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。本接口目前仅支持每次操作1个实例。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 实例机型。不同实例机型指定了不同的资源规格,具体取值可通过调用接口[`DescribeInstanceTypeConfigs`](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例类型](https://cloud.tencent.com/document/product/213/11518)描述。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机
  • FALSE:表示在正常关机失败后不进行强制关机

    默认取值:FALSE。

    强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` -} - -func (r *ResetInstancesTypeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetInstancesTypeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "InstanceType") - delete(f, "ForceStop") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetInstancesTypeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetInstancesTypeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetInstancesTypeResponse struct { - *tchttp.BaseResponse - Response *ResetInstancesTypeResponseParams `json:"Response"` -} - -func (r *ResetInstancesTypeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetInstancesTypeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResizeInstanceDisksRequestParams struct { - // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 待扩容的数据盘配置信息。只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](/document/api/213/9452#block_device)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。数据盘容量单位:GB。最小扩容步长:10G。关于数据盘类型的选择请参考[硬盘产品简介](https://cloud.tencent.com/document/product/362/2353)。可选数据盘类型受到实例类型`InstanceType`限制。另外允许扩容的最大容量也因数据盘类型的不同而有所差异。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机
  • FALSE:表示在正常关机失败后不进行强制关机

    默认取值:FALSE。

    强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` - - // 待扩容的系统盘配置信息。只支持扩容云盘。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 扩容云盘的方式是否为在线扩容。 - ResizeOnline *bool `json:"ResizeOnline,omitempty" name:"ResizeOnline"` -} - -type ResizeInstanceDisksRequest struct { - *tchttp.BaseRequest - - // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 待扩容的数据盘配置信息。只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](/document/api/213/9452#block_device)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。数据盘容量单位:GB。最小扩容步长:10G。关于数据盘类型的选择请参考[硬盘产品简介](https://cloud.tencent.com/document/product/362/2353)。可选数据盘类型受到实例类型`InstanceType`限制。另外允许扩容的最大容量也因数据盘类型的不同而有所差异。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:
  • TRUE:表示在正常关机失败后进行强制关机
  • FALSE:表示在正常关机失败后不进行强制关机

    默认取值:FALSE。

    强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` - - // 待扩容的系统盘配置信息。只支持扩容云盘。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 扩容云盘的方式是否为在线扩容。 - ResizeOnline *bool `json:"ResizeOnline,omitempty" name:"ResizeOnline"` -} - -func (r *ResizeInstanceDisksRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResizeInstanceDisksRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - delete(f, "DataDisks") - delete(f, "ForceStop") - delete(f, "SystemDisk") - delete(f, "ResizeOnline") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResizeInstanceDisksRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResizeInstanceDisksResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResizeInstanceDisksResponse struct { - *tchttp.BaseResponse - Response *ResizeInstanceDisksResponseParams `json:"Response"` -} - -func (r *ResizeInstanceDisksResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResizeInstanceDisksResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type RunAutomationServiceEnabled struct { - // 是否开启云自动化助手。取值范围:
  • TRUE:表示开启云自动化助手服务
  • FALSE:表示不开启云自动化助手服务

    默认取值:FALSE。 - Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` -} - -// Predefined struct for user -type RunInstancesRequestParams struct { - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • CDHPAID:独享子机(基于专用宿主机创建,宿主机部分的资源不收费)
  • SPOTPAID:竞价付费
  • CDCPAID:专用集群付费
    默认值:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 - // 注:如果您不指定LaunchTemplate参数,则Placement为必选参数。若同时传递Placement和LaunchTemplate,则默认覆盖LaunchTemplate中对应的Placement的值。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 实例机型。不同实例机型指定了不同的资源规格。 - //
  • 对于付费模式为PREPAID或POSTPAID\_BY\_HOUR的实例创建,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则系统将根据当前地域的资源售卖情况动态指定默认机型。
  • 对于付费模式为CDHPAID的实例创建,该参数以"CDH_"为前缀,根据CPU和内存配置生成,具体形式为:CDH_XCXG,例如对于创建CPU为1核,内存为1G大小的专用宿主机的实例,该参数应该为CDH_1C1G。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,传入InstanceType获取当前机型支持的镜像列表,取返回信息中的`ImageId`字段。
  • - // 注:如果您不指定LaunchTemplate参数,则ImageId为必选参数。若同时传递ImageId和LaunchTemplate,则默认覆盖LaunchTemplate中对应的ImageId的值。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若在此参数中指定了私有网络IP,即表示每个实例的主网卡IP;同时,InstanceCount参数必须与私有网络IP的个数一致且不能大于20。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 购买实例数量。包年包月实例取值范围:[1,500],按量计费实例取值范围:[1,500]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。
  • 购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。
  • 最多支持60个字符(包含模式串)。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认公共镜像开启云监控、云安全服务;自定义镜像与镜像市场镜像默认不开启云监控,云安全服务,而使用镜像里保留的服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 实例主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:主机名名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:主机名字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server{R:3}`,购买1台时,实例主机名为`server3`;购买2台时,实例主机名分别为`server3`,`server4`。支持指定多个模式串`{R:x}`。

  • 购买多台实例,如果不指定模式串,则在实例主机名添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server`,购买2台时,实例主机名分别为`server1`,`server2`。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 定时任务。通过该参数可以为实例指定定时任务,目前仅支持定时销毁。 - ActionTimer *ActionTimer `json:"ActionTimer,omitempty" name:"ActionTimer"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的云服务器、云硬盘实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费但没有传递该参数时,默认按当前固定折扣价格出价。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 是否只预检此次请求。 - // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 - // 如果检查不通过,则返回对应错误码; - // 如果检查通过,则返回RequestId. - // false(默认):发送正常请求,通过检查后直接创建实例 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // CAM角色名称。可通过[`DescribeRoleList`](https://cloud.tencent.com/document/product/598/13887)接口返回值中的`roleName`获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群ID。若创建的实例为高性能计算实例,需指定实例放置的集群,否则不可指定。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 实例启动模板。 - LaunchTemplate *LaunchTemplate `json:"LaunchTemplate,omitempty" name:"LaunchTemplate"` - - // 指定专用集群创建。 - DedicatedClusterId *string `json:"DedicatedClusterId,omitempty" name:"DedicatedClusterId"` - - // 指定CHC物理服务器来创建CHC云主机。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` -} - -type RunInstancesRequest struct { - *tchttp.BaseRequest - - // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。
  • PREPAID:预付费,即包年包月
  • POSTPAID_BY_HOUR:按小时后付费
  • CDHPAID:独享子机(基于专用宿主机创建,宿主机部分的资源不收费)
  • SPOTPAID:竞价付费
  • CDCPAID:专用集群付费
    默认值:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 - // 注:如果您不指定LaunchTemplate参数,则Placement为必选参数。若同时传递Placement和LaunchTemplate,则默认覆盖LaunchTemplate中对应的Placement的值。 - Placement *Placement `json:"Placement,omitempty" name:"Placement"` - - // 实例机型。不同实例机型指定了不同的资源规格。 - //
  • 对于付费模式为PREPAID或POSTPAID\_BY\_HOUR的实例创建,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则系统将根据当前地域的资源售卖情况动态指定默认机型。
  • 对于付费模式为CDHPAID的实例创建,该参数以"CDH_"为前缀,根据CPU和内存配置生成,具体形式为:CDH_XCXG,例如对于创建CPU为1核,内存为1G大小的专用宿主机的实例,该参数应该为CDH_1C1G。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:
  • 公共镜像
  • 自定义镜像
  • 共享镜像
  • 服务市场镜像

  • 可通过以下方式获取可用的镜像ID:
  • `公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。
  • 通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,传入InstanceType获取当前机型支持的镜像列表,取返回信息中的`ImageId`字段。
  • - // 注:如果您不指定LaunchTemplate参数,则ImageId为必选参数。若同时传递ImageId和LaunchTemplate,则默认覆盖LaunchTemplate中对应的ImageId的值。 - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 - SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` - - // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 - DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks"` - - // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若在此参数中指定了私有网络IP,即表示每个实例的主网卡IP;同时,InstanceCount参数必须与私有网络IP的个数一致且不能大于20。 - VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` - - // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 - InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` - - // 购买实例数量。包年包月实例取值范围:[1,500],按量计费实例取值范围:[1,500]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 - InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 实例显示名称。
  • 不指定实例显示名称则默认显示‘未命名’。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。
  • 购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。
  • 最多支持60个字符(包含模式串)。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 - LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` - - // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认公共镜像开启云监控、云安全服务;自定义镜像与镜像市场镜像默认不开启云监控,云安全服务,而使用镜像里保留的服务。 - EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` - - // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` - - // 实例主机名。
  • 点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。
  • Windows 实例:主机名名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。
  • 其他类型(Linux 等)实例:主机名字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。
  • 购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server{R:3}`,购买1台时,实例主机名为`server3`;购买2台时,实例主机名分别为`server3`,`server4`。支持指定多个模式串`{R:x}`。

  • 购买多台实例,如果不指定模式串,则在实例主机名添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server`,购买2台时,实例主机名分别为`server1`,`server2`。 - HostName *string `json:"HostName,omitempty" name:"HostName"` - - // 定时任务。通过该参数可以为实例指定定时任务,目前仅支持定时销毁。 - ActionTimer *ActionTimer `json:"ActionTimer,omitempty" name:"ActionTimer"` - - // 置放群组id,仅支持指定一个。 - DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds"` - - // 标签描述列表。通过指定该参数可以同时绑定标签到相应的云服务器、云硬盘实例。 - TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification"` - - // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费但没有传递该参数时,默认按当前固定折扣价格出价。 - InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` - - // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 - UserData *string `json:"UserData,omitempty" name:"UserData"` - - // 是否只预检此次请求。 - // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 - // 如果检查不通过,则返回对应错误码; - // 如果检查通过,则返回RequestId. - // false(默认):发送正常请求,通过检查后直接创建实例 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // CAM角色名称。可通过[`DescribeRoleList`](https://cloud.tencent.com/document/product/598/13887)接口返回值中的`roleName`获取。 - CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` - - // 高性能计算集群ID。若创建的实例为高性能计算实例,需指定实例放置的集群,否则不可指定。 - HpcClusterId *string `json:"HpcClusterId,omitempty" name:"HpcClusterId"` - - // 实例启动模板。 - LaunchTemplate *LaunchTemplate `json:"LaunchTemplate,omitempty" name:"LaunchTemplate"` - - // 指定专用集群创建。 - DedicatedClusterId *string `json:"DedicatedClusterId,omitempty" name:"DedicatedClusterId"` - - // 指定CHC物理服务器来创建CHC云主机。 - ChcIds []*string `json:"ChcIds,omitempty" name:"ChcIds"` - - // 实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围:
  • TRUE:表示开启实例保护,不允许通过api接口删除实例
  • FALSE:表示关闭实例保护,允许通过api接口删除实例

    默认取值:FALSE。 - DisableApiTermination *bool `json:"DisableApiTermination,omitempty" name:"DisableApiTermination"` -} - -func (r *RunInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RunInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "Placement") - delete(f, "InstanceType") - delete(f, "ImageId") - delete(f, "SystemDisk") - delete(f, "DataDisks") - delete(f, "VirtualPrivateCloud") - delete(f, "InternetAccessible") - delete(f, "InstanceCount") - delete(f, "InstanceName") - delete(f, "LoginSettings") - delete(f, "SecurityGroupIds") - delete(f, "EnhancedService") - delete(f, "ClientToken") - delete(f, "HostName") - delete(f, "ActionTimer") - delete(f, "DisasterRecoverGroupIds") - delete(f, "TagSpecification") - delete(f, "InstanceMarketOptions") - delete(f, "UserData") - delete(f, "DryRun") - delete(f, "CamRoleName") - delete(f, "HpcClusterId") - delete(f, "LaunchTemplate") - delete(f, "DedicatedClusterId") - delete(f, "ChcIds") - delete(f, "DisableApiTermination") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RunInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RunInstancesResponseParams struct { - // 当通过本接口来创建实例时会返回该参数,表示一个或多个实例`ID`。返回实例`ID`列表并不代表实例创建成功,可根据 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) 接口查询返回的InstancesSet中对应实例的`ID`的状态来判断创建是否完成;如果实例状态由“PENDING(创建中)”变为“RUNNING(运行中)”,则为创建成功。 - InstanceIdSet []*string `json:"InstanceIdSet,omitempty" name:"InstanceIdSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RunInstancesResponse struct { - *tchttp.BaseResponse - Response *RunInstancesResponseParams `json:"Response"` -} - -func (r *RunInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RunInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type RunMonitorServiceEnabled struct { - // 是否开启[云监控](/document/product/248)服务。取值范围:
  • TRUE:表示开启云监控服务
  • FALSE:表示不开启云监控服务

    默认取值:TRUE。 - Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` -} - -type RunSecurityServiceEnabled struct { - // 是否开启[云安全](/document/product/296)服务。取值范围:
  • TRUE:表示开启云安全服务
  • FALSE:表示不开启云安全服务

    默认取值:TRUE。 - Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` -} - -type SharePermission struct { - // 镜像分享时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 镜像分享的账户ID - AccountId *string `json:"AccountId,omitempty" name:"AccountId"` -} - -type Snapshot struct { - // 快照Id。 - SnapshotId *string `json:"SnapshotId,omitempty" name:"SnapshotId"` - - // 创建此快照的云硬盘类型。取值范围: - // SYSTEM_DISK:系统盘 - // DATA_DISK:数据盘。 - DiskUsage *string `json:"DiskUsage,omitempty" name:"DiskUsage"` - - // 创建此快照的云硬盘大小,单位GB。 - DiskSize *int64 `json:"DiskSize,omitempty" name:"DiskSize"` -} - -type SpotMarketOptions struct { - // 竞价出价 - MaxPrice *string `json:"MaxPrice,omitempty" name:"MaxPrice"` - - // 竞价请求类型,当前仅支持类型:one-time - SpotInstanceType *string `json:"SpotInstanceType,omitempty" name:"SpotInstanceType"` -} - -type SpotPaidQuota struct { - // 已使用配额,单位:vCPU核心数 - UsedQuota *uint64 `json:"UsedQuota,omitempty" name:"UsedQuota"` - - // 剩余配额,单位:vCPU核心数 - RemainingQuota *uint64 `json:"RemainingQuota,omitempty" name:"RemainingQuota"` - - // 总配额,单位:vCPU核心数 - TotalQuota *uint64 `json:"TotalQuota,omitempty" name:"TotalQuota"` - - // 可用区 - Zone *string `json:"Zone,omitempty" name:"Zone"` -} - -// Predefined struct for user -type StartInstancesRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type StartInstancesRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *StartInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *StartInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "StartInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type StartInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type StartInstancesResponse struct { - *tchttp.BaseResponse - Response *StartInstancesResponseParams `json:"Response"` -} - -func (r *StartInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *StartInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type StopInstancesRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 本参数已弃用,推荐使用StopType,不可以与参数StopType同时使用。表示是否在正常关闭失败后选择强制关闭实例。取值范围:
  • TRUE:表示在正常关闭失败后进行强制关闭
  • FALSE:表示在正常关闭失败后不进行强制关闭

    默认取值:FALSE。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` - - // 实例的关闭模式。取值范围:
  • SOFT_FIRST:表示在正常关闭失败后进行强制关闭
  • HARD:直接强制关闭
  • SOFT:仅软关机
    默认取值:SOFT。 - StopType *string `json:"StopType,omitempty" name:"StopType"` - - // 按量计费实例关机收费模式。 - // 取值范围:
  • KEEP_CHARGING:关机继续收费
  • STOP_CHARGING:关机停止收费
    默认取值:KEEP_CHARGING。 - // 该参数只针对部分按量计费云硬盘实例生效,详情参考[按量计费实例关机不收费说明](https://cloud.tencent.com/document/product/213/19918) - StoppedMode *string `json:"StoppedMode,omitempty" name:"StoppedMode"` -} - -type StopInstancesRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 本参数已弃用,推荐使用StopType,不可以与参数StopType同时使用。表示是否在正常关闭失败后选择强制关闭实例。取值范围:
  • TRUE:表示在正常关闭失败后进行强制关闭
  • FALSE:表示在正常关闭失败后不进行强制关闭

    默认取值:FALSE。 - ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` - - // 实例的关闭模式。取值范围:
  • SOFT_FIRST:表示在正常关闭失败后进行强制关闭
  • HARD:直接强制关闭
  • SOFT:仅软关机
    默认取值:SOFT。 - StopType *string `json:"StopType,omitempty" name:"StopType"` - - // 按量计费实例关机收费模式。 - // 取值范围:
  • KEEP_CHARGING:关机继续收费
  • STOP_CHARGING:关机停止收费
    默认取值:KEEP_CHARGING。 - // 该参数只针对部分按量计费云硬盘实例生效,详情参考[按量计费实例关机不收费说明](https://cloud.tencent.com/document/product/213/19918) - StoppedMode *string `json:"StoppedMode,omitempty" name:"StoppedMode"` -} - -func (r *StopInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *StopInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "ForceStop") - delete(f, "StopType") - delete(f, "StoppedMode") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "StopInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type StopInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type StopInstancesResponse struct { - *tchttp.BaseResponse - Response *StopInstancesResponseParams `json:"Response"` -} - -func (r *StopInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *StopInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type StorageBlock struct { - // HDD本地存储类型,值为:LOCAL_PRO. - // 注意:此字段可能返回 null,表示取不到有效值。 - Type *string `json:"Type,omitempty" name:"Type"` - - // HDD本地存储的最小容量 - // 注意:此字段可能返回 null,表示取不到有效值。 - MinSize *int64 `json:"MinSize,omitempty" name:"MinSize"` - - // HDD本地存储的最大容量 - // 注意:此字段可能返回 null,表示取不到有效值。 - MaxSize *int64 `json:"MaxSize,omitempty" name:"MaxSize"` -} - -type SyncImage struct { - // 镜像ID - ImageId *string `json:"ImageId,omitempty" name:"ImageId"` - - // 地域 - Region *string `json:"Region,omitempty" name:"Region"` -} - -// Predefined struct for user -type SyncImagesRequestParams struct { - // 镜像ID列表 ,镜像ID可以通过如下方式获取:
  • 通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。
  • 通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。
    镜像ID必须满足限制:
  • 镜像ID对应的镜像状态必须为`NORMAL`。
    镜像状态请参考[镜像数据表](https://cloud.tencent.com/document/product/213/15753#Image)。 - ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds"` - - // 目的同步地域列表,必须满足如下限制:
  • 必须是一个合法的Region。
  • 如果是自定义镜像,则目标同步地域不能为源地域。
  • 如果是共享镜像,则目的同步地域仅支持源地域,表示将共享镜像复制为源地域的自定义镜像。
  • 暂不支持部分地域同步。
    具体地域参数请参考[Region](https://cloud.tencent.com/document/product/213/6091)。 - DestinationRegions []*string `json:"DestinationRegions,omitempty" name:"DestinationRegions"` - - // 检测是否支持发起同步镜像。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 目标镜像名称。 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 是否需要返回目的地域的镜像ID。 - ImageSetRequired *bool `json:"ImageSetRequired,omitempty" name:"ImageSetRequired"` -} - -type SyncImagesRequest struct { - *tchttp.BaseRequest - - // 镜像ID列表 ,镜像ID可以通过如下方式获取:
  • 通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。
  • 通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。
    镜像ID必须满足限制:
  • 镜像ID对应的镜像状态必须为`NORMAL`。
    镜像状态请参考[镜像数据表](https://cloud.tencent.com/document/product/213/15753#Image)。 - ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds"` - - // 目的同步地域列表,必须满足如下限制:
  • 必须是一个合法的Region。
  • 如果是自定义镜像,则目标同步地域不能为源地域。
  • 如果是共享镜像,则目的同步地域仅支持源地域,表示将共享镜像复制为源地域的自定义镜像。
  • 暂不支持部分地域同步。
    具体地域参数请参考[Region](https://cloud.tencent.com/document/product/213/6091)。 - DestinationRegions []*string `json:"DestinationRegions,omitempty" name:"DestinationRegions"` - - // 检测是否支持发起同步镜像。 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` - - // 目标镜像名称。 - ImageName *string `json:"ImageName,omitempty" name:"ImageName"` - - // 是否需要返回目的地域的镜像ID。 - ImageSetRequired *bool `json:"ImageSetRequired,omitempty" name:"ImageSetRequired"` -} - -func (r *SyncImagesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *SyncImagesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ImageIds") - delete(f, "DestinationRegions") - delete(f, "DryRun") - delete(f, "ImageName") - delete(f, "ImageSetRequired") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SyncImagesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type SyncImagesResponseParams struct { - // 目的地域的镜像ID信息。 - ImageSet []*SyncImage `json:"ImageSet,omitempty" name:"ImageSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type SyncImagesResponse struct { - *tchttp.BaseResponse - Response *SyncImagesResponseParams `json:"Response"` -} - -func (r *SyncImagesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *SyncImagesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type SystemDisk struct { - // 系统盘类型。系统盘类型限制详见[存储概述](https://cloud.tencent.com/document/product/213/4952)。取值范围:
  • LOCAL_BASIC:本地硬盘
  • LOCAL_SSD:本地SSD硬盘
  • CLOUD_BASIC:普通云硬盘
  • CLOUD_SSD:SSD云硬盘
  • CLOUD_PREMIUM:高性能云硬盘
  • CLOUD_BSSD:通用性SSD云硬盘

    默认取值:当前有库存的硬盘类型。 - DiskType *string `json:"DiskType,omitempty" name:"DiskType"` - - // 系统盘ID。LOCAL_BASIC 和 LOCAL_SSD 类型没有ID。暂时不支持该参数。 - // 该参数目前仅用于`DescribeInstances`等查询类接口的返回参数,不可用于`RunInstances`等写接口的入参。 - DiskId *string `json:"DiskId,omitempty" name:"DiskId"` - - // 系统盘大小,单位:GB。默认值为 50 - DiskSize *int64 `json:"DiskSize,omitempty" name:"DiskSize"` - - // 所属的独享集群ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` -} - -type Tag struct { - // 标签键 - Key *string `json:"Key,omitempty" name:"Key"` - - // 标签值 - Value *string `json:"Value,omitempty" name:"Value"` -} - -type TagSpecification struct { - // 标签绑定的资源类型,云服务器为“instance”,专用宿主机为“host”,镜像为“image”,密钥为“keypair” - // 注意:此字段可能返回 null,表示取不到有效值。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 标签对列表 - // 注意:此字段可能返回 null,表示取不到有效值。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -// Predefined struct for user -type TerminateInstancesRequestParams struct { - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 释放实例挂载的包年包月数据盘。 - ReleasePrepaidDataDisks *bool `json:"ReleasePrepaidDataDisks,omitempty" name:"ReleasePrepaidDataDisks"` -} - -type TerminateInstancesRequest struct { - *tchttp.BaseRequest - - // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` - - // 释放实例挂载的包年包月数据盘。 - ReleasePrepaidDataDisks *bool `json:"ReleasePrepaidDataDisks,omitempty" name:"ReleasePrepaidDataDisks"` -} - -func (r *TerminateInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *TerminateInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceIds") - delete(f, "ReleasePrepaidDataDisks") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "TerminateInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type TerminateInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type TerminateInstancesResponse struct { - *tchttp.BaseResponse - Response *TerminateInstancesResponseParams `json:"Response"` -} - -func (r *TerminateInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *TerminateInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type VirtualPrivateCloud struct { - // 私有网络ID,形如`vpc-xxx`。有效的VpcId可通过登录[控制台](https://console.cloud.tencent.com/vpc/vpc?rid=1)查询;也可以调用接口 [DescribeVpcEx](/document/api/215/1372) ,从接口返回中的`unVpcId`字段获取。若在创建子机时VpcId与SubnetId同时传入`DEFAULT`,则强制使用默认vpc网络。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 私有网络子网ID,形如`subnet-xxx`。有效的私有网络子网ID可通过登录[控制台](https://console.cloud.tencent.com/vpc/subnet?rid=1)查询;也可以调用接口 [DescribeSubnets](/document/api/215/15784) ,从接口返回中的`unSubnetId`字段获取。若在创建子机时SubnetId与VpcId同时传入`DEFAULT`,则强制使用默认vpc网络。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 是否用作公网网关。公网网关只有在实例拥有公网IP以及处于私有网络下时才能正常使用。取值范围:
  • TRUE:表示用作公网网关
  • FALSE:表示不作为公网网关

    默认取值:FALSE。 - AsVpcGateway *bool `json:"AsVpcGateway,omitempty" name:"AsVpcGateway"` - - // 私有网络子网 IP 数组,在创建实例、修改实例vpc属性操作中可使用此参数。当前仅批量创建多台实例时支持传入相同子网的多个 IP。 - PrivateIpAddresses []*string `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 为弹性网卡指定随机生成的 IPv6 地址数量。 - Ipv6AddressCount *uint64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` -} - -type ZoneInfo struct { - // 可用区名称,例如,ap-guangzhou-3 - // 全网可用区名称如下: - //
  • ap-chongqing-1
  • - //
  • ap-seoul-1
  • - //
  • ap-seoul-2
  • - //
  • ap-chengdu-1
  • - //
  • ap-chengdu-2
  • - //
  • ap-hongkong-1(售罄)
  • - //
  • ap-hongkong-2
  • - //
  • ap-hongkong-3
  • - //
  • ap-shenzhen-fsi-1
  • - //
  • ap-shenzhen-fsi-2
  • - //
  • ap-shenzhen-fsi-3
  • - //
  • ap-guangzhou-1(售罄)
  • - //
  • ap-guangzhou-2(售罄)
  • - //
  • ap-guangzhou-3
  • - //
  • ap-guangzhou-4
  • - //
  • ap-guangzhou-6
  • - //
  • ap-guangzhou-7
  • - //
  • ap-tokyo-1
  • - //
  • ap-tokyo-2
  • - //
  • ap-singapore-1
  • - //
  • ap-singapore-2
  • - //
  • ap-singapore-3
  • - //
  • ap-singapore-4
  • - //
  • ap-shanghai-fsi-1
  • - //
  • ap-shanghai-fsi-2
  • - //
  • ap-shanghai-fsi-3
  • - //
  • ap-bangkok-1
  • - //
  • ap-bangkok-2
  • - //
  • ap-shanghai-1(售罄)
  • - //
  • ap-shanghai-2
  • - //
  • ap-shanghai-3
  • - //
  • ap-shanghai-4
  • - //
  • ap-shanghai-5
  • - //
  • ap-shanghai-8
  • - //
  • ap-mumbai-1
  • - //
  • ap-mumbai-2
  • - //
  • eu-moscow-1
  • - //
  • ap-beijing-1(售罄)
  • - //
  • ap-beijing-2
  • - //
  • ap-beijing-3
  • - //
  • ap-beijing-4
  • - //
  • ap-beijing-5
  • - //
  • ap-beijing-6
  • - //
  • ap-beijing-7
  • - //
  • na-siliconvalley-1
  • - //
  • na-siliconvalley-2
  • - //
  • eu-frankfurt-1
  • - //
  • eu-frankfurt-2
  • - //
  • na-toronto-1
  • - //
  • na-ashburn-1
  • - //
  • na-ashburn-2
  • - //
  • ap-nanjing-1
  • - //
  • ap-nanjing-2
  • - //
  • ap-nanjing-3
  • - //
  • sa-saopaulo-1
  • - //
  • ap-jakarta-1
  • - //
  • ap-jakarta-2
  • - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 可用区描述,例如,广州三区 - ZoneName *string `json:"ZoneName,omitempty" name:"ZoneName"` - - // 可用区ID - ZoneId *string `json:"ZoneId,omitempty" name:"ZoneId"` - - // 可用区状态,包含AVAILABLE和UNAVAILABLE。AVAILABLE代表可用,UNAVAILABLE代表不可用。 - ZoneState *string `json:"ZoneState,omitempty" name:"ZoneState"` -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/doc.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/doc.go deleted file mode 100644 index f0f00fec6d03..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -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 doc diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/client.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/client.go deleted file mode 100644 index 7ad28a4080f0..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/client.go +++ /dev/null @@ -1,20861 +0,0 @@ -/* -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 v20170312 - -import ( - "context" - "errors" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/profile" -) - -const APIVersion = "2017-03-12" - -type Client struct { - common.Client -} - -// Deprecated -func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { - cpf := profile.NewClientProfile() - client = &Client{} - client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf) - return -} - -func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { - client = &Client{} - client.Init(region). - WithCredential(credential). - WithProfile(clientProfile) - return -} - -func NewAcceptAttachCcnInstancesRequest() (request *AcceptAttachCcnInstancesRequest) { - request = &AcceptAttachCcnInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AcceptAttachCcnInstances") - - return -} - -func NewAcceptAttachCcnInstancesResponse() (response *AcceptAttachCcnInstancesResponse) { - response = &AcceptAttachCcnInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AcceptAttachCcnInstances -// 本接口(AcceptAttachCcnInstances)用于跨账号关联实例时,云联网所有者接受并同意关联操作。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" -// UNSUPPORTEDOPERATION_INVALIDINSTANCESTATE = "UnsupportedOperation.InvalidInstanceState" -// UNSUPPORTEDOPERATION_ISNOTFINANCEACCOUNT = "UnsupportedOperation.IsNotFinanceAccount" -// UNSUPPORTEDOPERATION_NOTPENDINGCCNINSTANCE = "UnsupportedOperation.NotPendingCcnInstance" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -// UNSUPPORTEDOPERATION_UNABLECROSSFINANCE = "UnsupportedOperation.UnableCrossFinance" -func (c *Client) AcceptAttachCcnInstances(request *AcceptAttachCcnInstancesRequest) (response *AcceptAttachCcnInstancesResponse, err error) { - return c.AcceptAttachCcnInstancesWithContext(context.Background(), request) -} - -// AcceptAttachCcnInstances -// 本接口(AcceptAttachCcnInstances)用于跨账号关联实例时,云联网所有者接受并同意关联操作。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" -// UNSUPPORTEDOPERATION_INVALIDINSTANCESTATE = "UnsupportedOperation.InvalidInstanceState" -// UNSUPPORTEDOPERATION_ISNOTFINANCEACCOUNT = "UnsupportedOperation.IsNotFinanceAccount" -// UNSUPPORTEDOPERATION_NOTPENDINGCCNINSTANCE = "UnsupportedOperation.NotPendingCcnInstance" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -// UNSUPPORTEDOPERATION_UNABLECROSSFINANCE = "UnsupportedOperation.UnableCrossFinance" -func (c *Client) AcceptAttachCcnInstancesWithContext(ctx context.Context, request *AcceptAttachCcnInstancesRequest) (response *AcceptAttachCcnInstancesResponse, err error) { - if request == nil { - request = NewAcceptAttachCcnInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AcceptAttachCcnInstances require credential") - } - - request.SetContext(ctx) - - response = NewAcceptAttachCcnInstancesResponse() - err = c.Send(request, response) - return -} - -func NewAcceptVpcPeeringConnectionRequest() (request *AcceptVpcPeeringConnectionRequest) { - request = &AcceptVpcPeeringConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AcceptVpcPeeringConnection") - - return -} - -func NewAcceptVpcPeeringConnectionResponse() (response *AcceptVpcPeeringConnectionResponse) { - response = &AcceptVpcPeeringConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AcceptVpcPeeringConnection -// 本接口(AcceptVpcPeeringConnection)用于接受对等连接请求。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_VPCPEERINVALIDSTATECHANGE = "UnsupportedOperation.VpcPeerInvalidStateChange" -// UNSUPPORTEDOPERATION_VPCPEERPURVIEWERROR = "UnsupportedOperation.VpcPeerPurviewError" -func (c *Client) AcceptVpcPeeringConnection(request *AcceptVpcPeeringConnectionRequest) (response *AcceptVpcPeeringConnectionResponse, err error) { - return c.AcceptVpcPeeringConnectionWithContext(context.Background(), request) -} - -// AcceptVpcPeeringConnection -// 本接口(AcceptVpcPeeringConnection)用于接受对等连接请求。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_VPCPEERINVALIDSTATECHANGE = "UnsupportedOperation.VpcPeerInvalidStateChange" -// UNSUPPORTEDOPERATION_VPCPEERPURVIEWERROR = "UnsupportedOperation.VpcPeerPurviewError" -func (c *Client) AcceptVpcPeeringConnectionWithContext(ctx context.Context, request *AcceptVpcPeeringConnectionRequest) (response *AcceptVpcPeeringConnectionResponse, err error) { - if request == nil { - request = NewAcceptVpcPeeringConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AcceptVpcPeeringConnection require credential") - } - - request.SetContext(ctx) - - response = NewAcceptVpcPeeringConnectionResponse() - err = c.Send(request, response) - return -} - -func NewAddBandwidthPackageResourcesRequest() (request *AddBandwidthPackageResourcesRequest) { - request = &AddBandwidthPackageResourcesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AddBandwidthPackageResources") - - return -} - -func NewAddBandwidthPackageResourcesResponse() (response *AddBandwidthPackageResourcesResponse) { - response = &AddBandwidthPackageResourcesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AddBandwidthPackageResources -// 接口用于添加带宽包资源,包括[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)和[负载均衡](https://cloud.tencent.com/document/product/214/517)等 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RESOURCEALREADYEXISTED = "InvalidParameterValue.ResourceAlreadyExisted" -// INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// LIMITEXCEEDED_BANDWIDTHPACKAGEQUOTA = "LimitExceeded.BandwidthPackageQuota" -// MISSINGPARAMETER = "MissingParameter" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDRESOURCEINTERNETCHARGETYPE = "UnsupportedOperation.InvalidResourceInternetChargeType" -// UNSUPPORTEDOPERATION_INVALIDRESOURCEPROTOCOL = "UnsupportedOperation.InvalidResourceProtocol" -func (c *Client) AddBandwidthPackageResources(request *AddBandwidthPackageResourcesRequest) (response *AddBandwidthPackageResourcesResponse, err error) { - return c.AddBandwidthPackageResourcesWithContext(context.Background(), request) -} - -// AddBandwidthPackageResources -// 接口用于添加带宽包资源,包括[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)和[负载均衡](https://cloud.tencent.com/document/product/214/517)等 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RESOURCEALREADYEXISTED = "InvalidParameterValue.ResourceAlreadyExisted" -// INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// LIMITEXCEEDED_BANDWIDTHPACKAGEQUOTA = "LimitExceeded.BandwidthPackageQuota" -// MISSINGPARAMETER = "MissingParameter" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDRESOURCEINTERNETCHARGETYPE = "UnsupportedOperation.InvalidResourceInternetChargeType" -// UNSUPPORTEDOPERATION_INVALIDRESOURCEPROTOCOL = "UnsupportedOperation.InvalidResourceProtocol" -func (c *Client) AddBandwidthPackageResourcesWithContext(ctx context.Context, request *AddBandwidthPackageResourcesRequest) (response *AddBandwidthPackageResourcesResponse, err error) { - if request == nil { - request = NewAddBandwidthPackageResourcesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AddBandwidthPackageResources require credential") - } - - request.SetContext(ctx) - - response = NewAddBandwidthPackageResourcesResponse() - err = c.Send(request, response) - return -} - -func NewAddIp6RulesRequest() (request *AddIp6RulesRequest) { - request = &AddIp6RulesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AddIp6Rules") - - return -} - -func NewAddIp6RulesResponse() (response *AddIp6RulesResponse) { - response = &AddIp6RulesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AddIp6Rules -// 1. 该接口用于在转换实例下添加IPV6转换规则。 -// -// 2. 支持在同一个转换实例下批量添加转换规则,一个账户在一个地域最多50个。 -// -// 3. 一个完整的转换规则包括vip6:vport6:protocol:vip:vport,其中vip6:vport6:protocol必须是唯一。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_IPV6RULEIDEXISTED = "InvalidParameterValue.IPv6RuleIdExisted" -// LIMITEXCEEDED = "LimitExceeded" -func (c *Client) AddIp6Rules(request *AddIp6RulesRequest) (response *AddIp6RulesResponse, err error) { - return c.AddIp6RulesWithContext(context.Background(), request) -} - -// AddIp6Rules -// 1. 该接口用于在转换实例下添加IPV6转换规则。 -// -// 2. 支持在同一个转换实例下批量添加转换规则,一个账户在一个地域最多50个。 -// -// 3. 一个完整的转换规则包括vip6:vport6:protocol:vip:vport,其中vip6:vport6:protocol必须是唯一。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_IPV6RULEIDEXISTED = "InvalidParameterValue.IPv6RuleIdExisted" -// LIMITEXCEEDED = "LimitExceeded" -func (c *Client) AddIp6RulesWithContext(ctx context.Context, request *AddIp6RulesRequest) (response *AddIp6RulesResponse, err error) { - if request == nil { - request = NewAddIp6RulesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AddIp6Rules require credential") - } - - request.SetContext(ctx) - - response = NewAddIp6RulesResponse() - err = c.Send(request, response) - return -} - -func NewAddTemplateMemberRequest() (request *AddTemplateMemberRequest) { - request = &AddTemplateMemberRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AddTemplateMember") - - return -} - -func NewAddTemplateMemberResponse() (response *AddTemplateMemberResponse) { - response = &AddTemplateMemberResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AddTemplateMember -// 增加模板对象中的IP地址、协议端口、IP地址组、协议端口组。当前仅支持北京、泰国、北美地域请求。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) AddTemplateMember(request *AddTemplateMemberRequest) (response *AddTemplateMemberResponse, err error) { - return c.AddTemplateMemberWithContext(context.Background(), request) -} - -// AddTemplateMember -// 增加模板对象中的IP地址、协议端口、IP地址组、协议端口组。当前仅支持北京、泰国、北美地域请求。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) AddTemplateMemberWithContext(ctx context.Context, request *AddTemplateMemberRequest) (response *AddTemplateMemberResponse, err error) { - if request == nil { - request = NewAddTemplateMemberRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AddTemplateMember require credential") - } - - request.SetContext(ctx) - - response = NewAddTemplateMemberResponse() - err = c.Send(request, response) - return -} - -func NewAdjustPublicAddressRequest() (request *AdjustPublicAddressRequest) { - request = &AdjustPublicAddressRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AdjustPublicAddress") - - return -} - -func NewAdjustPublicAddressResponse() (response *AdjustPublicAddressResponse) { - response = &AdjustPublicAddressResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AdjustPublicAddress -// 本接口 (AdjustPublicAddress) 用于更换IP地址,支持更换CVM实例的普通公网IP和包月带宽的EIP。 -// -// 可能返回的错误码: -// -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_ADDRESSATTACKED = "InvalidParameterValue.AddressAttacked" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTAVAILABLE = "InvalidParameterValue.AddressIpNotAvailable" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_INSTANCEHASNOWANIP = "InvalidParameterValue.InstanceHasNoWanIP" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// INVALIDPARAMETERVALUE_UNAVAILABLEZONE = "InvalidParameterValue.UnavailableZone" -// LIMITEXCEEDED_CHANGEADDRESSQUOTA = "LimitExceeded.ChangeAddressQuota" -// LIMITEXCEEDED_DAILYCHANGEADDRESSQUOTA = "LimitExceeded.DailyChangeAddressQuota" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -// UNSUPPORTEDOPERATION_ISPNOTSUPPORTED = "UnsupportedOperation.IspNotSupported" -func (c *Client) AdjustPublicAddress(request *AdjustPublicAddressRequest) (response *AdjustPublicAddressResponse, err error) { - return c.AdjustPublicAddressWithContext(context.Background(), request) -} - -// AdjustPublicAddress -// 本接口 (AdjustPublicAddress) 用于更换IP地址,支持更换CVM实例的普通公网IP和包月带宽的EIP。 -// -// 可能返回的错误码: -// -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_ADDRESSATTACKED = "InvalidParameterValue.AddressAttacked" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTAVAILABLE = "InvalidParameterValue.AddressIpNotAvailable" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_INSTANCEHASNOWANIP = "InvalidParameterValue.InstanceHasNoWanIP" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// INVALIDPARAMETERVALUE_UNAVAILABLEZONE = "InvalidParameterValue.UnavailableZone" -// LIMITEXCEEDED_CHANGEADDRESSQUOTA = "LimitExceeded.ChangeAddressQuota" -// LIMITEXCEEDED_DAILYCHANGEADDRESSQUOTA = "LimitExceeded.DailyChangeAddressQuota" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -// UNSUPPORTEDOPERATION_ISPNOTSUPPORTED = "UnsupportedOperation.IspNotSupported" -func (c *Client) AdjustPublicAddressWithContext(ctx context.Context, request *AdjustPublicAddressRequest) (response *AdjustPublicAddressResponse, err error) { - if request == nil { - request = NewAdjustPublicAddressRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AdjustPublicAddress require credential") - } - - request.SetContext(ctx) - - response = NewAdjustPublicAddressResponse() - err = c.Send(request, response) - return -} - -func NewAllocateAddressesRequest() (request *AllocateAddressesRequest) { - request = &AllocateAddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AllocateAddresses") - - return -} - -func NewAllocateAddressesResponse() (response *AllocateAddressesResponse) { - response = &AllocateAddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AllocateAddresses -// 本接口 (AllocateAddresses) 用于申请一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 -// -// * EIP 是专为动态云计算设计的静态 IP 地址。借助 EIP,您可以快速将 EIP 重新映射到您的另一个实例上,从而屏蔽实例故障。 -// -// * 您的 EIP 与腾讯云账户相关联,而不是与某个实例相关联。在您选择显式释放该地址,或欠费超过24小时之前,它会一直与您的腾讯云账户保持关联。 -// -// * 一个腾讯云账户在每个地域能申请的 EIP 最大配额有所限制,可参见 [EIP 产品简介](https://cloud.tencent.com/document/product/213/5733),上述配额可通过 DescribeAddressQuota 接口获取。 -// -// 可能返回的错误码: -// -// ADDRESSQUOTALIMITEXCEEDED = "AddressQuotaLimitExceeded" -// ADDRESSQUOTALIMITEXCEEDED_DAILYALLOCATE = "AddressQuotaLimitExceeded.DailyAllocate" -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// FAILEDOPERATION_INVALIDREGION = "FailedOperation.InvalidRegion" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" -// INVALIDPARAMETERVALUE_ADDRESSATTACKED = "InvalidParameterValue.AddressAttacked" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTAVAILABLE = "InvalidParameterValue.AddressIpNotAvailable" -// INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_BANDWIDTHTOOSMALL = "InvalidParameterValue.BandwidthTooSmall" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDDEDICATEDCLUSTERID = "InvalidParameterValue.InvalidDedicatedClusterId" -// INVALIDPARAMETERVALUE_INVALIDTAG = "InvalidParameterValue.InvalidTag" -// INVALIDPARAMETERVALUE_MIXEDADDRESSIPSETTYPE = "InvalidParameterValue.MixedAddressIpSetType" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_UNAVAILABLEZONE = "InvalidParameterValue.UnavailableZone" -// LIMITEXCEEDED_BANDWIDTHPACKAGEQUOTA = "LimitExceeded.BandwidthPackageQuota" -// LIMITEXCEEDED_BANDWIDTHPACKAGERESOURCEQUOTA = "LimitExceeded.BandwidthPackageResourceQuota" -// LIMITEXCEEDED_MONTHLYADDRESSRECOVERYQUOTA = "LimitExceeded.MonthlyAddressRecoveryQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// UNAUTHORIZEDOPERATION_ANYCASTEIP = "UnauthorizedOperation.AnycastEip" -// UNAUTHORIZEDOPERATION_INVALIDACCOUNT = "UnauthorizedOperation.InvalidAccount" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -// UNSUPPORTEDOPERATION_OFFLINECHARGETYPE = "UnsupportedOperation.OfflineChargeType" -// UNSUPPORTEDOPERATION_UNSUPPORTEDREGION = "UnsupportedOperation.UnsupportedRegion" -func (c *Client) AllocateAddresses(request *AllocateAddressesRequest) (response *AllocateAddressesResponse, err error) { - return c.AllocateAddressesWithContext(context.Background(), request) -} - -// AllocateAddresses -// 本接口 (AllocateAddresses) 用于申请一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 -// -// * EIP 是专为动态云计算设计的静态 IP 地址。借助 EIP,您可以快速将 EIP 重新映射到您的另一个实例上,从而屏蔽实例故障。 -// -// * 您的 EIP 与腾讯云账户相关联,而不是与某个实例相关联。在您选择显式释放该地址,或欠费超过24小时之前,它会一直与您的腾讯云账户保持关联。 -// -// * 一个腾讯云账户在每个地域能申请的 EIP 最大配额有所限制,可参见 [EIP 产品简介](https://cloud.tencent.com/document/product/213/5733),上述配额可通过 DescribeAddressQuota 接口获取。 -// -// 可能返回的错误码: -// -// ADDRESSQUOTALIMITEXCEEDED = "AddressQuotaLimitExceeded" -// ADDRESSQUOTALIMITEXCEEDED_DAILYALLOCATE = "AddressQuotaLimitExceeded.DailyAllocate" -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// FAILEDOPERATION_INVALIDREGION = "FailedOperation.InvalidRegion" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" -// INVALIDPARAMETERVALUE_ADDRESSATTACKED = "InvalidParameterValue.AddressAttacked" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTAVAILABLE = "InvalidParameterValue.AddressIpNotAvailable" -// INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_BANDWIDTHTOOSMALL = "InvalidParameterValue.BandwidthTooSmall" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDDEDICATEDCLUSTERID = "InvalidParameterValue.InvalidDedicatedClusterId" -// INVALIDPARAMETERVALUE_INVALIDTAG = "InvalidParameterValue.InvalidTag" -// INVALIDPARAMETERVALUE_MIXEDADDRESSIPSETTYPE = "InvalidParameterValue.MixedAddressIpSetType" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_UNAVAILABLEZONE = "InvalidParameterValue.UnavailableZone" -// LIMITEXCEEDED_BANDWIDTHPACKAGEQUOTA = "LimitExceeded.BandwidthPackageQuota" -// LIMITEXCEEDED_BANDWIDTHPACKAGERESOURCEQUOTA = "LimitExceeded.BandwidthPackageResourceQuota" -// LIMITEXCEEDED_MONTHLYADDRESSRECOVERYQUOTA = "LimitExceeded.MonthlyAddressRecoveryQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// UNAUTHORIZEDOPERATION_ANYCASTEIP = "UnauthorizedOperation.AnycastEip" -// UNAUTHORIZEDOPERATION_INVALIDACCOUNT = "UnauthorizedOperation.InvalidAccount" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -// UNSUPPORTEDOPERATION_OFFLINECHARGETYPE = "UnsupportedOperation.OfflineChargeType" -// UNSUPPORTEDOPERATION_UNSUPPORTEDREGION = "UnsupportedOperation.UnsupportedRegion" -func (c *Client) AllocateAddressesWithContext(ctx context.Context, request *AllocateAddressesRequest) (response *AllocateAddressesResponse, err error) { - if request == nil { - request = NewAllocateAddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AllocateAddresses require credential") - } - - request.SetContext(ctx) - - response = NewAllocateAddressesResponse() - err = c.Send(request, response) - return -} - -func NewAllocateIp6AddressesBandwidthRequest() (request *AllocateIp6AddressesBandwidthRequest) { - request = &AllocateIp6AddressesBandwidthRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AllocateIp6AddressesBandwidth") - - return -} - -func NewAllocateIp6AddressesBandwidthResponse() (response *AllocateIp6AddressesBandwidthResponse) { - response = &AllocateIp6AddressesBandwidthResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AllocateIp6AddressesBandwidth -// 该接口用于给IPv6地址初次分配公网带宽 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTFOUND = "InvalidParameterValue.AddressIpNotFound" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTINVPC = "InvalidParameterValue.AddressIpNotInVpc" -// INVALIDPARAMETERVALUE_ADDRESSPUBLISHED = "InvalidParameterValue.AddressPublished" -// INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_INVALIDIPV6 = "InvalidParameterValue.InvalidIpv6" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -func (c *Client) AllocateIp6AddressesBandwidth(request *AllocateIp6AddressesBandwidthRequest) (response *AllocateIp6AddressesBandwidthResponse, err error) { - return c.AllocateIp6AddressesBandwidthWithContext(context.Background(), request) -} - -// AllocateIp6AddressesBandwidth -// 该接口用于给IPv6地址初次分配公网带宽 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTFOUND = "InvalidParameterValue.AddressIpNotFound" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTINVPC = "InvalidParameterValue.AddressIpNotInVpc" -// INVALIDPARAMETERVALUE_ADDRESSPUBLISHED = "InvalidParameterValue.AddressPublished" -// INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_INVALIDIPV6 = "InvalidParameterValue.InvalidIpv6" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -func (c *Client) AllocateIp6AddressesBandwidthWithContext(ctx context.Context, request *AllocateIp6AddressesBandwidthRequest) (response *AllocateIp6AddressesBandwidthResponse, err error) { - if request == nil { - request = NewAllocateIp6AddressesBandwidthRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AllocateIp6AddressesBandwidth require credential") - } - - request.SetContext(ctx) - - response = NewAllocateIp6AddressesBandwidthResponse() - err = c.Send(request, response) - return -} - -func NewAssignIpv6AddressesRequest() (request *AssignIpv6AddressesRequest) { - request = &AssignIpv6AddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6Addresses") - - return -} - -func NewAssignIpv6AddressesResponse() (response *AssignIpv6AddressesResponse) { - response = &AssignIpv6AddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssignIpv6Addresses -// 本接口(AssignIpv6Addresses)用于弹性网卡申请`IPv6`地址。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见弹性网卡使用限制。 -// -// * 可以指定`IPv6`地址申请,地址类型不能为主`IP`,`IPv6`地址暂时只支持作为辅助`IP`。 -// -// * 地址必须要在弹性网卡所在子网内,而且不能被占用。 -// -// * 在弹性网卡上申请一个到多个辅助`IPv6`地址,接口会在弹性网卡所在子网段内返回指定数量的辅助`IPv6`地址。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// LIMITEXCEEDED_ADDRESS = "LimitExceeded.Address" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINUSE_ADDRESS = "ResourceInUse.Address" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_UNASSIGNCIDRBLOCK = "UnsupportedOperation.UnassignCidrBlock" -func (c *Client) AssignIpv6Addresses(request *AssignIpv6AddressesRequest) (response *AssignIpv6AddressesResponse, err error) { - return c.AssignIpv6AddressesWithContext(context.Background(), request) -} - -// AssignIpv6Addresses -// 本接口(AssignIpv6Addresses)用于弹性网卡申请`IPv6`地址。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见弹性网卡使用限制。 -// -// * 可以指定`IPv6`地址申请,地址类型不能为主`IP`,`IPv6`地址暂时只支持作为辅助`IP`。 -// -// * 地址必须要在弹性网卡所在子网内,而且不能被占用。 -// -// * 在弹性网卡上申请一个到多个辅助`IPv6`地址,接口会在弹性网卡所在子网段内返回指定数量的辅助`IPv6`地址。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// LIMITEXCEEDED_ADDRESS = "LimitExceeded.Address" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINUSE_ADDRESS = "ResourceInUse.Address" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_UNASSIGNCIDRBLOCK = "UnsupportedOperation.UnassignCidrBlock" -func (c *Client) AssignIpv6AddressesWithContext(ctx context.Context, request *AssignIpv6AddressesRequest) (response *AssignIpv6AddressesResponse, err error) { - if request == nil { - request = NewAssignIpv6AddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssignIpv6Addresses require credential") - } - - request.SetContext(ctx) - - response = NewAssignIpv6AddressesResponse() - err = c.Send(request, response) - return -} - -func NewAssignIpv6CidrBlockRequest() (request *AssignIpv6CidrBlockRequest) { - request = &AssignIpv6CidrBlockRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6CidrBlock") - - return -} - -func NewAssignIpv6CidrBlockResponse() (response *AssignIpv6CidrBlockResponse) { - response = &AssignIpv6CidrBlockResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssignIpv6CidrBlock -// 本接口(AssignIpv6CidrBlock)用于分配IPv6网段。 -// -// * 使用本接口前,您需要已有VPC实例,如果没有可通过接口CreateVpc创建。 -// -// * 每个VPC只能申请一个IPv6网段。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_CIDRBLOCK = "LimitExceeded.CidrBlock" -// RESOURCEINSUFFICIENT_CIDRBLOCK = "ResourceInsufficient.CidrBlock" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) AssignIpv6CidrBlock(request *AssignIpv6CidrBlockRequest) (response *AssignIpv6CidrBlockResponse, err error) { - return c.AssignIpv6CidrBlockWithContext(context.Background(), request) -} - -// AssignIpv6CidrBlock -// 本接口(AssignIpv6CidrBlock)用于分配IPv6网段。 -// -// * 使用本接口前,您需要已有VPC实例,如果没有可通过接口CreateVpc创建。 -// -// * 每个VPC只能申请一个IPv6网段。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_CIDRBLOCK = "LimitExceeded.CidrBlock" -// RESOURCEINSUFFICIENT_CIDRBLOCK = "ResourceInsufficient.CidrBlock" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) AssignIpv6CidrBlockWithContext(ctx context.Context, request *AssignIpv6CidrBlockRequest) (response *AssignIpv6CidrBlockResponse, err error) { - if request == nil { - request = NewAssignIpv6CidrBlockRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssignIpv6CidrBlock require credential") - } - - request.SetContext(ctx) - - response = NewAssignIpv6CidrBlockResponse() - err = c.Send(request, response) - return -} - -func NewAssignIpv6SubnetCidrBlockRequest() (request *AssignIpv6SubnetCidrBlockRequest) { - request = &AssignIpv6SubnetCidrBlockRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6SubnetCidrBlock") - - return -} - -func NewAssignIpv6SubnetCidrBlockResponse() (response *AssignIpv6SubnetCidrBlockResponse) { - response = &AssignIpv6SubnetCidrBlockResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssignIpv6SubnetCidrBlock -// 本接口(AssignIpv6SubnetCidrBlock)用于分配IPv6子网段。 -// -// * 给子网分配 `IPv6` 网段,要求子网所属 `VPC` 已获得 `IPv6` 网段。如果尚未分配,请先通过接口 `AssignIpv6CidrBlock` 给子网所属 `VPC` 分配一个 `IPv6` 网段。否则无法分配 `IPv6` 子网段。 -// -// * 每个子网只能分配一个IPv6网段。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" -// LIMITEXCEEDED_SUBNETCIDRBLOCK = "LimitExceeded.SubnetCidrBlock" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) AssignIpv6SubnetCidrBlock(request *AssignIpv6SubnetCidrBlockRequest) (response *AssignIpv6SubnetCidrBlockResponse, err error) { - return c.AssignIpv6SubnetCidrBlockWithContext(context.Background(), request) -} - -// AssignIpv6SubnetCidrBlock -// 本接口(AssignIpv6SubnetCidrBlock)用于分配IPv6子网段。 -// -// * 给子网分配 `IPv6` 网段,要求子网所属 `VPC` 已获得 `IPv6` 网段。如果尚未分配,请先通过接口 `AssignIpv6CidrBlock` 给子网所属 `VPC` 分配一个 `IPv6` 网段。否则无法分配 `IPv6` 子网段。 -// -// * 每个子网只能分配一个IPv6网段。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" -// LIMITEXCEEDED_SUBNETCIDRBLOCK = "LimitExceeded.SubnetCidrBlock" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) AssignIpv6SubnetCidrBlockWithContext(ctx context.Context, request *AssignIpv6SubnetCidrBlockRequest) (response *AssignIpv6SubnetCidrBlockResponse, err error) { - if request == nil { - request = NewAssignIpv6SubnetCidrBlockRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssignIpv6SubnetCidrBlock require credential") - } - - request.SetContext(ctx) - - response = NewAssignIpv6SubnetCidrBlockResponse() - err = c.Send(request, response) - return -} - -func NewAssignPrivateIpAddressesRequest() (request *AssignPrivateIpAddressesRequest) { - request = &AssignPrivateIpAddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssignPrivateIpAddresses") - - return -} - -func NewAssignPrivateIpAddressesResponse() (response *AssignPrivateIpAddressesResponse) { - response = &AssignPrivateIpAddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssignPrivateIpAddresses -// 本接口(AssignPrivateIpAddresses)用于弹性网卡申请内网 IP。 -// -// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见弹性网卡使用限制。 -// -// * 可以指定内网IP地址申请,内网IP地址类型不能为主IP,主IP已存在,不能修改,内网IP必须要弹性网卡所在子网内,而且不能被占用。 -// -// * 在弹性网卡上申请一个到多个辅助内网IP,接口会在弹性网卡所在子网网段内返回指定数量的辅助内网IP。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_RESOURCEMISMATCH = "UnsupportedOperation.ResourceMismatch" -func (c *Client) AssignPrivateIpAddresses(request *AssignPrivateIpAddressesRequest) (response *AssignPrivateIpAddressesResponse, err error) { - return c.AssignPrivateIpAddressesWithContext(context.Background(), request) -} - -// AssignPrivateIpAddresses -// 本接口(AssignPrivateIpAddresses)用于弹性网卡申请内网 IP。 -// -// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见弹性网卡使用限制。 -// -// * 可以指定内网IP地址申请,内网IP地址类型不能为主IP,主IP已存在,不能修改,内网IP必须要弹性网卡所在子网内,而且不能被占用。 -// -// * 在弹性网卡上申请一个到多个辅助内网IP,接口会在弹性网卡所在子网网段内返回指定数量的辅助内网IP。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_RESOURCEMISMATCH = "UnsupportedOperation.ResourceMismatch" -func (c *Client) AssignPrivateIpAddressesWithContext(ctx context.Context, request *AssignPrivateIpAddressesRequest) (response *AssignPrivateIpAddressesResponse, err error) { - if request == nil { - request = NewAssignPrivateIpAddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssignPrivateIpAddresses require credential") - } - - request.SetContext(ctx) - - response = NewAssignPrivateIpAddressesResponse() - err = c.Send(request, response) - return -} - -func NewAssociateAddressRequest() (request *AssociateAddressRequest) { - request = &AssociateAddressRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssociateAddress") - - return -} - -func NewAssociateAddressResponse() (response *AssociateAddressResponse) { - response = &AssociateAddressResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssociateAddress -// 本接口 (AssociateAddress) 用于将[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)绑定到实例或弹性网卡的指定内网 IP 上。 -// -// * 将 EIP 绑定到实例(CVM)上,其本质是将 EIP 绑定到实例上主网卡的主内网 IP 上。 -// -// * 将 EIP 绑定到主网卡的主内网IP上,绑定过程会把其上绑定的普通公网 IP 自动解绑并释放。 -// -// * 将 EIP 绑定到指定网卡的内网 IP上(非主网卡的主内网IP),则必须先解绑该 EIP,才能再绑定新的。 -// -// * 将 EIP 绑定到内网型CLB实例的功能处于内测阶段,如需使用,请提交内测申请。 -// -// * 将 EIP 绑定到NAT网关,请使用接口[AssociateNatGatewayAddress](https://cloud.tencent.com/document/product/215/36722) -// -// * EIP 如果欠费或被封堵,则不能被绑定。 -// -// * 只有状态为 UNBIND 的 EIP 才能够被绑定。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ADDRESSENIINFONOTFOUND = "FailedOperation.AddressEniInfoNotFound" -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDINSTANCEID_ALREADYBINDEIP = "InvalidInstanceId.AlreadyBindEip" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDNETWORKINTERFACEID_NOTFOUND = "InvalidNetworkInterfaceId.NotFound" -// INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTAPPLICABLE = "InvalidParameterValue.AddressNotApplicable" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_INSTANCEDOESNOTSUPPORTANYCAST = "InvalidParameterValue.InstanceDoesNotSupportAnycast" -// INVALIDPARAMETERVALUE_INSTANCEHASNOWANIP = "InvalidParameterValue.InstanceHasNoWanIP" -// INVALIDPARAMETERVALUE_INSTANCEHASWANIP = "InvalidParameterValue.InstanceHasWanIP" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" -// INVALIDPARAMETERVALUE_INSTANCENORMALPUBLICIPBLOCKED = "InvalidParameterValue.InstanceNormalPublicIpBlocked" -// INVALIDPARAMETERVALUE_INSTANCENOTMATCHASSOCIATEENI = "InvalidParameterValue.InstanceNotMatchAssociateEni" -// INVALIDPARAMETERVALUE_INVALIDINSTANCEINTERNETCHARGETYPE = "InvalidParameterValue.InvalidInstanceInternetChargeType" -// INVALIDPARAMETERVALUE_INVALIDINSTANCESTATE = "InvalidParameterValue.InvalidInstanceState" -// INVALIDPARAMETERVALUE_LBALREADYBINDEIP = "InvalidParameterValue.LBAlreadyBindEip" -// INVALIDPARAMETERVALUE_MISSINGASSOCIATEENTITY = "InvalidParameterValue.MissingAssociateEntity" -// INVALIDPARAMETERVALUE_NETWORKINTERFACENOTFOUND = "InvalidParameterValue.NetworkInterfaceNotFound" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// INVALIDPRIVATEIPADDRESS_ALREADYBINDEIP = "InvalidPrivateIpAddress.AlreadyBindEip" -// LIMITEXCEEDED_INSTANCEADDRESSQUOTA = "LimitExceeded.InstanceAddressQuota" -// MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -// UNSUPPORTEDOPERATION_ADDRESSIPNOTSUPPORTINSTANCE = "UnsupportedOperation.AddressIpNotSupportInstance" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INCORRECTADDRESSRESOURCETYPE = "UnsupportedOperation.IncorrectAddressResourceType" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -// UNSUPPORTEDOPERATION_ISPNOTSUPPORTED = "UnsupportedOperation.IspNotSupported" -func (c *Client) AssociateAddress(request *AssociateAddressRequest) (response *AssociateAddressResponse, err error) { - return c.AssociateAddressWithContext(context.Background(), request) -} - -// AssociateAddress -// 本接口 (AssociateAddress) 用于将[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)绑定到实例或弹性网卡的指定内网 IP 上。 -// -// * 将 EIP 绑定到实例(CVM)上,其本质是将 EIP 绑定到实例上主网卡的主内网 IP 上。 -// -// * 将 EIP 绑定到主网卡的主内网IP上,绑定过程会把其上绑定的普通公网 IP 自动解绑并释放。 -// -// * 将 EIP 绑定到指定网卡的内网 IP上(非主网卡的主内网IP),则必须先解绑该 EIP,才能再绑定新的。 -// -// * 将 EIP 绑定到内网型CLB实例的功能处于内测阶段,如需使用,请提交内测申请。 -// -// * 将 EIP 绑定到NAT网关,请使用接口[AssociateNatGatewayAddress](https://cloud.tencent.com/document/product/215/36722) -// -// * EIP 如果欠费或被封堵,则不能被绑定。 -// -// * 只有状态为 UNBIND 的 EIP 才能够被绑定。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_ADDRESSENIINFONOTFOUND = "FailedOperation.AddressEniInfoNotFound" -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDINSTANCEID_ALREADYBINDEIP = "InvalidInstanceId.AlreadyBindEip" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDNETWORKINTERFACEID_NOTFOUND = "InvalidNetworkInterfaceId.NotFound" -// INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTAPPLICABLE = "InvalidParameterValue.AddressNotApplicable" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_INSTANCEDOESNOTSUPPORTANYCAST = "InvalidParameterValue.InstanceDoesNotSupportAnycast" -// INVALIDPARAMETERVALUE_INSTANCEHASNOWANIP = "InvalidParameterValue.InstanceHasNoWanIP" -// INVALIDPARAMETERVALUE_INSTANCEHASWANIP = "InvalidParameterValue.InstanceHasWanIP" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" -// INVALIDPARAMETERVALUE_INSTANCENORMALPUBLICIPBLOCKED = "InvalidParameterValue.InstanceNormalPublicIpBlocked" -// INVALIDPARAMETERVALUE_INSTANCENOTMATCHASSOCIATEENI = "InvalidParameterValue.InstanceNotMatchAssociateEni" -// INVALIDPARAMETERVALUE_INVALIDINSTANCEINTERNETCHARGETYPE = "InvalidParameterValue.InvalidInstanceInternetChargeType" -// INVALIDPARAMETERVALUE_INVALIDINSTANCESTATE = "InvalidParameterValue.InvalidInstanceState" -// INVALIDPARAMETERVALUE_LBALREADYBINDEIP = "InvalidParameterValue.LBAlreadyBindEip" -// INVALIDPARAMETERVALUE_MISSINGASSOCIATEENTITY = "InvalidParameterValue.MissingAssociateEntity" -// INVALIDPARAMETERVALUE_NETWORKINTERFACENOTFOUND = "InvalidParameterValue.NetworkInterfaceNotFound" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// INVALIDPRIVATEIPADDRESS_ALREADYBINDEIP = "InvalidPrivateIpAddress.AlreadyBindEip" -// LIMITEXCEEDED_INSTANCEADDRESSQUOTA = "LimitExceeded.InstanceAddressQuota" -// MISSINGPARAMETER = "MissingParameter" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -// UNSUPPORTEDOPERATION_ADDRESSIPNOTSUPPORTINSTANCE = "UnsupportedOperation.AddressIpNotSupportInstance" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INCORRECTADDRESSRESOURCETYPE = "UnsupportedOperation.IncorrectAddressResourceType" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -// UNSUPPORTEDOPERATION_ISPNOTSUPPORTED = "UnsupportedOperation.IspNotSupported" -func (c *Client) AssociateAddressWithContext(ctx context.Context, request *AssociateAddressRequest) (response *AssociateAddressResponse, err error) { - if request == nil { - request = NewAssociateAddressRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssociateAddress require credential") - } - - request.SetContext(ctx) - - response = NewAssociateAddressResponse() - err = c.Send(request, response) - return -} - -func NewAssociateDhcpIpWithAddressIpRequest() (request *AssociateDhcpIpWithAddressIpRequest) { - request = &AssociateDhcpIpWithAddressIpRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssociateDhcpIpWithAddressIp") - - return -} - -func NewAssociateDhcpIpWithAddressIpResponse() (response *AssociateDhcpIpWithAddressIpResponse) { - response = &AssociateDhcpIpWithAddressIpResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssociateDhcpIpWithAddressIp -// 本接口(AssociateDhcpIpWithAddressIp)用于DhcpIp绑定弹性公网IP(EIP)。
    -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_BINDEIP = "UnsupportedOperation.BindEIP" -// UNSUPPORTEDOPERATION_UNSUPPORTEDBINDLOCALZONEEIP = "UnsupportedOperation.UnsupportedBindLocalZoneEIP" -func (c *Client) AssociateDhcpIpWithAddressIp(request *AssociateDhcpIpWithAddressIpRequest) (response *AssociateDhcpIpWithAddressIpResponse, err error) { - return c.AssociateDhcpIpWithAddressIpWithContext(context.Background(), request) -} - -// AssociateDhcpIpWithAddressIp -// 本接口(AssociateDhcpIpWithAddressIp)用于DhcpIp绑定弹性公网IP(EIP)。
    -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_BINDEIP = "UnsupportedOperation.BindEIP" -// UNSUPPORTEDOPERATION_UNSUPPORTEDBINDLOCALZONEEIP = "UnsupportedOperation.UnsupportedBindLocalZoneEIP" -func (c *Client) AssociateDhcpIpWithAddressIpWithContext(ctx context.Context, request *AssociateDhcpIpWithAddressIpRequest) (response *AssociateDhcpIpWithAddressIpResponse, err error) { - if request == nil { - request = NewAssociateDhcpIpWithAddressIpRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssociateDhcpIpWithAddressIp require credential") - } - - request.SetContext(ctx) - - response = NewAssociateDhcpIpWithAddressIpResponse() - err = c.Send(request, response) - return -} - -func NewAssociateDirectConnectGatewayNatGatewayRequest() (request *AssociateDirectConnectGatewayNatGatewayRequest) { - request = &AssociateDirectConnectGatewayNatGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssociateDirectConnectGatewayNatGateway") - - return -} - -func NewAssociateDirectConnectGatewayNatGatewayResponse() (response *AssociateDirectConnectGatewayNatGatewayResponse) { - response = &AssociateDirectConnectGatewayNatGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssociateDirectConnectGatewayNatGateway -// 将专线网关与NAT网关绑定,专线网关默认路由指向NAT网关 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_VPGTYPENOTMATCH = "InvalidParameterValue.VpgTypeNotMatch" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) AssociateDirectConnectGatewayNatGateway(request *AssociateDirectConnectGatewayNatGatewayRequest) (response *AssociateDirectConnectGatewayNatGatewayResponse, err error) { - return c.AssociateDirectConnectGatewayNatGatewayWithContext(context.Background(), request) -} - -// AssociateDirectConnectGatewayNatGateway -// 将专线网关与NAT网关绑定,专线网关默认路由指向NAT网关 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_VPGTYPENOTMATCH = "InvalidParameterValue.VpgTypeNotMatch" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) AssociateDirectConnectGatewayNatGatewayWithContext(ctx context.Context, request *AssociateDirectConnectGatewayNatGatewayRequest) (response *AssociateDirectConnectGatewayNatGatewayResponse, err error) { - if request == nil { - request = NewAssociateDirectConnectGatewayNatGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssociateDirectConnectGatewayNatGateway require credential") - } - - request.SetContext(ctx) - - response = NewAssociateDirectConnectGatewayNatGatewayResponse() - err = c.Send(request, response) - return -} - -func NewAssociateNatGatewayAddressRequest() (request *AssociateNatGatewayAddressRequest) { - request = &AssociateNatGatewayAddressRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssociateNatGatewayAddress") - - return -} - -func NewAssociateNatGatewayAddressResponse() (response *AssociateNatGatewayAddressResponse) { - response = &AssociateNatGatewayAddressResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssociateNatGatewayAddress -// 本接口(AssociateNatGatewayAddress)用于NAT网关绑定弹性IP(EIP)。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_EIPBRANDWIDTHOUTINVALID = "InvalidParameterValue.EIPBrandWidthOutInvalid" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.AddressQuotaLimitExceeded" -// LIMITEXCEEDED_DAILYALLOCATEADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.DailyAllocateAddressQuotaLimitExceeded" -// LIMITEXCEEDED_PUBLICIPADDRESSPERNATGATEWAYLIMITEXCEEDED = "LimitExceeded.PublicIpAddressPerNatGatewayLimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINUSE_ADDRESS = "ResourceInUse.Address" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTBGPIP = "UnsupportedOperation.PublicIpAddressIsNotBGPIp" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTEXISTED = "UnsupportedOperation.PublicIpAddressIsNotExisted" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSNOTBILLEDBYTRAFFIC = "UnsupportedOperation.PublicIpAddressNotBilledByTraffic" -func (c *Client) AssociateNatGatewayAddress(request *AssociateNatGatewayAddressRequest) (response *AssociateNatGatewayAddressResponse, err error) { - return c.AssociateNatGatewayAddressWithContext(context.Background(), request) -} - -// AssociateNatGatewayAddress -// 本接口(AssociateNatGatewayAddress)用于NAT网关绑定弹性IP(EIP)。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_EIPBRANDWIDTHOUTINVALID = "InvalidParameterValue.EIPBrandWidthOutInvalid" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.AddressQuotaLimitExceeded" -// LIMITEXCEEDED_DAILYALLOCATEADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.DailyAllocateAddressQuotaLimitExceeded" -// LIMITEXCEEDED_PUBLICIPADDRESSPERNATGATEWAYLIMITEXCEEDED = "LimitExceeded.PublicIpAddressPerNatGatewayLimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINUSE_ADDRESS = "ResourceInUse.Address" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTBGPIP = "UnsupportedOperation.PublicIpAddressIsNotBGPIp" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTEXISTED = "UnsupportedOperation.PublicIpAddressIsNotExisted" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSNOTBILLEDBYTRAFFIC = "UnsupportedOperation.PublicIpAddressNotBilledByTraffic" -func (c *Client) AssociateNatGatewayAddressWithContext(ctx context.Context, request *AssociateNatGatewayAddressRequest) (response *AssociateNatGatewayAddressResponse, err error) { - if request == nil { - request = NewAssociateNatGatewayAddressRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssociateNatGatewayAddress require credential") - } - - request.SetContext(ctx) - - response = NewAssociateNatGatewayAddressResponse() - err = c.Send(request, response) - return -} - -func NewAssociateNetworkAclSubnetsRequest() (request *AssociateNetworkAclSubnetsRequest) { - request = &AssociateNetworkAclSubnetsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssociateNetworkAclSubnets") - - return -} - -func NewAssociateNetworkAclSubnetsResponse() (response *AssociateNetworkAclSubnetsResponse) { - response = &AssociateNetworkAclSubnetsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssociateNetworkAclSubnets -// 本接口(AssociateNetworkAclSubnets)用于网络ACL关联VPC下的子网。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) AssociateNetworkAclSubnets(request *AssociateNetworkAclSubnetsRequest) (response *AssociateNetworkAclSubnetsResponse, err error) { - return c.AssociateNetworkAclSubnetsWithContext(context.Background(), request) -} - -// AssociateNetworkAclSubnets -// 本接口(AssociateNetworkAclSubnets)用于网络ACL关联VPC下的子网。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) AssociateNetworkAclSubnetsWithContext(ctx context.Context, request *AssociateNetworkAclSubnetsRequest) (response *AssociateNetworkAclSubnetsResponse, err error) { - if request == nil { - request = NewAssociateNetworkAclSubnetsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssociateNetworkAclSubnets require credential") - } - - request.SetContext(ctx) - - response = NewAssociateNetworkAclSubnetsResponse() - err = c.Send(request, response) - return -} - -func NewAssociateNetworkInterfaceSecurityGroupsRequest() (request *AssociateNetworkInterfaceSecurityGroupsRequest) { - request = &AssociateNetworkInterfaceSecurityGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AssociateNetworkInterfaceSecurityGroups") - - return -} - -func NewAssociateNetworkInterfaceSecurityGroupsResponse() (response *AssociateNetworkInterfaceSecurityGroupsResponse) { - response = &AssociateNetworkInterfaceSecurityGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AssociateNetworkInterfaceSecurityGroups -// 本接口(AssociateNetworkInterfaceSecurityGroups)用于弹性网卡绑定安全组(SecurityGroup)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) AssociateNetworkInterfaceSecurityGroups(request *AssociateNetworkInterfaceSecurityGroupsRequest) (response *AssociateNetworkInterfaceSecurityGroupsResponse, err error) { - return c.AssociateNetworkInterfaceSecurityGroupsWithContext(context.Background(), request) -} - -// AssociateNetworkInterfaceSecurityGroups -// 本接口(AssociateNetworkInterfaceSecurityGroups)用于弹性网卡绑定安全组(SecurityGroup)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) AssociateNetworkInterfaceSecurityGroupsWithContext(ctx context.Context, request *AssociateNetworkInterfaceSecurityGroupsRequest) (response *AssociateNetworkInterfaceSecurityGroupsResponse, err error) { - if request == nil { - request = NewAssociateNetworkInterfaceSecurityGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AssociateNetworkInterfaceSecurityGroups require credential") - } - - request.SetContext(ctx) - - response = NewAssociateNetworkInterfaceSecurityGroupsResponse() - err = c.Send(request, response) - return -} - -func NewAttachCcnInstancesRequest() (request *AttachCcnInstancesRequest) { - request = &AttachCcnInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AttachCcnInstances") - - return -} - -func NewAttachCcnInstancesResponse() (response *AttachCcnInstancesResponse) { - response = &AttachCcnInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AttachCcnInstances -// 本接口(AttachCcnInstances)用于将网络实例加载到云联网实例中,网络实例包括VPC和专线网关。
    -// -// 每个云联网能够关联的网络实例个数是有限的,详情请参考产品文档。如果需要扩充请联系在线客服。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CCNATTACHBMVPCLIMITEXCEEDED = "InvalidParameterValue.CcnAttachBmvpcLimitExceeded" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_CURRENTINSTANCEATTACHEDCCNINSTANCES = "LimitExceeded.CurrentInstanceAttachedCcnInstances" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" -// UNSUPPORTEDOPERATION_CCNATTACHED = "UnsupportedOperation.CcnAttached" -// UNSUPPORTEDOPERATION_CCNCROSSACCOUNT = "UnsupportedOperation.CcnCrossAccount" -// UNSUPPORTEDOPERATION_CCNORDINARYACCOUNTREFUSEATTACH = "UnsupportedOperation.CcnOrdinaryAccountRefuseAttach" -// UNSUPPORTEDOPERATION_CCNROUTETABLENOTEXIST = "UnsupportedOperation.CcnRouteTableNotExist" -// UNSUPPORTEDOPERATION_INSTANCEANDRTBNOTMATCH = "UnsupportedOperation.InstanceAndRtbNotMatch" -// UNSUPPORTEDOPERATION_INSTANCECDCIDNOTMATCHCCNCDCID = "UnsupportedOperation.InstanceCdcIdNotMatchCcnCdcId" -// UNSUPPORTEDOPERATION_INSTANCEORDINARYACCOUNTREFUSEATTACH = "UnsupportedOperation.InstanceOrdinaryAccountRefuseAttach" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_ISNOTFINANCEACCOUNT = "UnsupportedOperation.IsNotFinanceAccount" -// UNSUPPORTEDOPERATION_MULTIPLEVPCNOTSUPPORTATTACHACCOUNTHASIPV6 = "UnsupportedOperation.MultipleVpcNotSupportAttachAccountHasIpv6" -// UNSUPPORTEDOPERATION_NOTSUPPORTATTACHEDGEANDCROSSBORDERINSTANCE = "UnsupportedOperation.NotSupportAttachEdgeAndCrossBorderInstance" -// UNSUPPORTEDOPERATION_PURCHASELIMIT = "UnsupportedOperation.PurchaseLimit" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -// UNSUPPORTEDOPERATION_UNABLECROSSFINANCE = "UnsupportedOperation.UnableCrossFinance" -func (c *Client) AttachCcnInstances(request *AttachCcnInstancesRequest) (response *AttachCcnInstancesResponse, err error) { - return c.AttachCcnInstancesWithContext(context.Background(), request) -} - -// AttachCcnInstances -// 本接口(AttachCcnInstances)用于将网络实例加载到云联网实例中,网络实例包括VPC和专线网关。
    -// -// 每个云联网能够关联的网络实例个数是有限的,详情请参考产品文档。如果需要扩充请联系在线客服。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CCNATTACHBMVPCLIMITEXCEEDED = "InvalidParameterValue.CcnAttachBmvpcLimitExceeded" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_CURRENTINSTANCEATTACHEDCCNINSTANCES = "LimitExceeded.CurrentInstanceAttachedCcnInstances" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" -// UNSUPPORTEDOPERATION_CCNATTACHED = "UnsupportedOperation.CcnAttached" -// UNSUPPORTEDOPERATION_CCNCROSSACCOUNT = "UnsupportedOperation.CcnCrossAccount" -// UNSUPPORTEDOPERATION_CCNORDINARYACCOUNTREFUSEATTACH = "UnsupportedOperation.CcnOrdinaryAccountRefuseAttach" -// UNSUPPORTEDOPERATION_CCNROUTETABLENOTEXIST = "UnsupportedOperation.CcnRouteTableNotExist" -// UNSUPPORTEDOPERATION_INSTANCEANDRTBNOTMATCH = "UnsupportedOperation.InstanceAndRtbNotMatch" -// UNSUPPORTEDOPERATION_INSTANCECDCIDNOTMATCHCCNCDCID = "UnsupportedOperation.InstanceCdcIdNotMatchCcnCdcId" -// UNSUPPORTEDOPERATION_INSTANCEORDINARYACCOUNTREFUSEATTACH = "UnsupportedOperation.InstanceOrdinaryAccountRefuseAttach" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_ISNOTFINANCEACCOUNT = "UnsupportedOperation.IsNotFinanceAccount" -// UNSUPPORTEDOPERATION_MULTIPLEVPCNOTSUPPORTATTACHACCOUNTHASIPV6 = "UnsupportedOperation.MultipleVpcNotSupportAttachAccountHasIpv6" -// UNSUPPORTEDOPERATION_NOTSUPPORTATTACHEDGEANDCROSSBORDERINSTANCE = "UnsupportedOperation.NotSupportAttachEdgeAndCrossBorderInstance" -// UNSUPPORTEDOPERATION_PURCHASELIMIT = "UnsupportedOperation.PurchaseLimit" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -// UNSUPPORTEDOPERATION_UNABLECROSSFINANCE = "UnsupportedOperation.UnableCrossFinance" -func (c *Client) AttachCcnInstancesWithContext(ctx context.Context, request *AttachCcnInstancesRequest) (response *AttachCcnInstancesResponse, err error) { - if request == nil { - request = NewAttachCcnInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AttachCcnInstances require credential") - } - - request.SetContext(ctx) - - response = NewAttachCcnInstancesResponse() - err = c.Send(request, response) - return -} - -func NewAttachClassicLinkVpcRequest() (request *AttachClassicLinkVpcRequest) { - request = &AttachClassicLinkVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AttachClassicLinkVpc") - - return -} - -func NewAttachClassicLinkVpcResponse() (response *AttachClassicLinkVpcResponse) { - response = &AttachClassicLinkVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AttachClassicLinkVpc -// 本接口(AttachClassicLinkVpc)用于创建私有网络和基础网络设备互通。 -// -// * 私有网络和基础网络设备必须在同一个地域。 -// -// * 私有网络和基础网络的区别详见vpc产品文档-私有网络与基础网络。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CIDRUNSUPPORTEDCLASSICLINK = "UnsupportedOperation.CIDRUnSupportedClassicLink" -// UNSUPPORTEDOPERATION_CLASSICINSTANCEIDALREADYEXISTS = "UnsupportedOperation.ClassicInstanceIdAlreadyExists" -func (c *Client) AttachClassicLinkVpc(request *AttachClassicLinkVpcRequest) (response *AttachClassicLinkVpcResponse, err error) { - return c.AttachClassicLinkVpcWithContext(context.Background(), request) -} - -// AttachClassicLinkVpc -// 本接口(AttachClassicLinkVpc)用于创建私有网络和基础网络设备互通。 -// -// * 私有网络和基础网络设备必须在同一个地域。 -// -// * 私有网络和基础网络的区别详见vpc产品文档-私有网络与基础网络。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CIDRUNSUPPORTEDCLASSICLINK = "UnsupportedOperation.CIDRUnSupportedClassicLink" -// UNSUPPORTEDOPERATION_CLASSICINSTANCEIDALREADYEXISTS = "UnsupportedOperation.ClassicInstanceIdAlreadyExists" -func (c *Client) AttachClassicLinkVpcWithContext(ctx context.Context, request *AttachClassicLinkVpcRequest) (response *AttachClassicLinkVpcResponse, err error) { - if request == nil { - request = NewAttachClassicLinkVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AttachClassicLinkVpc require credential") - } - - request.SetContext(ctx) - - response = NewAttachClassicLinkVpcResponse() - err = c.Send(request, response) - return -} - -func NewAttachNetworkInterfaceRequest() (request *AttachNetworkInterfaceRequest) { - request = &AttachNetworkInterfaceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AttachNetworkInterface") - - return -} - -func NewAttachNetworkInterfaceResponse() (response *AttachNetworkInterfaceResponse) { - response = &AttachNetworkInterfaceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AttachNetworkInterface -// 本接口(AttachNetworkInterface)用于弹性网卡绑定云服务器。 -// -// * 一个弹性网卡请至少绑定一个安全组,如需绑定请参见弹性网卡绑定安全组。 -// -// * 一个云服务器可以绑定多个弹性网卡,但只能绑定一个主网卡。更多限制信息详见弹性网卡使用限制。 -// -// * 一个弹性网卡只能同时绑定一个云服务器。 -// -// * 只有运行中或者已关机状态的云服务器才能绑定弹性网卡,查看云服务器状态详见腾讯云服务器信息。 -// -// * 弹性网卡绑定的云服务器必须是私有网络的,而且云服务器所在可用区必须和弹性网卡子网的可用区相同。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ATTACHMENTALREADYEXISTS = "UnsupportedOperation.AttachmentAlreadyExists" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_RESOURCEISINVALIDSTATE = "UnsupportedOperation.ResourceIsInvalidState" -// UNSUPPORTEDOPERATION_UNSUPPORTEDINSTANCEFAMILY = "UnsupportedOperation.UnsupportedInstanceFamily" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -// UNSUPPORTEDOPERATION_ZONEMISMATCH = "UnsupportedOperation.ZoneMismatch" -func (c *Client) AttachNetworkInterface(request *AttachNetworkInterfaceRequest) (response *AttachNetworkInterfaceResponse, err error) { - return c.AttachNetworkInterfaceWithContext(context.Background(), request) -} - -// AttachNetworkInterface -// 本接口(AttachNetworkInterface)用于弹性网卡绑定云服务器。 -// -// * 一个弹性网卡请至少绑定一个安全组,如需绑定请参见弹性网卡绑定安全组。 -// -// * 一个云服务器可以绑定多个弹性网卡,但只能绑定一个主网卡。更多限制信息详见弹性网卡使用限制。 -// -// * 一个弹性网卡只能同时绑定一个云服务器。 -// -// * 只有运行中或者已关机状态的云服务器才能绑定弹性网卡,查看云服务器状态详见腾讯云服务器信息。 -// -// * 弹性网卡绑定的云服务器必须是私有网络的,而且云服务器所在可用区必须和弹性网卡子网的可用区相同。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ATTACHMENTALREADYEXISTS = "UnsupportedOperation.AttachmentAlreadyExists" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_RESOURCEISINVALIDSTATE = "UnsupportedOperation.ResourceIsInvalidState" -// UNSUPPORTEDOPERATION_UNSUPPORTEDINSTANCEFAMILY = "UnsupportedOperation.UnsupportedInstanceFamily" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -// UNSUPPORTEDOPERATION_ZONEMISMATCH = "UnsupportedOperation.ZoneMismatch" -func (c *Client) AttachNetworkInterfaceWithContext(ctx context.Context, request *AttachNetworkInterfaceRequest) (response *AttachNetworkInterfaceResponse, err error) { - if request == nil { - request = NewAttachNetworkInterfaceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AttachNetworkInterface require credential") - } - - request.SetContext(ctx) - - response = NewAttachNetworkInterfaceResponse() - err = c.Send(request, response) - return -} - -func NewAttachSnapshotInstancesRequest() (request *AttachSnapshotInstancesRequest) { - request = &AttachSnapshotInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AttachSnapshotInstances") - - return -} - -func NewAttachSnapshotInstancesResponse() (response *AttachSnapshotInstancesResponse) { - response = &AttachSnapshotInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AttachSnapshotInstances -// 本接口(AttachSnapshotInstances)用于快照策略关联实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_ATTACHEDSNAPSHOTPOLICYEXCEEDED = "LimitExceeded.AttachedSnapshotPolicyExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTATTACHED = "UnsupportedOperation.SnapshotAttached" -// UNSUPPORTEDOPERATION_SNAPSHOTINSTANCEREGIONDIFF = "UnsupportedOperation.SnapshotInstanceRegionDiff" -func (c *Client) AttachSnapshotInstances(request *AttachSnapshotInstancesRequest) (response *AttachSnapshotInstancesResponse, err error) { - return c.AttachSnapshotInstancesWithContext(context.Background(), request) -} - -// AttachSnapshotInstances -// 本接口(AttachSnapshotInstances)用于快照策略关联实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_ATTACHEDSNAPSHOTPOLICYEXCEEDED = "LimitExceeded.AttachedSnapshotPolicyExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTATTACHED = "UnsupportedOperation.SnapshotAttached" -// UNSUPPORTEDOPERATION_SNAPSHOTINSTANCEREGIONDIFF = "UnsupportedOperation.SnapshotInstanceRegionDiff" -func (c *Client) AttachSnapshotInstancesWithContext(ctx context.Context, request *AttachSnapshotInstancesRequest) (response *AttachSnapshotInstancesResponse, err error) { - if request == nil { - request = NewAttachSnapshotInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AttachSnapshotInstances require credential") - } - - request.SetContext(ctx) - - response = NewAttachSnapshotInstancesResponse() - err = c.Send(request, response) - return -} - -func NewAuditCrossBorderComplianceRequest() (request *AuditCrossBorderComplianceRequest) { - request = &AuditCrossBorderComplianceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "AuditCrossBorderCompliance") - - return -} - -func NewAuditCrossBorderComplianceResponse() (response *AuditCrossBorderComplianceResponse) { - response = &AuditCrossBorderComplianceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// AuditCrossBorderCompliance -// 本接口(AuditCrossBorderCompliance)用于服务商操作合规化资质审批。 -// -// * 服务商只能操作提交到本服务商的审批单,后台会校验身份。即只授权给服务商的`APPID` 调用本接口。 -// -// * `APPROVED` 状态的审批单,可以再次操作为 `DENY`;`DENY` 状态的审批单,也可以再次操作为 `APPROVED`。 -// -// 可能返回的错误码: -// -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) AuditCrossBorderCompliance(request *AuditCrossBorderComplianceRequest) (response *AuditCrossBorderComplianceResponse, err error) { - return c.AuditCrossBorderComplianceWithContext(context.Background(), request) -} - -// AuditCrossBorderCompliance -// 本接口(AuditCrossBorderCompliance)用于服务商操作合规化资质审批。 -// -// * 服务商只能操作提交到本服务商的审批单,后台会校验身份。即只授权给服务商的`APPID` 调用本接口。 -// -// * `APPROVED` 状态的审批单,可以再次操作为 `DENY`;`DENY` 状态的审批单,也可以再次操作为 `APPROVED`。 -// -// 可能返回的错误码: -// -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) AuditCrossBorderComplianceWithContext(ctx context.Context, request *AuditCrossBorderComplianceRequest) (response *AuditCrossBorderComplianceResponse, err error) { - if request == nil { - request = NewAuditCrossBorderComplianceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("AuditCrossBorderCompliance require credential") - } - - request.SetContext(ctx) - - response = NewAuditCrossBorderComplianceResponse() - err = c.Send(request, response) - return -} - -func NewCheckAssistantCidrRequest() (request *CheckAssistantCidrRequest) { - request = &CheckAssistantCidrRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CheckAssistantCidr") - - return -} - -func NewCheckAssistantCidrResponse() (response *CheckAssistantCidrResponse) { - response = &CheckAssistantCidrResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CheckAssistantCidr -// 本接口(CheckAssistantCidr)用于检查辅助CIDR是否与存量路由、对等连接(对端VPC的CIDR)等资源存在冲突。如果存在重叠,则返回重叠的资源。 -// -// * 检测辅助CIDR是否与当前VPC的主CIDR和辅助CIDR存在重叠。 -// -// * 检测辅助CIDR是否与当前VPC的路由的目的端存在重叠。 -// -// * 检测辅助CIDR是否与当前VPC的对等连接,对端VPC下的主CIDR或辅助CIDR存在重叠。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CheckAssistantCidr(request *CheckAssistantCidrRequest) (response *CheckAssistantCidrResponse, err error) { - return c.CheckAssistantCidrWithContext(context.Background(), request) -} - -// CheckAssistantCidr -// 本接口(CheckAssistantCidr)用于检查辅助CIDR是否与存量路由、对等连接(对端VPC的CIDR)等资源存在冲突。如果存在重叠,则返回重叠的资源。 -// -// * 检测辅助CIDR是否与当前VPC的主CIDR和辅助CIDR存在重叠。 -// -// * 检测辅助CIDR是否与当前VPC的路由的目的端存在重叠。 -// -// * 检测辅助CIDR是否与当前VPC的对等连接,对端VPC下的主CIDR或辅助CIDR存在重叠。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CheckAssistantCidrWithContext(ctx context.Context, request *CheckAssistantCidrRequest) (response *CheckAssistantCidrResponse, err error) { - if request == nil { - request = NewCheckAssistantCidrRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CheckAssistantCidr require credential") - } - - request.SetContext(ctx) - - response = NewCheckAssistantCidrResponse() - err = c.Send(request, response) - return -} - -func NewCheckDefaultSubnetRequest() (request *CheckDefaultSubnetRequest) { - request = &CheckDefaultSubnetRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CheckDefaultSubnet") - - return -} - -func NewCheckDefaultSubnetResponse() (response *CheckDefaultSubnetResponse) { - response = &CheckDefaultSubnetResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CheckDefaultSubnet -// 本接口(CheckDefaultSubnet)用于预判是否可建默认子网。 -// -// 可能返回的错误码: -// -// RESOURCEINSUFFICIENT_CIDRBLOCK = "ResourceInsufficient.CidrBlock" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CheckDefaultSubnet(request *CheckDefaultSubnetRequest) (response *CheckDefaultSubnetResponse, err error) { - return c.CheckDefaultSubnetWithContext(context.Background(), request) -} - -// CheckDefaultSubnet -// 本接口(CheckDefaultSubnet)用于预判是否可建默认子网。 -// -// 可能返回的错误码: -// -// RESOURCEINSUFFICIENT_CIDRBLOCK = "ResourceInsufficient.CidrBlock" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CheckDefaultSubnetWithContext(ctx context.Context, request *CheckDefaultSubnetRequest) (response *CheckDefaultSubnetResponse, err error) { - if request == nil { - request = NewCheckDefaultSubnetRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CheckDefaultSubnet require credential") - } - - request.SetContext(ctx) - - response = NewCheckDefaultSubnetResponse() - err = c.Send(request, response) - return -} - -func NewCheckNetDetectStateRequest() (request *CheckNetDetectStateRequest) { - request = &CheckNetDetectStateRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CheckNetDetectState") - - return -} - -func NewCheckNetDetectStateResponse() (response *CheckNetDetectStateResponse) { - response = &CheckNetDetectStateResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CheckNetDetectState -// 本接口(CheckNetDetectState)用于验证网络探测。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_NEXTHOPMISMATCH = "InvalidParameter.NextHopMismatch" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NETDETECTINVPC = "InvalidParameterValue.NetDetectInVpc" -// INVALIDPARAMETERVALUE_NETDETECTNOTFOUNDIP = "InvalidParameterValue.NetDetectNotFoundIp" -// INVALIDPARAMETERVALUE_NETDETECTSAMEIP = "InvalidParameterValue.NetDetectSameIp" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) CheckNetDetectState(request *CheckNetDetectStateRequest) (response *CheckNetDetectStateResponse, err error) { - return c.CheckNetDetectStateWithContext(context.Background(), request) -} - -// CheckNetDetectState -// 本接口(CheckNetDetectState)用于验证网络探测。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_NEXTHOPMISMATCH = "InvalidParameter.NextHopMismatch" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NETDETECTINVPC = "InvalidParameterValue.NetDetectInVpc" -// INVALIDPARAMETERVALUE_NETDETECTNOTFOUNDIP = "InvalidParameterValue.NetDetectNotFoundIp" -// INVALIDPARAMETERVALUE_NETDETECTSAMEIP = "InvalidParameterValue.NetDetectSameIp" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) CheckNetDetectStateWithContext(ctx context.Context, request *CheckNetDetectStateRequest) (response *CheckNetDetectStateResponse, err error) { - if request == nil { - request = NewCheckNetDetectStateRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CheckNetDetectState require credential") - } - - request.SetContext(ctx) - - response = NewCheckNetDetectStateResponse() - err = c.Send(request, response) - return -} - -func NewCloneSecurityGroupRequest() (request *CloneSecurityGroupRequest) { - request = &CloneSecurityGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CloneSecurityGroup") - - return -} - -func NewCloneSecurityGroupResponse() (response *CloneSecurityGroupResponse) { - response = &CloneSecurityGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CloneSecurityGroup -// 本接口(CloneSecurityGroup)用于根据存量的安全组,克隆创建出同样规则配置的安全组。仅克隆安全组及其规则信息,不会克隆安全组标签信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CloneSecurityGroup(request *CloneSecurityGroupRequest) (response *CloneSecurityGroupResponse, err error) { - return c.CloneSecurityGroupWithContext(context.Background(), request) -} - -// CloneSecurityGroup -// 本接口(CloneSecurityGroup)用于根据存量的安全组,克隆创建出同样规则配置的安全组。仅克隆安全组及其规则信息,不会克隆安全组标签信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CloneSecurityGroupWithContext(ctx context.Context, request *CloneSecurityGroupRequest) (response *CloneSecurityGroupResponse, err error) { - if request == nil { - request = NewCloneSecurityGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CloneSecurityGroup require credential") - } - - request.SetContext(ctx) - - response = NewCloneSecurityGroupResponse() - err = c.Send(request, response) - return -} - -func NewCreateAddressTemplateRequest() (request *CreateAddressTemplateRequest) { - request = &CreateAddressTemplateRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateAddressTemplate") - - return -} - -func NewCreateAddressTemplateResponse() (response *CreateAddressTemplateResponse) { - response = &CreateAddressTemplateResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateAddressTemplate -// 本接口(CreateAddressTemplate)用于创建IP地址模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -func (c *Client) CreateAddressTemplate(request *CreateAddressTemplateRequest) (response *CreateAddressTemplateResponse, err error) { - return c.CreateAddressTemplateWithContext(context.Background(), request) -} - -// CreateAddressTemplate -// 本接口(CreateAddressTemplate)用于创建IP地址模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -func (c *Client) CreateAddressTemplateWithContext(ctx context.Context, request *CreateAddressTemplateRequest) (response *CreateAddressTemplateResponse, err error) { - if request == nil { - request = NewCreateAddressTemplateRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateAddressTemplate require credential") - } - - request.SetContext(ctx) - - response = NewCreateAddressTemplateResponse() - err = c.Send(request, response) - return -} - -func NewCreateAddressTemplateGroupRequest() (request *CreateAddressTemplateGroupRequest) { - request = &CreateAddressTemplateGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateAddressTemplateGroup") - - return -} - -func NewCreateAddressTemplateGroupResponse() (response *CreateAddressTemplateGroupResponse) { - response = &CreateAddressTemplateGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateAddressTemplateGroup -// 本接口(CreateAddressTemplateGroup)用于创建IP地址模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) CreateAddressTemplateGroup(request *CreateAddressTemplateGroupRequest) (response *CreateAddressTemplateGroupResponse, err error) { - return c.CreateAddressTemplateGroupWithContext(context.Background(), request) -} - -// CreateAddressTemplateGroup -// 本接口(CreateAddressTemplateGroup)用于创建IP地址模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) CreateAddressTemplateGroupWithContext(ctx context.Context, request *CreateAddressTemplateGroupRequest) (response *CreateAddressTemplateGroupResponse, err error) { - if request == nil { - request = NewCreateAddressTemplateGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateAddressTemplateGroup require credential") - } - - request.SetContext(ctx) - - response = NewCreateAddressTemplateGroupResponse() - err = c.Send(request, response) - return -} - -func NewCreateAndAttachNetworkInterfaceRequest() (request *CreateAndAttachNetworkInterfaceRequest) { - request = &CreateAndAttachNetworkInterfaceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateAndAttachNetworkInterface") - - return -} - -func NewCreateAndAttachNetworkInterfaceResponse() (response *CreateAndAttachNetworkInterfaceResponse) { - response = &CreateAndAttachNetworkInterfaceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateAndAttachNetworkInterface -// 本接口(CreateAndAttachNetworkInterface)用于创建弹性网卡并绑定云服务器。 -// -// * 创建弹性网卡时可以指定内网IP,并且可以指定一个主IP,指定的内网IP必须在弹性网卡所在子网内,而且不能被占用。 -// -// * 创建弹性网卡时可以指定需要申请的内网IP数量,系统会随机生成内网IP地址。 -// -// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见弹性网卡使用限制。 -// -// * 创建弹性网卡同时可以绑定已有安全组。 -// -// * 创建弹性网卡同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_RESOURCEMISMATCH = "UnsupportedOperation.ResourceMismatch" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -// UNSUPPORTEDOPERATION_UNSUPPORTEDINSTANCEFAMILY = "UnsupportedOperation.UnsupportedInstanceFamily" -func (c *Client) CreateAndAttachNetworkInterface(request *CreateAndAttachNetworkInterfaceRequest) (response *CreateAndAttachNetworkInterfaceResponse, err error) { - return c.CreateAndAttachNetworkInterfaceWithContext(context.Background(), request) -} - -// CreateAndAttachNetworkInterface -// 本接口(CreateAndAttachNetworkInterface)用于创建弹性网卡并绑定云服务器。 -// -// * 创建弹性网卡时可以指定内网IP,并且可以指定一个主IP,指定的内网IP必须在弹性网卡所在子网内,而且不能被占用。 -// -// * 创建弹性网卡时可以指定需要申请的内网IP数量,系统会随机生成内网IP地址。 -// -// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见弹性网卡使用限制。 -// -// * 创建弹性网卡同时可以绑定已有安全组。 -// -// * 创建弹性网卡同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_RESOURCEMISMATCH = "UnsupportedOperation.ResourceMismatch" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -// UNSUPPORTEDOPERATION_UNSUPPORTEDINSTANCEFAMILY = "UnsupportedOperation.UnsupportedInstanceFamily" -func (c *Client) CreateAndAttachNetworkInterfaceWithContext(ctx context.Context, request *CreateAndAttachNetworkInterfaceRequest) (response *CreateAndAttachNetworkInterfaceResponse, err error) { - if request == nil { - request = NewCreateAndAttachNetworkInterfaceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateAndAttachNetworkInterface require credential") - } - - request.SetContext(ctx) - - response = NewCreateAndAttachNetworkInterfaceResponse() - err = c.Send(request, response) - return -} - -func NewCreateAssistantCidrRequest() (request *CreateAssistantCidrRequest) { - request = &CreateAssistantCidrRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateAssistantCidr") - - return -} - -func NewCreateAssistantCidrResponse() (response *CreateAssistantCidrResponse) { - response = &CreateAssistantCidrResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateAssistantCidr -// 本接口(CreateAssistantCidr)用于批量创建辅助CIDR。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETOVERLAPASSISTCIDR = "InvalidParameterValue.SubnetOverlapAssistCidr" -// INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CreateAssistantCidr(request *CreateAssistantCidrRequest) (response *CreateAssistantCidrResponse, err error) { - return c.CreateAssistantCidrWithContext(context.Background(), request) -} - -// CreateAssistantCidr -// 本接口(CreateAssistantCidr)用于批量创建辅助CIDR。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETOVERLAPASSISTCIDR = "InvalidParameterValue.SubnetOverlapAssistCidr" -// INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CreateAssistantCidrWithContext(ctx context.Context, request *CreateAssistantCidrRequest) (response *CreateAssistantCidrResponse, err error) { - if request == nil { - request = NewCreateAssistantCidrRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateAssistantCidr require credential") - } - - request.SetContext(ctx) - - response = NewCreateAssistantCidrResponse() - err = c.Send(request, response) - return -} - -func NewCreateBandwidthPackageRequest() (request *CreateBandwidthPackageRequest) { - request = &CreateBandwidthPackageRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateBandwidthPackage") - - return -} - -func NewCreateBandwidthPackageResponse() (response *CreateBandwidthPackageResponse) { - response = &CreateBandwidthPackageResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateBandwidthPackage -// 本接口 (CreateBandwidthPackage) 支持创建[设备带宽包](https://cloud.tencent.com/document/product/684/15245#bwptype)和[IP带宽包](https://cloud.tencent.com/document/product/684/15245#bwptype)。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// LIMITEXCEEDED_BANDWIDTHPACKAGEQUOTA = "LimitExceeded.BandwidthPackageQuota" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ACCOUNTNOTSUPPORTED = "UnsupportedOperation.AccountNotSupported" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDRESOURCEINTERNETCHARGETYPE = "UnsupportedOperation.InvalidResourceInternetChargeType" -// UNSUPPORTEDOPERATION_NOTSUPPORTEDPURCHASECENTEREGRESSRESOURCE = "UnsupportedOperation.NotSupportedPurchaseCenterEgressResource" -// UNSUPPORTEDOPERATION_UNSUPPORTEDREGION = "UnsupportedOperation.UnsupportedRegion" -func (c *Client) CreateBandwidthPackage(request *CreateBandwidthPackageRequest) (response *CreateBandwidthPackageResponse, err error) { - return c.CreateBandwidthPackageWithContext(context.Background(), request) -} - -// CreateBandwidthPackage -// 本接口 (CreateBandwidthPackage) 支持创建[设备带宽包](https://cloud.tencent.com/document/product/684/15245#bwptype)和[IP带宽包](https://cloud.tencent.com/document/product/684/15245#bwptype)。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// LIMITEXCEEDED_BANDWIDTHPACKAGEQUOTA = "LimitExceeded.BandwidthPackageQuota" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ACCOUNTNOTSUPPORTED = "UnsupportedOperation.AccountNotSupported" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDRESOURCEINTERNETCHARGETYPE = "UnsupportedOperation.InvalidResourceInternetChargeType" -// UNSUPPORTEDOPERATION_NOTSUPPORTEDPURCHASECENTEREGRESSRESOURCE = "UnsupportedOperation.NotSupportedPurchaseCenterEgressResource" -// UNSUPPORTEDOPERATION_UNSUPPORTEDREGION = "UnsupportedOperation.UnsupportedRegion" -func (c *Client) CreateBandwidthPackageWithContext(ctx context.Context, request *CreateBandwidthPackageRequest) (response *CreateBandwidthPackageResponse, err error) { - if request == nil { - request = NewCreateBandwidthPackageRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateBandwidthPackage require credential") - } - - request.SetContext(ctx) - - response = NewCreateBandwidthPackageResponse() - err = c.Send(request, response) - return -} - -func NewCreateCcnRequest() (request *CreateCcnRequest) { - request = &CreateCcnRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateCcn") - - return -} - -func NewCreateCcnResponse() (response *CreateCcnResponse) { - response = &CreateCcnResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateCcn -// 本接口(CreateCcn)用于创建云联网(CCN)。
    -// -// * 创建云联网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// * 每个账号能创建的云联网实例个数是有限的,详请参考产品文档。如果需要扩充请联系在线客服。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTINTERREGIONLIMIT = "UnsupportedOperation.PrepaidCcnOnlySupportInterRegionLimit" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -// UNSUPPORTEDOPERATION_USERANDCCNCHARGETYPENOTMATCH = "UnsupportedOperation.UserAndCcnChargeTypeNotMatch" -func (c *Client) CreateCcn(request *CreateCcnRequest) (response *CreateCcnResponse, err error) { - return c.CreateCcnWithContext(context.Background(), request) -} - -// CreateCcn -// 本接口(CreateCcn)用于创建云联网(CCN)。
    -// -// * 创建云联网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// * 每个账号能创建的云联网实例个数是有限的,详请参考产品文档。如果需要扩充请联系在线客服。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTINTERREGIONLIMIT = "UnsupportedOperation.PrepaidCcnOnlySupportInterRegionLimit" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -// UNSUPPORTEDOPERATION_USERANDCCNCHARGETYPENOTMATCH = "UnsupportedOperation.UserAndCcnChargeTypeNotMatch" -func (c *Client) CreateCcnWithContext(ctx context.Context, request *CreateCcnRequest) (response *CreateCcnResponse, err error) { - if request == nil { - request = NewCreateCcnRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateCcn require credential") - } - - request.SetContext(ctx) - - response = NewCreateCcnResponse() - err = c.Send(request, response) - return -} - -func NewCreateCustomerGatewayRequest() (request *CreateCustomerGatewayRequest) { - request = &CreateCustomerGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateCustomerGateway") - - return -} - -func NewCreateCustomerGatewayResponse() (response *CreateCustomerGatewayResponse) { - response = &CreateCustomerGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateCustomerGateway -// 本接口(CreateCustomerGateway)用于创建对端网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -// VPCLIMITEXCEEDED = "VpcLimitExceeded" -func (c *Client) CreateCustomerGateway(request *CreateCustomerGatewayRequest) (response *CreateCustomerGatewayResponse, err error) { - return c.CreateCustomerGatewayWithContext(context.Background(), request) -} - -// CreateCustomerGateway -// 本接口(CreateCustomerGateway)用于创建对端网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -// VPCLIMITEXCEEDED = "VpcLimitExceeded" -func (c *Client) CreateCustomerGatewayWithContext(ctx context.Context, request *CreateCustomerGatewayRequest) (response *CreateCustomerGatewayResponse, err error) { - if request == nil { - request = NewCreateCustomerGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateCustomerGateway require credential") - } - - request.SetContext(ctx) - - response = NewCreateCustomerGatewayResponse() - err = c.Send(request, response) - return -} - -func NewCreateDefaultSecurityGroupRequest() (request *CreateDefaultSecurityGroupRequest) { - request = &CreateDefaultSecurityGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateDefaultSecurityGroup") - - return -} - -func NewCreateDefaultSecurityGroupResponse() (response *CreateDefaultSecurityGroupResponse) { - response = &CreateDefaultSecurityGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateDefaultSecurityGroup -// 本接口(CreateDefaultSecurityGroup)用于创建(如果项目下未存在默认安全组,则创建;已存在则获取。)默认安全组(SecurityGroup)。 -// -// * 每个账户下每个地域的每个项目的安全组数量限制。 -// -// * 默认安全组会放通所有IPv4规则,在创建后通常您需要再调用CreateSecurityGroupPolicies将安全组的规则设置为需要的规则。 -// -// * 创建安全组同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CreateDefaultSecurityGroup(request *CreateDefaultSecurityGroupRequest) (response *CreateDefaultSecurityGroupResponse, err error) { - return c.CreateDefaultSecurityGroupWithContext(context.Background(), request) -} - -// CreateDefaultSecurityGroup -// 本接口(CreateDefaultSecurityGroup)用于创建(如果项目下未存在默认安全组,则创建;已存在则获取。)默认安全组(SecurityGroup)。 -// -// * 每个账户下每个地域的每个项目的安全组数量限制。 -// -// * 默认安全组会放通所有IPv4规则,在创建后通常您需要再调用CreateSecurityGroupPolicies将安全组的规则设置为需要的规则。 -// -// * 创建安全组同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CreateDefaultSecurityGroupWithContext(ctx context.Context, request *CreateDefaultSecurityGroupRequest) (response *CreateDefaultSecurityGroupResponse, err error) { - if request == nil { - request = NewCreateDefaultSecurityGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateDefaultSecurityGroup require credential") - } - - request.SetContext(ctx) - - response = NewCreateDefaultSecurityGroupResponse() - err = c.Send(request, response) - return -} - -func NewCreateDefaultVpcRequest() (request *CreateDefaultVpcRequest) { - request = &CreateDefaultVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateDefaultVpc") - - return -} - -func NewCreateDefaultVpcResponse() (response *CreateDefaultVpcResponse) { - response = &CreateDefaultVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateDefaultVpc -// 本接口(CreateDefaultVpc)用于创建默认私有网络(VPC)。 -// -// 默认VPC适用于快速入门和启动公共实例,您可以像使用任何其他VPC一样使用默认VPC。如果您想创建标准VPC,即指定VPC名称、VPC网段、子网网段、子网可用区,请使用常规创建VPC接口(CreateVpc) -// -// 正常情况,本接口并不一定生产默认VPC,而是根据用户账号的网络属性(DescribeAccountAttributes)来决定的 -// -// * 支持基础网络、VPC,返回VpcId为0 -// -// * 只支持VPC,返回默认VPC信息 -// -// 您也可以通过 Force 参数,强制返回默认VPC。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_SUBNETOVERLAP = "InvalidParameterValue.SubnetOverlap" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINSUFFICIENT_CIDRBLOCK = "ResourceInsufficient.CidrBlock" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -func (c *Client) CreateDefaultVpc(request *CreateDefaultVpcRequest) (response *CreateDefaultVpcResponse, err error) { - return c.CreateDefaultVpcWithContext(context.Background(), request) -} - -// CreateDefaultVpc -// 本接口(CreateDefaultVpc)用于创建默认私有网络(VPC)。 -// -// 默认VPC适用于快速入门和启动公共实例,您可以像使用任何其他VPC一样使用默认VPC。如果您想创建标准VPC,即指定VPC名称、VPC网段、子网网段、子网可用区,请使用常规创建VPC接口(CreateVpc) -// -// 正常情况,本接口并不一定生产默认VPC,而是根据用户账号的网络属性(DescribeAccountAttributes)来决定的 -// -// * 支持基础网络、VPC,返回VpcId为0 -// -// * 只支持VPC,返回默认VPC信息 -// -// 您也可以通过 Force 参数,强制返回默认VPC。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_SUBNETOVERLAP = "InvalidParameterValue.SubnetOverlap" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINSUFFICIENT_CIDRBLOCK = "ResourceInsufficient.CidrBlock" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -func (c *Client) CreateDefaultVpcWithContext(ctx context.Context, request *CreateDefaultVpcRequest) (response *CreateDefaultVpcResponse, err error) { - if request == nil { - request = NewCreateDefaultVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateDefaultVpc require credential") - } - - request.SetContext(ctx) - - response = NewCreateDefaultVpcResponse() - err = c.Send(request, response) - return -} - -func NewCreateDhcpIpRequest() (request *CreateDhcpIpRequest) { - request = &CreateDhcpIpRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateDhcpIp") - - return -} - -func NewCreateDhcpIpResponse() (response *CreateDhcpIpResponse) { - response = &CreateDhcpIpResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateDhcpIp -// 本接口(CreateDhcpIp)用于创建DhcpIp。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CreateDhcpIp(request *CreateDhcpIpRequest) (response *CreateDhcpIpResponse, err error) { - return c.CreateDhcpIpWithContext(context.Background(), request) -} - -// CreateDhcpIp -// 本接口(CreateDhcpIp)用于创建DhcpIp。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CreateDhcpIpWithContext(ctx context.Context, request *CreateDhcpIpRequest) (response *CreateDhcpIpResponse, err error) { - if request == nil { - request = NewCreateDhcpIpRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateDhcpIp require credential") - } - - request.SetContext(ctx) - - response = NewCreateDhcpIpResponse() - err = c.Send(request, response) - return -} - -func NewCreateDirectConnectGatewayRequest() (request *CreateDirectConnectGatewayRequest) { - request = &CreateDirectConnectGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateDirectConnectGateway") - - return -} - -func NewCreateDirectConnectGatewayResponse() (response *CreateDirectConnectGatewayResponse) { - response = &CreateDirectConnectGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateDirectConnectGateway -// 本接口(CreateDirectConnectGateway)用于创建专线网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_VPGHAGROUPNOTFOUND = "InvalidParameter.VpgHaGroupNotFound" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_CCNROUTETABLENOTEXIST = "UnsupportedOperation.CcnRouteTableNotExist" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -func (c *Client) CreateDirectConnectGateway(request *CreateDirectConnectGatewayRequest) (response *CreateDirectConnectGatewayResponse, err error) { - return c.CreateDirectConnectGatewayWithContext(context.Background(), request) -} - -// CreateDirectConnectGateway -// 本接口(CreateDirectConnectGateway)用于创建专线网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_VPGHAGROUPNOTFOUND = "InvalidParameter.VpgHaGroupNotFound" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_CCNROUTETABLENOTEXIST = "UnsupportedOperation.CcnRouteTableNotExist" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -func (c *Client) CreateDirectConnectGatewayWithContext(ctx context.Context, request *CreateDirectConnectGatewayRequest) (response *CreateDirectConnectGatewayResponse, err error) { - if request == nil { - request = NewCreateDirectConnectGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateDirectConnectGateway require credential") - } - - request.SetContext(ctx) - - response = NewCreateDirectConnectGatewayResponse() - err = c.Send(request, response) - return -} - -func NewCreateDirectConnectGatewayCcnRoutesRequest() (request *CreateDirectConnectGatewayCcnRoutesRequest) { - request = &CreateDirectConnectGatewayCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateDirectConnectGatewayCcnRoutes") - - return -} - -func NewCreateDirectConnectGatewayCcnRoutesResponse() (response *CreateDirectConnectGatewayCcnRoutesResponse) { - response = &CreateDirectConnectGatewayCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateDirectConnectGatewayCcnRoutes -// 本接口(CreateDirectConnectGatewayCcnRoutes)用于创建专线网关的云联网路由(IDC网段) -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CreateDirectConnectGatewayCcnRoutes(request *CreateDirectConnectGatewayCcnRoutesRequest) (response *CreateDirectConnectGatewayCcnRoutesResponse, err error) { - return c.CreateDirectConnectGatewayCcnRoutesWithContext(context.Background(), request) -} - -// CreateDirectConnectGatewayCcnRoutes -// 本接口(CreateDirectConnectGatewayCcnRoutes)用于创建专线网关的云联网路由(IDC网段) -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) CreateDirectConnectGatewayCcnRoutesWithContext(ctx context.Context, request *CreateDirectConnectGatewayCcnRoutesRequest) (response *CreateDirectConnectGatewayCcnRoutesResponse, err error) { - if request == nil { - request = NewCreateDirectConnectGatewayCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateDirectConnectGatewayCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewCreateDirectConnectGatewayCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewCreateFlowLogRequest() (request *CreateFlowLogRequest) { - request = &CreateFlowLogRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateFlowLog") - - return -} - -func NewCreateFlowLogResponse() (response *CreateFlowLogResponse) { - response = &CreateFlowLogResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateFlowLog -// 本接口(CreateFlowLog)用于创建网络流日志。 -// -// 可能返回的错误码: -// -// INTERNALERROR_CREATECKAFKAROUTEERROR = "InternalError.CreateCkafkaRouteError" -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION_DPDKNATFLOWLOGONLYSUPPORTALLTRAFFICTYPE = "UnsupportedOperation.DpdkNatFlowLogOnlySupportAllTrafficType" -// UNSUPPORTEDOPERATION_FLOWLOGINSTANCEEXISTED = "UnsupportedOperation.FlowLogInstanceExisted" -// UNSUPPORTEDOPERATION_FLOWLOGSNOTSUPPORTKOINSTANCEENI = "UnsupportedOperation.FlowLogsNotSupportKoInstanceEni" -// UNSUPPORTEDOPERATION_FLOWLOGSNOTSUPPORTNULLINSTANCEENI = "UnsupportedOperation.FlowLogsNotSupportNullInstanceEni" -// UNSUPPORTEDOPERATION_ONLYSUPPORTPROFESSIONKAFKA = "UnsupportedOperation.OnlySupportProfessionKafka" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateFlowLog(request *CreateFlowLogRequest) (response *CreateFlowLogResponse, err error) { - return c.CreateFlowLogWithContext(context.Background(), request) -} - -// CreateFlowLog -// 本接口(CreateFlowLog)用于创建网络流日志。 -// -// 可能返回的错误码: -// -// INTERNALERROR_CREATECKAFKAROUTEERROR = "InternalError.CreateCkafkaRouteError" -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION_DPDKNATFLOWLOGONLYSUPPORTALLTRAFFICTYPE = "UnsupportedOperation.DpdkNatFlowLogOnlySupportAllTrafficType" -// UNSUPPORTEDOPERATION_FLOWLOGINSTANCEEXISTED = "UnsupportedOperation.FlowLogInstanceExisted" -// UNSUPPORTEDOPERATION_FLOWLOGSNOTSUPPORTKOINSTANCEENI = "UnsupportedOperation.FlowLogsNotSupportKoInstanceEni" -// UNSUPPORTEDOPERATION_FLOWLOGSNOTSUPPORTNULLINSTANCEENI = "UnsupportedOperation.FlowLogsNotSupportNullInstanceEni" -// UNSUPPORTEDOPERATION_ONLYSUPPORTPROFESSIONKAFKA = "UnsupportedOperation.OnlySupportProfessionKafka" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateFlowLogWithContext(ctx context.Context, request *CreateFlowLogRequest) (response *CreateFlowLogResponse, err error) { - if request == nil { - request = NewCreateFlowLogRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateFlowLog require credential") - } - - request.SetContext(ctx) - - response = NewCreateFlowLogResponse() - err = c.Send(request, response) - return -} - -func NewCreateHaVipRequest() (request *CreateHaVipRequest) { - request = &CreateHaVipRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateHaVip") - - return -} - -func NewCreateHaVipResponse() (response *CreateHaVipResponse) { - response = &CreateHaVipResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateHaVip -// 本接口(CreateHaVip)用于创建高可用虚拟IP(HAVIP)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_INVALIDBUSINESS = "InvalidParameterValue.InvalidBusiness" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SUBNETNOTEXISTS = "UnsupportedOperation.SubnetNotExists" -func (c *Client) CreateHaVip(request *CreateHaVipRequest) (response *CreateHaVipResponse, err error) { - return c.CreateHaVipWithContext(context.Background(), request) -} - -// CreateHaVip -// 本接口(CreateHaVip)用于创建高可用虚拟IP(HAVIP)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_INVALIDBUSINESS = "InvalidParameterValue.InvalidBusiness" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SUBNETNOTEXISTS = "UnsupportedOperation.SubnetNotExists" -func (c *Client) CreateHaVipWithContext(ctx context.Context, request *CreateHaVipRequest) (response *CreateHaVipResponse, err error) { - if request == nil { - request = NewCreateHaVipRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateHaVip require credential") - } - - request.SetContext(ctx) - - response = NewCreateHaVipResponse() - err = c.Send(request, response) - return -} - -func NewCreateIp6TranslatorsRequest() (request *CreateIp6TranslatorsRequest) { - request = &CreateIp6TranslatorsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateIp6Translators") - - return -} - -func NewCreateIp6TranslatorsResponse() (response *CreateIp6TranslatorsResponse) { - response = &CreateIp6TranslatorsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateIp6Translators -// 1. 该接口用于创建IPV6转换IPV4实例,支持批量 -// -// 2. 同一个账户在一个地域最多允许创建10个转换实例 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -func (c *Client) CreateIp6Translators(request *CreateIp6TranslatorsRequest) (response *CreateIp6TranslatorsResponse, err error) { - return c.CreateIp6TranslatorsWithContext(context.Background(), request) -} - -// CreateIp6Translators -// 1. 该接口用于创建IPV6转换IPV4实例,支持批量 -// -// 2. 同一个账户在一个地域最多允许创建10个转换实例 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -func (c *Client) CreateIp6TranslatorsWithContext(ctx context.Context, request *CreateIp6TranslatorsRequest) (response *CreateIp6TranslatorsResponse, err error) { - if request == nil { - request = NewCreateIp6TranslatorsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateIp6Translators require credential") - } - - request.SetContext(ctx) - - response = NewCreateIp6TranslatorsResponse() - err = c.Send(request, response) - return -} - -func NewCreateLocalGatewayRequest() (request *CreateLocalGatewayRequest) { - request = &CreateLocalGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateLocalGateway") - - return -} - -func NewCreateLocalGatewayResponse() (response *CreateLocalGatewayResponse) { - response = &CreateLocalGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateLocalGateway -// 本接口(CreateLocalGateway)用于创建用于CDC的本地网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_LOCALGATEWAYALREADYEXISTS = "UnsupportedOperation.LocalGatewayAlreadyExists" -func (c *Client) CreateLocalGateway(request *CreateLocalGatewayRequest) (response *CreateLocalGatewayResponse, err error) { - return c.CreateLocalGatewayWithContext(context.Background(), request) -} - -// CreateLocalGateway -// 本接口(CreateLocalGateway)用于创建用于CDC的本地网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_LOCALGATEWAYALREADYEXISTS = "UnsupportedOperation.LocalGatewayAlreadyExists" -func (c *Client) CreateLocalGatewayWithContext(ctx context.Context, request *CreateLocalGatewayRequest) (response *CreateLocalGatewayResponse, err error) { - if request == nil { - request = NewCreateLocalGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateLocalGateway require credential") - } - - request.SetContext(ctx) - - response = NewCreateLocalGatewayResponse() - err = c.Send(request, response) - return -} - -func NewCreateNatGatewayRequest() (request *CreateNatGatewayRequest) { - request = &CreateNatGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateNatGateway") - - return -} - -func NewCreateNatGatewayResponse() (response *CreateNatGatewayResponse) { - response = &CreateNatGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateNatGateway -// 本接口(CreateNatGateway)用于创建NAT网关。 -// -// 在对新建的NAT网关做其他操作前,需先确认此网关已被创建完成(DescribeNatGateway接口返回的实例State字段为AVAILABLE)。 -// -// 可能返回的错误码: -// -// ADDRESSQUOTALIMITEXCEEDED = "AddressQuotaLimitExceeded" -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSSTATE = "InvalidAddressState" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_EIPBRANDWIDTHOUTINVALID = "InvalidParameterValue.EIPBrandWidthOutInvalid" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDVPCID_MALFORMED = "InvalidVpcId.Malformed" -// INVALIDVPCID_NOTFOUND = "InvalidVpcId.NotFound" -// LIMITEXCEEDED_ADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.AddressQuotaLimitExceeded" -// LIMITEXCEEDED_DAILYALLOCATEADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.DailyAllocateAddressQuotaLimitExceeded" -// LIMITEXCEEDED_NATGATEWAYLIMITEXCEEDED = "LimitExceeded.NatGatewayLimitExceeded" -// LIMITEXCEEDED_NATGATEWAYPERVPCLIMITEXCEEDED = "LimitExceeded.NatGatewayPerVpcLimitExceeded" -// LIMITEXCEEDED_PUBLICIPADDRESSPERNATGATEWAYLIMITEXCEEDED = "LimitExceeded.PublicIpAddressPerNatGatewayLimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCEINUSE_ADDRESS = "ResourceInUse.Address" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_NATGATEWAYHADEIPUNASSOCIATE = "UnsupportedOperation.NatGatewayHadEipUnassociate" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTBGPIP = "UnsupportedOperation.PublicIpAddressIsNotBGPIp" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTEXISTED = "UnsupportedOperation.PublicIpAddressIsNotExisted" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSNOTBILLEDBYTRAFFIC = "UnsupportedOperation.PublicIpAddressNotBilledByTraffic" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateNatGateway(request *CreateNatGatewayRequest) (response *CreateNatGatewayResponse, err error) { - return c.CreateNatGatewayWithContext(context.Background(), request) -} - -// CreateNatGateway -// 本接口(CreateNatGateway)用于创建NAT网关。 -// -// 在对新建的NAT网关做其他操作前,需先确认此网关已被创建完成(DescribeNatGateway接口返回的实例State字段为AVAILABLE)。 -// -// 可能返回的错误码: -// -// ADDRESSQUOTALIMITEXCEEDED = "AddressQuotaLimitExceeded" -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSSTATE = "InvalidAddressState" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_EIPBRANDWIDTHOUTINVALID = "InvalidParameterValue.EIPBrandWidthOutInvalid" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDVPCID_MALFORMED = "InvalidVpcId.Malformed" -// INVALIDVPCID_NOTFOUND = "InvalidVpcId.NotFound" -// LIMITEXCEEDED_ADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.AddressQuotaLimitExceeded" -// LIMITEXCEEDED_DAILYALLOCATEADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.DailyAllocateAddressQuotaLimitExceeded" -// LIMITEXCEEDED_NATGATEWAYLIMITEXCEEDED = "LimitExceeded.NatGatewayLimitExceeded" -// LIMITEXCEEDED_NATGATEWAYPERVPCLIMITEXCEEDED = "LimitExceeded.NatGatewayPerVpcLimitExceeded" -// LIMITEXCEEDED_PUBLICIPADDRESSPERNATGATEWAYLIMITEXCEEDED = "LimitExceeded.PublicIpAddressPerNatGatewayLimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCEINUSE_ADDRESS = "ResourceInUse.Address" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_NATGATEWAYHADEIPUNASSOCIATE = "UnsupportedOperation.NatGatewayHadEipUnassociate" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTBGPIP = "UnsupportedOperation.PublicIpAddressIsNotBGPIp" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTEXISTED = "UnsupportedOperation.PublicIpAddressIsNotExisted" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSNOTBILLEDBYTRAFFIC = "UnsupportedOperation.PublicIpAddressNotBilledByTraffic" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateNatGatewayWithContext(ctx context.Context, request *CreateNatGatewayRequest) (response *CreateNatGatewayResponse, err error) { - if request == nil { - request = NewCreateNatGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateNatGateway require credential") - } - - request.SetContext(ctx) - - response = NewCreateNatGatewayResponse() - err = c.Send(request, response) - return -} - -func NewCreateNatGatewayDestinationIpPortTranslationNatRuleRequest() (request *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) { - request = &CreateNatGatewayDestinationIpPortTranslationNatRuleRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateNatGatewayDestinationIpPortTranslationNatRule") - - return -} - -func NewCreateNatGatewayDestinationIpPortTranslationNatRuleResponse() (response *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse) { - response = &CreateNatGatewayDestinationIpPortTranslationNatRuleResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateNatGatewayDestinationIpPortTranslationNatRule -// 本接口(CreateNatGatewayDestinationIpPortTranslationNatRule)用于创建NAT网关端口转发规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEEXISTED = "InvalidParameterValue.NatGatewayDnatRuleExisted" -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEPIPNEEDVM = "InvalidParameterValue.NatGatewayDnatRulePipNeedVm" -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEREPEATED = "InvalidParameterValue.NatGatewayDnatRuleRepeated" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_NATGATEWAYEIPNOTEXISTS = "UnsupportedOperation.NatGatewayEipNotExists" -func (c *Client) CreateNatGatewayDestinationIpPortTranslationNatRule(request *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { - return c.CreateNatGatewayDestinationIpPortTranslationNatRuleWithContext(context.Background(), request) -} - -// CreateNatGatewayDestinationIpPortTranslationNatRule -// 本接口(CreateNatGatewayDestinationIpPortTranslationNatRule)用于创建NAT网关端口转发规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEEXISTED = "InvalidParameterValue.NatGatewayDnatRuleExisted" -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEPIPNEEDVM = "InvalidParameterValue.NatGatewayDnatRulePipNeedVm" -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEREPEATED = "InvalidParameterValue.NatGatewayDnatRuleRepeated" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_NATGATEWAYEIPNOTEXISTS = "UnsupportedOperation.NatGatewayEipNotExists" -func (c *Client) CreateNatGatewayDestinationIpPortTranslationNatRuleWithContext(ctx context.Context, request *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { - if request == nil { - request = NewCreateNatGatewayDestinationIpPortTranslationNatRuleRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateNatGatewayDestinationIpPortTranslationNatRule require credential") - } - - request.SetContext(ctx) - - response = NewCreateNatGatewayDestinationIpPortTranslationNatRuleResponse() - err = c.Send(request, response) - return -} - -func NewCreateNatGatewaySourceIpTranslationNatRuleRequest() (request *CreateNatGatewaySourceIpTranslationNatRuleRequest) { - request = &CreateNatGatewaySourceIpTranslationNatRuleRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateNatGatewaySourceIpTranslationNatRule") - - return -} - -func NewCreateNatGatewaySourceIpTranslationNatRuleResponse() (response *CreateNatGatewaySourceIpTranslationNatRuleResponse) { - response = &CreateNatGatewaySourceIpTranslationNatRuleResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateNatGatewaySourceIpTranslationNatRule -// 本接口(CreateNatGatewaySourceIpTranslationNatRule)用于创建NAT网关SNAT规则 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NATSNATRULEEXISTS = "InvalidParameterValue.NatSnatRuleExists" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION_NATGATEWAYEIPNOTEXISTS = "UnsupportedOperation.NatGatewayEipNotExists" -// UNSUPPORTEDOPERATION_NATGATEWAYRULEPIPEXISTS = "UnsupportedOperation.NatGatewayRulePipExists" -// UNSUPPORTEDOPERATION_NATGATEWAYSNATPIPNEEDVM = "UnsupportedOperation.NatGatewaySnatPipNeedVm" -// UNSUPPORTEDOPERATION_NATGATEWAYTYPENOTSUPPORTSNAT = "UnsupportedOperation.NatGatewayTypeNotSupportSNAT" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) CreateNatGatewaySourceIpTranslationNatRule(request *CreateNatGatewaySourceIpTranslationNatRuleRequest) (response *CreateNatGatewaySourceIpTranslationNatRuleResponse, err error) { - return c.CreateNatGatewaySourceIpTranslationNatRuleWithContext(context.Background(), request) -} - -// CreateNatGatewaySourceIpTranslationNatRule -// 本接口(CreateNatGatewaySourceIpTranslationNatRule)用于创建NAT网关SNAT规则 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NATSNATRULEEXISTS = "InvalidParameterValue.NatSnatRuleExists" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION_NATGATEWAYEIPNOTEXISTS = "UnsupportedOperation.NatGatewayEipNotExists" -// UNSUPPORTEDOPERATION_NATGATEWAYRULEPIPEXISTS = "UnsupportedOperation.NatGatewayRulePipExists" -// UNSUPPORTEDOPERATION_NATGATEWAYSNATPIPNEEDVM = "UnsupportedOperation.NatGatewaySnatPipNeedVm" -// UNSUPPORTEDOPERATION_NATGATEWAYTYPENOTSUPPORTSNAT = "UnsupportedOperation.NatGatewayTypeNotSupportSNAT" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) CreateNatGatewaySourceIpTranslationNatRuleWithContext(ctx context.Context, request *CreateNatGatewaySourceIpTranslationNatRuleRequest) (response *CreateNatGatewaySourceIpTranslationNatRuleResponse, err error) { - if request == nil { - request = NewCreateNatGatewaySourceIpTranslationNatRuleRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateNatGatewaySourceIpTranslationNatRule require credential") - } - - request.SetContext(ctx) - - response = NewCreateNatGatewaySourceIpTranslationNatRuleResponse() - err = c.Send(request, response) - return -} - -func NewCreateNetDetectRequest() (request *CreateNetDetectRequest) { - request = &CreateNetDetectRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateNetDetect") - - return -} - -func NewCreateNetDetectResponse() (response *CreateNetDetectResponse) { - response = &CreateNetDetectResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateNetDetect -// 本接口(CreateNetDetect)用于创建网络探测。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_NEXTHOPMISMATCH = "InvalidParameter.NextHopMismatch" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NETDETECTINVPC = "InvalidParameterValue.NetDetectInVpc" -// INVALIDPARAMETERVALUE_NETDETECTNOTFOUNDIP = "InvalidParameterValue.NetDetectNotFoundIp" -// INVALIDPARAMETERVALUE_NETDETECTSAMEIP = "InvalidParameterValue.NetDetectSameIp" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) CreateNetDetect(request *CreateNetDetectRequest) (response *CreateNetDetectResponse, err error) { - return c.CreateNetDetectWithContext(context.Background(), request) -} - -// CreateNetDetect -// 本接口(CreateNetDetect)用于创建网络探测。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_NEXTHOPMISMATCH = "InvalidParameter.NextHopMismatch" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NETDETECTINVPC = "InvalidParameterValue.NetDetectInVpc" -// INVALIDPARAMETERVALUE_NETDETECTNOTFOUNDIP = "InvalidParameterValue.NetDetectNotFoundIp" -// INVALIDPARAMETERVALUE_NETDETECTSAMEIP = "InvalidParameterValue.NetDetectSameIp" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) CreateNetDetectWithContext(ctx context.Context, request *CreateNetDetectRequest) (response *CreateNetDetectResponse, err error) { - if request == nil { - request = NewCreateNetDetectRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateNetDetect require credential") - } - - request.SetContext(ctx) - - response = NewCreateNetDetectResponse() - err = c.Send(request, response) - return -} - -func NewCreateNetworkAclRequest() (request *CreateNetworkAclRequest) { - request = &CreateNetworkAclRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateNetworkAcl") - - return -} - -func NewCreateNetworkAclResponse() (response *CreateNetworkAclResponse) { - response = &CreateNetworkAclResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateNetworkAcl -// 本接口(CreateNetworkAcl)用于创建新的网络ACL。 -// -// * 新建的网络ACL的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用ModifyNetworkAclEntries将网络ACL的规则设置为需要的规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateNetworkAcl(request *CreateNetworkAclRequest) (response *CreateNetworkAclResponse, err error) { - return c.CreateNetworkAclWithContext(context.Background(), request) -} - -// CreateNetworkAcl -// 本接口(CreateNetworkAcl)用于创建新的网络ACL。 -// -// * 新建的网络ACL的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用ModifyNetworkAclEntries将网络ACL的规则设置为需要的规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateNetworkAclWithContext(ctx context.Context, request *CreateNetworkAclRequest) (response *CreateNetworkAclResponse, err error) { - if request == nil { - request = NewCreateNetworkAclRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateNetworkAcl require credential") - } - - request.SetContext(ctx) - - response = NewCreateNetworkAclResponse() - err = c.Send(request, response) - return -} - -func NewCreateNetworkAclQuintupleEntriesRequest() (request *CreateNetworkAclQuintupleEntriesRequest) { - request = &CreateNetworkAclQuintupleEntriesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateNetworkAclQuintupleEntries") - - return -} - -func NewCreateNetworkAclQuintupleEntriesResponse() (response *CreateNetworkAclQuintupleEntriesResponse) { - response = &CreateNetworkAclQuintupleEntriesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateNetworkAclQuintupleEntries -// 本接口(CreateNetworkAclQuintupleEntries)用于增量网络ACL五元组的入站规则和出站规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_ACLTYPEMISMATCH = "InvalidParameter.AclTypeMismatch" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) CreateNetworkAclQuintupleEntries(request *CreateNetworkAclQuintupleEntriesRequest) (response *CreateNetworkAclQuintupleEntriesResponse, err error) { - return c.CreateNetworkAclQuintupleEntriesWithContext(context.Background(), request) -} - -// CreateNetworkAclQuintupleEntries -// 本接口(CreateNetworkAclQuintupleEntries)用于增量网络ACL五元组的入站规则和出站规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_ACLTYPEMISMATCH = "InvalidParameter.AclTypeMismatch" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) CreateNetworkAclQuintupleEntriesWithContext(ctx context.Context, request *CreateNetworkAclQuintupleEntriesRequest) (response *CreateNetworkAclQuintupleEntriesResponse, err error) { - if request == nil { - request = NewCreateNetworkAclQuintupleEntriesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateNetworkAclQuintupleEntries require credential") - } - - request.SetContext(ctx) - - response = NewCreateNetworkAclQuintupleEntriesResponse() - err = c.Send(request, response) - return -} - -func NewCreateNetworkInterfaceRequest() (request *CreateNetworkInterfaceRequest) { - request = &CreateNetworkInterfaceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateNetworkInterface") - - return -} - -func NewCreateNetworkInterfaceResponse() (response *CreateNetworkInterfaceResponse) { - response = &CreateNetworkInterfaceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateNetworkInterface -// 本接口(CreateNetworkInterface)用于创建弹性网卡。 -// -// * 创建弹性网卡时可以指定内网IP,并且可以指定一个主IP,指定的内网IP必须在弹性网卡所在子网内,而且不能被占用。 -// -// * 创建弹性网卡时可以指定需要申请的内网IP数量,系统会随机生成内网IP地址。 -// -// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见弹性网卡使用限制。 -// -// * 创建弹性网卡同时可以绑定已有安全组。 -// -// * 创建弹性网卡同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_RESOURCEMISMATCH = "UnsupportedOperation.ResourceMismatch" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateNetworkInterface(request *CreateNetworkInterfaceRequest) (response *CreateNetworkInterfaceResponse, err error) { - return c.CreateNetworkInterfaceWithContext(context.Background(), request) -} - -// CreateNetworkInterface -// 本接口(CreateNetworkInterface)用于创建弹性网卡。 -// -// * 创建弹性网卡时可以指定内网IP,并且可以指定一个主IP,指定的内网IP必须在弹性网卡所在子网内,而且不能被占用。 -// -// * 创建弹性网卡时可以指定需要申请的内网IP数量,系统会随机生成内网IP地址。 -// -// * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见弹性网卡使用限制。 -// -// * 创建弹性网卡同时可以绑定已有安全组。 -// -// * 创建弹性网卡同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_RESOURCEMISMATCH = "UnsupportedOperation.ResourceMismatch" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateNetworkInterfaceWithContext(ctx context.Context, request *CreateNetworkInterfaceRequest) (response *CreateNetworkInterfaceResponse, err error) { - if request == nil { - request = NewCreateNetworkInterfaceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateNetworkInterface require credential") - } - - request.SetContext(ctx) - - response = NewCreateNetworkInterfaceResponse() - err = c.Send(request, response) - return -} - -func NewCreateRouteTableRequest() (request *CreateRouteTableRequest) { - request = &CreateRouteTableRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateRouteTable") - - return -} - -func NewCreateRouteTableResponse() (response *CreateRouteTableResponse) { - response = &CreateRouteTableResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateRouteTable -// 本接口(CreateRouteTable)用于创建路由表。 -// -// * 创建了VPC后,系统会创建一个默认路由表,所有新建的子网都会关联到默认路由表。默认情况下您可以直接使用默认路由表来管理您的路由策略。当您的路由策略较多时,您可以调用创建路由表接口创建更多路由表管理您的路由策略。 -// -// * 创建路由表同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateRouteTable(request *CreateRouteTableRequest) (response *CreateRouteTableResponse, err error) { - return c.CreateRouteTableWithContext(context.Background(), request) -} - -// CreateRouteTable -// 本接口(CreateRouteTable)用于创建路由表。 -// -// * 创建了VPC后,系统会创建一个默认路由表,所有新建的子网都会关联到默认路由表。默认情况下您可以直接使用默认路由表来管理您的路由策略。当您的路由策略较多时,您可以调用创建路由表接口创建更多路由表管理您的路由策略。 -// -// * 创建路由表同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateRouteTableWithContext(ctx context.Context, request *CreateRouteTableRequest) (response *CreateRouteTableResponse, err error) { - if request == nil { - request = NewCreateRouteTableRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateRouteTable require credential") - } - - request.SetContext(ctx) - - response = NewCreateRouteTableResponse() - err = c.Send(request, response) - return -} - -func NewCreateRoutesRequest() (request *CreateRoutesRequest) { - request = &CreateRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateRoutes") - - return -} - -func NewCreateRoutesResponse() (response *CreateRoutesResponse) { - response = &CreateRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateRoutes -// 本接口(CreateRoutes)用于创建路由策略。 -// -// * 向指定路由表批量新增路由策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CIDRNOTINPEERVPC = "InvalidParameterValue.CidrNotInPeerVpc" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CDCSUBNETNOTSUPPORTUNLOCALGATEWAY = "UnsupportedOperation.CdcSubnetNotSupportUnLocalGateway" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -// UNSUPPORTEDOPERATION_ECMPWITHCCNROUTE = "UnsupportedOperation.EcmpWithCcnRoute" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -// UNSUPPORTEDOPERATION_NORMALSUBNETNOTSUPPORTLOCALGATEWAY = "UnsupportedOperation.NormalSubnetNotSupportLocalGateway" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) CreateRoutes(request *CreateRoutesRequest) (response *CreateRoutesResponse, err error) { - return c.CreateRoutesWithContext(context.Background(), request) -} - -// CreateRoutes -// 本接口(CreateRoutes)用于创建路由策略。 -// -// * 向指定路由表批量新增路由策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CIDRNOTINPEERVPC = "InvalidParameterValue.CidrNotInPeerVpc" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CDCSUBNETNOTSUPPORTUNLOCALGATEWAY = "UnsupportedOperation.CdcSubnetNotSupportUnLocalGateway" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -// UNSUPPORTEDOPERATION_ECMPWITHCCNROUTE = "UnsupportedOperation.EcmpWithCcnRoute" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -// UNSUPPORTEDOPERATION_NORMALSUBNETNOTSUPPORTLOCALGATEWAY = "UnsupportedOperation.NormalSubnetNotSupportLocalGateway" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) CreateRoutesWithContext(ctx context.Context, request *CreateRoutesRequest) (response *CreateRoutesResponse, err error) { - if request == nil { - request = NewCreateRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateRoutes require credential") - } - - request.SetContext(ctx) - - response = NewCreateRoutesResponse() - err = c.Send(request, response) - return -} - -func NewCreateSecurityGroupRequest() (request *CreateSecurityGroupRequest) { - request = &CreateSecurityGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateSecurityGroup") - - return -} - -func NewCreateSecurityGroupResponse() (response *CreateSecurityGroupResponse) { - response = &CreateSecurityGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateSecurityGroup -// 本接口(CreateSecurityGroup)用于创建新的安全组(SecurityGroup)。 -// -// * 每个账户下每个地域的每个项目的安全组数量限制。 -// -// * 新建的安全组的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用CreateSecurityGroupPolicies将安全组的规则设置为需要的规则。 -// -// * 创建安全组同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateSecurityGroup(request *CreateSecurityGroupRequest) (response *CreateSecurityGroupResponse, err error) { - return c.CreateSecurityGroupWithContext(context.Background(), request) -} - -// CreateSecurityGroup -// 本接口(CreateSecurityGroup)用于创建新的安全组(SecurityGroup)。 -// -// * 每个账户下每个地域的每个项目的安全组数量限制。 -// -// * 新建的安全组的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用CreateSecurityGroupPolicies将安全组的规则设置为需要的规则。 -// -// * 创建安全组同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateSecurityGroupWithContext(ctx context.Context, request *CreateSecurityGroupRequest) (response *CreateSecurityGroupResponse, err error) { - if request == nil { - request = NewCreateSecurityGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateSecurityGroup require credential") - } - - request.SetContext(ctx) - - response = NewCreateSecurityGroupResponse() - err = c.Send(request, response) - return -} - -func NewCreateSecurityGroupPoliciesRequest() (request *CreateSecurityGroupPoliciesRequest) { - request = &CreateSecurityGroupPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateSecurityGroupPolicies") - - return -} - -func NewCreateSecurityGroupPoliciesResponse() (response *CreateSecurityGroupPoliciesResponse) { - response = &CreateSecurityGroupPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateSecurityGroupPolicies -// 本接口(CreateSecurityGroupPolicies)用于创建安全组规则(SecurityGroupPolicy)。 -// -// 在 SecurityGroupPolicySet 参数中: -// -//
      -// -//
    • Version 安全组规则版本号,用户每次更新安全规则版本会自动加1,防止您更新的路由规则已过期,不填不考虑冲突。
    • -// -//
    • 在创建出站和入站规则(Egress 和 Ingress)时:
        -// -//
      • Protocol 字段支持输入TCP, UDP, ICMP, ICMPV6, GRE, ALL。
      • -// -//
      • CidrBlock 字段允许输入符合cidr格式标准的任意字符串。在基础网络中,如果 CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
      • -// -//
      • Ipv6CidrBlock 字段允许输入符合IPv6 cidr格式标准的任意字符串。在基础网络中,如果Ipv6CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
      • -// -//
      • SecurityGroupId 字段允许输入与待修改的安全组位于相同项目中的安全组 ID,包括这个安全组 ID 本身,代表安全组下所有云服务器的内网 IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个 ID 所关联的云服务器变化而变化,不需要重新修改。
      • -// -//
      • Port 字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当 Protocol 字段是 TCP 或 UDP 时,Port 字段才被接受,即 Protocol 字段不是 TCP 或 UDP 时,Protocol 和 Port 排他关系,不允许同时输入,否则会接口报错。
      • -// -//
      • Action 字段只允许输入 ACCEPT 或 DROP。
      • -// -//
      • CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate 四者是排他关系,不允许同时输入,Protocol + Port 和 ServiceTemplate 二者是排他关系,不允许同时输入。IPv6CidrBlock和ICMP是排他关系,如需使用,请输入ICMPV6。
      • -// -//
      • 一次请求中只能创建单个方向的规则, 如果需要指定索引(PolicyIndex)参数, 多条规则的索引必须一致。如想在规则最前面插入一条,则填0即可,如果想在最后追加,该字段可不填。
      • -// -//
    -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_SECURITYGROUPPOLICYSET = "LimitExceeded.SecurityGroupPolicySet" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_CLBPOLICYEXCEEDLIMIT = "UnsupportedOperation.ClbPolicyExceedLimit" -// UNSUPPORTEDOPERATION_CLBPOLICYLIMIT = "UnsupportedOperation.ClbPolicyLimit" -// UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -// UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" -func (c *Client) CreateSecurityGroupPolicies(request *CreateSecurityGroupPoliciesRequest) (response *CreateSecurityGroupPoliciesResponse, err error) { - return c.CreateSecurityGroupPoliciesWithContext(context.Background(), request) -} - -// CreateSecurityGroupPolicies -// 本接口(CreateSecurityGroupPolicies)用于创建安全组规则(SecurityGroupPolicy)。 -// -// 在 SecurityGroupPolicySet 参数中: -// -//
      -// -//
    • Version 安全组规则版本号,用户每次更新安全规则版本会自动加1,防止您更新的路由规则已过期,不填不考虑冲突。
    • -// -//
    • 在创建出站和入站规则(Egress 和 Ingress)时:
        -// -//
      • Protocol 字段支持输入TCP, UDP, ICMP, ICMPV6, GRE, ALL。
      • -// -//
      • CidrBlock 字段允许输入符合cidr格式标准的任意字符串。在基础网络中,如果 CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
      • -// -//
      • Ipv6CidrBlock 字段允许输入符合IPv6 cidr格式标准的任意字符串。在基础网络中,如果Ipv6CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
      • -// -//
      • SecurityGroupId 字段允许输入与待修改的安全组位于相同项目中的安全组 ID,包括这个安全组 ID 本身,代表安全组下所有云服务器的内网 IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个 ID 所关联的云服务器变化而变化,不需要重新修改。
      • -// -//
      • Port 字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当 Protocol 字段是 TCP 或 UDP 时,Port 字段才被接受,即 Protocol 字段不是 TCP 或 UDP 时,Protocol 和 Port 排他关系,不允许同时输入,否则会接口报错。
      • -// -//
      • Action 字段只允许输入 ACCEPT 或 DROP。
      • -// -//
      • CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate 四者是排他关系,不允许同时输入,Protocol + Port 和 ServiceTemplate 二者是排他关系,不允许同时输入。IPv6CidrBlock和ICMP是排他关系,如需使用,请输入ICMPV6。
      • -// -//
      • 一次请求中只能创建单个方向的规则, 如果需要指定索引(PolicyIndex)参数, 多条规则的索引必须一致。如想在规则最前面插入一条,则填0即可,如果想在最后追加,该字段可不填。
      • -// -//
    -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_SECURITYGROUPPOLICYSET = "LimitExceeded.SecurityGroupPolicySet" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_CLBPOLICYEXCEEDLIMIT = "UnsupportedOperation.ClbPolicyExceedLimit" -// UNSUPPORTEDOPERATION_CLBPOLICYLIMIT = "UnsupportedOperation.ClbPolicyLimit" -// UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -// UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" -func (c *Client) CreateSecurityGroupPoliciesWithContext(ctx context.Context, request *CreateSecurityGroupPoliciesRequest) (response *CreateSecurityGroupPoliciesResponse, err error) { - if request == nil { - request = NewCreateSecurityGroupPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateSecurityGroupPolicies require credential") - } - - request.SetContext(ctx) - - response = NewCreateSecurityGroupPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewCreateSecurityGroupWithPoliciesRequest() (request *CreateSecurityGroupWithPoliciesRequest) { - request = &CreateSecurityGroupWithPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateSecurityGroupWithPolicies") - - return -} - -func NewCreateSecurityGroupWithPoliciesResponse() (response *CreateSecurityGroupWithPoliciesResponse) { - response = &CreateSecurityGroupWithPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateSecurityGroupWithPolicies -// 本接口(CreateSecurityGroupWithPolicies)用于创建新的安全组(SecurityGroup),并且可以同时添加安全组规则(SecurityGroupPolicy)。 -// -// * 每个账户下每个地域的每个项目的安全组数量限制。 -// -// * 新建的安全组的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用CreateSecurityGroupPolicies -// -// 将安全组的规则设置为需要的规则。 -// -// 安全组规则说明: -// -// * Version安全组规则版本号,用户每次更新安全规则版本会自动加1,防止您更新的路由规则已过期,不填不考虑冲突。 -// -// * Protocol字段支持输入TCP, UDP, ICMP, ICMPV6, GRE, ALL。 -// -// * CidrBlock字段允许输入符合cidr格式标准的任意字符串。(展开)在基础网络中,如果CidrBlock包含您的账户内的云服务器之外的设备在腾讯云的内网IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。 -// -// * Ipv6CidrBlock字段允许输入符合IPv6 cidr格式标准的任意字符串。(展开)在基础网络中,如果Ipv6CidrBlock包含您的账户内的云服务器之外的设备在腾讯云的内网IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。 -// -// * SecurityGroupId字段允许输入与待修改的安全组位于相同项目中的安全组ID,包括这个安全组ID本身,代表安全组下所有云服务器的内网IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个ID所关联的云服务器变化而变化,不需要重新修改。 -// -// * Port字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当Protocol字段是TCP或UDP时,Port字段才被接受,即Protocol字段不是TCP或UDP时,Protocol和Port是排他关系,不允许同时输入,否则会接口报错。 -// -// * Action字段只允许输入ACCEPT或DROP。 -// -// * CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate四者是排他关系,不允许同时输入,Protocol + Port和ServiceTemplate二者是排他关系,不允许同时输入。 -// -// * 一次请求中只能创建单个方向的规则, 如果需要指定索引(PolicyIndex)参数, 多条规则的索引必须一致。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -func (c *Client) CreateSecurityGroupWithPolicies(request *CreateSecurityGroupWithPoliciesRequest) (response *CreateSecurityGroupWithPoliciesResponse, err error) { - return c.CreateSecurityGroupWithPoliciesWithContext(context.Background(), request) -} - -// CreateSecurityGroupWithPolicies -// 本接口(CreateSecurityGroupWithPolicies)用于创建新的安全组(SecurityGroup),并且可以同时添加安全组规则(SecurityGroupPolicy)。 -// -// * 每个账户下每个地域的每个项目的安全组数量限制。 -// -// * 新建的安全组的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用CreateSecurityGroupPolicies -// -// 将安全组的规则设置为需要的规则。 -// -// 安全组规则说明: -// -// * Version安全组规则版本号,用户每次更新安全规则版本会自动加1,防止您更新的路由规则已过期,不填不考虑冲突。 -// -// * Protocol字段支持输入TCP, UDP, ICMP, ICMPV6, GRE, ALL。 -// -// * CidrBlock字段允许输入符合cidr格式标准的任意字符串。(展开)在基础网络中,如果CidrBlock包含您的账户内的云服务器之外的设备在腾讯云的内网IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。 -// -// * Ipv6CidrBlock字段允许输入符合IPv6 cidr格式标准的任意字符串。(展开)在基础网络中,如果Ipv6CidrBlock包含您的账户内的云服务器之外的设备在腾讯云的内网IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。 -// -// * SecurityGroupId字段允许输入与待修改的安全组位于相同项目中的安全组ID,包括这个安全组ID本身,代表安全组下所有云服务器的内网IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个ID所关联的云服务器变化而变化,不需要重新修改。 -// -// * Port字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当Protocol字段是TCP或UDP时,Port字段才被接受,即Protocol字段不是TCP或UDP时,Protocol和Port是排他关系,不允许同时输入,否则会接口报错。 -// -// * Action字段只允许输入ACCEPT或DROP。 -// -// * CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate四者是排他关系,不允许同时输入,Protocol + Port和ServiceTemplate二者是排他关系,不允许同时输入。 -// -// * 一次请求中只能创建单个方向的规则, 如果需要指定索引(PolicyIndex)参数, 多条规则的索引必须一致。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -func (c *Client) CreateSecurityGroupWithPoliciesWithContext(ctx context.Context, request *CreateSecurityGroupWithPoliciesRequest) (response *CreateSecurityGroupWithPoliciesResponse, err error) { - if request == nil { - request = NewCreateSecurityGroupWithPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateSecurityGroupWithPolicies require credential") - } - - request.SetContext(ctx) - - response = NewCreateSecurityGroupWithPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewCreateServiceTemplateRequest() (request *CreateServiceTemplateRequest) { - request = &CreateServiceTemplateRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateServiceTemplate") - - return -} - -func NewCreateServiceTemplateResponse() (response *CreateServiceTemplateResponse) { - response = &CreateServiceTemplateResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateServiceTemplate -// 本接口(CreateServiceTemplate)用于创建协议端口模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -func (c *Client) CreateServiceTemplate(request *CreateServiceTemplateRequest) (response *CreateServiceTemplateResponse, err error) { - return c.CreateServiceTemplateWithContext(context.Background(), request) -} - -// CreateServiceTemplate -// 本接口(CreateServiceTemplate)用于创建协议端口模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -func (c *Client) CreateServiceTemplateWithContext(ctx context.Context, request *CreateServiceTemplateRequest) (response *CreateServiceTemplateResponse, err error) { - if request == nil { - request = NewCreateServiceTemplateRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateServiceTemplate require credential") - } - - request.SetContext(ctx) - - response = NewCreateServiceTemplateResponse() - err = c.Send(request, response) - return -} - -func NewCreateServiceTemplateGroupRequest() (request *CreateServiceTemplateGroupRequest) { - request = &CreateServiceTemplateGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateServiceTemplateGroup") - - return -} - -func NewCreateServiceTemplateGroupResponse() (response *CreateServiceTemplateGroupResponse) { - response = &CreateServiceTemplateGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateServiceTemplateGroup -// 本接口(CreateServiceTemplateGroup)用于创建协议端口模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) CreateServiceTemplateGroup(request *CreateServiceTemplateGroupRequest) (response *CreateServiceTemplateGroupResponse, err error) { - return c.CreateServiceTemplateGroupWithContext(context.Background(), request) -} - -// CreateServiceTemplateGroup -// 本接口(CreateServiceTemplateGroup)用于创建协议端口模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) CreateServiceTemplateGroupWithContext(ctx context.Context, request *CreateServiceTemplateGroupRequest) (response *CreateServiceTemplateGroupResponse, err error) { - if request == nil { - request = NewCreateServiceTemplateGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateServiceTemplateGroup require credential") - } - - request.SetContext(ctx) - - response = NewCreateServiceTemplateGroupResponse() - err = c.Send(request, response) - return -} - -func NewCreateSnapshotPoliciesRequest() (request *CreateSnapshotPoliciesRequest) { - request = &CreateSnapshotPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateSnapshotPolicies") - - return -} - -func NewCreateSnapshotPoliciesResponse() (response *CreateSnapshotPoliciesResponse) { - response = &CreateSnapshotPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateSnapshotPolicies -// 本接口(CreateSnapshotPolicies)用于创建快照策略。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) CreateSnapshotPolicies(request *CreateSnapshotPoliciesRequest) (response *CreateSnapshotPoliciesResponse, err error) { - return c.CreateSnapshotPoliciesWithContext(context.Background(), request) -} - -// CreateSnapshotPolicies -// 本接口(CreateSnapshotPolicies)用于创建快照策略。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) CreateSnapshotPoliciesWithContext(ctx context.Context, request *CreateSnapshotPoliciesRequest) (response *CreateSnapshotPoliciesResponse, err error) { - if request == nil { - request = NewCreateSnapshotPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateSnapshotPolicies require credential") - } - - request.SetContext(ctx) - - response = NewCreateSnapshotPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewCreateSubnetRequest() (request *CreateSubnetRequest) { - request = &CreateSubnetRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateSubnet") - - return -} - -func NewCreateSubnetResponse() (response *CreateSubnetResponse) { - response = &CreateSubnetResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateSubnet -// 本接口(CreateSubnet)用于创建子网。 -// -// * 创建子网前必须创建好 VPC。 -// -// * 子网创建成功后,子网网段不能修改。子网网段必须在VPC网段内,可以和VPC网段相同(VPC有且只有一个子网时),建议子网网段在VPC网段内,预留网段给其他子网使用。 -// -// * 您可以创建的最小网段子网掩码为28(有16个IP地址),最大网段子网掩码为16(65,536个IP地址)。 -// -// * 同一个VPC内,多个子网的网段不能重叠。 -// -// * 子网创建后会自动关联到默认路由表。 -// -// * 创建子网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETOVERLAP = "InvalidParameterValue.SubnetOverlap" -// INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_ZONECONFLICT = "InvalidParameterValue.ZoneConflict" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_DCGATEWAYSNOTFOUNDINVPC = "UnsupportedOperation.DcGatewaysNotFoundInVpc" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateSubnet(request *CreateSubnetRequest) (response *CreateSubnetResponse, err error) { - return c.CreateSubnetWithContext(context.Background(), request) -} - -// CreateSubnet -// 本接口(CreateSubnet)用于创建子网。 -// -// * 创建子网前必须创建好 VPC。 -// -// * 子网创建成功后,子网网段不能修改。子网网段必须在VPC网段内,可以和VPC网段相同(VPC有且只有一个子网时),建议子网网段在VPC网段内,预留网段给其他子网使用。 -// -// * 您可以创建的最小网段子网掩码为28(有16个IP地址),最大网段子网掩码为16(65,536个IP地址)。 -// -// * 同一个VPC内,多个子网的网段不能重叠。 -// -// * 子网创建后会自动关联到默认路由表。 -// -// * 创建子网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETOVERLAP = "InvalidParameterValue.SubnetOverlap" -// INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_ZONECONFLICT = "InvalidParameterValue.ZoneConflict" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_DCGATEWAYSNOTFOUNDINVPC = "UnsupportedOperation.DcGatewaysNotFoundInVpc" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateSubnetWithContext(ctx context.Context, request *CreateSubnetRequest) (response *CreateSubnetResponse, err error) { - if request == nil { - request = NewCreateSubnetRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateSubnet require credential") - } - - request.SetContext(ctx) - - response = NewCreateSubnetResponse() - err = c.Send(request, response) - return -} - -func NewCreateSubnetsRequest() (request *CreateSubnetsRequest) { - request = &CreateSubnetsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateSubnets") - - return -} - -func NewCreateSubnetsResponse() (response *CreateSubnetsResponse) { - response = &CreateSubnetsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateSubnets -// 本接口(CreateSubnets)用于批量创建子网。 -// -// * 创建子网前必须创建好 VPC。 -// -// * 子网创建成功后,子网网段不能修改。子网网段必须在VPC网段内,可以和VPC网段相同(VPC有且只有一个子网时),建议子网网段在VPC网段内,预留网段给其他子网使用。 -// -// * 您可以创建的最小网段子网掩码为28(有16个IP地址),最大网段子网掩码为16(65,536个IP地址)。 -// -// * 同一个VPC内,多个子网的网段不能重叠。 -// -// * 子网创建后会自动关联到默认路由表。 -// -// * 创建子网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_ZONECONFLICT = "InvalidParameterValue.ZoneConflict" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_DCGATEWAYSNOTFOUNDINVPC = "UnsupportedOperation.DcGatewaysNotFoundInVpc" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateSubnets(request *CreateSubnetsRequest) (response *CreateSubnetsResponse, err error) { - return c.CreateSubnetsWithContext(context.Background(), request) -} - -// CreateSubnets -// 本接口(CreateSubnets)用于批量创建子网。 -// -// * 创建子网前必须创建好 VPC。 -// -// * 子网创建成功后,子网网段不能修改。子网网段必须在VPC网段内,可以和VPC网段相同(VPC有且只有一个子网时),建议子网网段在VPC网段内,预留网段给其他子网使用。 -// -// * 您可以创建的最小网段子网掩码为28(有16个IP地址),最大网段子网掩码为16(65,536个IP地址)。 -// -// * 同一个VPC内,多个子网的网段不能重叠。 -// -// * 子网创建后会自动关联到默认路由表。 -// -// * 创建子网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_ZONECONFLICT = "InvalidParameterValue.ZoneConflict" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_DCGATEWAYSNOTFOUNDINVPC = "UnsupportedOperation.DcGatewaysNotFoundInVpc" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateSubnetsWithContext(ctx context.Context, request *CreateSubnetsRequest) (response *CreateSubnetsResponse, err error) { - if request == nil { - request = NewCreateSubnetsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateSubnets require credential") - } - - request.SetContext(ctx) - - response = NewCreateSubnetsResponse() - err = c.Send(request, response) - return -} - -func NewCreateTrafficPackagesRequest() (request *CreateTrafficPackagesRequest) { - request = &CreateTrafficPackagesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateTrafficPackages") - - return -} - -func NewCreateTrafficPackagesResponse() (response *CreateTrafficPackagesResponse) { - response = &CreateTrafficPackagesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateTrafficPackages -// 本接口 (CreateTrafficPackages) 用于创建共享流量包。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// LIMITEXCEEDED_TRAFFICPACKAGEQUOTA = "LimitExceeded.TrafficPackageQuota" -// UNSUPPORTEDOPERATION_UNSUPPORTEDREGION = "UnsupportedOperation.UnsupportedRegion" -func (c *Client) CreateTrafficPackages(request *CreateTrafficPackagesRequest) (response *CreateTrafficPackagesResponse, err error) { - return c.CreateTrafficPackagesWithContext(context.Background(), request) -} - -// CreateTrafficPackages -// 本接口 (CreateTrafficPackages) 用于创建共享流量包。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// LIMITEXCEEDED_TRAFFICPACKAGEQUOTA = "LimitExceeded.TrafficPackageQuota" -// UNSUPPORTEDOPERATION_UNSUPPORTEDREGION = "UnsupportedOperation.UnsupportedRegion" -func (c *Client) CreateTrafficPackagesWithContext(ctx context.Context, request *CreateTrafficPackagesRequest) (response *CreateTrafficPackagesResponse, err error) { - if request == nil { - request = NewCreateTrafficPackagesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateTrafficPackages require credential") - } - - request.SetContext(ctx) - - response = NewCreateTrafficPackagesResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpcRequest() (request *CreateVpcRequest) { - request = &CreateVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpc") - - return -} - -func NewCreateVpcResponse() (response *CreateVpcResponse) { - response = &CreateVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpc -// 本接口(CreateVpc)用于创建私有网络(VPC)。 -// -// * 用户可以创建的最小网段子网掩码为28(有16个IP地址),10.0.0.0/12,172.16.0.0/12最大网段子网掩码为12(1,048,576个IP地址),192.168.0.0/16最大网段子网掩码为16(65,536个IP地址)如果需要规划VPC网段请参见[网络规划](https://cloud.tencent.com/document/product/215/30313)。 -// -// * 同一个地域能创建的VPC资源个数也是有限制的,详见 VPC使用限制,如果需要申请更多资源,请提交[工单申请](https://console.cloud.tencent.com/workorder/category)。 -// -// * 创建VPC同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETOVERLAP = "InvalidParameterValue.SubnetOverlap" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_ENABLEMULTICAST = "UnsupportedOperation.EnableMulticast" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateVpc(request *CreateVpcRequest) (response *CreateVpcResponse, err error) { - return c.CreateVpcWithContext(context.Background(), request) -} - -// CreateVpc -// 本接口(CreateVpc)用于创建私有网络(VPC)。 -// -// * 用户可以创建的最小网段子网掩码为28(有16个IP地址),10.0.0.0/12,172.16.0.0/12最大网段子网掩码为12(1,048,576个IP地址),192.168.0.0/16最大网段子网掩码为16(65,536个IP地址)如果需要规划VPC网段请参见[网络规划](https://cloud.tencent.com/document/product/215/30313)。 -// -// * 同一个地域能创建的VPC资源个数也是有限制的,详见 VPC使用限制,如果需要申请更多资源,请提交[工单申请](https://console.cloud.tencent.com/workorder/category)。 -// -// * 创建VPC同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETOVERLAP = "InvalidParameterValue.SubnetOverlap" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_ENABLEMULTICAST = "UnsupportedOperation.EnableMulticast" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateVpcWithContext(ctx context.Context, request *CreateVpcRequest) (response *CreateVpcResponse, err error) { - if request == nil { - request = NewCreateVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpc require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpcResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpcEndPointRequest() (request *CreateVpcEndPointRequest) { - request = &CreateVpcEndPointRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpcEndPoint") - - return -} - -func NewCreateVpcEndPointResponse() (response *CreateVpcEndPointResponse) { - response = &CreateVpcEndPointResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpcEndPoint -// 本接口(CreateVpcEndPoint)用于创建终端节点。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// RESOURCEUNAVAILABLE_SERVICEWHITELISTNOTADDED = "ResourceUnavailable.ServiceWhiteListNotAdded" -// UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" -// UNSUPPORTEDOPERATION_ENDPOINTSERVICE = "UnsupportedOperation.EndPointService" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_SNATSUBNET = "UnsupportedOperation.SnatSubnet" -// UNSUPPORTEDOPERATION_SPECIALENDPOINTSERVICE = "UnsupportedOperation.SpecialEndPointService" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) CreateVpcEndPoint(request *CreateVpcEndPointRequest) (response *CreateVpcEndPointResponse, err error) { - return c.CreateVpcEndPointWithContext(context.Background(), request) -} - -// CreateVpcEndPoint -// 本接口(CreateVpcEndPoint)用于创建终端节点。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCEINSUFFICIENT = "ResourceInsufficient" -// RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// RESOURCEUNAVAILABLE_SERVICEWHITELISTNOTADDED = "ResourceUnavailable.ServiceWhiteListNotAdded" -// UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" -// UNSUPPORTEDOPERATION_ENDPOINTSERVICE = "UnsupportedOperation.EndPointService" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_SNATSUBNET = "UnsupportedOperation.SnatSubnet" -// UNSUPPORTEDOPERATION_SPECIALENDPOINTSERVICE = "UnsupportedOperation.SpecialEndPointService" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) CreateVpcEndPointWithContext(ctx context.Context, request *CreateVpcEndPointRequest) (response *CreateVpcEndPointResponse, err error) { - if request == nil { - request = NewCreateVpcEndPointRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpcEndPoint require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpcEndPointResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpcEndPointServiceRequest() (request *CreateVpcEndPointServiceRequest) { - request = &CreateVpcEndPointServiceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpcEndPointService") - - return -} - -func NewCreateVpcEndPointServiceResponse() (response *CreateVpcEndPointServiceResponse) { - response = &CreateVpcEndPointServiceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpcEndPointService -// 本接口(CreateVpcEndPointService)用于创建终端节点服务。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSTANCEMISMATCH = "UnsupportedOperation.InstanceMismatch" -// UNSUPPORTEDOPERATION_NOTMATCHTARGETSERVICE = "UnsupportedOperation.NotMatchTargetService" -// UNSUPPORTEDOPERATION_RESOURCEISINVALIDSTATE = "UnsupportedOperation.ResourceIsInvalidState" -// UNSUPPORTEDOPERATION_ROLENOTFOUND = "UnsupportedOperation.RoleNotFound" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) CreateVpcEndPointService(request *CreateVpcEndPointServiceRequest) (response *CreateVpcEndPointServiceResponse, err error) { - return c.CreateVpcEndPointServiceWithContext(context.Background(), request) -} - -// CreateVpcEndPointService -// 本接口(CreateVpcEndPointService)用于创建终端节点服务。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSTANCEMISMATCH = "UnsupportedOperation.InstanceMismatch" -// UNSUPPORTEDOPERATION_NOTMATCHTARGETSERVICE = "UnsupportedOperation.NotMatchTargetService" -// UNSUPPORTEDOPERATION_RESOURCEISINVALIDSTATE = "UnsupportedOperation.ResourceIsInvalidState" -// UNSUPPORTEDOPERATION_ROLENOTFOUND = "UnsupportedOperation.RoleNotFound" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) CreateVpcEndPointServiceWithContext(ctx context.Context, request *CreateVpcEndPointServiceRequest) (response *CreateVpcEndPointServiceResponse, err error) { - if request == nil { - request = NewCreateVpcEndPointServiceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpcEndPointService require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpcEndPointServiceResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpcEndPointServiceWhiteListRequest() (request *CreateVpcEndPointServiceWhiteListRequest) { - request = &CreateVpcEndPointServiceWhiteListRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpcEndPointServiceWhiteList") - - return -} - -func NewCreateVpcEndPointServiceWhiteListResponse() (response *CreateVpcEndPointServiceWhiteListResponse) { - response = &CreateVpcEndPointServiceWhiteListResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpcEndPointServiceWhiteList -// 本接口(CreateVpcEndPointServiceWhiteList)创建终端服务白名单。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) CreateVpcEndPointServiceWhiteList(request *CreateVpcEndPointServiceWhiteListRequest) (response *CreateVpcEndPointServiceWhiteListResponse, err error) { - return c.CreateVpcEndPointServiceWhiteListWithContext(context.Background(), request) -} - -// CreateVpcEndPointServiceWhiteList -// 本接口(CreateVpcEndPointServiceWhiteList)创建终端服务白名单。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) CreateVpcEndPointServiceWhiteListWithContext(ctx context.Context, request *CreateVpcEndPointServiceWhiteListRequest) (response *CreateVpcEndPointServiceWhiteListResponse, err error) { - if request == nil { - request = NewCreateVpcEndPointServiceWhiteListRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpcEndPointServiceWhiteList require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpcEndPointServiceWhiteListResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpcPeeringConnectionRequest() (request *CreateVpcPeeringConnectionRequest) { - request = &CreateVpcPeeringConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpcPeeringConnection") - - return -} - -func NewCreateVpcPeeringConnectionResponse() (response *CreateVpcPeeringConnectionResponse) { - response = &CreateVpcPeeringConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpcPeeringConnection -// 本接口(CreateVpcPeeringConnection)用于创建私有网络对等连接。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_DUPLICATEREGION = "InvalidParameterValue.DuplicateRegion" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_VPCPEERAVALIMITEXCEEDED = "LimitExceeded.VpcPeerAvaLimitExceeded" -// LIMITEXCEEDED_VPCPEERTOTALLIMITEXCEEDED = "LimitExceeded.VpcPeerTotalLimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_VPCPEERCIDRCONFLICT = "UnauthorizedOperation.VpcPeerCidrConflict" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_PURCHASELIMIT = "UnsupportedOperation.PurchaseLimit" -// UNSUPPORTEDOPERATION_VPCPEERALREADYEXIST = "UnsupportedOperation.VpcPeerAlreadyExist" -// UNSUPPORTEDOPERATION_VPCPEERCIDRCONFLICT = "UnsupportedOperation.VpcPeerCidrConflict" -func (c *Client) CreateVpcPeeringConnection(request *CreateVpcPeeringConnectionRequest) (response *CreateVpcPeeringConnectionResponse, err error) { - return c.CreateVpcPeeringConnectionWithContext(context.Background(), request) -} - -// CreateVpcPeeringConnection -// 本接口(CreateVpcPeeringConnection)用于创建私有网络对等连接。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_DUPLICATEREGION = "InvalidParameterValue.DuplicateRegion" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_VPCPEERAVALIMITEXCEEDED = "LimitExceeded.VpcPeerAvaLimitExceeded" -// LIMITEXCEEDED_VPCPEERTOTALLIMITEXCEEDED = "LimitExceeded.VpcPeerTotalLimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_VPCPEERCIDRCONFLICT = "UnauthorizedOperation.VpcPeerCidrConflict" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_PURCHASELIMIT = "UnsupportedOperation.PurchaseLimit" -// UNSUPPORTEDOPERATION_VPCPEERALREADYEXIST = "UnsupportedOperation.VpcPeerAlreadyExist" -// UNSUPPORTEDOPERATION_VPCPEERCIDRCONFLICT = "UnsupportedOperation.VpcPeerCidrConflict" -func (c *Client) CreateVpcPeeringConnectionWithContext(ctx context.Context, request *CreateVpcPeeringConnectionRequest) (response *CreateVpcPeeringConnectionResponse, err error) { - if request == nil { - request = NewCreateVpcPeeringConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpcPeeringConnection require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpcPeeringConnectionResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpnConnectionRequest() (request *CreateVpnConnectionRequest) { - request = &CreateVpnConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpnConnection") - - return -} - -func NewCreateVpnConnectionResponse() (response *CreateVpnConnectionResponse) { - response = &CreateVpnConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpnConnection -// 本接口(CreateVpnConnection)用于创建VPN通道。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// INVALIDPARAMETERVALUE_VPNCONNCIDRCONFLICT = "InvalidParameterValue.VpnConnCidrConflict" -// INVALIDPARAMETERVALUE_VPNCONNHEALTHCHECKIPCONFLICT = "InvalidParameterValue.VpnConnHealthCheckIpConflict" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateVpnConnection(request *CreateVpnConnectionRequest) (response *CreateVpnConnectionResponse, err error) { - return c.CreateVpnConnectionWithContext(context.Background(), request) -} - -// CreateVpnConnection -// 本接口(CreateVpnConnection)用于创建VPN通道。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// INVALIDPARAMETERVALUE_VPNCONNCIDRCONFLICT = "InvalidParameterValue.VpnConnCidrConflict" -// INVALIDPARAMETERVALUE_VPNCONNHEALTHCHECKIPCONFLICT = "InvalidParameterValue.VpnConnHealthCheckIpConflict" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -func (c *Client) CreateVpnConnectionWithContext(ctx context.Context, request *CreateVpnConnectionRequest) (response *CreateVpnConnectionResponse, err error) { - if request == nil { - request = NewCreateVpnConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpnConnection require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpnConnectionResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpnGatewayRequest() (request *CreateVpnGatewayRequest) { - request = &CreateVpnGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpnGateway") - - return -} - -func NewCreateVpnGatewayResponse() (response *CreateVpnGatewayResponse) { - response = &CreateVpnGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpnGateway -// 本接口(CreateVpnGateway)用于创建VPN网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_VPNCONNCIDRCONFLICT = "InvalidParameterValue.VpnConnCidrConflict" -// INVALIDVPCID_MALFORMED = "InvalidVpcId.Malformed" -// INVALIDVPCID_NOTFOUND = "InvalidVpcId.NotFound" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -// UNSUPPORTEDOPERATION_VPNGWVPCIDMUSTHAVE = "UnsupportedOperation.VpnGwVpcIdMustHave" -func (c *Client) CreateVpnGateway(request *CreateVpnGatewayRequest) (response *CreateVpnGatewayResponse, err error) { - return c.CreateVpnGatewayWithContext(context.Background(), request) -} - -// CreateVpnGateway -// 本接口(CreateVpnGateway)用于创建VPN网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" -// INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" -// INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" -// INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" -// INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" -// INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" -// INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" -// INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" -// INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" -// INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" -// INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" -// INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_VPNCONNCIDRCONFLICT = "InvalidParameterValue.VpnConnCidrConflict" -// INVALIDVPCID_MALFORMED = "InvalidVpcId.Malformed" -// INVALIDVPCID_NOTFOUND = "InvalidVpcId.NotFound" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" -// LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" -// LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" -// LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" -// LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" -// LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" -// UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" -// UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" -// UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" -// UNSUPPORTEDOPERATION_VPNGWVPCIDMUSTHAVE = "UnsupportedOperation.VpnGwVpcIdMustHave" -func (c *Client) CreateVpnGatewayWithContext(ctx context.Context, request *CreateVpnGatewayRequest) (response *CreateVpnGatewayResponse, err error) { - if request == nil { - request = NewCreateVpnGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpnGateway require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpnGatewayResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpnGatewayRoutesRequest() (request *CreateVpnGatewayRoutesRequest) { - request = &CreateVpnGatewayRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpnGatewayRoutes") - - return -} - -func NewCreateVpnGatewayRoutesResponse() (response *CreateVpnGatewayRoutesResponse) { - response = &CreateVpnGatewayRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpnGatewayRoutes -// 创建路由型VPN网关的目的路由 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) CreateVpnGatewayRoutes(request *CreateVpnGatewayRoutesRequest) (response *CreateVpnGatewayRoutesResponse, err error) { - return c.CreateVpnGatewayRoutesWithContext(context.Background(), request) -} - -// CreateVpnGatewayRoutes -// 创建路由型VPN网关的目的路由 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) CreateVpnGatewayRoutesWithContext(ctx context.Context, request *CreateVpnGatewayRoutesRequest) (response *CreateVpnGatewayRoutesResponse, err error) { - if request == nil { - request = NewCreateVpnGatewayRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpnGatewayRoutes require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpnGatewayRoutesResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpnGatewaySslClientRequest() (request *CreateVpnGatewaySslClientRequest) { - request = &CreateVpnGatewaySslClientRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpnGatewaySslClient") - - return -} - -func NewCreateVpnGatewaySslClientResponse() (response *CreateVpnGatewaySslClientResponse) { - response = &CreateVpnGatewaySslClientResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpnGatewaySslClient -// 创建SSL-VPN-CLIENT -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -func (c *Client) CreateVpnGatewaySslClient(request *CreateVpnGatewaySslClientRequest) (response *CreateVpnGatewaySslClientResponse, err error) { - return c.CreateVpnGatewaySslClientWithContext(context.Background(), request) -} - -// CreateVpnGatewaySslClient -// 创建SSL-VPN-CLIENT -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -func (c *Client) CreateVpnGatewaySslClientWithContext(ctx context.Context, request *CreateVpnGatewaySslClientRequest) (response *CreateVpnGatewaySslClientResponse, err error) { - if request == nil { - request = NewCreateVpnGatewaySslClientRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpnGatewaySslClient require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpnGatewaySslClientResponse() - err = c.Send(request, response) - return -} - -func NewCreateVpnGatewaySslServerRequest() (request *CreateVpnGatewaySslServerRequest) { - request = &CreateVpnGatewaySslServerRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "CreateVpnGatewaySslServer") - - return -} - -func NewCreateVpnGatewaySslServerResponse() (response *CreateVpnGatewaySslServerResponse) { - response = &CreateVpnGatewaySslServerResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// CreateVpnGatewaySslServer -// 本接口(CreateVpnGatewaySslServer)用于创建SSL-VPN Server端。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_CIDRNOTINSSLVPNVPC = "InvalidParameterValue.CidrNotInSslVpnVpc" -// INVALIDPARAMETERVALUE_SSLCCNVPNSERVERCIDRCONFLICT = "InvalidParameterValue.SslCcnVpnServerCidrConflict" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) CreateVpnGatewaySslServer(request *CreateVpnGatewaySslServerRequest) (response *CreateVpnGatewaySslServerResponse, err error) { - return c.CreateVpnGatewaySslServerWithContext(context.Background(), request) -} - -// CreateVpnGatewaySslServer -// 本接口(CreateVpnGatewaySslServer)用于创建SSL-VPN Server端。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_CIDRNOTINSSLVPNVPC = "InvalidParameterValue.CidrNotInSslVpnVpc" -// INVALIDPARAMETERVALUE_SSLCCNVPNSERVERCIDRCONFLICT = "InvalidParameterValue.SslCcnVpnServerCidrConflict" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) CreateVpnGatewaySslServerWithContext(ctx context.Context, request *CreateVpnGatewaySslServerRequest) (response *CreateVpnGatewaySslServerResponse, err error) { - if request == nil { - request = NewCreateVpnGatewaySslServerRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("CreateVpnGatewaySslServer require credential") - } - - request.SetContext(ctx) - - response = NewCreateVpnGatewaySslServerResponse() - err = c.Send(request, response) - return -} - -func NewDeleteAddressTemplateRequest() (request *DeleteAddressTemplateRequest) { - request = &DeleteAddressTemplateRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteAddressTemplate") - - return -} - -func NewDeleteAddressTemplateResponse() (response *DeleteAddressTemplateResponse) { - response = &DeleteAddressTemplateResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteAddressTemplate -// 本接口(DeleteAddressTemplate)用于删除IP地址模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteAddressTemplate(request *DeleteAddressTemplateRequest) (response *DeleteAddressTemplateResponse, err error) { - return c.DeleteAddressTemplateWithContext(context.Background(), request) -} - -// DeleteAddressTemplate -// 本接口(DeleteAddressTemplate)用于删除IP地址模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteAddressTemplateWithContext(ctx context.Context, request *DeleteAddressTemplateRequest) (response *DeleteAddressTemplateResponse, err error) { - if request == nil { - request = NewDeleteAddressTemplateRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteAddressTemplate require credential") - } - - request.SetContext(ctx) - - response = NewDeleteAddressTemplateResponse() - err = c.Send(request, response) - return -} - -func NewDeleteAddressTemplateGroupRequest() (request *DeleteAddressTemplateGroupRequest) { - request = &DeleteAddressTemplateGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteAddressTemplateGroup") - - return -} - -func NewDeleteAddressTemplateGroupResponse() (response *DeleteAddressTemplateGroupResponse) { - response = &DeleteAddressTemplateGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteAddressTemplateGroup -// 本接口(DeleteAddressTemplateGroup)用于删除IP地址模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteAddressTemplateGroup(request *DeleteAddressTemplateGroupRequest) (response *DeleteAddressTemplateGroupResponse, err error) { - return c.DeleteAddressTemplateGroupWithContext(context.Background(), request) -} - -// DeleteAddressTemplateGroup -// 本接口(DeleteAddressTemplateGroup)用于删除IP地址模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteAddressTemplateGroupWithContext(ctx context.Context, request *DeleteAddressTemplateGroupRequest) (response *DeleteAddressTemplateGroupResponse, err error) { - if request == nil { - request = NewDeleteAddressTemplateGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteAddressTemplateGroup require credential") - } - - request.SetContext(ctx) - - response = NewDeleteAddressTemplateGroupResponse() - err = c.Send(request, response) - return -} - -func NewDeleteAssistantCidrRequest() (request *DeleteAssistantCidrRequest) { - request = &DeleteAssistantCidrRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteAssistantCidr") - - return -} - -func NewDeleteAssistantCidrResponse() (response *DeleteAssistantCidrResponse) { - response = &DeleteAssistantCidrResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteAssistantCidr -// 本接口(DeleteAssistantCidr)用于删除辅助CIDR。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteAssistantCidr(request *DeleteAssistantCidrRequest) (response *DeleteAssistantCidrResponse, err error) { - return c.DeleteAssistantCidrWithContext(context.Background(), request) -} - -// DeleteAssistantCidr -// 本接口(DeleteAssistantCidr)用于删除辅助CIDR。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteAssistantCidrWithContext(ctx context.Context, request *DeleteAssistantCidrRequest) (response *DeleteAssistantCidrResponse, err error) { - if request == nil { - request = NewDeleteAssistantCidrRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteAssistantCidr require credential") - } - - request.SetContext(ctx) - - response = NewDeleteAssistantCidrResponse() - err = c.Send(request, response) - return -} - -func NewDeleteBandwidthPackageRequest() (request *DeleteBandwidthPackageRequest) { - request = &DeleteBandwidthPackageRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteBandwidthPackage") - - return -} - -func NewDeleteBandwidthPackageResponse() (response *DeleteBandwidthPackageResponse) { - response = &DeleteBandwidthPackageResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteBandwidthPackage -// 接口支持删除共享带宽包,包括[设备带宽包](https://cloud.tencent.com/document/product/684/15246#.E8.AE.BE.E5.A4.87.E5.B8.A6.E5.AE.BD.E5.8C.85)和[IP带宽包](https://cloud.tencent.com/document/product/684/15246#ip-.E5.B8.A6.E5.AE.BD.E5.8C.85) -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDREGION = "FailedOperation.InvalidRegion" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEINUSE = "InvalidParameterValue.BandwidthPackageInUse" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_STOPCHARGINGINSTANCEINUSE = "InvalidParameterValue.StopChargingInstanceInUse" -// LIMITEXCEEDED_ACCOUNTRETURNQUOTA = "LimitExceeded.AccountReturnQuota" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDADDRESSSTATE = "UnsupportedOperation.InvalidAddressState" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) DeleteBandwidthPackage(request *DeleteBandwidthPackageRequest) (response *DeleteBandwidthPackageResponse, err error) { - return c.DeleteBandwidthPackageWithContext(context.Background(), request) -} - -// DeleteBandwidthPackage -// 接口支持删除共享带宽包,包括[设备带宽包](https://cloud.tencent.com/document/product/684/15246#.E8.AE.BE.E5.A4.87.E5.B8.A6.E5.AE.BD.E5.8C.85)和[IP带宽包](https://cloud.tencent.com/document/product/684/15246#ip-.E5.B8.A6.E5.AE.BD.E5.8C.85) -// -// 可能返回的错误码: -// -// FAILEDOPERATION_INVALIDREGION = "FailedOperation.InvalidRegion" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEINUSE = "InvalidParameterValue.BandwidthPackageInUse" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_STOPCHARGINGINSTANCEINUSE = "InvalidParameterValue.StopChargingInstanceInUse" -// LIMITEXCEEDED_ACCOUNTRETURNQUOTA = "LimitExceeded.AccountReturnQuota" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDADDRESSSTATE = "UnsupportedOperation.InvalidAddressState" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) DeleteBandwidthPackageWithContext(ctx context.Context, request *DeleteBandwidthPackageRequest) (response *DeleteBandwidthPackageResponse, err error) { - if request == nil { - request = NewDeleteBandwidthPackageRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteBandwidthPackage require credential") - } - - request.SetContext(ctx) - - response = NewDeleteBandwidthPackageResponse() - err = c.Send(request, response) - return -} - -func NewDeleteCcnRequest() (request *DeleteCcnRequest) { - request = &DeleteCcnRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteCcn") - - return -} - -func NewDeleteCcnResponse() (response *DeleteCcnResponse) { - response = &DeleteCcnResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteCcn -// 本接口(DeleteCcn)用于删除云联网。 -// -// * 删除后,云联网关联的所有实例间路由将被删除,网络将会中断,请务必确认 -// -// * 删除云联网是不可逆的操作,请谨慎处理。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_BANDWIDTHNOTEXPIRED = "UnsupportedOperation.BandwidthNotExpired" -// UNSUPPORTEDOPERATION_CCNHASFLOWLOG = "UnsupportedOperation.CcnHasFlowLog" -func (c *Client) DeleteCcn(request *DeleteCcnRequest) (response *DeleteCcnResponse, err error) { - return c.DeleteCcnWithContext(context.Background(), request) -} - -// DeleteCcn -// 本接口(DeleteCcn)用于删除云联网。 -// -// * 删除后,云联网关联的所有实例间路由将被删除,网络将会中断,请务必确认 -// -// * 删除云联网是不可逆的操作,请谨慎处理。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_BANDWIDTHNOTEXPIRED = "UnsupportedOperation.BandwidthNotExpired" -// UNSUPPORTEDOPERATION_CCNHASFLOWLOG = "UnsupportedOperation.CcnHasFlowLog" -func (c *Client) DeleteCcnWithContext(ctx context.Context, request *DeleteCcnRequest) (response *DeleteCcnResponse, err error) { - if request == nil { - request = NewDeleteCcnRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteCcn require credential") - } - - request.SetContext(ctx) - - response = NewDeleteCcnResponse() - err = c.Send(request, response) - return -} - -func NewDeleteCustomerGatewayRequest() (request *DeleteCustomerGatewayRequest) { - request = &DeleteCustomerGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteCustomerGateway") - - return -} - -func NewDeleteCustomerGatewayResponse() (response *DeleteCustomerGatewayResponse) { - response = &DeleteCustomerGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteCustomerGateway -// 本接口(DeleteCustomerGateway)用于删除对端网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) DeleteCustomerGateway(request *DeleteCustomerGatewayRequest) (response *DeleteCustomerGatewayResponse, err error) { - return c.DeleteCustomerGatewayWithContext(context.Background(), request) -} - -// DeleteCustomerGateway -// 本接口(DeleteCustomerGateway)用于删除对端网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) DeleteCustomerGatewayWithContext(ctx context.Context, request *DeleteCustomerGatewayRequest) (response *DeleteCustomerGatewayResponse, err error) { - if request == nil { - request = NewDeleteCustomerGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteCustomerGateway require credential") - } - - request.SetContext(ctx) - - response = NewDeleteCustomerGatewayResponse() - err = c.Send(request, response) - return -} - -func NewDeleteDhcpIpRequest() (request *DeleteDhcpIpRequest) { - request = &DeleteDhcpIpRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteDhcpIp") - - return -} - -func NewDeleteDhcpIpResponse() (response *DeleteDhcpIpResponse) { - response = &DeleteDhcpIpResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteDhcpIp -// 本接口(DeleteDhcpIp)用于删除DhcpIp。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DeleteDhcpIp(request *DeleteDhcpIpRequest) (response *DeleteDhcpIpResponse, err error) { - return c.DeleteDhcpIpWithContext(context.Background(), request) -} - -// DeleteDhcpIp -// 本接口(DeleteDhcpIp)用于删除DhcpIp。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DeleteDhcpIpWithContext(ctx context.Context, request *DeleteDhcpIpRequest) (response *DeleteDhcpIpResponse, err error) { - if request == nil { - request = NewDeleteDhcpIpRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteDhcpIp require credential") - } - - request.SetContext(ctx) - - response = NewDeleteDhcpIpResponse() - err = c.Send(request, response) - return -} - -func NewDeleteDirectConnectGatewayRequest() (request *DeleteDirectConnectGatewayRequest) { - request = &DeleteDirectConnectGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteDirectConnectGateway") - - return -} - -func NewDeleteDirectConnectGatewayResponse() (response *DeleteDirectConnectGatewayResponse) { - response = &DeleteDirectConnectGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteDirectConnectGateway -// 本接口(DeleteDirectConnectGateway)用于删除专线网关。 -// -//
  • 如果是 NAT 网关,删除专线网关后,NAT 规则以及 ACL 策略都被清理了。
  • -// -//
  • 删除专线网关后,系统会删除路由表中跟该专线网关相关的路由策略。
  • -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_DCGATEWAYNATRULEEXISTS = "UnsupportedOperation.DCGatewayNatRuleExists" -// UNSUPPORTEDOPERATION_ROUTETABLEHASSUBNETRULE = "UnsupportedOperation.RouteTableHasSubnetRule" -func (c *Client) DeleteDirectConnectGateway(request *DeleteDirectConnectGatewayRequest) (response *DeleteDirectConnectGatewayResponse, err error) { - return c.DeleteDirectConnectGatewayWithContext(context.Background(), request) -} - -// DeleteDirectConnectGateway -// 本接口(DeleteDirectConnectGateway)用于删除专线网关。 -// -//
  • 如果是 NAT 网关,删除专线网关后,NAT 规则以及 ACL 策略都被清理了。
  • -// -//
  • 删除专线网关后,系统会删除路由表中跟该专线网关相关的路由策略。
  • -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_DCGATEWAYNATRULEEXISTS = "UnsupportedOperation.DCGatewayNatRuleExists" -// UNSUPPORTEDOPERATION_ROUTETABLEHASSUBNETRULE = "UnsupportedOperation.RouteTableHasSubnetRule" -func (c *Client) DeleteDirectConnectGatewayWithContext(ctx context.Context, request *DeleteDirectConnectGatewayRequest) (response *DeleteDirectConnectGatewayResponse, err error) { - if request == nil { - request = NewDeleteDirectConnectGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteDirectConnectGateway require credential") - } - - request.SetContext(ctx) - - response = NewDeleteDirectConnectGatewayResponse() - err = c.Send(request, response) - return -} - -func NewDeleteDirectConnectGatewayCcnRoutesRequest() (request *DeleteDirectConnectGatewayCcnRoutesRequest) { - request = &DeleteDirectConnectGatewayCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteDirectConnectGatewayCcnRoutes") - - return -} - -func NewDeleteDirectConnectGatewayCcnRoutesResponse() (response *DeleteDirectConnectGatewayCcnRoutesResponse) { - response = &DeleteDirectConnectGatewayCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteDirectConnectGatewayCcnRoutes -// 本接口(DeleteDirectConnectGatewayCcnRoutes)用于删除专线网关的云联网路由(IDC网段) -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteDirectConnectGatewayCcnRoutes(request *DeleteDirectConnectGatewayCcnRoutesRequest) (response *DeleteDirectConnectGatewayCcnRoutesResponse, err error) { - return c.DeleteDirectConnectGatewayCcnRoutesWithContext(context.Background(), request) -} - -// DeleteDirectConnectGatewayCcnRoutes -// 本接口(DeleteDirectConnectGatewayCcnRoutes)用于删除专线网关的云联网路由(IDC网段) -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteDirectConnectGatewayCcnRoutesWithContext(ctx context.Context, request *DeleteDirectConnectGatewayCcnRoutesRequest) (response *DeleteDirectConnectGatewayCcnRoutesResponse, err error) { - if request == nil { - request = NewDeleteDirectConnectGatewayCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteDirectConnectGatewayCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDeleteDirectConnectGatewayCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDeleteFlowLogRequest() (request *DeleteFlowLogRequest) { - request = &DeleteFlowLogRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteFlowLog") - - return -} - -func NewDeleteFlowLogResponse() (response *DeleteFlowLogResponse) { - response = &DeleteFlowLogResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteFlowLog -// 本接口(DeleteFlowLog)用于删除流日志。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteFlowLog(request *DeleteFlowLogRequest) (response *DeleteFlowLogResponse, err error) { - return c.DeleteFlowLogWithContext(context.Background(), request) -} - -// DeleteFlowLog -// 本接口(DeleteFlowLog)用于删除流日志。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteFlowLogWithContext(ctx context.Context, request *DeleteFlowLogRequest) (response *DeleteFlowLogResponse, err error) { - if request == nil { - request = NewDeleteFlowLogRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteFlowLog require credential") - } - - request.SetContext(ctx) - - response = NewDeleteFlowLogResponse() - err = c.Send(request, response) - return -} - -func NewDeleteHaVipRequest() (request *DeleteHaVipRequest) { - request = &DeleteHaVipRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteHaVip") - - return -} - -func NewDeleteHaVipResponse() (response *DeleteHaVipResponse) { - response = &DeleteHaVipResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteHaVip -// 本接口(DeleteHaVip)用于删除高可用虚拟IP(HAVIP)。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DeleteHaVip(request *DeleteHaVipRequest) (response *DeleteHaVipResponse, err error) { - return c.DeleteHaVipWithContext(context.Background(), request) -} - -// DeleteHaVip -// 本接口(DeleteHaVip)用于删除高可用虚拟IP(HAVIP)。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DeleteHaVipWithContext(ctx context.Context, request *DeleteHaVipRequest) (response *DeleteHaVipResponse, err error) { - if request == nil { - request = NewDeleteHaVipRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteHaVip require credential") - } - - request.SetContext(ctx) - - response = NewDeleteHaVipResponse() - err = c.Send(request, response) - return -} - -func NewDeleteIp6TranslatorsRequest() (request *DeleteIp6TranslatorsRequest) { - request = &DeleteIp6TranslatorsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteIp6Translators") - - return -} - -func NewDeleteIp6TranslatorsResponse() (response *DeleteIp6TranslatorsResponse) { - response = &DeleteIp6TranslatorsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteIp6Translators -// 1. 该接口用于释放IPV6转换实例,支持批量。 -// -// 2. 如果IPV6转换实例建立有转换规则,会一并删除。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_IP6TRANSLATORNOTFOUND = "InvalidParameterValue.Ip6TranslatorNotFound" -func (c *Client) DeleteIp6Translators(request *DeleteIp6TranslatorsRequest) (response *DeleteIp6TranslatorsResponse, err error) { - return c.DeleteIp6TranslatorsWithContext(context.Background(), request) -} - -// DeleteIp6Translators -// 1. 该接口用于释放IPV6转换实例,支持批量。 -// -// 2. 如果IPV6转换实例建立有转换规则,会一并删除。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_IP6TRANSLATORNOTFOUND = "InvalidParameterValue.Ip6TranslatorNotFound" -func (c *Client) DeleteIp6TranslatorsWithContext(ctx context.Context, request *DeleteIp6TranslatorsRequest) (response *DeleteIp6TranslatorsResponse, err error) { - if request == nil { - request = NewDeleteIp6TranslatorsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteIp6Translators require credential") - } - - request.SetContext(ctx) - - response = NewDeleteIp6TranslatorsResponse() - err = c.Send(request, response) - return -} - -func NewDeleteLocalGatewayRequest() (request *DeleteLocalGatewayRequest) { - request = &DeleteLocalGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteLocalGateway") - - return -} - -func NewDeleteLocalGatewayResponse() (response *DeleteLocalGatewayResponse) { - response = &DeleteLocalGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteLocalGateway -// 本接口(DeleteLocalGateway)用于删除CDC的本地网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteLocalGateway(request *DeleteLocalGatewayRequest) (response *DeleteLocalGatewayResponse, err error) { - return c.DeleteLocalGatewayWithContext(context.Background(), request) -} - -// DeleteLocalGateway -// 本接口(DeleteLocalGateway)用于删除CDC的本地网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteLocalGatewayWithContext(ctx context.Context, request *DeleteLocalGatewayRequest) (response *DeleteLocalGatewayResponse, err error) { - if request == nil { - request = NewDeleteLocalGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteLocalGateway require credential") - } - - request.SetContext(ctx) - - response = NewDeleteLocalGatewayResponse() - err = c.Send(request, response) - return -} - -func NewDeleteNatGatewayRequest() (request *DeleteNatGatewayRequest) { - request = &DeleteNatGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteNatGateway") - - return -} - -func NewDeleteNatGatewayResponse() (response *DeleteNatGatewayResponse) { - response = &DeleteNatGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteNatGateway -// 本接口(DeleteNatGateway)用于删除NAT网关。 -// -// 删除 NAT 网关后,系统会自动删除路由表中包含此 NAT 网关的路由项,同时也会解绑弹性公网IP(EIP)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteNatGateway(request *DeleteNatGatewayRequest) (response *DeleteNatGatewayResponse, err error) { - return c.DeleteNatGatewayWithContext(context.Background(), request) -} - -// DeleteNatGateway -// 本接口(DeleteNatGateway)用于删除NAT网关。 -// -// 删除 NAT 网关后,系统会自动删除路由表中包含此 NAT 网关的路由项,同时也会解绑弹性公网IP(EIP)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteNatGatewayWithContext(ctx context.Context, request *DeleteNatGatewayRequest) (response *DeleteNatGatewayResponse, err error) { - if request == nil { - request = NewDeleteNatGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteNatGateway require credential") - } - - request.SetContext(ctx) - - response = NewDeleteNatGatewayResponse() - err = c.Send(request, response) - return -} - -func NewDeleteNatGatewayDestinationIpPortTranslationNatRuleRequest() (request *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) { - request = &DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteNatGatewayDestinationIpPortTranslationNatRule") - - return -} - -func NewDeleteNatGatewayDestinationIpPortTranslationNatRuleResponse() (response *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse) { - response = &DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteNatGatewayDestinationIpPortTranslationNatRule -// 本接口(DeleteNatGatewayDestinationIpPortTranslationNatRule)用于删除NAT网关端口转发规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULENOTEXISTS = "InvalidParameterValue.NatGatewayDnatRuleNotExists" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteNatGatewayDestinationIpPortTranslationNatRule(request *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { - return c.DeleteNatGatewayDestinationIpPortTranslationNatRuleWithContext(context.Background(), request) -} - -// DeleteNatGatewayDestinationIpPortTranslationNatRule -// 本接口(DeleteNatGatewayDestinationIpPortTranslationNatRule)用于删除NAT网关端口转发规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULENOTEXISTS = "InvalidParameterValue.NatGatewayDnatRuleNotExists" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteNatGatewayDestinationIpPortTranslationNatRuleWithContext(ctx context.Context, request *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { - if request == nil { - request = NewDeleteNatGatewayDestinationIpPortTranslationNatRuleRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteNatGatewayDestinationIpPortTranslationNatRule require credential") - } - - request.SetContext(ctx) - - response = NewDeleteNatGatewayDestinationIpPortTranslationNatRuleResponse() - err = c.Send(request, response) - return -} - -func NewDeleteNatGatewaySourceIpTranslationNatRuleRequest() (request *DeleteNatGatewaySourceIpTranslationNatRuleRequest) { - request = &DeleteNatGatewaySourceIpTranslationNatRuleRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteNatGatewaySourceIpTranslationNatRule") - - return -} - -func NewDeleteNatGatewaySourceIpTranslationNatRuleResponse() (response *DeleteNatGatewaySourceIpTranslationNatRuleResponse) { - response = &DeleteNatGatewaySourceIpTranslationNatRuleResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteNatGatewaySourceIpTranslationNatRule -// 本接口(DeleteNatGatewaySourceIpTranslationNatRule)用于删除NAT网关端口SNAT转发规则。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NATGATEWAYSNATRULENOTEXISTS = "InvalidParameterValue.NatGatewaySnatRuleNotExists" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteNatGatewaySourceIpTranslationNatRule(request *DeleteNatGatewaySourceIpTranslationNatRuleRequest) (response *DeleteNatGatewaySourceIpTranslationNatRuleResponse, err error) { - return c.DeleteNatGatewaySourceIpTranslationNatRuleWithContext(context.Background(), request) -} - -// DeleteNatGatewaySourceIpTranslationNatRule -// 本接口(DeleteNatGatewaySourceIpTranslationNatRule)用于删除NAT网关端口SNAT转发规则。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NATGATEWAYSNATRULENOTEXISTS = "InvalidParameterValue.NatGatewaySnatRuleNotExists" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteNatGatewaySourceIpTranslationNatRuleWithContext(ctx context.Context, request *DeleteNatGatewaySourceIpTranslationNatRuleRequest) (response *DeleteNatGatewaySourceIpTranslationNatRuleResponse, err error) { - if request == nil { - request = NewDeleteNatGatewaySourceIpTranslationNatRuleRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteNatGatewaySourceIpTranslationNatRule require credential") - } - - request.SetContext(ctx) - - response = NewDeleteNatGatewaySourceIpTranslationNatRuleResponse() - err = c.Send(request, response) - return -} - -func NewDeleteNetDetectRequest() (request *DeleteNetDetectRequest) { - request = &DeleteNetDetectRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteNetDetect") - - return -} - -func NewDeleteNetDetectResponse() (response *DeleteNetDetectResponse) { - response = &DeleteNetDetectResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteNetDetect -// 本接口(DeleteNetDetect)用于删除网络探测实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) DeleteNetDetect(request *DeleteNetDetectRequest) (response *DeleteNetDetectResponse, err error) { - return c.DeleteNetDetectWithContext(context.Background(), request) -} - -// DeleteNetDetect -// 本接口(DeleteNetDetect)用于删除网络探测实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) DeleteNetDetectWithContext(ctx context.Context, request *DeleteNetDetectRequest) (response *DeleteNetDetectResponse, err error) { - if request == nil { - request = NewDeleteNetDetectRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteNetDetect require credential") - } - - request.SetContext(ctx) - - response = NewDeleteNetDetectResponse() - err = c.Send(request, response) - return -} - -func NewDeleteNetworkAclRequest() (request *DeleteNetworkAclRequest) { - request = &DeleteNetworkAclRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteNetworkAcl") - - return -} - -func NewDeleteNetworkAclResponse() (response *DeleteNetworkAclResponse) { - response = &DeleteNetworkAclResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteNetworkAcl -// 本接口(DeleteNetworkAcl)用于删除网络ACL。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) DeleteNetworkAcl(request *DeleteNetworkAclRequest) (response *DeleteNetworkAclResponse, err error) { - return c.DeleteNetworkAclWithContext(context.Background(), request) -} - -// DeleteNetworkAcl -// 本接口(DeleteNetworkAcl)用于删除网络ACL。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) DeleteNetworkAclWithContext(ctx context.Context, request *DeleteNetworkAclRequest) (response *DeleteNetworkAclResponse, err error) { - if request == nil { - request = NewDeleteNetworkAclRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteNetworkAcl require credential") - } - - request.SetContext(ctx) - - response = NewDeleteNetworkAclResponse() - err = c.Send(request, response) - return -} - -func NewDeleteNetworkAclQuintupleEntriesRequest() (request *DeleteNetworkAclQuintupleEntriesRequest) { - request = &DeleteNetworkAclQuintupleEntriesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteNetworkAclQuintupleEntries") - - return -} - -func NewDeleteNetworkAclQuintupleEntriesResponse() (response *DeleteNetworkAclQuintupleEntriesResponse) { - response = &DeleteNetworkAclQuintupleEntriesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteNetworkAclQuintupleEntries -// 本接口(DeleteNetworkAclQuintupleEntries)用于删除网络ACL五元组指定的入站规则和出站规则(但不是全量删除该ACL下的所有条目)。在NetworkAclQuintupleEntrySet参数中:NetworkAclQuintupleEntry需要提供NetworkAclQuintupleEntryId。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) DeleteNetworkAclQuintupleEntries(request *DeleteNetworkAclQuintupleEntriesRequest) (response *DeleteNetworkAclQuintupleEntriesResponse, err error) { - return c.DeleteNetworkAclQuintupleEntriesWithContext(context.Background(), request) -} - -// DeleteNetworkAclQuintupleEntries -// 本接口(DeleteNetworkAclQuintupleEntries)用于删除网络ACL五元组指定的入站规则和出站规则(但不是全量删除该ACL下的所有条目)。在NetworkAclQuintupleEntrySet参数中:NetworkAclQuintupleEntry需要提供NetworkAclQuintupleEntryId。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) DeleteNetworkAclQuintupleEntriesWithContext(ctx context.Context, request *DeleteNetworkAclQuintupleEntriesRequest) (response *DeleteNetworkAclQuintupleEntriesResponse, err error) { - if request == nil { - request = NewDeleteNetworkAclQuintupleEntriesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteNetworkAclQuintupleEntries require credential") - } - - request.SetContext(ctx) - - response = NewDeleteNetworkAclQuintupleEntriesResponse() - err = c.Send(request, response) - return -} - -func NewDeleteNetworkInterfaceRequest() (request *DeleteNetworkInterfaceRequest) { - request = &DeleteNetworkInterfaceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteNetworkInterface") - - return -} - -func NewDeleteNetworkInterfaceResponse() (response *DeleteNetworkInterfaceResponse) { - response = &DeleteNetworkInterfaceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteNetworkInterface -// 本接口(DeleteNetworkInterface)用于删除弹性网卡。 -// -// * 弹性网卡上绑定了云服务器时,不能被删除。 -// -// * 删除指定弹性网卡,弹性网卡必须先和子机解绑才能删除。删除之后弹性网卡上所有内网IP都将被退还。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) DeleteNetworkInterface(request *DeleteNetworkInterfaceRequest) (response *DeleteNetworkInterfaceResponse, err error) { - return c.DeleteNetworkInterfaceWithContext(context.Background(), request) -} - -// DeleteNetworkInterface -// 本接口(DeleteNetworkInterface)用于删除弹性网卡。 -// -// * 弹性网卡上绑定了云服务器时,不能被删除。 -// -// * 删除指定弹性网卡,弹性网卡必须先和子机解绑才能删除。删除之后弹性网卡上所有内网IP都将被退还。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) DeleteNetworkInterfaceWithContext(ctx context.Context, request *DeleteNetworkInterfaceRequest) (response *DeleteNetworkInterfaceResponse, err error) { - if request == nil { - request = NewDeleteNetworkInterfaceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteNetworkInterface require credential") - } - - request.SetContext(ctx) - - response = NewDeleteNetworkInterfaceResponse() - err = c.Send(request, response) - return -} - -func NewDeleteRouteTableRequest() (request *DeleteRouteTableRequest) { - request = &DeleteRouteTableRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteRouteTable") - - return -} - -func NewDeleteRouteTableResponse() (response *DeleteRouteTableResponse) { - response = &DeleteRouteTableResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteRouteTable -// 本接口(DeleteRouteTable)用于删除路由表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_DELDEFAULTROUTE = "UnsupportedOperation.DelDefaultRoute" -// UNSUPPORTEDOPERATION_DELROUTEWITHSUBNET = "UnsupportedOperation.DelRouteWithSubnet" -// UNSUPPORTEDOPERATION_NOTSUPPORTDELETEDEFAULTROUTETABLE = "UnsupportedOperation.NotSupportDeleteDefaultRouteTable" -// UNSUPPORTEDOPERATION_ROUTETABLEHASSUBNETRULE = "UnsupportedOperation.RouteTableHasSubnetRule" -func (c *Client) DeleteRouteTable(request *DeleteRouteTableRequest) (response *DeleteRouteTableResponse, err error) { - return c.DeleteRouteTableWithContext(context.Background(), request) -} - -// DeleteRouteTable -// 本接口(DeleteRouteTable)用于删除路由表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_DELDEFAULTROUTE = "UnsupportedOperation.DelDefaultRoute" -// UNSUPPORTEDOPERATION_DELROUTEWITHSUBNET = "UnsupportedOperation.DelRouteWithSubnet" -// UNSUPPORTEDOPERATION_NOTSUPPORTDELETEDEFAULTROUTETABLE = "UnsupportedOperation.NotSupportDeleteDefaultRouteTable" -// UNSUPPORTEDOPERATION_ROUTETABLEHASSUBNETRULE = "UnsupportedOperation.RouteTableHasSubnetRule" -func (c *Client) DeleteRouteTableWithContext(ctx context.Context, request *DeleteRouteTableRequest) (response *DeleteRouteTableResponse, err error) { - if request == nil { - request = NewDeleteRouteTableRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteRouteTable require credential") - } - - request.SetContext(ctx) - - response = NewDeleteRouteTableResponse() - err = c.Send(request, response) - return -} - -func NewDeleteRoutesRequest() (request *DeleteRoutesRequest) { - request = &DeleteRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteRoutes") - - return -} - -func NewDeleteRoutesResponse() (response *DeleteRoutesResponse) { - response = &DeleteRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteRoutes -// 本接口(DeleteRoutes)用于对某个路由表批量删除路由策略(Route)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_DISABLEDNOTIFYCCN = "UnsupportedOperation.DisabledNotifyCcn" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) DeleteRoutes(request *DeleteRoutesRequest) (response *DeleteRoutesResponse, err error) { - return c.DeleteRoutesWithContext(context.Background(), request) -} - -// DeleteRoutes -// 本接口(DeleteRoutes)用于对某个路由表批量删除路由策略(Route)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_DISABLEDNOTIFYCCN = "UnsupportedOperation.DisabledNotifyCcn" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) DeleteRoutesWithContext(ctx context.Context, request *DeleteRoutesRequest) (response *DeleteRoutesResponse, err error) { - if request == nil { - request = NewDeleteRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDeleteRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDeleteSecurityGroupRequest() (request *DeleteSecurityGroupRequest) { - request = &DeleteSecurityGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteSecurityGroup") - - return -} - -func NewDeleteSecurityGroupResponse() (response *DeleteSecurityGroupResponse) { - response = &DeleteSecurityGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteSecurityGroup -// 本接口(DeleteSecurityGroup)用于删除安全组(SecurityGroup)。 -// -// * 只有当前账号下的安全组允许被删除。 -// -// * 安全组实例ID如果在其他安全组的规则中被引用,则无法直接删除。这种情况下,需要先进行规则修改,再删除安全组。 -// -// * 删除的安全组无法再找回,请谨慎调用。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDSECURITYGROUPID_MALFORMED = "InvalidSecurityGroupID.Malformed" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupID.NotFound" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -func (c *Client) DeleteSecurityGroup(request *DeleteSecurityGroupRequest) (response *DeleteSecurityGroupResponse, err error) { - return c.DeleteSecurityGroupWithContext(context.Background(), request) -} - -// DeleteSecurityGroup -// 本接口(DeleteSecurityGroup)用于删除安全组(SecurityGroup)。 -// -// * 只有当前账号下的安全组允许被删除。 -// -// * 安全组实例ID如果在其他安全组的规则中被引用,则无法直接删除。这种情况下,需要先进行规则修改,再删除安全组。 -// -// * 删除的安全组无法再找回,请谨慎调用。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDSECURITYGROUPID_MALFORMED = "InvalidSecurityGroupID.Malformed" -// INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupID.NotFound" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -func (c *Client) DeleteSecurityGroupWithContext(ctx context.Context, request *DeleteSecurityGroupRequest) (response *DeleteSecurityGroupResponse, err error) { - if request == nil { - request = NewDeleteSecurityGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteSecurityGroup require credential") - } - - request.SetContext(ctx) - - response = NewDeleteSecurityGroupResponse() - err = c.Send(request, response) - return -} - -func NewDeleteSecurityGroupPoliciesRequest() (request *DeleteSecurityGroupPoliciesRequest) { - request = &DeleteSecurityGroupPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteSecurityGroupPolicies") - - return -} - -func NewDeleteSecurityGroupPoliciesResponse() (response *DeleteSecurityGroupPoliciesResponse) { - response = &DeleteSecurityGroupPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteSecurityGroupPolicies -// 本接口(DeleteSecurityGroupPolicies)用于用于删除安全组规则(SecurityGroupPolicy)。 -// -// * SecurityGroupPolicySet.Version 用于指定要操作的安全组的版本。传入 Version 版本号若不等于当前安全组的最新版本,将返回失败;若不传 Version 则直接删除指定PolicyIndex的规则。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -// UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" -func (c *Client) DeleteSecurityGroupPolicies(request *DeleteSecurityGroupPoliciesRequest) (response *DeleteSecurityGroupPoliciesResponse, err error) { - return c.DeleteSecurityGroupPoliciesWithContext(context.Background(), request) -} - -// DeleteSecurityGroupPolicies -// 本接口(DeleteSecurityGroupPolicies)用于用于删除安全组规则(SecurityGroupPolicy)。 -// -// * SecurityGroupPolicySet.Version 用于指定要操作的安全组的版本。传入 Version 版本号若不等于当前安全组的最新版本,将返回失败;若不传 Version 则直接删除指定PolicyIndex的规则。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -// UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" -func (c *Client) DeleteSecurityGroupPoliciesWithContext(ctx context.Context, request *DeleteSecurityGroupPoliciesRequest) (response *DeleteSecurityGroupPoliciesResponse, err error) { - if request == nil { - request = NewDeleteSecurityGroupPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteSecurityGroupPolicies require credential") - } - - request.SetContext(ctx) - - response = NewDeleteSecurityGroupPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewDeleteServiceTemplateRequest() (request *DeleteServiceTemplateRequest) { - request = &DeleteServiceTemplateRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteServiceTemplate") - - return -} - -func NewDeleteServiceTemplateResponse() (response *DeleteServiceTemplateResponse) { - response = &DeleteServiceTemplateResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteServiceTemplate -// 本接口(DeleteServiceTemplate)用于删除协议端口模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteServiceTemplate(request *DeleteServiceTemplateRequest) (response *DeleteServiceTemplateResponse, err error) { - return c.DeleteServiceTemplateWithContext(context.Background(), request) -} - -// DeleteServiceTemplate -// 本接口(DeleteServiceTemplate)用于删除协议端口模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteServiceTemplateWithContext(ctx context.Context, request *DeleteServiceTemplateRequest) (response *DeleteServiceTemplateResponse, err error) { - if request == nil { - request = NewDeleteServiceTemplateRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteServiceTemplate require credential") - } - - request.SetContext(ctx) - - response = NewDeleteServiceTemplateResponse() - err = c.Send(request, response) - return -} - -func NewDeleteServiceTemplateGroupRequest() (request *DeleteServiceTemplateGroupRequest) { - request = &DeleteServiceTemplateGroupRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteServiceTemplateGroup") - - return -} - -func NewDeleteServiceTemplateGroupResponse() (response *DeleteServiceTemplateGroupResponse) { - response = &DeleteServiceTemplateGroupResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteServiceTemplateGroup -// 本接口(DeleteServiceTemplateGroup)用于删除协议端口模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteServiceTemplateGroup(request *DeleteServiceTemplateGroupRequest) (response *DeleteServiceTemplateGroupResponse, err error) { - return c.DeleteServiceTemplateGroupWithContext(context.Background(), request) -} - -// DeleteServiceTemplateGroup -// 本接口(DeleteServiceTemplateGroup)用于删除协议端口模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteServiceTemplateGroupWithContext(ctx context.Context, request *DeleteServiceTemplateGroupRequest) (response *DeleteServiceTemplateGroupResponse, err error) { - if request == nil { - request = NewDeleteServiceTemplateGroupRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteServiceTemplateGroup require credential") - } - - request.SetContext(ctx) - - response = NewDeleteServiceTemplateGroupResponse() - err = c.Send(request, response) - return -} - -func NewDeleteSnapshotPoliciesRequest() (request *DeleteSnapshotPoliciesRequest) { - request = &DeleteSnapshotPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteSnapshotPolicies") - - return -} - -func NewDeleteSnapshotPoliciesResponse() (response *DeleteSnapshotPoliciesResponse) { - response = &DeleteSnapshotPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteSnapshotPolicies -// 本接口(DeleteSnapshotPolicies)用于删除快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteSnapshotPolicies(request *DeleteSnapshotPoliciesRequest) (response *DeleteSnapshotPoliciesResponse, err error) { - return c.DeleteSnapshotPoliciesWithContext(context.Background(), request) -} - -// DeleteSnapshotPolicies -// 本接口(DeleteSnapshotPolicies)用于删除快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteSnapshotPoliciesWithContext(ctx context.Context, request *DeleteSnapshotPoliciesRequest) (response *DeleteSnapshotPoliciesResponse, err error) { - if request == nil { - request = NewDeleteSnapshotPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteSnapshotPolicies require credential") - } - - request.SetContext(ctx) - - response = NewDeleteSnapshotPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewDeleteSubnetRequest() (request *DeleteSubnetRequest) { - request = &DeleteSubnetRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteSubnet") - - return -} - -func NewDeleteSubnetResponse() (response *DeleteSubnetResponse) { - response = &DeleteSubnetResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteSubnet -// 本接口(DeleteSubnet)用于删除子网(Subnet)。 -// -// * 删除子网前,请清理该子网下所有资源,包括云服务器、负载均衡、云数据、NoSQL、弹性网卡等资源。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_NATGATEWAYSNATRULENOTEXISTS = "UnsupportedOperation.NatGatewaySnatRuleNotExists" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) DeleteSubnet(request *DeleteSubnetRequest) (response *DeleteSubnetResponse, err error) { - return c.DeleteSubnetWithContext(context.Background(), request) -} - -// DeleteSubnet -// 本接口(DeleteSubnet)用于删除子网(Subnet)。 -// -// * 删除子网前,请清理该子网下所有资源,包括云服务器、负载均衡、云数据、NoSQL、弹性网卡等资源。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_NATGATEWAYSNATRULENOTEXISTS = "UnsupportedOperation.NatGatewaySnatRuleNotExists" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) DeleteSubnetWithContext(ctx context.Context, request *DeleteSubnetRequest) (response *DeleteSubnetResponse, err error) { - if request == nil { - request = NewDeleteSubnetRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteSubnet require credential") - } - - request.SetContext(ctx) - - response = NewDeleteSubnetResponse() - err = c.Send(request, response) - return -} - -func NewDeleteTemplateMemberRequest() (request *DeleteTemplateMemberRequest) { - request = &DeleteTemplateMemberRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteTemplateMember") - - return -} - -func NewDeleteTemplateMemberResponse() (response *DeleteTemplateMemberResponse) { - response = &DeleteTemplateMemberResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteTemplateMember -// 删除模板对象中的IP地址、协议端口、IP地址组、协议端口组。当前仅支持北京、泰国、北美地域请求。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteTemplateMember(request *DeleteTemplateMemberRequest) (response *DeleteTemplateMemberResponse, err error) { - return c.DeleteTemplateMemberWithContext(context.Background(), request) -} - -// DeleteTemplateMember -// 删除模板对象中的IP地址、协议端口、IP地址组、协议端口组。当前仅支持北京、泰国、北美地域请求。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteTemplateMemberWithContext(ctx context.Context, request *DeleteTemplateMemberRequest) (response *DeleteTemplateMemberResponse, err error) { - if request == nil { - request = NewDeleteTemplateMemberRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteTemplateMember require credential") - } - - request.SetContext(ctx) - - response = NewDeleteTemplateMemberResponse() - err = c.Send(request, response) - return -} - -func NewDeleteTrafficPackagesRequest() (request *DeleteTrafficPackagesRequest) { - request = &DeleteTrafficPackagesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteTrafficPackages") - - return -} - -func NewDeleteTrafficPackagesResponse() (response *DeleteTrafficPackagesResponse) { - response = &DeleteTrafficPackagesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteTrafficPackages -// 删除共享带宽包(仅非活动状态的流量包可删除)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_TRAFFICPACKAGEIDMALFORMED = "InvalidParameterValue.TrafficPackageIdMalformed" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGENOTFOUND = "InvalidParameterValue.TrafficPackageNotFound" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGENOTSUPPORTED = "InvalidParameterValue.TrafficPackageNotSupported" -func (c *Client) DeleteTrafficPackages(request *DeleteTrafficPackagesRequest) (response *DeleteTrafficPackagesResponse, err error) { - return c.DeleteTrafficPackagesWithContext(context.Background(), request) -} - -// DeleteTrafficPackages -// 删除共享带宽包(仅非活动状态的流量包可删除)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_TRAFFICPACKAGEIDMALFORMED = "InvalidParameterValue.TrafficPackageIdMalformed" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGENOTFOUND = "InvalidParameterValue.TrafficPackageNotFound" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGENOTSUPPORTED = "InvalidParameterValue.TrafficPackageNotSupported" -func (c *Client) DeleteTrafficPackagesWithContext(ctx context.Context, request *DeleteTrafficPackagesRequest) (response *DeleteTrafficPackagesResponse, err error) { - if request == nil { - request = NewDeleteTrafficPackagesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteTrafficPackages require credential") - } - - request.SetContext(ctx) - - response = NewDeleteTrafficPackagesResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpcRequest() (request *DeleteVpcRequest) { - request = &DeleteVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpc") - - return -} - -func NewDeleteVpcResponse() (response *DeleteVpcResponse) { - response = &DeleteVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpc -// 本接口(DeleteVpc)用于删除私有网络。 -// -// * 删除前请确保 VPC 内已经没有相关资源,例如云服务器、云数据库、NoSQL、VPN网关、专线网关、负载均衡、对等连接、与之互通的基础网络设备等。 -// -// * 删除私有网络是不可逆的操作,请谨慎处理。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -// UNSUPPORTEDOPERATION_ROUTETABLEHASSUBNETRULE = "UnsupportedOperation.RouteTableHasSubnetRule" -func (c *Client) DeleteVpc(request *DeleteVpcRequest) (response *DeleteVpcResponse, err error) { - return c.DeleteVpcWithContext(context.Background(), request) -} - -// DeleteVpc -// 本接口(DeleteVpc)用于删除私有网络。 -// -// * 删除前请确保 VPC 内已经没有相关资源,例如云服务器、云数据库、NoSQL、VPN网关、专线网关、负载均衡、对等连接、与之互通的基础网络设备等。 -// -// * 删除私有网络是不可逆的操作,请谨慎处理。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -// UNSUPPORTEDOPERATION_ROUTETABLEHASSUBNETRULE = "UnsupportedOperation.RouteTableHasSubnetRule" -func (c *Client) DeleteVpcWithContext(ctx context.Context, request *DeleteVpcRequest) (response *DeleteVpcResponse, err error) { - if request == nil { - request = NewDeleteVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpc require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpcResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpcEndPointRequest() (request *DeleteVpcEndPointRequest) { - request = &DeleteVpcEndPointRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpcEndPoint") - - return -} - -func NewDeleteVpcEndPointResponse() (response *DeleteVpcEndPointResponse) { - response = &DeleteVpcEndPointResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpcEndPoint -// 本接口(DeleteVpcEndPoint)用于删除终端节点。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteVpcEndPoint(request *DeleteVpcEndPointRequest) (response *DeleteVpcEndPointResponse, err error) { - return c.DeleteVpcEndPointWithContext(context.Background(), request) -} - -// DeleteVpcEndPoint -// 本接口(DeleteVpcEndPoint)用于删除终端节点。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteVpcEndPointWithContext(ctx context.Context, request *DeleteVpcEndPointRequest) (response *DeleteVpcEndPointResponse, err error) { - if request == nil { - request = NewDeleteVpcEndPointRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpcEndPoint require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpcEndPointResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpcEndPointServiceRequest() (request *DeleteVpcEndPointServiceRequest) { - request = &DeleteVpcEndPointServiceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpcEndPointService") - - return -} - -func NewDeleteVpcEndPointServiceResponse() (response *DeleteVpcEndPointServiceResponse) { - response = &DeleteVpcEndPointServiceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpcEndPointService -// 本接口(DeleteVpcEndPointService)用于删除终端节点服务。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteVpcEndPointService(request *DeleteVpcEndPointServiceRequest) (response *DeleteVpcEndPointServiceResponse, err error) { - return c.DeleteVpcEndPointServiceWithContext(context.Background(), request) -} - -// DeleteVpcEndPointService -// 本接口(DeleteVpcEndPointService)用于删除终端节点服务。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteVpcEndPointServiceWithContext(ctx context.Context, request *DeleteVpcEndPointServiceRequest) (response *DeleteVpcEndPointServiceResponse, err error) { - if request == nil { - request = NewDeleteVpcEndPointServiceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpcEndPointService require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpcEndPointServiceResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpcEndPointServiceWhiteListRequest() (request *DeleteVpcEndPointServiceWhiteListRequest) { - request = &DeleteVpcEndPointServiceWhiteListRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpcEndPointServiceWhiteList") - - return -} - -func NewDeleteVpcEndPointServiceWhiteListResponse() (response *DeleteVpcEndPointServiceWhiteListResponse) { - response = &DeleteVpcEndPointServiceWhiteListResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpcEndPointServiceWhiteList -// 本接口(DeleteVpcEndPointServiceWhiteList)用于删除终端节点服务白名单。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) DeleteVpcEndPointServiceWhiteList(request *DeleteVpcEndPointServiceWhiteListRequest) (response *DeleteVpcEndPointServiceWhiteListResponse, err error) { - return c.DeleteVpcEndPointServiceWhiteListWithContext(context.Background(), request) -} - -// DeleteVpcEndPointServiceWhiteList -// 本接口(DeleteVpcEndPointServiceWhiteList)用于删除终端节点服务白名单。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) DeleteVpcEndPointServiceWhiteListWithContext(ctx context.Context, request *DeleteVpcEndPointServiceWhiteListRequest) (response *DeleteVpcEndPointServiceWhiteListResponse, err error) { - if request == nil { - request = NewDeleteVpcEndPointServiceWhiteListRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpcEndPointServiceWhiteList require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpcEndPointServiceWhiteListResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpcPeeringConnectionRequest() (request *DeleteVpcPeeringConnectionRequest) { - request = &DeleteVpcPeeringConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpcPeeringConnection") - - return -} - -func NewDeleteVpcPeeringConnectionResponse() (response *DeleteVpcPeeringConnectionResponse) { - response = &DeleteVpcPeeringConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpcPeeringConnection -// 本接口(DeleteVpcPeeringConnection)用于删除私有网络对等连接。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_NOTSUPPORTDELETEVPCBMPEER = "UnsupportedOperation.NotSupportDeleteVpcBmPeer" -// UNSUPPORTEDOPERATION_VPCPEERPURVIEWERROR = "UnsupportedOperation.VpcPeerPurviewError" -func (c *Client) DeleteVpcPeeringConnection(request *DeleteVpcPeeringConnectionRequest) (response *DeleteVpcPeeringConnectionResponse, err error) { - return c.DeleteVpcPeeringConnectionWithContext(context.Background(), request) -} - -// DeleteVpcPeeringConnection -// 本接口(DeleteVpcPeeringConnection)用于删除私有网络对等连接。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_NOTSUPPORTDELETEVPCBMPEER = "UnsupportedOperation.NotSupportDeleteVpcBmPeer" -// UNSUPPORTEDOPERATION_VPCPEERPURVIEWERROR = "UnsupportedOperation.VpcPeerPurviewError" -func (c *Client) DeleteVpcPeeringConnectionWithContext(ctx context.Context, request *DeleteVpcPeeringConnectionRequest) (response *DeleteVpcPeeringConnectionResponse, err error) { - if request == nil { - request = NewDeleteVpcPeeringConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpcPeeringConnection require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpcPeeringConnectionResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpnConnectionRequest() (request *DeleteVpnConnectionRequest) { - request = &DeleteVpnConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpnConnection") - - return -} - -func NewDeleteVpnConnectionResponse() (response *DeleteVpnConnectionResponse) { - response = &DeleteVpnConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpnConnection -// 本接口(DeleteVpnConnection)用于删除VPN通道。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_DELETEVPNCONNINVALIDSTATE = "UnsupportedOperation.DeleteVpnConnInvalidState" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteVpnConnection(request *DeleteVpnConnectionRequest) (response *DeleteVpnConnectionResponse, err error) { - return c.DeleteVpnConnectionWithContext(context.Background(), request) -} - -// DeleteVpnConnection -// 本接口(DeleteVpnConnection)用于删除VPN通道。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_DELETEVPNCONNINVALIDSTATE = "UnsupportedOperation.DeleteVpnConnInvalidState" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DeleteVpnConnectionWithContext(ctx context.Context, request *DeleteVpnConnectionRequest) (response *DeleteVpnConnectionResponse, err error) { - if request == nil { - request = NewDeleteVpnConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpnConnection require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpnConnectionResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpnGatewayRequest() (request *DeleteVpnGatewayRequest) { - request = &DeleteVpnGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpnGateway") - - return -} - -func NewDeleteVpnGatewayResponse() (response *DeleteVpnGatewayResponse) { - response = &DeleteVpnGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpnGateway -// 本接口(DeleteVpnGateway)用于删除VPN网关。目前只支持删除运行中的按量计费的IPSEC网关实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDVPNGATEWAYID_MALFORMED = "InvalidVpnGatewayId.Malformed" -// INVALIDVPNGATEWAYID_NOTFOUND = "InvalidVpnGatewayId.NotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DeleteVpnGateway(request *DeleteVpnGatewayRequest) (response *DeleteVpnGatewayResponse, err error) { - return c.DeleteVpnGatewayWithContext(context.Background(), request) -} - -// DeleteVpnGateway -// 本接口(DeleteVpnGateway)用于删除VPN网关。目前只支持删除运行中的按量计费的IPSEC网关实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDVPNGATEWAYID_MALFORMED = "InvalidVpnGatewayId.Malformed" -// INVALIDVPNGATEWAYID_NOTFOUND = "InvalidVpnGatewayId.NotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DeleteVpnGatewayWithContext(ctx context.Context, request *DeleteVpnGatewayRequest) (response *DeleteVpnGatewayResponse, err error) { - if request == nil { - request = NewDeleteVpnGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpnGateway require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpnGatewayResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpnGatewayRoutesRequest() (request *DeleteVpnGatewayRoutesRequest) { - request = &DeleteVpnGatewayRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpnGatewayRoutes") - - return -} - -func NewDeleteVpnGatewayRoutesResponse() (response *DeleteVpnGatewayRoutesResponse) { - response = &DeleteVpnGatewayRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpnGatewayRoutes -// 本接口(DeleteVpnGatewayRoutes)用于删除VPN网关路由 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteVpnGatewayRoutes(request *DeleteVpnGatewayRoutesRequest) (response *DeleteVpnGatewayRoutesResponse, err error) { - return c.DeleteVpnGatewayRoutesWithContext(context.Background(), request) -} - -// DeleteVpnGatewayRoutes -// 本接口(DeleteVpnGatewayRoutes)用于删除VPN网关路由 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DeleteVpnGatewayRoutesWithContext(ctx context.Context, request *DeleteVpnGatewayRoutesRequest) (response *DeleteVpnGatewayRoutesResponse, err error) { - if request == nil { - request = NewDeleteVpnGatewayRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpnGatewayRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpnGatewayRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpnGatewaySslClientRequest() (request *DeleteVpnGatewaySslClientRequest) { - request = &DeleteVpnGatewaySslClientRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpnGatewaySslClient") - - return -} - -func NewDeleteVpnGatewaySslClientResponse() (response *DeleteVpnGatewaySslClientResponse) { - response = &DeleteVpnGatewaySslClientResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpnGatewaySslClient -// 本接口(DeleteVpnGatewaySslClient)用于删除SSL-VPN-CLIENT。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION_SSLVPNCLIENTIDNOTFOUND = "UnsupportedOperation.SslVpnClientIdNotFound" -func (c *Client) DeleteVpnGatewaySslClient(request *DeleteVpnGatewaySslClientRequest) (response *DeleteVpnGatewaySslClientResponse, err error) { - return c.DeleteVpnGatewaySslClientWithContext(context.Background(), request) -} - -// DeleteVpnGatewaySslClient -// 本接口(DeleteVpnGatewaySslClient)用于删除SSL-VPN-CLIENT。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION_SSLVPNCLIENTIDNOTFOUND = "UnsupportedOperation.SslVpnClientIdNotFound" -func (c *Client) DeleteVpnGatewaySslClientWithContext(ctx context.Context, request *DeleteVpnGatewaySslClientRequest) (response *DeleteVpnGatewaySslClientResponse, err error) { - if request == nil { - request = NewDeleteVpnGatewaySslClientRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpnGatewaySslClient require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpnGatewaySslClientResponse() - err = c.Send(request, response) - return -} - -func NewDeleteVpnGatewaySslServerRequest() (request *DeleteVpnGatewaySslServerRequest) { - request = &DeleteVpnGatewaySslServerRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpnGatewaySslServer") - - return -} - -func NewDeleteVpnGatewaySslServerResponse() (response *DeleteVpnGatewaySslServerResponse) { - response = &DeleteVpnGatewaySslServerResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DeleteVpnGatewaySslServer -// 删除SSL-VPN-SERVER 实例 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DeleteVpnGatewaySslServer(request *DeleteVpnGatewaySslServerRequest) (response *DeleteVpnGatewaySslServerResponse, err error) { - return c.DeleteVpnGatewaySslServerWithContext(context.Background(), request) -} - -// DeleteVpnGatewaySslServer -// 删除SSL-VPN-SERVER 实例 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DeleteVpnGatewaySslServerWithContext(ctx context.Context, request *DeleteVpnGatewaySslServerRequest) (response *DeleteVpnGatewaySslServerResponse, err error) { - if request == nil { - request = NewDeleteVpnGatewaySslServerRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DeleteVpnGatewaySslServer require credential") - } - - request.SetContext(ctx) - - response = NewDeleteVpnGatewaySslServerResponse() - err = c.Send(request, response) - return -} - -func NewDescribeAccountAttributesRequest() (request *DescribeAccountAttributesRequest) { - request = &DescribeAccountAttributesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeAccountAttributes") - - return -} - -func NewDescribeAccountAttributesResponse() (response *DescribeAccountAttributesResponse) { - response = &DescribeAccountAttributesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeAccountAttributes -// 本接口(DescribeAccountAttributes)用于查询用户账号私有属性。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -func (c *Client) DescribeAccountAttributes(request *DescribeAccountAttributesRequest) (response *DescribeAccountAttributesResponse, err error) { - return c.DescribeAccountAttributesWithContext(context.Background(), request) -} - -// DescribeAccountAttributes -// 本接口(DescribeAccountAttributes)用于查询用户账号私有属性。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -func (c *Client) DescribeAccountAttributesWithContext(ctx context.Context, request *DescribeAccountAttributesRequest) (response *DescribeAccountAttributesResponse, err error) { - if request == nil { - request = NewDescribeAccountAttributesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeAccountAttributes require credential") - } - - request.SetContext(ctx) - - response = NewDescribeAccountAttributesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeAddressQuotaRequest() (request *DescribeAddressQuotaRequest) { - request = &DescribeAddressQuotaRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeAddressQuota") - - return -} - -func NewDescribeAddressQuotaResponse() (response *DescribeAddressQuotaResponse) { - response = &DescribeAddressQuotaResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeAddressQuota -// 本接口 (DescribeAddressQuota) 用于查询您账户的[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)在当前地域的配额信息。配额详情可参见 [EIP 产品简介](https://cloud.tencent.com/document/product/213/5733)。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeAddressQuota(request *DescribeAddressQuotaRequest) (response *DescribeAddressQuotaResponse, err error) { - return c.DescribeAddressQuotaWithContext(context.Background(), request) -} - -// DescribeAddressQuota -// 本接口 (DescribeAddressQuota) 用于查询您账户的[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)在当前地域的配额信息。配额详情可参见 [EIP 产品简介](https://cloud.tencent.com/document/product/213/5733)。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeAddressQuotaWithContext(ctx context.Context, request *DescribeAddressQuotaRequest) (response *DescribeAddressQuotaResponse, err error) { - if request == nil { - request = NewDescribeAddressQuotaRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeAddressQuota require credential") - } - - request.SetContext(ctx) - - response = NewDescribeAddressQuotaResponse() - err = c.Send(request, response) - return -} - -func NewDescribeAddressTemplateGroupsRequest() (request *DescribeAddressTemplateGroupsRequest) { - request = &DescribeAddressTemplateGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeAddressTemplateGroups") - - return -} - -func NewDescribeAddressTemplateGroupsResponse() (response *DescribeAddressTemplateGroupsResponse) { - response = &DescribeAddressTemplateGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeAddressTemplateGroups -// 本接口(DescribeAddressTemplateGroups)用于查询IP地址模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeAddressTemplateGroups(request *DescribeAddressTemplateGroupsRequest) (response *DescribeAddressTemplateGroupsResponse, err error) { - return c.DescribeAddressTemplateGroupsWithContext(context.Background(), request) -} - -// DescribeAddressTemplateGroups -// 本接口(DescribeAddressTemplateGroups)用于查询IP地址模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeAddressTemplateGroupsWithContext(ctx context.Context, request *DescribeAddressTemplateGroupsRequest) (response *DescribeAddressTemplateGroupsResponse, err error) { - if request == nil { - request = NewDescribeAddressTemplateGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeAddressTemplateGroups require credential") - } - - request.SetContext(ctx) - - response = NewDescribeAddressTemplateGroupsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeAddressTemplatesRequest() (request *DescribeAddressTemplatesRequest) { - request = &DescribeAddressTemplatesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeAddressTemplates") - - return -} - -func NewDescribeAddressTemplatesResponse() (response *DescribeAddressTemplatesResponse) { - response = &DescribeAddressTemplatesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeAddressTemplates -// 本接口(DescribeAddressTemplates)用于查询IP地址模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeAddressTemplates(request *DescribeAddressTemplatesRequest) (response *DescribeAddressTemplatesResponse, err error) { - return c.DescribeAddressTemplatesWithContext(context.Background(), request) -} - -// DescribeAddressTemplates -// 本接口(DescribeAddressTemplates)用于查询IP地址模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeAddressTemplatesWithContext(ctx context.Context, request *DescribeAddressTemplatesRequest) (response *DescribeAddressTemplatesResponse, err error) { - if request == nil { - request = NewDescribeAddressTemplatesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeAddressTemplates require credential") - } - - request.SetContext(ctx) - - response = NewDescribeAddressTemplatesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeAddressesRequest() (request *DescribeAddressesRequest) { - request = &DescribeAddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeAddresses") - - return -} - -func NewDescribeAddressesResponse() (response *DescribeAddressesResponse) { - response = &DescribeAddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeAddresses -// 本接口 (DescribeAddresses) 用于查询一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)的详细信息。 -// -// * 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的 EIP。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NETWORKINTERFACEIDMALFORMED = "InvalidParameterValue.NetworkInterfaceIdMalformed" -// INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" -// LIMITEXCEEDED_NUMBEROFFILTERS = "LimitExceeded.NumberOfFilters" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeAddresses(request *DescribeAddressesRequest) (response *DescribeAddressesResponse, err error) { - return c.DescribeAddressesWithContext(context.Background(), request) -} - -// DescribeAddresses -// 本接口 (DescribeAddresses) 用于查询一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)的详细信息。 -// -// * 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的 EIP。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_NETWORKINTERFACEIDMALFORMED = "InvalidParameterValue.NetworkInterfaceIdMalformed" -// INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" -// LIMITEXCEEDED_NUMBEROFFILTERS = "LimitExceeded.NumberOfFilters" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeAddressesWithContext(ctx context.Context, request *DescribeAddressesRequest) (response *DescribeAddressesResponse, err error) { - if request == nil { - request = NewDescribeAddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeAddresses require credential") - } - - request.SetContext(ctx) - - response = NewDescribeAddressesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeAssistantCidrRequest() (request *DescribeAssistantCidrRequest) { - request = &DescribeAssistantCidrRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeAssistantCidr") - - return -} - -func NewDescribeAssistantCidrResponse() (response *DescribeAssistantCidrResponse) { - response = &DescribeAssistantCidrResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeAssistantCidr -// 本接口(DescribeAssistantCidr)用于查询辅助CIDR列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeAssistantCidr(request *DescribeAssistantCidrRequest) (response *DescribeAssistantCidrResponse, err error) { - return c.DescribeAssistantCidrWithContext(context.Background(), request) -} - -// DescribeAssistantCidr -// 本接口(DescribeAssistantCidr)用于查询辅助CIDR列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeAssistantCidrWithContext(ctx context.Context, request *DescribeAssistantCidrRequest) (response *DescribeAssistantCidrResponse, err error) { - if request == nil { - request = NewDescribeAssistantCidrRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeAssistantCidr require credential") - } - - request.SetContext(ctx) - - response = NewDescribeAssistantCidrResponse() - err = c.Send(request, response) - return -} - -func NewDescribeBandwidthPackageBillUsageRequest() (request *DescribeBandwidthPackageBillUsageRequest) { - request = &DescribeBandwidthPackageBillUsageRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeBandwidthPackageBillUsage") - - return -} - -func NewDescribeBandwidthPackageBillUsageResponse() (response *DescribeBandwidthPackageBillUsageResponse) { - response = &DescribeBandwidthPackageBillUsageResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeBandwidthPackageBillUsage -// 本接口 (DescribeBandwidthPackageBillUsage) 用于查询后付费共享带宽包当前的计费用量. -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -func (c *Client) DescribeBandwidthPackageBillUsage(request *DescribeBandwidthPackageBillUsageRequest) (response *DescribeBandwidthPackageBillUsageResponse, err error) { - return c.DescribeBandwidthPackageBillUsageWithContext(context.Background(), request) -} - -// DescribeBandwidthPackageBillUsage -// 本接口 (DescribeBandwidthPackageBillUsage) 用于查询后付费共享带宽包当前的计费用量. -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -func (c *Client) DescribeBandwidthPackageBillUsageWithContext(ctx context.Context, request *DescribeBandwidthPackageBillUsageRequest) (response *DescribeBandwidthPackageBillUsageResponse, err error) { - if request == nil { - request = NewDescribeBandwidthPackageBillUsageRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeBandwidthPackageBillUsage require credential") - } - - request.SetContext(ctx) - - response = NewDescribeBandwidthPackageBillUsageResponse() - err = c.Send(request, response) - return -} - -func NewDescribeBandwidthPackageQuotaRequest() (request *DescribeBandwidthPackageQuotaRequest) { - request = &DescribeBandwidthPackageQuotaRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeBandwidthPackageQuota") - - return -} - -func NewDescribeBandwidthPackageQuotaResponse() (response *DescribeBandwidthPackageQuotaResponse) { - response = &DescribeBandwidthPackageQuotaResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeBandwidthPackageQuota -// 接口用于查询账户在当前地域的带宽包上限数量以及使用数量 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -func (c *Client) DescribeBandwidthPackageQuota(request *DescribeBandwidthPackageQuotaRequest) (response *DescribeBandwidthPackageQuotaResponse, err error) { - return c.DescribeBandwidthPackageQuotaWithContext(context.Background(), request) -} - -// DescribeBandwidthPackageQuota -// 接口用于查询账户在当前地域的带宽包上限数量以及使用数量 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -func (c *Client) DescribeBandwidthPackageQuotaWithContext(ctx context.Context, request *DescribeBandwidthPackageQuotaRequest) (response *DescribeBandwidthPackageQuotaResponse, err error) { - if request == nil { - request = NewDescribeBandwidthPackageQuotaRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeBandwidthPackageQuota require credential") - } - - request.SetContext(ctx) - - response = NewDescribeBandwidthPackageQuotaResponse() - err = c.Send(request, response) - return -} - -func NewDescribeBandwidthPackageResourcesRequest() (request *DescribeBandwidthPackageResourcesRequest) { - request = &DescribeBandwidthPackageResourcesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeBandwidthPackageResources") - - return -} - -func NewDescribeBandwidthPackageResourcesResponse() (response *DescribeBandwidthPackageResourcesResponse) { - response = &DescribeBandwidthPackageResourcesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeBandwidthPackageResources -// 本接口 (DescribeBandwidthPackageResources) 用于根据共享带宽包唯一ID查询共享带宽包内的资源列表,支持按条件过滤查询结果和分页查询。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_ILLEGAL = "InvalidParameterValue.Illegal" -func (c *Client) DescribeBandwidthPackageResources(request *DescribeBandwidthPackageResourcesRequest) (response *DescribeBandwidthPackageResourcesResponse, err error) { - return c.DescribeBandwidthPackageResourcesWithContext(context.Background(), request) -} - -// DescribeBandwidthPackageResources -// 本接口 (DescribeBandwidthPackageResources) 用于根据共享带宽包唯一ID查询共享带宽包内的资源列表,支持按条件过滤查询结果和分页查询。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_ILLEGAL = "InvalidParameterValue.Illegal" -func (c *Client) DescribeBandwidthPackageResourcesWithContext(ctx context.Context, request *DescribeBandwidthPackageResourcesRequest) (response *DescribeBandwidthPackageResourcesResponse, err error) { - if request == nil { - request = NewDescribeBandwidthPackageResourcesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeBandwidthPackageResources require credential") - } - - request.SetContext(ctx) - - response = NewDescribeBandwidthPackageResourcesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeBandwidthPackagesRequest() (request *DescribeBandwidthPackagesRequest) { - request = &DescribeBandwidthPackagesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeBandwidthPackages") - - return -} - -func NewDescribeBandwidthPackagesResponse() (response *DescribeBandwidthPackagesResponse) { - response = &DescribeBandwidthPackagesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeBandwidthPackages -// 接口用于查询带宽包详细信息,包括带宽包唯一标识ID,类型,计费模式,名称,资源信息等 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDBANDWIDTHPACKAGECHARGETYPE = "InvalidParameterValue.InvalidBandwidthPackageChargeType" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeBandwidthPackages(request *DescribeBandwidthPackagesRequest) (response *DescribeBandwidthPackagesResponse, err error) { - return c.DescribeBandwidthPackagesWithContext(context.Background(), request) -} - -// DescribeBandwidthPackages -// 接口用于查询带宽包详细信息,包括带宽包唯一标识ID,类型,计费模式,名称,资源信息等 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_INVALIDBANDWIDTHPACKAGECHARGETYPE = "InvalidParameterValue.InvalidBandwidthPackageChargeType" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeBandwidthPackagesWithContext(ctx context.Context, request *DescribeBandwidthPackagesRequest) (response *DescribeBandwidthPackagesResponse, err error) { - if request == nil { - request = NewDescribeBandwidthPackagesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeBandwidthPackages require credential") - } - - request.SetContext(ctx) - - response = NewDescribeBandwidthPackagesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCcnAttachedInstancesRequest() (request *DescribeCcnAttachedInstancesRequest) { - request = &DescribeCcnAttachedInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCcnAttachedInstances") - - return -} - -func NewDescribeCcnAttachedInstancesResponse() (response *DescribeCcnAttachedInstancesResponse) { - response = &DescribeCcnAttachedInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCcnAttachedInstances -// 本接口(DescribeCcnAttachedInstances)用于查询云联网实例下已关联的网络实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" -func (c *Client) DescribeCcnAttachedInstances(request *DescribeCcnAttachedInstancesRequest) (response *DescribeCcnAttachedInstancesResponse, err error) { - return c.DescribeCcnAttachedInstancesWithContext(context.Background(), request) -} - -// DescribeCcnAttachedInstances -// 本接口(DescribeCcnAttachedInstances)用于查询云联网实例下已关联的网络实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" -func (c *Client) DescribeCcnAttachedInstancesWithContext(ctx context.Context, request *DescribeCcnAttachedInstancesRequest) (response *DescribeCcnAttachedInstancesResponse, err error) { - if request == nil { - request = NewDescribeCcnAttachedInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCcnAttachedInstances require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCcnAttachedInstancesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCcnRegionBandwidthLimitsRequest() (request *DescribeCcnRegionBandwidthLimitsRequest) { - request = &DescribeCcnRegionBandwidthLimitsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCcnRegionBandwidthLimits") - - return -} - -func NewDescribeCcnRegionBandwidthLimitsResponse() (response *DescribeCcnRegionBandwidthLimitsResponse) { - response = &DescribeCcnRegionBandwidthLimitsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCcnRegionBandwidthLimits -// 本接口(DescribeCcnRegionBandwidthLimits)用于查询云联网各地域出带宽上限,该接口只返回已关联网络实例包含的地域。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeCcnRegionBandwidthLimits(request *DescribeCcnRegionBandwidthLimitsRequest) (response *DescribeCcnRegionBandwidthLimitsResponse, err error) { - return c.DescribeCcnRegionBandwidthLimitsWithContext(context.Background(), request) -} - -// DescribeCcnRegionBandwidthLimits -// 本接口(DescribeCcnRegionBandwidthLimits)用于查询云联网各地域出带宽上限,该接口只返回已关联网络实例包含的地域。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeCcnRegionBandwidthLimitsWithContext(ctx context.Context, request *DescribeCcnRegionBandwidthLimitsRequest) (response *DescribeCcnRegionBandwidthLimitsResponse, err error) { - if request == nil { - request = NewDescribeCcnRegionBandwidthLimitsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCcnRegionBandwidthLimits require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCcnRegionBandwidthLimitsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCcnRoutesRequest() (request *DescribeCcnRoutesRequest) { - request = &DescribeCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCcnRoutes") - - return -} - -func NewDescribeCcnRoutesResponse() (response *DescribeCcnRoutesResponse) { - response = &DescribeCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCcnRoutes -// 本接口(DescribeCcnRoutes)用于查询已加入云联网(CCN)的路由。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" -func (c *Client) DescribeCcnRoutes(request *DescribeCcnRoutesRequest) (response *DescribeCcnRoutesResponse, err error) { - return c.DescribeCcnRoutesWithContext(context.Background(), request) -} - -// DescribeCcnRoutes -// 本接口(DescribeCcnRoutes)用于查询已加入云联网(CCN)的路由。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" -func (c *Client) DescribeCcnRoutesWithContext(ctx context.Context, request *DescribeCcnRoutesRequest) (response *DescribeCcnRoutesResponse, err error) { - if request == nil { - request = NewDescribeCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCcnsRequest() (request *DescribeCcnsRequest) { - request = &DescribeCcnsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCcns") - - return -} - -func NewDescribeCcnsResponse() (response *DescribeCcnsResponse) { - response = &DescribeCcnsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCcns -// 本接口(DescribeCcns)用于查询云联网(CCN)列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeCcns(request *DescribeCcnsRequest) (response *DescribeCcnsResponse, err error) { - return c.DescribeCcnsWithContext(context.Background(), request) -} - -// DescribeCcns -// 本接口(DescribeCcns)用于查询云联网(CCN)列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeCcnsWithContext(ctx context.Context, request *DescribeCcnsRequest) (response *DescribeCcnsResponse, err error) { - if request == nil { - request = NewDescribeCcnsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCcns require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCcnsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeClassicLinkInstancesRequest() (request *DescribeClassicLinkInstancesRequest) { - request = &DescribeClassicLinkInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeClassicLinkInstances") - - return -} - -func NewDescribeClassicLinkInstancesResponse() (response *DescribeClassicLinkInstancesResponse) { - response = &DescribeClassicLinkInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeClassicLinkInstances -// 本接口(DescribeClassicLinkInstances)用于查询私有网络和基础网络设备互通列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeClassicLinkInstances(request *DescribeClassicLinkInstancesRequest) (response *DescribeClassicLinkInstancesResponse, err error) { - return c.DescribeClassicLinkInstancesWithContext(context.Background(), request) -} - -// DescribeClassicLinkInstances -// 本接口(DescribeClassicLinkInstances)用于查询私有网络和基础网络设备互通列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeClassicLinkInstancesWithContext(ctx context.Context, request *DescribeClassicLinkInstancesRequest) (response *DescribeClassicLinkInstancesResponse, err error) { - if request == nil { - request = NewDescribeClassicLinkInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeClassicLinkInstances require credential") - } - - request.SetContext(ctx) - - response = NewDescribeClassicLinkInstancesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCrossBorderCcnRegionBandwidthLimitsRequest() (request *DescribeCrossBorderCcnRegionBandwidthLimitsRequest) { - request = &DescribeCrossBorderCcnRegionBandwidthLimitsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCrossBorderCcnRegionBandwidthLimits") - - return -} - -func NewDescribeCrossBorderCcnRegionBandwidthLimitsResponse() (response *DescribeCrossBorderCcnRegionBandwidthLimitsResponse) { - response = &DescribeCrossBorderCcnRegionBandwidthLimitsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCrossBorderCcnRegionBandwidthLimits -// 本接口(DescribeCrossBorderCcnRegionBandwidthLimits)用于获取要锁定的限速实例列表。 -// -// 该接口一般用来封禁地域间限速的云联网实例下的限速实例, 目前联通内部运营系统通过云API调用, 如果是出口限速, 一般使用更粗的云联网实例粒度封禁(DescribeTenantCcns) -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) DescribeCrossBorderCcnRegionBandwidthLimits(request *DescribeCrossBorderCcnRegionBandwidthLimitsRequest) (response *DescribeCrossBorderCcnRegionBandwidthLimitsResponse, err error) { - return c.DescribeCrossBorderCcnRegionBandwidthLimitsWithContext(context.Background(), request) -} - -// DescribeCrossBorderCcnRegionBandwidthLimits -// 本接口(DescribeCrossBorderCcnRegionBandwidthLimits)用于获取要锁定的限速实例列表。 -// -// 该接口一般用来封禁地域间限速的云联网实例下的限速实例, 目前联通内部运营系统通过云API调用, 如果是出口限速, 一般使用更粗的云联网实例粒度封禁(DescribeTenantCcns) -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) DescribeCrossBorderCcnRegionBandwidthLimitsWithContext(ctx context.Context, request *DescribeCrossBorderCcnRegionBandwidthLimitsRequest) (response *DescribeCrossBorderCcnRegionBandwidthLimitsResponse, err error) { - if request == nil { - request = NewDescribeCrossBorderCcnRegionBandwidthLimitsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCrossBorderCcnRegionBandwidthLimits require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCrossBorderCcnRegionBandwidthLimitsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCrossBorderComplianceRequest() (request *DescribeCrossBorderComplianceRequest) { - request = &DescribeCrossBorderComplianceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCrossBorderCompliance") - - return -} - -func NewDescribeCrossBorderComplianceResponse() (response *DescribeCrossBorderComplianceResponse) { - response = &DescribeCrossBorderComplianceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCrossBorderCompliance -// 本接口(DescribeCrossBorderCompliance)用于查询用户创建的合规化资质审批单。 -// -// 服务商可以查询服务名下的任意 `APPID` 创建的审批单;非服务商,只能查询自己审批单。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeCrossBorderCompliance(request *DescribeCrossBorderComplianceRequest) (response *DescribeCrossBorderComplianceResponse, err error) { - return c.DescribeCrossBorderComplianceWithContext(context.Background(), request) -} - -// DescribeCrossBorderCompliance -// 本接口(DescribeCrossBorderCompliance)用于查询用户创建的合规化资质审批单。 -// -// 服务商可以查询服务名下的任意 `APPID` 创建的审批单;非服务商,只能查询自己审批单。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeCrossBorderComplianceWithContext(ctx context.Context, request *DescribeCrossBorderComplianceRequest) (response *DescribeCrossBorderComplianceResponse, err error) { - if request == nil { - request = NewDescribeCrossBorderComplianceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCrossBorderCompliance require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCrossBorderComplianceResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCrossBorderFlowMonitorRequest() (request *DescribeCrossBorderFlowMonitorRequest) { - request = &DescribeCrossBorderFlowMonitorRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCrossBorderFlowMonitor") - - return -} - -func NewDescribeCrossBorderFlowMonitorResponse() (response *DescribeCrossBorderFlowMonitorResponse) { - response = &DescribeCrossBorderFlowMonitorResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCrossBorderFlowMonitor -// 本接口(DescribeCrossBorderFlowMonitor)用于查询跨境带宽监控数据,该接口目前只提供给服务商联通使用。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CCNINSTANCEACCOUNTNOTAPPROVEDBYUNICOM = "UnsupportedOperation.CcnInstanceAccountNotApprovedByUnicom" -// UNSUPPORTEDOPERATION_CURRENTACCOUNTISNOTUNICOMACCOUNT = "UnsupportedOperation.CurrentAccountIsNotUnicomAccount" -// UNSUPPORTEDOPERATION_CURRENTQUERYREGIONISNOTCROSSBORDER = "UnsupportedOperation.CurrentQueryRegionIsNotCrossBorder" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -func (c *Client) DescribeCrossBorderFlowMonitor(request *DescribeCrossBorderFlowMonitorRequest) (response *DescribeCrossBorderFlowMonitorResponse, err error) { - return c.DescribeCrossBorderFlowMonitorWithContext(context.Background(), request) -} - -// DescribeCrossBorderFlowMonitor -// 本接口(DescribeCrossBorderFlowMonitor)用于查询跨境带宽监控数据,该接口目前只提供给服务商联通使用。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CCNINSTANCEACCOUNTNOTAPPROVEDBYUNICOM = "UnsupportedOperation.CcnInstanceAccountNotApprovedByUnicom" -// UNSUPPORTEDOPERATION_CURRENTACCOUNTISNOTUNICOMACCOUNT = "UnsupportedOperation.CurrentAccountIsNotUnicomAccount" -// UNSUPPORTEDOPERATION_CURRENTQUERYREGIONISNOTCROSSBORDER = "UnsupportedOperation.CurrentQueryRegionIsNotCrossBorder" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -func (c *Client) DescribeCrossBorderFlowMonitorWithContext(ctx context.Context, request *DescribeCrossBorderFlowMonitorRequest) (response *DescribeCrossBorderFlowMonitorResponse, err error) { - if request == nil { - request = NewDescribeCrossBorderFlowMonitorRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCrossBorderFlowMonitor require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCrossBorderFlowMonitorResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCustomerGatewayVendorsRequest() (request *DescribeCustomerGatewayVendorsRequest) { - request = &DescribeCustomerGatewayVendorsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCustomerGatewayVendors") - - return -} - -func NewDescribeCustomerGatewayVendorsResponse() (response *DescribeCustomerGatewayVendorsResponse) { - response = &DescribeCustomerGatewayVendorsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCustomerGatewayVendors -// 本接口(DescribeCustomerGatewayVendors)用于查询可支持的对端网关厂商信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CCNINSTANCEACCOUNTNOTAPPROVEDBYUNICOM = "UnsupportedOperation.CcnInstanceAccountNotApprovedByUnicom" -// UNSUPPORTEDOPERATION_CURRENTACCOUNTISNOTUNICOMACCOUNT = "UnsupportedOperation.CurrentAccountIsNotUnicomAccount" -// UNSUPPORTEDOPERATION_CURRENTQUERYREGIONISNOTCROSSBORDER = "UnsupportedOperation.CurrentQueryRegionIsNotCrossBorder" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -func (c *Client) DescribeCustomerGatewayVendors(request *DescribeCustomerGatewayVendorsRequest) (response *DescribeCustomerGatewayVendorsResponse, err error) { - return c.DescribeCustomerGatewayVendorsWithContext(context.Background(), request) -} - -// DescribeCustomerGatewayVendors -// 本接口(DescribeCustomerGatewayVendors)用于查询可支持的对端网关厂商信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CCNINSTANCEACCOUNTNOTAPPROVEDBYUNICOM = "UnsupportedOperation.CcnInstanceAccountNotApprovedByUnicom" -// UNSUPPORTEDOPERATION_CURRENTACCOUNTISNOTUNICOMACCOUNT = "UnsupportedOperation.CurrentAccountIsNotUnicomAccount" -// UNSUPPORTEDOPERATION_CURRENTQUERYREGIONISNOTCROSSBORDER = "UnsupportedOperation.CurrentQueryRegionIsNotCrossBorder" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -// UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" -func (c *Client) DescribeCustomerGatewayVendorsWithContext(ctx context.Context, request *DescribeCustomerGatewayVendorsRequest) (response *DescribeCustomerGatewayVendorsResponse, err error) { - if request == nil { - request = NewDescribeCustomerGatewayVendorsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCustomerGatewayVendors require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCustomerGatewayVendorsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeCustomerGatewaysRequest() (request *DescribeCustomerGatewaysRequest) { - request = &DescribeCustomerGatewaysRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeCustomerGateways") - - return -} - -func NewDescribeCustomerGatewaysResponse() (response *DescribeCustomerGatewaysResponse) { - response = &DescribeCustomerGatewaysResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeCustomerGateways -// 本接口(DescribeCustomerGateways)用于查询对端网关列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeCustomerGateways(request *DescribeCustomerGatewaysRequest) (response *DescribeCustomerGatewaysResponse, err error) { - return c.DescribeCustomerGatewaysWithContext(context.Background(), request) -} - -// DescribeCustomerGateways -// 本接口(DescribeCustomerGateways)用于查询对端网关列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeCustomerGatewaysWithContext(ctx context.Context, request *DescribeCustomerGatewaysRequest) (response *DescribeCustomerGatewaysResponse, err error) { - if request == nil { - request = NewDescribeCustomerGatewaysRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeCustomerGateways require credential") - } - - request.SetContext(ctx) - - response = NewDescribeCustomerGatewaysResponse() - err = c.Send(request, response) - return -} - -func NewDescribeDhcpIpsRequest() (request *DescribeDhcpIpsRequest) { - request = &DescribeDhcpIpsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeDhcpIps") - - return -} - -func NewDescribeDhcpIpsResponse() (response *DescribeDhcpIpsResponse) { - response = &DescribeDhcpIpsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeDhcpIps -// 本接口(DescribeDhcpIps)用于查询DhcpIp列表 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeDhcpIps(request *DescribeDhcpIpsRequest) (response *DescribeDhcpIpsResponse, err error) { - return c.DescribeDhcpIpsWithContext(context.Background(), request) -} - -// DescribeDhcpIps -// 本接口(DescribeDhcpIps)用于查询DhcpIp列表 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeDhcpIpsWithContext(ctx context.Context, request *DescribeDhcpIpsRequest) (response *DescribeDhcpIpsResponse, err error) { - if request == nil { - request = NewDescribeDhcpIpsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeDhcpIps require credential") - } - - request.SetContext(ctx) - - response = NewDescribeDhcpIpsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeDirectConnectGatewayCcnRoutesRequest() (request *DescribeDirectConnectGatewayCcnRoutesRequest) { - request = &DescribeDirectConnectGatewayCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeDirectConnectGatewayCcnRoutes") - - return -} - -func NewDescribeDirectConnectGatewayCcnRoutesResponse() (response *DescribeDirectConnectGatewayCcnRoutesResponse) { - response = &DescribeDirectConnectGatewayCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeDirectConnectGatewayCcnRoutes -// 本接口(DescribeDirectConnectGatewayCcnRoutes)用于查询专线网关的云联网路由(IDC网段) -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeDirectConnectGatewayCcnRoutes(request *DescribeDirectConnectGatewayCcnRoutesRequest) (response *DescribeDirectConnectGatewayCcnRoutesResponse, err error) { - return c.DescribeDirectConnectGatewayCcnRoutesWithContext(context.Background(), request) -} - -// DescribeDirectConnectGatewayCcnRoutes -// 本接口(DescribeDirectConnectGatewayCcnRoutes)用于查询专线网关的云联网路由(IDC网段) -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeDirectConnectGatewayCcnRoutesWithContext(ctx context.Context, request *DescribeDirectConnectGatewayCcnRoutesRequest) (response *DescribeDirectConnectGatewayCcnRoutesResponse, err error) { - if request == nil { - request = NewDescribeDirectConnectGatewayCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeDirectConnectGatewayCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDescribeDirectConnectGatewayCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeDirectConnectGatewaysRequest() (request *DescribeDirectConnectGatewaysRequest) { - request = &DescribeDirectConnectGatewaysRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeDirectConnectGateways") - - return -} - -func NewDescribeDirectConnectGatewaysResponse() (response *DescribeDirectConnectGatewaysResponse) { - response = &DescribeDirectConnectGatewaysResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeDirectConnectGateways -// 本接口(DescribeDirectConnectGateways)用于查询专线网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeDirectConnectGateways(request *DescribeDirectConnectGatewaysRequest) (response *DescribeDirectConnectGatewaysResponse, err error) { - return c.DescribeDirectConnectGatewaysWithContext(context.Background(), request) -} - -// DescribeDirectConnectGateways -// 本接口(DescribeDirectConnectGateways)用于查询专线网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeDirectConnectGatewaysWithContext(ctx context.Context, request *DescribeDirectConnectGatewaysRequest) (response *DescribeDirectConnectGatewaysResponse, err error) { - if request == nil { - request = NewDescribeDirectConnectGatewaysRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeDirectConnectGateways require credential") - } - - request.SetContext(ctx) - - response = NewDescribeDirectConnectGatewaysResponse() - err = c.Send(request, response) - return -} - -func NewDescribeFlowLogRequest() (request *DescribeFlowLogRequest) { - request = &DescribeFlowLogRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeFlowLog") - - return -} - -func NewDescribeFlowLogResponse() (response *DescribeFlowLogResponse) { - response = &DescribeFlowLogResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeFlowLog -// 本接口(DescribeFlowLog)用于查询流日志实例信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeFlowLog(request *DescribeFlowLogRequest) (response *DescribeFlowLogResponse, err error) { - return c.DescribeFlowLogWithContext(context.Background(), request) -} - -// DescribeFlowLog -// 本接口(DescribeFlowLog)用于查询流日志实例信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeFlowLogWithContext(ctx context.Context, request *DescribeFlowLogRequest) (response *DescribeFlowLogResponse, err error) { - if request == nil { - request = NewDescribeFlowLogRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeFlowLog require credential") - } - - request.SetContext(ctx) - - response = NewDescribeFlowLogResponse() - err = c.Send(request, response) - return -} - -func NewDescribeFlowLogsRequest() (request *DescribeFlowLogsRequest) { - request = &DescribeFlowLogsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeFlowLogs") - - return -} - -func NewDescribeFlowLogsResponse() (response *DescribeFlowLogsResponse) { - response = &DescribeFlowLogsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeFlowLogs -// 本接口(DescribeFlowLogs)用于查询获取流日志集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeFlowLogs(request *DescribeFlowLogsRequest) (response *DescribeFlowLogsResponse, err error) { - return c.DescribeFlowLogsWithContext(context.Background(), request) -} - -// DescribeFlowLogs -// 本接口(DescribeFlowLogs)用于查询获取流日志集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeFlowLogsWithContext(ctx context.Context, request *DescribeFlowLogsRequest) (response *DescribeFlowLogsResponse, err error) { - if request == nil { - request = NewDescribeFlowLogsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeFlowLogs require credential") - } - - request.SetContext(ctx) - - response = NewDescribeFlowLogsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeGatewayFlowMonitorDetailRequest() (request *DescribeGatewayFlowMonitorDetailRequest) { - request = &DescribeGatewayFlowMonitorDetailRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeGatewayFlowMonitorDetail") - - return -} - -func NewDescribeGatewayFlowMonitorDetailResponse() (response *DescribeGatewayFlowMonitorDetailResponse) { - response = &DescribeGatewayFlowMonitorDetailResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeGatewayFlowMonitorDetail -// 本接口(DescribeGatewayFlowMonitorDetail)用于查询网关流量监控明细。 -// -// * 只支持单个网关实例查询。即入参 `VpnId`、 `DirectConnectGatewayId`、 `PeeringConnectionId`、 `NatId` 最多只支持传一个,且必须传一个。 -// -// * 如果网关有流量,但调用本接口没有返回数据,请在控制台对应网关详情页确认是否开启网关流量监控。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeGatewayFlowMonitorDetail(request *DescribeGatewayFlowMonitorDetailRequest) (response *DescribeGatewayFlowMonitorDetailResponse, err error) { - return c.DescribeGatewayFlowMonitorDetailWithContext(context.Background(), request) -} - -// DescribeGatewayFlowMonitorDetail -// 本接口(DescribeGatewayFlowMonitorDetail)用于查询网关流量监控明细。 -// -// * 只支持单个网关实例查询。即入参 `VpnId`、 `DirectConnectGatewayId`、 `PeeringConnectionId`、 `NatId` 最多只支持传一个,且必须传一个。 -// -// * 如果网关有流量,但调用本接口没有返回数据,请在控制台对应网关详情页确认是否开启网关流量监控。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeGatewayFlowMonitorDetailWithContext(ctx context.Context, request *DescribeGatewayFlowMonitorDetailRequest) (response *DescribeGatewayFlowMonitorDetailResponse, err error) { - if request == nil { - request = NewDescribeGatewayFlowMonitorDetailRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeGatewayFlowMonitorDetail require credential") - } - - request.SetContext(ctx) - - response = NewDescribeGatewayFlowMonitorDetailResponse() - err = c.Send(request, response) - return -} - -func NewDescribeGatewayFlowQosRequest() (request *DescribeGatewayFlowQosRequest) { - request = &DescribeGatewayFlowQosRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeGatewayFlowQos") - - return -} - -func NewDescribeGatewayFlowQosResponse() (response *DescribeGatewayFlowQosResponse) { - response = &DescribeGatewayFlowQosResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeGatewayFlowQos -// 本接口(DescribeGatewayFlowQos)用于查询网关来访IP流控带宽。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) DescribeGatewayFlowQos(request *DescribeGatewayFlowQosRequest) (response *DescribeGatewayFlowQosResponse, err error) { - return c.DescribeGatewayFlowQosWithContext(context.Background(), request) -} - -// DescribeGatewayFlowQos -// 本接口(DescribeGatewayFlowQos)用于查询网关来访IP流控带宽。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) DescribeGatewayFlowQosWithContext(ctx context.Context, request *DescribeGatewayFlowQosRequest) (response *DescribeGatewayFlowQosResponse, err error) { - if request == nil { - request = NewDescribeGatewayFlowQosRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeGatewayFlowQos require credential") - } - - request.SetContext(ctx) - - response = NewDescribeGatewayFlowQosResponse() - err = c.Send(request, response) - return -} - -func NewDescribeHaVipsRequest() (request *DescribeHaVipsRequest) { - request = &DescribeHaVipsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeHaVips") - - return -} - -func NewDescribeHaVipsResponse() (response *DescribeHaVipsResponse) { - response = &DescribeHaVipsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeHaVips -// 本接口(DescribeHaVips)用于查询高可用虚拟IP(HAVIP)列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -func (c *Client) DescribeHaVips(request *DescribeHaVipsRequest) (response *DescribeHaVipsResponse, err error) { - return c.DescribeHaVipsWithContext(context.Background(), request) -} - -// DescribeHaVips -// 本接口(DescribeHaVips)用于查询高可用虚拟IP(HAVIP)列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -func (c *Client) DescribeHaVipsWithContext(ctx context.Context, request *DescribeHaVipsRequest) (response *DescribeHaVipsResponse, err error) { - if request == nil { - request = NewDescribeHaVipsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeHaVips require credential") - } - - request.SetContext(ctx) - - response = NewDescribeHaVipsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeIp6AddressesRequest() (request *DescribeIp6AddressesRequest) { - request = &DescribeIp6AddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeIp6Addresses") - - return -} - -func NewDescribeIp6AddressesResponse() (response *DescribeIp6AddressesResponse) { - response = &DescribeIp6AddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeIp6Addresses -// 该接口用于查询IPV6地址信息 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTPUBLIC = "InvalidParameterValue.AddressIpNotPublic" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NETWORKINTERFACEIDMALFORMED = "InvalidParameterValue.NetworkInterfaceIdMalformed" -func (c *Client) DescribeIp6Addresses(request *DescribeIp6AddressesRequest) (response *DescribeIp6AddressesResponse, err error) { - return c.DescribeIp6AddressesWithContext(context.Background(), request) -} - -// DescribeIp6Addresses -// 该接口用于查询IPV6地址信息 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTPUBLIC = "InvalidParameterValue.AddressIpNotPublic" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NETWORKINTERFACEIDMALFORMED = "InvalidParameterValue.NetworkInterfaceIdMalformed" -func (c *Client) DescribeIp6AddressesWithContext(ctx context.Context, request *DescribeIp6AddressesRequest) (response *DescribeIp6AddressesResponse, err error) { - if request == nil { - request = NewDescribeIp6AddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeIp6Addresses require credential") - } - - request.SetContext(ctx) - - response = NewDescribeIp6AddressesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeIp6TranslatorQuotaRequest() (request *DescribeIp6TranslatorQuotaRequest) { - request = &DescribeIp6TranslatorQuotaRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeIp6TranslatorQuota") - - return -} - -func NewDescribeIp6TranslatorQuotaResponse() (response *DescribeIp6TranslatorQuotaResponse) { - response = &DescribeIp6TranslatorQuotaResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeIp6TranslatorQuota -// 查询账户在指定地域IPV6转换实例和规则的配额 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -func (c *Client) DescribeIp6TranslatorQuota(request *DescribeIp6TranslatorQuotaRequest) (response *DescribeIp6TranslatorQuotaResponse, err error) { - return c.DescribeIp6TranslatorQuotaWithContext(context.Background(), request) -} - -// DescribeIp6TranslatorQuota -// 查询账户在指定地域IPV6转换实例和规则的配额 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -func (c *Client) DescribeIp6TranslatorQuotaWithContext(ctx context.Context, request *DescribeIp6TranslatorQuotaRequest) (response *DescribeIp6TranslatorQuotaResponse, err error) { - if request == nil { - request = NewDescribeIp6TranslatorQuotaRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeIp6TranslatorQuota require credential") - } - - request.SetContext(ctx) - - response = NewDescribeIp6TranslatorQuotaResponse() - err = c.Send(request, response) - return -} - -func NewDescribeIp6TranslatorsRequest() (request *DescribeIp6TranslatorsRequest) { - request = &DescribeIp6TranslatorsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeIp6Translators") - - return -} - -func NewDescribeIp6TranslatorsResponse() (response *DescribeIp6TranslatorsResponse) { - response = &DescribeIp6TranslatorsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeIp6Translators -// 1. 该接口用于查询账户下的IPV6转换实例及其绑定的转换规则信息 -// -// 2. 支持过滤查询 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -func (c *Client) DescribeIp6Translators(request *DescribeIp6TranslatorsRequest) (response *DescribeIp6TranslatorsResponse, err error) { - return c.DescribeIp6TranslatorsWithContext(context.Background(), request) -} - -// DescribeIp6Translators -// 1. 该接口用于查询账户下的IPV6转换实例及其绑定的转换规则信息 -// -// 2. 支持过滤查询 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -func (c *Client) DescribeIp6TranslatorsWithContext(ctx context.Context, request *DescribeIp6TranslatorsRequest) (response *DescribeIp6TranslatorsResponse, err error) { - if request == nil { - request = NewDescribeIp6TranslatorsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeIp6Translators require credential") - } - - request.SetContext(ctx) - - response = NewDescribeIp6TranslatorsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeIpGeolocationDatabaseUrlRequest() (request *DescribeIpGeolocationDatabaseUrlRequest) { - request = &DescribeIpGeolocationDatabaseUrlRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeIpGeolocationDatabaseUrl") - - return -} - -func NewDescribeIpGeolocationDatabaseUrlResponse() (response *DescribeIpGeolocationDatabaseUrlResponse) { - response = &DescribeIpGeolocationDatabaseUrlResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeIpGeolocationDatabaseUrl -// 本接口(DescribeIpGeolocationDatabaseUrl)用于获取IP地理位置库下载链接。 -// -// 本接口即将下线,仅供存量用户使用,暂停新增用户。 -// -// 可能返回的错误码: -// -// AUTHFAILURE = "AuthFailure" -// INTERNALERROR = "InternalError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -func (c *Client) DescribeIpGeolocationDatabaseUrl(request *DescribeIpGeolocationDatabaseUrlRequest) (response *DescribeIpGeolocationDatabaseUrlResponse, err error) { - return c.DescribeIpGeolocationDatabaseUrlWithContext(context.Background(), request) -} - -// DescribeIpGeolocationDatabaseUrl -// 本接口(DescribeIpGeolocationDatabaseUrl)用于获取IP地理位置库下载链接。 -// -// 本接口即将下线,仅供存量用户使用,暂停新增用户。 -// -// 可能返回的错误码: -// -// AUTHFAILURE = "AuthFailure" -// INTERNALERROR = "InternalError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -func (c *Client) DescribeIpGeolocationDatabaseUrlWithContext(ctx context.Context, request *DescribeIpGeolocationDatabaseUrlRequest) (response *DescribeIpGeolocationDatabaseUrlResponse, err error) { - if request == nil { - request = NewDescribeIpGeolocationDatabaseUrlRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeIpGeolocationDatabaseUrl require credential") - } - - request.SetContext(ctx) - - response = NewDescribeIpGeolocationDatabaseUrlResponse() - err = c.Send(request, response) - return -} - -func NewDescribeIpGeolocationInfosRequest() (request *DescribeIpGeolocationInfosRequest) { - request = &DescribeIpGeolocationInfosRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeIpGeolocationInfos") - - return -} - -func NewDescribeIpGeolocationInfosResponse() (response *DescribeIpGeolocationInfosResponse) { - response = &DescribeIpGeolocationInfosResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeIpGeolocationInfos -// 本接口(DescribeIpGeolocationInfos)用于查询IP地址信息,包括地理位置信息和网络信息。 -// -// 本接口即将下线,仅供存量客户使用,暂停新增用户。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeIpGeolocationInfos(request *DescribeIpGeolocationInfosRequest) (response *DescribeIpGeolocationInfosResponse, err error) { - return c.DescribeIpGeolocationInfosWithContext(context.Background(), request) -} - -// DescribeIpGeolocationInfos -// 本接口(DescribeIpGeolocationInfos)用于查询IP地址信息,包括地理位置信息和网络信息。 -// -// 本接口即将下线,仅供存量客户使用,暂停新增用户。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeIpGeolocationInfosWithContext(ctx context.Context, request *DescribeIpGeolocationInfosRequest) (response *DescribeIpGeolocationInfosResponse, err error) { - if request == nil { - request = NewDescribeIpGeolocationInfosRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeIpGeolocationInfos require credential") - } - - request.SetContext(ctx) - - response = NewDescribeIpGeolocationInfosResponse() - err = c.Send(request, response) - return -} - -func NewDescribeLocalGatewayRequest() (request *DescribeLocalGatewayRequest) { - request = &DescribeLocalGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeLocalGateway") - - return -} - -func NewDescribeLocalGatewayResponse() (response *DescribeLocalGatewayResponse) { - response = &DescribeLocalGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeLocalGateway -// 本接口(DescribeLocalGateway)用于查询CDC的本地网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeLocalGateway(request *DescribeLocalGatewayRequest) (response *DescribeLocalGatewayResponse, err error) { - return c.DescribeLocalGatewayWithContext(context.Background(), request) -} - -// DescribeLocalGateway -// 本接口(DescribeLocalGateway)用于查询CDC的本地网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeLocalGatewayWithContext(ctx context.Context, request *DescribeLocalGatewayRequest) (response *DescribeLocalGatewayResponse, err error) { - if request == nil { - request = NewDescribeLocalGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeLocalGateway require credential") - } - - request.SetContext(ctx) - - response = NewDescribeLocalGatewayResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNatGatewayDestinationIpPortTranslationNatRulesRequest() (request *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) { - request = &DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNatGatewayDestinationIpPortTranslationNatRules") - - return -} - -func NewDescribeNatGatewayDestinationIpPortTranslationNatRulesResponse() (response *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse) { - response = &DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNatGatewayDestinationIpPortTranslationNatRules -// 本接口(DescribeNatGatewayDestinationIpPortTranslationNatRules)用于查询NAT网关端口转发规则对象数组。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -func (c *Client) DescribeNatGatewayDestinationIpPortTranslationNatRules(request *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) (response *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse, err error) { - return c.DescribeNatGatewayDestinationIpPortTranslationNatRulesWithContext(context.Background(), request) -} - -// DescribeNatGatewayDestinationIpPortTranslationNatRules -// 本接口(DescribeNatGatewayDestinationIpPortTranslationNatRules)用于查询NAT网关端口转发规则对象数组。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -func (c *Client) DescribeNatGatewayDestinationIpPortTranslationNatRulesWithContext(ctx context.Context, request *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) (response *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse, err error) { - if request == nil { - request = NewDescribeNatGatewayDestinationIpPortTranslationNatRulesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNatGatewayDestinationIpPortTranslationNatRules require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNatGatewayDestinationIpPortTranslationNatRulesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNatGatewayDirectConnectGatewayRouteRequest() (request *DescribeNatGatewayDirectConnectGatewayRouteRequest) { - request = &DescribeNatGatewayDirectConnectGatewayRouteRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNatGatewayDirectConnectGatewayRoute") - - return -} - -func NewDescribeNatGatewayDirectConnectGatewayRouteResponse() (response *DescribeNatGatewayDirectConnectGatewayRouteResponse) { - response = &DescribeNatGatewayDirectConnectGatewayRouteResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNatGatewayDirectConnectGatewayRoute -// 查询专线绑定NAT的路由 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -func (c *Client) DescribeNatGatewayDirectConnectGatewayRoute(request *DescribeNatGatewayDirectConnectGatewayRouteRequest) (response *DescribeNatGatewayDirectConnectGatewayRouteResponse, err error) { - return c.DescribeNatGatewayDirectConnectGatewayRouteWithContext(context.Background(), request) -} - -// DescribeNatGatewayDirectConnectGatewayRoute -// 查询专线绑定NAT的路由 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -func (c *Client) DescribeNatGatewayDirectConnectGatewayRouteWithContext(ctx context.Context, request *DescribeNatGatewayDirectConnectGatewayRouteRequest) (response *DescribeNatGatewayDirectConnectGatewayRouteResponse, err error) { - if request == nil { - request = NewDescribeNatGatewayDirectConnectGatewayRouteRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNatGatewayDirectConnectGatewayRoute require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNatGatewayDirectConnectGatewayRouteResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNatGatewaySourceIpTranslationNatRulesRequest() (request *DescribeNatGatewaySourceIpTranslationNatRulesRequest) { - request = &DescribeNatGatewaySourceIpTranslationNatRulesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNatGatewaySourceIpTranslationNatRules") - - return -} - -func NewDescribeNatGatewaySourceIpTranslationNatRulesResponse() (response *DescribeNatGatewaySourceIpTranslationNatRulesResponse) { - response = &DescribeNatGatewaySourceIpTranslationNatRulesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNatGatewaySourceIpTranslationNatRules -// 本接口(DescribeNatGatewaySourceIpTranslationNatRules)用于查询NAT网关SNAT转发规则对象数组。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNatGatewaySourceIpTranslationNatRules(request *DescribeNatGatewaySourceIpTranslationNatRulesRequest) (response *DescribeNatGatewaySourceIpTranslationNatRulesResponse, err error) { - return c.DescribeNatGatewaySourceIpTranslationNatRulesWithContext(context.Background(), request) -} - -// DescribeNatGatewaySourceIpTranslationNatRules -// 本接口(DescribeNatGatewaySourceIpTranslationNatRules)用于查询NAT网关SNAT转发规则对象数组。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNatGatewaySourceIpTranslationNatRulesWithContext(ctx context.Context, request *DescribeNatGatewaySourceIpTranslationNatRulesRequest) (response *DescribeNatGatewaySourceIpTranslationNatRulesResponse, err error) { - if request == nil { - request = NewDescribeNatGatewaySourceIpTranslationNatRulesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNatGatewaySourceIpTranslationNatRules require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNatGatewaySourceIpTranslationNatRulesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNatGatewaysRequest() (request *DescribeNatGatewaysRequest) { - request = &DescribeNatGatewaysRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNatGateways") - - return -} - -func NewDescribeNatGatewaysResponse() (response *DescribeNatGatewaysResponse) { - response = &DescribeNatGatewaysResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNatGateways -// 本接口(DescribeNatGateways)用于查询 NAT 网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -func (c *Client) DescribeNatGateways(request *DescribeNatGatewaysRequest) (response *DescribeNatGatewaysResponse, err error) { - return c.DescribeNatGatewaysWithContext(context.Background(), request) -} - -// DescribeNatGateways -// 本接口(DescribeNatGateways)用于查询 NAT 网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -func (c *Client) DescribeNatGatewaysWithContext(ctx context.Context, request *DescribeNatGatewaysRequest) (response *DescribeNatGatewaysResponse, err error) { - if request == nil { - request = NewDescribeNatGatewaysRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNatGateways require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNatGatewaysResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNetDetectStatesRequest() (request *DescribeNetDetectStatesRequest) { - request = &DescribeNetDetectStatesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetDetectStates") - - return -} - -func NewDescribeNetDetectStatesResponse() (response *DescribeNetDetectStatesResponse) { - response = &DescribeNetDetectStatesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNetDetectStates -// 本接口(DescribeNetDetectStates)用于查询网络探测验证结果列表。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNetDetectStates(request *DescribeNetDetectStatesRequest) (response *DescribeNetDetectStatesResponse, err error) { - return c.DescribeNetDetectStatesWithContext(context.Background(), request) -} - -// DescribeNetDetectStates -// 本接口(DescribeNetDetectStates)用于查询网络探测验证结果列表。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNetDetectStatesWithContext(ctx context.Context, request *DescribeNetDetectStatesRequest) (response *DescribeNetDetectStatesResponse, err error) { - if request == nil { - request = NewDescribeNetDetectStatesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNetDetectStates require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNetDetectStatesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNetDetectsRequest() (request *DescribeNetDetectsRequest) { - request = &DescribeNetDetectsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetDetects") - - return -} - -func NewDescribeNetDetectsResponse() (response *DescribeNetDetectsResponse) { - response = &DescribeNetDetectsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNetDetects -// 本接口(DescribeNetDetects)用于查询网络探测列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNetDetects(request *DescribeNetDetectsRequest) (response *DescribeNetDetectsResponse, err error) { - return c.DescribeNetDetectsWithContext(context.Background(), request) -} - -// DescribeNetDetects -// 本接口(DescribeNetDetects)用于查询网络探测列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNetDetectsWithContext(ctx context.Context, request *DescribeNetDetectsRequest) (response *DescribeNetDetectsResponse, err error) { - if request == nil { - request = NewDescribeNetDetectsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNetDetects require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNetDetectsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNetworkAccountTypeRequest() (request *DescribeNetworkAccountTypeRequest) { - request = &DescribeNetworkAccountTypeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetworkAccountType") - - return -} - -func NewDescribeNetworkAccountTypeResponse() (response *DescribeNetworkAccountTypeResponse) { - response = &DescribeNetworkAccountTypeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNetworkAccountType -// 判断用户在网络侧的用户类型,如标准(带宽上移),传统(非上移)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNetworkAccountType(request *DescribeNetworkAccountTypeRequest) (response *DescribeNetworkAccountTypeResponse, err error) { - return c.DescribeNetworkAccountTypeWithContext(context.Background(), request) -} - -// DescribeNetworkAccountType -// 判断用户在网络侧的用户类型,如标准(带宽上移),传统(非上移)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNetworkAccountTypeWithContext(ctx context.Context, request *DescribeNetworkAccountTypeRequest) (response *DescribeNetworkAccountTypeResponse, err error) { - if request == nil { - request = NewDescribeNetworkAccountTypeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNetworkAccountType require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNetworkAccountTypeResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNetworkAclQuintupleEntriesRequest() (request *DescribeNetworkAclQuintupleEntriesRequest) { - request = &DescribeNetworkAclQuintupleEntriesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetworkAclQuintupleEntries") - - return -} - -func NewDescribeNetworkAclQuintupleEntriesResponse() (response *DescribeNetworkAclQuintupleEntriesResponse) { - response = &DescribeNetworkAclQuintupleEntriesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNetworkAclQuintupleEntries -// 本接口(DescribeNetworkAclQuintupleEntries)查询入方向或出方向网络ACL五元组条目列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_ACLTYPEMISMATCH = "InvalidParameter.AclTypeMismatch" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -func (c *Client) DescribeNetworkAclQuintupleEntries(request *DescribeNetworkAclQuintupleEntriesRequest) (response *DescribeNetworkAclQuintupleEntriesResponse, err error) { - return c.DescribeNetworkAclQuintupleEntriesWithContext(context.Background(), request) -} - -// DescribeNetworkAclQuintupleEntries -// 本接口(DescribeNetworkAclQuintupleEntries)查询入方向或出方向网络ACL五元组条目列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_ACLTYPEMISMATCH = "InvalidParameter.AclTypeMismatch" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -func (c *Client) DescribeNetworkAclQuintupleEntriesWithContext(ctx context.Context, request *DescribeNetworkAclQuintupleEntriesRequest) (response *DescribeNetworkAclQuintupleEntriesResponse, err error) { - if request == nil { - request = NewDescribeNetworkAclQuintupleEntriesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNetworkAclQuintupleEntries require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNetworkAclQuintupleEntriesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNetworkAclsRequest() (request *DescribeNetworkAclsRequest) { - request = &DescribeNetworkAclsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetworkAcls") - - return -} - -func NewDescribeNetworkAclsResponse() (response *DescribeNetworkAclsResponse) { - response = &DescribeNetworkAclsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNetworkAcls -// 本接口(DescribeNetworkAcls)用于查询网络ACL列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -func (c *Client) DescribeNetworkAcls(request *DescribeNetworkAclsRequest) (response *DescribeNetworkAclsResponse, err error) { - return c.DescribeNetworkAclsWithContext(context.Background(), request) -} - -// DescribeNetworkAcls -// 本接口(DescribeNetworkAcls)用于查询网络ACL列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -func (c *Client) DescribeNetworkAclsWithContext(ctx context.Context, request *DescribeNetworkAclsRequest) (response *DescribeNetworkAclsResponse, err error) { - if request == nil { - request = NewDescribeNetworkAclsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNetworkAcls require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNetworkAclsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNetworkInterfaceLimitRequest() (request *DescribeNetworkInterfaceLimitRequest) { - request = &DescribeNetworkInterfaceLimitRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetworkInterfaceLimit") - - return -} - -func NewDescribeNetworkInterfaceLimitResponse() (response *DescribeNetworkInterfaceLimitResponse) { - response = &DescribeNetworkInterfaceLimitResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNetworkInterfaceLimit -// 本接口(DescribeNetworkInterfaceLimit)根据CVM实例ID或弹性网卡ID查询弹性网卡配额,返回该CVM实例或弹性网卡能绑定的弹性网卡配额,以及弹性网卡可以分配的IP配额。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNetworkInterfaceLimit(request *DescribeNetworkInterfaceLimitRequest) (response *DescribeNetworkInterfaceLimitResponse, err error) { - return c.DescribeNetworkInterfaceLimitWithContext(context.Background(), request) -} - -// DescribeNetworkInterfaceLimit -// 本接口(DescribeNetworkInterfaceLimit)根据CVM实例ID或弹性网卡ID查询弹性网卡配额,返回该CVM实例或弹性网卡能绑定的弹性网卡配额,以及弹性网卡可以分配的IP配额。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeNetworkInterfaceLimitWithContext(ctx context.Context, request *DescribeNetworkInterfaceLimitRequest) (response *DescribeNetworkInterfaceLimitResponse, err error) { - if request == nil { - request = NewDescribeNetworkInterfaceLimitRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNetworkInterfaceLimit require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNetworkInterfaceLimitResponse() - err = c.Send(request, response) - return -} - -func NewDescribeNetworkInterfacesRequest() (request *DescribeNetworkInterfacesRequest) { - request = &DescribeNetworkInterfacesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetworkInterfaces") - - return -} - -func NewDescribeNetworkInterfacesResponse() (response *DescribeNetworkInterfacesResponse) { - response = &DescribeNetworkInterfacesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeNetworkInterfaces -// 本接口(DescribeNetworkInterfaces)用于查询弹性网卡列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeNetworkInterfaces(request *DescribeNetworkInterfacesRequest) (response *DescribeNetworkInterfacesResponse, err error) { - return c.DescribeNetworkInterfacesWithContext(context.Background(), request) -} - -// DescribeNetworkInterfaces -// 本接口(DescribeNetworkInterfaces)用于查询弹性网卡列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeNetworkInterfacesWithContext(ctx context.Context, request *DescribeNetworkInterfacesRequest) (response *DescribeNetworkInterfacesResponse, err error) { - if request == nil { - request = NewDescribeNetworkInterfacesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeNetworkInterfaces require credential") - } - - request.SetContext(ctx) - - response = NewDescribeNetworkInterfacesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeProductQuotaRequest() (request *DescribeProductQuotaRequest) { - request = &DescribeProductQuotaRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeProductQuota") - - return -} - -func NewDescribeProductQuotaResponse() (response *DescribeProductQuotaResponse) { - response = &DescribeProductQuotaResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeProductQuota -// 本接口(DescribeProductQuota)用于查询网络产品的配额信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -func (c *Client) DescribeProductQuota(request *DescribeProductQuotaRequest) (response *DescribeProductQuotaResponse, err error) { - return c.DescribeProductQuotaWithContext(context.Background(), request) -} - -// DescribeProductQuota -// 本接口(DescribeProductQuota)用于查询网络产品的配额信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -func (c *Client) DescribeProductQuotaWithContext(ctx context.Context, request *DescribeProductQuotaRequest) (response *DescribeProductQuotaResponse, err error) { - if request == nil { - request = NewDescribeProductQuotaRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeProductQuota require credential") - } - - request.SetContext(ctx) - - response = NewDescribeProductQuotaResponse() - err = c.Send(request, response) - return -} - -func NewDescribeRouteConflictsRequest() (request *DescribeRouteConflictsRequest) { - request = &DescribeRouteConflictsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeRouteConflicts") - - return -} - -func NewDescribeRouteConflictsResponse() (response *DescribeRouteConflictsResponse) { - response = &DescribeRouteConflictsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeRouteConflicts -// 本接口(DescribeRouteConflicts)用于查询自定义路由策略与云联网路由策略冲突列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeRouteConflicts(request *DescribeRouteConflictsRequest) (response *DescribeRouteConflictsResponse, err error) { - return c.DescribeRouteConflictsWithContext(context.Background(), request) -} - -// DescribeRouteConflicts -// 本接口(DescribeRouteConflicts)用于查询自定义路由策略与云联网路由策略冲突列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeRouteConflictsWithContext(ctx context.Context, request *DescribeRouteConflictsRequest) (response *DescribeRouteConflictsResponse, err error) { - if request == nil { - request = NewDescribeRouteConflictsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeRouteConflicts require credential") - } - - request.SetContext(ctx) - - response = NewDescribeRouteConflictsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeRouteTablesRequest() (request *DescribeRouteTablesRequest) { - request = &DescribeRouteTablesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeRouteTables") - - return -} - -func NewDescribeRouteTablesResponse() (response *DescribeRouteTablesResponse) { - response = &DescribeRouteTablesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeRouteTables -// 本接口(DescribeRouteTables)用于查询路由表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeRouteTables(request *DescribeRouteTablesRequest) (response *DescribeRouteTablesResponse, err error) { - return c.DescribeRouteTablesWithContext(context.Background(), request) -} - -// DescribeRouteTables -// 本接口(DescribeRouteTables)用于查询路由表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeRouteTablesWithContext(ctx context.Context, request *DescribeRouteTablesRequest) (response *DescribeRouteTablesResponse, err error) { - if request == nil { - request = NewDescribeRouteTablesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeRouteTables require credential") - } - - request.SetContext(ctx) - - response = NewDescribeRouteTablesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSecurityGroupAssociationStatisticsRequest() (request *DescribeSecurityGroupAssociationStatisticsRequest) { - request = &DescribeSecurityGroupAssociationStatisticsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroupAssociationStatistics") - - return -} - -func NewDescribeSecurityGroupAssociationStatisticsResponse() (response *DescribeSecurityGroupAssociationStatisticsResponse) { - response = &DescribeSecurityGroupAssociationStatisticsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSecurityGroupAssociationStatistics -// 本接口(DescribeSecurityGroupAssociationStatistics)用于查询安全组关联的实例统计。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeSecurityGroupAssociationStatistics(request *DescribeSecurityGroupAssociationStatisticsRequest) (response *DescribeSecurityGroupAssociationStatisticsResponse, err error) { - return c.DescribeSecurityGroupAssociationStatisticsWithContext(context.Background(), request) -} - -// DescribeSecurityGroupAssociationStatistics -// 本接口(DescribeSecurityGroupAssociationStatistics)用于查询安全组关联的实例统计。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeSecurityGroupAssociationStatisticsWithContext(ctx context.Context, request *DescribeSecurityGroupAssociationStatisticsRequest) (response *DescribeSecurityGroupAssociationStatisticsResponse, err error) { - if request == nil { - request = NewDescribeSecurityGroupAssociationStatisticsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSecurityGroupAssociationStatistics require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSecurityGroupAssociationStatisticsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSecurityGroupLimitsRequest() (request *DescribeSecurityGroupLimitsRequest) { - request = &DescribeSecurityGroupLimitsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroupLimits") - - return -} - -func NewDescribeSecurityGroupLimitsResponse() (response *DescribeSecurityGroupLimitsResponse) { - response = &DescribeSecurityGroupLimitsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSecurityGroupLimits -// 本接口(DescribeSecurityGroupLimits)用于查询用户安全组配额。 -// -// 可能返回的错误码: -// -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeSecurityGroupLimits(request *DescribeSecurityGroupLimitsRequest) (response *DescribeSecurityGroupLimitsResponse, err error) { - return c.DescribeSecurityGroupLimitsWithContext(context.Background(), request) -} - -// DescribeSecurityGroupLimits -// 本接口(DescribeSecurityGroupLimits)用于查询用户安全组配额。 -// -// 可能返回的错误码: -// -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeSecurityGroupLimitsWithContext(ctx context.Context, request *DescribeSecurityGroupLimitsRequest) (response *DescribeSecurityGroupLimitsResponse, err error) { - if request == nil { - request = NewDescribeSecurityGroupLimitsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSecurityGroupLimits require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSecurityGroupLimitsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSecurityGroupPoliciesRequest() (request *DescribeSecurityGroupPoliciesRequest) { - request = &DescribeSecurityGroupPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroupPolicies") - - return -} - -func NewDescribeSecurityGroupPoliciesResponse() (response *DescribeSecurityGroupPoliciesResponse) { - response = &DescribeSecurityGroupPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSecurityGroupPolicies -// 本接口(DescribeSecurityGroupPolicies)用于查询安全组规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeSecurityGroupPolicies(request *DescribeSecurityGroupPoliciesRequest) (response *DescribeSecurityGroupPoliciesResponse, err error) { - return c.DescribeSecurityGroupPoliciesWithContext(context.Background(), request) -} - -// DescribeSecurityGroupPolicies -// 本接口(DescribeSecurityGroupPolicies)用于查询安全组规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeSecurityGroupPoliciesWithContext(ctx context.Context, request *DescribeSecurityGroupPoliciesRequest) (response *DescribeSecurityGroupPoliciesResponse, err error) { - if request == nil { - request = NewDescribeSecurityGroupPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSecurityGroupPolicies require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSecurityGroupPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSecurityGroupReferencesRequest() (request *DescribeSecurityGroupReferencesRequest) { - request = &DescribeSecurityGroupReferencesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroupReferences") - - return -} - -func NewDescribeSecurityGroupReferencesResponse() (response *DescribeSecurityGroupReferencesResponse) { - response = &DescribeSecurityGroupReferencesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSecurityGroupReferences -// 本接口(DescribeSecurityGroupReferences)用于查询安全组被引用信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeSecurityGroupReferences(request *DescribeSecurityGroupReferencesRequest) (response *DescribeSecurityGroupReferencesResponse, err error) { - return c.DescribeSecurityGroupReferencesWithContext(context.Background(), request) -} - -// DescribeSecurityGroupReferences -// 本接口(DescribeSecurityGroupReferences)用于查询安全组被引用信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeSecurityGroupReferencesWithContext(ctx context.Context, request *DescribeSecurityGroupReferencesRequest) (response *DescribeSecurityGroupReferencesResponse, err error) { - if request == nil { - request = NewDescribeSecurityGroupReferencesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSecurityGroupReferences require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSecurityGroupReferencesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSecurityGroupsRequest() (request *DescribeSecurityGroupsRequest) { - request = &DescribeSecurityGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroups") - - return -} - -func NewDescribeSecurityGroupsResponse() (response *DescribeSecurityGroupsResponse) { - response = &DescribeSecurityGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSecurityGroups -// 本接口(DescribeSecurityGroups)用于查询安全组。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeSecurityGroups(request *DescribeSecurityGroupsRequest) (response *DescribeSecurityGroupsResponse, err error) { - return c.DescribeSecurityGroupsWithContext(context.Background(), request) -} - -// DescribeSecurityGroups -// 本接口(DescribeSecurityGroups)用于查询安全组。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeSecurityGroupsWithContext(ctx context.Context, request *DescribeSecurityGroupsRequest) (response *DescribeSecurityGroupsResponse, err error) { - if request == nil { - request = NewDescribeSecurityGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSecurityGroups require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSecurityGroupsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeServiceTemplateGroupsRequest() (request *DescribeServiceTemplateGroupsRequest) { - request = &DescribeServiceTemplateGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeServiceTemplateGroups") - - return -} - -func NewDescribeServiceTemplateGroupsResponse() (response *DescribeServiceTemplateGroupsResponse) { - response = &DescribeServiceTemplateGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeServiceTemplateGroups -// 本接口(DescribeServiceTemplateGroups)用于查询协议端口模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeServiceTemplateGroups(request *DescribeServiceTemplateGroupsRequest) (response *DescribeServiceTemplateGroupsResponse, err error) { - return c.DescribeServiceTemplateGroupsWithContext(context.Background(), request) -} - -// DescribeServiceTemplateGroups -// 本接口(DescribeServiceTemplateGroups)用于查询协议端口模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeServiceTemplateGroupsWithContext(ctx context.Context, request *DescribeServiceTemplateGroupsRequest) (response *DescribeServiceTemplateGroupsResponse, err error) { - if request == nil { - request = NewDescribeServiceTemplateGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeServiceTemplateGroups require credential") - } - - request.SetContext(ctx) - - response = NewDescribeServiceTemplateGroupsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeServiceTemplatesRequest() (request *DescribeServiceTemplatesRequest) { - request = &DescribeServiceTemplatesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeServiceTemplates") - - return -} - -func NewDescribeServiceTemplatesResponse() (response *DescribeServiceTemplatesResponse) { - response = &DescribeServiceTemplatesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeServiceTemplates -// 本接口(DescribeServiceTemplates)用于查询协议端口模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeServiceTemplates(request *DescribeServiceTemplatesRequest) (response *DescribeServiceTemplatesResponse, err error) { - return c.DescribeServiceTemplatesWithContext(context.Background(), request) -} - -// DescribeServiceTemplates -// 本接口(DescribeServiceTemplates)用于查询协议端口模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeServiceTemplatesWithContext(ctx context.Context, request *DescribeServiceTemplatesRequest) (response *DescribeServiceTemplatesResponse, err error) { - if request == nil { - request = NewDescribeServiceTemplatesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeServiceTemplates require credential") - } - - request.SetContext(ctx) - - response = NewDescribeServiceTemplatesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSgSnapshotFileContentRequest() (request *DescribeSgSnapshotFileContentRequest) { - request = &DescribeSgSnapshotFileContentRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSgSnapshotFileContent") - - return -} - -func NewDescribeSgSnapshotFileContentResponse() (response *DescribeSgSnapshotFileContentResponse) { - response = &DescribeSgSnapshotFileContentResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSgSnapshotFileContent -// 本接口(DescribeSgSnapshotFileContent)用于查询安全组快照文件内容。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTFILEFAILED = "UnsupportedOperation.SnapshotFileFailed" -// UNSUPPORTEDOPERATION_SNAPSHOTFILENOEXIST = "UnsupportedOperation.SnapshotFileNoExist" -// UNSUPPORTEDOPERATION_SNAPSHOTFILEPROCESSING = "UnsupportedOperation.SnapshotFileProcessing" -func (c *Client) DescribeSgSnapshotFileContent(request *DescribeSgSnapshotFileContentRequest) (response *DescribeSgSnapshotFileContentResponse, err error) { - return c.DescribeSgSnapshotFileContentWithContext(context.Background(), request) -} - -// DescribeSgSnapshotFileContent -// 本接口(DescribeSgSnapshotFileContent)用于查询安全组快照文件内容。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTFILEFAILED = "UnsupportedOperation.SnapshotFileFailed" -// UNSUPPORTEDOPERATION_SNAPSHOTFILENOEXIST = "UnsupportedOperation.SnapshotFileNoExist" -// UNSUPPORTEDOPERATION_SNAPSHOTFILEPROCESSING = "UnsupportedOperation.SnapshotFileProcessing" -func (c *Client) DescribeSgSnapshotFileContentWithContext(ctx context.Context, request *DescribeSgSnapshotFileContentRequest) (response *DescribeSgSnapshotFileContentResponse, err error) { - if request == nil { - request = NewDescribeSgSnapshotFileContentRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSgSnapshotFileContent require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSgSnapshotFileContentResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSnapshotAttachedInstancesRequest() (request *DescribeSnapshotAttachedInstancesRequest) { - request = &DescribeSnapshotAttachedInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSnapshotAttachedInstances") - - return -} - -func NewDescribeSnapshotAttachedInstancesResponse() (response *DescribeSnapshotAttachedInstancesResponse) { - response = &DescribeSnapshotAttachedInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSnapshotAttachedInstances -// 本接口(DescribeSnapshotAttachedInstances)用于查询快照策略关联实例列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeSnapshotAttachedInstances(request *DescribeSnapshotAttachedInstancesRequest) (response *DescribeSnapshotAttachedInstancesResponse, err error) { - return c.DescribeSnapshotAttachedInstancesWithContext(context.Background(), request) -} - -// DescribeSnapshotAttachedInstances -// 本接口(DescribeSnapshotAttachedInstances)用于查询快照策略关联实例列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeSnapshotAttachedInstancesWithContext(ctx context.Context, request *DescribeSnapshotAttachedInstancesRequest) (response *DescribeSnapshotAttachedInstancesResponse, err error) { - if request == nil { - request = NewDescribeSnapshotAttachedInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSnapshotAttachedInstances require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSnapshotAttachedInstancesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSnapshotFilesRequest() (request *DescribeSnapshotFilesRequest) { - request = &DescribeSnapshotFilesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSnapshotFiles") - - return -} - -func NewDescribeSnapshotFilesResponse() (response *DescribeSnapshotFilesResponse) { - response = &DescribeSnapshotFilesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSnapshotFiles -// 本接口(DescribeSnapshotFiles)用于查询快照文件。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTNOTATTACHED = "UnsupportedOperation.SnapshotNotAttached" -func (c *Client) DescribeSnapshotFiles(request *DescribeSnapshotFilesRequest) (response *DescribeSnapshotFilesResponse, err error) { - return c.DescribeSnapshotFilesWithContext(context.Background(), request) -} - -// DescribeSnapshotFiles -// 本接口(DescribeSnapshotFiles)用于查询快照文件。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTNOTATTACHED = "UnsupportedOperation.SnapshotNotAttached" -func (c *Client) DescribeSnapshotFilesWithContext(ctx context.Context, request *DescribeSnapshotFilesRequest) (response *DescribeSnapshotFilesResponse, err error) { - if request == nil { - request = NewDescribeSnapshotFilesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSnapshotFiles require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSnapshotFilesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSnapshotPoliciesRequest() (request *DescribeSnapshotPoliciesRequest) { - request = &DescribeSnapshotPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSnapshotPolicies") - - return -} - -func NewDescribeSnapshotPoliciesResponse() (response *DescribeSnapshotPoliciesResponse) { - response = &DescribeSnapshotPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSnapshotPolicies -// 本接口(DescribeSnapshotPolicies)用于查询快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeSnapshotPolicies(request *DescribeSnapshotPoliciesRequest) (response *DescribeSnapshotPoliciesResponse, err error) { - return c.DescribeSnapshotPoliciesWithContext(context.Background(), request) -} - -// DescribeSnapshotPolicies -// 本接口(DescribeSnapshotPolicies)用于查询快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) DescribeSnapshotPoliciesWithContext(ctx context.Context, request *DescribeSnapshotPoliciesRequest) (response *DescribeSnapshotPoliciesResponse, err error) { - if request == nil { - request = NewDescribeSnapshotPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSnapshotPolicies require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSnapshotPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSpecificTrafficPackageUsedDetailsRequest() (request *DescribeSpecificTrafficPackageUsedDetailsRequest) { - request = &DescribeSpecificTrafficPackageUsedDetailsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSpecificTrafficPackageUsedDetails") - - return -} - -func NewDescribeSpecificTrafficPackageUsedDetailsResponse() (response *DescribeSpecificTrafficPackageUsedDetailsResponse) { - response = &DescribeSpecificTrafficPackageUsedDetailsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSpecificTrafficPackageUsedDetails -// 本接口 (DescribeSpecificTrafficPackageUsedDetails) 用于查询指定 共享流量包 的用量明细。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGEID = "InvalidParameterValue.TrafficPackageId" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGEIDMALFORMED = "InvalidParameterValue.TrafficPackageIdMalformed" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGENOTFOUND = "InvalidParameterValue.TrafficPackageNotFound" -func (c *Client) DescribeSpecificTrafficPackageUsedDetails(request *DescribeSpecificTrafficPackageUsedDetailsRequest) (response *DescribeSpecificTrafficPackageUsedDetailsResponse, err error) { - return c.DescribeSpecificTrafficPackageUsedDetailsWithContext(context.Background(), request) -} - -// DescribeSpecificTrafficPackageUsedDetails -// 本接口 (DescribeSpecificTrafficPackageUsedDetails) 用于查询指定 共享流量包 的用量明细。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGEID = "InvalidParameterValue.TrafficPackageId" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGEIDMALFORMED = "InvalidParameterValue.TrafficPackageIdMalformed" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGENOTFOUND = "InvalidParameterValue.TrafficPackageNotFound" -func (c *Client) DescribeSpecificTrafficPackageUsedDetailsWithContext(ctx context.Context, request *DescribeSpecificTrafficPackageUsedDetailsRequest) (response *DescribeSpecificTrafficPackageUsedDetailsResponse, err error) { - if request == nil { - request = NewDescribeSpecificTrafficPackageUsedDetailsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSpecificTrafficPackageUsedDetails require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSpecificTrafficPackageUsedDetailsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSubnetResourceDashboardRequest() (request *DescribeSubnetResourceDashboardRequest) { - request = &DescribeSubnetResourceDashboardRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSubnetResourceDashboard") - - return -} - -func NewDescribeSubnetResourceDashboardResponse() (response *DescribeSubnetResourceDashboardResponse) { - response = &DescribeSubnetResourceDashboardResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSubnetResourceDashboard -// 本接口(DescribeSubnetResourceDashboard)用于查看Subnet资源信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeSubnetResourceDashboard(request *DescribeSubnetResourceDashboardRequest) (response *DescribeSubnetResourceDashboardResponse, err error) { - return c.DescribeSubnetResourceDashboardWithContext(context.Background(), request) -} - -// DescribeSubnetResourceDashboard -// 本接口(DescribeSubnetResourceDashboard)用于查看Subnet资源信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeSubnetResourceDashboardWithContext(ctx context.Context, request *DescribeSubnetResourceDashboardRequest) (response *DescribeSubnetResourceDashboardResponse, err error) { - if request == nil { - request = NewDescribeSubnetResourceDashboardRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSubnetResourceDashboard require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSubnetResourceDashboardResponse() - err = c.Send(request, response) - return -} - -func NewDescribeSubnetsRequest() (request *DescribeSubnetsRequest) { - request = &DescribeSubnetsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeSubnets") - - return -} - -func NewDescribeSubnetsResponse() (response *DescribeSubnetsResponse) { - response = &DescribeSubnetsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeSubnets -// 本接口(DescribeSubnets)用于查询子网列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) DescribeSubnets(request *DescribeSubnetsRequest) (response *DescribeSubnetsResponse, err error) { - return c.DescribeSubnetsWithContext(context.Background(), request) -} - -// DescribeSubnets -// 本接口(DescribeSubnets)用于查询子网列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) DescribeSubnetsWithContext(ctx context.Context, request *DescribeSubnetsRequest) (response *DescribeSubnetsResponse, err error) { - if request == nil { - request = NewDescribeSubnetsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeSubnets require credential") - } - - request.SetContext(ctx) - - response = NewDescribeSubnetsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeTaskResultRequest() (request *DescribeTaskResultRequest) { - request = &DescribeTaskResultRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeTaskResult") - - return -} - -func NewDescribeTaskResultResponse() (response *DescribeTaskResultResponse) { - response = &DescribeTaskResultResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeTaskResult -// 查询EIP异步任务执行结果 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeTaskResult(request *DescribeTaskResultRequest) (response *DescribeTaskResultResponse, err error) { - return c.DescribeTaskResultWithContext(context.Background(), request) -} - -// DescribeTaskResult -// 查询EIP异步任务执行结果 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeTaskResultWithContext(ctx context.Context, request *DescribeTaskResultRequest) (response *DescribeTaskResultResponse, err error) { - if request == nil { - request = NewDescribeTaskResultRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeTaskResult require credential") - } - - request.SetContext(ctx) - - response = NewDescribeTaskResultResponse() - err = c.Send(request, response) - return -} - -func NewDescribeTemplateLimitsRequest() (request *DescribeTemplateLimitsRequest) { - request = &DescribeTemplateLimitsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeTemplateLimits") - - return -} - -func NewDescribeTemplateLimitsResponse() (response *DescribeTemplateLimitsResponse) { - response = &DescribeTemplateLimitsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeTemplateLimits -// 本接口(DescribeTemplateLimits)用于查询参数模板配额列表。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeTemplateLimits(request *DescribeTemplateLimitsRequest) (response *DescribeTemplateLimitsResponse, err error) { - return c.DescribeTemplateLimitsWithContext(context.Background(), request) -} - -// DescribeTemplateLimits -// 本接口(DescribeTemplateLimits)用于查询参数模板配额列表。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// MISSINGPARAMETER = "MissingParameter" -func (c *Client) DescribeTemplateLimitsWithContext(ctx context.Context, request *DescribeTemplateLimitsRequest) (response *DescribeTemplateLimitsResponse, err error) { - if request == nil { - request = NewDescribeTemplateLimitsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeTemplateLimits require credential") - } - - request.SetContext(ctx) - - response = NewDescribeTemplateLimitsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeTenantCcnsRequest() (request *DescribeTenantCcnsRequest) { - request = &DescribeTenantCcnsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeTenantCcns") - - return -} - -func NewDescribeTenantCcnsResponse() (response *DescribeTenantCcnsResponse) { - response = &DescribeTenantCcnsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeTenantCcns -// 本接口(DescribeTenantCcns)用于获取要锁定的云联网实例列表。 -// -// 该接口一般用来封禁出口限速的云联网实例, 目前联通内部运营系统通过云API调用, 因为出口限速无法按地域间封禁, 只能按更粗的云联网实例粒度封禁, 如果是地域间限速, 一般可以通过更细的限速实例粒度封禁(DescribeCrossBorderCcnRegionBandwidthLimits) -// -// 如有需要, 可以封禁任意云联网实例, 可接入到内部运营系统 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) DescribeTenantCcns(request *DescribeTenantCcnsRequest) (response *DescribeTenantCcnsResponse, err error) { - return c.DescribeTenantCcnsWithContext(context.Background(), request) -} - -// DescribeTenantCcns -// 本接口(DescribeTenantCcns)用于获取要锁定的云联网实例列表。 -// -// 该接口一般用来封禁出口限速的云联网实例, 目前联通内部运营系统通过云API调用, 因为出口限速无法按地域间封禁, 只能按更粗的云联网实例粒度封禁, 如果是地域间限速, 一般可以通过更细的限速实例粒度封禁(DescribeCrossBorderCcnRegionBandwidthLimits) -// -// 如有需要, 可以封禁任意云联网实例, 可接入到内部运营系统 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) DescribeTenantCcnsWithContext(ctx context.Context, request *DescribeTenantCcnsRequest) (response *DescribeTenantCcnsResponse, err error) { - if request == nil { - request = NewDescribeTenantCcnsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeTenantCcns require credential") - } - - request.SetContext(ctx) - - response = NewDescribeTenantCcnsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeTrafficPackagesRequest() (request *DescribeTrafficPackagesRequest) { - request = &DescribeTrafficPackagesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeTrafficPackages") - - return -} - -func NewDescribeTrafficPackagesResponse() (response *DescribeTrafficPackagesResponse) { - response = &DescribeTrafficPackagesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeTrafficPackages -// 本接口 (DescribeTrafficPackages) 用于查询共享流量包详细信息,包括共享流量包唯一标识ID,名称,流量使用信息等 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGEIDMALFORMED = "InvalidParameterValue.TrafficPackageIdMalformed" -func (c *Client) DescribeTrafficPackages(request *DescribeTrafficPackagesRequest) (response *DescribeTrafficPackagesResponse, err error) { - return c.DescribeTrafficPackagesWithContext(context.Background(), request) -} - -// DescribeTrafficPackages -// 本接口 (DescribeTrafficPackages) 用于查询共享流量包详细信息,包括共享流量包唯一标识ID,名称,流量使用信息等 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" -// INVALIDPARAMETERVALUE_TRAFFICPACKAGEIDMALFORMED = "InvalidParameterValue.TrafficPackageIdMalformed" -func (c *Client) DescribeTrafficPackagesWithContext(ctx context.Context, request *DescribeTrafficPackagesRequest) (response *DescribeTrafficPackagesResponse, err error) { - if request == nil { - request = NewDescribeTrafficPackagesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeTrafficPackages require credential") - } - - request.SetContext(ctx) - - response = NewDescribeTrafficPackagesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeUsedIpAddressRequest() (request *DescribeUsedIpAddressRequest) { - request = &DescribeUsedIpAddressRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeUsedIpAddress") - - return -} - -func NewDescribeUsedIpAddressResponse() (response *DescribeUsedIpAddressResponse) { - response = &DescribeUsedIpAddressResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeUsedIpAddress -// 本接口(DescribeUsedIpAddress)用于查询Subnet或者Vpc内的ip的使用情况, -// -// 如ip被占用,返回占用ip的资源类别与id;如未被占用,返回空值 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" -func (c *Client) DescribeUsedIpAddress(request *DescribeUsedIpAddressRequest) (response *DescribeUsedIpAddressResponse, err error) { - return c.DescribeUsedIpAddressWithContext(context.Background(), request) -} - -// DescribeUsedIpAddress -// 本接口(DescribeUsedIpAddress)用于查询Subnet或者Vpc内的ip的使用情况, -// -// 如ip被占用,返回占用ip的资源类别与id;如未被占用,返回空值 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" -func (c *Client) DescribeUsedIpAddressWithContext(ctx context.Context, request *DescribeUsedIpAddressRequest) (response *DescribeUsedIpAddressResponse, err error) { - if request == nil { - request = NewDescribeUsedIpAddressRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeUsedIpAddress require credential") - } - - request.SetContext(ctx) - - response = NewDescribeUsedIpAddressResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcEndPointRequest() (request *DescribeVpcEndPointRequest) { - request = &DescribeVpcEndPointRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcEndPoint") - - return -} - -func NewDescribeVpcEndPointResponse() (response *DescribeVpcEndPointResponse) { - response = &DescribeVpcEndPointResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcEndPoint -// 本接口(DescribeVpcEndPoint)用于查询终端节点列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCENOTFOUND_SVCNOTEXIST = "ResourceNotFound.SvcNotExist" -func (c *Client) DescribeVpcEndPoint(request *DescribeVpcEndPointRequest) (response *DescribeVpcEndPointResponse, err error) { - return c.DescribeVpcEndPointWithContext(context.Background(), request) -} - -// DescribeVpcEndPoint -// 本接口(DescribeVpcEndPoint)用于查询终端节点列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCENOTFOUND_SVCNOTEXIST = "ResourceNotFound.SvcNotExist" -func (c *Client) DescribeVpcEndPointWithContext(ctx context.Context, request *DescribeVpcEndPointRequest) (response *DescribeVpcEndPointResponse, err error) { - if request == nil { - request = NewDescribeVpcEndPointRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcEndPoint require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcEndPointResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcEndPointServiceRequest() (request *DescribeVpcEndPointServiceRequest) { - request = &DescribeVpcEndPointServiceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcEndPointService") - - return -} - -func NewDescribeVpcEndPointServiceResponse() (response *DescribeVpcEndPointServiceResponse) { - response = &DescribeVpcEndPointServiceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcEndPointService -// 查询终端节点服务列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INSTANCEMISMATCH = "UnsupportedOperation.InstanceMismatch" -// UNSUPPORTEDOPERATION_ROLENOTFOUND = "UnsupportedOperation.RoleNotFound" -func (c *Client) DescribeVpcEndPointService(request *DescribeVpcEndPointServiceRequest) (response *DescribeVpcEndPointServiceResponse, err error) { - return c.DescribeVpcEndPointServiceWithContext(context.Background(), request) -} - -// DescribeVpcEndPointService -// 查询终端节点服务列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INSTANCEMISMATCH = "UnsupportedOperation.InstanceMismatch" -// UNSUPPORTEDOPERATION_ROLENOTFOUND = "UnsupportedOperation.RoleNotFound" -func (c *Client) DescribeVpcEndPointServiceWithContext(ctx context.Context, request *DescribeVpcEndPointServiceRequest) (response *DescribeVpcEndPointServiceResponse, err error) { - if request == nil { - request = NewDescribeVpcEndPointServiceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcEndPointService require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcEndPointServiceResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcEndPointServiceWhiteListRequest() (request *DescribeVpcEndPointServiceWhiteListRequest) { - request = &DescribeVpcEndPointServiceWhiteListRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcEndPointServiceWhiteList") - - return -} - -func NewDescribeVpcEndPointServiceWhiteListResponse() (response *DescribeVpcEndPointServiceWhiteListResponse) { - response = &DescribeVpcEndPointServiceWhiteListResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcEndPointServiceWhiteList -// 本接口(DescribeVpcEndPointServiceWhiteList)用于查询终端节点服务的服务白名单列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) DescribeVpcEndPointServiceWhiteList(request *DescribeVpcEndPointServiceWhiteListRequest) (response *DescribeVpcEndPointServiceWhiteListResponse, err error) { - return c.DescribeVpcEndPointServiceWhiteListWithContext(context.Background(), request) -} - -// DescribeVpcEndPointServiceWhiteList -// 本接口(DescribeVpcEndPointServiceWhiteList)用于查询终端节点服务的服务白名单列表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) DescribeVpcEndPointServiceWhiteListWithContext(ctx context.Context, request *DescribeVpcEndPointServiceWhiteListRequest) (response *DescribeVpcEndPointServiceWhiteListResponse, err error) { - if request == nil { - request = NewDescribeVpcEndPointServiceWhiteListRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcEndPointServiceWhiteList require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcEndPointServiceWhiteListResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcInstancesRequest() (request *DescribeVpcInstancesRequest) { - request = &DescribeVpcInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcInstances") - - return -} - -func NewDescribeVpcInstancesResponse() (response *DescribeVpcInstancesResponse) { - response = &DescribeVpcInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcInstances -// 本接口(DescribeVpcInstances)用于查询VPC下的云主机实例列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpcInstances(request *DescribeVpcInstancesRequest) (response *DescribeVpcInstancesResponse, err error) { - return c.DescribeVpcInstancesWithContext(context.Background(), request) -} - -// DescribeVpcInstances -// 本接口(DescribeVpcInstances)用于查询VPC下的云主机实例列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpcInstancesWithContext(ctx context.Context, request *DescribeVpcInstancesRequest) (response *DescribeVpcInstancesResponse, err error) { - if request == nil { - request = NewDescribeVpcInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcInstances require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcInstancesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcIpv6AddressesRequest() (request *DescribeVpcIpv6AddressesRequest) { - request = &DescribeVpcIpv6AddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcIpv6Addresses") - - return -} - -func NewDescribeVpcIpv6AddressesResponse() (response *DescribeVpcIpv6AddressesResponse) { - response = &DescribeVpcIpv6AddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcIpv6Addresses -// 本接口(DescribeVpcIpv6Addresses)用于查询 `VPC` `IPv6` 信息。 -// -// 只能查询已使用的`IPv6`信息,当查询未使用的IP时,本接口不会报错,但不会出现在返回结果里。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpcIpv6Addresses(request *DescribeVpcIpv6AddressesRequest) (response *DescribeVpcIpv6AddressesResponse, err error) { - return c.DescribeVpcIpv6AddressesWithContext(context.Background(), request) -} - -// DescribeVpcIpv6Addresses -// 本接口(DescribeVpcIpv6Addresses)用于查询 `VPC` `IPv6` 信息。 -// -// 只能查询已使用的`IPv6`信息,当查询未使用的IP时,本接口不会报错,但不会出现在返回结果里。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpcIpv6AddressesWithContext(ctx context.Context, request *DescribeVpcIpv6AddressesRequest) (response *DescribeVpcIpv6AddressesResponse, err error) { - if request == nil { - request = NewDescribeVpcIpv6AddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcIpv6Addresses require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcIpv6AddressesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcLimitsRequest() (request *DescribeVpcLimitsRequest) { - request = &DescribeVpcLimitsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcLimits") - - return -} - -func NewDescribeVpcLimitsResponse() (response *DescribeVpcLimitsResponse) { - response = &DescribeVpcLimitsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcLimits -// 本接口(DescribeVpcLimits)用于获取私有网络配额,部分私有网络的配额有地域属性。 -// -// LimitTypes取值范围: -// -// * appid-max-vpcs (每个开发商每个地域可创建的VPC数)。 -// -// * vpc-max-subnets(每个VPC可创建的子网数)。 -// -// * vpc-max-route-tables(每个VPC可创建的路由表数)。 -// -// * route-table-max-policies(每个路由表可添加的策略数)。 -// -// * vpc-max-vpn-gateways(每个VPC可创建的VPN网关数)。 -// -// * appid-max-custom-gateways(每个开发商可创建的对端网关数)。 -// -// * appid-max-vpn-connections(每个开发商可创建的VPN通道数)。 -// -// * custom-gateway-max-vpn-connections(每个对端网关可创建的VPN通道数)。 -// -// * vpn-gateway-max-custom-gateways(每个VPNGW可以创建的通道数)。 -// -// * vpc-max-network-acls(每个VPC可创建的网络ACL数)。 -// -// * network-acl-max-inbound-policies(每个网络ACL可添加的入站规则数)。 -// -// * network-acl-max-outbound-policies(每个网络ACL可添加的出站规则数)。 -// -// * vpc-max-vpcpeers(每个VPC可创建的对等连接数)。 -// -// * vpc-max-available-vpcpeers(每个VPC可创建的有效对等连接数)。 -// -// * vpc-max-basic-network-interconnections(每个VPC可创建的基础网络云主机与VPC互通数)。 -// -// * direct-connection-max-snats(每个专线网关可创建的SNAT数)。 -// -// * direct-connection-max-dnats(每个专线网关可创建的DNAT数)。 -// -// * direct-connection-max-snapts(每个专线网关可创建的SNAPT数)。 -// -// * direct-connection-max-dnapts(每个专线网关可创建的DNAPT数)。 -// -// * vpc-max-nat-gateways(每个VPC可创建的NAT网关数)。 -// -// * nat-gateway-max-eips(每个NAT可以购买的外网IP数量)。 -// -// * vpc-max-enis(每个VPC可创建弹性网卡数)。 -// -// * vpc-max-havips(每个VPC可创建HAVIP数)。 -// -// * eni-max-private-ips(每个ENI可以绑定的内网IP数(ENI未绑定子机))。 -// -// * nat-gateway-max-dnapts(每个NAT网关可创建的DNAPT数)。 -// -// * vpc-max-ipv6s(每个VPC可分配的IPv6地址数)。 -// -// * eni-max-ipv6s(每个ENI可分配的IPv6地址数)。 -// -// * vpc-max-assistant_cidrs(每个VPC可分配的辅助CIDR数)。 -// -// * appid-max-end-point-services (每个开发商每个地域可创建的终端节点服务个数)。 -// -// * appid-max-end-point-service-white-lists (每个开发商每个地域可创建的终端节点服务白名单个数)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -func (c *Client) DescribeVpcLimits(request *DescribeVpcLimitsRequest) (response *DescribeVpcLimitsResponse, err error) { - return c.DescribeVpcLimitsWithContext(context.Background(), request) -} - -// DescribeVpcLimits -// 本接口(DescribeVpcLimits)用于获取私有网络配额,部分私有网络的配额有地域属性。 -// -// LimitTypes取值范围: -// -// * appid-max-vpcs (每个开发商每个地域可创建的VPC数)。 -// -// * vpc-max-subnets(每个VPC可创建的子网数)。 -// -// * vpc-max-route-tables(每个VPC可创建的路由表数)。 -// -// * route-table-max-policies(每个路由表可添加的策略数)。 -// -// * vpc-max-vpn-gateways(每个VPC可创建的VPN网关数)。 -// -// * appid-max-custom-gateways(每个开发商可创建的对端网关数)。 -// -// * appid-max-vpn-connections(每个开发商可创建的VPN通道数)。 -// -// * custom-gateway-max-vpn-connections(每个对端网关可创建的VPN通道数)。 -// -// * vpn-gateway-max-custom-gateways(每个VPNGW可以创建的通道数)。 -// -// * vpc-max-network-acls(每个VPC可创建的网络ACL数)。 -// -// * network-acl-max-inbound-policies(每个网络ACL可添加的入站规则数)。 -// -// * network-acl-max-outbound-policies(每个网络ACL可添加的出站规则数)。 -// -// * vpc-max-vpcpeers(每个VPC可创建的对等连接数)。 -// -// * vpc-max-available-vpcpeers(每个VPC可创建的有效对等连接数)。 -// -// * vpc-max-basic-network-interconnections(每个VPC可创建的基础网络云主机与VPC互通数)。 -// -// * direct-connection-max-snats(每个专线网关可创建的SNAT数)。 -// -// * direct-connection-max-dnats(每个专线网关可创建的DNAT数)。 -// -// * direct-connection-max-snapts(每个专线网关可创建的SNAPT数)。 -// -// * direct-connection-max-dnapts(每个专线网关可创建的DNAPT数)。 -// -// * vpc-max-nat-gateways(每个VPC可创建的NAT网关数)。 -// -// * nat-gateway-max-eips(每个NAT可以购买的外网IP数量)。 -// -// * vpc-max-enis(每个VPC可创建弹性网卡数)。 -// -// * vpc-max-havips(每个VPC可创建HAVIP数)。 -// -// * eni-max-private-ips(每个ENI可以绑定的内网IP数(ENI未绑定子机))。 -// -// * nat-gateway-max-dnapts(每个NAT网关可创建的DNAPT数)。 -// -// * vpc-max-ipv6s(每个VPC可分配的IPv6地址数)。 -// -// * eni-max-ipv6s(每个ENI可分配的IPv6地址数)。 -// -// * vpc-max-assistant_cidrs(每个VPC可分配的辅助CIDR数)。 -// -// * appid-max-end-point-services (每个开发商每个地域可创建的终端节点服务个数)。 -// -// * appid-max-end-point-service-white-lists (每个开发商每个地域可创建的终端节点服务白名单个数)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -func (c *Client) DescribeVpcLimitsWithContext(ctx context.Context, request *DescribeVpcLimitsRequest) (response *DescribeVpcLimitsResponse, err error) { - if request == nil { - request = NewDescribeVpcLimitsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcLimits require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcLimitsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcPeeringConnectionsRequest() (request *DescribeVpcPeeringConnectionsRequest) { - request = &DescribeVpcPeeringConnectionsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcPeeringConnections") - - return -} - -func NewDescribeVpcPeeringConnectionsResponse() (response *DescribeVpcPeeringConnectionsResponse) { - response = &DescribeVpcPeeringConnectionsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcPeeringConnections -// 查询私有网络对等连接。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -func (c *Client) DescribeVpcPeeringConnections(request *DescribeVpcPeeringConnectionsRequest) (response *DescribeVpcPeeringConnectionsResponse, err error) { - return c.DescribeVpcPeeringConnectionsWithContext(context.Background(), request) -} - -// DescribeVpcPeeringConnections -// 查询私有网络对等连接。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -func (c *Client) DescribeVpcPeeringConnectionsWithContext(ctx context.Context, request *DescribeVpcPeeringConnectionsRequest) (response *DescribeVpcPeeringConnectionsResponse, err error) { - if request == nil { - request = NewDescribeVpcPeeringConnectionsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcPeeringConnections require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcPeeringConnectionsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcPrivateIpAddressesRequest() (request *DescribeVpcPrivateIpAddressesRequest) { - request = &DescribeVpcPrivateIpAddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcPrivateIpAddresses") - - return -} - -func NewDescribeVpcPrivateIpAddressesResponse() (response *DescribeVpcPrivateIpAddressesResponse) { - response = &DescribeVpcPrivateIpAddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcPrivateIpAddresses -// 本接口(DescribeVpcPrivateIpAddresses)用于查询VPC内网IP信息。
    -// -// 只能查询已使用的IP信息,当查询未使用的IP时,本接口不会报错,但不会出现在返回结果里。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpcPrivateIpAddresses(request *DescribeVpcPrivateIpAddressesRequest) (response *DescribeVpcPrivateIpAddressesResponse, err error) { - return c.DescribeVpcPrivateIpAddressesWithContext(context.Background(), request) -} - -// DescribeVpcPrivateIpAddresses -// 本接口(DescribeVpcPrivateIpAddresses)用于查询VPC内网IP信息。
    -// -// 只能查询已使用的IP信息,当查询未使用的IP时,本接口不会报错,但不会出现在返回结果里。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpcPrivateIpAddressesWithContext(ctx context.Context, request *DescribeVpcPrivateIpAddressesRequest) (response *DescribeVpcPrivateIpAddressesResponse, err error) { - if request == nil { - request = NewDescribeVpcPrivateIpAddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcPrivateIpAddresses require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcPrivateIpAddressesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcResourceDashboardRequest() (request *DescribeVpcResourceDashboardRequest) { - request = &DescribeVpcResourceDashboardRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcResourceDashboard") - - return -} - -func NewDescribeVpcResourceDashboardResponse() (response *DescribeVpcResourceDashboardResponse) { - response = &DescribeVpcResourceDashboardResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcResourceDashboard -// 本接口(DescribeVpcResourceDashboard)用于查看VPC资源信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpcResourceDashboard(request *DescribeVpcResourceDashboardRequest) (response *DescribeVpcResourceDashboardResponse, err error) { - return c.DescribeVpcResourceDashboardWithContext(context.Background(), request) -} - -// DescribeVpcResourceDashboard -// 本接口(DescribeVpcResourceDashboard)用于查看VPC资源信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpcResourceDashboardWithContext(ctx context.Context, request *DescribeVpcResourceDashboardRequest) (response *DescribeVpcResourceDashboardResponse, err error) { - if request == nil { - request = NewDescribeVpcResourceDashboardRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcResourceDashboard require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcResourceDashboardResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcTaskResultRequest() (request *DescribeVpcTaskResultRequest) { - request = &DescribeVpcTaskResultRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcTaskResult") - - return -} - -func NewDescribeVpcTaskResultResponse() (response *DescribeVpcTaskResultResponse) { - response = &DescribeVpcTaskResultResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcTaskResult -// 本接口(DescribeVpcTaskResult)用于查询VPC任务执行结果。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpcTaskResult(request *DescribeVpcTaskResultRequest) (response *DescribeVpcTaskResultResponse, err error) { - return c.DescribeVpcTaskResultWithContext(context.Background(), request) -} - -// DescribeVpcTaskResult -// 本接口(DescribeVpcTaskResult)用于查询VPC任务执行结果。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpcTaskResultWithContext(ctx context.Context, request *DescribeVpcTaskResultRequest) (response *DescribeVpcTaskResultResponse, err error) { - if request == nil { - request = NewDescribeVpcTaskResultRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcTaskResult require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcTaskResultResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpcsRequest() (request *DescribeVpcsRequest) { - request = &DescribeVpcsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcs") - - return -} - -func NewDescribeVpcsResponse() (response *DescribeVpcsResponse) { - response = &DescribeVpcsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpcs -// 本接口(DescribeVpcs)用于查询私有网络列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpcs(request *DescribeVpcsRequest) (response *DescribeVpcsResponse, err error) { - return c.DescribeVpcsWithContext(context.Background(), request) -} - -// DescribeVpcs -// 本接口(DescribeVpcs)用于查询私有网络列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpcsWithContext(ctx context.Context, request *DescribeVpcsRequest) (response *DescribeVpcsResponse, err error) { - if request == nil { - request = NewDescribeVpcsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpcs require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpcsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpnConnectionsRequest() (request *DescribeVpnConnectionsRequest) { - request = &DescribeVpnConnectionsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnConnections") - - return -} - -func NewDescribeVpnConnectionsResponse() (response *DescribeVpnConnectionsResponse) { - response = &DescribeVpnConnectionsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpnConnections -// 本接口(DescribeVpnConnections)用于查询VPN通道列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpnConnections(request *DescribeVpnConnectionsRequest) (response *DescribeVpnConnectionsResponse, err error) { - return c.DescribeVpnConnectionsWithContext(context.Background(), request) -} - -// DescribeVpnConnections -// 本接口(DescribeVpnConnections)用于查询VPN通道列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpnConnectionsWithContext(ctx context.Context, request *DescribeVpnConnectionsRequest) (response *DescribeVpnConnectionsResponse, err error) { - if request == nil { - request = NewDescribeVpnConnectionsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpnConnections require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpnConnectionsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpnGatewayCcnRoutesRequest() (request *DescribeVpnGatewayCcnRoutesRequest) { - request = &DescribeVpnGatewayCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnGatewayCcnRoutes") - - return -} - -func NewDescribeVpnGatewayCcnRoutesResponse() (response *DescribeVpnGatewayCcnRoutesResponse) { - response = &DescribeVpnGatewayCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpnGatewayCcnRoutes -// 本接口(DescribeVpnGatewayCcnRoutes)用于查询VPN网关云联网路由。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpnGatewayCcnRoutes(request *DescribeVpnGatewayCcnRoutesRequest) (response *DescribeVpnGatewayCcnRoutesResponse, err error) { - return c.DescribeVpnGatewayCcnRoutesWithContext(context.Background(), request) -} - -// DescribeVpnGatewayCcnRoutes -// 本接口(DescribeVpnGatewayCcnRoutes)用于查询VPN网关云联网路由。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpnGatewayCcnRoutesWithContext(ctx context.Context, request *DescribeVpnGatewayCcnRoutesRequest) (response *DescribeVpnGatewayCcnRoutesResponse, err error) { - if request == nil { - request = NewDescribeVpnGatewayCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpnGatewayCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpnGatewayCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpnGatewayRoutesRequest() (request *DescribeVpnGatewayRoutesRequest) { - request = &DescribeVpnGatewayRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnGatewayRoutes") - - return -} - -func NewDescribeVpnGatewayRoutesResponse() (response *DescribeVpnGatewayRoutesResponse) { - response = &DescribeVpnGatewayRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpnGatewayRoutes -// 本接口(DescribeVpnGatewayRoutes)用于查询VPN网关路由。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpnGatewayRoutes(request *DescribeVpnGatewayRoutesRequest) (response *DescribeVpnGatewayRoutesResponse, err error) { - return c.DescribeVpnGatewayRoutesWithContext(context.Background(), request) -} - -// DescribeVpnGatewayRoutes -// 本接口(DescribeVpnGatewayRoutes)用于查询VPN网关路由。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpnGatewayRoutesWithContext(ctx context.Context, request *DescribeVpnGatewayRoutesRequest) (response *DescribeVpnGatewayRoutesResponse, err error) { - if request == nil { - request = NewDescribeVpnGatewayRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpnGatewayRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpnGatewayRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpnGatewaySslClientsRequest() (request *DescribeVpnGatewaySslClientsRequest) { - request = &DescribeVpnGatewaySslClientsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnGatewaySslClients") - - return -} - -func NewDescribeVpnGatewaySslClientsResponse() (response *DescribeVpnGatewaySslClientsResponse) { - response = &DescribeVpnGatewaySslClientsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpnGatewaySslClients -// 本接口(DescribeVpnGatewaySslClients)用于查询SSL-VPN-CLIENT 列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpnGatewaySslClients(request *DescribeVpnGatewaySslClientsRequest) (response *DescribeVpnGatewaySslClientsResponse, err error) { - return c.DescribeVpnGatewaySslClientsWithContext(context.Background(), request) -} - -// DescribeVpnGatewaySslClients -// 本接口(DescribeVpnGatewaySslClients)用于查询SSL-VPN-CLIENT 列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpnGatewaySslClientsWithContext(ctx context.Context, request *DescribeVpnGatewaySslClientsRequest) (response *DescribeVpnGatewaySslClientsResponse, err error) { - if request == nil { - request = NewDescribeVpnGatewaySslClientsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpnGatewaySslClients require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpnGatewaySslClientsResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpnGatewaySslServersRequest() (request *DescribeVpnGatewaySslServersRequest) { - request = &DescribeVpnGatewaySslServersRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnGatewaySslServers") - - return -} - -func NewDescribeVpnGatewaySslServersResponse() (response *DescribeVpnGatewaySslServersResponse) { - response = &DescribeVpnGatewaySslServersResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpnGatewaySslServers -// 本接口(DescribeVpnGatewaySslServers)用于查询SSL-VPN SERVER 列表信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpnGatewaySslServers(request *DescribeVpnGatewaySslServersRequest) (response *DescribeVpnGatewaySslServersResponse, err error) { - return c.DescribeVpnGatewaySslServersWithContext(context.Background(), request) -} - -// DescribeVpnGatewaySslServers -// 本接口(DescribeVpnGatewaySslServers)用于查询SSL-VPN SERVER 列表信息。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DescribeVpnGatewaySslServersWithContext(ctx context.Context, request *DescribeVpnGatewaySslServersRequest) (response *DescribeVpnGatewaySslServersResponse, err error) { - if request == nil { - request = NewDescribeVpnGatewaySslServersRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpnGatewaySslServers require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpnGatewaySslServersResponse() - err = c.Send(request, response) - return -} - -func NewDescribeVpnGatewaysRequest() (request *DescribeVpnGatewaysRequest) { - request = &DescribeVpnGatewaysRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnGateways") - - return -} - -func NewDescribeVpnGatewaysResponse() (response *DescribeVpnGatewaysResponse) { - response = &DescribeVpnGatewaysResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DescribeVpnGateways -// 本接口(DescribeVpnGateways)用于查询VPN网关列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDVPNGATEWAYID_MALFORMED = "InvalidVpnGatewayId.Malformed" -// INVALIDVPNGATEWAYID_NOTFOUND = "InvalidVpnGatewayId.NotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpnGateways(request *DescribeVpnGatewaysRequest) (response *DescribeVpnGatewaysResponse, err error) { - return c.DescribeVpnGatewaysWithContext(context.Background(), request) -} - -// DescribeVpnGateways -// 本接口(DescribeVpnGateways)用于查询VPN网关列表。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" -// INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDVPNGATEWAYID_MALFORMED = "InvalidVpnGatewayId.Malformed" -// INVALIDVPNGATEWAYID_NOTFOUND = "InvalidVpnGatewayId.NotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DescribeVpnGatewaysWithContext(ctx context.Context, request *DescribeVpnGatewaysRequest) (response *DescribeVpnGatewaysResponse, err error) { - if request == nil { - request = NewDescribeVpnGatewaysRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DescribeVpnGateways require credential") - } - - request.SetContext(ctx) - - response = NewDescribeVpnGatewaysResponse() - err = c.Send(request, response) - return -} - -func NewDetachCcnInstancesRequest() (request *DetachCcnInstancesRequest) { - request = &DetachCcnInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DetachCcnInstances") - - return -} - -func NewDetachCcnInstancesResponse() (response *DetachCcnInstancesResponse) { - response = &DetachCcnInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DetachCcnInstances -// 本接口(DetachCcnInstances)用于从云联网实例中解关联指定的网络实例。
    -// -// 解关联网络实例后,相应的路由策略会一并删除。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" -// UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DetachCcnInstances(request *DetachCcnInstancesRequest) (response *DetachCcnInstancesResponse, err error) { - return c.DetachCcnInstancesWithContext(context.Background(), request) -} - -// DetachCcnInstances -// 本接口(DetachCcnInstances)用于从云联网实例中解关联指定的网络实例。
    -// -// 解关联网络实例后,相应的路由策略会一并删除。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" -// UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) DetachCcnInstancesWithContext(ctx context.Context, request *DetachCcnInstancesRequest) (response *DetachCcnInstancesResponse, err error) { - if request == nil { - request = NewDetachCcnInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DetachCcnInstances require credential") - } - - request.SetContext(ctx) - - response = NewDetachCcnInstancesResponse() - err = c.Send(request, response) - return -} - -func NewDetachClassicLinkVpcRequest() (request *DetachClassicLinkVpcRequest) { - request = &DetachClassicLinkVpcRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DetachClassicLinkVpc") - - return -} - -func NewDetachClassicLinkVpcResponse() (response *DetachClassicLinkVpcResponse) { - response = &DetachClassicLinkVpcResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DetachClassicLinkVpc -// 本接口(DetachClassicLinkVpc)用于删除私有网络和基础网络设备互通。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DetachClassicLinkVpc(request *DetachClassicLinkVpcRequest) (response *DetachClassicLinkVpcResponse, err error) { - return c.DetachClassicLinkVpcWithContext(context.Background(), request) -} - -// DetachClassicLinkVpc -// 本接口(DetachClassicLinkVpc)用于删除私有网络和基础网络设备互通。 -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DetachClassicLinkVpcWithContext(ctx context.Context, request *DetachClassicLinkVpcRequest) (response *DetachClassicLinkVpcResponse, err error) { - if request == nil { - request = NewDetachClassicLinkVpcRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DetachClassicLinkVpc require credential") - } - - request.SetContext(ctx) - - response = NewDetachClassicLinkVpcResponse() - err = c.Send(request, response) - return -} - -func NewDetachNetworkInterfaceRequest() (request *DetachNetworkInterfaceRequest) { - request = &DetachNetworkInterfaceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DetachNetworkInterface") - - return -} - -func NewDetachNetworkInterfaceResponse() (response *DetachNetworkInterfaceResponse) { - response = &DetachNetworkInterfaceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DetachNetworkInterface -// 本接口(DetachNetworkInterface)用于弹性网卡解绑云服务器。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) DetachNetworkInterface(request *DetachNetworkInterfaceRequest) (response *DetachNetworkInterfaceResponse, err error) { - return c.DetachNetworkInterfaceWithContext(context.Background(), request) -} - -// DetachNetworkInterface -// 本接口(DetachNetworkInterface)用于弹性网卡解绑云服务器。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) DetachNetworkInterfaceWithContext(ctx context.Context, request *DetachNetworkInterfaceRequest) (response *DetachNetworkInterfaceResponse, err error) { - if request == nil { - request = NewDetachNetworkInterfaceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DetachNetworkInterface require credential") - } - - request.SetContext(ctx) - - response = NewDetachNetworkInterfaceResponse() - err = c.Send(request, response) - return -} - -func NewDetachSnapshotInstancesRequest() (request *DetachSnapshotInstancesRequest) { - request = &DetachSnapshotInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DetachSnapshotInstances") - - return -} - -func NewDetachSnapshotInstancesResponse() (response *DetachSnapshotInstancesResponse) { - response = &DetachSnapshotInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DetachSnapshotInstances -// 本接口(DetachSnapshotInstances)用于快照策略解关联实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTINSTANCEREGIONDIFF = "UnsupportedOperation.SnapshotInstanceRegionDiff" -// UNSUPPORTEDOPERATION_SNAPSHOTNOTATTACHED = "UnsupportedOperation.SnapshotNotAttached" -func (c *Client) DetachSnapshotInstances(request *DetachSnapshotInstancesRequest) (response *DetachSnapshotInstancesResponse, err error) { - return c.DetachSnapshotInstancesWithContext(context.Background(), request) -} - -// DetachSnapshotInstances -// 本接口(DetachSnapshotInstances)用于快照策略解关联实例。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTINSTANCEREGIONDIFF = "UnsupportedOperation.SnapshotInstanceRegionDiff" -// UNSUPPORTEDOPERATION_SNAPSHOTNOTATTACHED = "UnsupportedOperation.SnapshotNotAttached" -func (c *Client) DetachSnapshotInstancesWithContext(ctx context.Context, request *DetachSnapshotInstancesRequest) (response *DetachSnapshotInstancesResponse, err error) { - if request == nil { - request = NewDetachSnapshotInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DetachSnapshotInstances require credential") - } - - request.SetContext(ctx) - - response = NewDetachSnapshotInstancesResponse() - err = c.Send(request, response) - return -} - -func NewDisableCcnRoutesRequest() (request *DisableCcnRoutesRequest) { - request = &DisableCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisableCcnRoutes") - - return -} - -func NewDisableCcnRoutesResponse() (response *DisableCcnRoutesResponse) { - response = &DisableCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisableCcnRoutes -// 本接口(DisableCcnRoutes)用于禁用已经启用的云联网(CCN)路由。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DisableCcnRoutes(request *DisableCcnRoutesRequest) (response *DisableCcnRoutesResponse, err error) { - return c.DisableCcnRoutesWithContext(context.Background(), request) -} - -// DisableCcnRoutes -// 本接口(DisableCcnRoutes)用于禁用已经启用的云联网(CCN)路由。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DisableCcnRoutesWithContext(ctx context.Context, request *DisableCcnRoutesRequest) (response *DisableCcnRoutesResponse, err error) { - if request == nil { - request = NewDisableCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisableCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDisableCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDisableFlowLogsRequest() (request *DisableFlowLogsRequest) { - request = &DisableFlowLogsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisableFlowLogs") - - return -} - -func NewDisableFlowLogsResponse() (response *DisableFlowLogsResponse) { - response = &DisableFlowLogsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisableFlowLogs -// 本接口(DisableFlowLogs)用于停止流日志。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DisableFlowLogs(request *DisableFlowLogsRequest) (response *DisableFlowLogsResponse, err error) { - return c.DisableFlowLogsWithContext(context.Background(), request) -} - -// DisableFlowLogs -// 本接口(DisableFlowLogs)用于停止流日志。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DisableFlowLogsWithContext(ctx context.Context, request *DisableFlowLogsRequest) (response *DisableFlowLogsResponse, err error) { - if request == nil { - request = NewDisableFlowLogsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisableFlowLogs require credential") - } - - request.SetContext(ctx) - - response = NewDisableFlowLogsResponse() - err = c.Send(request, response) - return -} - -func NewDisableGatewayFlowMonitorRequest() (request *DisableGatewayFlowMonitorRequest) { - request = &DisableGatewayFlowMonitorRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisableGatewayFlowMonitor") - - return -} - -func NewDisableGatewayFlowMonitorResponse() (response *DisableGatewayFlowMonitorResponse) { - response = &DisableGatewayFlowMonitorResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisableGatewayFlowMonitor -// 本接口(DisableGatewayFlowMonitor)用于关闭网关流量监控。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) DisableGatewayFlowMonitor(request *DisableGatewayFlowMonitorRequest) (response *DisableGatewayFlowMonitorResponse, err error) { - return c.DisableGatewayFlowMonitorWithContext(context.Background(), request) -} - -// DisableGatewayFlowMonitor -// 本接口(DisableGatewayFlowMonitor)用于关闭网关流量监控。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) DisableGatewayFlowMonitorWithContext(ctx context.Context, request *DisableGatewayFlowMonitorRequest) (response *DisableGatewayFlowMonitorResponse, err error) { - if request == nil { - request = NewDisableGatewayFlowMonitorRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisableGatewayFlowMonitor require credential") - } - - request.SetContext(ctx) - - response = NewDisableGatewayFlowMonitorResponse() - err = c.Send(request, response) - return -} - -func NewDisableRoutesRequest() (request *DisableRoutesRequest) { - request = &DisableRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisableRoutes") - - return -} - -func NewDisableRoutesResponse() (response *DisableRoutesResponse) { - response = &DisableRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisableRoutes -// 本接口(DisableRoutes)用于禁用已启用的子网路由 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_DISABLEDNOTIFYCCN = "UnsupportedOperation.DisabledNotifyCcn" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) DisableRoutes(request *DisableRoutesRequest) (response *DisableRoutesResponse, err error) { - return c.DisableRoutesWithContext(context.Background(), request) -} - -// DisableRoutes -// 本接口(DisableRoutes)用于禁用已启用的子网路由 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_DISABLEDNOTIFYCCN = "UnsupportedOperation.DisabledNotifyCcn" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) DisableRoutesWithContext(ctx context.Context, request *DisableRoutesRequest) (response *DisableRoutesResponse, err error) { - if request == nil { - request = NewDisableRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisableRoutes require credential") - } - - request.SetContext(ctx) - - response = NewDisableRoutesResponse() - err = c.Send(request, response) - return -} - -func NewDisableSnapshotPoliciesRequest() (request *DisableSnapshotPoliciesRequest) { - request = &DisableSnapshotPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisableSnapshotPolicies") - - return -} - -func NewDisableSnapshotPoliciesResponse() (response *DisableSnapshotPoliciesResponse) { - response = &DisableSnapshotPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisableSnapshotPolicies -// 本接口(DisableSnapshotPolicies)用于停用快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DisableSnapshotPolicies(request *DisableSnapshotPoliciesRequest) (response *DisableSnapshotPoliciesResponse, err error) { - return c.DisableSnapshotPoliciesWithContext(context.Background(), request) -} - -// DisableSnapshotPolicies -// 本接口(DisableSnapshotPolicies)用于停用快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DisableSnapshotPoliciesWithContext(ctx context.Context, request *DisableSnapshotPoliciesRequest) (response *DisableSnapshotPoliciesResponse, err error) { - if request == nil { - request = NewDisableSnapshotPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisableSnapshotPolicies require credential") - } - - request.SetContext(ctx) - - response = NewDisableSnapshotPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewDisableVpnGatewaySslClientCertRequest() (request *DisableVpnGatewaySslClientCertRequest) { - request = &DisableVpnGatewaySslClientCertRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisableVpnGatewaySslClientCert") - - return -} - -func NewDisableVpnGatewaySslClientCertResponse() (response *DisableVpnGatewaySslClientCertResponse) { - response = &DisableVpnGatewaySslClientCertResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisableVpnGatewaySslClientCert -// 禁用SSL-VPN-CLIENT 证书 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_SSLVPNCLIENTIDNOTFOUND = "UnsupportedOperation.SslVpnClientIdNotFound" -func (c *Client) DisableVpnGatewaySslClientCert(request *DisableVpnGatewaySslClientCertRequest) (response *DisableVpnGatewaySslClientCertResponse, err error) { - return c.DisableVpnGatewaySslClientCertWithContext(context.Background(), request) -} - -// DisableVpnGatewaySslClientCert -// 禁用SSL-VPN-CLIENT 证书 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_SSLVPNCLIENTIDNOTFOUND = "UnsupportedOperation.SslVpnClientIdNotFound" -func (c *Client) DisableVpnGatewaySslClientCertWithContext(ctx context.Context, request *DisableVpnGatewaySslClientCertRequest) (response *DisableVpnGatewaySslClientCertResponse, err error) { - if request == nil { - request = NewDisableVpnGatewaySslClientCertRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisableVpnGatewaySslClientCert require credential") - } - - request.SetContext(ctx) - - response = NewDisableVpnGatewaySslClientCertResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateAddressRequest() (request *DisassociateAddressRequest) { - request = &DisassociateAddressRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisassociateAddress") - - return -} - -func NewDisassociateAddressResponse() (response *DisassociateAddressResponse) { - response = &DisassociateAddressResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateAddress -// 本接口 (DisassociateAddress) 用于解绑[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 -// -// * 支持CVM实例,弹性网卡上的EIP解绑 -// -// * 不支持NAT上的EIP解绑。NAT上的EIP解绑请参考[DisassociateNatGatewayAddress](https://cloud.tencent.com/document/api/215/36716) -// -// * 只有状态为 BIND 和 BIND_ENI 的 EIP 才能进行解绑定操作。 -// -// * EIP 如果被封堵,则不能进行解绑定操作。 -// -// 可能返回的错误码: -// -// ADDRESSQUOTALIMITEXCEEDED_DAILYALLOCATE = "AddressQuotaLimitExceeded.DailyAllocate" -// FAILEDOPERATION_ADDRESSENIINFONOTFOUND = "FailedOperation.AddressEniInfoNotFound" -// FAILEDOPERATION_MASTERENINOTFOUND = "FailedOperation.MasterEniNotFound" -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDADDRESSIDSTATUS_NOTPERMIT = "InvalidAddressIdStatus.NotPermit" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_ONLYSUPPORTEDFORMASTERNETWORKCARD = "InvalidParameterValue.OnlySupportedForMasterNetworkCard" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -func (c *Client) DisassociateAddress(request *DisassociateAddressRequest) (response *DisassociateAddressResponse, err error) { - return c.DisassociateAddressWithContext(context.Background(), request) -} - -// DisassociateAddress -// 本接口 (DisassociateAddress) 用于解绑[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 -// -// * 支持CVM实例,弹性网卡上的EIP解绑 -// -// * 不支持NAT上的EIP解绑。NAT上的EIP解绑请参考[DisassociateNatGatewayAddress](https://cloud.tencent.com/document/api/215/36716) -// -// * 只有状态为 BIND 和 BIND_ENI 的 EIP 才能进行解绑定操作。 -// -// * EIP 如果被封堵,则不能进行解绑定操作。 -// -// 可能返回的错误码: -// -// ADDRESSQUOTALIMITEXCEEDED_DAILYALLOCATE = "AddressQuotaLimitExceeded.DailyAllocate" -// FAILEDOPERATION_ADDRESSENIINFONOTFOUND = "FailedOperation.AddressEniInfoNotFound" -// FAILEDOPERATION_MASTERENINOTFOUND = "FailedOperation.MasterEniNotFound" -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDADDRESSIDSTATUS_NOTPERMIT = "InvalidAddressIdStatus.NotPermit" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_ONLYSUPPORTEDFORMASTERNETWORKCARD = "InvalidParameterValue.OnlySupportedForMasterNetworkCard" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -func (c *Client) DisassociateAddressWithContext(ctx context.Context, request *DisassociateAddressRequest) (response *DisassociateAddressResponse, err error) { - if request == nil { - request = NewDisassociateAddressRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateAddress require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateAddressResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateDhcpIpWithAddressIpRequest() (request *DisassociateDhcpIpWithAddressIpRequest) { - request = &DisassociateDhcpIpWithAddressIpRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisassociateDhcpIpWithAddressIp") - - return -} - -func NewDisassociateDhcpIpWithAddressIpResponse() (response *DisassociateDhcpIpWithAddressIpResponse) { - response = &DisassociateDhcpIpWithAddressIpResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateDhcpIpWithAddressIp -// 本接口(DisassociateDhcpIpWithAddressIp)用于将DhcpIp已绑定的弹性公网IP(EIP)解除绑定。
    -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) DisassociateDhcpIpWithAddressIp(request *DisassociateDhcpIpWithAddressIpRequest) (response *DisassociateDhcpIpWithAddressIpResponse, err error) { - return c.DisassociateDhcpIpWithAddressIpWithContext(context.Background(), request) -} - -// DisassociateDhcpIpWithAddressIp -// 本接口(DisassociateDhcpIpWithAddressIp)用于将DhcpIp已绑定的弹性公网IP(EIP)解除绑定。
    -// -// >?本接口为异步接口,可调用 [DescribeVpcTaskResult](https://cloud.tencent.com/document/api/215/59037) 接口查询任务执行结果,待任务执行成功后再进行其他操作。 -// -// > -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) DisassociateDhcpIpWithAddressIpWithContext(ctx context.Context, request *DisassociateDhcpIpWithAddressIpRequest) (response *DisassociateDhcpIpWithAddressIpResponse, err error) { - if request == nil { - request = NewDisassociateDhcpIpWithAddressIpRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateDhcpIpWithAddressIp require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateDhcpIpWithAddressIpResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateDirectConnectGatewayNatGatewayRequest() (request *DisassociateDirectConnectGatewayNatGatewayRequest) { - request = &DisassociateDirectConnectGatewayNatGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisassociateDirectConnectGatewayNatGateway") - - return -} - -func NewDisassociateDirectConnectGatewayNatGatewayResponse() (response *DisassociateDirectConnectGatewayNatGatewayResponse) { - response = &DisassociateDirectConnectGatewayNatGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateDirectConnectGatewayNatGateway -// 将专线网关与NAT网关解绑,解绑之后,专线网关将不能通过NAT网关访问公网 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DisassociateDirectConnectGatewayNatGateway(request *DisassociateDirectConnectGatewayNatGatewayRequest) (response *DisassociateDirectConnectGatewayNatGatewayResponse, err error) { - return c.DisassociateDirectConnectGatewayNatGatewayWithContext(context.Background(), request) -} - -// DisassociateDirectConnectGatewayNatGateway -// 将专线网关与NAT网关解绑,解绑之后,专线网关将不能通过NAT网关访问公网 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DisassociateDirectConnectGatewayNatGatewayWithContext(ctx context.Context, request *DisassociateDirectConnectGatewayNatGatewayRequest) (response *DisassociateDirectConnectGatewayNatGatewayResponse, err error) { - if request == nil { - request = NewDisassociateDirectConnectGatewayNatGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateDirectConnectGatewayNatGateway require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateDirectConnectGatewayNatGatewayResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateNatGatewayAddressRequest() (request *DisassociateNatGatewayAddressRequest) { - request = &DisassociateNatGatewayAddressRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisassociateNatGatewayAddress") - - return -} - -func NewDisassociateNatGatewayAddressResponse() (response *DisassociateNatGatewayAddressResponse) { - response = &DisassociateNatGatewayAddressResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateNatGatewayAddress -// 本接口(DisassociateNatGatewayAddress)用于NAT网关解绑弹性IP。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSDISASSOCIATE = "UnsupportedOperation.PublicIpAddressDisassociate" -func (c *Client) DisassociateNatGatewayAddress(request *DisassociateNatGatewayAddressRequest) (response *DisassociateNatGatewayAddressResponse, err error) { - return c.DisassociateNatGatewayAddressWithContext(context.Background(), request) -} - -// DisassociateNatGatewayAddress -// 本接口(DisassociateNatGatewayAddress)用于NAT网关解绑弹性IP。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_PUBLICIPADDRESSDISASSOCIATE = "UnsupportedOperation.PublicIpAddressDisassociate" -func (c *Client) DisassociateNatGatewayAddressWithContext(ctx context.Context, request *DisassociateNatGatewayAddressRequest) (response *DisassociateNatGatewayAddressResponse, err error) { - if request == nil { - request = NewDisassociateNatGatewayAddressRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateNatGatewayAddress require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateNatGatewayAddressResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateNetworkAclSubnetsRequest() (request *DisassociateNetworkAclSubnetsRequest) { - request = &DisassociateNetworkAclSubnetsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisassociateNetworkAclSubnets") - - return -} - -func NewDisassociateNetworkAclSubnetsResponse() (response *DisassociateNetworkAclSubnetsResponse) { - response = &DisassociateNetworkAclSubnetsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateNetworkAclSubnets -// 本接口(DisassociateNetworkAclSubnets)用于网络ACL解关联VPC下的子网。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) DisassociateNetworkAclSubnets(request *DisassociateNetworkAclSubnetsRequest) (response *DisassociateNetworkAclSubnetsResponse, err error) { - return c.DisassociateNetworkAclSubnetsWithContext(context.Background(), request) -} - -// DisassociateNetworkAclSubnets -// 本接口(DisassociateNetworkAclSubnets)用于网络ACL解关联VPC下的子网。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) DisassociateNetworkAclSubnetsWithContext(ctx context.Context, request *DisassociateNetworkAclSubnetsRequest) (response *DisassociateNetworkAclSubnetsResponse, err error) { - if request == nil { - request = NewDisassociateNetworkAclSubnetsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateNetworkAclSubnets require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateNetworkAclSubnetsResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateNetworkInterfaceSecurityGroupsRequest() (request *DisassociateNetworkInterfaceSecurityGroupsRequest) { - request = &DisassociateNetworkInterfaceSecurityGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisassociateNetworkInterfaceSecurityGroups") - - return -} - -func NewDisassociateNetworkInterfaceSecurityGroupsResponse() (response *DisassociateNetworkInterfaceSecurityGroupsResponse) { - response = &DisassociateNetworkInterfaceSecurityGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateNetworkInterfaceSecurityGroups -// 本接口(DisassociateNetworkInterfaceSecurityGroups)用于弹性网卡解绑安全组。支持弹性网卡完全解绑安全组。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DisassociateNetworkInterfaceSecurityGroups(request *DisassociateNetworkInterfaceSecurityGroupsRequest) (response *DisassociateNetworkInterfaceSecurityGroupsResponse, err error) { - return c.DisassociateNetworkInterfaceSecurityGroupsWithContext(context.Background(), request) -} - -// DisassociateNetworkInterfaceSecurityGroups -// 本接口(DisassociateNetworkInterfaceSecurityGroups)用于弹性网卡解绑安全组。支持弹性网卡完全解绑安全组。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) DisassociateNetworkInterfaceSecurityGroupsWithContext(ctx context.Context, request *DisassociateNetworkInterfaceSecurityGroupsRequest) (response *DisassociateNetworkInterfaceSecurityGroupsResponse, err error) { - if request == nil { - request = NewDisassociateNetworkInterfaceSecurityGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateNetworkInterfaceSecurityGroups require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateNetworkInterfaceSecurityGroupsResponse() - err = c.Send(request, response) - return -} - -func NewDisassociateVpcEndPointSecurityGroupsRequest() (request *DisassociateVpcEndPointSecurityGroupsRequest) { - request = &DisassociateVpcEndPointSecurityGroupsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DisassociateVpcEndPointSecurityGroups") - - return -} - -func NewDisassociateVpcEndPointSecurityGroupsResponse() (response *DisassociateVpcEndPointSecurityGroupsResponse) { - response = &DisassociateVpcEndPointSecurityGroupsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DisassociateVpcEndPointSecurityGroups -// 本接口(DisassociateVpcEndPointSecurityGroups)用于终端节点解绑安全组。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DisassociateVpcEndPointSecurityGroups(request *DisassociateVpcEndPointSecurityGroupsRequest) (response *DisassociateVpcEndPointSecurityGroupsResponse, err error) { - return c.DisassociateVpcEndPointSecurityGroupsWithContext(context.Background(), request) -} - -// DisassociateVpcEndPointSecurityGroups -// 本接口(DisassociateVpcEndPointSecurityGroups)用于终端节点解绑安全组。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DisassociateVpcEndPointSecurityGroupsWithContext(ctx context.Context, request *DisassociateVpcEndPointSecurityGroupsRequest) (response *DisassociateVpcEndPointSecurityGroupsResponse, err error) { - if request == nil { - request = NewDisassociateVpcEndPointSecurityGroupsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DisassociateVpcEndPointSecurityGroups require credential") - } - - request.SetContext(ctx) - - response = NewDisassociateVpcEndPointSecurityGroupsResponse() - err = c.Send(request, response) - return -} - -func NewDownloadCustomerGatewayConfigurationRequest() (request *DownloadCustomerGatewayConfigurationRequest) { - request = &DownloadCustomerGatewayConfigurationRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DownloadCustomerGatewayConfiguration") - - return -} - -func NewDownloadCustomerGatewayConfigurationResponse() (response *DownloadCustomerGatewayConfigurationResponse) { - response = &DownloadCustomerGatewayConfigurationResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DownloadCustomerGatewayConfiguration -// 本接口(DownloadCustomerGatewayConfiguration)用于下载VPN通道配置。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DownloadCustomerGatewayConfiguration(request *DownloadCustomerGatewayConfigurationRequest) (response *DownloadCustomerGatewayConfigurationResponse, err error) { - return c.DownloadCustomerGatewayConfigurationWithContext(context.Background(), request) -} - -// DownloadCustomerGatewayConfiguration -// 本接口(DownloadCustomerGatewayConfiguration)用于下载VPN通道配置。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) DownloadCustomerGatewayConfigurationWithContext(ctx context.Context, request *DownloadCustomerGatewayConfigurationRequest) (response *DownloadCustomerGatewayConfigurationResponse, err error) { - if request == nil { - request = NewDownloadCustomerGatewayConfigurationRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DownloadCustomerGatewayConfiguration require credential") - } - - request.SetContext(ctx) - - response = NewDownloadCustomerGatewayConfigurationResponse() - err = c.Send(request, response) - return -} - -func NewDownloadVpnGatewaySslClientCertRequest() (request *DownloadVpnGatewaySslClientCertRequest) { - request = &DownloadVpnGatewaySslClientCertRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "DownloadVpnGatewaySslClientCert") - - return -} - -func NewDownloadVpnGatewaySslClientCertResponse() (response *DownloadVpnGatewaySslClientCertResponse) { - response = &DownloadVpnGatewaySslClientCertResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// DownloadVpnGatewaySslClientCert -// 本接口(DownloadVpnGatewaySslClientCert)用于下载SSL-VPN-CLIENT 客户端证书。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_SSLCLIENTCERTDISABLEUNSUPPORTEDDOWNLOADSSLCLIENTCERT = "UnsupportedOperation.SSLClientCertDisableUnsupportedDownloadSSLClientCert" -// UNSUPPORTEDOPERATION_SSLVPNCLIENTIDNOTFOUND = "UnsupportedOperation.SslVpnClientIdNotFound" -func (c *Client) DownloadVpnGatewaySslClientCert(request *DownloadVpnGatewaySslClientCertRequest) (response *DownloadVpnGatewaySslClientCertResponse, err error) { - return c.DownloadVpnGatewaySslClientCertWithContext(context.Background(), request) -} - -// DownloadVpnGatewaySslClientCert -// 本接口(DownloadVpnGatewaySslClientCert)用于下载SSL-VPN-CLIENT 客户端证书。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_SSLCLIENTCERTDISABLEUNSUPPORTEDDOWNLOADSSLCLIENTCERT = "UnsupportedOperation.SSLClientCertDisableUnsupportedDownloadSSLClientCert" -// UNSUPPORTEDOPERATION_SSLVPNCLIENTIDNOTFOUND = "UnsupportedOperation.SslVpnClientIdNotFound" -func (c *Client) DownloadVpnGatewaySslClientCertWithContext(ctx context.Context, request *DownloadVpnGatewaySslClientCertRequest) (response *DownloadVpnGatewaySslClientCertResponse, err error) { - if request == nil { - request = NewDownloadVpnGatewaySslClientCertRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("DownloadVpnGatewaySslClientCert require credential") - } - - request.SetContext(ctx) - - response = NewDownloadVpnGatewaySslClientCertResponse() - err = c.Send(request, response) - return -} - -func NewEnableCcnRoutesRequest() (request *EnableCcnRoutesRequest) { - request = &EnableCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "EnableCcnRoutes") - - return -} - -func NewEnableCcnRoutesResponse() (response *EnableCcnRoutesResponse) { - response = &EnableCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// EnableCcnRoutes -// 本接口(EnableCcnRoutes)用于启用已经加入云联网(CCN)的路由。
    -// -// 本接口会校验启用后,是否与已有路由冲突,如果冲突,则无法启用,失败处理。路由冲突时,需要先禁用与之冲突的路由,才能启用该路由。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -func (c *Client) EnableCcnRoutes(request *EnableCcnRoutesRequest) (response *EnableCcnRoutesResponse, err error) { - return c.EnableCcnRoutesWithContext(context.Background(), request) -} - -// EnableCcnRoutes -// 本接口(EnableCcnRoutes)用于启用已经加入云联网(CCN)的路由。
    -// -// 本接口会校验启用后,是否与已有路由冲突,如果冲突,则无法启用,失败处理。路由冲突时,需要先禁用与之冲突的路由,才能启用该路由。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -func (c *Client) EnableCcnRoutesWithContext(ctx context.Context, request *EnableCcnRoutesRequest) (response *EnableCcnRoutesResponse, err error) { - if request == nil { - request = NewEnableCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("EnableCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewEnableCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewEnableFlowLogsRequest() (request *EnableFlowLogsRequest) { - request = &EnableFlowLogsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "EnableFlowLogs") - - return -} - -func NewEnableFlowLogsResponse() (response *EnableFlowLogsResponse) { - response = &EnableFlowLogsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// EnableFlowLogs -// 本接口(EnableFlowLogs)用于启动流日志。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) EnableFlowLogs(request *EnableFlowLogsRequest) (response *EnableFlowLogsResponse, err error) { - return c.EnableFlowLogsWithContext(context.Background(), request) -} - -// EnableFlowLogs -// 本接口(EnableFlowLogs)用于启动流日志。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) EnableFlowLogsWithContext(ctx context.Context, request *EnableFlowLogsRequest) (response *EnableFlowLogsResponse, err error) { - if request == nil { - request = NewEnableFlowLogsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("EnableFlowLogs require credential") - } - - request.SetContext(ctx) - - response = NewEnableFlowLogsResponse() - err = c.Send(request, response) - return -} - -func NewEnableGatewayFlowMonitorRequest() (request *EnableGatewayFlowMonitorRequest) { - request = &EnableGatewayFlowMonitorRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "EnableGatewayFlowMonitor") - - return -} - -func NewEnableGatewayFlowMonitorResponse() (response *EnableGatewayFlowMonitorResponse) { - response = &EnableGatewayFlowMonitorResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// EnableGatewayFlowMonitor -// 本接口(EnableGatewayFlowMonitor)用于开启网关流量监控。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) EnableGatewayFlowMonitor(request *EnableGatewayFlowMonitorRequest) (response *EnableGatewayFlowMonitorResponse, err error) { - return c.EnableGatewayFlowMonitorWithContext(context.Background(), request) -} - -// EnableGatewayFlowMonitor -// 本接口(EnableGatewayFlowMonitor)用于开启网关流量监控。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) EnableGatewayFlowMonitorWithContext(ctx context.Context, request *EnableGatewayFlowMonitorRequest) (response *EnableGatewayFlowMonitorResponse, err error) { - if request == nil { - request = NewEnableGatewayFlowMonitorRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("EnableGatewayFlowMonitor require credential") - } - - request.SetContext(ctx) - - response = NewEnableGatewayFlowMonitorResponse() - err = c.Send(request, response) - return -} - -func NewEnableRoutesRequest() (request *EnableRoutesRequest) { - request = &EnableRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "EnableRoutes") - - return -} - -func NewEnableRoutesResponse() (response *EnableRoutesResponse) { - response = &EnableRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// EnableRoutes -// 本接口(EnableRoutes)用于启用已禁用的子网路由。
    -// -// 本接口会校验启用后,是否与已有路由冲突,如果冲突,则无法启用,失败处理。路由冲突时,需要先禁用与之冲突的路由,才能启用该路由。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -// UNSUPPORTEDOPERATION_ECMPWITHCCNROUTE = "UnsupportedOperation.EcmpWithCcnRoute" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) EnableRoutes(request *EnableRoutesRequest) (response *EnableRoutesResponse, err error) { - return c.EnableRoutesWithContext(context.Background(), request) -} - -// EnableRoutes -// 本接口(EnableRoutes)用于启用已禁用的子网路由。
    -// -// 本接口会校验启用后,是否与已有路由冲突,如果冲突,则无法启用,失败处理。路由冲突时,需要先禁用与之冲突的路由,才能启用该路由。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -// UNSUPPORTEDOPERATION_ECMPWITHCCNROUTE = "UnsupportedOperation.EcmpWithCcnRoute" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) EnableRoutesWithContext(ctx context.Context, request *EnableRoutesRequest) (response *EnableRoutesResponse, err error) { - if request == nil { - request = NewEnableRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("EnableRoutes require credential") - } - - request.SetContext(ctx) - - response = NewEnableRoutesResponse() - err = c.Send(request, response) - return -} - -func NewEnableSnapshotPoliciesRequest() (request *EnableSnapshotPoliciesRequest) { - request = &EnableSnapshotPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "EnableSnapshotPolicies") - - return -} - -func NewEnableSnapshotPoliciesResponse() (response *EnableSnapshotPoliciesResponse) { - response = &EnableSnapshotPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// EnableSnapshotPolicies -// 本接口(EnableSnapshotPolicies)用于启用快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) EnableSnapshotPolicies(request *EnableSnapshotPoliciesRequest) (response *EnableSnapshotPoliciesResponse, err error) { - return c.EnableSnapshotPoliciesWithContext(context.Background(), request) -} - -// EnableSnapshotPolicies -// 本接口(EnableSnapshotPolicies)用于启用快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) EnableSnapshotPoliciesWithContext(ctx context.Context, request *EnableSnapshotPoliciesRequest) (response *EnableSnapshotPoliciesResponse, err error) { - if request == nil { - request = NewEnableSnapshotPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("EnableSnapshotPolicies require credential") - } - - request.SetContext(ctx) - - response = NewEnableSnapshotPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewEnableVpcEndPointConnectRequest() (request *EnableVpcEndPointConnectRequest) { - request = &EnableVpcEndPointConnectRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "EnableVpcEndPointConnect") - - return -} - -func NewEnableVpcEndPointConnectResponse() (response *EnableVpcEndPointConnectResponse) { - response = &EnableVpcEndPointConnectResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// EnableVpcEndPointConnect -// 本接口(EnableVpcEndPointConnect)用于是否接受终端节点连接请求。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) EnableVpcEndPointConnect(request *EnableVpcEndPointConnectRequest) (response *EnableVpcEndPointConnectResponse, err error) { - return c.EnableVpcEndPointConnectWithContext(context.Background(), request) -} - -// EnableVpcEndPointConnect -// 本接口(EnableVpcEndPointConnect)用于是否接受终端节点连接请求。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) EnableVpcEndPointConnectWithContext(ctx context.Context, request *EnableVpcEndPointConnectRequest) (response *EnableVpcEndPointConnectResponse, err error) { - if request == nil { - request = NewEnableVpcEndPointConnectRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("EnableVpcEndPointConnect require credential") - } - - request.SetContext(ctx) - - response = NewEnableVpcEndPointConnectResponse() - err = c.Send(request, response) - return -} - -func NewEnableVpnGatewaySslClientCertRequest() (request *EnableVpnGatewaySslClientCertRequest) { - request = &EnableVpnGatewaySslClientCertRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "EnableVpnGatewaySslClientCert") - - return -} - -func NewEnableVpnGatewaySslClientCertResponse() (response *EnableVpnGatewaySslClientCertResponse) { - response = &EnableVpnGatewaySslClientCertResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// EnableVpnGatewaySslClientCert -// 本接口(EnableVpnGatewaySslClientCert)用于启用SSL-VPN-CLIENT 证书。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) EnableVpnGatewaySslClientCert(request *EnableVpnGatewaySslClientCertRequest) (response *EnableVpnGatewaySslClientCertResponse, err error) { - return c.EnableVpnGatewaySslClientCertWithContext(context.Background(), request) -} - -// EnableVpnGatewaySslClientCert -// 本接口(EnableVpnGatewaySslClientCert)用于启用SSL-VPN-CLIENT 证书。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) EnableVpnGatewaySslClientCertWithContext(ctx context.Context, request *EnableVpnGatewaySslClientCertRequest) (response *EnableVpnGatewaySslClientCertResponse, err error) { - if request == nil { - request = NewEnableVpnGatewaySslClientCertRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("EnableVpnGatewaySslClientCert require credential") - } - - request.SetContext(ctx) - - response = NewEnableVpnGatewaySslClientCertResponse() - err = c.Send(request, response) - return -} - -func NewGenerateVpnConnectionDefaultHealthCheckIpRequest() (request *GenerateVpnConnectionDefaultHealthCheckIpRequest) { - request = &GenerateVpnConnectionDefaultHealthCheckIpRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "GenerateVpnConnectionDefaultHealthCheckIp") - - return -} - -func NewGenerateVpnConnectionDefaultHealthCheckIpResponse() (response *GenerateVpnConnectionDefaultHealthCheckIpResponse) { - response = &GenerateVpnConnectionDefaultHealthCheckIpResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// GenerateVpnConnectionDefaultHealthCheckIp -// 本接口(GenerateVpnConnectionDefaultHealthCheckIp)用于获取一对VPN通道健康检查地址。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) GenerateVpnConnectionDefaultHealthCheckIp(request *GenerateVpnConnectionDefaultHealthCheckIpRequest) (response *GenerateVpnConnectionDefaultHealthCheckIpResponse, err error) { - return c.GenerateVpnConnectionDefaultHealthCheckIpWithContext(context.Background(), request) -} - -// GenerateVpnConnectionDefaultHealthCheckIp -// 本接口(GenerateVpnConnectionDefaultHealthCheckIp)用于获取一对VPN通道健康检查地址。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) GenerateVpnConnectionDefaultHealthCheckIpWithContext(ctx context.Context, request *GenerateVpnConnectionDefaultHealthCheckIpRequest) (response *GenerateVpnConnectionDefaultHealthCheckIpResponse, err error) { - if request == nil { - request = NewGenerateVpnConnectionDefaultHealthCheckIpRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("GenerateVpnConnectionDefaultHealthCheckIp require credential") - } - - request.SetContext(ctx) - - response = NewGenerateVpnConnectionDefaultHealthCheckIpResponse() - err = c.Send(request, response) - return -} - -func NewGetCcnRegionBandwidthLimitsRequest() (request *GetCcnRegionBandwidthLimitsRequest) { - request = &GetCcnRegionBandwidthLimitsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "GetCcnRegionBandwidthLimits") - - return -} - -func NewGetCcnRegionBandwidthLimitsResponse() (response *GetCcnRegionBandwidthLimitsResponse) { - response = &GetCcnRegionBandwidthLimitsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// GetCcnRegionBandwidthLimits -// 本接口(GetCcnRegionBandwidthLimits)用于查询云联网相关地域带宽信息,其中预付费模式的云联网仅支持地域间限速,后付费模式的云联网支持地域间限速和地域出口限速。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) GetCcnRegionBandwidthLimits(request *GetCcnRegionBandwidthLimitsRequest) (response *GetCcnRegionBandwidthLimitsResponse, err error) { - return c.GetCcnRegionBandwidthLimitsWithContext(context.Background(), request) -} - -// GetCcnRegionBandwidthLimits -// 本接口(GetCcnRegionBandwidthLimits)用于查询云联网相关地域带宽信息,其中预付费模式的云联网仅支持地域间限速,后付费模式的云联网支持地域间限速和地域出口限速。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) GetCcnRegionBandwidthLimitsWithContext(ctx context.Context, request *GetCcnRegionBandwidthLimitsRequest) (response *GetCcnRegionBandwidthLimitsResponse, err error) { - if request == nil { - request = NewGetCcnRegionBandwidthLimitsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("GetCcnRegionBandwidthLimits require credential") - } - - request.SetContext(ctx) - - response = NewGetCcnRegionBandwidthLimitsResponse() - err = c.Send(request, response) - return -} - -func NewHaVipAssociateAddressIpRequest() (request *HaVipAssociateAddressIpRequest) { - request = &HaVipAssociateAddressIpRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "HaVipAssociateAddressIp") - - return -} - -func NewHaVipAssociateAddressIpResponse() (response *HaVipAssociateAddressIpResponse) { - response = &HaVipAssociateAddressIpResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// HaVipAssociateAddressIp -// 本接口(HaVipAssociateAddressIp)用于高可用虚拟IP(HAVIP)绑定弹性公网IP(EIP)。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_BINDEIP = "UnsupportedOperation.BindEIP" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_UNSUPPORTEDBINDLOCALZONEEIP = "UnsupportedOperation.UnsupportedBindLocalZoneEIP" -func (c *Client) HaVipAssociateAddressIp(request *HaVipAssociateAddressIpRequest) (response *HaVipAssociateAddressIpResponse, err error) { - return c.HaVipAssociateAddressIpWithContext(context.Background(), request) -} - -// HaVipAssociateAddressIp -// 本接口(HaVipAssociateAddressIp)用于高可用虚拟IP(HAVIP)绑定弹性公网IP(EIP)。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_BINDEIP = "UnsupportedOperation.BindEIP" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_UNSUPPORTEDBINDLOCALZONEEIP = "UnsupportedOperation.UnsupportedBindLocalZoneEIP" -func (c *Client) HaVipAssociateAddressIpWithContext(ctx context.Context, request *HaVipAssociateAddressIpRequest) (response *HaVipAssociateAddressIpResponse, err error) { - if request == nil { - request = NewHaVipAssociateAddressIpRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("HaVipAssociateAddressIp require credential") - } - - request.SetContext(ctx) - - response = NewHaVipAssociateAddressIpResponse() - err = c.Send(request, response) - return -} - -func NewHaVipDisassociateAddressIpRequest() (request *HaVipDisassociateAddressIpRequest) { - request = &HaVipDisassociateAddressIpRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "HaVipDisassociateAddressIp") - - return -} - -func NewHaVipDisassociateAddressIpResponse() (response *HaVipDisassociateAddressIpResponse) { - response = &HaVipDisassociateAddressIpResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// HaVipDisassociateAddressIp -// 本接口(HaVipDisassociateAddressIp)用于将高可用虚拟IP(HAVIP)已绑定的弹性公网IP(EIP)解除绑定。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) HaVipDisassociateAddressIp(request *HaVipDisassociateAddressIpRequest) (response *HaVipDisassociateAddressIpResponse, err error) { - return c.HaVipDisassociateAddressIpWithContext(context.Background(), request) -} - -// HaVipDisassociateAddressIp -// 本接口(HaVipDisassociateAddressIp)用于将高可用虚拟IP(HAVIP)已绑定的弹性公网IP(EIP)解除绑定。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) HaVipDisassociateAddressIpWithContext(ctx context.Context, request *HaVipDisassociateAddressIpRequest) (response *HaVipDisassociateAddressIpResponse, err error) { - if request == nil { - request = NewHaVipDisassociateAddressIpRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("HaVipDisassociateAddressIp require credential") - } - - request.SetContext(ctx) - - response = NewHaVipDisassociateAddressIpResponse() - err = c.Send(request, response) - return -} - -func NewInquirePriceCreateDirectConnectGatewayRequest() (request *InquirePriceCreateDirectConnectGatewayRequest) { - request = &InquirePriceCreateDirectConnectGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "InquirePriceCreateDirectConnectGateway") - - return -} - -func NewInquirePriceCreateDirectConnectGatewayResponse() (response *InquirePriceCreateDirectConnectGatewayResponse) { - response = &InquirePriceCreateDirectConnectGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquirePriceCreateDirectConnectGateway -// 本接口(DescribePriceCreateDirectConnectGateway)用于创建专线网关询价。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) InquirePriceCreateDirectConnectGateway(request *InquirePriceCreateDirectConnectGatewayRequest) (response *InquirePriceCreateDirectConnectGatewayResponse, err error) { - return c.InquirePriceCreateDirectConnectGatewayWithContext(context.Background(), request) -} - -// InquirePriceCreateDirectConnectGateway -// 本接口(DescribePriceCreateDirectConnectGateway)用于创建专线网关询价。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) InquirePriceCreateDirectConnectGatewayWithContext(ctx context.Context, request *InquirePriceCreateDirectConnectGatewayRequest) (response *InquirePriceCreateDirectConnectGatewayResponse, err error) { - if request == nil { - request = NewInquirePriceCreateDirectConnectGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquirePriceCreateDirectConnectGateway require credential") - } - - request.SetContext(ctx) - - response = NewInquirePriceCreateDirectConnectGatewayResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceCreateVpnGatewayRequest() (request *InquiryPriceCreateVpnGatewayRequest) { - request = &InquiryPriceCreateVpnGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "InquiryPriceCreateVpnGateway") - - return -} - -func NewInquiryPriceCreateVpnGatewayResponse() (response *InquiryPriceCreateVpnGatewayResponse) { - response = &InquiryPriceCreateVpnGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceCreateVpnGateway -// 本接口(InquiryPriceCreateVpnGateway)用于创建VPN网关询价。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) InquiryPriceCreateVpnGateway(request *InquiryPriceCreateVpnGatewayRequest) (response *InquiryPriceCreateVpnGatewayResponse, err error) { - return c.InquiryPriceCreateVpnGatewayWithContext(context.Background(), request) -} - -// InquiryPriceCreateVpnGateway -// 本接口(InquiryPriceCreateVpnGateway)用于创建VPN网关询价。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) InquiryPriceCreateVpnGatewayWithContext(ctx context.Context, request *InquiryPriceCreateVpnGatewayRequest) (response *InquiryPriceCreateVpnGatewayResponse, err error) { - if request == nil { - request = NewInquiryPriceCreateVpnGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceCreateVpnGateway require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceCreateVpnGatewayResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceRenewVpnGatewayRequest() (request *InquiryPriceRenewVpnGatewayRequest) { - request = &InquiryPriceRenewVpnGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "InquiryPriceRenewVpnGateway") - - return -} - -func NewInquiryPriceRenewVpnGatewayResponse() (response *InquiryPriceRenewVpnGatewayResponse) { - response = &InquiryPriceRenewVpnGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceRenewVpnGateway -// 本接口(InquiryPriceRenewVpnGateway)用于续费VPN网关询价。目前仅支持IPSEC类型网关的询价。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) InquiryPriceRenewVpnGateway(request *InquiryPriceRenewVpnGatewayRequest) (response *InquiryPriceRenewVpnGatewayResponse, err error) { - return c.InquiryPriceRenewVpnGatewayWithContext(context.Background(), request) -} - -// InquiryPriceRenewVpnGateway -// 本接口(InquiryPriceRenewVpnGateway)用于续费VPN网关询价。目前仅支持IPSEC类型网关的询价。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) InquiryPriceRenewVpnGatewayWithContext(ctx context.Context, request *InquiryPriceRenewVpnGatewayRequest) (response *InquiryPriceRenewVpnGatewayResponse, err error) { - if request == nil { - request = NewInquiryPriceRenewVpnGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceRenewVpnGateway require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceRenewVpnGatewayResponse() - err = c.Send(request, response) - return -} - -func NewInquiryPriceResetVpnGatewayInternetMaxBandwidthRequest() (request *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) { - request = &InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "InquiryPriceResetVpnGatewayInternetMaxBandwidth") - - return -} - -func NewInquiryPriceResetVpnGatewayInternetMaxBandwidthResponse() (response *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse) { - response = &InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// InquiryPriceResetVpnGatewayInternetMaxBandwidth -// 本接口(InquiryPriceResetVpnGatewayInternetMaxBandwidth)调整VPN网关带宽上限询价。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) InquiryPriceResetVpnGatewayInternetMaxBandwidth(request *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) (response *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse, err error) { - return c.InquiryPriceResetVpnGatewayInternetMaxBandwidthWithContext(context.Background(), request) -} - -// InquiryPriceResetVpnGatewayInternetMaxBandwidth -// 本接口(InquiryPriceResetVpnGatewayInternetMaxBandwidth)调整VPN网关带宽上限询价。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) InquiryPriceResetVpnGatewayInternetMaxBandwidthWithContext(ctx context.Context, request *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) (response *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse, err error) { - if request == nil { - request = NewInquiryPriceResetVpnGatewayInternetMaxBandwidthRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("InquiryPriceResetVpnGatewayInternetMaxBandwidth require credential") - } - - request.SetContext(ctx) - - response = NewInquiryPriceResetVpnGatewayInternetMaxBandwidthResponse() - err = c.Send(request, response) - return -} - -func NewLockCcnBandwidthsRequest() (request *LockCcnBandwidthsRequest) { - request = &LockCcnBandwidthsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "LockCcnBandwidths") - - return -} - -func NewLockCcnBandwidthsResponse() (response *LockCcnBandwidthsResponse) { - response = &LockCcnBandwidthsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// LockCcnBandwidths -// 本接口(LockCcnBandwidths)用户锁定云联网限速实例。 -// -// 该接口一般用来封禁地域间限速的云联网实例下的限速实例, 目前联通内部运营系统通过云API调用, 如果是出口限速, 一般使用更粗的云联网实例粒度封禁(LockCcns)。 -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) LockCcnBandwidths(request *LockCcnBandwidthsRequest) (response *LockCcnBandwidthsResponse, err error) { - return c.LockCcnBandwidthsWithContext(context.Background(), request) -} - -// LockCcnBandwidths -// 本接口(LockCcnBandwidths)用户锁定云联网限速实例。 -// -// 该接口一般用来封禁地域间限速的云联网实例下的限速实例, 目前联通内部运营系统通过云API调用, 如果是出口限速, 一般使用更粗的云联网实例粒度封禁(LockCcns)。 -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) LockCcnBandwidthsWithContext(ctx context.Context, request *LockCcnBandwidthsRequest) (response *LockCcnBandwidthsResponse, err error) { - if request == nil { - request = NewLockCcnBandwidthsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("LockCcnBandwidths require credential") - } - - request.SetContext(ctx) - - response = NewLockCcnBandwidthsResponse() - err = c.Send(request, response) - return -} - -func NewLockCcnsRequest() (request *LockCcnsRequest) { - request = &LockCcnsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "LockCcns") - - return -} - -func NewLockCcnsResponse() (response *LockCcnsResponse) { - response = &LockCcnsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// LockCcns -// 本接口(LockCcns)用于锁定云联网实例 -// -// 该接口一般用来封禁出口限速的云联网实例, 目前联通内部运营系统通过云API调用, 因为出口限速无法按地域间封禁, 只能按更粗的云联网实例粒度封禁, 如果是地域间限速, 一般可以通过更细的限速实例粒度封禁(LockCcnBandwidths) -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) LockCcns(request *LockCcnsRequest) (response *LockCcnsResponse, err error) { - return c.LockCcnsWithContext(context.Background(), request) -} - -// LockCcns -// 本接口(LockCcns)用于锁定云联网实例 -// -// 该接口一般用来封禁出口限速的云联网实例, 目前联通内部运营系统通过云API调用, 因为出口限速无法按地域间封禁, 只能按更粗的云联网实例粒度封禁, 如果是地域间限速, 一般可以通过更细的限速实例粒度封禁(LockCcnBandwidths) -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) LockCcnsWithContext(ctx context.Context, request *LockCcnsRequest) (response *LockCcnsResponse, err error) { - if request == nil { - request = NewLockCcnsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("LockCcns require credential") - } - - request.SetContext(ctx) - - response = NewLockCcnsResponse() - err = c.Send(request, response) - return -} - -func NewMigrateNetworkInterfaceRequest() (request *MigrateNetworkInterfaceRequest) { - request = &MigrateNetworkInterfaceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "MigrateNetworkInterface") - - return -} - -func NewMigrateNetworkInterfaceResponse() (response *MigrateNetworkInterfaceResponse) { - response = &MigrateNetworkInterfaceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// MigrateNetworkInterface -// 本接口(MigrateNetworkInterface)用于弹性网卡迁移。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) MigrateNetworkInterface(request *MigrateNetworkInterfaceRequest) (response *MigrateNetworkInterfaceResponse, err error) { - return c.MigrateNetworkInterfaceWithContext(context.Background(), request) -} - -// MigrateNetworkInterface -// 本接口(MigrateNetworkInterface)用于弹性网卡迁移。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) MigrateNetworkInterfaceWithContext(ctx context.Context, request *MigrateNetworkInterfaceRequest) (response *MigrateNetworkInterfaceResponse, err error) { - if request == nil { - request = NewMigrateNetworkInterfaceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("MigrateNetworkInterface require credential") - } - - request.SetContext(ctx) - - response = NewMigrateNetworkInterfaceResponse() - err = c.Send(request, response) - return -} - -func NewMigratePrivateIpAddressRequest() (request *MigratePrivateIpAddressRequest) { - request = &MigratePrivateIpAddressRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "MigratePrivateIpAddress") - - return -} - -func NewMigratePrivateIpAddressResponse() (response *MigratePrivateIpAddressResponse) { - response = &MigratePrivateIpAddressResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// MigratePrivateIpAddress -// 本接口(MigratePrivateIpAddress)用于弹性网卡内网IP迁移。 -// -// * 该接口用于将一个内网IP从一个弹性网卡上迁移到另外一个弹性网卡,主IP地址不支持迁移。 -// -// * 迁移前后的弹性网卡必须在同一个子网内。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_ATTACHMENTNOTFOUND = "UnauthorizedOperation.AttachmentNotFound" -// UNAUTHORIZEDOPERATION_PRIMARYIP = "UnauthorizedOperation.PrimaryIp" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_PRIMARYIP = "UnsupportedOperation.PrimaryIp" -func (c *Client) MigratePrivateIpAddress(request *MigratePrivateIpAddressRequest) (response *MigratePrivateIpAddressResponse, err error) { - return c.MigratePrivateIpAddressWithContext(context.Background(), request) -} - -// MigratePrivateIpAddress -// 本接口(MigratePrivateIpAddress)用于弹性网卡内网IP迁移。 -// -// * 该接口用于将一个内网IP从一个弹性网卡上迁移到另外一个弹性网卡,主IP地址不支持迁移。 -// -// * 迁移前后的弹性网卡必须在同一个子网内。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_ATTACHMENTNOTFOUND = "UnauthorizedOperation.AttachmentNotFound" -// UNAUTHORIZEDOPERATION_PRIMARYIP = "UnauthorizedOperation.PrimaryIp" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -// UNSUPPORTEDOPERATION_PRIMARYIP = "UnsupportedOperation.PrimaryIp" -func (c *Client) MigratePrivateIpAddressWithContext(ctx context.Context, request *MigratePrivateIpAddressRequest) (response *MigratePrivateIpAddressResponse, err error) { - if request == nil { - request = NewMigratePrivateIpAddressRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("MigratePrivateIpAddress require credential") - } - - request.SetContext(ctx) - - response = NewMigratePrivateIpAddressResponse() - err = c.Send(request, response) - return -} - -func NewModifyAddressAttributeRequest() (request *ModifyAddressAttributeRequest) { - request = &ModifyAddressAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressAttribute") - - return -} - -func NewModifyAddressAttributeResponse() (response *ModifyAddressAttributeResponse) { - response = &ModifyAddressAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyAddressAttribute -// 本接口 (ModifyAddressAttribute) 用于修改[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)的名称。 -// -// 可能返回的错误码: -// -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_RESOURCENOTEXISTED = "InvalidParameterValue.ResourceNotExisted" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INCORRECTADDRESSRESOURCETYPE = "UnsupportedOperation.IncorrectAddressResourceType" -// UNSUPPORTEDOPERATION_MODIFYADDRESSATTRIBUTE = "UnsupportedOperation.ModifyAddressAttribute" -func (c *Client) ModifyAddressAttribute(request *ModifyAddressAttributeRequest) (response *ModifyAddressAttributeResponse, err error) { - return c.ModifyAddressAttributeWithContext(context.Background(), request) -} - -// ModifyAddressAttribute -// 本接口 (ModifyAddressAttribute) 用于修改[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)的名称。 -// -// 可能返回的错误码: -// -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_RESOURCENOTEXISTED = "InvalidParameterValue.ResourceNotExisted" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INCORRECTADDRESSRESOURCETYPE = "UnsupportedOperation.IncorrectAddressResourceType" -// UNSUPPORTEDOPERATION_MODIFYADDRESSATTRIBUTE = "UnsupportedOperation.ModifyAddressAttribute" -func (c *Client) ModifyAddressAttributeWithContext(ctx context.Context, request *ModifyAddressAttributeRequest) (response *ModifyAddressAttributeResponse, err error) { - if request == nil { - request = NewModifyAddressAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyAddressAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyAddressAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyAddressInternetChargeTypeRequest() (request *ModifyAddressInternetChargeTypeRequest) { - request = &ModifyAddressInternetChargeTypeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressInternetChargeType") - - return -} - -func NewModifyAddressInternetChargeTypeResponse() (response *ModifyAddressInternetChargeTypeResponse) { - response = &ModifyAddressInternetChargeTypeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyAddressInternetChargeType -// 该接口用于调整具有带宽属性弹性公网IP的网络计费模式 -// -// * 支持BANDWIDTH_PREPAID_BY_MONTH和TRAFFIC_POSTPAID_BY_HOUR两种网络计费模式之间的切换。 -// -// * 每个弹性公网IP支持调整两次,次数超出则无法调整。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDADDRESSIDSTATE_INARREARS = "InvalidAddressIdState.InArrears" -// INVALIDADDRESSSTATE = "InvalidAddressState" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTCALCIP = "InvalidParameterValue.AddressNotCalcIP" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_INTERNETCHARGETYPENOTCHANGED = "InvalidParameterValue.InternetChargeTypeNotChanged" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_MODIFYADDRESSINTERNETCHARGETYPEQUOTA = "LimitExceeded.ModifyAddressInternetChargeTypeQuota" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -// UNSUPPORTEDOPERATION_NATNOTSUPPORTED = "UnsupportedOperation.NatNotSupported" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) ModifyAddressInternetChargeType(request *ModifyAddressInternetChargeTypeRequest) (response *ModifyAddressInternetChargeTypeResponse, err error) { - return c.ModifyAddressInternetChargeTypeWithContext(context.Background(), request) -} - -// ModifyAddressInternetChargeType -// 该接口用于调整具有带宽属性弹性公网IP的网络计费模式 -// -// * 支持BANDWIDTH_PREPAID_BY_MONTH和TRAFFIC_POSTPAID_BY_HOUR两种网络计费模式之间的切换。 -// -// * 每个弹性公网IP支持调整两次,次数超出则无法调整。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDADDRESSIDSTATE_INARREARS = "InvalidAddressIdState.InArrears" -// INVALIDADDRESSSTATE = "InvalidAddressState" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTCALCIP = "InvalidParameterValue.AddressNotCalcIP" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_INTERNETCHARGETYPENOTCHANGED = "InvalidParameterValue.InternetChargeTypeNotChanged" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// LIMITEXCEEDED = "LimitExceeded" -// LIMITEXCEEDED_MODIFYADDRESSINTERNETCHARGETYPEQUOTA = "LimitExceeded.ModifyAddressInternetChargeTypeQuota" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -// UNSUPPORTEDOPERATION_NATNOTSUPPORTED = "UnsupportedOperation.NatNotSupported" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) ModifyAddressInternetChargeTypeWithContext(ctx context.Context, request *ModifyAddressInternetChargeTypeRequest) (response *ModifyAddressInternetChargeTypeResponse, err error) { - if request == nil { - request = NewModifyAddressInternetChargeTypeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyAddressInternetChargeType require credential") - } - - request.SetContext(ctx) - - response = NewModifyAddressInternetChargeTypeResponse() - err = c.Send(request, response) - return -} - -func NewModifyAddressTemplateAttributeRequest() (request *ModifyAddressTemplateAttributeRequest) { - request = &ModifyAddressTemplateAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressTemplateAttribute") - - return -} - -func NewModifyAddressTemplateAttributeResponse() (response *ModifyAddressTemplateAttributeResponse) { - response = &ModifyAddressTemplateAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyAddressTemplateAttribute -// 本接口(ModifyAddressTemplateAttribute)用于修改IP地址模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyAddressTemplateAttribute(request *ModifyAddressTemplateAttributeRequest) (response *ModifyAddressTemplateAttributeResponse, err error) { - return c.ModifyAddressTemplateAttributeWithContext(context.Background(), request) -} - -// ModifyAddressTemplateAttribute -// 本接口(ModifyAddressTemplateAttribute)用于修改IP地址模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyAddressTemplateAttributeWithContext(ctx context.Context, request *ModifyAddressTemplateAttributeRequest) (response *ModifyAddressTemplateAttributeResponse, err error) { - if request == nil { - request = NewModifyAddressTemplateAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyAddressTemplateAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyAddressTemplateAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyAddressTemplateGroupAttributeRequest() (request *ModifyAddressTemplateGroupAttributeRequest) { - request = &ModifyAddressTemplateGroupAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressTemplateGroupAttribute") - - return -} - -func NewModifyAddressTemplateGroupAttributeResponse() (response *ModifyAddressTemplateGroupAttributeResponse) { - response = &ModifyAddressTemplateGroupAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyAddressTemplateGroupAttribute -// 本接口(ModifyAddressTemplateGroupAttribute)用于修改IP地址模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyAddressTemplateGroupAttribute(request *ModifyAddressTemplateGroupAttributeRequest) (response *ModifyAddressTemplateGroupAttributeResponse, err error) { - return c.ModifyAddressTemplateGroupAttributeWithContext(context.Background(), request) -} - -// ModifyAddressTemplateGroupAttribute -// 本接口(ModifyAddressTemplateGroupAttribute)用于修改IP地址模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyAddressTemplateGroupAttributeWithContext(ctx context.Context, request *ModifyAddressTemplateGroupAttributeRequest) (response *ModifyAddressTemplateGroupAttributeResponse, err error) { - if request == nil { - request = NewModifyAddressTemplateGroupAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyAddressTemplateGroupAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyAddressTemplateGroupAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyAddressesBandwidthRequest() (request *ModifyAddressesBandwidthRequest) { - request = &ModifyAddressesBandwidthRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressesBandwidth") - - return -} - -func NewModifyAddressesBandwidthResponse() (response *ModifyAddressesBandwidthResponse) { - response = &ModifyAddressesBandwidthResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyAddressesBandwidth -// 本接口(ModifyAddressesBandwidth)用于调整[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称EIP)带宽,支持后付费EIP, 预付费EIP和带宽包EIP -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" -// INVALIDPARAMETERVALUE_BANDWIDTHTOOSMALL = "InvalidParameterValue.BandwidthTooSmall" -// INVALIDPARAMETERVALUE_INCONSISTENTINSTANCEINTERNETCHARGETYPE = "InvalidParameterValue.InconsistentInstanceInternetChargeType" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOCALCIP = "InvalidParameterValue.InstanceNoCalcIP" -// INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RESOURCEEXPIRED = "InvalidParameterValue.ResourceExpired" -// INVALIDPARAMETERVALUE_RESOURCENOTEXISTED = "InvalidParameterValue.ResourceNotExisted" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) ModifyAddressesBandwidth(request *ModifyAddressesBandwidthRequest) (response *ModifyAddressesBandwidthResponse, err error) { - return c.ModifyAddressesBandwidthWithContext(context.Background(), request) -} - -// ModifyAddressesBandwidth -// 本接口(ModifyAddressesBandwidth)用于调整[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称EIP)带宽,支持后付费EIP, 预付费EIP和带宽包EIP -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" -// INVALIDPARAMETERVALUE_BANDWIDTHTOOSMALL = "InvalidParameterValue.BandwidthTooSmall" -// INVALIDPARAMETERVALUE_INCONSISTENTINSTANCEINTERNETCHARGETYPE = "InvalidParameterValue.InconsistentInstanceInternetChargeType" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOCALCIP = "InvalidParameterValue.InstanceNoCalcIP" -// INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_RESOURCEEXPIRED = "InvalidParameterValue.ResourceExpired" -// INVALIDPARAMETERVALUE_RESOURCENOTEXISTED = "InvalidParameterValue.ResourceNotExisted" -// INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) ModifyAddressesBandwidthWithContext(ctx context.Context, request *ModifyAddressesBandwidthRequest) (response *ModifyAddressesBandwidthResponse, err error) { - if request == nil { - request = NewModifyAddressesBandwidthRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyAddressesBandwidth require credential") - } - - request.SetContext(ctx) - - response = NewModifyAddressesBandwidthResponse() - err = c.Send(request, response) - return -} - -func NewModifyAssistantCidrRequest() (request *ModifyAssistantCidrRequest) { - request = &ModifyAssistantCidrRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyAssistantCidr") - - return -} - -func NewModifyAssistantCidrResponse() (response *ModifyAssistantCidrResponse) { - response = &ModifyAssistantCidrResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyAssistantCidr -// 本接口(ModifyAssistantCidr)用于批量修改辅助CIDR,支持新增和删除。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETOVERLAPASSISTCIDR = "InvalidParameterValue.SubnetOverlapAssistCidr" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ModifyAssistantCidr(request *ModifyAssistantCidrRequest) (response *ModifyAssistantCidrResponse, err error) { - return c.ModifyAssistantCidrWithContext(context.Background(), request) -} - -// ModifyAssistantCidr -// 本接口(ModifyAssistantCidr)用于批量修改辅助CIDR,支持新增和删除。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" -// INVALIDPARAMETERVALUE_SUBNETOVERLAPASSISTCIDR = "InvalidParameterValue.SubnetOverlapAssistCidr" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ModifyAssistantCidrWithContext(ctx context.Context, request *ModifyAssistantCidrRequest) (response *ModifyAssistantCidrResponse, err error) { - if request == nil { - request = NewModifyAssistantCidrRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyAssistantCidr require credential") - } - - request.SetContext(ctx) - - response = NewModifyAssistantCidrResponse() - err = c.Send(request, response) - return -} - -func NewModifyBandwidthPackageAttributeRequest() (request *ModifyBandwidthPackageAttributeRequest) { - request = &ModifyBandwidthPackageAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyBandwidthPackageAttribute") - - return -} - -func NewModifyBandwidthPackageAttributeResponse() (response *ModifyBandwidthPackageAttributeResponse) { - response = &ModifyBandwidthPackageAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyBandwidthPackageAttribute -// 接口用于修改带宽包属性,包括带宽包名字等 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_INVALIDBANDWIDTHPACKAGECHARGETYPE = "InvalidParameterValue.InvalidBandwidthPackageChargeType" -func (c *Client) ModifyBandwidthPackageAttribute(request *ModifyBandwidthPackageAttributeRequest) (response *ModifyBandwidthPackageAttributeResponse, err error) { - return c.ModifyBandwidthPackageAttributeWithContext(context.Background(), request) -} - -// ModifyBandwidthPackageAttribute -// 接口用于修改带宽包属性,包括带宽包名字等 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_INVALIDBANDWIDTHPACKAGECHARGETYPE = "InvalidParameterValue.InvalidBandwidthPackageChargeType" -func (c *Client) ModifyBandwidthPackageAttributeWithContext(ctx context.Context, request *ModifyBandwidthPackageAttributeRequest) (response *ModifyBandwidthPackageAttributeResponse, err error) { - if request == nil { - request = NewModifyBandwidthPackageAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyBandwidthPackageAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyBandwidthPackageAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyCcnAttachedInstancesAttributeRequest() (request *ModifyCcnAttachedInstancesAttributeRequest) { - request = &ModifyCcnAttachedInstancesAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyCcnAttachedInstancesAttribute") - - return -} - -func NewModifyCcnAttachedInstancesAttributeResponse() (response *ModifyCcnAttachedInstancesAttributeResponse) { - response = &ModifyCcnAttachedInstancesAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyCcnAttachedInstancesAttribute -// 修改CCN关联实例属性,目前仅修改备注description -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ModifyCcnAttachedInstancesAttribute(request *ModifyCcnAttachedInstancesAttributeRequest) (response *ModifyCcnAttachedInstancesAttributeResponse, err error) { - return c.ModifyCcnAttachedInstancesAttributeWithContext(context.Background(), request) -} - -// ModifyCcnAttachedInstancesAttribute -// 修改CCN关联实例属性,目前仅修改备注description -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ModifyCcnAttachedInstancesAttributeWithContext(ctx context.Context, request *ModifyCcnAttachedInstancesAttributeRequest) (response *ModifyCcnAttachedInstancesAttributeResponse, err error) { - if request == nil { - request = NewModifyCcnAttachedInstancesAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyCcnAttachedInstancesAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyCcnAttachedInstancesAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyCcnAttributeRequest() (request *ModifyCcnAttributeRequest) { - request = &ModifyCcnAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyCcnAttribute") - - return -} - -func NewModifyCcnAttributeResponse() (response *ModifyCcnAttributeResponse) { - response = &ModifyCcnAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyCcnAttribute -// 本接口(ModifyCcnAttribute)用于修改云联网(CCN)的相关属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyCcnAttribute(request *ModifyCcnAttributeRequest) (response *ModifyCcnAttributeResponse, err error) { - return c.ModifyCcnAttributeWithContext(context.Background(), request) -} - -// ModifyCcnAttribute -// 本接口(ModifyCcnAttribute)用于修改云联网(CCN)的相关属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyCcnAttributeWithContext(ctx context.Context, request *ModifyCcnAttributeRequest) (response *ModifyCcnAttributeResponse, err error) { - if request == nil { - request = NewModifyCcnAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyCcnAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyCcnAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyCcnRegionBandwidthLimitsTypeRequest() (request *ModifyCcnRegionBandwidthLimitsTypeRequest) { - request = &ModifyCcnRegionBandwidthLimitsTypeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyCcnRegionBandwidthLimitsType") - - return -} - -func NewModifyCcnRegionBandwidthLimitsTypeResponse() (response *ModifyCcnRegionBandwidthLimitsTypeResponse) { - response = &ModifyCcnRegionBandwidthLimitsTypeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyCcnRegionBandwidthLimitsType -// 本接口(ModifyCcnRegionBandwidthLimitsType)用于修改后付费云联网实例修改带宽限速策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_NOTLOCKEDINSTANCEOPERATION = "UnsupportedOperation.NotLockedInstanceOperation" -// UNSUPPORTEDOPERATION_NOTPOSTPAIDCCNOPERATION = "UnsupportedOperation.NotPostpaidCcnOperation" -func (c *Client) ModifyCcnRegionBandwidthLimitsType(request *ModifyCcnRegionBandwidthLimitsTypeRequest) (response *ModifyCcnRegionBandwidthLimitsTypeResponse, err error) { - return c.ModifyCcnRegionBandwidthLimitsTypeWithContext(context.Background(), request) -} - -// ModifyCcnRegionBandwidthLimitsType -// 本接口(ModifyCcnRegionBandwidthLimitsType)用于修改后付费云联网实例修改带宽限速策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_NOTLOCKEDINSTANCEOPERATION = "UnsupportedOperation.NotLockedInstanceOperation" -// UNSUPPORTEDOPERATION_NOTPOSTPAIDCCNOPERATION = "UnsupportedOperation.NotPostpaidCcnOperation" -func (c *Client) ModifyCcnRegionBandwidthLimitsTypeWithContext(ctx context.Context, request *ModifyCcnRegionBandwidthLimitsTypeRequest) (response *ModifyCcnRegionBandwidthLimitsTypeResponse, err error) { - if request == nil { - request = NewModifyCcnRegionBandwidthLimitsTypeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyCcnRegionBandwidthLimitsType require credential") - } - - request.SetContext(ctx) - - response = NewModifyCcnRegionBandwidthLimitsTypeResponse() - err = c.Send(request, response) - return -} - -func NewModifyCustomerGatewayAttributeRequest() (request *ModifyCustomerGatewayAttributeRequest) { - request = &ModifyCustomerGatewayAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyCustomerGatewayAttribute") - - return -} - -func NewModifyCustomerGatewayAttributeResponse() (response *ModifyCustomerGatewayAttributeResponse) { - response = &ModifyCustomerGatewayAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyCustomerGatewayAttribute -// 本接口(ModifyCustomerGatewayAttribute)用于修改对端网关信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyCustomerGatewayAttribute(request *ModifyCustomerGatewayAttributeRequest) (response *ModifyCustomerGatewayAttributeResponse, err error) { - return c.ModifyCustomerGatewayAttributeWithContext(context.Background(), request) -} - -// ModifyCustomerGatewayAttribute -// 本接口(ModifyCustomerGatewayAttribute)用于修改对端网关信息。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyCustomerGatewayAttributeWithContext(ctx context.Context, request *ModifyCustomerGatewayAttributeRequest) (response *ModifyCustomerGatewayAttributeResponse, err error) { - if request == nil { - request = NewModifyCustomerGatewayAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyCustomerGatewayAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyCustomerGatewayAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyDhcpIpAttributeRequest() (request *ModifyDhcpIpAttributeRequest) { - request = &ModifyDhcpIpAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyDhcpIpAttribute") - - return -} - -func NewModifyDhcpIpAttributeResponse() (response *ModifyDhcpIpAttributeResponse) { - response = &ModifyDhcpIpAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyDhcpIpAttribute -// 本接口(ModifyDhcpIpAttribute)用于修改DhcpIp属性 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyDhcpIpAttribute(request *ModifyDhcpIpAttributeRequest) (response *ModifyDhcpIpAttributeResponse, err error) { - return c.ModifyDhcpIpAttributeWithContext(context.Background(), request) -} - -// ModifyDhcpIpAttribute -// 本接口(ModifyDhcpIpAttribute)用于修改DhcpIp属性 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyDhcpIpAttributeWithContext(ctx context.Context, request *ModifyDhcpIpAttributeRequest) (response *ModifyDhcpIpAttributeResponse, err error) { - if request == nil { - request = NewModifyDhcpIpAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyDhcpIpAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyDhcpIpAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyDirectConnectGatewayAttributeRequest() (request *ModifyDirectConnectGatewayAttributeRequest) { - request = &ModifyDirectConnectGatewayAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyDirectConnectGatewayAttribute") - - return -} - -func NewModifyDirectConnectGatewayAttributeResponse() (response *ModifyDirectConnectGatewayAttributeResponse) { - response = &ModifyDirectConnectGatewayAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyDirectConnectGatewayAttribute -// 本接口(ModifyDirectConnectGatewayAttribute)用于修改专线网关属性 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_DIRECTCONNECTGATEWAYISUPDATINGCOMMUNITY = "UnsupportedOperation.DirectConnectGatewayIsUpdatingCommunity" -func (c *Client) ModifyDirectConnectGatewayAttribute(request *ModifyDirectConnectGatewayAttributeRequest) (response *ModifyDirectConnectGatewayAttributeResponse, err error) { - return c.ModifyDirectConnectGatewayAttributeWithContext(context.Background(), request) -} - -// ModifyDirectConnectGatewayAttribute -// 本接口(ModifyDirectConnectGatewayAttribute)用于修改专线网关属性 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -// UNSUPPORTEDOPERATION_DIRECTCONNECTGATEWAYISUPDATINGCOMMUNITY = "UnsupportedOperation.DirectConnectGatewayIsUpdatingCommunity" -func (c *Client) ModifyDirectConnectGatewayAttributeWithContext(ctx context.Context, request *ModifyDirectConnectGatewayAttributeRequest) (response *ModifyDirectConnectGatewayAttributeResponse, err error) { - if request == nil { - request = NewModifyDirectConnectGatewayAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyDirectConnectGatewayAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyDirectConnectGatewayAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyFlowLogAttributeRequest() (request *ModifyFlowLogAttributeRequest) { - request = &ModifyFlowLogAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyFlowLogAttribute") - - return -} - -func NewModifyFlowLogAttributeResponse() (response *ModifyFlowLogAttributeResponse) { - response = &ModifyFlowLogAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyFlowLogAttribute -// 本接口(ModifyFlowLogAttribute)用于修改流日志属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) ModifyFlowLogAttribute(request *ModifyFlowLogAttributeRequest) (response *ModifyFlowLogAttributeResponse, err error) { - return c.ModifyFlowLogAttributeWithContext(context.Background(), request) -} - -// ModifyFlowLogAttribute -// 本接口(ModifyFlowLogAttribute)用于修改流日志属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) ModifyFlowLogAttributeWithContext(ctx context.Context, request *ModifyFlowLogAttributeRequest) (response *ModifyFlowLogAttributeResponse, err error) { - if request == nil { - request = NewModifyFlowLogAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyFlowLogAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyFlowLogAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyGatewayFlowQosRequest() (request *ModifyGatewayFlowQosRequest) { - request = &ModifyGatewayFlowQosRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyGatewayFlowQos") - - return -} - -func NewModifyGatewayFlowQosResponse() (response *ModifyGatewayFlowQosResponse) { - response = &ModifyGatewayFlowQosResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyGatewayFlowQos -// 本接口(ModifyGatewayFlowQos)用于调整网关流控带宽。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ModifyGatewayFlowQos(request *ModifyGatewayFlowQosRequest) (response *ModifyGatewayFlowQosResponse, err error) { - return c.ModifyGatewayFlowQosWithContext(context.Background(), request) -} - -// ModifyGatewayFlowQos -// 本接口(ModifyGatewayFlowQos)用于调整网关流控带宽。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ModifyGatewayFlowQosWithContext(ctx context.Context, request *ModifyGatewayFlowQosRequest) (response *ModifyGatewayFlowQosResponse, err error) { - if request == nil { - request = NewModifyGatewayFlowQosRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyGatewayFlowQos require credential") - } - - request.SetContext(ctx) - - response = NewModifyGatewayFlowQosResponse() - err = c.Send(request, response) - return -} - -func NewModifyHaVipAttributeRequest() (request *ModifyHaVipAttributeRequest) { - request = &ModifyHaVipAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyHaVipAttribute") - - return -} - -func NewModifyHaVipAttributeResponse() (response *ModifyHaVipAttributeResponse) { - response = &ModifyHaVipAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyHaVipAttribute -// 本接口(ModifyHaVipAttribute)用于修改高可用虚拟IP(HAVIP)属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ModifyHaVipAttribute(request *ModifyHaVipAttributeRequest) (response *ModifyHaVipAttributeResponse, err error) { - return c.ModifyHaVipAttributeWithContext(context.Background(), request) -} - -// ModifyHaVipAttribute -// 本接口(ModifyHaVipAttribute)用于修改高可用虚拟IP(HAVIP)属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ModifyHaVipAttributeWithContext(ctx context.Context, request *ModifyHaVipAttributeRequest) (response *ModifyHaVipAttributeResponse, err error) { - if request == nil { - request = NewModifyHaVipAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyHaVipAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyHaVipAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyIp6AddressesBandwidthRequest() (request *ModifyIp6AddressesBandwidthRequest) { - request = &ModifyIp6AddressesBandwidthRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyIp6AddressesBandwidth") - - return -} - -func NewModifyIp6AddressesBandwidthResponse() (response *ModifyIp6AddressesBandwidthResponse) { - response = &ModifyIp6AddressesBandwidthResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyIp6AddressesBandwidth -// 该接口用于修改IPV6地址访问internet的带宽 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDADDRESSIDSTATE_INARREARS = "InvalidAddressIdState.InArrears" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTFOUND = "InvalidParameterValue.AddressIpNotFound" -// INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" -// INVALIDPARAMETERVALUE_INVALIDIPV6 = "InvalidParameterValue.InvalidIpv6" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSIPINARREAR = "UnsupportedOperation.AddressIpInArrear" -// UNSUPPORTEDOPERATION_ADDRESSIPINTERNETCHARGETYPENOTPERMIT = "UnsupportedOperation.AddressIpInternetChargeTypeNotPermit" -// UNSUPPORTEDOPERATION_ADDRESSIPNOTSUPPORTINSTANCE = "UnsupportedOperation.AddressIpNotSupportInstance" -// UNSUPPORTEDOPERATION_ADDRESSIPSTATUSNOTPERMIT = "UnsupportedOperation.AddressIpStatusNotPermit" -func (c *Client) ModifyIp6AddressesBandwidth(request *ModifyIp6AddressesBandwidthRequest) (response *ModifyIp6AddressesBandwidthResponse, err error) { - return c.ModifyIp6AddressesBandwidthWithContext(context.Background(), request) -} - -// ModifyIp6AddressesBandwidth -// 该接口用于修改IPV6地址访问internet的带宽 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDADDRESSIDSTATE_INARREARS = "InvalidAddressIdState.InArrears" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTFOUND = "InvalidParameterValue.AddressIpNotFound" -// INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" -// INVALIDPARAMETERVALUE_INVALIDIPV6 = "InvalidParameterValue.InvalidIpv6" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSIPINARREAR = "UnsupportedOperation.AddressIpInArrear" -// UNSUPPORTEDOPERATION_ADDRESSIPINTERNETCHARGETYPENOTPERMIT = "UnsupportedOperation.AddressIpInternetChargeTypeNotPermit" -// UNSUPPORTEDOPERATION_ADDRESSIPNOTSUPPORTINSTANCE = "UnsupportedOperation.AddressIpNotSupportInstance" -// UNSUPPORTEDOPERATION_ADDRESSIPSTATUSNOTPERMIT = "UnsupportedOperation.AddressIpStatusNotPermit" -func (c *Client) ModifyIp6AddressesBandwidthWithContext(ctx context.Context, request *ModifyIp6AddressesBandwidthRequest) (response *ModifyIp6AddressesBandwidthResponse, err error) { - if request == nil { - request = NewModifyIp6AddressesBandwidthRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyIp6AddressesBandwidth require credential") - } - - request.SetContext(ctx) - - response = NewModifyIp6AddressesBandwidthResponse() - err = c.Send(request, response) - return -} - -func NewModifyIp6RuleRequest() (request *ModifyIp6RuleRequest) { - request = &ModifyIp6RuleRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyIp6Rule") - - return -} - -func NewModifyIp6RuleResponse() (response *ModifyIp6RuleResponse) { - response = &ModifyIp6RuleResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyIp6Rule -// 该接口用于修改IPV6转换规则,当前仅支持修改转换规则名称,IPV4地址和IPV4端口号 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_IPV6RULENOTCHANGE = "InvalidParameterValue.IPv6RuleNotChange" -// INVALIDPARAMETERVALUE_IP6RULENOTFOUND = "InvalidParameterValue.Ip6RuleNotFound" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) ModifyIp6Rule(request *ModifyIp6RuleRequest) (response *ModifyIp6RuleResponse, err error) { - return c.ModifyIp6RuleWithContext(context.Background(), request) -} - -// ModifyIp6Rule -// 该接口用于修改IPV6转换规则,当前仅支持修改转换规则名称,IPV4地址和IPV4端口号 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_IPV6RULENOTCHANGE = "InvalidParameterValue.IPv6RuleNotChange" -// INVALIDPARAMETERVALUE_IP6RULENOTFOUND = "InvalidParameterValue.Ip6RuleNotFound" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -func (c *Client) ModifyIp6RuleWithContext(ctx context.Context, request *ModifyIp6RuleRequest) (response *ModifyIp6RuleResponse, err error) { - if request == nil { - request = NewModifyIp6RuleRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyIp6Rule require credential") - } - - request.SetContext(ctx) - - response = NewModifyIp6RuleResponse() - err = c.Send(request, response) - return -} - -func NewModifyIp6TranslatorRequest() (request *ModifyIp6TranslatorRequest) { - request = &ModifyIp6TranslatorRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyIp6Translator") - - return -} - -func NewModifyIp6TranslatorResponse() (response *ModifyIp6TranslatorResponse) { - response = &ModifyIp6TranslatorResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyIp6Translator -// 该接口用于修改IP6转换实例属性,当前仅支持修改实例名称。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -func (c *Client) ModifyIp6Translator(request *ModifyIp6TranslatorRequest) (response *ModifyIp6TranslatorResponse, err error) { - return c.ModifyIp6TranslatorWithContext(context.Background(), request) -} - -// ModifyIp6Translator -// 该接口用于修改IP6转换实例属性,当前仅支持修改实例名称。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -func (c *Client) ModifyIp6TranslatorWithContext(ctx context.Context, request *ModifyIp6TranslatorRequest) (response *ModifyIp6TranslatorResponse, err error) { - if request == nil { - request = NewModifyIp6TranslatorRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyIp6Translator require credential") - } - - request.SetContext(ctx) - - response = NewModifyIp6TranslatorResponse() - err = c.Send(request, response) - return -} - -func NewModifyIpv6AddressesAttributeRequest() (request *ModifyIpv6AddressesAttributeRequest) { - request = &ModifyIpv6AddressesAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyIpv6AddressesAttribute") - - return -} - -func NewModifyIpv6AddressesAttributeResponse() (response *ModifyIpv6AddressesAttributeResponse) { - response = &ModifyIpv6AddressesAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyIpv6AddressesAttribute -// 本接口(ModifyIpv6AddressesAttribute)用于修改弹性网卡内网IPv6地址属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ModifyIpv6AddressesAttribute(request *ModifyIpv6AddressesAttributeRequest) (response *ModifyIpv6AddressesAttributeResponse, err error) { - return c.ModifyIpv6AddressesAttributeWithContext(context.Background(), request) -} - -// ModifyIpv6AddressesAttribute -// 本接口(ModifyIpv6AddressesAttribute)用于修改弹性网卡内网IPv6地址属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ModifyIpv6AddressesAttributeWithContext(ctx context.Context, request *ModifyIpv6AddressesAttributeRequest) (response *ModifyIpv6AddressesAttributeResponse, err error) { - if request == nil { - request = NewModifyIpv6AddressesAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyIpv6AddressesAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyIpv6AddressesAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyLocalGatewayRequest() (request *ModifyLocalGatewayRequest) { - request = &ModifyLocalGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyLocalGateway") - - return -} - -func NewModifyLocalGatewayResponse() (response *ModifyLocalGatewayResponse) { - response = &ModifyLocalGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyLocalGateway -// 本接口(ModifyLocalGateway)用于修改CDC的本地网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyLocalGateway(request *ModifyLocalGatewayRequest) (response *ModifyLocalGatewayResponse, err error) { - return c.ModifyLocalGatewayWithContext(context.Background(), request) -} - -// ModifyLocalGateway -// 本接口(ModifyLocalGateway)用于修改CDC的本地网关。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyLocalGatewayWithContext(ctx context.Context, request *ModifyLocalGatewayRequest) (response *ModifyLocalGatewayResponse, err error) { - if request == nil { - request = NewModifyLocalGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyLocalGateway require credential") - } - - request.SetContext(ctx) - - response = NewModifyLocalGatewayResponse() - err = c.Send(request, response) - return -} - -func NewModifyNatGatewayAttributeRequest() (request *ModifyNatGatewayAttributeRequest) { - request = &ModifyNatGatewayAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNatGatewayAttribute") - - return -} - -func NewModifyNatGatewayAttributeResponse() (response *ModifyNatGatewayAttributeResponse) { - response = &ModifyNatGatewayAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNatGatewayAttribute -// 本接口(ModifyNatGatewayAttribute)用于修改NAT网关的属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ModifyNatGatewayAttribute(request *ModifyNatGatewayAttributeRequest) (response *ModifyNatGatewayAttributeResponse, err error) { - return c.ModifyNatGatewayAttributeWithContext(context.Background(), request) -} - -// ModifyNatGatewayAttribute -// 本接口(ModifyNatGatewayAttribute)用于修改NAT网关的属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ModifyNatGatewayAttributeWithContext(ctx context.Context, request *ModifyNatGatewayAttributeRequest) (response *ModifyNatGatewayAttributeResponse, err error) { - if request == nil { - request = NewModifyNatGatewayAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNatGatewayAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyNatGatewayAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyNatGatewayDestinationIpPortTranslationNatRuleRequest() (request *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) { - request = &ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNatGatewayDestinationIpPortTranslationNatRule") - - return -} - -func NewModifyNatGatewayDestinationIpPortTranslationNatRuleResponse() (response *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse) { - response = &ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNatGatewayDestinationIpPortTranslationNatRule -// 本接口(ModifyNatGatewayDestinationIpPortTranslationNatRule)用于修改NAT网关端口转发规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULENOTEXISTS = "InvalidParameterValue.NatGatewayDnatRuleNotExists" -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEPIPNEEDVM = "InvalidParameterValue.NatGatewayDnatRulePipNeedVm" -// UNSUPPORTEDOPERATION_NATGATEWAYRULEPIPEXISTS = "UnsupportedOperation.NatGatewayRulePipExists" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -func (c *Client) ModifyNatGatewayDestinationIpPortTranslationNatRule(request *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { - return c.ModifyNatGatewayDestinationIpPortTranslationNatRuleWithContext(context.Background(), request) -} - -// ModifyNatGatewayDestinationIpPortTranslationNatRule -// 本接口(ModifyNatGatewayDestinationIpPortTranslationNatRule)用于修改NAT网关端口转发规则。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULENOTEXISTS = "InvalidParameterValue.NatGatewayDnatRuleNotExists" -// INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEPIPNEEDVM = "InvalidParameterValue.NatGatewayDnatRulePipNeedVm" -// UNSUPPORTEDOPERATION_NATGATEWAYRULEPIPEXISTS = "UnsupportedOperation.NatGatewayRulePipExists" -// UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" -func (c *Client) ModifyNatGatewayDestinationIpPortTranslationNatRuleWithContext(ctx context.Context, request *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { - if request == nil { - request = NewModifyNatGatewayDestinationIpPortTranslationNatRuleRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNatGatewayDestinationIpPortTranslationNatRule require credential") - } - - request.SetContext(ctx) - - response = NewModifyNatGatewayDestinationIpPortTranslationNatRuleResponse() - err = c.Send(request, response) - return -} - -func NewModifyNatGatewaySourceIpTranslationNatRuleRequest() (request *ModifyNatGatewaySourceIpTranslationNatRuleRequest) { - request = &ModifyNatGatewaySourceIpTranslationNatRuleRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNatGatewaySourceIpTranslationNatRule") - - return -} - -func NewModifyNatGatewaySourceIpTranslationNatRuleResponse() (response *ModifyNatGatewaySourceIpTranslationNatRuleResponse) { - response = &ModifyNatGatewaySourceIpTranslationNatRuleResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNatGatewaySourceIpTranslationNatRule -// 本接口(ModifyNatGatewaySourceIpTranslationNatRule)用于修改NAT网关SNAT转发规则。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NATGATEWAYSNATRULENOTEXISTS = "InvalidParameterValue.NatGatewaySnatRuleNotExists" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) ModifyNatGatewaySourceIpTranslationNatRule(request *ModifyNatGatewaySourceIpTranslationNatRuleRequest) (response *ModifyNatGatewaySourceIpTranslationNatRuleResponse, err error) { - return c.ModifyNatGatewaySourceIpTranslationNatRuleWithContext(context.Background(), request) -} - -// ModifyNatGatewaySourceIpTranslationNatRule -// 本接口(ModifyNatGatewaySourceIpTranslationNatRule)用于修改NAT网关SNAT转发规则。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NATGATEWAYSNATRULENOTEXISTS = "InvalidParameterValue.NatGatewaySnatRuleNotExists" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" -func (c *Client) ModifyNatGatewaySourceIpTranslationNatRuleWithContext(ctx context.Context, request *ModifyNatGatewaySourceIpTranslationNatRuleRequest) (response *ModifyNatGatewaySourceIpTranslationNatRuleResponse, err error) { - if request == nil { - request = NewModifyNatGatewaySourceIpTranslationNatRuleRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNatGatewaySourceIpTranslationNatRule require credential") - } - - request.SetContext(ctx) - - response = NewModifyNatGatewaySourceIpTranslationNatRuleResponse() - err = c.Send(request, response) - return -} - -func NewModifyNetDetectRequest() (request *ModifyNetDetectRequest) { - request = &ModifyNetDetectRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetDetect") - - return -} - -func NewModifyNetDetectResponse() (response *ModifyNetDetectResponse) { - response = &ModifyNetDetectResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNetDetect -// 本接口(ModifyNetDetect)用于修改网络探测参数。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_NEXTHOPMISMATCH = "InvalidParameter.NextHopMismatch" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NETDETECTNOTFOUNDIP = "InvalidParameterValue.NetDetectNotFoundIp" -// INVALIDPARAMETERVALUE_NETDETECTSAMEIP = "InvalidParameterValue.NetDetectSameIp" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -func (c *Client) ModifyNetDetect(request *ModifyNetDetectRequest) (response *ModifyNetDetectResponse, err error) { - return c.ModifyNetDetectWithContext(context.Background(), request) -} - -// ModifyNetDetect -// 本接口(ModifyNetDetect)用于修改网络探测参数。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_NEXTHOPMISMATCH = "InvalidParameter.NextHopMismatch" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_NETDETECTNOTFOUNDIP = "InvalidParameterValue.NetDetectNotFoundIp" -// INVALIDPARAMETERVALUE_NETDETECTSAMEIP = "InvalidParameterValue.NetDetectSameIp" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" -func (c *Client) ModifyNetDetectWithContext(ctx context.Context, request *ModifyNetDetectRequest) (response *ModifyNetDetectResponse, err error) { - if request == nil { - request = NewModifyNetDetectRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNetDetect require credential") - } - - request.SetContext(ctx) - - response = NewModifyNetDetectResponse() - err = c.Send(request, response) - return -} - -func NewModifyNetworkAclAttributeRequest() (request *ModifyNetworkAclAttributeRequest) { - request = &ModifyNetworkAclAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetworkAclAttribute") - - return -} - -func NewModifyNetworkAclAttributeResponse() (response *ModifyNetworkAclAttributeResponse) { - response = &ModifyNetworkAclAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNetworkAclAttribute -// 本接口(ModifyNetworkAclAttribute)用于修改网络ACL属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyNetworkAclAttribute(request *ModifyNetworkAclAttributeRequest) (response *ModifyNetworkAclAttributeResponse, err error) { - return c.ModifyNetworkAclAttributeWithContext(context.Background(), request) -} - -// ModifyNetworkAclAttribute -// 本接口(ModifyNetworkAclAttribute)用于修改网络ACL属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyNetworkAclAttributeWithContext(ctx context.Context, request *ModifyNetworkAclAttributeRequest) (response *ModifyNetworkAclAttributeResponse, err error) { - if request == nil { - request = NewModifyNetworkAclAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNetworkAclAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyNetworkAclAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyNetworkAclEntriesRequest() (request *ModifyNetworkAclEntriesRequest) { - request = &ModifyNetworkAclEntriesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetworkAclEntries") - - return -} - -func NewModifyNetworkAclEntriesResponse() (response *ModifyNetworkAclEntriesResponse) { - response = &ModifyNetworkAclEntriesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNetworkAclEntries -// 本接口(ModifyNetworkAclEntries)用于修改(包括添加和删除)网络ACL的入站规则和出站规则。在NetworkAclEntrySet参数中: -// -// * 若同时传入入站规则和出站规则,则重置原有的入站规则和出站规则,并分别导入传入的规则。 -// -// * 若仅传入入站规则,则仅重置原有的入站规则,并导入传入的规则,不影响原有的出站规则(若仅传入出站规则,处理方式类似入站方向)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_ACLTYPEMISMATCH = "InvalidParameter.AclTypeMismatch" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) ModifyNetworkAclEntries(request *ModifyNetworkAclEntriesRequest) (response *ModifyNetworkAclEntriesResponse, err error) { - return c.ModifyNetworkAclEntriesWithContext(context.Background(), request) -} - -// ModifyNetworkAclEntries -// 本接口(ModifyNetworkAclEntries)用于修改(包括添加和删除)网络ACL的入站规则和出站规则。在NetworkAclEntrySet参数中: -// -// * 若同时传入入站规则和出站规则,则重置原有的入站规则和出站规则,并分别导入传入的规则。 -// -// * 若仅传入入站规则,则仅重置原有的入站规则,并导入传入的规则,不影响原有的出站规则(若仅传入出站规则,处理方式类似入站方向)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_ACLTYPEMISMATCH = "InvalidParameter.AclTypeMismatch" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) ModifyNetworkAclEntriesWithContext(ctx context.Context, request *ModifyNetworkAclEntriesRequest) (response *ModifyNetworkAclEntriesResponse, err error) { - if request == nil { - request = NewModifyNetworkAclEntriesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNetworkAclEntries require credential") - } - - request.SetContext(ctx) - - response = NewModifyNetworkAclEntriesResponse() - err = c.Send(request, response) - return -} - -func NewModifyNetworkAclQuintupleEntriesRequest() (request *ModifyNetworkAclQuintupleEntriesRequest) { - request = &ModifyNetworkAclQuintupleEntriesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetworkAclQuintupleEntries") - - return -} - -func NewModifyNetworkAclQuintupleEntriesResponse() (response *ModifyNetworkAclQuintupleEntriesResponse) { - response = &ModifyNetworkAclQuintupleEntriesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNetworkAclQuintupleEntries -// 本接口(ModifyNetworkAclQuintupleEntries)用于修改网络ACL五元组的入站规则和出站规则。在NetworkAclQuintupleEntrySet参数中:NetworkAclQuintupleEntry需要提供NetworkAclQuintupleEntryId。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) ModifyNetworkAclQuintupleEntries(request *ModifyNetworkAclQuintupleEntriesRequest) (response *ModifyNetworkAclQuintupleEntriesResponse, err error) { - return c.ModifyNetworkAclQuintupleEntriesWithContext(context.Background(), request) -} - -// ModifyNetworkAclQuintupleEntries -// 本接口(ModifyNetworkAclQuintupleEntries)用于修改网络ACL五元组的入站规则和出站规则。在NetworkAclQuintupleEntrySet参数中:NetworkAclQuintupleEntry需要提供NetworkAclQuintupleEntryId。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" -func (c *Client) ModifyNetworkAclQuintupleEntriesWithContext(ctx context.Context, request *ModifyNetworkAclQuintupleEntriesRequest) (response *ModifyNetworkAclQuintupleEntriesResponse, err error) { - if request == nil { - request = NewModifyNetworkAclQuintupleEntriesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNetworkAclQuintupleEntries require credential") - } - - request.SetContext(ctx) - - response = NewModifyNetworkAclQuintupleEntriesResponse() - err = c.Send(request, response) - return -} - -func NewModifyNetworkInterfaceAttributeRequest() (request *ModifyNetworkInterfaceAttributeRequest) { - request = &ModifyNetworkInterfaceAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetworkInterfaceAttribute") - - return -} - -func NewModifyNetworkInterfaceAttributeResponse() (response *ModifyNetworkInterfaceAttributeResponse) { - response = &ModifyNetworkInterfaceAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNetworkInterfaceAttribute -// 本接口(ModifyNetworkInterfaceAttribute)用于修改弹性网卡属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_SUBENINOTSUPPORTTRUNKING = "UnsupportedOperation.SubEniNotSupportTrunking" -func (c *Client) ModifyNetworkInterfaceAttribute(request *ModifyNetworkInterfaceAttributeRequest) (response *ModifyNetworkInterfaceAttributeResponse, err error) { - return c.ModifyNetworkInterfaceAttributeWithContext(context.Background(), request) -} - -// ModifyNetworkInterfaceAttribute -// 本接口(ModifyNetworkInterfaceAttribute)用于修改弹性网卡属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_SUBENINOTSUPPORTTRUNKING = "UnsupportedOperation.SubEniNotSupportTrunking" -func (c *Client) ModifyNetworkInterfaceAttributeWithContext(ctx context.Context, request *ModifyNetworkInterfaceAttributeRequest) (response *ModifyNetworkInterfaceAttributeResponse, err error) { - if request == nil { - request = NewModifyNetworkInterfaceAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNetworkInterfaceAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyNetworkInterfaceAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyNetworkInterfaceQosRequest() (request *ModifyNetworkInterfaceQosRequest) { - request = &ModifyNetworkInterfaceQosRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetworkInterfaceQos") - - return -} - -func NewModifyNetworkInterfaceQosResponse() (response *ModifyNetworkInterfaceQosResponse) { - response = &ModifyNetworkInterfaceQosResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyNetworkInterfaceQos -// 本接口(ModifyNetworkInterfaceQos)用于修改弹性网卡服务质量。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyNetworkInterfaceQos(request *ModifyNetworkInterfaceQosRequest) (response *ModifyNetworkInterfaceQosResponse, err error) { - return c.ModifyNetworkInterfaceQosWithContext(context.Background(), request) -} - -// ModifyNetworkInterfaceQos -// 本接口(ModifyNetworkInterfaceQos)用于修改弹性网卡服务质量。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyNetworkInterfaceQosWithContext(ctx context.Context, request *ModifyNetworkInterfaceQosRequest) (response *ModifyNetworkInterfaceQosResponse, err error) { - if request == nil { - request = NewModifyNetworkInterfaceQosRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyNetworkInterfaceQos require credential") - } - - request.SetContext(ctx) - - response = NewModifyNetworkInterfaceQosResponse() - err = c.Send(request, response) - return -} - -func NewModifyPrivateIpAddressesAttributeRequest() (request *ModifyPrivateIpAddressesAttributeRequest) { - request = &ModifyPrivateIpAddressesAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyPrivateIpAddressesAttribute") - - return -} - -func NewModifyPrivateIpAddressesAttributeResponse() (response *ModifyPrivateIpAddressesAttributeResponse) { - response = &ModifyPrivateIpAddressesAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyPrivateIpAddressesAttribute -// 本接口(ModifyPrivateIpAddressesAttribute)用于修改弹性网卡内网IP属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ModifyPrivateIpAddressesAttribute(request *ModifyPrivateIpAddressesAttributeRequest) (response *ModifyPrivateIpAddressesAttributeResponse, err error) { - return c.ModifyPrivateIpAddressesAttributeWithContext(context.Background(), request) -} - -// ModifyPrivateIpAddressesAttribute -// 本接口(ModifyPrivateIpAddressesAttribute)用于修改弹性网卡内网IP属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ModifyPrivateIpAddressesAttributeWithContext(ctx context.Context, request *ModifyPrivateIpAddressesAttributeRequest) (response *ModifyPrivateIpAddressesAttributeResponse, err error) { - if request == nil { - request = NewModifyPrivateIpAddressesAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyPrivateIpAddressesAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyPrivateIpAddressesAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyRouteTableAttributeRequest() (request *ModifyRouteTableAttributeRequest) { - request = &ModifyRouteTableAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyRouteTableAttribute") - - return -} - -func NewModifyRouteTableAttributeResponse() (response *ModifyRouteTableAttributeResponse) { - response = &ModifyRouteTableAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyRouteTableAttribute -// 本接口(ModifyRouteTableAttribute)用于修改路由表(RouteTable)属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyRouteTableAttribute(request *ModifyRouteTableAttributeRequest) (response *ModifyRouteTableAttributeResponse, err error) { - return c.ModifyRouteTableAttributeWithContext(context.Background(), request) -} - -// ModifyRouteTableAttribute -// 本接口(ModifyRouteTableAttribute)用于修改路由表(RouteTable)属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyRouteTableAttributeWithContext(ctx context.Context, request *ModifyRouteTableAttributeRequest) (response *ModifyRouteTableAttributeResponse, err error) { - if request == nil { - request = NewModifyRouteTableAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyRouteTableAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyRouteTableAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifySecurityGroupAttributeRequest() (request *ModifySecurityGroupAttributeRequest) { - request = &ModifySecurityGroupAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifySecurityGroupAttribute") - - return -} - -func NewModifySecurityGroupAttributeResponse() (response *ModifySecurityGroupAttributeResponse) { - response = &ModifySecurityGroupAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifySecurityGroupAttribute -// 本接口(ModifySecurityGroupAttribute)用于修改安全组(SecurityGroupPolicy)属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifySecurityGroupAttribute(request *ModifySecurityGroupAttributeRequest) (response *ModifySecurityGroupAttributeResponse, err error) { - return c.ModifySecurityGroupAttributeWithContext(context.Background(), request) -} - -// ModifySecurityGroupAttribute -// 本接口(ModifySecurityGroupAttribute)用于修改安全组(SecurityGroupPolicy)属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifySecurityGroupAttributeWithContext(ctx context.Context, request *ModifySecurityGroupAttributeRequest) (response *ModifySecurityGroupAttributeResponse, err error) { - if request == nil { - request = NewModifySecurityGroupAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifySecurityGroupAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifySecurityGroupAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifySecurityGroupPoliciesRequest() (request *ModifySecurityGroupPoliciesRequest) { - request = &ModifySecurityGroupPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifySecurityGroupPolicies") - - return -} - -func NewModifySecurityGroupPoliciesResponse() (response *ModifySecurityGroupPoliciesResponse) { - response = &ModifySecurityGroupPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifySecurityGroupPolicies -// 本接口(ModifySecurityGroupPolicies)用于重置安全组出站和入站规则(SecurityGroupPolicy)。 -// -//
      -// -//
    • 该接口不支持自定义索引 PolicyIndex。
    • -// -//
    • 在 SecurityGroupPolicySet 参数中:
        -// -//
      • 如果指定 SecurityGroupPolicySet.Version 为0, 表示清空所有规则,并忽略 Egress 和 Ingress。
      • -// -//
      • 如果指定 SecurityGroupPolicySet.Version 不为0, 在添加出站和入站规则(Egress 和 Ingress)时:
          -// -//
        • Protocol 字段支持输入 TCP, UDP, ICMP, ICMPV6, GRE, ALL。
        • -// -//
        • CidrBlock 字段允许输入符合 cidr 格式标准的任意字符串。(展开)在基础网络中,如果 CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
        • -// -//
        • Ipv6CidrBlock 字段允许输入符合 IPv6 cidr 格式标准的任意字符串。(展开)在基础网络中,如果Ipv6CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
        • -// -//
        • SecurityGroupId 字段允许输入与待修改的安全组位于相同项目中的安全组 ID,包括这个安全组 ID 本身,代表安全组下所有云服务器的内网 IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个ID所关联的云服务器变化而变化,不需要重新修改。
        • -// -//
        • Port 字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当 Protocol 字段是 TCP 或 UDP 时,Port 字段才被接受。
        • -// -//
        • Action 字段只允许输入 ACCEPT 或 DROP。
        • -// -//
        • CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate 四者是排他关系,不允许同时输入,Protocol + Port 和 ServiceTemplate 二者是排他关系,不允许同时输入。
        • -// -//
    • -// -//
    -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -func (c *Client) ModifySecurityGroupPolicies(request *ModifySecurityGroupPoliciesRequest) (response *ModifySecurityGroupPoliciesResponse, err error) { - return c.ModifySecurityGroupPoliciesWithContext(context.Background(), request) -} - -// ModifySecurityGroupPolicies -// 本接口(ModifySecurityGroupPolicies)用于重置安全组出站和入站规则(SecurityGroupPolicy)。 -// -//
      -// -//
    • 该接口不支持自定义索引 PolicyIndex。
    • -// -//
    • 在 SecurityGroupPolicySet 参数中:
        -// -//
      • 如果指定 SecurityGroupPolicySet.Version 为0, 表示清空所有规则,并忽略 Egress 和 Ingress。
      • -// -//
      • 如果指定 SecurityGroupPolicySet.Version 不为0, 在添加出站和入站规则(Egress 和 Ingress)时:
          -// -//
        • Protocol 字段支持输入 TCP, UDP, ICMP, ICMPV6, GRE, ALL。
        • -// -//
        • CidrBlock 字段允许输入符合 cidr 格式标准的任意字符串。(展开)在基础网络中,如果 CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
        • -// -//
        • Ipv6CidrBlock 字段允许输入符合 IPv6 cidr 格式标准的任意字符串。(展开)在基础网络中,如果Ipv6CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。
        • -// -//
        • SecurityGroupId 字段允许输入与待修改的安全组位于相同项目中的安全组 ID,包括这个安全组 ID 本身,代表安全组下所有云服务器的内网 IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个ID所关联的云服务器变化而变化,不需要重新修改。
        • -// -//
        • Port 字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当 Protocol 字段是 TCP 或 UDP 时,Port 字段才被接受。
        • -// -//
        • Action 字段只允许输入 ACCEPT 或 DROP。
        • -// -//
        • CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate 四者是排他关系,不允许同时输入,Protocol + Port 和 ServiceTemplate 二者是排他关系,不允许同时输入。
        • -// -//
    • -// -//
    -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -func (c *Client) ModifySecurityGroupPoliciesWithContext(ctx context.Context, request *ModifySecurityGroupPoliciesRequest) (response *ModifySecurityGroupPoliciesResponse, err error) { - if request == nil { - request = NewModifySecurityGroupPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifySecurityGroupPolicies require credential") - } - - request.SetContext(ctx) - - response = NewModifySecurityGroupPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewModifyServiceTemplateAttributeRequest() (request *ModifyServiceTemplateAttributeRequest) { - request = &ModifyServiceTemplateAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyServiceTemplateAttribute") - - return -} - -func NewModifyServiceTemplateAttributeResponse() (response *ModifyServiceTemplateAttributeResponse) { - response = &ModifyServiceTemplateAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyServiceTemplateAttribute -// 本接口(ModifyServiceTemplateAttribute)用于修改协议端口模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyServiceTemplateAttribute(request *ModifyServiceTemplateAttributeRequest) (response *ModifyServiceTemplateAttributeResponse, err error) { - return c.ModifyServiceTemplateAttributeWithContext(context.Background(), request) -} - -// ModifyServiceTemplateAttribute -// 本接口(ModifyServiceTemplateAttribute)用于修改协议端口模板。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyServiceTemplateAttributeWithContext(ctx context.Context, request *ModifyServiceTemplateAttributeRequest) (response *ModifyServiceTemplateAttributeResponse, err error) { - if request == nil { - request = NewModifyServiceTemplateAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyServiceTemplateAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyServiceTemplateAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyServiceTemplateGroupAttributeRequest() (request *ModifyServiceTemplateGroupAttributeRequest) { - request = &ModifyServiceTemplateGroupAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyServiceTemplateGroupAttribute") - - return -} - -func NewModifyServiceTemplateGroupAttributeResponse() (response *ModifyServiceTemplateGroupAttributeResponse) { - response = &ModifyServiceTemplateGroupAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyServiceTemplateGroupAttribute -// 本接口(ModifyServiceTemplateGroupAttribute)用于修改协议端口模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyServiceTemplateGroupAttribute(request *ModifyServiceTemplateGroupAttributeRequest) (response *ModifyServiceTemplateGroupAttributeResponse, err error) { - return c.ModifyServiceTemplateGroupAttributeWithContext(context.Background(), request) -} - -// ModifyServiceTemplateGroupAttribute -// 本接口(ModifyServiceTemplateGroupAttribute)用于修改协议端口模板集合。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyServiceTemplateGroupAttributeWithContext(ctx context.Context, request *ModifyServiceTemplateGroupAttributeRequest) (response *ModifyServiceTemplateGroupAttributeResponse, err error) { - if request == nil { - request = NewModifyServiceTemplateGroupAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyServiceTemplateGroupAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyServiceTemplateGroupAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifySnapshotPoliciesRequest() (request *ModifySnapshotPoliciesRequest) { - request = &ModifySnapshotPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifySnapshotPolicies") - - return -} - -func NewModifySnapshotPoliciesResponse() (response *ModifySnapshotPoliciesResponse) { - response = &ModifySnapshotPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifySnapshotPolicies -// 本接口(ModifySnapshotPolicies)用于修改快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTBACKUPTYPEMODIFY = "UnsupportedOperation.SnapshotBackupTypeModify" -func (c *Client) ModifySnapshotPolicies(request *ModifySnapshotPoliciesRequest) (response *ModifySnapshotPoliciesResponse, err error) { - return c.ModifySnapshotPoliciesWithContext(context.Background(), request) -} - -// ModifySnapshotPolicies -// 本接口(ModifySnapshotPolicies)用于修改快照策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_SNAPSHOTBACKUPTYPEMODIFY = "UnsupportedOperation.SnapshotBackupTypeModify" -func (c *Client) ModifySnapshotPoliciesWithContext(ctx context.Context, request *ModifySnapshotPoliciesRequest) (response *ModifySnapshotPoliciesResponse, err error) { - if request == nil { - request = NewModifySnapshotPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifySnapshotPolicies require credential") - } - - request.SetContext(ctx) - - response = NewModifySnapshotPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewModifySubnetAttributeRequest() (request *ModifySubnetAttributeRequest) { - request = &ModifySubnetAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifySubnetAttribute") - - return -} - -func NewModifySubnetAttributeResponse() (response *ModifySubnetAttributeResponse) { - response = &ModifySubnetAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifySubnetAttribute -// 本接口(ModifySubnetAttribute)用于修改子网属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifySubnetAttribute(request *ModifySubnetAttributeRequest) (response *ModifySubnetAttributeResponse, err error) { - return c.ModifySubnetAttributeWithContext(context.Background(), request) -} - -// ModifySubnetAttribute -// 本接口(ModifySubnetAttribute)用于修改子网属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifySubnetAttributeWithContext(ctx context.Context, request *ModifySubnetAttributeRequest) (response *ModifySubnetAttributeResponse, err error) { - if request == nil { - request = NewModifySubnetAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifySubnetAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifySubnetAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyTemplateMemberRequest() (request *ModifyTemplateMemberRequest) { - request = &ModifyTemplateMemberRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyTemplateMember") - - return -} - -func NewModifyTemplateMemberResponse() (response *ModifyTemplateMemberResponse) { - response = &ModifyTemplateMemberResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyTemplateMember -// 修改模板对象中的IP地址、协议端口、IP地址组、协议端口组。当前仅支持北京、泰国、北美地域请求。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyTemplateMember(request *ModifyTemplateMemberRequest) (response *ModifyTemplateMemberResponse, err error) { - return c.ModifyTemplateMemberWithContext(context.Background(), request) -} - -// ModifyTemplateMember -// 修改模板对象中的IP地址、协议端口、IP地址组、协议端口组。当前仅支持北京、泰国、北美地域请求。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) ModifyTemplateMemberWithContext(ctx context.Context, request *ModifyTemplateMemberRequest) (response *ModifyTemplateMemberResponse, err error) { - if request == nil { - request = NewModifyTemplateMemberRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyTemplateMember require credential") - } - - request.SetContext(ctx) - - response = NewModifyTemplateMemberResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpcAttributeRequest() (request *ModifyVpcAttributeRequest) { - request = &ModifyVpcAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpcAttribute") - - return -} - -func NewModifyVpcAttributeResponse() (response *ModifyVpcAttributeResponse) { - response = &ModifyVpcAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpcAttribute -// 本接口(ModifyVpcAttribute)用于修改私有网络(VPC)的相关属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION_ENABLEMULTICAST = "UnsupportedOperation.EnableMulticast" -// UNSUPPORTEDOPERATION_NOTSUPPORTEDUPDATECCNROUTEPUBLISH = "UnsupportedOperation.NotSupportedUpdateCcnRoutePublish" -func (c *Client) ModifyVpcAttribute(request *ModifyVpcAttributeRequest) (response *ModifyVpcAttributeResponse, err error) { - return c.ModifyVpcAttributeWithContext(context.Background(), request) -} - -// ModifyVpcAttribute -// 本接口(ModifyVpcAttribute)用于修改私有网络(VPC)的相关属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION_ENABLEMULTICAST = "UnsupportedOperation.EnableMulticast" -// UNSUPPORTEDOPERATION_NOTSUPPORTEDUPDATECCNROUTEPUBLISH = "UnsupportedOperation.NotSupportedUpdateCcnRoutePublish" -func (c *Client) ModifyVpcAttributeWithContext(ctx context.Context, request *ModifyVpcAttributeRequest) (response *ModifyVpcAttributeResponse, err error) { - if request == nil { - request = NewModifyVpcAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpcAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpcAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpcEndPointAttributeRequest() (request *ModifyVpcEndPointAttributeRequest) { - request = &ModifyVpcEndPointAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpcEndPointAttribute") - - return -} - -func NewModifyVpcEndPointAttributeResponse() (response *ModifyVpcEndPointAttributeResponse) { - response = &ModifyVpcEndPointAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpcEndPointAttribute -// 本接口(ModifyVpcEndPointAttribute)用于修改终端节点属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCENOTFOUND_SVCNOTEXIST = "ResourceNotFound.SvcNotExist" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_SPECIALENDPOINTSERVICE = "UnsupportedOperation.SpecialEndPointService" -func (c *Client) ModifyVpcEndPointAttribute(request *ModifyVpcEndPointAttributeRequest) (response *ModifyVpcEndPointAttributeResponse, err error) { - return c.ModifyVpcEndPointAttributeWithContext(context.Background(), request) -} - -// ModifyVpcEndPointAttribute -// 本接口(ModifyVpcEndPointAttribute)用于修改终端节点属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCENOTFOUND_SVCNOTEXIST = "ResourceNotFound.SvcNotExist" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_SPECIALENDPOINTSERVICE = "UnsupportedOperation.SpecialEndPointService" -func (c *Client) ModifyVpcEndPointAttributeWithContext(ctx context.Context, request *ModifyVpcEndPointAttributeRequest) (response *ModifyVpcEndPointAttributeResponse, err error) { - if request == nil { - request = NewModifyVpcEndPointAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpcEndPointAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpcEndPointAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpcEndPointServiceAttributeRequest() (request *ModifyVpcEndPointServiceAttributeRequest) { - request = &ModifyVpcEndPointServiceAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpcEndPointServiceAttribute") - - return -} - -func NewModifyVpcEndPointServiceAttributeResponse() (response *ModifyVpcEndPointServiceAttributeResponse) { - response = &ModifyVpcEndPointServiceAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpcEndPointServiceAttribute -// 本接口(ModifyVpcEndPointServiceAttribute)用于修改终端节点服务属性。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) ModifyVpcEndPointServiceAttribute(request *ModifyVpcEndPointServiceAttributeRequest) (response *ModifyVpcEndPointServiceAttributeResponse, err error) { - return c.ModifyVpcEndPointServiceAttributeWithContext(context.Background(), request) -} - -// ModifyVpcEndPointServiceAttribute -// 本接口(ModifyVpcEndPointServiceAttribute)用于修改终端节点服务属性。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) ModifyVpcEndPointServiceAttributeWithContext(ctx context.Context, request *ModifyVpcEndPointServiceAttributeRequest) (response *ModifyVpcEndPointServiceAttributeResponse, err error) { - if request == nil { - request = NewModifyVpcEndPointServiceAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpcEndPointServiceAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpcEndPointServiceAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpcEndPointServiceWhiteListRequest() (request *ModifyVpcEndPointServiceWhiteListRequest) { - request = &ModifyVpcEndPointServiceWhiteListRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpcEndPointServiceWhiteList") - - return -} - -func NewModifyVpcEndPointServiceWhiteListResponse() (response *ModifyVpcEndPointServiceWhiteListResponse) { - response = &ModifyVpcEndPointServiceWhiteListResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpcEndPointServiceWhiteList -// 本接口(ModifyVpcEndPointServiceWhiteList)用于修改终端节点服务白名单属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) ModifyVpcEndPointServiceWhiteList(request *ModifyVpcEndPointServiceWhiteListRequest) (response *ModifyVpcEndPointServiceWhiteListResponse, err error) { - return c.ModifyVpcEndPointServiceWhiteListWithContext(context.Background(), request) -} - -// ModifyVpcEndPointServiceWhiteList -// 本接口(ModifyVpcEndPointServiceWhiteList)用于修改终端节点服务白名单属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) ModifyVpcEndPointServiceWhiteListWithContext(ctx context.Context, request *ModifyVpcEndPointServiceWhiteListRequest) (response *ModifyVpcEndPointServiceWhiteListResponse, err error) { - if request == nil { - request = NewModifyVpcEndPointServiceWhiteListRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpcEndPointServiceWhiteList require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpcEndPointServiceWhiteListResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpcPeeringConnectionRequest() (request *ModifyVpcPeeringConnectionRequest) { - request = &ModifyVpcPeeringConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpcPeeringConnection") - - return -} - -func NewModifyVpcPeeringConnectionResponse() (response *ModifyVpcPeeringConnectionResponse) { - response = &ModifyVpcPeeringConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpcPeeringConnection -// 本接口(ModifyVpcPeeringConnection)用于修改私有网络对等连接属性。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_DUPLICATEREGION = "InvalidParameterValue.DuplicateRegion" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_VPCPEERAVALIMITEXCEEDED = "LimitExceeded.VpcPeerAvaLimitExceeded" -// LIMITEXCEEDED_VPCPEERTOTALLIMITEXCEEDED = "LimitExceeded.VpcPeerTotalLimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_VPCPEERCIDRCONFLICT = "UnauthorizedOperation.VpcPeerCidrConflict" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_PURCHASELIMIT = "UnsupportedOperation.PurchaseLimit" -// UNSUPPORTEDOPERATION_VPCPEERALREADYEXIST = "UnsupportedOperation.VpcPeerAlreadyExist" -// UNSUPPORTEDOPERATION_VPCPEERCIDRCONFLICT = "UnsupportedOperation.VpcPeerCidrConflict" -func (c *Client) ModifyVpcPeeringConnection(request *ModifyVpcPeeringConnectionRequest) (response *ModifyVpcPeeringConnectionResponse, err error) { - return c.ModifyVpcPeeringConnectionWithContext(context.Background(), request) -} - -// ModifyVpcPeeringConnection -// 本接口(ModifyVpcPeeringConnection)用于修改私有网络对等连接属性。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" -// INVALIDPARAMETERVALUE_DUPLICATEREGION = "InvalidParameterValue.DuplicateRegion" -// INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_VPCPEERAVALIMITEXCEEDED = "LimitExceeded.VpcPeerAvaLimitExceeded" -// LIMITEXCEEDED_VPCPEERTOTALLIMITEXCEEDED = "LimitExceeded.VpcPeerTotalLimitExceeded" -// MISSINGPARAMETER = "MissingParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_VPCPEERCIDRCONFLICT = "UnauthorizedOperation.VpcPeerCidrConflict" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_PURCHASELIMIT = "UnsupportedOperation.PurchaseLimit" -// UNSUPPORTEDOPERATION_VPCPEERALREADYEXIST = "UnsupportedOperation.VpcPeerAlreadyExist" -// UNSUPPORTEDOPERATION_VPCPEERCIDRCONFLICT = "UnsupportedOperation.VpcPeerCidrConflict" -func (c *Client) ModifyVpcPeeringConnectionWithContext(ctx context.Context, request *ModifyVpcPeeringConnectionRequest) (response *ModifyVpcPeeringConnectionResponse, err error) { - if request == nil { - request = NewModifyVpcPeeringConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpcPeeringConnection require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpcPeeringConnectionResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpnConnectionAttributeRequest() (request *ModifyVpnConnectionAttributeRequest) { - request = &ModifyVpnConnectionAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpnConnectionAttribute") - - return -} - -func NewModifyVpnConnectionAttributeResponse() (response *ModifyVpnConnectionAttributeResponse) { - response = &ModifyVpnConnectionAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpnConnectionAttribute -// 本接口(ModifyVpnConnectionAttribute)用于修改VPN通道。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_VPNCONNCIDRCONFLICT = "InvalidParameterValue.VpnConnCidrConflict" -// INVALIDPARAMETERVALUE_VPNCONNHEALTHCHECKIPCONFLICT = "InvalidParameterValue.VpnConnHealthCheckIpConflict" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_VPNCONNINVALIDSTATE = "UnsupportedOperation.VpnConnInvalidState" -func (c *Client) ModifyVpnConnectionAttribute(request *ModifyVpnConnectionAttributeRequest) (response *ModifyVpnConnectionAttributeResponse, err error) { - return c.ModifyVpnConnectionAttributeWithContext(context.Background(), request) -} - -// ModifyVpnConnectionAttribute -// 本接口(ModifyVpnConnectionAttribute)用于修改VPN通道。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_VPNCONNCIDRCONFLICT = "InvalidParameterValue.VpnConnCidrConflict" -// INVALIDPARAMETERVALUE_VPNCONNHEALTHCHECKIPCONFLICT = "InvalidParameterValue.VpnConnHealthCheckIpConflict" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_VPNCONNINVALIDSTATE = "UnsupportedOperation.VpnConnInvalidState" -func (c *Client) ModifyVpnConnectionAttributeWithContext(ctx context.Context, request *ModifyVpnConnectionAttributeRequest) (response *ModifyVpnConnectionAttributeResponse, err error) { - if request == nil { - request = NewModifyVpnConnectionAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpnConnectionAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpnConnectionAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpnGatewayAttributeRequest() (request *ModifyVpnGatewayAttributeRequest) { - request = &ModifyVpnGatewayAttributeRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpnGatewayAttribute") - - return -} - -func NewModifyVpnGatewayAttributeResponse() (response *ModifyVpnGatewayAttributeResponse) { - response = &ModifyVpnGatewayAttributeResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpnGatewayAttribute -// 本接口(ModifyVpnGatewayAttribute)用于修改VPN网关属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ModifyVpnGatewayAttribute(request *ModifyVpnGatewayAttributeRequest) (response *ModifyVpnGatewayAttributeResponse, err error) { - return c.ModifyVpnGatewayAttributeWithContext(context.Background(), request) -} - -// ModifyVpnGatewayAttribute -// 本接口(ModifyVpnGatewayAttribute)用于修改VPN网关属性。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ModifyVpnGatewayAttributeWithContext(ctx context.Context, request *ModifyVpnGatewayAttributeRequest) (response *ModifyVpnGatewayAttributeResponse, err error) { - if request == nil { - request = NewModifyVpnGatewayAttributeRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpnGatewayAttribute require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpnGatewayAttributeResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpnGatewayCcnRoutesRequest() (request *ModifyVpnGatewayCcnRoutesRequest) { - request = &ModifyVpnGatewayCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpnGatewayCcnRoutes") - - return -} - -func NewModifyVpnGatewayCcnRoutesResponse() (response *ModifyVpnGatewayCcnRoutesResponse) { - response = &ModifyVpnGatewayCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpnGatewayCcnRoutes -// 本接口(ModifyVpnGatewayCcnRoutes)用于修改VPN网关云联网路由。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyVpnGatewayCcnRoutes(request *ModifyVpnGatewayCcnRoutesRequest) (response *ModifyVpnGatewayCcnRoutesResponse, err error) { - return c.ModifyVpnGatewayCcnRoutesWithContext(context.Background(), request) -} - -// ModifyVpnGatewayCcnRoutes -// 本接口(ModifyVpnGatewayCcnRoutes)用于修改VPN网关云联网路由。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ModifyVpnGatewayCcnRoutesWithContext(ctx context.Context, request *ModifyVpnGatewayCcnRoutesRequest) (response *ModifyVpnGatewayCcnRoutesResponse, err error) { - if request == nil { - request = NewModifyVpnGatewayCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpnGatewayCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpnGatewayCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewModifyVpnGatewayRoutesRequest() (request *ModifyVpnGatewayRoutesRequest) { - request = &ModifyVpnGatewayRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpnGatewayRoutes") - - return -} - -func NewModifyVpnGatewayRoutesResponse() (response *ModifyVpnGatewayRoutesResponse) { - response = &ModifyVpnGatewayRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ModifyVpnGatewayRoutes -// 本接口(ModifyVpnGatewayRoutes)用于修改VPN路由是否启用。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) ModifyVpnGatewayRoutes(request *ModifyVpnGatewayRoutesRequest) (response *ModifyVpnGatewayRoutesResponse, err error) { - return c.ModifyVpnGatewayRoutesWithContext(context.Background(), request) -} - -// ModifyVpnGatewayRoutes -// 本接口(ModifyVpnGatewayRoutes)用于修改VPN路由是否启用。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETER = "InvalidParameter" -// RESOURCENOTFOUND = "ResourceNotFound" -// RESOURCEUNAVAILABLE = "ResourceUnavailable" -// UNKNOWNPARAMETER = "UnknownParameter" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -func (c *Client) ModifyVpnGatewayRoutesWithContext(ctx context.Context, request *ModifyVpnGatewayRoutesRequest) (response *ModifyVpnGatewayRoutesResponse, err error) { - if request == nil { - request = NewModifyVpnGatewayRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ModifyVpnGatewayRoutes require credential") - } - - request.SetContext(ctx) - - response = NewModifyVpnGatewayRoutesResponse() - err = c.Send(request, response) - return -} - -func NewNotifyRoutesRequest() (request *NotifyRoutesRequest) { - request = &NotifyRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "NotifyRoutes") - - return -} - -func NewNotifyRoutesResponse() (response *NotifyRoutesResponse) { - response = &NotifyRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// NotifyRoutes -// 本接口(NotifyRoutes)用于路由表列表页操作增加“发布到云联网”,发布路由到云联网。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDROUTEID_NOTFOUND = "InvalidRouteId.NotFound" -// INVALIDROUTETABLEID_MALFORMED = "InvalidRouteTableId.Malformed" -// INVALIDROUTETABLEID_NOTFOUND = "InvalidRouteTableId.NotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_ASSOCIATEDVPCOFCCNHADNATROUTE = "UnsupportedOperation.AssociatedVpcOfCcnHadNatRoute" -// UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" -// UNSUPPORTEDOPERATION_INVALIDSTATUSNOTIFYCCN = "UnsupportedOperation.InvalidStatusNotifyCcn" -// UNSUPPORTEDOPERATION_NOTIFYCCN = "UnsupportedOperation.NotifyCcn" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) NotifyRoutes(request *NotifyRoutesRequest) (response *NotifyRoutesResponse, err error) { - return c.NotifyRoutesWithContext(context.Background(), request) -} - -// NotifyRoutes -// 本接口(NotifyRoutes)用于路由表列表页操作增加“发布到云联网”,发布路由到云联网。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDROUTEID_NOTFOUND = "InvalidRouteId.NotFound" -// INVALIDROUTETABLEID_MALFORMED = "InvalidRouteTableId.Malformed" -// INVALIDROUTETABLEID_NOTFOUND = "InvalidRouteTableId.NotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_ASSOCIATEDVPCOFCCNHADNATROUTE = "UnsupportedOperation.AssociatedVpcOfCcnHadNatRoute" -// UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" -// UNSUPPORTEDOPERATION_INVALIDSTATUSNOTIFYCCN = "UnsupportedOperation.InvalidStatusNotifyCcn" -// UNSUPPORTEDOPERATION_NOTIFYCCN = "UnsupportedOperation.NotifyCcn" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) NotifyRoutesWithContext(ctx context.Context, request *NotifyRoutesRequest) (response *NotifyRoutesResponse, err error) { - if request == nil { - request = NewNotifyRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("NotifyRoutes require credential") - } - - request.SetContext(ctx) - - response = NewNotifyRoutesResponse() - err = c.Send(request, response) - return -} - -func NewRefreshDirectConnectGatewayRouteToNatGatewayRequest() (request *RefreshDirectConnectGatewayRouteToNatGatewayRequest) { - request = &RefreshDirectConnectGatewayRouteToNatGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "RefreshDirectConnectGatewayRouteToNatGateway") - - return -} - -func NewRefreshDirectConnectGatewayRouteToNatGatewayResponse() (response *RefreshDirectConnectGatewayRouteToNatGatewayResponse) { - response = &RefreshDirectConnectGatewayRouteToNatGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RefreshDirectConnectGatewayRouteToNatGateway -// 刷新专线直连nat路由,更新nat到专线的路由表 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -func (c *Client) RefreshDirectConnectGatewayRouteToNatGateway(request *RefreshDirectConnectGatewayRouteToNatGatewayRequest) (response *RefreshDirectConnectGatewayRouteToNatGatewayResponse, err error) { - return c.RefreshDirectConnectGatewayRouteToNatGatewayWithContext(context.Background(), request) -} - -// RefreshDirectConnectGatewayRouteToNatGateway -// 刷新专线直连nat路由,更新nat到专线的路由表 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -func (c *Client) RefreshDirectConnectGatewayRouteToNatGatewayWithContext(ctx context.Context, request *RefreshDirectConnectGatewayRouteToNatGatewayRequest) (response *RefreshDirectConnectGatewayRouteToNatGatewayResponse, err error) { - if request == nil { - request = NewRefreshDirectConnectGatewayRouteToNatGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RefreshDirectConnectGatewayRouteToNatGateway require credential") - } - - request.SetContext(ctx) - - response = NewRefreshDirectConnectGatewayRouteToNatGatewayResponse() - err = c.Send(request, response) - return -} - -func NewRejectAttachCcnInstancesRequest() (request *RejectAttachCcnInstancesRequest) { - request = &RejectAttachCcnInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "RejectAttachCcnInstances") - - return -} - -func NewRejectAttachCcnInstancesResponse() (response *RejectAttachCcnInstancesResponse) { - response = &RejectAttachCcnInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RejectAttachCcnInstances -// 本接口(RejectAttachCcnInstances)用于跨账号关联实例时,云联网所有者拒绝关联操作。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" -// UNSUPPORTEDOPERATION_NOTPENDINGCCNINSTANCE = "UnsupportedOperation.NotPendingCcnInstance" -func (c *Client) RejectAttachCcnInstances(request *RejectAttachCcnInstancesRequest) (response *RejectAttachCcnInstancesResponse, err error) { - return c.RejectAttachCcnInstancesWithContext(context.Background(), request) -} - -// RejectAttachCcnInstances -// 本接口(RejectAttachCcnInstances)用于跨账号关联实例时,云联网所有者拒绝关联操作。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" -// UNSUPPORTEDOPERATION_NOTPENDINGCCNINSTANCE = "UnsupportedOperation.NotPendingCcnInstance" -func (c *Client) RejectAttachCcnInstancesWithContext(ctx context.Context, request *RejectAttachCcnInstancesRequest) (response *RejectAttachCcnInstancesResponse, err error) { - if request == nil { - request = NewRejectAttachCcnInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RejectAttachCcnInstances require credential") - } - - request.SetContext(ctx) - - response = NewRejectAttachCcnInstancesResponse() - err = c.Send(request, response) - return -} - -func NewRejectVpcPeeringConnectionRequest() (request *RejectVpcPeeringConnectionRequest) { - request = &RejectVpcPeeringConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "RejectVpcPeeringConnection") - - return -} - -func NewRejectVpcPeeringConnectionResponse() (response *RejectVpcPeeringConnectionResponse) { - response = &RejectVpcPeeringConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RejectVpcPeeringConnection -// 本接口(RejectVpcPeeringConnection)用于驳回对等连接请求。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_VPCPEERINVALIDSTATECHANGE = "UnsupportedOperation.VpcPeerInvalidStateChange" -// UNSUPPORTEDOPERATION_VPCPEERPURVIEWERROR = "UnsupportedOperation.VpcPeerPurviewError" -func (c *Client) RejectVpcPeeringConnection(request *RejectVpcPeeringConnectionRequest) (response *RejectVpcPeeringConnectionResponse, err error) { - return c.RejectVpcPeeringConnectionWithContext(context.Background(), request) -} - -// RejectVpcPeeringConnection -// 本接口(RejectVpcPeeringConnection)用于驳回对等连接请求。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_VPCPEERINVALIDSTATECHANGE = "UnsupportedOperation.VpcPeerInvalidStateChange" -// UNSUPPORTEDOPERATION_VPCPEERPURVIEWERROR = "UnsupportedOperation.VpcPeerPurviewError" -func (c *Client) RejectVpcPeeringConnectionWithContext(ctx context.Context, request *RejectVpcPeeringConnectionRequest) (response *RejectVpcPeeringConnectionResponse, err error) { - if request == nil { - request = NewRejectVpcPeeringConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RejectVpcPeeringConnection require credential") - } - - request.SetContext(ctx) - - response = NewRejectVpcPeeringConnectionResponse() - err = c.Send(request, response) - return -} - -func NewReleaseAddressesRequest() (request *ReleaseAddressesRequest) { - request = &ReleaseAddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ReleaseAddresses") - - return -} - -func NewReleaseAddressesResponse() (response *ReleaseAddressesResponse) { - response = &ReleaseAddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ReleaseAddresses -// 本接口 (ReleaseAddresses) 用于释放一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 -// -// * 该操作不可逆,释放后 EIP 关联的 IP 地址将不再属于您的名下。 -// -// * 只有状态为 UNBIND 的 EIP 才能进行释放操作。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDADDRESSSTATE = "InvalidAddressState" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSINTERNETCHARGETYPECONFLICT = "InvalidParameterValue.AddressInternetChargeTypeConflict" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_ADDRESSTYPECONFLICT = "InvalidParameterValue.AddressTypeConflict" -// LIMITEXCEEDED_ACCOUNTRETURNQUOTA = "LimitExceeded.AccountReturnQuota" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) ReleaseAddresses(request *ReleaseAddressesRequest) (response *ReleaseAddressesResponse, err error) { - return c.ReleaseAddressesWithContext(context.Background(), request) -} - -// ReleaseAddresses -// 本接口 (ReleaseAddresses) 用于释放一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 -// -// * 该操作不可逆,释放后 EIP 关联的 IP 地址将不再属于您的名下。 -// -// * 只有状态为 UNBIND 的 EIP 才能进行释放操作。 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDADDRESSSTATE = "InvalidAddressState" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSINTERNETCHARGETYPECONFLICT = "InvalidParameterValue.AddressInternetChargeTypeConflict" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// INVALIDPARAMETERVALUE_ADDRESSTYPECONFLICT = "InvalidParameterValue.AddressTypeConflict" -// LIMITEXCEEDED_ACCOUNTRETURNQUOTA = "LimitExceeded.AccountReturnQuota" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) ReleaseAddressesWithContext(ctx context.Context, request *ReleaseAddressesRequest) (response *ReleaseAddressesResponse, err error) { - if request == nil { - request = NewReleaseAddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ReleaseAddresses require credential") - } - - request.SetContext(ctx) - - response = NewReleaseAddressesResponse() - err = c.Send(request, response) - return -} - -func NewReleaseIp6AddressesBandwidthRequest() (request *ReleaseIp6AddressesBandwidthRequest) { - request = &ReleaseIp6AddressesBandwidthRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ReleaseIp6AddressesBandwidth") - - return -} - -func NewReleaseIp6AddressesBandwidthResponse() (response *ReleaseIp6AddressesBandwidthResponse) { - response = &ReleaseIp6AddressesBandwidthResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ReleaseIp6AddressesBandwidth -// 该接口用于给弹性公网IPv6地址释放带宽。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTFOUND = "InvalidParameterValue.AddressIpNotFound" -// INVALIDPARAMETERVALUE_INVALIDIPV6 = "InvalidParameterValue.InvalidIpv6" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -func (c *Client) ReleaseIp6AddressesBandwidth(request *ReleaseIp6AddressesBandwidthRequest) (response *ReleaseIp6AddressesBandwidthResponse, err error) { - return c.ReleaseIp6AddressesBandwidthWithContext(context.Background(), request) -} - -// ReleaseIp6AddressesBandwidth -// 该接口用于给弹性公网IPv6地址释放带宽。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSIPNOTFOUND = "InvalidParameterValue.AddressIpNotFound" -// INVALIDPARAMETERVALUE_INVALIDIPV6 = "InvalidParameterValue.InvalidIpv6" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -func (c *Client) ReleaseIp6AddressesBandwidthWithContext(ctx context.Context, request *ReleaseIp6AddressesBandwidthRequest) (response *ReleaseIp6AddressesBandwidthResponse, err error) { - if request == nil { - request = NewReleaseIp6AddressesBandwidthRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ReleaseIp6AddressesBandwidth require credential") - } - - request.SetContext(ctx) - - response = NewReleaseIp6AddressesBandwidthResponse() - err = c.Send(request, response) - return -} - -func NewRemoveBandwidthPackageResourcesRequest() (request *RemoveBandwidthPackageResourcesRequest) { - request = &RemoveBandwidthPackageResourcesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "RemoveBandwidthPackageResources") - - return -} - -func NewRemoveBandwidthPackageResourcesResponse() (response *RemoveBandwidthPackageResourcesResponse) { - response = &RemoveBandwidthPackageResourcesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RemoveBandwidthPackageResources -// 接口用于删除带宽包资源,包括[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)和[负载均衡](https://cloud.tencent.com/document/product/214/517)等 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_IPTYPENOTPERMIT = "FailedOperation.IpTypeNotPermit" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" -// INVALIDPARAMETERVALUE_RESOURCENOTEXISTED = "InvalidParameterValue.ResourceNotExisted" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDRESOURCEPROTOCOL = "UnsupportedOperation.InvalidResourceProtocol" -func (c *Client) RemoveBandwidthPackageResources(request *RemoveBandwidthPackageResourcesRequest) (response *RemoveBandwidthPackageResourcesResponse, err error) { - return c.RemoveBandwidthPackageResourcesWithContext(context.Background(), request) -} - -// RemoveBandwidthPackageResources -// 接口用于删除带宽包资源,包括[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)和[负载均衡](https://cloud.tencent.com/document/product/214/517)等 -// -// 可能返回的错误码: -// -// FAILEDOPERATION_IPTYPENOTPERMIT = "FailedOperation.IpTypeNotPermit" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" -// INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" -// INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" -// INVALIDPARAMETERVALUE_RESOURCENOTEXISTED = "InvalidParameterValue.ResourceNotExisted" -// INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" -// UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" -// UNSUPPORTEDOPERATION_INVALIDRESOURCEPROTOCOL = "UnsupportedOperation.InvalidResourceProtocol" -func (c *Client) RemoveBandwidthPackageResourcesWithContext(ctx context.Context, request *RemoveBandwidthPackageResourcesRequest) (response *RemoveBandwidthPackageResourcesResponse, err error) { - if request == nil { - request = NewRemoveBandwidthPackageResourcesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RemoveBandwidthPackageResources require credential") - } - - request.SetContext(ctx) - - response = NewRemoveBandwidthPackageResourcesResponse() - err = c.Send(request, response) - return -} - -func NewRemoveIp6RulesRequest() (request *RemoveIp6RulesRequest) { - request = &RemoveIp6RulesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "RemoveIp6Rules") - - return -} - -func NewRemoveIp6RulesResponse() (response *RemoveIp6RulesResponse) { - response = &RemoveIp6RulesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RemoveIp6Rules -// 1. 该接口用于删除IPV6转换规则 -// -// 2. 支持批量删除同一个转换实例下的多个转换规则 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_IP6RULENOTFOUND = "InvalidParameterValue.Ip6RuleNotFound" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -func (c *Client) RemoveIp6Rules(request *RemoveIp6RulesRequest) (response *RemoveIp6RulesResponse, err error) { - return c.RemoveIp6RulesWithContext(context.Background(), request) -} - -// RemoveIp6Rules -// 1. 该接口用于删除IPV6转换规则 -// -// 2. 支持批量删除同一个转换实例下的多个转换规则 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE_IP6RULENOTFOUND = "InvalidParameterValue.Ip6RuleNotFound" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -func (c *Client) RemoveIp6RulesWithContext(ctx context.Context, request *RemoveIp6RulesRequest) (response *RemoveIp6RulesResponse, err error) { - if request == nil { - request = NewRemoveIp6RulesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RemoveIp6Rules require credential") - } - - request.SetContext(ctx) - - response = NewRemoveIp6RulesResponse() - err = c.Send(request, response) - return -} - -func NewRenewAddressesRequest() (request *RenewAddressesRequest) { - request = &RenewAddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "RenewAddresses") - - return -} - -func NewRenewAddressesResponse() (response *RenewAddressesResponse) { - response = &RenewAddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RenewAddresses -// 该接口用于续费包月带宽计费模式的弹性公网IP -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) RenewAddresses(request *RenewAddressesRequest) (response *RenewAddressesResponse, err error) { - return c.RenewAddressesWithContext(context.Background(), request) -} - -// RenewAddresses -// 该接口用于续费包月带宽计费模式的弹性公网IP -// -// 可能返回的错误码: -// -// FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" -// INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" -// INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" -// INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) RenewAddressesWithContext(ctx context.Context, request *RenewAddressesRequest) (response *RenewAddressesResponse, err error) { - if request == nil { - request = NewRenewAddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RenewAddresses require credential") - } - - request.SetContext(ctx) - - response = NewRenewAddressesResponse() - err = c.Send(request, response) - return -} - -func NewRenewVpnGatewayRequest() (request *RenewVpnGatewayRequest) { - request = &RenewVpnGatewayRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "RenewVpnGateway") - - return -} - -func NewRenewVpnGatewayResponse() (response *RenewVpnGatewayResponse) { - response = &RenewVpnGatewayResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// RenewVpnGateway -// 本接口(RenewVpnGateway)用于预付费(包年包月)VPN网关续费。目前只支持IPSEC网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -func (c *Client) RenewVpnGateway(request *RenewVpnGatewayRequest) (response *RenewVpnGatewayResponse, err error) { - return c.RenewVpnGatewayWithContext(context.Background(), request) -} - -// RenewVpnGateway -// 本接口(RenewVpnGateway)用于预付费(包年包月)VPN网关续费。目前只支持IPSEC网关。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -func (c *Client) RenewVpnGatewayWithContext(ctx context.Context, request *RenewVpnGatewayRequest) (response *RenewVpnGatewayResponse, err error) { - if request == nil { - request = NewRenewVpnGatewayRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("RenewVpnGateway require credential") - } - - request.SetContext(ctx) - - response = NewRenewVpnGatewayResponse() - err = c.Send(request, response) - return -} - -func NewReplaceDirectConnectGatewayCcnRoutesRequest() (request *ReplaceDirectConnectGatewayCcnRoutesRequest) { - request = &ReplaceDirectConnectGatewayCcnRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ReplaceDirectConnectGatewayCcnRoutes") - - return -} - -func NewReplaceDirectConnectGatewayCcnRoutesResponse() (response *ReplaceDirectConnectGatewayCcnRoutesResponse) { - response = &ReplaceDirectConnectGatewayCcnRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ReplaceDirectConnectGatewayCcnRoutes -// 本接口(ReplaceDirectConnectGatewayCcnRoutes)根据路由ID(RouteId)修改指定的路由(Route),支持批量修改。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ReplaceDirectConnectGatewayCcnRoutes(request *ReplaceDirectConnectGatewayCcnRoutesRequest) (response *ReplaceDirectConnectGatewayCcnRoutesResponse, err error) { - return c.ReplaceDirectConnectGatewayCcnRoutesWithContext(context.Background(), request) -} - -// ReplaceDirectConnectGatewayCcnRoutes -// 本接口(ReplaceDirectConnectGatewayCcnRoutes)根据路由ID(RouteId)修改指定的路由(Route),支持批量修改。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ReplaceDirectConnectGatewayCcnRoutesWithContext(ctx context.Context, request *ReplaceDirectConnectGatewayCcnRoutesRequest) (response *ReplaceDirectConnectGatewayCcnRoutesResponse, err error) { - if request == nil { - request = NewReplaceDirectConnectGatewayCcnRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ReplaceDirectConnectGatewayCcnRoutes require credential") - } - - request.SetContext(ctx) - - response = NewReplaceDirectConnectGatewayCcnRoutesResponse() - err = c.Send(request, response) - return -} - -func NewReplaceRouteTableAssociationRequest() (request *ReplaceRouteTableAssociationRequest) { - request = &ReplaceRouteTableAssociationRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ReplaceRouteTableAssociation") - - return -} - -func NewReplaceRouteTableAssociationResponse() (response *ReplaceRouteTableAssociationResponse) { - response = &ReplaceRouteTableAssociationResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ReplaceRouteTableAssociation -// 本接口(ReplaceRouteTableAssociation)用于修改子网(Subnet)关联的路由表(RouteTable)。 -// -// * 一个子网只能关联一个路由表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) ReplaceRouteTableAssociation(request *ReplaceRouteTableAssociationRequest) (response *ReplaceRouteTableAssociationResponse, err error) { - return c.ReplaceRouteTableAssociationWithContext(context.Background(), request) -} - -// ReplaceRouteTableAssociation -// 本接口(ReplaceRouteTableAssociation)用于修改子网(Subnet)关联的路由表(RouteTable)。 -// -// * 一个子网只能关联一个路由表。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" -func (c *Client) ReplaceRouteTableAssociationWithContext(ctx context.Context, request *ReplaceRouteTableAssociationRequest) (response *ReplaceRouteTableAssociationResponse, err error) { - if request == nil { - request = NewReplaceRouteTableAssociationRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ReplaceRouteTableAssociation require credential") - } - - request.SetContext(ctx) - - response = NewReplaceRouteTableAssociationResponse() - err = c.Send(request, response) - return -} - -func NewReplaceRoutesRequest() (request *ReplaceRoutesRequest) { - request = &ReplaceRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ReplaceRoutes") - - return -} - -func NewReplaceRoutesResponse() (response *ReplaceRoutesResponse) { - response = &ReplaceRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ReplaceRoutes -// 本接口(ReplaceRoutes)根据路由策略ID(RouteId)修改指定的路由策略(Route),支持批量修改。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CIDRNOTINPEERVPC = "InvalidParameterValue.CidrNotInPeerVpc" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CDCSUBNETNOTSUPPORTUNLOCALGATEWAY = "UnsupportedOperation.CdcSubnetNotSupportUnLocalGateway" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -// UNSUPPORTEDOPERATION_NORMALSUBNETNOTSUPPORTLOCALGATEWAY = "UnsupportedOperation.NormalSubnetNotSupportLocalGateway" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) ReplaceRoutes(request *ReplaceRoutesRequest) (response *ReplaceRoutesResponse, err error) { - return c.ReplaceRoutesWithContext(context.Background(), request) -} - -// ReplaceRoutes -// 本接口(ReplaceRoutes)根据路由策略ID(RouteId)修改指定的路由策略(Route),支持批量修改。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CIDRNOTINPEERVPC = "InvalidParameterValue.CidrNotInPeerVpc" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_CDCSUBNETNOTSUPPORTUNLOCALGATEWAY = "UnsupportedOperation.CdcSubnetNotSupportUnLocalGateway" -// UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -// UNSUPPORTEDOPERATION_NORMALSUBNETNOTSUPPORTLOCALGATEWAY = "UnsupportedOperation.NormalSubnetNotSupportLocalGateway" -// UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) ReplaceRoutesWithContext(ctx context.Context, request *ReplaceRoutesRequest) (response *ReplaceRoutesResponse, err error) { - if request == nil { - request = NewReplaceRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ReplaceRoutes require credential") - } - - request.SetContext(ctx) - - response = NewReplaceRoutesResponse() - err = c.Send(request, response) - return -} - -func NewReplaceSecurityGroupPoliciesRequest() (request *ReplaceSecurityGroupPoliciesRequest) { - request = &ReplaceSecurityGroupPoliciesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ReplaceSecurityGroupPolicies") - - return -} - -func NewReplaceSecurityGroupPoliciesResponse() (response *ReplaceSecurityGroupPoliciesResponse) { - response = &ReplaceSecurityGroupPoliciesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ReplaceSecurityGroupPolicies -// 本接口(ReplaceSecurityGroupPolicies)用于批量修改安全组规则(SecurityGroupPolicy)。 -// -// 单个请求中只能替换单个方向的一条或多条规则, 必须要指定索引(PolicyIndex)。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_CLBPOLICYEXCEEDLIMIT = "UnsupportedOperation.ClbPolicyExceedLimit" -// UNSUPPORTEDOPERATION_CLBPOLICYLIMIT = "UnsupportedOperation.ClbPolicyLimit" -// UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -// UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" -func (c *Client) ReplaceSecurityGroupPolicies(request *ReplaceSecurityGroupPoliciesRequest) (response *ReplaceSecurityGroupPoliciesResponse, err error) { - return c.ReplaceSecurityGroupPoliciesWithContext(context.Background(), request) -} - -// ReplaceSecurityGroupPolicies -// 本接口(ReplaceSecurityGroupPolicies)用于批量修改安全组规则(SecurityGroupPolicy)。 -// -// 单个请求中只能替换单个方向的一条或多条规则, 必须要指定索引(PolicyIndex)。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_CLBPOLICYEXCEEDLIMIT = "UnsupportedOperation.ClbPolicyExceedLimit" -// UNSUPPORTEDOPERATION_CLBPOLICYLIMIT = "UnsupportedOperation.ClbPolicyLimit" -// UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -// UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" -func (c *Client) ReplaceSecurityGroupPoliciesWithContext(ctx context.Context, request *ReplaceSecurityGroupPoliciesRequest) (response *ReplaceSecurityGroupPoliciesResponse, err error) { - if request == nil { - request = NewReplaceSecurityGroupPoliciesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ReplaceSecurityGroupPolicies require credential") - } - - request.SetContext(ctx) - - response = NewReplaceSecurityGroupPoliciesResponse() - err = c.Send(request, response) - return -} - -func NewReplaceSecurityGroupPolicyRequest() (request *ReplaceSecurityGroupPolicyRequest) { - request = &ReplaceSecurityGroupPolicyRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ReplaceSecurityGroupPolicy") - - return -} - -func NewReplaceSecurityGroupPolicyResponse() (response *ReplaceSecurityGroupPolicyResponse) { - response = &ReplaceSecurityGroupPolicyResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ReplaceSecurityGroupPolicy -// 本接口(ReplaceSecurityGroupPolicy)用于替换单条安全组规则(SecurityGroupPolicy)。 -// -// 单个请求中只能替换单个方向的一条规则, 必须要指定索引(PolicyIndex)。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_CLBPOLICYEXCEEDLIMIT = "UnsupportedOperation.ClbPolicyExceedLimit" -// UNSUPPORTEDOPERATION_CLBPOLICYLIMIT = "UnsupportedOperation.ClbPolicyLimit" -// UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -// UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" -func (c *Client) ReplaceSecurityGroupPolicy(request *ReplaceSecurityGroupPolicyRequest) (response *ReplaceSecurityGroupPolicyResponse, err error) { - return c.ReplaceSecurityGroupPolicyWithContext(context.Background(), request) -} - -// ReplaceSecurityGroupPolicy -// 本接口(ReplaceSecurityGroupPolicy)用于替换单条安全组规则(SecurityGroupPolicy)。 -// -// 单个请求中只能替换单个方向的一条规则, 必须要指定索引(PolicyIndex)。 -// -// 可能返回的错误码: -// -// INTERNALERROR_MODULEERROR = "InternalError.ModuleError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" -// INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" -// INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION_CLBPOLICYEXCEEDLIMIT = "UnsupportedOperation.ClbPolicyExceedLimit" -// UNSUPPORTEDOPERATION_CLBPOLICYLIMIT = "UnsupportedOperation.ClbPolicyLimit" -// UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" -// UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" -// UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" -func (c *Client) ReplaceSecurityGroupPolicyWithContext(ctx context.Context, request *ReplaceSecurityGroupPolicyRequest) (response *ReplaceSecurityGroupPolicyResponse, err error) { - if request == nil { - request = NewReplaceSecurityGroupPolicyRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ReplaceSecurityGroupPolicy require credential") - } - - request.SetContext(ctx) - - response = NewReplaceSecurityGroupPolicyResponse() - err = c.Send(request, response) - return -} - -func NewResetAttachCcnInstancesRequest() (request *ResetAttachCcnInstancesRequest) { - request = &ResetAttachCcnInstancesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ResetAttachCcnInstances") - - return -} - -func NewResetAttachCcnInstancesResponse() (response *ResetAttachCcnInstancesResponse) { - response = &ResetAttachCcnInstancesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetAttachCcnInstances -// 本接口(ResetAttachCcnInstances)用于跨账号关联实例申请过期时,重新申请关联操作。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ResetAttachCcnInstances(request *ResetAttachCcnInstancesRequest) (response *ResetAttachCcnInstancesResponse, err error) { - return c.ResetAttachCcnInstancesWithContext(context.Background(), request) -} - -// ResetAttachCcnInstances -// 本接口(ResetAttachCcnInstances)用于跨账号关联实例申请过期时,重新申请关联操作。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) ResetAttachCcnInstancesWithContext(ctx context.Context, request *ResetAttachCcnInstancesRequest) (response *ResetAttachCcnInstancesResponse, err error) { - if request == nil { - request = NewResetAttachCcnInstancesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetAttachCcnInstances require credential") - } - - request.SetContext(ctx) - - response = NewResetAttachCcnInstancesResponse() - err = c.Send(request, response) - return -} - -func NewResetNatGatewayConnectionRequest() (request *ResetNatGatewayConnectionRequest) { - request = &ResetNatGatewayConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ResetNatGatewayConnection") - - return -} - -func NewResetNatGatewayConnectionResponse() (response *ResetNatGatewayConnectionResponse) { - response = &ResetNatGatewayConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetNatGatewayConnection -// 本接口(ResetNatGatewayConnection)用来NAT网关并发连接上限。 -// -// 可能返回的错误码: -// -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) ResetNatGatewayConnection(request *ResetNatGatewayConnectionRequest) (response *ResetNatGatewayConnectionResponse, err error) { - return c.ResetNatGatewayConnectionWithContext(context.Background(), request) -} - -// ResetNatGatewayConnection -// 本接口(ResetNatGatewayConnection)用来NAT网关并发连接上限。 -// -// 可能返回的错误码: -// -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" -// UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" -func (c *Client) ResetNatGatewayConnectionWithContext(ctx context.Context, request *ResetNatGatewayConnectionRequest) (response *ResetNatGatewayConnectionResponse, err error) { - if request == nil { - request = NewResetNatGatewayConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetNatGatewayConnection require credential") - } - - request.SetContext(ctx) - - response = NewResetNatGatewayConnectionResponse() - err = c.Send(request, response) - return -} - -func NewResetRoutesRequest() (request *ResetRoutesRequest) { - request = &ResetRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ResetRoutes") - - return -} - -func NewResetRoutesResponse() (response *ResetRoutesResponse) { - response = &ResetRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetRoutes -// 本接口(ResetRoutes)用于对某个路由表名称和所有路由策略(Route)进行重新设置。
    -// -// 注意: 调用本接口是先删除当前路由表中所有路由策略, 再保存新提交的路由策略内容, 会引起网络中断。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CIDRNOTINPEERVPC = "InvalidParameterValue.CidrNotInPeerVpc" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) ResetRoutes(request *ResetRoutesRequest) (response *ResetRoutesResponse, err error) { - return c.ResetRoutesWithContext(context.Background(), request) -} - -// ResetRoutes -// 本接口(ResetRoutes)用于对某个路由表名称和所有路由策略(Route)进行重新设置。
    -// -// 注意: 调用本接口是先删除当前路由表中所有路由策略, 再保存新提交的路由策略内容, 会引起网络中断。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// INVALIDPARAMETERVALUE_CIDRNOTINPEERVPC = "InvalidParameterValue.CidrNotInPeerVpc" -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" -// INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" -// LIMITEXCEEDED = "LimitExceeded" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) ResetRoutesWithContext(ctx context.Context, request *ResetRoutesRequest) (response *ResetRoutesResponse, err error) { - if request == nil { - request = NewResetRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetRoutes require credential") - } - - request.SetContext(ctx) - - response = NewResetRoutesResponse() - err = c.Send(request, response) - return -} - -func NewResetVpnConnectionRequest() (request *ResetVpnConnectionRequest) { - request = &ResetVpnConnectionRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ResetVpnConnection") - - return -} - -func NewResetVpnConnectionResponse() (response *ResetVpnConnectionResponse) { - response = &ResetVpnConnectionResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetVpnConnection -// 本接口(ResetVpnConnection)用于重置VPN通道。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_VPNCONNINVALIDSTATE = "UnsupportedOperation.VpnConnInvalidState" -func (c *Client) ResetVpnConnection(request *ResetVpnConnectionRequest) (response *ResetVpnConnectionResponse, err error) { - return c.ResetVpnConnectionWithContext(context.Background(), request) -} - -// ResetVpnConnection -// 本接口(ResetVpnConnection)用于重置VPN通道。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_VPNCONNINVALIDSTATE = "UnsupportedOperation.VpnConnInvalidState" -func (c *Client) ResetVpnConnectionWithContext(ctx context.Context, request *ResetVpnConnectionRequest) (response *ResetVpnConnectionResponse, err error) { - if request == nil { - request = NewResetVpnConnectionRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetVpnConnection require credential") - } - - request.SetContext(ctx) - - response = NewResetVpnConnectionResponse() - err = c.Send(request, response) - return -} - -func NewResetVpnGatewayInternetMaxBandwidthRequest() (request *ResetVpnGatewayInternetMaxBandwidthRequest) { - request = &ResetVpnGatewayInternetMaxBandwidthRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ResetVpnGatewayInternetMaxBandwidth") - - return -} - -func NewResetVpnGatewayInternetMaxBandwidthResponse() (response *ResetVpnGatewayInternetMaxBandwidthResponse) { - response = &ResetVpnGatewayInternetMaxBandwidthResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResetVpnGatewayInternetMaxBandwidth -// 本接口(ResetVpnGatewayInternetMaxBandwidth)用于调整VPN网关带宽上限。VPN网关带宽目前仅支持部分带宽范围内升降配,如【5,100】Mbps和【200,1000】Mbps,在各自带宽范围内可提升配额,跨范围提升配额和降配暂不支持,如果是包年包月VPN网关需要在有效期内。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ResetVpnGatewayInternetMaxBandwidth(request *ResetVpnGatewayInternetMaxBandwidthRequest) (response *ResetVpnGatewayInternetMaxBandwidthResponse, err error) { - return c.ResetVpnGatewayInternetMaxBandwidthWithContext(context.Background(), request) -} - -// ResetVpnGatewayInternetMaxBandwidth -// 本接口(ResetVpnGatewayInternetMaxBandwidth)用于调整VPN网关带宽上限。VPN网关带宽目前仅支持部分带宽范围内升降配,如【5,100】Mbps和【200,1000】Mbps,在各自带宽范围内可提升配额,跨范围提升配额和降配暂不支持,如果是包年包月VPN网关需要在有效期内。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -func (c *Client) ResetVpnGatewayInternetMaxBandwidthWithContext(ctx context.Context, request *ResetVpnGatewayInternetMaxBandwidthRequest) (response *ResetVpnGatewayInternetMaxBandwidthResponse, err error) { - if request == nil { - request = NewResetVpnGatewayInternetMaxBandwidthRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResetVpnGatewayInternetMaxBandwidth require credential") - } - - request.SetContext(ctx) - - response = NewResetVpnGatewayInternetMaxBandwidthResponse() - err = c.Send(request, response) - return -} - -func NewResumeSnapshotInstanceRequest() (request *ResumeSnapshotInstanceRequest) { - request = &ResumeSnapshotInstanceRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ResumeSnapshotInstance") - - return -} - -func NewResumeSnapshotInstanceResponse() (response *ResumeSnapshotInstanceResponse) { - response = &ResumeSnapshotInstanceResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ResumeSnapshotInstance -// 本接口(ResumeSnapshotInstance)用于根据备份内容恢复安全组策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ResumeSnapshotInstance(request *ResumeSnapshotInstanceRequest) (response *ResumeSnapshotInstanceResponse, err error) { - return c.ResumeSnapshotInstanceWithContext(context.Background(), request) -} - -// ResumeSnapshotInstance -// 本接口(ResumeSnapshotInstance)用于根据备份内容恢复安全组策略。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) ResumeSnapshotInstanceWithContext(ctx context.Context, request *ResumeSnapshotInstanceRequest) (response *ResumeSnapshotInstanceResponse, err error) { - if request == nil { - request = NewResumeSnapshotInstanceRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ResumeSnapshotInstance require credential") - } - - request.SetContext(ctx) - - response = NewResumeSnapshotInstanceResponse() - err = c.Send(request, response) - return -} - -func NewReturnNormalAddressesRequest() (request *ReturnNormalAddressesRequest) { - request = &ReturnNormalAddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "ReturnNormalAddresses") - - return -} - -func NewReturnNormalAddressesResponse() (response *ReturnNormalAddressesResponse) { - response = &ReturnNormalAddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// ReturnNormalAddresses -// 本接口(ReturnNormalAddresses)用于解绑并释放普通公网IP。 -// -// 为完善公网IP的访问管理功能,此接口于2022年12月15日升级优化鉴权功能,升级后子用户调用此接口需向主账号申请CAM策略授权,否则可能调用失败。您可以提前为子账号配置操作授权,详情见[授权指南](https://cloud.tencent.com/document/product/598/34545)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_ADDRESSIPSNOTFOUND = "InvalidParameterValue.AddressIpsNotFound" -// INVALIDPARAMETERVALUE_ILLEGAL = "InvalidParameterValue.Illegal" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNSUPPORTEDOPERATION_NOTSUPPORTEDADDRESSIPSCHARGETYPE = "UnsupportedOperation.NotSupportedAddressIpsChargeType" -func (c *Client) ReturnNormalAddresses(request *ReturnNormalAddressesRequest) (response *ReturnNormalAddressesResponse, err error) { - return c.ReturnNormalAddressesWithContext(context.Background(), request) -} - -// ReturnNormalAddresses -// 本接口(ReturnNormalAddresses)用于解绑并释放普通公网IP。 -// -// 为完善公网IP的访问管理功能,此接口于2022年12月15日升级优化鉴权功能,升级后子用户调用此接口需向主账号申请CAM策略授权,否则可能调用失败。您可以提前为子账号配置操作授权,详情见[授权指南](https://cloud.tencent.com/document/product/598/34545)。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_ADDRESSIPSNOTFOUND = "InvalidParameterValue.AddressIpsNotFound" -// INVALIDPARAMETERVALUE_ILLEGAL = "InvalidParameterValue.Illegal" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// UNSUPPORTEDOPERATION_NOTSUPPORTEDADDRESSIPSCHARGETYPE = "UnsupportedOperation.NotSupportedAddressIpsChargeType" -func (c *Client) ReturnNormalAddressesWithContext(ctx context.Context, request *ReturnNormalAddressesRequest) (response *ReturnNormalAddressesResponse, err error) { - if request == nil { - request = NewReturnNormalAddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("ReturnNormalAddresses require credential") - } - - request.SetContext(ctx) - - response = NewReturnNormalAddressesResponse() - err = c.Send(request, response) - return -} - -func NewSetCcnRegionBandwidthLimitsRequest() (request *SetCcnRegionBandwidthLimitsRequest) { - request = &SetCcnRegionBandwidthLimitsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "SetCcnRegionBandwidthLimits") - - return -} - -func NewSetCcnRegionBandwidthLimitsResponse() (response *SetCcnRegionBandwidthLimitsResponse) { - response = &SetCcnRegionBandwidthLimitsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// SetCcnRegionBandwidthLimits -// 本接口(SetCcnRegionBandwidthLimits)用于设置云联网(CCN)各地域出带宽上限,或者地域间带宽上限。 -// -// 可能返回的错误码: -// -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_NOTPOSTPAIDCCNOPERATION = "UnsupportedOperation.NotPostpaidCcnOperation" -func (c *Client) SetCcnRegionBandwidthLimits(request *SetCcnRegionBandwidthLimitsRequest) (response *SetCcnRegionBandwidthLimitsResponse, err error) { - return c.SetCcnRegionBandwidthLimitsWithContext(context.Background(), request) -} - -// SetCcnRegionBandwidthLimits -// 本接口(SetCcnRegionBandwidthLimits)用于设置云联网(CCN)各地域出带宽上限,或者地域间带宽上限。 -// -// 可能返回的错误码: -// -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_NOTPOSTPAIDCCNOPERATION = "UnsupportedOperation.NotPostpaidCcnOperation" -func (c *Client) SetCcnRegionBandwidthLimitsWithContext(ctx context.Context, request *SetCcnRegionBandwidthLimitsRequest) (response *SetCcnRegionBandwidthLimitsResponse, err error) { - if request == nil { - request = NewSetCcnRegionBandwidthLimitsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("SetCcnRegionBandwidthLimits require credential") - } - - request.SetContext(ctx) - - response = NewSetCcnRegionBandwidthLimitsResponse() - err = c.Send(request, response) - return -} - -func NewSetVpnGatewaysRenewFlagRequest() (request *SetVpnGatewaysRenewFlagRequest) { - request = &SetVpnGatewaysRenewFlagRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "SetVpnGatewaysRenewFlag") - - return -} - -func NewSetVpnGatewaysRenewFlagResponse() (response *SetVpnGatewaysRenewFlagResponse) { - response = &SetVpnGatewaysRenewFlagResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// SetVpnGatewaysRenewFlag -// 本接口(SetVpnGatewaysRenewFlag)用于设置VPNGW续费标记。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) SetVpnGatewaysRenewFlag(request *SetVpnGatewaysRenewFlagRequest) (response *SetVpnGatewaysRenewFlagResponse, err error) { - return c.SetVpnGatewaysRenewFlagWithContext(context.Background(), request) -} - -// SetVpnGatewaysRenewFlag -// 本接口(SetVpnGatewaysRenewFlag)用于设置VPNGW续费标记。 -// -// 可能返回的错误码: -// -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETER = "InvalidParameter" -// INVALIDPARAMETERVALUE = "InvalidParameterValue" -// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) SetVpnGatewaysRenewFlagWithContext(ctx context.Context, request *SetVpnGatewaysRenewFlagRequest) (response *SetVpnGatewaysRenewFlagResponse, err error) { - if request == nil { - request = NewSetVpnGatewaysRenewFlagRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("SetVpnGatewaysRenewFlag require credential") - } - - request.SetContext(ctx) - - response = NewSetVpnGatewaysRenewFlagResponse() - err = c.Send(request, response) - return -} - -func NewTransformAddressRequest() (request *TransformAddressRequest) { - request = &TransformAddressRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "TransformAddress") - - return -} - -func NewTransformAddressResponse() (response *TransformAddressResponse) { - response = &TransformAddressResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// TransformAddress -// 本接口 (TransformAddress) 用于将实例的普通公网 IP 转换为[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 -// -// * 平台对用户每地域每日解绑 EIP 重新分配普通公网 IP 次数有所限制(可参见 [EIP 产品简介](/document/product/213/1941))。上述配额可通过 [DescribeAddressQuota](https://cloud.tencent.com/document/api/213/1378) 接口获取。 -// -// 可能返回的错误码: -// -// ADDRESSQUOTALIMITEXCEEDED = "AddressQuotaLimitExceeded" -// ADDRESSQUOTALIMITEXCEEDED_DAILYALLOCATE = "AddressQuotaLimitExceeded.DailyAllocate" -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_ALREADYBINDEIP = "InvalidInstanceId.AlreadyBindEip" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEHASNOWANIP = "InvalidParameterValue.InstanceHasNoWanIP" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" -// INVALIDPARAMETERVALUE_INVALIDINSTANCESTATE = "InvalidParameterValue.InvalidInstanceState" -// LIMITEXCEEDED_MONTHLYADDRESSRECOVERYQUOTA = "LimitExceeded.MonthlyAddressRecoveryQuota" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -func (c *Client) TransformAddress(request *TransformAddressRequest) (response *TransformAddressResponse, err error) { - return c.TransformAddressWithContext(context.Background(), request) -} - -// TransformAddress -// 本接口 (TransformAddress) 用于将实例的普通公网 IP 转换为[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 -// -// * 平台对用户每地域每日解绑 EIP 重新分配普通公网 IP 次数有所限制(可参见 [EIP 产品简介](/document/product/213/1941))。上述配额可通过 [DescribeAddressQuota](https://cloud.tencent.com/document/api/213/1378) 接口获取。 -// -// 可能返回的错误码: -// -// ADDRESSQUOTALIMITEXCEEDED = "AddressQuotaLimitExceeded" -// ADDRESSQUOTALIMITEXCEEDED_DAILYALLOCATE = "AddressQuotaLimitExceeded.DailyAllocate" -// FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" -// INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" -// INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" -// INVALIDINSTANCEID_ALREADYBINDEIP = "InvalidInstanceId.AlreadyBindEip" -// INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" -// INVALIDPARAMETERVALUE_INSTANCEHASNOWANIP = "InvalidParameterValue.InstanceHasNoWanIP" -// INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" -// INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" -// INVALIDPARAMETERVALUE_INVALIDINSTANCESTATE = "InvalidParameterValue.InvalidInstanceState" -// LIMITEXCEEDED_MONTHLYADDRESSRECOVERYQUOTA = "LimitExceeded.MonthlyAddressRecoveryQuota" -// OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" -// OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" -// UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" -// UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" -func (c *Client) TransformAddressWithContext(ctx context.Context, request *TransformAddressRequest) (response *TransformAddressResponse, err error) { - if request == nil { - request = NewTransformAddressRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("TransformAddress require credential") - } - - request.SetContext(ctx) - - response = NewTransformAddressResponse() - err = c.Send(request, response) - return -} - -func NewUnassignIpv6AddressesRequest() (request *UnassignIpv6AddressesRequest) { - request = &UnassignIpv6AddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6Addresses") - - return -} - -func NewUnassignIpv6AddressesResponse() (response *UnassignIpv6AddressesResponse) { - response = &UnassignIpv6AddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// UnassignIpv6Addresses -// 本接口(UnassignIpv6Addresses)用于释放弹性网卡`IPv6`地址。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_ATTACHMENTNOTFOUND = "UnauthorizedOperation.AttachmentNotFound" -// UNAUTHORIZEDOPERATION_PRIMARYIP = "UnauthorizedOperation.PrimaryIp" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) UnassignIpv6Addresses(request *UnassignIpv6AddressesRequest) (response *UnassignIpv6AddressesResponse, err error) { - return c.UnassignIpv6AddressesWithContext(context.Background(), request) -} - -// UnassignIpv6Addresses -// 本接口(UnassignIpv6Addresses)用于释放弹性网卡`IPv6`地址。
    -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// RESOURCENOTFOUND = "ResourceNotFound" -// UNAUTHORIZEDOPERATION_ATTACHMENTNOTFOUND = "UnauthorizedOperation.AttachmentNotFound" -// UNAUTHORIZEDOPERATION_PRIMARYIP = "UnauthorizedOperation.PrimaryIp" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) UnassignIpv6AddressesWithContext(ctx context.Context, request *UnassignIpv6AddressesRequest) (response *UnassignIpv6AddressesResponse, err error) { - if request == nil { - request = NewUnassignIpv6AddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("UnassignIpv6Addresses require credential") - } - - request.SetContext(ctx) - - response = NewUnassignIpv6AddressesResponse() - err = c.Send(request, response) - return -} - -func NewUnassignIpv6CidrBlockRequest() (request *UnassignIpv6CidrBlockRequest) { - request = &UnassignIpv6CidrBlockRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6CidrBlock") - - return -} - -func NewUnassignIpv6CidrBlockResponse() (response *UnassignIpv6CidrBlockResponse) { - response = &UnassignIpv6CidrBlockResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// UnassignIpv6CidrBlock -// 本接口(UnassignIpv6CidrBlock)用于释放IPv6网段。
    -// -// 网段如果还有IP占用且未回收,则网段无法释放。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) UnassignIpv6CidrBlock(request *UnassignIpv6CidrBlockRequest) (response *UnassignIpv6CidrBlockResponse, err error) { - return c.UnassignIpv6CidrBlockWithContext(context.Background(), request) -} - -// UnassignIpv6CidrBlock -// 本接口(UnassignIpv6CidrBlock)用于释放IPv6网段。
    -// -// 网段如果还有IP占用且未回收,则网段无法释放。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) UnassignIpv6CidrBlockWithContext(ctx context.Context, request *UnassignIpv6CidrBlockRequest) (response *UnassignIpv6CidrBlockResponse, err error) { - if request == nil { - request = NewUnassignIpv6CidrBlockRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("UnassignIpv6CidrBlock require credential") - } - - request.SetContext(ctx) - - response = NewUnassignIpv6CidrBlockResponse() - err = c.Send(request, response) - return -} - -func NewUnassignIpv6SubnetCidrBlockRequest() (request *UnassignIpv6SubnetCidrBlockRequest) { - request = &UnassignIpv6SubnetCidrBlockRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6SubnetCidrBlock") - - return -} - -func NewUnassignIpv6SubnetCidrBlockResponse() (response *UnassignIpv6SubnetCidrBlockResponse) { - response = &UnassignIpv6SubnetCidrBlockResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// UnassignIpv6SubnetCidrBlock -// 本接口(UnassignIpv6SubnetCidrBlock)用于释放IPv6子网段。
    -// -// 子网段如果还有IP占用且未回收,则子网段无法释放。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) UnassignIpv6SubnetCidrBlock(request *UnassignIpv6SubnetCidrBlockRequest) (response *UnassignIpv6SubnetCidrBlockResponse, err error) { - return c.UnassignIpv6SubnetCidrBlockWithContext(context.Background(), request) -} - -// UnassignIpv6SubnetCidrBlock -// 本接口(UnassignIpv6SubnetCidrBlock)用于释放IPv6子网段。
    -// -// 子网段如果还有IP占用且未回收,则子网段无法释放。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCEINUSE = "ResourceInUse" -// RESOURCENOTFOUND = "ResourceNotFound" -func (c *Client) UnassignIpv6SubnetCidrBlockWithContext(ctx context.Context, request *UnassignIpv6SubnetCidrBlockRequest) (response *UnassignIpv6SubnetCidrBlockResponse, err error) { - if request == nil { - request = NewUnassignIpv6SubnetCidrBlockRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("UnassignIpv6SubnetCidrBlock require credential") - } - - request.SetContext(ctx) - - response = NewUnassignIpv6SubnetCidrBlockResponse() - err = c.Send(request, response) - return -} - -func NewUnassignPrivateIpAddressesRequest() (request *UnassignPrivateIpAddressesRequest) { - request = &UnassignPrivateIpAddressesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "UnassignPrivateIpAddresses") - - return -} - -func NewUnassignPrivateIpAddressesResponse() (response *UnassignPrivateIpAddressesResponse) { - response = &UnassignPrivateIpAddressesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// UnassignPrivateIpAddresses -// 本接口(UnassignPrivateIpAddresses)用于弹性网卡退还内网 IP。 -// -// * 退还弹性网卡上的辅助内网IP,接口自动解关联弹性公网 IP。不能退还弹性网卡的主内网IP。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) UnassignPrivateIpAddresses(request *UnassignPrivateIpAddressesRequest) (response *UnassignPrivateIpAddressesResponse, err error) { - return c.UnassignPrivateIpAddressesWithContext(context.Background(), request) -} - -// UnassignPrivateIpAddresses -// 本接口(UnassignPrivateIpAddresses)用于弹性网卡退还内网 IP。 -// -// * 退还弹性网卡上的辅助内网IP,接口自动解关联弹性公网 IP。不能退还弹性网卡的主内网IP。 -// -// 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`DescribeVpcTaskResult`接口。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" -// UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" -// UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" -func (c *Client) UnassignPrivateIpAddressesWithContext(ctx context.Context, request *UnassignPrivateIpAddressesRequest) (response *UnassignPrivateIpAddressesResponse, err error) { - if request == nil { - request = NewUnassignPrivateIpAddressesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("UnassignPrivateIpAddresses require credential") - } - - request.SetContext(ctx) - - response = NewUnassignPrivateIpAddressesResponse() - err = c.Send(request, response) - return -} - -func NewUnlockCcnBandwidthsRequest() (request *UnlockCcnBandwidthsRequest) { - request = &UnlockCcnBandwidthsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "UnlockCcnBandwidths") - - return -} - -func NewUnlockCcnBandwidthsResponse() (response *UnlockCcnBandwidthsResponse) { - response = &UnlockCcnBandwidthsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// UnlockCcnBandwidths -// 本接口(UnlockCcnBandwidths)用户解锁云联网限速实例。 -// -// 该接口一般用来封禁地域间限速的云联网实例下的限速实例, 目前联通内部运营系统通过云API调用, 如果是出口限速, 一般使用更粗的云联网实例粒度封禁(SecurityUnlockCcns)。 -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) UnlockCcnBandwidths(request *UnlockCcnBandwidthsRequest) (response *UnlockCcnBandwidthsResponse, err error) { - return c.UnlockCcnBandwidthsWithContext(context.Background(), request) -} - -// UnlockCcnBandwidths -// 本接口(UnlockCcnBandwidths)用户解锁云联网限速实例。 -// -// 该接口一般用来封禁地域间限速的云联网实例下的限速实例, 目前联通内部运营系统通过云API调用, 如果是出口限速, 一般使用更粗的云联网实例粒度封禁(SecurityUnlockCcns)。 -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统。 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -// UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" -func (c *Client) UnlockCcnBandwidthsWithContext(ctx context.Context, request *UnlockCcnBandwidthsRequest) (response *UnlockCcnBandwidthsResponse, err error) { - if request == nil { - request = NewUnlockCcnBandwidthsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("UnlockCcnBandwidths require credential") - } - - request.SetContext(ctx) - - response = NewUnlockCcnBandwidthsResponse() - err = c.Send(request, response) - return -} - -func NewUnlockCcnsRequest() (request *UnlockCcnsRequest) { - request = &UnlockCcnsRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "UnlockCcns") - - return -} - -func NewUnlockCcnsResponse() (response *UnlockCcnsResponse) { - response = &UnlockCcnsResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// UnlockCcns -// 本接口(UnlockCcns)用于解锁云联网实例 -// -// 该接口一般用来解封禁出口限速的云联网实例, 目前联通内部运营系统通过云API调用, 因为出口限速无法按地域间解封禁, 只能按更粗的云联网实例粒度解封禁, 如果是地域间限速, 一般可以通过更细的限速实例粒度解封禁(UnlockCcnBandwidths) -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) UnlockCcns(request *UnlockCcnsRequest) (response *UnlockCcnsResponse, err error) { - return c.UnlockCcnsWithContext(context.Background(), request) -} - -// UnlockCcns -// 本接口(UnlockCcns)用于解锁云联网实例 -// -// 该接口一般用来解封禁出口限速的云联网实例, 目前联通内部运营系统通过云API调用, 因为出口限速无法按地域间解封禁, 只能按更粗的云联网实例粒度解封禁, 如果是地域间限速, 一般可以通过更细的限速实例粒度解封禁(UnlockCcnBandwidths) -// -// 如有需要, 可以封禁任意限速实例, 可接入到内部运营系统 -// -// 可能返回的错误码: -// -// INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION = "UnsupportedOperation" -func (c *Client) UnlockCcnsWithContext(ctx context.Context, request *UnlockCcnsRequest) (response *UnlockCcnsResponse, err error) { - if request == nil { - request = NewUnlockCcnsRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("UnlockCcns require credential") - } - - request.SetContext(ctx) - - response = NewUnlockCcnsResponse() - err = c.Send(request, response) - return -} - -func NewWithdrawNotifyRoutesRequest() (request *WithdrawNotifyRoutesRequest) { - request = &WithdrawNotifyRoutesRequest{ - BaseRequest: &tchttp.BaseRequest{}, - } - - request.Init().WithApiInfo("vpc", APIVersion, "WithdrawNotifyRoutes") - - return -} - -func NewWithdrawNotifyRoutesResponse() (response *WithdrawNotifyRoutesResponse) { - response = &WithdrawNotifyRoutesResponse{ - BaseResponse: &tchttp.BaseResponse{}, - } - return -} - -// WithdrawNotifyRoutes -// 本接口(WithdrawNotifyRoutes)用于撤销已发布到云联网的路由。路由表列表页操作增加“从云联网撤销”。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDROUTEID_NOTFOUND = "InvalidRouteId.NotFound" -// INVALIDROUTETABLEID_MALFORMED = "InvalidRouteTableId.Malformed" -// INVALIDROUTETABLEID_NOTFOUND = "InvalidRouteTableId.NotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_NOTIFYCCN = "UnsupportedOperation.NotifyCcn" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) WithdrawNotifyRoutes(request *WithdrawNotifyRoutesRequest) (response *WithdrawNotifyRoutesResponse, err error) { - return c.WithdrawNotifyRoutesWithContext(context.Background(), request) -} - -// WithdrawNotifyRoutes -// 本接口(WithdrawNotifyRoutes)用于撤销已发布到云联网的路由。路由表列表页操作增加“从云联网撤销”。 -// -// 可能返回的错误码: -// -// INTERNALERROR = "InternalError" -// INTERNALSERVERERROR = "InternalServerError" -// INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" -// INVALIDROUTEID_NOTFOUND = "InvalidRouteId.NotFound" -// INVALIDROUTETABLEID_MALFORMED = "InvalidRouteTableId.Malformed" -// INVALIDROUTETABLEID_NOTFOUND = "InvalidRouteTableId.NotFound" -// RESOURCENOTFOUND = "ResourceNotFound" -// UNSUPPORTEDOPERATION_NOTIFYCCN = "UnsupportedOperation.NotifyCcn" -// UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" -func (c *Client) WithdrawNotifyRoutesWithContext(ctx context.Context, request *WithdrawNotifyRoutesRequest) (response *WithdrawNotifyRoutesResponse, err error) { - if request == nil { - request = NewWithdrawNotifyRoutesRequest() - } - - if c.GetCredential() == nil { - return nil, errors.New("WithdrawNotifyRoutes require credential") - } - - request.SetContext(ctx) - - response = NewWithdrawNotifyRoutesResponse() - err = c.Send(request, response) - return -} diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/errors.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/errors.go deleted file mode 100644 index 41cf3286966a..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/errors.go +++ /dev/null @@ -1,1062 +0,0 @@ -/* -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 v20170312 - -const ( - // 此产品的特有错误码 - - // 账户配额不足,每个腾讯云账户每个地域下最多可创建 20 个 EIP。 - ADDRESSQUOTALIMITEXCEEDED = "AddressQuotaLimitExceeded" - - // 申购次数不足,每个腾讯云账户每个地域每天申购次数为配额数*2 次。 - ADDRESSQUOTALIMITEXCEEDED_DAILYALLOCATE = "AddressQuotaLimitExceeded.DailyAllocate" - - // CAM签名/鉴权错误。 - AUTHFAILURE = "AuthFailure" - - // 地址没有弹性网卡信息。 - FAILEDOPERATION_ADDRESSENIINFONOTFOUND = "FailedOperation.AddressEniInfoNotFound" - - // 账户余额不足。 - FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" - - // 不支持的地域。 - FAILEDOPERATION_INVALIDREGION = "FailedOperation.InvalidRegion" - - // 不支持的IP类型。 - FAILEDOPERATION_IPTYPENOTPERMIT = "FailedOperation.IpTypeNotPermit" - - // 未找到实例的主网卡。 - FAILEDOPERATION_MASTERENINOTFOUND = "FailedOperation.MasterEniNotFound" - - // 网络探测超时,请稍后重试。 - FAILEDOPERATION_NETDETECTTIMEOUT = "FailedOperation.NetDetectTimeOut" - - // 任务执行失败。 - FAILEDOPERATION_TASKFAILED = "FailedOperation.TaskFailed" - - // 内部错误。 - INTERNALERROR = "InternalError" - - // 创建Ckafka路由失败,请稍后重试。 - INTERNALERROR_CREATECKAFKAROUTEERROR = "InternalError.CreateCkafkaRouteError" - - // 内部模块错误。 - INTERNALERROR_MODULEERROR = "InternalError.ModuleError" - - // 操作内部错误。 - INTERNALSERVERERROR = "InternalServerError" - - // 不支持此账户。 - INVALIDACCOUNT_NOTSUPPORTED = "InvalidAccount.NotSupported" - - // 指定EIP处于被封堵状态。当EIP处于封堵状态的时候是不能够进行绑定操作的,需要先进行解封。 - INVALIDADDRESSID_BLOCKED = "InvalidAddressId.Blocked" - - // 指定的EIP不存在。 - INVALIDADDRESSID_NOTFOUND = "InvalidAddressId.NotFound" - - // 指定EIP处于欠费状态。 - INVALIDADDRESSIDSTATE_INARREARS = "InvalidAddressIdState.InArrears" - - // 指定 EIP 当前状态不能进行绑定操作。只有 EIP 的状态是 UNBIND 时才能进行绑定操作。 - INVALIDADDRESSIDSTATUS_NOTPERMIT = "InvalidAddressIdStatus.NotPermit" - - // 指定EIP的当前状态不允许进行该操作。 - INVALIDADDRESSSTATE = "InvalidAddressState" - - // 不被支持的实例。 - INVALIDINSTANCE_NOTSUPPORTED = "InvalidInstance.NotSupported" - - // 指定实例已经绑定了EIP。需先解绑当前的EIP才能再次进行绑定操作。 - INVALIDINSTANCEID_ALREADYBINDEIP = "InvalidInstanceId.AlreadyBindEip" - - // 无效实例ID。指定的实例ID不存在。 - INVALIDINSTANCEID_NOTFOUND = "InvalidInstanceId.NotFound" - - // 指定 NetworkInterfaceId 不存在或指定的PrivateIpAddress不在NetworkInterfaceId上。 - INVALIDNETWORKINTERFACEID_NOTFOUND = "InvalidNetworkInterfaceId.NotFound" - - // 参数错误。 - INVALIDPARAMETER = "InvalidParameter" - - // ACL ID与ACL类型不匹配。 - INVALIDPARAMETER_ACLTYPEMISMATCH = "InvalidParameter.AclTypeMismatch" - - // 参数不支持同时指定。 - INVALIDPARAMETER_COEXIST = "InvalidParameter.Coexist" - - // 指定过滤条件不存在。 - INVALIDPARAMETER_FILTERINVALIDKEY = "InvalidParameter.FilterInvalidKey" - - // 指定过滤条件不是键值对。 - INVALIDPARAMETER_FILTERNOTDICT = "InvalidParameter.FilterNotDict" - - // 指定过滤选项值不是列表。 - INVALIDPARAMETER_FILTERVALUESNOTLIST = "InvalidParameter.FilterValuesNotList" - - // 该过滤规则不合法。 - INVALIDPARAMETER_INVALIDFILTER = "InvalidParameter.InvalidFilter" - - // 下一跳类型与下一跳网关不匹配。 - INVALIDPARAMETER_NEXTHOPMISMATCH = "InvalidParameter.NextHopMismatch" - - // 专线网关跨可用区容灾组不存在。 - INVALIDPARAMETER_VPGHAGROUPNOTFOUND = "InvalidParameter.VpgHaGroupNotFound" - - // 指定的两个参数冲突,不能同时存在。 EIP只能绑定在实例上或指定网卡的指定内网 IP 上。 - INVALIDPARAMETERCONFLICT = "InvalidParameterConflict" - - // 参数取值错误。 - INVALIDPARAMETERVALUE = "InvalidParameterValue" - - // 被攻击的IP地址。 - INVALIDPARAMETERVALUE_ADDRESSATTACKED = "InvalidParameterValue.AddressAttacked" - - // 该地址ID不合法。 - INVALIDPARAMETERVALUE_ADDRESSIDMALFORMED = "InvalidParameterValue.AddressIdMalformed" - - // 该地址计费方式与其他地址冲突。 - INVALIDPARAMETERVALUE_ADDRESSINTERNETCHARGETYPECONFLICT = "InvalidParameterValue.AddressInternetChargeTypeConflict" - - // 该IP地址现在不可用。 - INVALIDPARAMETERVALUE_ADDRESSIPNOTAVAILABLE = "InvalidParameterValue.AddressIpNotAvailable" - - // IP地址未找到。 - INVALIDPARAMETERVALUE_ADDRESSIPNOTFOUND = "InvalidParameterValue.AddressIpNotFound" - - // VPC中不存在此IP地址。 - INVALIDPARAMETERVALUE_ADDRESSIPNOTINVPC = "InvalidParameterValue.AddressIpNotInVpc" - - // 此IPv6地址未发布。 - INVALIDPARAMETERVALUE_ADDRESSIPNOTPUBLIC = "InvalidParameterValue.AddressIpNotPublic" - - // 未查询到该地址。 - INVALIDPARAMETERVALUE_ADDRESSIPSNOTFOUND = "InvalidParameterValue.AddressIpsNotFound" - - // 该地址不可与此实例申请。 - INVALIDPARAMETERVALUE_ADDRESSNOTAPPLICABLE = "InvalidParameterValue.AddressNotApplicable" - - // 该地址不是CalcIP。 - INVALIDPARAMETERVALUE_ADDRESSNOTCALCIP = "InvalidParameterValue.AddressNotCalcIP" - - // 未找到该地址。 - INVALIDPARAMETERVALUE_ADDRESSNOTFOUND = "InvalidParameterValue.AddressNotFound" - - // 该IPv6地址已经发布。 - INVALIDPARAMETERVALUE_ADDRESSPUBLISHED = "InvalidParameterValue.AddressPublished" - - // 当前IP地址类型不正确。 - INVALIDPARAMETERVALUE_ADDRESSTYPECONFLICT = "InvalidParameterValue.AddressTypeConflict" - - // 带宽超出限制。 - INVALIDPARAMETERVALUE_BANDWIDTHOUTOFRANGE = "InvalidParameterValue.BandwidthOutOfRange" - - // 带宽包ID不正确。 - INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEIDMALFORMED = "InvalidParameterValue.BandwidthPackageIdMalformed" - - // 该带宽包正在被使用。 - INVALIDPARAMETERVALUE_BANDWIDTHPACKAGEINUSE = "InvalidParameterValue.BandwidthPackageInUse" - - // 未查询到该带宽包。 - INVALIDPARAMETERVALUE_BANDWIDTHPACKAGENOTFOUND = "InvalidParameterValue.BandwidthPackageNotFound" - - // 选择带宽低于可允许的最小范围。 - INVALIDPARAMETERVALUE_BANDWIDTHTOOSMALL = "InvalidParameterValue.BandwidthTooSmall" - - // 指定云联网关联黑石私有网络数量达到上限。 - INVALIDPARAMETERVALUE_CCNATTACHBMVPCLIMITEXCEEDED = "InvalidParameterValue.CcnAttachBmvpcLimitExceeded" - - // 目的网段不在对端VPC的CIDR范围内。 - INVALIDPARAMETERVALUE_CIDRNOTINPEERVPC = "InvalidParameterValue.CidrNotInPeerVpc" - - // 指定CIDR不在SSL-VPN所属私有网络CIDR内。 - INVALIDPARAMETERVALUE_CIDRNOTINSSLVPNVPC = "InvalidParameterValue.CidrNotInSslVpnVpc" - - // 非法入参组合。 - INVALIDPARAMETERVALUE_COMBINATION = "InvalidParameterValue.Combination" - - // 入参重复。 - INVALIDPARAMETERVALUE_DUPLICATE = "InvalidParameterValue.Duplicate" - - // 参数值存在重复。 - INVALIDPARAMETERVALUE_DUPLICATEPARA = "InvalidParameterValue.DuplicatePara" - - // 本端地域和端地域重复。 - INVALIDPARAMETERVALUE_DUPLICATEREGION = "InvalidParameterValue.DuplicateRegion" - - // 值超过上限。 - INVALIDPARAMETERVALUE_EIPBRANDWIDTHOUTINVALID = "InvalidParameterValue.EIPBrandWidthOutInvalid" - - // 缺少参数。 - INVALIDPARAMETERVALUE_EMPTY = "InvalidParameterValue.Empty" - - // IPv6转换实例ID已经存在。 - INVALIDPARAMETERVALUE_IPV6RULEIDEXISTED = "InvalidParameterValue.IPv6RuleIdExisted" - - // IPv6规则没有更改。 - INVALIDPARAMETERVALUE_IPV6RULENOTCHANGE = "InvalidParameterValue.IPv6RuleNotChange" - - // 资源格式错误 - INVALIDPARAMETERVALUE_ILLEGAL = "InvalidParameterValue.Illegal" - - // 该实例的计费方式与其他实例不同。 - INVALIDPARAMETERVALUE_INCONSISTENTINSTANCEINTERNETCHARGETYPE = "InvalidParameterValue.InconsistentInstanceInternetChargeType" - - // 该实例不支持AnycastEIP。 - INVALIDPARAMETERVALUE_INSTANCEDOESNOTSUPPORTANYCAST = "InvalidParameterValue.InstanceDoesNotSupportAnycast" - - // 实例不存在公网IP。 - INVALIDPARAMETERVALUE_INSTANCEHASNOWANIP = "InvalidParameterValue.InstanceHasNoWanIP" - - // 该实例已有WanIP。 - INVALIDPARAMETERVALUE_INSTANCEHASWANIP = "InvalidParameterValue.InstanceHasWanIP" - - // 实例ID错误。 - INVALIDPARAMETERVALUE_INSTANCEIDMALFORMED = "InvalidParameterValue.InstanceIdMalformed" - - // 该实例没有CalcIP,无法完成请求。 - INVALIDPARAMETERVALUE_INSTANCENOCALCIP = "InvalidParameterValue.InstanceNoCalcIP" - - // 该实例没有WanIP,无法完成请求。 - INVALIDPARAMETERVALUE_INSTANCENOWANIP = "InvalidParameterValue.InstanceNoWanIP" - - // 由于该IP被禁用,无法绑定该实例。 - INVALIDPARAMETERVALUE_INSTANCENORMALPUBLICIPBLOCKED = "InvalidParameterValue.InstanceNormalPublicIpBlocked" - - // 弹性网卡绑定的实例与地址绑定的实例不一致。 - INVALIDPARAMETERVALUE_INSTANCENOTMATCHASSOCIATEENI = "InvalidParameterValue.InstanceNotMatchAssociateEni" - - // 网络计费模式没有更改。 - INVALIDPARAMETERVALUE_INTERNETCHARGETYPENOTCHANGED = "InvalidParameterValue.InternetChargeTypeNotChanged" - - // 无效的带宽包计费方式。 - INVALIDPARAMETERVALUE_INVALIDBANDWIDTHPACKAGECHARGETYPE = "InvalidParameterValue.InvalidBandwidthPackageChargeType" - - // 参数的值不存在或不支持。 - INVALIDPARAMETERVALUE_INVALIDBUSINESS = "InvalidParameterValue.InvalidBusiness" - - // 传入的DedicatedClusterId有误。 - INVALIDPARAMETERVALUE_INVALIDDEDICATEDCLUSTERID = "InvalidParameterValue.InvalidDedicatedClusterId" - - // 该IP只能绑定小时流量后付费和带宽包实例。 - INVALIDPARAMETERVALUE_INVALIDINSTANCEINTERNETCHARGETYPE = "InvalidParameterValue.InvalidInstanceInternetChargeType" - - // 该实例状态无法完成操作。 - INVALIDPARAMETERVALUE_INVALIDINSTANCESTATE = "InvalidParameterValue.InvalidInstanceState" - - // 无效的IPv6地址。 - INVALIDPARAMETERVALUE_INVALIDIPV6 = "InvalidParameterValue.InvalidIpv6" - - // 该Tag不合法。 - INVALIDPARAMETERVALUE_INVALIDTAG = "InvalidParameterValue.InvalidTag" - - // 未查询到该IPv6规则。 - INVALIDPARAMETERVALUE_IP6RULENOTFOUND = "InvalidParameterValue.Ip6RuleNotFound" - - // 未查询到该IPv6翻译器。 - INVALIDPARAMETERVALUE_IP6TRANSLATORNOTFOUND = "InvalidParameterValue.Ip6TranslatorNotFound" - - // 负载均衡实例已经绑定了EIP。 - INVALIDPARAMETERVALUE_LBALREADYBINDEIP = "InvalidParameterValue.LBAlreadyBindEip" - - // 参数值超出限制。 - INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" - - // 入参格式不合法。 - INVALIDPARAMETERVALUE_MALFORMED = "InvalidParameterValue.Malformed" - - // 指定审批单号和资源不匹配。 - INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONIDMISMATCH = "InvalidParameterValue.MemberApprovalApplicationIdMismatch" - - // 流程服务审批单未审批。 - INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONNOTAPPROVED = "InvalidParameterValue.MemberApprovalApplicationNotApproved" - - // 流程服务审批单被拒绝。 - INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONREJECTED = "InvalidParameterValue.MemberApprovalApplicationRejected" - - // 该请求需要走BPAAS流程服务审批,当前发起审批中。 - INVALIDPARAMETERVALUE_MEMBERAPPROVALAPPLICATIONSTARTED = "InvalidParameterValue.MemberApprovalApplicationStarted" - - // 缺少绑定的实例。 - INVALIDPARAMETERVALUE_MISSINGASSOCIATEENTITY = "InvalidParameterValue.MissingAssociateEntity" - - // 集群类型不同的IP不可在同一请求中。 - INVALIDPARAMETERVALUE_MIXEDADDRESSIPSETTYPE = "InvalidParameterValue.MixedAddressIpSetType" - - // NAT网关的DNAT转换规则已存在。 - INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEEXISTED = "InvalidParameterValue.NatGatewayDnatRuleExisted" - - // NAT网关的DNAT转换规则不存在。 - INVALIDPARAMETERVALUE_NATGATEWAYDNATRULENOTEXISTS = "InvalidParameterValue.NatGatewayDnatRuleNotExists" - - // DNAT转换规则的内网IP需为虚拟机上网卡所用的IP。 - INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEPIPNEEDVM = "InvalidParameterValue.NatGatewayDnatRulePipNeedVm" - - // 新增NAT网关的DNAT转换规则已重复。 - INVALIDPARAMETERVALUE_NATGATEWAYDNATRULEREPEATED = "InvalidParameterValue.NatGatewayDnatRuleRepeated" - - // NAT网关的SNAT转换规则不存在。 - INVALIDPARAMETERVALUE_NATGATEWAYSNATRULENOTEXISTS = "InvalidParameterValue.NatGatewaySnatRuleNotExists" - - // NAT网关的SNAT规则已经存在。 - INVALIDPARAMETERVALUE_NATSNATRULEEXISTS = "InvalidParameterValue.NatSnatRuleExists" - - // 探测目的IP和网络探测在同一个VPC内。 - INVALIDPARAMETERVALUE_NETDETECTINVPC = "InvalidParameterValue.NetDetectInVpc" - - // 探测目的IP在云联网的路由表中找不到匹配的下一跳。 - INVALIDPARAMETERVALUE_NETDETECTNOTFOUNDIP = "InvalidParameterValue.NetDetectNotFoundIp" - - // 探测目的IP与同一个私有网络内的同一个子网下的其他网络探测的探测目的IP相同。 - INVALIDPARAMETERVALUE_NETDETECTSAMEIP = "InvalidParameterValue.NetDetectSameIp" - - // 网络接口ID不正确。 - INVALIDPARAMETERVALUE_NETWORKINTERFACEIDMALFORMED = "InvalidParameterValue.NetworkInterfaceIdMalformed" - - // 未找到网络接口ID,或私有IP地址未在网络接口配置。 - INVALIDPARAMETERVALUE_NETWORKINTERFACENOTFOUND = "InvalidParameterValue.NetworkInterfaceNotFound" - - // 该操作仅对主网卡支持。 - INVALIDPARAMETERVALUE_ONLYSUPPORTEDFORMASTERNETWORKCARD = "InvalidParameterValue.OnlySupportedForMasterNetworkCard" - - // 参数值格式不匹配。 - INVALIDPARAMETERVALUE_PARAMETERMISMATCH = "InvalidParameterValue.ParameterMismatch" - - // 参数值不在指定范围。 - INVALIDPARAMETERVALUE_RANGE = "InvalidParameterValue.Range" - - // 参数值是一个系统保留对象。 - INVALIDPARAMETERVALUE_RESERVED = "InvalidParameterValue.Reserved" - - // 该资源已加入其他带宽包。 - INVALIDPARAMETERVALUE_RESOURCEALREADYEXISTED = "InvalidParameterValue.ResourceAlreadyExisted" - - // 该资源已过期。 - INVALIDPARAMETERVALUE_RESOURCEEXPIRED = "InvalidParameterValue.ResourceExpired" - - // 资源ID不正确。 - INVALIDPARAMETERVALUE_RESOURCEIDMALFORMED = "InvalidParameterValue.ResourceIdMalformed" - - // 该资源不在此带宽包中。 - INVALIDPARAMETERVALUE_RESOURCENOTEXISTED = "InvalidParameterValue.ResourceNotExisted" - - // 未查询到该资源。 - INVALIDPARAMETERVALUE_RESOURCENOTFOUND = "InvalidParameterValue.ResourceNotFound" - - // 该资源不支持此操作。 - INVALIDPARAMETERVALUE_RESOURCENOTSUPPORT = "InvalidParameterValue.ResourceNotSupport" - - // SSL-VPN-SERVER 云端网段和SSL-VPN-SERVER 客户端网段重叠。 - INVALIDPARAMETERVALUE_SSLCCNVPNSERVERCIDRCONFLICT = "InvalidParameterValue.SslCcnVpnServerCidrConflict" - - // 存在关机的主机还在使用当前资源,无法操作。 - INVALIDPARAMETERVALUE_STOPCHARGINGINSTANCEINUSE = "InvalidParameterValue.StopChargingInstanceInUse" - - // 子网CIDR冲突。 - INVALIDPARAMETERVALUE_SUBNETCONFLICT = "InvalidParameterValue.SubnetConflict" - - // CIDR与同一个私有网络内的另一个子网发生重叠。 - INVALIDPARAMETERVALUE_SUBNETOVERLAP = "InvalidParameterValue.SubnetOverlap" - - // 子网与辅助Cidr网段重叠。 - INVALIDPARAMETERVALUE_SUBNETOVERLAPASSISTCIDR = "InvalidParameterValue.SubnetOverlapAssistCidr" - - // 子网CIDR不合法。 - INVALIDPARAMETERVALUE_SUBNETRANGE = "InvalidParameterValue.SubnetRange" - - // 标签键重复。 - INVALIDPARAMETERVALUE_TAGDUPLICATEKEY = "InvalidParameterValue.TagDuplicateKey" - - // 重复的标签资源类型。 - INVALIDPARAMETERVALUE_TAGDUPLICATERESOURCETYPE = "InvalidParameterValue.TagDuplicateResourceType" - - // 标签键无效。 - INVALIDPARAMETERVALUE_TAGINVALIDKEY = "InvalidParameterValue.TagInvalidKey" - - // 标签键长度无效。 - INVALIDPARAMETERVALUE_TAGINVALIDKEYLEN = "InvalidParameterValue.TagInvalidKeyLen" - - // 标签值无效。 - INVALIDPARAMETERVALUE_TAGINVALIDVAL = "InvalidParameterValue.TagInvalidVal" - - // 标签键不存在。 - INVALIDPARAMETERVALUE_TAGKEYNOTEXISTS = "InvalidParameterValue.TagKeyNotExists" - - // 标签没有分配配额。 - INVALIDPARAMETERVALUE_TAGNOTALLOCATEDQUOTA = "InvalidParameterValue.TagNotAllocatedQuota" - - // 该标签和值不存在。 - INVALIDPARAMETERVALUE_TAGNOTEXISTED = "InvalidParameterValue.TagNotExisted" - - // 不支持的标签。 - INVALIDPARAMETERVALUE_TAGNOTSUPPORTTAG = "InvalidParameterValue.TagNotSupportTag" - - // '标签资源格式错误。 - INVALIDPARAMETERVALUE_TAGRESOURCEFORMATERROR = "InvalidParameterValue.TagResourceFormatError" - - // 标签时间戳超配。 - INVALIDPARAMETERVALUE_TAGTIMESTAMPEXCEEDED = "InvalidParameterValue.TagTimestampExceeded" - - // 标签值不存在。 - INVALIDPARAMETERVALUE_TAGVALNOTEXISTS = "InvalidParameterValue.TagValNotExists" - - // 无效参数值。参数值太长。 - INVALIDPARAMETERVALUE_TOOLONG = "InvalidParameterValue.TooLong" - - // 流量包ID格式错误。 - INVALIDPARAMETERVALUE_TRAFFICPACKAGEID = "InvalidParameterValue.TrafficPackageId" - - // 该流量包ID不合法。 - INVALIDPARAMETERVALUE_TRAFFICPACKAGEIDMALFORMED = "InvalidParameterValue.TrafficPackageIdMalformed" - - // 未查询到此流量包。 - INVALIDPARAMETERVALUE_TRAFFICPACKAGENOTFOUND = "InvalidParameterValue.TrafficPackageNotFound" - - // 指定的流量包不支持此操作 - INVALIDPARAMETERVALUE_TRAFFICPACKAGENOTSUPPORTED = "InvalidParameterValue.TrafficPackageNotSupported" - - // 该可用区不可用。 - INVALIDPARAMETERVALUE_UNAVAILABLEZONE = "InvalidParameterValue.UnavailableZone" - - // 目的网段和当前VPC的CIDR冲突。 - INVALIDPARAMETERVALUE_VPCCIDRCONFLICT = "InvalidParameterValue.VpcCidrConflict" - - // 当前功能不支持此专线网关。 - INVALIDPARAMETERVALUE_VPGTYPENOTMATCH = "InvalidParameterValue.VpgTypeNotMatch" - - // 目的网段和当前VPN通道的CIDR冲突。 - INVALIDPARAMETERVALUE_VPNCONNCIDRCONFLICT = "InvalidParameterValue.VpnConnCidrConflict" - - // VPN通道探测ip冲突。 - INVALIDPARAMETERVALUE_VPNCONNHEALTHCHECKIPCONFLICT = "InvalidParameterValue.VpnConnHealthCheckIpConflict" - - // 参数Zone的值与CDC所在Zone冲突。 - INVALIDPARAMETERVALUE_ZONECONFLICT = "InvalidParameterValue.ZoneConflict" - - // 指定弹性网卡的指定内网IP已经绑定了EIP,不能重复绑定。 - INVALIDPRIVATEIPADDRESS_ALREADYBINDEIP = "InvalidPrivateIpAddress.AlreadyBindEip" - - // 无效的路由策略ID(RouteId)。 - INVALIDROUTEID_NOTFOUND = "InvalidRouteId.NotFound" - - // 无效的路由表,路由表实例ID不合法。 - INVALIDROUTETABLEID_MALFORMED = "InvalidRouteTableId.Malformed" - - // 无效的路由表,路由表资源不存在,请再次核实您输入的资源信息是否正确。 - INVALIDROUTETABLEID_NOTFOUND = "InvalidRouteTableId.NotFound" - - // 无效的安全组,安全组实例ID不合法。 - INVALIDSECURITYGROUPID_MALFORMED = "InvalidSecurityGroupID.Malformed" - - // 无效的安全组,安全组实例ID不存在。 - INVALIDSECURITYGROUPID_NOTFOUND = "InvalidSecurityGroupID.NotFound" - - // 无效的VPC,VPC实例ID不合法。 - INVALIDVPCID_MALFORMED = "InvalidVpcId.Malformed" - - // 无效的VPC,VPC资源不存在。 - INVALIDVPCID_NOTFOUND = "InvalidVpcId.NotFound" - - // 无效的VPN网关,VPN实例ID不合法。 - INVALIDVPNGATEWAYID_MALFORMED = "InvalidVpnGatewayId.Malformed" - - // 无效的VPN网关,VPN实例不存在,请再次核实您输入的资源信息是否正确。 - INVALIDVPNGATEWAYID_NOTFOUND = "InvalidVpnGatewayId.NotFound" - - // 超过配额限制。 - LIMITEXCEEDED = "LimitExceeded" - - // 账号退还配额超过限制。 - LIMITEXCEEDED_ACCOUNTRETURNQUOTA = "LimitExceeded.AccountReturnQuota" - - // 接口请求次数超过限频。 - LIMITEXCEEDED_ACTIONLIMITED = "LimitExceeded.ActionLimited" - - // 分配IP地址数量达到上限。 - LIMITEXCEEDED_ADDRESS = "LimitExceeded.Address" - - // 租户申请的弹性IP超过上限。 - LIMITEXCEEDED_ADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.AddressQuotaLimitExceeded" - - // 实例关联快照策略数量达到上限。 - LIMITEXCEEDED_ATTACHEDSNAPSHOTPOLICYEXCEEDED = "LimitExceeded.AttachedSnapshotPolicyExceeded" - - // 带宽包配额超过限制。 - LIMITEXCEEDED_BANDWIDTHPACKAGEQUOTA = "LimitExceeded.BandwidthPackageQuota" - - // 当前带宽包加入资源上限。 - LIMITEXCEEDED_BANDWIDTHPACKAGERESOURCEQUOTA = "LimitExceeded.BandwidthPackageResourceQuota" - - // 超过更换IP配额。 - LIMITEXCEEDED_CHANGEADDRESSQUOTA = "LimitExceeded.ChangeAddressQuota" - - // VPC分配网段数量达到上限。 - LIMITEXCEEDED_CIDRBLOCK = "LimitExceeded.CidrBlock" - - // 当前实例关联的云联网数量达到上限。 - LIMITEXCEEDED_CURRENTINSTANCEATTACHEDCCNINSTANCES = "LimitExceeded.CurrentInstanceAttachedCcnInstances" - - // 租户每天申请的弹性IP超过上限。 - LIMITEXCEEDED_DAILYALLOCATEADDRESSQUOTALIMITEXCEEDED = "LimitExceeded.DailyAllocateAddressQuotaLimitExceeded" - - // 超过每日更换IP配额。 - LIMITEXCEEDED_DAILYCHANGEADDRESSQUOTA = "LimitExceeded.DailyChangeAddressQuota" - - // 实例绑定的弹性IP超过配额。 - LIMITEXCEEDED_INSTANCEADDRESSQUOTA = "LimitExceeded.InstanceAddressQuota" - - // 修改地址网络计费模式配额超过限制。 - LIMITEXCEEDED_MODIFYADDRESSINTERNETCHARGETYPEQUOTA = "LimitExceeded.ModifyAddressInternetChargeTypeQuota" - - // 每月地址找回配额超过限制。 - LIMITEXCEEDED_MONTHLYADDRESSRECOVERYQUOTA = "LimitExceeded.MonthlyAddressRecoveryQuota" - - // NAT网关数量已达到上限。 - LIMITEXCEEDED_NATGATEWAYLIMITEXCEEDED = "LimitExceeded.NatGatewayLimitExceeded" - - // 私有网络创建的NAT网关超过上限。 - LIMITEXCEEDED_NATGATEWAYPERVPCLIMITEXCEEDED = "LimitExceeded.NatGatewayPerVpcLimitExceeded" - - // 过滤参数名称超过限制。 - LIMITEXCEEDED_NUMBEROFFILTERS = "LimitExceeded.NumberOfFilters" - - // NAT网关绑定的弹性IP超过上限。 - LIMITEXCEEDED_PUBLICIPADDRESSPERNATGATEWAYLIMITEXCEEDED = "LimitExceeded.PublicIpAddressPerNatGatewayLimitExceeded" - - // 安全组规则数量超过上限。 - LIMITEXCEEDED_SECURITYGROUPPOLICYSET = "LimitExceeded.SecurityGroupPolicySet" - - // 子网分配子网段数量达到上限。 - LIMITEXCEEDED_SUBNETCIDRBLOCK = "LimitExceeded.SubnetCidrBlock" - - // 标签键已达到上限。 - LIMITEXCEEDED_TAGKEYEXCEEDED = "LimitExceeded.TagKeyExceeded" - - // 每个资源的标签键已达到上限。 - LIMITEXCEEDED_TAGKEYPERRESOURCEEXCEEDED = "LimitExceeded.TagKeyPerResourceExceeded" - - // 没有足够的标签配额。 - LIMITEXCEEDED_TAGNOTENOUGHQUOTA = "LimitExceeded.TagNotEnoughQuota" - - // 标签配额已满,无法创建资源。 - LIMITEXCEEDED_TAGQUOTA = "LimitExceeded.TagQuota" - - // 标签配额已达到上限。 - LIMITEXCEEDED_TAGQUOTAEXCEEDED = "LimitExceeded.TagQuotaExceeded" - - // 标签键的数目已达到上限。 - LIMITEXCEEDED_TAGTAGSEXCEEDED = "LimitExceeded.TagTagsExceeded" - - // 流量包配额超过限制。 - LIMITEXCEEDED_TRAFFICPACKAGEQUOTA = "LimitExceeded.TrafficPackageQuota" - - // 有效的对等个数超过配额上限。 - LIMITEXCEEDED_VPCPEERAVALIMITEXCEEDED = "LimitExceeded.VpcPeerAvaLimitExceeded" - - // 可创建的对等连接个数超过总上限。 - LIMITEXCEEDED_VPCPEERTOTALLIMITEXCEEDED = "LimitExceeded.VpcPeerTotalLimitExceeded" - - // 缺少参数错误。 - MISSINGPARAMETER = "MissingParameter" - - // 指定公网IP处于隔离状态。 - OPERATIONDENIED_ADDRESSINARREARS = "OperationDenied.AddressInArrears" - - // 互斥的任务正在执行。 - OPERATIONDENIED_MUTEXTASKRUNNING = "OperationDenied.MutexTaskRunning" - - // 资源被占用。 - RESOURCEINUSE = "ResourceInUse" - - // 指定IP地址已经在使用中。 - RESOURCEINUSE_ADDRESS = "ResourceInUse.Address" - - // 资源不足。 - RESOURCEINSUFFICIENT = "ResourceInsufficient" - - // 网段资源不足。 - RESOURCEINSUFFICIENT_CIDRBLOCK = "ResourceInsufficient.CidrBlock" - - // 子网IP资源不足, 无法分配IP。 - RESOURCEINSUFFICIENT_SUBNET = "ResourceInsufficient.Subnet" - - // 资源不存在。 - RESOURCENOTFOUND = "ResourceNotFound" - - // Svc不存在。 - RESOURCENOTFOUND_SVCNOTEXIST = "ResourceNotFound.SvcNotExist" - - // 资源不可用。 - RESOURCEUNAVAILABLE = "ResourceUnavailable" - - // 当前用户不在指定终端节点服务的白名单内。 - RESOURCEUNAVAILABLE_SERVICEWHITELISTNOTADDED = "ResourceUnavailable.ServiceWhiteListNotAdded" - - // 未授权操作。 - UNAUTHORIZEDOPERATION = "UnauthorizedOperation" - - // 无权限申请AnycastEip资源。 - UNAUTHORIZEDOPERATION_ANYCASTEIP = "UnauthorizedOperation.AnycastEip" - - // 绑定关系不存在。 - UNAUTHORIZEDOPERATION_ATTACHMENTNOTFOUND = "UnauthorizedOperation.AttachmentNotFound" - - // 未授权的用户。 - UNAUTHORIZEDOPERATION_INVALIDACCOUNT = "UnauthorizedOperation.InvalidAccount" - - // 账号未实名。 - UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" - - // 主IP不支持指定操作。 - UNAUTHORIZEDOPERATION_PRIMARYIP = "UnauthorizedOperation.PrimaryIp" - - // 对等连接本端VPC与对端VPC存在CIDR冲突,或一端与已建立的对等连接某一端冲突。 - UNAUTHORIZEDOPERATION_VPCPEERCIDRCONFLICT = "UnauthorizedOperation.VpcPeerCidrConflict" - - // 未知参数错误。 - UNKNOWNPARAMETER = "UnknownParameter" - - // 参数无法识别,可以尝试相似参数代替。 - UNKNOWNPARAMETER_WITHGUESS = "UnknownParameter.WithGuess" - - // 操作不支持。 - UNSUPPORTEDOPERATION = "UnsupportedOperation" - - // 不支持的账户。 - UNSUPPORTEDOPERATION_ACCOUNTNOTSUPPORTED = "UnsupportedOperation.AccountNotSupported" - - // 接口不存在。 - UNSUPPORTEDOPERATION_ACTIONNOTFOUND = "UnsupportedOperation.ActionNotFound" - - // 欠费状态不支持该操作。 - UNSUPPORTEDOPERATION_ADDRESSIPINARREAR = "UnsupportedOperation.AddressIpInArrear" - - // 此付费模式的IP地址不支持该操作。 - UNSUPPORTEDOPERATION_ADDRESSIPINTERNETCHARGETYPENOTPERMIT = "UnsupportedOperation.AddressIpInternetChargeTypeNotPermit" - - // 绑定此实例的IP地址不支持该操作。 - UNSUPPORTEDOPERATION_ADDRESSIPNOTSUPPORTINSTANCE = "UnsupportedOperation.AddressIpNotSupportInstance" - - // 此IP地址状态不支持该操作。 - UNSUPPORTEDOPERATION_ADDRESSIPSTATUSNOTPERMIT = "UnsupportedOperation.AddressIpStatusNotPermit" - - // 该地址状态不支持此操作。 - UNSUPPORTEDOPERATION_ADDRESSSTATUSNOTPERMIT = "UnsupportedOperation.AddressStatusNotPermit" - - // 资源不在指定的AppId下。 - UNSUPPORTEDOPERATION_APPIDMISMATCH = "UnsupportedOperation.AppIdMismatch" - - // APPId不存在。 - UNSUPPORTEDOPERATION_APPIDNOTFOUND = "UnsupportedOperation.AppIdNotFound" - - // CCN关联的其他vpc已经存在nat的路由 - UNSUPPORTEDOPERATION_ASSOCIATEDVPCOFCCNHADNATROUTE = "UnsupportedOperation.AssociatedVpcOfCcnHadNatRoute" - - // 绑定关系已存在。 - UNSUPPORTEDOPERATION_ATTACHMENTALREADYEXISTS = "UnsupportedOperation.AttachmentAlreadyExists" - - // 绑定关系不存在。 - UNSUPPORTEDOPERATION_ATTACHMENTNOTFOUND = "UnsupportedOperation.AttachmentNotFound" - - // 当前云联网还有预付费带宽未到期,不支持主动删除。 - UNSUPPORTEDOPERATION_BANDWIDTHNOTEXPIRED = "UnsupportedOperation.BandwidthNotExpired" - - // 该带宽包不支持此操作。 - UNSUPPORTEDOPERATION_BANDWIDTHPACKAGEIDNOTSUPPORTED = "UnsupportedOperation.BandwidthPackageIdNotSupported" - - // 已绑定EIP。 - UNSUPPORTEDOPERATION_BINDEIP = "UnsupportedOperation.BindEIP" - - // 指定VPC CIDR范围不支持私有网络和基础网络设备互通。 - UNSUPPORTEDOPERATION_CIDRUNSUPPORTEDCLASSICLINK = "UnsupportedOperation.CIDRUnSupportedClassicLink" - - // 实例已关联CCN。 - UNSUPPORTEDOPERATION_CCNATTACHED = "UnsupportedOperation.CcnAttached" - - // 云联网实例不支持跨账号关联。 - UNSUPPORTEDOPERATION_CCNCROSSACCOUNT = "UnsupportedOperation.CcnCrossAccount" - - // 当前云联网有流日志,不支持删除。 - UNSUPPORTEDOPERATION_CCNHASFLOWLOG = "UnsupportedOperation.CcnHasFlowLog" - - // CCN实例所属账号未通过联通审批。 - UNSUPPORTEDOPERATION_CCNINSTANCEACCOUNTNOTAPPROVEDBYUNICOM = "UnsupportedOperation.CcnInstanceAccountNotApprovedByUnicom" - - // 实例未关联CCN。 - UNSUPPORTEDOPERATION_CCNNOTATTACHED = "UnsupportedOperation.CcnNotAttached" - - // 跨账号场景下不支持自驾云账号实例 关联普通账号云联网。 - UNSUPPORTEDOPERATION_CCNORDINARYACCOUNTREFUSEATTACH = "UnsupportedOperation.CcnOrdinaryAccountRefuseAttach" - - // 指定的路由表不存在。 - UNSUPPORTEDOPERATION_CCNROUTETABLENOTEXIST = "UnsupportedOperation.CcnRouteTableNotExist" - - // CDC子网不支持创建非本地网关类型的路由。 - UNSUPPORTEDOPERATION_CDCSUBNETNOTSUPPORTUNLOCALGATEWAY = "UnsupportedOperation.CdcSubnetNotSupportUnLocalGateway" - - // 实例已经和VPC绑定。 - UNSUPPORTEDOPERATION_CLASSICINSTANCEIDALREADYEXISTS = "UnsupportedOperation.ClassicInstanceIdAlreadyExists" - - // 负载均衡的安全组规则已达到上限。 - UNSUPPORTEDOPERATION_CLBPOLICYEXCEEDLIMIT = "UnsupportedOperation.ClbPolicyExceedLimit" - - // 公网Clb不支持该规则。 - UNSUPPORTEDOPERATION_CLBPOLICYLIMIT = "UnsupportedOperation.ClbPolicyLimit" - - // 与该VPC下的TKE容器的网段重叠。 - UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" - - // 当前账号非联通账号。 - UNSUPPORTEDOPERATION_CURRENTACCOUNTISNOTUNICOMACCOUNT = "UnsupportedOperation.CurrentAccountIsNotUnicomAccount" - - // 当前查询地域非跨境。 - UNSUPPORTEDOPERATION_CURRENTQUERYREGIONISNOTCROSSBORDER = "UnsupportedOperation.CurrentQueryRegionIsNotCrossBorder" - - // 该专线网关存在关联的NAT规则,不允许删除,请先删调所有的NAT规则。 - UNSUPPORTEDOPERATION_DCGATEWAYNATRULEEXISTS = "UnsupportedOperation.DCGatewayNatRuleExists" - - // 指定的VPC未发现专线网关。 - UNSUPPORTEDOPERATION_DCGATEWAYSNOTFOUNDINVPC = "UnsupportedOperation.DcGatewaysNotFoundInVpc" - - // 禁止删除默认路由表。 - UNSUPPORTEDOPERATION_DELDEFAULTROUTE = "UnsupportedOperation.DelDefaultRoute" - - // 禁止删除已关联子网的路由表。 - UNSUPPORTEDOPERATION_DELROUTEWITHSUBNET = "UnsupportedOperation.DelRouteWithSubnet" - - // VPN通道状态为更新中/销毁中/创建中,不支持此操作。 - UNSUPPORTEDOPERATION_DELETEVPNCONNINVALIDSTATE = "UnsupportedOperation.DeleteVpnConnInvalidState" - - // 专线网关正在更新BGP Community属性。 - UNSUPPORTEDOPERATION_DIRECTCONNECTGATEWAYISUPDATINGCOMMUNITY = "UnsupportedOperation.DirectConnectGatewayIsUpdatingCommunity" - - // 指定的路由策略已发布至云联网,请先撤销。 - UNSUPPORTEDOPERATION_DISABLEDNOTIFYCCN = "UnsupportedOperation.DisabledNotifyCcn" - - // 创建DPDK NAT流日志时,采集类型只支持全部。 - UNSUPPORTEDOPERATION_DPDKNATFLOWLOGONLYSUPPORTALLTRAFFICTYPE = "UnsupportedOperation.DpdkNatFlowLogOnlySupportAllTrafficType" - - // 安全组规则重复。 - UNSUPPORTEDOPERATION_DUPLICATEPOLICY = "UnsupportedOperation.DuplicatePolicy" - - // 不支持ECMP。 - UNSUPPORTEDOPERATION_ECMP = "UnsupportedOperation.Ecmp" - - // 和云联网的路由形成ECMP。 - UNSUPPORTEDOPERATION_ECMPWITHCCNROUTE = "UnsupportedOperation.EcmpWithCcnRoute" - - // 和用户自定义的路由形成ECMP。 - UNSUPPORTEDOPERATION_ECMPWITHUSERROUTE = "UnsupportedOperation.EcmpWithUserRoute" - - // 当前地域不支持启用组播。 - UNSUPPORTEDOPERATION_ENABLEMULTICAST = "UnsupportedOperation.EnableMulticast" - - // 终端节点服务本身不能是终端节点。 - UNSUPPORTEDOPERATION_ENDPOINTSERVICE = "UnsupportedOperation.EndPointService" - - // 指定ResourceId对应的流日志已经创建 - UNSUPPORTEDOPERATION_FLOWLOGINSTANCEEXISTED = "UnsupportedOperation.FlowLogInstanceExisted" - - // 不支持创建流日志:当前弹性网卡绑定的是KO机型。 - UNSUPPORTEDOPERATION_FLOWLOGSNOTSUPPORTKOINSTANCEENI = "UnsupportedOperation.FlowLogsNotSupportKoInstanceEni" - - // 不支持创建流日志:当前弹性网卡未绑定实例。 - UNSUPPORTEDOPERATION_FLOWLOGSNOTSUPPORTNULLINSTANCEENI = "UnsupportedOperation.FlowLogsNotSupportNullInstanceEni" - - // 该种类型地址不支持此操作。 - UNSUPPORTEDOPERATION_INCORRECTADDRESSRESOURCETYPE = "UnsupportedOperation.IncorrectAddressResourceType" - - // 用户配置的实例和路由表不匹配。 - UNSUPPORTEDOPERATION_INSTANCEANDRTBNOTMATCH = "UnsupportedOperation.InstanceAndRtbNotMatch" - - // 当前云联网`%(value)s`的CdcId与传入实例的CdcId不一致,不支持关联。 - UNSUPPORTEDOPERATION_INSTANCECDCIDNOTMATCHCCNCDCID = "UnsupportedOperation.InstanceCdcIdNotMatchCcnCdcId" - - // 指定实例资源不匹配。 - UNSUPPORTEDOPERATION_INSTANCEMISMATCH = "UnsupportedOperation.InstanceMismatch" - - // 跨账号场景下不支持普通账号实例关联自驾云账号云联网。 - UNSUPPORTEDOPERATION_INSTANCEORDINARYACCOUNTREFUSEATTACH = "UnsupportedOperation.InstanceOrdinaryAccountRefuseAttach" - - // 该地址绑定的实例状态不支持此操作。 - UNSUPPORTEDOPERATION_INSTANCESTATENOTSUPPORTED = "UnsupportedOperation.InstanceStateNotSupported" - - // 账户余额不足。 - UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" - - // 不支持该操作。 - UNSUPPORTEDOPERATION_INVALIDACTION = "UnsupportedOperation.InvalidAction" - - // 该地址的网络付费方式不支持此操作。 - UNSUPPORTEDOPERATION_INVALIDADDRESSINTERNETCHARGETYPE = "UnsupportedOperation.InvalidAddressInternetChargeType" - - // 该地址状态不支持此操作。 - UNSUPPORTEDOPERATION_INVALIDADDRESSSTATE = "UnsupportedOperation.InvalidAddressState" - - // 无效的实例状态。 - UNSUPPORTEDOPERATION_INVALIDINSTANCESTATE = "UnsupportedOperation.InvalidInstanceState" - - // 该计费方式不支持此操作。 - UNSUPPORTEDOPERATION_INVALIDRESOURCEINTERNETCHARGETYPE = "UnsupportedOperation.InvalidResourceInternetChargeType" - - // 不支持加入此协议的带宽包。 - UNSUPPORTEDOPERATION_INVALIDRESOURCEPROTOCOL = "UnsupportedOperation.InvalidResourceProtocol" - - // 资源状态不合法。 - UNSUPPORTEDOPERATION_INVALIDSTATE = "UnsupportedOperation.InvalidState" - - // 当前状态不支持发布至云联网,请重试。 - UNSUPPORTEDOPERATION_INVALIDSTATUSNOTIFYCCN = "UnsupportedOperation.InvalidStatusNotifyCcn" - - // 关联当前云联网的实例的账号存在不是金融云账号。 - UNSUPPORTEDOPERATION_ISNOTFINANCEACCOUNT = "UnsupportedOperation.IsNotFinanceAccount" - - // 该ISP不支持此操作。 - UNSUPPORTEDOPERATION_ISPNOTSUPPORTED = "UnsupportedOperation.IspNotSupported" - - // 指定的CDC已存在本地网关。 - UNSUPPORTEDOPERATION_LOCALGATEWAYALREADYEXISTS = "UnsupportedOperation.LocalGatewayAlreadyExists" - - // 资源被锁定。 - UNSUPPORTEDOPERATION_LOCKEDRESOURCES = "UnsupportedOperation.LockedResources" - - // 账户不支持修改公网IP的该属性。 - UNSUPPORTEDOPERATION_MODIFYADDRESSATTRIBUTE = "UnsupportedOperation.ModifyAddressAttribute" - - // VPC实例内部有账号纬度的IPv6白名单,不支持关联多云联网。 - UNSUPPORTEDOPERATION_MULTIPLEVPCNOTSUPPORTATTACHACCOUNTHASIPV6 = "UnsupportedOperation.MultipleVpcNotSupportAttachAccountHasIpv6" - - // 资源互斥操作任务正在执行。 - UNSUPPORTEDOPERATION_MUTEXOPERATIONTASKRUNNING = "UnsupportedOperation.MutexOperationTaskRunning" - - // NAT网关的公网IP不存在。 - UNSUPPORTEDOPERATION_NATGATEWAYEIPNOTEXISTS = "UnsupportedOperation.NatGatewayEipNotExists" - - // NAT网关存在未解绑的IP。 - UNSUPPORTEDOPERATION_NATGATEWAYHADEIPUNASSOCIATE = "UnsupportedOperation.NatGatewayHadEipUnassociate" - - // SNAT/DNAT转换规则所指定的内网IP已绑定了其他的规则,无法重复绑定。 - UNSUPPORTEDOPERATION_NATGATEWAYRULEPIPEXISTS = "UnsupportedOperation.NatGatewayRulePipExists" - - // SNAT转换规则的内网IP需为虚拟机上网卡所用的IP。 - UNSUPPORTEDOPERATION_NATGATEWAYSNATPIPNEEDVM = "UnsupportedOperation.NatGatewaySnatPipNeedVm" - - // NAT网关的SNAT转换规则不存在。 - UNSUPPORTEDOPERATION_NATGATEWAYSNATRULENOTEXISTS = "UnsupportedOperation.NatGatewaySnatRuleNotExists" - - // NAT网关类型不支持SNAT规则。 - UNSUPPORTEDOPERATION_NATGATEWAYTYPENOTSUPPORTSNAT = "UnsupportedOperation.NatGatewayTypeNotSupportSNAT" - - // NAT实例不支持该操作。 - UNSUPPORTEDOPERATION_NATNOTSUPPORTED = "UnsupportedOperation.NatNotSupported" - - // 指定的子网不支持创建本地网关类型的路由。 - UNSUPPORTEDOPERATION_NORMALSUBNETNOTSUPPORTLOCALGATEWAY = "UnsupportedOperation.NormalSubnetNotSupportLocalGateway" - - // 当前实例已被封禁,无法进行此操作。 - UNSUPPORTEDOPERATION_NOTLOCKEDINSTANCEOPERATION = "UnsupportedOperation.NotLockedInstanceOperation" - - // 目的端的服务在IP申请中使用的实例ID和这里传入的不匹配。 - UNSUPPORTEDOPERATION_NOTMATCHTARGETSERVICE = "UnsupportedOperation.NotMatchTargetService" - - // 当前云联网实例未处于申请中状态,无法进行操作。 - UNSUPPORTEDOPERATION_NOTPENDINGCCNINSTANCE = "UnsupportedOperation.NotPendingCcnInstance" - - // 当前云联网为非后付费类型,无法进行此操作。 - UNSUPPORTEDOPERATION_NOTPOSTPAIDCCNOPERATION = "UnsupportedOperation.NotPostpaidCcnOperation" - - // 当前云联网不支持同时关联EDGE实例和跨境实例 - UNSUPPORTEDOPERATION_NOTSUPPORTATTACHEDGEANDCROSSBORDERINSTANCE = "UnsupportedOperation.NotSupportAttachEdgeAndCrossBorderInstance" - - // 不支持删除默认路由表。 - UNSUPPORTEDOPERATION_NOTSUPPORTDELETEDEFAULTROUTETABLE = "UnsupportedOperation.NotSupportDeleteDefaultRouteTable" - - // 公有云到黑石的对等连接不支持删除。 - UNSUPPORTEDOPERATION_NOTSUPPORTDELETEVPCBMPEER = "UnsupportedOperation.NotSupportDeleteVpcBmPeer" - - // 该地址类型不支持释放操作。 - UNSUPPORTEDOPERATION_NOTSUPPORTEDADDRESSIPSCHARGETYPE = "UnsupportedOperation.NotSupportedAddressIpsChargeType" - - // 此地域没有上线出口二资源,请到北京/广州/南京购买。 - UNSUPPORTEDOPERATION_NOTSUPPORTEDPURCHASECENTEREGRESSRESOURCE = "UnsupportedOperation.NotSupportedPurchaseCenterEgressResource" - - // 当前云联网不支持更新路由发布。 - UNSUPPORTEDOPERATION_NOTSUPPORTEDUPDATECCNROUTEPUBLISH = "UnsupportedOperation.NotSupportedUpdateCcnRoutePublish" - - // 指定的路由策略不支持发布或撤销至云联网。 - UNSUPPORTEDOPERATION_NOTIFYCCN = "UnsupportedOperation.NotifyCcn" - - // 此产品计费方式已下线,请尝试其他计费方式。 - UNSUPPORTEDOPERATION_OFFLINECHARGETYPE = "UnsupportedOperation.OfflineChargeType" - - // 仅支持专业版Ckafka。 - UNSUPPORTEDOPERATION_ONLYSUPPORTPROFESSIONKAFKA = "UnsupportedOperation.OnlySupportProfessionKafka" - - // 预付费云联网只支持地域间限速。 - UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTINTERREGIONLIMIT = "UnsupportedOperation.PrepaidCcnOnlySupportInterRegionLimit" - - // 指定的值是主IP。 - UNSUPPORTEDOPERATION_PRIMARYIP = "UnsupportedOperation.PrimaryIp" - - // Nat网关至少存在一个弹性IP,弹性IP不能解绑。 - UNSUPPORTEDOPERATION_PUBLICIPADDRESSDISASSOCIATE = "UnsupportedOperation.PublicIpAddressDisassociate" - - // 绑定NAT网关的弹性IP不是BGP性质的IP。 - UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTBGPIP = "UnsupportedOperation.PublicIpAddressIsNotBGPIp" - - // 绑定NAT网关的弹性IP不存在。 - UNSUPPORTEDOPERATION_PUBLICIPADDRESSISNOTEXISTED = "UnsupportedOperation.PublicIpAddressIsNotExisted" - - // 绑定NAT网关的弹性IP不是按流量计费的。 - UNSUPPORTEDOPERATION_PUBLICIPADDRESSNOTBILLEDBYTRAFFIC = "UnsupportedOperation.PublicIpAddressNotBilledByTraffic" - - // 当前账号不能在该地域使用产品。 - UNSUPPORTEDOPERATION_PURCHASELIMIT = "UnsupportedOperation.PurchaseLimit" - - // 记录已存在。 - UNSUPPORTEDOPERATION_RECORDEXISTS = "UnsupportedOperation.RecordExists" - - // 记录不存在。 - UNSUPPORTEDOPERATION_RECORDNOTEXISTS = "UnsupportedOperation.RecordNotExists" - - // 资源处于不可用状态,禁止操作。 - UNSUPPORTEDOPERATION_RESOURCEISINVALIDSTATE = "UnsupportedOperation.ResourceIsInvalidState" - - // 输入的资源ID与IP绑定的资源不匹配,请检查。 - UNSUPPORTEDOPERATION_RESOURCEMISMATCH = "UnsupportedOperation.ResourceMismatch" - - // 未找到相关角色,请确认角色是否授权。 - UNSUPPORTEDOPERATION_ROLENOTFOUND = "UnsupportedOperation.RoleNotFound" - - // 路由表绑定了子网。 - UNSUPPORTEDOPERATION_ROUTETABLEHASSUBNETRULE = "UnsupportedOperation.RouteTableHasSubnetRule" - - // SSL客户端状态不可用,不支持下载 - UNSUPPORTEDOPERATION_SSLCLIENTCERTDISABLEUNSUPPORTEDDOWNLOADSSLCLIENTCERT = "UnsupportedOperation.SSLClientCertDisableUnsupportedDownloadSSLClientCert" - - // 实例已关联快照策略。 - UNSUPPORTEDOPERATION_SNAPSHOTATTACHED = "UnsupportedOperation.SnapshotAttached" - - // 快照备份策略不支持修改。 - UNSUPPORTEDOPERATION_SNAPSHOTBACKUPTYPEMODIFY = "UnsupportedOperation.SnapshotBackupTypeModify" - - // 快照文件生成失败。 - UNSUPPORTEDOPERATION_SNAPSHOTFILEFAILED = "UnsupportedOperation.SnapshotFileFailed" - - // 快照文件已过期或删除。 - UNSUPPORTEDOPERATION_SNAPSHOTFILENOEXIST = "UnsupportedOperation.SnapshotFileNoExist" - - // 快照文件正在生成中,请稍后查看。 - UNSUPPORTEDOPERATION_SNAPSHOTFILEPROCESSING = "UnsupportedOperation.SnapshotFileProcessing" - - // 一次仅支持关联一个地域的实例。 - UNSUPPORTEDOPERATION_SNAPSHOTINSTANCEREGIONDIFF = "UnsupportedOperation.SnapshotInstanceRegionDiff" - - // 实例未关联快照策略。 - UNSUPPORTEDOPERATION_SNAPSHOTNOTATTACHED = "UnsupportedOperation.SnapshotNotAttached" - - // SNAT子网 不支持分配IP。 - UNSUPPORTEDOPERATION_SNATSUBNET = "UnsupportedOperation.SnatSubnet" - - // 指定的终端节点服务所创建的终端节点不支持绑定安全组。 - UNSUPPORTEDOPERATION_SPECIALENDPOINTSERVICE = "UnsupportedOperation.SpecialEndPointService" - - // SslVpnClientId 不存在。 - UNSUPPORTEDOPERATION_SSLVPNCLIENTIDNOTFOUND = "UnsupportedOperation.SslVpnClientIdNotFound" - - // 中继网卡不支持该操作。 - UNSUPPORTEDOPERATION_SUBENINOTSUPPORTTRUNKING = "UnsupportedOperation.SubEniNotSupportTrunking" - - // 子网不存在。 - UNSUPPORTEDOPERATION_SUBNETNOTEXISTS = "UnsupportedOperation.SubnetNotExists" - - // 系统路由,禁止操作。 - UNSUPPORTEDOPERATION_SYSTEMROUTE = "UnsupportedOperation.SystemRoute" - - // 标签正在分配中。 - UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" - - // 标签正在释放中。 - UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" - - // 标签没有权限。 - UNSUPPORTEDOPERATION_TAGNOTPERMIT = "UnsupportedOperation.TagNotPermit" - - // 不支持使用系统预留的标签键。 - UNSUPPORTEDOPERATION_TAGSYSTEMRESERVEDTAGKEY = "UnsupportedOperation.TagSystemReservedTagKey" - - // 账号ID不存在。 - UNSUPPORTEDOPERATION_UINNOTFOUND = "UnsupportedOperation.UinNotFound" - - // 不支持跨境。 - UNSUPPORTEDOPERATION_UNABLECROSSBORDER = "UnsupportedOperation.UnableCrossBorder" - - // 当前云联网无法关联金融云实例。 - UNSUPPORTEDOPERATION_UNABLECROSSFINANCE = "UnsupportedOperation.UnableCrossFinance" - - // 未分配IPv6网段。 - UNSUPPORTEDOPERATION_UNASSIGNCIDRBLOCK = "UnsupportedOperation.UnassignCidrBlock" - - // 未绑定EIP。 - UNSUPPORTEDOPERATION_UNBINDEIP = "UnsupportedOperation.UnbindEIP" - - // 账户还有未支付订单,请先完成付款。 - UNSUPPORTEDOPERATION_UNPAIDORDERALREADYEXISTS = "UnsupportedOperation.UnpaidOrderAlreadyExists" - - // 不支持绑定LocalZone弹性公网IP。 - UNSUPPORTEDOPERATION_UNSUPPORTEDBINDLOCALZONEEIP = "UnsupportedOperation.UnsupportedBindLocalZoneEIP" - - // 指定机型不支持弹性网卡。 - UNSUPPORTEDOPERATION_UNSUPPORTEDINSTANCEFAMILY = "UnsupportedOperation.UnsupportedInstanceFamily" - - // 暂无法在此国家/地区提供该服务。 - UNSUPPORTEDOPERATION_UNSUPPORTEDREGION = "UnsupportedOperation.UnsupportedRegion" - - // 当前用户付费类型不支持创建所选付费类型的云联网。 - UNSUPPORTEDOPERATION_USERANDCCNCHARGETYPENOTMATCH = "UnsupportedOperation.UserAndCcnChargeTypeNotMatch" - - // 指定安全组规则版本号和当前最新版本不一致。 - UNSUPPORTEDOPERATION_VERSIONMISMATCH = "UnsupportedOperation.VersionMismatch" - - // 资源不属于同一个VPC。 - UNSUPPORTEDOPERATION_VPCMISMATCH = "UnsupportedOperation.VpcMismatch" - - // 对等连接已存在。 - UNSUPPORTEDOPERATION_VPCPEERALREADYEXIST = "UnsupportedOperation.VpcPeerAlreadyExist" - - // VPC网段存在CIDR冲突。 - UNSUPPORTEDOPERATION_VPCPEERCIDRCONFLICT = "UnsupportedOperation.VpcPeerCidrConflict" - - // 对等连接状态错误。 - UNSUPPORTEDOPERATION_VPCPEERINVALIDSTATECHANGE = "UnsupportedOperation.VpcPeerInvalidStateChange" - - // 该账不能发起操作。 - UNSUPPORTEDOPERATION_VPCPEERPURVIEWERROR = "UnsupportedOperation.VpcPeerPurviewError" - - // 当前通道为非可用状态,不支持该操作。 - UNSUPPORTEDOPERATION_VPNCONNINVALIDSTATE = "UnsupportedOperation.VpnConnInvalidState" - - // VPC类型VPN网关必须携带VpcId。 - UNSUPPORTEDOPERATION_VPNGWVPCIDMUSTHAVE = "UnsupportedOperation.VpnGwVpcIdMustHave" - - // 指定资源在不同的可用区。 - UNSUPPORTEDOPERATION_ZONEMISMATCH = "UnsupportedOperation.ZoneMismatch" - - // 已经达到指定区域vpc资源申请数量上限。 - VPCLIMITEXCEEDED = "VpcLimitExceeded" -) diff --git a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/models.go b/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/models.go deleted file mode 100644 index 4c2c44b825f8..000000000000 --- a/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/vpc/v20170312/models.go +++ /dev/null @@ -1,26035 +0,0 @@ -/* -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 v20170312 - -import ( - "encoding/json" - - tcerr "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/errors" - tchttp "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go/common/http" -) - -// Predefined struct for user -type AcceptAttachCcnInstancesRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 接受关联实例列表。 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -type AcceptAttachCcnInstancesRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 接受关联实例列表。 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -func (r *AcceptAttachCcnInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AcceptAttachCcnInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AcceptAttachCcnInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AcceptAttachCcnInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AcceptAttachCcnInstancesResponse struct { - *tchttp.BaseResponse - Response *AcceptAttachCcnInstancesResponseParams `json:"Response"` -} - -func (r *AcceptAttachCcnInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AcceptAttachCcnInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AcceptVpcPeeringConnectionRequestParams struct { - // 对等连接唯一ID。 - PeeringConnectionId *string `json:"PeeringConnectionId,omitempty" name:"PeeringConnectionId"` -} - -type AcceptVpcPeeringConnectionRequest struct { - *tchttp.BaseRequest - - // 对等连接唯一ID。 - PeeringConnectionId *string `json:"PeeringConnectionId,omitempty" name:"PeeringConnectionId"` -} - -func (r *AcceptVpcPeeringConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AcceptVpcPeeringConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "PeeringConnectionId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AcceptVpcPeeringConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AcceptVpcPeeringConnectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AcceptVpcPeeringConnectionResponse struct { - *tchttp.BaseResponse - Response *AcceptVpcPeeringConnectionResponseParams `json:"Response"` -} - -func (r *AcceptVpcPeeringConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AcceptVpcPeeringConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type AccessPolicy struct { - // 目的CIDR - TargetCidr *string `json:"TargetCidr,omitempty" name:"TargetCidr"` - - // 策略ID - VpnGatewayIdSslAccessPolicyId *string `json:"VpnGatewayIdSslAccessPolicyId,omitempty" name:"VpnGatewayIdSslAccessPolicyId"` - - // 是否对所有用户都生效。1 生效 0不生效 - ForAllClient *uint64 `json:"ForAllClient,omitempty" name:"ForAllClient"` - - // 用户组ID - UserGroupIds []*string `json:"UserGroupIds,omitempty" name:"UserGroupIds"` - - // 更新时间 - UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` - - // Remark - // 注意:此字段可能返回 null,表示取不到有效值。 - Remark *string `json:"Remark,omitempty" name:"Remark"` -} - -type AccountAttribute struct { - // 属性名 - AttributeName *string `json:"AttributeName,omitempty" name:"AttributeName"` - - // 属性值 - AttributeValues []*string `json:"AttributeValues,omitempty" name:"AttributeValues"` -} - -// Predefined struct for user -type AddBandwidthPackageResourcesRequestParams struct { - // 资源唯一ID,当前支持EIP资源和LB资源,形如'eip-xxxx', 'lb-xxxx' - ResourceIds []*string `json:"ResourceIds,omitempty" name:"ResourceIds"` - - // 带宽包唯一标识ID,形如'bwp-xxxx' - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 带宽包类型,当前支持'BGP'类型,表示内部资源是BGP IP。 - NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` - - // 资源类型,包括'Address', 'LoadBalance' - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 带宽包协议类型。当前支持'ipv4'和'ipv6'协议类型。 - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` -} - -type AddBandwidthPackageResourcesRequest struct { - *tchttp.BaseRequest - - // 资源唯一ID,当前支持EIP资源和LB资源,形如'eip-xxxx', 'lb-xxxx' - ResourceIds []*string `json:"ResourceIds,omitempty" name:"ResourceIds"` - - // 带宽包唯一标识ID,形如'bwp-xxxx' - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 带宽包类型,当前支持'BGP'类型,表示内部资源是BGP IP。 - NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` - - // 资源类型,包括'Address', 'LoadBalance' - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 带宽包协议类型。当前支持'ipv4'和'ipv6'协议类型。 - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` -} - -func (r *AddBandwidthPackageResourcesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AddBandwidthPackageResourcesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ResourceIds") - delete(f, "BandwidthPackageId") - delete(f, "NetworkType") - delete(f, "ResourceType") - delete(f, "Protocol") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AddBandwidthPackageResourcesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AddBandwidthPackageResourcesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AddBandwidthPackageResourcesResponse struct { - *tchttp.BaseResponse - Response *AddBandwidthPackageResourcesResponseParams `json:"Response"` -} - -func (r *AddBandwidthPackageResourcesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AddBandwidthPackageResourcesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AddIp6RulesRequestParams struct { - // IPV6转换实例唯一ID,形如ip6-xxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // IPV6转换规则信息 - Ip6RuleInfos []*Ip6RuleInfo `json:"Ip6RuleInfos,omitempty" name:"Ip6RuleInfos"` - - // IPV6转换规则名称 - Ip6RuleName *string `json:"Ip6RuleName,omitempty" name:"Ip6RuleName"` -} - -type AddIp6RulesRequest struct { - *tchttp.BaseRequest - - // IPV6转换实例唯一ID,形如ip6-xxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // IPV6转换规则信息 - Ip6RuleInfos []*Ip6RuleInfo `json:"Ip6RuleInfos,omitempty" name:"Ip6RuleInfos"` - - // IPV6转换规则名称 - Ip6RuleName *string `json:"Ip6RuleName,omitempty" name:"Ip6RuleName"` -} - -func (r *AddIp6RulesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AddIp6RulesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6TranslatorId") - delete(f, "Ip6RuleInfos") - delete(f, "Ip6RuleName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AddIp6RulesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AddIp6RulesResponseParams struct { - // IPV6转换规则唯一ID数组,形如rule6-xxxxxxxx - Ip6RuleSet []*string `json:"Ip6RuleSet,omitempty" name:"Ip6RuleSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AddIp6RulesResponse struct { - *tchttp.BaseResponse - Response *AddIp6RulesResponseParams `json:"Response"` -} - -func (r *AddIp6RulesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AddIp6RulesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AddTemplateMemberRequestParams struct { - // 参数模板实例ID,支持IP地址、协议端口、IP地址组、协议端口组四种参数模板的实例ID。 - TemplateId *string `json:"TemplateId,omitempty" name:"TemplateId"` - - // 需要添加的参数模板成员信息,支持IP地址、协议端口、IP地址组、协议端口组四种类型,类型需要与TemplateId参数类型一致。 - TemplateMember []*MemberInfo `json:"TemplateMember,omitempty" name:"TemplateMember"` -} - -type AddTemplateMemberRequest struct { - *tchttp.BaseRequest - - // 参数模板实例ID,支持IP地址、协议端口、IP地址组、协议端口组四种参数模板的实例ID。 - TemplateId *string `json:"TemplateId,omitempty" name:"TemplateId"` - - // 需要添加的参数模板成员信息,支持IP地址、协议端口、IP地址组、协议端口组四种类型,类型需要与TemplateId参数类型一致。 - TemplateMember []*MemberInfo `json:"TemplateMember,omitempty" name:"TemplateMember"` -} - -func (r *AddTemplateMemberRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AddTemplateMemberRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TemplateId") - delete(f, "TemplateMember") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AddTemplateMemberRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AddTemplateMemberResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AddTemplateMemberResponse struct { - *tchttp.BaseResponse - Response *AddTemplateMemberResponseParams `json:"Response"` -} - -func (r *AddTemplateMemberResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AddTemplateMemberResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type Address struct { - // `EIP`的`ID`,是`EIP`的唯一标识。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // `EIP`名称。 - AddressName *string `json:"AddressName,omitempty" name:"AddressName"` - - // `EIP`状态,包含'CREATING'(创建中),'BINDING'(绑定中),'BIND'(已绑定),'UNBINDING'(解绑中),'UNBIND'(已解绑),'OFFLINING'(释放中),'BIND_ENI'(绑定悬空弹性网卡) - AddressStatus *string `json:"AddressStatus,omitempty" name:"AddressStatus"` - - // 外网IP地址 - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` - - // 绑定的资源实例`ID`。可能是一个`CVM`,`NAT`。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 创建时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 绑定的弹性网卡ID - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 绑定的资源内网ip - PrivateAddressIp *string `json:"PrivateAddressIp,omitempty" name:"PrivateAddressIp"` - - // 资源隔离状态。true表示eip处于隔离状态,false表示资源处于未隔离状态 - IsArrears *bool `json:"IsArrears,omitempty" name:"IsArrears"` - - // 资源封堵状态。true表示eip处于封堵状态,false表示eip处于未封堵状态 - IsBlocked *bool `json:"IsBlocked,omitempty" name:"IsBlocked"` - - // eip是否支持直通模式。true表示eip支持直通模式,false表示资源不支持直通模式 - IsEipDirectConnection *bool `json:"IsEipDirectConnection,omitempty" name:"IsEipDirectConnection"` - - // EIP 资源类型,包括CalcIP、WanIP、EIP和AnycastEIP、高防EIP。其中:`CalcIP` 表示设备 IP,`WanIP` 表示普通公网 IP,`EIP` 表示弹性公网 IP,`AnycastEip` 表示加速 EIP,`AntiDDoSEIP`表示高防EIP。 - AddressType *string `json:"AddressType,omitempty" name:"AddressType"` - - // eip是否在解绑后自动释放。true表示eip将会在解绑后自动释放,false表示eip在解绑后不会自动释放 - CascadeRelease *bool `json:"CascadeRelease,omitempty" name:"CascadeRelease"` - - // EIP ALG开启的协议类型。 - EipAlgType *AlgType `json:"EipAlgType,omitempty" name:"EipAlgType"` - - // 弹性公网IP的运营商信息,当前可能返回值包括"CMCC","CTCC","CUCC","BGP" - InternetServiceProvider *string `json:"InternetServiceProvider,omitempty" name:"InternetServiceProvider"` - - // 是否本地带宽EIP - LocalBgp *bool `json:"LocalBgp,omitempty" name:"LocalBgp"` - - // 弹性公网IP的带宽值。注意,传统账户类型账户的弹性公网IP没有带宽属性,值为空。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Bandwidth *uint64 `json:"Bandwidth,omitempty" name:"Bandwidth"` - - // 弹性公网IP的网络计费模式。注意,传统账户类型账户的弹性公网IP没有网络计费模式属性,值为空。 - // 注意:此字段可能返回 null,表示取不到有效值。 - // 包括: - //
  • BANDWIDTH_PREPAID_BY_MONTH
  • - //

    表示包月带宽预付费。

    - //
  • TRAFFIC_POSTPAID_BY_HOUR
  • - //

    表示按小时流量后付费。

    - //
  • BANDWIDTH_POSTPAID_BY_HOUR
  • - //

    表示按小时带宽后付费。

    - //
  • BANDWIDTH_PACKAGE
  • - //

    表示共享带宽包。

    - // 注意:此字段可能返回 null,表示取不到有效值。 - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 弹性公网IP关联的标签列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // 到期时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DeadlineDate *string `json:"DeadlineDate,omitempty" name:"DeadlineDate"` - - // EIP绑定的实例类型。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 高防包ID,当EIP类型为高防EIP时,返回EIP绑定的高防包ID. - AntiDDoSPackageId *string `json:"AntiDDoSPackageId,omitempty" name:"AntiDDoSPackageId"` -} - -type AddressChargePrepaid struct { - // 购买实例的时长,单位是月。可支持时长:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36 - Period *int64 `json:"Period,omitempty" name:"Period"` - - // 自动续费标志。0表示手动续费,1表示自动续费,2表示到期不续费。默认缺省为0即手动续费 - AutoRenewFlag *int64 `json:"AutoRenewFlag,omitempty" name:"AutoRenewFlag"` -} - -type AddressInfo struct { - // ip地址。 - Address *string `json:"Address,omitempty" name:"Address"` - - // 备注。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -type AddressTemplate struct { - // IP地址模板名称。 - AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` - - // IP地址模板实例唯一ID。 - AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` - - // IP地址信息。 - AddressSet []*string `json:"AddressSet,omitempty" name:"AddressSet"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 带备注的IP地址信息。 - AddressExtraSet []*AddressInfo `json:"AddressExtraSet,omitempty" name:"AddressExtraSet"` -} - -type AddressTemplateGroup struct { - // IP地址模板集合名称。 - AddressTemplateGroupName *string `json:"AddressTemplateGroupName,omitempty" name:"AddressTemplateGroupName"` - - // IP地址模板集合实例ID,例如:ipmg-dih8xdbq。 - AddressTemplateGroupId *string `json:"AddressTemplateGroupId,omitempty" name:"AddressTemplateGroupId"` - - // IP地址模板ID。 - AddressTemplateIdSet []*string `json:"AddressTemplateIdSet,omitempty" name:"AddressTemplateIdSet"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // IP地址模板实例。 - AddressTemplateSet []*AddressTemplateItem `json:"AddressTemplateSet,omitempty" name:"AddressTemplateSet"` -} - -type AddressTemplateItem struct { - // ipm-xxxxxxxx - AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` - - // IP模板名称 - AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` - - // 废弃字段 - From *string `json:"From,omitempty" name:"From"` - - // 废弃字段 - To *string `json:"To,omitempty" name:"To"` -} - -type AddressTemplateSpecification struct { - // IP地址ID,例如:ipm-2uw6ujo6。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // IP地址组ID,例如:ipmg-2uw6ujo6。 - AddressGroupId *string `json:"AddressGroupId,omitempty" name:"AddressGroupId"` -} - -// Predefined struct for user -type AdjustPublicAddressRequestParams struct { - // 标识CVM实例的唯一 ID。CVM 唯一 ID 形如:`ins-11112222`。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 标识EIP实例的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` -} - -type AdjustPublicAddressRequest struct { - *tchttp.BaseRequest - - // 标识CVM实例的唯一 ID。CVM 唯一 ID 形如:`ins-11112222`。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 标识EIP实例的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` -} - -func (r *AdjustPublicAddressRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AdjustPublicAddressRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - delete(f, "AddressId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AdjustPublicAddressRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AdjustPublicAddressResponseParams struct { - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AdjustPublicAddressResponse struct { - *tchttp.BaseResponse - Response *AdjustPublicAddressResponseParams `json:"Response"` -} - -func (r *AdjustPublicAddressResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AdjustPublicAddressResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type AlgType struct { - // Ftp协议Alg功能是否开启 - Ftp *bool `json:"Ftp,omitempty" name:"Ftp"` - - // Sip协议Alg功能是否开启 - Sip *bool `json:"Sip,omitempty" name:"Sip"` -} - -// Predefined struct for user -type AllocateAddressesRequestParams struct { - // EIP数量。默认值:1。 - AddressCount *int64 `json:"AddressCount,omitempty" name:"AddressCount"` - - // EIP线路类型。默认值:BGP。 - //
    • 已开通静态单线IP白名单的用户,可选值:
      • CMCC:中国移动
      • - //
      • CTCC:中国电信
      • - //
      • CUCC:中国联通
      注意:仅部分地域支持静态单线IP。
    - InternetServiceProvider *string `json:"InternetServiceProvider,omitempty" name:"InternetServiceProvider"` - - // EIP计费方式。 - //
    • 已开通标准账户类型白名单的用户,可选值:
      • BANDWIDTH_PACKAGE:[共享带宽包](https://cloud.tencent.com/document/product/684/15255)付费(需额外开通共享带宽包白名单)
      • - //
      • BANDWIDTH_POSTPAID_BY_HOUR:带宽按小时后付费
      • - //
      • BANDWIDTH_PREPAID_BY_MONTH:包月按带宽预付费
      • - //
      • TRAFFIC_POSTPAID_BY_HOUR:流量按小时后付费
      默认值:TRAFFIC_POSTPAID_BY_HOUR。
    • - //
    • 未开通标准账户类型白名单的用户,EIP计费方式与其绑定的实例的计费方式一致,无需传递此参数。
    - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // EIP出带宽上限,单位:Mbps。 - //
    • 已开通标准账户类型白名单的用户,可选值范围取决于EIP计费方式:
      • BANDWIDTH_PACKAGE:1 Mbps 至 2000 Mbps
      • - //
      • BANDWIDTH_POSTPAID_BY_HOUR:1 Mbps 至 100 Mbps
      • - //
      • BANDWIDTH_PREPAID_BY_MONTH:1 Mbps 至 200 Mbps
      • - //
      • TRAFFIC_POSTPAID_BY_HOUR:1 Mbps 至 100 Mbps
      默认值:1 Mbps。
    • - //
    • 未开通标准账户类型白名单的用户,EIP出带宽上限取决于与其绑定的实例的公网出带宽上限,无需传递此参数。
    - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 包月按带宽预付费EIP的计费参数。EIP为包月按带宽预付费时,该参数必传,其余场景不需传递 - AddressChargePrepaid *AddressChargePrepaid `json:"AddressChargePrepaid,omitempty" name:"AddressChargePrepaid"` - - // EIP类型。默认值:EIP。 - //
    • 已开通Anycast公网加速白名单的用户,可选值:
      • AnycastEIP:加速IP,可参见 [Anycast 公网加速](https://cloud.tencent.com/document/product/644)
      注意:仅部分地域支持加速IP。
    - //
    • 已开通精品IP白名单的用户,可选值:
      • HighQualityEIP:精品IP
      注意:仅部分地域支持精品IP。
    - // - //
    • 已开高防IP白名单的用户,可选值:
      • AntiDDoSEIP:高防IP
      注意:仅部分地域支持高防IP。
    - AddressType *string `json:"AddressType,omitempty" name:"AddressType"` - - // Anycast发布域。 - //
    • 已开通Anycast公网加速白名单的用户,可选值:
      • ANYCAST_ZONE_GLOBAL:全球发布域(需要额外开通Anycast全球加速白名单)
      • ANYCAST_ZONE_OVERSEAS:境外发布域
      • [已废弃] ANYCAST_ZONE_A:发布域A(已更新为全球发布域)
      • [已废弃] ANYCAST_ZONE_B:发布域B(已更新为全球发布域)
      默认值:ANYCAST_ZONE_OVERSEAS。
    - AnycastZone *string `json:"AnycastZone,omitempty" name:"AnycastZone"` - - // [已废弃] AnycastEIP不再区分是否负载均衡。原参数说明如下: - // AnycastEIP是否用于绑定负载均衡。 - //
    • 已开通Anycast公网加速白名单的用户,可选值:
      • TRUE:AnycastEIP可绑定对象为负载均衡
      • - //
      • FALSE:AnycastEIP可绑定对象为云服务器、NAT网关、高可用虚拟IP等
      默认值:FALSE。
    - ApplicableForCLB *bool `json:"ApplicableForCLB,omitempty" name:"ApplicableForCLB"` - - // 需要关联的标签列表。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // BGP带宽包唯一ID参数。设定该参数且InternetChargeType为BANDWIDTH_PACKAGE,则表示创建的EIP加入该BGP带宽包并采用带宽包计费 - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // EIP名称,用于申请EIP时用户自定义该EIP的个性化名称,默认值:未命名 - AddressName *string `json:"AddressName,omitempty" name:"AddressName"` - - // 网络出口,默认是:center_egress1 - Egress *string `json:"Egress,omitempty" name:"Egress"` - - // 高防包ID, 申请高防IP时,该字段必传。 - AntiDDoSPackageId *string `json:"AntiDDoSPackageId,omitempty" name:"AntiDDoSPackageId"` - - // 保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符,且不能超过64个字符。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` -} - -type AllocateAddressesRequest struct { - *tchttp.BaseRequest - - // EIP数量。默认值:1。 - AddressCount *int64 `json:"AddressCount,omitempty" name:"AddressCount"` - - // EIP线路类型。默认值:BGP。 - //
    • 已开通静态单线IP白名单的用户,可选值:
      • CMCC:中国移动
      • - //
      • CTCC:中国电信
      • - //
      • CUCC:中国联通
      注意:仅部分地域支持静态单线IP。
    - InternetServiceProvider *string `json:"InternetServiceProvider,omitempty" name:"InternetServiceProvider"` - - // EIP计费方式。 - //
    • 已开通标准账户类型白名单的用户,可选值:
      • BANDWIDTH_PACKAGE:[共享带宽包](https://cloud.tencent.com/document/product/684/15255)付费(需额外开通共享带宽包白名单)
      • - //
      • BANDWIDTH_POSTPAID_BY_HOUR:带宽按小时后付费
      • - //
      • BANDWIDTH_PREPAID_BY_MONTH:包月按带宽预付费
      • - //
      • TRAFFIC_POSTPAID_BY_HOUR:流量按小时后付费
      默认值:TRAFFIC_POSTPAID_BY_HOUR。
    • - //
    • 未开通标准账户类型白名单的用户,EIP计费方式与其绑定的实例的计费方式一致,无需传递此参数。
    - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // EIP出带宽上限,单位:Mbps。 - //
    • 已开通标准账户类型白名单的用户,可选值范围取决于EIP计费方式:
      • BANDWIDTH_PACKAGE:1 Mbps 至 2000 Mbps
      • - //
      • BANDWIDTH_POSTPAID_BY_HOUR:1 Mbps 至 100 Mbps
      • - //
      • BANDWIDTH_PREPAID_BY_MONTH:1 Mbps 至 200 Mbps
      • - //
      • TRAFFIC_POSTPAID_BY_HOUR:1 Mbps 至 100 Mbps
      默认值:1 Mbps。
    • - //
    • 未开通标准账户类型白名单的用户,EIP出带宽上限取决于与其绑定的实例的公网出带宽上限,无需传递此参数。
    - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 包月按带宽预付费EIP的计费参数。EIP为包月按带宽预付费时,该参数必传,其余场景不需传递 - AddressChargePrepaid *AddressChargePrepaid `json:"AddressChargePrepaid,omitempty" name:"AddressChargePrepaid"` - - // EIP类型。默认值:EIP。 - //
    • 已开通Anycast公网加速白名单的用户,可选值:
      • AnycastEIP:加速IP,可参见 [Anycast 公网加速](https://cloud.tencent.com/document/product/644)
      注意:仅部分地域支持加速IP。
    - //
    • 已开通精品IP白名单的用户,可选值:
      • HighQualityEIP:精品IP
      注意:仅部分地域支持精品IP。
    - // - //
    • 已开高防IP白名单的用户,可选值:
      • AntiDDoSEIP:高防IP
      注意:仅部分地域支持高防IP。
    - AddressType *string `json:"AddressType,omitempty" name:"AddressType"` - - // Anycast发布域。 - //
    • 已开通Anycast公网加速白名单的用户,可选值:
      • ANYCAST_ZONE_GLOBAL:全球发布域(需要额外开通Anycast全球加速白名单)
      • ANYCAST_ZONE_OVERSEAS:境外发布域
      • [已废弃] ANYCAST_ZONE_A:发布域A(已更新为全球发布域)
      • [已废弃] ANYCAST_ZONE_B:发布域B(已更新为全球发布域)
      默认值:ANYCAST_ZONE_OVERSEAS。
    - AnycastZone *string `json:"AnycastZone,omitempty" name:"AnycastZone"` - - // [已废弃] AnycastEIP不再区分是否负载均衡。原参数说明如下: - // AnycastEIP是否用于绑定负载均衡。 - //
    • 已开通Anycast公网加速白名单的用户,可选值:
      • TRUE:AnycastEIP可绑定对象为负载均衡
      • - //
      • FALSE:AnycastEIP可绑定对象为云服务器、NAT网关、高可用虚拟IP等
      默认值:FALSE。
    - ApplicableForCLB *bool `json:"ApplicableForCLB,omitempty" name:"ApplicableForCLB"` - - // 需要关联的标签列表。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // BGP带宽包唯一ID参数。设定该参数且InternetChargeType为BANDWIDTH_PACKAGE,则表示创建的EIP加入该BGP带宽包并采用带宽包计费 - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // EIP名称,用于申请EIP时用户自定义该EIP的个性化名称,默认值:未命名 - AddressName *string `json:"AddressName,omitempty" name:"AddressName"` - - // 网络出口,默认是:center_egress1 - Egress *string `json:"Egress,omitempty" name:"Egress"` - - // 高防包ID, 申请高防IP时,该字段必传。 - AntiDDoSPackageId *string `json:"AntiDDoSPackageId,omitempty" name:"AntiDDoSPackageId"` - - // 保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符,且不能超过64个字符。 - ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` -} - -func (r *AllocateAddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AllocateAddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressCount") - delete(f, "InternetServiceProvider") - delete(f, "InternetChargeType") - delete(f, "InternetMaxBandwidthOut") - delete(f, "AddressChargePrepaid") - delete(f, "AddressType") - delete(f, "AnycastZone") - delete(f, "ApplicableForCLB") - delete(f, "Tags") - delete(f, "BandwidthPackageId") - delete(f, "AddressName") - delete(f, "Egress") - delete(f, "AntiDDoSPackageId") - delete(f, "ClientToken") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AllocateAddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AllocateAddressesResponseParams struct { - // 申请到的 EIP 的唯一 ID 列表。 - AddressSet []*string `json:"AddressSet,omitempty" name:"AddressSet"` - - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AllocateAddressesResponse struct { - *tchttp.BaseResponse - Response *AllocateAddressesResponseParams `json:"Response"` -} - -func (r *AllocateAddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AllocateAddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AllocateIp6AddressesBandwidthRequestParams struct { - // 需要开通公网访问能力的IPV6地址 - Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses"` - - // 带宽,单位Mbps。默认是1Mbps - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 网络计费模式。IPV6当前对标准账户类型支持"TRAFFIC_POSTPAID_BY_HOUR",对传统账户类型支持"BANDWIDTH_PACKAGE"。默认网络计费模式是"TRAFFIC_POSTPAID_BY_HOUR"。 - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 带宽包id,上移账号,申请带宽包计费模式的ipv6地址需要传入. - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -type AllocateIp6AddressesBandwidthRequest struct { - *tchttp.BaseRequest - - // 需要开通公网访问能力的IPV6地址 - Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses"` - - // 带宽,单位Mbps。默认是1Mbps - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 网络计费模式。IPV6当前对标准账户类型支持"TRAFFIC_POSTPAID_BY_HOUR",对传统账户类型支持"BANDWIDTH_PACKAGE"。默认网络计费模式是"TRAFFIC_POSTPAID_BY_HOUR"。 - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 带宽包id,上移账号,申请带宽包计费模式的ipv6地址需要传入. - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -func (r *AllocateIp6AddressesBandwidthRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AllocateIp6AddressesBandwidthRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6Addresses") - delete(f, "InternetMaxBandwidthOut") - delete(f, "InternetChargeType") - delete(f, "BandwidthPackageId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AllocateIp6AddressesBandwidthRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AllocateIp6AddressesBandwidthResponseParams struct { - // 弹性公网 IPV6 的唯一 ID 列表。 - AddressSet []*string `json:"AddressSet,omitempty" name:"AddressSet"` - - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AllocateIp6AddressesBandwidthResponse struct { - *tchttp.BaseResponse - Response *AllocateIp6AddressesBandwidthResponseParams `json:"Response"` -} - -func (r *AllocateIp6AddressesBandwidthResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AllocateIp6AddressesBandwidthResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssignIpv6AddressesRequestParams struct { - // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的`IPv6`地址列表,单次最多指定10个。与入参`Ipv6AddressCount`合并计算配额。与Ipv6AddressCount必填一个。 - Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses"` - - // 自动分配`IPv6`地址个数,内网IP地址个数总和不能超过配额数。与入参`Ipv6Addresses`合并计算配额。与Ipv6Addresses必填一个。 - Ipv6AddressCount *uint64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` -} - -type AssignIpv6AddressesRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的`IPv6`地址列表,单次最多指定10个。与入参`Ipv6AddressCount`合并计算配额。与Ipv6AddressCount必填一个。 - Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses"` - - // 自动分配`IPv6`地址个数,内网IP地址个数总和不能超过配额数。与入参`Ipv6Addresses`合并计算配额。与Ipv6Addresses必填一个。 - Ipv6AddressCount *uint64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` -} - -func (r *AssignIpv6AddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssignIpv6AddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "Ipv6Addresses") - delete(f, "Ipv6AddressCount") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssignIpv6AddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssignIpv6AddressesResponseParams struct { - // 分配给弹性网卡的`IPv6`地址列表。 - Ipv6AddressSet []*Ipv6Address `json:"Ipv6AddressSet,omitempty" name:"Ipv6AddressSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssignIpv6AddressesResponse struct { - *tchttp.BaseResponse - Response *AssignIpv6AddressesResponseParams `json:"Response"` -} - -func (r *AssignIpv6AddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssignIpv6AddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssignIpv6CidrBlockRequestParams struct { - // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -type AssignIpv6CidrBlockRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -func (r *AssignIpv6CidrBlockRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssignIpv6CidrBlockRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssignIpv6CidrBlockRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssignIpv6CidrBlockResponseParams struct { - // 分配的 `IPv6` 网段。形如:`3402:4e00:20:1000::/56`。 - Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssignIpv6CidrBlockResponse struct { - *tchttp.BaseResponse - Response *AssignIpv6CidrBlockResponseParams `json:"Response"` -} - -func (r *AssignIpv6CidrBlockResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssignIpv6CidrBlockResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssignIpv6SubnetCidrBlockRequestParams struct { - // 子网所在私有网络`ID`。形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 分配 `IPv6` 子网段列表。 - Ipv6SubnetCidrBlocks []*Ipv6SubnetCidrBlock `json:"Ipv6SubnetCidrBlocks,omitempty" name:"Ipv6SubnetCidrBlocks"` -} - -type AssignIpv6SubnetCidrBlockRequest struct { - *tchttp.BaseRequest - - // 子网所在私有网络`ID`。形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 分配 `IPv6` 子网段列表。 - Ipv6SubnetCidrBlocks []*Ipv6SubnetCidrBlock `json:"Ipv6SubnetCidrBlocks,omitempty" name:"Ipv6SubnetCidrBlocks"` -} - -func (r *AssignIpv6SubnetCidrBlockRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssignIpv6SubnetCidrBlockRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "Ipv6SubnetCidrBlocks") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssignIpv6SubnetCidrBlockRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssignIpv6SubnetCidrBlockResponseParams struct { - // 分配 `IPv6` 子网段列表。 - Ipv6SubnetCidrBlockSet []*Ipv6SubnetCidrBlock `json:"Ipv6SubnetCidrBlockSet,omitempty" name:"Ipv6SubnetCidrBlockSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssignIpv6SubnetCidrBlockResponse struct { - *tchttp.BaseResponse - Response *AssignIpv6SubnetCidrBlockResponseParams `json:"Response"` -} - -func (r *AssignIpv6SubnetCidrBlockResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssignIpv6SubnetCidrBlockResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssignPrivateIpAddressesRequestParams struct { - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的内网IP信息,单次最多指定10个。与SecondaryPrivateIpAddressCount至少提供一个。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 新申请的内网IP地址个数,与PrivateIpAddresses至少提供一个。内网IP地址个数总和不能超过配额数,详见弹性网卡使用限制。 - SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` - - // IP服务质量等级,和SecondaryPrivateIpAddressCount配合使用,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` -} - -type AssignPrivateIpAddressesRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的内网IP信息,单次最多指定10个。与SecondaryPrivateIpAddressCount至少提供一个。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 新申请的内网IP地址个数,与PrivateIpAddresses至少提供一个。内网IP地址个数总和不能超过配额数,详见弹性网卡使用限制。 - SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` - - // IP服务质量等级,和SecondaryPrivateIpAddressCount配合使用,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` -} - -func (r *AssignPrivateIpAddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssignPrivateIpAddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "PrivateIpAddresses") - delete(f, "SecondaryPrivateIpAddressCount") - delete(f, "QosLevel") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssignPrivateIpAddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssignPrivateIpAddressesResponseParams struct { - // 内网IP详细信息。 - PrivateIpAddressSet []*PrivateIpAddressSpecification `json:"PrivateIpAddressSet,omitempty" name:"PrivateIpAddressSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssignPrivateIpAddressesResponse struct { - *tchttp.BaseResponse - Response *AssignPrivateIpAddressesResponseParams `json:"Response"` -} - -func (r *AssignPrivateIpAddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssignPrivateIpAddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type AssistantCidr struct { - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 辅助CIDR。形如:`172.16.0.0/16` - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 辅助CIDR类型(0:普通辅助CIDR,1:容器辅助CIDR),默认都是0。 - AssistantType *int64 `json:"AssistantType,omitempty" name:"AssistantType"` - - // 辅助CIDR拆分的子网。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SubnetSet []*Subnet `json:"SubnetSet,omitempty" name:"SubnetSet"` -} - -// Predefined struct for user -type AssociateAddressRequestParams struct { - // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 要绑定的实例 ID。实例 ID 形如:`ins-11112222`、`lb-11112222`。可通过登录[控制台](https://console.cloud.tencent.com/cvm)查询,也可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) 接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 要绑定的弹性网卡 ID。 弹性网卡 ID 形如:`eni-11112222`。`NetworkInterfaceId` 与 `InstanceId` 不可同时指定。弹性网卡 ID 可通过登录[控制台](https://console.cloud.tencent.com/vpc/eni)查询,也可通过[DescribeNetworkInterfaces](https://cloud.tencent.com/document/api/215/15817)接口返回值中的`networkInterfaceId`获取。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 要绑定的内网 IP。如果指定了 `NetworkInterfaceId` 则也必须指定 `PrivateIpAddress` ,表示将 EIP 绑定到指定弹性网卡的指定内网 IP 上。同时要确保指定的 `PrivateIpAddress` 是指定的 `NetworkInterfaceId` 上的一个内网 IP。指定弹性网卡的内网 IP 可通过登录[控制台](https://console.cloud.tencent.com/vpc/eni)查询,也可通过[DescribeNetworkInterfaces](https://cloud.tencent.com/document/api/215/15817)接口返回值中的`privateIpAddress`获取。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 指定绑定时是否设置直通。弹性公网 IP 直通请参见 [EIP 直通](https://cloud.tencent.com/document/product/1199/41709)。取值:True、False,默认值为 False。当绑定 CVM 实例、EKS 弹性集群时,可设定此参数为 True。此参数目前处于内测中,如需使用,请提交 [工单申请](https://console.cloud.tencent.com/workorder/category?level1_id=6&level2_id=163&source=0&data_title=%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%20CLB&level3_id=1071&queue=96&scene_code=34639&step=2)。 - EipDirectConnection *bool `json:"EipDirectConnection,omitempty" name:"EipDirectConnection"` -} - -type AssociateAddressRequest struct { - *tchttp.BaseRequest - - // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 要绑定的实例 ID。实例 ID 形如:`ins-11112222`、`lb-11112222`。可通过登录[控制台](https://console.cloud.tencent.com/cvm)查询,也可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) 接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 要绑定的弹性网卡 ID。 弹性网卡 ID 形如:`eni-11112222`。`NetworkInterfaceId` 与 `InstanceId` 不可同时指定。弹性网卡 ID 可通过登录[控制台](https://console.cloud.tencent.com/vpc/eni)查询,也可通过[DescribeNetworkInterfaces](https://cloud.tencent.com/document/api/215/15817)接口返回值中的`networkInterfaceId`获取。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 要绑定的内网 IP。如果指定了 `NetworkInterfaceId` 则也必须指定 `PrivateIpAddress` ,表示将 EIP 绑定到指定弹性网卡的指定内网 IP 上。同时要确保指定的 `PrivateIpAddress` 是指定的 `NetworkInterfaceId` 上的一个内网 IP。指定弹性网卡的内网 IP 可通过登录[控制台](https://console.cloud.tencent.com/vpc/eni)查询,也可通过[DescribeNetworkInterfaces](https://cloud.tencent.com/document/api/215/15817)接口返回值中的`privateIpAddress`获取。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 指定绑定时是否设置直通。弹性公网 IP 直通请参见 [EIP 直通](https://cloud.tencent.com/document/product/1199/41709)。取值:True、False,默认值为 False。当绑定 CVM 实例、EKS 弹性集群时,可设定此参数为 True。此参数目前处于内测中,如需使用,请提交 [工单申请](https://console.cloud.tencent.com/workorder/category?level1_id=6&level2_id=163&source=0&data_title=%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%20CLB&level3_id=1071&queue=96&scene_code=34639&step=2)。 - EipDirectConnection *bool `json:"EipDirectConnection,omitempty" name:"EipDirectConnection"` -} - -func (r *AssociateAddressRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateAddressRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressId") - delete(f, "InstanceId") - delete(f, "NetworkInterfaceId") - delete(f, "PrivateIpAddress") - delete(f, "EipDirectConnection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateAddressRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateAddressResponseParams struct { - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssociateAddressResponse struct { - *tchttp.BaseResponse - Response *AssociateAddressResponseParams `json:"Response"` -} - -func (r *AssociateAddressResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateAddressResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateDhcpIpWithAddressIpRequestParams struct { - // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。必须是没有绑定`EIP`的`DhcpIp` - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` - - // 弹性公网`IP`。必须是没有绑定`DhcpIp`的`EIP` - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` -} - -type AssociateDhcpIpWithAddressIpRequest struct { - *tchttp.BaseRequest - - // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。必须是没有绑定`EIP`的`DhcpIp` - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` - - // 弹性公网`IP`。必须是没有绑定`DhcpIp`的`EIP` - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` -} - -func (r *AssociateDhcpIpWithAddressIpRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateDhcpIpWithAddressIpRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DhcpIpId") - delete(f, "AddressIp") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateDhcpIpWithAddressIpRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateDhcpIpWithAddressIpResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssociateDhcpIpWithAddressIpResponse struct { - *tchttp.BaseResponse - Response *AssociateDhcpIpWithAddressIpResponseParams `json:"Response"` -} - -func (r *AssociateDhcpIpWithAddressIpResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateDhcpIpWithAddressIpResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateDirectConnectGatewayNatGatewayRequestParams struct { - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关ID。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 专线网关ID。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` -} - -type AssociateDirectConnectGatewayNatGatewayRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关ID。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 专线网关ID。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` -} - -func (r *AssociateDirectConnectGatewayNatGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateDirectConnectGatewayNatGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "NatGatewayId") - delete(f, "DirectConnectGatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateDirectConnectGatewayNatGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateDirectConnectGatewayNatGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssociateDirectConnectGatewayNatGatewayResponse struct { - *tchttp.BaseResponse - Response *AssociateDirectConnectGatewayNatGatewayResponseParams `json:"Response"` -} - -func (r *AssociateDirectConnectGatewayNatGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateDirectConnectGatewayNatGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateNatGatewayAddressRequestParams struct { - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 需要申请的弹性IP个数,系统会按您的要求生产N个弹性IP, 其中AddressCount和PublicAddresses至少传递一个。 - AddressCount *uint64 `json:"AddressCount,omitempty" name:"AddressCount"` - - // 绑定NAT网关的弹性IP数组,其中AddressCount和PublicAddresses至少传递一个。 - PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses"` - - // 弹性IP可用区,自动分配弹性IP时传递。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 绑定NAT网关的弹性IP带宽大小(单位Mbps),默认为当前用户类型所能使用的最大值。 - StockPublicIpAddressesBandwidthOut *uint64 `json:"StockPublicIpAddressesBandwidthOut,omitempty" name:"StockPublicIpAddressesBandwidthOut"` - - // 需要申请公网IP带宽大小(单位Mbps),默认为当前用户类型所能使用的最大值。 - PublicIpAddressesBandwidthOut *uint64 `json:"PublicIpAddressesBandwidthOut,omitempty" name:"PublicIpAddressesBandwidthOut"` - - // 公网IP是否强制与NAT网关来自同可用区,true表示需要与NAT网关同可用区;false表示可与NAT网关不是同一个可用区。此参数只有当参数Zone存在时才能生效。 - PublicIpFromSameZone *bool `json:"PublicIpFromSameZone,omitempty" name:"PublicIpFromSameZone"` -} - -type AssociateNatGatewayAddressRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 需要申请的弹性IP个数,系统会按您的要求生产N个弹性IP, 其中AddressCount和PublicAddresses至少传递一个。 - AddressCount *uint64 `json:"AddressCount,omitempty" name:"AddressCount"` - - // 绑定NAT网关的弹性IP数组,其中AddressCount和PublicAddresses至少传递一个。 - PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses"` - - // 弹性IP可用区,自动分配弹性IP时传递。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 绑定NAT网关的弹性IP带宽大小(单位Mbps),默认为当前用户类型所能使用的最大值。 - StockPublicIpAddressesBandwidthOut *uint64 `json:"StockPublicIpAddressesBandwidthOut,omitempty" name:"StockPublicIpAddressesBandwidthOut"` - - // 需要申请公网IP带宽大小(单位Mbps),默认为当前用户类型所能使用的最大值。 - PublicIpAddressesBandwidthOut *uint64 `json:"PublicIpAddressesBandwidthOut,omitempty" name:"PublicIpAddressesBandwidthOut"` - - // 公网IP是否强制与NAT网关来自同可用区,true表示需要与NAT网关同可用区;false表示可与NAT网关不是同一个可用区。此参数只有当参数Zone存在时才能生效。 - PublicIpFromSameZone *bool `json:"PublicIpFromSameZone,omitempty" name:"PublicIpFromSameZone"` -} - -func (r *AssociateNatGatewayAddressRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateNatGatewayAddressRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "AddressCount") - delete(f, "PublicIpAddresses") - delete(f, "Zone") - delete(f, "StockPublicIpAddressesBandwidthOut") - delete(f, "PublicIpAddressesBandwidthOut") - delete(f, "PublicIpFromSameZone") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateNatGatewayAddressRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateNatGatewayAddressResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssociateNatGatewayAddressResponse struct { - *tchttp.BaseResponse - Response *AssociateNatGatewayAddressResponseParams `json:"Response"` -} - -func (r *AssociateNatGatewayAddressResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateNatGatewayAddressResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateNetworkAclSubnetsRequestParams struct { - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 子网实例ID数组。例如:[subnet-12345678]。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` -} - -type AssociateNetworkAclSubnetsRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 子网实例ID数组。例如:[subnet-12345678]。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` -} - -func (r *AssociateNetworkAclSubnetsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateNetworkAclSubnetsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - delete(f, "SubnetIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateNetworkAclSubnetsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateNetworkAclSubnetsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssociateNetworkAclSubnetsResponse struct { - *tchttp.BaseResponse - Response *AssociateNetworkAclSubnetsResponseParams `json:"Response"` -} - -func (r *AssociateNetworkAclSubnetsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateNetworkAclSubnetsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateNetworkInterfaceSecurityGroupsRequestParams struct { - // 弹性网卡实例ID。形如:eni-pxir56ns。每次请求的实例的上限为100。 - NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds"` - - // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。每次请求的实例的上限为100。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -type AssociateNetworkInterfaceSecurityGroupsRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID。形如:eni-pxir56ns。每次请求的实例的上限为100。 - NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds"` - - // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。每次请求的实例的上限为100。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -func (r *AssociateNetworkInterfaceSecurityGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateNetworkInterfaceSecurityGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceIds") - delete(f, "SecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AssociateNetworkInterfaceSecurityGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AssociateNetworkInterfaceSecurityGroupsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AssociateNetworkInterfaceSecurityGroupsResponse struct { - *tchttp.BaseResponse - Response *AssociateNetworkInterfaceSecurityGroupsResponseParams `json:"Response"` -} - -func (r *AssociateNetworkInterfaceSecurityGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AssociateNetworkInterfaceSecurityGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachCcnInstancesRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 关联网络实例列表 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` - - // CCN所属UIN(根账号),默认当前账号所属UIN - CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` -} - -type AttachCcnInstancesRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 关联网络实例列表 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` - - // CCN所属UIN(根账号),默认当前账号所属UIN - CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` -} - -func (r *AttachCcnInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachCcnInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "Instances") - delete(f, "CcnUin") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AttachCcnInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachCcnInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AttachCcnInstancesResponse struct { - *tchttp.BaseResponse - Response *AttachCcnInstancesResponseParams `json:"Response"` -} - -func (r *AttachCcnInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachCcnInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachClassicLinkVpcRequestParams struct { - // VPC实例ID - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CVM实例ID - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type AttachClassicLinkVpcRequest struct { - *tchttp.BaseRequest - - // VPC实例ID - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CVM实例ID - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *AttachClassicLinkVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachClassicLinkVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AttachClassicLinkVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachClassicLinkVpcResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AttachClassicLinkVpcResponse struct { - *tchttp.BaseResponse - Response *AttachClassicLinkVpcResponseParams `json:"Response"` -} - -func (r *AttachClassicLinkVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachClassicLinkVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachNetworkInterfaceRequestParams struct { - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // CVM实例ID。形如:ins-r8hr2upy。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 网卡的挂载类型:0 标准型,1扩展型,默认值0。 - AttachType *uint64 `json:"AttachType,omitempty" name:"AttachType"` -} - -type AttachNetworkInterfaceRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // CVM实例ID。形如:ins-r8hr2upy。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 网卡的挂载类型:0 标准型,1扩展型,默认值0。 - AttachType *uint64 `json:"AttachType,omitempty" name:"AttachType"` -} - -func (r *AttachNetworkInterfaceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachNetworkInterfaceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "InstanceId") - delete(f, "AttachType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AttachNetworkInterfaceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachNetworkInterfaceResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AttachNetworkInterfaceResponse struct { - *tchttp.BaseResponse - Response *AttachNetworkInterfaceResponseParams `json:"Response"` -} - -func (r *AttachNetworkInterfaceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachNetworkInterfaceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachSnapshotInstancesRequestParams struct { - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 关联实例信息。 - Instances []*SnapshotInstance `json:"Instances,omitempty" name:"Instances"` -} - -type AttachSnapshotInstancesRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 关联实例信息。 - Instances []*SnapshotInstance `json:"Instances,omitempty" name:"Instances"` -} - -func (r *AttachSnapshotInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachSnapshotInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyId") - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AttachSnapshotInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AttachSnapshotInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AttachSnapshotInstancesResponse struct { - *tchttp.BaseResponse - Response *AttachSnapshotInstancesResponseParams `json:"Response"` -} - -func (r *AttachSnapshotInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AttachSnapshotInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AuditCrossBorderComplianceRequestParams struct { - // 服务商, 可选值:`UNICOM`。 - ServiceProvider *string `json:"ServiceProvider,omitempty" name:"ServiceProvider"` - - // 表单唯一`ID`。可通过[DescribeCrossBorderCompliance](https://cloud.tencent.com/document/product/215/47838)接口查询ComplianceId信息 - ComplianceId *uint64 `json:"ComplianceId,omitempty" name:"ComplianceId"` - - // 通过:`APPROVED `,拒绝:`DENY`。 - AuditBehavior *string `json:"AuditBehavior,omitempty" name:"AuditBehavior"` -} - -type AuditCrossBorderComplianceRequest struct { - *tchttp.BaseRequest - - // 服务商, 可选值:`UNICOM`。 - ServiceProvider *string `json:"ServiceProvider,omitempty" name:"ServiceProvider"` - - // 表单唯一`ID`。可通过[DescribeCrossBorderCompliance](https://cloud.tencent.com/document/product/215/47838)接口查询ComplianceId信息 - ComplianceId *uint64 `json:"ComplianceId,omitempty" name:"ComplianceId"` - - // 通过:`APPROVED `,拒绝:`DENY`。 - AuditBehavior *string `json:"AuditBehavior,omitempty" name:"AuditBehavior"` -} - -func (r *AuditCrossBorderComplianceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AuditCrossBorderComplianceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ServiceProvider") - delete(f, "ComplianceId") - delete(f, "AuditBehavior") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AuditCrossBorderComplianceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type AuditCrossBorderComplianceResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type AuditCrossBorderComplianceResponse struct { - *tchttp.BaseResponse - Response *AuditCrossBorderComplianceResponseParams `json:"Response"` -} - -func (r *AuditCrossBorderComplianceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *AuditCrossBorderComplianceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type BackupPolicy struct { - // 备份周期时间,取值为monday, tuesday, wednesday, thursday, friday, saturday, sunday。 - BackupDay *string `json:"BackupDay,omitempty" name:"BackupDay"` - - // 备份时间点,格式:HH:mm:ss。 - BackupTime *string `json:"BackupTime,omitempty" name:"BackupTime"` -} - -type BandwidthPackage struct { - // 带宽包唯一标识Id - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 带宽包类型,包括'BGP','SINGLEISP','ANYCAST','SINGLEISP_CMCC','SINGLEISP_CTCC','SINGLEISP_CUCC' - NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` - - // 带宽包计费类型,包括'TOP5_POSTPAID_BY_MONTH'和'PERCENT95_POSTPAID_BY_MONTH' - ChargeType *string `json:"ChargeType,omitempty" name:"ChargeType"` - - // 带宽包名称 - BandwidthPackageName *string `json:"BandwidthPackageName,omitempty" name:"BandwidthPackageName"` - - // 带宽包创建时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 带宽包状态,包括'CREATING','CREATED','DELETING','DELETED' - Status *string `json:"Status,omitempty" name:"Status"` - - // 带宽包资源信息 - ResourceSet []*Resource `json:"ResourceSet,omitempty" name:"ResourceSet"` - - // 带宽包限速大小。单位:Mbps,-1表示不限速。 - Bandwidth *int64 `json:"Bandwidth,omitempty" name:"Bandwidth"` -} - -type BandwidthPackageBillBandwidth struct { - // 当前计费用量,单位为 Mbps - BandwidthUsage *float64 `json:"BandwidthUsage,omitempty" name:"BandwidthUsage"` -} - -type BatchModifySnapshotPolicy struct { - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 快照策略名称。 - SnapshotPolicyName *string `json:"SnapshotPolicyName,omitempty" name:"SnapshotPolicyName"` - - // 备份策略。 - BackupPolicies []*BackupPolicy `json:"BackupPolicies,omitempty" name:"BackupPolicies"` - - // 快照保留时间,支持1~365天。 - KeepTime *uint64 `json:"KeepTime,omitempty" name:"KeepTime"` -} - -type CCN struct { - // 云联网唯一ID - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 云联网名称 - CcnName *string `json:"CcnName,omitempty" name:"CcnName"` - - // 云联网描述信息 - CcnDescription *string `json:"CcnDescription,omitempty" name:"CcnDescription"` - - // 关联实例数量 - InstanceCount *uint64 `json:"InstanceCount,omitempty" name:"InstanceCount"` - - // 创建时间 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 实例状态, 'ISOLATED': 隔离中(欠费停服),'AVAILABLE':运行中。 - State *string `json:"State,omitempty" name:"State"` - - // 实例服务质量,’PT’:白金,'AU':金,'AG':银。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // 付费类型,PREPAID为预付费,POSTPAID为后付费。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 限速类型,`INTER_REGION_LIMIT` 为地域间限速;`OUTER_REGION_LIMIT` 为地域出口限速。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BandwidthLimitType *string `json:"BandwidthLimitType,omitempty" name:"BandwidthLimitType"` - - // 标签键值对。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // 是否支持云联网路由优先级的功能。`False`:不支持,`True`:支持。 - RoutePriorityFlag *bool `json:"RoutePriorityFlag,omitempty" name:"RoutePriorityFlag"` - - // 实例关联的路由表个数。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RouteTableCount *uint64 `json:"RouteTableCount,omitempty" name:"RouteTableCount"` - - // 是否开启云联网多路由表特性。`False`:未开启,`True`:开启。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RouteTableFlag *bool `json:"RouteTableFlag,omitempty" name:"RouteTableFlag"` - - // `true`:实例已被封禁,流量不通,`false`:解封禁。 - // 注意:此字段可能返回 null,表示取不到有效值。 - IsSecurityLock *bool `json:"IsSecurityLock,omitempty" name:"IsSecurityLock"` - - // 是否开启云联网路由传播策略。`False` 未开启,`True` 开启。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RouteBroadcastPolicyFlag *bool `json:"RouteBroadcastPolicyFlag,omitempty" name:"RouteBroadcastPolicyFlag"` -} - -type CcnAttachedInstance struct { - // 云联网实例ID。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 关联实例类型: - //
  • `VPC`:私有网络
  • - //
  • `DIRECTCONNECT`:专线网关
  • - //
  • `BMVPC`:黑石私有网络
  • - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 关联实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 关联实例名称。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 关联实例所属大区,例如:ap-guangzhou。 - InstanceRegion *string `json:"InstanceRegion,omitempty" name:"InstanceRegion"` - - // 关联实例所属UIN(根账号)。 - InstanceUin *string `json:"InstanceUin,omitempty" name:"InstanceUin"` - - // 关联实例CIDR。 - CidrBlock []*string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 关联实例状态: - //
  • `PENDING`:申请中
  • - //
  • `ACTIVE`:已连接
  • - //
  • `EXPIRED`:已过期
  • - //
  • `REJECTED`:已拒绝
  • - //
  • `DELETED`:已删除
  • - //
  • `FAILED`:失败的(2小时后将异步强制解关联)
  • - //
  • `ATTACHING`:关联中
  • - //
  • `DETACHING`:解关联中
  • - //
  • `DETACHFAILED`:解关联失败(2小时后将异步强制解关联)
  • - State *string `json:"State,omitempty" name:"State"` - - // 关联时间。 - AttachedTime *string `json:"AttachedTime,omitempty" name:"AttachedTime"` - - // 云联网所属UIN(根账号)。 - CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` - - // 关联实例所属的大地域,如: CHINA_MAINLAND - InstanceArea *string `json:"InstanceArea,omitempty" name:"InstanceArea"` - - // 备注 - Description *string `json:"Description,omitempty" name:"Description"` - - // 路由表ID - // 注意:此字段可能返回 null,表示取不到有效值。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由表名称 - // 注意:此字段可能返回 null,表示取不到有效值。 - RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` -} - -type CcnBandwidth struct { - // 带宽所属的云联网ID。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 实例的创建时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 实例的过期时间 - // 注意:此字段可能返回 null,表示取不到有效值。 - ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` - - // 带宽实例的唯一ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RegionFlowControlId *string `json:"RegionFlowControlId,omitempty" name:"RegionFlowControlId"` - - // 带宽是否自动续费的标记。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` - - // 描述带宽的地域和限速上限信息。在地域间限速的情况下才会返回参数,出口限速模式不返回。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CcnRegionBandwidthLimit *CcnRegionBandwidthLimitInfo `json:"CcnRegionBandwidthLimit,omitempty" name:"CcnRegionBandwidthLimit"` - - // 云市场实例ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - MarketId *string `json:"MarketId,omitempty" name:"MarketId"` - - // 实例所属用户主账号ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - UserAccountID *string `json:"UserAccountID,omitempty" name:"UserAccountID"` - - // 是否跨境,`true`表示跨境,反之不跨境。 - // 注意:此字段可能返回 null,表示取不到有效值。 - IsCrossBorder *bool `json:"IsCrossBorder,omitempty" name:"IsCrossBorder"` - - // `true`表示封禁,地域间流量不通,`false`解禁,地域间流量正常 - // 注意:此字段可能返回 null,表示取不到有效值。 - IsSecurityLock *bool `json:"IsSecurityLock,omitempty" name:"IsSecurityLock"` - - // `POSTPAID`表示后付费,`PREPAID`表示预付费。 - // 注意:此字段可能返回 null,表示取不到有效值。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 实例更新时间 - // 注意:此字段可能返回 null,表示取不到有效值。 - UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` -} - -type CcnBandwidthInfo struct { - // 带宽所属的云联网ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 实例的创建时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 实例的过期时间 - // 注意:此字段可能返回 null,表示取不到有效值。 - ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` - - // 带宽实例的唯一ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RegionFlowControlId *string `json:"RegionFlowControlId,omitempty" name:"RegionFlowControlId"` - - // 带宽是否自动续费的标记。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` - - // 描述带宽的地域和限速上限信息。在地域间限速的情况下才会返回参数,出口限速模式不返回。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CcnRegionBandwidthLimit *CcnRegionBandwidthLimit `json:"CcnRegionBandwidthLimit,omitempty" name:"CcnRegionBandwidthLimit"` - - // 云市场实例ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - MarketId *string `json:"MarketId,omitempty" name:"MarketId"` - - // 资源绑定的标签列表 - // 注意:此字段可能返回 null,表示取不到有效值。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` -} - -type CcnFlowLock struct { - // 带宽所属的云联网ID。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 实例所属用户主账号ID。 - UserAccountID *string `json:"UserAccountID,omitempty" name:"UserAccountID"` - - // 带宽实例的唯一ID。作为`UnlockCcnBandwidths`接口和`LockCcnBandwidths`接口的入参时,该字段必传。 - RegionFlowControlId *string `json:"RegionFlowControlId,omitempty" name:"RegionFlowControlId"` -} - -type CcnInstance struct { - // 关联实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 关联实例ID所属大区,例如:ap-guangzhou。 - InstanceRegion *string `json:"InstanceRegion,omitempty" name:"InstanceRegion"` - - // 关联实例类型,可选值: - //
  • `VPC`:私有网络
  • - //
  • `DIRECTCONNECT`:专线网关
  • - //
  • `BMVPC`:黑石私有网络
  • - //
  • `VPNGW`:VPNGW类型
  • - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 备注 - Description *string `json:"Description,omitempty" name:"Description"` - - // 实例关联的路由表ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` -} - -type CcnInstanceInfo struct { -} - -type CcnRegionBandwidthLimit struct { - // 地域,例如:ap-guangzhou - Region *string `json:"Region,omitempty" name:"Region"` - - // 出带宽上限,单位:Mbps - BandwidthLimit *uint64 `json:"BandwidthLimit,omitempty" name:"BandwidthLimit"` - - // 是否黑石地域,默认`false`。 - IsBm *bool `json:"IsBm,omitempty" name:"IsBm"` - - // 目的地域,例如:ap-shanghai - // 注意:此字段可能返回 null,表示取不到有效值。 - DstRegion *string `json:"DstRegion,omitempty" name:"DstRegion"` - - // 目的地域是否为黑石地域,默认`false`。 - DstIsBm *bool `json:"DstIsBm,omitempty" name:"DstIsBm"` -} - -type CcnRegionBandwidthLimitInfo struct { - // 源地域,例如:ap-shanghai - // 注意:此字段可能返回 null,表示取不到有效值。 - SourceRegion *string `json:"SourceRegion,omitempty" name:"SourceRegion"` - - // 目的地域, 例如:ap-shanghai - // 注意:此字段可能返回 null,表示取不到有效值。 - DestinationRegion *string `json:"DestinationRegion,omitempty" name:"DestinationRegion"` - - // 出带宽上限,单位:Mbps。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BandwidthLimit *uint64 `json:"BandwidthLimit,omitempty" name:"BandwidthLimit"` -} - -type CcnRoute struct { - // 路由策略ID - RouteId *string `json:"RouteId,omitempty" name:"RouteId"` - - // 目的端 - DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` - - // 下一跳类型(关联实例类型),所有类型:VPC、DIRECTCONNECT - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 下一跳(关联实例) - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 下一跳名称(关联实例名称) - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 下一跳所属地域(关联实例所属地域) - InstanceRegion *string `json:"InstanceRegion,omitempty" name:"InstanceRegion"` - - // 更新时间 - UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` - - // 路由是否启用 - Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` - - // 关联实例所属UIN(根账号) - InstanceUin *string `json:"InstanceUin,omitempty" name:"InstanceUin"` - - // 路由的扩展状态 - ExtraState *string `json:"ExtraState,omitempty" name:"ExtraState"` - - // 是否动态路由 - IsBgp *bool `json:"IsBgp,omitempty" name:"IsBgp"` - - // 路由优先级 - RoutePriority *uint64 `json:"RoutePriority,omitempty" name:"RoutePriority"` - - // 下一跳扩展名称(关联实例的扩展名称) - InstanceExtraName *string `json:"InstanceExtraName,omitempty" name:"InstanceExtraName"` -} - -// Predefined struct for user -type CheckAssistantCidrRequestParams struct { - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 待添加的辅助CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"]。入参NewCidrBlocks和OldCidrBlocks至少需要其一。 - NewCidrBlocks []*string `json:"NewCidrBlocks,omitempty" name:"NewCidrBlocks"` - - // 待删除的辅助CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"]。入参NewCidrBlocks和OldCidrBlocks至少需要其一。 - OldCidrBlocks []*string `json:"OldCidrBlocks,omitempty" name:"OldCidrBlocks"` -} - -type CheckAssistantCidrRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 待添加的辅助CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"]。入参NewCidrBlocks和OldCidrBlocks至少需要其一。 - NewCidrBlocks []*string `json:"NewCidrBlocks,omitempty" name:"NewCidrBlocks"` - - // 待删除的辅助CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"]。入参NewCidrBlocks和OldCidrBlocks至少需要其一。 - OldCidrBlocks []*string `json:"OldCidrBlocks,omitempty" name:"OldCidrBlocks"` -} - -func (r *CheckAssistantCidrRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CheckAssistantCidrRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "NewCidrBlocks") - delete(f, "OldCidrBlocks") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CheckAssistantCidrRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CheckAssistantCidrResponseParams struct { - // 冲突资源信息数组。 - ConflictSourceSet []*ConflictSource `json:"ConflictSourceSet,omitempty" name:"ConflictSourceSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CheckAssistantCidrResponse struct { - *tchttp.BaseResponse - Response *CheckAssistantCidrResponseParams `json:"Response"` -} - -func (r *CheckAssistantCidrResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CheckAssistantCidrResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CheckDefaultSubnetRequestParams struct { - // 子网所在的可用区ID,不同子网选择不同可用区可以做跨可用区灾备。 - Zone *string `json:"Zone,omitempty" name:"Zone"` -} - -type CheckDefaultSubnetRequest struct { - *tchttp.BaseRequest - - // 子网所在的可用区ID,不同子网选择不同可用区可以做跨可用区灾备。 - Zone *string `json:"Zone,omitempty" name:"Zone"` -} - -func (r *CheckDefaultSubnetRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CheckDefaultSubnetRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Zone") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CheckDefaultSubnetRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CheckDefaultSubnetResponseParams struct { - // 检查结果。true为可以创建默认子网,false为不可以创建默认子网。 - Result *bool `json:"Result,omitempty" name:"Result"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CheckDefaultSubnetResponse struct { - *tchttp.BaseResponse - Response *CheckDefaultSubnetResponseParams `json:"Response"` -} - -func (r *CheckDefaultSubnetResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CheckDefaultSubnetResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CheckNetDetectStateRequestParams struct { - // 探测目的IPv4地址数组,最多两个。 - DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` - - // 网络探测实例ID。形如:netd-12345678。该参数与(VpcId,SubnetId,NetDetectName),至少要有一个。当NetDetectId存在时,使用NetDetectId。 - NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` - - // `VPC`实例`ID`。形如:`vpc-12345678`。该参数与(SubnetId,NetDetectName)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。形如:subnet-12345678。该参数与(VpcId,NetDetectName)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 网络探测名称,最大长度不能超过60个字节。该参数与(VpcId,SubnetId)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 - NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` - - // 下一跳类型,目前我们支持的类型有: - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // CCN:云联网网关; - // NONEXTHOP:无下一跳; - NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` - - // 下一跳目的网关,取值与“下一跳类型”相关: - // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; - // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; - // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; - // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; - // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; - // 下一跳类型为CCN,取值云联网ID,形如:ccn-12345678; - // 下一跳类型为NONEXTHOP,指定网络探测为无下一跳的网络探测; - NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` -} - -type CheckNetDetectStateRequest struct { - *tchttp.BaseRequest - - // 探测目的IPv4地址数组,最多两个。 - DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` - - // 网络探测实例ID。形如:netd-12345678。该参数与(VpcId,SubnetId,NetDetectName),至少要有一个。当NetDetectId存在时,使用NetDetectId。 - NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` - - // `VPC`实例`ID`。形如:`vpc-12345678`。该参数与(SubnetId,NetDetectName)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。形如:subnet-12345678。该参数与(VpcId,NetDetectName)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 网络探测名称,最大长度不能超过60个字节。该参数与(VpcId,SubnetId)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 - NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` - - // 下一跳类型,目前我们支持的类型有: - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // CCN:云联网网关; - // NONEXTHOP:无下一跳; - NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` - - // 下一跳目的网关,取值与“下一跳类型”相关: - // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; - // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; - // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; - // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; - // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; - // 下一跳类型为CCN,取值云联网ID,形如:ccn-12345678; - // 下一跳类型为NONEXTHOP,指定网络探测为无下一跳的网络探测; - NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` -} - -func (r *CheckNetDetectStateRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CheckNetDetectStateRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DetectDestinationIp") - delete(f, "NetDetectId") - delete(f, "VpcId") - delete(f, "SubnetId") - delete(f, "NetDetectName") - delete(f, "NextHopType") - delete(f, "NextHopDestination") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CheckNetDetectStateRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CheckNetDetectStateResponseParams struct { - // 网络探测验证结果对象数组。 - NetDetectIpStateSet []*NetDetectIpState `json:"NetDetectIpStateSet,omitempty" name:"NetDetectIpStateSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CheckNetDetectStateResponse struct { - *tchttp.BaseResponse - Response *CheckNetDetectStateResponseParams `json:"Response"` -} - -func (r *CheckNetDetectStateResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CheckNetDetectStateResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type CidrForCcn struct { - // local cidr值。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Cidr *string `json:"Cidr,omitempty" name:"Cidr"` - - // 是否发布到了云联网。 - // 注意:此字段可能返回 null,表示取不到有效值。 - PublishedToVbc *bool `json:"PublishedToVbc,omitempty" name:"PublishedToVbc"` -} - -type ClassicLinkInstance struct { - // VPC实例ID - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 云服务器实例唯一ID - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -// Predefined struct for user -type CloneSecurityGroupRequestParams struct { - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组名称,可任意命名,但不得超过60个字符。未提供参数时,克隆后的安全组名称和SecurityGroupId对应的安全组名称相同。 - GroupName *string `json:"GroupName,omitempty" name:"GroupName"` - - // 安全组备注,最多100个字符。未提供参数时,克隆后的安全组备注和SecurityGroupId对应的安全组备注相同。 - GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` - - // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` - - // 源Region,跨地域克隆安全组时,需要传入源安全组所属地域信息,例如:克隆广州的安全组到上海,则这里需要传入广州安全的地域信息:ap-guangzhou。 - RemoteRegion *string `json:"RemoteRegion,omitempty" name:"RemoteRegion"` -} - -type CloneSecurityGroupRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组名称,可任意命名,但不得超过60个字符。未提供参数时,克隆后的安全组名称和SecurityGroupId对应的安全组名称相同。 - GroupName *string `json:"GroupName,omitempty" name:"GroupName"` - - // 安全组备注,最多100个字符。未提供参数时,克隆后的安全组备注和SecurityGroupId对应的安全组备注相同。 - GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` - - // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` - - // 源Region,跨地域克隆安全组时,需要传入源安全组所属地域信息,例如:克隆广州的安全组到上海,则这里需要传入广州安全的地域信息:ap-guangzhou。 - RemoteRegion *string `json:"RemoteRegion,omitempty" name:"RemoteRegion"` -} - -func (r *CloneSecurityGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CloneSecurityGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - delete(f, "GroupName") - delete(f, "GroupDescription") - delete(f, "ProjectId") - delete(f, "RemoteRegion") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CloneSecurityGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CloneSecurityGroupResponseParams struct { - // 安全组对象。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SecurityGroup *SecurityGroup `json:"SecurityGroup,omitempty" name:"SecurityGroup"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CloneSecurityGroupResponse struct { - *tchttp.BaseResponse - Response *CloneSecurityGroupResponseParams `json:"Response"` -} - -func (r *CloneSecurityGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CloneSecurityGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type ConflictItem struct { - // 冲突资源的ID - ConfilctId *string `json:"ConfilctId,omitempty" name:"ConfilctId"` - - // 冲突目的资源 - DestinationItem *string `json:"DestinationItem,omitempty" name:"DestinationItem"` -} - -type ConflictSource struct { - // 冲突资源ID - ConflictSourceId *string `json:"ConflictSourceId,omitempty" name:"ConflictSourceId"` - - // 冲突资源 - SourceItem *string `json:"SourceItem,omitempty" name:"SourceItem"` - - // 冲突资源条目信息 - ConflictItemSet []*ConflictItem `json:"ConflictItemSet,omitempty" name:"ConflictItemSet"` -} - -// Predefined struct for user -type CreateAddressTemplateGroupRequestParams struct { - // IP地址模板集合名称。 - AddressTemplateGroupName *string `json:"AddressTemplateGroupName,omitempty" name:"AddressTemplateGroupName"` - - // IP地址模板实例ID,例如:ipm-mdunqeb6。 - AddressTemplateIds []*string `json:"AddressTemplateIds,omitempty" name:"AddressTemplateIds"` -} - -type CreateAddressTemplateGroupRequest struct { - *tchttp.BaseRequest - - // IP地址模板集合名称。 - AddressTemplateGroupName *string `json:"AddressTemplateGroupName,omitempty" name:"AddressTemplateGroupName"` - - // IP地址模板实例ID,例如:ipm-mdunqeb6。 - AddressTemplateIds []*string `json:"AddressTemplateIds,omitempty" name:"AddressTemplateIds"` -} - -func (r *CreateAddressTemplateGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAddressTemplateGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressTemplateGroupName") - delete(f, "AddressTemplateIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAddressTemplateGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAddressTemplateGroupResponseParams struct { - // IP地址模板集合对象。 - AddressTemplateGroup *AddressTemplateGroup `json:"AddressTemplateGroup,omitempty" name:"AddressTemplateGroup"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateAddressTemplateGroupResponse struct { - *tchttp.BaseResponse - Response *CreateAddressTemplateGroupResponseParams `json:"Response"` -} - -func (r *CreateAddressTemplateGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAddressTemplateGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAddressTemplateRequestParams struct { - // IP地址模板名称。 - AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` - - // 地址信息,支持 IP、CIDR、IP 范围。Addresses与AddressesExtra必填其一。 - Addresses []*string `json:"Addresses,omitempty" name:"Addresses"` - - // 地址信息,支持携带备注,支持 IP、CIDR、IP 范围。Addresses与AddressesExtra必填其一。 - AddressesExtra []*AddressInfo `json:"AddressesExtra,omitempty" name:"AddressesExtra"` -} - -type CreateAddressTemplateRequest struct { - *tchttp.BaseRequest - - // IP地址模板名称。 - AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` - - // 地址信息,支持 IP、CIDR、IP 范围。Addresses与AddressesExtra必填其一。 - Addresses []*string `json:"Addresses,omitempty" name:"Addresses"` - - // 地址信息,支持携带备注,支持 IP、CIDR、IP 范围。Addresses与AddressesExtra必填其一。 - AddressesExtra []*AddressInfo `json:"AddressesExtra,omitempty" name:"AddressesExtra"` -} - -func (r *CreateAddressTemplateRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAddressTemplateRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressTemplateName") - delete(f, "Addresses") - delete(f, "AddressesExtra") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAddressTemplateRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAddressTemplateResponseParams struct { - // IP地址模板对象。 - AddressTemplate *AddressTemplate `json:"AddressTemplate,omitempty" name:"AddressTemplate"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateAddressTemplateResponse struct { - *tchttp.BaseResponse - Response *CreateAddressTemplateResponseParams `json:"Response"` -} - -func (r *CreateAddressTemplateResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAddressTemplateResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAndAttachNetworkInterfaceRequestParams struct { - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 弹性网卡名称,最大长度不能超过60个字节。 - NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` - - // 弹性网卡所在的子网实例ID,例如:subnet-0ap8nwca。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 云服务器实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 指定的内网IP信息,单次最多指定10个。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 新申请的内网IP地址个数,内网IP地址个数总和不能超过配额数。 - SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` - - // IP服务质量等级,和SecondaryPrivateIpAddressCount配合使用,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // 指定绑定的安全组,例如:['sg-1dd51d']。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 弹性网卡描述,可任意命名,但不得超过60个字符。 - NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 绑定类型:0 标准型 1 扩展型。 - AttachType *uint64 `json:"AttachType,omitempty" name:"AttachType"` -} - -type CreateAndAttachNetworkInterfaceRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 弹性网卡名称,最大长度不能超过60个字节。 - NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` - - // 弹性网卡所在的子网实例ID,例如:subnet-0ap8nwca。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 云服务器实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 指定的内网IP信息,单次最多指定10个。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 新申请的内网IP地址个数,内网IP地址个数总和不能超过配额数。 - SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` - - // IP服务质量等级,和SecondaryPrivateIpAddressCount配合使用,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // 指定绑定的安全组,例如:['sg-1dd51d']。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 弹性网卡描述,可任意命名,但不得超过60个字符。 - NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 绑定类型:0 标准型 1 扩展型。 - AttachType *uint64 `json:"AttachType,omitempty" name:"AttachType"` -} - -func (r *CreateAndAttachNetworkInterfaceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAndAttachNetworkInterfaceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "NetworkInterfaceName") - delete(f, "SubnetId") - delete(f, "InstanceId") - delete(f, "PrivateIpAddresses") - delete(f, "SecondaryPrivateIpAddressCount") - delete(f, "QosLevel") - delete(f, "SecurityGroupIds") - delete(f, "NetworkInterfaceDescription") - delete(f, "Tags") - delete(f, "AttachType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAndAttachNetworkInterfaceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAndAttachNetworkInterfaceResponseParams struct { - // 弹性网卡实例。 - NetworkInterface *NetworkInterface `json:"NetworkInterface,omitempty" name:"NetworkInterface"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateAndAttachNetworkInterfaceResponse struct { - *tchttp.BaseResponse - Response *CreateAndAttachNetworkInterfaceResponseParams `json:"Response"` -} - -func (r *CreateAndAttachNetworkInterfaceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAndAttachNetworkInterfaceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAssistantCidrRequestParams struct { - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"] - CidrBlocks []*string `json:"CidrBlocks,omitempty" name:"CidrBlocks"` -} - -type CreateAssistantCidrRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"] - CidrBlocks []*string `json:"CidrBlocks,omitempty" name:"CidrBlocks"` -} - -func (r *CreateAssistantCidrRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAssistantCidrRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "CidrBlocks") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAssistantCidrRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateAssistantCidrResponseParams struct { - // 辅助CIDR数组。 - // 注意:此字段可能返回 null,表示取不到有效值。 - AssistantCidrSet []*AssistantCidr `json:"AssistantCidrSet,omitempty" name:"AssistantCidrSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateAssistantCidrResponse struct { - *tchttp.BaseResponse - Response *CreateAssistantCidrResponseParams `json:"Response"` -} - -func (r *CreateAssistantCidrResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateAssistantCidrResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateBandwidthPackageRequestParams struct { - // 带宽包类型, 默认值: BGP, 可选值: - //
  • BGP: 普通BGP共享带宽包
  • - //
  • HIGH_QUALITY_BGP: 精品BGP共享带宽包
  • - NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` - - // 带宽包计费类型, 默认为: TOP5_POSTPAID_BY_MONTH, 可选值: - //
  • TOP5_POSTPAID_BY_MONTH: 按月后付费TOP5计费
  • - //
  • PERCENT95_POSTPAID_BY_MONTH: 按月后付费月95计费
  • - //
  • FIXED_PREPAID_BY_MONTH: 包月预付费计费
  • - ChargeType *string `json:"ChargeType,omitempty" name:"ChargeType"` - - // 带宽包名称。 - BandwidthPackageName *string `json:"BandwidthPackageName,omitempty" name:"BandwidthPackageName"` - - // 带宽包数量(传统账户类型只能填1), 标准账户类型取值范围为1~20。 - BandwidthPackageCount *uint64 `json:"BandwidthPackageCount,omitempty" name:"BandwidthPackageCount"` - - // 带宽包限速大小。单位:Mbps,-1表示不限速。该功能当前内测中,暂不对外开放。 - InternetMaxBandwidth *int64 `json:"InternetMaxBandwidth,omitempty" name:"InternetMaxBandwidth"` - - // 需要关联的标签列表。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 带宽包协议类型。当前支持'ipv4'和'ipv6'协议带宽包,默认值是'ipv4'。 - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` - - // 预付费包月带宽包的购买时长,单位: 月,取值范围: 1~60。 - TimeSpan *uint64 `json:"TimeSpan,omitempty" name:"TimeSpan"` -} - -type CreateBandwidthPackageRequest struct { - *tchttp.BaseRequest - - // 带宽包类型, 默认值: BGP, 可选值: - //
  • BGP: 普通BGP共享带宽包
  • - //
  • HIGH_QUALITY_BGP: 精品BGP共享带宽包
  • - NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` - - // 带宽包计费类型, 默认为: TOP5_POSTPAID_BY_MONTH, 可选值: - //
  • TOP5_POSTPAID_BY_MONTH: 按月后付费TOP5计费
  • - //
  • PERCENT95_POSTPAID_BY_MONTH: 按月后付费月95计费
  • - //
  • FIXED_PREPAID_BY_MONTH: 包月预付费计费
  • - ChargeType *string `json:"ChargeType,omitempty" name:"ChargeType"` - - // 带宽包名称。 - BandwidthPackageName *string `json:"BandwidthPackageName,omitempty" name:"BandwidthPackageName"` - - // 带宽包数量(传统账户类型只能填1), 标准账户类型取值范围为1~20。 - BandwidthPackageCount *uint64 `json:"BandwidthPackageCount,omitempty" name:"BandwidthPackageCount"` - - // 带宽包限速大小。单位:Mbps,-1表示不限速。该功能当前内测中,暂不对外开放。 - InternetMaxBandwidth *int64 `json:"InternetMaxBandwidth,omitempty" name:"InternetMaxBandwidth"` - - // 需要关联的标签列表。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 带宽包协议类型。当前支持'ipv4'和'ipv6'协议带宽包,默认值是'ipv4'。 - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` - - // 预付费包月带宽包的购买时长,单位: 月,取值范围: 1~60。 - TimeSpan *uint64 `json:"TimeSpan,omitempty" name:"TimeSpan"` -} - -func (r *CreateBandwidthPackageRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateBandwidthPackageRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkType") - delete(f, "ChargeType") - delete(f, "BandwidthPackageName") - delete(f, "BandwidthPackageCount") - delete(f, "InternetMaxBandwidth") - delete(f, "Tags") - delete(f, "Protocol") - delete(f, "TimeSpan") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateBandwidthPackageRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateBandwidthPackageResponseParams struct { - // 带宽包唯一ID。 - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 带宽包唯一ID列表(申请数量大于1时有效)。 - BandwidthPackageIds []*string `json:"BandwidthPackageIds,omitempty" name:"BandwidthPackageIds"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateBandwidthPackageResponse struct { - *tchttp.BaseResponse - Response *CreateBandwidthPackageResponseParams `json:"Response"` -} - -func (r *CreateBandwidthPackageResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateBandwidthPackageResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateCcnRequestParams struct { - // CCN名称,最大长度不能超过60个字节。 - CcnName *string `json:"CcnName,omitempty" name:"CcnName"` - - // CCN描述信息,最大长度不能超过100个字节。 - CcnDescription *string `json:"CcnDescription,omitempty" name:"CcnDescription"` - - // CCN服务质量,`PT`:白金,`AU`:金,`AG`:银,默认为`AU`。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // 计费模式,`PREPAID`:表示预付费,即包年包月,`POSTPAID`:表示后付费,即按量计费。默认:`POSTPAID`。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 限速类型,`OUTER_REGION_LIMIT`表示地域出口限速,`INTER_REGION_LIMIT`为地域间限速,默认为`OUTER_REGION_LIMIT`。预付费模式仅支持地域间限速,后付费模式支持地域间限速和地域出口限速。 - BandwidthLimitType *string `json:"BandwidthLimitType,omitempty" name:"BandwidthLimitType"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -type CreateCcnRequest struct { - *tchttp.BaseRequest - - // CCN名称,最大长度不能超过60个字节。 - CcnName *string `json:"CcnName,omitempty" name:"CcnName"` - - // CCN描述信息,最大长度不能超过100个字节。 - CcnDescription *string `json:"CcnDescription,omitempty" name:"CcnDescription"` - - // CCN服务质量,`PT`:白金,`AU`:金,`AG`:银,默认为`AU`。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // 计费模式,`PREPAID`:表示预付费,即包年包月,`POSTPAID`:表示后付费,即按量计费。默认:`POSTPAID`。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 限速类型,`OUTER_REGION_LIMIT`表示地域出口限速,`INTER_REGION_LIMIT`为地域间限速,默认为`OUTER_REGION_LIMIT`。预付费模式仅支持地域间限速,后付费模式支持地域间限速和地域出口限速。 - BandwidthLimitType *string `json:"BandwidthLimitType,omitempty" name:"BandwidthLimitType"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -func (r *CreateCcnRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateCcnRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnName") - delete(f, "CcnDescription") - delete(f, "QosLevel") - delete(f, "InstanceChargeType") - delete(f, "BandwidthLimitType") - delete(f, "Tags") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateCcnRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateCcnResponseParams struct { - // 云联网(CCN)对象。 - Ccn *CCN `json:"Ccn,omitempty" name:"Ccn"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateCcnResponse struct { - *tchttp.BaseResponse - Response *CreateCcnResponseParams `json:"Response"` -} - -func (r *CreateCcnResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateCcnResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateCustomerGatewayRequestParams struct { - // 对端网关名称,可任意命名,但不得超过60个字符。 - CustomerGatewayName *string `json:"CustomerGatewayName,omitempty" name:"CustomerGatewayName"` - - // 对端网关公网IP。 - IpAddress *string `json:"IpAddress,omitempty" name:"IpAddress"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -type CreateCustomerGatewayRequest struct { - *tchttp.BaseRequest - - // 对端网关名称,可任意命名,但不得超过60个字符。 - CustomerGatewayName *string `json:"CustomerGatewayName,omitempty" name:"CustomerGatewayName"` - - // 对端网关公网IP。 - IpAddress *string `json:"IpAddress,omitempty" name:"IpAddress"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -func (r *CreateCustomerGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateCustomerGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CustomerGatewayName") - delete(f, "IpAddress") - delete(f, "Tags") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateCustomerGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateCustomerGatewayResponseParams struct { - // 对端网关对象 - CustomerGateway *CustomerGateway `json:"CustomerGateway,omitempty" name:"CustomerGateway"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateCustomerGatewayResponse struct { - *tchttp.BaseResponse - Response *CreateCustomerGatewayResponseParams `json:"Response"` -} - -func (r *CreateCustomerGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateCustomerGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDefaultSecurityGroupRequestParams struct { - // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` -} - -type CreateDefaultSecurityGroupRequest struct { - *tchttp.BaseRequest - - // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` -} - -func (r *CreateDefaultSecurityGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDefaultSecurityGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ProjectId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDefaultSecurityGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDefaultSecurityGroupResponseParams struct { - // 安全组对象。 - SecurityGroup *SecurityGroup `json:"SecurityGroup,omitempty" name:"SecurityGroup"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateDefaultSecurityGroupResponse struct { - *tchttp.BaseResponse - Response *CreateDefaultSecurityGroupResponseParams `json:"Response"` -} - -func (r *CreateDefaultSecurityGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDefaultSecurityGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDefaultVpcRequestParams struct { - // 子网所在的可用区,该参数可通过[DescribeZones](https://cloud.tencent.com/document/product/213/15707)接口获取,例如ap-guangzhou-1,不指定时将随机选择可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 是否强制返回默认VPC。 - Force *bool `json:"Force,omitempty" name:"Force"` -} - -type CreateDefaultVpcRequest struct { - *tchttp.BaseRequest - - // 子网所在的可用区,该参数可通过[DescribeZones](https://cloud.tencent.com/document/product/213/15707)接口获取,例如ap-guangzhou-1,不指定时将随机选择可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 是否强制返回默认VPC。 - Force *bool `json:"Force,omitempty" name:"Force"` -} - -func (r *CreateDefaultVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDefaultVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Zone") - delete(f, "Force") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDefaultVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDefaultVpcResponseParams struct { - // 默认VPC和子网ID。 - Vpc *DefaultVpcSubnet `json:"Vpc,omitempty" name:"Vpc"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateDefaultVpcResponse struct { - *tchttp.BaseResponse - Response *CreateDefaultVpcResponseParams `json:"Response"` -} - -func (r *CreateDefaultVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDefaultVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDhcpIpRequestParams struct { - // 私有网络`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网`ID`。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // `DhcpIp`名称。 - DhcpIpName *string `json:"DhcpIpName,omitempty" name:"DhcpIpName"` - - // 新申请的内网IP地址个数。总数不能超过64个,为了兼容性,当前参数必填。 - SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` -} - -type CreateDhcpIpRequest struct { - *tchttp.BaseRequest - - // 私有网络`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网`ID`。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // `DhcpIp`名称。 - DhcpIpName *string `json:"DhcpIpName,omitempty" name:"DhcpIpName"` - - // 新申请的内网IP地址个数。总数不能超过64个,为了兼容性,当前参数必填。 - SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` -} - -func (r *CreateDhcpIpRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDhcpIpRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "SubnetId") - delete(f, "DhcpIpName") - delete(f, "SecondaryPrivateIpAddressCount") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDhcpIpRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDhcpIpResponseParams struct { - // 新创建的`DhcpIp`信息。 - DhcpIpSet []*DhcpIp `json:"DhcpIpSet,omitempty" name:"DhcpIpSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateDhcpIpResponse struct { - *tchttp.BaseResponse - Response *CreateDhcpIpResponseParams `json:"Response"` -} - -func (r *CreateDhcpIpResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDhcpIpResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDirectConnectGatewayCcnRoutesRequestParams struct { - // 专线网关ID,形如:dcg-prpqlmg1 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 需要连通的IDC网段列表 - Routes []*DirectConnectGatewayCcnRoute `json:"Routes,omitempty" name:"Routes"` -} - -type CreateDirectConnectGatewayCcnRoutesRequest struct { - *tchttp.BaseRequest - - // 专线网关ID,形如:dcg-prpqlmg1 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 需要连通的IDC网段列表 - Routes []*DirectConnectGatewayCcnRoute `json:"Routes,omitempty" name:"Routes"` -} - -func (r *CreateDirectConnectGatewayCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDirectConnectGatewayCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DirectConnectGatewayId") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDirectConnectGatewayCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDirectConnectGatewayCcnRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateDirectConnectGatewayCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *CreateDirectConnectGatewayCcnRoutesResponseParams `json:"Response"` -} - -func (r *CreateDirectConnectGatewayCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDirectConnectGatewayCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDirectConnectGatewayRequestParams struct { - // 专线网关名称 - DirectConnectGatewayName *string `json:"DirectConnectGatewayName,omitempty" name:"DirectConnectGatewayName"` - - // 关联网络类型,可选值: - //
  • VPC - 私有网络
  • - //
  • CCN - 云联网
  • - NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` - - //
  • NetworkType 为 VPC 时,这里传值为私有网络实例ID
  • - //
  • NetworkType 为 CCN 时,这里传值为云联网实例ID
  • - NetworkInstanceId *string `json:"NetworkInstanceId,omitempty" name:"NetworkInstanceId"` - - // 网关类型,可选值: - //
  • NORMAL - (默认)标准型,注:云联网只支持标准型
  • - //
  • NAT - NAT型
  • NAT类型支持网络地址转换配置,类型确定后不能修改;一个私有网络可以创建一个NAT类型的专线网关和一个非NAT类型的专线网关 - GatewayType *string `json:"GatewayType,omitempty" name:"GatewayType"` - - // 云联网路由发布模式,可选值:`standard`(标准模式)、`exquisite`(精细模式)。只有云联网类型专线网关才支持`ModeType`。 - ModeType *string `json:"ModeType,omitempty" name:"ModeType"` - - // 专线网关可用区 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 专线网关高可用区容灾组ID - HaZoneGroupId *string `json:"HaZoneGroupId,omitempty" name:"HaZoneGroupId"` -} - -type CreateDirectConnectGatewayRequest struct { - *tchttp.BaseRequest - - // 专线网关名称 - DirectConnectGatewayName *string `json:"DirectConnectGatewayName,omitempty" name:"DirectConnectGatewayName"` - - // 关联网络类型,可选值: - //
  • VPC - 私有网络
  • - //
  • CCN - 云联网
  • - NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` - - //
  • NetworkType 为 VPC 时,这里传值为私有网络实例ID
  • - //
  • NetworkType 为 CCN 时,这里传值为云联网实例ID
  • - NetworkInstanceId *string `json:"NetworkInstanceId,omitempty" name:"NetworkInstanceId"` - - // 网关类型,可选值: - //
  • NORMAL - (默认)标准型,注:云联网只支持标准型
  • - //
  • NAT - NAT型
  • NAT类型支持网络地址转换配置,类型确定后不能修改;一个私有网络可以创建一个NAT类型的专线网关和一个非NAT类型的专线网关 - GatewayType *string `json:"GatewayType,omitempty" name:"GatewayType"` - - // 云联网路由发布模式,可选值:`standard`(标准模式)、`exquisite`(精细模式)。只有云联网类型专线网关才支持`ModeType`。 - ModeType *string `json:"ModeType,omitempty" name:"ModeType"` - - // 专线网关可用区 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 专线网关高可用区容灾组ID - HaZoneGroupId *string `json:"HaZoneGroupId,omitempty" name:"HaZoneGroupId"` -} - -func (r *CreateDirectConnectGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDirectConnectGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DirectConnectGatewayName") - delete(f, "NetworkType") - delete(f, "NetworkInstanceId") - delete(f, "GatewayType") - delete(f, "ModeType") - delete(f, "Zone") - delete(f, "HaZoneGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDirectConnectGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateDirectConnectGatewayResponseParams struct { - // 专线网关对象。 - DirectConnectGateway *DirectConnectGateway `json:"DirectConnectGateway,omitempty" name:"DirectConnectGateway"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateDirectConnectGatewayResponse struct { - *tchttp.BaseResponse - Response *CreateDirectConnectGatewayResponseParams `json:"Response"` -} - -func (r *CreateDirectConnectGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateDirectConnectGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateFlowLogRequestParams struct { - // 流日志实例名字。 - FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` - - // 流日志所属资源类型,VPC|SUBNET|NETWORKINTERFACE|CCN|NAT|DCG。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源唯一ID。 - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 流日志采集类型,ACCEPT|REJECT|ALL。 - TrafficType *string `json:"TrafficType,omitempty" name:"TrafficType"` - - // 私用网络ID或者统一ID,建议使用统一ID,当ResourceType为CCN时不填,其他类型必填。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志实例描述。 - FlowLogDescription *string `json:"FlowLogDescription,omitempty" name:"FlowLogDescription"` - - // 流日志存储ID。 - CloudLogId *string `json:"CloudLogId,omitempty" name:"CloudLogId"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 消费端类型:cls、ckafka。默认值cls。 - StorageType *string `json:"StorageType,omitempty" name:"StorageType"` - - // 流日志消费端信息,当消费端类型为ckafka时,必填。 - FlowLogStorage *FlowLogStorage `json:"FlowLogStorage,omitempty" name:"FlowLogStorage"` - - // 流日志存储ID对应的地域,不传递默认为本地域。 - CloudLogRegion *string `json:"CloudLogRegion,omitempty" name:"CloudLogRegion"` -} - -type CreateFlowLogRequest struct { - *tchttp.BaseRequest - - // 流日志实例名字。 - FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` - - // 流日志所属资源类型,VPC|SUBNET|NETWORKINTERFACE|CCN|NAT|DCG。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源唯一ID。 - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 流日志采集类型,ACCEPT|REJECT|ALL。 - TrafficType *string `json:"TrafficType,omitempty" name:"TrafficType"` - - // 私用网络ID或者统一ID,建议使用统一ID,当ResourceType为CCN时不填,其他类型必填。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志实例描述。 - FlowLogDescription *string `json:"FlowLogDescription,omitempty" name:"FlowLogDescription"` - - // 流日志存储ID。 - CloudLogId *string `json:"CloudLogId,omitempty" name:"CloudLogId"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 消费端类型:cls、ckafka。默认值cls。 - StorageType *string `json:"StorageType,omitempty" name:"StorageType"` - - // 流日志消费端信息,当消费端类型为ckafka时,必填。 - FlowLogStorage *FlowLogStorage `json:"FlowLogStorage,omitempty" name:"FlowLogStorage"` - - // 流日志存储ID对应的地域,不传递默认为本地域。 - CloudLogRegion *string `json:"CloudLogRegion,omitempty" name:"CloudLogRegion"` -} - -func (r *CreateFlowLogRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateFlowLogRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "FlowLogName") - delete(f, "ResourceType") - delete(f, "ResourceId") - delete(f, "TrafficType") - delete(f, "VpcId") - delete(f, "FlowLogDescription") - delete(f, "CloudLogId") - delete(f, "Tags") - delete(f, "StorageType") - delete(f, "FlowLogStorage") - delete(f, "CloudLogRegion") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateFlowLogRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateFlowLogResponseParams struct { - // 创建的流日志信息。 - FlowLog []*FlowLog `json:"FlowLog,omitempty" name:"FlowLog"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateFlowLogResponse struct { - *tchttp.BaseResponse - Response *CreateFlowLogResponseParams `json:"Response"` -} - -func (r *CreateFlowLogResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateFlowLogResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateHaVipRequestParams struct { - // `HAVIP`所在私有网络`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `HAVIP`所在子网`ID`。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // `HAVIP`名称。 - HaVipName *string `json:"HaVipName,omitempty" name:"HaVipName"` - - // 指定虚拟IP地址,必须在`VPC`网段内且未被占用。不指定则自动分配。 - Vip *string `json:"Vip,omitempty" name:"Vip"` - - // `HAVIP`所在弹性网卡`ID`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` -} - -type CreateHaVipRequest struct { - *tchttp.BaseRequest - - // `HAVIP`所在私有网络`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `HAVIP`所在子网`ID`。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // `HAVIP`名称。 - HaVipName *string `json:"HaVipName,omitempty" name:"HaVipName"` - - // 指定虚拟IP地址,必须在`VPC`网段内且未被占用。不指定则自动分配。 - Vip *string `json:"Vip,omitempty" name:"Vip"` - - // `HAVIP`所在弹性网卡`ID`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` -} - -func (r *CreateHaVipRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateHaVipRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "SubnetId") - delete(f, "HaVipName") - delete(f, "Vip") - delete(f, "NetworkInterfaceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateHaVipRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateHaVipResponseParams struct { - // `HAVIP`对象。 - HaVip *HaVip `json:"HaVip,omitempty" name:"HaVip"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateHaVipResponse struct { - *tchttp.BaseResponse - Response *CreateHaVipResponseParams `json:"Response"` -} - -func (r *CreateHaVipResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateHaVipResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateIp6TranslatorsRequestParams struct { - // 转换实例名称 - Ip6TranslatorName *string `json:"Ip6TranslatorName,omitempty" name:"Ip6TranslatorName"` - - // 创建转换实例数量,默认是1个 - Ip6TranslatorCount *int64 `json:"Ip6TranslatorCount,omitempty" name:"Ip6TranslatorCount"` - - // 转换实例运营商属性,可取"CMCC","CTCC","CUCC","BGP" - Ip6InternetServiceProvider *string `json:"Ip6InternetServiceProvider,omitempty" name:"Ip6InternetServiceProvider"` -} - -type CreateIp6TranslatorsRequest struct { - *tchttp.BaseRequest - - // 转换实例名称 - Ip6TranslatorName *string `json:"Ip6TranslatorName,omitempty" name:"Ip6TranslatorName"` - - // 创建转换实例数量,默认是1个 - Ip6TranslatorCount *int64 `json:"Ip6TranslatorCount,omitempty" name:"Ip6TranslatorCount"` - - // 转换实例运营商属性,可取"CMCC","CTCC","CUCC","BGP" - Ip6InternetServiceProvider *string `json:"Ip6InternetServiceProvider,omitempty" name:"Ip6InternetServiceProvider"` -} - -func (r *CreateIp6TranslatorsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateIp6TranslatorsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6TranslatorName") - delete(f, "Ip6TranslatorCount") - delete(f, "Ip6InternetServiceProvider") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateIp6TranslatorsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateIp6TranslatorsResponseParams struct { - // 转换实例的唯一ID数组,形如"ip6-xxxxxxxx" - Ip6TranslatorSet []*string `json:"Ip6TranslatorSet,omitempty" name:"Ip6TranslatorSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateIp6TranslatorsResponse struct { - *tchttp.BaseResponse - Response *CreateIp6TranslatorsResponseParams `json:"Response"` -} - -func (r *CreateIp6TranslatorsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateIp6TranslatorsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLocalGatewayRequestParams struct { - // 本地网关名称。 - LocalGatewayName *string `json:"LocalGatewayName,omitempty" name:"LocalGatewayName"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` -} - -type CreateLocalGatewayRequest struct { - *tchttp.BaseRequest - - // 本地网关名称。 - LocalGatewayName *string `json:"LocalGatewayName,omitempty" name:"LocalGatewayName"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` -} - -func (r *CreateLocalGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLocalGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LocalGatewayName") - delete(f, "VpcId") - delete(f, "CdcId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateLocalGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateLocalGatewayResponseParams struct { - // 本地网关信息。 - LocalGateway *LocalGateway `json:"LocalGateway,omitempty" name:"LocalGateway"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateLocalGatewayResponse struct { - *tchttp.BaseResponse - Response *CreateLocalGatewayResponseParams `json:"Response"` -} - -func (r *CreateLocalGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateLocalGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNatGatewayDestinationIpPortTranslationNatRuleRequestParams struct { - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的端口转换规则。 - DestinationIpPortTranslationNatRules []*DestinationIpPortTranslationNatRule `json:"DestinationIpPortTranslationNatRules,omitempty" name:"DestinationIpPortTranslationNatRules"` -} - -type CreateNatGatewayDestinationIpPortTranslationNatRuleRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的端口转换规则。 - DestinationIpPortTranslationNatRules []*DestinationIpPortTranslationNatRule `json:"DestinationIpPortTranslationNatRules,omitempty" name:"DestinationIpPortTranslationNatRules"` -} - -func (r *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "DestinationIpPortTranslationNatRules") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateNatGatewayDestinationIpPortTranslationNatRuleRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNatGatewayDestinationIpPortTranslationNatRuleResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateNatGatewayDestinationIpPortTranslationNatRuleResponse struct { - *tchttp.BaseResponse - Response *CreateNatGatewayDestinationIpPortTranslationNatRuleResponseParams `json:"Response"` -} - -func (r *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNatGatewayRequestParams struct { - // NAT网关名称 - NatGatewayName *string `json:"NatGatewayName,omitempty" name:"NatGatewayName"` - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关最大外网出带宽(单位:Mbps),支持的参数值:`20, 50, 100, 200, 500, 1000, 2000, 5000`,默认: `100Mbps`。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // NAT网关并发连接上限,支持参数值:`1000000、3000000、10000000`,默认值为`100000`。 - MaxConcurrentConnection *uint64 `json:"MaxConcurrentConnection,omitempty" name:"MaxConcurrentConnection"` - - // 需要申请的弹性IP个数,系统会按您的要求生产N个弹性IP,其中AddressCount和PublicAddresses至少传递一个。 - AddressCount *uint64 `json:"AddressCount,omitempty" name:"AddressCount"` - - // 绑定NAT网关的弹性IP数组,其中AddressCount和PublicAddresses至少传递一个。 - PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses"` - - // 可用区,形如:`ap-guangzhou-1`。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // NAT网关所属子网 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 绑定NAT网关的弹性IP带宽大小(单位Mbps),默认为当前用户类型所能使用的最大值。 - StockPublicIpAddressesBandwidthOut *uint64 `json:"StockPublicIpAddressesBandwidthOut,omitempty" name:"StockPublicIpAddressesBandwidthOut"` - - // 需要申请公网IP带宽大小(单位Mbps),默认为当前用户类型所能使用的最大值。 - PublicIpAddressesBandwidthOut *uint64 `json:"PublicIpAddressesBandwidthOut,omitempty" name:"PublicIpAddressesBandwidthOut"` - - // 公网IP是否强制与NAT网关来自同可用区,true表示需要与NAT网关同可用区;false表示可与NAT网关不是同一个可用区。此参数只有当参数Zone存在时才能生效。 - PublicIpFromSameZone *bool `json:"PublicIpFromSameZone,omitempty" name:"PublicIpFromSameZone"` -} - -type CreateNatGatewayRequest struct { - *tchttp.BaseRequest - - // NAT网关名称 - NatGatewayName *string `json:"NatGatewayName,omitempty" name:"NatGatewayName"` - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关最大外网出带宽(单位:Mbps),支持的参数值:`20, 50, 100, 200, 500, 1000, 2000, 5000`,默认: `100Mbps`。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // NAT网关并发连接上限,支持参数值:`1000000、3000000、10000000`,默认值为`100000`。 - MaxConcurrentConnection *uint64 `json:"MaxConcurrentConnection,omitempty" name:"MaxConcurrentConnection"` - - // 需要申请的弹性IP个数,系统会按您的要求生产N个弹性IP,其中AddressCount和PublicAddresses至少传递一个。 - AddressCount *uint64 `json:"AddressCount,omitempty" name:"AddressCount"` - - // 绑定NAT网关的弹性IP数组,其中AddressCount和PublicAddresses至少传递一个。 - PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses"` - - // 可用区,形如:`ap-guangzhou-1`。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // NAT网关所属子网 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 绑定NAT网关的弹性IP带宽大小(单位Mbps),默认为当前用户类型所能使用的最大值。 - StockPublicIpAddressesBandwidthOut *uint64 `json:"StockPublicIpAddressesBandwidthOut,omitempty" name:"StockPublicIpAddressesBandwidthOut"` - - // 需要申请公网IP带宽大小(单位Mbps),默认为当前用户类型所能使用的最大值。 - PublicIpAddressesBandwidthOut *uint64 `json:"PublicIpAddressesBandwidthOut,omitempty" name:"PublicIpAddressesBandwidthOut"` - - // 公网IP是否强制与NAT网关来自同可用区,true表示需要与NAT网关同可用区;false表示可与NAT网关不是同一个可用区。此参数只有当参数Zone存在时才能生效。 - PublicIpFromSameZone *bool `json:"PublicIpFromSameZone,omitempty" name:"PublicIpFromSameZone"` -} - -func (r *CreateNatGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNatGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayName") - delete(f, "VpcId") - delete(f, "InternetMaxBandwidthOut") - delete(f, "MaxConcurrentConnection") - delete(f, "AddressCount") - delete(f, "PublicIpAddresses") - delete(f, "Zone") - delete(f, "Tags") - delete(f, "SubnetId") - delete(f, "StockPublicIpAddressesBandwidthOut") - delete(f, "PublicIpAddressesBandwidthOut") - delete(f, "PublicIpFromSameZone") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateNatGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNatGatewayResponseParams struct { - // NAT网关对象数组。 - NatGatewaySet []*NatGateway `json:"NatGatewaySet,omitempty" name:"NatGatewaySet"` - - // 符合条件的 NAT网关对象数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateNatGatewayResponse struct { - *tchttp.BaseResponse - Response *CreateNatGatewayResponseParams `json:"Response"` -} - -func (r *CreateNatGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNatGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNatGatewaySourceIpTranslationNatRuleRequestParams struct { - // NAT网关的ID,形如:"nat-df45454" - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的SNAT转换规则 - SourceIpTranslationNatRules []*SourceIpTranslationNatRule `json:"SourceIpTranslationNatRules,omitempty" name:"SourceIpTranslationNatRules"` -} - -type CreateNatGatewaySourceIpTranslationNatRuleRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:"nat-df45454" - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的SNAT转换规则 - SourceIpTranslationNatRules []*SourceIpTranslationNatRule `json:"SourceIpTranslationNatRules,omitempty" name:"SourceIpTranslationNatRules"` -} - -func (r *CreateNatGatewaySourceIpTranslationNatRuleRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNatGatewaySourceIpTranslationNatRuleRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "SourceIpTranslationNatRules") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateNatGatewaySourceIpTranslationNatRuleRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNatGatewaySourceIpTranslationNatRuleResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateNatGatewaySourceIpTranslationNatRuleResponse struct { - *tchttp.BaseResponse - Response *CreateNatGatewaySourceIpTranslationNatRuleResponseParams `json:"Response"` -} - -func (r *CreateNatGatewaySourceIpTranslationNatRuleResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNatGatewaySourceIpTranslationNatRuleResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNetDetectRequestParams struct { - // `VPC`实例`ID`。形如:`vpc-12345678`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。形如:subnet-12345678。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 网络探测名称,最大长度不能超过60个字节。 - NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` - - // 探测目的IPv4地址数组。最多两个。 - DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` - - // 下一跳类型,目前我们支持的类型有: - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // CCN:云联网网关; - // NONEXTHOP:无下一跳; - NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` - - // 下一跳目的网关,取值与“下一跳类型”相关: - // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; - // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; - // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; - // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; - // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; - // 下一跳类型为CCN,取值云联网ID,形如:ccn-12345678; - // 下一跳类型为NONEXTHOP,指定网络探测为无下一跳的网络探测; - NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` - - // 网络探测描述。 - NetDetectDescription *string `json:"NetDetectDescription,omitempty" name:"NetDetectDescription"` -} - -type CreateNetDetectRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`。形如:`vpc-12345678`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。形如:subnet-12345678。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 网络探测名称,最大长度不能超过60个字节。 - NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` - - // 探测目的IPv4地址数组。最多两个。 - DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` - - // 下一跳类型,目前我们支持的类型有: - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // CCN:云联网网关; - // NONEXTHOP:无下一跳; - NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` - - // 下一跳目的网关,取值与“下一跳类型”相关: - // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; - // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; - // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; - // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; - // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; - // 下一跳类型为CCN,取值云联网ID,形如:ccn-12345678; - // 下一跳类型为NONEXTHOP,指定网络探测为无下一跳的网络探测; - NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` - - // 网络探测描述。 - NetDetectDescription *string `json:"NetDetectDescription,omitempty" name:"NetDetectDescription"` -} - -func (r *CreateNetDetectRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNetDetectRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "SubnetId") - delete(f, "NetDetectName") - delete(f, "DetectDestinationIp") - delete(f, "NextHopType") - delete(f, "NextHopDestination") - delete(f, "NetDetectDescription") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateNetDetectRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNetDetectResponseParams struct { - // 网络探测(NetDetect)对象。 - NetDetect *NetDetect `json:"NetDetect,omitempty" name:"NetDetect"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateNetDetectResponse struct { - *tchttp.BaseResponse - Response *CreateNetDetectResponseParams `json:"Response"` -} - -func (r *CreateNetDetectResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNetDetectResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNetworkAclQuintupleEntriesRequestParams struct { - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络五元组ACL规则集。 - NetworkAclQuintupleSet *NetworkAclQuintupleEntries `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` -} - -type CreateNetworkAclQuintupleEntriesRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络五元组ACL规则集。 - NetworkAclQuintupleSet *NetworkAclQuintupleEntries `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` -} - -func (r *CreateNetworkAclQuintupleEntriesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNetworkAclQuintupleEntriesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - delete(f, "NetworkAclQuintupleSet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateNetworkAclQuintupleEntriesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNetworkAclQuintupleEntriesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateNetworkAclQuintupleEntriesResponse struct { - *tchttp.BaseResponse - Response *CreateNetworkAclQuintupleEntriesResponseParams `json:"Response"` -} - -func (r *CreateNetworkAclQuintupleEntriesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNetworkAclQuintupleEntriesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNetworkAclRequestParams struct { - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 网络ACL名称,最大长度不能超过60个字节。 - NetworkAclName *string `json:"NetworkAclName,omitempty" name:"NetworkAclName"` - - // 网络ACL类型,三元组(TRIPLE)或五元组(QUINTUPLE)。默认值三元组(TRIPLE)。 - NetworkAclType *string `json:"NetworkAclType,omitempty" name:"NetworkAclType"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -type CreateNetworkAclRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 网络ACL名称,最大长度不能超过60个字节。 - NetworkAclName *string `json:"NetworkAclName,omitempty" name:"NetworkAclName"` - - // 网络ACL类型,三元组(TRIPLE)或五元组(QUINTUPLE)。默认值三元组(TRIPLE)。 - NetworkAclType *string `json:"NetworkAclType,omitempty" name:"NetworkAclType"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -func (r *CreateNetworkAclRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNetworkAclRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "NetworkAclName") - delete(f, "NetworkAclType") - delete(f, "Tags") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateNetworkAclRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNetworkAclResponseParams struct { - // 网络ACL实例。 - NetworkAcl *NetworkAcl `json:"NetworkAcl,omitempty" name:"NetworkAcl"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateNetworkAclResponse struct { - *tchttp.BaseResponse - Response *CreateNetworkAclResponseParams `json:"Response"` -} - -func (r *CreateNetworkAclResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNetworkAclResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNetworkInterfaceRequestParams struct { - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 弹性网卡名称,最大长度不能超过60个字节。 - NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` - - // 弹性网卡所在的子网实例ID,例如:subnet-0ap8nwca。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 弹性网卡描述,可任意命名,但不得超过60个字符。 - NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` - - // 新申请的内网IP地址个数,内网IP地址个数总和不能超过配额数。 - SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` - - // IP服务质量等级,和SecondaryPrivateIpAddressCount配合使用,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // 指定绑定的安全组,例如:['sg-1dd51d']。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 指定的内网IP信息,单次最多指定10个。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 网卡trunking模式设置,Enable-开启,Disable--关闭,默认关闭。 - TrunkingFlag *string `json:"TrunkingFlag,omitempty" name:"TrunkingFlag"` -} - -type CreateNetworkInterfaceRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 弹性网卡名称,最大长度不能超过60个字节。 - NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` - - // 弹性网卡所在的子网实例ID,例如:subnet-0ap8nwca。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 弹性网卡描述,可任意命名,但不得超过60个字符。 - NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` - - // 新申请的内网IP地址个数,内网IP地址个数总和不能超过配额数。 - SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` - - // IP服务质量等级,和SecondaryPrivateIpAddressCount配合使用,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // 指定绑定的安全组,例如:['sg-1dd51d']。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 指定的内网IP信息,单次最多指定10个。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 网卡trunking模式设置,Enable-开启,Disable--关闭,默认关闭。 - TrunkingFlag *string `json:"TrunkingFlag,omitempty" name:"TrunkingFlag"` -} - -func (r *CreateNetworkInterfaceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNetworkInterfaceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "NetworkInterfaceName") - delete(f, "SubnetId") - delete(f, "NetworkInterfaceDescription") - delete(f, "SecondaryPrivateIpAddressCount") - delete(f, "QosLevel") - delete(f, "SecurityGroupIds") - delete(f, "PrivateIpAddresses") - delete(f, "Tags") - delete(f, "TrunkingFlag") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateNetworkInterfaceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateNetworkInterfaceResponseParams struct { - // 弹性网卡实例。 - NetworkInterface *NetworkInterface `json:"NetworkInterface,omitempty" name:"NetworkInterface"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateNetworkInterfaceResponse struct { - *tchttp.BaseResponse - Response *CreateNetworkInterfaceResponseParams `json:"Response"` -} - -func (r *CreateNetworkInterfaceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateNetworkInterfaceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateRouteTableRequestParams struct { - // 待操作的VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 路由表名称,最大长度不能超过60个字节。 - RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -type CreateRouteTableRequest struct { - *tchttp.BaseRequest - - // 待操作的VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 路由表名称,最大长度不能超过60个字节。 - RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -func (r *CreateRouteTableRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateRouteTableRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "RouteTableName") - delete(f, "Tags") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateRouteTableRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateRouteTableResponseParams struct { - // 路由表对象。 - RouteTable *RouteTable `json:"RouteTable,omitempty" name:"RouteTable"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateRouteTableResponse struct { - *tchttp.BaseResponse - Response *CreateRouteTableResponseParams `json:"Response"` -} - -func (r *CreateRouteTableResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateRouteTableResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateRoutesRequestParams struct { - // 路由表实例ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略对象。 - Routes []*Route `json:"Routes,omitempty" name:"Routes"` -} - -type CreateRoutesRequest struct { - *tchttp.BaseRequest - - // 路由表实例ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略对象。 - Routes []*Route `json:"Routes,omitempty" name:"Routes"` -} - -func (r *CreateRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateRoutesResponseParams struct { - // 新增的实例个数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 路由表对象。 - RouteTableSet []*RouteTable `json:"RouteTableSet,omitempty" name:"RouteTableSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateRoutesResponse struct { - *tchttp.BaseResponse - Response *CreateRoutesResponseParams `json:"Response"` -} - -func (r *CreateRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSecurityGroupPoliciesRequestParams struct { - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` -} - -type CreateSecurityGroupPoliciesRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` -} - -func (r *CreateSecurityGroupPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSecurityGroupPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - delete(f, "SecurityGroupPolicySet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSecurityGroupPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSecurityGroupPoliciesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateSecurityGroupPoliciesResponse struct { - *tchttp.BaseResponse - Response *CreateSecurityGroupPoliciesResponseParams `json:"Response"` -} - -func (r *CreateSecurityGroupPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSecurityGroupPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSecurityGroupRequestParams struct { - // 安全组名称,可任意命名,但不得超过60个字符。 - GroupName *string `json:"GroupName,omitempty" name:"GroupName"` - - // 安全组备注,最多100个字符。 - GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` - - // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -type CreateSecurityGroupRequest struct { - *tchttp.BaseRequest - - // 安全组名称,可任意命名,但不得超过60个字符。 - GroupName *string `json:"GroupName,omitempty" name:"GroupName"` - - // 安全组备注,最多100个字符。 - GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` - - // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -func (r *CreateSecurityGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSecurityGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "GroupName") - delete(f, "GroupDescription") - delete(f, "ProjectId") - delete(f, "Tags") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSecurityGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSecurityGroupResponseParams struct { - // 安全组对象。 - SecurityGroup *SecurityGroup `json:"SecurityGroup,omitempty" name:"SecurityGroup"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateSecurityGroupResponse struct { - *tchttp.BaseResponse - Response *CreateSecurityGroupResponseParams `json:"Response"` -} - -func (r *CreateSecurityGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSecurityGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSecurityGroupWithPoliciesRequestParams struct { - // 安全组名称,可任意命名,但不得超过60个字符。 - GroupName *string `json:"GroupName,omitempty" name:"GroupName"` - - // 安全组备注,最多100个字符。 - GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` - - // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` - - // 安全组规则集合。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` -} - -type CreateSecurityGroupWithPoliciesRequest struct { - *tchttp.BaseRequest - - // 安全组名称,可任意命名,但不得超过60个字符。 - GroupName *string `json:"GroupName,omitempty" name:"GroupName"` - - // 安全组备注,最多100个字符。 - GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` - - // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` - - // 安全组规则集合。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` -} - -func (r *CreateSecurityGroupWithPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSecurityGroupWithPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "GroupName") - delete(f, "GroupDescription") - delete(f, "ProjectId") - delete(f, "SecurityGroupPolicySet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSecurityGroupWithPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSecurityGroupWithPoliciesResponseParams struct { - // 安全组对象。 - SecurityGroup *SecurityGroup `json:"SecurityGroup,omitempty" name:"SecurityGroup"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateSecurityGroupWithPoliciesResponse struct { - *tchttp.BaseResponse - Response *CreateSecurityGroupWithPoliciesResponseParams `json:"Response"` -} - -func (r *CreateSecurityGroupWithPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSecurityGroupWithPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateServiceTemplateGroupRequestParams struct { - // 协议端口模板集合名称。 - ServiceTemplateGroupName *string `json:"ServiceTemplateGroupName,omitempty" name:"ServiceTemplateGroupName"` - - // 协议端口模板实例ID,例如:ppm-4dw6agho。 - ServiceTemplateIds []*string `json:"ServiceTemplateIds,omitempty" name:"ServiceTemplateIds"` -} - -type CreateServiceTemplateGroupRequest struct { - *tchttp.BaseRequest - - // 协议端口模板集合名称。 - ServiceTemplateGroupName *string `json:"ServiceTemplateGroupName,omitempty" name:"ServiceTemplateGroupName"` - - // 协议端口模板实例ID,例如:ppm-4dw6agho。 - ServiceTemplateIds []*string `json:"ServiceTemplateIds,omitempty" name:"ServiceTemplateIds"` -} - -func (r *CreateServiceTemplateGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateServiceTemplateGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ServiceTemplateGroupName") - delete(f, "ServiceTemplateIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateServiceTemplateGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateServiceTemplateGroupResponseParams struct { - // 协议端口模板集合对象。 - ServiceTemplateGroup *ServiceTemplateGroup `json:"ServiceTemplateGroup,omitempty" name:"ServiceTemplateGroup"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateServiceTemplateGroupResponse struct { - *tchttp.BaseResponse - Response *CreateServiceTemplateGroupResponseParams `json:"Response"` -} - -func (r *CreateServiceTemplateGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateServiceTemplateGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateServiceTemplateRequestParams struct { - // 协议端口模板名称。 - ServiceTemplateName *string `json:"ServiceTemplateName,omitempty" name:"ServiceTemplateName"` - - // 支持单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。Services与ServicesExtra必填其一。 - Services []*string `json:"Services,omitempty" name:"Services"` - - // 支持添加备注,单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。Services与ServicesExtra必填其一。 - ServicesExtra []*ServicesInfo `json:"ServicesExtra,omitempty" name:"ServicesExtra"` -} - -type CreateServiceTemplateRequest struct { - *tchttp.BaseRequest - - // 协议端口模板名称。 - ServiceTemplateName *string `json:"ServiceTemplateName,omitempty" name:"ServiceTemplateName"` - - // 支持单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。Services与ServicesExtra必填其一。 - Services []*string `json:"Services,omitempty" name:"Services"` - - // 支持添加备注,单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。Services与ServicesExtra必填其一。 - ServicesExtra []*ServicesInfo `json:"ServicesExtra,omitempty" name:"ServicesExtra"` -} - -func (r *CreateServiceTemplateRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateServiceTemplateRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ServiceTemplateName") - delete(f, "Services") - delete(f, "ServicesExtra") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateServiceTemplateRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateServiceTemplateResponseParams struct { - // 协议端口模板对象。 - ServiceTemplate *ServiceTemplate `json:"ServiceTemplate,omitempty" name:"ServiceTemplate"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateServiceTemplateResponse struct { - *tchttp.BaseResponse - Response *CreateServiceTemplateResponseParams `json:"Response"` -} - -func (r *CreateServiceTemplateResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateServiceTemplateResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSnapshotPoliciesRequestParams struct { - // 快照策略详情。 - SnapshotPolicies []*SnapshotPolicy `json:"SnapshotPolicies,omitempty" name:"SnapshotPolicies"` -} - -type CreateSnapshotPoliciesRequest struct { - *tchttp.BaseRequest - - // 快照策略详情。 - SnapshotPolicies []*SnapshotPolicy `json:"SnapshotPolicies,omitempty" name:"SnapshotPolicies"` -} - -func (r *CreateSnapshotPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSnapshotPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicies") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSnapshotPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSnapshotPoliciesResponseParams struct { - // 快照策略。 - SnapshotPolicies []*SnapshotPolicy `json:"SnapshotPolicies,omitempty" name:"SnapshotPolicies"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateSnapshotPoliciesResponse struct { - *tchttp.BaseResponse - Response *CreateSnapshotPoliciesResponseParams `json:"Response"` -} - -func (r *CreateSnapshotPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSnapshotPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSubnetRequestParams struct { - // 待操作的VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网名称,最大长度不能超过60个字节。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 子网网段,子网网段必须在VPC网段内,相同VPC内子网网段不能重叠。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 子网所在的可用区ID,不同子网选择不同可用区可以做跨可用区灾备。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` -} - -type CreateSubnetRequest struct { - *tchttp.BaseRequest - - // 待操作的VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网名称,最大长度不能超过60个字节。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 子网网段,子网网段必须在VPC网段内,相同VPC内子网网段不能重叠。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 子网所在的可用区ID,不同子网选择不同可用区可以做跨可用区灾备。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` -} - -func (r *CreateSubnetRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSubnetRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "SubnetName") - delete(f, "CidrBlock") - delete(f, "Zone") - delete(f, "Tags") - delete(f, "CdcId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSubnetRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSubnetResponseParams struct { - // 子网对象。 - Subnet *Subnet `json:"Subnet,omitempty" name:"Subnet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateSubnetResponse struct { - *tchttp.BaseResponse - Response *CreateSubnetResponseParams `json:"Response"` -} - -func (r *CreateSubnetResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSubnetResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSubnetsRequestParams struct { - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网对象列表。 - Subnets []*SubnetInput `json:"Subnets,omitempty" name:"Subnets"` - - // 指定绑定的标签列表,注意这里的标签集合为列表中所有子网对象所共享,不能为每个子网对象单独指定标签,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 需要增加到的CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` -} - -type CreateSubnetsRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网对象列表。 - Subnets []*SubnetInput `json:"Subnets,omitempty" name:"Subnets"` - - // 指定绑定的标签列表,注意这里的标签集合为列表中所有子网对象所共享,不能为每个子网对象单独指定标签,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 需要增加到的CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` -} - -func (r *CreateSubnetsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSubnetsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "Subnets") - delete(f, "Tags") - delete(f, "CdcId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSubnetsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateSubnetsResponseParams struct { - // 新创建的子网列表。 - SubnetSet []*Subnet `json:"SubnetSet,omitempty" name:"SubnetSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateSubnetsResponse struct { - *tchttp.BaseResponse - Response *CreateSubnetsResponseParams `json:"Response"` -} - -func (r *CreateSubnetsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateSubnetsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateTrafficPackagesRequestParams struct { - // 流量包规格。可选值: - //
  • 10: 10GB流量,有效期一个月
  • - //
  • 50: 50GB流量,有效期一个月
  • - //
  • 512: 512GB流量,有效期一个月
  • - //
  • 1024: 1TB流量,有效期一个月
  • - //
  • 5120: 5TB流量,有效期一个月
  • - //
  • 51200: 50TB流量,有效期一个月
  • - //
  • 60: 60GB流量,有效期半年
  • - //
  • 300: 300GB流量,有效期半年
  • - //
  • 600: 600GB流量,有效期半年
  • - //
  • 3072: 3TB流量,有效期半年
  • - //
  • 6144: 6TB流量,有效期半年
  • - //
  • 30720: 30TB流量,有效期半年
  • - //
  • 61440: 60TB流量,有效期半年
  • - //
  • 307200: 300TB流量,有效期半年
  • - TrafficAmount *uint64 `json:"TrafficAmount,omitempty" name:"TrafficAmount"` - - // 流量包数量,可选范围 1~20。 - TrafficPackageCount *uint64 `json:"TrafficPackageCount,omitempty" name:"TrafficPackageCount"` -} - -type CreateTrafficPackagesRequest struct { - *tchttp.BaseRequest - - // 流量包规格。可选值: - //
  • 10: 10GB流量,有效期一个月
  • - //
  • 50: 50GB流量,有效期一个月
  • - //
  • 512: 512GB流量,有效期一个月
  • - //
  • 1024: 1TB流量,有效期一个月
  • - //
  • 5120: 5TB流量,有效期一个月
  • - //
  • 51200: 50TB流量,有效期一个月
  • - //
  • 60: 60GB流量,有效期半年
  • - //
  • 300: 300GB流量,有效期半年
  • - //
  • 600: 600GB流量,有效期半年
  • - //
  • 3072: 3TB流量,有效期半年
  • - //
  • 6144: 6TB流量,有效期半年
  • - //
  • 30720: 30TB流量,有效期半年
  • - //
  • 61440: 60TB流量,有效期半年
  • - //
  • 307200: 300TB流量,有效期半年
  • - TrafficAmount *uint64 `json:"TrafficAmount,omitempty" name:"TrafficAmount"` - - // 流量包数量,可选范围 1~20。 - TrafficPackageCount *uint64 `json:"TrafficPackageCount,omitempty" name:"TrafficPackageCount"` -} - -func (r *CreateTrafficPackagesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateTrafficPackagesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TrafficAmount") - delete(f, "TrafficPackageCount") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateTrafficPackagesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateTrafficPackagesResponseParams struct { - // 创建的流量包ID列表。 - TrafficPackageSet []*string `json:"TrafficPackageSet,omitempty" name:"TrafficPackageSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateTrafficPackagesResponse struct { - *tchttp.BaseResponse - Response *CreateTrafficPackagesResponseParams `json:"Response"` -} - -func (r *CreateTrafficPackagesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateTrafficPackagesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcEndPointRequestParams struct { - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 终端节点名称。 - EndPointName *string `json:"EndPointName,omitempty" name:"EndPointName"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 终端节点VIP,可以指定IP申请。 - EndPointVip *string `json:"EndPointVip,omitempty" name:"EndPointVip"` - - // 安全组ID。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` -} - -type CreateVpcEndPointRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 终端节点名称。 - EndPointName *string `json:"EndPointName,omitempty" name:"EndPointName"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 终端节点VIP,可以指定IP申请。 - EndPointVip *string `json:"EndPointVip,omitempty" name:"EndPointVip"` - - // 安全组ID。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` -} - -func (r *CreateVpcEndPointRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcEndPointRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "SubnetId") - delete(f, "EndPointName") - delete(f, "EndPointServiceId") - delete(f, "EndPointVip") - delete(f, "SecurityGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpcEndPointRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcEndPointResponseParams struct { - // 终端节点对象详细信息。 - EndPoint *EndPoint `json:"EndPoint,omitempty" name:"EndPoint"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpcEndPointResponse struct { - *tchttp.BaseResponse - Response *CreateVpcEndPointResponseParams `json:"Response"` -} - -func (r *CreateVpcEndPointResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcEndPointResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcEndPointServiceRequestParams struct { - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 终端节点服务名称。 - EndPointServiceName *string `json:"EndPointServiceName,omitempty" name:"EndPointServiceName"` - - // 是否自动接受。 - AutoAcceptFlag *bool `json:"AutoAcceptFlag,omitempty" name:"AutoAcceptFlag"` - - // 后端服务ID,比如lb-xxx。 - ServiceInstanceId *string `json:"ServiceInstanceId,omitempty" name:"ServiceInstanceId"` - - // ~~是否是PassService类型。该字段已废弃,请不要使用该字段。~~ - IsPassService *bool `json:"IsPassService,omitempty" name:"IsPassService"` - - // 挂载的PAAS服务类型,CLB,CDB,CRS,不填默认挂载为CLB。 - ServiceType *string `json:"ServiceType,omitempty" name:"ServiceType"` -} - -type CreateVpcEndPointServiceRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 终端节点服务名称。 - EndPointServiceName *string `json:"EndPointServiceName,omitempty" name:"EndPointServiceName"` - - // 是否自动接受。 - AutoAcceptFlag *bool `json:"AutoAcceptFlag,omitempty" name:"AutoAcceptFlag"` - - // 后端服务ID,比如lb-xxx。 - ServiceInstanceId *string `json:"ServiceInstanceId,omitempty" name:"ServiceInstanceId"` - - // ~~是否是PassService类型。该字段已废弃,请不要使用该字段。~~ - IsPassService *bool `json:"IsPassService,omitempty" name:"IsPassService"` - - // 挂载的PAAS服务类型,CLB,CDB,CRS,不填默认挂载为CLB。 - ServiceType *string `json:"ServiceType,omitempty" name:"ServiceType"` -} - -func (r *CreateVpcEndPointServiceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcEndPointServiceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "EndPointServiceName") - delete(f, "AutoAcceptFlag") - delete(f, "ServiceInstanceId") - delete(f, "IsPassService") - delete(f, "ServiceType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpcEndPointServiceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcEndPointServiceResponseParams struct { - // 终端节点服务对象详细信息。 - EndPointService *EndPointService `json:"EndPointService,omitempty" name:"EndPointService"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpcEndPointServiceResponse struct { - *tchttp.BaseResponse - Response *CreateVpcEndPointServiceResponseParams `json:"Response"` -} - -func (r *CreateVpcEndPointServiceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcEndPointServiceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcEndPointServiceWhiteListRequestParams struct { - // UIN。 - UserUin *string `json:"UserUin,omitempty" name:"UserUin"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 白名单描述。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -type CreateVpcEndPointServiceWhiteListRequest struct { - *tchttp.BaseRequest - - // UIN。 - UserUin *string `json:"UserUin,omitempty" name:"UserUin"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 白名单描述。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -func (r *CreateVpcEndPointServiceWhiteListRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcEndPointServiceWhiteListRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "UserUin") - delete(f, "EndPointServiceId") - delete(f, "Description") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpcEndPointServiceWhiteListRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcEndPointServiceWhiteListResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpcEndPointServiceWhiteListResponse struct { - *tchttp.BaseResponse - Response *CreateVpcEndPointServiceWhiteListResponseParams `json:"Response"` -} - -func (r *CreateVpcEndPointServiceWhiteListResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcEndPointServiceWhiteListResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcPeeringConnectionRequestParams struct { -} - -type CreateVpcPeeringConnectionRequest struct { - *tchttp.BaseRequest -} - -func (r *CreateVpcPeeringConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcPeeringConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpcPeeringConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcPeeringConnectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpcPeeringConnectionResponse struct { - *tchttp.BaseResponse - Response *CreateVpcPeeringConnectionResponseParams `json:"Response"` -} - -func (r *CreateVpcPeeringConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcPeeringConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcRequestParams struct { - // vpc名称,最大长度不能超过60个字节。 - VpcName *string `json:"VpcName,omitempty" name:"VpcName"` - - // vpc的cidr,仅能在10.0.0.0/12,172.16.0.0/12,192.168.0.0/16这三个内网网段内。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 是否开启组播。true: 开启, false: 不开启。 - EnableMulticast *string `json:"EnableMulticast,omitempty" name:"EnableMulticast"` - - // DNS地址,最多支持4个。 - DnsServers []*string `json:"DnsServers,omitempty" name:"DnsServers"` - - // DHCP使用的域名。 - DomainName *string `json:"DomainName,omitempty" name:"DomainName"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -type CreateVpcRequest struct { - *tchttp.BaseRequest - - // vpc名称,最大长度不能超过60个字节。 - VpcName *string `json:"VpcName,omitempty" name:"VpcName"` - - // vpc的cidr,仅能在10.0.0.0/12,172.16.0.0/12,192.168.0.0/16这三个内网网段内。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 是否开启组播。true: 开启, false: 不开启。 - EnableMulticast *string `json:"EnableMulticast,omitempty" name:"EnableMulticast"` - - // DNS地址,最多支持4个。 - DnsServers []*string `json:"DnsServers,omitempty" name:"DnsServers"` - - // DHCP使用的域名。 - DomainName *string `json:"DomainName,omitempty" name:"DomainName"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` -} - -func (r *CreateVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcName") - delete(f, "CidrBlock") - delete(f, "EnableMulticast") - delete(f, "DnsServers") - delete(f, "DomainName") - delete(f, "Tags") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpcResponseParams struct { - // Vpc对象。 - Vpc *Vpc `json:"Vpc,omitempty" name:"Vpc"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpcResponse struct { - *tchttp.BaseResponse - Response *CreateVpcResponseParams `json:"Response"` -} - -func (r *CreateVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnConnectionRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 对端网关ID。例如:cgw-2wqq41m9,可通过[DescribeCustomerGateways](https://cloud.tencent.com/document/product/215/17516)接口查询对端网关。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` - - // 通道名称,可任意命名,但不得超过60个字符。 - VpnConnectionName *string `json:"VpnConnectionName,omitempty" name:"VpnConnectionName"` - - // 预共享密钥。 - PreShareKey *string `json:"PreShareKey,omitempty" name:"PreShareKey"` - - // VPC实例ID。可通过[DescribeVpcs](https://cloud.tencent.com/document/product/215/15778)接口返回值中的VpcId获取。 - // CCN VPN 形的通道 可以不传VPCID - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // SPD策略组,例如:{"10.0.0.5/24":["172.123.10.5/16"]},10.0.0.5/24是vpc内网段172.123.10.5/16是IDC网段。用户指定VPC内哪些网段可以和您IDC中哪些网段通信。 - SecurityPolicyDatabases []*SecurityPolicyDatabase `json:"SecurityPolicyDatabases,omitempty" name:"SecurityPolicyDatabases"` - - // IKE配置(Internet Key Exchange,因特网密钥交换),IKE具有一套自我保护机制,用户配置网络安全协议 - IKEOptionsSpecification *IKEOptionsSpecification `json:"IKEOptionsSpecification,omitempty" name:"IKEOptionsSpecification"` - - // IPSec配置,腾讯云提供IPSec安全会话设置 - IPSECOptionsSpecification *IPSECOptionsSpecification `json:"IPSECOptionsSpecification,omitempty" name:"IPSECOptionsSpecification"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 是否支持隧道内健康检查,默认为False。 - EnableHealthCheck *bool `json:"EnableHealthCheck,omitempty" name:"EnableHealthCheck"` - - // 健康检查本端地址,默认值为随机在169.254.128.0/17分配一个IP。 - HealthCheckLocalIp *string `json:"HealthCheckLocalIp,omitempty" name:"HealthCheckLocalIp"` - - // 健康检查对端地址,默认值为随机在169.254.128.0/17分配一个IP。 - HealthCheckRemoteIp *string `json:"HealthCheckRemoteIp,omitempty" name:"HealthCheckRemoteIp"` - - // 通道类型, 例如:["STATIC", "StaticRoute", "Policy"] - RouteType *string `json:"RouteType,omitempty" name:"RouteType"` - - // 协商类型,默认为active(主动协商)。可选值:active(主动协商),passive(被动协商),flowTrigger(流量协商) - NegotiationType *string `json:"NegotiationType,omitempty" name:"NegotiationType"` - - // DPD探测开关。默认为0,表示关闭DPD探测。可选值:0(关闭),1(开启) - DpdEnable *int64 `json:"DpdEnable,omitempty" name:"DpdEnable"` - - // DPD超时时间。即探测确认对端不存在需要的时间。dpdEnable为1(开启)时有效。默认30,单位为秒 - DpdTimeout *string `json:"DpdTimeout,omitempty" name:"DpdTimeout"` - - // DPD超时后的动作。默认为clear。dpdEnable为1(开启)时有效。可取值为clear(断开)和restart(重试) - DpdAction *string `json:"DpdAction,omitempty" name:"DpdAction"` -} - -type CreateVpnConnectionRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 对端网关ID。例如:cgw-2wqq41m9,可通过[DescribeCustomerGateways](https://cloud.tencent.com/document/product/215/17516)接口查询对端网关。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` - - // 通道名称,可任意命名,但不得超过60个字符。 - VpnConnectionName *string `json:"VpnConnectionName,omitempty" name:"VpnConnectionName"` - - // 预共享密钥。 - PreShareKey *string `json:"PreShareKey,omitempty" name:"PreShareKey"` - - // VPC实例ID。可通过[DescribeVpcs](https://cloud.tencent.com/document/product/215/15778)接口返回值中的VpcId获取。 - // CCN VPN 形的通道 可以不传VPCID - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // SPD策略组,例如:{"10.0.0.5/24":["172.123.10.5/16"]},10.0.0.5/24是vpc内网段172.123.10.5/16是IDC网段。用户指定VPC内哪些网段可以和您IDC中哪些网段通信。 - SecurityPolicyDatabases []*SecurityPolicyDatabase `json:"SecurityPolicyDatabases,omitempty" name:"SecurityPolicyDatabases"` - - // IKE配置(Internet Key Exchange,因特网密钥交换),IKE具有一套自我保护机制,用户配置网络安全协议 - IKEOptionsSpecification *IKEOptionsSpecification `json:"IKEOptionsSpecification,omitempty" name:"IKEOptionsSpecification"` - - // IPSec配置,腾讯云提供IPSec安全会话设置 - IPSECOptionsSpecification *IPSECOptionsSpecification `json:"IPSECOptionsSpecification,omitempty" name:"IPSECOptionsSpecification"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // 是否支持隧道内健康检查,默认为False。 - EnableHealthCheck *bool `json:"EnableHealthCheck,omitempty" name:"EnableHealthCheck"` - - // 健康检查本端地址,默认值为随机在169.254.128.0/17分配一个IP。 - HealthCheckLocalIp *string `json:"HealthCheckLocalIp,omitempty" name:"HealthCheckLocalIp"` - - // 健康检查对端地址,默认值为随机在169.254.128.0/17分配一个IP。 - HealthCheckRemoteIp *string `json:"HealthCheckRemoteIp,omitempty" name:"HealthCheckRemoteIp"` - - // 通道类型, 例如:["STATIC", "StaticRoute", "Policy"] - RouteType *string `json:"RouteType,omitempty" name:"RouteType"` - - // 协商类型,默认为active(主动协商)。可选值:active(主动协商),passive(被动协商),flowTrigger(流量协商) - NegotiationType *string `json:"NegotiationType,omitempty" name:"NegotiationType"` - - // DPD探测开关。默认为0,表示关闭DPD探测。可选值:0(关闭),1(开启) - DpdEnable *int64 `json:"DpdEnable,omitempty" name:"DpdEnable"` - - // DPD超时时间。即探测确认对端不存在需要的时间。dpdEnable为1(开启)时有效。默认30,单位为秒 - DpdTimeout *string `json:"DpdTimeout,omitempty" name:"DpdTimeout"` - - // DPD超时后的动作。默认为clear。dpdEnable为1(开启)时有效。可取值为clear(断开)和restart(重试) - DpdAction *string `json:"DpdAction,omitempty" name:"DpdAction"` -} - -func (r *CreateVpnConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "CustomerGatewayId") - delete(f, "VpnConnectionName") - delete(f, "PreShareKey") - delete(f, "VpcId") - delete(f, "SecurityPolicyDatabases") - delete(f, "IKEOptionsSpecification") - delete(f, "IPSECOptionsSpecification") - delete(f, "Tags") - delete(f, "EnableHealthCheck") - delete(f, "HealthCheckLocalIp") - delete(f, "HealthCheckRemoteIp") - delete(f, "RouteType") - delete(f, "NegotiationType") - delete(f, "DpdEnable") - delete(f, "DpdTimeout") - delete(f, "DpdAction") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpnConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnConnectionResponseParams struct { - // 通道实例对象。 - VpnConnection *VpnConnection `json:"VpnConnection,omitempty" name:"VpnConnection"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpnConnectionResponse struct { - *tchttp.BaseResponse - Response *CreateVpnConnectionResponseParams `json:"Response"` -} - -func (r *CreateVpnConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnGatewayRequestParams struct { - // VPC实例ID。可通过[DescribeVpcs](https://cloud.tencent.com/document/product/215/15778)接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // VPN网关名称,最大长度不能超过60个字节。 - VpnGatewayName *string `json:"VpnGatewayName,omitempty" name:"VpnGatewayName"` - - // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100, 200, 500, 1000, 3000;单位:Mbps。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // VPN网关计费模式,PREPAID:表示预付费,即包年包月,POSTPAID_BY_HOUR:表示后付费,即按量计费。默认:POSTPAID_BY_HOUR,如果指定预付费模式,参数InstanceChargePrepaid必填。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 可用区,如:ap-guangzhou-2。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // VPN网关类型,默认为IPSEC。值“IPSEC”为VPC型IPSEC VPN网关,值“SSL”为VPC型SSL VPN网关,值“CCN”为云联网型IPSEC VPN网关,值“SSL_CCN”为云联网型SSL VPN网关。 - Type *string `json:"Type,omitempty" name:"Type"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // SSL VPN连接数设置,可选规格:5, 10, 20, 50, 100, 200, 500, 1000;单位:个。仅 SSL / SSL_CCN 类型需要选这个参数。 - MaxConnection *uint64 `json:"MaxConnection,omitempty" name:"MaxConnection"` -} - -type CreateVpnGatewayRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。可通过[DescribeVpcs](https://cloud.tencent.com/document/product/215/15778)接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // VPN网关名称,最大长度不能超过60个字节。 - VpnGatewayName *string `json:"VpnGatewayName,omitempty" name:"VpnGatewayName"` - - // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100, 200, 500, 1000, 3000;单位:Mbps。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // VPN网关计费模式,PREPAID:表示预付费,即包年包月,POSTPAID_BY_HOUR:表示后付费,即按量计费。默认:POSTPAID_BY_HOUR,如果指定预付费模式,参数InstanceChargePrepaid必填。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // 可用区,如:ap-guangzhou-2。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // VPN网关类型,默认为IPSEC。值“IPSEC”为VPC型IPSEC VPN网关,值“SSL”为VPC型SSL VPN网关,值“CCN”为云联网型IPSEC VPN网关,值“SSL_CCN”为云联网型SSL VPN网关。 - Type *string `json:"Type,omitempty" name:"Type"` - - // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - Tags []*Tag `json:"Tags,omitempty" name:"Tags"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // SSL VPN连接数设置,可选规格:5, 10, 20, 50, 100, 200, 500, 1000;单位:个。仅 SSL / SSL_CCN 类型需要选这个参数。 - MaxConnection *uint64 `json:"MaxConnection,omitempty" name:"MaxConnection"` -} - -func (r *CreateVpnGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "VpnGatewayName") - delete(f, "InternetMaxBandwidthOut") - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "Zone") - delete(f, "Type") - delete(f, "Tags") - delete(f, "CdcId") - delete(f, "MaxConnection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpnGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnGatewayResponseParams struct { - // VPN网关对象 - VpnGateway *VpnGateway `json:"VpnGateway,omitempty" name:"VpnGateway"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpnGatewayResponse struct { - *tchttp.BaseResponse - Response *CreateVpnGatewayResponseParams `json:"Response"` -} - -func (r *CreateVpnGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnGatewayRoutesRequestParams struct { - // VPN网关的ID - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN网关目的路由列表 - Routes []*VpnGatewayRoute `json:"Routes,omitempty" name:"Routes"` -} - -type CreateVpnGatewayRoutesRequest struct { - *tchttp.BaseRequest - - // VPN网关的ID - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN网关目的路由列表 - Routes []*VpnGatewayRoute `json:"Routes,omitempty" name:"Routes"` -} - -func (r *CreateVpnGatewayRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnGatewayRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpnGatewayRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnGatewayRoutesResponseParams struct { - // VPN网关目的路由 - Routes []*VpnGatewayRoute `json:"Routes,omitempty" name:"Routes"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpnGatewayRoutesResponse struct { - *tchttp.BaseResponse - Response *CreateVpnGatewayRoutesResponseParams `json:"Response"` -} - -func (r *CreateVpnGatewayRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnGatewayRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnGatewaySslClientRequestParams struct { - // SSL-VPN-SERVER 实例ID。 - SslVpnServerId *string `json:"SslVpnServerId,omitempty" name:"SslVpnServerId"` - - // SSL-VPN-CLIENT实例Name。不可和SslVpnClientNames同时使用。 - SslVpnClientName *string `json:"SslVpnClientName,omitempty" name:"SslVpnClientName"` - - // SSL-VPN-CLIENT实例Name数字。批量创建时使用。不可和SslVpnClientName同时使用。 - SslVpnClientNames []*string `json:"SslVpnClientNames,omitempty" name:"SslVpnClientNames"` -} - -type CreateVpnGatewaySslClientRequest struct { - *tchttp.BaseRequest - - // SSL-VPN-SERVER 实例ID。 - SslVpnServerId *string `json:"SslVpnServerId,omitempty" name:"SslVpnServerId"` - - // SSL-VPN-CLIENT实例Name。不可和SslVpnClientNames同时使用。 - SslVpnClientName *string `json:"SslVpnClientName,omitempty" name:"SslVpnClientName"` - - // SSL-VPN-CLIENT实例Name数字。批量创建时使用。不可和SslVpnClientName同时使用。 - SslVpnClientNames []*string `json:"SslVpnClientNames,omitempty" name:"SslVpnClientNames"` -} - -func (r *CreateVpnGatewaySslClientRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnGatewaySslClientRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SslVpnServerId") - delete(f, "SslVpnClientName") - delete(f, "SslVpnClientNames") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpnGatewaySslClientRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnGatewaySslClientResponseParams struct { - // 异步任务ID。 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // SSL-VPN client 唯一ID - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpnGatewaySslClientResponse struct { - *tchttp.BaseResponse - Response *CreateVpnGatewaySslClientResponseParams `json:"Response"` -} - -func (r *CreateVpnGatewaySslClientResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnGatewaySslClientResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnGatewaySslServerRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // SSL-VPN-SERVER 实例名称,长度不超过60个字节。 - SslVpnServerName *string `json:"SslVpnServerName,omitempty" name:"SslVpnServerName"` - - // 云端地址(CIDR)列表。 - LocalAddress []*string `json:"LocalAddress,omitempty" name:"LocalAddress"` - - // 客户端地址网段。 - RemoteAddress *string `json:"RemoteAddress,omitempty" name:"RemoteAddress"` - - // SSL VPN服务端监听协议。当前仅支持 UDP,默认UDP。 - SslVpnProtocol *string `json:"SslVpnProtocol,omitempty" name:"SslVpnProtocol"` - - // SSL VPN服务端监听协议端口,默认1194。 - SslVpnPort *int64 `json:"SslVpnPort,omitempty" name:"SslVpnPort"` - - // 认证算法。可选 'SHA1', 'MD5', 'NONE',默认NONE。 - IntegrityAlgorithm *string `json:"IntegrityAlgorithm,omitempty" name:"IntegrityAlgorithm"` - - // 加密算法。可选 'AES-128-CBC','AES-192-CBC', 'AES-256-CBC', 'NONE',默认NONE。 - EncryptAlgorithm *string `json:"EncryptAlgorithm,omitempty" name:"EncryptAlgorithm"` - - // 是否支持压缩。当前仅支持不支持压缩,默认False。 - Compress *bool `json:"Compress,omitempty" name:"Compress"` - - // 是否开启SSO认证。默认为False - SsoEnabled *bool `json:"SsoEnabled,omitempty" name:"SsoEnabled"` - - // 是否开启策略访问控制。默认为False - AccessPolicyEnabled *bool `json:"AccessPolicyEnabled,omitempty" name:"AccessPolicyEnabled"` - - // SAML-DATA,开启SSO时传。 - SamlData *string `json:"SamlData,omitempty" name:"SamlData"` -} - -type CreateVpnGatewaySslServerRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // SSL-VPN-SERVER 实例名称,长度不超过60个字节。 - SslVpnServerName *string `json:"SslVpnServerName,omitempty" name:"SslVpnServerName"` - - // 云端地址(CIDR)列表。 - LocalAddress []*string `json:"LocalAddress,omitempty" name:"LocalAddress"` - - // 客户端地址网段。 - RemoteAddress *string `json:"RemoteAddress,omitempty" name:"RemoteAddress"` - - // SSL VPN服务端监听协议。当前仅支持 UDP,默认UDP。 - SslVpnProtocol *string `json:"SslVpnProtocol,omitempty" name:"SslVpnProtocol"` - - // SSL VPN服务端监听协议端口,默认1194。 - SslVpnPort *int64 `json:"SslVpnPort,omitempty" name:"SslVpnPort"` - - // 认证算法。可选 'SHA1', 'MD5', 'NONE',默认NONE。 - IntegrityAlgorithm *string `json:"IntegrityAlgorithm,omitempty" name:"IntegrityAlgorithm"` - - // 加密算法。可选 'AES-128-CBC','AES-192-CBC', 'AES-256-CBC', 'NONE',默认NONE。 - EncryptAlgorithm *string `json:"EncryptAlgorithm,omitempty" name:"EncryptAlgorithm"` - - // 是否支持压缩。当前仅支持不支持压缩,默认False。 - Compress *bool `json:"Compress,omitempty" name:"Compress"` - - // 是否开启SSO认证。默认为False - SsoEnabled *bool `json:"SsoEnabled,omitempty" name:"SsoEnabled"` - - // 是否开启策略访问控制。默认为False - AccessPolicyEnabled *bool `json:"AccessPolicyEnabled,omitempty" name:"AccessPolicyEnabled"` - - // SAML-DATA,开启SSO时传。 - SamlData *string `json:"SamlData,omitempty" name:"SamlData"` -} - -func (r *CreateVpnGatewaySslServerRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnGatewaySslServerRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "SslVpnServerName") - delete(f, "LocalAddress") - delete(f, "RemoteAddress") - delete(f, "SslVpnProtocol") - delete(f, "SslVpnPort") - delete(f, "IntegrityAlgorithm") - delete(f, "EncryptAlgorithm") - delete(f, "Compress") - delete(f, "SsoEnabled") - delete(f, "AccessPolicyEnabled") - delete(f, "SamlData") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpnGatewaySslServerRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type CreateVpnGatewaySslServerResponseParams struct { - // 创建SSL-VPN server 异步任务ID。 - TaskId *int64 `json:"TaskId,omitempty" name:"TaskId"` - - // SSL-VPN-SERVER 唯一ID。 - SslVpnServerId *string `json:"SslVpnServerId,omitempty" name:"SslVpnServerId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type CreateVpnGatewaySslServerResponse struct { - *tchttp.BaseResponse - Response *CreateVpnGatewaySslServerResponseParams `json:"Response"` -} - -func (r *CreateVpnGatewaySslServerResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *CreateVpnGatewaySslServerResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type CrossBorderCompliance struct { - // 服务商,可选值:`UNICOM`。 - ServiceProvider *string `json:"ServiceProvider,omitempty" name:"ServiceProvider"` - - // 合规化审批单`ID`。 - ComplianceId *uint64 `json:"ComplianceId,omitempty" name:"ComplianceId"` - - // 公司全称。 - Company *string `json:"Company,omitempty" name:"Company"` - - // 统一社会信用代码。 - UniformSocialCreditCode *string `json:"UniformSocialCreditCode,omitempty" name:"UniformSocialCreditCode"` - - // 法定代表人。 - LegalPerson *string `json:"LegalPerson,omitempty" name:"LegalPerson"` - - // 发证机关。 - IssuingAuthority *string `json:"IssuingAuthority,omitempty" name:"IssuingAuthority"` - - // 营业执照。 - BusinessLicense *string `json:"BusinessLicense,omitempty" name:"BusinessLicense"` - - // 营业执照住所。 - BusinessAddress *string `json:"BusinessAddress,omitempty" name:"BusinessAddress"` - - // 邮编。 - PostCode *uint64 `json:"PostCode,omitempty" name:"PostCode"` - - // 经办人。 - Manager *string `json:"Manager,omitempty" name:"Manager"` - - // 经办人身份证号。 - ManagerId *string `json:"ManagerId,omitempty" name:"ManagerId"` - - // 经办人身份证。 - ManagerIdCard *string `json:"ManagerIdCard,omitempty" name:"ManagerIdCard"` - - // 经办人身份证地址。 - ManagerAddress *string `json:"ManagerAddress,omitempty" name:"ManagerAddress"` - - // 经办人联系电话。 - ManagerTelephone *string `json:"ManagerTelephone,omitempty" name:"ManagerTelephone"` - - // 电子邮箱。 - Email *string `json:"Email,omitempty" name:"Email"` - - // 服务受理单。 - ServiceHandlingForm *string `json:"ServiceHandlingForm,omitempty" name:"ServiceHandlingForm"` - - // 授权函。 - AuthorizationLetter *string `json:"AuthorizationLetter,omitempty" name:"AuthorizationLetter"` - - // 信息安全承诺书。 - SafetyCommitment *string `json:"SafetyCommitment,omitempty" name:"SafetyCommitment"` - - // 服务开始时间。 - ServiceStartDate *string `json:"ServiceStartDate,omitempty" name:"ServiceStartDate"` - - // 服务截止时间。 - ServiceEndDate *string `json:"ServiceEndDate,omitempty" name:"ServiceEndDate"` - - // 状态。待审批:`PENDING`,已通过:`APPROVED`,已拒绝:`DENY`。 - State *string `json:"State,omitempty" name:"State"` - - // 审批单创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type CrossBorderFlowMonitorData struct { - // 入带宽,单位:`bps`。 - InBandwidth []*int64 `json:"InBandwidth,omitempty" name:"InBandwidth"` - - // 出带宽,单位:`bps`。 - OutBandwidth []*int64 `json:"OutBandwidth,omitempty" name:"OutBandwidth"` - - // 入包,单位:`pps`。 - InPkg []*int64 `json:"InPkg,omitempty" name:"InPkg"` - - // 出包,单位:`pps`。 - OutPkg []*int64 `json:"OutPkg,omitempty" name:"OutPkg"` -} - -type CustomerGateway struct { - // 用户网关唯一ID - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` - - // 网关名称 - CustomerGatewayName *string `json:"CustomerGatewayName,omitempty" name:"CustomerGatewayName"` - - // 公网地址 - IpAddress *string `json:"IpAddress,omitempty" name:"IpAddress"` - - // 创建时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type CustomerGatewayVendor struct { - // 平台。 - Platform *string `json:"Platform,omitempty" name:"Platform"` - - // 软件版本。 - SoftwareVersion *string `json:"SoftwareVersion,omitempty" name:"SoftwareVersion"` - - // 供应商名称。 - VendorName *string `json:"VendorName,omitempty" name:"VendorName"` -} - -type CvmInstance struct { - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 云主机实例ID - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 云主机名称。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` - - // 云主机状态。 - InstanceState *string `json:"InstanceState,omitempty" name:"InstanceState"` - - // 实例的CPU核数,单位:核。 - CPU *uint64 `json:"CPU,omitempty" name:"CPU"` - - // 实例内存容量,单位:GB。 - Memory *uint64 `json:"Memory,omitempty" name:"Memory"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 实例机型。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例弹性网卡配额(包含主网卡)。 - EniLimit *uint64 `json:"EniLimit,omitempty" name:"EniLimit"` - - // 实例弹性网卡内网IP配额(包含主网卡)。 - EniIpLimit *uint64 `json:"EniIpLimit,omitempty" name:"EniIpLimit"` - - // 实例已绑定弹性网卡的个数(包含主网卡)。 - InstanceEniCount *uint64 `json:"InstanceEniCount,omitempty" name:"InstanceEniCount"` -} - -type DefaultVpcSubnet struct { - // 默认VpcId。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 默认SubnetId。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 默认Vpc名字。 - VpcName *string `json:"VpcName,omitempty" name:"VpcName"` - - // 默认Subnet名字。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 默认子网网段。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` -} - -// Predefined struct for user -type DeleteAddressTemplateGroupRequestParams struct { - // IP地址模板集合实例ID,例如:ipmg-90cex8mq。 - AddressTemplateGroupId *string `json:"AddressTemplateGroupId,omitempty" name:"AddressTemplateGroupId"` -} - -type DeleteAddressTemplateGroupRequest struct { - *tchttp.BaseRequest - - // IP地址模板集合实例ID,例如:ipmg-90cex8mq。 - AddressTemplateGroupId *string `json:"AddressTemplateGroupId,omitempty" name:"AddressTemplateGroupId"` -} - -func (r *DeleteAddressTemplateGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteAddressTemplateGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressTemplateGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteAddressTemplateGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteAddressTemplateGroupResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteAddressTemplateGroupResponse struct { - *tchttp.BaseResponse - Response *DeleteAddressTemplateGroupResponseParams `json:"Response"` -} - -func (r *DeleteAddressTemplateGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteAddressTemplateGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteAddressTemplateRequestParams struct { - // IP地址模板实例ID,例如:ipm-09o5m8kc。 - AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` -} - -type DeleteAddressTemplateRequest struct { - *tchttp.BaseRequest - - // IP地址模板实例ID,例如:ipm-09o5m8kc。 - AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` -} - -func (r *DeleteAddressTemplateRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteAddressTemplateRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressTemplateId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteAddressTemplateRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteAddressTemplateResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteAddressTemplateResponse struct { - *tchttp.BaseResponse - Response *DeleteAddressTemplateResponseParams `json:"Response"` -} - -func (r *DeleteAddressTemplateResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteAddressTemplateResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteAssistantCidrRequestParams struct { - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"]。 - CidrBlocks []*string `json:"CidrBlocks,omitempty" name:"CidrBlocks"` -} - -type DeleteAssistantCidrRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"]。 - CidrBlocks []*string `json:"CidrBlocks,omitempty" name:"CidrBlocks"` -} - -func (r *DeleteAssistantCidrRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteAssistantCidrRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "CidrBlocks") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteAssistantCidrRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteAssistantCidrResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteAssistantCidrResponse struct { - *tchttp.BaseResponse - Response *DeleteAssistantCidrResponseParams `json:"Response"` -} - -func (r *DeleteAssistantCidrResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteAssistantCidrResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteBandwidthPackageRequestParams struct { - // 待删除带宽包唯一ID - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -type DeleteBandwidthPackageRequest struct { - *tchttp.BaseRequest - - // 待删除带宽包唯一ID - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -func (r *DeleteBandwidthPackageRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteBandwidthPackageRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "BandwidthPackageId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteBandwidthPackageRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteBandwidthPackageResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteBandwidthPackageResponse struct { - *tchttp.BaseResponse - Response *DeleteBandwidthPackageResponseParams `json:"Response"` -} - -func (r *DeleteBandwidthPackageResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteBandwidthPackageResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteCcnRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` -} - -type DeleteCcnRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` -} - -func (r *DeleteCcnRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteCcnRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteCcnRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteCcnResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteCcnResponse struct { - *tchttp.BaseResponse - Response *DeleteCcnResponseParams `json:"Response"` -} - -func (r *DeleteCcnResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteCcnResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteCustomerGatewayRequestParams struct { - // 对端网关ID,例如:cgw-2wqq41m9,可通过[DescribeCustomerGateways](https://cloud.tencent.com/document/api/215/17516)接口查询对端网关。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` -} - -type DeleteCustomerGatewayRequest struct { - *tchttp.BaseRequest - - // 对端网关ID,例如:cgw-2wqq41m9,可通过[DescribeCustomerGateways](https://cloud.tencent.com/document/api/215/17516)接口查询对端网关。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` -} - -func (r *DeleteCustomerGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteCustomerGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CustomerGatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteCustomerGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteCustomerGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteCustomerGatewayResponse struct { - *tchttp.BaseResponse - Response *DeleteCustomerGatewayResponseParams `json:"Response"` -} - -func (r *DeleteCustomerGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteCustomerGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteDhcpIpRequestParams struct { - // `DhcpIp`的`ID`,是`DhcpIp`的唯一标识。 - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` -} - -type DeleteDhcpIpRequest struct { - *tchttp.BaseRequest - - // `DhcpIp`的`ID`,是`DhcpIp`的唯一标识。 - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` -} - -func (r *DeleteDhcpIpRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteDhcpIpRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DhcpIpId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDhcpIpRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteDhcpIpResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteDhcpIpResponse struct { - *tchttp.BaseResponse - Response *DeleteDhcpIpResponseParams `json:"Response"` -} - -func (r *DeleteDhcpIpResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteDhcpIpResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteDirectConnectGatewayCcnRoutesRequestParams struct { - // 专线网关ID,形如:dcg-prpqlmg1 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 路由ID。形如:ccnr-f49l6u0z。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` -} - -type DeleteDirectConnectGatewayCcnRoutesRequest struct { - *tchttp.BaseRequest - - // 专线网关ID,形如:dcg-prpqlmg1 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 路由ID。形如:ccnr-f49l6u0z。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` -} - -func (r *DeleteDirectConnectGatewayCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteDirectConnectGatewayCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DirectConnectGatewayId") - delete(f, "RouteIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDirectConnectGatewayCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteDirectConnectGatewayCcnRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteDirectConnectGatewayCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *DeleteDirectConnectGatewayCcnRoutesResponseParams `json:"Response"` -} - -func (r *DeleteDirectConnectGatewayCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteDirectConnectGatewayCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteDirectConnectGatewayRequestParams struct { - // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` -} - -type DeleteDirectConnectGatewayRequest struct { - *tchttp.BaseRequest - - // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` -} - -func (r *DeleteDirectConnectGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteDirectConnectGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DirectConnectGatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDirectConnectGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteDirectConnectGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteDirectConnectGatewayResponse struct { - *tchttp.BaseResponse - Response *DeleteDirectConnectGatewayResponseParams `json:"Response"` -} - -func (r *DeleteDirectConnectGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteDirectConnectGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteFlowLogRequestParams struct { - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` - - // 私用网络ID或者统一ID,建议使用统一ID,删除云联网流日志时,可不填,其他流日志类型必填。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -type DeleteFlowLogRequest struct { - *tchttp.BaseRequest - - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` - - // 私用网络ID或者统一ID,建议使用统一ID,删除云联网流日志时,可不填,其他流日志类型必填。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -func (r *DeleteFlowLogRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteFlowLogRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "FlowLogId") - delete(f, "VpcId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteFlowLogRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteFlowLogResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteFlowLogResponse struct { - *tchttp.BaseResponse - Response *DeleteFlowLogResponseParams `json:"Response"` -} - -func (r *DeleteFlowLogResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteFlowLogResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteHaVipRequestParams struct { - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` -} - -type DeleteHaVipRequest struct { - *tchttp.BaseRequest - - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` -} - -func (r *DeleteHaVipRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteHaVipRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HaVipId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteHaVipRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteHaVipResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteHaVipResponse struct { - *tchttp.BaseResponse - Response *DeleteHaVipResponseParams `json:"Response"` -} - -func (r *DeleteHaVipResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteHaVipResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteIp6TranslatorsRequestParams struct { - // 待释放的IPV6转换实例的唯一ID,形如‘ip6-xxxxxxxx’ - Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds"` -} - -type DeleteIp6TranslatorsRequest struct { - *tchttp.BaseRequest - - // 待释放的IPV6转换实例的唯一ID,形如‘ip6-xxxxxxxx’ - Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds"` -} - -func (r *DeleteIp6TranslatorsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteIp6TranslatorsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6TranslatorIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteIp6TranslatorsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteIp6TranslatorsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteIp6TranslatorsResponse struct { - *tchttp.BaseResponse - Response *DeleteIp6TranslatorsResponseParams `json:"Response"` -} - -func (r *DeleteIp6TranslatorsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteIp6TranslatorsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLocalGatewayRequestParams struct { - // 本地网关实例ID。 - LocalGatewayId *string `json:"LocalGatewayId,omitempty" name:"LocalGatewayId"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -type DeleteLocalGatewayRequest struct { - *tchttp.BaseRequest - - // 本地网关实例ID。 - LocalGatewayId *string `json:"LocalGatewayId,omitempty" name:"LocalGatewayId"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -func (r *DeleteLocalGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLocalGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LocalGatewayId") - delete(f, "CdcId") - delete(f, "VpcId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteLocalGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteLocalGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteLocalGatewayResponse struct { - *tchttp.BaseResponse - Response *DeleteLocalGatewayResponseParams `json:"Response"` -} - -func (r *DeleteLocalGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteLocalGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNatGatewayDestinationIpPortTranslationNatRuleRequestParams struct { - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的端口转换规则。 - DestinationIpPortTranslationNatRules []*DestinationIpPortTranslationNatRule `json:"DestinationIpPortTranslationNatRules,omitempty" name:"DestinationIpPortTranslationNatRules"` -} - -type DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的端口转换规则。 - DestinationIpPortTranslationNatRules []*DestinationIpPortTranslationNatRule `json:"DestinationIpPortTranslationNatRules,omitempty" name:"DestinationIpPortTranslationNatRules"` -} - -func (r *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "DestinationIpPortTranslationNatRules") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNatGatewayDestinationIpPortTranslationNatRuleResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse struct { - *tchttp.BaseResponse - Response *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponseParams `json:"Response"` -} - -func (r *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNatGatewayRequestParams struct { - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` -} - -type DeleteNatGatewayRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` -} - -func (r *DeleteNatGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNatGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNatGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNatGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteNatGatewayResponse struct { - *tchttp.BaseResponse - Response *DeleteNatGatewayResponseParams `json:"Response"` -} - -func (r *DeleteNatGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNatGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNatGatewaySourceIpTranslationNatRuleRequestParams struct { - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的SNAT ID列表,形如:`snat-df43254`。 - NatGatewaySnatIds []*string `json:"NatGatewaySnatIds,omitempty" name:"NatGatewaySnatIds"` -} - -type DeleteNatGatewaySourceIpTranslationNatRuleRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的SNAT ID列表,形如:`snat-df43254`。 - NatGatewaySnatIds []*string `json:"NatGatewaySnatIds,omitempty" name:"NatGatewaySnatIds"` -} - -func (r *DeleteNatGatewaySourceIpTranslationNatRuleRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNatGatewaySourceIpTranslationNatRuleRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "NatGatewaySnatIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNatGatewaySourceIpTranslationNatRuleRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNatGatewaySourceIpTranslationNatRuleResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteNatGatewaySourceIpTranslationNatRuleResponse struct { - *tchttp.BaseResponse - Response *DeleteNatGatewaySourceIpTranslationNatRuleResponseParams `json:"Response"` -} - -func (r *DeleteNatGatewaySourceIpTranslationNatRuleResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNatGatewaySourceIpTranslationNatRuleResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNetDetectRequestParams struct { - // 网络探测实例`ID`。形如:`netd-12345678`。 - NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` -} - -type DeleteNetDetectRequest struct { - *tchttp.BaseRequest - - // 网络探测实例`ID`。形如:`netd-12345678`。 - NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` -} - -func (r *DeleteNetDetectRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNetDetectRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetDetectId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNetDetectRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNetDetectResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteNetDetectResponse struct { - *tchttp.BaseResponse - Response *DeleteNetDetectResponseParams `json:"Response"` -} - -func (r *DeleteNetDetectResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNetDetectResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNetworkAclQuintupleEntriesRequestParams struct { - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络五元组ACL规则集。 - NetworkAclQuintupleSet *NetworkAclQuintupleEntries `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` -} - -type DeleteNetworkAclQuintupleEntriesRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络五元组ACL规则集。 - NetworkAclQuintupleSet *NetworkAclQuintupleEntries `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` -} - -func (r *DeleteNetworkAclQuintupleEntriesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNetworkAclQuintupleEntriesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - delete(f, "NetworkAclQuintupleSet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNetworkAclQuintupleEntriesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNetworkAclQuintupleEntriesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteNetworkAclQuintupleEntriesResponse struct { - *tchttp.BaseResponse - Response *DeleteNetworkAclQuintupleEntriesResponseParams `json:"Response"` -} - -func (r *DeleteNetworkAclQuintupleEntriesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNetworkAclQuintupleEntriesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNetworkAclRequestParams struct { - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` -} - -type DeleteNetworkAclRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` -} - -func (r *DeleteNetworkAclRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNetworkAclRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNetworkAclRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNetworkAclResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteNetworkAclResponse struct { - *tchttp.BaseResponse - Response *DeleteNetworkAclResponseParams `json:"Response"` -} - -func (r *DeleteNetworkAclResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNetworkAclResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNetworkInterfaceRequestParams struct { - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` -} - -type DeleteNetworkInterfaceRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` -} - -func (r *DeleteNetworkInterfaceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNetworkInterfaceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteNetworkInterfaceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteNetworkInterfaceResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteNetworkInterfaceResponse struct { - *tchttp.BaseResponse - Response *DeleteNetworkInterfaceResponseParams `json:"Response"` -} - -func (r *DeleteNetworkInterfaceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteNetworkInterfaceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteRouteTableRequestParams struct { - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` -} - -type DeleteRouteTableRequest struct { - *tchttp.BaseRequest - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` -} - -func (r *DeleteRouteTableRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteRouteTableRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteRouteTableRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteRouteTableResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteRouteTableResponse struct { - *tchttp.BaseResponse - Response *DeleteRouteTableResponseParams `json:"Response"` -} - -func (r *DeleteRouteTableResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteRouteTableResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteRoutesRequestParams struct { - // 路由表实例ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略对象,删除路由策略时,仅需使用Route的RouteId字段。 - Routes []*Route `json:"Routes,omitempty" name:"Routes"` -} - -type DeleteRoutesRequest struct { - *tchttp.BaseRequest - - // 路由表实例ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略对象,删除路由策略时,仅需使用Route的RouteId字段。 - Routes []*Route `json:"Routes,omitempty" name:"Routes"` -} - -func (r *DeleteRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteRoutesResponseParams struct { - // 已删除的路由策略详情。 - RouteSet []*Route `json:"RouteSet,omitempty" name:"RouteSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteRoutesResponse struct { - *tchttp.BaseResponse - Response *DeleteRoutesResponseParams `json:"Response"` -} - -func (r *DeleteRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteSecurityGroupPoliciesRequestParams struct { - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合。一个请求中只能删除单个方向的一条或多条规则。支持指定索引(PolicyIndex) 匹配删除和安全组规则匹配删除两种方式,一个请求中只能使用一种匹配方式。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` -} - -type DeleteSecurityGroupPoliciesRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合。一个请求中只能删除单个方向的一条或多条规则。支持指定索引(PolicyIndex) 匹配删除和安全组规则匹配删除两种方式,一个请求中只能使用一种匹配方式。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` -} - -func (r *DeleteSecurityGroupPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteSecurityGroupPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - delete(f, "SecurityGroupPolicySet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteSecurityGroupPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteSecurityGroupPoliciesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteSecurityGroupPoliciesResponse struct { - *tchttp.BaseResponse - Response *DeleteSecurityGroupPoliciesResponseParams `json:"Response"` -} - -func (r *DeleteSecurityGroupPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteSecurityGroupPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteSecurityGroupRequestParams struct { - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` -} - -type DeleteSecurityGroupRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` -} - -func (r *DeleteSecurityGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteSecurityGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteSecurityGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteSecurityGroupResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteSecurityGroupResponse struct { - *tchttp.BaseResponse - Response *DeleteSecurityGroupResponseParams `json:"Response"` -} - -func (r *DeleteSecurityGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteSecurityGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteServiceTemplateGroupRequestParams struct { - // 协议端口模板集合实例ID,例如:ppmg-n17uxvve。 - ServiceTemplateGroupId *string `json:"ServiceTemplateGroupId,omitempty" name:"ServiceTemplateGroupId"` -} - -type DeleteServiceTemplateGroupRequest struct { - *tchttp.BaseRequest - - // 协议端口模板集合实例ID,例如:ppmg-n17uxvve。 - ServiceTemplateGroupId *string `json:"ServiceTemplateGroupId,omitempty" name:"ServiceTemplateGroupId"` -} - -func (r *DeleteServiceTemplateGroupRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteServiceTemplateGroupRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ServiceTemplateGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteServiceTemplateGroupRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteServiceTemplateGroupResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteServiceTemplateGroupResponse struct { - *tchttp.BaseResponse - Response *DeleteServiceTemplateGroupResponseParams `json:"Response"` -} - -func (r *DeleteServiceTemplateGroupResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteServiceTemplateGroupResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteServiceTemplateRequestParams struct { - // 协议端口模板实例ID,例如:ppm-e6dy460g。 - ServiceTemplateId *string `json:"ServiceTemplateId,omitempty" name:"ServiceTemplateId"` -} - -type DeleteServiceTemplateRequest struct { - *tchttp.BaseRequest - - // 协议端口模板实例ID,例如:ppm-e6dy460g。 - ServiceTemplateId *string `json:"ServiceTemplateId,omitempty" name:"ServiceTemplateId"` -} - -func (r *DeleteServiceTemplateRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteServiceTemplateRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ServiceTemplateId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteServiceTemplateRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteServiceTemplateResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteServiceTemplateResponse struct { - *tchttp.BaseResponse - Response *DeleteServiceTemplateResponseParams `json:"Response"` -} - -func (r *DeleteServiceTemplateResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteServiceTemplateResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteSnapshotPoliciesRequestParams struct { - // 快照策略Id。 - SnapshotPolicyIds []*string `json:"SnapshotPolicyIds,omitempty" name:"SnapshotPolicyIds"` -} - -type DeleteSnapshotPoliciesRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyIds []*string `json:"SnapshotPolicyIds,omitempty" name:"SnapshotPolicyIds"` -} - -func (r *DeleteSnapshotPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteSnapshotPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteSnapshotPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteSnapshotPoliciesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteSnapshotPoliciesResponse struct { - *tchttp.BaseResponse - Response *DeleteSnapshotPoliciesResponseParams `json:"Response"` -} - -func (r *DeleteSnapshotPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteSnapshotPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteSubnetRequestParams struct { - // 子网实例ID。可通过DescribeSubnets接口返回值中的SubnetId获取。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` -} - -type DeleteSubnetRequest struct { - *tchttp.BaseRequest - - // 子网实例ID。可通过DescribeSubnets接口返回值中的SubnetId获取。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` -} - -func (r *DeleteSubnetRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteSubnetRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SubnetId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteSubnetRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteSubnetResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteSubnetResponse struct { - *tchttp.BaseResponse - Response *DeleteSubnetResponseParams `json:"Response"` -} - -func (r *DeleteSubnetResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteSubnetResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteTemplateMemberRequestParams struct { - // 参数模板实例ID,支持IP地址、协议端口、IP地址组、协议端口组四种参数模板的实例ID。 - TemplateId *string `json:"TemplateId,omitempty" name:"TemplateId"` - - // 需要添加的参数模板成员信息,支持IP地址、协议端口、IP地址组、协议端口组四种类型,类型需要与TemplateId参数类型一致。 - TemplateMember []*MemberInfo `json:"TemplateMember,omitempty" name:"TemplateMember"` -} - -type DeleteTemplateMemberRequest struct { - *tchttp.BaseRequest - - // 参数模板实例ID,支持IP地址、协议端口、IP地址组、协议端口组四种参数模板的实例ID。 - TemplateId *string `json:"TemplateId,omitempty" name:"TemplateId"` - - // 需要添加的参数模板成员信息,支持IP地址、协议端口、IP地址组、协议端口组四种类型,类型需要与TemplateId参数类型一致。 - TemplateMember []*MemberInfo `json:"TemplateMember,omitempty" name:"TemplateMember"` -} - -func (r *DeleteTemplateMemberRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteTemplateMemberRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TemplateId") - delete(f, "TemplateMember") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteTemplateMemberRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteTemplateMemberResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteTemplateMemberResponse struct { - *tchttp.BaseResponse - Response *DeleteTemplateMemberResponseParams `json:"Response"` -} - -func (r *DeleteTemplateMemberResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteTemplateMemberResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteTrafficPackagesRequestParams struct { - // 待删除的流量包唯一ID数组 - TrafficPackageIds []*string `json:"TrafficPackageIds,omitempty" name:"TrafficPackageIds"` -} - -type DeleteTrafficPackagesRequest struct { - *tchttp.BaseRequest - - // 待删除的流量包唯一ID数组 - TrafficPackageIds []*string `json:"TrafficPackageIds,omitempty" name:"TrafficPackageIds"` -} - -func (r *DeleteTrafficPackagesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteTrafficPackagesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TrafficPackageIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteTrafficPackagesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteTrafficPackagesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteTrafficPackagesResponse struct { - *tchttp.BaseResponse - Response *DeleteTrafficPackagesResponseParams `json:"Response"` -} - -func (r *DeleteTrafficPackagesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteTrafficPackagesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcEndPointRequestParams struct { - // 终端节点ID。 - EndPointId *string `json:"EndPointId,omitempty" name:"EndPointId"` -} - -type DeleteVpcEndPointRequest struct { - *tchttp.BaseRequest - - // 终端节点ID。 - EndPointId *string `json:"EndPointId,omitempty" name:"EndPointId"` -} - -func (r *DeleteVpcEndPointRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcEndPointRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "EndPointId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpcEndPointRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcEndPointResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpcEndPointResponse struct { - *tchttp.BaseResponse - Response *DeleteVpcEndPointResponseParams `json:"Response"` -} - -func (r *DeleteVpcEndPointResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcEndPointResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcEndPointServiceRequestParams struct { - // 终端节点ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` -} - -type DeleteVpcEndPointServiceRequest struct { - *tchttp.BaseRequest - - // 终端节点ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` -} - -func (r *DeleteVpcEndPointServiceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcEndPointServiceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "EndPointServiceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpcEndPointServiceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcEndPointServiceResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpcEndPointServiceResponse struct { - *tchttp.BaseResponse - Response *DeleteVpcEndPointServiceResponseParams `json:"Response"` -} - -func (r *DeleteVpcEndPointServiceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcEndPointServiceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcEndPointServiceWhiteListRequestParams struct { - // 用户UIN数组。 - UserUin []*string `json:"UserUin,omitempty" name:"UserUin"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` -} - -type DeleteVpcEndPointServiceWhiteListRequest struct { - *tchttp.BaseRequest - - // 用户UIN数组。 - UserUin []*string `json:"UserUin,omitempty" name:"UserUin"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` -} - -func (r *DeleteVpcEndPointServiceWhiteListRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcEndPointServiceWhiteListRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "UserUin") - delete(f, "EndPointServiceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpcEndPointServiceWhiteListRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcEndPointServiceWhiteListResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpcEndPointServiceWhiteListResponse struct { - *tchttp.BaseResponse - Response *DeleteVpcEndPointServiceWhiteListResponseParams `json:"Response"` -} - -func (r *DeleteVpcEndPointServiceWhiteListResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcEndPointServiceWhiteListResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcPeeringConnectionRequestParams struct { - // 对等连接唯一ID。 - PeeringConnectionId *string `json:"PeeringConnectionId,omitempty" name:"PeeringConnectionId"` -} - -type DeleteVpcPeeringConnectionRequest struct { - *tchttp.BaseRequest - - // 对等连接唯一ID。 - PeeringConnectionId *string `json:"PeeringConnectionId,omitempty" name:"PeeringConnectionId"` -} - -func (r *DeleteVpcPeeringConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcPeeringConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "PeeringConnectionId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpcPeeringConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcPeeringConnectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpcPeeringConnectionResponse struct { - *tchttp.BaseResponse - Response *DeleteVpcPeeringConnectionResponseParams `json:"Response"` -} - -func (r *DeleteVpcPeeringConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcPeeringConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcRequestParams struct { - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -type DeleteVpcRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -func (r *DeleteVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpcResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpcResponse struct { - *tchttp.BaseResponse - Response *DeleteVpcResponseParams `json:"Response"` -} - -func (r *DeleteVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnConnectionRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN通道实例ID。形如:vpnx-f49l6u0z。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` -} - -type DeleteVpnConnectionRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN通道实例ID。形如:vpnx-f49l6u0z。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` -} - -func (r *DeleteVpnConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "VpnConnectionId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpnConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnConnectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpnConnectionResponse struct { - *tchttp.BaseResponse - Response *DeleteVpnConnectionResponseParams `json:"Response"` -} - -func (r *DeleteVpnConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnGatewayRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` -} - -type DeleteVpnGatewayRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` -} - -func (r *DeleteVpnGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpnGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpnGatewayResponse struct { - *tchttp.BaseResponse - Response *DeleteVpnGatewayResponseParams `json:"Response"` -} - -func (r *DeleteVpnGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnGatewayRoutesRequestParams struct { - // VPN网关实例ID - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 路由ID信息列表,可以通过[DescribeVpnGatewayRoutes](https://cloud.tencent.com/document/api/215/57676)接口查询。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` -} - -type DeleteVpnGatewayRoutesRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 路由ID信息列表,可以通过[DescribeVpnGatewayRoutes](https://cloud.tencent.com/document/api/215/57676)接口查询。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` -} - -func (r *DeleteVpnGatewayRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnGatewayRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "RouteIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpnGatewayRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnGatewayRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpnGatewayRoutesResponse struct { - *tchttp.BaseResponse - Response *DeleteVpnGatewayRoutesResponseParams `json:"Response"` -} - -func (r *DeleteVpnGatewayRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnGatewayRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnGatewaySslClientRequestParams struct { - // SSL-VPN-CLIENT 实例ID。不可和SslVpnClientIds同时使用。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // SSL-VPN-CLIENT 实例ID列表。批量删除时使用。不可和SslVpnClientId同时使用。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` -} - -type DeleteVpnGatewaySslClientRequest struct { - *tchttp.BaseRequest - - // SSL-VPN-CLIENT 实例ID。不可和SslVpnClientIds同时使用。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // SSL-VPN-CLIENT 实例ID列表。批量删除时使用。不可和SslVpnClientId同时使用。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` -} - -func (r *DeleteVpnGatewaySslClientRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnGatewaySslClientRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SslVpnClientId") - delete(f, "SslVpnClientIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpnGatewaySslClientRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnGatewaySslClientResponseParams struct { - // 异步任务ID。 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpnGatewaySslClientResponse struct { - *tchttp.BaseResponse - Response *DeleteVpnGatewaySslClientResponseParams `json:"Response"` -} - -func (r *DeleteVpnGatewaySslClientResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnGatewaySslClientResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnGatewaySslServerRequestParams struct { - // SSL-VPN-SERVER 实例ID。 - SslVpnServerId *string `json:"SslVpnServerId,omitempty" name:"SslVpnServerId"` -} - -type DeleteVpnGatewaySslServerRequest struct { - *tchttp.BaseRequest - - // SSL-VPN-SERVER 实例ID。 - SslVpnServerId *string `json:"SslVpnServerId,omitempty" name:"SslVpnServerId"` -} - -func (r *DeleteVpnGatewaySslServerRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnGatewaySslServerRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SslVpnServerId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteVpnGatewaySslServerRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DeleteVpnGatewaySslServerResponseParams struct { - // 异步任务ID。 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DeleteVpnGatewaySslServerResponse struct { - *tchttp.BaseResponse - Response *DeleteVpnGatewaySslServerResponseParams `json:"Response"` -} - -func (r *DeleteVpnGatewaySslServerResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DeleteVpnGatewaySslServerResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAccountAttributesRequestParams struct { -} - -type DescribeAccountAttributesRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeAccountAttributesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAccountAttributesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAccountAttributesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAccountAttributesResponseParams struct { - // 用户账号属性对象。 - AccountAttributeSet []*AccountAttribute `json:"AccountAttributeSet,omitempty" name:"AccountAttributeSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAccountAttributesResponse struct { - *tchttp.BaseResponse - Response *DescribeAccountAttributesResponseParams `json:"Response"` -} - -func (r *DescribeAccountAttributesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAccountAttributesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAddressQuotaRequestParams struct { -} - -type DescribeAddressQuotaRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeAddressQuotaRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAddressQuotaRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAddressQuotaRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAddressQuotaResponseParams struct { - // 账户 EIP 配额信息。 - QuotaSet []*Quota `json:"QuotaSet,omitempty" name:"QuotaSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAddressQuotaResponse struct { - *tchttp.BaseResponse - Response *DescribeAddressQuotaResponseParams `json:"Response"` -} - -func (r *DescribeAddressQuotaResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAddressQuotaResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAddressTemplateGroupsRequestParams struct { - // 过滤条件。 - //
  • address-template-group-name - String - (过滤条件)IP地址模板集合名称。
  • - //
  • address-template-group-id - String - (过滤条件)IP地址模板实集合例ID,例如:ipmg-mdunqeb6。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeAddressTemplateGroupsRequest struct { - *tchttp.BaseRequest - - // 过滤条件。 - //
  • address-template-group-name - String - (过滤条件)IP地址模板集合名称。
  • - //
  • address-template-group-id - String - (过滤条件)IP地址模板实集合例ID,例如:ipmg-mdunqeb6。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeAddressTemplateGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAddressTemplateGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAddressTemplateGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAddressTemplateGroupsResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // IP地址模板。 - AddressTemplateGroupSet []*AddressTemplateGroup `json:"AddressTemplateGroupSet,omitempty" name:"AddressTemplateGroupSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAddressTemplateGroupsResponse struct { - *tchttp.BaseResponse - Response *DescribeAddressTemplateGroupsResponseParams `json:"Response"` -} - -func (r *DescribeAddressTemplateGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAddressTemplateGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAddressTemplatesRequestParams struct { - // 过滤条件。 - //
  • address-template-name - IP地址模板名称。
  • - //
  • address-template-id - IP地址模板实例ID,例如:ipm-mdunqeb6。
  • - //
  • address-ip - IP地址。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeAddressTemplatesRequest struct { - *tchttp.BaseRequest - - // 过滤条件。 - //
  • address-template-name - IP地址模板名称。
  • - //
  • address-template-id - IP地址模板实例ID,例如:ipm-mdunqeb6。
  • - //
  • address-ip - IP地址。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeAddressTemplatesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAddressTemplatesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAddressTemplatesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAddressTemplatesResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // IP地址模板。 - AddressTemplateSet []*AddressTemplate `json:"AddressTemplateSet,omitempty" name:"AddressTemplateSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAddressTemplatesResponse struct { - *tchttp.BaseResponse - Response *DescribeAddressTemplatesResponseParams `json:"Response"` -} - -func (r *DescribeAddressTemplatesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAddressTemplatesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAddressesRequestParams struct { - // 标识 EIP 的唯一 ID 列表。EIP 唯一 ID 形如:`eip-11112222`。参数不支持同时指定`AddressIds`和`Filters.address-id`。 - AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为100。详细的过滤条件如下: - //
  • address-id - String - 是否必填:否 - (过滤条件)按照 EIP 的唯一 ID 过滤。EIP 唯一 ID 形如:eip-11112222。
  • - //
  • address-name - String - 是否必填:否 - (过滤条件)按照 EIP 名称过滤。不支持模糊过滤。
  • - //
  • address-ip - String - 是否必填:否 - (过滤条件)按照 EIP 的 IP 地址过滤。
  • - //
  • address-status - String - 是否必填:否 - (过滤条件)按照 EIP 的状态过滤。状态包含:'CREATING','BINDING','BIND','UNBINDING','UNBIND','OFFLINING','BIND_ENI'。
  • - //
  • instance-id - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的实例 ID 过滤。实例 ID 形如:ins-11112222。
  • - //
  • private-ip-address - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的内网 IP 过滤。
  • - //
  • network-interface-id - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的弹性网卡 ID 过滤。弹性网卡 ID 形如:eni-11112222。
  • - //
  • is-arrears - String - 是否必填:否 - (过滤条件)按照 EIP 是否欠费进行过滤。(TRUE:EIP 处于欠费状态|FALSE:EIP 费用状态正常)
  • - //
  • address-type - String - 是否必填:否 - (过滤条件)按照 IP类型 进行过滤。可选值:'WanIP', 'EIP','AnycastEIP','HighQualityEIP'。默认值是'EIP'。
  • - //
  • address-isp - String - 是否必填:否 - (过滤条件)按照 运营商类型 进行过滤。可选值:'BGP','CMCC','CUCC', 'CTCC'
  • - //
  • dedicated-cluster-id - String - 是否必填:否 - (过滤条件)按照 CDC 的唯一 ID 过滤。CDC 唯一 ID 形如:cluster-11112222。
  • - //
  • tag-key - String - 是否必填:否 - (过滤条件)按照标签键进行过滤。
  • - //
  • tag-value - String - 是否必填:否 - (过滤条件)按照标签值进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。tag-key使用具体的标签键进行替换。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API 中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API 中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeAddressesRequest struct { - *tchttp.BaseRequest - - // 标识 EIP 的唯一 ID 列表。EIP 唯一 ID 形如:`eip-11112222`。参数不支持同时指定`AddressIds`和`Filters.address-id`。 - AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为100。详细的过滤条件如下: - //
  • address-id - String - 是否必填:否 - (过滤条件)按照 EIP 的唯一 ID 过滤。EIP 唯一 ID 形如:eip-11112222。
  • - //
  • address-name - String - 是否必填:否 - (过滤条件)按照 EIP 名称过滤。不支持模糊过滤。
  • - //
  • address-ip - String - 是否必填:否 - (过滤条件)按照 EIP 的 IP 地址过滤。
  • - //
  • address-status - String - 是否必填:否 - (过滤条件)按照 EIP 的状态过滤。状态包含:'CREATING','BINDING','BIND','UNBINDING','UNBIND','OFFLINING','BIND_ENI'。
  • - //
  • instance-id - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的实例 ID 过滤。实例 ID 形如:ins-11112222。
  • - //
  • private-ip-address - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的内网 IP 过滤。
  • - //
  • network-interface-id - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的弹性网卡 ID 过滤。弹性网卡 ID 形如:eni-11112222。
  • - //
  • is-arrears - String - 是否必填:否 - (过滤条件)按照 EIP 是否欠费进行过滤。(TRUE:EIP 处于欠费状态|FALSE:EIP 费用状态正常)
  • - //
  • address-type - String - 是否必填:否 - (过滤条件)按照 IP类型 进行过滤。可选值:'WanIP', 'EIP','AnycastEIP','HighQualityEIP'。默认值是'EIP'。
  • - //
  • address-isp - String - 是否必填:否 - (过滤条件)按照 运营商类型 进行过滤。可选值:'BGP','CMCC','CUCC', 'CTCC'
  • - //
  • dedicated-cluster-id - String - 是否必填:否 - (过滤条件)按照 CDC 的唯一 ID 过滤。CDC 唯一 ID 形如:cluster-11112222。
  • - //
  • tag-key - String - 是否必填:否 - (过滤条件)按照标签键进行过滤。
  • - //
  • tag-value - String - 是否必填:否 - (过滤条件)按照标签值进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。tag-key使用具体的标签键进行替换。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API 中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API 中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeAddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAddressesResponseParams struct { - // 符合条件的 EIP 数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // EIP 详细信息列表。 - AddressSet []*Address `json:"AddressSet,omitempty" name:"AddressSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAddressesResponse struct { - *tchttp.BaseResponse - Response *DescribeAddressesResponseParams `json:"Response"` -} - -func (r *DescribeAddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAssistantCidrRequestParams struct { - // `VPC`实例`ID`数组。形如:[`vpc-6v2ht8q5`] - VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds"` - - // 过滤条件,参数不支持同时指定VpcIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeAssistantCidrRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`数组。形如:[`vpc-6v2ht8q5`] - VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds"` - - // 过滤条件,参数不支持同时指定VpcIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeAssistantCidrRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAssistantCidrRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAssistantCidrRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeAssistantCidrResponseParams struct { - // 符合条件的辅助CIDR数组。 - // 注意:此字段可能返回 null,表示取不到有效值。 - AssistantCidrSet []*AssistantCidr `json:"AssistantCidrSet,omitempty" name:"AssistantCidrSet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeAssistantCidrResponse struct { - *tchttp.BaseResponse - Response *DescribeAssistantCidrResponseParams `json:"Response"` -} - -func (r *DescribeAssistantCidrResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeAssistantCidrResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeBandwidthPackageBillUsageRequestParams struct { - // 后付费共享带宽包的唯一ID - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -type DescribeBandwidthPackageBillUsageRequest struct { - *tchttp.BaseRequest - - // 后付费共享带宽包的唯一ID - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` -} - -func (r *DescribeBandwidthPackageBillUsageRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeBandwidthPackageBillUsageRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "BandwidthPackageId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeBandwidthPackageBillUsageRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeBandwidthPackageBillUsageResponseParams struct { - // 当前计费用量 - BandwidthPackageBillBandwidthSet []*BandwidthPackageBillBandwidth `json:"BandwidthPackageBillBandwidthSet,omitempty" name:"BandwidthPackageBillBandwidthSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeBandwidthPackageBillUsageResponse struct { - *tchttp.BaseResponse - Response *DescribeBandwidthPackageBillUsageResponseParams `json:"Response"` -} - -func (r *DescribeBandwidthPackageBillUsageResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeBandwidthPackageBillUsageResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeBandwidthPackageQuotaRequestParams struct { -} - -type DescribeBandwidthPackageQuotaRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeBandwidthPackageQuotaRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeBandwidthPackageQuotaRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeBandwidthPackageQuotaRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeBandwidthPackageQuotaResponseParams struct { - // 带宽包配额详细信息 - QuotaSet []*Quota `json:"QuotaSet,omitempty" name:"QuotaSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeBandwidthPackageQuotaResponse struct { - *tchttp.BaseResponse - Response *DescribeBandwidthPackageQuotaResponseParams `json:"Response"` -} - -func (r *DescribeBandwidthPackageQuotaResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeBandwidthPackageQuotaResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeBandwidthPackageResourcesRequestParams struct { - // 标识 共享带宽包 的唯一 ID 列表。共享带宽包 唯一 ID 形如:`bwp-11112222`。 - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AddressIds`和`Filters`。详细的过滤条件如下: - //
  • resource-id - String - 是否必填:否 - (过滤条件)按照 共享带宽包内资源 的唯一 ID 过滤。共享带宽包内资源 唯一 ID 形如:eip-11112222。
  • - //
  • resource-type - String - 是否必填:否 - (过滤条件)按照 共享带宽包内资源 类型过滤,目前仅支持 弹性IP 和 负载均衡 两种类型,可选值为 Address 和 LoadBalance。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeBandwidthPackageResourcesRequest struct { - *tchttp.BaseRequest - - // 标识 共享带宽包 的唯一 ID 列表。共享带宽包 唯一 ID 形如:`bwp-11112222`。 - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AddressIds`和`Filters`。详细的过滤条件如下: - //
  • resource-id - String - 是否必填:否 - (过滤条件)按照 共享带宽包内资源 的唯一 ID 过滤。共享带宽包内资源 唯一 ID 形如:eip-11112222。
  • - //
  • resource-type - String - 是否必填:否 - (过滤条件)按照 共享带宽包内资源 类型过滤,目前仅支持 弹性IP 和 负载均衡 两种类型,可选值为 Address 和 LoadBalance。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeBandwidthPackageResourcesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeBandwidthPackageResourcesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "BandwidthPackageId") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeBandwidthPackageResourcesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeBandwidthPackageResourcesResponseParams struct { - // 符合条件的 共享带宽包内资源 数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 共享带宽包内资源 详细信息列表。 - ResourceSet []*Resource `json:"ResourceSet,omitempty" name:"ResourceSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeBandwidthPackageResourcesResponse struct { - *tchttp.BaseResponse - Response *DescribeBandwidthPackageResourcesResponseParams `json:"Response"` -} - -func (r *DescribeBandwidthPackageResourcesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeBandwidthPackageResourcesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeBandwidthPackagesRequestParams struct { - // 带宽包唯一ID列表 - BandwidthPackageIds []*string `json:"BandwidthPackageIds,omitempty" name:"BandwidthPackageIds"` - - // 每次请求的`Filters`的上限为10。参数不支持同时指定`BandwidthPackageIds`和`Filters`。详细的过滤条件如下: - //
  • bandwidth-package_id - String - 是否必填:否 - (过滤条件)按照带宽包的唯一标识ID过滤。
  • - //
  • bandwidth-package-name - String - 是否必填:否 - (过滤条件)按照 带宽包名称过滤。不支持模糊过滤。
  • - //
  • network-type - String - 是否必填:否 - (过滤条件)按照带宽包的类型过滤。类型包括'HIGH_QUALITY_BGP','BGP','SINGLEISP'和'ANYCAST'。
  • - //
  • charge-type - String - 是否必填:否 - (过滤条件)按照带宽包的计费类型过滤。计费类型包括'TOP5_POSTPAID_BY_MONTH'和'PERCENT95_POSTPAID_BY_MONTH'。
  • - //
  • resource.resource-type - String - 是否必填:否 - (过滤条件)按照带宽包资源类型过滤。资源类型包括'Address'和'LoadBalance'
  • - //
  • resource.resource-id - String - 是否必填:否 - (过滤条件)按照带宽包资源Id过滤。资源Id形如'eip-xxxx','lb-xxxx'
  • - //
  • resource.address-ip - String - 是否必填:否 - (过滤条件)按照带宽包资源Ip过滤。
  • - //
  • tag-key - String - 是否必填:否 - (过滤条件)按照标签键进行过滤。
  • - //
  • tag-value - String - 是否必填:否 - (过滤条件)按照标签值进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。tag-key使用具体的标签键进行替换。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 查询带宽包偏移量,默认为0。关于Offset的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小结。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 查询带宽包返回数量,默认为20,最大值为100。关于Limit的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小结。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeBandwidthPackagesRequest struct { - *tchttp.BaseRequest - - // 带宽包唯一ID列表 - BandwidthPackageIds []*string `json:"BandwidthPackageIds,omitempty" name:"BandwidthPackageIds"` - - // 每次请求的`Filters`的上限为10。参数不支持同时指定`BandwidthPackageIds`和`Filters`。详细的过滤条件如下: - //
  • bandwidth-package_id - String - 是否必填:否 - (过滤条件)按照带宽包的唯一标识ID过滤。
  • - //
  • bandwidth-package-name - String - 是否必填:否 - (过滤条件)按照 带宽包名称过滤。不支持模糊过滤。
  • - //
  • network-type - String - 是否必填:否 - (过滤条件)按照带宽包的类型过滤。类型包括'HIGH_QUALITY_BGP','BGP','SINGLEISP'和'ANYCAST'。
  • - //
  • charge-type - String - 是否必填:否 - (过滤条件)按照带宽包的计费类型过滤。计费类型包括'TOP5_POSTPAID_BY_MONTH'和'PERCENT95_POSTPAID_BY_MONTH'。
  • - //
  • resource.resource-type - String - 是否必填:否 - (过滤条件)按照带宽包资源类型过滤。资源类型包括'Address'和'LoadBalance'
  • - //
  • resource.resource-id - String - 是否必填:否 - (过滤条件)按照带宽包资源Id过滤。资源Id形如'eip-xxxx','lb-xxxx'
  • - //
  • resource.address-ip - String - 是否必填:否 - (过滤条件)按照带宽包资源Ip过滤。
  • - //
  • tag-key - String - 是否必填:否 - (过滤条件)按照标签键进行过滤。
  • - //
  • tag-value - String - 是否必填:否 - (过滤条件)按照标签值进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。tag-key使用具体的标签键进行替换。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 查询带宽包偏移量,默认为0。关于Offset的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小结。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 查询带宽包返回数量,默认为20,最大值为100。关于Limit的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小结。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeBandwidthPackagesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeBandwidthPackagesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "BandwidthPackageIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeBandwidthPackagesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeBandwidthPackagesResponseParams struct { - // 符合条件的带宽包数量 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 描述带宽包详细信息 - BandwidthPackageSet []*BandwidthPackage `json:"BandwidthPackageSet,omitempty" name:"BandwidthPackageSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeBandwidthPackagesResponse struct { - *tchttp.BaseResponse - Response *DescribeBandwidthPackagesResponseParams `json:"Response"` -} - -func (r *DescribeBandwidthPackagesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeBandwidthPackagesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCcnAttachedInstancesRequestParams struct { - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤条件: - //
  • ccn-id - String -(过滤条件)CCN实例ID。
  • - //
  • instance-type - String -(过滤条件)关联实例类型。
  • - //
  • instance-region - String -(过滤条件)关联实例所属地域。
  • - //
  • instance-id - String -(过滤条件)关联实例ID。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 云联网实例ID - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 排序字段。支持:`CcnId` `InstanceType` `InstanceId` `InstanceName` `InstanceRegion` `AttachedTime` `State`。默认值:`AttachedTime` - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方法。升序:`ASC`,倒序:`DESC`。默认值:`ASC` - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -type DescribeCcnAttachedInstancesRequest struct { - *tchttp.BaseRequest - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤条件: - //
  • ccn-id - String -(过滤条件)CCN实例ID。
  • - //
  • instance-type - String -(过滤条件)关联实例类型。
  • - //
  • instance-region - String -(过滤条件)关联实例所属地域。
  • - //
  • instance-id - String -(过滤条件)关联实例ID。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 云联网实例ID - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 排序字段。支持:`CcnId` `InstanceType` `InstanceId` `InstanceName` `InstanceRegion` `AttachedTime` `State`。默认值:`AttachedTime` - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方法。升序:`ASC`,倒序:`DESC`。默认值:`ASC` - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -func (r *DescribeCcnAttachedInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCcnAttachedInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Offset") - delete(f, "Limit") - delete(f, "Filters") - delete(f, "CcnId") - delete(f, "OrderField") - delete(f, "OrderDirection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCcnAttachedInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCcnAttachedInstancesResponseParams struct { - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 关联实例列表。 - InstanceSet []*CcnAttachedInstance `json:"InstanceSet,omitempty" name:"InstanceSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCcnAttachedInstancesResponse struct { - *tchttp.BaseResponse - Response *DescribeCcnAttachedInstancesResponseParams `json:"Response"` -} - -func (r *DescribeCcnAttachedInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCcnAttachedInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCcnRegionBandwidthLimitsRequestParams struct { - // CCN实例ID,形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` -} - -type DescribeCcnRegionBandwidthLimitsRequest struct { - *tchttp.BaseRequest - - // CCN实例ID,形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` -} - -func (r *DescribeCcnRegionBandwidthLimitsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCcnRegionBandwidthLimitsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCcnRegionBandwidthLimitsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCcnRegionBandwidthLimitsResponseParams struct { - // 云联网(CCN)各地域出带宽上限 - CcnRegionBandwidthLimitSet []*CcnRegionBandwidthLimit `json:"CcnRegionBandwidthLimitSet,omitempty" name:"CcnRegionBandwidthLimitSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCcnRegionBandwidthLimitsResponse struct { - *tchttp.BaseResponse - Response *DescribeCcnRegionBandwidthLimitsResponseParams `json:"Response"` -} - -func (r *DescribeCcnRegionBandwidthLimitsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCcnRegionBandwidthLimitsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCcnRoutesRequestParams struct { - // CCN实例ID,形如:`ccn-gree226l`。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN路由策略唯一ID,形如:`ccnr-f49l6u0z`。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` - - // 过滤条件,参数不支持同时指定RouteIds和Filters。 - //
  • route-id - String -(过滤条件)路由策略ID。
  • - //
  • cidr-block - String -(过滤条件)目的端。
  • - //
  • instance-type - String -(过滤条件)下一跳类型。
  • - //
  • instance-region - String -(过滤条件)下一跳所属地域。
  • - //
  • instance-id - String -(过滤条件)下一跳实例ID。
  • - //
  • route-table-id - String -(过滤条件)路由表ID列表,形如ccntr-1234edfr,可以根据路由表ID 过滤。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeCcnRoutesRequest struct { - *tchttp.BaseRequest - - // CCN实例ID,形如:`ccn-gree226l`。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN路由策略唯一ID,形如:`ccnr-f49l6u0z`。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` - - // 过滤条件,参数不支持同时指定RouteIds和Filters。 - //
  • route-id - String -(过滤条件)路由策略ID。
  • - //
  • cidr-block - String -(过滤条件)目的端。
  • - //
  • instance-type - String -(过滤条件)下一跳类型。
  • - //
  • instance-region - String -(过滤条件)下一跳所属地域。
  • - //
  • instance-id - String -(过滤条件)下一跳实例ID。
  • - //
  • route-table-id - String -(过滤条件)路由表ID列表,形如ccntr-1234edfr,可以根据路由表ID 过滤。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "RouteIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCcnRoutesResponseParams struct { - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // CCN路由策略对象。 - RouteSet []*CcnRoute `json:"RouteSet,omitempty" name:"RouteSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *DescribeCcnRoutesResponseParams `json:"Response"` -} - -func (r *DescribeCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCcnsRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定CcnIds和Filters。 - CcnIds []*string `json:"CcnIds,omitempty" name:"CcnIds"` - - // 过滤条件,参数不支持同时指定CcnIds和Filters。 - //
  • ccn-id - String - (过滤条件)CCN唯一ID,形如:`ccn-f49l6u0z`。
  • - //
  • ccn-name - String - (过滤条件)CCN名称。
  • - //
  • ccn-description - String - (过滤条件)CCN描述。
  • - //
  • state - String - (过滤条件)实例状态, 'ISOLATED': 隔离中(欠费停服),'AVAILABLE':运行中。
  • - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例:查询绑定了标签的CCN列表。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 排序字段。支持:`CcnId` `CcnName` `CreateTime` `State` `QosLevel`。默认值: `CreateTime` - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方法。升序:`ASC`,倒序:`DESC`。默认值:`ASC` - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -type DescribeCcnsRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定CcnIds和Filters。 - CcnIds []*string `json:"CcnIds,omitempty" name:"CcnIds"` - - // 过滤条件,参数不支持同时指定CcnIds和Filters。 - //
  • ccn-id - String - (过滤条件)CCN唯一ID,形如:`ccn-f49l6u0z`。
  • - //
  • ccn-name - String - (过滤条件)CCN名称。
  • - //
  • ccn-description - String - (过滤条件)CCN描述。
  • - //
  • state - String - (过滤条件)实例状态, 'ISOLATED': 隔离中(欠费停服),'AVAILABLE':运行中。
  • - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例:查询绑定了标签的CCN列表。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 排序字段。支持:`CcnId` `CcnName` `CreateTime` `State` `QosLevel`。默认值: `CreateTime` - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方法。升序:`ASC`,倒序:`DESC`。默认值:`ASC` - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -func (r *DescribeCcnsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCcnsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "OrderField") - delete(f, "OrderDirection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCcnsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCcnsResponseParams struct { - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // CCN对象。 - CcnSet []*CCN `json:"CcnSet,omitempty" name:"CcnSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCcnsResponse struct { - *tchttp.BaseResponse - Response *DescribeCcnsResponseParams `json:"Response"` -} - -func (r *DescribeCcnsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCcnsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeClassicLinkInstancesRequestParams struct { - // 过滤条件。 - //
  • vpc-id - String - (过滤条件)VPC实例ID。
  • - //
  • vm-ip - String - (过滤条件)基础网络云服务器IP。
  • - Filters []*FilterObject `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认值0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeClassicLinkInstancesRequest struct { - *tchttp.BaseRequest - - // 过滤条件。 - //
  • vpc-id - String - (过滤条件)VPC实例ID。
  • - //
  • vm-ip - String - (过滤条件)基础网络云服务器IP。
  • - Filters []*FilterObject `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认值0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeClassicLinkInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeClassicLinkInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeClassicLinkInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeClassicLinkInstancesResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 私有网络和基础网络互通设备。 - ClassicLinkInstanceSet []*ClassicLinkInstance `json:"ClassicLinkInstanceSet,omitempty" name:"ClassicLinkInstanceSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeClassicLinkInstancesResponse struct { - *tchttp.BaseResponse - Response *DescribeClassicLinkInstancesResponseParams `json:"Response"` -} - -func (r *DescribeClassicLinkInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeClassicLinkInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCrossBorderCcnRegionBandwidthLimitsRequestParams struct { - // 过滤条件,目前`value`值个数只支持一个,可支持的字段有: - //
  • `source-region` 源地域,值形如:`["ap-guangzhou"]`
  • `destination-region` 目的地域,值形如:`["ap-shanghai"]`
  • `ccn-ids` 云联网ID数组,值形如:`["ccn-12345678"]`
  • `user-account-id` 用户账号ID,值形如`["12345678"]`
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数据量可选值0到100之间的整数,默认20。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeCrossBorderCcnRegionBandwidthLimitsRequest struct { - *tchttp.BaseRequest - - // 过滤条件,目前`value`值个数只支持一个,可支持的字段有: - //
  • `source-region` 源地域,值形如:`["ap-guangzhou"]`
  • `destination-region` 目的地域,值形如:`["ap-shanghai"]`
  • `ccn-ids` 云联网ID数组,值形如:`["ccn-12345678"]`
  • `user-account-id` 用户账号ID,值形如`["12345678"]`
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数据量可选值0到100之间的整数,默认20。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeCrossBorderCcnRegionBandwidthLimitsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCrossBorderCcnRegionBandwidthLimitsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCrossBorderCcnRegionBandwidthLimitsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCrossBorderCcnRegionBandwidthLimitsResponseParams struct { - // 符合条件的对象总数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 云联网地域间限速带宽实例的信息。 - CcnBandwidthSet []*CcnBandwidth `json:"CcnBandwidthSet,omitempty" name:"CcnBandwidthSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCrossBorderCcnRegionBandwidthLimitsResponse struct { - *tchttp.BaseResponse - Response *DescribeCrossBorderCcnRegionBandwidthLimitsResponseParams `json:"Response"` -} - -func (r *DescribeCrossBorderCcnRegionBandwidthLimitsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCrossBorderCcnRegionBandwidthLimitsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCrossBorderComplianceRequestParams struct { - // (精确匹配)服务商,可选值:`UNICOM`。 - ServiceProvider *string `json:"ServiceProvider,omitempty" name:"ServiceProvider"` - - // (精确匹配)合规化审批单`ID`。 - ComplianceId *uint64 `json:"ComplianceId,omitempty" name:"ComplianceId"` - - // (模糊查询)公司名称。 - Company *string `json:"Company,omitempty" name:"Company"` - - // (精确匹配)统一社会信用代码。 - UniformSocialCreditCode *string `json:"UniformSocialCreditCode,omitempty" name:"UniformSocialCreditCode"` - - // (模糊查询)法定代表人。 - LegalPerson *string `json:"LegalPerson,omitempty" name:"LegalPerson"` - - // (模糊查询)发证机关。 - IssuingAuthority *string `json:"IssuingAuthority,omitempty" name:"IssuingAuthority"` - - // (模糊查询)营业执照住所。 - BusinessAddress *string `json:"BusinessAddress,omitempty" name:"BusinessAddress"` - - // (精确匹配)邮编。 - PostCode *uint64 `json:"PostCode,omitempty" name:"PostCode"` - - // (模糊查询)经办人。 - Manager *string `json:"Manager,omitempty" name:"Manager"` - - // (精确查询)经办人身份证号。 - ManagerId *string `json:"ManagerId,omitempty" name:"ManagerId"` - - // (模糊查询)经办人身份证地址。 - ManagerAddress *string `json:"ManagerAddress,omitempty" name:"ManagerAddress"` - - // (精确匹配)经办人联系电话。 - ManagerTelephone *string `json:"ManagerTelephone,omitempty" name:"ManagerTelephone"` - - // (精确匹配)电子邮箱。 - Email *string `json:"Email,omitempty" name:"Email"` - - // (精确匹配)服务开始日期,如:`2020-07-28`。 - ServiceStartDate *string `json:"ServiceStartDate,omitempty" name:"ServiceStartDate"` - - // (精确匹配)服务结束日期,如:`2021-07-28`。 - ServiceEndDate *string `json:"ServiceEndDate,omitempty" name:"ServiceEndDate"` - - // (精确匹配)状态。待审批:`PENDING`,通过:`APPROVED `,拒绝:`DENY`。 - State *string `json:"State,omitempty" name:"State"` - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeCrossBorderComplianceRequest struct { - *tchttp.BaseRequest - - // (精确匹配)服务商,可选值:`UNICOM`。 - ServiceProvider *string `json:"ServiceProvider,omitempty" name:"ServiceProvider"` - - // (精确匹配)合规化审批单`ID`。 - ComplianceId *uint64 `json:"ComplianceId,omitempty" name:"ComplianceId"` - - // (模糊查询)公司名称。 - Company *string `json:"Company,omitempty" name:"Company"` - - // (精确匹配)统一社会信用代码。 - UniformSocialCreditCode *string `json:"UniformSocialCreditCode,omitempty" name:"UniformSocialCreditCode"` - - // (模糊查询)法定代表人。 - LegalPerson *string `json:"LegalPerson,omitempty" name:"LegalPerson"` - - // (模糊查询)发证机关。 - IssuingAuthority *string `json:"IssuingAuthority,omitempty" name:"IssuingAuthority"` - - // (模糊查询)营业执照住所。 - BusinessAddress *string `json:"BusinessAddress,omitempty" name:"BusinessAddress"` - - // (精确匹配)邮编。 - PostCode *uint64 `json:"PostCode,omitempty" name:"PostCode"` - - // (模糊查询)经办人。 - Manager *string `json:"Manager,omitempty" name:"Manager"` - - // (精确查询)经办人身份证号。 - ManagerId *string `json:"ManagerId,omitempty" name:"ManagerId"` - - // (模糊查询)经办人身份证地址。 - ManagerAddress *string `json:"ManagerAddress,omitempty" name:"ManagerAddress"` - - // (精确匹配)经办人联系电话。 - ManagerTelephone *string `json:"ManagerTelephone,omitempty" name:"ManagerTelephone"` - - // (精确匹配)电子邮箱。 - Email *string `json:"Email,omitempty" name:"Email"` - - // (精确匹配)服务开始日期,如:`2020-07-28`。 - ServiceStartDate *string `json:"ServiceStartDate,omitempty" name:"ServiceStartDate"` - - // (精确匹配)服务结束日期,如:`2021-07-28`。 - ServiceEndDate *string `json:"ServiceEndDate,omitempty" name:"ServiceEndDate"` - - // (精确匹配)状态。待审批:`PENDING`,通过:`APPROVED `,拒绝:`DENY`。 - State *string `json:"State,omitempty" name:"State"` - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeCrossBorderComplianceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCrossBorderComplianceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ServiceProvider") - delete(f, "ComplianceId") - delete(f, "Company") - delete(f, "UniformSocialCreditCode") - delete(f, "LegalPerson") - delete(f, "IssuingAuthority") - delete(f, "BusinessAddress") - delete(f, "PostCode") - delete(f, "Manager") - delete(f, "ManagerId") - delete(f, "ManagerAddress") - delete(f, "ManagerTelephone") - delete(f, "Email") - delete(f, "ServiceStartDate") - delete(f, "ServiceEndDate") - delete(f, "State") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCrossBorderComplianceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCrossBorderComplianceResponseParams struct { - // 合规化审批单列表。 - CrossBorderComplianceSet []*CrossBorderCompliance `json:"CrossBorderComplianceSet,omitempty" name:"CrossBorderComplianceSet"` - - // 合规化审批单总数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCrossBorderComplianceResponse struct { - *tchttp.BaseResponse - Response *DescribeCrossBorderComplianceResponseParams `json:"Response"` -} - -func (r *DescribeCrossBorderComplianceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCrossBorderComplianceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCrossBorderFlowMonitorRequestParams struct { - // 源地域。 - SourceRegion *string `json:"SourceRegion,omitempty" name:"SourceRegion"` - - // 目的地域。 - DestinationRegion *string `json:"DestinationRegion,omitempty" name:"DestinationRegion"` - - // 云联网ID。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 云联网所属账号。 - CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` - - // 时间粒度。单位为:秒,如60为60s的时间粒度 - Period *int64 `json:"Period,omitempty" name:"Period"` - - // 开始时间。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 结束时间。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -type DescribeCrossBorderFlowMonitorRequest struct { - *tchttp.BaseRequest - - // 源地域。 - SourceRegion *string `json:"SourceRegion,omitempty" name:"SourceRegion"` - - // 目的地域。 - DestinationRegion *string `json:"DestinationRegion,omitempty" name:"DestinationRegion"` - - // 云联网ID。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 云联网所属账号。 - CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` - - // 时间粒度。单位为:秒,如60为60s的时间粒度 - Period *int64 `json:"Period,omitempty" name:"Period"` - - // 开始时间。 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 结束时间。 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -func (r *DescribeCrossBorderFlowMonitorRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCrossBorderFlowMonitorRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SourceRegion") - delete(f, "DestinationRegion") - delete(f, "CcnId") - delete(f, "CcnUin") - delete(f, "Period") - delete(f, "StartTime") - delete(f, "EndTime") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCrossBorderFlowMonitorRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCrossBorderFlowMonitorResponseParams struct { - // 云联网跨境带宽监控数据 - // 注意:此字段可能返回 null,表示取不到有效值。 - CrossBorderFlowMonitorData []*CrossBorderFlowMonitorData `json:"CrossBorderFlowMonitorData,omitempty" name:"CrossBorderFlowMonitorData"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCrossBorderFlowMonitorResponse struct { - *tchttp.BaseResponse - Response *DescribeCrossBorderFlowMonitorResponseParams `json:"Response"` -} - -func (r *DescribeCrossBorderFlowMonitorResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCrossBorderFlowMonitorResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCustomerGatewayVendorsRequestParams struct { -} - -type DescribeCustomerGatewayVendorsRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeCustomerGatewayVendorsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCustomerGatewayVendorsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCustomerGatewayVendorsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCustomerGatewayVendorsResponseParams struct { - // 对端网关厂商信息对象。 - CustomerGatewayVendorSet []*CustomerGatewayVendor `json:"CustomerGatewayVendorSet,omitempty" name:"CustomerGatewayVendorSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCustomerGatewayVendorsResponse struct { - *tchttp.BaseResponse - Response *DescribeCustomerGatewayVendorsResponseParams `json:"Response"` -} - -func (r *DescribeCustomerGatewayVendorsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCustomerGatewayVendorsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCustomerGatewaysRequestParams struct { - // 对端网关ID,例如:cgw-2wqq41m9。每次请求的实例的上限为100。参数不支持同时指定CustomerGatewayIds和Filters。 - CustomerGatewayIds []*string `json:"CustomerGatewayIds,omitempty" name:"CustomerGatewayIds"` - - // 过滤条件,详见下表:实例过滤条件表。每次请求的Filters的上限为10,Filter.Values的上限为5。参数不支持同时指定CustomerGatewayIds和Filters。 - //
  • customer-gateway-id - String - (过滤条件)用户网关唯一ID形如:`cgw-mgp33pll`。
  • - //
  • customer-gateway-name - String - (过滤条件)用户网关名称形如:`test-cgw`。
  • - //
  • ip-address - String - (过滤条件)公网地址形如:`58.211.1.12`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于Offset的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeCustomerGatewaysRequest struct { - *tchttp.BaseRequest - - // 对端网关ID,例如:cgw-2wqq41m9。每次请求的实例的上限为100。参数不支持同时指定CustomerGatewayIds和Filters。 - CustomerGatewayIds []*string `json:"CustomerGatewayIds,omitempty" name:"CustomerGatewayIds"` - - // 过滤条件,详见下表:实例过滤条件表。每次请求的Filters的上限为10,Filter.Values的上限为5。参数不支持同时指定CustomerGatewayIds和Filters。 - //
  • customer-gateway-id - String - (过滤条件)用户网关唯一ID形如:`cgw-mgp33pll`。
  • - //
  • customer-gateway-name - String - (过滤条件)用户网关名称形如:`test-cgw`。
  • - //
  • ip-address - String - (过滤条件)公网地址形如:`58.211.1.12`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于Offset的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeCustomerGatewaysRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCustomerGatewaysRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CustomerGatewayIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCustomerGatewaysRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeCustomerGatewaysResponseParams struct { - // 对端网关对象列表。 - CustomerGatewaySet []*CustomerGateway `json:"CustomerGatewaySet,omitempty" name:"CustomerGatewaySet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeCustomerGatewaysResponse struct { - *tchttp.BaseResponse - Response *DescribeCustomerGatewaysResponseParams `json:"Response"` -} - -func (r *DescribeCustomerGatewaysResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeCustomerGatewaysResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDhcpIpsRequestParams struct { - // DhcpIp实例ID。形如:dhcpip-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定DhcpIpIds和Filters。 - DhcpIpIds []*string `json:"DhcpIpIds,omitempty" name:"DhcpIpIds"` - - // 过滤条件,参数不支持同时指定DhcpIpIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • subnet-id - String - (过滤条件)所属子网实例ID,形如:subnet-f49l6u0z。
  • - //
  • dhcpip-id - String - (过滤条件)DhcpIp实例ID,形如:dhcpip-pxir56ns。
  • - //
  • dhcpip-name - String - (过滤条件)DhcpIp实例名称。
  • - //
  • address-ip - String - (过滤条件)DhcpIp实例的IP,根据IP精确查找。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeDhcpIpsRequest struct { - *tchttp.BaseRequest - - // DhcpIp实例ID。形如:dhcpip-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定DhcpIpIds和Filters。 - DhcpIpIds []*string `json:"DhcpIpIds,omitempty" name:"DhcpIpIds"` - - // 过滤条件,参数不支持同时指定DhcpIpIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • subnet-id - String - (过滤条件)所属子网实例ID,形如:subnet-f49l6u0z。
  • - //
  • dhcpip-id - String - (过滤条件)DhcpIp实例ID,形如:dhcpip-pxir56ns。
  • - //
  • dhcpip-name - String - (过滤条件)DhcpIp实例名称。
  • - //
  • address-ip - String - (过滤条件)DhcpIp实例的IP,根据IP精确查找。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeDhcpIpsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDhcpIpsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DhcpIpIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDhcpIpsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDhcpIpsResponseParams struct { - // 实例详细信息列表。 - DhcpIpSet []*DhcpIp `json:"DhcpIpSet,omitempty" name:"DhcpIpSet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeDhcpIpsResponse struct { - *tchttp.BaseResponse - Response *DescribeDhcpIpsResponseParams `json:"Response"` -} - -func (r *DescribeDhcpIpsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDhcpIpsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDirectConnectGatewayCcnRoutesRequestParams struct { - // 专线网关ID,形如:`dcg-prpqlmg1`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 云联网路由学习类型,可选值: - //
  • `BGP` - 自动学习。
  • - //
  • `STATIC` - 静态,即用户配置,默认值。
  • - CcnRouteType *string `json:"CcnRouteType,omitempty" name:"CcnRouteType"` - - // 偏移量。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeDirectConnectGatewayCcnRoutesRequest struct { - *tchttp.BaseRequest - - // 专线网关ID,形如:`dcg-prpqlmg1`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 云联网路由学习类型,可选值: - //
  • `BGP` - 自动学习。
  • - //
  • `STATIC` - 静态,即用户配置,默认值。
  • - CcnRouteType *string `json:"CcnRouteType,omitempty" name:"CcnRouteType"` - - // 偏移量。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeDirectConnectGatewayCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDirectConnectGatewayCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DirectConnectGatewayId") - delete(f, "CcnRouteType") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDirectConnectGatewayCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDirectConnectGatewayCcnRoutesResponseParams struct { - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 云联网路由(IDC网段)列表。 - RouteSet []*DirectConnectGatewayCcnRoute `json:"RouteSet,omitempty" name:"RouteSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeDirectConnectGatewayCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *DescribeDirectConnectGatewayCcnRoutesResponseParams `json:"Response"` -} - -func (r *DescribeDirectConnectGatewayCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDirectConnectGatewayCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDirectConnectGatewaysRequestParams struct { - // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 - DirectConnectGatewayIds []*string `json:"DirectConnectGatewayIds,omitempty" name:"DirectConnectGatewayIds"` - - // 过滤条件,参数不支持同时指定`DirectConnectGatewayIds`和`Filters`。 - //
  • direct-connect-gateway-id - String - 专线网关唯一`ID`,形如:`dcg-9o233uri`。
  • - //
  • direct-connect-gateway-name - String - 专线网关名称,默认模糊查询。
  • - //
  • direct-connect-gateway-ip - String - 专线网关`IP`。
  • - //
  • gateway-type - String - 网关类型,可选值:`NORMAL`(普通型)、`NAT`(NAT型)。
  • - //
  • network-type- String - 网络类型,可选值:`VPC`(私有网络类型)、`CCN`(云联网类型)。
  • - //
  • ccn-id - String - 专线网关所在云联网`ID`。
  • - //
  • vpc-id - String - 专线网关所在私有网络`ID`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeDirectConnectGatewaysRequest struct { - *tchttp.BaseRequest - - // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 - DirectConnectGatewayIds []*string `json:"DirectConnectGatewayIds,omitempty" name:"DirectConnectGatewayIds"` - - // 过滤条件,参数不支持同时指定`DirectConnectGatewayIds`和`Filters`。 - //
  • direct-connect-gateway-id - String - 专线网关唯一`ID`,形如:`dcg-9o233uri`。
  • - //
  • direct-connect-gateway-name - String - 专线网关名称,默认模糊查询。
  • - //
  • direct-connect-gateway-ip - String - 专线网关`IP`。
  • - //
  • gateway-type - String - 网关类型,可选值:`NORMAL`(普通型)、`NAT`(NAT型)。
  • - //
  • network-type- String - 网络类型,可选值:`VPC`(私有网络类型)、`CCN`(云联网类型)。
  • - //
  • ccn-id - String - 专线网关所在云联网`ID`。
  • - //
  • vpc-id - String - 专线网关所在私有网络`ID`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeDirectConnectGatewaysRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDirectConnectGatewaysRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DirectConnectGatewayIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDirectConnectGatewaysRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeDirectConnectGatewaysResponseParams struct { - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 专线网关对象数组。 - DirectConnectGatewaySet []*DirectConnectGateway `json:"DirectConnectGatewaySet,omitempty" name:"DirectConnectGatewaySet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeDirectConnectGatewaysResponse struct { - *tchttp.BaseResponse - Response *DescribeDirectConnectGatewaysResponseParams `json:"Response"` -} - -func (r *DescribeDirectConnectGatewaysResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeDirectConnectGatewaysResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeFlowLogRequestParams struct { - // 私用网络ID或者统一ID,建议使用统一ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` -} - -type DescribeFlowLogRequest struct { - *tchttp.BaseRequest - - // 私用网络ID或者统一ID,建议使用统一ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` -} - -func (r *DescribeFlowLogRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeFlowLogRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "FlowLogId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeFlowLogRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeFlowLogResponseParams struct { - // 流日志信息。 - FlowLog []*FlowLog `json:"FlowLog,omitempty" name:"FlowLog"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeFlowLogResponse struct { - *tchttp.BaseResponse - Response *DescribeFlowLogResponseParams `json:"Response"` -} - -func (r *DescribeFlowLogResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeFlowLogResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeFlowLogsRequestParams struct { - // 私用网络ID或者统一ID,建议使用统一ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` - - // 流日志实例名字。 - FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` - - // 流日志所属资源类型,VPC|SUBNET|NETWORKINTERFACE。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源唯一ID。 - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 流日志采集类型,ACCEPT|REJECT|ALL。 - TrafficType *string `json:"TrafficType,omitempty" name:"TrafficType"` - - // 流日志存储ID。 - CloudLogId *string `json:"CloudLogId,omitempty" name:"CloudLogId"` - - // 流日志存储ID状态。 - CloudLogState *string `json:"CloudLogState,omitempty" name:"CloudLogState"` - - // 按某个字段排序,支持字段:flowLogName,createTime,默认按createTime。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 升序(asc)还是降序(desc),默认:desc。 - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 每页行数,默认为10。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤条件,参数不支持同时指定FlowLogId和Filters。 - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。
  • - Filters *Filter `json:"Filters,omitempty" name:"Filters"` - - // 流日志存储ID对应的地域信息。 - CloudLogRegion *string `json:"CloudLogRegion,omitempty" name:"CloudLogRegion"` -} - -type DescribeFlowLogsRequest struct { - *tchttp.BaseRequest - - // 私用网络ID或者统一ID,建议使用统一ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` - - // 流日志实例名字。 - FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` - - // 流日志所属资源类型,VPC|SUBNET|NETWORKINTERFACE。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源唯一ID。 - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 流日志采集类型,ACCEPT|REJECT|ALL。 - TrafficType *string `json:"TrafficType,omitempty" name:"TrafficType"` - - // 流日志存储ID。 - CloudLogId *string `json:"CloudLogId,omitempty" name:"CloudLogId"` - - // 流日志存储ID状态。 - CloudLogState *string `json:"CloudLogState,omitempty" name:"CloudLogState"` - - // 按某个字段排序,支持字段:flowLogName,createTime,默认按createTime。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 升序(asc)还是降序(desc),默认:desc。 - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 每页行数,默认为10。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤条件,参数不支持同时指定FlowLogId和Filters。 - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。
  • - Filters *Filter `json:"Filters,omitempty" name:"Filters"` - - // 流日志存储ID对应的地域信息。 - CloudLogRegion *string `json:"CloudLogRegion,omitempty" name:"CloudLogRegion"` -} - -func (r *DescribeFlowLogsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeFlowLogsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "FlowLogId") - delete(f, "FlowLogName") - delete(f, "ResourceType") - delete(f, "ResourceId") - delete(f, "TrafficType") - delete(f, "CloudLogId") - delete(f, "CloudLogState") - delete(f, "OrderField") - delete(f, "OrderDirection") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "Filters") - delete(f, "CloudLogRegion") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeFlowLogsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeFlowLogsResponseParams struct { - // 流日志实例集合。 - FlowLog []*FlowLog `json:"FlowLog,omitempty" name:"FlowLog"` - - // 流日志总数目。 - TotalNum *uint64 `json:"TotalNum,omitempty" name:"TotalNum"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeFlowLogsResponse struct { - *tchttp.BaseResponse - Response *DescribeFlowLogsResponseParams `json:"Response"` -} - -func (r *DescribeFlowLogsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeFlowLogsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeGatewayFlowMonitorDetailRequestParams struct { - // 时间点。表示要查询这分钟内的明细。如:`2019-02-28 18:15:20`,将查询 `18:15` 这一分钟内的明细。 - TimePoint *string `json:"TimePoint,omitempty" name:"TimePoint"` - - // VPN网关实例ID,形如:`vpn-ltjahce6`。 - VpnId *string `json:"VpnId,omitempty" name:"VpnId"` - - // 专线网关实例ID,形如:`dcg-ltjahce6`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 对等连接实例ID,形如:`pcx-ltjahce6`。 - PeeringConnectionId *string `json:"PeeringConnectionId,omitempty" name:"PeeringConnectionId"` - - // NAT网关实例ID,形如:`nat-ltjahce6`。 - NatId *string `json:"NatId,omitempty" name:"NatId"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 排序字段。支持 `InPkg` `OutPkg` `InTraffic` `OutTraffic`。默认值`OutTraffic`。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方法。顺序:`ASC`,倒序:`DESC`。默认值`DESC`。 - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -type DescribeGatewayFlowMonitorDetailRequest struct { - *tchttp.BaseRequest - - // 时间点。表示要查询这分钟内的明细。如:`2019-02-28 18:15:20`,将查询 `18:15` 这一分钟内的明细。 - TimePoint *string `json:"TimePoint,omitempty" name:"TimePoint"` - - // VPN网关实例ID,形如:`vpn-ltjahce6`。 - VpnId *string `json:"VpnId,omitempty" name:"VpnId"` - - // 专线网关实例ID,形如:`dcg-ltjahce6`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 对等连接实例ID,形如:`pcx-ltjahce6`。 - PeeringConnectionId *string `json:"PeeringConnectionId,omitempty" name:"PeeringConnectionId"` - - // NAT网关实例ID,形如:`nat-ltjahce6`。 - NatId *string `json:"NatId,omitempty" name:"NatId"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 排序字段。支持 `InPkg` `OutPkg` `InTraffic` `OutTraffic`。默认值`OutTraffic`。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方法。顺序:`ASC`,倒序:`DESC`。默认值`DESC`。 - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -func (r *DescribeGatewayFlowMonitorDetailRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeGatewayFlowMonitorDetailRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TimePoint") - delete(f, "VpnId") - delete(f, "DirectConnectGatewayId") - delete(f, "PeeringConnectionId") - delete(f, "NatId") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "OrderField") - delete(f, "OrderDirection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeGatewayFlowMonitorDetailRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeGatewayFlowMonitorDetailResponseParams struct { - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 网关流量监控明细。 - GatewayFlowMonitorDetailSet []*GatewayFlowMonitorDetail `json:"GatewayFlowMonitorDetailSet,omitempty" name:"GatewayFlowMonitorDetailSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeGatewayFlowMonitorDetailResponse struct { - *tchttp.BaseResponse - Response *DescribeGatewayFlowMonitorDetailResponseParams `json:"Response"` -} - -func (r *DescribeGatewayFlowMonitorDetailResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeGatewayFlowMonitorDetailResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeGatewayFlowQosRequestParams struct { - // 网关实例ID,目前我们支持的网关实例类型有, - // 专线网关实例ID,形如,`dcg-ltjahce6`; - // Nat网关实例ID,形如,`nat-ltjahce6`; - // VPN网关实例ID,形如,`vpn-ltjahce6`。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` - - // 限流的云服务器内网IP。 - IpAddresses []*string `json:"IpAddresses,omitempty" name:"IpAddresses"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeGatewayFlowQosRequest struct { - *tchttp.BaseRequest - - // 网关实例ID,目前我们支持的网关实例类型有, - // 专线网关实例ID,形如,`dcg-ltjahce6`; - // Nat网关实例ID,形如,`nat-ltjahce6`; - // VPN网关实例ID,形如,`vpn-ltjahce6`。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` - - // 限流的云服务器内网IP。 - IpAddresses []*string `json:"IpAddresses,omitempty" name:"IpAddresses"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeGatewayFlowQosRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeGatewayFlowQosRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "GatewayId") - delete(f, "IpAddresses") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeGatewayFlowQosRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeGatewayFlowQosResponseParams struct { - // 实例详细信息列表。 - GatewayQosSet []*GatewayQos `json:"GatewayQosSet,omitempty" name:"GatewayQosSet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeGatewayFlowQosResponse struct { - *tchttp.BaseResponse - Response *DescribeGatewayFlowQosResponseParams `json:"Response"` -} - -func (r *DescribeGatewayFlowQosResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeGatewayFlowQosResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeHaVipsRequestParams struct { - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 - HaVipIds []*string `json:"HaVipIds,omitempty" name:"HaVipIds"` - - // 过滤条件,参数不支持同时指定`HaVipIds`和`Filters`。 - //
  • havip-id - String - `HAVIP`唯一`ID`,形如:`havip-9o233uri`。
  • - //
  • havip-name - String - `HAVIP`名称。
  • - //
  • vpc-id - String - `HAVIP`所在私有网络`ID`。
  • - //
  • subnet-id - String - `HAVIP`所在子网`ID`。
  • - //
  • vip - String - `HAVIP`的地址`VIP`。
  • - //
  • address-ip - String - `HAVIP`绑定的弹性公网`IP`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeHaVipsRequest struct { - *tchttp.BaseRequest - - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 - HaVipIds []*string `json:"HaVipIds,omitempty" name:"HaVipIds"` - - // 过滤条件,参数不支持同时指定`HaVipIds`和`Filters`。 - //
  • havip-id - String - `HAVIP`唯一`ID`,形如:`havip-9o233uri`。
  • - //
  • havip-name - String - `HAVIP`名称。
  • - //
  • vpc-id - String - `HAVIP`所在私有网络`ID`。
  • - //
  • subnet-id - String - `HAVIP`所在子网`ID`。
  • - //
  • vip - String - `HAVIP`的地址`VIP`。
  • - //
  • address-ip - String - `HAVIP`绑定的弹性公网`IP`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeHaVipsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeHaVipsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HaVipIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeHaVipsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeHaVipsResponseParams struct { - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // `HAVIP`对象数组。 - HaVipSet []*HaVip `json:"HaVipSet,omitempty" name:"HaVipSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeHaVipsResponse struct { - *tchttp.BaseResponse - Response *DescribeHaVipsResponseParams `json:"Response"` -} - -func (r *DescribeHaVipsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeHaVipsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIp6AddressesRequestParams struct { - // 标识 IPV6 的唯一 ID 列表。IPV6 唯一 ID 形如:`eip-11112222`。参数不支持同时指定`Ip6AddressIds`和`Filters`。 - Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AddressIds`和`Filters`。详细的过滤条件如下: - //
  • address-ip - String - 是否必填:否 - (过滤条件)按照 EIP 的 IP 地址过滤。
  • - //
  • network-interface-id - String - 是否必填:否 - (过滤条件)按照弹性网卡的唯一ID过滤。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeIp6AddressesRequest struct { - *tchttp.BaseRequest - - // 标识 IPV6 的唯一 ID 列表。IPV6 唯一 ID 形如:`eip-11112222`。参数不支持同时指定`Ip6AddressIds`和`Filters`。 - Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AddressIds`和`Filters`。详细的过滤条件如下: - //
  • address-ip - String - 是否必填:否 - (过滤条件)按照 EIP 的 IP 地址过滤。
  • - //
  • network-interface-id - String - 是否必填:否 - (过滤条件)按照弹性网卡的唯一ID过滤。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeIp6AddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIp6AddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6AddressIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeIp6AddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIp6AddressesResponseParams struct { - // 符合条件的 IPV6 数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // IPV6 详细信息列表。 - AddressSet []*Address `json:"AddressSet,omitempty" name:"AddressSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeIp6AddressesResponse struct { - *tchttp.BaseResponse - Response *DescribeIp6AddressesResponseParams `json:"Response"` -} - -func (r *DescribeIp6AddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIp6AddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIp6TranslatorQuotaRequestParams struct { - // 待查询IPV6转换实例的唯一ID列表,形如ip6-xxxxxxxx - Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds"` -} - -type DescribeIp6TranslatorQuotaRequest struct { - *tchttp.BaseRequest - - // 待查询IPV6转换实例的唯一ID列表,形如ip6-xxxxxxxx - Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds"` -} - -func (r *DescribeIp6TranslatorQuotaRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIp6TranslatorQuotaRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6TranslatorIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeIp6TranslatorQuotaRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIp6TranslatorQuotaResponseParams struct { - // 账户在指定地域的IPV6转换实例及规则配额信息 - // QUOTAID属性是TOTAL_TRANSLATOR_QUOTA,表示账户在指定地域的IPV6转换实例配额信息;QUOTAID属性是IPV6转换实例唯一ID(形如ip6-xxxxxxxx),表示账户在该转换实例允许创建的转换规则配额 - QuotaSet []*Quota `json:"QuotaSet,omitempty" name:"QuotaSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeIp6TranslatorQuotaResponse struct { - *tchttp.BaseResponse - Response *DescribeIp6TranslatorQuotaResponseParams `json:"Response"` -} - -func (r *DescribeIp6TranslatorQuotaResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIp6TranslatorQuotaResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIp6TranslatorsRequestParams struct { - // IPV6转换实例唯一ID数组,形如ip6-xxxxxxxx - Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`Ip6TranslatorIds`和`Filters`。详细的过滤条件如下: - //
  • ip6-translator-id - String - 是否必填:否 - (过滤条件)按照IPV6转换实例的唯一ID过滤,形如ip6-xxxxxxx。
  • - //
  • ip6-translator-vip6 - String - 是否必填:否 - (过滤条件)按照IPV6地址过滤。不支持模糊过滤。
  • - //
  • ip6-translator-name - String - 是否必填:否 - (过滤条件)按照IPV6转换实例名称过滤。不支持模糊过滤。
  • - //
  • ip6-translator-status - String - 是否必填:否 - (过滤条件)按照IPV6转换实例的状态过滤。状态取值范围为"CREATING","RUNNING","DELETING","MODIFYING" - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeIp6TranslatorsRequest struct { - *tchttp.BaseRequest - - // IPV6转换实例唯一ID数组,形如ip6-xxxxxxxx - Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`Ip6TranslatorIds`和`Filters`。详细的过滤条件如下: - //
  • ip6-translator-id - String - 是否必填:否 - (过滤条件)按照IPV6转换实例的唯一ID过滤,形如ip6-xxxxxxx。
  • - //
  • ip6-translator-vip6 - String - 是否必填:否 - (过滤条件)按照IPV6地址过滤。不支持模糊过滤。
  • - //
  • ip6-translator-name - String - 是否必填:否 - (过滤条件)按照IPV6转换实例名称过滤。不支持模糊过滤。
  • - //
  • ip6-translator-status - String - 是否必填:否 - (过滤条件)按照IPV6转换实例的状态过滤。状态取值范围为"CREATING","RUNNING","DELETING","MODIFYING" - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeIp6TranslatorsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIp6TranslatorsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6TranslatorIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeIp6TranslatorsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIp6TranslatorsResponseParams struct { - // 符合过滤条件的IPV6转换实例数量。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 符合过滤条件的IPV6转换实例详细信息 - Ip6TranslatorSet []*Ip6Translator `json:"Ip6TranslatorSet,omitempty" name:"Ip6TranslatorSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeIp6TranslatorsResponse struct { - *tchttp.BaseResponse - Response *DescribeIp6TranslatorsResponseParams `json:"Response"` -} - -func (r *DescribeIp6TranslatorsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIp6TranslatorsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIpGeolocationDatabaseUrlRequestParams struct { - // IP地理位置库协议类型,目前仅支持"ipv4"。 - Type *string `json:"Type,omitempty" name:"Type"` -} - -type DescribeIpGeolocationDatabaseUrlRequest struct { - *tchttp.BaseRequest - - // IP地理位置库协议类型,目前仅支持"ipv4"。 - Type *string `json:"Type,omitempty" name:"Type"` -} - -func (r *DescribeIpGeolocationDatabaseUrlRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIpGeolocationDatabaseUrlRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Type") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeIpGeolocationDatabaseUrlRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIpGeolocationDatabaseUrlResponseParams struct { - // IP地理位置库下载链接地址。 - DownLoadUrl *string `json:"DownLoadUrl,omitempty" name:"DownLoadUrl"` - - // 链接到期时间。按照`ISO8601`标准表示,并且使用`UTC`时间。 - ExpiredAt *string `json:"ExpiredAt,omitempty" name:"ExpiredAt"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeIpGeolocationDatabaseUrlResponse struct { - *tchttp.BaseResponse - Response *DescribeIpGeolocationDatabaseUrlResponseParams `json:"Response"` -} - -func (r *DescribeIpGeolocationDatabaseUrlResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIpGeolocationDatabaseUrlResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIpGeolocationInfosRequestParams struct { - // 需查询的IP地址列表,目前仅支持IPv4地址。查询的IP地址数量上限为100个。 - AddressIps []*string `json:"AddressIps,omitempty" name:"AddressIps"` - - // 需查询的IP地址的字段信息。 - Fields *IpField `json:"Fields,omitempty" name:"Fields"` -} - -type DescribeIpGeolocationInfosRequest struct { - *tchttp.BaseRequest - - // 需查询的IP地址列表,目前仅支持IPv4地址。查询的IP地址数量上限为100个。 - AddressIps []*string `json:"AddressIps,omitempty" name:"AddressIps"` - - // 需查询的IP地址的字段信息。 - Fields *IpField `json:"Fields,omitempty" name:"Fields"` -} - -func (r *DescribeIpGeolocationInfosRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIpGeolocationInfosRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressIps") - delete(f, "Fields") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeIpGeolocationInfosRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeIpGeolocationInfosResponseParams struct { - // IP地址信息列表。 - AddressInfo []*IpGeolocationInfo `json:"AddressInfo,omitempty" name:"AddressInfo"` - - // IP地址信息个数。 - Total *int64 `json:"Total,omitempty" name:"Total"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeIpGeolocationInfosResponse struct { - *tchttp.BaseResponse - Response *DescribeIpGeolocationInfosResponseParams `json:"Response"` -} - -func (r *DescribeIpGeolocationInfosResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeIpGeolocationInfosResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLocalGatewayRequestParams struct { - // 查询条件: - // vpc-id:按照VPCID过滤,local-gateway-name:按照本地网关名称过滤,名称支持模糊搜索,local-gateway-id:按照本地网关实例ID过滤,cdc-id:按照cdc实例ID过滤查询。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeLocalGatewayRequest struct { - *tchttp.BaseRequest - - // 查询条件: - // vpc-id:按照VPCID过滤,local-gateway-name:按照本地网关名称过滤,名称支持模糊搜索,local-gateway-id:按照本地网关实例ID过滤,cdc-id:按照cdc实例ID过滤查询。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeLocalGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLocalGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeLocalGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeLocalGatewayResponseParams struct { - // 本地网关信息集合。 - LocalGatewaySet []*LocalGateway `json:"LocalGatewaySet,omitempty" name:"LocalGatewaySet"` - - // 本地网关总数。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeLocalGatewayResponse struct { - *tchttp.BaseResponse - Response *DescribeLocalGatewayResponseParams `json:"Response"` -} - -func (r *DescribeLocalGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeLocalGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNatGatewayDestinationIpPortTranslationNatRulesRequestParams struct { - // NAT网关ID。 - NatGatewayIds []*string `json:"NatGatewayIds,omitempty" name:"NatGatewayIds"` - - // 过滤条件: - // 参数不支持同时指定NatGatewayIds和Filters。每次请求的Filters的上限为10,Filter.Values的上限为5 - //
  • nat-gateway-id,NAT网关的ID,如`nat-0yi4hekt`
  • - //
  • vpc-id,私有网络VPC的ID,如`vpc-0yi4hekt`
  • - //
  • public-ip-address, 弹性IP,如`139.199.232.238`。
  • - //
  • public-port, 公网端口。
  • - //
  • private-ip-address, 内网IP,如`10.0.0.1`。
  • - //
  • private-port, 内网端口。
  • - //
  • description,规则描述。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest struct { - *tchttp.BaseRequest - - // NAT网关ID。 - NatGatewayIds []*string `json:"NatGatewayIds,omitempty" name:"NatGatewayIds"` - - // 过滤条件: - // 参数不支持同时指定NatGatewayIds和Filters。每次请求的Filters的上限为10,Filter.Values的上限为5 - //
  • nat-gateway-id,NAT网关的ID,如`nat-0yi4hekt`
  • - //
  • vpc-id,私有网络VPC的ID,如`vpc-0yi4hekt`
  • - //
  • public-ip-address, 弹性IP,如`139.199.232.238`。
  • - //
  • public-port, 公网端口。
  • - //
  • private-ip-address, 内网IP,如`10.0.0.1`。
  • - //
  • private-port, 内网端口。
  • - //
  • description,规则描述。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNatGatewayDestinationIpPortTranslationNatRulesResponseParams struct { - // NAT网关端口转发规则对象数组。 - NatGatewayDestinationIpPortTranslationNatRuleSet []*NatGatewayDestinationIpPortTranslationNatRule `json:"NatGatewayDestinationIpPortTranslationNatRuleSet,omitempty" name:"NatGatewayDestinationIpPortTranslationNatRuleSet"` - - // 符合条件的NAT网关端口转发规则对象数目。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse struct { - *tchttp.BaseResponse - Response *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponseParams `json:"Response"` -} - -func (r *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNatGatewayDirectConnectGatewayRouteRequestParams struct { - // nat的唯一标识 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // vpc的唯一标识 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 0到200之间 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - // 大于0 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` -} - -type DescribeNatGatewayDirectConnectGatewayRouteRequest struct { - *tchttp.BaseRequest - - // nat的唯一标识 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // vpc的唯一标识 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 0到200之间 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - // 大于0 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` -} - -func (r *DescribeNatGatewayDirectConnectGatewayRouteRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNatGatewayDirectConnectGatewayRouteRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "VpcId") - delete(f, "Limit") - delete(f, "Offset") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNatGatewayDirectConnectGatewayRouteRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNatGatewayDirectConnectGatewayRouteResponseParams struct { - // 路由数据 - NatDirectConnectGatewayRouteSet []*NatDirectConnectGatewayRoute `json:"NatDirectConnectGatewayRouteSet,omitempty" name:"NatDirectConnectGatewayRouteSet"` - - // 路由总数 - Total *int64 `json:"Total,omitempty" name:"Total"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNatGatewayDirectConnectGatewayRouteResponse struct { - *tchttp.BaseResponse - Response *DescribeNatGatewayDirectConnectGatewayRouteResponseParams `json:"Response"` -} - -func (r *DescribeNatGatewayDirectConnectGatewayRouteResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNatGatewayDirectConnectGatewayRouteResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNatGatewaySourceIpTranslationNatRulesRequestParams struct { - // NAT网关统一 ID,形如:`nat-123xx454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 过滤条件: - //
  • resource-id,Subnet的ID或者Cvm ID,如`subnet-0yi4hekt`
  • - //
  • public-ip-address,弹性IP,如`139.199.232.238`
  • - //
  • description,规则描述。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeNatGatewaySourceIpTranslationNatRulesRequest struct { - *tchttp.BaseRequest - - // NAT网关统一 ID,形如:`nat-123xx454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 过滤条件: - //
  • resource-id,Subnet的ID或者Cvm ID,如`subnet-0yi4hekt`
  • - //
  • public-ip-address,弹性IP,如`139.199.232.238`
  • - //
  • description,规则描述。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeNatGatewaySourceIpTranslationNatRulesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNatGatewaySourceIpTranslationNatRulesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNatGatewaySourceIpTranslationNatRulesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNatGatewaySourceIpTranslationNatRulesResponseParams struct { - // NAT网关SNAT规则对象数组。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SourceIpTranslationNatRuleSet []*SourceIpTranslationNatRule `json:"SourceIpTranslationNatRuleSet,omitempty" name:"SourceIpTranslationNatRuleSet"` - - // 符合条件的NAT网关端口转发规则对象数目。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNatGatewaySourceIpTranslationNatRulesResponse struct { - *tchttp.BaseResponse - Response *DescribeNatGatewaySourceIpTranslationNatRulesResponseParams `json:"Response"` -} - -func (r *DescribeNatGatewaySourceIpTranslationNatRulesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNatGatewaySourceIpTranslationNatRulesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNatGatewaysRequestParams struct { - // NAT网关统一 ID,形如:`nat-123xx454`。每次请求的实例上限为100。参数不支持同时指定NatGatewayIds和Filters。 - NatGatewayIds []*string `json:"NatGatewayIds,omitempty" name:"NatGatewayIds"` - - // 过滤条件,参数不支持同时指定NatGatewayIds和Filters。每次请求的Filters的上限为10,Filter.Values的上限为5。 - //
  • nat-gateway-id - String - (过滤条件)协议端口模板实例ID,形如:`nat-123xx454`。
  • - //
  • vpc-id - String - (过滤条件)私有网络 唯一ID,形如:`vpc-123xx454`。
  • - //
  • nat-gateway-name - String - (过滤条件)协议端口模板实例ID,形如:`test_nat`。
  • - //
  • tag-key - String - (过滤条件)标签键,形如:`test-key`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeNatGatewaysRequest struct { - *tchttp.BaseRequest - - // NAT网关统一 ID,形如:`nat-123xx454`。每次请求的实例上限为100。参数不支持同时指定NatGatewayIds和Filters。 - NatGatewayIds []*string `json:"NatGatewayIds,omitempty" name:"NatGatewayIds"` - - // 过滤条件,参数不支持同时指定NatGatewayIds和Filters。每次请求的Filters的上限为10,Filter.Values的上限为5。 - //
  • nat-gateway-id - String - (过滤条件)协议端口模板实例ID,形如:`nat-123xx454`。
  • - //
  • vpc-id - String - (过滤条件)私有网络 唯一ID,形如:`vpc-123xx454`。
  • - //
  • nat-gateway-name - String - (过滤条件)协议端口模板实例ID,形如:`test_nat`。
  • - //
  • tag-key - String - (过滤条件)标签键,形如:`test-key`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeNatGatewaysRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNatGatewaysRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNatGatewaysRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNatGatewaysResponseParams struct { - // NAT网关对象数组。 - NatGatewaySet []*NatGateway `json:"NatGatewaySet,omitempty" name:"NatGatewaySet"` - - // 符合条件的NAT网关对象个数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNatGatewaysResponse struct { - *tchttp.BaseResponse - Response *DescribeNatGatewaysResponseParams `json:"Response"` -} - -func (r *DescribeNatGatewaysResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNatGatewaysResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetDetectStatesRequestParams struct { - // 网络探测实例`ID`数组。形如:[`netd-12345678`]。 - NetDetectIds []*string `json:"NetDetectIds,omitempty" name:"NetDetectIds"` - - // 过滤条件,参数不支持同时指定NetDetectIds和Filters。 - //
  • net-detect-id - String - (过滤条件)网络探测实例ID,形如:netd-12345678。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeNetDetectStatesRequest struct { - *tchttp.BaseRequest - - // 网络探测实例`ID`数组。形如:[`netd-12345678`]。 - NetDetectIds []*string `json:"NetDetectIds,omitempty" name:"NetDetectIds"` - - // 过滤条件,参数不支持同时指定NetDetectIds和Filters。 - //
  • net-detect-id - String - (过滤条件)网络探测实例ID,形如:netd-12345678。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeNetDetectStatesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetDetectStatesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetDetectIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNetDetectStatesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetDetectStatesResponseParams struct { - // 符合条件的网络探测验证结果对象数组。 - // 注意:此字段可能返回 null,表示取不到有效值。 - NetDetectStateSet []*NetDetectState `json:"NetDetectStateSet,omitempty" name:"NetDetectStateSet"` - - // 符合条件的网络探测验证结果对象数量。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNetDetectStatesResponse struct { - *tchttp.BaseResponse - Response *DescribeNetDetectStatesResponseParams `json:"Response"` -} - -func (r *DescribeNetDetectStatesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetDetectStatesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetDetectsRequestParams struct { - // 网络探测实例`ID`数组。形如:[`netd-12345678`]。 - NetDetectIds []*string `json:"NetDetectIds,omitempty" name:"NetDetectIds"` - - // 过滤条件,参数不支持同时指定NetDetectIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-12345678
  • - //
  • net-detect-id - String - (过滤条件)网络探测实例ID,形如:netd-12345678
  • - //
  • subnet-id - String - (过滤条件)子网实例ID,形如:subnet-12345678
  • - //
  • net-detect-name - String - (过滤条件)网络探测名称
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeNetDetectsRequest struct { - *tchttp.BaseRequest - - // 网络探测实例`ID`数组。形如:[`netd-12345678`]。 - NetDetectIds []*string `json:"NetDetectIds,omitempty" name:"NetDetectIds"` - - // 过滤条件,参数不支持同时指定NetDetectIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-12345678
  • - //
  • net-detect-id - String - (过滤条件)网络探测实例ID,形如:netd-12345678
  • - //
  • subnet-id - String - (过滤条件)子网实例ID,形如:subnet-12345678
  • - //
  • net-detect-name - String - (过滤条件)网络探测名称
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeNetDetectsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetDetectsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetDetectIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNetDetectsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetDetectsResponseParams struct { - // 符合条件的网络探测对象数组。 - // 注意:此字段可能返回 null,表示取不到有效值。 - NetDetectSet []*NetDetect `json:"NetDetectSet,omitempty" name:"NetDetectSet"` - - // 符合条件的网络探测对象数量。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNetDetectsResponse struct { - *tchttp.BaseResponse - Response *DescribeNetDetectsResponseParams `json:"Response"` -} - -func (r *DescribeNetDetectsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetDetectsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkAccountTypeRequestParams struct { -} - -type DescribeNetworkAccountTypeRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeNetworkAccountTypeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkAccountTypeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNetworkAccountTypeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkAccountTypeResponseParams struct { - // 用户账号的网络类型,STANDARD为标准用户,LEGACY为传统用户 - NetworkAccountType *string `json:"NetworkAccountType,omitempty" name:"NetworkAccountType"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNetworkAccountTypeResponse struct { - *tchttp.BaseResponse - Response *DescribeNetworkAccountTypeResponseParams `json:"Response"` -} - -func (r *DescribeNetworkAccountTypeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkAccountTypeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkAclQuintupleEntriesRequestParams struct { - // 网络ACL实例ID。形如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最小值为1,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤条件,参数不支持同时指定`HaVipIds`和`Filters`。 - //
  • protocol - String - 协议,形如:`TCP`。
  • - //
  • description - String - 描述。
  • - //
  • destination-cidr - String - 目的CIDR, 形如:'192.168.0.0/24'。
  • - //
  • source-cidr- String - 源CIDR, 形如:'192.168.0.0/24'。
  • - //
  • action - String - 动作,形如ACCEPT或DROP。
  • - //
  • network-acl-quintuple-entry-id - String - 五元组唯一ID,形如:'acli45-ahnu4rv5'。
  • - //
  • network-acl-direction - String - 方向,形如:'INGRESS'或'EGRESS'。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeNetworkAclQuintupleEntriesRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。形如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最小值为1,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤条件,参数不支持同时指定`HaVipIds`和`Filters`。 - //
  • protocol - String - 协议,形如:`TCP`。
  • - //
  • description - String - 描述。
  • - //
  • destination-cidr - String - 目的CIDR, 形如:'192.168.0.0/24'。
  • - //
  • source-cidr- String - 源CIDR, 形如:'192.168.0.0/24'。
  • - //
  • action - String - 动作,形如ACCEPT或DROP。
  • - //
  • network-acl-quintuple-entry-id - String - 五元组唯一ID,形如:'acli45-ahnu4rv5'。
  • - //
  • network-acl-direction - String - 方向,形如:'INGRESS'或'EGRESS'。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeNetworkAclQuintupleEntriesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkAclQuintupleEntriesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNetworkAclQuintupleEntriesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkAclQuintupleEntriesResponseParams struct { - // 网络ACL条目列表(NetworkAclTuple5Entry) - NetworkAclQuintupleSet []*NetworkAclQuintupleEntry `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNetworkAclQuintupleEntriesResponse struct { - *tchttp.BaseResponse - Response *DescribeNetworkAclQuintupleEntriesResponseParams `json:"Response"` -} - -func (r *DescribeNetworkAclQuintupleEntriesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkAclQuintupleEntriesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkAclsRequestParams struct { - // 过滤条件,参数不支持同时指定NetworkAclIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-12345678。
  • - //
  • network-acl-id - String - (过滤条件)网络ACL实例ID,形如:acl-12345678。
  • - //
  • network-acl-name - String - (过滤条件)网络ACL实例名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 网络ACL实例ID数组。形如:[acl-12345678]。每次请求的实例的上限为100。参数不支持同时指定NetworkAclIds和Filters。 - NetworkAclIds []*string `json:"NetworkAclIds,omitempty" name:"NetworkAclIds"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最小值为1,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeNetworkAclsRequest struct { - *tchttp.BaseRequest - - // 过滤条件,参数不支持同时指定NetworkAclIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-12345678。
  • - //
  • network-acl-id - String - (过滤条件)网络ACL实例ID,形如:acl-12345678。
  • - //
  • network-acl-name - String - (过滤条件)网络ACL实例名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 网络ACL实例ID数组。形如:[acl-12345678]。每次请求的实例的上限为100。参数不支持同时指定NetworkAclIds和Filters。 - NetworkAclIds []*string `json:"NetworkAclIds,omitempty" name:"NetworkAclIds"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最小值为1,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeNetworkAclsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkAclsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "NetworkAclIds") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNetworkAclsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkAclsResponseParams struct { - // 实例详细信息列表。 - NetworkAclSet []*NetworkAcl `json:"NetworkAclSet,omitempty" name:"NetworkAclSet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNetworkAclsResponse struct { - *tchttp.BaseResponse - Response *DescribeNetworkAclsResponseParams `json:"Response"` -} - -func (r *DescribeNetworkAclsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkAclsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkInterfaceLimitRequestParams struct { - // 要查询的CVM实例ID或弹性网卡ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -type DescribeNetworkInterfaceLimitRequest struct { - *tchttp.BaseRequest - - // 要查询的CVM实例ID或弹性网卡ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -func (r *DescribeNetworkInterfaceLimitRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkInterfaceLimitRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNetworkInterfaceLimitRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkInterfaceLimitResponseParams struct { - // 标准型弹性网卡配额。 - EniQuantity *int64 `json:"EniQuantity,omitempty" name:"EniQuantity"` - - // 每个标准型弹性网卡可以分配的IP配额。 - EniPrivateIpAddressQuantity *int64 `json:"EniPrivateIpAddressQuantity,omitempty" name:"EniPrivateIpAddressQuantity"` - - // 扩展型网卡配额。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ExtendEniQuantity *int64 `json:"ExtendEniQuantity,omitempty" name:"ExtendEniQuantity"` - - // 每个扩展型弹性网卡可以分配的IP配额。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ExtendEniPrivateIpAddressQuantity *int64 `json:"ExtendEniPrivateIpAddressQuantity,omitempty" name:"ExtendEniPrivateIpAddressQuantity"` - - // 中继网卡配额。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SubEniQuantity *int64 `json:"SubEniQuantity,omitempty" name:"SubEniQuantity"` - - // 每个中继网卡可以分配的IP配额。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SubEniPrivateIpAddressQuantity *int64 `json:"SubEniPrivateIpAddressQuantity,omitempty" name:"SubEniPrivateIpAddressQuantity"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNetworkInterfaceLimitResponse struct { - *tchttp.BaseResponse - Response *DescribeNetworkInterfaceLimitResponseParams `json:"Response"` -} - -func (r *DescribeNetworkInterfaceLimitResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkInterfaceLimitResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkInterfacesRequestParams struct { - // 弹性网卡实例ID查询。形如:eni-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定NetworkInterfaceIds和Filters。 - NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds"` - - // 过滤条件,参数不支持同时指定NetworkInterfaceIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • subnet-id - String - (过滤条件)所属子网实例ID,形如:subnet-f49l6u0z。
  • - //
  • network-interface-id - String - (过滤条件)弹性网卡实例ID,形如:eni-5k56k7k7。
  • - //
  • attachment.instance-id - String - (过滤条件)绑定的云服务器实例ID,形如:ins-3nqpdn3i。
  • - //
  • groups.security-group-id - String - (过滤条件)绑定的安全组实例ID,例如:sg-f9ekbxeq。
  • - //
  • network-interface-name - String - (过滤条件)网卡实例名称。
  • - //
  • network-interface-description - String - (过滤条件)网卡实例描述。
  • - //
  • address-ip - String - (过滤条件)内网IPv4地址,单IP后缀模糊匹配,多IP精确匹配。可以与`ip-exact-match`配合做单IP的精确匹配查询。
  • - //
  • ip-exact-match - Boolean - (过滤条件)内网IPv4精确匹配查询,存在多值情况,只取第一个。
  • - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。使用请参考示例2
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。
  • - //
  • is-primary - Boolean - 是否必填:否 - (过滤条件)按照是否主网卡进行过滤。值为true时,仅过滤主网卡;值为false时,仅过滤辅助网卡;此过滤参数未提供时,同时过滤主网卡和辅助网卡。
  • - //
  • eni-type - String -是否必填:否- (过滤条件)按照网卡类型进行过滤。“0”-辅助网卡,“1”-主网卡,“2”:中继网卡。
  • - //
  • eni-qos - String -是否必填:否- (过滤条件)按照网卡服务质量进行过滤。“AG”-服务质量为云铜,“AU”-服务质量为云银。
  • - //
  • address-ipv6 - String - 是否必填:否 -(过滤条件)内网IPv6地址过滤,支持多ipv6地址查询,如果和address-ip一起使用取交集。
  • - //
  • public-address-ip - String - (过滤条件)公网IPv4地址,精确匹配。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeNetworkInterfacesRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID查询。形如:eni-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定NetworkInterfaceIds和Filters。 - NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds"` - - // 过滤条件,参数不支持同时指定NetworkInterfaceIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • subnet-id - String - (过滤条件)所属子网实例ID,形如:subnet-f49l6u0z。
  • - //
  • network-interface-id - String - (过滤条件)弹性网卡实例ID,形如:eni-5k56k7k7。
  • - //
  • attachment.instance-id - String - (过滤条件)绑定的云服务器实例ID,形如:ins-3nqpdn3i。
  • - //
  • groups.security-group-id - String - (过滤条件)绑定的安全组实例ID,例如:sg-f9ekbxeq。
  • - //
  • network-interface-name - String - (过滤条件)网卡实例名称。
  • - //
  • network-interface-description - String - (过滤条件)网卡实例描述。
  • - //
  • address-ip - String - (过滤条件)内网IPv4地址,单IP后缀模糊匹配,多IP精确匹配。可以与`ip-exact-match`配合做单IP的精确匹配查询。
  • - //
  • ip-exact-match - Boolean - (过滤条件)内网IPv4精确匹配查询,存在多值情况,只取第一个。
  • - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。使用请参考示例2
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。
  • - //
  • is-primary - Boolean - 是否必填:否 - (过滤条件)按照是否主网卡进行过滤。值为true时,仅过滤主网卡;值为false时,仅过滤辅助网卡;此过滤参数未提供时,同时过滤主网卡和辅助网卡。
  • - //
  • eni-type - String -是否必填:否- (过滤条件)按照网卡类型进行过滤。“0”-辅助网卡,“1”-主网卡,“2”:中继网卡。
  • - //
  • eni-qos - String -是否必填:否- (过滤条件)按照网卡服务质量进行过滤。“AG”-服务质量为云铜,“AU”-服务质量为云银。
  • - //
  • address-ipv6 - String - 是否必填:否 -(过滤条件)内网IPv6地址过滤,支持多ipv6地址查询,如果和address-ip一起使用取交集。
  • - //
  • public-address-ip - String - (过滤条件)公网IPv4地址,精确匹配。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeNetworkInterfacesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkInterfacesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeNetworkInterfacesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeNetworkInterfacesResponseParams struct { - // 实例详细信息列表。 - NetworkInterfaceSet []*NetworkInterface `json:"NetworkInterfaceSet,omitempty" name:"NetworkInterfaceSet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeNetworkInterfacesResponse struct { - *tchttp.BaseResponse - Response *DescribeNetworkInterfacesResponseParams `json:"Response"` -} - -func (r *DescribeNetworkInterfacesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeNetworkInterfacesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeProductQuotaRequestParams struct { - // 查询的网络产品名称,可查询的产品有:vpc、ccn、vpn、dc、dfw、clb、eip。 - Product *string `json:"Product,omitempty" name:"Product"` -} - -type DescribeProductQuotaRequest struct { - *tchttp.BaseRequest - - // 查询的网络产品名称,可查询的产品有:vpc、ccn、vpn、dc、dfw、clb、eip。 - Product *string `json:"Product,omitempty" name:"Product"` -} - -func (r *DescribeProductQuotaRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeProductQuotaRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Product") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeProductQuotaRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeProductQuotaResponseParams struct { - // ProductQuota对象数组。 - ProductQuotaSet []*ProductQuota `json:"ProductQuotaSet,omitempty" name:"ProductQuotaSet"` - - // 符合条件的产品类型个数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeProductQuotaResponse struct { - *tchttp.BaseResponse - Response *DescribeProductQuotaResponseParams `json:"Response"` -} - -func (r *DescribeProductQuotaResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeProductQuotaResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeRouteConflictsRequestParams struct { - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 要检查的与之冲突的目的端列表。 - DestinationCidrBlocks []*string `json:"DestinationCidrBlocks,omitempty" name:"DestinationCidrBlocks"` -} - -type DescribeRouteConflictsRequest struct { - *tchttp.BaseRequest - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 要检查的与之冲突的目的端列表。 - DestinationCidrBlocks []*string `json:"DestinationCidrBlocks,omitempty" name:"DestinationCidrBlocks"` -} - -func (r *DescribeRouteConflictsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeRouteConflictsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "DestinationCidrBlocks") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeRouteConflictsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeRouteConflictsResponseParams struct { - // 路由策略冲突列表。 - RouteConflictSet []*RouteConflict `json:"RouteConflictSet,omitempty" name:"RouteConflictSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeRouteConflictsResponse struct { - *tchttp.BaseResponse - Response *DescribeRouteConflictsResponseParams `json:"Response"` -} - -func (r *DescribeRouteConflictsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeRouteConflictsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeRouteTablesRequestParams struct { - // 过滤条件,参数不支持同时指定RouteTableIds和Filters。 - //
  • route-table-id - String - (过滤条件)路由表实例ID。
  • - //
  • route-table-name - String - (过滤条件)路由表名称。
  • - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • association.main - String - (过滤条件)是否主路由表。
  • - //
  • tag-key - String -是否必填:否 - (过滤条件)按照标签键进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。
  • - //
  • next-hop-type - String - 是否必填:否 - (过滤条件)按下一跳类型进行过滤。使用next-hop-type进行过滤时,必须同时携带route-table-id与vpc-id。 - // 目前我们支持的类型有: - // LOCAL: 本地路由 - // CVM:公网网关类型的云服务器; - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // HAVIP:高可用虚拟IP; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // EIP:云服务器的公网IP; - // CCN:云联网; - // LOCAL_GATEWAY:本地网关。 - //
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableIds []*string `json:"RouteTableIds,omitempty" name:"RouteTableIds"` - - // 偏移量。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeRouteTablesRequest struct { - *tchttp.BaseRequest - - // 过滤条件,参数不支持同时指定RouteTableIds和Filters。 - //
  • route-table-id - String - (过滤条件)路由表实例ID。
  • - //
  • route-table-name - String - (过滤条件)路由表名称。
  • - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • association.main - String - (过滤条件)是否主路由表。
  • - //
  • tag-key - String -是否必填:否 - (过滤条件)按照标签键进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。
  • - //
  • next-hop-type - String - 是否必填:否 - (过滤条件)按下一跳类型进行过滤。使用next-hop-type进行过滤时,必须同时携带route-table-id与vpc-id。 - // 目前我们支持的类型有: - // LOCAL: 本地路由 - // CVM:公网网关类型的云服务器; - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // HAVIP:高可用虚拟IP; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // EIP:云服务器的公网IP; - // CCN:云联网; - // LOCAL_GATEWAY:本地网关。 - //
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableIds []*string `json:"RouteTableIds,omitempty" name:"RouteTableIds"` - - // 偏移量。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeRouteTablesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeRouteTablesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "RouteTableIds") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeRouteTablesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeRouteTablesResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 路由表对象。 - RouteTableSet []*RouteTable `json:"RouteTableSet,omitempty" name:"RouteTableSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeRouteTablesResponse struct { - *tchttp.BaseResponse - Response *DescribeRouteTablesResponseParams `json:"Response"` -} - -func (r *DescribeRouteTablesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeRouteTablesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupAssociationStatisticsRequestParams struct { - // 安全实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -type DescribeSecurityGroupAssociationStatisticsRequest struct { - *tchttp.BaseRequest - - // 安全实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -func (r *DescribeSecurityGroupAssociationStatisticsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupAssociationStatisticsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSecurityGroupAssociationStatisticsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupAssociationStatisticsResponseParams struct { - // 安全组关联实例统计。 - SecurityGroupAssociationStatisticsSet []*SecurityGroupAssociationStatistics `json:"SecurityGroupAssociationStatisticsSet,omitempty" name:"SecurityGroupAssociationStatisticsSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSecurityGroupAssociationStatisticsResponse struct { - *tchttp.BaseResponse - Response *DescribeSecurityGroupAssociationStatisticsResponseParams `json:"Response"` -} - -func (r *DescribeSecurityGroupAssociationStatisticsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupAssociationStatisticsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupLimitsRequestParams struct { -} - -type DescribeSecurityGroupLimitsRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeSecurityGroupLimitsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupLimitsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSecurityGroupLimitsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupLimitsResponseParams struct { - // 用户安全组配额限制。 - SecurityGroupLimitSet *SecurityGroupLimitSet `json:"SecurityGroupLimitSet,omitempty" name:"SecurityGroupLimitSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSecurityGroupLimitsResponse struct { - *tchttp.BaseResponse - Response *DescribeSecurityGroupLimitsResponseParams `json:"Response"` -} - -func (r *DescribeSecurityGroupLimitsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupLimitsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupPoliciesRequestParams struct { - // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 过滤条件。 - //
  • security-group-id - String - 规则中的安全组ID。
  • - //
  • ip - String - IP,支持IPV4和IPV6模糊匹配。
  • - //
  • address-module - String - IP地址模板或IP地址组模板ID。
  • - //
  • service-module - String - 协议端口模板或协议端口组模板ID。
  • - //
  • protocol-type - String - 安全组策略支持的协议,可选值:`TCP`, `UDP`, `ICMP`, `ICMPV6`, `GRE`, `ALL`。
  • - //
  • port - String - 是否必填:否 -协议端口,支持模糊匹配,值为`ALL`时,查询所有的端口。
  • - //
  • poly - String - 协议策略,可选值:`ALL`,所有策略;`ACCEPT`,允许;`DROP`,拒绝。
  • - //
  • direction - String - 协议规则,可选值:`ALL`,所有策略;`INBOUND`,入站规则;`OUTBOUND`,出站规则。
  • - //
  • description - String - 协议描述,该过滤条件支持模糊匹配。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeSecurityGroupPoliciesRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 过滤条件。 - //
  • security-group-id - String - 规则中的安全组ID。
  • - //
  • ip - String - IP,支持IPV4和IPV6模糊匹配。
  • - //
  • address-module - String - IP地址模板或IP地址组模板ID。
  • - //
  • service-module - String - 协议端口模板或协议端口组模板ID。
  • - //
  • protocol-type - String - 安全组策略支持的协议,可选值:`TCP`, `UDP`, `ICMP`, `ICMPV6`, `GRE`, `ALL`。
  • - //
  • port - String - 是否必填:否 -协议端口,支持模糊匹配,值为`ALL`时,查询所有的端口。
  • - //
  • poly - String - 协议策略,可选值:`ALL`,所有策略;`ACCEPT`,允许;`DROP`,拒绝。
  • - //
  • direction - String - 协议规则,可选值:`ALL`,所有策略;`INBOUND`,入站规则;`OUTBOUND`,出站规则。
  • - //
  • description - String - 协议描述,该过滤条件支持模糊匹配。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeSecurityGroupPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSecurityGroupPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupPoliciesResponseParams struct { - // 安全组规则集合。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSecurityGroupPoliciesResponse struct { - *tchttp.BaseResponse - Response *DescribeSecurityGroupPoliciesResponseParams `json:"Response"` -} - -func (r *DescribeSecurityGroupPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupReferencesRequestParams struct { - // 安全组实例ID数组。格式如:['sg-12345678']。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -type DescribeSecurityGroupReferencesRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID数组。格式如:['sg-12345678']。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -func (r *DescribeSecurityGroupReferencesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupReferencesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSecurityGroupReferencesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupReferencesResponseParams struct { - // 安全组被引用信息。 - ReferredSecurityGroupSet []*ReferredSecurityGroup `json:"ReferredSecurityGroupSet,omitempty" name:"ReferredSecurityGroupSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSecurityGroupReferencesResponse struct { - *tchttp.BaseResponse - Response *DescribeSecurityGroupReferencesResponseParams `json:"Response"` -} - -func (r *DescribeSecurityGroupReferencesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupReferencesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupsRequestParams struct { - // 安全组实例ID,例如:sg-33ocnj9n。每次请求的实例的上限为100。参数不支持同时指定SecurityGroupIds和Filters。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 过滤条件,参数不支持同时指定SecurityGroupIds和Filters。 - //
  • security-group-id - String - (过滤条件)安全组ID。
  • - //
  • project-id - Integer - (过滤条件)项目ID。
  • - //
  • security-group-name - String - (过滤条件)安全组名称。
  • - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。使用请参考示例2。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例3。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` - - // 排序字段。支持:`CreatedTime` `UpdateTime`。注意:该字段没有默认值。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方法。升序:`ASC`,倒序:`DESC`。默认值:`ASC` - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -type DescribeSecurityGroupsRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如:sg-33ocnj9n。每次请求的实例的上限为100。参数不支持同时指定SecurityGroupIds和Filters。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 过滤条件,参数不支持同时指定SecurityGroupIds和Filters。 - //
  • security-group-id - String - (过滤条件)安全组ID。
  • - //
  • project-id - Integer - (过滤条件)项目ID。
  • - //
  • security-group-name - String - (过滤条件)安全组名称。
  • - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。使用请参考示例2。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例3。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` - - // 排序字段。支持:`CreatedTime` `UpdateTime`。注意:该字段没有默认值。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方法。升序:`ASC`,倒序:`DESC`。默认值:`ASC` - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -func (r *DescribeSecurityGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "OrderField") - delete(f, "OrderDirection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSecurityGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSecurityGroupsResponseParams struct { - // 安全组对象。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SecurityGroupSet []*SecurityGroup `json:"SecurityGroupSet,omitempty" name:"SecurityGroupSet"` - - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSecurityGroupsResponse struct { - *tchttp.BaseResponse - Response *DescribeSecurityGroupsResponseParams `json:"Response"` -} - -func (r *DescribeSecurityGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSecurityGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeServiceTemplateGroupsRequestParams struct { - // 过滤条件。 - //
  • service-template-group-name - String - (过滤条件)协议端口模板集合名称。
  • - //
  • service-template-group-id - String - (过滤条件)协议端口模板集合实例ID,例如:ppmg-e6dy460g。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeServiceTemplateGroupsRequest struct { - *tchttp.BaseRequest - - // 过滤条件。 - //
  • service-template-group-name - String - (过滤条件)协议端口模板集合名称。
  • - //
  • service-template-group-id - String - (过滤条件)协议端口模板集合实例ID,例如:ppmg-e6dy460g。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeServiceTemplateGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeServiceTemplateGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeServiceTemplateGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeServiceTemplateGroupsResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 协议端口模板集合。 - ServiceTemplateGroupSet []*ServiceTemplateGroup `json:"ServiceTemplateGroupSet,omitempty" name:"ServiceTemplateGroupSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeServiceTemplateGroupsResponse struct { - *tchttp.BaseResponse - Response *DescribeServiceTemplateGroupsResponseParams `json:"Response"` -} - -func (r *DescribeServiceTemplateGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeServiceTemplateGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeServiceTemplatesRequestParams struct { - // 过滤条件。 - //
  • service-template-name - 协议端口模板名称。
  • - //
  • service-template-id - 协议端口模板实例ID,例如:ppm-e6dy460g。
  • - //
  • service-port- 协议端口。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeServiceTemplatesRequest struct { - *tchttp.BaseRequest - - // 过滤条件。 - //
  • service-template-name - 协议端口模板名称。
  • - //
  • service-template-id - 协议端口模板实例ID,例如:ppm-e6dy460g。
  • - //
  • service-port- 协议端口。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeServiceTemplatesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeServiceTemplatesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeServiceTemplatesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeServiceTemplatesResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 协议端口模板对象。 - ServiceTemplateSet []*ServiceTemplate `json:"ServiceTemplateSet,omitempty" name:"ServiceTemplateSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeServiceTemplatesResponse struct { - *tchttp.BaseResponse - Response *DescribeServiceTemplatesResponseParams `json:"Response"` -} - -func (r *DescribeServiceTemplatesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeServiceTemplatesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSgSnapshotFileContentRequestParams struct { - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 快照文件Id。 - SnapshotFileId *string `json:"SnapshotFileId,omitempty" name:"SnapshotFileId"` - - // 安全组Id。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` -} - -type DescribeSgSnapshotFileContentRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 快照文件Id。 - SnapshotFileId *string `json:"SnapshotFileId,omitempty" name:"SnapshotFileId"` - - // 安全组Id。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` -} - -func (r *DescribeSgSnapshotFileContentRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSgSnapshotFileContentRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyId") - delete(f, "SnapshotFileId") - delete(f, "SecurityGroupId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSgSnapshotFileContentRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSgSnapshotFileContentResponseParams struct { - // 实例Id,即安全组Id。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 快照文件Id。 - SnapshotFileId *string `json:"SnapshotFileId,omitempty" name:"SnapshotFileId"` - - // 备份时间。 - BackupTime *string `json:"BackupTime,omitempty" name:"BackupTime"` - - // 操作者。 - Operator *string `json:"Operator,omitempty" name:"Operator"` - - // 原始数据。 - OriginalData []*SecurityGroupPolicy `json:"OriginalData,omitempty" name:"OriginalData"` - - // 备份数据。 - BackupData []*SecurityGroupPolicy `json:"BackupData,omitempty" name:"BackupData"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSgSnapshotFileContentResponse struct { - *tchttp.BaseResponse - Response *DescribeSgSnapshotFileContentResponseParams `json:"Response"` -} - -func (r *DescribeSgSnapshotFileContentResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSgSnapshotFileContentResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSnapshotAttachedInstancesRequestParams struct { - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 过滤条件。 - // 支持的过滤条件如下: - //
  • instance-id:实例ID。
  • - //
  • instance-region:实例所在地域。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大为200。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeSnapshotAttachedInstancesRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 过滤条件。 - // 支持的过滤条件如下: - //
  • instance-id:实例ID。
  • - //
  • instance-region:实例所在地域。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大为200。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeSnapshotAttachedInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSnapshotAttachedInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyId") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSnapshotAttachedInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSnapshotAttachedInstancesResponseParams struct { - // 实例列表 - InstanceSet []*SnapshotInstance `json:"InstanceSet,omitempty" name:"InstanceSet"` - - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSnapshotAttachedInstancesResponse struct { - *tchttp.BaseResponse - Response *DescribeSnapshotAttachedInstancesResponseParams `json:"Response"` -} - -func (r *DescribeSnapshotAttachedInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSnapshotAttachedInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSnapshotFilesRequestParams struct { - // 业务类型,目前支持安全组:securitygroup。 - BusinessType *string `json:"BusinessType,omitempty" name:"BusinessType"` - - // 业务实例Id,和BusinessType对应。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 开始日期,格式%Y-%m-%d %H:%M:%S。 - StartDate *string `json:"StartDate,omitempty" name:"StartDate"` - - // 结束日期,格式%Y-%m-%d %H:%M:%S。 - EndDate *string `json:"EndDate,omitempty" name:"EndDate"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeSnapshotFilesRequest struct { - *tchttp.BaseRequest - - // 业务类型,目前支持安全组:securitygroup。 - BusinessType *string `json:"BusinessType,omitempty" name:"BusinessType"` - - // 业务实例Id,和BusinessType对应。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 开始日期,格式%Y-%m-%d %H:%M:%S。 - StartDate *string `json:"StartDate,omitempty" name:"StartDate"` - - // 结束日期,格式%Y-%m-%d %H:%M:%S。 - EndDate *string `json:"EndDate,omitempty" name:"EndDate"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeSnapshotFilesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSnapshotFilesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "BusinessType") - delete(f, "InstanceId") - delete(f, "StartDate") - delete(f, "EndDate") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSnapshotFilesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSnapshotFilesResponseParams struct { - // 快照文件集合。 - SnapshotFileSet []*SnapshotFileInfo `json:"SnapshotFileSet,omitempty" name:"SnapshotFileSet"` - - // 符合条件的对象数。 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSnapshotFilesResponse struct { - *tchttp.BaseResponse - Response *DescribeSnapshotFilesResponseParams `json:"Response"` -} - -func (r *DescribeSnapshotFilesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSnapshotFilesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSnapshotPoliciesRequestParams struct { - // 快照策略Id。 - SnapshotPolicyIds []*string `json:"SnapshotPolicyIds,omitempty" name:"SnapshotPolicyIds"` - - // 过滤条件,参数不支持同时指定SnapshotPolicyIds和Filters。 - //
  • snapshot-policy-id - String -(过滤条件)快照策略ID。
  • - //
  • snapshot-policy-name - String -(过滤条件)快照策略名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大为200。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeSnapshotPoliciesRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyIds []*string `json:"SnapshotPolicyIds,omitempty" name:"SnapshotPolicyIds"` - - // 过滤条件,参数不支持同时指定SnapshotPolicyIds和Filters。 - //
  • snapshot-policy-id - String -(过滤条件)快照策略ID。
  • - //
  • snapshot-policy-name - String -(过滤条件)快照策略名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大为200。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeSnapshotPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSnapshotPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSnapshotPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSnapshotPoliciesResponseParams struct { - // 快照策略。 - SnapshotPolicySet []*SnapshotPolicy `json:"SnapshotPolicySet,omitempty" name:"SnapshotPolicySet"` - - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSnapshotPoliciesResponse struct { - *tchttp.BaseResponse - Response *DescribeSnapshotPoliciesResponseParams `json:"Response"` -} - -func (r *DescribeSnapshotPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSnapshotPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSpecificTrafficPackageUsedDetailsRequestParams struct { - // 共享流量包唯一ID - TrafficPackageId *string `json:"TrafficPackageId,omitempty" name:"TrafficPackageId"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。详细的过滤条件如下:
  • resource-id - String - 是否必填:否 - (过滤条件)按照抵扣流量资源的唯一 ID 过滤。
  • resource-type - String - 是否必填:否 - (过滤条件)按照资源类型过滤,资源类型包括 CVM 和 EIP
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 排序条件。该参数仅支持根据抵扣量排序,传值为 deduction - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序类型,仅支持0和1,0-降序,1-升序。不传默认为0 - OrderType *int64 `json:"OrderType,omitempty" name:"OrderType"` - - // 开始时间。不传默认为当前时间往前推30天 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 结束时间。不传默认为当前时间 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 分页参数 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 分页参数 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeSpecificTrafficPackageUsedDetailsRequest struct { - *tchttp.BaseRequest - - // 共享流量包唯一ID - TrafficPackageId *string `json:"TrafficPackageId,omitempty" name:"TrafficPackageId"` - - // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。详细的过滤条件如下:
  • resource-id - String - 是否必填:否 - (过滤条件)按照抵扣流量资源的唯一 ID 过滤。
  • resource-type - String - 是否必填:否 - (过滤条件)按照资源类型过滤,资源类型包括 CVM 和 EIP
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 排序条件。该参数仅支持根据抵扣量排序,传值为 deduction - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序类型,仅支持0和1,0-降序,1-升序。不传默认为0 - OrderType *int64 `json:"OrderType,omitempty" name:"OrderType"` - - // 开始时间。不传默认为当前时间往前推30天 - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 结束时间。不传默认为当前时间 - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` - - // 分页参数 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 分页参数 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeSpecificTrafficPackageUsedDetailsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSpecificTrafficPackageUsedDetailsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TrafficPackageId") - delete(f, "Filters") - delete(f, "OrderField") - delete(f, "OrderType") - delete(f, "StartTime") - delete(f, "EndTime") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSpecificTrafficPackageUsedDetailsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSpecificTrafficPackageUsedDetailsResponseParams struct { - // 符合查询条件的共享流量包用量明细的总数 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 共享流量包用量明细列表 - UsedDetailSet []*UsedDetail `json:"UsedDetailSet,omitempty" name:"UsedDetailSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSpecificTrafficPackageUsedDetailsResponse struct { - *tchttp.BaseResponse - Response *DescribeSpecificTrafficPackageUsedDetailsResponseParams `json:"Response"` -} - -func (r *DescribeSpecificTrafficPackageUsedDetailsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSpecificTrafficPackageUsedDetailsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSubnetResourceDashboardRequestParams struct { - // Subnet实例ID,例如:subnet-f1xjkw1b。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` -} - -type DescribeSubnetResourceDashboardRequest struct { - *tchttp.BaseRequest - - // Subnet实例ID,例如:subnet-f1xjkw1b。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` -} - -func (r *DescribeSubnetResourceDashboardRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSubnetResourceDashboardRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SubnetIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSubnetResourceDashboardRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSubnetResourceDashboardResponseParams struct { - // 资源统计结果。 - ResourceStatisticsSet []*ResourceStatistics `json:"ResourceStatisticsSet,omitempty" name:"ResourceStatisticsSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSubnetResourceDashboardResponse struct { - *tchttp.BaseResponse - Response *DescribeSubnetResourceDashboardResponseParams `json:"Response"` -} - -func (r *DescribeSubnetResourceDashboardResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSubnetResourceDashboardResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSubnetsRequestParams struct { - // 子网实例ID查询。形如:subnet-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定SubnetIds和Filters。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` - - // 过滤条件,参数不支持同时指定SubnetIds和Filters。 - //
  • subnet-id - String - (过滤条件)Subnet实例名称。
  • - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • cidr-block - String - (过滤条件)子网网段,形如: 192.168.1.0 。
  • - //
  • is-default - Boolean - (过滤条件)是否是默认子网。
  • - //
  • is-remote-vpc-snat - Boolean - (过滤条件)是否为VPC SNAT地址池子网。
  • - //
  • subnet-name - String - (过滤条件)子网名称。
  • - //
  • zone - String - (过滤条件)可用区。
  • - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。
  • - //
  • cdc-id - String - 是否必填:否 - (过滤条件)按照cdc信息进行过滤。过滤出来制定cdc下的子网。
  • - //
  • is-cdc-subnet - String - 是否必填:否 - (过滤条件)按照是否是cdc子网进行过滤。取值:“0”-非cdc子网,“1”--cdc子网
  • - //
  • ipv6-cidr-block - String - (过滤条件)IPv6子网网段,形如: 2402:4e00:1717:8700::/64 。
  • - //
  • isp-type - String - (过滤条件)运营商类型,形如: BGP 。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeSubnetsRequest struct { - *tchttp.BaseRequest - - // 子网实例ID查询。形如:subnet-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定SubnetIds和Filters。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` - - // 过滤条件,参数不支持同时指定SubnetIds和Filters。 - //
  • subnet-id - String - (过滤条件)Subnet实例名称。
  • - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • cidr-block - String - (过滤条件)子网网段,形如: 192.168.1.0 。
  • - //
  • is-default - Boolean - (过滤条件)是否是默认子网。
  • - //
  • is-remote-vpc-snat - Boolean - (过滤条件)是否为VPC SNAT地址池子网。
  • - //
  • subnet-name - String - (过滤条件)子网名称。
  • - //
  • zone - String - (过滤条件)可用区。
  • - //
  • tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。
  • - //
  • tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。
  • - //
  • cdc-id - String - 是否必填:否 - (过滤条件)按照cdc信息进行过滤。过滤出来制定cdc下的子网。
  • - //
  • is-cdc-subnet - String - 是否必填:否 - (过滤条件)按照是否是cdc子网进行过滤。取值:“0”-非cdc子网,“1”--cdc子网
  • - //
  • ipv6-cidr-block - String - (过滤条件)IPv6子网网段,形如: 2402:4e00:1717:8700::/64 。
  • - //
  • isp-type - String - (过滤条件)运营商类型,形如: BGP 。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeSubnetsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSubnetsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SubnetIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSubnetsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeSubnetsResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 子网对象。 - SubnetSet []*Subnet `json:"SubnetSet,omitempty" name:"SubnetSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeSubnetsResponse struct { - *tchttp.BaseResponse - Response *DescribeSubnetsResponseParams `json:"Response"` -} - -func (r *DescribeSubnetsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeSubnetsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTaskResultRequestParams struct { - // 异步任务ID。TaskId和DealName必填一个参数 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 计费订单号。TaskId和DealName必填一个参数 - DealName *string `json:"DealName,omitempty" name:"DealName"` -} - -type DescribeTaskResultRequest struct { - *tchttp.BaseRequest - - // 异步任务ID。TaskId和DealName必填一个参数 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 计费订单号。TaskId和DealName必填一个参数 - DealName *string `json:"DealName,omitempty" name:"DealName"` -} - -func (r *DescribeTaskResultRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTaskResultRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TaskId") - delete(f, "DealName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTaskResultRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTaskResultResponseParams struct { - // 任务ID - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 执行结果,包括"SUCCESS", "FAILED", "RUNNING" - Result *string `json:"Result,omitempty" name:"Result"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeTaskResultResponse struct { - *tchttp.BaseResponse - Response *DescribeTaskResultResponseParams `json:"Response"` -} - -func (r *DescribeTaskResultResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTaskResultResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTemplateLimitsRequestParams struct { -} - -type DescribeTemplateLimitsRequest struct { - *tchttp.BaseRequest -} - -func (r *DescribeTemplateLimitsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTemplateLimitsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTemplateLimitsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTemplateLimitsResponseParams struct { - // 参数模板配额对象。 - TemplateLimit *TemplateLimit `json:"TemplateLimit,omitempty" name:"TemplateLimit"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeTemplateLimitsResponse struct { - *tchttp.BaseResponse - Response *DescribeTemplateLimitsResponseParams `json:"Response"` -} - -func (r *DescribeTemplateLimitsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTemplateLimitsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTenantCcnsRequestParams struct { - // 过滤条件,目前`value`值个数只支持一个,允许可支持的字段有: - //
  • `ccn-ids` 云联网ID数组,值形如:`["ccn-12345678"]`
  • - //
  • `user-account-id` 用户账号ID,值形如:`["12345678"]`
  • `is-security-lock` 是否锁定,值形如:`["true"]`
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数据量,可选值0到100之间的整数,默认20。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeTenantCcnsRequest struct { - *tchttp.BaseRequest - - // 过滤条件,目前`value`值个数只支持一个,允许可支持的字段有: - //
  • `ccn-ids` 云联网ID数组,值形如:`["ccn-12345678"]`
  • - //
  • `user-account-id` 用户账号ID,值形如:`["12345678"]`
  • `is-security-lock` 是否锁定,值形如:`["true"]`
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数据量,可选值0到100之间的整数,默认20。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeTenantCcnsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTenantCcnsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTenantCcnsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTenantCcnsResponseParams struct { - // 云联网(CCN)对象。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CcnSet []*CcnInstanceInfo `json:"CcnSet,omitempty" name:"CcnSet"` - - // 符合条件的对象总数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeTenantCcnsResponse struct { - *tchttp.BaseResponse - Response *DescribeTenantCcnsResponseParams `json:"Response"` -} - -func (r *DescribeTenantCcnsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTenantCcnsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTrafficPackagesRequestParams struct { - // 共享流量包ID,支持批量 - TrafficPackageIds []*string `json:"TrafficPackageIds,omitempty" name:"TrafficPackageIds"` - - // 每次请求的`Filters`的上限为10。参数不支持同时指定`TrafficPackageIds`和`Filters`。详细的过滤条件如下: - //
  • traffic-package_id - String - 是否必填:否 - (过滤条件)按照共享流量包的唯一标识ID过滤。
  • - //
  • traffic-package-name - String - 是否必填:否 - (过滤条件)按照共享流量包名称过滤。不支持模糊过滤。
  • - //
  • status - String - 是否必填:否 - (过滤条件)按照共享流量包状态过滤。可选状态:[AVAILABLE|EXPIRED|EXHAUSTED]
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 分页参数 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 分页参数 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeTrafficPackagesRequest struct { - *tchttp.BaseRequest - - // 共享流量包ID,支持批量 - TrafficPackageIds []*string `json:"TrafficPackageIds,omitempty" name:"TrafficPackageIds"` - - // 每次请求的`Filters`的上限为10。参数不支持同时指定`TrafficPackageIds`和`Filters`。详细的过滤条件如下: - //
  • traffic-package_id - String - 是否必填:否 - (过滤条件)按照共享流量包的唯一标识ID过滤。
  • - //
  • traffic-package-name - String - 是否必填:否 - (过滤条件)按照共享流量包名称过滤。不支持模糊过滤。
  • - //
  • status - String - 是否必填:否 - (过滤条件)按照共享流量包状态过滤。可选状态:[AVAILABLE|EXPIRED|EXHAUSTED]
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 分页参数 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 分页参数 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeTrafficPackagesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTrafficPackagesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TrafficPackageIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeTrafficPackagesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeTrafficPackagesResponseParams struct { - // 按照条件查询出来的流量包数量 - TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 流量包信息 - TrafficPackageSet []*TrafficPackage `json:"TrafficPackageSet,omitempty" name:"TrafficPackageSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeTrafficPackagesResponse struct { - *tchttp.BaseResponse - Response *DescribeTrafficPackagesResponseParams `json:"Response"` -} - -func (r *DescribeTrafficPackagesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeTrafficPackagesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeUsedIpAddressRequestParams struct { - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 查询是否占用的ip列表,ip需要在vpc或子网内。最多允许一次查询100个IP。 - IpAddresses []*string `json:"IpAddresses,omitempty" name:"IpAddresses"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeUsedIpAddressRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 查询是否占用的ip列表,ip需要在vpc或子网内。最多允许一次查询100个IP。 - IpAddresses []*string `json:"IpAddresses,omitempty" name:"IpAddresses"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeUsedIpAddressRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeUsedIpAddressRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "SubnetId") - delete(f, "IpAddresses") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUsedIpAddressRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeUsedIpAddressResponseParams struct { - // 占用ip地址的资源信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - IpAddressStates []*IpAddressStates `json:"IpAddressStates,omitempty" name:"IpAddressStates"` - - // 返回占用资源的个数 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeUsedIpAddressResponse struct { - *tchttp.BaseResponse - Response *DescribeUsedIpAddressResponseParams `json:"Response"` -} - -func (r *DescribeUsedIpAddressResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeUsedIpAddressResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcEndPointRequestParams struct { - // 过滤条件。 - //
  • end-point-service-id- String - (过滤条件)终端节点服务ID。
  • - //
  • end-point-name - String - (过滤条件)终端节点实例名称。
  • - //
  • end-point-id- String - (过滤条件)终端节点实例ID。
  • - //
  • vpc-id- String - (过滤条件)VPC实例ID。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 终端节点ID列表。 - EndPointId []*string `json:"EndPointId,omitempty" name:"EndPointId"` -} - -type DescribeVpcEndPointRequest struct { - *tchttp.BaseRequest - - // 过滤条件。 - //
  • end-point-service-id- String - (过滤条件)终端节点服务ID。
  • - //
  • end-point-name - String - (过滤条件)终端节点实例名称。
  • - //
  • end-point-id- String - (过滤条件)终端节点实例ID。
  • - //
  • vpc-id- String - (过滤条件)VPC实例ID。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 终端节点ID列表。 - EndPointId []*string `json:"EndPointId,omitempty" name:"EndPointId"` -} - -func (r *DescribeVpcEndPointRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcEndPointRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "EndPointId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcEndPointRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcEndPointResponseParams struct { - // 终端节点对象。 - EndPointSet []*EndPoint `json:"EndPointSet,omitempty" name:"EndPointSet"` - - // 符合查询条件的终端节点个数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcEndPointResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcEndPointResponseParams `json:"Response"` -} - -func (r *DescribeVpcEndPointResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcEndPointResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcEndPointServiceRequestParams struct { - // 过滤条件。不支持同时传入参数 EndPointServiceIds and Filters。 - //
  • service-id - String - (过滤条件)终端节点服务唯一ID。
  • - //
  • service-name - String - (过滤条件)终端节点实例名称。
  • - //
  • service-instance-id - String - (过滤条件)后端服务的唯一ID,比如lb-xxx。
  • - //
  • service-type - String - (过滤条件)后端PAAS服务类型,CLB,CDB,CRS,不填默认查询类型为CLB。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 终端节点服务ID。不支持同时传入参数 EndPointServiceIds and Filters。 - EndPointServiceIds []*string `json:"EndPointServiceIds,omitempty" name:"EndPointServiceIds"` - - //
  • 不支持同时传入参数 Filters 。
  • 列出授权给当前账号的的终端节点服务信息。可以配合EndPointServiceIds参数进行过滤,那些终端节点服务授权了该账户。
  • - IsListAuthorizedEndPointService *bool `json:"IsListAuthorizedEndPointService,omitempty" name:"IsListAuthorizedEndPointService"` -} - -type DescribeVpcEndPointServiceRequest struct { - *tchttp.BaseRequest - - // 过滤条件。不支持同时传入参数 EndPointServiceIds and Filters。 - //
  • service-id - String - (过滤条件)终端节点服务唯一ID。
  • - //
  • service-name - String - (过滤条件)终端节点实例名称。
  • - //
  • service-instance-id - String - (过滤条件)后端服务的唯一ID,比如lb-xxx。
  • - //
  • service-type - String - (过滤条件)后端PAAS服务类型,CLB,CDB,CRS,不填默认查询类型为CLB。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 终端节点服务ID。不支持同时传入参数 EndPointServiceIds and Filters。 - EndPointServiceIds []*string `json:"EndPointServiceIds,omitempty" name:"EndPointServiceIds"` - - //
  • 不支持同时传入参数 Filters 。
  • 列出授权给当前账号的的终端节点服务信息。可以配合EndPointServiceIds参数进行过滤,那些终端节点服务授权了该账户。
  • - IsListAuthorizedEndPointService *bool `json:"IsListAuthorizedEndPointService,omitempty" name:"IsListAuthorizedEndPointService"` -} - -func (r *DescribeVpcEndPointServiceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcEndPointServiceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "EndPointServiceIds") - delete(f, "IsListAuthorizedEndPointService") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcEndPointServiceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcEndPointServiceResponseParams struct { - // 终端节点服务对象数组。 - EndPointServiceSet []*EndPointService `json:"EndPointServiceSet,omitempty" name:"EndPointServiceSet"` - - // 符合查询条件的个数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcEndPointServiceResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcEndPointServiceResponseParams `json:"Response"` -} - -func (r *DescribeVpcEndPointServiceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcEndPointServiceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcEndPointServiceWhiteListRequestParams struct { - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤条件。 - //
  • user-uin String - (过滤条件)用户UIN。
  • - //
  • end-point-service-id String - (过滤条件)终端节点服务ID。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -type DescribeVpcEndPointServiceWhiteListRequest struct { - *tchttp.BaseRequest - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 单页返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 过滤条件。 - //
  • user-uin String - (过滤条件)用户UIN。
  • - //
  • end-point-service-id String - (过滤条件)终端节点服务ID。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` -} - -func (r *DescribeVpcEndPointServiceWhiteListRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcEndPointServiceWhiteListRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Offset") - delete(f, "Limit") - delete(f, "Filters") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcEndPointServiceWhiteListRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcEndPointServiceWhiteListResponseParams struct { - // 白名单对象数组。 - VpcEndpointServiceUserSet []*VpcEndPointServiceUser `json:"VpcEndpointServiceUserSet,omitempty" name:"VpcEndpointServiceUserSet"` - - // 符合条件的白名单个数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcEndPointServiceWhiteListResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcEndPointServiceWhiteListResponseParams `json:"Response"` -} - -func (r *DescribeVpcEndPointServiceWhiteListResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcEndPointServiceWhiteListResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcInstancesRequestParams struct { - // 过滤条件,参数不支持同时指定RouteTableIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • instance-id - String - (过滤条件)云主机实例ID。
  • - //
  • instance-name - String - (过滤条件)云主机名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeVpcInstancesRequest struct { - *tchttp.BaseRequest - - // 过滤条件,参数不支持同时指定RouteTableIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • instance-id - String - (过滤条件)云主机实例ID。
  • - //
  • instance-name - String - (过滤条件)云主机名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeVpcInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcInstancesResponseParams struct { - // 云主机实例列表。 - InstanceSet []*CvmInstance `json:"InstanceSet,omitempty" name:"InstanceSet"` - - // 满足条件的云主机实例个数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcInstancesResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcInstancesResponseParams `json:"Response"` -} - -func (r *DescribeVpcInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcIpv6AddressesRequestParams struct { - // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `IP`地址列表,批量查询单次请求最多支持`10`个。 - Ipv6Addresses []*string `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // VPC下的子网ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` -} - -type DescribeVpcIpv6AddressesRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `IP`地址列表,批量查询单次请求最多支持`10`个。 - Ipv6Addresses []*string `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses"` - - // 偏移量,默认为0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // VPC下的子网ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` -} - -func (r *DescribeVpcIpv6AddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcIpv6AddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "Ipv6Addresses") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "SubnetId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcIpv6AddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcIpv6AddressesResponseParams struct { - // `IPv6`地址列表。 - Ipv6AddressSet []*VpcIpv6Address `json:"Ipv6AddressSet,omitempty" name:"Ipv6AddressSet"` - - // `IPv6`地址总数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcIpv6AddressesResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcIpv6AddressesResponseParams `json:"Response"` -} - -func (r *DescribeVpcIpv6AddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcIpv6AddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcLimitsRequestParams struct { - // 配额名称。每次最大查询100个配额类型。 - LimitTypes []*string `json:"LimitTypes,omitempty" name:"LimitTypes"` -} - -type DescribeVpcLimitsRequest struct { - *tchttp.BaseRequest - - // 配额名称。每次最大查询100个配额类型。 - LimitTypes []*string `json:"LimitTypes,omitempty" name:"LimitTypes"` -} - -func (r *DescribeVpcLimitsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcLimitsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LimitTypes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcLimitsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcLimitsResponseParams struct { - // 私有网络配额 - VpcLimitSet []*VpcLimit `json:"VpcLimitSet,omitempty" name:"VpcLimitSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcLimitsResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcLimitsResponseParams `json:"Response"` -} - -func (r *DescribeVpcLimitsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcLimitsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcPeeringConnectionsRequestParams struct { - // 对等连接唯一ID数组。 - PeeringConnectionIds []*string `json:"PeeringConnectionIds,omitempty" name:"PeeringConnectionIds"` - - // 过滤条件,参数不支持同时指定PeeringConnectionIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • state String - (过滤条件)对等连接状态,可选值有:PENDING,投放中;ACTIVE,使用中;EXPIRED,已过期;REJECTED,拒绝。
  • - //
  • peering-connection-name - String - (过滤条件)对等连接名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - // 排序字段,可选值有:CreatedTime,PeeringConnectionName。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方式:DESC,降序;ASC,升序。 - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -type DescribeVpcPeeringConnectionsRequest struct { - *tchttp.BaseRequest - - // 对等连接唯一ID数组。 - PeeringConnectionIds []*string `json:"PeeringConnectionIds,omitempty" name:"PeeringConnectionIds"` - - // 过滤条件,参数不支持同时指定PeeringConnectionIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • state String - (过滤条件)对等连接状态,可选值有:PENDING,投放中;ACTIVE,使用中;EXPIRED,已过期;REJECTED,拒绝。
  • - //
  • peering-connection-name - String - (过滤条件)对等连接名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` - - // 排序字段,可选值有:CreatedTime,PeeringConnectionName。 - OrderField *string `json:"OrderField,omitempty" name:"OrderField"` - - // 排序方式:DESC,降序;ASC,升序。 - OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` -} - -func (r *DescribeVpcPeeringConnectionsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcPeeringConnectionsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "PeeringConnectionIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "OrderField") - delete(f, "OrderDirection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcPeeringConnectionsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcPeeringConnectionsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcPeeringConnectionsResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcPeeringConnectionsResponseParams `json:"Response"` -} - -func (r *DescribeVpcPeeringConnectionsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcPeeringConnectionsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcPrivateIpAddressesRequestParams struct { - // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 内网`IP`地址列表,批量查询单次请求最多支持`10`个。 - PrivateIpAddresses []*string `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` -} - -type DescribeVpcPrivateIpAddressesRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 内网`IP`地址列表,批量查询单次请求最多支持`10`个。 - PrivateIpAddresses []*string `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` -} - -func (r *DescribeVpcPrivateIpAddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcPrivateIpAddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "PrivateIpAddresses") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcPrivateIpAddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcPrivateIpAddressesResponseParams struct { - // 内网`IP`地址信息列表。 - VpcPrivateIpAddressSet []*VpcPrivateIpAddress `json:"VpcPrivateIpAddressSet,omitempty" name:"VpcPrivateIpAddressSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcPrivateIpAddressesResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcPrivateIpAddressesResponseParams `json:"Response"` -} - -func (r *DescribeVpcPrivateIpAddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcPrivateIpAddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcResourceDashboardRequestParams struct { - // Vpc实例ID,例如:vpc-f1xjkw1b。 - VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds"` -} - -type DescribeVpcResourceDashboardRequest struct { - *tchttp.BaseRequest - - // Vpc实例ID,例如:vpc-f1xjkw1b。 - VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds"` -} - -func (r *DescribeVpcResourceDashboardRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcResourceDashboardRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcResourceDashboardRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcResourceDashboardResponseParams struct { - // 资源对象列表。 - ResourceDashboardSet []*ResourceDashboard `json:"ResourceDashboardSet,omitempty" name:"ResourceDashboardSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcResourceDashboardResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcResourceDashboardResponseParams `json:"Response"` -} - -func (r *DescribeVpcResourceDashboardResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcResourceDashboardResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcTaskResultRequestParams struct { - // 异步任务请求返回的RequestId。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` -} - -type DescribeVpcTaskResultRequest struct { - *tchttp.BaseRequest - - // 异步任务请求返回的RequestId。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` -} - -func (r *DescribeVpcTaskResultRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcTaskResultRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TaskId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcTaskResultRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcTaskResultResponseParams struct { - // 异步任务执行结果。结果:SUCCESS、FAILED、RUNNING。3者其中之一。其中SUCCESS表示任务执行成功,FAILED表示任务执行失败,RUNNING表示任务执行中。 - Status *string `json:"Status,omitempty" name:"Status"` - - // 异步任务执行输出。 - Output *string `json:"Output,omitempty" name:"Output"` - - // 异步任务详细结果。只用于特殊场景,如批量删除弹性网卡时查询成功的网卡列表和失败的列表。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Result []*VpcTaskResultDetailInfo `json:"Result,omitempty" name:"Result"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcTaskResultResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcTaskResultResponseParams `json:"Response"` -} - -func (r *DescribeVpcTaskResultResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcTaskResultResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcsRequestParams struct { - // VPC实例ID。形如:vpc-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpcIds和Filters。 - VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds"` - - // 过滤条件,不支持同时指定VpcIds和Filters参数。 - // 支持的过滤条件如下: - //
  • vpc-name:VPC实例名称,支持模糊查询。
  • - //
  • is-default :是否默认VPC。
  • - //
  • vpc-id :VPC实例ID,例如:vpc-f49l6u0z。
  • - //
  • cidr-block:VPC的CIDR。
  • - //
  • tag-key :按照标签键进行过滤,非必填参数。
  • - //
  • tag:tag-key:按照标签键值对进行过滤,非必填参数。 其中 tag-key 请使用具体的标签键进行替换,可参考示例2。
  • - // **说明:**若同一个过滤条件(Filter)存在多个Values,则同一Filter下Values间的关系为逻辑或(OR)关系;若存在多个过滤条件(Filter),Filter之间的关系为逻辑与(AND)关系。 - //
  • ipv6-cidr-block - String - (过滤条件)IPv6子网网段,形如: 2402:4e00:1717:8700::/64 。
  • - //
  • isp-type - String - (过滤条件)运营商类型,形如: BGP 取值范围:'BGP'-默认, 'CMCC'-中国移动, 'CTCC'-中国电信, 'CUCC'-中国联调。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeVpcsRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。形如:vpc-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpcIds和Filters。 - VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds"` - - // 过滤条件,不支持同时指定VpcIds和Filters参数。 - // 支持的过滤条件如下: - //
  • vpc-name:VPC实例名称,支持模糊查询。
  • - //
  • is-default :是否默认VPC。
  • - //
  • vpc-id :VPC实例ID,例如:vpc-f49l6u0z。
  • - //
  • cidr-block:VPC的CIDR。
  • - //
  • tag-key :按照标签键进行过滤,非必填参数。
  • - //
  • tag:tag-key:按照标签键值对进行过滤,非必填参数。 其中 tag-key 请使用具体的标签键进行替换,可参考示例2。
  • - // **说明:**若同一个过滤条件(Filter)存在多个Values,则同一Filter下Values间的关系为逻辑或(OR)关系;若存在多个过滤条件(Filter),Filter之间的关系为逻辑与(AND)关系。 - //
  • ipv6-cidr-block - String - (过滤条件)IPv6子网网段,形如: 2402:4e00:1717:8700::/64 。
  • - //
  • isp-type - String - (过滤条件)运营商类型,形如: BGP 取值范围:'BGP'-默认, 'CMCC'-中国移动, 'CTCC'-中国电信, 'CUCC'-中国联调。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。 - Offset *string `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *string `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeVpcsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpcsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpcsResponseParams struct { - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // VPC对象。 - VpcSet []*Vpc `json:"VpcSet,omitempty" name:"VpcSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpcsResponse struct { - *tchttp.BaseResponse - Response *DescribeVpcsResponseParams `json:"Response"` -} - -func (r *DescribeVpcsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpcsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnConnectionsRequestParams struct { - // VPN通道实例ID。形如:vpnx-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpnConnectionIds和Filters。 - VpnConnectionIds []*string `json:"VpnConnectionIds,omitempty" name:"VpnConnectionIds"` - - // 过滤条件。每次请求的Filters的上限为10,Filter.Values的上限为5。参数不支持同时指定VpnConnectionIds和Filters。 - //
  • vpc-id - String - VPC实例ID,形如:`vpc-0a36uwkr`。
  • - //
  • vpn-gateway-id - String - VPN网关实例ID,形如:`vpngw-p4lmqawn`。
  • - //
  • customer-gateway-id - String - 对端网关实例ID,形如:`cgw-l4rblw63`。
  • - //
  • vpn-connection-name - String - 通道名称,形如:`test-vpn`。
  • - //
  • vpn-connection-id - String - 通道实例ID,形如:`vpnx-5p7vkch8"`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于Offset的更进一步介绍请参考 API 简介中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeVpnConnectionsRequest struct { - *tchttp.BaseRequest - - // VPN通道实例ID。形如:vpnx-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpnConnectionIds和Filters。 - VpnConnectionIds []*string `json:"VpnConnectionIds,omitempty" name:"VpnConnectionIds"` - - // 过滤条件。每次请求的Filters的上限为10,Filter.Values的上限为5。参数不支持同时指定VpnConnectionIds和Filters。 - //
  • vpc-id - String - VPC实例ID,形如:`vpc-0a36uwkr`。
  • - //
  • vpn-gateway-id - String - VPN网关实例ID,形如:`vpngw-p4lmqawn`。
  • - //
  • customer-gateway-id - String - 对端网关实例ID,形如:`cgw-l4rblw63`。
  • - //
  • vpn-connection-name - String - 通道名称,形如:`test-vpn`。
  • - //
  • vpn-connection-id - String - 通道实例ID,形如:`vpnx-5p7vkch8"`。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认为0。关于Offset的更进一步介绍请参考 API 简介中的相关小节。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量,默认为20,最大值为100。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeVpnConnectionsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnConnectionsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnConnectionIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpnConnectionsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnConnectionsResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // VPN通道实例。 - VpnConnectionSet []*VpnConnection `json:"VpnConnectionSet,omitempty" name:"VpnConnectionSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpnConnectionsResponse struct { - *tchttp.BaseResponse - Response *DescribeVpnConnectionsResponseParams `json:"Response"` -} - -func (r *DescribeVpnConnectionsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnConnectionsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewayCcnRoutesRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 偏移量。默认值:0 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量。默认值:20 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeVpnGatewayCcnRoutesRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 偏移量。默认值:0 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量。默认值:20 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeVpnGatewayCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewayCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpnGatewayCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewayCcnRoutesResponseParams struct { - // 云联网路由(IDC网段)列表。 - RouteSet []*VpngwCcnRoutes `json:"RouteSet,omitempty" name:"RouteSet"` - - // 符合条件的对象数。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpnGatewayCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *DescribeVpnGatewayCcnRoutesResponseParams `json:"Response"` -} - -func (r *DescribeVpnGatewayCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewayCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewayRoutesRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 过滤条件, 条件包括(DestinationCidr, InstanceId,InstanceType)。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量, 默认0。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 单页个数, 默认20, 最大值100。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeVpnGatewayRoutesRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 过滤条件, 条件包括(DestinationCidr, InstanceId,InstanceType)。 - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量, 默认0。 - Offset *int64 `json:"Offset,omitempty" name:"Offset"` - - // 单页个数, 默认20, 最大值100。 - Limit *int64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeVpnGatewayRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewayRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpnGatewayRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewayRoutesResponseParams struct { - // VPN网关目的路由。 - Routes []*VpnGatewayRoute `json:"Routes,omitempty" name:"Routes"` - - // 路由条数。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpnGatewayRoutesResponse struct { - *tchttp.BaseResponse - Response *DescribeVpnGatewayRoutesResponseParams `json:"Response"` -} - -func (r *DescribeVpnGatewayRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewayRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewaySslClientsRequestParams struct { - // 过滤条件,参数不支持同时指定SslVpnClientIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID形如:vpc-f49l6u0z。
  • - //
  • vpn-gateway-id - String - (过滤条件)VPN实例ID形如:vpngw-5aluhh9t。
  • - //
  • ssl-vpn-server-id - String - (过滤条件)SSL-VPN-SERVER实例ID形如:vpns-1j2w6xpx。
  • - //
  • ssl-vpn-client-id - String - (过滤条件)SSL-VPN-CLIENT实例ID形如:vpnc-3rlxp4nd。
  • - //
  • ssl-vpn-client-name - String - (过滤条件)SSL-VPN-CLIENT实例名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认值0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数,默认值20。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // SSL-VPN-CLIENT实例ID。形如: - // vpns-1jww3xpx。每次请求的实例的上限为100。参数不支持同时指定SslVpnClientIds和Filters。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` - - // VPN门户网站使用。默认是False。 - IsVpnPortal *bool `json:"IsVpnPortal,omitempty" name:"IsVpnPortal"` -} - -type DescribeVpnGatewaySslClientsRequest struct { - *tchttp.BaseRequest - - // 过滤条件,参数不支持同时指定SslVpnClientIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID形如:vpc-f49l6u0z。
  • - //
  • vpn-gateway-id - String - (过滤条件)VPN实例ID形如:vpngw-5aluhh9t。
  • - //
  • ssl-vpn-server-id - String - (过滤条件)SSL-VPN-SERVER实例ID形如:vpns-1j2w6xpx。
  • - //
  • ssl-vpn-client-id - String - (过滤条件)SSL-VPN-CLIENT实例ID形如:vpnc-3rlxp4nd。
  • - //
  • ssl-vpn-client-name - String - (过滤条件)SSL-VPN-CLIENT实例名称。
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 偏移量,默认值0。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数,默认值20。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // SSL-VPN-CLIENT实例ID。形如: - // vpns-1jww3xpx。每次请求的实例的上限为100。参数不支持同时指定SslVpnClientIds和Filters。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` - - // VPN门户网站使用。默认是False。 - IsVpnPortal *bool `json:"IsVpnPortal,omitempty" name:"IsVpnPortal"` -} - -func (r *DescribeVpnGatewaySslClientsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewaySslClientsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "SslVpnClientIds") - delete(f, "IsVpnPortal") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpnGatewaySslClientsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewaySslClientsResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // SSL-VPN-CLIENT 实例列表。 - SslVpnClientSet []*SslVpnClient `json:"SslVpnClientSet,omitempty" name:"SslVpnClientSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpnGatewaySslClientsResponse struct { - *tchttp.BaseResponse - Response *DescribeVpnGatewaySslClientsResponseParams `json:"Response"` -} - -func (r *DescribeVpnGatewaySslClientsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewaySslClientsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewaySslServersRequestParams struct { - // 偏移量。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // SSL-VPN-SERVER实例ID。形如:vpngwSslServer-12345678。每次请求的实例的上限为100。参数不支持同时指定SslVpnServerIds和Filters。 - SslVpnServerIds []*string `json:"SslVpnServerIds,omitempty" name:"SslVpnServerIds"` - - // 过滤条件,参数不支持同时指定SslVpnServerIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • vpn-gateway-id - String - (过滤条件)VPN实例ID,形如:vpngw-5aluhh9t。
  • - //
  • vpn-gateway-name - String - (过滤条件)VPN实例名称。
  • - //
  • ssl-vpn-server-name - String - (过滤条件)SSL-VPN-SERVER实例名称。
  • - //
  • ssl-vpn-server-id - String - (过滤条件)SSL-VPN-SERVER实例ID,形如:vpns-xxx。
  • - Filters []*FilterObject `json:"Filters,omitempty" name:"Filters"` - - // vpn门户使用。 默认Flase - IsVpnPortal *bool `json:"IsVpnPortal,omitempty" name:"IsVpnPortal"` -} - -type DescribeVpnGatewaySslServersRequest struct { - *tchttp.BaseRequest - - // 偏移量。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // SSL-VPN-SERVER实例ID。形如:vpngwSslServer-12345678。每次请求的实例的上限为100。参数不支持同时指定SslVpnServerIds和Filters。 - SslVpnServerIds []*string `json:"SslVpnServerIds,omitempty" name:"SslVpnServerIds"` - - // 过滤条件,参数不支持同时指定SslVpnServerIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。
  • - //
  • vpn-gateway-id - String - (过滤条件)VPN实例ID,形如:vpngw-5aluhh9t。
  • - //
  • vpn-gateway-name - String - (过滤条件)VPN实例名称。
  • - //
  • ssl-vpn-server-name - String - (过滤条件)SSL-VPN-SERVER实例名称。
  • - //
  • ssl-vpn-server-id - String - (过滤条件)SSL-VPN-SERVER实例ID,形如:vpns-xxx。
  • - Filters []*FilterObject `json:"Filters,omitempty" name:"Filters"` - - // vpn门户使用。 默认Flase - IsVpnPortal *bool `json:"IsVpnPortal,omitempty" name:"IsVpnPortal"` -} - -func (r *DescribeVpnGatewaySslServersRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewaySslServersRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Offset") - delete(f, "Limit") - delete(f, "SslVpnServerIds") - delete(f, "Filters") - delete(f, "IsVpnPortal") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpnGatewaySslServersRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewaySslServersResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // SSL-VPN-SERVER 实例详细信息列表。 - SslVpnSeverSet []*SslVpnSever `json:"SslVpnSeverSet,omitempty" name:"SslVpnSeverSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpnGatewaySslServersResponse struct { - *tchttp.BaseResponse - Response *DescribeVpnGatewaySslServersResponseParams `json:"Response"` -} - -func (r *DescribeVpnGatewaySslServersResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewaySslServersResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewaysRequestParams struct { - // VPN网关实例ID。形如:vpngw-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpnGatewayIds和Filters。 - VpnGatewayIds []*string `json:"VpnGatewayIds,omitempty" name:"VpnGatewayIds"` - - // 过滤条件,参数不支持同时指定VpnGatewayIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID形如:vpc-f49l6u0z。
  • - //
  • vpn-gateway-id - String - (过滤条件)VPN实例ID形如:vpngw-5aluhh9t。
  • - //
  • vpn-gateway-name - String - (过滤条件)VPN实例名称。
  • - //
  • type - String - (过滤条件)VPN网关类型:'IPSEC', 'SSL'。
  • - //
  • public-ip-address- String - (过滤条件)公网IP。
  • - //
  • renew-flag - String - (过滤条件)网关续费类型,手动续费:'NOTIFY_AND_MANUAL_RENEW'、自动续费:'NOTIFY_AND_AUTO_RENEW'。
  • - //
  • zone - String - (过滤条件)VPN所在可用区,形如:ap-guangzhou-2。
  • - Filters []*FilterObject `json:"Filters,omitempty" name:"Filters"` - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -type DescribeVpnGatewaysRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。形如:vpngw-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpnGatewayIds和Filters。 - VpnGatewayIds []*string `json:"VpnGatewayIds,omitempty" name:"VpnGatewayIds"` - - // 过滤条件,参数不支持同时指定VpnGatewayIds和Filters。 - //
  • vpc-id - String - (过滤条件)VPC实例ID形如:vpc-f49l6u0z。
  • - //
  • vpn-gateway-id - String - (过滤条件)VPN实例ID形如:vpngw-5aluhh9t。
  • - //
  • vpn-gateway-name - String - (过滤条件)VPN实例名称。
  • - //
  • type - String - (过滤条件)VPN网关类型:'IPSEC', 'SSL'。
  • - //
  • public-ip-address- String - (过滤条件)公网IP。
  • - //
  • renew-flag - String - (过滤条件)网关续费类型,手动续费:'NOTIFY_AND_MANUAL_RENEW'、自动续费:'NOTIFY_AND_AUTO_RENEW'。
  • - //
  • zone - String - (过滤条件)VPN所在可用区,形如:ap-guangzhou-2。
  • - Filters []*FilterObject `json:"Filters,omitempty" name:"Filters"` - - // 偏移量 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 请求对象个数 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` -} - -func (r *DescribeVpnGatewaysRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewaysRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayIds") - delete(f, "Filters") - delete(f, "Offset") - delete(f, "Limit") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeVpnGatewaysRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DescribeVpnGatewaysResponseParams struct { - // 符合条件的实例数量。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // VPN网关实例详细信息列表。 - VpnGatewaySet []*VpnGateway `json:"VpnGatewaySet,omitempty" name:"VpnGatewaySet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DescribeVpnGatewaysResponse struct { - *tchttp.BaseResponse - Response *DescribeVpnGatewaysResponseParams `json:"Response"` -} - -func (r *DescribeVpnGatewaysResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DescribeVpnGatewaysResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type DestinationIpPortTranslationNatRule struct { - // 网络协议,可选值:`TCP`、`UDP`。 - IpProtocol *string `json:"IpProtocol,omitempty" name:"IpProtocol"` - - // 弹性IP。 - PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` - - // 公网端口。 - PublicPort *uint64 `json:"PublicPort,omitempty" name:"PublicPort"` - - // 内网地址。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 内网端口。 - PrivatePort *uint64 `json:"PrivatePort,omitempty" name:"PrivatePort"` - - // NAT网关转发规则描述。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -// Predefined struct for user -type DetachCcnInstancesRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 要解关联网络实例列表 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -type DetachCcnInstancesRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 要解关联网络实例列表 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -func (r *DetachCcnInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachCcnInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DetachCcnInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachCcnInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DetachCcnInstancesResponse struct { - *tchttp.BaseResponse - Response *DetachCcnInstancesResponseParams `json:"Response"` -} - -func (r *DetachCcnInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachCcnInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachClassicLinkVpcRequestParams struct { - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CVM实例ID查询。形如:ins-r8hr2upy。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -type DetachClassicLinkVpcRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // CVM实例ID查询。形如:ins-r8hr2upy。 - InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds"` -} - -func (r *DetachClassicLinkVpcRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachClassicLinkVpcRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "InstanceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DetachClassicLinkVpcRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachClassicLinkVpcResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DetachClassicLinkVpcResponse struct { - *tchttp.BaseResponse - Response *DetachClassicLinkVpcResponseParams `json:"Response"` -} - -func (r *DetachClassicLinkVpcResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachClassicLinkVpcResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachNetworkInterfaceRequestParams struct { - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // CVM实例ID。形如:ins-r8hr2upy。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -type DetachNetworkInterfaceRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // CVM实例ID。形如:ins-r8hr2upy。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -func (r *DetachNetworkInterfaceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachNetworkInterfaceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "InstanceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DetachNetworkInterfaceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachNetworkInterfaceResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DetachNetworkInterfaceResponse struct { - *tchttp.BaseResponse - Response *DetachNetworkInterfaceResponseParams `json:"Response"` -} - -func (r *DetachNetworkInterfaceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachNetworkInterfaceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachSnapshotInstancesRequestParams struct { - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 实例信息。 - Instances []*SnapshotInstance `json:"Instances,omitempty" name:"Instances"` -} - -type DetachSnapshotInstancesRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 实例信息。 - Instances []*SnapshotInstance `json:"Instances,omitempty" name:"Instances"` -} - -func (r *DetachSnapshotInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachSnapshotInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyId") - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DetachSnapshotInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DetachSnapshotInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DetachSnapshotInstancesResponse struct { - *tchttp.BaseResponse - Response *DetachSnapshotInstancesResponseParams `json:"Response"` -} - -func (r *DetachSnapshotInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DetachSnapshotInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type DhcpIp struct { - // `DhcpIp`的`ID`,是`DhcpIp`的唯一标识。 - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` - - // `DhcpIp`所在私有网络`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `DhcpIp`所在子网`ID`。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // `DhcpIp`的名称。 - DhcpIpName *string `json:"DhcpIpName,omitempty" name:"DhcpIpName"` - - // IP地址。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 绑定`EIP`。 - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` - - // `DhcpIp`关联弹性网卡`ID`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 被绑定的实例`ID`。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 状态: - //
  • `AVAILABLE`:运行中
  • - //
  • `UNBIND`:未绑定
  • - State *string `json:"State,omitempty" name:"State"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type DirectConnectGateway struct { - // 专线网关`ID`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 专线网关名称。 - DirectConnectGatewayName *string `json:"DirectConnectGatewayName,omitempty" name:"DirectConnectGatewayName"` - - // 专线网关关联`VPC`实例`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 关联网络类型: - //
  • `VPC` - 私有网络
  • - //
  • `CCN` - 云联网
  • - NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` - - // 关联网络实例`ID`: - //
  • `NetworkType`为`VPC`时,这里为私有网络实例`ID`
  • - //
  • `NetworkType`为`CCN`时,这里为云联网实例`ID`
  • - NetworkInstanceId *string `json:"NetworkInstanceId,omitempty" name:"NetworkInstanceId"` - - // 网关类型: - //
  • NORMAL - 标准型,注:云联网只支持标准型
  • - //
  • NAT - NAT型
  • - // NAT类型支持网络地址转换配置,类型确定后不能修改;一个私有网络可以创建一个NAT类型的专线网关和一个非NAT类型的专线网关 - GatewayType *string `json:"GatewayType,omitempty" name:"GatewayType"` - - // 创建时间。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 专线网关IP。 - DirectConnectGatewayIp *string `json:"DirectConnectGatewayIp,omitempty" name:"DirectConnectGatewayIp"` - - // 专线网关关联`CCN`实例`ID`。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 云联网路由学习类型: - //
  • `BGP` - 自动学习。
  • - //
  • `STATIC` - 静态,即用户配置。
  • - CcnRouteType *string `json:"CcnRouteType,omitempty" name:"CcnRouteType"` - - // 是否启用BGP。 - EnableBGP *bool `json:"EnableBGP,omitempty" name:"EnableBGP"` - - // 开启和关闭BGP的community属性。 - EnableBGPCommunity *bool `json:"EnableBGPCommunity,omitempty" name:"EnableBGPCommunity"` - - // 绑定的NAT网关ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 专线网关是否支持VXLAN架构 - // 注意:此字段可能返回 null,表示取不到有效值。 - VXLANSupport []*bool `json:"VXLANSupport,omitempty" name:"VXLANSupport"` - - // 云联网路由发布模式:`standard`(标准模式)、`exquisite`(精细模式)。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ModeType *string `json:"ModeType,omitempty" name:"ModeType"` - - // 是否为localZone专线网关。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LocalZone *bool `json:"LocalZone,omitempty" name:"LocalZone"` - - // 专线网关所在可用区 - // 注意:此字段可能返回 null,表示取不到有效值。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 网关流控明细启用状态: - // 0:关闭 - // 1:开启 - // 注意:此字段可能返回 null,表示取不到有效值。 - EnableFlowDetails *uint64 `json:"EnableFlowDetails,omitempty" name:"EnableFlowDetails"` - - // 开启、关闭网关流控明细时间 - // 注意:此字段可能返回 null,表示取不到有效值。 - FlowDetailsUpdateTime *string `json:"FlowDetailsUpdateTime,omitempty" name:"FlowDetailsUpdateTime"` - - // 是否支持开启网关流控明细 - // 0:不支持 - // 1:支持 - // 注意:此字段可能返回 null,表示取不到有效值。 - NewAfc *uint64 `json:"NewAfc,omitempty" name:"NewAfc"` - - // 专线网关接入网络类型: - //
  • `VXLAN` - VXLAN类型。
  • - //
  • `MPLS` - MPLS类型。
  • - //
  • `Hybrid` - Hybrid类型。
  • - // 注意:此字段可能返回 null,表示取不到有效值。 - AccessNetworkType *string `json:"AccessNetworkType,omitempty" name:"AccessNetworkType"` - - // 跨可用区容灾专线网关的可用区列表 - // 注意:此字段可能返回 null,表示取不到有效值。 - HaZoneList []*string `json:"HaZoneList,omitempty" name:"HaZoneList"` -} - -type DirectConnectGatewayCcnRoute struct { - // 路由ID。 - RouteId *string `json:"RouteId,omitempty" name:"RouteId"` - - // IDC网段。 - DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` - - // `BGP`的`AS-Path`属性。 - ASPath []*string `json:"ASPath,omitempty" name:"ASPath"` - - // 备注 - Description *string `json:"Description,omitempty" name:"Description"` - - // 最后更新时间 - UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` -} - -type DirectConnectSubnet struct { - // 专线网关ID - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // IDC子网网段 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` -} - -// Predefined struct for user -type DisableCcnRoutesRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN路由策略唯一ID。形如:ccnr-f49l6u0z。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` -} - -type DisableCcnRoutesRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN路由策略唯一ID。形如:ccnr-f49l6u0z。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` -} - -func (r *DisableCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "RouteIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableCcnRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisableCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *DisableCcnRoutesResponseParams `json:"Response"` -} - -func (r *DisableCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableFlowLogsRequestParams struct { - // 流日志Id。 - FlowLogIds []*string `json:"FlowLogIds,omitempty" name:"FlowLogIds"` -} - -type DisableFlowLogsRequest struct { - *tchttp.BaseRequest - - // 流日志Id。 - FlowLogIds []*string `json:"FlowLogIds,omitempty" name:"FlowLogIds"` -} - -func (r *DisableFlowLogsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableFlowLogsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "FlowLogIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableFlowLogsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableFlowLogsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisableFlowLogsResponse struct { - *tchttp.BaseResponse - Response *DisableFlowLogsResponseParams `json:"Response"` -} - -func (r *DisableFlowLogsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableFlowLogsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableGatewayFlowMonitorRequestParams struct { - // 网关实例ID,目前我们支持的网关实例类型有, - // 专线网关实例ID,形如,`dcg-ltjahce6`; - // Nat网关实例ID,形如,`nat-ltjahce6`; - // VPN网关实例ID,形如,`vpn-ltjahce6`。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` -} - -type DisableGatewayFlowMonitorRequest struct { - *tchttp.BaseRequest - - // 网关实例ID,目前我们支持的网关实例类型有, - // 专线网关实例ID,形如,`dcg-ltjahce6`; - // Nat网关实例ID,形如,`nat-ltjahce6`; - // VPN网关实例ID,形如,`vpn-ltjahce6`。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` -} - -func (r *DisableGatewayFlowMonitorRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableGatewayFlowMonitorRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "GatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableGatewayFlowMonitorRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableGatewayFlowMonitorResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisableGatewayFlowMonitorResponse struct { - *tchttp.BaseResponse - Response *DisableGatewayFlowMonitorResponseParams `json:"Response"` -} - -func (r *DisableGatewayFlowMonitorResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableGatewayFlowMonitorResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableRoutesRequestParams struct { - // 路由表唯一ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略ID。不能和RouteItemIds同时使用,但至少输入一个。该参数取值可通过查询路由列表([DescribeRouteTables](https://cloud.tencent.com/document/product/215/15763))获取。 - RouteIds []*uint64 `json:"RouteIds,omitempty" name:"RouteIds"` - - // 路由策略唯一ID。不能和RouteIds同时使用,但至少输入一个。该参数取值可通过查询路由列表([DescribeRouteTables](https://cloud.tencent.com/document/product/215/15763))获取。 - RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds"` -} - -type DisableRoutesRequest struct { - *tchttp.BaseRequest - - // 路由表唯一ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略ID。不能和RouteItemIds同时使用,但至少输入一个。该参数取值可通过查询路由列表([DescribeRouteTables](https://cloud.tencent.com/document/product/215/15763))获取。 - RouteIds []*uint64 `json:"RouteIds,omitempty" name:"RouteIds"` - - // 路由策略唯一ID。不能和RouteIds同时使用,但至少输入一个。该参数取值可通过查询路由列表([DescribeRouteTables](https://cloud.tencent.com/document/product/215/15763))获取。 - RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds"` -} - -func (r *DisableRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "RouteIds") - delete(f, "RouteItemIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisableRoutesResponse struct { - *tchttp.BaseResponse - Response *DisableRoutesResponseParams `json:"Response"` -} - -func (r *DisableRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableSnapshotPoliciesRequestParams struct { - // 快照策略Id。 - SnapshotPolicyIds []*string `json:"SnapshotPolicyIds,omitempty" name:"SnapshotPolicyIds"` -} - -type DisableSnapshotPoliciesRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyIds []*string `json:"SnapshotPolicyIds,omitempty" name:"SnapshotPolicyIds"` -} - -func (r *DisableSnapshotPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableSnapshotPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableSnapshotPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableSnapshotPoliciesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisableSnapshotPoliciesResponse struct { - *tchttp.BaseResponse - Response *DisableSnapshotPoliciesResponseParams `json:"Response"` -} - -func (r *DisableSnapshotPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableSnapshotPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableVpnGatewaySslClientCertRequestParams struct { - // SSL-VPN-CLIENT 实例ID。不可和SslVpnClientIds同时使用。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // SSL-VPN-CLIENT 实例ID列表。批量禁用时使用。不可和SslVpnClientId同时使用。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` -} - -type DisableVpnGatewaySslClientCertRequest struct { - *tchttp.BaseRequest - - // SSL-VPN-CLIENT 实例ID。不可和SslVpnClientIds同时使用。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // SSL-VPN-CLIENT 实例ID列表。批量禁用时使用。不可和SslVpnClientId同时使用。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` -} - -func (r *DisableVpnGatewaySslClientCertRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableVpnGatewaySslClientCertRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SslVpnClientId") - delete(f, "SslVpnClientIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableVpnGatewaySslClientCertRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisableVpnGatewaySslClientCertResponseParams struct { - // 异步任务实例ID。 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisableVpnGatewaySslClientCertResponse struct { - *tchttp.BaseResponse - Response *DisableVpnGatewaySslClientCertResponseParams `json:"Response"` -} - -func (r *DisableVpnGatewaySslClientCertResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisableVpnGatewaySslClientCertResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateAddressRequestParams struct { - // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 表示解绑 EIP 之后是否分配普通公网 IP。取值范围:
  • TRUE:表示解绑 EIP 之后分配普通公网 IP。
  • FALSE:表示解绑 EIP 之后不分配普通公网 IP。
    默认取值:FALSE。

    只有满足以下条件时才能指定该参数:
  • 只有在解绑主网卡的主内网 IP 上的 EIP 时才能指定该参数。
  • 解绑 EIP 后重新分配普通公网 IP 操作一个账号每天最多操作 10 次;详情可通过 [DescribeAddressQuota](https://cloud.tencent.com/document/api/213/1378) 接口获取。 - ReallocateNormalPublicIp *bool `json:"ReallocateNormalPublicIp,omitempty" name:"ReallocateNormalPublicIp"` -} - -type DisassociateAddressRequest struct { - *tchttp.BaseRequest - - // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 表示解绑 EIP 之后是否分配普通公网 IP。取值范围:
  • TRUE:表示解绑 EIP 之后分配普通公网 IP。
  • FALSE:表示解绑 EIP 之后不分配普通公网 IP。
    默认取值:FALSE。

    只有满足以下条件时才能指定该参数:
  • 只有在解绑主网卡的主内网 IP 上的 EIP 时才能指定该参数。
  • 解绑 EIP 后重新分配普通公网 IP 操作一个账号每天最多操作 10 次;详情可通过 [DescribeAddressQuota](https://cloud.tencent.com/document/api/213/1378) 接口获取。 - ReallocateNormalPublicIp *bool `json:"ReallocateNormalPublicIp,omitempty" name:"ReallocateNormalPublicIp"` -} - -func (r *DisassociateAddressRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateAddressRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressId") - delete(f, "ReallocateNormalPublicIp") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateAddressRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateAddressResponseParams struct { - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateAddressResponse struct { - *tchttp.BaseResponse - Response *DisassociateAddressResponseParams `json:"Response"` -} - -func (r *DisassociateAddressResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateAddressResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateDhcpIpWithAddressIpRequestParams struct { - // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。必须是已绑定`EIP`的`DhcpIp`。 - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` -} - -type DisassociateDhcpIpWithAddressIpRequest struct { - *tchttp.BaseRequest - - // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。必须是已绑定`EIP`的`DhcpIp`。 - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` -} - -func (r *DisassociateDhcpIpWithAddressIpRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateDhcpIpWithAddressIpRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DhcpIpId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateDhcpIpWithAddressIpRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateDhcpIpWithAddressIpResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateDhcpIpWithAddressIpResponse struct { - *tchttp.BaseResponse - Response *DisassociateDhcpIpWithAddressIpResponseParams `json:"Response"` -} - -func (r *DisassociateDhcpIpWithAddressIpResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateDhcpIpWithAddressIpResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateDirectConnectGatewayNatGatewayRequestParams struct { - // 专线网关ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关ID。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` -} - -type DisassociateDirectConnectGatewayNatGatewayRequest struct { - *tchttp.BaseRequest - - // 专线网关ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关ID。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` -} - -func (r *DisassociateDirectConnectGatewayNatGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateDirectConnectGatewayNatGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "NatGatewayId") - delete(f, "DirectConnectGatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateDirectConnectGatewayNatGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateDirectConnectGatewayNatGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateDirectConnectGatewayNatGatewayResponse struct { - *tchttp.BaseResponse - Response *DisassociateDirectConnectGatewayNatGatewayResponseParams `json:"Response"` -} - -func (r *DisassociateDirectConnectGatewayNatGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateDirectConnectGatewayNatGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateNatGatewayAddressRequestParams struct { - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 待解绑NAT网关的弹性IP数组。 - PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses"` -} - -type DisassociateNatGatewayAddressRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 待解绑NAT网关的弹性IP数组。 - PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses"` -} - -func (r *DisassociateNatGatewayAddressRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateNatGatewayAddressRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "PublicIpAddresses") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateNatGatewayAddressRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateNatGatewayAddressResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateNatGatewayAddressResponse struct { - *tchttp.BaseResponse - Response *DisassociateNatGatewayAddressResponseParams `json:"Response"` -} - -func (r *DisassociateNatGatewayAddressResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateNatGatewayAddressResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateNetworkAclSubnetsRequestParams struct { - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 子网实例ID数组。例如:[subnet-12345678]。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` -} - -type DisassociateNetworkAclSubnetsRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 子网实例ID数组。例如:[subnet-12345678]。 - SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds"` -} - -func (r *DisassociateNetworkAclSubnetsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateNetworkAclSubnetsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - delete(f, "SubnetIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateNetworkAclSubnetsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateNetworkAclSubnetsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateNetworkAclSubnetsResponse struct { - *tchttp.BaseResponse - Response *DisassociateNetworkAclSubnetsResponseParams `json:"Response"` -} - -func (r *DisassociateNetworkAclSubnetsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateNetworkAclSubnetsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateNetworkInterfaceSecurityGroupsRequestParams struct { - // 弹性网卡实例ID。形如:eni-pxir56ns。每次请求的实例的上限为100。 - NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds"` - - // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。每次请求的实例的上限为100。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -type DisassociateNetworkInterfaceSecurityGroupsRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID。形如:eni-pxir56ns。每次请求的实例的上限为100。 - NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds"` - - // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。每次请求的实例的上限为100。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -func (r *DisassociateNetworkInterfaceSecurityGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateNetworkInterfaceSecurityGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceIds") - delete(f, "SecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateNetworkInterfaceSecurityGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateNetworkInterfaceSecurityGroupsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateNetworkInterfaceSecurityGroupsResponse struct { - *tchttp.BaseResponse - Response *DisassociateNetworkInterfaceSecurityGroupsResponseParams `json:"Response"` -} - -func (r *DisassociateNetworkInterfaceSecurityGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateNetworkInterfaceSecurityGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateVpcEndPointSecurityGroupsRequestParams struct { - // 安全组ID数组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 终端节点ID。 - EndPointId *string `json:"EndPointId,omitempty" name:"EndPointId"` -} - -type DisassociateVpcEndPointSecurityGroupsRequest struct { - *tchttp.BaseRequest - - // 安全组ID数组。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 终端节点ID。 - EndPointId *string `json:"EndPointId,omitempty" name:"EndPointId"` -} - -func (r *DisassociateVpcEndPointSecurityGroupsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateVpcEndPointSecurityGroupsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupIds") - delete(f, "EndPointId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisassociateVpcEndPointSecurityGroupsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DisassociateVpcEndPointSecurityGroupsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DisassociateVpcEndPointSecurityGroupsResponse struct { - *tchttp.BaseResponse - Response *DisassociateVpcEndPointSecurityGroupsResponseParams `json:"Response"` -} - -func (r *DisassociateVpcEndPointSecurityGroupsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DisassociateVpcEndPointSecurityGroupsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DownloadCustomerGatewayConfigurationRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN通道实例ID。形如:vpnx-f49l6u0z。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` - - // 对端网关厂商信息对象,可通过[DescribeCustomerGatewayVendors](https://cloud.tencent.com/document/api/215/17513)获取。 - CustomerGatewayVendor *CustomerGatewayVendor `json:"CustomerGatewayVendor,omitempty" name:"CustomerGatewayVendor"` - - // 通道接入设备物理接口名称。 - InterfaceName *string `json:"InterfaceName,omitempty" name:"InterfaceName"` -} - -type DownloadCustomerGatewayConfigurationRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN通道实例ID。形如:vpnx-f49l6u0z。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` - - // 对端网关厂商信息对象,可通过[DescribeCustomerGatewayVendors](https://cloud.tencent.com/document/api/215/17513)获取。 - CustomerGatewayVendor *CustomerGatewayVendor `json:"CustomerGatewayVendor,omitempty" name:"CustomerGatewayVendor"` - - // 通道接入设备物理接口名称。 - InterfaceName *string `json:"InterfaceName,omitempty" name:"InterfaceName"` -} - -func (r *DownloadCustomerGatewayConfigurationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DownloadCustomerGatewayConfigurationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "VpnConnectionId") - delete(f, "CustomerGatewayVendor") - delete(f, "InterfaceName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DownloadCustomerGatewayConfigurationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DownloadCustomerGatewayConfigurationResponseParams struct { - // XML格式配置信息。 - CustomerGatewayConfiguration *string `json:"CustomerGatewayConfiguration,omitempty" name:"CustomerGatewayConfiguration"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DownloadCustomerGatewayConfigurationResponse struct { - *tchttp.BaseResponse - Response *DownloadCustomerGatewayConfigurationResponseParams `json:"Response"` -} - -func (r *DownloadCustomerGatewayConfigurationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DownloadCustomerGatewayConfigurationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DownloadVpnGatewaySslClientCertRequestParams struct { - // SSL-VPN-CLIENT 实例ID。不可以和SslVpnClientIds同时使用。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // SAML Token(SAML令牌)。 - SamlToken *string `json:"SamlToken,omitempty" name:"SamlToken"` - - // VPN门户网站使用。默认False - IsVpnPortal *bool `json:"IsVpnPortal,omitempty" name:"IsVpnPortal"` - - // SSL-VPN-CLIENT 实例ID列表。批量下载时使用。不可以和SslVpnClientId同时使用。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` -} - -type DownloadVpnGatewaySslClientCertRequest struct { - *tchttp.BaseRequest - - // SSL-VPN-CLIENT 实例ID。不可以和SslVpnClientIds同时使用。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // SAML Token(SAML令牌)。 - SamlToken *string `json:"SamlToken,omitempty" name:"SamlToken"` - - // VPN门户网站使用。默认False - IsVpnPortal *bool `json:"IsVpnPortal,omitempty" name:"IsVpnPortal"` - - // SSL-VPN-CLIENT 实例ID列表。批量下载时使用。不可以和SslVpnClientId同时使用。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` -} - -func (r *DownloadVpnGatewaySslClientCertRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DownloadVpnGatewaySslClientCertRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SslVpnClientId") - delete(f, "SamlToken") - delete(f, "IsVpnPortal") - delete(f, "SslVpnClientIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DownloadVpnGatewaySslClientCertRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type DownloadVpnGatewaySslClientCertResponseParams struct { - // SSL-VPN 客户端配置。 - SslClientConfigsSet *string `json:"SslClientConfigsSet,omitempty" name:"SslClientConfigsSet"` - - // SSL-VPN 客户端配置。 - SslClientConfig []*SslClientConfig `json:"SslClientConfig,omitempty" name:"SslClientConfig"` - - // 是否鉴权成功 只有传入SamlToken 才生效,1为成功,0为失败。 - Authenticated *uint64 `json:"Authenticated,omitempty" name:"Authenticated"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type DownloadVpnGatewaySslClientCertResponse struct { - *tchttp.BaseResponse - Response *DownloadVpnGatewaySslClientCertResponseParams `json:"Response"` -} - -func (r *DownloadVpnGatewaySslClientCertResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *DownloadVpnGatewaySslClientCertResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableCcnRoutesRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN路由策略唯一ID。形如:ccnr-f49l6u0z。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` -} - -type EnableCcnRoutesRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN路由策略唯一ID。形如:ccnr-f49l6u0z。 - RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds"` -} - -func (r *EnableCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "RouteIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableCcnRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type EnableCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *EnableCcnRoutesResponseParams `json:"Response"` -} - -func (r *EnableCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableFlowLogsRequestParams struct { - // 流日志Id。 - FlowLogIds []*string `json:"FlowLogIds,omitempty" name:"FlowLogIds"` -} - -type EnableFlowLogsRequest struct { - *tchttp.BaseRequest - - // 流日志Id。 - FlowLogIds []*string `json:"FlowLogIds,omitempty" name:"FlowLogIds"` -} - -func (r *EnableFlowLogsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableFlowLogsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "FlowLogIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableFlowLogsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableFlowLogsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type EnableFlowLogsResponse struct { - *tchttp.BaseResponse - Response *EnableFlowLogsResponseParams `json:"Response"` -} - -func (r *EnableFlowLogsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableFlowLogsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableGatewayFlowMonitorRequestParams struct { - // 网关实例ID,目前我们支持的网关实例有, - // 专线网关实例ID,形如,`dcg-ltjahce6`; - // Nat网关实例ID,形如,`nat-ltjahce6`; - // VPN网关实例ID,形如,`vpn-ltjahce6`。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` -} - -type EnableGatewayFlowMonitorRequest struct { - *tchttp.BaseRequest - - // 网关实例ID,目前我们支持的网关实例有, - // 专线网关实例ID,形如,`dcg-ltjahce6`; - // Nat网关实例ID,形如,`nat-ltjahce6`; - // VPN网关实例ID,形如,`vpn-ltjahce6`。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` -} - -func (r *EnableGatewayFlowMonitorRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableGatewayFlowMonitorRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "GatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableGatewayFlowMonitorRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableGatewayFlowMonitorResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type EnableGatewayFlowMonitorResponse struct { - *tchttp.BaseResponse - Response *EnableGatewayFlowMonitorResponseParams `json:"Response"` -} - -func (r *EnableGatewayFlowMonitorResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableGatewayFlowMonitorResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableRoutesRequestParams struct { - // 路由表唯一ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略ID。不能和RouteItemIds同时使用,但至少输入一个。该参数取值可通过查询路由列表([DescribeRouteTables](https://cloud.tencent.com/document/product/215/15763))获取。 - RouteIds []*uint64 `json:"RouteIds,omitempty" name:"RouteIds"` - - // 路由策略唯一ID。不能和RouteIds同时使用,但至少输入一个。该参数取值可通过查询路由列表([DescribeRouteTables](https://cloud.tencent.com/document/product/215/15763))获取。 - RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds"` -} - -type EnableRoutesRequest struct { - *tchttp.BaseRequest - - // 路由表唯一ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略ID。不能和RouteItemIds同时使用,但至少输入一个。该参数取值可通过查询路由列表([DescribeRouteTables](https://cloud.tencent.com/document/product/215/15763))获取。 - RouteIds []*uint64 `json:"RouteIds,omitempty" name:"RouteIds"` - - // 路由策略唯一ID。不能和RouteIds同时使用,但至少输入一个。该参数取值可通过查询路由列表([DescribeRouteTables](https://cloud.tencent.com/document/product/215/15763))获取。 - RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds"` -} - -func (r *EnableRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "RouteIds") - delete(f, "RouteItemIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type EnableRoutesResponse struct { - *tchttp.BaseResponse - Response *EnableRoutesResponseParams `json:"Response"` -} - -func (r *EnableRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableSnapshotPoliciesRequestParams struct { - // 快照策略Id。 - SnapshotPolicyIds []*string `json:"SnapshotPolicyIds,omitempty" name:"SnapshotPolicyIds"` -} - -type EnableSnapshotPoliciesRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyIds []*string `json:"SnapshotPolicyIds,omitempty" name:"SnapshotPolicyIds"` -} - -func (r *EnableSnapshotPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableSnapshotPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableSnapshotPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableSnapshotPoliciesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type EnableSnapshotPoliciesResponse struct { - *tchttp.BaseResponse - Response *EnableSnapshotPoliciesResponseParams `json:"Response"` -} - -func (r *EnableSnapshotPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableSnapshotPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableVpcEndPointConnectRequestParams struct { - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 终端节点ID。 - EndPointId []*string `json:"EndPointId,omitempty" name:"EndPointId"` - - // 是否接受终端节点连接请求。 - //
  • true:自动接受。
  • false:不自动接受。
  • - AcceptFlag *bool `json:"AcceptFlag,omitempty" name:"AcceptFlag"` -} - -type EnableVpcEndPointConnectRequest struct { - *tchttp.BaseRequest - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 终端节点ID。 - EndPointId []*string `json:"EndPointId,omitempty" name:"EndPointId"` - - // 是否接受终端节点连接请求。 - //
  • true:自动接受。
  • false:不自动接受。
  • - AcceptFlag *bool `json:"AcceptFlag,omitempty" name:"AcceptFlag"` -} - -func (r *EnableVpcEndPointConnectRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableVpcEndPointConnectRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "EndPointServiceId") - delete(f, "EndPointId") - delete(f, "AcceptFlag") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableVpcEndPointConnectRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableVpcEndPointConnectResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type EnableVpcEndPointConnectResponse struct { - *tchttp.BaseResponse - Response *EnableVpcEndPointConnectResponseParams `json:"Response"` -} - -func (r *EnableVpcEndPointConnectResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableVpcEndPointConnectResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableVpnGatewaySslClientCertRequestParams struct { - // SSL-VPN-CLIENT 实例ID。不可和SslVpnClientIds同时使用。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // SSL-VPN-CLIENT 实例ID列表。批量启用时使用。不可和SslVpnClientId同时使用。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` -} - -type EnableVpnGatewaySslClientCertRequest struct { - *tchttp.BaseRequest - - // SSL-VPN-CLIENT 实例ID。不可和SslVpnClientIds同时使用。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // SSL-VPN-CLIENT 实例ID列表。批量启用时使用。不可和SslVpnClientId同时使用。 - SslVpnClientIds []*string `json:"SslVpnClientIds,omitempty" name:"SslVpnClientIds"` -} - -func (r *EnableVpnGatewaySslClientCertRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableVpnGatewaySslClientCertRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SslVpnClientId") - delete(f, "SslVpnClientIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableVpnGatewaySslClientCertRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type EnableVpnGatewaySslClientCertResponseParams struct { - // 异步任务实例ID。 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type EnableVpnGatewaySslClientCertResponse struct { - *tchttp.BaseResponse - Response *EnableVpnGatewaySslClientCertResponseParams `json:"Response"` -} - -func (r *EnableVpnGatewaySslClientCertResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *EnableVpnGatewaySslClientCertResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type EndPoint struct { - // 终端节点ID。 - EndPointId *string `json:"EndPointId,omitempty" name:"EndPointId"` - - // VPCID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // APPID。 - EndPointOwner *string `json:"EndPointOwner,omitempty" name:"EndPointOwner"` - - // 终端节点名称。 - EndPointName *string `json:"EndPointName,omitempty" name:"EndPointName"` - - // 终端节点服务的VPCID。 - ServiceVpcId *string `json:"ServiceVpcId,omitempty" name:"ServiceVpcId"` - - // 终端节点服务的VIP。 - ServiceVip *string `json:"ServiceVip,omitempty" name:"ServiceVip"` - - // 终端节点服务的ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 终端节点的VIP。 - EndPointVip *string `json:"EndPointVip,omitempty" name:"EndPointVip"` - - // 终端节点状态,ACTIVE:可用,PENDING:待接受,ACCEPTING:接受中,REJECTED:已拒绝,FAILED:失败。 - State *string `json:"State,omitempty" name:"State"` - - // 创建时间。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 终端节点绑定的安全组实例ID列表。 - GroupSet []*string `json:"GroupSet,omitempty" name:"GroupSet"` - - // 终端节点服务名称。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ServiceName *string `json:"ServiceName,omitempty" name:"ServiceName"` -} - -type EndPointService struct { - // 终端节点服务ID - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // VPCID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // APPID。 - ServiceOwner *string `json:"ServiceOwner,omitempty" name:"ServiceOwner"` - - // 终端节点服务名称。 - ServiceName *string `json:"ServiceName,omitempty" name:"ServiceName"` - - // 后端服务的VIP。 - ServiceVip *string `json:"ServiceVip,omitempty" name:"ServiceVip"` - - // 后端服务的ID,比如lb-xxx。 - ServiceInstanceId *string `json:"ServiceInstanceId,omitempty" name:"ServiceInstanceId"` - - // 是否自动接受。 - AutoAcceptFlag *bool `json:"AutoAcceptFlag,omitempty" name:"AutoAcceptFlag"` - - // 关联的终端节点个数。 - // 注意:此字段可能返回 null,表示取不到有效值。 - EndPointCount *uint64 `json:"EndPointCount,omitempty" name:"EndPointCount"` - - // 终端节点对象数组。 - // 注意:此字段可能返回 null,表示取不到有效值。 - EndPointSet []*EndPoint `json:"EndPointSet,omitempty" name:"EndPointSet"` - - // 创建时间。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 挂载的PAAS服务类型,CLB,CDB,CRS - ServiceType *string `json:"ServiceType,omitempty" name:"ServiceType"` -} - -type Filter struct { - // 属性名称, 若存在多个Filter时,Filter间的关系为逻辑与(AND)关系。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 属性值, 若同一个Filter存在多个Values,同一Filter下Values间的关系为逻辑或(OR)关系。当值类型为布尔类型时,可直接取值为字符串"TRUE"或 "FALSE"。 - Values []*string `json:"Values,omitempty" name:"Values"` -} - -type FilterObject struct { - // 属性名称, 若存在多个Filter时,Filter间的关系为逻辑与(AND)关系。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 属性值, 若同一个Filter存在多个Values,同一Filter下Values间的关系为逻辑或(OR)关系。 - Values []*string `json:"Values,omitempty" name:"Values"` -} - -type FlowLog struct { - // 私用网络ID或者统一ID,建议使用统一ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` - - // 流日志实例名字。 - FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` - - // 流日志所属资源类型,VPC|SUBNET|NETWORKINTERFACE|CCN|NAT|DCG。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源唯一ID。 - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 流日志采集类型,ACCEPT|REJECT|ALL。 - TrafficType *string `json:"TrafficType,omitempty" name:"TrafficType"` - - // 流日志存储ID。 - CloudLogId *string `json:"CloudLogId,omitempty" name:"CloudLogId"` - - // 流日志存储ID状态。 - CloudLogState *string `json:"CloudLogState,omitempty" name:"CloudLogState"` - - // 流日志描述信息。 - FlowLogDescription *string `json:"FlowLogDescription,omitempty" name:"FlowLogDescription"` - - // 流日志创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 标签列表,例如:[{"Key": "city", "Value": "shanghai"}]。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // 是否启用,true-启用,false-停用。 - Enable *bool `json:"Enable,omitempty" name:"Enable"` - - // 消费端类型:cls、ckafka。 - // 注意:此字段可能返回 null,表示取不到有效值。 - StorageType *string `json:"StorageType,omitempty" name:"StorageType"` - - // 消费端信息,当消费端类型为ckafka时返回。 - // 注意:此字段可能返回 null,表示取不到有效值。 - FlowLogStorage *FlowLogStorage `json:"FlowLogStorage,omitempty" name:"FlowLogStorage"` - - // 流日志存储ID对应的地域信息。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CloudLogRegion *string `json:"CloudLogRegion,omitempty" name:"CloudLogRegion"` -} - -type FlowLogStorage struct { - // 存储实例Id,当流日志存储类型为ckafka时,必填。 - StorageId *string `json:"StorageId,omitempty" name:"StorageId"` - - // 主题Id,当流日志存储类型为ckafka时,必填。 - // 注意:此字段可能返回 null,表示取不到有效值。 - StorageTopic *string `json:"StorageTopic,omitempty" name:"StorageTopic"` -} - -type GatewayFlowMonitorDetail struct { - // 来源`IP`。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 入包量。 - InPkg *uint64 `json:"InPkg,omitempty" name:"InPkg"` - - // 出包量。 - OutPkg *uint64 `json:"OutPkg,omitempty" name:"OutPkg"` - - // 入流量,单位:`Byte`。 - InTraffic *uint64 `json:"InTraffic,omitempty" name:"InTraffic"` - - // 出流量,单位:`Byte`。 - OutTraffic *uint64 `json:"OutTraffic,omitempty" name:"OutTraffic"` -} - -type GatewayQos struct { - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 云服务器内网IP。 - IpAddress *string `json:"IpAddress,omitempty" name:"IpAddress"` - - // 流控带宽值。 - Bandwidth *int64 `json:"Bandwidth,omitempty" name:"Bandwidth"` - - // 创建时间。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` -} - -// Predefined struct for user -type GenerateVpnConnectionDefaultHealthCheckIpRequestParams struct { - // VPN网关id, 例如:vpngw-1w9tue3d - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` -} - -type GenerateVpnConnectionDefaultHealthCheckIpRequest struct { - *tchttp.BaseRequest - - // VPN网关id, 例如:vpngw-1w9tue3d - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` -} - -func (r *GenerateVpnConnectionDefaultHealthCheckIpRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *GenerateVpnConnectionDefaultHealthCheckIpRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GenerateVpnConnectionDefaultHealthCheckIpRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type GenerateVpnConnectionDefaultHealthCheckIpResponseParams struct { - // VPN通道健康检查本端ip - HealthCheckLocalIp *string `json:"HealthCheckLocalIp,omitempty" name:"HealthCheckLocalIp"` - - // VPN通道健康检查对端ip - HealthCheckRemoteIp *string `json:"HealthCheckRemoteIp,omitempty" name:"HealthCheckRemoteIp"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type GenerateVpnConnectionDefaultHealthCheckIpResponse struct { - *tchttp.BaseResponse - Response *GenerateVpnConnectionDefaultHealthCheckIpResponseParams `json:"Response"` -} - -func (r *GenerateVpnConnectionDefaultHealthCheckIpResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *GenerateVpnConnectionDefaultHealthCheckIpResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type GetCcnRegionBandwidthLimitsRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 过滤条件。 - //
  • sregion - String - (过滤条件)源地域,形如:ap-guangzhou。
  • - //
  • dregion - String - (过滤条件)目的地域,形如:ap-shanghai-bm
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 排序条件,目前支持带宽(`BandwidthLimit`)和过期时间(`ExpireTime`),默认按 `ExpireTime` 排序。 - SortedBy *string `json:"SortedBy,omitempty" name:"SortedBy"` - - // 偏移量。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 排序方式,'ASC':升序,'DESC':降序。默认按'ASC'排序。 - OrderBy *string `json:"OrderBy,omitempty" name:"OrderBy"` -} - -type GetCcnRegionBandwidthLimitsRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 过滤条件。 - //
  • sregion - String - (过滤条件)源地域,形如:ap-guangzhou。
  • - //
  • dregion - String - (过滤条件)目的地域,形如:ap-shanghai-bm
  • - Filters []*Filter `json:"Filters,omitempty" name:"Filters"` - - // 排序条件,目前支持带宽(`BandwidthLimit`)和过期时间(`ExpireTime`),默认按 `ExpireTime` 排序。 - SortedBy *string `json:"SortedBy,omitempty" name:"SortedBy"` - - // 偏移量。 - Offset *uint64 `json:"Offset,omitempty" name:"Offset"` - - // 返回数量。 - Limit *uint64 `json:"Limit,omitempty" name:"Limit"` - - // 排序方式,'ASC':升序,'DESC':降序。默认按'ASC'排序。 - OrderBy *string `json:"OrderBy,omitempty" name:"OrderBy"` -} - -func (r *GetCcnRegionBandwidthLimitsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *GetCcnRegionBandwidthLimitsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "Filters") - delete(f, "SortedBy") - delete(f, "Offset") - delete(f, "Limit") - delete(f, "OrderBy") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "GetCcnRegionBandwidthLimitsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type GetCcnRegionBandwidthLimitsResponseParams struct { - // 云联网(CCN)各地域出带宽详情。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CcnBandwidthSet []*CcnBandwidthInfo `json:"CcnBandwidthSet,omitempty" name:"CcnBandwidthSet"` - - // 符合条件的对象数。 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type GetCcnRegionBandwidthLimitsResponse struct { - *tchttp.BaseResponse - Response *GetCcnRegionBandwidthLimitsResponseParams `json:"Response"` -} - -func (r *GetCcnRegionBandwidthLimitsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *GetCcnRegionBandwidthLimitsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type HaVip struct { - // `HAVIP`的`ID`,是`HAVIP`的唯一标识。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` - - // `HAVIP`名称。 - HaVipName *string `json:"HaVipName,omitempty" name:"HaVipName"` - - // 虚拟IP地址。 - Vip *string `json:"Vip,omitempty" name:"Vip"` - - // `HAVIP`所在私有网络`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `HAVIP`所在子网`ID`。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // `HAVIP`关联弹性网卡`ID`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 被绑定的实例`ID`。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 绑定`EIP`。 - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` - - // 状态: - //
  • `AVAILABLE`:运行中
  • - //
  • `UNBIND`:未绑定
  • - State *string `json:"State,omitempty" name:"State"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 使用havip的业务标识。 - Business *string `json:"Business,omitempty" name:"Business"` -} - -// Predefined struct for user -type HaVipAssociateAddressIpRequestParams struct { - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。必须是没有绑定`EIP`的`HAVIP`。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` - - // 弹性公网`IP`。必须是没有绑定`HAVIP`的`EIP`。 - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` -} - -type HaVipAssociateAddressIpRequest struct { - *tchttp.BaseRequest - - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。必须是没有绑定`EIP`的`HAVIP`。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` - - // 弹性公网`IP`。必须是没有绑定`HAVIP`的`EIP`。 - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` -} - -func (r *HaVipAssociateAddressIpRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *HaVipAssociateAddressIpRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HaVipId") - delete(f, "AddressIp") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "HaVipAssociateAddressIpRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type HaVipAssociateAddressIpResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type HaVipAssociateAddressIpResponse struct { - *tchttp.BaseResponse - Response *HaVipAssociateAddressIpResponseParams `json:"Response"` -} - -func (r *HaVipAssociateAddressIpResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *HaVipAssociateAddressIpResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type HaVipDisassociateAddressIpRequestParams struct { - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。必须是已绑定`EIP`的`HAVIP`。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` -} - -type HaVipDisassociateAddressIpRequest struct { - *tchttp.BaseRequest - - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。必须是已绑定`EIP`的`HAVIP`。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` -} - -func (r *HaVipDisassociateAddressIpRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *HaVipDisassociateAddressIpRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HaVipId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "HaVipDisassociateAddressIpRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type HaVipDisassociateAddressIpResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type HaVipDisassociateAddressIpResponse struct { - *tchttp.BaseResponse - Response *HaVipDisassociateAddressIpResponseParams `json:"Response"` -} - -func (r *HaVipDisassociateAddressIpResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *HaVipDisassociateAddressIpResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type IKEOptionsSpecification struct { - // 加密算法,可选值:'3DES-CBC', 'AES-CBC-128', 'AES-CBS-192', 'AES-CBC-256', 'DES-CBC','SM4', 默认为3DES-CBC - PropoEncryAlgorithm *string `json:"PropoEncryAlgorithm,omitempty" name:"PropoEncryAlgorithm"` - - // 认证算法:可选值:'MD5', 'SHA1','SHA-256' 默认为MD5 - PropoAuthenAlgorithm *string `json:"PropoAuthenAlgorithm,omitempty" name:"PropoAuthenAlgorithm"` - - // 协商模式:可选值:'AGGRESSIVE', 'MAIN',默认为MAIN - ExchangeMode *string `json:"ExchangeMode,omitempty" name:"ExchangeMode"` - - // 本端标识类型:可选值:'ADDRESS', 'FQDN',默认为ADDRESS - LocalIdentity *string `json:"LocalIdentity,omitempty" name:"LocalIdentity"` - - // 对端标识类型:可选值:'ADDRESS', 'FQDN',默认为ADDRESS - RemoteIdentity *string `json:"RemoteIdentity,omitempty" name:"RemoteIdentity"` - - // 本端标识,当LocalIdentity选为ADDRESS时,LocalAddress必填。localAddress默认为vpn网关公网IP - LocalAddress *string `json:"LocalAddress,omitempty" name:"LocalAddress"` - - // 对端标识,当RemoteIdentity选为ADDRESS时,RemoteAddress必填 - RemoteAddress *string `json:"RemoteAddress,omitempty" name:"RemoteAddress"` - - // 本端标识,当LocalIdentity选为FQDN时,LocalFqdnName必填 - LocalFqdnName *string `json:"LocalFqdnName,omitempty" name:"LocalFqdnName"` - - // 对端标识,当remoteIdentity选为FQDN时,RemoteFqdnName必填 - RemoteFqdnName *string `json:"RemoteFqdnName,omitempty" name:"RemoteFqdnName"` - - // DH group,指定IKE交换密钥时使用的DH组,可选值:'GROUP1', 'GROUP2', 'GROUP5', 'GROUP14', 'GROUP24', - DhGroupName *string `json:"DhGroupName,omitempty" name:"DhGroupName"` - - // IKE SA Lifetime,单位:秒,设置IKE SA的生存周期,取值范围:60-604800 - IKESaLifetimeSeconds *uint64 `json:"IKESaLifetimeSeconds,omitempty" name:"IKESaLifetimeSeconds"` - - // IKE版本 - IKEVersion *string `json:"IKEVersion,omitempty" name:"IKEVersion"` -} - -type IPSECOptionsSpecification struct { - // 加密算法,可选值:'3DES-CBC', 'AES-CBC-128', 'AES-CBC-192', 'AES-CBC-256', 'DES-CBC', 'SM4', 'NULL', 默认为AES-CBC-128 - EncryptAlgorithm *string `json:"EncryptAlgorithm,omitempty" name:"EncryptAlgorithm"` - - // 认证算法:可选值:'MD5', 'SHA1','SHA-256' 默认为 - IntegrityAlgorith *string `json:"IntegrityAlgorith,omitempty" name:"IntegrityAlgorith"` - - // IPsec SA lifetime(s):单位秒,取值范围:180-604800 - IPSECSaLifetimeSeconds *uint64 `json:"IPSECSaLifetimeSeconds,omitempty" name:"IPSECSaLifetimeSeconds"` - - // PFS:可选值:'NULL', 'DH-GROUP1', 'DH-GROUP2', 'DH-GROUP5', 'DH-GROUP14', 'DH-GROUP24',默认为NULL - PfsDhGroup *string `json:"PfsDhGroup,omitempty" name:"PfsDhGroup"` - - // IPsec SA lifetime(KB):单位KB,取值范围:2560-604800 - IPSECSaLifetimeTraffic *uint64 `json:"IPSECSaLifetimeTraffic,omitempty" name:"IPSECSaLifetimeTraffic"` -} - -// Predefined struct for user -type InquirePriceCreateDirectConnectGatewayRequestParams struct { -} - -type InquirePriceCreateDirectConnectGatewayRequest struct { - *tchttp.BaseRequest -} - -func (r *InquirePriceCreateDirectConnectGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquirePriceCreateDirectConnectGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquirePriceCreateDirectConnectGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquirePriceCreateDirectConnectGatewayResponseParams struct { - // 专线网关标准接入费用 - // 注意:此字段可能返回 null,表示取不到有效值。 - TotalCost *int64 `json:"TotalCost,omitempty" name:"TotalCost"` - - // 专线网关真实接入费用 - // 注意:此字段可能返回 null,表示取不到有效值。 - RealTotalCost *int64 `json:"RealTotalCost,omitempty" name:"RealTotalCost"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquirePriceCreateDirectConnectGatewayResponse struct { - *tchttp.BaseResponse - Response *InquirePriceCreateDirectConnectGatewayResponseParams `json:"Response"` -} - -func (r *InquirePriceCreateDirectConnectGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquirePriceCreateDirectConnectGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceCreateVpnGatewayRequestParams struct { - // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100;单位:Mbps。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // VPN网关计费模式,PREPAID:表示预付费,即包年包月,POSTPAID_BY_HOUR:表示后付费,即按量计费。默认:POSTPAID_BY_HOUR,如果指定预付费模式,参数InstanceChargePrepaid必填。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // SSL VPN连接数设置,可选规格:5, 10, 20, 50, 100;单位:个。 - MaxConnection *uint64 `json:"MaxConnection,omitempty" name:"MaxConnection"` - - // 查询的VPN类型,支持IPSEC和SSL两种类型,为SSL类型时,MaxConnection参数必传。 - Type *string `json:"Type,omitempty" name:"Type"` -} - -type InquiryPriceCreateVpnGatewayRequest struct { - *tchttp.BaseRequest - - // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100;单位:Mbps。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // VPN网关计费模式,PREPAID:表示预付费,即包年包月,POSTPAID_BY_HOUR:表示后付费,即按量计费。默认:POSTPAID_BY_HOUR,如果指定预付费模式,参数InstanceChargePrepaid必填。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` - - // SSL VPN连接数设置,可选规格:5, 10, 20, 50, 100;单位:个。 - MaxConnection *uint64 `json:"MaxConnection,omitempty" name:"MaxConnection"` - - // 查询的VPN类型,支持IPSEC和SSL两种类型,为SSL类型时,MaxConnection参数必传。 - Type *string `json:"Type,omitempty" name:"Type"` -} - -func (r *InquiryPriceCreateVpnGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceCreateVpnGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InternetMaxBandwidthOut") - delete(f, "InstanceChargeType") - delete(f, "InstanceChargePrepaid") - delete(f, "MaxConnection") - delete(f, "Type") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceCreateVpnGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceCreateVpnGatewayResponseParams struct { - // 商品价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceCreateVpnGatewayResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceCreateVpnGatewayResponseParams `json:"Response"` -} - -func (r *InquiryPriceCreateVpnGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceCreateVpnGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceRenewVpnGatewayRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` -} - -type InquiryPriceRenewVpnGatewayRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` -} - -func (r *InquiryPriceRenewVpnGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceRenewVpnGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "InstanceChargePrepaid") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceRenewVpnGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceRenewVpnGatewayResponseParams struct { - // 商品价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceRenewVpnGatewayResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceRenewVpnGatewayResponseParams `json:"Response"` -} - -func (r *InquiryPriceRenewVpnGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceRenewVpnGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResetVpnGatewayInternetMaxBandwidthRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100;单位:Mbps。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` -} - -type InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100;单位:Mbps。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` -} - -func (r *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "InternetMaxBandwidthOut") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type InquiryPriceResetVpnGatewayInternetMaxBandwidthResponseParams struct { - // 商品价格。 - Price *Price `json:"Price,omitempty" name:"Price"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse struct { - *tchttp.BaseResponse - Response *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponseParams `json:"Response"` -} - -func (r *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type InstanceChargePrepaid struct { - // 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36。 - Period *uint64 `json:"Period,omitempty" name:"Period"` - - // 自动续费标识。取值范围: NOTIFY_AND_AUTO_RENEW:通知过期且自动续费, NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费。默认:NOTIFY_AND_AUTO_RENEW - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` -} - -type InstanceStatistic struct { - // 实例的类型 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例的个数 - InstanceCount *uint64 `json:"InstanceCount,omitempty" name:"InstanceCount"` -} - -type Ip6Rule struct { - // IPV6转换规则唯一ID,形如rule6-xxxxxxxx - Ip6RuleId *string `json:"Ip6RuleId,omitempty" name:"Ip6RuleId"` - - // IPV6转换规则名称 - Ip6RuleName *string `json:"Ip6RuleName,omitempty" name:"Ip6RuleName"` - - // IPV6地址 - Vip6 *string `json:"Vip6,omitempty" name:"Vip6"` - - // IPV6端口号 - Vport6 *int64 `json:"Vport6,omitempty" name:"Vport6"` - - // 协议类型,支持TCP/UDP - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` - - // IPV4地址 - Vip *string `json:"Vip,omitempty" name:"Vip"` - - // IPV4端口号 - Vport *int64 `json:"Vport,omitempty" name:"Vport"` - - // 转换规则状态,限于CREATING,RUNNING,DELETING,MODIFYING - RuleStatus *string `json:"RuleStatus,omitempty" name:"RuleStatus"` - - // 转换规则创建时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type Ip6RuleInfo struct { - // IPV6端口号,可在0~65535范围取值 - Vport6 *int64 `json:"Vport6,omitempty" name:"Vport6"` - - // 协议类型,支持TCP/UDP - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` - - // IPV4地址 - Vip *string `json:"Vip,omitempty" name:"Vip"` - - // IPV4端口号,可在0~65535范围取值 - Vport *int64 `json:"Vport,omitempty" name:"Vport"` -} - -type Ip6Translator struct { - // IPV6转换实例唯一ID,形如ip6-xxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // IPV6转换实例名称 - Ip6TranslatorName *string `json:"Ip6TranslatorName,omitempty" name:"Ip6TranslatorName"` - - // IPV6地址 - Vip6 *string `json:"Vip6,omitempty" name:"Vip6"` - - // IPV6转换地址所属运营商 - IspName *string `json:"IspName,omitempty" name:"IspName"` - - // 转换实例状态,限于CREATING,RUNNING,DELETING,MODIFYING - TranslatorStatus *string `json:"TranslatorStatus,omitempty" name:"TranslatorStatus"` - - // IPV6转换实例创建时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 绑定的IPV6转换规则数量 - Ip6RuleCount *int64 `json:"Ip6RuleCount,omitempty" name:"Ip6RuleCount"` - - // IPV6转换规则信息 - IP6RuleSet []*Ip6Rule `json:"IP6RuleSet,omitempty" name:"IP6RuleSet"` -} - -type IpAddressStates struct { - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // IP地址。 - IpAddress *string `json:"IpAddress,omitempty" name:"IpAddress"` - - // 资源类型 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源ID - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` -} - -type IpField struct { - // 国家字段信息 - Country *bool `json:"Country,omitempty" name:"Country"` - - // 省、州、郡一级行政区域字段信息 - Province *bool `json:"Province,omitempty" name:"Province"` - - // 市一级行政区域字段信息 - City *bool `json:"City,omitempty" name:"City"` - - // 市内区域字段信息 - Region *bool `json:"Region,omitempty" name:"Region"` - - // 接入运营商字段信息 - Isp *bool `json:"Isp,omitempty" name:"Isp"` - - // 骨干运营商字段信息 - AsName *bool `json:"AsName,omitempty" name:"AsName"` - - // 骨干As号 - AsId *bool `json:"AsId,omitempty" name:"AsId"` - - // 注释字段 - Comment *bool `json:"Comment,omitempty" name:"Comment"` -} - -type IpGeolocationInfo struct { - // 国家信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - Country *string `json:"Country,omitempty" name:"Country"` - - // 省、州、郡一级行政区域信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - Province *string `json:"Province,omitempty" name:"Province"` - - // 市一级行政区域信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - City *string `json:"City,omitempty" name:"City"` - - // 市内区域信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - Region *string `json:"Region,omitempty" name:"Region"` - - // 接入运营商信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - Isp *string `json:"Isp,omitempty" name:"Isp"` - - // 骨干运营商名称 - // 注意:此字段可能返回 null,表示取不到有效值。 - AsName *string `json:"AsName,omitempty" name:"AsName"` - - // 骨干运营商AS号 - // 注意:此字段可能返回 null,表示取不到有效值。 - AsId *string `json:"AsId,omitempty" name:"AsId"` - - // 注释信息。目前的填充值为移动接入用户的APN值,如无APN属性则为空 - // 注意:此字段可能返回 null,表示取不到有效值。 - Comment *string `json:"Comment,omitempty" name:"Comment"` - - // IP地址 - // 注意:此字段可能返回 null,表示取不到有效值。 - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` -} - -type Ipv6Address struct { - // `IPv6`地址,形如:`3402:4e00:20:100:0:8cd9:2a67:71f3` - Address *string `json:"Address,omitempty" name:"Address"` - - // 是否是主`IP`。 - Primary *bool `json:"Primary,omitempty" name:"Primary"` - - // `EIP`实例`ID`,形如:`eip-hxlqja90`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 描述信息。 - Description *string `json:"Description,omitempty" name:"Description"` - - // 公网IP是否被封堵。 - IsWanIpBlocked *bool `json:"IsWanIpBlocked,omitempty" name:"IsWanIpBlocked"` - - // `IPv6`地址状态: - //
  • `PENDING`:生产中
  • - //
  • `MIGRATING`:迁移中
  • - //
  • `DELETING`:删除中
  • - //
  • `AVAILABLE`:可用的
  • - State *string `json:"State,omitempty" name:"State"` -} - -type Ipv6SubnetCidrBlock struct { - // 子网实例`ID`。形如:`subnet-pxir56ns`。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // `IPv6`子网段。形如:`3402:4e00:20:1001::/64` - Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` -} - -type ItemPrice struct { - // 按量计费后付费单价,单位:元。 - UnitPrice *float64 `json:"UnitPrice,omitempty" name:"UnitPrice"` - - // 按量计费后付费计价单元,可取值范围: HOUR:表示计价单元是按每小时来计算。当前涉及该计价单元的场景有:实例按小时后付费(POSTPAID_BY_HOUR)、带宽按小时后付费(BANDWIDTH_POSTPAID_BY_HOUR): GB:表示计价单元是按每GB来计算。当前涉及该计价单元的场景有:流量按小时后付费(TRAFFIC_POSTPAID_BY_HOUR)。 - ChargeUnit *string `json:"ChargeUnit,omitempty" name:"ChargeUnit"` - - // 预付费商品的原价,单位:元。 - OriginalPrice *float64 `json:"OriginalPrice,omitempty" name:"OriginalPrice"` - - // 预付费商品的折扣价,单位:元。 - DiscountPrice *float64 `json:"DiscountPrice,omitempty" name:"DiscountPrice"` -} - -type LocalGateway struct { - // CDC实例ID - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // VPC实例ID - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 本地网关实例ID - UniqLocalGwId *string `json:"UniqLocalGwId,omitempty" name:"UniqLocalGwId"` - - // 本地网关名称 - LocalGatewayName *string `json:"LocalGatewayName,omitempty" name:"LocalGatewayName"` - - // 本地网关IP地址 - LocalGwIp *string `json:"LocalGwIp,omitempty" name:"LocalGwIp"` - - // 本地网关创建时间 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` -} - -// Predefined struct for user -type LockCcnBandwidthsRequestParams struct { - // 带宽实例的唯一ID数组。 - Instances []*CcnFlowLock `json:"Instances,omitempty" name:"Instances"` -} - -type LockCcnBandwidthsRequest struct { - *tchttp.BaseRequest - - // 带宽实例的唯一ID数组。 - Instances []*CcnFlowLock `json:"Instances,omitempty" name:"Instances"` -} - -func (r *LockCcnBandwidthsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *LockCcnBandwidthsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "LockCcnBandwidthsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type LockCcnBandwidthsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type LockCcnBandwidthsResponse struct { - *tchttp.BaseResponse - Response *LockCcnBandwidthsResponseParams `json:"Response"` -} - -func (r *LockCcnBandwidthsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *LockCcnBandwidthsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type LockCcnsRequestParams struct { -} - -type LockCcnsRequest struct { - *tchttp.BaseRequest -} - -func (r *LockCcnsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *LockCcnsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "LockCcnsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type LockCcnsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type LockCcnsResponse struct { - *tchttp.BaseResponse - Response *LockCcnsResponseParams `json:"Response"` -} - -func (r *LockCcnsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *LockCcnsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type MemberInfo struct { - // 模板对象成员 - Member *string `json:"Member,omitempty" name:"Member"` - - // 模板对象成员描述信息 - Description *string `json:"Description,omitempty" name:"Description"` -} - -// Predefined struct for user -type MigrateNetworkInterfaceRequestParams struct { - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 弹性网卡当前绑定的CVM实例ID。形如:ins-r8hr2upy。 - SourceInstanceId *string `json:"SourceInstanceId,omitempty" name:"SourceInstanceId"` - - // 待迁移的目的CVM实例ID。 - DestinationInstanceId *string `json:"DestinationInstanceId,omitempty" name:"DestinationInstanceId"` - - // 网卡绑定类型:0 标准型 1 扩展型。 - AttachType *uint64 `json:"AttachType,omitempty" name:"AttachType"` -} - -type MigrateNetworkInterfaceRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 弹性网卡当前绑定的CVM实例ID。形如:ins-r8hr2upy。 - SourceInstanceId *string `json:"SourceInstanceId,omitempty" name:"SourceInstanceId"` - - // 待迁移的目的CVM实例ID。 - DestinationInstanceId *string `json:"DestinationInstanceId,omitempty" name:"DestinationInstanceId"` - - // 网卡绑定类型:0 标准型 1 扩展型。 - AttachType *uint64 `json:"AttachType,omitempty" name:"AttachType"` -} - -func (r *MigrateNetworkInterfaceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *MigrateNetworkInterfaceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "SourceInstanceId") - delete(f, "DestinationInstanceId") - delete(f, "AttachType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "MigrateNetworkInterfaceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type MigrateNetworkInterfaceResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type MigrateNetworkInterfaceResponse struct { - *tchttp.BaseResponse - Response *MigrateNetworkInterfaceResponseParams `json:"Response"` -} - -func (r *MigrateNetworkInterfaceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *MigrateNetworkInterfaceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type MigratePrivateIpAddressRequestParams struct { - // 当内网IP绑定的弹性网卡实例ID,例如:eni-m6dyj72l。 - SourceNetworkInterfaceId *string `json:"SourceNetworkInterfaceId,omitempty" name:"SourceNetworkInterfaceId"` - - // 待迁移的目的弹性网卡实例ID。 - DestinationNetworkInterfaceId *string `json:"DestinationNetworkInterfaceId,omitempty" name:"DestinationNetworkInterfaceId"` - - // 迁移的内网IP地址,例如:10.0.0.6。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` -} - -type MigratePrivateIpAddressRequest struct { - *tchttp.BaseRequest - - // 当内网IP绑定的弹性网卡实例ID,例如:eni-m6dyj72l。 - SourceNetworkInterfaceId *string `json:"SourceNetworkInterfaceId,omitempty" name:"SourceNetworkInterfaceId"` - - // 待迁移的目的弹性网卡实例ID。 - DestinationNetworkInterfaceId *string `json:"DestinationNetworkInterfaceId,omitempty" name:"DestinationNetworkInterfaceId"` - - // 迁移的内网IP地址,例如:10.0.0.6。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` -} - -func (r *MigratePrivateIpAddressRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *MigratePrivateIpAddressRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SourceNetworkInterfaceId") - delete(f, "DestinationNetworkInterfaceId") - delete(f, "PrivateIpAddress") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "MigratePrivateIpAddressRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type MigratePrivateIpAddressResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type MigratePrivateIpAddressResponse struct { - *tchttp.BaseResponse - Response *MigratePrivateIpAddressResponseParams `json:"Response"` -} - -func (r *MigratePrivateIpAddressResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *MigratePrivateIpAddressResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressAttributeRequestParams struct { - // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 修改后的 EIP 名称。长度上限为20个字符。 - AddressName *string `json:"AddressName,omitempty" name:"AddressName"` - - // 设定EIP是否直通,"TRUE"表示直通,"FALSE"表示非直通。注意该参数仅对EIP直通功能可见的用户可以设定。 - EipDirectConnection *string `json:"EipDirectConnection,omitempty" name:"EipDirectConnection"` -} - -type ModifyAddressAttributeRequest struct { - *tchttp.BaseRequest - - // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 修改后的 EIP 名称。长度上限为20个字符。 - AddressName *string `json:"AddressName,omitempty" name:"AddressName"` - - // 设定EIP是否直通,"TRUE"表示直通,"FALSE"表示非直通。注意该参数仅对EIP直通功能可见的用户可以设定。 - EipDirectConnection *string `json:"EipDirectConnection,omitempty" name:"EipDirectConnection"` -} - -func (r *ModifyAddressAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressId") - delete(f, "AddressName") - delete(f, "EipDirectConnection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAddressAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyAddressAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyAddressAttributeResponseParams `json:"Response"` -} - -func (r *ModifyAddressAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressInternetChargeTypeRequestParams struct { - // 弹性公网IP的唯一ID,形如eip-xxx - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 弹性公网IP调整目标计费模式,只支持"BANDWIDTH_PREPAID_BY_MONTH"和"TRAFFIC_POSTPAID_BY_HOUR" - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 弹性公网IP调整目标带宽值 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 包月带宽网络计费模式参数。弹性公网IP的调整目标计费模式是"BANDWIDTH_PREPAID_BY_MONTH"时,必传该参数。 - AddressChargePrepaid *AddressChargePrepaid `json:"AddressChargePrepaid,omitempty" name:"AddressChargePrepaid"` -} - -type ModifyAddressInternetChargeTypeRequest struct { - *tchttp.BaseRequest - - // 弹性公网IP的唯一ID,形如eip-xxx - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 弹性公网IP调整目标计费模式,只支持"BANDWIDTH_PREPAID_BY_MONTH"和"TRAFFIC_POSTPAID_BY_HOUR" - InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` - - // 弹性公网IP调整目标带宽值 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 包月带宽网络计费模式参数。弹性公网IP的调整目标计费模式是"BANDWIDTH_PREPAID_BY_MONTH"时,必传该参数。 - AddressChargePrepaid *AddressChargePrepaid `json:"AddressChargePrepaid,omitempty" name:"AddressChargePrepaid"` -} - -func (r *ModifyAddressInternetChargeTypeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressInternetChargeTypeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressId") - delete(f, "InternetChargeType") - delete(f, "InternetMaxBandwidthOut") - delete(f, "AddressChargePrepaid") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAddressInternetChargeTypeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressInternetChargeTypeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyAddressInternetChargeTypeResponse struct { - *tchttp.BaseResponse - Response *ModifyAddressInternetChargeTypeResponseParams `json:"Response"` -} - -func (r *ModifyAddressInternetChargeTypeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressInternetChargeTypeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressTemplateAttributeRequestParams struct { - // IP地址模板实例ID,例如:ipm-mdunqeb6。 - AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` - - // IP地址模板名称。 - AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` - - // 地址信息,支持 IP、CIDR、IP 范围。 - Addresses []*string `json:"Addresses,omitempty" name:"Addresses"` - - // 支持添加备注的地址信息,支持 IP、CIDR、IP 范围。 - AddressesExtra []*AddressInfo `json:"AddressesExtra,omitempty" name:"AddressesExtra"` -} - -type ModifyAddressTemplateAttributeRequest struct { - *tchttp.BaseRequest - - // IP地址模板实例ID,例如:ipm-mdunqeb6。 - AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` - - // IP地址模板名称。 - AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` - - // 地址信息,支持 IP、CIDR、IP 范围。 - Addresses []*string `json:"Addresses,omitempty" name:"Addresses"` - - // 支持添加备注的地址信息,支持 IP、CIDR、IP 范围。 - AddressesExtra []*AddressInfo `json:"AddressesExtra,omitempty" name:"AddressesExtra"` -} - -func (r *ModifyAddressTemplateAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressTemplateAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressTemplateId") - delete(f, "AddressTemplateName") - delete(f, "Addresses") - delete(f, "AddressesExtra") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAddressTemplateAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressTemplateAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyAddressTemplateAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyAddressTemplateAttributeResponseParams `json:"Response"` -} - -func (r *ModifyAddressTemplateAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressTemplateAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressTemplateGroupAttributeRequestParams struct { - // IP地址模板集合实例ID,例如:ipmg-2uw6ujo6。 - AddressTemplateGroupId *string `json:"AddressTemplateGroupId,omitempty" name:"AddressTemplateGroupId"` - - // IP地址模板集合名称。 - AddressTemplateGroupName *string `json:"AddressTemplateGroupName,omitempty" name:"AddressTemplateGroupName"` - - // IP地址模板实例ID, 例如:ipm-mdunqeb6。 - AddressTemplateIds []*string `json:"AddressTemplateIds,omitempty" name:"AddressTemplateIds"` -} - -type ModifyAddressTemplateGroupAttributeRequest struct { - *tchttp.BaseRequest - - // IP地址模板集合实例ID,例如:ipmg-2uw6ujo6。 - AddressTemplateGroupId *string `json:"AddressTemplateGroupId,omitempty" name:"AddressTemplateGroupId"` - - // IP地址模板集合名称。 - AddressTemplateGroupName *string `json:"AddressTemplateGroupName,omitempty" name:"AddressTemplateGroupName"` - - // IP地址模板实例ID, 例如:ipm-mdunqeb6。 - AddressTemplateIds []*string `json:"AddressTemplateIds,omitempty" name:"AddressTemplateIds"` -} - -func (r *ModifyAddressTemplateGroupAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressTemplateGroupAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressTemplateGroupId") - delete(f, "AddressTemplateGroupName") - delete(f, "AddressTemplateIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAddressTemplateGroupAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressTemplateGroupAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyAddressTemplateGroupAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyAddressTemplateGroupAttributeResponseParams `json:"Response"` -} - -func (r *ModifyAddressTemplateGroupAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressTemplateGroupAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressesBandwidthRequestParams struct { - // EIP唯一标识ID列表,形如'eip-xxxx' - AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds"` - - // 调整带宽目标值 - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 包月带宽起始时间(已废弃,输入无效) - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 包月带宽结束时间(已废弃,输入无效) - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -type ModifyAddressesBandwidthRequest struct { - *tchttp.BaseRequest - - // EIP唯一标识ID列表,形如'eip-xxxx' - AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds"` - - // 调整带宽目标值 - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 包月带宽起始时间(已废弃,输入无效) - StartTime *string `json:"StartTime,omitempty" name:"StartTime"` - - // 包月带宽结束时间(已废弃,输入无效) - EndTime *string `json:"EndTime,omitempty" name:"EndTime"` -} - -func (r *ModifyAddressesBandwidthRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressesBandwidthRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressIds") - delete(f, "InternetMaxBandwidthOut") - delete(f, "StartTime") - delete(f, "EndTime") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAddressesBandwidthRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAddressesBandwidthResponseParams struct { - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyAddressesBandwidthResponse struct { - *tchttp.BaseResponse - Response *ModifyAddressesBandwidthResponseParams `json:"Response"` -} - -func (r *ModifyAddressesBandwidthResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAddressesBandwidthResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAssistantCidrRequestParams struct { - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 待添加的辅助CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"],入参NewCidrBlocks和OldCidrBlocks至少需要其一。 - NewCidrBlocks []*string `json:"NewCidrBlocks,omitempty" name:"NewCidrBlocks"` - - // 待删除的辅助CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"],入参NewCidrBlocks和OldCidrBlocks至少需要其一。 - OldCidrBlocks []*string `json:"OldCidrBlocks,omitempty" name:"OldCidrBlocks"` -} - -type ModifyAssistantCidrRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`。形如:`vpc-6v2ht8q5`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 待添加的辅助CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"],入参NewCidrBlocks和OldCidrBlocks至少需要其一。 - NewCidrBlocks []*string `json:"NewCidrBlocks,omitempty" name:"NewCidrBlocks"` - - // 待删除的辅助CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"],入参NewCidrBlocks和OldCidrBlocks至少需要其一。 - OldCidrBlocks []*string `json:"OldCidrBlocks,omitempty" name:"OldCidrBlocks"` -} - -func (r *ModifyAssistantCidrRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAssistantCidrRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "NewCidrBlocks") - delete(f, "OldCidrBlocks") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAssistantCidrRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyAssistantCidrResponseParams struct { - // 辅助CIDR数组。 - // 注意:此字段可能返回 null,表示取不到有效值。 - AssistantCidrSet []*AssistantCidr `json:"AssistantCidrSet,omitempty" name:"AssistantCidrSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyAssistantCidrResponse struct { - *tchttp.BaseResponse - Response *ModifyAssistantCidrResponseParams `json:"Response"` -} - -func (r *ModifyAssistantCidrResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyAssistantCidrResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyBandwidthPackageAttributeRequestParams struct { - // 带宽包唯一标识ID - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 带宽包名称 - BandwidthPackageName *string `json:"BandwidthPackageName,omitempty" name:"BandwidthPackageName"` - - // 带宽包计费模式,示例 : - // 'TOP5_POSTPAID_BY_MONTH'(后付费-TOP5计费) - ChargeType *string `json:"ChargeType,omitempty" name:"ChargeType"` -} - -type ModifyBandwidthPackageAttributeRequest struct { - *tchttp.BaseRequest - - // 带宽包唯一标识ID - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 带宽包名称 - BandwidthPackageName *string `json:"BandwidthPackageName,omitempty" name:"BandwidthPackageName"` - - // 带宽包计费模式,示例 : - // 'TOP5_POSTPAID_BY_MONTH'(后付费-TOP5计费) - ChargeType *string `json:"ChargeType,omitempty" name:"ChargeType"` -} - -func (r *ModifyBandwidthPackageAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyBandwidthPackageAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "BandwidthPackageId") - delete(f, "BandwidthPackageName") - delete(f, "ChargeType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyBandwidthPackageAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyBandwidthPackageAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyBandwidthPackageAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyBandwidthPackageAttributeResponseParams `json:"Response"` -} - -func (r *ModifyBandwidthPackageAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyBandwidthPackageAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyCcnAttachedInstancesAttributeRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 关联网络实例列表 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -type ModifyCcnAttachedInstancesAttributeRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 关联网络实例列表 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -func (r *ModifyCcnAttachedInstancesAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyCcnAttachedInstancesAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyCcnAttachedInstancesAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyCcnAttachedInstancesAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyCcnAttachedInstancesAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyCcnAttachedInstancesAttributeResponseParams `json:"Response"` -} - -func (r *ModifyCcnAttachedInstancesAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyCcnAttachedInstancesAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyCcnAttributeRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN名称,最大长度不能超过60个字节,限制:CcnName和CcnDescription必须至少选择一个参数输入,否则报错。 - CcnName *string `json:"CcnName,omitempty" name:"CcnName"` - - // CCN描述信息,最大长度不能超过100个字节,限制:CcnName和CcnDescription必须至少选择一个参数输入,否则报错。 - CcnDescription *string `json:"CcnDescription,omitempty" name:"CcnDescription"` -} - -type ModifyCcnAttributeRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN名称,最大长度不能超过60个字节,限制:CcnName和CcnDescription必须至少选择一个参数输入,否则报错。 - CcnName *string `json:"CcnName,omitempty" name:"CcnName"` - - // CCN描述信息,最大长度不能超过100个字节,限制:CcnName和CcnDescription必须至少选择一个参数输入,否则报错。 - CcnDescription *string `json:"CcnDescription,omitempty" name:"CcnDescription"` -} - -func (r *ModifyCcnAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyCcnAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "CcnName") - delete(f, "CcnDescription") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyCcnAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyCcnAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyCcnAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyCcnAttributeResponseParams `json:"Response"` -} - -func (r *ModifyCcnAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyCcnAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyCcnRegionBandwidthLimitsTypeRequestParams struct { - // 云联网实例ID。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 云联网限速类型,INTER_REGION_LIMIT:地域间限速,OUTER_REGION_LIMIT:地域出口限速。默认值:OUTER_REGION_LIMIT。 - BandwidthLimitType *string `json:"BandwidthLimitType,omitempty" name:"BandwidthLimitType"` -} - -type ModifyCcnRegionBandwidthLimitsTypeRequest struct { - *tchttp.BaseRequest - - // 云联网实例ID。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 云联网限速类型,INTER_REGION_LIMIT:地域间限速,OUTER_REGION_LIMIT:地域出口限速。默认值:OUTER_REGION_LIMIT。 - BandwidthLimitType *string `json:"BandwidthLimitType,omitempty" name:"BandwidthLimitType"` -} - -func (r *ModifyCcnRegionBandwidthLimitsTypeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyCcnRegionBandwidthLimitsTypeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "BandwidthLimitType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyCcnRegionBandwidthLimitsTypeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyCcnRegionBandwidthLimitsTypeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyCcnRegionBandwidthLimitsTypeResponse struct { - *tchttp.BaseResponse - Response *ModifyCcnRegionBandwidthLimitsTypeResponseParams `json:"Response"` -} - -func (r *ModifyCcnRegionBandwidthLimitsTypeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyCcnRegionBandwidthLimitsTypeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyCustomerGatewayAttributeRequestParams struct { - // 对端网关ID,例如:cgw-2wqq41m9,可通过[DescribeCustomerGateways](https://cloud.tencent.com/document/api/215/17516)接口查询对端网关。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` - - // 对端网关名称,可任意命名,但不得超过60个字符。 - CustomerGatewayName *string `json:"CustomerGatewayName,omitempty" name:"CustomerGatewayName"` -} - -type ModifyCustomerGatewayAttributeRequest struct { - *tchttp.BaseRequest - - // 对端网关ID,例如:cgw-2wqq41m9,可通过[DescribeCustomerGateways](https://cloud.tencent.com/document/api/215/17516)接口查询对端网关。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` - - // 对端网关名称,可任意命名,但不得超过60个字符。 - CustomerGatewayName *string `json:"CustomerGatewayName,omitempty" name:"CustomerGatewayName"` -} - -func (r *ModifyCustomerGatewayAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyCustomerGatewayAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CustomerGatewayId") - delete(f, "CustomerGatewayName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyCustomerGatewayAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyCustomerGatewayAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyCustomerGatewayAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyCustomerGatewayAttributeResponseParams `json:"Response"` -} - -func (r *ModifyCustomerGatewayAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyCustomerGatewayAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyDhcpIpAttributeRequestParams struct { - // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。 - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` - - // `DhcpIp`名称,可任意命名,但不得超过60个字符。 - DhcpIpName *string `json:"DhcpIpName,omitempty" name:"DhcpIpName"` -} - -type ModifyDhcpIpAttributeRequest struct { - *tchttp.BaseRequest - - // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。 - DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` - - // `DhcpIp`名称,可任意命名,但不得超过60个字符。 - DhcpIpName *string `json:"DhcpIpName,omitempty" name:"DhcpIpName"` -} - -func (r *ModifyDhcpIpAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyDhcpIpAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DhcpIpId") - delete(f, "DhcpIpName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDhcpIpAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyDhcpIpAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyDhcpIpAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyDhcpIpAttributeResponseParams `json:"Response"` -} - -func (r *ModifyDhcpIpAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyDhcpIpAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyDirectConnectGatewayAttributeRequestParams struct { - // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 专线网关名称,可任意命名,但不得超过60个字符。 - DirectConnectGatewayName *string `json:"DirectConnectGatewayName,omitempty" name:"DirectConnectGatewayName"` - - // 云联网路由学习类型,可选值:`BGP`(自动学习)、`STATIC`(静态,即用户配置)。只有云联网类型专线网关且开启了BGP功能才支持修改`CcnRouteType`。 - CcnRouteType *string `json:"CcnRouteType,omitempty" name:"CcnRouteType"` - - // 云联网路由发布模式,可选值:`standard`(标准模式)、`exquisite`(精细模式)。只有云联网类型专线网关才支持修改`ModeType`。 - ModeType *string `json:"ModeType,omitempty" name:"ModeType"` -} - -type ModifyDirectConnectGatewayAttributeRequest struct { - *tchttp.BaseRequest - - // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 专线网关名称,可任意命名,但不得超过60个字符。 - DirectConnectGatewayName *string `json:"DirectConnectGatewayName,omitempty" name:"DirectConnectGatewayName"` - - // 云联网路由学习类型,可选值:`BGP`(自动学习)、`STATIC`(静态,即用户配置)。只有云联网类型专线网关且开启了BGP功能才支持修改`CcnRouteType`。 - CcnRouteType *string `json:"CcnRouteType,omitempty" name:"CcnRouteType"` - - // 云联网路由发布模式,可选值:`standard`(标准模式)、`exquisite`(精细模式)。只有云联网类型专线网关才支持修改`ModeType`。 - ModeType *string `json:"ModeType,omitempty" name:"ModeType"` -} - -func (r *ModifyDirectConnectGatewayAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyDirectConnectGatewayAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DirectConnectGatewayId") - delete(f, "DirectConnectGatewayName") - delete(f, "CcnRouteType") - delete(f, "ModeType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDirectConnectGatewayAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyDirectConnectGatewayAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyDirectConnectGatewayAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyDirectConnectGatewayAttributeResponseParams `json:"Response"` -} - -func (r *ModifyDirectConnectGatewayAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyDirectConnectGatewayAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyFlowLogAttributeRequestParams struct { - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` - - // 私用网络ID或者统一ID,建议使用统一ID,修改云联网流日志属性时可不填,其他流日志类型必填。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志实例名字。 - FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` - - // 流日志实例描述。 - FlowLogDescription *string `json:"FlowLogDescription,omitempty" name:"FlowLogDescription"` -} - -type ModifyFlowLogAttributeRequest struct { - *tchttp.BaseRequest - - // 流日志唯一ID。 - FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` - - // 私用网络ID或者统一ID,建议使用统一ID,修改云联网流日志属性时可不填,其他流日志类型必填。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 流日志实例名字。 - FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` - - // 流日志实例描述。 - FlowLogDescription *string `json:"FlowLogDescription,omitempty" name:"FlowLogDescription"` -} - -func (r *ModifyFlowLogAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyFlowLogAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "FlowLogId") - delete(f, "VpcId") - delete(f, "FlowLogName") - delete(f, "FlowLogDescription") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyFlowLogAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyFlowLogAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyFlowLogAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyFlowLogAttributeResponseParams `json:"Response"` -} - -func (r *ModifyFlowLogAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyFlowLogAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyGatewayFlowQosRequestParams struct { - // 网关实例ID,目前我们支持的网关实例类型有, - // 专线网关实例ID,形如,`dcg-ltjahce6`; - // Nat网关实例ID,形如,`nat-ltjahce6`; - // VPN网关实例ID,形如,`vpn-ltjahce6`。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` - - // 流控带宽值。取值大于0,表示限流到指定的Mbps;取值等于0,表示完全限流;取值为-1,不限流。 - Bandwidth *int64 `json:"Bandwidth,omitempty" name:"Bandwidth"` - - // 限流的云服务器内网IP。 - IpAddresses []*string `json:"IpAddresses,omitempty" name:"IpAddresses"` -} - -type ModifyGatewayFlowQosRequest struct { - *tchttp.BaseRequest - - // 网关实例ID,目前我们支持的网关实例类型有, - // 专线网关实例ID,形如,`dcg-ltjahce6`; - // Nat网关实例ID,形如,`nat-ltjahce6`; - // VPN网关实例ID,形如,`vpn-ltjahce6`。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` - - // 流控带宽值。取值大于0,表示限流到指定的Mbps;取值等于0,表示完全限流;取值为-1,不限流。 - Bandwidth *int64 `json:"Bandwidth,omitempty" name:"Bandwidth"` - - // 限流的云服务器内网IP。 - IpAddresses []*string `json:"IpAddresses,omitempty" name:"IpAddresses"` -} - -func (r *ModifyGatewayFlowQosRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyGatewayFlowQosRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "GatewayId") - delete(f, "Bandwidth") - delete(f, "IpAddresses") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyGatewayFlowQosRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyGatewayFlowQosResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyGatewayFlowQosResponse struct { - *tchttp.BaseResponse - Response *ModifyGatewayFlowQosResponseParams `json:"Response"` -} - -func (r *ModifyGatewayFlowQosResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyGatewayFlowQosResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyHaVipAttributeRequestParams struct { - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` - - // `HAVIP`名称,可任意命名,但不得超过60个字符。 - HaVipName *string `json:"HaVipName,omitempty" name:"HaVipName"` -} - -type ModifyHaVipAttributeRequest struct { - *tchttp.BaseRequest - - // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 - HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` - - // `HAVIP`名称,可任意命名,但不得超过60个字符。 - HaVipName *string `json:"HaVipName,omitempty" name:"HaVipName"` -} - -func (r *ModifyHaVipAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyHaVipAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "HaVipId") - delete(f, "HaVipName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyHaVipAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyHaVipAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyHaVipAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyHaVipAttributeResponseParams `json:"Response"` -} - -func (r *ModifyHaVipAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyHaVipAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyIp6AddressesBandwidthRequestParams struct { - // 修改的目标带宽,单位Mbps - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // IPV6地址。Ip6Addresses和Ip6AddressId必须且只能传一个 - Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses"` - - // IPV6地址对应的唯一ID,形如eip-xxxxxxxx。Ip6Addresses和Ip6AddressId必须且只能传一个 - Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds"` -} - -type ModifyIp6AddressesBandwidthRequest struct { - *tchttp.BaseRequest - - // 修改的目标带宽,单位Mbps - InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // IPV6地址。Ip6Addresses和Ip6AddressId必须且只能传一个 - Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses"` - - // IPV6地址对应的唯一ID,形如eip-xxxxxxxx。Ip6Addresses和Ip6AddressId必须且只能传一个 - Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds"` -} - -func (r *ModifyIp6AddressesBandwidthRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyIp6AddressesBandwidthRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InternetMaxBandwidthOut") - delete(f, "Ip6Addresses") - delete(f, "Ip6AddressIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyIp6AddressesBandwidthRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyIp6AddressesBandwidthResponseParams struct { - // 任务ID - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyIp6AddressesBandwidthResponse struct { - *tchttp.BaseResponse - Response *ModifyIp6AddressesBandwidthResponseParams `json:"Response"` -} - -func (r *ModifyIp6AddressesBandwidthResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyIp6AddressesBandwidthResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyIp6RuleRequestParams struct { - // IPV6转换实例唯一ID,形如ip6-xxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // IPV6转换规则唯一ID,形如rule6-xxxxxxxx - Ip6RuleId *string `json:"Ip6RuleId,omitempty" name:"Ip6RuleId"` - - // IPV6转换规则修改后的名称 - Ip6RuleName *string `json:"Ip6RuleName,omitempty" name:"Ip6RuleName"` - - // IPV6转换规则修改后的IPV4地址 - Vip *string `json:"Vip,omitempty" name:"Vip"` - - // IPV6转换规则修改后的IPV4端口号 - Vport *int64 `json:"Vport,omitempty" name:"Vport"` -} - -type ModifyIp6RuleRequest struct { - *tchttp.BaseRequest - - // IPV6转换实例唯一ID,形如ip6-xxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // IPV6转换规则唯一ID,形如rule6-xxxxxxxx - Ip6RuleId *string `json:"Ip6RuleId,omitempty" name:"Ip6RuleId"` - - // IPV6转换规则修改后的名称 - Ip6RuleName *string `json:"Ip6RuleName,omitempty" name:"Ip6RuleName"` - - // IPV6转换规则修改后的IPV4地址 - Vip *string `json:"Vip,omitempty" name:"Vip"` - - // IPV6转换规则修改后的IPV4端口号 - Vport *int64 `json:"Vport,omitempty" name:"Vport"` -} - -func (r *ModifyIp6RuleRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyIp6RuleRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6TranslatorId") - delete(f, "Ip6RuleId") - delete(f, "Ip6RuleName") - delete(f, "Vip") - delete(f, "Vport") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyIp6RuleRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyIp6RuleResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyIp6RuleResponse struct { - *tchttp.BaseResponse - Response *ModifyIp6RuleResponseParams `json:"Response"` -} - -func (r *ModifyIp6RuleResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyIp6RuleResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyIp6TranslatorRequestParams struct { - // IPV6转换实例唯一ID,形如ip6-xxxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // IPV6转换实例修改名称 - Ip6TranslatorName *string `json:"Ip6TranslatorName,omitempty" name:"Ip6TranslatorName"` -} - -type ModifyIp6TranslatorRequest struct { - *tchttp.BaseRequest - - // IPV6转换实例唯一ID,形如ip6-xxxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // IPV6转换实例修改名称 - Ip6TranslatorName *string `json:"Ip6TranslatorName,omitempty" name:"Ip6TranslatorName"` -} - -func (r *ModifyIp6TranslatorRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyIp6TranslatorRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6TranslatorId") - delete(f, "Ip6TranslatorName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyIp6TranslatorRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyIp6TranslatorResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyIp6TranslatorResponse struct { - *tchttp.BaseResponse - Response *ModifyIp6TranslatorResponseParams `json:"Response"` -} - -func (r *ModifyIp6TranslatorResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyIp6TranslatorResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyIpv6AddressesAttributeRequestParams struct { - // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的内网IPv6地址信息。 - Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses"` -} - -type ModifyIpv6AddressesAttributeRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的内网IPv6地址信息。 - Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses"` -} - -func (r *ModifyIpv6AddressesAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyIpv6AddressesAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "Ipv6Addresses") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyIpv6AddressesAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyIpv6AddressesAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyIpv6AddressesAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyIpv6AddressesAttributeResponseParams `json:"Response"` -} - -func (r *ModifyIpv6AddressesAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyIpv6AddressesAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLocalGatewayRequestParams struct { - // 本地网关名称。 - LocalGatewayName *string `json:"LocalGatewayName,omitempty" name:"LocalGatewayName"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // 本地网关实例ID。 - LocalGatewayId *string `json:"LocalGatewayId,omitempty" name:"LocalGatewayId"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -type ModifyLocalGatewayRequest struct { - *tchttp.BaseRequest - - // 本地网关名称。 - LocalGatewayName *string `json:"LocalGatewayName,omitempty" name:"LocalGatewayName"` - - // CDC实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // 本地网关实例ID。 - LocalGatewayId *string `json:"LocalGatewayId,omitempty" name:"LocalGatewayId"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` -} - -func (r *ModifyLocalGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLocalGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "LocalGatewayName") - delete(f, "CdcId") - delete(f, "LocalGatewayId") - delete(f, "VpcId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyLocalGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyLocalGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyLocalGatewayResponse struct { - *tchttp.BaseResponse - Response *ModifyLocalGatewayResponseParams `json:"Response"` -} - -func (r *ModifyLocalGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyLocalGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNatGatewayAttributeRequestParams struct { - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的名称,形如:`test_nat`。 - NatGatewayName *string `json:"NatGatewayName,omitempty" name:"NatGatewayName"` - - // NAT网关最大外网出带宽(单位:Mbps)。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 是否修改NAT网关绑定的安全组。 - ModifySecurityGroup *bool `json:"ModifySecurityGroup,omitempty" name:"ModifySecurityGroup"` - - // NAT网关绑定的安全组列表,最终状态,空列表表示删除所有安全组,形如: `['sg-1n232323', 'sg-o4242424']` - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -type ModifyNatGatewayAttributeRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的名称,形如:`test_nat`。 - NatGatewayName *string `json:"NatGatewayName,omitempty" name:"NatGatewayName"` - - // NAT网关最大外网出带宽(单位:Mbps)。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 是否修改NAT网关绑定的安全组。 - ModifySecurityGroup *bool `json:"ModifySecurityGroup,omitempty" name:"ModifySecurityGroup"` - - // NAT网关绑定的安全组列表,最终状态,空列表表示删除所有安全组,形如: `['sg-1n232323', 'sg-o4242424']` - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -func (r *ModifyNatGatewayAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNatGatewayAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "NatGatewayName") - delete(f, "InternetMaxBandwidthOut") - delete(f, "ModifySecurityGroup") - delete(f, "SecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNatGatewayAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNatGatewayAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNatGatewayAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyNatGatewayAttributeResponseParams `json:"Response"` -} - -func (r *ModifyNatGatewayAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNatGatewayAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNatGatewayDestinationIpPortTranslationNatRuleRequestParams struct { - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 源NAT网关的端口转换规则。 - SourceNatRule *DestinationIpPortTranslationNatRule `json:"SourceNatRule,omitempty" name:"SourceNatRule"` - - // 目的NAT网关的端口转换规则。 - DestinationNatRule *DestinationIpPortTranslationNatRule `json:"DestinationNatRule,omitempty" name:"DestinationNatRule"` -} - -type ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df45454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 源NAT网关的端口转换规则。 - SourceNatRule *DestinationIpPortTranslationNatRule `json:"SourceNatRule,omitempty" name:"SourceNatRule"` - - // 目的NAT网关的端口转换规则。 - DestinationNatRule *DestinationIpPortTranslationNatRule `json:"DestinationNatRule,omitempty" name:"DestinationNatRule"` -} - -func (r *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "SourceNatRule") - delete(f, "DestinationNatRule") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNatGatewayDestinationIpPortTranslationNatRuleResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse struct { - *tchttp.BaseResponse - Response *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponseParams `json:"Response"` -} - -func (r *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNatGatewaySourceIpTranslationNatRuleRequestParams struct { - // NAT网关的ID,形如:`nat-df453454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的SNAT转换规则。 - SourceIpTranslationNatRule *SourceIpTranslationNatRule `json:"SourceIpTranslationNatRule,omitempty" name:"SourceIpTranslationNatRule"` -} - -type ModifyNatGatewaySourceIpTranslationNatRuleRequest struct { - *tchttp.BaseRequest - - // NAT网关的ID,形如:`nat-df453454`。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的SNAT转换规则。 - SourceIpTranslationNatRule *SourceIpTranslationNatRule `json:"SourceIpTranslationNatRule,omitempty" name:"SourceIpTranslationNatRule"` -} - -func (r *ModifyNatGatewaySourceIpTranslationNatRuleRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNatGatewaySourceIpTranslationNatRuleRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "SourceIpTranslationNatRule") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNatGatewaySourceIpTranslationNatRuleRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNatGatewaySourceIpTranslationNatRuleResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNatGatewaySourceIpTranslationNatRuleResponse struct { - *tchttp.BaseResponse - Response *ModifyNatGatewaySourceIpTranslationNatRuleResponseParams `json:"Response"` -} - -func (r *ModifyNatGatewaySourceIpTranslationNatRuleResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNatGatewaySourceIpTranslationNatRuleResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetDetectRequestParams struct { - // 网络探测实例`ID`。形如:`netd-12345678` - NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` - - // 网络探测名称,最大长度不能超过60个字节。 - NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` - - // 探测目的IPv4地址数组,最多两个。 - DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` - - // 下一跳类型,目前我们支持的类型有: - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // CCN:云联网网关; - // NONEXTHOP:无下一跳; - NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` - - // 下一跳目的网关,取值与“下一跳类型”相关: - // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; - // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; - // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; - // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; - // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; - // 下一跳类型为CCN,取值云联网ID,形如:ccn-12345678; - // 下一跳类型为NONEXTHOP,指定网络探测为无下一跳的网络探测; - NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` - - // 网络探测描述。 - NetDetectDescription *string `json:"NetDetectDescription,omitempty" name:"NetDetectDescription"` -} - -type ModifyNetDetectRequest struct { - *tchttp.BaseRequest - - // 网络探测实例`ID`。形如:`netd-12345678` - NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` - - // 网络探测名称,最大长度不能超过60个字节。 - NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` - - // 探测目的IPv4地址数组,最多两个。 - DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` - - // 下一跳类型,目前我们支持的类型有: - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // CCN:云联网网关; - // NONEXTHOP:无下一跳; - NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` - - // 下一跳目的网关,取值与“下一跳类型”相关: - // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; - // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; - // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; - // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; - // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; - // 下一跳类型为CCN,取值云联网ID,形如:ccn-12345678; - // 下一跳类型为NONEXTHOP,指定网络探测为无下一跳的网络探测; - NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` - - // 网络探测描述。 - NetDetectDescription *string `json:"NetDetectDescription,omitempty" name:"NetDetectDescription"` -} - -func (r *ModifyNetDetectRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetDetectRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetDetectId") - delete(f, "NetDetectName") - delete(f, "DetectDestinationIp") - delete(f, "NextHopType") - delete(f, "NextHopDestination") - delete(f, "NetDetectDescription") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNetDetectRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetDetectResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNetDetectResponse struct { - *tchttp.BaseResponse - Response *ModifyNetDetectResponseParams `json:"Response"` -} - -func (r *ModifyNetDetectResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetDetectResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkAclAttributeRequestParams struct { - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络ACL名称,最大长度不能超过60个字节。 - NetworkAclName *string `json:"NetworkAclName,omitempty" name:"NetworkAclName"` -} - -type ModifyNetworkAclAttributeRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络ACL名称,最大长度不能超过60个字节。 - NetworkAclName *string `json:"NetworkAclName,omitempty" name:"NetworkAclName"` -} - -func (r *ModifyNetworkAclAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkAclAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - delete(f, "NetworkAclName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNetworkAclAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkAclAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNetworkAclAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyNetworkAclAttributeResponseParams `json:"Response"` -} - -func (r *ModifyNetworkAclAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkAclAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkAclEntriesRequestParams struct { - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络ACL规则集。NetworkAclEntrySet和NetworkAclQuintupleSet只能输入一个。 - NetworkAclEntrySet *NetworkAclEntrySet `json:"NetworkAclEntrySet,omitempty" name:"NetworkAclEntrySet"` - - // 网络ACL五元组规则集。NetworkAclEntrySet和NetworkAclQuintupleSet只能输入一个。 - NetworkAclQuintupleSet *NetworkAclQuintupleEntries `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` -} - -type ModifyNetworkAclEntriesRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络ACL规则集。NetworkAclEntrySet和NetworkAclQuintupleSet只能输入一个。 - NetworkAclEntrySet *NetworkAclEntrySet `json:"NetworkAclEntrySet,omitempty" name:"NetworkAclEntrySet"` - - // 网络ACL五元组规则集。NetworkAclEntrySet和NetworkAclQuintupleSet只能输入一个。 - NetworkAclQuintupleSet *NetworkAclQuintupleEntries `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` -} - -func (r *ModifyNetworkAclEntriesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkAclEntriesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - delete(f, "NetworkAclEntrySet") - delete(f, "NetworkAclQuintupleSet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNetworkAclEntriesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkAclEntriesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNetworkAclEntriesResponse struct { - *tchttp.BaseResponse - Response *ModifyNetworkAclEntriesResponseParams `json:"Response"` -} - -func (r *ModifyNetworkAclEntriesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkAclEntriesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkAclQuintupleEntriesRequestParams struct { - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络五元组ACL规则集。 - NetworkAclQuintupleSet *NetworkAclQuintupleEntries `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` -} - -type ModifyNetworkAclQuintupleEntriesRequest struct { - *tchttp.BaseRequest - - // 网络ACL实例ID。例如:acl-12345678。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络五元组ACL规则集。 - NetworkAclQuintupleSet *NetworkAclQuintupleEntries `json:"NetworkAclQuintupleSet,omitempty" name:"NetworkAclQuintupleSet"` -} - -func (r *ModifyNetworkAclQuintupleEntriesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkAclQuintupleEntriesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkAclId") - delete(f, "NetworkAclQuintupleSet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNetworkAclQuintupleEntriesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkAclQuintupleEntriesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNetworkAclQuintupleEntriesResponse struct { - *tchttp.BaseResponse - Response *ModifyNetworkAclQuintupleEntriesResponseParams `json:"Response"` -} - -func (r *ModifyNetworkAclQuintupleEntriesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkAclQuintupleEntriesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkInterfaceAttributeRequestParams struct { - // 弹性网卡实例ID,例如:eni-pxir56ns。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 弹性网卡名称,最大长度不能超过60个字节。 - NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` - - // 弹性网卡描述,可任意命名,但不得超过60个字符。 - NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` - - // 指定绑定的安全组,例如:['sg-1dd51d']。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 网卡trunking模式设置,Enable-开启,Disable--关闭,默认关闭。 - TrunkingFlag *string `json:"TrunkingFlag,omitempty" name:"TrunkingFlag"` -} - -type ModifyNetworkInterfaceAttributeRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID,例如:eni-pxir56ns。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 弹性网卡名称,最大长度不能超过60个字节。 - NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` - - // 弹性网卡描述,可任意命名,但不得超过60个字符。 - NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` - - // 指定绑定的安全组,例如:['sg-1dd51d']。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` - - // 网卡trunking模式设置,Enable-开启,Disable--关闭,默认关闭。 - TrunkingFlag *string `json:"TrunkingFlag,omitempty" name:"TrunkingFlag"` -} - -func (r *ModifyNetworkInterfaceAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkInterfaceAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "NetworkInterfaceName") - delete(f, "NetworkInterfaceDescription") - delete(f, "SecurityGroupIds") - delete(f, "TrunkingFlag") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNetworkInterfaceAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkInterfaceAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNetworkInterfaceAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyNetworkInterfaceAttributeResponseParams `json:"Response"` -} - -func (r *ModifyNetworkInterfaceAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkInterfaceAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkInterfaceQosRequestParams struct { - // 弹性网卡ID,支持批量修改。 - NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds"` - - // 服务质量,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // DirectSend端口范围最大值。 - DirectSendMaxPort *uint64 `json:"DirectSendMaxPort,omitempty" name:"DirectSendMaxPort"` -} - -type ModifyNetworkInterfaceQosRequest struct { - *tchttp.BaseRequest - - // 弹性网卡ID,支持批量修改。 - NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds"` - - // 服务质量,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` - - // DirectSend端口范围最大值。 - DirectSendMaxPort *uint64 `json:"DirectSendMaxPort,omitempty" name:"DirectSendMaxPort"` -} - -func (r *ModifyNetworkInterfaceQosRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkInterfaceQosRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceIds") - delete(f, "QosLevel") - delete(f, "DirectSendMaxPort") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyNetworkInterfaceQosRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyNetworkInterfaceQosResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyNetworkInterfaceQosResponse struct { - *tchttp.BaseResponse - Response *ModifyNetworkInterfaceQosResponseParams `json:"Response"` -} - -func (r *ModifyNetworkInterfaceQosResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyNetworkInterfaceQosResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyPrivateIpAddressesAttributeRequestParams struct { - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的内网IP信息。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` -} - -type ModifyPrivateIpAddressesAttributeRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的内网IP信息。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` -} - -func (r *ModifyPrivateIpAddressesAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyPrivateIpAddressesAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "PrivateIpAddresses") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyPrivateIpAddressesAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyPrivateIpAddressesAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyPrivateIpAddressesAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyPrivateIpAddressesAttributeResponseParams `json:"Response"` -} - -func (r *ModifyPrivateIpAddressesAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyPrivateIpAddressesAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyRouteTableAttributeRequestParams struct { - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由表名称。 - RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` -} - -type ModifyRouteTableAttributeRequest struct { - *tchttp.BaseRequest - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由表名称。 - RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` -} - -func (r *ModifyRouteTableAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyRouteTableAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "RouteTableName") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyRouteTableAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyRouteTableAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyRouteTableAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyRouteTableAttributeResponseParams `json:"Response"` -} - -func (r *ModifyRouteTableAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyRouteTableAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifySecurityGroupAttributeRequestParams struct { - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组名称,可任意命名,但不得超过60个字符。 - GroupName *string `json:"GroupName,omitempty" name:"GroupName"` - - // 安全组备注,最多100个字符。 - GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` -} - -type ModifySecurityGroupAttributeRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组名称,可任意命名,但不得超过60个字符。 - GroupName *string `json:"GroupName,omitempty" name:"GroupName"` - - // 安全组备注,最多100个字符。 - GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` -} - -func (r *ModifySecurityGroupAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifySecurityGroupAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - delete(f, "GroupName") - delete(f, "GroupDescription") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifySecurityGroupAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifySecurityGroupAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifySecurityGroupAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifySecurityGroupAttributeResponseParams `json:"Response"` -} - -func (r *ModifySecurityGroupAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifySecurityGroupAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifySecurityGroupPoliciesRequestParams struct { - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合。 SecurityGroupPolicySet对象必须同时指定新的出(Egress)入(Ingress)站规则。 SecurityGroupPolicy对象不支持自定义索引(PolicyIndex)。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` - - // 排序安全组标识,默认值为False。当SortPolicys为False时,不改变安全组规则排序;当SortPolicys为True时,系统将严格按照SecurityGroupPolicySet参数传入的安全组规则及顺序进行重置,考虑到人为输入参数可能存在遗漏风险,建议通过控制台对安全组规则进行排序。 - SortPolicys *bool `json:"SortPolicys,omitempty" name:"SortPolicys"` -} - -type ModifySecurityGroupPoliciesRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合。 SecurityGroupPolicySet对象必须同时指定新的出(Egress)入(Ingress)站规则。 SecurityGroupPolicy对象不支持自定义索引(PolicyIndex)。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` - - // 排序安全组标识,默认值为False。当SortPolicys为False时,不改变安全组规则排序;当SortPolicys为True时,系统将严格按照SecurityGroupPolicySet参数传入的安全组规则及顺序进行重置,考虑到人为输入参数可能存在遗漏风险,建议通过控制台对安全组规则进行排序。 - SortPolicys *bool `json:"SortPolicys,omitempty" name:"SortPolicys"` -} - -func (r *ModifySecurityGroupPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifySecurityGroupPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - delete(f, "SecurityGroupPolicySet") - delete(f, "SortPolicys") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifySecurityGroupPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifySecurityGroupPoliciesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifySecurityGroupPoliciesResponse struct { - *tchttp.BaseResponse - Response *ModifySecurityGroupPoliciesResponseParams `json:"Response"` -} - -func (r *ModifySecurityGroupPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifySecurityGroupPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyServiceTemplateAttributeRequestParams struct { - // 协议端口模板实例ID,例如:ppm-529nwwj8。 - ServiceTemplateId *string `json:"ServiceTemplateId,omitempty" name:"ServiceTemplateId"` - - // 协议端口模板名称。 - ServiceTemplateName *string `json:"ServiceTemplateName,omitempty" name:"ServiceTemplateName"` - - // 支持单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。 - Services []*string `json:"Services,omitempty" name:"Services"` - - // 支持添加备注的协议端口信息,支持单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。 - ServicesExtra []*ServicesInfo `json:"ServicesExtra,omitempty" name:"ServicesExtra"` -} - -type ModifyServiceTemplateAttributeRequest struct { - *tchttp.BaseRequest - - // 协议端口模板实例ID,例如:ppm-529nwwj8。 - ServiceTemplateId *string `json:"ServiceTemplateId,omitempty" name:"ServiceTemplateId"` - - // 协议端口模板名称。 - ServiceTemplateName *string `json:"ServiceTemplateName,omitempty" name:"ServiceTemplateName"` - - // 支持单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。 - Services []*string `json:"Services,omitempty" name:"Services"` - - // 支持添加备注的协议端口信息,支持单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。 - ServicesExtra []*ServicesInfo `json:"ServicesExtra,omitempty" name:"ServicesExtra"` -} - -func (r *ModifyServiceTemplateAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyServiceTemplateAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ServiceTemplateId") - delete(f, "ServiceTemplateName") - delete(f, "Services") - delete(f, "ServicesExtra") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyServiceTemplateAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyServiceTemplateAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyServiceTemplateAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyServiceTemplateAttributeResponseParams `json:"Response"` -} - -func (r *ModifyServiceTemplateAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyServiceTemplateAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyServiceTemplateGroupAttributeRequestParams struct { - // 协议端口模板集合实例ID,例如:ppmg-ei8hfd9a。 - ServiceTemplateGroupId *string `json:"ServiceTemplateGroupId,omitempty" name:"ServiceTemplateGroupId"` - - // 协议端口模板集合名称。 - ServiceTemplateGroupName *string `json:"ServiceTemplateGroupName,omitempty" name:"ServiceTemplateGroupName"` - - // 协议端口模板实例ID,例如:ppm-4dw6agho。 - ServiceTemplateIds []*string `json:"ServiceTemplateIds,omitempty" name:"ServiceTemplateIds"` -} - -type ModifyServiceTemplateGroupAttributeRequest struct { - *tchttp.BaseRequest - - // 协议端口模板集合实例ID,例如:ppmg-ei8hfd9a。 - ServiceTemplateGroupId *string `json:"ServiceTemplateGroupId,omitempty" name:"ServiceTemplateGroupId"` - - // 协议端口模板集合名称。 - ServiceTemplateGroupName *string `json:"ServiceTemplateGroupName,omitempty" name:"ServiceTemplateGroupName"` - - // 协议端口模板实例ID,例如:ppm-4dw6agho。 - ServiceTemplateIds []*string `json:"ServiceTemplateIds,omitempty" name:"ServiceTemplateIds"` -} - -func (r *ModifyServiceTemplateGroupAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyServiceTemplateGroupAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "ServiceTemplateGroupId") - delete(f, "ServiceTemplateGroupName") - delete(f, "ServiceTemplateIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyServiceTemplateGroupAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyServiceTemplateGroupAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyServiceTemplateGroupAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyServiceTemplateGroupAttributeResponseParams `json:"Response"` -} - -func (r *ModifyServiceTemplateGroupAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyServiceTemplateGroupAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifySnapshotPoliciesRequestParams struct { - // 快照策略修改信息。 - SnapshotPoliciesInfo []*BatchModifySnapshotPolicy `json:"SnapshotPoliciesInfo,omitempty" name:"SnapshotPoliciesInfo"` -} - -type ModifySnapshotPoliciesRequest struct { - *tchttp.BaseRequest - - // 快照策略修改信息。 - SnapshotPoliciesInfo []*BatchModifySnapshotPolicy `json:"SnapshotPoliciesInfo,omitempty" name:"SnapshotPoliciesInfo"` -} - -func (r *ModifySnapshotPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifySnapshotPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPoliciesInfo") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifySnapshotPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifySnapshotPoliciesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifySnapshotPoliciesResponse struct { - *tchttp.BaseResponse - Response *ModifySnapshotPoliciesResponseParams `json:"Response"` -} - -func (r *ModifySnapshotPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifySnapshotPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifySubnetAttributeRequestParams struct { - // 子网实例ID。形如:subnet-pxir56ns。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 子网名称,最大长度不能超过60个字节。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 子网是否开启广播。 - EnableBroadcast *string `json:"EnableBroadcast,omitempty" name:"EnableBroadcast"` -} - -type ModifySubnetAttributeRequest struct { - *tchttp.BaseRequest - - // 子网实例ID。形如:subnet-pxir56ns。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 子网名称,最大长度不能超过60个字节。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 子网是否开启广播。 - EnableBroadcast *string `json:"EnableBroadcast,omitempty" name:"EnableBroadcast"` -} - -func (r *ModifySubnetAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifySubnetAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SubnetId") - delete(f, "SubnetName") - delete(f, "EnableBroadcast") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifySubnetAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifySubnetAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifySubnetAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifySubnetAttributeResponseParams `json:"Response"` -} - -func (r *ModifySubnetAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifySubnetAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyTemplateMemberRequestParams struct { - // 参数模板实例ID,支持IP地址、协议端口、IP地址组、协议端口组四种参数模板的实例ID。 - TemplateId *string `json:"TemplateId,omitempty" name:"TemplateId"` - - // 需要修改的参数模板成员信息,支持IP地址、协议端口、IP地址组、协议端口组四种类型,类型需要与TemplateId参数类型一致,修改顺序与TemplateMember参数顺序一一对应,入参长度需要与TemplateMember参数保持一致。 - OriginalTemplateMember []*MemberInfo `json:"OriginalTemplateMember,omitempty" name:"OriginalTemplateMember"` - - // 新的参数模板成员信息,支持IP地址、协议端口、IP地址组、协议端口组四种类型,类型需要与TemplateId参数类型一致,修改顺序与OriginalTemplateMember参数顺序一一对应,入参长度需要与OriginalTemplateMember参数保持一致。 - TemplateMember []*MemberInfo `json:"TemplateMember,omitempty" name:"TemplateMember"` -} - -type ModifyTemplateMemberRequest struct { - *tchttp.BaseRequest - - // 参数模板实例ID,支持IP地址、协议端口、IP地址组、协议端口组四种参数模板的实例ID。 - TemplateId *string `json:"TemplateId,omitempty" name:"TemplateId"` - - // 需要修改的参数模板成员信息,支持IP地址、协议端口、IP地址组、协议端口组四种类型,类型需要与TemplateId参数类型一致,修改顺序与TemplateMember参数顺序一一对应,入参长度需要与TemplateMember参数保持一致。 - OriginalTemplateMember []*MemberInfo `json:"OriginalTemplateMember,omitempty" name:"OriginalTemplateMember"` - - // 新的参数模板成员信息,支持IP地址、协议端口、IP地址组、协议端口组四种类型,类型需要与TemplateId参数类型一致,修改顺序与OriginalTemplateMember参数顺序一一对应,入参长度需要与OriginalTemplateMember参数保持一致。 - TemplateMember []*MemberInfo `json:"TemplateMember,omitempty" name:"TemplateMember"` -} - -func (r *ModifyTemplateMemberRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyTemplateMemberRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "TemplateId") - delete(f, "OriginalTemplateMember") - delete(f, "TemplateMember") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyTemplateMemberRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyTemplateMemberResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyTemplateMemberResponse struct { - *tchttp.BaseResponse - Response *ModifyTemplateMemberResponseParams `json:"Response"` -} - -func (r *ModifyTemplateMemberResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyTemplateMemberResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcAttributeRequestParams struct { - // VPC实例ID。形如:vpc-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpcIds和Filters。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 私有网络名称,可任意命名,但不得超过60个字符。 - VpcName *string `json:"VpcName,omitempty" name:"VpcName"` - - // 是否开启组播。true: 开启, false: 关闭。 - EnableMulticast *string `json:"EnableMulticast,omitempty" name:"EnableMulticast"` - - // DNS地址,最多支持4个,第1个默认为主,其余为备。 - DnsServers []*string `json:"DnsServers,omitempty" name:"DnsServers"` - - // 域名。 - DomainName *string `json:"DomainName,omitempty" name:"DomainName"` - - // 发布cdc 子网到云联网的开关。true: 发布, false: 不发布。 - EnableCdcPublish *bool `json:"EnableCdcPublish,omitempty" name:"EnableCdcPublish"` -} - -type ModifyVpcAttributeRequest struct { - *tchttp.BaseRequest - - // VPC实例ID。形如:vpc-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpcIds和Filters。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 私有网络名称,可任意命名,但不得超过60个字符。 - VpcName *string `json:"VpcName,omitempty" name:"VpcName"` - - // 是否开启组播。true: 开启, false: 关闭。 - EnableMulticast *string `json:"EnableMulticast,omitempty" name:"EnableMulticast"` - - // DNS地址,最多支持4个,第1个默认为主,其余为备。 - DnsServers []*string `json:"DnsServers,omitempty" name:"DnsServers"` - - // 域名。 - DomainName *string `json:"DomainName,omitempty" name:"DomainName"` - - // 发布cdc 子网到云联网的开关。true: 发布, false: 不发布。 - EnableCdcPublish *bool `json:"EnableCdcPublish,omitempty" name:"EnableCdcPublish"` -} - -func (r *ModifyVpcAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "VpcName") - delete(f, "EnableMulticast") - delete(f, "DnsServers") - delete(f, "DomainName") - delete(f, "EnableCdcPublish") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpcAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpcAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyVpcAttributeResponseParams `json:"Response"` -} - -func (r *ModifyVpcAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcEndPointAttributeRequestParams struct { - // 终端节点ID。 - EndPointId *string `json:"EndPointId,omitempty" name:"EndPointId"` - - // 终端节点名称。 - EndPointName *string `json:"EndPointName,omitempty" name:"EndPointName"` - - // 安全组ID列表。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -type ModifyVpcEndPointAttributeRequest struct { - *tchttp.BaseRequest - - // 终端节点ID。 - EndPointId *string `json:"EndPointId,omitempty" name:"EndPointId"` - - // 终端节点名称。 - EndPointName *string `json:"EndPointName,omitempty" name:"EndPointName"` - - // 安全组ID列表。 - SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds"` -} - -func (r *ModifyVpcEndPointAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcEndPointAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "EndPointId") - delete(f, "EndPointName") - delete(f, "SecurityGroupIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpcEndPointAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcEndPointAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpcEndPointAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyVpcEndPointAttributeResponseParams `json:"Response"` -} - -func (r *ModifyVpcEndPointAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcEndPointAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcEndPointServiceAttributeRequestParams struct { - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // VPCID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 终端节点服务名称。 - EndPointServiceName *string `json:"EndPointServiceName,omitempty" name:"EndPointServiceName"` - - // 是否自动接受终端节点的连接请求。
  • true:自动接受
  • false:不自动接受 - AutoAcceptFlag *bool `json:"AutoAcceptFlag,omitempty" name:"AutoAcceptFlag"` - - // 后端服务的ID,比如lb-xxx。 - ServiceInstanceId *string `json:"ServiceInstanceId,omitempty" name:"ServiceInstanceId"` -} - -type ModifyVpcEndPointServiceAttributeRequest struct { - *tchttp.BaseRequest - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // VPCID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 终端节点服务名称。 - EndPointServiceName *string `json:"EndPointServiceName,omitempty" name:"EndPointServiceName"` - - // 是否自动接受终端节点的连接请求。
  • true:自动接受
  • false:不自动接受 - AutoAcceptFlag *bool `json:"AutoAcceptFlag,omitempty" name:"AutoAcceptFlag"` - - // 后端服务的ID,比如lb-xxx。 - ServiceInstanceId *string `json:"ServiceInstanceId,omitempty" name:"ServiceInstanceId"` -} - -func (r *ModifyVpcEndPointServiceAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcEndPointServiceAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "EndPointServiceId") - delete(f, "VpcId") - delete(f, "EndPointServiceName") - delete(f, "AutoAcceptFlag") - delete(f, "ServiceInstanceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpcEndPointServiceAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcEndPointServiceAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpcEndPointServiceAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyVpcEndPointServiceAttributeResponseParams `json:"Response"` -} - -func (r *ModifyVpcEndPointServiceAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcEndPointServiceAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcEndPointServiceWhiteListRequestParams struct { - // 用户UIN。 - UserUin *string `json:"UserUin,omitempty" name:"UserUin"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 白名单描述信息。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -type ModifyVpcEndPointServiceWhiteListRequest struct { - *tchttp.BaseRequest - - // 用户UIN。 - UserUin *string `json:"UserUin,omitempty" name:"UserUin"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` - - // 白名单描述信息。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -func (r *ModifyVpcEndPointServiceWhiteListRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcEndPointServiceWhiteListRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "UserUin") - delete(f, "EndPointServiceId") - delete(f, "Description") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpcEndPointServiceWhiteListRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcEndPointServiceWhiteListResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpcEndPointServiceWhiteListResponse struct { - *tchttp.BaseResponse - Response *ModifyVpcEndPointServiceWhiteListResponseParams `json:"Response"` -} - -func (r *ModifyVpcEndPointServiceWhiteListResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcEndPointServiceWhiteListResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcPeeringConnectionRequestParams struct { -} - -type ModifyVpcPeeringConnectionRequest struct { - *tchttp.BaseRequest -} - -func (r *ModifyVpcPeeringConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcPeeringConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpcPeeringConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpcPeeringConnectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpcPeeringConnectionResponse struct { - *tchttp.BaseResponse - Response *ModifyVpcPeeringConnectionResponseParams `json:"Response"` -} - -func (r *ModifyVpcPeeringConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpcPeeringConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpnConnectionAttributeRequestParams struct { - // VPN通道实例ID。形如:vpnx-f49l6u0z。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` - - // VPN通道名称,可任意命名,但不得超过60个字符。 - VpnConnectionName *string `json:"VpnConnectionName,omitempty" name:"VpnConnectionName"` - - // 预共享密钥。 - PreShareKey *string `json:"PreShareKey,omitempty" name:"PreShareKey"` - - // SPD策略组,例如:{"10.0.0.5/24":["172.123.10.5/16"]},10.0.0.5/24是vpc内网段,172.123.10.5/16是IDC网段。用户指定VPC内哪些网段可以和您IDC中哪些网段通信。 - SecurityPolicyDatabases []*SecurityPolicyDatabase `json:"SecurityPolicyDatabases,omitempty" name:"SecurityPolicyDatabases"` - - // IKE配置(Internet Key Exchange,因特网密钥交换),IKE具有一套自我保护机制,用户配置网络安全协议。 - IKEOptionsSpecification *IKEOptionsSpecification `json:"IKEOptionsSpecification,omitempty" name:"IKEOptionsSpecification"` - - // IPSec配置,腾讯云提供IPSec安全会话设置。 - IPSECOptionsSpecification *IPSECOptionsSpecification `json:"IPSECOptionsSpecification,omitempty" name:"IPSECOptionsSpecification"` - - // 是否启用通道健康检查,默认为False。 - EnableHealthCheck *bool `json:"EnableHealthCheck,omitempty" name:"EnableHealthCheck"` - - // 本端通道探测IP。 - HealthCheckLocalIp *string `json:"HealthCheckLocalIp,omitempty" name:"HealthCheckLocalIp"` - - // 对端通道探测IP。 - HealthCheckRemoteIp *string `json:"HealthCheckRemoteIp,omitempty" name:"HealthCheckRemoteIp"` - - // 协商类型,默认为active(主动协商)。可选值:active(主动协商),passive(被动协商),flowTrigger(流量协商) - NegotiationType *string `json:"NegotiationType,omitempty" name:"NegotiationType"` - - // DPD探测开关。默认为0,表示关闭DPD探测。可选值:0(关闭),1(开启) - DpdEnable *int64 `json:"DpdEnable,omitempty" name:"DpdEnable"` - - // DPD超时时间。即探测确认对端不存在需要的时间。dpdEnable为1(开启)时有效。默认30,单位为秒 - DpdTimeout *string `json:"DpdTimeout,omitempty" name:"DpdTimeout"` - - // DPD超时后的动作。默认为clear。dpdEnable为1(开启)时有效。可取值为clear(断开)和restart(重试) - DpdAction *string `json:"DpdAction,omitempty" name:"DpdAction"` - - // 对端网关ID,4.0及以上网关下的通道支持更新。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` -} - -type ModifyVpnConnectionAttributeRequest struct { - *tchttp.BaseRequest - - // VPN通道实例ID。形如:vpnx-f49l6u0z。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` - - // VPN通道名称,可任意命名,但不得超过60个字符。 - VpnConnectionName *string `json:"VpnConnectionName,omitempty" name:"VpnConnectionName"` - - // 预共享密钥。 - PreShareKey *string `json:"PreShareKey,omitempty" name:"PreShareKey"` - - // SPD策略组,例如:{"10.0.0.5/24":["172.123.10.5/16"]},10.0.0.5/24是vpc内网段,172.123.10.5/16是IDC网段。用户指定VPC内哪些网段可以和您IDC中哪些网段通信。 - SecurityPolicyDatabases []*SecurityPolicyDatabase `json:"SecurityPolicyDatabases,omitempty" name:"SecurityPolicyDatabases"` - - // IKE配置(Internet Key Exchange,因特网密钥交换),IKE具有一套自我保护机制,用户配置网络安全协议。 - IKEOptionsSpecification *IKEOptionsSpecification `json:"IKEOptionsSpecification,omitempty" name:"IKEOptionsSpecification"` - - // IPSec配置,腾讯云提供IPSec安全会话设置。 - IPSECOptionsSpecification *IPSECOptionsSpecification `json:"IPSECOptionsSpecification,omitempty" name:"IPSECOptionsSpecification"` - - // 是否启用通道健康检查,默认为False。 - EnableHealthCheck *bool `json:"EnableHealthCheck,omitempty" name:"EnableHealthCheck"` - - // 本端通道探测IP。 - HealthCheckLocalIp *string `json:"HealthCheckLocalIp,omitempty" name:"HealthCheckLocalIp"` - - // 对端通道探测IP。 - HealthCheckRemoteIp *string `json:"HealthCheckRemoteIp,omitempty" name:"HealthCheckRemoteIp"` - - // 协商类型,默认为active(主动协商)。可选值:active(主动协商),passive(被动协商),flowTrigger(流量协商) - NegotiationType *string `json:"NegotiationType,omitempty" name:"NegotiationType"` - - // DPD探测开关。默认为0,表示关闭DPD探测。可选值:0(关闭),1(开启) - DpdEnable *int64 `json:"DpdEnable,omitempty" name:"DpdEnable"` - - // DPD超时时间。即探测确认对端不存在需要的时间。dpdEnable为1(开启)时有效。默认30,单位为秒 - DpdTimeout *string `json:"DpdTimeout,omitempty" name:"DpdTimeout"` - - // DPD超时后的动作。默认为clear。dpdEnable为1(开启)时有效。可取值为clear(断开)和restart(重试) - DpdAction *string `json:"DpdAction,omitempty" name:"DpdAction"` - - // 对端网关ID,4.0及以上网关下的通道支持更新。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` -} - -func (r *ModifyVpnConnectionAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpnConnectionAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnConnectionId") - delete(f, "VpnConnectionName") - delete(f, "PreShareKey") - delete(f, "SecurityPolicyDatabases") - delete(f, "IKEOptionsSpecification") - delete(f, "IPSECOptionsSpecification") - delete(f, "EnableHealthCheck") - delete(f, "HealthCheckLocalIp") - delete(f, "HealthCheckRemoteIp") - delete(f, "NegotiationType") - delete(f, "DpdEnable") - delete(f, "DpdTimeout") - delete(f, "DpdAction") - delete(f, "CustomerGatewayId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpnConnectionAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpnConnectionAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpnConnectionAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyVpnConnectionAttributeResponseParams `json:"Response"` -} - -func (r *ModifyVpnConnectionAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpnConnectionAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpnGatewayAttributeRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN网关名称,最大长度不能超过60个字节。 - VpnGatewayName *string `json:"VpnGatewayName,omitempty" name:"VpnGatewayName"` - - // VPN网关计费模式,目前只支持预付费(即包年包月)到后付费(即按量计费)的转换。即参数只支持:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` -} - -type ModifyVpnGatewayAttributeRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN网关名称,最大长度不能超过60个字节。 - VpnGatewayName *string `json:"VpnGatewayName,omitempty" name:"VpnGatewayName"` - - // VPN网关计费模式,目前只支持预付费(即包年包月)到后付费(即按量计费)的转换。即参数只支持:POSTPAID_BY_HOUR。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` -} - -func (r *ModifyVpnGatewayAttributeRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpnGatewayAttributeRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "VpnGatewayName") - delete(f, "InstanceChargeType") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpnGatewayAttributeRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpnGatewayAttributeResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpnGatewayAttributeResponse struct { - *tchttp.BaseResponse - Response *ModifyVpnGatewayAttributeResponseParams `json:"Response"` -} - -func (r *ModifyVpnGatewayAttributeResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpnGatewayAttributeResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpnGatewayCcnRoutesRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 云联网路由(IDC网段)列表。 - Routes []*VpngwCcnRoutes `json:"Routes,omitempty" name:"Routes"` -} - -type ModifyVpnGatewayCcnRoutesRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 云联网路由(IDC网段)列表。 - Routes []*VpngwCcnRoutes `json:"Routes,omitempty" name:"Routes"` -} - -func (r *ModifyVpnGatewayCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpnGatewayCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpnGatewayCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpnGatewayCcnRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpnGatewayCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *ModifyVpnGatewayCcnRoutesResponseParams `json:"Response"` -} - -func (r *ModifyVpnGatewayCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpnGatewayCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpnGatewayRoutesRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 路由修改参数。 - Routes []*VpnGatewayRouteModify `json:"Routes,omitempty" name:"Routes"` -} - -type ModifyVpnGatewayRoutesRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 路由修改参数。 - Routes []*VpnGatewayRouteModify `json:"Routes,omitempty" name:"Routes"` -} - -func (r *ModifyVpnGatewayRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpnGatewayRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyVpnGatewayRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ModifyVpnGatewayRoutesResponseParams struct { - // VPN路由信息 - // 注意:此字段可能返回 null,表示取不到有效值。 - Routes []*VpnGatewayRoute `json:"Routes,omitempty" name:"Routes"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ModifyVpnGatewayRoutesResponse struct { - *tchttp.BaseResponse - Response *ModifyVpnGatewayRoutesResponseParams `json:"Response"` -} - -func (r *ModifyVpnGatewayRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ModifyVpnGatewayRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type NatDirectConnectGatewayRoute struct { - // 子网的 `IPv4` `CIDR` - DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` - - // 下一跳网关的类型,目前此接口支持的类型有: - // DIRECTCONNECT:专线网关 - GatewayType *string `json:"GatewayType,omitempty" name:"GatewayType"` - - // 下一跳网关ID - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` - - // 路由的创建时间 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 路由的更新时间 - UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` -} - -type NatGateway struct { - // NAT网关的ID。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关的名称。 - NatGatewayName *string `json:"NatGatewayName,omitempty" name:"NatGatewayName"` - - // NAT网关创建的时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // NAT网关的状态。 - // 'PENDING':生产中,'DELETING':删除中,'AVAILABLE':运行中,'UPDATING':升级中, - // ‘FAILED’:失败。 - State *string `json:"State,omitempty" name:"State"` - - // 网关最大外网出带宽(单位:Mbps)。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 网关并发连接上限。 - MaxConcurrentConnection *uint64 `json:"MaxConcurrentConnection,omitempty" name:"MaxConcurrentConnection"` - - // 绑定NAT网关的公网IP对象数组。 - PublicIpAddressSet []*NatGatewayAddress `json:"PublicIpAddressSet,omitempty" name:"PublicIpAddressSet"` - - // NAT网关网络状态。“AVAILABLE”:运行中, “UNAVAILABLE”:不可用, “INSUFFICIENT”:欠费停服。 - NetworkState *string `json:"NetworkState,omitempty" name:"NetworkState"` - - // NAT网关的端口转发规则。 - DestinationIpPortTranslationNatRuleSet []*DestinationIpPortTranslationNatRule `json:"DestinationIpPortTranslationNatRuleSet,omitempty" name:"DestinationIpPortTranslationNatRuleSet"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关所在的可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 绑定的专线网关ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DirectConnectGatewayIds []*string `json:"DirectConnectGatewayIds,omitempty" name:"DirectConnectGatewayIds"` - - // 所属子网ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 标签键值对。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // NAT网关绑定的安全组列表 - // 注意:此字段可能返回 null,表示取不到有效值。 - SecurityGroupSet []*string `json:"SecurityGroupSet,omitempty" name:"SecurityGroupSet"` - - // NAT网关的SNAT转发规则。 - // 注意:此字段可能返回 null,表示取不到有效值。 - SourceIpTranslationNatRuleSet []*SourceIpTranslationNatRule `json:"SourceIpTranslationNatRuleSet,omitempty" name:"SourceIpTranslationNatRuleSet"` - - // 是否独享型NAT。 - // 注意:此字段可能返回 null,表示取不到有效值。 - IsExclusive *bool `json:"IsExclusive,omitempty" name:"IsExclusive"` - - // 独享型NAT所在的网关集群的带宽(单位:Mbps),当IsExclusive为false时无此字段。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ExclusiveGatewayBandwidth *uint64 `json:"ExclusiveGatewayBandwidth,omitempty" name:"ExclusiveGatewayBandwidth"` - - // NAT网关是否被封禁。“NORMAL”:未被封禁,“RESTRICTED”:已被封禁。 - // 注意:此字段可能返回 null,表示取不到有效值。 - RestrictState *string `json:"RestrictState,omitempty" name:"RestrictState"` - - // NAT网关大版本号,传统型=1,标准型=2 - // 注意:此字段可能返回 null,表示取不到有效值。 - NatProductVersion *uint64 `json:"NatProductVersion,omitempty" name:"NatProductVersion"` -} - -type NatGatewayAddress struct { - // 弹性公网IP(EIP)的唯一 ID,形如:`eip-11112222`。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 外网IP地址,形如:`123.121.34.33`。 - PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` - - // 资源封堵状态。true表示弹性ip处于封堵状态,false表示弹性ip处于未封堵状态。 - IsBlocked *bool `json:"IsBlocked,omitempty" name:"IsBlocked"` -} - -type NatGatewayDestinationIpPortTranslationNatRule struct { - // 网络协议,可选值:`TCP`、`UDP`。 - IpProtocol *string `json:"IpProtocol,omitempty" name:"IpProtocol"` - - // 弹性IP。 - PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` - - // 公网端口。 - PublicPort *uint64 `json:"PublicPort,omitempty" name:"PublicPort"` - - // 内网地址。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 内网端口。 - PrivatePort *uint64 `json:"PrivatePort,omitempty" name:"PrivatePort"` - - // NAT网关转发规则描述。 - Description *string `json:"Description,omitempty" name:"Description"` - - // NAT网关的ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 私有网络VPC的ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关转发规则创建时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type NetDetect struct { - // `VPC`实例`ID`。形如:`vpc-12345678` - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `VPC`实例名称。 - VpcName *string `json:"VpcName,omitempty" name:"VpcName"` - - // 子网实例ID。形如:subnet-12345678。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 子网实例名称。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 网络探测实例ID。形如:netd-12345678。 - NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` - - // 网络探测名称,最大长度不能超过60个字节。 - NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` - - // 探测目的IPv4地址数组,最多两个。 - DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` - - // 系统自动分配的探测源IPv4数组。长度为2。 - DetectSourceIp []*string `json:"DetectSourceIp,omitempty" name:"DetectSourceIp"` - - // 下一跳类型,目前我们支持的类型有: - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // CCN:云联网网关; - // NONEXTHOP:无下一跳; - NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` - - // 下一跳目的网关,取值与“下一跳类型”相关: - // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; - // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; - // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; - // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; - // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; - // 下一跳类型为CCN,取值云联网ID,形如:ccn-12345678; - // 下一跳类型为NONEXTHOP,指定网络探测为无下一跳的网络探测; - NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` - - // 下一跳网关名称。 - // 注意:此字段可能返回 null,表示取不到有效值。 - NextHopName *string `json:"NextHopName,omitempty" name:"NextHopName"` - - // 网络探测描述。 - // 注意:此字段可能返回 null,表示取不到有效值。 - NetDetectDescription *string `json:"NetDetectDescription,omitempty" name:"NetDetectDescription"` - - // 创建时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` -} - -type NetDetectIpState struct { - // 探测目的IPv4地址。 - DetectDestinationIp *string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` - - // 探测结果。 - // 0:成功; - // -1:查询不到路由丢包; - // -2:外出ACL丢包; - // -3:IN ACL丢包; - // -4:其他错误; - State *int64 `json:"State,omitempty" name:"State"` - - // 时延,单位毫秒 - Delay *uint64 `json:"Delay,omitempty" name:"Delay"` - - // 丢包率 - PacketLossRate *uint64 `json:"PacketLossRate,omitempty" name:"PacketLossRate"` -} - -type NetDetectState struct { - // 网络探测实例ID。形如:netd-12345678。 - NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` - - // 网络探测目的IP验证结果对象数组。 - NetDetectIpStateSet []*NetDetectIpState `json:"NetDetectIpStateSet,omitempty" name:"NetDetectIpStateSet"` -} - -type NetworkAcl struct { - // `VPC`实例`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 网络ACL实例`ID`。 - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 网络ACL名称,最大长度为60。 - NetworkAclName *string `json:"NetworkAclName,omitempty" name:"NetworkAclName"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 网络ACL关联的子网数组。 - SubnetSet []*Subnet `json:"SubnetSet,omitempty" name:"SubnetSet"` - - // 网络ACl入站规则。 - IngressEntries []*NetworkAclEntry `json:"IngressEntries,omitempty" name:"IngressEntries"` - - // 网络ACL出站规则。 - EgressEntries []*NetworkAclEntry `json:"EgressEntries,omitempty" name:"EgressEntries"` - - // 网络ACL类型。三元组:'TRIPLE' 五元组:'QUINTUPLE' - NetworkAclType *string `json:"NetworkAclType,omitempty" name:"NetworkAclType"` - - // 标签键值对 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` -} - -type NetworkAclEntry struct { - // 修改时间。 - ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` - - // 协议, 取值: TCP,UDP, ICMP, ALL。 - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` - - // 端口(all, 单个port, range)。当Protocol为ALL或ICMP时,不能指定Port。 - Port *string `json:"Port,omitempty" name:"Port"` - - // 网段或IP(互斥)。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 网段或IPv6(互斥)。 - Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` - - // ACCEPT 或 DROP。 - Action *string `json:"Action,omitempty" name:"Action"` - - // 规则描述,最大长度100。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -type NetworkAclEntrySet struct { - // 入站规则。 - Ingress []*NetworkAclEntry `json:"Ingress,omitempty" name:"Ingress"` - - // 出站规则。 - Egress []*NetworkAclEntry `json:"Egress,omitempty" name:"Egress"` -} - -type NetworkAclQuintupleEntries struct { - // 网络ACL五元组入站规则。 - Ingress []*NetworkAclQuintupleEntry `json:"Ingress,omitempty" name:"Ingress"` - - // 网络ACL五元组出站规则 - Egress []*NetworkAclQuintupleEntry `json:"Egress,omitempty" name:"Egress"` -} - -type NetworkAclQuintupleEntry struct { - // 协议, 取值: TCP,UDP, ICMP, ALL。 - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` - - // 描述。 - Description *string `json:"Description,omitempty" name:"Description"` - - // 源端口(all, 单个port, range)。当Protocol为ALL或ICMP时,不能指定Port。 - SourcePort *string `json:"SourcePort,omitempty" name:"SourcePort"` - - // 源CIDR。 - SourceCidr *string `json:"SourceCidr,omitempty" name:"SourceCidr"` - - // 目的端口(all, 单个port, range)。当Protocol为ALL或ICMP时,不能指定Port。 - DestinationPort *string `json:"DestinationPort,omitempty" name:"DestinationPort"` - - // 目的CIDR。 - DestinationCidr *string `json:"DestinationCidr,omitempty" name:"DestinationCidr"` - - // 动作,ACCEPT 或 DROP。 - Action *string `json:"Action,omitempty" name:"Action"` - - // 网络ACL条目唯一ID。 - NetworkAclQuintupleEntryId *string `json:"NetworkAclQuintupleEntryId,omitempty" name:"NetworkAclQuintupleEntryId"` - - // 优先级,从1开始。 - Priority *int64 `json:"Priority,omitempty" name:"Priority"` - - // 创建时间,用于DescribeNetworkAclQuintupleEntries的出参。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 方向,INGRESS或EGRESS,用于DescribeNetworkAclQuintupleEntries的出参。 - NetworkAclDirection *string `json:"NetworkAclDirection,omitempty" name:"NetworkAclDirection"` -} - -type NetworkInterface struct { - // 弹性网卡实例ID,例如:eni-f1xjkw1b。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 弹性网卡名称。 - NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` - - // 弹性网卡描述。 - NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` - - // 子网实例ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 绑定的安全组。 - GroupSet []*string `json:"GroupSet,omitempty" name:"GroupSet"` - - // 是否是主网卡。 - Primary *bool `json:"Primary,omitempty" name:"Primary"` - - // MAC地址。 - MacAddress *string `json:"MacAddress,omitempty" name:"MacAddress"` - - // 弹性网卡状态: - //
  • `PENDING`:创建中
  • - //
  • `AVAILABLE`:可用的
  • - //
  • `ATTACHING`:绑定中
  • - //
  • `DETACHING`:解绑中
  • - //
  • `DELETING`:删除中
  • - State *string `json:"State,omitempty" name:"State"` - - // 内网IP信息。 - PrivateIpAddressSet []*PrivateIpAddressSpecification `json:"PrivateIpAddressSet,omitempty" name:"PrivateIpAddressSet"` - - // 绑定的云服务器对象。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Attachment *NetworkInterfaceAttachment `json:"Attachment,omitempty" name:"Attachment"` - - // 可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // `IPv6`地址列表。 - Ipv6AddressSet []*Ipv6Address `json:"Ipv6AddressSet,omitempty" name:"Ipv6AddressSet"` - - // 标签键值对。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // 网卡类型。0 - 弹性网卡;1 - evm弹性网卡。 - EniType *uint64 `json:"EniType,omitempty" name:"EniType"` - - // 网卡绑定的子机类型:cvm,eks。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Business *string `json:"Business,omitempty" name:"Business"` - - // 网卡所关联的CDC实例ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // 弹性网卡类型:0:标准型/1:扩展型。默认值为0。 - // 注意:此字段可能返回 null,表示取不到有效值。 - AttachType *uint64 `json:"AttachType,omitempty" name:"AttachType"` - - // 用于保留网卡主IP的资源ID用于保留网卡主IP的资源ID。用于删除网卡时作为入参数。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 服务质量级别: - //
  • `DEFAULT`:默认
  • - //
  • `PT`:云金
  • - //
  • `AU`:云银
  • - //
  • `AG`:云铜
  • - // 注意:此字段可能返回 null,表示取不到有效值。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` -} - -type NetworkInterfaceAttachment struct { - // 云主机实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 网卡在云主机实例内的序号。 - DeviceIndex *uint64 `json:"DeviceIndex,omitempty" name:"DeviceIndex"` - - // 云主机所有者账户信息。 - InstanceAccountId *string `json:"InstanceAccountId,omitempty" name:"InstanceAccountId"` - - // 绑定时间。 - AttachTime *string `json:"AttachTime,omitempty" name:"AttachTime"` -} - -// Predefined struct for user -type NotifyRoutesRequestParams struct { - // 路由表唯一ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略唯一ID。 - RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds"` -} - -type NotifyRoutesRequest struct { - *tchttp.BaseRequest - - // 路由表唯一ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略唯一ID。 - RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds"` -} - -func (r *NotifyRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *NotifyRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "RouteItemIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "NotifyRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type NotifyRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type NotifyRoutesResponse struct { - *tchttp.BaseResponse - Response *NotifyRoutesResponseParams `json:"Response"` -} - -func (r *NotifyRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *NotifyRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type Price struct { - // 实例价格。 - InstancePrice *ItemPrice `json:"InstancePrice,omitempty" name:"InstancePrice"` - - // 带宽价格。 - BandwidthPrice *ItemPrice `json:"BandwidthPrice,omitempty" name:"BandwidthPrice"` -} - -type PrivateIpAddressSpecification struct { - // 内网IP地址。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 是否是主IP。 - Primary *bool `json:"Primary,omitempty" name:"Primary"` - - // 公网IP地址。 - PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` - - // EIP实例ID,例如:eip-11112222。 - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 内网IP描述信息。 - Description *string `json:"Description,omitempty" name:"Description"` - - // 公网IP是否被封堵。 - IsWanIpBlocked *bool `json:"IsWanIpBlocked,omitempty" name:"IsWanIpBlocked"` - - // IP状态: - // PENDING:生产中 - // MIGRATING:迁移中 - // DELETING:删除中 - // AVAILABLE:可用的 - State *string `json:"State,omitempty" name:"State"` - - // IP服务质量等级,可选值:PT、AU、AG、DEFAULT,分别代表云金、云银、云铜、默认四个等级。 - QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` -} - -type ProductQuota struct { - // 产品配额ID - QuotaId *string `json:"QuotaId,omitempty" name:"QuotaId"` - - // 产品配额名称 - QuotaName *string `json:"QuotaName,omitempty" name:"QuotaName"` - - // 产品当前配额 - QuotaCurrent *int64 `json:"QuotaCurrent,omitempty" name:"QuotaCurrent"` - - // 产品配额上限 - QuotaLimit *int64 `json:"QuotaLimit,omitempty" name:"QuotaLimit"` - - // 产品配额是否有地域属性 - QuotaRegion *bool `json:"QuotaRegion,omitempty" name:"QuotaRegion"` -} - -type Quota struct { - // 配额名称,取值范围:
  • `TOTAL_EIP_QUOTA`:用户当前地域下EIP的配额数;
  • `DAILY_EIP_APPLY`:用户当前地域下今日申购次数;
  • `DAILY_PUBLIC_IP_ASSIGN`:用户当前地域下,重新分配公网 IP次数。 - QuotaId *string `json:"QuotaId,omitempty" name:"QuotaId"` - - // 当前数量 - QuotaCurrent *int64 `json:"QuotaCurrent,omitempty" name:"QuotaCurrent"` - - // 配额数量 - QuotaLimit *int64 `json:"QuotaLimit,omitempty" name:"QuotaLimit"` -} - -type ReferredSecurityGroup struct { - // 安全组实例ID。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 引用安全组实例ID(SecurityGroupId)的所有安全组实例ID。 - ReferredSecurityGroupIds []*string `json:"ReferredSecurityGroupIds,omitempty" name:"ReferredSecurityGroupIds"` -} - -// Predefined struct for user -type RefreshDirectConnectGatewayRouteToNatGatewayRequestParams struct { - // vpc的ID - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关ID - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 是否是预刷新;True:是, False:否 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` -} - -type RefreshDirectConnectGatewayRouteToNatGatewayRequest struct { - *tchttp.BaseRequest - - // vpc的ID - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关ID - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 是否是预刷新;True:是, False:否 - DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` -} - -func (r *RefreshDirectConnectGatewayRouteToNatGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RefreshDirectConnectGatewayRouteToNatGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "NatGatewayId") - delete(f, "DryRun") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RefreshDirectConnectGatewayRouteToNatGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RefreshDirectConnectGatewayRouteToNatGatewayResponseParams struct { - // IDC子网信息 - DirectConnectSubnetSet []*DirectConnectSubnet `json:"DirectConnectSubnetSet,omitempty" name:"DirectConnectSubnetSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RefreshDirectConnectGatewayRouteToNatGatewayResponse struct { - *tchttp.BaseResponse - Response *RefreshDirectConnectGatewayRouteToNatGatewayResponseParams `json:"Response"` -} - -func (r *RefreshDirectConnectGatewayRouteToNatGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RefreshDirectConnectGatewayRouteToNatGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RejectAttachCcnInstancesRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 拒绝关联实例列表。 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -type RejectAttachCcnInstancesRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 拒绝关联实例列表。 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -func (r *RejectAttachCcnInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RejectAttachCcnInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RejectAttachCcnInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RejectAttachCcnInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RejectAttachCcnInstancesResponse struct { - *tchttp.BaseResponse - Response *RejectAttachCcnInstancesResponseParams `json:"Response"` -} - -func (r *RejectAttachCcnInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RejectAttachCcnInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RejectVpcPeeringConnectionRequestParams struct { -} - -type RejectVpcPeeringConnectionRequest struct { - *tchttp.BaseRequest -} - -func (r *RejectVpcPeeringConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RejectVpcPeeringConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RejectVpcPeeringConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RejectVpcPeeringConnectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RejectVpcPeeringConnectionResponse struct { - *tchttp.BaseResponse - Response *RejectVpcPeeringConnectionResponseParams `json:"Response"` -} - -func (r *RejectVpcPeeringConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RejectVpcPeeringConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReleaseAddressesRequestParams struct { - // 标识 EIP 的唯一 ID 列表。EIP 唯一 ID 形如:`eip-11112222`。 - AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds"` -} - -type ReleaseAddressesRequest struct { - *tchttp.BaseRequest - - // 标识 EIP 的唯一 ID 列表。EIP 唯一 ID 形如:`eip-11112222`。 - AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds"` -} - -func (r *ReleaseAddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReleaseAddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReleaseAddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReleaseAddressesResponseParams struct { - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ReleaseAddressesResponse struct { - *tchttp.BaseResponse - Response *ReleaseAddressesResponseParams `json:"Response"` -} - -func (r *ReleaseAddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReleaseAddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReleaseIp6AddressesBandwidthRequestParams struct { - // IPV6地址。Ip6Addresses和Ip6AddressIds必须且只能传一个 - Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses"` - - // IPV6地址对应的唯一ID,形如eip-xxxxxxxx。Ip6Addresses和Ip6AddressIds必须且只能传一个。 - Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds"` -} - -type ReleaseIp6AddressesBandwidthRequest struct { - *tchttp.BaseRequest - - // IPV6地址。Ip6Addresses和Ip6AddressIds必须且只能传一个 - Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses"` - - // IPV6地址对应的唯一ID,形如eip-xxxxxxxx。Ip6Addresses和Ip6AddressIds必须且只能传一个。 - Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds"` -} - -func (r *ReleaseIp6AddressesBandwidthRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReleaseIp6AddressesBandwidthRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6Addresses") - delete(f, "Ip6AddressIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReleaseIp6AddressesBandwidthRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReleaseIp6AddressesBandwidthResponseParams struct { - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *string `json:"TaskId,omitempty" name:"TaskId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ReleaseIp6AddressesBandwidthResponse struct { - *tchttp.BaseResponse - Response *ReleaseIp6AddressesBandwidthResponseParams `json:"Response"` -} - -func (r *ReleaseIp6AddressesBandwidthResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReleaseIp6AddressesBandwidthResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RemoveBandwidthPackageResourcesRequestParams struct { - // 带宽包唯一标识ID,形如'bwp-xxxx' - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 资源类型,包括‘Address’, ‘LoadBalance’ - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源ID,可支持资源形如'eip-xxxx', 'lb-xxxx' - ResourceIds []*string `json:"ResourceIds,omitempty" name:"ResourceIds"` -} - -type RemoveBandwidthPackageResourcesRequest struct { - *tchttp.BaseRequest - - // 带宽包唯一标识ID,形如'bwp-xxxx' - BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` - - // 资源类型,包括‘Address’, ‘LoadBalance’ - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源ID,可支持资源形如'eip-xxxx', 'lb-xxxx' - ResourceIds []*string `json:"ResourceIds,omitempty" name:"ResourceIds"` -} - -func (r *RemoveBandwidthPackageResourcesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveBandwidthPackageResourcesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "BandwidthPackageId") - delete(f, "ResourceType") - delete(f, "ResourceIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RemoveBandwidthPackageResourcesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RemoveBandwidthPackageResourcesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RemoveBandwidthPackageResourcesResponse struct { - *tchttp.BaseResponse - Response *RemoveBandwidthPackageResourcesResponseParams `json:"Response"` -} - -func (r *RemoveBandwidthPackageResourcesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveBandwidthPackageResourcesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RemoveIp6RulesRequestParams struct { - // IPV6转换规则所属的转换实例唯一ID,形如ip6-xxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // 待删除IPV6转换规则,形如rule6-xxxxxxxx - Ip6RuleIds []*string `json:"Ip6RuleIds,omitempty" name:"Ip6RuleIds"` -} - -type RemoveIp6RulesRequest struct { - *tchttp.BaseRequest - - // IPV6转换规则所属的转换实例唯一ID,形如ip6-xxxxxxxx - Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` - - // 待删除IPV6转换规则,形如rule6-xxxxxxxx - Ip6RuleIds []*string `json:"Ip6RuleIds,omitempty" name:"Ip6RuleIds"` -} - -func (r *RemoveIp6RulesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveIp6RulesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Ip6TranslatorId") - delete(f, "Ip6RuleIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RemoveIp6RulesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RemoveIp6RulesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RemoveIp6RulesResponse struct { - *tchttp.BaseResponse - Response *RemoveIp6RulesResponseParams `json:"Response"` -} - -func (r *RemoveIp6RulesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RemoveIp6RulesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RenewAddressesRequestParams struct { - // EIP唯一标识ID列表,形如'eip-xxxx' - AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds"` - - // 续费参数 - AddressChargePrepaid *AddressChargePrepaid `json:"AddressChargePrepaid,omitempty" name:"AddressChargePrepaid"` -} - -type RenewAddressesRequest struct { - *tchttp.BaseRequest - - // EIP唯一标识ID列表,形如'eip-xxxx' - AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds"` - - // 续费参数 - AddressChargePrepaid *AddressChargePrepaid `json:"AddressChargePrepaid,omitempty" name:"AddressChargePrepaid"` -} - -func (r *RenewAddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RenewAddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressIds") - delete(f, "AddressChargePrepaid") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RenewAddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RenewAddressesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RenewAddressesResponse struct { - *tchttp.BaseResponse - Response *RenewAddressesResponseParams `json:"Response"` -} - -func (r *RenewAddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RenewAddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RenewVpnGatewayRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 预付费计费模式。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` -} - -type RenewVpnGatewayRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 预付费计费模式。 - InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` -} - -func (r *RenewVpnGatewayRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RenewVpnGatewayRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "InstanceChargePrepaid") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RenewVpnGatewayRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type RenewVpnGatewayResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type RenewVpnGatewayResponse struct { - *tchttp.BaseResponse - Response *RenewVpnGatewayResponseParams `json:"Response"` -} - -func (r *RenewVpnGatewayResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *RenewVpnGatewayResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceDirectConnectGatewayCcnRoutesRequestParams struct { - // 专线网关ID,形如:dcg-prpqlmg1 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 需要连通的IDC网段列表 - Routes []*DirectConnectGatewayCcnRoute `json:"Routes,omitempty" name:"Routes"` -} - -type ReplaceDirectConnectGatewayCcnRoutesRequest struct { - *tchttp.BaseRequest - - // 专线网关ID,形如:dcg-prpqlmg1 - DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` - - // 需要连通的IDC网段列表 - Routes []*DirectConnectGatewayCcnRoute `json:"Routes,omitempty" name:"Routes"` -} - -func (r *ReplaceDirectConnectGatewayCcnRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceDirectConnectGatewayCcnRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "DirectConnectGatewayId") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReplaceDirectConnectGatewayCcnRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceDirectConnectGatewayCcnRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ReplaceDirectConnectGatewayCcnRoutesResponse struct { - *tchttp.BaseResponse - Response *ReplaceDirectConnectGatewayCcnRoutesResponseParams `json:"Response"` -} - -func (r *ReplaceDirectConnectGatewayCcnRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceDirectConnectGatewayCcnRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceRouteTableAssociationRequestParams struct { - // 子网实例ID,例如:subnet-3x5lf5q0。可通过DescribeSubnets接口查询。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` -} - -type ReplaceRouteTableAssociationRequest struct { - *tchttp.BaseRequest - - // 子网实例ID,例如:subnet-3x5lf5q0。可通过DescribeSubnets接口查询。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` -} - -func (r *ReplaceRouteTableAssociationRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceRouteTableAssociationRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SubnetId") - delete(f, "RouteTableId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReplaceRouteTableAssociationRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceRouteTableAssociationResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ReplaceRouteTableAssociationResponse struct { - *tchttp.BaseResponse - Response *ReplaceRouteTableAssociationResponseParams `json:"Response"` -} - -func (r *ReplaceRouteTableAssociationResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceRouteTableAssociationResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceRoutesRequestParams struct { - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略对象。需要指定路由策略ID(RouteId)。 - Routes []*Route `json:"Routes,omitempty" name:"Routes"` -} - -type ReplaceRoutesRequest struct { - *tchttp.BaseRequest - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略对象。需要指定路由策略ID(RouteId)。 - Routes []*Route `json:"Routes,omitempty" name:"Routes"` -} - -func (r *ReplaceRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReplaceRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceRoutesResponseParams struct { - // 原路由策略信息。 - OldRouteSet []*Route `json:"OldRouteSet,omitempty" name:"OldRouteSet"` - - // 修改后的路由策略信息。 - NewRouteSet []*Route `json:"NewRouteSet,omitempty" name:"NewRouteSet"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ReplaceRoutesResponse struct { - *tchttp.BaseResponse - Response *ReplaceRoutesResponseParams `json:"Response"` -} - -func (r *ReplaceRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceSecurityGroupPoliciesRequestParams struct { - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合对象。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` - - // 旧的安全组规则集合对象,可选,日志记录用。 - OriginalSecurityGroupPolicySet *SecurityGroupPolicySet `json:"OriginalSecurityGroupPolicySet,omitempty" name:"OriginalSecurityGroupPolicySet"` -} - -type ReplaceSecurityGroupPoliciesRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合对象。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` - - // 旧的安全组规则集合对象,可选,日志记录用。 - OriginalSecurityGroupPolicySet *SecurityGroupPolicySet `json:"OriginalSecurityGroupPolicySet,omitempty" name:"OriginalSecurityGroupPolicySet"` -} - -func (r *ReplaceSecurityGroupPoliciesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceSecurityGroupPoliciesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - delete(f, "SecurityGroupPolicySet") - delete(f, "OriginalSecurityGroupPolicySet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReplaceSecurityGroupPoliciesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceSecurityGroupPoliciesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ReplaceSecurityGroupPoliciesResponse struct { - *tchttp.BaseResponse - Response *ReplaceSecurityGroupPoliciesResponseParams `json:"Response"` -} - -func (r *ReplaceSecurityGroupPoliciesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceSecurityGroupPoliciesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceSecurityGroupPolicyRequestParams struct { - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合对象。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` - - // 旧的安全组规则集合对象,可选,日志记录用。 - OriginalSecurityGroupPolicySet *SecurityGroupPolicySet `json:"OriginalSecurityGroupPolicySet,omitempty" name:"OriginalSecurityGroupPolicySet"` -} - -type ReplaceSecurityGroupPolicyRequest struct { - *tchttp.BaseRequest - - // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组规则集合对象。 - SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` - - // 旧的安全组规则集合对象,可选,日志记录用。 - OriginalSecurityGroupPolicySet *SecurityGroupPolicySet `json:"OriginalSecurityGroupPolicySet,omitempty" name:"OriginalSecurityGroupPolicySet"` -} - -func (r *ReplaceSecurityGroupPolicyRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceSecurityGroupPolicyRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SecurityGroupId") - delete(f, "SecurityGroupPolicySet") - delete(f, "OriginalSecurityGroupPolicySet") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReplaceSecurityGroupPolicyRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReplaceSecurityGroupPolicyResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ReplaceSecurityGroupPolicyResponse struct { - *tchttp.BaseResponse - Response *ReplaceSecurityGroupPolicyResponseParams `json:"Response"` -} - -func (r *ReplaceSecurityGroupPolicyResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReplaceSecurityGroupPolicyResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetAttachCcnInstancesRequestParams struct { - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN所属UIN(根账号)。 - CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` - - // 重新申请关联网络实例列表。 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -type ResetAttachCcnInstancesRequest struct { - *tchttp.BaseRequest - - // CCN实例ID。形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // CCN所属UIN(根账号)。 - CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` - - // 重新申请关联网络实例列表。 - Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances"` -} - -func (r *ResetAttachCcnInstancesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetAttachCcnInstancesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "CcnUin") - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetAttachCcnInstancesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetAttachCcnInstancesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetAttachCcnInstancesResponse struct { - *tchttp.BaseResponse - Response *ResetAttachCcnInstancesResponseParams `json:"Response"` -} - -func (r *ResetAttachCcnInstancesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetAttachCcnInstancesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetNatGatewayConnectionRequestParams struct { - // NAT网关ID。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关并发连接上限,形如:1000000、3000000、10000000。 - MaxConcurrentConnection *uint64 `json:"MaxConcurrentConnection,omitempty" name:"MaxConcurrentConnection"` -} - -type ResetNatGatewayConnectionRequest struct { - *tchttp.BaseRequest - - // NAT网关ID。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // NAT网关并发连接上限,形如:1000000、3000000、10000000。 - MaxConcurrentConnection *uint64 `json:"MaxConcurrentConnection,omitempty" name:"MaxConcurrentConnection"` -} - -func (r *ResetNatGatewayConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetNatGatewayConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NatGatewayId") - delete(f, "MaxConcurrentConnection") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetNatGatewayConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetNatGatewayConnectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetNatGatewayConnectionResponse struct { - *tchttp.BaseResponse - Response *ResetNatGatewayConnectionResponseParams `json:"Response"` -} - -func (r *ResetNatGatewayConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetNatGatewayConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetRoutesRequestParams struct { - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由表名称,最大长度不能超过60个字节。 - RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` - - // 路由策略。 - Routes []*Route `json:"Routes,omitempty" name:"Routes"` -} - -type ResetRoutesRequest struct { - *tchttp.BaseRequest - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由表名称,最大长度不能超过60个字节。 - RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` - - // 路由策略。 - Routes []*Route `json:"Routes,omitempty" name:"Routes"` -} - -func (r *ResetRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "RouteTableName") - delete(f, "Routes") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetRoutesResponse struct { - *tchttp.BaseResponse - Response *ResetRoutesResponseParams `json:"Response"` -} - -func (r *ResetRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetVpnConnectionRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN通道实例ID。形如:vpnx-f49l6u0z。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` -} - -type ResetVpnConnectionRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPN通道实例ID。形如:vpnx-f49l6u0z。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` -} - -func (r *ResetVpnConnectionRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetVpnConnectionRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "VpnConnectionId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetVpnConnectionRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetVpnConnectionResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetVpnConnectionResponse struct { - *tchttp.BaseResponse - Response *ResetVpnConnectionResponseParams `json:"Response"` -} - -func (r *ResetVpnConnectionResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetVpnConnectionResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetVpnGatewayInternetMaxBandwidthRequestParams struct { - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 新规格公网带宽设置。可选带宽规格:5, 10, 20, 50, 100, 200, 500, 1000;单位:Mbps。VPN网关带宽目前仅支持部分带宽范围内升降配,如【5,100】Mbps和【200,1000】Mbps,在各自带宽范围内可提升配额,跨范围提升配额和降配暂不支持。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` -} - -type ResetVpnGatewayInternetMaxBandwidthRequest struct { - *tchttp.BaseRequest - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 新规格公网带宽设置。可选带宽规格:5, 10, 20, 50, 100, 200, 500, 1000;单位:Mbps。VPN网关带宽目前仅支持部分带宽范围内升降配,如【5,100】Mbps和【200,1000】Mbps,在各自带宽范围内可提升配额,跨范围提升配额和降配暂不支持。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` -} - -func (r *ResetVpnGatewayInternetMaxBandwidthRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetVpnGatewayInternetMaxBandwidthRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayId") - delete(f, "InternetMaxBandwidthOut") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetVpnGatewayInternetMaxBandwidthRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResetVpnGatewayInternetMaxBandwidthResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResetVpnGatewayInternetMaxBandwidthResponse struct { - *tchttp.BaseResponse - Response *ResetVpnGatewayInternetMaxBandwidthResponseParams `json:"Response"` -} - -func (r *ResetVpnGatewayInternetMaxBandwidthResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResetVpnGatewayInternetMaxBandwidthResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type Resource struct { - // 带宽包资源类型,包括'Address'和'LoadBalance' - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 带宽包资源Id,形如'eip-xxxx', 'lb-xxxx' - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 带宽包资源Ip - AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` -} - -type ResourceDashboard struct { - // Vpc实例ID,例如:vpc-bq4bzxpj。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID,例如:subnet-bthucmmy。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 基础网络互通。 - Classiclink *uint64 `json:"Classiclink,omitempty" name:"Classiclink"` - - // 专线网关。 - Dcg *uint64 `json:"Dcg,omitempty" name:"Dcg"` - - // 对等连接。 - Pcx *uint64 `json:"Pcx,omitempty" name:"Pcx"` - - // 统计当前除云服务器 IP、弹性网卡IP和网络探测IP以外的所有已使用的IP总数。云服务器 IP、弹性网卡IP和网络探测IP单独计数。 - Ip *uint64 `json:"Ip,omitempty" name:"Ip"` - - // NAT网关。 - Nat *uint64 `json:"Nat,omitempty" name:"Nat"` - - // VPN网关。 - Vpngw *uint64 `json:"Vpngw,omitempty" name:"Vpngw"` - - // 流日志。 - FlowLog *uint64 `json:"FlowLog,omitempty" name:"FlowLog"` - - // 网络探测。 - NetworkDetect *uint64 `json:"NetworkDetect,omitempty" name:"NetworkDetect"` - - // 网络ACL。 - NetworkACL *uint64 `json:"NetworkACL,omitempty" name:"NetworkACL"` - - // 云主机。 - CVM *uint64 `json:"CVM,omitempty" name:"CVM"` - - // 负载均衡。 - LB *uint64 `json:"LB,omitempty" name:"LB"` - - // 关系型数据库。 - CDB *uint64 `json:"CDB,omitempty" name:"CDB"` - - // 云数据库 TencentDB for Memcached。 - Cmem *uint64 `json:"Cmem,omitempty" name:"Cmem"` - - // 时序数据库。 - CTSDB *uint64 `json:"CTSDB,omitempty" name:"CTSDB"` - - // 数据库 TencentDB for MariaDB(TDSQL)。 - MariaDB *uint64 `json:"MariaDB,omitempty" name:"MariaDB"` - - // 数据库 TencentDB for SQL Server。 - SQLServer *uint64 `json:"SQLServer,omitempty" name:"SQLServer"` - - // 云数据库 TencentDB for PostgreSQL。 - Postgres *uint64 `json:"Postgres,omitempty" name:"Postgres"` - - // 网络附加存储。 - NAS *uint64 `json:"NAS,omitempty" name:"NAS"` - - // Snova云数据仓库。 - Greenplumn *uint64 `json:"Greenplumn,omitempty" name:"Greenplumn"` - - // 消息队列 CKAFKA。 - Ckafka *uint64 `json:"Ckafka,omitempty" name:"Ckafka"` - - // Grocery。 - Grocery *uint64 `json:"Grocery,omitempty" name:"Grocery"` - - // 数据加密服务。 - HSM *uint64 `json:"HSM,omitempty" name:"HSM"` - - // 游戏存储 Tcaplus。 - Tcaplus *uint64 `json:"Tcaplus,omitempty" name:"Tcaplus"` - - // Cnas。 - Cnas *uint64 `json:"Cnas,omitempty" name:"Cnas"` - - // HTAP 数据库 TiDB。 - TiDB *uint64 `json:"TiDB,omitempty" name:"TiDB"` - - // EMR 集群。 - Emr *uint64 `json:"Emr,omitempty" name:"Emr"` - - // SEAL。 - SEAL *uint64 `json:"SEAL,omitempty" name:"SEAL"` - - // 文件存储 CFS。 - CFS *uint64 `json:"CFS,omitempty" name:"CFS"` - - // Oracle。 - Oracle *uint64 `json:"Oracle,omitempty" name:"Oracle"` - - // ElasticSearch服务。 - ElasticSearch *uint64 `json:"ElasticSearch,omitempty" name:"ElasticSearch"` - - // 区块链服务。 - TBaaS *uint64 `json:"TBaaS,omitempty" name:"TBaaS"` - - // Itop。 - Itop *uint64 `json:"Itop,omitempty" name:"Itop"` - - // 云数据库审计。 - DBAudit *uint64 `json:"DBAudit,omitempty" name:"DBAudit"` - - // 企业级云数据库 CynosDB for Postgres。 - CynosDBPostgres *uint64 `json:"CynosDBPostgres,omitempty" name:"CynosDBPostgres"` - - // 数据库 TencentDB for Redis。 - Redis *uint64 `json:"Redis,omitempty" name:"Redis"` - - // 数据库 TencentDB for MongoDB。 - MongoDB *uint64 `json:"MongoDB,omitempty" name:"MongoDB"` - - // 分布式数据库 TencentDB for TDSQL。 - DCDB *uint64 `json:"DCDB,omitempty" name:"DCDB"` - - // 企业级云数据库 CynosDB for MySQL。 - CynosDBMySQL *uint64 `json:"CynosDBMySQL,omitempty" name:"CynosDBMySQL"` - - // 子网。 - Subnet *uint64 `json:"Subnet,omitempty" name:"Subnet"` - - // 路由表。 - RouteTable *uint64 `json:"RouteTable,omitempty" name:"RouteTable"` -} - -type ResourceStatistics struct { - // Vpc实例ID,例如:vpc-f1xjkw1b。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例ID,例如:subnet-bthucmmy。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 当前已使用的IP总数。 - Ip *uint64 `json:"Ip,omitempty" name:"Ip"` - - // 资源统计信息。 - ResourceStatisticsItemSet []*ResourceStatisticsItem `json:"ResourceStatisticsItemSet,omitempty" name:"ResourceStatisticsItemSet"` -} - -type ResourceStatisticsItem struct { - // 资源类型。比如,CVM,ENI等。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源名称。 - ResourceName *string `json:"ResourceName,omitempty" name:"ResourceName"` - - // 资源个数。 - ResourceCount *uint64 `json:"ResourceCount,omitempty" name:"ResourceCount"` -} - -// Predefined struct for user -type ResumeSnapshotInstanceRequestParams struct { - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 快照文件Id。 - SnapshotFileId *string `json:"SnapshotFileId,omitempty" name:"SnapshotFileId"` - - // 实例Id。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -type ResumeSnapshotInstanceRequest struct { - *tchttp.BaseRequest - - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 快照文件Id。 - SnapshotFileId *string `json:"SnapshotFileId,omitempty" name:"SnapshotFileId"` - - // 实例Id。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -func (r *ResumeSnapshotInstanceRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResumeSnapshotInstanceRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "SnapshotPolicyId") - delete(f, "SnapshotFileId") - delete(f, "InstanceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResumeSnapshotInstanceRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ResumeSnapshotInstanceResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ResumeSnapshotInstanceResponse struct { - *tchttp.BaseResponse - Response *ResumeSnapshotInstanceResponseParams `json:"Response"` -} - -func (r *ResumeSnapshotInstanceResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ResumeSnapshotInstanceResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReturnNormalAddressesRequestParams struct { - // EIP 的 IP 地址,示例:101.35.139.183 - AddressIps []*string `json:"AddressIps,omitempty" name:"AddressIps"` -} - -type ReturnNormalAddressesRequest struct { - *tchttp.BaseRequest - - // EIP 的 IP 地址,示例:101.35.139.183 - AddressIps []*string `json:"AddressIps,omitempty" name:"AddressIps"` -} - -func (r *ReturnNormalAddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReturnNormalAddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "AddressIps") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReturnNormalAddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type ReturnNormalAddressesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type ReturnNormalAddressesResponse struct { - *tchttp.BaseResponse - Response *ReturnNormalAddressesResponseParams `json:"Response"` -} - -func (r *ReturnNormalAddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *ReturnNormalAddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type Route struct { - // 目的网段,取值不能在私有网络网段内,例如:112.20.51.0/24。 - DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` - - // 下一跳类型,目前我们支持的类型有: - // CVM:公网网关类型的云服务器; - // VPN:VPN网关; - // DIRECTCONNECT:专线网关; - // PEERCONNECTION:对等连接; - // HAVIP:高可用虚拟IP; - // NAT:NAT网关; - // NORMAL_CVM:普通云服务器; - // EIP:云服务器的公网IP; - // LOCAL_GATEWAY:本地网关。 - GatewayType *string `json:"GatewayType,omitempty" name:"GatewayType"` - - // 下一跳地址,这里只需要指定不同下一跳类型的网关ID,系统会自动匹配到下一跳地址。 - // 特殊说明:GatewayType为NORMAL_CVM时,GatewayId填写实例的内网IP。 - GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` - - // 路由策略ID。IPv4路由策略ID是有意义的值,IPv6路由策略是无意义的值0。后续建议完全使用字符串唯一ID `RouteItemId`操作路由策略。 - // 该字段在删除时必填,其他字段无需填写。 - RouteId *uint64 `json:"RouteId,omitempty" name:"RouteId"` - - // 路由策略描述。 - RouteDescription *string `json:"RouteDescription,omitempty" name:"RouteDescription"` - - // 是否启用 - Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` - - // 路由类型,目前我们支持的类型有: - // USER:用户路由; - // NETD:网络探测路由,创建网络探测实例时,系统默认下发,不可编辑与删除; - // CCN:云联网路由,系统默认下发,不可编辑与删除。 - // 用户只能添加和操作 USER 类型的路由。 - RouteType *string `json:"RouteType,omitempty" name:"RouteType"` - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 目的IPv6网段,取值不能在私有网络网段内,例如:2402:4e00:1000:810b::/64。 - DestinationIpv6CidrBlock *string `json:"DestinationIpv6CidrBlock,omitempty" name:"DestinationIpv6CidrBlock"` - - // 路由唯一策略ID。 - RouteItemId *string `json:"RouteItemId,omitempty" name:"RouteItemId"` - - // 路由策略是否发布到云联网。 - // 注意:此字段可能返回 null,表示取不到有效值。 - PublishedToVbc *bool `json:"PublishedToVbc,omitempty" name:"PublishedToVbc"` - - // 路由策略创建时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type RouteConflict struct { - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 要检查的与之冲突的目的端 - DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` - - // 冲突的路由策略列表 - ConflictSet []*Route `json:"ConflictSet,omitempty" name:"ConflictSet"` -} - -type RouteTable struct { - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 路由表实例ID,例如:rtb-azd4dt1c。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由表名称。 - RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` - - // 路由表关联关系。 - AssociationSet []*RouteTableAssociation `json:"AssociationSet,omitempty" name:"AssociationSet"` - - // IPv4路由策略集合。 - RouteSet []*Route `json:"RouteSet,omitempty" name:"RouteSet"` - - // 是否默认路由表。 - Main *bool `json:"Main,omitempty" name:"Main"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 标签键值对。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // local路由是否发布云联网。 - // 注意:此字段可能返回 null,表示取不到有效值。 - LocalCidrForCcn []*CidrForCcn `json:"LocalCidrForCcn,omitempty" name:"LocalCidrForCcn"` -} - -type RouteTableAssociation struct { - // 子网实例ID。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 路由表实例ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` -} - -type SecurityGroup struct { - // 安全组实例ID,例如:sg-ohuuioma。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 安全组名称,可任意命名,但不得超过60个字符。 - SecurityGroupName *string `json:"SecurityGroupName,omitempty" name:"SecurityGroupName"` - - // 安全组备注,最多100个字符。 - SecurityGroupDesc *string `json:"SecurityGroupDesc,omitempty" name:"SecurityGroupDesc"` - - // 项目id,默认0。可在qcloud控制台项目管理页面查询到。 - ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` - - // 是否是默认安全组,默认安全组不支持删除。 - IsDefault *bool `json:"IsDefault,omitempty" name:"IsDefault"` - - // 安全组创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 标签键值对。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // 安全组更新时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` -} - -type SecurityGroupAssociationStatistics struct { - // 安全组实例ID。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // 云服务器实例数。 - CVM *uint64 `json:"CVM,omitempty" name:"CVM"` - - // MySQL数据库实例数。 - CDB *uint64 `json:"CDB,omitempty" name:"CDB"` - - // 弹性网卡实例数。 - ENI *uint64 `json:"ENI,omitempty" name:"ENI"` - - // 被安全组引用数。 - SG *uint64 `json:"SG,omitempty" name:"SG"` - - // 负载均衡实例数。 - CLB *uint64 `json:"CLB,omitempty" name:"CLB"` - - // 全量实例的绑定统计。 - InstanceStatistics []*InstanceStatistic `json:"InstanceStatistics,omitempty" name:"InstanceStatistics"` - - // 所有资源的总计数(不包含被安全组引用数)。 - TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` -} - -type SecurityGroupLimitSet struct { - // 每个项目每个地域可创建安全组数 - SecurityGroupLimit *uint64 `json:"SecurityGroupLimit,omitempty" name:"SecurityGroupLimit"` - - // 安全组下的最大规则数 - SecurityGroupPolicyLimit *uint64 `json:"SecurityGroupPolicyLimit,omitempty" name:"SecurityGroupPolicyLimit"` - - // 安全组下嵌套安全组规则数 - ReferedSecurityGroupLimit *uint64 `json:"ReferedSecurityGroupLimit,omitempty" name:"ReferedSecurityGroupLimit"` - - // 单安全组关联实例数 - SecurityGroupInstanceLimit *uint64 `json:"SecurityGroupInstanceLimit,omitempty" name:"SecurityGroupInstanceLimit"` - - // 实例关联安全组数 - InstanceSecurityGroupLimit *uint64 `json:"InstanceSecurityGroupLimit,omitempty" name:"InstanceSecurityGroupLimit"` - - // 安全组展开后的规则数限制 - SecurityGroupExtendedPolicyLimit *uint64 `json:"SecurityGroupExtendedPolicyLimit,omitempty" name:"SecurityGroupExtendedPolicyLimit"` - - // 被引用的安全组关联CVM、ENI的实例配额 - SecurityGroupReferedCvmAndEniLimit *uint64 `json:"SecurityGroupReferedCvmAndEniLimit,omitempty" name:"SecurityGroupReferedCvmAndEniLimit"` - - // 被引用的安全组关联数据库、LB等服务实例配额 - SecurityGroupReferedSvcLimit *uint64 `json:"SecurityGroupReferedSvcLimit,omitempty" name:"SecurityGroupReferedSvcLimit"` -} - -type SecurityGroupPolicy struct { - // 安全组规则索引号,值会随着安全组规则的变更动态变化。使用PolicyIndex时,请先调用`DescribeSecurityGroupPolicies`获取到规则的PolicyIndex,并且结合返回值中的Version一起使用处理规则。 - PolicyIndex *int64 `json:"PolicyIndex,omitempty" name:"PolicyIndex"` - - // 协议, 取值: TCP,UDP,ICMP,ICMPv6,ALL。 - Protocol *string `json:"Protocol,omitempty" name:"Protocol"` - - // 端口(all, 离散port, range)。 - // 说明:如果Protocol设置为ALL,则Port也需要设置为all。 - Port *string `json:"Port,omitempty" name:"Port"` - - // 协议端口ID或者协议端口组ID。ServiceTemplate和Protocol+Port互斥。 - ServiceTemplate *ServiceTemplateSpecification `json:"ServiceTemplate,omitempty" name:"ServiceTemplate"` - - // 网段或IP(互斥),特殊说明:0.0.0.0/n 都会映射为0.0.0.0/0。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 网段或IPv6(互斥)。 - Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` - - // 安全组实例ID,例如:sg-ohuuioma。 - SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` - - // IP地址ID或者IP地址组ID。 - AddressTemplate *AddressTemplateSpecification `json:"AddressTemplate,omitempty" name:"AddressTemplate"` - - // ACCEPT 或 DROP。 - Action *string `json:"Action,omitempty" name:"Action"` - - // 安全组规则描述。 - PolicyDescription *string `json:"PolicyDescription,omitempty" name:"PolicyDescription"` - - // 安全组最近修改时间。 - ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` -} - -type SecurityGroupPolicySet struct { - // 安全组规则当前版本。用户每次更新安全规则版本会自动加1,防止更新的路由规则已过期,不填不考虑冲突。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Version *string `json:"Version,omitempty" name:"Version"` - - // 出站规则。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Egress []*SecurityGroupPolicy `json:"Egress,omitempty" name:"Egress"` - - // 入站规则。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Ingress []*SecurityGroupPolicy `json:"Ingress,omitempty" name:"Ingress"` -} - -type SecurityPolicyDatabase struct { - // 本端网段 - LocalCidrBlock *string `json:"LocalCidrBlock,omitempty" name:"LocalCidrBlock"` - - // 对端网段 - RemoteCidrBlock []*string `json:"RemoteCidrBlock,omitempty" name:"RemoteCidrBlock"` -} - -type ServiceTemplate struct { - // 协议端口实例ID,例如:ppm-f5n1f8da。 - ServiceTemplateId *string `json:"ServiceTemplateId,omitempty" name:"ServiceTemplateId"` - - // 模板名称。 - ServiceTemplateName *string `json:"ServiceTemplateName,omitempty" name:"ServiceTemplateName"` - - // 协议端口信息。 - ServiceSet []*string `json:"ServiceSet,omitempty" name:"ServiceSet"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 带备注的协议端口信息。 - ServiceExtraSet []*ServicesInfo `json:"ServiceExtraSet,omitempty" name:"ServiceExtraSet"` -} - -type ServiceTemplateGroup struct { - // 协议端口模板集合实例ID,例如:ppmg-2klmrefu。 - ServiceTemplateGroupId *string `json:"ServiceTemplateGroupId,omitempty" name:"ServiceTemplateGroupId"` - - // 协议端口模板集合名称。 - ServiceTemplateGroupName *string `json:"ServiceTemplateGroupName,omitempty" name:"ServiceTemplateGroupName"` - - // 协议端口模板实例ID。 - ServiceTemplateIdSet []*string `json:"ServiceTemplateIdSet,omitempty" name:"ServiceTemplateIdSet"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 协议端口模板实例信息。 - ServiceTemplateSet []*ServiceTemplate `json:"ServiceTemplateSet,omitempty" name:"ServiceTemplateSet"` -} - -type ServiceTemplateSpecification struct { - // 协议端口ID,例如:ppm-f5n1f8da。 - ServiceId *string `json:"ServiceId,omitempty" name:"ServiceId"` - - // 协议端口组ID,例如:ppmg-f5n1f8da。 - ServiceGroupId *string `json:"ServiceGroupId,omitempty" name:"ServiceGroupId"` -} - -type ServicesInfo struct { - // 协议端口。 - Service *string `json:"Service,omitempty" name:"Service"` - - // 备注。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Description *string `json:"Description,omitempty" name:"Description"` -} - -// Predefined struct for user -type SetCcnRegionBandwidthLimitsRequestParams struct { - // CCN实例ID,形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 云联网(CCN)各地域出带宽上限。 - CcnRegionBandwidthLimits []*CcnRegionBandwidthLimit `json:"CcnRegionBandwidthLimits,omitempty" name:"CcnRegionBandwidthLimits"` - - // 是否恢复云联网地域出口/地域间带宽限速为默认值(1Gbps)。false表示不恢复;true表示恢复。恢复默认值后,限速实例将不在控制台展示。该参数默认为 false,不恢复。 - SetDefaultLimitFlag *bool `json:"SetDefaultLimitFlag,omitempty" name:"SetDefaultLimitFlag"` -} - -type SetCcnRegionBandwidthLimitsRequest struct { - *tchttp.BaseRequest - - // CCN实例ID,形如:ccn-f49l6u0z。 - CcnId *string `json:"CcnId,omitempty" name:"CcnId"` - - // 云联网(CCN)各地域出带宽上限。 - CcnRegionBandwidthLimits []*CcnRegionBandwidthLimit `json:"CcnRegionBandwidthLimits,omitempty" name:"CcnRegionBandwidthLimits"` - - // 是否恢复云联网地域出口/地域间带宽限速为默认值(1Gbps)。false表示不恢复;true表示恢复。恢复默认值后,限速实例将不在控制台展示。该参数默认为 false,不恢复。 - SetDefaultLimitFlag *bool `json:"SetDefaultLimitFlag,omitempty" name:"SetDefaultLimitFlag"` -} - -func (r *SetCcnRegionBandwidthLimitsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *SetCcnRegionBandwidthLimitsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "CcnId") - delete(f, "CcnRegionBandwidthLimits") - delete(f, "SetDefaultLimitFlag") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SetCcnRegionBandwidthLimitsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type SetCcnRegionBandwidthLimitsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type SetCcnRegionBandwidthLimitsResponse struct { - *tchttp.BaseResponse - Response *SetCcnRegionBandwidthLimitsResponseParams `json:"Response"` -} - -func (r *SetCcnRegionBandwidthLimitsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *SetCcnRegionBandwidthLimitsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type SetVpnGatewaysRenewFlagRequestParams struct { - // VPNGW字符型ID列表。可通过[DescribeVpnGateways](https://cloud.tencent.com/document/api/215/17514)接口返回值VpnGatewaySet中的VpnGatewayId获取。 - VpnGatewayIds []*string `json:"VpnGatewayIds,omitempty" name:"VpnGatewayIds"` - - // 自动续费标记 [0, 1, 2] - // 0表示默认状态(初始状态), 1表示自动续费,2表示明确不自动续费。 - AutoRenewFlag *int64 `json:"AutoRenewFlag,omitempty" name:"AutoRenewFlag"` - - // VPNGW类型['IPSEC', 'SSL'], 默认为IPSEC。 - Type *string `json:"Type,omitempty" name:"Type"` -} - -type SetVpnGatewaysRenewFlagRequest struct { - *tchttp.BaseRequest - - // VPNGW字符型ID列表。可通过[DescribeVpnGateways](https://cloud.tencent.com/document/api/215/17514)接口返回值VpnGatewaySet中的VpnGatewayId获取。 - VpnGatewayIds []*string `json:"VpnGatewayIds,omitempty" name:"VpnGatewayIds"` - - // 自动续费标记 [0, 1, 2] - // 0表示默认状态(初始状态), 1表示自动续费,2表示明确不自动续费。 - AutoRenewFlag *int64 `json:"AutoRenewFlag,omitempty" name:"AutoRenewFlag"` - - // VPNGW类型['IPSEC', 'SSL'], 默认为IPSEC。 - Type *string `json:"Type,omitempty" name:"Type"` -} - -func (r *SetVpnGatewaysRenewFlagRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *SetVpnGatewaysRenewFlagRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpnGatewayIds") - delete(f, "AutoRenewFlag") - delete(f, "Type") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SetVpnGatewaysRenewFlagRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type SetVpnGatewaysRenewFlagResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type SetVpnGatewaysRenewFlagResponse struct { - *tchttp.BaseResponse - Response *SetVpnGatewaysRenewFlagResponseParams `json:"Response"` -} - -func (r *SetVpnGatewaysRenewFlagResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *SetVpnGatewaysRenewFlagResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type SnapshotFileInfo struct { - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 实例Id。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 快照文件Id。 - SnapshotFileId *string `json:"SnapshotFileId,omitempty" name:"SnapshotFileId"` - - // 备份时间。 - BackupTime *string `json:"BackupTime,omitempty" name:"BackupTime"` - - // 操作者Uin。 - Operator *string `json:"Operator,omitempty" name:"Operator"` -} - -type SnapshotInstance struct { - // 实例Id。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 实例类型,目前支持安全组:securitygroup。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 实例所在地域。 - InstanceRegion *string `json:"InstanceRegion,omitempty" name:"InstanceRegion"` - - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 实例名称。 - InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` -} - -type SnapshotPolicy struct { - // 快照策略名称。 - SnapshotPolicyName *string `json:"SnapshotPolicyName,omitempty" name:"SnapshotPolicyName"` - - // 备份策略类型,operate-操作备份,time-定时备份。 - BackupType *string `json:"BackupType,omitempty" name:"BackupType"` - - // 保留时间,支持1~365天。 - KeepTime *uint64 `json:"KeepTime,omitempty" name:"KeepTime"` - - // 是否创建新的cos桶,默认为False。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreateNewCos *bool `json:"CreateNewCos,omitempty" name:"CreateNewCos"` - - // cos桶所在地域。 - CosRegion *string `json:"CosRegion,omitempty" name:"CosRegion"` - - // cos桶。 - CosBucket *string `json:"CosBucket,omitempty" name:"CosBucket"` - - // 快照策略Id。 - SnapshotPolicyId *string `json:"SnapshotPolicyId,omitempty" name:"SnapshotPolicyId"` - - // 时间备份策略。 - // 注意:此字段可能返回 null,表示取不到有效值。 - BackupPolicies []*BackupPolicy `json:"BackupPolicies,omitempty" name:"BackupPolicies"` - - // 启用状态,True-启用,False-停用,默认为True。 - Enable *bool `json:"Enable,omitempty" name:"Enable"` - - // 创建时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` -} - -type SourceIpTranslationNatRule struct { - // 资源ID,如果ResourceType为USERDEFINED,可以为空 - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 资源类型,目前包含SUBNET、NETWORKINTERFACE、USERDEFINED - // 注意:此字段可能返回 null,表示取不到有效值。 - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 源IP/网段 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 弹性IP地址池 - PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses"` - - // 描述 - Description *string `json:"Description,omitempty" name:"Description"` - - // Snat规则ID - NatGatewaySnatId *string `json:"NatGatewaySnatId,omitempty" name:"NatGatewaySnatId"` - - // NAT网关的ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` - - // 私有网络VPC的ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // NAT网关SNAT规则创建时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type SslClientConfig struct { - // 客户端配置 - SslVpnClientConfiguration *string `json:"SslVpnClientConfiguration,omitempty" name:"SslVpnClientConfiguration"` - - // 更证书 - SslVpnRootCert *string `json:"SslVpnRootCert,omitempty" name:"SslVpnRootCert"` - - // 客户端密钥 - SslVpnKey *string `json:"SslVpnKey,omitempty" name:"SslVpnKey"` - - // 客户端证书 - SslVpnCert *string `json:"SslVpnCert,omitempty" name:"SslVpnCert"` - - // SSL-VPN-CLIENT 实例ID。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` -} - -type SslVpnClient struct { - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // SSL-VPN-SERVER 实例ID。 - SslVpnServerId *string `json:"SslVpnServerId,omitempty" name:"SslVpnServerId"` - - // 证书状态。 - // 0:创建中 - // 1:正常 - // 2:已停用 - // 3.已过期 - // 4.创建出错 - CertStatus *uint64 `json:"CertStatus,omitempty" name:"CertStatus"` - - // SSL-VPN-CLIENT 实例ID。 - SslVpnClientId *string `json:"SslVpnClientId,omitempty" name:"SslVpnClientId"` - - // 证书开始时间。 - CertBeginTime *string `json:"CertBeginTime,omitempty" name:"CertBeginTime"` - - // 证书到期时间。 - CertEndTime *string `json:"CertEndTime,omitempty" name:"CertEndTime"` - - // CLIENT NAME。 - Name *string `json:"Name,omitempty" name:"Name"` - - // 创建CLIENT 状态。 - // 0 创建中 - // 1 创建出错 - // 2 更新中 - // 3 更新出错 - // 4 销毁中 - // 5 销毁出粗 - // 6 已连通 - // 7 未知 - State *string `json:"State,omitempty" name:"State"` -} - -type SslVpnSever struct { - // VPC实例ID. - // 注意:此字段可能返回 null,表示取不到有效值。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // SSL-VPN-SERVER 实例ID。 - SslVpnServerId *string `json:"SslVpnServerId,omitempty" name:"SslVpnServerId"` - - // VPN 实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // SSL-VPN-SERVER name。 - SslVpnServerName *string `json:"SslVpnServerName,omitempty" name:"SslVpnServerName"` - - // 本端地址段。 - LocalAddress []*string `json:"LocalAddress,omitempty" name:"LocalAddress"` - - // 客户端地址段。 - RemoteAddress *string `json:"RemoteAddress,omitempty" name:"RemoteAddress"` - - // 客户端最大连接数。 - MaxConnection *uint64 `json:"MaxConnection,omitempty" name:"MaxConnection"` - - // SSL-VPN 网关公网IP。 - WanIp *string `json:"WanIp,omitempty" name:"WanIp"` - - // SSL VPN服务端监听协议 - SslVpnProtocol *string `json:"SslVpnProtocol,omitempty" name:"SslVpnProtocol"` - - // SSL VPN服务端监听协议端口 - SslVpnPort *uint64 `json:"SslVpnPort,omitempty" name:"SslVpnPort"` - - // 加密算法。 - EncryptAlgorithm *string `json:"EncryptAlgorithm,omitempty" name:"EncryptAlgorithm"` - - // 认证算法。 - IntegrityAlgorithm *string `json:"IntegrityAlgorithm,omitempty" name:"IntegrityAlgorithm"` - - // 是否支持压缩。 - Compress *uint64 `json:"Compress,omitempty" name:"Compress"` - - // 创建时间。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // SSL-VPN-SERVER 创建状态。 - // 0 创建中 - // 1 创建出错 - // 2 更新中 - // 3 更新出错 - // 4 销毁中 - // 5 销毁出粗 - // 6 已连通 - // 7 未知 - State *uint64 `json:"State,omitempty" name:"State"` - - // 是否开启SSO认证。1:开启 0: 不开启 - SsoEnabled *uint64 `json:"SsoEnabled,omitempty" name:"SsoEnabled"` - - // EIAM应用ID - EiamApplicationId *string `json:"EiamApplicationId,omitempty" name:"EiamApplicationId"` - - // 是否开启策略控制。0:不开启 1: 开启 - AccessPolicyEnabled *uint64 `json:"AccessPolicyEnabled,omitempty" name:"AccessPolicyEnabled"` - - // 策略信息 - AccessPolicy []*AccessPolicy `json:"AccessPolicy,omitempty" name:"AccessPolicy"` -} - -type Subnet struct { - // `VPC`实例`ID`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 子网实例`ID`,例如:subnet-bthucmmy。 - SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` - - // 子网名称。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 子网的 `IPv4` `CIDR`。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 是否默认子网。 - IsDefault *bool `json:"IsDefault,omitempty" name:"IsDefault"` - - // 是否开启广播。 - EnableBroadcast *bool `json:"EnableBroadcast,omitempty" name:"EnableBroadcast"` - - // 可用区。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 路由表实例ID,例如:rtb-l2h8d7c2。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 可用`IPv4`数。 - AvailableIpAddressCount *uint64 `json:"AvailableIpAddressCount,omitempty" name:"AvailableIpAddressCount"` - - // 子网的 `IPv6` `CIDR`。 - Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` - - // 关联`ACL`ID - NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` - - // 是否为 `SNAT` 地址池子网。 - IsRemoteVpcSnat *bool `json:"IsRemoteVpcSnat,omitempty" name:"IsRemoteVpcSnat"` - - // 子网`IPv4`总数。 - TotalIpAddressCount *uint64 `json:"TotalIpAddressCount,omitempty" name:"TotalIpAddressCount"` - - // 标签键值对。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // CDC实例ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // 是否是CDC所属子网。0:否 1:是 - // 注意:此字段可能返回 null,表示取不到有效值。 - IsCdcSubnet *int64 `json:"IsCdcSubnet,omitempty" name:"IsCdcSubnet"` -} - -type SubnetInput struct { - // 子网的`CIDR`。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 子网名称。 - SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` - - // 可用区。形如:`ap-guangzhou-2`。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 指定关联路由表,形如:`rtb-3ryrwzuu`。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` -} - -type Tag struct { - // 标签键 - // 注意:此字段可能返回 null,表示取不到有效值。 - Key *string `json:"Key,omitempty" name:"Key"` - - // 标签值 - // 注意:此字段可能返回 null,表示取不到有效值。 - Value *string `json:"Value,omitempty" name:"Value"` -} - -type TemplateLimit struct { - // 参数模板IP地址成员配额。 - AddressTemplateMemberLimit *uint64 `json:"AddressTemplateMemberLimit,omitempty" name:"AddressTemplateMemberLimit"` - - // 参数模板IP地址组成员配额。 - AddressTemplateGroupMemberLimit *uint64 `json:"AddressTemplateGroupMemberLimit,omitempty" name:"AddressTemplateGroupMemberLimit"` - - // 参数模板I协议端口成员配额。 - ServiceTemplateMemberLimit *uint64 `json:"ServiceTemplateMemberLimit,omitempty" name:"ServiceTemplateMemberLimit"` - - // 参数模板协议端口组成员配额。 - ServiceTemplateGroupMemberLimit *uint64 `json:"ServiceTemplateGroupMemberLimit,omitempty" name:"ServiceTemplateGroupMemberLimit"` -} - -type TrafficFlow struct { - // 实际流量,单位为 字节 - Value *uint64 `json:"Value,omitempty" name:"Value"` - - // 格式化后的流量,单位见参数 FormatUnit - // 注意:此字段可能返回 null,表示取不到有效值。 - FormatValue *float64 `json:"FormatValue,omitempty" name:"FormatValue"` - - // 格式化后流量的单位 - // 注意:此字段可能返回 null,表示取不到有效值。 - FormatUnit *string `json:"FormatUnit,omitempty" name:"FormatUnit"` -} - -type TrafficPackage struct { - // 流量包唯一ID - TrafficPackageId *string `json:"TrafficPackageId,omitempty" name:"TrafficPackageId"` - - // 流量包名称 - // 注意:此字段可能返回 null,表示取不到有效值。 - TrafficPackageName *string `json:"TrafficPackageName,omitempty" name:"TrafficPackageName"` - - // 流量包总量,单位GB - TotalAmount *float64 `json:"TotalAmount,omitempty" name:"TotalAmount"` - - // 流量包剩余量,单位GB - RemainingAmount *float64 `json:"RemainingAmount,omitempty" name:"RemainingAmount"` - - // 流量包状态,可能的值有: AVAILABLE-可用状态, EXPIRED-已过期, EXHAUSTED-已用完, REFUNDED-已退还, DELETED-已删除 - Status *string `json:"Status,omitempty" name:"Status"` - - // 流量包创建时间 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 流量包截止时间 - Deadline *string `json:"Deadline,omitempty" name:"Deadline"` - - // 已使用的流量,单位GB - UsedAmount *float64 `json:"UsedAmount,omitempty" name:"UsedAmount"` - - // 流量包标签 - // 注意:此字段可能返回 null,表示取不到有效值。 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // 区分闲时流量包与全时流量包 - DeductType *string `json:"DeductType,omitempty" name:"DeductType"` -} - -// Predefined struct for user -type TransformAddressRequestParams struct { - // 待操作有普通公网 IP 的实例 ID。实例 ID 形如:`ins-11112222`。可通过登录[控制台](https://console.cloud.tencent.com/cvm)查询,也可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/9389) 接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -type TransformAddressRequest struct { - *tchttp.BaseRequest - - // 待操作有普通公网 IP 的实例 ID。实例 ID 形如:`ins-11112222`。可通过登录[控制台](https://console.cloud.tencent.com/cvm)查询,也可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/9389) 接口返回值中的`InstanceId`获取。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -func (r *TransformAddressRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *TransformAddressRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "InstanceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "TransformAddressRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type TransformAddressResponseParams struct { - // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 - TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` - - // 转为弹性公网IP后的唯一ID - AddressId *string `json:"AddressId,omitempty" name:"AddressId"` - - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type TransformAddressResponse struct { - *tchttp.BaseResponse - Response *TransformAddressResponseParams `json:"Response"` -} - -func (r *TransformAddressResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *TransformAddressResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnassignIpv6AddressesRequestParams struct { - // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的`IPv6`地址列表,单次最多指定10个。 - Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses"` -} - -type UnassignIpv6AddressesRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的`IPv6`地址列表,单次最多指定10个。 - Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses"` -} - -func (r *UnassignIpv6AddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnassignIpv6AddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "Ipv6Addresses") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UnassignIpv6AddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnassignIpv6AddressesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type UnassignIpv6AddressesResponse struct { - *tchttp.BaseResponse - Response *UnassignIpv6AddressesResponseParams `json:"Response"` -} - -func (r *UnassignIpv6AddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnassignIpv6AddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnassignIpv6CidrBlockRequestParams struct { - // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `IPv6`网段。形如:`3402:4e00:20:1000::/56`。 - Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` -} - -type UnassignIpv6CidrBlockRequest struct { - *tchttp.BaseRequest - - // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `IPv6`网段。形如:`3402:4e00:20:1000::/56`。 - Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` -} - -func (r *UnassignIpv6CidrBlockRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnassignIpv6CidrBlockRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "Ipv6CidrBlock") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UnassignIpv6CidrBlockRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnassignIpv6CidrBlockResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type UnassignIpv6CidrBlockResponse struct { - *tchttp.BaseResponse - Response *UnassignIpv6CidrBlockResponseParams `json:"Response"` -} - -func (r *UnassignIpv6CidrBlockResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnassignIpv6CidrBlockResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnassignIpv6SubnetCidrBlockRequestParams struct { - // 子网所在私有网络`ID`。形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `IPv6` 子网段列表。 - Ipv6SubnetCidrBlocks []*Ipv6SubnetCidrBlock `json:"Ipv6SubnetCidrBlocks,omitempty" name:"Ipv6SubnetCidrBlocks"` -} - -type UnassignIpv6SubnetCidrBlockRequest struct { - *tchttp.BaseRequest - - // 子网所在私有网络`ID`。形如:`vpc-f49l6u0z`。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `IPv6` 子网段列表。 - Ipv6SubnetCidrBlocks []*Ipv6SubnetCidrBlock `json:"Ipv6SubnetCidrBlocks,omitempty" name:"Ipv6SubnetCidrBlocks"` -} - -func (r *UnassignIpv6SubnetCidrBlockRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnassignIpv6SubnetCidrBlockRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "VpcId") - delete(f, "Ipv6SubnetCidrBlocks") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UnassignIpv6SubnetCidrBlockRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnassignIpv6SubnetCidrBlockResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type UnassignIpv6SubnetCidrBlockResponse struct { - *tchttp.BaseResponse - Response *UnassignIpv6SubnetCidrBlockResponseParams `json:"Response"` -} - -func (r *UnassignIpv6SubnetCidrBlockResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnassignIpv6SubnetCidrBlockResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnassignPrivateIpAddressesRequestParams struct { - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的内网IP信息,单次最多指定10个。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 网卡绑定的子机实例ID,该参数仅用于指定网卡退还IP并解绑子机的场景,如果不涉及解绑子机,请勿填写。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -type UnassignPrivateIpAddressesRequest struct { - *tchttp.BaseRequest - - // 弹性网卡实例ID,例如:eni-m6dyj72l。 - NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` - - // 指定的内网IP信息,单次最多指定10个。 - PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses"` - - // 网卡绑定的子机实例ID,该参数仅用于指定网卡退还IP并解绑子机的场景,如果不涉及解绑子机,请勿填写。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` -} - -func (r *UnassignPrivateIpAddressesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnassignPrivateIpAddressesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "NetworkInterfaceId") - delete(f, "PrivateIpAddresses") - delete(f, "InstanceId") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UnassignPrivateIpAddressesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnassignPrivateIpAddressesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type UnassignPrivateIpAddressesResponse struct { - *tchttp.BaseResponse - Response *UnassignPrivateIpAddressesResponseParams `json:"Response"` -} - -func (r *UnassignPrivateIpAddressesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnassignPrivateIpAddressesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnlockCcnBandwidthsRequestParams struct { - // 带宽实例对象数组。 - Instances []*CcnFlowLock `json:"Instances,omitempty" name:"Instances"` -} - -type UnlockCcnBandwidthsRequest struct { - *tchttp.BaseRequest - - // 带宽实例对象数组。 - Instances []*CcnFlowLock `json:"Instances,omitempty" name:"Instances"` -} - -func (r *UnlockCcnBandwidthsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnlockCcnBandwidthsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "Instances") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UnlockCcnBandwidthsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnlockCcnBandwidthsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type UnlockCcnBandwidthsResponse struct { - *tchttp.BaseResponse - Response *UnlockCcnBandwidthsResponseParams `json:"Response"` -} - -func (r *UnlockCcnBandwidthsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnlockCcnBandwidthsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnlockCcnsRequestParams struct { -} - -type UnlockCcnsRequest struct { - *tchttp.BaseRequest -} - -func (r *UnlockCcnsRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnlockCcnsRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UnlockCcnsRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type UnlockCcnsResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type UnlockCcnsResponse struct { - *tchttp.BaseResponse - Response *UnlockCcnsResponseParams `json:"Response"` -} - -func (r *UnlockCcnsResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *UnlockCcnsResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} - -type UsedDetail struct { - // 流量包唯一ID - TrafficPackageId *string `json:"TrafficPackageId,omitempty" name:"TrafficPackageId"` - - // 流量包名称 - // 注意:此字段可能返回 null,表示取不到有效值。 - TrafficPackageName *string `json:"TrafficPackageName,omitempty" name:"TrafficPackageName"` - - // 流量包总量 - TotalAmount *TrafficFlow `json:"TotalAmount,omitempty" name:"TotalAmount"` - - // 本次抵扣 - Deduction *TrafficFlow `json:"Deduction,omitempty" name:"Deduction"` - - // 本次抵扣后剩余量 - RemainingAmount *TrafficFlow `json:"RemainingAmount,omitempty" name:"RemainingAmount"` - - // 抵扣时间 - Time *string `json:"Time,omitempty" name:"Time"` - - // 资源类型。可能的值: CVM, LB, NAT, HAVIP, EIP - ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` - - // 资源ID - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 资源名称 - ResourceName *string `json:"ResourceName,omitempty" name:"ResourceName"` - - // 流量包到期时间 - Deadline *string `json:"Deadline,omitempty" name:"Deadline"` -} - -type Vpc struct { - // `VPC`名称。 - VpcName *string `json:"VpcName,omitempty" name:"VpcName"` - - // `VPC`实例`ID`,例如:vpc-azd4dt1c。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // `VPC`的`IPv4` `CIDR`。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 是否默认`VPC`。 - IsDefault *bool `json:"IsDefault,omitempty" name:"IsDefault"` - - // 是否开启组播。 - EnableMulticast *bool `json:"EnableMulticast,omitempty" name:"EnableMulticast"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // `DNS`列表。 - DnsServerSet []*string `json:"DnsServerSet,omitempty" name:"DnsServerSet"` - - // `DHCP`域名选项值。 - DomainName *string `json:"DomainName,omitempty" name:"DomainName"` - - // `DHCP`选项集`ID`。 - DhcpOptionsId *string `json:"DhcpOptionsId,omitempty" name:"DhcpOptionsId"` - - // 是否开启`DHCP`。 - EnableDhcp *bool `json:"EnableDhcp,omitempty" name:"EnableDhcp"` - - // `VPC`的`IPv6` `CIDR`。 - Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` - - // 标签键值对 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // 辅助CIDR - // 注意:此字段可能返回 null,表示取不到有效值。 - AssistantCidrSet []*AssistantCidr `json:"AssistantCidrSet,omitempty" name:"AssistantCidrSet"` -} - -type VpcEndPointServiceUser struct { - // AppId。 - Owner *uint64 `json:"Owner,omitempty" name:"Owner"` - - // Uin。 - UserUin *string `json:"UserUin,omitempty" name:"UserUin"` - - // 描述信息。 - Description *string `json:"Description,omitempty" name:"Description"` - - // 创建时间。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 终端节点服务ID。 - EndPointServiceId *string `json:"EndPointServiceId,omitempty" name:"EndPointServiceId"` -} - -type VpcIpv6Address struct { - // `VPC`内`IPv6`地址。 - Ipv6Address *string `json:"Ipv6Address,omitempty" name:"Ipv6Address"` - - // 所属子网 `IPv6` `CIDR`。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // `IPv6`类型。 - Ipv6AddressType *string `json:"Ipv6AddressType,omitempty" name:"Ipv6AddressType"` - - // `IPv6`申请时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type VpcLimit struct { - // 私有网络配额描述 - LimitType *string `json:"LimitType,omitempty" name:"LimitType"` - - // 私有网络配额值 - LimitValue *uint64 `json:"LimitValue,omitempty" name:"LimitValue"` -} - -type VpcPrivateIpAddress struct { - // `VPC`内网`IP`。 - PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` - - // 所属子网`CIDR`。 - CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` - - // 内网`IP`类型。 - PrivateIpAddressType *string `json:"PrivateIpAddressType,omitempty" name:"PrivateIpAddressType"` - - // `IP`申请时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` -} - -type VpcTaskResultDetailInfo struct { - // 资源ID。 - // 注意:此字段可能返回 null,表示取不到有效值。 - ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` - - // 状态。 - // 注意:此字段可能返回 null,表示取不到有效值。 - Status *string `json:"Status,omitempty" name:"Status"` -} - -type VpnConnection struct { - // 通道实例ID。 - VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` - - // 通道名称。 - VpnConnectionName *string `json:"VpnConnectionName,omitempty" name:"VpnConnectionName"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // VPN网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // 对端网关实例ID。 - CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` - - // 预共享密钥。 - PreShareKey *string `json:"PreShareKey,omitempty" name:"PreShareKey"` - - // 通道传输协议。 - VpnProto *string `json:"VpnProto,omitempty" name:"VpnProto"` - - // 通道加密协议。 - EncryptProto *string `json:"EncryptProto,omitempty" name:"EncryptProto"` - - // 路由类型。 - RouteType *string `json:"RouteType,omitempty" name:"RouteType"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 通道的生产状态,PENDING:生产中,AVAILABLE:运行中,DELETING:删除中。 - State *string `json:"State,omitempty" name:"State"` - - // 通道连接状态,AVAILABLE:已连接。 - NetStatus *string `json:"NetStatus,omitempty" name:"NetStatus"` - - // SPD。 - SecurityPolicyDatabaseSet []*SecurityPolicyDatabase `json:"SecurityPolicyDatabaseSet,omitempty" name:"SecurityPolicyDatabaseSet"` - - // IKE选项。 - IKEOptionsSpecification *IKEOptionsSpecification `json:"IKEOptionsSpecification,omitempty" name:"IKEOptionsSpecification"` - - // IPSEC选择。 - IPSECOptionsSpecification *IPSECOptionsSpecification `json:"IPSECOptionsSpecification,omitempty" name:"IPSECOptionsSpecification"` - - // 是否支持健康状态探测 - EnableHealthCheck *bool `json:"EnableHealthCheck,omitempty" name:"EnableHealthCheck"` - - // 本端探测ip - HealthCheckLocalIp *string `json:"HealthCheckLocalIp,omitempty" name:"HealthCheckLocalIp"` - - // 对端探测ip - HealthCheckRemoteIp *string `json:"HealthCheckRemoteIp,omitempty" name:"HealthCheckRemoteIp"` - - // 通道健康检查状态,AVAILABLE:正常,UNAVAILABLE:不正常。 未配置健康检查不返回该对象 - HealthCheckStatus *string `json:"HealthCheckStatus,omitempty" name:"HealthCheckStatus"` - - // DPD探测开关。默认为0,表示关闭DPD探测。可选值:0(关闭),1(开启) - // 注意:此字段可能返回 null,表示取不到有效值。 - DpdEnable *int64 `json:"DpdEnable,omitempty" name:"DpdEnable"` - - // DPD超时时间。即探测确认对端不存在需要的时间。 - // 注意:此字段可能返回 null,表示取不到有效值。 - DpdTimeout *string `json:"DpdTimeout,omitempty" name:"DpdTimeout"` - - // DPD超时后的动作。默认为clear。dpdEnable为1(开启)时有效。可取值为clear(断开)和restart(重试) - // 注意:此字段可能返回 null,表示取不到有效值。 - DpdAction *string `json:"DpdAction,omitempty" name:"DpdAction"` - - // 标签键值对数组 - TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet"` - - // 协商类型 - // 注意:此字段可能返回 null,表示取不到有效值。 - NegotiationType *string `json:"NegotiationType,omitempty" name:"NegotiationType"` -} - -type VpnGateway struct { - // 网关实例ID。 - VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` - - // VPC实例ID。 - VpcId *string `json:"VpcId,omitempty" name:"VpcId"` - - // 网关实例名称。 - VpnGatewayName *string `json:"VpnGatewayName,omitempty" name:"VpnGatewayName"` - - // 网关实例类型:'IPSEC', 'SSL','CCN','SSL_CCN'。 - Type *string `json:"Type,omitempty" name:"Type"` - - // 网关实例状态, 'PENDING':生产中,'PENDING_ERROR':生产失败,'DELETING':删除中,'DELETING_ERROR':删除失败,'AVAILABLE':运行中。 - State *string `json:"State,omitempty" name:"State"` - - // 网关公网IP。 - PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` - - // 网关续费类型:'NOTIFY_AND_MANUAL_RENEW':手动续费,'NOTIFY_AND_AUTO_RENEW':自动续费,'NOT_NOTIFY_AND_NOT_RENEW':到期不续费。 - RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` - - // 网关付费类型:POSTPAID_BY_HOUR:按量计费,PREPAID:包年包月预付费。 - InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` - - // 网关出带宽。 - InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` - - // 创建时间。 - CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` - - // 预付费网关过期时间。 - ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` - - // 公网IP是否被封堵。 - IsAddressBlocked *bool `json:"IsAddressBlocked,omitempty" name:"IsAddressBlocked"` - - // 计费模式变更,PREPAID_TO_POSTPAID:包年包月预付费到期转按小时后付费。 - NewPurchasePlan *string `json:"NewPurchasePlan,omitempty" name:"NewPurchasePlan"` - - // 网关计费状态,PROTECTIVELY_ISOLATED:被安全隔离的实例,NORMAL:正常。 - RestrictState *string `json:"RestrictState,omitempty" name:"RestrictState"` - - // 可用区,如:ap-guangzhou-2。 - Zone *string `json:"Zone,omitempty" name:"Zone"` - - // 网关带宽配额信息。 - VpnGatewayQuotaSet []*VpnGatewayQuota `json:"VpnGatewayQuotaSet,omitempty" name:"VpnGatewayQuotaSet"` - - // 网关实例版本信息。 - Version *string `json:"Version,omitempty" name:"Version"` - - // Type值为CCN时,该值表示云联网实例ID。 - NetworkInstanceId *string `json:"NetworkInstanceId,omitempty" name:"NetworkInstanceId"` - - // CDC 实例ID。 - CdcId *string `json:"CdcId,omitempty" name:"CdcId"` - - // SSL-VPN 客户端连接数。 - MaxConnection *uint64 `json:"MaxConnection,omitempty" name:"MaxConnection"` -} - -type VpnGatewayQuota struct { - // 带宽配额 - Bandwidth *uint64 `json:"Bandwidth,omitempty" name:"Bandwidth"` - - // 配额中文名称 - Cname *string `json:"Cname,omitempty" name:"Cname"` - - // 配额英文名称 - Name *string `json:"Name,omitempty" name:"Name"` -} - -type VpnGatewayRoute struct { - // 目的端IDC网段。 - DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` - - // 下一跳类型(关联实例类型)可选值:"VPNCONN"(VPN通道), "CCN"(CCN实例)。 - InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` - - // 下一跳实例ID。 - InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` - - // 优先级,可选值:0,100。 - Priority *int64 `json:"Priority,omitempty" name:"Priority"` - - // 启用状态,可选值:"ENABLE"(启用),"DISABLE" (禁用)。 - Status *string `json:"Status,omitempty" name:"Status"` - - // 路由条目ID。 - RouteId *string `json:"RouteId,omitempty" name:"RouteId"` - - // 路由类型,可选值:"VPC"(VPC路由),"CCN"(云联网传播路由),"Static"(静态路由),"BGP"(BGP路由)。 - Type *string `json:"Type,omitempty" name:"Type"` - - // 创建时间。 - CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` - - // 更新时间。 - UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` -} - -type VpnGatewayRouteModify struct { - // VPN网关路由ID。 - RouteId *string `json:"RouteId,omitempty" name:"RouteId"` - - // VPN网关状态, ENABLE 启用, DISABLE禁用。 - Status *string `json:"Status,omitempty" name:"Status"` -} - -type VpngwCcnRoutes struct { - // 路由信息ID。 - RouteId *string `json:"RouteId,omitempty" name:"RouteId"` - - // 路由信息是否启用。 - // ENABLE:启用该路由 - // DISABLE:不启用该路由 - Status *string `json:"Status,omitempty" name:"Status"` - - // 路由CIDR。 - DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` -} - -// Predefined struct for user -type WithdrawNotifyRoutesRequestParams struct { - // 路由表唯一ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略唯一ID。 - RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds"` -} - -type WithdrawNotifyRoutesRequest struct { - *tchttp.BaseRequest - - // 路由表唯一ID。 - RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` - - // 路由策略唯一ID。 - RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds"` -} - -func (r *WithdrawNotifyRoutesRequest) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *WithdrawNotifyRoutesRequest) FromJsonString(s string) error { - f := make(map[string]interface{}) - if err := json.Unmarshal([]byte(s), &f); err != nil { - return err - } - delete(f, "RouteTableId") - delete(f, "RouteItemIds") - if len(f) > 0 { - return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "WithdrawNotifyRoutesRequest has unknown keys!", "") - } - return json.Unmarshal([]byte(s), &r) -} - -// Predefined struct for user -type WithdrawNotifyRoutesResponseParams struct { - // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 - RequestId *string `json:"RequestId,omitempty" name:"RequestId"` -} - -type WithdrawNotifyRoutesResponse struct { - *tchttp.BaseResponse - Response *WithdrawNotifyRoutesResponseParams `json:"Response"` -} - -func (r *WithdrawNotifyRoutesResponse) ToJsonString() string { - b, _ := json.Marshal(r) - return string(b) -} - -// FromJsonString It is highly **NOT** recommended to use this function -// because it has no param check, nor strict type check -func (r *WithdrawNotifyRoutesResponse) FromJsonString(s string) error { - return json.Unmarshal([]byte(s), &r) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/OWNERS b/cluster-autoscaler/cloudprovider/volcengine/OWNERS deleted file mode 100644 index 303761210458..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -approvers: -# - dougsong -reviewers: -# - dougsong -labels: -- area/provider/volcengine diff --git a/cluster-autoscaler/cloudprovider/volcengine/README.md b/cluster-autoscaler/cloudprovider/volcengine/README.md deleted file mode 100644 index 9ee3f32e38bc..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# Cluster Autoscaler on Volcengine - -The Cluster Autoscaler on Volcengine dynamically scales Kubernetes worker nodes. It runs as a deployment within your cluster. This README provides a step-by-step guide for setting up cluster autoscaler on your Kubernetes cluster. - -## Permissions - -### Using Volcengine Credentials - -To use Volcengine credentials, create a `Secret` with your access key and access key secret: - -```yaml -apiVersion: v1 -kind: Secret -metadata: - name: cloud-config - namespace: kube-system -type: Opaque -data: - access-key: [YOUR_BASE64_AK_ID] - secret-key: [YOUR_BASE64_AK_SECRET] - region-id: [YOUR_BASE64_REGION_ID] -``` - -See the [Volcengine Access Key User Manual](https://www.volcengine.com/docs/6291/65568) and [Volcengine Autoscaling Region](https://www.volcengine.com/docs/6617/87001) for more information. - -## Manual Configuration - -### Auto Scaling Group Setup - -1. Create an Auto Scaling Group in the [Volcengine Console](https://console.volcengine.com/as) with valid configurations, and set the desired instance number to zero. - -2. Create a Scaling Configuration for the Scaling Group with valid configurations. In User Data, specify the script to initialize the environment and join this node to the Kubernetes cluster. - -### Cluster Autoscaler Deployment - -1. Create a service account. - -```yaml ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler - name: cluster-autoscaler-account - namespace: kube-system - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: cluster-autoscaler - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -rules: - - apiGroups: [""] - resources: ["events", "endpoints"] - verbs: ["create", "patch"] - - apiGroups: [""] - resources: ["pods/eviction"] - verbs: ["create"] - - apiGroups: [""] - resources: ["pods/status"] - verbs: ["update"] - - apiGroups: [""] - resources: ["endpoints"] - resourceNames: ["cluster-autoscaler"] - verbs: ["get", "update"] - - apiGroups: [""] - resources: ["nodes"] - verbs: ["watch", "list", "get", "update", "delete"] - - apiGroups: [""] - resources: - - "namespaces" - - "pods" - - "services" - - "replicationcontrollers" - - "persistentvolumeclaims" - - "persistentvolumes" - verbs: ["watch", "list", "get"] - - apiGroups: ["batch", "extensions"] - resources: ["jobs"] - verbs: ["watch", "list", "get", "patch"] - - apiGroups: [ "policy" ] - resources: [ "poddisruptionbudgets" ] - verbs: [ "watch", "list" ] - - apiGroups: ["apps"] - resources: ["daemonsets", "replicasets", "statefulsets"] - verbs: ["watch", "list", "get"] - - apiGroups: ["storage.k8s.io"] - resources: ["storageclasses", "csinodes", "csidrivers", "csistoragecapacities"] - verbs: ["watch", "list", "get"] - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["create","list","watch"] - - apiGroups: [""] - resources: ["configmaps"] - resourceNames: ["cluster-autoscaler-status", "cluster-autoscaler-priority-expander"] - verbs: ["delete", "get", "update"] - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["watch", "list", "get", "create", "update", "patch", "delete", "deletecollection"] - - apiGroups: ["extensions"] - resources: ["replicasets", "daemonsets"] - verbs: ["watch", "list", "get"] - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -rules: - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["create","list","watch"] - - apiGroups: [""] - resources: ["configmaps"] - resourceNames: ["cluster-autoscaler-status", "cluster-autoscaler-priority-expander"] - verbs: ["delete","get","update","watch"] - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: cluster-autoscaler - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-autoscaler -subjects: - - kind: ServiceAccount - name: cluster-autoscaler-account - namespace: kube-system - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: cluster-autoscaler -subjects: - - kind: ServiceAccount - name: cluster-autoscaler - namespace: kube-system -``` - -2. Create a deployment. - -```yaml ---- -kind: Deployment -apiVersion: apps/v1 -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - app: cluster-autoscaler -spec: - replicas: 1 - selector: - matchLabels: - app: cluster-autoscaler - template: - metadata: - namespace: kube-system - labels: - app: cluster-autoscaler - spec: - serviceAccountName: cluster-autoscaler-account - containers: - - name: cluster-autoscaler - image: registry.k8s.io/autoscaling/cluster-autoscaler:latest - imagePullPolicy: Always - command: - - ./cluster-autoscaler - - --alsologtostderr - - --cloud-config=/config/cloud-config - - --cloud-provider=volcengine - - --nodes=[min]:[max]:[ASG_ID] - - --scale-down-delay-after-add=1m0s - - --scale-down-unneeded-time=1m0s - env: - - name: ACCESS_KEY - valueFrom: - secretKeyRef: - name: cloud-config - key: access-key - - name: SECRET_KEY - valueFrom: - secretKeyRef: - name: cloud-config - key: secret-key - - name: REGION_ID - valueFrom: - secretKeyRef: - name: cloud-config - key: region-id -``` - -## Auto-Discovery Setup - -Auto Discovery is not currently supported in Volcengine. \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-deployment.yaml b/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-deployment.yaml deleted file mode 100644 index 882413a70c41..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-deployment.yaml +++ /dev/null @@ -1,52 +0,0 @@ -kind: Deployment -apiVersion: apps/v1 -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - app: cluster-autoscaler -spec: - replicas: 1 - selector: - matchLabels: - app: cluster-autoscaler - template: - metadata: - namespace: kube-system - labels: - app: cluster-autoscaler - spec: - serviceAccountName: cluster-autoscaler-account - containers: - - name: cluster-autoscaler - image: registry.k8s.io/autoscaling/cluster-autoscaler:latest - imagePullPolicy: Always - command: - - ./cluster-autoscaler - - --alsologtostderr - - --cloud-config=/config/cloud-config - - --cloud-provider=volcengine - - --nodes=[min]:[max]:[ASG_ID] - - --scale-down-delay-after-add=1m0s - - --scale-down-unneeded-time=1m0s - env: - - name: ACCESS_KEY - valueFrom: - secretKeyRef: - name: cloud-config - key: access-key - - name: SECRET_KEY - valueFrom: - secretKeyRef: - name: cloud-config - key: secret-key - - name: REGION_ID - valueFrom: - secretKeyRef: - name: cloud-config - key: region-id - - name: ENDPOINT - valueFrom: - secretKeyRef: - name: cloud-config - key: endpoint \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-secret.yaml b/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-secret.yaml deleted file mode 100644 index 9be6ff38f0a0..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-secret.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: cloud-config - namespace: kube-system -type: Opaque -data: - access-key: [YOUR_BASE64_AK_ID] - secret-key: [YOUR_BASE64_AK_SECRET] - region-id: [YOUR_BASE64_REGION_ID] - endpoint: [YOUR_BASE64_ENDPOINT] \ No newline at end of file diff --git a/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-svcaccount.yaml b/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-svcaccount.yaml deleted file mode 100644 index a28db02a0400..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/examples/cluster-autoscaler-svcaccount.yaml +++ /dev/null @@ -1,122 +0,0 @@ ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler - name: cluster-autoscaler-account - namespace: kube-system - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: cluster-autoscaler - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -rules: - - apiGroups: [""] - resources: ["events", "endpoints"] - verbs: ["create", "patch"] - - apiGroups: [""] - resources: ["pods/eviction"] - verbs: ["create"] - - apiGroups: [""] - resources: ["pods/status"] - verbs: ["update"] - - apiGroups: [""] - resources: ["endpoints"] - resourceNames: ["cluster-autoscaler"] - verbs: ["get", "update"] - - apiGroups: [""] - resources: ["nodes"] - verbs: ["watch", "list", "get", "update", "delete"] - - apiGroups: [""] - resources: - - "namespaces" - - "pods" - - "services" - - "replicationcontrollers" - - "persistentvolumeclaims" - - "persistentvolumes" - verbs: ["watch", "list", "get"] - - apiGroups: ["batch", "extensions"] - resources: ["jobs"] - verbs: ["watch", "list", "get", "patch"] - - apiGroups: [ "policy" ] - resources: [ "poddisruptionbudgets" ] - verbs: [ "watch", "list" ] - - apiGroups: ["apps"] - resources: ["daemonsets", "replicasets", "statefulsets"] - verbs: ["watch", "list", "get"] - - apiGroups: ["storage.k8s.io"] - resources: ["storageclasses", "csinodes", "csidrivers", "csistoragecapacities"] - verbs: ["watch", "list", "get"] - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["create","list","watch"] - - apiGroups: [""] - resources: ["configmaps"] - resourceNames: ["cluster-autoscaler-status", "cluster-autoscaler-priority-expander"] - verbs: ["delete", "get", "update"] - - apiGroups: ["coordination.k8s.io"] - resources: ["leases"] - verbs: ["watch", "list", "get", "create", "update", "patch", "delete", "deletecollection"] - - apiGroups: ["extensions"] - resources: ["replicasets", "daemonsets"] - verbs: ["watch", "list", "get"] - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -rules: - - apiGroups: [""] - resources: ["configmaps"] - verbs: ["create","list","watch"] - - apiGroups: [""] - resources: ["configmaps"] - resourceNames: ["cluster-autoscaler-status", "cluster-autoscaler-priority-expander"] - verbs: ["delete","get","update","watch"] - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: cluster-autoscaler - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: cluster-autoscaler -subjects: - - kind: ServiceAccount - name: cluster-autoscaler-account - namespace: kube-system - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: cluster-autoscaler - namespace: kube-system - labels: - k8s-addon: cluster-autoscaler.addons.k8s.io - k8s-app: cluster-autoscaler -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: cluster-autoscaler -subjects: - - kind: ServiceAccount - name: cluster-autoscaler - namespace: kube-system diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/aes.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/aes.go deleted file mode 100644 index e11e0d729690..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/aes.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -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 base - -import ( - "bytes" - "crypto/aes" - "crypto/cipher" - "encoding/base64" - "errors" - "fmt" -) - -// AES CBC -func aesEncryptCBC(origData, key []byte) (crypted []byte, err error) { - defer func() { - if r := recover(); r != nil { - crypted = nil - err = errors.New(fmt.Sprintf("%v", r)) - } - }() - block, err := aes.NewCipher(key) - if err != nil { - return - } - - blockSize := block.BlockSize() - origData = zeroPadding(origData, blockSize) - blockMode := cipher.NewCBCEncrypter(block, key[:blockSize]) - crypted = make([]byte, len(origData)) - blockMode.CryptBlocks(crypted, origData) - return -} - -// AES CBC Do a Base64 encryption after encryption -func aesEncryptCBCWithBase64(origData, key []byte) (string, error) { - cbc, err := aesEncryptCBC(origData, key) - if err != nil { - return "", err - } - - return base64.StdEncoding.EncodeToString(cbc), nil -} - -func zeroPadding(ciphertext []byte, blockSize int) []byte { - padding := blockSize - len(ciphertext)%blockSize - if padding == 0 { - return ciphertext - } - - padtext := bytes.Repeat([]byte{byte(0)}, padding) - return append(ciphertext, padtext...) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/client.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/client.go deleted file mode 100644 index 92ffaa8b4375..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/client.go +++ /dev/null @@ -1,357 +0,0 @@ -/* -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 base - -import ( - "context" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "os" - "strings" - "time" - - "github.com/cenkalti/backoff/v4" -) - -const ( - accessKey = "VOLC_ACCESSKEY" - secretKey = "VOLC_SECRETKEY" - - defaultScheme = "http" -) - -var _GlobalClient *http.Client - -func init() { - _GlobalClient = &http.Client{ - Transport: &http.Transport{ - MaxIdleConns: 1000, - MaxIdleConnsPerHost: 100, - IdleConnTimeout: 10 * time.Second, - }, - } -} - -// Client -type Client struct { - Client *http.Client - ServiceInfo *ServiceInfo - ApiInfoList map[string]*ApiInfo -} - -// NewClient -func NewClient(info *ServiceInfo, apiInfoList map[string]*ApiInfo) *Client { - client := &Client{Client: _GlobalClient, ServiceInfo: info.Clone(), ApiInfoList: apiInfoList} - - if client.ServiceInfo.Scheme == "" { - client.ServiceInfo.Scheme = defaultScheme - } - - if os.Getenv(accessKey) != "" && os.Getenv(secretKey) != "" { - client.ServiceInfo.Credentials.AccessKeyID = os.Getenv(accessKey) - client.ServiceInfo.Credentials.SecretAccessKey = os.Getenv(secretKey) - } else if _, err := os.Stat(os.Getenv("HOME") + "/.volc/config"); err == nil { - if content, err := ioutil.ReadFile(os.Getenv("HOME") + "/.volc/config"); err == nil { - m := make(map[string]string) - json.Unmarshal(content, &m) - if accessKey, ok := m["ak"]; ok { - client.ServiceInfo.Credentials.AccessKeyID = accessKey - } - if secretKey, ok := m["sk"]; ok { - client.ServiceInfo.Credentials.SecretAccessKey = secretKey - } - } - } - return client -} - -func (serviceInfo *ServiceInfo) Clone() *ServiceInfo { - ret := new(ServiceInfo) - //base info - ret.Timeout = serviceInfo.Timeout - ret.Host = serviceInfo.Host - ret.Scheme = serviceInfo.Scheme - - //credential - ret.Credentials = serviceInfo.Credentials.Clone() - - // header - ret.Header = serviceInfo.Header.Clone() - return ret -} - -func (cred Credentials) Clone() Credentials { - return Credentials{ - Service: cred.Service, - Region: cred.Region, - SecretAccessKey: cred.SecretAccessKey, - AccessKeyID: cred.AccessKeyID, - SessionToken: cred.SessionToken, - } -} - -// SetRetrySettings -func (client *Client) SetRetrySettings(retrySettings *RetrySettings) { - if retrySettings != nil { - client.ServiceInfo.Retry = *retrySettings - } -} - -// SetAccessKey -func (client *Client) SetAccessKey(ak string) { - if ak != "" { - client.ServiceInfo.Credentials.AccessKeyID = ak - } -} - -// SetSecretKey -func (client *Client) SetSecretKey(sk string) { - if sk != "" { - client.ServiceInfo.Credentials.SecretAccessKey = sk - } -} - -// SetSessionToken -func (client *Client) SetSessionToken(token string) { - if token != "" { - client.ServiceInfo.Credentials.SessionToken = token - } -} - -// SetHost -func (client *Client) SetHost(host string) { - if host != "" { - client.ServiceInfo.Host = host - } -} - -func (client *Client) SetScheme(scheme string) { - if scheme != "" { - client.ServiceInfo.Scheme = scheme - } -} - -// SetCredential -func (client *Client) SetCredential(c Credentials) { - if c.AccessKeyID != "" { - client.ServiceInfo.Credentials.AccessKeyID = c.AccessKeyID - } - - if c.SecretAccessKey != "" { - client.ServiceInfo.Credentials.SecretAccessKey = c.SecretAccessKey - } - - if c.Region != "" { - client.ServiceInfo.Credentials.Region = c.Region - } - - if c.SessionToken != "" { - client.ServiceInfo.Credentials.SessionToken = c.SessionToken - } - - if c.Service != "" { - client.ServiceInfo.Credentials.Service = c.Service - } -} - -func (client *Client) SetTimeout(timeout time.Duration) { - if timeout > 0 { - client.ServiceInfo.Timeout = timeout - } -} - -// GetSignUrl -func (client *Client) GetSignUrl(api string, query url.Values) (string, error) { - apiInfo := client.ApiInfoList[api] - - if apiInfo == nil { - return "", errors.New("The related api does not exist") - } - - query = mergeQuery(query, apiInfo.Query) - - u := url.URL{ - Scheme: client.ServiceInfo.Scheme, - Host: client.ServiceInfo.Host, - Path: apiInfo.Path, - RawQuery: query.Encode(), - } - req, err := http.NewRequest(strings.ToUpper(apiInfo.Method), u.String(), nil) - - if err != nil { - return "", errors.New("Failed to build request") - } - - return client.ServiceInfo.Credentials.SignUrl(req), nil -} - -// SignSts2 -func (client *Client) SignSts2(inlinePolicy *Policy, expire time.Duration) (*SecurityToken2, error) { - var err error - sts := new(SecurityToken2) - if sts.AccessKeyID, sts.SecretAccessKey, err = createTempAKSK(); err != nil { - return nil, err - } - - if expire < time.Minute { - expire = time.Minute - } - - now := time.Now() - expireTime := now.Add(expire) - sts.CurrentTime = now.Format(time.RFC3339) - sts.ExpiredTime = expireTime.Format(time.RFC3339) - - innerToken, err := createInnerToken(client.ServiceInfo.Credentials, sts, inlinePolicy, expireTime.Unix()) - if err != nil { - return nil, err - } - - b, _ := json.Marshal(innerToken) - sts.SessionToken = "STS2" + base64.StdEncoding.EncodeToString(b) - return sts, nil -} - -// Query Initiate a Get query request -func (client *Client) Query(api string, query url.Values) ([]byte, int, error) { - return client.CtxQuery(context.Background(), api, query) -} - -func (client *Client) CtxQuery(ctx context.Context, api string, query url.Values) ([]byte, int, error) { - return client.request(ctx, api, query, "", "") -} - -// Json Initiate a Json post request -func (client *Client) Json(api string, query url.Values, body string) ([]byte, int, error) { - return client.CtxJson(context.Background(), api, query, body) -} - -func (client *Client) CtxJson(ctx context.Context, api string, query url.Values, body string) ([]byte, int, error) { - return client.request(ctx, api, query, body, "application/json") -} -func (client *Client) PostWithContentType(api string, query url.Values, body string, ct string) ([]byte, int, error) { - return client.CtxPostWithContentType(context.Background(), api, query, body, ct) -} - -// CtxPostWithContentType Initiate a post request with a custom Content-Type, Content-Type cannot be empty -func (client *Client) CtxPostWithContentType(ctx context.Context, api string, query url.Values, body string, ct string) ([]byte, int, error) { - return client.request(ctx, api, query, body, ct) -} - -func (client *Client) Post(api string, query url.Values, form url.Values) ([]byte, int, error) { - return client.CtxPost(context.Background(), api, query, form) -} - -// CtxPost Initiate a Post request -func (client *Client) CtxPost(ctx context.Context, api string, query url.Values, form url.Values) ([]byte, int, error) { - apiInfo := client.ApiInfoList[api] - form = mergeQuery(form, apiInfo.Form) - return client.request(ctx, api, query, form.Encode(), "application/x-www-form-urlencoded") -} - -func (client *Client) makeRequest(inputContext context.Context, api string, req *http.Request, timeout time.Duration) ([]byte, int, error, bool) { - req = client.ServiceInfo.Credentials.Sign(req) - - ctx := inputContext - if ctx == nil { - ctx = context.Background() - } - - ctx, cancel := context.WithTimeout(ctx, timeout) - defer cancel() - req = req.WithContext(ctx) - - resp, err := client.Client.Do(req) - if err != nil { - // should retry when client sends request error. - return []byte(""), 500, err, true - } - defer resp.Body.Close() - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return []byte(""), resp.StatusCode, err, false - } - - if resp.StatusCode < 200 || resp.StatusCode > 299 { - needRetry := false - // should retry when server returns 5xx error. - if resp.StatusCode >= http.StatusInternalServerError { - needRetry = true - } - return body, resp.StatusCode, fmt.Errorf("api %s http code %d body %s", api, resp.StatusCode, string(body)), needRetry - } - - return body, resp.StatusCode, nil, false -} - -func (client *Client) request(ctx context.Context, api string, query url.Values, body string, ct string) ([]byte, int, error) { - apiInfo := client.ApiInfoList[api] - - if apiInfo == nil { - return []byte(""), 500, errors.New("The related api does not exist") - } - timeout := getTimeout(client.ServiceInfo.Timeout, apiInfo.Timeout) - header := mergeHeader(client.ServiceInfo.Header, apiInfo.Header) - query = mergeQuery(query, apiInfo.Query) - retrySettings := getRetrySetting(&client.ServiceInfo.Retry, &apiInfo.Retry) - - u := url.URL{ - Scheme: client.ServiceInfo.Scheme, - Host: client.ServiceInfo.Host, - Path: apiInfo.Path, - RawQuery: query.Encode(), - } - requestBody := strings.NewReader(body) - req, err := http.NewRequest(strings.ToUpper(apiInfo.Method), u.String(), nil) - if err != nil { - return []byte(""), 500, errors.New("Failed to build request") - } - req.Header = header - if ct != "" { - req.Header.Set("Content-Type", ct) - } - - // Because service info could be changed by SetRegion, so set UA header for every request here. - req.Header.Set("User-Agent", strings.Join([]string{SDKName, SDKVersion}, "/")) - - var resp []byte - var code int - - err = backoff.Retry(func() error { - _, err = requestBody.Seek(0, io.SeekStart) - if err != nil { - // if seek failed, stop retry. - return backoff.Permanent(err) - } - req.Body = ioutil.NopCloser(requestBody) - var needRetry bool - resp, code, err, needRetry = client.makeRequest(ctx, api, req, timeout) - if needRetry { - return err - } else { - return backoff.Permanent(err) - } - }, backoff.WithMaxRetries(backoff.NewConstantBackOff(*retrySettings.RetryInterval), *retrySettings.RetryTimes)) - return resp, code, err -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/model.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/model.go deleted file mode 100644 index 26a8858e823b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/model.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -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 base - -import ( - "net/http" - "net/url" - "time" -) - -const ( - RegionCnNorth1 = "cn-north-1" - RegionUsEast1 = "us-east-1" - RegionApSingapore = "ap-singapore-1" - - timeFormatV4 = "20060102T150405Z" -) - -type ServiceInfo struct { - Timeout time.Duration - Scheme string - Host string - Header http.Header - Credentials Credentials - Retry RetrySettings -} - -type ApiInfo struct { - Method string - Path string - Query url.Values - Form url.Values - Timeout time.Duration - Header http.Header - Retry RetrySettings -} - -type Credentials struct { - AccessKeyID string - SecretAccessKey string - Service string - Region string - SessionToken string -} - -type metadata struct { - algorithm string - credentialScope string - signedHeaders string - date string - region string - service string -} - -// Unified JSON return results -type CommonResponse struct { - ResponseMetadata ResponseMetadata - Result interface{} `json:"Result,omitempty"` -} - -type BaseResp struct { - Status string - CreatedTime int64 - UpdatedTime int64 -} - -type ErrorObj struct { - CodeN int - Code string - Message string -} - -type ResponseMetadata struct { - RequestId string - Service string `json:",omitempty"` - Region string `json:",omitempty"` - Action string `json:",omitempty"` - Version string `json:",omitempty"` - Error *ErrorObj `json:",omitempty"` -} - -type Policy struct { - Statement []*Statement -} - -const ( - StatementEffectAllow = "Allow" - StatementEffectDeny = "Deny" -) - -type Statement struct { - Effect string - Action []string - Resource []string - Condition string `json:",omitempty"` -} - -type SecurityToken2 struct { - AccessKeyID string - SecretAccessKey string - SessionToken string - ExpiredTime string - CurrentTime string -} - -type InnerToken struct { - LTAccessKeyId string - AccessKeyId string - SignedSecretAccessKey string - ExpiredTime int64 - PolicyString string - Signature string -} - -type RetrySettings struct { - AutoRetry bool - RetryTimes *uint64 - RetryInterval *time.Duration -} - -type RequestParam struct { - IsSignUrl bool - Body []byte - Method string - Date time.Time - Path string - Host string - QueryList url.Values - Headers http.Header -} - -type SignRequest struct { - XDate string - XNotSignBody string - XCredential string - XAlgorithm string - XSignedHeaders string - XSignedQueries string - XSignature string - XSecurityToken string - - Host string - ContentType string - XContentSha256 string - Authorization string -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/sign.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/sign.go deleted file mode 100644 index 2a97e3e6ee56..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/sign.go +++ /dev/null @@ -1,349 +0,0 @@ -/* -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 base - -import ( - "bytes" - "crypto/hmac" - "crypto/md5" - "crypto/sha256" - "encoding/base64" - "encoding/hex" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "sort" - "strings" - "time" -) - -func (c Credentials) Sign(request *http.Request) *http.Request { - query := request.URL.Query() - request.URL.RawQuery = query.Encode() - - if request.URL.Path == "" { - request.URL.Path += "/" - } - requestParam := RequestParam{ - IsSignUrl: false, - Body: readAndReplaceBody(request), - Host: request.Host, - Path: request.URL.Path, - Method: request.Method, - Date: now(), - QueryList: query, - Headers: request.Header, - } - signRequest := GetSignRequest(requestParam, c) - - request.Header.Set("Host", signRequest.Host) - request.Header.Set("Content-Type", signRequest.ContentType) - request.Header.Set("X-Date", signRequest.XDate) - request.Header.Set("X-Content-Sha256", signRequest.XContentSha256) - request.Header.Set("Authorization", signRequest.Authorization) - if signRequest.XSecurityToken != "" { - request.Header.Set("X-Security-Token", signRequest.XSecurityToken) - } - return request -} - -func (c Credentials) SignUrl(request *http.Request) string { - query := request.URL.Query() - - requestParam := RequestParam{ - IsSignUrl: true, - Body: readAndReplaceBody(request), - Host: request.Host, - Path: request.URL.Path, - Method: request.Method, - Date: now(), - QueryList: query, - Headers: request.Header, - } - signRequest := GetSignRequest(requestParam, c) - - query.Set("X-Date", signRequest.XDate) - query.Set("X-NotSignBody", signRequest.XNotSignBody) - query.Set("X-Credential", signRequest.XCredential) - query.Set("X-Algorithm", signRequest.XAlgorithm) - query.Set("X-SignedHeaders", signRequest.XSignedHeaders) - query.Set("X-SignedQueries", signRequest.XSignedQueries) - query.Set("X-Signature", signRequest.XSignature) - if signRequest.XSecurityToken != "" { - query.Set("X-Security-Token", signRequest.XSecurityToken) - } - return query.Encode() -} - -func GetSignRequest(requestParam RequestParam, credentials Credentials) SignRequest { - formatDate := appointTimestampV4(requestParam.Date) - meta := getMetaData(credentials, tsDateV4(formatDate)) - - requestSignMap := make(map[string][]string) - if credentials.SessionToken != "" { - requestSignMap["X-Security-Token"] = []string{credentials.SessionToken} - } - signRequest := SignRequest{ - XDate: formatDate, - XSecurityToken: credentials.SessionToken, - } - var bodyHash string - if requestParam.IsSignUrl { - for k, v := range requestParam.QueryList { - requestSignMap[k] = v - } - requestSignMap["X-Date"], requestSignMap["X-NotSignBody"], requestSignMap["X-Credential"], requestSignMap["X-Algorithm"], requestSignMap["X-SignedHeaders"], requestSignMap["X-SignedQueries"] = - []string{formatDate}, []string{""}, []string{credentials.AccessKeyID + "/" + meta.credentialScope}, []string{meta.algorithm}, []string{meta.signedHeaders}, []string{""} - - keys := make([]string, 0, len(requestSignMap)) - for k := range requestSignMap { - keys = append(keys, k) - } - sort.Strings(keys) - requestSignMap["X-SignedQueries"] = []string{strings.Join(keys, ";")} - - signRequest.XNotSignBody, signRequest.XCredential, signRequest.XAlgorithm, signRequest.XSignedHeaders, signRequest.XSignedQueries = - "", credentials.AccessKeyID+"/"+meta.credentialScope, meta.algorithm, meta.signedHeaders, strings.Join(keys, ";") - bodyHash = hashSHA256([]byte{}) - } else { - for k, v := range requestParam.Headers { - requestSignMap[k] = v - } - if requestSignMap["Content-Type"] == nil { - signRequest.ContentType = "application/x-www-form-urlencoded; charset=utf-8" - } else { - signRequest.ContentType = requestSignMap["Content-Type"][0] - } - requestSignMap["X-Date"], requestSignMap["Host"], requestSignMap["Content-Type"] = []string{formatDate}, []string{requestParam.Host}, []string{signRequest.ContentType} - - if len(requestParam.Body) == 0 { - bodyHash = hashSHA256([]byte{}) - } else { - bodyHash = hashSHA256(requestParam.Body) - } - requestSignMap["X-Content-Sha256"] = []string{bodyHash} - signRequest.Host, signRequest.XContentSha256 = requestParam.Host, bodyHash - } - - signature := getSignatureStr(requestParam, meta, credentials.SecretAccessKey, formatDate, requestSignMap, bodyHash) - if requestParam.IsSignUrl { - signRequest.XSignature = signature - } else { - signRequest.Authorization = buildAuthHeaderV4(signature, meta, credentials) - } - return signRequest -} - -func getSignatureStr(requestParam RequestParam, meta *metadata, secretAccessKey string, - formatDate string, requestSignMap map[string][]string, bodyHash string) string { - // Task 1 - hashedCanonReq := hashedCanonicalRequestV4(requestParam, meta, requestSignMap, bodyHash) - - // Task 2 - stringToSign := concat("\n", meta.algorithm, formatDate, meta.credentialScope, hashedCanonReq) - - // Task 3 - signingKey := signingKeyV4(secretAccessKey, meta.date, meta.region, meta.service) - return signatureV4(signingKey, stringToSign) -} - -func hashedCanonicalRequestV4(param RequestParam, meta *metadata, requestSignMap map[string][]string, bodyHash string) string { - var canonicalRequest string - if param.IsSignUrl { - queryList := make(url.Values) - for k, v := range requestSignMap { - for i := range v { - queryList.Set(k, v[i]) - } - } - canonicalRequest = concat("\n", param.Method, normuri(param.Path), normquery(queryList), "\n", meta.signedHeaders, bodyHash) - } else { - canonicalHeaders := getCanonicalHeaders(param, meta, requestSignMap) - canonicalRequest = concat("\n", param.Method, normuri(param.Path), normquery(param.QueryList), canonicalHeaders, meta.signedHeaders, bodyHash) - } - return hashSHA256([]byte(canonicalRequest)) -} - -func getCanonicalHeaders(param RequestParam, meta *metadata, requestSignMap map[string][]string) string { - signMap := make(map[string][]string) - signedHeaders := sortHeaders(requestSignMap, signMap) - if !param.IsSignUrl { - meta.signedHeaders = concat(";", signedHeaders...) - } - if param.Path == "" { - param.Path = "/" - } - var headersToSign string - for _, key := range signedHeaders { - value := strings.TrimSpace(signMap[key][0]) - if key == "host" { - if strings.Contains(value, ":") { - split := strings.Split(value, ":") - port := split[1] - if port == "80" || port == "443" { - value = split[0] - } - } - } - headersToSign += key + ":" + value + "\n" - } - return headersToSign -} - -func sortHeaders(requestSignMap map[string][]string, signMap map[string][]string) []string { - var sortedHeaderKeys []string - for k, v := range requestSignMap { - signMap[strings.ToLower(k)] = v - switch k { - case "Content-Type", "Content-Md5", "Host", "X-Security-Token": - default: - if !strings.HasPrefix(k, "X-") { - continue - } - } - sortedHeaderKeys = append(sortedHeaderKeys, strings.ToLower(k)) - } - sort.Strings(sortedHeaderKeys) - return sortedHeaderKeys -} - -func getMetaData(credentials Credentials, date string) *metadata { - meta := new(metadata) - meta.date, meta.service, meta.region, meta.signedHeaders, meta.algorithm = date, credentials.Service, credentials.Region, "", "HMAC-SHA256" - meta.credentialScope = concat("/", meta.date, meta.region, meta.service, "request") - return meta -} - -func signatureV4(signingKey []byte, stringToSign string) string { - return hex.EncodeToString(hmacSHA256(signingKey, stringToSign)) -} - -func signingKeyV4(secretKey, date, region, service string) []byte { - kDate := hmacSHA256([]byte(secretKey), date) - kRegion := hmacSHA256(kDate, region) - kService := hmacSHA256(kRegion, service) - kSigning := hmacSHA256(kService, "request") - return kSigning -} - -func buildAuthHeaderV4(signature string, meta *metadata, keys Credentials) string { - credential := keys.AccessKeyID + "/" + meta.credentialScope - - return meta.algorithm + - " Credential=" + credential + - ", SignedHeaders=" + meta.signedHeaders + - ", Signature=" + signature -} - -func timestampV4() string { - return now().Format(timeFormatV4) -} - -func appointTimestampV4(date time.Time) string { - return date.Format(timeFormatV4) -} -func tsDateV4(timestamp string) string { - return timestamp[:8] -} - -func hmacSHA256(key []byte, content string) []byte { - mac := hmac.New(sha256.New, key) - mac.Write([]byte(content)) - return mac.Sum(nil) -} - -func hashSHA256(content []byte) string { - h := sha256.New() - h.Write(content) - return fmt.Sprintf("%x", h.Sum(nil)) -} - -func hashMD5(content []byte) string { - h := md5.New() - h.Write(content) - return base64.StdEncoding.EncodeToString(h.Sum(nil)) -} - -func readAndReplaceBody(request *http.Request) []byte { - if request.Body == nil { - return []byte{} - } - payload, _ := ioutil.ReadAll(request.Body) - request.Body = ioutil.NopCloser(bytes.NewReader(payload)) - return payload -} - -func concat(delim string, str ...string) string { - return strings.Join(str, delim) -} - -var now = func() time.Time { - return time.Now().UTC() -} - -func normuri(uri string) string { - parts := strings.Split(uri, "/") - for i := range parts { - parts[i] = encodePathFrag(parts[i]) - } - return strings.Join(parts, "/") -} - -func encodePathFrag(s string) string { - hexCount := 0 - for i := 0; i < len(s); i++ { - c := s[i] - if shouldEscape(c) { - hexCount++ - } - } - t := make([]byte, len(s)+2*hexCount) - j := 0 - for i := 0; i < len(s); i++ { - c := s[i] - if shouldEscape(c) { - t[j] = '%' - t[j+1] = "0123456789ABCDEF"[c>>4] - t[j+2] = "0123456789ABCDEF"[c&15] - j += 3 - } else { - t[j] = c - j++ - } - } - return string(t) -} - -func shouldEscape(c byte) bool { - if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' { - return false - } - if '0' <= c && c <= '9' { - return false - } - if c == '-' || c == '_' || c == '.' || c == '~' { - return false - } - return true -} - -func normquery(v url.Values) string { - queryString := v.Encode() - - return strings.Replace(queryString, "+", "%20", -1) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/utils.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/utils.go deleted file mode 100644 index 3665de0eab37..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/utils.go +++ /dev/null @@ -1,252 +0,0 @@ -/* -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 base - -import ( - "crypto/md5" - "encoding/base64" - "encoding/hex" - "encoding/json" - "fmt" - "math/rand" - "net/http" - "net/url" - "reflect" - "strconv" - "strings" - "time" - - "github.com/google/uuid" -) - -var ( - letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") - defaultRetryTimes uint64 = 2 - defaultRetryInterval = 1 * time.Second -) - -func init() { - rand.Seed(time.Now().Unix()) -} - -func createTempAKSK() (accessKeyId string, plainSk string, err error) { - if accessKeyId, err = generateAccessKeyId("AKTP"); err != nil { - return - } - - plainSk, err = generateSecretKey() - if err != nil { - return - } - return -} - -func generateAccessKeyId(prefix string) (string, error) { - uuid := uuid.New() - - uidBase64 := base64.StdEncoding.EncodeToString([]byte(strings.Replace(uuid.String(), "-", "", -1))) - - s := strings.Replace(uidBase64, "=", "", -1) - s = strings.Replace(s, "/", "", -1) - s = strings.Replace(s, "+", "", -1) - s = strings.Replace(s, "-", "", -1) - return prefix + s, nil -} - -func randStringRunes(n int) string { - b := make([]rune, n) - for i := range b { - b[i] = letterRunes[rand.Intn(len(letterRunes))] - } - return string(b) -} - -func generateSecretKey() (string, error) { - randString32 := randStringRunes(32) - return aesEncryptCBCWithBase64([]byte(randString32), []byte("bytedance-isgood")) -} - -func createInnerToken(credentials Credentials, sts *SecurityToken2, inlinePolicy *Policy, t int64) (*InnerToken, error) { - var err error - innerToken := new(InnerToken) - - innerToken.LTAccessKeyId = credentials.AccessKeyID - innerToken.AccessKeyId = sts.AccessKeyID - innerToken.ExpiredTime = t - - key := md5.Sum([]byte(credentials.SecretAccessKey)) - innerToken.SignedSecretAccessKey, err = aesEncryptCBCWithBase64([]byte(sts.SecretAccessKey), key[:]) - if err != nil { - return nil, err - } - - if inlinePolicy != nil { - b, _ := json.Marshal(inlinePolicy) - innerToken.PolicyString = string(b) - } - - signStr := fmt.Sprintf("%s|%s|%d|%s|%s", innerToken.LTAccessKeyId, innerToken.AccessKeyId, innerToken.ExpiredTime, innerToken.SignedSecretAccessKey, innerToken.PolicyString) - - innerToken.Signature = hex.EncodeToString(hmacSHA256(key[:], signStr)) - return innerToken, nil -} - -func getTimeout(serviceTimeout, apiTimeout time.Duration) time.Duration { - timeout := time.Second - if serviceTimeout != time.Duration(0) { - timeout = serviceTimeout - } - if apiTimeout != time.Duration(0) { - timeout = apiTimeout - } - return timeout -} - -func getRetrySetting(serviceRetrySettings, apiRetrySettings *RetrySettings) *RetrySettings { - retrySettings := &RetrySettings{ - AutoRetry: false, - RetryTimes: new(uint64), - RetryInterval: new(time.Duration), - } - if !apiRetrySettings.AutoRetry || !serviceRetrySettings.AutoRetry { - return retrySettings - } - retrySettings.AutoRetry = true - if serviceRetrySettings.RetryTimes != nil { - retrySettings.RetryTimes = serviceRetrySettings.RetryTimes - } else if apiRetrySettings.RetryTimes != nil { - retrySettings.RetryTimes = apiRetrySettings.RetryTimes - } else { - retrySettings.RetryTimes = &defaultRetryTimes - } - if serviceRetrySettings.RetryInterval != nil { - retrySettings.RetryInterval = serviceRetrySettings.RetryInterval - } else if apiRetrySettings.RetryInterval != nil { - retrySettings.RetryInterval = apiRetrySettings.RetryInterval - } else { - retrySettings.RetryInterval = &defaultRetryInterval - } - return retrySettings -} - -func mergeQuery(query1, query2 url.Values) (query url.Values) { - query = url.Values{} - if query1 != nil { - for k, vv := range query1 { - for _, v := range vv { - query.Add(k, v) - } - } - } - - if query2 != nil { - for k, vv := range query2 { - for _, v := range vv { - query.Add(k, v) - } - } - } - return -} - -func mergeHeader(header1, header2 http.Header) (header http.Header) { - header = http.Header{} - if header1 != nil { - for k, v := range header1 { - header.Set(k, strings.Join(v, ";")) - } - } - if header2 != nil { - for k, v := range header2 { - header.Set(k, strings.Join(v, ";")) - } - } - - return -} - -func NewAllowStatement(actions, resources []string) *Statement { - sts := new(Statement) - sts.Effect = "Allow" - sts.Action = actions - sts.Resource = resources - - return sts -} - -func NewDenyStatement(actions, resources []string) *Statement { - sts := new(Statement) - sts.Effect = "Deny" - sts.Action = actions - sts.Resource = resources - - return sts -} - -func ToUrlValues(i interface{}) (values url.Values) { - values = url.Values{} - iVal := reflect.ValueOf(i).Elem() - typ := iVal.Type() - for i := 0; i < iVal.NumField(); i++ { - f := iVal.Field(i) - // You ca use tags here... - // tag := typ.Field(i).Tag.Get("tagname") - // Convert each type into a string for the url.Values string map - var v string - switch f.Interface().(type) { - case int, int8, int16, int32, int64: - v = strconv.FormatInt(f.Int(), 10) - case uint, uint8, uint16, uint32, uint64: - v = strconv.FormatUint(f.Uint(), 10) - case float32: - v = strconv.FormatFloat(f.Float(), 'f', 4, 32) - case float64: - v = strconv.FormatFloat(f.Float(), 'f', 4, 64) - case []byte: - v = string(f.Bytes()) - case bool: - v = strconv.FormatBool(f.Bool()) - case string: - if f.Len() == 0 { - continue - } - v = f.String() - } - values.Set(typ.Field(i).Name, v) - } - return -} - -func UnmarshalResultInto(data []byte, result interface{}) error { - resp := new(CommonResponse) - if err := json.Unmarshal(data, resp); err != nil { - return fmt.Errorf("fail to unmarshal response, %v", err) - } - errObj := resp.ResponseMetadata.Error - if errObj != nil && errObj.CodeN != 0 { - return fmt.Errorf("request %s error %s", resp.ResponseMetadata.RequestId, errObj.Message) - } - - data, err := json.Marshal(resp.Result) - if err != nil { - return fmt.Errorf("fail to marshal result, %v", err) - } - if err = json.Unmarshal(data, result); err != nil { - return fmt.Errorf("fail to unmarshal result, %v", err) - } - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/version.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/version.go deleted file mode 100644 index 37ab6a63873b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base/version.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -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 base - -const SDKName = "volc-sdk-golang" - -const SDKVersion = "v1.0.82" diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/config.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/config.go deleted file mode 100644 index e1ef66244236..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/config.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -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 sts - -import ( - "net/http" - "net/url" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base" -) - -const ( - DefaultRegion = "cn-north-1" - ServiceVersion20180101 = "2018-01-01" - ServiceName = "sts" -) - -var ( - ServiceInfo = &base.ServiceInfo{ - Timeout: 5 * time.Second, - Host: "open.volcengineapi.com", - Header: http.Header{ - "Accept": []string{"application/json"}, - }, - } - - ApiInfoList = map[string]*base.ApiInfo{ - "AssumeRole": { - Method: http.MethodGet, - Path: "/", - Query: url.Values{ - "Action": []string{"AssumeRole"}, - "Version": []string{ServiceVersion20180101}, - }, - }, - } -) - -// DefaultInstance 默认的实例 -var DefaultInstance = NewInstance() - -// IAM . -type STS struct { - Client *base.Client -} - -// NewInstance 创建一个实例 -func NewInstance() *STS { - instance := &STS{} - instance.Client = base.NewClient(ServiceInfo, ApiInfoList) - instance.Client.ServiceInfo.Credentials.Service = ServiceName - instance.Client.ServiceInfo.Credentials.Region = DefaultRegion - return instance -} - -// GetServiceInfo interface -func (p *STS) GetServiceInfo() *base.ServiceInfo { - return p.Client.ServiceInfo -} - -// GetAPIInfo interface -func (p *STS) GetAPIInfo(api string) *base.ApiInfo { - if apiInfo, ok := ApiInfoList[api]; ok { - return apiInfo - } - return nil -} - -// SetHost . -func (p *STS) SetRegion(region string) { - p.Client.ServiceInfo.Credentials.Region = region -} - -// SetHost . -func (p *STS) SetHost(host string) { - p.Client.ServiceInfo.Host = host -} - -// SetSchema . -func (p *STS) SetSchema(schema string) { - p.Client.ServiceInfo.Scheme = schema -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/model.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/model.go deleted file mode 100644 index 2c3a8422702d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/model.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -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 sts - -import "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base" - -// AssumeRole -type AssumeRoleResp struct { - ResponseMetadata base.ResponseMetadata - Result *AssumeRoleResult `json:",omitempty"` -} - -type AssumeRoleResult struct { - Credentials *Credentials - AssumedRoleUser *AssumeRoleUser -} - -type AssumeRoleRequest struct { - DurationSeconds int - Policy string - RoleTrn string - RoleSessionName string -} - -type AssumeRoleUser struct { - Trn string - AssumedRoleId string -} - -type Credentials struct { - CurrentTime string - ExpiredTime string - AccessKeyId string - SecretAccessKey string - SessionToken string -} - -// AssumeRole diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/wrapper.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/wrapper.go deleted file mode 100644 index a83d9243e543..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/wrapper.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -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 sts - -import ( - "encoding/json" - "net/url" - "strconv" -) - -func (p *STS) commonHandler(api string, query url.Values, resp interface{}) (int, error) { - respBody, statusCode, err := p.Client.Query(api, query) - if err != nil { - return statusCode, err - } - - if err := json.Unmarshal(respBody, resp); err != nil { - return statusCode, err - } - return statusCode, nil -} - -func (p *STS) AssumeRole(req *AssumeRoleRequest) (*AssumeRoleResp, int, error) { - query := url.Values{} - resp := new(AssumeRoleResp) - - if req.DurationSeconds > 0 { - query.Set("DurationSeconds", strconv.Itoa(req.DurationSeconds)) - } - - if req.Policy != "" { - query.Set("Policy", req.Policy) - } - - query.Set("RoleTrn", req.RoleTrn) - query.Set("RoleSessionName", req.RoleSessionName) - - statusCode, err := p.commonHandler("AssumeRole", query, resp) - if err != nil { - return nil, statusCode, err - } - return resp, statusCode, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/wrapper_test.go b/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/wrapper_test.go deleted file mode 100644 index 47e0a46339ac..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts/wrapper_test.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 sts - -import ( - "encoding/json" - "fmt" - "testing" -) - -const ( - testAk = "testAK" - testSk = "testSK" -) - -func TestIAM_AssumeRole(t *testing.T) { - DefaultInstance.Client.SetAccessKey(testAk) - DefaultInstance.Client.SetSecretKey(testSk) - - req := &AssumeRoleRequest{ - DurationSeconds: 7200, - Policy: "", - RoleTrn: "testRoleTrn", - RoleSessionName: "test", - } - - list, status, err := DefaultInstance.AssumeRole(req) - fmt.Println(status, err) - b, _ := json.Marshal(list) - fmt.Println(string(b)) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ast.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ast.go deleted file mode 100644 index 1fcee0c636fe..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ast.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// ASTKind represents different states in the parse table -// and the type of AST that is being constructed -type ASTKind int - -// ASTKind* is used in the parse table to transition between -// the different states -const ( - ASTKindNone = ASTKind(iota) - ASTKindStart - ASTKindExpr - ASTKindEqualExpr - ASTKindStatement - ASTKindSkipStatement - ASTKindExprStatement - ASTKindSectionStatement - ASTKindNestedSectionStatement - ASTKindCompletedNestedSectionStatement - ASTKindCommentStatement - ASTKindCompletedSectionStatement -) - -func (k ASTKind) String() string { - switch k { - case ASTKindNone: - return "none" - case ASTKindStart: - return "start" - case ASTKindExpr: - return "expr" - case ASTKindStatement: - return "stmt" - case ASTKindSectionStatement: - return "section_stmt" - case ASTKindExprStatement: - return "expr_stmt" - case ASTKindCommentStatement: - return "comment" - case ASTKindNestedSectionStatement: - return "nested_section_stmt" - case ASTKindCompletedSectionStatement: - return "completed_stmt" - case ASTKindSkipStatement: - return "skip" - default: - return "" - } -} - -// AST interface allows us to determine what kind of node we -// are on and casting may not need to be necessary. -// -// The root is always the first node in Children -type AST struct { - Kind ASTKind - Root Token - RootToken bool - Children []AST -} - -func newAST(kind ASTKind, root AST, children ...AST) AST { - return AST{ - Kind: kind, - Children: append([]AST{root}, children...), - } -} - -func newASTWithRootToken(kind ASTKind, root Token, children ...AST) AST { - return AST{ - Kind: kind, - Root: root, - RootToken: true, - Children: children, - } -} - -// AppendChild will append to the list of children an AST has. -func (a *AST) AppendChild(child AST) { - a.Children = append(a.Children, child) -} - -// GetRoot will return the root AST which can be the first entry -// in the children list or a token. -func (a *AST) GetRoot() AST { - if a.RootToken { - return *a - } - - if len(a.Children) == 0 { - return AST{} - } - - return a.Children[0] -} - -// GetChildren will return the current AST's list of children -func (a *AST) GetChildren() []AST { - if len(a.Children) == 0 { - return []AST{} - } - - if a.RootToken { - return a.Children - } - - return a.Children[1:] -} - -// SetChildren will set and override all children of the AST. -func (a *AST) SetChildren(children []AST) { - if a.RootToken { - a.Children = children - } else { - a.Children = append(a.Children[:1], children...) - } -} - -// Start is used to indicate the starting state of the parse table. -var Start = newAST(ASTKindStart, AST{}) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/comma_token.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/comma_token.go deleted file mode 100644 index 573650e9adac..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/comma_token.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -var commaRunes = []rune(",") - -func isComma(b rune) bool { - return b == ',' -} - -func newCommaToken() Token { - return newToken(TokenComma, commaRunes, NoneType) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/comment_token.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/comment_token.go deleted file mode 100644 index f6fe914b2bd7..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/comment_token.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// isComment will return whether or not the next byte(s) is a -// comment. -func isComment(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case ';': - return true - case '#': - return true - } - - return false -} - -// newCommentToken will create a comment token and -// return how many bytes were read. -func newCommentToken(b []rune) (Token, int, error) { - i := 0 - for ; i < len(b); i++ { - if b[i] == '\n' { - break - } - - if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' { - break - } - } - - return newToken(TokenComment, b[:i], NoneType), i, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/empty_token.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/empty_token.go deleted file mode 100644 index 5c2f1794d1f8..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/empty_token.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// emptyToken is used to satisfy the Token interface -var emptyToken = newToken(TokenNone, []rune{}, NoneType) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/expression.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/expression.go deleted file mode 100644 index 0b905c53b6e2..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/expression.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// newExpression will return an expression AST. -// Expr represents an expression -// -// grammar: -// expr -> string | number -func newExpression(tok Token) AST { - return newASTWithRootToken(ASTKindExpr, tok) -} - -func newEqualExpr(left AST, tok Token) AST { - return newASTWithRootToken(ASTKindEqualExpr, tok, left) -} - -// EqualExprKey will return a LHS value in the equal expr -func EqualExprKey(ast AST) string { - children := ast.GetChildren() - if len(children) == 0 || ast.Kind != ASTKindEqualExpr { - return "" - } - - return string(children[0].Root.Raw()) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/fuzz.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/fuzz.go deleted file mode 100644 index 4983fcdf2563..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/fuzz.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" -) - -func Fuzz(data []byte) int { - b := bytes.NewReader(data) - - if _, err := Parse(b); err != nil { - return 0 - } - - return 1 -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini.go deleted file mode 100644 index a1b01ed4390d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "io" - "os" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// OpenFile takes a path to a given file, and will open and parse -// that file. -func OpenFile(path string) (Sections, error) { - f, err := os.Open(path) - if err != nil { - return Sections{}, volcengineerr.New(ErrCodeUnableToReadFile, "unable to open file", err) - } - defer f.Close() - - return Parse(f) -} - -// Parse will parse the given file using the shared config -// visitor. -func Parse(f io.Reader) (Sections, error) { - tree, err := ParseAST(f) - if err != nil { - return Sections{}, err - } - - v := NewDefaultVisitor() - if err = Walk(tree, v); err != nil { - return Sections{}, err - } - - return v.Sections, nil -} - -// ParseBytes will parse the given bytes and return the parsed sections. -func ParseBytes(b []byte) (Sections, error) { - tree, err := ParseASTBytes(b) - if err != nil { - return Sections{}, err - } - - v := NewDefaultVisitor() - if err = Walk(tree, v); err != nil { - return Sections{}, err - } - - return v.Sections, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini_lexer.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini_lexer.go deleted file mode 100644 index ce1c04877f74..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini_lexer.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "io" - "io/ioutil" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -const ( - // ErrCodeUnableToReadFile is used when a file is failed to be - // opened or read from. - ErrCodeUnableToReadFile = "FailedRead" -) - -// TokenType represents the various different tokens types -type TokenType int - -func (t TokenType) String() string { - switch t { - case TokenNone: - return "none" - case TokenLit: - return "literal" - case TokenSep: - return "sep" - case TokenOp: - return "op" - case TokenWS: - return "ws" - case TokenNL: - return "newline" - case TokenComment: - return "comment" - case TokenComma: - return "comma" - default: - return "" - } -} - -// TokenType enums -const ( - TokenNone = TokenType(iota) - TokenLit - TokenSep - TokenComma - TokenOp - TokenWS - TokenNL - TokenComment -) - -type iniLexer struct{} - -// Tokenize will return a list of tokens during lexical analysis of the -// io.Reader. -func (l *iniLexer) Tokenize(r io.Reader) ([]Token, error) { - b, err := ioutil.ReadAll(r) - if err != nil { - return nil, volcengineerr.New(ErrCodeUnableToReadFile, "unable to read file", err) - } - - return l.tokenize(b) -} - -func (l *iniLexer) tokenize(b []byte) ([]Token, error) { - runes := bytes.Runes(b) - var err error - n := 0 - tokenAmount := countTokens(runes) - tokens := make([]Token, tokenAmount) - count := 0 - - for len(runes) > 0 && count < tokenAmount { - switch { - case isWhitespace(runes[0]): - tokens[count], n, err = newWSToken(runes) - case isComma(runes[0]): - tokens[count], n = newCommaToken(), 1 - case isComment(runes): - tokens[count], n, err = newCommentToken(runes) - case isNewline(runes): - tokens[count], n, err = newNewlineToken(runes) - case isSep(runes): - tokens[count], n, err = newSepToken(runes) - case isOp(runes): - tokens[count], n, err = newOpToken(runes) - default: - tokens[count], n, err = newLitToken(runes) - } - - if err != nil { - return nil, err - } - - count++ - - runes = runes[n:] - } - - return tokens[:count], nil -} - -func countTokens(runes []rune) int { - count, n := 0, 0 - var err error - - for len(runes) > 0 { - switch { - case isWhitespace(runes[0]): - _, n, err = newWSToken(runes) - case isComma(runes[0]): - _, n = newCommaToken(), 1 - case isComment(runes): - _, n, err = newCommentToken(runes) - case isNewline(runes): - _, n, err = newNewlineToken(runes) - case isSep(runes): - _, n, err = newSepToken(runes) - case isOp(runes): - _, n, err = newOpToken(runes) - default: - _, n, err = newLitToken(runes) - } - - if err != nil { - return 0 - } - - count++ - runes = runes[n:] - } - - return count + 1 -} - -// Token indicates a metadata about a given value. -type Token struct { - t TokenType - ValueType ValueType - base int - raw []rune -} - -var emptyValue = Value{} - -func newToken(t TokenType, raw []rune, v ValueType) Token { - return Token{ - t: t, - raw: raw, - ValueType: v, - } -} - -// Raw return the raw runes that were consumed -func (tok Token) Raw() []rune { - return tok.raw -} - -// Type returns the token type -func (tok Token) Type() TokenType { - return tok.t -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini_parser.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini_parser.go deleted file mode 100644 index 792076f674b0..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ini_parser.go +++ /dev/null @@ -1,359 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "io" -) - -// ParseState represents the current state of the parser. -type ParseState uint - -// State enums for the parse table -const ( - InvalidState = iota - // StatementState stmt -> value stmt' - StatementState - // StatementPrimeState stmt' -> MarkComplete | op stmt - StatementPrimeState - // ValueState value -> number | string | boolean | quoted_string - ValueState - // OpenScopeState section -> [ section' - OpenScopeState - // SectionState section' -> value section_close - SectionState - // CloseScopeState section_close -> ] - CloseScopeState - // SkipState will skip (NL WS)+ - SkipState - // SkipTokenState will skip any token and push the previous - // state onto the stack. - SkipTokenState - // CommentState comment -> # comment' | ; comment' - // comment' -> MarkComplete | value - CommentState - // MarkCompleteState MarkComplete state will complete statements and move that - // to the completed AST list - MarkCompleteState - // TerminalState signifies that the tokens have been fully parsed - TerminalState -) - -// parseTable is a state machine to dictate the grammar above. -var parseTable = map[ASTKind]map[TokenType]int{ - ASTKindStart: { - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: TerminalState, - }, - ASTKindCommentStatement: { - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindExpr: { - TokenOp: StatementPrimeState, - TokenLit: ValueState, - TokenSep: OpenScopeState, - TokenWS: ValueState, - TokenNL: SkipState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindEqualExpr: { - TokenLit: ValueState, - TokenWS: SkipTokenState, - TokenNL: SkipState, - }, - ASTKindStatement: { - TokenLit: SectionState, - TokenSep: CloseScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindExprStatement: { - TokenLit: ValueState, - TokenSep: ValueState, - TokenOp: ValueState, - TokenWS: ValueState, - TokenNL: MarkCompleteState, - TokenComment: CommentState, - TokenNone: TerminalState, - TokenComma: SkipState, - }, - ASTKindSectionStatement: { - TokenLit: SectionState, - TokenOp: SectionState, - TokenSep: CloseScopeState, - TokenWS: SectionState, - TokenNL: SkipTokenState, - }, - ASTKindCompletedSectionStatement: { - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenComment: CommentState, - TokenNone: MarkCompleteState, - }, - ASTKindSkipStatement: { - TokenLit: StatementState, - TokenSep: OpenScopeState, - TokenWS: SkipTokenState, - TokenNL: SkipTokenState, - TokenComment: CommentState, - TokenNone: TerminalState, - }, -} - -// ParseAST will parse input from an io.Reader using -// an LL(1) parser. -func ParseAST(r io.Reader) ([]AST, error) { - lexer := iniLexer{} - tokens, err := lexer.Tokenize(r) - if err != nil { - return []AST{}, err - } - - return parse(tokens) -} - -// ParseASTBytes will parse input from a byte slice using -// an LL(1) parser. -func ParseASTBytes(b []byte) ([]AST, error) { - lexer := iniLexer{} - tokens, err := lexer.tokenize(b) - if err != nil { - return []AST{}, err - } - - return parse(tokens) -} - -func parse(tokens []Token) ([]AST, error) { - start := Start - stack := newParseStack(3, len(tokens)) - - stack.Push(start) - s := newSkipper() - -loop: - for stack.Len() > 0 { - k := stack.Pop() - - var tok Token - if len(tokens) == 0 { - // this occurs when all the tokens have been processed - // but reduction of what's left on the stack needs to - // occur. - tok = emptyToken - } else { - tok = tokens[0] - } - - step := parseTable[k.Kind][tok.Type()] - if s.ShouldSkip(tok) { - // being in a skip state with no tokens will break out of - // the parse loop since there is nothing left to process. - if len(tokens) == 0 { - break loop - } - - step = SkipTokenState - } - - switch step { - case TerminalState: - // Finished parsing. Push what should be the last - // statement to the stack. If there is anything left - // on the stack, an error in parsing has occurred. - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - break loop - case SkipTokenState: - // When skipping a token, the previous state was popped off the stack. - // To maintain the correct state, the previous state will be pushed - // onto the stack. - stack.Push(k) - case StatementState: - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - expr := newExpression(tok) - stack.Push(expr) - case StatementPrimeState: - if tok.Type() != TokenOp { - stack.MarkComplete(k) - continue - } - - if k.Kind != ASTKindExpr { - return nil, NewParseError( - fmt.Sprintf("invalid expression: expected Expr type, but found %T type", k), - ) - } - - k = trimSpaces(k) - expr := newEqualExpr(k, tok) - stack.Push(expr) - case ValueState: - // ValueState requires the previous state to either be an equal expression - // or an expression statement. - switch k.Kind { - case ASTKindEqualExpr: - // assiging a value to some key - k.AppendChild(newExpression(tok)) - stack.Push(newExprStatement(k)) - case ASTKindExpr: - k.Root.raw = append(k.Root.raw, tok.Raw()...) - stack.Push(k) - case ASTKindExprStatement: - root := k.GetRoot() - children := root.GetChildren() - if len(children) == 0 { - return nil, NewParseError( - fmt.Sprintf("invalid expression: AST contains no children %s", k.Kind), - ) - } - - rhs := children[len(children)-1] - - if rhs.Root.ValueType != QuotedStringType { - rhs.Root.ValueType = StringType - rhs.Root.raw = append(rhs.Root.raw, tok.Raw()...) - - } - - children[len(children)-1] = rhs - root.SetChildren(children) - - stack.Push(k) - } - case OpenScopeState: - if !runeCompare(tok.Raw(), openBrace) { - return nil, NewParseError("expected '['") - } - - stmt := newStatement() - stack.Push(stmt) - case CloseScopeState: - if !runeCompare(tok.Raw(), closeBrace) { - return nil, NewParseError("expected ']'") - } - - k = trimSpaces(k) - stack.Push(newCompletedSectionStatement(k)) - case SectionState: - var stmt AST - - switch k.Kind { - case ASTKindStatement: - // If there are multiple literals inside of a scope declaration, - // then the current token's raw value will be appended to the Name. - // - // This handles cases like [ profile default ] - // - // k will represent a SectionStatement with the children representing - // the label of the section - stmt = newSectionStatement(tok) - case ASTKindSectionStatement: - k.Root.raw = append(k.Root.raw, tok.Raw()...) - stmt = k - default: - return nil, NewParseError( - fmt.Sprintf("invalid statement: expected statement: %v", k.Kind), - ) - } - - stack.Push(stmt) - case MarkCompleteState: - if k.Kind != ASTKindStart { - stack.MarkComplete(k) - } - - if stack.Len() == 0 { - stack.Push(start) - } - case SkipState: - stack.Push(newSkipStatement(k)) - s.Skip() - case CommentState: - if k.Kind == ASTKindStart { - stack.Push(k) - } else { - stack.MarkComplete(k) - } - - stmt := newCommentStatement(tok) - stack.Push(stmt) - default: - return nil, NewParseError( - fmt.Sprintf("invalid state with ASTKind %v and TokenType %v", - k, tok.Type())) - } - - if len(tokens) > 0 { - tokens = tokens[1:] - } - } - - // this occurs when a statement has not been completed - if stack.top > 1 { - return nil, NewParseError(fmt.Sprintf("incomplete ini expression")) - } - - // returns a sublist which excludes the start symbol - return stack.List(), nil -} - -// trimSpaces will trim spaces on the left and right hand side of -// the literal. -func trimSpaces(k AST) AST { - // trim left hand side of spaces - for i := 0; i < len(k.Root.raw); i++ { - if !isWhitespace(k.Root.raw[i]) { - break - } - - k.Root.raw = k.Root.raw[1:] - i-- - } - - // trim right hand side of spaces - for i := len(k.Root.raw) - 1; i >= 0; i-- { - if !isWhitespace(k.Root.raw[i]) { - break - } - - k.Root.raw = k.Root.raw[:len(k.Root.raw)-1] - } - - return k -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/literal_tokens.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/literal_tokens.go deleted file mode 100644 index 1c2e9d977120..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/literal_tokens.go +++ /dev/null @@ -1,359 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "strconv" - "strings" - "unicode" -) - -var ( - runesTrue = []rune("true") - runesFalse = []rune("false") -) - -var literalValues = [][]rune{ - runesTrue, - runesFalse, -} - -func isBoolValue(b []rune) bool { - for _, lv := range literalValues { - if isCaselessLitValue(lv, b) { - return true - } - } - return false -} - -func isLitValue(want, have []rune) bool { - if len(have) < len(want) { - return false - } - - for i := 0; i < len(want); i++ { - if want[i] != have[i] { - return false - } - } - - return true -} - -// isCaselessLitValue is a caseless value comparison, assumes want is already lower-cased for efficiency. -func isCaselessLitValue(want, have []rune) bool { - if len(have) < len(want) { - return false - } - - for i := 0; i < len(want); i++ { - if want[i] != unicode.ToLower(have[i]) { - return false - } - } - - return true -} - -// isNumberValue will return whether not the leading characters in -// a byte slice is a number. A number is delimited by whitespace or -// the newline token. -// -// A number is defined to be in a binary, octal, decimal (int | float), hex format, -// or in scientific notation. -func isNumberValue(b []rune) bool { - negativeIndex := 0 - helper := numberHelper{} - needDigit := false - - for i := 0; i < len(b); i++ { - negativeIndex++ - - switch b[i] { - case '-': - if helper.IsNegative() || negativeIndex != 1 { - return false - } - helper.Determine(b[i]) - needDigit = true - continue - case 'e', 'E': - if err := helper.Determine(b[i]); err != nil { - return false - } - negativeIndex = 0 - needDigit = true - continue - case 'b': - if helper.numberFormat == hex { - break - } - fallthrough - case 'o', 'x': - needDigit = true - if i == 0 { - return false - } - - fallthrough - case '.': - if err := helper.Determine(b[i]); err != nil { - return false - } - needDigit = true - continue - } - - if i > 0 && (isNewline(b[i:]) || isWhitespace(b[i])) { - return !needDigit - } - - if !helper.CorrectByte(b[i]) { - return false - } - needDigit = false - } - - return !needDigit -} - -func isValid(b []rune) (bool, int, error) { - if len(b) == 0 { - // TODO: should probably return an error - return false, 0, nil - } - - return isValidRune(b[0]), 1, nil -} - -func isValidRune(r rune) bool { - return r != ':' && r != '=' && r != '[' && r != ']' && r != ' ' && r != '\n' -} - -// ValueType is an enum that will signify what type -// the Value is -type ValueType int - -func (v ValueType) String() string { - switch v { - case NoneType: - return "NONE" - case DecimalType: - return "FLOAT" - case IntegerType: - return "INT" - case StringType: - return "STRING" - case BoolType: - return "BOOL" - } - - return "" -} - -// ValueType enums -const ( - NoneType = ValueType(iota) - DecimalType - IntegerType - StringType - QuotedStringType - BoolType -) - -// Value is a union container -type Value struct { - Type ValueType - raw []rune - - integer int64 - decimal float64 - boolean bool - str string -} - -func newValue(t ValueType, base int, raw []rune) (Value, error) { - v := Value{ - Type: t, - raw: raw, - } - var err error - - switch t { - case DecimalType: - v.decimal, err = strconv.ParseFloat(string(raw), 64) - case IntegerType: - if base != 10 { - raw = raw[2:] - } - - v.integer, err = strconv.ParseInt(string(raw), base, 64) - case StringType: - v.str = string(raw) - case QuotedStringType: - v.str = string(raw[1 : len(raw)-1]) - case BoolType: - v.boolean = isCaselessLitValue(runesTrue, v.raw) - } - - // issue 2253 - // - // if the value trying to be parsed is too large, then we will use - // the 'StringType' and raw value instead. - if nerr, ok := err.(*strconv.NumError); ok && nerr.Err == strconv.ErrRange { - v.Type = StringType - v.str = string(raw) - err = nil - } - - return v, err -} - -// Append will append values and change the type to a string -// type. -func (v *Value) Append(tok Token) { - r := tok.Raw() - if v.Type != QuotedStringType { - v.Type = StringType - r = tok.raw[1 : len(tok.raw)-1] - } - if tok.Type() != TokenLit { - v.raw = append(v.raw, tok.Raw()...) - } else { - v.raw = append(v.raw, r...) - } -} - -func (v Value) String() string { - switch v.Type { - case DecimalType: - return fmt.Sprintf("decimal: %f", v.decimal) - case IntegerType: - return fmt.Sprintf("integer: %d", v.integer) - case StringType: - return fmt.Sprintf("string: %s", string(v.raw)) - case QuotedStringType: - return fmt.Sprintf("quoted string: %s", string(v.raw)) - case BoolType: - return fmt.Sprintf("bool: %t", v.boolean) - default: - return "union not set" - } -} - -func newLitToken(b []rune) (Token, int, error) { - n := 0 - var err error - - token := Token{} - if b[0] == '"' { - n, err = getStringValue(b) - if err != nil { - return token, n, err - } - - token = newToken(TokenLit, b[:n], QuotedStringType) - } else if isNumberValue(b) { - var base int - base, n, err = getNumericalValue(b) - if err != nil { - return token, 0, err - } - - value := b[:n] - vType := IntegerType - if contains(value, '.') || hasExponent(value) { - vType = DecimalType - } - token = newToken(TokenLit, value, vType) - token.base = base - } else if isBoolValue(b) { - n, err = getBoolValue(b) - - token = newToken(TokenLit, b[:n], BoolType) - } else { - n, err = getValue(b) - token = newToken(TokenLit, b[:n], StringType) - } - - return token, n, err -} - -// IntValue returns an integer value -func (v Value) IntValue() int64 { - return v.integer -} - -// FloatValue returns a float value -func (v Value) FloatValue() float64 { - return v.decimal -} - -// BoolValue returns a bool value -func (v Value) BoolValue() bool { - return v.boolean -} - -func isTrimmable(r rune) bool { - switch r { - case '\n', ' ': - return true - } - return false -} - -// StringValue returns the string value -func (v Value) StringValue() string { - switch v.Type { - case StringType: - return strings.TrimFunc(string(v.raw), isTrimmable) - case QuotedStringType: - // preserve all characters in the quotes - return string(removeEscapedCharacters(v.raw[1 : len(v.raw)-1])) - default: - return strings.TrimFunc(string(v.raw), isTrimmable) - } -} - -func contains(runes []rune, c rune) bool { - for i := 0; i < len(runes); i++ { - if runes[i] == c { - return true - } - } - - return false -} - -func runeCompare(v1 []rune, v2 []rune) bool { - if len(v1) != len(v2) { - return false - } - - for i := 0; i < len(v1); i++ { - if v1[i] != v2[i] { - return false - } - } - - return true -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/newline_token.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/newline_token.go deleted file mode 100644 index 1d5eec124a66..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/newline_token.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -func isNewline(b []rune) bool { - if len(b) == 0 { - return false - } - - if b[0] == '\n' { - return true - } - - if len(b) < 2 { - return false - } - - return b[0] == '\r' && b[1] == '\n' -} - -func newNewlineToken(b []rune) (Token, int, error) { - i := 1 - if b[0] == '\r' && isNewline(b[1:]) { - i++ - } - - if !isNewline([]rune(b[:i])) { - return emptyToken, 0, NewParseError("invalid new line token") - } - - return newToken(TokenNL, b[:i], NoneType), i, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/number_helper.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/number_helper.go deleted file mode 100644 index d4552c56fdef..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/number_helper.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "fmt" - "strconv" -) - -const ( - none = numberFormat(iota) - binary - octal - decimal - hex - exponent -) - -type numberFormat int - -// numberHelper is used to dictate what format a number is in -// and what to do for negative values. Since -1e-4 is a valid -// number, we cannot just simply check for duplicate negatives. -type numberHelper struct { - numberFormat numberFormat - - negative bool - negativeExponent bool -} - -func (b numberHelper) Exists() bool { - return b.numberFormat != none -} - -func (b numberHelper) IsNegative() bool { - return b.negative || b.negativeExponent -} - -func (b *numberHelper) Determine(c rune) error { - if b.Exists() { - return NewParseError(fmt.Sprintf("multiple number formats: 0%v", string(c))) - } - - switch c { - case 'b': - b.numberFormat = binary - case 'o': - b.numberFormat = octal - case 'x': - b.numberFormat = hex - case 'e', 'E': - b.numberFormat = exponent - case '-': - if b.numberFormat != exponent { - b.negative = true - } else { - b.negativeExponent = true - } - case '.': - b.numberFormat = decimal - default: - return NewParseError(fmt.Sprintf("invalid number character: %v", string(c))) - } - - return nil -} - -func (b numberHelper) CorrectByte(c rune) bool { - switch { - case b.numberFormat == binary: - if !isBinaryByte(c) { - return false - } - case b.numberFormat == octal: - if !isOctalByte(c) { - return false - } - case b.numberFormat == hex: - if !isHexByte(c) { - return false - } - case b.numberFormat == decimal: - if !isDigit(c) { - return false - } - case b.numberFormat == exponent: - if !isDigit(c) { - return false - } - case b.negativeExponent: - if !isDigit(c) { - return false - } - case b.negative: - if !isDigit(c) { - return false - } - default: - if !isDigit(c) { - return false - } - } - - return true -} - -func (b numberHelper) Base() int { - switch b.numberFormat { - case binary: - return 2 - case octal: - return 8 - case hex: - return 16 - default: - return 10 - } -} - -func (b numberHelper) String() string { - buf := bytes.Buffer{} - i := 0 - - switch b.numberFormat { - case binary: - i++ - buf.WriteString(strconv.Itoa(i) + ": binary format\n") - case octal: - i++ - buf.WriteString(strconv.Itoa(i) + ": octal format\n") - case hex: - i++ - buf.WriteString(strconv.Itoa(i) + ": hex format\n") - case exponent: - i++ - buf.WriteString(strconv.Itoa(i) + ": exponent format\n") - default: - i++ - buf.WriteString(strconv.Itoa(i) + ": integer format\n") - } - - if b.negative { - i++ - buf.WriteString(strconv.Itoa(i) + ": negative format\n") - } - - if b.negativeExponent { - i++ - buf.WriteString(strconv.Itoa(i) + ": negative exponent format\n") - } - - return buf.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/op_tokens.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/op_tokens.go deleted file mode 100644 index 9b026d62feb1..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/op_tokens.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" -) - -var ( - equalOp = []rune("=") - equalColonOp = []rune(":") -) - -func isOp(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case '=': - return true - case ':': - return true - default: - return false - } -} - -func newOpToken(b []rune) (Token, int, error) { - tok := Token{} - - switch b[0] { - case '=': - tok = newToken(TokenOp, equalOp, NoneType) - case ':': - tok = newToken(TokenOp, equalColonOp, NoneType) - default: - return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0])) - } - return tok, 1, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/parse_error.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/parse_error.go deleted file mode 100644 index a3a34a1dcaa1..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/parse_error.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "fmt" - -const ( - // ErrCodeParseError is returned when a parsing error - // has occurred. - ErrCodeParseError = "INIParseError" -) - -// ParseError is an error which is returned during any part of -// the parsing process. -type ParseError struct { - msg string -} - -// NewParseError will return a new ParseError where message -// is the description of the error. -func NewParseError(message string) *ParseError { - return &ParseError{ - msg: message, - } -} - -// Code will return the ErrCodeParseError -func (err *ParseError) Code() string { - return ErrCodeParseError -} - -// Message returns the error's message -func (err *ParseError) Message() string { - return err.msg -} - -// OrigError return nothing since there will never be any -// original error. -func (err *ParseError) OrigError() error { - return nil -} - -func (err *ParseError) Error() string { - return fmt.Sprintf("%s: %s", err.Code(), err.Message()) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/parse_stack.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/parse_stack.go deleted file mode 100644 index 2c7071b7b689..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/parse_stack.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "fmt" -) - -// ParseStack is a stack that contains a container, the stack portion, -// and the list which is the list of ASTs that have been successfully -// parsed. -type ParseStack struct { - top int - container []AST - list []AST - index int -} - -func newParseStack(sizeContainer, sizeList int) ParseStack { - return ParseStack{ - container: make([]AST, sizeContainer), - list: make([]AST, sizeList), - } -} - -// Pop will return and truncate the last container element. -func (s *ParseStack) Pop() AST { - s.top-- - return s.container[s.top] -} - -// Push will add the new AST to the container -func (s *ParseStack) Push(ast AST) { - s.container[s.top] = ast - s.top++ -} - -// MarkComplete will append the AST to the list of completed statements -func (s *ParseStack) MarkComplete(ast AST) { - s.list[s.index] = ast - s.index++ -} - -// List will return the completed statements -func (s ParseStack) List() []AST { - return s.list[:s.index] -} - -// Len will return the length of the container -func (s *ParseStack) Len() int { - return s.top -} - -func (s ParseStack) String() string { - buf := bytes.Buffer{} - for i, node := range s.list { - buf.WriteString(fmt.Sprintf("%d: %v\n", i+1, node)) - } - - return buf.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/sep_tokens.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/sep_tokens.go deleted file mode 100644 index 221a68789e55..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/sep_tokens.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" -) - -var ( - emptyRunes = []rune{} -) - -func isSep(b []rune) bool { - if len(b) == 0 { - return false - } - - switch b[0] { - case '[', ']': - return true - default: - return false - } -} - -var ( - openBrace = []rune("[") - closeBrace = []rune("]") -) - -func newSepToken(b []rune) (Token, int, error) { - tok := Token{} - - switch b[0] { - case '[': - tok = newToken(TokenSep, openBrace, NoneType) - case ']': - tok = newToken(TokenSep, closeBrace, NoneType) - default: - return tok, 0, NewParseError(fmt.Sprintf("unexpected sep type, %v", b[0])) - } - return tok, 1, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/skipper.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/skipper.go deleted file mode 100644 index eb08e0167c9c..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/skipper.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// skipper is used to skip certain blocks of an ini file. -// Currently skipper is used to skip nested blocks of ini -// files. See example below -// -// [ foo ] -// nested = ; this section will be skipped -// a=b -// c=d -// bar=baz ; this will be included -type skipper struct { - shouldSkip bool - TokenSet bool - prevTok Token -} - -func newSkipper() skipper { - return skipper{ - prevTok: emptyToken, - } -} - -func (s *skipper) ShouldSkip(tok Token) bool { - if s.shouldSkip && - s.prevTok.Type() == TokenNL && - tok.Type() != TokenWS { - - s.Continue() - return false - } - s.prevTok = tok - - return s.shouldSkip -} - -func (s *skipper) Skip() { - s.shouldSkip = true - s.prevTok = emptyToken -} - -func (s *skipper) Continue() { - s.shouldSkip = false - s.prevTok = emptyToken -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/statement.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/statement.go deleted file mode 100644 index 14ae44003574..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/statement.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// Statement is an empty AST mostly used for transitioning states. -func newStatement() AST { - return newAST(ASTKindStatement, AST{}) -} - -// SectionStatement represents a section AST -func newSectionStatement(tok Token) AST { - return newASTWithRootToken(ASTKindSectionStatement, tok) -} - -// ExprStatement represents a completed expression AST -func newExprStatement(ast AST) AST { - return newAST(ASTKindExprStatement, ast) -} - -// CommentStatement represents a comment in the ini definition. -// -// grammar: -// comment -> #comment' | ;comment' -// comment' -> epsilon | value -func newCommentStatement(tok Token) AST { - return newAST(ASTKindCommentStatement, newExpression(tok)) -} - -// CompletedSectionStatement represents a completed section -func newCompletedSectionStatement(ast AST) AST { - return newAST(ASTKindCompletedSectionStatement, ast) -} - -// SkipStatement is used to skip whole statements -func newSkipStatement(ast AST) AST { - return newAST(ASTKindSkipStatement, ast) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/value_util.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/value_util.go deleted file mode 100644 index fa545abcd14b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/value_util.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" -) - -// getStringValue will return a quoted string and the amount -// of bytes read -// -// an error will be returned if the string is not properly formatted -func getStringValue(b []rune) (int, error) { - if b[0] != '"' { - return 0, NewParseError("strings must start with '\"'") - } - - endQuote := false - i := 1 - - for ; i < len(b) && !endQuote; i++ { - if escaped := isEscaped(b[:i], b[i]); b[i] == '"' && !escaped { - endQuote = true - break - } else if escaped { - /*c, err := getEscapedByte(b[i]) - if err != nil { - return 0, err - } - - b[i-1] = c - b = append(b[:i], b[i+1:]...) - i--*/ - - continue - } - } - - if !endQuote { - return 0, NewParseError("missing '\"' in string value") - } - - return i + 1, nil -} - -// getBoolValue will return a boolean and the amount -// of bytes read -// -// an error will be returned if the boolean is not of a correct -// value -func getBoolValue(b []rune) (int, error) { - if len(b) < 4 { - return 0, NewParseError("invalid boolean value") - } - - n := 0 - for _, lv := range literalValues { - if len(lv) > len(b) { - continue - } - - if isCaselessLitValue(lv, b) { - n = len(lv) - } - } - - if n == 0 { - return 0, NewParseError("invalid boolean value") - } - - return n, nil -} - -// getNumericalValue will return a numerical string, the amount -// of bytes read, and the base of the number -// -// an error will be returned if the number is not of a correct -// value -func getNumericalValue(b []rune) (int, int, error) { - if !isDigit(b[0]) { - return 0, 0, NewParseError("invalid digit value") - } - - i := 0 - helper := numberHelper{} - -loop: - for negativeIndex := 0; i < len(b); i++ { - negativeIndex++ - - if !isDigit(b[i]) { - switch b[i] { - case '-': - if helper.IsNegative() || negativeIndex != 1 { - return 0, 0, NewParseError("parse error '-'") - } - - n := getNegativeNumber(b[i:]) - i += (n - 1) - helper.Determine(b[i]) - continue - case '.': - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - case 'e', 'E': - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - - negativeIndex = 0 - case 'b': - if helper.numberFormat == hex { - break - } - fallthrough - case 'o', 'x': - if i == 0 && b[i] != '0' { - return 0, 0, NewParseError("incorrect base format, expected leading '0'") - } - - if i != 1 { - return 0, 0, NewParseError(fmt.Sprintf("incorrect base format found %s at %d index", string(b[i]), i)) - } - - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - default: - if isWhitespace(b[i]) { - break loop - } - - if isNewline(b[i:]) { - break loop - } - - if !(helper.numberFormat == hex && isHexByte(b[i])) { - if i+2 < len(b) && !isNewline(b[i:i+2]) { - return 0, 0, NewParseError("invalid numerical character") - } else if !isNewline([]rune{b[i]}) { - return 0, 0, NewParseError("invalid numerical character") - } - - break loop - } - } - } - } - - return helper.Base(), i, nil -} - -// isDigit will return whether or not something is an integer -func isDigit(b rune) bool { - return b >= '0' && b <= '9' -} - -func hasExponent(v []rune) bool { - return contains(v, 'e') || contains(v, 'E') -} - -func isBinaryByte(b rune) bool { - switch b { - case '0', '1': - return true - default: - return false - } -} - -func isOctalByte(b rune) bool { - switch b { - case '0', '1', '2', '3', '4', '5', '6', '7': - return true - default: - return false - } -} - -func isHexByte(b rune) bool { - if isDigit(b) { - return true - } - return (b >= 'A' && b <= 'F') || - (b >= 'a' && b <= 'f') -} - -func getValue(b []rune) (int, error) { - i := 0 - - for i < len(b) { - if isNewline(b[i:]) { - break - } - - if isOp(b[i:]) { - break - } - - valid, n, err := isValid(b[i:]) - if err != nil { - return 0, err - } - - if !valid { - break - } - - i += n - } - - return i, nil -} - -// getNegativeNumber will return a negative number from a -// byte slice. This will iterate through all characters until -// a non-digit has been found. -func getNegativeNumber(b []rune) int { - if b[0] != '-' { - return 0 - } - - i := 1 - for ; i < len(b); i++ { - if !isDigit(b[i]) { - return i - } - } - - return i -} - -// isEscaped will return whether or not the character is an escaped -// character. -func isEscaped(value []rune, b rune) bool { - if len(value) == 0 { - return false - } - - switch b { - case '\'': // single quote - case '"': // quote - case 'n': // newline - case 't': // tab - case '\\': // backslash - default: - return false - } - - return value[len(value)-1] == '\\' -} - -func getEscapedByte(b rune) (rune, error) { - switch b { - case '\'': // single quote - return '\'', nil - case '"': // quote - return '"', nil - case 'n': // newline - return '\n', nil - case 't': // table - return '\t', nil - case '\\': // backslash - return '\\', nil - default: - return b, NewParseError(fmt.Sprintf("invalid escaped character %c", b)) - } -} - -func removeEscapedCharacters(b []rune) []rune { - for i := 0; i < len(b); i++ { - if isEscaped(b[:i], b[i]) { - c, err := getEscapedByte(b[i]) - if err != nil { - return b - } - - b[i-1] = c - b = append(b[:i], b[i+1:]...) - i-- - } - } - - return b -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/visitor.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/visitor.go deleted file mode 100644 index a87cc3c2b0dd..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/visitor.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "sort" -) - -// Visitor is an interface used by walkers that will -// traverse an array of ASTs. -type Visitor interface { - VisitExpr(AST) error - VisitStatement(AST) error -} - -// DefaultVisitor is used to visit statements and expressions -// and ensure that they are both of the correct format. -// In addition, upon visiting this will build sections and populate -// the Sections field which can be used to retrieve profile -// configuration. -type DefaultVisitor struct { - scope string - Sections Sections -} - -// NewDefaultVisitor return a DefaultVisitor -func NewDefaultVisitor() *DefaultVisitor { - return &DefaultVisitor{ - Sections: Sections{ - container: map[string]Section{}, - }, - } -} - -// VisitExpr visits expressions... -func (v *DefaultVisitor) VisitExpr(expr AST) error { - t := v.Sections.container[v.scope] - if t.values == nil { - t.values = values{} - } - - switch expr.Kind { - case ASTKindExprStatement: - opExpr := expr.GetRoot() - switch opExpr.Kind { - case ASTKindEqualExpr: - children := opExpr.GetChildren() - if len(children) <= 1 { - return NewParseError("unexpected token type") - } - - rhs := children[1] - - // The right-hand value side the equality expression is allowed to contain '[', ']', ':', '=' in the values. - // If the token is not either a literal or one of the token types that identifies those four additional - // tokens then error. - if !(rhs.Root.Type() == TokenLit || rhs.Root.Type() == TokenOp || rhs.Root.Type() == TokenSep) { - return NewParseError("unexpected token type") - } - - key := EqualExprKey(opExpr) - v, err := newValue(rhs.Root.ValueType, rhs.Root.base, rhs.Root.Raw()) - if err != nil { - return err - } - - t.values[key] = v - default: - return NewParseError(fmt.Sprintf("unsupported expression %v", expr)) - } - default: - return NewParseError(fmt.Sprintf("unsupported expression %v", expr)) - } - - v.Sections.container[v.scope] = t - return nil -} - -// VisitStatement visits statements... -func (v *DefaultVisitor) VisitStatement(stmt AST) error { - switch stmt.Kind { - case ASTKindCompletedSectionStatement: - child := stmt.GetRoot() - if child.Kind != ASTKindSectionStatement { - return NewParseError(fmt.Sprintf("unsupported child statement: %T", child)) - } - - name := string(child.Root.Raw()) - v.Sections.container[name] = Section{} - v.scope = name - default: - return NewParseError(fmt.Sprintf("unsupported statement: %s", stmt.Kind)) - } - - return nil -} - -// Sections is a map of Section structures that represent -// a configuration. -type Sections struct { - container map[string]Section -} - -// GetSection will return section p. If section p does not exist, -// false will be returned in the second parameter. -func (t Sections) GetSection(p string) (Section, bool) { - v, ok := t.container[p] - return v, ok -} - -// values represents a map of union values. -type values map[string]Value - -// List will return a list of all sections that were successfully -// parsed. -func (t Sections) List() []string { - keys := make([]string, len(t.container)) - i := 0 - for k := range t.container { - keys[i] = k - i++ - } - - sort.Strings(keys) - return keys -} - -// Section contains a name and values. This represent -// a sectioned entry in a configuration file. -type Section struct { - Name string - values values -} - -// Has will return whether or not an entry exists in a given section -func (t Section) Has(k string) bool { - _, ok := t.values[k] - return ok -} - -// ValueType will returned what type the union is set to. If -// k was not found, the NoneType will be returned. -func (t Section) ValueType(k string) (ValueType, bool) { - v, ok := t.values[k] - return v.Type, ok -} - -// Bool returns a bool value at k -func (t Section) Bool(k string) bool { - return t.values[k].BoolValue() -} - -// Int returns an integer value at k -func (t Section) Int(k string) int64 { - return t.values[k].IntValue() -} - -// Float64 returns a float value at k -func (t Section) Float64(k string) float64 { - return t.values[k].FloatValue() -} - -// String returns the string value at k -func (t Section) String(k string) string { - _, ok := t.values[k] - if !ok { - return "" - } - return t.values[k].StringValue() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/walker.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/walker.go deleted file mode 100644 index dc1a4de08a91..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/walker.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// Walk will traverse the AST using the v, the Visitor. -func Walk(tree []AST, v Visitor) error { - for _, node := range tree { - switch node.Kind { - case ASTKindExpr, - ASTKindExprStatement: - - if err := v.VisitExpr(node); err != nil { - return err - } - case ASTKindStatement, - ASTKindCompletedSectionStatement, - ASTKindNestedSectionStatement, - ASTKindCompletedNestedSectionStatement: - - if err := v.VisitStatement(node); err != nil { - return err - } - } - } - - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ws_token.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ws_token.go deleted file mode 100644 index c891f775aecb..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini/ws_token.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -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 ini - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "unicode" -) - -// isWhitespace will return whether or not the character is -// a whitespace character. -// -// Whitespace is defined as a space or tab. -func isWhitespace(c rune) bool { - return unicode.IsSpace(c) && c != '\n' && c != '\r' -} - -func newWSToken(b []rune) (Token, int, error) { - i := 0 - for ; i < len(b); i++ { - if !isWhitespace(b[i]) { - break - } - } - - return newToken(TokenWS, b[:i], NoneType), i, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkio/byte.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkio/byte.go deleted file mode 100644 index f21e56003338..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkio/byte.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -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 sdkio - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "io" - -const ( - // Byte is 8 bits - Byte int64 = 1 - // KbByte (KiB) is 1024 Bytes - KbByte = Byte * 1024 - // MbByte (MiB) is 1024 KiB - MbByte = KbByte * 1024 - // GbByte (GiB) is 1024 MiB - GbByte = MbByte * 1024 -) - -const ( - SeekStart = io.SeekStart // seek relative to the origin of the file - SeekCurrent = io.SeekCurrent // seek relative to the current offset - SeekEnd = io.SeekEnd // seek relative to the end -) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkmath/floor_go.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkmath/floor_go.go deleted file mode 100644 index 3e8cad9a96f1..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkmath/floor_go.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -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 sdkmath - -import "math" - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// Copied from the Go standard library's (Go 1.12) math/floor.go for use in -// Go version prior to Go 1.10. -const ( - uvone = 0x3FF0000000000000 - mask = 0x7FF - shift = 64 - 11 - 1 - bias = 1023 - signMask = 1 << 63 - fracMask = 1<= 0.5 { - // return t + Copysign(1, x) - // } - // return t - // } - bits := math.Float64bits(x) - e := uint(bits>>shift) & mask - if e < bias { - // Round abs(x) < 1 including denormals. - bits &= signMask // +-0 - if e == bias-1 { - bits |= uvone // +-1 - } - } else if e < bias+shift { - // Round any abs(x) >= 1 containing a fractional component [0,1). - // - // Numbers with larger exponents are returned unchanged since they - // must be either an integer, infinity, or NaN. - const half = 1 << (shift - 1) - e -= bias - bits += half >> e - bits &^= fracMask >> e - } - return math.Float64frombits(bits) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkrand/locked_source.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkrand/locked_source.go deleted file mode 100644 index 85939be609e6..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkrand/locked_source.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -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 sdkrand - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "math/rand" - "sync" - "time" -) - -// lockedSource is a thread-safe implementation of rand.Source -type lockedSource struct { - lk sync.Mutex - src rand.Source -} - -func (r *lockedSource) Int63() (n int64) { - r.lk.Lock() - n = r.src.Int63() - r.lk.Unlock() - return -} - -func (r *lockedSource) Seed(seed int64) { - r.lk.Lock() - r.src.Seed(seed) - r.lk.Unlock() -} - -// SeededRand is a new RNG using a thread safe implementation of rand.Source -var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkrand/read.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkrand/read.go deleted file mode 100644 index 50803495f1e7..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkrand/read.go +++ /dev/null @@ -1,26 +0,0 @@ -/* -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 sdkrand - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "math/rand" - -func Read(r *rand.Rand, p []byte) (int, error) { - return r.Read(p) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/shareddefaults/shared_config.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/shareddefaults/shared_config.go deleted file mode 100644 index 80b094678800..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/shareddefaults/shared_config.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -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 shareddefaults - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "os" - "path/filepath" - "runtime" -) - -// SharedCredentialsFilename returns the SDK's default file path -// for the shared credentials file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.volcengine/credentials -// - Windows: %USERPROFILE%\.volcengine\credentials -func SharedCredentialsFilename() string { - return filepath.Join(UserHomeDir(), ".volcengine", "credentials") -} - -// SharedConfigFilename returns the SDK's default file path for -// the shared config file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.volcengine/config -// - Windows: %USERPROFILE%\.volcengine\config -func SharedConfigFilename() string { - return filepath.Join(UserHomeDir(), ".volcengine", "config") -} - -// UserHomeDir returns the home directory for the user the process is -// running under. -func UserHomeDir() string { - if runtime.GOOS == "windows" { // Windows - return os.Getenv("USERPROFILE") - } - - // *nix - return os.Getenv("HOME") -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/host.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/host.go deleted file mode 100644 index 71504d32b931..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/host.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -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 protocol - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "strings" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// ValidateEndpointHostHandler is a request handler that will validate the -// request endpoint's hosts is a valid RFC 3986 host. -var ValidateEndpointHostHandler = request.NamedHandler{ - Name: "volcenginesdk.protocol.ValidateEndpointHostHandler", - Fn: func(r *request.Request) { - err := ValidateEndpointHost(r.Operation.Name, r.HTTPRequest.URL.Host) - if err != nil { - r.Error = err - } - }, -} - -// ValidateEndpointHost validates that the host string passed in is a valid RFC -// 3986 host. Returns error if the host is not valid. -func ValidateEndpointHost(opName, host string) error { - paramErrs := request.ErrInvalidParams{Context: opName} - labels := strings.Split(host, ".") - - for i, label := range labels { - if i == len(labels)-1 && len(label) == 0 { - // Allow trailing dot for FQDN hosts. - continue - } - - if !ValidHostLabel(label) { - paramErrs.Add(request.NewErrParamFormat( - "endpoint host label", "[a-zA-Z0-9-]{1,63}", label)) - } - } - - if len(host) > 255 { - paramErrs.Add(request.NewErrParamMaxLen( - "endpoint host", 255, host, - )) - } - - if paramErrs.Len() > 0 { - return paramErrs - } - return nil -} - -// ValidHostLabel returns if the label is a valid RFC 3986 host label. -func ValidHostLabel(label string) bool { - if l := len(label); l == 0 || l > 63 { - return false - } - for _, r := range label { - switch { - case r >= '0' && r <= '9': - case r >= 'A' && r <= 'Z': - case r >= 'a' && r <= 'z': - case r == '-': - default: - return false - } - } - - return true -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/host_prefix.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/host_prefix.go deleted file mode 100644 index 6030c5937616..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/host_prefix.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -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 protocol - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "strings" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// HostPrefixHandlerName is the handler name for the host prefix request -// handler. -const HostPrefixHandlerName = "volcenginesdk.endpoint.HostPrefixHandler" - -// NewHostPrefixHandler constructs a build handler -func NewHostPrefixHandler(prefix string, labelsFn func() map[string]string) request.NamedHandler { - builder := HostPrefixBuilder{ - Prefix: prefix, - LabelsFn: labelsFn, - } - - return request.NamedHandler{ - Name: HostPrefixHandlerName, - Fn: builder.Build, - } -} - -// HostPrefixBuilder provides the request handler to expand and prepend -// the host prefix into the operation's request endpoint host. -type HostPrefixBuilder struct { - Prefix string - LabelsFn func() map[string]string -} - -// Build updates the passed in Request with the HostPrefix template expanded. -func (h HostPrefixBuilder) Build(r *request.Request) { - //if volcengine.BoolValue(r.Config.DisableEndpointHostPrefix) { - // return - //} - - var labels map[string]string - if h.LabelsFn != nil { - labels = h.LabelsFn() - } - - prefix := h.Prefix - for name, value := range labels { - prefix = strings.Replace(prefix, "{"+name+"}", value, -1) - } - - r.HTTPRequest.URL.Host = prefix + r.HTTPRequest.URL.Host - if len(r.HTTPRequest.Host) > 0 { - r.HTTPRequest.Host = prefix + r.HTTPRequest.Host - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/idempotency.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/idempotency.go deleted file mode 100644 index 0f1c0af3590d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/idempotency.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -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 protocol - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "crypto/rand" - "fmt" - "reflect" -) - -// RandReader is the random reader the protocol package will use to read -// random bytes from. This is exported for testing, and should not be used. -var RandReader = rand.Reader - -const idempotencyTokenFillTag = `idempotencyToken` - -// CanSetIdempotencyToken returns true if the struct field should be -// automatically populated with a Idempotency token. -// -// Only *string and string type fields that are tagged with idempotencyToken -// which are not already set can be auto filled. -func CanSetIdempotencyToken(v reflect.Value, f reflect.StructField) bool { - switch u := v.Interface().(type) { - // To auto fill an Idempotency token the field must be a string, - // tagged for auto fill, and have a zero value. - case *string: - return u == nil && len(f.Tag.Get(idempotencyTokenFillTag)) != 0 - case string: - return len(u) == 0 && len(f.Tag.Get(idempotencyTokenFillTag)) != 0 - } - - return false -} - -// GetIdempotencyToken returns a randomly generated idempotency token. -func GetIdempotencyToken() string { - b := make([]byte, 16) - RandReader.Read(b) - - return UUIDVersion4(b) -} - -// SetIdempotencyToken will set the value provided with a Idempotency Token. -// Given that the value can be set. Will panic if value is not setable. -func SetIdempotencyToken(v reflect.Value) { - if v.Kind() == reflect.Ptr { - if v.IsNil() && v.CanSet() { - v.Set(reflect.New(v.Type().Elem())) - } - v = v.Elem() - } - v = reflect.Indirect(v) - - if !v.CanSet() { - panic(fmt.Sprintf("unable to set idempotnecy token %v", v)) - } - - b := make([]byte, 16) - _, err := rand.Read(b) - if err != nil { - // TODO handle error - return - } - - v.Set(reflect.ValueOf(UUIDVersion4(b))) -} - -// UUIDVersion4 returns a Version 4 random UUID from the byte slice provided -func UUIDVersion4(u []byte) string { - // https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29 - // 13th character is "4" - u[6] = (u[6] | 0x40) & 0x4F - // 17th character is "8", "9", "a", or "b" - u[8] = (u[8] | 0x80) & 0xBF - - return fmt.Sprintf(`%X-%X-%X-%X-%X`, u[0:4], u[4:6], u[6:8], u[8:10], u[10:]) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/json/jsonutil/build.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/json/jsonutil/build.go deleted file mode 100644 index 9c7337d8b340..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/json/jsonutil/build.go +++ /dev/null @@ -1,317 +0,0 @@ -/* -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 jsonutil provides JSON serialization of VOLCSTACK requests and responses. -package jsonutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "math" - "reflect" - "sort" - "strconv" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" -) - -var timeType = reflect.ValueOf(time.Time{}).Type() -var byteSliceType = reflect.ValueOf([]byte{}).Type() - -// BuildJSON builds a JSON string for a given object v. -func BuildJSON(v interface{}) ([]byte, error) { - var buf bytes.Buffer - - err := buildAny(reflect.ValueOf(v), &buf, "") - return buf.Bytes(), err -} - -func buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - origVal := value - value = reflect.Indirect(value) - if !value.IsValid() { - return nil - } - - vtype := value.Type() - - t := tag.Get("type") - if t == "" { - switch vtype.Kind() { - case reflect.Struct: - // also it can't be a time object - if value.Type() != timeType { - t = "structure" - } - case reflect.Slice: - // also it can't be a byte slice - if _, ok := value.Interface().([]byte); !ok { - t = "list" - } - case reflect.Map: - // cannot be a JSONValue map - if _, ok := value.Interface().(volcengine.JSONValue); !ok { - t = "map" - } - } - } - - switch t { - case "structure": - if field, ok := vtype.FieldByName("_"); ok { - tag = field.Tag - } - return buildStruct(value, buf, tag) - case "list": - return buildList(value, buf, tag) - case "map": - return buildMap(value, buf, tag) - default: - return buildScalar(origVal, buf, tag) - } -} - -func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - if !value.IsValid() { - return nil - } - - // unwrap payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := value.Type().FieldByName(payload) - tag = field.Tag - value = elemOf(value.FieldByName(payload)) - if !value.IsValid() && tag.Get("type") != "structure" { - return nil - } - } - - buf.WriteByte('{') - defer buf.WriteString("}") - - if !value.IsValid() { - return nil - } - - t := value.Type() - first := true - for i := 0; i < t.NumField(); i++ { - member := value.Field(i) - - // This allocates the most memory. - // Additionally, we cannot skip nil fields due to - // idempotency auto filling. - field := t.Field(i) - - if field.PkgPath != "" { - continue // ignore unexported fields - } - if field.Tag.Get("json") == "-" { - continue - } - if field.Tag.Get("location") != "" { - continue // ignore non-volcenginebody elements - } - if field.Tag.Get("ignore") != "" { - continue - } - - if protocol.CanSetIdempotencyToken(member, field) { - token := protocol.GetIdempotencyToken() - member = reflect.ValueOf(&token) - } - - if (member.Kind() == reflect.Ptr || member.Kind() == reflect.Slice || member.Kind() == reflect.Map) && member.IsNil() { - continue // ignore unset fields - } - - if first { - first = false - } else { - buf.WriteByte(',') - } - - // figure out what this field is called - name := field.Name - if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - - writeString(name, buf) - buf.WriteString(`:`) - - err := buildAny(member, buf, field.Tag) - if err != nil { - return err - } - - } - - return nil -} - -func buildList(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - buf.WriteString("[") - - for i := 0; i < value.Len(); i++ { - buildAny(value.Index(i), buf, "") - - if i < value.Len()-1 { - buf.WriteString(",") - } - } - - buf.WriteString("]") - - return nil -} - -type sortedValues []reflect.Value - -func (sv sortedValues) Len() int { return len(sv) } -func (sv sortedValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv sortedValues) Less(i, j int) bool { return sv[i].String() < sv[j].String() } - -func buildMap(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - buf.WriteString("{") - - sv := sortedValues(value.MapKeys()) - sort.Sort(sv) - - for i, k := range sv { - if i > 0 { - buf.WriteByte(',') - } - - writeString(k.String(), buf) - buf.WriteString(`:`) - - buildAny(value.MapIndex(k), buf, "") - } - - buf.WriteString("}") - - return nil -} - -func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error { - // prevents allocation on the heap. - scratch := [64]byte{} - switch value := reflect.Indirect(v); value.Kind() { - case reflect.String: - writeString(value.String(), buf) - case reflect.Bool: - if value.Bool() { - buf.WriteString("true") - } else { - buf.WriteString("false") - } - case reflect.Int64: - buf.Write(strconv.AppendInt(scratch[:0], value.Int(), 10)) - case reflect.Float64: - f := value.Float() - if math.IsInf(f, 0) || math.IsNaN(f) { - return &json.UnsupportedValueError{Value: v, Str: strconv.FormatFloat(f, 'f', -1, 64)} - } - buf.Write(strconv.AppendFloat(scratch[:0], f, 'f', -1, 64)) - default: - switch converted := value.Interface().(type) { - case time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.UnixTimeFormatName - } - - ts := protocol.FormatTime(format, converted) - if format != protocol.UnixTimeFormatName { - ts = `"` + ts + `"` - } - - buf.WriteString(ts) - case []byte: - if !value.IsNil() { - buf.WriteByte('"') - if len(converted) < 1024 { - // for small buffers, using Encode directly is much faster. - dst := make([]byte, base64.StdEncoding.EncodedLen(len(converted))) - base64.StdEncoding.Encode(dst, converted) - buf.Write(dst) - } else { - // for large buffers, avoid unnecessary extra temporary - // buffer space. - enc := base64.NewEncoder(base64.StdEncoding, buf) - enc.Write(converted) - enc.Close() - } - buf.WriteByte('"') - } - case volcengine.JSONValue: - str, err := protocol.EncodeJSONValue(converted, protocol.QuotedEscape) - if err != nil { - return fmt.Errorf("unable to encode JSONValue, %v", err) - } - buf.WriteString(str) - default: - return fmt.Errorf("unsupported JSON value %v (%s)", value.Interface(), value.Type()) - } - } - return nil -} - -var hex = "0123456789abcdef" - -func writeString(s string, buf *bytes.Buffer) { - buf.WriteByte('"') - for i := 0; i < len(s); i++ { - if s[i] == '"' { - buf.WriteString(`\"`) - } else if s[i] == '\\' { - buf.WriteString(`\\`) - } else if s[i] == '\b' { - buf.WriteString(`\b`) - } else if s[i] == '\f' { - buf.WriteString(`\f`) - } else if s[i] == '\r' { - buf.WriteString(`\r`) - } else if s[i] == '\t' { - buf.WriteString(`\t`) - } else if s[i] == '\n' { - buf.WriteString(`\n`) - } else if s[i] < 32 { - buf.WriteString("\\u00") - buf.WriteByte(hex[s[i]>>4]) - buf.WriteByte(hex[s[i]&0xF]) - } else { - buf.WriteByte(s[i]) - } - } - buf.WriteByte('"') -} - -// Returns the reflection element of a value, if it is a pointer. -func elemOf(value reflect.Value) reflect.Value { - for value.Kind() == reflect.Ptr { - value = value.Elem() - } - return value -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/json/jsonutil/unmarshal.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/json/jsonutil/unmarshal.go deleted file mode 100644 index 201da81b0c54..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/json/jsonutil/unmarshal.go +++ /dev/null @@ -1,269 +0,0 @@ -/* -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 jsonutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "io" - "reflect" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// UnmarshalJSONError unmarshal's the reader's JSON document into the passed in -// type. The value to unmarshal the json document into must be a pointer to the -// type. -func UnmarshalJSONError(v interface{}, stream io.Reader) error { - var errBuf bytes.Buffer - body := io.TeeReader(stream, &errBuf) - - err := json.NewDecoder(body).Decode(v) - if err != nil { - msg := "failed decoding error message" - if err == io.EOF { - msg = "error message missing" - err = nil - } - return volcengineerr.NewUnmarshalError(err, msg, errBuf.Bytes()) - } - - return nil -} - -// UnmarshalJSON reads a stream and unmarshals the results in object v. -func UnmarshalJSON(v interface{}, stream io.Reader) error { - var out interface{} - - err := json.NewDecoder(stream).Decode(&out) - if err == io.EOF { - return nil - } else if err != nil { - return err - } - - return unmarshalAny(reflect.ValueOf(v), out, "") -} - -func unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag) error { - vtype := value.Type() - if vtype.Kind() == reflect.Ptr { - vtype = vtype.Elem() // check kind of actual element type - } - - t := tag.Get("type") - if t == "" { - switch vtype.Kind() { - case reflect.Struct: - // also it can't be a time object - if _, ok := value.Interface().(*time.Time); !ok { - t = "structure" - } - case reflect.Slice: - // also it can't be a byte slice - if _, ok := value.Interface().([]byte); !ok { - t = "list" - } - case reflect.Map: - // cannot be a JSONValue map - if _, ok := value.Interface().(volcengine.JSONValue); !ok { - t = "map" - } - } - } - - switch t { - case "structure": - if field, ok := vtype.FieldByName("_"); ok { - tag = field.Tag - } - return unmarshalStruct(value, data, tag) - case "list": - return unmarshalList(value, data, tag) - case "map": - return unmarshalMap(value, data, tag) - default: - return unmarshalScalar(value, data, tag) - } -} - -func unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - mapData, ok := data.(map[string]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a structure (%#v)", data) - } - - t := value.Type() - if value.Kind() == reflect.Ptr { - if value.IsNil() { // create the structure if it's nil - s := reflect.New(value.Type().Elem()) - value.Set(s) - value = s - } - - value = value.Elem() - t = t.Elem() - } - - // unwrap any payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := t.FieldByName(payload) - return unmarshalAny(value.FieldByName(payload), data, field.Tag) - } - - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - if field.PkgPath != "" { - continue // ignore unexported fields - } - - // figure out what this field is called - name := field.Name - if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - - member := value.FieldByIndex(field.Index) - err := unmarshalAny(member, mapData[name], field.Tag) - if err != nil { - return err - } - } - return nil -} - -func unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - listData, ok := data.([]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a list (%#v)", data) - } - - if value.IsNil() { - l := len(listData) - value.Set(reflect.MakeSlice(value.Type(), l, l)) - } - - for i, c := range listData { - err := unmarshalAny(value.Index(i), c, "") - if err != nil { - return err - } - } - - return nil -} - -func unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) error { - if data == nil { - return nil - } - mapData, ok := data.(map[string]interface{}) - if !ok { - return fmt.Errorf("JSON value is not a map (%#v)", data) - } - - if value.IsNil() { - value.Set(reflect.MakeMap(value.Type())) - } - - for k, v := range mapData { - kvalue := reflect.ValueOf(k) - vvalue := reflect.New(value.Type().Elem()).Elem() - - unmarshalAny(vvalue, v, "") - value.SetMapIndex(kvalue, vvalue) - } - - return nil -} - -func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error { - - switch d := data.(type) { - case nil: - return nil // nothing to do here - case string: - switch value.Interface().(type) { - case *string: - value.Set(reflect.ValueOf(&d)) - case []byte: - b, err := base64.StdEncoding.DecodeString(d) - if err != nil { - return err - } - value.Set(reflect.ValueOf(b)) - case *time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.ISO8601TimeFormatName - } - - t, err := protocol.ParseTime(format, d) - if err != nil { - return err - } - value.Set(reflect.ValueOf(&t)) - case volcengine.JSONValue: - // No need to use escaping as the value is a non-quoted string. - v, err := protocol.DecodeJSONValue(d, protocol.NoEscape) - if err != nil { - return err - } - value.Set(reflect.ValueOf(v)) - default: - return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) - } - case float64: - switch value.Interface().(type) { - case *int64: - di := int64(d) - value.Set(reflect.ValueOf(&di)) - case *float64: - value.Set(reflect.ValueOf(&d)) - case *time.Time: - // Time unmarshaled from a float64 can only be epoch seconds - t := time.Unix(int64(d), 0).UTC() - value.Set(reflect.ValueOf(&t)) - default: - return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) - } - case bool: - switch value.Interface().(type) { - case *bool: - value.Set(reflect.ValueOf(&d)) - default: - return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type()) - } - default: - return fmt.Errorf("unsupported JSON value (%v)", data) - } - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/jsonvalue.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/jsonvalue.go deleted file mode 100644 index 1a2a336dcc0b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/jsonvalue.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -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 protocol - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "strconv" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" -) - -// EscapeMode is the mode that should be use for escaping a value -type EscapeMode uint - -// The modes for escaping a value before it is marshaled, and unmarshaled. -const ( - NoEscape EscapeMode = iota - Base64Escape - QuotedEscape -) - -// EncodeJSONValue marshals the value into a JSON string, and optionally base64 -// encodes the string before returning it. -// -// Will panic if the escape mode is unknown. -func EncodeJSONValue(v volcengine.JSONValue, escape EscapeMode) (string, error) { - b, err := json.Marshal(v) - if err != nil { - return "", err - } - - switch escape { - case NoEscape: - return string(b), nil - case Base64Escape: - return base64.StdEncoding.EncodeToString(b), nil - case QuotedEscape: - return strconv.Quote(string(b)), nil - } - - panic(fmt.Sprintf("EncodeJSONValue called with unknown EscapeMode, %v", escape)) -} - -// DecodeJSONValue will attempt to decode the string input as a JSONValue. -// Optionally decoding base64 the value first before JSON unmarshaling. -// -// Will panic if the escape mode is unknown. -func DecodeJSONValue(v string, escape EscapeMode) (volcengine.JSONValue, error) { - var b []byte - var err error - - switch escape { - case NoEscape: - b = []byte(v) - case Base64Escape: - b, err = base64.StdEncoding.DecodeString(v) - case QuotedEscape: - var u string - u, err = strconv.Unquote(v) - b = []byte(u) - default: - panic(fmt.Sprintf("DecodeJSONValue called with unknown EscapeMode, %v", escape)) - } - - if err != nil { - return nil, err - } - - m := volcengine.JSONValue{} - err = json.Unmarshal(b, &m) - if err != nil { - return nil, err - } - - return m, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/payload.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/payload.go deleted file mode 100644 index b39cfb29ab94..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/payload.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -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 protocol - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "io" - "io/ioutil" - "net/http" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// PayloadUnmarshaler provides the interface for unmarshaling a payload's -// reader into a SDK shape. -type PayloadUnmarshaler interface { - UnmarshalPayload(io.Reader, interface{}) error -} - -// HandlerPayloadUnmarshal implements the PayloadUnmarshaler from a -// HandlerList. This provides the support for unmarshaling a payload reader to -// a shape without needing a SDK request first. -type HandlerPayloadUnmarshal struct { - Unmarshalers request.HandlerList -} - -// UnmarshalPayload unmarshals the io.Reader payload into the SDK shape using -// the Unmarshalers HandlerList provided. Returns an error if unable -// unmarshaling fails. -func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) error { - req := &request.Request{ - HTTPRequest: &http.Request{}, - HTTPResponse: &http.Response{ - StatusCode: 200, - Header: http.Header{}, - Body: ioutil.NopCloser(r), - }, - Data: v, - } - - h.Unmarshalers.Run(req) - - return req.Error -} - -// PayloadMarshaler provides the interface for marshaling a SDK shape into and -// io.Writer. -type PayloadMarshaler interface { - MarshalPayload(io.Writer, interface{}) error -} - -// HandlerPayloadMarshal implements the PayloadMarshaler from a HandlerList. -// This provides support for marshaling a SDK shape into an io.Writer without -// needing a SDK request first. -type HandlerPayloadMarshal struct { - Marshalers request.HandlerList -} - -// MarshalPayload marshals the SDK shape into the io.Writer using the -// Marshalers HandlerList provided. Returns an error if unable if marshal -// fails. -func (h HandlerPayloadMarshal) MarshalPayload(w io.Writer, v interface{}) error { - req := request.New( - volcengine.Config{}, - metadata.ClientInfo{}, - request.Handlers{}, - nil, - &request.Operation{HTTPMethod: "GET"}, - v, - nil, - ) - - h.Marshalers.Run(req) - - if req.Error != nil { - return req.Error - } - - io.Copy(w, req.GetBody()) - - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/build.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/build.go deleted file mode 100644 index 8c9f07429bd6..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/build.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -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 query provides serialization of VOLCSTACK volcenginequery requests, and responses. -package query - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "net/url" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/queryutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// BuildHandler is a named request handler for building volcenginequery protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.volcenginequery.Build", Fn: Build} - -// Build builds a request for an VOLCSTACK Query service. -func Build(r *request.Request) { - body := url.Values{ - "Action": {r.Operation.Name}, - "Version": {r.ClientInfo.APIVersion}, - } - if err := queryutil.Parse(body, r.Params, false); err != nil { - r.Error = volcengineerr.New(request.ErrCodeSerialization, "failed encoding Query request", err) - return - } - - if !r.IsPresigned() { - r.HTTPRequest.Method = "POST" - r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") - r.SetBufferBody([]byte(body.Encode())) - } else { // This is a pre-signed request - r.HTTPRequest.Method = "GET" - r.HTTPRequest.URL.RawQuery = body.Encode() - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/queryutil/queryutil.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/queryutil/queryutil.go deleted file mode 100644 index b121e34af237..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/queryutil/queryutil.go +++ /dev/null @@ -1,271 +0,0 @@ -/* -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 queryutil - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "net/url" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol" -) - -// Parse parses an object i and fills a url.Values object. The isEC2 flag -// indicates if this is the EC2 Query sub-protocol. -func Parse(body url.Values, i interface{}, isEC2 bool) error { - q := queryParser{isEC2: isEC2} - return q.parseValue(body, reflect.ValueOf(i), "", "") -} - -func elemOf(value reflect.Value) reflect.Value { - for value.Kind() == reflect.Ptr { - value = value.Elem() - } - return value -} - -type queryParser struct { - isEC2 bool -} - -func (q *queryParser) parseValue(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { - value = elemOf(value) - - // no need to handle zero values - if !value.IsValid() { - return nil - } - - t := tag.Get("type") - if t == "" { - switch value.Kind() { - case reflect.Struct: - t = "structure" - case reflect.Slice: - t = "list" - case reflect.Map: - t = "map" - } - } - - switch t { - case "structure": - return q.parseStruct(v, value, prefix) - case "list": - return q.parseList(v, value, prefix, tag) - case "map": - return q.parseMap(v, value, prefix, tag) - default: - return q.parseScalar(v, value, prefix, tag) - } -} - -func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix string) error { - if !value.IsValid() { - return nil - } - - t := value.Type() - for i := 0; i < value.NumField(); i++ { - elemValue := elemOf(value.Field(i)) - field := t.Field(i) - - if field.PkgPath != "" { - continue // ignore unexported fields - } - if field.Tag.Get("ignore") != "" { - continue - } - - if protocol.CanSetIdempotencyToken(value.Field(i), field) { - token := protocol.GetIdempotencyToken() - elemValue = reflect.ValueOf(token) - } - - var name string - if q.isEC2 { - name = field.Tag.Get("queryName") - } - if name == "" { - if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" { - name = field.Tag.Get("locationNameList") - } else if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - if name != "" && q.isEC2 { - name = strings.ToUpper(name[0:1]) + name[1:] - } - } - if name == "" { - name = field.Name - } - - if prefix != "" { - name = prefix + "." + name - } - - if err := q.parseValue(v, elemValue, name, field.Tag); err != nil { - return err - } - } - return nil -} - -func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { - // If it's empty, generate an empty value - if !value.IsNil() && value.Len() == 0 { - v.Set(prefix, "") - return nil - } - - if _, ok := value.Interface().([]byte); ok { - return q.parseScalar(v, value, prefix, tag) - } - - // check for unflattened list member - //if !q.isEC2 && tag.Get("flattened") == "" { - // if listName := tag.Get("locationNameList"); listName == "" { - // prefix += ".member" - // } else { - // prefix += "." + listName - // } - //} - - for i := 0; i < value.Len(); i++ { - slicePrefix := prefix - if slicePrefix == "" { - slicePrefix = strconv.Itoa(i + 1) - } else { - slicePrefix = slicePrefix + "." + strconv.Itoa(i+1) - } - if err := q.parseValue(v, value.Index(i), slicePrefix, ""); err != nil { - return err - } - } - return nil -} - -func (q *queryParser) parseMap(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error { - // If it's empty, generate an empty value - if !value.IsNil() && value.Len() == 0 { - v.Set(prefix, "") - return nil - } - - // check for unflattened list member - if !q.isEC2 && tag.Get("flattened") == "" { - prefix += ".entry" - } - - // sort keys for improved serialization consistency. - // this is not strictly necessary for protocol support. - mapKeyValues := value.MapKeys() - mapKeys := map[string]reflect.Value{} - mapKeyNames := make([]string, len(mapKeyValues)) - for i, mapKey := range mapKeyValues { - name := mapKey.String() - mapKeys[name] = mapKey - mapKeyNames[i] = name - } - sort.Strings(mapKeyNames) - - for i, mapKeyName := range mapKeyNames { - mapKey := mapKeys[mapKeyName] - mapValue := value.MapIndex(mapKey) - - kname := tag.Get("locationNameKey") - if kname == "" { - kname = "key" - } - vname := tag.Get("locationNameValue") - if vname == "" { - vname = "value" - } - - // serialize key - var keyName string - if prefix == "" { - keyName = strconv.Itoa(i+1) + "." + kname - } else { - keyName = prefix + "." + strconv.Itoa(i+1) + "." + kname - } - - if err := q.parseValue(v, mapKey, keyName, ""); err != nil { - return err - } - - // serialize value - var valueName string - if prefix == "" { - valueName = strconv.Itoa(i+1) + "." + vname - } else { - valueName = prefix + "." + strconv.Itoa(i+1) + "." + vname - } - - if err := q.parseValue(v, mapValue, valueName, ""); err != nil { - return err - } - } - - return nil -} - -func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, tag reflect.StructTag) error { - switch value := r.Interface().(type) { - case string: - v.Set(name, value) - case []byte: - if !r.IsNil() { - v.Set(name, base64.StdEncoding.EncodeToString(value)) - } - case json.Number: - v.Set(name, value.String()) - case bool: - v.Set(name, strconv.FormatBool(value)) - case int64: - v.Set(name, strconv.FormatInt(value, 10)) - case int32: - v.Set(name, strconv.FormatInt(int64(value), 10)) - case int16: - v.Set(name, strconv.FormatInt(int64(value), 10)) - case int8: - v.Set(name, strconv.FormatInt(int64(value), 10)) - case int: - v.Set(name, strconv.Itoa(value)) - case float64: - v.Set(name, strconv.FormatFloat(value, 'f', -1, 64)) - case float32: - v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32)) - case time.Time: - const ISO8601UTC = "2006-01-02T15:04:05Z" - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.ISO8601TimeFormatName - } - - v.Set(name, protocol.FormatTime(format, value)) - default: - return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name()) - } - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/unmarshal.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/unmarshal.go deleted file mode 100644 index 66b33513705f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/unmarshal.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -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 query - -// This File is modify from https://github.com/aws/aws-sdk-go/blob/main/private/protocol/query/unmarshal.go - -import ( - "encoding/xml" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// UnmarshalHandler is a named request handler for unmarshaling volcenginequery protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.volcenginequery.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling volcenginequery protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.volcenginequery.UnmarshalMeta", Fn: UnmarshalMeta} - -// Unmarshal unmarshals a response for an VOLCSTACK Query service. -func Unmarshal(r *request.Request) { - defer r.HTTPResponse.Body.Close() - if r.DataFilled() { - decoder := xml.NewDecoder(r.HTTPResponse.Body) - err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") - if err != nil { - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(request.ErrCodeSerialization, "failed decoding Query response", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - } -} - -// UnmarshalMeta unmarshals header response values for an VOLCSTACK Query service. -func UnmarshalMeta(r *request.Request) { - r.RequestID = r.HTTPResponse.Header.Get("X-Top-Requestid") -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/unmarshal_error.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/unmarshal_error.go deleted file mode 100644 index b2ac8c25508f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/unmarshal_error.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -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 query - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/xml" - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// UnmarshalErrorHandler is a name request handler to unmarshal request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "volcenginesdk.volcenginequery.UnmarshalError", Fn: UnmarshalError} - -type xmlErrorResponse struct { - Code string `xml:"Error>Code"` - Message string `xml:"Error>Message"` - RequestID string `xml:"RequestId"` -} - -type xmlResponseError struct { - xmlErrorResponse -} - -func (e *xmlResponseError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { - const svcUnavailableTagName = "ServiceUnavailableException" - const errorResponseTagName = "ErrorResponse" - - switch start.Name.Local { - case svcUnavailableTagName: - e.Code = svcUnavailableTagName - e.Message = "service is unavailable" - return d.Skip() - - case errorResponseTagName: - return d.DecodeElement(&e.xmlErrorResponse, &start) - - default: - return fmt.Errorf("unknown error response tag, %v", start) - } -} - -// UnmarshalError unmarshals an error response for an VOLCSTACK Query service. -func UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - var respErr xmlResponseError - err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body) - if err != nil { - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(request.ErrCodeSerialization, - "failed to unmarshal error message", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - reqID := respErr.RequestID - if len(reqID) == 0 { - reqID = r.RequestID - } - - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(respErr.Code, respErr.Message, nil), - r.HTTPResponse.StatusCode, - reqID, - ) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/build.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/build.go deleted file mode 100644 index da4ac7b13307..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/build.go +++ /dev/null @@ -1,352 +0,0 @@ -/* -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 rest provides RESTFUL serialization of VOLCSTACK requests and responses. -package rest - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "encoding/base64" - "fmt" - "io" - "net/http" - "net/url" - "path" - "reflect" - "strconv" - "strings" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// Whether the byte value can be sent without escaping in VOLCSTACK URLs -var noEscape [256]bool - -var errValueNotSet = fmt.Errorf("value not set") - -var byteSliceType = reflect.TypeOf([]byte{}) - -func init() { - for i := 0; i < len(noEscape); i++ { - // VOLCSTACK expects every character except these to be escaped - noEscape[i] = (i >= 'A' && i <= 'Z') || - (i >= 'a' && i <= 'z') || - (i >= '0' && i <= '9') || - i == '-' || - i == '.' || - i == '_' || - i == '~' - } -} - -// BuildHandler is a named request handler for building rest protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.rest.Build", Fn: Build} - -// Build builds the REST component of a service request. -func Build(r *request.Request) { - if r.ParamsFilled() { - v := reflect.ValueOf(r.Params).Elem() - buildLocationElements(r, v, false) - buildBody(r, v) - } -} - -// BuildAsGET builds the REST component of a service request with the ability to hoist -// data from the volcenginebody. -func BuildAsGET(r *request.Request) { - if r.ParamsFilled() { - v := reflect.ValueOf(r.Params).Elem() - buildLocationElements(r, v, true) - buildBody(r, v) - } -} - -func buildLocationElements(r *request.Request, v reflect.Value, buildGETQuery bool) { - query := r.HTTPRequest.URL.Query() - - // Setup the raw path to match the base path pattern. This is needed - // so that when the path is mutated a custom escaped version can be - // stored in RawPath that will be used by the Go client. - r.HTTPRequest.URL.RawPath = r.HTTPRequest.URL.Path - - for i := 0; i < v.NumField(); i++ { - m := v.Field(i) - if n := v.Type().Field(i).Name; n[0:1] == strings.ToLower(n[0:1]) { - continue - } - - if m.IsValid() { - field := v.Type().Field(i) - name := field.Tag.Get("locationName") - if name == "" { - name = field.Name - } - if kind := m.Kind(); kind == reflect.Ptr { - m = m.Elem() - } else if kind == reflect.Interface { - if !m.Elem().IsValid() { - continue - } - } - if !m.IsValid() { - continue - } - if field.Tag.Get("ignore") != "" { - continue - } - - // Support the ability to customize values to be marshaled as a - // blob even though they were modeled as a string. Required for S3 - // API operations like SSECustomerKey is modeled as string but - // required to be base64 encoded in request. - if field.Tag.Get("marshal-as") == "blob" { - m = m.Convert(byteSliceType) - } - - var err error - switch field.Tag.Get("location") { - case "headers": // header maps - err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag) - case "header": - err = buildHeader(&r.HTTPRequest.Header, m, name, field.Tag) - case "uri": - err = buildURI(r.HTTPRequest.URL, m, name, field.Tag) - case "querystring": - err = buildQueryString(query, m, name, field.Tag) - default: - if buildGETQuery { - err = buildQueryString(query, m, name, field.Tag) - } - } - r.Error = err - } - if r.Error != nil { - return - } - } - - r.HTTPRequest.URL.RawQuery = query.Encode() - if !volcengine.BoolValue(r.Config.DisableRestProtocolURICleaning) { - cleanPath(r.HTTPRequest.URL) - } -} - -func buildBody(r *request.Request, v reflect.Value) { - if field, ok := v.Type().FieldByName("_"); ok { - if payloadName := field.Tag.Get("payload"); payloadName != "" { - pfield, _ := v.Type().FieldByName(payloadName) - if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" { - payload := reflect.Indirect(v.FieldByName(payloadName)) - if payload.IsValid() && payload.Interface() != nil { - switch reader := payload.Interface().(type) { - case io.ReadSeeker: - r.SetReaderBody(reader) - case []byte: - r.SetBufferBody(reader) - case string: - r.SetStringBody(reader) - default: - r.Error = volcengineerr.New(request.ErrCodeSerialization, - "failed to encode REST request", - fmt.Errorf("unknown payload type %s", payload.Type())) - } - } - } - } - } -} - -func buildHeader(header *http.Header, v reflect.Value, name string, tag reflect.StructTag) error { - str, err := convertType(v, tag) - if err == errValueNotSet { - return nil - } else if err != nil { - return volcengineerr.New(request.ErrCodeSerialization, "failed to encode REST request", err) - } - - name = strings.TrimSpace(name) - str = strings.TrimSpace(str) - - header.Add(name, str) - - return nil -} - -func buildHeaderMap(header *http.Header, v reflect.Value, tag reflect.StructTag) error { - prefix := tag.Get("locationName") - for _, key := range v.MapKeys() { - str, err := convertType(v.MapIndex(key), tag) - if err == errValueNotSet { - continue - } else if err != nil { - return volcengineerr.New(request.ErrCodeSerialization, "failed to encode REST request", err) - - } - keyStr := strings.TrimSpace(key.String()) - str = strings.TrimSpace(str) - - header.Add(prefix+keyStr, str) - } - return nil -} - -func buildURI(u *url.URL, v reflect.Value, name string, tag reflect.StructTag) error { - value, err := convertType(v, tag) - if err == errValueNotSet { - return nil - } else if err != nil { - return volcengineerr.New(request.ErrCodeSerialization, "failed to encode REST request", err) - } - - u.Path = strings.Replace(u.Path, "{"+name+"}", value, -1) - u.Path = strings.Replace(u.Path, "{"+name+"+}", value, -1) - - u.RawPath = strings.Replace(u.RawPath, "{"+name+"}", EscapePath(value, true), -1) - u.RawPath = strings.Replace(u.RawPath, "{"+name+"+}", EscapePath(value, false), -1) - - return nil -} - -func buildQueryString(query url.Values, v reflect.Value, name string, tag reflect.StructTag) error { - switch value := v.Interface().(type) { - case []*string: - for _, item := range value { - query.Add(name, *item) - } - case map[string]*string: - for key, item := range value { - query.Add(key, *item) - } - case map[string][]*string: - for key, items := range value { - for _, item := range items { - query.Add(key, *item) - } - } - default: - str, err := convertType(v, tag) - if err == errValueNotSet { - return nil - } else if err != nil { - return volcengineerr.New(request.ErrCodeSerialization, "failed to encode REST request", err) - } - query.Set(name, str) - } - - return nil -} - -func cleanPath(u *url.URL) { - hasSlash := strings.HasSuffix(u.Path, "/") - - // clean up path, removing duplicate `/` - u.Path = path.Clean(u.Path) - u.RawPath = path.Clean(u.RawPath) - - if hasSlash && !strings.HasSuffix(u.Path, "/") { - u.Path += "/" - u.RawPath += "/" - } -} - -// EscapePath escapes part of a URL path in style -func EscapePath(path string, encodeSep bool) string { - var buf bytes.Buffer - for i := 0; i < len(path); i++ { - c := path[i] - if noEscape[c] || (c == '/' && !encodeSep) { - buf.WriteByte(c) - } else { - fmt.Fprintf(&buf, "%%%02X", c) - } - } - return buf.String() -} - -func convertType(v reflect.Value, tag reflect.StructTag) (str string, err error) { - v = reflect.Indirect(v) - if !v.IsValid() { - return "", errValueNotSet - } - - switch value := v.Interface().(type) { - case string: - if tag.Get("suppressedJSONValue") == "true" && tag.Get("location") == "header" { - value = base64.StdEncoding.EncodeToString([]byte(value)) - } - str = value - case []*string: - if tag.Get("location") != "header" || tag.Get("enum") == "" { - return "", fmt.Errorf("%T is only supported with location header and enum shapes", value) - } - buff := &bytes.Buffer{} - for i, sv := range value { - if sv == nil || len(*sv) == 0 { - continue - } - if i != 0 { - buff.WriteRune(',') - } - item := *sv - if strings.Index(item, `,`) != -1 || strings.Index(item, `"`) != -1 { - item = strconv.Quote(item) - } - buff.WriteString(item) - } - str = string(buff.Bytes()) - case []byte: - str = base64.StdEncoding.EncodeToString(value) - case bool: - str = strconv.FormatBool(value) - case int64: - str = strconv.FormatInt(value, 10) - case float64: - str = strconv.FormatFloat(value, 'f', -1, 64) - case time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.RFC822TimeFormatName - if tag.Get("location") == "querystring" { - format = protocol.ISO8601TimeFormatName - } - } - str = protocol.FormatTime(format, value) - case volcengine.JSONValue: - if len(value) == 0 { - return "", errValueNotSet - } - escaping := protocol.NoEscape - if tag.Get("location") == "header" { - escaping = protocol.Base64Escape - } - str, err = protocol.EncodeJSONValue(value, escaping) - if err != nil { - return "", fmt.Errorf("unable to encode JSONValue, %v", err) - } - default: - err := fmt.Errorf("unsupported value for param %v (%s)", v.Interface(), v.Type()) - return "", err - } - - return str, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/payload.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/payload.go deleted file mode 100644 index 49de498f4802..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/payload.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -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 rest - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "reflect" - -// PayloadMember returns the payload field member of i if there is one, or nil. -func PayloadMember(i interface{}) interface{} { - if i == nil { - return nil - } - - v := reflect.ValueOf(i).Elem() - if !v.IsValid() { - return nil - } - if field, ok := v.Type().FieldByName("_"); ok { - if payloadName := field.Tag.Get("payload"); payloadName != "" { - field, _ := v.Type().FieldByName(payloadName) - if field.Tag.Get("type") != "structure" { - return nil - } - - payload := v.FieldByName(payloadName) - if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { - return payload.Interface() - } - } - } - return nil -} - -const nopayloadPayloadType = "nopayload" - -// PayloadType returns the type of a payload field member of i if there is one, -// or "". -func PayloadType(i interface{}) string { - v := reflect.Indirect(reflect.ValueOf(i)) - if !v.IsValid() { - return "" - } - - if field, ok := v.Type().FieldByName("_"); ok { - if noPayload := field.Tag.Get(nopayloadPayloadType); noPayload != "" { - return nopayloadPayloadType - } - - if payloadName := field.Tag.Get("payload"); payloadName != "" { - if member, ok := v.Type().FieldByName(payloadName); ok { - return member.Tag.Get("type") - } - } - } - - return "" -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/unmarshal.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/unmarshal.go deleted file mode 100644 index 2f6dcbc16615..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/rest/unmarshal.go +++ /dev/null @@ -1,263 +0,0 @@ -/* -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 rest - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "encoding/base64" - "fmt" - "io" - "io/ioutil" - "net/http" - "reflect" - "strconv" - "strings" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// UnmarshalHandler is a named request handler for unmarshaling rest protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "volcenginesdk.rest.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling rest protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "volcenginesdk.rest.UnmarshalMeta", Fn: UnmarshalMeta} - -// Unmarshal unmarshals the REST component of a response in a REST service. -func Unmarshal(r *request.Request) { - if r.DataFilled() { - v := reflect.Indirect(reflect.ValueOf(r.Data)) - unmarshalBody(r, v) - } -} - -// UnmarshalMeta unmarshals the REST metadata of a response in a REST service -func UnmarshalMeta(r *request.Request) { - r.RequestID = r.HTTPResponse.Header.Get("X-Top-Requestid") - if r.RequestID == "" { - // Alternative version of request id in the header - r.RequestID = r.HTTPResponse.Header.Get("X-Top-Request-Id") - } - if r.DataFilled() { - v := reflect.Indirect(reflect.ValueOf(r.Data)) - unmarshalLocationElements(r, v) - } -} - -func unmarshalBody(r *request.Request, v reflect.Value) { - if field, ok := v.Type().FieldByName("_"); ok { - if payloadName := field.Tag.Get("payload"); payloadName != "" { - pfield, _ := v.Type().FieldByName(payloadName) - if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" { - payload := v.FieldByName(payloadName) - if payload.IsValid() { - switch payload.Interface().(type) { - case []byte: - defer r.HTTPResponse.Body.Close() - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - r.Error = volcengineerr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - } else { - payload.Set(reflect.ValueOf(b)) - } - case *string: - defer r.HTTPResponse.Body.Close() - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - r.Error = volcengineerr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - } else { - str := string(b) - payload.Set(reflect.ValueOf(&str)) - } - default: - switch payload.Type().String() { - case "io.ReadCloser": - payload.Set(reflect.ValueOf(r.HTTPResponse.Body)) - case "io.ReadSeeker": - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - r.Error = volcengineerr.New(request.ErrCodeSerialization, - "failed to read response volcenginebody", err) - return - } - payload.Set(reflect.ValueOf(ioutil.NopCloser(bytes.NewReader(b)))) - default: - io.Copy(ioutil.Discard, r.HTTPResponse.Body) - defer r.HTTPResponse.Body.Close() - r.Error = volcengineerr.New(request.ErrCodeSerialization, - "failed to decode REST response", - fmt.Errorf("unknown payload type %s", payload.Type())) - } - } - } - } - } - } -} - -func unmarshalLocationElements(r *request.Request, v reflect.Value) { - for i := 0; i < v.NumField(); i++ { - m, field := v.Field(i), v.Type().Field(i) - if n := field.Name; n[0:1] == strings.ToLower(n[0:1]) { - continue - } - - if m.IsValid() { - name := field.Tag.Get("locationName") - if name == "" { - name = field.Name - } - - switch field.Tag.Get("location") { - case "statusCode": - unmarshalStatusCode(m, r.HTTPResponse.StatusCode) - case "header": - err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name), field.Tag) - if err != nil { - r.Error = volcengineerr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - break - } - case "headers": - prefix := field.Tag.Get("locationName") - err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix) - if err != nil { - r.Error = volcengineerr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - break - } - } - } - if r.Error != nil { - return - } - } -} - -func unmarshalStatusCode(v reflect.Value, statusCode int) { - if !v.IsValid() { - return - } - - switch v.Interface().(type) { - case *int64: - s := int64(statusCode) - v.Set(reflect.ValueOf(&s)) - } -} - -func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error { - if len(headers) == 0 { - return nil - } - switch r.Interface().(type) { - case map[string]*string: // we only support string map value types - out := map[string]*string{} - for k, v := range headers { - k = http.CanonicalHeaderKey(k) - if strings.HasPrefix(strings.ToLower(k), strings.ToLower(prefix)) { - out[k[len(prefix):]] = &v[0] - } - } - if len(out) != 0 { - r.Set(reflect.ValueOf(out)) - } - - } - return nil -} - -func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) error { - switch tag.Get("type") { - case "jsonvalue": - if len(header) == 0 { - return nil - } - case "blob": - if len(header) == 0 { - return nil - } - default: - if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) { - return nil - } - } - - switch v.Interface().(type) { - case *string: - if tag.Get("suppressedJSONValue") == "true" && tag.Get("location") == "header" { - b, err := base64.StdEncoding.DecodeString(header) - if err != nil { - return fmt.Errorf("failed to decode JSONValue, %v", err) - } - header = string(b) - } - v.Set(reflect.ValueOf(&header)) - case []byte: - b, err := base64.StdEncoding.DecodeString(header) - if err != nil { - return err - } - v.Set(reflect.ValueOf(b)) - case *bool: - b, err := strconv.ParseBool(header) - if err != nil { - return err - } - v.Set(reflect.ValueOf(&b)) - case *int64: - i, err := strconv.ParseInt(header, 10, 64) - if err != nil { - return err - } - v.Set(reflect.ValueOf(&i)) - case *float64: - f, err := strconv.ParseFloat(header, 64) - if err != nil { - return err - } - v.Set(reflect.ValueOf(&f)) - case *time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.RFC822TimeFormatName - } - t, err := protocol.ParseTime(format, header) - if err != nil { - return err - } - v.Set(reflect.ValueOf(&t)) - case volcengine.JSONValue: - escaping := protocol.NoEscape - if tag.Get("location") == "header" { - escaping = protocol.Base64Escape - } - m, err := protocol.DecodeJSONValue(header, escaping) - if err != nil { - return err - } - v.Set(reflect.ValueOf(m)) - default: - err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type()) - return err - } - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/timestamp.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/timestamp.go deleted file mode 100644 index ebcf78d68784..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/timestamp.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -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 protocol - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "fmt" - "math" - "strconv" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkmath" -) - -// Names of time formats supported by the SDK -const ( - RFC822TimeFormatName = "rfc822" - ISO8601TimeFormatName = "iso8601" - UnixTimeFormatName = "unixTimestamp" -) - -// Time formats supported by the SDK -// Output time is intended to not contain decimals -const ( - // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT - RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT" - rfc822TimeFormatSingleDigitDay = "Mon, _2 Jan 2006 15:04:05 GMT" - rfc822TimeFormatSingleDigitDayTwoDigitYear = "Mon, _2 Jan 06 15:04:05 GMT" - - // This format is used for output time without seconds precision - RFC822OutputTimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" - - // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z - ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z" - iso8601TimeFormatNoZ = "2006-01-02T15:04:05.999999999" - - // This format is used for output time without seconds precision - ISO8601OutputTimeFormat = "2006-01-02T15:04:05Z" -) - -// IsKnownTimestampFormat returns if the timestamp format name -// is know to the SDK's protocols. -func IsKnownTimestampFormat(name string) bool { - switch name { - case RFC822TimeFormatName: - fallthrough - case ISO8601TimeFormatName: - fallthrough - case UnixTimeFormatName: - return true - default: - return false - } -} - -// FormatTime returns a string value of the time. -func FormatTime(name string, t time.Time) string { - t = t.UTC() - - switch name { - case RFC822TimeFormatName: - return t.Format(RFC822OutputTimeFormat) - case ISO8601TimeFormatName: - return t.Format(ISO8601OutputTimeFormat) - case UnixTimeFormatName: - return strconv.FormatInt(t.Unix(), 10) - default: - panic("unknown timestamp format name, " + name) - } -} - -// ParseTime attempts to parse the time given the format. Returns -// the time if it was able to be parsed, and fails otherwise. -func ParseTime(formatName, value string) (time.Time, error) { - switch formatName { - case RFC822TimeFormatName: // Smithy HTTPDate format - return tryParse(value, - RFC822TimeFormat, - rfc822TimeFormatSingleDigitDay, - rfc822TimeFormatSingleDigitDayTwoDigitYear, - time.RFC850, - time.ANSIC, - ) - case ISO8601TimeFormatName: // Smithy DateTime format - return tryParse(value, - ISO8601TimeFormat, - iso8601TimeFormatNoZ, - time.RFC3339Nano, - time.RFC3339, - ) - case UnixTimeFormatName: - v, err := strconv.ParseFloat(value, 64) - _, dec := math.Modf(v) - dec = sdkmath.Round(dec*1e3) / 1e3 //Rounds 0.1229999 to 0.123 - if err != nil { - return time.Time{}, err - } - return time.Unix(int64(v), int64(dec*(1e9))), nil - default: - panic("unknown timestamp format name, " + formatName) - } -} - -func tryParse(v string, formats ...string) (time.Time, error) { - var errs parseErrors - for _, f := range formats { - t, err := time.Parse(f, v) - if err != nil { - errs = append(errs, parseError{ - Format: f, - Err: err, - }) - continue - } - return t, nil - } - - return time.Time{}, fmt.Errorf("unable to parse time string, %v", errs) -} - -type parseErrors []parseError - -func (es parseErrors) Error() string { - var s bytes.Buffer - for _, e := range es { - fmt.Fprintf(&s, "\n * %q: %v", e.Format, e.Err) - } - - return "parse errors:" + s.String() -} - -type parseError struct { - Format string - Err error -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/unmarshal.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/unmarshal.go deleted file mode 100644 index 81b39f214cee..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/unmarshal.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -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 protocol - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "io" - "io/ioutil" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's volcenginebody -var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "volcenginesdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} - -// UnmarshalDiscardBody is a request handler to empty a response's volcenginebody and closing it. -func UnmarshalDiscardBody(r *request.Request) { - if r.HTTPResponse == nil || r.HTTPResponse.Body == nil { - return - } - - io.Copy(ioutil.Discard, r.HTTPResponse.Body) - r.HTTPResponse.Body.Close() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/volcenginequery/unmarshal.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/volcenginequery/unmarshal.go deleted file mode 100644 index e1566fe883de..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/volcenginequery/unmarshal.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -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 volcenginequery - -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/ec2.json unmarshal_test.go - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/xml" - "strings" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// UnmarshalHandler is a named request handler for unmarshaling ec2query protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "volcenginesdk.volcenginequery.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling ec2query protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "volcenginesdk.volcenginequery.UnmarshalMeta", Fn: UnmarshalMeta} - -// UnmarshalErrorHandler is a named request handler for unmarshaling ec2query protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "volcenginesdk.volcenginequery.UnmarshalError", Fn: UnmarshalError} - -// Unmarshal unmarshals a response body for the EC2 protocol. -func Unmarshal(r *request.Request) { - defer r.HTTPResponse.Body.Close() - if r.DataFilled() { - decoder := xml.NewDecoder(r.HTTPResponse.Body) - err := xmlutil.UnmarshalXML(r.Data, decoder, "") - if err != nil { - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(request.ErrCodeSerialization, - "failed decoding EC2 Query response", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - } -} - -// UnmarshalMeta unmarshals response headers for the EC2 protocol. -func UnmarshalMeta(r *request.Request) { - r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") - if r.RequestID == "" { - // Alternative version of request id in the header - r.RequestID = r.HTTPResponse.Header.Get("X-Amz-Request-Id") - } -} - -type xmlErrorResponse struct { - XMLName xml.Name `xml:"Response"` - Code string `xml:"Errors>Error>Code"` - Message string `xml:"Errors>Error>Message"` - RequestID string `xml:"RequestID"` -} - -// UnmarshalError unmarshals a response error for the EC2 protocol. -func UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - var respErr xmlErrorResponse - err := xmlutil.UnmarshalXMLError(&respErr, r.HTTPResponse.Body) - if err != nil { - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(request.ErrCodeSerialization, - "failed to unmarshal error message", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(respErr.Code, respErr.Message, nil), - r.HTTPResponse.StatusCode, - respErr.RequestID, - ) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/build.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/build.go deleted file mode 100644 index 7ad1c7bca2ee..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/build.go +++ /dev/null @@ -1,325 +0,0 @@ -/* -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 xmlutil Package xml util provides XML serialization of VOLCSTACK requests and responses. -package xmlutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/base64" - "encoding/xml" - "fmt" - "reflect" - "sort" - "strconv" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol" -) - -// BuildXML will serialize params into an xml.Encoder. Error will be returned -// if the serialization of any of the params or nested values fails. -func BuildXML(params interface{}, e *xml.Encoder) error { - return buildXML(params, e, false) -} - -func buildXML(params interface{}, e *xml.Encoder, sorted bool) error { - b := xmlBuilder{encoder: e, namespaces: map[string]string{}} - root := NewXMLElement(xml.Name{}) - if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil { - return err - } - for _, c := range root.Children { - for _, v := range c { - return StructToXML(e, v, sorted) - } - } - return nil -} - -// Returns the reflection element of a value, if it is a pointer. -func elemOf(value reflect.Value) reflect.Value { - for value.Kind() == reflect.Ptr { - value = value.Elem() - } - return value -} - -// A xmlBuilder serializes values from Go code to XML -type xmlBuilder struct { - encoder *xml.Encoder - namespaces map[string]string -} - -// buildValue generic XMLNode builder for any type. Will build value for their specific type -// struct, list, map, scalar. -// -// Also takes a "type" tag value to set what type a value should be converted to XMLNode as. If -// type is not provided reflect will be used to determine the value's type. -func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - value = elemOf(value) - if !value.IsValid() { // no need to handle zero values - return nil - } else if tag.Get("location") != "" { // don't handle non-volcenginebody location values - return nil - } - - t := tag.Get("type") - if t == "" { - switch value.Kind() { - case reflect.Struct: - t = "structure" - case reflect.Slice: - t = "list" - case reflect.Map: - t = "map" - } - } - - switch t { - case "structure": - if field, ok := value.Type().FieldByName("_"); ok { - tag = tag + reflect.StructTag(" ") + field.Tag - } - return b.buildStruct(value, current, tag) - case "list": - return b.buildList(value, current, tag) - case "map": - return b.buildMap(value, current, tag) - default: - return b.buildScalar(value, current, tag) - } -} - -// buildStruct adds a struct and its fields to the current XMLNode. All fields and any nested -// types are converted to XMLNodes also. -func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - if !value.IsValid() { - return nil - } - - // unwrap payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := value.Type().FieldByName(payload) - tag = field.Tag - value = elemOf(value.FieldByName(payload)) - - if !value.IsValid() { - return nil - } - } - - child := NewXMLElement(xml.Name{Local: tag.Get("locationName")}) - - // there is an xmlNamespace associated with this struct - if prefix, uri := tag.Get("xmlPrefix"), tag.Get("xmlURI"); uri != "" { - ns := xml.Attr{ - Name: xml.Name{Local: "xmlns"}, - Value: uri, - } - if prefix != "" { - b.namespaces[prefix] = uri // register the namespace - ns.Name.Local = "xmlns:" + prefix - } - - child.Attr = append(child.Attr, ns) - } - - var payloadFields, nonPayloadFields int - - t := value.Type() - for i := 0; i < value.NumField(); i++ { - member := elemOf(value.Field(i)) - field := t.Field(i) - - if field.PkgPath != "" { - continue // ignore unexported fields - } - if field.Tag.Get("ignore") != "" { - continue - } - - mTag := field.Tag - if mTag.Get("location") != "" { // skip non-volcenginebody members - nonPayloadFields++ - continue - } - payloadFields++ - - if protocol.CanSetIdempotencyToken(value.Field(i), field) { - token := protocol.GetIdempotencyToken() - member = reflect.ValueOf(token) - } - - memberName := mTag.Get("locationName") - if memberName == "" { - memberName = field.Name - mTag = reflect.StructTag(string(mTag) + ` locationName:"` + memberName + `"`) - } - if err := b.buildValue(member, child, mTag); err != nil { - return err - } - } - - // Only case where the child shape is not added is if the shape only contains - // non-payload fields, e.g headers/volcenginequery. - if !(payloadFields == 0 && nonPayloadFields > 0) { - current.AddChild(child) - } - - return nil -} - -// buildList adds the value's list items to the current XMLNode as children nodes. All -// nested values in the list are converted to XMLNodes also. -func (b *xmlBuilder) buildList(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - if value.IsNil() { // don't build omitted lists - return nil - } - - // check for unflattened list member - flattened := tag.Get("flattened") != "" - - xname := xml.Name{Local: tag.Get("locationName")} - if flattened { - for i := 0; i < value.Len(); i++ { - child := NewXMLElement(xname) - current.AddChild(child) - if err := b.buildValue(value.Index(i), child, ""); err != nil { - return err - } - } - } else { - list := NewXMLElement(xname) - current.AddChild(list) - - for i := 0; i < value.Len(); i++ { - iname := tag.Get("locationNameList") - if iname == "" { - iname = "member" - } - - child := NewXMLElement(xml.Name{Local: iname}) - list.AddChild(child) - if err := b.buildValue(value.Index(i), child, ""); err != nil { - return err - } - } - } - - return nil -} - -// buildMap adds the value's key/value pairs to the current XMLNode as children nodes. All -// nested values in the map are converted to XMLNodes also. -// -// Error will be returned if it is unable to build the map's values into XMLNodes -func (b *xmlBuilder) buildMap(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - if value.IsNil() { // don't build omitted maps - return nil - } - - maproot := NewXMLElement(xml.Name{Local: tag.Get("locationName")}) - current.AddChild(maproot) - current = maproot - - kname, vname := "key", "value" - if n := tag.Get("locationNameKey"); n != "" { - kname = n - } - if n := tag.Get("locationNameValue"); n != "" { - vname = n - } - - // sorting is not required for compliance, but it makes testing easier - keys := make([]string, value.Len()) - for i, k := range value.MapKeys() { - keys[i] = k.String() - } - sort.Strings(keys) - - for _, k := range keys { - v := value.MapIndex(reflect.ValueOf(k)) - - mapcur := current - if tag.Get("flattened") == "" { // add "entry" tag to non-flat maps - child := NewXMLElement(xml.Name{Local: "entry"}) - mapcur.AddChild(child) - mapcur = child - } - - kchild := NewXMLElement(xml.Name{Local: kname}) - kchild.Text = k - vchild := NewXMLElement(xml.Name{Local: vname}) - mapcur.AddChild(kchild) - mapcur.AddChild(vchild) - - if err := b.buildValue(v, vchild, ""); err != nil { - return err - } - } - - return nil -} - -// buildScalar will convert the value into a string and append it as a attribute or child -// of the current XMLNode. -// -// The value will be added as an attribute if tag contains a "xmlAttribute" attribute value. -// -// Error will be returned if the value type is unsupported. -func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag reflect.StructTag) error { - var str string - switch converted := value.Interface().(type) { - case string: - str = converted - case []byte: - if !value.IsNil() { - str = base64.StdEncoding.EncodeToString(converted) - } - case bool: - str = strconv.FormatBool(converted) - case int64: - str = strconv.FormatInt(converted, 10) - case int: - str = strconv.Itoa(converted) - case float64: - str = strconv.FormatFloat(converted, 'f', -1, 64) - case float32: - str = strconv.FormatFloat(float64(converted), 'f', -1, 32) - case time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.ISO8601TimeFormatName - } - - str = protocol.FormatTime(format, converted) - default: - return fmt.Errorf("unsupported value for param %s: %v (%s)", - tag.Get("locationName"), value.Interface(), value.Type().Name()) - } - - xname := xml.Name{Local: tag.Get("locationName")} - if tag.Get("xmlAttribute") != "" { // put into current node's attribute list - attr := xml.Attr{Name: xname, Value: str} - current.Attr = append(current.Attr, attr) - } else { // regular text node - current.AddChild(&XMLNode{Name: xname, Text: str}) - } - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/sort.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/sort.go deleted file mode 100644 index 688d69edbadd..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/sort.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -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 xmlutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/xml" - "strings" -) - -type xmlAttrSlice []xml.Attr - -func (x xmlAttrSlice) Len() int { - return len(x) -} - -func (x xmlAttrSlice) Less(i, j int) bool { - spaceI, spaceJ := x[i].Name.Space, x[j].Name.Space - localI, localJ := x[i].Name.Local, x[j].Name.Local - valueI, valueJ := x[i].Value, x[j].Value - - spaceCmp := strings.Compare(spaceI, spaceJ) - localCmp := strings.Compare(localI, localJ) - valueCmp := strings.Compare(valueI, valueJ) - - if spaceCmp == -1 || (spaceCmp == 0 && (localCmp == -1 || (localCmp == 0 && valueCmp == -1))) { - return true - } - - return false -} - -func (x xmlAttrSlice) Swap(i, j int) { - x[i], x[j] = x[j], x[i] -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/unmarshal.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/unmarshal.go deleted file mode 100644 index 71a4191658da..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/unmarshal.go +++ /dev/null @@ -1,310 +0,0 @@ -/* -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 xmlutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "encoding/base64" - "encoding/xml" - "fmt" - "io" - "reflect" - "strconv" - "strings" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// UnmarshalXMLError unmarshals the XML error from the stream into the value -// type specified. The value must be a pointer. If the message fails to -// unmarshal, the message content will be included in the returned error as a -// volcengineerr.UnmarshalError. -func UnmarshalXMLError(v interface{}, stream io.Reader) error { - var errBuf bytes.Buffer - body := io.TeeReader(stream, &errBuf) - - err := xml.NewDecoder(body).Decode(v) - if err != nil && err != io.EOF { - return volcengineerr.NewUnmarshalError(err, - "failed to unmarshal error message", errBuf.Bytes()) - } - - return nil -} - -// UnmarshalXML deserializes an xml.Decoder into the container v. V -// needs to match the shape of the XML expected to be decoded. -// If the shape doesn't match unmarshaling will fail. -func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error { - n, err := XMLToStruct(d, nil) - if err != nil { - return err - } - if n.Children != nil { - for _, root := range n.Children { - for _, c := range root { - if wrappedChild, ok := c.Children[wrapper]; ok { - c = wrappedChild[0] // pull out wrapped element - } - - err = parse(reflect.ValueOf(v), c, "") - if err != nil { - if err == io.EOF { - return nil - } - return err - } - } - } - return nil - } - return nil -} - -// parse deserializes any value from the XMLNode. The type tag is used to infer the type, or reflect -// will be used to determine the type from r. -func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - rtype := r.Type() - if rtype.Kind() == reflect.Ptr { - rtype = rtype.Elem() // check kind of actual element type - } - - t := tag.Get("type") - if t == "" { - switch rtype.Kind() { - case reflect.Struct: - // also it can't be a time object - if _, ok := r.Interface().(*time.Time); !ok { - t = "structure" - } - case reflect.Slice: - // also it can't be a byte slice - if _, ok := r.Interface().([]byte); !ok { - t = "list" - } - case reflect.Map: - t = "map" - } - } - - switch t { - case "structure": - if field, ok := rtype.FieldByName("_"); ok { - tag = field.Tag - } - return parseStruct(r, node, tag) - case "list": - return parseList(r, node, tag) - case "map": - return parseMap(r, node, tag) - default: - return parseScalar(r, node, tag) - } -} - -// parseStruct deserializes a structure and its fields from an XMLNode. Any nested -// types in the structure will also be deserialized. -func parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - t := r.Type() - if r.Kind() == reflect.Ptr { - if r.IsNil() { // create the structure if it's nil - s := reflect.New(r.Type().Elem()) - r.Set(s) - r = s - } - - r = r.Elem() - t = t.Elem() - } - - // unwrap any payloads - if payload := tag.Get("payload"); payload != "" { - field, _ := t.FieldByName(payload) - return parseStruct(r.FieldByName(payload), node, field.Tag) - } - - for i := 0; i < t.NumField(); i++ { - field := t.Field(i) - if c := field.Name[0:1]; strings.ToLower(c) == c { - continue // ignore unexported fields - } - - // figure out what this field is called - name := field.Name - if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" { - name = field.Tag.Get("locationNameList") - } else if locName := field.Tag.Get("locationName"); locName != "" { - name = locName - } - - // try to find the field by name in elements - elems := node.Children[name] - - if elems == nil { // try to find the field in attributes - if val, ok := node.findElem(name); ok { - elems = []*XMLNode{{Text: val}} - } - } - - member := r.FieldByName(field.Name) - for _, elem := range elems { - err := parse(member, elem, field.Tag) - if err != nil { - return err - } - } - } - return nil -} - -// parseList deserializes a list of values from an XML node. Each list entry -// will also be deserialized. -func parseList(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - t := r.Type() - - if tag.Get("flattened") == "" { // look at all item entries - mname := "member" - if name := tag.Get("locationNameList"); name != "" { - mname = name - } - - if Children, ok := node.Children[mname]; ok { - if r.IsNil() { - r.Set(reflect.MakeSlice(t, len(Children), len(Children))) - } - - for i, c := range Children { - err := parse(r.Index(i), c, "") - if err != nil { - return err - } - } - } - } else { // flattened list means this is a single element - if r.IsNil() { - r.Set(reflect.MakeSlice(t, 0, 0)) - } - - childR := reflect.Zero(t.Elem()) - r.Set(reflect.Append(r, childR)) - err := parse(r.Index(r.Len()-1), node, "") - if err != nil { - return err - } - } - - return nil -} - -// parseMap deserializes a map from an XMLNode. The direct children of the XMLNode -// will also be deserialized as map entries. -func parseMap(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - if r.IsNil() { - r.Set(reflect.MakeMap(r.Type())) - } - - if tag.Get("flattened") == "" { // look at all child entries - for _, entry := range node.Children["entry"] { - parseMapEntry(r, entry, tag) - } - } else { // this element is itself an entry - parseMapEntry(r, node, tag) - } - - return nil -} - -// parseMapEntry deserializes a map entry from a XML node. -func parseMapEntry(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - kname, vname := "key", "value" - if n := tag.Get("locationNameKey"); n != "" { - kname = n - } - if n := tag.Get("locationNameValue"); n != "" { - vname = n - } - - keys, ok := node.Children[kname] - values := node.Children[vname] - if ok { - for i, key := range keys { - keyR := reflect.ValueOf(key.Text) - value := values[i] - valueR := reflect.New(r.Type().Elem()).Elem() - - parse(valueR, value, "") - r.SetMapIndex(keyR, valueR) - } - } - return nil -} - -// parseScaller deserializes an XMLNode value into a concrete type based on the -// interface type of r. -// -// Error is returned if the deserialization fails due to invalid type conversion, -// or unsupported interface type. -func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error { - switch r.Interface().(type) { - case *string: - r.Set(reflect.ValueOf(&node.Text)) - return nil - case []byte: - b, err := base64.StdEncoding.DecodeString(node.Text) - if err != nil { - return err - } - r.Set(reflect.ValueOf(b)) - case *bool: - v, err := strconv.ParseBool(node.Text) - if err != nil { - return err - } - r.Set(reflect.ValueOf(&v)) - case *int64: - v, err := strconv.ParseInt(node.Text, 10, 64) - if err != nil { - return err - } - r.Set(reflect.ValueOf(&v)) - case *float64: - v, err := strconv.ParseFloat(node.Text, 64) - if err != nil { - return err - } - r.Set(reflect.ValueOf(&v)) - case *time.Time: - format := tag.Get("timestampFormat") - if len(format) == 0 { - format = protocol.ISO8601TimeFormatName - } - - t, err := protocol.ParseTime(format, node.Text) - if err != nil { - return err - } - r.Set(reflect.ValueOf(&t)) - default: - return fmt.Errorf("unsupported value: %v (%s)", r.Interface(), r.Type()) - } - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/xml_to_struct.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/xml_to_struct.go deleted file mode 100644 index b029d1ebdfe3..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil/xml_to_struct.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -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 xmlutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/xml" - "fmt" - "io" - "sort" -) - -// A XMLNode contains the values to be encoded or decoded. -type XMLNode struct { - Name xml.Name `json:",omitempty"` - Children map[string][]*XMLNode `json:",omitempty"` - Text string `json:",omitempty"` - Attr []xml.Attr `json:",omitempty"` - - namespaces map[string]string - parent *XMLNode -} - -// NewXMLElement returns a pointer to a new XMLNode initialized to default values. -func NewXMLElement(name xml.Name) *XMLNode { - return &XMLNode{ - Name: name, - Children: map[string][]*XMLNode{}, - Attr: []xml.Attr{}, - } -} - -// AddChild adds child to the XMLNode. -func (n *XMLNode) AddChild(child *XMLNode) { - child.parent = n - if _, ok := n.Children[child.Name.Local]; !ok { - n.Children[child.Name.Local] = []*XMLNode{} - } - n.Children[child.Name.Local] = append(n.Children[child.Name.Local], child) -} - -// XMLToStruct converts a xml.Decoder stream to XMLNode with nested values. -func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) { - out := &XMLNode{} - for { - tok, err := d.Token() - if err != nil { - if err == io.EOF { - break - } else { - return out, err - } - } - - if tok == nil { - break - } - - switch typed := tok.(type) { - case xml.CharData: - out.Text = string(typed.Copy()) - case xml.StartElement: - el := typed.Copy() - out.Attr = el.Attr - if out.Children == nil { - out.Children = map[string][]*XMLNode{} - } - - name := typed.Name.Local - slice := out.Children[name] - if slice == nil { - slice = []*XMLNode{} - } - node, e := XMLToStruct(d, &el) - out.findNamespaces() - if e != nil { - return out, e - } - node.Name = typed.Name - node.findNamespaces() - tempOut := *out - // Save into a temp variable, simply because out gets squashed during - // loop iterations - node.parent = &tempOut - slice = append(slice, node) - out.Children[name] = slice - case xml.EndElement: - if s != nil && s.Name.Local == typed.Name.Local { // matching end token - return out, nil - } - out = &XMLNode{} - } - } - return out, nil -} - -func (n *XMLNode) findNamespaces() { - ns := map[string]string{} - for _, a := range n.Attr { - if a.Name.Space == "xmlns" { - ns[a.Value] = a.Name.Local - } - } - - n.namespaces = ns -} - -func (n *XMLNode) findElem(name string) (string, bool) { - for node := n; node != nil; node = node.parent { - for _, a := range node.Attr { - namespace := a.Name.Space - if v, ok := node.namespaces[namespace]; ok { - namespace = v - } - if name == fmt.Sprintf("%s:%s", namespace, a.Name.Local) { - return a.Value, true - } - } - } - return "", false -} - -// StructToXML writes an XMLNode to a xml.Encoder as tokens. -func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error { - // Sort Attributes - attrs := node.Attr - if sorted { - sortedAttrs := make([]xml.Attr, len(attrs)) - for _, k := range node.Attr { - sortedAttrs = append(sortedAttrs, k) - } - sort.Sort(xmlAttrSlice(sortedAttrs)) - attrs = sortedAttrs - } - - e.EncodeToken(xml.StartElement{Name: node.Name, Attr: attrs}) - - if node.Text != "" { - e.EncodeToken(xml.CharData([]byte(node.Text))) - } else if sorted { - sortedNames := []string{} - for k := range node.Children { - sortedNames = append(sortedNames, k) - } - sort.Strings(sortedNames) - - for _, k := range sortedNames { - for _, v := range node.Children[k] { - StructToXML(e, v, sorted) - } - } - } else { - for _, c := range node.Children { - for _, v := range c { - StructToXML(e, v, sorted) - } - } - } - - e.EncodeToken(xml.EndElement{Name: node.Name}) - return e.Flush() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/util/sort_keys.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/util/sort_keys.go deleted file mode 100644 index 821948e2bfc6..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/util/sort_keys.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -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 util - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "sort" - -// SortedKeys returns a sorted slice of keys of a map. -func SortedKeys(m map[string]interface{}) []string { - i, sorted := 0, make([]string, len(m)) - for k := range m { - sorted[i] = k - i++ - } - sort.Strings(sorted) - return sorted -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/util/util.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/util/util.go deleted file mode 100644 index a1b41890b78b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/util/util.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -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 util - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "encoding/xml" - "fmt" - "go/format" - "io" - "reflect" - "regexp" - "strings" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/xml/xmlutil" -) - -// GoFmt returns the Go formated string of the input. -// -// Panics if the format fails. -func GoFmt(buf string) string { - formatted, err := format.Source([]byte(buf)) - if err != nil { - panic(fmt.Errorf("%s\nOriginal code:\n%s", err.Error(), buf)) - } - return string(formatted) -} - -var reTrim = regexp.MustCompile(`\s{2,}`) - -// Trim removes all leading and trailing white space. -// -// All consecutive spaces will be reduced to a single space. -func Trim(s string) string { - return strings.TrimSpace(reTrim.ReplaceAllString(s, " ")) -} - -// Capitalize capitalizes the first character of the string. -func Capitalize(s string) string { - if len(s) == 1 { - return strings.ToUpper(s) - } - return strings.ToUpper(s[0:1]) + s[1:] -} - -// SortXML sorts the reader's XML elements -func SortXML(r io.Reader) string { - var buf bytes.Buffer - d := xml.NewDecoder(r) - root, _ := xmlutil.XMLToStruct(d, nil) - e := xml.NewEncoder(&buf) - xmlutil.StructToXML(e, root, true) - return buf.String() -} - -// PrettyPrint generates a human readable representation of the value v. -// All values of v are recursively found and pretty printed also. -func PrettyPrint(v interface{}) string { - value := reflect.ValueOf(v) - switch value.Kind() { - case reflect.Struct: - str := fullName(value.Type()) + "{\n" - for i := 0; i < value.NumField(); i++ { - l := string(value.Type().Field(i).Name[0]) - if strings.ToUpper(l) == l { - str += value.Type().Field(i).Name + ": " - str += PrettyPrint(value.Field(i).Interface()) - str += ",\n" - } - } - str += "}" - return str - case reflect.Map: - str := "map[" + fullName(value.Type().Key()) + "]" + fullName(value.Type().Elem()) + "{\n" - for _, k := range value.MapKeys() { - str += "\"" + k.String() + "\": " - str += PrettyPrint(value.MapIndex(k).Interface()) - str += ",\n" - } - str += "}" - return str - case reflect.Ptr: - if e := value.Elem(); e.IsValid() { - return "&" + PrettyPrint(e.Interface()) - } - return "nil" - case reflect.Slice: - str := "[]" + fullName(value.Type().Elem()) + "{\n" - for i := 0; i < value.Len(); i++ { - str += PrettyPrint(value.Index(i).Interface()) - str += ",\n" - } - str += "}" - return str - default: - return fmt.Sprintf("%#v", v) - } -} - -func pkgName(t reflect.Type) string { - pkg := t.PkgPath() - c := strings.Split(pkg, "/") - return c[len(c)-1] -} - -func fullName(t reflect.Type) string { - if pkg := pkgName(t); pkg != "" { - return pkg + "." + t.Name() - } - return t.Name() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_db_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_db_instances.go deleted file mode 100644 index 35c38c1fd9c7..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_db_instances.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opAttachDBInstancesCommon = "AttachDBInstances" - -// AttachDBInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the AttachDBInstancesCommon operation. The "output" return -// value will be populated with the AttachDBInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AttachDBInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after AttachDBInstancesCommon Send returns without error. -// -// See AttachDBInstancesCommon for more information on using the AttachDBInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the AttachDBInstancesCommonRequest method. -// req, resp := client.AttachDBInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) AttachDBInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opAttachDBInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// AttachDBInstancesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation AttachDBInstancesCommon for usage and error information. -func (c *AUTOSCALING) AttachDBInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.AttachDBInstancesCommonRequest(input) - return out, req.Send() -} - -// AttachDBInstancesCommonWithContext is the same as AttachDBInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See AttachDBInstancesCommon 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 *AUTOSCALING) AttachDBInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.AttachDBInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachDBInstances = "AttachDBInstances" - -// AttachDBInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the AttachDBInstances operation. The "output" return -// value will be populated with the AttachDBInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AttachDBInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after AttachDBInstancesCommon Send returns without error. -// -// See AttachDBInstances for more information on using the AttachDBInstances -// API call, and error handling. -// -// // Example sending a request using the AttachDBInstancesRequest method. -// req, resp := client.AttachDBInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) AttachDBInstancesRequest(input *AttachDBInstancesInput) (req *request.Request, output *AttachDBInstancesOutput) { - op := &request.Operation{ - Name: opAttachDBInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &AttachDBInstancesInput{} - } - - output = &AttachDBInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// AttachDBInstances API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation AttachDBInstances for usage and error information. -func (c *AUTOSCALING) AttachDBInstances(input *AttachDBInstancesInput) (*AttachDBInstancesOutput, error) { - req, out := c.AttachDBInstancesRequest(input) - return out, req.Send() -} - -// AttachDBInstancesWithContext is the same as AttachDBInstances with the addition of -// the ability to pass a context and additional request options. -// -// See AttachDBInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) AttachDBInstancesWithContext(ctx volcengine.Context, input *AttachDBInstancesInput, opts ...request.Option) (*AttachDBInstancesOutput, error) { - req, out := c.AttachDBInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AttachDBInstancesInput struct { - _ struct{} `type:"structure"` - - DBInstanceIds []*string `type:"list"` - - ForceAttach *bool `type:"boolean"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s AttachDBInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachDBInstancesInput) GoString() string { - return s.String() -} - -// SetDBInstanceIds sets the DBInstanceIds field's value. -func (s *AttachDBInstancesInput) SetDBInstanceIds(v []*string) *AttachDBInstancesInput { - s.DBInstanceIds = v - return s -} - -// SetForceAttach sets the ForceAttach field's value. -func (s *AttachDBInstancesInput) SetForceAttach(v bool) *AttachDBInstancesInput { - s.ForceAttach = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *AttachDBInstancesInput) SetScalingGroupId(v string) *AttachDBInstancesInput { - s.ScalingGroupId = &v - return s -} - -type AttachDBInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s AttachDBInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachDBInstancesOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *AttachDBInstancesOutput) SetScalingGroupId(v string) *AttachDBInstancesOutput { - s.ScalingGroupId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_instances.go deleted file mode 100644 index fa0e12837df3..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_instances.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opAttachInstancesCommon = "AttachInstances" - -// AttachInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the AttachInstancesCommon operation. The "output" return -// value will be populated with the AttachInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AttachInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after AttachInstancesCommon Send returns without error. -// -// See AttachInstancesCommon for more information on using the AttachInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the AttachInstancesCommonRequest method. -// req, resp := client.AttachInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) AttachInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opAttachInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// AttachInstancesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation AttachInstancesCommon for usage and error information. -func (c *AUTOSCALING) AttachInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.AttachInstancesCommonRequest(input) - return out, req.Send() -} - -// AttachInstancesCommonWithContext is the same as AttachInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See AttachInstancesCommon 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 *AUTOSCALING) AttachInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.AttachInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachInstances = "AttachInstances" - -// AttachInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the AttachInstances operation. The "output" return -// value will be populated with the AttachInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AttachInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after AttachInstancesCommon Send returns without error. -// -// See AttachInstances for more information on using the AttachInstances -// API call, and error handling. -// -// // Example sending a request using the AttachInstancesRequest method. -// req, resp := client.AttachInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) AttachInstancesRequest(input *AttachInstancesInput) (req *request.Request, output *AttachInstancesOutput) { - op := &request.Operation{ - Name: opAttachInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &AttachInstancesInput{} - } - - output = &AttachInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// AttachInstances API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation AttachInstances for usage and error information. -func (c *AUTOSCALING) AttachInstances(input *AttachInstancesInput) (*AttachInstancesOutput, error) { - req, out := c.AttachInstancesRequest(input) - return out, req.Send() -} - -// AttachInstancesWithContext is the same as AttachInstances with the addition of -// the ability to pass a context and additional request options. -// -// See AttachInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) AttachInstancesWithContext(ctx volcengine.Context, input *AttachInstancesInput, opts ...request.Option) (*AttachInstancesOutput, error) { - req, out := c.AttachInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AttachInstancesInput struct { - _ struct{} `type:"structure"` - - Entrusted *bool `type:"boolean"` - - InstanceIds []*string `type:"list"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s AttachInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachInstancesInput) GoString() string { - return s.String() -} - -// SetEntrusted sets the Entrusted field's value. -func (s *AttachInstancesInput) SetEntrusted(v bool) *AttachInstancesInput { - s.Entrusted = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *AttachInstancesInput) SetInstanceIds(v []*string) *AttachInstancesInput { - s.InstanceIds = v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *AttachInstancesInput) SetScalingGroupId(v string) *AttachInstancesInput { - s.ScalingGroupId = &v - return s -} - -type AttachInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s AttachInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachInstancesOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_server_groups.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_server_groups.go deleted file mode 100644 index e31f6ad3f126..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_attach_server_groups.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opAttachServerGroupsCommon = "AttachServerGroups" - -// AttachServerGroupsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the AttachServerGroupsCommon operation. The "output" return -// value will be populated with the AttachServerGroupsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AttachServerGroupsCommon Request to send the API call to the service. -// the "output" return value is not valid until after AttachServerGroupsCommon Send returns without error. -// -// See AttachServerGroupsCommon for more information on using the AttachServerGroupsCommon -// API call, and error handling. -// -// // Example sending a request using the AttachServerGroupsCommonRequest method. -// req, resp := client.AttachServerGroupsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) AttachServerGroupsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opAttachServerGroupsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// AttachServerGroupsCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation AttachServerGroupsCommon for usage and error information. -func (c *AUTOSCALING) AttachServerGroupsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.AttachServerGroupsCommonRequest(input) - return out, req.Send() -} - -// AttachServerGroupsCommonWithContext is the same as AttachServerGroupsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See AttachServerGroupsCommon 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 *AUTOSCALING) AttachServerGroupsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.AttachServerGroupsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachServerGroups = "AttachServerGroups" - -// AttachServerGroupsRequest generates a "volcengine/request.Request" representing the -// client's request for the AttachServerGroups operation. The "output" return -// value will be populated with the AttachServerGroupsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AttachServerGroupsCommon Request to send the API call to the service. -// the "output" return value is not valid until after AttachServerGroupsCommon Send returns without error. -// -// See AttachServerGroups for more information on using the AttachServerGroups -// API call, and error handling. -// -// // Example sending a request using the AttachServerGroupsRequest method. -// req, resp := client.AttachServerGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) AttachServerGroupsRequest(input *AttachServerGroupsInput) (req *request.Request, output *AttachServerGroupsOutput) { - op := &request.Operation{ - Name: opAttachServerGroups, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &AttachServerGroupsInput{} - } - - output = &AttachServerGroupsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// AttachServerGroups API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation AttachServerGroups for usage and error information. -func (c *AUTOSCALING) AttachServerGroups(input *AttachServerGroupsInput) (*AttachServerGroupsOutput, error) { - req, out := c.AttachServerGroupsRequest(input) - return out, req.Send() -} - -// AttachServerGroupsWithContext is the same as AttachServerGroups with the addition of -// the ability to pass a context and additional request options. -// -// See AttachServerGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) AttachServerGroupsWithContext(ctx volcengine.Context, input *AttachServerGroupsInput, opts ...request.Option) (*AttachServerGroupsOutput, error) { - req, out := c.AttachServerGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AttachServerGroupsInput struct { - _ struct{} `type:"structure"` - - ScalingGroupId *string `type:"string"` - - ServerGroupAttributes []*ServerGroupAttributeForAttachServerGroupsInput `type:"list"` -} - -// String returns the string representation -func (s AttachServerGroupsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachServerGroupsInput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *AttachServerGroupsInput) SetScalingGroupId(v string) *AttachServerGroupsInput { - s.ScalingGroupId = &v - return s -} - -// SetServerGroupAttributes sets the ServerGroupAttributes field's value. -func (s *AttachServerGroupsInput) SetServerGroupAttributes(v []*ServerGroupAttributeForAttachServerGroupsInput) *AttachServerGroupsInput { - s.ServerGroupAttributes = v - return s -} - -type AttachServerGroupsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s AttachServerGroupsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachServerGroupsOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *AttachServerGroupsOutput) SetScalingGroupId(v string) *AttachServerGroupsOutput { - s.ScalingGroupId = &v - return s -} - -type ServerGroupAttributeForAttachServerGroupsInput struct { - _ struct{} `type:"structure"` - - Port *int32 `type:"int32"` - - ServerGroupId *string `type:"string"` - - Weight *int32 `type:"int32"` -} - -// String returns the string representation -func (s ServerGroupAttributeForAttachServerGroupsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServerGroupAttributeForAttachServerGroupsInput) GoString() string { - return s.String() -} - -// SetPort sets the Port field's value. -func (s *ServerGroupAttributeForAttachServerGroupsInput) SetPort(v int32) *ServerGroupAttributeForAttachServerGroupsInput { - s.Port = &v - return s -} - -// SetServerGroupId sets the ServerGroupId field's value. -func (s *ServerGroupAttributeForAttachServerGroupsInput) SetServerGroupId(v string) *ServerGroupAttributeForAttachServerGroupsInput { - s.ServerGroupId = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *ServerGroupAttributeForAttachServerGroupsInput) SetWeight(v int32) *ServerGroupAttributeForAttachServerGroupsInput { - s.Weight = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_complete_lifecycle_activity.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_complete_lifecycle_activity.go deleted file mode 100644 index 04b94eb0b023..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_complete_lifecycle_activity.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCompleteLifecycleActivityCommon = "CompleteLifecycleActivity" - -// CompleteLifecycleActivityCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CompleteLifecycleActivityCommon operation. The "output" return -// value will be populated with the CompleteLifecycleActivityCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CompleteLifecycleActivityCommon Request to send the API call to the service. -// the "output" return value is not valid until after CompleteLifecycleActivityCommon Send returns without error. -// -// See CompleteLifecycleActivityCommon for more information on using the CompleteLifecycleActivityCommon -// API call, and error handling. -// -// // Example sending a request using the CompleteLifecycleActivityCommonRequest method. -// req, resp := client.CompleteLifecycleActivityCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CompleteLifecycleActivityCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCompleteLifecycleActivityCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CompleteLifecycleActivityCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CompleteLifecycleActivityCommon for usage and error information. -func (c *AUTOSCALING) CompleteLifecycleActivityCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CompleteLifecycleActivityCommonRequest(input) - return out, req.Send() -} - -// CompleteLifecycleActivityCommonWithContext is the same as CompleteLifecycleActivityCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CompleteLifecycleActivityCommon 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 *AUTOSCALING) CompleteLifecycleActivityCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CompleteLifecycleActivityCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCompleteLifecycleActivity = "CompleteLifecycleActivity" - -// CompleteLifecycleActivityRequest generates a "volcengine/request.Request" representing the -// client's request for the CompleteLifecycleActivity operation. The "output" return -// value will be populated with the CompleteLifecycleActivityCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CompleteLifecycleActivityCommon Request to send the API call to the service. -// the "output" return value is not valid until after CompleteLifecycleActivityCommon Send returns without error. -// -// See CompleteLifecycleActivity for more information on using the CompleteLifecycleActivity -// API call, and error handling. -// -// // Example sending a request using the CompleteLifecycleActivityRequest method. -// req, resp := client.CompleteLifecycleActivityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CompleteLifecycleActivityRequest(input *CompleteLifecycleActivityInput) (req *request.Request, output *CompleteLifecycleActivityOutput) { - op := &request.Operation{ - Name: opCompleteLifecycleActivity, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CompleteLifecycleActivityInput{} - } - - output = &CompleteLifecycleActivityOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CompleteLifecycleActivity API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CompleteLifecycleActivity for usage and error information. -func (c *AUTOSCALING) CompleteLifecycleActivity(input *CompleteLifecycleActivityInput) (*CompleteLifecycleActivityOutput, error) { - req, out := c.CompleteLifecycleActivityRequest(input) - return out, req.Send() -} - -// CompleteLifecycleActivityWithContext is the same as CompleteLifecycleActivity with the addition of -// the ability to pass a context and additional request options. -// -// See CompleteLifecycleActivity for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) CompleteLifecycleActivityWithContext(ctx volcengine.Context, input *CompleteLifecycleActivityInput, opts ...request.Option) (*CompleteLifecycleActivityOutput, error) { - req, out := c.CompleteLifecycleActivityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CompleteLifecycleActivityInput struct { - _ struct{} `type:"structure"` - - LifecycleActivityId *string `type:"string"` - - LifecycleActivityPolicy *string `type:"string"` -} - -// String returns the string representation -func (s CompleteLifecycleActivityInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteLifecycleActivityInput) GoString() string { - return s.String() -} - -// SetLifecycleActivityId sets the LifecycleActivityId field's value. -func (s *CompleteLifecycleActivityInput) SetLifecycleActivityId(v string) *CompleteLifecycleActivityInput { - s.LifecycleActivityId = &v - return s -} - -// SetLifecycleActivityPolicy sets the LifecycleActivityPolicy field's value. -func (s *CompleteLifecycleActivityInput) SetLifecycleActivityPolicy(v string) *CompleteLifecycleActivityInput { - s.LifecycleActivityPolicy = &v - return s -} - -type CompleteLifecycleActivityOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - InstanceId *string `type:"string"` - - LifecycleActivityId *string `type:"string"` -} - -// String returns the string representation -func (s CompleteLifecycleActivityOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CompleteLifecycleActivityOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CompleteLifecycleActivityOutput) SetInstanceId(v string) *CompleteLifecycleActivityOutput { - s.InstanceId = &v - return s -} - -// SetLifecycleActivityId sets the LifecycleActivityId field's value. -func (s *CompleteLifecycleActivityOutput) SetLifecycleActivityId(v string) *CompleteLifecycleActivityOutput { - s.LifecycleActivityId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_lifecycle_hook.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_lifecycle_hook.go deleted file mode 100644 index c21658fd0a19..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_lifecycle_hook.go +++ /dev/null @@ -1,218 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCreateLifecycleHookCommon = "CreateLifecycleHook" - -// CreateLifecycleHookCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateLifecycleHookCommon operation. The "output" return -// value will be populated with the CreateLifecycleHookCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateLifecycleHookCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateLifecycleHookCommon Send returns without error. -// -// See CreateLifecycleHookCommon for more information on using the CreateLifecycleHookCommon -// API call, and error handling. -// -// // Example sending a request using the CreateLifecycleHookCommonRequest method. -// req, resp := client.CreateLifecycleHookCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CreateLifecycleHookCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCreateLifecycleHookCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CreateLifecycleHookCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CreateLifecycleHookCommon for usage and error information. -func (c *AUTOSCALING) CreateLifecycleHookCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CreateLifecycleHookCommonRequest(input) - return out, req.Send() -} - -// CreateLifecycleHookCommonWithContext is the same as CreateLifecycleHookCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CreateLifecycleHookCommon 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 *AUTOSCALING) CreateLifecycleHookCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CreateLifecycleHookCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateLifecycleHook = "CreateLifecycleHook" - -// CreateLifecycleHookRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateLifecycleHook operation. The "output" return -// value will be populated with the CreateLifecycleHookCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateLifecycleHookCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateLifecycleHookCommon Send returns without error. -// -// See CreateLifecycleHook for more information on using the CreateLifecycleHook -// API call, and error handling. -// -// // Example sending a request using the CreateLifecycleHookRequest method. -// req, resp := client.CreateLifecycleHookRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CreateLifecycleHookRequest(input *CreateLifecycleHookInput) (req *request.Request, output *CreateLifecycleHookOutput) { - op := &request.Operation{ - Name: opCreateLifecycleHook, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CreateLifecycleHookInput{} - } - - output = &CreateLifecycleHookOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CreateLifecycleHook API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CreateLifecycleHook for usage and error information. -func (c *AUTOSCALING) CreateLifecycleHook(input *CreateLifecycleHookInput) (*CreateLifecycleHookOutput, error) { - req, out := c.CreateLifecycleHookRequest(input) - return out, req.Send() -} - -// CreateLifecycleHookWithContext is the same as CreateLifecycleHook with the addition of -// the ability to pass a context and additional request options. -// -// See CreateLifecycleHook for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) CreateLifecycleHookWithContext(ctx volcengine.Context, input *CreateLifecycleHookInput, opts ...request.Option) (*CreateLifecycleHookOutput, error) { - req, out := c.CreateLifecycleHookRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CreateLifecycleHookInput struct { - _ struct{} `type:"structure"` - - LifecycleHookName *string `type:"string"` - - LifecycleHookPolicy *string `type:"string"` - - LifecycleHookTimeout *int32 `type:"int32"` - - LifecycleHookType *string `type:"string"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s CreateLifecycleHookInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLifecycleHookInput) GoString() string { - return s.String() -} - -// SetLifecycleHookName sets the LifecycleHookName field's value. -func (s *CreateLifecycleHookInput) SetLifecycleHookName(v string) *CreateLifecycleHookInput { - s.LifecycleHookName = &v - return s -} - -// SetLifecycleHookPolicy sets the LifecycleHookPolicy field's value. -func (s *CreateLifecycleHookInput) SetLifecycleHookPolicy(v string) *CreateLifecycleHookInput { - s.LifecycleHookPolicy = &v - return s -} - -// SetLifecycleHookTimeout sets the LifecycleHookTimeout field's value. -func (s *CreateLifecycleHookInput) SetLifecycleHookTimeout(v int32) *CreateLifecycleHookInput { - s.LifecycleHookTimeout = &v - return s -} - -// SetLifecycleHookType sets the LifecycleHookType field's value. -func (s *CreateLifecycleHookInput) SetLifecycleHookType(v string) *CreateLifecycleHookInput { - s.LifecycleHookType = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *CreateLifecycleHookInput) SetScalingGroupId(v string) *CreateLifecycleHookInput { - s.ScalingGroupId = &v - return s -} - -type CreateLifecycleHookOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - LifecycleHookId *string `type:"string"` -} - -// String returns the string representation -func (s CreateLifecycleHookOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateLifecycleHookOutput) GoString() string { - return s.String() -} - -// SetLifecycleHookId sets the LifecycleHookId field's value. -func (s *CreateLifecycleHookOutput) SetLifecycleHookId(v string) *CreateLifecycleHookOutput { - s.LifecycleHookId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_configuration.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_configuration.go deleted file mode 100644 index 8a3396b82782..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_configuration.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCreateScalingConfigurationCommon = "CreateScalingConfiguration" - -// CreateScalingConfigurationCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateScalingConfigurationCommon operation. The "output" return -// value will be populated with the CreateScalingConfigurationCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateScalingConfigurationCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateScalingConfigurationCommon Send returns without error. -// -// See CreateScalingConfigurationCommon for more information on using the CreateScalingConfigurationCommon -// API call, and error handling. -// -// // Example sending a request using the CreateScalingConfigurationCommonRequest method. -// req, resp := client.CreateScalingConfigurationCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CreateScalingConfigurationCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCreateScalingConfigurationCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CreateScalingConfigurationCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CreateScalingConfigurationCommon for usage and error information. -func (c *AUTOSCALING) CreateScalingConfigurationCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CreateScalingConfigurationCommonRequest(input) - return out, req.Send() -} - -// CreateScalingConfigurationCommonWithContext is the same as CreateScalingConfigurationCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CreateScalingConfigurationCommon 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 *AUTOSCALING) CreateScalingConfigurationCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CreateScalingConfigurationCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateScalingConfiguration = "CreateScalingConfiguration" - -// CreateScalingConfigurationRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateScalingConfiguration operation. The "output" return -// value will be populated with the CreateScalingConfigurationCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateScalingConfigurationCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateScalingConfigurationCommon Send returns without error. -// -// See CreateScalingConfiguration for more information on using the CreateScalingConfiguration -// API call, and error handling. -// -// // Example sending a request using the CreateScalingConfigurationRequest method. -// req, resp := client.CreateScalingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CreateScalingConfigurationRequest(input *CreateScalingConfigurationInput) (req *request.Request, output *CreateScalingConfigurationOutput) { - op := &request.Operation{ - Name: opCreateScalingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CreateScalingConfigurationInput{} - } - - output = &CreateScalingConfigurationOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CreateScalingConfiguration API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CreateScalingConfiguration for usage and error information. -func (c *AUTOSCALING) CreateScalingConfiguration(input *CreateScalingConfigurationInput) (*CreateScalingConfigurationOutput, error) { - req, out := c.CreateScalingConfigurationRequest(input) - return out, req.Send() -} - -// CreateScalingConfigurationWithContext is the same as CreateScalingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See CreateScalingConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) CreateScalingConfigurationWithContext(ctx volcengine.Context, input *CreateScalingConfigurationInput, opts ...request.Option) (*CreateScalingConfigurationOutput, error) { - req, out := c.CreateScalingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CreateScalingConfigurationInput struct { - _ struct{} `type:"structure"` - - Eip *EipForCreateScalingConfigurationInput `type:"structure"` - - HostName *string `type:"string"` - - ImageId *string `type:"string"` - - InstanceDescription *string `type:"string"` - - InstanceName *string `type:"string"` - - InstanceTypes []*string `type:"list"` - - KeyPairName *string `type:"string"` - - Password *string `type:"string"` - - ScalingConfigurationName *string `type:"string"` - - ScalingGroupId *string `type:"string"` - - SecurityEnhancementStrategy *string `type:"string"` - - SecurityGroupIds []*string `type:"list"` - - UserData *string `type:"string"` - - Volumes []*VolumeForCreateScalingConfigurationInput `type:"list"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s CreateScalingConfigurationInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateScalingConfigurationInput) GoString() string { - return s.String() -} - -// SetEip sets the Eip field's value. -func (s *CreateScalingConfigurationInput) SetEip(v *EipForCreateScalingConfigurationInput) *CreateScalingConfigurationInput { - s.Eip = v - return s -} - -// SetHostName sets the HostName field's value. -func (s *CreateScalingConfigurationInput) SetHostName(v string) *CreateScalingConfigurationInput { - s.HostName = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *CreateScalingConfigurationInput) SetImageId(v string) *CreateScalingConfigurationInput { - s.ImageId = &v - return s -} - -// SetInstanceDescription sets the InstanceDescription field's value. -func (s *CreateScalingConfigurationInput) SetInstanceDescription(v string) *CreateScalingConfigurationInput { - s.InstanceDescription = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *CreateScalingConfigurationInput) SetInstanceName(v string) *CreateScalingConfigurationInput { - s.InstanceName = &v - return s -} - -// SetInstanceTypes sets the InstanceTypes field's value. -func (s *CreateScalingConfigurationInput) SetInstanceTypes(v []*string) *CreateScalingConfigurationInput { - s.InstanceTypes = v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *CreateScalingConfigurationInput) SetKeyPairName(v string) *CreateScalingConfigurationInput { - s.KeyPairName = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *CreateScalingConfigurationInput) SetPassword(v string) *CreateScalingConfigurationInput { - s.Password = &v - return s -} - -// SetScalingConfigurationName sets the ScalingConfigurationName field's value. -func (s *CreateScalingConfigurationInput) SetScalingConfigurationName(v string) *CreateScalingConfigurationInput { - s.ScalingConfigurationName = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *CreateScalingConfigurationInput) SetScalingGroupId(v string) *CreateScalingConfigurationInput { - s.ScalingGroupId = &v - return s -} - -// SetSecurityEnhancementStrategy sets the SecurityEnhancementStrategy field's value. -func (s *CreateScalingConfigurationInput) SetSecurityEnhancementStrategy(v string) *CreateScalingConfigurationInput { - s.SecurityEnhancementStrategy = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateScalingConfigurationInput) SetSecurityGroupIds(v []*string) *CreateScalingConfigurationInput { - s.SecurityGroupIds = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *CreateScalingConfigurationInput) SetUserData(v string) *CreateScalingConfigurationInput { - s.UserData = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *CreateScalingConfigurationInput) SetVolumes(v []*VolumeForCreateScalingConfigurationInput) *CreateScalingConfigurationInput { - s.Volumes = v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *CreateScalingConfigurationInput) SetZoneId(v string) *CreateScalingConfigurationInput { - s.ZoneId = &v - return s -} - -type CreateScalingConfigurationOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingConfigurationId *string `type:"string"` -} - -// String returns the string representation -func (s CreateScalingConfigurationOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateScalingConfigurationOutput) GoString() string { - return s.String() -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *CreateScalingConfigurationOutput) SetScalingConfigurationId(v string) *CreateScalingConfigurationOutput { - s.ScalingConfigurationId = &v - return s -} - -type EipForCreateScalingConfigurationInput struct { - _ struct{} `type:"structure"` - - Bandwidth *int32 `type:"int32"` - - BillingType *string `type:"string"` - - ISP *string `type:"string"` -} - -// String returns the string representation -func (s EipForCreateScalingConfigurationInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EipForCreateScalingConfigurationInput) GoString() string { - return s.String() -} - -// SetBandwidth sets the Bandwidth field's value. -func (s *EipForCreateScalingConfigurationInput) SetBandwidth(v int32) *EipForCreateScalingConfigurationInput { - s.Bandwidth = &v - return s -} - -// SetBillingType sets the BillingType field's value. -func (s *EipForCreateScalingConfigurationInput) SetBillingType(v string) *EipForCreateScalingConfigurationInput { - s.BillingType = &v - return s -} - -// SetISP sets the ISP field's value. -func (s *EipForCreateScalingConfigurationInput) SetISP(v string) *EipForCreateScalingConfigurationInput { - s.ISP = &v - return s -} - -type VolumeForCreateScalingConfigurationInput struct { - _ struct{} `type:"structure"` - - DeleteWithInstance *bool `type:"boolean"` - - Size *int32 `type:"int32"` - - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s VolumeForCreateScalingConfigurationInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeForCreateScalingConfigurationInput) GoString() string { - return s.String() -} - -// SetDeleteWithInstance sets the DeleteWithInstance field's value. -func (s *VolumeForCreateScalingConfigurationInput) SetDeleteWithInstance(v bool) *VolumeForCreateScalingConfigurationInput { - s.DeleteWithInstance = &v - return s -} - -// SetSize sets the Size field's value. -func (s *VolumeForCreateScalingConfigurationInput) SetSize(v int32) *VolumeForCreateScalingConfigurationInput { - s.Size = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *VolumeForCreateScalingConfigurationInput) SetVolumeType(v string) *VolumeForCreateScalingConfigurationInput { - s.VolumeType = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_group.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_group.go deleted file mode 100644 index ac8724d190cf..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_group.go +++ /dev/null @@ -1,296 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCreateScalingGroupCommon = "CreateScalingGroup" - -// CreateScalingGroupCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateScalingGroupCommon operation. The "output" return -// value will be populated with the CreateScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateScalingGroupCommon Send returns without error. -// -// See CreateScalingGroupCommon for more information on using the CreateScalingGroupCommon -// API call, and error handling. -// -// // Example sending a request using the CreateScalingGroupCommonRequest method. -// req, resp := client.CreateScalingGroupCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CreateScalingGroupCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCreateScalingGroupCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CreateScalingGroupCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CreateScalingGroupCommon for usage and error information. -func (c *AUTOSCALING) CreateScalingGroupCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CreateScalingGroupCommonRequest(input) - return out, req.Send() -} - -// CreateScalingGroupCommonWithContext is the same as CreateScalingGroupCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CreateScalingGroupCommon 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 *AUTOSCALING) CreateScalingGroupCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CreateScalingGroupCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateScalingGroup = "CreateScalingGroup" - -// CreateScalingGroupRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateScalingGroup operation. The "output" return -// value will be populated with the CreateScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateScalingGroupCommon Send returns without error. -// -// See CreateScalingGroup for more information on using the CreateScalingGroup -// API call, and error handling. -// -// // Example sending a request using the CreateScalingGroupRequest method. -// req, resp := client.CreateScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CreateScalingGroupRequest(input *CreateScalingGroupInput) (req *request.Request, output *CreateScalingGroupOutput) { - op := &request.Operation{ - Name: opCreateScalingGroup, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CreateScalingGroupInput{} - } - - output = &CreateScalingGroupOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CreateScalingGroup API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CreateScalingGroup for usage and error information. -func (c *AUTOSCALING) CreateScalingGroup(input *CreateScalingGroupInput) (*CreateScalingGroupOutput, error) { - req, out := c.CreateScalingGroupRequest(input) - return out, req.Send() -} - -// CreateScalingGroupWithContext is the same as CreateScalingGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateScalingGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) CreateScalingGroupWithContext(ctx volcengine.Context, input *CreateScalingGroupInput, opts ...request.Option) (*CreateScalingGroupOutput, error) { - req, out := c.CreateScalingGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CreateScalingGroupInput struct { - _ struct{} `type:"structure"` - - DBInstanceIds []*string `type:"list"` - - DefaultCooldown *int32 `type:"int32"` - - DesireInstanceNumber *int32 `type:"int32"` - - InstanceTerminatePolicy *string `type:"string"` - - MaxInstanceNumber *int32 `type:"int32"` - - MinInstanceNumber *int32 `type:"int32"` - - MultiAZPolicy *string `type:"string"` - - ScalingGroupName *string `type:"string"` - - ServerGroupAttributes []*ServerGroupAttributeForCreateScalingGroupInput `type:"list"` - - SubnetIds []*string `type:"list"` -} - -// String returns the string representation -func (s CreateScalingGroupInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateScalingGroupInput) GoString() string { - return s.String() -} - -// SetDBInstanceIds sets the DBInstanceIds field's value. -func (s *CreateScalingGroupInput) SetDBInstanceIds(v []*string) *CreateScalingGroupInput { - s.DBInstanceIds = v - return s -} - -// SetDefaultCooldown sets the DefaultCooldown field's value. -func (s *CreateScalingGroupInput) SetDefaultCooldown(v int32) *CreateScalingGroupInput { - s.DefaultCooldown = &v - return s -} - -// SetDesireInstanceNumber sets the DesireInstanceNumber field's value. -func (s *CreateScalingGroupInput) SetDesireInstanceNumber(v int32) *CreateScalingGroupInput { - s.DesireInstanceNumber = &v - return s -} - -// SetInstanceTerminatePolicy sets the InstanceTerminatePolicy field's value. -func (s *CreateScalingGroupInput) SetInstanceTerminatePolicy(v string) *CreateScalingGroupInput { - s.InstanceTerminatePolicy = &v - return s -} - -// SetMaxInstanceNumber sets the MaxInstanceNumber field's value. -func (s *CreateScalingGroupInput) SetMaxInstanceNumber(v int32) *CreateScalingGroupInput { - s.MaxInstanceNumber = &v - return s -} - -// SetMinInstanceNumber sets the MinInstanceNumber field's value. -func (s *CreateScalingGroupInput) SetMinInstanceNumber(v int32) *CreateScalingGroupInput { - s.MinInstanceNumber = &v - return s -} - -// SetMultiAZPolicy sets the MultiAZPolicy field's value. -func (s *CreateScalingGroupInput) SetMultiAZPolicy(v string) *CreateScalingGroupInput { - s.MultiAZPolicy = &v - return s -} - -// SetScalingGroupName sets the ScalingGroupName field's value. -func (s *CreateScalingGroupInput) SetScalingGroupName(v string) *CreateScalingGroupInput { - s.ScalingGroupName = &v - return s -} - -// SetServerGroupAttributes sets the ServerGroupAttributes field's value. -func (s *CreateScalingGroupInput) SetServerGroupAttributes(v []*ServerGroupAttributeForCreateScalingGroupInput) *CreateScalingGroupInput { - s.ServerGroupAttributes = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateScalingGroupInput) SetSubnetIds(v []*string) *CreateScalingGroupInput { - s.SubnetIds = v - return s -} - -type CreateScalingGroupOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s CreateScalingGroupOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateScalingGroupOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *CreateScalingGroupOutput) SetScalingGroupId(v string) *CreateScalingGroupOutput { - s.ScalingGroupId = &v - return s -} - -type ServerGroupAttributeForCreateScalingGroupInput struct { - _ struct{} `type:"structure"` - - Port *int32 `type:"int32"` - - ServerGroupId *string `type:"string"` - - Weight *int32 `type:"int32"` -} - -// String returns the string representation -func (s ServerGroupAttributeForCreateScalingGroupInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServerGroupAttributeForCreateScalingGroupInput) GoString() string { - return s.String() -} - -// SetPort sets the Port field's value. -func (s *ServerGroupAttributeForCreateScalingGroupInput) SetPort(v int32) *ServerGroupAttributeForCreateScalingGroupInput { - s.Port = &v - return s -} - -// SetServerGroupId sets the ServerGroupId field's value. -func (s *ServerGroupAttributeForCreateScalingGroupInput) SetServerGroupId(v string) *ServerGroupAttributeForCreateScalingGroupInput { - s.ServerGroupId = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *ServerGroupAttributeForCreateScalingGroupInput) SetWeight(v int32) *ServerGroupAttributeForCreateScalingGroupInput { - s.Weight = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_policy.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_policy.go deleted file mode 100644 index 628180986577..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_create_scaling_policy.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCreateScalingPolicyCommon = "CreateScalingPolicy" - -// CreateScalingPolicyCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateScalingPolicyCommon operation. The "output" return -// value will be populated with the CreateScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateScalingPolicyCommon Send returns without error. -// -// See CreateScalingPolicyCommon for more information on using the CreateScalingPolicyCommon -// API call, and error handling. -// -// // Example sending a request using the CreateScalingPolicyCommonRequest method. -// req, resp := client.CreateScalingPolicyCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CreateScalingPolicyCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCreateScalingPolicyCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CreateScalingPolicyCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CreateScalingPolicyCommon for usage and error information. -func (c *AUTOSCALING) CreateScalingPolicyCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CreateScalingPolicyCommonRequest(input) - return out, req.Send() -} - -// CreateScalingPolicyCommonWithContext is the same as CreateScalingPolicyCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CreateScalingPolicyCommon 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 *AUTOSCALING) CreateScalingPolicyCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CreateScalingPolicyCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateScalingPolicy = "CreateScalingPolicy" - -// CreateScalingPolicyRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateScalingPolicy operation. The "output" return -// value will be populated with the CreateScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateScalingPolicyCommon Send returns without error. -// -// See CreateScalingPolicy for more information on using the CreateScalingPolicy -// API call, and error handling. -// -// // Example sending a request using the CreateScalingPolicyRequest method. -// req, resp := client.CreateScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) CreateScalingPolicyRequest(input *CreateScalingPolicyInput) (req *request.Request, output *CreateScalingPolicyOutput) { - op := &request.Operation{ - Name: opCreateScalingPolicy, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CreateScalingPolicyInput{} - } - - output = &CreateScalingPolicyOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CreateScalingPolicy API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation CreateScalingPolicy for usage and error information. -func (c *AUTOSCALING) CreateScalingPolicy(input *CreateScalingPolicyInput) (*CreateScalingPolicyOutput, error) { - req, out := c.CreateScalingPolicyRequest(input) - return out, req.Send() -} - -// CreateScalingPolicyWithContext is the same as CreateScalingPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See CreateScalingPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) CreateScalingPolicyWithContext(ctx volcengine.Context, input *CreateScalingPolicyInput, opts ...request.Option) (*CreateScalingPolicyOutput, error) { - req, out := c.CreateScalingPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AlarmPolicyConditionForCreateScalingPolicyInput struct { - _ struct{} `type:"structure"` - - ComparisonOperator *string `type:"string"` - - MetricName *string `type:"string"` - - MetricUnit *string `type:"string"` - - Threshold *string `type:"string"` -} - -// String returns the string representation -func (s AlarmPolicyConditionForCreateScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AlarmPolicyConditionForCreateScalingPolicyInput) GoString() string { - return s.String() -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *AlarmPolicyConditionForCreateScalingPolicyInput) SetComparisonOperator(v string) *AlarmPolicyConditionForCreateScalingPolicyInput { - s.ComparisonOperator = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *AlarmPolicyConditionForCreateScalingPolicyInput) SetMetricName(v string) *AlarmPolicyConditionForCreateScalingPolicyInput { - s.MetricName = &v - return s -} - -// SetMetricUnit sets the MetricUnit field's value. -func (s *AlarmPolicyConditionForCreateScalingPolicyInput) SetMetricUnit(v string) *AlarmPolicyConditionForCreateScalingPolicyInput { - s.MetricUnit = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *AlarmPolicyConditionForCreateScalingPolicyInput) SetThreshold(v string) *AlarmPolicyConditionForCreateScalingPolicyInput { - s.Threshold = &v - return s -} - -type AlarmPolicyForCreateScalingPolicyInput struct { - _ struct{} `type:"structure"` - - Condition *AlarmPolicyConditionForCreateScalingPolicyInput `type:"structure"` - - EvaluationCount *int32 `type:"int32"` - - RuleType *string `type:"string"` -} - -// String returns the string representation -func (s AlarmPolicyForCreateScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AlarmPolicyForCreateScalingPolicyInput) GoString() string { - return s.String() -} - -// SetCondition sets the Condition field's value. -func (s *AlarmPolicyForCreateScalingPolicyInput) SetCondition(v *AlarmPolicyConditionForCreateScalingPolicyInput) *AlarmPolicyForCreateScalingPolicyInput { - s.Condition = v - return s -} - -// SetEvaluationCount sets the EvaluationCount field's value. -func (s *AlarmPolicyForCreateScalingPolicyInput) SetEvaluationCount(v int32) *AlarmPolicyForCreateScalingPolicyInput { - s.EvaluationCount = &v - return s -} - -// SetRuleType sets the RuleType field's value. -func (s *AlarmPolicyForCreateScalingPolicyInput) SetRuleType(v string) *AlarmPolicyForCreateScalingPolicyInput { - s.RuleType = &v - return s -} - -type CreateScalingPolicyInput struct { - _ struct{} `type:"structure"` - - AdjustmentType *string `type:"string"` - - AdjustmentValue *int32 `type:"int32"` - - AlarmPolicy *AlarmPolicyForCreateScalingPolicyInput `type:"structure"` - - Cooldown *int32 `type:"int32"` - - ScalingGroupId *string `type:"string"` - - ScalingPolicyName *string `type:"string"` - - ScalingPolicyType *string `type:"string"` - - ScheduledPolicy *ScheduledPolicyForCreateScalingPolicyInput `type:"structure"` -} - -// String returns the string representation -func (s CreateScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateScalingPolicyInput) GoString() string { - return s.String() -} - -// SetAdjustmentType sets the AdjustmentType field's value. -func (s *CreateScalingPolicyInput) SetAdjustmentType(v string) *CreateScalingPolicyInput { - s.AdjustmentType = &v - return s -} - -// SetAdjustmentValue sets the AdjustmentValue field's value. -func (s *CreateScalingPolicyInput) SetAdjustmentValue(v int32) *CreateScalingPolicyInput { - s.AdjustmentValue = &v - return s -} - -// SetAlarmPolicy sets the AlarmPolicy field's value. -func (s *CreateScalingPolicyInput) SetAlarmPolicy(v *AlarmPolicyForCreateScalingPolicyInput) *CreateScalingPolicyInput { - s.AlarmPolicy = v - return s -} - -// SetCooldown sets the Cooldown field's value. -func (s *CreateScalingPolicyInput) SetCooldown(v int32) *CreateScalingPolicyInput { - s.Cooldown = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *CreateScalingPolicyInput) SetScalingGroupId(v string) *CreateScalingPolicyInput { - s.ScalingGroupId = &v - return s -} - -// SetScalingPolicyName sets the ScalingPolicyName field's value. -func (s *CreateScalingPolicyInput) SetScalingPolicyName(v string) *CreateScalingPolicyInput { - s.ScalingPolicyName = &v - return s -} - -// SetScalingPolicyType sets the ScalingPolicyType field's value. -func (s *CreateScalingPolicyInput) SetScalingPolicyType(v string) *CreateScalingPolicyInput { - s.ScalingPolicyType = &v - return s -} - -// SetScheduledPolicy sets the ScheduledPolicy field's value. -func (s *CreateScalingPolicyInput) SetScheduledPolicy(v *ScheduledPolicyForCreateScalingPolicyInput) *CreateScalingPolicyInput { - s.ScheduledPolicy = v - return s -} - -type CreateScalingPolicyOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingPolicyId *string `type:"string"` -} - -// String returns the string representation -func (s CreateScalingPolicyOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateScalingPolicyOutput) GoString() string { - return s.String() -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *CreateScalingPolicyOutput) SetScalingPolicyId(v string) *CreateScalingPolicyOutput { - s.ScalingPolicyId = &v - return s -} - -type ScheduledPolicyForCreateScalingPolicyInput struct { - _ struct{} `type:"structure"` - - LaunchTime *string `type:"string"` - - RecurrenceEndTime *string `type:"string"` - - RecurrenceType *string `type:"string"` - - RecurrenceValue *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledPolicyForCreateScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledPolicyForCreateScalingPolicyInput) GoString() string { - return s.String() -} - -// SetLaunchTime sets the LaunchTime field's value. -func (s *ScheduledPolicyForCreateScalingPolicyInput) SetLaunchTime(v string) *ScheduledPolicyForCreateScalingPolicyInput { - s.LaunchTime = &v - return s -} - -// SetRecurrenceEndTime sets the RecurrenceEndTime field's value. -func (s *ScheduledPolicyForCreateScalingPolicyInput) SetRecurrenceEndTime(v string) *ScheduledPolicyForCreateScalingPolicyInput { - s.RecurrenceEndTime = &v - return s -} - -// SetRecurrenceType sets the RecurrenceType field's value. -func (s *ScheduledPolicyForCreateScalingPolicyInput) SetRecurrenceType(v string) *ScheduledPolicyForCreateScalingPolicyInput { - s.RecurrenceType = &v - return s -} - -// SetRecurrenceValue sets the RecurrenceValue field's value. -func (s *ScheduledPolicyForCreateScalingPolicyInput) SetRecurrenceValue(v string) *ScheduledPolicyForCreateScalingPolicyInput { - s.RecurrenceValue = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_lifecycle_hook.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_lifecycle_hook.go deleted file mode 100644 index fa80433d7f4f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_lifecycle_hook.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteLifecycleHookCommon = "DeleteLifecycleHook" - -// DeleteLifecycleHookCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteLifecycleHookCommon operation. The "output" return -// value will be populated with the DeleteLifecycleHookCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteLifecycleHookCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteLifecycleHookCommon Send returns without error. -// -// See DeleteLifecycleHookCommon for more information on using the DeleteLifecycleHookCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteLifecycleHookCommonRequest method. -// req, resp := client.DeleteLifecycleHookCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DeleteLifecycleHookCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteLifecycleHookCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteLifecycleHookCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DeleteLifecycleHookCommon for usage and error information. -func (c *AUTOSCALING) DeleteLifecycleHookCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteLifecycleHookCommonRequest(input) - return out, req.Send() -} - -// DeleteLifecycleHookCommonWithContext is the same as DeleteLifecycleHookCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteLifecycleHookCommon 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 *AUTOSCALING) DeleteLifecycleHookCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteLifecycleHookCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteLifecycleHook = "DeleteLifecycleHook" - -// DeleteLifecycleHookRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteLifecycleHook operation. The "output" return -// value will be populated with the DeleteLifecycleHookCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteLifecycleHookCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteLifecycleHookCommon Send returns without error. -// -// See DeleteLifecycleHook for more information on using the DeleteLifecycleHook -// API call, and error handling. -// -// // Example sending a request using the DeleteLifecycleHookRequest method. -// req, resp := client.DeleteLifecycleHookRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DeleteLifecycleHookRequest(input *DeleteLifecycleHookInput) (req *request.Request, output *DeleteLifecycleHookOutput) { - op := &request.Operation{ - Name: opDeleteLifecycleHook, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLifecycleHookInput{} - } - - output = &DeleteLifecycleHookOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteLifecycleHook API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DeleteLifecycleHook for usage and error information. -func (c *AUTOSCALING) DeleteLifecycleHook(input *DeleteLifecycleHookInput) (*DeleteLifecycleHookOutput, error) { - req, out := c.DeleteLifecycleHookRequest(input) - return out, req.Send() -} - -// DeleteLifecycleHookWithContext is the same as DeleteLifecycleHook with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteLifecycleHook for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DeleteLifecycleHookWithContext(ctx volcengine.Context, input *DeleteLifecycleHookInput, opts ...request.Option) (*DeleteLifecycleHookOutput, error) { - req, out := c.DeleteLifecycleHookRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteLifecycleHookInput struct { - _ struct{} `type:"structure"` - - LifecycleHookId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteLifecycleHookInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLifecycleHookInput) GoString() string { - return s.String() -} - -// SetLifecycleHookId sets the LifecycleHookId field's value. -func (s *DeleteLifecycleHookInput) SetLifecycleHookId(v string) *DeleteLifecycleHookInput { - s.LifecycleHookId = &v - return s -} - -type DeleteLifecycleHookOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - LifecycleHookId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteLifecycleHookOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLifecycleHookOutput) GoString() string { - return s.String() -} - -// SetLifecycleHookId sets the LifecycleHookId field's value. -func (s *DeleteLifecycleHookOutput) SetLifecycleHookId(v string) *DeleteLifecycleHookOutput { - s.LifecycleHookId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_configuration.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_configuration.go deleted file mode 100644 index aa279e060d30..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_configuration.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteScalingConfigurationCommon = "DeleteScalingConfiguration" - -// DeleteScalingConfigurationCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteScalingConfigurationCommon operation. The "output" return -// value will be populated with the DeleteScalingConfigurationCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteScalingConfigurationCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteScalingConfigurationCommon Send returns without error. -// -// See DeleteScalingConfigurationCommon for more information on using the DeleteScalingConfigurationCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteScalingConfigurationCommonRequest method. -// req, resp := client.DeleteScalingConfigurationCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DeleteScalingConfigurationCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteScalingConfigurationCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteScalingConfigurationCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DeleteScalingConfigurationCommon for usage and error information. -func (c *AUTOSCALING) DeleteScalingConfigurationCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteScalingConfigurationCommonRequest(input) - return out, req.Send() -} - -// DeleteScalingConfigurationCommonWithContext is the same as DeleteScalingConfigurationCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteScalingConfigurationCommon 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 *AUTOSCALING) DeleteScalingConfigurationCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteScalingConfigurationCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteScalingConfiguration = "DeleteScalingConfiguration" - -// DeleteScalingConfigurationRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteScalingConfiguration operation. The "output" return -// value will be populated with the DeleteScalingConfigurationCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteScalingConfigurationCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteScalingConfigurationCommon Send returns without error. -// -// See DeleteScalingConfiguration for more information on using the DeleteScalingConfiguration -// API call, and error handling. -// -// // Example sending a request using the DeleteScalingConfigurationRequest method. -// req, resp := client.DeleteScalingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DeleteScalingConfigurationRequest(input *DeleteScalingConfigurationInput) (req *request.Request, output *DeleteScalingConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteScalingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteScalingConfigurationInput{} - } - - output = &DeleteScalingConfigurationOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteScalingConfiguration API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DeleteScalingConfiguration for usage and error information. -func (c *AUTOSCALING) DeleteScalingConfiguration(input *DeleteScalingConfigurationInput) (*DeleteScalingConfigurationOutput, error) { - req, out := c.DeleteScalingConfigurationRequest(input) - return out, req.Send() -} - -// DeleteScalingConfigurationWithContext is the same as DeleteScalingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteScalingConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DeleteScalingConfigurationWithContext(ctx volcengine.Context, input *DeleteScalingConfigurationInput, opts ...request.Option) (*DeleteScalingConfigurationOutput, error) { - req, out := c.DeleteScalingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteScalingConfigurationInput struct { - _ struct{} `type:"structure"` - - ScalingConfigurationId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteScalingConfigurationInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScalingConfigurationInput) GoString() string { - return s.String() -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *DeleteScalingConfigurationInput) SetScalingConfigurationId(v string) *DeleteScalingConfigurationInput { - s.ScalingConfigurationId = &v - return s -} - -type DeleteScalingConfigurationOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingConfigurationId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteScalingConfigurationOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScalingConfigurationOutput) GoString() string { - return s.String() -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *DeleteScalingConfigurationOutput) SetScalingConfigurationId(v string) *DeleteScalingConfigurationOutput { - s.ScalingConfigurationId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_group.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_group.go deleted file mode 100644 index 9144e7f4dfa1..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_group.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteScalingGroupCommon = "DeleteScalingGroup" - -// DeleteScalingGroupCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteScalingGroupCommon operation. The "output" return -// value will be populated with the DeleteScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteScalingGroupCommon Send returns without error. -// -// See DeleteScalingGroupCommon for more information on using the DeleteScalingGroupCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteScalingGroupCommonRequest method. -// req, resp := client.DeleteScalingGroupCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DeleteScalingGroupCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteScalingGroupCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteScalingGroupCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DeleteScalingGroupCommon for usage and error information. -func (c *AUTOSCALING) DeleteScalingGroupCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteScalingGroupCommonRequest(input) - return out, req.Send() -} - -// DeleteScalingGroupCommonWithContext is the same as DeleteScalingGroupCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteScalingGroupCommon 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 *AUTOSCALING) DeleteScalingGroupCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteScalingGroupCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteScalingGroup = "DeleteScalingGroup" - -// DeleteScalingGroupRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteScalingGroup operation. The "output" return -// value will be populated with the DeleteScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteScalingGroupCommon Send returns without error. -// -// See DeleteScalingGroup for more information on using the DeleteScalingGroup -// API call, and error handling. -// -// // Example sending a request using the DeleteScalingGroupRequest method. -// req, resp := client.DeleteScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DeleteScalingGroupRequest(input *DeleteScalingGroupInput) (req *request.Request, output *DeleteScalingGroupOutput) { - op := &request.Operation{ - Name: opDeleteScalingGroup, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteScalingGroupInput{} - } - - output = &DeleteScalingGroupOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteScalingGroup API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DeleteScalingGroup for usage and error information. -func (c *AUTOSCALING) DeleteScalingGroup(input *DeleteScalingGroupInput) (*DeleteScalingGroupOutput, error) { - req, out := c.DeleteScalingGroupRequest(input) - return out, req.Send() -} - -// DeleteScalingGroupWithContext is the same as DeleteScalingGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteScalingGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DeleteScalingGroupWithContext(ctx volcengine.Context, input *DeleteScalingGroupInput, opts ...request.Option) (*DeleteScalingGroupOutput, error) { - req, out := c.DeleteScalingGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteScalingGroupInput struct { - _ struct{} `type:"structure"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteScalingGroupInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScalingGroupInput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DeleteScalingGroupInput) SetScalingGroupId(v string) *DeleteScalingGroupInput { - s.ScalingGroupId = &v - return s -} - -type DeleteScalingGroupOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteScalingGroupOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScalingGroupOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DeleteScalingGroupOutput) SetScalingGroupId(v string) *DeleteScalingGroupOutput { - s.ScalingGroupId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_policy.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_policy.go deleted file mode 100644 index 0f4c00939d1a..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_delete_scaling_policy.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteScalingPolicyCommon = "DeleteScalingPolicy" - -// DeleteScalingPolicyCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteScalingPolicyCommon operation. The "output" return -// value will be populated with the DeleteScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteScalingPolicyCommon Send returns without error. -// -// See DeleteScalingPolicyCommon for more information on using the DeleteScalingPolicyCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteScalingPolicyCommonRequest method. -// req, resp := client.DeleteScalingPolicyCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DeleteScalingPolicyCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteScalingPolicyCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteScalingPolicyCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DeleteScalingPolicyCommon for usage and error information. -func (c *AUTOSCALING) DeleteScalingPolicyCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteScalingPolicyCommonRequest(input) - return out, req.Send() -} - -// DeleteScalingPolicyCommonWithContext is the same as DeleteScalingPolicyCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteScalingPolicyCommon 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 *AUTOSCALING) DeleteScalingPolicyCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteScalingPolicyCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteScalingPolicy = "DeleteScalingPolicy" - -// DeleteScalingPolicyRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteScalingPolicy operation. The "output" return -// value will be populated with the DeleteScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteScalingPolicyCommon Send returns without error. -// -// See DeleteScalingPolicy for more information on using the DeleteScalingPolicy -// API call, and error handling. -// -// // Example sending a request using the DeleteScalingPolicyRequest method. -// req, resp := client.DeleteScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DeleteScalingPolicyRequest(input *DeleteScalingPolicyInput) (req *request.Request, output *DeleteScalingPolicyOutput) { - op := &request.Operation{ - Name: opDeleteScalingPolicy, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteScalingPolicyInput{} - } - - output = &DeleteScalingPolicyOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteScalingPolicy API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DeleteScalingPolicy for usage and error information. -func (c *AUTOSCALING) DeleteScalingPolicy(input *DeleteScalingPolicyInput) (*DeleteScalingPolicyOutput, error) { - req, out := c.DeleteScalingPolicyRequest(input) - return out, req.Send() -} - -// DeleteScalingPolicyWithContext is the same as DeleteScalingPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteScalingPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DeleteScalingPolicyWithContext(ctx volcengine.Context, input *DeleteScalingPolicyInput, opts ...request.Option) (*DeleteScalingPolicyOutput, error) { - req, out := c.DeleteScalingPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteScalingPolicyInput struct { - _ struct{} `type:"structure"` - - ScalingPolicyId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScalingPolicyInput) GoString() string { - return s.String() -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *DeleteScalingPolicyInput) SetScalingPolicyId(v string) *DeleteScalingPolicyInput { - s.ScalingPolicyId = &v - return s -} - -type DeleteScalingPolicyOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingPolicyId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteScalingPolicyOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteScalingPolicyOutput) GoString() string { - return s.String() -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *DeleteScalingPolicyOutput) SetScalingPolicyId(v string) *DeleteScalingPolicyOutput { - s.ScalingPolicyId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_lifecycle_activities.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_lifecycle_activities.go deleted file mode 100644 index b85355a8ffb7..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_lifecycle_activities.go +++ /dev/null @@ -1,304 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeLifecycleActivitiesCommon = "DescribeLifecycleActivities" - -// DescribeLifecycleActivitiesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeLifecycleActivitiesCommon operation. The "output" return -// value will be populated with the DescribeLifecycleActivitiesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeLifecycleActivitiesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeLifecycleActivitiesCommon Send returns without error. -// -// See DescribeLifecycleActivitiesCommon for more information on using the DescribeLifecycleActivitiesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeLifecycleActivitiesCommonRequest method. -// req, resp := client.DescribeLifecycleActivitiesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeLifecycleActivitiesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeLifecycleActivitiesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeLifecycleActivitiesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeLifecycleActivitiesCommon for usage and error information. -func (c *AUTOSCALING) DescribeLifecycleActivitiesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeLifecycleActivitiesCommonRequest(input) - return out, req.Send() -} - -// DescribeLifecycleActivitiesCommonWithContext is the same as DescribeLifecycleActivitiesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLifecycleActivitiesCommon 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 *AUTOSCALING) DescribeLifecycleActivitiesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeLifecycleActivitiesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeLifecycleActivities = "DescribeLifecycleActivities" - -// DescribeLifecycleActivitiesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeLifecycleActivities operation. The "output" return -// value will be populated with the DescribeLifecycleActivitiesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeLifecycleActivitiesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeLifecycleActivitiesCommon Send returns without error. -// -// See DescribeLifecycleActivities for more information on using the DescribeLifecycleActivities -// API call, and error handling. -// -// // Example sending a request using the DescribeLifecycleActivitiesRequest method. -// req, resp := client.DescribeLifecycleActivitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeLifecycleActivitiesRequest(input *DescribeLifecycleActivitiesInput) (req *request.Request, output *DescribeLifecycleActivitiesOutput) { - op := &request.Operation{ - Name: opDescribeLifecycleActivities, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLifecycleActivitiesInput{} - } - - output = &DescribeLifecycleActivitiesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeLifecycleActivities API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeLifecycleActivities for usage and error information. -func (c *AUTOSCALING) DescribeLifecycleActivities(input *DescribeLifecycleActivitiesInput) (*DescribeLifecycleActivitiesOutput, error) { - req, out := c.DescribeLifecycleActivitiesRequest(input) - return out, req.Send() -} - -// DescribeLifecycleActivitiesWithContext is the same as DescribeLifecycleActivities with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLifecycleActivities for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DescribeLifecycleActivitiesWithContext(ctx volcengine.Context, input *DescribeLifecycleActivitiesInput, opts ...request.Option) (*DescribeLifecycleActivitiesOutput, error) { - req, out := c.DescribeLifecycleActivitiesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeLifecycleActivitiesInput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` - - LifecycleActivityStatus *string `type:"string"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingActivityId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLifecycleActivitiesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLifecycleActivitiesInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeLifecycleActivitiesInput) SetInstanceId(v string) *DescribeLifecycleActivitiesInput { - s.InstanceId = &v - return s -} - -// SetLifecycleActivityStatus sets the LifecycleActivityStatus field's value. -func (s *DescribeLifecycleActivitiesInput) SetLifecycleActivityStatus(v string) *DescribeLifecycleActivitiesInput { - s.LifecycleActivityStatus = &v - return s -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeLifecycleActivitiesInput) SetPageNumber(v int32) *DescribeLifecycleActivitiesInput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeLifecycleActivitiesInput) SetPageSize(v int32) *DescribeLifecycleActivitiesInput { - s.PageSize = &v - return s -} - -// SetScalingActivityId sets the ScalingActivityId field's value. -func (s *DescribeLifecycleActivitiesInput) SetScalingActivityId(v string) *DescribeLifecycleActivitiesInput { - s.ScalingActivityId = &v - return s -} - -type DescribeLifecycleActivitiesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - LifecycleActivities []*LifecycleActivityForDescribeLifecycleActivitiesOutput `type:"list"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeLifecycleActivitiesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLifecycleActivitiesOutput) GoString() string { - return s.String() -} - -// SetLifecycleActivities sets the LifecycleActivities field's value. -func (s *DescribeLifecycleActivitiesOutput) SetLifecycleActivities(v []*LifecycleActivityForDescribeLifecycleActivitiesOutput) *DescribeLifecycleActivitiesOutput { - s.LifecycleActivities = v - return s -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeLifecycleActivitiesOutput) SetPageNumber(v int32) *DescribeLifecycleActivitiesOutput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeLifecycleActivitiesOutput) SetPageSize(v int32) *DescribeLifecycleActivitiesOutput { - s.PageSize = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeLifecycleActivitiesOutput) SetTotalCount(v int32) *DescribeLifecycleActivitiesOutput { - s.TotalCount = &v - return s -} - -type LifecycleActivityForDescribeLifecycleActivitiesOutput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` - - LifecycleActivityId *string `type:"string"` - - LifecycleActivityStatus *string `type:"string"` - - LifecycleHookId *string `type:"string"` - - LifecycleHookPolicy *string `type:"string"` - - ScalingActivityId *string `type:"string"` -} - -// String returns the string representation -func (s LifecycleActivityForDescribeLifecycleActivitiesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleActivityForDescribeLifecycleActivitiesOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *LifecycleActivityForDescribeLifecycleActivitiesOutput) SetInstanceId(v string) *LifecycleActivityForDescribeLifecycleActivitiesOutput { - s.InstanceId = &v - return s -} - -// SetLifecycleActivityId sets the LifecycleActivityId field's value. -func (s *LifecycleActivityForDescribeLifecycleActivitiesOutput) SetLifecycleActivityId(v string) *LifecycleActivityForDescribeLifecycleActivitiesOutput { - s.LifecycleActivityId = &v - return s -} - -// SetLifecycleActivityStatus sets the LifecycleActivityStatus field's value. -func (s *LifecycleActivityForDescribeLifecycleActivitiesOutput) SetLifecycleActivityStatus(v string) *LifecycleActivityForDescribeLifecycleActivitiesOutput { - s.LifecycleActivityStatus = &v - return s -} - -// SetLifecycleHookId sets the LifecycleHookId field's value. -func (s *LifecycleActivityForDescribeLifecycleActivitiesOutput) SetLifecycleHookId(v string) *LifecycleActivityForDescribeLifecycleActivitiesOutput { - s.LifecycleHookId = &v - return s -} - -// SetLifecycleHookPolicy sets the LifecycleHookPolicy field's value. -func (s *LifecycleActivityForDescribeLifecycleActivitiesOutput) SetLifecycleHookPolicy(v string) *LifecycleActivityForDescribeLifecycleActivitiesOutput { - s.LifecycleHookPolicy = &v - return s -} - -// SetScalingActivityId sets the ScalingActivityId field's value. -func (s *LifecycleActivityForDescribeLifecycleActivitiesOutput) SetScalingActivityId(v string) *LifecycleActivityForDescribeLifecycleActivitiesOutput { - s.ScalingActivityId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_lifecycle_hooks.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_lifecycle_hooks.go deleted file mode 100644 index 8a3375b2cfe2..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_lifecycle_hooks.go +++ /dev/null @@ -1,304 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeLifecycleHooksCommon = "DescribeLifecycleHooks" - -// DescribeLifecycleHooksCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeLifecycleHooksCommon operation. The "output" return -// value will be populated with the DescribeLifecycleHooksCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeLifecycleHooksCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeLifecycleHooksCommon Send returns without error. -// -// See DescribeLifecycleHooksCommon for more information on using the DescribeLifecycleHooksCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeLifecycleHooksCommonRequest method. -// req, resp := client.DescribeLifecycleHooksCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeLifecycleHooksCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeLifecycleHooksCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeLifecycleHooksCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeLifecycleHooksCommon for usage and error information. -func (c *AUTOSCALING) DescribeLifecycleHooksCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeLifecycleHooksCommonRequest(input) - return out, req.Send() -} - -// DescribeLifecycleHooksCommonWithContext is the same as DescribeLifecycleHooksCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLifecycleHooksCommon 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 *AUTOSCALING) DescribeLifecycleHooksCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeLifecycleHooksCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeLifecycleHooks = "DescribeLifecycleHooks" - -// DescribeLifecycleHooksRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeLifecycleHooks operation. The "output" return -// value will be populated with the DescribeLifecycleHooksCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeLifecycleHooksCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeLifecycleHooksCommon Send returns without error. -// -// See DescribeLifecycleHooks for more information on using the DescribeLifecycleHooks -// API call, and error handling. -// -// // Example sending a request using the DescribeLifecycleHooksRequest method. -// req, resp := client.DescribeLifecycleHooksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeLifecycleHooksRequest(input *DescribeLifecycleHooksInput) (req *request.Request, output *DescribeLifecycleHooksOutput) { - op := &request.Operation{ - Name: opDescribeLifecycleHooks, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeLifecycleHooksInput{} - } - - output = &DescribeLifecycleHooksOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeLifecycleHooks API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeLifecycleHooks for usage and error information. -func (c *AUTOSCALING) DescribeLifecycleHooks(input *DescribeLifecycleHooksInput) (*DescribeLifecycleHooksOutput, error) { - req, out := c.DescribeLifecycleHooksRequest(input) - return out, req.Send() -} - -// DescribeLifecycleHooksWithContext is the same as DescribeLifecycleHooks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeLifecycleHooks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DescribeLifecycleHooksWithContext(ctx volcengine.Context, input *DescribeLifecycleHooksInput, opts ...request.Option) (*DescribeLifecycleHooksOutput, error) { - req, out := c.DescribeLifecycleHooksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeLifecycleHooksInput struct { - _ struct{} `type:"structure"` - - LifecycleHookIds []*string `type:"list"` - - LifecycleHookName *string `type:"string"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeLifecycleHooksInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLifecycleHooksInput) GoString() string { - return s.String() -} - -// SetLifecycleHookIds sets the LifecycleHookIds field's value. -func (s *DescribeLifecycleHooksInput) SetLifecycleHookIds(v []*string) *DescribeLifecycleHooksInput { - s.LifecycleHookIds = v - return s -} - -// SetLifecycleHookName sets the LifecycleHookName field's value. -func (s *DescribeLifecycleHooksInput) SetLifecycleHookName(v string) *DescribeLifecycleHooksInput { - s.LifecycleHookName = &v - return s -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeLifecycleHooksInput) SetPageNumber(v int32) *DescribeLifecycleHooksInput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeLifecycleHooksInput) SetPageSize(v int32) *DescribeLifecycleHooksInput { - s.PageSize = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DescribeLifecycleHooksInput) SetScalingGroupId(v string) *DescribeLifecycleHooksInput { - s.ScalingGroupId = &v - return s -} - -type DescribeLifecycleHooksOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - LifecycleHooks []*LifecycleHookForDescribeLifecycleHooksOutput `type:"list"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeLifecycleHooksOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeLifecycleHooksOutput) GoString() string { - return s.String() -} - -// SetLifecycleHooks sets the LifecycleHooks field's value. -func (s *DescribeLifecycleHooksOutput) SetLifecycleHooks(v []*LifecycleHookForDescribeLifecycleHooksOutput) *DescribeLifecycleHooksOutput { - s.LifecycleHooks = v - return s -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeLifecycleHooksOutput) SetPageNumber(v int32) *DescribeLifecycleHooksOutput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeLifecycleHooksOutput) SetPageSize(v int32) *DescribeLifecycleHooksOutput { - s.PageSize = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeLifecycleHooksOutput) SetTotalCount(v int32) *DescribeLifecycleHooksOutput { - s.TotalCount = &v - return s -} - -type LifecycleHookForDescribeLifecycleHooksOutput struct { - _ struct{} `type:"structure"` - - LifecycleHookId *string `type:"string"` - - LifecycleHookName *string `type:"string"` - - LifecycleHookPolicy *string `type:"string"` - - LifecycleHookTimeout *int32 `type:"int32"` - - LifecycleHookType *string `type:"string"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s LifecycleHookForDescribeLifecycleHooksOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s LifecycleHookForDescribeLifecycleHooksOutput) GoString() string { - return s.String() -} - -// SetLifecycleHookId sets the LifecycleHookId field's value. -func (s *LifecycleHookForDescribeLifecycleHooksOutput) SetLifecycleHookId(v string) *LifecycleHookForDescribeLifecycleHooksOutput { - s.LifecycleHookId = &v - return s -} - -// SetLifecycleHookName sets the LifecycleHookName field's value. -func (s *LifecycleHookForDescribeLifecycleHooksOutput) SetLifecycleHookName(v string) *LifecycleHookForDescribeLifecycleHooksOutput { - s.LifecycleHookName = &v - return s -} - -// SetLifecycleHookPolicy sets the LifecycleHookPolicy field's value. -func (s *LifecycleHookForDescribeLifecycleHooksOutput) SetLifecycleHookPolicy(v string) *LifecycleHookForDescribeLifecycleHooksOutput { - s.LifecycleHookPolicy = &v - return s -} - -// SetLifecycleHookTimeout sets the LifecycleHookTimeout field's value. -func (s *LifecycleHookForDescribeLifecycleHooksOutput) SetLifecycleHookTimeout(v int32) *LifecycleHookForDescribeLifecycleHooksOutput { - s.LifecycleHookTimeout = &v - return s -} - -// SetLifecycleHookType sets the LifecycleHookType field's value. -func (s *LifecycleHookForDescribeLifecycleHooksOutput) SetLifecycleHookType(v string) *LifecycleHookForDescribeLifecycleHooksOutput { - s.LifecycleHookType = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *LifecycleHookForDescribeLifecycleHooksOutput) SetScalingGroupId(v string) *LifecycleHookForDescribeLifecycleHooksOutput { - s.ScalingGroupId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_activities.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_activities.go deleted file mode 100644 index 7bc0b0e3a31b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_activities.go +++ /dev/null @@ -1,438 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeScalingActivitiesCommon = "DescribeScalingActivities" - -// DescribeScalingActivitiesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingActivitiesCommon operation. The "output" return -// value will be populated with the DescribeScalingActivitiesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingActivitiesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingActivitiesCommon Send returns without error. -// -// See DescribeScalingActivitiesCommon for more information on using the DescribeScalingActivitiesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingActivitiesCommonRequest method. -// req, resp := client.DescribeScalingActivitiesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingActivitiesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeScalingActivitiesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingActivitiesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingActivitiesCommon for usage and error information. -func (c *AUTOSCALING) DescribeScalingActivitiesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeScalingActivitiesCommonRequest(input) - return out, req.Send() -} - -// DescribeScalingActivitiesCommonWithContext is the same as DescribeScalingActivitiesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingActivitiesCommon 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 *AUTOSCALING) DescribeScalingActivitiesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeScalingActivitiesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScalingActivities = "DescribeScalingActivities" - -// DescribeScalingActivitiesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingActivities operation. The "output" return -// value will be populated with the DescribeScalingActivitiesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingActivitiesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingActivitiesCommon Send returns without error. -// -// See DescribeScalingActivities for more information on using the DescribeScalingActivities -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingActivitiesRequest method. -// req, resp := client.DescribeScalingActivitiesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingActivitiesRequest(input *DescribeScalingActivitiesInput) (req *request.Request, output *DescribeScalingActivitiesOutput) { - op := &request.Operation{ - Name: opDescribeScalingActivities, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScalingActivitiesInput{} - } - - output = &DescribeScalingActivitiesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingActivities API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingActivities for usage and error information. -func (c *AUTOSCALING) DescribeScalingActivities(input *DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) { - req, out := c.DescribeScalingActivitiesRequest(input) - return out, req.Send() -} - -// DescribeScalingActivitiesWithContext is the same as DescribeScalingActivities with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingActivities for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DescribeScalingActivitiesWithContext(ctx volcengine.Context, input *DescribeScalingActivitiesInput, opts ...request.Option) (*DescribeScalingActivitiesOutput, error) { - req, out := c.DescribeScalingActivitiesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeScalingActivitiesInput struct { - _ struct{} `type:"structure"` - - EndTime *string `type:"string"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingActivityIds []*string `type:"list"` - - ScalingGroupId *string `type:"string"` - - StartTime *string `type:"string"` - - StatusCode *string `type:"string"` -} - -// String returns the string representation -func (s DescribeScalingActivitiesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingActivitiesInput) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *DescribeScalingActivitiesInput) SetEndTime(v string) *DescribeScalingActivitiesInput { - s.EndTime = &v - return s -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingActivitiesInput) SetPageNumber(v int32) *DescribeScalingActivitiesInput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingActivitiesInput) SetPageSize(v int32) *DescribeScalingActivitiesInput { - s.PageSize = &v - return s -} - -// SetScalingActivityIds sets the ScalingActivityIds field's value. -func (s *DescribeScalingActivitiesInput) SetScalingActivityIds(v []*string) *DescribeScalingActivitiesInput { - s.ScalingActivityIds = v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DescribeScalingActivitiesInput) SetScalingGroupId(v string) *DescribeScalingActivitiesInput { - s.ScalingGroupId = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *DescribeScalingActivitiesInput) SetStartTime(v string) *DescribeScalingActivitiesInput { - s.StartTime = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *DescribeScalingActivitiesInput) SetStatusCode(v string) *DescribeScalingActivitiesInput { - s.StatusCode = &v - return s -} - -type DescribeScalingActivitiesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingActivities []*ScalingActivityForDescribeScalingActivitiesOutput `type:"list"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeScalingActivitiesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingActivitiesOutput) GoString() string { - return s.String() -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingActivitiesOutput) SetPageNumber(v int32) *DescribeScalingActivitiesOutput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingActivitiesOutput) SetPageSize(v int32) *DescribeScalingActivitiesOutput { - s.PageSize = &v - return s -} - -// SetScalingActivities sets the ScalingActivities field's value. -func (s *DescribeScalingActivitiesOutput) SetScalingActivities(v []*ScalingActivityForDescribeScalingActivitiesOutput) *DescribeScalingActivitiesOutput { - s.ScalingActivities = v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeScalingActivitiesOutput) SetTotalCount(v int32) *DescribeScalingActivitiesOutput { - s.TotalCount = &v - return s -} - -type RelatedInstanceForDescribeScalingActivitiesOutput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` - - Message *string `type:"string"` - - OperateType *string `type:"string"` - - Status *string `type:"string"` -} - -// String returns the string representation -func (s RelatedInstanceForDescribeScalingActivitiesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RelatedInstanceForDescribeScalingActivitiesOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *RelatedInstanceForDescribeScalingActivitiesOutput) SetInstanceId(v string) *RelatedInstanceForDescribeScalingActivitiesOutput { - s.InstanceId = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *RelatedInstanceForDescribeScalingActivitiesOutput) SetMessage(v string) *RelatedInstanceForDescribeScalingActivitiesOutput { - s.Message = &v - return s -} - -// SetOperateType sets the OperateType field's value. -func (s *RelatedInstanceForDescribeScalingActivitiesOutput) SetOperateType(v string) *RelatedInstanceForDescribeScalingActivitiesOutput { - s.OperateType = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RelatedInstanceForDescribeScalingActivitiesOutput) SetStatus(v string) *RelatedInstanceForDescribeScalingActivitiesOutput { - s.Status = &v - return s -} - -type ScalingActivityForDescribeScalingActivitiesOutput struct { - _ struct{} `type:"structure"` - - ActivityType *string `type:"string"` - - ActualAdjustInstanceNumber *int32 `type:"int32"` - - Cooldown *int32 `type:"int32"` - - CreatedAt *string `type:"string"` - - CurrentInstanceNumber *int32 `type:"int32"` - - ExpectedRunTime *string `type:"string"` - - MaxInstanceNumber *int32 `type:"int32"` - - MinInstanceNumber *int32 `type:"int32"` - - RelatedInstances []*RelatedInstanceForDescribeScalingActivitiesOutput `type:"list"` - - ResultMsg *string `type:"string"` - - ScalingActivityId *string `type:"string"` - - ScalingGroupId *string `type:"string"` - - StatusCode *string `type:"string"` - - StoppedAt *string `type:"string"` - - TaskCategory *string `type:"string"` -} - -// String returns the string representation -func (s ScalingActivityForDescribeScalingActivitiesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingActivityForDescribeScalingActivitiesOutput) GoString() string { - return s.String() -} - -// SetActivityType sets the ActivityType field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetActivityType(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.ActivityType = &v - return s -} - -// SetActualAdjustInstanceNumber sets the ActualAdjustInstanceNumber field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetActualAdjustInstanceNumber(v int32) *ScalingActivityForDescribeScalingActivitiesOutput { - s.ActualAdjustInstanceNumber = &v - return s -} - -// SetCooldown sets the Cooldown field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetCooldown(v int32) *ScalingActivityForDescribeScalingActivitiesOutput { - s.Cooldown = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetCreatedAt(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.CreatedAt = &v - return s -} - -// SetCurrentInstanceNumber sets the CurrentInstanceNumber field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetCurrentInstanceNumber(v int32) *ScalingActivityForDescribeScalingActivitiesOutput { - s.CurrentInstanceNumber = &v - return s -} - -// SetExpectedRunTime sets the ExpectedRunTime field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetExpectedRunTime(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.ExpectedRunTime = &v - return s -} - -// SetMaxInstanceNumber sets the MaxInstanceNumber field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetMaxInstanceNumber(v int32) *ScalingActivityForDescribeScalingActivitiesOutput { - s.MaxInstanceNumber = &v - return s -} - -// SetMinInstanceNumber sets the MinInstanceNumber field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetMinInstanceNumber(v int32) *ScalingActivityForDescribeScalingActivitiesOutput { - s.MinInstanceNumber = &v - return s -} - -// SetRelatedInstances sets the RelatedInstances field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetRelatedInstances(v []*RelatedInstanceForDescribeScalingActivitiesOutput) *ScalingActivityForDescribeScalingActivitiesOutput { - s.RelatedInstances = v - return s -} - -// SetResultMsg sets the ResultMsg field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetResultMsg(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.ResultMsg = &v - return s -} - -// SetScalingActivityId sets the ScalingActivityId field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetScalingActivityId(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.ScalingActivityId = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetScalingGroupId(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.ScalingGroupId = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetStatusCode(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.StatusCode = &v - return s -} - -// SetStoppedAt sets the StoppedAt field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetStoppedAt(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.StoppedAt = &v - return s -} - -// SetTaskCategory sets the TaskCategory field's value. -func (s *ScalingActivityForDescribeScalingActivitiesOutput) SetTaskCategory(v string) *ScalingActivityForDescribeScalingActivitiesOutput { - s.TaskCategory = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_configurations.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_configurations.go deleted file mode 100644 index d19d6256b58e..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_configurations.go +++ /dev/null @@ -1,476 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeScalingConfigurationsCommon = "DescribeScalingConfigurations" - -// DescribeScalingConfigurationsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingConfigurationsCommon operation. The "output" return -// value will be populated with the DescribeScalingConfigurationsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingConfigurationsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingConfigurationsCommon Send returns without error. -// -// See DescribeScalingConfigurationsCommon for more information on using the DescribeScalingConfigurationsCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingConfigurationsCommonRequest method. -// req, resp := client.DescribeScalingConfigurationsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingConfigurationsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeScalingConfigurationsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingConfigurationsCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingConfigurationsCommon for usage and error information. -func (c *AUTOSCALING) DescribeScalingConfigurationsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeScalingConfigurationsCommonRequest(input) - return out, req.Send() -} - -// DescribeScalingConfigurationsCommonWithContext is the same as DescribeScalingConfigurationsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingConfigurationsCommon 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 *AUTOSCALING) DescribeScalingConfigurationsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeScalingConfigurationsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScalingConfigurations = "DescribeScalingConfigurations" - -// DescribeScalingConfigurationsRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingConfigurations operation. The "output" return -// value will be populated with the DescribeScalingConfigurationsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingConfigurationsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingConfigurationsCommon Send returns without error. -// -// See DescribeScalingConfigurations for more information on using the DescribeScalingConfigurations -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingConfigurationsRequest method. -// req, resp := client.DescribeScalingConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingConfigurationsRequest(input *DescribeScalingConfigurationsInput) (req *request.Request, output *DescribeScalingConfigurationsOutput) { - op := &request.Operation{ - Name: opDescribeScalingConfigurations, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScalingConfigurationsInput{} - } - - output = &DescribeScalingConfigurationsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingConfigurations API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingConfigurations for usage and error information. -func (c *AUTOSCALING) DescribeScalingConfigurations(input *DescribeScalingConfigurationsInput) (*DescribeScalingConfigurationsOutput, error) { - req, out := c.DescribeScalingConfigurationsRequest(input) - return out, req.Send() -} - -// DescribeScalingConfigurationsWithContext is the same as DescribeScalingConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingConfigurations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DescribeScalingConfigurationsWithContext(ctx volcengine.Context, input *DescribeScalingConfigurationsInput, opts ...request.Option) (*DescribeScalingConfigurationsOutput, error) { - req, out := c.DescribeScalingConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeScalingConfigurationsInput struct { - _ struct{} `type:"structure"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingConfigurationIds []*string `type:"list"` - - ScalingConfigurationNames []*string `type:"list"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeScalingConfigurationsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingConfigurationsInput) GoString() string { - return s.String() -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingConfigurationsInput) SetPageNumber(v int32) *DescribeScalingConfigurationsInput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingConfigurationsInput) SetPageSize(v int32) *DescribeScalingConfigurationsInput { - s.PageSize = &v - return s -} - -// SetScalingConfigurationIds sets the ScalingConfigurationIds field's value. -func (s *DescribeScalingConfigurationsInput) SetScalingConfigurationIds(v []*string) *DescribeScalingConfigurationsInput { - s.ScalingConfigurationIds = v - return s -} - -// SetScalingConfigurationNames sets the ScalingConfigurationNames field's value. -func (s *DescribeScalingConfigurationsInput) SetScalingConfigurationNames(v []*string) *DescribeScalingConfigurationsInput { - s.ScalingConfigurationNames = v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DescribeScalingConfigurationsInput) SetScalingGroupId(v string) *DescribeScalingConfigurationsInput { - s.ScalingGroupId = &v - return s -} - -type DescribeScalingConfigurationsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingConfigurations []*ScalingConfigurationForDescribeScalingConfigurationsOutput `type:"list"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeScalingConfigurationsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingConfigurationsOutput) GoString() string { - return s.String() -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingConfigurationsOutput) SetPageNumber(v int32) *DescribeScalingConfigurationsOutput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingConfigurationsOutput) SetPageSize(v int32) *DescribeScalingConfigurationsOutput { - s.PageSize = &v - return s -} - -// SetScalingConfigurations sets the ScalingConfigurations field's value. -func (s *DescribeScalingConfigurationsOutput) SetScalingConfigurations(v []*ScalingConfigurationForDescribeScalingConfigurationsOutput) *DescribeScalingConfigurationsOutput { - s.ScalingConfigurations = v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeScalingConfigurationsOutput) SetTotalCount(v int32) *DescribeScalingConfigurationsOutput { - s.TotalCount = &v - return s -} - -type EipForDescribeScalingConfigurationsOutput struct { - _ struct{} `type:"structure"` - - Bandwidth *int32 `type:"int32"` - - BillingType *string `type:"string"` - - ISP *string `type:"string"` -} - -// String returns the string representation -func (s EipForDescribeScalingConfigurationsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EipForDescribeScalingConfigurationsOutput) GoString() string { - return s.String() -} - -// SetBandwidth sets the Bandwidth field's value. -func (s *EipForDescribeScalingConfigurationsOutput) SetBandwidth(v int32) *EipForDescribeScalingConfigurationsOutput { - s.Bandwidth = &v - return s -} - -// SetBillingType sets the BillingType field's value. -func (s *EipForDescribeScalingConfigurationsOutput) SetBillingType(v string) *EipForDescribeScalingConfigurationsOutput { - s.BillingType = &v - return s -} - -// SetISP sets the ISP field's value. -func (s *EipForDescribeScalingConfigurationsOutput) SetISP(v string) *EipForDescribeScalingConfigurationsOutput { - s.ISP = &v - return s -} - -type ScalingConfigurationForDescribeScalingConfigurationsOutput struct { - _ struct{} `type:"structure"` - - CreatedAt *string `type:"string"` - - Eip *EipForDescribeScalingConfigurationsOutput `type:"structure"` - - HostName *string `type:"string"` - - ImageId *string `type:"string"` - - InstanceDescription *string `type:"string"` - - InstanceName *string `type:"string"` - - InstanceTypes []*string `type:"list"` - - KeyPairName *string `type:"string"` - - LifecycleState *string `type:"string"` - - ScalingConfigurationId *string `type:"string"` - - ScalingConfigurationName *string `type:"string"` - - ScalingGroupId *string `type:"string"` - - SecurityEnhancementStrategy *string `type:"string"` - - SecurityGroupIds []*string `type:"list"` - - UpdatedAt *string `type:"string"` - - UserData *string `type:"string"` - - Volumes []*VolumeForDescribeScalingConfigurationsOutput `type:"list"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s ScalingConfigurationForDescribeScalingConfigurationsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingConfigurationForDescribeScalingConfigurationsOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetCreatedAt(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.CreatedAt = &v - return s -} - -// SetEip sets the Eip field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetEip(v *EipForDescribeScalingConfigurationsOutput) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.Eip = v - return s -} - -// SetHostName sets the HostName field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetHostName(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.HostName = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetImageId(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.ImageId = &v - return s -} - -// SetInstanceDescription sets the InstanceDescription field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetInstanceDescription(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.InstanceDescription = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetInstanceName(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.InstanceName = &v - return s -} - -// SetInstanceTypes sets the InstanceTypes field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetInstanceTypes(v []*string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.InstanceTypes = v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetKeyPairName(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.KeyPairName = &v - return s -} - -// SetLifecycleState sets the LifecycleState field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetLifecycleState(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.LifecycleState = &v - return s -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetScalingConfigurationId(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.ScalingConfigurationId = &v - return s -} - -// SetScalingConfigurationName sets the ScalingConfigurationName field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetScalingConfigurationName(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.ScalingConfigurationName = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetScalingGroupId(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.ScalingGroupId = &v - return s -} - -// SetSecurityEnhancementStrategy sets the SecurityEnhancementStrategy field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetSecurityEnhancementStrategy(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.SecurityEnhancementStrategy = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetSecurityGroupIds(v []*string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.SecurityGroupIds = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetUpdatedAt(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.UpdatedAt = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetUserData(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.UserData = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetVolumes(v []*VolumeForDescribeScalingConfigurationsOutput) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.Volumes = v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *ScalingConfigurationForDescribeScalingConfigurationsOutput) SetZoneId(v string) *ScalingConfigurationForDescribeScalingConfigurationsOutput { - s.ZoneId = &v - return s -} - -type VolumeForDescribeScalingConfigurationsOutput struct { - _ struct{} `type:"structure"` - - DeleteWithInstance *bool `type:"boolean"` - - Size *int32 `type:"int32"` - - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s VolumeForDescribeScalingConfigurationsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeForDescribeScalingConfigurationsOutput) GoString() string { - return s.String() -} - -// SetDeleteWithInstance sets the DeleteWithInstance field's value. -func (s *VolumeForDescribeScalingConfigurationsOutput) SetDeleteWithInstance(v bool) *VolumeForDescribeScalingConfigurationsOutput { - s.DeleteWithInstance = &v - return s -} - -// SetSize sets the Size field's value. -func (s *VolumeForDescribeScalingConfigurationsOutput) SetSize(v int32) *VolumeForDescribeScalingConfigurationsOutput { - s.Size = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *VolumeForDescribeScalingConfigurationsOutput) SetVolumeType(v string) *VolumeForDescribeScalingConfigurationsOutput { - s.VolumeType = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_groups.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_groups.go deleted file mode 100644 index 7223e6427027..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_groups.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeScalingGroupsCommon = "DescribeScalingGroups" - -// DescribeScalingGroupsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingGroupsCommon operation. The "output" return -// value will be populated with the DescribeScalingGroupsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingGroupsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingGroupsCommon Send returns without error. -// -// See DescribeScalingGroupsCommon for more information on using the DescribeScalingGroupsCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingGroupsCommonRequest method. -// req, resp := client.DescribeScalingGroupsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingGroupsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeScalingGroupsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingGroupsCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingGroupsCommon for usage and error information. -func (c *AUTOSCALING) DescribeScalingGroupsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeScalingGroupsCommonRequest(input) - return out, req.Send() -} - -// DescribeScalingGroupsCommonWithContext is the same as DescribeScalingGroupsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingGroupsCommon 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 *AUTOSCALING) DescribeScalingGroupsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeScalingGroupsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScalingGroups = "DescribeScalingGroups" - -// DescribeScalingGroupsRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingGroups operation. The "output" return -// value will be populated with the DescribeScalingGroupsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingGroupsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingGroupsCommon Send returns without error. -// -// See DescribeScalingGroups for more information on using the DescribeScalingGroups -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingGroupsRequest method. -// req, resp := client.DescribeScalingGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingGroupsRequest(input *DescribeScalingGroupsInput) (req *request.Request, output *DescribeScalingGroupsOutput) { - op := &request.Operation{ - Name: opDescribeScalingGroups, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScalingGroupsInput{} - } - - output = &DescribeScalingGroupsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingGroups API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingGroups for usage and error information. -func (c *AUTOSCALING) DescribeScalingGroups(input *DescribeScalingGroupsInput) (*DescribeScalingGroupsOutput, error) { - req, out := c.DescribeScalingGroupsRequest(input) - return out, req.Send() -} - -// DescribeScalingGroupsWithContext is the same as DescribeScalingGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DescribeScalingGroupsWithContext(ctx volcengine.Context, input *DescribeScalingGroupsInput, opts ...request.Option) (*DescribeScalingGroupsOutput, error) { - req, out := c.DescribeScalingGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeScalingGroupsInput struct { - _ struct{} `type:"structure"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingGroupIds []*string `type:"list"` - - ScalingGroupNames []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeScalingGroupsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingGroupsInput) GoString() string { - return s.String() -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingGroupsInput) SetPageNumber(v int32) *DescribeScalingGroupsInput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingGroupsInput) SetPageSize(v int32) *DescribeScalingGroupsInput { - s.PageSize = &v - return s -} - -// SetScalingGroupIds sets the ScalingGroupIds field's value. -func (s *DescribeScalingGroupsInput) SetScalingGroupIds(v []*string) *DescribeScalingGroupsInput { - s.ScalingGroupIds = v - return s -} - -// SetScalingGroupNames sets the ScalingGroupNames field's value. -func (s *DescribeScalingGroupsInput) SetScalingGroupNames(v []*string) *DescribeScalingGroupsInput { - s.ScalingGroupNames = v - return s -} - -type DescribeScalingGroupsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingGroups []*ScalingGroupForDescribeScalingGroupsOutput `type:"list"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeScalingGroupsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingGroupsOutput) GoString() string { - return s.String() -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingGroupsOutput) SetPageNumber(v int32) *DescribeScalingGroupsOutput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingGroupsOutput) SetPageSize(v int32) *DescribeScalingGroupsOutput { - s.PageSize = &v - return s -} - -// SetScalingGroups sets the ScalingGroups field's value. -func (s *DescribeScalingGroupsOutput) SetScalingGroups(v []*ScalingGroupForDescribeScalingGroupsOutput) *DescribeScalingGroupsOutput { - s.ScalingGroups = v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeScalingGroupsOutput) SetTotalCount(v int32) *DescribeScalingGroupsOutput { - s.TotalCount = &v - return s -} - -type ScalingGroupForDescribeScalingGroupsOutput struct { - _ struct{} `type:"structure"` - - ActiveScalingConfigurationId *string `type:"string"` - - CreatedAt *string `type:"string"` - - DBInstanceIds []*string `type:"list"` - - DefaultCooldown *int32 `type:"int32"` - - DesireInstanceNumber *int32 `type:"int32"` - - InstanceTerminatePolicy *string `type:"string"` - - LifecycleState *string `type:"string"` - - MaxInstanceNumber *int32 `type:"int32"` - - MinInstanceNumber *int32 `type:"int32"` - - MultiAZPolicy *string `type:"string"` - - ScalingGroupId *string `type:"string"` - - ScalingGroupName *string `type:"string"` - - ServerGroupAttributes []*ServerGroupAttributeForDescribeScalingGroupsOutput `type:"list"` - - SubnetIds []*string `type:"list"` - - TotalInstanceCount *int32 `type:"int32"` - - UpdatedAt *string `type:"string"` - - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s ScalingGroupForDescribeScalingGroupsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingGroupForDescribeScalingGroupsOutput) GoString() string { - return s.String() -} - -// SetActiveScalingConfigurationId sets the ActiveScalingConfigurationId field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetActiveScalingConfigurationId(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.ActiveScalingConfigurationId = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetCreatedAt(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.CreatedAt = &v - return s -} - -// SetDBInstanceIds sets the DBInstanceIds field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetDBInstanceIds(v []*string) *ScalingGroupForDescribeScalingGroupsOutput { - s.DBInstanceIds = v - return s -} - -// SetDefaultCooldown sets the DefaultCooldown field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetDefaultCooldown(v int32) *ScalingGroupForDescribeScalingGroupsOutput { - s.DefaultCooldown = &v - return s -} - -// SetDesireInstanceNumber sets the DesireInstanceNumber field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetDesireInstanceNumber(v int32) *ScalingGroupForDescribeScalingGroupsOutput { - s.DesireInstanceNumber = &v - return s -} - -// SetInstanceTerminatePolicy sets the InstanceTerminatePolicy field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetInstanceTerminatePolicy(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.InstanceTerminatePolicy = &v - return s -} - -// SetLifecycleState sets the LifecycleState field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetLifecycleState(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.LifecycleState = &v - return s -} - -// SetMaxInstanceNumber sets the MaxInstanceNumber field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetMaxInstanceNumber(v int32) *ScalingGroupForDescribeScalingGroupsOutput { - s.MaxInstanceNumber = &v - return s -} - -// SetMinInstanceNumber sets the MinInstanceNumber field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetMinInstanceNumber(v int32) *ScalingGroupForDescribeScalingGroupsOutput { - s.MinInstanceNumber = &v - return s -} - -// SetMultiAZPolicy sets the MultiAZPolicy field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetMultiAZPolicy(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.MultiAZPolicy = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetScalingGroupId(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.ScalingGroupId = &v - return s -} - -// SetScalingGroupName sets the ScalingGroupName field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetScalingGroupName(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.ScalingGroupName = &v - return s -} - -// SetServerGroupAttributes sets the ServerGroupAttributes field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetServerGroupAttributes(v []*ServerGroupAttributeForDescribeScalingGroupsOutput) *ScalingGroupForDescribeScalingGroupsOutput { - s.ServerGroupAttributes = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetSubnetIds(v []*string) *ScalingGroupForDescribeScalingGroupsOutput { - s.SubnetIds = v - return s -} - -// SetTotalInstanceCount sets the TotalInstanceCount field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetTotalInstanceCount(v int32) *ScalingGroupForDescribeScalingGroupsOutput { - s.TotalInstanceCount = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetUpdatedAt(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.UpdatedAt = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ScalingGroupForDescribeScalingGroupsOutput) SetVpcId(v string) *ScalingGroupForDescribeScalingGroupsOutput { - s.VpcId = &v - return s -} - -type ServerGroupAttributeForDescribeScalingGroupsOutput struct { - _ struct{} `type:"structure"` - - LoadBalancerId *string `type:"string"` - - Port *int32 `type:"int32"` - - ServerGroupId *string `type:"string"` - - Weight *int32 `type:"int32"` -} - -// String returns the string representation -func (s ServerGroupAttributeForDescribeScalingGroupsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServerGroupAttributeForDescribeScalingGroupsOutput) GoString() string { - return s.String() -} - -// SetLoadBalancerId sets the LoadBalancerId field's value. -func (s *ServerGroupAttributeForDescribeScalingGroupsOutput) SetLoadBalancerId(v string) *ServerGroupAttributeForDescribeScalingGroupsOutput { - s.LoadBalancerId = &v - return s -} - -// SetPort sets the Port field's value. -func (s *ServerGroupAttributeForDescribeScalingGroupsOutput) SetPort(v int32) *ServerGroupAttributeForDescribeScalingGroupsOutput { - s.Port = &v - return s -} - -// SetServerGroupId sets the ServerGroupId field's value. -func (s *ServerGroupAttributeForDescribeScalingGroupsOutput) SetServerGroupId(v string) *ServerGroupAttributeForDescribeScalingGroupsOutput { - s.ServerGroupId = &v - return s -} - -// SetWeight sets the Weight field's value. -func (s *ServerGroupAttributeForDescribeScalingGroupsOutput) SetWeight(v int32) *ServerGroupAttributeForDescribeScalingGroupsOutput { - s.Weight = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_instances.go deleted file mode 100644 index 65a3cbeca42e..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_instances.go +++ /dev/null @@ -1,344 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeScalingInstancesCommon = "DescribeScalingInstances" - -// DescribeScalingInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingInstancesCommon operation. The "output" return -// value will be populated with the DescribeScalingInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingInstancesCommon Send returns without error. -// -// See DescribeScalingInstancesCommon for more information on using the DescribeScalingInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingInstancesCommonRequest method. -// req, resp := client.DescribeScalingInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeScalingInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingInstancesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingInstancesCommon for usage and error information. -func (c *AUTOSCALING) DescribeScalingInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeScalingInstancesCommonRequest(input) - return out, req.Send() -} - -// DescribeScalingInstancesCommonWithContext is the same as DescribeScalingInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingInstancesCommon 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 *AUTOSCALING) DescribeScalingInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeScalingInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScalingInstances = "DescribeScalingInstances" - -// DescribeScalingInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingInstances operation. The "output" return -// value will be populated with the DescribeScalingInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingInstancesCommon Send returns without error. -// -// See DescribeScalingInstances for more information on using the DescribeScalingInstances -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingInstancesRequest method. -// req, resp := client.DescribeScalingInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingInstancesRequest(input *DescribeScalingInstancesInput) (req *request.Request, output *DescribeScalingInstancesOutput) { - op := &request.Operation{ - Name: opDescribeScalingInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScalingInstancesInput{} - } - - output = &DescribeScalingInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingInstances API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingInstances for usage and error information. -func (c *AUTOSCALING) DescribeScalingInstances(input *DescribeScalingInstancesInput) (*DescribeScalingInstancesOutput, error) { - req, out := c.DescribeScalingInstancesRequest(input) - return out, req.Send() -} - -// DescribeScalingInstancesWithContext is the same as DescribeScalingInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DescribeScalingInstancesWithContext(ctx volcengine.Context, input *DescribeScalingInstancesInput, opts ...request.Option) (*DescribeScalingInstancesOutput, error) { - req, out := c.DescribeScalingInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeScalingInstancesInput struct { - _ struct{} `type:"structure"` - - CreationType *string `type:"string"` - - InstanceIds []*string `type:"list"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingConfigurationId *string `type:"string"` - - ScalingGroupId *string `type:"string"` - - Status *string `type:"string"` -} - -// String returns the string representation -func (s DescribeScalingInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingInstancesInput) GoString() string { - return s.String() -} - -// SetCreationType sets the CreationType field's value. -func (s *DescribeScalingInstancesInput) SetCreationType(v string) *DescribeScalingInstancesInput { - s.CreationType = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeScalingInstancesInput) SetInstanceIds(v []*string) *DescribeScalingInstancesInput { - s.InstanceIds = v - return s -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingInstancesInput) SetPageNumber(v int32) *DescribeScalingInstancesInput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingInstancesInput) SetPageSize(v int32) *DescribeScalingInstancesInput { - s.PageSize = &v - return s -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *DescribeScalingInstancesInput) SetScalingConfigurationId(v string) *DescribeScalingInstancesInput { - s.ScalingConfigurationId = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DescribeScalingInstancesInput) SetScalingGroupId(v string) *DescribeScalingInstancesInput { - s.ScalingGroupId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeScalingInstancesInput) SetStatus(v string) *DescribeScalingInstancesInput { - s.Status = &v - return s -} - -type DescribeScalingInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingInstances []*ScalingInstanceForDescribeScalingInstancesOutput `type:"list"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeScalingInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingInstancesOutput) GoString() string { - return s.String() -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingInstancesOutput) SetPageNumber(v int32) *DescribeScalingInstancesOutput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingInstancesOutput) SetPageSize(v int32) *DescribeScalingInstancesOutput { - s.PageSize = &v - return s -} - -// SetScalingInstances sets the ScalingInstances field's value. -func (s *DescribeScalingInstancesOutput) SetScalingInstances(v []*ScalingInstanceForDescribeScalingInstancesOutput) *DescribeScalingInstancesOutput { - s.ScalingInstances = v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeScalingInstancesOutput) SetTotalCount(v int32) *DescribeScalingInstancesOutput { - s.TotalCount = &v - return s -} - -type ScalingInstanceForDescribeScalingInstancesOutput struct { - _ struct{} `type:"structure"` - - CreatedTime *string `type:"string"` - - CreationType *string `type:"string"` - - Entrusted *bool `type:"boolean"` - - InstanceId *string `type:"string"` - - ScalingConfigurationId *string `type:"string"` - - ScalingGroupId *string `type:"string"` - - ScalingPolicyId *string `type:"string"` - - Status *string `type:"string"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s ScalingInstanceForDescribeScalingInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingInstanceForDescribeScalingInstancesOutput) GoString() string { - return s.String() -} - -// SetCreatedTime sets the CreatedTime field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetCreatedTime(v string) *ScalingInstanceForDescribeScalingInstancesOutput { - s.CreatedTime = &v - return s -} - -// SetCreationType sets the CreationType field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetCreationType(v string) *ScalingInstanceForDescribeScalingInstancesOutput { - s.CreationType = &v - return s -} - -// SetEntrusted sets the Entrusted field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetEntrusted(v bool) *ScalingInstanceForDescribeScalingInstancesOutput { - s.Entrusted = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetInstanceId(v string) *ScalingInstanceForDescribeScalingInstancesOutput { - s.InstanceId = &v - return s -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetScalingConfigurationId(v string) *ScalingInstanceForDescribeScalingInstancesOutput { - s.ScalingConfigurationId = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetScalingGroupId(v string) *ScalingInstanceForDescribeScalingInstancesOutput { - s.ScalingGroupId = &v - return s -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetScalingPolicyId(v string) *ScalingInstanceForDescribeScalingInstancesOutput { - s.ScalingPolicyId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetStatus(v string) *ScalingInstanceForDescribeScalingInstancesOutput { - s.Status = &v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *ScalingInstanceForDescribeScalingInstancesOutput) SetZoneId(v string) *ScalingInstanceForDescribeScalingInstancesOutput { - s.ZoneId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_policies.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_policies.go deleted file mode 100644 index a2c9998cc266..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_describe_scaling_policies.go +++ /dev/null @@ -1,482 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeScalingPoliciesCommon = "DescribeScalingPolicies" - -// DescribeScalingPoliciesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingPoliciesCommon operation. The "output" return -// value will be populated with the DescribeScalingPoliciesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingPoliciesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingPoliciesCommon Send returns without error. -// -// See DescribeScalingPoliciesCommon for more information on using the DescribeScalingPoliciesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingPoliciesCommonRequest method. -// req, resp := client.DescribeScalingPoliciesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingPoliciesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeScalingPoliciesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingPoliciesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingPoliciesCommon for usage and error information. -func (c *AUTOSCALING) DescribeScalingPoliciesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeScalingPoliciesCommonRequest(input) - return out, req.Send() -} - -// DescribeScalingPoliciesCommonWithContext is the same as DescribeScalingPoliciesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingPoliciesCommon 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 *AUTOSCALING) DescribeScalingPoliciesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeScalingPoliciesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeScalingPolicies = "DescribeScalingPolicies" - -// DescribeScalingPoliciesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeScalingPolicies operation. The "output" return -// value will be populated with the DescribeScalingPoliciesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeScalingPoliciesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeScalingPoliciesCommon Send returns without error. -// -// See DescribeScalingPolicies for more information on using the DescribeScalingPolicies -// API call, and error handling. -// -// // Example sending a request using the DescribeScalingPoliciesRequest method. -// req, resp := client.DescribeScalingPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DescribeScalingPoliciesRequest(input *DescribeScalingPoliciesInput) (req *request.Request, output *DescribeScalingPoliciesOutput) { - op := &request.Operation{ - Name: opDescribeScalingPolicies, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeScalingPoliciesInput{} - } - - output = &DescribeScalingPoliciesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeScalingPolicies API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DescribeScalingPolicies for usage and error information. -func (c *AUTOSCALING) DescribeScalingPolicies(input *DescribeScalingPoliciesInput) (*DescribeScalingPoliciesOutput, error) { - req, out := c.DescribeScalingPoliciesRequest(input) - return out, req.Send() -} - -// DescribeScalingPoliciesWithContext is the same as DescribeScalingPolicies with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeScalingPolicies for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DescribeScalingPoliciesWithContext(ctx volcengine.Context, input *DescribeScalingPoliciesInput, opts ...request.Option) (*DescribeScalingPoliciesOutput, error) { - req, out := c.DescribeScalingPoliciesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AlarmPolicyForDescribeScalingPoliciesOutput struct { - _ struct{} `type:"structure"` - - Condition *ConditionForDescribeScalingPoliciesOutput `type:"structure"` - - EvaluationCount *int32 `type:"int32"` - - RuleType *string `type:"string"` -} - -// String returns the string representation -func (s AlarmPolicyForDescribeScalingPoliciesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AlarmPolicyForDescribeScalingPoliciesOutput) GoString() string { - return s.String() -} - -// SetCondition sets the Condition field's value. -func (s *AlarmPolicyForDescribeScalingPoliciesOutput) SetCondition(v *ConditionForDescribeScalingPoliciesOutput) *AlarmPolicyForDescribeScalingPoliciesOutput { - s.Condition = v - return s -} - -// SetEvaluationCount sets the EvaluationCount field's value. -func (s *AlarmPolicyForDescribeScalingPoliciesOutput) SetEvaluationCount(v int32) *AlarmPolicyForDescribeScalingPoliciesOutput { - s.EvaluationCount = &v - return s -} - -// SetRuleType sets the RuleType field's value. -func (s *AlarmPolicyForDescribeScalingPoliciesOutput) SetRuleType(v string) *AlarmPolicyForDescribeScalingPoliciesOutput { - s.RuleType = &v - return s -} - -type ConditionForDescribeScalingPoliciesOutput struct { - _ struct{} `type:"structure"` - - ComparisonOperator *string `type:"string"` - - MetricName *string `type:"string"` - - MetricUnit *string `type:"string"` - - Threshold *string `type:"string"` -} - -// String returns the string representation -func (s ConditionForDescribeScalingPoliciesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ConditionForDescribeScalingPoliciesOutput) GoString() string { - return s.String() -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *ConditionForDescribeScalingPoliciesOutput) SetComparisonOperator(v string) *ConditionForDescribeScalingPoliciesOutput { - s.ComparisonOperator = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *ConditionForDescribeScalingPoliciesOutput) SetMetricName(v string) *ConditionForDescribeScalingPoliciesOutput { - s.MetricName = &v - return s -} - -// SetMetricUnit sets the MetricUnit field's value. -func (s *ConditionForDescribeScalingPoliciesOutput) SetMetricUnit(v string) *ConditionForDescribeScalingPoliciesOutput { - s.MetricUnit = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *ConditionForDescribeScalingPoliciesOutput) SetThreshold(v string) *ConditionForDescribeScalingPoliciesOutput { - s.Threshold = &v - return s -} - -type DescribeScalingPoliciesInput struct { - _ struct{} `type:"structure"` - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingGroupId *string `type:"string"` - - ScalingPolicyIds []*string `type:"list"` - - ScalingPolicyNames []*string `type:"list"` - - ScalingPolicyType *string `type:"string"` -} - -// String returns the string representation -func (s DescribeScalingPoliciesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingPoliciesInput) GoString() string { - return s.String() -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingPoliciesInput) SetPageNumber(v int32) *DescribeScalingPoliciesInput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingPoliciesInput) SetPageSize(v int32) *DescribeScalingPoliciesInput { - s.PageSize = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DescribeScalingPoliciesInput) SetScalingGroupId(v string) *DescribeScalingPoliciesInput { - s.ScalingGroupId = &v - return s -} - -// SetScalingPolicyIds sets the ScalingPolicyIds field's value. -func (s *DescribeScalingPoliciesInput) SetScalingPolicyIds(v []*string) *DescribeScalingPoliciesInput { - s.ScalingPolicyIds = v - return s -} - -// SetScalingPolicyNames sets the ScalingPolicyNames field's value. -func (s *DescribeScalingPoliciesInput) SetScalingPolicyNames(v []*string) *DescribeScalingPoliciesInput { - s.ScalingPolicyNames = v - return s -} - -// SetScalingPolicyType sets the ScalingPolicyType field's value. -func (s *DescribeScalingPoliciesInput) SetScalingPolicyType(v string) *DescribeScalingPoliciesInput { - s.ScalingPolicyType = &v - return s -} - -type DescribeScalingPoliciesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - PageNumber *int32 `type:"int32"` - - PageSize *int32 `type:"int32"` - - ScalingPolicies []*ScalingPolicyForDescribeScalingPoliciesOutput `type:"list"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeScalingPoliciesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeScalingPoliciesOutput) GoString() string { - return s.String() -} - -// SetPageNumber sets the PageNumber field's value. -func (s *DescribeScalingPoliciesOutput) SetPageNumber(v int32) *DescribeScalingPoliciesOutput { - s.PageNumber = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *DescribeScalingPoliciesOutput) SetPageSize(v int32) *DescribeScalingPoliciesOutput { - s.PageSize = &v - return s -} - -// SetScalingPolicies sets the ScalingPolicies field's value. -func (s *DescribeScalingPoliciesOutput) SetScalingPolicies(v []*ScalingPolicyForDescribeScalingPoliciesOutput) *DescribeScalingPoliciesOutput { - s.ScalingPolicies = v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeScalingPoliciesOutput) SetTotalCount(v int32) *DescribeScalingPoliciesOutput { - s.TotalCount = &v - return s -} - -type ScalingPolicyForDescribeScalingPoliciesOutput struct { - _ struct{} `type:"structure"` - - AdjustmentType *string `type:"string"` - - AdjustmentValue *int32 `type:"int32"` - - AlarmPolicy *AlarmPolicyForDescribeScalingPoliciesOutput `type:"structure"` - - Cooldown *int32 `type:"int32"` - - ScalingGroupId *string `type:"string"` - - ScalingPolicyId *string `type:"string"` - - ScalingPolicyName *string `type:"string"` - - ScalingPolicyType *string `type:"string"` - - ScheduledPolicy *ScheduledPolicyForDescribeScalingPoliciesOutput `type:"structure"` - - Status *string `type:"string"` -} - -// String returns the string representation -func (s ScalingPolicyForDescribeScalingPoliciesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScalingPolicyForDescribeScalingPoliciesOutput) GoString() string { - return s.String() -} - -// SetAdjustmentType sets the AdjustmentType field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetAdjustmentType(v string) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.AdjustmentType = &v - return s -} - -// SetAdjustmentValue sets the AdjustmentValue field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetAdjustmentValue(v int32) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.AdjustmentValue = &v - return s -} - -// SetAlarmPolicy sets the AlarmPolicy field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetAlarmPolicy(v *AlarmPolicyForDescribeScalingPoliciesOutput) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.AlarmPolicy = v - return s -} - -// SetCooldown sets the Cooldown field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetCooldown(v int32) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.Cooldown = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetScalingGroupId(v string) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.ScalingGroupId = &v - return s -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetScalingPolicyId(v string) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.ScalingPolicyId = &v - return s -} - -// SetScalingPolicyName sets the ScalingPolicyName field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetScalingPolicyName(v string) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.ScalingPolicyName = &v - return s -} - -// SetScalingPolicyType sets the ScalingPolicyType field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetScalingPolicyType(v string) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.ScalingPolicyType = &v - return s -} - -// SetScheduledPolicy sets the ScheduledPolicy field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetScheduledPolicy(v *ScheduledPolicyForDescribeScalingPoliciesOutput) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.ScheduledPolicy = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ScalingPolicyForDescribeScalingPoliciesOutput) SetStatus(v string) *ScalingPolicyForDescribeScalingPoliciesOutput { - s.Status = &v - return s -} - -type ScheduledPolicyForDescribeScalingPoliciesOutput struct { - _ struct{} `type:"structure"` - - LaunchTime *string `type:"string"` - - RecurrenceEndTime *string `type:"string"` - - RecurrenceStartTime *string `type:"string"` - - RecurrenceType *string `type:"string"` - - RecurrenceValue *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledPolicyForDescribeScalingPoliciesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledPolicyForDescribeScalingPoliciesOutput) GoString() string { - return s.String() -} - -// SetLaunchTime sets the LaunchTime field's value. -func (s *ScheduledPolicyForDescribeScalingPoliciesOutput) SetLaunchTime(v string) *ScheduledPolicyForDescribeScalingPoliciesOutput { - s.LaunchTime = &v - return s -} - -// SetRecurrenceEndTime sets the RecurrenceEndTime field's value. -func (s *ScheduledPolicyForDescribeScalingPoliciesOutput) SetRecurrenceEndTime(v string) *ScheduledPolicyForDescribeScalingPoliciesOutput { - s.RecurrenceEndTime = &v - return s -} - -// SetRecurrenceStartTime sets the RecurrenceStartTime field's value. -func (s *ScheduledPolicyForDescribeScalingPoliciesOutput) SetRecurrenceStartTime(v string) *ScheduledPolicyForDescribeScalingPoliciesOutput { - s.RecurrenceStartTime = &v - return s -} - -// SetRecurrenceType sets the RecurrenceType field's value. -func (s *ScheduledPolicyForDescribeScalingPoliciesOutput) SetRecurrenceType(v string) *ScheduledPolicyForDescribeScalingPoliciesOutput { - s.RecurrenceType = &v - return s -} - -// SetRecurrenceValue sets the RecurrenceValue field's value. -func (s *ScheduledPolicyForDescribeScalingPoliciesOutput) SetRecurrenceValue(v string) *ScheduledPolicyForDescribeScalingPoliciesOutput { - s.RecurrenceValue = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_db_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_db_instances.go deleted file mode 100644 index 506692762e91..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_db_instances.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDetachDBInstancesCommon = "DetachDBInstances" - -// DetachDBInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DetachDBInstancesCommon operation. The "output" return -// value will be populated with the DetachDBInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DetachDBInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DetachDBInstancesCommon Send returns without error. -// -// See DetachDBInstancesCommon for more information on using the DetachDBInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the DetachDBInstancesCommonRequest method. -// req, resp := client.DetachDBInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DetachDBInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDetachDBInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DetachDBInstancesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DetachDBInstancesCommon for usage and error information. -func (c *AUTOSCALING) DetachDBInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DetachDBInstancesCommonRequest(input) - return out, req.Send() -} - -// DetachDBInstancesCommonWithContext is the same as DetachDBInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DetachDBInstancesCommon 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 *AUTOSCALING) DetachDBInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DetachDBInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachDBInstances = "DetachDBInstances" - -// DetachDBInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the DetachDBInstances operation. The "output" return -// value will be populated with the DetachDBInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DetachDBInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DetachDBInstancesCommon Send returns without error. -// -// See DetachDBInstances for more information on using the DetachDBInstances -// API call, and error handling. -// -// // Example sending a request using the DetachDBInstancesRequest method. -// req, resp := client.DetachDBInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DetachDBInstancesRequest(input *DetachDBInstancesInput) (req *request.Request, output *DetachDBInstancesOutput) { - op := &request.Operation{ - Name: opDetachDBInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DetachDBInstancesInput{} - } - - output = &DetachDBInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DetachDBInstances API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DetachDBInstances for usage and error information. -func (c *AUTOSCALING) DetachDBInstances(input *DetachDBInstancesInput) (*DetachDBInstancesOutput, error) { - req, out := c.DetachDBInstancesRequest(input) - return out, req.Send() -} - -// DetachDBInstancesWithContext is the same as DetachDBInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DetachDBInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DetachDBInstancesWithContext(ctx volcengine.Context, input *DetachDBInstancesInput, opts ...request.Option) (*DetachDBInstancesOutput, error) { - req, out := c.DetachDBInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DetachDBInstancesInput struct { - _ struct{} `type:"structure"` - - DBInstanceIds []*string `type:"list"` - - ForceDetach *bool `type:"boolean"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DetachDBInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachDBInstancesInput) GoString() string { - return s.String() -} - -// SetDBInstanceIds sets the DBInstanceIds field's value. -func (s *DetachDBInstancesInput) SetDBInstanceIds(v []*string) *DetachDBInstancesInput { - s.DBInstanceIds = v - return s -} - -// SetForceDetach sets the ForceDetach field's value. -func (s *DetachDBInstancesInput) SetForceDetach(v bool) *DetachDBInstancesInput { - s.ForceDetach = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DetachDBInstancesInput) SetScalingGroupId(v string) *DetachDBInstancesInput { - s.ScalingGroupId = &v - return s -} - -type DetachDBInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DetachDBInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachDBInstancesOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DetachDBInstancesOutput) SetScalingGroupId(v string) *DetachDBInstancesOutput { - s.ScalingGroupId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_instances.go deleted file mode 100644 index dca1b2d2093b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_instances.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDetachInstancesCommon = "DetachInstances" - -// DetachInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DetachInstancesCommon operation. The "output" return -// value will be populated with the DetachInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DetachInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DetachInstancesCommon Send returns without error. -// -// See DetachInstancesCommon for more information on using the DetachInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the DetachInstancesCommonRequest method. -// req, resp := client.DetachInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DetachInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDetachInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DetachInstancesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DetachInstancesCommon for usage and error information. -func (c *AUTOSCALING) DetachInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DetachInstancesCommonRequest(input) - return out, req.Send() -} - -// DetachInstancesCommonWithContext is the same as DetachInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DetachInstancesCommon 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 *AUTOSCALING) DetachInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DetachInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachInstances = "DetachInstances" - -// DetachInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the DetachInstances operation. The "output" return -// value will be populated with the DetachInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DetachInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DetachInstancesCommon Send returns without error. -// -// See DetachInstances for more information on using the DetachInstances -// API call, and error handling. -// -// // Example sending a request using the DetachInstancesRequest method. -// req, resp := client.DetachInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DetachInstancesRequest(input *DetachInstancesInput) (req *request.Request, output *DetachInstancesOutput) { - op := &request.Operation{ - Name: opDetachInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DetachInstancesInput{} - } - - output = &DetachInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DetachInstances API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DetachInstances for usage and error information. -func (c *AUTOSCALING) DetachInstances(input *DetachInstancesInput) (*DetachInstancesOutput, error) { - req, out := c.DetachInstancesRequest(input) - return out, req.Send() -} - -// DetachInstancesWithContext is the same as DetachInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DetachInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DetachInstancesWithContext(ctx volcengine.Context, input *DetachInstancesInput, opts ...request.Option) (*DetachInstancesOutput, error) { - req, out := c.DetachInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DetachInstancesInput struct { - _ struct{} `type:"structure"` - - DecreaseDesiredCapacity *bool `type:"boolean"` - - DetachOption *string `type:"string"` - - InstanceIds []*string `type:"list"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DetachInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachInstancesInput) GoString() string { - return s.String() -} - -// SetDecreaseDesiredCapacity sets the DecreaseDesiredCapacity field's value. -func (s *DetachInstancesInput) SetDecreaseDesiredCapacity(v bool) *DetachInstancesInput { - s.DecreaseDesiredCapacity = &v - return s -} - -// SetDetachOption sets the DetachOption field's value. -func (s *DetachInstancesInput) SetDetachOption(v string) *DetachInstancesInput { - s.DetachOption = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DetachInstancesInput) SetInstanceIds(v []*string) *DetachInstancesInput { - s.InstanceIds = v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DetachInstancesInput) SetScalingGroupId(v string) *DetachInstancesInput { - s.ScalingGroupId = &v - return s -} - -type DetachInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s DetachInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachInstancesOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_server_groups.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_server_groups.go deleted file mode 100644 index f22c18dcce11..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_detach_server_groups.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDetachServerGroupsCommon = "DetachServerGroups" - -// DetachServerGroupsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DetachServerGroupsCommon operation. The "output" return -// value will be populated with the DetachServerGroupsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DetachServerGroupsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DetachServerGroupsCommon Send returns without error. -// -// See DetachServerGroupsCommon for more information on using the DetachServerGroupsCommon -// API call, and error handling. -// -// // Example sending a request using the DetachServerGroupsCommonRequest method. -// req, resp := client.DetachServerGroupsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DetachServerGroupsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDetachServerGroupsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DetachServerGroupsCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DetachServerGroupsCommon for usage and error information. -func (c *AUTOSCALING) DetachServerGroupsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DetachServerGroupsCommonRequest(input) - return out, req.Send() -} - -// DetachServerGroupsCommonWithContext is the same as DetachServerGroupsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DetachServerGroupsCommon 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 *AUTOSCALING) DetachServerGroupsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DetachServerGroupsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachServerGroups = "DetachServerGroups" - -// DetachServerGroupsRequest generates a "volcengine/request.Request" representing the -// client's request for the DetachServerGroups operation. The "output" return -// value will be populated with the DetachServerGroupsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DetachServerGroupsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DetachServerGroupsCommon Send returns without error. -// -// See DetachServerGroups for more information on using the DetachServerGroups -// API call, and error handling. -// -// // Example sending a request using the DetachServerGroupsRequest method. -// req, resp := client.DetachServerGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DetachServerGroupsRequest(input *DetachServerGroupsInput) (req *request.Request, output *DetachServerGroupsOutput) { - op := &request.Operation{ - Name: opDetachServerGroups, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DetachServerGroupsInput{} - } - - output = &DetachServerGroupsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DetachServerGroups API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DetachServerGroups for usage and error information. -func (c *AUTOSCALING) DetachServerGroups(input *DetachServerGroupsInput) (*DetachServerGroupsOutput, error) { - req, out := c.DetachServerGroupsRequest(input) - return out, req.Send() -} - -// DetachServerGroupsWithContext is the same as DetachServerGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DetachServerGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DetachServerGroupsWithContext(ctx volcengine.Context, input *DetachServerGroupsInput, opts ...request.Option) (*DetachServerGroupsOutput, error) { - req, out := c.DetachServerGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DetachServerGroupsInput struct { - _ struct{} `type:"structure"` - - ScalingGroupId *string `type:"string"` - - ServerGroupAttributes []*ServerGroupAttributeForDetachServerGroupsInput `type:"list"` -} - -// String returns the string representation -func (s DetachServerGroupsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachServerGroupsInput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DetachServerGroupsInput) SetScalingGroupId(v string) *DetachServerGroupsInput { - s.ScalingGroupId = &v - return s -} - -// SetServerGroupAttributes sets the ServerGroupAttributes field's value. -func (s *DetachServerGroupsInput) SetServerGroupAttributes(v []*ServerGroupAttributeForDetachServerGroupsInput) *DetachServerGroupsInput { - s.ServerGroupAttributes = v - return s -} - -type DetachServerGroupsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DetachServerGroupsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachServerGroupsOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DetachServerGroupsOutput) SetScalingGroupId(v string) *DetachServerGroupsOutput { - s.ScalingGroupId = &v - return s -} - -type ServerGroupAttributeForDetachServerGroupsInput struct { - _ struct{} `type:"structure"` - - ServerGroupId *string `type:"string"` -} - -// String returns the string representation -func (s ServerGroupAttributeForDetachServerGroupsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ServerGroupAttributeForDetachServerGroupsInput) GoString() string { - return s.String() -} - -// SetServerGroupId sets the ServerGroupId field's value. -func (s *ServerGroupAttributeForDetachServerGroupsInput) SetServerGroupId(v string) *ServerGroupAttributeForDetachServerGroupsInput { - s.ServerGroupId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_disable_scaling_group.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_disable_scaling_group.go deleted file mode 100644 index 592dbd081d8d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_disable_scaling_group.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDisableScalingGroupCommon = "DisableScalingGroup" - -// DisableScalingGroupCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DisableScalingGroupCommon operation. The "output" return -// value will be populated with the DisableScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DisableScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after DisableScalingGroupCommon Send returns without error. -// -// See DisableScalingGroupCommon for more information on using the DisableScalingGroupCommon -// API call, and error handling. -// -// // Example sending a request using the DisableScalingGroupCommonRequest method. -// req, resp := client.DisableScalingGroupCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DisableScalingGroupCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDisableScalingGroupCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DisableScalingGroupCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DisableScalingGroupCommon for usage and error information. -func (c *AUTOSCALING) DisableScalingGroupCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DisableScalingGroupCommonRequest(input) - return out, req.Send() -} - -// DisableScalingGroupCommonWithContext is the same as DisableScalingGroupCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DisableScalingGroupCommon 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 *AUTOSCALING) DisableScalingGroupCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DisableScalingGroupCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableScalingGroup = "DisableScalingGroup" - -// DisableScalingGroupRequest generates a "volcengine/request.Request" representing the -// client's request for the DisableScalingGroup operation. The "output" return -// value will be populated with the DisableScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DisableScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after DisableScalingGroupCommon Send returns without error. -// -// See DisableScalingGroup for more information on using the DisableScalingGroup -// API call, and error handling. -// -// // Example sending a request using the DisableScalingGroupRequest method. -// req, resp := client.DisableScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DisableScalingGroupRequest(input *DisableScalingGroupInput) (req *request.Request, output *DisableScalingGroupOutput) { - op := &request.Operation{ - Name: opDisableScalingGroup, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DisableScalingGroupInput{} - } - - output = &DisableScalingGroupOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DisableScalingGroup API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DisableScalingGroup for usage and error information. -func (c *AUTOSCALING) DisableScalingGroup(input *DisableScalingGroupInput) (*DisableScalingGroupOutput, error) { - req, out := c.DisableScalingGroupRequest(input) - return out, req.Send() -} - -// DisableScalingGroupWithContext is the same as DisableScalingGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DisableScalingGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DisableScalingGroupWithContext(ctx volcengine.Context, input *DisableScalingGroupInput, opts ...request.Option) (*DisableScalingGroupOutput, error) { - req, out := c.DisableScalingGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DisableScalingGroupInput struct { - _ struct{} `type:"structure"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DisableScalingGroupInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableScalingGroupInput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DisableScalingGroupInput) SetScalingGroupId(v string) *DisableScalingGroupInput { - s.ScalingGroupId = &v - return s -} - -type DisableScalingGroupOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s DisableScalingGroupOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableScalingGroupOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *DisableScalingGroupOutput) SetScalingGroupId(v string) *DisableScalingGroupOutput { - s.ScalingGroupId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_disable_scaling_policy.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_disable_scaling_policy.go deleted file mode 100644 index 7d6813709550..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_disable_scaling_policy.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDisableScalingPolicyCommon = "DisableScalingPolicy" - -// DisableScalingPolicyCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DisableScalingPolicyCommon operation. The "output" return -// value will be populated with the DisableScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DisableScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after DisableScalingPolicyCommon Send returns without error. -// -// See DisableScalingPolicyCommon for more information on using the DisableScalingPolicyCommon -// API call, and error handling. -// -// // Example sending a request using the DisableScalingPolicyCommonRequest method. -// req, resp := client.DisableScalingPolicyCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DisableScalingPolicyCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDisableScalingPolicyCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DisableScalingPolicyCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DisableScalingPolicyCommon for usage and error information. -func (c *AUTOSCALING) DisableScalingPolicyCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DisableScalingPolicyCommonRequest(input) - return out, req.Send() -} - -// DisableScalingPolicyCommonWithContext is the same as DisableScalingPolicyCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DisableScalingPolicyCommon 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 *AUTOSCALING) DisableScalingPolicyCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DisableScalingPolicyCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableScalingPolicy = "DisableScalingPolicy" - -// DisableScalingPolicyRequest generates a "volcengine/request.Request" representing the -// client's request for the DisableScalingPolicy operation. The "output" return -// value will be populated with the DisableScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DisableScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after DisableScalingPolicyCommon Send returns without error. -// -// See DisableScalingPolicy for more information on using the DisableScalingPolicy -// API call, and error handling. -// -// // Example sending a request using the DisableScalingPolicyRequest method. -// req, resp := client.DisableScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) DisableScalingPolicyRequest(input *DisableScalingPolicyInput) (req *request.Request, output *DisableScalingPolicyOutput) { - op := &request.Operation{ - Name: opDisableScalingPolicy, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DisableScalingPolicyInput{} - } - - output = &DisableScalingPolicyOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DisableScalingPolicy API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation DisableScalingPolicy for usage and error information. -func (c *AUTOSCALING) DisableScalingPolicy(input *DisableScalingPolicyInput) (*DisableScalingPolicyOutput, error) { - req, out := c.DisableScalingPolicyRequest(input) - return out, req.Send() -} - -// DisableScalingPolicyWithContext is the same as DisableScalingPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DisableScalingPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) DisableScalingPolicyWithContext(ctx volcengine.Context, input *DisableScalingPolicyInput, opts ...request.Option) (*DisableScalingPolicyOutput, error) { - req, out := c.DisableScalingPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DisableScalingPolicyInput struct { - _ struct{} `type:"structure"` - - ScalingPolicyId *string `type:"string"` -} - -// String returns the string representation -func (s DisableScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableScalingPolicyInput) GoString() string { - return s.String() -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *DisableScalingPolicyInput) SetScalingPolicyId(v string) *DisableScalingPolicyInput { - s.ScalingPolicyId = &v - return s -} - -type DisableScalingPolicyOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingPolicyId *string `type:"string"` -} - -// String returns the string representation -func (s DisableScalingPolicyOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisableScalingPolicyOutput) GoString() string { - return s.String() -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *DisableScalingPolicyOutput) SetScalingPolicyId(v string) *DisableScalingPolicyOutput { - s.ScalingPolicyId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_configuration.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_configuration.go deleted file mode 100644 index 9e1ffeac04ed..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_configuration.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opEnableScalingConfigurationCommon = "EnableScalingConfiguration" - -// EnableScalingConfigurationCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the EnableScalingConfigurationCommon operation. The "output" return -// value will be populated with the EnableScalingConfigurationCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned EnableScalingConfigurationCommon Request to send the API call to the service. -// the "output" return value is not valid until after EnableScalingConfigurationCommon Send returns without error. -// -// See EnableScalingConfigurationCommon for more information on using the EnableScalingConfigurationCommon -// API call, and error handling. -// -// // Example sending a request using the EnableScalingConfigurationCommonRequest method. -// req, resp := client.EnableScalingConfigurationCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) EnableScalingConfigurationCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opEnableScalingConfigurationCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// EnableScalingConfigurationCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation EnableScalingConfigurationCommon for usage and error information. -func (c *AUTOSCALING) EnableScalingConfigurationCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.EnableScalingConfigurationCommonRequest(input) - return out, req.Send() -} - -// EnableScalingConfigurationCommonWithContext is the same as EnableScalingConfigurationCommon with the addition of -// the ability to pass a context and additional request options. -// -// See EnableScalingConfigurationCommon 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 *AUTOSCALING) EnableScalingConfigurationCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.EnableScalingConfigurationCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableScalingConfiguration = "EnableScalingConfiguration" - -// EnableScalingConfigurationRequest generates a "volcengine/request.Request" representing the -// client's request for the EnableScalingConfiguration operation. The "output" return -// value will be populated with the EnableScalingConfigurationCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned EnableScalingConfigurationCommon Request to send the API call to the service. -// the "output" return value is not valid until after EnableScalingConfigurationCommon Send returns without error. -// -// See EnableScalingConfiguration for more information on using the EnableScalingConfiguration -// API call, and error handling. -// -// // Example sending a request using the EnableScalingConfigurationRequest method. -// req, resp := client.EnableScalingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) EnableScalingConfigurationRequest(input *EnableScalingConfigurationInput) (req *request.Request, output *EnableScalingConfigurationOutput) { - op := &request.Operation{ - Name: opEnableScalingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &EnableScalingConfigurationInput{} - } - - output = &EnableScalingConfigurationOutput{} - req = c.newRequest(op, input, output) - - return -} - -// EnableScalingConfiguration API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation EnableScalingConfiguration for usage and error information. -func (c *AUTOSCALING) EnableScalingConfiguration(input *EnableScalingConfigurationInput) (*EnableScalingConfigurationOutput, error) { - req, out := c.EnableScalingConfigurationRequest(input) - return out, req.Send() -} - -// EnableScalingConfigurationWithContext is the same as EnableScalingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See EnableScalingConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) EnableScalingConfigurationWithContext(ctx volcengine.Context, input *EnableScalingConfigurationInput, opts ...request.Option) (*EnableScalingConfigurationOutput, error) { - req, out := c.EnableScalingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type EnableScalingConfigurationInput struct { - _ struct{} `type:"structure"` - - ScalingConfigurationId *string `type:"string"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s EnableScalingConfigurationInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableScalingConfigurationInput) GoString() string { - return s.String() -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *EnableScalingConfigurationInput) SetScalingConfigurationId(v string) *EnableScalingConfigurationInput { - s.ScalingConfigurationId = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *EnableScalingConfigurationInput) SetScalingGroupId(v string) *EnableScalingConfigurationInput { - s.ScalingGroupId = &v - return s -} - -type EnableScalingConfigurationOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingConfigurationId *string `type:"string"` -} - -// String returns the string representation -func (s EnableScalingConfigurationOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableScalingConfigurationOutput) GoString() string { - return s.String() -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *EnableScalingConfigurationOutput) SetScalingConfigurationId(v string) *EnableScalingConfigurationOutput { - s.ScalingConfigurationId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_group.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_group.go deleted file mode 100644 index 69dc2b178734..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_group.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opEnableScalingGroupCommon = "EnableScalingGroup" - -// EnableScalingGroupCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the EnableScalingGroupCommon operation. The "output" return -// value will be populated with the EnableScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned EnableScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after EnableScalingGroupCommon Send returns without error. -// -// See EnableScalingGroupCommon for more information on using the EnableScalingGroupCommon -// API call, and error handling. -// -// // Example sending a request using the EnableScalingGroupCommonRequest method. -// req, resp := client.EnableScalingGroupCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) EnableScalingGroupCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opEnableScalingGroupCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// EnableScalingGroupCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation EnableScalingGroupCommon for usage and error information. -func (c *AUTOSCALING) EnableScalingGroupCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.EnableScalingGroupCommonRequest(input) - return out, req.Send() -} - -// EnableScalingGroupCommonWithContext is the same as EnableScalingGroupCommon with the addition of -// the ability to pass a context and additional request options. -// -// See EnableScalingGroupCommon 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 *AUTOSCALING) EnableScalingGroupCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.EnableScalingGroupCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableScalingGroup = "EnableScalingGroup" - -// EnableScalingGroupRequest generates a "volcengine/request.Request" representing the -// client's request for the EnableScalingGroup operation. The "output" return -// value will be populated with the EnableScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned EnableScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after EnableScalingGroupCommon Send returns without error. -// -// See EnableScalingGroup for more information on using the EnableScalingGroup -// API call, and error handling. -// -// // Example sending a request using the EnableScalingGroupRequest method. -// req, resp := client.EnableScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) EnableScalingGroupRequest(input *EnableScalingGroupInput) (req *request.Request, output *EnableScalingGroupOutput) { - op := &request.Operation{ - Name: opEnableScalingGroup, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &EnableScalingGroupInput{} - } - - output = &EnableScalingGroupOutput{} - req = c.newRequest(op, input, output) - - return -} - -// EnableScalingGroup API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation EnableScalingGroup for usage and error information. -func (c *AUTOSCALING) EnableScalingGroup(input *EnableScalingGroupInput) (*EnableScalingGroupOutput, error) { - req, out := c.EnableScalingGroupRequest(input) - return out, req.Send() -} - -// EnableScalingGroupWithContext is the same as EnableScalingGroup with the addition of -// the ability to pass a context and additional request options. -// -// See EnableScalingGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) EnableScalingGroupWithContext(ctx volcengine.Context, input *EnableScalingGroupInput, opts ...request.Option) (*EnableScalingGroupOutput, error) { - req, out := c.EnableScalingGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type EnableScalingGroupInput struct { - _ struct{} `type:"structure"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s EnableScalingGroupInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableScalingGroupInput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *EnableScalingGroupInput) SetScalingGroupId(v string) *EnableScalingGroupInput { - s.ScalingGroupId = &v - return s -} - -type EnableScalingGroupOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s EnableScalingGroupOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableScalingGroupOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *EnableScalingGroupOutput) SetScalingGroupId(v string) *EnableScalingGroupOutput { - s.ScalingGroupId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_policy.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_policy.go deleted file mode 100644 index f27ced36c91b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_enable_scaling_policy.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opEnableScalingPolicyCommon = "EnableScalingPolicy" - -// EnableScalingPolicyCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the EnableScalingPolicyCommon operation. The "output" return -// value will be populated with the EnableScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned EnableScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after EnableScalingPolicyCommon Send returns without error. -// -// See EnableScalingPolicyCommon for more information on using the EnableScalingPolicyCommon -// API call, and error handling. -// -// // Example sending a request using the EnableScalingPolicyCommonRequest method. -// req, resp := client.EnableScalingPolicyCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) EnableScalingPolicyCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opEnableScalingPolicyCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// EnableScalingPolicyCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation EnableScalingPolicyCommon for usage and error information. -func (c *AUTOSCALING) EnableScalingPolicyCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.EnableScalingPolicyCommonRequest(input) - return out, req.Send() -} - -// EnableScalingPolicyCommonWithContext is the same as EnableScalingPolicyCommon with the addition of -// the ability to pass a context and additional request options. -// -// See EnableScalingPolicyCommon 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 *AUTOSCALING) EnableScalingPolicyCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.EnableScalingPolicyCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableScalingPolicy = "EnableScalingPolicy" - -// EnableScalingPolicyRequest generates a "volcengine/request.Request" representing the -// client's request for the EnableScalingPolicy operation. The "output" return -// value will be populated with the EnableScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned EnableScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after EnableScalingPolicyCommon Send returns without error. -// -// See EnableScalingPolicy for more information on using the EnableScalingPolicy -// API call, and error handling. -// -// // Example sending a request using the EnableScalingPolicyRequest method. -// req, resp := client.EnableScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) EnableScalingPolicyRequest(input *EnableScalingPolicyInput) (req *request.Request, output *EnableScalingPolicyOutput) { - op := &request.Operation{ - Name: opEnableScalingPolicy, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &EnableScalingPolicyInput{} - } - - output = &EnableScalingPolicyOutput{} - req = c.newRequest(op, input, output) - - return -} - -// EnableScalingPolicy API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation EnableScalingPolicy for usage and error information. -func (c *AUTOSCALING) EnableScalingPolicy(input *EnableScalingPolicyInput) (*EnableScalingPolicyOutput, error) { - req, out := c.EnableScalingPolicyRequest(input) - return out, req.Send() -} - -// EnableScalingPolicyWithContext is the same as EnableScalingPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See EnableScalingPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) EnableScalingPolicyWithContext(ctx volcengine.Context, input *EnableScalingPolicyInput, opts ...request.Option) (*EnableScalingPolicyOutput, error) { - req, out := c.EnableScalingPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type EnableScalingPolicyInput struct { - _ struct{} `type:"structure"` - - ScalingPolicyId *string `type:"string"` -} - -// String returns the string representation -func (s EnableScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableScalingPolicyInput) GoString() string { - return s.String() -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *EnableScalingPolicyInput) SetScalingPolicyId(v string) *EnableScalingPolicyInput { - s.ScalingPolicyId = &v - return s -} - -type EnableScalingPolicyOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingPolicyId *string `type:"string"` -} - -// String returns the string representation -func (s EnableScalingPolicyOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EnableScalingPolicyOutput) GoString() string { - return s.String() -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *EnableScalingPolicyOutput) SetScalingPolicyId(v string) *EnableScalingPolicyOutput { - s.ScalingPolicyId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_lifecycle_hook.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_lifecycle_hook.go deleted file mode 100644 index 992371c08b7d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_lifecycle_hook.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyLifecycleHookCommon = "ModifyLifecycleHook" - -// ModifyLifecycleHookCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyLifecycleHookCommon operation. The "output" return -// value will be populated with the ModifyLifecycleHookCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyLifecycleHookCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyLifecycleHookCommon Send returns without error. -// -// See ModifyLifecycleHookCommon for more information on using the ModifyLifecycleHookCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyLifecycleHookCommonRequest method. -// req, resp := client.ModifyLifecycleHookCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) ModifyLifecycleHookCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyLifecycleHookCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyLifecycleHookCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation ModifyLifecycleHookCommon for usage and error information. -func (c *AUTOSCALING) ModifyLifecycleHookCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyLifecycleHookCommonRequest(input) - return out, req.Send() -} - -// ModifyLifecycleHookCommonWithContext is the same as ModifyLifecycleHookCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyLifecycleHookCommon 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 *AUTOSCALING) ModifyLifecycleHookCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyLifecycleHookCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyLifecycleHook = "ModifyLifecycleHook" - -// ModifyLifecycleHookRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyLifecycleHook operation. The "output" return -// value will be populated with the ModifyLifecycleHookCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyLifecycleHookCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyLifecycleHookCommon Send returns without error. -// -// See ModifyLifecycleHook for more information on using the ModifyLifecycleHook -// API call, and error handling. -// -// // Example sending a request using the ModifyLifecycleHookRequest method. -// req, resp := client.ModifyLifecycleHookRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) ModifyLifecycleHookRequest(input *ModifyLifecycleHookInput) (req *request.Request, output *ModifyLifecycleHookOutput) { - op := &request.Operation{ - Name: opModifyLifecycleHook, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyLifecycleHookInput{} - } - - output = &ModifyLifecycleHookOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyLifecycleHook API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation ModifyLifecycleHook for usage and error information. -func (c *AUTOSCALING) ModifyLifecycleHook(input *ModifyLifecycleHookInput) (*ModifyLifecycleHookOutput, error) { - req, out := c.ModifyLifecycleHookRequest(input) - return out, req.Send() -} - -// ModifyLifecycleHookWithContext is the same as ModifyLifecycleHook with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyLifecycleHook for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) ModifyLifecycleHookWithContext(ctx volcengine.Context, input *ModifyLifecycleHookInput, opts ...request.Option) (*ModifyLifecycleHookOutput, error) { - req, out := c.ModifyLifecycleHookRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyLifecycleHookInput struct { - _ struct{} `type:"structure"` - - LifecycleHookId *string `type:"string"` - - LifecycleHookPolicy *string `type:"string"` - - LifecycleHookTimeout *int32 `type:"int32"` - - LifecycleHookType *string `type:"string"` -} - -// String returns the string representation -func (s ModifyLifecycleHookInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyLifecycleHookInput) GoString() string { - return s.String() -} - -// SetLifecycleHookId sets the LifecycleHookId field's value. -func (s *ModifyLifecycleHookInput) SetLifecycleHookId(v string) *ModifyLifecycleHookInput { - s.LifecycleHookId = &v - return s -} - -// SetLifecycleHookPolicy sets the LifecycleHookPolicy field's value. -func (s *ModifyLifecycleHookInput) SetLifecycleHookPolicy(v string) *ModifyLifecycleHookInput { - s.LifecycleHookPolicy = &v - return s -} - -// SetLifecycleHookTimeout sets the LifecycleHookTimeout field's value. -func (s *ModifyLifecycleHookInput) SetLifecycleHookTimeout(v int32) *ModifyLifecycleHookInput { - s.LifecycleHookTimeout = &v - return s -} - -// SetLifecycleHookType sets the LifecycleHookType field's value. -func (s *ModifyLifecycleHookInput) SetLifecycleHookType(v string) *ModifyLifecycleHookInput { - s.LifecycleHookType = &v - return s -} - -type ModifyLifecycleHookOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - LifecycleHookId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyLifecycleHookOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyLifecycleHookOutput) GoString() string { - return s.String() -} - -// SetLifecycleHookId sets the LifecycleHookId field's value. -func (s *ModifyLifecycleHookOutput) SetLifecycleHookId(v string) *ModifyLifecycleHookOutput { - s.LifecycleHookId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_configuration.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_configuration.go deleted file mode 100644 index 05a5738fe908..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_configuration.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyScalingConfigurationCommon = "ModifyScalingConfiguration" - -// ModifyScalingConfigurationCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyScalingConfigurationCommon operation. The "output" return -// value will be populated with the ModifyScalingConfigurationCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyScalingConfigurationCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyScalingConfigurationCommon Send returns without error. -// -// See ModifyScalingConfigurationCommon for more information on using the ModifyScalingConfigurationCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyScalingConfigurationCommonRequest method. -// req, resp := client.ModifyScalingConfigurationCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) ModifyScalingConfigurationCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyScalingConfigurationCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyScalingConfigurationCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation ModifyScalingConfigurationCommon for usage and error information. -func (c *AUTOSCALING) ModifyScalingConfigurationCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyScalingConfigurationCommonRequest(input) - return out, req.Send() -} - -// ModifyScalingConfigurationCommonWithContext is the same as ModifyScalingConfigurationCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyScalingConfigurationCommon 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 *AUTOSCALING) ModifyScalingConfigurationCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyScalingConfigurationCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyScalingConfiguration = "ModifyScalingConfiguration" - -// ModifyScalingConfigurationRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyScalingConfiguration operation. The "output" return -// value will be populated with the ModifyScalingConfigurationCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyScalingConfigurationCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyScalingConfigurationCommon Send returns without error. -// -// See ModifyScalingConfiguration for more information on using the ModifyScalingConfiguration -// API call, and error handling. -// -// // Example sending a request using the ModifyScalingConfigurationRequest method. -// req, resp := client.ModifyScalingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) ModifyScalingConfigurationRequest(input *ModifyScalingConfigurationInput) (req *request.Request, output *ModifyScalingConfigurationOutput) { - op := &request.Operation{ - Name: opModifyScalingConfiguration, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyScalingConfigurationInput{} - } - - output = &ModifyScalingConfigurationOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyScalingConfiguration API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation ModifyScalingConfiguration for usage and error information. -func (c *AUTOSCALING) ModifyScalingConfiguration(input *ModifyScalingConfigurationInput) (*ModifyScalingConfigurationOutput, error) { - req, out := c.ModifyScalingConfigurationRequest(input) - return out, req.Send() -} - -// ModifyScalingConfigurationWithContext is the same as ModifyScalingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyScalingConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) ModifyScalingConfigurationWithContext(ctx volcengine.Context, input *ModifyScalingConfigurationInput, opts ...request.Option) (*ModifyScalingConfigurationOutput, error) { - req, out := c.ModifyScalingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type EipForModifyScalingConfigurationInput struct { - _ struct{} `type:"structure"` - - Bandwidth *int32 `type:"int32"` - - BillingType *string `type:"string"` - - ISP *string `type:"string"` -} - -// String returns the string representation -func (s EipForModifyScalingConfigurationInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EipForModifyScalingConfigurationInput) GoString() string { - return s.String() -} - -// SetBandwidth sets the Bandwidth field's value. -func (s *EipForModifyScalingConfigurationInput) SetBandwidth(v int32) *EipForModifyScalingConfigurationInput { - s.Bandwidth = &v - return s -} - -// SetBillingType sets the BillingType field's value. -func (s *EipForModifyScalingConfigurationInput) SetBillingType(v string) *EipForModifyScalingConfigurationInput { - s.BillingType = &v - return s -} - -// SetISP sets the ISP field's value. -func (s *EipForModifyScalingConfigurationInput) SetISP(v string) *EipForModifyScalingConfigurationInput { - s.ISP = &v - return s -} - -type ModifyScalingConfigurationInput struct { - _ struct{} `type:"structure"` - - Eip *EipForModifyScalingConfigurationInput `type:"structure"` - - HostName *string `type:"string"` - - ImageId *string `type:"string"` - - InstanceDescription *string `type:"string"` - - InstanceName *string `type:"string"` - - InstanceTypes []*string `type:"list"` - - KeyPairName *string `type:"string"` - - Password *string `type:"string"` - - ScalingConfigurationId *string `type:"string"` - - ScalingConfigurationName *string `type:"string"` - - SecurityEnhancementStrategy *string `type:"string"` - - SecurityGroupIds []*string `type:"list"` - - UserData *string `type:"string"` - - Volumes []*VolumeForModifyScalingConfigurationInput `type:"list"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyScalingConfigurationInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyScalingConfigurationInput) GoString() string { - return s.String() -} - -// SetEip sets the Eip field's value. -func (s *ModifyScalingConfigurationInput) SetEip(v *EipForModifyScalingConfigurationInput) *ModifyScalingConfigurationInput { - s.Eip = v - return s -} - -// SetHostName sets the HostName field's value. -func (s *ModifyScalingConfigurationInput) SetHostName(v string) *ModifyScalingConfigurationInput { - s.HostName = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ModifyScalingConfigurationInput) SetImageId(v string) *ModifyScalingConfigurationInput { - s.ImageId = &v - return s -} - -// SetInstanceDescription sets the InstanceDescription field's value. -func (s *ModifyScalingConfigurationInput) SetInstanceDescription(v string) *ModifyScalingConfigurationInput { - s.InstanceDescription = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *ModifyScalingConfigurationInput) SetInstanceName(v string) *ModifyScalingConfigurationInput { - s.InstanceName = &v - return s -} - -// SetInstanceTypes sets the InstanceTypes field's value. -func (s *ModifyScalingConfigurationInput) SetInstanceTypes(v []*string) *ModifyScalingConfigurationInput { - s.InstanceTypes = v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *ModifyScalingConfigurationInput) SetKeyPairName(v string) *ModifyScalingConfigurationInput { - s.KeyPairName = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *ModifyScalingConfigurationInput) SetPassword(v string) *ModifyScalingConfigurationInput { - s.Password = &v - return s -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *ModifyScalingConfigurationInput) SetScalingConfigurationId(v string) *ModifyScalingConfigurationInput { - s.ScalingConfigurationId = &v - return s -} - -// SetScalingConfigurationName sets the ScalingConfigurationName field's value. -func (s *ModifyScalingConfigurationInput) SetScalingConfigurationName(v string) *ModifyScalingConfigurationInput { - s.ScalingConfigurationName = &v - return s -} - -// SetSecurityEnhancementStrategy sets the SecurityEnhancementStrategy field's value. -func (s *ModifyScalingConfigurationInput) SetSecurityEnhancementStrategy(v string) *ModifyScalingConfigurationInput { - s.SecurityEnhancementStrategy = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ModifyScalingConfigurationInput) SetSecurityGroupIds(v []*string) *ModifyScalingConfigurationInput { - s.SecurityGroupIds = v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ModifyScalingConfigurationInput) SetUserData(v string) *ModifyScalingConfigurationInput { - s.UserData = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *ModifyScalingConfigurationInput) SetVolumes(v []*VolumeForModifyScalingConfigurationInput) *ModifyScalingConfigurationInput { - s.Volumes = v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *ModifyScalingConfigurationInput) SetZoneId(v string) *ModifyScalingConfigurationInput { - s.ZoneId = &v - return s -} - -type ModifyScalingConfigurationOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingConfigurationId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyScalingConfigurationOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyScalingConfigurationOutput) GoString() string { - return s.String() -} - -// SetScalingConfigurationId sets the ScalingConfigurationId field's value. -func (s *ModifyScalingConfigurationOutput) SetScalingConfigurationId(v string) *ModifyScalingConfigurationOutput { - s.ScalingConfigurationId = &v - return s -} - -type VolumeForModifyScalingConfigurationInput struct { - _ struct{} `type:"structure"` - - DeleteWithInstance *bool `type:"boolean"` - - Size *int32 `type:"int32"` - - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s VolumeForModifyScalingConfigurationInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeForModifyScalingConfigurationInput) GoString() string { - return s.String() -} - -// SetDeleteWithInstance sets the DeleteWithInstance field's value. -func (s *VolumeForModifyScalingConfigurationInput) SetDeleteWithInstance(v bool) *VolumeForModifyScalingConfigurationInput { - s.DeleteWithInstance = &v - return s -} - -// SetSize sets the Size field's value. -func (s *VolumeForModifyScalingConfigurationInput) SetSize(v int32) *VolumeForModifyScalingConfigurationInput { - s.Size = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *VolumeForModifyScalingConfigurationInput) SetVolumeType(v string) *VolumeForModifyScalingConfigurationInput { - s.VolumeType = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_group.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_group.go deleted file mode 100644 index a57fa84e3049..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_group.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyScalingGroupCommon = "ModifyScalingGroup" - -// ModifyScalingGroupCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyScalingGroupCommon operation. The "output" return -// value will be populated with the ModifyScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyScalingGroupCommon Send returns without error. -// -// See ModifyScalingGroupCommon for more information on using the ModifyScalingGroupCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyScalingGroupCommonRequest method. -// req, resp := client.ModifyScalingGroupCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) ModifyScalingGroupCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyScalingGroupCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyScalingGroupCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation ModifyScalingGroupCommon for usage and error information. -func (c *AUTOSCALING) ModifyScalingGroupCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyScalingGroupCommonRequest(input) - return out, req.Send() -} - -// ModifyScalingGroupCommonWithContext is the same as ModifyScalingGroupCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyScalingGroupCommon 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 *AUTOSCALING) ModifyScalingGroupCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyScalingGroupCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyScalingGroup = "ModifyScalingGroup" - -// ModifyScalingGroupRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyScalingGroup operation. The "output" return -// value will be populated with the ModifyScalingGroupCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyScalingGroupCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyScalingGroupCommon Send returns without error. -// -// See ModifyScalingGroup for more information on using the ModifyScalingGroup -// API call, and error handling. -// -// // Example sending a request using the ModifyScalingGroupRequest method. -// req, resp := client.ModifyScalingGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) ModifyScalingGroupRequest(input *ModifyScalingGroupInput) (req *request.Request, output *ModifyScalingGroupOutput) { - op := &request.Operation{ - Name: opModifyScalingGroup, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyScalingGroupInput{} - } - - output = &ModifyScalingGroupOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyScalingGroup API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation ModifyScalingGroup for usage and error information. -func (c *AUTOSCALING) ModifyScalingGroup(input *ModifyScalingGroupInput) (*ModifyScalingGroupOutput, error) { - req, out := c.ModifyScalingGroupRequest(input) - return out, req.Send() -} - -// ModifyScalingGroupWithContext is the same as ModifyScalingGroup with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyScalingGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) ModifyScalingGroupWithContext(ctx volcengine.Context, input *ModifyScalingGroupInput, opts ...request.Option) (*ModifyScalingGroupOutput, error) { - req, out := c.ModifyScalingGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyScalingGroupInput struct { - _ struct{} `type:"structure"` - - ActiveScalingConfigurationId *string `type:"string"` - - DefaultCooldown *int32 `type:"int32"` - - DesireInstanceNumber *int32 `type:"int32"` - - InstanceTerminatePolicy *string `type:"string"` - - MaxInstanceNumber *int32 `type:"int32"` - - MinInstanceNumber *int32 `type:"int32"` - - ScalingGroupId *string `type:"string"` - - ScalingGroupName *string `type:"string"` - - SubnetIds []*string `type:"list"` -} - -// String returns the string representation -func (s ModifyScalingGroupInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyScalingGroupInput) GoString() string { - return s.String() -} - -// SetActiveScalingConfigurationId sets the ActiveScalingConfigurationId field's value. -func (s *ModifyScalingGroupInput) SetActiveScalingConfigurationId(v string) *ModifyScalingGroupInput { - s.ActiveScalingConfigurationId = &v - return s -} - -// SetDefaultCooldown sets the DefaultCooldown field's value. -func (s *ModifyScalingGroupInput) SetDefaultCooldown(v int32) *ModifyScalingGroupInput { - s.DefaultCooldown = &v - return s -} - -// SetDesireInstanceNumber sets the DesireInstanceNumber field's value. -func (s *ModifyScalingGroupInput) SetDesireInstanceNumber(v int32) *ModifyScalingGroupInput { - s.DesireInstanceNumber = &v - return s -} - -// SetInstanceTerminatePolicy sets the InstanceTerminatePolicy field's value. -func (s *ModifyScalingGroupInput) SetInstanceTerminatePolicy(v string) *ModifyScalingGroupInput { - s.InstanceTerminatePolicy = &v - return s -} - -// SetMaxInstanceNumber sets the MaxInstanceNumber field's value. -func (s *ModifyScalingGroupInput) SetMaxInstanceNumber(v int32) *ModifyScalingGroupInput { - s.MaxInstanceNumber = &v - return s -} - -// SetMinInstanceNumber sets the MinInstanceNumber field's value. -func (s *ModifyScalingGroupInput) SetMinInstanceNumber(v int32) *ModifyScalingGroupInput { - s.MinInstanceNumber = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *ModifyScalingGroupInput) SetScalingGroupId(v string) *ModifyScalingGroupInput { - s.ScalingGroupId = &v - return s -} - -// SetScalingGroupName sets the ScalingGroupName field's value. -func (s *ModifyScalingGroupInput) SetScalingGroupName(v string) *ModifyScalingGroupInput { - s.ScalingGroupName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *ModifyScalingGroupInput) SetSubnetIds(v []*string) *ModifyScalingGroupInput { - s.SubnetIds = v - return s -} - -type ModifyScalingGroupOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyScalingGroupOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyScalingGroupOutput) GoString() string { - return s.String() -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *ModifyScalingGroupOutput) SetScalingGroupId(v string) *ModifyScalingGroupOutput { - s.ScalingGroupId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_policy.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_policy.go deleted file mode 100644 index f30f01795b11..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_modify_scaling_policy.go +++ /dev/null @@ -1,364 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyScalingPolicyCommon = "ModifyScalingPolicy" - -// ModifyScalingPolicyCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyScalingPolicyCommon operation. The "output" return -// value will be populated with the ModifyScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyScalingPolicyCommon Send returns without error. -// -// See ModifyScalingPolicyCommon for more information on using the ModifyScalingPolicyCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyScalingPolicyCommonRequest method. -// req, resp := client.ModifyScalingPolicyCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) ModifyScalingPolicyCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyScalingPolicyCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyScalingPolicyCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation ModifyScalingPolicyCommon for usage and error information. -func (c *AUTOSCALING) ModifyScalingPolicyCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyScalingPolicyCommonRequest(input) - return out, req.Send() -} - -// ModifyScalingPolicyCommonWithContext is the same as ModifyScalingPolicyCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyScalingPolicyCommon 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 *AUTOSCALING) ModifyScalingPolicyCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyScalingPolicyCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyScalingPolicy = "ModifyScalingPolicy" - -// ModifyScalingPolicyRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyScalingPolicy operation. The "output" return -// value will be populated with the ModifyScalingPolicyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyScalingPolicyCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyScalingPolicyCommon Send returns without error. -// -// See ModifyScalingPolicy for more information on using the ModifyScalingPolicy -// API call, and error handling. -// -// // Example sending a request using the ModifyScalingPolicyRequest method. -// req, resp := client.ModifyScalingPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) ModifyScalingPolicyRequest(input *ModifyScalingPolicyInput) (req *request.Request, output *ModifyScalingPolicyOutput) { - op := &request.Operation{ - Name: opModifyScalingPolicy, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyScalingPolicyInput{} - } - - output = &ModifyScalingPolicyOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyScalingPolicy API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation ModifyScalingPolicy for usage and error information. -func (c *AUTOSCALING) ModifyScalingPolicy(input *ModifyScalingPolicyInput) (*ModifyScalingPolicyOutput, error) { - req, out := c.ModifyScalingPolicyRequest(input) - return out, req.Send() -} - -// ModifyScalingPolicyWithContext is the same as ModifyScalingPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyScalingPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) ModifyScalingPolicyWithContext(ctx volcengine.Context, input *ModifyScalingPolicyInput, opts ...request.Option) (*ModifyScalingPolicyOutput, error) { - req, out := c.ModifyScalingPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AlarmPolicyConditionForModifyScalingPolicyInput struct { - _ struct{} `type:"structure"` - - ComparisonOperator *string `type:"string"` - - MetricName *string `type:"string"` - - MetricUnit *string `type:"string"` - - Threshold *string `type:"string"` -} - -// String returns the string representation -func (s AlarmPolicyConditionForModifyScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AlarmPolicyConditionForModifyScalingPolicyInput) GoString() string { - return s.String() -} - -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *AlarmPolicyConditionForModifyScalingPolicyInput) SetComparisonOperator(v string) *AlarmPolicyConditionForModifyScalingPolicyInput { - s.ComparisonOperator = &v - return s -} - -// SetMetricName sets the MetricName field's value. -func (s *AlarmPolicyConditionForModifyScalingPolicyInput) SetMetricName(v string) *AlarmPolicyConditionForModifyScalingPolicyInput { - s.MetricName = &v - return s -} - -// SetMetricUnit sets the MetricUnit field's value. -func (s *AlarmPolicyConditionForModifyScalingPolicyInput) SetMetricUnit(v string) *AlarmPolicyConditionForModifyScalingPolicyInput { - s.MetricUnit = &v - return s -} - -// SetThreshold sets the Threshold field's value. -func (s *AlarmPolicyConditionForModifyScalingPolicyInput) SetThreshold(v string) *AlarmPolicyConditionForModifyScalingPolicyInput { - s.Threshold = &v - return s -} - -type AlarmPolicyForModifyScalingPolicyInput struct { - _ struct{} `type:"structure"` - - Condition *AlarmPolicyConditionForModifyScalingPolicyInput `type:"structure"` - - EvaluationCount *int32 `type:"int32"` - - RuleType *string `type:"string"` -} - -// String returns the string representation -func (s AlarmPolicyForModifyScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AlarmPolicyForModifyScalingPolicyInput) GoString() string { - return s.String() -} - -// SetCondition sets the Condition field's value. -func (s *AlarmPolicyForModifyScalingPolicyInput) SetCondition(v *AlarmPolicyConditionForModifyScalingPolicyInput) *AlarmPolicyForModifyScalingPolicyInput { - s.Condition = v - return s -} - -// SetEvaluationCount sets the EvaluationCount field's value. -func (s *AlarmPolicyForModifyScalingPolicyInput) SetEvaluationCount(v int32) *AlarmPolicyForModifyScalingPolicyInput { - s.EvaluationCount = &v - return s -} - -// SetRuleType sets the RuleType field's value. -func (s *AlarmPolicyForModifyScalingPolicyInput) SetRuleType(v string) *AlarmPolicyForModifyScalingPolicyInput { - s.RuleType = &v - return s -} - -type ModifyScalingPolicyInput struct { - _ struct{} `type:"structure"` - - AdjustmentType *string `type:"string"` - - AdjustmentValue *int32 `type:"int32"` - - AlarmPolicy *AlarmPolicyForModifyScalingPolicyInput `type:"structure"` - - Cooldown *int32 `type:"int32"` - - ScalingPolicyId *string `type:"string"` - - ScalingPolicyName *string `type:"string"` - - ScheduledPolicy *ScheduledPolicyForModifyScalingPolicyInput `type:"structure"` -} - -// String returns the string representation -func (s ModifyScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyScalingPolicyInput) GoString() string { - return s.String() -} - -// SetAdjustmentType sets the AdjustmentType field's value. -func (s *ModifyScalingPolicyInput) SetAdjustmentType(v string) *ModifyScalingPolicyInput { - s.AdjustmentType = &v - return s -} - -// SetAdjustmentValue sets the AdjustmentValue field's value. -func (s *ModifyScalingPolicyInput) SetAdjustmentValue(v int32) *ModifyScalingPolicyInput { - s.AdjustmentValue = &v - return s -} - -// SetAlarmPolicy sets the AlarmPolicy field's value. -func (s *ModifyScalingPolicyInput) SetAlarmPolicy(v *AlarmPolicyForModifyScalingPolicyInput) *ModifyScalingPolicyInput { - s.AlarmPolicy = v - return s -} - -// SetCooldown sets the Cooldown field's value. -func (s *ModifyScalingPolicyInput) SetCooldown(v int32) *ModifyScalingPolicyInput { - s.Cooldown = &v - return s -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *ModifyScalingPolicyInput) SetScalingPolicyId(v string) *ModifyScalingPolicyInput { - s.ScalingPolicyId = &v - return s -} - -// SetScalingPolicyName sets the ScalingPolicyName field's value. -func (s *ModifyScalingPolicyInput) SetScalingPolicyName(v string) *ModifyScalingPolicyInput { - s.ScalingPolicyName = &v - return s -} - -// SetScheduledPolicy sets the ScheduledPolicy field's value. -func (s *ModifyScalingPolicyInput) SetScheduledPolicy(v *ScheduledPolicyForModifyScalingPolicyInput) *ModifyScalingPolicyInput { - s.ScheduledPolicy = v - return s -} - -type ModifyScalingPolicyOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ScalingPolicyId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyScalingPolicyOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyScalingPolicyOutput) GoString() string { - return s.String() -} - -// SetScalingPolicyId sets the ScalingPolicyId field's value. -func (s *ModifyScalingPolicyOutput) SetScalingPolicyId(v string) *ModifyScalingPolicyOutput { - s.ScalingPolicyId = &v - return s -} - -type ScheduledPolicyForModifyScalingPolicyInput struct { - _ struct{} `type:"structure"` - - LaunchTime *string `type:"string"` - - RecurrenceEndTime *string `type:"string"` - - RecurrenceType *string `type:"string"` - - RecurrenceValue *string `type:"string"` -} - -// String returns the string representation -func (s ScheduledPolicyForModifyScalingPolicyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ScheduledPolicyForModifyScalingPolicyInput) GoString() string { - return s.String() -} - -// SetLaunchTime sets the LaunchTime field's value. -func (s *ScheduledPolicyForModifyScalingPolicyInput) SetLaunchTime(v string) *ScheduledPolicyForModifyScalingPolicyInput { - s.LaunchTime = &v - return s -} - -// SetRecurrenceEndTime sets the RecurrenceEndTime field's value. -func (s *ScheduledPolicyForModifyScalingPolicyInput) SetRecurrenceEndTime(v string) *ScheduledPolicyForModifyScalingPolicyInput { - s.RecurrenceEndTime = &v - return s -} - -// SetRecurrenceType sets the RecurrenceType field's value. -func (s *ScheduledPolicyForModifyScalingPolicyInput) SetRecurrenceType(v string) *ScheduledPolicyForModifyScalingPolicyInput { - s.RecurrenceType = &v - return s -} - -// SetRecurrenceValue sets the RecurrenceValue field's value. -func (s *ScheduledPolicyForModifyScalingPolicyInput) SetRecurrenceValue(v string) *ScheduledPolicyForModifyScalingPolicyInput { - s.RecurrenceValue = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_remove_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_remove_instances.go deleted file mode 100644 index 6dec44eb18d6..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_remove_instances.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opRemoveInstancesCommon = "RemoveInstances" - -// RemoveInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the RemoveInstancesCommon operation. The "output" return -// value will be populated with the RemoveInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RemoveInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after RemoveInstancesCommon Send returns without error. -// -// See RemoveInstancesCommon for more information on using the RemoveInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the RemoveInstancesCommonRequest method. -// req, resp := client.RemoveInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) RemoveInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opRemoveInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// RemoveInstancesCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation RemoveInstancesCommon for usage and error information. -func (c *AUTOSCALING) RemoveInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.RemoveInstancesCommonRequest(input) - return out, req.Send() -} - -// RemoveInstancesCommonWithContext is the same as RemoveInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See RemoveInstancesCommon 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 *AUTOSCALING) RemoveInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.RemoveInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRemoveInstances = "RemoveInstances" - -// RemoveInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the RemoveInstances operation. The "output" return -// value will be populated with the RemoveInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RemoveInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after RemoveInstancesCommon Send returns without error. -// -// See RemoveInstances for more information on using the RemoveInstances -// API call, and error handling. -// -// // Example sending a request using the RemoveInstancesRequest method. -// req, resp := client.RemoveInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) RemoveInstancesRequest(input *RemoveInstancesInput) (req *request.Request, output *RemoveInstancesOutput) { - op := &request.Operation{ - Name: opRemoveInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveInstancesInput{} - } - - output = &RemoveInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// RemoveInstances API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation RemoveInstances for usage and error information. -func (c *AUTOSCALING) RemoveInstances(input *RemoveInstancesInput) (*RemoveInstancesOutput, error) { - req, out := c.RemoveInstancesRequest(input) - return out, req.Send() -} - -// RemoveInstancesWithContext is the same as RemoveInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RemoveInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) RemoveInstancesWithContext(ctx volcengine.Context, input *RemoveInstancesInput, opts ...request.Option) (*RemoveInstancesOutput, error) { - req, out := c.RemoveInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type RemoveInstancesInput struct { - _ struct{} `type:"structure"` - - DecreaseDesiredCapacity *bool `type:"boolean"` - - InstanceIds []*string `type:"list"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s RemoveInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveInstancesInput) GoString() string { - return s.String() -} - -// SetDecreaseDesiredCapacity sets the DecreaseDesiredCapacity field's value. -func (s *RemoveInstancesInput) SetDecreaseDesiredCapacity(v bool) *RemoveInstancesInput { - s.DecreaseDesiredCapacity = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *RemoveInstancesInput) SetInstanceIds(v []*string) *RemoveInstancesInput { - s.InstanceIds = v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *RemoveInstancesInput) SetScalingGroupId(v string) *RemoveInstancesInput { - s.ScalingGroupId = &v - return s -} - -type RemoveInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s RemoveInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RemoveInstancesOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_set_instances_protection.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_set_instances_protection.go deleted file mode 100644 index 8c1bcafe2deb..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/api_set_instances_protection.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opSetInstancesProtectionCommon = "SetInstancesProtection" - -// SetInstancesProtectionCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the SetInstancesProtectionCommon operation. The "output" return -// value will be populated with the SetInstancesProtectionCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned SetInstancesProtectionCommon Request to send the API call to the service. -// the "output" return value is not valid until after SetInstancesProtectionCommon Send returns without error. -// -// See SetInstancesProtectionCommon for more information on using the SetInstancesProtectionCommon -// API call, and error handling. -// -// // Example sending a request using the SetInstancesProtectionCommonRequest method. -// req, resp := client.SetInstancesProtectionCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) SetInstancesProtectionCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opSetInstancesProtectionCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// SetInstancesProtectionCommon API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation SetInstancesProtectionCommon for usage and error information. -func (c *AUTOSCALING) SetInstancesProtectionCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.SetInstancesProtectionCommonRequest(input) - return out, req.Send() -} - -// SetInstancesProtectionCommonWithContext is the same as SetInstancesProtectionCommon with the addition of -// the ability to pass a context and additional request options. -// -// See SetInstancesProtectionCommon 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 *AUTOSCALING) SetInstancesProtectionCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.SetInstancesProtectionCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSetInstancesProtection = "SetInstancesProtection" - -// SetInstancesProtectionRequest generates a "volcengine/request.Request" representing the -// client's request for the SetInstancesProtection operation. The "output" return -// value will be populated with the SetInstancesProtectionCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned SetInstancesProtectionCommon Request to send the API call to the service. -// the "output" return value is not valid until after SetInstancesProtectionCommon Send returns without error. -// -// See SetInstancesProtection for more information on using the SetInstancesProtection -// API call, and error handling. -// -// // Example sending a request using the SetInstancesProtectionRequest method. -// req, resp := client.SetInstancesProtectionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *AUTOSCALING) SetInstancesProtectionRequest(input *SetInstancesProtectionInput) (req *request.Request, output *SetInstancesProtectionOutput) { - op := &request.Operation{ - Name: opSetInstancesProtection, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &SetInstancesProtectionInput{} - } - - output = &SetInstancesProtectionOutput{} - req = c.newRequest(op, input, output) - - return -} - -// SetInstancesProtection API operation for AUTO_SCALING. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for AUTO_SCALING's -// API operation SetInstancesProtection for usage and error information. -func (c *AUTOSCALING) SetInstancesProtection(input *SetInstancesProtectionInput) (*SetInstancesProtectionOutput, error) { - req, out := c.SetInstancesProtectionRequest(input) - return out, req.Send() -} - -// SetInstancesProtectionWithContext is the same as SetInstancesProtection with the addition of -// the ability to pass a context and additional request options. -// -// See SetInstancesProtection for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *AUTOSCALING) SetInstancesProtectionWithContext(ctx volcengine.Context, input *SetInstancesProtectionInput, opts ...request.Option) (*SetInstancesProtectionOutput, error) { - req, out := c.SetInstancesProtectionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type InstanceProtectionResultForSetInstancesProtectionOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - InstanceId *string `type:"string"` - - Message *string `type:"string"` - - Result *string `type:"string"` -} - -// String returns the string representation -func (s InstanceProtectionResultForSetInstancesProtectionOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceProtectionResultForSetInstancesProtectionOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *InstanceProtectionResultForSetInstancesProtectionOutput) SetCode(v string) *InstanceProtectionResultForSetInstancesProtectionOutput { - s.Code = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceProtectionResultForSetInstancesProtectionOutput) SetInstanceId(v string) *InstanceProtectionResultForSetInstancesProtectionOutput { - s.InstanceId = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *InstanceProtectionResultForSetInstancesProtectionOutput) SetMessage(v string) *InstanceProtectionResultForSetInstancesProtectionOutput { - s.Message = &v - return s -} - -// SetResult sets the Result field's value. -func (s *InstanceProtectionResultForSetInstancesProtectionOutput) SetResult(v string) *InstanceProtectionResultForSetInstancesProtectionOutput { - s.Result = &v - return s -} - -type SetInstancesProtectionInput struct { - _ struct{} `type:"structure"` - - InstanceIds []*string `type:"list"` - - ProtectedFromScaleIn *bool `type:"boolean"` - - ScalingGroupId *string `type:"string"` -} - -// String returns the string representation -func (s SetInstancesProtectionInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetInstancesProtectionInput) GoString() string { - return s.String() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *SetInstancesProtectionInput) SetInstanceIds(v []*string) *SetInstancesProtectionInput { - s.InstanceIds = v - return s -} - -// SetProtectedFromScaleIn sets the ProtectedFromScaleIn field's value. -func (s *SetInstancesProtectionInput) SetProtectedFromScaleIn(v bool) *SetInstancesProtectionInput { - s.ProtectedFromScaleIn = &v - return s -} - -// SetScalingGroupId sets the ScalingGroupId field's value. -func (s *SetInstancesProtectionInput) SetScalingGroupId(v string) *SetInstancesProtectionInput { - s.ScalingGroupId = &v - return s -} - -type SetInstancesProtectionOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - InstanceProtectionResults []*InstanceProtectionResultForSetInstancesProtectionOutput `type:"list"` -} - -// String returns the string representation -func (s SetInstancesProtectionOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s SetInstancesProtectionOutput) GoString() string { - return s.String() -} - -// SetInstanceProtectionResults sets the InstanceProtectionResults field's value. -func (s *SetInstancesProtectionOutput) SetInstanceProtectionResults(v []*InstanceProtectionResultForSetInstancesProtectionOutput) *SetInstancesProtectionOutput { - s.InstanceProtectionResults = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/interface_autoscaling.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/interface_autoscaling.go deleted file mode 100644 index e76747dcf5de..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/interface_autoscaling.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package autoscalingiface provides an interface to enable mocking the AUTO_SCALING service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// AUTOSCALINGAPI provides an interface to enable mocking the -// autoscaling.AUTOSCALING service client's API operation, -// -// // volcengine sdk func uses an SDK service client to make a request to -// // AUTO_SCALING. -// func myFunc(svc AUTOSCALINGAPI) bool { -// // Make svc.AttachDBInstances request -// } -// -// func main() { -// sess := session.New() -// svc := autoscaling.New(sess) -// -// myFunc(svc) -// } -type AUTOSCALINGAPI interface { - AttachDBInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - AttachDBInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - AttachDBInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - AttachDBInstances(*AttachDBInstancesInput) (*AttachDBInstancesOutput, error) - AttachDBInstancesWithContext(volcengine.Context, *AttachDBInstancesInput, ...request.Option) (*AttachDBInstancesOutput, error) - AttachDBInstancesRequest(*AttachDBInstancesInput) (*request.Request, *AttachDBInstancesOutput) - - AttachInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - AttachInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - AttachInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - AttachInstances(*AttachInstancesInput) (*AttachInstancesOutput, error) - AttachInstancesWithContext(volcengine.Context, *AttachInstancesInput, ...request.Option) (*AttachInstancesOutput, error) - AttachInstancesRequest(*AttachInstancesInput) (*request.Request, *AttachInstancesOutput) - - AttachServerGroupsCommon(*map[string]interface{}) (*map[string]interface{}, error) - AttachServerGroupsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - AttachServerGroupsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - AttachServerGroups(*AttachServerGroupsInput) (*AttachServerGroupsOutput, error) - AttachServerGroupsWithContext(volcengine.Context, *AttachServerGroupsInput, ...request.Option) (*AttachServerGroupsOutput, error) - AttachServerGroupsRequest(*AttachServerGroupsInput) (*request.Request, *AttachServerGroupsOutput) - - CompleteLifecycleActivityCommon(*map[string]interface{}) (*map[string]interface{}, error) - CompleteLifecycleActivityCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CompleteLifecycleActivityCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CompleteLifecycleActivity(*CompleteLifecycleActivityInput) (*CompleteLifecycleActivityOutput, error) - CompleteLifecycleActivityWithContext(volcengine.Context, *CompleteLifecycleActivityInput, ...request.Option) (*CompleteLifecycleActivityOutput, error) - CompleteLifecycleActivityRequest(*CompleteLifecycleActivityInput) (*request.Request, *CompleteLifecycleActivityOutput) - - CreateLifecycleHookCommon(*map[string]interface{}) (*map[string]interface{}, error) - CreateLifecycleHookCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CreateLifecycleHookCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CreateLifecycleHook(*CreateLifecycleHookInput) (*CreateLifecycleHookOutput, error) - CreateLifecycleHookWithContext(volcengine.Context, *CreateLifecycleHookInput, ...request.Option) (*CreateLifecycleHookOutput, error) - CreateLifecycleHookRequest(*CreateLifecycleHookInput) (*request.Request, *CreateLifecycleHookOutput) - - CreateScalingConfigurationCommon(*map[string]interface{}) (*map[string]interface{}, error) - CreateScalingConfigurationCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CreateScalingConfigurationCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CreateScalingConfiguration(*CreateScalingConfigurationInput) (*CreateScalingConfigurationOutput, error) - CreateScalingConfigurationWithContext(volcengine.Context, *CreateScalingConfigurationInput, ...request.Option) (*CreateScalingConfigurationOutput, error) - CreateScalingConfigurationRequest(*CreateScalingConfigurationInput) (*request.Request, *CreateScalingConfigurationOutput) - - CreateScalingGroupCommon(*map[string]interface{}) (*map[string]interface{}, error) - CreateScalingGroupCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CreateScalingGroupCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CreateScalingGroup(*CreateScalingGroupInput) (*CreateScalingGroupOutput, error) - CreateScalingGroupWithContext(volcengine.Context, *CreateScalingGroupInput, ...request.Option) (*CreateScalingGroupOutput, error) - CreateScalingGroupRequest(*CreateScalingGroupInput) (*request.Request, *CreateScalingGroupOutput) - - CreateScalingPolicyCommon(*map[string]interface{}) (*map[string]interface{}, error) - CreateScalingPolicyCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CreateScalingPolicyCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CreateScalingPolicy(*CreateScalingPolicyInput) (*CreateScalingPolicyOutput, error) - CreateScalingPolicyWithContext(volcengine.Context, *CreateScalingPolicyInput, ...request.Option) (*CreateScalingPolicyOutput, error) - CreateScalingPolicyRequest(*CreateScalingPolicyInput) (*request.Request, *CreateScalingPolicyOutput) - - DeleteLifecycleHookCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteLifecycleHookCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteLifecycleHookCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteLifecycleHook(*DeleteLifecycleHookInput) (*DeleteLifecycleHookOutput, error) - DeleteLifecycleHookWithContext(volcengine.Context, *DeleteLifecycleHookInput, ...request.Option) (*DeleteLifecycleHookOutput, error) - DeleteLifecycleHookRequest(*DeleteLifecycleHookInput) (*request.Request, *DeleteLifecycleHookOutput) - - DeleteScalingConfigurationCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteScalingConfigurationCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteScalingConfigurationCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteScalingConfiguration(*DeleteScalingConfigurationInput) (*DeleteScalingConfigurationOutput, error) - DeleteScalingConfigurationWithContext(volcengine.Context, *DeleteScalingConfigurationInput, ...request.Option) (*DeleteScalingConfigurationOutput, error) - DeleteScalingConfigurationRequest(*DeleteScalingConfigurationInput) (*request.Request, *DeleteScalingConfigurationOutput) - - DeleteScalingGroupCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteScalingGroupCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteScalingGroupCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteScalingGroup(*DeleteScalingGroupInput) (*DeleteScalingGroupOutput, error) - DeleteScalingGroupWithContext(volcengine.Context, *DeleteScalingGroupInput, ...request.Option) (*DeleteScalingGroupOutput, error) - DeleteScalingGroupRequest(*DeleteScalingGroupInput) (*request.Request, *DeleteScalingGroupOutput) - - DeleteScalingPolicyCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteScalingPolicyCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteScalingPolicyCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteScalingPolicy(*DeleteScalingPolicyInput) (*DeleteScalingPolicyOutput, error) - DeleteScalingPolicyWithContext(volcengine.Context, *DeleteScalingPolicyInput, ...request.Option) (*DeleteScalingPolicyOutput, error) - DeleteScalingPolicyRequest(*DeleteScalingPolicyInput) (*request.Request, *DeleteScalingPolicyOutput) - - DescribeLifecycleActivitiesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeLifecycleActivitiesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeLifecycleActivitiesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeLifecycleActivities(*DescribeLifecycleActivitiesInput) (*DescribeLifecycleActivitiesOutput, error) - DescribeLifecycleActivitiesWithContext(volcengine.Context, *DescribeLifecycleActivitiesInput, ...request.Option) (*DescribeLifecycleActivitiesOutput, error) - DescribeLifecycleActivitiesRequest(*DescribeLifecycleActivitiesInput) (*request.Request, *DescribeLifecycleActivitiesOutput) - - DescribeLifecycleHooksCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeLifecycleHooksCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeLifecycleHooksCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeLifecycleHooks(*DescribeLifecycleHooksInput) (*DescribeLifecycleHooksOutput, error) - DescribeLifecycleHooksWithContext(volcengine.Context, *DescribeLifecycleHooksInput, ...request.Option) (*DescribeLifecycleHooksOutput, error) - DescribeLifecycleHooksRequest(*DescribeLifecycleHooksInput) (*request.Request, *DescribeLifecycleHooksOutput) - - DescribeScalingActivitiesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeScalingActivitiesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeScalingActivitiesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeScalingActivities(*DescribeScalingActivitiesInput) (*DescribeScalingActivitiesOutput, error) - DescribeScalingActivitiesWithContext(volcengine.Context, *DescribeScalingActivitiesInput, ...request.Option) (*DescribeScalingActivitiesOutput, error) - DescribeScalingActivitiesRequest(*DescribeScalingActivitiesInput) (*request.Request, *DescribeScalingActivitiesOutput) - - DescribeScalingConfigurationsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeScalingConfigurationsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeScalingConfigurationsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeScalingConfigurations(*DescribeScalingConfigurationsInput) (*DescribeScalingConfigurationsOutput, error) - DescribeScalingConfigurationsWithContext(volcengine.Context, *DescribeScalingConfigurationsInput, ...request.Option) (*DescribeScalingConfigurationsOutput, error) - DescribeScalingConfigurationsRequest(*DescribeScalingConfigurationsInput) (*request.Request, *DescribeScalingConfigurationsOutput) - - DescribeScalingGroupsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeScalingGroupsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeScalingGroupsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeScalingGroups(*DescribeScalingGroupsInput) (*DescribeScalingGroupsOutput, error) - DescribeScalingGroupsWithContext(volcengine.Context, *DescribeScalingGroupsInput, ...request.Option) (*DescribeScalingGroupsOutput, error) - DescribeScalingGroupsRequest(*DescribeScalingGroupsInput) (*request.Request, *DescribeScalingGroupsOutput) - - DescribeScalingInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeScalingInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeScalingInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeScalingInstances(*DescribeScalingInstancesInput) (*DescribeScalingInstancesOutput, error) - DescribeScalingInstancesWithContext(volcengine.Context, *DescribeScalingInstancesInput, ...request.Option) (*DescribeScalingInstancesOutput, error) - DescribeScalingInstancesRequest(*DescribeScalingInstancesInput) (*request.Request, *DescribeScalingInstancesOutput) - - DescribeScalingPoliciesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeScalingPoliciesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeScalingPoliciesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeScalingPolicies(*DescribeScalingPoliciesInput) (*DescribeScalingPoliciesOutput, error) - DescribeScalingPoliciesWithContext(volcengine.Context, *DescribeScalingPoliciesInput, ...request.Option) (*DescribeScalingPoliciesOutput, error) - DescribeScalingPoliciesRequest(*DescribeScalingPoliciesInput) (*request.Request, *DescribeScalingPoliciesOutput) - - DetachDBInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DetachDBInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DetachDBInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DetachDBInstances(*DetachDBInstancesInput) (*DetachDBInstancesOutput, error) - DetachDBInstancesWithContext(volcengine.Context, *DetachDBInstancesInput, ...request.Option) (*DetachDBInstancesOutput, error) - DetachDBInstancesRequest(*DetachDBInstancesInput) (*request.Request, *DetachDBInstancesOutput) - - DetachInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DetachInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DetachInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DetachInstances(*DetachInstancesInput) (*DetachInstancesOutput, error) - DetachInstancesWithContext(volcengine.Context, *DetachInstancesInput, ...request.Option) (*DetachInstancesOutput, error) - DetachInstancesRequest(*DetachInstancesInput) (*request.Request, *DetachInstancesOutput) - - DetachServerGroupsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DetachServerGroupsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DetachServerGroupsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DetachServerGroups(*DetachServerGroupsInput) (*DetachServerGroupsOutput, error) - DetachServerGroupsWithContext(volcengine.Context, *DetachServerGroupsInput, ...request.Option) (*DetachServerGroupsOutput, error) - DetachServerGroupsRequest(*DetachServerGroupsInput) (*request.Request, *DetachServerGroupsOutput) - - DisableScalingGroupCommon(*map[string]interface{}) (*map[string]interface{}, error) - DisableScalingGroupCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DisableScalingGroupCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DisableScalingGroup(*DisableScalingGroupInput) (*DisableScalingGroupOutput, error) - DisableScalingGroupWithContext(volcengine.Context, *DisableScalingGroupInput, ...request.Option) (*DisableScalingGroupOutput, error) - DisableScalingGroupRequest(*DisableScalingGroupInput) (*request.Request, *DisableScalingGroupOutput) - - DisableScalingPolicyCommon(*map[string]interface{}) (*map[string]interface{}, error) - DisableScalingPolicyCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DisableScalingPolicyCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DisableScalingPolicy(*DisableScalingPolicyInput) (*DisableScalingPolicyOutput, error) - DisableScalingPolicyWithContext(volcengine.Context, *DisableScalingPolicyInput, ...request.Option) (*DisableScalingPolicyOutput, error) - DisableScalingPolicyRequest(*DisableScalingPolicyInput) (*request.Request, *DisableScalingPolicyOutput) - - EnableScalingConfigurationCommon(*map[string]interface{}) (*map[string]interface{}, error) - EnableScalingConfigurationCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - EnableScalingConfigurationCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - EnableScalingConfiguration(*EnableScalingConfigurationInput) (*EnableScalingConfigurationOutput, error) - EnableScalingConfigurationWithContext(volcengine.Context, *EnableScalingConfigurationInput, ...request.Option) (*EnableScalingConfigurationOutput, error) - EnableScalingConfigurationRequest(*EnableScalingConfigurationInput) (*request.Request, *EnableScalingConfigurationOutput) - - EnableScalingGroupCommon(*map[string]interface{}) (*map[string]interface{}, error) - EnableScalingGroupCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - EnableScalingGroupCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - EnableScalingGroup(*EnableScalingGroupInput) (*EnableScalingGroupOutput, error) - EnableScalingGroupWithContext(volcengine.Context, *EnableScalingGroupInput, ...request.Option) (*EnableScalingGroupOutput, error) - EnableScalingGroupRequest(*EnableScalingGroupInput) (*request.Request, *EnableScalingGroupOutput) - - EnableScalingPolicyCommon(*map[string]interface{}) (*map[string]interface{}, error) - EnableScalingPolicyCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - EnableScalingPolicyCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - EnableScalingPolicy(*EnableScalingPolicyInput) (*EnableScalingPolicyOutput, error) - EnableScalingPolicyWithContext(volcengine.Context, *EnableScalingPolicyInput, ...request.Option) (*EnableScalingPolicyOutput, error) - EnableScalingPolicyRequest(*EnableScalingPolicyInput) (*request.Request, *EnableScalingPolicyOutput) - - ModifyLifecycleHookCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyLifecycleHookCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyLifecycleHookCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyLifecycleHook(*ModifyLifecycleHookInput) (*ModifyLifecycleHookOutput, error) - ModifyLifecycleHookWithContext(volcengine.Context, *ModifyLifecycleHookInput, ...request.Option) (*ModifyLifecycleHookOutput, error) - ModifyLifecycleHookRequest(*ModifyLifecycleHookInput) (*request.Request, *ModifyLifecycleHookOutput) - - ModifyScalingConfigurationCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyScalingConfigurationCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyScalingConfigurationCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyScalingConfiguration(*ModifyScalingConfigurationInput) (*ModifyScalingConfigurationOutput, error) - ModifyScalingConfigurationWithContext(volcengine.Context, *ModifyScalingConfigurationInput, ...request.Option) (*ModifyScalingConfigurationOutput, error) - ModifyScalingConfigurationRequest(*ModifyScalingConfigurationInput) (*request.Request, *ModifyScalingConfigurationOutput) - - ModifyScalingGroupCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyScalingGroupCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyScalingGroupCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyScalingGroup(*ModifyScalingGroupInput) (*ModifyScalingGroupOutput, error) - ModifyScalingGroupWithContext(volcengine.Context, *ModifyScalingGroupInput, ...request.Option) (*ModifyScalingGroupOutput, error) - ModifyScalingGroupRequest(*ModifyScalingGroupInput) (*request.Request, *ModifyScalingGroupOutput) - - ModifyScalingPolicyCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyScalingPolicyCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyScalingPolicyCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyScalingPolicy(*ModifyScalingPolicyInput) (*ModifyScalingPolicyOutput, error) - ModifyScalingPolicyWithContext(volcengine.Context, *ModifyScalingPolicyInput, ...request.Option) (*ModifyScalingPolicyOutput, error) - ModifyScalingPolicyRequest(*ModifyScalingPolicyInput) (*request.Request, *ModifyScalingPolicyOutput) - - RemoveInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - RemoveInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - RemoveInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - RemoveInstances(*RemoveInstancesInput) (*RemoveInstancesOutput, error) - RemoveInstancesWithContext(volcengine.Context, *RemoveInstancesInput, ...request.Option) (*RemoveInstancesOutput, error) - RemoveInstancesRequest(*RemoveInstancesInput) (*request.Request, *RemoveInstancesOutput) - - SetInstancesProtectionCommon(*map[string]interface{}) (*map[string]interface{}, error) - SetInstancesProtectionCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - SetInstancesProtectionCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - SetInstancesProtection(*SetInstancesProtectionInput) (*SetInstancesProtectionOutput, error) - SetInstancesProtectionWithContext(volcengine.Context, *SetInstancesProtectionInput, ...request.Option) (*SetInstancesProtectionOutput, error) - SetInstancesProtectionRequest(*SetInstancesProtectionInput) (*request.Request, *SetInstancesProtectionOutput) -} - -var _ AUTOSCALINGAPI = (*AUTOSCALING)(nil) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/service_autoscaling.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/service_autoscaling.go deleted file mode 100644 index 3419d868bdbf..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling/service_autoscaling.go +++ /dev/null @@ -1,105 +0,0 @@ -/* -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. -*/ - -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package autoscaling - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/signer/volc" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery" -) - -// AUTOSCALING provides the API operation methods for making requests to -// AUTO_SCALING. See this package's package overview docs -// for details on the service. -// -// AUTOSCALING methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type AUTOSCALING struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "autoscaling" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "auto_scaling" // ServiceID is a unique identifer of a specific service. -) - -// New create int can support ssl or region locate set -func New(p client.ConfigProvider, cfgs ...*volcengine.Config) *AUTOSCALING { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg volcengine.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AUTOSCALING { - svc := &AUTOSCALING{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2020-01-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) - svc.Handlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHandler) - svc.Handlers.Sign.PushBackNamed(volc.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(volcenginequery.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(volcenginequery.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(volcenginequery.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(volcenginequery.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a AUTOSCALING operation and runs any -// custom request initialization. -func (c *AUTOSCALING) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_associate_instances_iam_role.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_associate_instances_iam_role.go deleted file mode 100644 index 9286b99fdc1c..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_associate_instances_iam_role.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opAssociateInstancesIamRoleCommon = "AssociateInstancesIamRole" - -// AssociateInstancesIamRoleCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the AssociateInstancesIamRoleCommon operation. The "output" return -// value will be populated with the AssociateInstancesIamRoleCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AssociateInstancesIamRoleCommon Request to send the API call to the service. -// the "output" return value is not valid until after AssociateInstancesIamRoleCommon Send returns without error. -// -// See AssociateInstancesIamRoleCommon for more information on using the AssociateInstancesIamRoleCommon -// API call, and error handling. -// -// // Example sending a request using the AssociateInstancesIamRoleCommonRequest method. -// req, resp := client.AssociateInstancesIamRoleCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) AssociateInstancesIamRoleCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opAssociateInstancesIamRoleCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// AssociateInstancesIamRoleCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation AssociateInstancesIamRoleCommon for usage and error information. -func (c *ECS) AssociateInstancesIamRoleCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.AssociateInstancesIamRoleCommonRequest(input) - return out, req.Send() -} - -// AssociateInstancesIamRoleCommonWithContext is the same as AssociateInstancesIamRoleCommon with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateInstancesIamRoleCommon 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 *ECS) AssociateInstancesIamRoleCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.AssociateInstancesIamRoleCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAssociateInstancesIamRole = "AssociateInstancesIamRole" - -// AssociateInstancesIamRoleRequest generates a "volcengine/request.Request" representing the -// client's request for the AssociateInstancesIamRole operation. The "output" return -// value will be populated with the AssociateInstancesIamRoleCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AssociateInstancesIamRoleCommon Request to send the API call to the service. -// the "output" return value is not valid until after AssociateInstancesIamRoleCommon Send returns without error. -// -// See AssociateInstancesIamRole for more information on using the AssociateInstancesIamRole -// API call, and error handling. -// -// // Example sending a request using the AssociateInstancesIamRoleRequest method. -// req, resp := client.AssociateInstancesIamRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) AssociateInstancesIamRoleRequest(input *AssociateInstancesIamRoleInput) (req *request.Request, output *AssociateInstancesIamRoleOutput) { - op := &request.Operation{ - Name: opAssociateInstancesIamRole, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateInstancesIamRoleInput{} - } - - output = &AssociateInstancesIamRoleOutput{} - req = c.newRequest(op, input, output) - - return -} - -// AssociateInstancesIamRole API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation AssociateInstancesIamRole for usage and error information. -func (c *ECS) AssociateInstancesIamRole(input *AssociateInstancesIamRoleInput) (*AssociateInstancesIamRoleOutput, error) { - req, out := c.AssociateInstancesIamRoleRequest(input) - return out, req.Send() -} - -// AssociateInstancesIamRoleWithContext is the same as AssociateInstancesIamRole with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateInstancesIamRole for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) AssociateInstancesIamRoleWithContext(ctx volcengine.Context, input *AssociateInstancesIamRoleInput, opts ...request.Option) (*AssociateInstancesIamRoleOutput, error) { - req, out := c.AssociateInstancesIamRoleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AssociateInstancesIamRoleInput struct { - _ struct{} `type:"structure"` - - IamRoleName *string `type:"string"` - - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s AssociateInstancesIamRoleInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateInstancesIamRoleInput) GoString() string { - return s.String() -} - -// SetIamRoleName sets the IamRoleName field's value. -func (s *AssociateInstancesIamRoleInput) SetIamRoleName(v string) *AssociateInstancesIamRoleInput { - s.IamRoleName = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *AssociateInstancesIamRoleInput) SetInstanceIds(v []*string) *AssociateInstancesIamRoleInput { - s.InstanceIds = v - return s -} - -type AssociateInstancesIamRoleOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForAssociateInstancesIamRoleOutput `type:"list"` -} - -// String returns the string representation -func (s AssociateInstancesIamRoleOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateInstancesIamRoleOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *AssociateInstancesIamRoleOutput) SetOperationDetails(v []*OperationDetailForAssociateInstancesIamRoleOutput) *AssociateInstancesIamRoleOutput { - s.OperationDetails = v - return s -} - -type ErrorForAssociateInstancesIamRoleOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForAssociateInstancesIamRoleOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForAssociateInstancesIamRoleOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForAssociateInstancesIamRoleOutput) SetCode(v string) *ErrorForAssociateInstancesIamRoleOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForAssociateInstancesIamRoleOutput) SetMessage(v string) *ErrorForAssociateInstancesIamRoleOutput { - s.Message = &v - return s -} - -type OperationDetailForAssociateInstancesIamRoleOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForAssociateInstancesIamRoleOutput `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForAssociateInstancesIamRoleOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForAssociateInstancesIamRoleOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForAssociateInstancesIamRoleOutput) SetError(v *ErrorForAssociateInstancesIamRoleOutput) *OperationDetailForAssociateInstancesIamRoleOutput { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *OperationDetailForAssociateInstancesIamRoleOutput) SetInstanceId(v string) *OperationDetailForAssociateInstancesIamRoleOutput { - s.InstanceId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_attach_key_pair.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_attach_key_pair.go deleted file mode 100644 index c705bd7fbfb8..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_attach_key_pair.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opAttachKeyPairCommon = "AttachKeyPair" - -// AttachKeyPairCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the AttachKeyPairCommon operation. The "output" return -// value will be populated with the AttachKeyPairCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AttachKeyPairCommon Request to send the API call to the service. -// the "output" return value is not valid until after AttachKeyPairCommon Send returns without error. -// -// See AttachKeyPairCommon for more information on using the AttachKeyPairCommon -// API call, and error handling. -// -// // Example sending a request using the AttachKeyPairCommonRequest method. -// req, resp := client.AttachKeyPairCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) AttachKeyPairCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opAttachKeyPairCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// AttachKeyPairCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation AttachKeyPairCommon for usage and error information. -func (c *ECS) AttachKeyPairCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.AttachKeyPairCommonRequest(input) - return out, req.Send() -} - -// AttachKeyPairCommonWithContext is the same as AttachKeyPairCommon with the addition of -// the ability to pass a context and additional request options. -// -// See AttachKeyPairCommon 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 *ECS) AttachKeyPairCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.AttachKeyPairCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachKeyPair = "AttachKeyPair" - -// AttachKeyPairRequest generates a "volcengine/request.Request" representing the -// client's request for the AttachKeyPair operation. The "output" return -// value will be populated with the AttachKeyPairCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned AttachKeyPairCommon Request to send the API call to the service. -// the "output" return value is not valid until after AttachKeyPairCommon Send returns without error. -// -// See AttachKeyPair for more information on using the AttachKeyPair -// API call, and error handling. -// -// // Example sending a request using the AttachKeyPairRequest method. -// req, resp := client.AttachKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) AttachKeyPairRequest(input *AttachKeyPairInput) (req *request.Request, output *AttachKeyPairOutput) { - op := &request.Operation{ - Name: opAttachKeyPair, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &AttachKeyPairInput{} - } - - output = &AttachKeyPairOutput{} - req = c.newRequest(op, input, output) - - return -} - -// AttachKeyPair API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation AttachKeyPair for usage and error information. -func (c *ECS) AttachKeyPair(input *AttachKeyPairInput) (*AttachKeyPairOutput, error) { - req, out := c.AttachKeyPairRequest(input) - return out, req.Send() -} - -// AttachKeyPairWithContext is the same as AttachKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See AttachKeyPair for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) AttachKeyPairWithContext(ctx volcengine.Context, input *AttachKeyPairInput, opts ...request.Option) (*AttachKeyPairOutput, error) { - req, out := c.AttachKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AttachKeyPairInput struct { - _ struct{} `type:"structure"` - - InstanceIds []*string `type:"list"` - - KeyPairId *string `type:"string"` - - KeyPairName *string `type:"string"` -} - -// String returns the string representation -func (s AttachKeyPairInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachKeyPairInput) GoString() string { - return s.String() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *AttachKeyPairInput) SetInstanceIds(v []*string) *AttachKeyPairInput { - s.InstanceIds = v - return s -} - -// SetKeyPairId sets the KeyPairId field's value. -func (s *AttachKeyPairInput) SetKeyPairId(v string) *AttachKeyPairInput { - s.KeyPairId = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *AttachKeyPairInput) SetKeyPairName(v string) *AttachKeyPairInput { - s.KeyPairName = &v - return s -} - -type AttachKeyPairOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForAttachKeyPairOutput `type:"list"` -} - -// String returns the string representation -func (s AttachKeyPairOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AttachKeyPairOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *AttachKeyPairOutput) SetOperationDetails(v []*OperationDetailForAttachKeyPairOutput) *AttachKeyPairOutput { - s.OperationDetails = v - return s -} - -type ErrorForAttachKeyPairOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForAttachKeyPairOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForAttachKeyPairOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForAttachKeyPairOutput) SetCode(v string) *ErrorForAttachKeyPairOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForAttachKeyPairOutput) SetMessage(v string) *ErrorForAttachKeyPairOutput { - s.Message = &v - return s -} - -type OperationDetailForAttachKeyPairOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForAttachKeyPairOutput `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForAttachKeyPairOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForAttachKeyPairOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForAttachKeyPairOutput) SetError(v *ErrorForAttachKeyPairOutput) *OperationDetailForAttachKeyPairOutput { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *OperationDetailForAttachKeyPairOutput) SetInstanceId(v string) *OperationDetailForAttachKeyPairOutput { - s.InstanceId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_deployment_set.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_deployment_set.go deleted file mode 100644 index f8cda74b1b93..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_deployment_set.go +++ /dev/null @@ -1,218 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCreateDeploymentSetCommon = "CreateDeploymentSet" - -// CreateDeploymentSetCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateDeploymentSetCommon operation. The "output" return -// value will be populated with the CreateDeploymentSetCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateDeploymentSetCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateDeploymentSetCommon Send returns without error. -// -// See CreateDeploymentSetCommon for more information on using the CreateDeploymentSetCommon -// API call, and error handling. -// -// // Example sending a request using the CreateDeploymentSetCommonRequest method. -// req, resp := client.CreateDeploymentSetCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) CreateDeploymentSetCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCreateDeploymentSetCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CreateDeploymentSetCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation CreateDeploymentSetCommon for usage and error information. -func (c *ECS) CreateDeploymentSetCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CreateDeploymentSetCommonRequest(input) - return out, req.Send() -} - -// CreateDeploymentSetCommonWithContext is the same as CreateDeploymentSetCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDeploymentSetCommon 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 *ECS) CreateDeploymentSetCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CreateDeploymentSetCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateDeploymentSet = "CreateDeploymentSet" - -// CreateDeploymentSetRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateDeploymentSet operation. The "output" return -// value will be populated with the CreateDeploymentSetCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateDeploymentSetCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateDeploymentSetCommon Send returns without error. -// -// See CreateDeploymentSet for more information on using the CreateDeploymentSet -// API call, and error handling. -// -// // Example sending a request using the CreateDeploymentSetRequest method. -// req, resp := client.CreateDeploymentSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) CreateDeploymentSetRequest(input *CreateDeploymentSetInput) (req *request.Request, output *CreateDeploymentSetOutput) { - op := &request.Operation{ - Name: opCreateDeploymentSet, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CreateDeploymentSetInput{} - } - - output = &CreateDeploymentSetOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CreateDeploymentSet API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation CreateDeploymentSet for usage and error information. -func (c *ECS) CreateDeploymentSet(input *CreateDeploymentSetInput) (*CreateDeploymentSetOutput, error) { - req, out := c.CreateDeploymentSetRequest(input) - return out, req.Send() -} - -// CreateDeploymentSetWithContext is the same as CreateDeploymentSet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateDeploymentSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) CreateDeploymentSetWithContext(ctx volcengine.Context, input *CreateDeploymentSetInput, opts ...request.Option) (*CreateDeploymentSetOutput, error) { - req, out := c.CreateDeploymentSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CreateDeploymentSetInput struct { - _ struct{} `type:"structure"` - - ClientToken *string `type:"string"` - - DeploymentSetName *string `type:"string"` - - Description *string `type:"string"` - - Granularity *string `type:"string"` - - Strategy *string `type:"string"` -} - -// String returns the string representation -func (s CreateDeploymentSetInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentSetInput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *CreateDeploymentSetInput) SetClientToken(v string) *CreateDeploymentSetInput { - s.ClientToken = &v - return s -} - -// SetDeploymentSetName sets the DeploymentSetName field's value. -func (s *CreateDeploymentSetInput) SetDeploymentSetName(v string) *CreateDeploymentSetInput { - s.DeploymentSetName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateDeploymentSetInput) SetDescription(v string) *CreateDeploymentSetInput { - s.Description = &v - return s -} - -// SetGranularity sets the Granularity field's value. -func (s *CreateDeploymentSetInput) SetGranularity(v string) *CreateDeploymentSetInput { - s.Granularity = &v - return s -} - -// SetStrategy sets the Strategy field's value. -func (s *CreateDeploymentSetInput) SetStrategy(v string) *CreateDeploymentSetInput { - s.Strategy = &v - return s -} - -type CreateDeploymentSetOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - DeploymentSetId *string `type:"string"` -} - -// String returns the string representation -func (s CreateDeploymentSetOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateDeploymentSetOutput) GoString() string { - return s.String() -} - -// SetDeploymentSetId sets the DeploymentSetId field's value. -func (s *CreateDeploymentSetOutput) SetDeploymentSetId(v string) *CreateDeploymentSetOutput { - s.DeploymentSetId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_image.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_image.go deleted file mode 100644 index a325179c380b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_image.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCreateImageCommon = "CreateImage" - -// CreateImageCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateImageCommon operation. The "output" return -// value will be populated with the CreateImageCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateImageCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateImageCommon Send returns without error. -// -// See CreateImageCommon for more information on using the CreateImageCommon -// API call, and error handling. -// -// // Example sending a request using the CreateImageCommonRequest method. -// req, resp := client.CreateImageCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) CreateImageCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCreateImageCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CreateImageCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation CreateImageCommon for usage and error information. -func (c *ECS) CreateImageCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CreateImageCommonRequest(input) - return out, req.Send() -} - -// CreateImageCommonWithContext is the same as CreateImageCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CreateImageCommon 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 *ECS) CreateImageCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CreateImageCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateImage = "CreateImage" - -// CreateImageRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateImage operation. The "output" return -// value will be populated with the CreateImageCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateImageCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateImageCommon Send returns without error. -// -// See CreateImage for more information on using the CreateImage -// API call, and error handling. -// -// // Example sending a request using the CreateImageRequest method. -// req, resp := client.CreateImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) CreateImageRequest(input *CreateImageInput) (req *request.Request, output *CreateImageOutput) { - op := &request.Operation{ - Name: opCreateImage, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CreateImageInput{} - } - - output = &CreateImageOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CreateImage API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation CreateImage for usage and error information. -func (c *ECS) CreateImage(input *CreateImageInput) (*CreateImageOutput, error) { - req, out := c.CreateImageRequest(input) - return out, req.Send() -} - -// CreateImageWithContext is the same as CreateImage with the addition of -// the ability to pass a context and additional request options. -// -// See CreateImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) CreateImageWithContext(ctx volcengine.Context, input *CreateImageInput, opts ...request.Option) (*CreateImageOutput, error) { - req, out := c.CreateImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CreateImageInput struct { - _ struct{} `type:"structure"` - - Description *string `type:"string"` - - ImageName *string `type:"string"` - - InstanceId *string `type:"string"` - - ProjectName *string `type:"string"` -} - -// String returns the string representation -func (s CreateImageInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateImageInput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *CreateImageInput) SetDescription(v string) *CreateImageInput { - s.Description = &v - return s -} - -// SetImageName sets the ImageName field's value. -func (s *CreateImageInput) SetImageName(v string) *CreateImageInput { - s.ImageName = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *CreateImageInput) SetInstanceId(v string) *CreateImageInput { - s.InstanceId = &v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *CreateImageInput) SetProjectName(v string) *CreateImageInput { - s.ProjectName = &v - return s -} - -type CreateImageOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ImageId *string `type:"string"` -} - -// String returns the string representation -func (s CreateImageOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateImageOutput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *CreateImageOutput) SetImageId(v string) *CreateImageOutput { - s.ImageId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_key_pair.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_key_pair.go deleted file mode 100644 index d5675b9fb011..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_key_pair.go +++ /dev/null @@ -1,218 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCreateKeyPairCommon = "CreateKeyPair" - -// CreateKeyPairCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateKeyPairCommon operation. The "output" return -// value will be populated with the CreateKeyPairCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateKeyPairCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateKeyPairCommon Send returns without error. -// -// See CreateKeyPairCommon for more information on using the CreateKeyPairCommon -// API call, and error handling. -// -// // Example sending a request using the CreateKeyPairCommonRequest method. -// req, resp := client.CreateKeyPairCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) CreateKeyPairCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCreateKeyPairCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CreateKeyPairCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation CreateKeyPairCommon for usage and error information. -func (c *ECS) CreateKeyPairCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CreateKeyPairCommonRequest(input) - return out, req.Send() -} - -// CreateKeyPairCommonWithContext is the same as CreateKeyPairCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CreateKeyPairCommon 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 *ECS) CreateKeyPairCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CreateKeyPairCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateKeyPair = "CreateKeyPair" - -// CreateKeyPairRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateKeyPair operation. The "output" return -// value will be populated with the CreateKeyPairCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateKeyPairCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateKeyPairCommon Send returns without error. -// -// See CreateKeyPair for more information on using the CreateKeyPair -// API call, and error handling. -// -// // Example sending a request using the CreateKeyPairRequest method. -// req, resp := client.CreateKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) CreateKeyPairRequest(input *CreateKeyPairInput) (req *request.Request, output *CreateKeyPairOutput) { - op := &request.Operation{ - Name: opCreateKeyPair, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CreateKeyPairInput{} - } - - output = &CreateKeyPairOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CreateKeyPair API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation CreateKeyPair for usage and error information. -func (c *ECS) CreateKeyPair(input *CreateKeyPairInput) (*CreateKeyPairOutput, error) { - req, out := c.CreateKeyPairRequest(input) - return out, req.Send() -} - -// CreateKeyPairWithContext is the same as CreateKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See CreateKeyPair for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) CreateKeyPairWithContext(ctx volcengine.Context, input *CreateKeyPairInput, opts ...request.Option) (*CreateKeyPairOutput, error) { - req, out := c.CreateKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CreateKeyPairInput struct { - _ struct{} `type:"structure"` - - Description *string `type:"string"` - - KeyPairName *string `type:"string"` -} - -// String returns the string representation -func (s CreateKeyPairInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateKeyPairInput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *CreateKeyPairInput) SetDescription(v string) *CreateKeyPairInput { - s.Description = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *CreateKeyPairInput) SetKeyPairName(v string) *CreateKeyPairInput { - s.KeyPairName = &v - return s -} - -type CreateKeyPairOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - FingerPrint *string `type:"string"` - - KeyPairId *string `type:"string"` - - KeyPairName *string `type:"string"` - - PrivateKey *string `type:"string"` -} - -// String returns the string representation -func (s CreateKeyPairOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateKeyPairOutput) GoString() string { - return s.String() -} - -// SetFingerPrint sets the FingerPrint field's value. -func (s *CreateKeyPairOutput) SetFingerPrint(v string) *CreateKeyPairOutput { - s.FingerPrint = &v - return s -} - -// SetKeyPairId sets the KeyPairId field's value. -func (s *CreateKeyPairOutput) SetKeyPairId(v string) *CreateKeyPairOutput { - s.KeyPairId = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *CreateKeyPairOutput) SetKeyPairName(v string) *CreateKeyPairOutput { - s.KeyPairName = &v - return s -} - -// SetPrivateKey sets the PrivateKey field's value. -func (s *CreateKeyPairOutput) SetPrivateKey(v string) *CreateKeyPairOutput { - s.PrivateKey = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_tags.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_tags.go deleted file mode 100644 index 74feb85437ef..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_create_tags.go +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opCreateTagsCommon = "CreateTags" - -// CreateTagsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateTagsCommon operation. The "output" return -// value will be populated with the CreateTagsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateTagsCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateTagsCommon Send returns without error. -// -// See CreateTagsCommon for more information on using the CreateTagsCommon -// API call, and error handling. -// -// // Example sending a request using the CreateTagsCommonRequest method. -// req, resp := client.CreateTagsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) CreateTagsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opCreateTagsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// CreateTagsCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation CreateTagsCommon for usage and error information. -func (c *ECS) CreateTagsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.CreateTagsCommonRequest(input) - return out, req.Send() -} - -// CreateTagsCommonWithContext is the same as CreateTagsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTagsCommon 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 *ECS) CreateTagsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.CreateTagsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTags = "CreateTags" - -// CreateTagsRequest generates a "volcengine/request.Request" representing the -// client's request for the CreateTags operation. The "output" return -// value will be populated with the CreateTagsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned CreateTagsCommon Request to send the API call to the service. -// the "output" return value is not valid until after CreateTagsCommon Send returns without error. -// -// See CreateTags for more information on using the CreateTags -// API call, and error handling. -// -// // Example sending a request using the CreateTagsRequest method. -// req, resp := client.CreateTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, output *CreateTagsOutput) { - op := &request.Operation{ - Name: opCreateTags, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTagsInput{} - } - - output = &CreateTagsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// CreateTags API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation CreateTags for usage and error information. -func (c *ECS) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { - req, out := c.CreateTagsRequest(input) - return out, req.Send() -} - -// CreateTagsWithContext is the same as CreateTags with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) CreateTagsWithContext(ctx volcengine.Context, input *CreateTagsInput, opts ...request.Option) (*CreateTagsOutput, error) { - req, out := c.CreateTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CreateTagsInput struct { - _ struct{} `type:"structure"` - - ResourceIds []*string `type:"list"` - - ResourceType *string `type:"string"` - - Tags []*TagForCreateTagsInput `type:"list"` -} - -// String returns the string representation -func (s CreateTagsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTagsInput) GoString() string { - return s.String() -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *CreateTagsInput) SetResourceIds(v []*string) *CreateTagsInput { - s.ResourceIds = v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *CreateTagsInput) SetResourceType(v string) *CreateTagsInput { - s.ResourceType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateTagsInput) SetTags(v []*TagForCreateTagsInput) *CreateTagsInput { - s.Tags = v - return s -} - -type CreateTagsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForCreateTagsOutput `type:"list"` -} - -// String returns the string representation -func (s CreateTagsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTagsOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *CreateTagsOutput) SetOperationDetails(v []*OperationDetailForCreateTagsOutput) *CreateTagsOutput { - s.OperationDetails = v - return s -} - -type ErrorForCreateTagsOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForCreateTagsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForCreateTagsOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForCreateTagsOutput) SetCode(v string) *ErrorForCreateTagsOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForCreateTagsOutput) SetMessage(v string) *ErrorForCreateTagsOutput { - s.Message = &v - return s -} - -type OperationDetailForCreateTagsOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForCreateTagsOutput `type:"structure"` - - ResourceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForCreateTagsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForCreateTagsOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForCreateTagsOutput) SetError(v *ErrorForCreateTagsOutput) *OperationDetailForCreateTagsOutput { - s.Error = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *OperationDetailForCreateTagsOutput) SetResourceId(v string) *OperationDetailForCreateTagsOutput { - s.ResourceId = &v - return s -} - -type TagForCreateTagsInput struct { - _ struct{} `type:"structure"` - - Key *string `type:"string"` - - Value *string `type:"string"` -} - -// String returns the string representation -func (s TagForCreateTagsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagForCreateTagsInput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TagForCreateTagsInput) SetKey(v string) *TagForCreateTagsInput { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *TagForCreateTagsInput) SetValue(v string) *TagForCreateTagsInput { - s.Value = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_deployment_set.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_deployment_set.go deleted file mode 100644 index 1e853a2a2a0e..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_deployment_set.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteDeploymentSetCommon = "DeleteDeploymentSet" - -// DeleteDeploymentSetCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteDeploymentSetCommon operation. The "output" return -// value will be populated with the DeleteDeploymentSetCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteDeploymentSetCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteDeploymentSetCommon Send returns without error. -// -// See DeleteDeploymentSetCommon for more information on using the DeleteDeploymentSetCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteDeploymentSetCommonRequest method. -// req, resp := client.DeleteDeploymentSetCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteDeploymentSetCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteDeploymentSetCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteDeploymentSetCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteDeploymentSetCommon for usage and error information. -func (c *ECS) DeleteDeploymentSetCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteDeploymentSetCommonRequest(input) - return out, req.Send() -} - -// DeleteDeploymentSetCommonWithContext is the same as DeleteDeploymentSetCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDeploymentSetCommon 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 *ECS) DeleteDeploymentSetCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteDeploymentSetCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteDeploymentSet = "DeleteDeploymentSet" - -// DeleteDeploymentSetRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteDeploymentSet operation. The "output" return -// value will be populated with the DeleteDeploymentSetCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteDeploymentSetCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteDeploymentSetCommon Send returns without error. -// -// See DeleteDeploymentSet for more information on using the DeleteDeploymentSet -// API call, and error handling. -// -// // Example sending a request using the DeleteDeploymentSetRequest method. -// req, resp := client.DeleteDeploymentSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteDeploymentSetRequest(input *DeleteDeploymentSetInput) (req *request.Request, output *DeleteDeploymentSetOutput) { - op := &request.Operation{ - Name: opDeleteDeploymentSet, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteDeploymentSetInput{} - } - - output = &DeleteDeploymentSetOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteDeploymentSet API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteDeploymentSet for usage and error information. -func (c *ECS) DeleteDeploymentSet(input *DeleteDeploymentSetInput) (*DeleteDeploymentSetOutput, error) { - req, out := c.DeleteDeploymentSetRequest(input) - return out, req.Send() -} - -// DeleteDeploymentSetWithContext is the same as DeleteDeploymentSet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteDeploymentSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DeleteDeploymentSetWithContext(ctx volcengine.Context, input *DeleteDeploymentSetInput, opts ...request.Option) (*DeleteDeploymentSetOutput, error) { - req, out := c.DeleteDeploymentSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteDeploymentSetInput struct { - _ struct{} `type:"structure"` - - DeploymentSetId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteDeploymentSetInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeploymentSetInput) GoString() string { - return s.String() -} - -// SetDeploymentSetId sets the DeploymentSetId field's value. -func (s *DeleteDeploymentSetInput) SetDeploymentSetId(v string) *DeleteDeploymentSetInput { - s.DeploymentSetId = &v - return s -} - -type DeleteDeploymentSetOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s DeleteDeploymentSetOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteDeploymentSetOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_images.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_images.go deleted file mode 100644 index 09b66e7ee65c..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_images.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteImagesCommon = "DeleteImages" - -// DeleteImagesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteImagesCommon operation. The "output" return -// value will be populated with the DeleteImagesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteImagesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteImagesCommon Send returns without error. -// -// See DeleteImagesCommon for more information on using the DeleteImagesCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteImagesCommonRequest method. -// req, resp := client.DeleteImagesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteImagesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteImagesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteImagesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteImagesCommon for usage and error information. -func (c *ECS) DeleteImagesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteImagesCommonRequest(input) - return out, req.Send() -} - -// DeleteImagesCommonWithContext is the same as DeleteImagesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteImagesCommon 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 *ECS) DeleteImagesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteImagesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteImages = "DeleteImages" - -// DeleteImagesRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteImages operation. The "output" return -// value will be populated with the DeleteImagesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteImagesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteImagesCommon Send returns without error. -// -// See DeleteImages for more information on using the DeleteImages -// API call, and error handling. -// -// // Example sending a request using the DeleteImagesRequest method. -// req, resp := client.DeleteImagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteImagesRequest(input *DeleteImagesInput) (req *request.Request, output *DeleteImagesOutput) { - op := &request.Operation{ - Name: opDeleteImages, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteImagesInput{} - } - - output = &DeleteImagesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteImages API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteImages for usage and error information. -func (c *ECS) DeleteImages(input *DeleteImagesInput) (*DeleteImagesOutput, error) { - req, out := c.DeleteImagesRequest(input) - return out, req.Send() -} - -// DeleteImagesWithContext is the same as DeleteImages with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteImages for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DeleteImagesWithContext(ctx volcengine.Context, input *DeleteImagesInput, opts ...request.Option) (*DeleteImagesOutput, error) { - req, out := c.DeleteImagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteImagesInput struct { - _ struct{} `type:"structure"` - - ImageIds []*string `type:"list"` -} - -// String returns the string representation -func (s DeleteImagesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteImagesInput) GoString() string { - return s.String() -} - -// SetImageIds sets the ImageIds field's value. -func (s *DeleteImagesInput) SetImageIds(v []*string) *DeleteImagesInput { - s.ImageIds = v - return s -} - -type DeleteImagesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForDeleteImagesOutput `type:"list"` -} - -// String returns the string representation -func (s DeleteImagesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteImagesOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *DeleteImagesOutput) SetOperationDetails(v []*OperationDetailForDeleteImagesOutput) *DeleteImagesOutput { - s.OperationDetails = v - return s -} - -type ErrorForDeleteImagesOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForDeleteImagesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForDeleteImagesOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForDeleteImagesOutput) SetCode(v string) *ErrorForDeleteImagesOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForDeleteImagesOutput) SetMessage(v string) *ErrorForDeleteImagesOutput { - s.Message = &v - return s -} - -type OperationDetailForDeleteImagesOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForDeleteImagesOutput `type:"structure"` - - ImageId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForDeleteImagesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForDeleteImagesOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForDeleteImagesOutput) SetError(v *ErrorForDeleteImagesOutput) *OperationDetailForDeleteImagesOutput { - s.Error = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *OperationDetailForDeleteImagesOutput) SetImageId(v string) *OperationDetailForDeleteImagesOutput { - s.ImageId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_instance.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_instance.go deleted file mode 100644 index bae1a86af1cd..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_instance.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteInstanceCommon = "DeleteInstance" - -// DeleteInstanceCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteInstanceCommon operation. The "output" return -// value will be populated with the DeleteInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteInstanceCommon Send returns without error. -// -// See DeleteInstanceCommon for more information on using the DeleteInstanceCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteInstanceCommonRequest method. -// req, resp := client.DeleteInstanceCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteInstanceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteInstanceCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteInstanceCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteInstanceCommon for usage and error information. -func (c *ECS) DeleteInstanceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteInstanceCommonRequest(input) - return out, req.Send() -} - -// DeleteInstanceCommonWithContext is the same as DeleteInstanceCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteInstanceCommon 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 *ECS) DeleteInstanceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteInstanceCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteInstance = "DeleteInstance" - -// DeleteInstanceRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteInstance operation. The "output" return -// value will be populated with the DeleteInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteInstanceCommon Send returns without error. -// -// See DeleteInstance for more information on using the DeleteInstance -// API call, and error handling. -// -// // Example sending a request using the DeleteInstanceRequest method. -// req, resp := client.DeleteInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteInstanceRequest(input *DeleteInstanceInput) (req *request.Request, output *DeleteInstanceOutput) { - op := &request.Operation{ - Name: opDeleteInstance, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteInstanceInput{} - } - - output = &DeleteInstanceOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteInstance API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteInstance for usage and error information. -func (c *ECS) DeleteInstance(input *DeleteInstanceInput) (*DeleteInstanceOutput, error) { - req, out := c.DeleteInstanceRequest(input) - return out, req.Send() -} - -// DeleteInstanceWithContext is the same as DeleteInstance with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DeleteInstanceWithContext(ctx volcengine.Context, input *DeleteInstanceInput, opts ...request.Option) (*DeleteInstanceOutput, error) { - req, out := c.DeleteInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteInstanceInput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s DeleteInstanceInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DeleteInstanceInput) SetInstanceId(v string) *DeleteInstanceInput { - s.InstanceId = &v - return s -} - -type DeleteInstanceOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s DeleteInstanceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstanceOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_instances.go deleted file mode 100644 index d73843ed16c3..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_instances.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteInstancesCommon = "DeleteInstances" - -// DeleteInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteInstancesCommon operation. The "output" return -// value will be populated with the DeleteInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteInstancesCommon Send returns without error. -// -// See DeleteInstancesCommon for more information on using the DeleteInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteInstancesCommonRequest method. -// req, resp := client.DeleteInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteInstancesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteInstancesCommon for usage and error information. -func (c *ECS) DeleteInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteInstancesCommonRequest(input) - return out, req.Send() -} - -// DeleteInstancesCommonWithContext is the same as DeleteInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteInstancesCommon 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 *ECS) DeleteInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteInstances = "DeleteInstances" - -// DeleteInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteInstances operation. The "output" return -// value will be populated with the DeleteInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteInstancesCommon Send returns without error. -// -// See DeleteInstances for more information on using the DeleteInstances -// API call, and error handling. -// -// // Example sending a request using the DeleteInstancesRequest method. -// req, resp := client.DeleteInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteInstancesRequest(input *DeleteInstancesInput) (req *request.Request, output *DeleteInstancesOutput) { - op := &request.Operation{ - Name: opDeleteInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteInstancesInput{} - } - - output = &DeleteInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteInstances API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteInstances for usage and error information. -func (c *ECS) DeleteInstances(input *DeleteInstancesInput) (*DeleteInstancesOutput, error) { - req, out := c.DeleteInstancesRequest(input) - return out, req.Send() -} - -// DeleteInstancesWithContext is the same as DeleteInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DeleteInstancesWithContext(ctx volcengine.Context, input *DeleteInstancesInput, opts ...request.Option) (*DeleteInstancesOutput, error) { - req, out := c.DeleteInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteInstancesInput struct { - _ struct{} `type:"structure"` - - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s DeleteInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstancesInput) GoString() string { - return s.String() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DeleteInstancesInput) SetInstanceIds(v []*string) *DeleteInstancesInput { - s.InstanceIds = v - return s -} - -type DeleteInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForDeleteInstancesOutput `type:"list"` -} - -// String returns the string representation -func (s DeleteInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteInstancesOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *DeleteInstancesOutput) SetOperationDetails(v []*OperationDetailForDeleteInstancesOutput) *DeleteInstancesOutput { - s.OperationDetails = v - return s -} - -type ErrorForDeleteInstancesOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForDeleteInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForDeleteInstancesOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForDeleteInstancesOutput) SetCode(v string) *ErrorForDeleteInstancesOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForDeleteInstancesOutput) SetMessage(v string) *ErrorForDeleteInstancesOutput { - s.Message = &v - return s -} - -type OperationDetailForDeleteInstancesOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForDeleteInstancesOutput `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForDeleteInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForDeleteInstancesOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForDeleteInstancesOutput) SetError(v *ErrorForDeleteInstancesOutput) *OperationDetailForDeleteInstancesOutput { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *OperationDetailForDeleteInstancesOutput) SetInstanceId(v string) *OperationDetailForDeleteInstancesOutput { - s.InstanceId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_key_pairs.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_key_pairs.go deleted file mode 100644 index 473d915dfe03..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_key_pairs.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteKeyPairsCommon = "DeleteKeyPairs" - -// DeleteKeyPairsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteKeyPairsCommon operation. The "output" return -// value will be populated with the DeleteKeyPairsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteKeyPairsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteKeyPairsCommon Send returns without error. -// -// See DeleteKeyPairsCommon for more information on using the DeleteKeyPairsCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteKeyPairsCommonRequest method. -// req, resp := client.DeleteKeyPairsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteKeyPairsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteKeyPairsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteKeyPairsCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteKeyPairsCommon for usage and error information. -func (c *ECS) DeleteKeyPairsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteKeyPairsCommonRequest(input) - return out, req.Send() -} - -// DeleteKeyPairsCommonWithContext is the same as DeleteKeyPairsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteKeyPairsCommon 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 *ECS) DeleteKeyPairsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteKeyPairsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteKeyPairs = "DeleteKeyPairs" - -// DeleteKeyPairsRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteKeyPairs operation. The "output" return -// value will be populated with the DeleteKeyPairsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteKeyPairsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteKeyPairsCommon Send returns without error. -// -// See DeleteKeyPairs for more information on using the DeleteKeyPairs -// API call, and error handling. -// -// // Example sending a request using the DeleteKeyPairsRequest method. -// req, resp := client.DeleteKeyPairsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteKeyPairsRequest(input *DeleteKeyPairsInput) (req *request.Request, output *DeleteKeyPairsOutput) { - op := &request.Operation{ - Name: opDeleteKeyPairs, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteKeyPairsInput{} - } - - output = &DeleteKeyPairsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteKeyPairs API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteKeyPairs for usage and error information. -func (c *ECS) DeleteKeyPairs(input *DeleteKeyPairsInput) (*DeleteKeyPairsOutput, error) { - req, out := c.DeleteKeyPairsRequest(input) - return out, req.Send() -} - -// DeleteKeyPairsWithContext is the same as DeleteKeyPairs with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteKeyPairs for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DeleteKeyPairsWithContext(ctx volcengine.Context, input *DeleteKeyPairsInput, opts ...request.Option) (*DeleteKeyPairsOutput, error) { - req, out := c.DeleteKeyPairsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteKeyPairsInput struct { - _ struct{} `type:"structure"` - - KeyPairNames []*string `type:"list"` -} - -// String returns the string representation -func (s DeleteKeyPairsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteKeyPairsInput) GoString() string { - return s.String() -} - -// SetKeyPairNames sets the KeyPairNames field's value. -func (s *DeleteKeyPairsInput) SetKeyPairNames(v []*string) *DeleteKeyPairsInput { - s.KeyPairNames = v - return s -} - -type DeleteKeyPairsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForDeleteKeyPairsOutput `type:"list"` -} - -// String returns the string representation -func (s DeleteKeyPairsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteKeyPairsOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *DeleteKeyPairsOutput) SetOperationDetails(v []*OperationDetailForDeleteKeyPairsOutput) *DeleteKeyPairsOutput { - s.OperationDetails = v - return s -} - -type ErrorForDeleteKeyPairsOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForDeleteKeyPairsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForDeleteKeyPairsOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForDeleteKeyPairsOutput) SetCode(v string) *ErrorForDeleteKeyPairsOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForDeleteKeyPairsOutput) SetMessage(v string) *ErrorForDeleteKeyPairsOutput { - s.Message = &v - return s -} - -type OperationDetailForDeleteKeyPairsOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForDeleteKeyPairsOutput `type:"structure"` - - KeyPairName *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForDeleteKeyPairsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForDeleteKeyPairsOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForDeleteKeyPairsOutput) SetError(v *ErrorForDeleteKeyPairsOutput) *OperationDetailForDeleteKeyPairsOutput { - s.Error = v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *OperationDetailForDeleteKeyPairsOutput) SetKeyPairName(v string) *OperationDetailForDeleteKeyPairsOutput { - s.KeyPairName = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_tags.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_tags.go deleted file mode 100644 index 25b79d8babbd..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_delete_tags.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDeleteTagsCommon = "DeleteTags" - -// DeleteTagsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteTagsCommon operation. The "output" return -// value will be populated with the DeleteTagsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteTagsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteTagsCommon Send returns without error. -// -// See DeleteTagsCommon for more information on using the DeleteTagsCommon -// API call, and error handling. -// -// // Example sending a request using the DeleteTagsCommonRequest method. -// req, resp := client.DeleteTagsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteTagsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDeleteTagsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteTagsCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteTagsCommon for usage and error information. -func (c *ECS) DeleteTagsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DeleteTagsCommonRequest(input) - return out, req.Send() -} - -// DeleteTagsCommonWithContext is the same as DeleteTagsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTagsCommon 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 *ECS) DeleteTagsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DeleteTagsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTags = "DeleteTags" - -// DeleteTagsRequest generates a "volcengine/request.Request" representing the -// client's request for the DeleteTags operation. The "output" return -// value will be populated with the DeleteTagsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DeleteTagsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DeleteTagsCommon Send returns without error. -// -// See DeleteTags for more information on using the DeleteTags -// API call, and error handling. -// -// // Example sending a request using the DeleteTagsRequest method. -// req, resp := client.DeleteTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { - op := &request.Operation{ - Name: opDeleteTags, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTagsInput{} - } - - output = &DeleteTagsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DeleteTags API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DeleteTags for usage and error information. -func (c *ECS) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - return out, req.Send() -} - -// DeleteTagsWithContext is the same as DeleteTags with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DeleteTagsWithContext(ctx volcengine.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DeleteTagsInput struct { - _ struct{} `type:"structure"` - - ResourceIds []*string `type:"list"` - - ResourceType *string `type:"string"` - - TagKeys []*string `type:"list"` -} - -// String returns the string representation -func (s DeleteTagsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTagsInput) GoString() string { - return s.String() -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *DeleteTagsInput) SetResourceIds(v []*string) *DeleteTagsInput { - s.ResourceIds = v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *DeleteTagsInput) SetResourceType(v string) *DeleteTagsInput { - s.ResourceType = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { - s.TagKeys = v - return s -} - -type DeleteTagsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForDeleteTagsOutput `type:"list"` -} - -// String returns the string representation -func (s DeleteTagsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteTagsOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *DeleteTagsOutput) SetOperationDetails(v []*OperationDetailForDeleteTagsOutput) *DeleteTagsOutput { - s.OperationDetails = v - return s -} - -type ErrorForDeleteTagsOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForDeleteTagsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForDeleteTagsOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForDeleteTagsOutput) SetCode(v string) *ErrorForDeleteTagsOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForDeleteTagsOutput) SetMessage(v string) *ErrorForDeleteTagsOutput { - s.Message = &v - return s -} - -type OperationDetailForDeleteTagsOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForDeleteTagsOutput `type:"structure"` - - ResourceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForDeleteTagsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForDeleteTagsOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForDeleteTagsOutput) SetError(v *ErrorForDeleteTagsOutput) *OperationDetailForDeleteTagsOutput { - s.Error = v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *OperationDetailForDeleteTagsOutput) SetResourceId(v string) *OperationDetailForDeleteTagsOutput { - s.ResourceId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_available_resource.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_available_resource.go deleted file mode 100644 index 2fbcb4925315..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_available_resource.go +++ /dev/null @@ -1,332 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeAvailableResourceCommon = "DescribeAvailableResource" - -// DescribeAvailableResourceCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeAvailableResourceCommon operation. The "output" return -// value will be populated with the DescribeAvailableResourceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeAvailableResourceCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeAvailableResourceCommon Send returns without error. -// -// See DescribeAvailableResourceCommon for more information on using the DescribeAvailableResourceCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeAvailableResourceCommonRequest method. -// req, resp := client.DescribeAvailableResourceCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeAvailableResourceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeAvailableResourceCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeAvailableResourceCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeAvailableResourceCommon for usage and error information. -func (c *ECS) DescribeAvailableResourceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeAvailableResourceCommonRequest(input) - return out, req.Send() -} - -// DescribeAvailableResourceCommonWithContext is the same as DescribeAvailableResourceCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAvailableResourceCommon 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 *ECS) DescribeAvailableResourceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeAvailableResourceCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAvailableResource = "DescribeAvailableResource" - -// DescribeAvailableResourceRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeAvailableResource operation. The "output" return -// value will be populated with the DescribeAvailableResourceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeAvailableResourceCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeAvailableResourceCommon Send returns without error. -// -// See DescribeAvailableResource for more information on using the DescribeAvailableResource -// API call, and error handling. -// -// // Example sending a request using the DescribeAvailableResourceRequest method. -// req, resp := client.DescribeAvailableResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeAvailableResourceRequest(input *DescribeAvailableResourceInput) (req *request.Request, output *DescribeAvailableResourceOutput) { - op := &request.Operation{ - Name: opDescribeAvailableResource, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAvailableResourceInput{} - } - - output = &DescribeAvailableResourceOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeAvailableResource API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeAvailableResource for usage and error information. -func (c *ECS) DescribeAvailableResource(input *DescribeAvailableResourceInput) (*DescribeAvailableResourceOutput, error) { - req, out := c.DescribeAvailableResourceRequest(input) - return out, req.Send() -} - -// DescribeAvailableResourceWithContext is the same as DescribeAvailableResource with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAvailableResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeAvailableResourceWithContext(ctx volcengine.Context, input *DescribeAvailableResourceInput, opts ...request.Option) (*DescribeAvailableResourceOutput, error) { - req, out := c.DescribeAvailableResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AvailableResourceForDescribeAvailableResourceOutput struct { - _ struct{} `type:"structure"` - - SupportedResources []*SupportedResourceForDescribeAvailableResourceOutput `type:"list"` - - Type *string `type:"string"` -} - -// String returns the string representation -func (s AvailableResourceForDescribeAvailableResourceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailableResourceForDescribeAvailableResourceOutput) GoString() string { - return s.String() -} - -// SetSupportedResources sets the SupportedResources field's value. -func (s *AvailableResourceForDescribeAvailableResourceOutput) SetSupportedResources(v []*SupportedResourceForDescribeAvailableResourceOutput) *AvailableResourceForDescribeAvailableResourceOutput { - s.SupportedResources = v - return s -} - -// SetType sets the Type field's value. -func (s *AvailableResourceForDescribeAvailableResourceOutput) SetType(v string) *AvailableResourceForDescribeAvailableResourceOutput { - s.Type = &v - return s -} - -type AvailableZoneForDescribeAvailableResourceOutput struct { - _ struct{} `type:"structure"` - - AvailableResources []*AvailableResourceForDescribeAvailableResourceOutput `type:"list"` - - RegionId *string `type:"string"` - - Status *string `type:"string"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s AvailableZoneForDescribeAvailableResourceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AvailableZoneForDescribeAvailableResourceOutput) GoString() string { - return s.String() -} - -// SetAvailableResources sets the AvailableResources field's value. -func (s *AvailableZoneForDescribeAvailableResourceOutput) SetAvailableResources(v []*AvailableResourceForDescribeAvailableResourceOutput) *AvailableZoneForDescribeAvailableResourceOutput { - s.AvailableResources = v - return s -} - -// SetRegionId sets the RegionId field's value. -func (s *AvailableZoneForDescribeAvailableResourceOutput) SetRegionId(v string) *AvailableZoneForDescribeAvailableResourceOutput { - s.RegionId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *AvailableZoneForDescribeAvailableResourceOutput) SetStatus(v string) *AvailableZoneForDescribeAvailableResourceOutput { - s.Status = &v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *AvailableZoneForDescribeAvailableResourceOutput) SetZoneId(v string) *AvailableZoneForDescribeAvailableResourceOutput { - s.ZoneId = &v - return s -} - -type DescribeAvailableResourceInput struct { - _ struct{} `type:"structure"` - - DestinationResource *string `type:"string"` - - InstanceChargeType *string `type:"string"` - - InstanceType *string `type:"string"` - - InstanceTypeId *string `type:"string"` - - SpotStrategy *string `type:"string"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeAvailableResourceInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAvailableResourceInput) GoString() string { - return s.String() -} - -// SetDestinationResource sets the DestinationResource field's value. -func (s *DescribeAvailableResourceInput) SetDestinationResource(v string) *DescribeAvailableResourceInput { - s.DestinationResource = &v - return s -} - -// SetInstanceChargeType sets the InstanceChargeType field's value. -func (s *DescribeAvailableResourceInput) SetInstanceChargeType(v string) *DescribeAvailableResourceInput { - s.InstanceChargeType = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeAvailableResourceInput) SetInstanceType(v string) *DescribeAvailableResourceInput { - s.InstanceType = &v - return s -} - -// SetInstanceTypeId sets the InstanceTypeId field's value. -func (s *DescribeAvailableResourceInput) SetInstanceTypeId(v string) *DescribeAvailableResourceInput { - s.InstanceTypeId = &v - return s -} - -// SetSpotStrategy sets the SpotStrategy field's value. -func (s *DescribeAvailableResourceInput) SetSpotStrategy(v string) *DescribeAvailableResourceInput { - s.SpotStrategy = &v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *DescribeAvailableResourceInput) SetZoneId(v string) *DescribeAvailableResourceInput { - s.ZoneId = &v - return s -} - -type DescribeAvailableResourceOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - AvailableZones []*AvailableZoneForDescribeAvailableResourceOutput `type:"list"` -} - -// String returns the string representation -func (s DescribeAvailableResourceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeAvailableResourceOutput) GoString() string { - return s.String() -} - -// SetAvailableZones sets the AvailableZones field's value. -func (s *DescribeAvailableResourceOutput) SetAvailableZones(v []*AvailableZoneForDescribeAvailableResourceOutput) *DescribeAvailableResourceOutput { - s.AvailableZones = v - return s -} - -type SupportedResourceForDescribeAvailableResourceOutput struct { - _ struct{} `type:"structure"` - - Status *string `type:"string"` - - Value *string `type:"string"` -} - -// String returns the string representation -func (s SupportedResourceForDescribeAvailableResourceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s SupportedResourceForDescribeAvailableResourceOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *SupportedResourceForDescribeAvailableResourceOutput) SetStatus(v string) *SupportedResourceForDescribeAvailableResourceOutput { - s.Status = &v - return s -} - -// SetValue sets the Value field's value. -func (s *SupportedResourceForDescribeAvailableResourceOutput) SetValue(v string) *SupportedResourceForDescribeAvailableResourceOutput { - s.Value = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_deployment_set_supported_instance_type_family.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_deployment_set_supported_instance_type_family.go deleted file mode 100644 index 86a6f49033a1..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_deployment_set_supported_instance_type_family.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeDeploymentSetSupportedInstanceTypeFamilyCommon = "DescribeDeploymentSetSupportedInstanceTypeFamily" - -// DescribeDeploymentSetSupportedInstanceTypeFamilyCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeDeploymentSetSupportedInstanceTypeFamilyCommon operation. The "output" return -// value will be populated with the DescribeDeploymentSetSupportedInstanceTypeFamilyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeDeploymentSetSupportedInstanceTypeFamilyCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeDeploymentSetSupportedInstanceTypeFamilyCommon Send returns without error. -// -// See DescribeDeploymentSetSupportedInstanceTypeFamilyCommon for more information on using the DescribeDeploymentSetSupportedInstanceTypeFamilyCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeDeploymentSetSupportedInstanceTypeFamilyCommonRequest method. -// req, resp := client.DescribeDeploymentSetSupportedInstanceTypeFamilyCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeDeploymentSetSupportedInstanceTypeFamilyCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeDeploymentSetSupportedInstanceTypeFamilyCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeDeploymentSetSupportedInstanceTypeFamilyCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeDeploymentSetSupportedInstanceTypeFamilyCommon for usage and error information. -func (c *ECS) DescribeDeploymentSetSupportedInstanceTypeFamilyCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeDeploymentSetSupportedInstanceTypeFamilyCommonRequest(input) - return out, req.Send() -} - -// DescribeDeploymentSetSupportedInstanceTypeFamilyCommonWithContext is the same as DescribeDeploymentSetSupportedInstanceTypeFamilyCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeDeploymentSetSupportedInstanceTypeFamilyCommon 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 *ECS) DescribeDeploymentSetSupportedInstanceTypeFamilyCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeDeploymentSetSupportedInstanceTypeFamilyCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeDeploymentSetSupportedInstanceTypeFamily = "DescribeDeploymentSetSupportedInstanceTypeFamily" - -// DescribeDeploymentSetSupportedInstanceTypeFamilyRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeDeploymentSetSupportedInstanceTypeFamily operation. The "output" return -// value will be populated with the DescribeDeploymentSetSupportedInstanceTypeFamilyCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeDeploymentSetSupportedInstanceTypeFamilyCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeDeploymentSetSupportedInstanceTypeFamilyCommon Send returns without error. -// -// See DescribeDeploymentSetSupportedInstanceTypeFamily for more information on using the DescribeDeploymentSetSupportedInstanceTypeFamily -// API call, and error handling. -// -// // Example sending a request using the DescribeDeploymentSetSupportedInstanceTypeFamilyRequest method. -// req, resp := client.DescribeDeploymentSetSupportedInstanceTypeFamilyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeDeploymentSetSupportedInstanceTypeFamilyRequest(input *DescribeDeploymentSetSupportedInstanceTypeFamilyInput) (req *request.Request, output *DescribeDeploymentSetSupportedInstanceTypeFamilyOutput) { - op := &request.Operation{ - Name: opDescribeDeploymentSetSupportedInstanceTypeFamily, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDeploymentSetSupportedInstanceTypeFamilyInput{} - } - - output = &DescribeDeploymentSetSupportedInstanceTypeFamilyOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeDeploymentSetSupportedInstanceTypeFamily API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeDeploymentSetSupportedInstanceTypeFamily for usage and error information. -func (c *ECS) DescribeDeploymentSetSupportedInstanceTypeFamily(input *DescribeDeploymentSetSupportedInstanceTypeFamilyInput) (*DescribeDeploymentSetSupportedInstanceTypeFamilyOutput, error) { - req, out := c.DescribeDeploymentSetSupportedInstanceTypeFamilyRequest(input) - return out, req.Send() -} - -// DescribeDeploymentSetSupportedInstanceTypeFamilyWithContext is the same as DescribeDeploymentSetSupportedInstanceTypeFamily with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeDeploymentSetSupportedInstanceTypeFamily for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeDeploymentSetSupportedInstanceTypeFamilyWithContext(ctx volcengine.Context, input *DescribeDeploymentSetSupportedInstanceTypeFamilyInput, opts ...request.Option) (*DescribeDeploymentSetSupportedInstanceTypeFamilyOutput, error) { - req, out := c.DescribeDeploymentSetSupportedInstanceTypeFamilyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeDeploymentSetSupportedInstanceTypeFamilyInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeDeploymentSetSupportedInstanceTypeFamilyInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeploymentSetSupportedInstanceTypeFamilyInput) GoString() string { - return s.String() -} - -type DescribeDeploymentSetSupportedInstanceTypeFamilyOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - DeploymentSetCreateInstanceTypeFamilies []*string `type:"list"` - - DeploymentSetModifyInstanceTypeFamilies []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeDeploymentSetSupportedInstanceTypeFamilyOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeploymentSetSupportedInstanceTypeFamilyOutput) GoString() string { - return s.String() -} - -// SetDeploymentSetCreateInstanceTypeFamilies sets the DeploymentSetCreateInstanceTypeFamilies field's value. -func (s *DescribeDeploymentSetSupportedInstanceTypeFamilyOutput) SetDeploymentSetCreateInstanceTypeFamilies(v []*string) *DescribeDeploymentSetSupportedInstanceTypeFamilyOutput { - s.DeploymentSetCreateInstanceTypeFamilies = v - return s -} - -// SetDeploymentSetModifyInstanceTypeFamilies sets the DeploymentSetModifyInstanceTypeFamilies field's value. -func (s *DescribeDeploymentSetSupportedInstanceTypeFamilyOutput) SetDeploymentSetModifyInstanceTypeFamilies(v []*string) *DescribeDeploymentSetSupportedInstanceTypeFamilyOutput { - s.DeploymentSetModifyInstanceTypeFamilies = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_deployment_sets.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_deployment_sets.go deleted file mode 100644 index e671fd167432..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_deployment_sets.go +++ /dev/null @@ -1,358 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeDeploymentSetsCommon = "DescribeDeploymentSets" - -// DescribeDeploymentSetsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeDeploymentSetsCommon operation. The "output" return -// value will be populated with the DescribeDeploymentSetsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeDeploymentSetsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeDeploymentSetsCommon Send returns without error. -// -// See DescribeDeploymentSetsCommon for more information on using the DescribeDeploymentSetsCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeDeploymentSetsCommonRequest method. -// req, resp := client.DescribeDeploymentSetsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeDeploymentSetsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeDeploymentSetsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeDeploymentSetsCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeDeploymentSetsCommon for usage and error information. -func (c *ECS) DescribeDeploymentSetsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeDeploymentSetsCommonRequest(input) - return out, req.Send() -} - -// DescribeDeploymentSetsCommonWithContext is the same as DescribeDeploymentSetsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeDeploymentSetsCommon 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 *ECS) DescribeDeploymentSetsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeDeploymentSetsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeDeploymentSets = "DescribeDeploymentSets" - -// DescribeDeploymentSetsRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeDeploymentSets operation. The "output" return -// value will be populated with the DescribeDeploymentSetsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeDeploymentSetsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeDeploymentSetsCommon Send returns without error. -// -// See DescribeDeploymentSets for more information on using the DescribeDeploymentSets -// API call, and error handling. -// -// // Example sending a request using the DescribeDeploymentSetsRequest method. -// req, resp := client.DescribeDeploymentSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeDeploymentSetsRequest(input *DescribeDeploymentSetsInput) (req *request.Request, output *DescribeDeploymentSetsOutput) { - op := &request.Operation{ - Name: opDescribeDeploymentSets, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeDeploymentSetsInput{} - } - - output = &DescribeDeploymentSetsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeDeploymentSets API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeDeploymentSets for usage and error information. -func (c *ECS) DescribeDeploymentSets(input *DescribeDeploymentSetsInput) (*DescribeDeploymentSetsOutput, error) { - req, out := c.DescribeDeploymentSetsRequest(input) - return out, req.Send() -} - -// DescribeDeploymentSetsWithContext is the same as DescribeDeploymentSets with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeDeploymentSets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeDeploymentSetsWithContext(ctx volcengine.Context, input *DescribeDeploymentSetsInput, opts ...request.Option) (*DescribeDeploymentSetsOutput, error) { - req, out := c.DescribeDeploymentSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CapacityForDescribeDeploymentSetsOutput struct { - _ struct{} `type:"structure"` - - AvailableCount *int32 `type:"int32"` - - UsedCount *int32 `type:"int32"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s CapacityForDescribeDeploymentSetsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CapacityForDescribeDeploymentSetsOutput) GoString() string { - return s.String() -} - -// SetAvailableCount sets the AvailableCount field's value. -func (s *CapacityForDescribeDeploymentSetsOutput) SetAvailableCount(v int32) *CapacityForDescribeDeploymentSetsOutput { - s.AvailableCount = &v - return s -} - -// SetUsedCount sets the UsedCount field's value. -func (s *CapacityForDescribeDeploymentSetsOutput) SetUsedCount(v int32) *CapacityForDescribeDeploymentSetsOutput { - s.UsedCount = &v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *CapacityForDescribeDeploymentSetsOutput) SetZoneId(v string) *CapacityForDescribeDeploymentSetsOutput { - s.ZoneId = &v - return s -} - -type DeploymentSetForDescribeDeploymentSetsOutput struct { - _ struct{} `type:"structure"` - - Capacities []*CapacityForDescribeDeploymentSetsOutput `type:"list"` - - CreatedAt *string `type:"string"` - - DeploymentSetDescription *string `type:"string"` - - DeploymentSetId *string `type:"string"` - - DeploymentSetName *string `type:"string"` - - Granularity *string `type:"string"` - - InstanceAmount *int32 `type:"int32"` - - InstanceIds []*string `type:"list"` - - Strategy *string `type:"string"` -} - -// String returns the string representation -func (s DeploymentSetForDescribeDeploymentSetsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeploymentSetForDescribeDeploymentSetsOutput) GoString() string { - return s.String() -} - -// SetCapacities sets the Capacities field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetCapacities(v []*CapacityForDescribeDeploymentSetsOutput) *DeploymentSetForDescribeDeploymentSetsOutput { - s.Capacities = v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetCreatedAt(v string) *DeploymentSetForDescribeDeploymentSetsOutput { - s.CreatedAt = &v - return s -} - -// SetDeploymentSetDescription sets the DeploymentSetDescription field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetDeploymentSetDescription(v string) *DeploymentSetForDescribeDeploymentSetsOutput { - s.DeploymentSetDescription = &v - return s -} - -// SetDeploymentSetId sets the DeploymentSetId field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetDeploymentSetId(v string) *DeploymentSetForDescribeDeploymentSetsOutput { - s.DeploymentSetId = &v - return s -} - -// SetDeploymentSetName sets the DeploymentSetName field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetDeploymentSetName(v string) *DeploymentSetForDescribeDeploymentSetsOutput { - s.DeploymentSetName = &v - return s -} - -// SetGranularity sets the Granularity field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetGranularity(v string) *DeploymentSetForDescribeDeploymentSetsOutput { - s.Granularity = &v - return s -} - -// SetInstanceAmount sets the InstanceAmount field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetInstanceAmount(v int32) *DeploymentSetForDescribeDeploymentSetsOutput { - s.InstanceAmount = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetInstanceIds(v []*string) *DeploymentSetForDescribeDeploymentSetsOutput { - s.InstanceIds = v - return s -} - -// SetStrategy sets the Strategy field's value. -func (s *DeploymentSetForDescribeDeploymentSetsOutput) SetStrategy(v string) *DeploymentSetForDescribeDeploymentSetsOutput { - s.Strategy = &v - return s -} - -type DescribeDeploymentSetsInput struct { - _ struct{} `type:"structure"` - - DeploymentSetIds []*string `type:"list"` - - DeploymentSetName *string `type:"string"` - - Granularity *string `type:"string"` - - MaxResults *int32 `type:"int32"` - - NextToken *string `type:"string"` - - Strategy *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDeploymentSetsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeploymentSetsInput) GoString() string { - return s.String() -} - -// SetDeploymentSetIds sets the DeploymentSetIds field's value. -func (s *DescribeDeploymentSetsInput) SetDeploymentSetIds(v []*string) *DescribeDeploymentSetsInput { - s.DeploymentSetIds = v - return s -} - -// SetDeploymentSetName sets the DeploymentSetName field's value. -func (s *DescribeDeploymentSetsInput) SetDeploymentSetName(v string) *DescribeDeploymentSetsInput { - s.DeploymentSetName = &v - return s -} - -// SetGranularity sets the Granularity field's value. -func (s *DescribeDeploymentSetsInput) SetGranularity(v string) *DescribeDeploymentSetsInput { - s.Granularity = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeDeploymentSetsInput) SetMaxResults(v int32) *DescribeDeploymentSetsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDeploymentSetsInput) SetNextToken(v string) *DescribeDeploymentSetsInput { - s.NextToken = &v - return s -} - -// SetStrategy sets the Strategy field's value. -func (s *DescribeDeploymentSetsInput) SetStrategy(v string) *DescribeDeploymentSetsInput { - s.Strategy = &v - return s -} - -type DescribeDeploymentSetsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - DeploymentSets []*DeploymentSetForDescribeDeploymentSetsOutput `type:"list"` - - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeDeploymentSetsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeDeploymentSetsOutput) GoString() string { - return s.String() -} - -// SetDeploymentSets sets the DeploymentSets field's value. -func (s *DescribeDeploymentSetsOutput) SetDeploymentSets(v []*DeploymentSetForDescribeDeploymentSetsOutput) *DescribeDeploymentSetsOutput { - s.DeploymentSets = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDeploymentSetsOutput) SetNextToken(v string) *DescribeDeploymentSetsOutput { - s.NextToken = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_image_share_permission.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_image_share_permission.go deleted file mode 100644 index 5f51ecd6329e..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_image_share_permission.go +++ /dev/null @@ -1,248 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeImageSharePermissionCommon = "DescribeImageSharePermission" - -// DescribeImageSharePermissionCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeImageSharePermissionCommon operation. The "output" return -// value will be populated with the DescribeImageSharePermissionCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeImageSharePermissionCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeImageSharePermissionCommon Send returns without error. -// -// See DescribeImageSharePermissionCommon for more information on using the DescribeImageSharePermissionCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeImageSharePermissionCommonRequest method. -// req, resp := client.DescribeImageSharePermissionCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeImageSharePermissionCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeImageSharePermissionCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeImageSharePermissionCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeImageSharePermissionCommon for usage and error information. -func (c *ECS) DescribeImageSharePermissionCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeImageSharePermissionCommonRequest(input) - return out, req.Send() -} - -// DescribeImageSharePermissionCommonWithContext is the same as DescribeImageSharePermissionCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImageSharePermissionCommon 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 *ECS) DescribeImageSharePermissionCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeImageSharePermissionCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImageSharePermission = "DescribeImageSharePermission" - -// DescribeImageSharePermissionRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeImageSharePermission operation. The "output" return -// value will be populated with the DescribeImageSharePermissionCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeImageSharePermissionCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeImageSharePermissionCommon Send returns without error. -// -// See DescribeImageSharePermission for more information on using the DescribeImageSharePermission -// API call, and error handling. -// -// // Example sending a request using the DescribeImageSharePermissionRequest method. -// req, resp := client.DescribeImageSharePermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeImageSharePermissionRequest(input *DescribeImageSharePermissionInput) (req *request.Request, output *DescribeImageSharePermissionOutput) { - op := &request.Operation{ - Name: opDescribeImageSharePermission, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImageSharePermissionInput{} - } - - output = &DescribeImageSharePermissionOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeImageSharePermission API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeImageSharePermission for usage and error information. -func (c *ECS) DescribeImageSharePermission(input *DescribeImageSharePermissionInput) (*DescribeImageSharePermissionOutput, error) { - req, out := c.DescribeImageSharePermissionRequest(input) - return out, req.Send() -} - -// DescribeImageSharePermissionWithContext is the same as DescribeImageSharePermission with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImageSharePermission for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeImageSharePermissionWithContext(ctx volcengine.Context, input *DescribeImageSharePermissionInput, opts ...request.Option) (*DescribeImageSharePermissionOutput, error) { - req, out := c.DescribeImageSharePermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type AccountForDescribeImageSharePermissionOutput struct { - _ struct{} `type:"structure"` - - AccountId *string `type:"string"` -} - -// String returns the string representation -func (s AccountForDescribeImageSharePermissionOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s AccountForDescribeImageSharePermissionOutput) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *AccountForDescribeImageSharePermissionOutput) SetAccountId(v string) *AccountForDescribeImageSharePermissionOutput { - s.AccountId = &v - return s -} - -type DescribeImageSharePermissionInput struct { - _ struct{} `type:"structure"` - - ImageId *string `type:"string"` - - MaxResults *int32 `type:"int32"` - - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeImageSharePermissionInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImageSharePermissionInput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *DescribeImageSharePermissionInput) SetImageId(v string) *DescribeImageSharePermissionInput { - s.ImageId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeImageSharePermissionInput) SetMaxResults(v int32) *DescribeImageSharePermissionInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImageSharePermissionInput) SetNextToken(v string) *DescribeImageSharePermissionInput { - s.NextToken = &v - return s -} - -type DescribeImageSharePermissionOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - Accounts []*AccountForDescribeImageSharePermissionOutput `type:"list"` - - ImageId *string `type:"string"` - - NextToken *string `type:"string"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeImageSharePermissionOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImageSharePermissionOutput) GoString() string { - return s.String() -} - -// SetAccounts sets the Accounts field's value. -func (s *DescribeImageSharePermissionOutput) SetAccounts(v []*AccountForDescribeImageSharePermissionOutput) *DescribeImageSharePermissionOutput { - s.Accounts = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *DescribeImageSharePermissionOutput) SetImageId(v string) *DescribeImageSharePermissionOutput { - s.ImageId = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImageSharePermissionOutput) SetNextToken(v string) *DescribeImageSharePermissionOutput { - s.NextToken = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeImageSharePermissionOutput) SetTotalCount(v int32) *DescribeImageSharePermissionOutput { - s.TotalCount = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_images.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_images.go deleted file mode 100644 index ccc1e5ff42ce..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_images.go +++ /dev/null @@ -1,434 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "encoding/json" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeImagesCommon = "DescribeImages" - -// DescribeImagesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeImagesCommon operation. The "output" return -// value will be populated with the DescribeImagesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeImagesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeImagesCommon Send returns without error. -// -// See DescribeImagesCommon for more information on using the DescribeImagesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeImagesCommonRequest method. -// req, resp := client.DescribeImagesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeImagesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeImagesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeImagesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeImagesCommon for usage and error information. -func (c *ECS) DescribeImagesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeImagesCommonRequest(input) - return out, req.Send() -} - -// DescribeImagesCommonWithContext is the same as DescribeImagesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImagesCommon 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 *ECS) DescribeImagesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeImagesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeImages = "DescribeImages" - -// DescribeImagesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeImages operation. The "output" return -// value will be populated with the DescribeImagesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeImagesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeImagesCommon Send returns without error. -// -// See DescribeImages for more information on using the DescribeImages -// API call, and error handling. -// -// // Example sending a request using the DescribeImagesRequest method. -// req, resp := client.DescribeImagesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Request, output *DescribeImagesOutput) { - op := &request.Operation{ - Name: opDescribeImages, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeImagesInput{} - } - - output = &DescribeImagesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeImages API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeImages for usage and error information. -func (c *ECS) DescribeImages(input *DescribeImagesInput) (*DescribeImagesOutput, error) { - req, out := c.DescribeImagesRequest(input) - return out, req.Send() -} - -// DescribeImagesWithContext is the same as DescribeImages with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeImages for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeImagesWithContext(ctx volcengine.Context, input *DescribeImagesInput, opts ...request.Option) (*DescribeImagesOutput, error) { - req, out := c.DescribeImagesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeImagesInput struct { - _ struct{} `type:"structure"` - - ImageIds []*string `type:"list"` - - ImageStatus *string `type:"string"` - - InstanceTypeId *string `type:"string"` - - IsSupportCloudInit *bool `type:"boolean"` - - MaxResults *int32 `type:"int32"` - - NextToken *string `type:"string"` - - OsType *string `type:"string"` - - ProjectName *string `type:"string"` - - Status []*string `type:"list"` - - Visibility *string `type:"string"` -} - -// String returns the string representation -func (s DescribeImagesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImagesInput) GoString() string { - return s.String() -} - -// SetImageIds sets the ImageIds field's value. -func (s *DescribeImagesInput) SetImageIds(v []*string) *DescribeImagesInput { - s.ImageIds = v - return s -} - -// SetImageStatus sets the ImageStatus field's value. -func (s *DescribeImagesInput) SetImageStatus(v string) *DescribeImagesInput { - s.ImageStatus = &v - return s -} - -// SetInstanceTypeId sets the InstanceTypeId field's value. -func (s *DescribeImagesInput) SetInstanceTypeId(v string) *DescribeImagesInput { - s.InstanceTypeId = &v - return s -} - -// SetIsSupportCloudInit sets the IsSupportCloudInit field's value. -func (s *DescribeImagesInput) SetIsSupportCloudInit(v bool) *DescribeImagesInput { - s.IsSupportCloudInit = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeImagesInput) SetMaxResults(v int32) *DescribeImagesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImagesInput) SetNextToken(v string) *DescribeImagesInput { - s.NextToken = &v - return s -} - -// SetOsType sets the OsType field's value. -func (s *DescribeImagesInput) SetOsType(v string) *DescribeImagesInput { - s.OsType = &v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *DescribeImagesInput) SetProjectName(v string) *DescribeImagesInput { - s.ProjectName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeImagesInput) SetStatus(v []*string) *DescribeImagesInput { - s.Status = v - return s -} - -// SetVisibility sets the Visibility field's value. -func (s *DescribeImagesInput) SetVisibility(v string) *DescribeImagesInput { - s.Visibility = &v - return s -} - -type DescribeImagesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - Images []*ImageForDescribeImagesOutput `type:"list"` - - NextToken *string `type:"string"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeImagesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeImagesOutput) GoString() string { - return s.String() -} - -// SetImages sets the Images field's value. -func (s *DescribeImagesOutput) SetImages(v []*ImageForDescribeImagesOutput) *DescribeImagesOutput { - s.Images = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeImagesOutput) SetNextToken(v string) *DescribeImagesOutput { - s.NextToken = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeImagesOutput) SetTotalCount(v int32) *DescribeImagesOutput { - s.TotalCount = &v - return s -} - -type ImageForDescribeImagesOutput struct { - _ struct{} `type:"structure"` - - Architecture *string `type:"string"` - - CreatedAt *string `type:"string"` - - Description *string `type:"string"` - - ImageId *string `type:"string"` - - ImageName *string `type:"string"` - - ImageOwnerId *string `type:"string"` - - IsSupportCloudInit *bool `type:"boolean"` - - OsName *string `type:"string"` - - OsType *string `type:"string"` - - Platform *string `type:"string"` - - PlatformVersion *string `type:"string"` - - ProjectName *string `type:"string"` - - ShareStatus *string `type:"string"` - - Size *int32 `type:"int32"` - - Status *string `type:"string"` - - UpdatedAt *string `type:"string"` - - VirtualSize *json.Number `type:"json_number"` - - Visibility *string `type:"string"` -} - -// String returns the string representation -func (s ImageForDescribeImagesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImageForDescribeImagesOutput) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImageForDescribeImagesOutput) SetArchitecture(v string) *ImageForDescribeImagesOutput { - s.Architecture = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *ImageForDescribeImagesOutput) SetCreatedAt(v string) *ImageForDescribeImagesOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImageForDescribeImagesOutput) SetDescription(v string) *ImageForDescribeImagesOutput { - s.Description = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ImageForDescribeImagesOutput) SetImageId(v string) *ImageForDescribeImagesOutput { - s.ImageId = &v - return s -} - -// SetImageName sets the ImageName field's value. -func (s *ImageForDescribeImagesOutput) SetImageName(v string) *ImageForDescribeImagesOutput { - s.ImageName = &v - return s -} - -// SetImageOwnerId sets the ImageOwnerId field's value. -func (s *ImageForDescribeImagesOutput) SetImageOwnerId(v string) *ImageForDescribeImagesOutput { - s.ImageOwnerId = &v - return s -} - -// SetIsSupportCloudInit sets the IsSupportCloudInit field's value. -func (s *ImageForDescribeImagesOutput) SetIsSupportCloudInit(v bool) *ImageForDescribeImagesOutput { - s.IsSupportCloudInit = &v - return s -} - -// SetOsName sets the OsName field's value. -func (s *ImageForDescribeImagesOutput) SetOsName(v string) *ImageForDescribeImagesOutput { - s.OsName = &v - return s -} - -// SetOsType sets the OsType field's value. -func (s *ImageForDescribeImagesOutput) SetOsType(v string) *ImageForDescribeImagesOutput { - s.OsType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImageForDescribeImagesOutput) SetPlatform(v string) *ImageForDescribeImagesOutput { - s.Platform = &v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *ImageForDescribeImagesOutput) SetPlatformVersion(v string) *ImageForDescribeImagesOutput { - s.PlatformVersion = &v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *ImageForDescribeImagesOutput) SetProjectName(v string) *ImageForDescribeImagesOutput { - s.ProjectName = &v - return s -} - -// SetShareStatus sets the ShareStatus field's value. -func (s *ImageForDescribeImagesOutput) SetShareStatus(v string) *ImageForDescribeImagesOutput { - s.ShareStatus = &v - return s -} - -// SetSize sets the Size field's value. -func (s *ImageForDescribeImagesOutput) SetSize(v int32) *ImageForDescribeImagesOutput { - s.Size = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImageForDescribeImagesOutput) SetStatus(v string) *ImageForDescribeImagesOutput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *ImageForDescribeImagesOutput) SetUpdatedAt(v string) *ImageForDescribeImagesOutput { - s.UpdatedAt = &v - return s -} - -// SetVirtualSize sets the VirtualSize field's value. -func (s *ImageForDescribeImagesOutput) SetVirtualSize(v json.Number) *ImageForDescribeImagesOutput { - s.VirtualSize = &v - return s -} - -// SetVisibility sets the Visibility field's value. -func (s *ImageForDescribeImagesOutput) SetVisibility(v string) *ImageForDescribeImagesOutput { - s.Visibility = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_ecs_terminal_url.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_ecs_terminal_url.go deleted file mode 100644 index 9f9eccdb5288..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_ecs_terminal_url.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeInstanceECSTerminalUrlCommon = "DescribeInstanceECSTerminalUrl" - -// DescribeInstanceECSTerminalUrlCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstanceECSTerminalUrlCommon operation. The "output" return -// value will be populated with the DescribeInstanceECSTerminalUrlCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstanceECSTerminalUrlCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstanceECSTerminalUrlCommon Send returns without error. -// -// See DescribeInstanceECSTerminalUrlCommon for more information on using the DescribeInstanceECSTerminalUrlCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeInstanceECSTerminalUrlCommonRequest method. -// req, resp := client.DescribeInstanceECSTerminalUrlCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstanceECSTerminalUrlCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeInstanceECSTerminalUrlCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstanceECSTerminalUrlCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstanceECSTerminalUrlCommon for usage and error information. -func (c *ECS) DescribeInstanceECSTerminalUrlCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeInstanceECSTerminalUrlCommonRequest(input) - return out, req.Send() -} - -// DescribeInstanceECSTerminalUrlCommonWithContext is the same as DescribeInstanceECSTerminalUrlCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceECSTerminalUrlCommon 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 *ECS) DescribeInstanceECSTerminalUrlCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeInstanceECSTerminalUrlCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceECSTerminalUrl = "DescribeInstanceECSTerminalUrl" - -// DescribeInstanceECSTerminalUrlRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstanceECSTerminalUrl operation. The "output" return -// value will be populated with the DescribeInstanceECSTerminalUrlCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstanceECSTerminalUrlCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstanceECSTerminalUrlCommon Send returns without error. -// -// See DescribeInstanceECSTerminalUrl for more information on using the DescribeInstanceECSTerminalUrl -// API call, and error handling. -// -// // Example sending a request using the DescribeInstanceECSTerminalUrlRequest method. -// req, resp := client.DescribeInstanceECSTerminalUrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstanceECSTerminalUrlRequest(input *DescribeInstanceECSTerminalUrlInput) (req *request.Request, output *DescribeInstanceECSTerminalUrlOutput) { - op := &request.Operation{ - Name: opDescribeInstanceECSTerminalUrl, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceECSTerminalUrlInput{} - } - - output = &DescribeInstanceECSTerminalUrlOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstanceECSTerminalUrl API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstanceECSTerminalUrl for usage and error information. -func (c *ECS) DescribeInstanceECSTerminalUrl(input *DescribeInstanceECSTerminalUrlInput) (*DescribeInstanceECSTerminalUrlOutput, error) { - req, out := c.DescribeInstanceECSTerminalUrlRequest(input) - return out, req.Send() -} - -// DescribeInstanceECSTerminalUrlWithContext is the same as DescribeInstanceECSTerminalUrl with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceECSTerminalUrl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeInstanceECSTerminalUrlWithContext(ctx volcengine.Context, input *DescribeInstanceECSTerminalUrlInput, opts ...request.Option) (*DescribeInstanceECSTerminalUrlOutput, error) { - req, out := c.DescribeInstanceECSTerminalUrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeInstanceECSTerminalUrlInput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceECSTerminalUrlInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceECSTerminalUrlInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceECSTerminalUrlInput) SetInstanceId(v string) *DescribeInstanceECSTerminalUrlInput { - s.InstanceId = &v - return s -} - -type DescribeInstanceECSTerminalUrlOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - EcsTerminalUrl *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceECSTerminalUrlOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceECSTerminalUrlOutput) GoString() string { - return s.String() -} - -// SetEcsTerminalUrl sets the EcsTerminalUrl field's value. -func (s *DescribeInstanceECSTerminalUrlOutput) SetEcsTerminalUrl(v string) *DescribeInstanceECSTerminalUrlOutput { - s.EcsTerminalUrl = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_type_families.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_type_families.go deleted file mode 100644 index 0b5c4db6c7d1..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_type_families.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeInstanceTypeFamiliesCommon = "DescribeInstanceTypeFamilies" - -// DescribeInstanceTypeFamiliesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstanceTypeFamiliesCommon operation. The "output" return -// value will be populated with the DescribeInstanceTypeFamiliesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstanceTypeFamiliesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstanceTypeFamiliesCommon Send returns without error. -// -// See DescribeInstanceTypeFamiliesCommon for more information on using the DescribeInstanceTypeFamiliesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeInstanceTypeFamiliesCommonRequest method. -// req, resp := client.DescribeInstanceTypeFamiliesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstanceTypeFamiliesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeInstanceTypeFamiliesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstanceTypeFamiliesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstanceTypeFamiliesCommon for usage and error information. -func (c *ECS) DescribeInstanceTypeFamiliesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeInstanceTypeFamiliesCommonRequest(input) - return out, req.Send() -} - -// DescribeInstanceTypeFamiliesCommonWithContext is the same as DescribeInstanceTypeFamiliesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceTypeFamiliesCommon 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 *ECS) DescribeInstanceTypeFamiliesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeInstanceTypeFamiliesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceTypeFamilies = "DescribeInstanceTypeFamilies" - -// DescribeInstanceTypeFamiliesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstanceTypeFamilies operation. The "output" return -// value will be populated with the DescribeInstanceTypeFamiliesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstanceTypeFamiliesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstanceTypeFamiliesCommon Send returns without error. -// -// See DescribeInstanceTypeFamilies for more information on using the DescribeInstanceTypeFamilies -// API call, and error handling. -// -// // Example sending a request using the DescribeInstanceTypeFamiliesRequest method. -// req, resp := client.DescribeInstanceTypeFamiliesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstanceTypeFamiliesRequest(input *DescribeInstanceTypeFamiliesInput) (req *request.Request, output *DescribeInstanceTypeFamiliesOutput) { - op := &request.Operation{ - Name: opDescribeInstanceTypeFamilies, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceTypeFamiliesInput{} - } - - output = &DescribeInstanceTypeFamiliesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstanceTypeFamilies API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstanceTypeFamilies for usage and error information. -func (c *ECS) DescribeInstanceTypeFamilies(input *DescribeInstanceTypeFamiliesInput) (*DescribeInstanceTypeFamiliesOutput, error) { - req, out := c.DescribeInstanceTypeFamiliesRequest(input) - return out, req.Send() -} - -// DescribeInstanceTypeFamiliesWithContext is the same as DescribeInstanceTypeFamilies with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceTypeFamilies for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeInstanceTypeFamiliesWithContext(ctx volcengine.Context, input *DescribeInstanceTypeFamiliesInput, opts ...request.Option) (*DescribeInstanceTypeFamiliesOutput, error) { - req, out := c.DescribeInstanceTypeFamiliesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeInstanceTypeFamiliesInput struct { - _ struct{} `type:"structure"` - - Generation *string `type:"string"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceTypeFamiliesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceTypeFamiliesInput) GoString() string { - return s.String() -} - -// SetGeneration sets the Generation field's value. -func (s *DescribeInstanceTypeFamiliesInput) SetGeneration(v string) *DescribeInstanceTypeFamiliesInput { - s.Generation = &v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *DescribeInstanceTypeFamiliesInput) SetZoneId(v string) *DescribeInstanceTypeFamiliesInput { - s.ZoneId = &v - return s -} - -type DescribeInstanceTypeFamiliesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - InstanceTypeFamilies []*InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput `type:"list"` -} - -// String returns the string representation -func (s DescribeInstanceTypeFamiliesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceTypeFamiliesOutput) GoString() string { - return s.String() -} - -// SetInstanceTypeFamilies sets the InstanceTypeFamilies field's value. -func (s *DescribeInstanceTypeFamiliesOutput) SetInstanceTypeFamilies(v []*InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput) *DescribeInstanceTypeFamiliesOutput { - s.InstanceTypeFamilies = v - return s -} - -type InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput struct { - _ struct{} `type:"structure"` - - Generation *string `type:"string"` - - InstanceTypeFamily *string `type:"string"` - - ZoneIds []*string `type:"list"` -} - -// String returns the string representation -func (s InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput) GoString() string { - return s.String() -} - -// SetGeneration sets the Generation field's value. -func (s *InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput) SetGeneration(v string) *InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput { - s.Generation = &v - return s -} - -// SetInstanceTypeFamily sets the InstanceTypeFamily field's value. -func (s *InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput) SetInstanceTypeFamily(v string) *InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput { - s.InstanceTypeFamily = &v - return s -} - -// SetZoneIds sets the ZoneIds field's value. -func (s *InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput) SetZoneIds(v []*string) *InstanceTypeFamilyForDescribeInstanceTypeFamiliesOutput { - s.ZoneIds = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_types.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_types.go deleted file mode 100644 index ab739df34f18..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_types.go +++ /dev/null @@ -1,608 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeInstanceTypesCommon = "DescribeInstanceTypes" - -// DescribeInstanceTypesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstanceTypesCommon operation. The "output" return -// value will be populated with the DescribeInstanceTypesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstanceTypesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstanceTypesCommon Send returns without error. -// -// See DescribeInstanceTypesCommon for more information on using the DescribeInstanceTypesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeInstanceTypesCommonRequest method. -// req, resp := client.DescribeInstanceTypesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstanceTypesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeInstanceTypesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstanceTypesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstanceTypesCommon for usage and error information. -func (c *ECS) DescribeInstanceTypesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeInstanceTypesCommonRequest(input) - return out, req.Send() -} - -// DescribeInstanceTypesCommonWithContext is the same as DescribeInstanceTypesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceTypesCommon 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 *ECS) DescribeInstanceTypesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeInstanceTypesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceTypes = "DescribeInstanceTypes" - -// DescribeInstanceTypesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstanceTypes operation. The "output" return -// value will be populated with the DescribeInstanceTypesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstanceTypesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstanceTypesCommon Send returns without error. -// -// See DescribeInstanceTypes for more information on using the DescribeInstanceTypes -// API call, and error handling. -// -// // Example sending a request using the DescribeInstanceTypesRequest method. -// req, resp := client.DescribeInstanceTypesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstanceTypesRequest(input *DescribeInstanceTypesInput) (req *request.Request, output *DescribeInstanceTypesOutput) { - op := &request.Operation{ - Name: opDescribeInstanceTypes, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceTypesInput{} - } - - output = &DescribeInstanceTypesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstanceTypes API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstanceTypes for usage and error information. -func (c *ECS) DescribeInstanceTypes(input *DescribeInstanceTypesInput) (*DescribeInstanceTypesOutput, error) { - req, out := c.DescribeInstanceTypesRequest(input) - return out, req.Send() -} - -// DescribeInstanceTypesWithContext is the same as DescribeInstanceTypes with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceTypes for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeInstanceTypesWithContext(ctx volcengine.Context, input *DescribeInstanceTypesInput, opts ...request.Option) (*DescribeInstanceTypesOutput, error) { - req, out := c.DescribeInstanceTypesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeInstanceTypesInput struct { - _ struct{} `type:"structure"` - - InstanceTypeIds []*string `type:"list"` - - InstanceTypes []*string `type:"list"` - - MaxResults *int32 `type:"int32"` - - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceTypesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceTypesInput) GoString() string { - return s.String() -} - -// SetInstanceTypeIds sets the InstanceTypeIds field's value. -func (s *DescribeInstanceTypesInput) SetInstanceTypeIds(v []*string) *DescribeInstanceTypesInput { - s.InstanceTypeIds = v - return s -} - -// SetInstanceTypes sets the InstanceTypes field's value. -func (s *DescribeInstanceTypesInput) SetInstanceTypes(v []*string) *DescribeInstanceTypesInput { - s.InstanceTypes = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstanceTypesInput) SetMaxResults(v int32) *DescribeInstanceTypesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceTypesInput) SetNextToken(v string) *DescribeInstanceTypesInput { - s.NextToken = &v - return s -} - -type DescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - InstanceTypes []*InstanceTypeForDescribeInstanceTypesOutput `type:"list"` - - NextToken *string `type:"string"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetInstanceTypes sets the InstanceTypes field's value. -func (s *DescribeInstanceTypesOutput) SetInstanceTypes(v []*InstanceTypeForDescribeInstanceTypesOutput) *DescribeInstanceTypesOutput { - s.InstanceTypes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceTypesOutput) SetNextToken(v string) *DescribeInstanceTypesOutput { - s.NextToken = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeInstanceTypesOutput) SetTotalCount(v int32) *DescribeInstanceTypesOutput { - s.TotalCount = &v - return s -} - -type GpuDeviceForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - Count *int32 `type:"int32"` - - Memory *MemoryForDescribeInstanceTypesOutput `type:"structure"` - - ProductName *string `type:"string"` -} - -// String returns the string representation -func (s GpuDeviceForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s GpuDeviceForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *GpuDeviceForDescribeInstanceTypesOutput) SetCount(v int32) *GpuDeviceForDescribeInstanceTypesOutput { - s.Count = &v - return s -} - -// SetMemory sets the Memory field's value. -func (s *GpuDeviceForDescribeInstanceTypesOutput) SetMemory(v *MemoryForDescribeInstanceTypesOutput) *GpuDeviceForDescribeInstanceTypesOutput { - s.Memory = v - return s -} - -// SetProductName sets the ProductName field's value. -func (s *GpuDeviceForDescribeInstanceTypesOutput) SetProductName(v string) *GpuDeviceForDescribeInstanceTypesOutput { - s.ProductName = &v - return s -} - -type GpuForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - GpuDevices []*GpuDeviceForDescribeInstanceTypesOutput `type:"list"` -} - -// String returns the string representation -func (s GpuForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s GpuForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetGpuDevices sets the GpuDevices field's value. -func (s *GpuForDescribeInstanceTypesOutput) SetGpuDevices(v []*GpuDeviceForDescribeInstanceTypesOutput) *GpuForDescribeInstanceTypesOutput { - s.GpuDevices = v - return s -} - -type InstanceTypeForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - BaselineCredit *int64 `type:"int64"` - - Gpu *GpuForDescribeInstanceTypesOutput `type:"structure"` - - InitialCredit *int64 `type:"int64"` - - InstanceTypeFamily *string `type:"string"` - - InstanceTypeId *string `type:"string"` - - LocalVolumes []*LocalVolumeForDescribeInstanceTypesOutput `type:"list"` - - Memory *MemoryForDescribeInstanceTypesOutput `type:"structure"` - - Network *NetworkForDescribeInstanceTypesOutput `type:"structure"` - - Processor *ProcessorForDescribeInstanceTypesOutput `type:"structure"` - - Rdma *RdmaForDescribeInstanceTypesOutput `type:"structure"` - - Volume *VolumeForDescribeInstanceTypesOutput `type:"structure"` -} - -// String returns the string representation -func (s InstanceTypeForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceTypeForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetBaselineCredit sets the BaselineCredit field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetBaselineCredit(v int64) *InstanceTypeForDescribeInstanceTypesOutput { - s.BaselineCredit = &v - return s -} - -// SetGpu sets the Gpu field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetGpu(v *GpuForDescribeInstanceTypesOutput) *InstanceTypeForDescribeInstanceTypesOutput { - s.Gpu = v - return s -} - -// SetInitialCredit sets the InitialCredit field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetInitialCredit(v int64) *InstanceTypeForDescribeInstanceTypesOutput { - s.InitialCredit = &v - return s -} - -// SetInstanceTypeFamily sets the InstanceTypeFamily field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetInstanceTypeFamily(v string) *InstanceTypeForDescribeInstanceTypesOutput { - s.InstanceTypeFamily = &v - return s -} - -// SetInstanceTypeId sets the InstanceTypeId field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetInstanceTypeId(v string) *InstanceTypeForDescribeInstanceTypesOutput { - s.InstanceTypeId = &v - return s -} - -// SetLocalVolumes sets the LocalVolumes field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetLocalVolumes(v []*LocalVolumeForDescribeInstanceTypesOutput) *InstanceTypeForDescribeInstanceTypesOutput { - s.LocalVolumes = v - return s -} - -// SetMemory sets the Memory field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetMemory(v *MemoryForDescribeInstanceTypesOutput) *InstanceTypeForDescribeInstanceTypesOutput { - s.Memory = v - return s -} - -// SetNetwork sets the Network field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetNetwork(v *NetworkForDescribeInstanceTypesOutput) *InstanceTypeForDescribeInstanceTypesOutput { - s.Network = v - return s -} - -// SetProcessor sets the Processor field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetProcessor(v *ProcessorForDescribeInstanceTypesOutput) *InstanceTypeForDescribeInstanceTypesOutput { - s.Processor = v - return s -} - -// SetRdma sets the Rdma field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetRdma(v *RdmaForDescribeInstanceTypesOutput) *InstanceTypeForDescribeInstanceTypesOutput { - s.Rdma = v - return s -} - -// SetVolume sets the Volume field's value. -func (s *InstanceTypeForDescribeInstanceTypesOutput) SetVolume(v *VolumeForDescribeInstanceTypesOutput) *InstanceTypeForDescribeInstanceTypesOutput { - s.Volume = v - return s -} - -type LocalVolumeForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - Count *int32 `type:"int32"` - - Size *int32 `type:"int32"` - - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s LocalVolumeForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s LocalVolumeForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *LocalVolumeForDescribeInstanceTypesOutput) SetCount(v int32) *LocalVolumeForDescribeInstanceTypesOutput { - s.Count = &v - return s -} - -// SetSize sets the Size field's value. -func (s *LocalVolumeForDescribeInstanceTypesOutput) SetSize(v int32) *LocalVolumeForDescribeInstanceTypesOutput { - s.Size = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *LocalVolumeForDescribeInstanceTypesOutput) SetVolumeType(v string) *LocalVolumeForDescribeInstanceTypesOutput { - s.VolumeType = &v - return s -} - -type MemoryForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - EncryptedSize *int32 `type:"int32"` - - Size *int32 `type:"int32"` -} - -// String returns the string representation -func (s MemoryForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s MemoryForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetEncryptedSize sets the EncryptedSize field's value. -func (s *MemoryForDescribeInstanceTypesOutput) SetEncryptedSize(v int32) *MemoryForDescribeInstanceTypesOutput { - s.EncryptedSize = &v - return s -} - -// SetSize sets the Size field's value. -func (s *MemoryForDescribeInstanceTypesOutput) SetSize(v int32) *MemoryForDescribeInstanceTypesOutput { - s.Size = &v - return s -} - -type NetworkForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - MaximumBandwidthMbps *int32 `type:"int32"` - - MaximumNetworkInterfaces *int32 `type:"int32"` - - MaximumPrivateIpv4AddressesPerNetworkInterface *int32 `type:"int32"` - - MaximumQueuesPerNetworkInterface *int32 `type:"int32"` - - MaximumThroughputKpps *int32 `type:"int32"` -} - -// String returns the string representation -func (s NetworkForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetMaximumBandwidthMbps sets the MaximumBandwidthMbps field's value. -func (s *NetworkForDescribeInstanceTypesOutput) SetMaximumBandwidthMbps(v int32) *NetworkForDescribeInstanceTypesOutput { - s.MaximumBandwidthMbps = &v - return s -} - -// SetMaximumNetworkInterfaces sets the MaximumNetworkInterfaces field's value. -func (s *NetworkForDescribeInstanceTypesOutput) SetMaximumNetworkInterfaces(v int32) *NetworkForDescribeInstanceTypesOutput { - s.MaximumNetworkInterfaces = &v - return s -} - -// SetMaximumPrivateIpv4AddressesPerNetworkInterface sets the MaximumPrivateIpv4AddressesPerNetworkInterface field's value. -func (s *NetworkForDescribeInstanceTypesOutput) SetMaximumPrivateIpv4AddressesPerNetworkInterface(v int32) *NetworkForDescribeInstanceTypesOutput { - s.MaximumPrivateIpv4AddressesPerNetworkInterface = &v - return s -} - -// SetMaximumQueuesPerNetworkInterface sets the MaximumQueuesPerNetworkInterface field's value. -func (s *NetworkForDescribeInstanceTypesOutput) SetMaximumQueuesPerNetworkInterface(v int32) *NetworkForDescribeInstanceTypesOutput { - s.MaximumQueuesPerNetworkInterface = &v - return s -} - -// SetMaximumThroughputKpps sets the MaximumThroughputKpps field's value. -func (s *NetworkForDescribeInstanceTypesOutput) SetMaximumThroughputKpps(v int32) *NetworkForDescribeInstanceTypesOutput { - s.MaximumThroughputKpps = &v - return s -} - -type ProcessorForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - BaseFrequency *float64 `type:"float"` - - Cpus *int32 `type:"int32"` - - Model *string `type:"string"` - - TurboFrequency *float64 `type:"float"` -} - -// String returns the string representation -func (s ProcessorForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ProcessorForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetBaseFrequency sets the BaseFrequency field's value. -func (s *ProcessorForDescribeInstanceTypesOutput) SetBaseFrequency(v float64) *ProcessorForDescribeInstanceTypesOutput { - s.BaseFrequency = &v - return s -} - -// SetCpus sets the Cpus field's value. -func (s *ProcessorForDescribeInstanceTypesOutput) SetCpus(v int32) *ProcessorForDescribeInstanceTypesOutput { - s.Cpus = &v - return s -} - -// SetModel sets the Model field's value. -func (s *ProcessorForDescribeInstanceTypesOutput) SetModel(v string) *ProcessorForDescribeInstanceTypesOutput { - s.Model = &v - return s -} - -// SetTurboFrequency sets the TurboFrequency field's value. -func (s *ProcessorForDescribeInstanceTypesOutput) SetTurboFrequency(v float64) *ProcessorForDescribeInstanceTypesOutput { - s.TurboFrequency = &v - return s -} - -type RdmaForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - RdmaNetworkInterfaces *int32 `type:"int32"` -} - -// String returns the string representation -func (s RdmaForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RdmaForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetRdmaNetworkInterfaces sets the RdmaNetworkInterfaces field's value. -func (s *RdmaForDescribeInstanceTypesOutput) SetRdmaNetworkInterfaces(v int32) *RdmaForDescribeInstanceTypesOutput { - s.RdmaNetworkInterfaces = &v - return s -} - -type VolumeForDescribeInstanceTypesOutput struct { - _ struct{} `type:"structure"` - - MaximumCount *int32 `type:"int32"` - - SupportedVolumeTypes []*string `type:"list"` -} - -// String returns the string representation -func (s VolumeForDescribeInstanceTypesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeForDescribeInstanceTypesOutput) GoString() string { - return s.String() -} - -// SetMaximumCount sets the MaximumCount field's value. -func (s *VolumeForDescribeInstanceTypesOutput) SetMaximumCount(v int32) *VolumeForDescribeInstanceTypesOutput { - s.MaximumCount = &v - return s -} - -// SetSupportedVolumeTypes sets the SupportedVolumeTypes field's value. -func (s *VolumeForDescribeInstanceTypesOutput) SetSupportedVolumeTypes(v []*string) *VolumeForDescribeInstanceTypesOutput { - s.SupportedVolumeTypes = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_vnc_url.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_vnc_url.go deleted file mode 100644 index a5472c7eaebf..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instance_vnc_url.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeInstanceVncUrlCommon = "DescribeInstanceVncUrl" - -// DescribeInstanceVncUrlCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstanceVncUrlCommon operation. The "output" return -// value will be populated with the DescribeInstanceVncUrlCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstanceVncUrlCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstanceVncUrlCommon Send returns without error. -// -// See DescribeInstanceVncUrlCommon for more information on using the DescribeInstanceVncUrlCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeInstanceVncUrlCommonRequest method. -// req, resp := client.DescribeInstanceVncUrlCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstanceVncUrlCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeInstanceVncUrlCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstanceVncUrlCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstanceVncUrlCommon for usage and error information. -func (c *ECS) DescribeInstanceVncUrlCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeInstanceVncUrlCommonRequest(input) - return out, req.Send() -} - -// DescribeInstanceVncUrlCommonWithContext is the same as DescribeInstanceVncUrlCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceVncUrlCommon 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 *ECS) DescribeInstanceVncUrlCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeInstanceVncUrlCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstanceVncUrl = "DescribeInstanceVncUrl" - -// DescribeInstanceVncUrlRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstanceVncUrl operation. The "output" return -// value will be populated with the DescribeInstanceVncUrlCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstanceVncUrlCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstanceVncUrlCommon Send returns without error. -// -// See DescribeInstanceVncUrl for more information on using the DescribeInstanceVncUrl -// API call, and error handling. -// -// // Example sending a request using the DescribeInstanceVncUrlRequest method. -// req, resp := client.DescribeInstanceVncUrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstanceVncUrlRequest(input *DescribeInstanceVncUrlInput) (req *request.Request, output *DescribeInstanceVncUrlOutput) { - op := &request.Operation{ - Name: opDescribeInstanceVncUrl, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstanceVncUrlInput{} - } - - output = &DescribeInstanceVncUrlOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstanceVncUrl API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstanceVncUrl for usage and error information. -func (c *ECS) DescribeInstanceVncUrl(input *DescribeInstanceVncUrlInput) (*DescribeInstanceVncUrlOutput, error) { - req, out := c.DescribeInstanceVncUrlRequest(input) - return out, req.Send() -} - -// DescribeInstanceVncUrlWithContext is the same as DescribeInstanceVncUrl with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstanceVncUrl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeInstanceVncUrlWithContext(ctx volcengine.Context, input *DescribeInstanceVncUrlInput, opts ...request.Option) (*DescribeInstanceVncUrlOutput, error) { - req, out := c.DescribeInstanceVncUrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeInstanceVncUrlInput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceVncUrlInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceVncUrlInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceVncUrlInput) SetInstanceId(v string) *DescribeInstanceVncUrlInput { - s.InstanceId = &v - return s -} - -type DescribeInstanceVncUrlOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - VncUrl *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstanceVncUrlOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstanceVncUrlOutput) GoString() string { - return s.String() -} - -// SetVncUrl sets the VncUrl field's value. -func (s *DescribeInstanceVncUrlOutput) SetVncUrl(v string) *DescribeInstanceVncUrlOutput { - s.VncUrl = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instances.go deleted file mode 100644 index 3ce6e3e62d43..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instances.go +++ /dev/null @@ -1,820 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeInstancesCommon = "DescribeInstances" - -// DescribeInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstancesCommon operation. The "output" return -// value will be populated with the DescribeInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstancesCommon Send returns without error. -// -// See DescribeInstancesCommon for more information on using the DescribeInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeInstancesCommonRequest method. -// req, resp := client.DescribeInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstancesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstancesCommon for usage and error information. -func (c *ECS) DescribeInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeInstancesCommonRequest(input) - return out, req.Send() -} - -// DescribeInstancesCommonWithContext is the same as DescribeInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstancesCommon 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 *ECS) DescribeInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstances = "DescribeInstances" - -// DescribeInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstances operation. The "output" return -// value will be populated with the DescribeInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstancesCommon Send returns without error. -// -// See DescribeInstances for more information on using the DescribeInstances -// API call, and error handling. -// -// // Example sending a request using the DescribeInstancesRequest method. -// req, resp := client.DescribeInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstancesRequest(input *DescribeInstancesInput) (req *request.Request, output *DescribeInstancesOutput) { - op := &request.Operation{ - Name: opDescribeInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstancesInput{} - } - - output = &DescribeInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstances API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstances for usage and error information. -func (c *ECS) DescribeInstances(input *DescribeInstancesInput) (*DescribeInstancesOutput, error) { - req, out := c.DescribeInstancesRequest(input) - return out, req.Send() -} - -// DescribeInstancesWithContext is the same as DescribeInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeInstancesWithContext(ctx volcengine.Context, input *DescribeInstancesInput, opts ...request.Option) (*DescribeInstancesOutput, error) { - req, out := c.DescribeInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type CpuOptionsForDescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - CoreCount *int32 `type:"int32"` - - ThreadsPerCore *int32 `type:"int32"` -} - -// String returns the string representation -func (s CpuOptionsForDescribeInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s CpuOptionsForDescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetCoreCount sets the CoreCount field's value. -func (s *CpuOptionsForDescribeInstancesOutput) SetCoreCount(v int32) *CpuOptionsForDescribeInstancesOutput { - s.CoreCount = &v - return s -} - -// SetThreadsPerCore sets the ThreadsPerCore field's value. -func (s *CpuOptionsForDescribeInstancesOutput) SetThreadsPerCore(v int32) *CpuOptionsForDescribeInstancesOutput { - s.ThreadsPerCore = &v - return s -} - -type DescribeInstancesInput struct { - _ struct{} `type:"structure"` - - DeploymentSetIds []*string `type:"list"` - - HpcClusterId *string `type:"string"` - - InstanceChargeType *string `type:"string"` - - InstanceIds []*string `type:"list"` - - InstanceName *string `type:"string"` - - InstanceTypeFamilies []*string `type:"list"` - - InstanceTypeIds []*string `type:"list"` - - InstanceTypes []*string `type:"list"` - - KeyPairName *string `type:"string"` - - MaxResults *int32 `type:"int32"` - - NextToken *string `type:"string"` - - PrimaryIpAddress *string `type:"string"` - - ProjectName *string `type:"string"` - - Status *string `type:"string"` - - TagFilters []*TagFilterForDescribeInstancesInput `type:"list"` - - VpcId *string `type:"string"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesInput) GoString() string { - return s.String() -} - -// SetDeploymentSetIds sets the DeploymentSetIds field's value. -func (s *DescribeInstancesInput) SetDeploymentSetIds(v []*string) *DescribeInstancesInput { - s.DeploymentSetIds = v - return s -} - -// SetHpcClusterId sets the HpcClusterId field's value. -func (s *DescribeInstancesInput) SetHpcClusterId(v string) *DescribeInstancesInput { - s.HpcClusterId = &v - return s -} - -// SetInstanceChargeType sets the InstanceChargeType field's value. -func (s *DescribeInstancesInput) SetInstanceChargeType(v string) *DescribeInstancesInput { - s.InstanceChargeType = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstancesInput) SetInstanceIds(v []*string) *DescribeInstancesInput { - s.InstanceIds = v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *DescribeInstancesInput) SetInstanceName(v string) *DescribeInstancesInput { - s.InstanceName = &v - return s -} - -// SetInstanceTypeFamilies sets the InstanceTypeFamilies field's value. -func (s *DescribeInstancesInput) SetInstanceTypeFamilies(v []*string) *DescribeInstancesInput { - s.InstanceTypeFamilies = v - return s -} - -// SetInstanceTypeIds sets the InstanceTypeIds field's value. -func (s *DescribeInstancesInput) SetInstanceTypeIds(v []*string) *DescribeInstancesInput { - s.InstanceTypeIds = v - return s -} - -// SetInstanceTypes sets the InstanceTypes field's value. -func (s *DescribeInstancesInput) SetInstanceTypes(v []*string) *DescribeInstancesInput { - s.InstanceTypes = v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *DescribeInstancesInput) SetKeyPairName(v string) *DescribeInstancesInput { - s.KeyPairName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstancesInput) SetMaxResults(v int32) *DescribeInstancesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesInput) SetNextToken(v string) *DescribeInstancesInput { - s.NextToken = &v - return s -} - -// SetPrimaryIpAddress sets the PrimaryIpAddress field's value. -func (s *DescribeInstancesInput) SetPrimaryIpAddress(v string) *DescribeInstancesInput { - s.PrimaryIpAddress = &v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *DescribeInstancesInput) SetProjectName(v string) *DescribeInstancesInput { - s.ProjectName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeInstancesInput) SetStatus(v string) *DescribeInstancesInput { - s.Status = &v - return s -} - -// SetTagFilters sets the TagFilters field's value. -func (s *DescribeInstancesInput) SetTagFilters(v []*TagFilterForDescribeInstancesInput) *DescribeInstancesInput { - s.TagFilters = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *DescribeInstancesInput) SetVpcId(v string) *DescribeInstancesInput { - s.VpcId = &v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *DescribeInstancesInput) SetZoneId(v string) *DescribeInstancesInput { - s.ZoneId = &v - return s -} - -type DescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - Instances []*InstanceForDescribeInstancesOutput `type:"list"` - - NextToken *string `type:"string"` - - TotalCount *int32 `type:"int32"` -} - -// String returns the string representation -func (s DescribeInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetInstances sets the Instances field's value. -func (s *DescribeInstancesOutput) SetInstances(v []*InstanceForDescribeInstancesOutput) *DescribeInstancesOutput { - s.Instances = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesOutput) SetNextToken(v string) *DescribeInstancesOutput { - s.NextToken = &v - return s -} - -// SetTotalCount sets the TotalCount field's value. -func (s *DescribeInstancesOutput) SetTotalCount(v int32) *DescribeInstancesOutput { - s.TotalCount = &v - return s -} - -type EipAddressForDescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - AllocationId *string `type:"string"` -} - -// String returns the string representation -func (s EipAddressForDescribeInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s EipAddressForDescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetAllocationId sets the AllocationId field's value. -func (s *EipAddressForDescribeInstancesOutput) SetAllocationId(v string) *EipAddressForDescribeInstancesOutput { - s.AllocationId = &v - return s -} - -type InstanceForDescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - CpuOptions *CpuOptionsForDescribeInstancesOutput `type:"structure"` - - Cpus *int32 `type:"int32"` - - CreatedAt *string `type:"string"` - - DeploymentSetId *string `type:"string"` - - Description *string `type:"string"` - - EipAddress *EipAddressForDescribeInstancesOutput `type:"structure"` - - ExpiredAt *string `type:"string"` - - HostName *string `type:"string"` - - Hostname *string `type:"string"` - - ImageId *string `type:"string"` - - InstanceChargeType *string `type:"string"` - - InstanceId *string `type:"string"` - - InstanceName *string `type:"string"` - - InstanceTypeId *string `type:"string"` - - KeyPairId *string `type:"string"` - - KeyPairName *string `type:"string"` - - LocalVolumes []*LocalVolumeForDescribeInstancesOutput `type:"list"` - - MemorySize *int32 `type:"int32"` - - NetworkInterfaces []*NetworkInterfaceForDescribeInstancesOutput `type:"list"` - - OsName *string `type:"string"` - - OsType *string `type:"string"` - - ProjectName *string `type:"string"` - - RdmaIpAddresses []*string `type:"list"` - - SpotStrategy *string `type:"string"` - - Status *string `type:"string"` - - StoppedMode *string `type:"string"` - - Tags []*TagForDescribeInstancesOutput `type:"list"` - - UpdatedAt *string `type:"string"` - - Uuid *string `type:"string"` - - VpcId *string `type:"string"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s InstanceForDescribeInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstanceForDescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetCpuOptions sets the CpuOptions field's value. -func (s *InstanceForDescribeInstancesOutput) SetCpuOptions(v *CpuOptionsForDescribeInstancesOutput) *InstanceForDescribeInstancesOutput { - s.CpuOptions = v - return s -} - -// SetCpus sets the Cpus field's value. -func (s *InstanceForDescribeInstancesOutput) SetCpus(v int32) *InstanceForDescribeInstancesOutput { - s.Cpus = &v - return s -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *InstanceForDescribeInstancesOutput) SetCreatedAt(v string) *InstanceForDescribeInstancesOutput { - s.CreatedAt = &v - return s -} - -// SetDeploymentSetId sets the DeploymentSetId field's value. -func (s *InstanceForDescribeInstancesOutput) SetDeploymentSetId(v string) *InstanceForDescribeInstancesOutput { - s.DeploymentSetId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *InstanceForDescribeInstancesOutput) SetDescription(v string) *InstanceForDescribeInstancesOutput { - s.Description = &v - return s -} - -// SetEipAddress sets the EipAddress field's value. -func (s *InstanceForDescribeInstancesOutput) SetEipAddress(v *EipAddressForDescribeInstancesOutput) *InstanceForDescribeInstancesOutput { - s.EipAddress = v - return s -} - -// SetExpiredAt sets the ExpiredAt field's value. -func (s *InstanceForDescribeInstancesOutput) SetExpiredAt(v string) *InstanceForDescribeInstancesOutput { - s.ExpiredAt = &v - return s -} - -// SetHostName sets the HostName field's value. -func (s *InstanceForDescribeInstancesOutput) SetHostName(v string) *InstanceForDescribeInstancesOutput { - s.HostName = &v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *InstanceForDescribeInstancesOutput) SetHostname(v string) *InstanceForDescribeInstancesOutput { - s.Hostname = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *InstanceForDescribeInstancesOutput) SetImageId(v string) *InstanceForDescribeInstancesOutput { - s.ImageId = &v - return s -} - -// SetInstanceChargeType sets the InstanceChargeType field's value. -func (s *InstanceForDescribeInstancesOutput) SetInstanceChargeType(v string) *InstanceForDescribeInstancesOutput { - s.InstanceChargeType = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceForDescribeInstancesOutput) SetInstanceId(v string) *InstanceForDescribeInstancesOutput { - s.InstanceId = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *InstanceForDescribeInstancesOutput) SetInstanceName(v string) *InstanceForDescribeInstancesOutput { - s.InstanceName = &v - return s -} - -// SetInstanceTypeId sets the InstanceTypeId field's value. -func (s *InstanceForDescribeInstancesOutput) SetInstanceTypeId(v string) *InstanceForDescribeInstancesOutput { - s.InstanceTypeId = &v - return s -} - -// SetKeyPairId sets the KeyPairId field's value. -func (s *InstanceForDescribeInstancesOutput) SetKeyPairId(v string) *InstanceForDescribeInstancesOutput { - s.KeyPairId = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *InstanceForDescribeInstancesOutput) SetKeyPairName(v string) *InstanceForDescribeInstancesOutput { - s.KeyPairName = &v - return s -} - -// SetLocalVolumes sets the LocalVolumes field's value. -func (s *InstanceForDescribeInstancesOutput) SetLocalVolumes(v []*LocalVolumeForDescribeInstancesOutput) *InstanceForDescribeInstancesOutput { - s.LocalVolumes = v - return s -} - -// SetMemorySize sets the MemorySize field's value. -func (s *InstanceForDescribeInstancesOutput) SetMemorySize(v int32) *InstanceForDescribeInstancesOutput { - s.MemorySize = &v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *InstanceForDescribeInstancesOutput) SetNetworkInterfaces(v []*NetworkInterfaceForDescribeInstancesOutput) *InstanceForDescribeInstancesOutput { - s.NetworkInterfaces = v - return s -} - -// SetOsName sets the OsName field's value. -func (s *InstanceForDescribeInstancesOutput) SetOsName(v string) *InstanceForDescribeInstancesOutput { - s.OsName = &v - return s -} - -// SetOsType sets the OsType field's value. -func (s *InstanceForDescribeInstancesOutput) SetOsType(v string) *InstanceForDescribeInstancesOutput { - s.OsType = &v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *InstanceForDescribeInstancesOutput) SetProjectName(v string) *InstanceForDescribeInstancesOutput { - s.ProjectName = &v - return s -} - -// SetRdmaIpAddresses sets the RdmaIpAddresses field's value. -func (s *InstanceForDescribeInstancesOutput) SetRdmaIpAddresses(v []*string) *InstanceForDescribeInstancesOutput { - s.RdmaIpAddresses = v - return s -} - -// SetSpotStrategy sets the SpotStrategy field's value. -func (s *InstanceForDescribeInstancesOutput) SetSpotStrategy(v string) *InstanceForDescribeInstancesOutput { - s.SpotStrategy = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *InstanceForDescribeInstancesOutput) SetStatus(v string) *InstanceForDescribeInstancesOutput { - s.Status = &v - return s -} - -// SetStoppedMode sets the StoppedMode field's value. -func (s *InstanceForDescribeInstancesOutput) SetStoppedMode(v string) *InstanceForDescribeInstancesOutput { - s.StoppedMode = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *InstanceForDescribeInstancesOutput) SetTags(v []*TagForDescribeInstancesOutput) *InstanceForDescribeInstancesOutput { - s.Tags = v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *InstanceForDescribeInstancesOutput) SetUpdatedAt(v string) *InstanceForDescribeInstancesOutput { - s.UpdatedAt = &v - return s -} - -// SetUuid sets the Uuid field's value. -func (s *InstanceForDescribeInstancesOutput) SetUuid(v string) *InstanceForDescribeInstancesOutput { - s.Uuid = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *InstanceForDescribeInstancesOutput) SetVpcId(v string) *InstanceForDescribeInstancesOutput { - s.VpcId = &v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *InstanceForDescribeInstancesOutput) SetZoneId(v string) *InstanceForDescribeInstancesOutput { - s.ZoneId = &v - return s -} - -type LocalVolumeForDescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - Count *int32 `type:"int32"` - - Size *int32 `type:"int32"` - - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s LocalVolumeForDescribeInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s LocalVolumeForDescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetCount sets the Count field's value. -func (s *LocalVolumeForDescribeInstancesOutput) SetCount(v int32) *LocalVolumeForDescribeInstancesOutput { - s.Count = &v - return s -} - -// SetSize sets the Size field's value. -func (s *LocalVolumeForDescribeInstancesOutput) SetSize(v int32) *LocalVolumeForDescribeInstancesOutput { - s.Size = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *LocalVolumeForDescribeInstancesOutput) SetVolumeType(v string) *LocalVolumeForDescribeInstancesOutput { - s.VolumeType = &v - return s -} - -type NetworkInterfaceForDescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - MacAddress *string `type:"string"` - - NetworkInterfaceId *string `type:"string"` - - PrimaryIpAddress *string `type:"string"` - - SubnetId *string `type:"string"` - - Type *string `type:"string"` - - VpcId *string `type:"string"` -} - -// String returns the string representation -func (s NetworkInterfaceForDescribeInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceForDescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetMacAddress sets the MacAddress field's value. -func (s *NetworkInterfaceForDescribeInstancesOutput) SetMacAddress(v string) *NetworkInterfaceForDescribeInstancesOutput { - s.MacAddress = &v - return s -} - -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *NetworkInterfaceForDescribeInstancesOutput) SetNetworkInterfaceId(v string) *NetworkInterfaceForDescribeInstancesOutput { - s.NetworkInterfaceId = &v - return s -} - -// SetPrimaryIpAddress sets the PrimaryIpAddress field's value. -func (s *NetworkInterfaceForDescribeInstancesOutput) SetPrimaryIpAddress(v string) *NetworkInterfaceForDescribeInstancesOutput { - s.PrimaryIpAddress = &v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NetworkInterfaceForDescribeInstancesOutput) SetSubnetId(v string) *NetworkInterfaceForDescribeInstancesOutput { - s.SubnetId = &v - return s -} - -// SetType sets the Type field's value. -func (s *NetworkInterfaceForDescribeInstancesOutput) SetType(v string) *NetworkInterfaceForDescribeInstancesOutput { - s.Type = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *NetworkInterfaceForDescribeInstancesOutput) SetVpcId(v string) *NetworkInterfaceForDescribeInstancesOutput { - s.VpcId = &v - return s -} - -type TagFilterForDescribeInstancesInput struct { - _ struct{} `type:"structure"` - - Key *string `type:"string"` - - Values []*string `type:"list"` -} - -// String returns the string representation -func (s TagFilterForDescribeInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagFilterForDescribeInstancesInput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TagFilterForDescribeInstancesInput) SetKey(v string) *TagFilterForDescribeInstancesInput { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *TagFilterForDescribeInstancesInput) SetValues(v []*string) *TagFilterForDescribeInstancesInput { - s.Values = v - return s -} - -type TagForDescribeInstancesOutput struct { - _ struct{} `type:"structure"` - - Key *string `type:"string"` - - Value *string `type:"string"` -} - -// String returns the string representation -func (s TagForDescribeInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagForDescribeInstancesOutput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TagForDescribeInstancesOutput) SetKey(v string) *TagForDescribeInstancesOutput { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *TagForDescribeInstancesOutput) SetValue(v string) *TagForDescribeInstancesOutput { - s.Value = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instances_iam_roles.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instances_iam_roles.go deleted file mode 100644 index 0d3f327e3ab5..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_instances_iam_roles.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeInstancesIamRolesCommon = "DescribeInstancesIamRoles" - -// DescribeInstancesIamRolesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstancesIamRolesCommon operation. The "output" return -// value will be populated with the DescribeInstancesIamRolesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstancesIamRolesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstancesIamRolesCommon Send returns without error. -// -// See DescribeInstancesIamRolesCommon for more information on using the DescribeInstancesIamRolesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeInstancesIamRolesCommonRequest method. -// req, resp := client.DescribeInstancesIamRolesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstancesIamRolesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeInstancesIamRolesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstancesIamRolesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstancesIamRolesCommon for usage and error information. -func (c *ECS) DescribeInstancesIamRolesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeInstancesIamRolesCommonRequest(input) - return out, req.Send() -} - -// DescribeInstancesIamRolesCommonWithContext is the same as DescribeInstancesIamRolesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstancesIamRolesCommon 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 *ECS) DescribeInstancesIamRolesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeInstancesIamRolesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeInstancesIamRoles = "DescribeInstancesIamRoles" - -// DescribeInstancesIamRolesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeInstancesIamRoles operation. The "output" return -// value will be populated with the DescribeInstancesIamRolesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeInstancesIamRolesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeInstancesIamRolesCommon Send returns without error. -// -// See DescribeInstancesIamRoles for more information on using the DescribeInstancesIamRoles -// API call, and error handling. -// -// // Example sending a request using the DescribeInstancesIamRolesRequest method. -// req, resp := client.DescribeInstancesIamRolesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeInstancesIamRolesRequest(input *DescribeInstancesIamRolesInput) (req *request.Request, output *DescribeInstancesIamRolesOutput) { - op := &request.Operation{ - Name: opDescribeInstancesIamRoles, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeInstancesIamRolesInput{} - } - - output = &DescribeInstancesIamRolesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeInstancesIamRoles API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeInstancesIamRoles for usage and error information. -func (c *ECS) DescribeInstancesIamRoles(input *DescribeInstancesIamRolesInput) (*DescribeInstancesIamRolesOutput, error) { - req, out := c.DescribeInstancesIamRolesRequest(input) - return out, req.Send() -} - -// DescribeInstancesIamRolesWithContext is the same as DescribeInstancesIamRoles with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeInstancesIamRoles for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeInstancesIamRolesWithContext(ctx volcengine.Context, input *DescribeInstancesIamRolesInput, opts ...request.Option) (*DescribeInstancesIamRolesOutput, error) { - req, out := c.DescribeInstancesIamRolesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeInstancesIamRolesInput struct { - _ struct{} `type:"structure"` - - InstanceIds []*string `type:"list"` - - MaxResults *int32 `type:"int32"` - - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstancesIamRolesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesIamRolesInput) GoString() string { - return s.String() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstancesIamRolesInput) SetInstanceIds(v []*string) *DescribeInstancesIamRolesInput { - s.InstanceIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstancesIamRolesInput) SetMaxResults(v int32) *DescribeInstancesIamRolesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesIamRolesInput) SetNextToken(v string) *DescribeInstancesIamRolesInput { - s.NextToken = &v - return s -} - -type DescribeInstancesIamRolesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - InstancesIamRoles []*InstancesIamRoleForDescribeInstancesIamRolesOutput `type:"list"` - - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeInstancesIamRolesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeInstancesIamRolesOutput) GoString() string { - return s.String() -} - -// SetInstancesIamRoles sets the InstancesIamRoles field's value. -func (s *DescribeInstancesIamRolesOutput) SetInstancesIamRoles(v []*InstancesIamRoleForDescribeInstancesIamRolesOutput) *DescribeInstancesIamRolesOutput { - s.InstancesIamRoles = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesIamRolesOutput) SetNextToken(v string) *DescribeInstancesIamRolesOutput { - s.NextToken = &v - return s -} - -type InstancesIamRoleForDescribeInstancesIamRolesOutput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` - - RoleNames []*string `type:"list"` -} - -// String returns the string representation -func (s InstancesIamRoleForDescribeInstancesIamRolesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s InstancesIamRoleForDescribeInstancesIamRolesOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *InstancesIamRoleForDescribeInstancesIamRolesOutput) SetInstanceId(v string) *InstancesIamRoleForDescribeInstancesIamRolesOutput { - s.InstanceId = &v - return s -} - -// SetRoleNames sets the RoleNames field's value. -func (s *InstancesIamRoleForDescribeInstancesIamRolesOutput) SetRoleNames(v []*string) *InstancesIamRoleForDescribeInstancesIamRolesOutput { - s.RoleNames = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_key_pairs.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_key_pairs.go deleted file mode 100644 index 6c64b9c79183..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_key_pairs.go +++ /dev/null @@ -1,296 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeKeyPairsCommon = "DescribeKeyPairs" - -// DescribeKeyPairsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeKeyPairsCommon operation. The "output" return -// value will be populated with the DescribeKeyPairsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeKeyPairsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeKeyPairsCommon Send returns without error. -// -// See DescribeKeyPairsCommon for more information on using the DescribeKeyPairsCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeKeyPairsCommonRequest method. -// req, resp := client.DescribeKeyPairsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeKeyPairsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeKeyPairsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeKeyPairsCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeKeyPairsCommon for usage and error information. -func (c *ECS) DescribeKeyPairsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeKeyPairsCommonRequest(input) - return out, req.Send() -} - -// DescribeKeyPairsCommonWithContext is the same as DescribeKeyPairsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeKeyPairsCommon 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 *ECS) DescribeKeyPairsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeKeyPairsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeKeyPairs = "DescribeKeyPairs" - -// DescribeKeyPairsRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeKeyPairs operation. The "output" return -// value will be populated with the DescribeKeyPairsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeKeyPairsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeKeyPairsCommon Send returns without error. -// -// See DescribeKeyPairs for more information on using the DescribeKeyPairs -// API call, and error handling. -// -// // Example sending a request using the DescribeKeyPairsRequest method. -// req, resp := client.DescribeKeyPairsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeKeyPairsRequest(input *DescribeKeyPairsInput) (req *request.Request, output *DescribeKeyPairsOutput) { - op := &request.Operation{ - Name: opDescribeKeyPairs, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeKeyPairsInput{} - } - - output = &DescribeKeyPairsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeKeyPairs API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeKeyPairs for usage and error information. -func (c *ECS) DescribeKeyPairs(input *DescribeKeyPairsInput) (*DescribeKeyPairsOutput, error) { - req, out := c.DescribeKeyPairsRequest(input) - return out, req.Send() -} - -// DescribeKeyPairsWithContext is the same as DescribeKeyPairs with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeKeyPairs for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeKeyPairsWithContext(ctx volcengine.Context, input *DescribeKeyPairsInput, opts ...request.Option) (*DescribeKeyPairsOutput, error) { - req, out := c.DescribeKeyPairsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeKeyPairsInput struct { - _ struct{} `type:"structure"` - - FingerPrint *string `type:"string"` - - KeyPairIds []*string `type:"list"` - - KeyPairName *string `type:"string"` - - KeyPairNames []*string `type:"list"` - - MaxResults *int32 `type:"int32"` - - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeKeyPairsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeKeyPairsInput) GoString() string { - return s.String() -} - -// SetFingerPrint sets the FingerPrint field's value. -func (s *DescribeKeyPairsInput) SetFingerPrint(v string) *DescribeKeyPairsInput { - s.FingerPrint = &v - return s -} - -// SetKeyPairIds sets the KeyPairIds field's value. -func (s *DescribeKeyPairsInput) SetKeyPairIds(v []*string) *DescribeKeyPairsInput { - s.KeyPairIds = v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *DescribeKeyPairsInput) SetKeyPairName(v string) *DescribeKeyPairsInput { - s.KeyPairName = &v - return s -} - -// SetKeyPairNames sets the KeyPairNames field's value. -func (s *DescribeKeyPairsInput) SetKeyPairNames(v []*string) *DescribeKeyPairsInput { - s.KeyPairNames = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeKeyPairsInput) SetMaxResults(v int32) *DescribeKeyPairsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeKeyPairsInput) SetNextToken(v string) *DescribeKeyPairsInput { - s.NextToken = &v - return s -} - -type DescribeKeyPairsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - KeyPairs []*KeyPairForDescribeKeyPairsOutput `type:"list"` - - NextToken *string `type:"string"` -} - -// String returns the string representation -func (s DescribeKeyPairsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeKeyPairsOutput) GoString() string { - return s.String() -} - -// SetKeyPairs sets the KeyPairs field's value. -func (s *DescribeKeyPairsOutput) SetKeyPairs(v []*KeyPairForDescribeKeyPairsOutput) *DescribeKeyPairsOutput { - s.KeyPairs = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeKeyPairsOutput) SetNextToken(v string) *DescribeKeyPairsOutput { - s.NextToken = &v - return s -} - -type KeyPairForDescribeKeyPairsOutput struct { - _ struct{} `type:"structure"` - - CreatedAt *string `type:"string"` - - Description *string `type:"string"` - - FingerPrint *string `type:"string"` - - KeyPairId *string `type:"string"` - - KeyPairName *string `type:"string"` - - UpdatedAt *string `type:"string"` -} - -// String returns the string representation -func (s KeyPairForDescribeKeyPairsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s KeyPairForDescribeKeyPairsOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *KeyPairForDescribeKeyPairsOutput) SetCreatedAt(v string) *KeyPairForDescribeKeyPairsOutput { - s.CreatedAt = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *KeyPairForDescribeKeyPairsOutput) SetDescription(v string) *KeyPairForDescribeKeyPairsOutput { - s.Description = &v - return s -} - -// SetFingerPrint sets the FingerPrint field's value. -func (s *KeyPairForDescribeKeyPairsOutput) SetFingerPrint(v string) *KeyPairForDescribeKeyPairsOutput { - s.FingerPrint = &v - return s -} - -// SetKeyPairId sets the KeyPairId field's value. -func (s *KeyPairForDescribeKeyPairsOutput) SetKeyPairId(v string) *KeyPairForDescribeKeyPairsOutput { - s.KeyPairId = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *KeyPairForDescribeKeyPairsOutput) SetKeyPairName(v string) *KeyPairForDescribeKeyPairsOutput { - s.KeyPairName = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *KeyPairForDescribeKeyPairsOutput) SetUpdatedAt(v string) *KeyPairForDescribeKeyPairsOutput { - s.UpdatedAt = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_system_events.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_system_events.go deleted file mode 100644 index 55414a0e6010..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_system_events.go +++ /dev/null @@ -1,418 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "encoding/json" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeSystemEventsCommon = "DescribeSystemEvents" - -// DescribeSystemEventsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeSystemEventsCommon operation. The "output" return -// value will be populated with the DescribeSystemEventsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeSystemEventsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeSystemEventsCommon Send returns without error. -// -// See DescribeSystemEventsCommon for more information on using the DescribeSystemEventsCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeSystemEventsCommonRequest method. -// req, resp := client.DescribeSystemEventsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeSystemEventsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeSystemEventsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeSystemEventsCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeSystemEventsCommon for usage and error information. -func (c *ECS) DescribeSystemEventsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeSystemEventsCommonRequest(input) - return out, req.Send() -} - -// DescribeSystemEventsCommonWithContext is the same as DescribeSystemEventsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSystemEventsCommon 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 *ECS) DescribeSystemEventsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeSystemEventsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeSystemEvents = "DescribeSystemEvents" - -// DescribeSystemEventsRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeSystemEvents operation. The "output" return -// value will be populated with the DescribeSystemEventsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeSystemEventsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeSystemEventsCommon Send returns without error. -// -// See DescribeSystemEvents for more information on using the DescribeSystemEvents -// API call, and error handling. -// -// // Example sending a request using the DescribeSystemEventsRequest method. -// req, resp := client.DescribeSystemEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeSystemEventsRequest(input *DescribeSystemEventsInput) (req *request.Request, output *DescribeSystemEventsOutput) { - op := &request.Operation{ - Name: opDescribeSystemEvents, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeSystemEventsInput{} - } - - output = &DescribeSystemEventsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeSystemEvents API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeSystemEvents for usage and error information. -func (c *ECS) DescribeSystemEvents(input *DescribeSystemEventsInput) (*DescribeSystemEventsOutput, error) { - req, out := c.DescribeSystemEventsRequest(input) - return out, req.Send() -} - -// DescribeSystemEventsWithContext is the same as DescribeSystemEvents with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeSystemEvents for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeSystemEventsWithContext(ctx volcengine.Context, input *DescribeSystemEventsInput, opts ...request.Option) (*DescribeSystemEventsOutput, error) { - req, out := c.DescribeSystemEventsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeSystemEventsInput struct { - _ struct{} `type:"structure"` - - CreatedAtEnd *string `type:"string"` - - CreatedAtStart *string `type:"string"` - - EventIds []*string `type:"list"` - - MaxResults *json.Number `type:"json_number"` - - NextToken *string `type:"string"` - - ResourceIds []*string `type:"list"` - - Status []*string `type:"list"` - - Types []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeSystemEventsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSystemEventsInput) GoString() string { - return s.String() -} - -// SetCreatedAtEnd sets the CreatedAtEnd field's value. -func (s *DescribeSystemEventsInput) SetCreatedAtEnd(v string) *DescribeSystemEventsInput { - s.CreatedAtEnd = &v - return s -} - -// SetCreatedAtStart sets the CreatedAtStart field's value. -func (s *DescribeSystemEventsInput) SetCreatedAtStart(v string) *DescribeSystemEventsInput { - s.CreatedAtStart = &v - return s -} - -// SetEventIds sets the EventIds field's value. -func (s *DescribeSystemEventsInput) SetEventIds(v []*string) *DescribeSystemEventsInput { - s.EventIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeSystemEventsInput) SetMaxResults(v json.Number) *DescribeSystemEventsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSystemEventsInput) SetNextToken(v string) *DescribeSystemEventsInput { - s.NextToken = &v - return s -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *DescribeSystemEventsInput) SetResourceIds(v []*string) *DescribeSystemEventsInput { - s.ResourceIds = v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeSystemEventsInput) SetStatus(v []*string) *DescribeSystemEventsInput { - s.Status = v - return s -} - -// SetTypes sets the Types field's value. -func (s *DescribeSystemEventsInput) SetTypes(v []*string) *DescribeSystemEventsInput { - s.Types = v - return s -} - -type DescribeSystemEventsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - NextToken *string `type:"string"` - - SystemEvents []*SystemEventForDescribeSystemEventsOutput `type:"list"` -} - -// String returns the string representation -func (s DescribeSystemEventsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeSystemEventsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeSystemEventsOutput) SetNextToken(v string) *DescribeSystemEventsOutput { - s.NextToken = &v - return s -} - -// SetSystemEvents sets the SystemEvents field's value. -func (s *DescribeSystemEventsOutput) SetSystemEvents(v []*SystemEventForDescribeSystemEventsOutput) *DescribeSystemEventsOutput { - s.SystemEvents = v - return s -} - -type SystemEventForDescribeSystemEventsOutput struct { - _ struct{} `type:"structure"` - - CreatedAt *string `type:"string"` - - Id *string `type:"string"` - - OperatedEndAt *string `type:"string"` - - OperatedStartAt *string `type:"string"` - - ResourceId *string `type:"string"` - - Status *string `type:"string" enum:"StatusForDescribeSystemEventsOutput"` - - Type *string `type:"string" enum:"TypeForDescribeSystemEventsOutput"` - - UpdatedAt *string `type:"string"` -} - -// String returns the string representation -func (s SystemEventForDescribeSystemEventsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s SystemEventForDescribeSystemEventsOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *SystemEventForDescribeSystemEventsOutput) SetCreatedAt(v string) *SystemEventForDescribeSystemEventsOutput { - s.CreatedAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *SystemEventForDescribeSystemEventsOutput) SetId(v string) *SystemEventForDescribeSystemEventsOutput { - s.Id = &v - return s -} - -// SetOperatedEndAt sets the OperatedEndAt field's value. -func (s *SystemEventForDescribeSystemEventsOutput) SetOperatedEndAt(v string) *SystemEventForDescribeSystemEventsOutput { - s.OperatedEndAt = &v - return s -} - -// SetOperatedStartAt sets the OperatedStartAt field's value. -func (s *SystemEventForDescribeSystemEventsOutput) SetOperatedStartAt(v string) *SystemEventForDescribeSystemEventsOutput { - s.OperatedStartAt = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *SystemEventForDescribeSystemEventsOutput) SetResourceId(v string) *SystemEventForDescribeSystemEventsOutput { - s.ResourceId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *SystemEventForDescribeSystemEventsOutput) SetStatus(v string) *SystemEventForDescribeSystemEventsOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *SystemEventForDescribeSystemEventsOutput) SetType(v string) *SystemEventForDescribeSystemEventsOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *SystemEventForDescribeSystemEventsOutput) SetUpdatedAt(v string) *SystemEventForDescribeSystemEventsOutput { - s.UpdatedAt = &v - return s -} - -const ( - // StatusForDescribeSystemEventsOutputUnknownStatus is a StatusForDescribeSystemEventsOutput enum value - StatusForDescribeSystemEventsOutputUnknownStatus = "UnknownStatus" - - // StatusForDescribeSystemEventsOutputExecuting is a StatusForDescribeSystemEventsOutput enum value - StatusForDescribeSystemEventsOutputExecuting = "Executing" - - // StatusForDescribeSystemEventsOutputSucceeded is a StatusForDescribeSystemEventsOutput enum value - StatusForDescribeSystemEventsOutputSucceeded = "Succeeded" - - // StatusForDescribeSystemEventsOutputFailed is a StatusForDescribeSystemEventsOutput enum value - StatusForDescribeSystemEventsOutputFailed = "Failed" - - // StatusForDescribeSystemEventsOutputInquiring is a StatusForDescribeSystemEventsOutput enum value - StatusForDescribeSystemEventsOutputInquiring = "Inquiring" - - // StatusForDescribeSystemEventsOutputScheduled is a StatusForDescribeSystemEventsOutput enum value - StatusForDescribeSystemEventsOutputScheduled = "Scheduled" - - // StatusForDescribeSystemEventsOutputRejected is a StatusForDescribeSystemEventsOutput enum value - StatusForDescribeSystemEventsOutputRejected = "Rejected" -) - -const ( - // TypeForDescribeSystemEventsOutputUnknownType is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputUnknownType = "UnknownType" - - // TypeForDescribeSystemEventsOutputSystemFailureStop is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputSystemFailureStop = "SystemFailure_Stop" - - // TypeForDescribeSystemEventsOutputSystemFailureReboot is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputSystemFailureReboot = "SystemFailure_Reboot" - - // TypeForDescribeSystemEventsOutputSystemFailurePleaseCheck is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputSystemFailurePleaseCheck = "SystemFailure_PleaseCheck" - - // TypeForDescribeSystemEventsOutputDiskErrorRedeploy is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputDiskErrorRedeploy = "DiskError_Redeploy" - - // TypeForDescribeSystemEventsOutputHddbadSectorRedeploy is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputHddbadSectorRedeploy = "HDDBadSector_Redeploy" - - // TypeForDescribeSystemEventsOutputGpuErrorRedeploy is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputGpuErrorRedeploy = "GpuError_Redeploy" - - // TypeForDescribeSystemEventsOutputSystemMaintenanceRedeploy is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputSystemMaintenanceRedeploy = "SystemMaintenance_Redeploy" - - // TypeForDescribeSystemEventsOutputSystemFailureRedeploy is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputSystemFailureRedeploy = "SystemFailure_Redeploy" - - // TypeForDescribeSystemEventsOutputCreateInstance is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputCreateInstance = "CreateInstance" - - // TypeForDescribeSystemEventsOutputRunInstance is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputRunInstance = "RunInstance" - - // TypeForDescribeSystemEventsOutputStopInstance is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputStopInstance = "StopInstance" - - // TypeForDescribeSystemEventsOutputDeleteInstance is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputDeleteInstance = "DeleteInstance" - - // TypeForDescribeSystemEventsOutputSpotInstanceInterruptionDelete is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputSpotInstanceInterruptionDelete = "SpotInstanceInterruption_Delete" - - // TypeForDescribeSystemEventsOutputAccountUnbalancedStop is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputAccountUnbalancedStop = "AccountUnbalanced_Stop" - - // TypeForDescribeSystemEventsOutputAccountUnbalancedDelete is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputAccountUnbalancedDelete = "AccountUnbalanced_Delete" - - // TypeForDescribeSystemEventsOutputInstanceChargeTypeChange is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputInstanceChargeTypeChange = "InstanceChargeType_Change" - - // TypeForDescribeSystemEventsOutputInstanceConfigurationChange is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputInstanceConfigurationChange = "InstanceConfiguration_Change" - - // TypeForDescribeSystemEventsOutputFileSystemReadOnlyChange is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputFileSystemReadOnlyChange = "FileSystemReadOnly_Change" - - // TypeForDescribeSystemEventsOutputRebootInstance is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputRebootInstance = "RebootInstance" - - // TypeForDescribeSystemEventsOutputInstanceFailure is a TypeForDescribeSystemEventsOutput enum value - TypeForDescribeSystemEventsOutputInstanceFailure = "InstanceFailure" -) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_tags.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_tags.go deleted file mode 100644 index 940544f4d302..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_tags.go +++ /dev/null @@ -1,302 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeTagsCommon = "DescribeTags" - -// DescribeTagsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeTagsCommon operation. The "output" return -// value will be populated with the DescribeTagsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeTagsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeTagsCommon Send returns without error. -// -// See DescribeTagsCommon for more information on using the DescribeTagsCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeTagsCommonRequest method. -// req, resp := client.DescribeTagsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeTagsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeTagsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeTagsCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeTagsCommon for usage and error information. -func (c *ECS) DescribeTagsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeTagsCommonRequest(input) - return out, req.Send() -} - -// DescribeTagsCommonWithContext is the same as DescribeTagsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTagsCommon 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 *ECS) DescribeTagsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeTagsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTags = "DescribeTags" - -// DescribeTagsRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeTags operation. The "output" return -// value will be populated with the DescribeTagsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeTagsCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeTagsCommon Send returns without error. -// -// See DescribeTags for more information on using the DescribeTags -// API call, and error handling. -// -// // Example sending a request using the DescribeTagsRequest method. -// req, resp := client.DescribeTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { - op := &request.Operation{ - Name: opDescribeTags, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTagsInput{} - } - - output = &DescribeTagsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeTags API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeTags for usage and error information. -func (c *ECS) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - return out, req.Send() -} - -// DescribeTagsWithContext is the same as DescribeTags with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeTagsWithContext(ctx volcengine.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeTagsInput struct { - _ struct{} `type:"structure"` - - MaxResults *int32 `type:"int32"` - - NextToken *string `type:"string"` - - ResourceIds []*string `type:"list"` - - ResourceType *string `type:"string"` - - TagFilters []*TagFilterForDescribeTagsInput `type:"list"` -} - -// String returns the string representation -func (s DescribeTagsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTagsInput) GoString() string { - return s.String() -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeTagsInput) SetMaxResults(v int32) *DescribeTagsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTagsInput) SetNextToken(v string) *DescribeTagsInput { - s.NextToken = &v - return s -} - -// SetResourceIds sets the ResourceIds field's value. -func (s *DescribeTagsInput) SetResourceIds(v []*string) *DescribeTagsInput { - s.ResourceIds = v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *DescribeTagsInput) SetResourceType(v string) *DescribeTagsInput { - s.ResourceType = &v - return s -} - -// SetTagFilters sets the TagFilters field's value. -func (s *DescribeTagsInput) SetTagFilters(v []*TagFilterForDescribeTagsInput) *DescribeTagsInput { - s.TagFilters = v - return s -} - -type DescribeTagsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - NextToken *string `type:"string"` - - TagResources []*TagResourceForDescribeTagsOutput `type:"list"` -} - -// String returns the string representation -func (s DescribeTagsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTagsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTagsOutput) SetNextToken(v string) *DescribeTagsOutput { - s.NextToken = &v - return s -} - -// SetTagResources sets the TagResources field's value. -func (s *DescribeTagsOutput) SetTagResources(v []*TagResourceForDescribeTagsOutput) *DescribeTagsOutput { - s.TagResources = v - return s -} - -type TagFilterForDescribeTagsInput struct { - _ struct{} `type:"structure"` - - Key *string `type:"string"` - - Values []*string `type:"list"` -} - -// String returns the string representation -func (s TagFilterForDescribeTagsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagFilterForDescribeTagsInput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TagFilterForDescribeTagsInput) SetKey(v string) *TagFilterForDescribeTagsInput { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *TagFilterForDescribeTagsInput) SetValues(v []*string) *TagFilterForDescribeTagsInput { - s.Values = v - return s -} - -type TagResourceForDescribeTagsOutput struct { - _ struct{} `type:"structure"` - - ResourceId *string `type:"string"` - - ResourceType *string `type:"string"` - - TagKey *string `type:"string"` - - TagValue *string `type:"string"` -} - -// String returns the string representation -func (s TagResourceForDescribeTagsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagResourceForDescribeTagsOutput) GoString() string { - return s.String() -} - -// SetResourceId sets the ResourceId field's value. -func (s *TagResourceForDescribeTagsOutput) SetResourceId(v string) *TagResourceForDescribeTagsOutput { - s.ResourceId = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *TagResourceForDescribeTagsOutput) SetResourceType(v string) *TagResourceForDescribeTagsOutput { - s.ResourceType = &v - return s -} - -// SetTagKey sets the TagKey field's value. -func (s *TagResourceForDescribeTagsOutput) SetTagKey(v string) *TagResourceForDescribeTagsOutput { - s.TagKey = &v - return s -} - -// SetTagValue sets the TagValue field's value. -func (s *TagResourceForDescribeTagsOutput) SetTagValue(v string) *TagResourceForDescribeTagsOutput { - s.TagValue = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_tasks.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_tasks.go deleted file mode 100644 index 2967bd3f0245..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_tasks.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "encoding/json" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeTasksCommon = "DescribeTasks" - -// DescribeTasksCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeTasksCommon operation. The "output" return -// value will be populated with the DescribeTasksCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeTasksCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeTasksCommon Send returns without error. -// -// See DescribeTasksCommon for more information on using the DescribeTasksCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeTasksCommonRequest method. -// req, resp := client.DescribeTasksCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeTasksCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeTasksCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeTasksCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeTasksCommon for usage and error information. -func (c *ECS) DescribeTasksCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeTasksCommonRequest(input) - return out, req.Send() -} - -// DescribeTasksCommonWithContext is the same as DescribeTasksCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTasksCommon 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 *ECS) DescribeTasksCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeTasksCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTasks = "DescribeTasks" - -// DescribeTasksRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeTasks operation. The "output" return -// value will be populated with the DescribeTasksCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeTasksCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeTasksCommon Send returns without error. -// -// See DescribeTasks for more information on using the DescribeTasks -// API call, and error handling. -// -// // Example sending a request using the DescribeTasksRequest method. -// req, resp := client.DescribeTasksRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeTasksRequest(input *DescribeTasksInput) (req *request.Request, output *DescribeTasksOutput) { - op := &request.Operation{ - Name: opDescribeTasks, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTasksInput{} - } - - output = &DescribeTasksOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeTasks API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeTasks for usage and error information. -func (c *ECS) DescribeTasks(input *DescribeTasksInput) (*DescribeTasksOutput, error) { - req, out := c.DescribeTasksRequest(input) - return out, req.Send() -} - -// DescribeTasksWithContext is the same as DescribeTasks with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTasks for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeTasksWithContext(ctx volcengine.Context, input *DescribeTasksInput, opts ...request.Option) (*DescribeTasksOutput, error) { - req, out := c.DescribeTasksRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeTasksInput struct { - _ struct{} `type:"structure"` - - MaxResults *json.Number `type:"json_number"` - - NextToken *string `type:"string"` - - ResourceId *string `type:"string"` - - TaskIds []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeTasksInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTasksInput) GoString() string { - return s.String() -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeTasksInput) SetMaxResults(v json.Number) *DescribeTasksInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTasksInput) SetNextToken(v string) *DescribeTasksInput { - s.NextToken = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *DescribeTasksInput) SetResourceId(v string) *DescribeTasksInput { - s.ResourceId = &v - return s -} - -// SetTaskIds sets the TaskIds field's value. -func (s *DescribeTasksInput) SetTaskIds(v []*string) *DescribeTasksInput { - s.TaskIds = v - return s -} - -type DescribeTasksOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - NextToken *string `type:"string"` - - Tasks []*TaskForDescribeTasksOutput `type:"list"` -} - -// String returns the string representation -func (s DescribeTasksOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeTasksOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeTasksOutput) SetNextToken(v string) *DescribeTasksOutput { - s.NextToken = &v - return s -} - -// SetTasks sets the Tasks field's value. -func (s *DescribeTasksOutput) SetTasks(v []*TaskForDescribeTasksOutput) *DescribeTasksOutput { - s.Tasks = v - return s -} - -type TaskForDescribeTasksOutput struct { - _ struct{} `type:"structure"` - - CreatedAt *string `type:"string"` - - EndAt *string `type:"string"` - - Id *string `type:"string"` - - Process *int64 `type:"int64"` - - ResourceId *string `type:"string"` - - Status *string `type:"string" enum:"StatusForDescribeTasksOutput"` - - Type *string `type:"string" enum:"TypeForDescribeTasksOutput"` - - UpdatedAt *string `type:"string"` -} - -// String returns the string representation -func (s TaskForDescribeTasksOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s TaskForDescribeTasksOutput) GoString() string { - return s.String() -} - -// SetCreatedAt sets the CreatedAt field's value. -func (s *TaskForDescribeTasksOutput) SetCreatedAt(v string) *TaskForDescribeTasksOutput { - s.CreatedAt = &v - return s -} - -// SetEndAt sets the EndAt field's value. -func (s *TaskForDescribeTasksOutput) SetEndAt(v string) *TaskForDescribeTasksOutput { - s.EndAt = &v - return s -} - -// SetId sets the Id field's value. -func (s *TaskForDescribeTasksOutput) SetId(v string) *TaskForDescribeTasksOutput { - s.Id = &v - return s -} - -// SetProcess sets the Process field's value. -func (s *TaskForDescribeTasksOutput) SetProcess(v int64) *TaskForDescribeTasksOutput { - s.Process = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *TaskForDescribeTasksOutput) SetResourceId(v string) *TaskForDescribeTasksOutput { - s.ResourceId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *TaskForDescribeTasksOutput) SetStatus(v string) *TaskForDescribeTasksOutput { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *TaskForDescribeTasksOutput) SetType(v string) *TaskForDescribeTasksOutput { - s.Type = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *TaskForDescribeTasksOutput) SetUpdatedAt(v string) *TaskForDescribeTasksOutput { - s.UpdatedAt = &v - return s -} - -const ( - // StatusForDescribeTasksOutputUnknownStatus is a StatusForDescribeTasksOutput enum value - StatusForDescribeTasksOutputUnknownStatus = "UnknownStatus" - - // StatusForDescribeTasksOutputPending is a StatusForDescribeTasksOutput enum value - StatusForDescribeTasksOutputPending = "Pending" - - // StatusForDescribeTasksOutputRunning is a StatusForDescribeTasksOutput enum value - StatusForDescribeTasksOutputRunning = "Running" - - // StatusForDescribeTasksOutputSucceeded is a StatusForDescribeTasksOutput enum value - StatusForDescribeTasksOutputSucceeded = "Succeeded" - - // StatusForDescribeTasksOutputFailed is a StatusForDescribeTasksOutput enum value - StatusForDescribeTasksOutputFailed = "Failed" -) - -const ( - // TypeForDescribeTasksOutputUnknownType is a TypeForDescribeTasksOutput enum value - TypeForDescribeTasksOutputUnknownType = "UnknownType" - - // TypeForDescribeTasksOutputExportImage is a TypeForDescribeTasksOutput enum value - TypeForDescribeTasksOutputExportImage = "ExportImage" - - // TypeForDescribeTasksOutputCopyImage is a TypeForDescribeTasksOutput enum value - TypeForDescribeTasksOutputCopyImage = "CopyImage" - - // TypeForDescribeTasksOutputPreheatImage is a TypeForDescribeTasksOutput enum value - TypeForDescribeTasksOutputPreheatImage = "PreheatImage" -) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_user_data.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_user_data.go deleted file mode 100644 index 11c2035e64e2..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_user_data.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeUserDataCommon = "DescribeUserData" - -// DescribeUserDataCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeUserDataCommon operation. The "output" return -// value will be populated with the DescribeUserDataCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeUserDataCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeUserDataCommon Send returns without error. -// -// See DescribeUserDataCommon for more information on using the DescribeUserDataCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeUserDataCommonRequest method. -// req, resp := client.DescribeUserDataCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeUserDataCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeUserDataCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeUserDataCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeUserDataCommon for usage and error information. -func (c *ECS) DescribeUserDataCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeUserDataCommonRequest(input) - return out, req.Send() -} - -// DescribeUserDataCommonWithContext is the same as DescribeUserDataCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeUserDataCommon 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 *ECS) DescribeUserDataCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeUserDataCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeUserData = "DescribeUserData" - -// DescribeUserDataRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeUserData operation. The "output" return -// value will be populated with the DescribeUserDataCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeUserDataCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeUserDataCommon Send returns without error. -// -// See DescribeUserData for more information on using the DescribeUserData -// API call, and error handling. -// -// // Example sending a request using the DescribeUserDataRequest method. -// req, resp := client.DescribeUserDataRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeUserDataRequest(input *DescribeUserDataInput) (req *request.Request, output *DescribeUserDataOutput) { - op := &request.Operation{ - Name: opDescribeUserData, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeUserDataInput{} - } - - output = &DescribeUserDataOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeUserData API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeUserData for usage and error information. -func (c *ECS) DescribeUserData(input *DescribeUserDataInput) (*DescribeUserDataOutput, error) { - req, out := c.DescribeUserDataRequest(input) - return out, req.Send() -} - -// DescribeUserDataWithContext is the same as DescribeUserData with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeUserData for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeUserDataWithContext(ctx volcengine.Context, input *DescribeUserDataInput, opts ...request.Option) (*DescribeUserDataOutput, error) { - req, out := c.DescribeUserDataRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeUserDataInput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s DescribeUserDataInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeUserDataInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeUserDataInput) SetInstanceId(v string) *DescribeUserDataInput { - s.InstanceId = &v - return s -} - -type DescribeUserDataOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - InstanceId *string `type:"string"` - - UserData *string `type:"string"` -} - -// String returns the string representation -func (s DescribeUserDataOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeUserDataOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeUserDataOutput) SetInstanceId(v string) *DescribeUserDataOutput { - s.InstanceId = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *DescribeUserDataOutput) SetUserData(v string) *DescribeUserDataOutput { - s.UserData = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_zones.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_zones.go deleted file mode 100644 index 9b3e35e5832d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_describe_zones.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDescribeZonesCommon = "DescribeZones" - -// DescribeZonesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeZonesCommon operation. The "output" return -// value will be populated with the DescribeZonesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeZonesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeZonesCommon Send returns without error. -// -// See DescribeZonesCommon for more information on using the DescribeZonesCommon -// API call, and error handling. -// -// // Example sending a request using the DescribeZonesCommonRequest method. -// req, resp := client.DescribeZonesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeZonesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDescribeZonesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeZonesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeZonesCommon for usage and error information. -func (c *ECS) DescribeZonesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DescribeZonesCommonRequest(input) - return out, req.Send() -} - -// DescribeZonesCommonWithContext is the same as DescribeZonesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeZonesCommon 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 *ECS) DescribeZonesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DescribeZonesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeZones = "DescribeZones" - -// DescribeZonesRequest generates a "volcengine/request.Request" representing the -// client's request for the DescribeZones operation. The "output" return -// value will be populated with the DescribeZonesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DescribeZonesCommon Request to send the API call to the service. -// the "output" return value is not valid until after DescribeZonesCommon Send returns without error. -// -// See DescribeZones for more information on using the DescribeZones -// API call, and error handling. -// -// // Example sending a request using the DescribeZonesRequest method. -// req, resp := client.DescribeZonesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DescribeZonesRequest(input *DescribeZonesInput) (req *request.Request, output *DescribeZonesOutput) { - op := &request.Operation{ - Name: opDescribeZones, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeZonesInput{} - } - - output = &DescribeZonesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DescribeZones API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DescribeZones for usage and error information. -func (c *ECS) DescribeZones(input *DescribeZonesInput) (*DescribeZonesOutput, error) { - req, out := c.DescribeZonesRequest(input) - return out, req.Send() -} - -// DescribeZonesWithContext is the same as DescribeZones with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeZones for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DescribeZonesWithContext(ctx volcengine.Context, input *DescribeZonesInput, opts ...request.Option) (*DescribeZonesOutput, error) { - req, out := c.DescribeZonesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DescribeZonesInput struct { - _ struct{} `type:"structure"` - - ZoneIds []*string `type:"list"` -} - -// String returns the string representation -func (s DescribeZonesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeZonesInput) GoString() string { - return s.String() -} - -// SetZoneIds sets the ZoneIds field's value. -func (s *DescribeZonesInput) SetZoneIds(v []*string) *DescribeZonesInput { - s.ZoneIds = v - return s -} - -type DescribeZonesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - Zones []*ZoneForDescribeZonesOutput `type:"list"` -} - -// String returns the string representation -func (s DescribeZonesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeZonesOutput) GoString() string { - return s.String() -} - -// SetZones sets the Zones field's value. -func (s *DescribeZonesOutput) SetZones(v []*ZoneForDescribeZonesOutput) *DescribeZonesOutput { - s.Zones = v - return s -} - -type ZoneForDescribeZonesOutput struct { - _ struct{} `type:"structure"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s ZoneForDescribeZonesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ZoneForDescribeZonesOutput) GoString() string { - return s.String() -} - -// SetZoneId sets the ZoneId field's value. -func (s *ZoneForDescribeZonesOutput) SetZoneId(v string) *ZoneForDescribeZonesOutput { - s.ZoneId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_detach_key_pair.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_detach_key_pair.go deleted file mode 100644 index fa2d40a965d3..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_detach_key_pair.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDetachKeyPairCommon = "DetachKeyPair" - -// DetachKeyPairCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DetachKeyPairCommon operation. The "output" return -// value will be populated with the DetachKeyPairCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DetachKeyPairCommon Request to send the API call to the service. -// the "output" return value is not valid until after DetachKeyPairCommon Send returns without error. -// -// See DetachKeyPairCommon for more information on using the DetachKeyPairCommon -// API call, and error handling. -// -// // Example sending a request using the DetachKeyPairCommonRequest method. -// req, resp := client.DetachKeyPairCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DetachKeyPairCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDetachKeyPairCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DetachKeyPairCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DetachKeyPairCommon for usage and error information. -func (c *ECS) DetachKeyPairCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DetachKeyPairCommonRequest(input) - return out, req.Send() -} - -// DetachKeyPairCommonWithContext is the same as DetachKeyPairCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DetachKeyPairCommon 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 *ECS) DetachKeyPairCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DetachKeyPairCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachKeyPair = "DetachKeyPair" - -// DetachKeyPairRequest generates a "volcengine/request.Request" representing the -// client's request for the DetachKeyPair operation. The "output" return -// value will be populated with the DetachKeyPairCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DetachKeyPairCommon Request to send the API call to the service. -// the "output" return value is not valid until after DetachKeyPairCommon Send returns without error. -// -// See DetachKeyPair for more information on using the DetachKeyPair -// API call, and error handling. -// -// // Example sending a request using the DetachKeyPairRequest method. -// req, resp := client.DetachKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DetachKeyPairRequest(input *DetachKeyPairInput) (req *request.Request, output *DetachKeyPairOutput) { - op := &request.Operation{ - Name: opDetachKeyPair, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DetachKeyPairInput{} - } - - output = &DetachKeyPairOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DetachKeyPair API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DetachKeyPair for usage and error information. -func (c *ECS) DetachKeyPair(input *DetachKeyPairInput) (*DetachKeyPairOutput, error) { - req, out := c.DetachKeyPairRequest(input) - return out, req.Send() -} - -// DetachKeyPairWithContext is the same as DetachKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See DetachKeyPair for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DetachKeyPairWithContext(ctx volcengine.Context, input *DetachKeyPairInput, opts ...request.Option) (*DetachKeyPairOutput, error) { - req, out := c.DetachKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DetachKeyPairInput struct { - _ struct{} `type:"structure"` - - InstanceIds []*string `type:"list"` - - KeyPairId *string `type:"string"` - - KeyPairName *string `type:"string"` -} - -// String returns the string representation -func (s DetachKeyPairInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachKeyPairInput) GoString() string { - return s.String() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DetachKeyPairInput) SetInstanceIds(v []*string) *DetachKeyPairInput { - s.InstanceIds = v - return s -} - -// SetKeyPairId sets the KeyPairId field's value. -func (s *DetachKeyPairInput) SetKeyPairId(v string) *DetachKeyPairInput { - s.KeyPairId = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *DetachKeyPairInput) SetKeyPairName(v string) *DetachKeyPairInput { - s.KeyPairName = &v - return s -} - -type DetachKeyPairOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForDetachKeyPairOutput `type:"list"` -} - -// String returns the string representation -func (s DetachKeyPairOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DetachKeyPairOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *DetachKeyPairOutput) SetOperationDetails(v []*OperationDetailForDetachKeyPairOutput) *DetachKeyPairOutput { - s.OperationDetails = v - return s -} - -type ErrorForDetachKeyPairOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForDetachKeyPairOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForDetachKeyPairOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForDetachKeyPairOutput) SetCode(v string) *ErrorForDetachKeyPairOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForDetachKeyPairOutput) SetMessage(v string) *ErrorForDetachKeyPairOutput { - s.Message = &v - return s -} - -type OperationDetailForDetachKeyPairOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForDetachKeyPairOutput `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForDetachKeyPairOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForDetachKeyPairOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForDetachKeyPairOutput) SetError(v *ErrorForDetachKeyPairOutput) *OperationDetailForDetachKeyPairOutput { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *OperationDetailForDetachKeyPairOutput) SetInstanceId(v string) *OperationDetailForDetachKeyPairOutput { - s.InstanceId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_disassociate_instances_iam_role.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_disassociate_instances_iam_role.go deleted file mode 100644 index cee14e6076e0..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_disassociate_instances_iam_role.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opDisassociateInstancesIamRoleCommon = "DisassociateInstancesIamRole" - -// DisassociateInstancesIamRoleCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the DisassociateInstancesIamRoleCommon operation. The "output" return -// value will be populated with the DisassociateInstancesIamRoleCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DisassociateInstancesIamRoleCommon Request to send the API call to the service. -// the "output" return value is not valid until after DisassociateInstancesIamRoleCommon Send returns without error. -// -// See DisassociateInstancesIamRoleCommon for more information on using the DisassociateInstancesIamRoleCommon -// API call, and error handling. -// -// // Example sending a request using the DisassociateInstancesIamRoleCommonRequest method. -// req, resp := client.DisassociateInstancesIamRoleCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DisassociateInstancesIamRoleCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opDisassociateInstancesIamRoleCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// DisassociateInstancesIamRoleCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DisassociateInstancesIamRoleCommon for usage and error information. -func (c *ECS) DisassociateInstancesIamRoleCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.DisassociateInstancesIamRoleCommonRequest(input) - return out, req.Send() -} - -// DisassociateInstancesIamRoleCommonWithContext is the same as DisassociateInstancesIamRoleCommon with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateInstancesIamRoleCommon 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 *ECS) DisassociateInstancesIamRoleCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.DisassociateInstancesIamRoleCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateInstancesIamRole = "DisassociateInstancesIamRole" - -// DisassociateInstancesIamRoleRequest generates a "volcengine/request.Request" representing the -// client's request for the DisassociateInstancesIamRole operation. The "output" return -// value will be populated with the DisassociateInstancesIamRoleCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned DisassociateInstancesIamRoleCommon Request to send the API call to the service. -// the "output" return value is not valid until after DisassociateInstancesIamRoleCommon Send returns without error. -// -// See DisassociateInstancesIamRole for more information on using the DisassociateInstancesIamRole -// API call, and error handling. -// -// // Example sending a request using the DisassociateInstancesIamRoleRequest method. -// req, resp := client.DisassociateInstancesIamRoleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) DisassociateInstancesIamRoleRequest(input *DisassociateInstancesIamRoleInput) (req *request.Request, output *DisassociateInstancesIamRoleOutput) { - op := &request.Operation{ - Name: opDisassociateInstancesIamRole, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateInstancesIamRoleInput{} - } - - output = &DisassociateInstancesIamRoleOutput{} - req = c.newRequest(op, input, output) - - return -} - -// DisassociateInstancesIamRole API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation DisassociateInstancesIamRole for usage and error information. -func (c *ECS) DisassociateInstancesIamRole(input *DisassociateInstancesIamRoleInput) (*DisassociateInstancesIamRoleOutput, error) { - req, out := c.DisassociateInstancesIamRoleRequest(input) - return out, req.Send() -} - -// DisassociateInstancesIamRoleWithContext is the same as DisassociateInstancesIamRole with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateInstancesIamRole for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) DisassociateInstancesIamRoleWithContext(ctx volcengine.Context, input *DisassociateInstancesIamRoleInput, opts ...request.Option) (*DisassociateInstancesIamRoleOutput, error) { - req, out := c.DisassociateInstancesIamRoleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type DisassociateInstancesIamRoleInput struct { - _ struct{} `type:"structure"` - - IamRoleName *string `type:"string"` - - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s DisassociateInstancesIamRoleInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateInstancesIamRoleInput) GoString() string { - return s.String() -} - -// SetIamRoleName sets the IamRoleName field's value. -func (s *DisassociateInstancesIamRoleInput) SetIamRoleName(v string) *DisassociateInstancesIamRoleInput { - s.IamRoleName = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *DisassociateInstancesIamRoleInput) SetInstanceIds(v []*string) *DisassociateInstancesIamRoleInput { - s.InstanceIds = v - return s -} - -type DisassociateInstancesIamRoleOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForDisassociateInstancesIamRoleOutput `type:"list"` -} - -// String returns the string representation -func (s DisassociateInstancesIamRoleOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s DisassociateInstancesIamRoleOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *DisassociateInstancesIamRoleOutput) SetOperationDetails(v []*OperationDetailForDisassociateInstancesIamRoleOutput) *DisassociateInstancesIamRoleOutput { - s.OperationDetails = v - return s -} - -type ErrorForDisassociateInstancesIamRoleOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForDisassociateInstancesIamRoleOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForDisassociateInstancesIamRoleOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForDisassociateInstancesIamRoleOutput) SetCode(v string) *ErrorForDisassociateInstancesIamRoleOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForDisassociateInstancesIamRoleOutput) SetMessage(v string) *ErrorForDisassociateInstancesIamRoleOutput { - s.Message = &v - return s -} - -type OperationDetailForDisassociateInstancesIamRoleOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForDisassociateInstancesIamRoleOutput `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForDisassociateInstancesIamRoleOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForDisassociateInstancesIamRoleOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForDisassociateInstancesIamRoleOutput) SetError(v *ErrorForDisassociateInstancesIamRoleOutput) *OperationDetailForDisassociateInstancesIamRoleOutput { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *OperationDetailForDisassociateInstancesIamRoleOutput) SetInstanceId(v string) *OperationDetailForDisassociateInstancesIamRoleOutput { - s.InstanceId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_export_image.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_export_image.go deleted file mode 100644 index e15c82124b65..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_export_image.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opExportImageCommon = "ExportImage" - -// ExportImageCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ExportImageCommon operation. The "output" return -// value will be populated with the ExportImageCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ExportImageCommon Request to send the API call to the service. -// the "output" return value is not valid until after ExportImageCommon Send returns without error. -// -// See ExportImageCommon for more information on using the ExportImageCommon -// API call, and error handling. -// -// // Example sending a request using the ExportImageCommonRequest method. -// req, resp := client.ExportImageCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ExportImageCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opExportImageCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ExportImageCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ExportImageCommon for usage and error information. -func (c *ECS) ExportImageCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ExportImageCommonRequest(input) - return out, req.Send() -} - -// ExportImageCommonWithContext is the same as ExportImageCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ExportImageCommon 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 *ECS) ExportImageCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ExportImageCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opExportImage = "ExportImage" - -// ExportImageRequest generates a "volcengine/request.Request" representing the -// client's request for the ExportImage operation. The "output" return -// value will be populated with the ExportImageCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ExportImageCommon Request to send the API call to the service. -// the "output" return value is not valid until after ExportImageCommon Send returns without error. -// -// See ExportImage for more information on using the ExportImage -// API call, and error handling. -// -// // Example sending a request using the ExportImageRequest method. -// req, resp := client.ExportImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ExportImageRequest(input *ExportImageInput) (req *request.Request, output *ExportImageOutput) { - op := &request.Operation{ - Name: opExportImage, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ExportImageInput{} - } - - output = &ExportImageOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ExportImage API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ExportImage for usage and error information. -func (c *ECS) ExportImage(input *ExportImageInput) (*ExportImageOutput, error) { - req, out := c.ExportImageRequest(input) - return out, req.Send() -} - -// ExportImageWithContext is the same as ExportImage with the addition of -// the ability to pass a context and additional request options. -// -// See ExportImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ExportImageWithContext(ctx volcengine.Context, input *ExportImageInput, opts ...request.Option) (*ExportImageOutput, error) { - req, out := c.ExportImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ExportImageInput struct { - _ struct{} `type:"structure"` - - ImageId *string `type:"string"` - - TOSBucket *string `type:"string"` - - TOSPrefix *string `type:"string"` -} - -// String returns the string representation -func (s ExportImageInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportImageInput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *ExportImageInput) SetImageId(v string) *ExportImageInput { - s.ImageId = &v - return s -} - -// SetTOSBucket sets the TOSBucket field's value. -func (s *ExportImageInput) SetTOSBucket(v string) *ExportImageInput { - s.TOSBucket = &v - return s -} - -// SetTOSPrefix sets the TOSPrefix field's value. -func (s *ExportImageInput) SetTOSPrefix(v string) *ExportImageInput { - s.TOSPrefix = &v - return s -} - -type ExportImageOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - TaskId *string `type:"string"` -} - -// String returns the string representation -func (s ExportImageOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ExportImageOutput) GoString() string { - return s.String() -} - -// SetTaskId sets the TaskId field's value. -func (s *ExportImageOutput) SetTaskId(v string) *ExportImageOutput { - s.TaskId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_import_image.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_import_image.go deleted file mode 100644 index 6d1aedc69750..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_import_image.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opImportImageCommon = "ImportImage" - -// ImportImageCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ImportImageCommon operation. The "output" return -// value will be populated with the ImportImageCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ImportImageCommon Request to send the API call to the service. -// the "output" return value is not valid until after ImportImageCommon Send returns without error. -// -// See ImportImageCommon for more information on using the ImportImageCommon -// API call, and error handling. -// -// // Example sending a request using the ImportImageCommonRequest method. -// req, resp := client.ImportImageCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ImportImageCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opImportImageCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ImportImageCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ImportImageCommon for usage and error information. -func (c *ECS) ImportImageCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ImportImageCommonRequest(input) - return out, req.Send() -} - -// ImportImageCommonWithContext is the same as ImportImageCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ImportImageCommon 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 *ECS) ImportImageCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ImportImageCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportImage = "ImportImage" - -// ImportImageRequest generates a "volcengine/request.Request" representing the -// client's request for the ImportImage operation. The "output" return -// value will be populated with the ImportImageCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ImportImageCommon Request to send the API call to the service. -// the "output" return value is not valid until after ImportImageCommon Send returns without error. -// -// See ImportImage for more information on using the ImportImage -// API call, and error handling. -// -// // Example sending a request using the ImportImageRequest method. -// req, resp := client.ImportImageRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ImportImageRequest(input *ImportImageInput) (req *request.Request, output *ImportImageOutput) { - op := &request.Operation{ - Name: opImportImage, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ImportImageInput{} - } - - output = &ImportImageOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ImportImage API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ImportImage for usage and error information. -func (c *ECS) ImportImage(input *ImportImageInput) (*ImportImageOutput, error) { - req, out := c.ImportImageRequest(input) - return out, req.Send() -} - -// ImportImageWithContext is the same as ImportImage with the addition of -// the ability to pass a context and additional request options. -// -// See ImportImage for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ImportImageWithContext(ctx volcengine.Context, input *ImportImageInput, opts ...request.Option) (*ImportImageOutput, error) { - req, out := c.ImportImageRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ImportImageInput struct { - _ struct{} `type:"structure"` - - Architecture *string `type:"string"` - - BootMode *string `type:"string"` - - Description *string `type:"string"` - - ImageName *string `type:"string"` - - OsType *string `type:"string"` - - Platform *string `type:"string"` - - PlatformVersion *string `type:"string"` - - ProjectName *string `type:"string"` - - Url *string `type:"string"` -} - -// String returns the string representation -func (s ImportImageInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportImageInput) GoString() string { - return s.String() -} - -// SetArchitecture sets the Architecture field's value. -func (s *ImportImageInput) SetArchitecture(v string) *ImportImageInput { - s.Architecture = &v - return s -} - -// SetBootMode sets the BootMode field's value. -func (s *ImportImageInput) SetBootMode(v string) *ImportImageInput { - s.BootMode = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ImportImageInput) SetDescription(v string) *ImportImageInput { - s.Description = &v - return s -} - -// SetImageName sets the ImageName field's value. -func (s *ImportImageInput) SetImageName(v string) *ImportImageInput { - s.ImageName = &v - return s -} - -// SetOsType sets the OsType field's value. -func (s *ImportImageInput) SetOsType(v string) *ImportImageInput { - s.OsType = &v - return s -} - -// SetPlatform sets the Platform field's value. -func (s *ImportImageInput) SetPlatform(v string) *ImportImageInput { - s.Platform = &v - return s -} - -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *ImportImageInput) SetPlatformVersion(v string) *ImportImageInput { - s.PlatformVersion = &v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *ImportImageInput) SetProjectName(v string) *ImportImageInput { - s.ProjectName = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *ImportImageInput) SetUrl(v string) *ImportImageInput { - s.Url = &v - return s -} - -type ImportImageOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - ImageId *string `type:"string"` -} - -// String returns the string representation -func (s ImportImageOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportImageOutput) GoString() string { - return s.String() -} - -// SetImageId sets the ImageId field's value. -func (s *ImportImageOutput) SetImageId(v string) *ImportImageOutput { - s.ImageId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_import_key_pair.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_import_key_pair.go deleted file mode 100644 index 73d77c56a690..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_import_key_pair.go +++ /dev/null @@ -1,218 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opImportKeyPairCommon = "ImportKeyPair" - -// ImportKeyPairCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ImportKeyPairCommon operation. The "output" return -// value will be populated with the ImportKeyPairCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ImportKeyPairCommon Request to send the API call to the service. -// the "output" return value is not valid until after ImportKeyPairCommon Send returns without error. -// -// See ImportKeyPairCommon for more information on using the ImportKeyPairCommon -// API call, and error handling. -// -// // Example sending a request using the ImportKeyPairCommonRequest method. -// req, resp := client.ImportKeyPairCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ImportKeyPairCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opImportKeyPairCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ImportKeyPairCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ImportKeyPairCommon for usage and error information. -func (c *ECS) ImportKeyPairCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ImportKeyPairCommonRequest(input) - return out, req.Send() -} - -// ImportKeyPairCommonWithContext is the same as ImportKeyPairCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ImportKeyPairCommon 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 *ECS) ImportKeyPairCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ImportKeyPairCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opImportKeyPair = "ImportKeyPair" - -// ImportKeyPairRequest generates a "volcengine/request.Request" representing the -// client's request for the ImportKeyPair operation. The "output" return -// value will be populated with the ImportKeyPairCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ImportKeyPairCommon Request to send the API call to the service. -// the "output" return value is not valid until after ImportKeyPairCommon Send returns without error. -// -// See ImportKeyPair for more information on using the ImportKeyPair -// API call, and error handling. -// -// // Example sending a request using the ImportKeyPairRequest method. -// req, resp := client.ImportKeyPairRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ImportKeyPairRequest(input *ImportKeyPairInput) (req *request.Request, output *ImportKeyPairOutput) { - op := &request.Operation{ - Name: opImportKeyPair, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ImportKeyPairInput{} - } - - output = &ImportKeyPairOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ImportKeyPair API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ImportKeyPair for usage and error information. -func (c *ECS) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, error) { - req, out := c.ImportKeyPairRequest(input) - return out, req.Send() -} - -// ImportKeyPairWithContext is the same as ImportKeyPair with the addition of -// the ability to pass a context and additional request options. -// -// See ImportKeyPair for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ImportKeyPairWithContext(ctx volcengine.Context, input *ImportKeyPairInput, opts ...request.Option) (*ImportKeyPairOutput, error) { - req, out := c.ImportKeyPairRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ImportKeyPairInput struct { - _ struct{} `type:"structure"` - - Description *string `type:"string"` - - KeyPairName *string `type:"string"` - - PublicKey *string `type:"string"` -} - -// String returns the string representation -func (s ImportKeyPairInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportKeyPairInput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ImportKeyPairInput) SetDescription(v string) *ImportKeyPairInput { - s.Description = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *ImportKeyPairInput) SetKeyPairName(v string) *ImportKeyPairInput { - s.KeyPairName = &v - return s -} - -// SetPublicKey sets the PublicKey field's value. -func (s *ImportKeyPairInput) SetPublicKey(v string) *ImportKeyPairInput { - s.PublicKey = &v - return s -} - -type ImportKeyPairOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - FingerPrint *string `type:"string"` - - KeyPairId *string `type:"string"` - - KeyPairName *string `type:"string"` -} - -// String returns the string representation -func (s ImportKeyPairOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ImportKeyPairOutput) GoString() string { - return s.String() -} - -// SetFingerPrint sets the FingerPrint field's value. -func (s *ImportKeyPairOutput) SetFingerPrint(v string) *ImportKeyPairOutput { - s.FingerPrint = &v - return s -} - -// SetKeyPairId sets the KeyPairId field's value. -func (s *ImportKeyPairOutput) SetKeyPairId(v string) *ImportKeyPairOutput { - s.KeyPairId = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *ImportKeyPairOutput) SetKeyPairName(v string) *ImportKeyPairOutput { - s.KeyPairName = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_deployment_set_attribute.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_deployment_set_attribute.go deleted file mode 100644 index 502ab8867a34..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_deployment_set_attribute.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyDeploymentSetAttributeCommon = "ModifyDeploymentSetAttribute" - -// ModifyDeploymentSetAttributeCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyDeploymentSetAttributeCommon operation. The "output" return -// value will be populated with the ModifyDeploymentSetAttributeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyDeploymentSetAttributeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyDeploymentSetAttributeCommon Send returns without error. -// -// See ModifyDeploymentSetAttributeCommon for more information on using the ModifyDeploymentSetAttributeCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyDeploymentSetAttributeCommonRequest method. -// req, resp := client.ModifyDeploymentSetAttributeCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyDeploymentSetAttributeCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyDeploymentSetAttributeCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyDeploymentSetAttributeCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyDeploymentSetAttributeCommon for usage and error information. -func (c *ECS) ModifyDeploymentSetAttributeCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyDeploymentSetAttributeCommonRequest(input) - return out, req.Send() -} - -// ModifyDeploymentSetAttributeCommonWithContext is the same as ModifyDeploymentSetAttributeCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyDeploymentSetAttributeCommon 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 *ECS) ModifyDeploymentSetAttributeCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyDeploymentSetAttributeCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyDeploymentSetAttribute = "ModifyDeploymentSetAttribute" - -// ModifyDeploymentSetAttributeRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyDeploymentSetAttribute operation. The "output" return -// value will be populated with the ModifyDeploymentSetAttributeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyDeploymentSetAttributeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyDeploymentSetAttributeCommon Send returns without error. -// -// See ModifyDeploymentSetAttribute for more information on using the ModifyDeploymentSetAttribute -// API call, and error handling. -// -// // Example sending a request using the ModifyDeploymentSetAttributeRequest method. -// req, resp := client.ModifyDeploymentSetAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyDeploymentSetAttributeRequest(input *ModifyDeploymentSetAttributeInput) (req *request.Request, output *ModifyDeploymentSetAttributeOutput) { - op := &request.Operation{ - Name: opModifyDeploymentSetAttribute, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyDeploymentSetAttributeInput{} - } - - output = &ModifyDeploymentSetAttributeOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyDeploymentSetAttribute API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyDeploymentSetAttribute for usage and error information. -func (c *ECS) ModifyDeploymentSetAttribute(input *ModifyDeploymentSetAttributeInput) (*ModifyDeploymentSetAttributeOutput, error) { - req, out := c.ModifyDeploymentSetAttributeRequest(input) - return out, req.Send() -} - -// ModifyDeploymentSetAttributeWithContext is the same as ModifyDeploymentSetAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyDeploymentSetAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ModifyDeploymentSetAttributeWithContext(ctx volcengine.Context, input *ModifyDeploymentSetAttributeInput, opts ...request.Option) (*ModifyDeploymentSetAttributeOutput, error) { - req, out := c.ModifyDeploymentSetAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyDeploymentSetAttributeInput struct { - _ struct{} `type:"structure"` - - DeploymentSetId *string `type:"string"` - - DeploymentSetName *string `type:"string"` - - Description *string `type:"string"` -} - -// String returns the string representation -func (s ModifyDeploymentSetAttributeInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDeploymentSetAttributeInput) GoString() string { - return s.String() -} - -// SetDeploymentSetId sets the DeploymentSetId field's value. -func (s *ModifyDeploymentSetAttributeInput) SetDeploymentSetId(v string) *ModifyDeploymentSetAttributeInput { - s.DeploymentSetId = &v - return s -} - -// SetDeploymentSetName sets the DeploymentSetName field's value. -func (s *ModifyDeploymentSetAttributeInput) SetDeploymentSetName(v string) *ModifyDeploymentSetAttributeInput { - s.DeploymentSetName = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModifyDeploymentSetAttributeInput) SetDescription(v string) *ModifyDeploymentSetAttributeInput { - s.Description = &v - return s -} - -type ModifyDeploymentSetAttributeOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s ModifyDeploymentSetAttributeOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyDeploymentSetAttributeOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_image_attribute.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_image_attribute.go deleted file mode 100644 index 2931d3f30d39..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_image_attribute.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyImageAttributeCommon = "ModifyImageAttribute" - -// ModifyImageAttributeCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyImageAttributeCommon operation. The "output" return -// value will be populated with the ModifyImageAttributeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyImageAttributeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyImageAttributeCommon Send returns without error. -// -// See ModifyImageAttributeCommon for more information on using the ModifyImageAttributeCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyImageAttributeCommonRequest method. -// req, resp := client.ModifyImageAttributeCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyImageAttributeCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyImageAttributeCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyImageAttributeCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyImageAttributeCommon for usage and error information. -func (c *ECS) ModifyImageAttributeCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyImageAttributeCommonRequest(input) - return out, req.Send() -} - -// ModifyImageAttributeCommonWithContext is the same as ModifyImageAttributeCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyImageAttributeCommon 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 *ECS) ModifyImageAttributeCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyImageAttributeCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyImageAttribute = "ModifyImageAttribute" - -// ModifyImageAttributeRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyImageAttribute operation. The "output" return -// value will be populated with the ModifyImageAttributeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyImageAttributeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyImageAttributeCommon Send returns without error. -// -// See ModifyImageAttribute for more information on using the ModifyImageAttribute -// API call, and error handling. -// -// // Example sending a request using the ModifyImageAttributeRequest method. -// req, resp := client.ModifyImageAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyImageAttributeRequest(input *ModifyImageAttributeInput) (req *request.Request, output *ModifyImageAttributeOutput) { - op := &request.Operation{ - Name: opModifyImageAttribute, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyImageAttributeInput{} - } - - output = &ModifyImageAttributeOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyImageAttribute API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyImageAttribute for usage and error information. -func (c *ECS) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) { - req, out := c.ModifyImageAttributeRequest(input) - return out, req.Send() -} - -// ModifyImageAttributeWithContext is the same as ModifyImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyImageAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ModifyImageAttributeWithContext(ctx volcengine.Context, input *ModifyImageAttributeInput, opts ...request.Option) (*ModifyImageAttributeOutput, error) { - req, out := c.ModifyImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyImageAttributeInput struct { - _ struct{} `type:"structure"` - - BootMode *string `type:"string"` - - Description *string `type:"string"` - - ImageId *string `type:"string"` - - ImageName *string `type:"string"` -} - -// String returns the string representation -func (s ModifyImageAttributeInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyImageAttributeInput) GoString() string { - return s.String() -} - -// SetBootMode sets the BootMode field's value. -func (s *ModifyImageAttributeInput) SetBootMode(v string) *ModifyImageAttributeInput { - s.BootMode = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ModifyImageAttributeInput) SetDescription(v string) *ModifyImageAttributeInput { - s.Description = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ModifyImageAttributeInput) SetImageId(v string) *ModifyImageAttributeInput { - s.ImageId = &v - return s -} - -// SetImageName sets the ImageName field's value. -func (s *ModifyImageAttributeInput) SetImageName(v string) *ModifyImageAttributeInput { - s.ImageName = &v - return s -} - -type ModifyImageAttributeOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s ModifyImageAttributeOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyImageAttributeOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_image_share_permission.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_image_share_permission.go deleted file mode 100644 index 2e2784e24e18..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_image_share_permission.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyImageSharePermissionCommon = "ModifyImageSharePermission" - -// ModifyImageSharePermissionCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyImageSharePermissionCommon operation. The "output" return -// value will be populated with the ModifyImageSharePermissionCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyImageSharePermissionCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyImageSharePermissionCommon Send returns without error. -// -// See ModifyImageSharePermissionCommon for more information on using the ModifyImageSharePermissionCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyImageSharePermissionCommonRequest method. -// req, resp := client.ModifyImageSharePermissionCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyImageSharePermissionCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyImageSharePermissionCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyImageSharePermissionCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyImageSharePermissionCommon for usage and error information. -func (c *ECS) ModifyImageSharePermissionCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyImageSharePermissionCommonRequest(input) - return out, req.Send() -} - -// ModifyImageSharePermissionCommonWithContext is the same as ModifyImageSharePermissionCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyImageSharePermissionCommon 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 *ECS) ModifyImageSharePermissionCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyImageSharePermissionCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyImageSharePermission = "ModifyImageSharePermission" - -// ModifyImageSharePermissionRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyImageSharePermission operation. The "output" return -// value will be populated with the ModifyImageSharePermissionCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyImageSharePermissionCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyImageSharePermissionCommon Send returns without error. -// -// See ModifyImageSharePermission for more information on using the ModifyImageSharePermission -// API call, and error handling. -// -// // Example sending a request using the ModifyImageSharePermissionRequest method. -// req, resp := client.ModifyImageSharePermissionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyImageSharePermissionRequest(input *ModifyImageSharePermissionInput) (req *request.Request, output *ModifyImageSharePermissionOutput) { - op := &request.Operation{ - Name: opModifyImageSharePermission, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyImageSharePermissionInput{} - } - - output = &ModifyImageSharePermissionOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyImageSharePermission API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyImageSharePermission for usage and error information. -func (c *ECS) ModifyImageSharePermission(input *ModifyImageSharePermissionInput) (*ModifyImageSharePermissionOutput, error) { - req, out := c.ModifyImageSharePermissionRequest(input) - return out, req.Send() -} - -// ModifyImageSharePermissionWithContext is the same as ModifyImageSharePermission with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyImageSharePermission for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ModifyImageSharePermissionWithContext(ctx volcengine.Context, input *ModifyImageSharePermissionInput, opts ...request.Option) (*ModifyImageSharePermissionOutput, error) { - req, out := c.ModifyImageSharePermissionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyImageSharePermissionInput struct { - _ struct{} `type:"structure"` - - AddAccounts []*string `type:"list"` - - ImageId *string `type:"string"` - - RemoveAccounts []*string `type:"list"` -} - -// String returns the string representation -func (s ModifyImageSharePermissionInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyImageSharePermissionInput) GoString() string { - return s.String() -} - -// SetAddAccounts sets the AddAccounts field's value. -func (s *ModifyImageSharePermissionInput) SetAddAccounts(v []*string) *ModifyImageSharePermissionInput { - s.AddAccounts = v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ModifyImageSharePermissionInput) SetImageId(v string) *ModifyImageSharePermissionInput { - s.ImageId = &v - return s -} - -// SetRemoveAccounts sets the RemoveAccounts field's value. -func (s *ModifyImageSharePermissionInput) SetRemoveAccounts(v []*string) *ModifyImageSharePermissionInput { - s.RemoveAccounts = v - return s -} - -type ModifyImageSharePermissionOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s ModifyImageSharePermissionOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyImageSharePermissionOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_attribute.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_attribute.go deleted file mode 100644 index 530562fee61f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_attribute.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyInstanceAttributeCommon = "ModifyInstanceAttribute" - -// ModifyInstanceAttributeCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyInstanceAttributeCommon operation. The "output" return -// value will be populated with the ModifyInstanceAttributeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyInstanceAttributeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyInstanceAttributeCommon Send returns without error. -// -// See ModifyInstanceAttributeCommon for more information on using the ModifyInstanceAttributeCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyInstanceAttributeCommonRequest method. -// req, resp := client.ModifyInstanceAttributeCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyInstanceAttributeCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyInstanceAttributeCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyInstanceAttributeCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyInstanceAttributeCommon for usage and error information. -func (c *ECS) ModifyInstanceAttributeCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyInstanceAttributeCommonRequest(input) - return out, req.Send() -} - -// ModifyInstanceAttributeCommonWithContext is the same as ModifyInstanceAttributeCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceAttributeCommon 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 *ECS) ModifyInstanceAttributeCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyInstanceAttributeCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstanceAttribute = "ModifyInstanceAttribute" - -// ModifyInstanceAttributeRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyInstanceAttribute operation. The "output" return -// value will be populated with the ModifyInstanceAttributeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyInstanceAttributeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyInstanceAttributeCommon Send returns without error. -// -// See ModifyInstanceAttribute for more information on using the ModifyInstanceAttribute -// API call, and error handling. -// -// // Example sending a request using the ModifyInstanceAttributeRequest method. -// req, resp := client.ModifyInstanceAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput) (req *request.Request, output *ModifyInstanceAttributeOutput) { - op := &request.Operation{ - Name: opModifyInstanceAttribute, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceAttributeInput{} - } - - output = &ModifyInstanceAttributeOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyInstanceAttribute API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyInstanceAttribute for usage and error information. -func (c *ECS) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*ModifyInstanceAttributeOutput, error) { - req, out := c.ModifyInstanceAttributeRequest(input) - return out, req.Send() -} - -// ModifyInstanceAttributeWithContext is the same as ModifyInstanceAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ModifyInstanceAttributeWithContext(ctx volcengine.Context, input *ModifyInstanceAttributeInput, opts ...request.Option) (*ModifyInstanceAttributeOutput, error) { - req, out := c.ModifyInstanceAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyInstanceAttributeInput struct { - _ struct{} `type:"structure"` - - Description *string `type:"string"` - - InstanceId *string `type:"string"` - - InstanceName *string `type:"string"` - - Password *string `type:"string"` - - UserData *string `type:"string"` -} - -// String returns the string representation -func (s ModifyInstanceAttributeInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceAttributeInput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ModifyInstanceAttributeInput) SetDescription(v string) *ModifyInstanceAttributeInput { - s.Description = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ModifyInstanceAttributeInput) SetInstanceId(v string) *ModifyInstanceAttributeInput { - s.InstanceId = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *ModifyInstanceAttributeInput) SetInstanceName(v string) *ModifyInstanceAttributeInput { - s.InstanceName = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *ModifyInstanceAttributeInput) SetPassword(v string) *ModifyInstanceAttributeInput { - s.Password = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ModifyInstanceAttributeInput) SetUserData(v string) *ModifyInstanceAttributeInput { - s.UserData = &v - return s -} - -type ModifyInstanceAttributeOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s ModifyInstanceAttributeOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceAttributeOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_charge_type.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_charge_type.go deleted file mode 100644 index 12e143f7b5bc..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_charge_type.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyInstanceChargeTypeCommon = "ModifyInstanceChargeType" - -// ModifyInstanceChargeTypeCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyInstanceChargeTypeCommon operation. The "output" return -// value will be populated with the ModifyInstanceChargeTypeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyInstanceChargeTypeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyInstanceChargeTypeCommon Send returns without error. -// -// See ModifyInstanceChargeTypeCommon for more information on using the ModifyInstanceChargeTypeCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyInstanceChargeTypeCommonRequest method. -// req, resp := client.ModifyInstanceChargeTypeCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyInstanceChargeTypeCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyInstanceChargeTypeCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyInstanceChargeTypeCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyInstanceChargeTypeCommon for usage and error information. -func (c *ECS) ModifyInstanceChargeTypeCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyInstanceChargeTypeCommonRequest(input) - return out, req.Send() -} - -// ModifyInstanceChargeTypeCommonWithContext is the same as ModifyInstanceChargeTypeCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceChargeTypeCommon 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 *ECS) ModifyInstanceChargeTypeCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyInstanceChargeTypeCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstanceChargeType = "ModifyInstanceChargeType" - -// ModifyInstanceChargeTypeRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyInstanceChargeType operation. The "output" return -// value will be populated with the ModifyInstanceChargeTypeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyInstanceChargeTypeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyInstanceChargeTypeCommon Send returns without error. -// -// See ModifyInstanceChargeType for more information on using the ModifyInstanceChargeType -// API call, and error handling. -// -// // Example sending a request using the ModifyInstanceChargeTypeRequest method. -// req, resp := client.ModifyInstanceChargeTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyInstanceChargeTypeRequest(input *ModifyInstanceChargeTypeInput) (req *request.Request, output *ModifyInstanceChargeTypeOutput) { - op := &request.Operation{ - Name: opModifyInstanceChargeType, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceChargeTypeInput{} - } - - output = &ModifyInstanceChargeTypeOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyInstanceChargeType API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyInstanceChargeType for usage and error information. -func (c *ECS) ModifyInstanceChargeType(input *ModifyInstanceChargeTypeInput) (*ModifyInstanceChargeTypeOutput, error) { - req, out := c.ModifyInstanceChargeTypeRequest(input) - return out, req.Send() -} - -// ModifyInstanceChargeTypeWithContext is the same as ModifyInstanceChargeType with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceChargeType for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ModifyInstanceChargeTypeWithContext(ctx volcengine.Context, input *ModifyInstanceChargeTypeInput, opts ...request.Option) (*ModifyInstanceChargeTypeOutput, error) { - req, out := c.ModifyInstanceChargeTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyInstanceChargeTypeInput struct { - _ struct{} `type:"structure"` - - AutoPay *bool `type:"boolean"` - - ClientToken *string `type:"string"` - - IncludeDataVolumes *bool `type:"boolean"` - - InstanceChargeType *string `type:"string"` - - InstanceIds []*string `type:"list"` - - Period *int32 `type:"int32"` - - PeriodUnit *string `type:"string"` -} - -// String returns the string representation -func (s ModifyInstanceChargeTypeInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceChargeTypeInput) GoString() string { - return s.String() -} - -// SetAutoPay sets the AutoPay field's value. -func (s *ModifyInstanceChargeTypeInput) SetAutoPay(v bool) *ModifyInstanceChargeTypeInput { - s.AutoPay = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *ModifyInstanceChargeTypeInput) SetClientToken(v string) *ModifyInstanceChargeTypeInput { - s.ClientToken = &v - return s -} - -// SetIncludeDataVolumes sets the IncludeDataVolumes field's value. -func (s *ModifyInstanceChargeTypeInput) SetIncludeDataVolumes(v bool) *ModifyInstanceChargeTypeInput { - s.IncludeDataVolumes = &v - return s -} - -// SetInstanceChargeType sets the InstanceChargeType field's value. -func (s *ModifyInstanceChargeTypeInput) SetInstanceChargeType(v string) *ModifyInstanceChargeTypeInput { - s.InstanceChargeType = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *ModifyInstanceChargeTypeInput) SetInstanceIds(v []*string) *ModifyInstanceChargeTypeInput { - s.InstanceIds = v - return s -} - -// SetPeriod sets the Period field's value. -func (s *ModifyInstanceChargeTypeInput) SetPeriod(v int32) *ModifyInstanceChargeTypeInput { - s.Period = &v - return s -} - -// SetPeriodUnit sets the PeriodUnit field's value. -func (s *ModifyInstanceChargeTypeInput) SetPeriodUnit(v string) *ModifyInstanceChargeTypeInput { - s.PeriodUnit = &v - return s -} - -type ModifyInstanceChargeTypeOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OrderId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyInstanceChargeTypeOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceChargeTypeOutput) GoString() string { - return s.String() -} - -// SetOrderId sets the OrderId field's value. -func (s *ModifyInstanceChargeTypeOutput) SetOrderId(v string) *ModifyInstanceChargeTypeOutput { - s.OrderId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_deployment.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_deployment.go deleted file mode 100644 index b4f6b0a83e94..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_deployment.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyInstanceDeploymentCommon = "ModifyInstanceDeployment" - -// ModifyInstanceDeploymentCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyInstanceDeploymentCommon operation. The "output" return -// value will be populated with the ModifyInstanceDeploymentCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyInstanceDeploymentCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyInstanceDeploymentCommon Send returns without error. -// -// See ModifyInstanceDeploymentCommon for more information on using the ModifyInstanceDeploymentCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyInstanceDeploymentCommonRequest method. -// req, resp := client.ModifyInstanceDeploymentCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyInstanceDeploymentCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyInstanceDeploymentCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyInstanceDeploymentCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyInstanceDeploymentCommon for usage and error information. -func (c *ECS) ModifyInstanceDeploymentCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyInstanceDeploymentCommonRequest(input) - return out, req.Send() -} - -// ModifyInstanceDeploymentCommonWithContext is the same as ModifyInstanceDeploymentCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceDeploymentCommon 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 *ECS) ModifyInstanceDeploymentCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyInstanceDeploymentCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstanceDeployment = "ModifyInstanceDeployment" - -// ModifyInstanceDeploymentRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyInstanceDeployment operation. The "output" return -// value will be populated with the ModifyInstanceDeploymentCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyInstanceDeploymentCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyInstanceDeploymentCommon Send returns without error. -// -// See ModifyInstanceDeployment for more information on using the ModifyInstanceDeployment -// API call, and error handling. -// -// // Example sending a request using the ModifyInstanceDeploymentRequest method. -// req, resp := client.ModifyInstanceDeploymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyInstanceDeploymentRequest(input *ModifyInstanceDeploymentInput) (req *request.Request, output *ModifyInstanceDeploymentOutput) { - op := &request.Operation{ - Name: opModifyInstanceDeployment, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceDeploymentInput{} - } - - output = &ModifyInstanceDeploymentOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyInstanceDeployment API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyInstanceDeployment for usage and error information. -func (c *ECS) ModifyInstanceDeployment(input *ModifyInstanceDeploymentInput) (*ModifyInstanceDeploymentOutput, error) { - req, out := c.ModifyInstanceDeploymentRequest(input) - return out, req.Send() -} - -// ModifyInstanceDeploymentWithContext is the same as ModifyInstanceDeployment with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceDeployment for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ModifyInstanceDeploymentWithContext(ctx volcengine.Context, input *ModifyInstanceDeploymentInput, opts ...request.Option) (*ModifyInstanceDeploymentOutput, error) { - req, out := c.ModifyInstanceDeploymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyInstanceDeploymentInput struct { - _ struct{} `type:"structure"` - - DeploymentSetId *string `type:"string"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyInstanceDeploymentInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceDeploymentInput) GoString() string { - return s.String() -} - -// SetDeploymentSetId sets the DeploymentSetId field's value. -func (s *ModifyInstanceDeploymentInput) SetDeploymentSetId(v string) *ModifyInstanceDeploymentInput { - s.DeploymentSetId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ModifyInstanceDeploymentInput) SetInstanceId(v string) *ModifyInstanceDeploymentInput { - s.InstanceId = &v - return s -} - -type ModifyInstanceDeploymentOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s ModifyInstanceDeploymentOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceDeploymentOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_spec.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_spec.go deleted file mode 100644 index 659e11bd8db5..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_instance_spec.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyInstanceSpecCommon = "ModifyInstanceSpec" - -// ModifyInstanceSpecCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyInstanceSpecCommon operation. The "output" return -// value will be populated with the ModifyInstanceSpecCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyInstanceSpecCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyInstanceSpecCommon Send returns without error. -// -// See ModifyInstanceSpecCommon for more information on using the ModifyInstanceSpecCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyInstanceSpecCommonRequest method. -// req, resp := client.ModifyInstanceSpecCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyInstanceSpecCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyInstanceSpecCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyInstanceSpecCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyInstanceSpecCommon for usage and error information. -func (c *ECS) ModifyInstanceSpecCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyInstanceSpecCommonRequest(input) - return out, req.Send() -} - -// ModifyInstanceSpecCommonWithContext is the same as ModifyInstanceSpecCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceSpecCommon 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 *ECS) ModifyInstanceSpecCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyInstanceSpecCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyInstanceSpec = "ModifyInstanceSpec" - -// ModifyInstanceSpecRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyInstanceSpec operation. The "output" return -// value will be populated with the ModifyInstanceSpecCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyInstanceSpecCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyInstanceSpecCommon Send returns without error. -// -// See ModifyInstanceSpec for more information on using the ModifyInstanceSpec -// API call, and error handling. -// -// // Example sending a request using the ModifyInstanceSpecRequest method. -// req, resp := client.ModifyInstanceSpecRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyInstanceSpecRequest(input *ModifyInstanceSpecInput) (req *request.Request, output *ModifyInstanceSpecOutput) { - op := &request.Operation{ - Name: opModifyInstanceSpec, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyInstanceSpecInput{} - } - - output = &ModifyInstanceSpecOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyInstanceSpec API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyInstanceSpec for usage and error information. -func (c *ECS) ModifyInstanceSpec(input *ModifyInstanceSpecInput) (*ModifyInstanceSpecOutput, error) { - req, out := c.ModifyInstanceSpecRequest(input) - return out, req.Send() -} - -// ModifyInstanceSpecWithContext is the same as ModifyInstanceSpec with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyInstanceSpec for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ModifyInstanceSpecWithContext(ctx volcengine.Context, input *ModifyInstanceSpecInput, opts ...request.Option) (*ModifyInstanceSpecOutput, error) { - req, out := c.ModifyInstanceSpecRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyInstanceSpecInput struct { - _ struct{} `type:"structure"` - - ClientToken *string `type:"string"` - - InstanceId *string `type:"string"` - - InstanceType *string `type:"string"` -} - -// String returns the string representation -func (s ModifyInstanceSpecInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceSpecInput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *ModifyInstanceSpecInput) SetClientToken(v string) *ModifyInstanceSpecInput { - s.ClientToken = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ModifyInstanceSpecInput) SetInstanceId(v string) *ModifyInstanceSpecInput { - s.InstanceId = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *ModifyInstanceSpecInput) SetInstanceType(v string) *ModifyInstanceSpecInput { - s.InstanceType = &v - return s -} - -type ModifyInstanceSpecOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - InstanceId *string `type:"string"` - - OrderId *string `type:"string"` -} - -// String returns the string representation -func (s ModifyInstanceSpecOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyInstanceSpecOutput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ModifyInstanceSpecOutput) SetInstanceId(v string) *ModifyInstanceSpecOutput { - s.InstanceId = &v - return s -} - -// SetOrderId sets the OrderId field's value. -func (s *ModifyInstanceSpecOutput) SetOrderId(v string) *ModifyInstanceSpecOutput { - s.OrderId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_key_pair_attribute.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_key_pair_attribute.go deleted file mode 100644 index a1e5de791593..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_modify_key_pair_attribute.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opModifyKeyPairAttributeCommon = "ModifyKeyPairAttribute" - -// ModifyKeyPairAttributeCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyKeyPairAttributeCommon operation. The "output" return -// value will be populated with the ModifyKeyPairAttributeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyKeyPairAttributeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyKeyPairAttributeCommon Send returns without error. -// -// See ModifyKeyPairAttributeCommon for more information on using the ModifyKeyPairAttributeCommon -// API call, and error handling. -// -// // Example sending a request using the ModifyKeyPairAttributeCommonRequest method. -// req, resp := client.ModifyKeyPairAttributeCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyKeyPairAttributeCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opModifyKeyPairAttributeCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyKeyPairAttributeCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyKeyPairAttributeCommon for usage and error information. -func (c *ECS) ModifyKeyPairAttributeCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ModifyKeyPairAttributeCommonRequest(input) - return out, req.Send() -} - -// ModifyKeyPairAttributeCommonWithContext is the same as ModifyKeyPairAttributeCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyKeyPairAttributeCommon 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 *ECS) ModifyKeyPairAttributeCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ModifyKeyPairAttributeCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opModifyKeyPairAttribute = "ModifyKeyPairAttribute" - -// ModifyKeyPairAttributeRequest generates a "volcengine/request.Request" representing the -// client's request for the ModifyKeyPairAttribute operation. The "output" return -// value will be populated with the ModifyKeyPairAttributeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ModifyKeyPairAttributeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ModifyKeyPairAttributeCommon Send returns without error. -// -// See ModifyKeyPairAttribute for more information on using the ModifyKeyPairAttribute -// API call, and error handling. -// -// // Example sending a request using the ModifyKeyPairAttributeRequest method. -// req, resp := client.ModifyKeyPairAttributeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ModifyKeyPairAttributeRequest(input *ModifyKeyPairAttributeInput) (req *request.Request, output *ModifyKeyPairAttributeOutput) { - op := &request.Operation{ - Name: opModifyKeyPairAttribute, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ModifyKeyPairAttributeInput{} - } - - output = &ModifyKeyPairAttributeOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ModifyKeyPairAttribute API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ModifyKeyPairAttribute for usage and error information. -func (c *ECS) ModifyKeyPairAttribute(input *ModifyKeyPairAttributeInput) (*ModifyKeyPairAttributeOutput, error) { - req, out := c.ModifyKeyPairAttributeRequest(input) - return out, req.Send() -} - -// ModifyKeyPairAttributeWithContext is the same as ModifyKeyPairAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyKeyPairAttribute for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ModifyKeyPairAttributeWithContext(ctx volcengine.Context, input *ModifyKeyPairAttributeInput, opts ...request.Option) (*ModifyKeyPairAttributeOutput, error) { - req, out := c.ModifyKeyPairAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ModifyKeyPairAttributeInput struct { - _ struct{} `type:"structure"` - - Description *string `type:"string"` - - KeyPairId *string `type:"string"` - - KeyPairName *string `type:"string"` -} - -// String returns the string representation -func (s ModifyKeyPairAttributeInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyKeyPairAttributeInput) GoString() string { - return s.String() -} - -// SetDescription sets the Description field's value. -func (s *ModifyKeyPairAttributeInput) SetDescription(v string) *ModifyKeyPairAttributeInput { - s.Description = &v - return s -} - -// SetKeyPairId sets the KeyPairId field's value. -func (s *ModifyKeyPairAttributeInput) SetKeyPairId(v string) *ModifyKeyPairAttributeInput { - s.KeyPairId = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *ModifyKeyPairAttributeInput) SetKeyPairName(v string) *ModifyKeyPairAttributeInput { - s.KeyPairName = &v - return s -} - -type ModifyKeyPairAttributeOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - KeyPairName *string `type:"string"` -} - -// String returns the string representation -func (s ModifyKeyPairAttributeOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModifyKeyPairAttributeOutput) GoString() string { - return s.String() -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *ModifyKeyPairAttributeOutput) SetKeyPairName(v string) *ModifyKeyPairAttributeOutput { - s.KeyPairName = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_reboot_instance.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_reboot_instance.go deleted file mode 100644 index f31b4cf6e3a8..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_reboot_instance.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opRebootInstanceCommon = "RebootInstance" - -// RebootInstanceCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the RebootInstanceCommon operation. The "output" return -// value will be populated with the RebootInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RebootInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after RebootInstanceCommon Send returns without error. -// -// See RebootInstanceCommon for more information on using the RebootInstanceCommon -// API call, and error handling. -// -// // Example sending a request using the RebootInstanceCommonRequest method. -// req, resp := client.RebootInstanceCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) RebootInstanceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opRebootInstanceCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// RebootInstanceCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation RebootInstanceCommon for usage and error information. -func (c *ECS) RebootInstanceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.RebootInstanceCommonRequest(input) - return out, req.Send() -} - -// RebootInstanceCommonWithContext is the same as RebootInstanceCommon with the addition of -// the ability to pass a context and additional request options. -// -// See RebootInstanceCommon 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 *ECS) RebootInstanceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.RebootInstanceCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRebootInstance = "RebootInstance" - -// RebootInstanceRequest generates a "volcengine/request.Request" representing the -// client's request for the RebootInstance operation. The "output" return -// value will be populated with the RebootInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RebootInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after RebootInstanceCommon Send returns without error. -// -// See RebootInstance for more information on using the RebootInstance -// API call, and error handling. -// -// // Example sending a request using the RebootInstanceRequest method. -// req, resp := client.RebootInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) RebootInstanceRequest(input *RebootInstanceInput) (req *request.Request, output *RebootInstanceOutput) { - op := &request.Operation{ - Name: opRebootInstance, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &RebootInstanceInput{} - } - - output = &RebootInstanceOutput{} - req = c.newRequest(op, input, output) - - return -} - -// RebootInstance API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation RebootInstance for usage and error information. -func (c *ECS) RebootInstance(input *RebootInstanceInput) (*RebootInstanceOutput, error) { - req, out := c.RebootInstanceRequest(input) - return out, req.Send() -} - -// RebootInstanceWithContext is the same as RebootInstance with the addition of -// the ability to pass a context and additional request options. -// -// See RebootInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) RebootInstanceWithContext(ctx volcengine.Context, input *RebootInstanceInput, opts ...request.Option) (*RebootInstanceOutput, error) { - req, out := c.RebootInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type RebootInstanceInput struct { - _ struct{} `type:"structure"` - - ForceStop *bool `type:"boolean"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s RebootInstanceInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstanceInput) GoString() string { - return s.String() -} - -// SetForceStop sets the ForceStop field's value. -func (s *RebootInstanceInput) SetForceStop(v bool) *RebootInstanceInput { - s.ForceStop = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *RebootInstanceInput) SetInstanceId(v string) *RebootInstanceInput { - s.InstanceId = &v - return s -} - -type RebootInstanceOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s RebootInstanceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstanceOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_reboot_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_reboot_instances.go deleted file mode 100644 index b653149b0661..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_reboot_instances.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opRebootInstancesCommon = "RebootInstances" - -// RebootInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the RebootInstancesCommon operation. The "output" return -// value will be populated with the RebootInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RebootInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after RebootInstancesCommon Send returns without error. -// -// See RebootInstancesCommon for more information on using the RebootInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the RebootInstancesCommonRequest method. -// req, resp := client.RebootInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) RebootInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opRebootInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// RebootInstancesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation RebootInstancesCommon for usage and error information. -func (c *ECS) RebootInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.RebootInstancesCommonRequest(input) - return out, req.Send() -} - -// RebootInstancesCommonWithContext is the same as RebootInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See RebootInstancesCommon 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 *ECS) RebootInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.RebootInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRebootInstances = "RebootInstances" - -// RebootInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the RebootInstances operation. The "output" return -// value will be populated with the RebootInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RebootInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after RebootInstancesCommon Send returns without error. -// -// See RebootInstances for more information on using the RebootInstances -// API call, and error handling. -// -// // Example sending a request using the RebootInstancesRequest method. -// req, resp := client.RebootInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) RebootInstancesRequest(input *RebootInstancesInput) (req *request.Request, output *RebootInstancesOutput) { - op := &request.Operation{ - Name: opRebootInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &RebootInstancesInput{} - } - - output = &RebootInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// RebootInstances API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation RebootInstances for usage and error information. -func (c *ECS) RebootInstances(input *RebootInstancesInput) (*RebootInstancesOutput, error) { - req, out := c.RebootInstancesRequest(input) - return out, req.Send() -} - -// RebootInstancesWithContext is the same as RebootInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RebootInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) RebootInstancesWithContext(ctx volcengine.Context, input *RebootInstancesInput, opts ...request.Option) (*RebootInstancesOutput, error) { - req, out := c.RebootInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ErrorForRebootInstancesOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForRebootInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForRebootInstancesOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForRebootInstancesOutput) SetCode(v string) *ErrorForRebootInstancesOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForRebootInstancesOutput) SetMessage(v string) *ErrorForRebootInstancesOutput { - s.Message = &v - return s -} - -type OperationDetailForRebootInstancesOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForRebootInstancesOutput `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForRebootInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForRebootInstancesOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForRebootInstancesOutput) SetError(v *ErrorForRebootInstancesOutput) *OperationDetailForRebootInstancesOutput { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *OperationDetailForRebootInstancesOutput) SetInstanceId(v string) *OperationDetailForRebootInstancesOutput { - s.InstanceId = &v - return s -} - -type RebootInstancesInput struct { - _ struct{} `type:"structure"` - - ForceStop *bool `type:"boolean"` - - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s RebootInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstancesInput) GoString() string { - return s.String() -} - -// SetForceStop sets the ForceStop field's value. -func (s *RebootInstancesInput) SetForceStop(v bool) *RebootInstancesInput { - s.ForceStop = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *RebootInstancesInput) SetInstanceIds(v []*string) *RebootInstancesInput { - s.InstanceIds = v - return s -} - -type RebootInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForRebootInstancesOutput `type:"list"` -} - -// String returns the string representation -func (s RebootInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RebootInstancesOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *RebootInstancesOutput) SetOperationDetails(v []*OperationDetailForRebootInstancesOutput) *RebootInstancesOutput { - s.OperationDetails = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_renew_instance.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_renew_instance.go deleted file mode 100644 index 6c635dedc92b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_renew_instance.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opRenewInstanceCommon = "RenewInstance" - -// RenewInstanceCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the RenewInstanceCommon operation. The "output" return -// value will be populated with the RenewInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RenewInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after RenewInstanceCommon Send returns without error. -// -// See RenewInstanceCommon for more information on using the RenewInstanceCommon -// API call, and error handling. -// -// // Example sending a request using the RenewInstanceCommonRequest method. -// req, resp := client.RenewInstanceCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) RenewInstanceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opRenewInstanceCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// RenewInstanceCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation RenewInstanceCommon for usage and error information. -func (c *ECS) RenewInstanceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.RenewInstanceCommonRequest(input) - return out, req.Send() -} - -// RenewInstanceCommonWithContext is the same as RenewInstanceCommon with the addition of -// the ability to pass a context and additional request options. -// -// See RenewInstanceCommon 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 *ECS) RenewInstanceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.RenewInstanceCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRenewInstance = "RenewInstance" - -// RenewInstanceRequest generates a "volcengine/request.Request" representing the -// client's request for the RenewInstance operation. The "output" return -// value will be populated with the RenewInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RenewInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after RenewInstanceCommon Send returns without error. -// -// See RenewInstance for more information on using the RenewInstance -// API call, and error handling. -// -// // Example sending a request using the RenewInstanceRequest method. -// req, resp := client.RenewInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) RenewInstanceRequest(input *RenewInstanceInput) (req *request.Request, output *RenewInstanceOutput) { - op := &request.Operation{ - Name: opRenewInstance, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &RenewInstanceInput{} - } - - output = &RenewInstanceOutput{} - req = c.newRequest(op, input, output) - - return -} - -// RenewInstance API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation RenewInstance for usage and error information. -func (c *ECS) RenewInstance(input *RenewInstanceInput) (*RenewInstanceOutput, error) { - req, out := c.RenewInstanceRequest(input) - return out, req.Send() -} - -// RenewInstanceWithContext is the same as RenewInstance with the addition of -// the ability to pass a context and additional request options. -// -// See RenewInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) RenewInstanceWithContext(ctx volcengine.Context, input *RenewInstanceInput, opts ...request.Option) (*RenewInstanceOutput, error) { - req, out := c.RenewInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type RenewInstanceInput struct { - _ struct{} `type:"structure"` - - ClientToken *string `type:"string"` - - InstanceId *string `type:"string"` - - Period *int32 `type:"int32"` - - PeriodUnit *string `type:"string"` -} - -// String returns the string representation -func (s RenewInstanceInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RenewInstanceInput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *RenewInstanceInput) SetClientToken(v string) *RenewInstanceInput { - s.ClientToken = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *RenewInstanceInput) SetInstanceId(v string) *RenewInstanceInput { - s.InstanceId = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *RenewInstanceInput) SetPeriod(v int32) *RenewInstanceInput { - s.Period = &v - return s -} - -// SetPeriodUnit sets the PeriodUnit field's value. -func (s *RenewInstanceInput) SetPeriodUnit(v string) *RenewInstanceInput { - s.PeriodUnit = &v - return s -} - -type RenewInstanceOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OrderId *string `type:"string"` -} - -// String returns the string representation -func (s RenewInstanceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RenewInstanceOutput) GoString() string { - return s.String() -} - -// SetOrderId sets the OrderId field's value. -func (s *RenewInstanceOutput) SetOrderId(v string) *RenewInstanceOutput { - s.OrderId = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_replace_system_volume.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_replace_system_volume.go deleted file mode 100644 index ded59c106d7a..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_replace_system_volume.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "encoding/json" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opReplaceSystemVolumeCommon = "ReplaceSystemVolume" - -// ReplaceSystemVolumeCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the ReplaceSystemVolumeCommon operation. The "output" return -// value will be populated with the ReplaceSystemVolumeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ReplaceSystemVolumeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ReplaceSystemVolumeCommon Send returns without error. -// -// See ReplaceSystemVolumeCommon for more information on using the ReplaceSystemVolumeCommon -// API call, and error handling. -// -// // Example sending a request using the ReplaceSystemVolumeCommonRequest method. -// req, resp := client.ReplaceSystemVolumeCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ReplaceSystemVolumeCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opReplaceSystemVolumeCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// ReplaceSystemVolumeCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ReplaceSystemVolumeCommon for usage and error information. -func (c *ECS) ReplaceSystemVolumeCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.ReplaceSystemVolumeCommonRequest(input) - return out, req.Send() -} - -// ReplaceSystemVolumeCommonWithContext is the same as ReplaceSystemVolumeCommon with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceSystemVolumeCommon 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 *ECS) ReplaceSystemVolumeCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.ReplaceSystemVolumeCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opReplaceSystemVolume = "ReplaceSystemVolume" - -// ReplaceSystemVolumeRequest generates a "volcengine/request.Request" representing the -// client's request for the ReplaceSystemVolume operation. The "output" return -// value will be populated with the ReplaceSystemVolumeCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned ReplaceSystemVolumeCommon Request to send the API call to the service. -// the "output" return value is not valid until after ReplaceSystemVolumeCommon Send returns without error. -// -// See ReplaceSystemVolume for more information on using the ReplaceSystemVolume -// API call, and error handling. -// -// // Example sending a request using the ReplaceSystemVolumeRequest method. -// req, resp := client.ReplaceSystemVolumeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) ReplaceSystemVolumeRequest(input *ReplaceSystemVolumeInput) (req *request.Request, output *ReplaceSystemVolumeOutput) { - op := &request.Operation{ - Name: opReplaceSystemVolume, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ReplaceSystemVolumeInput{} - } - - output = &ReplaceSystemVolumeOutput{} - req = c.newRequest(op, input, output) - - return -} - -// ReplaceSystemVolume API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation ReplaceSystemVolume for usage and error information. -func (c *ECS) ReplaceSystemVolume(input *ReplaceSystemVolumeInput) (*ReplaceSystemVolumeOutput, error) { - req, out := c.ReplaceSystemVolumeRequest(input) - return out, req.Send() -} - -// ReplaceSystemVolumeWithContext is the same as ReplaceSystemVolume with the addition of -// the ability to pass a context and additional request options. -// -// See ReplaceSystemVolume for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) ReplaceSystemVolumeWithContext(ctx volcengine.Context, input *ReplaceSystemVolumeInput, opts ...request.Option) (*ReplaceSystemVolumeOutput, error) { - req, out := c.ReplaceSystemVolumeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ReplaceSystemVolumeInput struct { - _ struct{} `type:"structure"` - - ClientToken *string `type:"string"` - - ImageId *string `type:"string"` - - InstanceId *string `type:"string"` - - KeepImageCredential *bool `type:"boolean"` - - KeyPairName *string `type:"string"` - - Password *string `type:"string"` - - Size *json.Number `type:"json_number"` - - UserData *string `type:"string"` -} - -// String returns the string representation -func (s ReplaceSystemVolumeInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceSystemVolumeInput) GoString() string { - return s.String() -} - -// SetClientToken sets the ClientToken field's value. -func (s *ReplaceSystemVolumeInput) SetClientToken(v string) *ReplaceSystemVolumeInput { - s.ClientToken = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *ReplaceSystemVolumeInput) SetImageId(v string) *ReplaceSystemVolumeInput { - s.ImageId = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *ReplaceSystemVolumeInput) SetInstanceId(v string) *ReplaceSystemVolumeInput { - s.InstanceId = &v - return s -} - -// SetKeepImageCredential sets the KeepImageCredential field's value. -func (s *ReplaceSystemVolumeInput) SetKeepImageCredential(v bool) *ReplaceSystemVolumeInput { - s.KeepImageCredential = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *ReplaceSystemVolumeInput) SetKeyPairName(v string) *ReplaceSystemVolumeInput { - s.KeyPairName = &v - return s -} - -// SetPassword sets the Password field's value. -func (s *ReplaceSystemVolumeInput) SetPassword(v string) *ReplaceSystemVolumeInput { - s.Password = &v - return s -} - -// SetSize sets the Size field's value. -func (s *ReplaceSystemVolumeInput) SetSize(v json.Number) *ReplaceSystemVolumeInput { - s.Size = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *ReplaceSystemVolumeInput) SetUserData(v string) *ReplaceSystemVolumeInput { - s.UserData = &v - return s -} - -type ReplaceSystemVolumeOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s ReplaceSystemVolumeOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ReplaceSystemVolumeOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_run_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_run_instances.go deleted file mode 100644 index 2fe24a9ad9a5..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_run_instances.go +++ /dev/null @@ -1,540 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opRunInstancesCommon = "RunInstances" - -// RunInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the RunInstancesCommon operation. The "output" return -// value will be populated with the RunInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RunInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after RunInstancesCommon Send returns without error. -// -// See RunInstancesCommon for more information on using the RunInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the RunInstancesCommonRequest method. -// req, resp := client.RunInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) RunInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opRunInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// RunInstancesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation RunInstancesCommon for usage and error information. -func (c *ECS) RunInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.RunInstancesCommonRequest(input) - return out, req.Send() -} - -// RunInstancesCommonWithContext is the same as RunInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See RunInstancesCommon 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 *ECS) RunInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.RunInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRunInstances = "RunInstances" - -// RunInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the RunInstances operation. The "output" return -// value will be populated with the RunInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned RunInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after RunInstancesCommon Send returns without error. -// -// See RunInstances for more information on using the RunInstances -// API call, and error handling. -// -// // Example sending a request using the RunInstancesRequest method. -// req, resp := client.RunInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) RunInstancesRequest(input *RunInstancesInput) (req *request.Request, output *RunInstancesOutput) { - op := &request.Operation{ - Name: opRunInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &RunInstancesInput{} - } - - output = &RunInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// RunInstances API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation RunInstances for usage and error information. -func (c *ECS) RunInstances(input *RunInstancesInput) (*RunInstancesOutput, error) { - req, out := c.RunInstancesRequest(input) - return out, req.Send() -} - -// RunInstancesWithContext is the same as RunInstances with the addition of -// the ability to pass a context and additional request options. -// -// See RunInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) RunInstancesWithContext(ctx volcengine.Context, input *RunInstancesInput, opts ...request.Option) (*RunInstancesOutput, error) { - req, out := c.RunInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type NetworkInterfaceForRunInstancesInput struct { - _ struct{} `type:"structure"` - - PrimaryIpAddress *string `type:"string"` - - SecurityGroupIds []*string `type:"list"` - - SubnetId *string `type:"string"` -} - -// String returns the string representation -func (s NetworkInterfaceForRunInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s NetworkInterfaceForRunInstancesInput) GoString() string { - return s.String() -} - -// SetPrimaryIpAddress sets the PrimaryIpAddress field's value. -func (s *NetworkInterfaceForRunInstancesInput) SetPrimaryIpAddress(v string) *NetworkInterfaceForRunInstancesInput { - s.PrimaryIpAddress = &v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *NetworkInterfaceForRunInstancesInput) SetSecurityGroupIds(v []*string) *NetworkInterfaceForRunInstancesInput { - s.SecurityGroupIds = v - return s -} - -// SetSubnetId sets the SubnetId field's value. -func (s *NetworkInterfaceForRunInstancesInput) SetSubnetId(v string) *NetworkInterfaceForRunInstancesInput { - s.SubnetId = &v - return s -} - -type RunInstancesInput struct { - _ struct{} `type:"structure"` - - AutoRenew *bool `type:"boolean"` - - AutoRenewPeriod *int32 `type:"int32"` - - ClientToken *string `type:"string"` - - Count *int32 `type:"int32"` - - CreditSpecification *string `type:"string"` - - DeploymentSetId *string `type:"string"` - - Description *string `type:"string"` - - DryRun *bool `type:"boolean"` - - HostName *string `type:"string"` - - Hostname *string `type:"string"` - - HpcClusterId *string `type:"string"` - - ImageId *string `type:"string"` - - InstanceChargeType *string `type:"string"` - - InstanceName *string `type:"string"` - - InstanceType *string `type:"string"` - - InstanceTypeId *string `type:"string"` - - KeepImageCredential *bool `type:"boolean"` - - KeyPairName *string `type:"string"` - - MinCount *int32 `type:"int32"` - - NetworkInterfaces []*NetworkInterfaceForRunInstancesInput `type:"list"` - - Password *string `type:"string"` - - Period *int32 `type:"int32"` - - PeriodUnit *string `type:"string"` - - ProjectName *string `type:"string"` - - SecurityEnhancementStrategy *string `type:"string"` - - SpotStrategy *string `type:"string"` - - SuffixIndex *int32 `type:"int32"` - - Tags []*TagForRunInstancesInput `type:"list"` - - UniqueSuffix *bool `type:"boolean"` - - UserData *string `type:"string"` - - Volumes []*VolumeForRunInstancesInput `type:"list"` - - ZoneId *string `type:"string"` -} - -// String returns the string representation -func (s RunInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunInstancesInput) GoString() string { - return s.String() -} - -// SetAutoRenew sets the AutoRenew field's value. -func (s *RunInstancesInput) SetAutoRenew(v bool) *RunInstancesInput { - s.AutoRenew = &v - return s -} - -// SetAutoRenewPeriod sets the AutoRenewPeriod field's value. -func (s *RunInstancesInput) SetAutoRenewPeriod(v int32) *RunInstancesInput { - s.AutoRenewPeriod = &v - return s -} - -// SetClientToken sets the ClientToken field's value. -func (s *RunInstancesInput) SetClientToken(v string) *RunInstancesInput { - s.ClientToken = &v - return s -} - -// SetCount sets the Count field's value. -func (s *RunInstancesInput) SetCount(v int32) *RunInstancesInput { - s.Count = &v - return s -} - -// SetCreditSpecification sets the CreditSpecification field's value. -func (s *RunInstancesInput) SetCreditSpecification(v string) *RunInstancesInput { - s.CreditSpecification = &v - return s -} - -// SetDeploymentSetId sets the DeploymentSetId field's value. -func (s *RunInstancesInput) SetDeploymentSetId(v string) *RunInstancesInput { - s.DeploymentSetId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *RunInstancesInput) SetDescription(v string) *RunInstancesInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *RunInstancesInput) SetDryRun(v bool) *RunInstancesInput { - s.DryRun = &v - return s -} - -// SetHostName sets the HostName field's value. -func (s *RunInstancesInput) SetHostName(v string) *RunInstancesInput { - s.HostName = &v - return s -} - -// SetHostname sets the Hostname field's value. -func (s *RunInstancesInput) SetHostname(v string) *RunInstancesInput { - s.Hostname = &v - return s -} - -// SetHpcClusterId sets the HpcClusterId field's value. -func (s *RunInstancesInput) SetHpcClusterId(v string) *RunInstancesInput { - s.HpcClusterId = &v - return s -} - -// SetImageId sets the ImageId field's value. -func (s *RunInstancesInput) SetImageId(v string) *RunInstancesInput { - s.ImageId = &v - return s -} - -// SetInstanceChargeType sets the InstanceChargeType field's value. -func (s *RunInstancesInput) SetInstanceChargeType(v string) *RunInstancesInput { - s.InstanceChargeType = &v - return s -} - -// SetInstanceName sets the InstanceName field's value. -func (s *RunInstancesInput) SetInstanceName(v string) *RunInstancesInput { - s.InstanceName = &v - return s -} - -// SetInstanceType sets the InstanceType field's value. -func (s *RunInstancesInput) SetInstanceType(v string) *RunInstancesInput { - s.InstanceType = &v - return s -} - -// SetInstanceTypeId sets the InstanceTypeId field's value. -func (s *RunInstancesInput) SetInstanceTypeId(v string) *RunInstancesInput { - s.InstanceTypeId = &v - return s -} - -// SetKeepImageCredential sets the KeepImageCredential field's value. -func (s *RunInstancesInput) SetKeepImageCredential(v bool) *RunInstancesInput { - s.KeepImageCredential = &v - return s -} - -// SetKeyPairName sets the KeyPairName field's value. -func (s *RunInstancesInput) SetKeyPairName(v string) *RunInstancesInput { - s.KeyPairName = &v - return s -} - -// SetMinCount sets the MinCount field's value. -func (s *RunInstancesInput) SetMinCount(v int32) *RunInstancesInput { - s.MinCount = &v - return s -} - -// SetNetworkInterfaces sets the NetworkInterfaces field's value. -func (s *RunInstancesInput) SetNetworkInterfaces(v []*NetworkInterfaceForRunInstancesInput) *RunInstancesInput { - s.NetworkInterfaces = v - return s -} - -// SetPassword sets the Password field's value. -func (s *RunInstancesInput) SetPassword(v string) *RunInstancesInput { - s.Password = &v - return s -} - -// SetPeriod sets the Period field's value. -func (s *RunInstancesInput) SetPeriod(v int32) *RunInstancesInput { - s.Period = &v - return s -} - -// SetPeriodUnit sets the PeriodUnit field's value. -func (s *RunInstancesInput) SetPeriodUnit(v string) *RunInstancesInput { - s.PeriodUnit = &v - return s -} - -// SetProjectName sets the ProjectName field's value. -func (s *RunInstancesInput) SetProjectName(v string) *RunInstancesInput { - s.ProjectName = &v - return s -} - -// SetSecurityEnhancementStrategy sets the SecurityEnhancementStrategy field's value. -func (s *RunInstancesInput) SetSecurityEnhancementStrategy(v string) *RunInstancesInput { - s.SecurityEnhancementStrategy = &v - return s -} - -// SetSpotStrategy sets the SpotStrategy field's value. -func (s *RunInstancesInput) SetSpotStrategy(v string) *RunInstancesInput { - s.SpotStrategy = &v - return s -} - -// SetSuffixIndex sets the SuffixIndex field's value. -func (s *RunInstancesInput) SetSuffixIndex(v int32) *RunInstancesInput { - s.SuffixIndex = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *RunInstancesInput) SetTags(v []*TagForRunInstancesInput) *RunInstancesInput { - s.Tags = v - return s -} - -// SetUniqueSuffix sets the UniqueSuffix field's value. -func (s *RunInstancesInput) SetUniqueSuffix(v bool) *RunInstancesInput { - s.UniqueSuffix = &v - return s -} - -// SetUserData sets the UserData field's value. -func (s *RunInstancesInput) SetUserData(v string) *RunInstancesInput { - s.UserData = &v - return s -} - -// SetVolumes sets the Volumes field's value. -func (s *RunInstancesInput) SetVolumes(v []*VolumeForRunInstancesInput) *RunInstancesInput { - s.Volumes = v - return s -} - -// SetZoneId sets the ZoneId field's value. -func (s *RunInstancesInput) SetZoneId(v string) *RunInstancesInput { - s.ZoneId = &v - return s -} - -type RunInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s RunInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s RunInstancesOutput) GoString() string { - return s.String() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *RunInstancesOutput) SetInstanceIds(v []*string) *RunInstancesOutput { - s.InstanceIds = v - return s -} - -type TagForRunInstancesInput struct { - _ struct{} `type:"structure"` - - Key *string `type:"string"` - - Value *string `type:"string"` -} - -// String returns the string representation -func (s TagForRunInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s TagForRunInstancesInput) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *TagForRunInstancesInput) SetKey(v string) *TagForRunInstancesInput { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *TagForRunInstancesInput) SetValue(v string) *TagForRunInstancesInput { - s.Value = &v - return s -} - -type VolumeForRunInstancesInput struct { - _ struct{} `type:"structure"` - - DeleteWithInstance *string `type:"string"` - - Size *int32 `type:"int32"` - - VolumeType *string `type:"string"` -} - -// String returns the string representation -func (s VolumeForRunInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s VolumeForRunInstancesInput) GoString() string { - return s.String() -} - -// SetDeleteWithInstance sets the DeleteWithInstance field's value. -func (s *VolumeForRunInstancesInput) SetDeleteWithInstance(v string) *VolumeForRunInstancesInput { - s.DeleteWithInstance = &v - return s -} - -// SetSize sets the Size field's value. -func (s *VolumeForRunInstancesInput) SetSize(v int32) *VolumeForRunInstancesInput { - s.Size = &v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *VolumeForRunInstancesInput) SetVolumeType(v string) *VolumeForRunInstancesInput { - s.VolumeType = &v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_start_instance.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_start_instance.go deleted file mode 100644 index 4dd9770fc4c1..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_start_instance.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opStartInstanceCommon = "StartInstance" - -// StartInstanceCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the StartInstanceCommon operation. The "output" return -// value will be populated with the StartInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned StartInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after StartInstanceCommon Send returns without error. -// -// See StartInstanceCommon for more information on using the StartInstanceCommon -// API call, and error handling. -// -// // Example sending a request using the StartInstanceCommonRequest method. -// req, resp := client.StartInstanceCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) StartInstanceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opStartInstanceCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// StartInstanceCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation StartInstanceCommon for usage and error information. -func (c *ECS) StartInstanceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.StartInstanceCommonRequest(input) - return out, req.Send() -} - -// StartInstanceCommonWithContext is the same as StartInstanceCommon with the addition of -// the ability to pass a context and additional request options. -// -// See StartInstanceCommon 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 *ECS) StartInstanceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.StartInstanceCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartInstance = "StartInstance" - -// StartInstanceRequest generates a "volcengine/request.Request" representing the -// client's request for the StartInstance operation. The "output" return -// value will be populated with the StartInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned StartInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after StartInstanceCommon Send returns without error. -// -// See StartInstance for more information on using the StartInstance -// API call, and error handling. -// -// // Example sending a request using the StartInstanceRequest method. -// req, resp := client.StartInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) StartInstanceRequest(input *StartInstanceInput) (req *request.Request, output *StartInstanceOutput) { - op := &request.Operation{ - Name: opStartInstance, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &StartInstanceInput{} - } - - output = &StartInstanceOutput{} - req = c.newRequest(op, input, output) - - return -} - -// StartInstance API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation StartInstance for usage and error information. -func (c *ECS) StartInstance(input *StartInstanceInput) (*StartInstanceOutput, error) { - req, out := c.StartInstanceRequest(input) - return out, req.Send() -} - -// StartInstanceWithContext is the same as StartInstance with the addition of -// the ability to pass a context and additional request options. -// -// See StartInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) StartInstanceWithContext(ctx volcengine.Context, input *StartInstanceInput, opts ...request.Option) (*StartInstanceOutput, error) { - req, out := c.StartInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type StartInstanceInput struct { - _ struct{} `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s StartInstanceInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstanceInput) GoString() string { - return s.String() -} - -// SetInstanceId sets the InstanceId field's value. -func (s *StartInstanceInput) SetInstanceId(v string) *StartInstanceInput { - s.InstanceId = &v - return s -} - -type StartInstanceOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s StartInstanceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstanceOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_start_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_start_instances.go deleted file mode 100644 index 5c69578f5212..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_start_instances.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opStartInstancesCommon = "StartInstances" - -// StartInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the StartInstancesCommon operation. The "output" return -// value will be populated with the StartInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned StartInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after StartInstancesCommon Send returns without error. -// -// See StartInstancesCommon for more information on using the StartInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the StartInstancesCommonRequest method. -// req, resp := client.StartInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) StartInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opStartInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// StartInstancesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation StartInstancesCommon for usage and error information. -func (c *ECS) StartInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.StartInstancesCommonRequest(input) - return out, req.Send() -} - -// StartInstancesCommonWithContext is the same as StartInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See StartInstancesCommon 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 *ECS) StartInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.StartInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartInstances = "StartInstances" - -// StartInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the StartInstances operation. The "output" return -// value will be populated with the StartInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned StartInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after StartInstancesCommon Send returns without error. -// -// See StartInstances for more information on using the StartInstances -// API call, and error handling. -// -// // Example sending a request using the StartInstancesRequest method. -// req, resp := client.StartInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) StartInstancesRequest(input *StartInstancesInput) (req *request.Request, output *StartInstancesOutput) { - op := &request.Operation{ - Name: opStartInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &StartInstancesInput{} - } - - output = &StartInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// StartInstances API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation StartInstances for usage and error information. -func (c *ECS) StartInstances(input *StartInstancesInput) (*StartInstancesOutput, error) { - req, out := c.StartInstancesRequest(input) - return out, req.Send() -} - -// StartInstancesWithContext is the same as StartInstances with the addition of -// the ability to pass a context and additional request options. -// -// See StartInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) StartInstancesWithContext(ctx volcengine.Context, input *StartInstancesInput, opts ...request.Option) (*StartInstancesOutput, error) { - req, out := c.StartInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ErrorForStartInstancesOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForStartInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForStartInstancesOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForStartInstancesOutput) SetCode(v string) *ErrorForStartInstancesOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForStartInstancesOutput) SetMessage(v string) *ErrorForStartInstancesOutput { - s.Message = &v - return s -} - -type OperationDetailForStartInstancesOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForStartInstancesOutput `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForStartInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForStartInstancesOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForStartInstancesOutput) SetError(v *ErrorForStartInstancesOutput) *OperationDetailForStartInstancesOutput { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *OperationDetailForStartInstancesOutput) SetInstanceId(v string) *OperationDetailForStartInstancesOutput { - s.InstanceId = &v - return s -} - -type StartInstancesInput struct { - _ struct{} `type:"structure"` - - InstanceIds []*string `type:"list"` -} - -// String returns the string representation -func (s StartInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstancesInput) GoString() string { - return s.String() -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *StartInstancesInput) SetInstanceIds(v []*string) *StartInstancesInput { - s.InstanceIds = v - return s -} - -type StartInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForStartInstancesOutput `type:"list"` -} - -// String returns the string representation -func (s StartInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s StartInstancesOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *StartInstancesOutput) SetOperationDetails(v []*OperationDetailForStartInstancesOutput) *StartInstancesOutput { - s.OperationDetails = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_stop_instance.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_stop_instance.go deleted file mode 100644 index 881c762f779a..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_stop_instance.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opStopInstanceCommon = "StopInstance" - -// StopInstanceCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the StopInstanceCommon operation. The "output" return -// value will be populated with the StopInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned StopInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after StopInstanceCommon Send returns without error. -// -// See StopInstanceCommon for more information on using the StopInstanceCommon -// API call, and error handling. -// -// // Example sending a request using the StopInstanceCommonRequest method. -// req, resp := client.StopInstanceCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) StopInstanceCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opStopInstanceCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// StopInstanceCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation StopInstanceCommon for usage and error information. -func (c *ECS) StopInstanceCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.StopInstanceCommonRequest(input) - return out, req.Send() -} - -// StopInstanceCommonWithContext is the same as StopInstanceCommon with the addition of -// the ability to pass a context and additional request options. -// -// See StopInstanceCommon 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 *ECS) StopInstanceCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.StopInstanceCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopInstance = "StopInstance" - -// StopInstanceRequest generates a "volcengine/request.Request" representing the -// client's request for the StopInstance operation. The "output" return -// value will be populated with the StopInstanceCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned StopInstanceCommon Request to send the API call to the service. -// the "output" return value is not valid until after StopInstanceCommon Send returns without error. -// -// See StopInstance for more information on using the StopInstance -// API call, and error handling. -// -// // Example sending a request using the StopInstanceRequest method. -// req, resp := client.StopInstanceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) StopInstanceRequest(input *StopInstanceInput) (req *request.Request, output *StopInstanceOutput) { - op := &request.Operation{ - Name: opStopInstance, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &StopInstanceInput{} - } - - output = &StopInstanceOutput{} - req = c.newRequest(op, input, output) - - return -} - -// StopInstance API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation StopInstance for usage and error information. -func (c *ECS) StopInstance(input *StopInstanceInput) (*StopInstanceOutput, error) { - req, out := c.StopInstanceRequest(input) - return out, req.Send() -} - -// StopInstanceWithContext is the same as StopInstance with the addition of -// the ability to pass a context and additional request options. -// -// See StopInstance for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) StopInstanceWithContext(ctx volcengine.Context, input *StopInstanceInput, opts ...request.Option) (*StopInstanceOutput, error) { - req, out := c.StopInstanceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type StopInstanceInput struct { - _ struct{} `type:"structure"` - - ForceStop *bool `type:"boolean"` - - InstanceId *string `type:"string"` - - StoppedMode *string `type:"string"` -} - -// String returns the string representation -func (s StopInstanceInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstanceInput) GoString() string { - return s.String() -} - -// SetForceStop sets the ForceStop field's value. -func (s *StopInstanceInput) SetForceStop(v bool) *StopInstanceInput { - s.ForceStop = &v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *StopInstanceInput) SetInstanceId(v string) *StopInstanceInput { - s.InstanceId = &v - return s -} - -// SetStoppedMode sets the StoppedMode field's value. -func (s *StopInstanceInput) SetStoppedMode(v string) *StopInstanceInput { - s.StoppedMode = &v - return s -} - -type StopInstanceOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata -} - -// String returns the string representation -func (s StopInstanceOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstanceOutput) GoString() string { - return s.String() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_stop_instances.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_stop_instances.go deleted file mode 100644 index 67a7fb95a940..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_stop_instances.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opStopInstancesCommon = "StopInstances" - -// StopInstancesCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the StopInstancesCommon operation. The "output" return -// value will be populated with the StopInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned StopInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after StopInstancesCommon Send returns without error. -// -// See StopInstancesCommon for more information on using the StopInstancesCommon -// API call, and error handling. -// -// // Example sending a request using the StopInstancesCommonRequest method. -// req, resp := client.StopInstancesCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) StopInstancesCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opStopInstancesCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// StopInstancesCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation StopInstancesCommon for usage and error information. -func (c *ECS) StopInstancesCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.StopInstancesCommonRequest(input) - return out, req.Send() -} - -// StopInstancesCommonWithContext is the same as StopInstancesCommon with the addition of -// the ability to pass a context and additional request options. -// -// See StopInstancesCommon 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 *ECS) StopInstancesCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.StopInstancesCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopInstances = "StopInstances" - -// StopInstancesRequest generates a "volcengine/request.Request" representing the -// client's request for the StopInstances operation. The "output" return -// value will be populated with the StopInstancesCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned StopInstancesCommon Request to send the API call to the service. -// the "output" return value is not valid until after StopInstancesCommon Send returns without error. -// -// See StopInstances for more information on using the StopInstances -// API call, and error handling. -// -// // Example sending a request using the StopInstancesRequest method. -// req, resp := client.StopInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) StopInstancesRequest(input *StopInstancesInput) (req *request.Request, output *StopInstancesOutput) { - op := &request.Operation{ - Name: opStopInstances, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &StopInstancesInput{} - } - - output = &StopInstancesOutput{} - req = c.newRequest(op, input, output) - - return -} - -// StopInstances API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation StopInstances for usage and error information. -func (c *ECS) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, error) { - req, out := c.StopInstancesRequest(input) - return out, req.Send() -} - -// StopInstancesWithContext is the same as StopInstances with the addition of -// the ability to pass a context and additional request options. -// -// See StopInstances for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) StopInstancesWithContext(ctx volcengine.Context, input *StopInstancesInput, opts ...request.Option) (*StopInstancesOutput, error) { - req, out := c.StopInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ErrorForStopInstancesOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForStopInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForStopInstancesOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForStopInstancesOutput) SetCode(v string) *ErrorForStopInstancesOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForStopInstancesOutput) SetMessage(v string) *ErrorForStopInstancesOutput { - s.Message = &v - return s -} - -type OperationDetailForStopInstancesOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForStopInstancesOutput `type:"structure"` - - InstanceId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForStopInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForStopInstancesOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForStopInstancesOutput) SetError(v *ErrorForStopInstancesOutput) *OperationDetailForStopInstancesOutput { - s.Error = v - return s -} - -// SetInstanceId sets the InstanceId field's value. -func (s *OperationDetailForStopInstancesOutput) SetInstanceId(v string) *OperationDetailForStopInstancesOutput { - s.InstanceId = &v - return s -} - -type StopInstancesInput struct { - _ struct{} `type:"structure"` - - ForceStop *bool `type:"boolean"` - - InstanceIds []*string `type:"list"` - - StoppedMode *string `type:"string"` -} - -// String returns the string representation -func (s StopInstancesInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstancesInput) GoString() string { - return s.String() -} - -// SetForceStop sets the ForceStop field's value. -func (s *StopInstancesInput) SetForceStop(v bool) *StopInstancesInput { - s.ForceStop = &v - return s -} - -// SetInstanceIds sets the InstanceIds field's value. -func (s *StopInstancesInput) SetInstanceIds(v []*string) *StopInstancesInput { - s.InstanceIds = v - return s -} - -// SetStoppedMode sets the StoppedMode field's value. -func (s *StopInstancesInput) SetStoppedMode(v string) *StopInstancesInput { - s.StoppedMode = &v - return s -} - -type StopInstancesOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForStopInstancesOutput `type:"list"` -} - -// String returns the string representation -func (s StopInstancesOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopInstancesOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *StopInstancesOutput) SetOperationDetails(v []*OperationDetailForStopInstancesOutput) *StopInstancesOutput { - s.OperationDetails = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_update_system_events.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_update_system_events.go deleted file mode 100644 index 977d73b44783..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/api_update_system_events.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const opUpdateSystemEventsCommon = "UpdateSystemEvents" - -// UpdateSystemEventsCommonRequest generates a "volcengine/request.Request" representing the -// client's request for the UpdateSystemEventsCommon operation. The "output" return -// value will be populated with the UpdateSystemEventsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned UpdateSystemEventsCommon Request to send the API call to the service. -// the "output" return value is not valid until after UpdateSystemEventsCommon Send returns without error. -// -// See UpdateSystemEventsCommon for more information on using the UpdateSystemEventsCommon -// API call, and error handling. -// -// // Example sending a request using the UpdateSystemEventsCommonRequest method. -// req, resp := client.UpdateSystemEventsCommonRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) UpdateSystemEventsCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { - op := &request.Operation{ - Name: opUpdateSystemEventsCommon, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &map[string]interface{}{} - } - - output = &map[string]interface{}{} - req = c.newRequest(op, input, output) - - return -} - -// UpdateSystemEventsCommon API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation UpdateSystemEventsCommon for usage and error information. -func (c *ECS) UpdateSystemEventsCommon(input *map[string]interface{}) (*map[string]interface{}, error) { - req, out := c.UpdateSystemEventsCommonRequest(input) - return out, req.Send() -} - -// UpdateSystemEventsCommonWithContext is the same as UpdateSystemEventsCommon with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSystemEventsCommon 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 *ECS) UpdateSystemEventsCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { - req, out := c.UpdateSystemEventsCommonRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateSystemEvents = "UpdateSystemEvents" - -// UpdateSystemEventsRequest generates a "volcengine/request.Request" representing the -// client's request for the UpdateSystemEvents operation. The "output" return -// value will be populated with the UpdateSystemEventsCommon request's response once the request completes -// successfully. -// -// Use "Send" method on the returned UpdateSystemEventsCommon Request to send the API call to the service. -// the "output" return value is not valid until after UpdateSystemEventsCommon Send returns without error. -// -// See UpdateSystemEvents for more information on using the UpdateSystemEvents -// API call, and error handling. -// -// // Example sending a request using the UpdateSystemEventsRequest method. -// req, resp := client.UpdateSystemEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -func (c *ECS) UpdateSystemEventsRequest(input *UpdateSystemEventsInput) (req *request.Request, output *UpdateSystemEventsOutput) { - op := &request.Operation{ - Name: opUpdateSystemEvents, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateSystemEventsInput{} - } - - output = &UpdateSystemEventsOutput{} - req = c.newRequest(op, input, output) - - return -} - -// UpdateSystemEvents API operation for ECS. -// -// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions -// with volcengineerr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the VOLCENGINE API reference guide for ECS's -// API operation UpdateSystemEvents for usage and error information. -func (c *ECS) UpdateSystemEvents(input *UpdateSystemEventsInput) (*UpdateSystemEventsOutput, error) { - req, out := c.UpdateSystemEventsRequest(input) - return out, req.Send() -} - -// UpdateSystemEventsWithContext is the same as UpdateSystemEvents with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateSystemEvents for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. Ifthe 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 *ECS) UpdateSystemEventsWithContext(ctx volcengine.Context, input *UpdateSystemEventsInput, opts ...request.Option) (*UpdateSystemEventsOutput, error) { - req, out := c.UpdateSystemEventsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -type ErrorForUpdateSystemEventsOutput struct { - _ struct{} `type:"structure"` - - Code *string `type:"string"` - - Message *string `type:"string"` -} - -// String returns the string representation -func (s ErrorForUpdateSystemEventsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s ErrorForUpdateSystemEventsOutput) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *ErrorForUpdateSystemEventsOutput) SetCode(v string) *ErrorForUpdateSystemEventsOutput { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ErrorForUpdateSystemEventsOutput) SetMessage(v string) *ErrorForUpdateSystemEventsOutput { - s.Message = &v - return s -} - -type OperationDetailForUpdateSystemEventsOutput struct { - _ struct{} `type:"structure"` - - Error *ErrorForUpdateSystemEventsOutput `type:"structure"` - - EventId *string `type:"string"` -} - -// String returns the string representation -func (s OperationDetailForUpdateSystemEventsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s OperationDetailForUpdateSystemEventsOutput) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *OperationDetailForUpdateSystemEventsOutput) SetError(v *ErrorForUpdateSystemEventsOutput) *OperationDetailForUpdateSystemEventsOutput { - s.Error = v - return s -} - -// SetEventId sets the EventId field's value. -func (s *OperationDetailForUpdateSystemEventsOutput) SetEventId(v string) *OperationDetailForUpdateSystemEventsOutput { - s.EventId = &v - return s -} - -type UpdateSystemEventsInput struct { - _ struct{} `type:"structure"` - - EventIds []*string `type:"list"` - - OperatedEndAt *string `type:"string"` - - OperatedStartAt *string `type:"string"` - - Status *string `type:"string"` - - UpdatedAt *string `type:"string"` -} - -// String returns the string representation -func (s UpdateSystemEventsInput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSystemEventsInput) GoString() string { - return s.String() -} - -// SetEventIds sets the EventIds field's value. -func (s *UpdateSystemEventsInput) SetEventIds(v []*string) *UpdateSystemEventsInput { - s.EventIds = v - return s -} - -// SetOperatedEndAt sets the OperatedEndAt field's value. -func (s *UpdateSystemEventsInput) SetOperatedEndAt(v string) *UpdateSystemEventsInput { - s.OperatedEndAt = &v - return s -} - -// SetOperatedStartAt sets the OperatedStartAt field's value. -func (s *UpdateSystemEventsInput) SetOperatedStartAt(v string) *UpdateSystemEventsInput { - s.OperatedStartAt = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateSystemEventsInput) SetStatus(v string) *UpdateSystemEventsInput { - s.Status = &v - return s -} - -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *UpdateSystemEventsInput) SetUpdatedAt(v string) *UpdateSystemEventsInput { - s.UpdatedAt = &v - return s -} - -type UpdateSystemEventsOutput struct { - _ struct{} `type:"structure"` - - Metadata *response.ResponseMetadata - - OperationDetails []*OperationDetailForUpdateSystemEventsOutput `type:"list"` -} - -// String returns the string representation -func (s UpdateSystemEventsOutput) String() string { - return volcengineutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateSystemEventsOutput) GoString() string { - return s.String() -} - -// SetOperationDetails sets the OperationDetails field's value. -func (s *UpdateSystemEventsOutput) SetOperationDetails(v []*OperationDetailForUpdateSystemEventsOutput) *UpdateSystemEventsOutput { - s.OperationDetails = v - return s -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/interface_ecs.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/interface_ecs.go deleted file mode 100644 index a2831143177a..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/interface_ecs.go +++ /dev/null @@ -1,449 +0,0 @@ -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package ecsiface provides an interface to enable mocking the ECS service client -// for testing your code. -// -// It is important to note that this interface will have breaking changes -// when the service model is updated and adds new API operations, paginators, -// and waiters. -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// ECSAPI provides an interface to enable mocking the -// ecs.ECS service client's API operation, -// -// // volcengine sdk func uses an SDK service client to make a request to -// // ECS. -// func myFunc(svc ECSAPI) bool { -// // Make svc.AssociateInstancesIamRole request -// } -// -// func main() { -// sess := session.New() -// svc := ecs.New(sess) -// -// myFunc(svc) -// } -type ECSAPI interface { - AssociateInstancesIamRoleCommon(*map[string]interface{}) (*map[string]interface{}, error) - AssociateInstancesIamRoleCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - AssociateInstancesIamRoleCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - AssociateInstancesIamRole(*AssociateInstancesIamRoleInput) (*AssociateInstancesIamRoleOutput, error) - AssociateInstancesIamRoleWithContext(volcengine.Context, *AssociateInstancesIamRoleInput, ...request.Option) (*AssociateInstancesIamRoleOutput, error) - AssociateInstancesIamRoleRequest(*AssociateInstancesIamRoleInput) (*request.Request, *AssociateInstancesIamRoleOutput) - - AttachKeyPairCommon(*map[string]interface{}) (*map[string]interface{}, error) - AttachKeyPairCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - AttachKeyPairCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - AttachKeyPair(*AttachKeyPairInput) (*AttachKeyPairOutput, error) - AttachKeyPairWithContext(volcengine.Context, *AttachKeyPairInput, ...request.Option) (*AttachKeyPairOutput, error) - AttachKeyPairRequest(*AttachKeyPairInput) (*request.Request, *AttachKeyPairOutput) - - CreateDeploymentSetCommon(*map[string]interface{}) (*map[string]interface{}, error) - CreateDeploymentSetCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CreateDeploymentSetCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CreateDeploymentSet(*CreateDeploymentSetInput) (*CreateDeploymentSetOutput, error) - CreateDeploymentSetWithContext(volcengine.Context, *CreateDeploymentSetInput, ...request.Option) (*CreateDeploymentSetOutput, error) - CreateDeploymentSetRequest(*CreateDeploymentSetInput) (*request.Request, *CreateDeploymentSetOutput) - - CreateImageCommon(*map[string]interface{}) (*map[string]interface{}, error) - CreateImageCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CreateImageCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CreateImage(*CreateImageInput) (*CreateImageOutput, error) - CreateImageWithContext(volcengine.Context, *CreateImageInput, ...request.Option) (*CreateImageOutput, error) - CreateImageRequest(*CreateImageInput) (*request.Request, *CreateImageOutput) - - CreateKeyPairCommon(*map[string]interface{}) (*map[string]interface{}, error) - CreateKeyPairCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CreateKeyPairCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CreateKeyPair(*CreateKeyPairInput) (*CreateKeyPairOutput, error) - CreateKeyPairWithContext(volcengine.Context, *CreateKeyPairInput, ...request.Option) (*CreateKeyPairOutput, error) - CreateKeyPairRequest(*CreateKeyPairInput) (*request.Request, *CreateKeyPairOutput) - - CreateTagsCommon(*map[string]interface{}) (*map[string]interface{}, error) - CreateTagsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - CreateTagsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - CreateTags(*CreateTagsInput) (*CreateTagsOutput, error) - CreateTagsWithContext(volcengine.Context, *CreateTagsInput, ...request.Option) (*CreateTagsOutput, error) - CreateTagsRequest(*CreateTagsInput) (*request.Request, *CreateTagsOutput) - - DeleteDeploymentSetCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteDeploymentSetCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteDeploymentSetCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteDeploymentSet(*DeleteDeploymentSetInput) (*DeleteDeploymentSetOutput, error) - DeleteDeploymentSetWithContext(volcengine.Context, *DeleteDeploymentSetInput, ...request.Option) (*DeleteDeploymentSetOutput, error) - DeleteDeploymentSetRequest(*DeleteDeploymentSetInput) (*request.Request, *DeleteDeploymentSetOutput) - - DeleteImagesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteImagesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteImagesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteImages(*DeleteImagesInput) (*DeleteImagesOutput, error) - DeleteImagesWithContext(volcengine.Context, *DeleteImagesInput, ...request.Option) (*DeleteImagesOutput, error) - DeleteImagesRequest(*DeleteImagesInput) (*request.Request, *DeleteImagesOutput) - - DeleteInstanceCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteInstanceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteInstanceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteInstance(*DeleteInstanceInput) (*DeleteInstanceOutput, error) - DeleteInstanceWithContext(volcengine.Context, *DeleteInstanceInput, ...request.Option) (*DeleteInstanceOutput, error) - DeleteInstanceRequest(*DeleteInstanceInput) (*request.Request, *DeleteInstanceOutput) - - DeleteInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteInstances(*DeleteInstancesInput) (*DeleteInstancesOutput, error) - DeleteInstancesWithContext(volcengine.Context, *DeleteInstancesInput, ...request.Option) (*DeleteInstancesOutput, error) - DeleteInstancesRequest(*DeleteInstancesInput) (*request.Request, *DeleteInstancesOutput) - - DeleteKeyPairsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteKeyPairsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteKeyPairsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteKeyPairs(*DeleteKeyPairsInput) (*DeleteKeyPairsOutput, error) - DeleteKeyPairsWithContext(volcengine.Context, *DeleteKeyPairsInput, ...request.Option) (*DeleteKeyPairsOutput, error) - DeleteKeyPairsRequest(*DeleteKeyPairsInput) (*request.Request, *DeleteKeyPairsOutput) - - DeleteTagsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DeleteTagsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DeleteTagsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DeleteTags(*DeleteTagsInput) (*DeleteTagsOutput, error) - DeleteTagsWithContext(volcengine.Context, *DeleteTagsInput, ...request.Option) (*DeleteTagsOutput, error) - DeleteTagsRequest(*DeleteTagsInput) (*request.Request, *DeleteTagsOutput) - - DescribeAvailableResourceCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeAvailableResourceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeAvailableResourceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeAvailableResource(*DescribeAvailableResourceInput) (*DescribeAvailableResourceOutput, error) - DescribeAvailableResourceWithContext(volcengine.Context, *DescribeAvailableResourceInput, ...request.Option) (*DescribeAvailableResourceOutput, error) - DescribeAvailableResourceRequest(*DescribeAvailableResourceInput) (*request.Request, *DescribeAvailableResourceOutput) - - DescribeDeploymentSetSupportedInstanceTypeFamilyCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeDeploymentSetSupportedInstanceTypeFamilyCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeDeploymentSetSupportedInstanceTypeFamilyCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeDeploymentSetSupportedInstanceTypeFamily(*DescribeDeploymentSetSupportedInstanceTypeFamilyInput) (*DescribeDeploymentSetSupportedInstanceTypeFamilyOutput, error) - DescribeDeploymentSetSupportedInstanceTypeFamilyWithContext(volcengine.Context, *DescribeDeploymentSetSupportedInstanceTypeFamilyInput, ...request.Option) (*DescribeDeploymentSetSupportedInstanceTypeFamilyOutput, error) - DescribeDeploymentSetSupportedInstanceTypeFamilyRequest(*DescribeDeploymentSetSupportedInstanceTypeFamilyInput) (*request.Request, *DescribeDeploymentSetSupportedInstanceTypeFamilyOutput) - - DescribeDeploymentSetsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeDeploymentSetsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeDeploymentSetsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeDeploymentSets(*DescribeDeploymentSetsInput) (*DescribeDeploymentSetsOutput, error) - DescribeDeploymentSetsWithContext(volcengine.Context, *DescribeDeploymentSetsInput, ...request.Option) (*DescribeDeploymentSetsOutput, error) - DescribeDeploymentSetsRequest(*DescribeDeploymentSetsInput) (*request.Request, *DescribeDeploymentSetsOutput) - - DescribeImageSharePermissionCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeImageSharePermissionCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeImageSharePermissionCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeImageSharePermission(*DescribeImageSharePermissionInput) (*DescribeImageSharePermissionOutput, error) - DescribeImageSharePermissionWithContext(volcengine.Context, *DescribeImageSharePermissionInput, ...request.Option) (*DescribeImageSharePermissionOutput, error) - DescribeImageSharePermissionRequest(*DescribeImageSharePermissionInput) (*request.Request, *DescribeImageSharePermissionOutput) - - DescribeImagesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeImagesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeImagesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeImages(*DescribeImagesInput) (*DescribeImagesOutput, error) - DescribeImagesWithContext(volcengine.Context, *DescribeImagesInput, ...request.Option) (*DescribeImagesOutput, error) - DescribeImagesRequest(*DescribeImagesInput) (*request.Request, *DescribeImagesOutput) - - DescribeInstanceECSTerminalUrlCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeInstanceECSTerminalUrlCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeInstanceECSTerminalUrlCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeInstanceECSTerminalUrl(*DescribeInstanceECSTerminalUrlInput) (*DescribeInstanceECSTerminalUrlOutput, error) - DescribeInstanceECSTerminalUrlWithContext(volcengine.Context, *DescribeInstanceECSTerminalUrlInput, ...request.Option) (*DescribeInstanceECSTerminalUrlOutput, error) - DescribeInstanceECSTerminalUrlRequest(*DescribeInstanceECSTerminalUrlInput) (*request.Request, *DescribeInstanceECSTerminalUrlOutput) - - DescribeInstanceTypeFamiliesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeInstanceTypeFamiliesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeInstanceTypeFamiliesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeInstanceTypeFamilies(*DescribeInstanceTypeFamiliesInput) (*DescribeInstanceTypeFamiliesOutput, error) - DescribeInstanceTypeFamiliesWithContext(volcengine.Context, *DescribeInstanceTypeFamiliesInput, ...request.Option) (*DescribeInstanceTypeFamiliesOutput, error) - DescribeInstanceTypeFamiliesRequest(*DescribeInstanceTypeFamiliesInput) (*request.Request, *DescribeInstanceTypeFamiliesOutput) - - DescribeInstanceTypesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeInstanceTypesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeInstanceTypesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeInstanceTypes(*DescribeInstanceTypesInput) (*DescribeInstanceTypesOutput, error) - DescribeInstanceTypesWithContext(volcengine.Context, *DescribeInstanceTypesInput, ...request.Option) (*DescribeInstanceTypesOutput, error) - DescribeInstanceTypesRequest(*DescribeInstanceTypesInput) (*request.Request, *DescribeInstanceTypesOutput) - - DescribeInstanceVncUrlCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeInstanceVncUrlCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeInstanceVncUrlCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeInstanceVncUrl(*DescribeInstanceVncUrlInput) (*DescribeInstanceVncUrlOutput, error) - DescribeInstanceVncUrlWithContext(volcengine.Context, *DescribeInstanceVncUrlInput, ...request.Option) (*DescribeInstanceVncUrlOutput, error) - DescribeInstanceVncUrlRequest(*DescribeInstanceVncUrlInput) (*request.Request, *DescribeInstanceVncUrlOutput) - - DescribeInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeInstances(*DescribeInstancesInput) (*DescribeInstancesOutput, error) - DescribeInstancesWithContext(volcengine.Context, *DescribeInstancesInput, ...request.Option) (*DescribeInstancesOutput, error) - DescribeInstancesRequest(*DescribeInstancesInput) (*request.Request, *DescribeInstancesOutput) - - DescribeInstancesIamRolesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeInstancesIamRolesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeInstancesIamRolesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeInstancesIamRoles(*DescribeInstancesIamRolesInput) (*DescribeInstancesIamRolesOutput, error) - DescribeInstancesIamRolesWithContext(volcengine.Context, *DescribeInstancesIamRolesInput, ...request.Option) (*DescribeInstancesIamRolesOutput, error) - DescribeInstancesIamRolesRequest(*DescribeInstancesIamRolesInput) (*request.Request, *DescribeInstancesIamRolesOutput) - - DescribeKeyPairsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeKeyPairsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeKeyPairsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeKeyPairs(*DescribeKeyPairsInput) (*DescribeKeyPairsOutput, error) - DescribeKeyPairsWithContext(volcengine.Context, *DescribeKeyPairsInput, ...request.Option) (*DescribeKeyPairsOutput, error) - DescribeKeyPairsRequest(*DescribeKeyPairsInput) (*request.Request, *DescribeKeyPairsOutput) - - DescribeSystemEventsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeSystemEventsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeSystemEventsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeSystemEvents(*DescribeSystemEventsInput) (*DescribeSystemEventsOutput, error) - DescribeSystemEventsWithContext(volcengine.Context, *DescribeSystemEventsInput, ...request.Option) (*DescribeSystemEventsOutput, error) - DescribeSystemEventsRequest(*DescribeSystemEventsInput) (*request.Request, *DescribeSystemEventsOutput) - - DescribeTagsCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeTagsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeTagsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeTags(*DescribeTagsInput) (*DescribeTagsOutput, error) - DescribeTagsWithContext(volcengine.Context, *DescribeTagsInput, ...request.Option) (*DescribeTagsOutput, error) - DescribeTagsRequest(*DescribeTagsInput) (*request.Request, *DescribeTagsOutput) - - DescribeTasksCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeTasksCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeTasksCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeTasks(*DescribeTasksInput) (*DescribeTasksOutput, error) - DescribeTasksWithContext(volcengine.Context, *DescribeTasksInput, ...request.Option) (*DescribeTasksOutput, error) - DescribeTasksRequest(*DescribeTasksInput) (*request.Request, *DescribeTasksOutput) - - DescribeUserDataCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeUserDataCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeUserDataCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeUserData(*DescribeUserDataInput) (*DescribeUserDataOutput, error) - DescribeUserDataWithContext(volcengine.Context, *DescribeUserDataInput, ...request.Option) (*DescribeUserDataOutput, error) - DescribeUserDataRequest(*DescribeUserDataInput) (*request.Request, *DescribeUserDataOutput) - - DescribeZonesCommon(*map[string]interface{}) (*map[string]interface{}, error) - DescribeZonesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DescribeZonesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DescribeZones(*DescribeZonesInput) (*DescribeZonesOutput, error) - DescribeZonesWithContext(volcengine.Context, *DescribeZonesInput, ...request.Option) (*DescribeZonesOutput, error) - DescribeZonesRequest(*DescribeZonesInput) (*request.Request, *DescribeZonesOutput) - - DetachKeyPairCommon(*map[string]interface{}) (*map[string]interface{}, error) - DetachKeyPairCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DetachKeyPairCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DetachKeyPair(*DetachKeyPairInput) (*DetachKeyPairOutput, error) - DetachKeyPairWithContext(volcengine.Context, *DetachKeyPairInput, ...request.Option) (*DetachKeyPairOutput, error) - DetachKeyPairRequest(*DetachKeyPairInput) (*request.Request, *DetachKeyPairOutput) - - DisassociateInstancesIamRoleCommon(*map[string]interface{}) (*map[string]interface{}, error) - DisassociateInstancesIamRoleCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - DisassociateInstancesIamRoleCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - DisassociateInstancesIamRole(*DisassociateInstancesIamRoleInput) (*DisassociateInstancesIamRoleOutput, error) - DisassociateInstancesIamRoleWithContext(volcengine.Context, *DisassociateInstancesIamRoleInput, ...request.Option) (*DisassociateInstancesIamRoleOutput, error) - DisassociateInstancesIamRoleRequest(*DisassociateInstancesIamRoleInput) (*request.Request, *DisassociateInstancesIamRoleOutput) - - ExportImageCommon(*map[string]interface{}) (*map[string]interface{}, error) - ExportImageCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ExportImageCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ExportImage(*ExportImageInput) (*ExportImageOutput, error) - ExportImageWithContext(volcengine.Context, *ExportImageInput, ...request.Option) (*ExportImageOutput, error) - ExportImageRequest(*ExportImageInput) (*request.Request, *ExportImageOutput) - - ImportImageCommon(*map[string]interface{}) (*map[string]interface{}, error) - ImportImageCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ImportImageCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ImportImage(*ImportImageInput) (*ImportImageOutput, error) - ImportImageWithContext(volcengine.Context, *ImportImageInput, ...request.Option) (*ImportImageOutput, error) - ImportImageRequest(*ImportImageInput) (*request.Request, *ImportImageOutput) - - ImportKeyPairCommon(*map[string]interface{}) (*map[string]interface{}, error) - ImportKeyPairCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ImportKeyPairCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ImportKeyPair(*ImportKeyPairInput) (*ImportKeyPairOutput, error) - ImportKeyPairWithContext(volcengine.Context, *ImportKeyPairInput, ...request.Option) (*ImportKeyPairOutput, error) - ImportKeyPairRequest(*ImportKeyPairInput) (*request.Request, *ImportKeyPairOutput) - - ModifyDeploymentSetAttributeCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyDeploymentSetAttributeCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyDeploymentSetAttributeCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyDeploymentSetAttribute(*ModifyDeploymentSetAttributeInput) (*ModifyDeploymentSetAttributeOutput, error) - ModifyDeploymentSetAttributeWithContext(volcengine.Context, *ModifyDeploymentSetAttributeInput, ...request.Option) (*ModifyDeploymentSetAttributeOutput, error) - ModifyDeploymentSetAttributeRequest(*ModifyDeploymentSetAttributeInput) (*request.Request, *ModifyDeploymentSetAttributeOutput) - - ModifyImageAttributeCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyImageAttributeCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyImageAttributeCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyImageAttribute(*ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) - ModifyImageAttributeWithContext(volcengine.Context, *ModifyImageAttributeInput, ...request.Option) (*ModifyImageAttributeOutput, error) - ModifyImageAttributeRequest(*ModifyImageAttributeInput) (*request.Request, *ModifyImageAttributeOutput) - - ModifyImageSharePermissionCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyImageSharePermissionCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyImageSharePermissionCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyImageSharePermission(*ModifyImageSharePermissionInput) (*ModifyImageSharePermissionOutput, error) - ModifyImageSharePermissionWithContext(volcengine.Context, *ModifyImageSharePermissionInput, ...request.Option) (*ModifyImageSharePermissionOutput, error) - ModifyImageSharePermissionRequest(*ModifyImageSharePermissionInput) (*request.Request, *ModifyImageSharePermissionOutput) - - ModifyInstanceAttributeCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyInstanceAttributeCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyInstanceAttributeCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyInstanceAttribute(*ModifyInstanceAttributeInput) (*ModifyInstanceAttributeOutput, error) - ModifyInstanceAttributeWithContext(volcengine.Context, *ModifyInstanceAttributeInput, ...request.Option) (*ModifyInstanceAttributeOutput, error) - ModifyInstanceAttributeRequest(*ModifyInstanceAttributeInput) (*request.Request, *ModifyInstanceAttributeOutput) - - ModifyInstanceChargeTypeCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyInstanceChargeTypeCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyInstanceChargeTypeCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyInstanceChargeType(*ModifyInstanceChargeTypeInput) (*ModifyInstanceChargeTypeOutput, error) - ModifyInstanceChargeTypeWithContext(volcengine.Context, *ModifyInstanceChargeTypeInput, ...request.Option) (*ModifyInstanceChargeTypeOutput, error) - ModifyInstanceChargeTypeRequest(*ModifyInstanceChargeTypeInput) (*request.Request, *ModifyInstanceChargeTypeOutput) - - ModifyInstanceDeploymentCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyInstanceDeploymentCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyInstanceDeploymentCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyInstanceDeployment(*ModifyInstanceDeploymentInput) (*ModifyInstanceDeploymentOutput, error) - ModifyInstanceDeploymentWithContext(volcengine.Context, *ModifyInstanceDeploymentInput, ...request.Option) (*ModifyInstanceDeploymentOutput, error) - ModifyInstanceDeploymentRequest(*ModifyInstanceDeploymentInput) (*request.Request, *ModifyInstanceDeploymentOutput) - - ModifyInstanceSpecCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyInstanceSpecCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyInstanceSpecCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyInstanceSpec(*ModifyInstanceSpecInput) (*ModifyInstanceSpecOutput, error) - ModifyInstanceSpecWithContext(volcengine.Context, *ModifyInstanceSpecInput, ...request.Option) (*ModifyInstanceSpecOutput, error) - ModifyInstanceSpecRequest(*ModifyInstanceSpecInput) (*request.Request, *ModifyInstanceSpecOutput) - - ModifyKeyPairAttributeCommon(*map[string]interface{}) (*map[string]interface{}, error) - ModifyKeyPairAttributeCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ModifyKeyPairAttributeCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ModifyKeyPairAttribute(*ModifyKeyPairAttributeInput) (*ModifyKeyPairAttributeOutput, error) - ModifyKeyPairAttributeWithContext(volcengine.Context, *ModifyKeyPairAttributeInput, ...request.Option) (*ModifyKeyPairAttributeOutput, error) - ModifyKeyPairAttributeRequest(*ModifyKeyPairAttributeInput) (*request.Request, *ModifyKeyPairAttributeOutput) - - RebootInstanceCommon(*map[string]interface{}) (*map[string]interface{}, error) - RebootInstanceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - RebootInstanceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - RebootInstance(*RebootInstanceInput) (*RebootInstanceOutput, error) - RebootInstanceWithContext(volcengine.Context, *RebootInstanceInput, ...request.Option) (*RebootInstanceOutput, error) - RebootInstanceRequest(*RebootInstanceInput) (*request.Request, *RebootInstanceOutput) - - RebootInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - RebootInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - RebootInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - RebootInstances(*RebootInstancesInput) (*RebootInstancesOutput, error) - RebootInstancesWithContext(volcengine.Context, *RebootInstancesInput, ...request.Option) (*RebootInstancesOutput, error) - RebootInstancesRequest(*RebootInstancesInput) (*request.Request, *RebootInstancesOutput) - - RenewInstanceCommon(*map[string]interface{}) (*map[string]interface{}, error) - RenewInstanceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - RenewInstanceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - RenewInstance(*RenewInstanceInput) (*RenewInstanceOutput, error) - RenewInstanceWithContext(volcengine.Context, *RenewInstanceInput, ...request.Option) (*RenewInstanceOutput, error) - RenewInstanceRequest(*RenewInstanceInput) (*request.Request, *RenewInstanceOutput) - - ReplaceSystemVolumeCommon(*map[string]interface{}) (*map[string]interface{}, error) - ReplaceSystemVolumeCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - ReplaceSystemVolumeCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - ReplaceSystemVolume(*ReplaceSystemVolumeInput) (*ReplaceSystemVolumeOutput, error) - ReplaceSystemVolumeWithContext(volcengine.Context, *ReplaceSystemVolumeInput, ...request.Option) (*ReplaceSystemVolumeOutput, error) - ReplaceSystemVolumeRequest(*ReplaceSystemVolumeInput) (*request.Request, *ReplaceSystemVolumeOutput) - - RunInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - RunInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - RunInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - RunInstances(*RunInstancesInput) (*RunInstancesOutput, error) - RunInstancesWithContext(volcengine.Context, *RunInstancesInput, ...request.Option) (*RunInstancesOutput, error) - RunInstancesRequest(*RunInstancesInput) (*request.Request, *RunInstancesOutput) - - StartInstanceCommon(*map[string]interface{}) (*map[string]interface{}, error) - StartInstanceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - StartInstanceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - StartInstance(*StartInstanceInput) (*StartInstanceOutput, error) - StartInstanceWithContext(volcengine.Context, *StartInstanceInput, ...request.Option) (*StartInstanceOutput, error) - StartInstanceRequest(*StartInstanceInput) (*request.Request, *StartInstanceOutput) - - StartInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - StartInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - StartInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - StartInstances(*StartInstancesInput) (*StartInstancesOutput, error) - StartInstancesWithContext(volcengine.Context, *StartInstancesInput, ...request.Option) (*StartInstancesOutput, error) - StartInstancesRequest(*StartInstancesInput) (*request.Request, *StartInstancesOutput) - - StopInstanceCommon(*map[string]interface{}) (*map[string]interface{}, error) - StopInstanceCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - StopInstanceCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - StopInstance(*StopInstanceInput) (*StopInstanceOutput, error) - StopInstanceWithContext(volcengine.Context, *StopInstanceInput, ...request.Option) (*StopInstanceOutput, error) - StopInstanceRequest(*StopInstanceInput) (*request.Request, *StopInstanceOutput) - - StopInstancesCommon(*map[string]interface{}) (*map[string]interface{}, error) - StopInstancesCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - StopInstancesCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - StopInstances(*StopInstancesInput) (*StopInstancesOutput, error) - StopInstancesWithContext(volcengine.Context, *StopInstancesInput, ...request.Option) (*StopInstancesOutput, error) - StopInstancesRequest(*StopInstancesInput) (*request.Request, *StopInstancesOutput) - - UpdateSystemEventsCommon(*map[string]interface{}) (*map[string]interface{}, error) - UpdateSystemEventsCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) - UpdateSystemEventsCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) - - UpdateSystemEvents(*UpdateSystemEventsInput) (*UpdateSystemEventsOutput, error) - UpdateSystemEventsWithContext(volcengine.Context, *UpdateSystemEventsInput, ...request.Option) (*UpdateSystemEventsOutput, error) - UpdateSystemEventsRequest(*UpdateSystemEventsInput) (*request.Request, *UpdateSystemEventsOutput) -} - -var _ ECSAPI = (*ECS)(nil) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/service_ecs.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/service_ecs.go deleted file mode 100644 index a363fca06a42..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs/service_ecs.go +++ /dev/null @@ -1,105 +0,0 @@ -/* -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. -*/ - -// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. - -package ecs - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/signer/volc" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery" -) - -// ECS provides the API operation methods for making requests to -// ECS. See this package's package overview docs -// for details on the service. -// -// ECS methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ECS struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "ecs" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "ecs" // ServiceID is a unique identifer of a specific service. -) - -// New create int can support ssl or region locate set -func New(p client.ConfigProvider, cfgs ...*volcengine.Config) *ECS { - c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg volcengine.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ECS { - svc := &ECS{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - Endpoint: endpoint, - APIVersion: "2020-04-01", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) - svc.Handlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHandler) - svc.Handlers.Sign.PushBackNamed(volc.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(volcenginequery.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(volcenginequery.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(volcenginequery.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(volcenginequery.UnmarshalErrorHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ECS operation and runs any -// custom request initialization. -func (c *ECS) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/client.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/client.go deleted file mode 100644 index 2d4d8128ed85..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/client.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -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 client - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// A Config provides configuration to a service client instance. -type Config struct { - Config *volcengine.Config - Handlers request.Handlers - Endpoint string - SigningRegion string - SigningName string - - // States that the signing name did not come from a modeled source but - // was derived based on other data. Used by service client constructors - // to determine if the signin name can be overridden based on metadata the - // service has. - SigningNameDerived bool -} - -// ConfigProvider provides a generic way for a service client to receive -// the ClientConfig without circular dependencies. -type ConfigProvider interface { - ClientConfig(serviceName string, cfgs ...*volcengine.Config) Config -} - -// ConfigNoResolveEndpointProvider same as ConfigProvider except it will not -// resolve the endpoint automatically. The service client's endpoint must be -// provided via the volcengine.Config.Endpoint field. -type ConfigNoResolveEndpointProvider interface { - ClientConfigNoResolveEndpoint(cfgs ...*volcengine.Config) Config -} - -// A Client implements the base client request and response handling -// used by all service clients. -type Client struct { - request.Retryer - metadata.ClientInfo - - Config volcengine.Config - Handlers request.Handlers -} - -// New will return a pointer to a new initialized service client. -func New(cfg volcengine.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client { - svc := &Client{ - Config: cfg, - ClientInfo: info, - Handlers: handlers.Copy(), - } - - switch retryer, ok := cfg.Retryer.(request.Retryer); { - case ok: - svc.Retryer = retryer - case cfg.Retryer != nil && cfg.Logger != nil: - s := fmt.Sprintf("WARNING: %T does not implement request.Retryer; using DefaultRetryer instead", cfg.Retryer) - cfg.Logger.Log(s) - fallthrough - default: - maxRetries := volcengine.IntValue(cfg.MaxRetries) - if cfg.MaxRetries == nil || maxRetries == volcengine.UseServiceDefaultRetries { - maxRetries = DefaultRetryerMaxNumRetries - } - svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries} - } - - svc.AddDebugHandlers() - - for _, option := range options { - option(svc) - } - - return svc -} - -// NewRequest returns a new Request pointer for the service API -// operation and parameters. -func (c *Client) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request { - return request.New(c.Config, c.ClientInfo, c.Handlers, c.Retryer, operation, params, data) -} - -// AddDebugHandlers injects debug logging handlers into the service to log request -// debug information. -func (c *Client) AddDebugHandlers() { - if !c.Config.LogLevel.AtLeast(volcengine.LogDebug) { - return - } - if c.Config.LogLevel.Matches(volcengine.LogInfoWithInputAndOutput) || - c.Config.LogLevel.Matches(volcengine.LogDebugWithInputAndOutput) { - c.Handlers.Send.PushFrontNamed(LogInputHandler) - c.Handlers.Complete.PushBackNamed(LogOutHandler) - return - } - - c.Handlers.Send.PushFrontNamed(LogHTTPRequestHandler) - c.Handlers.Send.PushBackNamed(LogHTTPResponseHandler) - -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/default_retryer.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/default_retryer.go deleted file mode 100644 index b4fa9e973a7d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/default_retryer.go +++ /dev/null @@ -1,195 +0,0 @@ -/* -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 client - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "math" - "strconv" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkrand" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// DefaultRetryer implements basic retry logic using exponential backoff for -// most services. If you want to implement custom retry logic, you can implement the -// request.Retryer interface. -type DefaultRetryer struct { - // Num max Retries is the number of max retries that will be performed. - // By default, this is zero. - NumMaxRetries int - - // MinRetryDelay is the minimum retry delay after which retry will be performed. - // If not set, the value is 0ns. - MinRetryDelay time.Duration - - // MinThrottleRetryDelay is the minimum retry delay when throttled. - // If not set, the value is 0ns. - MinThrottleDelay time.Duration - - // MaxRetryDelay is the maximum retry delay before which retry must be performed. - // If not set, the value is 0ns. - MaxRetryDelay time.Duration - - // MaxThrottleDelay is the maximum retry delay when throttled. - // If not set, the value is 0ns. - MaxThrottleDelay time.Duration -} - -const ( - // DefaultRetryerMaxNumRetries sets maximum number of retries - DefaultRetryerMaxNumRetries = 3 - - // DefaultRetryerMinRetryDelay sets minimum retry delay - DefaultRetryerMinRetryDelay = 30 * time.Millisecond - - // DefaultRetryerMinThrottleDelay sets minimum delay when throttled - DefaultRetryerMinThrottleDelay = 500 * time.Millisecond - - // DefaultRetryerMaxRetryDelay sets maximum retry delay - DefaultRetryerMaxRetryDelay = 300 * time.Second - - // DefaultRetryerMaxThrottleDelay sets maximum delay when throttled - DefaultRetryerMaxThrottleDelay = 300 * time.Second -) - -// MaxRetries returns the number of maximum returns the service will use to make -// an individual API request. -func (d DefaultRetryer) MaxRetries() int { - return d.NumMaxRetries -} - -// setRetryerDefaults sets the default values of the retryer if not set -func (d *DefaultRetryer) setRetryerDefaults() { - if d.MinRetryDelay == 0 { - d.MinRetryDelay = DefaultRetryerMinRetryDelay - } - if d.MaxRetryDelay == 0 { - d.MaxRetryDelay = DefaultRetryerMaxRetryDelay - } - if d.MinThrottleDelay == 0 { - d.MinThrottleDelay = DefaultRetryerMinThrottleDelay - } - if d.MaxThrottleDelay == 0 { - d.MaxThrottleDelay = DefaultRetryerMaxThrottleDelay - } -} - -// RetryRules returns the delay duration before retrying this request again -func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration { - - // if number of max retries is zero, no retries will be performed. - if d.NumMaxRetries == 0 { - return 0 - } - - // Sets default value for retryer members - d.setRetryerDefaults() - - // minDelay is the minimum retryer delay - minDelay := d.MinRetryDelay - - var initialDelay time.Duration - - isThrottle := r.IsErrorThrottle() - if isThrottle { - if delay, ok := getRetryAfterDelay(r); ok { - initialDelay = delay - } - minDelay = d.MinThrottleDelay - } - - retryCount := r.RetryCount - - // maxDelay the maximum retryer delay - maxDelay := d.MaxRetryDelay - - if isThrottle { - maxDelay = d.MaxThrottleDelay - } - - var delay time.Duration - - // Logic to cap the retry count based on the minDelay provided - actualRetryCount := int(math.Log2(float64(minDelay))) + 1 - if actualRetryCount < 63-retryCount { - delay = time.Duration(1< maxDelay { - delay = getJitterDelay(maxDelay / 2) - } - } else { - delay = getJitterDelay(maxDelay / 2) - } - return delay + initialDelay -} - -// getJitterDelay returns a jittered delay for retry -func getJitterDelay(duration time.Duration) time.Duration { - return time.Duration(sdkrand.SeededRand.Int63n(int64(duration)) + int64(duration)) -} - -// ShouldRetry returns true if the request should be retried. -func (d DefaultRetryer) ShouldRetry(r *request.Request) bool { - - // ShouldRetry returns false if number of max retries is 0. - if d.NumMaxRetries == 0 { - return false - } - - // If one of the other handlers already set the retry state - // we don't want to override it based on the service's state - if r.Retryable != nil { - return *r.Retryable - } - return r.IsErrorRetryable() || r.IsErrorThrottle() -} - -// This will look in the Retry-After header, RFC 7231, for how long -// it will wait before attempting another request -func getRetryAfterDelay(r *request.Request) (time.Duration, bool) { - if !canUseRetryAfterHeader(r) { - return 0, false - } - - delayStr := r.HTTPResponse.Header.Get("Retry-After") - if len(delayStr) == 0 { - return 0, false - } - - delay, err := strconv.Atoi(delayStr) - if err != nil { - return 0, false - } - - return time.Duration(delay) * time.Second, true -} - -// Will look at the status code to see if the retry header pertains to -// the status code. -func canUseRetryAfterHeader(r *request.Request) bool { - switch r.HTTPResponse.StatusCode { - case 429: - case 503: - default: - return false - } - - return true -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/logger.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/logger.go deleted file mode 100644 index 8bf506e7b6bd..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/logger.go +++ /dev/null @@ -1,288 +0,0 @@ -/* -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 client - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "context" - "fmt" - "io" - "io/ioutil" - "net/http/httputil" - "strings" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -const logReqMsg = `DEBUG: Request %s/%s Details: ----[ REQUEST POST-SIGN ]----------------------------- -%s ------------------------------------------------------` - -const logReqErrMsg = `DEBUG ERROR: Request %s/%s: ----[ REQUEST DUMP ERROR ]----------------------------- -%s -------------------------------------------------------` - -type logWriter struct { - // Logger is what we will use to log the payload of a response. - Logger volcengine.Logger - // buf stores the contents of what has been read - buf *bytes.Buffer -} - -func (logger *logWriter) Write(b []byte) (int, error) { - return logger.buf.Write(b) -} - -type teeReaderCloser struct { - // io.Reader will be a tee reader that is used during logging. - // This structure will read from a volcenginebody and write the contents to a logger. - io.Reader - // Source is used just to close when we are done reading. - Source io.ReadCloser -} - -func (reader *teeReaderCloser) Close() error { - return reader.Source.Close() -} - -type LogStruct struct { - Level string - OperationName string - Request interface{} `json:"Request,omitempty"` - Body interface{} `json:"Body,omitempty"` - Response interface{} `json:"Response,omitempty"` - Type string - AccountId string `json:"AccountId,omitempty"` - Context context.Context -} - -func logStructLog(r *request.Request, level string, logStruct LogStruct) { - logStruct.Level = level - if r.IsJsonBody && strings.HasSuffix(logStruct.OperationName, "Request") { - logStruct.Body = r.Params - } - if r.Config.LogAccount != nil { - logStruct.AccountId = *r.Config.LogAccount(r.Context()) - } - //b, _ := json.Marshal(logStruct) - r.Config.Logger.Log(logStruct) -} - -var LogInputHandler = request.NamedHandler{ - Name: "volcenginesdk.client.LogInput", - Fn: logInput, -} - -func logInput(r *request.Request) { - logInfoStruct := r.Config.LogLevel.Matches(volcengine.LogInfoWithInputAndOutput) - logDebugStruct := r.Config.LogLevel.Matches(volcengine.LogDebugWithInputAndOutput) - - logStruct := LogStruct{ - OperationName: r.Operation.Name, - Type: "Request", - Request: r.Input, - Context: r.Context(), - } - - if logInfoStruct { - logStructLog(r, "INFO", logStruct) - } else if logDebugStruct { - logStructLog(r, "DEBUG", logStruct) - } -} - -var LogOutHandler = request.NamedHandler{ - Name: "volcenginesdk.client.LogOutput", - Fn: LogOutput, -} - -func LogOutput(r *request.Request) { - logInfoStruct := r.Config.LogLevel.Matches(volcengine.LogInfoWithInputAndOutput) - logDebugStruct := r.Config.LogLevel.Matches(volcengine.LogDebugWithInputAndOutput) - - logStruct := LogStruct{ - OperationName: r.Operation.Name, - Response: r.Data, - Type: "Response", - Context: r.Context(), - } - - if logInfoStruct { - logStructLog(r, "INFO", logStruct) - } else if logDebugStruct { - logStructLog(r, "DEBUG", logStruct) - } -} - -// LogHTTPRequestHandler is a SDK request handler to log the HTTP request sent -// to a service. Will include the HTTP request volcenginebody if the LogLevel of the -// request matches LogDebugWithHTTPBody. -var LogHTTPRequestHandler = request.NamedHandler{ - Name: "volcenginesdk.client.LogRequest", - Fn: logRequest, -} - -func logRequest(r *request.Request) { - logBody := r.Config.LogLevel.Matches(volcengine.LogDebugWithHTTPBody) - bodySeekable := volcengine.IsReaderSeekable(r.Body) - - b, err := httputil.DumpRequestOut(r.HTTPRequest, logBody) - if err != nil { - r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - - if logBody { - if !bodySeekable { - r.SetReaderBody(volcengine.ReadSeekCloser(r.HTTPRequest.Body)) - } - // Reset the request volcenginebody because dumpRequest will re-wrap the - // r.HTTPRequest's Body as a NoOpCloser and will not be reset after - // read by the HTTP client reader. - if err := r.Error; err != nil { - r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - } - - r.Config.Logger.Log(fmt.Sprintf(logReqMsg, - r.ClientInfo.ServiceName, r.Operation.Name, string(b))) -} - -// LogHTTPRequestHeaderHandler is a SDK request handler to log the HTTP request sent -// to a service. Will only log the HTTP request's headers. The request payload -// will not be read. -var LogHTTPRequestHeaderHandler = request.NamedHandler{ - Name: "volcenginesdk.client.LogRequestHeader", - Fn: logRequestHeader, -} - -func logRequestHeader(r *request.Request) { - if !r.Config.LogLevel.AtLeast(aws.LogDebug) || r.Config.Logger == nil { - return - } - - b, err := httputil.DumpRequestOut(r.HTTPRequest, false) - if err != nil { - r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - - r.Config.Logger.Log(fmt.Sprintf(logReqMsg, - r.ClientInfo.ServiceName, r.Operation.Name, string(b))) -} - -const logRespMsg = `DEBUG: Response %s/%s Details: ----[ RESPONSE ]-------------------------------------- -%s ------------------------------------------------------` - -const logRespErrMsg = `DEBUG ERROR: Response %s/%s: ----[ RESPONSE DUMP ERROR ]----------------------------- -%s ------------------------------------------------------` - -// LogHTTPResponseHandler is a SDK request handler to log the HTTP response -// received from a service. Will include the HTTP response volcenginebody if the LogLevel -// of the request matches LogDebugWithHTTPBody. -var LogHTTPResponseHandler = request.NamedHandler{ - Name: "volcenginesdk.client.LogResponse", - Fn: logResponse, -} - -func logResponse(r *request.Request) { - lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)} - - if r.HTTPResponse == nil { - lw.Logger.Log(fmt.Sprintf(logRespErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, "request's HTTPResponse is nil")) - return - } - - logBody := r.Config.LogLevel.Matches(volcengine.LogDebugWithHTTPBody) - if logBody { - r.HTTPResponse.Body = &teeReaderCloser{ - Reader: io.TeeReader(r.HTTPResponse.Body, lw), - Source: r.HTTPResponse.Body, - } - } - - handlerFn := func(req *request.Request) { - b, err := httputil.DumpResponse(req.HTTPResponse, false) - if err != nil { - lw.Logger.Log(fmt.Sprintf(logRespErrMsg, - req.ClientInfo.ServiceName, req.Operation.Name, err)) - return - } - - lw.Logger.Log(fmt.Sprintf(logRespMsg, - req.ClientInfo.ServiceName, req.Operation.Name, string(b))) - - if logBody { - b, err := ioutil.ReadAll(lw.buf) - if err != nil { - lw.Logger.Log(fmt.Sprintf(logRespErrMsg, - req.ClientInfo.ServiceName, req.Operation.Name, err)) - return - } - - lw.Logger.Log(string(b)) - } - } - - const handlerName = "volcenginesdk.client.LogResponse.ResponseBody" - - r.Handlers.Unmarshal.SetBackNamed(request.NamedHandler{ - Name: handlerName, Fn: handlerFn, - }) - r.Handlers.UnmarshalError.SetBackNamed(request.NamedHandler{ - Name: handlerName, Fn: handlerFn, - }) -} - -// LogHTTPResponseHeaderHandler is a SDK request handler to log the HTTP -// response received from a service. Will only log the HTTP response's headers. -// The response payload will not be read. -var LogHTTPResponseHeaderHandler = request.NamedHandler{ - Name: "volcenginesdk.client.LogResponseHeader", - Fn: logResponseHeader, -} - -func logResponseHeader(r *request.Request) { - if !r.Config.LogLevel.AtLeast(aws.LogDebug) || r.Config.Logger == nil { - return - } - - b, err := httputil.DumpResponse(r.HTTPResponse, false) - if err != nil { - r.Config.Logger.Log(fmt.Sprintf(logRespErrMsg, - r.ClientInfo.ServiceName, r.Operation.Name, err)) - return - } - - r.Config.Logger.Log(fmt.Sprintf(logRespMsg, - r.ClientInfo.ServiceName, r.Operation.Name, string(b))) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata/client_info.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata/client_info.go deleted file mode 100644 index 153ea7d067d7..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata/client_info.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -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 metadata - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// ClientInfo wraps immutable data from the client.Client structure. -type ClientInfo struct { - ServiceName string - ServiceID string - APIVersion string - Endpoint string - SigningName string - SigningRegion string - JSONVersion string - TargetPrefix string -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/no_op_retryer.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/no_op_retryer.go deleted file mode 100644 index 86aafc317eeb..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/no_op_retryer.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -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 client - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// NoOpRetryer provides a retryer that performs no retries. -// It should be used when we do not want retries to be performed. -type NoOpRetryer struct{} - -// MaxRetries returns the number of maximum returns the service will use to make -// an individual API; For NoOpRetryer the MaxRetries will always be zero. -func (d NoOpRetryer) MaxRetries() int { - return 0 -} - -// ShouldRetry will always return false for NoOpRetryer, as it should never retry. -func (d NoOpRetryer) ShouldRetry(_ *request.Request) bool { - return false -} - -// RetryRules returns the delay duration before retrying this request again; -// since NoOpRetryer does not retry, RetryRules always returns 0. -func (d NoOpRetryer) RetryRules(_ *request.Request) time.Duration { - return 0 -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/config.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/config.go deleted file mode 100644 index ee6a10607df2..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/config.go +++ /dev/null @@ -1,674 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "net/http" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/endpoints" -) - -// UseServiceDefaultRetries instructs the config to use the service's own -// default number of retries. This will be the default action if -// Config.MaxRetries is nil also. -const UseServiceDefaultRetries = -1 - -// RequestRetryer is an alias for a type that implements the request.Retryer -// interface. -type RequestRetryer interface{} - -// A Config provides service configuration for service clients. By default, -// all clients will use the defaults.DefaultConfig structure. -type Config struct { - // Enables verbose error printing of all credential chain errors. - // Should be used when wanting to see all errors while attempting to - // retrieve credentials. - CredentialsChainVerboseErrors *bool - - // The credentials object to use when signing requests. Defaults to a - // chain of credential providers to search for credentials in environment - // variables, shared credential file, and EC2 Instance Roles. - Credentials *credentials.Credentials - - // An optional endpoint URL (hostname only or fully qualified URI) - // that overrides the default generated endpoint for a client. Set this - // to `""` to use the default generated endpoint. - // - // Note: You must still provide a `Region` value when specifying an - // endpoint for a client. - Endpoint *string - - // The resolver to use for looking up endpoints for volcengine service clients - // to use based on region. - EndpointResolver endpoints.Resolver - - // EnforceShouldRetryCheck is used in the AfterRetryHandler to always call - // ShouldRetry regardless of whether or not if request.Retryable is set. - // This will utilize ShouldRetry method of custom retryers. If EnforceShouldRetryCheck - // is not set, then ShouldRetry will only be called if request.Retryable is nil. - // Proper handling of the request.Retryable field is important when setting this field. - EnforceShouldRetryCheck *bool - - // The region to send requests to. This parameter is required and must - // be configured globally or on a per-client basis unless otherwise - // noted. A full list of regions is found in the "Regions and Endpoints" - // document. - // - // Regions and Endpoints. - Region *string - - // Set this to `true` to disable SSL when sending requests. Defaults - // to `false`. - DisableSSL *bool - - // The HTTP client to use when sending requests. Defaults to - // `http.DefaultClient`. - HTTPClient *http.Client - - // An integer value representing the logging level. The default log level - // is zero (LogOff), which represents no logging. To enable logging set - // to a LogLevel Value. - LogLevel *LogLevelType - - // The logger writer interface to write logging messages to. Defaults to - // standard out. - Logger Logger - - // The maximum number of times that a request will be retried for failures. - // Defaults to -1, which defers the max retry setting to the service - // specific configuration. - MaxRetries *int - - // Retryer guides how HTTP requests should be retried in case of - // recoverable failures. - // - // When nil or the value does not implement the request.Retryer interface, - // the client.DefaultRetryer will be used. - // - // When both Retryer and MaxRetries are non-nil, the former is used and - // the latter ignored. - // - // To set the Retryer field in a type-safe manner and with chaining, use - // the request.WithRetryer helper function: - // - // cfg := request.WithRetryer(volcengine.NewConfig(), myRetryer) - // - Retryer RequestRetryer - - // Disables semantic parameter validation, which validates input for - // missing required fields and/or other semantic request input errors - // Temporary notes by xuyaming@bytedance.com because some validate field is relation. - //DisableParamValidation *bool - - // Disables the computation of request and response checksums, e.g., - //DisableComputeChecksums *bool - - // Set this to `true` to enable S3 Accelerate feature. For all operations - // compatible with S3 Accelerate will use the accelerate endpoint for - // requests. Requests not compatible will fall back to normal S3 requests. - // - // The bucket must be enable for accelerate to be used with S3 client with - // accelerate enabled. If the bucket is not enabled for accelerate an error - // will be returned. The bucket name must be DNS compatible to also work - // with accelerate. - //S3UseAccelerate *bool - - // S3DisableContentMD5Validation config option is temporarily disabled, - // For S3 GetObject API calls, #1837. - // - // Set this to `true` to disable the S3 service client from automatically - // adding the ContentMD5 to S3 Object Put and Upload API calls. This option - // will also disable the SDK from performing object ContentMD5 validation - // on GetObject API calls. - //S3DisableContentMD5Validation *bool - - // Set this to `true` to disable the EC2Metadata client from overriding the - // default http.Client's Timeout. This is helpful if you do not want the - // EC2Metadata client to create a new http.Client. This options is only - // meaningful if you're not already using a custom HTTP client with the - // SDK. Enabled by default. - // - // Must be set and provided to the session.NewSession() in order to disable - // the EC2Metadata overriding the timeout for default credentials chain. - // - // Example: - // sess := session.Must(session.NewSession(volcengine.NewConfig() - // .WithEC2MetadataDiableTimeoutOverride(true))) - // - // svc := s3.New(sess) - // - //EC2MetadataDisableTimeoutOverride *bool - - // Instructs the endpoint to be generated for a service client to - // be the dual stack endpoint. The dual stack endpoint will support - // both IPv4 and IPv6 addressing. - // - // Setting this for a service which does not support dual stack will fail - // to make requets. It is not recommended to set this value on the session - // as it will apply to all service clients created with the session. Even - // services which don't support dual stack endpoints. - // - // If the Endpoint config value is also provided the UseDualStack flag - // will be ignored. - // - // Only supported with. - // - // sess := session.Must(session.NewSession()) - // - // svc := s3.New(sess, &volcengine.Config{ - // UseDualStack: volcengine.Bool(true), - // }) - //UseDualStack *bool - - // Sets the resolver to resolve a dual-stack endpoint for the service. - UseDualStackEndpoint endpoints.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint endpoints.FIPSEndpointState - - // SleepDelay is an override for the func the SDK will call when sleeping - // during the lifecycle of a request. Specifically this will be used for - // request delays. This value should only be used for testing. To adjust - // the delay of a request see the volcengine/client.DefaultRetryer and - // volcengine/request.Retryer. - // - // SleepDelay will prevent any Context from being used for canceling retry - // delay of an API operation. It is recommended to not use SleepDelay at all - // and specify a Retryer instead. - SleepDelay func(time.Duration) - - // DisableRestProtocolURICleaning will not clean the URL path when making rest protocol requests. - // Will default to false. This would only be used for empty directory names in s3 requests. - // - // Example: - // sess := session.Must(session.NewSession(&volcengine.Config{ - // DisableRestProtocolURICleaning: volcengine.Bool(true), - // })) - // - // svc := s3.New(sess) - // out, err := svc.GetObject(&s3.GetObjectInput { - // Bucket: volcengine.String("bucketname"), - // Key: volcengine.String("//foo//bar//moo"), - // }) - DisableRestProtocolURICleaning *bool - - // EnableEndpointDiscovery will allow for endpoint discovery on operations that - // have the definition in its model. By default, endpoint discovery is off. - // - // Example: - // sess := session.Must(session.NewSession(&volcengine.Config{ - // EnableEndpointDiscovery: volcengine.Bool(true), - // })) - // - // svc := s3.New(sess) - // out, err := svc.GetObject(&s3.GetObjectInput { - // Bucket: volcengine.String("bucketname"), - // Key: volcengine.String("/foo/bar/moo"), - // }) - //EnableEndpointDiscovery *bool - - // DisableEndpointHostPrefix will disable the SDK's behavior of prefixing - // request endpoint hosts with modeled information. - // - // Disabling this feature is useful when you want to use local endpoints - // for testing that do not support the modeled host prefix pattern. - //DisableEndpointHostPrefix *bool - - LogSensitives []string - - DynamicCredentials custom.DynamicCredentials - - DynamicCredentialsIncludeError custom.DynamicCredentialsIncludeError - - LogAccount custom.LogAccount - - ExtendHttpRequest custom.ExtendHttpRequest - - ExtendHttpRequestWithMeta custom.ExtendHttpRequestWithMeta - - ExtraHttpParameters custom.ExtraHttpParameters - - ExtraHttpParametersWithMeta custom.ExtraHttpParametersWithMeta - - ExtraHttpJsonBody custom.ExtraHttpJsonBody - - CustomerUnmarshalError custom.CustomerUnmarshalError - - CustomerUnmarshalData custom.CustomerUnmarshalData - - ExtraUserAgent *string - - Interceptors []custom.SdkInterceptor - - SimpleError *bool - - ForceJsonNumberDecode custom.ForceJsonNumberDecode -} - -// NewConfig returns a new Config pointer that can be chained with builder -// methods to set multiple configuration values inline without using pointers. -// -// // Create Session with MaxRetries configuration to be shared by multiple -// // service clients. -// sess := session.Must(session.NewSession(volcengine.NewConfig(). -// WithMaxRetries(3), -// )) -// -// // Create S3 service client with a specific Region. -// svc := s3.New(sess, volcengine.NewConfig(). -// WithRegion("us-west-2"), -// ) -func NewConfig() *Config { - return &Config{} -} - -func (c *Config) AddInterceptor(interceptor custom.SdkInterceptor) *Config { - c.Interceptors = append(c.Interceptors, interceptor) - return c -} - -// WithCredentialsChainVerboseErrors sets a config verbose errors boolean and returning -// a Config pointer. -func (c *Config) WithCredentialsChainVerboseErrors(verboseErrs bool) *Config { - c.CredentialsChainVerboseErrors = &verboseErrs - return c -} - -// WithCredentials sets a config Credentials value returning a Config pointer -// for chaining. -func (c *Config) WithCredentials(creds *credentials.Credentials) *Config { - c.Credentials = creds - return c -} - -// WithAkSk sets a config Credentials value returning a Config pointer -// for chaining. -func (c *Config) WithAkSk(ak, sk string) *Config { - c.Credentials = credentials.NewStaticCredentials(ak, sk, "") - return c -} - -// WithEndpoint sets a config Endpoint value returning a Config pointer for -// chaining. -func (c *Config) WithEndpoint(endpoint string) *Config { - c.Endpoint = &endpoint - return c -} - -func (c *Config) WithSimpleError(simpleError bool) *Config { - c.SimpleError = &simpleError - return c -} - -func (c *Config) WithLogSensitives(sensitives []string) *Config { - c.LogSensitives = sensitives - return c -} - -func (c *Config) WithExtendHttpRequest(extendHttpRequest custom.ExtendHttpRequest) *Config { - c.ExtendHttpRequest = extendHttpRequest - return c -} - -func (c *Config) WithExtendHttpRequestWithMeta(extendHttpRequestWithMeta custom.ExtendHttpRequestWithMeta) *Config { - c.ExtendHttpRequestWithMeta = extendHttpRequestWithMeta - return c -} - -func (c *Config) WithExtraHttpParameters(extraHttpParameters custom.ExtraHttpParameters) *Config { - c.ExtraHttpParameters = extraHttpParameters - return c -} - -func (c *Config) WithExtraHttpParametersWithMeta(extraHttpParametersWithMeta custom.ExtraHttpParametersWithMeta) *Config { - c.ExtraHttpParametersWithMeta = extraHttpParametersWithMeta - return c -} - -func (c *Config) WithExtraHttpJsonBody(extraHttpJsonBody custom.ExtraHttpJsonBody) *Config { - c.ExtraHttpJsonBody = extraHttpJsonBody - return c -} - -func (c *Config) WithExtraUserAgent(extra *string) *Config { - c.ExtraUserAgent = extra - return c -} - -func (c *Config) WithLogAccount(account custom.LogAccount) *Config { - c.LogAccount = account - return c -} - -func (c *Config) WithDynamicCredentials(f custom.DynamicCredentials) *Config { - c.DynamicCredentials = f - return c -} - -// WithDynamicCredentialsIncludeError sets a config DynamicCredentialsIncludeError value returning a Config pointer for -// chaining. -func (c *Config) WithDynamicCredentialsIncludeError(f custom.DynamicCredentialsIncludeError) *Config { - c.DynamicCredentialsIncludeError = f - return c -} - -func (c *Config) WithCustomerUnmarshalError(f custom.CustomerUnmarshalError) *Config { - c.CustomerUnmarshalError = f - return c -} - -func (c *Config) WithCustomerUnmarshalData(f custom.CustomerUnmarshalData) *Config { - c.CustomerUnmarshalData = f - return c -} - -func (c *Config) WithForceJsonNumberDecode(f custom.ForceJsonNumberDecode) *Config { - c.ForceJsonNumberDecode = f - return c -} - -// WithEndpointResolver sets a config EndpointResolver value returning a -// Config pointer for chaining. -func (c *Config) WithEndpointResolver(resolver endpoints.Resolver) *Config { - c.EndpointResolver = resolver - return c -} - -// WithRegion sets a config Region value returning a Config pointer for -// chaining. -func (c *Config) WithRegion(region string) *Config { - c.Region = ®ion - return c -} - -// WithDisableSSL sets a config DisableSSL value returning a Config pointer -// for chaining. -func (c *Config) WithDisableSSL(disable bool) *Config { - c.DisableSSL = &disable - return c -} - -// WithHTTPClient sets a config HTTPClient value returning a Config pointer -// for chaining. -func (c *Config) WithHTTPClient(client *http.Client) *Config { - c.HTTPClient = client - return c -} - -// WithMaxRetries sets a config MaxRetries value returning a Config pointer -// for chaining. -func (c *Config) WithMaxRetries(max int) *Config { - c.MaxRetries = &max - return c -} - -// WithDisableParamValidation sets a config DisableParamValidation value -// returning a Config pointer for chaining -// Temporary notes by xuyaming@bytedance.com because some validate field is relation. -//func (c *Config) WithDisableParamValidation(disable bool) *Config { -// c.DisableParamValidation = &disable -// return c -//} - -// WithDisableComputeChecksums sets a config DisableComputeChecksums value -// returning a Config pointer for chaining. -//func (c *Config) WithDisableComputeChecksums(disable bool) *Config { -// c.DisableComputeChecksums = &disable -// return c -//} - -// WithLogLevel sets a config LogLevel value returning a Config pointer for -// chaining. -func (c *Config) WithLogLevel(level LogLevelType) *Config { - c.LogLevel = &level - return c -} - -// WithLogger sets a config Logger value returning a Config pointer for -// chaining. -func (c *Config) WithLogger(logger Logger) *Config { - c.Logger = logger - return c -} - -// WithS3UseAccelerate sets a config S3UseAccelerate value returning a Config -// pointer for chaining. -//func (c *Config) WithS3UseAccelerate(enable bool) *Config { -// c.S3UseAccelerate = &enable -// return c -// -//} - -// WithS3DisableContentMD5Validation sets a config -// S3DisableContentMD5Validation value returning a Config pointer for chaining. -//func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config { -// c.S3DisableContentMD5Validation = &enable -// return c -// -//} - -// WithUseDualStack sets a config UseDualStack value returning a Config -// pointer for chaining. -//func (c *Config) WithUseDualStack(enable bool) *Config { -// c.UseDualStack = &enable -// return c -//} - -// WithEC2MetadataDisableTimeoutOverride sets a config EC2MetadataDisableTimeoutOverride value -// returning a Config pointer for chaining. -//func (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config { -// c.EC2MetadataDisableTimeoutOverride = &enable -// return c -//} - -// WithSleepDelay overrides the function used to sleep while waiting for the -// next retry. Defaults to time.Sleep. -func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config { - c.SleepDelay = fn - return c -} - -// WithEndpointDiscovery will set whether or not to use endpoint discovery. -//func (c *Config) WithEndpointDiscovery(t bool) *Config { -// c.EnableEndpointDiscovery = &t -// return c -//} - -// WithDisableEndpointHostPrefix will set whether or not to use modeled host prefix -// when making requests. -//func (c *Config) WithDisableEndpointHostPrefix(t bool) *Config { -// c.DisableEndpointHostPrefix = &t -// return c -//} - -// MergeIn merges the passed in configs into the existing config object. -func (c *Config) MergeIn(cfgs ...*Config) { - for _, other := range cfgs { - mergeInConfig(c, other) - } -} - -func mergeInConfig(dst *Config, other *Config) { - if other == nil { - return - } - - if other.CredentialsChainVerboseErrors != nil { - dst.CredentialsChainVerboseErrors = other.CredentialsChainVerboseErrors - } - - if other.Credentials != nil { - dst.Credentials = other.Credentials - } - - if other.Endpoint != nil { - dst.Endpoint = other.Endpoint - } - - if other.EndpointResolver != nil { - dst.EndpointResolver = other.EndpointResolver - } - - if other.Region != nil { - dst.Region = other.Region - } - - if other.DisableSSL != nil { - dst.DisableSSL = other.DisableSSL - } - - if other.HTTPClient != nil { - dst.HTTPClient = other.HTTPClient - } - - if other.LogLevel != nil { - dst.LogLevel = other.LogLevel - } - - if other.Logger != nil { - dst.Logger = other.Logger - } - - if other.MaxRetries != nil { - dst.MaxRetries = other.MaxRetries - } - - if other.Retryer != nil { - dst.Retryer = other.Retryer - } - - if other.ForceJsonNumberDecode != nil { - dst.ForceJsonNumberDecode = other.ForceJsonNumberDecode - } - // Temporary notes by xuyaming@bytedance.com because some validate field is relation. - //if other.DisableParamValidation != nil { - // dst.DisableParamValidation = other.DisableParamValidation - //} - - //if other.DisableComputeChecksums != nil { - // dst.DisableComputeChecksums = other.DisableComputeChecksums - //} - - //if other.S3UseAccelerate != nil { - // dst.S3UseAccelerate = other.S3UseAccelerate - //} - // - //if other.S3DisableContentMD5Validation != nil { - // dst.S3DisableContentMD5Validation = other.S3DisableContentMD5Validation - //} - // - //if other.UseDualStack != nil { - // dst.UseDualStack = other.UseDualStack - //} - // - //if other.EC2MetadataDisableTimeoutOverride != nil { - // dst.EC2MetadataDisableTimeoutOverride = other.EC2MetadataDisableTimeoutOverride - //} - // - if other.SleepDelay != nil { - dst.SleepDelay = other.SleepDelay - } - // - if other.DisableRestProtocolURICleaning != nil { - dst.DisableRestProtocolURICleaning = other.DisableRestProtocolURICleaning - } - // - //if other.EnforceShouldRetryCheck != nil { - // dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck - //} - // - //if other.EnableEndpointDiscovery != nil { - // dst.EnableEndpointDiscovery = other.EnableEndpointDiscovery - //} - // - //if other.DisableEndpointHostPrefix != nil { - // dst.DisableEndpointHostPrefix = other.DisableEndpointHostPrefix - //} - - if other.LogSensitives != nil { - dst.LogSensitives = other.LogSensitives - } - - if other.LogAccount != nil { - dst.LogAccount = other.LogAccount - } - - if other.DynamicCredentials != nil { - dst.DynamicCredentials = other.DynamicCredentials - } - - if other.DynamicCredentialsIncludeError != nil { - dst.DynamicCredentialsIncludeError = other.DynamicCredentialsIncludeError - } - - if other.ExtendHttpRequest != nil { - dst.ExtendHttpRequest = other.ExtendHttpRequest - } - - if other.ExtendHttpRequestWithMeta != nil { - dst.ExtendHttpRequestWithMeta = other.ExtendHttpRequestWithMeta - } - - if other.ExtraHttpParameters != nil { - dst.ExtraHttpParameters = other.ExtraHttpParameters - } - - if other.ExtraHttpParametersWithMeta != nil { - dst.ExtraHttpParametersWithMeta = other.ExtraHttpParametersWithMeta - } - - if other.ExtraUserAgent != nil { - dst.ExtraUserAgent = other.ExtraUserAgent - } - - if other.SimpleError != nil { - dst.SimpleError = other.SimpleError - } - - if other.ExtraHttpJsonBody != nil { - dst.ExtraHttpJsonBody = other.ExtraHttpJsonBody - } - - if other.CustomerUnmarshalError != nil { - dst.CustomerUnmarshalError = other.CustomerUnmarshalError - } - - if other.CustomerUnmarshalData != nil { - dst.CustomerUnmarshalData = other.CustomerUnmarshalData - } - - dst.Interceptors = other.Interceptors -} - -// Copy will return a shallow copy of the Config object. If any additional -// configurations are provided they will be merged into the new config returned. -func (c *Config) Copy(cfgs ...*Config) *Config { - dst := &Config{} - dst.MergeIn(c) - - for _, cfg := range cfgs { - dst.MergeIn(cfg) - } - - return dst -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context.go deleted file mode 100644 index 1285bd678c02..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context.go +++ /dev/null @@ -1,28 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "context" - -// Context is an alias of the Go stdlib's context.Context interface. -// It can be used within the SDK's API operation "WithContext" methods. -// -// See https://golang.org/pkg/context on how to use contexts. -type Context = context.Context diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context_background.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context_background.go deleted file mode 100644 index 83169ffa06b0..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context_background.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "context" - -// BackgroundContext returns a context that will never be canceled, has no -// values, and no deadline. This context is used by the SDK to provide -// backwards compatibility with non-context API operations and functionality. -// See https://golang.org/pkg/context for more information on Contexts. -func BackgroundContext() Context { - return context.Background() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context_sleep.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context_sleep.go deleted file mode 100644 index 69e784afe93f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/context_sleep.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "time" -) - -// SleepWithContext will wait for the timer duration to expire, or the context -// is canceled. Which ever happens first. If the context is canceled the Context's -// error will be returned. -// -// Expects Context to always return a non-nil error if the Done channel is closed. -func SleepWithContext(ctx Context, dur time.Duration) error { - t := time.NewTimer(dur) - defer t.Stop() - - select { - case <-t.C: - break - case <-ctx.Done(): - return ctx.Err() - } - - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/convert_types.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/convert_types.go deleted file mode 100644 index 0095366ae58f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/convert_types.go +++ /dev/null @@ -1,951 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/json" - "time" -) - -// JsonNumber returns a pointer to the json.Number passed in. -func JsonNumber(v string) *json.Number { - jn := json.Number(v) - return &jn -} - -func JsonNumberValue(v *string) json.Number { - jn := json.Number(StringValue(v)) - return jn -} - -// String returns a pointer to the string value passed in. -func String(v string) *string { - return &v -} - -// StringValue returns the value of the string pointer passed in or -// "" if the pointer is nil. -func StringValue(v *string) string { - if v != nil { - return *v - } - return "" -} - -// StringSlice converts a slice of string values into a slice of -// string pointers -func StringSlice(src []string) []*string { - dst := make([]*string, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// StringValueSlice converts a slice of string pointers into a slice of -// string values -func StringValueSlice(src []*string) []string { - dst := make([]string, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// StringMap converts a string map of string values into a string -// map of string pointers -func StringMap(src map[string]string) map[string]*string { - dst := make(map[string]*string) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// StringValueMap converts a string map of string pointers into a string -// map of string values -func StringValueMap(src map[string]*string) map[string]string { - dst := make(map[string]string) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Bool returns a pointer to the bool value passed in. -func Bool(v bool) *bool { - return &v -} - -// BoolValue returns the value of the bool pointer passed in or -// false if the pointer is nil. -func BoolValue(v *bool) bool { - if v != nil { - return *v - } - return false -} - -// BoolSlice converts a slice of bool values into a slice of -// bool pointers -func BoolSlice(src []bool) []*bool { - dst := make([]*bool, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// BoolValueSlice converts a slice of bool pointers into a slice of -// bool values -func BoolValueSlice(src []*bool) []bool { - dst := make([]bool, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// BoolMap converts a string map of bool values into a string -// map of bool pointers -func BoolMap(src map[string]bool) map[string]*bool { - dst := make(map[string]*bool) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// BoolValueMap converts a string map of bool pointers into a string -// map of bool values -func BoolValueMap(src map[string]*bool) map[string]bool { - dst := make(map[string]bool) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int returns a pointer to the int value passed in. -func Int(v int) *int { - return &v -} - -// IntValue returns the value of the int pointer passed in or -// 0 if the pointer is nil. -func IntValue(v *int) int { - if v != nil { - return *v - } - return 0 -} - -// IntSlice converts a slice of int values into a slice of -// int pointers -func IntSlice(src []int) []*int { - dst := make([]*int, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// IntValueSlice converts a slice of int pointers into a slice of -// int values -func IntValueSlice(src []*int) []int { - dst := make([]int, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// IntMap converts a string map of int values into a string -// map of int pointers -func IntMap(src map[string]int) map[string]*int { - dst := make(map[string]*int) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// IntValueMap converts a string map of int pointers into a string -// map of int values -func IntValueMap(src map[string]*int) map[string]int { - dst := make(map[string]int) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint returns a pointer to the uint value passed in. -func Uint(v uint) *uint { - return &v -} - -// UintValue returns the value of the uint pointer passed in or -// 0 if the pointer is nil. -func UintValue(v *uint) uint { - if v != nil { - return *v - } - return 0 -} - -// UintSlice converts a slice of uint values uinto a slice of -// uint pointers -func UintSlice(src []uint) []*uint { - dst := make([]*uint, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// UintValueSlice converts a slice of uint pointers uinto a slice of -// uint values -func UintValueSlice(src []*uint) []uint { - dst := make([]uint, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// UintMap converts a string map of uint values uinto a string -// map of uint pointers -func UintMap(src map[string]uint) map[string]*uint { - dst := make(map[string]*uint) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// UintValueMap converts a string map of uint pointers uinto a string -// map of uint values -func UintValueMap(src map[string]*uint) map[string]uint { - dst := make(map[string]uint) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int8 returns a pointer to the int8 value passed in. -func Int8(v int8) *int8 { - return &v -} - -// Int8Value returns the value of the int8 pointer passed in or -// 0 if the pointer is nil. -func Int8Value(v *int8) int8 { - if v != nil { - return *v - } - return 0 -} - -// Int8Slice converts a slice of int8 values into a slice of -// int8 pointers -func Int8Slice(src []int8) []*int8 { - dst := make([]*int8, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int8ValueSlice converts a slice of int8 pointers into a slice of -// int8 values -func Int8ValueSlice(src []*int8) []int8 { - dst := make([]int8, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int8Map converts a string map of int8 values into a string -// map of int8 pointers -func Int8Map(src map[string]int8) map[string]*int8 { - dst := make(map[string]*int8) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int8ValueMap converts a string map of int8 pointers into a string -// map of int8 values -func Int8ValueMap(src map[string]*int8) map[string]int8 { - dst := make(map[string]int8) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int16 returns a pointer to the int16 value passed in. -func Int16(v int16) *int16 { - return &v -} - -// Int16Value returns the value of the int16 pointer passed in or -// 0 if the pointer is nil. -func Int16Value(v *int16) int16 { - if v != nil { - return *v - } - return 0 -} - -// Int16Slice converts a slice of int16 values into a slice of -// int16 pointers -func Int16Slice(src []int16) []*int16 { - dst := make([]*int16, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int16ValueSlice converts a slice of int16 pointers into a slice of -// int16 values -func Int16ValueSlice(src []*int16) []int16 { - dst := make([]int16, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int16Map converts a string map of int16 values into a string -// map of int16 pointers -func Int16Map(src map[string]int16) map[string]*int16 { - dst := make(map[string]*int16) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int16ValueMap converts a string map of int16 pointers into a string -// map of int16 values -func Int16ValueMap(src map[string]*int16) map[string]int16 { - dst := make(map[string]int16) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int32 returns a pointer to the int32 value passed in. -func Int32(v int32) *int32 { - return &v -} - -// Int32Value returns the value of the int32 pointer passed in or -// 0 if the pointer is nil. -func Int32Value(v *int32) int32 { - if v != nil { - return *v - } - return 0 -} - -// Int32Slice converts a slice of int32 values into a slice of -// int32 pointers -func Int32Slice(src []int32) []*int32 { - dst := make([]*int32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int32ValueSlice converts a slice of int32 pointers into a slice of -// int32 values -func Int32ValueSlice(src []*int32) []int32 { - dst := make([]int32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int32Map converts a string map of int32 values into a string -// map of int32 pointers -func Int32Map(src map[string]int32) map[string]*int32 { - dst := make(map[string]*int32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int32ValueMap converts a string map of int32 pointers into a string -// map of int32 values -func Int32ValueMap(src map[string]*int32) map[string]int32 { - dst := make(map[string]int32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Int64 returns a pointer to the int64 value passed in. -func Int64(v int64) *int64 { - return &v -} - -// Int64Value returns the value of the int64 pointer passed in or -// 0 if the pointer is nil. -func Int64Value(v *int64) int64 { - if v != nil { - return *v - } - return 0 -} - -// Int64Slice converts a slice of int64 values into a slice of -// int64 pointers -func Int64Slice(src []int64) []*int64 { - dst := make([]*int64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Int64ValueSlice converts a slice of int64 pointers into a slice of -// int64 values -func Int64ValueSlice(src []*int64) []int64 { - dst := make([]int64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Int64Map converts a string map of int64 values into a string -// map of int64 pointers -func Int64Map(src map[string]int64) map[string]*int64 { - dst := make(map[string]*int64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Int64ValueMap converts a string map of int64 pointers into a string -// map of int64 values -func Int64ValueMap(src map[string]*int64) map[string]int64 { - dst := make(map[string]int64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint8 returns a pointer to the uint8 value passed in. -func Uint8(v uint8) *uint8 { - return &v -} - -// Uint8Value returns the value of the uint8 pointer passed in or -// 0 if the pointer is nil. -func Uint8Value(v *uint8) uint8 { - if v != nil { - return *v - } - return 0 -} - -// Uint8Slice converts a slice of uint8 values into a slice of -// uint8 pointers -func Uint8Slice(src []uint8) []*uint8 { - dst := make([]*uint8, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint8ValueSlice converts a slice of uint8 pointers into a slice of -// uint8 values -func Uint8ValueSlice(src []*uint8) []uint8 { - dst := make([]uint8, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint8Map converts a string map of uint8 values into a string -// map of uint8 pointers -func Uint8Map(src map[string]uint8) map[string]*uint8 { - dst := make(map[string]*uint8) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint8ValueMap converts a string map of uint8 pointers into a string -// map of uint8 values -func Uint8ValueMap(src map[string]*uint8) map[string]uint8 { - dst := make(map[string]uint8) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint16 returns a pointer to the uint16 value passed in. -func Uint16(v uint16) *uint16 { - return &v -} - -// Uint16Value returns the value of the uint16 pointer passed in or -// 0 if the pointer is nil. -func Uint16Value(v *uint16) uint16 { - if v != nil { - return *v - } - return 0 -} - -// Uint16Slice converts a slice of uint16 values into a slice of -// uint16 pointers -func Uint16Slice(src []uint16) []*uint16 { - dst := make([]*uint16, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint16ValueSlice converts a slice of uint16 pointers into a slice of -// uint16 values -func Uint16ValueSlice(src []*uint16) []uint16 { - dst := make([]uint16, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint16Map converts a string map of uint16 values into a string -// map of uint16 pointers -func Uint16Map(src map[string]uint16) map[string]*uint16 { - dst := make(map[string]*uint16) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint16ValueMap converts a string map of uint16 pointers into a string -// map of uint16 values -func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { - dst := make(map[string]uint16) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint32 returns a pointer to the uint32 value passed in. -func Uint32(v uint32) *uint32 { - return &v -} - -// Uint32Value returns the value of the uint32 pointer passed in or -// 0 if the pointer is nil. -func Uint32Value(v *uint32) uint32 { - if v != nil { - return *v - } - return 0 -} - -// Uint32Slice converts a slice of uint32 values into a slice of -// uint32 pointers -func Uint32Slice(src []uint32) []*uint32 { - dst := make([]*uint32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint32ValueSlice converts a slice of uint32 pointers into a slice of -// uint32 values -func Uint32ValueSlice(src []*uint32) []uint32 { - dst := make([]uint32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint32Map converts a string map of uint32 values into a string -// map of uint32 pointers -func Uint32Map(src map[string]uint32) map[string]*uint32 { - dst := make(map[string]*uint32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint32ValueMap converts a string map of uint32 pointers into a string -// map of uint32 values -func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { - dst := make(map[string]uint32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Uint64 returns a pointer to the uint64 value passed in. -func Uint64(v uint64) *uint64 { - return &v -} - -// Uint64Value returns the value of the uint64 pointer passed in or -// 0 if the pointer is nil. -func Uint64Value(v *uint64) uint64 { - if v != nil { - return *v - } - return 0 -} - -// Uint64Slice converts a slice of uint64 values into a slice of -// uint64 pointers -func Uint64Slice(src []uint64) []*uint64 { - dst := make([]*uint64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Uint64ValueSlice converts a slice of uint64 pointers into a slice of -// uint64 values -func Uint64ValueSlice(src []*uint64) []uint64 { - dst := make([]uint64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Uint64Map converts a string map of uint64 values into a string -// map of uint64 pointers -func Uint64Map(src map[string]uint64) map[string]*uint64 { - dst := make(map[string]*uint64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Uint64ValueMap converts a string map of uint64 pointers into a string -// map of uint64 values -func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { - dst := make(map[string]uint64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Float32 returns a pointer to the float32 value passed in. -func Float32(v float32) *float32 { - return &v -} - -// Float32Value returns the value of the float32 pointer passed in or -// 0 if the pointer is nil. -func Float32Value(v *float32) float32 { - if v != nil { - return *v - } - return 0 -} - -// Float32Slice converts a slice of float32 values into a slice of -// float32 pointers -func Float32Slice(src []float32) []*float32 { - dst := make([]*float32, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Float32ValueSlice converts a slice of float32 pointers into a slice of -// float32 values -func Float32ValueSlice(src []*float32) []float32 { - dst := make([]float32, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Float32Map converts a string map of float32 values into a string -// map of float32 pointers -func Float32Map(src map[string]float32) map[string]*float32 { - dst := make(map[string]*float32) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Float32ValueMap converts a string map of float32 pointers into a string -// map of float32 values -func Float32ValueMap(src map[string]*float32) map[string]float32 { - dst := make(map[string]float32) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Float64 returns a pointer to the float64 value passed in. -func Float64(v float64) *float64 { - return &v -} - -// Float64Value returns the value of the float64 pointer passed in or -// 0 if the pointer is nil. -func Float64Value(v *float64) float64 { - if v != nil { - return *v - } - return 0 -} - -// Float64Slice converts a slice of float64 values into a slice of -// float64 pointers -func Float64Slice(src []float64) []*float64 { - dst := make([]*float64, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// Float64ValueSlice converts a slice of float64 pointers into a slice of -// float64 values -func Float64ValueSlice(src []*float64) []float64 { - dst := make([]float64, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// Float64Map converts a string map of float64 values into a string -// map of float64 pointers -func Float64Map(src map[string]float64) map[string]*float64 { - dst := make(map[string]*float64) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// Float64ValueMap converts a string map of float64 pointers into a string -// map of float64 values -func Float64ValueMap(src map[string]*float64) map[string]float64 { - dst := make(map[string]float64) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} - -// Time returns a pointer to the time.Time value passed in. -func Time(v time.Time) *time.Time { - return &v -} - -// TimeValue returns the value of the time.Time pointer passed in or -// time.Time{} if the pointer is nil. -func TimeValue(v *time.Time) time.Time { - if v != nil { - return *v - } - return time.Time{} -} - -// SecondsTimeValue converts an int64 pointer to a time.Time value -// representing seconds since Epoch or time.Time{} if the pointer is nil. -func SecondsTimeValue(v *int64) time.Time { - if v != nil { - return time.Unix((*v / 1000), 0) - } - return time.Time{} -} - -// MillisecondsTimeValue converts an int64 pointer to a time.Time value -// representing milliseconds sinch Epoch or time.Time{} if the pointer is nil. -func MillisecondsTimeValue(v *int64) time.Time { - if v != nil { - return time.Unix(0, (*v * 1000000)) - } - return time.Time{} -} - -// TimeUnixMilli returns a Unix timestamp in milliseconds from "January 1, 1970 UTC". -// The result is undefined if the Unix time cannot be represented by an int64. -// Which includes calling TimeUnixMilli on a zero Time is undefined. -// -// This utility is useful for service API's such as CloudWatch Logs which require -// their unix time values to be in milliseconds. -// -// See Go stdlib https://golang.org/pkg/time/#Time.UnixNano for more information. -func TimeUnixMilli(t time.Time) int64 { - return t.UnixNano() / int64(time.Millisecond/time.Nanosecond) -} - -// TimeSlice converts a slice of time.Time values into a slice of -// time.Time pointers -func TimeSlice(src []time.Time) []*time.Time { - dst := make([]*time.Time, len(src)) - for i := 0; i < len(src); i++ { - dst[i] = &(src[i]) - } - return dst -} - -// TimeValueSlice converts a slice of time.Time pointers into a slice of -// time.Time values -func TimeValueSlice(src []*time.Time) []time.Time { - dst := make([]time.Time, len(src)) - for i := 0; i < len(src); i++ { - if src[i] != nil { - dst[i] = *(src[i]) - } - } - return dst -} - -// TimeMap converts a string map of time.Time values into a string -// map of time.Time pointers -func TimeMap(src map[string]time.Time) map[string]*time.Time { - dst := make(map[string]*time.Time) - for k, val := range src { - v := val - dst[k] = &v - } - return dst -} - -// TimeValueMap converts a string map of time.Time pointers into a string -// map of time.Time values -func TimeValueMap(src map[string]*time.Time) map[string]time.Time { - dst := make(map[string]time.Time) - for k, val := range src { - if val != nil { - dst[k] = *val - } - } - return dst -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/custom_req.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/custom_req.go deleted file mode 100644 index 957fa8edcd5d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/custom_req.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -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 corehandlers - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -var CustomerRequestHandler = request.NamedHandler{ - Name: "core.CustomerRequestHandler", - Fn: func(r *request.Request) { - if r.Config.ExtendHttpRequest != nil { - r.Config.ExtendHttpRequest(r.Context(), r.HTTPRequest) - } - - if r.Config.ExtendHttpRequestWithMeta != nil { - r.Config.ExtendHttpRequestWithMeta(r.Context(), r.HTTPRequest, custom.RequestMetadata{ - ServiceName: r.ClientInfo.ServiceName, - Version: r.ClientInfo.APIVersion, - Action: r.Operation.Name, - HttpMethod: r.Operation.HTTPMethod, - Region: *r.Config.Region, - }) - } - }, -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/handlers.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/handlers.go deleted file mode 100644 index 9f199fdb0a1d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/handlers.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -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 corehandlers - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "regexp" - "strconv" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// Interface for matching types which also have a Len method. -type lener interface { - Len() int -} - -// BuildContentLengthHandler builds the content length of a request based on the volcenginebody, -// or will use the HTTPRequest.Header's "Content-Length" if defined. If unable -// to determine request volcenginebody length and no "Content-Length" was specified it will panic. -// -// The Content-Length will only be added to the request if the length of the volcenginebody -// is greater than 0. If the volcenginebody is empty or the current `Content-Length` -// header is <= 0, the header will also be stripped. -var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) { - var length int64 - - if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" { - length, _ = strconv.ParseInt(slength, 10, 64) - } else { - if r.Body != nil { - var err error - length, err = volcengine.SeekerLen(r.Body) - if err != nil { - r.Error = volcengineerr.New(request.ErrCodeSerialization, "failed to get request volcenginebody's length", err) - return - } - } - } - - if length > 0 { - r.HTTPRequest.ContentLength = length - r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length)) - } else { - r.HTTPRequest.ContentLength = 0 - r.HTTPRequest.Header.Del("Content-Length") - } -}} - -var reStatusCode = regexp.MustCompile(`^(\d{3})`) - -// ValidateReqSigHandler is a request handler to ensure that the request's -// signature doesn't expire before it is sent. This can happen when a request -// is built and signed significantly before it is sent. Or significant delays -// occur when retrying requests that would cause the signature to expire. -var ValidateReqSigHandler = request.NamedHandler{ - Name: "core.ValidateReqSigHandler", - Fn: func(r *request.Request) { - // Unsigned requests are not signed - if r.Config.Credentials == credentials.AnonymousCredentials { - return - } - - signedTime := r.Time - if !r.LastSignedAt.IsZero() { - signedTime = r.LastSignedAt - } - - // 5 minutes to allow for some clock skew/delays in transmission. - // Would be improved with volcengine/volcengine-go-sdk#423 - if signedTime.Add(5 * time.Minute).After(time.Now()) { - return - } - - fmt.Println("request expired, resigning") - r.Sign() - }, -} - -// SendHandler is a request handler to send service request using HTTP client. -var SendHandler = request.NamedHandler{ - Name: "core.SendHandler", - Fn: func(r *request.Request) { - sender := sendFollowRedirects - if r.DisableFollowRedirects { - sender = sendWithoutFollowRedirects - } - - if request.NoBody == r.HTTPRequest.Body { - // Strip off the request volcenginebody if the NoBody reader was used as a - // place holder for a request volcenginebody. This prevents the SDK from - // making requests with a request volcenginebody when it would be invalid - // to do so. - // - // Use a shallow copy of the http.Request to ensure the race condition - // of transport on Body will not trigger - reqOrig, reqCopy := r.HTTPRequest, *r.HTTPRequest - reqCopy.Body = nil - r.HTTPRequest = &reqCopy - defer func() { - r.HTTPRequest = reqOrig - }() - } - - var err error - r.HTTPResponse, err = sender(r) - if err != nil { - handleSendError(r, err) - } - }, -} - -func sendFollowRedirects(r *request.Request) (*http.Response, error) { - return r.Config.HTTPClient.Do(r.HTTPRequest) -} - -func sendWithoutFollowRedirects(r *request.Request) (*http.Response, error) { - transport := r.Config.HTTPClient.Transport - if transport == nil { - transport = http.DefaultTransport - } - - return transport.RoundTrip(r.HTTPRequest) -} - -func handleSendError(r *request.Request, err error) { - // Prevent leaking if an HTTPResponse was returned. Clean up - // the volcenginebody. - if r.HTTPResponse != nil { - r.HTTPResponse.Body.Close() - } - // Capture the case where url.Error is returned for error processing - // response. e.g. 301 without location header comes back as string - // error and r.HTTPResponse is nil. Other URL redirect errors will - // comeback in a similar method. - if e, ok := err.(*url.Error); ok && e.Err != nil { - if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil { - code, _ := strconv.ParseInt(s[1], 10, 64) - r.HTTPResponse = &http.Response{ - StatusCode: int(code), - Status: http.StatusText(int(code)), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - return - } - } - if r.HTTPResponse == nil { - // Add a dummy request response object to ensure the HTTPResponse - // value is consistent. - r.HTTPResponse = &http.Response{ - StatusCode: int(0), - Status: http.StatusText(int(0)), - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), - } - } - // Catch all request errors, and let the default retrier determine - // if the error is retryable. - r.Error = volcengineerr.New("RequestError", "send request failed", err) - - // Override the error with a context canceled error, if that was canceled. - ctx := r.Context() - select { - case <-ctx.Done(): - r.Error = volcengineerr.New(request.CanceledErrorCode, - "request context canceled", ctx.Err()) - r.Retryable = volcengine.Bool(false) - default: - } -} - -// ValidateResponseHandler is a request handler to validate service response. -var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) { - if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 { - // this may be replaced by an UnmarshalError handler - r.Error = volcengineerr.New("UnknownError", "unknown error", nil) - } -}} - -// AfterRetryHandler performs final checks to determine if the request should -// be retried and how long to delay. -var AfterRetryHandler = request.NamedHandler{ - Name: "core.AfterRetryHandler", - Fn: func(r *request.Request) { - // If one of the other handlers already set the retry state - // we don't want to override it based on the service's state - if r.Retryable == nil || volcengine.BoolValue(r.Config.EnforceShouldRetryCheck) { - r.Retryable = volcengine.Bool(r.ShouldRetry(r)) - } - - if r.WillRetry() { - r.RetryDelay = r.RetryRules(r) - - if sleepFn := r.Config.SleepDelay; sleepFn != nil { - // Support SleepDelay for backwards compatibility and testing - sleepFn(r.RetryDelay) - } else if err := volcengine.SleepWithContext(r.Context(), r.RetryDelay); err != nil { - r.Error = volcengineerr.New(request.CanceledErrorCode, - "request context canceled", err) - r.Retryable = volcengine.Bool(false) - return - } - - // when the expired token exception occurs the credentials - // need to be expired locally so that the next request to - // get credentials will trigger a credentials refresh. - if r.IsErrorExpired() { - r.Config.Credentials.Expire() - } - - r.RetryCount++ - r.Error = nil - } - }} - -// ValidateEndpointHandler is a request handler to validate a request had the -// appropriate Region and Endpoint set. Will set r.Error if the endpoint or -// region is not valid. -var ValidateEndpointHandler = request.NamedHandler{Name: "core.ValidateEndpointHandler", Fn: func(r *request.Request) { - if r.ClientInfo.SigningRegion == "" && volcengine.StringValue(r.Config.Region) == "" && r.Config.DynamicCredentials == nil { - r.Error = volcengine.ErrMissingRegion - } else if r.ClientInfo.Endpoint == "" { - r.Error = volcengine.ErrMissingEndpoint - } -}} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/param_validator.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/param_validator.go deleted file mode 100644 index adc113ef23f2..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/param_validator.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -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 corehandlers - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - -// ValidateParametersHandler is a request handler to validate the input parameters. -// Validating parameters only has meaning if done prior to the request being sent. -var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { - if !r.ParamsFilled() { - return - } - - if v, ok := r.Params.(request.Validator); ok { - if err := v.Validate(); err != nil { - r.Error = err - } - } -}} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/user_agent.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/user_agent.go deleted file mode 100644 index 34c24637e990..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers/user_agent.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -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 corehandlers - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "os" - "runtime" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// SDKVersionUserAgentHandler is a request handler for adding the SDK Version -// to the user agent. -var SDKVersionUserAgentHandler = request.NamedHandler{ - Name: "core.SDKVersionUserAgentHandler", - Fn: request.MakeAddToUserAgentHandler(volcengine.SDKName, volcengine.SDKVersion, - runtime.Version(), runtime.GOOS, runtime.GOARCH), -} - -const execEnvVar = `VOLCSTACK_EXECUTION_ENV` -const execEnvUAKey = `exec-env` - -// AddHostExecEnvUserAgentHandler is a request handler appending the SDK's -// execution environment to the user agent. -// -// If the environment variable VOLCSTACK_EXECUTION_ENV is set, its value will be -// appended to the user agent string. -var AddHostExecEnvUserAgentHandler = request.NamedHandler{ - Name: "core.AddHostExecEnvUserAgentHandler", - Fn: func(r *request.Request) { - v := os.Getenv(execEnvVar) - if len(v) == 0 { - return - } - - request.AddToUserAgent(r, execEnvUAKey+"/"+v) - }, -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/chain_provider.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/chain_provider.go deleted file mode 100644 index 39cd505a0e08..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/chain_provider.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -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 credentials - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -var ( - // ErrNoValidProvidersFoundInChain Is returned when there are no valid - // providers in the ChainProvider. - // - // This has been deprecated. For verbose error messaging set - // volcengine.Config.CredentialsChainVerboseErrors to true. - ErrNoValidProvidersFoundInChain = volcengineerr.New("NoCredentialProviders", - `no valid providers in chain. Deprecated. - For verbose messaging see volcengine.Config.CredentialsChainVerboseErrors`, - nil) -) - -// A ChainProvider will search for a provider which returns credentials -// and cache that provider until Retrieve is called again. -// -// The ChainProvider provides a way of chaining multiple providers together -// which will pick the first available using priority order of the Providers -// in the list. -// -// If none of the Providers retrieve valid credentials Value, ChainProvider's -// Retrieve() will return the error ErrNoValidProvidersFoundInChain. -// -// If a Provider is found which returns valid credentials Value ChainProvider -// will cache that Provider for all calls to IsExpired(), until Retrieve is -// called again. -// -// Example of ChainProvider to be used with an EnvProvider and EC2RoleProvider. -// In this example EnvProvider will first check if any credentials are available -// via the environment variables. If there are none ChainProvider will check -// the next Provider in the list, EC2RoleProvider in this case. If EC2RoleProvider -// does not return any credentials ChainProvider will return the error -type ChainProvider struct { - Providers []Provider - curr Provider - VerboseErrors bool -} - -// NewChainCredentials returns a pointer to a new Credentials object -// wrapping a chain of providers. -func NewChainCredentials(providers []Provider) *Credentials { - return NewCredentials(&ChainProvider{ - Providers: append([]Provider{}, providers...), - }) -} - -// Retrieve returns the credentials value or error if no provider returned -// without error. -// -// If a provider is found it will be cached and any calls to IsExpired() -// will return the expired state of the cached provider. -func (c *ChainProvider) Retrieve() (Value, error) { - var errs []error - for _, p := range c.Providers { - creds, err := p.Retrieve() - if err == nil { - c.curr = p - return creds, nil - } - errs = append(errs, err) - } - c.curr = nil - - var err error - err = ErrNoValidProvidersFoundInChain - if c.VerboseErrors { - err = volcengineerr.NewBatchError("NoCredentialProviders", "no valid providers in chain", errs) - } - return Value{}, err -} - -// IsExpired will returned the expired state of the currently cached provider -// if there is one. If there is no current provider, true will be returned. -func (c *ChainProvider) IsExpired() bool { - if c.curr != nil { - return c.curr.IsExpired() - } - - return true -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/credentials.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/credentials.go deleted file mode 100644 index 7a5ee8775e4b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/credentials.go +++ /dev/null @@ -1,337 +0,0 @@ -/* -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 credentials provides credential retrieval and management -// -// The Credentials is the primary method of getting access to and managing -// credentials Values. Using dependency injection retrieval of the credential -// values is handled by a object which satisfies the Provider interface. -// -// By default the Credentials.Get() will cache the successful result of a -// Provider's Retrieve() until Provider.IsExpired() returns true. At which -// point Credentials will call Provider's Retrieve() to get new credential Value. -// -// The Provider is responsible for determining when credentials Value have expired. -// It is also important to note that Credentials will always call Retrieve the -// first time Credentials.Get() is called. -// -// Example of using the environment variable credentials. -// -// creds := credentials.NewEnvCredentials() -// -// // Retrieve the credentials value -// credValue, err := creds.Get() -// if err != nil { -// // handle error -// } -// -// Example of forcing credentials to expire and be refreshed on the next Get(). -// This may be helpful to proactively expire credentials and refresh them sooner -// than they would naturally expire on their own. -// -// creds := credentials.NewCredentials(&ec2rolecreds.EC2RoleProvider{}) -// creds.Expire() -// credsValue, err := creds.Get() -// // New credentials will be retrieved instead of from cache. -// -// # Custom Provider -// -// Each Provider built into this package also provides a helper method to generate -// a Credentials pointer setup with the provider. To use a custom Provider just -// create a type which satisfies the Provider interface and pass it to the -// NewCredentials method. -// -// type MyProvider struct{} -// func (m *MyProvider) Retrieve() (Value, error) {...} -// func (m *MyProvider) IsExpired() bool {...} -// -// creds := credentials.NewCredentials(&MyProvider{}) -// credValue, err := creds.Get() -package credentials - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "sync" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// AnonymousCredentials is an empty Credential object that can be used as -// dummy placeholder credentials for requests that do not need signed. -var AnonymousCredentials = NewStaticCredentials("", "", "") - -// A Value is the Volcengine credentials value for individual credential fields. -type Value struct { - // Volcengine Access key ID - AccessKeyID string - - // Volcengine Secret Access Key - SecretAccessKey string - - // Volcengine Session Token - SessionToken string - - // Provider used to get credentials - ProviderName string -} - -// HasKeys returns if the credentials Value has both AccessKeyID and -// SecretAccessKey value set. -func (v Value) HasKeys() bool { - return len(v.AccessKeyID) != 0 && len(v.SecretAccessKey) != 0 -} - -// A Provider is the interface for any component which will provide credentials -// Value. A provider is required to manage its own Expired state, and what to -// be expired means. -// -// The Provider should not need to implement its own mutexes, because -// that will be managed by Credentials. -type Provider interface { - // Retrieve returns nil if it successfully retrieved the value. - // Error is returned if the value were not obtainable, or empty. - Retrieve() (Value, error) - - // IsExpired returns if the credentials are no longer valid, and need - // to be retrieved. - IsExpired() bool -} - -// An Expirer is an interface that Providers can implement to expose the expiration -// time, if known. If the Provider cannot accurately provide this info, -// it should not implement this interface. -type Expirer interface { - // The time at which the credentials are no longer valid - ExpiresAt() time.Time -} - -// An ErrorProvider is a stub credentials provider that always returns an error -// this is used by the SDK when construction a known provider is not possible -// due to an error. -type ErrorProvider struct { - // The error to be returned from Retrieve - Err error - - // The provider name to set on the Retrieved returned Value - ProviderName string -} - -// Retrieve will always return the error that the ErrorProvider was created with. -func (p ErrorProvider) Retrieve() (Value, error) { - return Value{ProviderName: p.ProviderName}, p.Err -} - -// IsExpired will always return not expired. -func (p ErrorProvider) IsExpired() bool { - return false -} - -// A Expiry provides shared expiration logic to be used by credentials -// providers to implement expiry functionality. -// -// The best method to use this struct is as an anonymous field within the -// provider's struct. -// -// Example: -// -// type EC2RoleProvider struct { -// Expiry -// ... -// } -type Expiry struct { - // The date/time when to expire on - expiration time.Time - - // If set will be used by IsExpired to determine the current time. - // Defaults to time.Now if CurrentTime is not set. Available for testing - // to be able to mock out the current time. - CurrentTime func() time.Time -} - -// SetExpiration sets the expiration IsExpired will check when called. -// -// If window is greater than 0 the expiration time will be reduced by the -// window value. -// -// Using a window is helpful to trigger credentials to expire sooner than -// the expiration time given to ensure no requests are made with expired -// tokens. -func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) { - e.expiration = expiration - if window > 0 { - e.expiration = e.expiration.Add(-window) - } -} - -// IsExpired returns if the credentials are expired. -func (e *Expiry) IsExpired() bool { - curTime := e.CurrentTime - if curTime == nil { - curTime = time.Now - } - return e.expiration.Before(curTime()) -} - -// ExpiresAt returns the expiration time of the credential -func (e *Expiry) ExpiresAt() time.Time { - return e.expiration -} - -// A Credentials provides concurrency safe retrieval of Volcengine credentials Value. -// Credentials will cache the credentials value until they expire. Once the value -// expires the next Get will attempt to retrieve valid credentials. -// -// Credentials is safe to use across multiple goroutines and will manage the -// synchronous state so the Providers do not need to implement their own -// synchronization. -// -// The first Credentials.Get() will always call Provider.Retrieve() to get the -// first instance of the credentials Value. All calls to Get() after that -// will return the cached credentials Value until IsExpired() returns true. -type Credentials struct { - creds Value - forceRefresh bool - - m sync.RWMutex - - provider Provider -} - -// NewCredentials returns a pointer to a new Credentials with the provider set. -func NewCredentials(provider Provider) *Credentials { - return &Credentials{ - provider: provider, - forceRefresh: true, - } -} - -// NewExpireAbleCredentials returns a pointer to a new Credentials with the provider set and disable forceRefresh. -func NewExpireAbleCredentials(provider Provider) *Credentials { - return &Credentials{ - provider: provider, - } -} - -// Get returns the credentials value, or error if the credentials Value failed -// to be retrieved. -// -// Will return the cached credentials Value if it has not expired. If the -// credentials Value has expired the Provider's Retrieve() will be called -// to refresh the credentials. -// -// If Credentials.Expire() was called the credentials Value will be force -// expired, and the next call to Get() will cause them to be refreshed. -func (c *Credentials) Get() (Value, error) { - // Check the cached credentials first with just the read lock. - c.m.RLock() - if !c.isExpired() { - creds := c.creds - c.m.RUnlock() - return creds, nil - } - c.m.RUnlock() - - // Credentials are expired need to retrieve the credentials taking the full - // lock. - c.m.Lock() - defer c.m.Unlock() - - if c.isExpired() { - creds, err := c.provider.Retrieve() - if err != nil { - return Value{}, err - } - c.creds = creds - c.forceRefresh = false - } - - return c.creds, nil -} - -// Expire expires the credentials and forces them to be retrieved on the -// next call to Get(). -// -// This will override the Provider's expired state, and force Credentials -// to call the Provider's Retrieve(). -func (c *Credentials) Expire() { - c.m.Lock() - defer c.m.Unlock() - - c.forceRefresh = true -} - -// GetProvider returns provider instance of the credentials -func (c *Credentials) GetProvider() Provider { - return c.provider -} - -// IsExpired returns if the credentials are no longer valid, and need -// to be retrieved. -// -// If the Credentials were forced to be expired with Expire() this will -// reflect that override. -func (c *Credentials) IsExpired() bool { - c.m.RLock() - defer c.m.RUnlock() - - return c.isExpired() -} - -// isExpired helper method wrapping the definition of expired credentials. -func (c *Credentials) isExpired() bool { - return c.forceRefresh || c.provider.IsExpired() -} - -// ExpiresAt provides access to the functionality of the Expirer interface of -// the underlying Provider, if it supports that interface. Otherwise, it returns -// an error. -func (c *Credentials) ExpiresAt() (time.Time, error) { - c.m.RLock() - defer c.m.RUnlock() - - expirer, ok := c.provider.(Expirer) - if !ok { - return time.Time{}, volcengineerr.New("ProviderNotExpirer", - fmt.Sprintf("provider %s does not support ExpiresAt()", c.creds.ProviderName), - nil) - } - if c.forceRefresh { - // set expiration time to the distant past - return time.Time{}, nil - } - return expirer.ExpiresAt(), nil -} - -func (c *Credentials) GetBase(region string, service string) (base.Credentials, error) { - value, err := c.Get() - - if err != nil { - return base.Credentials{}, err - } - - return base.Credentials{ - AccessKeyID: value.AccessKeyID, - SecretAccessKey: value.SecretAccessKey, - SessionToken: value.SessionToken, - Service: service, - Region: region, - }, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/endpointcreds/provider.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/endpointcreds/provider.go deleted file mode 100644 index 2bc1c3850ed9..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/endpointcreds/provider.go +++ /dev/null @@ -1,193 +0,0 @@ -/* -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 endpointcreds - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/json" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/json/jsonutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// ProviderName is the name of the credentials provider. -const ProviderName = `CredentialsEndpointProvider` - -// Provider satisfies the credentials.Provider interface, and is a client to -// retrieve credentials from an arbitrary endpoint. -type Provider struct { - staticCreds bool - credentials.Expiry - - // Requires a Volcengine Client to make HTTP requests to the endpoint with. - // the Endpoint the request will be made to is provided by the volcengine.Config's - // Endpoint value. - Client *client.Client - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration - - // Optional authorization token value if set will be used as the value of - // the Authorization header of the endpoint credential request. - AuthorizationToken string -} - -// NewProviderClient returns a credentials Provider for retrieving Volcengine credentials -// from arbitrary endpoint. -func NewProviderClient(cfg volcengine.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) credentials.Provider { - p := &Provider{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: "CredentialsEndpoint", - Endpoint: endpoint, - }, - handlers, - ), - } - - p.Client.Handlers.Unmarshal.PushBack(unmarshalHandler) - p.Client.Handlers.UnmarshalError.PushBack(unmarshalError) - p.Client.Handlers.Validate.Clear() - p.Client.Handlers.Validate.PushBack(validateEndpointHandler) - - for _, option := range options { - option(p) - } - - return p -} - -// NewCredentialsClient returns a pointer to a new Credentials object -// wrapping the endpoint credentials Provider. -func NewCredentialsClient(cfg volcengine.Config, handlers request.Handlers, endpoint string, options ...func(*Provider)) *credentials.Credentials { - return credentials.NewCredentials(NewProviderClient(cfg, handlers, endpoint, options...)) -} - -// IsExpired returns true if the credentials retrieved are expired, or not yet -// retrieved. -func (p *Provider) IsExpired() bool { - if p.staticCreds { - return false - } - return p.Expiry.IsExpired() -} - -// Retrieve will attempt to request the credentials from the endpoint the Provider -// was configured for. And error will be returned if the retrieval fails. -func (p *Provider) Retrieve() (credentials.Value, error) { - resp, err := p.getCredentials() - if err != nil { - return credentials.Value{ProviderName: ProviderName}, - volcengineerr.New("CredentialsEndpointError", "failed to load credentials", err) - } - - if resp.Expiration != nil { - p.SetExpiration(*resp.Expiration, p.ExpiryWindow) - } else { - p.staticCreds = true - } - - return credentials.Value{ - AccessKeyID: resp.AccessKeyID, - SecretAccessKey: resp.SecretAccessKey, - SessionToken: resp.Token, - ProviderName: ProviderName, - }, nil -} - -type getCredentialsOutput struct { - Expiration *time.Time - AccessKeyID string - SecretAccessKey string - Token string -} - -type errorOutput struct { - Code string `json:"code"` - Message string `json:"message"` -} - -func (p *Provider) getCredentials() (*getCredentialsOutput, error) { - op := &request.Operation{ - Name: "GetCredentials", - HTTPMethod: "GET", - } - - out := &getCredentialsOutput{} - req := p.Client.NewRequest(op, nil, out) - req.HTTPRequest.Header.Set("Accept", "application/json") - if authToken := p.AuthorizationToken; len(authToken) != 0 { - req.HTTPRequest.Header.Set("Authorization", authToken) - } - - return out, req.Send() -} - -func validateEndpointHandler(r *request.Request) { - if len(r.ClientInfo.Endpoint) == 0 { - r.Error = volcengine.ErrMissingEndpoint - } -} - -func unmarshalHandler(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - out := r.Data.(*getCredentialsOutput) - if err := json.NewDecoder(r.HTTPResponse.Body).Decode(&out); err != nil { - r.Error = volcengineerr.New(request.ErrCodeSerialization, - "failed to decode endpoint credentials", - err, - ) - } -} - -func unmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - - var errOut errorOutput - err := jsonutil.UnmarshalJSONError(&errOut, r.HTTPResponse.Body) - if err != nil { - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(request.ErrCodeSerialization, - "failed to decode error message", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - // Response volcenginebody format is not consistent between metadata endpoints. - // Grab the error message as a string and include that as the source error - r.Error = volcengineerr.New(errOut.Code, errOut.Message, nil) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/env_provider.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/env_provider.go deleted file mode 100644 index 14d4fc3e1749..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/env_provider.go +++ /dev/null @@ -1,93 +0,0 @@ -/* -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 credentials - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "os" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// EnvProviderName provides a name of Env provider -const EnvProviderName = "EnvProvider" - -var ( - // ErrAccessKeyIDNotFound is returned when the Volcengine Access Key ID can't be - // found in the process's environment. - ErrAccessKeyIDNotFound = volcengineerr.New("EnvAccessKeyNotFound", "VOLCSTACK_ACCESS_KEY_ID or VOLCSTACK_ACCESS_KEY not found in environment", nil) - - // ErrSecretAccessKeyNotFound is returned when the Volcengine Secret Access Key - // can't be found in the process's environment. - ErrSecretAccessKeyNotFound = volcengineerr.New("EnvSecretNotFound", "VOLCSTACK_SECRET_ACCESS_KEY or VOLCSTACK_SECRET_KEY not found in environment", nil) -) - -// A EnvProvider retrieves credentials from the environment variables of the -// running process. Environment credentials never expire. -// -// Environment variables used: -// -// * Access Key ID: VOLCSTACK_ACCESS_KEY_ID or VOLCSTACK_ACCESS_KEY -// -// * Secret Access Key: VOLCSTACK_SECRET_ACCESS_KEY or VOLCSTACK_SECRET_KEY -type EnvProvider struct { - retrieved bool -} - -// NewEnvCredentials returns a pointer to a new Credentials object -// wrapping the environment variable provider. -func NewEnvCredentials() *Credentials { - return NewCredentials(&EnvProvider{}) -} - -// Retrieve retrieves the keys from the environment. -func (e *EnvProvider) Retrieve() (Value, error) { - e.retrieved = false - - id := os.Getenv("VOLCSTACK_ACCESS_KEY_ID") - if id == "" { - id = os.Getenv("VOLCSTACK_ACCESS_KEY") - } - - secret := os.Getenv("VOLCSTACK_SECRET_ACCESS_KEY") - if secret == "" { - secret = os.Getenv("VOLCSTACK_SECRET_KEY") - } - - if id == "" { - return Value{ProviderName: EnvProviderName}, ErrAccessKeyIDNotFound - } - - if secret == "" { - return Value{ProviderName: EnvProviderName}, ErrSecretAccessKeyNotFound - } - - e.retrieved = true - return Value{ - AccessKeyID: id, - SecretAccessKey: secret, - SessionToken: os.Getenv("VOLCSTACK_SESSION_TOKEN"), - ProviderName: EnvProviderName, - }, nil -} - -// IsExpired returns if the credentials have been retrieved. -func (e *EnvProvider) IsExpired() bool { - return !e.retrieved -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/processcreds/provider.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/processcreds/provider.go deleted file mode 100644 index a89835618353..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/processcreds/provider.go +++ /dev/null @@ -1,368 +0,0 @@ -/* -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 processcreds - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "os" - "os/exec" - "runtime" - "strings" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -const ( - // ProviderName is the name this credentials provider will label any - // returned credentials Value with. - ProviderName = `ProcessProvider` - - // ErrCodeProcessProviderParse error parsing process output - ErrCodeProcessProviderParse = "ProcessProviderParseError" - - // ErrCodeProcessProviderVersion version error in output - ErrCodeProcessProviderVersion = "ProcessProviderVersionError" - - // ErrCodeProcessProviderRequired required attribute missing in output - ErrCodeProcessProviderRequired = "ProcessProviderRequiredError" - - // ErrCodeProcessProviderExecution execution of command failed - ErrCodeProcessProviderExecution = "ProcessProviderExecutionError" - - // errMsgProcessProviderTimeout process took longer than allowed - errMsgProcessProviderTimeout = "credential process timed out" - - // errMsgProcessProviderProcess process error - errMsgProcessProviderProcess = "error in credential_process" - - // errMsgProcessProviderParse problem parsing output - errMsgProcessProviderParse = "parse failed of credential_process output" - - // errMsgProcessProviderVersion version error in output - errMsgProcessProviderVersion = "wrong version in process output (not 1)" - - // errMsgProcessProviderMissKey missing access key id in output - errMsgProcessProviderMissKey = "missing AccessKeyId in process output" - - // errMsgProcessProviderMissSecret missing secret acess key in output - errMsgProcessProviderMissSecret = "missing SecretAccessKey in process output" - - // errMsgProcessProviderPrepareCmd prepare of command failed - errMsgProcessProviderPrepareCmd = "failed to prepare command" - - // errMsgProcessProviderEmptyCmd command must not be empty - errMsgProcessProviderEmptyCmd = "command must not be empty" - - // errMsgProcessProviderPipe failed to initialize pipe - errMsgProcessProviderPipe = "failed to initialize pipe" - - // DefaultDuration is the default amount of time in minutes that the - // credentials will be valid for. - DefaultDuration = time.Duration(15) * time.Minute - - // DefaultBufSize limits buffer size from growing to an enormous - // amount due to a faulty process. - DefaultBufSize = 1024 - - // DefaultTimeout default limit on time a process can run. - DefaultTimeout = time.Duration(1) * time.Minute -) - -// ProcessProvider satisfies the credentials.Provider interface, and is a -// client to retrieve credentials from a process. -type ProcessProvider struct { - staticCreds bool - credentials.Expiry - originalCommand []string - - // Expiry duration of the credentials. Defaults to 15 minutes if not set. - Duration time.Duration - - // ExpiryWindow will allow the credentials to trigger refreshing prior to - // the credentials actually expiring. This is beneficial so race conditions - // with expiring credentials do not cause request to fail unexpectedly - // due to ExpiredTokenException exceptions. - // - // So a ExpiryWindow of 10s would cause calls to IsExpired() to return true - // 10 seconds before the credentials are actually expired. - // - // If ExpiryWindow is 0 or less it will be ignored. - ExpiryWindow time.Duration - - // A string representing an os command that should return a JSON with - // credential information. - command *exec.Cmd - - // MaxBufSize limits memory usage from growing to an enormous - // amount due to a faulty process. - MaxBufSize int - - // Timeout limits the time a process can run. - Timeout time.Duration -} - -// NewCredentials returns a pointer to a new Credentials object wrapping the -// ProcessProvider. The credentials will expire every 15 minutes by default. -func NewCredentials(command string, options ...func(*ProcessProvider)) *credentials.Credentials { - p := &ProcessProvider{ - command: exec.Command(command), - Duration: DefaultDuration, - Timeout: DefaultTimeout, - MaxBufSize: DefaultBufSize, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -// NewCredentialsTimeout returns a pointer to a new Credentials object with -// the specified command and timeout, and default duration and max buffer size. -func NewCredentialsTimeout(command string, timeout time.Duration) *credentials.Credentials { - p := NewCredentials(command, func(opt *ProcessProvider) { - opt.Timeout = timeout - }) - - return p -} - -// NewCredentialsCommand returns a pointer to a new Credentials object with -// the specified command, and default timeout, duration and max buffer size. -func NewCredentialsCommand(command *exec.Cmd, options ...func(*ProcessProvider)) *credentials.Credentials { - p := &ProcessProvider{ - command: command, - Duration: DefaultDuration, - Timeout: DefaultTimeout, - MaxBufSize: DefaultBufSize, - } - - for _, option := range options { - option(p) - } - - return credentials.NewCredentials(p) -} - -type credentialProcessResponse struct { - Version int - AccessKeyID string `json:"AccessKeyId"` - SecretAccessKey string - SessionToken string - Expiration *time.Time -} - -// Retrieve executes the 'credential_process' and returns the credentials. -func (p *ProcessProvider) Retrieve() (credentials.Value, error) { - out, err := p.executeCredentialProcess() - if err != nil { - return credentials.Value{ProviderName: ProviderName}, err - } - - // Serialize and validate response - resp := &credentialProcessResponse{} - if err = json.Unmarshal(out, resp); err != nil { - return credentials.Value{ProviderName: ProviderName}, volcengineerr.New( - ErrCodeProcessProviderParse, - fmt.Sprintf("%s: %s", errMsgProcessProviderParse, string(out)), - err) - } - - if resp.Version != 1 { - return credentials.Value{ProviderName: ProviderName}, volcengineerr.New( - ErrCodeProcessProviderVersion, - errMsgProcessProviderVersion, - nil) - } - - if len(resp.AccessKeyID) == 0 { - return credentials.Value{ProviderName: ProviderName}, volcengineerr.New( - ErrCodeProcessProviderRequired, - errMsgProcessProviderMissKey, - nil) - } - - if len(resp.SecretAccessKey) == 0 { - return credentials.Value{ProviderName: ProviderName}, volcengineerr.New( - ErrCodeProcessProviderRequired, - errMsgProcessProviderMissSecret, - nil) - } - - // Handle expiration - p.staticCreds = resp.Expiration == nil - if resp.Expiration != nil { - p.SetExpiration(*resp.Expiration, p.ExpiryWindow) - } - - return credentials.Value{ - ProviderName: ProviderName, - AccessKeyID: resp.AccessKeyID, - SecretAccessKey: resp.SecretAccessKey, - SessionToken: resp.SessionToken, - }, nil -} - -// IsExpired returns true if the credentials retrieved are expired, or not yet -// retrieved. -func (p *ProcessProvider) IsExpired() bool { - if p.staticCreds { - return false - } - return p.Expiry.IsExpired() -} - -// prepareCommand prepares the command to be executed. -func (p *ProcessProvider) prepareCommand() error { - - var cmdArgs []string - if runtime.GOOS == "windows" { - cmdArgs = []string{"cmd.exe", "/C"} - } else { - cmdArgs = []string{"sh", "-c"} - } - - if len(p.originalCommand) == 0 { - p.originalCommand = make([]string, len(p.command.Args)) - copy(p.originalCommand, p.command.Args) - - // check for empty command because it succeeds - if len(strings.TrimSpace(p.originalCommand[0])) < 1 { - return volcengineerr.New( - ErrCodeProcessProviderExecution, - fmt.Sprintf( - "%s: %s", - errMsgProcessProviderPrepareCmd, - errMsgProcessProviderEmptyCmd), - nil) - } - } - - cmdArgs = append(cmdArgs, p.originalCommand...) - p.command = exec.Command(cmdArgs[0], cmdArgs[1:]...) - p.command.Env = os.Environ() - - return nil -} - -// executeCredentialProcess starts the credential process on the OS and -// returns the results or an error. -func (p *ProcessProvider) executeCredentialProcess() ([]byte, error) { - - if err := p.prepareCommand(); err != nil { - return nil, err - } - - // Setup the pipes - outReadPipe, outWritePipe, err := os.Pipe() - if err != nil { - return nil, volcengineerr.New( - ErrCodeProcessProviderExecution, - errMsgProcessProviderPipe, - err) - } - - p.command.Stderr = os.Stderr // display stderr on console for MFA - p.command.Stdout = outWritePipe // get creds json on process's stdout - p.command.Stdin = os.Stdin // enable stdin for MFA - - output := bytes.NewBuffer(make([]byte, 0, p.MaxBufSize)) - - stdoutCh := make(chan error, 1) - go readInput( - io.LimitReader(outReadPipe, int64(p.MaxBufSize)), - output, - stdoutCh) - - execCh := make(chan error, 1) - go executeCommand(*p.command, execCh) - - finished := false - var errors []error - for !finished { - select { - case readError := <-stdoutCh: - errors = appendError(errors, readError) - finished = true - case execError := <-execCh: - err := outWritePipe.Close() - errors = appendError(errors, err) - errors = appendError(errors, execError) - if errors != nil { - return output.Bytes(), volcengineerr.NewBatchError( - ErrCodeProcessProviderExecution, - errMsgProcessProviderProcess, - errors) - } - case <-time.After(p.Timeout): - finished = true - return output.Bytes(), volcengineerr.NewBatchError( - ErrCodeProcessProviderExecution, - errMsgProcessProviderTimeout, - errors) // errors can be nil - } - } - - out := output.Bytes() - - if runtime.GOOS == "windows" { - // windows adds slashes to quotes - out = []byte(strings.Replace(string(out), `\"`, `"`, -1)) - } - - return out, nil -} - -// appendError conveniently checks for nil before appending slice -func appendError(errors []error, err error) []error { - if err != nil { - return append(errors, err) - } - return errors -} - -func executeCommand(cmd exec.Cmd, exec chan error) { - // Start the command - err := cmd.Start() - if err == nil { - err = cmd.Wait() - } - - exec <- err -} - -func readInput(r io.Reader, w io.Writer, read chan error) { - tee := io.TeeReader(r, w) - - _, err := ioutil.ReadAll(tee) - - if err == io.EOF { - err = nil - } - - read <- err // will only arrive here when write end of pipe is closed -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/shared_credentials_provider.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/shared_credentials_provider.go deleted file mode 100644 index ffe9d4d1dd8f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/shared_credentials_provider.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 credentials - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "os" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/shareddefaults" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// SharedCredsProviderName provides a name of SharedCreds provider -const SharedCredsProviderName = "SharedCredentialsProvider" - -var ( - // ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found. - ErrSharedCredentialsHomeNotFound = volcengineerr.New("UserHomeNotFound", "user home directory not found.", nil) -) - -// A SharedCredentialsProvider retrieves credentials from the current user's home -// directory, and keeps track if those credentials are expired. -// -// Profile ini file example: $HOME/.volcengine/credentials -type SharedCredentialsProvider struct { - // Path to the shared credentials file. - // - // If empty will look for "VOLCSTACK_SHARED_CREDENTIALS_FILE" env variable. If the - // env value is empty will default to current user's home directory. - // Linux/OSX: "$HOME/.volcengine/credentials" - // Windows: "%USERPROFILE%\.volcengine\credentials" - Filename string - - // VOLCSTACK Profile to extract credentials from the shared credentials file. If empty - // will default to environment variable "VOLCSTACK_PROFILE" or "default" if - // environment variable is also not set. - Profile string - - // retrieved states if the credentials have been successfully retrieved. - retrieved bool -} - -// NewSharedCredentials returns a pointer to a new Credentials object -// wrapping the Profile file provider. -func NewSharedCredentials(filename, profile string) *Credentials { - return NewCredentials(&SharedCredentialsProvider{ - Filename: filename, - Profile: profile, - }) -} - -// Retrieve reads and extracts the shared credentials from the current -// users home directory. -func (p *SharedCredentialsProvider) Retrieve() (Value, error) { - p.retrieved = false - - filename, err := p.filename() - if err != nil { - return Value{ProviderName: SharedCredsProviderName}, err - } - - creds, err := loadProfile(filename, p.profile()) - if err != nil { - return Value{ProviderName: SharedCredsProviderName}, err - } - - p.retrieved = true - return creds, nil -} - -// IsExpired returns if the shared credentials have expired. -func (p *SharedCredentialsProvider) IsExpired() bool { - return !p.retrieved -} - -// loadProfiles loads from the file pointed to by shared credentials filename for profile. -// The credentials retrieved from the profile will be returned or error. Error will be -// returned if it fails to read from the file, or the data is invalid. -func loadProfile(filename, profile string) (Value, error) { - config, err := ini.OpenFile(filename) - if err != nil { - return Value{ProviderName: SharedCredsProviderName}, volcengineerr.New("SharedCredsLoad", "failed to load shared credentials file", err) - } - - iniProfile, ok := config.GetSection(profile) - if !ok { - return Value{ProviderName: SharedCredsProviderName}, volcengineerr.New("SharedCredsLoad", "failed to get profile", nil) - } - - id := iniProfile.String("volcengine_access_key_id") - if len(id) == 0 { - return Value{ProviderName: SharedCredsProviderName}, volcengineerr.New("SharedCredsAccessKey", - fmt.Sprintf("shared credentials %s in %s did not contain volcengine_access_key_id", profile, filename), - nil) - } - - secret := iniProfile.String("volcengine_secret_access_key") - if len(secret) == 0 { - return Value{ProviderName: SharedCredsProviderName}, volcengineerr.New("SharedCredsSecret", - fmt.Sprintf("shared credentials %s in %s did not contain volcengine_secret_access_key", profile, filename), - nil) - } - - // Default to empty string if not found - token := iniProfile.String("volcengine_session_token") - - return Value{ - AccessKeyID: id, - SecretAccessKey: secret, - SessionToken: token, - ProviderName: SharedCredsProviderName, - }, nil -} - -// filename returns the filename to use to read VOLCSTACK shared credentials. -// -// Will return an error if the user's home directory path cannot be found. -func (p *SharedCredentialsProvider) filename() (string, error) { - if len(p.Filename) != 0 { - return p.Filename, nil - } - - if p.Filename = os.Getenv("VOLCSTACK_SHARED_CREDENTIALS_FILE"); len(p.Filename) != 0 { - return p.Filename, nil - } - - if home := shareddefaults.UserHomeDir(); len(home) == 0 { - // Backwards compatibility of home directly not found error being returned. - // This error is too verbose, failure when opening the file would of been - // a better error to return. - return "", ErrSharedCredentialsHomeNotFound - } - - p.Filename = shareddefaults.SharedCredentialsFilename() - - return p.Filename, nil -} - -// profile returns the VOLCSTACK shared credentials profile. If empty will read -// environment variable "VOLCSTACK_PROFILE". If that is not set profile will -// return "default". -func (p *SharedCredentialsProvider) profile() string { - if p.Profile == "" { - p.Profile = os.Getenv("VOLCSTACK_PROFILE") - } - if p.Profile == "" { - p.Profile = "default" - } - - return p.Profile -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/static_provider.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/static_provider.go deleted file mode 100644 index 6441fc7fffdb..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/static_provider.go +++ /dev/null @@ -1,74 +0,0 @@ -/* -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 credentials - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// StaticProviderName provides a name of Static provider -const StaticProviderName = "StaticProvider" - -var ( - // ErrStaticCredentialsEmpty is emitted when static credentials are empty. - ErrStaticCredentialsEmpty = volcengineerr.New("EmptyStaticCreds", "static credentials are empty", nil) -) - -// A StaticProvider is a set of credentials which are set programmatically, -// and will never expire. -type StaticProvider struct { - Value -} - -// NewStaticCredentials returns a pointer to a new Credentials object -// wrapping a static credentials value provider. -func NewStaticCredentials(id, secret, token string) *Credentials { - return NewCredentials(&StaticProvider{Value: Value{ - AccessKeyID: id, - SecretAccessKey: secret, - SessionToken: token, - }}) -} - -// NewStaticCredentialsFromCreds returns a pointer to a new Credentials object -// wrapping the static credentials value provide. Same as NewStaticCredentials -// but takes the creds Value instead of individual fields -func NewStaticCredentialsFromCreds(creds Value) *Credentials { - return NewCredentials(&StaticProvider{Value: creds}) -} - -// Retrieve returns the credentials or error if the credentials are invalid. -func (s *StaticProvider) Retrieve() (Value, error) { - if s.AccessKeyID == "" || s.SecretAccessKey == "" { - return Value{ProviderName: StaticProviderName}, ErrStaticCredentialsEmpty - } - - if len(s.Value.ProviderName) == 0 { - s.Value.ProviderName = StaticProviderName - } - return s.Value, nil -} - -// IsExpired returns if the credentials are expired. -// -// For StaticProvider, the credentials never expired. -func (s *StaticProvider) IsExpired() bool { - return false -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/sts_credentials.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/sts_credentials.go deleted file mode 100644 index 188e6495b9c8..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/sts_credentials.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -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 credentials - -import ( - "fmt" - "time" - - "github.com/google/uuid" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts" -) - -type StsAssumeRoleProvider struct { - AccessKey string - SecurityKey string - RoleName string - AccountId string - Host string - Region string - Timeout time.Duration - DurationSeconds int -} - -type StsAssumeRoleTime struct { - CurrentTime string - ExpiredTime string -} - -func StsAssumeRole(p *StsAssumeRoleProvider) (*Credentials, *StsAssumeRoleTime, error) { - ins := sts.NewInstance() - if p.Region != "" { - ins.SetRegion(p.Region) - } - if p.Host != "" { - ins.SetHost(p.Host) - } - if p.Timeout > 0 { - ins.Client.SetTimeout(p.Timeout) - } - - ins.Client.SetAccessKey(p.AccessKey) - ins.Client.SetSecretKey(p.SecurityKey) - input := &sts.AssumeRoleRequest{ - DurationSeconds: p.DurationSeconds, - RoleTrn: fmt.Sprintf("trn:iam::%s:role/%s", p.AccountId, p.RoleName), - RoleSessionName: uuid.New().String(), - } - output, statusCode, err := ins.AssumeRole(input) - var reqId string - if output != nil { - reqId = output.ResponseMetadata.RequestId - } - if err != nil { - return nil, nil, fmt.Errorf("AssumeRole error,httpcode is %v and reqId is %s error is %s", statusCode, reqId, err.Error()) - } - if statusCode >= 300 || statusCode < 200 { - return nil, nil, fmt.Errorf("AssumeRole error,httpcode is %v and reqId is %s", statusCode, reqId) - } - return NewCredentials(&StaticProvider{Value: Value{ - AccessKeyID: output.Result.Credentials.AccessKeyId, - SecretAccessKey: output.Result.Credentials.SecretAccessKey, - SessionToken: output.Result.Credentials.SessionToken, - }}), &StsAssumeRoleTime{ - CurrentTime: output.Result.Credentials.CurrentTime, - ExpiredTime: output.Result.Credentials.ExpiredTime, - }, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/sts_provider.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/sts_provider.go deleted file mode 100644 index c4904c40414f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/sts_provider.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -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 credentials - -import ( - "encoding/json" - "fmt" - "time" - - "github.com/google/uuid" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/service/sts" -) - -type StsValue StsAssumeRoleProvider - -type StsProvider struct { - Expiry - StsValue -} - -func (s *StsProvider) Retrieve() (Value, error) { - ins := sts.NewInstance() - if s.Region != "" { - ins.SetRegion(s.Region) - } - if s.Host != "" { - ins.SetHost(s.Host) - } - if s.Timeout > 0 { - ins.Client.SetTimeout(s.Timeout) - } - if s.DurationSeconds < 900 { - return Value{}, fmt.Errorf("DurationSeconds must greater than 900 seconds ") - } - - ins.Client.SetAccessKey(s.AccessKey) - ins.Client.SetSecretKey(s.SecurityKey) - input := &sts.AssumeRoleRequest{ - DurationSeconds: s.DurationSeconds, - RoleTrn: fmt.Sprintf("trn:iam::%s:role/%s", s.AccountId, s.RoleName), - RoleSessionName: uuid.New().String(), - } - t := time.Now().Add(time.Duration(s.DurationSeconds-60) * time.Second) - output, _, err := ins.AssumeRole(input) - if err != nil || output.ResponseMetadata.Error != nil { - if err == nil { - bb, _err := json.Marshal(output.ResponseMetadata.Error) - if _err != nil { - return Value{}, _err - } - return Value{}, fmt.Errorf(string(bb)) - } - return Value{}, err - } - v := Value{ - AccessKeyID: output.Result.Credentials.AccessKeyId, - SecretAccessKey: output.Result.Credentials.SecretAccessKey, - SessionToken: output.Result.Credentials.SessionToken, - ProviderName: "StsProvider", - } - s.SetExpiration(t, 0) - return v, nil -} - -func (s *StsProvider) IsExpired() bool { - return s.Expiry.IsExpired() -} - -func NewStsCredentials(value StsValue) *Credentials { - - p := &StsProvider{ - StsValue: value, - Expiry: Expiry{}, - } - return NewExpireAbleCredentials(p) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom/custom.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom/custom.go deleted file mode 100644 index 7752c9ee8806..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom/custom.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -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 custom - -import ( - "context" - "net/http" - "net/url" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" -) - -type RequestMetadata struct { - ServiceName string - Version string - Action string - HttpMethod string - Region string - Request *http.Request - RawQuery *url.Values -} - -type ExtendHttpRequest func(ctx context.Context, request *http.Request) - -type ExtendHttpRequestWithMeta func(ctx context.Context, request *http.Request, meta RequestMetadata) - -type ExtraHttpParameters func(ctx context.Context) map[string]string - -type ExtraHttpParametersWithMeta func(ctx context.Context, meta RequestMetadata) map[string]string - -type ExtraHttpJsonBody func(ctx context.Context, input *map[string]interface{}, meta RequestMetadata) - -type LogAccount func(ctx context.Context) *string - -type DynamicCredentials func(ctx context.Context) (*credentials.Credentials, *string) - -// DynamicCredentialsIncludeError func return Credentials info and error info when error appear -type DynamicCredentialsIncludeError func(ctx context.Context) (*credentials.Credentials, *string, error) - -type CustomerUnmarshalError func(ctx context.Context, meta RequestMetadata, resp response.VolcengineResponse) error - -type CustomerUnmarshalData func(ctx context.Context, info RequestInfo, resp response.VolcengineResponse) interface{} - -type ForceJsonNumberDecode func(ctx context.Context, info RequestInfo) bool diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom/interceptor.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom/interceptor.go deleted file mode 100644 index c080e66c516a..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom/interceptor.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -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 custom - -import ( - "context" - "net/http" - "net/url" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" -) - -type SdkInterceptor struct { - Before BeforeCall - After AfterCall -} - -type RequestInfo struct { - Context context.Context - Request *http.Request - Response *http.Response - Name string - Method string - ClientInfo metadata.ClientInfo - URI string - Header http.Header - URL *url.URL - Input interface{} - Output interface{} - Metadata response.ResponseMetadata - Error error -} - -type BeforeCall func(RequestInfo) interface{} - -type AfterCall func(RequestInfo, interface{}) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/defaults/defaults.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/defaults/defaults.go deleted file mode 100644 index e5cc9002d6ad..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/defaults/defaults.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -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 defaults is a collection of helpers to retrieve the SDK's default -// configuration and handlers. -// -// Generally this package shouldn't be used directly, but session.Session -// instead. This package is useful when you need to reset the defaults -// of a session or service client to the SDK defaults before setting -// additional parameters. -package defaults - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "net" - "net/http" - "net/url" - "os" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/endpointcreds" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -// A Defaults provides a collection of default values for SDK clients. -type Defaults struct { - Config *volcengine.Config - Handlers request.Handlers -} - -// Get returns the SDK's default values with Config and handlers pre-configured. -func Get() Defaults { - cfg := Config() - handlers := Handlers() - cfg.Credentials = CredChain(cfg, handlers) - - return Defaults{ - Config: cfg, - Handlers: handlers, - } -} - -// Config returns the default configuration without credentials. -// To retrieve a config with credentials also included use -// `defaults.Get().Config` instead. -// -// Generally you shouldn't need to use this method directly, but -// is available if you need to reset the configuration of an -// existing service client or session. -func Config() *volcengine.Config { - return volcengine.NewConfig(). - WithCredentials(credentials.AnonymousCredentials). - WithRegion(os.Getenv("VOLCSTACK_REGION")). - WithHTTPClient(http.DefaultClient). - WithMaxRetries(volcengine.UseServiceDefaultRetries). - WithLogger(volcengine.NewDefaultLogger()). - WithLogLevel(volcengine.LogOff) -} - -// Handlers returns the default request handlers. -// -// Generally you shouldn't need to use this method directly, but -// is available if you need to reset the request handlers of an -// existing service client or session. -func Handlers() request.Handlers { - var handlers request.Handlers - - handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler) - handlers.Validate.AfterEachFn = request.HandlerListStopOnError - handlers.Build.PushBackNamed(corehandlers.CustomerRequestHandler) - handlers.Build.AfterEachFn = request.HandlerListStopOnError - handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) - handlers.Send.PushBackNamed(corehandlers.ValidateReqSigHandler) - handlers.Send.PushBackNamed(corehandlers.SendHandler) - handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler) - handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler) - - return handlers -} - -// CredChain returns the default credential chain. -// -// Generally you shouldn't need to use this method directly, but -// is available if you need to reset the credentials of an -// existing service client or session's Config. -func CredChain(cfg *volcengine.Config, handlers request.Handlers) *credentials.Credentials { - return credentials.NewCredentials(&credentials.ChainProvider{ - VerboseErrors: volcengine.BoolValue(cfg.CredentialsChainVerboseErrors), - Providers: CredProviders(cfg, handlers), - }) -} - -// CredProviders returns the slice of providers used in -// the default credential chain. -// -// For applications that need to use some other provider (for example use -// different environment variables for legacy reasons) but still fall back -// on the default chain of providers. This allows that default chaint to be -// automatically updated -func CredProviders(cfg *volcengine.Config, handlers request.Handlers) []credentials.Provider { - return []credentials.Provider{ - &credentials.EnvProvider{}, - &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, - } -} - -const ( - httpProviderAuthorizationEnvVar = "VOLCSTACK_CONTAINER_AUTHORIZATION_TOKEN" - httpProviderEnvVar = "VOLCSTACK_CONTAINER_CREDENTIALS_FULL_URI" -) - -var lookupHostFn = net.LookupHost - -func isLoopbackHost(host string) (bool, error) { - ip := net.ParseIP(host) - if ip != nil { - return ip.IsLoopback(), nil - } - - // Host is not an ip, perform lookup - addrs, err := lookupHostFn(host) - if err != nil { - return false, err - } - for _, addr := range addrs { - if !net.ParseIP(addr).IsLoopback() { - return false, nil - } - } - - return true, nil -} - -func localHTTPCredProvider(cfg volcengine.Config, handlers request.Handlers, u string) credentials.Provider { - var errMsg string - - parsed, err := url.Parse(u) - if err != nil { - errMsg = fmt.Sprintf("invalid URL, %v", err) - } else { - host := volcengine.URLHostname(parsed) - if len(host) == 0 { - errMsg = "unable to parse host from local HTTP cred provider URL" - } else if isLoopback, loopbackErr := isLoopbackHost(host); loopbackErr != nil { - errMsg = fmt.Sprintf("failed to resolve host %q, %v", host, loopbackErr) - } else if !isLoopback { - errMsg = fmt.Sprintf("invalid endpoint host, %q, only loopback hosts are allowed.", host) - } - } - - if len(errMsg) > 0 { - if cfg.Logger != nil { - cfg.Logger.Log("Ignoring, HTTP credential provider", errMsg, err) - } - return credentials.ErrorProvider{ - Err: volcengineerr.New("CredentialsEndpointError", errMsg, err), - ProviderName: endpointcreds.ProviderName, - } - } - - return httpCredProvider(cfg, handlers, u) -} - -func httpCredProvider(cfg volcengine.Config, handlers request.Handlers, u string) credentials.Provider { - return endpointcreds.NewProviderClient(cfg, handlers, u, - func(p *endpointcreds.Provider) { - p.ExpiryWindow = 5 * time.Minute - p.AuthorizationToken = os.Getenv(httpProviderAuthorizationEnvVar) - }, - ) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/defaults/shared_config.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/defaults/shared_config.go deleted file mode 100644 index a368c29b2745..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/defaults/shared_config.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 defaults - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/shareddefaults" -) - -// SharedCredentialsFilename returns the SDK's default file path -// for the shared credentials file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/credentials -// - Windows: %USERPROFILE%\.aws\credentials -func SharedCredentialsFilename() string { - return shareddefaults.SharedCredentialsFilename() -} - -// SharedConfigFilename returns the SDK's default file path for -// the shared config file. -// -// Builds the shared config file path based on the OS's platform. -// -// - Linux/Unix: $HOME/.aws/config -// - Windows: %USERPROFILE%\.aws\config -func SharedConfigFilename() string { - return shareddefaults.SharedConfigFilename() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/endpoints/endpoints.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/endpoints/endpoints.go deleted file mode 100644 index 9993578b5283..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/endpoints/endpoints.go +++ /dev/null @@ -1,515 +0,0 @@ -/* -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 endpoints - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "regexp" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// A Logger is a minimalistic interface for the SDK to log messages to. -type Logger interface { - Log(...interface{}) -} - -// DualStackEndpointState is a constant to describe the dual-stack endpoint resolution -// behavior. -type DualStackEndpointState uint - -const ( - // DualStackEndpointStateUnset is the default value behavior for dual-stack endpoint - // resolution. - DualStackEndpointStateUnset DualStackEndpointState = iota - - // DualStackEndpointStateEnabled enable dual-stack endpoint resolution for endpoints. - DualStackEndpointStateEnabled - - // DualStackEndpointStateDisabled disables dual-stack endpoint resolution for endpoints. - DualStackEndpointStateDisabled -) - -// FIPSEndpointState is a constant to describe the FIPS endpoint resolution behavior. -type FIPSEndpointState uint - -const ( - // FIPSEndpointStateUnset is the default value behavior for FIPS endpoint resolution. - FIPSEndpointStateUnset FIPSEndpointState = iota - - // FIPSEndpointStateEnabled enables FIPS endpoint resolution for service endpoints. - FIPSEndpointStateEnabled - - // FIPSEndpointStateDisabled disables FIPS endpoint resolution for endpoints. - FIPSEndpointStateDisabled -) - -// Options provide the configuration needed to direct how the -// endpoints will be resolved. -type Options struct { - // DisableSSL forces the endpoint to be resolved as HTTP. - // instead of HTTPS if the service supports it. - DisableSSL bool - - // Sets the resolver to resolve the endpoint as a dualstack endpoint - // for the service. If dualstack support for a service is not known and - // StrictMatching is not enabled a dualstack endpoint for the service will - // be returned. This endpoint may not be valid. If StrictMatching is - // enabled only services that are known to support dualstack will return - // dualstack endpoints. - // - // Deprecated: This option will continue to function for S3 and S3 Control for backwards compatibility. - // UseDualStackEndpoint should be used to enable usage of a service's dual-stack endpoint for all service clients - // moving forward. For S3 and S3 Control, when UseDualStackEndpoint is set to a non-zero value it takes higher - // precedence then this option. - UseDualStack bool - - // Sets the resolver to resolve a dual-stack endpoint for the service. - UseDualStackEndpoint DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint FIPSEndpointState - - // Enables strict matching of services and regions resolved endpoints. - // If the partition doesn't enumerate the exact service and region an - // error will be returned. This option will prevent returning endpoints - // that look valid, but may not resolve to any real endpoint. - StrictMatching bool - - // Enables resolving a service endpoint based on the region provided if the - // service does not exist. The service endpoint ID will be used as the service - // domain name prefix. By default the endpoint resolver requires the service - // to be known when resolving endpoints. - // - // If resolving an endpoint on the partition list the provided region will - // be used to determine which partition's domain name pattern to the service - // endpoint ID with. If both the service and region are unknown and resolving - // the endpoint on partition list an UnknownEndpointError error will be returned. - // - // If resolving and endpoint on a partition specific resolver that partition's - // domain name pattern will be used with the service endpoint ID. If both - // region and service do not exist when resolving an endpoint on a specific - // partition the partition's domain pattern will be used to combine the - // endpoint and region together. - // - // This option is ignored if StrictMatching is enabled. - ResolveUnknownService bool -} - -// Set combines all of the option functions together. -func (o *Options) Set(optFns ...func(*Options)) { - for _, fn := range optFns { - fn(o) - } -} - -// DisableSSLOption sets the DisableSSL options. Can be used as a functional -// option when resolving endpoints. -func DisableSSLOption(o *Options) { - o.DisableSSL = true -} - -// UseDualStackOption sets the UseDualStack option. Can be used as a functional -// option when resolving endpoints. -// -// Deprecated: UseDualStackEndpointOption should be used to enable usage of a service's dual-stack endpoint. -// When DualStackEndpointState is set to a non-zero value it takes higher precedence then this option. -func UseDualStackOption(o *Options) { - o.UseDualStack = true -} - -// UseDualStackEndpointOption sets the UseDualStackEndpoint option to enabled. Can be used as a functional -// option when resolving endpoints. -func UseDualStackEndpointOption(o *Options) { - o.UseDualStackEndpoint = DualStackEndpointStateEnabled -} - -// UseFIPSEndpointOption sets the UseFIPSEndpoint option to enabled. Can be used as a functional -// option when resolving endpoints. -func UseFIPSEndpointOption(o *Options) { - o.UseFIPSEndpoint = FIPSEndpointStateEnabled -} - -// StrictMatchingOption sets the StrictMatching option. Can be used as a functional -// option when resolving endpoints. -func StrictMatchingOption(o *Options) { - o.StrictMatching = true -} - -// ResolveUnknownServiceOption sets the ResolveUnknownService option. Can be used -// as a functional option when resolving endpoints. -func ResolveUnknownServiceOption(o *Options) { - o.ResolveUnknownService = true -} - -// A Resolver provides the interface for functionality to resolve endpoints. -// The build in Partition and DefaultResolver return value satisfy this interface. -type Resolver interface { - EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) -} - -// ResolverFunc is a helper utility that wraps a function so it satisfies the -// Resolver interface. This is useful when you want to add additional endpoint -// resolving logic, or stub out specific endpoints with custom values. -type ResolverFunc func(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) - -// EndpointFor wraps the ResolverFunc function to satisfy the Resolver interface. -func (fn ResolverFunc) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return fn(service, region, opts...) -} - -var schemeRE = regexp.MustCompile("^([^:]+)://") - -// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no -// scheme. If disableSSL is true HTTP will set HTTP instead of the default HTTPS. -// -// If disableSSL is set, it will only set the URL's scheme if the URL does not -// contain a scheme. -func AddScheme(endpoint string, disableSSL bool) string { - if !schemeRE.MatchString(endpoint) { - scheme := "https" - if disableSSL { - scheme = "http" - } - endpoint = fmt.Sprintf("%s://%s", scheme, endpoint) - } - - return endpoint -} - -// EnumPartitions a provides a way to retrieve the underlying partitions that -// make up the SDK's default Resolver, or any resolver decoded from a model -// file. -// -// Use this interface with DefaultResolver and DecodeModels to get the list of -// Partitions. -type EnumPartitions interface { - Partitions() []Partition -} - -// A Partition provides the ability to enumerate the partition's regions -// and services. -type Partition struct { - id, dnsSuffix string - p *partition -} - -// DNSSuffix returns the base domain name of the partition. -func (p Partition) DNSSuffix() string { return p.dnsSuffix } - -// ID returns the identifier of the partition. -func (p Partition) ID() string { return p.id } - -// EndpointFor attempts to resolve the endpoint based on service and region. -// See Options for information on configuring how the endpoint is resolved. -// -// If the service cannot be found in the metadata the UnknownServiceError -// error will be returned. This validation will occur regardless if -// StrictMatching is enabled. To enable resolving unknown services set the -// "ResolveUnknownService" option to true. When StrictMatching is disabled -// this option allows the partition resolver to resolve a endpoint based on -// the service endpoint ID provided. -// -// When resolving endpoints you can choose to enable StrictMatching. This will -// require the provided service and region to be known by the partition. -// If the endpoint cannot be strictly resolved an error will be returned. This -// mode is useful to ensure the endpoint resolved is valid. Without -// StrictMatching enabled the endpoint returned my look valid but may not work. -// StrictMatching requires the SDK to be updated if you want to take advantage -// of new regions and services expansions. -// -// Errors that can be returned. -// - UnknownServiceError -// - UnknownEndpointError -func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return p.p.EndpointFor(service, region, opts...) -} - -// Regions returns a map of Regions indexed by their ID. This is useful for -// enumerating over the regions in a partition. -func (p Partition) Regions() map[string]Region { - rs := map[string]Region{} - for id, r := range p.p.Regions { - rs[id] = Region{ - id: id, - desc: r.Description, - p: p.p, - } - } - - return rs -} - -// Services returns a map of Service indexed by their ID. This is useful for -// enumerating over the services in a partition. -func (p Partition) Services() map[string]Service { - ss := map[string]Service{} - for id := range p.p.Services { - ss[id] = Service{ - id: id, - p: p.p, - } - } - - // Since we have removed the customization that injected this into the model - // we still need to pretend that this is a modeled service. - if _, ok := ss[Ec2metadataServiceID]; !ok { - ss[Ec2metadataServiceID] = Service{ - id: Ec2metadataServiceID, - p: p.p, - } - } - - return ss -} - -// A Region provides information about a region, and ability to resolve an -// endpoint from the context of a region, given a service. -type Region struct { - id, desc string - p *partition -} - -// ID returns the region's identifier. -func (r Region) ID() string { return r.id } - -// Description returns the region's description. The region description -// is free text, it can be empty, and it may change between SDK releases. -func (r Region) Description() string { return r.desc } - -// ResolveEndpoint resolves an endpoint from the context of the region given -// a service. See Partition.EndpointFor for usage and errors that can be returned. -func (r Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return r.p.EndpointFor(service, r.id, opts...) -} - -// Services returns a list of all services that are known to be in this region. -func (r Region) Services() map[string]Service { - ss := map[string]Service{} - for id, s := range r.p.Services { - if _, ok := s.Endpoints[endpointKey{Region: r.id}]; ok { - ss[id] = Service{ - id: id, - p: r.p, - } - } - } - - return ss -} - -// A Service provides information about a service, and ability to resolve an -// endpoint from the context of a service, given a region. -type Service struct { - id string - p *partition -} - -// ID returns the identifier for the service. -func (s Service) ID() string { return s.id } - -// ResolveEndpoint resolves an endpoint from the context of a service given -// a region. See Partition.EndpointFor for usage and errors that can be returned. -func (s Service) ResolveEndpoint(region string, opts ...func(*Options)) (ResolvedEndpoint, error) { - return s.p.EndpointFor(s.id, region, opts...) -} - -// Regions returns a map of Regions that the service is present in. -// -// A region is the Volcengine region the service exists in. Whereas a Endpoint is -// an URL that can be resolved to a instance of a service. -func (s Service) Regions() map[string]Region { - rs := map[string]Region{} - - service, ok := s.p.Services[s.id] - - // Since ec2metadata customization has been removed we need to check - // if it was defined in non-standard endpoints.json file. If it's not - // then we can return the empty map as there is no regional-endpoints for IMDS. - // Otherwise, we iterate need to iterate the non-standard model. - if s.id == Ec2metadataServiceID && !ok { - return rs - } - - for id := range service.Endpoints { - if id.Variant != 0 { - continue - } - if r, ok := s.p.Regions[id.Region]; ok { - rs[id.Region] = Region{ - id: id.Region, - desc: r.Description, - p: s.p, - } - } - } - - return rs -} - -// Endpoints returns a map of Endpoints indexed by their ID for all known -// endpoints for a service. -// -// A region is the Volcengine region the service exists in. Whereas a Endpoint is -// an URL that can be resolved to a instance of a service. -func (s Service) Endpoints() map[string]Endpoint { - es := map[string]Endpoint{} - for id := range s.p.Services[s.id].Endpoints { - if id.Variant != 0 { - continue - } - es[id.Region] = Endpoint{ - id: id.Region, - serviceID: s.id, - p: s.p, - } - } - - return es -} - -// A Endpoint provides information about endpoints, and provides the ability -// to resolve that endpoint for the service, and the region the endpoint -// represents. -type Endpoint struct { - id string - serviceID string - p *partition -} - -// ID returns the identifier for an endpoint. -func (e Endpoint) ID() string { return e.id } - -// ServiceID returns the identifier the endpoint belongs to. -func (e Endpoint) ServiceID() string { return e.serviceID } - -// ResolveEndpoint resolves an endpoint from the context of a service and -// region the endpoint represents. See Partition.EndpointFor for usage and -// errors that can be returned. -func (e Endpoint) ResolveEndpoint(opts ...func(*Options)) (ResolvedEndpoint, error) { - return e.p.EndpointFor(e.serviceID, e.id, opts...) -} - -// A ResolvedEndpoint is an endpoint that has been resolved based on a partition -// service, and region. -type ResolvedEndpoint struct { - // The endpoint URL - URL string - - // The region that should be used for signing requests. - SigningRegion string - - // The service name that should be used for signing requests. - SigningName string - - // States that the signing name for this endpoint was derived from metadata - // passed in, but was not explicitly modeled. - SigningNameDerived bool - - // The signing method that should be used for signing requests. - SigningMethod string -} - -// So that the Error interface type can be included as an anonymous field -// in the requestError struct and not conflict with the error.Error() method. -type volcengineerror volcengineerr.Error - -// A EndpointNotFoundError is returned when in StrictMatching mode, and the -// endpoint for the service and region cannot be found in any of the partitions. -type EndpointNotFoundError struct { - volcengineerror - Partition string - Service string - Region string -} - -// A UnknownServiceError is returned when the service does not resolve to an -// endpoint. Includes a list of all known services for the partition. Returned -// when a partition does not support the service. -type UnknownServiceError struct { - volcengineerror - Partition string - Service string - Known []string -} - -// NewUnknownServiceError builds and returns UnknownServiceError. -func NewUnknownServiceError(p, s string, known []string) UnknownServiceError { - return UnknownServiceError{ - volcengineerror: volcengineerr.New("UnknownServiceError", - "could not resolve endpoint for unknown service", nil), - Partition: p, - Service: s, - Known: known, - } -} - -// String returns the string representation of the error. -func (e UnknownServiceError) Error() string { - extra := fmt.Sprintf("partition: %q, service: %q", - e.Partition, e.Service) - if len(e.Known) > 0 { - extra += fmt.Sprintf(", known: %v", e.Known) - } - return volcengineerr.SprintError(e.Code(), e.Message(), extra, e.OrigErr()) -} - -// String returns the string representation of the error. -func (e UnknownServiceError) String() string { - return e.Error() -} - -// A UnknownEndpointError is returned when in StrictMatching mode and the -// service is valid, but the region does not resolve to an endpoint. Includes -// a list of all known endpoints for the service. -type UnknownEndpointError struct { - volcengineerror - Partition string - Service string - Region string - Known []string -} - -// NewUnknownEndpointError builds and returns UnknownEndpointError. -func NewUnknownEndpointError(p, s, r string, known []string) UnknownEndpointError { - return UnknownEndpointError{ - volcengineerror: volcengineerr.New("UnknownEndpointError", - "could not resolve endpoint", nil), - Partition: p, - Service: s, - Region: r, - Known: known, - } -} - -// String returns the string representation of the error. -func (e UnknownEndpointError) Error() string { - extra := fmt.Sprintf("partition: %q, service: %q, region: %q", - e.Partition, e.Service, e.Region) - if len(e.Known) > 0 { - extra += fmt.Sprintf(", known: %v", e.Known) - } - return volcengineerr.SprintError(e.Code(), e.Message(), extra, e.OrigErr()) -} - -// String returns the string representation of the error. -func (e UnknownEndpointError) String() string { - return e.Error() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/endpoints/model.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/endpoints/model.go deleted file mode 100644 index e652360226e8..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/endpoints/model.go +++ /dev/null @@ -1,455 +0,0 @@ -/* -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 endpoints - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/json" - "fmt" - "regexp" - "strconv" - "strings" -) - -type partitions []partition - -func (ps partitions) EndpointFor(service, region string, opts ...func(*Options)) (ResolvedEndpoint, error) { - var opt Options - opt.Set(opts...) - - if len(opt.ResolvedRegion) > 0 { - region = opt.ResolvedRegion - } - - for i := 0; i < len(ps); i++ { - if !ps[i].canResolveEndpoint(service, region, opt) { - continue - } - - return ps[i].EndpointFor(service, region, opts...) - } - - // If loose matching fallback to first partition format to use - // when resolving the endpoint. - if !opt.StrictMatching && len(ps) > 0 { - return ps[0].EndpointFor(service, region, opts...) - } - - return ResolvedEndpoint{}, NewUnknownEndpointError("all partitions", service, region, []string{}) -} - -// Partitions satisfies the EnumPartitions interface and returns a list -// of Partitions representing each partition represented in the SDK's -// endpoints model. -func (ps partitions) Partitions() []Partition { - parts := make([]Partition, 0, len(ps)) - for i := 0; i < len(ps); i++ { - parts = append(parts, ps[i].Partition()) - } - - return parts -} - -type endpointWithVariants struct { - endpoint - Variants []endpointWithTags `json:"variants"` -} - -type endpointWithTags struct { - endpoint - Tags []string `json:"tags"` -} - -type endpointDefaults map[defaultKey]endpoint - -func (p *endpointDefaults) UnmarshalJSON(data []byte) error { - if *p == nil { - *p = make(endpointDefaults) - } - - var e endpointWithVariants - if err := json.Unmarshal(data, &e); err != nil { - return err - } - - (*p)[defaultKey{Variant: 0}] = e.endpoint - - e.Hostname = "" - e.DNSSuffix = "" - - for _, variant := range e.Variants { - endpointVariant, unknown := parseVariantTags(variant.Tags) - if unknown { - continue - } - - var ve endpoint - ve.mergeIn(e.endpoint) - ve.mergeIn(variant.endpoint) - - (*p)[defaultKey{Variant: endpointVariant}] = ve - } - - return nil -} - -func parseVariantTags(tags []string) (ev endpointVariant, unknown bool) { - if len(tags) == 0 { - unknown = true - return - } - - for _, tag := range tags { - switch { - case strings.EqualFold("fips", tag): - ev |= fipsVariant - case strings.EqualFold("dualstack", tag): - ev |= dualStackVariant - default: - unknown = true - } - } - return ev, unknown -} - -type partition struct { - ID string `json:"partition"` - Name string `json:"partitionName"` - DNSSuffix string `json:"dnsSuffix"` - RegionRegex regionRegex `json:"regionRegex"` - Defaults endpointDefaults `json:"defaults"` - Regions regions `json:"regions"` - Services services `json:"services"` -} - -func (p partition) Partition() Partition { - return Partition{ - dnsSuffix: p.DNSSuffix, - id: p.ID, - p: &p, - } -} - -func (p partition) canResolveEndpoint(service, region string, options Options) bool { - s, hasService := p.Services[service] - _, hasEndpoint := s.Endpoints[endpointKey{ - Region: region, - Variant: options.getEndpointVariant(service), - }] - - if hasEndpoint && hasService { - return true - } - - if options.StrictMatching { - return false - } - - return p.RegionRegex.MatchString(region) -} - -func (p partition) EndpointFor(service, region string, opts ...func(*Options)) (resolved ResolvedEndpoint, err error) { - var opt Options - opt.Set(opts...) - - if len(opt.ResolvedRegion) > 0 { - region = opt.ResolvedRegion - } - - s, hasService := p.Services[service] - if !(hasService || opt.ResolveUnknownService) { - // Only return error if the resolver will not fallback to creating - // endpoint based on service endpoint ID passed in. - return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services)) - } - - e, hasEndpoint := s.endpointForRegion(region) - if !hasEndpoint && opt.StrictMatching { - return resolved, NewUnknownEndpointError(p.ID, service, region, endpointList(s.Endpoints)) - } - - defs := []endpoint{p.Defaults, s.Defaults} - return e.resolve(service, region, p.DNSSuffix, defs, opt), nil -} - -func serviceList(ss services) []string { - list := make([]string, 0, len(ss)) - for k := range ss { - list = append(list, k) - } - return list -} -func endpointList(es serviceEndpoints, variant endpointVariant) []string { - list := make([]string, 0, len(es)) - for k := range es { - if k.Variant != variant { - continue - } - list = append(list, k.Region) - } - return list -} - -type regionRegex struct { - *regexp.Regexp -} - -func (rr *regionRegex) UnmarshalJSON(b []byte) (err error) { - // Strip leading and trailing quotes - regex, err := strconv.Unquote(string(b)) - if err != nil { - return fmt.Errorf("unable to strip quotes from regex, %v", err) - } - - rr.Regexp, err = regexp.Compile(regex) - if err != nil { - return fmt.Errorf("unable to unmarshal region regex, %v", err) - } - return nil -} - -type regions map[string]region - -type region struct { - Description string `json:"description"` -} - -type services map[string]service - -type service struct { - PartitionEndpoint string `json:"partitionEndpoint"` - IsRegionalized boxedBool `json:"isRegionalized,omitempty"` - Defaults endpointDefaults `json:"defaults"` - Endpoints serviceEndpoints `json:"endpoints"` -} - -func (s *service) endpointForRegion(region string) (endpoint, bool) { - if s.IsRegionalized == boxedFalse { - return endpoints[endpointKey{Region: s.PartitionEndpoint, Variant: variant}], region == s.PartitionEndpoint - } - - if e, ok := s.Endpoints[region]; ok { - return e, true - } - - // Unable to find any matching endpoint, return - // blank that will be used for generic endpoint creation. - return endpoint{}, false -} - -type serviceEndpoints map[endpointKey]endpoint - -func (s *serviceEndpoints) UnmarshalJSON(data []byte) error { - if *s == nil { - *s = make(serviceEndpoints) - } - - var regionToEndpoint map[string]endpointWithVariants - - if err := json.Unmarshal(data, ®ionToEndpoint); err != nil { - return err - } - - for region, e := range regionToEndpoint { - (*s)[endpointKey{Region: region}] = e.endpoint - - e.Hostname = "" - e.DNSSuffix = "" - - for _, variant := range e.Variants { - endpointVariant, unknown := parseVariantTags(variant.Tags) - if unknown { - continue - } - - var ve endpoint - ve.mergeIn(e.endpoint) - ve.mergeIn(variant.endpoint) - - (*s)[endpointKey{Region: region, Variant: endpointVariant}] = ve - } - } - - return nil -} - -type endpoint struct { - Hostname string `json:"hostname"` - Protocols []string `json:"protocols"` - CredentialScope credentialScope `json:"credentialScope"` - - DNSSuffix string `json:"dnsSuffix"` - - // Signature Version not used - SignatureVersions []string `json:"signatureVersions"` - - // SSLCommonName not used. - SSLCommonName string `json:"sslCommonName"` - - Deprecated boxedBool `json:"deprecated"` -} - -// isZero returns whether the endpoint structure is an empty (zero) value. -func (e endpoint) isZero() bool { - switch { - case len(e.Hostname) != 0: - return false - case len(e.Protocols) != 0: - return false - case e.CredentialScope != (credentialScope{}): - return false - case len(e.SignatureVersions) != 0: - return false - case len(e.SSLCommonName) != 0: - return false - } - return true -} - -const ( - defaultProtocol = "https" - defaultSigner = "v4" -) - -var ( - protocolPriority = []string{"https", "http"} - signerPriority = []string{"v4", "v2"} -) - -func getByPriority(s []string, p []string, def string) string { - if len(s) == 0 { - return def - } - - for i := 0; i < len(p); i++ { - for j := 0; j < len(s); j++ { - if s[j] == p[i] { - return s[j] - } - } - } - - return s[0] -} - -func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { - var merged endpoint - for _, def := range defs { - merged.mergeIn(def) - } - merged.mergeIn(e) - e = merged - - hostname := e.Hostname - - // Offset the hostname for dualstack if enabled - if opts.UseDualStack && e.HasDualStack == boxedTrue { - hostname = e.DualStackHostname - } - - u := strings.Replace(hostname, "{service}", service, 1) - u = strings.Replace(u, "{region}", region, 1) - u = strings.Replace(u, "{dnsSuffix}", dnsSuffix, 1) - - scheme := getEndpointScheme(e.Protocols, opts.DisableSSL) - u = fmt.Sprintf("%s://%s", scheme, u) - - signingRegion := e.CredentialScope.Region - if len(signingRegion) == 0 { - signingRegion = region - } - - signingName := e.CredentialScope.Service - var signingNameDerived bool - if len(signingName) == 0 { - signingName = service - signingNameDerived = true - } - - return ResolvedEndpoint{ - URL: u, - SigningRegion: signingRegion, - SigningName: signingName, - SigningNameDerived: signingNameDerived, - SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner), - } -} - -func getEndpointScheme(protocols []string, disableSSL bool) string { - if disableSSL { - return "http" - } - - return getByPriority(protocols, protocolPriority, defaultProtocol) -} - -func (e *endpoint) mergeIn(other endpoint) { - if len(other.Hostname) > 0 { - e.Hostname = other.Hostname - } - if len(other.Protocols) > 0 { - e.Protocols = other.Protocols - } - if len(other.SignatureVersions) > 0 { - e.SignatureVersions = other.SignatureVersions - } - if len(other.CredentialScope.Region) > 0 { - e.CredentialScope.Region = other.CredentialScope.Region - } - if len(other.CredentialScope.Service) > 0 { - e.CredentialScope.Service = other.CredentialScope.Service - } - if len(other.SSLCommonName) > 0 { - e.SSLCommonName = other.SSLCommonName - } - if len(other.DNSSuffix) > 0 { - e.DNSSuffix = other.DNSSuffix - } - if other.Deprecated != boxedBoolUnset { - e.Deprecated = other.Deprecated - } -} - -type credentialScope struct { - Region string `json:"region"` - Service string `json:"service"` -} - -type boxedBool int - -func (b *boxedBool) UnmarshalJSON(buf []byte) error { - v, err := strconv.ParseBool(string(buf)) - if err != nil { - return err - } - - if v { - *b = boxedTrue - } else { - *b = boxedFalse - } - - return nil -} - -const ( - boxedBoolUnset boxedBool = iota - boxedFalse - boxedTrue -) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/errors.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/errors.go deleted file mode 100644 index 916e883313b6..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/errors.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" - -var ( - // ErrMissingRegion is an error that is returned if region configuration is - // not found. - ErrMissingRegion = volcengineerr.New("MissingRegion", "could not find region configuration", nil) - - // ErrMissingEndpoint is an error that is returned if an endpoint cannot be - // resolved for a service. - ErrMissingEndpoint = volcengineerr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) -) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/jsonvalue.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/jsonvalue.go deleted file mode 100644 index b0c4536b657d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/jsonvalue.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// JSONValue is a representation of a grab bag type that will be marshaled -// into a json string. This type can be used just like any other map. -// -// Example: -// -// values := volcengine.JSONValue{ -// "Foo": "Bar", -// } -// values["Baz"] = "Qux" -type JSONValue map[string]interface{} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/logger.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/logger.go deleted file mode 100644 index 226444fd2bf7..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/logger.go +++ /dev/null @@ -1,140 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "log" - "os" -) - -// A LogLevelType defines the level logging should be performed at. Used to instruct -// the SDK which statements should be logged. -type LogLevelType uint - -// LogLevel returns the pointer to a LogLevel. Should be used to workaround -// not being able to take the address of a non-composite literal. -func LogLevel(l LogLevelType) *LogLevelType { - return &l -} - -// Value returns the LogLevel value or the default value LogOff if the LogLevel -// is nil. Safe to use on nil value LogLevelTypes. -func (l *LogLevelType) Value() LogLevelType { - if l != nil { - return *l - } - return LogOff -} - -// Matches returns true if the v LogLevel is enabled by this LogLevel. Should be -// used with logging sub levels. Is safe to use on nil value LogLevelTypes. If -// LogLevel is nil, will default to LogOff comparison. -func (l *LogLevelType) Matches(v LogLevelType) bool { - c := l.Value() - return c&v == v -} - -// AtLeast returns true if this LogLevel is at least high enough to satisfies v. -// Is safe to use on nil value LogLevelTypes. If LogLevel is nil, will default -// to LogOff comparison. -func (l *LogLevelType) AtLeast(v LogLevelType) bool { - c := l.Value() - return c >= v -} - -const ( - // LogOff states that no logging should be performed by the SDK. This is the - // default state of the SDK, and should be use to disable all logging. - LogOff LogLevelType = iota * 0x1000 - - // LogDebug state that debug output should be logged by the SDK. This should - // be used to inspect request made and responses received. - LogDebug -) - -// Debug Logging Sub Levels -const ( - // LogDebugWithSigning states that the SDK should log request signing and - // presigning events. This should be used to log the signing details of - // requests for debugging. Will also enable LogDebug. - LogDebugWithSigning LogLevelType = LogDebug | (1 << iota) - - // LogDebugWithHTTPBody states the SDK should log HTTP request and response - // HTTP bodys in addition to the headers and path. This should be used to - // see the volcenginebody content of requests and responses made while using the SDK - // Will also enable LogDebug. - LogDebugWithHTTPBody - - // LogDebugWithRequestRetries states the SDK should log when service requests will - // be retried. This should be used to log when you want to log when service - // requests are being retried. Will also enable LogDebug. - LogDebugWithRequestRetries - - // LogDebugWithRequestErrors states the SDK should log when service requests fail - // to build, send, validate, or unmarshal. - LogDebugWithRequestErrors - - // LogDebugWithEventStreamBody states the SDK should log EventStream - // request and response bodys. This should be used to log the EventStream - // wire unmarshaled message content of requests and responses made while - // using the SDK Will also enable LogDebug. - LogDebugWithEventStreamBody - - // LogInfoWithInputAndOutput states the SDK should log STRUCT input and output - // Will also enable LogInfo. - LogInfoWithInputAndOutput - - // LogDebugWithInputAndOutput states the SDK should log STRUCT input and output - // Will also enable LogDebug. - LogDebugWithInputAndOutput -) - -// A Logger is a minimalistic interface for the SDK to log messages to. Should -// be used to provide custom logging writers for the SDK to use. -type Logger interface { - Log(...interface{}) -} - -// A LoggerFunc is a convenience type to convert a function taking a variadic -// list of arguments and wrap it so the Logger interface can be used. -type LoggerFunc func(...interface{}) - -// Log calls the wrapped function with the arguments provided -func (f LoggerFunc) Log(args ...interface{}) { - f(args...) -} - -// NewDefaultLogger returns a Logger which will write log messages to stdout, and -// use same formatting runes as the stdlib log.Logger -func NewDefaultLogger() Logger { - return &defaultLogger{ - logger: log.New(os.Stdout, "", log.LstdFlags), - } -} - -// A defaultLogger provides a minimalistic logger satisfying the Logger interface. -type defaultLogger struct { - logger *log.Logger -} - -// Log logs the parameters to the stdlib logger. See log.Println. -func (l defaultLogger) Log(args ...interface{}) { - l.logger.Println(args...) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/connection_reset_error.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/connection_reset_error.go deleted file mode 100644 index ed546d72288b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/connection_reset_error.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "strings" -) - -func isErrConnectionReset(err error) bool { - if strings.Contains(err.Error(), "read: connection reset") { - return false - } - - if strings.Contains(err.Error(), "connection reset") || - strings.Contains(err.Error(), "broken pipe") { - return true - } - - return false -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/handlers.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/handlers.go deleted file mode 100644 index a2b770c0631f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/handlers.go +++ /dev/null @@ -1,341 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "strings" -) - -// A Handlers provides a collection of request handlers for various -// stages of handling requests. -type Handlers struct { - Validate HandlerList - Build HandlerList - Sign HandlerList - Send HandlerList - ValidateResponse HandlerList - Unmarshal HandlerList - UnmarshalStream HandlerList - UnmarshalMeta HandlerList - UnmarshalError HandlerList - Retry HandlerList - AfterRetry HandlerList - CompleteAttempt HandlerList - Complete HandlerList -} - -// Copy returns a copy of this handler's lists. -func (h *Handlers) Copy() Handlers { - return Handlers{ - Validate: h.Validate.copy(), - Build: h.Build.copy(), - Sign: h.Sign.copy(), - Send: h.Send.copy(), - ValidateResponse: h.ValidateResponse.copy(), - Unmarshal: h.Unmarshal.copy(), - UnmarshalStream: h.UnmarshalStream.copy(), - UnmarshalError: h.UnmarshalError.copy(), - UnmarshalMeta: h.UnmarshalMeta.copy(), - Retry: h.Retry.copy(), - AfterRetry: h.AfterRetry.copy(), - CompleteAttempt: h.CompleteAttempt.copy(), - Complete: h.Complete.copy(), - } -} - -// Clear removes callback functions for all handlers. -func (h *Handlers) Clear() { - h.Validate.Clear() - h.Build.Clear() - h.Send.Clear() - h.Sign.Clear() - h.Unmarshal.Clear() - h.UnmarshalStream.Clear() - h.UnmarshalMeta.Clear() - h.UnmarshalError.Clear() - h.ValidateResponse.Clear() - h.Retry.Clear() - h.AfterRetry.Clear() - h.CompleteAttempt.Clear() - h.Complete.Clear() -} - -// IsEmpty returns if there are no handlers in any of the handlerlists. -func (h *Handlers) IsEmpty() bool { - if h.Validate.Len() != 0 { - return false - } - if h.Build.Len() != 0 { - return false - } - if h.Send.Len() != 0 { - return false - } - if h.Sign.Len() != 0 { - return false - } - if h.Unmarshal.Len() != 0 { - return false - } - if h.UnmarshalStream.Len() != 0 { - return false - } - if h.UnmarshalMeta.Len() != 0 { - return false - } - if h.UnmarshalError.Len() != 0 { - return false - } - if h.ValidateResponse.Len() != 0 { - return false - } - if h.Retry.Len() != 0 { - return false - } - if h.AfterRetry.Len() != 0 { - return false - } - if h.CompleteAttempt.Len() != 0 { - return false - } - if h.Complete.Len() != 0 { - return false - } - - return true -} - -// A HandlerListRunItem represents an entry in the HandlerList which -// is being run. -type HandlerListRunItem struct { - Index int - Handler NamedHandler - Request *Request -} - -// A HandlerList manages zero or more handlers in a list. -type HandlerList struct { - list []NamedHandler - - // Called after each request handler in the list is called. If set - // and the func returns true the HandlerList will continue to iterate - // over the request handlers. If false is returned the HandlerList - // will stop iterating. - // - // Should be used if extra logic to be performed between each handler - // in the list. This can be used to terminate a list's iteration - // based on a condition such as error like, HandlerListStopOnError. - // Or for logging like HandlerListLogItem. - AfterEachFn func(item HandlerListRunItem) bool -} - -// A NamedHandler is a struct that contains a name and function callback. -type NamedHandler struct { - Name string - Fn func(*Request) -} - -// copy creates a copy of the handler list. -func (l *HandlerList) copy() HandlerList { - n := HandlerList{ - AfterEachFn: l.AfterEachFn, - } - if len(l.list) == 0 { - return n - } - - n.list = append(make([]NamedHandler, 0, len(l.list)), l.list...) - return n -} - -// Clear clears the handler list. -func (l *HandlerList) Clear() { - l.list = l.list[0:0] -} - -// Len returns the number of handlers in the list. -func (l *HandlerList) Len() int { - return len(l.list) -} - -// PushBack pushes handler f to the back of the handler list. -func (l *HandlerList) PushBack(f func(*Request)) { - l.PushBackNamed(NamedHandler{"__anonymous", f}) -} - -// PushBackNamed pushes named handler f to the back of the handler list. -func (l *HandlerList) PushBackNamed(n NamedHandler) { - if cap(l.list) == 0 { - l.list = make([]NamedHandler, 0, 5) - } - l.list = append(l.list, n) -} - -// PushFront pushes handler f to the front of the handler list. -func (l *HandlerList) PushFront(f func(*Request)) { - l.PushFrontNamed(NamedHandler{"__anonymous", f}) -} - -// PushFrontNamed pushes named handler f to the front of the handler list. -func (l *HandlerList) PushFrontNamed(n NamedHandler) { - if cap(l.list) == len(l.list) { - // Allocating new list required - l.list = append([]NamedHandler{n}, l.list...) - } else { - // Enough room to prepend into list. - l.list = append(l.list, NamedHandler{}) - copy(l.list[1:], l.list) - l.list[0] = n - } -} - -// Remove removes a NamedHandler n -func (l *HandlerList) Remove(n NamedHandler) { - l.RemoveByName(n.Name) -} - -// RemoveByName removes a NamedHandler by name. -func (l *HandlerList) RemoveByName(name string) { - for i := 0; i < len(l.list); i++ { - m := l.list[i] - if m.Name == name { - // Shift array preventing creating new arrays - copy(l.list[i:], l.list[i+1:]) - l.list[len(l.list)-1] = NamedHandler{} - l.list = l.list[:len(l.list)-1] - - // decrement list so next check to length is correct - i-- - } - } -} - -// SwapNamed will swap out any existing handlers with the same name as the -// passed in NamedHandler returning true if handlers were swapped. False is -// returned otherwise. -func (l *HandlerList) SwapNamed(n NamedHandler) (swapped bool) { - for i := 0; i < len(l.list); i++ { - if l.list[i].Name == n.Name { - l.list[i].Fn = n.Fn - swapped = true - } - } - - return swapped -} - -// Swap will swap out all handlers matching the name passed in. The matched -// handlers will be swapped in. True is returned if the handlers were swapped. -func (l *HandlerList) Swap(name string, replace NamedHandler) bool { - var swapped bool - - for i := 0; i < len(l.list); i++ { - if l.list[i].Name == name { - l.list[i] = replace - swapped = true - } - } - - return swapped -} - -// SetBackNamed will replace the named handler if it exists in the handler list. -// If the handler does not exist the handler will be added to the end of the list. -func (l *HandlerList) SetBackNamed(n NamedHandler) { - if !l.SwapNamed(n) { - l.PushBackNamed(n) - } -} - -// SetFrontNamed will replace the named handler if it exists in the handler list. -// If the handler does not exist the handler will be added to the beginning of -// the list. -func (l *HandlerList) SetFrontNamed(n NamedHandler) { - if !l.SwapNamed(n) { - l.PushFrontNamed(n) - } -} - -// Run executes all handlers in the list with a given request object. -func (l *HandlerList) Run(r *Request) { - for i, h := range l.list { - h.Fn(r) - item := HandlerListRunItem{ - Index: i, Handler: h, Request: r, - } - if l.AfterEachFn != nil && !l.AfterEachFn(item) { - return - } - } -} - -// HandlerListLogItem logs the request handler and the state of the -// request's Error value. Always returns true to continue iterating -// request handlers in a HandlerList. -func HandlerListLogItem(item HandlerListRunItem) bool { - if item.Request.Config.Logger == nil { - return true - } - item.Request.Config.Logger.Log("DEBUG: RequestHandler", - item.Index, item.Handler.Name, item.Request.Error) - - return true -} - -// HandlerListStopOnError returns false to stop the HandlerList iterating -// over request handlers if Request.Error is not nil. True otherwise -// to continue iterating. -func HandlerListStopOnError(item HandlerListRunItem) bool { - return item.Request.Error == nil -} - -// WithAppendUserAgent will add a string to the user agent prefixed with a -// single white space. -func WithAppendUserAgent(s string) Option { - return func(r *Request) { - r.Handlers.Build.PushBack(func(r2 *Request) { - AddToUserAgent(r, s) - }) - } -} - -// MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request -// header. If the extra parameters are provided they will be added as metadata to the -// name/version pair resulting in the following format. -// "name/version (extra0; extra1; ...)" -// The user agent part will be concatenated with this current request's user agent string. -func MakeAddToUserAgentHandler(name, version string, extra ...string) func(*Request) { - ua := fmt.Sprintf("%s/%s", name, version) - if len(extra) > 0 { - ua += fmt.Sprintf("/(%s)", strings.Join(extra, "; ")) - } - return func(r *Request) { - AddToUserAgent(r, ua) - } -} - -// MakeAddToUserAgentFreeFormHandler adds the input to the User-Agent request header. -// The input string will be concatenated with the current request's user agent string. -func MakeAddToUserAgentFreeFormHandler(s string) func(*Request) { - return func(r *Request) { - AddToUserAgent(r, s) - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/http_request.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/http_request.go deleted file mode 100644 index 3ce6989299ac..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/http_request.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "io" - "net/http" - "net/url" -) - -func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request { - req := new(http.Request) - *req = *r - req.URL = &url.URL{} - *req.URL = *r.URL - req.Body = body - - req.Header = http.Header{} - for k, v := range r.Header { - for _, vv := range v { - req.Header.Add(k, vv) - } - } - - return req -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/offset_reader.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/offset_reader.go deleted file mode 100644 index 417ffd15ead4..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/offset_reader.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "io" - "sync" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkio" -) - -// offsetReader is a thread-safe io.ReadCloser to prevent racing -// with retrying requests -type offsetReader struct { - buf io.ReadSeeker - lock sync.Mutex - closed bool -} - -func newOffsetReader(buf io.ReadSeeker, offset int64) (*offsetReader, error) { - reader := &offsetReader{} - _, err := buf.Seek(offset, sdkio.SeekStart) - if err != nil { - return nil, err - } - - reader.buf = buf - return reader, nil -} - -// Close will close the instance of the offset reader's access to -// the underlying io.ReadSeeker. -func (o *offsetReader) Close() error { - o.lock.Lock() - defer o.lock.Unlock() - o.closed = true - return nil -} - -// Read is a thread-safe read of the underlying io.ReadSeeker -func (o *offsetReader) Read(p []byte) (int, error) { - o.lock.Lock() - defer o.lock.Unlock() - - if o.closed { - return 0, io.EOF - } - - return o.buf.Read(p) -} - -// Seek is a thread-safe seeking operation. -func (o *offsetReader) Seek(offset int64, whence int) (int64, error) { - o.lock.Lock() - defer o.lock.Unlock() - - return o.buf.Seek(offset, whence) -} - -// CloseAndCopy will return a new offsetReader with a copy of the old buffer -// and close the old buffer. -func (o *offsetReader) CloseAndCopy(offset int64) (*offsetReader, error) { - if err := o.Close(); err != nil { - return nil, err - } - return newOffsetReader(o.buf, offset) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request.go deleted file mode 100644 index 2bbf8be18d82..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request.go +++ /dev/null @@ -1,756 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "reflect" - "strings" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkio" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -const ( - // ErrCodeSerialization is the serialization error code that is received - // during protocol unmarshaling. - ErrCodeSerialization = "SerializationError" - - // ErrCodeRead is an error that is returned during HTTP reads. - ErrCodeRead = "ReadError" - - // ErrCodeResponseTimeout is the connection timeout error that is received - // during volcenginebody reads. - ErrCodeResponseTimeout = "ResponseTimeout" - - // ErrCodeInvalidPresignExpire is returned when the expire time provided to - // presign is invalid - ErrCodeInvalidPresignExpire = "InvalidPresignExpireError" - - // CanceledErrorCode is the error code that will be returned by an - // API request that was canceled. Requests given a volcengine.Context may - // return this error when canceled. - CanceledErrorCode = "RequestCanceled" -) - -// A Request is the service request to be made. -type Request struct { - Config volcengine.Config - ClientInfo metadata.ClientInfo - Handlers Handlers - - Retryer - AttemptTime time.Time - Time time.Time - Operation *Operation - HTTPRequest *http.Request - HTTPResponse *http.Response - Body io.ReadSeeker - BodyStart int64 // offset from beginning of Body that the request volcenginebody starts - Params interface{} - Error error - Data interface{} - RequestID string - RetryCount int - Retryable *bool - RetryDelay time.Duration - NotHoist bool - SignedHeaderVals http.Header - LastSignedAt time.Time - DisableFollowRedirects bool - - // Additional API error codes that should be retried. IsErrorRetryable - // will consider these codes in addition to its built in cases. - RetryErrorCodes []string - - // Additional API error codes that should be retried with throttle backoff - // delay. IsErrorThrottle will consider these codes in addition to its - // built in cases. - ThrottleErrorCodes []string - - // A value greater than 0 instructs the request to be signed as Presigned URL - // You should not set this field directly. Instead use Request's - // Presign or PresignRequest methods. - ExpireTime time.Duration - - context volcengine.Context - - built bool - - // Need to persist an intermediate volcenginebody between the input Body and HTTP - // request volcenginebody because the HTTP Client's transport can maintain a reference - // to the HTTP request's volcenginebody after the client has returned. This value is - // safe to use concurrently and wrap the input Body for each HTTP request. - safeBody *offsetReader - Input interface{} - IsJsonBody bool - - holders []interface{} - - Metadata response.ResponseMetadata -} - -// An Operation is the service API operation to be made. -type Operation struct { - Name string - HTTPMethod string - HTTPPath string - *Paginator - - BeforePresignFn func(r *Request) error -} - -// New returns a new Request pointer for the service API -// operation and parameters. -// -// Params is any value of input parameters to be the request payload. -// Data is pointer value to an object which the request's response -// payload will be deserialized to. -func New(cfg volcengine.Config, clientInfo metadata.ClientInfo, handlers Handlers, - retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { - - method := operation.HTTPMethod - if method == "" { - method = "POST" - } - - httpReq, _ := http.NewRequest(method, "", nil) - - var err error - httpReq.URL, err = url.Parse(clientInfo.Endpoint) - if err != nil { - httpReq.URL = &url.URL{} - err = volcengineerr.New("InvalidEndpointURL", "invalid endpoint uri", err) - } - - SanitizeHostForHeader(httpReq) - - r := &Request{ - Config: cfg, - ClientInfo: clientInfo, - Handlers: handlers.Copy(), - Retryer: retryer, - Time: time.Now(), - ExpireTime: 0, - Operation: operation, - HTTPRequest: httpReq, - Body: nil, - Params: params, - Error: err, - Data: data, - } - r.SetBufferBody([]byte{}) - - return r -} - -// A Option is a functional option that can augment or modify a request when -// using a WithContext API operation method. -type Option func(*Request) - -// WithGetResponseHeader builds a request Option which will retrieve a single -// header value from the HTTP Response. If there are multiple values for the -// header key use WithGetResponseHeaders instead to access the http.Header -// map directly. The passed in val pointer must be non-nil. -// -// This Option can be used multiple times with a single API operation. -// -// var id2, versionID string -// svc.PutObjectWithContext(ctx, params, -// request.WithGetResponseHeader("x-top-id-2", &id2), -// request.WithGetResponseHeader("x-top-version-id", &versionID), -// ) -func WithGetResponseHeader(key string, val *string) Option { - return func(r *Request) { - r.Handlers.Complete.PushBack(func(req *Request) { - *val = req.HTTPResponse.Header.Get(key) - }) - } -} - -// WithGetResponseHeaders builds a request Option which will retrieve the -// headers from the HTTP response and assign them to the passed in headers -// variable. The passed in headers pointer must be non-nil. -// -// var headers http.Header -// svc.PutObjectWithContext(ctx, params, request.WithGetResponseHeaders(&headers)) -func WithGetResponseHeaders(headers *http.Header) Option { - return func(r *Request) { - r.Handlers.Complete.PushBack(func(req *Request) { - *headers = req.HTTPResponse.Header - }) - } -} - -// WithLogLevel is a request option that will set the request to use a specific -// log level when the request is made. -// -// svc.PutObjectWithContext(ctx, params, request.WithLogLevel(volcengine.LogDebugWithHTTPBody) -func WithLogLevel(l volcengine.LogLevelType) Option { - return func(r *Request) { - r.Config.LogLevel = volcengine.LogLevel(l) - } -} - -// ApplyOptions will apply each option to the request calling them in the order -// the were provided. -func (r *Request) ApplyOptions(opts ...Option) { - for _, opt := range opts { - opt(r) - } -} - -// Context will always returns a non-nil context. If Request does not have a -// context volcengine.BackgroundContext will be returned. -func (r *Request) Context() volcengine.Context { - if r.context != nil { - return r.context - } - return volcengine.BackgroundContext() -} - -// SetContext adds a Context to the current request that can be used to cancel -// a in-flight request. The Context value must not be nil, or this method will -// panic. -// -// Unlike http.Request.WithContext, SetContext does not return a copy of the -// Request. It is not safe to use use a single Request value for multiple -// requests. A new Request should be created for each API operation request. -func (r *Request) SetContext(ctx volcengine.Context) { - if ctx == nil { - panic("context cannot be nil") - } - setRequestContext(r, ctx) -} - -// NoBody is a http.NoBody reader instructing Go HTTP client to not include -// and volcenginebody in the HTTP request. -var NoBody = http.NoBody - -// ResetBody rewinds the request volcenginebody back to its starting position, and -// sets the HTTP Request volcenginebody reference. When the volcenginebody is read prior -// to being sent in the HTTP request it will need to be rewound. -// -// ResetBody will automatically be called by the SDK's build handler, but if -// the request is being used directly ResetBody must be called before the request -// is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically -// call ResetBody. -// -// Will also set the Go 1.8's http.Request.GetBody member to allow retrying -// PUT/POST redirects. -func (r *Request) ResetBody() { - body, err := r.getNextRequestBody() - if err != nil { - r.Error = volcengineerr.New(ErrCodeSerialization, - "failed to reset request volcenginebody", err) - return - } - - r.HTTPRequest.Body = body - r.HTTPRequest.GetBody = r.getNextRequestBody -} - -// WillRetry returns if the request's can be retried. -func (r *Request) WillRetry() bool { - if !volcengine.IsReaderSeekable(r.Body) && r.HTTPRequest.Body != NoBody { - return false - } - return r.Error != nil && volcengine.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries() -} - -func fmtAttemptCount(retryCount, maxRetries int) string { - return fmt.Sprintf("attempt %v/%v", retryCount, maxRetries) -} - -// ParamsFilled returns if the request's parameters have been populated -// and the parameters are valid. False is returned if no parameters are -// provided or invalid. -func (r *Request) ParamsFilled() bool { - return r.Params != nil && reflect.ValueOf(r.Params).Elem().IsValid() -} - -// DataFilled returns true if the request's data for response deserialization -// target has been set and is a valid. False is returned if data is not -// set, or is invalid. -func (r *Request) DataFilled() bool { - return r.Data != nil && reflect.ValueOf(r.Data).Elem().IsValid() -} - -// SetBufferBody will set the request's volcenginebody bytes that will be sent to -// the service API. -func (r *Request) SetBufferBody(buf []byte) { - r.SetReaderBody(bytes.NewReader(buf)) -} - -// SetStringBody sets the volcenginebody of the request to be backed by a string. -func (r *Request) SetStringBody(s string) { - r.SetReaderBody(strings.NewReader(s)) -} - -// SetReaderBody will set the request's volcenginebody reader. -func (r *Request) SetReaderBody(reader io.ReadSeeker) { - r.Body = reader - - if volcengine.IsReaderSeekable(reader) { - var err error - // Get the Bodies current offset so retries will start from the same - // initial position. - r.BodyStart, err = reader.Seek(0, sdkio.SeekCurrent) - if err != nil { - r.Error = volcengineerr.New(ErrCodeSerialization, - "failed to determine start of request volcenginebody", err) - return - } - } - r.ResetBody() -} - -// Presign returns the request's signed URL. Error will be returned -// if the signing fails. The expire parameter is only used for presigned -// S3 API requests. All other Volcengine services will use a fixed expiration -// time of 15 minutes. -// -// It is invalid to create a presigned URL with a expire duration 0 or less. An -// error is returned if expire duration is 0 or less. -func (r *Request) Presign(expire time.Duration) (string, error) { - r = r.copy() - - // Presign requires all headers be hoisted. There is no way to retrieve - // the signed headers not hoisted without this. Making the presigned URL - // useless. - r.NotHoist = false - - u, _, err := getPresignedURL(r, expire) - return u, err -} - -// PresignRequest behaves just like presign, with the addition of returning a -// set of headers that were signed. The expire parameter is only used for -// presigned S3 API requests. All other Volcengine services will use a fixed -// expiration time of 15 minutes. -// -// It is invalid to create a presigned URL with a expire duration 0 or less. An -// error is returned if expire duration is 0 or less. -// -// Returns the URL string for the API operation with signature in the volcenginequery string, -// and the HTTP headers that were included in the signature. These headers must -// be included in any HTTP request made with the presigned URL. -// -// To prevent hoisting any headers to the volcenginequery string set NotHoist to true on -// this Request value prior to calling PresignRequest. -func (r *Request) PresignRequest(expire time.Duration) (string, http.Header, error) { - r = r.copy() - return getPresignedURL(r, expire) -} - -// IsPresigned returns true if the request represents a presigned API url. -func (r *Request) IsPresigned() bool { - return r.ExpireTime != 0 -} - -func getPresignedURL(r *Request, expire time.Duration) (string, http.Header, error) { - if expire <= 0 { - return "", nil, volcengineerr.New( - ErrCodeInvalidPresignExpire, - "presigned URL requires an expire duration greater than 0", - nil, - ) - } - - r.ExpireTime = expire - - if r.Operation.BeforePresignFn != nil { - if err := r.Operation.BeforePresignFn(r); err != nil { - return "", nil, err - } - } - - if err := r.Sign(); err != nil { - return "", nil, err - } - - return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil -} - -const ( - notRetrying = "not retrying" -) - -func debugLogReqError(r *Request, stage, retryStr string, err error) { - if !r.Config.LogLevel.Matches(volcengine.LogDebugWithRequestErrors) { - return - } - - r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v", - stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err)) -} - -// Build will build the request's object so it can be signed and sent -// to the service. Build will also validate all the request's parameters. -// Any additional build Handlers set on this request will be run -// in the order they were set. -// -// The request will only be built once. Multiple calls to build will have -// no effect. -// -// If any Validate or Build errors occur the build will stop and the error -// which occurred will be returned. -func (r *Request) Build() error { - if !r.built { - r.Handlers.Validate.Run(r) - if r.Error != nil { - debugLogReqError(r, "Validate Request", notRetrying, r.Error) - return r.Error - } - r.Handlers.Build.Run(r) - if r.Error != nil { - debugLogReqError(r, "Build Request", notRetrying, r.Error) - return r.Error - } - r.built = true - } - - return r.Error -} - -// Sign will sign the request, returning error if errors are encountered. -// -// Sign will build the request prior to signing. All Sign Handlers will -// be executed in the order they were set. -func (r *Request) Sign() error { - err := r.Build() - if err != nil { - debugLogReqError(r, "Build Request", notRetrying, err) - return err - } - - r.Handlers.Sign.Run(r) - return r.Error -} - -func (r *Request) getNextRequestBody() (body io.ReadCloser, err error) { - if r.safeBody != nil { - _ = r.safeBody.Close() - } - - r.safeBody, err = newOffsetReader(r.Body, r.BodyStart) - if err != nil { - return nil, volcengineerr.New(ErrCodeSerialization, - "failed to get next request volcenginebody reader", err) - } - - // Go 1.8 tightened and clarified the rules code needs to use when building - // requests with the http package. Go 1.8 removed the automatic detection - // of if the Request.Body was empty, or actually had bytes in it. The SDK - // always sets the Request.Body even if it is empty and should not actually - // be sent. This is incorrect. - // - // Go 1.8 did add a http.NoBody value that the SDK can use to tell the http - // client that the request really should be sent without a volcenginebody. The - // Request.Body cannot be set to nil, which is preferable, because the - // field is exported and could introduce nil pointer dereferences for users - // of the SDK if they used that field. - // - // Related golang/go#18257 - l, err := volcengine.SeekerLen(r.Body) - if err != nil { - return nil, volcengineerr.New(ErrCodeSerialization, - "failed to compute request volcenginebody size", err) - } - - if l == 0 { - body = NoBody - } else if l > 0 { - body = r.safeBody - } else { - // Hack to prevent sending bodies for methods where the volcenginebody - // should be ignored by the server. Sending bodies on these - // methods without an associated ContentLength will cause the - // request to socket timeout because the server does not handle - // Transfer-Encoding: chunked bodies for these methods. - // - // This would only happen if a volcengine.ReaderSeekerCloser was used with - // a io.Reader that was not also an io.Seeker, or did not implement - // Len() method. - switch r.Operation.HTTPMethod { - case "GET", "HEAD", "DELETE": - body = NoBody - default: - body = r.safeBody - } - } - - return body, nil -} - -// GetBody will return an io.ReadSeeker of the Request's underlying -// input volcenginebody with a concurrency safe wrapper. -func (r *Request) GetBody() io.ReadSeeker { - return r.safeBody -} - -// Send will send the request, returning error if errors are encountered. -// -// Send will sign the request prior to sending. All Send Handlers will -// be executed in the order they were set. -// -// Canceling a request is non-deterministic. If a request has been canceled, -// then the transport will choose, randomly, one of the state channels during -// reads or getting the connection. -// -// readLoop() and getConn(req *Request, cm connectMethod) -// https://github.com/golang/go/blob/master/src/net/http/transport.go -// -// Send will not close the request.Request's volcenginebody. -func (r *Request) Send() error { - interceptorMapping := make(map[int]interface{}) - defer func() { - // Ensure a non-nil HTTPResponse parameter is set to ensure handlers - // checking for HTTPResponse values, don't fail. - if r.HTTPResponse == nil { - r.HTTPResponse = &http.Response{ - Header: http.Header{}, - Body: ioutil.NopCloser(&bytes.Buffer{}), - } - } - // Regardless of success or failure of the request trigger the Complete - // request handlers. - r.Handlers.Complete.Run(r) - for index, interceptor := range r.Config.Interceptors { - if interceptor.After != nil { - interceptor.After(r.MergeRequestInfo(), interceptorMapping[index]) - } - } - }() - - if err := r.Error; err != nil { - return err - } - - for { - r.Error = nil - r.AttemptTime = time.Now() - - if err := r.Sign(); err != nil { - debugLogReqError(r, "Sign Request", notRetrying, err) - return err - } - - for index, interceptor := range r.Config.Interceptors { - if interceptor.Before != nil { - interceptorMapping[index] = interceptor.Before(r.MergeRequestInfo()) - } else { - interceptorMapping[index] = nil - } - - } - - if err := r.sendRequest(); err == nil { - return nil - } - r.Handlers.Retry.Run(r) - r.Handlers.AfterRetry.Run(r) - - if r.Error != nil || !volcengine.BoolValue(r.Retryable) { - return r.Error - } - - if err := r.prepareRetry(); err != nil { - r.Error = err - return err - } - } -} - -func (r *Request) prepareRetry() error { - if r.Config.LogLevel.Matches(volcengine.LogDebugWithRequestRetries) { - r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d", - r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount)) - } - - // The previous http.Request will have a reference to the r.Body - // and the HTTP Client's Transport may still be reading from - // the request's volcenginebody even though the Client's Do returned. - r.HTTPRequest = copyHTTPRequest(r.HTTPRequest, nil) - r.ResetBody() - if err := r.Error; err != nil { - return volcengineerr.New(ErrCodeSerialization, - "failed to prepare volcenginebody for retry", err) - - } - - // Closing response volcenginebody to ensure that no response volcenginebody is leaked - // between retry attempts. - if r.HTTPResponse != nil && r.HTTPResponse.Body != nil { - r.HTTPResponse.Body.Close() - } - - return nil -} - -func (r *Request) sendRequest() (sendErr error) { - defer r.Handlers.CompleteAttempt.Run(r) - - r.Retryable = nil - r.Handlers.Send.Run(r) - if r.Error != nil { - debugLogReqError(r, "Send Request", - fmtAttemptCount(r.RetryCount, r.MaxRetries()), - r.Error) - return r.Error - } - - r.Handlers.UnmarshalMeta.Run(r) - r.Handlers.ValidateResponse.Run(r) - if r.Error != nil { - r.Handlers.UnmarshalError.Run(r) - debugLogReqError(r, "Validate Response", - fmtAttemptCount(r.RetryCount, r.MaxRetries()), - r.Error) - return r.Error - } - - r.Handlers.Unmarshal.Run(r) - if r.Error != nil { - debugLogReqError(r, "Unmarshal Response", - fmtAttemptCount(r.RetryCount, r.MaxRetries()), - r.Error) - return r.Error - } - - return nil -} - -// copy will copy a request which will allow for local manipulation of the -// request. -func (r *Request) copy() *Request { - req := &Request{} - *req = *r - req.Handlers = r.Handlers.Copy() - op := *r.Operation - req.Operation = &op - return req -} - -// AddToUserAgent adds the string to the end of the request's current user agent. -func AddToUserAgent(r *Request, s string) { - curUA := r.HTTPRequest.Header.Get("User-Agent") - if len(curUA) > 0 { - s = curUA + " " + s - } - r.HTTPRequest.Header.Set("User-Agent", s) -} - -// SanitizeHostForHeader removes default port from host and updates request.Host -func SanitizeHostForHeader(r *http.Request) { - host := getHost(r) - port := portOnly(host) - if port != "" && isDefaultPort(r.URL.Scheme, port) { - r.Host = stripPort(host) - } -} - -// Returns host from request -func getHost(r *http.Request) string { - if r.Host != "" { - return r.Host - } - - return r.URL.Host -} - -// Hostname returns u.Host, without any port number. -// -// If Host is an IPv6 literal with a port number, Hostname returns the -// IPv6 literal without the square brackets. IPv6 literals may include -// a zone identifier. -// -// Copied from the Go 1.8 standard library (net/url) -func stripPort(hostport string) string { - colon := strings.IndexByte(hostport, ':') - if colon == -1 { - return hostport - } - if i := strings.IndexByte(hostport, ']'); i != -1 { - return strings.TrimPrefix(hostport[:i], "[") - } - return hostport[:colon] -} - -// Port returns the port part of u.Host, without the leading colon. -// If u.Host doesn't contain a port, Port returns an empty string. -// -// Copied from the Go 1.8 standard library (net/url) -func portOnly(hostport string) string { - colon := strings.IndexByte(hostport, ':') - if colon == -1 { - return "" - } - if i := strings.Index(hostport, "]:"); i != -1 { - return hostport[i+len("]:"):] - } - if strings.Contains(hostport, "]") { - return "" - } - return hostport[colon+len(":"):] -} - -// Returns true if the specified URI is using the standard port -// (i.e. port 80 for HTTP URIs or 443 for HTTPS URIs) -func isDefaultPort(scheme, port string) bool { - if port == "" { - return true - } - - lowerCaseScheme := strings.ToLower(scheme) - if (lowerCaseScheme == "http" && port == "80") || (lowerCaseScheme == "https" && port == "443") { - return true - } - - return false -} - -func (r *Request) MergeRequestInfo() custom.RequestInfo { - return custom.RequestInfo{ - Context: r.context, - Request: r.HTTPRequest, - Response: r.HTTPResponse, - Name: r.Operation.Name, - Method: r.Operation.HTTPMethod, - ClientInfo: r.ClientInfo, - URI: r.HTTPRequest.RequestURI, - Header: r.HTTPRequest.Header, - URL: r.HTTPRequest.URL, - Input: r.Params, - Output: r.Data, - Metadata: r.Metadata, - Error: r.Error, - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request_context.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request_context.go deleted file mode 100644 index c65e46b4c0c5..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request_context.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - -// setContext updates the Request to use the passed in context for cancellation. -// Context will also be used for request retry delay. -// -// Creates shallow copy of the http.Request with the WithContext method. -func setRequestContext(r *Request, ctx volcengine.Context) { - r.context = ctx - r.HTTPRequest = r.HTTPRequest.WithContext(ctx) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request_pagination.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request_pagination.go deleted file mode 100644 index e240a6e3873e..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/request_pagination.go +++ /dev/null @@ -1,283 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "reflect" - "sync/atomic" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -// A Pagination provides paginating of SDK API operations which are paginatable. -// Generally you should not use this type directly, but use the "Pages" API -// operations method to automatically perform pagination for you. Such as, -// "S3.ListObjectsPages", and "S3.ListObjectsPagesWithContext" methods. -// -// Pagination differs from a Paginator type in that pagination is the type that -// does the pagination between API operations, and Paginator defines the -// configuration that will be used per page request. -// -// cont := true -// for p.Next() && cont { -// data := p.Page().(*s3.ListObjectsOutput) -// // process the page's data -// } -// return p.Err() -// -// See service client API operation Pages methods for examples how the SDK will -// use the Pagination type. -type Pagination struct { - // Function to return a Request value for each pagination request. - // Any configuration or handlers that need to be applied to the request - // prior to getting the next page should be done here before the request - // returned. - // - // NewRequest should always be built from the same API operations. It is - // undefined if different API operations are returned on subsequent calls. - NewRequest func() (*Request, error) - // EndPageOnSameToken, when enabled, will allow the paginator to stop on - // token that are the same as its previous tokens. - EndPageOnSameToken bool - - started bool - prevTokens []interface{} - nextTokens []interface{} - - err error - curPage interface{} -} - -// HasNextPage will return true if Pagination is able to determine that the API -// operation has additional pages. False will be returned if there are no more -// pages remaining. -// -// Will always return true if Next has not been called yet. -func (p *Pagination) HasNextPage() bool { - if !p.started { - return true - } - - hasNextPage := len(p.nextTokens) != 0 - if p.EndPageOnSameToken { - return hasNextPage && !volcengineutil.DeepEqual(p.nextTokens, p.prevTokens) - } - return hasNextPage -} - -// Err returns the error Pagination encountered when retrieving the next page. -func (p *Pagination) Err() error { - return p.err -} - -// Page returns the current page. Page should only be called after a successful -// call to Next. It is undefined what Page will return if Page is called after -// Next returns false. -func (p *Pagination) Page() interface{} { - return p.curPage -} - -// Next will attempt to retrieve the next page for the API operation. When a page -// is retrieved true will be returned. If the page cannot be retrieved, or there -// are no more pages false will be returned. -// -// Use the Page method to retrieve the current page data. The data will need -// to be cast to the API operation's output type. -// -// Use the Err method to determine if an error occurred if Page returns false. -func (p *Pagination) Next() bool { - if !p.HasNextPage() { - return false - } - - req, err := p.NewRequest() - if err != nil { - p.err = err - return false - } - - if p.started { - for i, intok := range req.Operation.InputTokens { - volcengineutil.SetValueAtPath(req.Params, intok, p.nextTokens[i]) - } - } - p.started = true - - err = req.Send() - if err != nil { - p.err = err - return false - } - - p.prevTokens = p.nextTokens - p.nextTokens = req.nextPageTokens() - p.curPage = req.Data - - return true -} - -// A Paginator is the configuration data that defines how an API operation -// should be paginated. This type is used by the API service models to define -// the generated pagination config for service APIs. -// -// The Pagination type is what provides iterating between pages of an API. It -// is only used to store the token metadata the SDK should use for performing -// pagination. -type Paginator struct { - InputTokens []string - OutputTokens []string - LimitToken string - TruncationToken string -} - -// nextPageTokens returns the tokens to use when asking for the next page of data. -func (r *Request) nextPageTokens() []interface{} { - if r.Operation.Paginator == nil { - return nil - } - if r.Operation.TruncationToken != "" { - tr, _ := volcengineutil.ValuesAtPath(r.Data, r.Operation.TruncationToken) - if len(tr) == 0 { - return nil - } - - switch v := tr[0].(type) { - case *bool: - if !volcengine.BoolValue(v) { - return nil - } - case bool: - if !v { - return nil - } - } - } - - tokens := []interface{}{} - tokenAdded := false - for _, outToken := range r.Operation.OutputTokens { - vs, _ := volcengineutil.ValuesAtPath(r.Data, outToken) - if len(vs) == 0 { - tokens = append(tokens, nil) - continue - } - v := vs[0] - - switch tv := v.(type) { - case *string: - if len(volcengineutil.StringValue(tv)) == 0 { - tokens = append(tokens, nil) - continue - } - case string: - if len(tv) == 0 { - tokens = append(tokens, nil) - continue - } - } - - tokenAdded = true - tokens = append(tokens, v) - } - if !tokenAdded { - return nil - } - - return tokens -} - -// Ensure a deprecated item is only logged once instead of each time its used. -func logDeprecatedf(logger volcengine.Logger, flag *int32, msg string) { - if logger == nil { - return - } - if atomic.CompareAndSwapInt32(flag, 0, 1) { - logger.Log(msg) - } -} - -var ( - logDeprecatedHasNextPage int32 - logDeprecatedNextPage int32 - logDeprecatedEachPage int32 -) - -// HasNextPage returns true if this request has more pages of data available. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) HasNextPage() bool { - logDeprecatedf(r.Config.Logger, &logDeprecatedHasNextPage, - "Request.HasNextPage deprecated. Use Pagination type for configurable pagination of API operations") - - return len(r.nextPageTokens()) > 0 -} - -// NextPage returns a new Request that can be executed to return the next -// page of result data. Call .Send() on this request to execute it. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) NextPage() *Request { - logDeprecatedf(r.Config.Logger, &logDeprecatedNextPage, - "Request.NextPage deprecated. Use Pagination type for configurable pagination of API operations") - - tokens := r.nextPageTokens() - if len(tokens) == 0 { - return nil - } - - data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface() - nr := New(r.Config, r.ClientInfo, r.Handlers, r.Retryer, r.Operation, volcengineutil.CopyOf(r.Params), data) - for i, intok := range nr.Operation.InputTokens { - volcengineutil.SetValueAtPath(nr.Params, intok, tokens[i]) - } - return nr -} - -// EachPage iterates over each page of a paginated request object. The fn -// parameter should be a function with the following sample signature: -// -// func(page *T, lastPage bool) bool { -// return true // return false to stop iterating -// } -// -// Where "T" is the structure type matching the output structure of the given -// operation. For example, a request object generated by -// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput -// as the structure "T". The lastPage value represents whether the page is -// the last page of data or not. The return value of this function should -// return true to keep iterating or false to stop. -// -// Deprecated Use Pagination type for configurable pagination of API operations -func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error { - logDeprecatedf(r.Config.Logger, &logDeprecatedEachPage, - "Request.EachPage deprecated. Use Pagination type for configurable pagination of API operations") - - for page := r; page != nil; page = page.NextPage() { - if err := page.Send(); err != nil { - return err - } - if getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage { - return page.Error - } - } - - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/retryer.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/retryer.go deleted file mode 100644 index feb46d6e5300..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/retryer.go +++ /dev/null @@ -1,295 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "net" - "net/url" - "strings" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// Retryer provides the interface drive the SDK's request retry behavior. The -// Retryer implementation is responsible for implementing exponential backoff, -// and determine if a request API error should be retried. -// -// client.DefaultRetryer is the SDK's default implementation of the Retryer. It -// uses the Request.IsErrorRetryable and Request.IsErrorThrottle methods to -// determine if the request is retried. -type Retryer interface { - // RetryRules return the retry delay that should be used by the SDK before - // making another request attempt for the failed request. - RetryRules(*Request) time.Duration - - // ShouldRetry returns if the failed request is retryable. - // - // Implementations may consider request attempt count when determining if a - // request is retryable, but the SDK will use MaxRetries to limit the - // number of attempts a request are made. - ShouldRetry(*Request) bool - - // MaxRetries is the number of times a request may be retried before - // failing. - MaxRetries() int -} - -// WithRetryer sets a Retryer value to the given Config returning the Config -// value for chaining. -func WithRetryer(cfg *volcengine.Config, retryer Retryer) *volcengine.Config { - cfg.Retryer = retryer - return cfg -} - -// retryableCodes is a collection of service response codes which are retry-able -// without any further action. -var retryableCodes = map[string]struct{}{ - "RequestError": {}, - "RequestTimeout": {}, - ErrCodeResponseTimeout: {}, - "RequestTimeoutException": {}, // Glacier's flavor of RequestTimeout -} - -var throttleCodes = map[string]struct{}{ - "ProvisionedThroughputExceededException": {}, - "Throttling": {}, - "ThrottlingException": {}, - "RequestLimitExceeded": {}, - "RequestThrottled": {}, - "RequestThrottledException": {}, - "TooManyRequestsException": {}, // Lambda functions - "PriorRequestNotComplete": {}, // Route53 - "TransactionInProgressException": {}, -} - -// credsExpiredCodes is a collection of error codes which signify the credentials -// need to be refreshed. Expired tokens require refreshing of credentials, and -// resigning before the request can be retried. -var credsExpiredCodes = map[string]struct{}{ - "ExpiredToken": {}, - "ExpiredTokenException": {}, - "RequestExpired": {}, // EC2 Only -} - -func isCodeThrottle(code string) bool { - _, ok := throttleCodes[code] - return ok -} - -func isCodeRetryable(code string) bool { - if _, ok := retryableCodes[code]; ok { - return true - } - - return isCodeExpiredCreds(code) -} - -func isCodeExpiredCreds(code string) bool { - _, ok := credsExpiredCodes[code] - return ok -} - -var validParentCodes = map[string]struct{}{ - ErrCodeSerialization: {}, - ErrCodeRead: {}, -} - -func isNestedErrorRetryable(parentErr volcengineerr.Error) bool { - if parentErr == nil { - return false - } - - if _, ok := validParentCodes[parentErr.Code()]; !ok { - return false - } - - err := parentErr.OrigErr() - if err == nil { - return false - } - - if aerr, ok := err.(volcengineerr.Error); ok { - return isCodeRetryable(aerr.Code()) - } - - if t, ok := err.(temporary); ok { - return t.Temporary() || isErrConnectionReset(err) - } - - return isErrConnectionReset(err) -} - -// IsErrorRetryable returns whether the error is retryable, based on its Code. -// Returns false if error is nil. -func IsErrorRetryable(err error) bool { - if err == nil { - return false - } - return shouldRetryError(err) -} - -type temporary interface { - Temporary() bool -} - -func shouldRetryError(origErr error) bool { - switch err := origErr.(type) { - case volcengineerr.Error: - if err.Code() == CanceledErrorCode { - return false - } - if isNestedErrorRetryable(err) { - return true - } - - origErr := err.OrigErr() - var shouldRetry bool - if origErr != nil { - shouldRetry := shouldRetryError(origErr) - if err.Code() == "RequestError" && !shouldRetry { - return false - } - } - if isCodeRetryable(err.Code()) { - return true - } - return shouldRetry - - case *url.Error: - if strings.Contains(err.Error(), "connection refused") { - // Refused connections should be retried as the service may not yet - // be running on the port. Go TCP dial considers refused - // connections as not temporary. - return true - } - // *url.Error only implements Temporary after golang 1.6 but since - // url.Error only wraps the error: - return shouldRetryError(err.Err) - - case temporary: - if netErr, ok := err.(*net.OpError); ok && netErr.Op == "dial" { - return true - } - // If the error is temporary, we want to allow continuation of the - // retry process - return err.Temporary() || isErrConnectionReset(origErr) - - case nil: - // `volcengineerr.Error.OrigErr()` can be nil, meaning there was an error but - // because we don't know the cause, it is marked as retryable. See - // TestRequest4xxUnretryable for an example. - return true - - default: - switch err.Error() { - case "net/http: request canceled", - "net/http: request canceled while waiting for connection": - // known 1.5 error case when an http request is cancelled - return false - } - // here we don't know the error; so we allow a retry. - return true - } -} - -// IsErrorThrottle returns whether the error is to be throttled based on its code. -// Returns false if error is nil. -func IsErrorThrottle(err error) bool { - if aerr, ok := err.(volcengineerr.Error); ok && aerr != nil { - return isCodeThrottle(aerr.Code()) - } - return false -} - -// IsErrorExpiredCreds returns whether the error code is a credential expiry -// error. Returns false if error is nil. -func IsErrorExpiredCreds(err error) bool { - if aerr, ok := err.(volcengineerr.Error); ok && aerr != nil { - return isCodeExpiredCreds(aerr.Code()) - } - return false -} - -// IsErrorRetryable returns whether the error is retryable, based on its Code. -// Returns false if the request has no Error set. -// -// Alias for the utility function IsErrorRetryable -func (r *Request) IsErrorRetryable() bool { - if isErrCode(r.Error, r.RetryErrorCodes) { - return true - } - - // HTTP response status code 501 should not be retried. - // 501 represents Not Implemented which means the request method is not - // supported by the server and cannot be handled. - if r.HTTPResponse != nil { - // HTTP response status code 500 represents internal server error and - // should be retried without any throttle. - if r.HTTPResponse.StatusCode == 500 { - return true - } - } - return IsErrorRetryable(r.Error) -} - -// IsErrorThrottle returns whether the error is to be throttled based on its -// code. Returns false if the request has no Error set. -// -// Alias for the utility function IsErrorThrottle -func (r *Request) IsErrorThrottle() bool { - if isErrCode(r.Error, r.ThrottleErrorCodes) { - return true - } - - if r.HTTPResponse != nil { - switch r.HTTPResponse.StatusCode { - case - 429, // error caused due to too many requests - 502, // Bad Gateway error should be throttled - 503, // caused when service is unavailable - 504: // error occurred due to gateway timeout - return true - } - } - - return IsErrorThrottle(r.Error) -} - -func isErrCode(err error, codes []string) bool { - if aerr, ok := err.(volcengineerr.Error); ok && aerr != nil { - for _, code := range codes { - if code == aerr.Code() { - return true - } - } - } - - return false -} - -// IsErrorExpired returns whether the error code is a credential expiry error. -// Returns false if the request has no Error set. -// -// Alias for the utility function IsErrorExpiredCreds -func (r *Request) IsErrorExpired() bool { - return IsErrorExpiredCreds(r.Error) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/timeout_read_closer.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/timeout_read_closer.go deleted file mode 100644 index 43026253a614..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/timeout_read_closer.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "io" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -var timeoutErr = volcengineerr.New( - ErrCodeResponseTimeout, - "read on volcenginebody has reached the timeout limit", - nil, -) - -type readResult struct { - n int - err error -} - -// timeoutReadCloser will handle volcenginebody reads that take too long. -// We will return a ErrReadTimeout error if a timeout occurs. -type timeoutReadCloser struct { - reader io.ReadCloser - duration time.Duration -} - -// Read will spin off a goroutine to call the reader's Read method. We will -// select on the timer's channel or the read's channel. Whoever completes first -// will be returned. -func (r *timeoutReadCloser) Read(b []byte) (int, error) { - timer := time.NewTimer(r.duration) - c := make(chan readResult, 1) - - go func() { - n, err := r.reader.Read(b) - timer.Stop() - c <- readResult{n: n, err: err} - }() - - select { - case data := <-c: - return data.n, data.err - case <-timer.C: - return 0, timeoutErr - } -} - -func (r *timeoutReadCloser) Close() error { - return r.reader.Close() -} - -const ( - // HandlerResponseTimeout is what we use to signify the name of the - // response timeout handler. - HandlerResponseTimeout = "ResponseTimeoutHandler" -) - -// adaptToResponseTimeoutError is a handler that will replace any top level error -// to a ErrCodeResponseTimeout, if its child is that. -func adaptToResponseTimeoutError(req *Request) { - if err, ok := req.Error.(volcengineerr.Error); ok { - aerr, ok := err.OrigErr().(volcengineerr.Error) - if ok && aerr.Code() == ErrCodeResponseTimeout { - req.Error = aerr - } - } -} - -// WithResponseReadTimeout is a request option that will wrap the volcenginebody in a timeout read closer. -// This will allow for per read timeouts. If a timeout occurred, we will return the -// ErrCodeResponseTimeout. -// -// svc.PutObjectWithContext(ctx, params, request.WithTimeoutReadCloser(30 * time.Second) -func WithResponseReadTimeout(duration time.Duration) Option { - return func(r *Request) { - - var timeoutHandler = NamedHandler{ - HandlerResponseTimeout, - func(req *Request) { - req.HTTPResponse.Body = &timeoutReadCloser{ - reader: req.HTTPResponse.Body, - duration: duration, - } - }} - - // remove the handler so we are not stomping over any new durations. - r.Handlers.Send.RemoveByName(HandlerResponseTimeout) - r.Handlers.Send.PushBackNamed(timeoutHandler) - - r.Handlers.Unmarshal.PushBack(adaptToResponseTimeoutError) - r.Handlers.UnmarshalError.PushBack(adaptToResponseTimeoutError) - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/validation.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/validation.go deleted file mode 100644 index 22b470301570..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/validation.go +++ /dev/null @@ -1,333 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -const ( - // InvalidParameterErrCode is the error code for invalid parameters errors - InvalidParameterErrCode = "InvalidParameter" - // ParamRequiredErrCode is the error code for required parameter errors - ParamRequiredErrCode = "ParamRequiredError" - // ParamMinValueErrCode is the error code for fields with too low of a - // number value. - ParamMinValueErrCode = "ParamMinValueError" - // ParamMaxValueErrCode is the error code for fields with too high of a - // number value. - ParamMaxValueErrCode = "ParamMaxValueError" - // ParamMinLenErrCode is the error code for fields without enough elements. - ParamMinLenErrCode = "ParamMinLenError" - // ParamMaxLenErrCode is the error code for value being too long. - ParamMaxLenErrCode = "ParamMaxLenError" - - // ParamFormatErrCode is the error code for a field with invalid - // format or characters. - ParamFormatErrCode = "ParamFormatInvalidError" -) - -// Validator provides a way for types to perform validation logic on their -// input values that external code can use to determine if a type's values -// are valid. -type Validator interface { - Validate() error -} - -// An ErrInvalidParams provides wrapping of invalid parameter errors found when -// validating API operation input parameters. -type ErrInvalidParams struct { - // Context is the base context of the invalid parameter group. - Context string - errs []ErrInvalidParam -} - -// Add adds a new invalid parameter error to the collection of invalid -// parameters. The context of the invalid parameter will be updated to reflect -// this collection. -func (e *ErrInvalidParams) Add(err ErrInvalidParam) { - err.SetContext(e.Context) - e.errs = append(e.errs, err) -} - -// AddNested adds the invalid parameter errors from another ErrInvalidParams -// value into this collection. The nested errors will have their nested context -// updated and base context to reflect the merging. -// -// Use for nested validations errors. -func (e *ErrInvalidParams) AddNested(nestedCtx string, nested ErrInvalidParams) { - for _, err := range nested.errs { - err.SetContext(e.Context) - err.AddNestedContext(nestedCtx) - e.errs = append(e.errs, err) - } -} - -// Len returns the number of invalid parameter errors -func (e ErrInvalidParams) Len() int { - return len(e.errs) -} - -// Code returns the code of the error -func (e ErrInvalidParams) Code() string { - return InvalidParameterErrCode -} - -// Message returns the message of the error -func (e ErrInvalidParams) Message() string { - return fmt.Sprintf("%d validation error(s) found.", len(e.errs)) -} - -// Error returns the string formatted form of the invalid parameters. -func (e ErrInvalidParams) Error() string { - w := &bytes.Buffer{} - fmt.Fprintf(w, "%s: %s\n", e.Code(), e.Message()) - - for _, err := range e.errs { - fmt.Fprintf(w, "- %s\n", err.Message()) - } - - return w.String() -} - -// OrigErr returns the invalid parameters as a volcengineerr.BatchedErrors value -func (e ErrInvalidParams) OrigErr() error { - return volcengineerr.NewBatchError( - InvalidParameterErrCode, e.Message(), e.OrigErrs()) -} - -// OrigErrs returns a slice of the invalid parameters -func (e ErrInvalidParams) OrigErrs() []error { - errs := make([]error, len(e.errs)) - for i := 0; i < len(errs); i++ { - errs[i] = e.errs[i] - } - - return errs -} - -// An ErrInvalidParam represents an invalid parameter error type. -type ErrInvalidParam interface { - volcengineerr.Error - - // Field name the error occurred on. - Field() string - - // SetContext updates the context of the error. - SetContext(string) - - // AddNestedContext updates the error's context to include a nested level. - AddNestedContext(string) -} - -type errInvalidParam struct { - context string - nestedContext string - field string - code string - msg string -} - -// Code returns the error code for the type of invalid parameter. -func (e *errInvalidParam) Code() string { - return e.code -} - -// Message returns the reason the parameter was invalid, and its context. -func (e *errInvalidParam) Message() string { - return fmt.Sprintf("%s, %s.", e.msg, e.Field()) -} - -// Error returns the string version of the invalid parameter error. -func (e *errInvalidParam) Error() string { - return fmt.Sprintf("%s: %s", e.code, e.Message()) -} - -// OrigErr returns nil, Implemented for volcengineerr.Error interface. -func (e *errInvalidParam) OrigErr() error { - return nil -} - -// Field Returns the field and context the error occurred. -func (e *errInvalidParam) Field() string { - field := e.context - if len(field) > 0 { - field += "." - } - if len(e.nestedContext) > 0 { - field += fmt.Sprintf("%s.", e.nestedContext) - } - field += e.field - - return field -} - -// SetContext updates the base context of the error. -func (e *errInvalidParam) SetContext(ctx string) { - e.context = ctx -} - -// AddNestedContext prepends a context to the field's path. -func (e *errInvalidParam) AddNestedContext(ctx string) { - if len(e.nestedContext) == 0 { - e.nestedContext = ctx - } else { - e.nestedContext = fmt.Sprintf("%s.%s", ctx, e.nestedContext) - } - -} - -// An ErrParamRequired represents an required parameter error. -type ErrParamRequired struct { - errInvalidParam -} - -// NewErrParamRequired creates a new required parameter error. -func NewErrParamRequired(field string) *ErrParamRequired { - return &ErrParamRequired{ - errInvalidParam{ - code: ParamRequiredErrCode, - field: field, - msg: fmt.Sprintf("missing required field"), - }, - } -} - -// An ErrParamMaxValue represents a maximum value parameter error. -type ErrParamMaxValue struct { - errInvalidParam - max float64 -} - -// NewErrParamMaxValue creates a new maximum value parameter error. -func NewErrParamMaxValue(field string, max float64) *ErrParamMaxValue { - return &ErrParamMaxValue{ - errInvalidParam: errInvalidParam{ - code: ParamMinValueErrCode, - field: field, - msg: fmt.Sprintf("maximum field value of %v", max), - }, - max: max, - } -} - -// MaxValue returns the field's require maximum value. -// -// float64 is returned for both int and float max values. -func (e *ErrParamMaxValue) MaxValue() float64 { - return e.max -} - -// An ErrParamMinValue represents a minimum value parameter error. -type ErrParamMinValue struct { - errInvalidParam - min float64 -} - -// NewErrParamMinValue creates a new minimum value parameter error. -func NewErrParamMinValue(field string, min float64) *ErrParamMinValue { - return &ErrParamMinValue{ - errInvalidParam: errInvalidParam{ - code: ParamMinValueErrCode, - field: field, - msg: fmt.Sprintf("minimum field value of %v", min), - }, - min: min, - } -} - -// MinValue returns the field's require minimum value. -// -// float64 is returned for both int and float min values. -func (e *ErrParamMinValue) MinValue() float64 { - return e.min -} - -// An ErrParamMinLen represents a minimum length parameter error. -type ErrParamMinLen struct { - errInvalidParam - min int -} - -// NewErrParamMinLen creates a new minimum length parameter error. -func NewErrParamMinLen(field string, min int) *ErrParamMinLen { - return &ErrParamMinLen{ - errInvalidParam: errInvalidParam{ - code: ParamMinLenErrCode, - field: field, - msg: fmt.Sprintf("minimum field size of %v", min), - }, - min: min, - } -} - -// MinLen returns the field's required minimum length. -func (e *ErrParamMinLen) MinLen() int { - return e.min -} - -// An ErrParamMaxLen represents a maximum length parameter error. -type ErrParamMaxLen struct { - errInvalidParam - max int -} - -// NewErrParamMaxLen creates a new maximum length parameter error. -func NewErrParamMaxLen(field string, max int, value string) *ErrParamMaxLen { - return &ErrParamMaxLen{ - errInvalidParam: errInvalidParam{ - code: ParamMaxLenErrCode, - field: field, - msg: fmt.Sprintf("maximum size of %v, %v", max, value), - }, - max: max, - } -} - -// MaxLen returns the field's required minimum length. -func (e *ErrParamMaxLen) MaxLen() int { - return e.max -} - -// An ErrParamFormat represents a invalid format parameter error. -type ErrParamFormat struct { - errInvalidParam - format string -} - -// NewErrParamFormat creates a new invalid format parameter error. -func NewErrParamFormat(field string, format, value string) *ErrParamFormat { - return &ErrParamFormat{ - errInvalidParam: errInvalidParam{ - code: ParamFormatErrCode, - field: field, - msg: fmt.Sprintf("format %v, %v", format, value), - }, - format: format, - } -} - -// Format returns the field's required format. -func (e *ErrParamFormat) Format() string { - return e.format -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/waiter.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/waiter.go deleted file mode 100644 index b2648791ef63..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request/waiter.go +++ /dev/null @@ -1,315 +0,0 @@ -/* -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 request - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// WaiterResourceNotReadyErrorCode is the error code returned by a waiter when -// the waiter's max attempts have been exhausted. -const WaiterResourceNotReadyErrorCode = "ResourceNotReady" - -// A WaiterOption is a function that will update the Waiter value's fields to -// configure the waiter. -type WaiterOption func(*Waiter) - -// WithWaiterMaxAttempts returns the maximum number of times the waiter should -// attempt to check the resource for the target state. -func WithWaiterMaxAttempts(max int) WaiterOption { - return func(w *Waiter) { - w.MaxAttempts = max - } -} - -// WaiterDelay will return a delay the waiter should pause between attempts to -// check the resource state. The passed in attempt is the number of times the -// Waiter has checked the resource state. -// -// Attempt is the number of attempts the Waiter has made checking the resource -// state. -type WaiterDelay func(attempt int) time.Duration - -// ConstantWaiterDelay returns a WaiterDelay that will always return a constant -// delay the waiter should use between attempts. It ignores the number of -// attempts made. -func ConstantWaiterDelay(delay time.Duration) WaiterDelay { - return func(attempt int) time.Duration { - return delay - } -} - -// WithWaiterDelay will set the Waiter to use the WaiterDelay passed in. -func WithWaiterDelay(delayer WaiterDelay) WaiterOption { - return func(w *Waiter) { - w.Delay = delayer - } -} - -// WithWaiterLogger returns a waiter option to set the logger a waiter -// should use to log warnings and errors to. -func WithWaiterLogger(logger volcengine.Logger) WaiterOption { - return func(w *Waiter) { - w.Logger = logger - } -} - -// WithWaiterRequestOptions returns a waiter option setting the request -// options for each request the waiter makes. Appends to waiter's request -// options already set. -func WithWaiterRequestOptions(opts ...Option) WaiterOption { - return func(w *Waiter) { - w.RequestOptions = append(w.RequestOptions, opts...) - } -} - -// A Waiter provides the functionality to perform a blocking call which will -// wait for a resource state to be satisfied by a service. -// -// This type should not be used directly. The API operations provided in the -// service packages prefixed with "WaitUntil" should be used instead. -type Waiter struct { - Name string - Acceptors []WaiterAcceptor - Logger volcengine.Logger - - MaxAttempts int - Delay WaiterDelay - - RequestOptions []Option - NewRequest func([]Option) (*Request, error) - SleepWithContext func(volcengine.Context, time.Duration) error -} - -// ApplyOptions updates the waiter with the list of waiter options provided. -func (w *Waiter) ApplyOptions(opts ...WaiterOption) { - for _, fn := range opts { - fn(w) - } -} - -// WaiterState are states the waiter uses based on WaiterAcceptor definitions -// to identify if the resource state the waiter is waiting on has occurred. -type WaiterState int - -// String returns the string representation of the waiter state. -func (s WaiterState) String() string { - switch s { - case SuccessWaiterState: - return "success" - case FailureWaiterState: - return "failure" - case RetryWaiterState: - return "retry" - default: - return "unknown waiter state" - } -} - -// States the waiter acceptors will use to identify target resource states. -const ( - SuccessWaiterState WaiterState = iota // waiter successful - FailureWaiterState // waiter failed - RetryWaiterState // waiter needs to be retried -) - -// WaiterMatchMode is the mode that the waiter will use to match the WaiterAcceptor -// definition's Expected attribute. -type WaiterMatchMode int - -// Modes the waiter will use when inspecting API response to identify target -// resource states. -const ( - PathAllWaiterMatch WaiterMatchMode = iota // match on all paths - PathWaiterMatch // match on specific path - PathAnyWaiterMatch // match on any path - PathListWaiterMatch // match on list of paths - StatusWaiterMatch // match on status code - ErrorWaiterMatch // match on error -) - -// String returns the string representation of the waiter match mode. -func (m WaiterMatchMode) String() string { - switch m { - case PathAllWaiterMatch: - return "pathAll" - case PathWaiterMatch: - return "path" - case PathAnyWaiterMatch: - return "pathAny" - case PathListWaiterMatch: - return "pathList" - case StatusWaiterMatch: - return "status" - case ErrorWaiterMatch: - return "error" - default: - return "unknown waiter match mode" - } -} - -// WaitWithContext will make requests for the API operation using NewRequest to -// build API requests. The request's response will be compared against the -// Waiter's Acceptors to determine the successful state of the resource the -// waiter is inspecting. -// -// The passed in context must not be nil. If it is nil a panic will occur. The -// Context will be used to cancel the waiter's pending requests and retry delays. -// Use volcengine.BackgroundContext if no context is available. -// -// The waiter will continue until the target state defined by the Acceptors, -// or the max attempts expires. -// -// Will return the WaiterResourceNotReadyErrorCode error code if the waiter's -// retryer ShouldRetry returns false. This normally will happen when the max -// wait attempts expires. -func (w Waiter) WaitWithContext(ctx volcengine.Context) error { - - for attempt := 1; ; attempt++ { - req, err := w.NewRequest(w.RequestOptions) - if err != nil { - waiterLogf(w.Logger, "unable to create request %v", err) - return err - } - req.Handlers.Build.PushBack(MakeAddToUserAgentFreeFormHandler("Waiter")) - err = req.Send() - - // See if any of the acceptors match the request's response, or error - for _, a := range w.Acceptors { - if matched, matchErr := a.match(w.Name, w.Logger, req, err); matched { - return matchErr - } - } - - // The Waiter should only check the resource state MaxAttempts times - // This is here instead of in the for loop above to prevent delaying - // unnecessary when the waiter will not retry. - if attempt == w.MaxAttempts { - break - } - - // Delay to wait before inspecting the resource again - delay := w.Delay(attempt) - if sleepFn := req.Config.SleepDelay; sleepFn != nil { - // Support SleepDelay for backwards compatibility and testing - sleepFn(delay) - } else { - sleepCtxFn := w.SleepWithContext - if sleepCtxFn == nil { - sleepCtxFn = volcengine.SleepWithContext - } - - if err := sleepCtxFn(ctx, delay); err != nil { - return volcengineerr.New(CanceledErrorCode, "waiter context canceled", err) - } - } - } - - return volcengineerr.New(WaiterResourceNotReadyErrorCode, "exceeded wait attempts", nil) -} - -// A WaiterAcceptor provides the information needed to wait for an API operation -// to complete. -type WaiterAcceptor struct { - State WaiterState - Matcher WaiterMatchMode - Argument string - Expected interface{} -} - -// match returns if the acceptor found a match with the passed in request -// or error. True is returned if the acceptor made a match, error is returned -// if there was an error attempting to perform the match. -func (a *WaiterAcceptor) match(name string, l volcengine.Logger, req *Request, err error) (bool, error) { - result := false - var vals []interface{} - - switch a.Matcher { - case PathAllWaiterMatch, PathWaiterMatch: - // Require all matches to be equal for result to match - vals, _ = volcengineutil.ValuesAtPath(req.Data, a.Argument) - if len(vals) == 0 { - break - } - result = true - for _, val := range vals { - if !volcengineutil.DeepEqual(val, a.Expected) { - result = false - break - } - } - case PathAnyWaiterMatch: - // Only a single match needs to equal for the result to match - vals, _ = volcengineutil.ValuesAtPath(req.Data, a.Argument) - for _, val := range vals { - if volcengineutil.DeepEqual(val, a.Expected) { - result = true - break - } - } - case PathListWaiterMatch: - // ignored matcher - case StatusWaiterMatch: - s := a.Expected.(int) - result = s == req.HTTPResponse.StatusCode - case ErrorWaiterMatch: - if aerr, ok := err.(volcengineerr.Error); ok { - result = aerr.Code() == a.Expected.(string) - } - default: - waiterLogf(l, "WARNING: Waiter %s encountered unexpected matcher: %s", - name, a.Matcher) - } - - if !result { - // If there was no matching result found there is nothing more to do - // for this response, retry the request. - return false, nil - } - - switch a.State { - case SuccessWaiterState: - // waiter completed - return true, nil - case FailureWaiterState: - // Waiter failure state triggered - return true, volcengineerr.New(WaiterResourceNotReadyErrorCode, - "failed waiting for successful resource state", err) - case RetryWaiterState: - // clear the error and retry the operation - return false, nil - default: - waiterLogf(l, "WARNING: Waiter %s encountered unexpected state: %s", - name, a.State) - return false, nil - } -} - -func waiterLogf(logger volcengine.Logger, msg string, args ...interface{}) { - if logger != nil { - logger.Log(fmt.Sprintf(msg, args...)) - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response/volcengine_response.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response/volcengine_response.go deleted file mode 100644 index d65f8f6efd65..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response/volcengine_response.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 response - -type VolcengineResponse struct { - ResponseMetadata *ResponseMetadata - Result interface{} -} - -type ResponseMetadata struct { - RequestId string - Action string - Version string - Service string - Region string - HTTPCode int - Error *Error -} - -type Error struct { - CodeN int - Code string - Message string -} - -type VolcengineSimpleError struct { - HttpCode int `json:"HTTPCode"` - ErrorCode string `json:"errorcode"` - Message string `json:"message"` -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/credentials.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/credentials.go deleted file mode 100644 index 58c6ef74cfc9..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/credentials.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -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 session - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials/processcreds" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -func resolveCredentials(cfg *volcengine.Config, - envCfg envConfig, sharedCfg sharedConfig, - handlers request.Handlers, - sessOpts Options, -) (*credentials.Credentials, error) { - - switch { - case len(sessOpts.Profile) != 0: - // User explicitly provided an Profile in the session's configuration - // so load that profile from shared config first. - // Github(volcengine/volcengine-go-sdk#2727) - return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) - - case envCfg.Creds.HasKeys(): - // Environment credentials - return credentials.NewStaticCredentialsFromCreds(envCfg.Creds), nil - - default: - // Fallback to the "default" credential resolution chain. - return resolveCredsFromProfile(cfg, envCfg, sharedCfg, handlers, sessOpts) - } -} - -func resolveCredsFromProfile(cfg *volcengine.Config, - envCfg envConfig, sharedCfg sharedConfig, - handlers request.Handlers, - sessOpts Options, -) (creds *credentials.Credentials, err error) { - - switch { - case sharedCfg.SourceProfile != nil: - // Assume IAM role with credentials source from a different profile. - creds, err = resolveCredsFromProfile(cfg, envCfg, - *sharedCfg.SourceProfile, handlers, sessOpts, - ) - - case sharedCfg.Creds.HasKeys(): - // Static Credentials from Shared Config/Credentials file. - creds = credentials.NewStaticCredentialsFromCreds( - sharedCfg.Creds, - ) - - case len(sharedCfg.CredentialProcess) != 0: - // Get credentials from CredentialProcess - creds = processcreds.NewCredentials(sharedCfg.CredentialProcess) - - case len(sharedCfg.CredentialSource) != 0: - creds, err = resolveCredsFromSource(cfg, envCfg, - sharedCfg, handlers, sessOpts, - ) - - default: - // Fallback to default credentials provider, include mock errors for - // the credential chain so user can identify why credentials failed to - // be retrieved. - creds = credentials.NewCredentials(&credentials.ChainProvider{ - VerboseErrors: volcengine.BoolValue(cfg.CredentialsChainVerboseErrors), - Providers: []credentials.Provider{ - &credProviderError{ - Err: volcengineerr.New("EnvAccessKeyNotFound", - "failed to find credentials in the environment.", nil), - }, - &credProviderError{ - Err: volcengineerr.New("SharedCredsLoad", - fmt.Sprintf("failed to load profile, %s.", envCfg.Profile), nil), - }, - }, - }) - } - if err != nil { - return nil, err - } - - return creds, nil -} - -// valid credential source values -const ( - credSourceEc2Metadata = "Ec2InstanceMetadata" - credSourceEnvironment = "Environment" - credSourceECSContainer = "EcsContainer" -) - -func resolveCredsFromSource(cfg *volcengine.Config, - envCfg envConfig, sharedCfg sharedConfig, - handlers request.Handlers, - sessOpts Options, -) (creds *credentials.Credentials, err error) { - - switch sharedCfg.CredentialSource { - - case credSourceEnvironment: - creds = credentials.NewStaticCredentialsFromCreds(envCfg.Creds) - - default: - return nil, ErrSharedConfigInvalidCredSource - } - - return creds, nil -} - -type credProviderError struct { - Err error -} - -func (c credProviderError) Retrieve() (credentials.Value, error) { - return credentials.Value{}, c.Err -} -func (c credProviderError) IsExpired() bool { - return true -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/env_config.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/env_config.go deleted file mode 100644 index d1b667dc0e69..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/env_config.go +++ /dev/null @@ -1,358 +0,0 @@ -/* -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 session - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "os" - "strconv" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/defaults" -) - -// EnvProviderName provides a name of the provider when config is loaded from environment. -const EnvProviderName = "EnvConfigCredentials" - -// envConfig is a collection of environment values the SDK will read -// setup config from. All environment values are optional. But some values -// such as credentials require multiple values to be complete or the values -// will be ignored. -type envConfig struct { - // Environment configuration values. If set both Access Key ID and Secret Access - // Key must be provided. Session Token and optionally also be provided, but is - // not required. - // - // # Access Key ID - // VOLCSTACK_ACCESS_KEY_ID=AKID - // VOLCSTACK_ACCESS_KEY=AKID # only read if VOLCSTACK_ACCESS_KEY_ID is not set. - // - // # Secret Access Key - // VOLCSTACK_SECRET_ACCESS_KEY=SECRET - // VOLCSTACK_SECRET_KEY=SECRET=SECRET # only read if VOLCSTACK_SECRET_ACCESS_KEY is not set. - // - // # Session Token - // VOLCSTACK_SESSION_TOKEN=TOKEN - Creds credentials.Value - - // Region value will instruct the SDK where to make service API requests to. If is - // not provided in the environment the region must be provided before a service - // client request is made. - // - // VOLCSTACK_REGION=us-east-1 - // - // # VOLCSTACK_DEFAULT_REGION is only read if VOLCSTACK_SDK_LOAD_CONFIG is also set, - // # and VOLCSTACK_REGION is not also set. - // VOLCSTACK_DEFAULT_REGION=us-east-1 - Region string - - // Profile name the SDK should load use when loading shared configuration from the - // shared configuration files. If not provided "default" will be used as the - // profile name. - // - // VOLCSTACK_PROFILE=my_profile - // - // # VOLCSTACK_DEFAULT_PROFILE is only read if VOLCSTACK_SDK_LOAD_CONFIG is also set, - // # and VOLCSTACK_PROFILE is not also set. - // VOLCSTACK_DEFAULT_PROFILE=my_profile - Profile string - - // SDK load config instructs the SDK to load the shared config in addition to - // shared credentials. This also expands the configuration loaded from the shared - // credentials to have parity with the shared config file. This also enables - // Region and Profile support for the VOLCSTACK_DEFAULT_REGION and VOLCSTACK_DEFAULT_PROFILE - // env values as well. - // - // VOLCSTACK_SDK_LOAD_CONFIG=1 - EnableSharedConfig bool - - // Shared credentials file path can be set to instruct the SDK to use an alternate - // file for the shared credentials. If not set the file will be loaded from - // $HOME/.volcengine/credentials on Linux/Unix based systems, and - // %USERPROFILE%\.volcengine\credentials on Windows. - // - // VOLCSTACK_SHARED_CREDENTIALS_FILE=$HOME/my_shared_credentials - SharedCredentialsFile string - - // Shared config file path can be set to instruct the SDK to use an alternate - // file for the shared config. If not set the file will be loaded from - // $HOME/.volcengine/config on Linux/Unix based systems, and - // %USERPROFILE%\.volcengine\config on Windows. - // - // VOLCSTACK_CONFIG_FILE=$HOME/my_shared_config - SharedConfigFile string - - // Sets the path to a custom Credentials Authority (CA) Bundle PEM file - // that the SDK will use instead of the system's root CA bundle. - // Only use this if you want to configure the SDK to use a custom set - // of CAs. - // - // Enabling this option will attempt to merge the Transport - // into the SDK's HTTP client. If the client's Transport is - // not a http.Transport an error will be returned. If the - // Transport's TLS config is set this option will cause the - // SDK to overwrite the Transport's TLS config's RootCAs value. - // - // Setting a custom HTTPClient in the volcengine.Config options will override this setting. - // To use this option and custom HTTP client, the HTTP client needs to be provided - // when creating the session. Not the service client. - // - // VOLCSTACK_CA_BUNDLE=$HOME/my_custom_ca_bundle - CustomCABundle string - - csmEnabled string - CSMEnabled *bool - CSMPort string - CSMHost string - CSMClientID string - - // Enables endpoint discovery via environment variables. - // - // VOLCSTACK_ENABLE_ENDPOINT_DISCOVERY=true - EnableEndpointDiscovery *bool - enableEndpointDiscovery string - - // Specifies the WebIdentity token the SDK should use to assume a role - // with. - // - // VOLCSTACK_WEB_IDENTITY_TOKEN_FILE=file_path - WebIdentityTokenFilePath string - - // Specifies the IAM role arn to use when assuming an role. - // - // VOLCSTACK_ROLE_ARN=role_arn - RoleARN string - - // Specifies the IAM role session name to use when assuming a role. - // - // VOLCSTACK_ROLE_SESSION_NAME=session_name - RoleSessionName string -} - -var ( - csmEnabledEnvKey = []string{ - "VOLCSTACK_CSM_ENABLED", - } - csmHostEnvKey = []string{ - "VOLCSTACK_CSM_HOST", - } - csmPortEnvKey = []string{ - "VOLCSTACK_CSM_PORT", - } - csmClientIDEnvKey = []string{ - "VOLCSTACK_CSM_CLIENT_ID", - } - credAccessEnvKey = []string{ - "VOLCSTACK_ACCESS_KEY_ID", - "VOLCSTACK_ACCESS_KEY", - } - credSecretEnvKey = []string{ - "VOLCSTACK_SECRET_ACCESS_KEY", - "VOLCSTACK_SECRET_KEY", - } - credSessionEnvKey = []string{ - "VOLCSTACK_SESSION_TOKEN", - } - - enableEndpointDiscoveryEnvKey = []string{ - "VOLCSTACK_ENABLE_ENDPOINT_DISCOVERY", - } - - regionEnvKeys = []string{ - "VOLCSTACK_REGION", - "VOLCSTACK_DEFAULT_REGION", // Only read if VOLCSTACK_SDK_LOAD_CONFIG is also set - } - profileEnvKeys = []string{ - "VOLCSTACK_PROFILE", - "VOLCSTACK_DEFAULT_PROFILE", // Only read if VOLCSTACK_SDK_LOAD_CONFIG is also set - } - sharedCredsFileEnvKey = []string{ - "VOLCSTACK_SHARED_CREDENTIALS_FILE", - } - sharedConfigFileEnvKey = []string{ - "VOLCSTACK_CONFIG_FILE", - } - webIdentityTokenFilePathEnvKey = []string{ - "VOLCSTACK_WEB_IDENTITY_TOKEN_FILE", - } - roleARNEnvKey = []string{ - "VOLCSTACK_ROLE_ARN", - } - roleSessionNameEnvKey = []string{ - "VOLCSTACK_ROLE_SESSION_NAME", - } - awsUseDualStackEndpoint = []string{ - "AWS_USE_DUALSTACK_ENDPOINT", - } - awsUseFIPSEndpoint = []string{ - "AWS_USE_FIPS_ENDPOINT", - } -) - -// loadEnvConfig retrieves the SDK's environment configuration. -// See `envConfig` for the values that will be retrieved. -// -// If the environment variable `VOLCSTACK_SDK_LOAD_CONFIG` is set to a truthy value -// the shared SDK config will be loaded in addition to the SDK's specific -// configuration values. -func loadEnvConfig() envConfig { - enableSharedConfig, _ := strconv.ParseBool(os.Getenv("VOLCSTACK_SDK_LOAD_CONFIG")) - return envConfigLoad(enableSharedConfig) -} - -// loadEnvSharedConfig retrieves the SDK's environment configuration, and the -// SDK shared config. See `envConfig` for the values that will be retrieved. -// -// Loads the shared configuration in addition to the SDK's specific configuration. -// This will load the same values as `loadEnvConfig` if the `VOLCSTACK_SDK_LOAD_CONFIG` -// environment variable is set. -func loadSharedEnvConfig() envConfig { - return envConfigLoad(true) -} - -func envConfigLoad(enableSharedConfig bool) envConfig { - cfg := envConfig{} - - cfg.EnableSharedConfig = enableSharedConfig - - // Static environment credentials - var creds credentials.Value - setFromEnvVal(&creds.AccessKeyID, credAccessEnvKey) - setFromEnvVal(&creds.SecretAccessKey, credSecretEnvKey) - setFromEnvVal(&creds.SessionToken, credSessionEnvKey) - if creds.HasKeys() { - // Require logical grouping of credentials - creds.ProviderName = EnvProviderName - cfg.Creds = creds - } - - // Role Metadata - setFromEnvVal(&cfg.RoleARN, roleARNEnvKey) - setFromEnvVal(&cfg.RoleSessionName, roleSessionNameEnvKey) - - // Web identity environment variables - setFromEnvVal(&cfg.WebIdentityTokenFilePath, webIdentityTokenFilePathEnvKey) - - // CSM environment variables - setFromEnvVal(&cfg.csmEnabled, csmEnabledEnvKey) - setFromEnvVal(&cfg.CSMHost, csmHostEnvKey) - setFromEnvVal(&cfg.CSMPort, csmPortEnvKey) - setFromEnvVal(&cfg.CSMClientID, csmClientIDEnvKey) - - if len(cfg.csmEnabled) != 0 { - v, _ := strconv.ParseBool(cfg.csmEnabled) - cfg.CSMEnabled = &v - } - - regionKeys := regionEnvKeys - profileKeys := profileEnvKeys - if !cfg.EnableSharedConfig { - regionKeys = regionKeys[:1] - profileKeys = profileKeys[:1] - } - - setFromEnvVal(&cfg.Region, regionKeys) - setFromEnvVal(&cfg.Profile, profileKeys) - - // endpoint discovery is in reference to it being enabled. - setFromEnvVal(&cfg.enableEndpointDiscovery, enableEndpointDiscoveryEnvKey) - if len(cfg.enableEndpointDiscovery) > 0 { - cfg.EnableEndpointDiscovery = volcengine.Bool(cfg.enableEndpointDiscovery != "false") - } - - setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey) - setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey) - - if len(cfg.SharedCredentialsFile) == 0 { - cfg.SharedCredentialsFile = defaults.SharedCredentialsFilename() - } - if len(cfg.SharedConfigFile) == 0 { - cfg.SharedConfigFile = defaults.SharedConfigFilename() - } - - cfg.CustomCABundle = os.Getenv("VOLCSTACK_CA_BUNDLE") - - return cfg -} - -func setFromEnvVal(dst *string, keys []string) { - for _, k := range keys { - if v := os.Getenv(k); len(v) > 0 { - *dst = v - break - } - } -} - -func setEC2IMDSEndpointMode(mode *endpoints.EC2IMDSEndpointModeState, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue - } - if err := mode.SetFromString(value); err != nil { - return fmt.Errorf("invalid value for environment variable, %s=%s, %v", k, value, err) - } - return nil - } - return nil -} - -func setUseDualStackEndpointFromEnvVal(dst *endpoints.DualStackEndpointState, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue // skip if empty - } - - switch { - case strings.EqualFold(value, "true"): - *dst = endpoints.DualStackEndpointStateEnabled - case strings.EqualFold(value, "false"): - *dst = endpoints.DualStackEndpointStateDisabled - default: - return fmt.Errorf( - "invalid value for environment variable, %s=%s, need true, false", - k, value) - } - } - return nil -} - -func setUseFIPSEndpointFromEnvVal(dst *endpoints.FIPSEndpointState, keys []string) error { - for _, k := range keys { - value := os.Getenv(k) - if len(value) == 0 { - continue // skip if empty - } - - switch { - case strings.EqualFold(value, "true"): - *dst = endpoints.FIPSEndpointStateEnabled - case strings.EqualFold(value, "false"): - *dst = endpoints.FIPSEndpointStateDisabled - default: - return fmt.Errorf( - "invalid value for environment variable, %s=%s, need true, false", - k, value) - } - } - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/session.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/session.go deleted file mode 100644 index 2f592874a48e..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/session.go +++ /dev/null @@ -1,612 +0,0 @@ -/* -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 session - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "crypto/tls" - "crypto/x509" - "io" - "io/ioutil" - "net" - "net/http" - "os" - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/defaults" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/endpoints" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -const ( - // ErrCodeSharedConfig represents an error that occurs in the shared - // configuration logic - ErrCodeSharedConfig = "SharedConfigErr" -) - -// ErrSharedConfigSourceCollision will be returned if a section contains both -// source_profile and credential_source -var ErrSharedConfigSourceCollision = volcengineerr.New(ErrCodeSharedConfig, "only source profile or credential source can be specified, not both", nil) - -// ErrSharedConfigECSContainerEnvVarEmpty will be returned if the environment -// variables are empty and Environment was set as the credential source -var ErrSharedConfigECSContainerEnvVarEmpty = volcengineerr.New(ErrCodeSharedConfig, "EcsContainer was specified as the credential_source, but 'volcengine_CONTAINER_CREDENTIALS_RELATIVE_URI' was not set", nil) - -// ErrSharedConfigInvalidCredSource will be returned if an invalid credential source was provided -var ErrSharedConfigInvalidCredSource = volcengineerr.New(ErrCodeSharedConfig, "credential source values must be EcsContainer, Ec2InstanceMetadata, or Environment", nil) - -// A Session provides a central location to create service clients from and -// store configurations and request handlers for those services. -// -// Sessions are safe to create service clients concurrently, but it is not safe -// to mutate the Session concurrently. -// -// The Session satisfies the service client's client.ConfigProvider. -type Session struct { - Config *volcengine.Config - Handlers request.Handlers -} - -// New creates a new instance of the handlers merging in the provided configs -// on top of the SDK's default configurations. Once the Session is created it -// can be mutated to modify the Config or Handlers. The Session is safe to be -// read concurrently, but it should not be written to concurrently. -// -// If the volcengine_SDK_LOAD_CONFIG environment is set to a truthy value, the New -// method could now encounter an error when loading the configuration. When -// The environment variable is set, and an error occurs, New will return a -// session that will fail all requests reporting the error that occurred while -// loading the session. Use NewSession to get the error when creating the -// session. -// -// If the volcengine_SDK_LOAD_CONFIG environment variable is set to a truthy value -// the shared config file (~/.volcengine/config) will also be loaded, in addition to -// the shared credentials file (~/.volcengine/credentials). Values set in both the -// shared config, and shared credentials will be taken from the shared -// credentials file. -// -// Deprecated: Use NewSession functions to create sessions instead. NewSession -// has the same functionality as New except an error can be returned when the -// func is called instead of waiting to receive an error until a request is made. -func New(cfgs ...*volcengine.Config) *Session { - // load initial config from environment - envCfg := loadEnvConfig() - - if envCfg.EnableSharedConfig { - var cfg volcengine.Config - cfg.MergeIn(cfgs...) - s, err := NewSessionWithOptions(Options{ - Config: cfg, - SharedConfigState: SharedConfigEnable, - }) - if err != nil { - // Old session.New expected all errors to be discovered when - // a request is made, and would report the errors then. This - // needs to be replicated if an error occurs while creating - // the session. - msg := "failed to create session with volcengine_SDK_LOAD_CONFIG enabled. " + - "Use session.NewSession to handle errors occurring during session creation." - - // Session creation failed, need to report the error and prevent - // any requests from succeeding. - s = &Session{Config: defaults.Config()} - s.Config.MergeIn(cfgs...) - s.Config.Logger.Log("ERROR:", msg, "Error:", err) - s.Handlers.Validate.PushBack(func(r *request.Request) { - r.Error = err - }) - } - - return s - } - - s := deprecatedNewSession(cfgs...) - - return s -} - -// NewSession returns a new Session created from SDK defaults, config files, -// environment, and user provided config files. Once the Session is created -// it can be mutated to modify the Config or Handlers. The Session is safe to -// be read concurrently, but it should not be written to concurrently. -// -// If the volcengine_SDK_LOAD_CONFIG environment variable is set to a truthy value -// the shared config file (~/.volcengine/config) will also be loaded in addition to -// the shared credentials file (~/.volcengine/credentials). Values set in both the -// shared config, and shared credentials will be taken from the shared -// credentials file. Enabling the Shared Config will also allow the Session -// to be built with retrieving credentials with AssumeRole set in the config. -// -// See the NewSessionWithOptions func for information on how to override or -// control through code how the Session will be created, such as specifying the -// config profile, and controlling if shared config is enabled or not. -func NewSession(cfgs ...*volcengine.Config) (*Session, error) { - opts := Options{} - opts.Config.MergeIn(cfgs...) - - if opts.Config.Endpoint == nil { - opts.Config.Endpoint = volcengine.String(volcengineutil.NewEndpoint().GetEndpoint()) - } - - //merge config region and endpoint info to sts - if opts.Config.Credentials == nil { - return NewSessionWithOptions(opts) - } else if sts, ok := opts.Config.Credentials.GetProvider().(*credentials.StsProvider); ok { - if sts.Region == "" && opts.Config.Region != nil { - sts.Region = *(opts.Config.Region) - } - if sts.Host == "" && opts.Config.Endpoint != nil { - sts.Host = *(opts.Config.Endpoint) - } - } - return NewSessionWithOptions(opts) -} - -// SharedConfigState provides the ability to optionally override the state -// of the session's creation based on the shared config being enabled or -// disabled. -type SharedConfigState int - -const ( - // SharedConfigStateFromEnv does not override any state of the - // volcengine_SDK_LOAD_CONFIG env var. It is the default value of the - // SharedConfigState type. - SharedConfigStateFromEnv SharedConfigState = iota - - // SharedConfigDisable overrides the volcengine_SDK_LOAD_CONFIG env var value - // and disables the shared config functionality. - SharedConfigDisable - - // SharedConfigEnable overrides the volcengine_SDK_LOAD_CONFIG env var value - // and enables the shared config functionality. - SharedConfigEnable -) - -// Options provides the means to control how a Session is created and what -// configuration values will be loaded. -type Options struct { - // Provides config values for the SDK to use when creating service clients - // and making API requests to services. Any value set in with this field - // will override the associated value provided by the SDK defaults, - // environment or config files where relevant. - // - // If not set, configuration values from from SDK defaults, environment, - // config will be used. - Config volcengine.Config - - // Overrides the config profile the Session should be created from. If not - // set the value of the environment variable will be loaded (volcengine_PROFILE, - // or volcengine_DEFAULT_PROFILE if the Shared Config is enabled). - // - // If not set and environment variables are not set the "default" - // (DefaultSharedConfigProfile) will be used as the profile to load the - // session config from. - Profile string - - // Instructs how the Session will be created based on the volcengine_SDK_LOAD_CONFIG - // environment variable. By default a Session will be created using the - // value provided by the volcengine_SDK_LOAD_CONFIG environment variable. - // - // Setting this value to SharedConfigEnable or SharedConfigDisable - // will allow you to override the volcengine_SDK_LOAD_CONFIG environment variable - // and enable or disable the shared config functionality. - SharedConfigState SharedConfigState - - // Ordered list of files the session will load configuration from. - // It will override environment variable volcengine_SHARED_CREDENTIALS_FILE, volcengine_CONFIG_FILE. - SharedConfigFiles []string - - // When the SDK's shared config is configured to assume a role with MFA - // this option is required in order to provide the mechanism that will - // retrieve the MFA token. There is no default value for this field. If - // it is not set an error will be returned when creating the session. - // - // This token provider will be called when ever the assumed role's - // credentials need to be refreshed. Within the context of service clients - // all sharing the same session the SDK will ensure calls to the token - // provider are atomic. When sharing a token provider across multiple - // sessions additional synchronization logic is needed to ensure the - // token providers do not introduce race conditions. It is recommend to - // share the session where possible. - // - // stscreds.StdinTokenProvider is a basic implementation that will prompt - // from stdin for the MFA token code. - // - // This field is only used if the shared configuration is enabled, and - // the config enables assume role wit MFA via the mfa_serial field. - AssumeRoleTokenProvider func() (string, error) - - // When the SDK's shared config is configured to assume a role this option - // may be provided to set the expiry duration of the STS credentials. - // Defaults to 15 minutes if not set as documented in the - // stscreds.AssumeRoleProvider. - AssumeRoleDuration time.Duration - - // Reader for a custom Credentials Authority (CA) bundle in PEM format that - // the SDK will use instead of the default system's root CA bundle. Use this - // only if you want to replace the CA bundle the SDK uses for TLS requests. - // - // Enabling this option will attempt to merge the Transport into the SDK's HTTP - // client. If the client's Transport is not a http.Transport an error will be - // returned. If the Transport's TLS config is set this option will cause the SDK - // to overwrite the Transport's TLS config's RootCAs value. If the CA - // bundle reader contains multiple certificates all of them will be loaded. - // - // The Session option CustomCABundle is also available when creating sessions - // to also enable this feature. CustomCABundle session option field has priority - // over the volcengine_CA_BUNDLE environment variable, and will be used if both are set. - CustomCABundle io.Reader - - // The handlers that the session and all API clients will be created with. - // This must be a complete set of handlers. Use the defaults.Handlers() - // function to initialize this value before changing the handlers to be - // used by the SDK. - Handlers request.Handlers -} - -// NewSessionWithOptions returns a new Session created from SDK defaults, config files, -// environment, and user provided config files. This func uses the Options -// values to configure how the Session is created. -// -// If the volcengine_SDK_LOAD_CONFIG environment variable is set to a truthy value -// the shared config file (~/.volcengine/config) will also be loaded in addition to -// the shared credentials file (~/.volcengine/credentials). Values set in both the -// shared config, and shared credentials will be taken from the shared -// credentials file. Enabling the Shared Config will also allow the Session -// to be built with retrieving credentials with AssumeRole set in the config. -// -// // Equivalent to session.New -// sess := session.Must(session.NewSessionWithOptions(session.Options{})) -// -// // Specify profile to load for the session's config -// sess := session.Must(session.NewSessionWithOptions(session.Options{ -// Profile: "profile_name", -// })) -// -// // Specify profile for config and region for requests -// sess := session.Must(session.NewSessionWithOptions(session.Options{ -// Config: volcengine.Config{Region: volcengine.String("us-east-1")}, -// Profile: "profile_name", -// })) -// -// // Force enable Shared Config support -// sess := session.Must(session.NewSessionWithOptions(session.Options{ -// SharedConfigState: session.SharedConfigEnable, -// })) -func NewSessionWithOptions(opts Options) (*Session, error) { - var envCfg envConfig - if opts.SharedConfigState == SharedConfigEnable { - envCfg = loadSharedEnvConfig() - } else { - envCfg = loadEnvConfig() - } - - if len(opts.Profile) != 0 { - envCfg.Profile = opts.Profile - } - - switch opts.SharedConfigState { - case SharedConfigDisable: - envCfg.EnableSharedConfig = false - case SharedConfigEnable: - envCfg.EnableSharedConfig = true - } - - // Only use volcengine_CA_BUNDLE if session option is not provided. - if len(envCfg.CustomCABundle) != 0 && opts.CustomCABundle == nil { - f, err := os.Open(envCfg.CustomCABundle) - if err != nil { - return nil, volcengineerr.New("LoadCustomCABundleError", - "failed to open custom CA bundle PEM file", err) - } - defer f.Close() - opts.CustomCABundle = f - } - - return newSession(opts, envCfg, &opts.Config) -} - -// Must is a helper function to ensure the Session is valid and there was no -// error when calling a NewSession function. -// -// This helper is intended to be used in variable initialization to load the -// Session and configuration at startup. Such as: -// -// var sess = session.Must(session.NewSession()) -func Must(sess *Session, err error) *Session { - if err != nil { - panic(err) - } - - return sess -} - -func deprecatedNewSession(cfgs ...*volcengine.Config) *Session { - cfg := defaults.Config() - handlers := defaults.Handlers() - - // Apply the passed in configs so the configuration can be applied to the - // default credential chain - cfg.MergeIn(cfgs...) - cfg.Credentials = defaults.CredChain(cfg, handlers) - - // Reapply any passed in configs to override credentials if set - cfg.MergeIn(cfgs...) - - s := &Session{ - Config: cfg, - Handlers: handlers, - } - - initHandlers(s) - return s -} - -func newSession(opts Options, envCfg envConfig, cfgs ...*volcengine.Config) (*Session, error) { - cfg := defaults.Config() - - handlers := opts.Handlers - if handlers.IsEmpty() { - handlers = defaults.Handlers() - } - - // Get a merged version of the user provided config to determine if - // credentials were. - userCfg := &volcengine.Config{} - userCfg.MergeIn(cfgs...) - cfg.MergeIn(userCfg) - - // Ordered config files will be loaded in with later files overwriting - // previous config file values. - var cfgFiles []string - if opts.SharedConfigFiles != nil { - cfgFiles = opts.SharedConfigFiles - } else { - cfgFiles = []string{envCfg.SharedConfigFile, envCfg.SharedCredentialsFile} - if !envCfg.EnableSharedConfig { - // The shared config file (~/.volcengine/config) is only loaded if instructed - // to load via the envConfig.EnableSharedConfig (volcengine_SDK_LOAD_CONFIG). - cfgFiles = cfgFiles[1:] - } - } - - // Load additional config from file(s) - sharedCfg, err := loadSharedConfig(envCfg.Profile, cfgFiles, envCfg.EnableSharedConfig) - if err != nil { - if len(envCfg.Profile) == 0 && !envCfg.EnableSharedConfig && (envCfg.Creds.HasKeys() || userCfg.Credentials != nil) { - // Special case where the user has not explicitly specified an volcengine_PROFILE, - // or session.Options.profile, shared config is not enabled, and the - // environment has credentials, allow the shared config file to fail to - // load since the user has already provided credentials, and nothing else - // is required to be read file. Github(volcengine/volcengine-go-sdk#2455) - } else if _, ok := err.(SharedConfigProfileNotExistsError); !ok { - return nil, err - } - } - - if err := mergeConfigSrcs(cfg, userCfg, envCfg, sharedCfg, handlers, opts); err != nil { - return nil, err - } - - s := &Session{ - Config: cfg, - Handlers: handlers, - } - - initHandlers(s) - - // Setup HTTP client with custom cert bundle if enabled - if opts.CustomCABundle != nil { - if err := loadCustomCABundle(s, opts.CustomCABundle); err != nil { - return nil, err - } - } - - return s, nil -} - -func getCABundleTransport() *http.Transport { - return &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - DualStack: true, - }).DialContext, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - } -} - -func loadCustomCABundle(s *Session, bundle io.Reader) error { - var t *http.Transport - switch v := s.Config.HTTPClient.Transport.(type) { - case *http.Transport: - t = v - default: - if s.Config.HTTPClient.Transport != nil { - return volcengineerr.New("LoadCustomCABundleError", - "unable to load custom CA bundle, HTTPClient's transport unsupported type", nil) - } - } - if t == nil { - // Nil transport implies `http.DefaultTransport` should be used. Since - // the SDK cannot modify, nor copy the `DefaultTransport` specifying - // the values the next closest behavior. - t = getCABundleTransport() - } - - p, err := loadCertPool(bundle) - if err != nil { - return err - } - if t.TLSClientConfig == nil { - t.TLSClientConfig = &tls.Config{} - } - t.TLSClientConfig.RootCAs = p - - s.Config.HTTPClient.Transport = t - - return nil -} - -func loadCertPool(r io.Reader) (*x509.CertPool, error) { - b, err := ioutil.ReadAll(r) - if err != nil { - return nil, volcengineerr.New("LoadCustomCABundleError", - "failed to read custom CA bundle PEM file", err) - } - - p := x509.NewCertPool() - if !p.AppendCertsFromPEM(b) { - return nil, volcengineerr.New("LoadCustomCABundleError", - "failed to load custom CA bundle PEM file", err) - } - - return p, nil -} - -func mergeConfigSrcs(cfg, userCfg *volcengine.Config, - envCfg envConfig, sharedCfg sharedConfig, - handlers request.Handlers, - sessOpts Options, -) error { - - // Region if not already set by user - if len(volcengine.StringValue(cfg.Region)) == 0 { - if len(envCfg.Region) > 0 { - cfg.WithRegion(envCfg.Region) - } else if envCfg.EnableSharedConfig && len(sharedCfg.Region) > 0 { - cfg.WithRegion(sharedCfg.Region) - } - } - - //if cfg.EnableEndpointDiscovery == nil { - // if envCfg.EnableEndpointDiscovery != nil { - // cfg.WithEndpointDiscovery(*envCfg.EnableEndpointDiscovery) - // } else if envCfg.EnableSharedConfig && sharedCfg.EnableEndpointDiscovery != nil { - // cfg.WithEndpointDiscovery(*sharedCfg.EnableEndpointDiscovery) - // } - //} - - // Configure credentials if not already set by the user when creating the - // Session. - if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { - creds, err := resolveCredentials(cfg, envCfg, sharedCfg, handlers, sessOpts) - if err != nil { - return err - } - cfg.Credentials = creds - } - - return nil -} - -func initHandlers(s *Session) { - // Add the Validate parameter handler if it is not disabled. - s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler) - // Temporary notes by xuyaming@bytedance.com because some validate field is relation. - //if !volcengine.BoolValue(s.Config.DisableParamValidation) { - // s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler) - //} -} - -// Copy creates and returns a copy of the current Session, copying the config -// and handlers. If any additional configs are provided they will be merged -// on top of the Session's copied config. -// -// // Create a copy of the current Session, configured for the us-west-2 region. -// sess.Copy(&volcengine.Config{Region: volcengine.String("us-west-2")}) -func (s *Session) Copy(cfgs ...*volcengine.Config) *Session { - newSession := &Session{ - Config: s.Config.Copy(cfgs...), - Handlers: s.Handlers.Copy(), - } - - initHandlers(newSession) - - return newSession -} - -// ClientConfig satisfies the client.ConfigProvider interface and is used to -// configure the service client instances. Passing the Session to the service -// client's constructor (New) will use this method to configure the client. -func (s *Session) ClientConfig(serviceName string, cfgs ...*volcengine.Config) client.Config { - // Backwards compatibility, the error will be eaten if user calls ClientConfig - // directly. All SDK services will use ClientconfigWithError. - cfg, _ := s.clientConfigWithErr(serviceName, cfgs...) - - return cfg -} - -func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*volcengine.Config) (client.Config, error) { - s = s.Copy(cfgs...) - - var resolved endpoints.ResolvedEndpoint - var err error - - region := volcengine.StringValue(s.Config.Region) - - if endpoint := volcengine.StringValue(s.Config.Endpoint); len(endpoint) != 0 { - resolved.URL = endpoints.AddScheme(endpoint, volcengine.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = region - } - - return client.Config{ - Config: s.Config, - Handlers: s.Handlers, - Endpoint: resolved.URL, - SigningRegion: resolved.SigningRegion, - SigningNameDerived: resolved.SigningNameDerived, - SigningName: resolved.SigningName, - }, err -} - -// ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception -// that the EndpointResolver will not be used to resolve the endpoint. The only -// endpoint set must come from the volcengine.Config.Endpoint field. -func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*volcengine.Config) client.Config { - s = s.Copy(cfgs...) - - var resolved endpoints.ResolvedEndpoint - - region := volcengine.StringValue(s.Config.Region) - - if ep := volcengine.StringValue(s.Config.Endpoint); len(ep) > 0 { - resolved.URL = endpoints.AddScheme(ep, volcengine.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = region - } - - return client.Config{ - Config: s.Config, - Handlers: s.Handlers, - Endpoint: resolved.URL, - SigningRegion: resolved.SigningRegion, - SigningNameDerived: resolved.SigningNameDerived, - SigningName: resolved.SigningName, - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/shared_config.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/shared_config.go deleted file mode 100644 index 1ccb6ed52241..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session/shared_config.go +++ /dev/null @@ -1,530 +0,0 @@ -/* -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 session - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/ini" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -const ( - // Static Credentials group - accessKeyIDKey = `volcengine_access_key_id` // group required - secretAccessKey = `volcengine_secret_access_key` // group required - sessionTokenKey = `volcengine_session_token` // optional - - // Assume Role Credentials group - roleArnKey = `role_trn` // group required - sourceProfileKey = `source_profile` // group required (or credential_source) - credentialSourceKey = `credential_source` // group required (or source_profile) - externalIDKey = `external_id` // optional - mfaSerialKey = `mfa_serial` // optional - roleSessionNameKey = `role_session_name` // optional - - // Additional Config fields - regionKey = `region` - - // endpoint discovery group - enableEndpointDiscoveryKey = `endpoint_discovery_enabled` // optional - - // External Credential Process - credentialProcessKey = `credential_process` // optional - - // Web Identity Token File - webIdentityTokenFileKey = `web_identity_token_file` // optional - - // DefaultSharedConfigProfile is the default profile to be used when - // loading configuration from the config files if another profile name - // is not provided. - DefaultSharedConfigProfile = `default` -) - -// sharedConfig represents the configuration fields of the SDK config files. -type sharedConfig struct { - // Credentials values from the config file. Both volcengine_access_key_id and - // volcengine_secret_access_key must be provided together in the same file to be - // considered valid. The values will be ignored if not a complete group. - // volcengine_session_token is an optional field that can be provided if both of - // the other two fields are also provided. - // - // volcengine_access_key_id - // volcengine_secret_access_key - // volcengine_session_token - Creds credentials.Value - - CredentialSource string - CredentialProcess string - WebIdentityTokenFile string - - RoleARN string - RoleSessionName string - ExternalID string - MFASerial string - - SourceProfileName string - SourceProfile *sharedConfig - - // Region is the region the SDK should use for looking up VOLCSTACK service - // endpoints and signing requests. - // - // region - Region string - - // EnableEndpointDiscovery can be enabled in the shared config by setting - // endpoint_discovery_enabled to true - // - // endpoint_discovery_enabled = true - EnableEndpointDiscovery *bool - - // CSM Options - CSMEnabled *bool - CSMHost string - CSMPort string - CSMClientID string -} - -type sharedConfigFile struct { - Filename string - IniData ini.Sections -} - -// loadSharedConfig retrieves the configuration from the list of files using -// the profile provided. The order the files are listed will determine -// precedence. Values in subsequent files will overwrite values defined in -// earlier files. -// -// For example, given two files A and B. Both define credentials. If the order -// of the files are A then B, B's credential values will be used instead of -// A's. -// -// See sharedConfig.setFromFile for information how the config files -// will be loaded. -func loadSharedConfig(profile string, filenames []string, exOpts bool) (sharedConfig, error) { - if len(profile) == 0 { - profile = DefaultSharedConfigProfile - } - - files, err := loadSharedConfigIniFiles(filenames) - if err != nil { - return sharedConfig{}, err - } - - cfg := sharedConfig{} - profiles := map[string]struct{}{} - if err = cfg.setFromIniFiles(profiles, profile, files, exOpts); err != nil { - return sharedConfig{}, err - } - - return cfg, nil -} - -func loadSharedConfigIniFiles(filenames []string) ([]sharedConfigFile, error) { - files := make([]sharedConfigFile, 0, len(filenames)) - - for _, filename := range filenames { - sections, err := ini.OpenFile(filename) - if aerr, ok := err.(volcengineerr.Error); ok && aerr.Code() == ini.ErrCodeUnableToReadFile { - // Skip files which can't be opened and read for whatever reason - continue - } else if err != nil { - return nil, SharedConfigLoadError{Filename: filename, Err: err} - } - - files = append(files, sharedConfigFile{ - Filename: filename, IniData: sections, - }) - } - - return files, nil -} - -func (cfg *sharedConfig) setFromIniFiles(profiles map[string]struct{}, profile string, files []sharedConfigFile, exOpts bool) error { - // Trim files from the list that don't exist. - var skippedFiles int - var profileNotFoundErr error - for _, f := range files { - if err := cfg.setFromIniFile(profile, f, exOpts); err != nil { - if _, ok := err.(SharedConfigProfileNotExistsError); ok { - // Ignore profiles not defined in individual files. - profileNotFoundErr = err - skippedFiles++ - continue - } - return err - } - } - if skippedFiles == len(files) { - // If all files were skipped because the profile is not found, return - // the original profile not found error. - return profileNotFoundErr - } - - if _, ok := profiles[profile]; ok { - // if this is the second instance of the profile the Assume Role - // options must be cleared because they are only valid for the - // first reference of a profile. The self linked instance of the - // profile only have credential provider options. - cfg.clearAssumeRoleOptions() - } else { - // First time a profile has been seen, It must either be a assume role - // or credentials. Assert if the credential type requires a role ARN, - // the ARN is also set. - if err := cfg.validateCredentialsRequireARN(profile); err != nil { - return err - } - } - profiles[profile] = struct{}{} - - if err := cfg.validateCredentialType(); err != nil { - return err - } - - // Link source profiles for assume roles - if len(cfg.SourceProfileName) != 0 { - // Linked profile via source_profile ignore credential provider - // options, the source profile must provide the credentials. - cfg.clearCredentialOptions() - - srcCfg := &sharedConfig{} - err := srcCfg.setFromIniFiles(profiles, cfg.SourceProfileName, files, exOpts) - if err != nil { - // SourceProfile that doesn't exist is an error in configuration. - if _, ok := err.(SharedConfigProfileNotExistsError); ok { - err = SharedConfigAssumeRoleError{ - RoleARN: cfg.RoleARN, - SourceProfile: cfg.SourceProfileName, - } - } - return err - } - - if !srcCfg.hasCredentials() { - return SharedConfigAssumeRoleError{ - RoleARN: cfg.RoleARN, - SourceProfile: cfg.SourceProfileName, - } - } - - cfg.SourceProfile = srcCfg - } - - return nil -} - -// setFromFile loads the configuration from the file using the profile -// provided. A sharedConfig pointer type value is used so that multiple config -// file loadings can be chained. -// -// Only loads complete logically grouped values, and will not set fields in cfg -// for incomplete grouped values in the config. Such as credentials. For -// example if a config file only includes volcengine_access_key_id but no -// volcengine_secret_access_key the volcengine_access_key_id will be ignored. -func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, exOpts bool) error { - section, ok := file.IniData.GetSection(profile) - if !ok { - // Fallback to to alternate profile name: profile - section, ok = file.IniData.GetSection(fmt.Sprintf("profile %s", profile)) - if !ok { - return SharedConfigProfileNotExistsError{Profile: profile, Err: nil} - } - } - - if exOpts { - // Assume Role Parameters - updateString(&cfg.RoleARN, section, roleArnKey) - updateString(&cfg.ExternalID, section, externalIDKey) - updateString(&cfg.MFASerial, section, mfaSerialKey) - updateString(&cfg.RoleSessionName, section, roleSessionNameKey) - updateString(&cfg.SourceProfileName, section, sourceProfileKey) - updateString(&cfg.CredentialSource, section, credentialSourceKey) - - updateString(&cfg.Region, section, regionKey) - } - - updateString(&cfg.CredentialProcess, section, credentialProcessKey) - updateString(&cfg.WebIdentityTokenFile, section, webIdentityTokenFileKey) - - // Shared Credentials - creds := credentials.Value{ - AccessKeyID: section.String(accessKeyIDKey), - SecretAccessKey: section.String(secretAccessKey), - SessionToken: section.String(sessionTokenKey), - ProviderName: fmt.Sprintf("SharedConfigCredentials: %s", file.Filename), - } - if creds.HasKeys() { - cfg.Creds = creds - } - - // Endpoint discovery - updateBoolPtr(&cfg.EnableEndpointDiscovery, section, enableEndpointDiscoveryKey) - - return nil -} - -func (cfg *sharedConfig) validateCredentialsRequireARN(profile string) error { - var credSource string - - switch { - case len(cfg.SourceProfileName) != 0: - credSource = sourceProfileKey - case len(cfg.CredentialSource) != 0: - credSource = credentialSourceKey - case len(cfg.WebIdentityTokenFile) != 0: - credSource = webIdentityTokenFileKey - } - - if len(credSource) != 0 && len(cfg.RoleARN) == 0 { - return CredentialRequiresARNError{ - Type: credSource, - Profile: profile, - } - } - - return nil -} - -func (cfg *sharedConfig) validateCredentialType() error { - // Only one or no credential type can be defined. - if !oneOrNone( - len(cfg.SourceProfileName) != 0, - len(cfg.CredentialSource) != 0, - len(cfg.CredentialProcess) != 0, - len(cfg.WebIdentityTokenFile) != 0, - ) { - return ErrSharedConfigSourceCollision - } - - return nil -} - -func (cfg *sharedConfig) hasCredentials() bool { - switch { - case len(cfg.SourceProfileName) != 0: - case len(cfg.CredentialSource) != 0: - case len(cfg.CredentialProcess) != 0: - case len(cfg.WebIdentityTokenFile) != 0: - case cfg.Creds.HasKeys(): - default: - return false - } - - return true -} - -func (cfg *sharedConfig) clearCredentialOptions() { - cfg.CredentialSource = "" - cfg.CredentialProcess = "" - cfg.WebIdentityTokenFile = "" - cfg.Creds = credentials.Value{} -} - -func (cfg *sharedConfig) clearAssumeRoleOptions() { - cfg.RoleARN = "" - cfg.ExternalID = "" - cfg.MFASerial = "" - cfg.RoleSessionName = "" - cfg.SourceProfileName = "" -} - -func oneOrNone(bs ...bool) bool { - var count int - - for _, b := range bs { - if b { - count++ - if count > 1 { - return false - } - } - } - - return true -} - -// updateString will only update the dst with the value in the section key, key -// is present in the section. -func updateString(dst *string, section ini.Section, key string) { - if !section.Has(key) { - return - } - *dst = section.String(key) -} - -// updateBoolPtr will only update the dst with the value in the section key, -// key is present in the section. -func updateBoolPtr(dst **bool, section ini.Section, key string) { - if !section.Has(key) { - return - } - *dst = new(bool) - **dst = section.Bool(key) -} - -// SharedConfigLoadError is an error for the shared config file failed to load. -type SharedConfigLoadError struct { - Filename string - Err error -} - -// Code is the short id of the error. -func (e SharedConfigLoadError) Code() string { - return "SharedConfigLoadError" -} - -// Message is the description of the error -func (e SharedConfigLoadError) Message() string { - return fmt.Sprintf("failed to load config file, %s", e.Filename) -} - -// OrigErr is the underlying error that caused the failure. -func (e SharedConfigLoadError) OrigErr() error { - return e.Err -} - -// Error satisfies the error interface. -func (e SharedConfigLoadError) Error() string { - return volcengineerr.SprintError(e.Code(), e.Message(), "", e.Err) -} - -// SharedConfigProfileNotExistsError is an error for the shared config when -// the profile was not find in the config file. -type SharedConfigProfileNotExistsError struct { - Profile string - Err error -} - -// Code is the short id of the error. -func (e SharedConfigProfileNotExistsError) Code() string { - return "SharedConfigProfileNotExistsError" -} - -// Message is the description of the error -func (e SharedConfigProfileNotExistsError) Message() string { - return fmt.Sprintf("failed to get profile, %s", e.Profile) -} - -// OrigErr is the underlying error that caused the failure. -func (e SharedConfigProfileNotExistsError) OrigErr() error { - return e.Err -} - -// Error satisfies the error interface. -func (e SharedConfigProfileNotExistsError) Error() string { - return volcengineerr.SprintError(e.Code(), e.Message(), "", e.Err) -} - -// SharedConfigAssumeRoleError is an error for the shared config when the -// profile contains assume role information, but that information is invalid -// or not complete. -type SharedConfigAssumeRoleError struct { - RoleARN string - SourceProfile string -} - -// Code is the short id of the error. -func (e SharedConfigAssumeRoleError) Code() string { - return "SharedConfigAssumeRoleError" -} - -// Message is the description of the error -func (e SharedConfigAssumeRoleError) Message() string { - return fmt.Sprintf( - "failed to load assume role for %s, source profile %s has no shared credentials", - e.RoleARN, e.SourceProfile, - ) -} - -// OrigErr is the underlying error that caused the failure. -func (e SharedConfigAssumeRoleError) OrigErr() error { - return nil -} - -// Error satisfies the error interface. -func (e SharedConfigAssumeRoleError) Error() string { - return volcengineerr.SprintError(e.Code(), e.Message(), "", nil) -} - -// CredentialRequiresARNError provides the error for shared config credentials -// that are incorrectly configured in the shared config or credentials file. -type CredentialRequiresARNError struct { - // type of credentials that were configured. - Type string - - // Profile name the credentials were in. - Profile string -} - -// Code is the short id of the error. -func (e CredentialRequiresARNError) Code() string { - return "CredentialRequiresARNError" -} - -// Message is the description of the error -func (e CredentialRequiresARNError) Message() string { - return fmt.Sprintf( - "credential type %s requires role_arn, profile %s", - e.Type, e.Profile, - ) -} - -// OrigErr is the underlying error that caused the failure. -func (e CredentialRequiresARNError) OrigErr() error { - return nil -} - -// Error satisfies the error interface. -func (e CredentialRequiresARNError) Error() string { - return volcengineerr.SprintError(e.Code(), e.Message(), "", nil) -} - -// updateEndpointDiscoveryType will only update the dst with the value in the section, if -// a valid key and corresponding EndpointDiscoveryType is found. -func updateUseDualStackEndpoint(dst *endpoints.DualStackEndpointState, section ini.Section, key string) { - if !section.Has(key) { - return - } - - if section.Bool(key) { - *dst = endpoints.DualStackEndpointStateEnabled - } else { - *dst = endpoints.DualStackEndpointStateDisabled - } - - return -} - -// updateEndpointDiscoveryType will only update the dst with the value in the section, if -// a valid key and corresponding EndpointDiscoveryType is found. -func updateUseFIPSEndpoint(dst *endpoints.FIPSEndpointState, section ini.Section, key string) { - if !section.Has(key) { - return - } - - if section.Bool(key) { - *dst = endpoints.FIPSEndpointStateEnabled - } else { - *dst = endpoints.FIPSEndpointStateDisabled - } - - return -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/signer/volc/volc.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/signer/volc/volc.go deleted file mode 100644 index 71c3ac9f4b0b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/signer/volc/volc.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -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 volc - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang/base" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" -) - -var SignRequestHandler = request.NamedHandler{ - Name: "volc.SignRequestHandler", Fn: SignSDKRequest, -} - -func SignSDKRequest(req *request.Request) { - - region := req.ClientInfo.SigningRegion - - var ( - dynamicCredentials *credentials.Credentials - dynamicRegion *string - c1 base.Credentials - err error - ) - - if req.Config.DynamicCredentialsIncludeError != nil { - dynamicCredentials, dynamicRegion, err = req.Config.DynamicCredentialsIncludeError(req.Context()) - if err != nil { - req.Error = err - return - } - } else if req.Config.DynamicCredentials != nil { - dynamicCredentials, dynamicRegion = req.Config.DynamicCredentials(req.Context()) - } - - if req.Config.DynamicCredentials != nil || req.Config.DynamicCredentialsIncludeError != nil { - if volcengine.StringValue(dynamicRegion) == "" { - req.Error = volcengine.ErrMissingRegion - return - } - region = volcengine.StringValue(dynamicRegion) - } else if region == "" { - region = volcengine.StringValue(req.Config.Region) - } - - name := req.ClientInfo.SigningName - if name == "" { - name = req.ClientInfo.ServiceID - } - - if dynamicCredentials == nil { - c1, err = req.Config.Credentials.GetBase(region, name) - } else { - c1, err = dynamicCredentials.GetBase(region, name) - } - - if err != nil { - req.Error = err - return - } - - r := c1.Sign(req.HTTPRequest) - req.HTTPRequest.Header = r.Header -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/special/iot_response.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/special/iot_response.go deleted file mode 100644 index 27083080456b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/special/iot_response.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -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 special - -import ( - "reflect" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" -) - -func iotResponse(response response.VolcengineResponse, i interface{}) interface{} { - _, ok1 := reflect.TypeOf(i).Elem().FieldByName("ResponseMetadata") - _, ok2 := reflect.TypeOf(i).Elem().FieldByName("Result") - if ok1 && ok2 { - return response - } - return response.Result -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/special/special_conf.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/special/special_conf.go deleted file mode 100644 index d47037053924..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/special/special_conf.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -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 special - -import "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - -type ResponseSpecial func(response.VolcengineResponse, interface{}) interface{} - -var responseSpecialMapping map[string]ResponseSpecial - -func init() { - responseSpecialMapping = map[string]ResponseSpecial{ - "iot": iotResponse, - } -} - -func ResponseSpecialMapping() map[string]ResponseSpecial { - return responseSpecialMapping -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/types.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/types.go deleted file mode 100644 index 1efe284684ab..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/types.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "io" - "sync" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/internal/sdkio" -) - -// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Allows the -// SDK to accept an io.Reader that is not also an io.Seeker for unsigned -// streaming payload API operations. -// -// A ReadSeekCloser wrapping an nonseekable io.Reader used in an API -// operation's input will prevent that operation being retried in the case of -// network errors, and cause operation requests to fail if the operation -// requires payload signing. -// -// Note: If using With S3 PutObject to stream an object upload The SDK's S3 -// Upload manager (s3manager.Uploader) provides support for streaming with the -// ability to retry network errors. -func ReadSeekCloser(r io.Reader) ReaderSeekerCloser { - return ReaderSeekerCloser{r} -} - -// ReaderSeekerCloser represents a reader that can also delegate io.Seeker and -// io.Closer interfaces to the underlying object if they are available. -type ReaderSeekerCloser struct { - r io.Reader -} - -// IsReaderSeekable returns if the underlying reader type can be seeked. A -// io.Reader might not actually be seekable if it is the ReaderSeekerCloser -// type. -func IsReaderSeekable(r io.Reader) bool { - switch v := r.(type) { - case ReaderSeekerCloser: - return v.IsSeeker() - case *ReaderSeekerCloser: - return v.IsSeeker() - case io.ReadSeeker: - return true - default: - return false - } -} - -// Read reads from the reader up to size of p. The number of bytes read, and -// error if it occurred will be returned. -// -// If the reader is not an io.Reader zero bytes read, and nil error will be -// returned. -// -// Performs the same functionality as io.Reader Read -func (r ReaderSeekerCloser) Read(p []byte) (int, error) { - switch t := r.r.(type) { - case io.Reader: - return t.Read(p) - } - return 0, nil -} - -// Seek sets the offset for the next Read to offset, interpreted according to -// whence: 0 means relative to the origin of the file, 1 means relative to the -// current offset, and 2 means relative to the end. Seek returns the new offset -// and an error, if any. -// -// If the ReaderSeekerCloser is not an io.Seeker nothing will be done. -func (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error) { - switch t := r.r.(type) { - case io.Seeker: - return t.Seek(offset, whence) - } - return int64(0), nil -} - -// IsSeeker returns if the underlying reader is also a seeker. -func (r ReaderSeekerCloser) IsSeeker() bool { - _, ok := r.r.(io.Seeker) - return ok -} - -// HasLen returns the length of the underlying reader if the value implements -// the Len() int method. -func (r ReaderSeekerCloser) HasLen() (int, bool) { - type lenner interface { - Len() int - } - - if lr, ok := r.r.(lenner); ok { - return lr.Len(), true - } - - return 0, false -} - -// GetLen returns the length of the bytes remaining in the underlying reader. -// Checks first for Len(), then io.Seeker to determine the size of the -// underlying reader. -// -// Will return -1 if the length cannot be determined. -func (r ReaderSeekerCloser) GetLen() (int64, error) { - if l, ok := r.HasLen(); ok { - return int64(l), nil - } - - if s, ok := r.r.(io.Seeker); ok { - return seekerLen(s) - } - - return -1, nil -} - -// SeekerLen attempts to get the number of bytes remaining at the seeker's -// current position. Returns the number of bytes remaining or error. -func SeekerLen(s io.Seeker) (int64, error) { - // Determine if the seeker is actually seekable. ReaderSeekerCloser - // hides the fact that a io.Readers might not actually be seekable. - switch v := s.(type) { - case ReaderSeekerCloser: - return v.GetLen() - case *ReaderSeekerCloser: - return v.GetLen() - } - - return seekerLen(s) -} - -func seekerLen(s io.Seeker) (int64, error) { - curOffset, err := s.Seek(0, sdkio.SeekCurrent) - if err != nil { - return 0, err - } - - endOffset, err := s.Seek(0, sdkio.SeekEnd) - if err != nil { - return 0, err - } - - _, err = s.Seek(curOffset, sdkio.SeekStart) - if err != nil { - return 0, err - } - - return endOffset - curOffset, nil -} - -// Close closes the ReaderSeekerCloser. -// -// If the ReaderSeekerCloser is not an io.Closer nothing will be done. -func (r ReaderSeekerCloser) Close() error { - switch t := r.r.(type) { - case io.Closer: - return t.Close() - } - return nil -} - -// A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface -// Can be used with the s3manager.Downloader to download content to a buffer -// in memory. Safe to use concurrently. -type WriteAtBuffer struct { - buf []byte - m sync.Mutex - - // GrowthCoeff defines the growth rate of the internal buffer. By - // default, the growth rate is 1, where expanding the internal - // buffer will allocate only enough capacity to fit the new expected - // length. - GrowthCoeff float64 -} - -// NewWriteAtBuffer creates a WriteAtBuffer with an internal buffer -// provided by buf. -func NewWriteAtBuffer(buf []byte) *WriteAtBuffer { - return &WriteAtBuffer{buf: buf} -} - -// WriteAt writes a slice of bytes to a buffer starting at the position provided -// The number of bytes written will be returned, or error. Can overwrite previous -// written slices if the write ats overlap. -func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) { - pLen := len(p) - expLen := pos + int64(pLen) - b.m.Lock() - defer b.m.Unlock() - if int64(len(b.buf)) < expLen { - if int64(cap(b.buf)) < expLen { - if b.GrowthCoeff < 1 { - b.GrowthCoeff = 1 - } - newBuf := make([]byte, expLen, int64(b.GrowthCoeff*float64(expLen))) - copy(newBuf, b.buf) - b.buf = newBuf - } - b.buf = b.buf[:expLen] - } - copy(b.buf[pos:], p) - return pLen, nil -} - -// Bytes returns a slice of bytes written to the buffer. -func (b *WriteAtBuffer) Bytes() []byte { - b.m.Lock() - defer b.m.Unlock() - return b.buf -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_client.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_client.go deleted file mode 100644 index e0c5fdcb8d65..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_client.go +++ /dev/null @@ -1,105 +0,0 @@ -/* -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 universal - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/client/metadata" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/corehandlers" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/signer/volc" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery" -) - -func New(session *session.Session) *Universal { - return &Universal{ - Session: session, - } -} - -func (u *Universal) newClient(info RequestUniversal) *client.Client { - config := u.Session.ClientConfig(info.ServiceName) - c := client.New( - *config.Config, - metadata.ClientInfo{ - SigningName: config.SigningName, - SigningRegion: config.SigningRegion, - Endpoint: config.Endpoint, - APIVersion: info.Version, - ServiceName: info.ServiceName, - ServiceID: info.ServiceName, - }, - config.Handlers, - ) - c.Handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler) - c.Handlers.Sign.PushBackNamed(volc.SignRequestHandler) - c.Handlers.Build.PushBackNamed(volcenginequery.BuildHandler) - c.Handlers.Unmarshal.PushBackNamed(volcenginequery.UnmarshalHandler) - c.Handlers.UnmarshalMeta.PushBackNamed(volcenginequery.UnmarshalMetaHandler) - c.Handlers.UnmarshalError.PushBackNamed(volcenginequery.UnmarshalErrorHandler) - - return c -} - -func (u *Universal) getMethod(m HttpMethod) string { - switch m { - case GET: - return "GET" - case POST: - return "POST" - case PUT: - return "PUT" - case DELETE: - return "DELETE" - case HEAD: - return "HEAD" - default: - return "GET" - } -} - -func getContentType(m ContentType) string { - switch m { - case ApplicationJSON: - return "application/json" - case FormUrlencoded: - return "x-www-form-urlencoded" - default: - return "" - } -} - -func (u *Universal) DoCall(info RequestUniversal, input *map[string]interface{}) (output *map[string]interface{}, err error) { - c := u.newClient(info) - op := &request.Operation{ - HTTPMethod: u.getMethod(info.HttpMethod), - HTTPPath: "/", - Name: info.Action, - } - if input == nil { - input = &map[string]interface{}{} - } - output = &map[string]interface{}{} - req := c.NewRequest(op, input, output) - - if getContentType(info.ContentType) != "" { - req.HTTPRequest.Header.Set("Content-Type", getContentType(info.ContentType)) - } - err = req.Send() - return output, err -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_const.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_const.go deleted file mode 100644 index 893abf5e8663..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_const.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -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 universal - -type HttpMethod int - -const ( - GET HttpMethod = iota - HEAD - POST - PUT - DELETE -) - -type ContentType int - -const ( - Default ContentType = iota - FormUrlencoded - ApplicationJSON -) diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_struct.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_struct.go deleted file mode 100644 index c66adb18583b..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/universal/universal_struct.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -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 universal - -import "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session" - -type Universal struct { - Session *session.Session -} - -type RequestUniversal struct { - ServiceName string - Action string - Version string - HttpMethod HttpMethod - ContentType ContentType -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/url.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/url.go deleted file mode 100644 index 9c3837ecc18f..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/url.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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 volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "net/url" - -// URLHostname will extract the Hostname without port from the URL value. -// -// Wrapper of net/url#URL.Hostname for backwards Go version compatibility. -func URLHostname(url *url.URL) string { - return url.Hostname() -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/version.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/version.go deleted file mode 100644 index b3a357851d22..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/version.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -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 volcengine provides core functionality for making requests to volcengine services. -package volcengine - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// SDKName is the name of this volcengine SDK -const SDKName = "volcengine-go-sdk" - -// SDKVersion is the version of this SDK -const SDKVersion = "1.0.52" diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginebody/body.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginebody/body.go deleted file mode 100755 index 723ab4f092d9..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginebody/body.go +++ /dev/null @@ -1,140 +0,0 @@ -/* -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 volcenginebody - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/json" - "fmt" - "net/url" - "reflect" - "strings" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/private/protocol/query/queryutil" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -func BodyParam(body *url.Values, r *request.Request) { - var ( - isForm bool - ) - contentType := r.HTTPRequest.Header.Get("Content-Type") - newBody := body - if len(contentType) > 0 && strings.Contains(strings.ToLower(contentType), "x-www-form-urlencoded") { - isForm = true - newBody = &url.Values{} - } - - if !isForm && len(contentType) > 0 { - r.Error = volcengineerr.New("SerializationError", "not support such content-type", nil) - return - } - - if reflect.TypeOf(r.Params) == reflect.TypeOf(&map[string]interface{}{}) { - m := *(r.Params).(*map[string]interface{}) - for k, v := range m { - if reflect.TypeOf(v).String() == "string" { - newBody.Add(k, v.(string)) - } else { - newBody.Add(k, fmt.Sprintf("%v", v)) - } - } - } else if err := queryutil.Parse(*newBody, r.Params, false); err != nil { - r.Error = volcengineerr.New("SerializationError", "failed encoding Query request", err) - return - } - - //extra process - if r.Config.ExtraHttpParameters != nil { - extra := r.Config.ExtraHttpParameters(r.Context()) - if extra != nil { - for k, value := range extra { - newBody.Add(k, value) - } - } - } - if r.Config.ExtraHttpParametersWithMeta != nil { - extra := r.Config.ExtraHttpParametersWithMeta(r.Context(), custom.RequestMetadata{ - ServiceName: r.ClientInfo.ServiceName, - Version: r.ClientInfo.APIVersion, - Action: r.Operation.Name, - HttpMethod: r.Operation.HTTPMethod, - Region: *r.Config.Region, - Request: r.HTTPRequest, - RawQuery: body, - }) - if extra != nil { - for k, value := range extra { - newBody.Add(k, value) - } - } - } - - if isForm { - r.HTTPRequest.URL.RawQuery = body.Encode() - r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") - r.SetBufferBody([]byte(newBody.Encode())) - return - } - - r.Input = volcengineutil.ParameterToMap(body.Encode(), r.Config.LogSensitives, - r.Config.LogLevel.Matches(volcengine.LogInfoWithInputAndOutput) || r.Config.LogLevel.Matches(volcengine.LogDebugWithInputAndOutput)) - - r.HTTPRequest.URL.RawQuery = newBody.Encode() -} - -func BodyJson(body *url.Values, r *request.Request) { - method := strings.ToUpper(r.HTTPRequest.Method) - if v := r.HTTPRequest.Header.Get("Content-Type"); len(v) == 0 { - r.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") - } - - if v := r.HTTPRequest.Header.Get("Content-Type"); !strings.Contains(strings.ToLower(v), "application/json") || method == "GET" { - return - } - - input := make(map[string]interface{}) - b, _ := json.Marshal(r.Params) - _ = json.Unmarshal(b, &input) - if r.Config.ExtraHttpJsonBody != nil { - r.Config.ExtraHttpJsonBody(r.Context(), &input, custom.RequestMetadata{ - ServiceName: r.ClientInfo.ServiceName, - Version: r.ClientInfo.APIVersion, - Action: r.Operation.Name, - HttpMethod: r.Operation.HTTPMethod, - Region: *r.Config.Region, - Request: r.HTTPRequest, - RawQuery: body, - }) - b, _ = json.Marshal(input) - } - r.SetStringBody(string(b)) - - r.HTTPRequest.URL.RawQuery = body.Encode() - r.IsJsonBody = true - - r.Input = volcengineutil.BodyToMap(input, r.Config.LogSensitives, - r.Config.LogLevel.Matches(volcengine.LogInfoWithInputAndOutput) || r.Config.LogLevel.Matches(volcengine.LogDebugWithInputAndOutput)) - r.Params = nil - r.HTTPRequest.Header.Set("Accept", "application/json") -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr/error.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr/error.go deleted file mode 100644 index b3387fa31420..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr/error.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -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 volcengineerr represents API error interface accessors for the SDK. -package volcengineerr - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -// An Error wraps lower level errors with code, message and an original error. -// The underlying concrete error type may also satisfy other interfaces which -// can be to used to obtain more specific information about the error. -// -// Calling Error() or String() will always include the full information about -// an error based on its underlying type. -type Error interface { - // Satisfy the generic error interface. - error - - // Code Returns the short phrase depicting the classification of the error. - Code() string - - // Message Returns the error details message. - Message() string - - // OrigErr Returns the original error if one was set. Nil is returned if not set. - OrigErr() error -} - -// BatchError is a batch of errors which also wraps lower level errors with -// code, message, and original errors. Calling Error() will include all errors -// that occurred in the batch. -// -// Deprecated: Replaced with BatchedErrors. Only defined for backwards -// compatibility. -type BatchError interface { - // Satisfy the generic error interface. - error - - // Code Returns the short phrase depicting the classification of the error. - Code() string - - // Message Returns the error details message. - Message() string - - // OrigErrs Returns the original error if one was set. Nil is returned if not set. - OrigErrs() []error -} - -// BatchedErrors is a batch of errors which also wraps lower level errors with -// code, message, and original errors. Calling Error() will include all errors -// that occurred in the batch. -// -// Replaces BatchError -type BatchedErrors interface { - // Error Satisfy the base Error interface. - Error - - // OrigErrs Returns the original error if one was set. Nil is returned if not set. - OrigErrs() []error -} - -// New returns an Error object described by the code, message, and origErr. -// -// If origErr satisfies the Error interface it will not be wrapped within a new -// Error object and will instead be returned. -func New(code, message string, origErr error) Error { - var errs []error - if origErr != nil { - errs = append(errs, origErr) - } - return newBaseError(code, message, errs) -} - -// NewBatchError returns an BatchedErrors with a collection of errors as an -// array of errors. -func NewBatchError(code, message string, errs []error) BatchedErrors { - return newBaseError(code, message, errs) -} - -// A RequestFailure is an interface to extract request failure information from -// an Error such as the request ID of the failed request returned by a service. -// RequestFailures may not always have a requestID value if the request failed -// prior to reaching the service such as a connection error. -type RequestFailure interface { - Error - - // StatusCode The status code of the HTTP response. - StatusCode() int - - // RequestID The request ID returned by the service for a request failure. This will - // be empty if no request ID is available such as the request failed due - // to a connection error. - RequestID() string -} - -// NewRequestFailure returns a wrapped error with additional information for -// request status code, and service requestID. -// -// Should be used to wrap all request which involve service requests. Even if -// the request failed without a service response, but had an HTTP status code -// that may be meaningful. -func NewRequestFailure(err Error, statusCode int, reqID string, simple ...*bool) RequestFailure { - return newRequestError(err, statusCode, reqID, simple...) -} - -// UnmarshalError provides the interface for the SDK failing to unmarshal data. -type UnmarshalError interface { - volcengineerror - Bytes() []byte -} - -// NewUnmarshalError returns an initialized UnmarshalError error wrapper adding -// the bytes that fail to unmarshal to the error. -func NewUnmarshalError(err error, msg string, bytes []byte) UnmarshalError { - return &unmarshalError{ - volcengineerror: New("UnmarshalError", msg, err), - bytes: bytes, - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr/types.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr/types.go deleted file mode 100644 index af1ae2efbc62..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr/types.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -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 volcengineerr - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/hex" - "fmt" -) - -// SprintError returns a string of the formatted error code. -// -// Both extra and origErr are optional. If they are included their lines -// will be added, but if they are not included their lines will be ignored. -func SprintError(code, message, extra string, origErr error) string { - msg := fmt.Sprintf("%s: %s", code, message) - if extra != "" { - msg = fmt.Sprintf("%s\n\t%s", msg, extra) - } - if origErr != nil { - msg = fmt.Sprintf("%s\ncaused by: %s", msg, origErr.Error()) - } - return msg -} - -// A baseError wraps the code and message which defines an error. It also -// can be used to wrap an original error object. -// -// Should be used as the root for errors satisfying the volcengineerr.Error. Also -// for any error which does not fit into a specific error wrapper type. -type baseError struct { - // Classification of error - code string - - // Detailed information about error - message string - - // Optional original error this error is based off of. Allows building - // chained errors. - errs []error -} - -// newBaseError returns an error object for the code, message, and errors. -// -// code is a short no whitespace phrase depicting the classification of -// the error that is being created. -// -// message is the free flow string containing detailed information about the -// error. -// -// origErrs is the error objects which will be nested under the new errors to -// be returned. -func newBaseError(code, message string, origErrs []error) *baseError { - b := &baseError{ - code: code, - message: message, - errs: origErrs, - } - - return b -} - -// Error returns the string representation of the error. -// -// See ErrorWithExtra for formatting. -// -// Satisfies the error interface. -func (b baseError) Error() string { - size := len(b.errs) - if size > 0 { - return SprintError(b.code, b.message, "", errorList(b.errs)) - } - - return SprintError(b.code, b.message, "", nil) -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (b baseError) String() string { - return b.Error() -} - -// Code returns the short phrase depicting the classification of the error. -func (b baseError) Code() string { - return b.code -} - -// Message returns the error details message. -func (b baseError) Message() string { - return b.message -} - -// OrigErr returns the original error if one was set. Nil is returned if no -// error was set. This only returns the first element in the list. If the full -// list is needed, use BatchedErrors. -func (b baseError) OrigErr() error { - switch len(b.errs) { - case 0: - return nil - case 1: - return b.errs[0] - default: - if err, ok := b.errs[0].(Error); ok { - return NewBatchError(err.Code(), err.Message(), b.errs[1:]) - } - return NewBatchError("BatchedErrors", - "multiple errors occurred", b.errs) - } -} - -// OrigErrs returns the original errors if one was set. An empty slice is -// returned if no error was set. -func (b baseError) OrigErrs() []error { - return b.errs -} - -// So that the Error interface type can be included as an anonymous field -// in the requestError struct and not conflict with the error.Error() method. -type volcengineerror Error - -// A requestError wraps a request or service error. -// -// Composed of baseError for code, message, and original error. -type requestError struct { - volcengineerror - statusCode int - requestID string - bytes []byte - simpleError bool -} - -// newRequestError returns a wrapped error with additional information for -// request status code, and service requestID. -// -// Should be used to wrap all request which involve service requests. Even if -// the request failed without a service response, but had an HTTP status code -// that may be meaningful. -// -// Also wraps original errors via the baseError. -func newRequestError(err Error, statusCode int, requestID string, simple ...*bool) *requestError { - if simple == nil || len(simple) != 1 || simple[0] == nil { - return &requestError{ - volcengineerror: err, - statusCode: statusCode, - requestID: requestID, - } - } - return &requestError{ - volcengineerror: err, - statusCode: statusCode, - requestID: requestID, - simpleError: *simple[0], - } - -} - -// Error returns the string representation of the error. -// Satisfies the error interface. -func (r requestError) Error() string { - if !r.simpleError { - extra := fmt.Sprintf("status code: %d, request id: %s", - r.statusCode, r.requestID) - return SprintError(r.Code(), r.Message(), extra, r.OrigErr()) - } - return r.Code() - -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (r requestError) String() string { - return r.Error() -} - -// StatusCode returns the wrapped status code for the error -func (r requestError) StatusCode() int { - return r.statusCode -} - -// RequestID returns the wrapped requestID -func (r requestError) RequestID() string { - return r.requestID -} - -// OrigErrs returns the original errors if one was set. An empty slice is -// returned if no error was set. -func (r requestError) OrigErrs() []error { - if b, ok := r.volcengineerror.(BatchedErrors); ok { - return b.OrigErrs() - } - return []error{r.OrigErr()} -} - -type unmarshalError struct { - volcengineerror - bytes []byte -} - -// Error returns the string representation of the error. -// Satisfies the error interface. -func (e unmarshalError) Error() string { - extra := hex.Dump(e.bytes) - return SprintError(e.Code(), e.Message(), extra, e.OrigErr()) -} - -// String returns the string representation of the error. -// Alias for Error to satisfy the stringer interface. -func (e unmarshalError) String() string { - return e.Error() -} - -// Bytes returns the bytes that failed to unmarshal. -func (e unmarshalError) Bytes() []byte { - return e.bytes -} - -// An error list that satisfies the golang interface -type errorList []error - -// Error returns the string representation of the error. -// -// Satisfies the error interface. -func (e errorList) Error() string { - msg := "" - // How do we want to handle the array size being zero - if size := len(e); size > 0 { - for i := 0; i < size; i++ { - msg += e[i].Error() - // We check the next index to see if it is within the slice. - // If it is, then we append a newline. We do this, because unit tests - // could be broken with the additional '\n' - if i+1 < size { - msg += "\n" - } - } - } - return msg -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/build.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/build.go deleted file mode 100755 index 7bcc2541a9c6..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/build.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -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 volcenginequery - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "net/url" - "strings" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginebody" -) - -// BuildHandler is a named request handler for building volcenginequery protocol requests -var BuildHandler = request.NamedHandler{Name: "volcenginesdk.volcenginequery.Build", Fn: Build} - -// Build builds a request for a Volcengine Query service. -func Build(r *request.Request) { - body := url.Values{ - "Action": {r.Operation.Name}, - "Version": {r.ClientInfo.APIVersion}, - } - //r.HTTPRequest.Header.Add("Accept", "application/json") - //method := strings.ToUpper(r.HTTPRequest.Method) - - if r.Config.ExtraUserAgent != nil && *r.Config.ExtraUserAgent != "" { - if strings.HasPrefix(*r.Config.ExtraUserAgent, "/") { - request.AddToUserAgent(r, *r.Config.ExtraUserAgent) - } else { - request.AddToUserAgent(r, "/"+*r.Config.ExtraUserAgent) - } - - } - r.HTTPRequest.Host = r.HTTPRequest.URL.Host - v := r.HTTPRequest.Header.Get("Content-Type") - if (strings.ToUpper(r.HTTPRequest.Method) == "PUT" || - strings.ToUpper(r.HTTPRequest.Method) == "POST" || - strings.ToUpper(r.HTTPRequest.Method) == "DELETE" || - strings.ToUpper(r.HTTPRequest.Method) == "PATCH") && - strings.Contains(strings.ToLower(v), "application/json") { - r.HTTPRequest.Header.Set("Content-Type", "application/json; charset=utf-8") - volcenginebody.BodyJson(&body, r) - } else { - volcenginebody.BodyParam(&body, r) - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/unmarshal.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/unmarshal.go deleted file mode 100644 index b4b0f4c2a6d3..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/unmarshal.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -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 volcenginequery - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "reflect" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/special" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil" -) - -// UnmarshalHandler is a named request handler for unmarshaling volcenginequery protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "volcenginesdk.volcenginequery.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling volcenginequery protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "volcenginesdk.volcenginequery.UnmarshalMeta", Fn: UnmarshalMeta} - -// Unmarshal unmarshals a response for an VOLCSTACK Query service. -func Unmarshal(r *request.Request) { - defer r.HTTPResponse.Body.Close() - if r.DataFilled() { - body, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - fmt.Printf("read volcenginebody err, %v\n", err) - r.Error = err - return - } - - var forceJsonNumberDecoder bool - - if r.Config.ForceJsonNumberDecode != nil { - forceJsonNumberDecoder = r.Config.ForceJsonNumberDecode(r.Context(), r.MergeRequestInfo()) - } - - if reflect.TypeOf(r.Data) == reflect.TypeOf(&map[string]interface{}{}) { - if err = json.Unmarshal(body, &r.Data); err != nil || forceJsonNumberDecoder { - //try next - decoder := json.NewDecoder(bytes.NewReader(body)) - decoder.UseNumber() - if err = decoder.Decode(&r.Data); err != nil { - fmt.Printf("Unmarshal err, %v\n", err) - r.Error = err - return - } - } - var info interface{} - - ptr := r.Data.(*map[string]interface{}) - info, err = volcengineutil.ObtainSdkValue("ResponseMetadata.Error.Code", *ptr) - if err != nil { - r.Error = err - return - } - if info != nil { - if processBodyError(r, &response.VolcengineResponse{}, body, forceJsonNumberDecoder) { - return - } - } - - } else { - volcengineResponse := response.VolcengineResponse{} - if processBodyError(r, &volcengineResponse, body, forceJsonNumberDecoder) { - return - } - - if _, ok := reflect.TypeOf(r.Data).Elem().FieldByName("Metadata"); ok { - if volcengineResponse.ResponseMetadata != nil { - volcengineResponse.ResponseMetadata.HTTPCode = r.HTTPResponse.StatusCode - } - r.Metadata = *(volcengineResponse.ResponseMetadata) - reflect.ValueOf(r.Data).Elem().FieldByName("Metadata").Set(reflect.ValueOf(volcengineResponse.ResponseMetadata)) - } - - var ( - b []byte - source interface{} - ) - - if r.Config.CustomerUnmarshalData != nil { - source = r.Config.CustomerUnmarshalData(r.Context(), r.MergeRequestInfo(), volcengineResponse) - } else { - if sp, ok := special.ResponseSpecialMapping()[r.ClientInfo.ServiceName]; ok { - source = sp(volcengineResponse, r.Data) - } else { - source = volcengineResponse.Result - } - } - - if b, err = json.Marshal(source); err != nil { - fmt.Printf("Unmarshal err, %v\n", err) - r.Error = err - return - } - if err = json.Unmarshal(b, &r.Data); err != nil || forceJsonNumberDecoder { - decoder := json.NewDecoder(bytes.NewReader(b)) - decoder.UseNumber() - if err = decoder.Decode(&r.Data); err != nil { - fmt.Printf("Unmarshal err, %v\n", err) - r.Error = err - return - } - } - } - - } -} - -// UnmarshalMeta unmarshals header response values for an VOLCSTACK Query service. -func UnmarshalMeta(r *request.Request) { - -} - -func processBodyError(r *request.Request, volcengineResponse *response.VolcengineResponse, body []byte, forceJsonNumberDecoder bool) bool { - if err := json.Unmarshal(body, &volcengineResponse); err != nil || forceJsonNumberDecoder { - decoder := json.NewDecoder(bytes.NewReader(body)) - decoder.UseNumber() - if err = decoder.Decode(&r.Data); err != nil { - fmt.Printf("Unmarshal err, %v\n", err) - r.Error = err - return true - } - } - if volcengineResponse.ResponseMetadata.Error != nil && volcengineResponse.ResponseMetadata.Error.Code != "" { - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(volcengineResponse.ResponseMetadata.Error.Code, volcengineResponse.ResponseMetadata.Error.Message, nil), - http.StatusBadRequest, - volcengineResponse.ResponseMetadata.RequestId, - ) - processUnmarshalError(unmarshalErrorInfo{ - Request: r, - Response: volcengineResponse, - Body: body, - Err: r.Error, - }) - return true - } - return false -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/unmarshal_error.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/unmarshal_error.go deleted file mode 100755 index 3425f4455af7..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcenginequery/unmarshal_error.go +++ /dev/null @@ -1,135 +0,0 @@ -/* -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 volcenginequery - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "reflect" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/custom" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/request" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/response" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineerr" -) - -// UnmarshalErrorHandler is a name request handler to unmarshal request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "volcenginesdk.volcenginequery.UnmarshalError", Fn: UnmarshalError} - -// UnmarshalError unmarshals an error response for an VOLCSTACK Query service. -func UnmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - processUnmarshalError(unmarshalErrorInfo{ - Request: r, - }) -} - -type unmarshalErrorInfo struct { - Request *request.Request - Response *response.VolcengineResponse - Body []byte - Err error -} - -func processUnmarshalError(info unmarshalErrorInfo) { - var ( - body []byte - err error - ) - r := info.Request - if info.Response == nil && info.Body == nil { - info.Response = &response.VolcengineResponse{} - if r.DataFilled() { - body, err = ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - fmt.Printf("read volcenginebody err, %v\n", err) - r.Error = err - return - } - info.Body = body - if err = json.Unmarshal(body, info.Response); err != nil { - fmt.Printf("Unmarshal err, %v\n", err) - r.Error = err - return - } - } else { - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New("ServiceUnavailableException", "service is unavailable", nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - } - - if r.Config.CustomerUnmarshalError != nil { - customerErr := r.Config.CustomerUnmarshalError(r.Context(), custom.RequestMetadata{ - ServiceName: r.ClientInfo.ServiceName, - Version: r.ClientInfo.APIVersion, - Action: r.Operation.Name, - HttpMethod: r.Operation.HTTPMethod, - Region: *r.Config.Region, - }, *info.Response) - if customerErr != nil { - r.Error = customerErr - return - } - } - - if info.Response.ResponseMetadata == nil { - simple := response.VolcengineSimpleError{} - if err = json.Unmarshal(info.Body, &simple); err != nil { - fmt.Printf("Unmarshal err, %v\n", err) - r.Error = err - return - } - info.Response.ResponseMetadata = &response.ResponseMetadata{ - Error: &response.Error{ - Code: simple.ErrorCode, - Message: simple.Message, - }, - } - return - } - - if info.Err != nil { - r.Error = info.Err - } else { - r.Error = volcengineerr.NewRequestFailure( - volcengineerr.New(info.Response.ResponseMetadata.Error.Code, info.Response.ResponseMetadata.Error.Message, nil), - r.HTTPResponse.StatusCode, - info.Response.ResponseMetadata.RequestId, - r.Config.SimpleError, - ) - } - if reflect.TypeOf(r.Data) != reflect.TypeOf(&map[string]interface{}{}) { - - if _, ok := reflect.TypeOf(r.Data).Elem().FieldByName("Metadata"); ok { - if info.Response.ResponseMetadata != nil { - info.Response.ResponseMetadata.HTTPCode = r.HTTPResponse.StatusCode - } - r.Metadata = *(info.Response.ResponseMetadata) - reflect.ValueOf(r.Data).Elem().FieldByName("Metadata").Set(reflect.ValueOf(info.Response.ResponseMetadata)) - } - } - return - -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/copy.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/copy.go deleted file mode 100644 index 7c23f3f4a87d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/copy.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -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 volcengineutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "io" - "reflect" - "time" -) - -// Copy deeply copies a src structure to dst. Useful for copying request and -// response structures. -// -// Can copy between structs of different type, but will only copy fields which -// are assignable, and exist in both structs. Fields which are not assignable, -// or do not exist in both structs are ignored. -func Copy(dst, src interface{}) { - dstval := reflect.ValueOf(dst) - if !dstval.IsValid() { - panic("Copy dst cannot be nil") - } - - rcopy(dstval, reflect.ValueOf(src), true) -} - -// CopyOf returns a copy of src while also allocating the memory for dst. -// src must be a pointer type or this operation will fail. -func CopyOf(src interface{}) (dst interface{}) { - dsti := reflect.New(reflect.TypeOf(src).Elem()) - dst = dsti.Interface() - rcopy(dsti, reflect.ValueOf(src), true) - return -} - -// rcopy performs a recursive copy of values from the source to destination. -// -// root is used to skip certain aspects of the copy which are not valid -// for the root node of a object. -func rcopy(dst, src reflect.Value, root bool) { - if !src.IsValid() { - return - } - - switch src.Kind() { - case reflect.Ptr: - if _, ok := src.Interface().(io.Reader); ok { - if dst.Kind() == reflect.Ptr && dst.Elem().CanSet() { - dst.Elem().Set(src) - } else if dst.CanSet() { - dst.Set(src) - } - } else { - e := src.Type().Elem() - if dst.CanSet() && !src.IsNil() { - if _, ok := src.Interface().(*time.Time); !ok { - dst.Set(reflect.New(e)) - } else { - tempValue := reflect.New(e) - tempValue.Elem().Set(src.Elem()) - // Sets time.Time's unexported values - dst.Set(tempValue) - } - } - if src.Elem().IsValid() { - // Keep the current root state since the depth hasn't changed - rcopy(dst.Elem(), src.Elem(), root) - } - } - case reflect.Struct: - t := dst.Type() - for i := 0; i < t.NumField(); i++ { - name := t.Field(i).Name - srcVal := src.FieldByName(name) - dstVal := dst.FieldByName(name) - if srcVal.IsValid() && dstVal.CanSet() { - rcopy(dstVal, srcVal, false) - } - } - case reflect.Slice: - if src.IsNil() { - break - } - - s := reflect.MakeSlice(src.Type(), src.Len(), src.Cap()) - dst.Set(s) - for i := 0; i < src.Len(); i++ { - rcopy(dst.Index(i), src.Index(i), false) - } - case reflect.Map: - if src.IsNil() { - break - } - - s := reflect.MakeMap(src.Type()) - dst.Set(s) - for _, k := range src.MapKeys() { - v := src.MapIndex(k) - v2 := reflect.New(v.Type()).Elem() - rcopy(v2, v, false) - dst.SetMapIndex(k, v2) - } - default: - // Assign the value if possible. If its not assignable, the value would - // need to be converted and the impact of that may be unexpected, or is - // not compatible with the dst type. - if src.Type().AssignableTo(dst.Type()) { - dst.Set(src) - } - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/equal.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/equal.go deleted file mode 100644 index 49884f3fd380..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/equal.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 volcengineutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import "reflect" - -// DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. -// In addition to this, this method will also dereference the input values if -// possible so the DeepEqual performed will not fail if one parameter is a -// pointer and the other is not. -// -// DeepEqual will not perform indirection of nested values of the input parameters. -func DeepEqual(a, b interface{}) bool { - ra := reflect.Indirect(reflect.ValueOf(a)) - rb := reflect.Indirect(reflect.ValueOf(b)) - - if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { - // If the elements are both nil, and of the same type they are equal - // If they are of different types they are not equal - return reflect.TypeOf(a) == reflect.TypeOf(b) - } else if raValid != rbValid { - // Both values must be valid to be equal - return false - } - - return reflect.DeepEqual(ra.Interface(), rb.Interface()) -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/path_value.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/path_value.go deleted file mode 100644 index 9db1ce9a3ca7..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/path_value.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -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 volcengineutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "reflect" - "regexp" - "strconv" - "strings" - - "github.com/jmespath/go-jmespath" -) - -var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`) - -// rValuesAtPath returns a slice of values found in value v. The values -// in v are explored recursively so all nested values are collected. -func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTerm bool) []reflect.Value { - pathparts := strings.Split(path, "||") - if len(pathparts) > 1 { - for _, pathpart := range pathparts { - vals := rValuesAtPath(v, pathpart, createPath, caseSensitive, nilTerm) - if len(vals) > 0 { - return vals - } - } - return nil - } - - values := []reflect.Value{reflect.Indirect(reflect.ValueOf(v))} - components := strings.Split(path, ".") - for len(values) > 0 && len(components) > 0 { - var index *int64 - var indexStar bool - c := strings.TrimSpace(components[0]) - if c == "" { // no actual component, illegal syntax - return nil - } else if caseSensitive && c != "*" && strings.ToLower(c[0:1]) == c[0:1] { - // TODO normalize case for user - return nil // don't support unexported fields - } - - // parse this component - if m := indexRe.FindStringSubmatch(c); m != nil { - c = m[1] - if m[2] == "" { - index = nil - indexStar = true - } else { - i, _ := strconv.ParseInt(m[2], 10, 32) - index = &i - indexStar = false - } - } - - nextvals := []reflect.Value{} - for _, value := range values { - // pull component name out of struct member - if value.Kind() != reflect.Struct { - continue - } - - if c == "*" { // pull all members - for i := 0; i < value.NumField(); i++ { - if f := reflect.Indirect(value.Field(i)); f.IsValid() { - nextvals = append(nextvals, f) - } - } - continue - } - - value = value.FieldByNameFunc(func(name string) bool { - if c == name { - return true - } else if !caseSensitive && strings.ToLower(name) == strings.ToLower(c) { - return true - } - return false - }) - - if nilTerm && value.Kind() == reflect.Ptr && len(components[1:]) == 0 { - if !value.IsNil() { - value.Set(reflect.Zero(value.Type())) - } - return []reflect.Value{value} - } - - if createPath && value.Kind() == reflect.Ptr && value.IsNil() { - // TODO if the value is the terminus it should not be created - // if the value to be set to its position is nil. - value.Set(reflect.New(value.Type().Elem())) - value = value.Elem() - } else { - value = reflect.Indirect(value) - } - - if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { - if !createPath && value.IsNil() { - value = reflect.ValueOf(nil) - } - } - - if value.IsValid() { - nextvals = append(nextvals, value) - } - } - values = nextvals - - if indexStar || index != nil { - nextvals = []reflect.Value{} - for _, valItem := range values { - value := reflect.Indirect(valItem) - if value.Kind() != reflect.Slice { - continue - } - - if indexStar { // grab all indices - for i := 0; i < value.Len(); i++ { - idx := reflect.Indirect(value.Index(i)) - if idx.IsValid() { - nextvals = append(nextvals, idx) - } - } - continue - } - - // pull out index - i := int(*index) - if i >= value.Len() { // check out of bounds - if createPath { - // TODO resize slice - } else { - continue - } - } else if i < 0 { // support negative indexing - i = value.Len() + i - } - value = reflect.Indirect(value.Index(i)) - - if value.Kind() == reflect.Slice || value.Kind() == reflect.Map { - if !createPath && value.IsNil() { - value = reflect.ValueOf(nil) - } - } - - if value.IsValid() { - nextvals = append(nextvals, value) - } - } - values = nextvals - } - - components = components[1:] - } - return values -} - -// ValuesAtPath returns a list of values at the case insensitive lexical -// path inside of a structure. -func ValuesAtPath(i interface{}, path string) ([]interface{}, error) { - result, err := jmespath.Search(path, i) - if err != nil { - return nil, err - } - - v := reflect.ValueOf(result) - if !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) { - return nil, nil - } - if s, ok := result.([]interface{}); ok { - return s, err - } - if v.Kind() == reflect.Map && v.Len() == 0 { - return nil, nil - } - if v.Kind() == reflect.Slice { - out := make([]interface{}, v.Len()) - for i := 0; i < v.Len(); i++ { - out[i] = v.Index(i).Interface() - } - return out, nil - } - - return []interface{}{result}, nil -} - -// SetValueAtPath sets a value at the case insensitive lexical path inside -// of a structure. -func SetValueAtPath(i interface{}, path string, v interface{}) { - rvals := rValuesAtPath(i, path, true, false, v == nil) - for _, rval := range rvals { - if rval.Kind() == reflect.Ptr && rval.IsNil() { - continue - } - setValue(rval, v) - } -} - -func setValue(dstVal reflect.Value, src interface{}) { - if dstVal.Kind() == reflect.Ptr { - dstVal = reflect.Indirect(dstVal) - } - srcVal := reflect.ValueOf(src) - - if !srcVal.IsValid() { // src is literal nil - if dstVal.CanAddr() { - // Convert to pointer so that pointer's value can be nil'ed - // dstVal = dstVal.Addr() - } - dstVal.Set(reflect.Zero(dstVal.Type())) - - } else if srcVal.Kind() == reflect.Ptr { - if srcVal.IsNil() { - srcVal = reflect.Zero(dstVal.Type()) - } else { - srcVal = reflect.ValueOf(src).Elem() - } - dstVal.Set(srcVal) - } else { - dstVal.Set(srcVal) - } - -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/prettify.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/prettify.go deleted file mode 100644 index 74b2eb01f506..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/prettify.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -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 volcengineutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "fmt" - "io" - "reflect" - "strings" -) - -// Prettify returns the string representation of a value. -func Prettify(i interface{}) string { - var buf bytes.Buffer - prettify(reflect.ValueOf(i), 0, &buf) - return buf.String() -} - -// prettify will recursively walk value v to build a textual -// representation of the value. -func prettify(v reflect.Value, indent int, buf *bytes.Buffer) { - for v.Kind() == reflect.Ptr { - v = v.Elem() - } - - switch v.Kind() { - case reflect.Struct: - strtype := v.Type().String() - if strtype == "time.Time" { - _, err := fmt.Fprintf(buf, "%s", v.Interface()) - if err != nil { - panic(err) - } - break - } else if strings.HasPrefix(strtype, "io.") { - buf.WriteString("") - break - } - - buf.WriteString("{\n") - - var names []string - for i := 0; i < v.Type().NumField(); i++ { - name := v.Type().Field(i).Name - f := v.Field(i) - if name[0:1] == strings.ToLower(name[0:1]) { - continue // ignore unexported fields - } - if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice || f.Kind() == reflect.Map) && f.IsNil() { - continue // ignore unset fields - } - names = append(names, name) - } - - for i, n := range names { - val := v.FieldByName(n) - ft, ok := v.Type().FieldByName(n) - if !ok { - panic(fmt.Sprintf("expected to find field %v on type %v, but was not found", n, v.Type())) - } - - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(n + ": ") - - if tag := ft.Tag.Get("sensitive"); tag == "true" { - buf.WriteString("") - } else { - prettify(val, indent+2, buf) - } - - if i < len(names)-1 { - buf.WriteString(",\n") - } - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - case reflect.Slice: - strtype := v.Type().String() - if strtype == "[]uint8" { - _, err := fmt.Fprintf(buf, " len %d", v.Len()) - if err != nil { - panic(err) - } - break - } - - nl, id, id2 := "", "", "" - if v.Len() > 3 { - nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) - } - buf.WriteString("[" + nl) - for i := 0; i < v.Len(); i++ { - buf.WriteString(id2) - prettify(v.Index(i), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString("," + nl) - } - } - - buf.WriteString(nl + id + "]") - case reflect.Map: - buf.WriteString("{\n") - - for i, k := range v.MapKeys() { - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(k.String() + ": ") - prettify(v.MapIndex(k), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString(",\n") - } - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - default: - if !v.IsValid() { - _, err := fmt.Fprint(buf, "") - if err != nil { - panic(err) - } - return - } - format := "%v" - switch v.Interface().(type) { - case string: - format = "%q" - case io.ReadSeeker, io.Reader: - format = "buffer(%p)" - } - _, err := fmt.Fprintf(buf, format, v.Interface()) - if err != nil { - panic(err) - } - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/string_value.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/string_value.go deleted file mode 100644 index 1acf44b996ad..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/string_value.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -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 volcengineutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "bytes" - "fmt" - "reflect" - "strings" -) - -// StringValue returns the string representation of a value. -// -// Deprecated: Use Prettify instead. -func StringValue(i interface{}) string { - var buf bytes.Buffer - stringValue(reflect.ValueOf(i), 0, &buf) - return buf.String() -} - -func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) { - for v.Kind() == reflect.Ptr { - v = v.Elem() - } - - switch v.Kind() { - case reflect.Struct: - buf.WriteString("{\n") - - for i := 0; i < v.Type().NumField(); i++ { - ft := v.Type().Field(i) - fv := v.Field(i) - - if ft.Name[0:1] == strings.ToLower(ft.Name[0:1]) { - continue // ignore unexported fields - } - if (fv.Kind() == reflect.Ptr || fv.Kind() == reflect.Slice) && fv.IsNil() { - continue // ignore unset fields - } - - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(ft.Name + ": ") - - if tag := ft.Tag.Get("sensitive"); tag == "true" { - buf.WriteString("") - } else { - stringValue(fv, indent+2, buf) - } - - buf.WriteString(",\n") - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - case reflect.Slice: - nl, id, id2 := "", "", "" - if v.Len() > 3 { - nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2) - } - buf.WriteString("[" + nl) - for i := 0; i < v.Len(); i++ { - buf.WriteString(id2) - stringValue(v.Index(i), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString("," + nl) - } - } - - buf.WriteString(nl + id + "]") - case reflect.Map: - buf.WriteString("{\n") - - for i, k := range v.MapKeys() { - buf.WriteString(strings.Repeat(" ", indent+2)) - buf.WriteString(k.String() + ": ") - stringValue(v.MapIndex(k), indent+2, buf) - - if i < v.Len()-1 { - buf.WriteString(",\n") - } - } - - buf.WriteString("\n" + strings.Repeat(" ", indent) + "}") - default: - format := "%v" - switch v.Interface().(type) { - case string: - format = "%q" - } - _, err := fmt.Fprintf(buf, format, v.Interface()) - if err != nil { - panic(err) - } - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/tools.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/tools.go deleted file mode 100755 index 0e4f91d5ad70..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/tools.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -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 volcengineutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -import ( - "fmt" - "reflect" - "strconv" - "strings" -) - -func ObtainSdkValue(keyPattern string, obj interface{}) (interface{}, error) { - keys := strings.Split(keyPattern, ".") - root := obj - for index, k := range keys { - if reflect.ValueOf(root).Kind() == reflect.Map { - root = root.(map[string]interface{})[k] - if root == nil { - return root, nil - } - - } else if reflect.ValueOf(root).Kind() == reflect.Slice { - i, err := strconv.Atoi(k) - if err != nil { - return nil, fmt.Errorf("keyPattern %s index %d must number", keyPattern, index) - } - if len(root.([]interface{})) < i { - return nil, nil - } - root = root.([]interface{})[i] - } - } - return root, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/trans.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/trans.go deleted file mode 100644 index 589f9c5e8a6e..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/trans.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -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 volcengineutil - -import "strings" - -func ParameterToMap(body string, sensitive []string, enable bool) map[string]interface{} { - if !enable { - return nil - } - result := make(map[string]interface{}) - params := strings.Split(body, "&") - for _, param := range params { - values := strings.Split(param, "=") - if values[0] == "Action" || values[0] == "Version" { - continue - } - v := values[1] - if sensitive != nil && len(sensitive) > 0 { - for _, s := range sensitive { - if strings.Contains(values[0], s) { - v = "****" - break - } - } - } - result[values[0]] = v - } - return result -} - -func BodyToMap(input map[string]interface{}, sensitive []string, enable bool) map[string]interface{} { - if !enable { - return nil - } - result := make(map[string]interface{}) -loop: - for k, v := range input { - if len(sensitive) > 0 { - for _, s := range sensitive { - if strings.Contains(k, s) { - v = "****" - result[k] = v - continue loop - } - } - } - var ( - next map[string]interface{} - nextPtr *map[string]interface{} - ok bool - ) - - if next, ok = v.(map[string]interface{}); ok { - result[k] = BodyToMap(next, sensitive, enable) - } else if nextPtr, ok = v.(*map[string]interface{}); ok { - result[k] = BodyToMap(*nextPtr, sensitive, enable) - } else { - result[k] = v - } - } - return result -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/url.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/url.go deleted file mode 100755 index 46455e2122cd..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/volcengineutil/url.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -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 volcengineutil - -// Copy from https://github.com/aws/aws-sdk-go -// May have been modified by Beijing Volcanoengine Technology Ltd. - -type Endpoint struct { - //UseSSL bool - //Locate bool - //UseInternal bool - CustomerEndpoint string - //CustomerDomainIgnoreService bool - -} - -func NewEndpoint() *Endpoint { - return &Endpoint{} -} - -func (c *Endpoint) WithCustomerEndpoint(customerEndpoint string) *Endpoint { - c.CustomerEndpoint = customerEndpoint - return c -} - -type ServiceInfo struct { - Service string - Region string -} - -const ( - endpoint = "open.volcengineapi.com" - //internalUrl = "open.volcengineapi.com" - //http = "http" - //https = "https" -) - -func (c *Endpoint) GetEndpoint() string { - if c.CustomerEndpoint != "" { - return c.CustomerEndpoint - } else { - return endpoint - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_cloud_service.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_cloud_service.go deleted file mode 100644 index 3b60d1c5c813..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_cloud_service.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -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 volcengine - -import ( - "fmt" - "math" - "time" - - "github.com/google/uuid" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/autoscaling" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session" - "k8s.io/klog/v2" -) - -// AutoScalingService is the interface for volcengine auto-scaling service -type AutoScalingService interface { - GetScalingGroupById(groupId string) (*autoscaling.ScalingGroupForDescribeScalingGroupsOutput, error) - ListScalingInstancesByGroupId(groupId string) ([]*autoscaling.ScalingInstanceForDescribeScalingInstancesOutput, error) - GetScalingConfigurationById(configurationId string) (*autoscaling.ScalingConfigurationForDescribeScalingConfigurationsOutput, error) - RemoveInstances(groupId string, instanceIds []string) error - SetAsgTargetSize(groupId string, targetSize int) error - SetAsgDesireCapacity(groupId string, desireCapacity int) error -} - -type autoScalingService struct { - autoscalingClient *autoscaling.AUTOSCALING -} - -func (a *autoScalingService) SetAsgDesireCapacity(groupId string, desireCapacity int) error { - _, err := a.autoscalingClient.ModifyScalingGroupCommon(&map[string]interface{}{ - "ScalingGroupId": groupId, - "DesireInstanceNumber": desireCapacity, - }) - return err -} - -func (a *autoScalingService) SetAsgTargetSize(groupId string, targetSize int) error { - uid, err := uuid.NewUUID() - if err != nil { - return err - } - - resp, err := a.autoscalingClient.CreateScalingPolicyCommon(&map[string]interface{}{ - "AdjustmentType": "TotalCapacity", - "AdjustmentValue": targetSize, - "Cooldown": 0, - "ScalingGroupId": groupId, - "ScalingPolicyName": fmt.Sprintf("autoscaler-autogen-scaling-policy-%s", uid.String()), - "ScalingPolicyType": "Scheduled", - "ScheduledPolicy.LaunchTime": time.Now().Add(2 * time.Minute).UTC().Format("2006-01-02T15:04Z"), - }) - if err != nil { - klog.Errorf("failed to create scaling policy, err: %v", err) - return err - } - - scalingPolicyId := (*resp)["Result"].(map[string]interface{})["ScalingPolicyId"].(string) - klog.Infof("create scaling policy response: %v, scalingPolicyId: %s", resp, scalingPolicyId) - - defer func() { - // delete scaling policy - _, err = a.autoscalingClient.DeleteScalingPolicyCommon(&map[string]interface{}{ - "ScalingPolicyId": scalingPolicyId, - }) - if err != nil { - klog.Warningf("failed to delete scaling policy %s, err: %v", scalingPolicyId, err) - } - }() - - _, err = a.autoscalingClient.EnableScalingPolicyCommon(&map[string]interface{}{ - "ScalingPolicyId": scalingPolicyId, - }) - - if err != nil { - klog.Errorf("failed to enable scaling policy %s, err: %v", scalingPolicyId, err) - return err - } - - return wait.Poll(5*time.Second, 30*time.Minute, func() (bool, error) { - // check scaling group status - group, err := a.GetScalingGroupById(groupId) - if err != nil { - return false, err - } - if *group.DesireInstanceNumber == int32(targetSize) { - return true, nil - } - return false, nil - }) -} - -func (a *autoScalingService) RemoveInstances(groupId string, instanceIds []string) error { - if len(instanceIds) == 0 { - return nil - } - - instanceIdGroups := StringSliceInGroupsOf(instanceIds, 20) - for _, instanceIdGroup := range instanceIdGroups { - _, err := a.autoscalingClient.RemoveInstances(&autoscaling.RemoveInstancesInput{ - ScalingGroupId: volcengine.String(groupId), - InstanceIds: volcengine.StringSlice(instanceIdGroup), - }) - if err != nil { - return err - } - } - - return nil -} - -func (a *autoScalingService) GetScalingConfigurationById(configurationId string) (*autoscaling.ScalingConfigurationForDescribeScalingConfigurationsOutput, error) { - configurations, err := a.autoscalingClient.DescribeScalingConfigurations(&autoscaling.DescribeScalingConfigurationsInput{ - ScalingConfigurationIds: volcengine.StringSlice([]string{configurationId}), - }) - if err != nil { - return nil, err - } - if len(configurations.ScalingConfigurations) == 0 || - volcengine.StringValue(configurations.ScalingConfigurations[0].ScalingConfigurationId) != configurationId { - return nil, fmt.Errorf("scaling configuration %s not found", configurationId) - } - return configurations.ScalingConfigurations[0], nil -} - -func (a *autoScalingService) ListScalingInstancesByGroupId(groupId string) ([]*autoscaling.ScalingInstanceForDescribeScalingInstancesOutput, error) { - req := &autoscaling.DescribeScalingInstancesInput{ - ScalingGroupId: volcengine.String(groupId), - PageSize: volcengine.Int32(50), - PageNumber: volcengine.Int32(1), - } - resp, err := a.autoscalingClient.DescribeScalingInstances(req) - if err != nil { - return nil, err - } - - total := volcengine.Int32Value(resp.TotalCount) - if total <= 50 { - return resp.ScalingInstances, nil - } - - res := make([]*autoscaling.ScalingInstanceForDescribeScalingInstancesOutput, 0) - res = append(res, resp.ScalingInstances...) - totalNumber := math.Ceil(float64(total) / 50) - for i := 2; i <= int(totalNumber); i++ { - req.PageNumber = volcengine.Int32(int32(i)) - resp, err = a.autoscalingClient.DescribeScalingInstances(req) - if err != nil { - return nil, err - } - res = append(res, resp.ScalingInstances...) - } - - return res, nil -} - -func (a *autoScalingService) GetScalingGroupById(groupId string) (*autoscaling.ScalingGroupForDescribeScalingGroupsOutput, error) { - groups, err := a.autoscalingClient.DescribeScalingGroups(&autoscaling.DescribeScalingGroupsInput{ - ScalingGroupIds: volcengine.StringSlice([]string{groupId}), - }) - if err != nil { - return nil, err - } - if len(groups.ScalingGroups) == 0 { - return nil, fmt.Errorf("scaling group %s not found", groupId) - } - return groups.ScalingGroups[0], nil -} - -func newAutoScalingService(cloudConfig *cloudConfig) AutoScalingService { - config := volcengine.NewConfig(). - WithCredentials(credentials.NewStaticCredentials(cloudConfig.getAccessKey(), cloudConfig.getSecretKey(), "")). - WithRegion(cloudConfig.getRegion()). - WithEndpoint(cloudConfig.getEndpoint()) - sess, _ := session.NewSession(config) - client := autoscaling.New(sess) - return &autoScalingService{ - autoscalingClient: client, - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_group.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_group.go deleted file mode 100644 index 5a63690e7529..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_group.go +++ /dev/null @@ -1,216 +0,0 @@ -/* -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 volcengine - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/config" - "k8s.io/klog/v2" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" -) - -// AutoScalingGroup represents a Volcengine 'Auto Scaling Group' which also can be treated as a node group. -type AutoScalingGroup struct { - manager VolcengineManager - asgId string - minInstanceNumber int - maxInstanceNumber int -} - -// MaxSize returns maximum size of the node group. -func (asg *AutoScalingGroup) MaxSize() int { - return asg.maxInstanceNumber -} - -// MinSize returns minimum size of the node group. -func (asg *AutoScalingGroup) MinSize() int { - return asg.minInstanceNumber -} - -// TargetSize returns the current target size of the node group. It is possible that the -// number of nodes in Kubernetes is different at the moment but should be equal -// to Size() once everything stabilizes (new nodes finish startup and registration or -// removed nodes are deleted completely). Implementation required. -func (asg *AutoScalingGroup) TargetSize() (int, error) { - return asg.manager.GetAsgDesireCapacity(asg.asgId) -} - -// IncreaseSize increases the size of the node group. To delete a node you need -// to explicitly name it and use DeleteNode. This function should wait until -// node group size is updated. Implementation required. -func (asg *AutoScalingGroup) IncreaseSize(delta int) error { - if delta <= 0 { - return fmt.Errorf("size increase must be positive") - } - size, err := asg.manager.GetAsgDesireCapacity(asg.asgId) - if err != nil { - return err - } - if size+delta > asg.MaxSize() { - return fmt.Errorf("size increase is too large - desired:%d max:%d", size+delta, asg.MaxSize()) - } - return asg.manager.SetAsgTargetSize(asg.asgId, size+delta) -} - -// DeleteNodes deletes nodes from this node group. Error is returned either on -// failure or if the given node doesn't belong to this node group. This function -// should wait until node group size is updated. Implementation required. -func (asg *AutoScalingGroup) DeleteNodes(nodes []*apiv1.Node) error { - size, err := asg.manager.GetAsgDesireCapacity(asg.asgId) - if err != nil { - klog.Errorf("Failed to get desire capacity for %s: %v", asg.asgId, err) - return err - } - if size <= asg.MinSize() { - klog.Errorf("Failed to delete nodes from %s: min size reached", asg.asgId) - return fmt.Errorf("asg min size reached") - } - - instanceIds := make([]string, 0, len(nodes)) - for _, node := range nodes { - belongs, err := asg.belongs(node) - if err != nil { - return err - } - if !belongs { - return fmt.Errorf("node %s doesn't belong to asg %s", node.Name, asg.asgId) - } - instanceId, err := ecsInstanceFromProviderId(node.Spec.ProviderID) - if err != nil { - return err - } - instanceIds = append(instanceIds, instanceId) - } - return asg.manager.DeleteScalingInstances(asg.asgId, instanceIds) -} - -func (asg *AutoScalingGroup) belongs(node *apiv1.Node) (bool, error) { - instanceId, err := ecsInstanceFromProviderId(node.Spec.ProviderID) - if err != nil { - return false, err - } - targetAsg, err := asg.manager.GetAsgForInstance(instanceId) - if err != nil { - return false, err - } - if targetAsg == nil { - return false, nil - } - return targetAsg.Id() == asg.asgId, nil -} - -// DecreaseTargetSize decreases the target size of the node group. This function -// doesn't permit to delete any existing node and can be used only to reduce the -// request for new nodes that have not been yet fulfilled. Delta should be negative. -// It is assumed that cloud provider will not delete the existing nodes when there -// is an option to just decrease the target. Implementation required. -func (asg *AutoScalingGroup) DecreaseTargetSize(delta int) error { - if delta >= 0 { - return fmt.Errorf("size decrease size must be negative") - } - desireCapacity, err := asg.manager.GetAsgDesireCapacity(asg.asgId) - if err != nil { - klog.Errorf("Failed to get desire capacity for %s: %v", asg.asgId, err) - return err - } - allNodes, err := asg.manager.GetAsgNodes(asg.asgId) - if err != nil { - klog.Errorf("Failed to get nodes for %s: %v", asg.asgId, err) - return err - } - if desireCapacity+delta < len(allNodes) { - return fmt.Errorf("size decrease is too large, need to delete existing node - newDesiredCapacity:%d currentNodes:%d", desireCapacity+delta, len(allNodes)) - } - - return asg.manager.SetAsgDesireCapacity(asg.asgId, desireCapacity+delta) -} - -// Id returns an unique identifier of the node group. -func (asg *AutoScalingGroup) Id() string { - return asg.asgId -} - -// Debug returns a string containing all information regarding this node group. -func (asg *AutoScalingGroup) Debug() string { - return fmt.Sprintf("%s (%d:%d)", asg.Id(), asg.MinSize(), asg.MaxSize()) -} - -// Nodes returns a list of all nodes that belong to this node group. -// It is required that Instance objects returned by this method have Id field set. -// Other fields are optional. -// This list should include also instances that might have not become a kubernetes node yet. -func (asg *AutoScalingGroup) Nodes() ([]cloudprovider.Instance, error) { - nodes, err := asg.manager.GetAsgNodes(asg.asgId) - if err != nil { - return nil, err - } - return nodes, nil -} - -// TemplateNodeInfo returns a schedulerframework.NodeInfo structure of an empty -// (as if just started) node. This will be used in scale-up simulations to -// predict what would a new node look like if a node group was expanded. The returned -// NodeInfo is expected to have a fully populated Node object, with all of the labels, -// capacity and allocatable information as well as all pods that are started on -// the node by default, using manifest (most likely only kube-proxy). Implementation optional. -func (asg *AutoScalingGroup) TemplateNodeInfo() (*schedulerframework.NodeInfo, error) { - template, err := asg.manager.getAsgTemplate(asg.asgId) - if err != nil { - return nil, err - } - node, err := asg.manager.buildNodeFromTemplateName(asg.asgId, template) - if err != nil { - return nil, err - } - nodeInfo := schedulerframework.NewNodeInfo(cloudprovider.BuildKubeProxy(asg.asgId)) - nodeInfo.SetNode(node) - return nodeInfo, nil -} - -// Exist checks if the node group really exists on the cloud provider side. Allows to tell the -// theoretical node group from the real one. Implementation required. -func (asg *AutoScalingGroup) Exist() bool { - return true -} - -// Create creates the node group on the cloud provider side. Implementation optional. -func (asg *AutoScalingGroup) Create() (cloudprovider.NodeGroup, error) { - return nil, cloudprovider.ErrNotImplemented -} - -// Delete deletes the node group on the cloud provider side. -// This will be executed only for autoprovisioned node groups, once their size drops to 0. -// Implementation optional. -func (asg *AutoScalingGroup) Delete() error { - return cloudprovider.ErrNotImplemented -} - -// Autoprovisioned returns true if the node group is autoprovisioned. An autoprovisioned group -// was created by CA and can be deleted when scaled to 0. -func (asg *AutoScalingGroup) Autoprovisioned() bool { - return false -} - -// GetOptions returns NodeGroupAutoscalingOptions that should be used for this particular -// NodeGroup. Returning a nil will result in using default options. -// Implementation optional. -func (asg *AutoScalingGroup) GetOptions(defaults config.NodeGroupAutoscalingOptions) (*config.NodeGroupAutoscalingOptions, error) { - return nil, cloudprovider.ErrNotImplemented -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_groups.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_groups.go deleted file mode 100644 index f8c5274b1bd8..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine_auto_scaling_groups.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -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 volcengine - -import ( - "sync" - "time" - - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/klog/v2" -) - -type autoScalingGroupsCache struct { - registeredAsgs []*AutoScalingGroup - instanceToAsg map[string]*AutoScalingGroup - cacheMutex sync.Mutex - instancesNotInManagedAsg map[string]struct{} - asgService AutoScalingService -} - -func newAutoScalingGroupsCache(asgService AutoScalingService) *autoScalingGroupsCache { - registry := &autoScalingGroupsCache{ - registeredAsgs: make([]*AutoScalingGroup, 0), - instanceToAsg: make(map[string]*AutoScalingGroup), - instancesNotInManagedAsg: make(map[string]struct{}), - asgService: asgService, - } - - go wait.Forever(func() { - registry.cacheMutex.Lock() - defer registry.cacheMutex.Unlock() - if err := registry.regenerateCache(); err != nil { - klog.Errorf("Error while regenerating ASG cache: %v", err) - } - }, time.Hour) - - return registry -} - -func (c *autoScalingGroupsCache) Register(asg *AutoScalingGroup) { - c.cacheMutex.Lock() - defer c.cacheMutex.Unlock() - c.registeredAsgs = append(c.registeredAsgs, asg) -} - -func (c *autoScalingGroupsCache) FindForInstance(instanceId string) (*AutoScalingGroup, error) { - c.cacheMutex.Lock() - defer c.cacheMutex.Unlock() - if asg, found := c.instanceToAsg[instanceId]; found { - return asg, nil - } - if _, found := c.instancesNotInManagedAsg[instanceId]; found { - return nil, nil - } - if err := c.regenerateCache(); err != nil { - return nil, err - } - if asg, found := c.instanceToAsg[instanceId]; found { - return asg, nil - } - - // instance does not belong to any configured ASG - c.instancesNotInManagedAsg[instanceId] = struct{}{} - return nil, nil -} - -func (c *autoScalingGroupsCache) regenerateCache() error { - newCache := make(map[string]*AutoScalingGroup) - for _, asg := range c.registeredAsgs { - instances, err := c.asgService.ListScalingInstancesByGroupId(asg.asgId) - if err != nil { - return err - } - for _, instance := range instances { - newCache[volcengine.StringValue(instance.InstanceId)] = asg - } - } - c.instanceToAsg = newCache - return nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine_cloud_config.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine_cloud_config.go deleted file mode 100644 index bacdd46374d6..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine_cloud_config.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -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 volcengine - -import ( - "os" - - "k8s.io/klog/v2" -) - -const ( - regionId = "REGION_ID" - accessKey = "ACCESS_KEY" - secretKey = "SECRET_KEY" - endpoint = "ENDPOINT" - - defaultEndpoint = "open.volcengineapi.com" -) - -type cloudConfig struct { - regionId string - accessKey string - secretKey string - endpoint string -} - -func (c *cloudConfig) getRegion() string { - return c.regionId -} - -func (c *cloudConfig) getAccessKey() string { - return c.accessKey -} - -func (c *cloudConfig) getSecretKey() string { - return c.secretKey -} - -func (c *cloudConfig) getEndpoint() string { - return c.endpoint -} - -func (c *cloudConfig) validate() bool { - if c.regionId == "" { - c.regionId = os.Getenv(regionId) - } - - if c.accessKey == "" { - c.accessKey = os.Getenv(accessKey) - } - - if c.secretKey == "" { - c.secretKey = os.Getenv(secretKey) - } - - if c.endpoint == "" { - c.endpoint = os.Getenv(endpoint) - } - - if c.endpoint == "" { - c.endpoint = defaultEndpoint - } - - if c.regionId == "" || c.accessKey == "" || c.secretKey == "" || c.endpoint == "" { - klog.V(5).Infof("Failed to get RegionId:%s,AccessKey:%s,SecretKey:%s,Endpoint:%s from cloudConfig and Env\n", c.regionId, c.accessKey, c.secretKey, c.endpoint) - return false - } - - return true -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine_cloud_provider.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine_cloud_provider.go deleted file mode 100644 index 53ad1ec1139d..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine_cloud_provider.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -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 volcengine - -import ( - "fmt" - "io" - "os" - "strings" - - "gopkg.in/gcfg.v1" - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/config" - "k8s.io/autoscaler/cluster-autoscaler/config/dynamic" - "k8s.io/autoscaler/cluster-autoscaler/utils/errors" - "k8s.io/autoscaler/cluster-autoscaler/utils/gpu" - "k8s.io/klog/v2" -) - -// volcengineCloudProvider implements CloudProvider interface. -type volcengineCloudProvider struct { - volcengineManager VolcengineManager - resourceLimiter *cloudprovider.ResourceLimiter - scalingGroups []*AutoScalingGroup -} - -// Name returns name of the cloud provider. -func (v *volcengineCloudProvider) Name() string { - return cloudprovider.VolcengineProviderName -} - -// NodeGroups returns all node groups configured for this cloud provider. -func (v *volcengineCloudProvider) NodeGroups() []cloudprovider.NodeGroup { - result := make([]cloudprovider.NodeGroup, 0, len(v.scalingGroups)) - for _, ng := range v.scalingGroups { - result = append(result, ng) - } - return result -} - -// NodeGroupForNode returns the node group for the given node, nil if the node -// should not be processed by cluster autoscaler, or non-nil error if such -// occurred. Must be implemented. -func (v *volcengineCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error) { - instanceId, err := ecsInstanceFromProviderId(node.Spec.ProviderID) - if err != nil { - return nil, err - } - if len(instanceId) == 0 { - klog.Warningf("Node %v has no providerId", node.Name) - return nil, fmt.Errorf("provider id missing from node: %s", node.Name) - } - return v.volcengineManager.GetAsgForInstance(instanceId) -} - -// HasInstance returns whether the node has corresponding instance in cloud provider, -// true if the node has an instance, false if it no longer exists -func (v *volcengineCloudProvider) HasInstance(node *apiv1.Node) (bool, error) { - return true, cloudprovider.ErrNotImplemented -} - -// Pricing returns pricing model for this cloud provider or error if not available. -// Implementation optional. -func (v *volcengineCloudProvider) Pricing() (cloudprovider.PricingModel, errors.AutoscalerError) { - return nil, cloudprovider.ErrNotImplemented -} - -// GetAvailableMachineTypes get all machine types that can be requested from the cloud provider. -// Implementation optional. -func (v *volcengineCloudProvider) GetAvailableMachineTypes() ([]string, error) { - return []string{}, nil -} - -// NewNodeGroup builds a theoretical node group based on the node definition provided. The node group is not automatically -// created on the cloud provider side. The node group is not returned by NodeGroups() until it is created. -// Implementation optional. -func (v *volcengineCloudProvider) NewNodeGroup(machineType string, labels map[string]string, systemLabels map[string]string, taints []apiv1.Taint, extraResources map[string]resource.Quantity) (cloudprovider.NodeGroup, error) { - return nil, cloudprovider.ErrNotImplemented -} - -// GetResourceLimiter returns struct containing limits (max, min) for resources (cores, memory etc.). -func (v *volcengineCloudProvider) GetResourceLimiter() (*cloudprovider.ResourceLimiter, error) { - return v.resourceLimiter, nil -} - -// GPULabel returns the label added to nodes with GPU resource. -func (v *volcengineCloudProvider) GPULabel() string { - return "" -} - -// GetAvailableGPUTypes return all available GPU types cloud provider supports. -func (v *volcengineCloudProvider) GetAvailableGPUTypes() map[string]struct{} { - return map[string]struct{}{} -} - -// Cleanup cleans up open resources before the cloud provider is destroyed, i.e. go routines etc. -func (v *volcengineCloudProvider) Cleanup() error { - return nil -} - -// Refresh is called before every main loop and can be used to dynamically update cloud provider state. -// In particular the list of node groups returned by NodeGroups can change as a result of CloudProvider.Refresh(). -func (v *volcengineCloudProvider) Refresh() error { - return nil -} - -// GetNodeGpuConfig returns the label, type and resource name for the GPU added to node. If node doesn't have -// any GPUs, it returns nil. -func (v *volcengineCloudProvider) GetNodeGpuConfig(node *apiv1.Node) *cloudprovider.GpuConfig { - return gpu.GetNodeGPUFromCloudProvider(v, node) -} - -func (v *volcengineCloudProvider) addNodeGroup(spec string) error { - group, err := buildScalingGroupFromSpec(v.volcengineManager, spec) - if err != nil { - klog.Errorf("Failed to build scaling group from spec: %v", err) - return err - } - v.addAsg(group) - return nil -} - -func (v *volcengineCloudProvider) addAsg(asg *AutoScalingGroup) { - v.scalingGroups = append(v.scalingGroups, asg) - v.volcengineManager.RegisterAsg(asg) -} - -func buildScalingGroupFromSpec(manager VolcengineManager, spec string) (*AutoScalingGroup, error) { - nodeGroupSpec, err := dynamic.SpecFromString(spec, true) - if err != nil { - return nil, fmt.Errorf("failed to parse node group spec: %v", err) - } - group, err := manager.GetAsgById(nodeGroupSpec.Name) - if err != nil { - klog.Errorf("scaling group %s not exists", nodeGroupSpec.Name) - return nil, err - } - return &AutoScalingGroup{ - manager: manager, - asgId: nodeGroupSpec.Name, - minInstanceNumber: group.minInstanceNumber, - maxInstanceNumber: group.maxInstanceNumber, - }, nil -} - -// BuildVolcengine builds CloudProvider implementation for Volcengine -func BuildVolcengine(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider { - if opts.CloudConfig == "" { - klog.Fatalf("The path to the cloud provider configuration file must be set via the --cloud-config command line parameter") - } - cloudConf, err := readConf(opts.CloudConfig) - if err != nil { - klog.Warningf("Failed to read cloud provider configuration: %v", err) - cloudConf = &cloudConfig{} - } - - if !cloudConf.validate() { - klog.Fatalf("Failed to validate cloud provider configuration: %v", err) - } - - manager, err := CreateVolcengineManager(cloudConf) - if err != nil { - klog.Fatalf("Failed to create volcengine manager: %v", err) - } - - provider, err := buildVolcengineProvider(manager, do, rl) - if err != nil { - klog.Fatalf("Failed to create volcengine cloud provider: %v", err) - } - - return provider -} - -func buildVolcengineProvider(manager VolcengineManager, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) (cloudprovider.CloudProvider, error) { - if !do.StaticDiscoverySpecified() { - return nil, fmt.Errorf("static discovery configuration must be provided for volcengine cloud provider") - } - - provider := &volcengineCloudProvider{ - volcengineManager: manager, - resourceLimiter: rl, - } - - for _, spec := range do.NodeGroupSpecs { - if err := provider.addNodeGroup(spec); err != nil { - klog.Warningf("Failed to add node group from spec %s: %v", spec, err) - return nil, err - } - } - - return provider, nil -} - -func readConf(confFile string) (*cloudConfig, error) { - var conf io.ReadCloser - conf, err := os.Open(confFile) - if err != nil { - return nil, err - } - defer conf.Close() - - var cloudConfig cloudConfig - if err = gcfg.ReadInto(&cloudConfig, conf); err != nil { - return nil, err - } - - return &cloudConfig, nil -} - -func ecsInstanceFromProviderId(providerId string) (string, error) { - if !strings.HasPrefix(providerId, "volcengine://") { - return "", fmt.Errorf("providerId %q doesn't match prefix %q", providerId, "volcengine://") - } - return strings.TrimPrefix(providerId, "volcengine://"), nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine_ecs_cloud_service.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine_ecs_cloud_service.go deleted file mode 100644 index 847537a14211..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine_ecs_cloud_service.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -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 volcengine - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/service/ecs" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/credentials" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine/session" -) - -// EcsService represents the ECS interfaces -type EcsService interface { - GetInstanceTypeById(instanceTypeId string) (*ecs.InstanceTypeForDescribeInstanceTypesOutput, error) -} - -type ecsService struct { - ecsClient *ecs.ECS -} - -// GetInstanceTypeById returns instance type info by given instance type id -func (e *ecsService) GetInstanceTypeById(instanceTypeId string) (*ecs.InstanceTypeForDescribeInstanceTypesOutput, error) { - resp, err := e.ecsClient.DescribeInstanceTypes(&ecs.DescribeInstanceTypesInput{ - InstanceTypeIds: volcengine.StringSlice([]string{instanceTypeId}), - }) - if err != nil { - return nil, err - } - if len(resp.InstanceTypes) == 0 || volcengine.StringValue(resp.InstanceTypes[0].InstanceTypeId) != instanceTypeId { - return nil, fmt.Errorf("instance type %s not found", instanceTypeId) - } - return resp.InstanceTypes[0], nil -} - -func newEcsService(cloudConfig *cloudConfig) EcsService { - config := volcengine.NewConfig(). - WithCredentials(credentials.NewStaticCredentials(cloudConfig.getAccessKey(), cloudConfig.getSecretKey(), "")). - WithRegion(cloudConfig.getRegion()). - WithEndpoint(cloudConfig.getEndpoint()) - sess, _ := session.NewSession(config) - client := ecs.New(sess) - return &ecsService{ - ecsClient: client, - } -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine_manager.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine_manager.go deleted file mode 100644 index beceb1cc90c6..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine_manager.go +++ /dev/null @@ -1,238 +0,0 @@ -/* -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 volcengine - -import ( - "fmt" - "math/rand" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk/volcengine" - "k8s.io/autoscaler/cluster-autoscaler/utils/gpu" - "k8s.io/klog/v2" -) - -// VolcengineManager define the interface that implements Cloud Provider and Node Group -type VolcengineManager interface { - // RegisterAsg registers the given ASG with the manager. - RegisterAsg(asg *AutoScalingGroup) - - // GetAsgForInstance returns the ASG of the given instance. - GetAsgForInstance(instanceId string) (*AutoScalingGroup, error) - - // GetAsgById returns the ASG of the given id. - GetAsgById(id string) (*AutoScalingGroup, error) - - // GetAsgDesireCapacity returns the desired capacity of the given ASG. - GetAsgDesireCapacity(asgId string) (int, error) - - // SetAsgTargetSize sets the target size of the given ASG. - SetAsgTargetSize(asgId string, targetSize int) error - - // DeleteScalingInstances deletes the given instances from the given ASG. - DeleteScalingInstances(asgId string, instanceIds []string) error - - // GetAsgNodes returns the scaling instance ids of the given ASG. - GetAsgNodes(asgId string) ([]cloudprovider.Instance, error) - - // SetAsgDesireCapacity sets the desired capacity of the given ASG. - SetAsgDesireCapacity(groupId string, desireCapacity int) error - - // getAsgTemplate returns the scaling configuration of the given ASG. - getAsgTemplate(groupId string) (*asgTemplate, error) - - // buildNodeFromTemplateName builds a node object from the given template. - buildNodeFromTemplateName(asgName string, template *asgTemplate) (*apiv1.Node, error) -} - -type asgTemplate struct { - vcpu int64 - memInMB int64 - gpu int64 - region string - zone string - instanceType string - tags map[string]string -} - -// volcengineManager handles volcengine service communication. -type volcengineManager struct { - cloudConfig *cloudConfig - asgs *autoScalingGroupsCache - - asgService AutoScalingService - ecsService EcsService -} - -func (v *volcengineManager) SetAsgDesireCapacity(groupId string, desireCapacity int) error { - return v.asgService.SetAsgDesireCapacity(groupId, desireCapacity) -} - -func (v *volcengineManager) GetAsgDesireCapacity(asgId string) (int, error) { - group, err := v.asgService.GetScalingGroupById(asgId) - if err != nil { - klog.Errorf("failed to get scaling group by id %s: %v", asgId, err) - return 0, err - } - return int(volcengine.Int32Value(group.DesireInstanceNumber)), nil -} - -func (v *volcengineManager) SetAsgTargetSize(asgId string, targetSize int) error { - return v.asgService.SetAsgTargetSize(asgId, targetSize) -} - -func (v *volcengineManager) DeleteScalingInstances(asgId string, instanceIds []string) error { - if len(instanceIds) == 0 { - klog.Infof("no instances to delete from scaling group %s", asgId) - return nil - } - klog.Infof("deleting instances %v from scaling group %s", instanceIds, asgId) - return v.asgService.RemoveInstances(asgId, instanceIds) -} - -func (v *volcengineManager) GetAsgNodes(asgId string) ([]cloudprovider.Instance, error) { - scalingInstances, err := v.asgService.ListScalingInstancesByGroupId(asgId) - if err != nil { - return nil, err - } - - instances := make([]cloudprovider.Instance, 0, len(scalingInstances)) - for _, scalingInstance := range scalingInstances { - if scalingInstance.InstanceId == nil { - klog.Warningf("scaling instance has no instance id") - continue - } - - instances = append(instances, cloudprovider.Instance{ - Id: getNodeProviderId(volcengine.StringValue(scalingInstance.InstanceId)), - }) - } - return instances, nil -} - -func getNodeProviderId(instanceId string) string { - return fmt.Sprintf("volcengine://%s", instanceId) -} - -func (v *volcengineManager) getAsgTemplate(groupId string) (*asgTemplate, error) { - group, err := v.asgService.GetScalingGroupById(groupId) - if err != nil { - klog.Errorf("failed to get scaling group by id %s: %v", groupId, err) - return nil, err - } - - configuration, err := v.asgService.GetScalingConfigurationById(volcengine.StringValue(group.ActiveScalingConfigurationId)) - if err != nil { - klog.Errorf("failed to get scaling configuration by id %s: %v", volcengine.StringValue(group.ActiveScalingConfigurationId), err) - return nil, err - } - - instanceType, err := v.ecsService.GetInstanceTypeById(volcengine.StringValue(configuration.InstanceTypes[0])) - if err != nil { - klog.Errorf("failed to get instance type by id %s: %v", volcengine.StringValue(configuration.InstanceTypes[0]), err) - return nil, err - } - - return &asgTemplate{ - vcpu: int64(volcengine.Int32Value(instanceType.Processor.Cpus)), - memInMB: int64(volcengine.Int32Value(instanceType.Memory.Size)), - region: v.cloudConfig.getRegion(), - instanceType: volcengine.StringValue(instanceType.InstanceTypeId), - tags: map[string]string{}, // TODO read tags from configuration - }, nil -} - -func (v *volcengineManager) buildNodeFromTemplateName(asgName string, template *asgTemplate) (*apiv1.Node, error) { - node := apiv1.Node{} - nodeName := fmt.Sprintf("%s-asg-%d", asgName, rand.Int63()) - - node.ObjectMeta = metav1.ObjectMeta{ - Name: nodeName, - SelfLink: fmt.Sprintf("/api/v1/nodes/%s", nodeName), - Labels: map[string]string{}, - } - - node.Status = apiv1.NodeStatus{ - Capacity: apiv1.ResourceList{}, - } - - node.Status.Capacity[apiv1.ResourcePods] = *resource.NewQuantity(110, resource.DecimalSI) - node.Status.Capacity[apiv1.ResourceCPU] = *resource.NewQuantity(template.vcpu, resource.DecimalSI) - node.Status.Capacity[apiv1.ResourceMemory] = *resource.NewQuantity(template.memInMB*1024*1024, resource.DecimalSI) - node.Status.Capacity[gpu.ResourceNvidiaGPU] = *resource.NewQuantity(template.gpu, resource.DecimalSI) - - node.Status.Allocatable = node.Status.Capacity - - node.Labels = cloudprovider.JoinStringMaps(node.Labels, buildGenericLabels(template, nodeName)) - - node.Status.Conditions = cloudprovider.BuildReadyConditions() - return &node, nil -} - -func buildGenericLabels(template *asgTemplate, nodeName string) map[string]string { - result := make(map[string]string) - result[apiv1.LabelArchStable] = cloudprovider.DefaultArch - result[apiv1.LabelOSStable] = cloudprovider.DefaultOS - - result[apiv1.LabelInstanceTypeStable] = template.instanceType - - result[apiv1.LabelTopologyRegion] = template.region - result[apiv1.LabelTopologyZone] = template.zone - result[apiv1.LabelHostname] = nodeName - - // append custom node labels - for key, value := range template.tags { - result[key] = value - } - - return result -} - -func (v *volcengineManager) GetAsgById(id string) (*AutoScalingGroup, error) { - asg, err := v.asgService.GetScalingGroupById(id) - if err != nil { - return nil, err - } - return &AutoScalingGroup{ - manager: v, - asgId: volcengine.StringValue(asg.ScalingGroupId), - minInstanceNumber: int(volcengine.Int32Value(asg.MinInstanceNumber)), - maxInstanceNumber: int(volcengine.Int32Value(asg.MaxInstanceNumber)), - }, nil -} - -func (v *volcengineManager) GetAsgForInstance(instanceId string) (*AutoScalingGroup, error) { - return v.asgs.FindForInstance(instanceId) -} - -func (v *volcengineManager) RegisterAsg(asg *AutoScalingGroup) { - v.asgs.Register(asg) -} - -// CreateVolcengineManager returns the VolcengineManager interface implementation -func CreateVolcengineManager(cloudConfig *cloudConfig) (VolcengineManager, error) { - asgCloudService := newAutoScalingService(cloudConfig) - return &volcengineManager{ - cloudConfig: cloudConfig, - asgs: newAutoScalingGroupsCache(asgCloudService), - asgService: asgCloudService, - ecsService: newEcsService(cloudConfig), - }, nil -} diff --git a/cluster-autoscaler/cloudprovider/volcengine/volcengine_util.go b/cluster-autoscaler/cloudprovider/volcengine/volcengine_util.go deleted file mode 100644 index ee0b337f5bf1..000000000000 --- a/cluster-autoscaler/cloudprovider/volcengine/volcengine_util.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 volcengine - -// StringSliceInGroupsOf split arr into num parts -func StringSliceInGroupsOf(arr []string, num int64) [][]string { - if arr == nil { - return nil - } - sliceLen := int64(len(arr)) - if sliceLen <= num { - return [][]string{arr} - } - var quantity int64 - if sliceLen%num == 0 { - quantity = sliceLen / num - } else { - quantity = (sliceLen / num) + 1 - } - var segments = make([][]string, 0) - var start, end, i int64 - for i = 1; i <= quantity; i++ { - end = i * num - if i != quantity { - segments = append(segments, arr[start:end]) - } else { - segments = append(segments, arr[start:]) - } - start = i * num - } - return segments -} diff --git a/cluster-autoscaler/config/crd/autoscaling.x-k8s.io_provisioningrequests.yaml b/cluster-autoscaler/config/crd/autoscaling.x-k8s.io_provisioningrequests.yaml deleted file mode 100644 index 0f4bbfc20292..000000000000 --- a/cluster-autoscaler/config/crd/autoscaling.x-k8s.io_provisioningrequests.yaml +++ /dev/null @@ -1,225 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.13.0 - name: provisioningrequests.autoscaling.x-k8s.io -spec: - group: autoscaling.x-k8s.io - names: - kind: ProvisioningRequest - listKind: ProvisioningRequestList - plural: provisioningrequests - shortNames: - - provreq - - provreqs - singular: provisioningrequest - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: ProvisioningRequest is a way to express additional capacity that - we would like to provision in the cluster. Cluster Autoscaler can use this - information in its calculations and signal if the capacity is available - in the cluster or actively add capacity if needed. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: 'Spec contains specification of the ProvisioningRequest object. - More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. - The spec is immutable, to make changes to the request users are expected - to delete an existing and create a new object with the corrected fields.' - properties: - parameters: - additionalProperties: - description: Parameter is limited to 255 characters. - maxLength: 255 - type: string - description: Parameters contains all other parameters classes may - require. 'atomic-scale-up.kubernetes.io' supports 'ValidUntilSeconds' - parameter, which should contain a string denoting duration for which - we should retry (measured since creation fo the CR). - maxProperties: 100 - type: object - x-kubernetes-validations: - - message: Value is immutable - rule: self == oldSelf - podSets: - description: PodSets lists groups of pods for which we would like - to provision resources. - items: - description: PodSet represents one group of pods for Provisioning - Request to provision capacity. - properties: - count: - description: Count contains the number of pods that will be - created with a given template. - format: int32 - minimum: 1 - type: integer - podTemplateRef: - description: PodTemplateRef is a reference to a PodTemplate - object that is representing pods that will consume this reservation - (must be within the same namespace). Users need to make sure - that the fields relevant to scheduler (e.g. node selector - tolerations) are consistent between this template and actual - pods consuming the Provisioning Request. - properties: - name: - description: 'Name of the referenced object. More info: - https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names' - maxLength: 253 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - type: string - type: object - required: - - count - - podTemplateRef - type: object - maxItems: 32 - minItems: 1 - type: array - x-kubernetes-validations: - - message: Value is immutable - rule: self == oldSelf - provisioningClassName: - description: 'ProvisioningClassName describes the different modes - of provisioning the resources. Currently there is no support for - ''ProvisioningClass'' objects. Supported values: * check-capacity.kubernetes.io - - check if current cluster state can fullfil this request, do not - reserve the capacity. Users should provide a reference to a valid - PodTemplate object. CA will check if there is enough capacity in - cluster to fulfill the request and put the answer in ''CapacityAvailable'' - condition. * atomic-scale-up.kubernetes.io - provision the resources - in an atomic manner. Users should provide a reference to a valid - PodTemplate object. CA will try to create the VMs in an atomic manner, - clean any partially provisioned VMs and re-try the operation in - a exponential back-off manner. Users can configure the timeout duration - after which the request will fail by ''ValidUntilSeconds'' key in - ''Parameters''. CA will set ''Failed=true'' or ''Provisioned=true'' - condition according to the outcome. * ... - potential other classes - that are specific to the cloud providers. ''kubernetes.io'' suffix - is reserved for the modes defined in Kubernetes projects.' - maxLength: 253 - pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - type: string - x-kubernetes-validations: - - message: Value is immutable - rule: self == oldSelf - required: - - podSets - - provisioningClassName - type: object - status: - description: Status of the ProvisioningRequest. CA constantly reconciles - this field. - properties: - conditions: - description: Conditions represent the observations of a Provisioning - Request's current state. Those will contain information whether - the capacity was found/created or if there were any issues. The - condition types may differ between different provisioning classes. - items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - provisioningClassDetails: - additionalProperties: - description: Detail is limited to 32768 characters. - maxLength: 32768 - type: string - description: ProvisioningClassDetails contains all other values custom - provisioning classes may want to pass to end users. - maxProperties: 64 - type: object - type: object - required: - - spec - type: object - served: true - storage: true - subresources: - status: {} diff --git a/cluster-autoscaler/config/test/config.go b/cluster-autoscaler/config/test/config.go deleted file mode 100644 index c5708ac54efd..000000000000 --- a/cluster-autoscaler/config/test/config.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -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 test - -const ( - // Custom scheduler configs for testing - - // SchedulerConfigNodeResourcesFitDisabled is scheduler config - // with `NodeResourcesFit` plugin disabled - SchedulerConfigNodeResourcesFitDisabled = ` -apiVersion: kubescheduler.config.k8s.io/v1 -kind: KubeSchedulerConfiguration -profiles: -- pluginConfig: - plugins: - multiPoint: - disabled: - - name: NodeResourcesFit - weight: 1 - schedulerName: custom-scheduler` - - // SchedulerConfigTaintTolerationDisabled is scheduler config - // with `TaintToleration` plugin disabled - SchedulerConfigTaintTolerationDisabled = ` -apiVersion: kubescheduler.config.k8s.io/v1 -kind: KubeSchedulerConfiguration -profiles: -- pluginConfig: - plugins: - multiPoint: - disabled: - - name: TaintToleration - weight: 1 - schedulerName: custom-scheduler` - - // SchedulerConfigMinimalCorrect is the minimal - // correct scheduler config - SchedulerConfigMinimalCorrect = ` -apiVersion: kubescheduler.config.k8s.io/v1 -kind: KubeSchedulerConfiguration` - - // SchedulerConfigDecodeErr is the scheduler config - // which throws decoding error when we try to load it - SchedulerConfigDecodeErr = ` -kind: KubeSchedulerConfiguration` - - // SchedulerConfigInvalid is invalid scheduler config - // because we specify percentageOfNodesToScore > 100 - SchedulerConfigInvalid = ` -apiVersion: kubescheduler.config.k8s.io/v1 -kind: KubeSchedulerConfiguration -# percentageOfNodesToScore has to be between 0 and 100 -percentageOfNodesToScore: 130` -) diff --git a/cluster-autoscaler/core/podlistprocessor/clear_tpu_request.go b/cluster-autoscaler/core/podlistprocessor/clear_tpu_request.go deleted file mode 100644 index f26104347eaa..000000000000 --- a/cluster-autoscaler/core/podlistprocessor/clear_tpu_request.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -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 podlistprocessor - -import ( - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/context" - "k8s.io/autoscaler/cluster-autoscaler/utils/tpu" -) - -type clearTpuRequests struct { -} - -// NewClearTPURequestsPodListProcessor creates a PodListProcessor which clears TPU requests in pods -func NewClearTPURequestsPodListProcessor() *clearTpuRequests { - return &clearTpuRequests{} -} - -// Process removes pods' tpu requests -func (p *clearTpuRequests) Process(context *context.AutoscalingContext, pods []*apiv1.Pod) ([]*apiv1.Pod, error) { - return tpu.ClearTPURequests(pods), nil -} - -func (p *clearTpuRequests) CleanUp() { -} diff --git a/cluster-autoscaler/core/podlistprocessor/filter_out_expendable.go b/cluster-autoscaler/core/podlistprocessor/filter_out_expendable.go deleted file mode 100644 index 0ec929814a1a..000000000000 --- a/cluster-autoscaler/core/podlistprocessor/filter_out_expendable.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -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 podlistprocessor - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/context" - core_utils "k8s.io/autoscaler/cluster-autoscaler/core/utils" - caerrors "k8s.io/autoscaler/cluster-autoscaler/utils/errors" - klog "k8s.io/klog/v2" -) - -type filterOutExpendable struct { -} - -// NewFilterOutExpendablePodListProcessor creates a PodListProcessor filtering out expendable pods -func NewFilterOutExpendablePodListProcessor() *filterOutExpendable { - return &filterOutExpendable{} -} - -// Process filters out pods which are expendable and adds pods which is waiting for lower priority pods preemption to the cluster snapshot -func (p *filterOutExpendable) Process(context *context.AutoscalingContext, pods []*apiv1.Pod) ([]*apiv1.Pod, error) { - nodes, err := context.AllNodeLister().List() - if err != nil { - return nil, fmt.Errorf("Failed to list all nodes while filtering expendable pods: %v", err) - } - expendablePodsPriorityCutoff := context.AutoscalingOptions.ExpendablePodsPriorityCutoff - - unschedulablePods, waitingForLowerPriorityPreemption := core_utils.FilterOutExpendableAndSplit(pods, nodes, expendablePodsPriorityCutoff) - if err = p.addPreemptingPodsToSnapshot(waitingForLowerPriorityPreemption, context); err != nil { - klog.Warningf("Failed to add preempting pods to snapshot: %v", err) - return nil, err - } - - return unschedulablePods, nil -} - -// addPreemptingPodsToSnapshot modifies the snapshot simulating scheduling of pods waiting for preemption. -// this is not strictly correct as we are not simulating preemption itself but it matches -// CA logic from before migration to scheduler framework. So let's keep it for now -func (p *filterOutExpendable) addPreemptingPodsToSnapshot(pods []*apiv1.Pod, ctx *context.AutoscalingContext) error { - for _, p := range pods { - if err := ctx.ClusterSnapshot.AddPod(p, p.Status.NominatedNodeName); err != nil { - klog.Errorf("Failed to update snapshot with pod %s/%s waiting for preemption: %v", p.Namespace, p.Name, err) - return caerrors.ToAutoscalerError(caerrors.InternalError, err) - } - } - return nil -} - -func (p *filterOutExpendable) CleanUp() { -} diff --git a/cluster-autoscaler/core/podlistprocessor/filter_out_expendable_test.go b/cluster-autoscaler/core/podlistprocessor/filter_out_expendable_test.go deleted file mode 100644 index 5a286b4276de..000000000000 --- a/cluster-autoscaler/core/podlistprocessor/filter_out_expendable_test.go +++ /dev/null @@ -1,179 +0,0 @@ -/* -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 podlistprocessor - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/config" - "k8s.io/autoscaler/cluster-autoscaler/context" - "k8s.io/autoscaler/cluster-autoscaler/simulator/clustersnapshot" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" -) - -func TestFilterOutExpendable(t *testing.T) { - testCases := []struct { - name string - pods []*apiv1.Pod - wantPods []*apiv1.Pod - wantPodsInSnapshot []*apiv1.Pod - priorityCutoff int - nodes []*apiv1.Node - }{ - { - name: "no pods", - }, - { - name: "single non-expendable pod", - pods: []*apiv1.Pod{ - test.BuildTestPod("p", 1000, 1), - }, - wantPods: []*apiv1.Pod{ - test.BuildTestPod("p", 1000, 1), - }, - }, - { - name: "non-expendable pods with priority >= to cutoff priority", - pods: []*apiv1.Pod{ - test.BuildTestPod("p1", 1000, 1, priority(2)), - test.BuildTestPod("p2", 1000, 1, priority(3)), - }, - wantPods: []*apiv1.Pod{ - test.BuildTestPod("p1", 1000, 1, priority(2)), - test.BuildTestPod("p2", 1000, 1, priority(3)), - }, - priorityCutoff: 2, - }, - { - name: "single expednable pod", - pods: []*apiv1.Pod{ - test.BuildTestPod("p", 1000, 1, priority(2)), - }, - priorityCutoff: 3, - }, - { - name: "single waiting-for-low-priority-preemption pod", - pods: []*apiv1.Pod{ - test.BuildTestPod("p", 1000, 1, nominatedNodeName("node-1")), - }, - nodes: []*apiv1.Node{ - test.BuildTestNode("node-1", 2400, 2400), - }, - wantPodsInSnapshot: []*apiv1.Pod{ - test.BuildTestPod("p", 1000, 1, nominatedNodeName("node-1")), - }, - }, - { - name: "mixed expendable, non-expendable & waiting-for-low-priority-preemption pods", - pods: []*apiv1.Pod{ - test.BuildTestPod("p1", 1000, 1, priority(3)), - test.BuildTestPod("p2", 1000, 1, priority(4)), - test.BuildTestPod("p3", 1000, 1, priority(1)), - test.BuildTestPod("p4", 1000, 1), - test.BuildTestPod("p5", 1000, 1, nominatedNodeName("node-1")), - }, - priorityCutoff: 2, - wantPods: []*apiv1.Pod{ - test.BuildTestPod("p1", 1000, 1, priority(3)), - test.BuildTestPod("p2", 1000, 1, priority(4)), - test.BuildTestPod("p4", 1000, 1), - }, - wantPodsInSnapshot: []*apiv1.Pod{ - test.BuildTestPod("p5", 1000, 1, nominatedNodeName("node-1")), - }, - nodes: []*apiv1.Node{ - test.BuildTestNode("node-1", 2400, 2400), - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - processor := NewFilterOutExpendablePodListProcessor() - snapshot := clustersnapshot.NewBasicClusterSnapshot() - snapshot.AddNodes(tc.nodes) - - pods, err := processor.Process(&context.AutoscalingContext{ - ClusterSnapshot: snapshot, - AutoscalingOptions: config.AutoscalingOptions{ - ExpendablePodsPriorityCutoff: tc.priorityCutoff, - }, - AutoscalingKubeClients: context.AutoscalingKubeClients{ - ListerRegistry: newMockListerRegistry(tc.nodes), - }, - }, tc.pods) - - assert.NoError(t, err) - assert.ElementsMatch(t, tc.wantPods, pods) - - var podsInSnapshot []*apiv1.Pod - nodeInfoLister := snapshot.NodeInfos() - // Get pods in snapshot - for _, n := range tc.nodes { - nodeInfo, err := nodeInfoLister.Get(n.Name) - assert.NoError(t, err) - assert.NotEqual(t, nodeInfo.Pods, nil) - for _, podInfo := range nodeInfo.Pods { - podsInSnapshot = append(podsInSnapshot, podInfo.Pod) - } - } - - assert.ElementsMatch(t, tc.wantPodsInSnapshot, podsInSnapshot) - }) - } -} - -func priority(priority int32) func(*apiv1.Pod) { - return func(pod *apiv1.Pod) { - pod.Spec.Priority = &priority - } -} -func nominatedNodeName(nodeName string) func(*apiv1.Pod) { - return func(pod *apiv1.Pod) { - pod.Status.NominatedNodeName = nodeName - } -} - -type mockListerRegistry struct { - kube_util.ListerRegistry - nodes []*apiv1.Node -} - -func newMockListerRegistry(nodes []*apiv1.Node) *mockListerRegistry { - return &mockListerRegistry{ - nodes: nodes, - } -} - -func (mlr mockListerRegistry) AllNodeLister() kube_util.NodeLister { - return &mockNodeLister{nodes: mlr.nodes} -} - -type mockNodeLister struct { - nodes []*apiv1.Node -} - -func (mnl *mockNodeLister) List() ([]*apiv1.Node, error) { - return mnl.nodes, nil -} -func (mnl *mockNodeLister) Get(name string) (*apiv1.Node, error) { - return nil, fmt.Errorf("Unsupported operation") -} diff --git a/cluster-autoscaler/core/scaledown/actuation/group_deletion_scheduler.go b/cluster-autoscaler/core/scaledown/actuation/group_deletion_scheduler.go deleted file mode 100644 index e8aa9676932e..000000000000 --- a/cluster-autoscaler/core/scaledown/actuation/group_deletion_scheduler.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -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 actuation - -import ( - "sync" - "time" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" - "k8s.io/kubernetes/pkg/scheduler/framework" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/config" - "k8s.io/autoscaler/cluster-autoscaler/context" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/deletiontracker" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/status" - "k8s.io/autoscaler/cluster-autoscaler/metrics" - "k8s.io/autoscaler/cluster-autoscaler/utils/errors" -) - -type batcher interface { - AddNodes(nodes []*apiv1.Node, nodeGroup cloudprovider.NodeGroup, drain bool) -} - -// GroupDeletionScheduler is a wrapper over NodeDeletionBatcher responsible for grouping nodes for deletion -// and rolling back deletion of all nodes from a group in case deletion fails for any of the other nodes. -type GroupDeletionScheduler struct { - sync.Mutex - ctx *context.AutoscalingContext - nodeDeletionTracker *deletiontracker.NodeDeletionTracker - nodeDeletionBatcher batcher - evictor Evictor - nodeQueue map[string][]*apiv1.Node - failuresForGroup map[string]bool -} - -// NewGroupDeletionScheduler creates an instance of GroupDeletionScheduler. -func NewGroupDeletionScheduler(ctx *context.AutoscalingContext, ndt *deletiontracker.NodeDeletionTracker, b batcher, evictor Evictor) *GroupDeletionScheduler { - return &GroupDeletionScheduler{ - ctx: ctx, - nodeDeletionTracker: ndt, - nodeDeletionBatcher: b, - evictor: evictor, - nodeQueue: map[string][]*apiv1.Node{}, - failuresForGroup: map[string]bool{}, - } -} - -// ReportMetrics should be invoked for GroupDeletionScheduler before each scale-down phase. -func (ds *GroupDeletionScheduler) ReportMetrics() { - ds.Lock() - defer ds.Unlock() - pendingNodeDeletions := 0 - for _, nodes := range ds.nodeQueue { - pendingNodeDeletions += len(nodes) - } - // Since the nodes are deleted asynchronously, it's easier to - // monitor the pending ones at the beginning of the next scale-down phase. - metrics.ObservePendingNodeDeletions(pendingNodeDeletions) -} - -// ScheduleDeletion schedules deletion of the node. Nodes that should be deleted in groups are queued until whole group is scheduled for deletion, -// other nodes are passed over to NodeDeletionBatcher immediately. -func (ds *GroupDeletionScheduler) ScheduleDeletion(nodeInfo *framework.NodeInfo, nodeGroup cloudprovider.NodeGroup, batchSize int, drain bool) { - opts, err := nodeGroup.GetOptions(ds.ctx.NodeGroupDefaults) - if err != nil && err != cloudprovider.ErrNotImplemented { - nodeDeleteResult := status.NodeDeleteResult{ResultType: status.NodeDeleteErrorInternal, Err: errors.NewAutoscalerError(errors.InternalError, "GetOptions returned error %v", err)} - ds.AbortNodeDeletion(nodeInfo.Node(), nodeGroup.Id(), drain, "failed to get autoscaling options for a node group", nodeDeleteResult) - return - } - if opts == nil { - opts = &config.NodeGroupAutoscalingOptions{} - } - - nodeDeleteResult := ds.prepareNodeForDeletion(nodeInfo, drain) - if nodeDeleteResult.Err != nil { - ds.AbortNodeDeletion(nodeInfo.Node(), nodeGroup.Id(), drain, "prepareNodeForDeletion failed", nodeDeleteResult) - return - } - - ds.addToBatcher(nodeInfo, nodeGroup, batchSize, drain, opts.ZeroOrMaxNodeScaling) -} - -// prepareNodeForDeletion is a long-running operation, so it needs to avoid locking the AtomicDeletionScheduler object -func (ds *GroupDeletionScheduler) prepareNodeForDeletion(nodeInfo *framework.NodeInfo, drain bool) status.NodeDeleteResult { - node := nodeInfo.Node() - if drain { - if evictionResults, err := ds.evictor.DrainNode(ds.ctx, nodeInfo); err != nil { - return status.NodeDeleteResult{ResultType: status.NodeDeleteErrorFailedToEvictPods, Err: err, PodEvictionResults: evictionResults} - } - } else { - if err := ds.evictor.EvictDaemonSetPods(ds.ctx, nodeInfo, time.Now()); err != nil { - // Evicting DS pods is best-effort, so proceed with the deletion even if there are errors. - klog.Warningf("Error while evicting DS pods from an empty node %q: %v", node.Name, err) - } - } - if err := WaitForDelayDeletion(node, ds.ctx.ListerRegistry.AllNodeLister(), ds.ctx.AutoscalingOptions.NodeDeletionDelayTimeout); err != nil { - return status.NodeDeleteResult{ResultType: status.NodeDeleteErrorFailedToDelete, Err: err} - } - return status.NodeDeleteResult{ResultType: status.NodeDeleteOk} -} - -func (ds *GroupDeletionScheduler) addToBatcher(nodeInfo *framework.NodeInfo, nodeGroup cloudprovider.NodeGroup, batchSize int, drain, atomic bool) { - ds.Lock() - defer ds.Unlock() - ds.nodeQueue[nodeGroup.Id()] = append(ds.nodeQueue[nodeGroup.Id()], nodeInfo.Node()) - if atomic { - if ds.failuresForGroup[nodeGroup.Id()] { - nodeDeleteResult := status.NodeDeleteResult{ResultType: status.NodeDeleteErrorFailedToDelete, Err: errors.NewAutoscalerError(errors.TransientError, "couldn't scale down other nodes in this node group")} - CleanUpAndRecordFailedScaleDownEvent(ds.ctx, nodeInfo.Node(), nodeGroup.Id(), drain, ds.nodeDeletionTracker, "scale down failed for node group as a whole", nodeDeleteResult) - delete(ds.nodeQueue, nodeGroup.Id()) - } - if len(ds.nodeQueue[nodeGroup.Id()]) < batchSize { - // node group should be scaled down atomically, but not all nodes are ready yet - return - } - } - ds.nodeDeletionBatcher.AddNodes(ds.nodeQueue[nodeGroup.Id()], nodeGroup, drain) - ds.nodeQueue[nodeGroup.Id()] = []*apiv1.Node{} -} - -// AbortNodeDeletion frees up a node that couldn't be deleted successfully. If it was a part of a group, the same is applied for other nodes queued for deletion. -func (ds *GroupDeletionScheduler) AbortNodeDeletion(node *apiv1.Node, nodeGroupId string, drain bool, errMsg string, result status.NodeDeleteResult) { - ds.Lock() - defer ds.Unlock() - ds.failuresForGroup[nodeGroupId] = true - CleanUpAndRecordFailedScaleDownEvent(ds.ctx, node, nodeGroupId, drain, ds.nodeDeletionTracker, errMsg, result) - for _, otherNode := range ds.nodeQueue[nodeGroupId] { - if otherNode == node { - continue - } - nodeDeleteResult := status.NodeDeleteResult{ResultType: status.NodeDeleteErrorFailedToDelete, Err: errors.NewAutoscalerError(errors.TransientError, "couldn't scale down other nodes in this node group")} - CleanUpAndRecordFailedScaleDownEvent(ds.ctx, otherNode, nodeGroupId, drain, ds.nodeDeletionTracker, "scale down failed for node group as a whole", nodeDeleteResult) - } - delete(ds.nodeQueue, nodeGroupId) -} diff --git a/cluster-autoscaler/core/scaledown/actuation/group_deletion_scheduler_test.go b/cluster-autoscaler/core/scaledown/actuation/group_deletion_scheduler_test.go deleted file mode 100644 index 8149bb33e234..000000000000 --- a/cluster-autoscaler/core/scaledown/actuation/group_deletion_scheduler_test.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -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 actuation - -import ( - "fmt" - "testing" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - appsv1 "k8s.io/api/apps/v1" - apiv1 "k8s.io/api/core/v1" - policyv1 "k8s.io/api/policy/v1" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - testprovider "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/test" - "k8s.io/autoscaler/cluster-autoscaler/config" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/budgets" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/deletiontracker" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/status" - . "k8s.io/autoscaler/cluster-autoscaler/core/test" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/client-go/kubernetes/fake" - "k8s.io/kubernetes/pkg/scheduler/framework" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" -) - -func TestScheduleDeletion(t *testing.T) { - testNg := testprovider.NewTestNodeGroup("test", 100, 0, 3, true, false, "n1-standard-2", nil, nil) - atomic2 := sizedNodeGroup("atomic-2", 2, true, false) - atomic4 := sizedNodeGroup("atomic-4", 4, true, false) - - testCases := []struct { - name string - toSchedule []*budgets.NodeGroupView - toAbort []*budgets.NodeGroupView - toScheduleAfterAbort []*budgets.NodeGroupView - wantDeleted int - wantNodeDeleteResults map[string]status.NodeDeleteResult - }{ - { - name: "no nodes", - toSchedule: []*budgets.NodeGroupView{}, - }, - { - name: "individual nodes are deleted right away", - toSchedule: generateNodeGroupViewList(testNg, 0, 3), - toAbort: generateNodeGroupViewList(testNg, 3, 6), - toScheduleAfterAbort: generateNodeGroupViewList(testNg, 6, 9), - wantDeleted: 6, - wantNodeDeleteResults: map[string]status.NodeDeleteResult{ - "test-node-3": {ResultType: status.NodeDeleteErrorFailedToDelete, Err: cmpopts.AnyError}, - "test-node-4": {ResultType: status.NodeDeleteErrorFailedToDelete, Err: cmpopts.AnyError}, - "test-node-5": {ResultType: status.NodeDeleteErrorFailedToDelete, Err: cmpopts.AnyError}, - }, - }, - { - name: "whole atomic node groups deleted", - toSchedule: mergeLists( - generateNodeGroupViewList(atomic4, 0, 1), - generateNodeGroupViewList(atomic2, 0, 1), - generateNodeGroupViewList(atomic4, 1, 2), - generateNodeGroupViewList(atomic2, 1, 2), - generateNodeGroupViewList(atomic4, 2, 4), - ), - wantDeleted: 6, - }, - { - name: "atomic node group aborted in the process", - toSchedule: mergeLists( - generateNodeGroupViewList(atomic4, 0, 1), - generateNodeGroupViewList(atomic2, 0, 1), - generateNodeGroupViewList(atomic4, 1, 2), - generateNodeGroupViewList(atomic2, 1, 2), - ), - toAbort: generateNodeGroupViewList(atomic4, 2, 3), - toScheduleAfterAbort: generateNodeGroupViewList(atomic4, 3, 4), - wantDeleted: 2, - wantNodeDeleteResults: map[string]status.NodeDeleteResult{ - "atomic-4-node-0": {ResultType: status.NodeDeleteErrorFailedToDelete, Err: cmpopts.AnyError}, - "atomic-4-node-1": {ResultType: status.NodeDeleteErrorFailedToDelete, Err: cmpopts.AnyError}, - "atomic-4-node-2": {ResultType: status.NodeDeleteErrorFailedToDelete, Err: cmpopts.AnyError}, - "atomic-4-node-3": {ResultType: status.NodeDeleteErrorFailedToDelete, Err: cmpopts.AnyError}, - }, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - provider := testprovider.NewTestCloudProvider(nil, func(nodeGroup string, node string) error { - return nil - }) - for _, bucket := range append(append(tc.toSchedule, tc.toAbort...), tc.toScheduleAfterAbort...) { - bucket.Group.(*testprovider.TestNodeGroup).SetCloudProvider(provider) - provider.InsertNodeGroup(bucket.Group) - for _, node := range bucket.Nodes { - provider.AddNode(bucket.Group.Id(), node) - } - } - - batcher := &countingBatcher{} - tracker := deletiontracker.NewNodeDeletionTracker(0) - opts := config.AutoscalingOptions{} - fakeClient := &fake.Clientset{} - podLister := kube_util.NewTestPodLister([]*apiv1.Pod{}) - pdbLister := kube_util.NewTestPodDisruptionBudgetLister([]*policyv1.PodDisruptionBudget{}) - dsLister, err := kube_util.NewTestDaemonSetLister([]*appsv1.DaemonSet{}) - if err != nil { - t.Fatalf("Couldn't create daemonset lister") - } - registry := kube_util.NewListerRegistry(nil, nil, podLister, pdbLister, dsLister, nil, nil, nil, nil) - ctx, err := NewScaleTestAutoscalingContext(opts, fakeClient, registry, provider, nil, nil) - if err != nil { - t.Fatalf("Couldn't set up autoscaling context: %v", err) - } - scheduler := NewGroupDeletionScheduler(&ctx, tracker, batcher, Evictor{EvictionRetryTime: 0, DsEvictionRetryTime: 0, DsEvictionEmptyNodeTimeout: 0, PodEvictionHeadroom: DefaultPodEvictionHeadroom}) - - if err := scheduleAll(tc.toSchedule, scheduler); err != nil { - t.Fatal(err) - } - for _, bucket := range tc.toAbort { - for _, node := range bucket.Nodes { - nodeDeleteResult := status.NodeDeleteResult{ResultType: status.NodeDeleteErrorFailedToDelete, Err: cmpopts.AnyError} - scheduler.AbortNodeDeletion(node, bucket.Group.Id(), false, "simulated abort", nodeDeleteResult) - } - } - if err := scheduleAll(tc.toScheduleAfterAbort, scheduler); err != nil { - t.Fatal(err) - } - - if batcher.addedNodes != tc.wantDeleted { - t.Errorf("Incorrect number of deleted nodes, want %v but got %v", tc.wantDeleted, batcher.addedNodes) - } - gotDeletionResult, _ := tracker.DeletionResults() - if diff := cmp.Diff(tc.wantNodeDeleteResults, gotDeletionResult, cmpopts.EquateEmpty(), cmpopts.EquateErrors()); diff != "" { - t.Errorf("NodeDeleteResults diff (-want +got):\n%s", diff) - } - }) - } -} - -type countingBatcher struct { - addedNodes int -} - -func (b *countingBatcher) AddNodes(nodes []*apiv1.Node, nodeGroup cloudprovider.NodeGroup, drain bool) { - b.addedNodes += len(nodes) -} - -func scheduleAll(toSchedule []*budgets.NodeGroupView, scheduler *GroupDeletionScheduler) error { - for _, bucket := range toSchedule { - bucketSize, err := bucket.Group.TargetSize() - if err != nil { - return fmt.Errorf("failed to get target size for node group %q: %s", bucket.Group.Id(), err) - } - for _, node := range bucket.Nodes { - scheduler.ScheduleDeletion(infoForNode(node), bucket.Group, bucketSize, false) - } - } - return nil -} - -func infoForNode(n *apiv1.Node) *framework.NodeInfo { - info := schedulerframework.NewNodeInfo() - info.SetNode(n) - return info -} - -func mergeLists(lists ...[]*budgets.NodeGroupView) []*budgets.NodeGroupView { - merged := []*budgets.NodeGroupView{} - for _, l := range lists { - merged = append(merged, l...) - } - return merged -} diff --git a/cluster-autoscaler/core/scaledown/actuation/update_latency_tracker.go b/cluster-autoscaler/core/scaledown/actuation/update_latency_tracker.go deleted file mode 100644 index 99397b8d6a88..000000000000 --- a/cluster-autoscaler/core/scaledown/actuation/update_latency_tracker.go +++ /dev/null @@ -1,148 +0,0 @@ -/* -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 actuation - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/autoscaler/cluster-autoscaler/utils/taints" - "k8s.io/klog/v2" -) - -const sleepDurationWhenPolling = 50 * time.Millisecond -const waitForTaintingTimeoutDuration = 30 * time.Second - -type nodeTaintStartTime struct { - nodeName string - startTime time.Time -} - -// UpdateLatencyTracker can be used to calculate round-trip time between CA and api-server -// when adding ToBeDeletedTaint to nodes -type UpdateLatencyTracker struct { - startTimestamp map[string]time.Time - finishTimestamp map[string]time.Time - remainingNodeCount int - nodeLister kubernetes.NodeLister - // Sends node tainting start timestamps to the tracker - StartTimeChan chan nodeTaintStartTime - sleepDurationWhenPolling time.Duration - // Passing a bool will wait for all the started nodes to get tainted and calculate - // latency based on latencies observed. (If all the nodes did not get tained within - // waitForTaintingTimeoutDuration after passing a bool, latency calculation will be - // aborted and the ResultChan will be closed without returning a value) Closing the - // AwaitOrStopChan without passing any bool will abort the latency calculation. - AwaitOrStopChan chan bool - // Communicate back the measured latency - ResultChan chan time.Duration - // now is used only to make the testing easier - now func() time.Time -} - -// NewUpdateLatencyTracker returns a new NewUpdateLatencyTracker object -func NewUpdateLatencyTracker(nodeLister kubernetes.NodeLister) *UpdateLatencyTracker { - return &UpdateLatencyTracker{ - startTimestamp: map[string]time.Time{}, - finishTimestamp: map[string]time.Time{}, - remainingNodeCount: 0, - nodeLister: nodeLister, - StartTimeChan: make(chan nodeTaintStartTime), - sleepDurationWhenPolling: sleepDurationWhenPolling, - AwaitOrStopChan: make(chan bool), - ResultChan: make(chan time.Duration), - now: time.Now, - } -} - -// Start starts listening for node tainting start timestamps and update the timestamps that -// the taint appears for the first time for a particular node. Listen AwaitOrStopChan for stop/await signals -func (u *UpdateLatencyTracker) Start() { - for { - select { - case _, ok := <-u.AwaitOrStopChan: - if ok { - u.await() - } - return - case ntst := <-u.StartTimeChan: - u.startTimestamp[ntst.nodeName] = ntst.startTime - u.remainingNodeCount += 1 - continue - default: - } - u.updateFinishTime() - time.Sleep(u.sleepDurationWhenPolling) - } -} - -func (u *UpdateLatencyTracker) updateFinishTime() { - for nodeName := range u.startTimestamp { - if _, ok := u.finishTimestamp[nodeName]; ok { - continue - } - node, err := u.nodeLister.Get(nodeName) - if err != nil { - klog.Errorf("Error getting node: %v", err) - continue - } - if taints.HasToBeDeletedTaint(node) { - u.finishTimestamp[node.Name] = u.now() - u.remainingNodeCount -= 1 - } - } -} - -func (u *UpdateLatencyTracker) calculateLatency() time.Duration { - var maxLatency time.Duration = 0 - for node, startTime := range u.startTimestamp { - endTime, _ := u.finishTimestamp[node] - currentLatency := endTime.Sub(startTime) - if currentLatency > maxLatency { - maxLatency = currentLatency - } - } - return maxLatency -} - -func (u *UpdateLatencyTracker) await() { - waitingForTaintingStartTime := time.Now() - for { - switch { - case u.remainingNodeCount == 0: - latency := u.calculateLatency() - u.ResultChan <- latency - return - case time.Now().After(waitingForTaintingStartTime.Add(waitForTaintingTimeoutDuration)): - klog.Errorf("Timeout before tainting all nodes, latency measurement will be stale") - close(u.ResultChan) - return - default: - time.Sleep(u.sleepDurationWhenPolling) - u.updateFinishTime() - } - } -} - -// NewUpdateLatencyTrackerForTesting returns a UpdateLatencyTracker object with -// reduced sleepDurationWhenPolling and mock clock for testing -func NewUpdateLatencyTrackerForTesting(nodeLister kubernetes.NodeLister, now func() time.Time) *UpdateLatencyTracker { - updateLatencyTracker := NewUpdateLatencyTracker(nodeLister) - updateLatencyTracker.now = now - updateLatencyTracker.sleepDurationWhenPolling = time.Millisecond - return updateLatencyTracker -} diff --git a/cluster-autoscaler/core/scaledown/actuation/update_latency_tracker_test.go b/cluster-autoscaler/core/scaledown/actuation/update_latency_tracker_test.go deleted file mode 100644 index da55267186e7..000000000000 --- a/cluster-autoscaler/core/scaledown/actuation/update_latency_tracker_test.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -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 actuation - -import ( - "fmt" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/utils/taints" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" -) - -// mockClock is used to mock time.Now() when testing UpdateLatencyTracker -// For the n th call to Now() it will return a timestamp after duration[n] to -// the startTime if n < the length of durations. Otherwise, it will return current time. -type mockClock struct { - startTime time.Time - durations []time.Duration - index int - mutex sync.Mutex -} - -// Returns a new NewMockClock object -func NewMockClock(startTime time.Time, durations []time.Duration) mockClock { - return mockClock{ - startTime: startTime, - durations: durations, - index: 0, - } -} - -// Returns a time after Nth duration from the start time if N < length of durations. -// Otherwise, returns the current time -func (m *mockClock) Now() time.Time { - m.mutex.Lock() - defer m.mutex.Unlock() - var timeToSend time.Time - if m.index < len(m.durations) { - timeToSend = m.startTime.Add(m.durations[m.index]) - } else { - timeToSend = time.Now() - } - m.index += 1 - return timeToSend -} - -// Returns the number of times that the Now function was called -func (m *mockClock) getIndex() int { - m.mutex.Lock() - defer m.mutex.Unlock() - return m.index -} - -// TestCustomNodeLister can be used to mock nodeLister Get call when testing delayed tainting -type TestCustomNodeLister struct { - nodes map[string]*apiv1.Node - getCallCount map[string]int - nodeTaintAfterNthGetCall map[string]int -} - -// List returns all nodes in test lister. -func (l *TestCustomNodeLister) List() ([]*apiv1.Node, error) { - var nodes []*apiv1.Node - for _, node := range l.nodes { - nodes = append(nodes, node) - } - return nodes, nil -} - -// Get returns node from test lister. Add ToBeDeletedTaint to the node -// during the N th call specified in the nodeTaintAfterNthGetCall -func (l *TestCustomNodeLister) Get(name string) (*apiv1.Node, error) { - for _, node := range l.nodes { - if node.Name == name { - l.getCallCount[node.Name] += 1 - if _, ok := l.nodeTaintAfterNthGetCall[node.Name]; ok && l.getCallCount[node.Name] == l.nodeTaintAfterNthGetCall[node.Name] { - toBeDeletedTaint := apiv1.Taint{Key: taints.ToBeDeletedTaint, Effect: apiv1.TaintEffectNoSchedule} - node.Spec.Taints = append(node.Spec.Taints, toBeDeletedTaint) - } - return node, nil - } - } - return nil, fmt.Errorf("Node %s not found", name) -} - -// Return new TestCustomNodeLister object -func NewTestCustomNodeLister(nodes map[string]*apiv1.Node, nodeTaintAfterNthGetCall map[string]int) *TestCustomNodeLister { - getCallCounts := map[string]int{} - for name := range nodes { - getCallCounts[name] = 0 - } - return &TestCustomNodeLister{ - nodes: nodes, - getCallCount: getCallCounts, - nodeTaintAfterNthGetCall: nodeTaintAfterNthGetCall, - } -} - -func TestUpdateLatencyCalculation(t *testing.T) { - - testCases := []struct { - description string - startTime time.Time - nodes []string - // If an entry is not added for a node, that node will never get tainted - nodeTaintAfterNthGetCall map[string]int - durations []time.Duration - wantLatency time.Duration - wantResultChanOpen bool - }{ - { - description: "latency when tainting a single node - node is tainted in the first call to the lister", - startTime: time.Now(), - nodes: []string{"n1"}, - nodeTaintAfterNthGetCall: map[string]int{"n1": 1}, - durations: []time.Duration{100 * time.Millisecond}, - wantLatency: 100 * time.Millisecond, - wantResultChanOpen: true, - }, - { - description: "latency when tainting a single node - node is not tainted in the first call to the lister", - startTime: time.Now(), - nodes: []string{"n1"}, - nodeTaintAfterNthGetCall: map[string]int{"n1": 3}, - durations: []time.Duration{100 * time.Millisecond}, - wantLatency: 100 * time.Millisecond, - wantResultChanOpen: true, - }, - { - description: "latency when tainting multiple nodes - nodes are tainted in the first calls to the lister", - startTime: time.Now(), - nodes: []string{"n1", "n2"}, - nodeTaintAfterNthGetCall: map[string]int{"n1": 1, "n2": 1}, - durations: []time.Duration{100 * time.Millisecond, 150 * time.Millisecond}, - wantLatency: 150 * time.Millisecond, - wantResultChanOpen: true, - }, - { - description: "latency when tainting multiple nodes - nodes are not tainted in the first calls to the lister", - startTime: time.Now(), - nodes: []string{"n1", "n2"}, - nodeTaintAfterNthGetCall: map[string]int{"n1": 3, "n2": 5}, - durations: []time.Duration{100 * time.Millisecond, 150 * time.Millisecond}, - wantLatency: 150 * time.Millisecond, - wantResultChanOpen: true, - }, - { - description: "Some nodes fails to taint before timeout", - startTime: time.Now(), - nodes: []string{"n1", "n3"}, - nodeTaintAfterNthGetCall: map[string]int{"n1": 1}, - durations: []time.Duration{100 * time.Millisecond, 150 * time.Millisecond}, - wantResultChanOpen: false, - }, - } - - for _, tc := range testCases { - t.Run(tc.description, func(t *testing.T) { - mc := NewMockClock(tc.startTime, tc.durations) - nodes := map[string]*apiv1.Node{} - for _, name := range tc.nodes { - node := test.BuildTestNode(name, 100, 100) - nodes[name] = node - } - nodeLister := NewTestCustomNodeLister(nodes, tc.nodeTaintAfterNthGetCall) - updateLatencyTracker := NewUpdateLatencyTrackerForTesting(nodeLister, mc.Now) - go updateLatencyTracker.Start() - for _, node := range nodes { - updateLatencyTracker.StartTimeChan <- nodeTaintStartTime{node.Name, tc.startTime} - } - updateLatencyTracker.AwaitOrStopChan <- true - latency, ok := <-updateLatencyTracker.ResultChan - assert.Equal(t, tc.wantResultChanOpen, ok) - if ok { - assert.Equal(t, tc.wantLatency, latency) - assert.Equal(t, len(tc.durations), mc.getIndex()) - } - }) - } -} diff --git a/cluster-autoscaler/core/scaledown/budgets/budgets.go b/cluster-autoscaler/core/scaledown/budgets/budgets.go deleted file mode 100644 index 4f2e8f2343b8..000000000000 --- a/cluster-autoscaler/core/scaledown/budgets/budgets.go +++ /dev/null @@ -1,212 +0,0 @@ -/* -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 budgets - -import ( - "reflect" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/context" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown" -) - -// NodeGroupView is a subset of nodes from a given NodeGroup -type NodeGroupView struct { - Group cloudprovider.NodeGroup - Nodes []*apiv1.Node - // BatchSize allows overriding the number of nodes needed to trigger deletion. - // Useful for node groups which only scale between zero and max size. - BatchSize int -} - -// ScaleDownBudgetProcessor is responsible for keeping the number of nodes deleted in parallel within defined limits. -type ScaleDownBudgetProcessor struct { - ctx *context.AutoscalingContext -} - -// NewScaleDownBudgetProcessor creates a ScaleDownBudgetProcessor instance. -func NewScaleDownBudgetProcessor(ctx *context.AutoscalingContext) *ScaleDownBudgetProcessor { - return &ScaleDownBudgetProcessor{ - ctx: ctx, - } -} - -// CropNodes crops the provided node lists to respect scale-down max parallelism budgets. -// The returned nodes are grouped by a node group. -// This function assumes that each node group may occur at most once in each of the "empty" and "drain" lists. -func (bp *ScaleDownBudgetProcessor) CropNodes(as scaledown.ActuationStatus, empty, drain []*apiv1.Node) (emptyToDelete, drainToDelete []*NodeGroupView) { - emptyIndividual, emptyAtomic := bp.categorize(bp.group(empty)) - drainIndividual, drainAtomic := bp.categorize(bp.group(drain)) - - emptyAtomicMap := groupBuckets(emptyAtomic) - drainAtomicMap := groupBuckets(drainAtomic) - - emptyInProgress, drainInProgress := as.DeletionsInProgress() - parallelismBudget := bp.ctx.MaxScaleDownParallelism - len(emptyInProgress) - len(drainInProgress) - drainBudget := bp.ctx.MaxDrainParallelism - len(drainInProgress) - - var err error - canOverflow := true - emptyToDelete, drainToDelete = []*NodeGroupView{}, []*NodeGroupView{} - for _, bucket := range emptyAtomic { - drainNodes := []*apiv1.Node{} - drainBucket, drainFound := drainAtomicMap[bucket.Group.Id()] - if drainFound { - drainNodes = drainBucket.Nodes - } - // For node groups using atomic scaling, skip them if either the total number - // of empty and drain nodes exceeds the parallelism budget, - // or if the number of drain nodes exceeds the drain budget. - if parallelismBudget < len(bucket.Nodes)+len(drainNodes) || - drainBudget < len(drainNodes) { - // One pod slice can sneak in even if it would exceed parallelism budget. - // This is to help avoid starvation of pod slices by regular nodes, - // also larger pod slices will immediately exceed parallelism budget. - if parallelismBudget == 0 || (len(drainNodes) > 0 && drainBudget == 0) || !canOverflow { - break - } - } - var targetSize int - if targetSize, err = bucket.Group.TargetSize(); err != nil { - // Very unlikely to happen, as we've got this far with this group. - klog.Errorf("not scaling atomically scaled group %v: can't get target size, err: %v", bucket.Group.Id(), err) - continue - } - bucket.BatchSize = targetSize - if len(bucket.Nodes)+len(drainNodes) != targetSize { - // We can't only partially scale down atomic group. - klog.Errorf("not scaling atomic group %v because not all nodes are candidates, target size: %v, empty: %v, drainable: %v", bucket.Group.Id(), targetSize, len(bucket.Nodes), len(drainNodes)) - continue - } - emptyToDelete = append(emptyToDelete, bucket) - if drainFound { - drainBucket.BatchSize = bucket.BatchSize - drainToDelete = append(drainToDelete, drainBucket) - } - parallelismBudget -= len(bucket.Nodes) + len(drainNodes) - drainBudget -= len(drainNodes) - canOverflow = false - } - - drainBudget = min(parallelismBudget, drainBudget) - for _, bucket := range drainAtomic { - if _, found := emptyAtomicMap[bucket.Group.Id()]; found { - // This atomically-scaled node group should have been already processed - // in the previous loop. - continue - } - if drainBudget < len(bucket.Nodes) { - // One pod slice can sneak in even if it would exceed parallelism budget. - // This is to help avoid starvation of pod slices by regular nodes, - // also larger pod slices will immediately exceed parallelism budget. - if drainBudget == 0 || !canOverflow { - break - } - } - var targetSize int - if targetSize, err = bucket.Group.TargetSize(); err != nil { - // Very unlikely to happen, as we've got this far with this group. - klog.Errorf("not scaling atomically scaled group %v: can't get target size, err: %v", bucket.Group.Id(), err) - continue - } - bucket.BatchSize = targetSize - if len(bucket.Nodes) != targetSize { - // We can't only partially scale down atomic group. - klog.Errorf("not scaling atomic group %v because not all nodes are candidates, target size: %v, empty: none, drainable: %v", bucket.Group.Id(), targetSize, len(bucket.Nodes)) - continue - } - drainToDelete = append(drainToDelete, bucket) - parallelismBudget -= len(bucket.Nodes) - drainBudget -= len(bucket.Nodes) - canOverflow = false - } - - emptyToDelete, allowedCount := cropIndividualNodes(emptyToDelete, emptyIndividual, parallelismBudget) - parallelismBudget -= allowedCount - drainBudget = min(parallelismBudget, drainBudget) - - drainToDelete, _ = cropIndividualNodes(drainToDelete, drainIndividual, drainBudget) - - return emptyToDelete, drainToDelete -} - -func groupBuckets(buckets []*NodeGroupView) map[string]*NodeGroupView { - grouped := map[string]*NodeGroupView{} - for _, bucket := range buckets { - grouped[bucket.Group.Id()] = bucket - } - return grouped -} - -// cropIndividualNodes returns two values: -// * nodes selected for deletion -// * the number of nodes planned for deletion in this invocation -func cropIndividualNodes(toDelete []*NodeGroupView, groups []*NodeGroupView, budget int) ([]*NodeGroupView, int) { - remainingBudget := budget - for _, bucket := range groups { - if remainingBudget < 1 { - break - } - if remainingBudget < len(bucket.Nodes) { - bucket.Nodes = bucket.Nodes[:remainingBudget] - } - toDelete = append(toDelete, bucket) - remainingBudget -= len(bucket.Nodes) - } - return toDelete, budget - remainingBudget -} - -func (bp *ScaleDownBudgetProcessor) group(nodes []*apiv1.Node) []*NodeGroupView { - groupMap := map[string]int{} - grouped := []*NodeGroupView{} - for _, node := range nodes { - nodeGroup, err := bp.ctx.CloudProvider.NodeGroupForNode(node) - if err != nil || nodeGroup == nil || reflect.ValueOf(nodeGroup).IsNil() { - klog.Errorf("Failed to find node group for %s: %v", node.Name, err) - continue - } - if idx, ok := groupMap[nodeGroup.Id()]; ok { - grouped[idx].Nodes = append(grouped[idx].Nodes, node) - } else { - groupMap[nodeGroup.Id()] = len(grouped) - grouped = append(grouped, &NodeGroupView{ - Group: nodeGroup, - Nodes: []*apiv1.Node{node}, - }) - } - } - return grouped -} - -func (bp *ScaleDownBudgetProcessor) categorize(groups []*NodeGroupView) (individual, atomic []*NodeGroupView) { - for _, view := range groups { - autoscalingOptions, err := view.Group.GetOptions(bp.ctx.NodeGroupDefaults) - if err != nil && err != cloudprovider.ErrNotImplemented { - klog.Errorf("Failed to get autoscaling options for node group %s: %v", view.Group.Id(), err) - continue - } - if autoscalingOptions != nil && autoscalingOptions.ZeroOrMaxNodeScaling { - atomic = append(atomic, view) - } else { - individual = append(individual, view) - } - } - return individual, atomic -} diff --git a/cluster-autoscaler/core/scaledown/budgets/budgets_test.go b/cluster-autoscaler/core/scaledown/budgets/budgets_test.go deleted file mode 100644 index dc03a892db3e..000000000000 --- a/cluster-autoscaler/core/scaledown/budgets/budgets_test.go +++ /dev/null @@ -1,520 +0,0 @@ -/* -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 budgets - -import ( - "fmt" - "testing" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - testprovider "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/test" - "k8s.io/autoscaler/cluster-autoscaler/config" - "k8s.io/autoscaler/cluster-autoscaler/context" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/deletiontracker" -) - -func TestCropNodesToBudgets(t *testing.T) { - testNg := testprovider.NewTestNodeGroup("test-ng", 0, 100, 3, true, false, "n1-standard-2", nil, nil) - testNg2 := testprovider.NewTestNodeGroup("test-ng2", 0, 100, 3, true, false, "n1-standard-2", nil, nil) - atomic3 := sizedNodeGroup("atomic-3", 3, true) - atomic4 := sizedNodeGroup("atomic-4", 4, true) - atomic5 := sizedNodeGroup("atomic-5", 5, true) - atomic8 := sizedNodeGroup("atomic-8", 8, true) - atomic11 := sizedNodeGroup("atomic-11", 11, true) - for tn, tc := range map[string]struct { - emptyDeletionsInProgress int - drainDeletionsInProgress int - empty []*NodeGroupView - drain []*NodeGroupView - wantEmpty []*NodeGroupView - wantDrain []*NodeGroupView - }{ - "no nodes": { - empty: []*NodeGroupView{}, - drain: []*NodeGroupView{}, - wantEmpty: []*NodeGroupView{}, - wantDrain: []*NodeGroupView{}, - }, - // Empty nodes only. - "empty nodes within max limit, no deletions in progress": { - empty: generateNodeGroupViewList(testNg, 0, 10), - wantEmpty: generateNodeGroupViewList(testNg, 0, 10), - }, - "empty nodes exceeding max limit, no deletions in progress": { - empty: generateNodeGroupViewList(testNg, 0, 11), - wantEmpty: generateNodeGroupViewList(testNg, 0, 10), - }, - "empty atomic node group exceeding max limit": { - empty: generateNodeGroupViewList(atomic11, 0, 11), - wantEmpty: generateNodeGroupViewList(atomic11, 0, 11), - }, - "empty regular and atomic": { - empty: append(generateNodeGroupViewList(testNg, 0, 8), generateNodeGroupViewList(atomic3, 0, 3)...), - wantEmpty: append(generateNodeGroupViewList(atomic3, 0, 3), generateNodeGroupViewList(testNg, 0, 7)...), - }, - "multiple empty atomic": { - empty: append( - append( - generateNodeGroupViewList(testNg, 0, 3), - generateNodeGroupViewList(atomic8, 0, 8)...), - generateNodeGroupViewList(atomic3, 0, 3)...), - wantEmpty: append(generateNodeGroupViewList(atomic8, 0, 8), generateNodeGroupViewList(testNg, 0, 2)...), - }, - "empty nodes with deletions in progress, within budget": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 1, - empty: generateNodeGroupViewList(testNg, 0, 8), - wantEmpty: generateNodeGroupViewList(testNg, 0, 8), - }, - "empty nodes with deletions in progress, exceeding budget": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 1, - empty: generateNodeGroupViewList(testNg, 0, 10), - wantEmpty: generateNodeGroupViewList(testNg, 0, 8), - }, - "empty atomic nodes with deletions in progress, exceeding budget": { - emptyDeletionsInProgress: 3, - drainDeletionsInProgress: 3, - empty: generateNodeGroupViewList(atomic8, 0, 8), - wantEmpty: generateNodeGroupViewList(atomic8, 0, 8), - }, - "empty nodes with deletions in progress, 0 budget left": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 5, - empty: generateNodeGroupViewList(testNg, 0, 10), - wantEmpty: []*NodeGroupView{}, - }, - "empty atomic nodes with deletions in progress, 0 budget left": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 5, - empty: generateNodeGroupViewList(atomic3, 0, 3), - wantEmpty: []*NodeGroupView{}, - }, - "empty nodes with deletions in progress, budget exceeded": { - emptyDeletionsInProgress: 50, - drainDeletionsInProgress: 50, - empty: generateNodeGroupViewList(testNg, 0, 10), - wantEmpty: []*NodeGroupView{}, - }, - // Drain nodes only. - "drain nodes within max limit, no deletions in progress": { - drain: generateNodeGroupViewList(testNg, 0, 5), - wantDrain: generateNodeGroupViewList(testNg, 0, 5), - }, - "multiple drain node groups": { - drain: append(generateNodeGroupViewList(testNg, 0, 5), generateNodeGroupViewList(testNg2, 0, 5)...), - wantDrain: generateNodeGroupViewList(testNg, 0, 5), - }, - "drain nodes exceeding max limit, no deletions in progress": { - drain: generateNodeGroupViewList(testNg, 0, 6), - wantDrain: generateNodeGroupViewList(testNg, 0, 5), - }, - "drain atomic exceeding limit": { - drain: generateNodeGroupViewList(atomic8, 0, 8), - wantDrain: generateNodeGroupViewList(atomic8, 0, 8), - }, - "drain regular and atomic exceeding limit": { - drain: append(generateNodeGroupViewList(testNg, 0, 3), generateNodeGroupViewList(atomic3, 0, 3)...), - wantDrain: append(generateNodeGroupViewList(atomic3, 0, 3), generateNodeGroupViewList(testNg, 0, 2)...), - }, - "multiple drain atomic": { - drain: append( - append( - generateNodeGroupViewList(testNg, 0, 3), - generateNodeGroupViewList(atomic3, 0, 3)...), - generateNodeGroupViewList(atomic4, 0, 4)...), - wantDrain: append(generateNodeGroupViewList(atomic3, 0, 3), generateNodeGroupViewList(testNg, 0, 2)...), - }, - "drain nodes with deletions in progress, within budget": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 2, - drain: generateNodeGroupViewList(testNg, 0, 3), - wantDrain: generateNodeGroupViewList(testNg, 0, 3), - }, - "drain nodes with deletions in progress, exceeding drain budget": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 2, - drain: generateNodeGroupViewList(testNg, 0, 5), - wantDrain: generateNodeGroupViewList(testNg, 0, 3), - }, - "drain atomic nodes with deletions in progress, exceeding drain budget": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 2, - drain: generateNodeGroupViewList(atomic4, 0, 4), - wantDrain: generateNodeGroupViewList(atomic4, 0, 4), - }, - "drain nodes with deletions in progress, 0 drain budget left": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 5, - drain: generateNodeGroupViewList(testNg, 0, 5), - wantDrain: []*NodeGroupView{}, - }, - "drain atomic nodes with deletions in progress, 0 drain budget left": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 5, - drain: generateNodeGroupViewList(atomic4, 0, 4), - wantDrain: []*NodeGroupView{}, - }, - "drain nodes with deletions in progress, drain budget exceeded": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 50, - drain: generateNodeGroupViewList(testNg, 0, 5), - wantDrain: []*NodeGroupView{}, - }, - "drain nodes with deletions in progress, exceeding overall budget": { - emptyDeletionsInProgress: 7, - drainDeletionsInProgress: 1, - drain: generateNodeGroupViewList(testNg, 0, 4), - wantDrain: generateNodeGroupViewList(testNg, 0, 2), - }, - "drain nodes with deletions in progress, 0 overall budget left": { - emptyDeletionsInProgress: 10, - drain: generateNodeGroupViewList(testNg, 0, 4), - wantDrain: []*NodeGroupView{}, - }, - "drain nodes with deletions in progress, overall budget exceeded": { - emptyDeletionsInProgress: 50, - drain: generateNodeGroupViewList(testNg, 0, 4), - wantDrain: []*NodeGroupView{}, - }, - // Empty and drain nodes together. - "empty&drain nodes within max limits, no deletions in progress": { - empty: generateNodeGroupViewList(testNg, 0, 5), - drain: generateNodeGroupViewList(testNg, 0, 5), - wantDrain: generateNodeGroupViewList(testNg, 0, 5), - wantEmpty: generateNodeGroupViewList(testNg, 0, 5), - }, - "empty&drain atomic nodes within max limits, no deletions in progress": { - empty: generateNodeGroupViewList(atomic3, 0, 3), - drain: generateNodeGroupViewList(atomic4, 0, 4), - wantEmpty: generateNodeGroupViewList(atomic3, 0, 3), - wantDrain: generateNodeGroupViewList(atomic4, 0, 4), - }, - "empty&drain nodes exceeding overall limit, no deletions in progress": { - empty: generateNodeGroupViewList(testNg, 0, 8), - drain: generateNodeGroupViewList(testNg, 0, 8), - wantDrain: generateNodeGroupViewList(testNg, 0, 2), - wantEmpty: generateNodeGroupViewList(testNg, 0, 8), - }, - "empty&drain atomic nodes exceeding overall limit, no deletions in progress": { - empty: generateNodeGroupViewList(atomic8, 0, 8), - drain: generateNodeGroupViewList(atomic4, 0, 4), - wantEmpty: generateNodeGroupViewList(atomic8, 0, 8), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain atomic nodes in same group within overall limit, no deletions in progress": { - empty: generateNodeGroupViewList(atomic8, 0, 5), - drain: generateNodeGroupViewList(atomic8, 5, 8), - wantEmpty: generateNodeGroupViewList(atomic8, 0, 5), - wantDrain: generateNodeGroupViewList(atomic8, 5, 8), - }, - "empty&drain atomic nodes in same group exceeding overall limit, no deletions in progress": { - empty: generateNodeGroupViewList(atomic11, 0, 8), - drain: generateNodeGroupViewList(atomic11, 8, 11), - wantEmpty: generateNodeGroupViewList(atomic11, 0, 8), - wantDrain: generateNodeGroupViewList(atomic11, 8, 11), - }, - "empty&drain atomic nodes in same group exceeding drain limit, no deletions in progress": { - empty: generateNodeGroupViewList(atomic8, 0, 2), - drain: generateNodeGroupViewList(atomic8, 2, 8), - wantEmpty: generateNodeGroupViewList(atomic8, 0, 2), - wantDrain: generateNodeGroupViewList(atomic8, 2, 8), - }, - "empty&drain atomic nodes in same group not matching node group size, no deletions in progress": { - empty: generateNodeGroupViewList(atomic8, 0, 2), - drain: generateNodeGroupViewList(atomic8, 2, 4), - wantEmpty: []*NodeGroupView{}, - wantDrain: []*NodeGroupView{}, - }, - "empty&drain atomic nodes exceeding drain limit, no deletions in progress": { - empty: generateNodeGroupViewList(atomic4, 0, 4), - drain: generateNodeGroupViewList(atomic8, 0, 8), - wantEmpty: generateNodeGroupViewList(atomic4, 0, 4), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain atomic and regular nodes exceeding drain limit, no deletions in progress": { - empty: append(generateNodeGroupViewList(testNg, 0, 5), generateNodeGroupViewList(atomic3, 0, 3)...), - drain: generateNodeGroupViewList(atomic8, 0, 8), - wantEmpty: append(generateNodeGroupViewList(atomic3, 0, 3), generateNodeGroupViewList(testNg, 0, 5)...), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain regular and atomic nodes in same group exceeding overall limit, no deletions in progress": { - empty: append(generateNodeGroupViewList(testNg, 0, 5), generateNodeGroupViewList(atomic11, 0, 8)...), - drain: generateNodeGroupViewList(atomic11, 8, 11), - wantEmpty: generateNodeGroupViewList(atomic11, 0, 8), - wantDrain: generateNodeGroupViewList(atomic11, 8, 11), - }, - "empty&drain regular and multiple atomic nodes in same group exceeding drain limit, no deletions in progress": { - empty: append(append(generateNodeGroupViewList(testNg, 0, 5), generateNodeGroupViewList(atomic8, 0, 5)...), generateNodeGroupViewList(atomic11, 0, 8)...), - drain: append(generateNodeGroupViewList(atomic11, 8, 11), generateNodeGroupViewList(atomic8, 5, 8)...), - wantEmpty: append(generateNodeGroupViewList(atomic8, 0, 5), generateNodeGroupViewList(testNg, 0, 2)...), - wantDrain: generateNodeGroupViewList(atomic8, 5, 8), - }, - "empty&drain multiple atomic nodes in same group exceeding overall limit, no deletions in progress": { - empty: append(append(generateNodeGroupViewList(atomic3, 0, 3), generateNodeGroupViewList(atomic4, 0, 2)...), generateNodeGroupViewList(atomic11, 0, 11)...), - drain: generateNodeGroupViewList(atomic4, 2, 4), - wantEmpty: append(generateNodeGroupViewList(atomic3, 0, 3), generateNodeGroupViewList(atomic4, 0, 2)...), - wantDrain: generateNodeGroupViewList(atomic4, 2, 4), - }, - "empty regular and drain atomic nodes exceeding overall limit, no deletions in progress": { - drain: generateNodeGroupViewList(atomic8, 0, 8), - empty: generateNodeGroupViewList(testNg, 0, 5), - wantDrain: generateNodeGroupViewList(atomic8, 0, 8), - wantEmpty: generateNodeGroupViewList(testNg, 0, 2), - }, - "empty&drain nodes exceeding drain limit, no deletions in progress": { - empty: generateNodeGroupViewList(testNg, 0, 2), - drain: generateNodeGroupViewList(testNg, 0, 8), - wantDrain: generateNodeGroupViewList(testNg, 0, 5), - wantEmpty: generateNodeGroupViewList(testNg, 0, 2), - }, - "empty&drain nodes with deletions in progress, 0 overall budget left": { - emptyDeletionsInProgress: 10, - empty: generateNodeGroupViewList(testNg, 0, 5), - drain: generateNodeGroupViewList(testNg, 0, 5), - wantEmpty: []*NodeGroupView{}, - wantDrain: []*NodeGroupView{}, - }, - "empty&drain atomic nodes with deletions in progress, 0 overall budget left": { - emptyDeletionsInProgress: 10, - empty: generateNodeGroupViewList(atomic4, 0, 4), - drain: generateNodeGroupViewList(atomic3, 0, 3), - wantEmpty: []*NodeGroupView{}, - wantDrain: []*NodeGroupView{}, - }, - "empty&drain atomic nodes in same group with deletions in progress, 0 overall budget left": { - emptyDeletionsInProgress: 10, - empty: generateNodeGroupViewList(atomic8, 0, 4), - drain: generateNodeGroupViewList(atomic8, 4, 8), - wantEmpty: []*NodeGroupView{}, - wantDrain: []*NodeGroupView{}, - }, - "empty&drain nodes with deletions in progress, overall budget exceeded (shouldn't happen, just a sanity check)": { - emptyDeletionsInProgress: 50, - empty: generateNodeGroupViewList(testNg, 0, 5), - drain: generateNodeGroupViewList(testNg, 0, 5), - wantEmpty: []*NodeGroupView{}, - wantDrain: []*NodeGroupView{}, - }, - "empty&drain nodes with deletions in progress, 0 drain budget left": { - drainDeletionsInProgress: 5, - empty: generateNodeGroupViewList(testNg, 0, 5), - drain: generateNodeGroupViewList(testNg, 0, 5), - wantEmpty: generateNodeGroupViewList(testNg, 0, 5), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain atomic nodes with deletions in progress, 0 drain budget left": { - drainDeletionsInProgress: 5, - empty: generateNodeGroupViewList(atomic4, 0, 4), - drain: generateNodeGroupViewList(atomic3, 0, 3), - wantEmpty: generateNodeGroupViewList(atomic4, 0, 4), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain nodes with deletions in progress, drain budget exceeded (shouldn't happen, just a sanity check)": { - drainDeletionsInProgress: 9, - empty: generateNodeGroupViewList(testNg, 0, 5), - drain: generateNodeGroupViewList(testNg, 0, 5), - wantEmpty: generateNodeGroupViewList(testNg, 0, 1), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain nodes with deletions in progress, overall budget exceeded, only empty nodes fit": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 3, - empty: generateNodeGroupViewList(testNg, 0, 5), - drain: generateNodeGroupViewList(testNg, 0, 2), - wantEmpty: generateNodeGroupViewList(testNg, 0, 2), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain nodes with deletions in progress, overall budget exceeded, both empty&drain nodes fit": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 3, - empty: generateNodeGroupViewList(testNg, 0, 1), - drain: generateNodeGroupViewList(testNg, 0, 2), - wantEmpty: generateNodeGroupViewList(testNg, 0, 1), - wantDrain: generateNodeGroupViewList(testNg, 0, 1), - }, - "empty&drain nodes with deletions in progress, drain budget exceeded": { - emptyDeletionsInProgress: 1, - drainDeletionsInProgress: 3, - empty: generateNodeGroupViewList(testNg, 0, 4), - drain: generateNodeGroupViewList(testNg, 0, 5), - wantEmpty: generateNodeGroupViewList(testNg, 0, 4), - wantDrain: generateNodeGroupViewList(testNg, 0, 2), - }, - "empty&drain atomic nodes with deletions in progress, overall budget exceeded, only empty nodes fit": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 2, - empty: generateNodeGroupViewList(atomic4, 0, 4), - drain: generateNodeGroupViewList(atomic3, 0, 3), - wantEmpty: generateNodeGroupViewList(atomic4, 0, 4), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain atomic nodes in same group with deletions in progress, both empty&drain nodes fit": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 2, - empty: generateNodeGroupViewList(atomic3, 0, 2), - drain: generateNodeGroupViewList(atomic3, 2, 3), - wantEmpty: generateNodeGroupViewList(atomic3, 0, 2), - wantDrain: generateNodeGroupViewList(atomic3, 2, 3), - }, - "empty&drain atomic nodes in same group with deletions in progress, overall budget exceeded, both empty&drain nodes fit": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 2, - empty: generateNodeGroupViewList(atomic8, 0, 6), - drain: generateNodeGroupViewList(atomic8, 6, 8), - wantEmpty: generateNodeGroupViewList(atomic8, 0, 6), - wantDrain: generateNodeGroupViewList(atomic8, 6, 8), - }, - "empty&drain atomic nodes in same group with deletions in progress, drain budget exceeded, both empty&drain nodes fit": { - emptyDeletionsInProgress: 2, - drainDeletionsInProgress: 2, - empty: generateNodeGroupViewList(atomic5, 0, 1), - drain: generateNodeGroupViewList(atomic5, 1, 5), - wantEmpty: generateNodeGroupViewList(atomic5, 0, 1), - wantDrain: generateNodeGroupViewList(atomic5, 1, 5), - }, - "empty&drain regular and atomic nodes with deletions in progress, overall budget exceeded, only empty atomic is deleted": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 2, - empty: append(generateNodeGroupViewList(testNg, 0, 4), generateNodeGroupViewList(atomic4, 0, 4)...), - drain: append(generateNodeGroupViewList(testNg2, 0, 4), generateNodeGroupViewList(atomic3, 0, 3)...), - wantEmpty: generateNodeGroupViewList(atomic4, 0, 4), - wantDrain: []*NodeGroupView{}, - }, - "empty&drain regular and atomic nodes in same group with deletions in progress, overall budget exceeded, both empty&drain atomic nodes fit": { - emptyDeletionsInProgress: 5, - drainDeletionsInProgress: 2, - empty: append(generateNodeGroupViewList(testNg, 0, 4), generateNodeGroupViewList(atomic4, 0, 2)...), - drain: append(generateNodeGroupViewList(testNg2, 0, 4), generateNodeGroupViewList(atomic4, 2, 4)...), - wantEmpty: generateNodeGroupViewList(atomic4, 0, 2), - wantDrain: generateNodeGroupViewList(atomic4, 2, 4), - }, - "empty&drain regular and atomic nodes in same group with deletions in progress, both empty&drain nodes fit": { - emptyDeletionsInProgress: 2, - drainDeletionsInProgress: 2, - empty: append(generateNodeGroupViewList(testNg, 0, 4), generateNodeGroupViewList(atomic4, 0, 2)...), - drain: append(generateNodeGroupViewList(testNg2, 0, 4), generateNodeGroupViewList(atomic4, 2, 4)...), - wantEmpty: append(generateNodeGroupViewList(atomic4, 0, 2), generateNodeGroupViewList(testNg, 0, 2)...), - wantDrain: generateNodeGroupViewList(atomic4, 2, 4), - }, - } { - t.Run(tn, func(t *testing.T) { - provider := testprovider.NewTestCloudProvider(nil, func(nodeGroup string, node string) error { - return nil - }) - for _, bucket := range append(tc.empty, tc.drain...) { - bucket.Group.(*testprovider.TestNodeGroup).SetCloudProvider(provider) - provider.InsertNodeGroup(bucket.Group) - for _, node := range bucket.Nodes { - provider.AddNode(bucket.Group.Id(), node) - } - } - - ctx := &context.AutoscalingContext{ - AutoscalingOptions: config.AutoscalingOptions{ - MaxScaleDownParallelism: 10, - MaxDrainParallelism: 5, - NodeDeletionBatcherInterval: 0 * time.Second, - NodeDeleteDelayAfterTaint: 1 * time.Second, - }, - CloudProvider: provider, - } - ndt := deletiontracker.NewNodeDeletionTracker(1 * time.Hour) - for i := 0; i < tc.emptyDeletionsInProgress; i++ { - ndt.StartDeletion("ng1", fmt.Sprintf("empty-node-%d", i)) - } - for i := 0; i < tc.drainDeletionsInProgress; i++ { - ndt.StartDeletionWithDrain("ng2", fmt.Sprintf("drain-node-%d", i)) - } - emptyList, drainList := []*apiv1.Node{}, []*apiv1.Node{} - for _, bucket := range tc.empty { - emptyList = append(emptyList, bucket.Nodes...) - } - for _, bucket := range tc.drain { - drainList = append(drainList, bucket.Nodes...) - } - - budgeter := NewScaleDownBudgetProcessor(ctx) - gotEmpty, gotDrain := budgeter.CropNodes(ndt, emptyList, drainList) - if diff := cmp.Diff(tc.wantEmpty, gotEmpty, cmpopts.EquateEmpty(), transformNodeGroupView); diff != "" { - t.Errorf("cropNodesToBudgets empty nodes diff (-want +got):\n%s", diff) - } - if diff := cmp.Diff(tc.wantDrain, gotDrain, cmpopts.EquateEmpty(), transformNodeGroupView); diff != "" { - t.Errorf("cropNodesToBudgets drain nodes diff (-want +got):\n%s", diff) - } - }) - } -} - -// transformNodeGroupView transforms a NodeGroupView to a structure that can be directly compared with other node bucket. -var transformNodeGroupView = cmp.Transformer("transformNodeGroupView", func(b NodeGroupView) interface{} { - return struct { - Group string - Nodes []*apiv1.Node - }{ - Group: b.Group.Id(), - Nodes: b.Nodes, - } -}) - -func sizedNodeGroup(id string, size int, atomic bool) cloudprovider.NodeGroup { - ng := testprovider.NewTestNodeGroup(id, 10000, 0, size, true, false, "n1-standard-2", nil, nil) - ng.SetOptions(&config.NodeGroupAutoscalingOptions{ - ZeroOrMaxNodeScaling: atomic, - }) - return ng -} - -func generateNodes(from, to int, prefix string) []*apiv1.Node { - var result []*apiv1.Node - for i := from; i < to; i++ { - name := fmt.Sprintf("node-%d", i) - if prefix != "" { - name = prefix + "-" + name - } - result = append(result, generateNode(name)) - } - return result -} - -func generateNodeGroupViewList(ng cloudprovider.NodeGroup, from, to int) []*NodeGroupView { - return []*NodeGroupView{ - { - Group: ng, - Nodes: generateNodes(from, to, ng.Id()), - }, - } -} - -func generateNode(name string) *apiv1.Node { - return &apiv1.Node{ - ObjectMeta: metav1.ObjectMeta{Name: name}, - Status: apiv1.NodeStatus{ - Allocatable: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("8"), - apiv1.ResourceMemory: resource.MustParse("8G"), - }, - }, - } -} diff --git a/cluster-autoscaler/core/scaleup/orchestrator/executor.go b/cluster-autoscaler/core/scaleup/orchestrator/executor.go deleted file mode 100644 index 8f787e6cecce..000000000000 --- a/cluster-autoscaler/core/scaleup/orchestrator/executor.go +++ /dev/null @@ -1,248 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 orchestrator - -import ( - "fmt" - "sort" - "strings" - "sync" - "time" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/clusterstate" - "k8s.io/autoscaler/cluster-autoscaler/context" - "k8s.io/autoscaler/cluster-autoscaler/metrics" - "k8s.io/autoscaler/cluster-autoscaler/processors/nodegroupset" - "k8s.io/autoscaler/cluster-autoscaler/utils/errors" - "k8s.io/autoscaler/cluster-autoscaler/utils/gpu" -) - -// ScaleUpExecutor scales up node groups. -type scaleUpExecutor struct { - autoscalingContext *context.AutoscalingContext - clusterStateRegistry *clusterstate.ClusterStateRegistry -} - -// New returns new instance of scale up executor. -func newScaleUpExecutor( - autoscalingContext *context.AutoscalingContext, - clusterStateRegistry *clusterstate.ClusterStateRegistry, -) *scaleUpExecutor { - return &scaleUpExecutor{ - autoscalingContext: autoscalingContext, - clusterStateRegistry: clusterStateRegistry, - } -} - -// ExecuteScaleUps executes the scale ups, based on the provided scale up infos and options. -// May scale up groups concurrently when autoscler option is enabled. -// In case of issues returns an error and a scale up info which failed to execute. -// If there were multiple concurrent errors one combined error is returned. -func (e *scaleUpExecutor) ExecuteScaleUps( - scaleUpInfos []nodegroupset.ScaleUpInfo, - nodeInfos map[string]*schedulerframework.NodeInfo, - now time.Time, -) (errors.AutoscalerError, []cloudprovider.NodeGroup) { - options := e.autoscalingContext.AutoscalingOptions - if options.ParallelScaleUp { - return e.executeScaleUpsParallel(scaleUpInfos, nodeInfos, now) - } - return e.executeScaleUpsSync(scaleUpInfos, nodeInfos, now) -} - -func (e *scaleUpExecutor) executeScaleUpsSync( - scaleUpInfos []nodegroupset.ScaleUpInfo, - nodeInfos map[string]*schedulerframework.NodeInfo, - now time.Time, -) (errors.AutoscalerError, []cloudprovider.NodeGroup) { - availableGPUTypes := e.autoscalingContext.CloudProvider.GetAvailableGPUTypes() - for _, scaleUpInfo := range scaleUpInfos { - nodeInfo, ok := nodeInfos[scaleUpInfo.Group.Id()] - if !ok { - klog.Errorf("ExecuteScaleUp: failed to get node info for node group %s", scaleUpInfo.Group.Id()) - continue - } - if aErr := e.executeScaleUp(scaleUpInfo, nodeInfo, availableGPUTypes, now); aErr != nil { - return aErr, []cloudprovider.NodeGroup{scaleUpInfo.Group} - } - } - return nil, nil -} - -func (e *scaleUpExecutor) executeScaleUpsParallel( - scaleUpInfos []nodegroupset.ScaleUpInfo, - nodeInfos map[string]*schedulerframework.NodeInfo, - now time.Time, -) (errors.AutoscalerError, []cloudprovider.NodeGroup) { - if err := checkUniqueNodeGroups(scaleUpInfos); err != nil { - return err, extractNodeGroups(scaleUpInfos) - } - type errResult struct { - err errors.AutoscalerError - info *nodegroupset.ScaleUpInfo - } - scaleUpsLen := len(scaleUpInfos) - errResults := make(chan errResult, scaleUpsLen) - var wg sync.WaitGroup - wg.Add(scaleUpsLen) - availableGPUTypes := e.autoscalingContext.CloudProvider.GetAvailableGPUTypes() - for _, scaleUpInfo := range scaleUpInfos { - go func(info nodegroupset.ScaleUpInfo) { - defer wg.Done() - nodeInfo, ok := nodeInfos[info.Group.Id()] - if !ok { - klog.Errorf("ExecuteScaleUp: failed to get node info for node group %s", info.Group.Id()) - return - } - if aErr := e.executeScaleUp(info, nodeInfo, availableGPUTypes, now); aErr != nil { - errResults <- errResult{err: aErr, info: &info} - } - }(scaleUpInfo) - } - wg.Wait() - close(errResults) - var results []errResult - for err := range errResults { - results = append(results, err) - } - if len(results) > 0 { - failedNodeGroups := make([]cloudprovider.NodeGroup, len(results)) - scaleUpErrors := make([]errors.AutoscalerError, len(results)) - for i, result := range results { - failedNodeGroups[i] = result.info.Group - scaleUpErrors[i] = result.err - } - return combineConcurrentScaleUpErrors(scaleUpErrors), failedNodeGroups - } - return nil, nil -} - -func (e *scaleUpExecutor) executeScaleUp( - info nodegroupset.ScaleUpInfo, - nodeInfo *schedulerframework.NodeInfo, - availableGPUTypes map[string]struct{}, - now time.Time, -) errors.AutoscalerError { - gpuConfig := e.autoscalingContext.CloudProvider.GetNodeGpuConfig(nodeInfo.Node()) - gpuResourceName, gpuType := gpu.GetGpuInfoForMetrics(gpuConfig, availableGPUTypes, nodeInfo.Node(), nil) - klog.V(0).Infof("Scale-up: setting group %s size to %d", info.Group.Id(), info.NewSize) - e.autoscalingContext.LogRecorder.Eventf(apiv1.EventTypeNormal, "ScaledUpGroup", - "Scale-up: setting group %s size to %d instead of %d (max: %d)", info.Group.Id(), info.NewSize, info.CurrentSize, info.MaxSize) - increase := info.NewSize - info.CurrentSize - if err := info.Group.IncreaseSize(increase); err != nil { - e.autoscalingContext.LogRecorder.Eventf(apiv1.EventTypeWarning, "FailedToScaleUpGroup", "Scale-up failed for group %s: %v", info.Group.Id(), err) - aerr := errors.ToAutoscalerError(errors.CloudProviderError, err).AddPrefix("failed to increase node group size: ") - e.clusterStateRegistry.RegisterFailedScaleUp(info.Group, metrics.FailedScaleUpReason(string(aerr.Type())), gpuResourceName, gpuType, now) - return aerr - } - e.clusterStateRegistry.RegisterOrUpdateScaleUp( - info.Group, - increase, - time.Now()) - metrics.RegisterScaleUp(increase, gpuResourceName, gpuType) - e.autoscalingContext.LogRecorder.Eventf(apiv1.EventTypeNormal, "ScaledUpGroup", - "Scale-up: group %s size set to %d instead of %d (max: %d)", info.Group.Id(), info.NewSize, info.CurrentSize, info.MaxSize) - return nil -} - -func combineConcurrentScaleUpErrors(errs []errors.AutoscalerError) errors.AutoscalerError { - if len(errs) == 0 { - return nil - } - if len(errs) == 1 { - return errs[0] - } - uniqueMessages := make(map[string]bool) - uniqueTypes := make(map[errors.AutoscalerErrorType]bool) - for _, err := range errs { - uniqueTypes[err.Type()] = true - uniqueMessages[err.Error()] = true - } - if len(uniqueTypes) == 1 && len(uniqueMessages) == 1 { - return errs[0] - } - // sort to stabilize the results and easier log aggregation - sort.Slice(errs, func(i, j int) bool { - errA := errs[i] - errB := errs[j] - if errA.Type() == errB.Type() { - return errs[i].Error() < errs[j].Error() - } - return errA.Type() < errB.Type() - }) - firstErr := errs[0] - printErrorTypes := len(uniqueTypes) > 1 - message := formatMessageFromConcurrentErrors(errs, printErrorTypes) - return errors.NewAutoscalerError(firstErr.Type(), message) -} - -func formatMessageFromConcurrentErrors(errs []errors.AutoscalerError, printErrorTypes bool) string { - firstErr := errs[0] - var builder strings.Builder - builder.WriteString(firstErr.Error()) - builder.WriteString(" ...and other concurrent errors: [") - formattedErrs := map[errors.AutoscalerError]bool{ - firstErr: true, - } - for _, err := range errs { - if _, has := formattedErrs[err]; has { - continue - } - formattedErrs[err] = true - var message string - if printErrorTypes { - message = fmt.Sprintf("[%s] %s", err.Type(), err.Error()) - } else { - message = err.Error() - } - if len(formattedErrs) > 2 { - builder.WriteString(", ") - } - builder.WriteString(fmt.Sprintf("%q", message)) - } - builder.WriteString("]") - return builder.String() -} - -// Checks if all groups are scaled only once. -// Scaling one group multiple times concurrently may cause problems. -func checkUniqueNodeGroups(scaleUpInfos []nodegroupset.ScaleUpInfo) errors.AutoscalerError { - uniqueGroups := make(map[string]bool) - for _, info := range scaleUpInfos { - if uniqueGroups[info.Group.Id()] { - return errors.NewAutoscalerError( - errors.InternalError, - "assertion failure: detected group double scaling: %s", info.Group.Id(), - ) - } - uniqueGroups[info.Group.Id()] = true - } - return nil -} - -func extractNodeGroups(scaleUpInfos []nodegroupset.ScaleUpInfo) []cloudprovider.NodeGroup { - groups := make([]cloudprovider.NodeGroup, len(scaleUpInfos)) - for i, info := range scaleUpInfos { - groups[i] = info.Group - } - return groups -} diff --git a/cluster-autoscaler/core/scaleup/orchestrator/executor_test.go b/cluster-autoscaler/core/scaleup/orchestrator/executor_test.go deleted file mode 100644 index a7ef5d60f575..000000000000 --- a/cluster-autoscaler/core/scaleup/orchestrator/executor_test.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 orchestrator - -import ( - "testing" - - "k8s.io/autoscaler/cluster-autoscaler/utils/errors" - - "github.com/stretchr/testify/assert" -) - -func TestCombinedConcurrentScaleUpErrors(t *testing.T) { - cloudProviderErr := errors.NewAutoscalerError(errors.CloudProviderError, "provider error") - internalErr := errors.NewAutoscalerError(errors.InternalError, "internal error") - testCases := []struct { - desc string - errors []errors.AutoscalerError - expectedErr errors.AutoscalerError - }{ - { - desc: "no errors", - errors: []errors.AutoscalerError{}, - expectedErr: nil, - }, - { - desc: "single error", - errors: []errors.AutoscalerError{internalErr}, - expectedErr: internalErr, - }, - { - desc: "two duplicated errors", - errors: []errors.AutoscalerError{ - internalErr, - internalErr, - }, - expectedErr: internalErr, - }, - { - desc: "two different errors", - errors: []errors.AutoscalerError{ - cloudProviderErr, - internalErr, - }, - expectedErr: errors.NewAutoscalerError( - errors.CloudProviderError, - "provider error ...and other concurrent errors: [\"[internalError] internal error\"]", - ), - }, - { - desc: "two different errors - reverse alphabetical order", - errors: []errors.AutoscalerError{ - internalErr, - cloudProviderErr, - }, - expectedErr: errors.NewAutoscalerError( - errors.CloudProviderError, - "provider error ...and other concurrent errors: [\"[internalError] internal error\"]", - ), - }, - { - desc: "errors with the same type and different messages", - errors: []errors.AutoscalerError{ - errors.NewAutoscalerError(errors.InternalError, "A"), - errors.NewAutoscalerError(errors.InternalError, "B"), - errors.NewAutoscalerError(errors.InternalError, "C"), - }, - expectedErr: errors.NewAutoscalerError( - errors.InternalError, - "A ...and other concurrent errors: [\"B\", \"C\"]"), - }, - { - desc: "errors with the same type and some duplicated messages", - errors: []errors.AutoscalerError{ - errors.NewAutoscalerError(errors.InternalError, "A"), - errors.NewAutoscalerError(errors.InternalError, "B"), - errors.NewAutoscalerError(errors.InternalError, "A"), - }, - expectedErr: errors.NewAutoscalerError( - errors.InternalError, - "A ...and other concurrent errors: [\"B\"]"), - }, - { - desc: "some duplicated errors", - errors: []errors.AutoscalerError{ - errors.NewAutoscalerError(errors.CloudProviderError, "A"), - errors.NewAutoscalerError(errors.CloudProviderError, "A"), - errors.NewAutoscalerError(errors.CloudProviderError, "B"), - errors.NewAutoscalerError(errors.InternalError, "A"), - }, - expectedErr: errors.NewAutoscalerError( - errors.CloudProviderError, - "A ...and other concurrent errors: [\"[cloudProviderError] B\", \"[internalError] A\"]"), - }, - { - desc: "different errors with quotes in messages", - errors: []errors.AutoscalerError{ - errors.NewAutoscalerError(errors.InternalError, "\"first\""), - errors.NewAutoscalerError(errors.InternalError, "\"second\""), - }, - expectedErr: errors.NewAutoscalerError( - errors.InternalError, - "\"first\" ...and other concurrent errors: [\"\\\"second\\\"\"]"), - }, - } - - for _, testCase := range testCases { - t.Run(testCase.desc, func(t *testing.T) { - combinedErr := combineConcurrentScaleUpErrors(testCase.errors) - assert.Equal(t, testCase.expectedErr, combinedErr) - }) - } -} diff --git a/cluster-autoscaler/estimator/cluster_capacity_threshold.go b/cluster-autoscaler/estimator/cluster_capacity_threshold.go deleted file mode 100644 index eeced6886f9d..000000000000 --- a/cluster-autoscaler/estimator/cluster_capacity_threshold.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -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 estimator - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" -) - -type clusterCapacityThreshold struct { -} - -// NodeLimit returns maximum number of new nodes that can be added to the cluster -// based on its capacity. Possible return values are: -// - -1 when cluster has no available capacity -// - 0 when context or cluster-wide node limit is not set. Return value of 0 means that there is no limit. -// - Any positive number representing maximum possible number of new nodes -func (l *clusterCapacityThreshold) NodeLimit(_ cloudprovider.NodeGroup, context EstimationContext) int { - if context == nil || context.ClusterMaxNodeLimit() == 0 { - return 0 - } - if (context.ClusterMaxNodeLimit() < 0) || (context.ClusterMaxNodeLimit() <= context.CurrentNodeCount()) { - return -1 - } - return context.ClusterMaxNodeLimit() - context.CurrentNodeCount() -} - -// DurationLimit always returns 0 for this threshold, meaning that no limit is set. -func (l *clusterCapacityThreshold) DurationLimit(cloudprovider.NodeGroup, EstimationContext) time.Duration { - return 0 -} - -// NewClusterCapacityThreshold returns a Threshold that can be used to limit binpacking -// by available cluster capacity -func NewClusterCapacityThreshold() Threshold { - return &clusterCapacityThreshold{} -} diff --git a/cluster-autoscaler/estimator/cluster_capacity_threshold_test.go b/cluster-autoscaler/estimator/cluster_capacity_threshold_test.go deleted file mode 100644 index 9358fb9a7754..000000000000 --- a/cluster-autoscaler/estimator/cluster_capacity_threshold_test.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -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 estimator - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestNewClusterCapacityThreshold(t *testing.T) { - tests := []struct { - name string - wantThreshold int - contextMaxNodes int - contextCurrentNodes int - }{ - { - name: "returns available capacity", - contextMaxNodes: 10, - contextCurrentNodes: 5, - wantThreshold: 5, - }, - { - name: "no threshold is set if cluster capacity is unlimited", - contextMaxNodes: 0, - contextCurrentNodes: 10, - wantThreshold: 0, - }, - { - name: "threshold is negative if cluster has no capacity", - contextMaxNodes: 5, - contextCurrentNodes: 10, - wantThreshold: -1, - }, - { - name: "threshold is negative if cluster node limit is negative", - contextMaxNodes: -5, - contextCurrentNodes: 0, - wantThreshold: -1, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - context := &estimationContext{ - similarNodeGroups: nil, - currentNodeCount: tt.contextCurrentNodes, - clusterMaxNodeLimit: tt.contextMaxNodes, - } - assert.Equal(t, tt.wantThreshold, NewClusterCapacityThreshold().NodeLimit(nil, context)) - assert.True(t, NewClusterCapacityThreshold().DurationLimit(nil, nil) == 0) - }) - } -} diff --git a/cluster-autoscaler/estimator/decreasing_pod_orderer.go b/cluster-autoscaler/estimator/decreasing_pod_orderer.go deleted file mode 100644 index ac8b930ddd31..000000000000 --- a/cluster-autoscaler/estimator/decreasing_pod_orderer.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -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 estimator - -import ( - "sort" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/kubernetes/pkg/scheduler/framework" -) - -// podScoreInfo contains Pod and score that corresponds to how important it is to handle the pod first. -type podScoreInfo struct { - score float64 - pod *apiv1.Pod -} - -// DecreasingPodOrderer is the default implementation of the EstimationPodOrderer -// It implements sorting pods by pod score in decreasing order -type DecreasingPodOrderer struct { -} - -// NewDecreasingPodOrderer returns the object of DecreasingPodOrderer -func NewDecreasingPodOrderer() *DecreasingPodOrderer { - return &DecreasingPodOrderer{} -} - -// Order is the processing func that sorts the pods based on the size of the pod -func (d *DecreasingPodOrderer) Order(pods []*apiv1.Pod, nodeTemplate *framework.NodeInfo, _ cloudprovider.NodeGroup) []*apiv1.Pod { - podInfos := make([]*podScoreInfo, 0, len(pods)) - for _, pod := range pods { - podInfos = append(podInfos, d.calculatePodScore(pod, nodeTemplate)) - } - sort.Slice(podInfos, func(i, j int) bool { return podInfos[i].score > podInfos[j].score }) - podList := make([]*apiv1.Pod, 0, len(pods)) - for _, podInfo := range podInfos { - podList = append(podList, podInfo.pod) - } - - return podList -} - -// calculatePodScore score for pod and returns podScoreInfo structure. -// Score is defined as cpu_sum/node_capacity + mem_sum/node_capacity. -// Pods that have bigger requirements should be processed first, thus have higher scores. -func (d *DecreasingPodOrderer) calculatePodScore(pod *apiv1.Pod, nodeTemplate *framework.NodeInfo) *podScoreInfo { - - cpuSum := resource.Quantity{} - memorySum := resource.Quantity{} - - for _, container := range pod.Spec.Containers { - if request, ok := container.Resources.Requests[apiv1.ResourceCPU]; ok { - cpuSum.Add(request) - } - if request, ok := container.Resources.Requests[apiv1.ResourceMemory]; ok { - memorySum.Add(request) - } - } - score := float64(0) - if cpuAllocatable, ok := nodeTemplate.Node().Status.Allocatable[apiv1.ResourceCPU]; ok && cpuAllocatable.MilliValue() > 0 { - score += float64(cpuSum.MilliValue()) / float64(cpuAllocatable.MilliValue()) - } - if memAllocatable, ok := nodeTemplate.Node().Status.Allocatable[apiv1.ResourceMemory]; ok && memAllocatable.Value() > 0 { - score += float64(memorySum.Value()) / float64(memAllocatable.Value()) - } - - return &podScoreInfo{ - score: score, - pod: pod, - } -} diff --git a/cluster-autoscaler/estimator/decreasing_pod_orderer_test.go b/cluster-autoscaler/estimator/decreasing_pod_orderer_test.go deleted file mode 100644 index 07c2e0349075..000000000000 --- a/cluster-autoscaler/estimator/decreasing_pod_orderer_test.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -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 estimator - -import ( - "testing" - - "github.com/stretchr/testify/assert" - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" - schedulerframework "k8s.io/kubernetes/pkg/scheduler/framework" -) - -func TestPodPriorityProcessor(t *testing.T) { - p1 := test.BuildTestPod("p1", 1, 1) - p2 := test.BuildTestPod("p2", 2, 1) - p3 := test.BuildTestPod("p3", 2, 100) - node := makeNode(4, 600, "node1", "zone-sun") - testCases := map[string]struct { - inputPods []*apiv1.Pod - expectedPods []*apiv1.Pod - }{ - "single pod": { - inputPods: []*apiv1.Pod{p1}, - expectedPods: []*apiv1.Pod{p1}, - }, - "sorted list of pods": { - inputPods: []*apiv1.Pod{p3, p2, p1}, - expectedPods: []*apiv1.Pod{p3, p2, p1}, - }, - "randomised list of pods": { - inputPods: []*apiv1.Pod{p1, p3, p2}, - expectedPods: []*apiv1.Pod{p3, p2, p1}, - }, - "empty pod list": { - inputPods: []*apiv1.Pod{}, - expectedPods: []*apiv1.Pod{}, - }, - } - - for tn, tc := range testCases { - t.Run(tn, func(t *testing.T) { - tc := tc - t.Parallel() - processor := NewDecreasingPodOrderer() - nodeInfo := schedulerframework.NewNodeInfo() - nodeInfo.SetNode(node) - actual := processor.Order(tc.inputPods, nodeInfo, nil) - assert.Equal(t, tc.expectedPods, actual) - }) - } -} diff --git a/cluster-autoscaler/estimator/estimation_context.go b/cluster-autoscaler/estimator/estimation_context.go deleted file mode 100644 index 8187f598aaee..000000000000 --- a/cluster-autoscaler/estimator/estimation_context.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -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 estimator - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" -) - -// EstimationContext stores static and runtime state of autoscaling, used by Estimator -type EstimationContext interface { - SimilarNodeGroups() []cloudprovider.NodeGroup - ClusterMaxNodeLimit() int - CurrentNodeCount() int -} - -type estimationContext struct { - similarNodeGroups []cloudprovider.NodeGroup - currentNodeCount int - clusterMaxNodeLimit int -} - -// NewEstimationContext creates a patch for estimation context with runtime properties. -// This patch is used to update existing context. -func NewEstimationContext(clusterMaxNodeLimit int, similarNodeGroups []cloudprovider.NodeGroup, currentNodeCount int) EstimationContext { - return &estimationContext{ - similarNodeGroups: similarNodeGroups, - currentNodeCount: currentNodeCount, - clusterMaxNodeLimit: clusterMaxNodeLimit, - } -} - -// SimilarNodeGroups returns array of similar node groups -func (c *estimationContext) SimilarNodeGroups() []cloudprovider.NodeGroup { - return c.similarNodeGroups -} - -// ClusterMaxNodeLimit returns maximum node number allowed for the cluster -func (c *estimationContext) ClusterMaxNodeLimit() int { - return c.clusterMaxNodeLimit -} - -// CurrentNodeCount returns current number of nodes in the cluster -func (c *estimationContext) CurrentNodeCount() int { - return c.currentNodeCount -} diff --git a/cluster-autoscaler/estimator/sng_capacity_threshold.go b/cluster-autoscaler/estimator/sng_capacity_threshold.go deleted file mode 100644 index 8ecd1acb501e..000000000000 --- a/cluster-autoscaler/estimator/sng_capacity_threshold.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -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 estimator - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/klog/v2" -) - -type sngCapacityThreshold struct { -} - -// NodeLimit returns maximum number of new nodes that can be added to the cluster -// based on capacity of current node group and total capacity of similar node groups. Possible return values are: -// - -1 when this node group AND similar node groups have no available capacity -// - 0 when context is not set. Return value of 0 means that there is no limit. -// - Any positive number representing maximum possible number of new nodes -func (t *sngCapacityThreshold) NodeLimit(nodeGroup cloudprovider.NodeGroup, context EstimationContext) int { - if context == nil { - return 0 - } - totalAvailableCapacity := t.computeNodeGroupCapacity(nodeGroup) - for _, sng := range context.SimilarNodeGroups() { - totalAvailableCapacity += t.computeNodeGroupCapacity(sng) - } - if totalAvailableCapacity <= 0 { - return -1 - } - return totalAvailableCapacity -} - -func (t *sngCapacityThreshold) computeNodeGroupCapacity(nodeGroup cloudprovider.NodeGroup) int { - nodeGroupTargetSize, err := nodeGroup.TargetSize() - // Should not ever happen as only valid node groups are passed to estimator - if err != nil { - klog.Errorf("Error while computing available capacity of a node group %v: can't get target size of the group: %v", nodeGroup.Id(), err) - return 0 - } - groupCapacity := nodeGroup.MaxSize() - nodeGroupTargetSize - if groupCapacity > 0 { - return groupCapacity - } - return 0 -} - -// DurationLimit always returns 0 for this threshold, meaning that no limit is set. -func (t *sngCapacityThreshold) DurationLimit(cloudprovider.NodeGroup, EstimationContext) time.Duration { - return 0 -} - -// NewSngCapacityThreshold returns a Threshold that can be used to limit binpacking -// by available capacity of similar node groups -func NewSngCapacityThreshold() Threshold { - return &sngCapacityThreshold{} -} diff --git a/cluster-autoscaler/estimator/sng_capacity_threshold_test.go b/cluster-autoscaler/estimator/sng_capacity_threshold_test.go deleted file mode 100644 index 5867152179d5..000000000000 --- a/cluster-autoscaler/estimator/sng_capacity_threshold_test.go +++ /dev/null @@ -1,92 +0,0 @@ -/* -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 estimator - -import ( - "testing" - - "github.com/stretchr/testify/assert" - testprovider "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/test" -) - -func TestSngCapacityThreshold(t *testing.T) { - type nodeGroupConfig struct { - name string - maxNodes int - nodesCount int - } - tests := []struct { - name string - nodeGroupsConfig []nodeGroupConfig - currentNodeGroup nodeGroupConfig - wantThreshold int - }{ - { - name: "returns available capacity", - nodeGroupsConfig: []nodeGroupConfig{ - {name: "ng1", maxNodes: 10, nodesCount: 5}, - {name: "ng2", maxNodes: 100, nodesCount: 50}, - {name: "ng3", maxNodes: 5, nodesCount: 3}, - }, - currentNodeGroup: nodeGroupConfig{name: "main-ng", maxNodes: 20, nodesCount: 10}, - wantThreshold: 67, - }, - { - name: "returns available capacity and skips over-provisioned groups", - nodeGroupsConfig: []nodeGroupConfig{ - {name: "ng1", maxNodes: 10, nodesCount: 5}, - {name: "ng3", maxNodes: 10, nodesCount: 11}, - {name: "ng3", maxNodes: 0, nodesCount: 5}, - }, - currentNodeGroup: nodeGroupConfig{name: "main-ng", maxNodes: 5, nodesCount: 10}, - wantThreshold: 5, - }, - { - name: "threshold is negative if cluster has no capacity", - nodeGroupsConfig: []nodeGroupConfig{ - {name: "ng1", maxNodes: 10, nodesCount: 10}, - {name: "ng2", maxNodes: 100, nodesCount: 100}, - }, - currentNodeGroup: nodeGroupConfig{name: "main-ng", maxNodes: 5, nodesCount: 5}, - wantThreshold: -1, - }, - { - name: "threshold is negative if all groups are over-provisioned", - nodeGroupsConfig: []nodeGroupConfig{ - {name: "ng1", maxNodes: 10, nodesCount: 11}, - {name: "ng3", maxNodes: 100, nodesCount: 111}, - {name: "ng3", maxNodes: 0, nodesCount: 5}, - }, - currentNodeGroup: nodeGroupConfig{name: "main-ng", maxNodes: 5, nodesCount: 10}, - wantThreshold: -1, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - provider := testprovider.NewTestCloudProvider(func(string, int) error { return nil }, nil) - for _, ng := range tt.nodeGroupsConfig { - provider.AddNodeGroup(ng.name, 0, ng.maxNodes, ng.nodesCount) - } - // Context must be constructed first to exclude current node group passed from orchestrator - context := estimationContext{similarNodeGroups: provider.NodeGroups()} - provider.AddNodeGroup(tt.currentNodeGroup.name, 0, tt.currentNodeGroup.maxNodes, tt.currentNodeGroup.nodesCount) - currentNodeGroup := provider.GetNodeGroup(tt.currentNodeGroup.name) - assert.Equalf(t, tt.wantThreshold, NewSngCapacityThreshold().NodeLimit(currentNodeGroup, &context), "NewSngCapacityThreshold()") - assert.True(t, NewClusterCapacityThreshold().DurationLimit(currentNodeGroup, &context) == 0) - }) - } -} diff --git a/cluster-autoscaler/estimator/static_threshold.go b/cluster-autoscaler/estimator/static_threshold.go deleted file mode 100644 index 8aaf93c4b5d0..000000000000 --- a/cluster-autoscaler/estimator/static_threshold.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 estimator - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" -) - -type staticThreshold struct { - maxNodes int - maxDuration time.Duration -} - -func (l *staticThreshold) NodeLimit(cloudprovider.NodeGroup, EstimationContext) int { - return l.maxNodes -} - -func (l *staticThreshold) DurationLimit(cloudprovider.NodeGroup, EstimationContext) time.Duration { - return l.maxDuration -} - -// NewStaticThreshold returns a Threshold that should be used to limit -// result and duration of binpacking by given static values -func NewStaticThreshold(maxNodes int, maxDuration time.Duration) Threshold { - return &staticThreshold{ - maxNodes: maxNodes, - maxDuration: maxDuration, - } -} diff --git a/cluster-autoscaler/estimator/threshold.go b/cluster-autoscaler/estimator/threshold.go deleted file mode 100644 index 6246360009b3..000000000000 --- a/cluster-autoscaler/estimator/threshold.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -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 estimator - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" -) - -// Threshold provides resources configuration for threshold based estimation limiter. -// Return value of 0 means that no limit is set. -type Threshold interface { - NodeLimit(cloudprovider.NodeGroup, EstimationContext) int - DurationLimit(cloudprovider.NodeGroup, EstimationContext) time.Duration -} diff --git a/cluster-autoscaler/hack/update-codegen.sh b/cluster-autoscaler/hack/update-codegen.sh deleted file mode 100755 index a716c5b1579b..000000000000 --- a/cluster-autoscaler/hack/update-codegen.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -# 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. - -### -# This script is to be used when updating the generated clients of -# the Provisoning Request CRD. -### - -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -CODEGEN_PKG="./vendor/k8s.io/code-generator" - -chmod +x "${CODEGEN_PKG}"/generate-groups.sh -chmod +x "${CODEGEN_PKG}"/generate-internal-groups.sh - -bash "${CODEGEN_PKG}"/generate-groups.sh "applyconfiguration,client,deepcopy,informer,lister" \ - k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client \ - k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis \ - autoscaling.x-k8s.io:v1beta1 \ - --go-header-file "${SCRIPT_ROOT}"/../hack/boilerplate/boilerplate.generatego.txt - -chmod -x "${CODEGEN_PKG}"/generate-groups.sh -chmod -x "${CODEGEN_PKG}"/generate-internal-groups.sh diff --git a/cluster-autoscaler/processors/binpacking/binpacking_limiter.go b/cluster-autoscaler/processors/binpacking/binpacking_limiter.go deleted file mode 100644 index e1396ecf79c7..000000000000 --- a/cluster-autoscaler/processors/binpacking/binpacking_limiter.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -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 binpacking - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/context" - "k8s.io/autoscaler/cluster-autoscaler/expander" -) - -// BinpackingLimiter processes expansion options to stop binpacking early. -type BinpackingLimiter interface { - InitBinpacking(context *context.AutoscalingContext, nodeGroups []cloudprovider.NodeGroup) - MarkProcessed(context *context.AutoscalingContext, nodegroupId string) - StopBinpacking(context *context.AutoscalingContext, evaluatedOptions []expander.Option) bool - FinalizeBinpacking(context *context.AutoscalingContext, finalOptions []expander.Option) -} - -// NoOpBinpackingLimiter returns true without processing expansion options. -type NoOpBinpackingLimiter struct { -} - -// NewDefaultBinpackingLimiter creates an instance of NoOpBinpackingLimiter. -func NewDefaultBinpackingLimiter() BinpackingLimiter { - return &NoOpBinpackingLimiter{} -} - -// InitBinpacking initialises the BinpackingLimiter. -func (p *NoOpBinpackingLimiter) InitBinpacking(context *context.AutoscalingContext, nodeGroups []cloudprovider.NodeGroup) { -} - -// MarkProcessed marks the nodegroup as processed. -func (p *NoOpBinpackingLimiter) MarkProcessed(context *context.AutoscalingContext, nodegroupId string) { -} - -// StopBinpacking is used to make decsions on the evaluated expansion options. -func (p *NoOpBinpackingLimiter) StopBinpacking(context *context.AutoscalingContext, evaluatedOptions []expander.Option) bool { - return false -} - -// FinalizeBinpacking is called to finalize the BinpackingLimiter. -func (p *NoOpBinpackingLimiter) FinalizeBinpacking(context *context.AutoscalingContext, finalOptions []expander.Option) { -} diff --git a/cluster-autoscaler/processors/nodes/scale_down_set_processor.go b/cluster-autoscaler/processors/nodes/scale_down_set_processor.go deleted file mode 100644 index b503e42a8ae1..000000000000 --- a/cluster-autoscaler/processors/nodes/scale_down_set_processor.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -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 nodes - -import ( - "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" - "k8s.io/autoscaler/cluster-autoscaler/context" - "k8s.io/autoscaler/cluster-autoscaler/simulator" - klog "k8s.io/klog/v2" -) - -// CompositeScaleDownSetProcessor is a ScaleDownSetProcessor composed of multiple sub-processors passed as an argument. -type CompositeScaleDownSetProcessor struct { - orderedProcessorList []ScaleDownSetProcessor -} - -// NewCompositeScaleDownSetProcessor creates new CompositeScaleDownSetProcessor. The order on a list defines order in witch -// sub-processors are invoked. -func NewCompositeScaleDownSetProcessor(orderedProcessorList []ScaleDownSetProcessor) *CompositeScaleDownSetProcessor { - return &CompositeScaleDownSetProcessor{ - orderedProcessorList: orderedProcessorList, - } -} - -// GetNodesToRemove selects nodes to remove. -func (p *CompositeScaleDownSetProcessor) GetNodesToRemove(ctx *context.AutoscalingContext, candidates []simulator.NodeToBeRemoved, maxCount int) []simulator.NodeToBeRemoved { - for _, p := range p.orderedProcessorList { - candidates = p.GetNodesToRemove(ctx, candidates, maxCount) - } - return candidates -} - -// CleanUp is called at CA termination -func (p *CompositeScaleDownSetProcessor) CleanUp() { - for _, p := range p.orderedProcessorList { - p.CleanUp() - } -} - -// MaxNodesProcessor selects first maxCount nodes (if possible) to be removed -type MaxNodesProcessor struct { -} - -// GetNodesToRemove selects up to maxCount nodes for deletion, by selecting a first maxCount candidates -func (p *MaxNodesProcessor) GetNodesToRemove(ctx *context.AutoscalingContext, candidates []simulator.NodeToBeRemoved, maxCount int) []simulator.NodeToBeRemoved { - end := len(candidates) - if len(candidates) > maxCount { - end = maxCount - } - return candidates[:end] -} - -// CleanUp is called at CA termination -func (p *MaxNodesProcessor) CleanUp() { -} - -// NewMaxNodesProcessor returns a new MaxNodesProcessor -func NewMaxNodesProcessor() *MaxNodesProcessor { - return &MaxNodesProcessor{} -} - -// AtomicResizeFilteringProcessor removes node groups which should be scaled down as one unit -// if only part of these nodes were scheduled for scale down. -// NOTE! When chaining with other processors, AtomicResizeFilteringProcessors should be always used last. -// Otherwise, it's possible that another processor will break the property that this processor aims to restore: -// no partial scale-downs for node groups that should be resized atomically. -type AtomicResizeFilteringProcessor struct { -} - -// GetNodesToRemove selects up to maxCount nodes for deletion, by selecting a first maxCount candidates -func (p *AtomicResizeFilteringProcessor) GetNodesToRemove(ctx *context.AutoscalingContext, candidates []simulator.NodeToBeRemoved, maxCount int) []simulator.NodeToBeRemoved { - nodesByGroup := map[cloudprovider.NodeGroup][]simulator.NodeToBeRemoved{} - result := []simulator.NodeToBeRemoved{} - for _, node := range candidates { - nodeGroup, err := ctx.CloudProvider.NodeGroupForNode(node.Node) - if err != nil { - klog.Errorf("Node %v will not scale down, failed to get node info: %s", node.Node.Name, err) - continue - } - autoscalingOptions, err := nodeGroup.GetOptions(ctx.NodeGroupDefaults) - if err != nil && err != cloudprovider.ErrNotImplemented { - klog.Errorf("Failed to get autoscaling options for node group %s: %v", nodeGroup.Id(), err) - continue - } - if autoscalingOptions != nil && autoscalingOptions.ZeroOrMaxNodeScaling { - klog.V(2).Infof("Considering node %s for atomic scale down", node.Node.Name) - nodesByGroup[nodeGroup] = append(nodesByGroup[nodeGroup], node) - } else { - klog.V(2).Infof("Considering node %s for standard scale down", node.Node.Name) - result = append(result, node) - } - } - for nodeGroup, nodes := range nodesByGroup { - ngSize, err := nodeGroup.TargetSize() - if err != nil { - klog.Errorf("Nodes from group %s will not scale down, failed to get target size: %s", nodeGroup.Id(), err) - continue - } - if ngSize == len(nodes) { - klog.V(2).Infof("Scheduling atomic scale down for all %v nodes from node group %s", len(nodes), nodeGroup.Id()) - result = append(result, nodes...) - } else { - klog.V(2).Infof("Skipping scale down for %v nodes from node group %s, all %v nodes have to be scaled down atomically", len(nodes), nodeGroup.Id(), ngSize) - } - } - return result -} - -// CleanUp is called at CA termination -func (p *AtomicResizeFilteringProcessor) CleanUp() { -} - -// NewAtomicResizeFilteringProcessor returns a new AtomicResizeFilteringProcessor -func NewAtomicResizeFilteringProcessor() *AtomicResizeFilteringProcessor { - return &AtomicResizeFilteringProcessor{} -} diff --git a/cluster-autoscaler/proposals/provisioning-request.md b/cluster-autoscaler/proposals/provisioning-request.md deleted file mode 100644 index 0540cd7d8dc0..000000000000 --- a/cluster-autoscaler/proposals/provisioning-request.md +++ /dev/null @@ -1,328 +0,0 @@ -# Provisioning Request CRD - -author: kisieland - -## Background - -Currently CA does not provide any way to express that a group of pods would like -to have a capacity available. -This is caused by the fact that each CA loop picks a group of unschedulable pods -and works on provisioning capacity for them, meaning that the grouping is random -(as it depends on the kube-scheduler and CA loop interactions). -This is especially problematic in couple of cases: - - - Users would like to have all-or-nothing semantics for their workloads. - Currently CA will try to provision this capacity and if it is partially - successful it will leave it in cluster until user removes the workload. - - Users would like to lower e2e scale-up latency for huge scale-ups (100 - nodes+). Due to CA nature and kube-scheduler throughput, CA will create - partial scale-ups, e.g. `0->200->400->600` rather than one `0->600`. This - significantly increases the e2e latency as there is non-negligible time tax - on each scale-up operation. - -## Proposal - -### High level - -Provisioning Request (abbr. ProvReq) is a new namespaced Custom Resource that -aims to allow users to ask CA for capacity for groups of pods. -It allows users to express the fact that group of pods is connected and should -be threated as one entity. -This AEP proposes an API that can have multiple provisioning classes and can be -extended by cloud provider specific ones. -This object is meant as one-shot request to CA, so that if CA fails to provision -the capacity it is up to users to retry (such retry functionality can be added -later on). - -### ProvisioningRequest CRD - -The following code snippets assume [kubebuilder](https://book.kubebuilder.io/) -is used to generate the CRD: - -```go -// ProvisioningRequest is a way to express additional capacity -// that we would like to provision in the cluster. Cluster Autoscaler -// can use this information in its calculations and signal if the capacity -// is available in the cluster or actively add capacity if needed. -type ProvisioningRequest struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - // Spec contains specification of the ProvisioningRequest object. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. - // - // +kubebuilder:validation:Required - Spec ProvisioningRequestSpec `json:"spec"` - // Status of the ProvisioningRequest. CA constantly reconciles this field. - // - // +optional - Status ProvisioningRequestStatus `json:"status,omitempty"` -} - -// ProvisioningRequestList is a object for list of ProvisioningRequest. -type ProvisioningRequestList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // - // +optional - metav1.ListMeta `json:"metadata"` - // Items, list of ProvisioningRequest returned from API. - // - // +optional - Items []ProvisioningRequest `json:"items"` -} - -// ProvisioningRequestSpec is a specification of additional pods for which we -// would like to provision additional resources in the cluster. -type ProvisioningRequestSpec struct { - // PodSets lists groups of pods for which we would like to provision - // resources. - // - // +kubebuilder:validation:Required - // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:MaxItems=32 - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" - PodSets []PodSet `json:"podSets"` - - // ProvisioningClass describes the different modes of provisioning the resources. - // Supported values: - // * check-capacity.kubernetes.io - check if current cluster state can fullfil this request, - // do not reserve the capacity. - // * atomic-scale-up.kubernetes.io - provision the resources in an atomic manner - // * ... - potential other classes that are specific to the cloud providers - // - // +kubebuilder:validation:Required - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" - ProvisioningClass string `json:"provisioningClass"` - - // Parameters contains all other parameters custom classes may require. - // - // +optional - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" - Parameters map[string]string `json:"Parameters"` -} - -type PodSet struct { - // PodTemplateRef is a reference to a PodTemplate object that is representing pods - // that will consume this reservation (must be within the same namespace). - // Users need to make sure that the fields relevant to scheduler (e.g. node selector tolerations) - // are consistent between this template and actual pods consuming the Provisioning Request. - // - // +kubebuilder:validation:Required - PodTemplateRef Reference `json:"podTemplateRef"` - // Count contains the number of pods that will be created with a given - // template. - // - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:Maximum=16384 - Count int32 `json:"count"` -} - -type Reference struct { - // Name of the referenced object. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names - // - // +kubebuilder:validation:Required - Name string `json:"name,omitempty"` -} - -// ProvisioningRequestStatus represents the status of the resource reservation. -type ProvisioningRequestStatus struct { - // Conditions represent the observations of a Provisioning Request's - // current state. Those will contain information whether the capacity - // was found/created or if there were any issues. The condition types - // may differ between different provisioning classes. - // - // +listType=map - // +listMapKey=type - // +patchStrategy=merge - // +patchMergeKey=type - // +optional - Conditions []metav1.Condition `json:"conditions"` - - // Statuses contains all other status values custom provisioning classes may require. - // - // +optional - // +kubebuilder:validation:MaxItems=64 - Statuses map[string]string `json:"statuses"` -} -``` - -### Provisioning Classes - -#### check-capacity.kubernetes.io class - -The `check-capacity.kubernetes.io` is one-off check to verify that the in the cluster -there is enough capacity to provision given set of pods. - -Note: If two of such objects are created around the same time, CA will consider -them independently and place no guards for the capacity. -Also the capacity is not reserved in any manner so it may be scaled-down. - -#### atomic-scale-up.kubernetes.io class - -The `atomic-scale-up.kubernetes.io` aims to provision the resources required for the -specified pods in an atomic way. The proposed logic is to: -1. Try to provision required VMs in one loop. -2. If it failed, remove the partially provisioned VMs and back-off. -3. Stop the back-off after a given duration (optional), which would be passed - via `Parameters` field, using `ValidUntilSeconds` key and would contain string - denoting duration for which we should retry (measured since creation fo the CR). - -Note: that the VMs created in this mode are subject to the scale-down logic. -So the duration during which users need to create the Pods is equal to the -value of `--scale-down-unneeded-time` flag. - -### Adding pods that consume given ProvisioningRequest - -To avoid generating double scale-ups and exclude pods that are meant to consume -given capacity CA should be able to differentiate those from all other pods. -To achieve this users need to specify the following pod annotations (those are -not required in ProvReq’s template, though can be specified): - -```yaml -annotations: - "cluster-autoscaler.kubernetes.io/provisioning-class-name": "provreq-class-name" - "cluster-autoscaler.kubernetes.io/consume-provisioning-request": "provreq-name" -``` - -If those are provided for the pods that consume the ProvReq with `check-capacity.kubernetes.io` class, -the CA will not provision the capacity, even if it was needed (as some other pods might have been -scheduled on it) and will result in visibility events passed to the ProvReq and pods. -If those are not passed the CA will behave normally and just provision the capacity if it needed. -Both annotation are required and CA will not work correctly if only one of them is passed. - -Note: CA will match all pods with this annotation to a corresponding ProvReq and -ignore them when executing a scale-up loop (so that is up to users to make sure -that the ProvReq count is matching the number of created pods). -If the ProvReq is missing, all of the pods that consume it will be unschedulable indefinitely. - -### CRD lifecycle - -1. A ProvReq will be created either by the end user or by a framework. - At this point needed PodTemplate objects should be also created. -2. CA will pick it up, choose a nodepool (or create a new one if NAP is - enabled), and try to create nodes. -3. If CA successfully creates capacity, ProvReq will receive information about - this fact in `Conditions` field. -4. At this moment, users can create pods in that will consume the ProvReq (in - the same namespace), those will be scheduled on the capacity that was - created by the CA. -5. Once all of the pods are scheduled users can delete the ProvReq object, - otherwise it will be garbage collected after some time. -6. When pods finish the work and nodes become unused the CA will scale them - down. - -Note: Users can create a ProvReq and pods consuming them at the same time (in a -"fire and forget" manner), but this may result in the pods being unschedulable -and triggering user configured alerts. - -### Canceling the requests - -To cancel a pending Provisioning Request with atomic class, all that the users need to do is -to delete the Provisioning Request object. -After that the CA will no longer guard the nodes from deletion and proceed with standard scale-down logic. - -### Conditions - -The following Condition states should encode the states of the ProvReq: - - - Provisioned - VMs were created successfully (Atomic class) - - CapacityAvailable - cluster contains enough capacity to schedule pods (Check - class) - * `CapacityAvailable=true` will denote that cluster contains enough capacity to schedule pods - * `CapacityAvailable=false` will denote that cluster does not contain enough capacity to schedule pods - - Failed - failed to create or check capacity (both classes) - -The Reasons and Messages will contain more details about why the specific -condition was triggered. - -Providers of the custom classes should reuse the conditions where available or create their own ones -if items from the above list cannot be used to denote a specific situation. - -### CA implementation details - -The proposed implementation is to handle each ProvReq in a separate scale-up -loop. This will require changes in multiple parts of CA: - -1. Listing unschedulable pods where: - - pods that consume ProvReq need to filtered-out - - pods that are represented by the ProvReq need to be injected (we need to - ensure those are threated as one group by the sharding logic) -2. Scale-up logic, which as of now has no notion atomicity and grouping of - pods. This is simplified as the ScaleUp logic was recently put [behind an - interface](https://github.com/kubernetes/autoscaler/pull/5597). - - This is a place where the biggest part of the change will be made. Here - many parts of the logic are assuming best-effort semantics and the scale - up size is lowered in many situations: - - Estimation logic, which stops after some time-out or number of - pods/nodes. - - Size limiting, which caps the scale-up to match the size - restrictions (on node group or cluster level). -3. Node creation, which needs to support atomic resize. Either via native cloud - provider APIs or best effort with node removal if CA is unable to fulfill - the scale-up. - - This is also quite substantial change, we can provide a generic - best-effort implementation that will try to scale up and clean-up nodes - if it is unsuccessful, but it is up to cloud providers to integrate with - provider specific APIs. -4. Scale down path is not expected to change much. But users should follow - [best - practices](https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a-node) - to avoid CA disturbing their workloads. - -## Testing - -The following e2e test scenarios will be created to check whether ProvReq -handling works as expected: - -1. A new ProvReq with `check-capacity.kubernetes.io` provisioning class is created, CA - checks if there is enough capacity in cluster to provision specified pods. -2. A new ProvReq with `atomic-scale-up.kubernetes.io` provisioning class is created, CA - picks an appropriate node group scales it up atomically. -3. A new atomic ProvReq is created for which a NAP needs to provision a new - node group. NAP creates it CA scales it atomically. - - Here we should cover some of the different reasons why NAP may be - required. -4. An atomic ProvReq fails due to node group size limits and NAP CPU and/or RAM - limits. -5. Scalability tests. - - Scenario in which many small ProvReqs are created (strain on the number - of scale-up loops). - - Scenario in which big ProvReq is created (strain on a single scale-up - loop). - -## Limitations - -The current Cluster Autoscaler implementation is not taking into account [Resource Quotas](https://kubernetes.io/docs/concepts/policy/resource-quotas/). \ -The current proposal is to not include handling of the Resource Quotas, but it could be added later on. - -## Future Expansions - -### ProvisioningClass CRD - -One of the expansion of this approach is to introduce the ProvisioningClass CRD, -which follows the same approach as -[StorageClass object](https://kubernetes.io/docs/concepts/storage/storage-classes/). -Such approach would allow administrators of the cluster to introduce a list of allowed -ProvisioningClasses. Such CRD can also contain a pre set configuration, i.e. -administrators may set that `atomic-scale-up.kubernetes.io` would retry up to `2h`. - -Possible CRD definition: -```go -// ProvisioningClass is a way to express provisioning classes available in the cluster. -type ProvisioningClass struct { - // Name denotes the name of the object, which is to be used in the ProvisioningClass - // field in Provisioning Request CRD. - // - // +kubebuilder:validation:Required - Name string `json:"name"` - - // Parameters contains all other parameters custom classes may require. - // - // +optional - Parameters map[string]string `json:"Parameters"` -} -``` diff --git a/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/doc.go b/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/doc.go deleted file mode 100644 index ff0f1d9bdcc5..000000000000 --- a/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -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 v1beta1 contains definitions of Provisioning Request related objects. -// +k8s:deepcopy-gen=package -// +k8s:defaulter-gen=TypeMeta -// +groupName=autoscaling.x-k8s.io -package v1beta1 diff --git a/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/register.go b/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/register.go deleted file mode 100644 index 3f3a361b0485..000000000000 --- a/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -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 v1beta1 contains definitions of Provisioning Request related objects. -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -const ( - // GroupName represents the group name for ProvisioningRequest resources. - GroupName = "autoscaling.x-k8s.io" - // GroupVersion represents the group name for ProvisioningRequest resources. - GroupVersion = "v1beta1" -) - -// SchemeGroupVersion represents the group version object for ProvisioningRequest scheme. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: GroupVersion} - -var ( - // SchemeBuilder is the scheme builder for ProvisioningRequest. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme is the func that applies all the stored functions to the scheme. - AddToScheme = SchemeBuilder.AddToScheme -) - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &ProvisioningRequest{}, - &ProvisioningRequestList{}, - ) - - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/types.go b/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/types.go deleted file mode 100644 index 4309091c6d6a..000000000000 --- a/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/types.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -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 v1beta1 contains definitions of Provisioning Request related objects. -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - // Dependencies for the generation of the code: - _ "github.com/onsi/ginkgo/v2" - _ "github.com/onsi/gomega" - _ "k8s.io/code-generator" -) - -// +genclient -// +kubebuilder:storageversions -// +kubebuilder:resource:shortName=provreq;provreqs - -// ProvisioningRequest is a way to express additional capacity -// that we would like to provision in the cluster. Cluster Autoscaler -// can use this information in its calculations and signal if the capacity -// is available in the cluster or actively add capacity if needed. -// -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ProvisioningRequest struct { - metav1.TypeMeta `json:",inline"` - // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - // Spec contains specification of the ProvisioningRequest object. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. - // The spec is immutable, to make changes to the request users are expected to delete an existing - // and create a new object with the corrected fields. - // - // +kubebuilder:validation:Required - Spec ProvisioningRequestSpec `json:"spec"` - // Status of the ProvisioningRequest. CA constantly reconciles this field. - // - // +optional - Status ProvisioningRequestStatus `json:"status,omitempty"` -} - -// ProvisioningRequestList is a object for list of ProvisioningRequest. -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ProvisioningRequestList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // - // +optional - metav1.ListMeta `json:"metadata"` - // Items, list of ProvisioningRequest returned from API. - // - // +optional - Items []ProvisioningRequest `json:"items"` -} - -// ProvisioningRequestSpec is a specification of additional pods for which we -// would like to provision additional resources in the cluster. -type ProvisioningRequestSpec struct { - // PodSets lists groups of pods for which we would like to provision - // resources. - // - // +kubebuilder:validation:Required - // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:MaxItems=32 - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" - PodSets []PodSet `json:"podSets"` - - // ProvisioningClassName describes the different modes of provisioning the resources. - // Currently there is no support for 'ProvisioningClass' objects. - // Supported values: - // * check-capacity.kubernetes.io - check if current cluster state can fullfil this request, - // do not reserve the capacity. Users should provide a reference to a valid PodTemplate object. - // CA will check if there is enough capacity in cluster to fulfill the request and put - // the answer in 'CapacityAvailable' condition. - // * atomic-scale-up.kubernetes.io - provision the resources in an atomic manner. - // Users should provide a reference to a valid PodTemplate object. - // CA will try to create the VMs in an atomic manner, clean any partially provisioned VMs - // and re-try the operation in a exponential back-off manner. Users can configure the timeout - // duration after which the request will fail by 'ValidUntilSeconds' key in 'Parameters'. - // CA will set 'Failed=true' or 'Provisioned=true' condition according to the outcome. - // * ... - potential other classes that are specific to the cloud providers. - // 'kubernetes.io' suffix is reserved for the modes defined in Kubernetes projects. - // - // +kubebuilder:validation:Required - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" - // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` - // +kubebuilder:validation:MaxLength=253 - ProvisioningClassName string `json:"provisioningClassName"` - - // Parameters contains all other parameters classes may require. - // 'atomic-scale-up.kubernetes.io' supports 'ValidUntilSeconds' parameter, which should contain - // a string denoting duration for which we should retry (measured since creation fo the CR). - // - // +optional - // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable" - // +kubebuilder:validation:MaxProperties=100 - Parameters map[string]Parameter `json:"parameters"` -} - -// Parameter is limited to 255 characters. -// +kubebuilder:validation:MaxLength=255 -type Parameter string - -// PodSet represents one group of pods for Provisioning Request to provision capacity. -type PodSet struct { - // PodTemplateRef is a reference to a PodTemplate object that is representing pods - // that will consume this reservation (must be within the same namespace). - // Users need to make sure that the fields relevant to scheduler (e.g. node selector tolerations) - // are consistent between this template and actual pods consuming the Provisioning Request. - // - // +kubebuilder:validation:Required - PodTemplateRef Reference `json:"podTemplateRef"` - // Count contains the number of pods that will be created with a given - // template. - // - // +kubebuilder:validation:Minimum=1 - Count int32 `json:"count"` -} - -// Reference represents reference to an object within the same namespace. -type Reference struct { - // Name of the referenced object. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names - // - // +kubebuilder:validation:Required - // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` - // +kubebuilder:validation:MaxLength=253 - Name string `json:"name,omitempty"` -} - -// ProvisioningRequestStatus represents the status of the resource reservation. -type ProvisioningRequestStatus struct { - // Conditions represent the observations of a Provisioning Request's - // current state. Those will contain information whether the capacity - // was found/created or if there were any issues. The condition types - // may differ between different provisioning classes. - // - // +listType=map - // +listMapKey=type - // +patchStrategy=merge - // +patchMergeKey=type - // +optional - Conditions []metav1.Condition `json:"conditions"` - - // ProvisioningClassDetails contains all other values custom provisioning classes may - // want to pass to end users. - // - // +optional - // +kubebuilder:validation:MaxProperties=64 - ProvisioningClassDetails map[string]Detail `json:"provisioningClassDetails"` -} - -// Detail is limited to 32768 characters. -// +kubebuilder:validation:MaxLength=32768 -type Detail string - -// The following constants list all currently available Conditions Type values. -// See: https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Condition -const ( - // CapacityAvailable indicates that all of the requested resources were - // already available in the cluster. - CapacityAvailable string = "CapacityAvailable" - // Provisioned indicates that all of the requested resources were created - // and are available in the cluster. CA will set this condition when the - // VM creation finishes successfully. - Provisioned string = "Provisioned" - // Failed indicates that it is impossible to obtain resources to fulfill - // this ProvisioningRequest. - // Condition Reason and Message will contain more details about what failed. - Failed string = "Failed" -) - -const ( - // ProvisioningClassCheckCapacity denotes that CA will check if free capacity - // is available in the cluster. - ProvisioningClassCheckCapacity string = "check-capacity.kubernetes.io" - // ProvisioningClassAtomicScaleUp denotes that CA try to provision the capacity - // in an atomic manner. - ProvisioningClassAtomicScaleUp string = "atomic-scale-up.kubernetes.io" -) diff --git a/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/zz_generated.deepcopy.go b/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index d34851a169c9..000000000000 --- a/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PodSet) DeepCopyInto(out *PodSet) { - *out = *in - out.PodTemplateRef = in.PodTemplateRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSet. -func (in *PodSet) DeepCopy() *PodSet { - if in == nil { - return nil - } - out := new(PodSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProvisioningRequest) DeepCopyInto(out *ProvisioningRequest) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisioningRequest. -func (in *ProvisioningRequest) DeepCopy() *ProvisioningRequest { - if in == nil { - return nil - } - out := new(ProvisioningRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProvisioningRequest) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProvisioningRequestList) DeepCopyInto(out *ProvisioningRequestList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ProvisioningRequest, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisioningRequestList. -func (in *ProvisioningRequestList) DeepCopy() *ProvisioningRequestList { - if in == nil { - return nil - } - out := new(ProvisioningRequestList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ProvisioningRequestList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProvisioningRequestSpec) DeepCopyInto(out *ProvisioningRequestSpec) { - *out = *in - if in.PodSets != nil { - in, out := &in.PodSets, &out.PodSets - *out = make([]PodSet, len(*in)) - copy(*out, *in) - } - if in.Parameters != nil { - in, out := &in.Parameters, &out.Parameters - *out = make(map[string]Parameter, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisioningRequestSpec. -func (in *ProvisioningRequestSpec) DeepCopy() *ProvisioningRequestSpec { - if in == nil { - return nil - } - out := new(ProvisioningRequestSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProvisioningRequestStatus) DeepCopyInto(out *ProvisioningRequestStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ProvisioningClassDetails != nil { - in, out := &in.ProvisioningClassDetails, &out.ProvisioningClassDetails - *out = make(map[string]Detail, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisioningRequestStatus. -func (in *ProvisioningRequestStatus) DeepCopy() *ProvisioningRequestStatus { - if in == nil { - return nil - } - out := new(ProvisioningRequestStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Reference) DeepCopyInto(out *Reference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Reference. -func (in *Reference) DeepCopy() *Reference { - if in == nil { - return nil - } - out := new(Reference) - in.DeepCopyInto(out) - return out -} diff --git a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/podset.go b/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/podset.go deleted file mode 100644 index b65221d8021b..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/podset.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// PodSetApplyConfiguration represents an declarative configuration of the PodSet type for use -// with apply. -type PodSetApplyConfiguration struct { - PodTemplateRef *ReferenceApplyConfiguration `json:"podTemplateRef,omitempty"` - Count *int32 `json:"count,omitempty"` -} - -// PodSetApplyConfiguration constructs an declarative configuration of the PodSet type for use with -// apply. -func PodSet() *PodSetApplyConfiguration { - return &PodSetApplyConfiguration{} -} - -// WithPodTemplateRef sets the PodTemplateRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PodTemplateRef field is set to the value of the last call. -func (b *PodSetApplyConfiguration) WithPodTemplateRef(value *ReferenceApplyConfiguration) *PodSetApplyConfiguration { - b.PodTemplateRef = value - return b -} - -// WithCount sets the Count field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Count field is set to the value of the last call. -func (b *PodSetApplyConfiguration) WithCount(value int32) *PodSetApplyConfiguration { - b.Count = &value - return b -} diff --git a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go b/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go deleted file mode 100644 index 7a420da3c42a..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ProvisioningRequestApplyConfiguration represents an declarative configuration of the ProvisioningRequest type for use -// with apply. -type ProvisioningRequestApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *ProvisioningRequestSpecApplyConfiguration `json:"spec,omitempty"` - Status *ProvisioningRequestStatusApplyConfiguration `json:"status,omitempty"` -} - -// ProvisioningRequest constructs an declarative configuration of the ProvisioningRequest type for use with -// apply. -func ProvisioningRequest(name, namespace string) *ProvisioningRequestApplyConfiguration { - b := &ProvisioningRequestApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("ProvisioningRequest") - b.WithAPIVersion("autoscaling.x-k8s.io/v1beta1") - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithKind(value string) *ProvisioningRequestApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithAPIVersion(value string) *ProvisioningRequestApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithName(value string) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithGenerateName(value string) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithNamespace(value string) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithUID(value types.UID) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithResourceVersion(value string) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithGeneration(value int64) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ProvisioningRequestApplyConfiguration) WithLabels(entries map[string]string) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ProvisioningRequestApplyConfiguration) WithAnnotations(entries map[string]string) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ProvisioningRequestApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ProvisioningRequestApplyConfiguration) WithFinalizers(values ...string) *ProvisioningRequestApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ProvisioningRequestApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithSpec(value *ProvisioningRequestSpecApplyConfiguration) *ProvisioningRequestApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *ProvisioningRequestApplyConfiguration) WithStatus(value *ProvisioningRequestStatusApplyConfiguration) *ProvisioningRequestApplyConfiguration { - b.Status = value - return b -} diff --git a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequestspec.go b/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequestspec.go deleted file mode 100644 index bc4b9566d30a..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequestspec.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - autoscalingxk8siov1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" -) - -// ProvisioningRequestSpecApplyConfiguration represents an declarative configuration of the ProvisioningRequestSpec type for use -// with apply. -type ProvisioningRequestSpecApplyConfiguration struct { - PodSets []PodSetApplyConfiguration `json:"podSets,omitempty"` - ProvisioningClassName *string `json:"provisioningClassName,omitempty"` - Parameters map[string]autoscalingxk8siov1beta1.Parameter `json:"parameters,omitempty"` -} - -// ProvisioningRequestSpecApplyConfiguration constructs an declarative configuration of the ProvisioningRequestSpec type for use with -// apply. -func ProvisioningRequestSpec() *ProvisioningRequestSpecApplyConfiguration { - return &ProvisioningRequestSpecApplyConfiguration{} -} - -// WithPodSets adds the given value to the PodSets field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the PodSets field. -func (b *ProvisioningRequestSpecApplyConfiguration) WithPodSets(values ...*PodSetApplyConfiguration) *ProvisioningRequestSpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithPodSets") - } - b.PodSets = append(b.PodSets, *values[i]) - } - return b -} - -// WithProvisioningClassName sets the ProvisioningClassName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ProvisioningClassName field is set to the value of the last call. -func (b *ProvisioningRequestSpecApplyConfiguration) WithProvisioningClassName(value string) *ProvisioningRequestSpecApplyConfiguration { - b.ProvisioningClassName = &value - return b -} - -// WithParameters puts the entries into the Parameters field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Parameters field, -// overwriting an existing map entries in Parameters field with the same key. -func (b *ProvisioningRequestSpecApplyConfiguration) WithParameters(entries map[string]autoscalingxk8siov1beta1.Parameter) *ProvisioningRequestSpecApplyConfiguration { - if b.Parameters == nil && len(entries) > 0 { - b.Parameters = make(map[string]autoscalingxk8siov1beta1.Parameter, len(entries)) - } - for k, v := range entries { - b.Parameters[k] = v - } - return b -} diff --git a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequeststatus.go b/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequeststatus.go deleted file mode 100644 index e8746ecc2f7b..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/provisioningrequeststatus.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" -) - -// ProvisioningRequestStatusApplyConfiguration represents an declarative configuration of the ProvisioningRequestStatus type for use -// with apply. -type ProvisioningRequestStatusApplyConfiguration struct { - Conditions []v1.Condition `json:"conditions,omitempty"` - ProvisioningClassDetails map[string]v1beta1.Detail `json:"provisioningClassDetails,omitempty"` -} - -// ProvisioningRequestStatusApplyConfiguration constructs an declarative configuration of the ProvisioningRequestStatus type for use with -// apply. -func ProvisioningRequestStatus() *ProvisioningRequestStatusApplyConfiguration { - return &ProvisioningRequestStatusApplyConfiguration{} -} - -// WithConditions adds the given value to the Conditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *ProvisioningRequestStatusApplyConfiguration) WithConditions(values ...v1.Condition) *ProvisioningRequestStatusApplyConfiguration { - for i := range values { - b.Conditions = append(b.Conditions, values[i]) - } - return b -} - -// WithProvisioningClassDetails puts the entries into the ProvisioningClassDetails field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the ProvisioningClassDetails field, -// overwriting an existing map entries in ProvisioningClassDetails field with the same key. -func (b *ProvisioningRequestStatusApplyConfiguration) WithProvisioningClassDetails(entries map[string]v1beta1.Detail) *ProvisioningRequestStatusApplyConfiguration { - if b.ProvisioningClassDetails == nil && len(entries) > 0 { - b.ProvisioningClassDetails = make(map[string]v1beta1.Detail, len(entries)) - } - for k, v := range entries { - b.ProvisioningClassDetails[k] = v - } - return b -} diff --git a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/reference.go b/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/reference.go deleted file mode 100644 index e395468feef4..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1/reference.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// ReferenceApplyConfiguration represents an declarative configuration of the Reference type for use -// with apply. -type ReferenceApplyConfiguration struct { - Name *string `json:"name,omitempty"` -} - -// ReferenceApplyConfiguration constructs an declarative configuration of the Reference type for use with -// apply. -func Reference() *ReferenceApplyConfiguration { - return &ReferenceApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ReferenceApplyConfiguration) WithName(value string) *ReferenceApplyConfiguration { - b.Name = &value - return b -} diff --git a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/internal/internal.go b/cluster-autoscaler/provisioningrequest/client/applyconfiguration/internal/internal.go deleted file mode 100644 index 4d7ef1313fbd..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/internal/internal.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package internal - -import ( - "fmt" - "sync" - - typed "sigs.k8s.io/structured-merge-diff/v4/typed" -) - -func Parser() *typed.Parser { - parserOnce.Do(func() { - var err error - parser, err = typed.NewParser(schemaYAML) - if err != nil { - panic(fmt.Sprintf("Failed to parse schema: %v", err)) - } - }) - return parser -} - -var parserOnce sync.Once -var parser *typed.Parser -var schemaYAML = typed.YAMLObject(`types: -- name: __untyped_atomic_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic -- name: __untyped_deduced_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_deduced_ - elementRelationship: separable -`) diff --git a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/utils.go b/cluster-autoscaler/provisioningrequest/client/applyconfiguration/utils.go deleted file mode 100644 index cc1c299a7051..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/applyconfiguration/utils.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package applyconfiguration - -import ( - schema "k8s.io/apimachinery/pkg/runtime/schema" - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - autoscalingxk8siov1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1" -) - -// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no -// apply configuration type exists for the given GroupVersionKind. -func ForKind(kind schema.GroupVersionKind) interface{} { - switch kind { - // Group=autoscaling.x-k8s.io, Version=v1beta1 - case v1beta1.SchemeGroupVersion.WithKind("PodSet"): - return &autoscalingxk8siov1beta1.PodSetApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ProvisioningRequest"): - return &autoscalingxk8siov1beta1.ProvisioningRequestApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ProvisioningRequestSpec"): - return &autoscalingxk8siov1beta1.ProvisioningRequestSpecApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("ProvisioningRequestStatus"): - return &autoscalingxk8siov1beta1.ProvisioningRequestStatusApplyConfiguration{} - case v1beta1.SchemeGroupVersion.WithKind("Reference"): - return &autoscalingxk8siov1beta1.ReferenceApplyConfiguration{} - - } - return nil -} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/clientset.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/clientset.go deleted file mode 100644 index c081e28ef99e..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/clientset.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - "fmt" - "net/http" - - autoscalingv1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - AutoscalingV1beta1() autoscalingv1beta1.AutoscalingV1beta1Interface -} - -// Clientset contains the clients for groups. -type Clientset struct { - *discovery.DiscoveryClient - autoscalingV1beta1 *autoscalingv1beta1.AutoscalingV1beta1Client -} - -// AutoscalingV1beta1 retrieves the AutoscalingV1beta1Client -func (c *Clientset) AutoscalingV1beta1() autoscalingv1beta1.AutoscalingV1beta1Interface { - return c.autoscalingV1beta1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - - if configShallowCopy.UserAgent == "" { - configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() - } - - // share the transport between all clients - httpClient, err := rest.HTTPClientFor(&configShallowCopy) - if err != nil { - return nil, err - } - - return NewForConfigAndClient(&configShallowCopy, httpClient) -} - -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - - var cs Clientset - var err error - cs.autoscalingV1beta1, err = autoscalingv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - cs, err := NewForConfig(c) - if err != nil { - panic(err) - } - return cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.autoscalingV1beta1 = autoscalingv1beta1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/clientset_generated.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index 2b733ffca62b..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - clientset "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned" - autoscalingv1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1" - fakeautoscalingv1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} - -var ( - _ clientset.Interface = &Clientset{} - _ testing.FakeClient = &Clientset{} -) - -// AutoscalingV1beta1 retrieves the AutoscalingV1beta1Client -func (c *Clientset) AutoscalingV1beta1() autoscalingv1beta1.AutoscalingV1beta1Interface { - return &fakeautoscalingv1beta1.FakeAutoscalingV1beta1{Fake: &c.Fake} -} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/doc.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/doc.go deleted file mode 100644 index 9b99e7167091..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/register.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/register.go deleted file mode 100644 index e21a07104c0a..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - autoscalingv1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) - -var localSchemeBuilder = runtime.SchemeBuilder{ - autoscalingv1beta1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/scheme/doc.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7dc3756168fa..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/scheme/register.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/scheme/register.go deleted file mode 100644 index 3defe5bb3368..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - autoscalingv1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - autoscalingv1beta1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/autoscaling.x-k8s.io_client.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/autoscaling.x-k8s.io_client.go deleted file mode 100644 index 95af8c0ea0eb..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/autoscaling.x-k8s.io_client.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "net/http" - - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type AutoscalingV1beta1Interface interface { - RESTClient() rest.Interface - ProvisioningRequestsGetter -} - -// AutoscalingV1beta1Client is used to interact with features provided by the autoscaling.x-k8s.io group. -type AutoscalingV1beta1Client struct { - restClient rest.Interface -} - -func (c *AutoscalingV1beta1Client) ProvisioningRequests(namespace string) ProvisioningRequestInterface { - return newProvisioningRequests(c, namespace) -} - -// NewForConfig creates a new AutoscalingV1beta1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*AutoscalingV1beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new AutoscalingV1beta1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV1beta1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &AutoscalingV1beta1Client{client}, nil -} - -// NewForConfigOrDie creates a new AutoscalingV1beta1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *AutoscalingV1beta1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new AutoscalingV1beta1Client for the given RESTClient. -func New(c rest.Interface) *AutoscalingV1beta1Client { - return &AutoscalingV1beta1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *AutoscalingV1beta1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/doc.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/doc.go deleted file mode 100644 index 771101956f36..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1beta1 diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/doc.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/doc.go deleted file mode 100644 index 16f44399065e..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/fake_autoscaling.x-k8s.io_client.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/fake_autoscaling.x-k8s.io_client.go deleted file mode 100644 index 89365e84c337..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/fake_autoscaling.x-k8s.io_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeAutoscalingV1beta1 struct { - *testing.Fake -} - -func (c *FakeAutoscalingV1beta1) ProvisioningRequests(namespace string) v1beta1.ProvisioningRequestInterface { - return &FakeProvisioningRequests{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeAutoscalingV1beta1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/fake_provisioningrequest.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/fake_provisioningrequest.go deleted file mode 100644 index e1dc7262f2fa..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/fake/fake_provisioningrequest.go +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - autoscalingxk8siov1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeProvisioningRequests implements ProvisioningRequestInterface -type FakeProvisioningRequests struct { - Fake *FakeAutoscalingV1beta1 - ns string -} - -var provisioningrequestsResource = v1beta1.SchemeGroupVersion.WithResource("provisioningrequests") - -var provisioningrequestsKind = v1beta1.SchemeGroupVersion.WithKind("ProvisioningRequest") - -// Get takes name of the provisioningRequest, and returns the corresponding provisioningRequest object, and an error if there is any. -func (c *FakeProvisioningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ProvisioningRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(provisioningrequestsResource, c.ns, name), &v1beta1.ProvisioningRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ProvisioningRequest), err -} - -// List takes label and field selectors, and returns the list of ProvisioningRequests that match those selectors. -func (c *FakeProvisioningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ProvisioningRequestList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(provisioningrequestsResource, provisioningrequestsKind, c.ns, opts), &v1beta1.ProvisioningRequestList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ProvisioningRequestList{ListMeta: obj.(*v1beta1.ProvisioningRequestList).ListMeta} - for _, item := range obj.(*v1beta1.ProvisioningRequestList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested provisioningRequests. -func (c *FakeProvisioningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(provisioningrequestsResource, c.ns, opts)) - -} - -// Create takes the representation of a provisioningRequest and creates it. Returns the server's representation of the provisioningRequest, and an error, if there is any. -func (c *FakeProvisioningRequests) Create(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.CreateOptions) (result *v1beta1.ProvisioningRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(provisioningrequestsResource, c.ns, provisioningRequest), &v1beta1.ProvisioningRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ProvisioningRequest), err -} - -// Update takes the representation of a provisioningRequest and updates it. Returns the server's representation of the provisioningRequest, and an error, if there is any. -func (c *FakeProvisioningRequests) Update(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.UpdateOptions) (result *v1beta1.ProvisioningRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(provisioningrequestsResource, c.ns, provisioningRequest), &v1beta1.ProvisioningRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ProvisioningRequest), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeProvisioningRequests) UpdateStatus(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.UpdateOptions) (*v1beta1.ProvisioningRequest, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(provisioningrequestsResource, "status", c.ns, provisioningRequest), &v1beta1.ProvisioningRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ProvisioningRequest), err -} - -// Delete takes name of the provisioningRequest and deletes it. Returns an error if one occurs. -func (c *FakeProvisioningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(provisioningrequestsResource, c.ns, name, opts), &v1beta1.ProvisioningRequest{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeProvisioningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(provisioningrequestsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ProvisioningRequestList{}) - return err -} - -// Patch applies the patch and returns the patched provisioningRequest. -func (c *FakeProvisioningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ProvisioningRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(provisioningrequestsResource, c.ns, name, pt, data, subresources...), &v1beta1.ProvisioningRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ProvisioningRequest), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied provisioningRequest. -func (c *FakeProvisioningRequests) Apply(ctx context.Context, provisioningRequest *autoscalingxk8siov1beta1.ProvisioningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ProvisioningRequest, err error) { - if provisioningRequest == nil { - return nil, fmt.Errorf("provisioningRequest provided to Apply must not be nil") - } - data, err := json.Marshal(provisioningRequest) - if err != nil { - return nil, err - } - name := provisioningRequest.Name - if name == nil { - return nil, fmt.Errorf("provisioningRequest.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(provisioningrequestsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ProvisioningRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ProvisioningRequest), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeProvisioningRequests) ApplyStatus(ctx context.Context, provisioningRequest *autoscalingxk8siov1beta1.ProvisioningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ProvisioningRequest, err error) { - if provisioningRequest == nil { - return nil, fmt.Errorf("provisioningRequest provided to Apply must not be nil") - } - data, err := json.Marshal(provisioningRequest) - if err != nil { - return nil, err - } - name := provisioningRequest.Name - if name == nil { - return nil, fmt.Errorf("provisioningRequest.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(provisioningrequestsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.ProvisioningRequest{}) - - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ProvisioningRequest), err -} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/generated_expansion.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/generated_expansion.go deleted file mode 100644 index 66b471322a5d..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -type ProvisioningRequestExpansion interface{} diff --git a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go b/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go deleted file mode 100644 index b14e8c7f820b..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/clientset/versioned/typed/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - autoscalingxk8siov1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/applyconfiguration/autoscaling.x-k8s.io/v1beta1" - scheme "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -// ProvisioningRequestsGetter has a method to return a ProvisioningRequestInterface. -// A group's client should implement this interface. -type ProvisioningRequestsGetter interface { - ProvisioningRequests(namespace string) ProvisioningRequestInterface -} - -// ProvisioningRequestInterface has methods to work with ProvisioningRequest resources. -type ProvisioningRequestInterface interface { - Create(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.CreateOptions) (*v1beta1.ProvisioningRequest, error) - Update(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.UpdateOptions) (*v1beta1.ProvisioningRequest, error) - UpdateStatus(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.UpdateOptions) (*v1beta1.ProvisioningRequest, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ProvisioningRequest, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ProvisioningRequestList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ProvisioningRequest, err error) - Apply(ctx context.Context, provisioningRequest *autoscalingxk8siov1beta1.ProvisioningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ProvisioningRequest, err error) - ApplyStatus(ctx context.Context, provisioningRequest *autoscalingxk8siov1beta1.ProvisioningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ProvisioningRequest, err error) - ProvisioningRequestExpansion -} - -// provisioningRequests implements ProvisioningRequestInterface -type provisioningRequests struct { - client rest.Interface - ns string -} - -// newProvisioningRequests returns a ProvisioningRequests -func newProvisioningRequests(c *AutoscalingV1beta1Client, namespace string) *provisioningRequests { - return &provisioningRequests{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the provisioningRequest, and returns the corresponding provisioningRequest object, and an error if there is any. -func (c *provisioningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ProvisioningRequest, err error) { - result = &v1beta1.ProvisioningRequest{} - err = c.client.Get(). - Namespace(c.ns). - Resource("provisioningrequests"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ProvisioningRequests that match those selectors. -func (c *provisioningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ProvisioningRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ProvisioningRequestList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("provisioningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested provisioningRequests. -func (c *provisioningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("provisioningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a provisioningRequest and creates it. Returns the server's representation of the provisioningRequest, and an error, if there is any. -func (c *provisioningRequests) Create(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.CreateOptions) (result *v1beta1.ProvisioningRequest, err error) { - result = &v1beta1.ProvisioningRequest{} - err = c.client.Post(). - Namespace(c.ns). - Resource("provisioningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(provisioningRequest). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a provisioningRequest and updates it. Returns the server's representation of the provisioningRequest, and an error, if there is any. -func (c *provisioningRequests) Update(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.UpdateOptions) (result *v1beta1.ProvisioningRequest, err error) { - result = &v1beta1.ProvisioningRequest{} - err = c.client.Put(). - Namespace(c.ns). - Resource("provisioningrequests"). - Name(provisioningRequest.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(provisioningRequest). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *provisioningRequests) UpdateStatus(ctx context.Context, provisioningRequest *v1beta1.ProvisioningRequest, opts v1.UpdateOptions) (result *v1beta1.ProvisioningRequest, err error) { - result = &v1beta1.ProvisioningRequest{} - err = c.client.Put(). - Namespace(c.ns). - Resource("provisioningrequests"). - Name(provisioningRequest.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(provisioningRequest). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the provisioningRequest and deletes it. Returns an error if one occurs. -func (c *provisioningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("provisioningrequests"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *provisioningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("provisioningrequests"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched provisioningRequest. -func (c *provisioningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ProvisioningRequest, err error) { - result = &v1beta1.ProvisioningRequest{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("provisioningrequests"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied provisioningRequest. -func (c *provisioningRequests) Apply(ctx context.Context, provisioningRequest *autoscalingxk8siov1beta1.ProvisioningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ProvisioningRequest, err error) { - if provisioningRequest == nil { - return nil, fmt.Errorf("provisioningRequest provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(provisioningRequest) - if err != nil { - return nil, err - } - name := provisioningRequest.Name - if name == nil { - return nil, fmt.Errorf("provisioningRequest.Name must be provided to Apply") - } - result = &v1beta1.ProvisioningRequest{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("provisioningrequests"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *provisioningRequests) ApplyStatus(ctx context.Context, provisioningRequest *autoscalingxk8siov1beta1.ProvisioningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ProvisioningRequest, err error) { - if provisioningRequest == nil { - return nil, fmt.Errorf("provisioningRequest provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(provisioningRequest) - if err != nil { - return nil, err - } - - name := provisioningRequest.Name - if name == nil { - return nil, fmt.Errorf("provisioningRequest.Name must be provided to Apply") - } - - result = &v1beta1.ProvisioningRequest{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("provisioningrequests"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/interface.go b/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/interface.go deleted file mode 100644 index 5e943f6a06bb..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package autoscaling - -import ( - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/v1beta1" - internalinterfaces "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1beta1 provides access to shared informers for resources in V1beta1. - V1beta1() v1beta1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1beta1 returns a new v1beta1.Interface. -func (g *group) V1beta1() v1beta1.Interface { - return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/v1beta1/interface.go b/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/v1beta1/interface.go deleted file mode 100644 index cefcfe5baa22..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/v1beta1/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1beta1 - -import ( - internalinterfaces "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // ProvisioningRequests returns a ProvisioningRequestInformer. - ProvisioningRequests() ProvisioningRequestInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// ProvisioningRequests returns a ProvisioningRequestInformer. -func (v *version) ProvisioningRequests() ProvisioningRequestInformer { - return &provisioningRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go b/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go deleted file mode 100644 index 382cb5d03051..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - autoscalingxk8siov1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - versioned "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned" - internalinterfaces "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/informers/externalversions/internalinterfaces" - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1" - cache "k8s.io/client-go/tools/cache" -) - -// ProvisioningRequestInformer provides access to a shared informer and lister for -// ProvisioningRequests. -type ProvisioningRequestInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1beta1.ProvisioningRequestLister -} - -type provisioningRequestInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewProvisioningRequestInformer constructs a new informer for ProvisioningRequest type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewProvisioningRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredProvisioningRequestInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredProvisioningRequestInformer constructs a new informer for ProvisioningRequest type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredProvisioningRequestInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AutoscalingV1beta1().ProvisioningRequests(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AutoscalingV1beta1().ProvisioningRequests(namespace).Watch(context.TODO(), options) - }, - }, - &autoscalingxk8siov1beta1.ProvisioningRequest{}, - resyncPeriod, - indexers, - ) -} - -func (f *provisioningRequestInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredProvisioningRequestInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *provisioningRequestInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&autoscalingxk8siov1beta1.ProvisioningRequest{}, f.defaultInformer) -} - -func (f *provisioningRequestInformer) Lister() v1beta1.ProvisioningRequestLister { - return v1beta1.NewProvisioningRequestLister(f.Informer().GetIndexer()) -} diff --git a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/factory.go b/cluster-autoscaler/provisioningrequest/client/informers/externalversions/factory.go deleted file mode 100644 index fcd0d06ce139..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/factory.go +++ /dev/null @@ -1,251 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - versioned "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned" - autoscalingxk8sio "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/informers/externalversions/autoscaling.x-k8s.io" - internalinterfaces "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/informers/externalversions/internalinterfaces" - cache "k8s.io/client-go/tools/cache" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client versioned.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool - // wg tracks how many goroutines were started. - wg sync.WaitGroup - // shuttingDown is true when Shutdown has been called. It may still be running - // because it needs to wait for goroutines. - shuttingDown bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - if f.shuttingDown { - return - } - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - f.wg.Add(1) - // We need a new variable in each loop iteration, - // otherwise the goroutine would use the loop variable - // and that keeps changing. - informer := informer - go func() { - defer f.wg.Done() - informer.Run(stopCh) - }() - f.startedInformers[informerType] = true - } - } -} - -func (f *sharedInformerFactory) Shutdown() { - f.lock.Lock() - f.shuttingDown = true - f.lock.Unlock() - - // Will return immediately if there is nothing to wait for. - f.wg.Wait() -} - -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -// -// It is typically used like this: -// -// ctx, cancel := context.Background() -// defer cancel() -// factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. -// genericInformer := factory.ForResource(resource) -// typedInformer := factory.SomeAPIGroup().V1().SomeType() -// factory.Start(ctx.Done()) // Start processing these informers. -// synced := factory.WaitForCacheSync(ctx.Done()) -// for v, ok := range synced { -// if !ok { -// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) -// return -// } -// } -// -// // Creating informers can also be created after Start, but then -// // Start must be called again: -// anotherGenericInformer := factory.ForResource(resource) -// factory.Start(ctx.Done()) -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - - // Start initializes all requested informers. They are handled in goroutines - // which run until the stop channel gets closed. - Start(stopCh <-chan struct{}) - - // Shutdown marks a factory as shutting down. At that point no new - // informers can be started anymore and Start will return without - // doing anything. - // - // In addition, Shutdown blocks until all goroutines have terminated. For that - // to happen, the close channel(s) that they were started with must be closed, - // either before Shutdown gets called or while it is waiting. - // - // Shutdown may be called multiple times, even concurrently. All such calls will - // block until all goroutines have terminated. - Shutdown() - - // WaitForCacheSync blocks until all started informers' caches were synced - // or the stop channel gets closed. - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - // ForResource gives generic access to a shared informer of the matching type. - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - - // InformerFor returns the SharedIndexInformer for obj using an internal - // client. - InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer - - Autoscaling() autoscalingxk8sio.Interface -} - -func (f *sharedInformerFactory) Autoscaling() autoscalingxk8sio.Interface { - return autoscalingxk8sio.New(f, f.namespace, f.tweakListOptions) -} diff --git a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/generic.go b/cluster-autoscaler/provisioningrequest/client/informers/externalversions/generic.go deleted file mode 100644 index bc3f61b718aa..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/generic.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - schema "k8s.io/apimachinery/pkg/runtime/schema" - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=autoscaling.x-k8s.io, Version=v1beta1 - case v1beta1.SchemeGroupVersion.WithResource("provisioningrequests"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V1beta1().ProvisioningRequests().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/cluster-autoscaler/provisioningrequest/client/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index e77b74203cc9..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - versioned "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned" - cache "k8s.io/client-go/tools/cache" -) - -// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. -type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -// TweakListOptionsFunc is a function that transforms a v1.ListOptions. -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/cluster-autoscaler/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1/expansion_generated.go b/cluster-autoscaler/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1/expansion_generated.go deleted file mode 100644 index 4821165487a1..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -// ProvisioningRequestListerExpansion allows custom methods to be added to -// ProvisioningRequestLister. -type ProvisioningRequestListerExpansion interface{} - -// ProvisioningRequestNamespaceListerExpansion allows custom methods to be added to -// ProvisioningRequestNamespaceLister. -type ProvisioningRequestNamespaceListerExpansion interface{} diff --git a/cluster-autoscaler/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go b/cluster-autoscaler/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go deleted file mode 100644 index 7737e1a5ccfa..000000000000 --- a/cluster-autoscaler/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1/provisioningrequest.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - v1beta1 "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - "k8s.io/client-go/tools/cache" -) - -// ProvisioningRequestLister helps list ProvisioningRequests. -// All objects returned here must be treated as read-only. -type ProvisioningRequestLister interface { - // List lists all ProvisioningRequests in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.ProvisioningRequest, err error) - // ProvisioningRequests returns an object that can list and get ProvisioningRequests. - ProvisioningRequests(namespace string) ProvisioningRequestNamespaceLister - ProvisioningRequestListerExpansion -} - -// provisioningRequestLister implements the ProvisioningRequestLister interface. -type provisioningRequestLister struct { - indexer cache.Indexer -} - -// NewProvisioningRequestLister returns a new ProvisioningRequestLister. -func NewProvisioningRequestLister(indexer cache.Indexer) ProvisioningRequestLister { - return &provisioningRequestLister{indexer: indexer} -} - -// List lists all ProvisioningRequests in the indexer. -func (s *provisioningRequestLister) List(selector labels.Selector) (ret []*v1beta1.ProvisioningRequest, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ProvisioningRequest)) - }) - return ret, err -} - -// ProvisioningRequests returns an object that can list and get ProvisioningRequests. -func (s *provisioningRequestLister) ProvisioningRequests(namespace string) ProvisioningRequestNamespaceLister { - return provisioningRequestNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ProvisioningRequestNamespaceLister helps list and get ProvisioningRequests. -// All objects returned here must be treated as read-only. -type ProvisioningRequestNamespaceLister interface { - // List lists all ProvisioningRequests in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.ProvisioningRequest, err error) - // Get retrieves the ProvisioningRequest from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.ProvisioningRequest, error) - ProvisioningRequestNamespaceListerExpansion -} - -// provisioningRequestNamespaceLister implements the ProvisioningRequestNamespaceLister -// interface. -type provisioningRequestNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ProvisioningRequests in the indexer for a given namespace. -func (s provisioningRequestNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ProvisioningRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ProvisioningRequest)) - }) - return ret, err -} - -// Get retrieves the ProvisioningRequest from the indexer for a given namespace and name. -func (s provisioningRequestNamespaceLister) Get(name string) (*v1beta1.ProvisioningRequest, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("provisioningrequest"), name) - } - return obj.(*v1beta1.ProvisioningRequest), nil -} diff --git a/cluster-autoscaler/provisioningrequest/provreqwrapper/wrapper.go b/cluster-autoscaler/provisioningrequest/provreqwrapper/wrapper.go deleted file mode 100644 index c6cdb364108a..000000000000 --- a/cluster-autoscaler/provisioningrequest/provreqwrapper/wrapper.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -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 provreqwrapper - -import ( - "fmt" - "strings" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" -) - -// ProvisioningRequest wrapper representation of the ProvisisoningRequest -type ProvisioningRequest struct { - v1Beta1PR *v1beta1.ProvisioningRequest - v1Beta1PodTemplates []*apiv1.PodTemplate -} - -// PodSet wrapper representation of the PodSet. -type PodSet struct { - // Count number of pods with given template. - Count int32 - // PodTemplate template of given pod set. - PodTemplate apiv1.PodTemplateSpec -} - -// NewV1Beta1ProvisioningRequest creates new ProvisioningRequest based on v1beta1 CR. -func NewV1Beta1ProvisioningRequest(v1Beta1PR *v1beta1.ProvisioningRequest, v1Beta1PodTemplates []*apiv1.PodTemplate) *ProvisioningRequest { - return &ProvisioningRequest{ - v1Beta1PR: v1Beta1PR, - v1Beta1PodTemplates: v1Beta1PodTemplates, - } -} - -// Name of the Provisioning Request. -func (pr *ProvisioningRequest) Name() string { - return pr.v1Beta1PR.Name -} - -// Namespace of the Provisioning Request. -func (pr *ProvisioningRequest) Namespace() string { - return pr.v1Beta1PR.Namespace -} - -// CreationTimestamp of the Provisioning Request. -func (pr *ProvisioningRequest) CreationTimestamp() metav1.Time { - return pr.v1Beta1PR.CreationTimestamp -} - -// RuntimeObject returns runtime.Object of the Provisioning Request. -func (pr *ProvisioningRequest) RuntimeObject() runtime.Object { - return pr.v1Beta1PR -} - -// APIVersion returns APIVersion of the Provisioning Request. -func (pr *ProvisioningRequest) APIVersion() string { - return pr.v1Beta1PR.APIVersion -} - -// Kind returns Kind of the Provisioning Request. -func (pr *ProvisioningRequest) Kind() string { - return pr.v1Beta1PR.Kind - -} - -// UID returns UID of the Provisioning Request. -func (pr *ProvisioningRequest) UID() types.UID { - return pr.v1Beta1PR.UID -} - -// Conditions of the Provisioning Request. -func (pr *ProvisioningRequest) Conditions() []metav1.Condition { - return pr.v1Beta1PR.Status.Conditions -} - -// SetConditions of the Provisioning Request. -func (pr *ProvisioningRequest) SetConditions(conditions []metav1.Condition) { - pr.v1Beta1PR.Status.Conditions = conditions - return -} - -// PodSets of the Provisioning Request. -func (pr *ProvisioningRequest) PodSets() ([]PodSet, error) { - if len(pr.v1Beta1PR.Spec.PodSets) != len(pr.v1Beta1PodTemplates) { - return nil, errMissingPodTemplates(pr.v1Beta1PR.Spec.PodSets, pr.v1Beta1PodTemplates) - } - podSets := make([]PodSet, 0, len(pr.v1Beta1PR.Spec.PodSets)) - for i, podSet := range pr.v1Beta1PR.Spec.PodSets { - podSets = append(podSets, PodSet{ - Count: podSet.Count, - PodTemplate: pr.v1Beta1PodTemplates[i].Template, - }) - } - return podSets, nil -} - -// V1Beta1 returns v1beta1 object CR, to be used only to pass information to clients. -func (pr *ProvisioningRequest) V1Beta1() *v1beta1.ProvisioningRequest { - return pr.v1Beta1PR -} - -// PodTemplates returns pod templates associated with the Provisioning Request, to be used only to pass information to clients. -func (pr *ProvisioningRequest) PodTemplates() []*apiv1.PodTemplate { - return pr.v1Beta1PodTemplates -} - -// errMissingPodTemplates creates error that is passed when there are missing pod templates. -func errMissingPodTemplates(podSets []v1beta1.PodSet, podTemplates []*apiv1.PodTemplate) error { - foundPodTemplates := map[string]struct{}{} - for _, pt := range podTemplates { - foundPodTemplates[pt.Name] = struct{}{} - } - missingTemplates := make([]string, 0) - for _, ps := range podSets { - if _, found := foundPodTemplates[ps.PodTemplateRef.Name]; !found { - missingTemplates = append(missingTemplates, ps.PodTemplateRef.Name) - } - } - return fmt.Errorf("missing pod templates, %d pod templates were referenced, %d templates were missing: %s", len(podSets), len(missingTemplates), strings.Join(missingTemplates, ",")) -} diff --git a/cluster-autoscaler/provisioningrequest/provreqwrapper/wrapper_test.go b/cluster-autoscaler/provisioningrequest/provreqwrapper/wrapper_test.go deleted file mode 100644 index 8b5359040df2..000000000000 --- a/cluster-autoscaler/provisioningrequest/provreqwrapper/wrapper_test.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -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 provreqwrapper - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" -) - -func TestProvisioningRequestWrapper(t *testing.T) { - creationTimestamp := metav1.NewTime(time.Date(2023, 11, 12, 13, 14, 15, 0, time.UTC)) - conditions := []metav1.Condition{ - { - LastTransitionTime: metav1.NewTime(time.Date(2022, 11, 12, 13, 14, 15, 0, time.UTC)), - Message: "Message", - ObservedGeneration: 1, - Reason: "Reason", - Status: "Status", - Type: "ConditionType", - }, - } - podSets := []PodSet{ - { - Count: 1, - PodTemplate: apiv1.PodTemplateSpec{ - Spec: apiv1.PodSpec{ - Containers: []apiv1.Container{ - { - Name: "test-container", - Image: "test-image", - }, - }, - }, - }, - }, - } - - podTemplates := []*apiv1.PodTemplate{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: "name-pod-template-beta", - Namespace: "namespace-beta", - CreationTimestamp: creationTimestamp, - }, - Template: apiv1.PodTemplateSpec{ - Spec: apiv1.PodSpec{ - Containers: []apiv1.Container{ - { - Name: "test-container", - Image: "test-image", - }, - }, - }, - }, - }, - } - v1Beta1PR := &v1beta1.ProvisioningRequest{ - TypeMeta: metav1.TypeMeta{ - APIVersion: "beta-api", - Kind: "beta-kind", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "name-beta", - Namespace: "namespace-beta", - CreationTimestamp: creationTimestamp, - UID: types.UID("beta-uid"), - }, - Spec: v1beta1.ProvisioningRequestSpec{ - ProvisioningClassName: "queued-provisioning.gke.io", - PodSets: []v1beta1.PodSet{ - { - Count: 1, - PodTemplateRef: v1beta1.Reference{ - Name: podTemplates[0].Name, - }, - }, - }, - }, - Status: v1beta1.ProvisioningRequestStatus{ - Conditions: conditions, - ProvisioningClassDetails: map[string]v1beta1.Detail{}, - }, - } - - wrappedBetaPR := NewV1Beta1ProvisioningRequest(v1Beta1PR, podTemplates) - - // Check Name, Namespace and Creation accessors - assert.Equal(t, "name-beta", wrappedBetaPR.Name()) - assert.Equal(t, "namespace-beta", wrappedBetaPR.Namespace()) - assert.Equal(t, creationTimestamp, wrappedBetaPR.CreationTimestamp()) - - // Check APIVersion, Kind and UID accessors - assert.Equal(t, "beta-api", wrappedBetaPR.APIVersion()) - assert.Equal(t, "beta-kind", wrappedBetaPR.Kind()) - assert.Equal(t, types.UID("beta-uid"), wrappedBetaPR.UID()) - - // Check the initial conditions - assert.Equal(t, conditions, wrappedBetaPR.Conditions()) - - // Clear conditions and check the values - wrappedBetaPR.SetConditions(nil) - assert.Nil(t, wrappedBetaPR.Conditions()) - - // Set conditions and check the values - wrappedBetaPR.SetConditions(conditions) - assert.Equal(t, conditions, wrappedBetaPR.Conditions()) - - // Check the PodSets - betaPodSets, betaErr := wrappedBetaPR.PodSets() - assert.Nil(t, betaErr) - assert.Equal(t, podSets, betaPodSets) - - // Check the type accessors. - assert.Equal(t, v1Beta1PR, wrappedBetaPR.V1Beta1()) - assert.Equal(t, podTemplates, wrappedBetaPR.PodTemplates()) - - // Check case where the Provisioning Request is missing Pod Templates. - wrappedBetaPRMissingPodTemplates := NewV1Beta1ProvisioningRequest(v1Beta1PR, nil) - podSets, err := wrappedBetaPRMissingPodTemplates.PodSets() - assert.Nil(t, podSets) - assert.EqualError(t, err, "missing pod templates, 1 pod templates were referenced, 1 templates were missing: name-pod-template-beta") -} diff --git a/cluster-autoscaler/provisioningrequest/service/service.go b/cluster-autoscaler/provisioningrequest/service/service.go deleted file mode 100644 index 72ffe9e1a43f..000000000000 --- a/cluster-autoscaler/provisioningrequest/service/service.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -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 provreqservice - -import ( - "fmt" - - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/provreqwrapper" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/service/v1beta1client" - "k8s.io/client-go/rest" -) - -// ProvisioningRequestService represents the service that is able to list, -// access and delete different Provisioning Requests. -type ProvisioningRequestService struct { - provReqV1Beta1Client *v1beta1client.ProvisioningRequestClient -} - -// NewProvisioningRequestService returns new service for interacting with ProvisioningRequests. -func NewProvisioningRequestService(kubeConfig *rest.Config) (*ProvisioningRequestService, error) { - v1Beta1Client, err := v1beta1client.NewProvisioningRequestClient(kubeConfig) - if err != nil { - return nil, err - } - return &ProvisioningRequestService{ - provReqV1Beta1Client: v1Beta1Client, - }, nil -} - -// ProvisioningRequest gets a specific ProvisioningRequest CR. -func (s *ProvisioningRequestService) ProvisioningRequest(namespace, name string) (*provreqwrapper.ProvisioningRequest, error) { - v1Beta1PR, err := s.provReqV1Beta1Client.ProvisioningRequest(namespace, name) - if err == nil { - podTemplates, errPodTemplates := s.provReqV1Beta1Client.FetchPodTemplates(v1Beta1PR) - if errPodTemplates != nil { - return nil, fmt.Errorf("while fetching pod templates for Get Provisioning Request %s/%s got error: %v", namespace, name, errPodTemplates) - } - return provreqwrapper.NewV1Beta1ProvisioningRequest(v1Beta1PR, podTemplates), nil - } - return nil, err -} - -// ProvisioningRequests gets all Queued ProvisioningRequest CRs. -func (s *ProvisioningRequestService) ProvisioningRequests() ([]*provreqwrapper.ProvisioningRequest, error) { - v1Beta1PRs, err := s.provReqV1Beta1Client.ProvisioningRequests() - if err != nil { - return nil, err - } - prs := make([]*provreqwrapper.ProvisioningRequest, 0, len(v1Beta1PRs)) - for _, v1Beta1PR := range v1Beta1PRs { - podTemplates, errPodTemplates := s.provReqV1Beta1Client.FetchPodTemplates(v1Beta1PR) - if errPodTemplates != nil { - return nil, fmt.Errorf("while fetching pod templates for List Provisioning Request %s/%s got error: %v", v1Beta1PR.Namespace, v1Beta1PR.Name, errPodTemplates) - } - prs = append(prs, provreqwrapper.NewV1Beta1ProvisioningRequest(v1Beta1PR, podTemplates)) - } - return prs, nil -} diff --git a/cluster-autoscaler/provisioningrequest/service/v1beta1client/client.go b/cluster-autoscaler/provisioningrequest/service/v1beta1client/client.go deleted file mode 100644 index 59b534ac2be5..000000000000 --- a/cluster-autoscaler/provisioningrequest/service/v1beta1client/client.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -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 v1beta1client - -import ( - "fmt" - "time" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" - - "k8s.io/apimachinery/pkg/labels" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/informers/externalversions" - listers "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/listers/autoscaling.x-k8s.io/v1beta1" - "k8s.io/client-go/informers" - "k8s.io/client-go/kubernetes" - v1 "k8s.io/client-go/listers/core/v1" - "k8s.io/client-go/rest" - - klog "k8s.io/klog/v2" -) - -const ( - provisioningRequestClientCallTimeout = 4 * time.Second -) - -// ProvisioningRequestClient represents client for v1beta1 ProvReq CRD. -type ProvisioningRequestClient struct { - client versioned.Interface - provReqLister listers.ProvisioningRequestLister - podTemplLister v1.PodTemplateLister -} - -// NewProvisioningRequestClient configures and returns a provisioningRequestClient. -func NewProvisioningRequestClient(kubeConfig *rest.Config) (*ProvisioningRequestClient, error) { - prClient, err := newPRClient(kubeConfig) - if err != nil { - return nil, fmt.Errorf("Failed to create Provisioning Request client: %v", err) - } - - provReqLister, err := newPRsLister(prClient, make(chan struct{})) - if err != nil { - return nil, err - } - - podTemplateClient, err := kubernetes.NewForConfig(kubeConfig) - if err != nil { - return nil, fmt.Errorf("Failed to create Pod Template client: %v", err) - } - - podTemplLister, err := newPodTemplatesLister(podTemplateClient, make(chan struct{})) - if err != nil { - return nil, err - } - - return &ProvisioningRequestClient{ - client: prClient, - provReqLister: provReqLister, - podTemplLister: podTemplLister, - }, nil -} - -// ProvisioningRequest gets a specific ProvisioningRequest CR. -func (c *ProvisioningRequestClient) ProvisioningRequest(namespace, name string) (*v1beta1.ProvisioningRequest, error) { - return c.provReqLister.ProvisioningRequests(namespace).Get(name) -} - -// ProvisioningRequests gets all ProvisioningRequest CRs. -func (c *ProvisioningRequestClient) ProvisioningRequests() ([]*v1beta1.ProvisioningRequest, error) { - provisioningRequests, err := c.provReqLister.List(labels.Everything()) - if err != nil { - return nil, fmt.Errorf("error fetching provisioningRequests: %w", err) - } - return provisioningRequests, nil -} - -// FetchPodTemplates fetches PodTemplates referenced by the Provisioning Request. -func (c *ProvisioningRequestClient) FetchPodTemplates(pr *v1beta1.ProvisioningRequest) ([]*apiv1.PodTemplate, error) { - podTemplates := make([]*apiv1.PodTemplate, 0, len(pr.Spec.PodSets)) - for _, podSpec := range pr.Spec.PodSets { - podTemplate, err := c.podTemplLister.PodTemplates(pr.Namespace).Get(podSpec.PodTemplateRef.Name) - if errors.IsNotFound(err) { - klog.Infof("While fetching Pod Template for Provisioning Request %s/%s received not found error", pr.Namespace, pr.Name) - continue - } else if err != nil { - return nil, err - } - podTemplates = append(podTemplates, podTemplate) - } - return podTemplates, nil -} - -// newPRClient creates a new Provisioning Request client from the given config. -func newPRClient(kubeConfig *rest.Config) (*versioned.Clientset, error) { - return versioned.NewForConfig(kubeConfig) -} - -// newPRsLister creates a lister for the Provisioning Requests in the cluster. -func newPRsLister(prClient versioned.Interface, stopChannel <-chan struct{}) (listers.ProvisioningRequestLister, error) { - factory := externalversions.NewSharedInformerFactory(prClient, 1*time.Hour) - provReqLister := factory.Autoscaling().V1beta1().ProvisioningRequests().Lister() - factory.Start(stopChannel) - informersSynced := factory.WaitForCacheSync(stopChannel) - for _, synced := range informersSynced { - if !synced { - return nil, fmt.Errorf("can't create Provisioning Request lister") - } - } - klog.V(2).Info("Successful initial Provisioning Request sync") - return provReqLister, nil -} - -// newPodTemplatesLister creates a lister for the Pod Templates in the cluster. -func newPodTemplatesLister(client *kubernetes.Clientset, stopChannel <-chan struct{}) (v1.PodTemplateLister, error) { - factory := informers.NewSharedInformerFactory(client, 1*time.Hour) - podTemplLister := factory.Core().V1().PodTemplates().Lister() - factory.Start(stopChannel) - informersSynced := factory.WaitForCacheSync(stopChannel) - for _, synced := range informersSynced { - if !synced { - return nil, fmt.Errorf("can't create Pod Template lister") - } - } - klog.V(2).Info("Successful initial Pod Template sync") - return podTemplLister, nil -} diff --git a/cluster-autoscaler/provisioningrequest/service/v1beta1client/client_test.go b/cluster-autoscaler/provisioningrequest/service/v1beta1client/client_test.go deleted file mode 100644 index 7d5e25ce1e38..000000000000 --- a/cluster-autoscaler/provisioningrequest/service/v1beta1client/client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 v1beta1client - -import ( - "context" - "testing" - - "github.com/google/go-cmp/cmp" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/provreqwrapper" -) - -func TestFetchPodTemplates(t *testing.T) { - pr1 := provisioningRequestBetaForTests("namespace", "name-1") - pr2 := provisioningRequestBetaForTests("namespace", "name-2") - mockProvisioningRequests := []*provreqwrapper.ProvisioningRequest{pr1, pr2} - - ctx := context.Background() - c, _ := NewFakeProvisioningRequestClient(ctx, t, mockProvisioningRequests...) - got, err := c.FetchPodTemplates(pr1.V1Beta1()) - if err != nil { - t.Errorf("provisioningRequestClient.ProvisioningRequests() error: %v", err) - } - if len(got) != 1 { - t.Errorf("provisioningRequestClient.ProvisioningRequests() got: %v, want 1 element", err) - } - if diff := cmp.Diff(pr1.PodTemplates(), got); diff != "" { - t.Errorf("Template mismatch, diff (-want +got):\n%s", diff) - } -} diff --git a/cluster-autoscaler/provisioningrequest/service/v1beta1client/testutils.go b/cluster-autoscaler/provisioningrequest/service/v1beta1client/testutils.go deleted file mode 100644 index 25fe65e6e941..000000000000 --- a/cluster-autoscaler/provisioningrequest/service/v1beta1client/testutils.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -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 v1beta1client - -import ( - "context" - "fmt" - "testing" - "time" - - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/client/clientset/versioned/fake" - "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/provreqwrapper" - "k8s.io/client-go/informers" - "k8s.io/client-go/kubernetes" - fake_kubernetes "k8s.io/client-go/kubernetes/fake" - v1 "k8s.io/client-go/listers/core/v1" - klog "k8s.io/klog/v2" -) - -// NewFakeProvisioningRequestClient mock ProvisioningRequestClient for tests. -func NewFakeProvisioningRequestClient(ctx context.Context, t *testing.T, prs ...*provreqwrapper.ProvisioningRequest) (*ProvisioningRequestClient, *FakeProvisioningRequestForceClient) { - t.Helper() - provReqClient := fake.NewSimpleClientset() - podTemplClient := fake_kubernetes.NewSimpleClientset() - for _, pr := range prs { - if pr == nil { - continue - } - if _, err := provReqClient.AutoscalingV1beta1().ProvisioningRequests(pr.Namespace()).Create(ctx, pr.V1Beta1(), metav1.CreateOptions{}); err != nil { - t.Errorf("While adding a ProvisioningRequest: %s/%s to fake client, got error: %v", pr.Namespace(), pr.Name(), err) - } - for _, pd := range pr.PodTemplates() { - if _, err := podTemplClient.CoreV1().PodTemplates(pr.Namespace()).Create(ctx, pd, metav1.CreateOptions{}); err != nil { - t.Errorf("While adding a PodTemplate: %s/%s to fake client, got error: %v", pr.Namespace(), pd.Name, err) - } - } - } - provReqLister, err := newPRsLister(provReqClient, make(chan struct{})) - if err != nil { - t.Fatalf("Failed to create Provisioning Request lister. Error was: %v", err) - } - podTemplLister, err := newFakePodTemplatesLister(t, podTemplClient, make(chan struct{})) - if err != nil { - t.Fatalf("Failed to create Provisioning Request lister. Error was: %v", err) - } - return &ProvisioningRequestClient{ - client: provReqClient, - provReqLister: provReqLister, - podTemplLister: podTemplLister, - }, &FakeProvisioningRequestForceClient{ - client: provReqClient, - } -} - -// FakeProvisioningRequestForceClient that allows to skip cache. -type FakeProvisioningRequestForceClient struct { - client *fake.Clientset -} - -// ProvisioningRequest gets a specific ProvisioningRequest CR, skipping cache. -func (c *FakeProvisioningRequestForceClient) ProvisioningRequest(namespace, name string) (*v1beta1.ProvisioningRequest, error) { - ctx, cancel := context.WithTimeout(context.Background(), provisioningRequestClientCallTimeout) - defer cancel() - return c.client.AutoscalingV1beta1().ProvisioningRequests(namespace).Get(ctx, name, metav1.GetOptions{}) -} - -// newFakePodTemplatesLister creates a fake lister for the Pod Templates in the cluster. -func newFakePodTemplatesLister(t *testing.T, client kubernetes.Interface, channel <-chan struct{}) (v1.PodTemplateLister, error) { - t.Helper() - factory := informers.NewSharedInformerFactory(client, 1*time.Hour) - podTemplLister := factory.Core().V1().PodTemplates().Lister() - factory.Start(channel) - informersSynced := factory.WaitForCacheSync(channel) - for _, synced := range informersSynced { - if !synced { - return nil, fmt.Errorf("can't create Pod Template lister") - } - } - klog.V(2).Info("Successful initial Pod Template sync") - return podTemplLister, nil -} - -func provisioningRequestBetaForTests(namespace, name string) *provreqwrapper.ProvisioningRequest { - if namespace == "" { - namespace = "default" - } - podTemplates := []*apiv1.PodTemplate{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: podTemplateNameFromName(name), - Namespace: namespace, - }, - Template: apiv1.PodTemplateSpec{ - Spec: apiv1.PodSpec{ - Containers: []apiv1.Container{ - { - Name: "test-container", - Image: "test-image", - }, - }, - }, - }, - }, - } - v1Beta1PR := &v1beta1.ProvisioningRequest{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - }, - Spec: v1beta1.ProvisioningRequestSpec{ - ProvisioningClassName: "test-class", - PodSets: []v1beta1.PodSet{ - { - Count: 1, - PodTemplateRef: v1beta1.Reference{ - Name: podTemplates[0].Name, - }, - }, - }, - }, - Status: v1beta1.ProvisioningRequestStatus{ - ProvisioningClassDetails: map[string]v1beta1.Detail{}, - }, - } - - pr := provreqwrapper.NewV1Beta1ProvisioningRequest(v1Beta1PR, podTemplates) - return pr -} - -func podTemplateNameFromName(name string) string { - return fmt.Sprintf("%s-pod-template", name) -} diff --git a/cluster-autoscaler/simulator/drainability/context.go b/cluster-autoscaler/simulator/drainability/context.go deleted file mode 100644 index ffaa44b4b29c..000000000000 --- a/cluster-autoscaler/simulator/drainability/context.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -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 drainability - -import ( - "time" - - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/pdb" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" -) - -// DrainContext contains parameters for drainability rules. -type DrainContext struct { - RemainingPdbTracker pdb.RemainingPdbTracker - Listers kube_util.ListerRegistry - Timestamp time.Time -} diff --git a/cluster-autoscaler/simulator/drainability/rules/daemonset/rule.go b/cluster-autoscaler/simulator/drainability/rules/daemonset/rule.go deleted file mode 100644 index a56795974178..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/daemonset/rule.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 daemonset - -import ( - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - pod_util "k8s.io/autoscaler/cluster-autoscaler/utils/pod" -) - -// Rule is a drainability rule on how to handle daemon set pods. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "DaemonSet" -} - -// Drainable decides what to do with daemon set pods on node drain. -func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if pod_util.IsDaemonSetPod(pod) { - return drainability.NewDrainableStatus() - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/daemonset/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/daemonset/rule_test.go deleted file mode 100644 index d7d620160b91..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/daemonset/rule_test.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -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 daemonset - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" -) - -func TestDrainable(t *testing.T) { - for desc, tc := range map[string]struct { - pod *apiv1.Pod - want drainability.Status - }{ - "regular pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod", - Namespace: "ns", - }, - }, - want: drainability.NewUndefinedStatus(), - }, - "daemonset pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod", - Namespace: "ns", - OwnerReferences: test.GenerateOwnerReferences("ds", "DaemonSet", "apps/v1", ""), - }, - }, - want: drainability.NewDrainableStatus(), - }, - } { - t.Run(desc, func(t *testing.T) { - got := New().Drainable(nil, tc.pod) - if diff := cmp.Diff(tc.want, got); diff != "" { - t.Errorf("Rule.Drainable(%v): got status diff (-want +got):\n%s", tc.pod.Name, diff) - } - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/localstorage/rule.go b/cluster-autoscaler/simulator/drainability/rules/localstorage/rule.go deleted file mode 100644 index 076c977d3218..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/localstorage/rule.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 localstorage - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// Rule is a drainability rule on how to handle local storage pods. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "LocalStorage" -} - -// Drainable decides what to do with local storage pods on node drain. -func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if drain.HasBlockingLocalStorage(pod) { - return drainability.NewBlockedStatus(drain.LocalStorageRequested, fmt.Errorf("pod with local storage present: %s", pod.Name)) - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/localstorage/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/localstorage/rule_test.go deleted file mode 100644 index 25713c7f5bc8..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/localstorage/rule_test.go +++ /dev/null @@ -1,285 +0,0 @@ -/* -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 localstorage - -import ( - "testing" - "time" - - appsv1 "k8s.io/api/apps/v1" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" - - "github.com/stretchr/testify/assert" -) - -func TestDrainable(t *testing.T) { - var ( - testTime = time.Date(2020, time.December, 18, 17, 0, 0, 0, time.UTC) - replicas = int32(5) - - rc = apiv1.ReplicationController{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rc", - Namespace: "default", - SelfLink: "api/v1/namespaces/default/replicationcontrollers/rc", - }, - Spec: apiv1.ReplicationControllerSpec{ - Replicas: &replicas, - }, - } - ) - - for desc, test := range map[string]struct { - pod *apiv1.Pod - rcs []*apiv1.ReplicationController - rss []*appsv1.ReplicaSet - - wantReason drain.BlockingPodReason - wantError bool - }{ - "pod with EmptyDir": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - Volumes: []apiv1.Volume{ - { - Name: "scratch", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.LocalStorageRequested, - wantError: true, - }, - "pod with EmptyDir and SafeToEvictLocalVolumesKey annotation": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - Annotations: map[string]string{ - drain.SafeToEvictLocalVolumesKey: "scratch", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - Volumes: []apiv1.Volume{ - { - Name: "scratch", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "pod with EmptyDir and empty value for SafeToEvictLocalVolumesKey annotation": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - Annotations: map[string]string{ - drain.SafeToEvictLocalVolumesKey: "", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - Volumes: []apiv1.Volume{ - { - Name: "scratch", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.LocalStorageRequested, - wantError: true, - }, - "pod with EmptyDir and non-matching value for SafeToEvictLocalVolumesKey annotation": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - Annotations: map[string]string{ - drain.SafeToEvictLocalVolumesKey: "scratch-2", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - Volumes: []apiv1.Volume{ - { - Name: "scratch-1", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.LocalStorageRequested, - wantError: true, - }, - "pod with EmptyDir and SafeToEvictLocalVolumesKey annotation with matching values": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - Annotations: map[string]string{ - drain.SafeToEvictLocalVolumesKey: "scratch-1,scratch-2,scratch-3", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - Volumes: []apiv1.Volume{ - { - Name: "scratch-1", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - { - Name: "scratch-2", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - { - Name: "scratch-3", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "pod with EmptyDir and SafeToEvictLocalVolumesKey annotation with non-matching values": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - Annotations: map[string]string{ - drain.SafeToEvictLocalVolumesKey: "scratch-1,scratch-2,scratch-5", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - Volumes: []apiv1.Volume{ - { - Name: "scratch-1", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - { - Name: "scratch-2", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - { - Name: "scratch-3", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.LocalStorageRequested, - wantError: true, - }, - "pod with EmptyDir and SafeToEvictLocalVolumesKey annotation with some matching values": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - Annotations: map[string]string{ - drain.SafeToEvictLocalVolumesKey: "scratch-1,scratch-2", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - Volumes: []apiv1.Volume{ - { - Name: "scratch-1", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - { - Name: "scratch-2", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - { - Name: "scratch-3", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.LocalStorageRequested, - wantError: true, - }, - "pod with EmptyDir and SafeToEvictLocalVolumesKey annotation empty values": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - Annotations: map[string]string{ - drain.SafeToEvictLocalVolumesKey: ",", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - Volumes: []apiv1.Volume{ - { - Name: "scratch-1", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - { - Name: "scratch-2", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - { - Name: "scratch-3", - VolumeSource: apiv1.VolumeSource{EmptyDir: &apiv1.EmptyDirVolumeSource{Medium: ""}}, - }, - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.LocalStorageRequested, - wantError: true, - }, - } { - t.Run(desc, func(t *testing.T) { - drainCtx := &drainability.DrainContext{ - Timestamp: testTime, - } - status := New().Drainable(drainCtx, test.pod) - assert.Equal(t, test.wantReason, status.BlockingReason) - assert.Equal(t, test.wantError, status.Error != nil) - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/longterminating/rule.go b/cluster-autoscaler/simulator/drainability/rules/longterminating/rule.go deleted file mode 100644 index 1efa3bfdc713..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/longterminating/rule.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 longterminating - -import ( - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// Rule is a drainability rule on how to handle long terminating pods. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "LongTerminating" -} - -// Drainable decides what to do with long terminating pods on node drain. -func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if drain.IsPodLongTerminating(pod, drainCtx.Timestamp) { - return drainability.NewSkipStatus() - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/longterminating/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/longterminating/rule_test.go deleted file mode 100644 index bf0d32853d12..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/longterminating/rule_test.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -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 longterminating - -import ( - "testing" - "time" - - "github.com/google/go-cmp/cmp" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -func TestDrainable(t *testing.T) { - var ( - testTime = time.Date(2020, time.December, 18, 17, 0, 0, 0, time.UTC) - zeroGracePeriod = int64(0) - extendedGracePeriod = int64(6 * 60) // 6 minutes - ) - - for desc, tc := range map[string]struct { - pod *apiv1.Pod - want drainability.Status - }{ - "regular pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod", - Namespace: "ns", - }, - }, - want: drainability.NewUndefinedStatus(), - }, - "long terminating pod with 0 grace period": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - DeletionTimestamp: &metav1.Time{Time: testTime.Add(drain.PodLongTerminatingExtraThreshold / 2)}, - }, - Spec: apiv1.PodSpec{ - RestartPolicy: apiv1.RestartPolicyOnFailure, - TerminationGracePeriodSeconds: &zeroGracePeriod, - }, - Status: apiv1.PodStatus{ - Phase: apiv1.PodUnknown, - }, - }, - want: drainability.NewUndefinedStatus(), - }, - "expired long terminating pod with 0 grace period": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - DeletionTimestamp: &metav1.Time{Time: testTime.Add(-2 * drain.PodLongTerminatingExtraThreshold)}, - }, - Spec: apiv1.PodSpec{ - RestartPolicy: apiv1.RestartPolicyOnFailure, - TerminationGracePeriodSeconds: &zeroGracePeriod, - }, - Status: apiv1.PodStatus{ - Phase: apiv1.PodUnknown, - }, - }, - want: drainability.NewSkipStatus(), - }, - "long terminating pod with extended grace period": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - DeletionTimestamp: &metav1.Time{Time: testTime.Add(time.Duration(extendedGracePeriod) / 2 * time.Second)}, - }, - Spec: apiv1.PodSpec{ - RestartPolicy: apiv1.RestartPolicyOnFailure, - TerminationGracePeriodSeconds: &extendedGracePeriod, - }, - Status: apiv1.PodStatus{ - Phase: apiv1.PodUnknown, - }, - }, - want: drainability.NewUndefinedStatus(), - }, - "expired long terminating pod with extended grace period": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - DeletionTimestamp: &metav1.Time{Time: testTime.Add(-2 * time.Duration(extendedGracePeriod) * time.Second)}, - }, - Spec: apiv1.PodSpec{ - RestartPolicy: apiv1.RestartPolicyOnFailure, - TerminationGracePeriodSeconds: &extendedGracePeriod, - }, - Status: apiv1.PodStatus{ - Phase: apiv1.PodUnknown, - }, - }, - want: drainability.NewSkipStatus(), - }, - } { - t.Run(desc, func(t *testing.T) { - drainCtx := &drainability.DrainContext{ - Timestamp: testTime, - } - got := New().Drainable(drainCtx, tc.pod) - if diff := cmp.Diff(tc.want, got); diff != "" { - t.Errorf("Rule.Drainable(%v): got status diff (-want +got):\n%s", tc.pod.Name, diff) - } - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/mirror/rule.go b/cluster-autoscaler/simulator/drainability/rules/mirror/rule.go deleted file mode 100644 index 057991f697bf..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/mirror/rule.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 mirror - -import ( - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - pod_util "k8s.io/autoscaler/cluster-autoscaler/utils/pod" -) - -// Rule is a drainability rule on how to handle mirror pods. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "Mirror" -} - -// Drainable decides what to do with mirror pods on node drain. -func (Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if pod_util.IsMirrorPod(pod) { - return drainability.NewSkipStatus() - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/mirror/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/mirror/rule_test.go deleted file mode 100644 index 81d13302f615..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/mirror/rule_test.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -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 mirror - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/kubernetes/pkg/kubelet/types" -) - -func TestDrainable(t *testing.T) { - for desc, tc := range map[string]struct { - pod *apiv1.Pod - want drainability.Status - }{ - "regular pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "regularPod", - Namespace: "ns", - }, - }, - want: drainability.NewUndefinedStatus(), - }, - "mirror pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "manifestPod", - Namespace: "kube-system", - Annotations: map[string]string{ - types.ConfigMirrorAnnotationKey: "something", - }, - }, - }, - want: drainability.NewSkipStatus(), - }, - } { - t.Run(desc, func(t *testing.T) { - got := New().Drainable(nil, tc.pod) - if diff := cmp.Diff(tc.want, got); diff != "" { - t.Errorf("Rule.Drainable(%v): got status diff (-want +got):\n%s", tc.pod.Name, diff) - } - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/notsafetoevict/rule.go b/cluster-autoscaler/simulator/drainability/rules/notsafetoevict/rule.go deleted file mode 100644 index 6373f74ae5c6..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/notsafetoevict/rule.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 notsafetoevict - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// Rule is a drainability rule on how to handle not safe to evict pods. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "NotSafeToEvict" -} - -// Drainable decides what to do with not safe to evict pods on node drain. -func (Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if drain.HasNotSafeToEvictAnnotation(pod) { - return drainability.NewBlockedStatus(drain.NotSafeToEvictAnnotation, fmt.Errorf("pod annotated as not safe to evict present: %s", pod.Name)) - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/notsafetoevict/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/notsafetoevict/rule_test.go deleted file mode 100644 index 8d96437eb74b..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/notsafetoevict/rule_test.go +++ /dev/null @@ -1,146 +0,0 @@ -/* -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 notsafetoevict - -import ( - "testing" - "time" - - appsv1 "k8s.io/api/apps/v1" - batchv1 "k8s.io/api/batch/v1" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" - - "github.com/stretchr/testify/assert" -) - -func TestDrainable(t *testing.T) { - var ( - testTime = time.Date(2020, time.December, 18, 17, 0, 0, 0, time.UTC) - replicas = int32(5) - - rc = apiv1.ReplicationController{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rc", - Namespace: "default", - SelfLink: "api/v1/namespaces/default/replicationcontrollers/rc", - }, - Spec: apiv1.ReplicationControllerSpec{ - Replicas: &replicas, - }, - } - job = batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: "job", - Namespace: "default", - SelfLink: "/apiv1s/batch/v1/namespaces/default/jobs/job", - }, - } - ) - - for desc, test := range map[string]struct { - pod *apiv1.Pod - rcs []*apiv1.ReplicationController - rss []*appsv1.ReplicaSet - - wantReason drain.BlockingPodReason - wantError bool - }{ - "pod with PodSafeToEvict annotation": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "kube-system", - Annotations: map[string]string{ - drain.PodSafeToEvictKey: "true", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - }, - "RC-managed pod with no annotation": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "RC-managed pod with PodSafeToEvict=false annotation": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - Annotations: map[string]string{ - drain.PodSafeToEvictKey: "false", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.NotSafeToEvictAnnotation, - wantError: true, - }, - "job-managed pod with no annotation": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(job.Name, "Job", "batch/v1", ""), - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "job-managed pod with PodSafeToEvict=false annotation": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(job.Name, "Job", "batch/v1", ""), - Annotations: map[string]string{ - drain.PodSafeToEvictKey: "false", - }, - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.NotSafeToEvictAnnotation, - wantError: true, - }, - } { - t.Run(desc, func(t *testing.T) { - drainCtx := &drainability.DrainContext{ - Timestamp: testTime, - } - status := New().Drainable(drainCtx, test.pod) - assert.Equal(t, test.wantReason, status.BlockingReason) - assert.Equal(t, test.wantError, status.Error != nil) - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/pdb/rule.go b/cluster-autoscaler/simulator/drainability/rules/pdb/rule.go deleted file mode 100644 index 9c9e89cf84c0..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/pdb/rule.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -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 pdb - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// Rule is a drainability rule on how to handle pods with pdbs. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "PDB" -} - -// Drainable decides how to handle pods with pdbs on node drain. -func (Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - for _, pdb := range drainCtx.RemainingPdbTracker.MatchingPdbs(pod) { - if pdb.Status.DisruptionsAllowed < 1 { - return drainability.NewBlockedStatus(drain.NotEnoughPdb, fmt.Errorf("not enough pod disruption budget to move %s/%s", pod.Namespace, pod.Name)) - } - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/pdb/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/pdb/rule_test.go deleted file mode 100644 index a727c361f174..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/pdb/rule_test.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -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 pdb - -import ( - "testing" - - apiv1 "k8s.io/api/core/v1" - policyv1 "k8s.io/api/policy/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/pdb" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" - - "github.com/stretchr/testify/assert" -) - -func TestDrainable(t *testing.T) { - one := intstr.FromInt(1) - - for desc, tc := range map[string]struct { - pod *apiv1.Pod - pdbs []*policyv1.PodDisruptionBudget - wantOutcome drainability.OutcomeType - wantReason drain.BlockingPodReason - }{ - "no pdbs": { - pod: &apiv1.Pod{}, - }, - "no matching pdbs": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "happy", - Namespace: "good", - Labels: map[string]string{ - "label": "true", - }, - }, - }, - pdbs: []*policyv1.PodDisruptionBudget{ - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "bad", - }, - Spec: policyv1.PodDisruptionBudgetSpec{ - MinAvailable: &one, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "label": "true", - }, - }, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "good", - }, - Spec: policyv1.PodDisruptionBudgetSpec{ - MinAvailable: &one, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "label": "false", - }, - }, - }, - }, - }, - }, - "pdb prevents scale-down": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "sad", - Namespace: "good", - Labels: map[string]string{ - "label": "true", - }, - }, - }, - pdbs: []*policyv1.PodDisruptionBudget{ - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "bad", - }, - Spec: policyv1.PodDisruptionBudgetSpec{ - MinAvailable: &one, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "label": "true", - }, - }, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "good", - }, - Spec: policyv1.PodDisruptionBudgetSpec{ - MinAvailable: &one, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "label": "true", - }, - }, - }, - }, - { - ObjectMeta: metav1.ObjectMeta{ - Namespace: "good", - }, - Spec: policyv1.PodDisruptionBudgetSpec{ - MinAvailable: &one, - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "label": "false", - }, - }, - }, - }, - }, - wantOutcome: drainability.BlockDrain, - wantReason: drain.NotEnoughPdb, - }, - } { - t.Run(desc, func(t *testing.T) { - tracker := pdb.NewBasicRemainingPdbTracker() - tracker.SetPdbs(tc.pdbs) - drainCtx := &drainability.DrainContext{ - RemainingPdbTracker: tracker, - } - - got := New().Drainable(drainCtx, tc.pod) - assert.Equal(t, tc.wantReason, got.BlockingReason) - assert.Equal(t, tc.wantOutcome, got.Outcome) - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/replicacount/rule.go b/cluster-autoscaler/simulator/drainability/rules/replicacount/rule.go deleted file mode 100644 index 458ee234f777..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/replicacount/rule.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -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 replicacount - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" - pod_util "k8s.io/autoscaler/cluster-autoscaler/utils/pod" -) - -// Rule is a drainability rule on how to handle replicated pods. -type Rule struct { - minReplicaCount int -} - -// New creates a new Rule. -func New(minReplicaCount int) *Rule { - return &Rule{ - minReplicaCount: minReplicaCount, - } -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "ReplicaCount" -} - -// Drainable decides what to do with replicated pods on node drain. -func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if drainCtx.Listers == nil { - return drainability.NewUndefinedStatus() - } - - // For now, owner controller must be in the same namespace as the pod - // so OwnerReference doesn't have its own Namespace field. - controllerNamespace := pod.Namespace - - controllerRef := drain.ControllerRef(pod) - if controllerRef == nil { - return drainability.NewUndefinedStatus() - } - refKind := controllerRef.Kind - - if refKind == "ReplicationController" { - rc, err := drainCtx.Listers.ReplicationControllerLister().ReplicationControllers(controllerNamespace).Get(controllerRef.Name) - // Assume RC is either gone/missing or has too few replicas configured. - if err != nil || rc == nil { - return drainability.NewBlockedStatus(drain.ControllerNotFound, fmt.Errorf("replication controller for %s/%s is not available, err: %v", pod.Namespace, pod.Name, err)) - } - - // TODO: Replace the minReplica check with PDB. - if rc.Spec.Replicas != nil && int(*rc.Spec.Replicas) < r.minReplicaCount { - return drainability.NewBlockedStatus(drain.MinReplicasReached, fmt.Errorf("replication controller for %s/%s has too few replicas spec: %d min: %d", pod.Namespace, pod.Name, rc.Spec.Replicas, r.minReplicaCount)) - } - } else if pod_util.IsDaemonSetPod(pod) { - if refKind != "DaemonSet" { - // We don't have a listener for the other DaemonSet kind. - // TODO: Use a generic client for checking the reference. - return drainability.NewUndefinedStatus() - } - - _, err := drainCtx.Listers.DaemonSetLister().DaemonSets(controllerNamespace).Get(controllerRef.Name) - if err != nil { - if apierrors.IsNotFound(err) { - return drainability.NewBlockedStatus(drain.ControllerNotFound, fmt.Errorf("daemonset for %s/%s is not present, err: %v", pod.Namespace, pod.Name, err)) - } - return drainability.NewBlockedStatus(drain.UnexpectedError, fmt.Errorf("error when trying to get daemonset for %s/%s , err: %v", pod.Namespace, pod.Name, err)) - } - } else if refKind == "Job" { - job, err := drainCtx.Listers.JobLister().Jobs(controllerNamespace).Get(controllerRef.Name) - - if err != nil || job == nil { - // Assume the only reason for an error is because the Job is gone/missing. - return drainability.NewBlockedStatus(drain.ControllerNotFound, fmt.Errorf("job for %s/%s is not available: err: %v", pod.Namespace, pod.Name, err)) - } - } else if refKind == "ReplicaSet" { - rs, err := drainCtx.Listers.ReplicaSetLister().ReplicaSets(controllerNamespace).Get(controllerRef.Name) - - if err == nil && rs != nil { - // Assume the only reason for an error is because the RS is gone/missing. - if rs.Spec.Replicas != nil && int(*rs.Spec.Replicas) < r.minReplicaCount { - return drainability.NewBlockedStatus(drain.MinReplicasReached, fmt.Errorf("replication controller for %s/%s has too few replicas spec: %d min: %d", pod.Namespace, pod.Name, rs.Spec.Replicas, r.minReplicaCount)) - } - } else { - return drainability.NewBlockedStatus(drain.ControllerNotFound, fmt.Errorf("replication controller for %s/%s is not available, err: %v", pod.Namespace, pod.Name, err)) - } - } else if refKind == "StatefulSet" { - ss, err := drainCtx.Listers.StatefulSetLister().StatefulSets(controllerNamespace).Get(controllerRef.Name) - - if err != nil && ss == nil { - // Assume the only reason for an error is because the SS is gone/missing. - return drainability.NewBlockedStatus(drain.ControllerNotFound, fmt.Errorf("statefulset for %s/%s is not available: err: %v", pod.Namespace, pod.Name, err)) - } - } - - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/replicacount/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/replicacount/rule_test.go deleted file mode 100644 index 342a69738bb5..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/replicacount/rule_test.go +++ /dev/null @@ -1,295 +0,0 @@ -/* -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 replicacount - -import ( - "testing" - "time" - - appsv1 "k8s.io/api/apps/v1" - batchv1 "k8s.io/api/batch/v1" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" - v1appslister "k8s.io/client-go/listers/apps/v1" - v1lister "k8s.io/client-go/listers/core/v1" - - "github.com/stretchr/testify/assert" -) - -func TestDrainable(t *testing.T) { - var ( - testTime = time.Date(2020, time.December, 18, 17, 0, 0, 0, time.UTC) - replicas = int32(5) - - rc = apiv1.ReplicationController{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rc", - Namespace: "default", - SelfLink: "api/v1/namespaces/default/replicationcontrollers/rc", - }, - Spec: apiv1.ReplicationControllerSpec{ - Replicas: &replicas, - }, - } - ds = appsv1.DaemonSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "ds", - Namespace: "default", - SelfLink: "/apiv1s/apps/v1/namespaces/default/daemonsets/ds", - }, - } - job = batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: "job", - Namespace: "default", - SelfLink: "/apiv1s/batch/v1/namespaces/default/jobs/job", - }, - } - statefulset = appsv1.StatefulSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "ss", - Namespace: "default", - SelfLink: "/apiv1s/apps/v1/namespaces/default/statefulsets/ss", - }, - } - rs = appsv1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rs", - Namespace: "default", - SelfLink: "api/v1/namespaces/default/replicasets/rs", - }, - Spec: appsv1.ReplicaSetSpec{ - Replicas: &replicas, - }, - } - ) - - for desc, test := range map[string]struct { - desc string - pod *apiv1.Pod - rcs []*apiv1.ReplicationController - rss []*appsv1.ReplicaSet - - wantReason drain.BlockingPodReason - wantError bool - }{ - "RC-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "RC-managed pod with missing reference": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences("missing", "ReplicationController", "core/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.ControllerNotFound, - wantError: true, - }, - "DS-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(ds.Name, "DaemonSet", "apps/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - }, - "DS-managed pod with missing reference": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences("missing", "DaemonSet", "apps/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - wantReason: drain.ControllerNotFound, - wantError: true, - }, - "DS-managed pod by a custom Daemonset": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(ds.Name, "CustomDaemonSet", "crd/v1", ""), - Annotations: map[string]string{ - "cluster-autoscaler.kubernetes.io/daemonset-pod": "true", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - }, - "DS-managed pod by a custom Daemonset with missing reference": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences("missing", "CustomDaemonSet", "crd/v1", ""), - Annotations: map[string]string{ - "cluster-autoscaler.kubernetes.io/daemonset-pod": "true", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - }, - "Job-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(job.Name, "Job", "batch/v1", ""), - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "Job-managed pod with missing reference": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences("missing", "Job", "batch/v1", ""), - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.ControllerNotFound, - wantError: true, - }, - "SS-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(statefulset.Name, "StatefulSet", "apps/v1", ""), - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "SS-managed pod with missing reference": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences("missing", "StatefulSet", "apps/v1", ""), - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - wantReason: drain.ControllerNotFound, - wantError: true, - }, - "RS-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rs.Name, "ReplicaSet", "apps/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rss: []*appsv1.ReplicaSet{&rs}, - }, - "RS-managed pod that is being deleted": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rs.Name, "ReplicaSet", "apps/v1", ""), - DeletionTimestamp: &metav1.Time{Time: testTime.Add(-time.Hour)}, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rss: []*appsv1.ReplicaSet{&rs}, - }, - "RS-managed pod with missing reference": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences("missing", "ReplicaSet", "apps/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rss: []*appsv1.ReplicaSet{&rs}, - wantReason: drain.ControllerNotFound, - wantError: true, - }, - } { - t.Run(desc, func(t *testing.T) { - var err error - var rcLister v1lister.ReplicationControllerLister - if len(test.rcs) > 0 { - rcLister, err = kube_util.NewTestReplicationControllerLister(test.rcs) - assert.NoError(t, err) - } - var rsLister v1appslister.ReplicaSetLister - if len(test.rss) > 0 { - rsLister, err = kube_util.NewTestReplicaSetLister(test.rss) - assert.NoError(t, err) - } - dsLister, err := kube_util.NewTestDaemonSetLister([]*appsv1.DaemonSet{&ds}) - assert.NoError(t, err) - jobLister, err := kube_util.NewTestJobLister([]*batchv1.Job{&job}) - assert.NoError(t, err) - ssLister, err := kube_util.NewTestStatefulSetLister([]*appsv1.StatefulSet{&statefulset}) - assert.NoError(t, err) - - registry := kube_util.NewListerRegistry(nil, nil, nil, nil, dsLister, rcLister, jobLister, rsLister, ssLister) - - drainCtx := &drainability.DrainContext{ - Listers: registry, - Timestamp: testTime, - } - status := New(0).Drainable(drainCtx, test.pod) - assert.Equal(t, test.wantReason, status.BlockingReason) - assert.Equal(t, test.wantError, status.Error != nil) - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/replicated/rule.go b/cluster-autoscaler/simulator/drainability/rules/replicated/rule.go deleted file mode 100644 index 5a760d6bf295..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/replicated/rule.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -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 replicated - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// Rule is a drainability rule on how to handle replicated pods. -type Rule struct { - skipNodesWithCustomControllerPods bool -} - -// New creates a new Rule. -func New(skipNodesWithCustomControllerPods bool) *Rule { - return &Rule{ - skipNodesWithCustomControllerPods: skipNodesWithCustomControllerPods, - } -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "Replicated" -} - -// Drainable decides what to do with replicated pods on node drain. -func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - controllerRef := drain.ControllerRef(pod) - replicated := controllerRef != nil - - if r.skipNodesWithCustomControllerPods { - // TODO(vadasambar): remove this when we get rid of skipNodesWithCustomControllerPods - replicated = replicated && replicatedKind[controllerRef.Kind] - } - - if !replicated { - return drainability.NewBlockedStatus(drain.NotReplicated, fmt.Errorf("%s/%s is not replicated", pod.Namespace, pod.Name)) - } - return drainability.NewUndefinedStatus() -} - -// replicatedKind returns true if this kind has replicates pods. -var replicatedKind = map[string]bool{ - "ReplicationController": true, - "Job": true, - "ReplicaSet": true, - "StatefulSet": true, -} diff --git a/cluster-autoscaler/simulator/drainability/rules/replicated/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/replicated/rule_test.go deleted file mode 100644 index ce2943eb42c7..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/replicated/rule_test.go +++ /dev/null @@ -1,239 +0,0 @@ -/* -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 replicated - -import ( - "fmt" - "testing" - "time" - - appsv1 "k8s.io/api/apps/v1" - batchv1 "k8s.io/api/batch/v1" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" - kube_util "k8s.io/autoscaler/cluster-autoscaler/utils/kubernetes" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" - v1appslister "k8s.io/client-go/listers/apps/v1" - v1lister "k8s.io/client-go/listers/core/v1" - - "github.com/stretchr/testify/assert" -) - -func TestDrainable(t *testing.T) { - var ( - testTime = time.Date(2020, time.December, 18, 17, 0, 0, 0, time.UTC) - replicas = int32(5) - - rc = apiv1.ReplicationController{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rc", - Namespace: "default", - SelfLink: "api/v1/namespaces/default/replicationcontrollers/rc", - }, - Spec: apiv1.ReplicationControllerSpec{ - Replicas: &replicas, - }, - } - ds = appsv1.DaemonSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "ds", - Namespace: "default", - SelfLink: "/apiv1s/apps/v1/namespaces/default/daemonsets/ds", - }, - } - job = batchv1.Job{ - ObjectMeta: metav1.ObjectMeta{ - Name: "job", - Namespace: "default", - SelfLink: "/apiv1s/batch/v1/namespaces/default/jobs/job", - }, - } - statefulset = appsv1.StatefulSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "ss", - Namespace: "default", - SelfLink: "/apiv1s/apps/v1/namespaces/default/statefulsets/ss", - }, - } - rs = appsv1.ReplicaSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rs", - Namespace: "default", - SelfLink: "api/v1/namespaces/default/replicasets/rs", - }, - Spec: appsv1.ReplicaSetSpec{ - Replicas: &replicas, - }, - } - customControllerPod = &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - // Using names like FooController is discouraged - // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#naming-conventions - // vadasambar: I am using it here just because `FooController`` - // is easier to understand than say `FooSet` - OwnerReferences: test.GenerateOwnerReferences("Foo", "FooController", "apps/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - } - ) - - type testCase struct { - pod *apiv1.Pod - rcs []*apiv1.ReplicationController - rss []*appsv1.ReplicaSet - - // TODO(vadasambar): remove this when we get rid of scaleDownNodesWithCustomControllerPods - skipNodesWithCustomControllerPods bool - - wantReason drain.BlockingPodReason - wantError bool - } - - sharedTests := map[string]testCase{ - "RC-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "Job-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(job.Name, "Job", "batch/v1", ""), - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "SS-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(statefulset.Name, "StatefulSet", "apps/v1", ""), - }, - }, - rcs: []*apiv1.ReplicationController{&rc}, - }, - "RS-managed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rs.Name, "ReplicaSet", "apps/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rss: []*appsv1.ReplicaSet{&rs}, - }, - "RS-managed pod that is being deleted": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rs.Name, "ReplicaSet", "apps/v1", ""), - DeletionTimestamp: &metav1.Time{Time: testTime.Add(-time.Hour)}, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - rss: []*appsv1.ReplicaSet{&rs}, - }, - "naked pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - }, - wantReason: drain.NotReplicated, - wantError: true, - }, - } - - tests := make(map[string]testCase) - for desc, test := range sharedTests { - for _, skipNodesWithCustomControllerPods := range []bool{true, false} { - // Copy test to prevent side effects. - test := test - test.skipNodesWithCustomControllerPods = skipNodesWithCustomControllerPods - desc := fmt.Sprintf("%s with skipNodesWithCustomControllerPods:%t", desc, skipNodesWithCustomControllerPods) - tests[desc] = test - } - } - tests["custom-controller-managed non-blocking pod"] = testCase{ - pod: customControllerPod, - } - tests["custom-controller-managed blocking pod"] = testCase{ - pod: customControllerPod, - skipNodesWithCustomControllerPods: true, - wantReason: drain.NotReplicated, - wantError: true, - } - - for desc, test := range tests { - t.Run(desc, func(t *testing.T) { - var err error - var rcLister v1lister.ReplicationControllerLister - if len(test.rcs) > 0 { - rcLister, err = kube_util.NewTestReplicationControllerLister(test.rcs) - assert.NoError(t, err) - } - var rsLister v1appslister.ReplicaSetLister - if len(test.rss) > 0 { - rsLister, err = kube_util.NewTestReplicaSetLister(test.rss) - assert.NoError(t, err) - } - dsLister, err := kube_util.NewTestDaemonSetLister([]*appsv1.DaemonSet{&ds}) - assert.NoError(t, err) - jobLister, err := kube_util.NewTestJobLister([]*batchv1.Job{&job}) - assert.NoError(t, err) - ssLister, err := kube_util.NewTestStatefulSetLister([]*appsv1.StatefulSet{&statefulset}) - assert.NoError(t, err) - - registry := kube_util.NewListerRegistry(nil, nil, nil, nil, dsLister, rcLister, jobLister, rsLister, ssLister) - - drainCtx := &drainability.DrainContext{ - Listers: registry, - Timestamp: testTime, - } - status := New(test.skipNodesWithCustomControllerPods).Drainable(drainCtx, test.pod) - assert.Equal(t, test.wantReason, status.BlockingReason) - assert.Equal(t, test.wantError, status.Error != nil) - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/rules.go b/cluster-autoscaler/simulator/drainability/rules/rules.go deleted file mode 100644 index d2912bffb75c..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/rules.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -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 rules - -import ( - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/pdb" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/daemonset" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/localstorage" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/longterminating" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/mirror" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/notsafetoevict" - pdbrule "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/pdb" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/replicacount" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/replicated" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/safetoevict" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/system" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability/rules/terminal" - "k8s.io/autoscaler/cluster-autoscaler/simulator/options" - "k8s.io/klog/v2" -) - -// Rule determines whether a given pod can be drained or not. -type Rule interface { - // The name of the rule. - Name() string - // Drainable determines whether a given pod is drainable according to - // the specific Rule. - // - // DrainContext cannot be nil. - Drainable(*drainability.DrainContext, *apiv1.Pod) drainability.Status -} - -// Default returns the default list of Rules. -func Default(deleteOptions options.NodeDeleteOptions) Rules { - var rules Rules - for _, r := range []struct { - rule Rule - skip bool - }{ - {rule: mirror.New()}, - {rule: longterminating.New()}, - {rule: replicacount.New(deleteOptions.MinReplicaCount), skip: !deleteOptions.SkipNodesWithCustomControllerPods}, - - // Interrupting checks - {rule: daemonset.New()}, - {rule: safetoevict.New()}, - {rule: terminal.New()}, - - // Blocking checks - {rule: replicated.New(deleteOptions.SkipNodesWithCustomControllerPods)}, - {rule: system.New(), skip: !deleteOptions.SkipNodesWithSystemPods}, - {rule: notsafetoevict.New()}, - {rule: localstorage.New(), skip: !deleteOptions.SkipNodesWithLocalStorage}, - {rule: pdbrule.New()}, - } { - if !r.skip { - rules = append(rules, r.rule) - } - } - return rules -} - -// Rules defines operations on a collections of rules. -type Rules []Rule - -// Drainable determines whether a given pod is drainable according to the -// specified set of rules. -func (rs Rules) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if drainCtx == nil { - drainCtx = &drainability.DrainContext{} - } - if drainCtx.RemainingPdbTracker == nil { - drainCtx.RemainingPdbTracker = pdb.NewBasicRemainingPdbTracker() - } - - var candidates []overrideCandidate - - for _, r := range rs { - status := r.Drainable(drainCtx, pod) - if len(status.Overrides) > 0 { - candidates = append(candidates, overrideCandidate{r.Name(), status}) - continue - } - for _, candidate := range candidates { - for _, override := range candidate.status.Overrides { - if status.Outcome == override { - klog.V(5).Infof("Overriding pod %s/%s drainability rule %s with rule %s, outcome %v", pod.GetNamespace(), pod.GetName(), r.Name(), candidate.name, candidate.status.Outcome) - return candidate.status - } - } - } - if status.Outcome != drainability.UndefinedOutcome { - return status - } - } - return drainability.NewUndefinedStatus() -} - -type overrideCandidate struct { - name string - status drainability.Status -} diff --git a/cluster-autoscaler/simulator/drainability/rules/rules_test.go b/cluster-autoscaler/simulator/drainability/rules/rules_test.go deleted file mode 100644 index 1c1ab7b23df6..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/rules_test.go +++ /dev/null @@ -1,132 +0,0 @@ -/* -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 rules - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -func TestDrainable(t *testing.T) { - for desc, tc := range map[string]struct { - rules Rules - want drainability.Status - }{ - "no rules": { - want: drainability.NewUndefinedStatus(), - }, - "first non-undefined rule returned": { - rules: Rules{ - fakeRule{drainability.NewUndefinedStatus()}, - fakeRule{drainability.NewDrainableStatus()}, - fakeRule{drainability.NewSkipStatus()}, - }, - want: drainability.NewDrainableStatus(), - }, - "override match": { - rules: Rules{ - fakeRule{drainability.Status{ - Outcome: drainability.DrainOk, - Overrides: []drainability.OutcomeType{drainability.BlockDrain}, - }}, - fakeRule{drainability.NewBlockedStatus(drain.NotEnoughPdb, nil)}, - }, - want: drainability.Status{ - Outcome: drainability.DrainOk, - Overrides: []drainability.OutcomeType{drainability.BlockDrain}, - }, - }, - "override no match": { - rules: Rules{ - fakeRule{drainability.Status{ - Outcome: drainability.DrainOk, - Overrides: []drainability.OutcomeType{drainability.SkipDrain}, - }}, - fakeRule{drainability.NewBlockedStatus(drain.NotEnoughPdb, nil)}, - }, - want: drainability.NewBlockedStatus(drain.NotEnoughPdb, nil), - }, - "override unreachable": { - rules: Rules{ - fakeRule{drainability.NewSkipStatus()}, - fakeRule{drainability.Status{ - Outcome: drainability.DrainOk, - Overrides: []drainability.OutcomeType{drainability.BlockDrain}, - }}, - fakeRule{drainability.NewBlockedStatus(drain.NotEnoughPdb, nil)}, - }, - want: drainability.NewSkipStatus(), - }, - "multiple overrides all run": { - rules: Rules{ - fakeRule{drainability.Status{ - Outcome: drainability.DrainOk, - Overrides: []drainability.OutcomeType{drainability.SkipDrain}, - }}, - fakeRule{drainability.Status{ - Outcome: drainability.SkipDrain, - Overrides: []drainability.OutcomeType{drainability.BlockDrain}, - }}, - fakeRule{drainability.NewBlockedStatus(drain.NotEnoughPdb, nil)}, - }, - want: drainability.Status{ - Outcome: drainability.SkipDrain, - Overrides: []drainability.OutcomeType{drainability.BlockDrain}, - }, - }, - "multiple overrides respects order": { - rules: Rules{ - fakeRule{drainability.Status{ - Outcome: drainability.SkipDrain, - Overrides: []drainability.OutcomeType{drainability.BlockDrain}, - }}, - fakeRule{drainability.Status{ - Outcome: drainability.DrainOk, - Overrides: []drainability.OutcomeType{drainability.BlockDrain}, - }}, - fakeRule{drainability.NewBlockedStatus(drain.NotEnoughPdb, nil)}, - }, - want: drainability.Status{ - Outcome: drainability.SkipDrain, - Overrides: []drainability.OutcomeType{drainability.BlockDrain}, - }, - }, - } { - t.Run(desc, func(t *testing.T) { - got := tc.rules.Drainable(nil, &apiv1.Pod{}) - if diff := cmp.Diff(tc.want, got); diff != "" { - t.Errorf("Drainable(): got status diff (-want +got):\n%s", diff) - } - }) - } -} - -type fakeRule struct { - status drainability.Status -} - -func (r fakeRule) Name() string { - return "FakeRule" -} - -func (r fakeRule) Drainable(*drainability.DrainContext, *apiv1.Pod) drainability.Status { - return r.status -} diff --git a/cluster-autoscaler/simulator/drainability/rules/safetoevict/rule.go b/cluster-autoscaler/simulator/drainability/rules/safetoevict/rule.go deleted file mode 100644 index 42ea2ec7fd04..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/safetoevict/rule.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 safetoevict - -import ( - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// Rule is a drainability rule on how to handle safe to evict pods. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "SafeToEvict" -} - -// Drainable decides what to do with safe to evict pods on node drain. -func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if drain.HasSafeToEvictAnnotation(pod) { - return drainability.NewDrainableStatus() - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/safetoevict/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/safetoevict/rule_test.go deleted file mode 100644 index e407077f00b3..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/safetoevict/rule_test.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -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 safetoevict - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -func TestDrainable(t *testing.T) { - for desc, tc := range map[string]struct { - pod *apiv1.Pod - want drainability.Status - }{ - "regular pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod", - Namespace: "ns", - }, - }, - want: drainability.NewUndefinedStatus(), - }, - "safe to evict pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - Annotations: map[string]string{ - drain.PodSafeToEvictKey: "true", - }, - }, - }, - want: drainability.NewDrainableStatus(), - }, - } { - t.Run(desc, func(t *testing.T) { - got := New().Drainable(nil, tc.pod) - if diff := cmp.Diff(tc.want, got); diff != "" { - t.Errorf("Rule.Drainable(%v): got status diff (-want +got):\n%s", tc.pod.Name, diff) - } - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/system/rule.go b/cluster-autoscaler/simulator/drainability/rules/system/rule.go deleted file mode 100644 index 0db0ea8b3a3d..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/system/rule.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 system - -import ( - "fmt" - - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// Rule is a drainability rule on how to handle system pods. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "System" -} - -// Drainable decides what to do with system pods on node drain. -func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if pod.Namespace == "kube-system" && len(drainCtx.RemainingPdbTracker.MatchingPdbs(pod)) == 0 { - return drainability.NewBlockedStatus(drain.UnmovableKubeSystemPod, fmt.Errorf("non-daemonset, non-mirrored, non-pdb-assigned kube-system pod present: %s", pod.Name)) - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/system/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/system/rule_test.go deleted file mode 100644 index bc25337750c8..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/system/rule_test.go +++ /dev/null @@ -1,181 +0,0 @@ -/* -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 system - -import ( - "testing" - "time" - - appsv1 "k8s.io/api/apps/v1" - apiv1 "k8s.io/api/core/v1" - policyv1 "k8s.io/api/policy/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/core/scaledown/pdb" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" - "k8s.io/autoscaler/cluster-autoscaler/utils/test" - - "github.com/stretchr/testify/assert" -) - -func TestDrainable(t *testing.T) { - var ( - testTime = time.Date(2020, time.December, 18, 17, 0, 0, 0, time.UTC) - replicas = int32(5) - - rc = apiv1.ReplicationController{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rc", - Namespace: "default", - SelfLink: "api/v1/namespaces/default/replicationcontrollers/rc", - }, - Spec: apiv1.ReplicationControllerSpec{ - Replicas: &replicas, - }, - } - - rcPod = &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - OwnerReferences: test.GenerateOwnerReferences(rc.Name, "ReplicationController", "core/v1", ""), - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - } - - kubeSystemRc = apiv1.ReplicationController{ - ObjectMeta: metav1.ObjectMeta{ - Name: "rc", - Namespace: "kube-system", - SelfLink: "api/v1/namespaces/kube-system/replicationcontrollers/rc", - }, - Spec: apiv1.ReplicationControllerSpec{ - Replicas: &replicas, - }, - } - - kubeSystemRcPod = &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "kube-system", - OwnerReferences: test.GenerateOwnerReferences(kubeSystemRc.Name, "ReplicationController", "core/v1", ""), - Labels: map[string]string{ - "k8s-app": "bar", - }, - }, - Spec: apiv1.PodSpec{ - NodeName: "node", - }, - } - - emptyPDB = &policyv1.PodDisruptionBudget{} - - kubeSystemPDB = &policyv1.PodDisruptionBudget{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "kube-system", - }, - Spec: policyv1.PodDisruptionBudgetSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "k8s-app": "bar", - }, - }, - }, - } - - kubeSystemFakePDB = &policyv1.PodDisruptionBudget{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "kube-system", - }, - Spec: policyv1.PodDisruptionBudgetSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "k8s-app": "foo", - }, - }, - }, - } - - defaultNamespacePDB = &policyv1.PodDisruptionBudget{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: "default", - }, - Spec: policyv1.PodDisruptionBudgetSpec{ - Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{ - "k8s-app": "PDB-managed pod", - }, - }, - }, - } - ) - - for desc, test := range map[string]struct { - pod *apiv1.Pod - rcs []*apiv1.ReplicationController - rss []*appsv1.ReplicaSet - pdbs []*policyv1.PodDisruptionBudget - - wantReason drain.BlockingPodReason - wantError bool - }{ - "empty PDB with RC-managed pod": { - pod: rcPod, - rcs: []*apiv1.ReplicationController{&rc}, - pdbs: []*policyv1.PodDisruptionBudget{emptyPDB}, - }, - "kube-system PDB with matching kube-system pod": { - pod: kubeSystemRcPod, - rcs: []*apiv1.ReplicationController{&kubeSystemRc}, - pdbs: []*policyv1.PodDisruptionBudget{kubeSystemPDB}, - }, - "kube-system PDB with non-matching kube-system pod": { - pod: kubeSystemRcPod, - rcs: []*apiv1.ReplicationController{&kubeSystemRc}, - pdbs: []*policyv1.PodDisruptionBudget{kubeSystemFakePDB}, - wantReason: drain.UnmovableKubeSystemPod, - wantError: true, - }, - "kube-system PDB with default namespace pod": { - pod: rcPod, - rcs: []*apiv1.ReplicationController{&rc}, - pdbs: []*policyv1.PodDisruptionBudget{kubeSystemPDB}, - }, - "default namespace PDB with matching labels kube-system pod": { - pod: kubeSystemRcPod, - rcs: []*apiv1.ReplicationController{&kubeSystemRc}, - pdbs: []*policyv1.PodDisruptionBudget{defaultNamespacePDB}, - wantReason: drain.UnmovableKubeSystemPod, - wantError: true, - }, - } { - t.Run(desc, func(t *testing.T) { - tracker := pdb.NewBasicRemainingPdbTracker() - tracker.SetPdbs(test.pdbs) - - drainCtx := &drainability.DrainContext{ - RemainingPdbTracker: tracker, - Timestamp: testTime, - } - status := New().Drainable(drainCtx, test.pod) - assert.Equal(t, test.wantReason, status.BlockingReason) - assert.Equal(t, test.wantError, status.Error != nil) - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/rules/terminal/rule.go b/cluster-autoscaler/simulator/drainability/rules/terminal/rule.go deleted file mode 100644 index 83edfcfcce19..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/terminal/rule.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -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 terminal - -import ( - apiv1 "k8s.io/api/core/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// Rule is a drainability rule on how to handle terminal pods. -type Rule struct{} - -// New creates a new Rule. -func New() *Rule { - return &Rule{} -} - -// Name returns the name of the rule. -func (r *Rule) Name() string { - return "Terminal" -} - -// Drainable decides what to do with terminal pods on node drain. -func (r *Rule) Drainable(drainCtx *drainability.DrainContext, pod *apiv1.Pod) drainability.Status { - if drain.IsPodTerminal(pod) { - return drainability.NewDrainableStatus() - } - return drainability.NewUndefinedStatus() -} diff --git a/cluster-autoscaler/simulator/drainability/rules/terminal/rule_test.go b/cluster-autoscaler/simulator/drainability/rules/terminal/rule_test.go deleted file mode 100644 index 7986a38c9f20..000000000000 --- a/cluster-autoscaler/simulator/drainability/rules/terminal/rule_test.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -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 terminal - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - apiv1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/autoscaler/cluster-autoscaler/simulator/drainability" -) - -func TestDrainable(t *testing.T) { - for desc, tc := range map[string]struct { - pod *apiv1.Pod - want drainability.Status - }{ - "regular pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod", - Namespace: "ns", - }, - }, - want: drainability.NewUndefinedStatus(), - }, - "terminal pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - }, - Spec: apiv1.PodSpec{ - RestartPolicy: apiv1.RestartPolicyOnFailure, - }, - Status: apiv1.PodStatus{ - Phase: apiv1.PodSucceeded, - }, - }, - want: drainability.NewDrainableStatus(), - }, - "failed pod": { - pod: &apiv1.Pod{ - ObjectMeta: metav1.ObjectMeta{ - Name: "bar", - Namespace: "default", - }, - Spec: apiv1.PodSpec{ - RestartPolicy: apiv1.RestartPolicyNever, - }, - Status: apiv1.PodStatus{ - Phase: apiv1.PodFailed, - }, - }, - want: drainability.NewDrainableStatus(), - }, - } { - t.Run(desc, func(t *testing.T) { - got := New().Drainable(nil, tc.pod) - if diff := cmp.Diff(tc.want, got); diff != "" { - t.Errorf("Rule.Drainable(%v): got status diff (-want +got):\n%s", tc.pod.Name, diff) - } - }) - } -} diff --git a/cluster-autoscaler/simulator/drainability/status.go b/cluster-autoscaler/simulator/drainability/status.go deleted file mode 100644 index 402342ec3071..000000000000 --- a/cluster-autoscaler/simulator/drainability/status.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -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 drainability - -import ( - "k8s.io/autoscaler/cluster-autoscaler/utils/drain" -) - -// OutcomeType identifies the action that should be taken when it comes to -// draining a pod. -type OutcomeType int - -const ( - // UndefinedOutcome means the Rule did not match and that another one - // has to be applied. - UndefinedOutcome OutcomeType = iota - // DrainOk means that the pod can be drained. - DrainOk - // BlockDrain means that the pod should block drain for its entire node. - BlockDrain - // SkipDrain means that the pod doesn't block drain of other pods, but - // should not be drained itself. - SkipDrain -) - -// Status contains all information about drainability of a single pod. -// TODO(x13n): Move values from drain.BlockingPodReason to some typed string. -type Status struct { - // Outcome indicates what can happen when it comes to draining a - // specific pod. - Outcome OutcomeType - // Overrides specifies Outcomes that should be trumped by this Status. - // If Overrides is empty, this Status is returned immediately. - // If Overrides is non-empty, we continue running the remaining Rules. If a - // Rule is encountered that matches one of the Outcomes specified by this - // field, this Status will will be returned instead. - Overrides []OutcomeType - // Reason contains the reason why a pod is blocking node drain. It is - // set only when Outcome is BlockDrain. - BlockingReason drain.BlockingPodReason - // Error contains an optional error message. - Error error -} - -// NewDrainableStatus returns a new Status indicating that a pod can be drained. -func NewDrainableStatus() Status { - return Status{ - Outcome: DrainOk, - } -} - -// NewBlockedStatus returns a new Status indicating that a pod is blocked and cannot be drained. -func NewBlockedStatus(reason drain.BlockingPodReason, err error) Status { - return Status{ - Outcome: BlockDrain, - BlockingReason: reason, - Error: err, - } -} - -// NewSkipStatus returns a new Status indicating that a pod should be skipped when draining a node. -func NewSkipStatus() Status { - return Status{ - Outcome: SkipDrain, - } -} - -// NewUndefinedStatus returns a new Status that doesn't contain a decision. -func NewUndefinedStatus() Status { - return Status{} -} diff --git a/cluster-autoscaler/simulator/options/nodedelete.go b/cluster-autoscaler/simulator/options/nodedelete.go deleted file mode 100644 index 6b6e17a1b7e9..000000000000 --- a/cluster-autoscaler/simulator/options/nodedelete.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -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 options - -import ( - "k8s.io/autoscaler/cluster-autoscaler/config" -) - -// NodeDeleteOptions contains various options to customize how draining will behave -type NodeDeleteOptions struct { - // SkipNodesWithSystemPods is true if nodes with kube-system pods should be - // deleted (except for DaemonSet or mirror pods). - SkipNodesWithSystemPods bool - // SkipNodesWithLocalStorage is true if nodes with pods using local storage - // (e.g. EmptyDir or HostPath) should be deleted. - SkipNodesWithLocalStorage bool - // SkipNodesWithCustomControllerPods is true if nodes with - // custom-controller-owned pods should be skipped. - SkipNodesWithCustomControllerPods bool - // MinReplicaCount determines the minimum number of replicas that a replica - // set or replication controller should have to allow pod deletion during - // scale down. - MinReplicaCount int -} - -// NewNodeDeleteOptions returns new node delete options extracted from autoscaling options. -func NewNodeDeleteOptions(opts config.AutoscalingOptions) NodeDeleteOptions { - return NodeDeleteOptions{ - SkipNodesWithSystemPods: opts.SkipNodesWithSystemPods, - SkipNodesWithLocalStorage: opts.SkipNodesWithLocalStorage, - SkipNodesWithCustomControllerPods: opts.SkipNodesWithCustomControllerPods, - MinReplicaCount: opts.MinReplicaCount, - } -} diff --git a/cluster-autoscaler/utils/kubernetes/client.go b/cluster-autoscaler/utils/kubernetes/client.go deleted file mode 100644 index f7f1dcc45fb7..000000000000 --- a/cluster-autoscaler/utils/kubernetes/client.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -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 kubernetes - -import ( - "net/url" - - "k8s.io/autoscaler/cluster-autoscaler/config" - - kube_client "k8s.io/client-go/kubernetes" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - "k8s.io/klog/v2" -) - -const ( - failedToBuildConfigErr = "Failed to build config" - failedToParseK8sUrlErr = "Failed to parse Kubernetes url" - failedToBuildClientConfigErr = "Failed to build Kubernetes client configuration" -) - -// CreateKubeClient creates kube client based on AutoscalingOptions.KubeClientOptions -func CreateKubeClient(opts config.KubeClientOptions) kube_client.Interface { - return kube_client.NewForConfigOrDie(getKubeConfig(opts)) -} - -// getKubeConfig returns the rest config from AutoscalingOptions.KubeClientOptions. -func getKubeConfig(opts config.KubeClientOptions) *rest.Config { - var kubeConfig *rest.Config - var err error - - if opts.KubeConfigPath != "" { - klog.V(1).Infof("Using kubeconfig file: %s", opts.KubeConfigPath) - // use the current context in kubeconfig - kubeConfig, err = clientcmd.BuildConfigFromFlags("", opts.KubeConfigPath) - if err != nil { - klog.Fatalf("%v: %v", failedToBuildConfigErr, err) - } - } else { - url, err := url.Parse(opts.Master) - if err != nil { - klog.Fatalf("%v: %v", failedToParseK8sUrlErr, err) - } - - kubeConfig, err = config.GetKubeClientConfig(url) - if err != nil { - klog.Fatalf("%v: %v", failedToBuildClientConfigErr, err) - } - } - - kubeConfig.ContentType = opts.APIContentType - - return kubeConfig -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json deleted file mode 100644 index 2af6e17d27a5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "dad644cc6d0c88991f291eda37e18f27c16739b2", - "readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", - "tag": "package-2022-08-01", - "use": "@microsoft.azure/autorest.go@2.1.188", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.188 --tag=package-2022-08-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --debug /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --debug" - } -} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go deleted file mode 100644 index 90fce14e0039..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go +++ /dev/null @@ -1,652 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailabilitySetsClient is the compute Client -type AvailabilitySetsClient struct { - BaseClient -} - -// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client. -func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { - return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { - return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -// parameters - parameters supplied to the Create Availability Set operation. -func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all availability sets in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") - defer func() { - sc := -1 - if result.aslr.Response.Response != nil { - sc = result.aslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request") - return - } - - result.aslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") - return - } - if result.aslr.hasNextLink() && result.aslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailabilitySetsClient) listNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { - req, err := lastResults.availabilitySetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an -// existing availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListAvailableSizes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSizesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSizesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSizesPreparer prepares the ListAvailableSizes request. -func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySubscription lists all availability sets in a subscription. -// Parameters: -// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") - defer func() { - sc := -1 - if result.aslr.Response.Response != nil { - sc = result.aslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.aslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.aslr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.aslr.hasNextLink() && result.aslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { - req, err := lastResults.availabilitySetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx, expand) - return -} - -// Update update an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -// parameters - parameters supplied to the Update Availability Set operation. -func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go deleted file mode 100644 index b8d398016584..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go +++ /dev/null @@ -1,596 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CapacityReservationGroupsClient is the compute Client -type CapacityReservationGroupsClient struct { - BaseClient -} - -// NewCapacityReservationGroupsClient creates an instance of the CapacityReservationGroupsClient client. -func NewCapacityReservationGroupsClient(subscriptionID string) CapacityReservationGroupsClient { - return NewCapacityReservationGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCapacityReservationGroupsClientWithBaseURI creates an instance of the CapacityReservationGroupsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewCapacityReservationGroupsClientWithBaseURI(baseURI string, subscriptionID string) CapacityReservationGroupsClient { - return CapacityReservationGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update a capacity reservation group. When updating a capacity reservation -// group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// parameters - parameters supplied to the Create capacity reservation Group. -func (client CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup) (result CapacityReservationGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CapacityReservationGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityReservationGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -func (client CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, capacityReservationGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CapacityReservationGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation that retrieves information about a capacity reservation group. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// expand - 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. -func (client CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, expand CapacityReservationGroupInstanceViewTypes) (result CapacityReservationGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, capacityReservationGroupName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CapacityReservationGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, expand CapacityReservationGroupInstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) GetResponder(resp *http.Response) (result CapacityReservationGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// expand - 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. -func (client CapacityReservationGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.crglr.Response.Response != nil { - sc = result.crglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.crglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.crglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.crglr.hasNextLink() && result.crglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client CapacityReservationGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result CapacityReservationGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client CapacityReservationGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CapacityReservationGroupListResult) (result CapacityReservationGroupListResult, err error) { - req, err := lastResults.capacityReservationGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client CapacityReservationGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, expand) - return -} - -// ListBySubscription 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. -// Parameters: -// expand - 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. -func (client CapacityReservationGroupsClient) ListBySubscription(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.crglr.Response.Response != nil { - sc = result.crglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.crglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.crglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.crglr.hasNextLink() && result.crglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client CapacityReservationGroupsClient) ListBySubscriptionPreparer(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result CapacityReservationGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client CapacityReservationGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CapacityReservationGroupListResult) (result CapacityReservationGroupListResult, err error) { - req, err := lastResults.capacityReservationGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client CapacityReservationGroupsClient) ListBySubscriptionComplete(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx, expand) - return -} - -// Update the operation to update a capacity reservation group. When updating a capacity reservation group, only tags -// may be modified. -// Parameters: -// 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. -func (client CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate) (result CapacityReservationGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CapacityReservationGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CapacityReservationGroupsClient) UpdateResponder(resp *http.Response) (result CapacityReservationGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go deleted file mode 100644 index d8f7e2ca2d2a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go +++ /dev/null @@ -1,493 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CapacityReservationsClient is the compute Client -type CapacityReservationsClient struct { - BaseClient -} - -// NewCapacityReservationsClient creates an instance of the CapacityReservationsClient client. -func NewCapacityReservationsClient(subscriptionID string) CapacityReservationsClient { - return NewCapacityReservationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCapacityReservationsClientWithBaseURI creates an instance of the CapacityReservationsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCapacityReservationsClientWithBaseURI(baseURI string, subscriptionID string) CapacityReservationsClient { - return CapacityReservationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// 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. -// Parameters: -// 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. -func (client CapacityReservationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation) (result CapacityReservationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.CapacityReservationsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CapacityReservationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "capacityReservationName": autorest.Encode("path", capacityReservationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationsClient) CreateOrUpdateSender(req *http.Request) (future CapacityReservationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityReservation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// capacityReservationName - the name of the capacity reservation. -func (client CapacityReservationsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string) (result CapacityReservationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CapacityReservationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "capacityReservationName": autorest.Encode("path", capacityReservationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationsClient) DeleteSender(req *http.Request) (future CapacityReservationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation that retrieves information about the capacity reservation. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -// capacityReservationName - the name of the capacity reservation. -// expand - 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. -func (client CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, expand CapacityReservationInstanceViewTypes) (result CapacityReservation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CapacityReservationsClient) GetPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, expand CapacityReservationInstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "capacityReservationName": autorest.Encode("path", capacityReservationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) GetResponder(resp *http.Response) (result CapacityReservation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByCapacityReservationGroup 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// capacityReservationGroupName - the name of the capacity reservation group. -func (client CapacityReservationsClient) ListByCapacityReservationGroup(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result CapacityReservationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.ListByCapacityReservationGroup") - defer func() { - sc := -1 - if result.crlr.Response.Response != nil { - sc = result.crlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByCapacityReservationGroupNextResults - req, err := client.ListByCapacityReservationGroupPreparer(ctx, resourceGroupName, capacityReservationGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByCapacityReservationGroupSender(req) - if err != nil { - result.crlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", resp, "Failure sending request") - return - } - - result.crlr, err = client.ListByCapacityReservationGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", resp, "Failure responding to request") - return - } - if result.crlr.hasNextLink() && result.crlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByCapacityReservationGroupPreparer prepares the ListByCapacityReservationGroup request. -func (client CapacityReservationsClient) ListByCapacityReservationGroupPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByCapacityReservationGroupSender sends the ListByCapacityReservationGroup request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationsClient) ListByCapacityReservationGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByCapacityReservationGroupResponder handles the response to the ListByCapacityReservationGroup request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) ListByCapacityReservationGroupResponder(resp *http.Response) (result CapacityReservationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByCapacityReservationGroupNextResults retrieves the next set of results, if any. -func (client CapacityReservationsClient) listByCapacityReservationGroupNextResults(ctx context.Context, lastResults CapacityReservationListResult) (result CapacityReservationListResult, err error) { - req, err := lastResults.capacityReservationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByCapacityReservationGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByCapacityReservationGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByCapacityReservationGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client CapacityReservationsClient) ListByCapacityReservationGroupComplete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result CapacityReservationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.ListByCapacityReservationGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByCapacityReservationGroup(ctx, resourceGroupName, capacityReservationGroupName) - return -} - -// Update the operation to update a capacity reservation. -// Parameters: -// 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. -func (client CapacityReservationsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate) (result CapacityReservationsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CapacityReservationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), - "capacityReservationName": autorest.Encode("path", capacityReservationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client CapacityReservationsClient) UpdateSender(req *http.Request) (future CapacityReservationsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CapacityReservationsClient) UpdateResponder(resp *http.Response) (result CapacityReservation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/client.go deleted file mode 100644 index c7c4543154d5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/client.go +++ /dev/null @@ -1,43 +0,0 @@ -// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. -// -// Package compute implements the Azure ARM Compute service API version . -// -// Compute Client -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Compute - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Compute. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go deleted file mode 100644 index 31ee54e5f533..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go +++ /dev/null @@ -1,422 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServiceOperatingSystemsClient is the compute Client -type CloudServiceOperatingSystemsClient struct { - BaseClient -} - -// NewCloudServiceOperatingSystemsClient creates an instance of the CloudServiceOperatingSystemsClient client. -func NewCloudServiceOperatingSystemsClient(subscriptionID string) CloudServiceOperatingSystemsClient { - return NewCloudServiceOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServiceOperatingSystemsClientWithBaseURI creates an instance of the CloudServiceOperatingSystemsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewCloudServiceOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceOperatingSystemsClient { - return CloudServiceOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetOSFamily gets properties of a guest operating system family that can be specified in the XML service -// configuration (.cscfg) for a cloud service. -// Parameters: -// location - name of the location that the OS family pertains to. -// osFamilyName - name of the OS family. -func (client CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string) (result OSFamily, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.GetOSFamily") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetOSFamilyPreparer(ctx, location, osFamilyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", nil, "Failure preparing request") - return - } - - resp, err := client.GetOSFamilySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", resp, "Failure sending request") - return - } - - result, err = client.GetOSFamilyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", resp, "Failure responding to request") - return - } - - return -} - -// GetOSFamilyPreparer prepares the GetOSFamily request. -func (client CloudServiceOperatingSystemsClient) GetOSFamilyPreparer(ctx context.Context, location string, osFamilyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "osFamilyName": autorest.Encode("path", osFamilyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOSFamilySender sends the GetOSFamily request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceOperatingSystemsClient) GetOSFamilySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOSFamilyResponder handles the response to the GetOSFamily request. The method always -// closes the http.Response Body. -func (client CloudServiceOperatingSystemsClient) GetOSFamilyResponder(resp *http.Response) (result OSFamily, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetOSVersion gets properties of a guest operating system version that can be specified in the XML service -// configuration (.cscfg) for a cloud service. -// Parameters: -// location - name of the location that the OS version pertains to. -// osVersionName - name of the OS version. -func (client CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string) (result OSVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.GetOSVersion") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetOSVersionPreparer(ctx, location, osVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", nil, "Failure preparing request") - return - } - - resp, err := client.GetOSVersionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", resp, "Failure sending request") - return - } - - result, err = client.GetOSVersionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", resp, "Failure responding to request") - return - } - - return -} - -// GetOSVersionPreparer prepares the GetOSVersion request. -func (client CloudServiceOperatingSystemsClient) GetOSVersionPreparer(ctx context.Context, location string, osVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "osVersionName": autorest.Encode("path", osVersionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOSVersionSender sends the GetOSVersion request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceOperatingSystemsClient) GetOSVersionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOSVersionResponder handles the response to the GetOSVersion request. The method always -// closes the http.Response Body. -func (client CloudServiceOperatingSystemsClient) GetOSVersionResponder(resp *http.Response) (result OSVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOSFamilies 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. -// Parameters: -// location - name of the location that the OS families pertain to. -func (client CloudServiceOperatingSystemsClient) ListOSFamilies(ctx context.Context, location string) (result OSFamilyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSFamilies") - defer func() { - sc := -1 - if result.oflr.Response.Response != nil { - sc = result.oflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listOSFamiliesNextResults - req, err := client.ListOSFamiliesPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", nil, "Failure preparing request") - return - } - - resp, err := client.ListOSFamiliesSender(req) - if err != nil { - result.oflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", resp, "Failure sending request") - return - } - - result.oflr, err = client.ListOSFamiliesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", resp, "Failure responding to request") - return - } - if result.oflr.hasNextLink() && result.oflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListOSFamiliesPreparer prepares the ListOSFamilies request. -func (client CloudServiceOperatingSystemsClient) ListOSFamiliesPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOSFamiliesSender sends the ListOSFamilies request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceOperatingSystemsClient) ListOSFamiliesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOSFamiliesResponder handles the response to the ListOSFamilies request. The method always -// closes the http.Response Body. -func (client CloudServiceOperatingSystemsClient) ListOSFamiliesResponder(resp *http.Response) (result OSFamilyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listOSFamiliesNextResults retrieves the next set of results, if any. -func (client CloudServiceOperatingSystemsClient) listOSFamiliesNextResults(ctx context.Context, lastResults OSFamilyListResult) (result OSFamilyListResult, err error) { - req, err := lastResults.oSFamilyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListOSFamiliesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListOSFamiliesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListOSFamiliesComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServiceOperatingSystemsClient) ListOSFamiliesComplete(ctx context.Context, location string) (result OSFamilyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSFamilies") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListOSFamilies(ctx, location) - return -} - -// ListOSVersions 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. -// Parameters: -// location - name of the location that the OS versions pertain to. -func (client CloudServiceOperatingSystemsClient) ListOSVersions(ctx context.Context, location string) (result OSVersionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSVersions") - defer func() { - sc := -1 - if result.ovlr.Response.Response != nil { - sc = result.ovlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listOSVersionsNextResults - req, err := client.ListOSVersionsPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", nil, "Failure preparing request") - return - } - - resp, err := client.ListOSVersionsSender(req) - if err != nil { - result.ovlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", resp, "Failure sending request") - return - } - - result.ovlr, err = client.ListOSVersionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", resp, "Failure responding to request") - return - } - if result.ovlr.hasNextLink() && result.ovlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListOSVersionsPreparer prepares the ListOSVersions request. -func (client CloudServiceOperatingSystemsClient) ListOSVersionsPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOSVersionsSender sends the ListOSVersions request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceOperatingSystemsClient) ListOSVersionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOSVersionsResponder handles the response to the ListOSVersions request. The method always -// closes the http.Response Body. -func (client CloudServiceOperatingSystemsClient) ListOSVersionsResponder(resp *http.Response) (result OSVersionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listOSVersionsNextResults retrieves the next set of results, if any. -func (client CloudServiceOperatingSystemsClient) listOSVersionsNextResults(ctx context.Context, lastResults OSVersionListResult) (result OSVersionListResult, err error) { - req, err := lastResults.oSVersionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListOSVersionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListOSVersionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListOSVersionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServiceOperatingSystemsClient) ListOSVersionsComplete(ctx context.Context, location string) (result OSVersionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSVersions") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListOSVersions(ctx, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go deleted file mode 100644 index f29213d9f510..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go +++ /dev/null @@ -1,715 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServiceRoleInstancesClient is the compute Client -type CloudServiceRoleInstancesClient struct { - BaseClient -} - -// NewCloudServiceRoleInstancesClient creates an instance of the CloudServiceRoleInstancesClient client. -func NewCloudServiceRoleInstancesClient(subscriptionID string) CloudServiceRoleInstancesClient { - return NewCloudServiceRoleInstancesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServiceRoleInstancesClientWithBaseURI creates an instance of the CloudServiceRoleInstancesClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewCloudServiceRoleInstancesClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceRoleInstancesClient { - return CloudServiceRoleInstancesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete deletes a role instance from a cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) Delete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CloudServiceRoleInstancesClient) DeletePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) DeleteSender(req *http.Request) (future CloudServiceRoleInstancesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a role instance from a cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// expand - the expand expression to apply to the operation. 'UserData' is not supported for cloud services. -func (client CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstance, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CloudServiceRoleInstancesClient) GetPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) GetResponder(resp *http.Response) (result RoleInstance, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView retrieves information about the run-time state of a role instance in a cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result RoleInstanceInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client CloudServiceRoleInstancesClient) GetInstanceViewPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) GetInstanceViewResponder(resp *http.Response) (result RoleInstanceInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetRemoteDesktopFile gets a remote desktop file for a role instance in a cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result ReadCloser, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.GetRemoteDesktopFile") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetRemoteDesktopFilePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", nil, "Failure preparing request") - return - } - - resp, err := client.GetRemoteDesktopFileSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", resp, "Failure sending request") - return - } - - result, err = client.GetRemoteDesktopFileResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", resp, "Failure responding to request") - return - } - - return -} - -// GetRemoteDesktopFilePreparer prepares the GetRemoteDesktopFile request. -func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFilePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetRemoteDesktopFileSender sends the GetRemoteDesktopFile request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFileSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetRemoteDesktopFileResponder handles the response to the GetRemoteDesktopFile request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFileResponder(resp *http.Response) (result ReadCloser, err error) { - result.Value = &resp.Body - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK)) - result.Response = autorest.Response{Response: resp} - return -} - -// List 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. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// expand - the expand expression to apply to the operation. 'UserData' is not supported for cloud services. -func (client CloudServiceRoleInstancesClient) List(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstanceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.List") - defer func() { - sc := -1 - if result.rilr.Response.Response != nil { - sc = result.rilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, cloudServiceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", resp, "Failure sending request") - return - } - - result.rilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", resp, "Failure responding to request") - return - } - if result.rilr.hasNextLink() && result.rilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CloudServiceRoleInstancesClient) ListPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) ListResponder(resp *http.Response) (result RoleInstanceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client CloudServiceRoleInstancesClient) listNextResults(ctx context.Context, lastResults RoleInstanceListResult) (result RoleInstanceListResult, err error) { - req, err := lastResults.roleInstanceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServiceRoleInstancesClient) ListComplete(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstanceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, cloudServiceName, expand) - return -} - -// 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. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) Rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesRebuildFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Rebuild") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RebuildPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Rebuild", nil, "Failure preparing request") - return - } - - result, err = client.RebuildSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Rebuild", result.Response(), "Failure sending request") - return - } - - return -} - -// RebuildPreparer prepares the Rebuild request. -func (client CloudServiceRoleInstancesClient) RebuildPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebuildSender sends the Rebuild request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) RebuildSender(req *http.Request) (future CloudServiceRoleInstancesRebuildFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RebuildResponder handles the response to the Rebuild request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) RebuildResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage the Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles -// or worker roles. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) Reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client CloudServiceRoleInstancesClient) ReimagePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) ReimageSender(req *http.Request) (future CloudServiceRoleInstancesReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart the Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. -// Parameters: -// roleInstanceName - name of the role instance. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRoleInstancesClient) Restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client CloudServiceRoleInstancesClient) RestartPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRoleInstancesClient) RestartSender(req *http.Request) (future CloudServiceRoleInstancesRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client CloudServiceRoleInstancesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go deleted file mode 100644 index a67f6351181e..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go +++ /dev/null @@ -1,229 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServiceRolesClient is the compute Client -type CloudServiceRolesClient struct { - BaseClient -} - -// NewCloudServiceRolesClient creates an instance of the CloudServiceRolesClient client. -func NewCloudServiceRolesClient(subscriptionID string) CloudServiceRolesClient { - return NewCloudServiceRolesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServiceRolesClientWithBaseURI creates an instance of the CloudServiceRolesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCloudServiceRolesClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceRolesClient { - return CloudServiceRolesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a role from a cloud service. -// Parameters: -// roleName - name of the role. -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRole, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, roleName, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CloudServiceRolesClient) GetPreparer(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleName": autorest.Encode("path", roleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRolesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CloudServiceRolesClient) GetResponder(resp *http.Response) (result CloudServiceRole, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List 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. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServiceRolesClient) List(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.List") - defer func() { - sc := -1 - if result.csrlr.Response.Response != nil { - sc = result.csrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.csrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", resp, "Failure sending request") - return - } - - result.csrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", resp, "Failure responding to request") - return - } - if result.csrlr.hasNextLink() && result.csrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CloudServiceRolesClient) ListPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServiceRolesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CloudServiceRolesClient) ListResponder(resp *http.Response) (result CloudServiceRoleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client CloudServiceRolesClient) listNextResults(ctx context.Context, lastResults CloudServiceRoleListResult) (result CloudServiceRoleListResult, err error) { - req, err := lastResults.cloudServiceRoleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServiceRolesClient) ListComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, cloudServiceName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go deleted file mode 100644 index e467efb8f666..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go +++ /dev/null @@ -1,1198 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServicesClient is the compute Client -type CloudServicesClient struct { - BaseClient -} - -// NewCloudServicesClient creates an instance of the CloudServicesClient client. -func NewCloudServicesClient(subscriptionID string) CloudServicesClient { - return NewCloudServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServicesClientWithBaseURI creates an instance of the CloudServicesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewCloudServicesClientWithBaseURI(baseURI string, subscriptionID string) CloudServicesClient { - return CloudServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a cloud service. Please note some properties can be set only during cloud service -// creation. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - the cloud service object. -func (client CloudServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudService) (result CloudServicesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CloudServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudService) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) CreateOrUpdateSender(req *http.Request) (future CloudServicesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) CreateOrUpdateResponder(resp *http.Response) (result CloudService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) Delete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CloudServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) DeleteSender(req *http.Request) (future CloudServicesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteInstances deletes role instances in a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - list of cloud service role instance names. -func (client CloudServicesClient) DeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesDeleteInstancesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.DeleteInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "DeleteInstances", err.Error()) - } - - req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "DeleteInstances", nil, "Failure preparing request") - return - } - - result, err = client.DeleteInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "DeleteInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteInstancesPreparer prepares the DeleteInstances request. -func (client CloudServicesClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteInstancesSender sends the DeleteInstances request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) DeleteInstancesSender(req *http.Request) (future CloudServicesDeleteInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get display information about a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudService, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CloudServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) GetResponder(resp *http.Response) (result CloudService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client CloudServicesClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) GetInstanceViewResponder(resp *http.Response) (result CloudServiceInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List 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. -// Parameters: -// resourceGroupName - name of the resource group. -func (client CloudServicesClient) List(ctx context.Context, resourceGroupName string) (result CloudServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.List") - defer func() { - sc := -1 - if result.cslr.Response.Response != nil { - sc = result.cslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", resp, "Failure sending request") - return - } - - result.cslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", resp, "Failure responding to request") - return - } - if result.cslr.hasNextLink() && result.cslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CloudServicesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) ListResponder(resp *http.Response) (result CloudServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client CloudServicesClient) listNextResults(ctx context.Context, lastResults CloudServiceListResult) (result CloudServiceListResult, err error) { - req, err := lastResults.cloudServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServicesClient) ListComplete(ctx context.Context, resourceGroupName string) (result CloudServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll 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. -func (client CloudServicesClient) ListAll(ctx context.Context) (result CloudServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.ListAll") - defer func() { - sc := -1 - if result.cslr.Response.Response != nil { - sc = result.cslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.cslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", resp, "Failure sending request") - return - } - - result.cslr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.cslr.hasNextLink() && result.cslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client CloudServicesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) ListAllResponder(resp *http.Response) (result CloudServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client CloudServicesClient) listAllNextResults(ctx context.Context, lastResults CloudServiceListResult) (result CloudServiceListResult, err error) { - req, err := lastResults.cloudServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServicesClient) ListAllComplete(ctx context.Context) (result CloudServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// PowerOff power off the cloud service. Note that resources are still attached and you are getting charged for the -// resources. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) PowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client CloudServicesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) PowerOffSender(req *http.Request) (future CloudServicesPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - list of cloud service role instance names. -func (client CloudServicesClient) Rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesRebuildFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Rebuild") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "Rebuild", err.Error()) - } - - req, err := client.RebuildPreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Rebuild", nil, "Failure preparing request") - return - } - - result, err = client.RebuildSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Rebuild", result.Response(), "Failure sending request") - return - } - - return -} - -// RebuildPreparer prepares the Rebuild request. -func (client CloudServicesClient) RebuildPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RebuildSender sends the Rebuild request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) RebuildSender(req *http.Request) (future CloudServicesRebuildFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RebuildResponder handles the response to the Rebuild request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) RebuildResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - list of cloud service role instance names. -func (client CloudServicesClient) Reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "Reimage", err.Error()) - } - - req, err := client.ReimagePreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client CloudServicesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) ReimageSender(req *http.Request) (future CloudServicesReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts one or more role instances in a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - list of cloud service role instance names. -func (client CloudServicesClient) Restart(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.CloudServicesClient", "Restart", err.Error()) - } - - req, err := client.RestartPreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client CloudServicesClient) RestartPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) RestartSender(req *http.Request) (future CloudServicesRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts the cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesClient) Start(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client CloudServicesClient) StartPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) StartSender(req *http.Request) (future CloudServicesStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -// parameters - the cloud service object. -func (client CloudServicesClient) Update(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudServiceUpdate) (result CloudServicesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, cloudServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client CloudServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudServiceUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesClient) UpdateSender(req *http.Request) (future CloudServicesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client CloudServicesClient) UpdateResponder(resp *http.Response) (result CloudService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go deleted file mode 100644 index 74f7d76a39e6..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go +++ /dev/null @@ -1,319 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CloudServicesUpdateDomainClient is the compute Client -type CloudServicesUpdateDomainClient struct { - BaseClient -} - -// NewCloudServicesUpdateDomainClient creates an instance of the CloudServicesUpdateDomainClient client. -func NewCloudServicesUpdateDomainClient(subscriptionID string) CloudServicesUpdateDomainClient { - return NewCloudServicesUpdateDomainClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCloudServicesUpdateDomainClientWithBaseURI creates an instance of the CloudServicesUpdateDomainClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewCloudServicesUpdateDomainClientWithBaseURI(baseURI string, subscriptionID string) CloudServicesUpdateDomainClient { - return CloudServicesUpdateDomainClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// 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. -// Parameters: -// 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. -func (client CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32) (result UpdateDomain, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.GetUpdateDomain") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetUpdateDomainPreparer(ctx, resourceGroupName, cloudServiceName, updateDomain) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", nil, "Failure preparing request") - return - } - - resp, err := client.GetUpdateDomainSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", resp, "Failure sending request") - return - } - - result, err = client.GetUpdateDomainResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", resp, "Failure responding to request") - return - } - - return -} - -// GetUpdateDomainPreparer prepares the GetUpdateDomain request. -func (client CloudServicesUpdateDomainClient) GetUpdateDomainPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "updateDomain": autorest.Encode("path", updateDomain), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetUpdateDomainSender sends the GetUpdateDomain request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesUpdateDomainClient) GetUpdateDomainSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetUpdateDomainResponder handles the response to the GetUpdateDomain request. The method always -// closes the http.Response Body. -func (client CloudServicesUpdateDomainClient) GetUpdateDomainResponder(resp *http.Response) (result UpdateDomain, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListUpdateDomains gets a list of all update domains in a cloud service. -// Parameters: -// resourceGroupName - name of the resource group. -// cloudServiceName - name of the cloud service. -func (client CloudServicesUpdateDomainClient) ListUpdateDomains(ctx context.Context, resourceGroupName string, cloudServiceName string) (result UpdateDomainListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.ListUpdateDomains") - defer func() { - sc := -1 - if result.udlr.Response.Response != nil { - sc = result.udlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listUpdateDomainsNextResults - req, err := client.ListUpdateDomainsPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", nil, "Failure preparing request") - return - } - - resp, err := client.ListUpdateDomainsSender(req) - if err != nil { - result.udlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", resp, "Failure sending request") - return - } - - result.udlr, err = client.ListUpdateDomainsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", resp, "Failure responding to request") - return - } - if result.udlr.hasNextLink() && result.udlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListUpdateDomainsPreparer prepares the ListUpdateDomains request. -func (client CloudServicesUpdateDomainClient) ListUpdateDomainsPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUpdateDomainsSender sends the ListUpdateDomains request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesUpdateDomainClient) ListUpdateDomainsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListUpdateDomainsResponder handles the response to the ListUpdateDomains request. The method always -// closes the http.Response Body. -func (client CloudServicesUpdateDomainClient) ListUpdateDomainsResponder(resp *http.Response) (result UpdateDomainListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listUpdateDomainsNextResults retrieves the next set of results, if any. -func (client CloudServicesUpdateDomainClient) listUpdateDomainsNextResults(ctx context.Context, lastResults UpdateDomainListResult) (result UpdateDomainListResult, err error) { - req, err := lastResults.updateDomainListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListUpdateDomainsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListUpdateDomainsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListUpdateDomainsComplete enumerates all values, automatically crossing page boundaries as required. -func (client CloudServicesUpdateDomainClient) ListUpdateDomainsComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result UpdateDomainListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.ListUpdateDomains") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListUpdateDomains(ctx, resourceGroupName, cloudServiceName) - return -} - -// WalkUpdateDomain updates the role instances in the specified update domain. -// Parameters: -// 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. -func (client CloudServicesUpdateDomainClient) WalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters *UpdateDomain) (result CloudServicesUpdateDomainWalkUpdateDomainFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.WalkUpdateDomain") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.WalkUpdateDomainPreparer(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "WalkUpdateDomain", nil, "Failure preparing request") - return - } - - result, err = client.WalkUpdateDomainSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "WalkUpdateDomain", result.Response(), "Failure sending request") - return - } - - return -} - -// WalkUpdateDomainPreparer prepares the WalkUpdateDomain request. -func (client CloudServicesUpdateDomainClient) WalkUpdateDomainPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters *UpdateDomain) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "updateDomain": autorest.Encode("path", updateDomain), - } - - const APIVersion = "2022-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.ID = nil - parameters.Name = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// WalkUpdateDomainSender sends the WalkUpdateDomain request. The method will close the -// http.Response Body if it receives an error. -func (client CloudServicesUpdateDomainClient) WalkUpdateDomainSender(req *http.Request) (future CloudServicesUpdateDomainWalkUpdateDomainFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// WalkUpdateDomainResponder handles the response to the WalkUpdateDomain request. The method always -// closes the http.Response Body. -func (client CloudServicesUpdateDomainClient) WalkUpdateDomainResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go deleted file mode 100644 index 6a6335a1e5ed..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go +++ /dev/null @@ -1,108 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CommunityGalleriesClient is the compute Client -type CommunityGalleriesClient struct { - BaseClient -} - -// NewCommunityGalleriesClient creates an instance of the CommunityGalleriesClient client. -func NewCommunityGalleriesClient(subscriptionID string) CommunityGalleriesClient { - return NewCommunityGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCommunityGalleriesClientWithBaseURI creates an instance of the CommunityGalleriesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCommunityGalleriesClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleriesClient { - return CommunityGalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a community gallery by gallery public name. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -func (client CommunityGalleriesClient) Get(ctx context.Context, location string, publicGalleryName string) (result CommunityGallery, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publicGalleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CommunityGalleriesClient) GetPreparer(ctx context.Context, location string, publicGalleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CommunityGalleriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CommunityGalleriesClient) GetResponder(resp *http.Response) (result CommunityGallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go deleted file mode 100644 index b77c378c6c12..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go +++ /dev/null @@ -1,228 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CommunityGalleryImagesClient is the compute Client -type CommunityGalleryImagesClient struct { - BaseClient -} - -// NewCommunityGalleryImagesClient creates an instance of the CommunityGalleryImagesClient client. -func NewCommunityGalleryImagesClient(subscriptionID string) CommunityGalleryImagesClient { - return NewCommunityGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCommunityGalleryImagesClientWithBaseURI creates an instance of the CommunityGalleryImagesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewCommunityGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImagesClient { - return CommunityGalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a community gallery image. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -// galleryImageName - the name of the community gallery image definition. -func (client CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CommunityGalleryImagesClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CommunityGalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CommunityGalleryImagesClient) GetResponder(resp *http.Response) (result CommunityGalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list community gallery images inside a gallery. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -func (client CommunityGalleryImagesClient) List(ctx context.Context, location string, publicGalleryName string) (result CommunityGalleryImageListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.List") - defer func() { - sc := -1 - if result.cgil.Response.Response != nil { - sc = result.cgil.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, publicGalleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cgil.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", resp, "Failure sending request") - return - } - - result.cgil, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", resp, "Failure responding to request") - return - } - if result.cgil.hasNextLink() && result.cgil.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CommunityGalleryImagesClient) ListPreparer(ctx context.Context, location string, publicGalleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client CommunityGalleryImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CommunityGalleryImagesClient) ListResponder(resp *http.Response) (result CommunityGalleryImageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client CommunityGalleryImagesClient) listNextResults(ctx context.Context, lastResults CommunityGalleryImageList) (result CommunityGalleryImageList, err error) { - req, err := lastResults.communityGalleryImageListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CommunityGalleryImagesClient) ListComplete(ctx context.Context, location string, publicGalleryName string) (result CommunityGalleryImageListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, publicGalleryName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go deleted file mode 100644 index dfa0ea75d4e1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go +++ /dev/null @@ -1,234 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CommunityGalleryImageVersionsClient is the compute Client -type CommunityGalleryImageVersionsClient struct { - BaseClient -} - -// NewCommunityGalleryImageVersionsClient creates an instance of the CommunityGalleryImageVersionsClient client. -func NewCommunityGalleryImageVersionsClient(subscriptionID string) CommunityGalleryImageVersionsClient { - return NewCommunityGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCommunityGalleryImageVersionsClientWithBaseURI creates an instance of the CommunityGalleryImageVersionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewCommunityGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImageVersionsClient { - return CommunityGalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a community gallery image version. -// Parameters: -// 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: .. -func (client CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (result CommunityGalleryImageVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CommunityGalleryImageVersionsClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CommunityGalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CommunityGalleryImageVersionsClient) GetResponder(resp *http.Response) (result CommunityGalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list community gallery image versions inside an image. -// Parameters: -// location - resource location. -// publicGalleryName - the public name of the community gallery. -// galleryImageName - the name of the community gallery image definition. -func (client CommunityGalleryImageVersionsClient) List(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImageVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.List") - defer func() { - sc := -1 - if result.cgivl.Response.Response != nil { - sc = result.cgivl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, publicGalleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cgivl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", resp, "Failure sending request") - return - } - - result.cgivl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", resp, "Failure responding to request") - return - } - if result.cgivl.hasNextLink() && result.cgivl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CommunityGalleryImageVersionsClient) ListPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "location": autorest.Encode("path", location), - "publicGalleryName": autorest.Encode("path", publicGalleryName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client CommunityGalleryImageVersionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CommunityGalleryImageVersionsClient) ListResponder(resp *http.Response) (result CommunityGalleryImageVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client CommunityGalleryImageVersionsClient) listNextResults(ctx context.Context, lastResults CommunityGalleryImageVersionList) (result CommunityGalleryImageVersionList, err error) { - req, err := lastResults.communityGalleryImageVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CommunityGalleryImageVersionsClient) ListComplete(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImageVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, publicGalleryName, galleryImageName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go deleted file mode 100644 index 0165ab393148..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go +++ /dev/null @@ -1,589 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DedicatedHostGroupsClient is the compute Client -type DedicatedHostGroupsClient struct { - BaseClient -} - -// NewDedicatedHostGroupsClient creates an instance of the DedicatedHostGroupsClient client. -func NewDedicatedHostGroupsClient(subscriptionID string) DedicatedHostGroupsClient { - return NewDedicatedHostGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDedicatedHostGroupsClientWithBaseURI creates an instance of the DedicatedHostGroupsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDedicatedHostGroupsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostGroupsClient { - return DedicatedHostGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// 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) -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// parameters - parameters supplied to the Create Dedicated Host Group. -func (client DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.DedicatedHostGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedHostGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DedicatedHostGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// expand - 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. -func (client DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, expand InstanceViewTypes) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DedicatedHostGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) GetResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup 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. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DedicatedHostGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dhglr.Response.Response != nil { - sc = result.dhglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dhglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dhglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DedicatedHostGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DedicatedHostGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { - req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription 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. -func (client DedicatedHostGroupsClient) ListBySubscription(ctx context.Context) (result DedicatedHostGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.dhglr.Response.Response != nil { - sc = result.dhglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.dhglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.dhglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client DedicatedHostGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client DedicatedHostGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { - req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result DedicatedHostGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update update an dedicated host group. -// Parameters: -// 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. -func (client DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DedicatedHostGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) UpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go deleted file mode 100644 index 2e52a6e1de0c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go +++ /dev/null @@ -1,575 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DedicatedHostsClient is the compute Client -type DedicatedHostsClient struct { - BaseClient -} - -// NewDedicatedHostsClient creates an instance of the DedicatedHostsClient client. -func NewDedicatedHostsClient(subscriptionID string) DedicatedHostsClient { - return NewDedicatedHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDedicatedHostsClientWithBaseURI creates an instance of the DedicatedHostsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDedicatedHostsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostsClient { - return DedicatedHostsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a dedicated host . -// Parameters: -// 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. -func (client DedicatedHostsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (result DedicatedHostsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - }}, - {Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.DedicatedHostsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedHostsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) CreateOrUpdateSender(req *http.Request) (future DedicatedHostsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a dedicated host. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -func (client DedicatedHostsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (result DedicatedHostsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName, hostName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DedicatedHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) DeleteSender(req *http.Request) (future DedicatedHostsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a dedicated host. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -// expand - 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. -func (client DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (result DedicatedHost, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName, hostName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DedicatedHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) GetResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByHostGroup 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostsClient) ListByHostGroup(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") - defer func() { - sc := -1 - if result.dhlr.Response.Response != nil { - sc = result.dhlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByHostGroupNextResults - req, err := client.ListByHostGroupPreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByHostGroupSender(req) - if err != nil { - result.dhlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure sending request") - return - } - - result.dhlr, err = client.ListByHostGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure responding to request") - return - } - if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByHostGroupPreparer prepares the ListByHostGroup request. -func (client DedicatedHostsClient) ListByHostGroupPreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByHostGroupSender sends the ListByHostGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) ListByHostGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByHostGroupResponder handles the response to the ListByHostGroup request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) ListByHostGroupResponder(resp *http.Response) (result DedicatedHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByHostGroupNextResults retrieves the next set of results, if any. -func (client DedicatedHostsClient) listByHostGroupNextResults(ctx context.Context, lastResults DedicatedHostListResult) (result DedicatedHostListResult, err error) { - req, err := lastResults.dedicatedHostListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByHostGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByHostGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByHostGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostsClient) ListByHostGroupComplete(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByHostGroup(ctx, resourceGroupName, hostGroupName) - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -func (client DedicatedHostsClient) Restart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (result DedicatedHostsRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, hostGroupName, hostName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client DedicatedHostsClient) RestartPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) RestartSender(req *http.Request) (future DedicatedHostsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update an dedicated host . -// Parameters: -// 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. -func (client DedicatedHostsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (result DedicatedHostsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DedicatedHostsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) UpdateSender(req *http.Request) (future DedicatedHostsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) UpdateResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go deleted file mode 100644 index f7e51959c441..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go +++ /dev/null @@ -1,1045 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiskAccessesClient is the compute Client -type DiskAccessesClient struct { - BaseClient -} - -// NewDiskAccessesClient creates an instance of the DiskAccessesClient client. -func NewDiskAccessesClient(subscriptionID string) DiskAccessesClient { - return NewDiskAccessesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiskAccessesClientWithBaseURI creates an instance of the DiskAccessesClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDiskAccessesClientWithBaseURI(baseURI string, subscriptionID string) DiskAccessesClient { - return DiskAccessesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk access resource -// Parameters: -// 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. -func (client DiskAccessesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess) (result DiskAccessesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskAccessName, diskAccess) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiskAccessesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", pathParameters), - autorest.WithJSON(diskAccess), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) CreateOrUpdateSender(req *http.Request) (future DiskAccessesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) CreateOrUpdateResponder(resp *http.Response) (result DiskAccess, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk access resource. -// Parameters: -// 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. -func (client DiskAccessesClient) Delete(ctx context.Context, resourceGroupName string, diskAccessName string) (result DiskAccessesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskAccessName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DiskAccessesClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) DeleteSender(req *http.Request) (future DiskAccessesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteAPrivateEndpointConnection deletes a private endpoint connection under a disk access resource. -// Parameters: -// 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. -func (client DiskAccessesClient) DeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (result DiskAccessesDeleteAPrivateEndpointConnectionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.DeleteAPrivateEndpointConnection") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeleteAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "DeleteAPrivateEndpointConnection", nil, "Failure preparing request") - return - } - - result, err = client.DeleteAPrivateEndpointConnectionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "DeleteAPrivateEndpointConnection", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteAPrivateEndpointConnectionPreparer prepares the DeleteAPrivateEndpointConnection request. -func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteAPrivateEndpointConnectionSender sends the DeleteAPrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionSender(req *http.Request) (future DiskAccessesDeleteAPrivateEndpointConnectionFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteAPrivateEndpointConnectionResponder handles the response to the DeleteAPrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk access resource. -// Parameters: -// 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. -func (client DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string) (result DiskAccess, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskAccessName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DiskAccessesClient) GetPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) GetResponder(resp *http.Response) (result DiskAccess, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAPrivateEndpointConnection gets information about a private endpoint connection under a disk access resource. -// Parameters: -// 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. -func (client DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.GetAPrivateEndpointConnection") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", nil, "Failure preparing request") - return - } - - resp, err := client.GetAPrivateEndpointConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", resp, "Failure sending request") - return - } - - result, err = client.GetAPrivateEndpointConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", resp, "Failure responding to request") - return - } - - return -} - -// GetAPrivateEndpointConnectionPreparer prepares the GetAPrivateEndpointConnection request. -func (client DiskAccessesClient) GetAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAPrivateEndpointConnectionSender sends the GetAPrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) GetAPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetAPrivateEndpointConnectionResponder handles the response to the GetAPrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) GetAPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPrivateLinkResources gets the private link resources possible under disk access resource -// Parameters: -// 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. -func (client DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateLinkResourceListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.GetPrivateLinkResources") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPrivateLinkResourcesPreparer(ctx, resourceGroupName, diskAccessName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", nil, "Failure preparing request") - return - } - - resp, err := client.GetPrivateLinkResourcesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", resp, "Failure sending request") - return - } - - result, err = client.GetPrivateLinkResourcesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", resp, "Failure responding to request") - return - } - - return -} - -// GetPrivateLinkResourcesPreparer prepares the GetPrivateLinkResources request. -func (client DiskAccessesClient) GetPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPrivateLinkResourcesSender sends the GetPrivateLinkResources request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) GetPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetPrivateLinkResourcesResponder handles the response to the GetPrivateLinkResources request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) GetPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disk access resources under a subscription. -func (client DiskAccessesClient) List(ctx context.Context) (result DiskAccessListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.List") - defer func() { - sc := -1 - if result.dal.Response.Response != nil { - sc = result.dal.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dal.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", resp, "Failure sending request") - return - } - - result.dal, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", resp, "Failure responding to request") - return - } - if result.dal.hasNextLink() && result.dal.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DiskAccessesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) ListResponder(resp *http.Response) (result DiskAccessList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DiskAccessesClient) listNextResults(ctx context.Context, lastResults DiskAccessList) (result DiskAccessList, err error) { - req, err := lastResults.diskAccessListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskAccessesClient) ListComplete(ctx context.Context) (result DiskAccessListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the disk access resources under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DiskAccessesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskAccessListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dal.Response.Response != nil { - sc = result.dal.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dal.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dal, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dal.hasNextLink() && result.dal.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DiskAccessesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) ListByResourceGroupResponder(resp *http.Response) (result DiskAccessList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DiskAccessesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskAccessList) (result DiskAccessList, err error) { - req, err := lastResults.diskAccessListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskAccessesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskAccessListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListPrivateEndpointConnections list information about private endpoint connections under a disk access resource -// Parameters: -// 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. -func (client DiskAccessesClient) ListPrivateEndpointConnections(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateEndpointConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListPrivateEndpointConnections") - defer func() { - sc := -1 - if result.peclr.Response.Response != nil { - sc = result.peclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listPrivateEndpointConnectionsNextResults - req, err := client.ListPrivateEndpointConnectionsPreparer(ctx, resourceGroupName, diskAccessName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", nil, "Failure preparing request") - return - } - - resp, err := client.ListPrivateEndpointConnectionsSender(req) - if err != nil { - result.peclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", resp, "Failure sending request") - return - } - - result.peclr, err = client.ListPrivateEndpointConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", resp, "Failure responding to request") - return - } - if result.peclr.hasNextLink() && result.peclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPrivateEndpointConnectionsPreparer prepares the ListPrivateEndpointConnections request. -func (client DiskAccessesClient) ListPrivateEndpointConnectionsPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPrivateEndpointConnectionsSender sends the ListPrivateEndpointConnections request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) ListPrivateEndpointConnectionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPrivateEndpointConnectionsResponder handles the response to the ListPrivateEndpointConnections request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) ListPrivateEndpointConnectionsResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPrivateEndpointConnectionsNextResults retrieves the next set of results, if any. -func (client DiskAccessesClient) listPrivateEndpointConnectionsNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { - req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPrivateEndpointConnectionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPrivateEndpointConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPrivateEndpointConnectionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskAccessesClient) ListPrivateEndpointConnectionsComplete(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateEndpointConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListPrivateEndpointConnections") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListPrivateEndpointConnections(ctx, resourceGroupName, diskAccessName) - return -} - -// Update updates (patches) a disk access resource. -// Parameters: -// 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. -func (client DiskAccessesClient) Update(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate) (result DiskAccessesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskAccessName, diskAccess) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DiskAccessesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", pathParameters), - autorest.WithJSON(diskAccess), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) UpdateSender(req *http.Request) (future DiskAccessesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) UpdateResponder(resp *http.Response) (result DiskAccess, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateAPrivateEndpointConnection approve or reject a private endpoint connection under disk access resource, this -// can't be used to create a new private endpoint connection. -// Parameters: -// 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. -func (client DiskAccessesClient) UpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (result DiskAccessesUpdateAPrivateEndpointConnectionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.UpdateAPrivateEndpointConnection") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: privateEndpointConnection, - Constraints: []validation.Constraint{{Target: "privateEndpointConnection.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "privateEndpointConnection.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", err.Error()) - } - - req, err := client.UpdateAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", nil, "Failure preparing request") - return - } - - result, err = client.UpdateAPrivateEndpointConnectionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateAPrivateEndpointConnectionPreparer prepares the UpdateAPrivateEndpointConnection request. -func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskAccessName": autorest.Encode("path", diskAccessName), - "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - privateEndpointConnection.ID = nil - privateEndpointConnection.Name = nil - privateEndpointConnection.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), - autorest.WithJSON(privateEndpointConnection), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateAPrivateEndpointConnectionSender sends the UpdateAPrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionSender(req *http.Request) (future DiskAccessesUpdateAPrivateEndpointConnectionFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateAPrivateEndpointConnectionResponder handles the response to the UpdateAPrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go deleted file mode 100644 index ed5632a30550..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go +++ /dev/null @@ -1,719 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiskEncryptionSetsClient is the compute Client -type DiskEncryptionSetsClient struct { - BaseClient -} - -// NewDiskEncryptionSetsClient creates an instance of the DiskEncryptionSetsClient client. -func NewDiskEncryptionSetsClient(subscriptionID string) DiskEncryptionSetsClient { - return NewDiskEncryptionSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiskEncryptionSetsClientWithBaseURI creates an instance of the DiskEncryptionSetsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDiskEncryptionSetsClientWithBaseURI(baseURI string, subscriptionID string) DiskEncryptionSetsClient { - return DiskEncryptionSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk encryption set -// Parameters: -// 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. -func (client DiskEncryptionSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (result DiskEncryptionSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: diskEncryptionSet, - Constraints: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.DiskEncryptionSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiskEncryptionSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithJSON(diskEncryptionSet), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) (future DiskEncryptionSetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk encryption set. -// Parameters: -// 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. -func (client DiskEncryptionSetsClient) Delete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DiskEncryptionSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future DiskEncryptionSetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk encryption set. -// Parameters: -// 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. -func (client DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DiskEncryptionSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) GetResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disk encryption sets under a subscription. -func (client DiskEncryptionSetsClient) List(ctx context.Context) (result DiskEncryptionSetListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") - defer func() { - sc := -1 - if result.desl.Response.Response != nil { - sc = result.desl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.desl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure sending request") - return - } - - result.desl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure responding to request") - return - } - if result.desl.hasNextLink() && result.desl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DiskEncryptionSetsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DiskEncryptionSetsClient) listNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { - req, err := lastResults.diskEncryptionSetListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListComplete(ctx context.Context) (result DiskEncryptionSetListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListAssociatedResources lists all resources that are encrypted with this disk encryption set. -// Parameters: -// 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. -func (client DiskEncryptionSetsClient) ListAssociatedResources(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result ResourceURIListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListAssociatedResources") - defer func() { - sc := -1 - if result.rul.Response.Response != nil { - sc = result.rul.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAssociatedResourcesNextResults - req, err := client.ListAssociatedResourcesPreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", nil, "Failure preparing request") - return - } - - resp, err := client.ListAssociatedResourcesSender(req) - if err != nil { - result.rul.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", resp, "Failure sending request") - return - } - - result.rul, err = client.ListAssociatedResourcesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", resp, "Failure responding to request") - return - } - if result.rul.hasNextLink() && result.rul.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAssociatedResourcesPreparer prepares the ListAssociatedResources request. -func (client DiskEncryptionSetsClient) ListAssociatedResourcesPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAssociatedResourcesSender sends the ListAssociatedResources request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) ListAssociatedResourcesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAssociatedResourcesResponder handles the response to the ListAssociatedResources request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListAssociatedResourcesResponder(resp *http.Response) (result ResourceURIList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAssociatedResourcesNextResults retrieves the next set of results, if any. -func (client DiskEncryptionSetsClient) listAssociatedResourcesNextResults(ctx context.Context, lastResults ResourceURIList) (result ResourceURIList, err error) { - req, err := lastResults.resourceURIListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAssociatedResourcesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAssociatedResourcesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAssociatedResourcesComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListAssociatedResourcesComplete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result ResourceURIListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListAssociatedResources") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAssociatedResources(ctx, resourceGroupName, diskEncryptionSetName) - return -} - -// ListByResourceGroup lists all the disk encryption sets under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DiskEncryptionSetsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.desl.Response.Response != nil { - sc = result.desl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.desl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.desl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.desl.hasNextLink() && result.desl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DiskEncryptionSetsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListByResourceGroupResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DiskEncryptionSetsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { - req, err := lastResults.diskEncryptionSetListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update updates (patches) a disk encryption set. -// Parameters: -// 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. -func (client DiskEncryptionSetsClient) Update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (result DiskEncryptionSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DiskEncryptionSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithJSON(diskEncryptionSet), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future DiskEncryptionSetsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) UpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go deleted file mode 100644 index 2f38511cc6e0..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go +++ /dev/null @@ -1,407 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiskRestorePointClient is the compute Client -type DiskRestorePointClient struct { - BaseClient -} - -// NewDiskRestorePointClient creates an instance of the DiskRestorePointClient client. -func NewDiskRestorePointClient(subscriptionID string) DiskRestorePointClient { - return NewDiskRestorePointClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiskRestorePointClientWithBaseURI creates an instance of the DiskRestorePointClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDiskRestorePointClientWithBaseURI(baseURI string, subscriptionID string) DiskRestorePointClient { - return DiskRestorePointClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get disk restorePoint resource -// Parameters: -// 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. -func (client DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (result DiskRestorePoint, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DiskRestorePointClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskRestorePointName": autorest.Encode("path", diskRestorePointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmRestorePointName": autorest.Encode("path", VMRestorePointName), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DiskRestorePointClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DiskRestorePointClient) GetResponder(resp *http.Response) (result DiskRestorePoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a diskRestorePoint. -// Parameters: -// 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. -func (client DiskRestorePointClient) GrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData) (result DiskRestorePointGrantAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: grantAccessData, - Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.DiskRestorePointClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client DiskRestorePointClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskRestorePointName": autorest.Encode("path", diskRestorePointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmRestorePointName": autorest.Encode("path", VMRestorePointName), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DiskRestorePointClient) GrantAccessSender(req *http.Request) (future DiskRestorePointGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client DiskRestorePointClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByRestorePoint lists diskRestorePoints under a vmRestorePoint. -// Parameters: -// 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. -func (client DiskRestorePointClient) ListByRestorePoint(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (result DiskRestorePointListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.ListByRestorePoint") - defer func() { - sc := -1 - if result.drpl.Response.Response != nil { - sc = result.drpl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByRestorePointNextResults - req, err := client.ListByRestorePointPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", nil, "Failure preparing request") - return - } - - resp, err := client.ListByRestorePointSender(req) - if err != nil { - result.drpl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", resp, "Failure sending request") - return - } - - result.drpl, err = client.ListByRestorePointResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", resp, "Failure responding to request") - return - } - if result.drpl.hasNextLink() && result.drpl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByRestorePointPreparer prepares the ListByRestorePoint request. -func (client DiskRestorePointClient) ListByRestorePointPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmRestorePointName": autorest.Encode("path", VMRestorePointName), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByRestorePointSender sends the ListByRestorePoint request. The method will close the -// http.Response Body if it receives an error. -func (client DiskRestorePointClient) ListByRestorePointSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByRestorePointResponder handles the response to the ListByRestorePoint request. The method always -// closes the http.Response Body. -func (client DiskRestorePointClient) ListByRestorePointResponder(resp *http.Response) (result DiskRestorePointList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByRestorePointNextResults retrieves the next set of results, if any. -func (client DiskRestorePointClient) listByRestorePointNextResults(ctx context.Context, lastResults DiskRestorePointList) (result DiskRestorePointList, err error) { - req, err := lastResults.diskRestorePointListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByRestorePointSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByRestorePointResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByRestorePointComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskRestorePointClient) ListByRestorePointComplete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (result DiskRestorePointListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.ListByRestorePoint") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByRestorePoint(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName) - return -} - -// RevokeAccess revokes access to a diskRestorePoint. -// Parameters: -// 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. -func (client DiskRestorePointClient) RevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (result DiskRestorePointRevokeAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client DiskRestorePointClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskRestorePointName": autorest.Encode("path", diskRestorePointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmRestorePointName": autorest.Encode("path", VMRestorePointName), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DiskRestorePointClient) RevokeAccessSender(req *http.Request) (future DiskRestorePointRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client DiskRestorePointClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go deleted file mode 100644 index a8a4f41132a0..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go +++ /dev/null @@ -1,774 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DisksClient is the compute Client -type DisksClient struct { - BaseClient -} - -// NewDisksClient creates an instance of the DisksClient client. -func NewDisksClient(subscriptionID string) DisksClient { - return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDisksClientWithBaseURI creates an instance of the DisksClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient { - return DisksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk. -// Parameters: -// 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. -func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (result DisksCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: disk, - Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.PurchasePlan", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.PurchasePlan.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "disk.DiskProperties.PurchasePlan.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "disk.DiskProperties.PurchasePlan.Product", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "disk.DiskProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - disk.ManagedBy = nil - disk.ManagedByExtended = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithJSON(disk), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk. -// Parameters: -// 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. -func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, diskName string) (result DisksDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk. -// Parameters: -// 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. -func (client DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string) (result Disk, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a disk. -// Parameters: -// 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. -func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (result DisksGrantAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: grantAccessData, - Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.DisksClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disks under a subscription. -func (client DisksClient) List(ctx context.Context) (result DiskListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request") - return - } - - result.dl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DisksClient) listNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { - req, err := lastResults.diskListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the disks under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DisksClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { - req, err := lastResults.diskListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// RevokeAccess revokes access to a disk. -// Parameters: -// 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. -func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result DisksRevokeAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates (patches) a disk. -// Parameters: -// 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. -func (client DisksClient) Update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (result DisksUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithJSON(disk), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go deleted file mode 100644 index cf404eb9a131..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go +++ /dev/null @@ -1,2248 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// AccessLevel enumerates the values for access level. -type AccessLevel string - -const ( - // None ... - None AccessLevel = "None" - // Read ... - Read AccessLevel = "Read" - // Write ... - Write AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{None, Read, Write} -} - -// AggregatedReplicationState enumerates the values for aggregated replication state. -type AggregatedReplicationState string - -const ( - // Completed ... - Completed AggregatedReplicationState = "Completed" - // Failed ... - Failed AggregatedReplicationState = "Failed" - // InProgress ... - InProgress AggregatedReplicationState = "InProgress" - // Unknown ... - Unknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} -} - -// Architecture enumerates the values for architecture. -type Architecture string - -const ( - // Arm64 ... - Arm64 Architecture = "Arm64" - // X64 ... - X64 Architecture = "x64" -) - -// PossibleArchitectureValues returns an array of possible values for the Architecture const type. -func PossibleArchitectureValues() []Architecture { - return []Architecture{Arm64, X64} -} - -// ArchitectureTypes enumerates the values for architecture types. -type ArchitectureTypes string - -const ( - // ArchitectureTypesArm64 ... - ArchitectureTypesArm64 ArchitectureTypes = "Arm64" - // ArchitectureTypesX64 ... - ArchitectureTypesX64 ArchitectureTypes = "x64" -) - -// PossibleArchitectureTypesValues returns an array of possible values for the ArchitectureTypes const type. -func PossibleArchitectureTypesValues() []ArchitectureTypes { - return []ArchitectureTypes{ArchitectureTypesArm64, ArchitectureTypesX64} -} - -// AvailabilitySetSkuTypes enumerates the values for availability set sku types. -type AvailabilitySetSkuTypes string - -const ( - // Aligned ... - Aligned AvailabilitySetSkuTypes = "Aligned" - // Classic ... - Classic AvailabilitySetSkuTypes = "Classic" -) - -// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. -func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { - return []AvailabilitySetSkuTypes{Aligned, Classic} -} - -// CachingTypes enumerates the values for caching types. -type CachingTypes string - -const ( - // CachingTypesNone ... - CachingTypesNone CachingTypes = "None" - // CachingTypesReadOnly ... - CachingTypesReadOnly CachingTypes = "ReadOnly" - // CachingTypesReadWrite ... - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} -} - -// CapacityReservationGroupInstanceViewTypes enumerates the values for capacity reservation group instance view -// types. -type CapacityReservationGroupInstanceViewTypes string - -const ( - // InstanceView ... - InstanceView CapacityReservationGroupInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationGroupInstanceViewTypesValues returns an array of possible values for the CapacityReservationGroupInstanceViewTypes const type. -func PossibleCapacityReservationGroupInstanceViewTypesValues() []CapacityReservationGroupInstanceViewTypes { - return []CapacityReservationGroupInstanceViewTypes{InstanceView} -} - -// CapacityReservationInstanceViewTypes enumerates the values for capacity reservation instance view types. -type CapacityReservationInstanceViewTypes string - -const ( - // CapacityReservationInstanceViewTypesInstanceView ... - CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView" -) - -// PossibleCapacityReservationInstanceViewTypesValues returns an array of possible values for the CapacityReservationInstanceViewTypes const type. -func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationInstanceViewTypes { - return []CapacityReservationInstanceViewTypes{CapacityReservationInstanceViewTypesInstanceView} -} - -// CloudServiceSlotType enumerates the values for cloud service slot type. -type CloudServiceSlotType string - -const ( - // Production ... - Production CloudServiceSlotType = "Production" - // Staging ... - Staging CloudServiceSlotType = "Staging" -) - -// PossibleCloudServiceSlotTypeValues returns an array of possible values for the CloudServiceSlotType const type. -func PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType { - return []CloudServiceSlotType{Production, Staging} -} - -// CloudServiceUpgradeMode enumerates the values for cloud service upgrade mode. -type CloudServiceUpgradeMode string - -const ( - // Auto ... - Auto CloudServiceUpgradeMode = "Auto" - // Manual ... - Manual CloudServiceUpgradeMode = "Manual" - // Simultaneous ... - Simultaneous CloudServiceUpgradeMode = "Simultaneous" -) - -// PossibleCloudServiceUpgradeModeValues returns an array of possible values for the CloudServiceUpgradeMode const type. -func PossibleCloudServiceUpgradeModeValues() []CloudServiceUpgradeMode { - return []CloudServiceUpgradeMode{Auto, Manual, Simultaneous} -} - -// ComponentNames enumerates the values for component names. -type ComponentNames string - -const ( - // MicrosoftWindowsShellSetup ... - MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" -) - -// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. -func PossibleComponentNamesValues() []ComponentNames { - return []ComponentNames{MicrosoftWindowsShellSetup} -} - -// ConfidentialVMEncryptionType enumerates the values for confidential vm encryption type. -type ConfidentialVMEncryptionType string - -const ( - // EncryptedVMGuestStateOnlyWithPmk ... - EncryptedVMGuestStateOnlyWithPmk ConfidentialVMEncryptionType = "EncryptedVMGuestStateOnlyWithPmk" - // EncryptedWithCmk ... - EncryptedWithCmk ConfidentialVMEncryptionType = "EncryptedWithCmk" - // EncryptedWithPmk ... - EncryptedWithPmk ConfidentialVMEncryptionType = "EncryptedWithPmk" -) - -// PossibleConfidentialVMEncryptionTypeValues returns an array of possible values for the ConfidentialVMEncryptionType const type. -func PossibleConfidentialVMEncryptionTypeValues() []ConfidentialVMEncryptionType { - return []ConfidentialVMEncryptionType{EncryptedVMGuestStateOnlyWithPmk, EncryptedWithCmk, EncryptedWithPmk} -} - -// ConsistencyModeTypes enumerates the values for consistency mode types. -type ConsistencyModeTypes string - -const ( - // ApplicationConsistent ... - ApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" - // CrashConsistent ... - CrashConsistent ConsistencyModeTypes = "CrashConsistent" - // FileSystemConsistent ... - FileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" -) - -// PossibleConsistencyModeTypesValues returns an array of possible values for the ConsistencyModeTypes const type. -func PossibleConsistencyModeTypesValues() []ConsistencyModeTypes { - return []ConsistencyModeTypes{ApplicationConsistent, CrashConsistent, FileSystemConsistent} -} - -// DataAccessAuthMode enumerates the values for data access auth mode. -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 an array of possible values for the DataAccessAuthMode const type. -func PossibleDataAccessAuthModeValues() []DataAccessAuthMode { - return []DataAccessAuthMode{DataAccessAuthModeAzureActiveDirectory, DataAccessAuthModeNone} -} - -// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. -type DedicatedHostLicenseTypes string - -const ( - // DedicatedHostLicenseTypesNone ... - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - // DedicatedHostLicenseTypesWindowsServerHybrid ... - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - // DedicatedHostLicenseTypesWindowsServerPerpetual ... - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} -} - -// DeleteOptions enumerates the values for delete options. -type DeleteOptions string - -const ( - // Delete ... - Delete DeleteOptions = "Delete" - // Detach ... - Detach DeleteOptions = "Detach" -) - -// PossibleDeleteOptionsValues returns an array of possible values for the DeleteOptions const type. -func PossibleDeleteOptionsValues() []DeleteOptions { - return []DeleteOptions{Delete, Detach} -} - -// DiffDiskOptions enumerates the values for diff disk options. -type DiffDiskOptions string - -const ( - // Local ... - Local DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{Local} -} - -// DiffDiskPlacement enumerates the values for diff disk placement. -type DiffDiskPlacement string - -const ( - // CacheDisk ... - CacheDisk DiffDiskPlacement = "CacheDisk" - // ResourceDisk ... - ResourceDisk DiffDiskPlacement = "ResourceDisk" -) - -// PossibleDiffDiskPlacementValues returns an array of possible values for the DiffDiskPlacement const type. -func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { - return []DiffDiskPlacement{CacheDisk, ResourceDisk} -} - -// DiskControllerTypes enumerates the values for disk controller types. -type DiskControllerTypes string - -const ( - // NVMe ... - NVMe DiskControllerTypes = "NVMe" - // SCSI ... - SCSI DiskControllerTypes = "SCSI" -) - -// PossibleDiskControllerTypesValues returns an array of possible values for the DiskControllerTypes const type. -func PossibleDiskControllerTypesValues() []DiskControllerTypes { - return []DiskControllerTypes{NVMe, SCSI} -} - -// DiskCreateOption enumerates the values for disk create option. -type DiskCreateOption string - -const ( - // Attach Disk will be attached to a VM. - Attach DiskCreateOption = "Attach" - // Copy Create a new disk or snapshot by copying from a disk or snapshot specified by the given - // sourceResourceId. - Copy DiskCreateOption = "Copy" - // CopyStart 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. - CopyStart DiskCreateOption = "CopyStart" - // Empty Create an empty data disk of a size given by diskSizeGB. - Empty DiskCreateOption = "Empty" - // FromImage Create a new disk from a platform image specified by the given imageReference or - // galleryImageReference. - FromImage DiskCreateOption = "FromImage" - // Import Create a disk by importing from a blob specified by a sourceUri in a storage account specified by - // storageAccountId. - Import DiskCreateOption = "Import" - // ImportSecure 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 - ImportSecure DiskCreateOption = "ImportSecure" - // Restore Create a new disk by copying from a backup recovery point. - Restore DiskCreateOption = "Restore" - // Upload Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - Upload DiskCreateOption = "Upload" - // UploadPreparedSecure 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 - UploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" -) - -// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{Attach, Copy, CopyStart, Empty, FromImage, Import, ImportSecure, Restore, Upload, UploadPreparedSecure} -} - -// DiskCreateOptionTypes enumerates the values for disk create option types. -type DiskCreateOptionTypes string - -const ( - // DiskCreateOptionTypesAttach ... - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - // DiskCreateOptionTypesEmpty ... - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - // DiskCreateOptionTypesFromImage ... - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" -) - -// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} -} - -// DiskDeleteOptionTypes enumerates the values for disk delete option types. -type DiskDeleteOptionTypes string - -const ( - // DiskDeleteOptionTypesDelete ... - DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete" - // DiskDeleteOptionTypesDetach ... - DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach" -) - -// PossibleDiskDeleteOptionTypesValues returns an array of possible values for the DiskDeleteOptionTypes const type. -func PossibleDiskDeleteOptionTypesValues() []DiskDeleteOptionTypes { - return []DiskDeleteOptionTypes{DiskDeleteOptionTypesDelete, DiskDeleteOptionTypesDetach} -} - -// DiskDetachOptionTypes enumerates the values for disk detach option types. -type DiskDetachOptionTypes string - -const ( - // ForceDetach ... - ForceDetach DiskDetachOptionTypes = "ForceDetach" -) - -// PossibleDiskDetachOptionTypesValues returns an array of possible values for the DiskDetachOptionTypes const type. -func PossibleDiskDetachOptionTypesValues() []DiskDetachOptionTypes { - return []DiskDetachOptionTypes{ForceDetach} -} - -// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. -type DiskEncryptionSetIdentityType string - -const ( - // DiskEncryptionSetIdentityTypeNone ... - DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None" - // DiskEncryptionSetIdentityTypeSystemAssigned ... - DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" - // DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned ... - DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned DiskEncryptionSetIdentityType = "SystemAssigned, UserAssigned" - // DiskEncryptionSetIdentityTypeUserAssigned ... - DiskEncryptionSetIdentityTypeUserAssigned DiskEncryptionSetIdentityType = "UserAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{DiskEncryptionSetIdentityTypeNone, DiskEncryptionSetIdentityTypeSystemAssigned, DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned, DiskEncryptionSetIdentityTypeUserAssigned} -} - -// DiskEncryptionSetType enumerates the values for disk encryption set type. -type DiskEncryptionSetType string - -const ( - // ConfidentialVMEncryptedWithCustomerKey Confidential VM supported disk and VM guest state would be - // encrypted with customer managed key. - ConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = "ConfidentialVmEncryptedWithCustomerKey" - // EncryptionAtRestWithCustomerKey Resource using diskEncryptionSet would be encrypted at rest with - // Customer managed key that can be changed and revoked by a customer. - EncryptionAtRestWithCustomerKey DiskEncryptionSetType = "EncryptionAtRestWithCustomerKey" - // EncryptionAtRestWithPlatformAndCustomerKeys 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. - EncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = "EncryptionAtRestWithPlatformAndCustomerKeys" -) - -// PossibleDiskEncryptionSetTypeValues returns an array of possible values for the DiskEncryptionSetType const type. -func PossibleDiskEncryptionSetTypeValues() []DiskEncryptionSetType { - return []DiskEncryptionSetType{ConfidentialVMEncryptedWithCustomerKey, EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformAndCustomerKeys} -} - -// DiskSecurityTypes enumerates the values for disk security types. -type DiskSecurityTypes string - -const ( - // ConfidentialVMDiskEncryptedWithCustomerKey Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a customer managed key - ConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" - // ConfidentialVMDiskEncryptedWithPlatformKey Indicates Confidential VM disk with both OS disk and VM guest - // state encrypted with a platform managed key - ConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" - // ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey Indicates Confidential VM disk with only VM guest - // state encrypted - ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" - // TrustedLaunch Trusted Launch provides security features such as secure boot and virtual Trusted Platform - // Module (vTPM) - TrustedLaunch DiskSecurityTypes = "TrustedLaunch" -) - -// PossibleDiskSecurityTypesValues returns an array of possible values for the DiskSecurityTypes const type. -func PossibleDiskSecurityTypesValues() []DiskSecurityTypes { - return []DiskSecurityTypes{ConfidentialVMDiskEncryptedWithCustomerKey, ConfidentialVMDiskEncryptedWithPlatformKey, ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey, TrustedLaunch} -} - -// DiskState enumerates the values for disk state. -type DiskState string - -const ( - // ActiveSAS The disk currently has an Active SAS Uri associated with it. - ActiveSAS DiskState = "ActiveSAS" - // ActiveSASFrozen The disk is attached to a VM in hibernated state and has an active SAS URI associated - // with it. - ActiveSASFrozen DiskState = "ActiveSASFrozen" - // ActiveUpload A disk is created for upload and a write token has been issued for uploading to it. - ActiveUpload DiskState = "ActiveUpload" - // Attached The disk is currently attached to a running VM. - Attached DiskState = "Attached" - // Frozen The disk is attached to a VM which is in hibernated state. - Frozen DiskState = "Frozen" - // ReadyToUpload A disk is ready to be created by upload by requesting a write token. - ReadyToUpload DiskState = "ReadyToUpload" - // Reserved The disk is attached to a stopped-deallocated VM. - Reserved DiskState = "Reserved" - // Unattached The disk is not being used and can be attached to a VM. - Unattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns an array of possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ActiveSAS, ActiveSASFrozen, ActiveUpload, Attached, Frozen, ReadyToUpload, Reserved, Unattached} -} - -// DiskStorageAccountTypes enumerates the values for disk storage account types. -type DiskStorageAccountTypes string - -const ( - // PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - PremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // PremiumV2LRS Premium SSD v2 locally redundant storage. Best for production and performance-sensitive - // workloads that consistently require low latency and high IOPS and throughput. - PremiumV2LRS DiskStorageAccountTypes = "PremiumV2_LRS" - // PremiumZRS Premium SSD zone redundant storage. Best for the production workloads that need storage - // resiliency against zone failures. - PremiumZRS DiskStorageAccountTypes = "Premium_ZRS" - // StandardLRS Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - StandardLRS DiskStorageAccountTypes = "Standard_LRS" - // StandardSSDLRS Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // StandardSSDZRS Standard SSD zone redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test that need storage resiliency against zone failures. - StandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" - // UltraSSDLRS 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. - UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{PremiumLRS, PremiumV2LRS, PremiumZRS, StandardLRS, StandardSSDLRS, StandardSSDZRS, UltraSSDLRS} -} - -// EncryptionType enumerates the values for encryption type. -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 an array of possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{EncryptionTypeEncryptionAtRestWithCustomerKey, EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, EncryptionTypeEncryptionAtRestWithPlatformKey} -} - -// ExecutionState enumerates the values for execution state. -type ExecutionState string - -const ( - // ExecutionStateCanceled ... - ExecutionStateCanceled ExecutionState = "Canceled" - // ExecutionStateFailed ... - ExecutionStateFailed ExecutionState = "Failed" - // ExecutionStatePending ... - ExecutionStatePending ExecutionState = "Pending" - // ExecutionStateRunning ... - ExecutionStateRunning ExecutionState = "Running" - // ExecutionStateSucceeded ... - ExecutionStateSucceeded ExecutionState = "Succeeded" - // ExecutionStateTimedOut ... - ExecutionStateTimedOut ExecutionState = "TimedOut" - // ExecutionStateUnknown ... - ExecutionStateUnknown ExecutionState = "Unknown" -) - -// PossibleExecutionStateValues returns an array of possible values for the ExecutionState const type. -func PossibleExecutionStateValues() []ExecutionState { - return []ExecutionState{ExecutionStateCanceled, ExecutionStateFailed, ExecutionStatePending, ExecutionStateRunning, ExecutionStateSucceeded, ExecutionStateTimedOut, ExecutionStateUnknown} -} - -// ExpandTypesForGetCapacityReservationGroups enumerates the values for expand types for get capacity -// reservation groups. -type ExpandTypesForGetCapacityReservationGroups string - -const ( - // VirtualMachineScaleSetVMsref ... - VirtualMachineScaleSetVMsref ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref" - // VirtualMachinesref ... - VirtualMachinesref ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref" -) - -// PossibleExpandTypesForGetCapacityReservationGroupsValues returns an array of possible values for the ExpandTypesForGetCapacityReservationGroups const type. -func PossibleExpandTypesForGetCapacityReservationGroupsValues() []ExpandTypesForGetCapacityReservationGroups { - return []ExpandTypesForGetCapacityReservationGroups{VirtualMachineScaleSetVMsref, VirtualMachinesref} -} - -// ExpandTypesForGetVMScaleSets enumerates the values for expand types for get vm scale sets. -type ExpandTypesForGetVMScaleSets string - -const ( - // UserData ... - UserData ExpandTypesForGetVMScaleSets = "userData" -) - -// PossibleExpandTypesForGetVMScaleSetsValues returns an array of possible values for the ExpandTypesForGetVMScaleSets const type. -func PossibleExpandTypesForGetVMScaleSetsValues() []ExpandTypesForGetVMScaleSets { - return []ExpandTypesForGetVMScaleSets{UserData} -} - -// ExtendedLocationType enumerates the values for extended location type. -type ExtendedLocationType string - -const ( - // EdgeZone ... - EdgeZone ExtendedLocationType = "EdgeZone" -) - -// PossibleExtendedLocationTypeValues returns an array of possible values for the ExtendedLocationType const type. -func PossibleExtendedLocationTypeValues() []ExtendedLocationType { - return []ExtendedLocationType{EdgeZone} -} - -// ExtendedLocationTypes enumerates the values for extended location types. -type ExtendedLocationTypes string - -const ( - // ExtendedLocationTypesEdgeZone ... - ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" -) - -// PossibleExtendedLocationTypesValues returns an array of possible values for the ExtendedLocationTypes const type. -func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{ExtendedLocationTypesEdgeZone} -} - -// GalleryExpandParams enumerates the values for gallery expand params. -type GalleryExpandParams string - -const ( - // SharingProfileGroups ... - SharingProfileGroups GalleryExpandParams = "SharingProfile/Groups" -) - -// PossibleGalleryExpandParamsValues returns an array of possible values for the GalleryExpandParams const type. -func PossibleGalleryExpandParamsValues() []GalleryExpandParams { - return []GalleryExpandParams{SharingProfileGroups} -} - -// GalleryExtendedLocationType enumerates the values for gallery extended location type. -type GalleryExtendedLocationType string - -const ( - // GalleryExtendedLocationTypeEdgeZone ... - GalleryExtendedLocationTypeEdgeZone GalleryExtendedLocationType = "EdgeZone" - // GalleryExtendedLocationTypeUnknown ... - GalleryExtendedLocationTypeUnknown GalleryExtendedLocationType = "Unknown" -) - -// PossibleGalleryExtendedLocationTypeValues returns an array of possible values for the GalleryExtendedLocationType const type. -func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType { - return []GalleryExtendedLocationType{GalleryExtendedLocationTypeEdgeZone, GalleryExtendedLocationTypeUnknown} -} - -// GalleryProvisioningState enumerates the values for gallery provisioning state. -type GalleryProvisioningState string - -const ( - // GalleryProvisioningStateCreating ... - GalleryProvisioningStateCreating GalleryProvisioningState = "Creating" - // GalleryProvisioningStateDeleting ... - GalleryProvisioningStateDeleting GalleryProvisioningState = "Deleting" - // GalleryProvisioningStateFailed ... - GalleryProvisioningStateFailed GalleryProvisioningState = "Failed" - // GalleryProvisioningStateMigrating ... - GalleryProvisioningStateMigrating GalleryProvisioningState = "Migrating" - // GalleryProvisioningStateSucceeded ... - GalleryProvisioningStateSucceeded GalleryProvisioningState = "Succeeded" - // GalleryProvisioningStateUpdating ... - GalleryProvisioningStateUpdating GalleryProvisioningState = "Updating" -) - -// PossibleGalleryProvisioningStateValues returns an array of possible values for the GalleryProvisioningState const type. -func PossibleGalleryProvisioningStateValues() []GalleryProvisioningState { - return []GalleryProvisioningState{GalleryProvisioningStateCreating, GalleryProvisioningStateDeleting, GalleryProvisioningStateFailed, GalleryProvisioningStateMigrating, GalleryProvisioningStateSucceeded, GalleryProvisioningStateUpdating} -} - -// GallerySharingPermissionTypes enumerates the values for gallery sharing permission types. -type GallerySharingPermissionTypes string - -const ( - // Community ... - Community GallerySharingPermissionTypes = "Community" - // Groups ... - Groups GallerySharingPermissionTypes = "Groups" - // Private ... - Private GallerySharingPermissionTypes = "Private" -) - -// PossibleGallerySharingPermissionTypesValues returns an array of possible values for the GallerySharingPermissionTypes const type. -func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes { - return []GallerySharingPermissionTypes{Community, Groups, Private} -} - -// HostCaching enumerates the values for host caching. -type HostCaching string - -const ( - // HostCachingNone ... - HostCachingNone HostCaching = "None" - // HostCachingReadOnly ... - HostCachingReadOnly HostCaching = "ReadOnly" - // HostCachingReadWrite ... - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} -} - -// HyperVGeneration enumerates the values for hyper v generation. -type HyperVGeneration string - -const ( - // V1 ... - V1 HyperVGeneration = "V1" - // V2 ... - V2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{V1, V2} -} - -// HyperVGenerationType enumerates the values for hyper v generation type. -type HyperVGenerationType string - -const ( - // HyperVGenerationTypeV1 ... - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - // HyperVGenerationTypeV2 ... - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} -} - -// HyperVGenerationTypes enumerates the values for hyper v generation types. -type HyperVGenerationTypes string - -const ( - // HyperVGenerationTypesV1 ... - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - // HyperVGenerationTypesV2 ... - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} -} - -// InstanceViewTypes enumerates the values for instance view types. -type InstanceViewTypes string - -const ( - // InstanceViewTypesInstanceView ... - InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" - // InstanceViewTypesUserData ... - InstanceViewTypesUserData InstanceViewTypes = "userData" -) - -// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{InstanceViewTypesInstanceView, InstanceViewTypesUserData} -} - -// IntervalInMins enumerates the values for interval in mins. -type IntervalInMins string - -const ( - // FiveMins ... - FiveMins IntervalInMins = "FiveMins" - // SixtyMins ... - SixtyMins IntervalInMins = "SixtyMins" - // ThirtyMins ... - ThirtyMins IntervalInMins = "ThirtyMins" - // ThreeMins ... - ThreeMins IntervalInMins = "ThreeMins" -) - -// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. -func PossibleIntervalInMinsValues() []IntervalInMins { - return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// IPVersions enumerates the values for ip versions. -type IPVersions string - -const ( - // IPVersionsIPv4 ... - IPVersionsIPv4 IPVersions = "IPv4" - // IPVersionsIPv6 ... - IPVersionsIPv6 IPVersions = "IPv6" -) - -// PossibleIPVersionsValues returns an array of possible values for the IPVersions const type. -func PossibleIPVersionsValues() []IPVersions { - return []IPVersions{IPVersionsIPv4, IPVersionsIPv6} -} - -// LinuxPatchAssessmentMode enumerates the values for linux patch assessment mode. -type LinuxPatchAssessmentMode string - -const ( - // AutomaticByPlatform ... - AutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" - // ImageDefault ... - ImageDefault LinuxPatchAssessmentMode = "ImageDefault" -) - -// PossibleLinuxPatchAssessmentModeValues returns an array of possible values for the LinuxPatchAssessmentMode const type. -func PossibleLinuxPatchAssessmentModeValues() []LinuxPatchAssessmentMode { - return []LinuxPatchAssessmentMode{AutomaticByPlatform, ImageDefault} -} - -// LinuxVMGuestPatchAutomaticByPlatformRebootSetting enumerates the values for linux vm guest patch automatic -// by platform reboot setting. -type LinuxVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - // LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways ... - LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - // LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired ... - LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - // LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever ... - LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - // LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown ... - LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown LinuxVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues returns an array of possible values for the LinuxVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleLinuxVMGuestPatchAutomaticByPlatformRebootSettingValues() []LinuxVMGuestPatchAutomaticByPlatformRebootSetting { - return []LinuxVMGuestPatchAutomaticByPlatformRebootSetting{LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways, LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever, LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown} -} - -// LinuxVMGuestPatchMode enumerates the values for linux vm guest patch mode. -type LinuxVMGuestPatchMode string - -const ( - // LinuxVMGuestPatchModeAutomaticByPlatform ... - LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" - // LinuxVMGuestPatchModeImageDefault ... - LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" -) - -// PossibleLinuxVMGuestPatchModeValues returns an array of possible values for the LinuxVMGuestPatchMode const type. -func PossibleLinuxVMGuestPatchModeValues() []LinuxVMGuestPatchMode { - return []LinuxVMGuestPatchMode{LinuxVMGuestPatchModeAutomaticByPlatform, LinuxVMGuestPatchModeImageDefault} -} - -// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. -type MaintenanceOperationResultCodeTypes string - -const ( - // MaintenanceOperationResultCodeTypesMaintenanceAborted ... - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - // MaintenanceOperationResultCodeTypesNone ... - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - // MaintenanceOperationResultCodeTypesRetryLater ... - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} -} - -// NetworkAccessPolicy enumerates the values for network access policy. -type NetworkAccessPolicy string - -const ( - // AllowAll The disk can be exported or uploaded to from any network. - AllowAll NetworkAccessPolicy = "AllowAll" - // AllowPrivate The disk can be exported or uploaded to using a DiskAccess resource's private endpoints. - AllowPrivate NetworkAccessPolicy = "AllowPrivate" - // DenyAll The disk cannot be exported. - DenyAll NetworkAccessPolicy = "DenyAll" -) - -// PossibleNetworkAccessPolicyValues returns an array of possible values for the NetworkAccessPolicy const type. -func PossibleNetworkAccessPolicyValues() []NetworkAccessPolicy { - return []NetworkAccessPolicy{AllowAll, AllowPrivate, DenyAll} -} - -// NetworkAPIVersion enumerates the values for network api version. -type NetworkAPIVersion string - -const ( - // TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne ... - TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne NetworkAPIVersion = "2020-11-01" -) - -// PossibleNetworkAPIVersionValues returns an array of possible values for the NetworkAPIVersion const type. -func PossibleNetworkAPIVersionValues() []NetworkAPIVersion { - return []NetworkAPIVersion{TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne} -} - -// OperatingSystemStateTypes enumerates the values for operating system state types. -type OperatingSystemStateTypes string - -const ( - // Generalized Generalized image. Needs to be provisioned during deployment time. - Generalized OperatingSystemStateTypes = "Generalized" - // Specialized Specialized image. Contains already provisioned OS Disk. - Specialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{Generalized, Specialized} -} - -// OperatingSystemType enumerates the values for operating system type. -type OperatingSystemType string - -const ( - // Linux ... - Linux OperatingSystemType = "Linux" - // Windows ... - Windows OperatingSystemType = "Windows" -) - -// PossibleOperatingSystemTypeValues returns an array of possible values for the OperatingSystemType const type. -func PossibleOperatingSystemTypeValues() []OperatingSystemType { - return []OperatingSystemType{Linux, Windows} -} - -// OperatingSystemTypes enumerates the values for operating system types. -type OperatingSystemTypes string - -const ( - // OperatingSystemTypesLinux ... - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - // OperatingSystemTypesWindows ... - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{OperatingSystemTypesLinux, OperatingSystemTypesWindows} -} - -// OrchestrationMode enumerates the values for orchestration mode. -type OrchestrationMode string - -const ( - // Flexible ... - Flexible OrchestrationMode = "Flexible" - // Uniform ... - Uniform OrchestrationMode = "Uniform" -) - -// PossibleOrchestrationModeValues returns an array of possible values for the OrchestrationMode const type. -func PossibleOrchestrationModeValues() []OrchestrationMode { - return []OrchestrationMode{Flexible, Uniform} -} - -// OrchestrationServiceNames enumerates the values for orchestration service names. -type OrchestrationServiceNames string - -const ( - // AutomaticRepairs ... - AutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" -) - -// PossibleOrchestrationServiceNamesValues returns an array of possible values for the OrchestrationServiceNames const type. -func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { - return []OrchestrationServiceNames{AutomaticRepairs} -} - -// OrchestrationServiceState enumerates the values for orchestration service state. -type OrchestrationServiceState string - -const ( - // NotRunning ... - NotRunning OrchestrationServiceState = "NotRunning" - // Running ... - Running OrchestrationServiceState = "Running" - // Suspended ... - Suspended OrchestrationServiceState = "Suspended" -) - -// PossibleOrchestrationServiceStateValues returns an array of possible values for the OrchestrationServiceState const type. -func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { - return []OrchestrationServiceState{NotRunning, Running, Suspended} -} - -// OrchestrationServiceStateAction enumerates the values for orchestration service state action. -type OrchestrationServiceStateAction string - -const ( - // Resume ... - Resume OrchestrationServiceStateAction = "Resume" - // Suspend ... - Suspend OrchestrationServiceStateAction = "Suspend" -) - -// PossibleOrchestrationServiceStateActionValues returns an array of possible values for the OrchestrationServiceStateAction const type. -func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { - return []OrchestrationServiceStateAction{Resume, Suspend} -} - -// PassNames enumerates the values for pass names. -type PassNames string - -const ( - // OobeSystem ... - OobeSystem PassNames = "OobeSystem" -) - -// PossiblePassNamesValues returns an array of possible values for the PassNames const type. -func PossiblePassNamesValues() []PassNames { - return []PassNames{OobeSystem} -} - -// PatchAssessmentState enumerates the values for patch assessment state. -type PatchAssessmentState string - -const ( - // PatchAssessmentStateAvailable ... - PatchAssessmentStateAvailable PatchAssessmentState = "Available" - // PatchAssessmentStateUnknown ... - PatchAssessmentStateUnknown PatchAssessmentState = "Unknown" -) - -// PossiblePatchAssessmentStateValues returns an array of possible values for the PatchAssessmentState const type. -func PossiblePatchAssessmentStateValues() []PatchAssessmentState { - return []PatchAssessmentState{PatchAssessmentStateAvailable, PatchAssessmentStateUnknown} -} - -// PatchInstallationState enumerates the values for patch installation state. -type PatchInstallationState string - -const ( - // PatchInstallationStateExcluded ... - PatchInstallationStateExcluded PatchInstallationState = "Excluded" - // PatchInstallationStateFailed ... - PatchInstallationStateFailed PatchInstallationState = "Failed" - // PatchInstallationStateInstalled ... - PatchInstallationStateInstalled PatchInstallationState = "Installed" - // PatchInstallationStateNotSelected ... - PatchInstallationStateNotSelected PatchInstallationState = "NotSelected" - // PatchInstallationStatePending ... - PatchInstallationStatePending PatchInstallationState = "Pending" - // PatchInstallationStateUnknown ... - PatchInstallationStateUnknown PatchInstallationState = "Unknown" -) - -// PossiblePatchInstallationStateValues returns an array of possible values for the PatchInstallationState const type. -func PossiblePatchInstallationStateValues() []PatchInstallationState { - return []PatchInstallationState{PatchInstallationStateExcluded, PatchInstallationStateFailed, PatchInstallationStateInstalled, PatchInstallationStateNotSelected, PatchInstallationStatePending, PatchInstallationStateUnknown} -} - -// PatchOperationStatus enumerates the values for patch operation status. -type PatchOperationStatus string - -const ( - // PatchOperationStatusCompletedWithWarnings ... - PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings" - // PatchOperationStatusFailed ... - PatchOperationStatusFailed PatchOperationStatus = "Failed" - // PatchOperationStatusInProgress ... - PatchOperationStatusInProgress PatchOperationStatus = "InProgress" - // PatchOperationStatusSucceeded ... - PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded" - // PatchOperationStatusUnknown ... - PatchOperationStatusUnknown PatchOperationStatus = "Unknown" -) - -// PossiblePatchOperationStatusValues returns an array of possible values for the PatchOperationStatus const type. -func PossiblePatchOperationStatusValues() []PatchOperationStatus { - return []PatchOperationStatus{PatchOperationStatusCompletedWithWarnings, PatchOperationStatusFailed, PatchOperationStatusInProgress, PatchOperationStatusSucceeded, PatchOperationStatusUnknown} -} - -// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection -// provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - // PrivateEndpointConnectionProvisioningStateCreating ... - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - // PrivateEndpointConnectionProvisioningStateDeleting ... - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - // PrivateEndpointConnectionProvisioningStateFailed ... - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - // PrivateEndpointConnectionProvisioningStateSucceeded ... - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} -} - -// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - // Approved ... - Approved PrivateEndpointServiceConnectionStatus = "Approved" - // Pending ... - Pending PrivateEndpointServiceConnectionStatus = "Pending" - // Rejected ... - Rejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{Approved, Pending, Rejected} -} - -// ProtocolTypes enumerates the values for protocol types. -type ProtocolTypes string - -const ( - // HTTP ... - HTTP ProtocolTypes = "Http" - // HTTPS ... - HTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{HTTP, HTTPS} -} - -// ProximityPlacementGroupType enumerates the values for proximity placement group type. -type ProximityPlacementGroupType string - -const ( - // Standard ... - Standard ProximityPlacementGroupType = "Standard" - // Ultra ... - Ultra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{Standard, Ultra} -} - -// PublicIPAddressSkuName enumerates the values for public ip address sku name. -type PublicIPAddressSkuName string - -const ( - // PublicIPAddressSkuNameBasic ... - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - // PublicIPAddressSkuNameStandard ... - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. -func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { - return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} -} - -// PublicIPAddressSkuTier enumerates the values for public ip address sku tier. -type PublicIPAddressSkuTier string - -const ( - // Global ... - Global PublicIPAddressSkuTier = "Global" - // Regional ... - Regional PublicIPAddressSkuTier = "Regional" -) - -// PossiblePublicIPAddressSkuTierValues returns an array of possible values for the PublicIPAddressSkuTier const type. -func PossiblePublicIPAddressSkuTierValues() []PublicIPAddressSkuTier { - return []PublicIPAddressSkuTier{Global, Regional} -} - -// PublicIPAllocationMethod enumerates the values for public ip allocation method. -type PublicIPAllocationMethod string - -const ( - // Dynamic ... - Dynamic PublicIPAllocationMethod = "Dynamic" - // Static ... - Static PublicIPAllocationMethod = "Static" -) - -// PossiblePublicIPAllocationMethodValues returns an array of possible values for the PublicIPAllocationMethod const type. -func PossiblePublicIPAllocationMethodValues() []PublicIPAllocationMethod { - return []PublicIPAllocationMethod{Dynamic, Static} -} - -// PublicNetworkAccess enumerates the values for public network access. -type PublicNetworkAccess string - -const ( - // Disabled 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. - Disabled PublicNetworkAccess = "Disabled" - // Enabled 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. - Enabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{Disabled, Enabled} -} - -// RepairAction enumerates the values for repair action. -type RepairAction string - -const ( - // Reimage ... - Reimage RepairAction = "Reimage" - // Replace ... - Replace RepairAction = "Replace" - // Restart ... - Restart RepairAction = "Restart" -) - -// PossibleRepairActionValues returns an array of possible values for the RepairAction const type. -func PossibleRepairActionValues() []RepairAction { - return []RepairAction{Reimage, Replace, Restart} -} - -// ReplicationMode enumerates the values for replication mode. -type ReplicationMode string - -const ( - // Full ... - Full ReplicationMode = "Full" - // Shallow ... - Shallow ReplicationMode = "Shallow" -) - -// PossibleReplicationModeValues returns an array of possible values for the ReplicationMode const type. -func PossibleReplicationModeValues() []ReplicationMode { - return []ReplicationMode{Full, Shallow} -} - -// ReplicationState enumerates the values for replication state. -type ReplicationState string - -const ( - // ReplicationStateCompleted ... - ReplicationStateCompleted ReplicationState = "Completed" - // ReplicationStateFailed ... - ReplicationStateFailed ReplicationState = "Failed" - // ReplicationStateReplicating ... - ReplicationStateReplicating ReplicationState = "Replicating" - // ReplicationStateUnknown ... - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} -} - -// ReplicationStatusTypes enumerates the values for replication status types. -type ReplicationStatusTypes string - -const ( - // ReplicationStatusTypesReplicationStatus ... - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" -) - -// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. -type ResourceSkuCapacityScaleType string - -const ( - // ResourceSkuCapacityScaleTypeAutomatic ... - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - // ResourceSkuCapacityScaleTypeManual ... - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - // ResourceSkuCapacityScaleTypeNone ... - ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" -) - -// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. -func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { - return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} -} - -// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. -type ResourceSkuRestrictionsReasonCode string - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - // QuotaID ... - QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" -) - -// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. -func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { - return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} -} - -// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. -type ResourceSkuRestrictionsType string - -const ( - // Location ... - Location ResourceSkuRestrictionsType = "Location" - // Zone ... - Zone ResourceSkuRestrictionsType = "Zone" -) - -// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. -func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { - return []ResourceSkuRestrictionsType{Location, Zone} -} - -// RestorePointCollectionExpandOptions enumerates the values for restore point collection expand options. -type RestorePointCollectionExpandOptions string - -const ( - // RestorePoints ... - RestorePoints RestorePointCollectionExpandOptions = "restorePoints" -) - -// PossibleRestorePointCollectionExpandOptionsValues returns an array of possible values for the RestorePointCollectionExpandOptions const type. -func PossibleRestorePointCollectionExpandOptionsValues() []RestorePointCollectionExpandOptions { - return []RestorePointCollectionExpandOptions{RestorePoints} -} - -// RestorePointExpandOptions enumerates the values for restore point expand options. -type RestorePointExpandOptions string - -const ( - // RestorePointExpandOptionsInstanceView ... - RestorePointExpandOptionsInstanceView RestorePointExpandOptions = "instanceView" -) - -// PossibleRestorePointExpandOptionsValues returns an array of possible values for the RestorePointExpandOptions const type. -func PossibleRestorePointExpandOptionsValues() []RestorePointExpandOptions { - return []RestorePointExpandOptions{RestorePointExpandOptionsInstanceView} -} - -// RollingUpgradeActionType enumerates the values for rolling upgrade action type. -type RollingUpgradeActionType string - -const ( - // Cancel ... - Cancel RollingUpgradeActionType = "Cancel" - // Start ... - Start RollingUpgradeActionType = "Start" -) - -// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return []RollingUpgradeActionType{Cancel, Start} -} - -// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. -type RollingUpgradeStatusCode string - -const ( - // RollingUpgradeStatusCodeCancelled ... - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - // RollingUpgradeStatusCodeCompleted ... - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - // RollingUpgradeStatusCodeFaulted ... - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - // RollingUpgradeStatusCodeRollingForward ... - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} -} - -// SecurityEncryptionTypes enumerates the values for security encryption types. -type SecurityEncryptionTypes string - -const ( - // DiskWithVMGuestState ... - DiskWithVMGuestState SecurityEncryptionTypes = "DiskWithVMGuestState" - // VMGuestStateOnly ... - VMGuestStateOnly SecurityEncryptionTypes = "VMGuestStateOnly" -) - -// PossibleSecurityEncryptionTypesValues returns an array of possible values for the SecurityEncryptionTypes const type. -func PossibleSecurityEncryptionTypesValues() []SecurityEncryptionTypes { - return []SecurityEncryptionTypes{DiskWithVMGuestState, VMGuestStateOnly} -} - -// SecurityTypes enumerates the values for security types. -type SecurityTypes string - -const ( - // SecurityTypesConfidentialVM ... - SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" - // SecurityTypesTrustedLaunch ... - SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" -) - -// PossibleSecurityTypesValues returns an array of possible values for the SecurityTypes const type. -func PossibleSecurityTypesValues() []SecurityTypes { - return []SecurityTypes{SecurityTypesConfidentialVM, SecurityTypesTrustedLaunch} -} - -// SelectPermissions enumerates the values for select permissions. -type SelectPermissions string - -const ( - // Permissions ... - Permissions SelectPermissions = "Permissions" -) - -// PossibleSelectPermissionsValues returns an array of possible values for the SelectPermissions const type. -func PossibleSelectPermissionsValues() []SelectPermissions { - return []SelectPermissions{Permissions} -} - -// SettingNames enumerates the values for setting names. -type SettingNames string - -const ( - // AutoLogon ... - AutoLogon SettingNames = "AutoLogon" - // FirstLogonCommands ... - FirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{AutoLogon, FirstLogonCommands} -} - -// SharedGalleryHostCaching enumerates the values for shared gallery host caching. -type SharedGalleryHostCaching string - -const ( - // SharedGalleryHostCachingNone ... - SharedGalleryHostCachingNone SharedGalleryHostCaching = "None" - // SharedGalleryHostCachingReadOnly ... - SharedGalleryHostCachingReadOnly SharedGalleryHostCaching = "ReadOnly" - // SharedGalleryHostCachingReadWrite ... - SharedGalleryHostCachingReadWrite SharedGalleryHostCaching = "ReadWrite" -) - -// PossibleSharedGalleryHostCachingValues returns an array of possible values for the SharedGalleryHostCaching const type. -func PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching { - return []SharedGalleryHostCaching{SharedGalleryHostCachingNone, SharedGalleryHostCachingReadOnly, SharedGalleryHostCachingReadWrite} -} - -// SharedToValues enumerates the values for shared to values. -type SharedToValues string - -const ( - // Tenant ... - Tenant SharedToValues = "tenant" -) - -// PossibleSharedToValuesValues returns an array of possible values for the SharedToValues const type. -func PossibleSharedToValuesValues() []SharedToValues { - return []SharedToValues{Tenant} -} - -// SharingProfileGroupTypes enumerates the values for sharing profile group types. -type SharingProfileGroupTypes string - -const ( - // AADTenants ... - AADTenants SharingProfileGroupTypes = "AADTenants" - // Subscriptions ... - Subscriptions SharingProfileGroupTypes = "Subscriptions" -) - -// PossibleSharingProfileGroupTypesValues returns an array of possible values for the SharingProfileGroupTypes const type. -func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes { - return []SharingProfileGroupTypes{AADTenants, Subscriptions} -} - -// SharingState enumerates the values for sharing state. -type SharingState string - -const ( - // SharingStateFailed ... - SharingStateFailed SharingState = "Failed" - // SharingStateInProgress ... - SharingStateInProgress SharingState = "InProgress" - // SharingStateSucceeded ... - SharingStateSucceeded SharingState = "Succeeded" - // SharingStateUnknown ... - SharingStateUnknown SharingState = "Unknown" -) - -// PossibleSharingStateValues returns an array of possible values for the SharingState const type. -func PossibleSharingStateValues() []SharingState { - return []SharingState{SharingStateFailed, SharingStateInProgress, SharingStateSucceeded, SharingStateUnknown} -} - -// SharingUpdateOperationTypes enumerates the values for sharing update operation types. -type SharingUpdateOperationTypes string - -const ( - // Add ... - Add SharingUpdateOperationTypes = "Add" - // EnableCommunity ... - EnableCommunity SharingUpdateOperationTypes = "EnableCommunity" - // Remove ... - Remove SharingUpdateOperationTypes = "Remove" - // Reset ... - Reset SharingUpdateOperationTypes = "Reset" -) - -// PossibleSharingUpdateOperationTypesValues returns an array of possible values for the SharingUpdateOperationTypes const type. -func PossibleSharingUpdateOperationTypesValues() []SharingUpdateOperationTypes { - return []SharingUpdateOperationTypes{Add, EnableCommunity, Remove, Reset} -} - -// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. -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 an array of possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} -} - -// StatusLevelTypes enumerates the values for status level types. -type StatusLevelTypes string - -const ( - // Error ... - Error StatusLevelTypes = "Error" - // Info ... - Info StatusLevelTypes = "Info" - // Warning ... - Warning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{Error, Info, Warning} -} - -// StorageAccountType enumerates the values for storage account type. -type StorageAccountType string - -const ( - // StorageAccountTypePremiumLRS ... - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - // StorageAccountTypeStandardLRS ... - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - // StorageAccountTypeStandardZRS ... - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{StorageAccountTypePremiumLRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} -} - -// StorageAccountTypes enumerates the values for storage account types. -type StorageAccountTypes string - -const ( - // StorageAccountTypesPremiumLRS ... - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - // StorageAccountTypesPremiumV2LRS ... - StorageAccountTypesPremiumV2LRS StorageAccountTypes = "PremiumV2_LRS" - // StorageAccountTypesPremiumZRS ... - StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" - // StorageAccountTypesStandardLRS ... - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - // StorageAccountTypesStandardSSDLRS ... - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - // StorageAccountTypesStandardSSDZRS ... - StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" - // StorageAccountTypesUltraSSDLRS ... - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesPremiumV2LRS, StorageAccountTypesPremiumZRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesStandardSSDZRS, StorageAccountTypesUltraSSDLRS} -} - -// UpgradeMode enumerates the values for upgrade mode. -type UpgradeMode string - -const ( - // UpgradeModeAutomatic ... - UpgradeModeAutomatic UpgradeMode = "Automatic" - // UpgradeModeManual ... - UpgradeModeManual UpgradeMode = "Manual" - // UpgradeModeRolling ... - UpgradeModeRolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{UpgradeModeAutomatic, UpgradeModeManual, UpgradeModeRolling} -} - -// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. -type UpgradeOperationInvoker string - -const ( - // UpgradeOperationInvokerPlatform ... - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - // UpgradeOperationInvokerUnknown ... - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - // UpgradeOperationInvokerUser ... - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} -} - -// UpgradeState enumerates the values for upgrade state. -type UpgradeState string - -const ( - // UpgradeStateCancelled ... - UpgradeStateCancelled UpgradeState = "Cancelled" - // UpgradeStateCompleted ... - UpgradeStateCompleted UpgradeState = "Completed" - // UpgradeStateFaulted ... - UpgradeStateFaulted UpgradeState = "Faulted" - // UpgradeStateRollingForward ... - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} -} - -// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. -type VirtualMachineEvictionPolicyTypes string - -const ( - // VirtualMachineEvictionPolicyTypesDeallocate ... - VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - // VirtualMachineEvictionPolicyTypesDelete ... - VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{VirtualMachineEvictionPolicyTypesDeallocate, VirtualMachineEvictionPolicyTypesDelete} -} - -// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. -type VirtualMachinePriorityTypes string - -const ( - // Low ... - Low VirtualMachinePriorityTypes = "Low" - // Regular ... - Regular VirtualMachinePriorityTypes = "Regular" - // Spot ... - Spot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{Low, Regular, Spot} -} - -// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. -type VirtualMachineScaleSetScaleInRules string - -const ( - // Default ... - Default VirtualMachineScaleSetScaleInRules = "Default" - // NewestVM ... - NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - // OldestVM ... - OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} -} - -// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. -type VirtualMachineScaleSetSkuScaleType string - -const ( - // VirtualMachineScaleSetSkuScaleTypeAutomatic ... - VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" - // VirtualMachineScaleSetSkuScaleTypeNone ... - VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" -) - -// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. -func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { - return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} -} - -// VirtualMachineSizeTypes enumerates the values for virtual machine size types. -type VirtualMachineSizeTypes string - -const ( - // BasicA0 ... - BasicA0 VirtualMachineSizeTypes = "Basic_A0" - // BasicA1 ... - BasicA1 VirtualMachineSizeTypes = "Basic_A1" - // BasicA2 ... - BasicA2 VirtualMachineSizeTypes = "Basic_A2" - // BasicA3 ... - BasicA3 VirtualMachineSizeTypes = "Basic_A3" - // BasicA4 ... - BasicA4 VirtualMachineSizeTypes = "Basic_A4" - // StandardA0 ... - StandardA0 VirtualMachineSizeTypes = "Standard_A0" - // StandardA1 ... - StandardA1 VirtualMachineSizeTypes = "Standard_A1" - // StandardA10 ... - StandardA10 VirtualMachineSizeTypes = "Standard_A10" - // StandardA11 ... - StandardA11 VirtualMachineSizeTypes = "Standard_A11" - // StandardA1V2 ... - StandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - // StandardA2 ... - StandardA2 VirtualMachineSizeTypes = "Standard_A2" - // StandardA2mV2 ... - StandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - // StandardA2V2 ... - StandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - // StandardA3 ... - StandardA3 VirtualMachineSizeTypes = "Standard_A3" - // StandardA4 ... - StandardA4 VirtualMachineSizeTypes = "Standard_A4" - // StandardA4mV2 ... - StandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - // StandardA4V2 ... - StandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - // StandardA5 ... - StandardA5 VirtualMachineSizeTypes = "Standard_A5" - // StandardA6 ... - StandardA6 VirtualMachineSizeTypes = "Standard_A6" - // StandardA7 ... - StandardA7 VirtualMachineSizeTypes = "Standard_A7" - // StandardA8 ... - StandardA8 VirtualMachineSizeTypes = "Standard_A8" - // StandardA8mV2 ... - StandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - // StandardA8V2 ... - StandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - // StandardA9 ... - StandardA9 VirtualMachineSizeTypes = "Standard_A9" - // StandardB1ms ... - StandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" - // StandardB1s ... - StandardB1s VirtualMachineSizeTypes = "Standard_B1s" - // StandardB2ms ... - StandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" - // StandardB2s ... - StandardB2s VirtualMachineSizeTypes = "Standard_B2s" - // StandardB4ms ... - StandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" - // StandardB8ms ... - StandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" - // StandardD1 ... - StandardD1 VirtualMachineSizeTypes = "Standard_D1" - // StandardD11 ... - StandardD11 VirtualMachineSizeTypes = "Standard_D11" - // StandardD11V2 ... - StandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - // StandardD12 ... - StandardD12 VirtualMachineSizeTypes = "Standard_D12" - // StandardD12V2 ... - StandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - // StandardD13 ... - StandardD13 VirtualMachineSizeTypes = "Standard_D13" - // StandardD13V2 ... - StandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - // StandardD14 ... - StandardD14 VirtualMachineSizeTypes = "Standard_D14" - // StandardD14V2 ... - StandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - // StandardD15V2 ... - StandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - // StandardD16sV3 ... - StandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - // StandardD16V3 ... - StandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - // StandardD1V2 ... - StandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - // StandardD2 ... - StandardD2 VirtualMachineSizeTypes = "Standard_D2" - // StandardD2sV3 ... - StandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - // StandardD2V2 ... - StandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - // StandardD2V3 ... - StandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - // StandardD3 ... - StandardD3 VirtualMachineSizeTypes = "Standard_D3" - // StandardD32sV3 ... - StandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - // StandardD32V3 ... - StandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - // StandardD3V2 ... - StandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - // StandardD4 ... - StandardD4 VirtualMachineSizeTypes = "Standard_D4" - // StandardD4sV3 ... - StandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - // StandardD4V2 ... - StandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - // StandardD4V3 ... - StandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - // StandardD5V2 ... - StandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - // StandardD64sV3 ... - StandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - // StandardD64V3 ... - StandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - // StandardD8sV3 ... - StandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - // StandardD8V3 ... - StandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - // StandardDS1 ... - StandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - // StandardDS11 ... - StandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - // StandardDS11V2 ... - StandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - // StandardDS12 ... - StandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - // StandardDS12V2 ... - StandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - // StandardDS13 ... - StandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - // StandardDS132V2 ... - StandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - // StandardDS134V2 ... - StandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - // StandardDS13V2 ... - StandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - // StandardDS14 ... - StandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - // StandardDS144V2 ... - StandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - // StandardDS148V2 ... - StandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - // StandardDS14V2 ... - StandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - // StandardDS15V2 ... - StandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - // StandardDS1V2 ... - StandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - // StandardDS2 ... - StandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - // StandardDS2V2 ... - StandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - // StandardDS3 ... - StandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - // StandardDS3V2 ... - StandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - // StandardDS4 ... - StandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - // StandardDS4V2 ... - StandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - // StandardDS5V2 ... - StandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - // StandardE16sV3 ... - StandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - // StandardE16V3 ... - StandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - // StandardE2sV3 ... - StandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - // StandardE2V3 ... - StandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - // StandardE3216V3 ... - StandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - // StandardE328sV3 ... - StandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - // StandardE32sV3 ... - StandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - // StandardE32V3 ... - StandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - // StandardE4sV3 ... - StandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - // StandardE4V3 ... - StandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - // StandardE6416sV3 ... - StandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - // StandardE6432sV3 ... - StandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - // StandardE64sV3 ... - StandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - // StandardE64V3 ... - StandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - // StandardE8sV3 ... - StandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - // StandardE8V3 ... - StandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - // StandardF1 ... - StandardF1 VirtualMachineSizeTypes = "Standard_F1" - // StandardF16 ... - StandardF16 VirtualMachineSizeTypes = "Standard_F16" - // StandardF16s ... - StandardF16s VirtualMachineSizeTypes = "Standard_F16s" - // StandardF16sV2 ... - StandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - // StandardF1s ... - StandardF1s VirtualMachineSizeTypes = "Standard_F1s" - // StandardF2 ... - StandardF2 VirtualMachineSizeTypes = "Standard_F2" - // StandardF2s ... - StandardF2s VirtualMachineSizeTypes = "Standard_F2s" - // StandardF2sV2 ... - StandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - // StandardF32sV2 ... - StandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - // StandardF4 ... - StandardF4 VirtualMachineSizeTypes = "Standard_F4" - // StandardF4s ... - StandardF4s VirtualMachineSizeTypes = "Standard_F4s" - // StandardF4sV2 ... - StandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - // StandardF64sV2 ... - StandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - // StandardF72sV2 ... - StandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - // StandardF8 ... - StandardF8 VirtualMachineSizeTypes = "Standard_F8" - // StandardF8s ... - StandardF8s VirtualMachineSizeTypes = "Standard_F8s" - // StandardF8sV2 ... - StandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - // StandardG1 ... - StandardG1 VirtualMachineSizeTypes = "Standard_G1" - // StandardG2 ... - StandardG2 VirtualMachineSizeTypes = "Standard_G2" - // StandardG3 ... - StandardG3 VirtualMachineSizeTypes = "Standard_G3" - // StandardG4 ... - StandardG4 VirtualMachineSizeTypes = "Standard_G4" - // StandardG5 ... - StandardG5 VirtualMachineSizeTypes = "Standard_G5" - // StandardGS1 ... - StandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - // StandardGS2 ... - StandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - // StandardGS3 ... - StandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - // StandardGS4 ... - StandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - // StandardGS44 ... - StandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - // StandardGS48 ... - StandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - // StandardGS5 ... - StandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - // StandardGS516 ... - StandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - // StandardGS58 ... - StandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - // StandardH16 ... - StandardH16 VirtualMachineSizeTypes = "Standard_H16" - // StandardH16m ... - StandardH16m VirtualMachineSizeTypes = "Standard_H16m" - // StandardH16mr ... - StandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" - // StandardH16r ... - StandardH16r VirtualMachineSizeTypes = "Standard_H16r" - // StandardH8 ... - StandardH8 VirtualMachineSizeTypes = "Standard_H8" - // StandardH8m ... - StandardH8m VirtualMachineSizeTypes = "Standard_H8m" - // StandardL16s ... - StandardL16s VirtualMachineSizeTypes = "Standard_L16s" - // StandardL32s ... - StandardL32s VirtualMachineSizeTypes = "Standard_L32s" - // StandardL4s ... - StandardL4s VirtualMachineSizeTypes = "Standard_L4s" - // StandardL8s ... - StandardL8s VirtualMachineSizeTypes = "Standard_L8s" - // StandardM12832ms ... - StandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" - // StandardM12864ms ... - StandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" - // StandardM128ms ... - StandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" - // StandardM128s ... - StandardM128s VirtualMachineSizeTypes = "Standard_M128s" - // StandardM6416ms ... - StandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" - // StandardM6432ms ... - StandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" - // StandardM64ms ... - StandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" - // StandardM64s ... - StandardM64s VirtualMachineSizeTypes = "Standard_M64s" - // StandardNC12 ... - StandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - // StandardNC12sV2 ... - StandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - // StandardNC12sV3 ... - StandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - // StandardNC24 ... - StandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - // StandardNC24r ... - StandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" - // StandardNC24rsV2 ... - StandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - // StandardNC24rsV3 ... - StandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - // StandardNC24sV2 ... - StandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - // StandardNC24sV3 ... - StandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - // StandardNC6 ... - StandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - // StandardNC6sV2 ... - StandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - // StandardNC6sV3 ... - StandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - // StandardND12s ... - StandardND12s VirtualMachineSizeTypes = "Standard_ND12s" - // StandardND24rs ... - StandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" - // StandardND24s ... - StandardND24s VirtualMachineSizeTypes = "Standard_ND24s" - // StandardND6s ... - StandardND6s VirtualMachineSizeTypes = "Standard_ND6s" - // StandardNV12 ... - StandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - // StandardNV24 ... - StandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - // StandardNV6 ... - StandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return []VirtualMachineSizeTypes{BasicA0, BasicA1, BasicA2, BasicA3, BasicA4, StandardA0, StandardA1, StandardA10, StandardA11, StandardA1V2, StandardA2, StandardA2mV2, StandardA2V2, StandardA3, StandardA4, StandardA4mV2, StandardA4V2, StandardA5, StandardA6, StandardA7, StandardA8, StandardA8mV2, StandardA8V2, StandardA9, StandardB1ms, StandardB1s, StandardB2ms, StandardB2s, StandardB4ms, StandardB8ms, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD15V2, StandardD16sV3, StandardD16V3, StandardD1V2, StandardD2, StandardD2sV3, StandardD2V2, StandardD2V3, StandardD3, StandardD32sV3, StandardD32V3, StandardD3V2, StandardD4, StandardD4sV3, StandardD4V2, StandardD4V3, StandardD5V2, StandardD64sV3, StandardD64V3, StandardD8sV3, StandardD8V3, StandardDS1, StandardDS11, StandardDS11V2, StandardDS12, StandardDS12V2, StandardDS13, StandardDS132V2, StandardDS134V2, StandardDS13V2, StandardDS14, StandardDS144V2, StandardDS148V2, StandardDS14V2, StandardDS15V2, StandardDS1V2, StandardDS2, StandardDS2V2, StandardDS3, StandardDS3V2, StandardDS4, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE16V3, StandardE2sV3, StandardE2V3, StandardE3216V3, StandardE328sV3, StandardE32sV3, StandardE32V3, StandardE4sV3, StandardE4V3, StandardE6416sV3, StandardE6432sV3, StandardE64sV3, StandardE64V3, StandardE8sV3, StandardE8V3, StandardF1, StandardF16, StandardF16s, StandardF16sV2, StandardF1s, StandardF2, StandardF2s, StandardF2sV2, StandardF32sV2, StandardF4, StandardF4s, StandardF4sV2, StandardF64sV2, StandardF72sV2, StandardF8, StandardF8s, StandardF8sV2, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS44, StandardGS48, StandardGS5, StandardGS516, StandardGS58, StandardH16, StandardH16m, StandardH16mr, StandardH16r, StandardH8, StandardH8m, StandardL16s, StandardL32s, StandardL4s, StandardL8s, StandardM12832ms, StandardM12864ms, StandardM128ms, StandardM128s, StandardM6416ms, StandardM6432ms, StandardM64ms, StandardM64s, StandardNC12, StandardNC12sV2, StandardNC12sV3, StandardNC24, StandardNC24r, StandardNC24rsV2, StandardNC24rsV3, StandardNC24sV2, StandardNC24sV3, StandardNC6, StandardNC6sV2, StandardNC6sV3, StandardND12s, StandardND24rs, StandardND24s, StandardND6s, StandardNV12, StandardNV24, StandardNV6} -} - -// VMDiskTypes enumerates the values for vm disk types. -type VMDiskTypes string - -const ( - // VMDiskTypesNone ... - VMDiskTypesNone VMDiskTypes = "None" - // VMDiskTypesUnmanaged ... - VMDiskTypesUnmanaged VMDiskTypes = "Unmanaged" -) - -// PossibleVMDiskTypesValues returns an array of possible values for the VMDiskTypes const type. -func PossibleVMDiskTypesValues() []VMDiskTypes { - return []VMDiskTypes{VMDiskTypesNone, VMDiskTypesUnmanaged} -} - -// VMGuestPatchClassificationLinux enumerates the values for vm guest patch classification linux. -type VMGuestPatchClassificationLinux string - -const ( - // Critical ... - Critical VMGuestPatchClassificationLinux = "Critical" - // Other ... - Other VMGuestPatchClassificationLinux = "Other" - // Security ... - Security VMGuestPatchClassificationLinux = "Security" -) - -// PossibleVMGuestPatchClassificationLinuxValues returns an array of possible values for the VMGuestPatchClassificationLinux const type. -func PossibleVMGuestPatchClassificationLinuxValues() []VMGuestPatchClassificationLinux { - return []VMGuestPatchClassificationLinux{Critical, Other, Security} -} - -// VMGuestPatchClassificationWindows enumerates the values for vm guest patch classification windows. -type VMGuestPatchClassificationWindows string - -const ( - // VMGuestPatchClassificationWindowsCritical ... - VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical" - // VMGuestPatchClassificationWindowsDefinition ... - VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition" - // VMGuestPatchClassificationWindowsFeaturePack ... - VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack" - // VMGuestPatchClassificationWindowsSecurity ... - VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security" - // VMGuestPatchClassificationWindowsServicePack ... - VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack" - // VMGuestPatchClassificationWindowsTools ... - VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools" - // VMGuestPatchClassificationWindowsUpdateRollUp ... - VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp" - // VMGuestPatchClassificationWindowsUpdates ... - VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates" -) - -// PossibleVMGuestPatchClassificationWindowsValues returns an array of possible values for the VMGuestPatchClassificationWindows const type. -func PossibleVMGuestPatchClassificationWindowsValues() []VMGuestPatchClassificationWindows { - return []VMGuestPatchClassificationWindows{VMGuestPatchClassificationWindowsCritical, VMGuestPatchClassificationWindowsDefinition, VMGuestPatchClassificationWindowsFeaturePack, VMGuestPatchClassificationWindowsSecurity, VMGuestPatchClassificationWindowsServicePack, VMGuestPatchClassificationWindowsTools, VMGuestPatchClassificationWindowsUpdateRollUp, VMGuestPatchClassificationWindowsUpdates} -} - -// VMGuestPatchRebootBehavior enumerates the values for vm guest patch reboot behavior. -type VMGuestPatchRebootBehavior string - -const ( - // VMGuestPatchRebootBehaviorAlwaysRequiresReboot ... - VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot" - // VMGuestPatchRebootBehaviorCanRequestReboot ... - VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot" - // VMGuestPatchRebootBehaviorNeverReboots ... - VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots" - // VMGuestPatchRebootBehaviorUnknown ... - VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown" -) - -// PossibleVMGuestPatchRebootBehaviorValues returns an array of possible values for the VMGuestPatchRebootBehavior const type. -func PossibleVMGuestPatchRebootBehaviorValues() []VMGuestPatchRebootBehavior { - return []VMGuestPatchRebootBehavior{VMGuestPatchRebootBehaviorAlwaysRequiresReboot, VMGuestPatchRebootBehaviorCanRequestReboot, VMGuestPatchRebootBehaviorNeverReboots, VMGuestPatchRebootBehaviorUnknown} -} - -// VMGuestPatchRebootSetting enumerates the values for vm guest patch reboot setting. -type VMGuestPatchRebootSetting string - -const ( - // Always ... - Always VMGuestPatchRebootSetting = "Always" - // IfRequired ... - IfRequired VMGuestPatchRebootSetting = "IfRequired" - // Never ... - Never VMGuestPatchRebootSetting = "Never" -) - -// PossibleVMGuestPatchRebootSettingValues returns an array of possible values for the VMGuestPatchRebootSetting const type. -func PossibleVMGuestPatchRebootSettingValues() []VMGuestPatchRebootSetting { - return []VMGuestPatchRebootSetting{Always, IfRequired, Never} -} - -// VMGuestPatchRebootStatus enumerates the values for vm guest patch reboot status. -type VMGuestPatchRebootStatus string - -const ( - // VMGuestPatchRebootStatusCompleted ... - VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed" - // VMGuestPatchRebootStatusFailed ... - VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed" - // VMGuestPatchRebootStatusNotNeeded ... - VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded" - // VMGuestPatchRebootStatusRequired ... - VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required" - // VMGuestPatchRebootStatusStarted ... - VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started" - // VMGuestPatchRebootStatusUnknown ... - VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown" -) - -// PossibleVMGuestPatchRebootStatusValues returns an array of possible values for the VMGuestPatchRebootStatus const type. -func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus { - return []VMGuestPatchRebootStatus{VMGuestPatchRebootStatusCompleted, VMGuestPatchRebootStatusFailed, VMGuestPatchRebootStatusNotNeeded, VMGuestPatchRebootStatusRequired, VMGuestPatchRebootStatusStarted, VMGuestPatchRebootStatusUnknown} -} - -// WindowsPatchAssessmentMode enumerates the values for windows patch assessment mode. -type WindowsPatchAssessmentMode string - -const ( - // WindowsPatchAssessmentModeAutomaticByPlatform ... - WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" - // WindowsPatchAssessmentModeImageDefault ... - WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" -) - -// PossibleWindowsPatchAssessmentModeValues returns an array of possible values for the WindowsPatchAssessmentMode const type. -func PossibleWindowsPatchAssessmentModeValues() []WindowsPatchAssessmentMode { - return []WindowsPatchAssessmentMode{WindowsPatchAssessmentModeAutomaticByPlatform, WindowsPatchAssessmentModeImageDefault} -} - -// WindowsVMGuestPatchAutomaticByPlatformRebootSetting enumerates the values for windows vm guest patch -// automatic by platform reboot setting. -type WindowsVMGuestPatchAutomaticByPlatformRebootSetting string - -const ( - // WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways ... - WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Always" - // WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired ... - WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "IfRequired" - // WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever ... - WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Never" - // WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown ... - WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown WindowsVMGuestPatchAutomaticByPlatformRebootSetting = "Unknown" -) - -// PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues returns an array of possible values for the WindowsVMGuestPatchAutomaticByPlatformRebootSetting const type. -func PossibleWindowsVMGuestPatchAutomaticByPlatformRebootSettingValues() []WindowsVMGuestPatchAutomaticByPlatformRebootSetting { - return []WindowsVMGuestPatchAutomaticByPlatformRebootSetting{WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways, WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired, WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever, WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown} -} - -// WindowsVMGuestPatchMode enumerates the values for windows vm guest patch mode. -type WindowsVMGuestPatchMode string - -const ( - // WindowsVMGuestPatchModeAutomaticByOS ... - WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" - // WindowsVMGuestPatchModeAutomaticByPlatform ... - WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" - // WindowsVMGuestPatchModeManual ... - WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" -) - -// PossibleWindowsVMGuestPatchModeValues returns an array of possible values for the WindowsVMGuestPatchMode const type. -func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode { - return []WindowsVMGuestPatchMode{WindowsVMGuestPatchModeAutomaticByOS, WindowsVMGuestPatchModeAutomaticByPlatform, WindowsVMGuestPatchModeManual} -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go deleted file mode 100644 index 334db1f6cfb9..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go +++ /dev/null @@ -1,588 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleriesClient is the compute Client -type GalleriesClient struct { - BaseClient -} - -// NewGalleriesClient creates an instance of the GalleriesClient client. -func NewGalleriesClient(subscriptionID string) GalleriesClient { - return NewGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleriesClientWithBaseURI creates an instance of the GalleriesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGalleriesClientWithBaseURI(baseURI string, subscriptionID string) GalleriesClient { - return GalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a Shared Image Gallery. -// Parameters: -// 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. -func (client GalleriesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (result GalleriesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, gallery) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleriesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), - autorest.WithJSON(gallery), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) CreateOrUpdateSender(req *http.Request) (future GalleriesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleriesClient) CreateOrUpdateResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery to be deleted. -func (client GalleriesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleriesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleriesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) DeleteSender(req *http.Request) (future GalleriesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. -// selectParameter - the select expression to apply on the operation. -// expand - the expand query option to apply on the operation. -func (client GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, selectParameter SelectPermissions, expand GalleryExpandParams) (result Gallery, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, selectParameter, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleriesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, selectParameter SelectPermissions, expand GalleryExpandParams) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(selectParameter)) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleriesClient) GetResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list galleries under a subscription. -func (client GalleriesClient) List(ctx context.Context) (result GalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") - defer func() { - sc := -1 - if result.gl.Response.Response != nil { - sc = result.gl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.gl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure sending request") - return - } - - result.gl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure responding to request") - return - } - if result.gl.hasNextLink() && result.gl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client GalleriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client GalleriesClient) ListResponder(resp *http.Response) (result GalleryList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client GalleriesClient) listNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { - req, err := lastResults.galleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleriesClient) ListComplete(ctx context.Context) (result GalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup list galleries under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client GalleriesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result GalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.gl.Response.Response != nil { - sc = result.gl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.gl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.gl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.gl.hasNextLink() && result.gl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client GalleriesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client GalleriesClient) ListByResourceGroupResponder(resp *http.Response) (result GalleryList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client GalleriesClient) listByResourceGroupNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { - req, err := lastResults.galleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleriesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result GalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update a Shared Image Gallery. -// Parameters: -// 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. -func (client GalleriesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (result GalleriesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, gallery) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleriesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), - autorest.WithJSON(gallery), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) UpdateSender(req *http.Request) (future GalleriesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleriesClient) UpdateResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go deleted file mode 100644 index d1599af68494..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go +++ /dev/null @@ -1,485 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryApplicationsClient is the compute Client -type GalleryApplicationsClient struct { - BaseClient -} - -// NewGalleryApplicationsClient creates an instance of the GalleryApplicationsClient client. -func NewGalleryApplicationsClient(subscriptionID string) GalleryApplicationsClient { - return NewGalleryApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryApplicationsClientWithBaseURI creates an instance of the GalleryApplicationsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewGalleryApplicationsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationsClient { - return GalleryApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Application Definition. -// Parameters: -// 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. -func (client GalleryApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (result GalleryApplicationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithJSON(galleryApplication), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Application. -// Parameters: -// 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. -func (client GalleryApplicationsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) DeleteSender(req *http.Request) (future GalleryApplicationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Application Definition. -// Parameters: -// 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. -func (client GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplication, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) GetResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGallery list gallery Application Definitions in a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery from which Application Definitions are to be -// listed. -func (client GalleryApplicationsClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") - defer func() { - sc := -1 - if result.gal.Response.Response != nil { - sc = result.gal.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryNextResults - req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGallerySender(req) - if err != nil { - result.gal.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure sending request") - return - } - - result.gal, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure responding to request") - return - } - if result.gal.hasNextLink() && result.gal.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryPreparer prepares the ListByGallery request. -func (client GalleryApplicationsClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGallerySender sends the ListByGallery request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) ListByGallerySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryResponder handles the response to the ListByGallery request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) ListByGalleryResponder(resp *http.Response) (result GalleryApplicationList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryNextResults retrieves the next set of results, if any. -func (client GalleryApplicationsClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryApplicationList) (result GalleryApplicationList, err error) { - req, err := lastResults.galleryApplicationListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGallerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryApplicationsClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) - return -} - -// Update update a gallery Application Definition. -// Parameters: -// 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. -func (client GalleryApplicationsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (result GalleryApplicationsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithJSON(galleryApplication), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) UpdateSender(req *http.Request) (future GalleryApplicationsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) UpdateResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go deleted file mode 100644 index 364a3c02d825..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go +++ /dev/null @@ -1,516 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryApplicationVersionsClient is the compute Client -type GalleryApplicationVersionsClient struct { - BaseClient -} - -// NewGalleryApplicationVersionsClient creates an instance of the GalleryApplicationVersionsClient client. -func NewGalleryApplicationVersionsClient(subscriptionID string) GalleryApplicationVersionsClient { - return NewGalleryApplicationVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryApplicationVersionsClientWithBaseURI creates an instance of the GalleryApplicationVersionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewGalleryApplicationVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationVersionsClient { - return GalleryApplicationVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Application Version. -// Parameters: -// 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. -func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (result GalleryApplicationVersionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryApplicationVersion, - Constraints: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.MediaLink", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions.Install", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions.Remove", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.GalleryApplicationVersionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryApplicationVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithJSON(galleryApplicationVersion), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationVersionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Application Version. -// Parameters: -// 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. -func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (result GalleryApplicationVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryApplicationVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) DeleteSender(req *http.Request) (future GalleryApplicationVersionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Application Version. -// Parameters: -// 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. -// expand - the expand expression to apply on the operation. -func (client GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (result GalleryApplicationVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryApplicationVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGalleryApplication list gallery Application Versions in a gallery Application Definition. -// Parameters: -// 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. -func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") - defer func() { - sc := -1 - if result.gavl.Response.Response != nil { - sc = result.gavl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryApplicationNextResults - req, err := client.ListByGalleryApplicationPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGalleryApplicationSender(req) - if err != nil { - result.gavl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure sending request") - return - } - - result.gavl, err = client.ListByGalleryApplicationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request") - return - } - if result.gavl.hasNextLink() && result.gavl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryApplicationPreparer prepares the ListByGalleryApplication request. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGalleryApplicationSender sends the ListByGalleryApplication request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryApplicationResponder handles the response to the ListByGalleryApplication request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryApplicationNextResults retrieves the next set of results, if any. -func (client GalleryApplicationVersionsClient) listByGalleryApplicationNextResults(ctx context.Context, lastResults GalleryApplicationVersionList) (result GalleryApplicationVersionList, err error) { - req, err := lastResults.galleryApplicationVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGalleryApplicationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryApplicationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryApplicationComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGalleryApplication(ctx, resourceGroupName, galleryName, galleryApplicationName) - return -} - -// Update update a gallery Application Version. -// Parameters: -// 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. -func (client GalleryApplicationVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (result GalleryApplicationVersionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryApplicationVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithJSON(galleryApplicationVersion), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) UpdateSender(req *http.Request) (future GalleryApplicationVersionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) UpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go deleted file mode 100644 index 61283069ba75..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go +++ /dev/null @@ -1,492 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryImagesClient is the compute Client -type GalleryImagesClient struct { - BaseClient -} - -// NewGalleryImagesClient creates an instance of the GalleryImagesClient client. -func NewGalleryImagesClient(subscriptionID string) GalleryImagesClient { - return NewGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryImagesClientWithBaseURI creates an instance of the GalleryImagesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) GalleryImagesClient { - return GalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery image definition. -// Parameters: -// 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. -func (client GalleryImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (result GalleryImagesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryImage, - Constraints: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryImage.GalleryImageProperties.Identifier.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryImage.GalleryImageProperties.Identifier.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.GalleryImagesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithJSON(galleryImage), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (future GalleryImagesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery image. -// Parameters: -// 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. -func (client GalleryImagesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImagesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) DeleteSender(req *http.Request) (future GalleryImagesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery image definition. -// Parameters: -// 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. -func (client GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) GetResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGallery list gallery image definitions in a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery from which Image Definitions are to be listed. -func (client GalleryImagesClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") - defer func() { - sc := -1 - if result.gil.Response.Response != nil { - sc = result.gil.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryNextResults - req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGallerySender(req) - if err != nil { - result.gil.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure sending request") - return - } - - result.gil, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure responding to request") - return - } - if result.gil.hasNextLink() && result.gil.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryPreparer prepares the ListByGallery request. -func (client GalleryImagesClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGallerySender sends the ListByGallery request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) ListByGallerySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryResponder handles the response to the ListByGallery request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) ListByGalleryResponder(resp *http.Response) (result GalleryImageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryNextResults retrieves the next set of results, if any. -func (client GalleryImagesClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryImageList) (result GalleryImageList, err error) { - req, err := lastResults.galleryImageListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGallerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImagesClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) - return -} - -// Update update a gallery image definition. -// Parameters: -// 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. -func (client GalleryImagesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (result GalleryImagesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithJSON(galleryImage), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) UpdateSender(req *http.Request) (future GalleryImagesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) UpdateResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go deleted file mode 100644 index e06108847b0c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go +++ /dev/null @@ -1,503 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryImageVersionsClient is the compute Client -type GalleryImageVersionsClient struct { - BaseClient -} - -// NewGalleryImageVersionsClient creates an instance of the GalleryImageVersionsClient client. -func NewGalleryImageVersionsClient(subscriptionID string) GalleryImageVersionsClient { - return NewGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryImageVersionsClientWithBaseURI creates an instance of the GalleryImageVersionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryImageVersionsClient { - return GalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery image version. -// Parameters: -// 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. -func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (result GalleryImageVersionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryImageVersion, - Constraints: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.GalleryImageVersionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryImageVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithJSON(galleryImageVersion), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryImageVersionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery image version. -// Parameters: -// 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. -func (client GalleryImageVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (result GalleryImageVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryImageVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) DeleteSender(req *http.Request) (future GalleryImageVersionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery image version. -// Parameters: -// 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. -// expand - the expand expression to apply on the operation. -func (client GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (result GalleryImageVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryImageVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) GetResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGalleryImage list gallery image versions in a gallery image definition. -// Parameters: -// 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. -func (client GalleryImageVersionsClient) ListByGalleryImage(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") - defer func() { - sc := -1 - if result.givl.Response.Response != nil { - sc = result.givl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryImageNextResults - req, err := client.ListByGalleryImagePreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGalleryImageSender(req) - if err != nil { - result.givl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure sending request") - return - } - - result.givl, err = client.ListByGalleryImageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure responding to request") - return - } - if result.givl.hasNextLink() && result.givl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryImagePreparer prepares the ListByGalleryImage request. -func (client GalleryImageVersionsClient) ListByGalleryImagePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGalleryImageSender sends the ListByGalleryImage request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) ListByGalleryImageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryImageResponder handles the response to the ListByGalleryImage request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) ListByGalleryImageResponder(resp *http.Response) (result GalleryImageVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryImageNextResults retrieves the next set of results, if any. -func (client GalleryImageVersionsClient) listByGalleryImageNextResults(ctx context.Context, lastResults GalleryImageVersionList) (result GalleryImageVersionList, err error) { - req, err := lastResults.galleryImageVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGalleryImageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryImageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryImageComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImageVersionsClient) ListByGalleryImageComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGalleryImage(ctx, resourceGroupName, galleryName, galleryImageName) - return -} - -// Update update a gallery image version. -// Parameters: -// 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. -func (client GalleryImageVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (result GalleryImageVersionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryImageVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithJSON(galleryImageVersion), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) UpdateSender(req *http.Request) (future GalleryImageVersionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) UpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go deleted file mode 100644 index 311d7e7c8b2f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go +++ /dev/null @@ -1,114 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GallerySharingProfileClient is the compute Client -type GallerySharingProfileClient struct { - BaseClient -} - -// NewGallerySharingProfileClient creates an instance of the GallerySharingProfileClient client. -func NewGallerySharingProfileClient(subscriptionID string) GallerySharingProfileClient { - return NewGallerySharingProfileClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGallerySharingProfileClientWithBaseURI creates an instance of the GallerySharingProfileClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewGallerySharingProfileClientWithBaseURI(baseURI string, subscriptionID string) GallerySharingProfileClient { - return GallerySharingProfileClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Update update sharing profile of a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. -// sharingUpdate - parameters supplied to the update gallery sharing profile. -func (client GallerySharingProfileClient) Update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate) (result GallerySharingProfileUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GallerySharingProfileClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, sharingUpdate) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GallerySharingProfileClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share", pathParameters), - autorest.WithJSON(sharingUpdate), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GallerySharingProfileClient) UpdateSender(req *http.Request) (future GallerySharingProfileUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GallerySharingProfileClient) UpdateResponder(resp *http.Response) (result SharingUpdate, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go deleted file mode 100644 index 6c41cf7cea27..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go +++ /dev/null @@ -1,583 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ImagesClient is the compute Client -type ImagesClient struct { - BaseClient -} - -// NewImagesClient creates an instance of the ImagesClient client. -func NewImagesClient(subscriptionID string) ImagesClient { - return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewImagesClientWithBaseURI creates an instance of the ImagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient { - return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// parameters - parameters supplied to the Create Image operation. -func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (result ImagesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "imageName": autorest.Encode("path", imageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes an Image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, imageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, imageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "imageName": autorest.Encode("path", imageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// expand - the expand expression to apply on the operation. -func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, imageName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, imageName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "imageName": autorest.Encode("path", imageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List 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. -func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ImagesClient) listNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { - req, err := lastResults.imageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets the list of images under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ImagesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { - req, err := lastResults.imageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ImageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// parameters - parameters supplied to the Update Image operation. -func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, imageName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "imageName": autorest.Encode("path", imageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go deleted file mode 100644 index 9182f969d8ef..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go +++ /dev/null @@ -1,206 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LogAnalyticsClient is the compute Client -type LogAnalyticsClient struct { - BaseClient -} - -// NewLogAnalyticsClient creates an instance of the LogAnalyticsClient client. -func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient { - return NewLogAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLogAnalyticsClientWithBaseURI creates an instance of the LogAnalyticsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient { - return LogAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to -// show throttling activities. -// Parameters: -// parameters - parameters supplied to the LogAnalytics getRequestRateByInterval Api. -// location - the location upon which virtual-machine-sizes is queried. -func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context, parameters RequestRateByIntervalInput, location string) (result LogAnalyticsExportRequestRateByIntervalFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportRequestRateByInterval") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.LogAnalyticsClient", "ExportRequestRateByInterval", err.Error()) - } - - req, err := client.ExportRequestRateByIntervalPreparer(ctx, parameters, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", nil, "Failure preparing request") - return - } - - result, err = client.ExportRequestRateByIntervalSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportRequestRateByIntervalPreparer prepares the ExportRequestRateByInterval request. -func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context.Context, parameters RequestRateByIntervalInput, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the -// http.Response Body if it receives an error. -func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ExportRequestRateByIntervalResponder handles the response to the ExportRequestRateByInterval request. The method always -// closes the http.Response Body. -func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time -// window. -// Parameters: -// parameters - parameters supplied to the LogAnalytics getThrottledRequests Api. -// location - the location upon which virtual-machine-sizes is queried. -func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, parameters ThrottledRequestsInput, location string) (result LogAnalyticsExportThrottledRequestsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportThrottledRequests") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.LogAnalyticsClient", "ExportThrottledRequests", err.Error()) - } - - req, err := client.ExportThrottledRequestsPreparer(ctx, parameters, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", nil, "Failure preparing request") - return - } - - result, err = client.ExportThrottledRequestsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportThrottledRequestsPreparer prepares the ExportThrottledRequests request. -func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Context, parameters ThrottledRequestsInput, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the -// http.Response Body if it receives an error. -func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ExportThrottledRequestsResponder handles the response to the ExportThrottledRequests request. The method always -// closes the http.Response Body. -func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go deleted file mode 100644 index d9c282fab4a8..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go +++ /dev/null @@ -1,24367 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "io" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" - -// AccessURI a disk access SAS uri. -type AccessURI struct { - autorest.Response `json:"-"` - // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. - AccessSAS *string `json:"accessSAS,omitempty"` - // SecurityDataAccessSAS - READ-ONLY; A SAS uri for accessing a VM guest state. - SecurityDataAccessSAS *string `json:"securityDataAccessSAS,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccessURI. -func (au AccessURI) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale -// set. -type AdditionalCapabilities struct { - // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. - UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` - // HibernationEnabled - The flag that enables or disables hibernation capability on the VM. - HibernationEnabled *bool `json:"hibernationEnabled,omitempty"` -} - -// 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 { - // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' - PassName PassNames `json:"passName,omitempty"` - // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' - ComponentName ComponentNames `json:"componentName,omitempty"` - // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' - SettingName SettingNames `json:"settingName,omitempty"` - // Content - 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 `json:"content,omitempty"` -} - -// APIEntityReference the API entity reference. -type APIEntityReference struct { - // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - ID *string `json:"id,omitempty"` -} - -// APIError api error. -type APIError struct { - // Details - The Api error details - Details *[]APIErrorBase `json:"details,omitempty"` - // Innererror - The Api inner error - Innererror *InnerError `json:"innererror,omitempty"` - // Code - The error code. - Code *string `json:"code,omitempty"` - // Target - The target of the particular error. - Target *string `json:"target,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// APIErrorBase api error base. -type APIErrorBase struct { - // Code - The error code. - Code *string `json:"code,omitempty"` - // Target - The target of the particular error. - Target *string `json:"target,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// ApplicationProfile contains the list of gallery applications that should be made available to the -// VM/VMSS -type ApplicationProfile struct { - // GalleryApplications - Specifies the gallery applications that should be made available to the VM/VMSS - GalleryApplications *[]VMGalleryApplication `json:"galleryApplications,omitempty"` -} - -// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. -type AutomaticOSUpgradePolicy struct { - // EnableAutomaticOSUpgrade - 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 `json:"enableAutomaticOSUpgrade,omitempty"` - // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. - DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` - // UseRollingUpgradePolicy - 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 `json:"useRollingUpgradePolicy,omitempty"` -} - -// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. -type AutomaticOSUpgradeProperties struct { - // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. - AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` -} - -// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual -// machine scale set. -type AutomaticRepairsPolicy struct { - // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool `json:"enabled,omitempty"` - // GracePeriod - 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 `json:"gracePeriod,omitempty"` - // 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. Possible values include: 'Replace', 'Restart', 'Reimage' - RepairAction RepairAction `json:"repairAction,omitempty"` -} - -// 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 availability set at creation time. An existing VM cannot be added to an -// availability set. -type AvailabilitySet struct { - autorest.Response `json:"-"` - *AvailabilitySetProperties `json:"properties,omitempty"` - // Sku - 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 `json:"sku,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AvailabilitySet. -func (as AvailabilitySet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if as.AvailabilitySetProperties != nil { - objectMap["properties"] = as.AvailabilitySetProperties - } - if as.Sku != nil { - objectMap["sku"] = as.Sku - } - if as.Location != nil { - objectMap["location"] = as.Location - } - if as.Tags != nil { - objectMap["tags"] = as.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. -func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var availabilitySetProperties AvailabilitySetProperties - err = json.Unmarshal(*v, &availabilitySetProperties) - if err != nil { - return err - } - as.AvailabilitySetProperties = &availabilitySetProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - as.Sku = &sku - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - as.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - as.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - as.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - as.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - as.Tags = tags - } - } - } - - return nil -} - -// AvailabilitySetListResult the List Availability Set operation response. -type AvailabilitySetListResult struct { - autorest.Response `json:"-"` - // Value - The list of availability sets - Value *[]AvailabilitySet `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. - NextLink *string `json:"nextLink,omitempty"` -} - -// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. -type AvailabilitySetListResultIterator struct { - i int - page AvailabilitySetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailabilitySetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailabilitySetListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { - if !iter.page.NotDone() { - return AvailabilitySet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailabilitySetListResultIterator type. -func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { - return AvailabilitySetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aslr AvailabilitySetListResult) IsEmpty() bool { - return aslr.Value == nil || len(*aslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aslr AvailabilitySetListResult) hasNextLink() bool { - return aslr.NextLink != nil && len(*aslr.NextLink) != 0 -} - -// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !aslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aslr.NextLink))) -} - -// AvailabilitySetListResultPage contains a page of AvailabilitySet values. -type AvailabilitySetListResultPage struct { - fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) - aslr AvailabilitySetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aslr) - if err != nil { - return err - } - page.aslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailabilitySetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailabilitySetListResultPage) NotDone() bool { - return !page.aslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { - return page.aslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { - if page.aslr.IsEmpty() { - return nil - } - return *page.aslr.Value -} - -// Creates a new instance of the AvailabilitySetListResultPage type. -func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { - return AvailabilitySetListResultPage{ - fn: getNextPage, - aslr: cur, - } -} - -// AvailabilitySetProperties the instance view of a resource. -type AvailabilitySetProperties struct { - // PlatformUpdateDomainCount - Update Domain count. - PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` - // PlatformFaultDomainCount - Fault Domain count. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // VirtualMachines - A list of references to all virtual machines in the availability set. - VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to.

    Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // Statuses - READ-ONLY; The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailabilitySetProperties. -func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asp.PlatformUpdateDomainCount != nil { - objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount - } - if asp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount - } - if asp.VirtualMachines != nil { - objectMap["virtualMachines"] = asp.VirtualMachines - } - if asp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup - } - return json.Marshal(objectMap) -} - -// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should -// be assigned to. Only tags may be updated. -type AvailabilitySetUpdate struct { - *AvailabilitySetProperties `json:"properties,omitempty"` - // Sku - Sku of the availability set - Sku *Sku `json:"sku,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. -func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asu.AvailabilitySetProperties != nil { - objectMap["properties"] = asu.AvailabilitySetProperties - } - if asu.Sku != nil { - objectMap["sku"] = asu.Sku - } - if asu.Tags != nil { - objectMap["tags"] = asu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. -func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var availabilitySetProperties AvailabilitySetProperties - err = json.Unmarshal(*v, &availabilitySetProperties) - if err != nil { - return err - } - asu.AvailabilitySetProperties = &availabilitySetProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - asu.Sku = &sku - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - asu.Tags = tags - } - } - } - - return nil -} - -// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch -// summary. -type AvailablePatchSummary struct { - // Status - 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.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' - Status PatchOperationStatus `json:"status,omitempty"` - // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` - // RebootPending - 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 `json:"rebootPending,omitempty"` - // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` - // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` - // StartTime - READ-ONLY; The UTC timestamp when the operation began. - StartTime *date.Time `json:"startTime,omitempty"` - // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailablePatchSummary. -func (aps AvailablePatchSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS.

    Minimum -// api-version: 2019-03-01. -type BillingProfile struct { - // MaxPrice - 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 `json:"maxPrice,omitempty"` -} - -// 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 { - // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. - Enabled *bool `json:"enabled,omitempty"` - // StorageURI - 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 `json:"storageUri,omitempty"` -} - -// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. -type BootDiagnosticsInstanceView struct { - // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI.

    NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. - ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` - // SerialConsoleLogBlobURI - 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 `json:"serialConsoleLogBlobUri,omitempty"` - // Status - 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 `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. -func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CapacityReservation specifies information about the capacity reservation. -type CapacityReservation struct { - autorest.Response `json:"-"` - *CapacityReservationProperties `json:"properties,omitempty"` - // Sku - 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 `json:"sku,omitempty"` - // Zones - 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 `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CapacityReservation. -func (cr CapacityReservation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cr.CapacityReservationProperties != nil { - objectMap["properties"] = cr.CapacityReservationProperties - } - if cr.Sku != nil { - objectMap["sku"] = cr.Sku - } - if cr.Zones != nil { - objectMap["zones"] = cr.Zones - } - if cr.Location != nil { - objectMap["location"] = cr.Location - } - if cr.Tags != nil { - objectMap["tags"] = cr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityReservation struct. -func (cr *CapacityReservation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var capacityReservationProperties CapacityReservationProperties - err = json.Unmarshal(*v, &capacityReservationProperties) - if err != nil { - return err - } - cr.CapacityReservationProperties = &capacityReservationProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - cr.Sku = &sku - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - cr.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cr.Tags = tags - } - } - } - - return nil -} - -// 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 { - autorest.Response `json:"-"` - *CapacityReservationGroupProperties `json:"properties,omitempty"` - // Zones - 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 `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationGroup. -func (crg CapacityReservationGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if crg.CapacityReservationGroupProperties != nil { - objectMap["properties"] = crg.CapacityReservationGroupProperties - } - if crg.Zones != nil { - objectMap["zones"] = crg.Zones - } - if crg.Location != nil { - objectMap["location"] = crg.Location - } - if crg.Tags != nil { - objectMap["tags"] = crg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroup struct. -func (crg *CapacityReservationGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var capacityReservationGroupProperties CapacityReservationGroupProperties - err = json.Unmarshal(*v, &capacityReservationGroupProperties) - if err != nil { - return err - } - crg.CapacityReservationGroupProperties = &capacityReservationGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - crg.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - crg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - crg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - crg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - crg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - crg.Tags = tags - } - } - } - - return nil -} - -// CapacityReservationGroupInstanceView ... -type CapacityReservationGroupInstanceView struct { - // CapacityReservations - READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. - CapacityReservations *[]CapacityReservationInstanceViewWithName `json:"capacityReservations,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationGroupInstanceView. -func (crgiv CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CapacityReservationGroupListResult the List capacity reservation group with resource group response. -type CapacityReservationGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of capacity reservation groups - Value *[]CapacityReservationGroup `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// CapacityReservationGroupListResultIterator provides access to a complete listing of -// CapacityReservationGroup values. -type CapacityReservationGroupListResultIterator struct { - i int - page CapacityReservationGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CapacityReservationGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CapacityReservationGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CapacityReservationGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CapacityReservationGroupListResultIterator) Response() CapacityReservationGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CapacityReservationGroupListResultIterator) Value() CapacityReservationGroup { - if !iter.page.NotDone() { - return CapacityReservationGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CapacityReservationGroupListResultIterator type. -func NewCapacityReservationGroupListResultIterator(page CapacityReservationGroupListResultPage) CapacityReservationGroupListResultIterator { - return CapacityReservationGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (crglr CapacityReservationGroupListResult) IsEmpty() bool { - return crglr.Value == nil || len(*crglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (crglr CapacityReservationGroupListResult) hasNextLink() bool { - return crglr.NextLink != nil && len(*crglr.NextLink) != 0 -} - -// capacityReservationGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (crglr CapacityReservationGroupListResult) capacityReservationGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !crglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(crglr.NextLink))) -} - -// CapacityReservationGroupListResultPage contains a page of CapacityReservationGroup values. -type CapacityReservationGroupListResultPage struct { - fn func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error) - crglr CapacityReservationGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CapacityReservationGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.crglr) - if err != nil { - return err - } - page.crglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CapacityReservationGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CapacityReservationGroupListResultPage) NotDone() bool { - return !page.crglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CapacityReservationGroupListResultPage) Response() CapacityReservationGroupListResult { - return page.crglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CapacityReservationGroupListResultPage) Values() []CapacityReservationGroup { - if page.crglr.IsEmpty() { - return nil - } - return *page.crglr.Value -} - -// Creates a new instance of the CapacityReservationGroupListResultPage type. -func NewCapacityReservationGroupListResultPage(cur CapacityReservationGroupListResult, getNextPage func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error)) CapacityReservationGroupListResultPage { - return CapacityReservationGroupListResultPage{ - fn: getNextPage, - crglr: cur, - } -} - -// CapacityReservationGroupProperties capacity reservation group Properties. -type CapacityReservationGroupProperties struct { - // CapacityReservations - READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. - CapacityReservations *[]SubResourceReadOnly `json:"capacityReservations,omitempty"` - // VirtualMachinesAssociated - READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. - VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` - // InstanceView - 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 `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationGroupProperties. -func (crgp CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CapacityReservationGroupUpdate specifies information about the capacity reservation group. Only tags can -// be updated. -type CapacityReservationGroupUpdate struct { - *CapacityReservationGroupProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationGroupUpdate. -func (crgu CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if crgu.CapacityReservationGroupProperties != nil { - objectMap["properties"] = crgu.CapacityReservationGroupProperties - } - if crgu.Tags != nil { - objectMap["tags"] = crgu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroupUpdate struct. -func (crgu *CapacityReservationGroupUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var capacityReservationGroupProperties CapacityReservationGroupProperties - err = json.Unmarshal(*v, &capacityReservationGroupProperties) - if err != nil { - return err - } - crgu.CapacityReservationGroupProperties = &capacityReservationGroupProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - crgu.Tags = tags - } - } - } - - return nil -} - -// 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 { - // UtilizationInfo - Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// 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 { - // Name - READ-ONLY; The name of the capacity reservation. - Name *string `json:"name,omitempty"` - // UtilizationInfo - Unutilized capacity of the capacity reservation. - UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationInstanceViewWithName. -func (crivwn CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if crivwn.UtilizationInfo != nil { - objectMap["utilizationInfo"] = crivwn.UtilizationInfo - } - if crivwn.Statuses != nil { - objectMap["statuses"] = crivwn.Statuses - } - return json.Marshal(objectMap) -} - -// CapacityReservationListResult the list capacity reservation operation response. -type CapacityReservationListResult struct { - autorest.Response `json:"-"` - // Value - The list of capacity reservations - Value *[]CapacityReservation `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// CapacityReservationListResultIterator provides access to a complete listing of CapacityReservation -// values. -type CapacityReservationListResultIterator struct { - i int - page CapacityReservationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CapacityReservationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CapacityReservationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CapacityReservationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CapacityReservationListResultIterator) Response() CapacityReservationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CapacityReservationListResultIterator) Value() CapacityReservation { - if !iter.page.NotDone() { - return CapacityReservation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CapacityReservationListResultIterator type. -func NewCapacityReservationListResultIterator(page CapacityReservationListResultPage) CapacityReservationListResultIterator { - return CapacityReservationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (crlr CapacityReservationListResult) IsEmpty() bool { - return crlr.Value == nil || len(*crlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (crlr CapacityReservationListResult) hasNextLink() bool { - return crlr.NextLink != nil && len(*crlr.NextLink) != 0 -} - -// capacityReservationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (crlr CapacityReservationListResult) capacityReservationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !crlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(crlr.NextLink))) -} - -// CapacityReservationListResultPage contains a page of CapacityReservation values. -type CapacityReservationListResultPage struct { - fn func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error) - crlr CapacityReservationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CapacityReservationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.crlr) - if err != nil { - return err - } - page.crlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CapacityReservationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CapacityReservationListResultPage) NotDone() bool { - return !page.crlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CapacityReservationListResultPage) Response() CapacityReservationListResult { - return page.crlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CapacityReservationListResultPage) Values() []CapacityReservation { - if page.crlr.IsEmpty() { - return nil - } - return *page.crlr.Value -} - -// Creates a new instance of the CapacityReservationListResultPage type. -func NewCapacityReservationListResultPage(cur CapacityReservationListResult, getNextPage func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error)) CapacityReservationListResultPage { - return CapacityReservationListResultPage{ - fn: getNextPage, - crlr: cur, - } -} - -// CapacityReservationProfile the parameters of a capacity reservation Profile. -type CapacityReservationProfile struct { - // CapacityReservationGroup - 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 `json:"capacityReservationGroup,omitempty"` -} - -// CapacityReservationProperties properties of the Capacity reservation. -type CapacityReservationProperties struct { - // ReservationID - 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 `json:"reservationId,omitempty"` - // PlatformFaultDomainCount - 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 `json:"platformFaultDomainCount,omitempty"` - // VirtualMachinesAssociated - READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. - VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` - // ProvisioningTime - READ-ONLY; The date time when the capacity reservation was last updated. - ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The Capacity reservation instance view. - InstanceView *CapacityReservationInstanceView `json:"instanceView,omitempty"` - // TimeCreated - READ-ONLY; Specifies the time at which the Capacity Reservation resource was created.

    Minimum api-version: 2021-11-01. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationProperties. -func (crp CapacityReservationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CapacityReservationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CapacityReservationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CapacityReservationsClient) (CapacityReservation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CapacityReservationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CapacityReservationsCreateOrUpdateFuture.Result. -func (future *CapacityReservationsCreateOrUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { - cr, err = client.CreateOrUpdateResponder(cr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") - } - } - return -} - -// CapacityReservationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CapacityReservationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CapacityReservationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CapacityReservationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CapacityReservationsDeleteFuture.Result. -func (future *CapacityReservationsDeleteFuture) result(client CapacityReservationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// CapacityReservationsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CapacityReservationsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CapacityReservationsClient) (CapacityReservation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CapacityReservationsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CapacityReservationsUpdateFuture.Result. -func (future *CapacityReservationsUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { - cr, err = client.UpdateResponder(cr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") - } - } - return -} - -// CapacityReservationUpdate specifies information about the capacity reservation. Only tags and -// sku.capacity can be updated. -type CapacityReservationUpdate struct { - *CapacityReservationProperties `json:"properties,omitempty"` - // Sku - 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 `json:"sku,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationUpdate. -func (cru CapacityReservationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cru.CapacityReservationProperties != nil { - objectMap["properties"] = cru.CapacityReservationProperties - } - if cru.Sku != nil { - objectMap["sku"] = cru.Sku - } - if cru.Tags != nil { - objectMap["tags"] = cru.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CapacityReservationUpdate struct. -func (cru *CapacityReservationUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var capacityReservationProperties CapacityReservationProperties - err = json.Unmarshal(*v, &capacityReservationProperties) - if err != nil { - return err - } - cru.CapacityReservationProperties = &capacityReservationProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - cru.Sku = &sku - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cru.Tags = tags - } - } - } - - return nil -} - -// CapacityReservationUtilization represents the capacity reservation utilization in terms of resources -// allocated. -type CapacityReservationUtilization struct { - // CurrentCapacity - 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 `json:"currentCapacity,omitempty"` - // VirtualMachinesAllocated - READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. - VirtualMachinesAllocated *[]SubResourceReadOnly `json:"virtualMachinesAllocated,omitempty"` -} - -// MarshalJSON is the custom marshaler for CapacityReservationUtilization. -func (cru CapacityReservationUtilization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CloudError an error response from the Compute service. -type CloudError struct { - Error *APIError `json:"error,omitempty"` -} - -// CloudService describes the cloud service. -type CloudService struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - Properties *CloudServiceProperties `json:"properties,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudService. -func (cs CloudService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cs.Location != nil { - objectMap["location"] = cs.Location - } - if cs.Tags != nil { - objectMap["tags"] = cs.Tags - } - if cs.Properties != nil { - objectMap["properties"] = cs.Properties - } - if cs.SystemData != nil { - objectMap["systemData"] = cs.SystemData - } - return json.Marshal(objectMap) -} - -// CloudServiceExtensionProfile describes a cloud service extension profile. -type CloudServiceExtensionProfile struct { - // Extensions - List of extensions for the cloud service. - Extensions *[]Extension `json:"extensions,omitempty"` -} - -// CloudServiceExtensionProperties extension Properties. -type CloudServiceExtensionProperties struct { - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension. - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - 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 `json:"typeHandlerVersion,omitempty"` - // AutoUpgradeMinorVersion - Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available. - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - // Settings - 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 interface{} `json:"settings,omitempty"` - // ProtectedSettings - Protected settings for the extension which are encrypted before sent to the role instance. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` - // ForceUpdateTag - 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 `json:"forceUpdateTag,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // RolesAppliedTo - 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 `json:"rolesAppliedTo,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceExtensionProperties. -func (csep CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csep.Publisher != nil { - objectMap["publisher"] = csep.Publisher - } - if csep.Type != nil { - objectMap["type"] = csep.Type - } - if csep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = csep.TypeHandlerVersion - } - if csep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = csep.AutoUpgradeMinorVersion - } - if csep.Settings != nil { - objectMap["settings"] = csep.Settings - } - if csep.ProtectedSettings != nil { - objectMap["protectedSettings"] = csep.ProtectedSettings - } - if csep.ProtectedSettingsFromKeyVault != nil { - objectMap["protectedSettingsFromKeyVault"] = csep.ProtectedSettingsFromKeyVault - } - if csep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = csep.ForceUpdateTag - } - if csep.RolesAppliedTo != nil { - objectMap["rolesAppliedTo"] = csep.RolesAppliedTo - } - return json.Marshal(objectMap) -} - -// CloudServiceInstanceView instanceView of CloudService as a whole -type CloudServiceInstanceView struct { - autorest.Response `json:"-"` - RoleInstance *InstanceViewStatusesSummary `json:"roleInstance,omitempty"` - // SdkVersion - READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. - SdkVersion *string `json:"sdkVersion,omitempty"` - // PrivateIds - 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 `json:"privateIds,omitempty"` - // Statuses - READ-ONLY - Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceInstanceView. -func (csiv CloudServiceInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csiv.RoleInstance != nil { - objectMap["roleInstance"] = csiv.RoleInstance - } - return json.Marshal(objectMap) -} - -// CloudServiceListResult the list operation result. -type CloudServiceListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]CloudService `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// CloudServiceListResultIterator provides access to a complete listing of CloudService values. -type CloudServiceListResultIterator struct { - i int - page CloudServiceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CloudServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CloudServiceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudServiceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CloudServiceListResultIterator) Response() CloudServiceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CloudServiceListResultIterator) Value() CloudService { - if !iter.page.NotDone() { - return CloudService{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CloudServiceListResultIterator type. -func NewCloudServiceListResultIterator(page CloudServiceListResultPage) CloudServiceListResultIterator { - return CloudServiceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cslr CloudServiceListResult) IsEmpty() bool { - return cslr.Value == nil || len(*cslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cslr CloudServiceListResult) hasNextLink() bool { - return cslr.NextLink != nil && len(*cslr.NextLink) != 0 -} - -// cloudServiceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cslr CloudServiceListResult) cloudServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !cslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cslr.NextLink))) -} - -// CloudServiceListResultPage contains a page of CloudService values. -type CloudServiceListResultPage struct { - fn func(context.Context, CloudServiceListResult) (CloudServiceListResult, error) - cslr CloudServiceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CloudServiceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cslr) - if err != nil { - return err - } - page.cslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CloudServiceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudServiceListResultPage) NotDone() bool { - return !page.cslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudServiceListResultPage) Response() CloudServiceListResult { - return page.cslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudServiceListResultPage) Values() []CloudService { - if page.cslr.IsEmpty() { - return nil - } - return *page.cslr.Value -} - -// Creates a new instance of the CloudServiceListResultPage type. -func NewCloudServiceListResultPage(cur CloudServiceListResult, getNextPage func(context.Context, CloudServiceListResult) (CloudServiceListResult, error)) CloudServiceListResultPage { - return CloudServiceListResultPage{ - fn: getNextPage, - cslr: cur, - } -} - -// CloudServiceNetworkProfile network Profile for the cloud service. -type CloudServiceNetworkProfile struct { - // LoadBalancerConfigurations - 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 `json:"loadBalancerConfigurations,omitempty"` - // SlotType - Possible values include: 'Production', 'Staging' - SlotType CloudServiceSlotType `json:"slotType,omitempty"` - // SwappableCloudService - 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 `json:"swappableCloudService,omitempty"` -} - -// CloudServiceOsProfile describes the OS profile for the cloud service. -type CloudServiceOsProfile struct { - // Secrets - Specifies set of certificates that should be installed onto the role instances. - Secrets *[]CloudServiceVaultSecretGroup `json:"secrets,omitempty"` -} - -// CloudServiceProperties cloud service properties -type CloudServiceProperties struct { - // PackageURL - 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 `json:"packageUrl,omitempty"` - // Configuration - Specifies the XML service configuration (.cscfg) for the cloud service. - Configuration *string `json:"configuration,omitempty"` - // ConfigurationURL - 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 `json:"configurationUrl,omitempty"` - // StartCloudService - (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 `json:"startCloudService,omitempty"` - // AllowModelOverride - (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 `json:"allowModelOverride,omitempty"` - // UpgradeMode - Possible values include: 'Auto', 'Manual', 'Simultaneous' - UpgradeMode CloudServiceUpgradeMode `json:"upgradeMode,omitempty"` - RoleProfile *CloudServiceRoleProfile `json:"roleProfile,omitempty"` - OsProfile *CloudServiceOsProfile `json:"osProfile,omitempty"` - NetworkProfile *CloudServiceNetworkProfile `json:"networkProfile,omitempty"` - ExtensionProfile *CloudServiceExtensionProfile `json:"extensionProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueID - READ-ONLY; The unique identifier for the cloud service. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceProperties. -func (csp CloudServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csp.PackageURL != nil { - objectMap["packageUrl"] = csp.PackageURL - } - if csp.Configuration != nil { - objectMap["configuration"] = csp.Configuration - } - if csp.ConfigurationURL != nil { - objectMap["configurationUrl"] = csp.ConfigurationURL - } - if csp.StartCloudService != nil { - objectMap["startCloudService"] = csp.StartCloudService - } - if csp.AllowModelOverride != nil { - objectMap["allowModelOverride"] = csp.AllowModelOverride - } - if csp.UpgradeMode != "" { - objectMap["upgradeMode"] = csp.UpgradeMode - } - if csp.RoleProfile != nil { - objectMap["roleProfile"] = csp.RoleProfile - } - if csp.OsProfile != nil { - objectMap["osProfile"] = csp.OsProfile - } - if csp.NetworkProfile != nil { - objectMap["networkProfile"] = csp.NetworkProfile - } - if csp.ExtensionProfile != nil { - objectMap["extensionProfile"] = csp.ExtensionProfile - } - return json.Marshal(objectMap) -} - -// CloudServiceRole describes a role of the cloud service. -type CloudServiceRole struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - Sku *CloudServiceRoleSku `json:"sku,omitempty"` - Properties *CloudServiceRoleProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceRole. -func (csr CloudServiceRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csr.Sku != nil { - objectMap["sku"] = csr.Sku - } - if csr.Properties != nil { - objectMap["properties"] = csr.Properties - } - return json.Marshal(objectMap) -} - -// CloudServiceRoleInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServiceRoleInstancesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServiceRoleInstancesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServiceRoleInstancesDeleteFuture.Result. -func (future *CloudServiceRoleInstancesDeleteFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServiceRoleInstancesRebuildFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServiceRoleInstancesRebuildFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServiceRoleInstancesRebuildFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServiceRoleInstancesRebuildFuture.Result. -func (future *CloudServiceRoleInstancesRebuildFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRebuildFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRebuildFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServiceRoleInstancesReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServiceRoleInstancesReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServiceRoleInstancesReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServiceRoleInstancesReimageFuture.Result. -func (future *CloudServiceRoleInstancesReimageFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServiceRoleInstancesRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServiceRoleInstancesRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServiceRoleInstancesRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServiceRoleInstancesRestartFuture.Result. -func (future *CloudServiceRoleInstancesRestartFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServiceRoleListResult the list operation result. -type CloudServiceRoleListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]CloudServiceRole `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// CloudServiceRoleListResultIterator provides access to a complete listing of CloudServiceRole values. -type CloudServiceRoleListResultIterator struct { - i int - page CloudServiceRoleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CloudServiceRoleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CloudServiceRoleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CloudServiceRoleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CloudServiceRoleListResultIterator) Response() CloudServiceRoleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CloudServiceRoleListResultIterator) Value() CloudServiceRole { - if !iter.page.NotDone() { - return CloudServiceRole{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CloudServiceRoleListResultIterator type. -func NewCloudServiceRoleListResultIterator(page CloudServiceRoleListResultPage) CloudServiceRoleListResultIterator { - return CloudServiceRoleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (csrlr CloudServiceRoleListResult) IsEmpty() bool { - return csrlr.Value == nil || len(*csrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (csrlr CloudServiceRoleListResult) hasNextLink() bool { - return csrlr.NextLink != nil && len(*csrlr.NextLink) != 0 -} - -// cloudServiceRoleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (csrlr CloudServiceRoleListResult) cloudServiceRoleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !csrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(csrlr.NextLink))) -} - -// CloudServiceRoleListResultPage contains a page of CloudServiceRole values. -type CloudServiceRoleListResultPage struct { - fn func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error) - csrlr CloudServiceRoleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CloudServiceRoleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.csrlr) - if err != nil { - return err - } - page.csrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CloudServiceRoleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CloudServiceRoleListResultPage) NotDone() bool { - return !page.csrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CloudServiceRoleListResultPage) Response() CloudServiceRoleListResult { - return page.csrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CloudServiceRoleListResultPage) Values() []CloudServiceRole { - if page.csrlr.IsEmpty() { - return nil - } - return *page.csrlr.Value -} - -// Creates a new instance of the CloudServiceRoleListResultPage type. -func NewCloudServiceRoleListResultPage(cur CloudServiceRoleListResult, getNextPage func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error)) CloudServiceRoleListResultPage { - return CloudServiceRoleListResultPage{ - fn: getNextPage, - csrlr: cur, - } -} - -// CloudServiceRoleProfile describes the role profile for the cloud service. -type CloudServiceRoleProfile struct { - // Roles - List of roles for the cloud service. - Roles *[]CloudServiceRoleProfileProperties `json:"roles,omitempty"` -} - -// CloudServiceRoleProfileProperties describes the role properties. -type CloudServiceRoleProfileProperties struct { - // Name - Resource name. - Name *string `json:"name,omitempty"` - Sku *CloudServiceRoleSku `json:"sku,omitempty"` -} - -// CloudServiceRoleProperties the cloud service role properties. -type CloudServiceRoleProperties struct { - // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// MarshalJSON is the custom marshaler for CloudServiceRoleProperties. -func (csrp CloudServiceRoleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CloudServiceRoleSku describes the cloud service role sku. -type CloudServiceRoleSku struct { - // Name - 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 `json:"name,omitempty"` - // Tier - Specifies the tier of the cloud service. Possible Values are

    **Standard**

    **Basic** - Tier *string `json:"tier,omitempty"` - // Capacity - Specifies the number of role instances in the cloud service. - Capacity *int64 `json:"capacity,omitempty"` -} - -// CloudServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServicesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (CloudService, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesCreateOrUpdateFuture.Result. -func (future *CloudServicesCreateOrUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cs.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { - cs, err = client.CreateOrUpdateResponder(cs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") - } - } - return -} - -// CloudServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesDeleteFuture.Result. -func (future *CloudServicesDeleteFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CloudServicesDeleteInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesDeleteInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesDeleteInstancesFuture.Result. -func (future *CloudServicesDeleteInstancesFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesPowerOffFuture.Result. -func (future *CloudServicesPowerOffFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesRebuildFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesRebuildFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesRebuildFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesRebuildFuture.Result. -func (future *CloudServicesRebuildFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesRebuildFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRebuildFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesReimageFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesReimageFuture.Result. -func (future *CloudServicesReimageFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesRestartFuture.Result. -func (future *CloudServicesRestartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesStartFuture.Result. -func (future *CloudServicesStartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesStartFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesUpdateDomainWalkUpdateDomainFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type CloudServicesUpdateDomainWalkUpdateDomainFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesUpdateDomainClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesUpdateDomainWalkUpdateDomainFuture.Result. -func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) result(client CloudServicesUpdateDomainClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainWalkUpdateDomainFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateDomainWalkUpdateDomainFuture") - return - } - ar.Response = future.Response() - return -} - -// CloudServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CloudServicesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CloudServicesClient) (CloudService, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CloudServicesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CloudServicesUpdateFuture.Result. -func (future *CloudServicesUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cs.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { - cs, err = client.UpdateResponder(cs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") - } - } - return -} - -// CloudServiceUpdate ... -type CloudServiceUpdate struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CloudServiceUpdate. -func (csu CloudServiceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csu.Tags != nil { - objectMap["tags"] = csu.Tags - } - return json.Marshal(objectMap) -} - -// CloudServiceVaultAndSecretReference protected settings for the extension, referenced using KeyVault -// which are encrypted before sent to the role instance. -type CloudServiceVaultAndSecretReference struct { - // SourceVault - The ARM Resource ID of the Key Vault - SourceVault *SubResource `json:"sourceVault,omitempty"` - // SecretURL - Secret URL which contains the protected settings of the extension - SecretURL *string `json:"secretUrl,omitempty"` -} - -// CloudServiceVaultCertificate describes a single certificate reference in a Key Vault, and where the -// certificate should reside on the role instance. -type CloudServiceVaultCertificate struct { - // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. - CertificateURL *string `json:"certificateUrl,omitempty"` -} - -// CloudServiceVaultSecretGroup describes a set of certificates which are all in the same Key Vault. -type CloudServiceVaultSecretGroup struct { - // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource `json:"sourceVault,omitempty"` - // VaultCertificates - The list of key vault references in SourceVault which contain certificates. - VaultCertificates *[]CloudServiceVaultCertificate `json:"vaultCertificates,omitempty"` -} - -// CommunityGallery specifies information about the Community Gallery that you want to create or update. -type CommunityGallery struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *CommunityGalleryIdentifier `json:"identifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGallery. -func (cg CommunityGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cg.CommunityGalleryIdentifier != nil { - objectMap["identifier"] = cg.CommunityGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CommunityGallery struct. -func (cg *CommunityGallery) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cg.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cg.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cg.Type = &typeVar - } - case "identifier": - if v != nil { - var communityGalleryIdentifier CommunityGalleryIdentifier - err = json.Unmarshal(*v, &communityGalleryIdentifier) - if err != nil { - return err - } - cg.CommunityGalleryIdentifier = &communityGalleryIdentifier - } - } - } - - return nil -} - -// CommunityGalleryIdentifier the identifier information of community gallery. -type CommunityGalleryIdentifier struct { - // UniqueID - The unique id of this community gallery. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// CommunityGalleryImage specifies information about the gallery image definition that you want to create -// or update. -type CommunityGalleryImage struct { - autorest.Response `json:"-"` - *CommunityGalleryImageProperties `json:"properties,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *CommunityGalleryIdentifier `json:"identifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGalleryImage. -func (cgiVar CommunityGalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cgiVar.CommunityGalleryImageProperties != nil { - objectMap["properties"] = cgiVar.CommunityGalleryImageProperties - } - if cgiVar.CommunityGalleryIdentifier != nil { - objectMap["identifier"] = cgiVar.CommunityGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CommunityGalleryImage struct. -func (cgiVar *CommunityGalleryImage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var communityGalleryImageProperties CommunityGalleryImageProperties - err = json.Unmarshal(*v, &communityGalleryImageProperties) - if err != nil { - return err - } - cgiVar.CommunityGalleryImageProperties = &communityGalleryImageProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cgiVar.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cgiVar.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cgiVar.Type = &typeVar - } - case "identifier": - if v != nil { - var communityGalleryIdentifier CommunityGalleryIdentifier - err = json.Unmarshal(*v, &communityGalleryIdentifier) - if err != nil { - return err - } - cgiVar.CommunityGalleryIdentifier = &communityGalleryIdentifier - } - } - } - - return nil -} - -// CommunityGalleryImageList the List Community Gallery Images operation response. -type CommunityGalleryImageList struct { - autorest.Response `json:"-"` - // Value - A list of community gallery images. - Value *[]CommunityGalleryImage `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// CommunityGalleryImageListIterator provides access to a complete listing of CommunityGalleryImage values. -type CommunityGalleryImageListIterator struct { - i int - page CommunityGalleryImageListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CommunityGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CommunityGalleryImageListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CommunityGalleryImageListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CommunityGalleryImageListIterator) Response() CommunityGalleryImageList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CommunityGalleryImageListIterator) Value() CommunityGalleryImage { - if !iter.page.NotDone() { - return CommunityGalleryImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CommunityGalleryImageListIterator type. -func NewCommunityGalleryImageListIterator(page CommunityGalleryImageListPage) CommunityGalleryImageListIterator { - return CommunityGalleryImageListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cgil CommunityGalleryImageList) IsEmpty() bool { - return cgil.Value == nil || len(*cgil.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cgil CommunityGalleryImageList) hasNextLink() bool { - return cgil.NextLink != nil && len(*cgil.NextLink) != 0 -} - -// communityGalleryImageListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cgil CommunityGalleryImageList) communityGalleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if !cgil.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cgil.NextLink))) -} - -// CommunityGalleryImageListPage contains a page of CommunityGalleryImage values. -type CommunityGalleryImageListPage struct { - fn func(context.Context, CommunityGalleryImageList) (CommunityGalleryImageList, error) - cgil CommunityGalleryImageList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CommunityGalleryImageListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cgil) - if err != nil { - return err - } - page.cgil = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CommunityGalleryImageListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CommunityGalleryImageListPage) NotDone() bool { - return !page.cgil.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CommunityGalleryImageListPage) Response() CommunityGalleryImageList { - return page.cgil -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CommunityGalleryImageListPage) Values() []CommunityGalleryImage { - if page.cgil.IsEmpty() { - return nil - } - return *page.cgil.Value -} - -// Creates a new instance of the CommunityGalleryImageListPage type. -func NewCommunityGalleryImageListPage(cur CommunityGalleryImageList, getNextPage func(context.Context, CommunityGalleryImageList) (CommunityGalleryImageList, error)) CommunityGalleryImageListPage { - return CommunityGalleryImageListPage{ - fn: getNextPage, - cgil: cur, - } -} - -// CommunityGalleryImageProperties describes the properties of a gallery image definition. -type CommunityGalleryImageProperties struct { - // OsType - 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**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - Disallowed *Disallowed `json:"disallowed,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // Features - A list of gallery image features. - Features *[]GalleryImageFeature `json:"features,omitempty"` - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - // Architecture - Possible values include: 'X64', 'Arm64' - Architecture Architecture `json:"architecture,omitempty"` - // PrivacyStatementURI - Privacy statement uri for the current community gallery image. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // Eula - End-user license agreement for the current community gallery image. - Eula *string `json:"eula,omitempty"` -} - -// CommunityGalleryImageVersion specifies information about the gallery image version that you want to -// create or update. -type CommunityGalleryImageVersion struct { - autorest.Response `json:"-"` - *CommunityGalleryImageVersionProperties `json:"properties,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *CommunityGalleryIdentifier `json:"identifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGalleryImageVersion. -func (cgiv CommunityGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cgiv.CommunityGalleryImageVersionProperties != nil { - objectMap["properties"] = cgiv.CommunityGalleryImageVersionProperties - } - if cgiv.CommunityGalleryIdentifier != nil { - objectMap["identifier"] = cgiv.CommunityGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CommunityGalleryImageVersion struct. -func (cgiv *CommunityGalleryImageVersion) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var communityGalleryImageVersionProperties CommunityGalleryImageVersionProperties - err = json.Unmarshal(*v, &communityGalleryImageVersionProperties) - if err != nil { - return err - } - cgiv.CommunityGalleryImageVersionProperties = &communityGalleryImageVersionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cgiv.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cgiv.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cgiv.Type = &typeVar - } - case "identifier": - if v != nil { - var communityGalleryIdentifier CommunityGalleryIdentifier - err = json.Unmarshal(*v, &communityGalleryIdentifier) - if err != nil { - return err - } - cgiv.CommunityGalleryIdentifier = &communityGalleryIdentifier - } - } - } - - return nil -} - -// CommunityGalleryImageVersionList the List Community Gallery Image versions operation response. -type CommunityGalleryImageVersionList struct { - autorest.Response `json:"-"` - // Value - A list of community gallery image versions. - Value *[]CommunityGalleryImageVersion `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// CommunityGalleryImageVersionListIterator provides access to a complete listing of -// CommunityGalleryImageVersion values. -type CommunityGalleryImageVersionListIterator struct { - i int - page CommunityGalleryImageVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CommunityGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CommunityGalleryImageVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CommunityGalleryImageVersionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CommunityGalleryImageVersionListIterator) Response() CommunityGalleryImageVersionList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CommunityGalleryImageVersionListIterator) Value() CommunityGalleryImageVersion { - if !iter.page.NotDone() { - return CommunityGalleryImageVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CommunityGalleryImageVersionListIterator type. -func NewCommunityGalleryImageVersionListIterator(page CommunityGalleryImageVersionListPage) CommunityGalleryImageVersionListIterator { - return CommunityGalleryImageVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cgivl CommunityGalleryImageVersionList) IsEmpty() bool { - return cgivl.Value == nil || len(*cgivl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cgivl CommunityGalleryImageVersionList) hasNextLink() bool { - return cgivl.NextLink != nil && len(*cgivl.NextLink) != 0 -} - -// communityGalleryImageVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cgivl CommunityGalleryImageVersionList) communityGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !cgivl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cgivl.NextLink))) -} - -// CommunityGalleryImageVersionListPage contains a page of CommunityGalleryImageVersion values. -type CommunityGalleryImageVersionListPage struct { - fn func(context.Context, CommunityGalleryImageVersionList) (CommunityGalleryImageVersionList, error) - cgivl CommunityGalleryImageVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CommunityGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cgivl) - if err != nil { - return err - } - page.cgivl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CommunityGalleryImageVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CommunityGalleryImageVersionListPage) NotDone() bool { - return !page.cgivl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CommunityGalleryImageVersionListPage) Response() CommunityGalleryImageVersionList { - return page.cgivl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CommunityGalleryImageVersionListPage) Values() []CommunityGalleryImageVersion { - if page.cgivl.IsEmpty() { - return nil - } - return *page.cgivl.Value -} - -// Creates a new instance of the CommunityGalleryImageVersionListPage type. -func NewCommunityGalleryImageVersionListPage(cur CommunityGalleryImageVersionList, getNextPage func(context.Context, CommunityGalleryImageVersionList) (CommunityGalleryImageVersionList, error)) CommunityGalleryImageVersionListPage { - return CommunityGalleryImageVersionListPage{ - fn: getNextPage, - cgivl: cur, - } -} - -// CommunityGalleryImageVersionProperties describes the properties of a gallery image version. -type CommunityGalleryImageVersionProperties struct { - // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // StorageProfile - Describes the storage profile of the image version. - StorageProfile *SharedGalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` -} - -// CommunityGalleryInfo information of community gallery if current gallery is shared to community -type CommunityGalleryInfo struct { - // PublisherURI - The link to the publisher website. Visible to all users. - PublisherURI *string `json:"publisherUri,omitempty"` - // PublisherContact - Community gallery publisher support email. The email address of the publisher. Visible to all users. - PublisherContact *string `json:"publisherContact,omitempty"` - // Eula - End-user license agreement for community gallery image. - Eula *string `json:"eula,omitempty"` - // PublicNamePrefix - The prefix of the gallery name that will be displayed publicly. Visible to all users. - PublicNamePrefix *string `json:"publicNamePrefix,omitempty"` - // CommunityGalleryEnabled - READ-ONLY; Contains info about whether community gallery sharing is enabled. - CommunityGalleryEnabled *bool `json:"communityGalleryEnabled,omitempty"` - // PublicNames - READ-ONLY; Community gallery public name list. - PublicNames *[]string `json:"publicNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGalleryInfo. -func (cgiVar CommunityGalleryInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cgiVar.PublisherURI != nil { - objectMap["publisherUri"] = cgiVar.PublisherURI - } - if cgiVar.PublisherContact != nil { - objectMap["publisherContact"] = cgiVar.PublisherContact - } - if cgiVar.Eula != nil { - objectMap["eula"] = cgiVar.Eula - } - if cgiVar.PublicNamePrefix != nil { - objectMap["publicNamePrefix"] = cgiVar.PublicNamePrefix - } - return json.Marshal(objectMap) -} - -// CopyCompletionError indicates the error details if the background copy of a resource created via the -// CopyStart operation fails. -type CopyCompletionError struct { - // ErrorCode - Indicates the error code if the background copy of a resource created via the CopyStart operation fails. - ErrorCode *string `json:"errorCode,omitempty"` - // ErrorMessage - Indicates the error message if the background copy of a resource created via the CopyStart operation fails. - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -// CommunityGalleryInfo information of community gallery if current gallery is shared to community -type CommunityGalleryInfo struct { - // PublisherURI - Community gallery publisher uri - PublisherURI *string `json:"publisherUri,omitempty"` - // PublisherContact - Community gallery publisher contact email - PublisherContact *string `json:"publisherContact,omitempty"` - // Eula - Community gallery publisher eula - Eula *string `json:"eula,omitempty"` - // PublicNamePrefix - Community gallery public name prefix - PublicNamePrefix *string `json:"publicNamePrefix,omitempty"` - // CommunityGalleryEnabled - READ-ONLY; Contains info about whether community gallery sharing is enabled. - CommunityGalleryEnabled *bool `json:"communityGalleryEnabled,omitempty"` - // PublicNames - READ-ONLY; Community gallery public name list. - PublicNames *[]string `json:"publicNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for CommunityGalleryInfo. -func (cgiVar CommunityGalleryInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cgiVar.PublisherURI != nil { - objectMap["publisherUri"] = cgiVar.PublisherURI - } - if cgiVar.PublisherContact != nil { - objectMap["publisherContact"] = cgiVar.PublisherContact - } - if cgiVar.Eula != nil { - objectMap["eula"] = cgiVar.Eula - } - if cgiVar.PublicNamePrefix != nil { - objectMap["publicNamePrefix"] = cgiVar.PublicNamePrefix - } - return json.Marshal(objectMap) -} - -// CreationData data used when creating a disk. -type CreationData struct { - // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload', 'CopyStart', 'ImportSecure', 'UploadPreparedSecure' - CreateOption DiskCreateOption `json:"createOption,omitempty"` - // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. - StorageAccountID *string `json:"storageAccountId,omitempty"` - // ImageReference - Disk source information for PIR or user images. - ImageReference *ImageDiskReference `json:"imageReference,omitempty"` - // GalleryImageReference - 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 `json:"galleryImageReference,omitempty"` - // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. - SourceURI *string `json:"sourceUri,omitempty"` - // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. - SourceUniqueID *string `json:"sourceUniqueId,omitempty"` - // UploadSizeBytes - 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 `json:"uploadSizeBytes,omitempty"` - // LogicalSectorSize - Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. - LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"` - // SecurityDataURI - If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. - SecurityDataURI *string `json:"securityDataUri,omitempty"` - // PerformancePlus - 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 `json:"performancePlus,omitempty"` -} - -// MarshalJSON is the custom marshaler for CreationData. -func (cd CreationData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cd.CreateOption != "" { - objectMap["createOption"] = cd.CreateOption - } - if cd.StorageAccountID != nil { - objectMap["storageAccountId"] = cd.StorageAccountID - } - if cd.ImageReference != nil { - objectMap["imageReference"] = cd.ImageReference - } - if cd.GalleryImageReference != nil { - objectMap["galleryImageReference"] = cd.GalleryImageReference - } - if cd.SourceURI != nil { - objectMap["sourceUri"] = cd.SourceURI - } - if cd.SourceResourceID != nil { - objectMap["sourceResourceId"] = cd.SourceResourceID - } - if cd.UploadSizeBytes != nil { - objectMap["uploadSizeBytes"] = cd.UploadSizeBytes - } - if cd.LogicalSectorSize != nil { - objectMap["logicalSectorSize"] = cd.LogicalSectorSize - } - if cd.SecurityDataURI != nil { - objectMap["securityDataUri"] = cd.SecurityDataURI - } - if cd.PerformancePlus != nil { - objectMap["performancePlus"] = cd.PerformancePlus - } - return json.Marshal(objectMap) -} - -// DataDisk describes a data disk. -type DataDisk struct { - // Lun - 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 `json:"lun,omitempty"` - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Vhd - The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - // 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. - Image *VirtualHardDisk `json:"image,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - Specifies how the virtual machine should be created.

    Possible values are:

    **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \u2013 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. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset - ToBeDetached *bool `json:"toBeDetached,omitempty"` - // DiskIOPSReadWrite - 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 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - 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 `json:"diskMBpsReadWrite,omitempty"` - // DetachOption - 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'. Possible values include: 'ForceDetach' - DetachOption DiskDetachOptionTypes `json:"detachOption,omitempty"` - // DeleteOption - Specifies whether data disk should be deleted or detached upon VM deletion.

    Possible values:

    **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**. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataDisk. -func (dd DataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dd.Lun != nil { - objectMap["lun"] = dd.Lun - } - if dd.Name != nil { - objectMap["name"] = dd.Name - } - if dd.Vhd != nil { - objectMap["vhd"] = dd.Vhd - } - if dd.Image != nil { - objectMap["image"] = dd.Image - } - if dd.Caching != "" { - objectMap["caching"] = dd.Caching - } - if dd.WriteAcceleratorEnabled != nil { - objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled - } - if dd.CreateOption != "" { - objectMap["createOption"] = dd.CreateOption - } - if dd.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dd.DiskSizeGB - } - if dd.ManagedDisk != nil { - objectMap["managedDisk"] = dd.ManagedDisk - } - if dd.ToBeDetached != nil { - objectMap["toBeDetached"] = dd.ToBeDetached - } - if dd.DetachOption != "" { - objectMap["detachOption"] = dd.DetachOption - } - if dd.DeleteOption != "" { - objectMap["deleteOption"] = dd.DeleteOption - } - return json.Marshal(objectMap) -} - -// DataDiskImage contains the data disk images information. -type DataDiskImage struct { - // Lun - 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 `json:"lun,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataDiskImage. -func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DataDiskImageEncryption contains encryption settings for a data disk image. -type DataDiskImageEncryption struct { - // Lun - 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 `json:"lun,omitempty"` - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// DedicatedHost specifies information about the Dedicated host. -type DedicatedHost struct { - autorest.Response `json:"-"` - *DedicatedHostProperties `json:"properties,omitempty"` - // Sku - 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 `json:"sku,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHost. -func (dh DedicatedHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dh.DedicatedHostProperties != nil { - objectMap["properties"] = dh.DedicatedHostProperties - } - if dh.Sku != nil { - objectMap["sku"] = dh.Sku - } - if dh.Location != nil { - objectMap["location"] = dh.Location - } - if dh.Tags != nil { - objectMap["tags"] = dh.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. -func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dedicatedHostProperties DedicatedHostProperties - err = json.Unmarshal(*v, &dedicatedHostProperties) - if err != nil { - return err - } - dh.DedicatedHostProperties = &dedicatedHostProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - dh.Sku = &sku - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dh.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dh.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dh.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM -// size. -type DedicatedHostAllocatableVM struct { - // VMSize - VM size in terms of which the unutilized capacity is represented. - VMSize *string `json:"vmSize,omitempty"` - // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. - Count *float64 `json:"count,omitempty"` -} - -// DedicatedHostAvailableCapacity dedicated host unutilized capacity. -type DedicatedHostAvailableCapacity struct { - // AllocatableVMs - 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 `json:"allocatableVMs,omitempty"` -} - -// 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 { - autorest.Response `json:"-"` - *DedicatedHostGroupProperties `json:"properties,omitempty"` - // Zones - 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 `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroup. -func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhg.DedicatedHostGroupProperties != nil { - objectMap["properties"] = dhg.DedicatedHostGroupProperties - } - if dhg.Zones != nil { - objectMap["zones"] = dhg.Zones - } - if dhg.Location != nil { - objectMap["location"] = dhg.Location - } - if dhg.Tags != nil { - objectMap["tags"] = dhg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. -func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dedicatedHostGroupProperties DedicatedHostGroupProperties - err = json.Unmarshal(*v, &dedicatedHostGroupProperties) - if err != nil { - return err - } - dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - dhg.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dhg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dhg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dhg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dhg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhg.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostGroupInstanceView ... -type DedicatedHostGroupInstanceView struct { - // Hosts - List of instance view of the dedicated hosts under the dedicated host group. - Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` -} - -// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. -type DedicatedHostGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of dedicated host groups - Value *[]DedicatedHostGroup `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. -type DedicatedHostGroupListResultIterator struct { - i int - page DedicatedHostGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DedicatedHostGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DedicatedHostGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { - if !iter.page.NotDone() { - return DedicatedHostGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DedicatedHostGroupListResultIterator type. -func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { - return DedicatedHostGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { - return dhglr.Value == nil || len(*dhglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { - return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 -} - -// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dhglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dhglr.NextLink))) -} - -// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. -type DedicatedHostGroupListResultPage struct { - fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) - dhglr DedicatedHostGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dhglr) - if err != nil { - return err - } - page.dhglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DedicatedHostGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DedicatedHostGroupListResultPage) NotDone() bool { - return !page.dhglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { - return page.dhglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { - if page.dhglr.IsEmpty() { - return nil - } - return *page.dhglr.Value -} - -// Creates a new instance of the DedicatedHostGroupListResultPage type. -func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { - return DedicatedHostGroupListResultPage{ - fn: getNextPage, - dhglr: cur, - } -} - -// DedicatedHostGroupProperties dedicated Host Group Properties. -type DedicatedHostGroupProperties struct { - // PlatformFaultDomainCount - Number of fault domains that the host group can span. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. - Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` - // InstanceView - 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 `json:"instanceView,omitempty"` - // SupportAutomaticPlacement - 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 `json:"supportAutomaticPlacement,omitempty"` - // AdditionalCapabilities - Enables or disables a capability on the dedicated host group.

    Minimum api-version: 2022-03-01. - AdditionalCapabilities *DedicatedHostGroupPropertiesAdditionalCapabilities `json:"additionalCapabilities,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. -func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhgp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount - } - if dhgp.SupportAutomaticPlacement != nil { - objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement - } - if dhgp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = dhgp.AdditionalCapabilities - } - return json.Marshal(objectMap) -} - -// DedicatedHostGroupPropertiesAdditionalCapabilities enables or disables a capability on the dedicated -// host group.

    Minimum api-version: 2022-03-01. -type DedicatedHostGroupPropertiesAdditionalCapabilities struct { - // UltraSSDEnabled - 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 `json:"ultraSSDEnabled,omitempty"` -} - -// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host -// should be assigned to. Only tags may be updated. -type DedicatedHostGroupUpdate struct { - *DedicatedHostGroupProperties `json:"properties,omitempty"` - // Zones - 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 `json:"zones,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. -func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhgu.DedicatedHostGroupProperties != nil { - objectMap["properties"] = dhgu.DedicatedHostGroupProperties - } - if dhgu.Zones != nil { - objectMap["zones"] = dhgu.Zones - } - if dhgu.Tags != nil { - objectMap["tags"] = dhgu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. -func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dedicatedHostGroupProperties DedicatedHostGroupProperties - err = json.Unmarshal(*v, &dedicatedHostGroupProperties) - if err != nil { - return err - } - dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - dhgu.Zones = &zones - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhgu.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostInstanceView the instance view of a dedicated host. -type DedicatedHostInstanceView struct { - // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string `json:"assetId,omitempty"` - // AvailableCapacity - Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. -func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhiv.AvailableCapacity != nil { - objectMap["availableCapacity"] = dhiv.AvailableCapacity - } - if dhiv.Statuses != nil { - objectMap["statuses"] = dhiv.Statuses - } - return json.Marshal(objectMap) -} - -// 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 { - // Name - READ-ONLY; The name of the dedicated host. - Name *string `json:"name,omitempty"` - // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string `json:"assetId,omitempty"` - // AvailableCapacity - Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. -func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhivwn.AvailableCapacity != nil { - objectMap["availableCapacity"] = dhivwn.AvailableCapacity - } - if dhivwn.Statuses != nil { - objectMap["statuses"] = dhivwn.Statuses - } - return json.Marshal(objectMap) -} - -// DedicatedHostListResult the list dedicated host operation response. -type DedicatedHostListResult struct { - autorest.Response `json:"-"` - // Value - The list of dedicated hosts - Value *[]DedicatedHost `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. -type DedicatedHostListResultIterator struct { - i int - page DedicatedHostListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DedicatedHostListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DedicatedHostListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DedicatedHostListResultIterator) Value() DedicatedHost { - if !iter.page.NotDone() { - return DedicatedHost{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DedicatedHostListResultIterator type. -func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { - return DedicatedHostListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dhlr DedicatedHostListResult) IsEmpty() bool { - return dhlr.Value == nil || len(*dhlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dhlr DedicatedHostListResult) hasNextLink() bool { - return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 -} - -// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dhlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dhlr.NextLink))) -} - -// DedicatedHostListResultPage contains a page of DedicatedHost values. -type DedicatedHostListResultPage struct { - fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) - dhlr DedicatedHostListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dhlr) - if err != nil { - return err - } - page.dhlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DedicatedHostListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DedicatedHostListResultPage) NotDone() bool { - return !page.dhlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { - return page.dhlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DedicatedHostListResultPage) Values() []DedicatedHost { - if page.dhlr.IsEmpty() { - return nil - } - return *page.dhlr.Value -} - -// Creates a new instance of the DedicatedHostListResultPage type. -func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { - return DedicatedHostListResultPage{ - fn: getNextPage, - dhlr: cur, - } -} - -// DedicatedHostProperties properties of the dedicated host. -type DedicatedHostProperties struct { - // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // AutoReplaceOnFailure - 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 `json:"autoReplaceOnFailure,omitempty"` - // HostID - 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 `json:"hostId,omitempty"` - // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. - VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` - // LicenseType - Specifies the software license type that will be applied to the VMs deployed on the dedicated host.

    Possible values are:

    **None**

    **Windows_Server_Hybrid**

    **Windows_Server_Perpetual**

    Default: **None**. Possible values include: 'DedicatedHostLicenseTypesNone', 'DedicatedHostLicenseTypesWindowsServerHybrid', 'DedicatedHostLicenseTypesWindowsServerPerpetual' - LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` - // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. - ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The dedicated host instance view. - InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` - // TimeCreated - READ-ONLY; Specifies the time at which the Dedicated Host resource was created.

    Minimum api-version: 2021-11-01. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostProperties. -func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhp.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain - } - if dhp.AutoReplaceOnFailure != nil { - objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure - } - if dhp.LicenseType != "" { - objectMap["licenseType"] = dhp.LicenseType - } - return json.Marshal(objectMap) -} - -// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DedicatedHostsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (DedicatedHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. -func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { - dh, err = client.CreateOrUpdateResponder(dh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") - } - } - return -} - -// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsDeleteFuture.Result. -func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DedicatedHostsRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsRestartFuture.Result. -func (future *DedicatedHostsRestartFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (DedicatedHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsUpdateFuture.Result. -func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { - dh, err = client.UpdateResponder(dh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") - } - } - return -} - -// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and -// licenseType may be updated. -type DedicatedHostUpdate struct { - *DedicatedHostProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostUpdate. -func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhu.DedicatedHostProperties != nil { - objectMap["properties"] = dhu.DedicatedHostProperties - } - if dhu.Tags != nil { - objectMap["tags"] = dhu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. -func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dedicatedHostProperties DedicatedHostProperties - err = json.Unmarshal(*v, &dedicatedHostProperties) - if err != nil { - return err - } - dhu.DedicatedHostProperties = &dedicatedHostProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhu.Tags = tags - } - } - } - - return nil -} - -// DiagnosticsProfile specifies the boot diagnostic settings state.

    Minimum api-version: -// 2015-06-15. -type DiagnosticsProfile struct { - // BootDiagnostics - 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 `json:"bootDiagnostics,omitempty"` -} - -// 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 { - // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' - Option DiffDiskOptions `json:"option,omitempty"` - // Placement - Specifies the ephemeral disk placement for operating system disk.

    Possible values are:

    **CacheDisk**

    **ResourceDisk**

    Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used.

    Refer to 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. Possible values include: 'CacheDisk', 'ResourceDisk' - Placement DiffDiskPlacement `json:"placement,omitempty"` -} - -// Disallowed describes the disallowed disk types. -type Disallowed struct { - // DiskTypes - A list of disk types. - DiskTypes *[]string `json:"diskTypes,omitempty"` -} - -// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. -type DisallowedConfiguration struct { - // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' - VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` -} - -// Disk disk resource. -type Disk struct { - autorest.Response `json:"-"` - // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - ManagedBy *string `json:"managedBy,omitempty"` - // ManagedByExtended - 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 `json:"managedByExtended,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` - // Zones - The Logical zone list for Disk. - Zones *[]string `json:"zones,omitempty"` - // ExtendedLocation - The extended location where the disk will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - *DiskProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Disk. -func (d Disk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.Sku != nil { - objectMap["sku"] = d.Sku - } - if d.Zones != nil { - objectMap["zones"] = d.Zones - } - if d.ExtendedLocation != nil { - objectMap["extendedLocation"] = d.ExtendedLocation - } - if d.DiskProperties != nil { - objectMap["properties"] = d.DiskProperties - } - if d.Location != nil { - objectMap["location"] = d.Location - } - if d.Tags != nil { - objectMap["tags"] = d.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Disk struct. -func (d *Disk) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "managedBy": - if v != nil { - var managedBy string - err = json.Unmarshal(*v, &managedBy) - if err != nil { - return err - } - d.ManagedBy = &managedBy - } - case "managedByExtended": - if v != nil { - var managedByExtended []string - err = json.Unmarshal(*v, &managedByExtended) - if err != nil { - return err - } - d.ManagedByExtended = &managedByExtended - } - case "sku": - if v != nil { - var sku DiskSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - d.Sku = &sku - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - d.Zones = &zones - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - d.ExtendedLocation = &extendedLocation - } - case "properties": - if v != nil { - var diskProperties DiskProperties - err = json.Unmarshal(*v, &diskProperties) - if err != nil { - return err - } - d.DiskProperties = &diskProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - d.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - d.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - d.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - d.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - d.Tags = tags - } - } - } - - return nil -} - -// DiskAccess disk access resource. -type DiskAccess struct { - autorest.Response `json:"-"` - *DiskAccessProperties `json:"properties,omitempty"` - // ExtendedLocation - The extended location where the disk access will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DiskAccess. -func (da DiskAccess) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if da.DiskAccessProperties != nil { - objectMap["properties"] = da.DiskAccessProperties - } - if da.ExtendedLocation != nil { - objectMap["extendedLocation"] = da.ExtendedLocation - } - if da.Location != nil { - objectMap["location"] = da.Location - } - if da.Tags != nil { - objectMap["tags"] = da.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskAccess struct. -func (da *DiskAccess) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var diskAccessProperties DiskAccessProperties - err = json.Unmarshal(*v, &diskAccessProperties) - if err != nil { - return err - } - da.DiskAccessProperties = &diskAccessProperties - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - da.ExtendedLocation = &extendedLocation - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - da.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - da.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - da.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - da.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - da.Tags = tags - } - } - } - - return nil -} - -// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskAccessesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (DiskAccess, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesCreateOrUpdateFuture.Result. -func (future *DiskAccessesCreateOrUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - da.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { - da, err = client.CreateOrUpdateResponder(da.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", da.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskAccessesDeleteAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type DiskAccessesDeleteAPrivateEndpointConnectionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesDeleteAPrivateEndpointConnectionFuture.Result. -func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskAccessesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DiskAccessesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesDeleteFuture.Result. -func (future *DiskAccessesDeleteFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskAccessesUpdateAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type DiskAccessesUpdateAPrivateEndpointConnectionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (PrivateEndpointConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesUpdateAPrivateEndpointConnectionFuture.Result. -func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (pec PrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pec.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { - pec, err = client.UpdateAPrivateEndpointConnectionResponder(pec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", pec.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskAccessesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DiskAccessesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskAccessesClient) (DiskAccess, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskAccessesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskAccessesUpdateFuture.Result. -func (future *DiskAccessesUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - da.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { - da, err = client.UpdateResponder(da.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", da.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskAccessList the List disk access operation response. -type DiskAccessList struct { - autorest.Response `json:"-"` - // Value - A list of disk access resources. - Value *[]DiskAccess `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// DiskAccessListIterator provides access to a complete listing of DiskAccess values. -type DiskAccessListIterator struct { - i int - page DiskAccessListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskAccessListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskAccessListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskAccessListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DiskAccessListIterator) Response() DiskAccessList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DiskAccessListIterator) Value() DiskAccess { - if !iter.page.NotDone() { - return DiskAccess{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskAccessListIterator type. -func NewDiskAccessListIterator(page DiskAccessListPage) DiskAccessListIterator { - return DiskAccessListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dal DiskAccessList) IsEmpty() bool { - return dal.Value == nil || len(*dal.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dal DiskAccessList) hasNextLink() bool { - return dal.NextLink != nil && len(*dal.NextLink) != 0 -} - -// diskAccessListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dal DiskAccessList) diskAccessListPreparer(ctx context.Context) (*http.Request, error) { - if !dal.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dal.NextLink))) -} - -// DiskAccessListPage contains a page of DiskAccess values. -type DiskAccessListPage struct { - fn func(context.Context, DiskAccessList) (DiskAccessList, error) - dal DiskAccessList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskAccessListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dal) - if err != nil { - return err - } - page.dal = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskAccessListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskAccessListPage) NotDone() bool { - return !page.dal.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskAccessListPage) Response() DiskAccessList { - return page.dal -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskAccessListPage) Values() []DiskAccess { - if page.dal.IsEmpty() { - return nil - } - return *page.dal.Value -} - -// Creates a new instance of the DiskAccessListPage type. -func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { - return DiskAccessListPage{ - fn: getNextPage, - dal: cur, - } -} - -// DiskAccessProperties ... -type DiskAccessProperties struct { - // PrivateEndpointConnections - READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // ProvisioningState - READ-ONLY; The disk access resource provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // TimeCreated - READ-ONLY; The time when the disk access was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskAccessProperties. -func (dap DiskAccessProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DiskAccessUpdate used for updating a disk access resource. -type DiskAccessUpdate struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DiskAccessUpdate. -func (dau DiskAccessUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dau.Tags != nil { - objectMap["tags"] = dau.Tags - } - return json.Marshal(objectMap) -} - -// DiskEncryptionSet disk encryption set resource. -type DiskEncryptionSet struct { - autorest.Response `json:"-"` - Identity *EncryptionSetIdentity `json:"identity,omitempty"` - *EncryptionSetProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DiskEncryptionSet. -func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desVar.Identity != nil { - objectMap["identity"] = desVar.Identity - } - if desVar.EncryptionSetProperties != nil { - objectMap["properties"] = desVar.EncryptionSetProperties - } - if desVar.Location != nil { - objectMap["location"] = desVar.Location - } - if desVar.Tags != nil { - objectMap["tags"] = desVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. -func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "identity": - if v != nil { - var identity EncryptionSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - desVar.Identity = &identity - } - case "properties": - if v != nil { - var encryptionSetProperties EncryptionSetProperties - err = json.Unmarshal(*v, &encryptionSetProperties) - if err != nil { - return err - } - desVar.EncryptionSetProperties = &encryptionSetProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - desVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - desVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - desVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - desVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - desVar.Tags = tags - } - } - } - - return nil -} - -// DiskEncryptionSetList the List disk encryption set operation response. -type DiskEncryptionSetList struct { - autorest.Response `json:"-"` - // Value - A list of disk encryption sets. - Value *[]DiskEncryptionSet `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. -type DiskEncryptionSetListIterator struct { - i int - page DiskEncryptionSetListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskEncryptionSetListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskEncryptionSetListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { - if !iter.page.NotDone() { - return DiskEncryptionSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskEncryptionSetListIterator type. -func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { - return DiskEncryptionSetListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (desl DiskEncryptionSetList) IsEmpty() bool { - return desl.Value == nil || len(*desl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (desl DiskEncryptionSetList) hasNextLink() bool { - return desl.NextLink != nil && len(*desl.NextLink) != 0 -} - -// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { - if !desl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(desl.NextLink))) -} - -// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. -type DiskEncryptionSetListPage struct { - fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) - desl DiskEncryptionSetList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.desl) - if err != nil { - return err - } - page.desl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskEncryptionSetListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskEncryptionSetListPage) NotDone() bool { - return !page.desl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { - return page.desl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { - if page.desl.IsEmpty() { - return nil - } - return *page.desl.Value -} - -// Creates a new instance of the DiskEncryptionSetListPage type. -func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { - return DiskEncryptionSetListPage{ - fn: getNextPage, - desl: cur, - } -} - -// 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 { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - desVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { - desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. -func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. -func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - desVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { - desVar, err = client.UpdateResponder(desVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskEncryptionSettings describes a Encryption Settings for a Disk -type DiskEncryptionSettings struct { - // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. - DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. - KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` - // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. - Enabled *bool `json:"enabled,omitempty"` -} - -// DiskEncryptionSetUpdate disk encryption set update resource. -type DiskEncryptionSetUpdate struct { - *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - Identity *EncryptionSetIdentity `json:"identity,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. -func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desu.DiskEncryptionSetUpdateProperties != nil { - objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties - } - if desu.Tags != nil { - objectMap["tags"] = desu.Tags - } - if desu.Identity != nil { - objectMap["identity"] = desu.Identity - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. -func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties - err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) - if err != nil { - return err - } - desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - desu.Tags = tags - } - case "identity": - if v != nil { - var identity EncryptionSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - desu.Identity = &identity - } - } - } - - return nil -} - -// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. -type DiskEncryptionSetUpdateProperties struct { - // EncryptionType - Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys', 'ConfidentialVMEncryptedWithCustomerKey' - EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` - ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` - // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` - // FederatedClientID - Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. - FederatedClientID *string `json:"federatedClientId,omitempty"` -} - -// DiskImageEncryption this is the disk image encryption base class. -type DiskImageEncryption struct { - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// DiskInstanceView the instance view of the disk. -type DiskInstanceView struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // EncryptionSettings - Specifies the encryption settings for the OS Disk.

    Minimum api-version: 2015-06-15 - EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// DiskList the List Disks operation response. -type DiskList struct { - autorest.Response `json:"-"` - // Value - A list of disks. - Value *[]Disk `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskListIterator provides access to a complete listing of Disk values. -type DiskListIterator struct { - i int - page DiskListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DiskListIterator) Response() DiskList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DiskListIterator) Value() Disk { - if !iter.page.NotDone() { - return Disk{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskListIterator type. -func NewDiskListIterator(page DiskListPage) DiskListIterator { - return DiskListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dl DiskList) IsEmpty() bool { - return dl.Value == nil || len(*dl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dl DiskList) hasNextLink() bool { - return dl.NextLink != nil && len(*dl.NextLink) != 0 -} - -// diskListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { - if !dl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dl.NextLink))) -} - -// DiskListPage contains a page of Disk values. -type DiskListPage struct { - fn func(context.Context, DiskList) (DiskList, error) - dl DiskList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dl) - if err != nil { - return err - } - page.dl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskListPage) NotDone() bool { - return !page.dl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskListPage) Response() DiskList { - return page.dl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskListPage) Values() []Disk { - if page.dl.IsEmpty() { - return nil - } - return *page.dl.Value -} - -// Creates a new instance of the DiskListPage type. -func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { - return DiskListPage{ - fn: getNextPage, - dl: cur, - } -} - -// DiskProperties disk resource properties. -type DiskProperties struct { - // TimeCreated - READ-ONLY; The time when the disk was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - // SupportedCapabilities - List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - // UniqueID - READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // ProvisioningState - READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - 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 `json:"diskMBpsReadWrite,omitempty"` - // DiskIOPSReadOnly - 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 `json:"diskIOPSReadOnly,omitempty"` - // DiskMBpsReadOnly - 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 `json:"diskMBpsReadOnly,omitempty"` - // DiskState - The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' - DiskState DiskState `json:"diskState,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // MaxShares - 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 `json:"maxShares,omitempty"` - // ShareInfo - 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 `json:"shareInfo,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // BurstingEnabledTime - READ-ONLY; Latest time when bursting was last enabled on a disk. - BurstingEnabledTime *date.Time `json:"burstingEnabledTime,omitempty"` - // Tier - 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 `json:"tier,omitempty"` - // BurstingEnabled - 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 `json:"burstingEnabled,omitempty"` - // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` - // SupportsHibernation - Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // SecurityProfile - Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` - // CompletionPercent - Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float64 `json:"completionPercent,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone' - DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - // OptimizedForFrequentAttach - 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 `json:"optimizedForFrequentAttach,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskProperties. -func (dp DiskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.OsType != "" { - objectMap["osType"] = dp.OsType - } - if dp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = dp.HyperVGeneration - } - if dp.PurchasePlan != nil { - objectMap["purchasePlan"] = dp.PurchasePlan - } - if dp.SupportedCapabilities != nil { - objectMap["supportedCapabilities"] = dp.SupportedCapabilities - } - if dp.CreationData != nil { - objectMap["creationData"] = dp.CreationData - } - if dp.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dp.DiskSizeGB - } - if dp.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection - } - if dp.DiskIOPSReadWrite != nil { - objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite - } - if dp.DiskMBpsReadWrite != nil { - objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite - } - if dp.DiskIOPSReadOnly != nil { - objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly - } - if dp.DiskMBpsReadOnly != nil { - objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly - } - if dp.DiskState != "" { - objectMap["diskState"] = dp.DiskState - } - if dp.Encryption != nil { - objectMap["encryption"] = dp.Encryption - } - if dp.MaxShares != nil { - objectMap["maxShares"] = dp.MaxShares - } - if dp.NetworkAccessPolicy != "" { - objectMap["networkAccessPolicy"] = dp.NetworkAccessPolicy - } - if dp.DiskAccessID != nil { - objectMap["diskAccessId"] = dp.DiskAccessID - } - if dp.Tier != nil { - objectMap["tier"] = dp.Tier - } - if dp.BurstingEnabled != nil { - objectMap["burstingEnabled"] = dp.BurstingEnabled - } - if dp.SupportsHibernation != nil { - objectMap["supportsHibernation"] = dp.SupportsHibernation - } - if dp.SecurityProfile != nil { - objectMap["securityProfile"] = dp.SecurityProfile - } - if dp.CompletionPercent != nil { - objectMap["completionPercent"] = dp.CompletionPercent - } - if dp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = dp.PublicNetworkAccess - } - if dp.DataAccessAuthMode != "" { - objectMap["dataAccessAuthMode"] = dp.DataAccessAuthMode - } - if dp.OptimizedForFrequentAttach != nil { - objectMap["optimizedForFrequentAttach"] = dp.OptimizedForFrequentAttach - } - return json.Marshal(objectMap) -} - -// DiskRestorePoint properties of disk restore point -type DiskRestorePoint struct { - autorest.Response `json:"-"` - *DiskRestorePointProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskRestorePoint. -func (drp DiskRestorePoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if drp.DiskRestorePointProperties != nil { - objectMap["properties"] = drp.DiskRestorePointProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskRestorePoint struct. -func (drp *DiskRestorePoint) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var diskRestorePointProperties DiskRestorePointProperties - err = json.Unmarshal(*v, &diskRestorePointProperties) - if err != nil { - return err - } - drp.DiskRestorePointProperties = &diskRestorePointProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - drp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - drp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - drp.Type = &typeVar - } - } - } - - return nil -} - -// DiskRestorePointGrantAccessFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskRestorePointGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskRestorePointClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskRestorePointGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskRestorePointGrantAccessFuture.Result. -func (future *DiskRestorePointGrantAccessFuture) result(client DiskRestorePointClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskRestorePointInstanceView the instance view of a disk restore point. -type DiskRestorePointInstanceView struct { - // ID - Disk restore point Id. - ID *string `json:"id,omitempty"` - // ReplicationStatus - The disk restore point replication status information. - ReplicationStatus *DiskRestorePointReplicationStatus `json:"replicationStatus,omitempty"` -} - -// DiskRestorePointList the List Disk Restore Points operation response. -type DiskRestorePointList struct { - autorest.Response `json:"-"` - // Value - A list of disk restore points. - Value *[]DiskRestorePoint `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// DiskRestorePointListIterator provides access to a complete listing of DiskRestorePoint values. -type DiskRestorePointListIterator struct { - i int - page DiskRestorePointListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskRestorePointListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskRestorePointListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskRestorePointListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DiskRestorePointListIterator) Response() DiskRestorePointList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DiskRestorePointListIterator) Value() DiskRestorePoint { - if !iter.page.NotDone() { - return DiskRestorePoint{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskRestorePointListIterator type. -func NewDiskRestorePointListIterator(page DiskRestorePointListPage) DiskRestorePointListIterator { - return DiskRestorePointListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (drpl DiskRestorePointList) IsEmpty() bool { - return drpl.Value == nil || len(*drpl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (drpl DiskRestorePointList) hasNextLink() bool { - return drpl.NextLink != nil && len(*drpl.NextLink) != 0 -} - -// diskRestorePointListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (drpl DiskRestorePointList) diskRestorePointListPreparer(ctx context.Context) (*http.Request, error) { - if !drpl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(drpl.NextLink))) -} - -// DiskRestorePointListPage contains a page of DiskRestorePoint values. -type DiskRestorePointListPage struct { - fn func(context.Context, DiskRestorePointList) (DiskRestorePointList, error) - drpl DiskRestorePointList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskRestorePointListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.drpl) - if err != nil { - return err - } - page.drpl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskRestorePointListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskRestorePointListPage) NotDone() bool { - return !page.drpl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskRestorePointListPage) Response() DiskRestorePointList { - return page.drpl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskRestorePointListPage) Values() []DiskRestorePoint { - if page.drpl.IsEmpty() { - return nil - } - return *page.drpl.Value -} - -// Creates a new instance of the DiskRestorePointListPage type. -func NewDiskRestorePointListPage(cur DiskRestorePointList, getNextPage func(context.Context, DiskRestorePointList) (DiskRestorePointList, error)) DiskRestorePointListPage { - return DiskRestorePointListPage{ - fn: getNextPage, - drpl: cur, - } -} - -// DiskRestorePointProperties properties of an incremental disk restore point -type DiskRestorePointProperties struct { - // TimeCreated - READ-ONLY; The timestamp of restorePoint creation - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // SourceResourceID - READ-ONLY; arm id of source disk or source disk restore point. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // OsType - READ-ONLY; The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - // SupportedCapabilities - List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - // FamilyID - READ-ONLY; id of the backing snapshot's MIS family - FamilyID *string `json:"familyId,omitempty"` - // SourceUniqueID - READ-ONLY; unique incarnation id of the source disk - SourceUniqueID *string `json:"sourceUniqueId,omitempty"` - // Encryption - READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // SupportsHibernation - Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // CompletionPercent - Percentage complete for the background copy of disk restore point when source resource is from a different region. - CompletionPercent *float64 `json:"completionPercent,omitempty"` - // ReplicationState - READ-ONLY; Replication state of disk restore point when source resource is from a different region. - ReplicationState *string `json:"replicationState,omitempty"` - // SourceResourceLocation - READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region. - SourceResourceLocation *string `json:"sourceResourceLocation,omitempty"` - // SecurityProfile - Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskRestorePointProperties. -func (drpp DiskRestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if drpp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = drpp.HyperVGeneration - } - if drpp.PurchasePlan != nil { - objectMap["purchasePlan"] = drpp.PurchasePlan - } - if drpp.SupportedCapabilities != nil { - objectMap["supportedCapabilities"] = drpp.SupportedCapabilities - } - if drpp.SupportsHibernation != nil { - objectMap["supportsHibernation"] = drpp.SupportsHibernation - } - if drpp.NetworkAccessPolicy != "" { - objectMap["networkAccessPolicy"] = drpp.NetworkAccessPolicy - } - if drpp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = drpp.PublicNetworkAccess - } - if drpp.DiskAccessID != nil { - objectMap["diskAccessId"] = drpp.DiskAccessID - } - if drpp.CompletionPercent != nil { - objectMap["completionPercent"] = drpp.CompletionPercent - } - if drpp.SecurityProfile != nil { - objectMap["securityProfile"] = drpp.SecurityProfile - } - return json.Marshal(objectMap) -} - -// DiskRestorePointReplicationStatus the instance view of a disk restore point. -type DiskRestorePointReplicationStatus struct { - // Status - The resource status information. - Status *InstanceViewStatus `json:"status,omitempty"` - // CompletionPercent - Replication completion percentage. - CompletionPercent *int32 `json:"completionPercent,omitempty"` -} - -// DiskRestorePointRevokeAccessFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskRestorePointRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskRestorePointClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskRestorePointRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskRestorePointRevokeAccessFuture.Result. -func (future *DiskRestorePointRevokeAccessFuture) result(client DiskRestorePointClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskRestorePointRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (Disk, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksCreateOrUpdateFuture.Result. -func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.CreateOrUpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DisksDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksDeleteFuture.Result. -func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskSecurityProfile contains the security related information for the resource. -type DiskSecurityProfile struct { - // SecurityType - Possible values include: 'TrustedLaunch', 'ConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey', 'ConfidentialVMDiskEncryptedWithPlatformKey', 'ConfidentialVMDiskEncryptedWithCustomerKey' - SecurityType DiskSecurityTypes `json:"securityType,omitempty"` - // SecureVMDiskEncryptionSetID - ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key - SecureVMDiskEncryptionSetID *string `json:"secureVMDiskEncryptionSetId,omitempty"` -} - -// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksGrantAccessFuture.Result. -func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, -// Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS. -type DiskSku struct { - // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS', 'PremiumZRS', 'StandardSSDZRS', 'PremiumV2LRS' - Name DiskStorageAccountTypes `json:"name,omitempty"` - // Tier - READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskSku. -func (ds DiskSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ds.Name != "" { - objectMap["name"] = ds.Name - } - return json.Marshal(objectMap) -} - -// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksRevokeAccessFuture.Result. -func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DisksUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (Disk, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksUpdateFuture.Result. -func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.UpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskUpdate disk update resource. -type DiskUpdate struct { - *DiskUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - Sku *DiskSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskUpdate. -func (du DiskUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if du.DiskUpdateProperties != nil { - objectMap["properties"] = du.DiskUpdateProperties - } - if du.Tags != nil { - objectMap["tags"] = du.Tags - } - if du.Sku != nil { - objectMap["sku"] = du.Sku - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. -func (du *DiskUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var diskUpdateProperties DiskUpdateProperties - err = json.Unmarshal(*v, &diskUpdateProperties) - if err != nil { - return err - } - du.DiskUpdateProperties = &diskUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - du.Tags = tags - } - case "sku": - if v != nil { - var sku DiskSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - du.Sku = &sku - } - } - } - - return nil -} - -// DiskUpdateProperties disk resource update properties. -type DiskUpdateProperties struct { - // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - 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 `json:"diskMBpsReadWrite,omitempty"` - // DiskIOPSReadOnly - 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 `json:"diskIOPSReadOnly,omitempty"` - // DiskMBpsReadOnly - 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 `json:"diskMBpsReadOnly,omitempty"` - // MaxShares - 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 `json:"maxShares,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // Tier - 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 `json:"tier,omitempty"` - // BurstingEnabled - 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 `json:"burstingEnabled,omitempty"` - // PurchasePlan - Purchase plan information to be added on the OS disk - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - // SupportedCapabilities - List of supported capabilities to be added on the OS disk. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. - PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` - // SupportsHibernation - Indicates the OS on a disk supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone' - DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - // OptimizedForFrequentAttach - 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 `json:"optimizedForFrequentAttach,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskUpdateProperties. -func (dup DiskUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dup.OsType != "" { - objectMap["osType"] = dup.OsType - } - if dup.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dup.DiskSizeGB - } - if dup.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = dup.EncryptionSettingsCollection - } - if dup.DiskIOPSReadWrite != nil { - objectMap["diskIOPSReadWrite"] = dup.DiskIOPSReadWrite - } - if dup.DiskMBpsReadWrite != nil { - objectMap["diskMBpsReadWrite"] = dup.DiskMBpsReadWrite - } - if dup.DiskIOPSReadOnly != nil { - objectMap["diskIOPSReadOnly"] = dup.DiskIOPSReadOnly - } - if dup.DiskMBpsReadOnly != nil { - objectMap["diskMBpsReadOnly"] = dup.DiskMBpsReadOnly - } - if dup.MaxShares != nil { - objectMap["maxShares"] = dup.MaxShares - } - if dup.Encryption != nil { - objectMap["encryption"] = dup.Encryption - } - if dup.NetworkAccessPolicy != "" { - objectMap["networkAccessPolicy"] = dup.NetworkAccessPolicy - } - if dup.DiskAccessID != nil { - objectMap["diskAccessId"] = dup.DiskAccessID - } - if dup.Tier != nil { - objectMap["tier"] = dup.Tier - } - if dup.BurstingEnabled != nil { - objectMap["burstingEnabled"] = dup.BurstingEnabled - } - if dup.PurchasePlan != nil { - objectMap["purchasePlan"] = dup.PurchasePlan - } - if dup.SupportedCapabilities != nil { - objectMap["supportedCapabilities"] = dup.SupportedCapabilities - } - if dup.SupportsHibernation != nil { - objectMap["supportsHibernation"] = dup.SupportsHibernation - } - if dup.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = dup.PublicNetworkAccess - } - if dup.DataAccessAuthMode != "" { - objectMap["dataAccessAuthMode"] = dup.DataAccessAuthMode - } - if dup.OptimizedForFrequentAttach != nil { - objectMap["optimizedForFrequentAttach"] = dup.OptimizedForFrequentAttach - } - return json.Marshal(objectMap) -} - -// Encryption encryption at rest settings for disk or snapshot -type Encryption struct { - // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` - // Type - Possible values include: 'EncryptionTypeEncryptionAtRestWithPlatformKey', 'EncryptionTypeEncryptionAtRestWithCustomerKey', 'EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys' - Type EncryptionType `json:"type,omitempty"` -} - -// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data -// disks in the gallery artifact. -type EncryptionImages struct { - OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of encryption specifications for data disk images. - DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` -} - -// 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 { - // Type - 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. Possible values include: 'DiskEncryptionSetIdentityTypeSystemAssigned', 'DiskEncryptionSetIdentityTypeUserAssigned', 'DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned', 'DiskEncryptionSetIdentityTypeNone' - Type DiskEncryptionSetIdentityType `json:"type,omitempty"` - // PrincipalID - 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 `json:"principalId,omitempty"` - // TenantID - 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 `json:"tenantId,omitempty"` - // UserAssignedIdentities - 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 `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for EncryptionSetIdentity. -func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esi.Type != "" { - objectMap["type"] = esi.Type - } - if esi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = esi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// EncryptionSetProperties ... -type EncryptionSetProperties struct { - // EncryptionType - Possible values include: 'EncryptionAtRestWithCustomerKey', 'EncryptionAtRestWithPlatformAndCustomerKeys', 'ConfidentialVMEncryptedWithCustomerKey' - EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` - // ActiveKey - The key vault key which is currently used by this disk encryption set. - ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` - // PreviousKeys - 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 `json:"previousKeys,omitempty"` - // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. - RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` - // LastKeyRotationTimestamp - READ-ONLY; The time when the active key of this disk encryption set was updated. - LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"` - // AutoKeyRotationError - 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 `json:"autoKeyRotationError,omitempty"` - // FederatedClientID - Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property. - FederatedClientID *string `json:"federatedClientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for EncryptionSetProperties. -func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esp.EncryptionType != "" { - objectMap["encryptionType"] = esp.EncryptionType - } - if esp.ActiveKey != nil { - objectMap["activeKey"] = esp.ActiveKey - } - if esp.RotationToLatestKeyVersionEnabled != nil { - objectMap["rotationToLatestKeyVersionEnabled"] = esp.RotationToLatestKeyVersionEnabled - } - if esp.FederatedClientID != nil { - objectMap["federatedClientId"] = esp.FederatedClientID - } - return json.Marshal(objectMap) -} - -// EncryptionSettingsCollection encryption settings for disk or snapshot -type EncryptionSettingsCollection struct { - // Enabled - 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 `json:"enabled,omitempty"` - // EncryptionSettings - A collection of encryption settings, one for each disk volume. - EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` - // EncryptionSettingsVersion - 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 `json:"encryptionSettingsVersion,omitempty"` -} - -// EncryptionSettingsElement encryption settings for one disk volume. -type EncryptionSettingsElement struct { - // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key - DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - 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 `json:"keyEncryptionKey,omitempty"` -} - -// ExtendedLocation the complex type of the extended location. -type ExtendedLocation struct { - // Name - The name of the extended location. - Name *string `json:"name,omitempty"` - // Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone' - Type ExtendedLocationTypes `json:"type,omitempty"` -} - -// Extension describes a cloud service Extension. -type Extension struct { - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - Properties *CloudServiceExtensionProperties `json:"properties,omitempty"` -} - -// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (Gallery, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. -func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - g.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { - g, err = client.CreateOrUpdateResponder(g.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesDeleteFuture.Result. -func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (Gallery, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesUpdateFuture.Result. -func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - g.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { - g, err = client.UpdateResponder(g.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") - } - } - return -} - -// Gallery specifies information about the Shared Image Gallery that you want to create or update. -type Gallery struct { - autorest.Response `json:"-"` - *GalleryProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Gallery. -func (g Gallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if g.GalleryProperties != nil { - objectMap["properties"] = g.GalleryProperties - } - if g.Location != nil { - objectMap["location"] = g.Location - } - if g.Tags != nil { - objectMap["tags"] = g.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Gallery struct. -func (g *Gallery) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryProperties GalleryProperties - err = json.Unmarshal(*v, &galleryProperties) - if err != nil { - return err - } - g.GalleryProperties = &galleryProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - g.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - g.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - g.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - g.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - g.Tags = tags - } - } - } - - return nil -} - -// GalleryApplication specifies information about the gallery Application Definition that you want to -// create or update. -type GalleryApplication struct { - autorest.Response `json:"-"` - *GalleryApplicationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplication. -func (ga GalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ga.GalleryApplicationProperties != nil { - objectMap["properties"] = ga.GalleryApplicationProperties - } - if ga.Location != nil { - objectMap["location"] = ga.Location - } - if ga.Tags != nil { - objectMap["tags"] = ga.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. -func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryApplicationProperties GalleryApplicationProperties - err = json.Unmarshal(*v, &galleryApplicationProperties) - if err != nil { - return err - } - ga.GalleryApplicationProperties = &galleryApplicationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ga.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ga.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ga.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ga.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ga.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationList the List Gallery Applications operation response. -type GalleryApplicationList struct { - autorest.Response `json:"-"` - // Value - A list of Gallery Applications. - Value *[]GalleryApplication `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. -type GalleryApplicationListIterator struct { - i int - page GalleryApplicationListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryApplicationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryApplicationListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryApplicationListIterator) Value() GalleryApplication { - if !iter.page.NotDone() { - return GalleryApplication{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryApplicationListIterator type. -func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { - return GalleryApplicationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gal GalleryApplicationList) IsEmpty() bool { - return gal.Value == nil || len(*gal.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gal GalleryApplicationList) hasNextLink() bool { - return gal.NextLink != nil && len(*gal.NextLink) != 0 -} - -// galleryApplicationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { - if !gal.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gal.NextLink))) -} - -// GalleryApplicationListPage contains a page of GalleryApplication values. -type GalleryApplicationListPage struct { - fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) - gal GalleryApplicationList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gal) - if err != nil { - return err - } - page.gal = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryApplicationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryApplicationListPage) NotDone() bool { - return !page.gal.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryApplicationListPage) Response() GalleryApplicationList { - return page.gal -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryApplicationListPage) Values() []GalleryApplication { - if page.gal.IsEmpty() { - return nil - } - return *page.gal.Value -} - -// Creates a new instance of the GalleryApplicationListPage type. -func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { - return GalleryApplicationListPage{ - fn: getNextPage, - gal: cur, - } -} - -// GalleryApplicationProperties describes the properties of a gallery Application Definition. -type GalleryApplicationProperties struct { - // Description - The description of this gallery Application Definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - // Eula - The Eula agreement for the gallery Application Definition. - Eula *string `json:"eula,omitempty"` - // PrivacyStatementURI - The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // ReleaseNoteURI - The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // SupportedOSType - This property allows you to specify the supported type of the OS that application is built for.

    Possible values are:

    **Windows**

    **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` -} - -// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (GalleryApplication, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. -func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ga.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { - ga, err = client.CreateOrUpdateResponder(ga.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsDeleteFuture.Result. -func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (GalleryApplication, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsUpdateFuture.Result. -func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ga.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { - ga, err = client.UpdateResponder(ga.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to -// update. -type GalleryApplicationUpdate struct { - *GalleryApplicationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. -func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gau.GalleryApplicationProperties != nil { - objectMap["properties"] = gau.GalleryApplicationProperties - } - if gau.Tags != nil { - objectMap["tags"] = gau.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. -func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryApplicationProperties GalleryApplicationProperties - err = json.Unmarshal(*v, &galleryApplicationProperties) - if err != nil { - return err - } - gau.GalleryApplicationProperties = &galleryApplicationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gau.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gau.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gau.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gau.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationVersion specifies information about the gallery Application Version that you want to -// create or update. -type GalleryApplicationVersion struct { - autorest.Response `json:"-"` - *GalleryApplicationVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersion. -func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gav.GalleryApplicationVersionProperties != nil { - objectMap["properties"] = gav.GalleryApplicationVersionProperties - } - if gav.Location != nil { - objectMap["location"] = gav.Location - } - if gav.Tags != nil { - objectMap["tags"] = gav.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. -func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryApplicationVersionProperties GalleryApplicationVersionProperties - err = json.Unmarshal(*v, &galleryApplicationVersionProperties) - if err != nil { - return err - } - gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gav.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gav.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gav.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gav.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gav.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationVersionList the List Gallery Application version operation response. -type GalleryApplicationVersionList struct { - autorest.Response `json:"-"` - // Value - A list of gallery Application Versions. - Value *[]GalleryApplicationVersion `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion -// values. -type GalleryApplicationVersionListIterator struct { - i int - page GalleryApplicationVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryApplicationVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryApplicationVersionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { - if !iter.page.NotDone() { - return GalleryApplicationVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryApplicationVersionListIterator type. -func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { - return GalleryApplicationVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gavl GalleryApplicationVersionList) IsEmpty() bool { - return gavl.Value == nil || len(*gavl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gavl GalleryApplicationVersionList) hasNextLink() bool { - return gavl.NextLink != nil && len(*gavl.NextLink) != 0 -} - -// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !gavl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gavl.NextLink))) -} - -// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. -type GalleryApplicationVersionListPage struct { - fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) - gavl GalleryApplicationVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gavl) - if err != nil { - return err - } - page.gavl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryApplicationVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryApplicationVersionListPage) NotDone() bool { - return !page.gavl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { - return page.gavl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { - if page.gavl.IsEmpty() { - return nil - } - return *page.gavl.Value -} - -// Creates a new instance of the GalleryApplicationVersionListPage type. -func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { - return GalleryApplicationVersionListPage{ - fn: getNextPage, - gavl: cur, - } -} - -// GalleryApplicationVersionProperties describes the properties of a gallery image version. -type GalleryApplicationVersionProperties struct { - PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating' - ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"` - // ReplicationStatus - READ-ONLY - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. -func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavp.PublishingProfile != nil { - objectMap["publishingProfile"] = gavp.PublishingProfile - } - return json.Marshal(objectMap) -} - -// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery image version. -type GalleryApplicationVersionPublishingProfile struct { - Source *UserArtifactSource `json:"source,omitempty"` - ManageActions *UserArtifactManage `json:"manageActions,omitempty"` - Settings *UserArtifactSettings `json:"settings,omitempty"` - // AdvancedSettings - Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. - AdvancedSettings map[string]*string `json:"advancedSettings"` - // EnableHealthCheck - Optional. Whether or not this application reports health. - EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - 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 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'Full', 'Shallow' - ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` - // TargetExtendedLocations - The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations *[]GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. -func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavpp.Source != nil { - objectMap["source"] = gavpp.Source - } - if gavpp.ManageActions != nil { - objectMap["manageActions"] = gavpp.ManageActions - } - if gavpp.Settings != nil { - objectMap["settings"] = gavpp.Settings - } - if gavpp.AdvancedSettings != nil { - objectMap["advancedSettings"] = gavpp.AdvancedSettings - } - if gavpp.EnableHealthCheck != nil { - objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck - } - if gavpp.TargetRegions != nil { - objectMap["targetRegions"] = gavpp.TargetRegions - } - if gavpp.ReplicaCount != nil { - objectMap["replicaCount"] = gavpp.ReplicaCount - } - if gavpp.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest - } - if gavpp.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate - } - if gavpp.StorageAccountType != "" { - objectMap["storageAccountType"] = gavpp.StorageAccountType - } - if gavpp.ReplicationMode != "" { - objectMap["replicationMode"] = gavpp.ReplicationMode - } - if gavpp.TargetExtendedLocations != nil { - objectMap["targetExtendedLocations"] = gavpp.TargetExtendedLocations - } - return json.Marshal(objectMap) -} - -// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type GalleryApplicationVersionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gav.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { - gav, err = client.CreateOrUpdateResponder(gav.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationVersionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. -func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationVersionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. -func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gav.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { - gav, err = client.UpdateResponder(gav.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you -// want to update. -type GalleryApplicationVersionUpdate struct { - *GalleryApplicationVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. -func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavu.GalleryApplicationVersionProperties != nil { - objectMap["properties"] = gavu.GalleryApplicationVersionProperties - } - if gavu.Tags != nil { - objectMap["tags"] = gavu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. -func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryApplicationVersionProperties GalleryApplicationVersionProperties - err = json.Unmarshal(*v, &galleryApplicationVersionProperties) - if err != nil { - return err - } - gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gavu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gavu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gavu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gavu.Tags = tags - } - } - } - - return nil -} - -// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. -type GalleryArtifactPublishingProfileBase struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - 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 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'Full', 'Shallow' - ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` - // TargetExtendedLocations - The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations *[]GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. -func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gappb.TargetRegions != nil { - objectMap["targetRegions"] = gappb.TargetRegions - } - if gappb.ReplicaCount != nil { - objectMap["replicaCount"] = gappb.ReplicaCount - } - if gappb.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest - } - if gappb.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gappb.EndOfLifeDate - } - if gappb.StorageAccountType != "" { - objectMap["storageAccountType"] = gappb.StorageAccountType - } - if gappb.ReplicationMode != "" { - objectMap["replicationMode"] = gappb.ReplicationMode - } - if gappb.TargetExtendedLocations != nil { - objectMap["targetExtendedLocations"] = gappb.TargetExtendedLocations - } - return json.Marshal(objectMap) -} - -// GalleryArtifactSource the source image from which the Image Version is going to be created. -type GalleryArtifactSource struct { - ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` -} - -// GalleryArtifactVersionSource the gallery artifact version source. -type GalleryArtifactVersionSource struct { - // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. - ID *string `json:"id,omitempty"` - // URI - The uri of the gallery artifact version source. Currently used to specify vhd/blob source. - URI *string `json:"uri,omitempty"` -} - -// GalleryDataDiskImage this is the data disk image. -type GalleryDataDiskImage struct { - // Lun - 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 `json:"lun,omitempty"` - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryDataDiskImage. -func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gddi.Lun != nil { - objectMap["lun"] = gddi.Lun - } - if gddi.HostCaching != "" { - objectMap["hostCaching"] = gddi.HostCaching - } - if gddi.Source != nil { - objectMap["source"] = gddi.Source - } - return json.Marshal(objectMap) -} - -// GalleryDiskImage this is the disk image base class. -type GalleryDiskImage struct { - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryDiskImage. -func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gdi.HostCaching != "" { - objectMap["hostCaching"] = gdi.HostCaching - } - if gdi.Source != nil { - objectMap["source"] = gdi.Source - } - return json.Marshal(objectMap) -} - -// GalleryExtendedLocation the name of the extended location. -type GalleryExtendedLocation struct { - Name *string `json:"name,omitempty"` - // Type - Possible values include: 'GalleryExtendedLocationTypeEdgeZone', 'GalleryExtendedLocationTypeUnknown' - Type GalleryExtendedLocationType `json:"type,omitempty"` -} - -// GalleryIdentifier describes the gallery unique name. -type GalleryIdentifier struct { - // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. - UniqueName *string `json:"uniqueName,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryIdentifier. -func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// GalleryImage specifies information about the gallery image definition that you want to create or update. -type GalleryImage struct { - autorest.Response `json:"-"` - *GalleryImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImage. -func (gi GalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gi.GalleryImageProperties != nil { - objectMap["properties"] = gi.GalleryImageProperties - } - if gi.Location != nil { - objectMap["location"] = gi.Location - } - if gi.Tags != nil { - objectMap["tags"] = gi.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. -func (gi *GalleryImage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryImageProperties GalleryImageProperties - err = json.Unmarshal(*v, &galleryImageProperties) - if err != nil { - return err - } - gi.GalleryImageProperties = &galleryImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gi.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gi.Tags = tags - } - } - } - - return nil -} - -// GalleryImageFeature a feature for gallery image. -type GalleryImageFeature struct { - // Name - The name of the gallery image feature. - Name *string `json:"name,omitempty"` - // Value - The value of the gallery image feature. - Value *string `json:"value,omitempty"` -} - -// GalleryImageIdentifier this is the gallery image definition identifier. -type GalleryImageIdentifier struct { - // Publisher - The name of the gallery image definition publisher. - Publisher *string `json:"publisher,omitempty"` - // Offer - The name of the gallery image definition offer. - Offer *string `json:"offer,omitempty"` - // Sku - The name of the gallery image definition SKU. - Sku *string `json:"sku,omitempty"` -} - -// GalleryImageList the List Gallery Images operation response. -type GalleryImageList struct { - autorest.Response `json:"-"` - // Value - A list of Shared Image Gallery images. - Value *[]GalleryImage `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// GalleryImageListIterator provides access to a complete listing of GalleryImage values. -type GalleryImageListIterator struct { - i int - page GalleryImageListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryImageListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryImageListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryImageListIterator) Response() GalleryImageList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryImageListIterator) Value() GalleryImage { - if !iter.page.NotDone() { - return GalleryImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryImageListIterator type. -func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { - return GalleryImageListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gil GalleryImageList) IsEmpty() bool { - return gil.Value == nil || len(*gil.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gil GalleryImageList) hasNextLink() bool { - return gil.NextLink != nil && len(*gil.NextLink) != 0 -} - -// galleryImageListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if !gil.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gil.NextLink))) -} - -// GalleryImageListPage contains a page of GalleryImage values. -type GalleryImageListPage struct { - fn func(context.Context, GalleryImageList) (GalleryImageList, error) - gil GalleryImageList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gil) - if err != nil { - return err - } - page.gil = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryImageListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryImageListPage) NotDone() bool { - return !page.gil.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryImageListPage) Response() GalleryImageList { - return page.gil -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryImageListPage) Values() []GalleryImage { - if page.gil.IsEmpty() { - return nil - } - return *page.gil.Value -} - -// Creates a new instance of the GalleryImageListPage type. -func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { - return GalleryImageListPage{ - fn: getNextPage, - gil: cur, - } -} - -// GalleryImageProperties describes the properties of a gallery image definition. -type GalleryImageProperties struct { - // Description - The description of this gallery image definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - // Eula - The Eula agreement for the gallery image definition. - Eula *string `json:"eula,omitempty"` - // PrivacyStatementURI - The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // ReleaseNoteURI - The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - // OsType - 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**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - Disallowed *Disallowed `json:"disallowed,omitempty"` - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating' - ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"` - // Features - A list of gallery image features. - Features *[]GalleryImageFeature `json:"features,omitempty"` - // Architecture - Possible values include: 'X64', 'Arm64' - Architecture Architecture `json:"architecture,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageProperties. -func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gip.Description != nil { - objectMap["description"] = gip.Description - } - if gip.Eula != nil { - objectMap["eula"] = gip.Eula - } - if gip.PrivacyStatementURI != nil { - objectMap["privacyStatementUri"] = gip.PrivacyStatementURI - } - if gip.ReleaseNoteURI != nil { - objectMap["releaseNoteUri"] = gip.ReleaseNoteURI - } - if gip.OsType != "" { - objectMap["osType"] = gip.OsType - } - if gip.OsState != "" { - objectMap["osState"] = gip.OsState - } - if gip.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = gip.HyperVGeneration - } - if gip.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gip.EndOfLifeDate - } - if gip.Identifier != nil { - objectMap["identifier"] = gip.Identifier - } - if gip.Recommended != nil { - objectMap["recommended"] = gip.Recommended - } - if gip.Disallowed != nil { - objectMap["disallowed"] = gip.Disallowed - } - if gip.PurchasePlan != nil { - objectMap["purchasePlan"] = gip.PurchasePlan - } - if gip.Features != nil { - objectMap["features"] = gip.Features - } - if gip.Architecture != "" { - objectMap["architecture"] = gip.Architecture - } - return json.Marshal(objectMap) -} - -// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (GalleryImage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. -func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gi.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { - gi, err = client.CreateOrUpdateResponder(gi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleryImagesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesDeleteFuture.Result. -func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleryImagesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (GalleryImage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesUpdateFuture.Result. -func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gi.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { - gi, err = client.UpdateResponder(gi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageUpdate specifies information about the gallery image definition that you want to update. -type GalleryImageUpdate struct { - *GalleryImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageUpdate. -func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if giu.GalleryImageProperties != nil { - objectMap["properties"] = giu.GalleryImageProperties - } - if giu.Tags != nil { - objectMap["tags"] = giu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. -func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryImageProperties GalleryImageProperties - err = json.Unmarshal(*v, &galleryImageProperties) - if err != nil { - return err - } - giu.GalleryImageProperties = &galleryImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - giu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - giu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - giu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - giu.Tags = tags - } - } - } - - return nil -} - -// GalleryImageVersion specifies information about the gallery image version that you want to create or -// update. -type GalleryImageVersion struct { - autorest.Response `json:"-"` - *GalleryImageVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersion. -func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if giv.GalleryImageVersionProperties != nil { - objectMap["properties"] = giv.GalleryImageVersionProperties - } - if giv.Location != nil { - objectMap["location"] = giv.Location - } - if giv.Tags != nil { - objectMap["tags"] = giv.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. -func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryImageVersionProperties GalleryImageVersionProperties - err = json.Unmarshal(*v, &galleryImageVersionProperties) - if err != nil { - return err - } - giv.GalleryImageVersionProperties = &galleryImageVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - giv.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - giv.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - giv.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - giv.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - giv.Tags = tags - } - } - } - - return nil -} - -// GalleryImageVersionList the List Gallery Image version operation response. -type GalleryImageVersionList struct { - autorest.Response `json:"-"` - // Value - A list of gallery image versions. - Value *[]GalleryImageVersion `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. -type GalleryImageVersionListIterator struct { - i int - page GalleryImageVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryImageVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryImageVersionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { - if !iter.page.NotDone() { - return GalleryImageVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryImageVersionListIterator type. -func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { - return GalleryImageVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (givl GalleryImageVersionList) IsEmpty() bool { - return givl.Value == nil || len(*givl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (givl GalleryImageVersionList) hasNextLink() bool { - return givl.NextLink != nil && len(*givl.NextLink) != 0 -} - -// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !givl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(givl.NextLink))) -} - -// GalleryImageVersionListPage contains a page of GalleryImageVersion values. -type GalleryImageVersionListPage struct { - fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) - givl GalleryImageVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.givl) - if err != nil { - return err - } - page.givl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryImageVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryImageVersionListPage) NotDone() bool { - return !page.givl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { - return page.givl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { - if page.givl.IsEmpty() { - return nil - } - return *page.givl.Value -} - -// Creates a new instance of the GalleryImageVersionListPage type. -func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { - return GalleryImageVersionListPage{ - fn: getNextPage, - givl: cur, - } -} - -// GalleryImageVersionProperties describes the properties of a gallery image version. -type GalleryImageVersionProperties struct { - PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating' - ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"` - StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` - // ReplicationStatus - READ-ONLY - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. -func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givp.PublishingProfile != nil { - objectMap["publishingProfile"] = givp.PublishingProfile - } - if givp.StorageProfile != nil { - objectMap["storageProfile"] = givp.StorageProfile - } - return json.Marshal(objectMap) -} - -// GalleryImageVersionPublishingProfile the publishing profile of a gallery image Version. -type GalleryImageVersionPublishingProfile struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - 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 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'Full', 'Shallow' - ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` - // TargetExtendedLocations - The target extended locations where the Image Version is going to be replicated to. This property is updatable. - TargetExtendedLocations *[]GalleryTargetExtendedLocation `json:"targetExtendedLocations,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. -func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givpp.TargetRegions != nil { - objectMap["targetRegions"] = givpp.TargetRegions - } - if givpp.ReplicaCount != nil { - objectMap["replicaCount"] = givpp.ReplicaCount - } - if givpp.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest - } - if givpp.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = givpp.EndOfLifeDate - } - if givpp.StorageAccountType != "" { - objectMap["storageAccountType"] = givpp.StorageAccountType - } - if givpp.ReplicationMode != "" { - objectMap["replicationMode"] = givpp.ReplicationMode - } - if givpp.TargetExtendedLocations != nil { - objectMap["targetExtendedLocations"] = givpp.TargetExtendedLocations - } - return json.Marshal(objectMap) -} - -// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. -func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - giv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { - giv, err = client.CreateOrUpdateResponder(giv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. -func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. -type GalleryImageVersionStorageProfile struct { - Source *GalleryArtifactVersionSource `json:"source,omitempty"` - OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of data disk images. - DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` -} - -// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. -func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - giv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { - giv, err = client.UpdateResponder(giv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageVersionUpdate specifies information about the gallery image version that you want to update. -type GalleryImageVersionUpdate struct { - *GalleryImageVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. -func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givu.GalleryImageVersionProperties != nil { - objectMap["properties"] = givu.GalleryImageVersionProperties - } - if givu.Tags != nil { - objectMap["tags"] = givu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. -func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryImageVersionProperties GalleryImageVersionProperties - err = json.Unmarshal(*v, &galleryImageVersionProperties) - if err != nil { - return err - } - givu.GalleryImageVersionProperties = &galleryImageVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - givu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - givu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - givu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - givu.Tags = tags - } - } - } - - return nil -} - -// GalleryList the List Galleries operation response. -type GalleryList struct { - autorest.Response `json:"-"` - // Value - A list of galleries. - Value *[]Gallery `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryListIterator provides access to a complete listing of Gallery values. -type GalleryListIterator struct { - i int - page GalleryListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryListIterator) Response() GalleryList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryListIterator) Value() Gallery { - if !iter.page.NotDone() { - return Gallery{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryListIterator type. -func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { - return GalleryListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gl GalleryList) IsEmpty() bool { - return gl.Value == nil || len(*gl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gl GalleryList) hasNextLink() bool { - return gl.NextLink != nil && len(*gl.NextLink) != 0 -} - -// galleryListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { - if !gl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gl.NextLink))) -} - -// GalleryListPage contains a page of Gallery values. -type GalleryListPage struct { - fn func(context.Context, GalleryList) (GalleryList, error) - gl GalleryList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gl) - if err != nil { - return err - } - page.gl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryListPage) NotDone() bool { - return !page.gl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryListPage) Response() GalleryList { - return page.gl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryListPage) Values() []Gallery { - if page.gl.IsEmpty() { - return nil - } - return *page.gl.Value -} - -// Creates a new instance of the GalleryListPage type. -func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { - return GalleryListPage{ - fn: getNextPage, - gl: cur, - } -} - -// GalleryOSDiskImage this is the OS disk image. -type GalleryOSDiskImage struct { - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryOSDiskImage. -func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if godi.HostCaching != "" { - objectMap["hostCaching"] = godi.HostCaching - } - if godi.Source != nil { - objectMap["source"] = godi.Source - } - return json.Marshal(objectMap) -} - -// GalleryProperties describes the properties of a Shared Image Gallery. -type GalleryProperties struct { - // Description - The description of this Shared Image Gallery resource. This property is updatable. - Description *string `json:"description,omitempty"` - Identifier *GalleryIdentifier `json:"identifier,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating' - ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"` - SharingProfile *SharingProfile `json:"sharingProfile,omitempty"` - SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"` - // SharingStatus - READ-ONLY - SharingStatus *SharingStatus `json:"sharingStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryProperties. -func (gp GalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gp.Description != nil { - objectMap["description"] = gp.Description - } - if gp.Identifier != nil { - objectMap["identifier"] = gp.Identifier - } - if gp.SharingProfile != nil { - objectMap["sharingProfile"] = gp.SharingProfile - } - if gp.SoftDeletePolicy != nil { - objectMap["softDeletePolicy"] = gp.SoftDeletePolicy - } - return json.Marshal(objectMap) -} - -// GallerySharingProfileUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GallerySharingProfileUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GallerySharingProfileClient) (SharingUpdate, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GallerySharingProfileUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GallerySharingProfileUpdateFuture.Result. -func (future *GallerySharingProfileUpdateFuture) result(client GallerySharingProfileClient) (su SharingUpdate, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - su.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GallerySharingProfileUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if su.Response.Response, err = future.GetResult(sender); err == nil && su.Response.Response.StatusCode != http.StatusNoContent { - su, err = client.UpdateResponder(su.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", su.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryTargetExtendedLocation ... -type GalleryTargetExtendedLocation struct { - // Name - The name of the region. - Name *string `json:"name,omitempty"` - ExtendedLocation *GalleryExtendedLocation `json:"extendedLocation,omitempty"` - // ExtendedLocationReplicaCount - The number of replicas of the Image Version to be created per extended location. This property is updatable. - ExtendedLocationReplicaCount *int32 `json:"extendedLocationReplicaCount,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - Encryption *EncryptionImages `json:"encryption,omitempty"` -} - -// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. -type GalleryUpdate struct { - *GalleryProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryUpdate. -func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gu.GalleryProperties != nil { - objectMap["properties"] = gu.GalleryProperties - } - if gu.Tags != nil { - objectMap["tags"] = gu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. -func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryProperties GalleryProperties - err = json.Unmarshal(*v, &galleryProperties) - if err != nil { - return err - } - gu.GalleryProperties = &galleryProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gu.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gu.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gu.Tags = tags - } - } - } - - return nil -} - -// GrantAccessData data used for requesting a SAS. -type GrantAccessData struct { - // Access - Possible values include: 'None', 'Read', 'Write' - Access AccessLevel `json:"access,omitempty"` - // DurationInSeconds - Time duration in seconds until the SAS access expires. - DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` - // GetSecureVMGuestStateSAS - Set this flag to true to get additional SAS for VM guest state - GetSecureVMGuestStateSAS *bool `json:"getSecureVMGuestStateSAS,omitempty"` -} - -// HardwareProfile specifies the hardware settings for the virtual machine. -type HardwareProfile struct { - // VMSize - Specifies the size of the virtual machine.

    The enum data type is currently deprecated and will be removed by December 23rd 2023.

    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. Possible values include: 'BasicA0', 'BasicA1', 'BasicA2', 'BasicA3', 'BasicA4', 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2V2', 'StandardA4V2', 'StandardA8V2', 'StandardA2mV2', 'StandardA4mV2', 'StandardA8mV2', 'StandardB1s', 'StandardB1ms', 'StandardB2s', 'StandardB2ms', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD2V3', 'StandardD4V3', 'StandardD8V3', 'StandardD16V3', 'StandardD32V3', 'StandardD64V3', 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardD15V2', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardDS1V2', 'StandardDS2V2', 'StandardDS3V2', 'StandardDS4V2', 'StandardDS5V2', 'StandardDS11V2', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardDS134V2', 'StandardDS132V2', 'StandardDS148V2', 'StandardDS144V2', 'StandardE2V3', 'StandardE4V3', 'StandardE8V3', 'StandardE16V3', 'StandardE32V3', 'StandardE64V3', 'StandardE2sV3', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardE3216V3', 'StandardE328sV3', 'StandardE6432sV3', 'StandardE6416sV3', 'StandardF1', 'StandardF2', 'StandardF4', 'StandardF8', 'StandardF16', 'StandardF1s', 'StandardF2s', 'StandardF4s', 'StandardF8s', 'StandardF16s', 'StandardF2sV2', 'StandardF4sV2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardGS48', 'StandardGS44', 'StandardGS516', 'StandardGS58', 'StandardH8', 'StandardH16', 'StandardH8m', 'StandardH16m', 'StandardH16r', 'StandardH16mr', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s', 'StandardM64s', 'StandardM64ms', 'StandardM128s', 'StandardM128ms', 'StandardM6432ms', 'StandardM6416ms', 'StandardM12864ms', 'StandardM12832ms', 'StandardNC6', 'StandardNC12', 'StandardNC24', 'StandardNC24r', 'StandardNC6sV2', 'StandardNC12sV2', 'StandardNC24sV2', 'StandardNC24rsV2', 'StandardNC6sV3', 'StandardNC12sV3', 'StandardNC24sV3', 'StandardNC24rsV3', 'StandardND6s', 'StandardND12s', 'StandardND24s', 'StandardND24rs', 'StandardNV6', 'StandardNV12', 'StandardNV24' - VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` - // VMSizeProperties - 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 `json:"vmSizeProperties,omitempty"` -} - -// 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 { - autorest.Response `json:"-"` - *ImageProperties `json:"properties,omitempty"` - // ExtendedLocation - The extended location of the Image. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Image. -func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i.ImageProperties != nil { - objectMap["properties"] = i.ImageProperties - } - if i.ExtendedLocation != nil { - objectMap["extendedLocation"] = i.ExtendedLocation - } - if i.Location != nil { - objectMap["location"] = i.Location - } - if i.Tags != nil { - objectMap["tags"] = i.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Image struct. -func (i *Image) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var imageProperties ImageProperties - err = json.Unmarshal(*v, &imageProperties) - if err != nil { - return err - } - i.ImageProperties = &imageProperties - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - i.ExtendedLocation = &extendedLocation - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - i.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - i.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - i.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - i.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - i.Tags = tags - } - } - } - - return nil -} - -// ImageDataDisk describes a data disk. -type ImageDataDisk struct { - // Lun - 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 `json:"lun,omitempty"` - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // StorageAccountType - 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. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageDisk describes a image disk. -type ImageDisk struct { - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // StorageAccountType - 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. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageDiskReference the source image used for creating the disk. -type ImageDiskReference struct { - // ID - A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference. - ID *string `json:"id,omitempty"` - // SharedGalleryImageID - A relative uri containing a direct shared Azure Compute Gallery image reference. - SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` - // CommunityGalleryImageID - A relative uri containing a community Azure Compute Gallery image reference. - CommunityGalleryImageID *string `json:"communityGalleryImageId,omitempty"` - // Lun - 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 `json:"lun,omitempty"` -} - -// ImageListResult the List Image operation response. -type ImageListResult struct { - autorest.Response `json:"-"` - // Value - The list of Images. - Value *[]Image `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. - NextLink *string `json:"nextLink,omitempty"` -} - -// ImageListResultIterator provides access to a complete listing of Image values. -type ImageListResultIterator struct { - i int - page ImageListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ImageListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ImageListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ImageListResultIterator) Response() ImageListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ImageListResultIterator) Value() Image { - if !iter.page.NotDone() { - return Image{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ImageListResultIterator type. -func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { - return ImageListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ilr ImageListResult) IsEmpty() bool { - return ilr.Value == nil || len(*ilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ilr ImageListResult) hasNextLink() bool { - return ilr.NextLink != nil && len(*ilr.NextLink) != 0 -} - -// imageListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ilr.NextLink))) -} - -// ImageListResultPage contains a page of Image values. -type ImageListResultPage struct { - fn func(context.Context, ImageListResult) (ImageListResult, error) - ilr ImageListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err - } - page.ilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ImageListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ImageListResultPage) NotDone() bool { - return !page.ilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ImageListResultPage) Response() ImageListResult { - return page.ilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ImageListResultPage) Values() []Image { - if page.ilr.IsEmpty() { - return nil - } - return *page.ilr.Value -} - -// Creates a new instance of the ImageListResultPage type. -func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { - return ImageListResultPage{ - fn: getNextPage, - ilr: cur, - } -} - -// ImageOSDisk describes an Operating System disk. -type ImageOSDisk struct { - // OsType - 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**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - The OS State. For managed images, use Generalized. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // StorageAccountType - 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. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageProperties describes the properties of an Image. -type ImageProperties struct { - // SourceVirtualMachine - The source virtual machine from which Image is created. - SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // HyperVGeneration - 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. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' - HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImageProperties. -func (IP ImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if IP.SourceVirtualMachine != nil { - objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine - } - if IP.StorageProfile != nil { - objectMap["storageProfile"] = IP.StorageProfile - } - if IP.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = IP.HyperVGeneration - } - return json.Marshal(objectMap) -} - -// ImagePurchasePlan describes the gallery image definition purchase plan. This is used by marketplace -// images. -type ImagePurchasePlan struct { - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Product - The product ID. - Product *string `json:"product,omitempty"` -} - -// 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 { - // Publisher - The image publisher. - Publisher *string `json:"publisher,omitempty"` - // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. - Offer *string `json:"offer,omitempty"` - // Sku - The image SKU. - Sku *string `json:"sku,omitempty"` - // Version - 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 `json:"version,omitempty"` - // ExactVersion - 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 `json:"exactVersion,omitempty"` - // SharedGalleryImageID - Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. - SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` - // CommunityGalleryImageID - Specified the community gallery image unique id for vm deployment. This can be fetched from community gallery image GET call. - CommunityGalleryImageID *string `json:"communityGalleryImageId,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImageReference. -func (ir ImageReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ir.Publisher != nil { - objectMap["publisher"] = ir.Publisher - } - if ir.Offer != nil { - objectMap["offer"] = ir.Offer - } - if ir.Sku != nil { - objectMap["sku"] = ir.Sku - } - if ir.Version != nil { - objectMap["version"] = ir.Version - } - if ir.SharedGalleryImageID != nil { - objectMap["sharedGalleryImageId"] = ir.SharedGalleryImageID - } - if ir.CommunityGalleryImageID != nil { - objectMap["communityGalleryImageId"] = ir.CommunityGalleryImageID - } - if ir.ID != nil { - objectMap["id"] = ir.ID - } - return json.Marshal(objectMap) -} - -// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (Image, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesCreateOrUpdateFuture.Result. -func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.CreateOrUpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ImagesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesDeleteFuture.Result. -func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ImageStorageProfile describes a storage profile. -type ImageStorageProfile struct { - // 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). - OsDisk *ImageOSDisk `json:"osDisk,omitempty"` - // DataDisks - 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 `json:"dataDisks,omitempty"` - // ZoneResilient - 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 `json:"zoneResilient,omitempty"` -} - -// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ImagesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (Image, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesUpdateFuture.Result. -func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.UpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// ImageUpdate the source user image virtual hard disk. Only tags may be updated. -type ImageUpdate struct { - *ImageProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ImageUpdate. -func (iu ImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iu.ImageProperties != nil { - objectMap["properties"] = iu.ImageProperties - } - if iu.Tags != nil { - objectMap["tags"] = iu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. -func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var imageProperties ImageProperties - err = json.Unmarshal(*v, &imageProperties) - if err != nil { - return err - } - iu.ImageProperties = &imageProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - iu.Tags = tags - } - } - } - - return nil -} - -// InnerError inner error details. -type InnerError struct { - // Exceptiontype - The exception type. - Exceptiontype *string `json:"exceptiontype,omitempty"` - // Errordetail - The internal error message or exception dump. - Errordetail *string `json:"errordetail,omitempty"` -} - -// InstanceSku the role instance SKU. -type InstanceSku struct { - // Name - READ-ONLY; The sku name. - Name *string `json:"name,omitempty"` - // Tier - READ-ONLY; The tier of the cloud service role instance. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for InstanceSku. -func (is InstanceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// InstanceViewStatus instance view status. -type InstanceViewStatus struct { - // Code - The status code. - Code *string `json:"code,omitempty"` - // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' - Level StatusLevelTypes `json:"level,omitempty"` - // DisplayStatus - The short localizable label for the status. - DisplayStatus *string `json:"displayStatus,omitempty"` - // Message - The detailed status message, including for alerts and error messages. - Message *string `json:"message,omitempty"` - // Time - The time of the status. - Time *date.Time `json:"time,omitempty"` -} - -// InstanceViewStatusesSummary instance view statuses. -type InstanceViewStatusesSummary struct { - // StatusesSummary - READ-ONLY; The summary. - StatusesSummary *[]StatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for InstanceViewStatusesSummary. -func (ivss InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// KeyForDiskEncryptionSet key Vault Key Url to be used for server side encryption of Managed Disks and -// Snapshots -type KeyForDiskEncryptionSet struct { - // SourceVault - 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 `json:"sourceVault,omitempty"` - // KeyURL - Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. - KeyURL *string `json:"keyUrl,omitempty"` -} - -// 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 { - // SourceVault - Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault `json:"sourceVault,omitempty"` - // KeyURL - Url pointing to a key or secret in KeyVault - KeyURL *string `json:"keyUrl,omitempty"` -} - -// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key -type KeyVaultAndSecretReference struct { - // SourceVault - Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault `json:"sourceVault,omitempty"` - // SecretURL - Url pointing to a key or secret in KeyVault - SecretURL *string `json:"secretUrl,omitempty"` -} - -// KeyVaultKeyReference describes a reference to Key Vault Key -type KeyVaultKeyReference struct { - // KeyURL - The URL referencing a key encryption key in Key Vault. - KeyURL *string `json:"keyUrl,omitempty"` - // SourceVault - The relative URL of the Key Vault containing the key. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// KeyVaultSecretReference describes a reference to Key Vault Secret -type KeyVaultSecretReference struct { - // SecretURL - The URL referencing a secret in a Key Vault. - SecretURL *string `json:"secretUrl,omitempty"` - // SourceVault - The relative URL of the Key Vault containing the secret. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// LastPatchInstallationSummary describes the properties of the last installed patch summary. -type LastPatchInstallationSummary struct { - // Status - 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.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' - Status PatchOperationStatus `json:"status,omitempty"` - // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - InstallationActivityID *string `json:"installationActivityId,omitempty"` - // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions - MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` - // NotSelectedPatchCount - 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 `json:"notSelectedPatchCount,omitempty"` - // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. - ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` - // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. - PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` - // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. - InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` - // FailedPatchCount - READ-ONLY; The count of patches that failed installation. - FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` - // StartTime - READ-ONLY; The UTC timestamp when the operation began. - StartTime *date.Time `json:"startTime,omitempty"` - // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for LastPatchInstallationSummary. -func (lpis LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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 { - // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. - DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` - // SSH - Specifies the ssh key configuration for a Linux OS. - SSH *SSHConfiguration `json:"ssh,omitempty"` - // ProvisionVMAgent - 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 `json:"provisionVMAgent,omitempty"` - // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Linux. - PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` - // EnableVMAgentPlatformUpdates - Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false. - EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"` -} - -// LinuxParameters input for InstallPatches on a Linux VM, as directly received by the API -type LinuxParameters struct { - // ClassificationsToInclude - The update classifications to select when installing patches for Linux. - ClassificationsToInclude *[]VMGuestPatchClassificationLinux `json:"classificationsToInclude,omitempty"` - // PackageNameMasksToInclude - packages to include in the patch operation. Format: packageName_packageVersion - PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` - // PackageNameMasksToExclude - packages to exclude in the patch operation. Format: packageName_packageVersion - PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` - // MaintenanceRunID - This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. - MaintenanceRunID *string `json:"maintenanceRunId,omitempty"` -} - -// LinuxPatchSettings specifies settings related to VM Guest Patching on Linux. -type LinuxPatchSettings struct { - // PatchMode - 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. Possible values include: 'LinuxVMGuestPatchModeImageDefault', 'LinuxVMGuestPatchModeAutomaticByPlatform' - PatchMode LinuxVMGuestPatchMode `json:"patchMode,omitempty"` - // AssessmentMode - 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. Possible values include: 'ImageDefault', 'AutomaticByPlatform' - AssessmentMode LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` - // AutomaticByPlatformSettings - Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Linux. - AutomaticByPlatformSettings *LinuxVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` -} - -// LinuxVMGuestPatchAutomaticByPlatformSettings specifies additional settings to be applied when patch mode -// AutomaticByPlatform is selected in Linux patch settings. -type LinuxVMGuestPatchAutomaticByPlatformSettings struct { - // RebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation operations. Possible values include: 'LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown', 'LinuxVMGuestPatchAutomaticByPlatformRebootSettingIfRequired', 'LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever', 'LinuxVMGuestPatchAutomaticByPlatformRebootSettingAlways' - RebootSetting LinuxVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` -} - -// ListUsagesResult the List Usages operation response. -type ListUsagesResult struct { - autorest.Response `json:"-"` - // Value - The list of compute resource usages. - Value *[]Usage `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// ListUsagesResultIterator provides access to a complete listing of Usage values. -type ListUsagesResultIterator struct { - i int - page ListUsagesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListUsagesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListUsagesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListUsagesResultIterator) Response() ListUsagesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListUsagesResultIterator) Value() Usage { - if !iter.page.NotDone() { - return Usage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListUsagesResultIterator type. -func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { - return ListUsagesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lur ListUsagesResult) IsEmpty() bool { - return lur.Value == nil || len(*lur.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lur ListUsagesResult) hasNextLink() bool { - return lur.NextLink != nil && len(*lur.NextLink) != 0 -} - -// listUsagesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lur.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lur.NextLink))) -} - -// ListUsagesResultPage contains a page of Usage values. -type ListUsagesResultPage struct { - fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) - lur ListUsagesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lur) - if err != nil { - return err - } - page.lur = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListUsagesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListUsagesResultPage) NotDone() bool { - return !page.lur.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListUsagesResultPage) Response() ListUsagesResult { - return page.lur -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListUsagesResultPage) Values() []Usage { - if page.lur.IsEmpty() { - return nil - } - return *page.lur.Value -} - -// Creates a new instance of the ListUsagesResultPage type. -func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { - return ListUsagesResultPage{ - fn: getNextPage, - lur: cur, - } -} - -// ListVirtualMachineExtensionImage ... -type ListVirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` -} - -// ListVirtualMachineImageResource ... -type ListVirtualMachineImageResource struct { - autorest.Response `json:"-"` - Value *[]VirtualMachineImageResource `json:"value,omitempty"` -} - -// LoadBalancerConfiguration describes the load balancer configuration. -type LoadBalancerConfiguration struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - The name of the Load balancer - Name *string `json:"name,omitempty"` - // Properties - Properties of the load balancer configuration. - Properties *LoadBalancerConfigurationProperties `json:"properties,omitempty"` -} - -// LoadBalancerConfigurationProperties describes the properties of the load balancer configuration. -type LoadBalancerConfigurationProperties struct { - // FrontendIPConfigurations - 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 `json:"frontendIPConfigurations,omitempty"` -} - -// 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 { - // Name - 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 `json:"name,omitempty"` - // Properties - Properties of load balancer frontend ip configuration. - Properties *LoadBalancerFrontendIPConfigurationProperties `json:"properties,omitempty"` -} - -// LoadBalancerFrontendIPConfigurationProperties describes a cloud service IP Configuration -type LoadBalancerFrontendIPConfigurationProperties struct { - // PublicIPAddress - The reference to the public ip address resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // Subnet - The reference to the virtual network subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PrivateIPAddress - The virtual network private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} - -// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type LogAnalyticsExportRequestRateByIntervalFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - laor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { - laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") - } - } - return -} - -// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LogAnalyticsExportThrottledRequestsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. -func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - laor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { - laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") - } - } - return -} - -// LogAnalyticsInputBase api input base class for LogAnalytics Api. -type LogAnalyticsInputBase struct { - // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - // FromTime - From time of the query - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - // GroupByClientApplicationID - Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - // GroupByUserAgent - Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// LogAnalyticsOperationResult logAnalytics operation status response -type LogAnalyticsOperationResult struct { - autorest.Response `json:"-"` - // Properties - READ-ONLY; LogAnalyticsOutput - Properties *LogAnalyticsOutput `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. -func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// LogAnalyticsOutput logAnalytics output properties -type LogAnalyticsOutput struct { - // Output - READ-ONLY; Output file Uri path to blob container. - Output *string `json:"output,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogAnalyticsOutput. -func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// MaintenanceRedeployStatus maintenance Operation Status. -type MaintenanceRedeployStatus struct { - // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. - IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` - // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. - PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` - // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. - PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` - // MaintenanceWindowStartTime - Start Time for the Maintenance Window. - MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` - // MaintenanceWindowEndTime - End Time for the Maintenance Window. - MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` - // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' - LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` - // LastOperationMessage - Message returned for the last Maintenance Operation. - LastOperationMessage *string `json:"lastOperationMessage,omitempty"` -} - -// ManagedArtifact the managed artifact. -type ManagedArtifact struct { - // ID - The managed artifact id. - ID *string `json:"id,omitempty"` -} - -// ManagedDiskParameters the parameters of a managed disk. -type ManagedDiskParameters struct { - // StorageAccountType - 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. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - // SecurityProfile - Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// NetworkInterfaceReference describes a network interface reference. -type NetworkInterfaceReference struct { - *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for NetworkInterfaceReference. -func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if nir.NetworkInterfaceReferenceProperties != nil { - objectMap["properties"] = nir.NetworkInterfaceReferenceProperties - } - if nir.ID != nil { - objectMap["id"] = nir.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. -func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties - err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) - if err != nil { - return err - } - nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - nir.ID = &ID - } - } - } - - return nil -} - -// NetworkInterfaceReferenceProperties describes a network interface reference properties. -type NetworkInterfaceReferenceProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// NetworkProfile specifies the network interfaces or the networking configuration of the virtual machine. -type NetworkProfile struct { - // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. - NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` - // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations. Possible values include: 'TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' - NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` - // NetworkInterfaceConfigurations - Specifies the networking configurations that will be used to create the virtual machine networking resources. - NetworkInterfaceConfigurations *[]VirtualMachineNetworkInterfaceConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// OperationListResult the List Compute Operation operation response. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of compute operations - Value *[]OperationValue `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationListResult. -func (olr OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationValue describes the properties of a Compute Operation value. -type OperationValue struct { - // Origin - READ-ONLY; The origin of the compute operation. - Origin *string `json:"origin,omitempty"` - // Name - READ-ONLY; The name of the compute operation. - Name *string `json:"name,omitempty"` - *OperationValueDisplay `json:"display,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationValue. -func (ov OperationValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ov.OperationValueDisplay != nil { - objectMap["display"] = ov.OperationValueDisplay - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OperationValue struct. -func (ov *OperationValue) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "origin": - if v != nil { - var origin string - err = json.Unmarshal(*v, &origin) - if err != nil { - return err - } - ov.Origin = &origin - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ov.Name = &name - } - case "display": - if v != nil { - var operationValueDisplay OperationValueDisplay - err = json.Unmarshal(*v, &operationValueDisplay) - if err != nil { - return err - } - ov.OperationValueDisplay = &operationValueDisplay - } - } - } - - return nil -} - -// OperationValueDisplay describes the properties of a Compute Operation Value Display. -type OperationValueDisplay struct { - // Operation - READ-ONLY; The display name of the compute operation. - Operation *string `json:"operation,omitempty"` - // Resource - READ-ONLY; The display name of the resource the operation applies to. - Resource *string `json:"resource,omitempty"` - // Description - READ-ONLY; The description of the operation. - Description *string `json:"description,omitempty"` - // Provider - READ-ONLY; The resource provider for the operation. - Provider *string `json:"provider,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationValueDisplay. -func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OrchestrationServiceStateInput the input for OrchestrationServiceState -type OrchestrationServiceStateInput struct { - // ServiceName - The name of the service. Possible values include: 'AutomaticRepairs' - ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` - // Action - The action to be performed. Possible values include: 'Resume', 'Suspend' - Action OrchestrationServiceStateAction `json:"action,omitempty"` -} - -// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. -type OrchestrationServiceSummary struct { - // ServiceName - READ-ONLY; The name of the service. Possible values include: 'AutomaticRepairs', 'DummyOrchestrationServiceName' - ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` - // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'NotRunning', 'Running', 'Suspended' - ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` -} - -// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. -func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// 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 { - // OsType - 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**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // EncryptionSettings - Specifies the encryption settings for the OS Disk.

    Minimum api-version: 2015-06-15 - EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Vhd - The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - // 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. - Image *VirtualHardDisk `json:"image,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None** for Standard storage. **ReadOnly** for Premium storage. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - // CreateOption - Specifies how the virtual machine should be created.

    Possible values are:

    **Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

    **FromImage** \u2013 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. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // DeleteOption - Specifies whether OS Disk should be deleted or detached upon VM deletion.

    Possible values:

    **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**. User cannot change the delete option for ephemeral OS Disk. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// OSDiskImage contains the os disk image information. -type OSDiskImage struct { - // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` -} - -// OSDiskImageEncryption contains encryption settings for an OS disk image. -type OSDiskImageEncryption struct { - // SecurityProfile - This property specifies the security profile of an OS disk image. - SecurityProfile *OSDiskImageSecurityProfile `json:"securityProfile,omitempty"` - // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` -} - -// OSDiskImageSecurityProfile contains security profile for an OS disk image. -type OSDiskImageSecurityProfile struct { - // ConfidentialVMEncryptionType - confidential VM encryption types. Possible values include: 'EncryptedVMGuestStateOnlyWithPmk', 'EncryptedWithPmk', 'EncryptedWithCmk' - ConfidentialVMEncryptionType ConfidentialVMEncryptionType `json:"confidentialVMEncryptionType,omitempty"` - // SecureVMDiskEncryptionSetID - secure VM disk encryption set id - SecureVMDiskEncryptionSetID *string `json:"secureVMDiskEncryptionSetId,omitempty"` -} - -// OSFamily describes a cloud service OS family. -type OSFamily struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - Properties *OSFamilyProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSFamily. -func (of OSFamily) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if of.Properties != nil { - objectMap["properties"] = of.Properties - } - return json.Marshal(objectMap) -} - -// OSFamilyListResult the list operation result. -type OSFamilyListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]OSFamily `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// OSFamilyListResultIterator provides access to a complete listing of OSFamily values. -type OSFamilyListResultIterator struct { - i int - page OSFamilyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OSFamilyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OSFamilyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OSFamilyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter OSFamilyListResultIterator) Response() OSFamilyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter OSFamilyListResultIterator) Value() OSFamily { - if !iter.page.NotDone() { - return OSFamily{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OSFamilyListResultIterator type. -func NewOSFamilyListResultIterator(page OSFamilyListResultPage) OSFamilyListResultIterator { - return OSFamilyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (oflr OSFamilyListResult) IsEmpty() bool { - return oflr.Value == nil || len(*oflr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (oflr OSFamilyListResult) hasNextLink() bool { - return oflr.NextLink != nil && len(*oflr.NextLink) != 0 -} - -// oSFamilyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (oflr OSFamilyListResult) oSFamilyListResultPreparer(ctx context.Context) (*http.Request, error) { - if !oflr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(oflr.NextLink))) -} - -// OSFamilyListResultPage contains a page of OSFamily values. -type OSFamilyListResultPage struct { - fn func(context.Context, OSFamilyListResult) (OSFamilyListResult, error) - oflr OSFamilyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OSFamilyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.oflr) - if err != nil { - return err - } - page.oflr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OSFamilyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OSFamilyListResultPage) NotDone() bool { - return !page.oflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OSFamilyListResultPage) Response() OSFamilyListResult { - return page.oflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OSFamilyListResultPage) Values() []OSFamily { - if page.oflr.IsEmpty() { - return nil - } - return *page.oflr.Value -} - -// Creates a new instance of the OSFamilyListResultPage type. -func NewOSFamilyListResultPage(cur OSFamilyListResult, getNextPage func(context.Context, OSFamilyListResult) (OSFamilyListResult, error)) OSFamilyListResultPage { - return OSFamilyListResultPage{ - fn: getNextPage, - oflr: cur, - } -} - -// OSFamilyProperties OS family properties. -type OSFamilyProperties struct { - // Name - READ-ONLY; The OS family name. - Name *string `json:"name,omitempty"` - // Label - READ-ONLY; The OS family label. - Label *string `json:"label,omitempty"` - // Versions - READ-ONLY; List of OS versions belonging to this family. - Versions *[]OSVersionPropertiesBase `json:"versions,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSFamilyProperties. -func (ofp OSFamilyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot -// be changed once VM is provisioned. -type OSProfile struct { - // ComputerName - 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 `json:"computerName,omitempty"` - // AdminUsername - 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 `json:"adminUsername,omitempty"` - // AdminPassword - 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 `json:"adminPassword,omitempty"` - // CustomData - 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.

    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 `json:"customData,omitempty"` - // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // 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). - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - 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 `json:"secrets,omitempty"` - // AllowExtensionOperations - 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 `json:"allowExtensionOperations,omitempty"` - // RequireGuestProvisionSignal - Optional property which must either be set to True or omitted. - RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` -} - -// OSVersion describes a cloud service OS version. -type OSVersion struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location. - Location *string `json:"location,omitempty"` - Properties *OSVersionProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSVersion. -func (ov OSVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ov.Properties != nil { - objectMap["properties"] = ov.Properties - } - return json.Marshal(objectMap) -} - -// OSVersionListResult the list operation result. -type OSVersionListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]OSVersion `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// OSVersionListResultIterator provides access to a complete listing of OSVersion values. -type OSVersionListResultIterator struct { - i int - page OSVersionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OSVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OSVersionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OSVersionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter OSVersionListResultIterator) Response() OSVersionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter OSVersionListResultIterator) Value() OSVersion { - if !iter.page.NotDone() { - return OSVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OSVersionListResultIterator type. -func NewOSVersionListResultIterator(page OSVersionListResultPage) OSVersionListResultIterator { - return OSVersionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ovlr OSVersionListResult) IsEmpty() bool { - return ovlr.Value == nil || len(*ovlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ovlr OSVersionListResult) hasNextLink() bool { - return ovlr.NextLink != nil && len(*ovlr.NextLink) != 0 -} - -// oSVersionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ovlr OSVersionListResult) oSVersionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ovlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ovlr.NextLink))) -} - -// OSVersionListResultPage contains a page of OSVersion values. -type OSVersionListResultPage struct { - fn func(context.Context, OSVersionListResult) (OSVersionListResult, error) - ovlr OSVersionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OSVersionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ovlr) - if err != nil { - return err - } - page.ovlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OSVersionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OSVersionListResultPage) NotDone() bool { - return !page.ovlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OSVersionListResultPage) Response() OSVersionListResult { - return page.ovlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OSVersionListResultPage) Values() []OSVersion { - if page.ovlr.IsEmpty() { - return nil - } - return *page.ovlr.Value -} - -// Creates a new instance of the OSVersionListResultPage type. -func NewOSVersionListResultPage(cur OSVersionListResult, getNextPage func(context.Context, OSVersionListResult) (OSVersionListResult, error)) OSVersionListResultPage { - return OSVersionListResultPage{ - fn: getNextPage, - ovlr: cur, - } -} - -// OSVersionProperties OS version properties. -type OSVersionProperties struct { - // Family - READ-ONLY; The family of this OS version. - Family *string `json:"family,omitempty"` - // FamilyLabel - READ-ONLY; The family label of this OS version. - FamilyLabel *string `json:"familyLabel,omitempty"` - // Version - READ-ONLY; The OS version. - Version *string `json:"version,omitempty"` - // Label - READ-ONLY; The OS version label. - Label *string `json:"label,omitempty"` - // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool `json:"isDefault,omitempty"` - // IsActive - READ-ONLY; Specifies whether this OS version is active. - IsActive *bool `json:"isActive,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSVersionProperties. -func (ovp OSVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OSVersionPropertiesBase configuration view of an OS version. -type OSVersionPropertiesBase struct { - // Version - READ-ONLY; The OS version. - Version *string `json:"version,omitempty"` - // Label - READ-ONLY; The OS version label. - Label *string `json:"label,omitempty"` - // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. - IsDefault *bool `json:"isDefault,omitempty"` - // IsActive - READ-ONLY; Specifies whether this OS version is active. - IsActive *bool `json:"isActive,omitempty"` -} - -// MarshalJSON is the custom marshaler for OSVersionPropertiesBase. -func (ovpb OSVersionPropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PatchInstallationDetail information about a specific patch that was encountered during an installation -// action. -type PatchInstallationDetail struct { - // PatchID - READ-ONLY; A unique identifier for the patch. - PatchID *string `json:"patchId,omitempty"` - // Name - READ-ONLY; The friendly name of the patch. - Name *string `json:"name,omitempty"` - // Version - READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. - Version *string `json:"version,omitempty"` - // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string `json:"kbId,omitempty"` - // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications *[]string `json:"classifications,omitempty"` - // InstallationState - READ-ONLY; The state of the patch after the installation operation completed. Possible values include: 'PatchInstallationStateUnknown', 'PatchInstallationStateInstalled', 'PatchInstallationStateFailed', 'PatchInstallationStateExcluded', 'PatchInstallationStateNotSelected', 'PatchInstallationStatePending' - InstallationState PatchInstallationState `json:"installationState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PatchInstallationDetail. -func (pid PatchInstallationDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PatchSettings specifies settings related to VM Guest Patching on Windows. -type PatchSettings struct { - // PatchMode - 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. Possible values include: 'WindowsVMGuestPatchModeManual', 'WindowsVMGuestPatchModeAutomaticByOS', 'WindowsVMGuestPatchModeAutomaticByPlatform' - PatchMode WindowsVMGuestPatchMode `json:"patchMode,omitempty"` - // EnableHotpatching - 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 `json:"enableHotpatching,omitempty"` - // AssessmentMode - 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. Possible values include: 'WindowsPatchAssessmentModeImageDefault', 'WindowsPatchAssessmentModeAutomaticByPlatform' - AssessmentMode WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` - // AutomaticByPlatformSettings - Specifies additional settings for patch mode AutomaticByPlatform in VM Guest Patching on Windows. - AutomaticByPlatformSettings *WindowsVMGuestPatchAutomaticByPlatformSettings `json:"automaticByPlatformSettings,omitempty"` -} - -// PirCommunityGalleryResource base information about the community gallery resource in pir. -type PirCommunityGalleryResource struct { - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *CommunityGalleryIdentifier `json:"identifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for PirCommunityGalleryResource. -func (pcgr PirCommunityGalleryResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pcgr.CommunityGalleryIdentifier != nil { - objectMap["identifier"] = pcgr.CommunityGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PirCommunityGalleryResource struct. -func (pcgr *PirCommunityGalleryResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcgr.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pcgr.Location = &location - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pcgr.Type = &typeVar - } - case "identifier": - if v != nil { - var communityGalleryIdentifier CommunityGalleryIdentifier - err = json.Unmarshal(*v, &communityGalleryIdentifier) - if err != nil { - return err - } - pcgr.CommunityGalleryIdentifier = &communityGalleryIdentifier - } - } - } - - return nil -} - -// PirResource the Resource model definition. -type PirResource struct { - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for PirResource. -func (pr PirResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PirSharedGalleryResource base information about the shared gallery resource in pir. -type PirSharedGalleryResource struct { - *SharedGalleryIdentifier `json:"identifier,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for PirSharedGalleryResource. -func (psgr PirSharedGalleryResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if psgr.SharedGalleryIdentifier != nil { - objectMap["identifier"] = psgr.SharedGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PirSharedGalleryResource struct. -func (psgr *PirSharedGalleryResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "identifier": - if v != nil { - var sharedGalleryIdentifier SharedGalleryIdentifier - err = json.Unmarshal(*v, &sharedGalleryIdentifier) - if err != nil { - return err - } - psgr.SharedGalleryIdentifier = &sharedGalleryIdentifier - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - psgr.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - psgr.Location = &location - } - } - } - - return nil -} - -// 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 { - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` - // PromotionCode - The promotion code. - PromotionCode *string `json:"promotionCode,omitempty"` -} - -// 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 { - // BaseRegularPriorityCount - The base number of regular priority VMs that will be created in this scale set as it scales out. - BaseRegularPriorityCount *int32 `json:"baseRegularPriorityCount,omitempty"` - // RegularPriorityPercentageAboveBase - The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular priority. - RegularPriorityPercentageAboveBase *int32 `json:"regularPriorityPercentageAboveBase,omitempty"` -} - -// PrivateEndpoint the Private Endpoint resource. -type PrivateEndpoint struct { - // ID - READ-ONLY; The ARM identifier for Private Endpoint - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpoint. -func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PrivateEndpointConnection the Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Resource properties. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; private endpoint connection Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; private endpoint connection name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; private endpoint connection type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult a list of private link resources -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - Array of private endpoint connections - Value *[]PrivateEndpointConnection `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string `json:"nextLink,omitempty"` -} - -// PrivateEndpointConnectionListResultIterator provides access to a complete listing of -// PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultIterator struct { - i int - page PrivateEndpointConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateEndpointConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { - if !iter.page.NotDone() { - return PrivateEndpointConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. -func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { - return PrivateEndpointConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { - return peclr.Value == nil || len(*peclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { - return peclr.NextLink != nil && len(*peclr.NextLink) != 0 -} - -// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !peclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(peclr.NextLink))) -} - -// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultPage struct { - fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) - peclr PrivateEndpointConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.peclr) - if err != nil { - return err - } - page.peclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateEndpointConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointConnectionListResultPage) NotDone() bool { - return !page.peclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { - return page.peclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { - if page.peclr.IsEmpty() { - return nil - } - return *page.peclr.Value -} - -// Creates a new instance of the PrivateEndpointConnectionListResultPage type. -func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { - return PrivateEndpointConnectionListResultPage{ - fn: getNextPage, - peclr: cur, - } -} - -// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between DiskAccess and Virtual Network. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' - ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. -func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pecp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState - } - if pecp.ProvisioningState != "" { - objectMap["provisioningState"] = pecp.ProvisioningState - } - return json.Marshal(objectMap) -} - -// PrivateLinkResource a private link resource -type PrivateLinkResource struct { - // PrivateLinkResourceProperties - Resource properties. - *PrivateLinkResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; private link resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; private link resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; private link resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResource. -func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plr.PrivateLinkResourceProperties != nil { - objectMap["properties"] = plr.PrivateLinkResourceProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. -func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkResourceProperties PrivateLinkResourceProperties - err = json.Unmarshal(*v, &privateLinkResourceProperties) - if err != nil { - return err - } - plr.PrivateLinkResourceProperties = &privateLinkResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plr.Type = &typeVar - } - } - } - - return nil -} - -// PrivateLinkResourceListResult a list of private link resources -type PrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - Array of private link resources - Value *[]PrivateLinkResource `json:"value,omitempty"` -} - -// PrivateLinkResourceProperties properties of a private link resource. -type PrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; The private link resource group id. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; The private link resource required member names. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - // RequiredZoneNames - The private link resource DNS zone name. - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. -func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plrp.RequiredZoneNames != nil { - objectMap["requiredZoneNames"] = plrp.RequiredZoneNames - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionState a collection of information about the state of the connection between -// service consumer and provider. -type PrivateLinkServiceConnectionState struct { - // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected' - Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` - // Description - The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// PropertyUpdatesInProgress properties of the disk for which update is pending. -type PropertyUpdatesInProgress struct { - // TargetTier - The target performance tier of the disk if a tier change operation is in progress. - TargetTier *string `json:"targetTier,omitempty"` -} - -// ProximityPlacementGroup specifies information about the proximity placement group. -type ProximityPlacementGroup struct { - autorest.Response `json:"-"` - // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. - *ProximityPlacementGroupProperties `json:"properties,omitempty"` - // Zones - 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 `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroup. -func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppg.ProximityPlacementGroupProperties != nil { - objectMap["properties"] = ppg.ProximityPlacementGroupProperties - } - if ppg.Zones != nil { - objectMap["zones"] = ppg.Zones - } - if ppg.Location != nil { - objectMap["location"] = ppg.Location - } - if ppg.Tags != nil { - objectMap["tags"] = ppg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. -func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var proximityPlacementGroupProperties ProximityPlacementGroupProperties - err = json.Unmarshal(*v, &proximityPlacementGroupProperties) - if err != nil { - return err - } - ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - ppg.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ppg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ppg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ppg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ppg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ppg.Tags = tags - } - } - } - - return nil -} - -// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. -type ProximityPlacementGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of proximity placement groups - Value *[]ProximityPlacementGroup `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of proximity placement groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProximityPlacementGroupListResultIterator provides access to a complete listing of -// ProximityPlacementGroup values. -type ProximityPlacementGroupListResultIterator struct { - i int - page ProximityPlacementGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProximityPlacementGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { - if !iter.page.NotDone() { - return ProximityPlacementGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProximityPlacementGroupListResultIterator type. -func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { - return ProximityPlacementGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { - return ppglr.Value == nil || len(*ppglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { - return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 -} - -// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ppglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ppglr.NextLink))) -} - -// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. -type ProximityPlacementGroupListResultPage struct { - fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) - ppglr ProximityPlacementGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ppglr) - if err != nil { - return err - } - page.ppglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProximityPlacementGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProximityPlacementGroupListResultPage) NotDone() bool { - return !page.ppglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { - return page.ppglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { - if page.ppglr.IsEmpty() { - return nil - } - return *page.ppglr.Value -} - -// Creates a new instance of the ProximityPlacementGroupListResultPage type. -func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { - return ProximityPlacementGroupListResultPage{ - fn: getNextPage, - ppglr: cur, - } -} - -// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. -type ProximityPlacementGroupProperties struct { - // 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. Possible values include: 'Standard', 'Ultra' - ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` - // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. - VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` - // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. - VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` - // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. - AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` - // ColocationStatus - Describes colocation status of the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` - // Intent - Specifies the user intent of the proximity placement group. - Intent *ProximityPlacementGroupPropertiesIntent `json:"intent,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. -func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppgp.ProximityPlacementGroupType != "" { - objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType - } - if ppgp.ColocationStatus != nil { - objectMap["colocationStatus"] = ppgp.ColocationStatus - } - if ppgp.Intent != nil { - objectMap["intent"] = ppgp.Intent - } - return json.Marshal(objectMap) -} - -// ProximityPlacementGroupPropertiesIntent specifies the user intent of the proximity placement group. -type ProximityPlacementGroupPropertiesIntent struct { - // VMSizes - Specifies possible sizes of virtual machines that can be created in the proximity placement group. - VMSizes *[]string `json:"vmSizes,omitempty"` -} - -// ProximityPlacementGroupUpdate specifies information about the proximity placement group. -type ProximityPlacementGroupUpdate struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. -func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppgu.Tags != nil { - objectMap["tags"] = ppgu.Tags - } - return json.Marshal(objectMap) -} - -// ProxyOnlyResource the ProxyOnly Resource model definition. -type ProxyOnlyResource struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyOnlyResource. -func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will not -// have tags and a location -type ProxyResource struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProxyResource. -func (pr ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PublicIPAddressSku describes the public IP Sku. It can only be set with OrchestrationMode as Flexible. -type PublicIPAddressSku struct { - // Name - Specify public IP sku name. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' - Name PublicIPAddressSkuName `json:"name,omitempty"` - // Tier - Specify public IP sku tier. Possible values include: 'Regional', 'Global' - Tier PublicIPAddressSkuTier `json:"tier,omitempty"` -} - -// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type PurchasePlan struct { - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` - // PromotionCode - The Offer Promotion Code. - PromotionCode *string `json:"promotionCode,omitempty"` -} - -// ReadCloser ... -type ReadCloser struct { - autorest.Response `json:"-"` - Value *io.ReadCloser `json:"value,omitempty"` -} - -// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this -// Image Definition. These properties are updatable. -type RecommendedMachineConfiguration struct { - VCPUs *ResourceRange `json:"vCPUs,omitempty"` - Memory *ResourceRange `json:"memory,omitempty"` -} - -// RecoveryWalkResponse response after calling a manual recovery walk -type RecoveryWalkResponse struct { - autorest.Response `json:"-"` - // WalkPerformed - READ-ONLY; Whether the recovery walk was performed - WalkPerformed *bool `json:"walkPerformed,omitempty"` - // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed - NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecoveryWalkResponse. -func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RegionalReplicationStatus this is the regional replication status. -type RegionalReplicationStatus struct { - // Region - READ-ONLY; The region to which the gallery image version is being replicated to. - Region *string `json:"region,omitempty"` - // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' - State ReplicationState `json:"state,omitempty"` - // Details - READ-ONLY; The details of the replication status. - Details *string `json:"details,omitempty"` - // Progress - READ-ONLY; It indicates progress of the replication job. - Progress *int32 `json:"progress,omitempty"` -} - -// MarshalJSON is the custom marshaler for RegionalReplicationStatus. -func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RegionalSharingStatus gallery regional sharing status -type RegionalSharingStatus struct { - // Region - Region name - Region *string `json:"region,omitempty"` - // State - Gallery sharing state in current region. Possible values include: 'SharingStateSucceeded', 'SharingStateInProgress', 'SharingStateFailed', 'SharingStateUnknown' - State SharingState `json:"state,omitempty"` - // Details - Details of gallery regional sharing failure. - Details *string `json:"details,omitempty"` -} - -// ReplicationStatus this is the replication status of the gallery image version. -type ReplicationStatus struct { - // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' - AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` - // Summary - READ-ONLY; This is a summary of replication status for each region. - Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` -} - -// MarshalJSON is the custom marshaler for ReplicationStatus. -func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. -type RequestRateByIntervalInput struct { - // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' - IntervalLength IntervalInMins `json:"intervalLength,omitempty"` - // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - // FromTime - From time of the query - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - // GroupByClientApplicationID - Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - // GroupByUserAgent - Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// Resource the Resource model definition. -type Resource struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ResourceInstanceViewStatus instance view status. -type ResourceInstanceViewStatus struct { - // Code - READ-ONLY; The status code. - Code *string `json:"code,omitempty"` - // DisplayStatus - READ-ONLY; The short localizable label for the status. - DisplayStatus *string `json:"displayStatus,omitempty"` - // Message - READ-ONLY; The detailed status message, including for alerts and error messages. - Message *string `json:"message,omitempty"` - // Time - READ-ONLY; The time of the status. - Time *date.Time `json:"time,omitempty"` - // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' - Level StatusLevelTypes `json:"level,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceInstanceViewStatus. -func (rivs ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rivs.Level != "" { - objectMap["level"] = rivs.Level - } - return json.Marshal(objectMap) -} - -// ResourceRange describes the resource range. -type ResourceRange struct { - // Min - The minimum number of the resource. - Min *int32 `json:"min,omitempty"` - // Max - The maximum number of the resource. - Max *int32 `json:"max,omitempty"` -} - -// ResourceSku describes an available Compute SKU. -type ResourceSku struct { - // ResourceType - READ-ONLY; The type of resource the SKU applies to. - ResourceType *string `json:"resourceType,omitempty"` - // Name - READ-ONLY; The name of SKU. - Name *string `json:"name,omitempty"` - // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** - Tier *string `json:"tier,omitempty"` - // Size - READ-ONLY; The Size of the SKU. - Size *string `json:"size,omitempty"` - // Family - READ-ONLY; The Family of this particular SKU. - Family *string `json:"family,omitempty"` - // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. - Kind *string `json:"kind,omitempty"` - // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` - // Locations - READ-ONLY; The set of locations that the SKU is available. - Locations *[]string `json:"locations,omitempty"` - // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. - LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` - // APIVersions - READ-ONLY; The api versions that support this SKU. - APIVersions *[]string `json:"apiVersions,omitempty"` - // Costs - READ-ONLY; Metadata for retrieving price info. - Costs *[]ResourceSkuCosts `json:"costs,omitempty"` - // Capabilities - READ-ONLY; A name value pair to describe the capability. - Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` - // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSku. -func (rs ResourceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCapabilities describes The SKU capabilities object. -type ResourceSkuCapabilities struct { - // Name - READ-ONLY; An invariant to describe the feature. - Name *string `json:"name,omitempty"` - // Value - READ-ONLY; An invariant if the feature is measured by quantity. - Value *string `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. -func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCapacity describes scaling information of a SKU. -type ResourceSkuCapacity struct { - // Minimum - READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty"` - // Default - READ-ONLY; The default capacity. - Default *int64 `json:"default,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' - ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCapacity. -func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCosts describes metadata for retrieving price info. -type ResourceSkuCosts struct { - // MeterID - READ-ONLY; Used for querying price from commerce. - MeterID *string `json:"meterID,omitempty"` - // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. - Quantity *int64 `json:"quantity,omitempty"` - // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. - ExtendedUnit *string `json:"extendedUnit,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCosts. -func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuLocationInfo describes an available Compute SKU Location Information. -type ResourceSkuLocationInfo struct { - // Location - READ-ONLY; Location of the SKU - Location *string `json:"location,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is supported. - Zones *[]string `json:"zones,omitempty"` - // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. - ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` - // ExtendedLocations - READ-ONLY; The names of extended locations. - ExtendedLocations *[]string `json:"extendedLocations,omitempty"` - // Type - READ-ONLY; The type of the extended location. Possible values include: 'EdgeZone' - Type ExtendedLocationType `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. -func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuRestrictionInfo describes an available Compute SKU Restriction Information. -type ResourceSkuRestrictionInfo struct { - // Locations - READ-ONLY; Locations where the SKU is restricted - Locations *[]string `json:"locations,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is restricted. - Zones *[]string `json:"zones,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. -func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuRestrictions describes scaling information of a SKU. -type ResourceSkuRestrictions struct { - // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' - Type ResourceSkuRestrictionsType `json:"type,omitempty"` - // Values - 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 `json:"values,omitempty"` - // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. - RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` - // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' - ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. -func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkusResult the List Resource Skus operation response. -type ResourceSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of skus available for the subscription. - Value *[]ResourceSku `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. -type ResourceSkusResultIterator struct { - i int - page ResourceSkusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ResourceSkusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceSkusResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ResourceSkusResultIterator) Value() ResourceSku { - if !iter.page.NotDone() { - return ResourceSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceSkusResultIterator type. -func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { - return ResourceSkusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rsr ResourceSkusResult) IsEmpty() bool { - return rsr.Value == nil || len(*rsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rsr ResourceSkusResult) hasNextLink() bool { - return rsr.NextLink != nil && len(*rsr.NextLink) != 0 -} - -// resourceSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if !rsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rsr.NextLink))) -} - -// ResourceSkusResultPage contains a page of ResourceSku values. -type ResourceSkusResultPage struct { - fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) - rsr ResourceSkusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rsr) - if err != nil { - return err - } - page.rsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ResourceSkusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceSkusResultPage) NotDone() bool { - return !page.rsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceSkusResultPage) Response() ResourceSkusResult { - return page.rsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceSkusResultPage) Values() []ResourceSku { - if page.rsr.IsEmpty() { - return nil - } - return *page.rsr.Value -} - -// Creates a new instance of the ResourceSkusResultPage type. -func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { - return ResourceSkusResultPage{ - fn: getNextPage, - rsr: cur, - } -} - -// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. -type ResourceSkuZoneDetails struct { - // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. - Name *[]string `json:"name,omitempty"` - // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. - Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. -func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceURIList the List resources which are encrypted with the disk encryption set. -type ResourceURIList struct { - autorest.Response `json:"-"` - // Value - A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. - Value *[]string `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceURIListIterator provides access to a complete listing of string values. -type ResourceURIListIterator struct { - i int - page ResourceURIListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ResourceURIListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ResourceURIListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceURIListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ResourceURIListIterator) Response() ResourceURIList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ResourceURIListIterator) Value() string { - if !iter.page.NotDone() { - return "" - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceURIListIterator type. -func NewResourceURIListIterator(page ResourceURIListPage) ResourceURIListIterator { - return ResourceURIListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rul ResourceURIList) IsEmpty() bool { - return rul.Value == nil || len(*rul.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rul ResourceURIList) hasNextLink() bool { - return rul.NextLink != nil && len(*rul.NextLink) != 0 -} - -// resourceURIListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rul ResourceURIList) resourceURIListPreparer(ctx context.Context) (*http.Request, error) { - if !rul.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rul.NextLink))) -} - -// ResourceURIListPage contains a page of string values. -type ResourceURIListPage struct { - fn func(context.Context, ResourceURIList) (ResourceURIList, error) - rul ResourceURIList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ResourceURIListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rul) - if err != nil { - return err - } - page.rul = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ResourceURIListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceURIListPage) NotDone() bool { - return !page.rul.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceURIListPage) Response() ResourceURIList { - return page.rul -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceURIListPage) Values() []string { - if page.rul.IsEmpty() { - return nil - } - return *page.rul.Value -} - -// Creates a new instance of the ResourceURIListPage type. -func NewResourceURIListPage(cur ResourceURIList, getNextPage func(context.Context, ResourceURIList) (ResourceURIList, error)) ResourceURIListPage { - return ResourceURIListPage{ - fn: getNextPage, - rul: cur, - } -} - -// ResourceWithOptionalLocation the Resource model definition with location property as optional. -type ResourceWithOptionalLocation struct { - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ResourceWithOptionalLocation. -func (rwol ResourceWithOptionalLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rwol.Location != nil { - objectMap["location"] = rwol.Location - } - if rwol.Tags != nil { - objectMap["tags"] = rwol.Tags - } - return json.Marshal(objectMap) -} - -// RestorePoint restore Point details. -type RestorePoint struct { - autorest.Response `json:"-"` - *RestorePointProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestorePoint. -func (rp RestorePoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rp.RestorePointProperties != nil { - objectMap["properties"] = rp.RestorePointProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. -func (rp *RestorePoint) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var restorePointProperties RestorePointProperties - err = json.Unmarshal(*v, &restorePointProperties) - if err != nil { - return err - } - rp.RestorePointProperties = &restorePointProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rp.Type = &typeVar - } - } - } - - return nil -} - -// RestorePointCollection create or update Restore Point collection parameters. -type RestorePointCollection struct { - autorest.Response `json:"-"` - *RestorePointCollectionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RestorePointCollection. -func (RPCVar RestorePointCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if RPCVar.RestorePointCollectionProperties != nil { - objectMap["properties"] = RPCVar.RestorePointCollectionProperties - } - if RPCVar.Location != nil { - objectMap["location"] = RPCVar.Location - } - if RPCVar.Tags != nil { - objectMap["tags"] = RPCVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorePointCollection struct. -func (RPCVar *RestorePointCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var restorePointCollectionProperties RestorePointCollectionProperties - err = json.Unmarshal(*v, &restorePointCollectionProperties) - if err != nil { - return err - } - RPCVar.RestorePointCollectionProperties = &restorePointCollectionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - RPCVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - RPCVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - RPCVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - RPCVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - RPCVar.Tags = tags - } - } - } - - return nil -} - -// RestorePointCollectionListResult the List restore point collection operation response. -type RestorePointCollectionListResult struct { - autorest.Response `json:"-"` - // Value - Gets the list of restore point collections. - Value *[]RestorePointCollection `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections - NextLink *string `json:"nextLink,omitempty"` -} - -// RestorePointCollectionListResultIterator provides access to a complete listing of RestorePointCollection -// values. -type RestorePointCollectionListResultIterator struct { - i int - page RestorePointCollectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RestorePointCollectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RestorePointCollectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RestorePointCollectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RestorePointCollectionListResultIterator) Response() RestorePointCollectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RestorePointCollectionListResultIterator) Value() RestorePointCollection { - if !iter.page.NotDone() { - return RestorePointCollection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RestorePointCollectionListResultIterator type. -func NewRestorePointCollectionListResultIterator(page RestorePointCollectionListResultPage) RestorePointCollectionListResultIterator { - return RestorePointCollectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rpclr RestorePointCollectionListResult) IsEmpty() bool { - return rpclr.Value == nil || len(*rpclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rpclr RestorePointCollectionListResult) hasNextLink() bool { - return rpclr.NextLink != nil && len(*rpclr.NextLink) != 0 -} - -// restorePointCollectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rpclr RestorePointCollectionListResult) restorePointCollectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rpclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rpclr.NextLink))) -} - -// RestorePointCollectionListResultPage contains a page of RestorePointCollection values. -type RestorePointCollectionListResultPage struct { - fn func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error) - rpclr RestorePointCollectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RestorePointCollectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rpclr) - if err != nil { - return err - } - page.rpclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RestorePointCollectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RestorePointCollectionListResultPage) NotDone() bool { - return !page.rpclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RestorePointCollectionListResultPage) Response() RestorePointCollectionListResult { - return page.rpclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RestorePointCollectionListResultPage) Values() []RestorePointCollection { - if page.rpclr.IsEmpty() { - return nil - } - return *page.rpclr.Value -} - -// Creates a new instance of the RestorePointCollectionListResultPage type. -func NewRestorePointCollectionListResultPage(cur RestorePointCollectionListResult, getNextPage func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error)) RestorePointCollectionListResultPage { - return RestorePointCollectionListResultPage{ - fn: getNextPage, - rpclr: cur, - } -} - -// RestorePointCollectionProperties the restore point collection properties. -type RestorePointCollectionProperties struct { - Source *RestorePointCollectionSourceProperties `json:"source,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the restore point collection. - ProvisioningState *string `json:"provisioningState,omitempty"` - // RestorePointCollectionID - READ-ONLY; The unique id of the restore point collection. - RestorePointCollectionID *string `json:"restorePointCollectionId,omitempty"` - // RestorePoints - READ-ONLY; A list containing all restore points created under this restore point collection. - RestorePoints *[]RestorePoint `json:"restorePoints,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestorePointCollectionProperties. -func (rpcp RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpcp.Source != nil { - objectMap["source"] = rpcp.Source - } - return json.Marshal(objectMap) -} - -// RestorePointCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RestorePointCollectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RestorePointCollectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RestorePointCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RestorePointCollectionsDeleteFuture.Result. -func (future *RestorePointCollectionsDeleteFuture) result(client RestorePointCollectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.RestorePointCollectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RestorePointCollectionSourceProperties the properties of the source resource that this restore point -// collection is created from. -type RestorePointCollectionSourceProperties struct { - // Location - READ-ONLY; Location of the source resource used to create this restore point collection. - Location *string `json:"location,omitempty"` - // ID - Resource Id of the source resource used to create this restore point collection - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestorePointCollectionSourceProperties. -func (rpcsp RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpcsp.ID != nil { - objectMap["id"] = rpcsp.ID - } - return json.Marshal(objectMap) -} - -// RestorePointCollectionUpdate update Restore Point collection parameters. -type RestorePointCollectionUpdate struct { - *RestorePointCollectionProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RestorePointCollectionUpdate. -func (rpcu RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpcu.RestorePointCollectionProperties != nil { - objectMap["properties"] = rpcu.RestorePointCollectionProperties - } - if rpcu.Tags != nil { - objectMap["tags"] = rpcu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RestorePointCollectionUpdate struct. -func (rpcu *RestorePointCollectionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var restorePointCollectionProperties RestorePointCollectionProperties - err = json.Unmarshal(*v, &restorePointCollectionProperties) - if err != nil { - return err - } - rpcu.RestorePointCollectionProperties = &restorePointCollectionProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rpcu.Tags = tags - } - } - } - - return nil -} - -// RestorePointInstanceView the instance view of a restore point. -type RestorePointInstanceView struct { - // DiskRestorePoints - The disk restore points information. - DiskRestorePoints *[]DiskRestorePointInstanceView `json:"diskRestorePoints,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// RestorePointProperties the restore point properties. -type RestorePointProperties struct { - // ExcludeDisks - 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 `json:"excludeDisks,omitempty"` - // SourceMetadata - READ-ONLY; Gets the details of the VM captured at the time of the restore point creation. - SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty"` - // ProvisioningState - READ-ONLY; Gets the provisioning state of the restore point. - ProvisioningState *string `json:"provisioningState,omitempty"` - // ConsistencyMode - 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. Possible values include: 'CrashConsistent', 'FileSystemConsistent', 'ApplicationConsistent' - ConsistencyMode ConsistencyModeTypes `json:"consistencyMode,omitempty"` - // TimeCreated - Gets the creation time of the restore point. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // SourceRestorePoint - Resource Id of the source restore point from which a copy needs to be created. - SourceRestorePoint *APIEntityReference `json:"sourceRestorePoint,omitempty"` - // InstanceView - READ-ONLY; The restore point instance view. - InstanceView *RestorePointInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for RestorePointProperties. -func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpp.ExcludeDisks != nil { - objectMap["excludeDisks"] = rpp.ExcludeDisks - } - if rpp.ConsistencyMode != "" { - objectMap["consistencyMode"] = rpp.ConsistencyMode - } - if rpp.TimeCreated != nil { - objectMap["timeCreated"] = rpp.TimeCreated - } - if rpp.SourceRestorePoint != nil { - objectMap["sourceRestorePoint"] = rpp.SourceRestorePoint - } - return json.Marshal(objectMap) -} - -// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RestorePointsCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RestorePointsClient) (RestorePoint, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RestorePointsCreateFuture.Result. -func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.RestorePointsCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { - rp, err = client.CreateResponder(rp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request") - } - } - return -} - -// RestorePointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RestorePointsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RestorePointsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RestorePointsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RestorePointsDeleteFuture.Result. -func (future *RestorePointsDeleteFuture) result(client RestorePointsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.RestorePointsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// 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 { - // HardwareProfile - Gets the hardware profile. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Gets the storage profile. - StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` - // OsProfile - Gets the OS profile. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // DiagnosticsProfile - Gets the diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // LicenseType - Gets the license type, which is for bring your own license scenario. - LicenseType *string `json:"licenseType,omitempty"` - // VMID - Gets the virtual machine unique id. - VMID *string `json:"vmId,omitempty"` - // SecurityProfile - Gets the security profile. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // Location - Location of the VM from which the restore point was created. - Location *string `json:"location,omitempty"` -} - -// RestorePointSourceVMDataDisk describes a data disk. -type RestorePointSourceVMDataDisk struct { - // Lun - Gets the logical unit number. - Lun *int32 `json:"lun,omitempty"` - // Name - Gets the disk name. - Name *string `json:"name,omitempty"` - // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - Gets the managed disk details - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskRestorePoint - Gets the disk restore point Id. - DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` -} - -// RestorePointSourceVMOSDisk describes an Operating System disk. -type RestorePointSourceVMOSDisk struct { - // OsType - Gets the Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemType `json:"osType,omitempty"` - // EncryptionSettings - Gets the disk encryption settings. - EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Name - Gets the disk name. - Name *string `json:"name,omitempty"` - // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Gets the disk size in GB. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - Gets the managed disk details - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskRestorePoint - Gets the disk restore point Id. - DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` -} - -// RestorePointSourceVMStorageProfile describes the storage profile. -type RestorePointSourceVMStorageProfile struct { - // OsDisk - Gets the OS disk of the VM captured at the time of the restore point creation. - OsDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` - // DataDisks - Gets the data disks of the VM captured at the time of the restore point creation. - DataDisks *[]RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` -} - -// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. -type RetrieveBootDiagnosticsDataResult struct { - autorest.Response `json:"-"` - // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI - ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` - // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. - SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` -} - -// MarshalJSON is the custom marshaler for RetrieveBootDiagnosticsDataResult. -func (rbddr RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RoleInstance describes the cloud service role instance. -type RoleInstance struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource Name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource Type. - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource Location. - Location *string `json:"location,omitempty"` - // Tags - READ-ONLY; Resource tags. - Tags map[string]*string `json:"tags"` - Sku *InstanceSku `json:"sku,omitempty"` - Properties *RoleInstanceProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoleInstance. -func (ri RoleInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ri.Sku != nil { - objectMap["sku"] = ri.Sku - } - if ri.Properties != nil { - objectMap["properties"] = ri.Properties - } - return json.Marshal(objectMap) -} - -// RoleInstanceInstanceView the instance view of the role instance. -type RoleInstanceInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - READ-ONLY; The Update Domain. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - READ-ONLY; The Fault Domain. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // PrivateID - 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 `json:"privateId,omitempty"` - // Statuses - READ-ONLY - Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoleInstanceInstanceView. -func (riiv RoleInstanceInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RoleInstanceListResult the list operation result. -type RoleInstanceListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]RoleInstance `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// RoleInstanceListResultIterator provides access to a complete listing of RoleInstance values. -type RoleInstanceListResultIterator struct { - i int - page RoleInstanceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RoleInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RoleInstanceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RoleInstanceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RoleInstanceListResultIterator) Response() RoleInstanceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RoleInstanceListResultIterator) Value() RoleInstance { - if !iter.page.NotDone() { - return RoleInstance{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RoleInstanceListResultIterator type. -func NewRoleInstanceListResultIterator(page RoleInstanceListResultPage) RoleInstanceListResultIterator { - return RoleInstanceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rilr RoleInstanceListResult) IsEmpty() bool { - return rilr.Value == nil || len(*rilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rilr RoleInstanceListResult) hasNextLink() bool { - return rilr.NextLink != nil && len(*rilr.NextLink) != 0 -} - -// roleInstanceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rilr RoleInstanceListResult) roleInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rilr.NextLink))) -} - -// RoleInstanceListResultPage contains a page of RoleInstance values. -type RoleInstanceListResultPage struct { - fn func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error) - rilr RoleInstanceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RoleInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rilr) - if err != nil { - return err - } - page.rilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RoleInstanceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RoleInstanceListResultPage) NotDone() bool { - return !page.rilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RoleInstanceListResultPage) Response() RoleInstanceListResult { - return page.rilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RoleInstanceListResultPage) Values() []RoleInstance { - if page.rilr.IsEmpty() { - return nil - } - return *page.rilr.Value -} - -// Creates a new instance of the RoleInstanceListResultPage type. -func NewRoleInstanceListResultPage(cur RoleInstanceListResult, getNextPage func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error)) RoleInstanceListResultPage { - return RoleInstanceListResultPage{ - fn: getNextPage, - rilr: cur, - } -} - -// RoleInstanceNetworkProfile describes the network profile for the role instance. -type RoleInstanceNetworkProfile struct { - // NetworkInterfaces - READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. - NetworkInterfaces *[]SubResource `json:"networkInterfaces,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoleInstanceNetworkProfile. -func (rinp RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RoleInstanceProperties role instance properties. -type RoleInstanceProperties struct { - NetworkProfile *RoleInstanceNetworkProfile `json:"networkProfile,omitempty"` - InstanceView *RoleInstanceInstanceView `json:"instanceView,omitempty"` -} - -// RoleInstances specifies a list of role instances from the cloud service. -type RoleInstances struct { - // RoleInstances - List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. - RoleInstances *[]string `json:"roleInstances,omitempty"` -} - -// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. -type RollbackStatusInfo struct { - // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. - SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` - // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. - FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` - // RollbackError - READ-ONLY; Error details if OS rollback failed. - RollbackError *APIError `json:"rollbackError,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollbackStatusInfo. -func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. -type RollingUpgradePolicy struct { - // MaxBatchInstancePercent - 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 `json:"maxBatchInstancePercent,omitempty"` - // MaxUnhealthyInstancePercent - 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 `json:"maxUnhealthyInstancePercent,omitempty"` - // MaxUnhealthyUpgradedInstancePercent - 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 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` - // PauseTimeBetweenBatches - 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 `json:"pauseTimeBetweenBatches,omitempty"` - // EnableCrossZoneUpgrade - 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 `json:"enableCrossZoneUpgrade,omitempty"` - // PrioritizeUnhealthyInstances - Upgrade all unhealthy instances in a scale set before any healthy instances. - PrioritizeUnhealthyInstances *bool `json:"prioritizeUnhealthyInstances,omitempty"` -} - -// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade -// state. -type RollingUpgradeProgressInfo struct { - // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. - SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` - // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. - FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` - // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. - InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` - // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. - PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. -func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. -type RollingUpgradeRunningStatus struct { - // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' - Code RollingUpgradeStatusCode `json:"code,omitempty"` - // StartTime - READ-ONLY; Start time of the upgrade. - StartTime *date.Time `json:"startTime,omitempty"` - // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' - LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` - // LastActionTime - READ-ONLY; Last action time of the upgrade. - LastActionTime *date.Time `json:"lastActionTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. -func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfo struct { - autorest.Response `json:"-"` - *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. -func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rusi.RollingUpgradeStatusInfoProperties != nil { - objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties - } - if rusi.Location != nil { - objectMap["location"] = rusi.Location - } - if rusi.Tags != nil { - objectMap["tags"] = rusi.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. -func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties - err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) - if err != nil { - return err - } - rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rusi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rusi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rusi.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rusi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rusi.Tags = tags - } - } - } - - return nil -} - -// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfoProperties struct { - // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. - Policy *RollingUpgradePolicy `json:"policy,omitempty"` - // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. - RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` - // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` - // Error - READ-ONLY; Error details for this upgrade, if there are any. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. -func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RunCommandDocument describes the properties of a Run Command. -type RunCommandDocument struct { - autorest.Response `json:"-"` - // Script - The script to be executed. - Script *[]string `json:"script,omitempty"` - // Parameters - The parameters used by the script. - Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` - // Schema - The VM run command schema. - Schema *string `json:"$schema,omitempty"` - // ID - The VM run command id. - ID *string `json:"id,omitempty"` - // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Label - The VM run command label. - Label *string `json:"label,omitempty"` - // Description - The VM run command description. - Description *string `json:"description,omitempty"` -} - -// RunCommandDocumentBase describes the properties of a Run Command metadata. -type RunCommandDocumentBase struct { - // Schema - The VM run command schema. - Schema *string `json:"$schema,omitempty"` - // ID - The VM run command id. - ID *string `json:"id,omitempty"` - // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Label - The VM run command label. - Label *string `json:"label,omitempty"` - // Description - The VM run command description. - Description *string `json:"description,omitempty"` -} - -// RunCommandInput capture Virtual Machine parameters. -type RunCommandInput struct { - // CommandID - The run command id. - CommandID *string `json:"commandId,omitempty"` - // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. - Script *[]string `json:"script,omitempty"` - // Parameters - The run command parameters. - Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` -} - -// RunCommandInputParameter describes the properties of a run command parameter. -type RunCommandInputParameter struct { - // Name - The run command parameter name. - Name *string `json:"name,omitempty"` - // Value - The run command parameter value. - Value *string `json:"value,omitempty"` -} - -// RunCommandListResult the List Virtual Machine operation response. -type RunCommandListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine run commands. - Value *[]RunCommandDocumentBase `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - NextLink *string `json:"nextLink,omitempty"` -} - -// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. -type RunCommandListResultIterator struct { - i int - page RunCommandListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RunCommandListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RunCommandListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RunCommandListResultIterator) Response() RunCommandListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { - if !iter.page.NotDone() { - return RunCommandDocumentBase{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RunCommandListResultIterator type. -func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { - return RunCommandListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rclr RunCommandListResult) IsEmpty() bool { - return rclr.Value == nil || len(*rclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rclr RunCommandListResult) hasNextLink() bool { - return rclr.NextLink != nil && len(*rclr.NextLink) != 0 -} - -// runCommandListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rclr.NextLink))) -} - -// RunCommandListResultPage contains a page of RunCommandDocumentBase values. -type RunCommandListResultPage struct { - fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) - rclr RunCommandListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rclr) - if err != nil { - return err - } - page.rclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RunCommandListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RunCommandListResultPage) NotDone() bool { - return !page.rclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RunCommandListResultPage) Response() RunCommandListResult { - return page.rclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { - if page.rclr.IsEmpty() { - return nil - } - return *page.rclr.Value -} - -// Creates a new instance of the RunCommandListResultPage type. -func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { - return RunCommandListResultPage{ - fn: getNextPage, - rclr: cur, - } -} - -// RunCommandParameterDefinition describes the properties of a run command parameter. -type RunCommandParameterDefinition struct { - // Name - The run command parameter name. - Name *string `json:"name,omitempty"` - // Type - The run command parameter type. - Type *string `json:"type,omitempty"` - // DefaultValue - The run command parameter default value. - DefaultValue *string `json:"defaultValue,omitempty"` - // Required - The run command parameter required. - Required *bool `json:"required,omitempty"` -} - -// RunCommandResult ... -type RunCommandResult struct { - autorest.Response `json:"-"` - // Value - Run command operation response. - Value *[]InstanceViewStatus `json:"value,omitempty"` -} - -// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. -type ScaleInPolicy struct { - // Rules - 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 `json:"rules,omitempty"` - // ForceDeletion - 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 `json:"forceDeletion,omitempty"` -} - -// ScheduledEventsProfile ... -type ScheduledEventsProfile struct { - // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. - TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` -} - -// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale -// set. -type SecurityProfile struct { - // UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine.

    Minimum api-version: 2020-12-01 - UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` - // EncryptionAtHost - 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.

    Default: The Encryption at host will be disabled unless this property is set to true for the resource. - EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` - // SecurityType - Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings.

    Default: UefiSettings will not be enabled unless this property is set. Possible values include: 'SecurityTypesTrustedLaunch', 'SecurityTypesConfidentialVM' - SecurityType SecurityTypes `json:"securityType,omitempty"` -} - -// SharedGallery specifies information about the Shared Gallery that you want to create or update. -type SharedGallery struct { - autorest.Response `json:"-"` - *SharedGalleryIdentifier `json:"identifier,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGallery. -func (sg SharedGallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sg.SharedGalleryIdentifier != nil { - objectMap["identifier"] = sg.SharedGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SharedGallery struct. -func (sg *SharedGallery) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "identifier": - if v != nil { - var sharedGalleryIdentifier SharedGalleryIdentifier - err = json.Unmarshal(*v, &sharedGalleryIdentifier) - if err != nil { - return err - } - sg.SharedGalleryIdentifier = &sharedGalleryIdentifier - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sg.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sg.Location = &location - } - } - } - - return nil -} - -// SharedGalleryDataDiskImage this is the data disk image. -type SharedGalleryDataDiskImage struct { - // Lun - 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 `json:"lun,omitempty"` - // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite' - HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryDataDiskImage. -func (sgddi SharedGalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgddi.Lun != nil { - objectMap["lun"] = sgddi.Lun - } - if sgddi.HostCaching != "" { - objectMap["hostCaching"] = sgddi.HostCaching - } - return json.Marshal(objectMap) -} - -// SharedGalleryDiskImage this is the disk image base class. -type SharedGalleryDiskImage struct { - // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite' - HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryDiskImage. -func (sgdi SharedGalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgdi.HostCaching != "" { - objectMap["hostCaching"] = sgdi.HostCaching - } - return json.Marshal(objectMap) -} - -// SharedGalleryIdentifier the identifier information of shared gallery. -type SharedGalleryIdentifier struct { - // UniqueID - The unique id of this shared gallery. - UniqueID *string `json:"uniqueId,omitempty"` -} - -// SharedGalleryImage specifies information about the gallery image definition that you want to create or -// update. -type SharedGalleryImage struct { - autorest.Response `json:"-"` - *SharedGalleryImageProperties `json:"properties,omitempty"` - *SharedGalleryIdentifier `json:"identifier,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryImage. -func (sgi SharedGalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgi.SharedGalleryImageProperties != nil { - objectMap["properties"] = sgi.SharedGalleryImageProperties - } - if sgi.SharedGalleryIdentifier != nil { - objectMap["identifier"] = sgi.SharedGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SharedGalleryImage struct. -func (sgi *SharedGalleryImage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var sharedGalleryImageProperties SharedGalleryImageProperties - err = json.Unmarshal(*v, &sharedGalleryImageProperties) - if err != nil { - return err - } - sgi.SharedGalleryImageProperties = &sharedGalleryImageProperties - } - case "identifier": - if v != nil { - var sharedGalleryIdentifier SharedGalleryIdentifier - err = json.Unmarshal(*v, &sharedGalleryIdentifier) - if err != nil { - return err - } - sgi.SharedGalleryIdentifier = &sharedGalleryIdentifier - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sgi.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sgi.Location = &location - } - } - } - - return nil -} - -// SharedGalleryImageList the List Shared Gallery Images operation response. -type SharedGalleryImageList struct { - autorest.Response `json:"-"` - // Value - A list of shared gallery images. - Value *[]SharedGalleryImage `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// SharedGalleryImageListIterator provides access to a complete listing of SharedGalleryImage values. -type SharedGalleryImageListIterator struct { - i int - page SharedGalleryImageListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SharedGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SharedGalleryImageListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SharedGalleryImageListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SharedGalleryImageListIterator) Response() SharedGalleryImageList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SharedGalleryImageListIterator) Value() SharedGalleryImage { - if !iter.page.NotDone() { - return SharedGalleryImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SharedGalleryImageListIterator type. -func NewSharedGalleryImageListIterator(page SharedGalleryImageListPage) SharedGalleryImageListIterator { - return SharedGalleryImageListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sgil SharedGalleryImageList) IsEmpty() bool { - return sgil.Value == nil || len(*sgil.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sgil SharedGalleryImageList) hasNextLink() bool { - return sgil.NextLink != nil && len(*sgil.NextLink) != 0 -} - -// sharedGalleryImageListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sgil SharedGalleryImageList) sharedGalleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if !sgil.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sgil.NextLink))) -} - -// SharedGalleryImageListPage contains a page of SharedGalleryImage values. -type SharedGalleryImageListPage struct { - fn func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error) - sgil SharedGalleryImageList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SharedGalleryImageListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sgil) - if err != nil { - return err - } - page.sgil = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SharedGalleryImageListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SharedGalleryImageListPage) NotDone() bool { - return !page.sgil.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SharedGalleryImageListPage) Response() SharedGalleryImageList { - return page.sgil -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SharedGalleryImageListPage) Values() []SharedGalleryImage { - if page.sgil.IsEmpty() { - return nil - } - return *page.sgil.Value -} - -// Creates a new instance of the SharedGalleryImageListPage type. -func NewSharedGalleryImageListPage(cur SharedGalleryImageList, getNextPage func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error)) SharedGalleryImageListPage { - return SharedGalleryImageListPage{ - fn: getNextPage, - sgil: cur, - } -} - -// SharedGalleryImageProperties describes the properties of a gallery image definition. -type SharedGalleryImageProperties struct { - // OsType - 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**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - Disallowed *Disallowed `json:"disallowed,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // Features - A list of gallery image features. - Features *[]GalleryImageFeature `json:"features,omitempty"` - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - // Architecture - Possible values include: 'X64', 'Arm64' - Architecture Architecture `json:"architecture,omitempty"` -} - -// SharedGalleryImageVersion specifies information about the gallery image version that you want to create -// or update. -type SharedGalleryImageVersion struct { - autorest.Response `json:"-"` - *SharedGalleryImageVersionProperties `json:"properties,omitempty"` - *SharedGalleryIdentifier `json:"identifier,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryImageVersion. -func (sgiv SharedGalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgiv.SharedGalleryImageVersionProperties != nil { - objectMap["properties"] = sgiv.SharedGalleryImageVersionProperties - } - if sgiv.SharedGalleryIdentifier != nil { - objectMap["identifier"] = sgiv.SharedGalleryIdentifier - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SharedGalleryImageVersion struct. -func (sgiv *SharedGalleryImageVersion) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var sharedGalleryImageVersionProperties SharedGalleryImageVersionProperties - err = json.Unmarshal(*v, &sharedGalleryImageVersionProperties) - if err != nil { - return err - } - sgiv.SharedGalleryImageVersionProperties = &sharedGalleryImageVersionProperties - } - case "identifier": - if v != nil { - var sharedGalleryIdentifier SharedGalleryIdentifier - err = json.Unmarshal(*v, &sharedGalleryIdentifier) - if err != nil { - return err - } - sgiv.SharedGalleryIdentifier = &sharedGalleryIdentifier - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sgiv.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sgiv.Location = &location - } - } - } - - return nil -} - -// SharedGalleryImageVersionList the List Shared Gallery Image versions operation response. -type SharedGalleryImageVersionList struct { - autorest.Response `json:"-"` - // Value - A list of shared gallery images versions. - Value *[]SharedGalleryImageVersion `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// SharedGalleryImageVersionListIterator provides access to a complete listing of SharedGalleryImageVersion -// values. -type SharedGalleryImageVersionListIterator struct { - i int - page SharedGalleryImageVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SharedGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SharedGalleryImageVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SharedGalleryImageVersionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SharedGalleryImageVersionListIterator) Response() SharedGalleryImageVersionList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SharedGalleryImageVersionListIterator) Value() SharedGalleryImageVersion { - if !iter.page.NotDone() { - return SharedGalleryImageVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SharedGalleryImageVersionListIterator type. -func NewSharedGalleryImageVersionListIterator(page SharedGalleryImageVersionListPage) SharedGalleryImageVersionListIterator { - return SharedGalleryImageVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sgivl SharedGalleryImageVersionList) IsEmpty() bool { - return sgivl.Value == nil || len(*sgivl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sgivl SharedGalleryImageVersionList) hasNextLink() bool { - return sgivl.NextLink != nil && len(*sgivl.NextLink) != 0 -} - -// sharedGalleryImageVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sgivl SharedGalleryImageVersionList) sharedGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !sgivl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sgivl.NextLink))) -} - -// SharedGalleryImageVersionListPage contains a page of SharedGalleryImageVersion values. -type SharedGalleryImageVersionListPage struct { - fn func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error) - sgivl SharedGalleryImageVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SharedGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sgivl) - if err != nil { - return err - } - page.sgivl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SharedGalleryImageVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SharedGalleryImageVersionListPage) NotDone() bool { - return !page.sgivl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SharedGalleryImageVersionListPage) Response() SharedGalleryImageVersionList { - return page.sgivl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SharedGalleryImageVersionListPage) Values() []SharedGalleryImageVersion { - if page.sgivl.IsEmpty() { - return nil - } - return *page.sgivl.Value -} - -// Creates a new instance of the SharedGalleryImageVersionListPage type. -func NewSharedGalleryImageVersionListPage(cur SharedGalleryImageVersionList, getNextPage func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error)) SharedGalleryImageVersionListPage { - return SharedGalleryImageVersionListPage{ - fn: getNextPage, - sgivl: cur, - } -} - -// SharedGalleryImageVersionProperties describes the properties of a gallery image version. -type SharedGalleryImageVersionProperties struct { - // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // StorageProfile - Describes the storage profile of the image version. - StorageProfile *SharedGalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` -} - -// SharedGalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. -type SharedGalleryImageVersionStorageProfile struct { - OsDiskImage *SharedGalleryOSDiskImage `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of data disk images. - DataDiskImages *[]SharedGalleryDataDiskImage `json:"dataDiskImages,omitempty"` -} - -// SharedGalleryList the List Shared Galleries operation response. -type SharedGalleryList struct { - autorest.Response `json:"-"` - // Value - A list of shared galleries. - Value *[]SharedGallery `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. - NextLink *string `json:"nextLink,omitempty"` -} - -// SharedGalleryListIterator provides access to a complete listing of SharedGallery values. -type SharedGalleryListIterator struct { - i int - page SharedGalleryListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SharedGalleryListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SharedGalleryListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SharedGalleryListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SharedGalleryListIterator) Response() SharedGalleryList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SharedGalleryListIterator) Value() SharedGallery { - if !iter.page.NotDone() { - return SharedGallery{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SharedGalleryListIterator type. -func NewSharedGalleryListIterator(page SharedGalleryListPage) SharedGalleryListIterator { - return SharedGalleryListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sgl SharedGalleryList) IsEmpty() bool { - return sgl.Value == nil || len(*sgl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sgl SharedGalleryList) hasNextLink() bool { - return sgl.NextLink != nil && len(*sgl.NextLink) != 0 -} - -// sharedGalleryListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sgl SharedGalleryList) sharedGalleryListPreparer(ctx context.Context) (*http.Request, error) { - if !sgl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sgl.NextLink))) -} - -// SharedGalleryListPage contains a page of SharedGallery values. -type SharedGalleryListPage struct { - fn func(context.Context, SharedGalleryList) (SharedGalleryList, error) - sgl SharedGalleryList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SharedGalleryListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sgl) - if err != nil { - return err - } - page.sgl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SharedGalleryListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SharedGalleryListPage) NotDone() bool { - return !page.sgl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SharedGalleryListPage) Response() SharedGalleryList { - return page.sgl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SharedGalleryListPage) Values() []SharedGallery { - if page.sgl.IsEmpty() { - return nil - } - return *page.sgl.Value -} - -// Creates a new instance of the SharedGalleryListPage type. -func NewSharedGalleryListPage(cur SharedGalleryList, getNextPage func(context.Context, SharedGalleryList) (SharedGalleryList, error)) SharedGalleryListPage { - return SharedGalleryListPage{ - fn: getNextPage, - sgl: cur, - } -} - -// SharedGalleryOSDiskImage this is the OS disk image. -type SharedGalleryOSDiskImage struct { - // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite' - HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharedGalleryOSDiskImage. -func (sgodi SharedGalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgodi.HostCaching != "" { - objectMap["hostCaching"] = sgodi.HostCaching - } - return json.Marshal(objectMap) -} - -// ShareInfoElement ... -type ShareInfoElement struct { - // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - VMURI *string `json:"vmUri,omitempty"` -} - -// MarshalJSON is the custom marshaler for ShareInfoElement. -func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SharingProfile profile for gallery sharing to subscription or tenant -type SharingProfile struct { - // Permissions - This property allows you to specify the permission of sharing gallery.

    Possible values are:

    **Private**

    **Groups**

    **Community**. Possible values include: 'Private', 'Groups', 'Community' - Permissions GallerySharingPermissionTypes `json:"permissions,omitempty"` - // Groups - READ-ONLY; A list of sharing profile groups. - Groups *[]SharingProfileGroup `json:"groups,omitempty"` - // CommunityGalleryInfo - Information of community gallery if current gallery is shared to community. - CommunityGalleryInfo *CommunityGalleryInfo `json:"communityGalleryInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for SharingProfile. -func (sp SharingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.Permissions != "" { - objectMap["permissions"] = sp.Permissions - } - if sp.CommunityGalleryInfo != nil { - objectMap["communityGalleryInfo"] = sp.CommunityGalleryInfo - } - return json.Marshal(objectMap) -} - -// SharingProfileGroup group of the gallery sharing profile -type SharingProfileGroup struct { - // Type - This property allows you to specify the type of sharing group.

    Possible values are:

    **Subscriptions**

    **AADTenants**. Possible values include: 'Subscriptions', 'AADTenants' - Type SharingProfileGroupTypes `json:"type,omitempty"` - // Ids - A list of subscription/tenant ids the gallery is aimed to be shared to. - Ids *[]string `json:"ids,omitempty"` -} - -// SharingStatus sharing status of current gallery. -type SharingStatus struct { - // AggregatedState - Aggregated sharing state of current gallery. Possible values include: 'SharingStateSucceeded', 'SharingStateInProgress', 'SharingStateFailed', 'SharingStateUnknown' - AggregatedState SharingState `json:"aggregatedState,omitempty"` - // Summary - Summary of all regional sharing status. - Summary *[]RegionalSharingStatus `json:"summary,omitempty"` -} - -// SharingUpdate specifies information about the gallery sharing profile update. -type SharingUpdate struct { - autorest.Response `json:"-"` - // OperationType - This property allows you to specify the operation type of gallery sharing update.

    Possible values are:

    **Add**

    **Remove**

    **Reset**. Possible values include: 'Add', 'Remove', 'Reset', 'EnableCommunity' - OperationType SharingUpdateOperationTypes `json:"operationType,omitempty"` - // Groups - A list of sharing profile groups. - Groups *[]SharingProfileGroup `json:"groups,omitempty"` -} - -// 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 { - // Name - The sku name. - Name *string `json:"name,omitempty"` - // Tier - Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** - Tier *string `json:"tier,omitempty"` - // Capacity - Specifies the number of virtual machines in the scale set. - Capacity *int64 `json:"capacity,omitempty"` -} - -// Snapshot snapshot resource. -type Snapshot struct { - autorest.Response `json:"-"` - // ManagedBy - READ-ONLY; Unused. Always Null. - ManagedBy *string `json:"managedBy,omitempty"` - Sku *SnapshotSku `json:"sku,omitempty"` - // ExtendedLocation - The extended location where the snapshot will be created. Extended location cannot be changed. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - *SnapshotProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Sku != nil { - objectMap["sku"] = s.Sku - } - if s.ExtendedLocation != nil { - objectMap["extendedLocation"] = s.ExtendedLocation - } - if s.SnapshotProperties != nil { - objectMap["properties"] = s.SnapshotProperties - } - if s.Location != nil { - objectMap["location"] = s.Location - } - if s.Tags != nil { - objectMap["tags"] = s.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Snapshot struct. -func (s *Snapshot) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "managedBy": - if v != nil { - var managedBy string - err = json.Unmarshal(*v, &managedBy) - if err != nil { - return err - } - s.ManagedBy = &managedBy - } - case "sku": - if v != nil { - var sku SnapshotSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - s.Sku = &sku - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - s.ExtendedLocation = &extendedLocation - } - case "properties": - if v != nil { - var snapshotProperties SnapshotProperties - err = json.Unmarshal(*v, &snapshotProperties) - if err != nil { - return err - } - s.SnapshotProperties = &snapshotProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - s.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - s.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - s.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - s.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - s.Tags = tags - } - } - } - - return nil -} - -// SnapshotList the List Snapshots operation response. -type SnapshotList struct { - autorest.Response `json:"-"` - // Value - A list of snapshots. - Value *[]Snapshot `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string `json:"nextLink,omitempty"` -} - -// SnapshotListIterator provides access to a complete listing of Snapshot values. -type SnapshotListIterator struct { - i int - page SnapshotListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SnapshotListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SnapshotListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SnapshotListIterator) Response() SnapshotList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SnapshotListIterator) Value() Snapshot { - if !iter.page.NotDone() { - return Snapshot{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SnapshotListIterator type. -func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { - return SnapshotListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sl SnapshotList) IsEmpty() bool { - return sl.Value == nil || len(*sl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sl SnapshotList) hasNextLink() bool { - return sl.NextLink != nil && len(*sl.NextLink) != 0 -} - -// snapshotListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { - if !sl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sl.NextLink))) -} - -// SnapshotListPage contains a page of Snapshot values. -type SnapshotListPage struct { - fn func(context.Context, SnapshotList) (SnapshotList, error) - sl SnapshotList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sl) - if err != nil { - return err - } - page.sl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SnapshotListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SnapshotListPage) NotDone() bool { - return !page.sl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SnapshotListPage) Response() SnapshotList { - return page.sl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SnapshotListPage) Values() []Snapshot { - if page.sl.IsEmpty() { - return nil - } - return *page.sl.Value -} - -// Creates a new instance of the SnapshotListPage type. -func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { - return SnapshotListPage{ - fn: getNextPage, - sl: cur, - } -} - -// SnapshotProperties snapshot resource properties. -type SnapshotProperties struct { - // TimeCreated - READ-ONLY; The time when the snapshot was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // PurchasePlan - Purchase plan information for the image from which the source disk for the snapshot was originally created. - PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` - // SupportedCapabilities - List of supported capabilities for the image from which the source disk from the snapshot was originally created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` - // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - // DiskState - The state of the snapshot. Possible values include: 'Unattached', 'Attached', 'Reserved', 'Frozen', 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload', 'ActiveUpload' - DiskState DiskState `json:"diskState,omitempty"` - // UniqueID - READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // ProvisioningState - READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. - Incremental *bool `json:"incremental,omitempty"` - // IncrementalSnapshotFamilyID - 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 `json:"incrementalSnapshotFamilyId,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // SecurityProfile - Contains the security related information for the resource. - SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` - // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // CompletionPercent - Percentage complete for the background copy when a resource is created via the CopyStart operation. - CompletionPercent *float64 `json:"completionPercent,omitempty"` - // CopyCompletionError - Indicates the error details if the background copy of a resource created via the CopyStart operation fails. - CopyCompletionError *CopyCompletionError `json:"copyCompletionError,omitempty"` - // DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone' - DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotProperties. -func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.OsType != "" { - objectMap["osType"] = sp.OsType - } - if sp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = sp.HyperVGeneration - } - if sp.PurchasePlan != nil { - objectMap["purchasePlan"] = sp.PurchasePlan - } - if sp.SupportedCapabilities != nil { - objectMap["supportedCapabilities"] = sp.SupportedCapabilities - } - if sp.CreationData != nil { - objectMap["creationData"] = sp.CreationData - } - if sp.DiskSizeGB != nil { - objectMap["diskSizeGB"] = sp.DiskSizeGB - } - if sp.DiskState != "" { - objectMap["diskState"] = sp.DiskState - } - if sp.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection - } - if sp.Incremental != nil { - objectMap["incremental"] = sp.Incremental - } - if sp.Encryption != nil { - objectMap["encryption"] = sp.Encryption - } - if sp.NetworkAccessPolicy != "" { - objectMap["networkAccessPolicy"] = sp.NetworkAccessPolicy - } - if sp.DiskAccessID != nil { - objectMap["diskAccessId"] = sp.DiskAccessID - } - if sp.SecurityProfile != nil { - objectMap["securityProfile"] = sp.SecurityProfile - } - if sp.SupportsHibernation != nil { - objectMap["supportsHibernation"] = sp.SupportsHibernation - } - if sp.PublicNetworkAccess != "" { - objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess - } - if sp.CompletionPercent != nil { - objectMap["completionPercent"] = sp.CompletionPercent - } - if sp.CopyCompletionError != nil { - objectMap["copyCompletionError"] = sp.CopyCompletionError - } - if sp.DataAccessAuthMode != "" { - objectMap["dataAccessAuthMode"] = sp.DataAccessAuthMode - } - return json.Marshal(objectMap) -} - -// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. -func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateOrUpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsDeleteFuture.Result. -func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsGrantAccessFuture.Result. -func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, 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 { - // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' - Name SnapshotStorageAccountTypes `json:"name,omitempty"` - // Tier - READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotSku. -func (ss SnapshotSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ss.Name != "" { - objectMap["name"] = ss.Name - } - return json.Marshal(objectMap) -} - -// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsRevokeAccessFuture.Result. -func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsUpdateFuture.Result. -func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.UpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotUpdate snapshot update resource. -type SnapshotUpdate struct { - *SnapshotUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - Sku *SnapshotSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotUpdate. -func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if su.SnapshotUpdateProperties != nil { - objectMap["properties"] = su.SnapshotUpdateProperties - } - if su.Tags != nil { - objectMap["tags"] = su.Tags - } - if su.Sku != nil { - objectMap["sku"] = su.Sku - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. -func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var snapshotUpdateProperties SnapshotUpdateProperties - err = json.Unmarshal(*v, &snapshotUpdateProperties) - if err != nil { - return err - } - su.SnapshotUpdateProperties = &snapshotUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - su.Tags = tags - } - case "sku": - if v != nil { - var sku SnapshotSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - su.Sku = &sku - } - } - } - - return nil -} - -// SnapshotUpdateProperties snapshot resource update properties. -type SnapshotUpdateProperties struct { - // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` - // NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll' - NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` - // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. - DiskAccessID *string `json:"diskAccessId,omitempty"` - // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. - SupportsHibernation *bool `json:"supportsHibernation,omitempty"` - // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled' - PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone' - DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"` - // SupportedCapabilities - List of supported capabilities for the image from which the OS disk was created. - SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` -} - -// SoftDeletePolicy contains information about the soft deletion policy of the gallery. -type SoftDeletePolicy struct { - // IsSoftDeleteEnabled - Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. - IsSoftDeleteEnabled *bool `json:"isSoftDeleteEnabled,omitempty"` -} - -// 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 { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// 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 { - // Enabled - 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 `json:"enabled,omitempty"` - // RestoreTimeout - Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances - RestoreTimeout *string `json:"restoreTimeout,omitempty"` -} - -// SSHConfiguration SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. - PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` -} - -// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where -// the public key is placed. -type SSHPublicKey struct { - // Path - 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 `json:"path,omitempty"` - // KeyData - 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 `json:"keyData,omitempty"` -} - -// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. -type SSHPublicKeyGenerateKeyPairResult struct { - autorest.Response `json:"-"` - // PrivateKey - 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 `json:"privateKey,omitempty"` - // PublicKey - 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 `json:"publicKey,omitempty"` - // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} - ID *string `json:"id,omitempty"` -} - -// SSHPublicKeyResource specifies information about the SSH public key. -type SSHPublicKeyResource struct { - autorest.Response `json:"-"` - // SSHPublicKeyResourceProperties - Properties of the SSH public key. - *SSHPublicKeyResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for SSHPublicKeyResource. -func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spkr.SSHPublicKeyResourceProperties != nil { - objectMap["properties"] = spkr.SSHPublicKeyResourceProperties - } - if spkr.Location != nil { - objectMap["location"] = spkr.Location - } - if spkr.Tags != nil { - objectMap["tags"] = spkr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. -func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties - err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) - if err != nil { - return err - } - spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - spkr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - spkr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - spkr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - spkr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spkr.Tags = tags - } - } - } - - return nil -} - -// SSHPublicKeyResourceProperties properties of the SSH public key. -type SSHPublicKeyResourceProperties struct { - // PublicKey - 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 `json:"publicKey,omitempty"` -} - -// SSHPublicKeysGroupListResult the list SSH public keys operation response. -type SSHPublicKeysGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of SSH public keys - Value *[]SSHPublicKeyResource `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource -// values. -type SSHPublicKeysGroupListResultIterator struct { - i int - page SSHPublicKeysGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SSHPublicKeysGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { - if !iter.page.NotDone() { - return SSHPublicKeyResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. -func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { - return SSHPublicKeysGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { - return spkglr.Value == nil || len(*spkglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { - return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 -} - -// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !spkglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(spkglr.NextLink))) -} - -// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. -type SSHPublicKeysGroupListResultPage struct { - fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) - spkglr SSHPublicKeysGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.spkglr) - if err != nil { - return err - } - page.spkglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SSHPublicKeysGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SSHPublicKeysGroupListResultPage) NotDone() bool { - return !page.spkglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { - return page.spkglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { - if page.spkglr.IsEmpty() { - return nil - } - return *page.spkglr.Value -} - -// Creates a new instance of the SSHPublicKeysGroupListResultPage type. -func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { - return SSHPublicKeysGroupListResultPage{ - fn: getNextPage, - spkglr: cur, - } -} - -// SSHPublicKeyUpdateResource specifies information about the SSH public key. -type SSHPublicKeyUpdateResource struct { - // SSHPublicKeyResourceProperties - Properties of the SSH public key. - *SSHPublicKeyResourceProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. -func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spkur.SSHPublicKeyResourceProperties != nil { - objectMap["properties"] = spkur.SSHPublicKeyResourceProperties - } - if spkur.Tags != nil { - objectMap["tags"] = spkur.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. -func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties - err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) - if err != nil { - return err - } - spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spkur.Tags = tags - } - } - } - - return nil -} - -// StatusCodeCount the status code and count of the cloud service instance view statuses -type StatusCodeCount struct { - // Code - READ-ONLY; The instance view status code - Code *string `json:"code,omitempty"` - // Count - READ-ONLY; Number of instances having this status code - Count *int32 `json:"count,omitempty"` -} - -// MarshalJSON is the custom marshaler for StatusCodeCount. -func (scc StatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// StorageProfile specifies the storage settings for the virtual machine disks. -type StorageProfile struct { - // 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. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // 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). - OsDisk *OSDisk `json:"osDisk,omitempty"` - // DataDisks - 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 `json:"dataDisks,omitempty"` - // DiskControllerType - 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 as a hyperVGeneration: 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. Possible values include: 'SCSI', 'NVMe' - DiskControllerType DiskControllerTypes `json:"diskControllerType,omitempty"` -} - -// SubResource ... -type SubResource struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SubResourceReadOnly ... -type SubResourceReadOnly struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubResourceReadOnly. -func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SubResourceWithColocationStatus ... -type SubResourceWithColocationStatus struct { - // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SupportedCapabilities list of supported capabilities persisted on the disk resource for VM use. -type SupportedCapabilities struct { - // DiskControllerTypes - The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI. - DiskControllerTypes *string `json:"diskControllerTypes,omitempty"` - // AcceleratedNetwork - True if the image from which the OS disk is created supports accelerated networking. - AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"` - // Architecture - CPU architecture supported by an OS disk. Possible values include: 'X64', 'Arm64' - Architecture Architecture `json:"architecture,omitempty"` -} - -// SystemData the system meta data relating to this resource. -type SystemData struct { - // CreatedAt - READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was created.
    Minimum api-version: 2022-04-04. - CreatedAt *date.Time `json:"createdAt,omitempty"` - // LastModifiedAt - 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 *date.Time `json:"lastModifiedAt,omitempty"` -} - -// MarshalJSON is the custom marshaler for SystemData. -func (sd SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// TargetRegion describes the target region information. -type TargetRegion struct { - // Name - The name of the region. - Name *string `json:"name,omitempty"` - // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. - RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` - Encryption *EncryptionImages `json:"encryption,omitempty"` -} - -// TerminateNotificationProfile ... -type TerminateNotificationProfile struct { - // NotBeforeTimeout - 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 `json:"notBeforeTimeout,omitempty"` - // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. - Enable *bool `json:"enable,omitempty"` -} - -// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. -type ThrottledRequestsInput struct { - // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - // FromTime - From time of the query - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` - // GroupByClientApplicationID - Group query result by Client Application ID. - GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` - // GroupByUserAgent - Group query result by User Agent. - GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` -} - -// 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 { - // SecureBootEnabled - Specifies whether secure boot should be enabled on the virtual machine.

    Minimum api-version: 2020-12-01 - SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` - // VTpmEnabled - Specifies whether vTPM should be enabled on the virtual machine.

    Minimum api-version: 2020-12-01 - VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` -} - -// UpdateDomain defines an update domain for the cloud service. -type UpdateDomain struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource Name - Name *string `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpdateDomain. -func (ud UpdateDomain) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpdateDomainListResult the list operation result. -type UpdateDomainListResult struct { - autorest.Response `json:"-"` - // Value - The list of resources. - Value *[]UpdateDomain `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// UpdateDomainListResultIterator provides access to a complete listing of UpdateDomain values. -type UpdateDomainListResultIterator struct { - i int - page UpdateDomainListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *UpdateDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *UpdateDomainListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter UpdateDomainListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter UpdateDomainListResultIterator) Response() UpdateDomainListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter UpdateDomainListResultIterator) Value() UpdateDomain { - if !iter.page.NotDone() { - return UpdateDomain{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the UpdateDomainListResultIterator type. -func NewUpdateDomainListResultIterator(page UpdateDomainListResultPage) UpdateDomainListResultIterator { - return UpdateDomainListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (udlr UpdateDomainListResult) IsEmpty() bool { - return udlr.Value == nil || len(*udlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (udlr UpdateDomainListResult) hasNextLink() bool { - return udlr.NextLink != nil && len(*udlr.NextLink) != 0 -} - -// updateDomainListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (udlr UpdateDomainListResult) updateDomainListResultPreparer(ctx context.Context) (*http.Request, error) { - if !udlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(udlr.NextLink))) -} - -// UpdateDomainListResultPage contains a page of UpdateDomain values. -type UpdateDomainListResultPage struct { - fn func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error) - udlr UpdateDomainListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *UpdateDomainListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.udlr) - if err != nil { - return err - } - page.udlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *UpdateDomainListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page UpdateDomainListResultPage) NotDone() bool { - return !page.udlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page UpdateDomainListResultPage) Response() UpdateDomainListResult { - return page.udlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page UpdateDomainListResultPage) Values() []UpdateDomain { - if page.udlr.IsEmpty() { - return nil - } - return *page.udlr.Value -} - -// Creates a new instance of the UpdateDomainListResultPage type. -func NewUpdateDomainListResultPage(cur UpdateDomainListResult, getNextPage func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error)) UpdateDomainListResultPage { - return UpdateDomainListResultPage{ - fn: getNextPage, - udlr: cur, - } -} - -// UpdateResource the Update Resource model definition. -type UpdateResource struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for UpdateResource. -func (ur UpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ur.Tags != nil { - objectMap["tags"] = ur.Tags - } - return json.Marshal(objectMap) -} - -// UpdateResourceDefinition the Update Resource model definition. -type UpdateResourceDefinition struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for UpdateResourceDefinition. -func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if urd.Tags != nil { - objectMap["tags"] = urd.Tags - } - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. -type UpgradeOperationHistoricalStatusInfo struct { - // Properties - READ-ONLY; Information about the properties of the upgrade operation. - Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. -func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale -// Set. -type UpgradeOperationHistoricalStatusInfoProperties struct { - // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. - RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` - // Progress - READ-ONLY; Counts of the VMs in each state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` - // Error - READ-ONLY; Error Details for this upgrade if there are any. - Error *APIError `json:"error,omitempty"` - // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' - StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` - // TargetImageReference - READ-ONLY; Image Reference details - TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` - // RollbackInfo - READ-ONLY; Information about OS rollback if performed - RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. -func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. -type UpgradeOperationHistoryStatus struct { - // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' - Code UpgradeState `json:"code,omitempty"` - // StartTime - READ-ONLY; Start time of the upgrade. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; End time of the upgrade. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. -func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. -type UpgradePolicy struct { - // Mode - 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. Possible values include: 'UpgradeModeAutomatic', 'UpgradeModeManual', 'UpgradeModeRolling' - Mode UpgradeMode `json:"mode,omitempty"` - // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. - RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` - // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. - AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` -} - -// Usage describes Compute Resource Usage. -type Usage struct { - // Unit - An enum describing the unit of usage measurement. - Unit *string `json:"unit,omitempty"` - // CurrentValue - The current usage of the resource. - CurrentValue *int32 `json:"currentValue,omitempty"` - // Limit - The maximum permitted usage of the resource. - Limit *int64 `json:"limit,omitempty"` - // Name - The name of the type of usage. - Name *UsageName `json:"name,omitempty"` -} - -// UsageName the Usage Names. -type UsageName struct { - // Value - The name of the resource. - Value *string `json:"value,omitempty"` - // LocalizedValue - The localized name of the resource. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// UserArtifactManage ... -type UserArtifactManage struct { - // Install - Required. The path and arguments to install the gallery application. This is limited to 4096 characters. - Install *string `json:"install,omitempty"` - // Remove - Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. - Remove *string `json:"remove,omitempty"` - // Update - 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 `json:"update,omitempty"` -} - -// 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 { - // PackageFileName - 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 `json:"packageFileName,omitempty"` - // ConfigFileName - 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 `json:"configFileName,omitempty"` -} - -// UserArtifactSource the source image from which the Image Version is going to be created. -type UserArtifactSource struct { - // MediaLink - Required. The mediaLink of the artifact, must be a readable storage page blob. - MediaLink *string `json:"mediaLink,omitempty"` - // DefaultConfigurationLink - Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. - DefaultConfigurationLink *string `json:"defaultConfigurationLink,omitempty"` -} - -// UserAssignedIdentitiesValue ... -type UserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for UserAssignedIdentitiesValue. -func (uaiv UserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate -// should reside on the VM. -type VaultCertificate struct { - // CertificateURL - 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 `json:"certificateUrl,omitempty"` - // CertificateStore - 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 <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. - CertificateStore *string `json:"certificateStore,omitempty"` -} - -// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. -type VaultSecretGroup struct { - // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource `json:"sourceVault,omitempty"` - // VaultCertificates - The list of key vault references in SourceVault which contain certificates. - VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` -} - -// VirtualHardDisk describes the uri of a disk. -type VirtualHardDisk struct { - // URI - Specifies the virtual hard disk's uri. - URI *string `json:"uri,omitempty"` -} - -// VirtualMachine describes a Virtual Machine. -type VirtualMachine struct { - autorest.Response `json:"-"` - // 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**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineProperties `json:"properties,omitempty"` - // Resources - READ-ONLY; The virtual machine child extension resources. - Resources *[]VirtualMachineExtension `json:"resources,omitempty"` - // Identity - The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - // Zones - The virtual machine zones. - Zones *[]string `json:"zones,omitempty"` - // ExtendedLocation - The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachine. -func (VM VirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if VM.Plan != nil { - objectMap["plan"] = VM.Plan - } - if VM.VirtualMachineProperties != nil { - objectMap["properties"] = VM.VirtualMachineProperties - } - if VM.Identity != nil { - objectMap["identity"] = VM.Identity - } - if VM.Zones != nil { - objectMap["zones"] = VM.Zones - } - if VM.ExtendedLocation != nil { - objectMap["extendedLocation"] = VM.ExtendedLocation - } - if VM.Location != nil { - objectMap["location"] = VM.Location - } - if VM.Tags != nil { - objectMap["tags"] = VM.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. -func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - VM.Plan = &plan - } - case "properties": - if v != nil { - var virtualMachineProperties VirtualMachineProperties - err = json.Unmarshal(*v, &virtualMachineProperties) - if err != nil { - return err - } - VM.VirtualMachineProperties = &virtualMachineProperties - } - case "resources": - if v != nil { - var resources []VirtualMachineExtension - err = json.Unmarshal(*v, &resources) - if err != nil { - return err - } - VM.Resources = &resources - } - case "identity": - if v != nil { - var identity VirtualMachineIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - VM.Identity = &identity - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - VM.Zones = &zones - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - VM.ExtendedLocation = &extendedLocation - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - VM.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - VM.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - VM.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - VM.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - VM.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. -type VirtualMachineAgentInstanceView struct { - // VMAgentVersion - The VM Agent full version. - VMAgentVersion *string `json:"vmAgentVersion,omitempty"` - // ExtensionHandlers - The virtual machine extension handler instance view. - ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. -type VirtualMachineAssessPatchesResult struct { - autorest.Response `json:"-"` - // Status - 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.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' - Status PatchOperationStatus `json:"status,omitempty"` - // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` - // RebootPending - 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 `json:"rebootPending,omitempty"` - // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. - CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` - // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. - OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` - // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *date.Time `json:"startDateTime,omitempty"` - // AvailablePatches - READ-ONLY; The list of patches that have been detected as available for installation. - AvailablePatches *[]VirtualMachineSoftwarePatchProperties `json:"availablePatches,omitempty"` - // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineAssessPatchesResult. -func (vmapr VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineCaptureParameters capture Virtual Machine parameters. -type VirtualMachineCaptureParameters struct { - // VhdPrefix - The captured virtual hard disk's name prefix. - VhdPrefix *string `json:"vhdPrefix,omitempty"` - // DestinationContainerName - The destination container name. - DestinationContainerName *string `json:"destinationContainerName,omitempty"` - // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. - OverwriteVhds *bool `json:"overwriteVhds,omitempty"` -} - -// VirtualMachineCaptureResult output of virtual machine capture operation. -type VirtualMachineCaptureResult struct { - autorest.Response `json:"-"` - // Schema - READ-ONLY; the schema of the captured virtual machine - Schema *string `json:"$schema,omitempty"` - // ContentVersion - READ-ONLY; the version of the content - ContentVersion *string `json:"contentVersion,omitempty"` - // Parameters - READ-ONLY; parameters of the captured virtual machine - Parameters interface{} `json:"parameters,omitempty"` - // Resources - READ-ONLY; a list of resource items of the captured virtual machine - Resources *[]interface{} `json:"resources,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. -func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmcr.ID != nil { - objectMap["id"] = vmcr.ID - } - return json.Marshal(objectMap) -} - -// VirtualMachineExtension describes a Virtual Machine Extension. -type VirtualMachineExtension struct { - autorest.Response `json:"-"` - *VirtualMachineExtensionProperties `json:"properties,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtension. -func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vme.VirtualMachineExtensionProperties != nil { - objectMap["properties"] = vme.VirtualMachineExtensionProperties - } - if vme.Location != nil { - objectMap["location"] = vme.Location - } - if vme.Tags != nil { - objectMap["tags"] = vme.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. -func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineExtensionProperties VirtualMachineExtensionProperties - err = json.Unmarshal(*v, &virtualMachineExtensionProperties) - if err != nil { - return err - } - vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vme.Location = &location - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vme.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vme.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vme.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vme.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. -type VirtualMachineExtensionHandlerInstanceView struct { - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // Status - The extension handler status. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. -type VirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. -func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmei.VirtualMachineExtensionImageProperties != nil { - objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties - } - if vmei.Location != nil { - objectMap["location"] = vmei.Location - } - if vmei.Tags != nil { - objectMap["tags"] = vmei.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. -func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties - err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) - if err != nil { - return err - } - vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmei.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmei.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmei.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmei.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmei.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. -type VirtualMachineExtensionImageProperties struct { - // OperatingSystem - The operating system this extension supports. - OperatingSystem *string `json:"operatingSystem,omitempty"` - // ComputeRole - The type of role (IaaS or PaaS) this extension supports. - ComputeRole *string `json:"computeRole,omitempty"` - // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. - HandlerSchema *string `json:"handlerSchema,omitempty"` - // VMScaleSetEnabled - 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 `json:"vmScaleSetEnabled,omitempty"` - // SupportsMultipleExtensions - Whether the handler can support multiple extensions. - SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` -} - -// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. -type VirtualMachineExtensionInstanceView struct { - // Name - The virtual machine extension name. - Name *string `json:"name,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // Substatuses - The resource status information. - Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionProperties struct { - // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // AutoUpgradeMinorVersion - 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 `json:"autoUpgradeMinorVersion,omitempty"` - // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - The virtual machine extension instance view. - InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` - // SuppressFailures - 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 `json:"suppressFailures,omitempty"` - // ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. -func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = vmep.ForceUpdateTag - } - if vmep.Publisher != nil { - objectMap["publisher"] = vmep.Publisher - } - if vmep.Type != nil { - objectMap["type"] = vmep.Type - } - if vmep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion - } - if vmep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion - } - if vmep.EnableAutomaticUpgrade != nil { - objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade - } - if vmep.Settings != nil { - objectMap["settings"] = vmep.Settings - } - if vmep.ProtectedSettings != nil { - objectMap["protectedSettings"] = vmep.ProtectedSettings - } - if vmep.InstanceView != nil { - objectMap["instanceView"] = vmep.InstanceView - } - if vmep.SuppressFailures != nil { - objectMap["suppressFailures"] = vmep.SuppressFailures - } - if vmep.ProtectedSettingsFromKeyVault != nil { - objectMap["protectedSettingsFromKeyVault"] = vmep.ProtectedSettingsFromKeyVault - } - return json.Marshal(objectMap) -} - -// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.CreateOrUpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. -func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineExtensionsListResult the List Extension operation response -type VirtualMachineExtensionsListResult struct { - autorest.Response `json:"-"` - // Value - The list of extensions - Value *[]VirtualMachineExtension `json:"value,omitempty"` -} - -// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. -func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.UpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. -type VirtualMachineExtensionUpdate struct { - *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. -func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmeu.VirtualMachineExtensionUpdateProperties != nil { - objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties - } - if vmeu.Tags != nil { - objectMap["tags"] = vmeu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. -func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties - err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) - if err != nil { - return err - } - vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmeu.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionUpdateProperties struct { - // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // AutoUpgradeMinorVersion - 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 `json:"autoUpgradeMinorVersion,omitempty"` - // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // SuppressFailures - 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 `json:"suppressFailures,omitempty"` - // ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` -} - -// VirtualMachineHealthStatus the health status of the VM. -type VirtualMachineHealthStatus struct { - // Status - READ-ONLY; The health status information for the VM. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. -func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineIdentity identity for the virtual machine. -type VirtualMachineIdentity struct { - // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - 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. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - 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 `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineIdentity. -func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmi.Type != "" { - objectMap["type"] = vmi.Type - } - if vmi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// VirtualMachineImage describes a Virtual Machine Image. -type VirtualMachineImage struct { - autorest.Response `json:"-"` - *VirtualMachineImageProperties `json:"properties,omitempty"` - // Name - The name of the resource. - Name *string `json:"name,omitempty"` - // Location - The supported Azure location of the resource. - Location *string `json:"location,omitempty"` - // Tags - 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 `json:"tags"` - // ExtendedLocation - The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineImage. -func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmi.VirtualMachineImageProperties != nil { - objectMap["properties"] = vmi.VirtualMachineImageProperties - } - if vmi.Name != nil { - objectMap["name"] = vmi.Name - } - if vmi.Location != nil { - objectMap["location"] = vmi.Location - } - if vmi.Tags != nil { - objectMap["tags"] = vmi.Tags - } - if vmi.ExtendedLocation != nil { - objectMap["extendedLocation"] = vmi.ExtendedLocation - } - if vmi.ID != nil { - objectMap["id"] = vmi.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. -func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineImageProperties VirtualMachineImageProperties - err = json.Unmarshal(*v, &virtualMachineImageProperties) - if err != nil { - return err - } - vmi.VirtualMachineImageProperties = &virtualMachineImageProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmi.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmi.Tags = tags - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - vmi.ExtendedLocation = &extendedLocation - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmi.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineImageFeature specifies additional capabilities supported by the image -type VirtualMachineImageFeature struct { - // Name - The name of the feature. - Name *string `json:"name,omitempty"` - // Value - The corresponding value for the feature. - Value *string `json:"value,omitempty"` -} - -// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. -type VirtualMachineImageProperties struct { - Plan *PurchasePlan `json:"plan,omitempty"` - OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` - DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` - AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` - // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' - HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` - // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image - Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` - Features *[]VirtualMachineImageFeature `json:"features,omitempty"` - // Architecture - Possible values include: 'ArchitectureTypesX64', 'ArchitectureTypesArm64' - Architecture ArchitectureTypes `json:"architecture,omitempty"` -} - -// VirtualMachineImageResource virtual machine image resource information. -type VirtualMachineImageResource struct { - // Name - The name of the resource. - Name *string `json:"name,omitempty"` - // Location - The supported Azure location of the resource. - Location *string `json:"location,omitempty"` - // Tags - 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 `json:"tags"` - // ExtendedLocation - The extended location of the Virtual Machine. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineImageResource. -func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmir.Name != nil { - objectMap["name"] = vmir.Name - } - if vmir.Location != nil { - objectMap["location"] = vmir.Location - } - if vmir.Tags != nil { - objectMap["tags"] = vmir.Tags - } - if vmir.ExtendedLocation != nil { - objectMap["extendedLocation"] = vmir.ExtendedLocation - } - if vmir.ID != nil { - objectMap["id"] = vmir.ID - } - return json.Marshal(objectMap) -} - -// VirtualMachineInstallPatchesParameters input for InstallPatches as directly received by the API -type VirtualMachineInstallPatchesParameters struct { - // MaximumDuration - 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 `json:"maximumDuration,omitempty"` - // RebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. Possible values include: 'IfRequired', 'Never', 'Always' - RebootSetting VMGuestPatchRebootSetting `json:"rebootSetting,omitempty"` - // WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API - WindowsParameters *WindowsParameters `json:"windowsParameters,omitempty"` - // LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API - LinuxParameters *LinuxParameters `json:"linuxParameters,omitempty"` -} - -// VirtualMachineInstallPatchesResult the result summary of an installation operation. -type VirtualMachineInstallPatchesResult struct { - autorest.Response `json:"-"` - // Status - 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.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' - Status PatchOperationStatus `json:"status,omitempty"` - // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - InstallationActivityID *string `json:"installationActivityId,omitempty"` - // RebootStatus - READ-ONLY; The reboot state of the VM following completion of the operation. Possible values include: 'VMGuestPatchRebootStatusUnknown', 'VMGuestPatchRebootStatusNotNeeded', 'VMGuestPatchRebootStatusRequired', 'VMGuestPatchRebootStatusStarted', 'VMGuestPatchRebootStatusFailed', 'VMGuestPatchRebootStatusCompleted' - RebootStatus VMGuestPatchRebootStatus `json:"rebootStatus,omitempty"` - // MaintenanceWindowExceeded - READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. - MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` - // ExcludedPatchCount - READ-ONLY; The number of patches that were not installed due to the user blocking their installation. - ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` - // NotSelectedPatchCount - READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. - NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` - // PendingPatchCount - 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 `json:"pendingPatchCount,omitempty"` - // InstalledPatchCount - READ-ONLY; The number of patches successfully installed. - InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` - // FailedPatchCount - READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. - FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` - // Patches - READ-ONLY; The patches that were installed during the operation. - Patches *[]PatchInstallationDetail `json:"patches,omitempty"` - // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. - StartDateTime *date.Time `json:"startDateTime,omitempty"` - // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineInstallPatchesResult. -func (vmipr VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineInstanceView the instance view of a virtual machine. -type VirtualMachineInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - Specifies the update domain of the virtual machine. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - Specifies the fault domain of the virtual machine. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // ComputerName - The computer name assigned to the virtual machine. - ComputerName *string `json:"computerName,omitempty"` - // OsName - The Operating System running on the virtual machine. - OsName *string `json:"osName,omitempty"` - // OsVersion - The version of Operating System running on the virtual machine. - OsVersion *string `json:"osVersion,omitempty"` - // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' - HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` - // RdpThumbPrint - The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - // VMAgent - The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - // Disks - The virtual machine disk information. - Disks *[]DiskInstanceView `json:"disks,omitempty"` - // Extensions - The extensions information. - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // VMHealth - READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` - // 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. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - // AssignedHost - 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 `json:"assignedHost,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // PatchStatus - [Preview Feature] The status of virtual machine patch operations. - PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. -func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmiv.PlatformUpdateDomain != nil { - objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain - } - if vmiv.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain - } - if vmiv.ComputerName != nil { - objectMap["computerName"] = vmiv.ComputerName - } - if vmiv.OsName != nil { - objectMap["osName"] = vmiv.OsName - } - if vmiv.OsVersion != nil { - objectMap["osVersion"] = vmiv.OsVersion - } - if vmiv.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = vmiv.HyperVGeneration - } - if vmiv.RdpThumbPrint != nil { - objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint - } - if vmiv.VMAgent != nil { - objectMap["vmAgent"] = vmiv.VMAgent - } - if vmiv.MaintenanceRedeployStatus != nil { - objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus - } - if vmiv.Disks != nil { - objectMap["disks"] = vmiv.Disks - } - if vmiv.Extensions != nil { - objectMap["extensions"] = vmiv.Extensions - } - if vmiv.BootDiagnostics != nil { - objectMap["bootDiagnostics"] = vmiv.BootDiagnostics - } - if vmiv.Statuses != nil { - objectMap["statuses"] = vmiv.Statuses - } - if vmiv.PatchStatus != nil { - objectMap["patchStatus"] = vmiv.PatchStatus - } - return json.Marshal(objectMap) -} - -// VirtualMachineIPTag contains the IP tag associated with the public IP address. -type VirtualMachineIPTag struct { - // IPTagType - IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string `json:"tag,omitempty"` -} - -// VirtualMachineListResult the List Virtual Machine operation response. -type VirtualMachineListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machines. - Value *[]VirtualMachine `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. -type VirtualMachineListResultIterator struct { - i int - page VirtualMachineListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineListResultIterator) Value() VirtualMachine { - if !iter.page.NotDone() { - return VirtualMachine{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineListResultIterator type. -func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { - return VirtualMachineListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmlr VirtualMachineListResult) IsEmpty() bool { - return vmlr.Value == nil || len(*vmlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmlr VirtualMachineListResult) hasNextLink() bool { - return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 -} - -// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmlr.NextLink))) -} - -// VirtualMachineListResultPage contains a page of VirtualMachine values. -type VirtualMachineListResultPage struct { - fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) - vmlr VirtualMachineListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmlr) - if err != nil { - return err - } - page.vmlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineListResultPage) NotDone() bool { - return !page.vmlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { - return page.vmlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineListResultPage) Values() []VirtualMachine { - if page.vmlr.IsEmpty() { - return nil - } - return *page.vmlr.Value -} - -// Creates a new instance of the VirtualMachineListResultPage type. -func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { - return VirtualMachineListResultPage{ - fn: getNextPage, - vmlr: cur, - } -} - -// VirtualMachineNetworkInterfaceConfiguration describes a virtual machine network interface -// configurations. -type VirtualMachineNetworkInterfaceConfiguration struct { - // Name - The network interface configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineNetworkInterfaceConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceConfiguration. -func (vmnic VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmnic.Name != nil { - objectMap["name"] = vmnic.Name - } - if vmnic.VirtualMachineNetworkInterfaceConfigurationProperties != nil { - objectMap["properties"] = vmnic.VirtualMachineNetworkInterfaceConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceConfiguration struct. -func (vmnic *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmnic.Name = &name - } - case "properties": - if v != nil { - var virtualMachineNetworkInterfaceConfigurationProperties VirtualMachineNetworkInterfaceConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceConfigurationProperties) - if err != nil { - return err - } - vmnic.VirtualMachineNetworkInterfaceConfigurationProperties = &virtualMachineNetworkInterfaceConfigurationProperties - } - } - } - - return nil -} - -// VirtualMachineNetworkInterfaceConfigurationProperties describes a virtual machine network profile's IP -// configuration. -type VirtualMachineNetworkInterfaceConfigurationProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration `json:"dnsSettings,omitempty"` - // IPConfigurations - Specifies the IP configurations of the network interface. - IPConfigurations *[]VirtualMachineNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` -} - -// VirtualMachineNetworkInterfaceDNSSettingsConfiguration describes a virtual machines network -// configuration's DNS settings. -type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { - // DNSServers - List of DNS servers IP addresses - DNSServers *[]string `json:"dnsServers,omitempty"` -} - -// VirtualMachineNetworkInterfaceIPConfiguration describes a virtual machine network profile's IP -// configuration. -type VirtualMachineNetworkInterfaceIPConfiguration struct { - // Name - The IP configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineNetworkInterfaceIPConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceIPConfiguration. -func (vmniic VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmniic.Name != nil { - objectMap["name"] = vmniic.Name - } - if vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties != nil { - objectMap["properties"] = vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceIPConfiguration struct. -func (vmniic *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmniic.Name = &name - } - case "properties": - if v != nil { - var virtualMachineNetworkInterfaceIPConfigurationProperties VirtualMachineNetworkInterfaceIPConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceIPConfigurationProperties) - if err != nil { - return err - } - vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties = &virtualMachineNetworkInterfaceIPConfigurationProperties - } - } - } - - return nil -} - -// VirtualMachineNetworkInterfaceIPConfigurationProperties describes a virtual machine network interface IP -// configuration properties. -type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { - // Subnet - Specifies the identifier of the subnet. - Subnet *SubResource `json:"subnet,omitempty"` - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - 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'. Possible values include: 'IPVersionsIPv4', 'IPVersionsIPv6' - PrivateIPAddressVersion IPVersions `json:"privateIPAddressVersion,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // ApplicationGatewayBackendAddressPools - 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 `json:"applicationGatewayBackendAddressPools,omitempty"` - // LoadBalancerBackendAddressPools - 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 `json:"loadBalancerBackendAddressPools,omitempty"` -} - -// VirtualMachinePatchStatus the status of virtual machine patch operations. -type VirtualMachinePatchStatus struct { - // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. - AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` - // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. - LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` - // ConfigurationStatuses - READ-ONLY; The enablement status of the specified patchMode - ConfigurationStatuses *[]InstanceViewStatus `json:"configurationStatuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachinePatchStatus. -func (vmps VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmps.AvailablePatchSummary != nil { - objectMap["availablePatchSummary"] = vmps.AvailablePatchSummary - } - if vmps.LastPatchInstallationSummary != nil { - objectMap["lastPatchInstallationSummary"] = vmps.LastPatchInstallationSummary - } - return json.Marshal(objectMap) -} - -// VirtualMachineProperties describes the properties of a Virtual Machine. -type VirtualMachineProperties struct { - // HardwareProfile - Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // NetworkProfile - Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // SecurityProfile - Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // 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 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 `json:"availabilitySet,omitempty"` - // VirtualMachineScaleSet - 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 `json:"virtualMachineScaleSet,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to.

    Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // Priority - Specifies the priority for the virtual machine.

    Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' - Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - 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. Possible values include: 'VirtualMachineEvictionPolicyTypesDeallocate', 'VirtualMachineEvictionPolicyTypesDelete' - EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine.

    Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // Host - Specifies information about the dedicated host that the virtual machine resides in.

    Minimum api-version: 2018-10-01. - Host *SubResource `json:"host,omitempty"` - // HostGroup - Specifies information about the dedicated host group that the virtual machine resides in.

    Minimum api-version: 2020-06-01.

    NOTE: User cannot specify both host and hostGroup properties. - HostGroup *SubResource `json:"hostGroup,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

    Possible values for Windows Server operating system are:

    Windows_Client

    Windows_Server

    Possible values for Linux Server operating system are:

    RHEL_BYOS (for RHEL)

    SLES_BYOS (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 `json:"licenseType,omitempty"` - // VMID - 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 `json:"vmId,omitempty"` - // ExtensionsTimeBudget - 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 `json:"extensionsTimeBudget,omitempty"` - // PlatformFaultDomain - 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' > 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 `json:"platformFaultDomain,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - // UserData - 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 `json:"userData,omitempty"` - // CapacityReservation - Specifies information about the capacity reservation that is used to allocate virtual machine.

    Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` - // ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS - ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` - // TimeCreated - READ-ONLY; Specifies the time at which the Virtual Machine resource was created.

    Minimum api-version: 2021-11-01. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineProperties. -func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmp.HardwareProfile != nil { - objectMap["hardwareProfile"] = vmp.HardwareProfile - } - if vmp.StorageProfile != nil { - objectMap["storageProfile"] = vmp.StorageProfile - } - if vmp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities - } - if vmp.OsProfile != nil { - objectMap["osProfile"] = vmp.OsProfile - } - if vmp.NetworkProfile != nil { - objectMap["networkProfile"] = vmp.NetworkProfile - } - if vmp.SecurityProfile != nil { - objectMap["securityProfile"] = vmp.SecurityProfile - } - if vmp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile - } - if vmp.AvailabilitySet != nil { - objectMap["availabilitySet"] = vmp.AvailabilitySet - } - if vmp.VirtualMachineScaleSet != nil { - objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet - } - if vmp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup - } - if vmp.Priority != "" { - objectMap["priority"] = vmp.Priority - } - if vmp.EvictionPolicy != "" { - objectMap["evictionPolicy"] = vmp.EvictionPolicy - } - if vmp.BillingProfile != nil { - objectMap["billingProfile"] = vmp.BillingProfile - } - if vmp.Host != nil { - objectMap["host"] = vmp.Host - } - if vmp.HostGroup != nil { - objectMap["hostGroup"] = vmp.HostGroup - } - if vmp.LicenseType != nil { - objectMap["licenseType"] = vmp.LicenseType - } - if vmp.ExtensionsTimeBudget != nil { - objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget - } - if vmp.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = vmp.PlatformFaultDomain - } - if vmp.ScheduledEventsProfile != nil { - objectMap["scheduledEventsProfile"] = vmp.ScheduledEventsProfile - } - if vmp.UserData != nil { - objectMap["userData"] = vmp.UserData - } - if vmp.CapacityReservation != nil { - objectMap["capacityReservation"] = vmp.CapacityReservation - } - if vmp.ApplicationProfile != nil { - objectMap["applicationProfile"] = vmp.ApplicationProfile - } - return json.Marshal(objectMap) -} - -// VirtualMachinePublicIPAddressConfiguration describes a virtual machines IP Configuration's -// PublicIPAddress configuration -type VirtualMachinePublicIPAddressConfiguration struct { - // Name - The publicIP address configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachinePublicIPAddressConfigurationProperties `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachinePublicIPAddressConfiguration. -func (vmpiac VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmpiac.Name != nil { - objectMap["name"] = vmpiac.Name - } - if vmpiac.VirtualMachinePublicIPAddressConfigurationProperties != nil { - objectMap["properties"] = vmpiac.VirtualMachinePublicIPAddressConfigurationProperties - } - if vmpiac.Sku != nil { - objectMap["sku"] = vmpiac.Sku - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachinePublicIPAddressConfiguration struct. -func (vmpiac *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmpiac.Name = &name - } - case "properties": - if v != nil { - var virtualMachinePublicIPAddressConfigurationProperties VirtualMachinePublicIPAddressConfigurationProperties - err = json.Unmarshal(*v, &virtualMachinePublicIPAddressConfigurationProperties) - if err != nil { - return err - } - vmpiac.VirtualMachinePublicIPAddressConfigurationProperties = &virtualMachinePublicIPAddressConfigurationProperties - } - case "sku": - if v != nil { - var sku PublicIPAddressSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmpiac.Sku = &sku - } - } - } - - return nil -} - -// VirtualMachinePublicIPAddressConfigurationProperties describes a virtual machines IP Configuration's -// PublicIPAddress configuration -type VirtualMachinePublicIPAddressConfigurationProperties struct { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DeleteOption - Specify what happens to the public IP address when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration `json:"dnsSettings,omitempty"` - // IPTags - The list of IP tags associated with the public IP address. - IPTags *[]VirtualMachineIPTag `json:"ipTags,omitempty"` - // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // PublicIPAddressVersion - 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'. Possible values include: 'IPVersionsIPv4', 'IPVersionsIPv6' - PublicIPAddressVersion IPVersions `json:"publicIPAddressVersion,omitempty"` - // PublicIPAllocationMethod - Specify the public IP allocation type. Possible values include: 'Dynamic', 'Static' - PublicIPAllocationMethod PublicIPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` -} - -// VirtualMachinePublicIPAddressDNSSettingsConfiguration describes a virtual machines network -// configuration's DNS settings. -type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { - // DomainNameLabel - 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 `json:"domainNameLabel,omitempty"` -} - -// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk -// will always be reimaged -type VirtualMachineReimageParameters struct { - // TempDisk - 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 `json:"tempDisk,omitempty"` -} - -// VirtualMachineRunCommand describes a Virtual Machine run command. -type VirtualMachineRunCommand struct { - autorest.Response `json:"-"` - *VirtualMachineRunCommandProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineRunCommand. -func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmrc.VirtualMachineRunCommandProperties != nil { - objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties - } - if vmrc.Location != nil { - objectMap["location"] = vmrc.Location - } - if vmrc.Tags != nil { - objectMap["tags"] = vmrc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. -func (vmrc *VirtualMachineRunCommand) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties - err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) - if err != nil { - return err - } - vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmrc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmrc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmrc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmrc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmrc.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. -type VirtualMachineRunCommandInstanceView struct { - // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' - ExecutionState ExecutionState `json:"executionState,omitempty"` - // ExecutionMessage - Communicate script configuration errors or execution messages. - ExecutionMessage *string `json:"executionMessage,omitempty"` - // ExitCode - Exit code returned from script execution. - ExitCode *int32 `json:"exitCode,omitempty"` - // Output - Script output stream. - Output *string `json:"output,omitempty"` - // Error - Script error stream. - Error *string `json:"error,omitempty"` - // StartTime - Script start time. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - Script end time. - EndTime *date.Time `json:"endTime,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. -type VirtualMachineRunCommandProperties struct { - // Source - The source of the run command script. - Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` - // Parameters - The parameters used by the script. - Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` - // ProtectedParameters - The parameters used by the script. - ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` - // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. - AsyncExecution *bool `json:"asyncExecution,omitempty"` - // RunAsUser - Specifies the user account on the VM when executing the run command. - RunAsUser *string `json:"runAsUser,omitempty"` - // RunAsPassword - Specifies the user account password on the VM when executing the run command. - RunAsPassword *string `json:"runAsPassword,omitempty"` - // TimeoutInSeconds - The timeout in seconds to execute the run command. - TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` - // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. - OutputBlobURI *string `json:"outputBlobUri,omitempty"` - // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. - ErrorBlobURI *string `json:"errorBlobUri,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The virtual machine run command instance view. - InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. -func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmrcp.Source != nil { - objectMap["source"] = vmrcp.Source - } - if vmrcp.Parameters != nil { - objectMap["parameters"] = vmrcp.Parameters - } - if vmrcp.ProtectedParameters != nil { - objectMap["protectedParameters"] = vmrcp.ProtectedParameters - } - if vmrcp.AsyncExecution != nil { - objectMap["asyncExecution"] = vmrcp.AsyncExecution - } - if vmrcp.RunAsUser != nil { - objectMap["runAsUser"] = vmrcp.RunAsUser - } - if vmrcp.RunAsPassword != nil { - objectMap["runAsPassword"] = vmrcp.RunAsPassword - } - if vmrcp.TimeoutInSeconds != nil { - objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds - } - if vmrcp.OutputBlobURI != nil { - objectMap["outputBlobUri"] = vmrcp.OutputBlobURI - } - if vmrcp.ErrorBlobURI != nil { - objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI - } - return json.Marshal(objectMap) -} - -// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineRunCommandsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineRunCommandsCreateOrUpdateFuture.Result. -func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmrc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { - vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineRunCommandScriptSource describes the script sources for run command. -type VirtualMachineRunCommandScriptSource struct { - // Script - Specifies the script content to be executed on the VM. - Script *string `json:"script,omitempty"` - // ScriptURI - Specifies the script download location. - ScriptURI *string `json:"scriptUri,omitempty"` - // CommandID - Specifies a commandId of predefined built-in script. - CommandID *string `json:"commandId,omitempty"` -} - -// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineRunCommandsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineRunCommandsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineRunCommandsDeleteFuture.Result. -func (future *VirtualMachineRunCommandsDeleteFuture) result(client VirtualMachineRunCommandsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineRunCommandsListResult the List run command operation response -type VirtualMachineRunCommandsListResult struct { - autorest.Response `json:"-"` - // Value - The list of run commands - Value *[]VirtualMachineRunCommand `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of run commands. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of -// VirtualMachineRunCommand values. -type VirtualMachineRunCommandsListResultIterator struct { - i int - page VirtualMachineRunCommandsListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineRunCommandsListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { - if !iter.page.NotDone() { - return VirtualMachineRunCommand{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. -func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { - return VirtualMachineRunCommandsListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { - return vmrclr.Value == nil || len(*vmrclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { - return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 -} - -// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmrclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmrclr.NextLink))) -} - -// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. -type VirtualMachineRunCommandsListResultPage struct { - fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) - vmrclr VirtualMachineRunCommandsListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmrclr) - if err != nil { - return err - } - page.vmrclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineRunCommandsListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { - return !page.vmrclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { - return page.vmrclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { - if page.vmrclr.IsEmpty() { - return nil - } - return *page.vmrclr.Value -} - -// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. -func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { - return VirtualMachineRunCommandsListResultPage{ - fn: getNextPage, - vmrclr: cur, - } -} - -// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineRunCommandsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineRunCommandsUpdateFuture.Result. -func (future *VirtualMachineRunCommandsUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmrc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { - vmrc, err = client.UpdateResponder(vmrc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. -type VirtualMachineRunCommandUpdate struct { - *VirtualMachineRunCommandProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. -func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmrcu.VirtualMachineRunCommandProperties != nil { - objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties - } - if vmrcu.Tags != nil { - objectMap["tags"] = vmrcu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. -func (vmrcu *VirtualMachineRunCommandUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties - err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) - if err != nil { - return err - } - vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmrcu.Tags = tags - } - } - } - - return nil -} - -// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesAssessPatchesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesAssessPatchesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesAssessPatchesFuture.Result. -func (future *VirtualMachinesAssessPatchesFuture) result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmapr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { - vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSet describes a Virtual Machine Scale Set. -type VirtualMachineScaleSet struct { - autorest.Response `json:"-"` - // Sku - The virtual machine scale set sku. - Sku *Sku `json:"sku,omitempty"` - // 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**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineScaleSetProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set - Zones *[]string `json:"zones,omitempty"` - // ExtendedLocation - The extended location of the Virtual Machine Scale Set. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. -func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmss.Sku != nil { - objectMap["sku"] = vmss.Sku - } - if vmss.Plan != nil { - objectMap["plan"] = vmss.Plan - } - if vmss.VirtualMachineScaleSetProperties != nil { - objectMap["properties"] = vmss.VirtualMachineScaleSetProperties - } - if vmss.Identity != nil { - objectMap["identity"] = vmss.Identity - } - if vmss.Zones != nil { - objectMap["zones"] = vmss.Zones - } - if vmss.ExtendedLocation != nil { - objectMap["extendedLocation"] = vmss.ExtendedLocation - } - if vmss.Location != nil { - objectMap["location"] = vmss.Location - } - if vmss.Tags != nil { - objectMap["tags"] = vmss.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. -func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmss.Sku = &sku - } - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmss.Plan = &plan - } - case "properties": - if v != nil { - var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) - if err != nil { - return err - } - vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties - } - case "identity": - if v != nil { - var identity VirtualMachineScaleSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmss.Identity = &identity - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - vmss.Zones = &zones - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - vmss.ExtendedLocation = &extendedLocation - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmss.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmss.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmss.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmss.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmss.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. -type VirtualMachineScaleSetDataDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Lun - 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 `json:"lun,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskIOPSReadWrite - 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 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - 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 `json:"diskMBpsReadWrite,omitempty"` - // DeleteOption - 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**. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtension struct { - autorest.Response `json:"-"` - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. -func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmsse.Name != nil { - objectMap["name"] = vmsse.Name - } - if vmsse.VirtualMachineScaleSetExtensionProperties != nil { - objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. -func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmsse.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsse.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) - if err != nil { - return err - } - vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmsse.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. -type VirtualMachineScaleSetExtensionListResult struct { - autorest.Response `json:"-"` - // Value - The list of VM scale set extensions. - Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetExtension values. -type VirtualMachineScaleSetExtensionListResultIterator struct { - i int - page VirtualMachineScaleSetExtensionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { - if !iter.page.NotDone() { - return VirtualMachineScaleSetExtension{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. -func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { - return VirtualMachineScaleSetExtensionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { - return vmsselr.Value == nil || len(*vmsselr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { - return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 -} - -// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsselr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsselr.NextLink))) -} - -// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. -type VirtualMachineScaleSetExtensionListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) - vmsselr VirtualMachineScaleSetExtensionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsselr) - if err != nil { - return err - } - page.vmsselr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { - return !page.vmsselr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { - return page.vmsselr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { - if page.vmsselr.IsEmpty() { - return nil - } - return *page.vmsselr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. -func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { - return VirtualMachineScaleSetExtensionListResultPage{ - fn: getNextPage, - vmsselr: cur, - } -} - -// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. -type VirtualMachineScaleSetExtensionProfile struct { - // Extensions - The virtual machine scale set child extension resources. - Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` - // ExtensionsTimeBudget - 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 `json:"extensionsTimeBudget,omitempty"` -} - -// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set -// Extension. -type VirtualMachineScaleSetExtensionProperties struct { - // ForceUpdateTag - 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 `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // AutoUpgradeMinorVersion - 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 `json:"autoUpgradeMinorVersion,omitempty"` - // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` - // SuppressFailures - 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 `json:"suppressFailures,omitempty"` - // ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault - ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. -func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag - } - if vmssep.Publisher != nil { - objectMap["publisher"] = vmssep.Publisher - } - if vmssep.Type != nil { - objectMap["type"] = vmssep.Type - } - if vmssep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion - } - if vmssep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion - } - if vmssep.EnableAutomaticUpgrade != nil { - objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade - } - if vmssep.Settings != nil { - objectMap["settings"] = vmssep.Settings - } - if vmssep.ProtectedSettings != nil { - objectMap["protectedSettings"] = vmssep.ProtectedSettings - } - if vmssep.ProvisionAfterExtensions != nil { - objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions - } - if vmssep.SuppressFailures != nil { - objectMap["suppressFailures"] = vmssep.SuppressFailures - } - if vmssep.ProtectedSettingsFromKeyVault != nil { - objectMap["protectedSettingsFromKeyVault"] = vmssep.ProtectedSettingsFromKeyVault - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmsse.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { - vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmsse.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { - vmsse, err = client.UpdateResponder(vmsse.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionUpdate struct { - // Name - READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. -func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { - objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. -func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmsseu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsseu.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) - if err != nil { - return err - } - vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmsseu.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetHardwareProfile specifies the hardware settings for the virtual machine scale set. -type VirtualMachineScaleSetHardwareProfile struct { - // VMSizeProperties - 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 `json:"vmSizeProperties,omitempty"` -} - -// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. -type VirtualMachineScaleSetIdentity struct { - // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - 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 `json:"tenantId,omitempty"` - // Type - 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. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - 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 `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. -func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssi.Type != "" { - objectMap["type"] = vmssi.Type - } - if vmssi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. -type VirtualMachineScaleSetInstanceView struct { - autorest.Response `json:"-"` - // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. - VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` - // Extensions - READ-ONLY; The extensions information. - Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // OrchestrationServices - READ-ONLY; The orchestration services information. - OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. -func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssiv.Statuses != nil { - objectMap["statuses"] = vmssiv.Statuses - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of -// a virtual machine scale set. -type VirtualMachineScaleSetInstanceViewStatusesSummary struct { - // StatusesSummary - READ-ONLY; The extensions information. - StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. -func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP -// configuration. -type VirtualMachineScaleSetIPConfiguration struct { - // Name - The IP configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. -func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssic.Name != nil { - objectMap["name"] = vmssic.Name - } - if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { - objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties - } - if vmssic.ID != nil { - objectMap["id"] = vmssic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. -func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssic.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) - if err != nil { - return err - } - vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssic.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's -// IP configuration properties. -type VirtualMachineScaleSetIPConfigurationProperties struct { - // Subnet - Specifies the identifier of the subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - 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'. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // ApplicationGatewayBackendAddressPools - 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 `json:"applicationGatewayBackendAddressPools,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - 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 `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - 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 `json:"loadBalancerInboundNatPools,omitempty"` -} - -// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. -type VirtualMachineScaleSetIPTag struct { - // IPTagType - IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string `json:"tag,omitempty"` -} - -// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History -// operation response. -type VirtualMachineScaleSetListOSUpgradeHistory struct { - autorest.Response `json:"-"` - // Value - The list of OS upgrades performed on the virtual machine scale set. - Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of -// UpgradeOperationHistoricalStatusInfo values. -type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { - i int - page VirtualMachineScaleSetListOSUpgradeHistoryPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { - if !iter.page.NotDone() { - return UpgradeOperationHistoricalStatusInfo{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { - return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { - return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { - return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 -} - -// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslouh.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslouh.NextLink))) -} - -// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo -// values. -type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { - fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) - vmsslouh VirtualMachineScaleSetListOSUpgradeHistory -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslouh) - if err != nil { - return err - } - page.vmsslouh = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { - return !page.vmsslouh.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { - return page.vmsslouh -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { - if page.vmsslouh.IsEmpty() { - return nil - } - return *page.vmsslouh.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { - return VirtualMachineScaleSetListOSUpgradeHistoryPage{ - fn: getNextPage, - vmsslouh: cur, - } -} - -// VirtualMachineScaleSetListResult the List Virtual Machine operation response. -type VirtualMachineScaleSetListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets. - Value *[]VirtualMachineScaleSet `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet -// values. -type VirtualMachineScaleSetListResultIterator struct { - i int - page VirtualMachineScaleSetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { - if !iter.page.NotDone() { - return VirtualMachineScaleSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. -func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { - return VirtualMachineScaleSetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { - return vmsslr.Value == nil || len(*vmsslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { - return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 -} - -// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslr.NextLink))) -} - -// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. -type VirtualMachineScaleSetListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) - vmsslr VirtualMachineScaleSetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslr) - if err != nil { - return err - } - page.vmsslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListResultPage) NotDone() bool { - return !page.vmsslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { - return page.vmsslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { - if page.vmsslr.IsEmpty() { - return nil - } - return *page.vmsslr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListResultPage type. -func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { - return VirtualMachineScaleSetListResultPage{ - fn: getNextPage, - vmsslr: cur, - } -} - -// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. -type VirtualMachineScaleSetListSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of skus available for the virtual machine scale set. - Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of -// VirtualMachineScaleSetSku values. -type VirtualMachineScaleSetListSkusResultIterator struct { - i int - page VirtualMachineScaleSetListSkusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { - if !iter.page.NotDone() { - return VirtualMachineScaleSetSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. -func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { - return VirtualMachineScaleSetListSkusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { - return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { - return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 -} - -// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslsr.NextLink))) -} - -// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. -type VirtualMachineScaleSetListSkusResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) - vmsslsr VirtualMachineScaleSetListSkusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslsr) - if err != nil { - return err - } - page.vmsslsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { - return !page.vmsslsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { - return page.vmsslsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { - if page.vmsslsr.IsEmpty() { - return nil - } - return *page.vmsslsr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. -func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { - return VirtualMachineScaleSetListSkusResultPage{ - fn: getNextPage, - vmsslsr: cur, - } -} - -// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. -type VirtualMachineScaleSetListWithLinkResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets. - Value *[]VirtualMachineScaleSet `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of -// VirtualMachineScaleSet values. -type VirtualMachineScaleSetListWithLinkResultIterator struct { - i int - page VirtualMachineScaleSetListWithLinkResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { - if !iter.page.NotDone() { - return VirtualMachineScaleSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. -func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { - return VirtualMachineScaleSetListWithLinkResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { - return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { - return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 -} - -// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslwlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) -} - -// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. -type VirtualMachineScaleSetListWithLinkResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) - vmsslwlr VirtualMachineScaleSetListWithLinkResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslwlr) - if err != nil { - return err - } - page.vmsslwlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { - return !page.vmsslwlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { - return page.vmsslwlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { - if page.vmsslwlr.IsEmpty() { - return nil - } - return *page.vmsslwlr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. -func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { - return VirtualMachineScaleSetListWithLinkResultPage{ - fn: getNextPage, - vmsslwlr: cur, - } -} - -// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. -type VirtualMachineScaleSetManagedDiskParameters struct { - // StorageAccountType - 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. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS', 'StorageAccountTypesPremiumV2LRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - // SecurityProfile - Specifies the security profile for the managed disk. - SecurityProfile *VMDiskSecurityProfile `json:"securityProfile,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. -type VirtualMachineScaleSetNetworkConfiguration struct { - // Name - The network configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. -func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssnc.Name != nil { - objectMap["name"] = vmssnc.Name - } - if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { - objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties - } - if vmssnc.ID != nil { - objectMap["id"] = vmssnc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. -func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssnc.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) - if err != nil { - return err - } - vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssnc.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network -// configuration's DNS settings. -type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { - // DNSServers - List of DNS servers IP addresses - DNSServers *[]string `json:"dnsServers,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network -// profile's IP configuration. -type VirtualMachineScaleSetNetworkConfigurationProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPConfigurations - Specifies the IP configurations of the network interface. - IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. -type VirtualMachineScaleSetNetworkProfile struct { - // HealthProbe - 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 `json:"healthProbe,omitempty"` - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` - // NetworkAPIVersion - 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'. Possible values include: 'TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' - NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` -} - -// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. -type VirtualMachineScaleSetOSDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - Specifies how the virtual machines in the scale set should be created.

    The only allowed value is: **FromImage** \u2013 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. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // OsType - 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**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Image - Specifies information about the unmanaged user image to base the scale set on. - Image *VirtualHardDisk `json:"image,omitempty"` - // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. - VhdContainers *[]string `json:"vhdContainers,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DeleteOption - 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. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetOSProfile struct { - // ComputerNamePrefix - 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 `json:"computerNamePrefix,omitempty"` - // AdminUsername - 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 `json:"adminUsername,omitempty"` - // AdminPassword - 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 `json:"adminPassword,omitempty"` - // CustomData - 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 `json:"customData,omitempty"` - // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // 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). - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - 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 `json:"secrets,omitempty"` - // AllowExtensionOperations - 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 `json:"allowExtensionOperations,omitempty"` -} - -// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetProperties struct { - // UpgradePolicy - The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - // AutomaticRepairsPolicy - Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - // VirtualMachineProfile - The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - // DoNotRunExtensionsOnOverprovisionedVMs - 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 `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - UniqueID *string `json:"uniqueId,omitempty"` - // SinglePlacementGroup - 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 `json:"singlePlacementGroup,omitempty"` - // ZoneBalance - 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 `json:"zoneBalance,omitempty"` - // PlatformFaultDomainCount - Fault Domain count for each placement group. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // ProximityPlacementGroup - 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 `json:"proximityPlacementGroup,omitempty"` - // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in.

    Minimum api-version: 2020-06-01. - HostGroup *SubResource `json:"hostGroup,omitempty"` - // AdditionalCapabilities - 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 `json:"additionalCapabilities,omitempty"` - // ScaleInPolicy - Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` - // OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. Possible values include: 'Uniform', 'Flexible' - OrchestrationMode OrchestrationMode `json:"orchestrationMode,omitempty"` - // SpotRestorePolicy - Specifies the Spot Restore properties for the virtual machine scale set. - SpotRestorePolicy *SpotRestorePolicy `json:"spotRestorePolicy,omitempty"` - // PriorityMixPolicy - Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. - PriorityMixPolicy *PriorityMixPolicy `json:"priorityMixPolicy,omitempty"` - // TimeCreated - READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created.

    Minimum api-version: 2021-11-01. - TimeCreated *date.Time `json:"timeCreated,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. -func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssp.UpgradePolicy != nil { - objectMap["upgradePolicy"] = vmssp.UpgradePolicy - } - if vmssp.AutomaticRepairsPolicy != nil { - objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy - } - if vmssp.VirtualMachineProfile != nil { - objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile - } - if vmssp.Overprovision != nil { - objectMap["overprovision"] = vmssp.Overprovision - } - if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { - objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs - } - if vmssp.SinglePlacementGroup != nil { - objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup - } - if vmssp.ZoneBalance != nil { - objectMap["zoneBalance"] = vmssp.ZoneBalance - } - if vmssp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount - } - if vmssp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup - } - if vmssp.HostGroup != nil { - objectMap["hostGroup"] = vmssp.HostGroup - } - if vmssp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities - } - if vmssp.ScaleInPolicy != nil { - objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy - } - if vmssp.OrchestrationMode != "" { - objectMap["orchestrationMode"] = vmssp.OrchestrationMode - } - if vmssp.SpotRestorePolicy != nil { - objectMap["spotRestorePolicy"] = vmssp.SpotRestorePolicy - } - if vmssp.PriorityMixPolicy != nil { - objectMap["priorityMixPolicy"] = vmssp.PriorityMixPolicy - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfiguration struct { - // Name - The publicIP address configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. -func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmsspiac.Name != nil { - objectMap["name"] = vmsspiac.Name - } - if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { - objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties - } - if vmsspiac.Sku != nil { - objectMap["sku"] = vmsspiac.Sku - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. -func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmsspiac.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) - if err != nil { - return err - } - vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties - } - case "sku": - if v != nil { - var sku PublicIPAddressSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmsspiac.Sku = &sku - } - } - } - - return nil -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets -// network configuration's DNS settings. -type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { - // DomainNameLabel - 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 `json:"domainNameLabel,omitempty"` -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPTags - The list of IP tags associated with the public IP address. - IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` - // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // PublicIPAddressVersion - 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'. Possible values include: 'IPv4', 'IPv6' - PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` - // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetReimageParameters struct { - // InstanceIds - 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 `json:"instanceIds,omitempty"` - // TempDisk - 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 `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and -// retrieving the results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmss.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { - vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. -func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. -func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsDeleteInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. -type VirtualMachineScaleSetSku struct { - // ResourceType - READ-ONLY; The type of resource the sku applies to. - ResourceType *string `json:"resourceType,omitempty"` - // Sku - READ-ONLY; The Sku. - Sku *Sku `json:"sku,omitempty"` - // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. -func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. -type VirtualMachineScaleSetSkuCapacity struct { - // Minimum - READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty"` - // DefaultCapacity - READ-ONLY; The default capacity. - DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' - ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. -func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetsPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. -func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. -func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsReimageAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. -func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. -func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. -func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. -func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. -func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetStorageProfile struct { - // 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. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - 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 `json:"osDisk,omitempty"` - // DataDisks - 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 `json:"dataDisks,omitempty"` - DiskControllerType *string `json:"diskControllerType,omitempty"` -} - -// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. -func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmss.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { - vmss, err = client.UpdateResponder(vmss.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsUpdateInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdate struct { - // Sku - The virtual machine scale set sku. - Sku *Sku `json:"sku,omitempty"` - // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. -func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssu.Sku != nil { - objectMap["sku"] = vmssu.Sku - } - if vmssu.Plan != nil { - objectMap["plan"] = vmssu.Plan - } - if vmssu.VirtualMachineScaleSetUpdateProperties != nil { - objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties - } - if vmssu.Identity != nil { - objectMap["identity"] = vmssu.Identity - } - if vmssu.Tags != nil { - objectMap["tags"] = vmssu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. -func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmssu.Sku = &sku - } - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmssu.Plan = &plan - } - case "properties": - if v != nil { - var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) - if err != nil { - return err - } - vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties - } - case "identity": - if v != nil { - var identity VirtualMachineScaleSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmssu.Identity = &identity - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmssu.Tags = tags - } - } - } - - return nil -} - -// 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 { - // Name - The IP configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. -func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssuic.Name != nil { - objectMap["name"] = vmssuic.Name - } - if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { - objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties - } - if vmssuic.ID != nil { - objectMap["id"] = vmssuic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. -func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssuic.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) - if err != nil { - return err - } - vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssuic.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network -// profile's IP configuration properties. -type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { - // Subnet - The subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` - // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - 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'. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - The load balancer backend address pools. - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - The load balancer inbound nat pools. - LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. -type VirtualMachineScaleSetUpdateNetworkConfiguration struct { - // Name - The network configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. -func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssunc.Name != nil { - objectMap["name"] = vmssunc.Name - } - if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { - objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties - } - if vmssunc.ID != nil { - objectMap["id"] = vmssunc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. -func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssunc.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) - if err != nil { - return err - } - vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssunc.ID = &ID - } - } - } - - return nil -} - -// 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 { - // Primary - Whether this is a primary NIC on a virtual machine. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking. - DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. - EnableFpga *bool `json:"enableFpga,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPConfigurations - The virtual machine scale set IP Configuration. - IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. -type VirtualMachineScaleSetUpdateNetworkProfile struct { - // HealthProbe - 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 `json:"healthProbe,omitempty"` - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` - // NetworkAPIVersion - 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'. Possible values include: 'TwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' - NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update -// Object. This should be used for Updating VMSS OS Disk. -type VirtualMachineScaleSetUpdateOSDisk struct { - // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiskSizeGB - 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 `json:"diskSizeGB,omitempty"` - // Image - 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 `json:"image,omitempty"` - // VhdContainers - The list of virtual hard disk container uris. - VhdContainers *[]string `json:"vhdContainers,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DeleteOption - 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. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' - DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetUpdateOSProfile struct { - // CustomData - A base-64 encoded string of custom data. - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - The Windows Configuration of the OS profile. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - The Linux Configuration of the OS profile. - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - The List of certificates for addition to the VM. - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` -} - -// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdateProperties struct { - // UpgradePolicy - The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - // AutomaticRepairsPolicy - Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - // VirtualMachineProfile - The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` - // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - // DoNotRunExtensionsOnOverprovisionedVMs - 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 `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - // SinglePlacementGroup - 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 `json:"singlePlacementGroup,omitempty"` - // AdditionalCapabilities - 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 `json:"additionalCapabilities,omitempty"` - // ScaleInPolicy - Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` - // ProximityPlacementGroup - 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 `json:"proximityPlacementGroup,omitempty"` -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { - // Name - The publicIP address configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. -func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssupiac.Name != nil { - objectMap["name"] = vmssupiac.Name - } - if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { - objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. -func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssupiac.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) - if err != nil { - return err - } - vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - } - } - } - - return nil -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale -// set IP Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetUpdateStorageProfile struct { - // ImageReference - The image reference. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - The OS disk. - OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` - // DataDisks - The data disks. - DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` - DiskControllerType *string `json:"diskControllerType,omitempty"` -} - -// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetUpdateVMProfile struct { - // OsProfile - The virtual machine scale set OS profile. - OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` - // StorageProfile - The virtual machine scale set storage profile. - StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` - // NetworkProfile - The virtual machine scale set network profile. - NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` - // SecurityProfile - The virtual machine scale set Security profile - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // DiagnosticsProfile - The virtual machine scale set diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // ExtensionProfile - The virtual machine scale set extension profile. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - The license type, which is for bring your own license scenario. - LicenseType *string `json:"licenseType,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

    Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - // UserData - 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 `json:"userData,omitempty"` - // HardwareProfile - Specifies the hardware profile related details of a scale set.

    Minimum api-version: 2021-11-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile `json:"hardwareProfile,omitempty"` -} - -// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVM struct { - autorest.Response `json:"-"` - // InstanceID - READ-ONLY; The virtual machine instance ID. - InstanceID *string `json:"instanceId,omitempty"` - // Sku - READ-ONLY; The virtual machine SKU. - Sku *Sku `json:"sku,omitempty"` - *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` - // 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**. - Plan *Plan `json:"plan,omitempty"` - // Resources - READ-ONLY; The virtual machine child extension resources. - Resources *[]VirtualMachineExtension `json:"resources,omitempty"` - // Zones - READ-ONLY; The virtual machine zones. - Zones *[]string `json:"zones,omitempty"` - // Identity - The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. -func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssv.VirtualMachineScaleSetVMProperties != nil { - objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties - } - if vmssv.Plan != nil { - objectMap["plan"] = vmssv.Plan - } - if vmssv.Identity != nil { - objectMap["identity"] = vmssv.Identity - } - if vmssv.Location != nil { - objectMap["location"] = vmssv.Location - } - if vmssv.Tags != nil { - objectMap["tags"] = vmssv.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. -func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "instanceId": - if v != nil { - var instanceID string - err = json.Unmarshal(*v, &instanceID) - if err != nil { - return err - } - vmssv.InstanceID = &instanceID - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmssv.Sku = &sku - } - case "properties": - if v != nil { - var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) - if err != nil { - return err - } - vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties - } - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmssv.Plan = &plan - } - case "resources": - if v != nil { - var resources []VirtualMachineExtension - err = json.Unmarshal(*v, &resources) - if err != nil { - return err - } - vmssv.Resources = &resources - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - vmssv.Zones = &zones - } - case "identity": - if v != nil { - var identity VirtualMachineIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmssv.Identity = &identity - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssv.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssv.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmssv.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmssv.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmssv.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtension struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. -func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssve.VirtualMachineExtensionProperties != nil { - objectMap["properties"] = vmssve.VirtualMachineExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. -func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssve.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmssve.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineExtensionProperties VirtualMachineExtensionProperties - err = json.Unmarshal(*v, &virtualMachineExtensionProperties) - if err != nil { - return err - } - vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssve.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmssve.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { - vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response -type VirtualMachineScaleSetVMExtensionsListResult struct { - autorest.Response `json:"-"` - // Value - The list of VMSS VM extensions - Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` -} - -// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine -// scale set. -type VirtualMachineScaleSetVMExtensionsSummary struct { - // Name - READ-ONLY; The extension name. - Name *string `json:"name,omitempty"` - // StatusesSummary - READ-ONLY; The extensions information. - StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. -func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmssve.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { - vmssve, err = client.UpdateResponder(vmssve.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. -type VirtualMachineScaleSetVMExtensionUpdate struct { - // Name - READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. -func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssveu.VirtualMachineExtensionUpdateProperties != nil { - objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. -func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssveu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmssveu.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties - err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) - if err != nil { - return err - } - vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssveu.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale -// set. -type VirtualMachineScaleSetVMInstanceIDs struct { - // InstanceIds - 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 `json:"instanceIds,omitempty"` -} - -// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM -// scale set. -type VirtualMachineScaleSetVMInstanceRequiredIDs struct { - // InstanceIds - The virtual machine scale set instance ids. - InstanceIds *[]string `json:"instanceIds,omitempty"` -} - -// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. -type VirtualMachineScaleSetVMInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - The Update Domain count. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - The Fault Domain count. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // RdpThumbPrint - The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - // VMAgent - The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - // Disks - The disks information. - Disks *[]DiskInstanceView `json:"disks,omitempty"` - // Extensions - The extensions information. - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // VMHealth - READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` - // 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. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // AssignedHost - 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 `json:"assignedHost,omitempty"` - // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. - PlacementGroupID *string `json:"placementGroupId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. -func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssviv.PlatformUpdateDomain != nil { - objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain - } - if vmssviv.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain - } - if vmssviv.RdpThumbPrint != nil { - objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint - } - if vmssviv.VMAgent != nil { - objectMap["vmAgent"] = vmssviv.VMAgent - } - if vmssviv.MaintenanceRedeployStatus != nil { - objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus - } - if vmssviv.Disks != nil { - objectMap["disks"] = vmssviv.Disks - } - if vmssviv.Extensions != nil { - objectMap["extensions"] = vmssviv.Extensions - } - if vmssviv.BootDiagnostics != nil { - objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics - } - if vmssviv.Statuses != nil { - objectMap["statuses"] = vmssviv.Statuses - } - if vmssviv.PlacementGroupID != nil { - objectMap["placementGroupId"] = vmssviv.PlacementGroupID - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. -type VirtualMachineScaleSetVMListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets VMs. - Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetVM values. -type VirtualMachineScaleSetVMListResultIterator struct { - i int - page VirtualMachineScaleSetVMListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { - if !iter.page.NotDone() { - return VirtualMachineScaleSetVM{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. -func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { - return VirtualMachineScaleSetVMListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { - return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { - return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 -} - -// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmssvlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmssvlr.NextLink))) -} - -// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. -type VirtualMachineScaleSetVMListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) - vmssvlr VirtualMachineScaleSetVMListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmssvlr) - if err != nil { - return err - } - page.vmssvlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetVMListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { - return !page.vmssvlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { - return page.vmssvlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { - if page.vmssvlr.IsEmpty() { - return nil - } - return *page.vmssvlr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. -func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { - return VirtualMachineScaleSetVMListResultPage{ - fn: getNextPage, - vmssvlr: cur, - } -} - -// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network -// profile. -type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetVMProfile struct { - // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. - OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` - // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. - NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` - // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

    Possible values for Windows Server operating system are:

    Windows_Client

    Windows_Server

    Possible values for Linux Server operating system are:

    RHEL_BYOS (for RHEL)

    SLES_BYOS (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 `json:"licenseType,omitempty"` - // Priority - Specifies the priority for the virtual machines in the scale set.

    Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' - Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - 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. Possible values include: 'VirtualMachineEvictionPolicyTypesDeallocate', 'VirtualMachineEvictionPolicyTypesDelete' - EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

    Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` - // UserData - 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 `json:"userData,omitempty"` - // CapacityReservation - Specifies the capacity reservation related details of a scale set.

    Minimum api-version: 2021-04-01. - CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` - // ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS - ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` - // HardwareProfile - Specifies the hardware profile related details of a scale set.

    Minimum api-version: 2021-11-01. - HardwareProfile *VirtualMachineScaleSetHardwareProfile `json:"hardwareProfile,omitempty"` -} - -// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual -// machine. -type VirtualMachineScaleSetVMProperties struct { - // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. - LatestModelApplied *bool `json:"latestModelApplied,omitempty"` - // VMID - READ-ONLY; Azure VM unique ID. - VMID *string `json:"vmId,omitempty"` - // InstanceView - READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` - // HardwareProfile - Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdditionalCapabilities - 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 `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings for the virtual machine. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // SecurityProfile - Specifies the Security related profile settings for the virtual machine. - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - // NetworkProfile - Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. - NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // 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 availability set at creation time. An existing VM cannot be added to an availability set. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

    Possible values for Windows Server operating system are:

    Windows_Client

    Windows_Server

    Possible values for Linux Server operating system are:

    RHEL_BYOS (for RHEL)

    SLES_BYOS (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 `json:"licenseType,omitempty"` - // ModelDefinitionApplied - 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 `json:"modelDefinitionApplied,omitempty"` - // ProtectionPolicy - Specifies the protection policy of the virtual machine. - ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` - // UserData - 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 `json:"userData,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. -func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssvp.HardwareProfile != nil { - objectMap["hardwareProfile"] = vmssvp.HardwareProfile - } - if vmssvp.StorageProfile != nil { - objectMap["storageProfile"] = vmssvp.StorageProfile - } - if vmssvp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities - } - if vmssvp.OsProfile != nil { - objectMap["osProfile"] = vmssvp.OsProfile - } - if vmssvp.SecurityProfile != nil { - objectMap["securityProfile"] = vmssvp.SecurityProfile - } - if vmssvp.NetworkProfile != nil { - objectMap["networkProfile"] = vmssvp.NetworkProfile - } - if vmssvp.NetworkProfileConfiguration != nil { - objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration - } - if vmssvp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile - } - if vmssvp.AvailabilitySet != nil { - objectMap["availabilitySet"] = vmssvp.AvailabilitySet - } - if vmssvp.LicenseType != nil { - objectMap["licenseType"] = vmssvp.LicenseType - } - if vmssvp.ProtectionPolicy != nil { - objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy - } - if vmssvp.UserData != nil { - objectMap["userData"] = vmssvp.UserData - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. -type VirtualMachineScaleSetVMProtectionPolicy struct { - // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. - ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` - // ProtectFromScaleSetActions - 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 `json:"protectFromScaleSetActions,omitempty"` -} - -// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetVMReimageParameters struct { - // TempDisk - 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 `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmrc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { - vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMRunCommandsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMRunCommandsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMRunCommandsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmrc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { - vmrc, err = client.UpdateResponder(vmrc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. -func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsReimageAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. -func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. -func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRunCommandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { - rcr, err = client.RunCommandResponder(rcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. -func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmssv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { - vmssv, err = client.UpdateResponder(vmssv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesCaptureFuture.Result. -func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { - vmcr, err = client.CaptureResponder(vmcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesConvertToManagedDisksFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. -func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachine, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. -func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - VM.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.CreateOrUpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesDeallocateFuture.Result. -func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesDeleteFuture.Result. -func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesInstallPatchesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesInstallPatchesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachineInstallPatchesResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesInstallPatchesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesInstallPatchesFuture.Result. -func (future *VirtualMachinesInstallPatchesFuture) result(client VirtualMachinesClient) (vmipr VirtualMachineInstallPatchesResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmipr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesInstallPatchesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmipr.Response.Response, err = future.GetResult(sender); err == nil && vmipr.Response.Response.StatusCode != http.StatusNoContent { - vmipr, err = client.InstallPatchesResponder(vmipr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", vmipr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineSize describes the properties of a VM size. -type VirtualMachineSize struct { - // Name - The name of the virtual machine size. - Name *string `json:"name,omitempty"` - // NumberOfCores - 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 `json:"numberOfCores,omitempty"` - // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. - OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` - // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. - ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` - // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. - MemoryInMB *int32 `json:"memoryInMB,omitempty"` - // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. - MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` -} - -// VirtualMachineSizeListResult the List Virtual Machine operation response. -type VirtualMachineSizeListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine sizes. - Value *[]VirtualMachineSize `json:"value,omitempty"` -} - -// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. -type VirtualMachineSoftwarePatchProperties struct { - // PatchID - READ-ONLY; A unique identifier for the patch. - PatchID *string `json:"patchId,omitempty"` - // Name - READ-ONLY; The friendly name of the patch. - Name *string `json:"name,omitempty"` - // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. - Version *string `json:"version,omitempty"` - // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. - KbID *string `json:"kbId,omitempty"` - // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. - Classifications *[]string `json:"classifications,omitempty"` - // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'VMGuestPatchRebootBehaviorUnknown', 'VMGuestPatchRebootBehaviorNeverReboots', 'VMGuestPatchRebootBehaviorAlwaysRequiresReboot', 'VMGuestPatchRebootBehaviorCanRequestReboot' - RebootBehavior VMGuestPatchRebootBehavior `json:"rebootBehavior,omitempty"` - // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. - ActivityID *string `json:"activityId,omitempty"` - // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. - LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` - // AssessmentState - READ-ONLY; Describes the availability of a given patch. Possible values include: 'PatchAssessmentStateUnknown', 'PatchAssessmentStateAvailable' - AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineSoftwarePatchProperties. -func (vmspp VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. -func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesPowerOffFuture.Result. -func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesReapplyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesReapplyFuture.Result. -func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRedeployFuture.Result. -func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesReimageFuture.Result. -func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRestartFuture.Result. -func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesRunCommandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (RunCommandResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRunCommandFuture.Result. -func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { - rcr, err = client.RunCommandResponder(rcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesStartFuture.Result. -func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view -// status summary. -type VirtualMachineStatusCodeCount struct { - // Code - READ-ONLY; The instance view status code. - Code *string `json:"code,omitempty"` - // Count - READ-ONLY; The number of instances having a particular status code. - Count *int32 `json:"count,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. -func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachine, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesUpdateFuture.Result. -func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - VM.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.UpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineUpdate describes a Virtual Machine Update. -type VirtualMachineUpdate struct { - // 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**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - // Zones - The virtual machine zones. - Zones *[]string `json:"zones,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineUpdate. -func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmu.Plan != nil { - objectMap["plan"] = vmu.Plan - } - if vmu.VirtualMachineProperties != nil { - objectMap["properties"] = vmu.VirtualMachineProperties - } - if vmu.Identity != nil { - objectMap["identity"] = vmu.Identity - } - if vmu.Zones != nil { - objectMap["zones"] = vmu.Zones - } - if vmu.Tags != nil { - objectMap["tags"] = vmu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. -func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmu.Plan = &plan - } - case "properties": - if v != nil { - var virtualMachineProperties VirtualMachineProperties - err = json.Unmarshal(*v, &virtualMachineProperties) - if err != nil { - return err - } - vmu.VirtualMachineProperties = &virtualMachineProperties - } - case "identity": - if v != nil { - var identity VirtualMachineIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmu.Identity = &identity - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - vmu.Zones = &zones - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmu.Tags = tags - } - } - } - - return nil -} - -// VMDiskSecurityProfile specifies the security profile settings for the managed disk.

    NOTE: It -// can only be set for Confidential VMs -type VMDiskSecurityProfile struct { - // SecurityEncryptionType - Specifies the EncryptionType of the managed disk.
    It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob, and VMGuestStateOnly for encryption of just the VMGuestState blob.

    NOTE: It can be set for only Confidential VMs. Possible values include: 'VMGuestStateOnly', 'DiskWithVMGuestState' - SecurityEncryptionType SecurityEncryptionTypes `json:"securityEncryptionType,omitempty"` - // DiskEncryptionSet - 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 `json:"diskEncryptionSet,omitempty"` -} - -// VMGalleryApplication specifies the required information to reference a compute gallery application -// version -type VMGalleryApplication struct { - // Tags - Optional, Specifies a passthrough value for more generic context. - Tags *string `json:"tags,omitempty"` - // Order - Optional, Specifies the order in which the packages have to be installed - Order *int32 `json:"order,omitempty"` - // PackageReferenceID - Specifies the GalleryApplicationVersion resource id on the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} - PackageReferenceID *string `json:"packageReferenceId,omitempty"` - // ConfigurationReference - Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided - ConfigurationReference *string `json:"configurationReference,omitempty"` - // TreatFailureAsDeploymentFailure - Optional, If true, any failure for any operation in the VmApplication will fail the deployment - TreatFailureAsDeploymentFailure *bool `json:"treatFailureAsDeploymentFailure,omitempty"` - // EnableAutomaticUpgrade - 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 `json:"enableAutomaticUpgrade,omitempty"` -} - -// VMImagesInEdgeZoneListResult the List VmImages in EdgeZone operation response. -type VMImagesInEdgeZoneListResult struct { - autorest.Response `json:"-"` - // Value - The list of VMImages in EdgeZone - Value *[]VirtualMachineImageResource `json:"value,omitempty"` - // NextLink - 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 `json:"nextLink,omitempty"` -} - -// VMScaleSetConvertToSinglePlacementGroupInput ... -type VMScaleSetConvertToSinglePlacementGroupInput struct { - // ActivePlacementGroupID - 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 `json:"activePlacementGroupId,omitempty"` -} - -// VMSizeProperties specifies VM Size Property settings on the virtual machine. -type VMSizeProperties struct { - // VCPUsAvailable - 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 `json:"vCPUsAvailable,omitempty"` - // VCPUsPerCore - 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 `json:"vCPUsPerCore,omitempty"` -} - -// WindowsConfiguration specifies Windows operating system settings on the virtual machine. -type WindowsConfiguration struct { - // ProvisionVMAgent - 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 `json:"provisionVMAgent,omitempty"` - // EnableAutomaticUpdates - 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 `json:"enableAutomaticUpdates,omitempty"` - // TimeZone - 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 `json:"timeZone,omitempty"` - // AdditionalUnattendContent - 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 `json:"additionalUnattendContent,omitempty"` - // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Windows. - PatchSettings *PatchSettings `json:"patchSettings,omitempty"` - // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - WinRM *WinRMConfiguration `json:"winRM,omitempty"` - // EnableVMAgentPlatformUpdates - Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. - EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"` -} - -// WindowsParameters input for InstallPatches on a Windows VM, as directly received by the API -type WindowsParameters struct { - // ClassificationsToInclude - The update classifications to select when installing patches for Windows. - ClassificationsToInclude *[]VMGuestPatchClassificationWindows `json:"classificationsToInclude,omitempty"` - // KbNumbersToInclude - Kbs to include in the patch operation - KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` - // KbNumbersToExclude - Kbs to exclude in the patch operation - KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` - // ExcludeKbsRequiringReboot - Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. - ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` - // MaxPatchPublishDate - This is used to install patches that were published on or before this given max published date. - MaxPatchPublishDate *date.Time `json:"maxPatchPublishDate,omitempty"` -} - -// WindowsVMGuestPatchAutomaticByPlatformSettings specifies additional settings to be applied when patch -// mode AutomaticByPlatform is selected in Windows patch settings. -type WindowsVMGuestPatchAutomaticByPlatformSettings struct { - // RebootSetting - Specifies the reboot setting for all AutomaticByPlatform patch installation operations. Possible values include: 'WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown', 'WindowsVMGuestPatchAutomaticByPlatformRebootSettingIfRequired', 'WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever', 'WindowsVMGuestPatchAutomaticByPlatformRebootSettingAlways' - RebootSetting WindowsVMGuestPatchAutomaticByPlatformRebootSetting `json:"rebootSetting,omitempty"` -} - -// WinRMConfiguration describes Windows Remote Management configuration of the VM -type WinRMConfiguration struct { - // Listeners - The list of Windows Remote Management listeners - Listeners *[]WinRMListener `json:"listeners,omitempty"` -} - -// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener -type WinRMListener struct { - // Protocol - Specifies the protocol of WinRM listener.

    Possible values are:
    **http**

    **https**. Possible values include: 'HTTP', 'HTTPS' - Protocol ProtocolTypes `json:"protocol,omitempty"` - // CertificateURL - 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 `json:"certificateUrl,omitempty"` -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go deleted file mode 100644 index 3f4a51a3f27c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go +++ /dev/null @@ -1,98 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the compute Client -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of compute operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Compute/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go deleted file mode 100644 index cc7766f7c677..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go +++ /dev/null @@ -1,575 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProximityPlacementGroupsClient is the compute Client -type ProximityPlacementGroupsClient struct { - BaseClient -} - -// NewProximityPlacementGroupsClient creates an instance of the ProximityPlacementGroupsClient client. -func NewProximityPlacementGroupsClient(subscriptionID string) ProximityPlacementGroupsClient { - return NewProximityPlacementGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProximityPlacementGroupsClientWithBaseURI creates an instance of the ProximityPlacementGroupsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewProximityPlacementGroupsClientWithBaseURI(baseURI string, subscriptionID string) ProximityPlacementGroupsClient { - return ProximityPlacementGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a proximity placement group. -// Parameters: -// 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. -func (client ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProximityPlacementGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -func (client ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, proximityPlacementGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProximityPlacementGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a proximity placement group . -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// includeColocationStatus - includeColocationStatus=true enables fetching the colocation status of all the -// resources in the proximity placement group. -func (client ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, proximityPlacementGroupName, includeColocationStatus) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProximityPlacementGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(includeColocationStatus) > 0 { - queryParameters["includeColocationStatus"] = autorest.Encode("query", includeColocationStatus) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) GetResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all proximity placement groups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ProximityPlacementGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ppglr.Response.Response != nil { - sc = result.ppglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ppglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ppglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ProximityPlacementGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ProximityPlacementGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { - req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProximityPlacementGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all proximity placement groups in a subscription. -func (client ProximityPlacementGroupsClient) ListBySubscription(ctx context.Context) (result ProximityPlacementGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.ppglr.Response.Response != nil { - sc = result.ppglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.ppglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.ppglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ProximityPlacementGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client ProximityPlacementGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { - req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProximityPlacementGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result ProximityPlacementGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update update a proximity placement group. -// Parameters: -// 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. -func (client ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ProximityPlacementGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) UpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go deleted file mode 100644 index 35266973811b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go +++ /dev/null @@ -1,153 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceSkusClient is the compute Client -type ResourceSkusClient struct { - BaseClient -} - -// NewResourceSkusClient creates an instance of the ResourceSkusClient client. -func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { - return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { - return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets the list of Microsoft.Compute SKUs available for your Subscription. -// Parameters: -// filter - the filter to apply on the operation. Only **location** filter is supported currently. -// includeExtendedLocations - to Include Extended Locations information or not in the response. -func (client ResourceSkusClient) List(ctx context.Context, filter string, includeExtendedLocations string) (result ResourceSkusResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") - defer func() { - sc := -1 - if result.rsr.Response.Response != nil { - sc = result.rsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, includeExtendedLocations) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request") - return - } - - result.rsr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") - return - } - if result.rsr.hasNextLink() && result.rsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ResourceSkusClient) ListPreparer(ctx context.Context, filter string, includeExtendedLocations string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2021-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(includeExtendedLocations) > 0 { - queryParameters["includeExtendedLocations"] = autorest.Encode("query", includeExtendedLocations) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ResourceSkusClient) listNextResults(ctx context.Context, lastResults ResourceSkusResult) (result ResourceSkusResult, err error) { - req, err := lastResults.resourceSkusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ResourceSkusClient) ListComplete(ctx context.Context, filter string, includeExtendedLocations string) (result ResourceSkusResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, filter, includeExtendedLocations) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go deleted file mode 100644 index 469f8e2b3149..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go +++ /dev/null @@ -1,582 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RestorePointCollectionsClient is the compute Client -type RestorePointCollectionsClient struct { - BaseClient -} - -// NewRestorePointCollectionsClient creates an instance of the RestorePointCollectionsClient client. -func NewRestorePointCollectionsClient(subscriptionID string) RestorePointCollectionsClient { - return NewRestorePointCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRestorePointCollectionsClientWithBaseURI creates an instance of the RestorePointCollectionsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewRestorePointCollectionsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointCollectionsClient { - return RestorePointCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// 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. -// Parameters: -// 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. -func (client RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection) (result RestorePointCollection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, restorePointCollectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RestorePointCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointCollectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) CreateOrUpdateResponder(resp *http.Response) (result RestorePointCollection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the restore point collection. This operation will also delete all the contained -// restore points. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the Restore Point Collection. -func (client RestorePointCollectionsClient) Delete(ctx context.Context, resourceGroupName string, restorePointCollectionName string) (result RestorePointCollectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, restorePointCollectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RestorePointCollectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointCollectionsClient) DeleteSender(req *http.Request) (future RestorePointCollectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the restore point collection. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection. -// expand - the expand expression to apply on the operation. If expand=restorePoints, server will return all -// contained restore points in the restorePointCollection. -func (client RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, expand RestorePointCollectionExpandOptions) (result RestorePointCollection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RestorePointCollectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, expand RestorePointCollectionExpandOptions) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointCollectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) GetResponder(resp *http.Response) (result RestorePointCollection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the list of restore point collections in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client RestorePointCollectionsClient) List(ctx context.Context, resourceGroupName string) (result RestorePointCollectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.List") - defer func() { - sc := -1 - if result.rpclr.Response.Response != nil { - sc = result.rpclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rpclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", resp, "Failure sending request") - return - } - - result.rpclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", resp, "Failure responding to request") - return - } - if result.rpclr.hasNextLink() && result.rpclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RestorePointCollectionsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointCollectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) ListResponder(resp *http.Response) (result RestorePointCollectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RestorePointCollectionsClient) listNextResults(ctx context.Context, lastResults RestorePointCollectionListResult) (result RestorePointCollectionListResult, err error) { - req, err := lastResults.restorePointCollectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RestorePointCollectionsClient) ListComplete(ctx context.Context, resourceGroupName string) (result RestorePointCollectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll 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. -func (client RestorePointCollectionsClient) ListAll(ctx context.Context) (result RestorePointCollectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.ListAll") - defer func() { - sc := -1 - if result.rpclr.Response.Response != nil { - sc = result.rpclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.rpclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", resp, "Failure sending request") - return - } - - result.rpclr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.rpclr.hasNextLink() && result.rpclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client RestorePointCollectionsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointCollectionsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) ListAllResponder(resp *http.Response) (result RestorePointCollectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client RestorePointCollectionsClient) listAllNextResults(ctx context.Context, lastResults RestorePointCollectionListResult) (result RestorePointCollectionListResult, err error) { - req, err := lastResults.restorePointCollectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client RestorePointCollectionsClient) ListAllComplete(ctx context.Context) (result RestorePointCollectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// Update the operation to update the restore point collection. -// Parameters: -// 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. -func (client RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate) (result RestorePointCollection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, restorePointCollectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client RestorePointCollectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointCollectionsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client RestorePointCollectionsClient) UpdateResponder(resp *http.Response) (result RestorePointCollection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go deleted file mode 100644 index 5e00d6ffedb2..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go +++ /dev/null @@ -1,302 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RestorePointsClient is the compute Client -type RestorePointsClient struct { - BaseClient -} - -// NewRestorePointsClient creates an instance of the RestorePointsClient client. -func NewRestorePointsClient(subscriptionID string) RestorePointsClient { - return NewRestorePointsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRestorePointsClientWithBaseURI creates an instance of the RestorePointsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { - return RestorePointsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create the operation to create the restore point. Updating properties of an existing restore point is not allowed -// Parameters: -// 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. -func (client RestorePointsClient) Create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint) (result RestorePointsCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.RestorePointProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.RestorePointsClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client RestorePointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "restorePointName": autorest.Encode("path", restorePointName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointsClient) CreateSender(req *http.Request) (future RestorePointsCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client RestorePointsClient) CreateResponder(resp *http.Response) (result RestorePoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the restore point. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the Restore Point Collection. -// restorePointName - the name of the restore point. -func (client RestorePointsClient) Delete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (result RestorePointsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RestorePointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "restorePointName": autorest.Encode("path", restorePointName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointsClient) DeleteSender(req *http.Request) (future RestorePointsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RestorePointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the restore point. -// Parameters: -// resourceGroupName - the name of the resource group. -// restorePointCollectionName - the name of the restore point collection. -// restorePointName - the name of the restore point. -// expand - the expand expression to apply on the operation. 'InstanceView' retrieves information about the -// run-time state of a restore point. -func (client RestorePointsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, expand RestorePointExpandOptions) (result RestorePoint, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RestorePointsClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, expand RestorePointExpandOptions) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), - "restorePointName": autorest.Encode("path", restorePointName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RestorePointsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RestorePointsClient) GetResponder(resp *http.Response) (result RestorePoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go deleted file mode 100644 index e15a36d7b7ec..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go +++ /dev/null @@ -1,227 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SharedGalleriesClient is the compute Client -type SharedGalleriesClient struct { - BaseClient -} - -// NewSharedGalleriesClient creates an instance of the SharedGalleriesClient client. -func NewSharedGalleriesClient(subscriptionID string) SharedGalleriesClient { - return NewSharedGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSharedGalleriesClientWithBaseURI creates an instance of the SharedGalleriesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSharedGalleriesClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleriesClient { - return SharedGalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a shared gallery by subscription id or tenant id. -// Parameters: -// location - resource location. -// galleryUniqueName - the unique name of the Shared Gallery. -func (client SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string) (result SharedGallery, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, galleryUniqueName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SharedGalleriesClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SharedGalleriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SharedGalleriesClient) GetResponder(resp *http.Response) (result SharedGallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list shared galleries by subscription id or tenant id. -// Parameters: -// location - resource location. -// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. -func (client SharedGalleriesClient) List(ctx context.Context, location string, sharedTo SharedToValues) (result SharedGalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.List") - defer func() { - sc := -1 - if result.sgl.Response.Response != nil { - sc = result.sgl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, sharedTo) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sgl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", resp, "Failure sending request") - return - } - - result.sgl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", resp, "Failure responding to request") - return - } - if result.sgl.hasNextLink() && result.sgl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SharedGalleriesClient) ListPreparer(ctx context.Context, location string, sharedTo SharedToValues) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(sharedTo)) > 0 { - queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SharedGalleriesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SharedGalleriesClient) ListResponder(resp *http.Response) (result SharedGalleryList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SharedGalleriesClient) listNextResults(ctx context.Context, lastResults SharedGalleryList) (result SharedGalleryList, err error) { - req, err := lastResults.sharedGalleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SharedGalleriesClient) ListComplete(ctx context.Context, location string, sharedTo SharedToValues) (result SharedGalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, sharedTo) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go deleted file mode 100644 index 70c7cde609ab..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go +++ /dev/null @@ -1,233 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SharedGalleryImagesClient is the compute Client -type SharedGalleryImagesClient struct { - BaseClient -} - -// NewSharedGalleryImagesClient creates an instance of the SharedGalleryImagesClient client. -func NewSharedGalleryImagesClient(subscriptionID string) SharedGalleryImagesClient { - return NewSharedGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSharedGalleryImagesClientWithBaseURI creates an instance of the SharedGalleryImagesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewSharedGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleryImagesClient { - return SharedGalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a shared gallery image by subscription id or tenant id. -// Parameters: -// 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. -func (client SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string) (result SharedGalleryImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, galleryUniqueName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SharedGalleryImagesClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SharedGalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SharedGalleryImagesClient) GetResponder(resp *http.Response) (result SharedGalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list shared gallery images by subscription id or tenant id. -// Parameters: -// location - resource location. -// galleryUniqueName - the unique name of the Shared Gallery. -// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. -func (client SharedGalleryImagesClient) List(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (result SharedGalleryImageListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.List") - defer func() { - sc := -1 - if result.sgil.Response.Response != nil { - sc = result.sgil.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, galleryUniqueName, sharedTo) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sgil.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", resp, "Failure sending request") - return - } - - result.sgil, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", resp, "Failure responding to request") - return - } - if result.sgil.hasNextLink() && result.sgil.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SharedGalleryImagesClient) ListPreparer(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(sharedTo)) > 0 { - queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SharedGalleryImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SharedGalleryImagesClient) ListResponder(resp *http.Response) (result SharedGalleryImageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SharedGalleryImagesClient) listNextResults(ctx context.Context, lastResults SharedGalleryImageList) (result SharedGalleryImageList, err error) { - req, err := lastResults.sharedGalleryImageListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SharedGalleryImagesClient) ListComplete(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (result SharedGalleryImageListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, galleryUniqueName, sharedTo) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go deleted file mode 100644 index ea3a76bb149a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go +++ /dev/null @@ -1,240 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SharedGalleryImageVersionsClient is the compute Client -type SharedGalleryImageVersionsClient struct { - BaseClient -} - -// NewSharedGalleryImageVersionsClient creates an instance of the SharedGalleryImageVersionsClient client. -func NewSharedGalleryImageVersionsClient(subscriptionID string) SharedGalleryImageVersionsClient { - return NewSharedGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSharedGalleryImageVersionsClientWithBaseURI creates an instance of the SharedGalleryImageVersionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewSharedGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleryImageVersionsClient { - return SharedGalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get a shared gallery image version by subscription id or tenant id. -// Parameters: -// 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: .. -func (client SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string) (result SharedGalleryImageVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, galleryUniqueName, galleryImageName, galleryImageVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SharedGalleryImageVersionsClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SharedGalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SharedGalleryImageVersionsClient) GetResponder(resp *http.Response) (result SharedGalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list shared gallery image versions by subscription id or tenant id. -// Parameters: -// 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. -// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. -func (client SharedGalleryImageVersionsClient) List(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (result SharedGalleryImageVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.List") - defer func() { - sc := -1 - if result.sgivl.Response.Response != nil { - sc = result.sgivl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, galleryUniqueName, galleryImageName, sharedTo) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sgivl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", resp, "Failure sending request") - return - } - - result.sgivl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", resp, "Failure responding to request") - return - } - if result.sgivl.hasNextLink() && result.sgivl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SharedGalleryImageVersionsClient) ListPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryUniqueName": autorest.Encode("path", galleryUniqueName), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-01-03" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(sharedTo)) > 0 { - queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SharedGalleryImageVersionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SharedGalleryImageVersionsClient) ListResponder(resp *http.Response) (result SharedGalleryImageVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SharedGalleryImageVersionsClient) listNextResults(ctx context.Context, lastResults SharedGalleryImageVersionList) (result SharedGalleryImageVersionList, err error) { - req, err := lastResults.sharedGalleryImageVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SharedGalleryImageVersionsClient) ListComplete(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (result SharedGalleryImageVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, galleryUniqueName, galleryImageName, sharedTo) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go deleted file mode 100644 index 54eb26c52d47..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go +++ /dev/null @@ -1,777 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SnapshotsClient is the compute Client -type SnapshotsClient struct { - BaseClient -} - -// NewSnapshotsClient creates an instance of the SnapshotsClient client. -func NewSnapshotsClient(subscriptionID string) SnapshotsClient { - return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { - return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a snapshot. -// Parameters: -// 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. -func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (result SnapshotsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: snapshot, - Constraints: []validation.Constraint{{Target: "snapshot.SnapshotProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.PurchasePlan", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.PurchasePlan.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.PurchasePlan.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.PurchasePlan.Product", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "snapshot.SnapshotProperties.CreationData", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "snapshot.SnapshotProperties.CopyCompletionError", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CopyCompletionError.ErrorCode", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.CopyCompletionError.ErrorMessage", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - snapshot.ManagedBy = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(snapshot), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a snapshot. -// Parameters: -// 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. -func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a snapshot. -// Parameters: -// 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. -func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string) (result Snapshot, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a snapshot. -// Parameters: -// 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. -func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (result SnapshotsGrantAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: grantAccessData, - Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.SnapshotsClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists snapshots under a subscription. -func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.sl.Response.Response != nil { - sc = result.sl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request") - return - } - - result.sl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") - return - } - if result.sl.hasNextLink() && result.sl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { - req, err := lastResults.snapshotListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists snapshots under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.sl.Response.Response != nil { - sc = result.sl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.sl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.sl.hasNextLink() && result.sl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { - req, err := lastResults.snapshotListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// RevokeAccess revokes access to a snapshot. -// Parameters: -// 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. -func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsRevokeAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates (patches) a snapshot. -// Parameters: -// 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. -func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (result SnapshotsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-02" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(snapshot), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go deleted file mode 100644 index f293af111faa..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go +++ /dev/null @@ -1,649 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SSHPublicKeysClient is the compute Client -type SSHPublicKeysClient struct { - BaseClient -} - -// NewSSHPublicKeysClient creates an instance of the SSHPublicKeysClient client. -func NewSSHPublicKeysClient(subscriptionID string) SSHPublicKeysClient { - return NewSSHPublicKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSSHPublicKeysClientWithBaseURI creates an instance of the SSHPublicKeysClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSSHPublicKeysClientWithBaseURI(baseURI string, subscriptionID string) SSHPublicKeysClient { - return SSHPublicKeysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create creates a new SSH public key resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -// parameters - parameters supplied to create the SSH public key. -func (client SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyResource) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Create") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreatePreparer(ctx, resourceGroupName, SSHPublicKeyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure responding to request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client SSHPublicKeysClient) CreatePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) CreateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) CreateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete an SSH public key. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SSHPublicKeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result SSHPublicKeyGenerateKeyPairResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.GenerateKeyPair") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GenerateKeyPairPreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", nil, "Failure preparing request") - return - } - - resp, err := client.GenerateKeyPairSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure sending request") - return - } - - result, err = client.GenerateKeyPairResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure responding to request") - return - } - - return -} - -// GenerateKeyPairPreparer prepares the GenerateKeyPair request. -func (client SSHPublicKeysClient) GenerateKeyPairPreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateKeyPairSender sends the GenerateKeyPair request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) GenerateKeyPairSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GenerateKeyPairResponder handles the response to the GenerateKeyPair request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) GenerateKeyPairResponder(resp *http.Response) (result SSHPublicKeyGenerateKeyPairResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieves information about an SSH public key. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -func (client SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, SSHPublicKeyName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SSHPublicKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) GetResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup 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. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SSHPublicKeysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SSHPublicKeysGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.spkglr.Response.Response != nil { - sc = result.spkglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.spkglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.spkglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SSHPublicKeysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) ListByResourceGroupResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SSHPublicKeysClient) listByResourceGroupNextResults(ctx context.Context, lastResults SSHPublicKeysGroupListResult) (result SSHPublicKeysGroupListResult, err error) { - req, err := lastResults.sSHPublicKeysGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SSHPublicKeysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SSHPublicKeysGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription 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. -func (client SSHPublicKeysClient) ListBySubscription(ctx context.Context) (result SSHPublicKeysGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListBySubscription") - defer func() { - sc := -1 - if result.spkglr.Response.Response != nil { - sc = result.spkglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.spkglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.spkglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client SSHPublicKeysClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) ListBySubscriptionResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client SSHPublicKeysClient) listBySubscriptionNextResults(ctx context.Context, lastResults SSHPublicKeysGroupListResult) (result SSHPublicKeysGroupListResult, err error) { - req, err := lastResults.sSHPublicKeysGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client SSHPublicKeysClient) ListBySubscriptionComplete(ctx context.Context) (result SSHPublicKeysGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update updates a new SSH public key resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// SSHPublicKeyName - the name of the SSH public key. -// parameters - parameters supplied to update the SSH public key. -func (client SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyUpdateResource) (result SSHPublicKeyResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, SSHPublicKeyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SSHPublicKeysClient) UpdatePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyUpdateResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client SSHPublicKeysClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SSHPublicKeysClient) UpdateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go deleted file mode 100644 index 8af0c7de4251..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go +++ /dev/null @@ -1,155 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsageClient is the compute Client -type UsageClient struct { - BaseClient -} - -// NewUsageClient creates an instance of the UsageClient client. -func NewUsageClient(subscriptionID string) UsageClient { - return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient { - return UsageClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets, for the specified location, the current compute resource usage information as well as the limits for -// compute resources under the subscription. -// Parameters: -// location - the location for which resource usage is queried. -func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") - defer func() { - sc := -1 - if result.lur.Response.Response != nil { - sc = result.lur.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.UsageClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lur.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request") - return - } - - result.lur, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request") - return - } - if result.lur.hasNextLink() && result.lur.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client UsageClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { - req, err := lastResults.listUsagesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go deleted file mode 100644 index d7dcad9c4c74..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package compute - -import "github.com/Azure/azure-sdk-for-go/version" - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " compute/2022-08-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go deleted file mode 100644 index 5ebc7b481f68..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go +++ /dev/null @@ -1,270 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineExtensionImagesClient is the compute Client -type VirtualMachineExtensionImagesClient struct { - BaseClient -} - -// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client. -func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { - return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient { - return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine extension image. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, typeParameter string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "type": autorest.Encode("path", typeParameter), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListTypes gets a list of virtual machine extension image types. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListTypes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListTypesPreparer(ctx, location, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request") - return - } - - resp, err := client.ListTypesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request") - return - } - - result, err = client.ListTypesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request") - return - } - - return -} - -// ListTypesPreparer prepares the ListTypes request. -func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListTypesSender sends the ListTypes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListTypesResponder handles the response to the ListTypes request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListVersions gets a list of virtual machine extension image versions. -// Parameters: -// location - the name of a supported Azure region. -// filter - the filter to apply on the operation. -func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListVersions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request") - return - } - - resp, err := client.ListVersionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request") - return - } - - result, err = client.ListVersionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request") - return - } - - return -} - -// ListVersionsPreparer prepares the ListVersions request. -func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "type": autorest.Encode("path", typeParameter), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVersionsSender sends the ListVersions request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVersionsResponder handles the response to the ListVersions request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go deleted file mode 100644 index 4835d9d641c3..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go +++ /dev/null @@ -1,454 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineExtensionsClient is the compute Client -type VirtualMachineExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client. -func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { - return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient { - return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the extension. -// Parameters: -// 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. -func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: extensionParameters, - Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineExtensionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the extension. -// Parameters: -// 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. -func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the extension. -// Parameters: -// 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. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all extensions of a Virtual Machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineExtensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the operation to update the extension. -// Parameters: -// 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. -func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go deleted file mode 100644 index 65b20c304615..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go +++ /dev/null @@ -1,508 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineImagesClient is the compute Client -type VirtualMachineImagesClient struct { - BaseClient -} - -// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client. -func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { - return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient { - return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine image. -// Parameters: -// 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. -func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, expand, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByEdgeZone gets a list of all virtual machine image versions for the specified edge zone -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -func (client VirtualMachineImagesClient) ListByEdgeZone(ctx context.Context, location string, edgeZone string) (result VMImagesInEdgeZoneListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListByEdgeZone") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByEdgeZonePreparer(ctx, location, edgeZone) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListByEdgeZone", nil, "Failure preparing request") - return - } - - resp, err := client.ListByEdgeZoneSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListByEdgeZone", resp, "Failure sending request") - return - } - - result, err = client.ListByEdgeZoneResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListByEdgeZone", resp, "Failure responding to request") - return - } - - return -} - -// ListByEdgeZonePreparer prepares the ListByEdgeZone request. -func (client VirtualMachineImagesClient) ListByEdgeZonePreparer(ctx context.Context, location string, edgeZone string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/vmimages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByEdgeZoneSender sends the ListByEdgeZone request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListByEdgeZoneSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByEdgeZoneResponder handles the response to the ListByEdgeZone request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListByEdgeZoneResponder(resp *http.Response) (result VMImagesInEdgeZoneListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOffers gets a list of virtual machine image offers for the specified location and publisher. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListOffers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListOffersPreparer(ctx, location, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request") - return - } - - resp, err := client.ListOffersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request") - return - } - - result, err = client.ListOffersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request") - return - } - - return -} - -// ListOffersPreparer prepares the ListOffers request. -func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOffersSender sends the ListOffers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOffersResponder handles the response to the ListOffers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListPublishers gets a list of virtual machine image publishers for the specified Azure location. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListPublishers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPublishersPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request") - return - } - - resp, err := client.ListPublishersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request") - return - } - - result, err = client.ListPublishersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request") - return - } - - return -} - -// ListPublishersPreparer prepares the ListPublishers request. -func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPublishersSender sends the ListPublishers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPublishersResponder handles the response to the ListPublishers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListSkus") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListSkusPreparer(ctx, location, publisherName, offer) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request") - return - } - - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request") - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, location string, publisherName string, offer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go deleted file mode 100644 index 33ca2cbe8ed9..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go +++ /dev/null @@ -1,445 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineImagesEdgeZoneClient is the compute Client -type VirtualMachineImagesEdgeZoneClient struct { - BaseClient -} - -// NewVirtualMachineImagesEdgeZoneClient creates an instance of the VirtualMachineImagesEdgeZoneClient client. -func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string) VirtualMachineImagesEdgeZoneClient { - return NewVirtualMachineImagesEdgeZoneClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineImagesEdgeZoneClientWithBaseURI creates an instance of the VirtualMachineImagesEdgeZoneClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewVirtualMachineImagesEdgeZoneClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesEdgeZoneClient { - return VirtualMachineImagesEdgeZoneClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine image in an edge zone. -// Parameters: -// 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. -func (client VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, edgeZone, publisherName, offer, skus, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineImagesEdgeZoneClient) GetPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesEdgeZoneClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and -// SKU. -// Parameters: -// 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. -// expand - the expand expression to apply on the operation. -// top - an integer value specifying the number of images to return that matches supplied values. -// orderby - specifies the order of the results returned. Formatted as an OData query. -func (client VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location, edgeZone, publisherName, offer, skus, expand, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineImagesEdgeZoneClient) ListPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesEdgeZoneClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOffers gets a list of virtual machine image offers for the specified location, edge zone and publisher. -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -// publisherName - a valid image publisher. -func (client VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListOffers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListOffersPreparer(ctx, location, edgeZone, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", nil, "Failure preparing request") - return - } - - resp, err := client.ListOffersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", resp, "Failure sending request") - return - } - - result, err = client.ListOffersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", resp, "Failure responding to request") - return - } - - return -} - -// ListOffersPreparer prepares the ListOffers request. -func (client VirtualMachineImagesEdgeZoneClient) ListOffersPreparer(ctx context.Context, location string, edgeZone string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOffersSender sends the ListOffers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesEdgeZoneClient) ListOffersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOffersResponder handles the response to the ListOffers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListPublishers gets a list of virtual machine image publishers for the specified Azure location and edge zone. -// Parameters: -// location - the name of a supported Azure region. -// edgeZone - the name of the edge zone. -func (client VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListPublishers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPublishersPreparer(ctx, location, edgeZone) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", nil, "Failure preparing request") - return - } - - resp, err := client.ListPublishersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", resp, "Failure sending request") - return - } - - result, err = client.ListPublishersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", resp, "Failure responding to request") - return - } - - return -} - -// ListPublishersPreparer prepares the ListPublishers request. -func (client VirtualMachineImagesEdgeZoneClient) ListPublishersPreparer(ctx context.Context, location string, edgeZone string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPublishersSender sends the ListPublishers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesEdgeZoneClient) ListPublishersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPublishersResponder handles the response to the ListPublishers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListSkus gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. -// Parameters: -// 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. -func (client VirtualMachineImagesEdgeZoneClient) ListSkus(ctx context.Context, location string, edgeZone string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListSkus") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListSkusPreparer(ctx, location, edgeZone, publisherName, offer) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", resp, "Failure sending request") - return - } - - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", resp, "Failure responding to request") - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineImagesEdgeZoneClient) ListSkusPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "edgeZone": autorest.Encode("path", edgeZone), - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesEdgeZoneClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesEdgeZoneClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go deleted file mode 100644 index be46b192eaf3..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go +++ /dev/null @@ -1,689 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineRunCommandsClient is the compute Client -type VirtualMachineRunCommandsClient struct { - BaseClient -} - -// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client. -func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient { - return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient { - return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the run command. -// Parameters: -// 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. -func (client VirtualMachineRunCommandsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommand) (result VirtualMachineRunCommandsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, runCommandName, runCommand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineRunCommandsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommand) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), - autorest.WithJSON(runCommand), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineRunCommandsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the run command. -// Parameters: -// 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. -func (client VirtualMachineRunCommandsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (result VirtualMachineRunCommandsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, runCommandName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineRunCommandsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) DeleteSender(req *http.Request) (future VirtualMachineRunCommandsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets specific run command for a subscription in a location. -// Parameters: -// location - the location upon which run commands is queried. -// commandID - the command id. -func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, location, commandID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, location string, commandID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "commandId": autorest.Encode("path", commandID), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetByVirtualMachine the operation to get the run command. -// Parameters: -// 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. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (result VirtualMachineRunCommand, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.GetByVirtualMachine") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetByVirtualMachinePreparer(ctx, resourceGroupName, VMName, runCommandName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", nil, "Failure preparing request") - return - } - - resp, err := client.GetByVirtualMachineSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", resp, "Failure sending request") - return - } - - result, err = client.GetByVirtualMachineResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", resp, "Failure responding to request") - return - } - - return -} - -// GetByVirtualMachinePreparer prepares the GetByVirtualMachine request. -func (client VirtualMachineRunCommandsClient) GetByVirtualMachinePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetByVirtualMachineSender sends the GetByVirtualMachine request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) GetByVirtualMachineSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetByVirtualMachineResponder handles the response to the GetByVirtualMachine request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) GetByVirtualMachineResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all available run commands for a subscription in a location. -// Parameters: -// location - the location upon which run commands is queried. -func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") - defer func() { - sc := -1 - if result.rclr.Response.Response != nil { - sc = result.rclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request") - return - } - - result.rclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") - return - } - if result.rclr.hasNextLink() && result.rclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineRunCommandsClient) listNextResults(ctx context.Context, lastResults RunCommandListResult) (result RunCommandListResult, err error) { - req, err := lastResults.runCommandListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, location string) (result RunCommandListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} - -// ListByVirtualMachine the operation to get all run commands of a Virtual Machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the run command. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineRunCommandsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.ListByVirtualMachine") - defer func() { - sc := -1 - if result.vmrclr.Response.Response != nil { - sc = result.vmrclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVirtualMachineNextResults - req, err := client.ListByVirtualMachinePreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVirtualMachineSender(req) - if err != nil { - result.vmrclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", resp, "Failure sending request") - return - } - - result.vmrclr, err = client.ListByVirtualMachineResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", resp, "Failure responding to request") - return - } - if result.vmrclr.hasNextLink() && result.vmrclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVirtualMachinePreparer prepares the ListByVirtualMachine request. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachinePreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVirtualMachineSender sends the ListByVirtualMachine request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachineSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVirtualMachineResponder handles the response to the ListByVirtualMachine request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachineResponder(resp *http.Response) (result VirtualMachineRunCommandsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVirtualMachineNextResults retrieves the next set of results, if any. -func (client VirtualMachineRunCommandsClient) listByVirtualMachineNextResults(ctx context.Context, lastResults VirtualMachineRunCommandsListResult) (result VirtualMachineRunCommandsListResult, err error) { - req, err := lastResults.virtualMachineRunCommandsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVirtualMachineSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVirtualMachineResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVirtualMachineComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineRunCommandsClient) ListByVirtualMachineComplete(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineRunCommandsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.ListByVirtualMachine") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVirtualMachine(ctx, resourceGroupName, VMName, expand) - return -} - -// Update the operation to update the run command. -// Parameters: -// 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. -func (client VirtualMachineRunCommandsClient) Update(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (result VirtualMachineRunCommandsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, runCommandName, runCommand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineRunCommandsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), - autorest.WithJSON(runCommand), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) UpdateSender(req *http.Request) (future VirtualMachineRunCommandsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) UpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go deleted file mode 100644 index d9c7043e7b37..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go +++ /dev/null @@ -1,2205 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachinesClient is the compute Client -type VirtualMachinesClient struct { - BaseClient -} - -// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client. -func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { - return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { - return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// AssessPatches assess patches on the VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) AssessPatches(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesAssessPatchesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.AssessPatches") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.AssessPatchesPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "AssessPatches", nil, "Failure preparing request") - return - } - - result, err = client.AssessPatchesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "AssessPatches", result.Response(), "Failure sending request") - return - } - - return -} - -// AssessPatchesPreparer prepares the AssessPatches request. -func (client VirtualMachinesClient) AssessPatchesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AssessPatchesSender sends the AssessPatches request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) AssessPatchesSender(req *http.Request) (future VirtualMachinesAssessPatchesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// AssessPatchesResponder handles the response to the AssessPatches request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) AssessPatchesResponder(resp *http.Response) (result VirtualMachineAssessPatchesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Capture captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create -// similar VMs. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Capture Virtual Machine operation. -func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (result VirtualMachinesCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Capture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VhdPrefix", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.DestinationContainerName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.OverwriteVhds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "Capture", err.Error()) - } - - req, err := client.CapturePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure preparing request") - return - } - - result, err = client.CaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", result.Response(), "Failure sending request") - return - } - - return -} - -// CapturePreparer prepares the Capture request. -func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CaptureSender sends the Capture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future VirtualMachinesCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CaptureResponder handles the response to the Capture request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be -// stop-deallocated before invoking this operation. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesConvertToManagedDisksFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ConvertToManagedDisks") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ConvertToManagedDisksPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", nil, "Failure preparing request") - return - } - - result, err = client.ConvertToManagedDisksSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", result.Response(), "Failure sending request") - return - } - - return -} - -// ConvertToManagedDisksPreparer prepares the ConvertToManagedDisks request. -func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ConvertToManagedDisksSender sends the ConvertToManagedDisks request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Request) (future VirtualMachinesConvertToManagedDisksFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ConvertToManagedDisksResponder handles the response to the ConvertToManagedDisks request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate the operation to create or update a virtual machine. Please note some properties can be set only -// during virtual machine creation. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Create Virtual Machine operation. -func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (result VirtualMachinesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Resources = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachinesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Deallocate shuts down the virtual machine and releases the compute resources. You are not billed for the compute -// resources that this virtual machine uses. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// hibernate - optional parameter to hibernate a virtual machine. (Feature in Preview) -func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGroupName string, VMName string, hibernate *bool) (result VirtualMachinesDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMName, hibernate) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMName string, hibernate *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if hibernate != nil { - queryParameters["hibernate"] = autorest.Encode("query", *hibernate) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future VirtualMachinesDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete the operation to delete a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// forceDeletion - optional parameter to force delete virtual machines. -func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (result VirtualMachinesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, forceDeletion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if forceDeletion != nil { - queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future VirtualMachinesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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). -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Generalize") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GeneralizePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", nil, "Failure preparing request") - return - } - - resp, err := client.GeneralizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure sending request") - return - } - - result, err = client.GeneralizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure responding to request") - return - } - - return -} - -// GeneralizePreparer prepares the Generalize request. -func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GeneralizeSender sends the Generalize request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GeneralizeResponder handles the response to the Generalize request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about the model view or the instance view of a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// expand - 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. -func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (result VirtualMachine, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// InstallPatches installs patches on the VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// installPatchesInput - input for InstallPatches as directly received by the API -func (client VirtualMachinesClient) InstallPatches(ctx context.Context, resourceGroupName string, VMName string, installPatchesInput VirtualMachineInstallPatchesParameters) (result VirtualMachinesInstallPatchesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstallPatches") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InstallPatchesPreparer(ctx, resourceGroupName, VMName, installPatchesInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstallPatches", nil, "Failure preparing request") - return - } - - result, err = client.InstallPatchesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstallPatches", result.Response(), "Failure sending request") - return - } - - return -} - -// InstallPatchesPreparer prepares the InstallPatches request. -func (client VirtualMachinesClient) InstallPatchesPreparer(ctx context.Context, resourceGroupName string, VMName string, installPatchesInput VirtualMachineInstallPatchesParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches", pathParameters), - autorest.WithJSON(installPatchesInput), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InstallPatchesSender sends the InstallPatches request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) InstallPatchesSender(req *http.Request) (future VirtualMachinesInstallPatchesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// InstallPatchesResponder handles the response to the InstallPatches request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) InstallPatchesResponder(resp *http.Response) (result VirtualMachineInstallPatchesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// InstanceView retrieves information about the run-time state of a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InstanceViewPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.InstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure sending request") - return - } - - result, err = client.InstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure responding to request") - return - } - - return -} - -// InstanceViewPreparer prepares the InstanceView request. -func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InstanceViewSender sends the InstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// InstanceViewResponder handles the response to the InstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// filter - 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}' -func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string, filter string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGroupName string, filter string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, filter) - return -} - -// ListAll 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. -// Parameters: -// statusOnly - statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. -// filter - 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}' -func (client VirtualMachinesClient) ListAll(ctx context.Context, statusOnly string, filter string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx, statusOnly, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context, statusOnly string, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(statusOnly) > 0 { - queryParameters["statusOnly"] = autorest.Encode("query", statusOnly) - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListAllComplete(ctx context.Context, statusOnly string, filter string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx, statusOnly, filter) - return -} - -// ListAvailableSizes lists all available virtual machine sizes to which the specified virtual machine can be resized. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAvailableSizes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSizesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSizesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSizesPreparer prepares the ListAvailableSizes request. -func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByLocation gets all the virtual machines under the specified subscription for the specified location. -// Parameters: -// location - the location for which virtual machines under the subscription are queried. -func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "ListByLocation", err.Error()) - } - - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client VirtualMachinesClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, location) - return -} - -// PerformMaintenance the operation to perform maintenance on a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachinesPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// skipShutdown - 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 -func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (result VirtualMachinesPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future VirtualMachinesPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reapply the operation to reapply a virtual machine's state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Reapply(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesReapplyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reapply") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReapplyPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", nil, "Failure preparing request") - return - } - - result, err = client.ReapplySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", result.Response(), "Failure sending request") - return - } - - return -} - -// ReapplyPreparer prepares the Reapply request. -func (client VirtualMachinesClient) ReapplyPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReapplySender sends the Reapply request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future VirtualMachinesReapplyFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReapplyResponder handles the response to the Reapply request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ReapplyResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down the virtual machine, moves it to a new node, and powers it back on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages the virtual machine which has an ephemeral OS disk back to its initial state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Reimage Virtual Machine operation. -func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (result VirtualMachinesReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future VirtualMachinesReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart the operation to restart a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RestartSender(req *http.Request) (future VirtualMachinesRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// RetrieveBootDiagnosticsData the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// sasURIExpirationTimeInMinutes - 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. -func (client VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, VMName string, sasURIExpirationTimeInMinutes *int32) (result RetrieveBootDiagnosticsDataResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RetrieveBootDiagnosticsData") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RetrieveBootDiagnosticsDataPreparer(ctx, resourceGroupName, VMName, sasURIExpirationTimeInMinutes) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", nil, "Failure preparing request") - return - } - - resp, err := client.RetrieveBootDiagnosticsDataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", resp, "Failure sending request") - return - } - - result, err = client.RetrieveBootDiagnosticsDataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", resp, "Failure responding to request") - return - } - - return -} - -// RetrieveBootDiagnosticsDataPreparer prepares the RetrieveBootDiagnosticsData request. -func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataPreparer(ctx context.Context, resourceGroupName string, VMName string, sasURIExpirationTimeInMinutes *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if sasURIExpirationTimeInMinutes != nil { - queryParameters["sasUriExpirationTimeInMinutes"] = autorest.Encode("query", *sasURIExpirationTimeInMinutes) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RetrieveBootDiagnosticsDataSender sends the RetrieveBootDiagnosticsData request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RetrieveBootDiagnosticsDataResponder handles the response to the RetrieveBootDiagnosticsData request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataResponder(resp *http.Response) (result RetrieveBootDiagnosticsDataResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// RunCommand run command on the VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Run command operation. -func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (result VirtualMachinesRunCommandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RunCommand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "RunCommand", err.Error()) - } - - req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = client.RunCommandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", result.Response(), "Failure sending request") - return - } - - return -} - -// RunCommandPreparer prepares the RunCommand request. -func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RunCommandSender sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future VirtualMachinesRunCommandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RunCommandResponder handles the response to the RunCommand request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SimulateEviction the operation to simulate the eviction of spot virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.SimulateEviction") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SimulateEvictionPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", nil, "Failure preparing request") - return - } - - resp, err := client.SimulateEvictionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure sending request") - return - } - - result, err = client.SimulateEvictionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure responding to request") - return - } - - return -} - -// SimulateEvictionPreparer prepares the SimulateEviction request. -func (client VirtualMachinesClient) SimulateEvictionPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SimulateEvictionSender sends the SimulateEviction request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) SimulateEvictionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SimulateEvictionResponder handles the response to the SimulateEviction request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start the operation to start a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update the operation to update a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Update Virtual Machine operation. -func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (result VirtualMachinesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future VirtualMachinesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go deleted file mode 100644 index d790ab51784f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go +++ /dev/null @@ -1,495 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetExtensionsClient is the compute Client -type VirtualMachineScaleSetExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client. -func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetExtensionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update an extension. -// Parameters: -// 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. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: extensionParameters, - Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the extension. -// Parameters: -// 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. -func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the extension. -// Parameters: -// 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. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all extensions in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set containing the extension. -func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") - defer func() { - sc := -1 - if result.vmsselr.Response.Response != nil { - sc = result.vmsselr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmsselr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request") - return - } - - result.vmsselr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") - return - } - if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetExtensionsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) { - req, err := lastResults.virtualMachineScaleSetExtensionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName) - return -} - -// Update the operation to update an extension. -// Parameters: -// 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. -func (client VirtualMachineScaleSetExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (result VirtualMachineScaleSetExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Name = nil - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go deleted file mode 100644 index f1fe61962208..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go +++ /dev/null @@ -1,346 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetRollingUpgradesClient is the compute Client -type VirtualMachineScaleSetRollingUpgradesClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates an instance of the -// VirtualMachineScaleSetRollingUpgradesClient client. -func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetRollingUpgradesClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return VirtualMachineScaleSetRollingUpgradesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Cancel cancels the current virtual machine scale set rolling upgrade. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.Cancel") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure preparing request") - return - } - - result, err = client.CancelSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", result.Response(), "Failure sending request") - return - } - - return -} - -// CancelPreparer prepares the Cancel request. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelSender sends the Cancel request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CancelResponder handles the response to the Cancel request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetLatest gets the status of the latest virtual machine scale set rolling upgrade. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.GetLatest") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", nil, "Failure preparing request") - return - } - - resp, err := client.GetLatestSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure sending request") - return - } - - result, err = client.GetLatestResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request") - return - } - - return -} - -// GetLatestPreparer prepares the GetLatest request. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetLatestSender sends the GetLatest request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetLatestResponder handles the response to the GetLatest request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartExtensionUpgrade") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartExtensionUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", nil, "Failure preparing request") - return - } - - result, err = client.StartExtensionUpgradeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", result.Response(), "Failure sending request") - return - } - - return -} - -// StartExtensionUpgradePreparer prepares the StartExtensionUpgrade request. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartExtensionUpgradeSender sends the StartExtensionUpgrade request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartExtensionUpgradeResponder handles the response to the StartExtensionUpgrade request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure preparing request") - return - } - - result, err = client.StartOSUpgradeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", result.Response(), "Failure sending request") - return - } - - return -} - -// StartOSUpgradePreparer prepares the StartOSUpgrade request. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go deleted file mode 100644 index 6d0f4c523e11..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go +++ /dev/null @@ -1,2170 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetsClient is the compute Client -type VirtualMachineScaleSetsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetsClient creates an instance of the VirtualMachineScaleSetsClient client. -func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { - return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the VirtualMachineScaleSetsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient { - return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ConvertToSinglePlacementGroup converts SinglePlacementGroup property to false for a existing virtual machine scale -// set. -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ConvertToSinglePlacementGroupPreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ConvertToSinglePlacementGroupSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure sending request") - return - } - - result, err = client.ConvertToSinglePlacementGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure responding to request") - return - } - - return -} - -// ConvertToSinglePlacementGroupPreparer prepares the ConvertToSinglePlacementGroup request. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ConvertToSinglePlacementGroupSender sends the ConvertToSinglePlacementGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ConvertToSinglePlacementGroupResponder handles the response to the ConvertToSinglePlacementGroup request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate create or update a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set to create or update. -// parameters - the scale set object. -func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.BaseRegularPriorityCount", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.BaseRegularPriorityCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// 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. -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetsDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// forceDeletion - optional parameter to force delete a VM scale set. (Feature in Preview) -func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, forceDeletion *bool) (result VirtualMachineScaleSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, forceDeletion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, forceDeletion *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if forceDeletion != nil { - queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteInstances deletes virtual machines in a VM scale set. -// Parameters: -// 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. -// forceDeletion - optional parameter to force delete virtual machines from the VM scale set. (Feature in -// Preview) -func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, forceDeletion *bool) (result VirtualMachineScaleSetsDeleteInstancesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.DeleteInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: VMInstanceIDs, - Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "DeleteInstances", err.Error()) - } - - req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, forceDeletion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request") - return - } - - result, err = client.DeleteInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteInstancesPreparer prepares the DeleteInstances request. -func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, forceDeletion *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if forceDeletion != nil { - queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters), - autorest.WithJSON(VMInstanceIDs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteInstancesSender sends the DeleteInstances request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (future VirtualMachineScaleSetsDeleteInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalk manual platform update domain walk to update virtual machines in -// a service fabric virtual machine scale set. -// Parameters: -// 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 -// zone - the zone in which the manual recovery walk is requested for cross zone virtual machine scale set -// placementGroupID - the placement group id for which the manual recovery walk is requested. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32, zone string, placementGroupID string) (result RecoveryWalkResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx, resourceGroupName, VMScaleSetName, platformUpdateDomain, zone, placementGroupID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", nil, "Failure preparing request") - return - } - - resp, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure sending request") - return - } - - result, err = client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure responding to request") - return - } - - return -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer prepares the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32, zone string, placementGroupID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain), - } - if len(zone) > 0 { - queryParameters["zone"] = autorest.Encode("query", zone) - } - if len(placementGroupID) > 0 { - queryParameters["placementGroupId"] = autorest.Encode("query", placementGroupID) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender sends the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder handles the response to the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get display information about a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// expand - 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 -func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, expand ExpandTypesForGetVMScaleSets) (result VirtualMachineScaleSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, expand ExpandTypesForGetVMScaleSets) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a VM scale set instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetOSUpgradeHistory gets list of OS upgrades on a VM scale set instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") - defer func() { - sc := -1 - if result.vmsslouh.Response.Response != nil { - sc = result.vmsslouh.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.getOSUpgradeHistoryNextResults - req, err := client.GetOSUpgradeHistoryPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", nil, "Failure preparing request") - return - } - - resp, err := client.GetOSUpgradeHistorySender(req) - if err != nil { - result.vmsslouh.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure sending request") - return - } - - result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") - return - } - if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// GetOSUpgradeHistoryPreparer prepares the GetOSUpgradeHistory request. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOSUpgradeHistorySender sends the GetOSUpgradeHistory request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOSUpgradeHistoryResponder handles the response to the GetOSUpgradeHistory request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getOSUpgradeHistoryNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) getOSUpgradeHistoryNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListOSUpgradeHistory) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { - req, err := lastResults.virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetOSUpgradeHistorySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure sending next results request") - } - result, err = client.GetOSUpgradeHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetOSUpgradeHistoryComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.GetOSUpgradeHistory(ctx, resourceGroupName, VMScaleSetName) - return -} - -// List gets a list of all VM scale sets under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") - defer func() { - sc := -1 - if result.vmsslr.Response.Response != nil { - sc = result.vmsslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmsslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending request") - return - } - - result.vmsslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") - return - } - if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { - req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll 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. -func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") - defer func() { - sc := -1 - if result.vmsslwlr.Response.Response != nil { - sc = result.vmsslwlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vmsslwlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending request") - return - } - - result.vmsslwlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) { - req, err := lastResults.virtualMachineScaleSetListWithLinkResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListAllComplete(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListByLocation gets all the VM scale sets under the specified subscription for the specified location. -// Parameters: -// location - the location for which VM scale sets under the subscription are queried. -func (client VirtualMachineScaleSetsClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineScaleSetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListByLocation") - defer func() { - sc := -1 - if result.vmsslr.Response.Response != nil { - sc = result.vmsslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "ListByLocation", err.Error()) - } - - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.vmsslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.vmsslr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", resp, "Failure responding to request") - return - } - if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client VirtualMachineScaleSetsClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { - req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineScaleSetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, location) - return -} - -// ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed -// for each SKU. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") - defer func() { - sc := -1 - if result.vmsslsr.Response.Response != nil { - sc = result.vmsslsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listSkusNextResults - req, err := client.ListSkusPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.vmsslsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending request") - return - } - - result.vmsslsr, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") - return - } - if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listSkusNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listSkusNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) { - req, err := lastResults.virtualMachineScaleSetListSkusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListSkus(ctx, resourceGroupName, VMScaleSetName) - return -} - -// 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 -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// 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. -// skipShutdown - 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 -func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (result VirtualMachineScaleSetsPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetsPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers -// them back on. -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetsRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMScaleSetReimageInput - parameters for Reimaging VM ScaleSet. -func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (result VirtualMachineScaleSetsReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMScaleSetReimageInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMScaleSetReimageInput != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMScaleSetReimageInput)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetsReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ReimageAll") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure preparing request") - return - } - - result, err = client.ReimageAllSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageAllSender sends the ReimageAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetsReimageAllFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageAllResponder handles the response to the ReimageAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts one or more virtual machines in a VM scale set. -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// SetOrchestrationServiceState changes ServiceState property for a given service -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceState(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters OrchestrationServiceStateInput) (result VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.SetOrchestrationServiceState") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SetOrchestrationServiceStatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", nil, "Failure preparing request") - return - } - - result, err = client.SetOrchestrationServiceStateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", result.Response(), "Failure sending request") - return - } - - return -} - -// SetOrchestrationServiceStatePreparer prepares the SetOrchestrationServiceState request. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters OrchestrationServiceStateInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetOrchestrationServiceStateSender sends the SetOrchestrationServiceState request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateSender(req *http.Request) (future VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetOrchestrationServiceStateResponder handles the response to the SetOrchestrationServiceState request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts one or more virtual machines in a VM scale set. -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set to create or update. -// parameters - the scale set object. -func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (result VirtualMachineScaleSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// Parameters: -// 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. -func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsUpdateInstancesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.UpdateInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: VMInstanceIDs, - Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "UpdateInstances", err.Error()) - } - - req, err := client.UpdateInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request") - return - } - - result, err = client.UpdateInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateInstancesPreparer prepares the UpdateInstances request. -func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters), - autorest.WithJSON(VMInstanceIDs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateInstancesSender sends the UpdateInstances request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (future VirtualMachineScaleSetsUpdateInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateInstancesResponder handles the response to the UpdateInstances request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go deleted file mode 100644 index 72992a5458cf..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go +++ /dev/null @@ -1,469 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMExtensionsClient is the compute Client -type VirtualMachineScaleSetVMExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates an instance of the VirtualMachineScaleSetVMExtensionsClient -// client. -func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { - return NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetVMExtensionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { - return VirtualMachineScaleSetVMExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the VMSS VM extension. -// Parameters: -// 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. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: extensionParameters, - Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Name = nil - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the VMSS VM extension. -// Parameters: -// 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. -func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the VMSS VM extension. -// Parameters: -// 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. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineScaleSetVMExtension, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all extensions of an instance in Virtual Machine Scaleset. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineScaleSetVMExtensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the operation to update the VMSS VM extension. -// Parameters: -// 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. -func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Name = nil - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go deleted file mode 100644 index fb95c143fb8d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go +++ /dev/null @@ -1,495 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMRunCommandsClient is the compute Client -type VirtualMachineScaleSetVMRunCommandsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMRunCommandsClient creates an instance of the VirtualMachineScaleSetVMRunCommandsClient -// client. -func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string) VirtualMachineScaleSetVMRunCommandsClient { - return NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetVMRunCommandsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMRunCommandsClient { - return VirtualMachineScaleSetVMRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the VMSS VM run command. -// Parameters: -// 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. -func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand) (result VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, runCommand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), - autorest.WithJSON(runCommand), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the VMSS VM run command. -// Parameters: -// 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. -func (client VirtualMachineScaleSetVMRunCommandsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (result VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMRunCommandsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMRunCommandsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the VMSS VM run command. -// Parameters: -// 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. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (result VirtualMachineRunCommand, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMRunCommandsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) GetResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all run commands of an instance in Virtual Machine Scaleset. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMRunCommandsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineRunCommandsListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.List") - defer func() { - sc := -1 - if result.vmrclr.Response.Response != nil { - sc = result.vmrclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmrclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", resp, "Failure sending request") - return - } - - result.vmrclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", resp, "Failure responding to request") - return - } - if result.vmrclr.hasNextLink() && result.vmrclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMRunCommandsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) ListResponder(resp *http.Response) (result VirtualMachineRunCommandsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetVMRunCommandsClient) listNextResults(ctx context.Context, lastResults VirtualMachineRunCommandsListResult) (result VirtualMachineRunCommandsListResult, err error) { - req, err := lastResults.virtualMachineRunCommandsListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetVMRunCommandsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineRunCommandsListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - return -} - -// Update the operation to update the VMSS VM run command. -// Parameters: -// 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. -func (client VirtualMachineScaleSetVMRunCommandsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (result VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, runCommand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMRunCommandsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "runCommandName": autorest.Encode("path", runCommandName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), - autorest.WithJSON(runCommand), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMRunCommandsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMRunCommandsClient) UpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go deleted file mode 100644 index 6514dd7c4a57..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go +++ /dev/null @@ -1,1430 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMsClient is the compute Client -type VirtualMachineScaleSetVMsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMsClient creates an instance of the VirtualMachineScaleSetVMsClient client. -func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient { - return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the VirtualMachineScaleSetVMsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient { - return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetVMsDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// forceDeletion - optional parameter to force delete a virtual machine from a VM scale set. (Feature in -// Preview) -func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, forceDeletion *bool) (result VirtualMachineScaleSetVMsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, forceDeletion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, forceDeletion *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if forceDeletion != nil { - queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - 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. -func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (result VirtualMachineScaleSetVM, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machines in a VM scale sets. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the VM scale set. -// filter - 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'. -// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. -// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. -func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") - defer func() { - sc := -1 - if result.vmssvlr.Response.Response != nil { - sc = result.vmssvlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmssvlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending request") - return - } - - result.vmssvlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request") - return - } - if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetVMsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) { - req, err := lastResults.virtualMachineScaleSetVMListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) - return -} - -// PerformMaintenance performs maintenance on a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// skipShutdown - 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 -func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetVMsPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back -// on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetVMsRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMScaleSetVMReimageInput - parameters for the Reimaging Virtual machine in ScaleSet. -func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (result VirtualMachineScaleSetVMsReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMScaleSetVMReimageInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMScaleSetVMReimageInput != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMScaleSetVMReimageInput)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// 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. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.ReimageAll") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", nil, "Failure preparing request") - return - } - - result, err = client.ReimageAllSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/reimageall", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageAllSender sends the ReimageAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageAllFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageAllResponder handles the response to the ReimageAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetVMsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// RetrieveBootDiagnosticsData the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM -// scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// sasURIExpirationTimeInMinutes - 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. -func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, sasURIExpirationTimeInMinutes *int32) (result RetrieveBootDiagnosticsDataResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RetrieveBootDiagnosticsDataPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, sasURIExpirationTimeInMinutes) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", nil, "Failure preparing request") - return - } - - resp, err := client.RetrieveBootDiagnosticsDataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", resp, "Failure sending request") - return - } - - result, err = client.RetrieveBootDiagnosticsDataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", resp, "Failure responding to request") - return - } - - return -} - -// RetrieveBootDiagnosticsDataPreparer prepares the RetrieveBootDiagnosticsData request. -func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, sasURIExpirationTimeInMinutes *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if sasURIExpirationTimeInMinutes != nil { - queryParameters["sasUriExpirationTimeInMinutes"] = autorest.Encode("query", *sasURIExpirationTimeInMinutes) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RetrieveBootDiagnosticsDataSender sends the RetrieveBootDiagnosticsData request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// RetrieveBootDiagnosticsDataResponder handles the response to the RetrieveBootDiagnosticsData request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataResponder(resp *http.Response) (result RetrieveBootDiagnosticsDataResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// RunCommand run command on a virtual machine in a VM scale set. -// Parameters: -// 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. -func (client VirtualMachineScaleSetVMsClient) RunCommand(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (result VirtualMachineScaleSetVMsRunCommandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RunCommand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "RunCommand", err.Error()) - } - - req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = client.RunCommandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", result.Response(), "Failure sending request") - return - } - - return -} - -// RunCommandPreparer prepares the RunCommand request. -func (client VirtualMachineScaleSetVMsClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RunCommandSender sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request) (future VirtualMachineScaleSetVMsRunCommandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RunCommandResponder handles the response to the RunCommand request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SimulateEviction the operation to simulate the eviction of spot virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.SimulateEviction") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SimulateEvictionPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", nil, "Failure preparing request") - return - } - - resp, err := client.SimulateEvictionSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure sending request") - return - } - - result, err = client.SimulateEvictionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure responding to request") - return - } - - return -} - -// SimulateEvictionPreparer prepares the SimulateEviction request. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SimulateEvictionSender sends the SimulateEviction request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SimulateEvictionResponder handles the response to the SimulateEviction request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetVMsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates a virtual machine of a VM scale set. -// Parameters: -// 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. -func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (result VirtualMachineScaleSetVMsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.InstanceID = nil - parameters.Sku = nil - parameters.Resources = nil - parameters.Zones = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go deleted file mode 100644 index cdbf6579260e..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go +++ /dev/null @@ -1,113 +0,0 @@ -package compute - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineSizesClient is the compute Client -type VirtualMachineSizesClient struct { - BaseClient -} - -// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. -func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { - return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { - return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) -// Parameters: -// location - the location upon which virtual-machine-sizes is queried. -func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineSizesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-08-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/_meta.json deleted file mode 100644 index 1ccde570f9ae..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "c91eca4e2081703002581da6f58f9d9332e1afd1", - "readme": "/_/azure-rest-api-specs/specification/network/resource-manager/readme.md", - "tag": "package-2022-07", - "use": "@microsoft.azure/autorest.go@2.1.188", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.188 --tag=package-2022-07 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" - } -} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrulecollections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrulecollections.go deleted file mode 100644 index 2292b61ce294..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrulecollections.go +++ /dev/null @@ -1,431 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AdminRuleCollectionsClient is the network Client -type AdminRuleCollectionsClient struct { - BaseClient -} - -// NewAdminRuleCollectionsClient creates an instance of the AdminRuleCollectionsClient client. -func NewAdminRuleCollectionsClient(subscriptionID string) AdminRuleCollectionsClient { - return NewAdminRuleCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAdminRuleCollectionsClientWithBaseURI creates an instance of the AdminRuleCollectionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAdminRuleCollectionsClientWithBaseURI(baseURI string, subscriptionID string) AdminRuleCollectionsClient { - return AdminRuleCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an admin rule collection. -// Parameters: -// ruleCollection - the Rule Collection to create or update -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// ruleCollectionName - the name of the network manager security Configuration rule collection. -func (client AdminRuleCollectionsClient) CreateOrUpdate(ctx context.Context, ruleCollection AdminRuleCollection, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string) (result AdminRuleCollection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: ruleCollection, - Constraints: []validation.Constraint{{Target: "ruleCollection.AdminRuleCollectionPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "ruleCollection.AdminRuleCollectionPropertiesFormat.AppliesToGroups", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("network.AdminRuleCollectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AdminRuleCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, ruleCollection AdminRuleCollection, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionName": autorest.Encode("path", ruleCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - ruleCollection.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", pathParameters), - autorest.WithJSON(ruleCollection), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AdminRuleCollectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AdminRuleCollectionsClient) CreateOrUpdateResponder(resp *http.Response) (result AdminRuleCollection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes an admin rule collection. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// ruleCollectionName - the name of the network manager security Configuration rule collection. -// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been -// deployed, the service will do a cleanup deployment in the background, prior to the delete. -func (client AdminRuleCollectionsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, force *bool) (result AdminRuleCollectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AdminRuleCollectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, force *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionName": autorest.Encode("path", ruleCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if force != nil { - queryParameters["force"] = autorest.Encode("query", *force) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AdminRuleCollectionsClient) DeleteSender(req *http.Request) (future AdminRuleCollectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AdminRuleCollectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a network manager security admin configuration rule collection. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// ruleCollectionName - the name of the network manager security Configuration rule collection. -func (client AdminRuleCollectionsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string) (result AdminRuleCollection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AdminRuleCollectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionName": autorest.Encode("path", ruleCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AdminRuleCollectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AdminRuleCollectionsClient) GetResponder(resp *http.Response) (result AdminRuleCollection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the rule collections in a security admin configuration, in a paginated format. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client AdminRuleCollectionsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, top *int32, skipToken string) (result AdminRuleCollectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.List") - defer func() { - sc := -1 - if result.arclr.Response.Response != nil { - sc = result.arclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.AdminRuleCollectionsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, configurationName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.arclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "List", resp, "Failure sending request") - return - } - - result.arclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "List", resp, "Failure responding to request") - return - } - if result.arclr.hasNextLink() && result.arclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AdminRuleCollectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AdminRuleCollectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AdminRuleCollectionsClient) ListResponder(resp *http.Response) (result AdminRuleCollectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AdminRuleCollectionsClient) listNextResults(ctx context.Context, lastResults AdminRuleCollectionListResult) (result AdminRuleCollectionListResult, err error) { - req, err := lastResults.adminRuleCollectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AdminRuleCollectionsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, top *int32, skipToken string) (result AdminRuleCollectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkManagerName, configurationName, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrules.go deleted file mode 100644 index e38d6e174a6a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrules.go +++ /dev/null @@ -1,430 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AdminRulesClient is the network Client -type AdminRulesClient struct { - BaseClient -} - -// NewAdminRulesClient creates an instance of the AdminRulesClient client. -func NewAdminRulesClient(subscriptionID string) AdminRulesClient { - return NewAdminRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAdminRulesClientWithBaseURI creates an instance of the AdminRulesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAdminRulesClientWithBaseURI(baseURI string, subscriptionID string) AdminRulesClient { - return AdminRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an admin rule. -// Parameters: -// adminRule - the admin rule to create or update -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// ruleCollectionName - the name of the network manager security Configuration rule collection. -// ruleName - the name of the rule. -func (client AdminRulesClient) CreateOrUpdate(ctx context.Context, adminRule BasicBaseAdminRule, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string) (result BaseAdminRuleModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AdminRulesClient) CreateOrUpdatePreparer(ctx context.Context, adminRule BasicBaseAdminRule, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionName": autorest.Encode("path", ruleCollectionName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", pathParameters), - autorest.WithJSON(adminRule), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AdminRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AdminRulesClient) CreateOrUpdateResponder(resp *http.Response) (result BaseAdminRuleModel, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes an admin rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// ruleCollectionName - the name of the network manager security Configuration rule collection. -// ruleName - the name of the rule. -// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been -// deployed, the service will do a cleanup deployment in the background, prior to the delete. -func (client AdminRulesClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, force *bool) (result AdminRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AdminRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, force *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionName": autorest.Encode("path", ruleCollectionName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if force != nil { - queryParameters["force"] = autorest.Encode("query", *force) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AdminRulesClient) DeleteSender(req *http.Request) (future AdminRulesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AdminRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a network manager security configuration admin rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// ruleCollectionName - the name of the network manager security Configuration rule collection. -// ruleName - the name of the rule. -func (client AdminRulesClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string) (result BaseAdminRuleModel, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AdminRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionName": autorest.Encode("path", ruleCollectionName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AdminRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AdminRulesClient) GetResponder(resp *http.Response) (result BaseAdminRuleModel, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all network manager security configuration admin rules. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// ruleCollectionName - the name of the network manager security Configuration rule collection. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client AdminRulesClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, top *int32, skipToken string) (result AdminRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.List") - defer func() { - sc := -1 - if result.arlr.Response.Response != nil { - sc = result.arlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.AdminRulesClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.arlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "List", resp, "Failure sending request") - return - } - - result.arlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "List", resp, "Failure responding to request") - return - } - if result.arlr.hasNextLink() && result.arlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AdminRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionName": autorest.Encode("path", ruleCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AdminRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AdminRulesClient) ListResponder(resp *http.Response) (result AdminRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AdminRulesClient) listNextResults(ctx context.Context, lastResults AdminRuleListResult) (result AdminRuleListResult, err error) { - req, err := lastResults.adminRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AdminRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AdminRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AdminRulesClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, top *int32, skipToken string) (result AdminRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivateendpointconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivateendpointconnections.go deleted file mode 100644 index 917f0b7b641b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivateendpointconnections.go +++ /dev/null @@ -1,395 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationGatewayPrivateEndpointConnectionsClient is the network Client -type ApplicationGatewayPrivateEndpointConnectionsClient struct { - BaseClient -} - -// NewApplicationGatewayPrivateEndpointConnectionsClient creates an instance of the -// ApplicationGatewayPrivateEndpointConnectionsClient client. -func NewApplicationGatewayPrivateEndpointConnectionsClient(subscriptionID string) ApplicationGatewayPrivateEndpointConnectionsClient { - return NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI creates an instance of the -// ApplicationGatewayPrivateEndpointConnectionsClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayPrivateEndpointConnectionsClient { - return ApplicationGatewayPrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Delete deletes the specified private endpoint connection on application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// connectionName - the name of the application gateway private endpoint connection. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string) (result ApplicationGatewayPrivateEndpointConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future ApplicationGatewayPrivateEndpointConnectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified private endpoint connection on application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// connectionName - the name of the application gateway private endpoint connection. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string) (result ApplicationGatewayPrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationGatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result ApplicationGatewayPrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all private endpoint connections on an application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateEndpointConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.List") - defer func() { - sc := -1 - if result.agpeclr.Response.Response != nil { - sc = result.agpeclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.agpeclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.agpeclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.agpeclr.hasNextLink() && result.agpeclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result ApplicationGatewayPrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) listNextResults(ctx context.Context, lastResults ApplicationGatewayPrivateEndpointConnectionListResult) (result ApplicationGatewayPrivateEndpointConnectionListResult, err error) { - req, err := lastResults.applicationGatewayPrivateEndpointConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateEndpointConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, applicationGatewayName) - return -} - -// Update updates the specified private endpoint connection on application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// connectionName - the name of the application gateway private endpoint connection. -// parameters - parameters supplied to update application gateway private endpoint connection operation. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) Update(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection) (result ApplicationGatewayPrivateEndpointConnectionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGatewayName, connectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, connectionName string, parameters ApplicationGatewayPrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateEndpointConnections/{connectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdateSender(req *http.Request) (future ApplicationGatewayPrivateEndpointConnectionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdateResponder(resp *http.Response) (result ApplicationGatewayPrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivatelinkresources.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivatelinkresources.go deleted file mode 100644 index e899d166e863..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivatelinkresources.go +++ /dev/null @@ -1,151 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationGatewayPrivateLinkResourcesClient is the network Client -type ApplicationGatewayPrivateLinkResourcesClient struct { - BaseClient -} - -// NewApplicationGatewayPrivateLinkResourcesClient creates an instance of the -// ApplicationGatewayPrivateLinkResourcesClient client. -func NewApplicationGatewayPrivateLinkResourcesClient(subscriptionID string) ApplicationGatewayPrivateLinkResourcesClient { - return NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI creates an instance of the -// ApplicationGatewayPrivateLinkResourcesClient client using a custom endpoint. Use this when interacting with an -// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayPrivateLinkResourcesClient { - return ApplicationGatewayPrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all private link resources on an application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewayPrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateLinkResourceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourcesClient.List") - defer func() { - sc := -1 - if result.agplrlr.Response.Response != nil { - sc = result.agplrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.agplrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", resp, "Failure sending request") - return - } - - result.agplrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "List", resp, "Failure responding to request") - return - } - if result.agplrlr.hasNextLink() && result.agplrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationGatewayPrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/privateLinkResources", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayPrivateLinkResourcesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayPrivateLinkResourcesClient) ListResponder(resp *http.Response) (result ApplicationGatewayPrivateLinkResourceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ApplicationGatewayPrivateLinkResourcesClient) listNextResults(ctx context.Context, lastResults ApplicationGatewayPrivateLinkResourceListResult) (result ApplicationGatewayPrivateLinkResourceListResult, err error) { - req, err := lastResults.applicationGatewayPrivateLinkResourceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateLinkResourcesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewayPrivateLinkResourcesClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewayPrivateLinkResourceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourcesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, applicationGatewayName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgateways.go deleted file mode 100644 index 55a64bbc1ae7..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgateways.go +++ /dev/null @@ -1,1474 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationGatewaysClient is the network Client -type ApplicationGatewaysClient struct { - BaseClient -} - -// NewApplicationGatewaysClient creates an instance of the ApplicationGatewaysClient client. -func NewApplicationGatewaysClient(subscriptionID string) ApplicationGatewaysClient { - return NewApplicationGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationGatewaysClientWithBaseURI creates an instance of the ApplicationGatewaysClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewaysClient { - return ApplicationGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// BackendHealth gets the backend health of the specified application gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// expand - expands BackendAddressPool and BackendHttpSettings referenced in backend health. -func (client ApplicationGatewaysClient) BackendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, expand string) (result ApplicationGatewaysBackendHealthFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.BackendHealth") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.BackendHealthPreparer(ctx, resourceGroupName, applicationGatewayName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", nil, "Failure preparing request") - return - } - - result, err = client.BackendHealthSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealth", result.Response(), "Failure sending request") - return - } - - return -} - -// BackendHealthPreparer prepares the BackendHealth request. -func (client ApplicationGatewaysClient) BackendHealthPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// BackendHealthSender sends the BackendHealth request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) BackendHealthSender(req *http.Request) (future ApplicationGatewaysBackendHealthFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// BackendHealthResponder handles the response to the BackendHealth request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Response) (result ApplicationGatewayBackendHealth, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// BackendHealthOnDemand gets the backend health for given combination of backend pool and http setting of the -// specified application gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// probeRequest - request body for on-demand test probe operation. -// expand - expands BackendAddressPool and BackendHttpSettings referenced in backend health. -func (client ApplicationGatewaysClient) BackendHealthOnDemand(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, expand string) (result ApplicationGatewaysBackendHealthOnDemandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.BackendHealthOnDemand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.BackendHealthOnDemandPreparer(ctx, resourceGroupName, applicationGatewayName, probeRequest, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealthOnDemand", nil, "Failure preparing request") - return - } - - result, err = client.BackendHealthOnDemandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "BackendHealthOnDemand", result.Response(), "Failure sending request") - return - } - - return -} - -// BackendHealthOnDemandPreparer prepares the BackendHealthOnDemand request. -func (client ApplicationGatewaysClient) BackendHealthOnDemandPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, probeRequest ApplicationGatewayOnDemandProbe, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand", pathParameters), - autorest.WithJSON(probeRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// BackendHealthOnDemandSender sends the BackendHealthOnDemand request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) BackendHealthOnDemandSender(req *http.Request) (future ApplicationGatewaysBackendHealthOnDemandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// BackendHealthOnDemandResponder handles the response to the BackendHealthOnDemand request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) BackendHealthOnDemandResponder(resp *http.Response) (result ApplicationGatewayBackendHealthOnDemand, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates the specified application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// parameters - parameters supplied to the create or update application gateway operation. -func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway) (result ApplicationGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.Enabled", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetType", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.RuleSetVersion", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySize", Name: validation.InclusiveMinimum, Rule: int64(8), Chain: nil}, - }}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySizeInKb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySizeInKb", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.MaxRequestBodySizeInKb", Name: validation.InclusiveMinimum, Rule: int64(8), Chain: nil}, - }}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.FileUploadLimitInMb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.FileUploadLimitInMb", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - }}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.MinCapacity", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.MinCapacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - {Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.MaxCapacity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.AutoscaleConfiguration.MaxCapacity", Name: validation.InclusiveMinimum, Rule: int64(2), Chain: nil}}}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.ApplicationGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) CreateOrUpdateSender(req *http.Request) (future ApplicationGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewaysClient) Delete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) DeleteSender(req *http.Request) (future ApplicationGatewaysDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (result ApplicationGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetSslPredefinedPolicy gets Ssl predefined policy with the specified policy name. -// Parameters: -// predefinedPolicyName - name of Ssl predefined policy. -func (client ApplicationGatewaysClient) GetSslPredefinedPolicy(ctx context.Context, predefinedPolicyName string) (result ApplicationGatewaySslPredefinedPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.GetSslPredefinedPolicy") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetSslPredefinedPolicyPreparer(ctx, predefinedPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", nil, "Failure preparing request") - return - } - - resp, err := client.GetSslPredefinedPolicySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", resp, "Failure sending request") - return - } - - result, err = client.GetSslPredefinedPolicyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", resp, "Failure responding to request") - return - } - - return -} - -// GetSslPredefinedPolicyPreparer prepares the GetSslPredefinedPolicy request. -func (client ApplicationGatewaysClient) GetSslPredefinedPolicyPreparer(ctx context.Context, predefinedPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "predefinedPolicyName": autorest.Encode("path", predefinedPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSslPredefinedPolicySender sends the GetSslPredefinedPolicy request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) GetSslPredefinedPolicySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetSslPredefinedPolicyResponder handles the response to the GetSslPredefinedPolicy request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) GetSslPredefinedPolicyResponder(resp *http.Response) (result ApplicationGatewaySslPredefinedPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all application gateways in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ApplicationGatewaysClient) List(ctx context.Context, resourceGroupName string) (result ApplicationGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.List") - defer func() { - sc := -1 - if result.aglr.Response.Response != nil { - sc = result.aglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.aglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.aglr.hasNextLink() && result.aglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListResponder(resp *http.Response) (result ApplicationGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ApplicationGatewaysClient) listNextResults(ctx context.Context, lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, err error) { - req, err := lastResults.applicationGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result ApplicationGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the application gateways in a subscription. -func (client ApplicationGatewaysClient) ListAll(ctx context.Context) (result ApplicationGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAll") - defer func() { - sc := -1 - if result.aglr.Response.Response != nil { - sc = result.aglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.aglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure sending request") - return - } - - result.aglr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAll", resp, "Failure responding to request") - return - } - if result.aglr.hasNextLink() && result.aglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client ApplicationGatewaysClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAllResponder(resp *http.Response) (result ApplicationGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client ApplicationGatewaysClient) listAllNextResults(ctx context.Context, lastResults ApplicationGatewayListResult) (result ApplicationGatewayListResult, err error) { - req, err := lastResults.applicationGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewaysClient) ListAllComplete(ctx context.Context) (result ApplicationGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListAvailableRequestHeaders lists all available request headers. -func (client ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context) (result ListString, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableRequestHeaders") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableRequestHeadersPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableRequestHeaders", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableRequestHeadersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableRequestHeaders", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableRequestHeadersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableRequestHeaders", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableRequestHeadersPreparer prepares the ListAvailableRequestHeaders request. -func (client ApplicationGatewaysClient) ListAvailableRequestHeadersPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableRequestHeadersSender sends the ListAvailableRequestHeaders request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableRequestHeadersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableRequestHeadersResponder handles the response to the ListAvailableRequestHeaders request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableRequestHeadersResponder(resp *http.Response) (result ListString, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableResponseHeaders lists all available response headers. -func (client ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context) (result ListString, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableResponseHeaders") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableResponseHeadersPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableResponseHeaders", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableResponseHeadersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableResponseHeaders", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableResponseHeadersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableResponseHeaders", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableResponseHeadersPreparer prepares the ListAvailableResponseHeaders request. -func (client ApplicationGatewaysClient) ListAvailableResponseHeadersPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableResponseHeadersSender sends the ListAvailableResponseHeaders request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableResponseHeadersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableResponseHeadersResponder handles the response to the ListAvailableResponseHeaders request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableResponseHeadersResponder(resp *http.Response) (result ListString, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableServerVariables lists all available server variables. -func (client ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context) (result ListString, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableServerVariables") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableServerVariablesPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableServerVariables", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableServerVariablesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableServerVariables", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableServerVariablesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableServerVariables", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableServerVariablesPreparer prepares the ListAvailableServerVariables request. -func (client ApplicationGatewaysClient) ListAvailableServerVariablesPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableServerVariablesSender sends the ListAvailableServerVariables request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableServerVariablesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableServerVariablesResponder handles the response to the ListAvailableServerVariables request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableServerVariablesResponder(resp *http.Response) (result ListString, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableSslOptions lists available Ssl options for configuring Ssl policy. -func (client ApplicationGatewaysClient) ListAvailableSslOptions(ctx context.Context) (result ApplicationGatewayAvailableSslOptions, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableSslOptions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSslOptionsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSslOptionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSslOptionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSslOptionsPreparer prepares the ListAvailableSslOptions request. -func (client ApplicationGatewaysClient) ListAvailableSslOptionsPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSslOptionsSender sends the ListAvailableSslOptions request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableSslOptionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSslOptionsResponder handles the response to the ListAvailableSslOptions request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableSslOptionsResponder(resp *http.Response) (result ApplicationGatewayAvailableSslOptions, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableSslPredefinedPolicies lists all SSL predefined policies for configuring Ssl policy. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPolicies(ctx context.Context) (result ApplicationGatewayAvailableSslPredefinedPoliciesPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableSslPredefinedPolicies") - defer func() { - sc := -1 - if result.agaspp.Response.Response != nil { - sc = result.agaspp.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAvailableSslPredefinedPoliciesNextResults - req, err := client.ListAvailableSslPredefinedPoliciesPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSslPredefinedPoliciesSender(req) - if err != nil { - result.agaspp.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure sending request") - return - } - - result.agaspp, err = client.ListAvailableSslPredefinedPoliciesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure responding to request") - return - } - if result.agaspp.hasNextLink() && result.agaspp.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAvailableSslPredefinedPoliciesPreparer prepares the ListAvailableSslPredefinedPolicies request. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSslPredefinedPoliciesSender sends the ListAvailableSslPredefinedPolicies request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSslPredefinedPoliciesResponder handles the response to the ListAvailableSslPredefinedPolicies request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesResponder(resp *http.Response) (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAvailableSslPredefinedPoliciesNextResults retrieves the next set of results, if any. -func (client ApplicationGatewaysClient) listAvailableSslPredefinedPoliciesNextResults(ctx context.Context, lastResults ApplicationGatewayAvailableSslPredefinedPolicies) (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { - req, err := lastResults.applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAvailableSslPredefinedPoliciesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAvailableSslPredefinedPoliciesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAvailableSslPredefinedPoliciesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAvailableSslPredefinedPoliciesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "listAvailableSslPredefinedPoliciesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAvailableSslPredefinedPoliciesComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesComplete(ctx context.Context) (result ApplicationGatewayAvailableSslPredefinedPoliciesIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableSslPredefinedPolicies") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAvailableSslPredefinedPolicies(ctx) - return -} - -// ListAvailableWafRuleSets lists all available web application firewall rule sets. -func (client ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context) (result ApplicationGatewayAvailableWafRuleSetsResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.ListAvailableWafRuleSets") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableWafRuleSetsPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableWafRuleSets", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableWafRuleSetsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableWafRuleSets", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableWafRuleSetsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableWafRuleSets", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableWafRuleSetsPreparer prepares the ListAvailableWafRuleSets request. -func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableWafRuleSetsSender sends the ListAvailableWafRuleSets request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableWafRuleSetsResponder handles the response to the ListAvailableWafRuleSets request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsResponder(resp *http.Response) (result ApplicationGatewayAvailableWafRuleSetsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Start starts the specified application gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewaysClient) Start(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client ApplicationGatewaysClient) StartPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) StartSender(req *http.Request) (future ApplicationGatewaysStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Stop stops the specified application gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -func (client ApplicationGatewaysClient) Stop(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysStopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.Stop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPreparer(ctx, resourceGroupName, applicationGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", nil, "Failure preparing request") - return - } - - result, err = client.StopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "Stop", result.Response(), "Failure sending request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client ApplicationGatewaysClient) StopPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) StopSender(req *http.Request) (future ApplicationGatewaysStopFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// UpdateTags updates the specified application gateway tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationGatewayName - the name of the application gateway. -// parameters - parameters supplied to update application gateway tags. -func (client ApplicationGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject) (result ApplicationGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, applicationGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ApplicationGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationGatewayName": autorest.Encode("path", applicationGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ApplicationGatewaysClient) UpdateTagsResponder(resp *http.Response) (result ApplicationGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifests.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifests.go deleted file mode 100644 index b77a7e4da9eb..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifests.go +++ /dev/null @@ -1,149 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationGatewayWafDynamicManifestsClient is the network Client -type ApplicationGatewayWafDynamicManifestsClient struct { - BaseClient -} - -// NewApplicationGatewayWafDynamicManifestsClient creates an instance of the -// ApplicationGatewayWafDynamicManifestsClient client. -func NewApplicationGatewayWafDynamicManifestsClient(subscriptionID string) ApplicationGatewayWafDynamicManifestsClient { - return NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationGatewayWafDynamicManifestsClientWithBaseURI creates an instance of the -// ApplicationGatewayWafDynamicManifestsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayWafDynamicManifestsClient { - return ApplicationGatewayWafDynamicManifestsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the regional application gateway waf manifest. -// Parameters: -// location - the region where the nrp are located at. -func (client ApplicationGatewayWafDynamicManifestsClient) Get(ctx context.Context, location string) (result ApplicationGatewayWafDynamicManifestResultListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestsClient.Get") - defer func() { - sc := -1 - if result.agwdmrl.Response.Response != nil { - sc = result.agwdmrl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.getNextResults - req, err := client.GetPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.agwdmrl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "Get", resp, "Failure sending request") - return - } - - result.agwdmrl, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "Get", resp, "Failure responding to request") - return - } - if result.agwdmrl.hasNextLink() && result.agwdmrl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationGatewayWafDynamicManifestsClient) GetPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayWafDynamicManifestsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayWafDynamicManifestsClient) GetResponder(resp *http.Response) (result ApplicationGatewayWafDynamicManifestResultList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getNextResults retrieves the next set of results, if any. -func (client ApplicationGatewayWafDynamicManifestsClient) getNextResults(ctx context.Context, lastResults ApplicationGatewayWafDynamicManifestResultList) (result ApplicationGatewayWafDynamicManifestResultList, err error) { - req, err := lastResults.applicationGatewayWafDynamicManifestResultListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "getNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "getNextResults", resp, "Failure sending next results request") - } - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "getNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationGatewayWafDynamicManifestsClient) GetComplete(ctx context.Context, location string) (result ApplicationGatewayWafDynamicManifestResultListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestsClient.Get") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.Get(ctx, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifestsdefault.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifestsdefault.go deleted file mode 100644 index 5068e59eef52..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifestsdefault.go +++ /dev/null @@ -1,107 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationGatewayWafDynamicManifestsDefaultClient is the network Client -type ApplicationGatewayWafDynamicManifestsDefaultClient struct { - BaseClient -} - -// NewApplicationGatewayWafDynamicManifestsDefaultClient creates an instance of the -// ApplicationGatewayWafDynamicManifestsDefaultClient client. -func NewApplicationGatewayWafDynamicManifestsDefaultClient(subscriptionID string) ApplicationGatewayWafDynamicManifestsDefaultClient { - return NewApplicationGatewayWafDynamicManifestsDefaultClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationGatewayWafDynamicManifestsDefaultClientWithBaseURI creates an instance of the -// ApplicationGatewayWafDynamicManifestsDefaultClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewApplicationGatewayWafDynamicManifestsDefaultClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayWafDynamicManifestsDefaultClient { - return ApplicationGatewayWafDynamicManifestsDefaultClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the regional application gateway waf manifest. -// Parameters: -// location - the region where the nrp are located at. -func (client ApplicationGatewayWafDynamicManifestsDefaultClient) Get(ctx context.Context, location string) (result ApplicationGatewayWafDynamicManifestResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestsDefaultClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsDefaultClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsDefaultClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsDefaultClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationGatewayWafDynamicManifestsDefaultClient) GetPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationGatewayWafDynamicManifestsDefaultClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationGatewayWafDynamicManifestsDefaultClient) GetResponder(resp *http.Response) (result ApplicationGatewayWafDynamicManifestResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationsecuritygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationsecuritygroups.go deleted file mode 100644 index 7e0bf86d3a64..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationsecuritygroups.go +++ /dev/null @@ -1,577 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ApplicationSecurityGroupsClient is the network Client -type ApplicationSecurityGroupsClient struct { - BaseClient -} - -// NewApplicationSecurityGroupsClient creates an instance of the ApplicationSecurityGroupsClient client. -func NewApplicationSecurityGroupsClient(subscriptionID string) ApplicationSecurityGroupsClient { - return NewApplicationSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewApplicationSecurityGroupsClientWithBaseURI creates an instance of the ApplicationSecurityGroupsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewApplicationSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationSecurityGroupsClient { - return ApplicationSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an application security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationSecurityGroupName - the name of the application security group. -// parameters - parameters supplied to the create or update ApplicationSecurityGroup operation. -func (client ApplicationSecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup) (result ApplicationSecurityGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationSecurityGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (future ApplicationSecurityGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified application security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationSecurityGroupName - the name of the application security group. -func (client ApplicationSecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, applicationSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ApplicationSecurityGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) DeleteSender(req *http.Request) (future ApplicationSecurityGroupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified application security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationSecurityGroupName - the name of the application security group. -func (client ApplicationSecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, applicationSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ApplicationSecurityGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) GetResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the application security groups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ApplicationSecurityGroupsClient) List(ctx context.Context, resourceGroupName string) (result ApplicationSecurityGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.List") - defer func() { - sc := -1 - if result.asglr.Response.Response != nil { - sc = result.asglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.asglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure sending request") - return - } - - result.asglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.asglr.hasNextLink() && result.asglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ApplicationSecurityGroupsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) ListResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ApplicationSecurityGroupsClient) listNextResults(ctx context.Context, lastResults ApplicationSecurityGroupListResult) (result ApplicationSecurityGroupListResult, err error) { - req, err := lastResults.applicationSecurityGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationSecurityGroupsClient) ListComplete(ctx context.Context, resourceGroupName string) (result ApplicationSecurityGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all application security groups in a subscription. -func (client ApplicationSecurityGroupsClient) ListAll(ctx context.Context) (result ApplicationSecurityGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.ListAll") - defer func() { - sc := -1 - if result.asglr.Response.Response != nil { - sc = result.asglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.asglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure sending request") - return - } - - result.asglr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.asglr.hasNextLink() && result.asglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client ApplicationSecurityGroupsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) ListAllResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client ApplicationSecurityGroupsClient) listAllNextResults(ctx context.Context, lastResults ApplicationSecurityGroupListResult) (result ApplicationSecurityGroupListResult, err error) { - req, err := lastResults.applicationSecurityGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client ApplicationSecurityGroupsClient) ListAllComplete(ctx context.Context) (result ApplicationSecurityGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates an application security group's tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// applicationSecurityGroupName - the name of the application security group. -// parameters - parameters supplied to update application security group tags. -func (client ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject) (result ApplicationSecurityGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, applicationSecurityGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ApplicationSecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ApplicationSecurityGroupsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ApplicationSecurityGroupsClient) UpdateTagsResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availabledelegations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availabledelegations.go deleted file mode 100644 index f5262c88511f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availabledelegations.go +++ /dev/null @@ -1,148 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailableDelegationsClient is the network Client -type AvailableDelegationsClient struct { - BaseClient -} - -// NewAvailableDelegationsClient creates an instance of the AvailableDelegationsClient client. -func NewAvailableDelegationsClient(subscriptionID string) AvailableDelegationsClient { - return NewAvailableDelegationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailableDelegationsClientWithBaseURI creates an instance of the AvailableDelegationsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAvailableDelegationsClientWithBaseURI(baseURI string, subscriptionID string) AvailableDelegationsClient { - return AvailableDelegationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all of the available subnet delegations for this subscription in this region. -// Parameters: -// location - the location of the subnet. -func (client AvailableDelegationsClient) List(ctx context.Context, location string) (result AvailableDelegationsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsClient.List") - defer func() { - sc := -1 - if result.adr.Response.Response != nil { - sc = result.adr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.adr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "List", resp, "Failure sending request") - return - } - - result.adr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "List", resp, "Failure responding to request") - return - } - if result.adr.hasNextLink() && result.adr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailableDelegationsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableDelegations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableDelegationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailableDelegationsClient) ListResponder(resp *http.Response) (result AvailableDelegationsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailableDelegationsClient) listNextResults(ctx context.Context, lastResults AvailableDelegationsResult) (result AvailableDelegationsResult, err error) { - req, err := lastResults.availableDelegationsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableDelegationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableDelegationsClient) ListComplete(ctx context.Context, location string) (result AvailableDelegationsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableendpointservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableendpointservices.go deleted file mode 100644 index c5ac9b3f4e76..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableendpointservices.go +++ /dev/null @@ -1,148 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailableEndpointServicesClient is the network Client -type AvailableEndpointServicesClient struct { - BaseClient -} - -// NewAvailableEndpointServicesClient creates an instance of the AvailableEndpointServicesClient client. -func NewAvailableEndpointServicesClient(subscriptionID string) AvailableEndpointServicesClient { - return NewAvailableEndpointServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailableEndpointServicesClientWithBaseURI creates an instance of the AvailableEndpointServicesClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewAvailableEndpointServicesClientWithBaseURI(baseURI string, subscriptionID string) AvailableEndpointServicesClient { - return AvailableEndpointServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List list what values of endpoint services are available for use. -// Parameters: -// location - the location to check available endpoint services. -func (client AvailableEndpointServicesClient) List(ctx context.Context, location string) (result EndpointServicesListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableEndpointServicesClient.List") - defer func() { - sc := -1 - if result.eslr.Response.Response != nil { - sc = result.eslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.eslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure sending request") - return - } - - result.eslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure responding to request") - return - } - if result.eslr.hasNextLink() && result.eslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailableEndpointServicesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableEndpointServicesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailableEndpointServicesClient) ListResponder(resp *http.Response) (result EndpointServicesListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailableEndpointServicesClient) listNextResults(ctx context.Context, lastResults EndpointServicesListResult) (result EndpointServicesListResult, err error) { - req, err := lastResults.endpointServicesListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableEndpointServicesClient) ListComplete(ctx context.Context, location string) (result EndpointServicesListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableEndpointServicesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableprivateendpointtypes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableprivateendpointtypes.go deleted file mode 100644 index cfbe6e507560..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableprivateendpointtypes.go +++ /dev/null @@ -1,267 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailablePrivateEndpointTypesClient is the network Client -type AvailablePrivateEndpointTypesClient struct { - BaseClient -} - -// NewAvailablePrivateEndpointTypesClient creates an instance of the AvailablePrivateEndpointTypesClient client. -func NewAvailablePrivateEndpointTypesClient(subscriptionID string) AvailablePrivateEndpointTypesClient { - return NewAvailablePrivateEndpointTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailablePrivateEndpointTypesClientWithBaseURI creates an instance of the AvailablePrivateEndpointTypesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewAvailablePrivateEndpointTypesClientWithBaseURI(baseURI string, subscriptionID string) AvailablePrivateEndpointTypesClient { - return AvailablePrivateEndpointTypesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List returns all of the resource types that can be linked to a Private Endpoint in this subscription in this region. -// Parameters: -// location - the location of the domain name. -func (client AvailablePrivateEndpointTypesClient) List(ctx context.Context, location string) (result AvailablePrivateEndpointTypesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesClient.List") - defer func() { - sc := -1 - if result.apetr.Response.Response != nil { - sc = result.apetr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.apetr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "List", resp, "Failure sending request") - return - } - - result.apetr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "List", resp, "Failure responding to request") - return - } - if result.apetr.hasNextLink() && result.apetr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailablePrivateEndpointTypesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailablePrivateEndpointTypesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailablePrivateEndpointTypesClient) ListResponder(resp *http.Response) (result AvailablePrivateEndpointTypesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailablePrivateEndpointTypesClient) listNextResults(ctx context.Context, lastResults AvailablePrivateEndpointTypesResult) (result AvailablePrivateEndpointTypesResult, err error) { - req, err := lastResults.availablePrivateEndpointTypesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailablePrivateEndpointTypesClient) ListComplete(ctx context.Context, location string) (result AvailablePrivateEndpointTypesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} - -// ListByResourceGroup returns all of the resource types that can be linked to a Private Endpoint in this subscription -// in this region. -// Parameters: -// location - the location of the domain name. -// resourceGroupName - the name of the resource group. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroup(ctx context.Context, location string, resourceGroupName string) (result AvailablePrivateEndpointTypesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.apetr.Response.Response != nil { - sc = result.apetr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, location, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.apetr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.apetr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.apetr.hasNextLink() && result.apetr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupPreparer(ctx context.Context, location string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availablePrivateEndpointTypes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupResponder(resp *http.Response) (result AvailablePrivateEndpointTypesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client AvailablePrivateEndpointTypesClient) listByResourceGroupNextResults(ctx context.Context, lastResults AvailablePrivateEndpointTypesResult) (result AvailablePrivateEndpointTypesResult, err error) { - req, err := lastResults.availablePrivateEndpointTypesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailablePrivateEndpointTypesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupComplete(ctx context.Context, location string, resourceGroupName string) (result AvailablePrivateEndpointTypesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, location, resourceGroupName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableresourcegroupdelegations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableresourcegroupdelegations.go deleted file mode 100644 index 81bce6207291..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableresourcegroupdelegations.go +++ /dev/null @@ -1,151 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailableResourceGroupDelegationsClient is the network Client -type AvailableResourceGroupDelegationsClient struct { - BaseClient -} - -// NewAvailableResourceGroupDelegationsClient creates an instance of the AvailableResourceGroupDelegationsClient -// client. -func NewAvailableResourceGroupDelegationsClient(subscriptionID string) AvailableResourceGroupDelegationsClient { - return NewAvailableResourceGroupDelegationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailableResourceGroupDelegationsClientWithBaseURI creates an instance of the -// AvailableResourceGroupDelegationsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAvailableResourceGroupDelegationsClientWithBaseURI(baseURI string, subscriptionID string) AvailableResourceGroupDelegationsClient { - return AvailableResourceGroupDelegationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all of the available subnet delegations for this resource group in this region. -// Parameters: -// location - the location of the domain name. -// resourceGroupName - the name of the resource group. -func (client AvailableResourceGroupDelegationsClient) List(ctx context.Context, location string, resourceGroupName string) (result AvailableDelegationsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableResourceGroupDelegationsClient.List") - defer func() { - sc := -1 - if result.adr.Response.Response != nil { - sc = result.adr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.adr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "List", resp, "Failure sending request") - return - } - - result.adr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "List", resp, "Failure responding to request") - return - } - if result.adr.hasNextLink() && result.adr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailableResourceGroupDelegationsClient) ListPreparer(ctx context.Context, location string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableDelegations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableResourceGroupDelegationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailableResourceGroupDelegationsClient) ListResponder(resp *http.Response) (result AvailableDelegationsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailableResourceGroupDelegationsClient) listNextResults(ctx context.Context, lastResults AvailableDelegationsResult) (result AvailableDelegationsResult, err error) { - req, err := lastResults.availableDelegationsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableResourceGroupDelegationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableResourceGroupDelegationsClient) ListComplete(ctx context.Context, location string, resourceGroupName string) (result AvailableDelegationsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableResourceGroupDelegationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, resourceGroupName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableservicealiases.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableservicealiases.go deleted file mode 100644 index 6b7a2b613dd2..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableservicealiases.go +++ /dev/null @@ -1,266 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailableServiceAliasesClient is the network Client -type AvailableServiceAliasesClient struct { - BaseClient -} - -// NewAvailableServiceAliasesClient creates an instance of the AvailableServiceAliasesClient client. -func NewAvailableServiceAliasesClient(subscriptionID string) AvailableServiceAliasesClient { - return NewAvailableServiceAliasesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailableServiceAliasesClientWithBaseURI creates an instance of the AvailableServiceAliasesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewAvailableServiceAliasesClientWithBaseURI(baseURI string, subscriptionID string) AvailableServiceAliasesClient { - return AvailableServiceAliasesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all available service aliases for this subscription in this region. -// Parameters: -// location - the location. -func (client AvailableServiceAliasesClient) List(ctx context.Context, location string) (result AvailableServiceAliasesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesClient.List") - defer func() { - sc := -1 - if result.asar.Response.Response != nil { - sc = result.asar.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.asar.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "List", resp, "Failure sending request") - return - } - - result.asar, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "List", resp, "Failure responding to request") - return - } - if result.asar.hasNextLink() && result.asar.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailableServiceAliasesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/availableServiceAliases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableServiceAliasesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailableServiceAliasesClient) ListResponder(resp *http.Response) (result AvailableServiceAliasesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailableServiceAliasesClient) listNextResults(ctx context.Context, lastResults AvailableServiceAliasesResult) (result AvailableServiceAliasesResult, err error) { - req, err := lastResults.availableServiceAliasesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableServiceAliasesClient) ListComplete(ctx context.Context, location string) (result AvailableServiceAliasesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} - -// ListByResourceGroup gets all available service aliases for this resource group in this region. -// Parameters: -// resourceGroupName - the name of the resource group. -// location - the location. -func (client AvailableServiceAliasesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, location string) (result AvailableServiceAliasesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.asar.Response.Response != nil { - sc = result.asar.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.asar.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.asar, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.asar.hasNextLink() && result.asar.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AvailableServiceAliasesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/availableServiceAliases", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client AvailableServiceAliasesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client AvailableServiceAliasesClient) ListByResourceGroupResponder(resp *http.Response) (result AvailableServiceAliasesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client AvailableServiceAliasesClient) listByResourceGroupNextResults(ctx context.Context, lastResults AvailableServiceAliasesResult) (result AvailableServiceAliasesResult, err error) { - req, err := lastResults.availableServiceAliasesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AvailableServiceAliasesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailableServiceAliasesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, location string) (result AvailableServiceAliasesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewallfqdntags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewallfqdntags.go deleted file mode 100644 index d8d05de9f5b7..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewallfqdntags.go +++ /dev/null @@ -1,145 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AzureFirewallFqdnTagsClient is the network Client -type AzureFirewallFqdnTagsClient struct { - BaseClient -} - -// NewAzureFirewallFqdnTagsClient creates an instance of the AzureFirewallFqdnTagsClient client. -func NewAzureFirewallFqdnTagsClient(subscriptionID string) AzureFirewallFqdnTagsClient { - return NewAzureFirewallFqdnTagsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAzureFirewallFqdnTagsClientWithBaseURI creates an instance of the AzureFirewallFqdnTagsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewAzureFirewallFqdnTagsClientWithBaseURI(baseURI string, subscriptionID string) AzureFirewallFqdnTagsClient { - return AzureFirewallFqdnTagsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ListAll gets all the Azure Firewall FQDN Tags in a subscription. -func (client AzureFirewallFqdnTagsClient) ListAll(ctx context.Context) (result AzureFirewallFqdnTagListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagsClient.ListAll") - defer func() { - sc := -1 - if result.afftlr.Response.Response != nil { - sc = result.afftlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.afftlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "ListAll", resp, "Failure sending request") - return - } - - result.afftlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.afftlr.hasNextLink() && result.afftlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client AzureFirewallFqdnTagsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewallFqdnTags", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallFqdnTagsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client AzureFirewallFqdnTagsClient) ListAllResponder(resp *http.Response) (result AzureFirewallFqdnTagListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client AzureFirewallFqdnTagsClient) listAllNextResults(ctx context.Context, lastResults AzureFirewallFqdnTagListResult) (result AzureFirewallFqdnTagListResult, err error) { - req, err := lastResults.azureFirewallFqdnTagListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallFqdnTagsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client AzureFirewallFqdnTagsClient) ListAllComplete(ctx context.Context) (result AzureFirewallFqdnTagListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewalls.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewalls.go deleted file mode 100644 index 3246b6636b66..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewalls.go +++ /dev/null @@ -1,666 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AzureFirewallsClient is the network Client -type AzureFirewallsClient struct { - BaseClient -} - -// NewAzureFirewallsClient creates an instance of the AzureFirewallsClient client. -func NewAzureFirewallsClient(subscriptionID string) AzureFirewallsClient { - return NewAzureFirewallsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAzureFirewallsClientWithBaseURI creates an instance of the AzureFirewallsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAzureFirewallsClientWithBaseURI(baseURI string, subscriptionID string) AzureFirewallsClient { - return AzureFirewallsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Azure Firewall. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the Azure Firewall. -// parameters - parameters supplied to the create or update Azure Firewall operation. -func (client AzureFirewallsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (result AzureFirewallsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: azureFirewallName, - Constraints: []validation.Constraint{{Target: "azureFirewallName", Name: validation.MaxLength, Rule: 56, Chain: nil}, - {Target: "azureFirewallName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.AzureFirewallsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, azureFirewallName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AzureFirewallsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters AzureFirewall) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) CreateOrUpdateSender(req *http.Request) (future AzureFirewallsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) CreateOrUpdateResponder(resp *http.Response) (result AzureFirewall, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Azure Firewall. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the Azure Firewall. -func (client AzureFirewallsClient) Delete(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewallsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, azureFirewallName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AzureFirewallsClient) DeletePreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) DeleteSender(req *http.Request) (future AzureFirewallsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Azure Firewall. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the Azure Firewall. -func (client AzureFirewallsClient) Get(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewall, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, azureFirewallName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AzureFirewallsClient) GetPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) GetResponder(resp *http.Response) (result AzureFirewall, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Azure Firewalls in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client AzureFirewallsClient) List(ctx context.Context, resourceGroupName string) (result AzureFirewallListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.List") - defer func() { - sc := -1 - if result.aflr.Response.Response != nil { - sc = result.aflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure sending request") - return - } - - result.aflr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "List", resp, "Failure responding to request") - return - } - if result.aflr.hasNextLink() && result.aflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AzureFirewallsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) ListResponder(resp *http.Response) (result AzureFirewallListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AzureFirewallsClient) listNextResults(ctx context.Context, lastResults AzureFirewallListResult) (result AzureFirewallListResult, err error) { - req, err := lastResults.azureFirewallListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AzureFirewallsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AzureFirewallListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the Azure Firewalls in a subscription. -func (client AzureFirewallsClient) ListAll(ctx context.Context) (result AzureFirewallListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.ListAll") - defer func() { - sc := -1 - if result.aflr.Response.Response != nil { - sc = result.aflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.aflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure sending request") - return - } - - result.aflr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.aflr.hasNextLink() && result.aflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client AzureFirewallsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) ListAllResponder(resp *http.Response) (result AzureFirewallListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client AzureFirewallsClient) listAllNextResults(ctx context.Context, lastResults AzureFirewallListResult) (result AzureFirewallListResult, err error) { - req, err := lastResults.azureFirewallListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client AzureFirewallsClient) ListAllComplete(ctx context.Context) (result AzureFirewallListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListLearnedPrefixes retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the azure firewall. -func (client AzureFirewallsClient) ListLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewallsListLearnedPrefixesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.ListLearnedPrefixes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListLearnedPrefixesPreparer(ctx, resourceGroupName, azureFirewallName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListLearnedPrefixes", nil, "Failure preparing request") - return - } - - result, err = client.ListLearnedPrefixesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListLearnedPrefixes", result.Response(), "Failure sending request") - return - } - - return -} - -// ListLearnedPrefixesPreparer prepares the ListLearnedPrefixes request. -func (client AzureFirewallsClient) ListLearnedPrefixesPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/learnedIPPrefixes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListLearnedPrefixesSender sends the ListLearnedPrefixes request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) ListLearnedPrefixesSender(req *http.Request) (future AzureFirewallsListLearnedPrefixesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListLearnedPrefixesResponder handles the response to the ListLearnedPrefixes request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) ListLearnedPrefixesResponder(resp *http.Response) (result IPPrefixesList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates tags of an Azure Firewall resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// azureFirewallName - the name of the Azure Firewall. -// parameters - parameters supplied to update azure firewall tags. -func (client AzureFirewallsClient) UpdateTags(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject) (result AzureFirewallsUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, azureFirewallName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "UpdateTags", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client AzureFirewallsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "azureFirewallName": autorest.Encode("path", azureFirewallName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client AzureFirewallsClient) UpdateTagsSender(req *http.Request) (future AzureFirewallsUpdateTagsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client AzureFirewallsClient) UpdateTagsResponder(resp *http.Response) (result AzureFirewall, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bastionhosts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bastionhosts.go deleted file mode 100644 index f7f7b35717ed..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bastionhosts.go +++ /dev/null @@ -1,591 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BastionHostsClient is the network Client -type BastionHostsClient struct { - BaseClient -} - -// NewBastionHostsClient creates an instance of the BastionHostsClient client. -func NewBastionHostsClient(subscriptionID string) BastionHostsClient { - return NewBastionHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBastionHostsClientWithBaseURI creates an instance of the BastionHostsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewBastionHostsClientWithBaseURI(baseURI string, subscriptionID string) BastionHostsClient { - return BastionHostsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Bastion Host. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// parameters - parameters supplied to the create or update Bastion Host operation. -func (client BastionHostsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost) (result BastionHostsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.BastionHostPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BastionHostPropertiesFormat.ScaleUnits", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BastionHostPropertiesFormat.ScaleUnits", Name: validation.InclusiveMaximum, Rule: int64(50), Chain: nil}, - {Target: "parameters.BastionHostPropertiesFormat.ScaleUnits", Name: validation.InclusiveMinimum, Rule: int64(2), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.BastionHostsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, bastionHostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BastionHostsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, bastionHostName string, parameters BastionHost) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) CreateOrUpdateSender(req *http.Request) (future BastionHostsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) CreateOrUpdateResponder(resp *http.Response) (result BastionHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Bastion Host. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -func (client BastionHostsClient) Delete(ctx context.Context, resourceGroupName string, bastionHostName string) (result BastionHostsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, bastionHostName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client BastionHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, bastionHostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) DeleteSender(req *http.Request) (future BastionHostsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Bastion Host. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -func (client BastionHostsClient) Get(ctx context.Context, resourceGroupName string, bastionHostName string) (result BastionHost, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, bastionHostName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client BastionHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, bastionHostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) GetResponder(resp *http.Response) (result BastionHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Bastion Hosts in a subscription. -func (client BastionHostsClient) List(ctx context.Context) (result BastionHostListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.List") - defer func() { - sc := -1 - if result.bhlr.Response.Response != nil { - sc = result.bhlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.bhlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "List", resp, "Failure sending request") - return - } - - result.bhlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "List", resp, "Failure responding to request") - return - } - if result.bhlr.hasNextLink() && result.bhlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client BastionHostsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/bastionHosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) ListResponder(resp *http.Response) (result BastionHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client BastionHostsClient) listNextResults(ctx context.Context, lastResults BastionHostListResult) (result BastionHostListResult, err error) { - req, err := lastResults.bastionHostListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BastionHostsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BastionHostsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client BastionHostsClient) ListComplete(ctx context.Context) (result BastionHostListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all Bastion Hosts in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client BastionHostsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result BastionHostListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.bhlr.Response.Response != nil { - sc = result.bhlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.bhlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.bhlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.bhlr.hasNextLink() && result.bhlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client BastionHostsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) ListByResourceGroupResponder(resp *http.Response) (result BastionHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client BastionHostsClient) listByResourceGroupNextResults(ctx context.Context, lastResults BastionHostListResult) (result BastionHostListResult, err error) { - req, err := lastResults.bastionHostListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BastionHostsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BastionHostsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client BastionHostsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result BastionHostListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates Tags for BastionHost resource -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// parameters - parameters supplied to update BastionHost tags. -func (client BastionHostsClient) UpdateTags(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject) (result BastionHostsUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostsClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, bastionHostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsClient", "UpdateTags", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client BastionHostsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client BastionHostsClient) UpdateTagsSender(req *http.Request) (future BastionHostsUpdateTagsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client BastionHostsClient) UpdateTagsResponder(resp *http.Response) (result BastionHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bgpservicecommunities.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bgpservicecommunities.go deleted file mode 100644 index 661637839aec..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bgpservicecommunities.go +++ /dev/null @@ -1,145 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// BgpServiceCommunitiesClient is the network Client -type BgpServiceCommunitiesClient struct { - BaseClient -} - -// NewBgpServiceCommunitiesClient creates an instance of the BgpServiceCommunitiesClient client. -func NewBgpServiceCommunitiesClient(subscriptionID string) BgpServiceCommunitiesClient { - return NewBgpServiceCommunitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewBgpServiceCommunitiesClientWithBaseURI creates an instance of the BgpServiceCommunitiesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewBgpServiceCommunitiesClientWithBaseURI(baseURI string, subscriptionID string) BgpServiceCommunitiesClient { - return BgpServiceCommunitiesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all the available bgp service communities. -func (client BgpServiceCommunitiesClient) List(ctx context.Context) (result BgpServiceCommunityListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunitiesClient.List") - defer func() { - sc := -1 - if result.bsclr.Response.Response != nil { - sc = result.bsclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.bsclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "List", resp, "Failure sending request") - return - } - - result.bsclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "List", resp, "Failure responding to request") - return - } - if result.bsclr.hasNextLink() && result.bsclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client BgpServiceCommunitiesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client BgpServiceCommunitiesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client BgpServiceCommunitiesClient) ListResponder(resp *http.Response) (result BgpServiceCommunityListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client BgpServiceCommunitiesClient) listNextResults(ctx context.Context, lastResults BgpServiceCommunityListResult) (result BgpServiceCommunityListResult, err error) { - req, err := lastResults.bgpServiceCommunityListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BgpServiceCommunitiesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client BgpServiceCommunitiesClient) ListComplete(ctx context.Context) (result BgpServiceCommunityListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunitiesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/client.go deleted file mode 100644 index 33703c4c94df..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/client.go +++ /dev/null @@ -1,1297 +0,0 @@ -// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. -// -// Package network implements the Azure ARM Network service API version . -// -// Network Client -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -const ( - // DefaultBaseURI is the default URI used for the service Network - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Network. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} - -// CheckDNSNameAvailability checks whether a domain name in the cloudapp.azure.com zone is available for use. -// Parameters: -// location - the location of the domain name. -// domainNameLabel - the domain name to be verified. It must conform to the following regular expression: -// ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. -func (client BaseClient) CheckDNSNameAvailability(ctx context.Context, location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckDNSNameAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CheckDNSNameAvailabilityPreparer(ctx, location, domainNameLabel) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "CheckDNSNameAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckDNSNameAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "CheckDNSNameAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckDNSNameAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "CheckDNSNameAvailability", resp, "Failure responding to request") - return - } - - return -} - -// CheckDNSNameAvailabilityPreparer prepares the CheckDNSNameAvailability request. -func (client BaseClient) CheckDNSNameAvailabilityPreparer(ctx context.Context, location string, domainNameLabel string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "domainNameLabel": autorest.Encode("query", domainNameLabel), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckDNSNameAvailabilitySender sends the CheckDNSNameAvailability request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) CheckDNSNameAvailabilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckDNSNameAvailabilityResponder handles the response to the CheckDNSNameAvailability request. The method always -// closes the http.Response Body. -func (client BaseClient) CheckDNSNameAvailabilityResponder(resp *http.Response) (result DNSNameAvailabilityResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// DeleteBastionShareableLink deletes the Bastion Shareable Links for all the VMs specified in the request. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// bslRequest - post request for all the Bastion Shareable Link endpoints. -func (client BaseClient) DeleteBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result DeleteBastionShareableLinkFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteBastionShareableLink") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeleteBastionShareableLinkPreparer(ctx, resourceGroupName, bastionHostName, bslRequest) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "DeleteBastionShareableLink", nil, "Failure preparing request") - return - } - - result, err = client.DeleteBastionShareableLinkSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "DeleteBastionShareableLink", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteBastionShareableLinkPreparer prepares the DeleteBastionShareableLink request. -func (client BaseClient) DeleteBastionShareableLinkPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/deleteShareableLinks", pathParameters), - autorest.WithJSON(bslRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteBastionShareableLinkSender sends the DeleteBastionShareableLink request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) DeleteBastionShareableLinkSender(req *http.Request) (future DeleteBastionShareableLinkFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteBastionShareableLinkResponder handles the response to the DeleteBastionShareableLink request. The method always -// closes the http.Response Body. -func (client BaseClient) DeleteBastionShareableLinkResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisconnectActiveSessions returns the list of currently active sessions on the Bastion. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// sessionIds - the list of sessionids to disconnect. -func (client BaseClient) DisconnectActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIds SessionIds) (result BastionSessionDeleteResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisconnectActiveSessions") - defer func() { - sc := -1 - if result.bsdr.Response.Response != nil { - sc = result.bsdr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.disconnectActiveSessionsNextResults - req, err := client.DisconnectActiveSessionsPreparer(ctx, resourceGroupName, bastionHostName, sessionIds) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "DisconnectActiveSessions", nil, "Failure preparing request") - return - } - - resp, err := client.DisconnectActiveSessionsSender(req) - if err != nil { - result.bsdr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "DisconnectActiveSessions", resp, "Failure sending request") - return - } - - result.bsdr, err = client.DisconnectActiveSessionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "DisconnectActiveSessions", resp, "Failure responding to request") - return - } - if result.bsdr.hasNextLink() && result.bsdr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// DisconnectActiveSessionsPreparer prepares the DisconnectActiveSessions request. -func (client BaseClient) DisconnectActiveSessionsPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIds SessionIds) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/disconnectActiveSessions", pathParameters), - autorest.WithJSON(sessionIds), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisconnectActiveSessionsSender sends the DisconnectActiveSessions request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) DisconnectActiveSessionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DisconnectActiveSessionsResponder handles the response to the DisconnectActiveSessions request. The method always -// closes the http.Response Body. -func (client BaseClient) DisconnectActiveSessionsResponder(resp *http.Response) (result BastionSessionDeleteResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// disconnectActiveSessionsNextResults retrieves the next set of results, if any. -func (client BaseClient) disconnectActiveSessionsNextResults(ctx context.Context, lastResults BastionSessionDeleteResult) (result BastionSessionDeleteResult, err error) { - req, err := lastResults.bastionSessionDeleteResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "disconnectActiveSessionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.DisconnectActiveSessionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BaseClient", "disconnectActiveSessionsNextResults", resp, "Failure sending next results request") - } - result, err = client.DisconnectActiveSessionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "disconnectActiveSessionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// DisconnectActiveSessionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) DisconnectActiveSessionsComplete(ctx context.Context, resourceGroupName string, bastionHostName string, sessionIds SessionIds) (result BastionSessionDeleteResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisconnectActiveSessions") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.DisconnectActiveSessions(ctx, resourceGroupName, bastionHostName, sessionIds) - return -} - -// ExpressRouteProviderPortMethod retrieves detail of a provider port. -// Parameters: -// providerport - the name of the provider port. -func (client BaseClient) ExpressRouteProviderPortMethod(ctx context.Context, providerport string) (result ExpressRouteProviderPort, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ExpressRouteProviderPortMethod") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ExpressRouteProviderPortMethodPreparer(ctx, providerport) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ExpressRouteProviderPortMethod", nil, "Failure preparing request") - return - } - - resp, err := client.ExpressRouteProviderPortMethodSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "ExpressRouteProviderPortMethod", resp, "Failure sending request") - return - } - - result, err = client.ExpressRouteProviderPortMethodResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ExpressRouteProviderPortMethod", resp, "Failure responding to request") - return - } - - return -} - -// ExpressRouteProviderPortMethodPreparer prepares the ExpressRouteProviderPortMethod request. -func (client BaseClient) ExpressRouteProviderPortMethodPreparer(ctx context.Context, providerport string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "providerport": autorest.Encode("path", providerport), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExpressRouteProviderPortMethodSender sends the ExpressRouteProviderPortMethod request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) ExpressRouteProviderPortMethodSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ExpressRouteProviderPortMethodResponder handles the response to the ExpressRouteProviderPortMethod request. The method always -// closes the http.Response Body. -func (client BaseClient) ExpressRouteProviderPortMethodResponder(resp *http.Response) (result ExpressRouteProviderPort, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Generatevirtualwanvpnserverconfigurationvpnprofile generates a unique VPN profile for P2S clients for VirtualWan and -// associated VpnServerConfiguration combination in the specified resource group. -// Parameters: -// resourceGroupName - the resource group name. -// virtualWANName - the name of the VirtualWAN whose associated VpnServerConfigurations is needed. -// vpnClientParams - parameters supplied to the generate VirtualWan VPN profile generation operation. -func (client BaseClient) Generatevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVpnProfileParameters) (result GeneratevirtualwanvpnserverconfigurationvpnprofileFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Generatevirtualwanvpnserverconfigurationvpnprofile") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GeneratevirtualwanvpnserverconfigurationvpnprofilePreparer(ctx, resourceGroupName, virtualWANName, vpnClientParams) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "Generatevirtualwanvpnserverconfigurationvpnprofile", nil, "Failure preparing request") - return - } - - result, err = client.GeneratevirtualwanvpnserverconfigurationvpnprofileSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "Generatevirtualwanvpnserverconfigurationvpnprofile", result.Response(), "Failure sending request") - return - } - - return -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofilePreparer prepares the Generatevirtualwanvpnserverconfigurationvpnprofile request. -func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofilePreparer(ctx context.Context, resourceGroupName string, virtualWANName string, vpnClientParams VirtualWanVpnProfileParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/GenerateVpnProfile", pathParameters), - autorest.WithJSON(vpnClientParams), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofileSender sends the Generatevirtualwanvpnserverconfigurationvpnprofile request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofileSender(req *http.Request) (future GeneratevirtualwanvpnserverconfigurationvpnprofileFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofileResponder handles the response to the Generatevirtualwanvpnserverconfigurationvpnprofile request. The method always -// closes the http.Response Body. -func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofileResponder(resp *http.Response) (result VpnProfileResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetActiveSessions returns the list of currently active sessions on the Bastion. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -func (client BaseClient) GetActiveSessions(ctx context.Context, resourceGroupName string, bastionHostName string) (result GetActiveSessionsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetActiveSessions") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetActiveSessionsPreparer(ctx, resourceGroupName, bastionHostName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetActiveSessions", nil, "Failure preparing request") - return - } - - result, err = client.GetActiveSessionsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetActiveSessions", result.Response(), "Failure sending request") - return - } - - return -} - -// GetActiveSessionsPreparer prepares the GetActiveSessions request. -func (client BaseClient) GetActiveSessionsPreparer(ctx context.Context, resourceGroupName string, bastionHostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getActiveSessions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetActiveSessionsSender sends the GetActiveSessions request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetActiveSessionsSender(req *http.Request) (future GetActiveSessionsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetActiveSessionsResponder handles the response to the GetActiveSessions request. The method always -// closes the http.Response Body. -func (client BaseClient) GetActiveSessionsResponder(resp *http.Response) (result BastionActiveSessionListResultPage, err error) { - result.baslr, err = client.getActiveSessionsResponder(resp) - result.fn = client.getActiveSessionsNextResults - return -} - -func (client BaseClient) getActiveSessionsResponder(resp *http.Response) (result BastionActiveSessionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getActiveSessionsNextResults retrieves the next set of results, if any. -func (client BaseClient) getActiveSessionsNextResults(ctx context.Context, lastResults BastionActiveSessionListResult) (result BastionActiveSessionListResult, err error) { - req, err := lastResults.bastionActiveSessionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "getActiveSessionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - var resp *http.Response - resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "getActiveSessionsNextResults", resp, "Failure sending next results request") - } - return client.getActiveSessionsResponder(resp) -} - -// GetActiveSessionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) GetActiveSessionsComplete(ctx context.Context, resourceGroupName string, bastionHostName string) (result GetActiveSessionsAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetActiveSessions") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - var future GetActiveSessionsFuture - future, err = client.GetActiveSessions(ctx, resourceGroupName, bastionHostName) - result.FutureAPI = future.FutureAPI - return -} - -// GetBastionShareableLink return the Bastion Shareable Links for all the VMs specified in the request. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// bslRequest - post request for all the Bastion Shareable Link endpoints. -func (client BaseClient) GetBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result BastionShareableLinkListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBastionShareableLink") - defer func() { - sc := -1 - if result.bsllr.Response.Response != nil { - sc = result.bsllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.getBastionShareableLinkNextResults - req, err := client.GetBastionShareableLinkPreparer(ctx, resourceGroupName, bastionHostName, bslRequest) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetBastionShareableLink", nil, "Failure preparing request") - return - } - - resp, err := client.GetBastionShareableLinkSender(req) - if err != nil { - result.bsllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetBastionShareableLink", resp, "Failure sending request") - return - } - - result.bsllr, err = client.GetBastionShareableLinkResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "GetBastionShareableLink", resp, "Failure responding to request") - return - } - if result.bsllr.hasNextLink() && result.bsllr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// GetBastionShareableLinkPreparer prepares the GetBastionShareableLink request. -func (client BaseClient) GetBastionShareableLinkPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/getShareableLinks", pathParameters), - autorest.WithJSON(bslRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetBastionShareableLinkSender sends the GetBastionShareableLink request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) GetBastionShareableLinkSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetBastionShareableLinkResponder handles the response to the GetBastionShareableLink request. The method always -// closes the http.Response Body. -func (client BaseClient) GetBastionShareableLinkResponder(resp *http.Response) (result BastionShareableLinkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getBastionShareableLinkNextResults retrieves the next set of results, if any. -func (client BaseClient) getBastionShareableLinkNextResults(ctx context.Context, lastResults BastionShareableLinkListResult) (result BastionShareableLinkListResult, err error) { - req, err := lastResults.bastionShareableLinkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "getBastionShareableLinkNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetBastionShareableLinkSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.BaseClient", "getBastionShareableLinkNextResults", resp, "Failure sending next results request") - } - result, err = client.GetBastionShareableLinkResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "getBastionShareableLinkNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetBastionShareableLinkComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) GetBastionShareableLinkComplete(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result BastionShareableLinkListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBastionShareableLink") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.GetBastionShareableLink(ctx, resourceGroupName, bastionHostName, bslRequest) - return -} - -// ListActiveConnectivityConfigurations lists active connectivity configurations in a network manager. -// Parameters: -// parameters - active Configuration Parameter. -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -func (client BaseClient) ListActiveConnectivityConfigurations(ctx context.Context, parameters ActiveConfigurationParameter, resourceGroupName string, networkManagerName string, top *int32) (result ActiveConnectivityConfigurationsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListActiveConnectivityConfigurations") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.BaseClient", "ListActiveConnectivityConfigurations", err.Error()) - } - - req, err := client.ListActiveConnectivityConfigurationsPreparer(ctx, parameters, resourceGroupName, networkManagerName, top) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveConnectivityConfigurations", nil, "Failure preparing request") - return - } - - resp, err := client.ListActiveConnectivityConfigurationsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveConnectivityConfigurations", resp, "Failure sending request") - return - } - - result, err = client.ListActiveConnectivityConfigurationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveConnectivityConfigurations", resp, "Failure responding to request") - return - } - - return -} - -// ListActiveConnectivityConfigurationsPreparer prepares the ListActiveConnectivityConfigurations request. -func (client BaseClient) ListActiveConnectivityConfigurationsPreparer(ctx context.Context, parameters ActiveConfigurationParameter, resourceGroupName string, networkManagerName string, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveConnectivityConfigurations", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListActiveConnectivityConfigurationsSender sends the ListActiveConnectivityConfigurations request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) ListActiveConnectivityConfigurationsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListActiveConnectivityConfigurationsResponder handles the response to the ListActiveConnectivityConfigurations request. The method always -// closes the http.Response Body. -func (client BaseClient) ListActiveConnectivityConfigurationsResponder(resp *http.Response) (result ActiveConnectivityConfigurationsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListActiveSecurityAdminRules lists active security admin rules in a network manager. -// Parameters: -// parameters - active Configuration Parameter. -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -func (client BaseClient) ListActiveSecurityAdminRules(ctx context.Context, parameters ActiveConfigurationParameter, resourceGroupName string, networkManagerName string, top *int32) (result ActiveSecurityAdminRulesListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListActiveSecurityAdminRules") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.BaseClient", "ListActiveSecurityAdminRules", err.Error()) - } - - req, err := client.ListActiveSecurityAdminRulesPreparer(ctx, parameters, resourceGroupName, networkManagerName, top) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveSecurityAdminRules", nil, "Failure preparing request") - return - } - - resp, err := client.ListActiveSecurityAdminRulesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveSecurityAdminRules", resp, "Failure sending request") - return - } - - result, err = client.ListActiveSecurityAdminRulesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveSecurityAdminRules", resp, "Failure responding to request") - return - } - - return -} - -// ListActiveSecurityAdminRulesPreparer prepares the ListActiveSecurityAdminRules request. -func (client BaseClient) ListActiveSecurityAdminRulesPreparer(ctx context.Context, parameters ActiveConfigurationParameter, resourceGroupName string, networkManagerName string, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityAdminRules", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListActiveSecurityAdminRulesSender sends the ListActiveSecurityAdminRules request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) ListActiveSecurityAdminRulesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListActiveSecurityAdminRulesResponder handles the response to the ListActiveSecurityAdminRules request. The method always -// closes the http.Response Body. -func (client BaseClient) ListActiveSecurityAdminRulesResponder(resp *http.Response) (result ActiveSecurityAdminRulesListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListNetworkManagerEffectiveConnectivityConfigurations list all effective connectivity configurations applied on a -// virtual network. -// Parameters: -// parameters - parameters supplied to list correct page. -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -func (client BaseClient) ListNetworkManagerEffectiveConnectivityConfigurations(ctx context.Context, parameters QueryRequestOptions, resourceGroupName string, virtualNetworkName string, top *int32) (result ManagerEffectiveConnectivityConfigurationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListNetworkManagerEffectiveConnectivityConfigurations") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.BaseClient", "ListNetworkManagerEffectiveConnectivityConfigurations", err.Error()) - } - - req, err := client.ListNetworkManagerEffectiveConnectivityConfigurationsPreparer(ctx, parameters, resourceGroupName, virtualNetworkName, top) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveConnectivityConfigurations", nil, "Failure preparing request") - return - } - - resp, err := client.ListNetworkManagerEffectiveConnectivityConfigurationsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveConnectivityConfigurations", resp, "Failure sending request") - return - } - - result, err = client.ListNetworkManagerEffectiveConnectivityConfigurationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveConnectivityConfigurations", resp, "Failure responding to request") - return - } - - return -} - -// ListNetworkManagerEffectiveConnectivityConfigurationsPreparer prepares the ListNetworkManagerEffectiveConnectivityConfigurations request. -func (client BaseClient) ListNetworkManagerEffectiveConnectivityConfigurationsPreparer(ctx context.Context, parameters QueryRequestOptions, resourceGroupName string, virtualNetworkName string, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveConnectivityConfigurations", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNetworkManagerEffectiveConnectivityConfigurationsSender sends the ListNetworkManagerEffectiveConnectivityConfigurations request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) ListNetworkManagerEffectiveConnectivityConfigurationsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListNetworkManagerEffectiveConnectivityConfigurationsResponder handles the response to the ListNetworkManagerEffectiveConnectivityConfigurations request. The method always -// closes the http.Response Body. -func (client BaseClient) ListNetworkManagerEffectiveConnectivityConfigurationsResponder(resp *http.Response) (result ManagerEffectiveConnectivityConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListNetworkManagerEffectiveSecurityAdminRules list all effective security admin rules applied on a virtual network. -// Parameters: -// parameters - parameters supplied to list correct page. -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -func (client BaseClient) ListNetworkManagerEffectiveSecurityAdminRules(ctx context.Context, parameters QueryRequestOptions, resourceGroupName string, virtualNetworkName string, top *int32) (result ManagerEffectiveSecurityAdminRulesListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListNetworkManagerEffectiveSecurityAdminRules") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.BaseClient", "ListNetworkManagerEffectiveSecurityAdminRules", err.Error()) - } - - req, err := client.ListNetworkManagerEffectiveSecurityAdminRulesPreparer(ctx, parameters, resourceGroupName, virtualNetworkName, top) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveSecurityAdminRules", nil, "Failure preparing request") - return - } - - resp, err := client.ListNetworkManagerEffectiveSecurityAdminRulesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveSecurityAdminRules", resp, "Failure sending request") - return - } - - result, err = client.ListNetworkManagerEffectiveSecurityAdminRulesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveSecurityAdminRules", resp, "Failure responding to request") - return - } - - return -} - -// ListNetworkManagerEffectiveSecurityAdminRulesPreparer prepares the ListNetworkManagerEffectiveSecurityAdminRules request. -func (client BaseClient) ListNetworkManagerEffectiveSecurityAdminRulesPreparer(ctx context.Context, parameters QueryRequestOptions, resourceGroupName string, virtualNetworkName string, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveSecurityAdminRules", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListNetworkManagerEffectiveSecurityAdminRulesSender sends the ListNetworkManagerEffectiveSecurityAdminRules request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) ListNetworkManagerEffectiveSecurityAdminRulesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListNetworkManagerEffectiveSecurityAdminRulesResponder handles the response to the ListNetworkManagerEffectiveSecurityAdminRules request. The method always -// closes the http.Response Body. -func (client BaseClient) ListNetworkManagerEffectiveSecurityAdminRulesResponder(resp *http.Response) (result ManagerEffectiveSecurityAdminRulesListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// PutBastionShareableLink creates a Bastion Shareable Links for all the VMs specified in the request. -// Parameters: -// resourceGroupName - the name of the resource group. -// bastionHostName - the name of the Bastion Host. -// bslRequest - post request for all the Bastion Shareable Link endpoints. -func (client BaseClient) PutBastionShareableLink(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result PutBastionShareableLinkFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutBastionShareableLink") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PutBastionShareableLinkPreparer(ctx, resourceGroupName, bastionHostName, bslRequest) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "PutBastionShareableLink", nil, "Failure preparing request") - return - } - - result, err = client.PutBastionShareableLinkSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "PutBastionShareableLink", result.Response(), "Failure sending request") - return - } - - return -} - -// PutBastionShareableLinkPreparer prepares the PutBastionShareableLink request. -func (client BaseClient) PutBastionShareableLinkPreparer(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "bastionHostName": autorest.Encode("path", bastionHostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/bastionHosts/{bastionHostName}/createShareableLinks", pathParameters), - autorest.WithJSON(bslRequest), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PutBastionShareableLinkSender sends the PutBastionShareableLink request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) PutBastionShareableLinkSender(req *http.Request) (future PutBastionShareableLinkFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PutBastionShareableLinkResponder handles the response to the PutBastionShareableLink request. The method always -// closes the http.Response Body. -func (client BaseClient) PutBastionShareableLinkResponder(resp *http.Response) (result BastionShareableLinkListResultPage, err error) { - result.bsllr, err = client.putBastionShareableLinkResponder(resp) - result.fn = client.putBastionShareableLinkNextResults - return -} - -func (client BaseClient) putBastionShareableLinkResponder(resp *http.Response) (result BastionShareableLinkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// putBastionShareableLinkNextResults retrieves the next set of results, if any. -func (client BaseClient) putBastionShareableLinkNextResults(ctx context.Context, lastResults BastionShareableLinkListResult) (result BastionShareableLinkListResult, err error) { - req, err := lastResults.bastionShareableLinkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "putBastionShareableLinkNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - var resp *http.Response - resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.BaseClient", "putBastionShareableLinkNextResults", resp, "Failure sending next results request") - } - return client.putBastionShareableLinkResponder(resp) -} - -// PutBastionShareableLinkComplete enumerates all values, automatically crossing page boundaries as required. -func (client BaseClient) PutBastionShareableLinkComplete(ctx context.Context, resourceGroupName string, bastionHostName string, bslRequest BastionShareableLinkListRequest) (result PutBastionShareableLinkAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutBastionShareableLink") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - var future PutBastionShareableLinkFuture - future, err = client.PutBastionShareableLink(ctx, resourceGroupName, bastionHostName, bslRequest) - result.FutureAPI = future.FutureAPI - return -} - -// SupportedSecurityProviders gives the supported security providers for the virtual wan. -// Parameters: -// resourceGroupName - the resource group name. -// virtualWANName - the name of the VirtualWAN for which supported security providers are needed. -func (client BaseClient) SupportedSecurityProviders(ctx context.Context, resourceGroupName string, virtualWANName string) (result VirtualWanSecurityProviders, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SupportedSecurityProviders") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SupportedSecurityProvidersPreparer(ctx, resourceGroupName, virtualWANName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "SupportedSecurityProviders", nil, "Failure preparing request") - return - } - - resp, err := client.SupportedSecurityProvidersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.BaseClient", "SupportedSecurityProviders", resp, "Failure sending request") - return - } - - result, err = client.SupportedSecurityProvidersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BaseClient", "SupportedSecurityProviders", resp, "Failure responding to request") - return - } - - return -} - -// SupportedSecurityProvidersPreparer prepares the SupportedSecurityProviders request. -func (client BaseClient) SupportedSecurityProvidersPreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SupportedSecurityProvidersSender sends the SupportedSecurityProviders request. The method will close the -// http.Response Body if it receives an error. -func (client BaseClient) SupportedSecurityProvidersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SupportedSecurityProvidersResponder handles the response to the SupportedSecurityProviders request. The method always -// closes the http.Response Body. -func (client BaseClient) SupportedSecurityProvidersResponder(resp *http.Response) (result VirtualWanSecurityProviders, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/configurationpolicygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/configurationpolicygroups.go deleted file mode 100644 index 79c24fee950a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/configurationpolicygroups.go +++ /dev/null @@ -1,396 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ConfigurationPolicyGroupsClient is the network Client -type ConfigurationPolicyGroupsClient struct { - BaseClient -} - -// NewConfigurationPolicyGroupsClient creates an instance of the ConfigurationPolicyGroupsClient client. -func NewConfigurationPolicyGroupsClient(subscriptionID string) ConfigurationPolicyGroupsClient { - return NewConfigurationPolicyGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewConfigurationPolicyGroupsClientWithBaseURI creates an instance of the ConfigurationPolicyGroupsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewConfigurationPolicyGroupsClientWithBaseURI(baseURI string, subscriptionID string) ConfigurationPolicyGroupsClient { - return ConfigurationPolicyGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a ConfigurationPolicyGroup if it doesn't exist else updates the existing one. -// Parameters: -// resourceGroupName - the resource group name of the ConfigurationPolicyGroup. -// vpnServerConfigurationName - the name of the VpnServerConfiguration. -// configurationPolicyGroupName - the name of the ConfigurationPolicyGroup. -// vpnServerConfigurationPolicyGroupParameters - parameters supplied to create or update a -// VpnServerConfiguration PolicyGroup. -func (client ConfigurationPolicyGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VpnServerConfigurationPolicyGroup) (result ConfigurationPolicyGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName, vpnServerConfigurationPolicyGroupParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConfigurationPolicyGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string, vpnServerConfigurationPolicyGroupParameters VpnServerConfigurationPolicyGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationPolicyGroupName": autorest.Encode("path", configurationPolicyGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - vpnServerConfigurationPolicyGroupParameters.Etag = nil - vpnServerConfigurationPolicyGroupParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", pathParameters), - autorest.WithJSON(vpnServerConfigurationPolicyGroupParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ConfigurationPolicyGroupsClient) CreateOrUpdateSender(req *http.Request) (future ConfigurationPolicyGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ConfigurationPolicyGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnServerConfigurationPolicyGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a ConfigurationPolicyGroup. -// Parameters: -// resourceGroupName - the resource group name of the ConfigurationPolicyGroup. -// vpnServerConfigurationName - the name of the VpnServerConfiguration. -// configurationPolicyGroupName - the name of the ConfigurationPolicyGroup. -func (client ConfigurationPolicyGroupsClient) Delete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) (result ConfigurationPolicyGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ConfigurationPolicyGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationPolicyGroupName": autorest.Encode("path", configurationPolicyGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ConfigurationPolicyGroupsClient) DeleteSender(req *http.Request) (future ConfigurationPolicyGroupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ConfigurationPolicyGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a ConfigurationPolicyGroup. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration. -// configurationPolicyGroupName - the name of the ConfigurationPolicyGroup being retrieved. -func (client ConfigurationPolicyGroupsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) (result VpnServerConfigurationPolicyGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, vpnServerConfigurationName, configurationPolicyGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ConfigurationPolicyGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationPolicyGroupName": autorest.Encode("path", configurationPolicyGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups/{configurationPolicyGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ConfigurationPolicyGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ConfigurationPolicyGroupsClient) GetResponder(resp *http.Response) (result VpnServerConfigurationPolicyGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByVpnServerConfiguration lists all the configurationPolicyGroups in a resource group for a -// vpnServerConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration. -func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfiguration(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (result ListVpnServerConfigurationPolicyGroupsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.ListByVpnServerConfiguration") - defer func() { - sc := -1 - if result.lvscpgr.Response.Response != nil { - sc = result.lvscpgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVpnServerConfigurationNextResults - req, err := client.ListByVpnServerConfigurationPreparer(ctx, resourceGroupName, vpnServerConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "ListByVpnServerConfiguration", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVpnServerConfigurationSender(req) - if err != nil { - result.lvscpgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "ListByVpnServerConfiguration", resp, "Failure sending request") - return - } - - result.lvscpgr, err = client.ListByVpnServerConfigurationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "ListByVpnServerConfiguration", resp, "Failure responding to request") - return - } - if result.lvscpgr.hasNextLink() && result.lvscpgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVpnServerConfigurationPreparer prepares the ListByVpnServerConfiguration request. -func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationPreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}/configurationPolicyGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVpnServerConfigurationSender sends the ListByVpnServerConfiguration request. The method will close the -// http.Response Body if it receives an error. -func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVpnServerConfigurationResponder handles the response to the ListByVpnServerConfiguration request. The method always -// closes the http.Response Body. -func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationResponder(resp *http.Response) (result ListVpnServerConfigurationPolicyGroupsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVpnServerConfigurationNextResults retrieves the next set of results, if any. -func (client ConfigurationPolicyGroupsClient) listByVpnServerConfigurationNextResults(ctx context.Context, lastResults ListVpnServerConfigurationPolicyGroupsResult) (result ListVpnServerConfigurationPolicyGroupsResult, err error) { - req, err := lastResults.listVpnServerConfigurationPolicyGroupsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "listByVpnServerConfigurationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVpnServerConfigurationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "listByVpnServerConfigurationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVpnServerConfigurationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsClient", "listByVpnServerConfigurationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVpnServerConfigurationComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationComplete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (result ListVpnServerConfigurationPolicyGroupsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationPolicyGroupsClient.ListByVpnServerConfiguration") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVpnServerConfiguration(ctx, resourceGroupName, vpnServerConfigurationName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectionmonitors.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectionmonitors.go deleted file mode 100644 index bdd5308976e5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectionmonitors.go +++ /dev/null @@ -1,701 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ConnectionMonitorsClient is the network Client -type ConnectionMonitorsClient struct { - BaseClient -} - -// NewConnectionMonitorsClient creates an instance of the ConnectionMonitorsClient client. -func NewConnectionMonitorsClient(subscriptionID string) ConnectionMonitorsClient { - return NewConnectionMonitorsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewConnectionMonitorsClientWithBaseURI creates an instance of the ConnectionMonitorsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewConnectionMonitorsClientWithBaseURI(baseURI string, subscriptionID string) ConnectionMonitorsClient { - return ConnectionMonitorsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -// parameters - parameters that define the operation to create a connection monitor. -// migrate - value indicating whether connection monitor V1 should be migrated to V2 format. -func (client ConnectionMonitorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, migrate string) (result ConnectionMonitorsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters.Source", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters.Source.ResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ConnectionMonitorParameters.Source.Port", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters.Source.Port", Name: validation.InclusiveMaximum, Rule: int64(65535), Chain: nil}, - {Target: "parameters.ConnectionMonitorParameters.Source.Port", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - {Target: "parameters.ConnectionMonitorParameters.Destination", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters.Destination.Port", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters.Destination.Port", Name: validation.InclusiveMaximum, Rule: int64(65535), Chain: nil}, - {Target: "parameters.ConnectionMonitorParameters.Destination.Port", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - {Target: "parameters.ConnectionMonitorParameters.MonitoringIntervalInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ConnectionMonitorParameters.MonitoringIntervalInSeconds", Name: validation.InclusiveMaximum, Rule: int64(1800), Chain: nil}, - {Target: "parameters.ConnectionMonitorParameters.MonitoringIntervalInSeconds", Name: validation.InclusiveMinimum, Rule: int64(30), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.ConnectionMonitorsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters, migrate) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor, migrate string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(migrate) > 0 { - queryParameters["migrate"] = autorest.Encode("query", migrate) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) CreateOrUpdateSender(req *http.Request) (future ConnectionMonitorsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -func (client ConnectionMonitorsClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) DeleteSender(req *http.Request) (future ConnectionMonitorsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a connection monitor by name. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -func (client ConnectionMonitorsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ConnectionMonitorsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) GetResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all connection monitors for the specified Network Watcher. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -func (client ConnectionMonitorsClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result ConnectionMonitorListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ConnectionMonitorsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) ListResponder(resp *http.Response) (result ConnectionMonitorListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Query query a snapshot of the most recent connection states. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name given to the connection monitor. -func (client ConnectionMonitorsClient) Query(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsQueryFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Query") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.QueryPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Query", nil, "Failure preparing request") - return - } - - result, err = client.QuerySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Query", result.Response(), "Failure sending request") - return - } - - return -} - -// QueryPreparer prepares the Query request. -func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// QuerySender sends the Query request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) QuerySender(req *http.Request) (future ConnectionMonitorsQueryFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// QueryResponder handles the response to the Query request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) QueryResponder(resp *http.Response) (result ConnectionMonitorQueryResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Start starts the specified connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -func (client ConnectionMonitorsClient) Start(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) StartSender(req *http.Request) (future ConnectionMonitorsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Stop stops the specified connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -// connectionMonitorName - the name of the connection monitor. -func (client ConnectionMonitorsClient) Stop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsStopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.Stop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Stop", nil, "Failure preparing request") - return - } - - result, err = client.StopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "Stop", result.Response(), "Failure sending request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) StopSender(req *http.Request) (future ConnectionMonitorsStopFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// UpdateTags update tags of the specified connection monitor. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// connectionMonitorName - the name of the connection monitor. -// parameters - parameters supplied to update connection monitor tags. -func (client ConnectionMonitorsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject) (result ConnectionMonitorResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionMonitorsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ConnectionMonitorsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionMonitorName": autorest.Encode("path", connectionMonitorName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectionMonitorsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ConnectionMonitorsClient) UpdateTagsResponder(resp *http.Response) (result ConnectionMonitorResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectivityconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectivityconfigurations.go deleted file mode 100644 index c5243c646bf9..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectivityconfigurations.go +++ /dev/null @@ -1,426 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ConnectivityConfigurationsClient is the network Client -type ConnectivityConfigurationsClient struct { - BaseClient -} - -// NewConnectivityConfigurationsClient creates an instance of the ConnectivityConfigurationsClient client. -func NewConnectivityConfigurationsClient(subscriptionID string) ConnectivityConfigurationsClient { - return NewConnectivityConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewConnectivityConfigurationsClientWithBaseURI creates an instance of the ConnectivityConfigurationsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewConnectivityConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ConnectivityConfigurationsClient { - return ConnectivityConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates/Updates a new network manager connectivity configuration -// Parameters: -// connectivityConfiguration - parameters supplied to create/update a network manager connectivity -// configuration -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager connectivity configuration. -func (client ConnectivityConfigurationsClient) CreateOrUpdate(ctx context.Context, connectivityConfiguration ConnectivityConfiguration, resourceGroupName string, networkManagerName string, configurationName string) (result ConnectivityConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: connectivityConfiguration, - Constraints: []validation.Constraint{{Target: "connectivityConfiguration.ConnectivityConfigurationProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "connectivityConfiguration.ConnectivityConfigurationProperties.AppliesToGroups", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("network.ConnectivityConfigurationsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, connectivityConfiguration, resourceGroupName, networkManagerName, configurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ConnectivityConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, connectivityConfiguration ConnectivityConfiguration, resourceGroupName string, networkManagerName string, configurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - connectivityConfiguration.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", pathParameters), - autorest.WithJSON(connectivityConfiguration), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectivityConfigurationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ConnectivityConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectivityConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a network manager connectivity configuration, specified by the resource group, network manager name, -// and connectivity configuration name -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager connectivity configuration. -// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been -// deployed, the service will do a cleanup deployment in the background, prior to the delete. -func (client ConnectivityConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, force *bool) (result ConnectivityConfigurationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, configurationName, force) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ConnectivityConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, force *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if force != nil { - queryParameters["force"] = autorest.Encode("query", *force) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectivityConfigurationsClient) DeleteSender(req *http.Request) (future ConnectivityConfigurationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ConnectivityConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a Network Connectivity Configuration, specified by the resource group, network manager name, and -// connectivity Configuration name -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager connectivity configuration. -func (client ConnectivityConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string) (result ConnectivityConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, configurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ConnectivityConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectivityConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ConnectivityConfigurationsClient) GetResponder(resp *http.Response) (result ConnectivityConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the network manager connectivity configuration in a specified network manager. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client ConnectivityConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result ConnectivityConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.List") - defer func() { - sc := -1 - if result.cclr.Response.Response != nil { - sc = result.cclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.ConnectivityConfigurationsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.cclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.cclr.hasNextLink() && result.cclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ConnectivityConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ConnectivityConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ConnectivityConfigurationsClient) ListResponder(resp *http.Response) (result ConnectivityConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ConnectivityConfigurationsClient) listNextResults(ctx context.Context, lastResults ConnectivityConfigurationListResult) (result ConnectivityConfigurationListResult, err error) { - req, err := lastResults.connectivityConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ConnectivityConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result ConnectivityConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkManagerName, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/customipprefixes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/customipprefixes.go deleted file mode 100644 index 9667eff63548..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/customipprefixes.go +++ /dev/null @@ -1,581 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// CustomIPPrefixesClient is the network Client -type CustomIPPrefixesClient struct { - BaseClient -} - -// NewCustomIPPrefixesClient creates an instance of the CustomIPPrefixesClient client. -func NewCustomIPPrefixesClient(subscriptionID string) CustomIPPrefixesClient { - return NewCustomIPPrefixesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewCustomIPPrefixesClientWithBaseURI creates an instance of the CustomIPPrefixesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewCustomIPPrefixesClientWithBaseURI(baseURI string, subscriptionID string) CustomIPPrefixesClient { - return CustomIPPrefixesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a custom IP prefix. -// Parameters: -// resourceGroupName - the name of the resource group. -// customIPPrefixName - the name of the custom IP prefix. -// parameters - parameters supplied to the create or update custom IP prefix operation. -func (client CustomIPPrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix) (result CustomIPPrefixesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, customIPPrefixName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client CustomIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters CustomIPPrefix) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "customIpPrefixName": autorest.Encode("path", customIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client CustomIPPrefixesClient) CreateOrUpdateSender(req *http.Request) (future CustomIPPrefixesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client CustomIPPrefixesClient) CreateOrUpdateResponder(resp *http.Response) (result CustomIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified custom IP prefix. -// Parameters: -// resourceGroupName - the name of the resource group. -// customIPPrefixName - the name of the CustomIpPrefix. -func (client CustomIPPrefixesClient) Delete(ctx context.Context, resourceGroupName string, customIPPrefixName string) (result CustomIPPrefixesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, customIPPrefixName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client CustomIPPrefixesClient) DeletePreparer(ctx context.Context, resourceGroupName string, customIPPrefixName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "customIpPrefixName": autorest.Encode("path", customIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client CustomIPPrefixesClient) DeleteSender(req *http.Request) (future CustomIPPrefixesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client CustomIPPrefixesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified custom IP prefix in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// customIPPrefixName - the name of the custom IP prefix. -// expand - expands referenced resources. -func (client CustomIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, customIPPrefixName string, expand string) (result CustomIPPrefix, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, customIPPrefixName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client CustomIPPrefixesClient) GetPreparer(ctx context.Context, resourceGroupName string, customIPPrefixName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "customIpPrefixName": autorest.Encode("path", customIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client CustomIPPrefixesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client CustomIPPrefixesClient) GetResponder(resp *http.Response) (result CustomIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all custom IP prefixes in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client CustomIPPrefixesClient) List(ctx context.Context, resourceGroupName string) (result CustomIPPrefixListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixesClient.List") - defer func() { - sc := -1 - if result.ciplr.Response.Response != nil { - sc = result.ciplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ciplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "List", resp, "Failure sending request") - return - } - - result.ciplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "List", resp, "Failure responding to request") - return - } - if result.ciplr.hasNextLink() && result.ciplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client CustomIPPrefixesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client CustomIPPrefixesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client CustomIPPrefixesClient) ListResponder(resp *http.Response) (result CustomIPPrefixListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client CustomIPPrefixesClient) listNextResults(ctx context.Context, lastResults CustomIPPrefixListResult) (result CustomIPPrefixListResult, err error) { - req, err := lastResults.customIPPrefixListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CustomIPPrefixesClient) ListComplete(ctx context.Context, resourceGroupName string) (result CustomIPPrefixListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the custom IP prefixes in a subscription. -func (client CustomIPPrefixesClient) ListAll(ctx context.Context) (result CustomIPPrefixListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixesClient.ListAll") - defer func() { - sc := -1 - if result.ciplr.Response.Response != nil { - sc = result.ciplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.ciplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "ListAll", resp, "Failure sending request") - return - } - - result.ciplr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.ciplr.hasNextLink() && result.ciplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client CustomIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/customIpPrefixes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client CustomIPPrefixesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client CustomIPPrefixesClient) ListAllResponder(resp *http.Response) (result CustomIPPrefixListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client CustomIPPrefixesClient) listAllNextResults(ctx context.Context, lastResults CustomIPPrefixListResult) (result CustomIPPrefixListResult, err error) { - req, err := lastResults.customIPPrefixListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client CustomIPPrefixesClient) ListAllComplete(ctx context.Context) (result CustomIPPrefixListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates custom IP prefix tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// customIPPrefixName - the name of the custom IP prefix. -// parameters - parameters supplied to update custom IP prefix tags. -func (client CustomIPPrefixesClient) UpdateTags(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters TagsObject) (result CustomIPPrefix, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, customIPPrefixName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client CustomIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, customIPPrefixName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "customIpPrefixName": autorest.Encode("path", customIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/customIpPrefixes/{customIpPrefixName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client CustomIPPrefixesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client CustomIPPrefixesClient) UpdateTagsResponder(resp *http.Response) (result CustomIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddoscustompolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddoscustompolicies.go deleted file mode 100644 index e253f8e979e9..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddoscustompolicies.go +++ /dev/null @@ -1,348 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DdosCustomPoliciesClient is the network Client -type DdosCustomPoliciesClient struct { - BaseClient -} - -// NewDdosCustomPoliciesClient creates an instance of the DdosCustomPoliciesClient client. -func NewDdosCustomPoliciesClient(subscriptionID string) DdosCustomPoliciesClient { - return NewDdosCustomPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDdosCustomPoliciesClientWithBaseURI creates an instance of the DdosCustomPoliciesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDdosCustomPoliciesClientWithBaseURI(baseURI string, subscriptionID string) DdosCustomPoliciesClient { - return DdosCustomPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a DDoS custom policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosCustomPolicyName - the name of the DDoS custom policy. -// parameters - parameters supplied to the create or update operation. -func (client DdosCustomPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy) (result DdosCustomPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ddosCustomPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DdosCustomPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters DdosCustomPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosCustomPolicyName": autorest.Encode("path", ddosCustomPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DdosCustomPoliciesClient) CreateOrUpdateSender(req *http.Request) (future DdosCustomPoliciesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DdosCustomPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result DdosCustomPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified DDoS custom policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosCustomPolicyName - the name of the DDoS custom policy. -func (client DdosCustomPoliciesClient) Delete(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string) (result DdosCustomPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, ddosCustomPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DdosCustomPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosCustomPolicyName": autorest.Encode("path", ddosCustomPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DdosCustomPoliciesClient) DeleteSender(req *http.Request) (future DdosCustomPoliciesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DdosCustomPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified DDoS custom policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosCustomPolicyName - the name of the DDoS custom policy. -func (client DdosCustomPoliciesClient) Get(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string) (result DdosCustomPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, ddosCustomPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DdosCustomPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosCustomPolicyName": autorest.Encode("path", ddosCustomPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DdosCustomPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DdosCustomPoliciesClient) GetResponder(resp *http.Response) (result DdosCustomPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags update a DDoS custom policy tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosCustomPolicyName - the name of the DDoS custom policy. -// parameters - parameters supplied to update DDoS custom policy resource tags. -func (client DdosCustomPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject) (result DdosCustomPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosCustomPoliciesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, ddosCustomPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client DdosCustomPoliciesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, ddosCustomPolicyName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosCustomPolicyName": autorest.Encode("path", ddosCustomPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosCustomPolicies/{ddosCustomPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client DdosCustomPoliciesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client DdosCustomPoliciesClient) UpdateTagsResponder(resp *http.Response) (result DdosCustomPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddosprotectionplans.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddosprotectionplans.go deleted file mode 100644 index a73299aebf3b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddosprotectionplans.go +++ /dev/null @@ -1,580 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DdosProtectionPlansClient is the network Client -type DdosProtectionPlansClient struct { - BaseClient -} - -// NewDdosProtectionPlansClient creates an instance of the DdosProtectionPlansClient client. -func NewDdosProtectionPlansClient(subscriptionID string) DdosProtectionPlansClient { - return NewDdosProtectionPlansClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDdosProtectionPlansClientWithBaseURI creates an instance of the DdosProtectionPlansClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDdosProtectionPlansClientWithBaseURI(baseURI string, subscriptionID string) DdosProtectionPlansClient { - return DdosProtectionPlansClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a DDoS protection plan. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosProtectionPlanName - the name of the DDoS protection plan. -// parameters - parameters supplied to the create or update operation. -func (client DdosProtectionPlansClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan) (result DdosProtectionPlansCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ddosProtectionPlanName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DdosProtectionPlansClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) CreateOrUpdateSender(req *http.Request) (future DdosProtectionPlansCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) CreateOrUpdateResponder(resp *http.Response) (result DdosProtectionPlan, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified DDoS protection plan. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosProtectionPlanName - the name of the DDoS protection plan. -func (client DdosProtectionPlansClient) Delete(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (result DdosProtectionPlansDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, ddosProtectionPlanName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DdosProtectionPlansClient) DeletePreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) DeleteSender(req *http.Request) (future DdosProtectionPlansDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified DDoS protection plan. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosProtectionPlanName - the name of the DDoS protection plan. -func (client DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (result DdosProtectionPlan, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, ddosProtectionPlanName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DdosProtectionPlansClient) GetPreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) GetResponder(resp *http.Response) (result DdosProtectionPlan, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all DDoS protection plans in a subscription. -func (client DdosProtectionPlansClient) List(ctx context.Context) (result DdosProtectionPlanListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.List") - defer func() { - sc := -1 - if result.dpplr.Response.Response != nil { - sc = result.dpplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dpplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", resp, "Failure sending request") - return - } - - result.dpplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", resp, "Failure responding to request") - return - } - if result.dpplr.hasNextLink() && result.dpplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DdosProtectionPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) ListResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DdosProtectionPlansClient) listNextResults(ctx context.Context, lastResults DdosProtectionPlanListResult) (result DdosProtectionPlanListResult, err error) { - req, err := lastResults.ddosProtectionPlanListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DdosProtectionPlansClient) ListComplete(ctx context.Context) (result DdosProtectionPlanListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all the DDoS protection plans in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DdosProtectionPlansClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DdosProtectionPlanListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dpplr.Response.Response != nil { - sc = result.dpplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dpplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dpplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dpplr.hasNextLink() && result.dpplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DdosProtectionPlansClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) ListByResourceGroupResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DdosProtectionPlansClient) listByResourceGroupNextResults(ctx context.Context, lastResults DdosProtectionPlanListResult) (result DdosProtectionPlanListResult, err error) { - req, err := lastResults.ddosProtectionPlanListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DdosProtectionPlansClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DdosProtectionPlanListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags update a DDoS protection plan tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// ddosProtectionPlanName - the name of the DDoS protection plan. -// parameters - parameters supplied to the update DDoS protection plan resource tags. -func (client DdosProtectionPlansClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject) (result DdosProtectionPlan, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, ddosProtectionPlanName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client DdosProtectionPlansClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client DdosProtectionPlansClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client DdosProtectionPlansClient) UpdateTagsResponder(resp *http.Response) (result DdosProtectionPlan, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/defaultsecurityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/defaultsecurityrules.go deleted file mode 100644 index fa15bacf8df1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/defaultsecurityrules.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DefaultSecurityRulesClient is the network Client -type DefaultSecurityRulesClient struct { - BaseClient -} - -// NewDefaultSecurityRulesClient creates an instance of the DefaultSecurityRulesClient client. -func NewDefaultSecurityRulesClient(subscriptionID string) DefaultSecurityRulesClient { - return NewDefaultSecurityRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDefaultSecurityRulesClientWithBaseURI creates an instance of the DefaultSecurityRulesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDefaultSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) DefaultSecurityRulesClient { - return DefaultSecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get get the specified default network security rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// defaultSecurityRuleName - the name of the default security rule. -func (client DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (result SecurityRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DefaultSecurityRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DefaultSecurityRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "defaultSecurityRuleName": autorest.Encode("path", defaultSecurityRuleName), - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DefaultSecurityRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DefaultSecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all default security rules in a network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -func (client DefaultSecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DefaultSecurityRulesClient.List") - defer func() { - sc := -1 - if result.srlr.Response.Response != nil { - sc = result.srlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.srlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure sending request") - return - } - - result.srlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure responding to request") - return - } - if result.srlr.hasNextLink() && result.srlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DefaultSecurityRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DefaultSecurityRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DefaultSecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DefaultSecurityRulesClient) listNextResults(ctx context.Context, lastResults SecurityRuleListResult) (result SecurityRuleListResult, err error) { - req, err := lastResults.securityRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DefaultSecurityRulesClient) ListComplete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DefaultSecurityRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkSecurityGroupName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/dscpconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/dscpconfiguration.go deleted file mode 100644 index e0c2f52fe98d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/dscpconfiguration.go +++ /dev/null @@ -1,498 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DscpConfigurationClient is the network Client -type DscpConfigurationClient struct { - BaseClient -} - -// NewDscpConfigurationClient creates an instance of the DscpConfigurationClient client. -func NewDscpConfigurationClient(subscriptionID string) DscpConfigurationClient { - return NewDscpConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDscpConfigurationClientWithBaseURI creates an instance of the DscpConfigurationClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDscpConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscpConfigurationClient { - return DscpConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a DSCP Configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// dscpConfigurationName - the name of the resource. -// parameters - parameters supplied to the create or update dscp configuration operation. -func (client DscpConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration) (result DscpConfigurationCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, dscpConfigurationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DscpConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, dscpConfigurationName string, parameters DscpConfiguration) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dscpConfigurationName": autorest.Encode("path", dscpConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DscpConfigurationClient) CreateOrUpdateSender(req *http.Request) (future DscpConfigurationCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DscpConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscpConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a DSCP Configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// dscpConfigurationName - the name of the resource. -func (client DscpConfigurationClient) Delete(ctx context.Context, resourceGroupName string, dscpConfigurationName string) (result DscpConfigurationDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, dscpConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DscpConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, dscpConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dscpConfigurationName": autorest.Encode("path", dscpConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DscpConfigurationClient) DeleteSender(req *http.Request) (future DscpConfigurationDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DscpConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a DSCP Configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// dscpConfigurationName - the name of the resource. -func (client DscpConfigurationClient) Get(ctx context.Context, resourceGroupName string, dscpConfigurationName string) (result DscpConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, dscpConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DscpConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, dscpConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "dscpConfigurationName": autorest.Encode("path", dscpConfigurationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations/{dscpConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DscpConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DscpConfigurationClient) GetResponder(resp *http.Response) (result DscpConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a DSCP Configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DscpConfigurationClient) List(ctx context.Context, resourceGroupName string) (result DscpConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationClient.List") - defer func() { - sc := -1 - if result.dclr.Response.Response != nil { - sc = result.dclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "List", resp, "Failure sending request") - return - } - - result.dclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "List", resp, "Failure responding to request") - return - } - if result.dclr.hasNextLink() && result.dclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DscpConfigurationClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dscpConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DscpConfigurationClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DscpConfigurationClient) ListResponder(resp *http.Response) (result DscpConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DscpConfigurationClient) listNextResults(ctx context.Context, lastResults DscpConfigurationListResult) (result DscpConfigurationListResult, err error) { - req, err := lastResults.dscpConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscpConfigurationClient) ListComplete(ctx context.Context, resourceGroupName string) (result DscpConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all dscp configurations in a subscription. -func (client DscpConfigurationClient) ListAll(ctx context.Context) (result DscpConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationClient.ListAll") - defer func() { - sc := -1 - if result.dclr.Response.Response != nil { - sc = result.dclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.dclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "ListAll", resp, "Failure sending request") - return - } - - result.dclr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "ListAll", resp, "Failure responding to request") - return - } - if result.dclr.hasNextLink() && result.dclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client DscpConfigurationClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/dscpConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client DscpConfigurationClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client DscpConfigurationClient) ListAllResponder(resp *http.Response) (result DscpConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client DscpConfigurationClient) listAllNextResults(ctx context.Context, lastResults DscpConfigurationListResult) (result DscpConfigurationListResult, err error) { - req, err := lastResults.dscpConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client DscpConfigurationClient) ListAllComplete(ctx context.Context) (result DscpConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/enums.go deleted file mode 100644 index f4ea93ba33ac..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/enums.go +++ /dev/null @@ -1,3703 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// Access enumerates the values for access. -type Access string - -const ( - // Allow ... - Allow Access = "Allow" - // Deny ... - Deny Access = "Deny" -) - -// PossibleAccessValues returns an array of possible values for the Access const type. -func PossibleAccessValues() []Access { - return []Access{Allow, Deny} -} - -// ActionType enumerates the values for action type. -type ActionType string - -const ( - // ActionTypeAllow ... - ActionTypeAllow ActionType = "Allow" - // ActionTypeAnomalyScoring ... - ActionTypeAnomalyScoring ActionType = "AnomalyScoring" - // ActionTypeBlock ... - ActionTypeBlock ActionType = "Block" - // ActionTypeLog ... - ActionTypeLog ActionType = "Log" -) - -// PossibleActionTypeValues returns an array of possible values for the ActionType const type. -func PossibleActionTypeValues() []ActionType { - return []ActionType{ActionTypeAllow, ActionTypeAnomalyScoring, ActionTypeBlock, ActionTypeLog} -} - -// AddressPrefixType enumerates the values for address prefix type. -type AddressPrefixType string - -const ( - // IPPrefix ... - IPPrefix AddressPrefixType = "IPPrefix" - // ServiceTag ... - ServiceTag AddressPrefixType = "ServiceTag" -) - -// PossibleAddressPrefixTypeValues returns an array of possible values for the AddressPrefixType const type. -func PossibleAddressPrefixTypeValues() []AddressPrefixType { - return []AddressPrefixType{IPPrefix, ServiceTag} -} - -// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health -// server health. -type ApplicationGatewayBackendHealthServerHealth string - -const ( - // Down ... - Down ApplicationGatewayBackendHealthServerHealth = "Down" - // Draining ... - Draining ApplicationGatewayBackendHealthServerHealth = "Draining" - // Partial ... - Partial ApplicationGatewayBackendHealthServerHealth = "Partial" - // Unknown ... - Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - // Up ... - Up ApplicationGatewayBackendHealthServerHealth = "Up" -) - -// PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. -func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { - return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} -} - -// ApplicationGatewayClientRevocationOptions enumerates the values for application gateway client revocation -// options. -type ApplicationGatewayClientRevocationOptions string - -const ( - // None ... - None ApplicationGatewayClientRevocationOptions = "None" - // OCSP ... - OCSP ApplicationGatewayClientRevocationOptions = "OCSP" -) - -// PossibleApplicationGatewayClientRevocationOptionsValues returns an array of possible values for the ApplicationGatewayClientRevocationOptions const type. -func PossibleApplicationGatewayClientRevocationOptionsValues() []ApplicationGatewayClientRevocationOptions { - return []ApplicationGatewayClientRevocationOptions{None, OCSP} -} - -// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. -type ApplicationGatewayCookieBasedAffinity string - -const ( - // Disabled ... - Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" - // Enabled ... - Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -// PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. -func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { - return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} -} - -// ApplicationGatewayCustomErrorStatusCode enumerates the values for application gateway custom error status -// code. -type ApplicationGatewayCustomErrorStatusCode string - -const ( - // HTTPStatus403 ... - HTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" - // HTTPStatus502 ... - HTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" -) - -// PossibleApplicationGatewayCustomErrorStatusCodeValues returns an array of possible values for the ApplicationGatewayCustomErrorStatusCode const type. -func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { - return []ApplicationGatewayCustomErrorStatusCode{HTTPStatus403, HTTPStatus502} -} - -// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. -type ApplicationGatewayFirewallMode string - -const ( - // Detection ... - Detection ApplicationGatewayFirewallMode = "Detection" - // Prevention ... - Prevention ApplicationGatewayFirewallMode = "Prevention" -) - -// PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. -func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { - return []ApplicationGatewayFirewallMode{Detection, Prevention} -} - -// ApplicationGatewayLoadDistributionAlgorithm enumerates the values for application gateway load distribution -// algorithm. -type ApplicationGatewayLoadDistributionAlgorithm string - -const ( - // IPHash ... - IPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - // LeastConnections ... - LeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - // RoundRobin ... - RoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" -) - -// PossibleApplicationGatewayLoadDistributionAlgorithmValues returns an array of possible values for the ApplicationGatewayLoadDistributionAlgorithm const type. -func PossibleApplicationGatewayLoadDistributionAlgorithmValues() []ApplicationGatewayLoadDistributionAlgorithm { - return []ApplicationGatewayLoadDistributionAlgorithm{IPHash, LeastConnections, RoundRobin} -} - -// ApplicationGatewayOperationalState enumerates the values for application gateway operational state. -type ApplicationGatewayOperationalState string - -const ( - // Running ... - Running ApplicationGatewayOperationalState = "Running" - // Starting ... - Starting ApplicationGatewayOperationalState = "Starting" - // Stopped ... - Stopped ApplicationGatewayOperationalState = "Stopped" - // Stopping ... - Stopping ApplicationGatewayOperationalState = "Stopping" -) - -// PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. -func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { - return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} -} - -// ApplicationGatewayProtocol enumerates the values for application gateway protocol. -type ApplicationGatewayProtocol string - -const ( - // HTTP ... - HTTP ApplicationGatewayProtocol = "Http" - // HTTPS ... - HTTPS ApplicationGatewayProtocol = "Https" - // TCP ... - TCP ApplicationGatewayProtocol = "Tcp" - // TLS ... - TLS ApplicationGatewayProtocol = "Tls" -) - -// PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. -func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { - return []ApplicationGatewayProtocol{HTTP, HTTPS, TCP, TLS} -} - -// ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. -type ApplicationGatewayRedirectType string - -const ( - // Found ... - Found ApplicationGatewayRedirectType = "Found" - // Permanent ... - Permanent ApplicationGatewayRedirectType = "Permanent" - // SeeOther ... - SeeOther ApplicationGatewayRedirectType = "SeeOther" - // Temporary ... - Temporary ApplicationGatewayRedirectType = "Temporary" -) - -// PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. -func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { - return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} -} - -// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule -// type. -type ApplicationGatewayRequestRoutingRuleType string - -const ( - // Basic ... - Basic ApplicationGatewayRequestRoutingRuleType = "Basic" - // PathBasedRouting ... - PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. -func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { - return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} -} - -// ApplicationGatewayRuleSetStatusOptions enumerates the values for application gateway rule set status -// options. -type ApplicationGatewayRuleSetStatusOptions string - -const ( - // Deprecated ... - Deprecated ApplicationGatewayRuleSetStatusOptions = "Deprecated" - // GA ... - GA ApplicationGatewayRuleSetStatusOptions = "GA" - // Preview ... - Preview ApplicationGatewayRuleSetStatusOptions = "Preview" - // Supported ... - Supported ApplicationGatewayRuleSetStatusOptions = "Supported" -) - -// PossibleApplicationGatewayRuleSetStatusOptionsValues returns an array of possible values for the ApplicationGatewayRuleSetStatusOptions const type. -func PossibleApplicationGatewayRuleSetStatusOptionsValues() []ApplicationGatewayRuleSetStatusOptions { - return []ApplicationGatewayRuleSetStatusOptions{Deprecated, GA, Preview, Supported} -} - -// ApplicationGatewaySkuName enumerates the values for application gateway sku name. -type ApplicationGatewaySkuName string - -const ( - // StandardBasic ... - StandardBasic ApplicationGatewaySkuName = "Standard_Basic" - // StandardLarge ... - StandardLarge ApplicationGatewaySkuName = "Standard_Large" - // StandardMedium ... - StandardMedium ApplicationGatewaySkuName = "Standard_Medium" - // StandardSmall ... - StandardSmall ApplicationGatewaySkuName = "Standard_Small" - // StandardV2 ... - StandardV2 ApplicationGatewaySkuName = "Standard_v2" - // WAFLarge ... - WAFLarge ApplicationGatewaySkuName = "WAF_Large" - // WAFMedium ... - WAFMedium ApplicationGatewaySkuName = "WAF_Medium" - // WAFV2 ... - WAFV2 ApplicationGatewaySkuName = "WAF_v2" -) - -// PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. -func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { - return []ApplicationGatewaySkuName{StandardBasic, StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} -} - -// ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. -type ApplicationGatewaySslCipherSuite string - -const ( - // TLSDHEDSSWITH3DESEDECBCSHA ... - TLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA ... - TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - // TLSDHEDSSWITHAES128CBCSHA256 ... - TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - // TLSDHEDSSWITHAES256CBCSHA ... - TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - // TLSDHEDSSWITHAES256CBCSHA256 ... - TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - // TLSDHERSAWITHAES128CBCSHA ... - TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - // TLSDHERSAWITHAES128GCMSHA256 ... - TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSDHERSAWITHAES256CBCSHA ... - TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - // TLSDHERSAWITHAES256GCMSHA384 ... - TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSECDHEECDSAWITHAES128CBCSHA ... - TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - // TLSECDHEECDSAWITHAES128CBCSHA256 ... - TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - // TLSECDHEECDSAWITHAES128GCMSHA256 ... - TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - // TLSECDHEECDSAWITHAES256CBCSHA ... - TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - // TLSECDHEECDSAWITHAES256CBCSHA384 ... - TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - // TLSECDHEECDSAWITHAES256GCMSHA384 ... - TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - // TLSECDHERSAWITHAES128CBCSHA ... - TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - // TLSECDHERSAWITHAES128CBCSHA256 ... - TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - // TLSECDHERSAWITHAES128GCMSHA256 ... - TLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - // TLSECDHERSAWITHAES256CBCSHA ... - TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - // TLSECDHERSAWITHAES256CBCSHA384 ... - TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - // TLSECDHERSAWITHAES256GCMSHA384 ... - TLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - // TLSRSAWITH3DESEDECBCSHA ... - TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - // TLSRSAWITHAES128CBCSHA ... - TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - // TLSRSAWITHAES128CBCSHA256 ... - TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - // TLSRSAWITHAES128GCMSHA256 ... - TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - // TLSRSAWITHAES256CBCSHA ... - TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - // TLSRSAWITHAES256CBCSHA256 ... - TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - // TLSRSAWITHAES256GCMSHA384 ... - TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" -) - -// PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. -func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { - return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITH3DESEDECBCSHA, TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES128GCMSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSECDHERSAWITHAES256GCMSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} -} - -// ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. -type ApplicationGatewaySslPolicyName string - -const ( - // AppGwSslPolicy20150501 ... - AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - // AppGwSslPolicy20170401 ... - AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - // AppGwSslPolicy20170401S ... - AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" - // AppGwSslPolicy20220101 ... - AppGwSslPolicy20220101 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" - // AppGwSslPolicy20220101S ... - AppGwSslPolicy20220101S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" -) - -// PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. -func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { - return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S, AppGwSslPolicy20220101, AppGwSslPolicy20220101S} -} - -// ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. -type ApplicationGatewaySslPolicyType string - -const ( - // Custom ... - Custom ApplicationGatewaySslPolicyType = "Custom" - // CustomV2 ... - CustomV2 ApplicationGatewaySslPolicyType = "CustomV2" - // Predefined ... - Predefined ApplicationGatewaySslPolicyType = "Predefined" -) - -// PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. -func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { - return []ApplicationGatewaySslPolicyType{Custom, CustomV2, Predefined} -} - -// ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. -type ApplicationGatewaySslProtocol string - -const ( - // TLSv10 ... - TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" - // TLSv11 ... - TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" - // TLSv12 ... - TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" - // TLSv13 ... - TLSv13 ApplicationGatewaySslProtocol = "TLSv1_3" -) - -// PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. -func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { - return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12, TLSv13} -} - -// ApplicationGatewayTier enumerates the values for application gateway tier. -type ApplicationGatewayTier string - -const ( - // ApplicationGatewayTierStandard ... - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - // ApplicationGatewayTierStandardBasic ... - ApplicationGatewayTierStandardBasic ApplicationGatewayTier = "Standard_Basic" - // ApplicationGatewayTierStandardV2 ... - ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" - // ApplicationGatewayTierWAF ... - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - // ApplicationGatewayTierWAFV2 ... - ApplicationGatewayTierWAFV2 ApplicationGatewayTier = "WAF_v2" -) - -// PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. -func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { - return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardBasic, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} -} - -// ApplicationGatewayTierTypes enumerates the values for application gateway tier types. -type ApplicationGatewayTierTypes string - -const ( - // ApplicationGatewayTierTypesStandard ... - ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" - // ApplicationGatewayTierTypesStandardV2 ... - ApplicationGatewayTierTypesStandardV2 ApplicationGatewayTierTypes = "Standard_v2" - // ApplicationGatewayTierTypesWAF ... - ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" - // ApplicationGatewayTierTypesWAFV2 ... - ApplicationGatewayTierTypesWAFV2 ApplicationGatewayTierTypes = "WAF_v2" -) - -// PossibleApplicationGatewayTierTypesValues returns an array of possible values for the ApplicationGatewayTierTypes const type. -func PossibleApplicationGatewayTierTypesValues() []ApplicationGatewayTierTypes { - return []ApplicationGatewayTierTypes{ApplicationGatewayTierTypesStandard, ApplicationGatewayTierTypesStandardV2, ApplicationGatewayTierTypesWAF, ApplicationGatewayTierTypesWAFV2} -} - -// ApplicationGatewayWafRuleActionTypes enumerates the values for application gateway waf rule action types. -type ApplicationGatewayWafRuleActionTypes string - -const ( - // ApplicationGatewayWafRuleActionTypesAllow ... - ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" - // ApplicationGatewayWafRuleActionTypesAnomalyScoring ... - ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" - // ApplicationGatewayWafRuleActionTypesBlock ... - ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" - // ApplicationGatewayWafRuleActionTypesLog ... - ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" - // ApplicationGatewayWafRuleActionTypesNone ... - ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" -) - -// PossibleApplicationGatewayWafRuleActionTypesValues returns an array of possible values for the ApplicationGatewayWafRuleActionTypes const type. -func PossibleApplicationGatewayWafRuleActionTypesValues() []ApplicationGatewayWafRuleActionTypes { - return []ApplicationGatewayWafRuleActionTypes{ApplicationGatewayWafRuleActionTypesAllow, ApplicationGatewayWafRuleActionTypesAnomalyScoring, ApplicationGatewayWafRuleActionTypesBlock, ApplicationGatewayWafRuleActionTypesLog, ApplicationGatewayWafRuleActionTypesNone} -} - -// ApplicationGatewayWafRuleStateTypes enumerates the values for application gateway waf rule state types. -type ApplicationGatewayWafRuleStateTypes string - -const ( - // ApplicationGatewayWafRuleStateTypesDisabled ... - ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" - // ApplicationGatewayWafRuleStateTypesEnabled ... - ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" -) - -// PossibleApplicationGatewayWafRuleStateTypesValues returns an array of possible values for the ApplicationGatewayWafRuleStateTypes const type. -func PossibleApplicationGatewayWafRuleStateTypesValues() []ApplicationGatewayWafRuleStateTypes { - return []ApplicationGatewayWafRuleStateTypes{ApplicationGatewayWafRuleStateTypesDisabled, ApplicationGatewayWafRuleStateTypesEnabled} -} - -// AssociationType enumerates the values for association type. -type AssociationType string - -const ( - // Associated ... - Associated AssociationType = "Associated" - // Contains ... - Contains AssociationType = "Contains" -) - -// PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. -func PossibleAssociationTypeValues() []AssociationType { - return []AssociationType{Associated, Contains} -} - -// AuthenticationMethod enumerates the values for authentication method. -type AuthenticationMethod string - -const ( - // EAPMSCHAPv2 ... - EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" - // EAPTLS ... - EAPTLS AuthenticationMethod = "EAPTLS" -) - -// PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. -func PossibleAuthenticationMethodValues() []AuthenticationMethod { - return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} -} - -// AuthorizationUseStatus enumerates the values for authorization use status. -type AuthorizationUseStatus string - -const ( - // Available ... - Available AuthorizationUseStatus = "Available" - // InUse ... - InUse AuthorizationUseStatus = "InUse" -) - -// PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. -func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { - return []AuthorizationUseStatus{Available, InUse} -} - -// AutoLearnPrivateRangesMode enumerates the values for auto learn private ranges mode. -type AutoLearnPrivateRangesMode string - -const ( - // AutoLearnPrivateRangesModeDisabled ... - AutoLearnPrivateRangesModeDisabled AutoLearnPrivateRangesMode = "Disabled" - // AutoLearnPrivateRangesModeEnabled ... - AutoLearnPrivateRangesModeEnabled AutoLearnPrivateRangesMode = "Enabled" -) - -// PossibleAutoLearnPrivateRangesModeValues returns an array of possible values for the AutoLearnPrivateRangesMode const type. -func PossibleAutoLearnPrivateRangesModeValues() []AutoLearnPrivateRangesMode { - return []AutoLearnPrivateRangesMode{AutoLearnPrivateRangesModeDisabled, AutoLearnPrivateRangesModeEnabled} -} - -// AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol -// type. -type AzureFirewallApplicationRuleProtocolType string - -const ( - // AzureFirewallApplicationRuleProtocolTypeHTTP ... - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" - // AzureFirewallApplicationRuleProtocolTypeHTTPS ... - AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" - // AzureFirewallApplicationRuleProtocolTypeMssql ... - AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" -) - -// PossibleAzureFirewallApplicationRuleProtocolTypeValues returns an array of possible values for the AzureFirewallApplicationRuleProtocolType const type. -func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApplicationRuleProtocolType { - return []AzureFirewallApplicationRuleProtocolType{AzureFirewallApplicationRuleProtocolTypeHTTP, AzureFirewallApplicationRuleProtocolTypeHTTPS, AzureFirewallApplicationRuleProtocolTypeMssql} -} - -// AzureFirewallNatRCActionType enumerates the values for azure firewall nat rc action type. -type AzureFirewallNatRCActionType string - -const ( - // Dnat ... - Dnat AzureFirewallNatRCActionType = "Dnat" - // Snat ... - Snat AzureFirewallNatRCActionType = "Snat" -) - -// PossibleAzureFirewallNatRCActionTypeValues returns an array of possible values for the AzureFirewallNatRCActionType const type. -func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { - return []AzureFirewallNatRCActionType{Dnat, Snat} -} - -// AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. -type AzureFirewallNetworkRuleProtocol string - -const ( - // AzureFirewallNetworkRuleProtocolAny ... - AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" - // AzureFirewallNetworkRuleProtocolICMP ... - AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" - // AzureFirewallNetworkRuleProtocolTCP ... - AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" - // AzureFirewallNetworkRuleProtocolUDP ... - AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" -) - -// PossibleAzureFirewallNetworkRuleProtocolValues returns an array of possible values for the AzureFirewallNetworkRuleProtocol const type. -func PossibleAzureFirewallNetworkRuleProtocolValues() []AzureFirewallNetworkRuleProtocol { - return []AzureFirewallNetworkRuleProtocol{AzureFirewallNetworkRuleProtocolAny, AzureFirewallNetworkRuleProtocolICMP, AzureFirewallNetworkRuleProtocolTCP, AzureFirewallNetworkRuleProtocolUDP} -} - -// AzureFirewallRCActionType enumerates the values for azure firewall rc action type. -type AzureFirewallRCActionType string - -const ( - // AzureFirewallRCActionTypeAllow ... - AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - // AzureFirewallRCActionTypeDeny ... - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" -) - -// PossibleAzureFirewallRCActionTypeValues returns an array of possible values for the AzureFirewallRCActionType const type. -func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { - return []AzureFirewallRCActionType{AzureFirewallRCActionTypeAllow, AzureFirewallRCActionTypeDeny} -} - -// AzureFirewallSkuName enumerates the values for azure firewall sku name. -type AzureFirewallSkuName string - -const ( - // AZFWHub ... - AZFWHub AzureFirewallSkuName = "AZFW_Hub" - // AZFWVNet ... - AZFWVNet AzureFirewallSkuName = "AZFW_VNet" -) - -// PossibleAzureFirewallSkuNameValues returns an array of possible values for the AzureFirewallSkuName const type. -func PossibleAzureFirewallSkuNameValues() []AzureFirewallSkuName { - return []AzureFirewallSkuName{AZFWHub, AZFWVNet} -} - -// AzureFirewallSkuTier enumerates the values for azure firewall sku tier. -type AzureFirewallSkuTier string - -const ( - // AzureFirewallSkuTierBasic ... - AzureFirewallSkuTierBasic AzureFirewallSkuTier = "Basic" - // AzureFirewallSkuTierPremium ... - AzureFirewallSkuTierPremium AzureFirewallSkuTier = "Premium" - // AzureFirewallSkuTierStandard ... - AzureFirewallSkuTierStandard AzureFirewallSkuTier = "Standard" -) - -// PossibleAzureFirewallSkuTierValues returns an array of possible values for the AzureFirewallSkuTier const type. -func PossibleAzureFirewallSkuTierValues() []AzureFirewallSkuTier { - return []AzureFirewallSkuTier{AzureFirewallSkuTierBasic, AzureFirewallSkuTierPremium, AzureFirewallSkuTierStandard} -} - -// AzureFirewallThreatIntelMode enumerates the values for azure firewall threat intel mode. -type AzureFirewallThreatIntelMode string - -const ( - // AzureFirewallThreatIntelModeAlert ... - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - // AzureFirewallThreatIntelModeDeny ... - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - // AzureFirewallThreatIntelModeOff ... - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -// PossibleAzureFirewallThreatIntelModeValues returns an array of possible values for the AzureFirewallThreatIntelMode const type. -func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode { - return []AzureFirewallThreatIntelMode{AzureFirewallThreatIntelModeAlert, AzureFirewallThreatIntelModeDeny, AzureFirewallThreatIntelModeOff} -} - -// BastionConnectProtocol enumerates the values for bastion connect protocol. -type BastionConnectProtocol string - -const ( - // RDP ... - RDP BastionConnectProtocol = "RDP" - // SSH ... - SSH BastionConnectProtocol = "SSH" -) - -// PossibleBastionConnectProtocolValues returns an array of possible values for the BastionConnectProtocol const type. -func PossibleBastionConnectProtocolValues() []BastionConnectProtocol { - return []BastionConnectProtocol{RDP, SSH} -} - -// BastionHostSkuName enumerates the values for bastion host sku name. -type BastionHostSkuName string - -const ( - // BastionHostSkuNameBasic ... - BastionHostSkuNameBasic BastionHostSkuName = "Basic" - // BastionHostSkuNameStandard ... - BastionHostSkuNameStandard BastionHostSkuName = "Standard" -) - -// PossibleBastionHostSkuNameValues returns an array of possible values for the BastionHostSkuName const type. -func PossibleBastionHostSkuNameValues() []BastionHostSkuName { - return []BastionHostSkuName{BastionHostSkuNameBasic, BastionHostSkuNameStandard} -} - -// BgpPeerState enumerates the values for bgp peer state. -type BgpPeerState string - -const ( - // BgpPeerStateConnected ... - BgpPeerStateConnected BgpPeerState = "Connected" - // BgpPeerStateConnecting ... - BgpPeerStateConnecting BgpPeerState = "Connecting" - // BgpPeerStateIdle ... - BgpPeerStateIdle BgpPeerState = "Idle" - // BgpPeerStateStopped ... - BgpPeerStateStopped BgpPeerState = "Stopped" - // BgpPeerStateUnknown ... - BgpPeerStateUnknown BgpPeerState = "Unknown" -) - -// PossibleBgpPeerStateValues returns an array of possible values for the BgpPeerState const type. -func PossibleBgpPeerStateValues() []BgpPeerState { - return []BgpPeerState{BgpPeerStateConnected, BgpPeerStateConnecting, BgpPeerStateIdle, BgpPeerStateStopped, BgpPeerStateUnknown} -} - -// CircuitConnectionStatus enumerates the values for circuit connection status. -type CircuitConnectionStatus string - -const ( - // Connected ... - Connected CircuitConnectionStatus = "Connected" - // Connecting ... - Connecting CircuitConnectionStatus = "Connecting" - // Disconnected ... - Disconnected CircuitConnectionStatus = "Disconnected" -) - -// PossibleCircuitConnectionStatusValues returns an array of possible values for the CircuitConnectionStatus const type. -func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { - return []CircuitConnectionStatus{Connected, Connecting, Disconnected} -} - -// CommissionedState enumerates the values for commissioned state. -type CommissionedState string - -const ( - // Commissioned ... - Commissioned CommissionedState = "Commissioned" - // CommissionedNoInternetAdvertise ... - CommissionedNoInternetAdvertise CommissionedState = "CommissionedNoInternetAdvertise" - // Commissioning ... - Commissioning CommissionedState = "Commissioning" - // Decommissioning ... - Decommissioning CommissionedState = "Decommissioning" - // Deprovisioned ... - Deprovisioned CommissionedState = "Deprovisioned" - // Deprovisioning ... - Deprovisioning CommissionedState = "Deprovisioning" - // Provisioned ... - Provisioned CommissionedState = "Provisioned" - // Provisioning ... - Provisioning CommissionedState = "Provisioning" -) - -// PossibleCommissionedStateValues returns an array of possible values for the CommissionedState const type. -func PossibleCommissionedStateValues() []CommissionedState { - return []CommissionedState{Commissioned, CommissionedNoInternetAdvertise, Commissioning, Decommissioning, Deprovisioned, Deprovisioning, Provisioned, Provisioning} -} - -// ConfigurationType enumerates the values for configuration type. -type ConfigurationType string - -const ( - // Connectivity ... - Connectivity ConfigurationType = "Connectivity" - // SecurityAdmin ... - SecurityAdmin ConfigurationType = "SecurityAdmin" -) - -// PossibleConfigurationTypeValues returns an array of possible values for the ConfigurationType const type. -func PossibleConfigurationTypeValues() []ConfigurationType { - return []ConfigurationType{Connectivity, SecurityAdmin} -} - -// ConnectionMonitorEndpointFilterItemType enumerates the values for connection monitor endpoint filter item -// type. -type ConnectionMonitorEndpointFilterItemType string - -const ( - // AgentAddress ... - AgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" -) - -// PossibleConnectionMonitorEndpointFilterItemTypeValues returns an array of possible values for the ConnectionMonitorEndpointFilterItemType const type. -func PossibleConnectionMonitorEndpointFilterItemTypeValues() []ConnectionMonitorEndpointFilterItemType { - return []ConnectionMonitorEndpointFilterItemType{AgentAddress} -} - -// ConnectionMonitorEndpointFilterType enumerates the values for connection monitor endpoint filter type. -type ConnectionMonitorEndpointFilterType string - -const ( - // Include ... - Include ConnectionMonitorEndpointFilterType = "Include" -) - -// PossibleConnectionMonitorEndpointFilterTypeValues returns an array of possible values for the ConnectionMonitorEndpointFilterType const type. -func PossibleConnectionMonitorEndpointFilterTypeValues() []ConnectionMonitorEndpointFilterType { - return []ConnectionMonitorEndpointFilterType{Include} -} - -// ConnectionMonitorSourceStatus enumerates the values for connection monitor source status. -type ConnectionMonitorSourceStatus string - -const ( - // ConnectionMonitorSourceStatusActive ... - ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" - // ConnectionMonitorSourceStatusInactive ... - ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" - // ConnectionMonitorSourceStatusUnknown ... - ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" -) - -// PossibleConnectionMonitorSourceStatusValues returns an array of possible values for the ConnectionMonitorSourceStatus const type. -func PossibleConnectionMonitorSourceStatusValues() []ConnectionMonitorSourceStatus { - return []ConnectionMonitorSourceStatus{ConnectionMonitorSourceStatusActive, ConnectionMonitorSourceStatusInactive, ConnectionMonitorSourceStatusUnknown} -} - -// ConnectionMonitorTestConfigurationProtocol enumerates the values for connection monitor test configuration -// protocol. -type ConnectionMonitorTestConfigurationProtocol string - -const ( - // ConnectionMonitorTestConfigurationProtocolHTTP ... - ConnectionMonitorTestConfigurationProtocolHTTP ConnectionMonitorTestConfigurationProtocol = "Http" - // ConnectionMonitorTestConfigurationProtocolIcmp ... - ConnectionMonitorTestConfigurationProtocolIcmp ConnectionMonitorTestConfigurationProtocol = "Icmp" - // ConnectionMonitorTestConfigurationProtocolTCP ... - ConnectionMonitorTestConfigurationProtocolTCP ConnectionMonitorTestConfigurationProtocol = "Tcp" -) - -// PossibleConnectionMonitorTestConfigurationProtocolValues returns an array of possible values for the ConnectionMonitorTestConfigurationProtocol const type. -func PossibleConnectionMonitorTestConfigurationProtocolValues() []ConnectionMonitorTestConfigurationProtocol { - return []ConnectionMonitorTestConfigurationProtocol{ConnectionMonitorTestConfigurationProtocolHTTP, ConnectionMonitorTestConfigurationProtocolIcmp, ConnectionMonitorTestConfigurationProtocolTCP} -} - -// ConnectionMonitorType enumerates the values for connection monitor type. -type ConnectionMonitorType string - -const ( - // MultiEndpoint ... - MultiEndpoint ConnectionMonitorType = "MultiEndpoint" - // SingleSourceDestination ... - SingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" -) - -// PossibleConnectionMonitorTypeValues returns an array of possible values for the ConnectionMonitorType const type. -func PossibleConnectionMonitorTypeValues() []ConnectionMonitorType { - return []ConnectionMonitorType{MultiEndpoint, SingleSourceDestination} -} - -// ConnectionState enumerates the values for connection state. -type ConnectionState string - -const ( - // ConnectionStateReachable ... - ConnectionStateReachable ConnectionState = "Reachable" - // ConnectionStateUnknown ... - ConnectionStateUnknown ConnectionState = "Unknown" - // ConnectionStateUnreachable ... - ConnectionStateUnreachable ConnectionState = "Unreachable" -) - -// PossibleConnectionStateValues returns an array of possible values for the ConnectionState const type. -func PossibleConnectionStateValues() []ConnectionState { - return []ConnectionState{ConnectionStateReachable, ConnectionStateUnknown, ConnectionStateUnreachable} -} - -// ConnectionStatus enumerates the values for connection status. -type ConnectionStatus string - -const ( - // ConnectionStatusConnected ... - ConnectionStatusConnected ConnectionStatus = "Connected" - // ConnectionStatusDegraded ... - ConnectionStatusDegraded ConnectionStatus = "Degraded" - // ConnectionStatusDisconnected ... - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - // ConnectionStatusUnknown ... - ConnectionStatusUnknown ConnectionStatus = "Unknown" -) - -// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. -func PossibleConnectionStatusValues() []ConnectionStatus { - return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} -} - -// ConnectivityTopology enumerates the values for connectivity topology. -type ConnectivityTopology string - -const ( - // HubAndSpoke ... - HubAndSpoke ConnectivityTopology = "HubAndSpoke" - // Mesh ... - Mesh ConnectivityTopology = "Mesh" -) - -// PossibleConnectivityTopologyValues returns an array of possible values for the ConnectivityTopology const type. -func PossibleConnectivityTopologyValues() []ConnectivityTopology { - return []ConnectivityTopology{HubAndSpoke, Mesh} -} - -// CoverageLevel enumerates the values for coverage level. -type CoverageLevel string - -const ( - // AboveAverage ... - AboveAverage CoverageLevel = "AboveAverage" - // Average ... - Average CoverageLevel = "Average" - // BelowAverage ... - BelowAverage CoverageLevel = "BelowAverage" - // Default ... - Default CoverageLevel = "Default" - // Full ... - Full CoverageLevel = "Full" - // Low ... - Low CoverageLevel = "Low" -) - -// PossibleCoverageLevelValues returns an array of possible values for the CoverageLevel const type. -func PossibleCoverageLevelValues() []CoverageLevel { - return []CoverageLevel{AboveAverage, Average, BelowAverage, Default, Full, Low} -} - -// CreatedByType enumerates the values for created by type. -type CreatedByType string - -const ( - // Application ... - Application CreatedByType = "Application" - // Key ... - Key CreatedByType = "Key" - // ManagedIdentity ... - ManagedIdentity CreatedByType = "ManagedIdentity" - // User ... - User CreatedByType = "User" -) - -// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. -func PossibleCreatedByTypeValues() []CreatedByType { - return []CreatedByType{Application, Key, ManagedIdentity, User} -} - -// CustomIPPrefixType enumerates the values for custom ip prefix type. -type CustomIPPrefixType string - -const ( - // Child ... - Child CustomIPPrefixType = "Child" - // Parent ... - Parent CustomIPPrefixType = "Parent" - // Singular ... - Singular CustomIPPrefixType = "Singular" -) - -// PossibleCustomIPPrefixTypeValues returns an array of possible values for the CustomIPPrefixType const type. -func PossibleCustomIPPrefixTypeValues() []CustomIPPrefixType { - return []CustomIPPrefixType{Child, Parent, Singular} -} - -// DdosSettingsProtectionMode enumerates the values for ddos settings protection mode. -type DdosSettingsProtectionMode string - -const ( - // DdosSettingsProtectionModeDisabled ... - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - // DdosSettingsProtectionModeEnabled ... - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - // DdosSettingsProtectionModeVirtualNetworkInherited ... - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -// PossibleDdosSettingsProtectionModeValues returns an array of possible values for the DdosSettingsProtectionMode const type. -func PossibleDdosSettingsProtectionModeValues() []DdosSettingsProtectionMode { - return []DdosSettingsProtectionMode{DdosSettingsProtectionModeDisabled, DdosSettingsProtectionModeEnabled, DdosSettingsProtectionModeVirtualNetworkInherited} -} - -// DeleteExistingPeering enumerates the values for delete existing peering. -type DeleteExistingPeering string - -const ( - // False ... - False DeleteExistingPeering = "False" - // True ... - True DeleteExistingPeering = "True" -) - -// PossibleDeleteExistingPeeringValues returns an array of possible values for the DeleteExistingPeering const type. -func PossibleDeleteExistingPeeringValues() []DeleteExistingPeering { - return []DeleteExistingPeering{False, True} -} - -// DeleteOptions enumerates the values for delete options. -type DeleteOptions string - -const ( - // Delete ... - Delete DeleteOptions = "Delete" - // Detach ... - Detach DeleteOptions = "Detach" -) - -// PossibleDeleteOptionsValues returns an array of possible values for the DeleteOptions const type. -func PossibleDeleteOptionsValues() []DeleteOptions { - return []DeleteOptions{Delete, Detach} -} - -// DeploymentStatus enumerates the values for deployment status. -type DeploymentStatus string - -const ( - // Deployed ... - Deployed DeploymentStatus = "Deployed" - // Deploying ... - Deploying DeploymentStatus = "Deploying" - // Failed ... - Failed DeploymentStatus = "Failed" - // NotStarted ... - NotStarted DeploymentStatus = "NotStarted" -) - -// PossibleDeploymentStatusValues returns an array of possible values for the DeploymentStatus const type. -func PossibleDeploymentStatusValues() []DeploymentStatus { - return []DeploymentStatus{Deployed, Deploying, Failed, NotStarted} -} - -// DestinationPortBehavior enumerates the values for destination port behavior. -type DestinationPortBehavior string - -const ( - // DestinationPortBehaviorListenIfAvailable ... - DestinationPortBehaviorListenIfAvailable DestinationPortBehavior = "ListenIfAvailable" - // DestinationPortBehaviorNone ... - DestinationPortBehaviorNone DestinationPortBehavior = "None" -) - -// PossibleDestinationPortBehaviorValues returns an array of possible values for the DestinationPortBehavior const type. -func PossibleDestinationPortBehaviorValues() []DestinationPortBehavior { - return []DestinationPortBehavior{DestinationPortBehaviorListenIfAvailable, DestinationPortBehaviorNone} -} - -// DhGroup enumerates the values for dh group. -type DhGroup string - -const ( - // DhGroupDHGroup1 ... - DhGroupDHGroup1 DhGroup = "DHGroup1" - // DhGroupDHGroup14 ... - DhGroupDHGroup14 DhGroup = "DHGroup14" - // DhGroupDHGroup2 ... - DhGroupDHGroup2 DhGroup = "DHGroup2" - // DhGroupDHGroup2048 ... - DhGroupDHGroup2048 DhGroup = "DHGroup2048" - // DhGroupDHGroup24 ... - DhGroupDHGroup24 DhGroup = "DHGroup24" - // DhGroupECP256 ... - DhGroupECP256 DhGroup = "ECP256" - // DhGroupECP384 ... - DhGroupECP384 DhGroup = "ECP384" - // DhGroupNone ... - DhGroupNone DhGroup = "None" -) - -// PossibleDhGroupValues returns an array of possible values for the DhGroup const type. -func PossibleDhGroupValues() []DhGroup { - return []DhGroup{DhGroupDHGroup1, DhGroupDHGroup14, DhGroupDHGroup2, DhGroupDHGroup2048, DhGroupDHGroup24, DhGroupECP256, DhGroupECP384, DhGroupNone} -} - -// Direction enumerates the values for direction. -type Direction string - -const ( - // Inbound ... - Inbound Direction = "Inbound" - // Outbound ... - Outbound Direction = "Outbound" -) - -// PossibleDirectionValues returns an array of possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{Inbound, Outbound} -} - -// EffectiveRouteSource enumerates the values for effective route source. -type EffectiveRouteSource string - -const ( - // EffectiveRouteSourceDefault ... - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - // EffectiveRouteSourceUnknown ... - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - // EffectiveRouteSourceUser ... - EffectiveRouteSourceUser EffectiveRouteSource = "User" - // EffectiveRouteSourceVirtualNetworkGateway ... - EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" -) - -// PossibleEffectiveRouteSourceValues returns an array of possible values for the EffectiveRouteSource const type. -func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { - return []EffectiveRouteSource{EffectiveRouteSourceDefault, EffectiveRouteSourceUnknown, EffectiveRouteSourceUser, EffectiveRouteSourceVirtualNetworkGateway} -} - -// EffectiveRouteState enumerates the values for effective route state. -type EffectiveRouteState string - -const ( - // Active ... - Active EffectiveRouteState = "Active" - // Invalid ... - Invalid EffectiveRouteState = "Invalid" -) - -// PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. -func PossibleEffectiveRouteStateValues() []EffectiveRouteState { - return []EffectiveRouteState{Active, Invalid} -} - -// EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. -type EffectiveSecurityRuleProtocol string - -const ( - // EffectiveSecurityRuleProtocolAll ... - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - // EffectiveSecurityRuleProtocolTCP ... - EffectiveSecurityRuleProtocolTCP EffectiveSecurityRuleProtocol = "Tcp" - // EffectiveSecurityRuleProtocolUDP ... - EffectiveSecurityRuleProtocolUDP EffectiveSecurityRuleProtocol = "Udp" -) - -// PossibleEffectiveSecurityRuleProtocolValues returns an array of possible values for the EffectiveSecurityRuleProtocol const type. -func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtocol { - return []EffectiveSecurityRuleProtocol{EffectiveSecurityRuleProtocolAll, EffectiveSecurityRuleProtocolTCP, EffectiveSecurityRuleProtocolUDP} -} - -// EndpointType enumerates the values for endpoint type. -type EndpointType string - -const ( - // AzureArcVM ... - AzureArcVM EndpointType = "AzureArcVM" - // AzureSubnet ... - AzureSubnet EndpointType = "AzureSubnet" - // AzureVM ... - AzureVM EndpointType = "AzureVM" - // AzureVMSS ... - AzureVMSS EndpointType = "AzureVMSS" - // AzureVNet ... - AzureVNet EndpointType = "AzureVNet" - // ExternalAddress ... - ExternalAddress EndpointType = "ExternalAddress" - // MMAWorkspaceMachine ... - MMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" - // MMAWorkspaceNetwork ... - MMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" -) - -// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. -func PossibleEndpointTypeValues() []EndpointType { - return []EndpointType{AzureArcVM, AzureSubnet, AzureVM, AzureVMSS, AzureVNet, ExternalAddress, MMAWorkspaceMachine, MMAWorkspaceNetwork} -} - -// EvaluationState enumerates the values for evaluation state. -type EvaluationState string - -const ( - // EvaluationStateCompleted ... - EvaluationStateCompleted EvaluationState = "Completed" - // EvaluationStateInProgress ... - EvaluationStateInProgress EvaluationState = "InProgress" - // EvaluationStateNotStarted ... - EvaluationStateNotStarted EvaluationState = "NotStarted" -) - -// PossibleEvaluationStateValues returns an array of possible values for the EvaluationState const type. -func PossibleEvaluationStateValues() []EvaluationState { - return []EvaluationState{EvaluationStateCompleted, EvaluationStateInProgress, EvaluationStateNotStarted} -} - -// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit -// peering advertised public prefix state. -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - // Configured ... - Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - // Configuring ... - Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - // NotConfigured ... - NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - // ValidationNeeded ... - ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. -func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { - return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} -} - -// ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. -type ExpressRouteCircuitPeeringState string - -const ( - // ExpressRouteCircuitPeeringStateDisabled ... - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - // ExpressRouteCircuitPeeringStateEnabled ... - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -// PossibleExpressRouteCircuitPeeringStateValues returns an array of possible values for the ExpressRouteCircuitPeeringState const type. -func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { - return []ExpressRouteCircuitPeeringState{ExpressRouteCircuitPeeringStateDisabled, ExpressRouteCircuitPeeringStateEnabled} -} - -// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. -type ExpressRouteCircuitSkuFamily string - -const ( - // MeteredData ... - MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - // UnlimitedData ... - UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" -) - -// PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. -func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { - return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} -} - -// ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. -type ExpressRouteCircuitSkuTier string - -const ( - // ExpressRouteCircuitSkuTierBasic ... - ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" - // ExpressRouteCircuitSkuTierLocal ... - ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" - // ExpressRouteCircuitSkuTierPremium ... - ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" - // ExpressRouteCircuitSkuTierStandard ... - ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" -) - -// PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. -func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { - return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierBasic, ExpressRouteCircuitSkuTierLocal, ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} -} - -// ExpressRouteLinkAdminState enumerates the values for express route link admin state. -type ExpressRouteLinkAdminState string - -const ( - // ExpressRouteLinkAdminStateDisabled ... - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - // ExpressRouteLinkAdminStateEnabled ... - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -// PossibleExpressRouteLinkAdminStateValues returns an array of possible values for the ExpressRouteLinkAdminState const type. -func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { - return []ExpressRouteLinkAdminState{ExpressRouteLinkAdminStateDisabled, ExpressRouteLinkAdminStateEnabled} -} - -// ExpressRouteLinkConnectorType enumerates the values for express route link connector type. -type ExpressRouteLinkConnectorType string - -const ( - // LC ... - LC ExpressRouteLinkConnectorType = "LC" - // SC ... - SC ExpressRouteLinkConnectorType = "SC" -) - -// PossibleExpressRouteLinkConnectorTypeValues returns an array of possible values for the ExpressRouteLinkConnectorType const type. -func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { - return []ExpressRouteLinkConnectorType{LC, SC} -} - -// ExpressRouteLinkMacSecCipher enumerates the values for express route link mac sec cipher. -type ExpressRouteLinkMacSecCipher string - -const ( - // GcmAes128 ... - GcmAes128 ExpressRouteLinkMacSecCipher = "GcmAes128" - // GcmAes256 ... - GcmAes256 ExpressRouteLinkMacSecCipher = "GcmAes256" - // GcmAesXpn128 ... - GcmAesXpn128 ExpressRouteLinkMacSecCipher = "GcmAesXpn128" - // GcmAesXpn256 ... - GcmAesXpn256 ExpressRouteLinkMacSecCipher = "GcmAesXpn256" -) - -// PossibleExpressRouteLinkMacSecCipherValues returns an array of possible values for the ExpressRouteLinkMacSecCipher const type. -func PossibleExpressRouteLinkMacSecCipherValues() []ExpressRouteLinkMacSecCipher { - return []ExpressRouteLinkMacSecCipher{GcmAes128, GcmAes256, GcmAesXpn128, GcmAesXpn256} -} - -// ExpressRouteLinkMacSecSciState enumerates the values for express route link mac sec sci state. -type ExpressRouteLinkMacSecSciState string - -const ( - // ExpressRouteLinkMacSecSciStateDisabled ... - ExpressRouteLinkMacSecSciStateDisabled ExpressRouteLinkMacSecSciState = "Disabled" - // ExpressRouteLinkMacSecSciStateEnabled ... - ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" -) - -// PossibleExpressRouteLinkMacSecSciStateValues returns an array of possible values for the ExpressRouteLinkMacSecSciState const type. -func PossibleExpressRouteLinkMacSecSciStateValues() []ExpressRouteLinkMacSecSciState { - return []ExpressRouteLinkMacSecSciState{ExpressRouteLinkMacSecSciStateDisabled, ExpressRouteLinkMacSecSciStateEnabled} -} - -// ExpressRoutePeeringState enumerates the values for express route peering state. -type ExpressRoutePeeringState string - -const ( - // ExpressRoutePeeringStateDisabled ... - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - // ExpressRoutePeeringStateEnabled ... - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -// PossibleExpressRoutePeeringStateValues returns an array of possible values for the ExpressRoutePeeringState const type. -func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { - return []ExpressRoutePeeringState{ExpressRoutePeeringStateDisabled, ExpressRoutePeeringStateEnabled} -} - -// ExpressRoutePeeringType enumerates the values for express route peering type. -type ExpressRoutePeeringType string - -const ( - // AzurePrivatePeering ... - AzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - // AzurePublicPeering ... - AzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - // MicrosoftPeering ... - MicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -// PossibleExpressRoutePeeringTypeValues returns an array of possible values for the ExpressRoutePeeringType const type. -func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { - return []ExpressRoutePeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} -} - -// ExpressRoutePortAuthorizationUseStatus enumerates the values for express route port authorization use -// status. -type ExpressRoutePortAuthorizationUseStatus string - -const ( - // ExpressRoutePortAuthorizationUseStatusAvailable ... - ExpressRoutePortAuthorizationUseStatusAvailable ExpressRoutePortAuthorizationUseStatus = "Available" - // ExpressRoutePortAuthorizationUseStatusInUse ... - ExpressRoutePortAuthorizationUseStatusInUse ExpressRoutePortAuthorizationUseStatus = "InUse" -) - -// PossibleExpressRoutePortAuthorizationUseStatusValues returns an array of possible values for the ExpressRoutePortAuthorizationUseStatus const type. -func PossibleExpressRoutePortAuthorizationUseStatusValues() []ExpressRoutePortAuthorizationUseStatus { - return []ExpressRoutePortAuthorizationUseStatus{ExpressRoutePortAuthorizationUseStatusAvailable, ExpressRoutePortAuthorizationUseStatusInUse} -} - -// ExpressRoutePortsBillingType enumerates the values for express route ports billing type. -type ExpressRoutePortsBillingType string - -const ( - // ExpressRoutePortsBillingTypeMeteredData ... - ExpressRoutePortsBillingTypeMeteredData ExpressRoutePortsBillingType = "MeteredData" - // ExpressRoutePortsBillingTypeUnlimitedData ... - ExpressRoutePortsBillingTypeUnlimitedData ExpressRoutePortsBillingType = "UnlimitedData" -) - -// PossibleExpressRoutePortsBillingTypeValues returns an array of possible values for the ExpressRoutePortsBillingType const type. -func PossibleExpressRoutePortsBillingTypeValues() []ExpressRoutePortsBillingType { - return []ExpressRoutePortsBillingType{ExpressRoutePortsBillingTypeMeteredData, ExpressRoutePortsBillingTypeUnlimitedData} -} - -// ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. -type ExpressRoutePortsEncapsulation string - -const ( - // Dot1Q ... - Dot1Q ExpressRoutePortsEncapsulation = "Dot1Q" - // QinQ ... - QinQ ExpressRoutePortsEncapsulation = "QinQ" -) - -// PossibleExpressRoutePortsEncapsulationValues returns an array of possible values for the ExpressRoutePortsEncapsulation const type. -func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { - return []ExpressRoutePortsEncapsulation{Dot1Q, QinQ} -} - -// ExtendedLocationTypes enumerates the values for extended location types. -type ExtendedLocationTypes string - -const ( - // EdgeZone ... - EdgeZone ExtendedLocationTypes = "EdgeZone" -) - -// PossibleExtendedLocationTypesValues returns an array of possible values for the ExtendedLocationTypes const type. -func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{EdgeZone} -} - -// FirewallPolicyFilterRuleCollectionActionType enumerates the values for firewall policy filter rule -// collection action type. -type FirewallPolicyFilterRuleCollectionActionType string - -const ( - // FirewallPolicyFilterRuleCollectionActionTypeAllow ... - FirewallPolicyFilterRuleCollectionActionTypeAllow FirewallPolicyFilterRuleCollectionActionType = "Allow" - // FirewallPolicyFilterRuleCollectionActionTypeDeny ... - FirewallPolicyFilterRuleCollectionActionTypeDeny FirewallPolicyFilterRuleCollectionActionType = "Deny" -) - -// PossibleFirewallPolicyFilterRuleCollectionActionTypeValues returns an array of possible values for the FirewallPolicyFilterRuleCollectionActionType const type. -func PossibleFirewallPolicyFilterRuleCollectionActionTypeValues() []FirewallPolicyFilterRuleCollectionActionType { - return []FirewallPolicyFilterRuleCollectionActionType{FirewallPolicyFilterRuleCollectionActionTypeAllow, FirewallPolicyFilterRuleCollectionActionTypeDeny} -} - -// FirewallPolicyIDPSQuerySortOrder enumerates the values for firewall policy idps query sort order. -type FirewallPolicyIDPSQuerySortOrder string - -const ( - // Ascending ... - Ascending FirewallPolicyIDPSQuerySortOrder = "Ascending" - // Descending ... - Descending FirewallPolicyIDPSQuerySortOrder = "Descending" -) - -// PossibleFirewallPolicyIDPSQuerySortOrderValues returns an array of possible values for the FirewallPolicyIDPSQuerySortOrder const type. -func PossibleFirewallPolicyIDPSQuerySortOrderValues() []FirewallPolicyIDPSQuerySortOrder { - return []FirewallPolicyIDPSQuerySortOrder{Ascending, Descending} -} - -// FirewallPolicyIntrusionDetectionProtocol enumerates the values for firewall policy intrusion detection -// protocol. -type FirewallPolicyIntrusionDetectionProtocol string - -const ( - // FirewallPolicyIntrusionDetectionProtocolANY ... - FirewallPolicyIntrusionDetectionProtocolANY FirewallPolicyIntrusionDetectionProtocol = "ANY" - // FirewallPolicyIntrusionDetectionProtocolICMP ... - FirewallPolicyIntrusionDetectionProtocolICMP FirewallPolicyIntrusionDetectionProtocol = "ICMP" - // FirewallPolicyIntrusionDetectionProtocolTCP ... - FirewallPolicyIntrusionDetectionProtocolTCP FirewallPolicyIntrusionDetectionProtocol = "TCP" - // FirewallPolicyIntrusionDetectionProtocolUDP ... - FirewallPolicyIntrusionDetectionProtocolUDP FirewallPolicyIntrusionDetectionProtocol = "UDP" -) - -// PossibleFirewallPolicyIntrusionDetectionProtocolValues returns an array of possible values for the FirewallPolicyIntrusionDetectionProtocol const type. -func PossibleFirewallPolicyIntrusionDetectionProtocolValues() []FirewallPolicyIntrusionDetectionProtocol { - return []FirewallPolicyIntrusionDetectionProtocol{FirewallPolicyIntrusionDetectionProtocolANY, FirewallPolicyIntrusionDetectionProtocolICMP, FirewallPolicyIntrusionDetectionProtocolTCP, FirewallPolicyIntrusionDetectionProtocolUDP} -} - -// FirewallPolicyIntrusionDetectionStateType enumerates the values for firewall policy intrusion detection -// state type. -type FirewallPolicyIntrusionDetectionStateType string - -const ( - // FirewallPolicyIntrusionDetectionStateTypeAlert ... - FirewallPolicyIntrusionDetectionStateTypeAlert FirewallPolicyIntrusionDetectionStateType = "Alert" - // FirewallPolicyIntrusionDetectionStateTypeDeny ... - FirewallPolicyIntrusionDetectionStateTypeDeny FirewallPolicyIntrusionDetectionStateType = "Deny" - // FirewallPolicyIntrusionDetectionStateTypeOff ... - FirewallPolicyIntrusionDetectionStateTypeOff FirewallPolicyIntrusionDetectionStateType = "Off" -) - -// PossibleFirewallPolicyIntrusionDetectionStateTypeValues returns an array of possible values for the FirewallPolicyIntrusionDetectionStateType const type. -func PossibleFirewallPolicyIntrusionDetectionStateTypeValues() []FirewallPolicyIntrusionDetectionStateType { - return []FirewallPolicyIntrusionDetectionStateType{FirewallPolicyIntrusionDetectionStateTypeAlert, FirewallPolicyIntrusionDetectionStateTypeDeny, FirewallPolicyIntrusionDetectionStateTypeOff} -} - -// FirewallPolicyNatRuleCollectionActionType enumerates the values for firewall policy nat rule collection -// action type. -type FirewallPolicyNatRuleCollectionActionType string - -const ( - // DNAT ... - DNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" -) - -// PossibleFirewallPolicyNatRuleCollectionActionTypeValues returns an array of possible values for the FirewallPolicyNatRuleCollectionActionType const type. -func PossibleFirewallPolicyNatRuleCollectionActionTypeValues() []FirewallPolicyNatRuleCollectionActionType { - return []FirewallPolicyNatRuleCollectionActionType{DNAT} -} - -// FirewallPolicyRuleApplicationProtocolType enumerates the values for firewall policy rule application -// protocol type. -type FirewallPolicyRuleApplicationProtocolType string - -const ( - // FirewallPolicyRuleApplicationProtocolTypeHTTP ... - FirewallPolicyRuleApplicationProtocolTypeHTTP FirewallPolicyRuleApplicationProtocolType = "Http" - // FirewallPolicyRuleApplicationProtocolTypeHTTPS ... - FirewallPolicyRuleApplicationProtocolTypeHTTPS FirewallPolicyRuleApplicationProtocolType = "Https" -) - -// PossibleFirewallPolicyRuleApplicationProtocolTypeValues returns an array of possible values for the FirewallPolicyRuleApplicationProtocolType const type. -func PossibleFirewallPolicyRuleApplicationProtocolTypeValues() []FirewallPolicyRuleApplicationProtocolType { - return []FirewallPolicyRuleApplicationProtocolType{FirewallPolicyRuleApplicationProtocolTypeHTTP, FirewallPolicyRuleApplicationProtocolTypeHTTPS} -} - -// FirewallPolicyRuleNetworkProtocol enumerates the values for firewall policy rule network protocol. -type FirewallPolicyRuleNetworkProtocol string - -const ( - // FirewallPolicyRuleNetworkProtocolAny ... - FirewallPolicyRuleNetworkProtocolAny FirewallPolicyRuleNetworkProtocol = "Any" - // FirewallPolicyRuleNetworkProtocolICMP ... - FirewallPolicyRuleNetworkProtocolICMP FirewallPolicyRuleNetworkProtocol = "ICMP" - // FirewallPolicyRuleNetworkProtocolTCP ... - FirewallPolicyRuleNetworkProtocolTCP FirewallPolicyRuleNetworkProtocol = "TCP" - // FirewallPolicyRuleNetworkProtocolUDP ... - FirewallPolicyRuleNetworkProtocolUDP FirewallPolicyRuleNetworkProtocol = "UDP" -) - -// PossibleFirewallPolicyRuleNetworkProtocolValues returns an array of possible values for the FirewallPolicyRuleNetworkProtocol const type. -func PossibleFirewallPolicyRuleNetworkProtocolValues() []FirewallPolicyRuleNetworkProtocol { - return []FirewallPolicyRuleNetworkProtocol{FirewallPolicyRuleNetworkProtocolAny, FirewallPolicyRuleNetworkProtocolICMP, FirewallPolicyRuleNetworkProtocolTCP, FirewallPolicyRuleNetworkProtocolUDP} -} - -// FirewallPolicySkuTier enumerates the values for firewall policy sku tier. -type FirewallPolicySkuTier string - -const ( - // FirewallPolicySkuTierBasic ... - FirewallPolicySkuTierBasic FirewallPolicySkuTier = "Basic" - // FirewallPolicySkuTierPremium ... - FirewallPolicySkuTierPremium FirewallPolicySkuTier = "Premium" - // FirewallPolicySkuTierStandard ... - FirewallPolicySkuTierStandard FirewallPolicySkuTier = "Standard" -) - -// PossibleFirewallPolicySkuTierValues returns an array of possible values for the FirewallPolicySkuTier const type. -func PossibleFirewallPolicySkuTierValues() []FirewallPolicySkuTier { - return []FirewallPolicySkuTier{FirewallPolicySkuTierBasic, FirewallPolicySkuTierPremium, FirewallPolicySkuTierStandard} -} - -// FlowLogFormatType enumerates the values for flow log format type. -type FlowLogFormatType string - -const ( - // JSON ... - JSON FlowLogFormatType = "JSON" -) - -// PossibleFlowLogFormatTypeValues returns an array of possible values for the FlowLogFormatType const type. -func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { - return []FlowLogFormatType{JSON} -} - -// GatewayLoadBalancerTunnelInterfaceType enumerates the values for gateway load balancer tunnel interface -// type. -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - // GatewayLoadBalancerTunnelInterfaceTypeExternal ... - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - // GatewayLoadBalancerTunnelInterfaceTypeInternal ... - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - // GatewayLoadBalancerTunnelInterfaceTypeNone ... - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -// PossibleGatewayLoadBalancerTunnelInterfaceTypeValues returns an array of possible values for the GatewayLoadBalancerTunnelInterfaceType const type. -func PossibleGatewayLoadBalancerTunnelInterfaceTypeValues() []GatewayLoadBalancerTunnelInterfaceType { - return []GatewayLoadBalancerTunnelInterfaceType{GatewayLoadBalancerTunnelInterfaceTypeExternal, GatewayLoadBalancerTunnelInterfaceTypeInternal, GatewayLoadBalancerTunnelInterfaceTypeNone} -} - -// GatewayLoadBalancerTunnelProtocol enumerates the values for gateway load balancer tunnel protocol. -type GatewayLoadBalancerTunnelProtocol string - -const ( - // GatewayLoadBalancerTunnelProtocolNative ... - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - // GatewayLoadBalancerTunnelProtocolNone ... - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - // GatewayLoadBalancerTunnelProtocolVXLAN ... - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -// PossibleGatewayLoadBalancerTunnelProtocolValues returns an array of possible values for the GatewayLoadBalancerTunnelProtocol const type. -func PossibleGatewayLoadBalancerTunnelProtocolValues() []GatewayLoadBalancerTunnelProtocol { - return []GatewayLoadBalancerTunnelProtocol{GatewayLoadBalancerTunnelProtocolNative, GatewayLoadBalancerTunnelProtocolNone, GatewayLoadBalancerTunnelProtocolVXLAN} -} - -// Geo enumerates the values for geo. -type Geo string - -const ( - // AFRI ... - AFRI Geo = "AFRI" - // APAC ... - APAC Geo = "APAC" - // AQ ... - AQ Geo = "AQ" - // EURO ... - EURO Geo = "EURO" - // GLOBAL ... - GLOBAL Geo = "GLOBAL" - // LATAM ... - LATAM Geo = "LATAM" - // ME ... - ME Geo = "ME" - // NAM ... - NAM Geo = "NAM" - // OCEANIA ... - OCEANIA Geo = "OCEANIA" -) - -// PossibleGeoValues returns an array of possible values for the Geo const type. -func PossibleGeoValues() []Geo { - return []Geo{AFRI, APAC, AQ, EURO, GLOBAL, LATAM, ME, NAM, OCEANIA} -} - -// GroupConnectivity enumerates the values for group connectivity. -type GroupConnectivity string - -const ( - // GroupConnectivityDirectlyConnected ... - GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - // GroupConnectivityNone ... - GroupConnectivityNone GroupConnectivity = "None" -) - -// PossibleGroupConnectivityValues returns an array of possible values for the GroupConnectivity const type. -func PossibleGroupConnectivityValues() []GroupConnectivity { - return []GroupConnectivity{GroupConnectivityDirectlyConnected, GroupConnectivityNone} -} - -// HTTPConfigurationMethod enumerates the values for http configuration method. -type HTTPConfigurationMethod string - -const ( - // Get ... - Get HTTPConfigurationMethod = "Get" - // Post ... - Post HTTPConfigurationMethod = "Post" -) - -// PossibleHTTPConfigurationMethodValues returns an array of possible values for the HTTPConfigurationMethod const type. -func PossibleHTTPConfigurationMethodValues() []HTTPConfigurationMethod { - return []HTTPConfigurationMethod{Get, Post} -} - -// HTTPMethod enumerates the values for http method. -type HTTPMethod string - -const ( - // HTTPMethodGet ... - HTTPMethodGet HTTPMethod = "Get" -) - -// PossibleHTTPMethodValues returns an array of possible values for the HTTPMethod const type. -func PossibleHTTPMethodValues() []HTTPMethod { - return []HTTPMethod{HTTPMethodGet} -} - -// HubBgpConnectionStatus enumerates the values for hub bgp connection status. -type HubBgpConnectionStatus string - -const ( - // HubBgpConnectionStatusConnected ... - HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" - // HubBgpConnectionStatusConnecting ... - HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" - // HubBgpConnectionStatusNotConnected ... - HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" - // HubBgpConnectionStatusUnknown ... - HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" -) - -// PossibleHubBgpConnectionStatusValues returns an array of possible values for the HubBgpConnectionStatus const type. -func PossibleHubBgpConnectionStatusValues() []HubBgpConnectionStatus { - return []HubBgpConnectionStatus{HubBgpConnectionStatusConnected, HubBgpConnectionStatusConnecting, HubBgpConnectionStatusNotConnected, HubBgpConnectionStatusUnknown} -} - -// HubRoutingPreference enumerates the values for hub routing preference. -type HubRoutingPreference string - -const ( - // HubRoutingPreferenceASPath ... - HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" - // HubRoutingPreferenceExpressRoute ... - HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" - // HubRoutingPreferenceVpnGateway ... - HubRoutingPreferenceVpnGateway HubRoutingPreference = "VpnGateway" -) - -// PossibleHubRoutingPreferenceValues returns an array of possible values for the HubRoutingPreference const type. -func PossibleHubRoutingPreferenceValues() []HubRoutingPreference { - return []HubRoutingPreference{HubRoutingPreferenceASPath, HubRoutingPreferenceExpressRoute, HubRoutingPreferenceVpnGateway} -} - -// HubVirtualNetworkConnectionStatus enumerates the values for hub virtual network connection status. -type HubVirtualNetworkConnectionStatus string - -const ( - // HubVirtualNetworkConnectionStatusConnected ... - HubVirtualNetworkConnectionStatusConnected HubVirtualNetworkConnectionStatus = "Connected" - // HubVirtualNetworkConnectionStatusConnecting ... - HubVirtualNetworkConnectionStatusConnecting HubVirtualNetworkConnectionStatus = "Connecting" - // HubVirtualNetworkConnectionStatusNotConnected ... - HubVirtualNetworkConnectionStatusNotConnected HubVirtualNetworkConnectionStatus = "NotConnected" - // HubVirtualNetworkConnectionStatusUnknown ... - HubVirtualNetworkConnectionStatusUnknown HubVirtualNetworkConnectionStatus = "Unknown" -) - -// PossibleHubVirtualNetworkConnectionStatusValues returns an array of possible values for the HubVirtualNetworkConnectionStatus const type. -func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnectionStatus { - return []HubVirtualNetworkConnectionStatus{HubVirtualNetworkConnectionStatusConnected, HubVirtualNetworkConnectionStatusConnecting, HubVirtualNetworkConnectionStatusNotConnected, HubVirtualNetworkConnectionStatusUnknown} -} - -// IkeEncryption enumerates the values for ike encryption. -type IkeEncryption string - -const ( - // AES128 ... - AES128 IkeEncryption = "AES128" - // AES192 ... - AES192 IkeEncryption = "AES192" - // AES256 ... - AES256 IkeEncryption = "AES256" - // DES ... - DES IkeEncryption = "DES" - // DES3 ... - DES3 IkeEncryption = "DES3" - // GCMAES128 ... - GCMAES128 IkeEncryption = "GCMAES128" - // GCMAES256 ... - GCMAES256 IkeEncryption = "GCMAES256" -) - -// PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. -func PossibleIkeEncryptionValues() []IkeEncryption { - return []IkeEncryption{AES128, AES192, AES256, DES, DES3, GCMAES128, GCMAES256} -} - -// IkeIntegrity enumerates the values for ike integrity. -type IkeIntegrity string - -const ( - // IkeIntegrityGCMAES128 ... - IkeIntegrityGCMAES128 IkeIntegrity = "GCMAES128" - // IkeIntegrityGCMAES256 ... - IkeIntegrityGCMAES256 IkeIntegrity = "GCMAES256" - // IkeIntegrityMD5 ... - IkeIntegrityMD5 IkeIntegrity = "MD5" - // IkeIntegritySHA1 ... - IkeIntegritySHA1 IkeIntegrity = "SHA1" - // IkeIntegritySHA256 ... - IkeIntegritySHA256 IkeIntegrity = "SHA256" - // IkeIntegritySHA384 ... - IkeIntegritySHA384 IkeIntegrity = "SHA384" -) - -// PossibleIkeIntegrityValues returns an array of possible values for the IkeIntegrity const type. -func PossibleIkeIntegrityValues() []IkeIntegrity { - return []IkeIntegrity{IkeIntegrityGCMAES128, IkeIntegrityGCMAES256, IkeIntegrityMD5, IkeIntegritySHA1, IkeIntegritySHA256, IkeIntegritySHA384} -} - -// InboundSecurityRulesProtocol enumerates the values for inbound security rules protocol. -type InboundSecurityRulesProtocol string - -const ( - // InboundSecurityRulesProtocolTCP ... - InboundSecurityRulesProtocolTCP InboundSecurityRulesProtocol = "TCP" - // InboundSecurityRulesProtocolUDP ... - InboundSecurityRulesProtocolUDP InboundSecurityRulesProtocol = "UDP" -) - -// PossibleInboundSecurityRulesProtocolValues returns an array of possible values for the InboundSecurityRulesProtocol const type. -func PossibleInboundSecurityRulesProtocolValues() []InboundSecurityRulesProtocol { - return []InboundSecurityRulesProtocol{InboundSecurityRulesProtocolTCP, InboundSecurityRulesProtocolUDP} -} - -// IntentPolicyBasedService enumerates the values for intent policy based service. -type IntentPolicyBasedService string - -const ( - // IntentPolicyBasedServiceAll ... - IntentPolicyBasedServiceAll IntentPolicyBasedService = "All" - // IntentPolicyBasedServiceAllowRulesOnly ... - IntentPolicyBasedServiceAllowRulesOnly IntentPolicyBasedService = "AllowRulesOnly" - // IntentPolicyBasedServiceNone ... - IntentPolicyBasedServiceNone IntentPolicyBasedService = "None" -) - -// PossibleIntentPolicyBasedServiceValues returns an array of possible values for the IntentPolicyBasedService const type. -func PossibleIntentPolicyBasedServiceValues() []IntentPolicyBasedService { - return []IntentPolicyBasedService{IntentPolicyBasedServiceAll, IntentPolicyBasedServiceAllowRulesOnly, IntentPolicyBasedServiceNone} -} - -// InterfaceAuxiliaryMode enumerates the values for interface auxiliary mode. -type InterfaceAuxiliaryMode string - -const ( - // InterfaceAuxiliaryModeFloating ... - InterfaceAuxiliaryModeFloating InterfaceAuxiliaryMode = "Floating" - // InterfaceAuxiliaryModeMaxConnections ... - InterfaceAuxiliaryModeMaxConnections InterfaceAuxiliaryMode = "MaxConnections" - // InterfaceAuxiliaryModeNone ... - InterfaceAuxiliaryModeNone InterfaceAuxiliaryMode = "None" -) - -// PossibleInterfaceAuxiliaryModeValues returns an array of possible values for the InterfaceAuxiliaryMode const type. -func PossibleInterfaceAuxiliaryModeValues() []InterfaceAuxiliaryMode { - return []InterfaceAuxiliaryMode{InterfaceAuxiliaryModeFloating, InterfaceAuxiliaryModeMaxConnections, InterfaceAuxiliaryModeNone} -} - -// InterfaceMigrationPhase enumerates the values for interface migration phase. -type InterfaceMigrationPhase string - -const ( - // InterfaceMigrationPhaseAbort ... - InterfaceMigrationPhaseAbort InterfaceMigrationPhase = "Abort" - // InterfaceMigrationPhaseCommit ... - InterfaceMigrationPhaseCommit InterfaceMigrationPhase = "Commit" - // InterfaceMigrationPhaseCommitted ... - InterfaceMigrationPhaseCommitted InterfaceMigrationPhase = "Committed" - // InterfaceMigrationPhaseNone ... - InterfaceMigrationPhaseNone InterfaceMigrationPhase = "None" - // InterfaceMigrationPhasePrepare ... - InterfaceMigrationPhasePrepare InterfaceMigrationPhase = "Prepare" -) - -// PossibleInterfaceMigrationPhaseValues returns an array of possible values for the InterfaceMigrationPhase const type. -func PossibleInterfaceMigrationPhaseValues() []InterfaceMigrationPhase { - return []InterfaceMigrationPhase{InterfaceMigrationPhaseAbort, InterfaceMigrationPhaseCommit, InterfaceMigrationPhaseCommitted, InterfaceMigrationPhaseNone, InterfaceMigrationPhasePrepare} -} - -// InterfaceNicType enumerates the values for interface nic type. -type InterfaceNicType string - -const ( - // Elastic ... - Elastic InterfaceNicType = "Elastic" - // Standard ... - Standard InterfaceNicType = "Standard" -) - -// PossibleInterfaceNicTypeValues returns an array of possible values for the InterfaceNicType const type. -func PossibleInterfaceNicTypeValues() []InterfaceNicType { - return []InterfaceNicType{Elastic, Standard} -} - -// IPAllocationMethod enumerates the values for ip allocation method. -type IPAllocationMethod string - -const ( - // Dynamic ... - Dynamic IPAllocationMethod = "Dynamic" - // Static ... - Static IPAllocationMethod = "Static" -) - -// PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. -func PossibleIPAllocationMethodValues() []IPAllocationMethod { - return []IPAllocationMethod{Dynamic, Static} -} - -// IPAllocationType enumerates the values for ip allocation type. -type IPAllocationType string - -const ( - // Hypernet ... - Hypernet IPAllocationType = "Hypernet" - // Undefined ... - Undefined IPAllocationType = "Undefined" -) - -// PossibleIPAllocationTypeValues returns an array of possible values for the IPAllocationType const type. -func PossibleIPAllocationTypeValues() []IPAllocationType { - return []IPAllocationType{Hypernet, Undefined} -} - -// IPFlowProtocol enumerates the values for ip flow protocol. -type IPFlowProtocol string - -const ( - // IPFlowProtocolTCP ... - IPFlowProtocolTCP IPFlowProtocol = "TCP" - // IPFlowProtocolUDP ... - IPFlowProtocolUDP IPFlowProtocol = "UDP" -) - -// PossibleIPFlowProtocolValues returns an array of possible values for the IPFlowProtocol const type. -func PossibleIPFlowProtocolValues() []IPFlowProtocol { - return []IPFlowProtocol{IPFlowProtocolTCP, IPFlowProtocolUDP} -} - -// IpsecEncryption enumerates the values for ipsec encryption. -type IpsecEncryption string - -const ( - // IpsecEncryptionAES128 ... - IpsecEncryptionAES128 IpsecEncryption = "AES128" - // IpsecEncryptionAES192 ... - IpsecEncryptionAES192 IpsecEncryption = "AES192" - // IpsecEncryptionAES256 ... - IpsecEncryptionAES256 IpsecEncryption = "AES256" - // IpsecEncryptionDES ... - IpsecEncryptionDES IpsecEncryption = "DES" - // IpsecEncryptionDES3 ... - IpsecEncryptionDES3 IpsecEncryption = "DES3" - // IpsecEncryptionGCMAES128 ... - IpsecEncryptionGCMAES128 IpsecEncryption = "GCMAES128" - // IpsecEncryptionGCMAES192 ... - IpsecEncryptionGCMAES192 IpsecEncryption = "GCMAES192" - // IpsecEncryptionGCMAES256 ... - IpsecEncryptionGCMAES256 IpsecEncryption = "GCMAES256" - // IpsecEncryptionNone ... - IpsecEncryptionNone IpsecEncryption = "None" -) - -// PossibleIpsecEncryptionValues returns an array of possible values for the IpsecEncryption const type. -func PossibleIpsecEncryptionValues() []IpsecEncryption { - return []IpsecEncryption{IpsecEncryptionAES128, IpsecEncryptionAES192, IpsecEncryptionAES256, IpsecEncryptionDES, IpsecEncryptionDES3, IpsecEncryptionGCMAES128, IpsecEncryptionGCMAES192, IpsecEncryptionGCMAES256, IpsecEncryptionNone} -} - -// IpsecIntegrity enumerates the values for ipsec integrity. -type IpsecIntegrity string - -const ( - // IpsecIntegrityGCMAES128 ... - IpsecIntegrityGCMAES128 IpsecIntegrity = "GCMAES128" - // IpsecIntegrityGCMAES192 ... - IpsecIntegrityGCMAES192 IpsecIntegrity = "GCMAES192" - // IpsecIntegrityGCMAES256 ... - IpsecIntegrityGCMAES256 IpsecIntegrity = "GCMAES256" - // IpsecIntegrityMD5 ... - IpsecIntegrityMD5 IpsecIntegrity = "MD5" - // IpsecIntegritySHA1 ... - IpsecIntegritySHA1 IpsecIntegrity = "SHA1" - // IpsecIntegritySHA256 ... - IpsecIntegritySHA256 IpsecIntegrity = "SHA256" -) - -// PossibleIpsecIntegrityValues returns an array of possible values for the IpsecIntegrity const type. -func PossibleIpsecIntegrityValues() []IpsecIntegrity { - return []IpsecIntegrity{IpsecIntegrityGCMAES128, IpsecIntegrityGCMAES192, IpsecIntegrityGCMAES256, IpsecIntegrityMD5, IpsecIntegritySHA1, IpsecIntegritySHA256} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// IsGlobal enumerates the values for is global. -type IsGlobal string - -const ( - // IsGlobalFalse ... - IsGlobalFalse IsGlobal = "False" - // IsGlobalTrue ... - IsGlobalTrue IsGlobal = "True" -) - -// PossibleIsGlobalValues returns an array of possible values for the IsGlobal const type. -func PossibleIsGlobalValues() []IsGlobal { - return []IsGlobal{IsGlobalFalse, IsGlobalTrue} -} - -// IssueType enumerates the values for issue type. -type IssueType string - -const ( - // IssueTypeAgentStopped ... - IssueTypeAgentStopped IssueType = "AgentStopped" - // IssueTypeDNSResolution ... - IssueTypeDNSResolution IssueType = "DnsResolution" - // IssueTypeGuestFirewall ... - IssueTypeGuestFirewall IssueType = "GuestFirewall" - // IssueTypeNetworkSecurityRule ... - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - // IssueTypePlatform ... - IssueTypePlatform IssueType = "Platform" - // IssueTypePortThrottled ... - IssueTypePortThrottled IssueType = "PortThrottled" - // IssueTypeSocketBind ... - IssueTypeSocketBind IssueType = "SocketBind" - // IssueTypeUnknown ... - IssueTypeUnknown IssueType = "Unknown" - // IssueTypeUserDefinedRoute ... - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. -func PossibleIssueTypeValues() []IssueType { - return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} -} - -// IsWorkloadProtected enumerates the values for is workload protected. -type IsWorkloadProtected string - -const ( - // IsWorkloadProtectedFalse ... - IsWorkloadProtectedFalse IsWorkloadProtected = "False" - // IsWorkloadProtectedTrue ... - IsWorkloadProtectedTrue IsWorkloadProtected = "True" -) - -// PossibleIsWorkloadProtectedValues returns an array of possible values for the IsWorkloadProtected const type. -func PossibleIsWorkloadProtectedValues() []IsWorkloadProtected { - return []IsWorkloadProtected{IsWorkloadProtectedFalse, IsWorkloadProtectedTrue} -} - -// Kind enumerates the values for kind. -type Kind string - -const ( - // KindActiveBaseSecurityAdminRule ... - KindActiveBaseSecurityAdminRule Kind = "ActiveBaseSecurityAdminRule" - // KindCustom ... - KindCustom Kind = "Custom" - // KindDefault ... - KindDefault Kind = "Default" -) - -// PossibleKindValues returns an array of possible values for the Kind const type. -func PossibleKindValues() []Kind { - return []Kind{KindActiveBaseSecurityAdminRule, KindCustom, KindDefault} -} - -// KindBasicBaseAdminRule enumerates the values for kind basic base admin rule. -type KindBasicBaseAdminRule string - -const ( - // KindBasicBaseAdminRuleKindBaseAdminRule ... - KindBasicBaseAdminRuleKindBaseAdminRule KindBasicBaseAdminRule = "BaseAdminRule" - // KindBasicBaseAdminRuleKindCustom ... - KindBasicBaseAdminRuleKindCustom KindBasicBaseAdminRule = "Custom" - // KindBasicBaseAdminRuleKindDefault ... - KindBasicBaseAdminRuleKindDefault KindBasicBaseAdminRule = "Default" -) - -// PossibleKindBasicBaseAdminRuleValues returns an array of possible values for the KindBasicBaseAdminRule const type. -func PossibleKindBasicBaseAdminRuleValues() []KindBasicBaseAdminRule { - return []KindBasicBaseAdminRule{KindBasicBaseAdminRuleKindBaseAdminRule, KindBasicBaseAdminRuleKindCustom, KindBasicBaseAdminRuleKindDefault} -} - -// KindBasicEffectiveBaseSecurityAdminRule enumerates the values for kind basic effective base security admin -// rule. -type KindBasicEffectiveBaseSecurityAdminRule string - -const ( - // KindBasicEffectiveBaseSecurityAdminRuleKindCustom ... - KindBasicEffectiveBaseSecurityAdminRuleKindCustom KindBasicEffectiveBaseSecurityAdminRule = "Custom" - // KindBasicEffectiveBaseSecurityAdminRuleKindDefault ... - KindBasicEffectiveBaseSecurityAdminRuleKindDefault KindBasicEffectiveBaseSecurityAdminRule = "Default" - // KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule ... - KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule KindBasicEffectiveBaseSecurityAdminRule = "EffectiveBaseSecurityAdminRule" -) - -// PossibleKindBasicEffectiveBaseSecurityAdminRuleValues returns an array of possible values for the KindBasicEffectiveBaseSecurityAdminRule const type. -func PossibleKindBasicEffectiveBaseSecurityAdminRuleValues() []KindBasicEffectiveBaseSecurityAdminRule { - return []KindBasicEffectiveBaseSecurityAdminRule{KindBasicEffectiveBaseSecurityAdminRuleKindCustom, KindBasicEffectiveBaseSecurityAdminRuleKindDefault, KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule} -} - -// LoadBalancerBackendAddressAdminState enumerates the values for load balancer backend address admin state. -type LoadBalancerBackendAddressAdminState string - -const ( - // LoadBalancerBackendAddressAdminStateDown ... - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - // LoadBalancerBackendAddressAdminStateDrain ... - LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" - // LoadBalancerBackendAddressAdminStateNone ... - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - // LoadBalancerBackendAddressAdminStateUp ... - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -// PossibleLoadBalancerBackendAddressAdminStateValues returns an array of possible values for the LoadBalancerBackendAddressAdminState const type. -func PossibleLoadBalancerBackendAddressAdminStateValues() []LoadBalancerBackendAddressAdminState { - return []LoadBalancerBackendAddressAdminState{LoadBalancerBackendAddressAdminStateDown, LoadBalancerBackendAddressAdminStateDrain, LoadBalancerBackendAddressAdminStateNone, LoadBalancerBackendAddressAdminStateUp} -} - -// LoadBalancerOutboundRuleProtocol enumerates the values for load balancer outbound rule protocol. -type LoadBalancerOutboundRuleProtocol string - -const ( - // LoadBalancerOutboundRuleProtocolAll ... - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - // LoadBalancerOutboundRuleProtocolTCP ... - LoadBalancerOutboundRuleProtocolTCP LoadBalancerOutboundRuleProtocol = "Tcp" - // LoadBalancerOutboundRuleProtocolUDP ... - LoadBalancerOutboundRuleProtocolUDP LoadBalancerOutboundRuleProtocol = "Udp" -) - -// PossibleLoadBalancerOutboundRuleProtocolValues returns an array of possible values for the LoadBalancerOutboundRuleProtocol const type. -func PossibleLoadBalancerOutboundRuleProtocolValues() []LoadBalancerOutboundRuleProtocol { - return []LoadBalancerOutboundRuleProtocol{LoadBalancerOutboundRuleProtocolAll, LoadBalancerOutboundRuleProtocolTCP, LoadBalancerOutboundRuleProtocolUDP} -} - -// LoadBalancerSkuName enumerates the values for load balancer sku name. -type LoadBalancerSkuName string - -const ( - // LoadBalancerSkuNameBasic ... - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - // LoadBalancerSkuNameGateway ... - LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" - // LoadBalancerSkuNameStandard ... - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -// PossibleLoadBalancerSkuNameValues returns an array of possible values for the LoadBalancerSkuName const type. -func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { - return []LoadBalancerSkuName{LoadBalancerSkuNameBasic, LoadBalancerSkuNameGateway, LoadBalancerSkuNameStandard} -} - -// LoadBalancerSkuTier enumerates the values for load balancer sku tier. -type LoadBalancerSkuTier string - -const ( - // Global ... - Global LoadBalancerSkuTier = "Global" - // Regional ... - Regional LoadBalancerSkuTier = "Regional" -) - -// PossibleLoadBalancerSkuTierValues returns an array of possible values for the LoadBalancerSkuTier const type. -func PossibleLoadBalancerSkuTierValues() []LoadBalancerSkuTier { - return []LoadBalancerSkuTier{Global, Regional} -} - -// LoadDistribution enumerates the values for load distribution. -type LoadDistribution string - -const ( - // LoadDistributionDefault ... - LoadDistributionDefault LoadDistribution = "Default" - // LoadDistributionSourceIP ... - LoadDistributionSourceIP LoadDistribution = "SourceIP" - // LoadDistributionSourceIPProtocol ... - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -// PossibleLoadDistributionValues returns an array of possible values for the LoadDistribution const type. -func PossibleLoadDistributionValues() []LoadDistribution { - return []LoadDistribution{LoadDistributionDefault, LoadDistributionSourceIP, LoadDistributionSourceIPProtocol} -} - -// ManagedRuleEnabledState enumerates the values for managed rule enabled state. -type ManagedRuleEnabledState string - -const ( - // ManagedRuleEnabledStateDisabled ... - ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" - // ManagedRuleEnabledStateEnabled ... - ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" -) - -// PossibleManagedRuleEnabledStateValues returns an array of possible values for the ManagedRuleEnabledState const type. -func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { - return []ManagedRuleEnabledState{ManagedRuleEnabledStateDisabled, ManagedRuleEnabledStateEnabled} -} - -// NatGatewaySkuName enumerates the values for nat gateway sku name. -type NatGatewaySkuName string - -const ( - // NatGatewaySkuNameStandard ... - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -// PossibleNatGatewaySkuNameValues returns an array of possible values for the NatGatewaySkuName const type. -func PossibleNatGatewaySkuNameValues() []NatGatewaySkuName { - return []NatGatewaySkuName{NatGatewaySkuNameStandard} -} - -// NextHopType enumerates the values for next hop type. -type NextHopType string - -const ( - // NextHopTypeHyperNetGateway ... - NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - // NextHopTypeInternet ... - NextHopTypeInternet NextHopType = "Internet" - // NextHopTypeNone ... - NextHopTypeNone NextHopType = "None" - // NextHopTypeVirtualAppliance ... - NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" - // NextHopTypeVirtualNetworkGateway ... - NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - // NextHopTypeVnetLocal ... - NextHopTypeVnetLocal NextHopType = "VnetLocal" -) - -// PossibleNextHopTypeValues returns an array of possible values for the NextHopType const type. -func PossibleNextHopTypeValues() []NextHopType { - return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} -} - -// NextStep enumerates the values for next step. -type NextStep string - -const ( - // NextStepContinue ... - NextStepContinue NextStep = "Continue" - // NextStepTerminate ... - NextStepTerminate NextStep = "Terminate" - // NextStepUnknown ... - NextStepUnknown NextStep = "Unknown" -) - -// PossibleNextStepValues returns an array of possible values for the NextStep const type. -func PossibleNextStepValues() []NextStep { - return []NextStep{NextStepContinue, NextStepTerminate, NextStepUnknown} -} - -// OfficeTrafficCategory enumerates the values for office traffic category. -type OfficeTrafficCategory string - -const ( - // OfficeTrafficCategoryAll ... - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - // OfficeTrafficCategoryNone ... - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - // OfficeTrafficCategoryOptimize ... - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" - // OfficeTrafficCategoryOptimizeAndAllow ... - OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" -) - -// PossibleOfficeTrafficCategoryValues returns an array of possible values for the OfficeTrafficCategory const type. -func PossibleOfficeTrafficCategoryValues() []OfficeTrafficCategory { - return []OfficeTrafficCategory{OfficeTrafficCategoryAll, OfficeTrafficCategoryNone, OfficeTrafficCategoryOptimize, OfficeTrafficCategoryOptimizeAndAllow} -} - -// OperationStatus enumerates the values for operation status. -type OperationStatus string - -const ( - // OperationStatusFailed ... - OperationStatusFailed OperationStatus = "Failed" - // OperationStatusInProgress ... - OperationStatusInProgress OperationStatus = "InProgress" - // OperationStatusSucceeded ... - OperationStatusSucceeded OperationStatus = "Succeeded" -) - -// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. -func PossibleOperationStatusValues() []OperationStatus { - return []OperationStatus{OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} -} - -// Origin enumerates the values for origin. -type Origin string - -const ( - // OriginInbound ... - OriginInbound Origin = "Inbound" - // OriginLocal ... - OriginLocal Origin = "Local" - // OriginOutbound ... - OriginOutbound Origin = "Outbound" -) - -// PossibleOriginValues returns an array of possible values for the Origin const type. -func PossibleOriginValues() []Origin { - return []Origin{OriginInbound, OriginLocal, OriginOutbound} -} - -// OutputType enumerates the values for output type. -type OutputType string - -const ( - // Workspace ... - Workspace OutputType = "Workspace" -) - -// PossibleOutputTypeValues returns an array of possible values for the OutputType const type. -func PossibleOutputTypeValues() []OutputType { - return []OutputType{Workspace} -} - -// OwaspCrsExclusionEntryMatchVariable enumerates the values for owasp crs exclusion entry match variable. -type OwaspCrsExclusionEntryMatchVariable string - -const ( - // RequestArgKeys ... - RequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" - // RequestArgNames ... - RequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - // RequestArgValues ... - RequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" - // RequestCookieKeys ... - RequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" - // RequestCookieNames ... - RequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" - // RequestCookieValues ... - RequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" - // RequestHeaderKeys ... - RequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" - // RequestHeaderNames ... - RequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" - // RequestHeaderValues ... - RequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" -) - -// PossibleOwaspCrsExclusionEntryMatchVariableValues returns an array of possible values for the OwaspCrsExclusionEntryMatchVariable const type. -func PossibleOwaspCrsExclusionEntryMatchVariableValues() []OwaspCrsExclusionEntryMatchVariable { - return []OwaspCrsExclusionEntryMatchVariable{RequestArgKeys, RequestArgNames, RequestArgValues, RequestCookieKeys, RequestCookieNames, RequestCookieValues, RequestHeaderKeys, RequestHeaderNames, RequestHeaderValues} -} - -// OwaspCrsExclusionEntrySelectorMatchOperator enumerates the values for owasp crs exclusion entry selector -// match operator. -type OwaspCrsExclusionEntrySelectorMatchOperator string - -const ( - // OwaspCrsExclusionEntrySelectorMatchOperatorContains ... - OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" - // OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith ... - OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" - // OwaspCrsExclusionEntrySelectorMatchOperatorEquals ... - OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" - // OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny ... - OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" - // OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith ... - OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" -) - -// PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues returns an array of possible values for the OwaspCrsExclusionEntrySelectorMatchOperator const type. -func PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues() []OwaspCrsExclusionEntrySelectorMatchOperator { - return []OwaspCrsExclusionEntrySelectorMatchOperator{OwaspCrsExclusionEntrySelectorMatchOperatorContains, OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, OwaspCrsExclusionEntrySelectorMatchOperatorEquals, OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith} -} - -// PacketCaptureTargetType enumerates the values for packet capture target type. -type PacketCaptureTargetType string - -const ( - // PacketCaptureTargetTypeAzureVM ... - PacketCaptureTargetTypeAzureVM PacketCaptureTargetType = "AzureVM" - // PacketCaptureTargetTypeAzureVMSS ... - PacketCaptureTargetTypeAzureVMSS PacketCaptureTargetType = "AzureVMSS" -) - -// PossiblePacketCaptureTargetTypeValues returns an array of possible values for the PacketCaptureTargetType const type. -func PossiblePacketCaptureTargetTypeValues() []PacketCaptureTargetType { - return []PacketCaptureTargetType{PacketCaptureTargetTypeAzureVM, PacketCaptureTargetTypeAzureVMSS} -} - -// PcError enumerates the values for pc error. -type PcError string - -const ( - // AgentStopped ... - AgentStopped PcError = "AgentStopped" - // CaptureFailed ... - CaptureFailed PcError = "CaptureFailed" - // InternalError ... - InternalError PcError = "InternalError" - // LocalFileFailed ... - LocalFileFailed PcError = "LocalFileFailed" - // StorageFailed ... - StorageFailed PcError = "StorageFailed" -) - -// PossiblePcErrorValues returns an array of possible values for the PcError const type. -func PossiblePcErrorValues() []PcError { - return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} -} - -// PcProtocol enumerates the values for pc protocol. -type PcProtocol string - -const ( - // PcProtocolAny ... - PcProtocolAny PcProtocol = "Any" - // PcProtocolTCP ... - PcProtocolTCP PcProtocol = "TCP" - // PcProtocolUDP ... - PcProtocolUDP PcProtocol = "UDP" -) - -// PossiblePcProtocolValues returns an array of possible values for the PcProtocol const type. -func PossiblePcProtocolValues() []PcProtocol { - return []PcProtocol{PcProtocolAny, PcProtocolTCP, PcProtocolUDP} -} - -// PcStatus enumerates the values for pc status. -type PcStatus string - -const ( - // PcStatusError ... - PcStatusError PcStatus = "Error" - // PcStatusNotStarted ... - PcStatusNotStarted PcStatus = "NotStarted" - // PcStatusRunning ... - PcStatusRunning PcStatus = "Running" - // PcStatusStopped ... - PcStatusStopped PcStatus = "Stopped" - // PcStatusUnknown ... - PcStatusUnknown PcStatus = "Unknown" -) - -// PossiblePcStatusValues returns an array of possible values for the PcStatus const type. -func PossiblePcStatusValues() []PcStatus { - return []PcStatus{PcStatusError, PcStatusNotStarted, PcStatusRunning, PcStatusStopped, PcStatusUnknown} -} - -// PfsGroup enumerates the values for pfs group. -type PfsGroup string - -const ( - // PfsGroupECP256 ... - PfsGroupECP256 PfsGroup = "ECP256" - // PfsGroupECP384 ... - PfsGroupECP384 PfsGroup = "ECP384" - // PfsGroupNone ... - PfsGroupNone PfsGroup = "None" - // PfsGroupPFS1 ... - PfsGroupPFS1 PfsGroup = "PFS1" - // PfsGroupPFS14 ... - PfsGroupPFS14 PfsGroup = "PFS14" - // PfsGroupPFS2 ... - PfsGroupPFS2 PfsGroup = "PFS2" - // PfsGroupPFS2048 ... - PfsGroupPFS2048 PfsGroup = "PFS2048" - // PfsGroupPFS24 ... - PfsGroupPFS24 PfsGroup = "PFS24" - // PfsGroupPFSMM ... - PfsGroupPFSMM PfsGroup = "PFSMM" -) - -// PossiblePfsGroupValues returns an array of possible values for the PfsGroup const type. -func PossiblePfsGroupValues() []PfsGroup { - return []PfsGroup{PfsGroupECP256, PfsGroupECP384, PfsGroupNone, PfsGroupPFS1, PfsGroupPFS14, PfsGroupPFS2, PfsGroupPFS2048, PfsGroupPFS24, PfsGroupPFSMM} -} - -// PreferredIPVersion enumerates the values for preferred ip version. -type PreferredIPVersion string - -const ( - // PreferredIPVersionIPv4 ... - PreferredIPVersionIPv4 PreferredIPVersion = "IPv4" - // PreferredIPVersionIPv6 ... - PreferredIPVersionIPv6 PreferredIPVersion = "IPv6" -) - -// PossiblePreferredIPVersionValues returns an array of possible values for the PreferredIPVersion const type. -func PossiblePreferredIPVersionValues() []PreferredIPVersion { - return []PreferredIPVersion{PreferredIPVersionIPv4, PreferredIPVersionIPv6} -} - -// PreferredRoutingGateway enumerates the values for preferred routing gateway. -type PreferredRoutingGateway string - -const ( - // PreferredRoutingGatewayExpressRoute ... - PreferredRoutingGatewayExpressRoute PreferredRoutingGateway = "ExpressRoute" - // PreferredRoutingGatewayNone ... - PreferredRoutingGatewayNone PreferredRoutingGateway = "None" - // PreferredRoutingGatewayVpnGateway ... - PreferredRoutingGatewayVpnGateway PreferredRoutingGateway = "VpnGateway" -) - -// PossiblePreferredRoutingGatewayValues returns an array of possible values for the PreferredRoutingGateway const type. -func PossiblePreferredRoutingGatewayValues() []PreferredRoutingGateway { - return []PreferredRoutingGateway{PreferredRoutingGatewayExpressRoute, PreferredRoutingGatewayNone, PreferredRoutingGatewayVpnGateway} -} - -// ProbeProtocol enumerates the values for probe protocol. -type ProbeProtocol string - -const ( - // ProbeProtocolHTTP ... - ProbeProtocolHTTP ProbeProtocol = "Http" - // ProbeProtocolHTTPS ... - ProbeProtocolHTTPS ProbeProtocol = "Https" - // ProbeProtocolTCP ... - ProbeProtocolTCP ProbeProtocol = "Tcp" -) - -// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. -func PossibleProbeProtocolValues() []ProbeProtocol { - return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolTCP} -} - -// ProcessorArchitecture enumerates the values for processor architecture. -type ProcessorArchitecture string - -const ( - // Amd64 ... - Amd64 ProcessorArchitecture = "Amd64" - // X86 ... - X86 ProcessorArchitecture = "X86" -) - -// PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. -func PossibleProcessorArchitectureValues() []ProcessorArchitecture { - return []ProcessorArchitecture{Amd64, X86} -} - -// Protocol enumerates the values for protocol. -type Protocol string - -const ( - // ProtocolHTTP ... - ProtocolHTTP Protocol = "Http" - // ProtocolHTTPS ... - ProtocolHTTPS Protocol = "Https" - // ProtocolIcmp ... - ProtocolIcmp Protocol = "Icmp" - // ProtocolTCP ... - ProtocolTCP Protocol = "Tcp" -) - -// PossibleProtocolValues returns an array of possible values for the Protocol const type. -func PossibleProtocolValues() []Protocol { - return []Protocol{ProtocolHTTP, ProtocolHTTPS, ProtocolIcmp, ProtocolTCP} -} - -// ProtocolType enumerates the values for protocol type. -type ProtocolType string - -const ( - // ProtocolTypeAh ... - ProtocolTypeAh ProtocolType = "Ah" - // ProtocolTypeAll ... - ProtocolTypeAll ProtocolType = "All" - // ProtocolTypeDoNotUse ... - ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - // ProtocolTypeEsp ... - ProtocolTypeEsp ProtocolType = "Esp" - // ProtocolTypeGre ... - ProtocolTypeGre ProtocolType = "Gre" - // ProtocolTypeIcmp ... - ProtocolTypeIcmp ProtocolType = "Icmp" - // ProtocolTypeTCP ... - ProtocolTypeTCP ProtocolType = "Tcp" - // ProtocolTypeUDP ... - ProtocolTypeUDP ProtocolType = "Udp" - // ProtocolTypeVxlan ... - ProtocolTypeVxlan ProtocolType = "Vxlan" -) - -// PossibleProtocolTypeValues returns an array of possible values for the ProtocolType const type. -func PossibleProtocolTypeValues() []ProtocolType { - return []ProtocolType{ProtocolTypeAh, ProtocolTypeAll, ProtocolTypeDoNotUse, ProtocolTypeEsp, ProtocolTypeGre, ProtocolTypeIcmp, ProtocolTypeTCP, ProtocolTypeUDP, ProtocolTypeVxlan} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateDeleting ... - ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateSucceeded ... - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - // ProvisioningStateUpdating ... - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating} -} - -// PublicIPAddressMigrationPhase enumerates the values for public ip address migration phase. -type PublicIPAddressMigrationPhase string - -const ( - // PublicIPAddressMigrationPhaseAbort ... - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - // PublicIPAddressMigrationPhaseCommit ... - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - // PublicIPAddressMigrationPhaseCommitted ... - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - // PublicIPAddressMigrationPhaseNone ... - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - // PublicIPAddressMigrationPhasePrepare ... - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -// PossiblePublicIPAddressMigrationPhaseValues returns an array of possible values for the PublicIPAddressMigrationPhase const type. -func PossiblePublicIPAddressMigrationPhaseValues() []PublicIPAddressMigrationPhase { - return []PublicIPAddressMigrationPhase{PublicIPAddressMigrationPhaseAbort, PublicIPAddressMigrationPhaseCommit, PublicIPAddressMigrationPhaseCommitted, PublicIPAddressMigrationPhaseNone, PublicIPAddressMigrationPhasePrepare} -} - -// PublicIPAddressSkuName enumerates the values for public ip address sku name. -type PublicIPAddressSkuName string - -const ( - // PublicIPAddressSkuNameBasic ... - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - // PublicIPAddressSkuNameStandard ... - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. -func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { - return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} -} - -// PublicIPAddressSkuTier enumerates the values for public ip address sku tier. -type PublicIPAddressSkuTier string - -const ( - // PublicIPAddressSkuTierGlobal ... - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - // PublicIPAddressSkuTierRegional ... - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -// PossiblePublicIPAddressSkuTierValues returns an array of possible values for the PublicIPAddressSkuTier const type. -func PossiblePublicIPAddressSkuTierValues() []PublicIPAddressSkuTier { - return []PublicIPAddressSkuTier{PublicIPAddressSkuTierGlobal, PublicIPAddressSkuTierRegional} -} - -// PublicIPPrefixSkuName enumerates the values for public ip prefix sku name. -type PublicIPPrefixSkuName string - -const ( - // PublicIPPrefixSkuNameStandard ... - PublicIPPrefixSkuNameStandard PublicIPPrefixSkuName = "Standard" -) - -// PossiblePublicIPPrefixSkuNameValues returns an array of possible values for the PublicIPPrefixSkuName const type. -func PossiblePublicIPPrefixSkuNameValues() []PublicIPPrefixSkuName { - return []PublicIPPrefixSkuName{PublicIPPrefixSkuNameStandard} -} - -// PublicIPPrefixSkuTier enumerates the values for public ip prefix sku tier. -type PublicIPPrefixSkuTier string - -const ( - // PublicIPPrefixSkuTierGlobal ... - PublicIPPrefixSkuTierGlobal PublicIPPrefixSkuTier = "Global" - // PublicIPPrefixSkuTierRegional ... - PublicIPPrefixSkuTierRegional PublicIPPrefixSkuTier = "Regional" -) - -// PossiblePublicIPPrefixSkuTierValues returns an array of possible values for the PublicIPPrefixSkuTier const type. -func PossiblePublicIPPrefixSkuTierValues() []PublicIPPrefixSkuTier { - return []PublicIPPrefixSkuTier{PublicIPPrefixSkuTierGlobal, PublicIPPrefixSkuTierRegional} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// RouteMapActionType enumerates the values for route map action type. -type RouteMapActionType string - -const ( - // RouteMapActionTypeAdd ... - RouteMapActionTypeAdd RouteMapActionType = "Add" - // RouteMapActionTypeDrop ... - RouteMapActionTypeDrop RouteMapActionType = "Drop" - // RouteMapActionTypeRemove ... - RouteMapActionTypeRemove RouteMapActionType = "Remove" - // RouteMapActionTypeReplace ... - RouteMapActionTypeReplace RouteMapActionType = "Replace" - // RouteMapActionTypeUnknown ... - RouteMapActionTypeUnknown RouteMapActionType = "Unknown" -) - -// PossibleRouteMapActionTypeValues returns an array of possible values for the RouteMapActionType const type. -func PossibleRouteMapActionTypeValues() []RouteMapActionType { - return []RouteMapActionType{RouteMapActionTypeAdd, RouteMapActionTypeDrop, RouteMapActionTypeRemove, RouteMapActionTypeReplace, RouteMapActionTypeUnknown} -} - -// RouteMapMatchCondition enumerates the values for route map match condition. -type RouteMapMatchCondition string - -const ( - // RouteMapMatchConditionContains ... - RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" - // RouteMapMatchConditionEquals ... - RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" - // RouteMapMatchConditionNotContains ... - RouteMapMatchConditionNotContains RouteMapMatchCondition = "NotContains" - // RouteMapMatchConditionNotEquals ... - RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" - // RouteMapMatchConditionUnknown ... - RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" -) - -// PossibleRouteMapMatchConditionValues returns an array of possible values for the RouteMapMatchCondition const type. -func PossibleRouteMapMatchConditionValues() []RouteMapMatchCondition { - return []RouteMapMatchCondition{RouteMapMatchConditionContains, RouteMapMatchConditionEquals, RouteMapMatchConditionNotContains, RouteMapMatchConditionNotEquals, RouteMapMatchConditionUnknown} -} - -// RouteNextHopType enumerates the values for route next hop type. -type RouteNextHopType string - -const ( - // RouteNextHopTypeInternet ... - RouteNextHopTypeInternet RouteNextHopType = "Internet" - // RouteNextHopTypeNone ... - RouteNextHopTypeNone RouteNextHopType = "None" - // RouteNextHopTypeVirtualAppliance ... - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - // RouteNextHopTypeVirtualNetworkGateway ... - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - // RouteNextHopTypeVnetLocal ... - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -// PossibleRouteNextHopTypeValues returns an array of possible values for the RouteNextHopType const type. -func PossibleRouteNextHopTypeValues() []RouteNextHopType { - return []RouteNextHopType{RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal} -} - -// RoutingState enumerates the values for routing state. -type RoutingState string - -const ( - // RoutingStateFailed ... - RoutingStateFailed RoutingState = "Failed" - // RoutingStateNone ... - RoutingStateNone RoutingState = "None" - // RoutingStateProvisioned ... - RoutingStateProvisioned RoutingState = "Provisioned" - // RoutingStateProvisioning ... - RoutingStateProvisioning RoutingState = "Provisioning" -) - -// PossibleRoutingStateValues returns an array of possible values for the RoutingState const type. -func PossibleRoutingStateValues() []RoutingState { - return []RoutingState{RoutingStateFailed, RoutingStateNone, RoutingStateProvisioned, RoutingStateProvisioning} -} - -// RuleCollectionType enumerates the values for rule collection type. -type RuleCollectionType string - -const ( - // RuleCollectionTypeFirewallPolicyFilterRuleCollection ... - RuleCollectionTypeFirewallPolicyFilterRuleCollection RuleCollectionType = "FirewallPolicyFilterRuleCollection" - // RuleCollectionTypeFirewallPolicyNatRuleCollection ... - RuleCollectionTypeFirewallPolicyNatRuleCollection RuleCollectionType = "FirewallPolicyNatRuleCollection" - // RuleCollectionTypeFirewallPolicyRuleCollection ... - RuleCollectionTypeFirewallPolicyRuleCollection RuleCollectionType = "FirewallPolicyRuleCollection" -) - -// PossibleRuleCollectionTypeValues returns an array of possible values for the RuleCollectionType const type. -func PossibleRuleCollectionTypeValues() []RuleCollectionType { - return []RuleCollectionType{RuleCollectionTypeFirewallPolicyFilterRuleCollection, RuleCollectionTypeFirewallPolicyNatRuleCollection, RuleCollectionTypeFirewallPolicyRuleCollection} -} - -// RuleType enumerates the values for rule type. -type RuleType string - -const ( - // RuleTypeApplicationRule ... - RuleTypeApplicationRule RuleType = "ApplicationRule" - // RuleTypeFirewallPolicyRule ... - RuleTypeFirewallPolicyRule RuleType = "FirewallPolicyRule" - // RuleTypeNatRule ... - RuleTypeNatRule RuleType = "NatRule" - // RuleTypeNetworkRule ... - RuleTypeNetworkRule RuleType = "NetworkRule" -) - -// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. -func PossibleRuleTypeValues() []RuleType { - return []RuleType{RuleTypeApplicationRule, RuleTypeFirewallPolicyRule, RuleTypeNatRule, RuleTypeNetworkRule} -} - -// ScopeConnectionState enumerates the values for scope connection state. -type ScopeConnectionState string - -const ( - // ScopeConnectionStateConflict ... - ScopeConnectionStateConflict ScopeConnectionState = "Conflict" - // ScopeConnectionStateConnected ... - ScopeConnectionStateConnected ScopeConnectionState = "Connected" - // ScopeConnectionStatePending ... - ScopeConnectionStatePending ScopeConnectionState = "Pending" - // ScopeConnectionStateRejected ... - ScopeConnectionStateRejected ScopeConnectionState = "Rejected" - // ScopeConnectionStateRevoked ... - ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" -) - -// PossibleScopeConnectionStateValues returns an array of possible values for the ScopeConnectionState const type. -func PossibleScopeConnectionStateValues() []ScopeConnectionState { - return []ScopeConnectionState{ScopeConnectionStateConflict, ScopeConnectionStateConnected, ScopeConnectionStatePending, ScopeConnectionStateRejected, ScopeConnectionStateRevoked} -} - -// SecurityConfigurationRuleAccess enumerates the values for security configuration rule access. -type SecurityConfigurationRuleAccess string - -const ( - // SecurityConfigurationRuleAccessAllow ... - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" - // SecurityConfigurationRuleAccessAlwaysAllow ... - SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - // SecurityConfigurationRuleAccessDeny ... - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" -) - -// PossibleSecurityConfigurationRuleAccessValues returns an array of possible values for the SecurityConfigurationRuleAccess const type. -func PossibleSecurityConfigurationRuleAccessValues() []SecurityConfigurationRuleAccess { - return []SecurityConfigurationRuleAccess{SecurityConfigurationRuleAccessAllow, SecurityConfigurationRuleAccessAlwaysAllow, SecurityConfigurationRuleAccessDeny} -} - -// SecurityConfigurationRuleDirection enumerates the values for security configuration rule direction. -type SecurityConfigurationRuleDirection string - -const ( - // SecurityConfigurationRuleDirectionInbound ... - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" - // SecurityConfigurationRuleDirectionOutbound ... - SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" -) - -// PossibleSecurityConfigurationRuleDirectionValues returns an array of possible values for the SecurityConfigurationRuleDirection const type. -func PossibleSecurityConfigurationRuleDirectionValues() []SecurityConfigurationRuleDirection { - return []SecurityConfigurationRuleDirection{SecurityConfigurationRuleDirectionInbound, SecurityConfigurationRuleDirectionOutbound} -} - -// SecurityConfigurationRuleProtocol enumerates the values for security configuration rule protocol. -type SecurityConfigurationRuleProtocol string - -const ( - // SecurityConfigurationRuleProtocolAh ... - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - // SecurityConfigurationRuleProtocolAny ... - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - // SecurityConfigurationRuleProtocolEsp ... - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" - // SecurityConfigurationRuleProtocolIcmp ... - SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - // SecurityConfigurationRuleProtocolTCP ... - SecurityConfigurationRuleProtocolTCP SecurityConfigurationRuleProtocol = "Tcp" - // SecurityConfigurationRuleProtocolUDP ... - SecurityConfigurationRuleProtocolUDP SecurityConfigurationRuleProtocol = "Udp" -) - -// PossibleSecurityConfigurationRuleProtocolValues returns an array of possible values for the SecurityConfigurationRuleProtocol const type. -func PossibleSecurityConfigurationRuleProtocolValues() []SecurityConfigurationRuleProtocol { - return []SecurityConfigurationRuleProtocol{SecurityConfigurationRuleProtocolAh, SecurityConfigurationRuleProtocolAny, SecurityConfigurationRuleProtocolEsp, SecurityConfigurationRuleProtocolIcmp, SecurityConfigurationRuleProtocolTCP, SecurityConfigurationRuleProtocolUDP} -} - -// SecurityPartnerProviderConnectionStatus enumerates the values for security partner provider connection -// status. -type SecurityPartnerProviderConnectionStatus string - -const ( - // SecurityPartnerProviderConnectionStatusConnected ... - SecurityPartnerProviderConnectionStatusConnected SecurityPartnerProviderConnectionStatus = "Connected" - // SecurityPartnerProviderConnectionStatusNotConnected ... - SecurityPartnerProviderConnectionStatusNotConnected SecurityPartnerProviderConnectionStatus = "NotConnected" - // SecurityPartnerProviderConnectionStatusPartiallyConnected ... - SecurityPartnerProviderConnectionStatusPartiallyConnected SecurityPartnerProviderConnectionStatus = "PartiallyConnected" - // SecurityPartnerProviderConnectionStatusUnknown ... - SecurityPartnerProviderConnectionStatusUnknown SecurityPartnerProviderConnectionStatus = "Unknown" -) - -// PossibleSecurityPartnerProviderConnectionStatusValues returns an array of possible values for the SecurityPartnerProviderConnectionStatus const type. -func PossibleSecurityPartnerProviderConnectionStatusValues() []SecurityPartnerProviderConnectionStatus { - return []SecurityPartnerProviderConnectionStatus{SecurityPartnerProviderConnectionStatusConnected, SecurityPartnerProviderConnectionStatusNotConnected, SecurityPartnerProviderConnectionStatusPartiallyConnected, SecurityPartnerProviderConnectionStatusUnknown} -} - -// SecurityProviderName enumerates the values for security provider name. -type SecurityProviderName string - -const ( - // Checkpoint ... - Checkpoint SecurityProviderName = "Checkpoint" - // IBoss ... - IBoss SecurityProviderName = "IBoss" - // ZScaler ... - ZScaler SecurityProviderName = "ZScaler" -) - -// PossibleSecurityProviderNameValues returns an array of possible values for the SecurityProviderName const type. -func PossibleSecurityProviderNameValues() []SecurityProviderName { - return []SecurityProviderName{Checkpoint, IBoss, ZScaler} -} - -// SecurityRuleAccess enumerates the values for security rule access. -type SecurityRuleAccess string - -const ( - // SecurityRuleAccessAllow ... - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - // SecurityRuleAccessDeny ... - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -// PossibleSecurityRuleAccessValues returns an array of possible values for the SecurityRuleAccess const type. -func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { - return []SecurityRuleAccess{SecurityRuleAccessAllow, SecurityRuleAccessDeny} -} - -// SecurityRuleDirection enumerates the values for security rule direction. -type SecurityRuleDirection string - -const ( - // SecurityRuleDirectionInbound ... - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - // SecurityRuleDirectionOutbound ... - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -// PossibleSecurityRuleDirectionValues returns an array of possible values for the SecurityRuleDirection const type. -func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { - return []SecurityRuleDirection{SecurityRuleDirectionInbound, SecurityRuleDirectionOutbound} -} - -// SecurityRuleProtocol enumerates the values for security rule protocol. -type SecurityRuleProtocol string - -const ( - // SecurityRuleProtocolAh ... - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - // SecurityRuleProtocolAsterisk ... - SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" - // SecurityRuleProtocolEsp ... - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - // SecurityRuleProtocolIcmp ... - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - // SecurityRuleProtocolTCP ... - SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" - // SecurityRuleProtocolUDP ... - SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" -) - -// PossibleSecurityRuleProtocolValues returns an array of possible values for the SecurityRuleProtocol const type. -func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { - return []SecurityRuleProtocol{SecurityRuleProtocolAh, SecurityRuleProtocolAsterisk, SecurityRuleProtocolEsp, SecurityRuleProtocolIcmp, SecurityRuleProtocolTCP, SecurityRuleProtocolUDP} -} - -// ServiceProviderProvisioningState enumerates the values for service provider provisioning state. -type ServiceProviderProvisioningState string - -const ( - // ServiceProviderProvisioningStateDeprovisioning ... - ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" - // ServiceProviderProvisioningStateNotProvisioned ... - ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - // ServiceProviderProvisioningStateProvisioned ... - ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" - // ServiceProviderProvisioningStateProvisioning ... - ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" -) - -// PossibleServiceProviderProvisioningStateValues returns an array of possible values for the ServiceProviderProvisioningState const type. -func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { - return []ServiceProviderProvisioningState{ServiceProviderProvisioningStateDeprovisioning, ServiceProviderProvisioningStateNotProvisioned, ServiceProviderProvisioningStateProvisioned, ServiceProviderProvisioningStateProvisioning} -} - -// Severity enumerates the values for severity. -type Severity string - -const ( - // SeverityError ... - SeverityError Severity = "Error" - // SeverityWarning ... - SeverityWarning Severity = "Warning" -) - -// PossibleSeverityValues returns an array of possible values for the Severity const type. -func PossibleSeverityValues() []Severity { - return []Severity{SeverityError, SeverityWarning} -} - -// SlotType enumerates the values for slot type. -type SlotType string - -const ( - // Production ... - Production SlotType = "Production" - // Staging ... - Staging SlotType = "Staging" -) - -// PossibleSlotTypeValues returns an array of possible values for the SlotType const type. -func PossibleSlotTypeValues() []SlotType { - return []SlotType{Production, Staging} -} - -// SyncRemoteAddressSpace enumerates the values for sync remote address space. -type SyncRemoteAddressSpace string - -const ( - // SyncRemoteAddressSpaceTrue ... - SyncRemoteAddressSpaceTrue SyncRemoteAddressSpace = "true" -) - -// PossibleSyncRemoteAddressSpaceValues returns an array of possible values for the SyncRemoteAddressSpace const type. -func PossibleSyncRemoteAddressSpaceValues() []SyncRemoteAddressSpace { - return []SyncRemoteAddressSpace{SyncRemoteAddressSpaceTrue} -} - -// TransportProtocol enumerates the values for transport protocol. -type TransportProtocol string - -const ( - // TransportProtocolAll ... - TransportProtocolAll TransportProtocol = "All" - // TransportProtocolTCP ... - TransportProtocolTCP TransportProtocol = "Tcp" - // TransportProtocolUDP ... - TransportProtocolUDP TransportProtocol = "Udp" -) - -// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. -func PossibleTransportProtocolValues() []TransportProtocol { - return []TransportProtocol{TransportProtocolAll, TransportProtocolTCP, TransportProtocolUDP} -} - -// TunnelConnectionStatus enumerates the values for tunnel connection status. -type TunnelConnectionStatus string - -const ( - // TunnelConnectionStatusConnected ... - TunnelConnectionStatusConnected TunnelConnectionStatus = "Connected" - // TunnelConnectionStatusConnecting ... - TunnelConnectionStatusConnecting TunnelConnectionStatus = "Connecting" - // TunnelConnectionStatusNotConnected ... - TunnelConnectionStatusNotConnected TunnelConnectionStatus = "NotConnected" - // TunnelConnectionStatusUnknown ... - TunnelConnectionStatusUnknown TunnelConnectionStatus = "Unknown" -) - -// PossibleTunnelConnectionStatusValues returns an array of possible values for the TunnelConnectionStatus const type. -func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { - return []TunnelConnectionStatus{TunnelConnectionStatusConnected, TunnelConnectionStatusConnecting, TunnelConnectionStatusNotConnected, TunnelConnectionStatusUnknown} -} - -// UseHubGateway enumerates the values for use hub gateway. -type UseHubGateway string - -const ( - // UseHubGatewayFalse ... - UseHubGatewayFalse UseHubGateway = "False" - // UseHubGatewayTrue ... - UseHubGatewayTrue UseHubGateway = "True" -) - -// PossibleUseHubGatewayValues returns an array of possible values for the UseHubGateway const type. -func PossibleUseHubGatewayValues() []UseHubGateway { - return []UseHubGateway{UseHubGatewayFalse, UseHubGatewayTrue} -} - -// VerbosityLevel enumerates the values for verbosity level. -type VerbosityLevel string - -const ( - // VerbosityLevelFull ... - VerbosityLevelFull VerbosityLevel = "Full" - // VerbosityLevelMinimum ... - VerbosityLevelMinimum VerbosityLevel = "Minimum" - // VerbosityLevelNormal ... - VerbosityLevelNormal VerbosityLevel = "Normal" -) - -// PossibleVerbosityLevelValues returns an array of possible values for the VerbosityLevel const type. -func PossibleVerbosityLevelValues() []VerbosityLevel { - return []VerbosityLevel{VerbosityLevelFull, VerbosityLevelMinimum, VerbosityLevelNormal} -} - -// VirtualNetworkEncryptionEnforcement enumerates the values for virtual network encryption enforcement. -type VirtualNetworkEncryptionEnforcement string - -const ( - // AllowUnencrypted ... - AllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - // DropUnencrypted ... - DropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" -) - -// PossibleVirtualNetworkEncryptionEnforcementValues returns an array of possible values for the VirtualNetworkEncryptionEnforcement const type. -func PossibleVirtualNetworkEncryptionEnforcementValues() []VirtualNetworkEncryptionEnforcement { - return []VirtualNetworkEncryptionEnforcement{AllowUnencrypted, DropUnencrypted} -} - -// VirtualNetworkGatewayConnectionMode enumerates the values for virtual network gateway connection mode. -type VirtualNetworkGatewayConnectionMode string - -const ( - // VirtualNetworkGatewayConnectionModeDefault ... - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" - // VirtualNetworkGatewayConnectionModeInitiatorOnly ... - VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" - // VirtualNetworkGatewayConnectionModeResponderOnly ... - VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" -) - -// PossibleVirtualNetworkGatewayConnectionModeValues returns an array of possible values for the VirtualNetworkGatewayConnectionMode const type. -func PossibleVirtualNetworkGatewayConnectionModeValues() []VirtualNetworkGatewayConnectionMode { - return []VirtualNetworkGatewayConnectionMode{VirtualNetworkGatewayConnectionModeDefault, VirtualNetworkGatewayConnectionModeInitiatorOnly, VirtualNetworkGatewayConnectionModeResponderOnly} -} - -// VirtualNetworkGatewayConnectionProtocol enumerates the values for virtual network gateway connection -// protocol. -type VirtualNetworkGatewayConnectionProtocol string - -const ( - // IKEv1 ... - IKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" - // IKEv2 ... - IKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -// PossibleVirtualNetworkGatewayConnectionProtocolValues returns an array of possible values for the VirtualNetworkGatewayConnectionProtocol const type. -func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { - return []VirtualNetworkGatewayConnectionProtocol{IKEv1, IKEv2} -} - -// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. -type VirtualNetworkGatewayConnectionStatus string - -const ( - // VirtualNetworkGatewayConnectionStatusConnected ... - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - // VirtualNetworkGatewayConnectionStatusConnecting ... - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - // VirtualNetworkGatewayConnectionStatusNotConnected ... - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - // VirtualNetworkGatewayConnectionStatusUnknown ... - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -// PossibleVirtualNetworkGatewayConnectionStatusValues returns an array of possible values for the VirtualNetworkGatewayConnectionStatus const type. -func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { - return []VirtualNetworkGatewayConnectionStatus{VirtualNetworkGatewayConnectionStatusConnected, VirtualNetworkGatewayConnectionStatusConnecting, VirtualNetworkGatewayConnectionStatusNotConnected, VirtualNetworkGatewayConnectionStatusUnknown} -} - -// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. -type VirtualNetworkGatewayConnectionType string - -const ( - // ExpressRoute ... - ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - // IPsec ... - IPsec VirtualNetworkGatewayConnectionType = "IPsec" - // Vnet2Vnet ... - Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" - // VPNClient ... - VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" -) - -// PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. -func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { - return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} -} - -// VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. -type VirtualNetworkGatewaySkuName string - -const ( - // VirtualNetworkGatewaySkuNameBasic ... - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - // VirtualNetworkGatewaySkuNameErGw1AZ ... - VirtualNetworkGatewaySkuNameErGw1AZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - // VirtualNetworkGatewaySkuNameErGw2AZ ... - VirtualNetworkGatewaySkuNameErGw2AZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - // VirtualNetworkGatewaySkuNameErGw3AZ ... - VirtualNetworkGatewaySkuNameErGw3AZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - // VirtualNetworkGatewaySkuNameHighPerformance ... - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - // VirtualNetworkGatewaySkuNameStandard ... - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - // VirtualNetworkGatewaySkuNameUltraPerformance ... - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - // VirtualNetworkGatewaySkuNameVpnGw1 ... - VirtualNetworkGatewaySkuNameVpnGw1 VirtualNetworkGatewaySkuName = "VpnGw1" - // VirtualNetworkGatewaySkuNameVpnGw1AZ ... - VirtualNetworkGatewaySkuNameVpnGw1AZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - // VirtualNetworkGatewaySkuNameVpnGw2 ... - VirtualNetworkGatewaySkuNameVpnGw2 VirtualNetworkGatewaySkuName = "VpnGw2" - // VirtualNetworkGatewaySkuNameVpnGw2AZ ... - VirtualNetworkGatewaySkuNameVpnGw2AZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" - // VirtualNetworkGatewaySkuNameVpnGw3 ... - VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" - // VirtualNetworkGatewaySkuNameVpnGw3AZ ... - VirtualNetworkGatewaySkuNameVpnGw3AZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" - // VirtualNetworkGatewaySkuNameVpnGw4 ... - VirtualNetworkGatewaySkuNameVpnGw4 VirtualNetworkGatewaySkuName = "VpnGw4" - // VirtualNetworkGatewaySkuNameVpnGw4AZ ... - VirtualNetworkGatewaySkuNameVpnGw4AZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" - // VirtualNetworkGatewaySkuNameVpnGw5 ... - VirtualNetworkGatewaySkuNameVpnGw5 VirtualNetworkGatewaySkuName = "VpnGw5" - // VirtualNetworkGatewaySkuNameVpnGw5AZ ... - VirtualNetworkGatewaySkuNameVpnGw5AZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" -) - -// PossibleVirtualNetworkGatewaySkuNameValues returns an array of possible values for the VirtualNetworkGatewaySkuName const type. -func PossibleVirtualNetworkGatewaySkuNameValues() []VirtualNetworkGatewaySkuName { - return []VirtualNetworkGatewaySkuName{VirtualNetworkGatewaySkuNameBasic, VirtualNetworkGatewaySkuNameErGw1AZ, VirtualNetworkGatewaySkuNameErGw2AZ, VirtualNetworkGatewaySkuNameErGw3AZ, VirtualNetworkGatewaySkuNameHighPerformance, VirtualNetworkGatewaySkuNameStandard, VirtualNetworkGatewaySkuNameUltraPerformance, VirtualNetworkGatewaySkuNameVpnGw1, VirtualNetworkGatewaySkuNameVpnGw1AZ, VirtualNetworkGatewaySkuNameVpnGw2, VirtualNetworkGatewaySkuNameVpnGw2AZ, VirtualNetworkGatewaySkuNameVpnGw3, VirtualNetworkGatewaySkuNameVpnGw3AZ, VirtualNetworkGatewaySkuNameVpnGw4, VirtualNetworkGatewaySkuNameVpnGw4AZ, VirtualNetworkGatewaySkuNameVpnGw5, VirtualNetworkGatewaySkuNameVpnGw5AZ} -} - -// VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. -type VirtualNetworkGatewaySkuTier string - -const ( - // VirtualNetworkGatewaySkuTierBasic ... - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - // VirtualNetworkGatewaySkuTierErGw1AZ ... - VirtualNetworkGatewaySkuTierErGw1AZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - // VirtualNetworkGatewaySkuTierErGw2AZ ... - VirtualNetworkGatewaySkuTierErGw2AZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - // VirtualNetworkGatewaySkuTierErGw3AZ ... - VirtualNetworkGatewaySkuTierErGw3AZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - // VirtualNetworkGatewaySkuTierHighPerformance ... - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - // VirtualNetworkGatewaySkuTierStandard ... - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - // VirtualNetworkGatewaySkuTierUltraPerformance ... - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - // VirtualNetworkGatewaySkuTierVpnGw1 ... - VirtualNetworkGatewaySkuTierVpnGw1 VirtualNetworkGatewaySkuTier = "VpnGw1" - // VirtualNetworkGatewaySkuTierVpnGw1AZ ... - VirtualNetworkGatewaySkuTierVpnGw1AZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - // VirtualNetworkGatewaySkuTierVpnGw2 ... - VirtualNetworkGatewaySkuTierVpnGw2 VirtualNetworkGatewaySkuTier = "VpnGw2" - // VirtualNetworkGatewaySkuTierVpnGw2AZ ... - VirtualNetworkGatewaySkuTierVpnGw2AZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" - // VirtualNetworkGatewaySkuTierVpnGw3 ... - VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" - // VirtualNetworkGatewaySkuTierVpnGw3AZ ... - VirtualNetworkGatewaySkuTierVpnGw3AZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" - // VirtualNetworkGatewaySkuTierVpnGw4 ... - VirtualNetworkGatewaySkuTierVpnGw4 VirtualNetworkGatewaySkuTier = "VpnGw4" - // VirtualNetworkGatewaySkuTierVpnGw4AZ ... - VirtualNetworkGatewaySkuTierVpnGw4AZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" - // VirtualNetworkGatewaySkuTierVpnGw5 ... - VirtualNetworkGatewaySkuTierVpnGw5 VirtualNetworkGatewaySkuTier = "VpnGw5" - // VirtualNetworkGatewaySkuTierVpnGw5AZ ... - VirtualNetworkGatewaySkuTierVpnGw5AZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" -) - -// PossibleVirtualNetworkGatewaySkuTierValues returns an array of possible values for the VirtualNetworkGatewaySkuTier const type. -func PossibleVirtualNetworkGatewaySkuTierValues() []VirtualNetworkGatewaySkuTier { - return []VirtualNetworkGatewaySkuTier{VirtualNetworkGatewaySkuTierBasic, VirtualNetworkGatewaySkuTierErGw1AZ, VirtualNetworkGatewaySkuTierErGw2AZ, VirtualNetworkGatewaySkuTierErGw3AZ, VirtualNetworkGatewaySkuTierHighPerformance, VirtualNetworkGatewaySkuTierStandard, VirtualNetworkGatewaySkuTierUltraPerformance, VirtualNetworkGatewaySkuTierVpnGw1, VirtualNetworkGatewaySkuTierVpnGw1AZ, VirtualNetworkGatewaySkuTierVpnGw2, VirtualNetworkGatewaySkuTierVpnGw2AZ, VirtualNetworkGatewaySkuTierVpnGw3, VirtualNetworkGatewaySkuTierVpnGw3AZ, VirtualNetworkGatewaySkuTierVpnGw4, VirtualNetworkGatewaySkuTierVpnGw4AZ, VirtualNetworkGatewaySkuTierVpnGw5, VirtualNetworkGatewaySkuTierVpnGw5AZ} -} - -// VirtualNetworkGatewayType enumerates the values for virtual network gateway type. -type VirtualNetworkGatewayType string - -const ( - // VirtualNetworkGatewayTypeExpressRoute ... - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - // VirtualNetworkGatewayTypeLocalGateway ... - VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - // VirtualNetworkGatewayTypeVpn ... - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -// PossibleVirtualNetworkGatewayTypeValues returns an array of possible values for the VirtualNetworkGatewayType const type. -func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { - return []VirtualNetworkGatewayType{VirtualNetworkGatewayTypeExpressRoute, VirtualNetworkGatewayTypeLocalGateway, VirtualNetworkGatewayTypeVpn} -} - -// VirtualNetworkPeeringLevel enumerates the values for virtual network peering level. -type VirtualNetworkPeeringLevel string - -const ( - // FullyInSync ... - FullyInSync VirtualNetworkPeeringLevel = "FullyInSync" - // LocalAndRemoteNotInSync ... - LocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - // LocalNotInSync ... - LocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - // RemoteNotInSync ... - RemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" -) - -// PossibleVirtualNetworkPeeringLevelValues returns an array of possible values for the VirtualNetworkPeeringLevel const type. -func PossibleVirtualNetworkPeeringLevelValues() []VirtualNetworkPeeringLevel { - return []VirtualNetworkPeeringLevel{FullyInSync, LocalAndRemoteNotInSync, LocalNotInSync, RemoteNotInSync} -} - -// VirtualNetworkPeeringState enumerates the values for virtual network peering state. -type VirtualNetworkPeeringState string - -const ( - // VirtualNetworkPeeringStateConnected ... - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - // VirtualNetworkPeeringStateDisconnected ... - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - // VirtualNetworkPeeringStateInitiated ... - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -// PossibleVirtualNetworkPeeringStateValues returns an array of possible values for the VirtualNetworkPeeringState const type. -func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { - return []VirtualNetworkPeeringState{VirtualNetworkPeeringStateConnected, VirtualNetworkPeeringStateDisconnected, VirtualNetworkPeeringStateInitiated} -} - -// VirtualNetworkPrivateEndpointNetworkPolicies enumerates the values for virtual network private endpoint -// network policies. -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - // VirtualNetworkPrivateEndpointNetworkPoliciesDisabled ... - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - // VirtualNetworkPrivateEndpointNetworkPoliciesEnabled ... - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -// PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues returns an array of possible values for the VirtualNetworkPrivateEndpointNetworkPolicies const type. -func PossibleVirtualNetworkPrivateEndpointNetworkPoliciesValues() []VirtualNetworkPrivateEndpointNetworkPolicies { - return []VirtualNetworkPrivateEndpointNetworkPolicies{VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, VirtualNetworkPrivateEndpointNetworkPoliciesEnabled} -} - -// VirtualNetworkPrivateLinkServiceNetworkPolicies enumerates the values for virtual network private link -// service network policies. -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - // VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled ... - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - // VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled ... - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -// PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues returns an array of possible values for the VirtualNetworkPrivateLinkServiceNetworkPolicies const type. -func PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues() []VirtualNetworkPrivateLinkServiceNetworkPolicies { - return []VirtualNetworkPrivateLinkServiceNetworkPolicies{VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled} -} - -// VirtualWanSecurityProviderType enumerates the values for virtual wan security provider type. -type VirtualWanSecurityProviderType string - -const ( - // External ... - External VirtualWanSecurityProviderType = "External" - // Native ... - Native VirtualWanSecurityProviderType = "Native" -) - -// PossibleVirtualWanSecurityProviderTypeValues returns an array of possible values for the VirtualWanSecurityProviderType const type. -func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { - return []VirtualWanSecurityProviderType{External, Native} -} - -// VnetLocalRouteOverrideCriteria enumerates the values for vnet local route override criteria. -type VnetLocalRouteOverrideCriteria string - -const ( - // VnetLocalRouteOverrideCriteriaContains ... - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - // VnetLocalRouteOverrideCriteriaEqual ... - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -// PossibleVnetLocalRouteOverrideCriteriaValues returns an array of possible values for the VnetLocalRouteOverrideCriteria const type. -func PossibleVnetLocalRouteOverrideCriteriaValues() []VnetLocalRouteOverrideCriteria { - return []VnetLocalRouteOverrideCriteria{VnetLocalRouteOverrideCriteriaContains, VnetLocalRouteOverrideCriteriaEqual} -} - -// VpnAuthenticationType enumerates the values for vpn authentication type. -type VpnAuthenticationType string - -const ( - // AAD ... - AAD VpnAuthenticationType = "AAD" - // Certificate ... - Certificate VpnAuthenticationType = "Certificate" - // Radius ... - Radius VpnAuthenticationType = "Radius" -) - -// PossibleVpnAuthenticationTypeValues returns an array of possible values for the VpnAuthenticationType const type. -func PossibleVpnAuthenticationTypeValues() []VpnAuthenticationType { - return []VpnAuthenticationType{AAD, Certificate, Radius} -} - -// VpnClientProtocol enumerates the values for vpn client protocol. -type VpnClientProtocol string - -const ( - // IkeV2 ... - IkeV2 VpnClientProtocol = "IkeV2" - // OpenVPN ... - OpenVPN VpnClientProtocol = "OpenVPN" - // SSTP ... - SSTP VpnClientProtocol = "SSTP" -) - -// PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. -func PossibleVpnClientProtocolValues() []VpnClientProtocol { - return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} -} - -// VpnConnectionStatus enumerates the values for vpn connection status. -type VpnConnectionStatus string - -const ( - // VpnConnectionStatusConnected ... - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - // VpnConnectionStatusConnecting ... - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - // VpnConnectionStatusNotConnected ... - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - // VpnConnectionStatusUnknown ... - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -// PossibleVpnConnectionStatusValues returns an array of possible values for the VpnConnectionStatus const type. -func PossibleVpnConnectionStatusValues() []VpnConnectionStatus { - return []VpnConnectionStatus{VpnConnectionStatusConnected, VpnConnectionStatusConnecting, VpnConnectionStatusNotConnected, VpnConnectionStatusUnknown} -} - -// VpnGatewayGeneration enumerates the values for vpn gateway generation. -type VpnGatewayGeneration string - -const ( - // VpnGatewayGenerationGeneration1 ... - VpnGatewayGenerationGeneration1 VpnGatewayGeneration = "Generation1" - // VpnGatewayGenerationGeneration2 ... - VpnGatewayGenerationGeneration2 VpnGatewayGeneration = "Generation2" - // VpnGatewayGenerationNone ... - VpnGatewayGenerationNone VpnGatewayGeneration = "None" -) - -// PossibleVpnGatewayGenerationValues returns an array of possible values for the VpnGatewayGeneration const type. -func PossibleVpnGatewayGenerationValues() []VpnGatewayGeneration { - return []VpnGatewayGeneration{VpnGatewayGenerationGeneration1, VpnGatewayGenerationGeneration2, VpnGatewayGenerationNone} -} - -// VpnGatewayTunnelingProtocol enumerates the values for vpn gateway tunneling protocol. -type VpnGatewayTunnelingProtocol string - -const ( - // VpnGatewayTunnelingProtocolIkeV2 ... - VpnGatewayTunnelingProtocolIkeV2 VpnGatewayTunnelingProtocol = "IkeV2" - // VpnGatewayTunnelingProtocolOpenVPN ... - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -// PossibleVpnGatewayTunnelingProtocolValues returns an array of possible values for the VpnGatewayTunnelingProtocol const type. -func PossibleVpnGatewayTunnelingProtocolValues() []VpnGatewayTunnelingProtocol { - return []VpnGatewayTunnelingProtocol{VpnGatewayTunnelingProtocolIkeV2, VpnGatewayTunnelingProtocolOpenVPN} -} - -// VpnLinkConnectionMode enumerates the values for vpn link connection mode. -type VpnLinkConnectionMode string - -const ( - // VpnLinkConnectionModeDefault ... - VpnLinkConnectionModeDefault VpnLinkConnectionMode = "Default" - // VpnLinkConnectionModeInitiatorOnly ... - VpnLinkConnectionModeInitiatorOnly VpnLinkConnectionMode = "InitiatorOnly" - // VpnLinkConnectionModeResponderOnly ... - VpnLinkConnectionModeResponderOnly VpnLinkConnectionMode = "ResponderOnly" -) - -// PossibleVpnLinkConnectionModeValues returns an array of possible values for the VpnLinkConnectionMode const type. -func PossibleVpnLinkConnectionModeValues() []VpnLinkConnectionMode { - return []VpnLinkConnectionMode{VpnLinkConnectionModeDefault, VpnLinkConnectionModeInitiatorOnly, VpnLinkConnectionModeResponderOnly} -} - -// VpnNatRuleMode enumerates the values for vpn nat rule mode. -type VpnNatRuleMode string - -const ( - // EgressSnat ... - EgressSnat VpnNatRuleMode = "EgressSnat" - // IngressSnat ... - IngressSnat VpnNatRuleMode = "IngressSnat" -) - -// PossibleVpnNatRuleModeValues returns an array of possible values for the VpnNatRuleMode const type. -func PossibleVpnNatRuleModeValues() []VpnNatRuleMode { - return []VpnNatRuleMode{EgressSnat, IngressSnat} -} - -// VpnNatRuleType enumerates the values for vpn nat rule type. -type VpnNatRuleType string - -const ( - // VpnNatRuleTypeDynamic ... - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - // VpnNatRuleTypeStatic ... - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -// PossibleVpnNatRuleTypeValues returns an array of possible values for the VpnNatRuleType const type. -func PossibleVpnNatRuleTypeValues() []VpnNatRuleType { - return []VpnNatRuleType{VpnNatRuleTypeDynamic, VpnNatRuleTypeStatic} -} - -// VpnPolicyMemberAttributeType enumerates the values for vpn policy member attribute type. -type VpnPolicyMemberAttributeType string - -const ( - // AADGroupID ... - AADGroupID VpnPolicyMemberAttributeType = "AADGroupId" - // CertificateGroupID ... - CertificateGroupID VpnPolicyMemberAttributeType = "CertificateGroupId" - // RadiusAzureGroupID ... - RadiusAzureGroupID VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -// PossibleVpnPolicyMemberAttributeTypeValues returns an array of possible values for the VpnPolicyMemberAttributeType const type. -func PossibleVpnPolicyMemberAttributeTypeValues() []VpnPolicyMemberAttributeType { - return []VpnPolicyMemberAttributeType{AADGroupID, CertificateGroupID, RadiusAzureGroupID} -} - -// VpnType enumerates the values for vpn type. -type VpnType string - -const ( - // PolicyBased ... - PolicyBased VpnType = "PolicyBased" - // RouteBased ... - RouteBased VpnType = "RouteBased" -) - -// PossibleVpnTypeValues returns an array of possible values for the VpnType const type. -func PossibleVpnTypeValues() []VpnType { - return []VpnType{PolicyBased, RouteBased} -} - -// WebApplicationFirewallAction enumerates the values for web application firewall action. -type WebApplicationFirewallAction string - -const ( - // WebApplicationFirewallActionAllow ... - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - // WebApplicationFirewallActionBlock ... - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - // WebApplicationFirewallActionLog ... - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" -) - -// PossibleWebApplicationFirewallActionValues returns an array of possible values for the WebApplicationFirewallAction const type. -func PossibleWebApplicationFirewallActionValues() []WebApplicationFirewallAction { - return []WebApplicationFirewallAction{WebApplicationFirewallActionAllow, WebApplicationFirewallActionBlock, WebApplicationFirewallActionLog} -} - -// WebApplicationFirewallEnabledState enumerates the values for web application firewall enabled state. -type WebApplicationFirewallEnabledState string - -const ( - // WebApplicationFirewallEnabledStateDisabled ... - WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - // WebApplicationFirewallEnabledStateEnabled ... - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" -) - -// PossibleWebApplicationFirewallEnabledStateValues returns an array of possible values for the WebApplicationFirewallEnabledState const type. -func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewallEnabledState { - return []WebApplicationFirewallEnabledState{WebApplicationFirewallEnabledStateDisabled, WebApplicationFirewallEnabledStateEnabled} -} - -// WebApplicationFirewallMatchVariable enumerates the values for web application firewall match variable. -type WebApplicationFirewallMatchVariable string - -const ( - // PostArgs ... - PostArgs WebApplicationFirewallMatchVariable = "PostArgs" - // QueryString ... - QueryString WebApplicationFirewallMatchVariable = "QueryString" - // RemoteAddr ... - RemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - // RequestBody ... - RequestBody WebApplicationFirewallMatchVariable = "RequestBody" - // RequestCookies ... - RequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - // RequestHeaders ... - RequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - // RequestMethod ... - RequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - // RequestURI ... - RequestURI WebApplicationFirewallMatchVariable = "RequestUri" -) - -// PossibleWebApplicationFirewallMatchVariableValues returns an array of possible values for the WebApplicationFirewallMatchVariable const type. -func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { - return []WebApplicationFirewallMatchVariable{PostArgs, QueryString, RemoteAddr, RequestBody, RequestCookies, RequestHeaders, RequestMethod, RequestURI} -} - -// WebApplicationFirewallMode enumerates the values for web application firewall mode. -type WebApplicationFirewallMode string - -const ( - // WebApplicationFirewallModeDetection ... - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" - // WebApplicationFirewallModePrevention ... - WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" -) - -// PossibleWebApplicationFirewallModeValues returns an array of possible values for the WebApplicationFirewallMode const type. -func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { - return []WebApplicationFirewallMode{WebApplicationFirewallModeDetection, WebApplicationFirewallModePrevention} -} - -// WebApplicationFirewallOperator enumerates the values for web application firewall operator. -type WebApplicationFirewallOperator string - -const ( - // WebApplicationFirewallOperatorAny ... - WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" - // WebApplicationFirewallOperatorBeginsWith ... - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - // WebApplicationFirewallOperatorContains ... - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - // WebApplicationFirewallOperatorEndsWith ... - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - // WebApplicationFirewallOperatorEqual ... - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - // WebApplicationFirewallOperatorGeoMatch ... - WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" - // WebApplicationFirewallOperatorGreaterThan ... - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" - // WebApplicationFirewallOperatorGreaterThanOrEqual ... - WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - // WebApplicationFirewallOperatorIPMatch ... - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - // WebApplicationFirewallOperatorLessThan ... - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - // WebApplicationFirewallOperatorLessThanOrEqual ... - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - // WebApplicationFirewallOperatorRegex ... - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" -) - -// PossibleWebApplicationFirewallOperatorValues returns an array of possible values for the WebApplicationFirewallOperator const type. -func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { - return []WebApplicationFirewallOperator{WebApplicationFirewallOperatorAny, WebApplicationFirewallOperatorBeginsWith, WebApplicationFirewallOperatorContains, WebApplicationFirewallOperatorEndsWith, WebApplicationFirewallOperatorEqual, WebApplicationFirewallOperatorGeoMatch, WebApplicationFirewallOperatorGreaterThan, WebApplicationFirewallOperatorGreaterThanOrEqual, WebApplicationFirewallOperatorIPMatch, WebApplicationFirewallOperatorLessThan, WebApplicationFirewallOperatorLessThanOrEqual, WebApplicationFirewallOperatorRegex} -} - -// WebApplicationFirewallPolicyResourceState enumerates the values for web application firewall policy resource -// state. -type WebApplicationFirewallPolicyResourceState string - -const ( - // WebApplicationFirewallPolicyResourceStateCreating ... - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - // WebApplicationFirewallPolicyResourceStateDeleting ... - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - // WebApplicationFirewallPolicyResourceStateDisabled ... - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" - // WebApplicationFirewallPolicyResourceStateDisabling ... - WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - // WebApplicationFirewallPolicyResourceStateEnabled ... - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - // WebApplicationFirewallPolicyResourceStateEnabling ... - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" -) - -// PossibleWebApplicationFirewallPolicyResourceStateValues returns an array of possible values for the WebApplicationFirewallPolicyResourceState const type. -func PossibleWebApplicationFirewallPolicyResourceStateValues() []WebApplicationFirewallPolicyResourceState { - return []WebApplicationFirewallPolicyResourceState{WebApplicationFirewallPolicyResourceStateCreating, WebApplicationFirewallPolicyResourceStateDeleting, WebApplicationFirewallPolicyResourceStateDisabled, WebApplicationFirewallPolicyResourceStateDisabling, WebApplicationFirewallPolicyResourceStateEnabled, WebApplicationFirewallPolicyResourceStateEnabling} -} - -// WebApplicationFirewallRuleType enumerates the values for web application firewall rule type. -type WebApplicationFirewallRuleType string - -const ( - // WebApplicationFirewallRuleTypeInvalid ... - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - // WebApplicationFirewallRuleTypeMatchRule ... - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" -) - -// PossibleWebApplicationFirewallRuleTypeValues returns an array of possible values for the WebApplicationFirewallRuleType const type. -func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRuleType { - return []WebApplicationFirewallRuleType{WebApplicationFirewallRuleTypeInvalid, WebApplicationFirewallRuleTypeMatchRule} -} - -// WebApplicationFirewallTransform enumerates the values for web application firewall transform. -type WebApplicationFirewallTransform string - -const ( - // HTMLEntityDecode ... - HTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - // Lowercase ... - Lowercase WebApplicationFirewallTransform = "Lowercase" - // RemoveNulls ... - RemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - // Trim ... - Trim WebApplicationFirewallTransform = "Trim" - // Uppercase ... - Uppercase WebApplicationFirewallTransform = "Uppercase" - // URLDecode ... - URLDecode WebApplicationFirewallTransform = "UrlDecode" - // URLEncode ... - URLEncode WebApplicationFirewallTransform = "UrlEncode" -) - -// PossibleWebApplicationFirewallTransformValues returns an array of possible values for the WebApplicationFirewallTransform const type. -func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { - return []WebApplicationFirewallTransform{HTMLEntityDecode, Lowercase, RemoveNulls, Trim, Uppercase, URLDecode, URLEncode} -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitauthorizations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitauthorizations.go deleted file mode 100644 index 41fdb499084d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitauthorizations.go +++ /dev/null @@ -1,396 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCircuitAuthorizationsClient is the network Client -type ExpressRouteCircuitAuthorizationsClient struct { - BaseClient -} - -// NewExpressRouteCircuitAuthorizationsClient creates an instance of the ExpressRouteCircuitAuthorizationsClient -// client. -func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string) ExpressRouteCircuitAuthorizationsClient { - return NewExpressRouteCircuitAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCircuitAuthorizationsClientWithBaseURI creates an instance of the -// ExpressRouteCircuitAuthorizationsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitAuthorizationsClient { - return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an authorization in the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// authorizationName - the name of the authorization. -// authorizationParameters - parameters supplied to the create or update express route circuit authorization -// operation. -func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (result ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - authorizationParameters.Etag = nil - authorizationParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters), - autorest.WithJSON(authorizationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified authorization from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// authorizationName - the name of the authorization. -func (client ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorizationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, authorizationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitAuthorizationsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitAuthorizationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified authorization from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// authorizationName - the name of the authorization. -func (client ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, authorizationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitAuthorizationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitAuthorization, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all authorizations in an express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -func (client ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, resourceGroupName string, circuitName string) (result AuthorizationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.List") - defer func() { - sc := -1 - if result.alr.Response.Response != nil { - sc = result.alr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.alr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure sending request") - return - } - - result.alr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "List", resp, "Failure responding to request") - return - } - if result.alr.hasNextLink() && result.alr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitAuthorizationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitAuthorizationsClient) ListResponder(resp *http.Response) (result AuthorizationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitAuthorizationsClient) listNextResults(ctx context.Context, lastResults AuthorizationListResult) (result AuthorizationListResult, err error) { - req, err := lastResults.authorizationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitAuthorizationsClient) ListComplete(ctx context.Context, resourceGroupName string, circuitName string) (result AuthorizationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitAuthorizationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, circuitName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitconnections.go deleted file mode 100644 index e9f8625d96b1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitconnections.go +++ /dev/null @@ -1,403 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCircuitConnectionsClient is the network Client -type ExpressRouteCircuitConnectionsClient struct { - BaseClient -} - -// NewExpressRouteCircuitConnectionsClient creates an instance of the ExpressRouteCircuitConnectionsClient client. -func NewExpressRouteCircuitConnectionsClient(subscriptionID string) ExpressRouteCircuitConnectionsClient { - return NewExpressRouteCircuitConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCircuitConnectionsClientWithBaseURI creates an instance of the ExpressRouteCircuitConnectionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewExpressRouteCircuitConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitConnectionsClient { - return ExpressRouteCircuitConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a Express Route Circuit Connection in the specified express route circuits. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// connectionName - the name of the express route circuit connection. -// expressRouteCircuitConnectionParameters - parameters supplied to the create or update express route circuit -// connection operation. -func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection) (result ExpressRouteCircuitConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, peeringName, connectionName, expressRouteCircuitConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string, expressRouteCircuitConnectionParameters ExpressRouteCircuitConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "connectionName": autorest.Encode("path", connectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - expressRouteCircuitConnectionParameters.Etag = nil - expressRouteCircuitConnectionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", pathParameters), - autorest.WithJSON(expressRouteCircuitConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Express Route Circuit Connection from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// connectionName - the name of the express route circuit connection. -func (client ExpressRouteCircuitConnectionsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (result ExpressRouteCircuitConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, peeringName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCircuitConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "connectionName": autorest.Encode("path", connectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitConnectionsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitConnectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Express Route Circuit Connection from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// connectionName - the name of the express route circuit connection. -func (client ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (result ExpressRouteCircuitConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, peeringName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "connectionName": autorest.Encode("path", connectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all global reach connections associated with a private peering in an express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -// peeringName - the name of the peering. -func (client ExpressRouteCircuitConnectionsClient) List(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.List") - defer func() { - sc := -1 - if result.ercclr.Response.Response != nil { - sc = result.ercclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ercclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.ercclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCircuitConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitConnectionsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCircuitConnectionListResult) (result ExpressRouteCircuitConnectionListResult, err error) { - req, err := lastResults.expressRouteCircuitConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, circuitName, peeringName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitpeerings.go deleted file mode 100644 index 8e3012a16698..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitpeerings.go +++ /dev/null @@ -1,406 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCircuitPeeringsClient is the network Client -type ExpressRouteCircuitPeeringsClient struct { - BaseClient -} - -// NewExpressRouteCircuitPeeringsClient creates an instance of the ExpressRouteCircuitPeeringsClient client. -func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient { - return NewExpressRouteCircuitPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCircuitPeeringsClientWithBaseURI creates an instance of the ExpressRouteCircuitPeeringsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitPeeringsClient { - return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a peering in the specified express route circuits. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// peeringParameters - parameters supplied to the create or update express route circuit peering operation. -func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering) (result ExpressRouteCircuitPeeringsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: peeringParameters, - Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, peeringName, peeringParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - peeringParameters.Etag = nil - peeringParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters), - autorest.WithJSON(peeringParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitPeeringsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified peering from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -func (client ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeeringsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitPeeringsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitPeeringsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified peering for the express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -func (client ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCircuitPeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitPeeringsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuitPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all peerings in a specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -func (client ExpressRouteCircuitPeeringsClient) List(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.List") - defer func() { - sc := -1 - if result.ercplr.Response.Response != nil { - sc = result.ercplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ercplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure sending request") - return - } - - result.ercplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "List", resp, "Failure responding to request") - return - } - if result.ercplr.hasNextLink() && result.ercplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCircuitPeeringsClient) ListPreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitPeeringsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitPeeringsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitPeeringListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitPeeringsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCircuitPeeringListResult) (result ExpressRouteCircuitPeeringListResult, err error) { - req, err := lastResults.expressRouteCircuitPeeringListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitPeeringsClient) ListComplete(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, circuitName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuits.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuits.go deleted file mode 100644 index 6bf7737c2cd5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuits.go +++ /dev/null @@ -1,982 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCircuitsClient is the network Client -type ExpressRouteCircuitsClient struct { - BaseClient -} - -// NewExpressRouteCircuitsClient creates an instance of the ExpressRouteCircuitsClient client. -func NewExpressRouteCircuitsClient(subscriptionID string) ExpressRouteCircuitsClient { - return NewExpressRouteCircuitsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCircuitsClientWithBaseURI creates an instance of the ExpressRouteCircuitsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewExpressRouteCircuitsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitsClient { - return ExpressRouteCircuitsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -// parameters - parameters supplied to the create or update express route circuit operation. -func (client ExpressRouteCircuitsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit) (result ExpressRouteCircuitsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -func (client ExpressRouteCircuitsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCircuitsClient) DeletePreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of express route circuit. -func (client ExpressRouteCircuitsClient) Get(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuit, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCircuitsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPeeringStats gets all stats from an express route circuit in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -func (client ExpressRouteCircuitsClient) GetPeeringStats(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.GetPeeringStats") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPeeringStatsPreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", nil, "Failure preparing request") - return - } - - resp, err := client.GetPeeringStatsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure sending request") - return - } - - result, err = client.GetPeeringStatsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure responding to request") - return - } - - return -} - -// GetPeeringStatsPreparer prepares the GetPeeringStats request. -func (client ExpressRouteCircuitsClient) GetPeeringStatsPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPeeringStatsSender sends the GetPeeringStats request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) GetPeeringStatsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetPeeringStatsResponder handles the response to the GetPeeringStats request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetStats gets all the stats from an express route circuit in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -func (client ExpressRouteCircuitsClient) GetStats(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.GetStats") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetStatsPreparer(ctx, resourceGroupName, circuitName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", nil, "Failure preparing request") - return - } - - resp, err := client.GetStatsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure sending request") - return - } - - result, err = client.GetStatsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure responding to request") - return - } - - return -} - -// GetStatsPreparer prepares the GetStats request. -func (client ExpressRouteCircuitsClient) GetStatsPreparer(ctx context.Context, resourceGroupName string, circuitName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetStatsSender sends the GetStats request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) GetStatsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetStatsResponder handles the response to the GetStats request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the express route circuits in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ExpressRouteCircuitsClient) List(ctx context.Context, resourceGroupName string) (result ExpressRouteCircuitListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.List") - defer func() { - sc := -1 - if result.erclr.Response.Response != nil { - sc = result.erclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure sending request") - return - } - - result.erclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "List", resp, "Failure responding to request") - return - } - if result.erclr.hasNextLink() && result.erclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCircuitsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListResponder(resp *http.Response) (result ExpressRouteCircuitListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, err error) { - req, err := lastResults.expressRouteCircuitListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitsClient) ListComplete(ctx context.Context, resourceGroupName string) (result ExpressRouteCircuitListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the express route circuits in a subscription. -func (client ExpressRouteCircuitsClient) ListAll(ctx context.Context) (result ExpressRouteCircuitListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListAll") - defer func() { - sc := -1 - if result.erclr.Response.Response != nil { - sc = result.erclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.erclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure sending request") - return - } - - result.erclr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.erclr.hasNextLink() && result.erclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client ExpressRouteCircuitsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListAllResponder(resp *http.Response) (result ExpressRouteCircuitListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client ExpressRouteCircuitsClient) listAllNextResults(ctx context.Context, lastResults ExpressRouteCircuitListResult) (result ExpressRouteCircuitListResult, err error) { - req, err := lastResults.expressRouteCircuitListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCircuitsClient) ListAllComplete(ctx context.Context) (result ExpressRouteCircuitListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListArpTable gets the currently advertised ARP table associated with the express route circuit in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCircuitsClient) ListArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListArpTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListArpTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListArpTablePreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", nil, "Failure preparing request") - return - } - - result, err = client.ListArpTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", result.Response(), "Failure sending request") - return - } - - return -} - -// ListArpTablePreparer prepares the ListArpTable request. -func (client ExpressRouteCircuitsClient) ListArpTablePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListArpTableSender sends the ListArpTable request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListArpTableSender(req *http.Request) (future ExpressRouteCircuitsListArpTableFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListArpTableResponder handles the response to the ListArpTable request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListRoutesTable gets the currently advertised routes table associated with the express route circuit in a resource -// group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCircuitsClient) ListRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListRoutesTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListRoutesTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListRoutesTablePreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", nil, "Failure preparing request") - return - } - - result, err = client.ListRoutesTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", result.Response(), "Failure sending request") - return - } - - return -} - -// ListRoutesTablePreparer prepares the ListRoutesTable request. -func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRoutesTableSender sends the ListRoutesTable request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListRoutesTableSender(req *http.Request) (future ExpressRouteCircuitsListRoutesTableFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListRoutesTableResponder handles the response to the ListRoutesTable request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListRoutesTableSummary gets the currently advertised routes table summary associated with the express route circuit -// in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListRoutesTableSummaryFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.ListRoutesTableSummary") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListRoutesTableSummaryPreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", nil, "Failure preparing request") - return - } - - result, err = client.ListRoutesTableSummarySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", result.Response(), "Failure sending request") - return - } - - return -} - -// ListRoutesTableSummaryPreparer prepares the ListRoutesTableSummary request. -func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRoutesTableSummarySender sends the ListRoutesTableSummary request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) ListRoutesTableSummarySender(req *http.Request) (future ExpressRouteCircuitsListRoutesTableSummaryFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListRoutesTableSummaryResponder handles the response to the ListRoutesTableSummary request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates an express route circuit tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -// parameters - parameters supplied to update express route circuit tags. -func (client ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject) (result ExpressRouteCircuit, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, circuitName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ExpressRouteCircuitsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCircuitsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ExpressRouteCircuitsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteCircuit, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteconnections.go deleted file mode 100644 index d033ecb9b85b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteconnections.go +++ /dev/null @@ -1,359 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteConnectionsClient is the network Client -type ExpressRouteConnectionsClient struct { - BaseClient -} - -// NewExpressRouteConnectionsClient creates an instance of the ExpressRouteConnectionsClient client. -func NewExpressRouteConnectionsClient(subscriptionID string) ExpressRouteConnectionsClient { - return NewExpressRouteConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteConnectionsClientWithBaseURI creates an instance of the ExpressRouteConnectionsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewExpressRouteConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteConnectionsClient { - return ExpressRouteConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a connection between an ExpressRoute gateway and an ExpressRoute circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -// connectionName - the name of the connection subresource. -// putExpressRouteConnectionParameters - parameters required in an ExpressRouteConnection PUT operation. -func (client ExpressRouteConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection) (result ExpressRouteConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: putExpressRouteConnectionParameters, - Constraints: []validation.Constraint{{Target: "putExpressRouteConnectionParameters.ExpressRouteConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "putExpressRouteConnectionParameters.ExpressRouteConnectionProperties.ExpressRouteCircuitPeering", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "putExpressRouteConnectionParameters.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.ExpressRouteConnectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRouteGatewayName, connectionName, putExpressRouteConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string, putExpressRouteConnectionParameters ExpressRouteConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", pathParameters), - autorest.WithJSON(putExpressRouteConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteConnectionsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a connection to a ExpressRoute circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -// connectionName - the name of the connection subresource. -func (client ExpressRouteConnectionsClient) Delete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string) (result ExpressRouteConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, expressRouteGatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteConnectionsClient) DeleteSender(req *http.Request) (future ExpressRouteConnectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified ExpressRouteConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -// connectionName - the name of the ExpressRoute connection. -func (client ExpressRouteConnectionsClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string) (result ExpressRouteConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRouteGatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists ExpressRouteConnections. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -func (client ExpressRouteConnectionsClient) List(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (result ExpressRouteConnectionList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteConnectionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, expressRouteGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}/expressRouteConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteConnectionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnectionpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnectionpeerings.go deleted file mode 100644 index ad4b71bd4e6b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnectionpeerings.go +++ /dev/null @@ -1,407 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCrossConnectionPeeringsClient is the network Client -type ExpressRouteCrossConnectionPeeringsClient struct { - BaseClient -} - -// NewExpressRouteCrossConnectionPeeringsClient creates an instance of the ExpressRouteCrossConnectionPeeringsClient -// client. -func NewExpressRouteCrossConnectionPeeringsClient(subscriptionID string) ExpressRouteCrossConnectionPeeringsClient { - return NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCrossConnectionPeeringsClientWithBaseURI creates an instance of the -// ExpressRouteCrossConnectionPeeringsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCrossConnectionPeeringsClient { - return ExpressRouteCrossConnectionPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a peering in the specified ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -// peeringParameters - parameters supplied to the create or update ExpressRouteCrossConnection peering -// operation. -func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering) (result ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: peeringParameters, - Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "peeringParameters.ExpressRouteCrossConnectionPeeringProperties.PeerASN", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.ExpressRouteCrossConnectionPeeringsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, crossConnectionName, peeringName, peeringParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, peeringParameters ExpressRouteCrossConnectionPeering) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - peeringParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", pathParameters), - autorest.WithJSON(peeringParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified peering from the ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -func (client ExpressRouteCrossConnectionPeeringsClient) Delete(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string) (result ExpressRouteCrossConnectionPeeringsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, crossConnectionName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteCrossConnectionPeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionPeeringsClient) DeleteSender(req *http.Request) (future ExpressRouteCrossConnectionPeeringsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified peering for the ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -func (client ExpressRouteCrossConnectionPeeringsClient) Get(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string) (result ExpressRouteCrossConnectionPeering, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, crossConnectionName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCrossConnectionPeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionPeeringsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionPeeringsClient) GetResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all peerings in a specified ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -func (client ExpressRouteCrossConnectionPeeringsClient) List(ctx context.Context, resourceGroupName string, crossConnectionName string) (result ExpressRouteCrossConnectionPeeringListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.List") - defer func() { - sc := -1 - if result.erccpl.Response.Response != nil { - sc = result.erccpl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, crossConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erccpl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "List", resp, "Failure sending request") - return - } - - result.erccpl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "List", resp, "Failure responding to request") - return - } - if result.erccpl.hasNextLink() && result.erccpl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCrossConnectionPeeringsClient) ListPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionPeeringsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionPeeringsClient) ListResponder(resp *http.Response) (result ExpressRouteCrossConnectionPeeringList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCrossConnectionPeeringsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCrossConnectionPeeringList) (result ExpressRouteCrossConnectionPeeringList, err error) { - req, err := lastResults.expressRouteCrossConnectionPeeringListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCrossConnectionPeeringsClient) ListComplete(ctx context.Context, resourceGroupName string, crossConnectionName string) (result ExpressRouteCrossConnectionPeeringListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, crossConnectionName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnections.go deleted file mode 100644 index 2db798b88830..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnections.go +++ /dev/null @@ -1,751 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteCrossConnectionsClient is the network Client -type ExpressRouteCrossConnectionsClient struct { - BaseClient -} - -// NewExpressRouteCrossConnectionsClient creates an instance of the ExpressRouteCrossConnectionsClient client. -func NewExpressRouteCrossConnectionsClient(subscriptionID string) ExpressRouteCrossConnectionsClient { - return NewExpressRouteCrossConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteCrossConnectionsClientWithBaseURI creates an instance of the ExpressRouteCrossConnectionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewExpressRouteCrossConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCrossConnectionsClient { - return ExpressRouteCrossConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate update the specified ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// parameters - parameters supplied to the update express route crossConnection operation. -func (client ExpressRouteCrossConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection) (result ExpressRouteCrossConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, crossConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteCrossConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, parameters ExpressRouteCrossConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCrossConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets details about the specified ExpressRouteCrossConnection. -// Parameters: -// resourceGroupName - the name of the resource group (peering location of the circuit). -// crossConnectionName - the name of the ExpressRouteCrossConnection (service key of the circuit). -func (client ExpressRouteCrossConnectionsClient) Get(ctx context.Context, resourceGroupName string, crossConnectionName string) (result ExpressRouteCrossConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, crossConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteCrossConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) GetResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves all the ExpressRouteCrossConnections in a subscription. -func (client ExpressRouteCrossConnectionsClient) List(ctx context.Context) (result ExpressRouteCrossConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.List") - defer func() { - sc := -1 - if result.ercclr.Response.Response != nil { - sc = result.ercclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ercclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.ercclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteCrossConnectionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCrossConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListResponder(resp *http.Response) (result ExpressRouteCrossConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteCrossConnectionsClient) listNextResults(ctx context.Context, lastResults ExpressRouteCrossConnectionListResult) (result ExpressRouteCrossConnectionListResult, err error) { - req, err := lastResults.expressRouteCrossConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCrossConnectionsClient) ListComplete(ctx context.Context) (result ExpressRouteCrossConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListArpTable gets the currently advertised ARP table associated with the express route cross connection in a -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCrossConnectionsClient) ListArpTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (result ExpressRouteCrossConnectionsListArpTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListArpTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListArpTablePreparer(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListArpTable", nil, "Failure preparing request") - return - } - - result, err = client.ListArpTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListArpTable", result.Response(), "Failure sending request") - return - } - - return -} - -// ListArpTablePreparer prepares the ListArpTable request. -func (client ExpressRouteCrossConnectionsClient) ListArpTablePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/arpTables/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListArpTableSender sends the ListArpTable request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListArpTableSender(req *http.Request) (future ExpressRouteCrossConnectionsListArpTableFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListArpTableResponder handles the response to the ListArpTable request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup retrieves all the ExpressRouteCrossConnections in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ExpressRouteCrossConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ercclr.Response.Response != nil { - sc = result.ercclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ercclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ercclr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ercclr.hasNextLink() && result.ercclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteCrossConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ExpressRouteCrossConnectionsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ExpressRouteCrossConnectionListResult) (result ExpressRouteCrossConnectionListResult, err error) { - req, err := lastResults.expressRouteCrossConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ExpressRouteCrossConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListRoutesTable gets the currently advertised routes table associated with the express route cross connection in a -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTable(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (result ExpressRouteCrossConnectionsListRoutesTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListRoutesTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListRoutesTablePreparer(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTable", nil, "Failure preparing request") - return - } - - result, err = client.ListRoutesTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTable", result.Response(), "Failure sending request") - return - } - - return -} - -// ListRoutesTablePreparer prepares the ListRoutesTable request. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTablePreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTables/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRoutesTableSender sends the ListRoutesTable request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSender(req *http.Request) (future ExpressRouteCrossConnectionsListRoutesTableFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListRoutesTableResponder handles the response to the ListRoutesTable request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListRoutesTableSummary gets the route table summary associated with the express route cross connection in a resource -// group. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the ExpressRouteCrossConnection. -// peeringName - the name of the peering. -// devicePath - the path of the device. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummary(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (result ExpressRouteCrossConnectionsListRoutesTableSummaryFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.ListRoutesTableSummary") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListRoutesTableSummaryPreparer(ctx, resourceGroupName, crossConnectionName, peeringName, devicePath) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTableSummary", nil, "Failure preparing request") - return - } - - result, err = client.ListRoutesTableSummarySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "ListRoutesTableSummary", result.Response(), "Failure sending request") - return - } - - return -} - -// ListRoutesTableSummaryPreparer prepares the ListRoutesTableSummary request. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, peeringName string, devicePath string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "devicePath": autorest.Encode("path", devicePath), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}/peerings/{peeringName}/routeTablesSummary/{devicePath}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListRoutesTableSummarySender sends the ListRoutesTableSummary request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummarySender(req *http.Request) (future ExpressRouteCrossConnectionsListRoutesTableSummaryFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListRoutesTableSummaryResponder handles the response to the ListRoutesTableSummary request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates an express route cross connection tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// crossConnectionName - the name of the cross connection. -// crossConnectionParameters - parameters supplied to update express route cross connection tags. -func (client ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject) (result ExpressRouteCrossConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, crossConnectionName, crossConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ExpressRouteCrossConnectionsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, crossConnectionName string, crossConnectionParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "crossConnectionName": autorest.Encode("path", crossConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCrossConnections/{crossConnectionName}", pathParameters), - autorest.WithJSON(crossConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteCrossConnectionsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ExpressRouteCrossConnectionsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteCrossConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutegateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutegateways.go deleted file mode 100644 index d321a2940098..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutegateways.go +++ /dev/null @@ -1,505 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteGatewaysClient is the network Client -type ExpressRouteGatewaysClient struct { - BaseClient -} - -// NewExpressRouteGatewaysClient creates an instance of the ExpressRouteGatewaysClient client. -func NewExpressRouteGatewaysClient(subscriptionID string) ExpressRouteGatewaysClient { - return NewExpressRouteGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteGatewaysClientWithBaseURI creates an instance of the ExpressRouteGatewaysClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewExpressRouteGatewaysClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteGatewaysClient { - return ExpressRouteGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a ExpressRoute gateway in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -// putExpressRouteGatewayParameters - parameters required in an ExpressRoute gateway PUT operation. -func (client ExpressRouteGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway) (result ExpressRouteGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: putExpressRouteGatewayParameters, - Constraints: []validation.Constraint{{Target: "putExpressRouteGatewayParameters.ExpressRouteGatewayProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "putExpressRouteGatewayParameters.ExpressRouteGatewayProperties.VirtualHub", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("network.ExpressRouteGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRouteGatewayName, putExpressRouteGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRouteGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, putExpressRouteGatewayParameters ExpressRouteGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - putExpressRouteGatewayParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters), - autorest.WithJSON(putExpressRouteGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRouteGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified ExpressRoute gateway in a resource group. An ExpressRoute gateway resource can only be -// deleted when there are no connection subresources. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -func (client ExpressRouteGatewaysClient) Delete(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (result ExpressRouteGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, expressRouteGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRouteGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) DeleteSender(req *http.Request) (future ExpressRouteGatewaysDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get fetches the details of a ExpressRoute gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRouteGatewayName - the name of the ExpressRoute gateway. -func (client ExpressRouteGatewaysClient) Get(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (result ExpressRouteGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRouteGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) GetResponder(resp *http.Response) (result ExpressRouteGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists ExpressRoute gateways in a given resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ExpressRouteGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ExpressRouteGatewayList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ExpressRouteGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySubscription lists ExpressRoute gateways under a given subscription. -func (client ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context) (result ExpressRouteGatewayList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "ListBySubscription", resp, "Failure responding to request") - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ExpressRouteGatewaysClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) ListBySubscriptionResponder(resp *http.Response) (result ExpressRouteGatewayList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates express route gateway tags. -// Parameters: -// resourceGroupName - the resource group name of the ExpressRouteGateway. -// expressRouteGatewayName - the name of the gateway. -// expressRouteGatewayParameters - parameters supplied to update a virtual wan express route gateway tags. -func (client ExpressRouteGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject) (result ExpressRouteGatewaysUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, expressRouteGatewayName, expressRouteGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ExpressRouteGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, expressRouteGatewayName string, expressRouteGatewayParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRouteGatewayName": autorest.Encode("path", expressRouteGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteGateways/{expressRouteGatewayName}", pathParameters), - autorest.WithJSON(expressRouteGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteGatewaysClient) UpdateTagsSender(req *http.Request) (future ExpressRouteGatewaysUpdateTagsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ExpressRouteGatewaysClient) UpdateTagsResponder(resp *http.Response) (result ExpressRouteGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutelinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutelinks.go deleted file mode 100644 index 04657f3a8ea7..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutelinks.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteLinksClient is the network Client -type ExpressRouteLinksClient struct { - BaseClient -} - -// NewExpressRouteLinksClient creates an instance of the ExpressRouteLinksClient client. -func NewExpressRouteLinksClient(subscriptionID string) ExpressRouteLinksClient { - return NewExpressRouteLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteLinksClientWithBaseURI creates an instance of the ExpressRouteLinksClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewExpressRouteLinksClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteLinksClient { - return ExpressRouteLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves the specified ExpressRouteLink resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -// linkName - the name of the ExpressRouteLink resource. -func (client ExpressRouteLinksClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string) (result ExpressRouteLink, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRoutePortName, linkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRouteLinksClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, linkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "linkName": autorest.Encode("path", linkName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links/{linkName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteLinksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRouteLinksClient) GetResponder(resp *http.Response) (result ExpressRouteLink, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieve the ExpressRouteLink sub-resources of the specified ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -func (client ExpressRouteLinksClient) List(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRouteLinkListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinksClient.List") - defer func() { - sc := -1 - if result.erllr.Response.Response != nil { - sc = result.erllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, expressRoutePortName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "List", resp, "Failure sending request") - return - } - - result.erllr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "List", resp, "Failure responding to request") - return - } - if result.erllr.hasNextLink() && result.erllr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteLinksClient) ListPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}/links", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteLinksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteLinksClient) ListResponder(resp *http.Response) (result ExpressRouteLinkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteLinksClient) listNextResults(ctx context.Context, lastResults ExpressRouteLinkListResult) (result ExpressRouteLinkListResult, err error) { - req, err := lastResults.expressRouteLinkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteLinksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteLinksClient) ListComplete(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRouteLinkListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinksClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, expressRoutePortName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportauthorizations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportauthorizations.go deleted file mode 100644 index 401e7cba6922..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportauthorizations.go +++ /dev/null @@ -1,395 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRoutePortAuthorizationsClient is the network Client -type ExpressRoutePortAuthorizationsClient struct { - BaseClient -} - -// NewExpressRoutePortAuthorizationsClient creates an instance of the ExpressRoutePortAuthorizationsClient client. -func NewExpressRoutePortAuthorizationsClient(subscriptionID string) ExpressRoutePortAuthorizationsClient { - return NewExpressRoutePortAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRoutePortAuthorizationsClientWithBaseURI creates an instance of the ExpressRoutePortAuthorizationsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewExpressRoutePortAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRoutePortAuthorizationsClient { - return ExpressRoutePortAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an authorization in the specified express route port. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the express route port. -// authorizationName - the name of the authorization. -// authorizationParameters - parameters supplied to the create or update express route port authorization -// operation. -func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization) (result ExpressRoutePortAuthorizationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRoutePortName, authorizationName, authorizationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string, authorizationParameters ExpressRoutePortAuthorization) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - authorizationParameters.Etag = nil - authorizationParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", pathParameters), - autorest.WithJSON(authorizationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRoutePortAuthorizationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRoutePortAuthorization, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified authorization from the specified express route port. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the express route port. -// authorizationName - the name of the authorization. -func (client ExpressRoutePortAuthorizationsClient) Delete(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string) (result ExpressRoutePortAuthorizationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, expressRoutePortName, authorizationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRoutePortAuthorizationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortAuthorizationsClient) DeleteSender(req *http.Request) (future ExpressRoutePortAuthorizationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortAuthorizationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified authorization from the specified express route port. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the express route port. -// authorizationName - the name of the authorization. -func (client ExpressRoutePortAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string) (result ExpressRoutePortAuthorization, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRoutePortName, authorizationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRoutePortAuthorizationsClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, authorizationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "authorizationName": autorest.Encode("path", authorizationName), - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations/{authorizationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortAuthorizationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortAuthorizationsClient) GetResponder(resp *http.Response) (result ExpressRoutePortAuthorization, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all authorizations in an express route port. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the express route port. -func (client ExpressRoutePortAuthorizationsClient) List(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRoutePortAuthorizationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.List") - defer func() { - sc := -1 - if result.erpalr.Response.Response != nil { - sc = result.erpalr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, expressRoutePortName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erpalr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "List", resp, "Failure sending request") - return - } - - result.erpalr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "List", resp, "Failure responding to request") - return - } - if result.erpalr.hasNextLink() && result.erpalr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRoutePortAuthorizationsClient) ListPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/authorizations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortAuthorizationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortAuthorizationsClient) ListResponder(resp *http.Response) (result ExpressRoutePortAuthorizationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRoutePortAuthorizationsClient) listNextResults(ctx context.Context, lastResults ExpressRoutePortAuthorizationListResult) (result ExpressRoutePortAuthorizationListResult, err error) { - req, err := lastResults.expressRoutePortAuthorizationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRoutePortAuthorizationsClient) ListComplete(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRoutePortAuthorizationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, expressRoutePortName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteports.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteports.go deleted file mode 100644 index d722d3ad13aa..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteports.go +++ /dev/null @@ -1,663 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRoutePortsClient is the network Client -type ExpressRoutePortsClient struct { - BaseClient -} - -// NewExpressRoutePortsClient creates an instance of the ExpressRoutePortsClient client. -func NewExpressRoutePortsClient(subscriptionID string) ExpressRoutePortsClient { - return NewExpressRoutePortsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRoutePortsClientWithBaseURI creates an instance of the ExpressRoutePortsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewExpressRoutePortsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRoutePortsClient { - return ExpressRoutePortsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -// parameters - parameters supplied to the create ExpressRoutePort operation. -func (client ExpressRoutePortsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort) (result ExpressRoutePortsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, expressRoutePortName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ExpressRoutePortsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters ExpressRoutePort) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRoutePortsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) CreateOrUpdateResponder(resp *http.Response) (result ExpressRoutePort, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -func (client ExpressRoutePortsClient) Delete(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRoutePortsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, expressRoutePortName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ExpressRoutePortsClient) DeletePreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) DeleteSender(req *http.Request) (future ExpressRoutePortsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// GenerateLOA generate a letter of authorization for the requested ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of ExpressRoutePort. -// request - request parameters supplied to generate a letter of authorization. -func (client ExpressRoutePortsClient) GenerateLOA(ctx context.Context, resourceGroupName string, expressRoutePortName string, request GenerateExpressRoutePortsLOARequest) (result GenerateExpressRoutePortsLOAResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.GenerateLOA") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: request, - Constraints: []validation.Constraint{{Target: "request.CustomerName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.ExpressRoutePortsClient", "GenerateLOA", err.Error()) - } - - req, err := client.GenerateLOAPreparer(ctx, resourceGroupName, expressRoutePortName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "GenerateLOA", nil, "Failure preparing request") - return - } - - resp, err := client.GenerateLOASender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "GenerateLOA", resp, "Failure sending request") - return - } - - result, err = client.GenerateLOAResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "GenerateLOA", resp, "Failure responding to request") - return - } - - return -} - -// GenerateLOAPreparer prepares the GenerateLOA request. -func (client ExpressRoutePortsClient) GenerateLOAPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, request GenerateExpressRoutePortsLOARequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRoutePorts/{expressRoutePortName}/generateLoa", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateLOASender sends the GenerateLOA request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) GenerateLOASender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GenerateLOAResponder handles the response to the GenerateLOA request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) GenerateLOAResponder(resp *http.Response) (result GenerateExpressRoutePortsLOAResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieves the requested ExpressRoutePort resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of ExpressRoutePort. -func (client ExpressRoutePortsClient) Get(ctx context.Context, resourceGroupName string, expressRoutePortName string) (result ExpressRoutePort, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, expressRoutePortName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRoutePortsClient) GetPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) GetResponder(resp *http.Response) (result ExpressRoutePort, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all the ExpressRoutePort resources in the specified subscription. -func (client ExpressRoutePortsClient) List(ctx context.Context) (result ExpressRoutePortListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.List") - defer func() { - sc := -1 - if result.erplr.Response.Response != nil { - sc = result.erplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "List", resp, "Failure sending request") - return - } - - result.erplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "List", resp, "Failure responding to request") - return - } - if result.erplr.hasNextLink() && result.erplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRoutePortsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePorts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) ListResponder(resp *http.Response) (result ExpressRoutePortListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRoutePortsClient) listNextResults(ctx context.Context, lastResults ExpressRoutePortListResult) (result ExpressRoutePortListResult, err error) { - req, err := lastResults.expressRoutePortListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRoutePortsClient) ListComplete(ctx context.Context) (result ExpressRoutePortListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup list all the ExpressRoutePort resources in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ExpressRoutePortsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ExpressRoutePortListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.erplr.Response.Response != nil { - sc = result.erplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.erplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.erplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.erplr.hasNextLink() && result.erplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ExpressRoutePortsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) ListByResourceGroupResponder(resp *http.Response) (result ExpressRoutePortListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ExpressRoutePortsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ExpressRoutePortListResult) (result ExpressRoutePortListResult, err error) { - req, err := lastResults.expressRoutePortListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRoutePortsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ExpressRoutePortListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags update ExpressRoutePort tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// expressRoutePortName - the name of the ExpressRoutePort resource. -// parameters - parameters supplied to update ExpressRoutePort resource tags. -func (client ExpressRoutePortsClient) UpdateTags(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject) (result ExpressRoutePort, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, expressRoutePortName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ExpressRoutePortsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, expressRoutePortName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "expressRoutePortName": autorest.Encode("path", expressRoutePortName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ExpressRoutePorts/{expressRoutePortName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsClient) UpdateTagsResponder(resp *http.Response) (result ExpressRoutePort, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportslocations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportslocations.go deleted file mode 100644 index 0fd21f2208c2..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportslocations.go +++ /dev/null @@ -1,221 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRoutePortsLocationsClient is the network Client -type ExpressRoutePortsLocationsClient struct { - BaseClient -} - -// NewExpressRoutePortsLocationsClient creates an instance of the ExpressRoutePortsLocationsClient client. -func NewExpressRoutePortsLocationsClient(subscriptionID string) ExpressRoutePortsLocationsClient { - return NewExpressRoutePortsLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRoutePortsLocationsClientWithBaseURI creates an instance of the ExpressRoutePortsLocationsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewExpressRoutePortsLocationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRoutePortsLocationsClient { - return ExpressRoutePortsLocationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves a single ExpressRoutePort peering location, including the list of available bandwidths available at -// said peering location. -// Parameters: -// locationName - name of the requested ExpressRoutePort peering location. -func (client ExpressRoutePortsLocationsClient) Get(ctx context.Context, locationName string) (result ExpressRoutePortsLocation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, locationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ExpressRoutePortsLocationsClient) GetPreparer(ctx context.Context, locationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "locationName": autorest.Encode("path", locationName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations/{locationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsLocationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsLocationsClient) GetResponder(resp *http.Response) (result ExpressRoutePortsLocation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves all ExpressRoutePort peering locations. Does not return available bandwidths for each location. -// Available bandwidths can only be obtained when retrieving a specific peering location. -func (client ExpressRoutePortsLocationsClient) List(ctx context.Context) (result ExpressRoutePortsLocationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationsClient.List") - defer func() { - sc := -1 - if result.erpllr.Response.Response != nil { - sc = result.erpllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.erpllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "List", resp, "Failure sending request") - return - } - - result.erpllr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "List", resp, "Failure responding to request") - return - } - if result.erpllr.hasNextLink() && result.erpllr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRoutePortsLocationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ExpressRoutePortsLocations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRoutePortsLocationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRoutePortsLocationsClient) ListResponder(resp *http.Response) (result ExpressRoutePortsLocationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRoutePortsLocationsClient) listNextResults(ctx context.Context, lastResults ExpressRoutePortsLocationListResult) (result ExpressRoutePortsLocationListResult, err error) { - req, err := lastResults.expressRoutePortsLocationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsLocationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRoutePortsLocationsClient) ListComplete(ctx context.Context) (result ExpressRoutePortsLocationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteproviderportslocation.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteproviderportslocation.go deleted file mode 100644 index c4671c00ae2b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteproviderportslocation.go +++ /dev/null @@ -1,109 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteProviderPortsLocationClient is the network Client -type ExpressRouteProviderPortsLocationClient struct { - BaseClient -} - -// NewExpressRouteProviderPortsLocationClient creates an instance of the ExpressRouteProviderPortsLocationClient -// client. -func NewExpressRouteProviderPortsLocationClient(subscriptionID string) ExpressRouteProviderPortsLocationClient { - return NewExpressRouteProviderPortsLocationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteProviderPortsLocationClientWithBaseURI creates an instance of the -// ExpressRouteProviderPortsLocationClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewExpressRouteProviderPortsLocationClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteProviderPortsLocationClient { - return ExpressRouteProviderPortsLocationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List retrieves all the ExpressRouteProviderPorts in a subscription. -// Parameters: -// filter - the filter to apply on the operation. For example, you can use $filter=location eq '{state}'. -func (client ExpressRouteProviderPortsLocationClient) List(ctx context.Context, filter string) (result ExpressRouteProviderPortListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteProviderPortsLocationClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteProviderPortsLocationClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteProviderPortsLocationClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteProviderPortsLocationClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteProviderPortsLocationClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteProviderPortsLocationClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteProviderPortsLocationClient) ListResponder(resp *http.Response) (result ExpressRouteProviderPortListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteserviceproviders.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteserviceproviders.go deleted file mode 100644 index b76714e641f8..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteserviceproviders.go +++ /dev/null @@ -1,145 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ExpressRouteServiceProvidersClient is the network Client -type ExpressRouteServiceProvidersClient struct { - BaseClient -} - -// NewExpressRouteServiceProvidersClient creates an instance of the ExpressRouteServiceProvidersClient client. -func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient { - return NewExpressRouteServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewExpressRouteServiceProvidersClientWithBaseURI creates an instance of the ExpressRouteServiceProvidersClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient { - return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets all the available express route service providers. -func (client ExpressRouteServiceProvidersClient) List(ctx context.Context) (result ExpressRouteServiceProviderListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProvidersClient.List") - defer func() { - sc := -1 - if result.ersplr.Response.Response != nil { - sc = result.ersplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ersplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure sending request") - return - } - - result.ersplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "List", resp, "Failure responding to request") - return - } - if result.ersplr.hasNextLink() && result.ersplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ExpressRouteServiceProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ExpressRouteServiceProvidersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ExpressRouteServiceProvidersClient) ListResponder(resp *http.Response) (result ExpressRouteServiceProviderListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ExpressRouteServiceProvidersClient) listNextResults(ctx context.Context, lastResults ExpressRouteServiceProviderListResult) (result ExpressRouteServiceProviderListResult, err error) { - req, err := lastResults.expressRouteServiceProviderListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteServiceProvidersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ExpressRouteServiceProvidersClient) ListComplete(ctx context.Context) (result ExpressRouteServiceProviderListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProvidersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicies.go deleted file mode 100644 index 44ec477c20bb..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicies.go +++ /dev/null @@ -1,603 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FirewallPoliciesClient is the network Client -type FirewallPoliciesClient struct { - BaseClient -} - -// NewFirewallPoliciesClient creates an instance of the FirewallPoliciesClient client. -func NewFirewallPoliciesClient(subscriptionID string) FirewallPoliciesClient { - return NewFirewallPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFirewallPoliciesClientWithBaseURI creates an instance of the FirewallPoliciesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewFirewallPoliciesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPoliciesClient { - return FirewallPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Firewall Policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// parameters - parameters supplied to the create or update Firewall Policy operation. -func (client FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy) (result FirewallPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPPort", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPPort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPPort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPSPort", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPSPort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPSPort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.PacFilePort", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.PacFilePort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.PacFilePort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.FirewallPoliciesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, firewallPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FirewallPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters FirewallPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) CreateOrUpdateSender(req *http.Request) (future FirewallPoliciesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Firewall Policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPoliciesClient) Delete(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FirewallPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) DeleteSender(req *http.Request) (future FirewallPoliciesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Firewall Policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// expand - expands referenced resources. -func (client FirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, expand string) (result FirewallPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, firewallPolicyName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client FirewallPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) GetResponder(resp *http.Response) (result FirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Firewall Policies in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client FirewallPoliciesClient) List(ctx context.Context, resourceGroupName string) (result FirewallPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.List") - defer func() { - sc := -1 - if result.fplr.Response.Response != nil { - sc = result.fplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.fplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", resp, "Failure sending request") - return - } - - result.fplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "List", resp, "Failure responding to request") - return - } - if result.fplr.hasNextLink() && result.fplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FirewallPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) ListResponder(resp *http.Response) (result FirewallPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client FirewallPoliciesClient) listNextResults(ctx context.Context, lastResults FirewallPolicyListResult) (result FirewallPolicyListResult, err error) { - req, err := lastResults.firewallPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client FirewallPoliciesClient) ListComplete(ctx context.Context, resourceGroupName string) (result FirewallPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the Firewall Policies in a subscription. -func (client FirewallPoliciesClient) ListAll(ctx context.Context) (result FirewallPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.ListAll") - defer func() { - sc := -1 - if result.fplr.Response.Response != nil { - sc = result.fplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.fplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", resp, "Failure sending request") - return - } - - result.fplr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.fplr.hasNextLink() && result.fplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client FirewallPoliciesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) ListAllResponder(resp *http.Response) (result FirewallPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client FirewallPoliciesClient) listAllNextResults(ctx context.Context, lastResults FirewallPolicyListResult) (result FirewallPolicyListResult, err error) { - req, err := lastResults.firewallPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client FirewallPoliciesClient) ListAllComplete(ctx context.Context) (result FirewallPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates tags of a Azure Firewall Policy resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// parameters - parameters supplied to update Azure Firewall Policy tags. -func (client FirewallPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject) (result FirewallPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPoliciesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, firewallPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client FirewallPoliciesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPoliciesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client FirewallPoliciesClient) UpdateTagsResponder(resp *http.Response) (result FirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignatures.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignatures.go deleted file mode 100644 index 851178b0d87c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignatures.go +++ /dev/null @@ -1,120 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FirewallPolicyIdpsSignaturesClient is the network Client -type FirewallPolicyIdpsSignaturesClient struct { - BaseClient -} - -// NewFirewallPolicyIdpsSignaturesClient creates an instance of the FirewallPolicyIdpsSignaturesClient client. -func NewFirewallPolicyIdpsSignaturesClient(subscriptionID string) FirewallPolicyIdpsSignaturesClient { - return NewFirewallPolicyIdpsSignaturesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFirewallPolicyIdpsSignaturesClientWithBaseURI creates an instance of the FirewallPolicyIdpsSignaturesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewFirewallPolicyIdpsSignaturesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyIdpsSignaturesClient { - return FirewallPolicyIdpsSignaturesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List retrieves the current status of IDPS signatures for the relevant policy -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPolicyIdpsSignaturesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject) (result QueryResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ResultsPerPage", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ResultsPerPage", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, - {Target: "parameters.ResultsPerPage", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.FirewallPolicyIdpsSignaturesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, resourceGroupName, firewallPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FirewallPolicyIdpsSignaturesClient) ListPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, parameters IDPSQueryObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsSignatures", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyIdpsSignaturesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FirewallPolicyIdpsSignaturesClient) ListResponder(resp *http.Response) (result QueryResults, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesfiltervalues.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesfiltervalues.go deleted file mode 100644 index 00a994c89a5f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesfiltervalues.go +++ /dev/null @@ -1,111 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FirewallPolicyIdpsSignaturesFilterValuesClient is the network Client -type FirewallPolicyIdpsSignaturesFilterValuesClient struct { - BaseClient -} - -// NewFirewallPolicyIdpsSignaturesFilterValuesClient creates an instance of the -// FirewallPolicyIdpsSignaturesFilterValuesClient client. -func NewFirewallPolicyIdpsSignaturesFilterValuesClient(subscriptionID string) FirewallPolicyIdpsSignaturesFilterValuesClient { - return NewFirewallPolicyIdpsSignaturesFilterValuesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFirewallPolicyIdpsSignaturesFilterValuesClientWithBaseURI creates an instance of the -// FirewallPolicyIdpsSignaturesFilterValuesClient client using a custom endpoint. Use this when interacting with an -// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFirewallPolicyIdpsSignaturesFilterValuesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyIdpsSignaturesFilterValuesClient { - return FirewallPolicyIdpsSignaturesFilterValuesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List retrieves the current filter values for the signatures overrides -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPolicyIdpsSignaturesFilterValuesClient) List(ctx context.Context, parameters SignatureOverridesFilterValuesQuery, resourceGroupName string, firewallPolicyName string) (result SignatureOverridesFilterValuesResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesFilterValuesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, parameters, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesFilterValuesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesFilterValuesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesFilterValuesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FirewallPolicyIdpsSignaturesFilterValuesClient) ListPreparer(ctx context.Context, parameters SignatureOverridesFilterValuesQuery, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/listIdpsFilterOptions", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyIdpsSignaturesFilterValuesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FirewallPolicyIdpsSignaturesFilterValuesClient) ListResponder(resp *http.Response) (result SignatureOverridesFilterValuesResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesoverrides.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesoverrides.go deleted file mode 100644 index b0bc6814f8ed..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesoverrides.go +++ /dev/null @@ -1,343 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FirewallPolicyIdpsSignaturesOverridesClient is the network Client -type FirewallPolicyIdpsSignaturesOverridesClient struct { - BaseClient -} - -// NewFirewallPolicyIdpsSignaturesOverridesClient creates an instance of the -// FirewallPolicyIdpsSignaturesOverridesClient client. -func NewFirewallPolicyIdpsSignaturesOverridesClient(subscriptionID string) FirewallPolicyIdpsSignaturesOverridesClient { - return NewFirewallPolicyIdpsSignaturesOverridesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFirewallPolicyIdpsSignaturesOverridesClientWithBaseURI creates an instance of the -// FirewallPolicyIdpsSignaturesOverridesClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFirewallPolicyIdpsSignaturesOverridesClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyIdpsSignaturesOverridesClient { - return FirewallPolicyIdpsSignaturesOverridesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get returns all signatures overrides for a specific policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPolicyIdpsSignaturesOverridesClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result SignaturesOverrides, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesOverridesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client FirewallPolicyIdpsSignaturesOverridesClient) GetPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyIdpsSignaturesOverridesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FirewallPolicyIdpsSignaturesOverridesClient) GetResponder(resp *http.Response) (result SignaturesOverrides, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List returns all signatures overrides objects for a specific policy as a list containing a single value. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPolicyIdpsSignaturesOverridesClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result SignaturesOverridesList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesOverridesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FirewallPolicyIdpsSignaturesOverridesClient) ListPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyIdpsSignaturesOverridesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FirewallPolicyIdpsSignaturesOverridesClient) ListResponder(resp *http.Response) (result SignaturesOverridesList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Patch will update the status of policy's signature overrides for IDPS -// Parameters: -// parameters - will contain all properties of the object to put -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPolicyIdpsSignaturesOverridesClient) Patch(ctx context.Context, parameters SignaturesOverrides, resourceGroupName string, firewallPolicyName string) (result SignaturesOverrides, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesOverridesClient.Patch") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PatchPreparer(ctx, parameters, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Patch", resp, "Failure responding to request") - return - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client FirewallPolicyIdpsSignaturesOverridesClient) PatchPreparer(ctx context.Context, parameters SignaturesOverrides, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyIdpsSignaturesOverridesClient) PatchSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client FirewallPolicyIdpsSignaturesOverridesClient) PatchResponder(resp *http.Response) (result SignaturesOverrides, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Put will override/create a new signature overrides for the policy's IDPS -// Parameters: -// parameters - will contain all properties of the object to put -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPolicyIdpsSignaturesOverridesClient) Put(ctx context.Context, parameters SignaturesOverrides, resourceGroupName string, firewallPolicyName string) (result SignaturesOverrides, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyIdpsSignaturesOverridesClient.Put") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PutPreparer(ctx, parameters, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Put", nil, "Failure preparing request") - return - } - - resp, err := client.PutSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Put", resp, "Failure sending request") - return - } - - result, err = client.PutResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyIdpsSignaturesOverridesClient", "Put", resp, "Failure responding to request") - return - } - - return -} - -// PutPreparer prepares the Put request. -func (client FirewallPolicyIdpsSignaturesOverridesClient) PutPreparer(ctx context.Context, parameters SignaturesOverrides, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/signatureOverrides/default", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PutSender sends the Put request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyIdpsSignaturesOverridesClient) PutSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// PutResponder handles the response to the Put request. The method always -// closes the http.Response Body. -func (client FirewallPolicyIdpsSignaturesOverridesClient) PutResponder(resp *http.Response) (result SignaturesOverrides, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyrulecollectiongroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyrulecollectiongroups.go deleted file mode 100644 index bb71e0b964e2..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyrulecollectiongroups.go +++ /dev/null @@ -1,407 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FirewallPolicyRuleCollectionGroupsClient is the network Client -type FirewallPolicyRuleCollectionGroupsClient struct { - BaseClient -} - -// NewFirewallPolicyRuleCollectionGroupsClient creates an instance of the FirewallPolicyRuleCollectionGroupsClient -// client. -func NewFirewallPolicyRuleCollectionGroupsClient(subscriptionID string) FirewallPolicyRuleCollectionGroupsClient { - return NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI creates an instance of the -// FirewallPolicyRuleCollectionGroupsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(baseURI string, subscriptionID string) FirewallPolicyRuleCollectionGroupsClient { - return FirewallPolicyRuleCollectionGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified FirewallPolicyRuleCollectionGroup. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// ruleCollectionGroupName - the name of the FirewallPolicyRuleCollectionGroup. -// parameters - parameters supplied to the create or update FirewallPolicyRuleCollectionGroup operation. -func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup) (result FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleCollectionGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleCollectionGroupProperties.Priority", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyRuleCollectionGroupProperties.Priority", Name: validation.InclusiveMaximum, Rule: int64(65000), Chain: nil}, - {Target: "parameters.FirewallPolicyRuleCollectionGroupProperties.Priority", Name: validation.InclusiveMinimum, Rule: int64(100), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.FirewallPolicyRuleCollectionGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string, parameters FirewallPolicyRuleCollectionGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionGroupName": autorest.Encode("path", ruleCollectionGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdateSender(req *http.Request) (future FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result FirewallPolicyRuleCollectionGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified FirewallPolicyRuleCollectionGroup. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// ruleCollectionGroupName - the name of the FirewallPolicyRuleCollectionGroup. -func (client FirewallPolicyRuleCollectionGroupsClient) Delete(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) (result FirewallPolicyRuleCollectionGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FirewallPolicyRuleCollectionGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionGroupName": autorest.Encode("path", ruleCollectionGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyRuleCollectionGroupsClient) DeleteSender(req *http.Request) (future FirewallPolicyRuleCollectionGroupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client FirewallPolicyRuleCollectionGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified FirewallPolicyRuleCollectionGroup. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -// ruleCollectionGroupName - the name of the FirewallPolicyRuleCollectionGroup. -func (client FirewallPolicyRuleCollectionGroupsClient) Get(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) (result FirewallPolicyRuleCollectionGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, firewallPolicyName, ruleCollectionGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client FirewallPolicyRuleCollectionGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionGroupName": autorest.Encode("path", ruleCollectionGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups/{ruleCollectionGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyRuleCollectionGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FirewallPolicyRuleCollectionGroupsClient) GetResponder(resp *http.Response) (result FirewallPolicyRuleCollectionGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all FirewallPolicyRuleCollectionGroups in a FirewallPolicy resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// firewallPolicyName - the name of the Firewall Policy. -func (client FirewallPolicyRuleCollectionGroupsClient) List(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPolicyRuleCollectionGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.List") - defer func() { - sc := -1 - if result.fprcglr.Response.Response != nil { - sc = result.fprcglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, firewallPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.fprcglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "List", resp, "Failure sending request") - return - } - - result.fprcglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.fprcglr.hasNextLink() && result.fprcglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FirewallPolicyRuleCollectionGroupsClient) ListPreparer(ctx context.Context, resourceGroupName string, firewallPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "firewallPolicyName": autorest.Encode("path", firewallPolicyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}/ruleCollectionGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FirewallPolicyRuleCollectionGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FirewallPolicyRuleCollectionGroupsClient) ListResponder(resp *http.Response) (result FirewallPolicyRuleCollectionGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client FirewallPolicyRuleCollectionGroupsClient) listNextResults(ctx context.Context, lastResults FirewallPolicyRuleCollectionGroupListResult) (result FirewallPolicyRuleCollectionGroupListResult, err error) { - req, err := lastResults.firewallPolicyRuleCollectionGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client FirewallPolicyRuleCollectionGroupsClient) ListComplete(ctx context.Context, resourceGroupName string, firewallPolicyName string) (result FirewallPolicyRuleCollectionGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, firewallPolicyName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/flowlogs.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/flowlogs.go deleted file mode 100644 index d1567ce5aa3d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/flowlogs.go +++ /dev/null @@ -1,483 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// FlowLogsClient is the network Client -type FlowLogsClient struct { - BaseClient -} - -// NewFlowLogsClient creates an instance of the FlowLogsClient client. -func NewFlowLogsClient(subscriptionID string) FlowLogsClient { - return NewFlowLogsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewFlowLogsClientWithBaseURI creates an instance of the FlowLogsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewFlowLogsClientWithBaseURI(baseURI string, subscriptionID string) FlowLogsClient { - return FlowLogsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a flow log for the specified network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// flowLogName - the name of the flow log. -// parameters - parameters that define the create or update flow log resource. -func (client FlowLogsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog) (result FlowLogsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.FlowLogPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FlowLogPropertiesFormat.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FlowLogPropertiesFormat.StorageID", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.FlowLogsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client FlowLogsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters FlowLog) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "flowLogName": autorest.Encode("path", flowLogName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) CreateOrUpdateSender(req *http.Request) (future FlowLogsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) CreateOrUpdateResponder(resp *http.Response) (result FlowLog, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified flow log resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// flowLogName - the name of the flow log resource. -func (client FlowLogsClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string) (result FlowLogsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, flowLogName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client FlowLogsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "flowLogName": autorest.Encode("path", flowLogName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) DeleteSender(req *http.Request) (future FlowLogsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a flow log resource by name. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// flowLogName - the name of the flow log resource. -func (client FlowLogsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string) (result FlowLog, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, flowLogName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client FlowLogsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "flowLogName": autorest.Encode("path", flowLogName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) GetResponder(resp *http.Response) (result FlowLog, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all flow log resources for the specified Network Watcher. -// Parameters: -// resourceGroupName - the name of the resource group containing Network Watcher. -// networkWatcherName - the name of the Network Watcher resource. -func (client FlowLogsClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result FlowLogListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.List") - defer func() { - sc := -1 - if result.fllr.Response.Response != nil { - sc = result.fllr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.fllr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "List", resp, "Failure sending request") - return - } - - result.fllr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "List", resp, "Failure responding to request") - return - } - if result.fllr.hasNextLink() && result.fllr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client FlowLogsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) ListResponder(resp *http.Response) (result FlowLogListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client FlowLogsClient) listNextResults(ctx context.Context, lastResults FlowLogListResult) (result FlowLogListResult, err error) { - req, err := lastResults.flowLogListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.FlowLogsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.FlowLogsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client FlowLogsClient) ListComplete(ctx context.Context, resourceGroupName string, networkWatcherName string) (result FlowLogListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkWatcherName) - return -} - -// UpdateTags update tags of the specified flow log. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// flowLogName - the name of the flow log. -// parameters - parameters supplied to update flow log tags. -func (client FlowLogsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters TagsObject) (result FlowLog, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkWatcherName, flowLogName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client FlowLogsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, flowLogName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "flowLogName": autorest.Encode("path", flowLogName), - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client FlowLogsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client FlowLogsClient) UpdateTagsResponder(resp *http.Response) (result FlowLog, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/groups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/groups.go deleted file mode 100644 index 4028e1173ef4..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/groups.go +++ /dev/null @@ -1,421 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GroupsClient is the network Client -type GroupsClient struct { - BaseClient -} - -// NewGroupsClient creates an instance of the GroupsClient client. -func NewGroupsClient(subscriptionID string) GroupsClient { - return NewGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGroupsClientWithBaseURI creates an instance of the GroupsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient { - return GroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a network group. -// Parameters: -// parameters - parameters supplied to the specify which network group need to create -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// networkGroupName - the name of the network group. -// ifMatch - 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. -func (client GroupsClient) CreateOrUpdate(ctx context.Context, parameters Group, resourceGroupName string, networkManagerName string, networkGroupName string, ifMatch string) (result Group, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, parameters, resourceGroupName, networkManagerName, networkGroupName, ifMatch) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.GroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GroupsClient) CreateOrUpdatePreparer(ctx context.Context, parameters Group, resourceGroupName string, networkManagerName string, networkGroupName string, ifMatch string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkGroupName": autorest.Encode("path", networkGroupName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result Group, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a network group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// networkGroupName - the name of the network group. -// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been -// deployed, the service will do a cleanup deployment in the background, prior to the delete. -func (client GroupsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, force *bool) (result GroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, networkGroupName, force) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, force *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkGroupName": autorest.Encode("path", networkGroupName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if force != nil { - queryParameters["force"] = autorest.Encode("query", *force) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified network group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// networkGroupName - the name of the network group. -func (client GroupsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string) (result Group, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, networkGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.GroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkGroupName": autorest.Encode("path", networkGroupName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists the specified network group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client GroupsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result GroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") - defer func() { - sc := -1 - if result.glr.Response.Response != nil { - sc = result.glr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.GroupsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.glr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.GroupsClient", "List", resp, "Failure sending request") - return - } - - result.glr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "List", resp, "Failure responding to request") - return - } - if result.glr.hasNextLink() && result.glr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client GroupsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client GroupsClient) listNextResults(ctx context.Context, lastResults GroupListResult) (result GroupListResult, err error) { - req, err := lastResults.groupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.GroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.GroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client GroupsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result GroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkManagerName, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubroutetables.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubroutetables.go deleted file mode 100644 index e2b54ffada4a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubroutetables.go +++ /dev/null @@ -1,393 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// HubRouteTablesClient is the network Client -type HubRouteTablesClient struct { - BaseClient -} - -// NewHubRouteTablesClient creates an instance of the HubRouteTablesClient client. -func NewHubRouteTablesClient(subscriptionID string) HubRouteTablesClient { - return NewHubRouteTablesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewHubRouteTablesClientWithBaseURI creates an instance of the HubRouteTablesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewHubRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) HubRouteTablesClient { - return HubRouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a RouteTable resource if it doesn't exist else updates the existing RouteTable. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the RouteTable. -// routeTableParameters - parameters supplied to create or update RouteTable. -func (client HubRouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable) (result HubRouteTablesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, routeTableName, routeTableParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client HubRouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, routeTableParameters HubRouteTable) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeTableParameters.Etag = nil - routeTableParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", pathParameters), - autorest.WithJSON(routeTableParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client HubRouteTablesClient) CreateOrUpdateSender(req *http.Request) (future HubRouteTablesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client HubRouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (result HubRouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a RouteTable. -// Parameters: -// resourceGroupName - the resource group name of the RouteTable. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the RouteTable. -func (client HubRouteTablesClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (result HubRouteTablesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client HubRouteTablesClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client HubRouteTablesClient) DeleteSender(req *http.Request) (future HubRouteTablesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client HubRouteTablesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a RouteTable. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the RouteTable. -func (client HubRouteTablesClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (result HubRouteTable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client HubRouteTablesClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client HubRouteTablesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client HubRouteTablesClient) GetResponder(resp *http.Response) (result HubRouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all RouteTables. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client HubRouteTablesClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubRouteTablesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.List") - defer func() { - sc := -1 - if result.lhrtr.Response.Response != nil { - sc = result.lhrtr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lhrtr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "List", resp, "Failure sending request") - return - } - - result.lhrtr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "List", resp, "Failure responding to request") - return - } - if result.lhrtr.hasNextLink() && result.lhrtr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client HubRouteTablesClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubRouteTables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client HubRouteTablesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client HubRouteTablesClient) ListResponder(resp *http.Response) (result ListHubRouteTablesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client HubRouteTablesClient) listNextResults(ctx context.Context, lastResults ListHubRouteTablesResult) (result ListHubRouteTablesResult, err error) { - req, err := lastResults.listHubRouteTablesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client HubRouteTablesClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubRouteTablesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubRouteTablesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubvirtualnetworkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubvirtualnetworkconnections.go deleted file mode 100644 index 02031271f7a4..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubvirtualnetworkconnections.go +++ /dev/null @@ -1,394 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// HubVirtualNetworkConnectionsClient is the network Client -type HubVirtualNetworkConnectionsClient struct { - BaseClient -} - -// NewHubVirtualNetworkConnectionsClient creates an instance of the HubVirtualNetworkConnectionsClient client. -func NewHubVirtualNetworkConnectionsClient(subscriptionID string) HubVirtualNetworkConnectionsClient { - return NewHubVirtualNetworkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewHubVirtualNetworkConnectionsClientWithBaseURI creates an instance of the HubVirtualNetworkConnectionsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewHubVirtualNetworkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) HubVirtualNetworkConnectionsClient { - return HubVirtualNetworkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a hub virtual network connection if it doesn't exist else updates the existing one. -// Parameters: -// resourceGroupName - the resource group name of the HubVirtualNetworkConnection. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the HubVirtualNetworkConnection. -// hubVirtualNetworkConnectionParameters - parameters supplied to create or update a hub virtual network -// connection. -func (client HubVirtualNetworkConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection) (result HubVirtualNetworkConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, connectionName, hubVirtualNetworkConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client HubVirtualNetworkConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, hubVirtualNetworkConnectionParameters HubVirtualNetworkConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - hubVirtualNetworkConnectionParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", pathParameters), - autorest.WithJSON(hubVirtualNetworkConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client HubVirtualNetworkConnectionsClient) CreateOrUpdateSender(req *http.Request) (future HubVirtualNetworkConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client HubVirtualNetworkConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result HubVirtualNetworkConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a HubVirtualNetworkConnection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the HubVirtualNetworkConnection. -func (client HubVirtualNetworkConnectionsClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result HubVirtualNetworkConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client HubVirtualNetworkConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client HubVirtualNetworkConnectionsClient) DeleteSender(req *http.Request) (future HubVirtualNetworkConnectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client HubVirtualNetworkConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a HubVirtualNetworkConnection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the vpn connection. -func (client HubVirtualNetworkConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result HubVirtualNetworkConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client HubVirtualNetworkConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client HubVirtualNetworkConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client HubVirtualNetworkConnectionsClient) GetResponder(resp *http.Response) (result HubVirtualNetworkConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all HubVirtualNetworkConnections. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client HubVirtualNetworkConnectionsClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubVirtualNetworkConnectionsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.List") - defer func() { - sc := -1 - if result.lhvncr.Response.Response != nil { - sc = result.lhvncr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lhvncr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.lhvncr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.lhvncr.hasNextLink() && result.lhvncr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client HubVirtualNetworkConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/hubVirtualNetworkConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client HubVirtualNetworkConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client HubVirtualNetworkConnectionsClient) ListResponder(resp *http.Response) (result ListHubVirtualNetworkConnectionsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client HubVirtualNetworkConnectionsClient) listNextResults(ctx context.Context, lastResults ListHubVirtualNetworkConnectionsResult) (result ListHubVirtualNetworkConnectionsResult, err error) { - req, err := lastResults.listHubVirtualNetworkConnectionsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client HubVirtualNetworkConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListHubVirtualNetworkConnectionsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/HubVirtualNetworkConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundnatrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundnatrules.go deleted file mode 100644 index e0dfa3bd6568..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundnatrules.go +++ /dev/null @@ -1,419 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InboundNatRulesClient is the network Client -type InboundNatRulesClient struct { - BaseClient -} - -// NewInboundNatRulesClient creates an instance of the InboundNatRulesClient client. -func NewInboundNatRulesClient(subscriptionID string) InboundNatRulesClient { - return NewInboundNatRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInboundNatRulesClientWithBaseURI creates an instance of the InboundNatRulesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewInboundNatRulesClientWithBaseURI(baseURI string, subscriptionID string) InboundNatRulesClient { - return InboundNatRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a load balancer inbound NAT rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound NAT rule. -// inboundNatRuleParameters - parameters supplied to the create or update inbound NAT rule operation. -func (client InboundNatRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule) (result InboundNatRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: inboundNatRuleParameters, - Constraints: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - {Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.ServicePublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.LinkedPublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.InboundNatRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - inboundNatRuleParameters.Etag = nil - inboundNatRuleParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), - autorest.WithJSON(inboundNatRuleParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client InboundNatRulesClient) CreateOrUpdateSender(req *http.Request) (future InboundNatRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client InboundNatRulesClient) CreateOrUpdateResponder(resp *http.Response) (result InboundNatRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified load balancer inbound NAT rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound NAT rule. -func (client InboundNatRulesClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) (result InboundNatRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client InboundNatRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client InboundNatRulesClient) DeleteSender(req *http.Request) (future InboundNatRulesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client InboundNatRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified load balancer inbound NAT rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// inboundNatRuleName - the name of the inbound NAT rule. -// expand - expands referenced resources. -func (client InboundNatRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (result InboundNatRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client InboundNatRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client InboundNatRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client InboundNatRulesClient) GetResponder(resp *http.Response) (result InboundNatRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the inbound NAT rules in a load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client InboundNatRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InboundNatRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.List") - defer func() { - sc := -1 - if result.inrlr.Response.Response != nil { - sc = result.inrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.inrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure sending request") - return - } - - result.inrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure responding to request") - return - } - if result.inrlr.hasNextLink() && result.inrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InboundNatRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InboundNatRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InboundNatRulesClient) ListResponder(resp *http.Response) (result InboundNatRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InboundNatRulesClient) listNextResults(ctx context.Context, lastResults InboundNatRuleListResult) (result InboundNatRuleListResult, err error) { - req, err := lastResults.inboundNatRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InboundNatRulesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InboundNatRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundsecurityrule.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundsecurityrule.go deleted file mode 100644 index eb1144376d02..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundsecurityrule.go +++ /dev/null @@ -1,119 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InboundSecurityRuleClient is the network Client -type InboundSecurityRuleClient struct { - BaseClient -} - -// NewInboundSecurityRuleClient creates an instance of the InboundSecurityRuleClient client. -func NewInboundSecurityRuleClient(subscriptionID string) InboundSecurityRuleClient { - return NewInboundSecurityRuleClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInboundSecurityRuleClientWithBaseURI creates an instance of the InboundSecurityRuleClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewInboundSecurityRuleClientWithBaseURI(baseURI string, subscriptionID string) InboundSecurityRuleClient { - return InboundSecurityRuleClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Network Virtual Appliance Inbound Security Rules. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -// ruleCollectionName - the name of security rule collection. -// parameters - parameters supplied to the create or update Network Virtual Appliance Inbound Security Rules -// operation. -func (client InboundSecurityRuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule) (result InboundSecurityRuleCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundSecurityRuleClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkVirtualApplianceName, ruleCollectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundSecurityRuleClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundSecurityRuleClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InboundSecurityRuleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, ruleCollectionName string, parameters InboundSecurityRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "ruleCollectionName": autorest.Encode("path", ruleCollectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/inboundSecurityRules/{ruleCollectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client InboundSecurityRuleClient) CreateOrUpdateSender(req *http.Request) (future InboundSecurityRuleCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client InboundSecurityRuleClient) CreateOrUpdateResponder(resp *http.Response) (result InboundSecurityRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceipconfigurations.go deleted file mode 100644 index 38d87b3d5ab2..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceipconfigurations.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InterfaceIPConfigurationsClient is the network Client -type InterfaceIPConfigurationsClient struct { - BaseClient -} - -// NewInterfaceIPConfigurationsClient creates an instance of the InterfaceIPConfigurationsClient client. -func NewInterfaceIPConfigurationsClient(subscriptionID string) InterfaceIPConfigurationsClient { - return NewInterfaceIPConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInterfaceIPConfigurationsClientWithBaseURI creates an instance of the InterfaceIPConfigurationsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewInterfaceIPConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) InterfaceIPConfigurationsClient { - return InterfaceIPConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified network interface ip configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// IPConfigurationName - the name of the ip configuration name. -func (client InterfaceIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, IPConfigurationName string) (result InterfaceIPConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, IPConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client InterfaceIPConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, IPConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceIPConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client InterfaceIPConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get all ip configurations in a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfaceIPConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceIPConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationsClient.List") - defer func() { - sc := -1 - if result.iiclr.Response.Response != nil { - sc = result.iiclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.iiclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.iiclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.iiclr.hasNextLink() && result.iiclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InterfaceIPConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceIPConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InterfaceIPConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InterfaceIPConfigurationsClient) listNextResults(ctx context.Context, lastResults InterfaceIPConfigurationListResult) (result InterfaceIPConfigurationListResult, err error) { - req, err := lastResults.interfaceIPConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfaceIPConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceIPConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkInterfaceName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceloadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceloadbalancers.go deleted file mode 100644 index a7b2666852f1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceloadbalancers.go +++ /dev/null @@ -1,150 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InterfaceLoadBalancersClient is the network Client -type InterfaceLoadBalancersClient struct { - BaseClient -} - -// NewInterfaceLoadBalancersClient creates an instance of the InterfaceLoadBalancersClient client. -func NewInterfaceLoadBalancersClient(subscriptionID string) InterfaceLoadBalancersClient { - return NewInterfaceLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInterfaceLoadBalancersClientWithBaseURI creates an instance of the InterfaceLoadBalancersClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewInterfaceLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) InterfaceLoadBalancersClient { - return InterfaceLoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List list all load balancers in a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfaceLoadBalancersClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceLoadBalancerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancersClient.List") - defer func() { - sc := -1 - if result.ilblr.Response.Response != nil { - sc = result.ilblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure sending request") - return - } - - result.ilblr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure responding to request") - return - } - if result.ilblr.hasNextLink() && result.ilblr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InterfaceLoadBalancersClient) ListPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceLoadBalancersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InterfaceLoadBalancersClient) ListResponder(resp *http.Response) (result InterfaceLoadBalancerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InterfaceLoadBalancersClient) listNextResults(ctx context.Context, lastResults InterfaceLoadBalancerListResult) (result InterfaceLoadBalancerListResult, err error) { - req, err := lastResults.interfaceLoadBalancerListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfaceLoadBalancersClient) ListComplete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceLoadBalancerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkInterfaceName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacesgroup.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacesgroup.go deleted file mode 100644 index 9e95b95955d3..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacesgroup.go +++ /dev/null @@ -1,1598 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InterfacesClient is the network Client -type InterfacesClient struct { - BaseClient -} - -// NewInterfacesClient creates an instance of the InterfacesClient client. -func NewInterfacesClient(subscriptionID string) InterfacesClient { - return NewInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInterfacesClientWithBaseURI creates an instance of the InterfacesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient { - return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// parameters - parameters supplied to the create or update network interface operation. -func (client InterfacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface) (result InterfacesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkInterfaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InterfacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) CreateOrUpdateSender(req *http.Request) (future InterfacesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfacesClient) Delete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client InterfacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) DeleteSender(req *http.Request) (future InterfacesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client InterfacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// expand - expands referenced resources. -func (client InterfacesClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, expand string) (result Interface, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client InterfacesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetCloudServiceNetworkInterface get the specified network interface in a cloud service. -// Parameters: -// resourceGroupName - the name of the resource group. -// cloudServiceName - the name of the cloud service. -// roleInstanceName - the name of role instance. -// networkInterfaceName - the name of the network interface. -// expand - expands referenced resources. -func (client InterfacesClient) GetCloudServiceNetworkInterface(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, expand string) (result Interface, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.GetCloudServiceNetworkInterface") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetCloudServiceNetworkInterfacePreparer(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetCloudServiceNetworkInterface", nil, "Failure preparing request") - return - } - - resp, err := client.GetCloudServiceNetworkInterfaceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetCloudServiceNetworkInterface", resp, "Failure sending request") - return - } - - result, err = client.GetCloudServiceNetworkInterfaceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetCloudServiceNetworkInterface", resp, "Failure responding to request") - return - } - - return -} - -// GetCloudServiceNetworkInterfacePreparer prepares the GetCloudServiceNetworkInterface request. -func (client InterfacesClient) GetCloudServiceNetworkInterfacePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCloudServiceNetworkInterfaceSender sends the GetCloudServiceNetworkInterface request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetCloudServiceNetworkInterfaceSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetCloudServiceNetworkInterfaceResponder handles the response to the GetCloudServiceNetworkInterface request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetCloudServiceNetworkInterfaceResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetEffectiveRouteTable gets all route tables applied to a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfacesClient) GetEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesGetEffectiveRouteTableFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.GetEffectiveRouteTable") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetEffectiveRouteTablePreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", nil, "Failure preparing request") - return - } - - result, err = client.GetEffectiveRouteTableSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", result.Response(), "Failure sending request") - return - } - - return -} - -// GetEffectiveRouteTablePreparer prepares the GetEffectiveRouteTable request. -func (client InterfacesClient) GetEffectiveRouteTablePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEffectiveRouteTableSender sends the GetEffectiveRouteTable request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetEffectiveRouteTableSender(req *http.Request) (future InterfacesGetEffectiveRouteTableFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetEffectiveRouteTableResponder handles the response to the GetEffectiveRouteTable request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Response) (result EffectiveRouteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVirtualMachineScaleSetIPConfiguration get the specified network interface ip configuration in a virtual machine -// scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the name of the network interface. -// IPConfigurationName - the name of the ip configuration. -// expand - expands referenced resources. -func (client InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, expand string) (result InterfaceIPConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.GetVirtualMachineScaleSetIPConfiguration") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVirtualMachineScaleSetIPConfigurationPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetIPConfiguration", nil, "Failure preparing request") - return - } - - resp, err := client.GetVirtualMachineScaleSetIPConfigurationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetIPConfiguration", resp, "Failure sending request") - return - } - - result, err = client.GetVirtualMachineScaleSetIPConfigurationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetIPConfiguration", resp, "Failure responding to request") - return - } - - return -} - -// GetVirtualMachineScaleSetIPConfigurationPreparer prepares the GetVirtualMachineScaleSetIPConfiguration request. -func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVirtualMachineScaleSetIPConfigurationSender sends the GetVirtualMachineScaleSetIPConfiguration request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetVirtualMachineScaleSetIPConfigurationResponder handles the response to the GetVirtualMachineScaleSetIPConfiguration request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVirtualMachineScaleSetNetworkInterface get the specified network interface in a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the name of the network interface. -// expand - expands referenced resources. -func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.GetVirtualMachineScaleSetNetworkInterface") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", nil, "Failure preparing request") - return - } - - resp, err := client.GetVirtualMachineScaleSetNetworkInterfaceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", resp, "Failure sending request") - return - } - - result, err = client.GetVirtualMachineScaleSetNetworkInterfaceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetVirtualMachineScaleSetNetworkInterface", resp, "Failure responding to request") - return - } - - return -} - -// GetVirtualMachineScaleSetNetworkInterfacePreparer prepares the GetVirtualMachineScaleSetNetworkInterface request. -func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVirtualMachineScaleSetNetworkInterfaceSender sends the GetVirtualMachineScaleSetNetworkInterface request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetVirtualMachineScaleSetNetworkInterfaceResponder handles the response to the GetVirtualMachineScaleSetNetworkInterface request. The method always -// closes the http.Response Body. -func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all network interfaces in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client InterfacesClient) List(ctx context.Context, resourceGroupName string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.List") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "List", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InterfacesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListComplete(ctx context.Context, resourceGroupName string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all network interfaces in a subscription. -func (client InterfacesClient) ListAll(ctx context.Context) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListAll") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client InterfacesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListAllResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listAllNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListAllComplete(ctx context.Context) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListCloudServiceNetworkInterfaces gets all network interfaces in a cloud service. -// Parameters: -// resourceGroupName - the name of the resource group. -// cloudServiceName - the name of the cloud service. -func (client InterfacesClient) ListCloudServiceNetworkInterfaces(ctx context.Context, resourceGroupName string, cloudServiceName string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListCloudServiceNetworkInterfaces") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listCloudServiceNetworkInterfacesNextResults - req, err := client.ListCloudServiceNetworkInterfacesPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListCloudServiceNetworkInterfaces", nil, "Failure preparing request") - return - } - - resp, err := client.ListCloudServiceNetworkInterfacesSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListCloudServiceNetworkInterfaces", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListCloudServiceNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListCloudServiceNetworkInterfaces", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListCloudServiceNetworkInterfacesPreparer prepares the ListCloudServiceNetworkInterfaces request. -func (client InterfacesClient) ListCloudServiceNetworkInterfacesPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCloudServiceNetworkInterfacesSender sends the ListCloudServiceNetworkInterfaces request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListCloudServiceNetworkInterfacesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListCloudServiceNetworkInterfacesResponder handles the response to the ListCloudServiceNetworkInterfaces request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListCloudServiceNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listCloudServiceNetworkInterfacesNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listCloudServiceNetworkInterfacesNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listCloudServiceNetworkInterfacesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListCloudServiceNetworkInterfacesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listCloudServiceNetworkInterfacesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListCloudServiceNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listCloudServiceNetworkInterfacesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListCloudServiceNetworkInterfacesComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListCloudServiceNetworkInterfacesComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListCloudServiceNetworkInterfaces") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListCloudServiceNetworkInterfaces(ctx, resourceGroupName, cloudServiceName) - return -} - -// ListCloudServiceRoleInstanceNetworkInterfaces gets information about all network interfaces in a role instance in a -// cloud service. -// Parameters: -// resourceGroupName - the name of the resource group. -// cloudServiceName - the name of the cloud service. -// roleInstanceName - the name of role instance. -func (client InterfacesClient) ListCloudServiceRoleInstanceNetworkInterfaces(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listCloudServiceRoleInstanceNetworkInterfacesNextResults - req, err := client.ListCloudServiceRoleInstanceNetworkInterfacesPreparer(ctx, resourceGroupName, cloudServiceName, roleInstanceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListCloudServiceRoleInstanceNetworkInterfaces", nil, "Failure preparing request") - return - } - - resp, err := client.ListCloudServiceRoleInstanceNetworkInterfacesSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListCloudServiceRoleInstanceNetworkInterfaces", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListCloudServiceRoleInstanceNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListCloudServiceRoleInstanceNetworkInterfaces", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListCloudServiceRoleInstanceNetworkInterfacesPreparer prepares the ListCloudServiceRoleInstanceNetworkInterfaces request. -func (client InterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCloudServiceRoleInstanceNetworkInterfacesSender sends the ListCloudServiceRoleInstanceNetworkInterfaces request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListCloudServiceRoleInstanceNetworkInterfacesResponder handles the response to the ListCloudServiceRoleInstanceNetworkInterfaces request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listCloudServiceRoleInstanceNetworkInterfacesNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listCloudServiceRoleInstanceNetworkInterfacesNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listCloudServiceRoleInstanceNetworkInterfacesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListCloudServiceRoleInstanceNetworkInterfacesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listCloudServiceRoleInstanceNetworkInterfacesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListCloudServiceRoleInstanceNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listCloudServiceRoleInstanceNetworkInterfacesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListCloudServiceRoleInstanceNetworkInterfacesComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesComplete(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListCloudServiceRoleInstanceNetworkInterfaces(ctx, resourceGroupName, cloudServiceName, roleInstanceName) - return -} - -// ListEffectiveNetworkSecurityGroups gets all network security groups applied to a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfacesClient) ListEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesListEffectiveNetworkSecurityGroupsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListEffectiveNetworkSecurityGroups") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListEffectiveNetworkSecurityGroupsPreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", nil, "Failure preparing request") - return - } - - result, err = client.ListEffectiveNetworkSecurityGroupsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", result.Response(), "Failure sending request") - return - } - - return -} - -// ListEffectiveNetworkSecurityGroupsPreparer prepares the ListEffectiveNetworkSecurityGroups request. -func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListEffectiveNetworkSecurityGroupsSender sends the ListEffectiveNetworkSecurityGroups request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsSender(req *http.Request) (future InterfacesListEffectiveNetworkSecurityGroupsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListEffectiveNetworkSecurityGroupsResponder handles the response to the ListEffectiveNetworkSecurityGroups request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp *http.Response) (result EffectiveNetworkSecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListVirtualMachineScaleSetIPConfigurations get the specified network interface ip configuration in a virtual machine -// scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the name of the network interface. -// expand - expands referenced resources. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurations(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result InterfaceIPConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetIPConfigurations") - defer func() { - sc := -1 - if result.iiclr.Response.Response != nil { - sc = result.iiclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetIPConfigurationsNextResults - req, err := client.ListVirtualMachineScaleSetIPConfigurationsPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetIPConfigurations", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetIPConfigurationsSender(req) - if err != nil { - result.iiclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetIPConfigurations", resp, "Failure sending request") - return - } - - result.iiclr, err = client.ListVirtualMachineScaleSetIPConfigurationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetIPConfigurations", resp, "Failure responding to request") - return - } - if result.iiclr.hasNextLink() && result.iiclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetIPConfigurationsPreparer prepares the ListVirtualMachineScaleSetIPConfigurations request. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetIPConfigurationsSender sends the ListVirtualMachineScaleSetIPConfigurations request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetIPConfigurationsResponder handles the response to the ListVirtualMachineScaleSetIPConfigurations request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetIPConfigurationsNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listVirtualMachineScaleSetIPConfigurationsNextResults(ctx context.Context, lastResults InterfaceIPConfigurationListResult) (result InterfaceIPConfigurationListResult, err error) { - req, err := lastResults.interfaceIPConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetIPConfigurationsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetIPConfigurationsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetIPConfigurationsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetIPConfigurationsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetIPConfigurationsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetIPConfigurationsComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result InterfaceIPConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetIPConfigurations") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetIPConfigurations(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) - return -} - -// ListVirtualMachineScaleSetNetworkInterfaces gets all network interfaces in a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetNetworkInterfacesNextResults - req, err := client.ListVirtualMachineScaleSetNetworkInterfacesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetNetworkInterfaces", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetNetworkInterfaces request. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetNetworkInterfacesSender sends the ListVirtualMachineScaleSetNetworkInterfaces request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetNetworkInterfacesResponder handles the response to the ListVirtualMachineScaleSetNetworkInterfaces request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetNetworkInterfacesNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listVirtualMachineScaleSetNetworkInterfacesNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetNetworkInterfacesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetNetworkInterfacesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetNetworkInterfacesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetNetworkInterfacesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetNetworkInterfacesComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetNetworkInterfaces(ctx, resourceGroupName, virtualMachineScaleSetName) - return -} - -// ListVirtualMachineScaleSetVMNetworkInterfaces gets information about all network interfaces in a virtual machine in -// a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetVMNetworkInterfacesNextResults - req, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListVirtualMachineScaleSetVMNetworkInterfaces", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetVMNetworkInterfaces request. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesSender sends the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesResponder handles the response to the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method always -// closes the http.Response Body. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetVMNetworkInterfacesNextResults retrieves the next set of results, if any. -func (client InterfacesClient) listVirtualMachineScaleSetVMNetworkInterfacesNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetVMNetworkInterfacesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetVMNetworkInterfacesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "listVirtualMachineScaleSetVMNetworkInterfacesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) - return -} - -// UpdateTags updates a network interface tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// parameters - parameters supplied to update network interface tags. -func (client InterfacesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject) (result Interface, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfacesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkInterfaceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client InterfacesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client InterfacesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client InterfacesClient) UpdateTagsResponder(resp *http.Response) (result Interface, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacetapconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacetapconfigurations.go deleted file mode 100644 index 12b4a1102849..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacetapconfigurations.go +++ /dev/null @@ -1,434 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// InterfaceTapConfigurationsClient is the network Client -type InterfaceTapConfigurationsClient struct { - BaseClient -} - -// NewInterfaceTapConfigurationsClient creates an instance of the InterfaceTapConfigurationsClient client. -func NewInterfaceTapConfigurationsClient(subscriptionID string) InterfaceTapConfigurationsClient { - return NewInterfaceTapConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewInterfaceTapConfigurationsClientWithBaseURI creates an instance of the InterfaceTapConfigurationsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewInterfaceTapConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) InterfaceTapConfigurationsClient { - return InterfaceTapConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a Tap configuration in the specified NetworkInterface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// tapConfigurationName - the name of the tap configuration. -// tapConfigurationParameters - parameters supplied to the create or update tap configuration operation. -func (client InterfaceTapConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration) (result InterfaceTapConfigurationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: tapConfigurationParameters, - Constraints: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - {Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.ServicePublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.LinkedPublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - }}, - }}, - }}, - }}, - {Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - {Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.ServicePublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "tapConfigurationParameters.InterfaceTapConfigurationPropertiesFormat.VirtualNetworkTap.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.LinkedPublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - }}, - }}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.InterfaceTapConfigurationsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName, tapConfigurationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InterfaceTapConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string, tapConfigurationParameters InterfaceTapConfiguration) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapConfigurationName": autorest.Encode("path", tapConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - tapConfigurationParameters.Etag = nil - tapConfigurationParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", pathParameters), - autorest.WithJSON(tapConfigurationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceTapConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future InterfaceTapConfigurationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client InterfaceTapConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result InterfaceTapConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified tap configuration from the NetworkInterface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// tapConfigurationName - the name of the tap configuration. -func (client InterfaceTapConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) (result InterfaceTapConfigurationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client InterfaceTapConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapConfigurationName": autorest.Encode("path", tapConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceTapConfigurationsClient) DeleteSender(req *http.Request) (future InterfaceTapConfigurationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client InterfaceTapConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the specified tap configuration on a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -// tapConfigurationName - the name of the tap configuration. -func (client InterfaceTapConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) (result InterfaceTapConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, tapConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client InterfaceTapConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapConfigurationName": autorest.Encode("path", tapConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations/{tapConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceTapConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client InterfaceTapConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceTapConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get all Tap configurations in a network interface. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkInterfaceName - the name of the network interface. -func (client InterfaceTapConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceTapConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.List") - defer func() { - sc := -1 - if result.itclr.Response.Response != nil { - sc = result.itclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.itclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.itclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.itclr.hasNextLink() && result.itclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client InterfaceTapConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkInterfaceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/tapConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client InterfaceTapConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client InterfaceTapConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceTapConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client InterfaceTapConfigurationsClient) listNextResults(ctx context.Context, lastResults InterfaceTapConfigurationListResult) (result InterfaceTapConfigurationListResult, err error) { - req, err := lastResults.interfaceTapConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client InterfaceTapConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceTapConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkInterfaceName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipallocations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipallocations.go deleted file mode 100644 index 5cfbec8391e1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipallocations.go +++ /dev/null @@ -1,580 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// IPAllocationsClient is the network Client -type IPAllocationsClient struct { - BaseClient -} - -// NewIPAllocationsClient creates an instance of the IPAllocationsClient client. -func NewIPAllocationsClient(subscriptionID string) IPAllocationsClient { - return NewIPAllocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewIPAllocationsClientWithBaseURI creates an instance of the IPAllocationsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewIPAllocationsClientWithBaseURI(baseURI string, subscriptionID string) IPAllocationsClient { - return IPAllocationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an IpAllocation in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPAllocationName - the name of the IpAllocation. -// parameters - parameters supplied to the create or update virtual network operation. -func (client IPAllocationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, IPAllocationName string, parameters IPAllocation) (result IPAllocationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, IPAllocationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IPAllocationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, IPAllocationName string, parameters IPAllocation) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipAllocationName": autorest.Encode("path", IPAllocationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) CreateOrUpdateSender(req *http.Request) (future IPAllocationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) CreateOrUpdateResponder(resp *http.Response) (result IPAllocation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified IpAllocation. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPAllocationName - the name of the IpAllocation. -func (client IPAllocationsClient) Delete(ctx context.Context, resourceGroupName string, IPAllocationName string) (result IPAllocationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, IPAllocationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IPAllocationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, IPAllocationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipAllocationName": autorest.Encode("path", IPAllocationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) DeleteSender(req *http.Request) (future IPAllocationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified IpAllocation by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPAllocationName - the name of the IpAllocation. -// expand - expands referenced resources. -func (client IPAllocationsClient) Get(ctx context.Context, resourceGroupName string, IPAllocationName string, expand string) (result IPAllocation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, IPAllocationName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client IPAllocationsClient) GetPreparer(ctx context.Context, resourceGroupName string, IPAllocationName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipAllocationName": autorest.Encode("path", IPAllocationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) GetResponder(resp *http.Response) (result IPAllocation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all IpAllocations in a subscription. -func (client IPAllocationsClient) List(ctx context.Context) (result IPAllocationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.List") - defer func() { - sc := -1 - if result.ialr.Response.Response != nil { - sc = result.ialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "List", resp, "Failure sending request") - return - } - - result.ialr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "List", resp, "Failure responding to request") - return - } - if result.ialr.hasNextLink() && result.ialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client IPAllocationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/IpAllocations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) ListResponder(resp *http.Response) (result IPAllocationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client IPAllocationsClient) listNextResults(ctx context.Context, lastResults IPAllocationListResult) (result IPAllocationListResult, err error) { - req, err := lastResults.iPAllocationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IPAllocationsClient) ListComplete(ctx context.Context) (result IPAllocationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all IpAllocations in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client IPAllocationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result IPAllocationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ialr.Response.Response != nil { - sc = result.ialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ialr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ialr.hasNextLink() && result.ialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client IPAllocationsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) ListByResourceGroupResponder(resp *http.Response) (result IPAllocationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client IPAllocationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults IPAllocationListResult) (result IPAllocationListResult, err error) { - req, err := lastResults.iPAllocationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client IPAllocationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result IPAllocationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates a IpAllocation tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPAllocationName - the name of the IpAllocation. -// parameters - parameters supplied to update IpAllocation tags. -func (client IPAllocationsClient) UpdateTags(ctx context.Context, resourceGroupName string, IPAllocationName string, parameters TagsObject) (result IPAllocation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, IPAllocationName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client IPAllocationsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, IPAllocationName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipAllocationName": autorest.Encode("path", IPAllocationName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client IPAllocationsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client IPAllocationsClient) UpdateTagsResponder(resp *http.Response) (result IPAllocation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipgroups.go deleted file mode 100644 index 16ff0075a00b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipgroups.go +++ /dev/null @@ -1,581 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// IPGroupsClient is the network Client -type IPGroupsClient struct { - BaseClient -} - -// NewIPGroupsClient creates an instance of the IPGroupsClient client. -func NewIPGroupsClient(subscriptionID string) IPGroupsClient { - return NewIPGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewIPGroupsClientWithBaseURI creates an instance of the IPGroupsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewIPGroupsClientWithBaseURI(baseURI string, subscriptionID string) IPGroupsClient { - return IPGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an ipGroups in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPGroupsName - the name of the ipGroups. -// parameters - parameters supplied to the create or update IpGroups operation. -func (client IPGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, IPGroupsName string, parameters IPGroup) (result IPGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, IPGroupsName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IPGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, IPGroupsName string, parameters IPGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipGroupsName": autorest.Encode("path", IPGroupsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) CreateOrUpdateSender(req *http.Request) (future IPGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result IPGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified ipGroups. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPGroupsName - the name of the ipGroups. -func (client IPGroupsClient) Delete(ctx context.Context, resourceGroupName string, IPGroupsName string) (result IPGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, IPGroupsName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IPGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, IPGroupsName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipGroupsName": autorest.Encode("path", IPGroupsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) DeleteSender(req *http.Request) (future IPGroupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified ipGroups. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPGroupsName - the name of the ipGroups. -// expand - expands resourceIds (of Firewalls/Network Security Groups etc.) back referenced by the IpGroups -// resource. -func (client IPGroupsClient) Get(ctx context.Context, resourceGroupName string, IPGroupsName string, expand string) (result IPGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, IPGroupsName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client IPGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, IPGroupsName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipGroupsName": autorest.Encode("path", IPGroupsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) GetResponder(resp *http.Response) (result IPGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all IpGroups in a subscription. -func (client IPGroupsClient) List(ctx context.Context) (result IPGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.List") - defer func() { - sc := -1 - if result.iglr.Response.Response != nil { - sc = result.iglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.iglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "List", resp, "Failure sending request") - return - } - - result.iglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.iglr.hasNextLink() && result.iglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client IPGroupsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ipGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) ListResponder(resp *http.Response) (result IPGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client IPGroupsClient) listNextResults(ctx context.Context, lastResults IPGroupListResult) (result IPGroupListResult, err error) { - req, err := lastResults.iPGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.IPGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.IPGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IPGroupsClient) ListComplete(ctx context.Context) (result IPGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all IpGroups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client IPGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result IPGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.iglr.Response.Response != nil { - sc = result.iglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.iglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.iglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.iglr.hasNextLink() && result.iglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client IPGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result IPGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client IPGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults IPGroupListResult) (result IPGroupListResult, err error) { - req, err := lastResults.iPGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.IPGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.IPGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client IPGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result IPGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateGroups updates tags of an IpGroups resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// IPGroupsName - the name of the ipGroups. -// parameters - parameters supplied to the update ipGroups operation. -func (client IPGroupsClient) UpdateGroups(ctx context.Context, resourceGroupName string, IPGroupsName string, parameters TagsObject) (result IPGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupsClient.UpdateGroups") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateGroupsPreparer(ctx, resourceGroupName, IPGroupsName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "UpdateGroups", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateGroupsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "UpdateGroups", resp, "Failure sending request") - return - } - - result, err = client.UpdateGroupsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsClient", "UpdateGroups", resp, "Failure responding to request") - return - } - - return -} - -// UpdateGroupsPreparer prepares the UpdateGroups request. -func (client IPGroupsClient) UpdateGroupsPreparer(ctx context.Context, resourceGroupName string, IPGroupsName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipGroupsName": autorest.Encode("path", IPGroupsName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ipGroups/{ipGroupsName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateGroupsSender sends the UpdateGroups request. The method will close the -// http.Response Body if it receives an error. -func (client IPGroupsClient) UpdateGroupsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateGroupsResponder handles the response to the UpdateGroups request. The method always -// closes the http.Response Body. -func (client IPGroupsClient) UpdateGroupsResponder(resp *http.Response) (result IPGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerbackendaddresspools.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerbackendaddresspools.go deleted file mode 100644 index 4ba059657da2..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerbackendaddresspools.go +++ /dev/null @@ -1,394 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerBackendAddressPoolsClient is the network Client -type LoadBalancerBackendAddressPoolsClient struct { - BaseClient -} - -// NewLoadBalancerBackendAddressPoolsClient creates an instance of the LoadBalancerBackendAddressPoolsClient client. -func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string) LoadBalancerBackendAddressPoolsClient { - return NewLoadBalancerBackendAddressPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerBackendAddressPoolsClientWithBaseURI creates an instance of the LoadBalancerBackendAddressPoolsClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewLoadBalancerBackendAddressPoolsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerBackendAddressPoolsClient { - return LoadBalancerBackendAddressPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a load balancer backend address pool. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// backendAddressPoolName - the name of the backend address pool. -// parameters - parameters supplied to the create or update load balancer backend address pool operation. -func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool) (result LoadBalancerBackendAddressPoolsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string, parameters BackendAddressPool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendAddressPoolName": autorest.Encode("path", backendAddressPoolName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancerBackendAddressPoolsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result BackendAddressPool, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified load balancer backend address pool. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// backendAddressPoolName - the name of the backend address pool. -func (client LoadBalancerBackendAddressPoolsClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (result LoadBalancerBackendAddressPoolsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LoadBalancerBackendAddressPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendAddressPoolName": autorest.Encode("path", backendAddressPoolName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerBackendAddressPoolsClient) DeleteSender(req *http.Request) (future LoadBalancerBackendAddressPoolsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client LoadBalancerBackendAddressPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets load balancer backend address pool. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// backendAddressPoolName - the name of the backend address pool. -func (client LoadBalancerBackendAddressPoolsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (result BackendAddressPool, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerBackendAddressPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendAddressPoolName": autorest.Encode("path", backendAddressPoolName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerBackendAddressPoolsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerBackendAddressPoolsClient) GetResponder(resp *http.Response) (result BackendAddressPool, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancer backed address pools. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerBackendAddressPoolsClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerBackendAddressPoolListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.List") - defer func() { - sc := -1 - if result.lbbaplr.Response.Response != nil { - sc = result.lbbaplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lbbaplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure sending request") - return - } - - result.lbbaplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure responding to request") - return - } - if result.lbbaplr.hasNextLink() && result.lbbaplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerBackendAddressPoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerBackendAddressPoolsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerBackendAddressPoolsClient) ListResponder(resp *http.Response) (result LoadBalancerBackendAddressPoolListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerBackendAddressPoolsClient) listNextResults(ctx context.Context, lastResults LoadBalancerBackendAddressPoolListResult) (result LoadBalancerBackendAddressPoolListResult, err error) { - req, err := lastResults.loadBalancerBackendAddressPoolListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerBackendAddressPoolsClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerBackendAddressPoolListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerfrontendipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerfrontendipconfigurations.go deleted file mode 100644 index 9d5495f9d35d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerfrontendipconfigurations.go +++ /dev/null @@ -1,229 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerFrontendIPConfigurationsClient is the network Client -type LoadBalancerFrontendIPConfigurationsClient struct { - BaseClient -} - -// NewLoadBalancerFrontendIPConfigurationsClient creates an instance of the LoadBalancerFrontendIPConfigurationsClient -// client. -func NewLoadBalancerFrontendIPConfigurationsClient(subscriptionID string) LoadBalancerFrontendIPConfigurationsClient { - return NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI creates an instance of the -// LoadBalancerFrontendIPConfigurationsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerFrontendIPConfigurationsClient { - return LoadBalancerFrontendIPConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets load balancer frontend IP configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// frontendIPConfigurationName - the name of the frontend IP configuration. -func (client LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) (result FrontendIPConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, frontendIPConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerFrontendIPConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "frontendIPConfigurationName": autorest.Encode("path", frontendIPConfigurationName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerFrontendIPConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerFrontendIPConfigurationsClient) GetResponder(resp *http.Response) (result FrontendIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancer frontend IP configurations. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerFrontendIPConfigurationsClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerFrontendIPConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationsClient.List") - defer func() { - sc := -1 - if result.lbficlr.Response.Response != nil { - sc = result.lbficlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lbficlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.lbficlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.lbficlr.hasNextLink() && result.lbficlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerFrontendIPConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerFrontendIPConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerFrontendIPConfigurationsClient) ListResponder(resp *http.Response) (result LoadBalancerFrontendIPConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerFrontendIPConfigurationsClient) listNextResults(ctx context.Context, lastResults LoadBalancerFrontendIPConfigurationListResult) (result LoadBalancerFrontendIPConfigurationListResult, err error) { - req, err := lastResults.loadBalancerFrontendIPConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerFrontendIPConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerFrontendIPConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerloadbalancingrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerloadbalancingrules.go deleted file mode 100644 index c11489329311..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerloadbalancingrules.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerLoadBalancingRulesClient is the network Client -type LoadBalancerLoadBalancingRulesClient struct { - BaseClient -} - -// NewLoadBalancerLoadBalancingRulesClient creates an instance of the LoadBalancerLoadBalancingRulesClient client. -func NewLoadBalancerLoadBalancingRulesClient(subscriptionID string) LoadBalancerLoadBalancingRulesClient { - return NewLoadBalancerLoadBalancingRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerLoadBalancingRulesClientWithBaseURI creates an instance of the LoadBalancerLoadBalancingRulesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewLoadBalancerLoadBalancingRulesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerLoadBalancingRulesClient { - return LoadBalancerLoadBalancingRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified load balancer load balancing rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// loadBalancingRuleName - the name of the load balancing rule. -func (client LoadBalancerLoadBalancingRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) (result LoadBalancingRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, loadBalancingRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerLoadBalancingRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "loadBalancingRuleName": autorest.Encode("path", loadBalancingRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerLoadBalancingRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerLoadBalancingRulesClient) GetResponder(resp *http.Response) (result LoadBalancingRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancing rules in a load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerLoadBalancingRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerLoadBalancingRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRulesClient.List") - defer func() { - sc := -1 - if result.lblbrlr.Response.Response != nil { - sc = result.lblbrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lblbrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure sending request") - return - } - - result.lblbrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure responding to request") - return - } - if result.lblbrlr.hasNextLink() && result.lblbrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerLoadBalancingRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerLoadBalancingRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerLoadBalancingRulesClient) ListResponder(resp *http.Response) (result LoadBalancerLoadBalancingRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerLoadBalancingRulesClient) listNextResults(ctx context.Context, lastResults LoadBalancerLoadBalancingRuleListResult) (result LoadBalancerLoadBalancingRuleListResult, err error) { - req, err := lastResults.loadBalancerLoadBalancingRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerLoadBalancingRulesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerLoadBalancingRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancernetworkinterfaces.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancernetworkinterfaces.go deleted file mode 100644 index 586ff96709bd..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancernetworkinterfaces.go +++ /dev/null @@ -1,150 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerNetworkInterfacesClient is the network Client -type LoadBalancerNetworkInterfacesClient struct { - BaseClient -} - -// NewLoadBalancerNetworkInterfacesClient creates an instance of the LoadBalancerNetworkInterfacesClient client. -func NewLoadBalancerNetworkInterfacesClient(subscriptionID string) LoadBalancerNetworkInterfacesClient { - return NewLoadBalancerNetworkInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerNetworkInterfacesClientWithBaseURI creates an instance of the LoadBalancerNetworkInterfacesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewLoadBalancerNetworkInterfacesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerNetworkInterfacesClient { - return LoadBalancerNetworkInterfacesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets associated load balancer network interfaces. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerNetworkInterfacesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InterfaceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerNetworkInterfacesClient.List") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerNetworkInterfacesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerNetworkInterfacesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerNetworkInterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerNetworkInterfacesClient) listNextResults(ctx context.Context, lastResults InterfaceListResult) (result InterfaceListResult, err error) { - req, err := lastResults.interfaceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerNetworkInterfacesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InterfaceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerNetworkInterfacesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalanceroutboundrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalanceroutboundrules.go deleted file mode 100644 index 6212cd6dedb8..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalanceroutboundrules.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerOutboundRulesClient is the network Client -type LoadBalancerOutboundRulesClient struct { - BaseClient -} - -// NewLoadBalancerOutboundRulesClient creates an instance of the LoadBalancerOutboundRulesClient client. -func NewLoadBalancerOutboundRulesClient(subscriptionID string) LoadBalancerOutboundRulesClient { - return NewLoadBalancerOutboundRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerOutboundRulesClientWithBaseURI creates an instance of the LoadBalancerOutboundRulesClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewLoadBalancerOutboundRulesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerOutboundRulesClient { - return LoadBalancerOutboundRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified load balancer outbound rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// outboundRuleName - the name of the outbound rule. -func (client LoadBalancerOutboundRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string) (result OutboundRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, outboundRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerOutboundRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, outboundRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "outboundRuleName": autorest.Encode("path", outboundRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules/{outboundRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerOutboundRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerOutboundRulesClient) GetResponder(resp *http.Response) (result OutboundRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the outbound rules in a load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerOutboundRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerOutboundRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRulesClient.List") - defer func() { - sc := -1 - if result.lborlr.Response.Response != nil { - sc = result.lborlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lborlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "List", resp, "Failure sending request") - return - } - - result.lborlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "List", resp, "Failure responding to request") - return - } - if result.lborlr.hasNextLink() && result.lborlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerOutboundRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/outboundRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerOutboundRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerOutboundRulesClient) ListResponder(resp *http.Response) (result LoadBalancerOutboundRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerOutboundRulesClient) listNextResults(ctx context.Context, lastResults LoadBalancerOutboundRuleListResult) (result LoadBalancerOutboundRuleListResult, err error) { - req, err := lastResults.loadBalancerOutboundRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerOutboundRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerOutboundRulesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerOutboundRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerprobes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerprobes.go deleted file mode 100644 index 4ba2205c3610..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerprobes.go +++ /dev/null @@ -1,228 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancerProbesClient is the network Client -type LoadBalancerProbesClient struct { - BaseClient -} - -// NewLoadBalancerProbesClient creates an instance of the LoadBalancerProbesClient client. -func NewLoadBalancerProbesClient(subscriptionID string) LoadBalancerProbesClient { - return NewLoadBalancerProbesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancerProbesClientWithBaseURI creates an instance of the LoadBalancerProbesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewLoadBalancerProbesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerProbesClient { - return LoadBalancerProbesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets load balancer probe. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// probeName - the name of the probe. -func (client LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string) (result Probe, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, probeName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancerProbesClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "probeName": autorest.Encode("path", probeName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerProbesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancerProbesClient) GetResponder(resp *http.Response) (result Probe, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancer probes. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancerProbesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerProbeListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbesClient.List") - defer func() { - sc := -1 - if result.lbplr.Response.Response != nil { - sc = result.lbplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lbplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure sending request") - return - } - - result.lbplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure responding to request") - return - } - if result.lbplr.hasNextLink() && result.lbplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancerProbesClient) ListPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancerProbesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancerProbesClient) ListResponder(resp *http.Response) (result LoadBalancerProbeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancerProbesClient) listNextResults(ctx context.Context, lastResults LoadBalancerProbeListResult) (result LoadBalancerProbeListResult, err error) { - req, err := lastResults.loadBalancerProbeListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancerProbesClient) ListComplete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerProbeListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, loadBalancerName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancers.go deleted file mode 100644 index ed722a05f867..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancers.go +++ /dev/null @@ -1,743 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LoadBalancersClient is the network Client -type LoadBalancersClient struct { - BaseClient -} - -// NewLoadBalancersClient creates an instance of the LoadBalancersClient client. -func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient { - return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLoadBalancersClientWithBaseURI creates an instance of the LoadBalancersClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient { - return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// parameters - parameters supplied to the create or update load balancer operation. -func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (result LoadBalancersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancersCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancer, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -func (client LoadBalancersClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBalancersDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified load balancer. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// expand - expands referenced resources. -func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LoadBalancersClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) GetResponder(resp *http.Response) (result LoadBalancer, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the load balancers in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client LoadBalancersClient) List(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.List") - defer func() { - sc := -1 - if result.lblr.Response.Response != nil { - sc = result.lblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure sending request") - return - } - - result.lblr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to request") - return - } - if result.lblr.hasNextLink() && result.lblr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LoadBalancersClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) ListResponder(resp *http.Response) (result LoadBalancerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LoadBalancersClient) listNextResults(ctx context.Context, lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) { - req, err := lastResults.loadBalancerListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancersClient) ListComplete(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the load balancers in a subscription. -func (client LoadBalancersClient) ListAll(ctx context.Context) (result LoadBalancerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListAll") - defer func() { - sc := -1 - if result.lblr.Response.Response != nil { - sc = result.lblr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.lblr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure sending request") - return - } - - result.lblr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to request") - return - } - if result.lblr.hasNextLink() && result.lblr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client LoadBalancersClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) ListAllResponder(resp *http.Response) (result LoadBalancerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client LoadBalancersClient) listAllNextResults(ctx context.Context, lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) { - req, err := lastResults.loadBalancerListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client LoadBalancersClient) ListAllComplete(ctx context.Context) (result LoadBalancerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListInboundNatRulePortMappings list of inbound NAT rule port mappings. -// Parameters: -// groupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// backendPoolName - the name of the load balancer backend address pool. -// parameters - query inbound NAT rule port mapping request. -func (client LoadBalancersClient) ListInboundNatRulePortMappings(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest) (result LoadBalancersListInboundNatRulePortMappingsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListInboundNatRulePortMappings") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListInboundNatRulePortMappingsPreparer(ctx, groupName, loadBalancerName, backendPoolName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListInboundNatRulePortMappings", nil, "Failure preparing request") - return - } - - result, err = client.ListInboundNatRulePortMappingsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListInboundNatRulePortMappings", result.Response(), "Failure sending request") - return - } - - return -} - -// ListInboundNatRulePortMappingsPreparer prepares the ListInboundNatRulePortMappings request. -func (client LoadBalancersClient) ListInboundNatRulePortMappingsPreparer(ctx context.Context, groupName string, loadBalancerName string, backendPoolName string, parameters QueryInboundNatRulePortMappingRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "backendPoolName": autorest.Encode("path", backendPoolName), - "groupName": autorest.Encode("path", groupName), - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendPoolName}/queryInboundNatRulePortMapping", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListInboundNatRulePortMappingsSender sends the ListInboundNatRulePortMappings request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) ListInboundNatRulePortMappingsSender(req *http.Request) (future LoadBalancersListInboundNatRulePortMappingsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListInboundNatRulePortMappingsResponder handles the response to the ListInboundNatRulePortMappings request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) ListInboundNatRulePortMappingsResponder(resp *http.Response) (result BackendAddressInboundNatRulePortMappings, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SwapPublicIPAddresses swaps VIPs between two load balancers. -// Parameters: -// location - the region where load balancers are located at. -// parameters - parameters that define which VIPs should be swapped. -func (client LoadBalancersClient) SwapPublicIPAddresses(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest) (result LoadBalancersSwapPublicIPAddressesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.SwapPublicIPAddresses") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SwapPublicIPAddressesPreparer(ctx, location, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "SwapPublicIPAddresses", nil, "Failure preparing request") - return - } - - result, err = client.SwapPublicIPAddressesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "SwapPublicIPAddresses", result.Response(), "Failure sending request") - return - } - - return -} - -// SwapPublicIPAddressesPreparer prepares the SwapPublicIPAddresses request. -func (client LoadBalancersClient) SwapPublicIPAddressesPreparer(ctx context.Context, location string, parameters LoadBalancerVipSwapRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/setLoadBalancerFrontendPublicIpAddresses", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SwapPublicIPAddressesSender sends the SwapPublicIPAddresses request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) SwapPublicIPAddressesSender(req *http.Request) (future LoadBalancersSwapPublicIPAddressesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SwapPublicIPAddressesResponder handles the response to the SwapPublicIPAddresses request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) SwapPublicIPAddressesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// UpdateTags updates a load balancer tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// loadBalancerName - the name of the load balancer. -// parameters - parameters supplied to update load balancer tags. -func (client LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (result LoadBalancer, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, loadBalancerName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "loadBalancerName": autorest.Encode("path", loadBalancerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client LoadBalancersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client LoadBalancersClient) UpdateTagsResponder(resp *http.Response) (result LoadBalancer, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/localnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/localnetworkgateways.go deleted file mode 100644 index c1e4015d0681..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/localnetworkgateways.go +++ /dev/null @@ -1,498 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LocalNetworkGatewaysClient is the network Client -type LocalNetworkGatewaysClient struct { - BaseClient -} - -// NewLocalNetworkGatewaysClient creates an instance of the LocalNetworkGatewaysClient client. -func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient { - return NewLocalNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLocalNetworkGatewaysClientWithBaseURI creates an instance of the LocalNetworkGatewaysClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) LocalNetworkGatewaysClient { - return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a local network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// localNetworkGatewayName - the name of the local network gateway. -// parameters - parameters supplied to the create or update local network gateway operation. -func (client LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (result LocalNetworkGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: localNetworkGatewayName, - Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.LocalNetworkGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, localNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future LocalNetworkGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result LocalNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified local network gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// localNetworkGatewayName - the name of the local network gateway. -func (client LocalNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: localNetworkGatewayName, - Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.LocalNetworkGatewaysClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, localNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client LocalNetworkGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) DeleteSender(req *http.Request) (future LocalNetworkGatewaysDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified local network gateway in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// localNetworkGatewayName - the name of the local network gateway. -func (client LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: localNetworkGatewayName, - Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.LocalNetworkGatewaysClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, localNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client LocalNetworkGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (result LocalNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the local network gateways in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client LocalNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result LocalNetworkGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.List") - defer func() { - sc := -1 - if result.lnglr.Response.Response != nil { - sc = result.lnglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lnglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.lnglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.lnglr.hasNextLink() && result.lnglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client LocalNetworkGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) ListResponder(resp *http.Response) (result LocalNetworkGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client LocalNetworkGatewaysClient) listNextResults(ctx context.Context, lastResults LocalNetworkGatewayListResult) (result LocalNetworkGatewayListResult, err error) { - req, err := lastResults.localNetworkGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client LocalNetworkGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result LocalNetworkGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// UpdateTags updates a local network gateway tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// localNetworkGatewayName - the name of the local network gateway. -// parameters - parameters supplied to update local network gateway tags. -func (client LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject) (result LocalNetworkGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: localNetworkGatewayName, - Constraints: []validation.Constraint{{Target: "localNetworkGatewayName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.LocalNetworkGatewaysClient", "UpdateTags", err.Error()) - } - - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, localNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client LocalNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client LocalNetworkGatewaysClient) UpdateTagsResponder(resp *http.Response) (result LocalNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managementgroupnetworkmanagerconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managementgroupnetworkmanagerconnections.go deleted file mode 100644 index 177be9f9bd94..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managementgroupnetworkmanagerconnections.go +++ /dev/null @@ -1,397 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ManagementGroupNetworkManagerConnectionsClient is the network Client -type ManagementGroupNetworkManagerConnectionsClient struct { - BaseClient -} - -// NewManagementGroupNetworkManagerConnectionsClient creates an instance of the -// ManagementGroupNetworkManagerConnectionsClient client. -func NewManagementGroupNetworkManagerConnectionsClient(subscriptionID string) ManagementGroupNetworkManagerConnectionsClient { - return NewManagementGroupNetworkManagerConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagementGroupNetworkManagerConnectionsClientWithBaseURI creates an instance of the -// ManagementGroupNetworkManagerConnectionsClient client using a custom endpoint. Use this when interacting with an -// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewManagementGroupNetworkManagerConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ManagementGroupNetworkManagerConnectionsClient { - return ManagementGroupNetworkManagerConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a network manager connection on this management group. -// Parameters: -// parameters - network manager connection to be created/updated. -// managementGroupID - the management group Id which uniquely identify the Microsoft Azure management group. -// networkManagerConnectionName - name for the network manager connection. -func (client ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdate(ctx context.Context, parameters ManagerConnection, managementGroupID string, networkManagerConnectionName string) (result ManagerConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, parameters, managementGroupID, networkManagerConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, parameters ManagerConnection, managementGroupID string, networkManagerConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managementGroupId": autorest.Encode("path", managementGroupID), - "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagerConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete specified pending connection created by this management group. -// Parameters: -// managementGroupID - the management group Id which uniquely identify the Microsoft Azure management group. -// networkManagerConnectionName - name for the network manager connection. -func (client ManagementGroupNetworkManagerConnectionsClient) Delete(ctx context.Context, managementGroupID string, networkManagerConnectionName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, managementGroupID, networkManagerConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagementGroupNetworkManagerConnectionsClient) DeletePreparer(ctx context.Context, managementGroupID string, networkManagerConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managementGroupId": autorest.Encode("path", managementGroupID), - "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ManagementGroupNetworkManagerConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ManagementGroupNetworkManagerConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get a specified connection created by this management group. -// Parameters: -// managementGroupID - the management group Id which uniquely identify the Microsoft Azure management group. -// networkManagerConnectionName - name for the network manager connection. -func (client ManagementGroupNetworkManagerConnectionsClient) Get(ctx context.Context, managementGroupID string, networkManagerConnectionName string) (result ManagerConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, managementGroupID, networkManagerConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagementGroupNetworkManagerConnectionsClient) GetPreparer(ctx context.Context, managementGroupID string, networkManagerConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managementGroupId": autorest.Encode("path", managementGroupID), - "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ManagementGroupNetworkManagerConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ManagementGroupNetworkManagerConnectionsClient) GetResponder(resp *http.Response) (result ManagerConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all network manager connections created by this management group. -// Parameters: -// managementGroupID - the management group Id which uniquely identify the Microsoft Azure management group. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client ManagementGroupNetworkManagerConnectionsClient) List(ctx context.Context, managementGroupID string, top *int32, skipToken string) (result ManagerConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.List") - defer func() { - sc := -1 - if result.mclr.Response.Response != nil { - sc = result.mclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.ManagementGroupNetworkManagerConnectionsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, managementGroupID, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.mclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.mclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.mclr.hasNextLink() && result.mclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ManagementGroupNetworkManagerConnectionsClient) ListPreparer(ctx context.Context, managementGroupID string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "managementGroupId": autorest.Encode("path", managementGroupID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ManagementGroupNetworkManagerConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ManagementGroupNetworkManagerConnectionsClient) ListResponder(resp *http.Response) (result ManagerConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ManagementGroupNetworkManagerConnectionsClient) listNextResults(ctx context.Context, lastResults ManagerConnectionListResult) (result ManagerConnectionListResult, err error) { - req, err := lastResults.managerConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagementGroupNetworkManagerConnectionsClient) ListComplete(ctx context.Context, managementGroupID string, top *int32, skipToken string) (result ManagerConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, managementGroupID, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managercommits.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managercommits.go deleted file mode 100644 index 8a88e396b262..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managercommits.go +++ /dev/null @@ -1,121 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ManagerCommitsClient is the network Client -type ManagerCommitsClient struct { - BaseClient -} - -// NewManagerCommitsClient creates an instance of the ManagerCommitsClient client. -func NewManagerCommitsClient(subscriptionID string) ManagerCommitsClient { - return NewManagerCommitsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagerCommitsClientWithBaseURI creates an instance of the ManagerCommitsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewManagerCommitsClientWithBaseURI(baseURI string, subscriptionID string) ManagerCommitsClient { - return ManagerCommitsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Post post a Network Manager Commit. -// Parameters: -// parameters - parameters supplied to specify which Managed Network commit is. -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -func (client ManagerCommitsClient) Post(ctx context.Context, parameters ManagerCommit, resourceGroupName string, networkManagerName string) (result ManagerCommitsPostFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagerCommitsClient.Post") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetLocations", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.ManagerCommitsClient", "Post", err.Error()) - } - - req, err := client.PostPreparer(ctx, parameters, resourceGroupName, networkManagerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagerCommitsClient", "Post", nil, "Failure preparing request") - return - } - - result, err = client.PostSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagerCommitsClient", "Post", result.Response(), "Failure sending request") - return - } - - return -} - -// PostPreparer prepares the Post request. -func (client ManagerCommitsClient) PostPreparer(ctx context.Context, parameters ManagerCommit, resourceGroupName string, networkManagerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.CommitID = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commit", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PostSender sends the Post request. The method will close the -// http.Response Body if it receives an error. -func (client ManagerCommitsClient) PostSender(req *http.Request) (future ManagerCommitsPostFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PostResponder handles the response to the Post request. The method always -// closes the http.Response Body. -func (client ManagerCommitsClient) PostResponder(resp *http.Response) (result ManagerCommit, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managerdeploymentstatus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managerdeploymentstatus.go deleted file mode 100644 index eff571d69866..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managerdeploymentstatus.go +++ /dev/null @@ -1,126 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ManagerDeploymentStatusClient is the network Client -type ManagerDeploymentStatusClient struct { - BaseClient -} - -// NewManagerDeploymentStatusClient creates an instance of the ManagerDeploymentStatusClient client. -func NewManagerDeploymentStatusClient(subscriptionID string) ManagerDeploymentStatusClient { - return NewManagerDeploymentStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagerDeploymentStatusClientWithBaseURI creates an instance of the ManagerDeploymentStatusClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewManagerDeploymentStatusClientWithBaseURI(baseURI string, subscriptionID string) ManagerDeploymentStatusClient { - return ManagerDeploymentStatusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List post to List of Network Manager Deployment Status. -// Parameters: -// parameters - parameters supplied to specify which Managed Network deployment status is. -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -func (client ManagerDeploymentStatusClient) List(ctx context.Context, parameters ManagerDeploymentStatusParameter, resourceGroupName string, networkManagerName string, top *int32) (result ManagerDeploymentStatusListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagerDeploymentStatusClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.ManagerDeploymentStatusClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, parameters, resourceGroupName, networkManagerName, top) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagerDeploymentStatusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagerDeploymentStatusClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagerDeploymentStatusClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ManagerDeploymentStatusClient) ListPreparer(ctx context.Context, parameters ManagerDeploymentStatusParameter, resourceGroupName string, networkManagerName string, top *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listDeploymentStatus", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ManagerDeploymentStatusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ManagerDeploymentStatusClient) ListResponder(resp *http.Response) (result ManagerDeploymentStatusListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managers.go deleted file mode 100644 index f569db33cbc0..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managers.go +++ /dev/null @@ -1,630 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ManagersClient is the network Client -type ManagersClient struct { - BaseClient -} - -// NewManagersClient creates an instance of the ManagersClient client. -func NewManagersClient(subscriptionID string) ManagersClient { - return NewManagersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewManagersClientWithBaseURI creates an instance of the ManagersClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewManagersClientWithBaseURI(baseURI string, subscriptionID string) ManagersClient { - return ManagersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a Network Manager. -// Parameters: -// parameters - parameters supplied to specify which network manager is. -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -func (client ManagersClient) CreateOrUpdate(ctx context.Context, parameters Manager, resourceGroupName string, networkManagerName string) (result Manager, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ManagerProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagerProperties.NetworkManagerScopes", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ManagerProperties.NetworkManagerScopeAccesses", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.ManagersClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, parameters, resourceGroupName, networkManagerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagersClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ManagersClient) CreateOrUpdatePreparer(ctx context.Context, parameters Manager, resourceGroupName string, networkManagerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ManagersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ManagersClient) CreateOrUpdateResponder(resp *http.Response) (result Manager, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a network manager. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been -// deployed, the service will do a cleanup deployment in the background, prior to the delete. -func (client ManagersClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, force *bool) (result ManagersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, force) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ManagersClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, force *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if force != nil { - queryParameters["force"] = autorest.Encode("query", *force) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ManagersClient) DeleteSender(req *http.Request) (future ManagersDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ManagersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Network Manager. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -func (client ManagersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string) (result Manager, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ManagersClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ManagersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ManagersClient) GetResponder(resp *http.Response) (result Manager, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list network managers in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client ManagersClient) List(ctx context.Context, resourceGroupName string, top *int32, skipToken string) (result ManagerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.List") - defer func() { - sc := -1 - if result.mlr.Response.Response != nil { - sc = result.mlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.ManagersClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.mlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagersClient", "List", resp, "Failure sending request") - return - } - - result.mlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "List", resp, "Failure responding to request") - return - } - if result.mlr.hasNextLink() && result.mlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ManagersClient) ListPreparer(ctx context.Context, resourceGroupName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ManagersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ManagersClient) ListResponder(resp *http.Response) (result ManagerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ManagersClient) listNextResults(ctx context.Context, lastResults ManagerListResult) (result ManagerListResult, err error) { - req, err := lastResults.managerListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ManagersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ManagersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagersClient) ListComplete(ctx context.Context, resourceGroupName string, top *int32, skipToken string) (result ManagerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, top, skipToken) - return -} - -// ListBySubscription list all network managers in a subscription. -// Parameters: -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client ManagersClient) ListBySubscription(ctx context.Context, top *int32, skipToken string) (result ManagerListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.ListBySubscription") - defer func() { - sc := -1 - if result.mlr.Response.Response != nil { - sc = result.mlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.ManagersClient", "ListBySubscription", err.Error()) - } - - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.mlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagersClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.mlr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.mlr.hasNextLink() && result.mlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ManagersClient) ListBySubscriptionPreparer(ctx context.Context, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client ManagersClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client ManagersClient) ListBySubscriptionResponder(resp *http.Response) (result ManagerListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client ManagersClient) listBySubscriptionNextResults(ctx context.Context, lastResults ManagerListResult) (result ManagerListResult, err error) { - req, err := lastResults.managerListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ManagersClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ManagersClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ManagersClient) ListBySubscriptionComplete(ctx context.Context, top *int32, skipToken string) (result ManagerListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx, top, skipToken) - return -} - -// Patch patch NetworkManager. -// Parameters: -// parameters - parameters supplied to specify which network manager is. -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -func (client ManagersClient) Patch(ctx context.Context, parameters PatchObject, resourceGroupName string, networkManagerName string) (result Manager, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.Patch") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PatchPreparer(ctx, parameters, resourceGroupName, networkManagerName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "Patch", nil, "Failure preparing request") - return - } - - resp, err := client.PatchSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ManagersClient", "Patch", resp, "Failure sending request") - return - } - - result, err = client.PatchResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersClient", "Patch", resp, "Failure responding to request") - return - } - - return -} - -// PatchPreparer prepares the Patch request. -func (client ManagersClient) PatchPreparer(ctx context.Context, parameters PatchObject, resourceGroupName string, networkManagerName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PatchSender sends the Patch request. The method will close the -// http.Response Body if it receives an error. -func (client ManagersClient) PatchSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// PatchResponder handles the response to the Patch request. The method always -// closes the http.Response Body. -func (client ManagersClient) PatchResponder(resp *http.Response) (result Manager, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/models.go deleted file mode 100644 index 9695388e700f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/models.go +++ /dev/null @@ -1,58052 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - -// AadAuthenticationParameters AAD Vpn authentication type related parameters. -type AadAuthenticationParameters struct { - // AadTenant - AAD Vpn authentication parameter AAD tenant. - AadTenant *string `json:"aadTenant,omitempty"` - // AadAudience - AAD Vpn authentication parameter AAD audience. - AadAudience *string `json:"aadAudience,omitempty"` - // AadIssuer - AAD Vpn authentication parameter AAD issuer. - AadIssuer *string `json:"aadIssuer,omitempty"` -} - -// Action action to be taken on a route matching a RouteMap criterion. -type Action struct { - // Type - Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.'. Possible values include: 'RouteMapActionTypeUnknown', 'RouteMapActionTypeRemove', 'RouteMapActionTypeAdd', 'RouteMapActionTypeReplace', 'RouteMapActionTypeDrop' - Type RouteMapActionType `json:"type,omitempty"` - // Parameters - List of parameters relevant to the action.For instance if type is drop then parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN numbers to be added - Parameters *[]Parameter `json:"parameters,omitempty"` -} - -// BasicActiveBaseSecurityAdminRule network base admin rule. -type BasicActiveBaseSecurityAdminRule interface { - AsActiveSecurityAdminRule() (*ActiveSecurityAdminRule, bool) - AsActiveDefaultSecurityAdminRule() (*ActiveDefaultSecurityAdminRule, bool) - AsActiveBaseSecurityAdminRule() (*ActiveBaseSecurityAdminRule, bool) -} - -// ActiveBaseSecurityAdminRule network base admin rule. -type ActiveBaseSecurityAdminRule struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // CommitTime - Deployment time string. - CommitTime *date.Time `json:"commitTime,omitempty"` - // Region - Deployment region. - Region *string `json:"region,omitempty"` - // ConfigurationDescription - A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - // RuleCollectionDescription - A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - // RuleCollectionAppliesToGroups - Groups for rule collection - RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - // RuleGroups - Effective configuration groups. - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` - // Kind - Possible values include: 'KindActiveBaseSecurityAdminRule', 'KindCustom', 'KindDefault' - Kind Kind `json:"kind,omitempty"` -} - -func unmarshalBasicActiveBaseSecurityAdminRule(body []byte) (BasicActiveBaseSecurityAdminRule, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindCustom): - var asar ActiveSecurityAdminRule - err := json.Unmarshal(body, &asar) - return asar, err - case string(KindDefault): - var adsar ActiveDefaultSecurityAdminRule - err := json.Unmarshal(body, &adsar) - return adsar, err - default: - var absar ActiveBaseSecurityAdminRule - err := json.Unmarshal(body, &absar) - return absar, err - } -} -func unmarshalBasicActiveBaseSecurityAdminRuleArray(body []byte) ([]BasicActiveBaseSecurityAdminRule, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - absarArray := make([]BasicActiveBaseSecurityAdminRule, len(rawMessages)) - - for index, rawMessage := range rawMessages { - absar, err := unmarshalBasicActiveBaseSecurityAdminRule(*rawMessage) - if err != nil { - return nil, err - } - absarArray[index] = absar - } - return absarArray, nil -} - -// MarshalJSON is the custom marshaler for ActiveBaseSecurityAdminRule. -func (absar ActiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { - absar.Kind = KindActiveBaseSecurityAdminRule - objectMap := make(map[string]interface{}) - if absar.ID != nil { - objectMap["id"] = absar.ID - } - if absar.CommitTime != nil { - objectMap["commitTime"] = absar.CommitTime - } - if absar.Region != nil { - objectMap["region"] = absar.Region - } - if absar.ConfigurationDescription != nil { - objectMap["configurationDescription"] = absar.ConfigurationDescription - } - if absar.RuleCollectionDescription != nil { - objectMap["ruleCollectionDescription"] = absar.RuleCollectionDescription - } - if absar.RuleCollectionAppliesToGroups != nil { - objectMap["ruleCollectionAppliesToGroups"] = absar.RuleCollectionAppliesToGroups - } - if absar.RuleGroups != nil { - objectMap["ruleGroups"] = absar.RuleGroups - } - if absar.Kind != "" { - objectMap["kind"] = absar.Kind - } - return json.Marshal(objectMap) -} - -// AsActiveSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveBaseSecurityAdminRule. -func (absar ActiveBaseSecurityAdminRule) AsActiveSecurityAdminRule() (*ActiveSecurityAdminRule, bool) { - return nil, false -} - -// AsActiveDefaultSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveBaseSecurityAdminRule. -func (absar ActiveBaseSecurityAdminRule) AsActiveDefaultSecurityAdminRule() (*ActiveDefaultSecurityAdminRule, bool) { - return nil, false -} - -// AsActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveBaseSecurityAdminRule. -func (absar ActiveBaseSecurityAdminRule) AsActiveBaseSecurityAdminRule() (*ActiveBaseSecurityAdminRule, bool) { - return &absar, true -} - -// AsBasicActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveBaseSecurityAdminRule. -func (absar ActiveBaseSecurityAdminRule) AsBasicActiveBaseSecurityAdminRule() (BasicActiveBaseSecurityAdminRule, bool) { - return &absar, true -} - -// ActiveConfigurationParameter effective Virtual Networks Parameter. -type ActiveConfigurationParameter struct { - // Regions - List of regions. - Regions *[]string `json:"regions,omitempty"` - // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// ActiveConnectivityConfiguration active connectivity configuration. -type ActiveConnectivityConfiguration struct { - // CommitTime - Deployment time string. - CommitTime *date.Time `json:"commitTime,omitempty"` - // Region - Deployment region. - Region *string `json:"region,omitempty"` - // ID - Connectivity configuration ID. - ID *string `json:"id,omitempty"` - // ConnectivityConfigurationProperties - Properties of a network manager connectivity configuration - *ConnectivityConfigurationProperties `json:"properties,omitempty"` - // ConfigurationGroups - Effective configuration groups. - ConfigurationGroups *[]ConfigurationGroup `json:"configurationGroups,omitempty"` -} - -// MarshalJSON is the custom marshaler for ActiveConnectivityConfiguration. -func (acc ActiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if acc.CommitTime != nil { - objectMap["commitTime"] = acc.CommitTime - } - if acc.Region != nil { - objectMap["region"] = acc.Region - } - if acc.ID != nil { - objectMap["id"] = acc.ID - } - if acc.ConnectivityConfigurationProperties != nil { - objectMap["properties"] = acc.ConnectivityConfigurationProperties - } - if acc.ConfigurationGroups != nil { - objectMap["configurationGroups"] = acc.ConfigurationGroups - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ActiveConnectivityConfiguration struct. -func (acc *ActiveConnectivityConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "commitTime": - if v != nil { - var commitTime date.Time - err = json.Unmarshal(*v, &commitTime) - if err != nil { - return err - } - acc.CommitTime = &commitTime - } - case "region": - if v != nil { - var region string - err = json.Unmarshal(*v, ®ion) - if err != nil { - return err - } - acc.Region = ®ion - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - acc.ID = &ID - } - case "properties": - if v != nil { - var connectivityConfigurationProperties ConnectivityConfigurationProperties - err = json.Unmarshal(*v, &connectivityConfigurationProperties) - if err != nil { - return err - } - acc.ConnectivityConfigurationProperties = &connectivityConfigurationProperties - } - case "configurationGroups": - if v != nil { - var configurationGroups []ConfigurationGroup - err = json.Unmarshal(*v, &configurationGroups) - if err != nil { - return err - } - acc.ConfigurationGroups = &configurationGroups - } - } - } - - return nil -} - -// ActiveConnectivityConfigurationsListResult result of the request to list active connectivity -// configurations. It contains a list of active connectivity configurations and a skiptoken to get the next -// set of results. -type ActiveConnectivityConfigurationsListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of active connectivity configurations. - Value *[]ActiveConnectivityConfiguration `json:"value,omitempty"` - // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// ActiveDefaultSecurityAdminRule network default admin rule. -type ActiveDefaultSecurityAdminRule struct { - // DefaultAdminPropertiesFormat - Indicates the properties of the default security admin rule - *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // CommitTime - Deployment time string. - CommitTime *date.Time `json:"commitTime,omitempty"` - // Region - Deployment region. - Region *string `json:"region,omitempty"` - // ConfigurationDescription - A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - // RuleCollectionDescription - A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - // RuleCollectionAppliesToGroups - Groups for rule collection - RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - // RuleGroups - Effective configuration groups. - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` - // Kind - Possible values include: 'KindActiveBaseSecurityAdminRule', 'KindCustom', 'KindDefault' - Kind Kind `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for ActiveDefaultSecurityAdminRule. -func (adsar ActiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { - adsar.Kind = KindDefault - objectMap := make(map[string]interface{}) - if adsar.DefaultAdminPropertiesFormat != nil { - objectMap["properties"] = adsar.DefaultAdminPropertiesFormat - } - if adsar.ID != nil { - objectMap["id"] = adsar.ID - } - if adsar.CommitTime != nil { - objectMap["commitTime"] = adsar.CommitTime - } - if adsar.Region != nil { - objectMap["region"] = adsar.Region - } - if adsar.ConfigurationDescription != nil { - objectMap["configurationDescription"] = adsar.ConfigurationDescription - } - if adsar.RuleCollectionDescription != nil { - objectMap["ruleCollectionDescription"] = adsar.RuleCollectionDescription - } - if adsar.RuleCollectionAppliesToGroups != nil { - objectMap["ruleCollectionAppliesToGroups"] = adsar.RuleCollectionAppliesToGroups - } - if adsar.RuleGroups != nil { - objectMap["ruleGroups"] = adsar.RuleGroups - } - if adsar.Kind != "" { - objectMap["kind"] = adsar.Kind - } - return json.Marshal(objectMap) -} - -// AsActiveSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveDefaultSecurityAdminRule. -func (adsar ActiveDefaultSecurityAdminRule) AsActiveSecurityAdminRule() (*ActiveSecurityAdminRule, bool) { - return nil, false -} - -// AsActiveDefaultSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveDefaultSecurityAdminRule. -func (adsar ActiveDefaultSecurityAdminRule) AsActiveDefaultSecurityAdminRule() (*ActiveDefaultSecurityAdminRule, bool) { - return &adsar, true -} - -// AsActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveDefaultSecurityAdminRule. -func (adsar ActiveDefaultSecurityAdminRule) AsActiveBaseSecurityAdminRule() (*ActiveBaseSecurityAdminRule, bool) { - return nil, false -} - -// AsBasicActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveDefaultSecurityAdminRule. -func (adsar ActiveDefaultSecurityAdminRule) AsBasicActiveBaseSecurityAdminRule() (BasicActiveBaseSecurityAdminRule, bool) { - return &adsar, true -} - -// UnmarshalJSON is the custom unmarshaler for ActiveDefaultSecurityAdminRule struct. -func (adsar *ActiveDefaultSecurityAdminRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var defaultAdminPropertiesFormat DefaultAdminPropertiesFormat - err = json.Unmarshal(*v, &defaultAdminPropertiesFormat) - if err != nil { - return err - } - adsar.DefaultAdminPropertiesFormat = &defaultAdminPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - adsar.ID = &ID - } - case "commitTime": - if v != nil { - var commitTime date.Time - err = json.Unmarshal(*v, &commitTime) - if err != nil { - return err - } - adsar.CommitTime = &commitTime - } - case "region": - if v != nil { - var region string - err = json.Unmarshal(*v, ®ion) - if err != nil { - return err - } - adsar.Region = ®ion - } - case "configurationDescription": - if v != nil { - var configurationDescription string - err = json.Unmarshal(*v, &configurationDescription) - if err != nil { - return err - } - adsar.ConfigurationDescription = &configurationDescription - } - case "ruleCollectionDescription": - if v != nil { - var ruleCollectionDescription string - err = json.Unmarshal(*v, &ruleCollectionDescription) - if err != nil { - return err - } - adsar.RuleCollectionDescription = &ruleCollectionDescription - } - case "ruleCollectionAppliesToGroups": - if v != nil { - var ruleCollectionAppliesToGroups []ManagerSecurityGroupItem - err = json.Unmarshal(*v, &ruleCollectionAppliesToGroups) - if err != nil { - return err - } - adsar.RuleCollectionAppliesToGroups = &ruleCollectionAppliesToGroups - } - case "ruleGroups": - if v != nil { - var ruleGroups []ConfigurationGroup - err = json.Unmarshal(*v, &ruleGroups) - if err != nil { - return err - } - adsar.RuleGroups = &ruleGroups - } - case "kind": - if v != nil { - var kind Kind - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - adsar.Kind = kind - } - } - } - - return nil -} - -// ActiveSecurityAdminRule network admin rule. -type ActiveSecurityAdminRule struct { - // AdminPropertiesFormat - Indicates the properties of the security admin rule - *AdminPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // CommitTime - Deployment time string. - CommitTime *date.Time `json:"commitTime,omitempty"` - // Region - Deployment region. - Region *string `json:"region,omitempty"` - // ConfigurationDescription - A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - // RuleCollectionDescription - A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - // RuleCollectionAppliesToGroups - Groups for rule collection - RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - // RuleGroups - Effective configuration groups. - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` - // Kind - Possible values include: 'KindActiveBaseSecurityAdminRule', 'KindCustom', 'KindDefault' - Kind Kind `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for ActiveSecurityAdminRule. -func (asar ActiveSecurityAdminRule) MarshalJSON() ([]byte, error) { - asar.Kind = KindCustom - objectMap := make(map[string]interface{}) - if asar.AdminPropertiesFormat != nil { - objectMap["properties"] = asar.AdminPropertiesFormat - } - if asar.ID != nil { - objectMap["id"] = asar.ID - } - if asar.CommitTime != nil { - objectMap["commitTime"] = asar.CommitTime - } - if asar.Region != nil { - objectMap["region"] = asar.Region - } - if asar.ConfigurationDescription != nil { - objectMap["configurationDescription"] = asar.ConfigurationDescription - } - if asar.RuleCollectionDescription != nil { - objectMap["ruleCollectionDescription"] = asar.RuleCollectionDescription - } - if asar.RuleCollectionAppliesToGroups != nil { - objectMap["ruleCollectionAppliesToGroups"] = asar.RuleCollectionAppliesToGroups - } - if asar.RuleGroups != nil { - objectMap["ruleGroups"] = asar.RuleGroups - } - if asar.Kind != "" { - objectMap["kind"] = asar.Kind - } - return json.Marshal(objectMap) -} - -// AsActiveSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveSecurityAdminRule. -func (asar ActiveSecurityAdminRule) AsActiveSecurityAdminRule() (*ActiveSecurityAdminRule, bool) { - return &asar, true -} - -// AsActiveDefaultSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveSecurityAdminRule. -func (asar ActiveSecurityAdminRule) AsActiveDefaultSecurityAdminRule() (*ActiveDefaultSecurityAdminRule, bool) { - return nil, false -} - -// AsActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveSecurityAdminRule. -func (asar ActiveSecurityAdminRule) AsActiveBaseSecurityAdminRule() (*ActiveBaseSecurityAdminRule, bool) { - return nil, false -} - -// AsBasicActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveSecurityAdminRule. -func (asar ActiveSecurityAdminRule) AsBasicActiveBaseSecurityAdminRule() (BasicActiveBaseSecurityAdminRule, bool) { - return &asar, true -} - -// UnmarshalJSON is the custom unmarshaler for ActiveSecurityAdminRule struct. -func (asar *ActiveSecurityAdminRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var adminPropertiesFormat AdminPropertiesFormat - err = json.Unmarshal(*v, &adminPropertiesFormat) - if err != nil { - return err - } - asar.AdminPropertiesFormat = &adminPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - asar.ID = &ID - } - case "commitTime": - if v != nil { - var commitTime date.Time - err = json.Unmarshal(*v, &commitTime) - if err != nil { - return err - } - asar.CommitTime = &commitTime - } - case "region": - if v != nil { - var region string - err = json.Unmarshal(*v, ®ion) - if err != nil { - return err - } - asar.Region = ®ion - } - case "configurationDescription": - if v != nil { - var configurationDescription string - err = json.Unmarshal(*v, &configurationDescription) - if err != nil { - return err - } - asar.ConfigurationDescription = &configurationDescription - } - case "ruleCollectionDescription": - if v != nil { - var ruleCollectionDescription string - err = json.Unmarshal(*v, &ruleCollectionDescription) - if err != nil { - return err - } - asar.RuleCollectionDescription = &ruleCollectionDescription - } - case "ruleCollectionAppliesToGroups": - if v != nil { - var ruleCollectionAppliesToGroups []ManagerSecurityGroupItem - err = json.Unmarshal(*v, &ruleCollectionAppliesToGroups) - if err != nil { - return err - } - asar.RuleCollectionAppliesToGroups = &ruleCollectionAppliesToGroups - } - case "ruleGroups": - if v != nil { - var ruleGroups []ConfigurationGroup - err = json.Unmarshal(*v, &ruleGroups) - if err != nil { - return err - } - asar.RuleGroups = &ruleGroups - } - case "kind": - if v != nil { - var kind Kind - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - asar.Kind = kind - } - } - } - - return nil -} - -// ActiveSecurityAdminRulesListResult result of the request to list active security admin rules. It -// contains a list of active security admin rules and a skiptoken to get the next set of results. -type ActiveSecurityAdminRulesListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of active security admin rules. - Value *[]BasicActiveBaseSecurityAdminRule `json:"value,omitempty"` - // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ActiveSecurityAdminRulesListResult struct. -func (asarlr *ActiveSecurityAdminRulesListResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "value": - if v != nil { - value, err := unmarshalBasicActiveBaseSecurityAdminRuleArray(*v) - if err != nil { - return err - } - asarlr.Value = &value - } - case "skipToken": - if v != nil { - var skipToken string - err = json.Unmarshal(*v, &skipToken) - if err != nil { - return err - } - asarlr.SkipToken = &skipToken - } - } - } - - return nil -} - -// AddressPrefixItem address prefix item. -type AddressPrefixItem struct { - // AddressPrefix - Address prefix. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // AddressPrefixType - Address prefix type. Possible values include: 'IPPrefix', 'ServiceTag' - AddressPrefixType AddressPrefixType `json:"addressPrefixType,omitempty"` -} - -// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the -// virtual network. -type AddressSpace struct { - // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} - -// AdminPropertiesFormat security admin rule resource. -type AdminPropertiesFormat struct { - // Description - A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - // Protocol - Network protocol this rule applies to. Possible values include: 'SecurityConfigurationRuleProtocolTCP', 'SecurityConfigurationRuleProtocolUDP', 'SecurityConfigurationRuleProtocolIcmp', 'SecurityConfigurationRuleProtocolEsp', 'SecurityConfigurationRuleProtocolAny', 'SecurityConfigurationRuleProtocolAh' - Protocol SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - // Sources - The CIDR or source IP ranges. - Sources *[]AddressPrefixItem `json:"sources,omitempty"` - // Destinations - The destination address prefixes. CIDR or destination IP ranges. - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - // SourcePortRanges - The source port ranges. - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - // DestinationPortRanges - The destination port ranges. - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - // Access - Indicates the access allowed for this particular rule. Possible values include: 'SecurityConfigurationRuleAccessAllow', 'SecurityConfigurationRuleAccessDeny', 'SecurityConfigurationRuleAccessAlwaysAllow' - Access SecurityConfigurationRuleAccess `json:"access,omitempty"` - // Priority - The priority of the rule. The value can be between 1 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. - Priority *int32 `json:"priority,omitempty"` - // Direction - Indicates if the traffic matched against the rule in inbound or outbound. Possible values include: 'SecurityConfigurationRuleDirectionInbound', 'SecurityConfigurationRuleDirectionOutbound' - Direction SecurityConfigurationRuleDirection `json:"direction,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AdminPropertiesFormat. -func (apf AdminPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if apf.Description != nil { - objectMap["description"] = apf.Description - } - if apf.Protocol != "" { - objectMap["protocol"] = apf.Protocol - } - if apf.Sources != nil { - objectMap["sources"] = apf.Sources - } - if apf.Destinations != nil { - objectMap["destinations"] = apf.Destinations - } - if apf.SourcePortRanges != nil { - objectMap["sourcePortRanges"] = apf.SourcePortRanges - } - if apf.DestinationPortRanges != nil { - objectMap["destinationPortRanges"] = apf.DestinationPortRanges - } - if apf.Access != "" { - objectMap["access"] = apf.Access - } - if apf.Priority != nil { - objectMap["priority"] = apf.Priority - } - if apf.Direction != "" { - objectMap["direction"] = apf.Direction - } - return json.Marshal(objectMap) -} - -// AdminRule network admin rule. -type AdminRule struct { - // AdminPropertiesFormat - Indicates the properties of the security admin rule - *AdminPropertiesFormat `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Kind - Possible values include: 'KindBasicBaseAdminRuleKindBaseAdminRule', 'KindBasicBaseAdminRuleKindCustom', 'KindBasicBaseAdminRuleKindDefault' - Kind KindBasicBaseAdminRule `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for AdminRule. -func (ar AdminRule) MarshalJSON() ([]byte, error) { - ar.Kind = KindBasicBaseAdminRuleKindCustom - objectMap := make(map[string]interface{}) - if ar.AdminPropertiesFormat != nil { - objectMap["properties"] = ar.AdminPropertiesFormat - } - if ar.Kind != "" { - objectMap["kind"] = ar.Kind - } - return json.Marshal(objectMap) -} - -// AsAdminRule is the BasicBaseAdminRule implementation for AdminRule. -func (ar AdminRule) AsAdminRule() (*AdminRule, bool) { - return &ar, true -} - -// AsDefaultAdminRule is the BasicBaseAdminRule implementation for AdminRule. -func (ar AdminRule) AsDefaultAdminRule() (*DefaultAdminRule, bool) { - return nil, false -} - -// AsBaseAdminRule is the BasicBaseAdminRule implementation for AdminRule. -func (ar AdminRule) AsBaseAdminRule() (*BaseAdminRule, bool) { - return nil, false -} - -// AsBasicBaseAdminRule is the BasicBaseAdminRule implementation for AdminRule. -func (ar AdminRule) AsBasicBaseAdminRule() (BasicBaseAdminRule, bool) { - return &ar, true -} - -// UnmarshalJSON is the custom unmarshaler for AdminRule struct. -func (ar *AdminRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var adminPropertiesFormat AdminPropertiesFormat - err = json.Unmarshal(*v, &adminPropertiesFormat) - if err != nil { - return err - } - ar.AdminPropertiesFormat = &adminPropertiesFormat - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - ar.SystemData = &systemData - } - case "kind": - if v != nil { - var kind KindBasicBaseAdminRule - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - ar.Kind = kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ar.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ar.Etag = &etag - } - } - } - - return nil -} - -// AdminRuleCollection defines the admin rule collection. -type AdminRuleCollection struct { - autorest.Response `json:"-"` - // AdminRuleCollectionPropertiesFormat - Indicates the properties for the network manager admin rule collection. - *AdminRuleCollectionPropertiesFormat `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for AdminRuleCollection. -func (arc AdminRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if arc.AdminRuleCollectionPropertiesFormat != nil { - objectMap["properties"] = arc.AdminRuleCollectionPropertiesFormat - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AdminRuleCollection struct. -func (arc *AdminRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var adminRuleCollectionPropertiesFormat AdminRuleCollectionPropertiesFormat - err = json.Unmarshal(*v, &adminRuleCollectionPropertiesFormat) - if err != nil { - return err - } - arc.AdminRuleCollectionPropertiesFormat = &adminRuleCollectionPropertiesFormat - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - arc.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - arc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - arc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - arc.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - arc.Etag = &etag - } - } - } - - return nil -} - -// AdminRuleCollectionListResult security admin configuration rule collection list result. -type AdminRuleCollectionListResult struct { - autorest.Response `json:"-"` - // Value - A list of network manager security admin configuration rule collections - Value *[]AdminRuleCollection `json:"value,omitempty"` - // NextLink - Gets the URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AdminRuleCollectionListResultIterator provides access to a complete listing of AdminRuleCollection -// values. -type AdminRuleCollectionListResultIterator struct { - i int - page AdminRuleCollectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AdminRuleCollectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AdminRuleCollectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AdminRuleCollectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AdminRuleCollectionListResultIterator) Response() AdminRuleCollectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AdminRuleCollectionListResultIterator) Value() AdminRuleCollection { - if !iter.page.NotDone() { - return AdminRuleCollection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AdminRuleCollectionListResultIterator type. -func NewAdminRuleCollectionListResultIterator(page AdminRuleCollectionListResultPage) AdminRuleCollectionListResultIterator { - return AdminRuleCollectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (arclr AdminRuleCollectionListResult) IsEmpty() bool { - return arclr.Value == nil || len(*arclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (arclr AdminRuleCollectionListResult) hasNextLink() bool { - return arclr.NextLink != nil && len(*arclr.NextLink) != 0 -} - -// adminRuleCollectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (arclr AdminRuleCollectionListResult) adminRuleCollectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !arclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(arclr.NextLink))) -} - -// AdminRuleCollectionListResultPage contains a page of AdminRuleCollection values. -type AdminRuleCollectionListResultPage struct { - fn func(context.Context, AdminRuleCollectionListResult) (AdminRuleCollectionListResult, error) - arclr AdminRuleCollectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AdminRuleCollectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.arclr) - if err != nil { - return err - } - page.arclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AdminRuleCollectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AdminRuleCollectionListResultPage) NotDone() bool { - return !page.arclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AdminRuleCollectionListResultPage) Response() AdminRuleCollectionListResult { - return page.arclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AdminRuleCollectionListResultPage) Values() []AdminRuleCollection { - if page.arclr.IsEmpty() { - return nil - } - return *page.arclr.Value -} - -// Creates a new instance of the AdminRuleCollectionListResultPage type. -func NewAdminRuleCollectionListResultPage(cur AdminRuleCollectionListResult, getNextPage func(context.Context, AdminRuleCollectionListResult) (AdminRuleCollectionListResult, error)) AdminRuleCollectionListResultPage { - return AdminRuleCollectionListResultPage{ - fn: getNextPage, - arclr: cur, - } -} - -// AdminRuleCollectionPropertiesFormat defines the admin rule collection properties. -type AdminRuleCollectionPropertiesFormat struct { - // Description - A description of the admin rule collection. - Description *string `json:"description,omitempty"` - // AppliesToGroups - Groups for configuration - AppliesToGroups *[]ManagerSecurityGroupItem `json:"appliesToGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AdminRuleCollectionPropertiesFormat. -func (arcpf AdminRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if arcpf.Description != nil { - objectMap["description"] = arcpf.Description - } - if arcpf.AppliesToGroups != nil { - objectMap["appliesToGroups"] = arcpf.AppliesToGroups - } - return json.Marshal(objectMap) -} - -// AdminRuleCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type AdminRuleCollectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AdminRuleCollectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AdminRuleCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AdminRuleCollectionsDeleteFuture.Result. -func (future *AdminRuleCollectionsDeleteFuture) result(client AdminRuleCollectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AdminRuleCollectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// AdminRuleListResult security configuration admin rule list result. -type AdminRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of admin rules - Value *[]BasicBaseAdminRule `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for AdminRuleListResult struct. -func (arlr *AdminRuleListResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "value": - if v != nil { - value, err := unmarshalBasicBaseAdminRuleArray(*v) - if err != nil { - return err - } - arlr.Value = &value - } - case "nextLink": - if v != nil { - var nextLink string - err = json.Unmarshal(*v, &nextLink) - if err != nil { - return err - } - arlr.NextLink = &nextLink - } - } - } - - return nil -} - -// AdminRuleListResultIterator provides access to a complete listing of BaseAdminRule values. -type AdminRuleListResultIterator struct { - i int - page AdminRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AdminRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AdminRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AdminRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AdminRuleListResultIterator) Response() AdminRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AdminRuleListResultIterator) Value() BasicBaseAdminRule { - if !iter.page.NotDone() { - return BaseAdminRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AdminRuleListResultIterator type. -func NewAdminRuleListResultIterator(page AdminRuleListResultPage) AdminRuleListResultIterator { - return AdminRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (arlr AdminRuleListResult) IsEmpty() bool { - return arlr.Value == nil || len(*arlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (arlr AdminRuleListResult) hasNextLink() bool { - return arlr.NextLink != nil && len(*arlr.NextLink) != 0 -} - -// adminRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (arlr AdminRuleListResult) adminRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !arlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(arlr.NextLink))) -} - -// AdminRuleListResultPage contains a page of BasicBaseAdminRule values. -type AdminRuleListResultPage struct { - fn func(context.Context, AdminRuleListResult) (AdminRuleListResult, error) - arlr AdminRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AdminRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.arlr) - if err != nil { - return err - } - page.arlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AdminRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AdminRuleListResultPage) NotDone() bool { - return !page.arlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AdminRuleListResultPage) Response() AdminRuleListResult { - return page.arlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AdminRuleListResultPage) Values() []BasicBaseAdminRule { - if page.arlr.IsEmpty() { - return nil - } - return *page.arlr.Value -} - -// Creates a new instance of the AdminRuleListResultPage type. -func NewAdminRuleListResultPage(cur AdminRuleListResult, getNextPage func(context.Context, AdminRuleListResult) (AdminRuleListResult, error)) AdminRuleListResultPage { - return AdminRuleListResultPage{ - fn: getNextPage, - arlr: cur, - } -} - -// AdminRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AdminRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AdminRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AdminRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AdminRulesDeleteFuture.Result. -func (future *AdminRulesDeleteFuture) result(client AdminRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AdminRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AdminRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGateway application gateway resource. -type ApplicationGateway struct { - autorest.Response `json:"-"` - // ApplicationGatewayPropertiesFormat - Properties of the application gateway. - *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting where the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // Identity - The identity of the application gateway, if configured. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ApplicationGateway. -func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ag.ApplicationGatewayPropertiesFormat != nil { - objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat - } - if ag.Zones != nil { - objectMap["zones"] = ag.Zones - } - if ag.Identity != nil { - objectMap["identity"] = ag.Identity - } - if ag.ID != nil { - objectMap["id"] = ag.ID - } - if ag.Location != nil { - objectMap["location"] = ag.Location - } - if ag.Tags != nil { - objectMap["tags"] = ag.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. -func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) - if err != nil { - return err - } - ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ag.Etag = &etag - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - ag.Zones = &zones - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - ag.Identity = &identity - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ag.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ag.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ag.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ag.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ag.Tags = tags - } - } - } - - return nil -} - -// ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway. -type ApplicationGatewayAuthenticationCertificate struct { - // ApplicationGatewayAuthenticationCertificatePropertiesFormat - Properties of the application gateway authentication certificate. - *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the authentication certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate. -func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil { - objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat - } - if agac.Name != nil { - objectMap["name"] = agac.Name - } - if agac.ID != nil { - objectMap["id"] = agac.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. -func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat) - if err != nil { - return err - } - agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agac.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agac.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agac.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agac.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an -// application gateway. -type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { - // Data - Certificate public data. - Data *string `json:"data,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the authentication certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificatePropertiesFormat. -func (agacpf ApplicationGatewayAuthenticationCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agacpf.Data != nil { - objectMap["data"] = agacpf.Data - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayAutoscaleConfiguration application Gateway autoscale configuration. -type ApplicationGatewayAutoscaleConfiguration struct { - // MinCapacity - Lower bound on number of Application Gateway capacity. - MinCapacity *int32 `json:"minCapacity,omitempty"` - // MaxCapacity - Upper bound on number of Application Gateway capacity. - MaxCapacity *int32 `json:"maxCapacity,omitempty"` -} - -// ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service -// call. -type ApplicationGatewayAvailableSslOptions struct { - autorest.Response `json:"-"` - // ApplicationGatewayAvailableSslOptionsPropertiesFormat - Properties of the application gateway available SSL options. - *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayAvailableSslOptions. -func (agaso ApplicationGatewayAvailableSslOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat != nil { - objectMap["properties"] = agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat - } - if agaso.ID != nil { - objectMap["id"] = agaso.ID - } - if agaso.Location != nil { - objectMap["location"] = agaso.Location - } - if agaso.Tags != nil { - objectMap["tags"] = agaso.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAvailableSslOptions struct. -func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayAvailableSslOptionsPropertiesFormat ApplicationGatewayAvailableSslOptionsPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayAvailableSslOptionsPropertiesFormat) - if err != nil { - return err - } - agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat = &applicationGatewayAvailableSslOptionsPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agaso.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agaso.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agaso.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - agaso.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - agaso.Tags = tags - } - } - } - - return nil -} - -// ApplicationGatewayAvailableSslOptionsPropertiesFormat properties of -// ApplicationGatewayAvailableSslOptions. -type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { - // PredefinedPolicies - List of available Ssl predefined policy. - PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` - // DefaultPolicy - Name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' - DefaultPolicy ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` - // AvailableCipherSuites - List of available Ssl cipher suites. - AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` - // AvailableProtocols - List of available Ssl protocols. - AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"` -} - -// ApplicationGatewayAvailableSslPredefinedPolicies response for ApplicationGatewayAvailableSslOptions API -// service call. -type ApplicationGatewayAvailableSslPredefinedPolicies struct { - autorest.Response `json:"-"` - // Value - List of available Ssl predefined policy. - Value *[]ApplicationGatewaySslPredefinedPolicy `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayAvailableSslPredefinedPoliciesIterator provides access to a complete listing of -// ApplicationGatewaySslPredefinedPolicy values. -type ApplicationGatewayAvailableSslPredefinedPoliciesIterator struct { - i int - page ApplicationGatewayAvailableSslPredefinedPoliciesPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Response() ApplicationGatewayAvailableSslPredefinedPolicies { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Value() ApplicationGatewaySslPredefinedPolicy { - if !iter.page.NotDone() { - return ApplicationGatewaySslPredefinedPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesIterator type. -func NewApplicationGatewayAvailableSslPredefinedPoliciesIterator(page ApplicationGatewayAvailableSslPredefinedPoliciesPage) ApplicationGatewayAvailableSslPredefinedPoliciesIterator { - return ApplicationGatewayAvailableSslPredefinedPoliciesIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) IsEmpty() bool { - return agaspp.Value == nil || len(*agaspp.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) hasNextLink() bool { - return agaspp.NextLink != nil && len(*agaspp.NextLink) != 0 -} - -// applicationGatewayAvailableSslPredefinedPoliciesPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { - if !agaspp.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(agaspp.NextLink))) -} - -// ApplicationGatewayAvailableSslPredefinedPoliciesPage contains a page of -// ApplicationGatewaySslPredefinedPolicy values. -type ApplicationGatewayAvailableSslPredefinedPoliciesPage struct { - fn func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error) - agaspp ApplicationGatewayAvailableSslPredefinedPolicies -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.agaspp) - if err != nil { - return err - } - page.agaspp = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) NotDone() bool { - return !page.agaspp.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Response() ApplicationGatewayAvailableSslPredefinedPolicies { - return page.agaspp -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Values() []ApplicationGatewaySslPredefinedPolicy { - if page.agaspp.IsEmpty() { - return nil - } - return *page.agaspp.Value -} - -// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesPage type. -func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(cur ApplicationGatewayAvailableSslPredefinedPolicies, getNextPage func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)) ApplicationGatewayAvailableSslPredefinedPoliciesPage { - return ApplicationGatewayAvailableSslPredefinedPoliciesPage{ - fn: getNextPage, - agaspp: cur, - } -} - -// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API -// service call. -type ApplicationGatewayAvailableWafRuleSetsResult struct { - autorest.Response `json:"-"` - // Value - The list of application gateway rule sets. - Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` -} - -// ApplicationGatewayBackendAddress backend address of an application gateway. -type ApplicationGatewayBackendAddress struct { - // Fqdn - Fully qualified domain name (FQDN). - Fqdn *string `json:"fqdn,omitempty"` - // IPAddress - IP address. - IPAddress *string `json:"ipAddress,omitempty"` -} - -// ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway. -type ApplicationGatewayBackendAddressPool struct { - // ApplicationGatewayBackendAddressPoolPropertiesFormat - Properties of the application gateway backend address pool. - *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend address pool that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. -func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { - objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat - } - if agbap.Name != nil { - objectMap["name"] = agbap.Name - } - if agbap.ID != nil { - objectMap["id"] = agbap.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. -func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) - if err != nil { - return err - } - agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agbap.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agbap.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agbap.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agbap.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an -// application gateway. -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - // BackendIPConfigurations - READ-ONLY; Collection of references to IPs defined in network interfaces. - BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - // BackendAddresses - Backend addresses. - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPoolPropertiesFormat. -func (agbappf ApplicationGatewayBackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbappf.BackendAddresses != nil { - objectMap["backendAddresses"] = agbappf.BackendAddresses - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayBackendHealth response for ApplicationGatewayBackendHealth API service call. -type ApplicationGatewayBackendHealth struct { - autorest.Response `json:"-"` - // BackendAddressPools - A list of ApplicationGatewayBackendHealthPool resources. - BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` -} - -// ApplicationGatewayBackendHealthHTTPSettings application gateway BackendHealthHttp settings. -type ApplicationGatewayBackendHealthHTTPSettings struct { - // BackendHTTPSettings - Reference to an ApplicationGatewayBackendHttpSettings resource. - BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` - // Servers - List of ApplicationGatewayBackendHealthServer resources. - Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` -} - -// ApplicationGatewayBackendHealthOnDemand result of on demand test probe. -type ApplicationGatewayBackendHealthOnDemand struct { - autorest.Response `json:"-"` - // BackendAddressPool - Reference to an ApplicationGatewayBackendAddressPool resource. - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - // BackendHealthHTTPSettings - Application gateway BackendHealthHttp settings. - BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings `json:"backendHealthHttpSettings,omitempty"` -} - -// ApplicationGatewayBackendHealthPool application gateway BackendHealth pool. -type ApplicationGatewayBackendHealthPool struct { - // BackendAddressPool - Reference to an ApplicationGatewayBackendAddressPool resource. - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - // BackendHTTPSettingsCollection - List of ApplicationGatewayBackendHealthHttpSettings resources. - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` -} - -// ApplicationGatewayBackendHealthServer application gateway backendhealth http settings. -type ApplicationGatewayBackendHealthServer struct { - // Address - IP address or FQDN of backend server. - Address *string `json:"address,omitempty"` - // IPConfiguration - Reference to IP configuration of backend server. - IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"` - // Health - Health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' - Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` - // HealthProbeLog - Health Probe Log. - HealthProbeLog *string `json:"healthProbeLog,omitempty"` -} - -// ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway. -type ApplicationGatewayBackendHTTPSettings struct { - // ApplicationGatewayBackendHTTPSettingsPropertiesFormat - Properties of the application gateway backend HTTP settings. - *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend http settings that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. -func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { - objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat - } - if agbhs.Name != nil { - objectMap["name"] = agbhs.Name - } - if agbhs.ID != nil { - objectMap["id"] = agbhs.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. -func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) - if err != nil { - return err - } - agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agbhs.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agbhs.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agbhs.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agbhs.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an -// application gateway. -type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - // Port - The destination port on the backend. - Port *int32 `json:"port,omitempty"` - // Protocol - The protocol used to communicate with the backend. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // CookieBasedAffinity - Cookie based affinity. Possible values include: 'Enabled', 'Disabled' - CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - // RequestTimeout - Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. - RequestTimeout *int32 `json:"requestTimeout,omitempty"` - // Probe - Probe resource of an application gateway. - Probe *SubResource `json:"probe,omitempty"` - // AuthenticationCertificates - Array of references to application gateway authentication certificates. - AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` - // TrustedRootCertificates - Array of references to application gateway trusted root certificates. - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` - // ConnectionDraining - Connection draining of the backend http settings resource. - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` - // HostName - Host header to be sent to the backend servers. - HostName *string `json:"hostName,omitempty"` - // PickHostNameFromBackendAddress - Whether to pick host header should be picked from the host name of the backend server. Default value is false. - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - // AffinityCookieName - Cookie name to use for the affinity cookie. - AffinityCookieName *string `json:"affinityCookieName,omitempty"` - // ProbeEnabled - Whether the probe is enabled. Default value is false. - ProbeEnabled *bool `json:"probeEnabled,omitempty"` - // Path - Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. - Path *string `json:"path,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettingsPropertiesFormat. -func (agbhspf ApplicationGatewayBackendHTTPSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbhspf.Port != nil { - objectMap["port"] = agbhspf.Port - } - if agbhspf.Protocol != "" { - objectMap["protocol"] = agbhspf.Protocol - } - if agbhspf.CookieBasedAffinity != "" { - objectMap["cookieBasedAffinity"] = agbhspf.CookieBasedAffinity - } - if agbhspf.RequestTimeout != nil { - objectMap["requestTimeout"] = agbhspf.RequestTimeout - } - if agbhspf.Probe != nil { - objectMap["probe"] = agbhspf.Probe - } - if agbhspf.AuthenticationCertificates != nil { - objectMap["authenticationCertificates"] = agbhspf.AuthenticationCertificates - } - if agbhspf.TrustedRootCertificates != nil { - objectMap["trustedRootCertificates"] = agbhspf.TrustedRootCertificates - } - if agbhspf.ConnectionDraining != nil { - objectMap["connectionDraining"] = agbhspf.ConnectionDraining - } - if agbhspf.HostName != nil { - objectMap["hostName"] = agbhspf.HostName - } - if agbhspf.PickHostNameFromBackendAddress != nil { - objectMap["pickHostNameFromBackendAddress"] = agbhspf.PickHostNameFromBackendAddress - } - if agbhspf.AffinityCookieName != nil { - objectMap["affinityCookieName"] = agbhspf.AffinityCookieName - } - if agbhspf.ProbeEnabled != nil { - objectMap["probeEnabled"] = agbhspf.ProbeEnabled - } - if agbhspf.Path != nil { - objectMap["path"] = agbhspf.Path - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayBackendSettings backend address pool settings of an application gateway. -type ApplicationGatewayBackendSettings struct { - // ApplicationGatewayBackendSettingsPropertiesFormat - Properties of the application gateway backend settings. - *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend settings that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendSettings. -func (agbs ApplicationGatewayBackendSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbs.ApplicationGatewayBackendSettingsPropertiesFormat != nil { - objectMap["properties"] = agbs.ApplicationGatewayBackendSettingsPropertiesFormat - } - if agbs.Name != nil { - objectMap["name"] = agbs.Name - } - if agbs.ID != nil { - objectMap["id"] = agbs.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendSettings struct. -func (agbs *ApplicationGatewayBackendSettings) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayBackendSettingsPropertiesFormat ApplicationGatewayBackendSettingsPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayBackendSettingsPropertiesFormat) - if err != nil { - return err - } - agbs.ApplicationGatewayBackendSettingsPropertiesFormat = &applicationGatewayBackendSettingsPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agbs.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agbs.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agbs.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agbs.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayBackendSettingsPropertiesFormat properties of Backend address pool settings of an -// application gateway. -type ApplicationGatewayBackendSettingsPropertiesFormat struct { - // Port - The destination port on the backend. - Port *int32 `json:"port,omitempty"` - // Protocol - The protocol used to communicate with the backend. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // Timeout - Connection timeout in seconds. Application Gateway will fail the request if response is not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` - // Probe - Probe resource of an application gateway. - Probe *SubResource `json:"probe,omitempty"` - // TrustedRootCertificates - Array of references to application gateway trusted root certificates. - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` - // HostName - Server name indication to be sent to the backend servers for Tls protocol. - HostName *string `json:"hostName,omitempty"` - // PickHostNameFromBackendAddress - Whether to pick server name indication from the host name of the backend server for Tls protocol. Default value is false. - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendSettingsPropertiesFormat. -func (agbspf ApplicationGatewayBackendSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbspf.Port != nil { - objectMap["port"] = agbspf.Port - } - if agbspf.Protocol != "" { - objectMap["protocol"] = agbspf.Protocol - } - if agbspf.Timeout != nil { - objectMap["timeout"] = agbspf.Timeout - } - if agbspf.Probe != nil { - objectMap["probe"] = agbspf.Probe - } - if agbspf.TrustedRootCertificates != nil { - objectMap["trustedRootCertificates"] = agbspf.TrustedRootCertificates - } - if agbspf.HostName != nil { - objectMap["hostName"] = agbspf.HostName - } - if agbspf.PickHostNameFromBackendAddress != nil { - objectMap["pickHostNameFromBackendAddress"] = agbspf.PickHostNameFromBackendAddress - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayClientAuthConfiguration application gateway client authentication configuration. -type ApplicationGatewayClientAuthConfiguration struct { - // VerifyClientCertIssuerDN - Verify client certificate issuer name on the application gateway. - VerifyClientCertIssuerDN *bool `json:"verifyClientCertIssuerDN,omitempty"` - // VerifyClientRevocation - Verify client certificate revocation status. Possible values include: 'None', 'OCSP' - VerifyClientRevocation ApplicationGatewayClientRevocationOptions `json:"verifyClientRevocation,omitempty"` -} - -// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to -// be active for a specified time after the backend server got removed from the configuration. -type ApplicationGatewayConnectionDraining struct { - // Enabled - Whether connection draining is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - // DrainTimeoutInSec - The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. - DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"` -} - -// ApplicationGatewayCustomError customer error of an application gateway. -type ApplicationGatewayCustomError struct { - // StatusCode - Status code of the application gateway customer error. Possible values include: 'HTTPStatus403', 'HTTPStatus502' - StatusCode ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` - // CustomErrorPageURL - Error page URL of the application gateway customer error. - CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` -} - -// ApplicationGatewayFirewallDisabledRuleGroup allows to disable rules within a rule group or an entire -// rule group. -type ApplicationGatewayFirewallDisabledRuleGroup struct { - // RuleGroupName - The name of the rule group that will be disabled. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Rules - The list of rules that will be disabled. If null, all rules of the rule group will be disabled. - Rules *[]int32 `json:"rules,omitempty"` -} - -// ApplicationGatewayFirewallExclusion allow to exclude some variable satisfy the condition for the WAF -// check. -type ApplicationGatewayFirewallExclusion struct { - // MatchVariable - The variable to be excluded. - MatchVariable *string `json:"matchVariable,omitempty"` - // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. - SelectorMatchOperator *string `json:"selectorMatchOperator,omitempty"` - // Selector - When matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. - Selector *string `json:"selector,omitempty"` -} - -// ApplicationGatewayFirewallManifestRuleSet properties of the web application firewall rule set. -type ApplicationGatewayFirewallManifestRuleSet struct { - // RuleSetType - The type of the web application firewall rule set. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - The version of the web application firewall rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // Status - The rule set status. Possible values include: 'Preview', 'GA', 'Supported', 'Deprecated' - Status ApplicationGatewayRuleSetStatusOptions `json:"status,omitempty"` - // Tiers - Tier of an application gateway that support the rule set. - Tiers *[]ApplicationGatewayTierTypes `json:"tiers,omitempty"` - // RuleGroups - The rule groups of the web application firewall rule set. - RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` -} - -// ApplicationGatewayFirewallRule a web application firewall rule. -type ApplicationGatewayFirewallRule struct { - // RuleID - The identifier of the web application firewall rule. - RuleID *int32 `json:"ruleId,omitempty"` - // RuleIDString - The string representation of the web application firewall rule identifier. - RuleIDString *string `json:"ruleIdString,omitempty"` - // State - The string representation of the web application firewall rule state. Possible values include: 'ApplicationGatewayWafRuleStateTypesEnabled', 'ApplicationGatewayWafRuleStateTypesDisabled' - State ApplicationGatewayWafRuleStateTypes `json:"state,omitempty"` - // Action - The string representation of the web application firewall rule action. Possible values include: 'ApplicationGatewayWafRuleActionTypesNone', 'ApplicationGatewayWafRuleActionTypesAnomalyScoring', 'ApplicationGatewayWafRuleActionTypesAllow', 'ApplicationGatewayWafRuleActionTypesBlock', 'ApplicationGatewayWafRuleActionTypesLog' - Action ApplicationGatewayWafRuleActionTypes `json:"action,omitempty"` - // Description - The description of the web application firewall rule. - Description *string `json:"description,omitempty"` -} - -// ApplicationGatewayFirewallRuleGroup a web application firewall rule group. -type ApplicationGatewayFirewallRuleGroup struct { - // RuleGroupName - The name of the web application firewall rule group. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Description - The description of the web application firewall rule group. - Description *string `json:"description,omitempty"` - // Rules - The rules of the web application firewall rule group. - Rules *[]ApplicationGatewayFirewallRule `json:"rules,omitempty"` -} - -// ApplicationGatewayFirewallRuleSet a web application firewall rule set. -type ApplicationGatewayFirewallRuleSet struct { - // ApplicationGatewayFirewallRuleSetPropertiesFormat - Properties of the application gateway firewall rule set. - *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSet. -func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat != nil { - objectMap["properties"] = agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat - } - if agfrs.ID != nil { - objectMap["id"] = agfrs.ID - } - if agfrs.Location != nil { - objectMap["location"] = agfrs.Location - } - if agfrs.Tags != nil { - objectMap["tags"] = agfrs.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFirewallRuleSet struct. -func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayFirewallRuleSetPropertiesFormat ApplicationGatewayFirewallRuleSetPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFirewallRuleSetPropertiesFormat) - if err != nil { - return err - } - agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &applicationGatewayFirewallRuleSetPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agfrs.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agfrs.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agfrs.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - agfrs.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - agfrs.Tags = tags - } - } - } - - return nil -} - -// ApplicationGatewayFirewallRuleSetPropertiesFormat properties of the web application firewall rule set. -type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall rule set. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // RuleSetType - The type of the web application firewall rule set. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - The version of the web application firewall rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroups - The rule groups of the web application firewall rule set. - RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` - // Tiers - Tier of an application gateway that support the rule set. - Tiers *[]ApplicationGatewayTierTypes `json:"tiers,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSetPropertiesFormat. -func (agfrspf ApplicationGatewayFirewallRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfrspf.RuleSetType != nil { - objectMap["ruleSetType"] = agfrspf.RuleSetType - } - if agfrspf.RuleSetVersion != nil { - objectMap["ruleSetVersion"] = agfrspf.RuleSetVersion - } - if agfrspf.RuleGroups != nil { - objectMap["ruleGroups"] = agfrspf.RuleGroups - } - if agfrspf.Tiers != nil { - objectMap["tiers"] = agfrspf.Tiers - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway. -type ApplicationGatewayFrontendIPConfiguration struct { - // ApplicationGatewayFrontendIPConfigurationPropertiesFormat - Properties of the application gateway frontend IP configuration. - *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the frontend IP configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. -func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat - } - if agfic.Name != nil { - objectMap["name"] = agfic.Name - } - if agfic.ID != nil { - objectMap["id"] = agfic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. -func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) - if err != nil { - return err - } - agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agfic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agfic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agfic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agfic.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an -// application gateway. -type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { - // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - Reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - Reference to the PublicIP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // PrivateLinkConfiguration - Reference to the application gateway private link configuration. - PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfigurationPropertiesFormat. -func (agficpf ApplicationGatewayFrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agficpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = agficpf.PrivateIPAddress - } - if agficpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = agficpf.PrivateIPAllocationMethod - } - if agficpf.Subnet != nil { - objectMap["subnet"] = agficpf.Subnet - } - if agficpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = agficpf.PublicIPAddress - } - if agficpf.PrivateLinkConfiguration != nil { - objectMap["privateLinkConfiguration"] = agficpf.PrivateLinkConfiguration - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayFrontendPort frontend port of an application gateway. -type ApplicationGatewayFrontendPort struct { - // ApplicationGatewayFrontendPortPropertiesFormat - Properties of the application gateway frontend port. - *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the frontend port that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. -func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { - objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat - } - if agfp.Name != nil { - objectMap["name"] = agfp.Name - } - if agfp.ID != nil { - objectMap["id"] = agfp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. -func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) - if err != nil { - return err - } - agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agfp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agfp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agfp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agfp.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend port of an application gateway. -type ApplicationGatewayFrontendPortPropertiesFormat struct { - // Port - Frontend port. - Port *int32 `json:"port,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend port resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPortPropertiesFormat. -func (agfppf ApplicationGatewayFrontendPortPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agfppf.Port != nil { - objectMap["port"] = agfppf.Port - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayGlobalConfiguration application Gateway global configuration. -type ApplicationGatewayGlobalConfiguration struct { - // EnableRequestBuffering - Enable request buffering. - EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` - // EnableResponseBuffering - Enable response buffering. - EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` -} - -// ApplicationGatewayHeaderConfiguration header configuration of the Actions set in Application Gateway. -type ApplicationGatewayHeaderConfiguration struct { - // HeaderName - Header name of the header configuration. - HeaderName *string `json:"headerName,omitempty"` - // HeaderValue - Header value of the header configuration. - HeaderValue *string `json:"headerValue,omitempty"` -} - -// ApplicationGatewayHTTPListener http listener of an application gateway. -type ApplicationGatewayHTTPListener struct { - // ApplicationGatewayHTTPListenerPropertiesFormat - Properties of the application gateway HTTP listener. - *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the HTTP listener that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. -func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { - objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat - } - if aghl.Name != nil { - objectMap["name"] = aghl.Name - } - if aghl.ID != nil { - objectMap["id"] = aghl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. -func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) - if err != nil { - return err - } - aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - aghl.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - aghl.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - aghl.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - aghl.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayHTTPListenerPropertiesFormat properties of HTTP listener of an application gateway. -type ApplicationGatewayHTTPListenerPropertiesFormat struct { - // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // FrontendPort - Frontend port resource of an application gateway. - FrontendPort *SubResource `json:"frontendPort,omitempty"` - // Protocol - Protocol of the HTTP listener. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // HostName - Host name of HTTP listener. - HostName *string `json:"hostName,omitempty"` - // SslCertificate - SSL certificate resource of an application gateway. - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - // SslProfile - SSL profile resource of the application gateway. - SslProfile *SubResource `json:"sslProfile,omitempty"` - // RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting. - RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CustomErrorConfigurations - Custom error configurations of the HTTP listener. - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - // FirewallPolicy - Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - // HostNames - List of Host names for HTTP Listener that allows special wildcard characters as well. - HostNames *[]string `json:"hostNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListenerPropertiesFormat. -func (aghlpf ApplicationGatewayHTTPListenerPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aghlpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = aghlpf.FrontendIPConfiguration - } - if aghlpf.FrontendPort != nil { - objectMap["frontendPort"] = aghlpf.FrontendPort - } - if aghlpf.Protocol != "" { - objectMap["protocol"] = aghlpf.Protocol - } - if aghlpf.HostName != nil { - objectMap["hostName"] = aghlpf.HostName - } - if aghlpf.SslCertificate != nil { - objectMap["sslCertificate"] = aghlpf.SslCertificate - } - if aghlpf.SslProfile != nil { - objectMap["sslProfile"] = aghlpf.SslProfile - } - if aghlpf.RequireServerNameIndication != nil { - objectMap["requireServerNameIndication"] = aghlpf.RequireServerNameIndication - } - if aghlpf.CustomErrorConfigurations != nil { - objectMap["customErrorConfigurations"] = aghlpf.CustomErrorConfigurations - } - if aghlpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = aghlpf.FirewallPolicy - } - if aghlpf.HostNames != nil { - objectMap["hostNames"] = aghlpf.HostNames - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 -// private IP configuration is allowed. -type ApplicationGatewayIPConfiguration struct { - // ApplicationGatewayIPConfigurationPropertiesFormat - Properties of the application gateway IP configuration. - *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the IP configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. -func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat - } - if agic.Name != nil { - objectMap["name"] = agic.Name - } - if agic.ID != nil { - objectMap["id"] = agic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct. -func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat) - if err != nil { - return err - } - agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agic.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of an application -// gateway. -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - // Subnet - Reference to the subnet resource. A subnet from where application gateway gets its private address. - Subnet *SubResource `json:"subnet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfigurationPropertiesFormat. -func (agicpf ApplicationGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agicpf.Subnet != nil { - objectMap["subnet"] = agicpf.Subnet - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayListener listener of an application gateway. -type ApplicationGatewayListener struct { - // ApplicationGatewayListenerPropertiesFormat - Properties of the application gateway listener. - *ApplicationGatewayListenerPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the listener that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayListener. -func (agl ApplicationGatewayListener) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agl.ApplicationGatewayListenerPropertiesFormat != nil { - objectMap["properties"] = agl.ApplicationGatewayListenerPropertiesFormat - } - if agl.Name != nil { - objectMap["name"] = agl.Name - } - if agl.ID != nil { - objectMap["id"] = agl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayListener struct. -func (agl *ApplicationGatewayListener) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayListenerPropertiesFormat ApplicationGatewayListenerPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayListenerPropertiesFormat) - if err != nil { - return err - } - agl.ApplicationGatewayListenerPropertiesFormat = &applicationGatewayListenerPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agl.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agl.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agl.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agl.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayListenerPropertiesFormat properties of listener of an application gateway. -type ApplicationGatewayListenerPropertiesFormat struct { - // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // FrontendPort - Frontend port resource of an application gateway. - FrontendPort *SubResource `json:"frontendPort,omitempty"` - // Protocol - Protocol of the listener. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // SslCertificate - SSL certificate resource of an application gateway. - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - // SslProfile - SSL profile resource of the application gateway. - SslProfile *SubResource `json:"sslProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the listener resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayListenerPropertiesFormat. -func (aglpf ApplicationGatewayListenerPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aglpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = aglpf.FrontendIPConfiguration - } - if aglpf.FrontendPort != nil { - objectMap["frontendPort"] = aglpf.FrontendPort - } - if aglpf.Protocol != "" { - objectMap["protocol"] = aglpf.Protocol - } - if aglpf.SslCertificate != nil { - objectMap["sslCertificate"] = aglpf.SslCertificate - } - if aglpf.SslProfile != nil { - objectMap["sslProfile"] = aglpf.SslProfile - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayListResult response for ListApplicationGateways API service call. -type ApplicationGatewayListResult struct { - autorest.Response `json:"-"` - // Value - List of an application gateways in a resource group. - Value *[]ApplicationGateway `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayListResultIterator provides access to a complete listing of ApplicationGateway values. -type ApplicationGatewayListResultIterator struct { - i int - page ApplicationGatewayListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayListResultIterator) Response() ApplicationGatewayListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayListResultIterator) Value() ApplicationGateway { - if !iter.page.NotDone() { - return ApplicationGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayListResultIterator type. -func NewApplicationGatewayListResultIterator(page ApplicationGatewayListResultPage) ApplicationGatewayListResultIterator { - return ApplicationGatewayListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aglr ApplicationGatewayListResult) IsEmpty() bool { - return aglr.Value == nil || len(*aglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aglr ApplicationGatewayListResult) hasNextLink() bool { - return aglr.NextLink != nil && len(*aglr.NextLink) != 0 -} - -// applicationGatewayListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !aglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aglr.NextLink))) -} - -// ApplicationGatewayListResultPage contains a page of ApplicationGateway values. -type ApplicationGatewayListResultPage struct { - fn func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error) - aglr ApplicationGatewayListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aglr) - if err != nil { - return err - } - page.aglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayListResultPage) NotDone() bool { - return !page.aglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayListResultPage) Response() ApplicationGatewayListResult { - return page.aglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway { - if page.aglr.IsEmpty() { - return nil - } - return *page.aglr.Value -} - -// Creates a new instance of the ApplicationGatewayListResultPage type. -func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage { - return ApplicationGatewayListResultPage{ - fn: getNextPage, - aglr: cur, - } -} - -// ApplicationGatewayLoadDistributionPolicy load Distribution Policy of an application gateway. -type ApplicationGatewayLoadDistributionPolicy struct { - // ApplicationGatewayLoadDistributionPolicyPropertiesFormat - Properties of the application gateway load distribution policy. - *ApplicationGatewayLoadDistributionPolicyPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the load distribution policy that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayLoadDistributionPolicy. -func (agldp ApplicationGatewayLoadDistributionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agldp.ApplicationGatewayLoadDistributionPolicyPropertiesFormat != nil { - objectMap["properties"] = agldp.ApplicationGatewayLoadDistributionPolicyPropertiesFormat - } - if agldp.Name != nil { - objectMap["name"] = agldp.Name - } - if agldp.ID != nil { - objectMap["id"] = agldp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayLoadDistributionPolicy struct. -func (agldp *ApplicationGatewayLoadDistributionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayLoadDistributionPolicyPropertiesFormat ApplicationGatewayLoadDistributionPolicyPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayLoadDistributionPolicyPropertiesFormat) - if err != nil { - return err - } - agldp.ApplicationGatewayLoadDistributionPolicyPropertiesFormat = &applicationGatewayLoadDistributionPolicyPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agldp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agldp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agldp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agldp.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayLoadDistributionPolicyPropertiesFormat properties of Load Distribution Policy of an -// application gateway. -type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { - // LoadDistributionTargets - Load Distribution Targets resource of an application gateway. - LoadDistributionTargets *[]ApplicationGatewayLoadDistributionTarget `json:"loadDistributionTargets,omitempty"` - // LoadDistributionAlgorithm - Load Distribution Targets resource of an application gateway. Possible values include: 'RoundRobin', 'LeastConnections', 'IPHash' - LoadDistributionAlgorithm ApplicationGatewayLoadDistributionAlgorithm `json:"loadDistributionAlgorithm,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the Load Distribution Policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayLoadDistributionPolicyPropertiesFormat. -func (agldppf ApplicationGatewayLoadDistributionPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agldppf.LoadDistributionTargets != nil { - objectMap["loadDistributionTargets"] = agldppf.LoadDistributionTargets - } - if agldppf.LoadDistributionAlgorithm != "" { - objectMap["loadDistributionAlgorithm"] = agldppf.LoadDistributionAlgorithm - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayLoadDistributionTarget load Distribution Target of an application gateway. -type ApplicationGatewayLoadDistributionTarget struct { - // ApplicationGatewayLoadDistributionTargetPropertiesFormat - Properties of the application gateway load distribution target. - *ApplicationGatewayLoadDistributionTargetPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the load distribution policy that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayLoadDistributionTarget. -func (agldt ApplicationGatewayLoadDistributionTarget) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agldt.ApplicationGatewayLoadDistributionTargetPropertiesFormat != nil { - objectMap["properties"] = agldt.ApplicationGatewayLoadDistributionTargetPropertiesFormat - } - if agldt.Name != nil { - objectMap["name"] = agldt.Name - } - if agldt.ID != nil { - objectMap["id"] = agldt.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayLoadDistributionTarget struct. -func (agldt *ApplicationGatewayLoadDistributionTarget) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayLoadDistributionTargetPropertiesFormat ApplicationGatewayLoadDistributionTargetPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayLoadDistributionTargetPropertiesFormat) - if err != nil { - return err - } - agldt.ApplicationGatewayLoadDistributionTargetPropertiesFormat = &applicationGatewayLoadDistributionTargetPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agldt.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agldt.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agldt.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agldt.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayLoadDistributionTargetPropertiesFormat ... -type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { - // WeightPerServer - Weight per server. Range between 1 and 100. - WeightPerServer *int32 `json:"weightPerServer,omitempty"` - // BackendAddressPool - Backend address pool resource of the application gateway. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` -} - -// ApplicationGatewayOnDemandProbe details of on demand test probe request. -type ApplicationGatewayOnDemandProbe struct { - // Protocol - The protocol used for the probe. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // Host - Host name to send the probe to. - Host *string `json:"host,omitempty"` - // Path - Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. - Path *string `json:"path,omitempty"` - // Timeout - The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` - // PickHostNameFromBackendHTTPSettings - Whether the host header should be picked from the backend http settings. Default value is false. - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - // Match - Criterion for classifying a healthy probe response. - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - // BackendAddressPool - Reference to backend pool of application gateway to which probe request will be sent. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendHTTPSettings - Reference to backend http setting of application gateway to be used for test probe. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` -} - -// ApplicationGatewayPathRule path rule of URL path map of an application gateway. -type ApplicationGatewayPathRule struct { - // ApplicationGatewayPathRulePropertiesFormat - Properties of the application gateway path rule. - *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the path rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPathRule. -func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agpr.ApplicationGatewayPathRulePropertiesFormat != nil { - objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat - } - if agpr.Name != nil { - objectMap["name"] = agpr.Name - } - if agpr.ID != nil { - objectMap["id"] = agpr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct. -func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat) - if err != nil { - return err - } - agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agpr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agpr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agpr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agpr.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPathRulePropertiesFormat properties of path rule of an application gateway. -type ApplicationGatewayPathRulePropertiesFormat struct { - // Paths - Path rules of URL path map. - Paths *[]string `json:"paths,omitempty"` - // BackendAddressPool - Backend address pool resource of URL path map path rule. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendHTTPSettings - Backend http settings resource of URL path map path rule. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - // RedirectConfiguration - Redirect configuration resource of URL path map path rule. - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - // RewriteRuleSet - Rewrite rule set resource of URL path map path rule. - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - // LoadDistributionPolicy - Load Distribution Policy resource of URL path map path rule. - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the path rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // FirewallPolicy - Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPathRulePropertiesFormat. -func (agprpf ApplicationGatewayPathRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agprpf.Paths != nil { - objectMap["paths"] = agprpf.Paths - } - if agprpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = agprpf.BackendAddressPool - } - if agprpf.BackendHTTPSettings != nil { - objectMap["backendHttpSettings"] = agprpf.BackendHTTPSettings - } - if agprpf.RedirectConfiguration != nil { - objectMap["redirectConfiguration"] = agprpf.RedirectConfiguration - } - if agprpf.RewriteRuleSet != nil { - objectMap["rewriteRuleSet"] = agprpf.RewriteRuleSet - } - if agprpf.LoadDistributionPolicy != nil { - objectMap["loadDistributionPolicy"] = agprpf.LoadDistributionPolicy - } - if agprpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = agprpf.FirewallPolicy - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPrivateEndpointConnection private Endpoint connection on an application gateway. -type ApplicationGatewayPrivateEndpointConnection struct { - autorest.Response `json:"-"` - // ApplicationGatewayPrivateEndpointConnectionProperties - Properties of the application gateway private endpoint connection. - *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - // Name - Name of the private endpoint connection on an application gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateEndpointConnection. -func (agpec ApplicationGatewayPrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agpec.ApplicationGatewayPrivateEndpointConnectionProperties != nil { - objectMap["properties"] = agpec.ApplicationGatewayPrivateEndpointConnectionProperties - } - if agpec.Name != nil { - objectMap["name"] = agpec.Name - } - if agpec.ID != nil { - objectMap["id"] = agpec.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPrivateEndpointConnection struct. -func (agpec *ApplicationGatewayPrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPrivateEndpointConnectionProperties ApplicationGatewayPrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &applicationGatewayPrivateEndpointConnectionProperties) - if err != nil { - return err - } - agpec.ApplicationGatewayPrivateEndpointConnectionProperties = &applicationGatewayPrivateEndpointConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agpec.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agpec.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agpec.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agpec.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPrivateEndpointConnectionListResult response for -// ListApplicationGatewayPrivateEndpointConnection API service call. Gets all private endpoint connections -// for an application gateway. -type ApplicationGatewayPrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - List of private endpoint connections on an application gateway. - Value *[]ApplicationGatewayPrivateEndpointConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayPrivateEndpointConnectionListResultIterator provides access to a complete listing of -// ApplicationGatewayPrivateEndpointConnection values. -type ApplicationGatewayPrivateEndpointConnectionListResultIterator struct { - i int - page ApplicationGatewayPrivateEndpointConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayPrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayPrivateEndpointConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayPrivateEndpointConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayPrivateEndpointConnectionListResultIterator) Response() ApplicationGatewayPrivateEndpointConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayPrivateEndpointConnectionListResultIterator) Value() ApplicationGatewayPrivateEndpointConnection { - if !iter.page.NotDone() { - return ApplicationGatewayPrivateEndpointConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayPrivateEndpointConnectionListResultIterator type. -func NewApplicationGatewayPrivateEndpointConnectionListResultIterator(page ApplicationGatewayPrivateEndpointConnectionListResultPage) ApplicationGatewayPrivateEndpointConnectionListResultIterator { - return ApplicationGatewayPrivateEndpointConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (agpeclr ApplicationGatewayPrivateEndpointConnectionListResult) IsEmpty() bool { - return agpeclr.Value == nil || len(*agpeclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (agpeclr ApplicationGatewayPrivateEndpointConnectionListResult) hasNextLink() bool { - return agpeclr.NextLink != nil && len(*agpeclr.NextLink) != 0 -} - -// applicationGatewayPrivateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (agpeclr ApplicationGatewayPrivateEndpointConnectionListResult) applicationGatewayPrivateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !agpeclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(agpeclr.NextLink))) -} - -// ApplicationGatewayPrivateEndpointConnectionListResultPage contains a page of -// ApplicationGatewayPrivateEndpointConnection values. -type ApplicationGatewayPrivateEndpointConnectionListResultPage struct { - fn func(context.Context, ApplicationGatewayPrivateEndpointConnectionListResult) (ApplicationGatewayPrivateEndpointConnectionListResult, error) - agpeclr ApplicationGatewayPrivateEndpointConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayPrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateEndpointConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.agpeclr) - if err != nil { - return err - } - page.agpeclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayPrivateEndpointConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayPrivateEndpointConnectionListResultPage) NotDone() bool { - return !page.agpeclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayPrivateEndpointConnectionListResultPage) Response() ApplicationGatewayPrivateEndpointConnectionListResult { - return page.agpeclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayPrivateEndpointConnectionListResultPage) Values() []ApplicationGatewayPrivateEndpointConnection { - if page.agpeclr.IsEmpty() { - return nil - } - return *page.agpeclr.Value -} - -// Creates a new instance of the ApplicationGatewayPrivateEndpointConnectionListResultPage type. -func NewApplicationGatewayPrivateEndpointConnectionListResultPage(cur ApplicationGatewayPrivateEndpointConnectionListResult, getNextPage func(context.Context, ApplicationGatewayPrivateEndpointConnectionListResult) (ApplicationGatewayPrivateEndpointConnectionListResult, error)) ApplicationGatewayPrivateEndpointConnectionListResultPage { - return ApplicationGatewayPrivateEndpointConnectionListResultPage{ - fn: getNextPage, - agpeclr: cur, - } -} - -// ApplicationGatewayPrivateEndpointConnectionProperties properties of Private Link Resource of an -// application gateway. -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - // PrivateEndpoint - READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private endpoint connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // LinkIdentifier - READ-ONLY; The consumer link id. - LinkIdentifier *string `json:"linkIdentifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateEndpointConnectionProperties. -func (agpecp ApplicationGatewayPrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agpecp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = agpecp.PrivateLinkServiceConnectionState - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type ApplicationGatewayPrivateEndpointConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewayPrivateEndpointConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewayPrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewayPrivateEndpointConnectionsDeleteFuture.Result. -func (future *ApplicationGatewayPrivateEndpointConnectionsDeleteFuture) result(client ApplicationGatewayPrivateEndpointConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewayPrivateEndpointConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGatewayPrivateEndpointConnectionsUpdateFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type ApplicationGatewayPrivateEndpointConnectionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewayPrivateEndpointConnectionsClient) (ApplicationGatewayPrivateEndpointConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewayPrivateEndpointConnectionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewayPrivateEndpointConnectionsUpdateFuture.Result. -func (future *ApplicationGatewayPrivateEndpointConnectionsUpdateFuture) result(client ApplicationGatewayPrivateEndpointConnectionsClient) (agpec ApplicationGatewayPrivateEndpointConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - agpec.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewayPrivateEndpointConnectionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if agpec.Response.Response, err = future.GetResult(sender); err == nil && agpec.Response.Response.StatusCode != http.StatusNoContent { - agpec, err = client.UpdateResponder(agpec.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewayPrivateEndpointConnectionsUpdateFuture", "Result", agpec.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationGatewayPrivateLinkConfiguration private Link Configuration on an application gateway. -type ApplicationGatewayPrivateLinkConfiguration struct { - // ApplicationGatewayPrivateLinkConfigurationProperties - Properties of the application gateway private link configuration. - *ApplicationGatewayPrivateLinkConfigurationProperties `json:"properties,omitempty"` - // Name - Name of the private link configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkConfiguration. -func (agplc ApplicationGatewayPrivateLinkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplc.ApplicationGatewayPrivateLinkConfigurationProperties != nil { - objectMap["properties"] = agplc.ApplicationGatewayPrivateLinkConfigurationProperties - } - if agplc.Name != nil { - objectMap["name"] = agplc.Name - } - if agplc.ID != nil { - objectMap["id"] = agplc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPrivateLinkConfiguration struct. -func (agplc *ApplicationGatewayPrivateLinkConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPrivateLinkConfigurationProperties ApplicationGatewayPrivateLinkConfigurationProperties - err = json.Unmarshal(*v, &applicationGatewayPrivateLinkConfigurationProperties) - if err != nil { - return err - } - agplc.ApplicationGatewayPrivateLinkConfigurationProperties = &applicationGatewayPrivateLinkConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agplc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agplc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agplc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agplc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPrivateLinkConfigurationProperties properties of private link configuration on an -// application gateway. -type ApplicationGatewayPrivateLinkConfigurationProperties struct { - // IPConfigurations - An array of application gateway private link ip configurations. - IPConfigurations *[]ApplicationGatewayPrivateLinkIPConfiguration `json:"ipConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private link configuration. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkConfigurationProperties. -func (agplcp ApplicationGatewayPrivateLinkConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplcp.IPConfigurations != nil { - objectMap["ipConfigurations"] = agplcp.IPConfigurations - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPrivateLinkIPConfiguration the application gateway private link ip configuration. -type ApplicationGatewayPrivateLinkIPConfiguration struct { - // ApplicationGatewayPrivateLinkIPConfigurationProperties - Properties of an application gateway private link ip configuration. - *ApplicationGatewayPrivateLinkIPConfigurationProperties `json:"properties,omitempty"` - // Name - The name of application gateway private link ip configuration. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkIPConfiguration. -func (agplic ApplicationGatewayPrivateLinkIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplic.ApplicationGatewayPrivateLinkIPConfigurationProperties != nil { - objectMap["properties"] = agplic.ApplicationGatewayPrivateLinkIPConfigurationProperties - } - if agplic.Name != nil { - objectMap["name"] = agplic.Name - } - if agplic.ID != nil { - objectMap["id"] = agplic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPrivateLinkIPConfiguration struct. -func (agplic *ApplicationGatewayPrivateLinkIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPrivateLinkIPConfigurationProperties ApplicationGatewayPrivateLinkIPConfigurationProperties - err = json.Unmarshal(*v, &applicationGatewayPrivateLinkIPConfigurationProperties) - if err != nil { - return err - } - agplic.ApplicationGatewayPrivateLinkIPConfigurationProperties = &applicationGatewayPrivateLinkIPConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agplic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agplic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agplic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agplic.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPrivateLinkIPConfigurationProperties properties of an application gateway private link -// IP configuration. -type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - Reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // Primary - Whether the ip configuration is primary or not. - Primary *bool `json:"primary,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway private link IP configuration. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkIPConfigurationProperties. -func (agplicp ApplicationGatewayPrivateLinkIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplicp.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = agplicp.PrivateIPAddress - } - if agplicp.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = agplicp.PrivateIPAllocationMethod - } - if agplicp.Subnet != nil { - objectMap["subnet"] = agplicp.Subnet - } - if agplicp.Primary != nil { - objectMap["primary"] = agplicp.Primary - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPrivateLinkResource privateLink Resource of an application gateway. -type ApplicationGatewayPrivateLinkResource struct { - // ApplicationGatewayPrivateLinkResourceProperties - Properties of the application gateway private link resource. - *ApplicationGatewayPrivateLinkResourceProperties `json:"properties,omitempty"` - // Name - Name of the private link resource that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkResource. -func (agplr ApplicationGatewayPrivateLinkResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplr.ApplicationGatewayPrivateLinkResourceProperties != nil { - objectMap["properties"] = agplr.ApplicationGatewayPrivateLinkResourceProperties - } - if agplr.Name != nil { - objectMap["name"] = agplr.Name - } - if agplr.ID != nil { - objectMap["id"] = agplr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPrivateLinkResource struct. -func (agplr *ApplicationGatewayPrivateLinkResource) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayPrivateLinkResourceProperties ApplicationGatewayPrivateLinkResourceProperties - err = json.Unmarshal(*v, &applicationGatewayPrivateLinkResourceProperties) - if err != nil { - return err - } - agplr.ApplicationGatewayPrivateLinkResourceProperties = &applicationGatewayPrivateLinkResourceProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agplr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agplr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agplr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agplr.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayPrivateLinkResourceListResult response for ListApplicationGatewayPrivateLinkResources -// API service call. Gets all private link resources for an application gateway. -type ApplicationGatewayPrivateLinkResourceListResult struct { - autorest.Response `json:"-"` - // Value - List of private link resources of an application gateway. - Value *[]ApplicationGatewayPrivateLinkResource `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayPrivateLinkResourceListResultIterator provides access to a complete listing of -// ApplicationGatewayPrivateLinkResource values. -type ApplicationGatewayPrivateLinkResourceListResultIterator struct { - i int - page ApplicationGatewayPrivateLinkResourceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayPrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayPrivateLinkResourceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayPrivateLinkResourceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayPrivateLinkResourceListResultIterator) Response() ApplicationGatewayPrivateLinkResourceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayPrivateLinkResourceListResultIterator) Value() ApplicationGatewayPrivateLinkResource { - if !iter.page.NotDone() { - return ApplicationGatewayPrivateLinkResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayPrivateLinkResourceListResultIterator type. -func NewApplicationGatewayPrivateLinkResourceListResultIterator(page ApplicationGatewayPrivateLinkResourceListResultPage) ApplicationGatewayPrivateLinkResourceListResultIterator { - return ApplicationGatewayPrivateLinkResourceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (agplrlr ApplicationGatewayPrivateLinkResourceListResult) IsEmpty() bool { - return agplrlr.Value == nil || len(*agplrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (agplrlr ApplicationGatewayPrivateLinkResourceListResult) hasNextLink() bool { - return agplrlr.NextLink != nil && len(*agplrlr.NextLink) != 0 -} - -// applicationGatewayPrivateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (agplrlr ApplicationGatewayPrivateLinkResourceListResult) applicationGatewayPrivateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !agplrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(agplrlr.NextLink))) -} - -// ApplicationGatewayPrivateLinkResourceListResultPage contains a page of -// ApplicationGatewayPrivateLinkResource values. -type ApplicationGatewayPrivateLinkResourceListResultPage struct { - fn func(context.Context, ApplicationGatewayPrivateLinkResourceListResult) (ApplicationGatewayPrivateLinkResourceListResult, error) - agplrlr ApplicationGatewayPrivateLinkResourceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayPrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayPrivateLinkResourceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.agplrlr) - if err != nil { - return err - } - page.agplrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayPrivateLinkResourceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayPrivateLinkResourceListResultPage) NotDone() bool { - return !page.agplrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayPrivateLinkResourceListResultPage) Response() ApplicationGatewayPrivateLinkResourceListResult { - return page.agplrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayPrivateLinkResourceListResultPage) Values() []ApplicationGatewayPrivateLinkResource { - if page.agplrlr.IsEmpty() { - return nil - } - return *page.agplrlr.Value -} - -// Creates a new instance of the ApplicationGatewayPrivateLinkResourceListResultPage type. -func NewApplicationGatewayPrivateLinkResourceListResultPage(cur ApplicationGatewayPrivateLinkResourceListResult, getNextPage func(context.Context, ApplicationGatewayPrivateLinkResourceListResult) (ApplicationGatewayPrivateLinkResourceListResult, error)) ApplicationGatewayPrivateLinkResourceListResultPage { - return ApplicationGatewayPrivateLinkResourceListResultPage{ - fn: getNextPage, - agplrlr: cur, - } -} - -// ApplicationGatewayPrivateLinkResourceProperties properties of a private link resource. -type ApplicationGatewayPrivateLinkResourceProperties struct { - // GroupID - READ-ONLY; Group identifier of private link resource. - GroupID *string `json:"groupId,omitempty"` - // RequiredMembers - READ-ONLY; Required member names of private link resource. - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - // RequiredZoneNames - Required DNS zone names of the the private link resource. - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPrivateLinkResourceProperties. -func (agplrp ApplicationGatewayPrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agplrp.RequiredZoneNames != nil { - objectMap["requiredZoneNames"] = agplrp.RequiredZoneNames - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayProbe probe of the application gateway. -type ApplicationGatewayProbe struct { - // ApplicationGatewayProbePropertiesFormat - Properties of the application gateway probe. - *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the probe that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayProbe. -func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agp.ApplicationGatewayProbePropertiesFormat != nil { - objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat - } - if agp.Name != nil { - objectMap["name"] = agp.Name - } - if agp.ID != nil { - objectMap["id"] = agp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct. -func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat) - if err != nil { - return err - } - agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agp.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayProbeHealthResponseMatch application gateway probe health response match. -type ApplicationGatewayProbeHealthResponseMatch struct { - // Body - Body that must be contained in the health response. Default value is empty. - Body *string `json:"body,omitempty"` - // StatusCodes - Allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. - StatusCodes *[]string `json:"statusCodes,omitempty"` -} - -// ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway. -type ApplicationGatewayProbePropertiesFormat struct { - // Protocol - The protocol used for the probe. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // Host - Host name to send the probe to. - Host *string `json:"host,omitempty"` - // Path - Relative path of probe. Valid path starts from '/'. Probe is sent to ://:. - Path *string `json:"path,omitempty"` - // Interval - The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. - Interval *int32 `json:"interval,omitempty"` - // Timeout - The probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` - // UnhealthyThreshold - The probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. - UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` - // PickHostNameFromBackendHTTPSettings - Whether the host header should be picked from the backend http settings. Default value is false. - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - // PickHostNameFromBackendSettings - Whether the server name indication should be picked from the backend settings for Tls protocol. Default value is false. - PickHostNameFromBackendSettings *bool `json:"pickHostNameFromBackendSettings,omitempty"` - // MinServers - Minimum number of servers that are always marked healthy. Default value is 0. - MinServers *int32 `json:"minServers,omitempty"` - // Match - Criterion for classifying a healthy probe response. - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Port - Custom port which will be used for probing the backend servers. The valid value ranges from 1 to 65535. In case not set, port from http settings will be used. This property is valid for Standard_v2 and WAF_v2 only. - Port *int32 `json:"port,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayProbePropertiesFormat. -func (agppf ApplicationGatewayProbePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agppf.Protocol != "" { - objectMap["protocol"] = agppf.Protocol - } - if agppf.Host != nil { - objectMap["host"] = agppf.Host - } - if agppf.Path != nil { - objectMap["path"] = agppf.Path - } - if agppf.Interval != nil { - objectMap["interval"] = agppf.Interval - } - if agppf.Timeout != nil { - objectMap["timeout"] = agppf.Timeout - } - if agppf.UnhealthyThreshold != nil { - objectMap["unhealthyThreshold"] = agppf.UnhealthyThreshold - } - if agppf.PickHostNameFromBackendHTTPSettings != nil { - objectMap["pickHostNameFromBackendHttpSettings"] = agppf.PickHostNameFromBackendHTTPSettings - } - if agppf.PickHostNameFromBackendSettings != nil { - objectMap["pickHostNameFromBackendSettings"] = agppf.PickHostNameFromBackendSettings - } - if agppf.MinServers != nil { - objectMap["minServers"] = agppf.MinServers - } - if agppf.Match != nil { - objectMap["match"] = agppf.Match - } - if agppf.Port != nil { - objectMap["port"] = agppf.Port - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayPropertiesFormat properties of the application gateway. -type ApplicationGatewayPropertiesFormat struct { - // Sku - SKU of the application gateway resource. - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - // SslPolicy - SSL policy of the application gateway resource. - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - // OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' - OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - // GatewayIPConfigurations - Subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - // AuthenticationCertificates - Authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - // TrustedRootCertificates - Trusted Root certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - // TrustedClientCertificates - Trusted client certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` - // SslCertificates - SSL certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - // FrontendIPConfigurations - Frontend IP addresses of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - // FrontendPorts - Frontend ports of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - // Probes - Probes of the application gateway resource. - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - // BackendAddressPools - Backend address pool of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - // BackendHTTPSettingsCollection - Backend http settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - // BackendSettingsCollection - Backend settings of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` - // HTTPListeners - Http listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - // Listeners - Listeners of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` - // SslProfiles - SSL profiles of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` - // URLPathMaps - URL path map of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` - // RequestRoutingRules - Request routing rules of the application gateway resource. - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - // RoutingRules - Routing rules of the application gateway resource. - RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` - // RewriteRuleSets - Rewrite rules for the application gateway resource. - RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - // RedirectConfigurations - Redirect configurations of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). - RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - // WebApplicationFirewallConfiguration - Web application firewall configuration. - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` - // FirewallPolicy - Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - // EnableHTTP2 - Whether HTTP2 is enabled on the application gateway resource. - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - // EnableFips - Whether FIPS is enabled on the application gateway resource. - EnableFips *bool `json:"enableFips,omitempty"` - // AutoscaleConfiguration - Autoscale Configuration. - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - // PrivateLinkConfigurations - PrivateLink configurations on application gateway. - PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - // PrivateEndpointConnections - READ-ONLY; Private Endpoint connections on application gateway. - PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the application gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CustomErrorConfigurations - Custom error configurations of the application gateway resource. - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - // ForceFirewallPolicyAssociation - If true, associates a firewall policy with an application gateway regardless whether the policy differs from the WAF Config. - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` - // LoadDistributionPolicies - Load distribution policies of the application gateway resource. - LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` - // GlobalConfiguration - Global Configuration. - GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat. -func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agpf.Sku != nil { - objectMap["sku"] = agpf.Sku - } - if agpf.SslPolicy != nil { - objectMap["sslPolicy"] = agpf.SslPolicy - } - if agpf.GatewayIPConfigurations != nil { - objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations - } - if agpf.AuthenticationCertificates != nil { - objectMap["authenticationCertificates"] = agpf.AuthenticationCertificates - } - if agpf.TrustedRootCertificates != nil { - objectMap["trustedRootCertificates"] = agpf.TrustedRootCertificates - } - if agpf.TrustedClientCertificates != nil { - objectMap["trustedClientCertificates"] = agpf.TrustedClientCertificates - } - if agpf.SslCertificates != nil { - objectMap["sslCertificates"] = agpf.SslCertificates - } - if agpf.FrontendIPConfigurations != nil { - objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations - } - if agpf.FrontendPorts != nil { - objectMap["frontendPorts"] = agpf.FrontendPorts - } - if agpf.Probes != nil { - objectMap["probes"] = agpf.Probes - } - if agpf.BackendAddressPools != nil { - objectMap["backendAddressPools"] = agpf.BackendAddressPools - } - if agpf.BackendHTTPSettingsCollection != nil { - objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection - } - if agpf.BackendSettingsCollection != nil { - objectMap["backendSettingsCollection"] = agpf.BackendSettingsCollection - } - if agpf.HTTPListeners != nil { - objectMap["httpListeners"] = agpf.HTTPListeners - } - if agpf.Listeners != nil { - objectMap["listeners"] = agpf.Listeners - } - if agpf.SslProfiles != nil { - objectMap["sslProfiles"] = agpf.SslProfiles - } - if agpf.URLPathMaps != nil { - objectMap["urlPathMaps"] = agpf.URLPathMaps - } - if agpf.RequestRoutingRules != nil { - objectMap["requestRoutingRules"] = agpf.RequestRoutingRules - } - if agpf.RoutingRules != nil { - objectMap["routingRules"] = agpf.RoutingRules - } - if agpf.RewriteRuleSets != nil { - objectMap["rewriteRuleSets"] = agpf.RewriteRuleSets - } - if agpf.RedirectConfigurations != nil { - objectMap["redirectConfigurations"] = agpf.RedirectConfigurations - } - if agpf.WebApplicationFirewallConfiguration != nil { - objectMap["webApplicationFirewallConfiguration"] = agpf.WebApplicationFirewallConfiguration - } - if agpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = agpf.FirewallPolicy - } - if agpf.EnableHTTP2 != nil { - objectMap["enableHttp2"] = agpf.EnableHTTP2 - } - if agpf.EnableFips != nil { - objectMap["enableFips"] = agpf.EnableFips - } - if agpf.AutoscaleConfiguration != nil { - objectMap["autoscaleConfiguration"] = agpf.AutoscaleConfiguration - } - if agpf.PrivateLinkConfigurations != nil { - objectMap["privateLinkConfigurations"] = agpf.PrivateLinkConfigurations - } - if agpf.CustomErrorConfigurations != nil { - objectMap["customErrorConfigurations"] = agpf.CustomErrorConfigurations - } - if agpf.ForceFirewallPolicyAssociation != nil { - objectMap["forceFirewallPolicyAssociation"] = agpf.ForceFirewallPolicyAssociation - } - if agpf.LoadDistributionPolicies != nil { - objectMap["loadDistributionPolicies"] = agpf.LoadDistributionPolicies - } - if agpf.GlobalConfiguration != nil { - objectMap["globalConfiguration"] = agpf.GlobalConfiguration - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayRedirectConfiguration redirect configuration of an application gateway. -type ApplicationGatewayRedirectConfiguration struct { - // ApplicationGatewayRedirectConfigurationPropertiesFormat - Properties of the application gateway redirect configuration. - *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the redirect configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRedirectConfiguration. -func (agrc ApplicationGatewayRedirectConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat != nil { - objectMap["properties"] = agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat - } - if agrc.Name != nil { - objectMap["name"] = agrc.Name - } - if agrc.ID != nil { - objectMap["id"] = agrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRedirectConfiguration struct. -func (agrc *ApplicationGatewayRedirectConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayRedirectConfigurationPropertiesFormat ApplicationGatewayRedirectConfigurationPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayRedirectConfigurationPropertiesFormat) - if err != nil { - return err - } - agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat = &applicationGatewayRedirectConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agrc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agrc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agrc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayRedirectConfigurationPropertiesFormat properties of redirect configuration of the -// application gateway. -type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - // RedirectType - HTTP redirection type. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' - RedirectType ApplicationGatewayRedirectType `json:"redirectType,omitempty"` - // TargetListener - Reference to a listener to redirect the request to. - TargetListener *SubResource `json:"targetListener,omitempty"` - // TargetURL - Url to redirect the request to. - TargetURL *string `json:"targetUrl,omitempty"` - // IncludePath - Include path in the redirected url. - IncludePath *bool `json:"includePath,omitempty"` - // IncludeQueryString - Include query string in the redirected url. - IncludeQueryString *bool `json:"includeQueryString,omitempty"` - // RequestRoutingRules - Request routing specifying redirect configuration. - RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` - // URLPathMaps - Url path maps specifying default redirect configuration. - URLPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` - // PathRules - Path rules specifying redirect configuration. - PathRules *[]SubResource `json:"pathRules,omitempty"` -} - -// ApplicationGatewayRequestRoutingRule request routing rule of an application gateway. -type ApplicationGatewayRequestRoutingRule struct { - // ApplicationGatewayRequestRoutingRulePropertiesFormat - Properties of the application gateway request routing rule. - *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the request routing rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRule. -func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil { - objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat - } - if agrrr.Name != nil { - objectMap["name"] = agrrr.Name - } - if agrrr.ID != nil { - objectMap["id"] = agrrr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct. -func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat) - if err != nil { - return err - } - agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agrrr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agrrr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agrrr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agrrr.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the -// application gateway. -type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' - RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - // Priority - Priority of the request routing rule. - Priority *int32 `json:"priority,omitempty"` - // BackendAddressPool - Backend address pool resource of the application gateway. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendHTTPSettings - Backend http settings resource of the application gateway. - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - // HTTPListener - Http listener resource of the application gateway. - HTTPListener *SubResource `json:"httpListener,omitempty"` - // URLPathMap - URL path map resource of the application gateway. - URLPathMap *SubResource `json:"urlPathMap,omitempty"` - // RewriteRuleSet - Rewrite Rule Set resource in Basic rule of the application gateway. - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - // RedirectConfiguration - Redirect configuration resource of the application gateway. - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - // LoadDistributionPolicy - Load Distribution Policy resource of the application gateway. - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the request routing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRulePropertiesFormat. -func (agrrrpf ApplicationGatewayRequestRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrrpf.RuleType != "" { - objectMap["ruleType"] = agrrrpf.RuleType - } - if agrrrpf.Priority != nil { - objectMap["priority"] = agrrrpf.Priority - } - if agrrrpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = agrrrpf.BackendAddressPool - } - if agrrrpf.BackendHTTPSettings != nil { - objectMap["backendHttpSettings"] = agrrrpf.BackendHTTPSettings - } - if agrrrpf.HTTPListener != nil { - objectMap["httpListener"] = agrrrpf.HTTPListener - } - if agrrrpf.URLPathMap != nil { - objectMap["urlPathMap"] = agrrrpf.URLPathMap - } - if agrrrpf.RewriteRuleSet != nil { - objectMap["rewriteRuleSet"] = agrrrpf.RewriteRuleSet - } - if agrrrpf.RedirectConfiguration != nil { - objectMap["redirectConfiguration"] = agrrrpf.RedirectConfiguration - } - if agrrrpf.LoadDistributionPolicy != nil { - objectMap["loadDistributionPolicy"] = agrrrpf.LoadDistributionPolicy - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayRewriteRule rewrite rule of an application gateway. -type ApplicationGatewayRewriteRule struct { - // Name - Name of the rewrite rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // RuleSequence - Rule Sequence of the rewrite rule that determines the order of execution of a particular rule in a RewriteRuleSet. - RuleSequence *int32 `json:"ruleSequence,omitempty"` - // Conditions - Conditions based on which the action set execution will be evaluated. - Conditions *[]ApplicationGatewayRewriteRuleCondition `json:"conditions,omitempty"` - // ActionSet - Set of actions to be done as part of the rewrite Rule. - ActionSet *ApplicationGatewayRewriteRuleActionSet `json:"actionSet,omitempty"` -} - -// ApplicationGatewayRewriteRuleActionSet set of actions in the Rewrite Rule in Application Gateway. -type ApplicationGatewayRewriteRuleActionSet struct { - // RequestHeaderConfigurations - Request Header Actions in the Action Set. - RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` - // ResponseHeaderConfigurations - Response Header Actions in the Action Set. - ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - // URLConfiguration - Url Configuration Action in the Action Set. - URLConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"` -} - -// ApplicationGatewayRewriteRuleCondition set of conditions in the Rewrite Rule in Application Gateway. -type ApplicationGatewayRewriteRuleCondition struct { - // Variable - The condition parameter of the RewriteRuleCondition. - Variable *string `json:"variable,omitempty"` - // Pattern - The pattern, either fixed string or regular expression, that evaluates the truthfulness of the condition. - Pattern *string `json:"pattern,omitempty"` - // IgnoreCase - Setting this parameter to truth value with force the pattern to do a case in-sensitive comparison. - IgnoreCase *bool `json:"ignoreCase,omitempty"` - // Negate - Setting this value as truth will force to check the negation of the condition given by the user. - Negate *bool `json:"negate,omitempty"` -} - -// ApplicationGatewayRewriteRuleSet rewrite rule set of an application gateway. -type ApplicationGatewayRewriteRuleSet struct { - // ApplicationGatewayRewriteRuleSetPropertiesFormat - Properties of the application gateway rewrite rule set. - *ApplicationGatewayRewriteRuleSetPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the rewrite rule set that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRewriteRuleSet. -func (agrrs ApplicationGatewayRewriteRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat != nil { - objectMap["properties"] = agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat - } - if agrrs.Name != nil { - objectMap["name"] = agrrs.Name - } - if agrrs.ID != nil { - objectMap["id"] = agrrs.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRewriteRuleSet struct. -func (agrrs *ApplicationGatewayRewriteRuleSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayRewriteRuleSetPropertiesFormat ApplicationGatewayRewriteRuleSetPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayRewriteRuleSetPropertiesFormat) - if err != nil { - return err - } - agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat = &applicationGatewayRewriteRuleSetPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agrrs.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agrrs.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agrrs.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayRewriteRuleSetPropertiesFormat properties of rewrite rule set of the application -// gateway. -type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { - // RewriteRules - Rewrite rules in the rewrite rule set. - RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the rewrite rule set resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRewriteRuleSetPropertiesFormat. -func (agrrspf ApplicationGatewayRewriteRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrspf.RewriteRules != nil { - objectMap["rewriteRules"] = agrrspf.RewriteRules - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayRoutingRule routing rule of an application gateway. -type ApplicationGatewayRoutingRule struct { - // ApplicationGatewayRoutingRulePropertiesFormat - Properties of the application gateway routing rule. - *ApplicationGatewayRoutingRulePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the routing rule that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRoutingRule. -func (agrr ApplicationGatewayRoutingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrr.ApplicationGatewayRoutingRulePropertiesFormat != nil { - objectMap["properties"] = agrr.ApplicationGatewayRoutingRulePropertiesFormat - } - if agrr.Name != nil { - objectMap["name"] = agrr.Name - } - if agrr.ID != nil { - objectMap["id"] = agrr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRoutingRule struct. -func (agrr *ApplicationGatewayRoutingRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayRoutingRulePropertiesFormat ApplicationGatewayRoutingRulePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayRoutingRulePropertiesFormat) - if err != nil { - return err - } - agrr.ApplicationGatewayRoutingRulePropertiesFormat = &applicationGatewayRoutingRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agrr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agrr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agrr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agrr.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayRoutingRulePropertiesFormat properties of routing rule of the application gateway. -type ApplicationGatewayRoutingRulePropertiesFormat struct { - // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' - RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - // Priority - Priority of the routing rule. - Priority *int32 `json:"priority,omitempty"` - // BackendAddressPool - Backend address pool resource of the application gateway. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendSettings - Backend settings resource of the application gateway. - BackendSettings *SubResource `json:"backendSettings,omitempty"` - // Listener - Listener resource of the application gateway. - Listener *SubResource `json:"listener,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the request routing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayRoutingRulePropertiesFormat. -func (agrrpf ApplicationGatewayRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agrrpf.RuleType != "" { - objectMap["ruleType"] = agrrpf.RuleType - } - if agrrpf.Priority != nil { - objectMap["priority"] = agrrpf.Priority - } - if agrrpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = agrrpf.BackendAddressPool - } - if agrrpf.BackendSettings != nil { - objectMap["backendSettings"] = agrrpf.BackendSettings - } - if agrrpf.Listener != nil { - objectMap["listener"] = agrrpf.Listener - } - return json.Marshal(objectMap) -} - -// ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationGatewaysBackendHealthFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealth, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysBackendHealthFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysBackendHealthFuture.Result. -func (future *ApplicationGatewaysBackendHealthFuture) result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - agbh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if agbh.Response.Response, err = future.GetResult(sender); err == nil && agbh.Response.Response.StatusCode != http.StatusNoContent { - agbh, err = client.BackendHealthResponder(agbh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", agbh.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationGatewaysBackendHealthOnDemandFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ApplicationGatewaysBackendHealthOnDemandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealthOnDemand, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysBackendHealthOnDemandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysBackendHealthOnDemandFuture.Result. -func (future *ApplicationGatewaysBackendHealthOnDemandFuture) result(client ApplicationGatewaysClient) (agbhod ApplicationGatewayBackendHealthOnDemand, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthOnDemandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - agbhod.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthOnDemandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if agbhod.Response.Response, err = future.GetResult(sender); err == nil && agbhod.Response.Response.StatusCode != http.StatusNoContent { - agbhod, err = client.BackendHealthOnDemandResponder(agbhod.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthOnDemandFuture", "Result", agbhod.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (ApplicationGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysCreateOrUpdateFuture.Result. -func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ag.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ag.Response.Response, err = future.GetResult(sender); err == nil && ag.Response.Response.StatusCode != http.StatusNoContent { - ag, err = client.CreateOrUpdateResponder(ag.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", ag.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysDeleteFuture.Result. -func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGatewaySku SKU of an application gateway. -type ApplicationGatewaySku struct { - // Name - Name of an application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge', 'StandardV2', 'StandardBasic', 'WAFV2' - Name ApplicationGatewaySkuName `json:"name,omitempty"` - // Tier - Tier of an application gateway. Possible values include: 'ApplicationGatewayTierStandard', 'ApplicationGatewayTierWAF', 'ApplicationGatewayTierStandardV2', 'ApplicationGatewayTierWAFV2', 'ApplicationGatewayTierStandardBasic' - Tier ApplicationGatewayTier `json:"tier,omitempty"` - // Capacity - Capacity (instance count) of an application gateway. - Capacity *int32 `json:"capacity,omitempty"` -} - -// ApplicationGatewaySslCertificate SSL certificates of an application gateway. -type ApplicationGatewaySslCertificate struct { - // ApplicationGatewaySslCertificatePropertiesFormat - Properties of the application gateway SSL certificate. - *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the SSL certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificate. -func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil { - objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat - } - if agsc.Name != nil { - objectMap["name"] = agsc.Name - } - if agsc.ID != nil { - objectMap["id"] = agsc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct. -func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat) - if err != nil { - return err - } - agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agsc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agsc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agsc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agsc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of an application -// gateway. -type ApplicationGatewaySslCertificatePropertiesFormat struct { - // Data - Base-64 encoded pfx certificate. Only applicable in PUT Request. - Data *string `json:"data,omitempty"` - // Password - Password for the pfx file specified in data. Only applicable in PUT request. - Password *string `json:"password,omitempty"` - // PublicCertData - READ-ONLY; Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. - PublicCertData *string `json:"publicCertData,omitempty"` - // KeyVaultSecretID - Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the SSL certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificatePropertiesFormat. -func (agscpf ApplicationGatewaySslCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agscpf.Data != nil { - objectMap["data"] = agscpf.Data - } - if agscpf.Password != nil { - objectMap["password"] = agscpf.Password - } - if agscpf.KeyVaultSecretID != nil { - objectMap["keyVaultSecretId"] = agscpf.KeyVaultSecretID - } - return json.Marshal(objectMap) -} - -// ApplicationGatewaySslPolicy application Gateway Ssl policy. -type ApplicationGatewaySslPolicy struct { - // DisabledSslProtocols - Ssl protocols to be disabled on application gateway. - DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` - // PolicyType - Type of Ssl Policy. Possible values include: 'Predefined', 'Custom', 'CustomV2' - PolicyType ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` - // PolicyName - Name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' - PolicyName ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` - // CipherSuites - Ssl cipher suites to be enabled in the specified order to application gateway. - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12', 'TLSv13' - MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` -} - -// ApplicationGatewaySslPredefinedPolicy an Ssl predefined policy. -type ApplicationGatewaySslPredefinedPolicy struct { - autorest.Response `json:"-"` - // Name - Name of the Ssl predefined policy. - Name *string `json:"name,omitempty"` - // ApplicationGatewaySslPredefinedPolicyPropertiesFormat - Properties of the application gateway SSL predefined policy. - *ApplicationGatewaySslPredefinedPolicyPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewaySslPredefinedPolicy. -func (agspp ApplicationGatewaySslPredefinedPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agspp.Name != nil { - objectMap["name"] = agspp.Name - } - if agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat != nil { - objectMap["properties"] = agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat - } - if agspp.ID != nil { - objectMap["id"] = agspp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslPredefinedPolicy struct. -func (agspp *ApplicationGatewaySslPredefinedPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agspp.Name = &name - } - case "properties": - if v != nil { - var applicationGatewaySslPredefinedPolicyPropertiesFormat ApplicationGatewaySslPredefinedPolicyPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewaySslPredefinedPolicyPropertiesFormat) - if err != nil { - return err - } - agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat = &applicationGatewaySslPredefinedPolicyPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agspp.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewaySslPredefinedPolicyPropertiesFormat properties of -// ApplicationGatewaySslPredefinedPolicy. -type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { - // CipherSuites - Ssl cipher suites to be enabled in the specified order for application gateway. - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12', 'TLSv13' - MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` -} - -// ApplicationGatewaySslProfile SSL profile of an application gateway. -type ApplicationGatewaySslProfile struct { - // ApplicationGatewaySslProfilePropertiesFormat - Properties of the application gateway SSL profile. - *ApplicationGatewaySslProfilePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the SSL profile that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewaySslProfile. -func (agsp ApplicationGatewaySslProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agsp.ApplicationGatewaySslProfilePropertiesFormat != nil { - objectMap["properties"] = agsp.ApplicationGatewaySslProfilePropertiesFormat - } - if agsp.Name != nil { - objectMap["name"] = agsp.Name - } - if agsp.ID != nil { - objectMap["id"] = agsp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslProfile struct. -func (agsp *ApplicationGatewaySslProfile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewaySslProfilePropertiesFormat ApplicationGatewaySslProfilePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewaySslProfilePropertiesFormat) - if err != nil { - return err - } - agsp.ApplicationGatewaySslProfilePropertiesFormat = &applicationGatewaySslProfilePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agsp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agsp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agsp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agsp.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewaySslProfilePropertiesFormat properties of SSL profile of an application gateway. -type ApplicationGatewaySslProfilePropertiesFormat struct { - // TrustedClientCertificates - Array of references to application gateway trusted client certificates. - TrustedClientCertificates *[]SubResource `json:"trustedClientCertificates,omitempty"` - // SslPolicy - SSL policy of the application gateway resource. - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - // ClientAuthConfiguration - Client authentication configuration of the application gateway resource. - ClientAuthConfiguration *ApplicationGatewayClientAuthConfiguration `json:"clientAuthConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewaySslProfilePropertiesFormat. -func (agsppf ApplicationGatewaySslProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agsppf.TrustedClientCertificates != nil { - objectMap["trustedClientCertificates"] = agsppf.TrustedClientCertificates - } - if agsppf.SslPolicy != nil { - objectMap["sslPolicy"] = agsppf.SslPolicy - } - if agsppf.ClientAuthConfiguration != nil { - objectMap["clientAuthConfiguration"] = agsppf.ClientAuthConfiguration - } - return json.Marshal(objectMap) -} - -// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationGatewaysStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysStartFuture.Result. -func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ApplicationGatewaysStopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationGatewaysStopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationGatewaysStopFuture.Result. -func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture") - return - } - ar.Response = future.Response() - return -} - -// ApplicationGatewayTrustedClientCertificate trusted client certificates of an application gateway. -type ApplicationGatewayTrustedClientCertificate struct { - // ApplicationGatewayTrustedClientCertificatePropertiesFormat - Properties of the application gateway trusted client certificate. - *ApplicationGatewayTrustedClientCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the trusted client certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayTrustedClientCertificate. -func (agtcc ApplicationGatewayTrustedClientCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agtcc.ApplicationGatewayTrustedClientCertificatePropertiesFormat != nil { - objectMap["properties"] = agtcc.ApplicationGatewayTrustedClientCertificatePropertiesFormat - } - if agtcc.Name != nil { - objectMap["name"] = agtcc.Name - } - if agtcc.ID != nil { - objectMap["id"] = agtcc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayTrustedClientCertificate struct. -func (agtcc *ApplicationGatewayTrustedClientCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayTrustedClientCertificatePropertiesFormat ApplicationGatewayTrustedClientCertificatePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayTrustedClientCertificatePropertiesFormat) - if err != nil { - return err - } - agtcc.ApplicationGatewayTrustedClientCertificatePropertiesFormat = &applicationGatewayTrustedClientCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agtcc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agtcc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agtcc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agtcc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayTrustedClientCertificatePropertiesFormat trusted client certificates properties of an -// application gateway. -type ApplicationGatewayTrustedClientCertificatePropertiesFormat struct { - // Data - Certificate public data. - Data *string `json:"data,omitempty"` - // ValidatedCertData - READ-ONLY; Validated certificate data. - ValidatedCertData *string `json:"validatedCertData,omitempty"` - // ClientCertIssuerDN - READ-ONLY; Distinguished name of client certificate issuer. - ClientCertIssuerDN *string `json:"clientCertIssuerDN,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the trusted client certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayTrustedClientCertificatePropertiesFormat. -func (agtccpf ApplicationGatewayTrustedClientCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agtccpf.Data != nil { - objectMap["data"] = agtccpf.Data - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayTrustedRootCertificate trusted Root certificates of an application gateway. -type ApplicationGatewayTrustedRootCertificate struct { - // ApplicationGatewayTrustedRootCertificatePropertiesFormat - Properties of the application gateway trusted root certificate. - *ApplicationGatewayTrustedRootCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the trusted root certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayTrustedRootCertificate. -func (agtrc ApplicationGatewayTrustedRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat != nil { - objectMap["properties"] = agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat - } - if agtrc.Name != nil { - objectMap["name"] = agtrc.Name - } - if agtrc.ID != nil { - objectMap["id"] = agtrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayTrustedRootCertificate struct. -func (agtrc *ApplicationGatewayTrustedRootCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayTrustedRootCertificatePropertiesFormat ApplicationGatewayTrustedRootCertificatePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayTrustedRootCertificatePropertiesFormat) - if err != nil { - return err - } - agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat = &applicationGatewayTrustedRootCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agtrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agtrc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agtrc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agtrc.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayTrustedRootCertificatePropertiesFormat trusted Root certificates properties of an -// application gateway. -type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { - // Data - Certificate public data. - Data *string `json:"data,omitempty"` - // KeyVaultSecretID - Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the trusted root certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayTrustedRootCertificatePropertiesFormat. -func (agtrcpf ApplicationGatewayTrustedRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agtrcpf.Data != nil { - objectMap["data"] = agtrcpf.Data - } - if agtrcpf.KeyVaultSecretID != nil { - objectMap["keyVaultSecretId"] = agtrcpf.KeyVaultSecretID - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayURLConfiguration url configuration of the Actions set in Application Gateway. -type ApplicationGatewayURLConfiguration struct { - // ModifiedPath - Url path which user has provided for url rewrite. Null means no path will be updated. Default value is null. - ModifiedPath *string `json:"modifiedPath,omitempty"` - // ModifiedQueryString - Query string which user has provided for url rewrite. Null means no query string will be updated. Default value is null. - ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` - // Reroute - If set as true, it will re-evaluate the url path map provided in path based request routing rules using modified path. Default value is false. - Reroute *bool `json:"reroute,omitempty"` -} - -// ApplicationGatewayURLPathMap urlPathMaps give a url path to the backend mapping information for -// PathBasedRouting. -type ApplicationGatewayURLPathMap struct { - // ApplicationGatewayURLPathMapPropertiesFormat - Properties of the application gateway URL path map. - *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the URL path map that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMap. -func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil { - objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat - } - if agupm.Name != nil { - objectMap["name"] = agupm.Name - } - if agupm.ID != nil { - objectMap["id"] = agupm.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct. -func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat) - if err != nil { - return err - } - agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agupm.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - agupm.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agupm.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agupm.ID = &ID - } - } - } - - return nil -} - -// ApplicationGatewayURLPathMapPropertiesFormat properties of UrlPathMap of the application gateway. -type ApplicationGatewayURLPathMapPropertiesFormat struct { - // DefaultBackendAddressPool - Default backend address pool resource of URL path map. - DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` - // DefaultBackendHTTPSettings - Default backend http settings resource of URL path map. - DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` - // DefaultRewriteRuleSet - Default Rewrite rule set resource of URL path map. - DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"` - // DefaultRedirectConfiguration - Default redirect configuration resource of URL path map. - DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` - // DefaultLoadDistributionPolicy - Default Load Distribution Policy resource of URL path map. - DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` - // PathRules - Path rule of URL path map resource. - PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the URL path map resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMapPropertiesFormat. -func (agupmpf ApplicationGatewayURLPathMapPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agupmpf.DefaultBackendAddressPool != nil { - objectMap["defaultBackendAddressPool"] = agupmpf.DefaultBackendAddressPool - } - if agupmpf.DefaultBackendHTTPSettings != nil { - objectMap["defaultBackendHttpSettings"] = agupmpf.DefaultBackendHTTPSettings - } - if agupmpf.DefaultRewriteRuleSet != nil { - objectMap["defaultRewriteRuleSet"] = agupmpf.DefaultRewriteRuleSet - } - if agupmpf.DefaultRedirectConfiguration != nil { - objectMap["defaultRedirectConfiguration"] = agupmpf.DefaultRedirectConfiguration - } - if agupmpf.DefaultLoadDistributionPolicy != nil { - objectMap["defaultLoadDistributionPolicy"] = agupmpf.DefaultLoadDistributionPolicy - } - if agupmpf.PathRules != nil { - objectMap["pathRules"] = agupmpf.PathRules - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayWafDynamicManifestPropertiesResult properties of ApplicationGatewayWafDynamicManifest. -type ApplicationGatewayWafDynamicManifestPropertiesResult struct { - // DefaultRuleSetPropertyFormat - The default ruleset. - *DefaultRuleSetPropertyFormat `json:"defaultRuleSet,omitempty"` - // AvailableRuleSets - The available rulesets. - AvailableRuleSets *[]ApplicationGatewayFirewallManifestRuleSet `json:"availableRuleSets,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayWafDynamicManifestPropertiesResult. -func (agwdmpr ApplicationGatewayWafDynamicManifestPropertiesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agwdmpr.DefaultRuleSetPropertyFormat != nil { - objectMap["defaultRuleSet"] = agwdmpr.DefaultRuleSetPropertyFormat - } - if agwdmpr.AvailableRuleSets != nil { - objectMap["availableRuleSets"] = agwdmpr.AvailableRuleSets - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayWafDynamicManifestPropertiesResult struct. -func (agwdmpr *ApplicationGatewayWafDynamicManifestPropertiesResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "defaultRuleSet": - if v != nil { - var defaultRuleSetPropertyFormat DefaultRuleSetPropertyFormat - err = json.Unmarshal(*v, &defaultRuleSetPropertyFormat) - if err != nil { - return err - } - agwdmpr.DefaultRuleSetPropertyFormat = &defaultRuleSetPropertyFormat - } - case "availableRuleSets": - if v != nil { - var availableRuleSets []ApplicationGatewayFirewallManifestRuleSet - err = json.Unmarshal(*v, &availableRuleSets) - if err != nil { - return err - } - agwdmpr.AvailableRuleSets = &availableRuleSets - } - } - } - - return nil -} - -// ApplicationGatewayWafDynamicManifestResult response for ApplicationGatewayWafDynamicManifest API service -// call. -type ApplicationGatewayWafDynamicManifestResult struct { - autorest.Response `json:"-"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ApplicationGatewayWafDynamicManifestPropertiesResult - Properties of the ApplicationGatewayWafDynamicManifest . - *ApplicationGatewayWafDynamicManifestPropertiesResult `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayWafDynamicManifestResult. -func (agwdmr ApplicationGatewayWafDynamicManifestResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agwdmr.ID != nil { - objectMap["id"] = agwdmr.ID - } - if agwdmr.ApplicationGatewayWafDynamicManifestPropertiesResult != nil { - objectMap["properties"] = agwdmr.ApplicationGatewayWafDynamicManifestPropertiesResult - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayWafDynamicManifestResult struct. -func (agwdmr *ApplicationGatewayWafDynamicManifestResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - agwdmr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - agwdmr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - agwdmr.Type = &typeVar - } - case "properties": - if v != nil { - var applicationGatewayWafDynamicManifestPropertiesResult ApplicationGatewayWafDynamicManifestPropertiesResult - err = json.Unmarshal(*v, &applicationGatewayWafDynamicManifestPropertiesResult) - if err != nil { - return err - } - agwdmr.ApplicationGatewayWafDynamicManifestPropertiesResult = &applicationGatewayWafDynamicManifestPropertiesResult - } - } - } - - return nil -} - -// ApplicationGatewayWafDynamicManifestResultList response for ApplicationGatewayWafDynamicManifests API -// service call. -type ApplicationGatewayWafDynamicManifestResultList struct { - autorest.Response `json:"-"` - // Value - The list of application gateway waf manifest. - Value *[]ApplicationGatewayWafDynamicManifestResult `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ApplicationGatewayWafDynamicManifestResultListIterator provides access to a complete listing of -// ApplicationGatewayWafDynamicManifestResult values. -type ApplicationGatewayWafDynamicManifestResultListIterator struct { - i int - page ApplicationGatewayWafDynamicManifestResultListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayWafDynamicManifestResultListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestResultListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayWafDynamicManifestResultListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayWafDynamicManifestResultListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationGatewayWafDynamicManifestResultListIterator) Response() ApplicationGatewayWafDynamicManifestResultList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayWafDynamicManifestResultListIterator) Value() ApplicationGatewayWafDynamicManifestResult { - if !iter.page.NotDone() { - return ApplicationGatewayWafDynamicManifestResult{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationGatewayWafDynamicManifestResultListIterator type. -func NewApplicationGatewayWafDynamicManifestResultListIterator(page ApplicationGatewayWafDynamicManifestResultListPage) ApplicationGatewayWafDynamicManifestResultListIterator { - return ApplicationGatewayWafDynamicManifestResultListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (agwdmrl ApplicationGatewayWafDynamicManifestResultList) IsEmpty() bool { - return agwdmrl.Value == nil || len(*agwdmrl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (agwdmrl ApplicationGatewayWafDynamicManifestResultList) hasNextLink() bool { - return agwdmrl.NextLink != nil && len(*agwdmrl.NextLink) != 0 -} - -// applicationGatewayWafDynamicManifestResultListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (agwdmrl ApplicationGatewayWafDynamicManifestResultList) applicationGatewayWafDynamicManifestResultListPreparer(ctx context.Context) (*http.Request, error) { - if !agwdmrl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(agwdmrl.NextLink))) -} - -// ApplicationGatewayWafDynamicManifestResultListPage contains a page of -// ApplicationGatewayWafDynamicManifestResult values. -type ApplicationGatewayWafDynamicManifestResultListPage struct { - fn func(context.Context, ApplicationGatewayWafDynamicManifestResultList) (ApplicationGatewayWafDynamicManifestResultList, error) - agwdmrl ApplicationGatewayWafDynamicManifestResultList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationGatewayWafDynamicManifestResultListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestResultListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.agwdmrl) - if err != nil { - return err - } - page.agwdmrl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayWafDynamicManifestResultListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayWafDynamicManifestResultListPage) NotDone() bool { - return !page.agwdmrl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationGatewayWafDynamicManifestResultListPage) Response() ApplicationGatewayWafDynamicManifestResultList { - return page.agwdmrl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayWafDynamicManifestResultListPage) Values() []ApplicationGatewayWafDynamicManifestResult { - if page.agwdmrl.IsEmpty() { - return nil - } - return *page.agwdmrl.Value -} - -// Creates a new instance of the ApplicationGatewayWafDynamicManifestResultListPage type. -func NewApplicationGatewayWafDynamicManifestResultListPage(cur ApplicationGatewayWafDynamicManifestResultList, getNextPage func(context.Context, ApplicationGatewayWafDynamicManifestResultList) (ApplicationGatewayWafDynamicManifestResultList, error)) ApplicationGatewayWafDynamicManifestResultListPage { - return ApplicationGatewayWafDynamicManifestResultListPage{ - fn: getNextPage, - agwdmrl: cur, - } -} - -// ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall -// configuration. -type ApplicationGatewayWebApplicationFirewallConfiguration struct { - // Enabled - Whether the web application firewall is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - // FirewallMode - Web application firewall mode. Possible values include: 'Detection', 'Prevention' - FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` - // RuleSetType - The type of the web application firewall rule set. Possible values are: 'OWASP'. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - The version of the rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // DisabledRuleGroups - The disabled rule groups. - DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` - // RequestBodyCheck - Whether allow WAF to check request Body. - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - // MaxRequestBodySize - Maximum request body size for WAF. - MaxRequestBodySize *int32 `json:"maxRequestBodySize,omitempty"` - // MaxRequestBodySizeInKb - Maximum request body size in Kb for WAF. - MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"` - // FileUploadLimitInMb - Maximum file upload size in Mb for WAF. - FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"` - // Exclusions - The exclusion list. - Exclusions *[]ApplicationGatewayFirewallExclusion `json:"exclusions,omitempty"` -} - -// ApplicationRule rule of type application. -type ApplicationRule struct { - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses or Service Tags. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // Protocols - Array of Application Protocols. - Protocols *[]FirewallPolicyRuleApplicationProtocol `json:"protocols,omitempty"` - // TargetFqdns - List of FQDNs for this rule. - TargetFqdns *[]string `json:"targetFqdns,omitempty"` - // TargetUrls - List of Urls for this rule condition. - TargetUrls *[]string `json:"targetUrls,omitempty"` - // FqdnTags - List of FQDN Tags for this rule. - FqdnTags *[]string `json:"fqdnTags,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // TerminateTLS - Terminate TLS connections for this rule. - TerminateTLS *bool `json:"terminateTLS,omitempty"` - // WebCategories - List of destination azure web categories. - WebCategories *[]string `json:"webCategories,omitempty"` - // Name - Name of the rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' - RuleType RuleType `json:"ruleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationRule. -func (ar ApplicationRule) MarshalJSON() ([]byte, error) { - ar.RuleType = RuleTypeApplicationRule - objectMap := make(map[string]interface{}) - if ar.SourceAddresses != nil { - objectMap["sourceAddresses"] = ar.SourceAddresses - } - if ar.DestinationAddresses != nil { - objectMap["destinationAddresses"] = ar.DestinationAddresses - } - if ar.Protocols != nil { - objectMap["protocols"] = ar.Protocols - } - if ar.TargetFqdns != nil { - objectMap["targetFqdns"] = ar.TargetFqdns - } - if ar.TargetUrls != nil { - objectMap["targetUrls"] = ar.TargetUrls - } - if ar.FqdnTags != nil { - objectMap["fqdnTags"] = ar.FqdnTags - } - if ar.SourceIPGroups != nil { - objectMap["sourceIpGroups"] = ar.SourceIPGroups - } - if ar.TerminateTLS != nil { - objectMap["terminateTLS"] = ar.TerminateTLS - } - if ar.WebCategories != nil { - objectMap["webCategories"] = ar.WebCategories - } - if ar.Name != nil { - objectMap["name"] = ar.Name - } - if ar.Description != nil { - objectMap["description"] = ar.Description - } - if ar.RuleType != "" { - objectMap["ruleType"] = ar.RuleType - } - return json.Marshal(objectMap) -} - -// AsApplicationRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsApplicationRule() (*ApplicationRule, bool) { - return &ar, true -} - -// AsNatRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsNatRule() (*NatRule, bool) { - return nil, false -} - -// AsRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsRule() (*Rule, bool) { - return nil, false -} - -// AsFirewallPolicyRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRule is the BasicFirewallPolicyRule implementation for ApplicationRule. -func (ar ApplicationRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { - return &ar, true -} - -// ApplicationSecurityGroup an application security group in a resource group. -type ApplicationSecurityGroup struct { - autorest.Response `json:"-"` - // ApplicationSecurityGroupPropertiesFormat - Properties of the application security group. - *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ApplicationSecurityGroup. -func (asg ApplicationSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asg.ApplicationSecurityGroupPropertiesFormat != nil { - objectMap["properties"] = asg.ApplicationSecurityGroupPropertiesFormat - } - if asg.ID != nil { - objectMap["id"] = asg.ID - } - if asg.Location != nil { - objectMap["location"] = asg.Location - } - if asg.Tags != nil { - objectMap["tags"] = asg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ApplicationSecurityGroup struct. -func (asg *ApplicationSecurityGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var applicationSecurityGroupPropertiesFormat ApplicationSecurityGroupPropertiesFormat - err = json.Unmarshal(*v, &applicationSecurityGroupPropertiesFormat) - if err != nil { - return err - } - asg.ApplicationSecurityGroupPropertiesFormat = &applicationSecurityGroupPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - asg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - asg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - asg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - asg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - asg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - asg.Tags = tags - } - } - } - - return nil -} - -// ApplicationSecurityGroupListResult a list of application security groups. -type ApplicationSecurityGroupListResult struct { - autorest.Response `json:"-"` - // Value - A list of application security groups. - Value *[]ApplicationSecurityGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationSecurityGroupListResult. -func (asglr ApplicationSecurityGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asglr.Value != nil { - objectMap["value"] = asglr.Value - } - return json.Marshal(objectMap) -} - -// ApplicationSecurityGroupListResultIterator provides access to a complete listing of -// ApplicationSecurityGroup values. -type ApplicationSecurityGroupListResultIterator struct { - i int - page ApplicationSecurityGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ApplicationSecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ApplicationSecurityGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationSecurityGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ApplicationSecurityGroupListResultIterator) Response() ApplicationSecurityGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ApplicationSecurityGroupListResultIterator) Value() ApplicationSecurityGroup { - if !iter.page.NotDone() { - return ApplicationSecurityGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ApplicationSecurityGroupListResultIterator type. -func NewApplicationSecurityGroupListResultIterator(page ApplicationSecurityGroupListResultPage) ApplicationSecurityGroupListResultIterator { - return ApplicationSecurityGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (asglr ApplicationSecurityGroupListResult) IsEmpty() bool { - return asglr.Value == nil || len(*asglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (asglr ApplicationSecurityGroupListResult) hasNextLink() bool { - return asglr.NextLink != nil && len(*asglr.NextLink) != 0 -} - -// applicationSecurityGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (asglr ApplicationSecurityGroupListResult) applicationSecurityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !asglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(asglr.NextLink))) -} - -// ApplicationSecurityGroupListResultPage contains a page of ApplicationSecurityGroup values. -type ApplicationSecurityGroupListResultPage struct { - fn func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error) - asglr ApplicationSecurityGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ApplicationSecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.asglr) - if err != nil { - return err - } - page.asglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ApplicationSecurityGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationSecurityGroupListResultPage) NotDone() bool { - return !page.asglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ApplicationSecurityGroupListResultPage) Response() ApplicationSecurityGroupListResult { - return page.asglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationSecurityGroupListResultPage) Values() []ApplicationSecurityGroup { - if page.asglr.IsEmpty() { - return nil - } - return *page.asglr.Value -} - -// Creates a new instance of the ApplicationSecurityGroupListResultPage type. -func NewApplicationSecurityGroupListResultPage(cur ApplicationSecurityGroupListResult, getNextPage func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error)) ApplicationSecurityGroupListResultPage { - return ApplicationSecurityGroupListResultPage{ - fn: getNextPage, - asglr: cur, - } -} - -// ApplicationSecurityGroupPropertiesFormat application security group properties. -type ApplicationSecurityGroupPropertiesFormat struct { - // ResourceGUID - READ-ONLY; The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application security group resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationSecurityGroupPropertiesFormat. -func (asgpf ApplicationSecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ApplicationSecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ApplicationSecurityGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationSecurityGroupsClient) (ApplicationSecurityGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationSecurityGroupsCreateOrUpdateFuture.Result. -func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - asg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if asg.Response.Response, err = future.GetResult(sender); err == nil && asg.Response.Response.StatusCode != http.StatusNoContent { - asg, err = client.CreateOrUpdateResponder(asg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", asg.Response.Response, "Failure responding to request") - } - } - return -} - -// ApplicationSecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ApplicationSecurityGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ApplicationSecurityGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ApplicationSecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ApplicationSecurityGroupsDeleteFuture.Result. -func (future *ApplicationSecurityGroupsDeleteFuture) result(client ApplicationSecurityGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations -// that belongs to an ExpressRouteCircuit. -type AuthorizationListResult struct { - autorest.Response `json:"-"` - // Value - The authorizations in an ExpressRoute Circuit. - Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AuthorizationListResultIterator provides access to a complete listing of -// ExpressRouteCircuitAuthorization values. -type AuthorizationListResultIterator struct { - i int - page AuthorizationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AuthorizationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AuthorizationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AuthorizationListResultIterator) Response() AuthorizationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AuthorizationListResultIterator) Value() ExpressRouteCircuitAuthorization { - if !iter.page.NotDone() { - return ExpressRouteCircuitAuthorization{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AuthorizationListResultIterator type. -func NewAuthorizationListResultIterator(page AuthorizationListResultPage) AuthorizationListResultIterator { - return AuthorizationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (alr AuthorizationListResult) IsEmpty() bool { - return alr.Value == nil || len(*alr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (alr AuthorizationListResult) hasNextLink() bool { - return alr.NextLink != nil && len(*alr.NextLink) != 0 -} - -// authorizationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !alr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(alr.NextLink))) -} - -// AuthorizationListResultPage contains a page of ExpressRouteCircuitAuthorization values. -type AuthorizationListResultPage struct { - fn func(context.Context, AuthorizationListResult) (AuthorizationListResult, error) - alr AuthorizationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.alr) - if err != nil { - return err - } - page.alr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AuthorizationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AuthorizationListResultPage) NotDone() bool { - return !page.alr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AuthorizationListResultPage) Response() AuthorizationListResult { - return page.alr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorization { - if page.alr.IsEmpty() { - return nil - } - return *page.alr.Value -} - -// Creates a new instance of the AuthorizationListResultPage type. -func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage { - return AuthorizationListResultPage{ - fn: getNextPage, - alr: cur, - } -} - -// AuthorizationPropertiesFormat properties of ExpressRouteCircuitAuthorization. -type AuthorizationPropertiesFormat struct { - // AuthorizationKey - The authorization key. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // AuthorizationUseStatus - The authorization use status. Possible values include: 'Available', 'InUse' - AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the authorization resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AuthorizationPropertiesFormat. -func (apf AuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if apf.AuthorizationKey != nil { - objectMap["authorizationKey"] = apf.AuthorizationKey - } - if apf.AuthorizationUseStatus != "" { - objectMap["authorizationUseStatus"] = apf.AuthorizationUseStatus - } - return json.Marshal(objectMap) -} - -// AutoApprovedPrivateLinkService the information of an AutoApprovedPrivateLinkService. -type AutoApprovedPrivateLinkService struct { - // PrivateLinkService - The id of the private link service resource. - PrivateLinkService *string `json:"privateLinkService,omitempty"` -} - -// AutoApprovedPrivateLinkServicesResult an array of private link service id that can be linked to a -// private end point with auto approved. -type AutoApprovedPrivateLinkServicesResult struct { - autorest.Response `json:"-"` - // Value - An array of auto approved private link service. - Value *[]AutoApprovedPrivateLinkService `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AutoApprovedPrivateLinkServicesResult. -func (aaplsr AutoApprovedPrivateLinkServicesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aaplsr.Value != nil { - objectMap["value"] = aaplsr.Value - } - return json.Marshal(objectMap) -} - -// AutoApprovedPrivateLinkServicesResultIterator provides access to a complete listing of -// AutoApprovedPrivateLinkService values. -type AutoApprovedPrivateLinkServicesResultIterator struct { - i int - page AutoApprovedPrivateLinkServicesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AutoApprovedPrivateLinkServicesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutoApprovedPrivateLinkServicesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AutoApprovedPrivateLinkServicesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AutoApprovedPrivateLinkServicesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AutoApprovedPrivateLinkServicesResultIterator) Response() AutoApprovedPrivateLinkServicesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AutoApprovedPrivateLinkServicesResultIterator) Value() AutoApprovedPrivateLinkService { - if !iter.page.NotDone() { - return AutoApprovedPrivateLinkService{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AutoApprovedPrivateLinkServicesResultIterator type. -func NewAutoApprovedPrivateLinkServicesResultIterator(page AutoApprovedPrivateLinkServicesResultPage) AutoApprovedPrivateLinkServicesResultIterator { - return AutoApprovedPrivateLinkServicesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aaplsr AutoApprovedPrivateLinkServicesResult) IsEmpty() bool { - return aaplsr.Value == nil || len(*aaplsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aaplsr AutoApprovedPrivateLinkServicesResult) hasNextLink() bool { - return aaplsr.NextLink != nil && len(*aaplsr.NextLink) != 0 -} - -// autoApprovedPrivateLinkServicesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aaplsr AutoApprovedPrivateLinkServicesResult) autoApprovedPrivateLinkServicesResultPreparer(ctx context.Context) (*http.Request, error) { - if !aaplsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aaplsr.NextLink))) -} - -// AutoApprovedPrivateLinkServicesResultPage contains a page of AutoApprovedPrivateLinkService values. -type AutoApprovedPrivateLinkServicesResultPage struct { - fn func(context.Context, AutoApprovedPrivateLinkServicesResult) (AutoApprovedPrivateLinkServicesResult, error) - aaplsr AutoApprovedPrivateLinkServicesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AutoApprovedPrivateLinkServicesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutoApprovedPrivateLinkServicesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aaplsr) - if err != nil { - return err - } - page.aaplsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AutoApprovedPrivateLinkServicesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AutoApprovedPrivateLinkServicesResultPage) NotDone() bool { - return !page.aaplsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AutoApprovedPrivateLinkServicesResultPage) Response() AutoApprovedPrivateLinkServicesResult { - return page.aaplsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AutoApprovedPrivateLinkServicesResultPage) Values() []AutoApprovedPrivateLinkService { - if page.aaplsr.IsEmpty() { - return nil - } - return *page.aaplsr.Value -} - -// Creates a new instance of the AutoApprovedPrivateLinkServicesResultPage type. -func NewAutoApprovedPrivateLinkServicesResultPage(cur AutoApprovedPrivateLinkServicesResult, getNextPage func(context.Context, AutoApprovedPrivateLinkServicesResult) (AutoApprovedPrivateLinkServicesResult, error)) AutoApprovedPrivateLinkServicesResultPage { - return AutoApprovedPrivateLinkServicesResultPage{ - fn: getNextPage, - aaplsr: cur, - } -} - -// Availability availability of the metric. -type Availability struct { - // TimeGrain - The time grain of the availability. - TimeGrain *string `json:"timeGrain,omitempty"` - // Retention - The retention of the availability. - Retention *string `json:"retention,omitempty"` - // BlobDuration - Duration of the availability blob. - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// AvailableDelegation the serviceName of an AvailableDelegation indicates a possible delegation for a -// subnet. -type AvailableDelegation struct { - // Name - The name of the AvailableDelegation resource. - Name *string `json:"name,omitempty"` - // ID - A unique identifier of the AvailableDelegation resource. - ID *string `json:"id,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // ServiceName - The name of the service and resource. - ServiceName *string `json:"serviceName,omitempty"` - // Actions - The actions permitted to the service upon delegation. - Actions *[]string `json:"actions,omitempty"` -} - -// AvailableDelegationsResult an array of available delegations. -type AvailableDelegationsResult struct { - autorest.Response `json:"-"` - // Value - An array of available delegations. - Value *[]AvailableDelegation `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailableDelegationsResult. -func (adr AvailableDelegationsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if adr.Value != nil { - objectMap["value"] = adr.Value - } - return json.Marshal(objectMap) -} - -// AvailableDelegationsResultIterator provides access to a complete listing of AvailableDelegation values. -type AvailableDelegationsResultIterator struct { - i int - page AvailableDelegationsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailableDelegationsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailableDelegationsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailableDelegationsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AvailableDelegationsResultIterator) Response() AvailableDelegationsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AvailableDelegationsResultIterator) Value() AvailableDelegation { - if !iter.page.NotDone() { - return AvailableDelegation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailableDelegationsResultIterator type. -func NewAvailableDelegationsResultIterator(page AvailableDelegationsResultPage) AvailableDelegationsResultIterator { - return AvailableDelegationsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (adr AvailableDelegationsResult) IsEmpty() bool { - return adr.Value == nil || len(*adr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (adr AvailableDelegationsResult) hasNextLink() bool { - return adr.NextLink != nil && len(*adr.NextLink) != 0 -} - -// availableDelegationsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (adr AvailableDelegationsResult) availableDelegationsResultPreparer(ctx context.Context) (*http.Request, error) { - if !adr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(adr.NextLink))) -} - -// AvailableDelegationsResultPage contains a page of AvailableDelegation values. -type AvailableDelegationsResultPage struct { - fn func(context.Context, AvailableDelegationsResult) (AvailableDelegationsResult, error) - adr AvailableDelegationsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailableDelegationsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.adr) - if err != nil { - return err - } - page.adr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailableDelegationsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailableDelegationsResultPage) NotDone() bool { - return !page.adr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailableDelegationsResultPage) Response() AvailableDelegationsResult { - return page.adr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailableDelegationsResultPage) Values() []AvailableDelegation { - if page.adr.IsEmpty() { - return nil - } - return *page.adr.Value -} - -// Creates a new instance of the AvailableDelegationsResultPage type. -func NewAvailableDelegationsResultPage(cur AvailableDelegationsResult, getNextPage func(context.Context, AvailableDelegationsResult) (AvailableDelegationsResult, error)) AvailableDelegationsResultPage { - return AvailableDelegationsResultPage{ - fn: getNextPage, - adr: cur, - } -} - -// AvailablePrivateEndpointType the information of an AvailablePrivateEndpointType. -type AvailablePrivateEndpointType struct { - // Name - The name of the service and resource. - Name *string `json:"name,omitempty"` - // ID - A unique identifier of the AvailablePrivateEndpoint Type resource. - ID *string `json:"id,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // ResourceName - The name of the service and resource. - ResourceName *string `json:"resourceName,omitempty"` - // DisplayName - Display name of the resource. - DisplayName *string `json:"displayName,omitempty"` -} - -// AvailablePrivateEndpointTypesResult an array of available PrivateEndpoint types. -type AvailablePrivateEndpointTypesResult struct { - autorest.Response `json:"-"` - // Value - An array of available privateEndpoint type. - Value *[]AvailablePrivateEndpointType `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailablePrivateEndpointTypesResult. -func (apetr AvailablePrivateEndpointTypesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if apetr.Value != nil { - objectMap["value"] = apetr.Value - } - return json.Marshal(objectMap) -} - -// AvailablePrivateEndpointTypesResultIterator provides access to a complete listing of -// AvailablePrivateEndpointType values. -type AvailablePrivateEndpointTypesResultIterator struct { - i int - page AvailablePrivateEndpointTypesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailablePrivateEndpointTypesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailablePrivateEndpointTypesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailablePrivateEndpointTypesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AvailablePrivateEndpointTypesResultIterator) Response() AvailablePrivateEndpointTypesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AvailablePrivateEndpointTypesResultIterator) Value() AvailablePrivateEndpointType { - if !iter.page.NotDone() { - return AvailablePrivateEndpointType{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailablePrivateEndpointTypesResultIterator type. -func NewAvailablePrivateEndpointTypesResultIterator(page AvailablePrivateEndpointTypesResultPage) AvailablePrivateEndpointTypesResultIterator { - return AvailablePrivateEndpointTypesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (apetr AvailablePrivateEndpointTypesResult) IsEmpty() bool { - return apetr.Value == nil || len(*apetr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (apetr AvailablePrivateEndpointTypesResult) hasNextLink() bool { - return apetr.NextLink != nil && len(*apetr.NextLink) != 0 -} - -// availablePrivateEndpointTypesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (apetr AvailablePrivateEndpointTypesResult) availablePrivateEndpointTypesResultPreparer(ctx context.Context) (*http.Request, error) { - if !apetr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(apetr.NextLink))) -} - -// AvailablePrivateEndpointTypesResultPage contains a page of AvailablePrivateEndpointType values. -type AvailablePrivateEndpointTypesResultPage struct { - fn func(context.Context, AvailablePrivateEndpointTypesResult) (AvailablePrivateEndpointTypesResult, error) - apetr AvailablePrivateEndpointTypesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailablePrivateEndpointTypesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.apetr) - if err != nil { - return err - } - page.apetr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailablePrivateEndpointTypesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailablePrivateEndpointTypesResultPage) NotDone() bool { - return !page.apetr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailablePrivateEndpointTypesResultPage) Response() AvailablePrivateEndpointTypesResult { - return page.apetr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailablePrivateEndpointTypesResultPage) Values() []AvailablePrivateEndpointType { - if page.apetr.IsEmpty() { - return nil - } - return *page.apetr.Value -} - -// Creates a new instance of the AvailablePrivateEndpointTypesResultPage type. -func NewAvailablePrivateEndpointTypesResultPage(cur AvailablePrivateEndpointTypesResult, getNextPage func(context.Context, AvailablePrivateEndpointTypesResult) (AvailablePrivateEndpointTypesResult, error)) AvailablePrivateEndpointTypesResultPage { - return AvailablePrivateEndpointTypesResultPage{ - fn: getNextPage, - apetr: cur, - } -} - -// AvailableProvidersList list of available countries with details. -type AvailableProvidersList struct { - autorest.Response `json:"-"` - // Countries - List of available countries. - Countries *[]AvailableProvidersListCountry `json:"countries,omitempty"` -} - -// AvailableProvidersListCity city or town details. -type AvailableProvidersListCity struct { - // CityName - The city or town name. - CityName *string `json:"cityName,omitempty"` - // Providers - A list of Internet service providers. - Providers *[]string `json:"providers,omitempty"` -} - -// AvailableProvidersListCountry country details. -type AvailableProvidersListCountry struct { - // CountryName - The country name. - CountryName *string `json:"countryName,omitempty"` - // Providers - A list of Internet service providers. - Providers *[]string `json:"providers,omitempty"` - // States - List of available states in the country. - States *[]AvailableProvidersListState `json:"states,omitempty"` -} - -// AvailableProvidersListParameters constraints that determine the list of available Internet service -// providers. -type AvailableProvidersListParameters struct { - // AzureLocations - A list of Azure regions. - AzureLocations *[]string `json:"azureLocations,omitempty"` - // Country - The country for available providers list. - Country *string `json:"country,omitempty"` - // State - The state for available providers list. - State *string `json:"state,omitempty"` - // City - The city or town for available providers list. - City *string `json:"city,omitempty"` -} - -// AvailableProvidersListState state details. -type AvailableProvidersListState struct { - // StateName - The state name. - StateName *string `json:"stateName,omitempty"` - // Providers - A list of Internet service providers. - Providers *[]string `json:"providers,omitempty"` - // Cities - List of available cities or towns in the state. - Cities *[]AvailableProvidersListCity `json:"cities,omitempty"` -} - -// AvailableServiceAlias the available service alias. -type AvailableServiceAlias struct { - // Name - The name of the service alias. - Name *string `json:"name,omitempty"` - // ID - The ID of the service alias. - ID *string `json:"id,omitempty"` - // Type - The type of the resource. - Type *string `json:"type,omitempty"` - // ResourceName - The resource name of the service alias. - ResourceName *string `json:"resourceName,omitempty"` -} - -// AvailableServiceAliasesResult an array of available service aliases. -type AvailableServiceAliasesResult struct { - autorest.Response `json:"-"` - // Value - An array of available service aliases. - Value *[]AvailableServiceAlias `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailableServiceAliasesResult. -func (asar AvailableServiceAliasesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asar.Value != nil { - objectMap["value"] = asar.Value - } - return json.Marshal(objectMap) -} - -// AvailableServiceAliasesResultIterator provides access to a complete listing of AvailableServiceAlias -// values. -type AvailableServiceAliasesResultIterator struct { - i int - page AvailableServiceAliasesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailableServiceAliasesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailableServiceAliasesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailableServiceAliasesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AvailableServiceAliasesResultIterator) Response() AvailableServiceAliasesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AvailableServiceAliasesResultIterator) Value() AvailableServiceAlias { - if !iter.page.NotDone() { - return AvailableServiceAlias{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailableServiceAliasesResultIterator type. -func NewAvailableServiceAliasesResultIterator(page AvailableServiceAliasesResultPage) AvailableServiceAliasesResultIterator { - return AvailableServiceAliasesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (asar AvailableServiceAliasesResult) IsEmpty() bool { - return asar.Value == nil || len(*asar.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (asar AvailableServiceAliasesResult) hasNextLink() bool { - return asar.NextLink != nil && len(*asar.NextLink) != 0 -} - -// availableServiceAliasesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (asar AvailableServiceAliasesResult) availableServiceAliasesResultPreparer(ctx context.Context) (*http.Request, error) { - if !asar.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(asar.NextLink))) -} - -// AvailableServiceAliasesResultPage contains a page of AvailableServiceAlias values. -type AvailableServiceAliasesResultPage struct { - fn func(context.Context, AvailableServiceAliasesResult) (AvailableServiceAliasesResult, error) - asar AvailableServiceAliasesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailableServiceAliasesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.asar) - if err != nil { - return err - } - page.asar = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailableServiceAliasesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailableServiceAliasesResultPage) NotDone() bool { - return !page.asar.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailableServiceAliasesResultPage) Response() AvailableServiceAliasesResult { - return page.asar -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailableServiceAliasesResultPage) Values() []AvailableServiceAlias { - if page.asar.IsEmpty() { - return nil - } - return *page.asar.Value -} - -// Creates a new instance of the AvailableServiceAliasesResultPage type. -func NewAvailableServiceAliasesResultPage(cur AvailableServiceAliasesResult, getNextPage func(context.Context, AvailableServiceAliasesResult) (AvailableServiceAliasesResult, error)) AvailableServiceAliasesResultPage { - return AvailableServiceAliasesResultPage{ - fn: getNextPage, - asar: cur, - } -} - -// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, -// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct -// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous -// operation succeeded, the response body includes the HTTP status code for the successful request. If the -// asynchronous operation failed, the response body includes the HTTP status code for the failed request -// and error information regarding the failure. -type AzureAsyncOperationResult struct { - // Status - Status of the Azure async operation. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed' - Status OperationStatus `json:"status,omitempty"` - // Error - Details of the error occurred during specified asynchronous operation. - Error *Error `json:"error,omitempty"` -} - -// AzureFirewall azure Firewall resource. -type AzureFirewall struct { - autorest.Response `json:"-"` - // AzureFirewallPropertiesFormat - Properties of the azure firewall. - *AzureFirewallPropertiesFormat `json:"properties,omitempty"` - // Zones - A list of availability zones denoting where the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AzureFirewall. -func (af AzureFirewall) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if af.AzureFirewallPropertiesFormat != nil { - objectMap["properties"] = af.AzureFirewallPropertiesFormat - } - if af.Zones != nil { - objectMap["zones"] = af.Zones - } - if af.ID != nil { - objectMap["id"] = af.ID - } - if af.Location != nil { - objectMap["location"] = af.Location - } - if af.Tags != nil { - objectMap["tags"] = af.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewall struct. -func (af *AzureFirewall) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallPropertiesFormat AzureFirewallPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallPropertiesFormat) - if err != nil { - return err - } - af.AzureFirewallPropertiesFormat = &azureFirewallPropertiesFormat - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - af.Zones = &zones - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - af.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - af.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - af.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - af.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - af.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - af.Tags = tags - } - } - } - - return nil -} - -// AzureFirewallApplicationRule properties of an application rule. -type AzureFirewallApplicationRule struct { - // Name - Name of the application rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // Protocols - Array of ApplicationRuleProtocols. - Protocols *[]AzureFirewallApplicationRuleProtocol `json:"protocols,omitempty"` - // TargetFqdns - List of FQDNs for this rule. - TargetFqdns *[]string `json:"targetFqdns,omitempty"` - // FqdnTags - List of FQDN Tags for this rule. - FqdnTags *[]string `json:"fqdnTags,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` -} - -// AzureFirewallApplicationRuleCollection application rule collection resource. -type AzureFirewallApplicationRuleCollection struct { - // AzureFirewallApplicationRuleCollectionPropertiesFormat - Properties of the azure firewall application rule collection. - *AzureFirewallApplicationRuleCollectionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallApplicationRuleCollection. -func (afarc AzureFirewallApplicationRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat != nil { - objectMap["properties"] = afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat - } - if afarc.Name != nil { - objectMap["name"] = afarc.Name - } - if afarc.ID != nil { - objectMap["id"] = afarc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallApplicationRuleCollection struct. -func (afarc *AzureFirewallApplicationRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallApplicationRuleCollectionPropertiesFormat AzureFirewallApplicationRuleCollectionPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallApplicationRuleCollectionPropertiesFormat) - if err != nil { - return err - } - afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat = &azureFirewallApplicationRuleCollectionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afarc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afarc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afarc.ID = &ID - } - } - } - - return nil -} - -// AzureFirewallApplicationRuleCollectionPropertiesFormat properties of the application rule collection. -type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { - // Priority - Priority of the application rule collection resource. - Priority *int32 `json:"priority,omitempty"` - // Action - The action type of a rule collection. - Action *AzureFirewallRCAction `json:"action,omitempty"` - // Rules - Collection of rules used by a application rule collection. - Rules *[]AzureFirewallApplicationRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the application rule collection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallApplicationRuleCollectionPropertiesFormat. -func (afarcpf AzureFirewallApplicationRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afarcpf.Priority != nil { - objectMap["priority"] = afarcpf.Priority - } - if afarcpf.Action != nil { - objectMap["action"] = afarcpf.Action - } - if afarcpf.Rules != nil { - objectMap["rules"] = afarcpf.Rules - } - return json.Marshal(objectMap) -} - -// AzureFirewallApplicationRuleProtocol properties of the application rule protocol. -type AzureFirewallApplicationRuleProtocol struct { - // ProtocolType - Protocol type. Possible values include: 'AzureFirewallApplicationRuleProtocolTypeHTTP', 'AzureFirewallApplicationRuleProtocolTypeHTTPS', 'AzureFirewallApplicationRuleProtocolTypeMssql' - ProtocolType AzureFirewallApplicationRuleProtocolType `json:"protocolType,omitempty"` - // Port - Port number for the protocol, cannot be greater than 64000. This field is optional. - Port *int32 `json:"port,omitempty"` -} - -// AzureFirewallFqdnTag azure Firewall FQDN Tag Resource. -type AzureFirewallFqdnTag struct { - // AzureFirewallFqdnTagPropertiesFormat - Properties of the azure firewall FQDN tag. - *AzureFirewallFqdnTagPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallFqdnTag. -func (afft AzureFirewallFqdnTag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afft.AzureFirewallFqdnTagPropertiesFormat != nil { - objectMap["properties"] = afft.AzureFirewallFqdnTagPropertiesFormat - } - if afft.ID != nil { - objectMap["id"] = afft.ID - } - if afft.Location != nil { - objectMap["location"] = afft.Location - } - if afft.Tags != nil { - objectMap["tags"] = afft.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallFqdnTag struct. -func (afft *AzureFirewallFqdnTag) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallFqdnTagPropertiesFormat AzureFirewallFqdnTagPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallFqdnTagPropertiesFormat) - if err != nil { - return err - } - afft.AzureFirewallFqdnTagPropertiesFormat = &azureFirewallFqdnTagPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afft.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afft.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afft.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - afft.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - afft.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - afft.Tags = tags - } - } - } - - return nil -} - -// AzureFirewallFqdnTagListResult response for ListAzureFirewallFqdnTags API service call. -type AzureFirewallFqdnTagListResult struct { - autorest.Response `json:"-"` - // Value - List of Azure Firewall FQDN Tags in a resource group. - Value *[]AzureFirewallFqdnTag `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AzureFirewallFqdnTagListResultIterator provides access to a complete listing of AzureFirewallFqdnTag -// values. -type AzureFirewallFqdnTagListResultIterator struct { - i int - page AzureFirewallFqdnTagListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AzureFirewallFqdnTagListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AzureFirewallFqdnTagListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AzureFirewallFqdnTagListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AzureFirewallFqdnTagListResultIterator) Response() AzureFirewallFqdnTagListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AzureFirewallFqdnTagListResultIterator) Value() AzureFirewallFqdnTag { - if !iter.page.NotDone() { - return AzureFirewallFqdnTag{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AzureFirewallFqdnTagListResultIterator type. -func NewAzureFirewallFqdnTagListResultIterator(page AzureFirewallFqdnTagListResultPage) AzureFirewallFqdnTagListResultIterator { - return AzureFirewallFqdnTagListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (afftlr AzureFirewallFqdnTagListResult) IsEmpty() bool { - return afftlr.Value == nil || len(*afftlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (afftlr AzureFirewallFqdnTagListResult) hasNextLink() bool { - return afftlr.NextLink != nil && len(*afftlr.NextLink) != 0 -} - -// azureFirewallFqdnTagListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (afftlr AzureFirewallFqdnTagListResult) azureFirewallFqdnTagListResultPreparer(ctx context.Context) (*http.Request, error) { - if !afftlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(afftlr.NextLink))) -} - -// AzureFirewallFqdnTagListResultPage contains a page of AzureFirewallFqdnTag values. -type AzureFirewallFqdnTagListResultPage struct { - fn func(context.Context, AzureFirewallFqdnTagListResult) (AzureFirewallFqdnTagListResult, error) - afftlr AzureFirewallFqdnTagListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AzureFirewallFqdnTagListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.afftlr) - if err != nil { - return err - } - page.afftlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AzureFirewallFqdnTagListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AzureFirewallFqdnTagListResultPage) NotDone() bool { - return !page.afftlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AzureFirewallFqdnTagListResultPage) Response() AzureFirewallFqdnTagListResult { - return page.afftlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AzureFirewallFqdnTagListResultPage) Values() []AzureFirewallFqdnTag { - if page.afftlr.IsEmpty() { - return nil - } - return *page.afftlr.Value -} - -// Creates a new instance of the AzureFirewallFqdnTagListResultPage type. -func NewAzureFirewallFqdnTagListResultPage(cur AzureFirewallFqdnTagListResult, getNextPage func(context.Context, AzureFirewallFqdnTagListResult) (AzureFirewallFqdnTagListResult, error)) AzureFirewallFqdnTagListResultPage { - return AzureFirewallFqdnTagListResultPage{ - fn: getNextPage, - afftlr: cur, - } -} - -// AzureFirewallFqdnTagPropertiesFormat azure Firewall FQDN Tag Properties. -type AzureFirewallFqdnTagPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall FQDN tag resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // FqdnTagName - READ-ONLY; The name of this FQDN Tag. - FqdnTagName *string `json:"fqdnTagName,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallFqdnTagPropertiesFormat. -func (afftpf AzureFirewallFqdnTagPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AzureFirewallIPConfiguration IP configuration of an Azure Firewall. -type AzureFirewallIPConfiguration struct { - // AzureFirewallIPConfigurationPropertiesFormat - Properties of the azure firewall IP configuration. - *AzureFirewallIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallIPConfiguration. -func (afic AzureFirewallIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afic.AzureFirewallIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = afic.AzureFirewallIPConfigurationPropertiesFormat - } - if afic.Name != nil { - objectMap["name"] = afic.Name - } - if afic.ID != nil { - objectMap["id"] = afic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallIPConfiguration struct. -func (afic *AzureFirewallIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallIPConfigurationPropertiesFormat AzureFirewallIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallIPConfigurationPropertiesFormat) - if err != nil { - return err - } - afic.AzureFirewallIPConfigurationPropertiesFormat = &azureFirewallIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - afic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afic.ID = &ID - } - } - } - - return nil -} - -// AzureFirewallIPConfigurationPropertiesFormat properties of IP configuration of an Azure Firewall. -type AzureFirewallIPConfigurationPropertiesFormat struct { - // PrivateIPAddress - READ-ONLY; The Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // Subnet - Reference to the subnet resource. This resource must be named 'AzureFirewallSubnet' or 'AzureFirewallManagementSubnet'. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - Reference to the PublicIP resource. This field is a mandatory input if subnet is not null. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallIPConfigurationPropertiesFormat. -func (aficpf AzureFirewallIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aficpf.Subnet != nil { - objectMap["subnet"] = aficpf.Subnet - } - if aficpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = aficpf.PublicIPAddress - } - return json.Marshal(objectMap) -} - -// AzureFirewallIPGroups ipGroups associated with azure firewall. -type AzureFirewallIPGroups struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // ChangeNumber - READ-ONLY; The iteration number. - ChangeNumber *string `json:"changeNumber,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallIPGroups. -func (afig AzureFirewallIPGroups) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AzureFirewallListResult response for ListAzureFirewalls API service call. -type AzureFirewallListResult struct { - autorest.Response `json:"-"` - // Value - List of Azure Firewalls in a resource group. - Value *[]AzureFirewall `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AzureFirewallListResultIterator provides access to a complete listing of AzureFirewall values. -type AzureFirewallListResultIterator struct { - i int - page AzureFirewallListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AzureFirewallListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AzureFirewallListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AzureFirewallListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AzureFirewallListResultIterator) Response() AzureFirewallListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AzureFirewallListResultIterator) Value() AzureFirewall { - if !iter.page.NotDone() { - return AzureFirewall{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AzureFirewallListResultIterator type. -func NewAzureFirewallListResultIterator(page AzureFirewallListResultPage) AzureFirewallListResultIterator { - return AzureFirewallListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aflr AzureFirewallListResult) IsEmpty() bool { - return aflr.Value == nil || len(*aflr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aflr AzureFirewallListResult) hasNextLink() bool { - return aflr.NextLink != nil && len(*aflr.NextLink) != 0 -} - -// azureFirewallListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aflr AzureFirewallListResult) azureFirewallListResultPreparer(ctx context.Context) (*http.Request, error) { - if !aflr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aflr.NextLink))) -} - -// AzureFirewallListResultPage contains a page of AzureFirewall values. -type AzureFirewallListResultPage struct { - fn func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error) - aflr AzureFirewallListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AzureFirewallListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aflr) - if err != nil { - return err - } - page.aflr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AzureFirewallListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AzureFirewallListResultPage) NotDone() bool { - return !page.aflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AzureFirewallListResultPage) Response() AzureFirewallListResult { - return page.aflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AzureFirewallListResultPage) Values() []AzureFirewall { - if page.aflr.IsEmpty() { - return nil - } - return *page.aflr.Value -} - -// Creates a new instance of the AzureFirewallListResultPage type. -func NewAzureFirewallListResultPage(cur AzureFirewallListResult, getNextPage func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error)) AzureFirewallListResultPage { - return AzureFirewallListResultPage{ - fn: getNextPage, - aflr: cur, - } -} - -// AzureFirewallNatRCAction azureFirewall NAT Rule Collection Action. -type AzureFirewallNatRCAction struct { - // Type - The type of action. Possible values include: 'Snat', 'Dnat' - Type AzureFirewallNatRCActionType `json:"type,omitempty"` -} - -// AzureFirewallNatRule properties of a NAT rule. -type AzureFirewallNatRule struct { - // Name - Name of the NAT rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses for this rule. Supports IP ranges, prefixes, and service tags. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // Protocols - Array of AzureFirewallNetworkRuleProtocols applicable to this NAT rule. - Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - // TranslatedAddress - The translated address for this NAT rule. - TranslatedAddress *string `json:"translatedAddress,omitempty"` - // TranslatedPort - The translated port for this NAT rule. - TranslatedPort *string `json:"translatedPort,omitempty"` - // TranslatedFqdn - The translated FQDN for this NAT rule. - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` -} - -// AzureFirewallNatRuleCollection NAT rule collection resource. -type AzureFirewallNatRuleCollection struct { - // AzureFirewallNatRuleCollectionProperties - Properties of the azure firewall NAT rule collection. - *AzureFirewallNatRuleCollectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallNatRuleCollection. -func (afnrc AzureFirewallNatRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afnrc.AzureFirewallNatRuleCollectionProperties != nil { - objectMap["properties"] = afnrc.AzureFirewallNatRuleCollectionProperties - } - if afnrc.Name != nil { - objectMap["name"] = afnrc.Name - } - if afnrc.ID != nil { - objectMap["id"] = afnrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallNatRuleCollection struct. -func (afnrc *AzureFirewallNatRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallNatRuleCollectionProperties AzureFirewallNatRuleCollectionProperties - err = json.Unmarshal(*v, &azureFirewallNatRuleCollectionProperties) - if err != nil { - return err - } - afnrc.AzureFirewallNatRuleCollectionProperties = &azureFirewallNatRuleCollectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afnrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afnrc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afnrc.ID = &ID - } - } - } - - return nil -} - -// AzureFirewallNatRuleCollectionProperties properties of the NAT rule collection. -type AzureFirewallNatRuleCollectionProperties struct { - // Priority - Priority of the NAT rule collection resource. - Priority *int32 `json:"priority,omitempty"` - // Action - The action type of a NAT rule collection. - Action *AzureFirewallNatRCAction `json:"action,omitempty"` - // Rules - Collection of rules used by a NAT rule collection. - Rules *[]AzureFirewallNatRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the NAT rule collection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallNatRuleCollectionProperties. -func (afnrcp AzureFirewallNatRuleCollectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afnrcp.Priority != nil { - objectMap["priority"] = afnrcp.Priority - } - if afnrcp.Action != nil { - objectMap["action"] = afnrcp.Action - } - if afnrcp.Rules != nil { - objectMap["rules"] = afnrcp.Rules - } - return json.Marshal(objectMap) -} - -// AzureFirewallNetworkRule properties of the network rule. -type AzureFirewallNetworkRule struct { - // Name - Name of the network rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // Protocols - Array of AzureFirewallNetworkRuleProtocols. - Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // DestinationFqdns - List of destination FQDNs. - DestinationFqdns *[]string `json:"destinationFqdns,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // DestinationIPGroups - List of destination IpGroups for this rule. - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` -} - -// AzureFirewallNetworkRuleCollection network rule collection resource. -type AzureFirewallNetworkRuleCollection struct { - // AzureFirewallNetworkRuleCollectionPropertiesFormat - Properties of the azure firewall network rule collection. - *AzureFirewallNetworkRuleCollectionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the Azure firewall. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallNetworkRuleCollection. -func (afnrc AzureFirewallNetworkRuleCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat != nil { - objectMap["properties"] = afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat - } - if afnrc.Name != nil { - objectMap["name"] = afnrc.Name - } - if afnrc.ID != nil { - objectMap["id"] = afnrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureFirewallNetworkRuleCollection struct. -func (afnrc *AzureFirewallNetworkRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureFirewallNetworkRuleCollectionPropertiesFormat AzureFirewallNetworkRuleCollectionPropertiesFormat - err = json.Unmarshal(*v, &azureFirewallNetworkRuleCollectionPropertiesFormat) - if err != nil { - return err - } - afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat = &azureFirewallNetworkRuleCollectionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - afnrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - afnrc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - afnrc.ID = &ID - } - } - } - - return nil -} - -// AzureFirewallNetworkRuleCollectionPropertiesFormat properties of the network rule collection. -type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { - // Priority - Priority of the network rule collection resource. - Priority *int32 `json:"priority,omitempty"` - // Action - The action type of a rule collection. - Action *AzureFirewallRCAction `json:"action,omitempty"` - // Rules - Collection of rules used by a network rule collection. - Rules *[]AzureFirewallNetworkRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network rule collection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallNetworkRuleCollectionPropertiesFormat. -func (afnrcpf AzureFirewallNetworkRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afnrcpf.Priority != nil { - objectMap["priority"] = afnrcpf.Priority - } - if afnrcpf.Action != nil { - objectMap["action"] = afnrcpf.Action - } - if afnrcpf.Rules != nil { - objectMap["rules"] = afnrcpf.Rules - } - return json.Marshal(objectMap) -} - -// AzureFirewallPropertiesFormat properties of the Azure Firewall. -type AzureFirewallPropertiesFormat struct { - // ApplicationRuleCollections - Collection of application rule collections used by Azure Firewall. - ApplicationRuleCollections *[]AzureFirewallApplicationRuleCollection `json:"applicationRuleCollections,omitempty"` - // NatRuleCollections - Collection of NAT rule collections used by Azure Firewall. - NatRuleCollections *[]AzureFirewallNatRuleCollection `json:"natRuleCollections,omitempty"` - // NetworkRuleCollections - Collection of network rule collections used by Azure Firewall. - NetworkRuleCollections *[]AzureFirewallNetworkRuleCollection `json:"networkRuleCollections,omitempty"` - // IPConfigurations - IP configuration of the Azure Firewall resource. - IPConfigurations *[]AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"` - // ManagementIPConfiguration - IP configuration of the Azure Firewall used for management traffic. - ManagementIPConfiguration *AzureFirewallIPConfiguration `json:"managementIpConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the Azure firewall resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ThreatIntelMode - The operation mode for Threat Intelligence. Possible values include: 'AzureFirewallThreatIntelModeAlert', 'AzureFirewallThreatIntelModeDeny', 'AzureFirewallThreatIntelModeOff' - ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - // VirtualHub - The virtualHub to which the firewall belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - // FirewallPolicy - The firewallPolicy associated with this azure firewall. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - // HubIPAddresses - IP addresses associated with AzureFirewall. - HubIPAddresses *HubIPAddresses `json:"hubIPAddresses,omitempty"` - // IPGroups - READ-ONLY; IpGroups associated with AzureFirewall. - IPGroups *[]AzureFirewallIPGroups `json:"ipGroups,omitempty"` - // Sku - The Azure Firewall Resource SKU. - Sku *AzureFirewallSku `json:"sku,omitempty"` - // AdditionalProperties - The additional properties used to further config this azure firewall. - AdditionalProperties map[string]*string `json:"additionalProperties"` -} - -// MarshalJSON is the custom marshaler for AzureFirewallPropertiesFormat. -func (afpf AzureFirewallPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if afpf.ApplicationRuleCollections != nil { - objectMap["applicationRuleCollections"] = afpf.ApplicationRuleCollections - } - if afpf.NatRuleCollections != nil { - objectMap["natRuleCollections"] = afpf.NatRuleCollections - } - if afpf.NetworkRuleCollections != nil { - objectMap["networkRuleCollections"] = afpf.NetworkRuleCollections - } - if afpf.IPConfigurations != nil { - objectMap["ipConfigurations"] = afpf.IPConfigurations - } - if afpf.ManagementIPConfiguration != nil { - objectMap["managementIpConfiguration"] = afpf.ManagementIPConfiguration - } - if afpf.ThreatIntelMode != "" { - objectMap["threatIntelMode"] = afpf.ThreatIntelMode - } - if afpf.VirtualHub != nil { - objectMap["virtualHub"] = afpf.VirtualHub - } - if afpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = afpf.FirewallPolicy - } - if afpf.HubIPAddresses != nil { - objectMap["hubIPAddresses"] = afpf.HubIPAddresses - } - if afpf.Sku != nil { - objectMap["sku"] = afpf.Sku - } - if afpf.AdditionalProperties != nil { - objectMap["additionalProperties"] = afpf.AdditionalProperties - } - return json.Marshal(objectMap) -} - -// AzureFirewallPublicIPAddress public IP Address associated with azure firewall. -type AzureFirewallPublicIPAddress struct { - // Address - Public IP Address value. - Address *string `json:"address,omitempty"` -} - -// AzureFirewallRCAction properties of the AzureFirewallRCAction. -type AzureFirewallRCAction struct { - // Type - The type of action. Possible values include: 'AzureFirewallRCActionTypeAllow', 'AzureFirewallRCActionTypeDeny' - Type AzureFirewallRCActionType `json:"type,omitempty"` -} - -// AzureFirewallsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type AzureFirewallsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AzureFirewallsClient) (AzureFirewall, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AzureFirewallsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AzureFirewallsCreateOrUpdateFuture.Result. -func (future *AzureFirewallsCreateOrUpdateFuture) result(client AzureFirewallsClient) (af AzureFirewall, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - af.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent { - af, err = client.CreateOrUpdateResponder(af.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", af.Response.Response, "Failure responding to request") - } - } - return -} - -// AzureFirewallsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type AzureFirewallsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AzureFirewallsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AzureFirewallsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AzureFirewallsDeleteFuture.Result. -func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// AzureFirewallSku SKU of an Azure Firewall. -type AzureFirewallSku struct { - // Name - Name of an Azure Firewall SKU. Possible values include: 'AZFWVNet', 'AZFWHub' - Name AzureFirewallSkuName `json:"name,omitempty"` - // Tier - Tier of an Azure Firewall. Possible values include: 'AzureFirewallSkuTierStandard', 'AzureFirewallSkuTierPremium', 'AzureFirewallSkuTierBasic' - Tier AzureFirewallSkuTier `json:"tier,omitempty"` -} - -// AzureFirewallsListLearnedPrefixesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type AzureFirewallsListLearnedPrefixesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AzureFirewallsClient) (IPPrefixesList, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AzureFirewallsListLearnedPrefixesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AzureFirewallsListLearnedPrefixesFuture.Result. -func (future *AzureFirewallsListLearnedPrefixesFuture) result(client AzureFirewallsClient) (ipl IPPrefixesList, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsListLearnedPrefixesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ipl.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsListLearnedPrefixesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ipl.Response.Response, err = future.GetResult(sender); err == nil && ipl.Response.Response.StatusCode != http.StatusNoContent { - ipl, err = client.ListLearnedPrefixesResponder(ipl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsListLearnedPrefixesFuture", "Result", ipl.Response.Response, "Failure responding to request") - } - } - return -} - -// AzureFirewallsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type AzureFirewallsUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(AzureFirewallsClient) (AzureFirewall, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *AzureFirewallsUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for AzureFirewallsUpdateTagsFuture.Result. -func (future *AzureFirewallsUpdateTagsFuture) result(client AzureFirewallsClient) (af AzureFirewall, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - af.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent { - af, err = client.UpdateTagsResponder(af.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.AzureFirewallsUpdateTagsFuture", "Result", af.Response.Response, "Failure responding to request") - } - } - return -} - -// AzureReachabilityReport azure reachability report details. -type AzureReachabilityReport struct { - autorest.Response `json:"-"` - // AggregationLevel - The aggregation level of Azure reachability report. Can be Country, State or City. - AggregationLevel *string `json:"aggregationLevel,omitempty"` - // ProviderLocation - Parameters that define a geographic location. - ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` - // ReachabilityReport - List of Azure reachability report items. - ReachabilityReport *[]AzureReachabilityReportItem `json:"reachabilityReport,omitempty"` -} - -// AzureReachabilityReportItem azure reachability report details for a given provider location. -type AzureReachabilityReportItem struct { - // Provider - The Internet service provider. - Provider *string `json:"provider,omitempty"` - // AzureLocation - The Azure region. - AzureLocation *string `json:"azureLocation,omitempty"` - // Latencies - List of latency details for each of the time series. - Latencies *[]AzureReachabilityReportLatencyInfo `json:"latencies,omitempty"` -} - -// AzureReachabilityReportLatencyInfo details on latency for a time series. -type AzureReachabilityReportLatencyInfo struct { - // TimeStamp - The time stamp. - TimeStamp *date.Time `json:"timeStamp,omitempty"` - // Score - The relative latency score between 1 and 100, higher values indicating a faster connection. - Score *int32 `json:"score,omitempty"` -} - -// AzureReachabilityReportLocation parameters that define a geographic location. -type AzureReachabilityReportLocation struct { - // Country - The name of the country. - Country *string `json:"country,omitempty"` - // State - The name of the state. - State *string `json:"state,omitempty"` - // City - The name of the city or town. - City *string `json:"city,omitempty"` -} - -// AzureReachabilityReportParameters geographic and time constraints for Azure reachability report. -type AzureReachabilityReportParameters struct { - // ProviderLocation - Parameters that define a geographic location. - ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` - // Providers - List of Internet service providers. - Providers *[]string `json:"providers,omitempty"` - // AzureLocations - Optional Azure regions to scope the query to. - AzureLocations *[]string `json:"azureLocations,omitempty"` - // StartTime - The start time for the Azure reachability report. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time for the Azure reachability report. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// AzureWebCategory azure Web Category Resource. -type AzureWebCategory struct { - autorest.Response `json:"-"` - // AzureWebCategoryPropertiesFormat - Properties of the Azure Web Category. - *AzureWebCategoryPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWebCategory. -func (awc AzureWebCategory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if awc.AzureWebCategoryPropertiesFormat != nil { - objectMap["properties"] = awc.AzureWebCategoryPropertiesFormat - } - if awc.ID != nil { - objectMap["id"] = awc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AzureWebCategory struct. -func (awc *AzureWebCategory) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var azureWebCategoryPropertiesFormat AzureWebCategoryPropertiesFormat - err = json.Unmarshal(*v, &azureWebCategoryPropertiesFormat) - if err != nil { - return err - } - awc.AzureWebCategoryPropertiesFormat = &azureWebCategoryPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - awc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - awc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - awc.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - awc.Etag = &etag - } - } - } - - return nil -} - -// AzureWebCategoryListResult response for ListAzureWebCategories API service call. -type AzureWebCategoryListResult struct { - autorest.Response `json:"-"` - // Value - List of Azure Web Categories for a given Subscription. - Value *[]AzureWebCategory `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// AzureWebCategoryListResultIterator provides access to a complete listing of AzureWebCategory values. -type AzureWebCategoryListResultIterator struct { - i int - page AzureWebCategoryListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AzureWebCategoryListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureWebCategoryListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AzureWebCategoryListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AzureWebCategoryListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AzureWebCategoryListResultIterator) Response() AzureWebCategoryListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AzureWebCategoryListResultIterator) Value() AzureWebCategory { - if !iter.page.NotDone() { - return AzureWebCategory{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AzureWebCategoryListResultIterator type. -func NewAzureWebCategoryListResultIterator(page AzureWebCategoryListResultPage) AzureWebCategoryListResultIterator { - return AzureWebCategoryListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (awclr AzureWebCategoryListResult) IsEmpty() bool { - return awclr.Value == nil || len(*awclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (awclr AzureWebCategoryListResult) hasNextLink() bool { - return awclr.NextLink != nil && len(*awclr.NextLink) != 0 -} - -// azureWebCategoryListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (awclr AzureWebCategoryListResult) azureWebCategoryListResultPreparer(ctx context.Context) (*http.Request, error) { - if !awclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(awclr.NextLink))) -} - -// AzureWebCategoryListResultPage contains a page of AzureWebCategory values. -type AzureWebCategoryListResultPage struct { - fn func(context.Context, AzureWebCategoryListResult) (AzureWebCategoryListResult, error) - awclr AzureWebCategoryListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AzureWebCategoryListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AzureWebCategoryListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.awclr) - if err != nil { - return err - } - page.awclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AzureWebCategoryListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AzureWebCategoryListResultPage) NotDone() bool { - return !page.awclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AzureWebCategoryListResultPage) Response() AzureWebCategoryListResult { - return page.awclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AzureWebCategoryListResultPage) Values() []AzureWebCategory { - if page.awclr.IsEmpty() { - return nil - } - return *page.awclr.Value -} - -// Creates a new instance of the AzureWebCategoryListResultPage type. -func NewAzureWebCategoryListResultPage(cur AzureWebCategoryListResult, getNextPage func(context.Context, AzureWebCategoryListResult) (AzureWebCategoryListResult, error)) AzureWebCategoryListResultPage { - return AzureWebCategoryListResultPage{ - fn: getNextPage, - awclr: cur, - } -} - -// AzureWebCategoryPropertiesFormat azure Web Category Properties. -type AzureWebCategoryPropertiesFormat struct { - // Group - READ-ONLY; The name of the group that the category belongs to. - Group *string `json:"group,omitempty"` -} - -// MarshalJSON is the custom marshaler for AzureWebCategoryPropertiesFormat. -func (awcpf AzureWebCategoryPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BackendAddressInboundNatRulePortMappings the response for a QueryInboundNatRulePortMapping API. -type BackendAddressInboundNatRulePortMappings struct { - autorest.Response `json:"-"` - // InboundNatRulePortMappings - Collection of inbound NAT rule port mappings. - InboundNatRulePortMappings *[]InboundNatRulePortMapping `json:"inboundNatRulePortMappings,omitempty"` -} - -// BackendAddressPool pool of backend IP addresses. -type BackendAddressPool struct { - autorest.Response `json:"-"` - // BackendAddressPoolPropertiesFormat - Properties of load balancer backend address pool. - *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of backend address pools used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackendAddressPool. -func (bap BackendAddressPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bap.BackendAddressPoolPropertiesFormat != nil { - objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat - } - if bap.Name != nil { - objectMap["name"] = bap.Name - } - if bap.ID != nil { - objectMap["id"] = bap.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct. -func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat - err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat) - if err != nil { - return err - } - bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bap.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bap.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bap.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bap.ID = &ID - } - } - } - - return nil -} - -// BackendAddressPoolPropertiesFormat properties of the backend address pool. -type BackendAddressPoolPropertiesFormat struct { - // Location - The location of the backend address pool. - Location *string `json:"location,omitempty"` - // TunnelInterfaces - An array of gateway load balancer tunnel interfaces. - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - // LoadBalancerBackendAddresses - An array of backend addresses. - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - // BackendIPConfigurations - READ-ONLY; An array of references to IP addresses defined in network interfaces. - BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - // LoadBalancingRules - READ-ONLY; An array of references to load balancing rules that use this backend address pool. - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // OutboundRule - READ-ONLY; A reference to an outbound rule that uses this backend address pool. - OutboundRule *SubResource `json:"outboundRule,omitempty"` - // OutboundRules - READ-ONLY; An array of references to outbound rules that use this backend address pool. - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - // InboundNatRules - READ-ONLY; An array of references to inbound NAT rules that use this backend address pool. - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // DrainPeriodInSeconds - Amount of seconds Load Balancer waits for before sending RESET to client and backend address. - DrainPeriodInSeconds *int32 `json:"drainPeriodInSeconds,omitempty"` - // VirtualNetwork - A reference to a virtual network. - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} - -// MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. -func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bappf.Location != nil { - objectMap["location"] = bappf.Location - } - if bappf.TunnelInterfaces != nil { - objectMap["tunnelInterfaces"] = bappf.TunnelInterfaces - } - if bappf.LoadBalancerBackendAddresses != nil { - objectMap["loadBalancerBackendAddresses"] = bappf.LoadBalancerBackendAddresses - } - if bappf.DrainPeriodInSeconds != nil { - objectMap["drainPeriodInSeconds"] = bappf.DrainPeriodInSeconds - } - if bappf.VirtualNetwork != nil { - objectMap["virtualNetwork"] = bappf.VirtualNetwork - } - return json.Marshal(objectMap) -} - -// BasicBaseAdminRule network base admin rule. -type BasicBaseAdminRule interface { - AsAdminRule() (*AdminRule, bool) - AsDefaultAdminRule() (*DefaultAdminRule, bool) - AsBaseAdminRule() (*BaseAdminRule, bool) -} - -// BaseAdminRule network base admin rule. -type BaseAdminRule struct { - autorest.Response `json:"-"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // Kind - Possible values include: 'KindBasicBaseAdminRuleKindBaseAdminRule', 'KindBasicBaseAdminRuleKindCustom', 'KindBasicBaseAdminRuleKindDefault' - Kind KindBasicBaseAdminRule `json:"kind,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -func unmarshalBasicBaseAdminRule(body []byte) (BasicBaseAdminRule, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindBasicBaseAdminRuleKindCustom): - var ar AdminRule - err := json.Unmarshal(body, &ar) - return ar, err - case string(KindBasicBaseAdminRuleKindDefault): - var dar DefaultAdminRule - err := json.Unmarshal(body, &dar) - return dar, err - default: - var bar BaseAdminRule - err := json.Unmarshal(body, &bar) - return bar, err - } -} -func unmarshalBasicBaseAdminRuleArray(body []byte) ([]BasicBaseAdminRule, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - barArray := make([]BasicBaseAdminRule, len(rawMessages)) - - for index, rawMessage := range rawMessages { - bar, err := unmarshalBasicBaseAdminRule(*rawMessage) - if err != nil { - return nil, err - } - barArray[index] = bar - } - return barArray, nil -} - -// MarshalJSON is the custom marshaler for BaseAdminRule. -func (bar BaseAdminRule) MarshalJSON() ([]byte, error) { - bar.Kind = KindBasicBaseAdminRuleKindBaseAdminRule - objectMap := make(map[string]interface{}) - if bar.Kind != "" { - objectMap["kind"] = bar.Kind - } - return json.Marshal(objectMap) -} - -// AsAdminRule is the BasicBaseAdminRule implementation for BaseAdminRule. -func (bar BaseAdminRule) AsAdminRule() (*AdminRule, bool) { - return nil, false -} - -// AsDefaultAdminRule is the BasicBaseAdminRule implementation for BaseAdminRule. -func (bar BaseAdminRule) AsDefaultAdminRule() (*DefaultAdminRule, bool) { - return nil, false -} - -// AsBaseAdminRule is the BasicBaseAdminRule implementation for BaseAdminRule. -func (bar BaseAdminRule) AsBaseAdminRule() (*BaseAdminRule, bool) { - return &bar, true -} - -// AsBasicBaseAdminRule is the BasicBaseAdminRule implementation for BaseAdminRule. -func (bar BaseAdminRule) AsBasicBaseAdminRule() (BasicBaseAdminRule, bool) { - return &bar, true -} - -// BaseAdminRuleModel ... -type BaseAdminRuleModel struct { - autorest.Response `json:"-"` - Value BasicBaseAdminRule `json:"value,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for BaseAdminRuleModel struct. -func (barm *BaseAdminRuleModel) UnmarshalJSON(body []byte) error { - bar, err := unmarshalBasicBaseAdminRule(body) - if err != nil { - return err - } - barm.Value = bar - - return nil -} - -// BastionActiveSession the session detail for a target. -type BastionActiveSession struct { - // SessionID - READ-ONLY; A unique id for the session. - SessionID *string `json:"sessionId,omitempty"` - // StartTime - READ-ONLY; The time when the session started. - StartTime interface{} `json:"startTime,omitempty"` - // TargetSubscriptionID - READ-ONLY; The subscription id for the target virtual machine. - TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty"` - // ResourceType - READ-ONLY; The type of the resource. - ResourceType *string `json:"resourceType,omitempty"` - // TargetHostName - READ-ONLY; The host name of the target. - TargetHostName *string `json:"targetHostName,omitempty"` - // TargetResourceGroup - READ-ONLY; The resource group of the target. - TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` - // UserName - READ-ONLY; The user name who is active on this session. - UserName *string `json:"userName,omitempty"` - // TargetIPAddress - READ-ONLY; The IP Address of the target. - TargetIPAddress *string `json:"targetIpAddress,omitempty"` - // Protocol - READ-ONLY; The protocol used to connect to the target. Possible values include: 'SSH', 'RDP' - Protocol BastionConnectProtocol `json:"protocol,omitempty"` - // TargetResourceID - READ-ONLY; The resource id of the target. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // SessionDurationInMins - READ-ONLY; Duration in mins the session has been active. - SessionDurationInMins *float64 `json:"sessionDurationInMins,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionActiveSession. -func (bas BastionActiveSession) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BastionActiveSessionListResult response for GetActiveSessions. -type BastionActiveSessionListResult struct { - autorest.Response `json:"-"` - // Value - List of active sessions on the bastion. - Value *[]BastionActiveSession `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BastionActiveSessionListResultIterator provides access to a complete listing of BastionActiveSession -// values. -type BastionActiveSessionListResultIterator struct { - i int - page BastionActiveSessionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BastionActiveSessionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionActiveSessionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BastionActiveSessionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BastionActiveSessionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BastionActiveSessionListResultIterator) Response() BastionActiveSessionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BastionActiveSessionListResultIterator) Value() BastionActiveSession { - if !iter.page.NotDone() { - return BastionActiveSession{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BastionActiveSessionListResultIterator type. -func NewBastionActiveSessionListResultIterator(page BastionActiveSessionListResultPage) BastionActiveSessionListResultIterator { - return BastionActiveSessionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (baslr BastionActiveSessionListResult) IsEmpty() bool { - return baslr.Value == nil || len(*baslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (baslr BastionActiveSessionListResult) hasNextLink() bool { - return baslr.NextLink != nil && len(*baslr.NextLink) != 0 -} - -// bastionActiveSessionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (baslr BastionActiveSessionListResult) bastionActiveSessionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !baslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(baslr.NextLink))) -} - -// BastionActiveSessionListResultPage contains a page of BastionActiveSession values. -type BastionActiveSessionListResultPage struct { - fn func(context.Context, BastionActiveSessionListResult) (BastionActiveSessionListResult, error) - baslr BastionActiveSessionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BastionActiveSessionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionActiveSessionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.baslr) - if err != nil { - return err - } - page.baslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BastionActiveSessionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BastionActiveSessionListResultPage) NotDone() bool { - return !page.baslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BastionActiveSessionListResultPage) Response() BastionActiveSessionListResult { - return page.baslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BastionActiveSessionListResultPage) Values() []BastionActiveSession { - if page.baslr.IsEmpty() { - return nil - } - return *page.baslr.Value -} - -// Creates a new instance of the BastionActiveSessionListResultPage type. -func NewBastionActiveSessionListResultPage(cur BastionActiveSessionListResult, getNextPage func(context.Context, BastionActiveSessionListResult) (BastionActiveSessionListResult, error)) BastionActiveSessionListResultPage { - return BastionActiveSessionListResultPage{ - fn: getNextPage, - baslr: cur, - } -} - -// BastionHost bastion Host resource. -type BastionHost struct { - autorest.Response `json:"-"` - // BastionHostPropertiesFormat - Represents the bastion host resource. - *BastionHostPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Sku - The sku of this Bastion Host. - Sku *Sku `json:"sku,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for BastionHost. -func (bh BastionHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bh.BastionHostPropertiesFormat != nil { - objectMap["properties"] = bh.BastionHostPropertiesFormat - } - if bh.Sku != nil { - objectMap["sku"] = bh.Sku - } - if bh.ID != nil { - objectMap["id"] = bh.ID - } - if bh.Location != nil { - objectMap["location"] = bh.Location - } - if bh.Tags != nil { - objectMap["tags"] = bh.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BastionHost struct. -func (bh *BastionHost) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var bastionHostPropertiesFormat BastionHostPropertiesFormat - err = json.Unmarshal(*v, &bastionHostPropertiesFormat) - if err != nil { - return err - } - bh.BastionHostPropertiesFormat = &bastionHostPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bh.Etag = &etag - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - bh.Sku = &sku - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bh.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - bh.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - bh.Tags = tags - } - } - } - - return nil -} - -// BastionHostIPConfiguration IP configuration of an Bastion Host. -type BastionHostIPConfiguration struct { - // BastionHostIPConfigurationPropertiesFormat - Represents the ip configuration associated with the resource. - *BastionHostIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Ip configuration type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionHostIPConfiguration. -func (bhic BastionHostIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bhic.BastionHostIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = bhic.BastionHostIPConfigurationPropertiesFormat - } - if bhic.Name != nil { - objectMap["name"] = bhic.Name - } - if bhic.ID != nil { - objectMap["id"] = bhic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BastionHostIPConfiguration struct. -func (bhic *BastionHostIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var bastionHostIPConfigurationPropertiesFormat BastionHostIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &bastionHostIPConfigurationPropertiesFormat) - if err != nil { - return err - } - bhic.BastionHostIPConfigurationPropertiesFormat = &bastionHostIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bhic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bhic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bhic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bhic.ID = &ID - } - } - } - - return nil -} - -// BastionHostIPConfigurationPropertiesFormat properties of IP configuration of an Bastion Host. -type BastionHostIPConfigurationPropertiesFormat struct { - // Subnet - Reference of the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - Reference of the PublicIP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the bastion host IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateIPAllocationMethod - Private IP allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionHostIPConfigurationPropertiesFormat. -func (bhicpf BastionHostIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bhicpf.Subnet != nil { - objectMap["subnet"] = bhicpf.Subnet - } - if bhicpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = bhicpf.PublicIPAddress - } - if bhicpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = bhicpf.PrivateIPAllocationMethod - } - return json.Marshal(objectMap) -} - -// BastionHostListResult response for ListBastionHosts API service call. -type BastionHostListResult struct { - autorest.Response `json:"-"` - // Value - List of Bastion Hosts in a resource group. - Value *[]BastionHost `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BastionHostListResultIterator provides access to a complete listing of BastionHost values. -type BastionHostListResultIterator struct { - i int - page BastionHostListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BastionHostListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BastionHostListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BastionHostListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BastionHostListResultIterator) Response() BastionHostListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BastionHostListResultIterator) Value() BastionHost { - if !iter.page.NotDone() { - return BastionHost{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BastionHostListResultIterator type. -func NewBastionHostListResultIterator(page BastionHostListResultPage) BastionHostListResultIterator { - return BastionHostListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bhlr BastionHostListResult) IsEmpty() bool { - return bhlr.Value == nil || len(*bhlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (bhlr BastionHostListResult) hasNextLink() bool { - return bhlr.NextLink != nil && len(*bhlr.NextLink) != 0 -} - -// bastionHostListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bhlr BastionHostListResult) bastionHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if !bhlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bhlr.NextLink))) -} - -// BastionHostListResultPage contains a page of BastionHost values. -type BastionHostListResultPage struct { - fn func(context.Context, BastionHostListResult) (BastionHostListResult, error) - bhlr BastionHostListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BastionHostListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.bhlr) - if err != nil { - return err - } - page.bhlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BastionHostListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BastionHostListResultPage) NotDone() bool { - return !page.bhlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BastionHostListResultPage) Response() BastionHostListResult { - return page.bhlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BastionHostListResultPage) Values() []BastionHost { - if page.bhlr.IsEmpty() { - return nil - } - return *page.bhlr.Value -} - -// Creates a new instance of the BastionHostListResultPage type. -func NewBastionHostListResultPage(cur BastionHostListResult, getNextPage func(context.Context, BastionHostListResult) (BastionHostListResult, error)) BastionHostListResultPage { - return BastionHostListResultPage{ - fn: getNextPage, - bhlr: cur, - } -} - -// BastionHostPropertiesFormat properties of the Bastion Host. -type BastionHostPropertiesFormat struct { - // IPConfigurations - IP configuration of the Bastion Host resource. - IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` - // DNSName - FQDN for the endpoint on which bastion host is accessible. - DNSName *string `json:"dnsName,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the bastion host resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ScaleUnits - The scale units for the Bastion Host resource. - ScaleUnits *int32 `json:"scaleUnits,omitempty"` - // DisableCopyPaste - Enable/Disable Copy/Paste feature of the Bastion Host resource. - DisableCopyPaste *bool `json:"disableCopyPaste,omitempty"` - // EnableFileCopy - Enable/Disable File Copy feature of the Bastion Host resource. - EnableFileCopy *bool `json:"enableFileCopy,omitempty"` - // EnableIPConnect - Enable/Disable IP Connect feature of the Bastion Host resource. - EnableIPConnect *bool `json:"enableIpConnect,omitempty"` - // EnableShareableLink - Enable/Disable Shareable Link of the Bastion Host resource. - EnableShareableLink *bool `json:"enableShareableLink,omitempty"` - // EnableTunneling - Enable/Disable Tunneling feature of the Bastion Host resource. - EnableTunneling *bool `json:"enableTunneling,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionHostPropertiesFormat. -func (bhpf BastionHostPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bhpf.IPConfigurations != nil { - objectMap["ipConfigurations"] = bhpf.IPConfigurations - } - if bhpf.DNSName != nil { - objectMap["dnsName"] = bhpf.DNSName - } - if bhpf.ScaleUnits != nil { - objectMap["scaleUnits"] = bhpf.ScaleUnits - } - if bhpf.DisableCopyPaste != nil { - objectMap["disableCopyPaste"] = bhpf.DisableCopyPaste - } - if bhpf.EnableFileCopy != nil { - objectMap["enableFileCopy"] = bhpf.EnableFileCopy - } - if bhpf.EnableIPConnect != nil { - objectMap["enableIpConnect"] = bhpf.EnableIPConnect - } - if bhpf.EnableShareableLink != nil { - objectMap["enableShareableLink"] = bhpf.EnableShareableLink - } - if bhpf.EnableTunneling != nil { - objectMap["enableTunneling"] = bhpf.EnableTunneling - } - return json.Marshal(objectMap) -} - -// BastionHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type BastionHostsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BastionHostsClient) (BastionHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BastionHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BastionHostsCreateOrUpdateFuture.Result. -func (future *BastionHostsCreateOrUpdateFuture) result(client BastionHostsClient) (bh BastionHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.BastionHostsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bh.Response.Response, err = future.GetResult(sender); err == nil && bh.Response.Response.StatusCode != http.StatusNoContent { - bh, err = client.CreateOrUpdateResponder(bh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsCreateOrUpdateFuture", "Result", bh.Response.Response, "Failure responding to request") - } - } - return -} - -// BastionHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BastionHostsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BastionHostsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BastionHostsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BastionHostsDeleteFuture.Result. -func (future *BastionHostsDeleteFuture) result(client BastionHostsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.BastionHostsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// BastionHostsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type BastionHostsUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BastionHostsClient) (BastionHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *BastionHostsUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for BastionHostsUpdateTagsFuture.Result. -func (future *BastionHostsUpdateTagsFuture) result(client BastionHostsClient) (bh BastionHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.BastionHostsUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bh.Response.Response, err = future.GetResult(sender); err == nil && bh.Response.Response.StatusCode != http.StatusNoContent { - bh, err = client.UpdateTagsResponder(bh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.BastionHostsUpdateTagsFuture", "Result", bh.Response.Response, "Failure responding to request") - } - } - return -} - -// BastionSessionDeleteResult response for DisconnectActiveSessions. -type BastionSessionDeleteResult struct { - autorest.Response `json:"-"` - // Value - List of sessions with their corresponding state. - Value *[]BastionSessionState `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BastionSessionDeleteResultIterator provides access to a complete listing of BastionSessionState values. -type BastionSessionDeleteResultIterator struct { - i int - page BastionSessionDeleteResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BastionSessionDeleteResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionSessionDeleteResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BastionSessionDeleteResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BastionSessionDeleteResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BastionSessionDeleteResultIterator) Response() BastionSessionDeleteResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BastionSessionDeleteResultIterator) Value() BastionSessionState { - if !iter.page.NotDone() { - return BastionSessionState{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BastionSessionDeleteResultIterator type. -func NewBastionSessionDeleteResultIterator(page BastionSessionDeleteResultPage) BastionSessionDeleteResultIterator { - return BastionSessionDeleteResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bsdr BastionSessionDeleteResult) IsEmpty() bool { - return bsdr.Value == nil || len(*bsdr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (bsdr BastionSessionDeleteResult) hasNextLink() bool { - return bsdr.NextLink != nil && len(*bsdr.NextLink) != 0 -} - -// bastionSessionDeleteResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bsdr BastionSessionDeleteResult) bastionSessionDeleteResultPreparer(ctx context.Context) (*http.Request, error) { - if !bsdr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bsdr.NextLink))) -} - -// BastionSessionDeleteResultPage contains a page of BastionSessionState values. -type BastionSessionDeleteResultPage struct { - fn func(context.Context, BastionSessionDeleteResult) (BastionSessionDeleteResult, error) - bsdr BastionSessionDeleteResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BastionSessionDeleteResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionSessionDeleteResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.bsdr) - if err != nil { - return err - } - page.bsdr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BastionSessionDeleteResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BastionSessionDeleteResultPage) NotDone() bool { - return !page.bsdr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BastionSessionDeleteResultPage) Response() BastionSessionDeleteResult { - return page.bsdr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BastionSessionDeleteResultPage) Values() []BastionSessionState { - if page.bsdr.IsEmpty() { - return nil - } - return *page.bsdr.Value -} - -// Creates a new instance of the BastionSessionDeleteResultPage type. -func NewBastionSessionDeleteResultPage(cur BastionSessionDeleteResult, getNextPage func(context.Context, BastionSessionDeleteResult) (BastionSessionDeleteResult, error)) BastionSessionDeleteResultPage { - return BastionSessionDeleteResultPage{ - fn: getNextPage, - bsdr: cur, - } -} - -// BastionSessionState the session state detail for a target. -type BastionSessionState struct { - // SessionID - READ-ONLY; A unique id for the session. - SessionID *string `json:"sessionId,omitempty"` - // Message - READ-ONLY; Used for extra information. - Message *string `json:"message,omitempty"` - // State - READ-ONLY; The state of the session. Disconnected/Failed/NotFound. - State *string `json:"state,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionSessionState. -func (bss BastionSessionState) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BastionShareableLink bastion Shareable Link. -type BastionShareableLink struct { - // VM - Reference of the virtual machine resource. - VM *VM `json:"vm,omitempty"` - // Bsl - READ-ONLY; The unique Bastion Shareable Link to the virtual machine. - Bsl *string `json:"bsl,omitempty"` - // CreatedAt - READ-ONLY; The time when the link was created. - CreatedAt *string `json:"createdAt,omitempty"` - // Message - READ-ONLY; Optional field indicating the warning or error message related to the vm in case of partial failure. - Message *string `json:"message,omitempty"` -} - -// MarshalJSON is the custom marshaler for BastionShareableLink. -func (bsl BastionShareableLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bsl.VM != nil { - objectMap["vm"] = bsl.VM - } - return json.Marshal(objectMap) -} - -// BastionShareableLinkListRequest post request for all the Bastion Shareable Link endpoints. -type BastionShareableLinkListRequest struct { - // Vms - List of VM references. - Vms *[]BastionShareableLink `json:"vms,omitempty"` -} - -// BastionShareableLinkListResult response for all the Bastion Shareable Link endpoints. -type BastionShareableLinkListResult struct { - autorest.Response `json:"-"` - // Value - List of Bastion Shareable Links for the request. - Value *[]BastionShareableLink `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BastionShareableLinkListResultIterator provides access to a complete listing of BastionShareableLink -// values. -type BastionShareableLinkListResultIterator struct { - i int - page BastionShareableLinkListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BastionShareableLinkListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionShareableLinkListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BastionShareableLinkListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BastionShareableLinkListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BastionShareableLinkListResultIterator) Response() BastionShareableLinkListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BastionShareableLinkListResultIterator) Value() BastionShareableLink { - if !iter.page.NotDone() { - return BastionShareableLink{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BastionShareableLinkListResultIterator type. -func NewBastionShareableLinkListResultIterator(page BastionShareableLinkListResultPage) BastionShareableLinkListResultIterator { - return BastionShareableLinkListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bsllr BastionShareableLinkListResult) IsEmpty() bool { - return bsllr.Value == nil || len(*bsllr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (bsllr BastionShareableLinkListResult) hasNextLink() bool { - return bsllr.NextLink != nil && len(*bsllr.NextLink) != 0 -} - -// bastionShareableLinkListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bsllr BastionShareableLinkListResult) bastionShareableLinkListResultPreparer(ctx context.Context) (*http.Request, error) { - if !bsllr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bsllr.NextLink))) -} - -// BastionShareableLinkListResultPage contains a page of BastionShareableLink values. -type BastionShareableLinkListResultPage struct { - fn func(context.Context, BastionShareableLinkListResult) (BastionShareableLinkListResult, error) - bsllr BastionShareableLinkListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BastionShareableLinkListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BastionShareableLinkListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.bsllr) - if err != nil { - return err - } - page.bsllr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BastionShareableLinkListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BastionShareableLinkListResultPage) NotDone() bool { - return !page.bsllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BastionShareableLinkListResultPage) Response() BastionShareableLinkListResult { - return page.bsllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BastionShareableLinkListResultPage) Values() []BastionShareableLink { - if page.bsllr.IsEmpty() { - return nil - } - return *page.bsllr.Value -} - -// Creates a new instance of the BastionShareableLinkListResultPage type. -func NewBastionShareableLinkListResultPage(cur BastionShareableLinkListResult, getNextPage func(context.Context, BastionShareableLinkListResult) (BastionShareableLinkListResult, error)) BastionShareableLinkListResultPage { - return BastionShareableLinkListResultPage{ - fn: getNextPage, - bsllr: cur, - } -} - -// BGPCommunity contains bgp community information offered in Service Community resources. -type BGPCommunity struct { - // ServiceSupportedRegion - The region which the service support. e.g. For O365, region is Global. - ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"` - // CommunityName - The name of the bgp community. e.g. Skype. - CommunityName *string `json:"communityName,omitempty"` - // CommunityValue - The value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - CommunityValue *string `json:"communityValue,omitempty"` - // CommunityPrefixes - The prefixes that the bgp community contains. - CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"` - // IsAuthorizedToUse - Customer is authorized to use bgp community or not. - IsAuthorizedToUse *bool `json:"isAuthorizedToUse,omitempty"` - // ServiceGroup - The service group of the bgp community contains. - ServiceGroup *string `json:"serviceGroup,omitempty"` -} - -// BgpConnection virtual Appliance Site resource. -type BgpConnection struct { - autorest.Response `json:"-"` - // BgpConnectionProperties - The properties of the Bgp connections. - *BgpConnectionProperties `json:"properties,omitempty"` - // Name - Name of the connection. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Connection type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for BgpConnection. -func (bc BgpConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bc.BgpConnectionProperties != nil { - objectMap["properties"] = bc.BgpConnectionProperties - } - if bc.Name != nil { - objectMap["name"] = bc.Name - } - if bc.ID != nil { - objectMap["id"] = bc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BgpConnection struct. -func (bc *BgpConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var bgpConnectionProperties BgpConnectionProperties - err = json.Unmarshal(*v, &bgpConnectionProperties) - if err != nil { - return err - } - bc.BgpConnectionProperties = &bgpConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - bc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bc.ID = &ID - } - } - } - - return nil -} - -// BgpConnectionProperties properties of the bgp connection. -type BgpConnectionProperties struct { - // PeerAsn - Peer ASN. - PeerAsn *int64 `json:"peerAsn,omitempty"` - // PeerIP - Peer IP. - PeerIP *string `json:"peerIp,omitempty"` - // HubVirtualNetworkConnection - The reference to the HubVirtualNetworkConnection resource. - HubVirtualNetworkConnection *SubResource `json:"hubVirtualNetworkConnection,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ConnectionState - READ-ONLY; The current state of the VirtualHub to Peer. Possible values include: 'HubBgpConnectionStatusUnknown', 'HubBgpConnectionStatusConnecting', 'HubBgpConnectionStatusConnected', 'HubBgpConnectionStatusNotConnected' - ConnectionState HubBgpConnectionStatus `json:"connectionState,omitempty"` -} - -// MarshalJSON is the custom marshaler for BgpConnectionProperties. -func (bcp BgpConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bcp.PeerAsn != nil { - objectMap["peerAsn"] = bcp.PeerAsn - } - if bcp.PeerIP != nil { - objectMap["peerIp"] = bcp.PeerIP - } - if bcp.HubVirtualNetworkConnection != nil { - objectMap["hubVirtualNetworkConnection"] = bcp.HubVirtualNetworkConnection - } - return json.Marshal(objectMap) -} - -// BgpPeerStatus BGP peer status details. -type BgpPeerStatus struct { - // LocalAddress - READ-ONLY; The virtual network gateway's local address. - LocalAddress *string `json:"localAddress,omitempty"` - // Neighbor - READ-ONLY; The remote BGP peer. - Neighbor *string `json:"neighbor,omitempty"` - // Asn - READ-ONLY; The autonomous system number of the remote BGP peer. - Asn *int64 `json:"asn,omitempty"` - // State - READ-ONLY; The BGP peer state. Possible values include: 'BgpPeerStateUnknown', 'BgpPeerStateStopped', 'BgpPeerStateIdle', 'BgpPeerStateConnecting', 'BgpPeerStateConnected' - State BgpPeerState `json:"state,omitempty"` - // ConnectedDuration - READ-ONLY; For how long the peering has been up. - ConnectedDuration *string `json:"connectedDuration,omitempty"` - // RoutesReceived - READ-ONLY; The number of routes learned from this peer. - RoutesReceived *int64 `json:"routesReceived,omitempty"` - // MessagesSent - READ-ONLY; The number of BGP messages sent. - MessagesSent *int64 `json:"messagesSent,omitempty"` - // MessagesReceived - READ-ONLY; The number of BGP messages received. - MessagesReceived *int64 `json:"messagesReceived,omitempty"` -} - -// MarshalJSON is the custom marshaler for BgpPeerStatus. -func (bps BgpPeerStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// BgpPeerStatusListResult response for list BGP peer status API service call. -type BgpPeerStatusListResult struct { - autorest.Response `json:"-"` - // Value - List of BGP peers. - Value *[]BgpPeerStatus `json:"value,omitempty"` -} - -// BgpServiceCommunity service Community Properties. -type BgpServiceCommunity struct { - // BgpServiceCommunityPropertiesFormat - Properties of the BGP service community. - *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for BgpServiceCommunity. -func (bsc BgpServiceCommunity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if bsc.BgpServiceCommunityPropertiesFormat != nil { - objectMap["properties"] = bsc.BgpServiceCommunityPropertiesFormat - } - if bsc.ID != nil { - objectMap["id"] = bsc.ID - } - if bsc.Location != nil { - objectMap["location"] = bsc.Location - } - if bsc.Tags != nil { - objectMap["tags"] = bsc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BgpServiceCommunity struct. -func (bsc *BgpServiceCommunity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var bgpServiceCommunityPropertiesFormat BgpServiceCommunityPropertiesFormat - err = json.Unmarshal(*v, &bgpServiceCommunityPropertiesFormat) - if err != nil { - return err - } - bsc.BgpServiceCommunityPropertiesFormat = &bgpServiceCommunityPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - bsc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - bsc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - bsc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - bsc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - bsc.Tags = tags - } - } - } - - return nil -} - -// BgpServiceCommunityListResult response for the ListServiceCommunity API service call. -type BgpServiceCommunityListResult struct { - autorest.Response `json:"-"` - // Value - A list of service community resources. - Value *[]BgpServiceCommunity `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// BgpServiceCommunityListResultIterator provides access to a complete listing of BgpServiceCommunity -// values. -type BgpServiceCommunityListResultIterator struct { - i int - page BgpServiceCommunityListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *BgpServiceCommunityListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *BgpServiceCommunityListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BgpServiceCommunityListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter BgpServiceCommunityListResultIterator) Response() BgpServiceCommunityListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter BgpServiceCommunityListResultIterator) Value() BgpServiceCommunity { - if !iter.page.NotDone() { - return BgpServiceCommunity{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BgpServiceCommunityListResultIterator type. -func NewBgpServiceCommunityListResultIterator(page BgpServiceCommunityListResultPage) BgpServiceCommunityListResultIterator { - return BgpServiceCommunityListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (bsclr BgpServiceCommunityListResult) IsEmpty() bool { - return bsclr.Value == nil || len(*bsclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (bsclr BgpServiceCommunityListResult) hasNextLink() bool { - return bsclr.NextLink != nil && len(*bsclr.NextLink) != 0 -} - -// bgpServiceCommunityListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (bsclr BgpServiceCommunityListResult) bgpServiceCommunityListResultPreparer(ctx context.Context) (*http.Request, error) { - if !bsclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(bsclr.NextLink))) -} - -// BgpServiceCommunityListResultPage contains a page of BgpServiceCommunity values. -type BgpServiceCommunityListResultPage struct { - fn func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error) - bsclr BgpServiceCommunityListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *BgpServiceCommunityListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.bsclr) - if err != nil { - return err - } - page.bsclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *BgpServiceCommunityListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BgpServiceCommunityListResultPage) NotDone() bool { - return !page.bsclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BgpServiceCommunityListResultPage) Response() BgpServiceCommunityListResult { - return page.bsclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BgpServiceCommunityListResultPage) Values() []BgpServiceCommunity { - if page.bsclr.IsEmpty() { - return nil - } - return *page.bsclr.Value -} - -// Creates a new instance of the BgpServiceCommunityListResultPage type. -func NewBgpServiceCommunityListResultPage(cur BgpServiceCommunityListResult, getNextPage func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)) BgpServiceCommunityListResultPage { - return BgpServiceCommunityListResultPage{ - fn: getNextPage, - bsclr: cur, - } -} - -// BgpServiceCommunityPropertiesFormat properties of Service Community. -type BgpServiceCommunityPropertiesFormat struct { - // ServiceName - The name of the bgp community. e.g. Skype. - ServiceName *string `json:"serviceName,omitempty"` - // BgpCommunities - A list of bgp communities. - BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"` -} - -// BgpSettings BGP settings details. -type BgpSettings struct { - // Asn - The BGP speaker's ASN. - Asn *int64 `json:"asn,omitempty"` - // BgpPeeringAddress - The BGP peering address and BGP identifier of this BGP speaker. - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - // PeerWeight - The weight added to routes learned from this BGP speaker. - PeerWeight *int32 `json:"peerWeight,omitempty"` - // BgpPeeringAddresses - BGP peering address with IP configuration ID for virtual network gateway. - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` -} - -// BreakOutCategoryPolicies network Virtual Appliance Sku Properties. -type BreakOutCategoryPolicies struct { - // Allow - Flag to control breakout of o365 allow category. - Allow *bool `json:"allow,omitempty"` - // Optimize - Flag to control breakout of o365 optimize category. - Optimize *bool `json:"optimize,omitempty"` - // Default - Flag to control breakout of o365 default category. - Default *bool `json:"default,omitempty"` -} - -// CheckPrivateLinkServiceVisibilityRequest request body of the CheckPrivateLinkServiceVisibility API -// service call. -type CheckPrivateLinkServiceVisibilityRequest struct { - // PrivateLinkServiceAlias - The alias of the private link service. - PrivateLinkServiceAlias *string `json:"privateLinkServiceAlias,omitempty"` -} - -// ChildResource proxy resource representation. -type ChildResource struct { - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ChildResource. -func (cr ChildResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CloudError an error response from the service. -type CloudError struct { - // Error - Cloud error body. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody an error response from the service. -type CloudErrorBody struct { - // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` - // Target - The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty"` - // Details - A list of additional details about the error. - Details *[]CloudErrorBody `json:"details,omitempty"` -} - -// ConfigurationDiagnosticParameters parameters to get network configuration diagnostic. -type ConfigurationDiagnosticParameters struct { - // TargetResourceID - The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // VerbosityLevel - Verbosity level. Possible values include: 'VerbosityLevelNormal', 'VerbosityLevelMinimum', 'VerbosityLevelFull' - VerbosityLevel VerbosityLevel `json:"verbosityLevel,omitempty"` - // Profiles - List of network configuration diagnostic profiles. - Profiles *[]ConfigurationDiagnosticProfile `json:"profiles,omitempty"` -} - -// ConfigurationDiagnosticProfile parameters to compare with network configuration. -type ConfigurationDiagnosticProfile struct { - // Direction - The direction of the traffic. Possible values include: 'Inbound', 'Outbound' - Direction Direction `json:"direction,omitempty"` - // Protocol - Protocol to be verified on. Accepted values are '*', TCP, UDP. - Protocol *string `json:"protocol,omitempty"` - // Source - Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag. - Source *string `json:"source,omitempty"` - // Destination - Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag. - Destination *string `json:"destination,omitempty"` - // DestinationPort - Traffic destination port. Accepted values are '*' and a single port in the range (0 - 65535). - DestinationPort *string `json:"destinationPort,omitempty"` -} - -// ConfigurationDiagnosticResponse results of network configuration diagnostic on the target resource. -type ConfigurationDiagnosticResponse struct { - autorest.Response `json:"-"` - // Results - READ-ONLY; List of network configuration diagnostic results. - Results *[]ConfigurationDiagnosticResult `json:"results,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConfigurationDiagnosticResponse. -func (cdr ConfigurationDiagnosticResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ConfigurationDiagnosticResult network configuration diagnostic result corresponded to provided traffic -// query. -type ConfigurationDiagnosticResult struct { - // Profile - Network configuration diagnostic profile. - Profile *ConfigurationDiagnosticProfile `json:"profile,omitempty"` - // NetworkSecurityGroupResult - Network security group result. - NetworkSecurityGroupResult *SecurityGroupResult `json:"networkSecurityGroupResult,omitempty"` -} - -// ConfigurationGroup the network configuration group resource -type ConfigurationGroup struct { - // ID - Network group ID. - ID *string `json:"id,omitempty"` - // GroupProperties - The network configuration group properties - *GroupProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConfigurationGroup. -func (cg ConfigurationGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cg.ID != nil { - objectMap["id"] = cg.ID - } - if cg.GroupProperties != nil { - objectMap["properties"] = cg.GroupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConfigurationGroup struct. -func (cg *ConfigurationGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cg.ID = &ID - } - case "properties": - if v != nil { - var groupProperties GroupProperties - err = json.Unmarshal(*v, &groupProperties) - if err != nil { - return err - } - cg.GroupProperties = &groupProperties - } - } - } - - return nil -} - -// ConfigurationPolicyGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ConfigurationPolicyGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConfigurationPolicyGroupsClient) (VpnServerConfigurationPolicyGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConfigurationPolicyGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConfigurationPolicyGroupsCreateOrUpdateFuture.Result. -func (future *ConfigurationPolicyGroupsCreateOrUpdateFuture) result(client ConfigurationPolicyGroupsClient) (vscpg VpnServerConfigurationPolicyGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vscpg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConfigurationPolicyGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vscpg.Response.Response, err = future.GetResult(sender); err == nil && vscpg.Response.Response.StatusCode != http.StatusNoContent { - vscpg, err = client.CreateOrUpdateResponder(vscpg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsCreateOrUpdateFuture", "Result", vscpg.Response.Response, "Failure responding to request") - } - } - return -} - -// ConfigurationPolicyGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ConfigurationPolicyGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConfigurationPolicyGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConfigurationPolicyGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConfigurationPolicyGroupsDeleteFuture.Result. -func (future *ConfigurationPolicyGroupsDeleteFuture) result(client ConfigurationPolicyGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConfigurationPolicyGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConfigurationPolicyGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ConnectionMonitor parameters that define the operation to create a connection monitor. -type ConnectionMonitor struct { - // Location - Connection monitor location. - Location *string `json:"location,omitempty"` - // Tags - Connection monitor tags. - Tags map[string]*string `json:"tags"` - // ConnectionMonitorParameters - Properties of the connection monitor. - *ConnectionMonitorParameters `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionMonitor. -func (cm ConnectionMonitor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cm.Location != nil { - objectMap["location"] = cm.Location - } - if cm.Tags != nil { - objectMap["tags"] = cm.Tags - } - if cm.ConnectionMonitorParameters != nil { - objectMap["properties"] = cm.ConnectionMonitorParameters - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectionMonitor struct. -func (cm *ConnectionMonitor) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cm.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cm.Tags = tags - } - case "properties": - if v != nil { - var connectionMonitorParameters ConnectionMonitorParameters - err = json.Unmarshal(*v, &connectionMonitorParameters) - if err != nil { - return err - } - cm.ConnectionMonitorParameters = &connectionMonitorParameters - } - } - } - - return nil -} - -// ConnectionMonitorDestination describes the destination of connection monitor. -type ConnectionMonitorDestination struct { - // ResourceID - The ID of the resource used as the destination by connection monitor. - ResourceID *string `json:"resourceId,omitempty"` - // Address - Address of the connection monitor destination (IP or domain name). - Address *string `json:"address,omitempty"` - // Port - The destination port used by connection monitor. - Port *int32 `json:"port,omitempty"` -} - -// ConnectionMonitorEndpoint describes the connection monitor endpoint. -type ConnectionMonitorEndpoint struct { - // Name - The name of the connection monitor endpoint. - Name *string `json:"name,omitempty"` - // Type - The endpoint type. Possible values include: 'AzureVM', 'AzureVNet', 'AzureSubnet', 'ExternalAddress', 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork', 'AzureArcVM', 'AzureVMSS' - Type EndpointType `json:"type,omitempty"` - // ResourceID - Resource ID of the connection monitor endpoint. - ResourceID *string `json:"resourceId,omitempty"` - // Address - Address of the connection monitor endpoint (IP or domain name). - Address *string `json:"address,omitempty"` - // Filter - Filter for sub-items within the endpoint. - Filter *ConnectionMonitorEndpointFilter `json:"filter,omitempty"` - // Scope - Endpoint scope. - Scope *ConnectionMonitorEndpointScope `json:"scope,omitempty"` - // CoverageLevel - Test coverage for the endpoint. Possible values include: 'Default', 'Low', 'BelowAverage', 'Average', 'AboveAverage', 'Full' - CoverageLevel CoverageLevel `json:"coverageLevel,omitempty"` -} - -// ConnectionMonitorEndpointFilter describes the connection monitor endpoint filter. -type ConnectionMonitorEndpointFilter struct { - // Type - The behavior of the endpoint filter. Currently only 'Include' is supported. Possible values include: 'Include' - Type ConnectionMonitorEndpointFilterType `json:"type,omitempty"` - // Items - List of items in the filter. - Items *[]ConnectionMonitorEndpointFilterItem `json:"items,omitempty"` -} - -// ConnectionMonitorEndpointFilterItem describes the connection monitor endpoint filter item. -type ConnectionMonitorEndpointFilterItem struct { - // Type - The type of item included in the filter. Currently only 'AgentAddress' is supported. Possible values include: 'AgentAddress' - Type ConnectionMonitorEndpointFilterItemType `json:"type,omitempty"` - // Address - The address of the filter item. - Address *string `json:"address,omitempty"` -} - -// ConnectionMonitorEndpointScope describes the connection monitor endpoint scope. -type ConnectionMonitorEndpointScope struct { - // Include - List of items which needs to be included to the endpoint scope. - Include *[]ConnectionMonitorEndpointScopeItem `json:"include,omitempty"` - // Exclude - List of items which needs to be excluded from the endpoint scope. - Exclude *[]ConnectionMonitorEndpointScopeItem `json:"exclude,omitempty"` -} - -// ConnectionMonitorEndpointScopeItem describes the connection monitor endpoint scope item. -type ConnectionMonitorEndpointScopeItem struct { - // Address - The address of the endpoint item. Supported types are IPv4/IPv6 subnet mask or IPv4/IPv6 IP address. - Address *string `json:"address,omitempty"` -} - -// ConnectionMonitorHTTPConfiguration describes the HTTP configuration. -type ConnectionMonitorHTTPConfiguration struct { - // Port - The port to connect to. - Port *int32 `json:"port,omitempty"` - // Method - The HTTP method to use. Possible values include: 'Get', 'Post' - Method HTTPConfigurationMethod `json:"method,omitempty"` - // Path - The path component of the URI. For instance, "/dir1/dir2". - Path *string `json:"path,omitempty"` - // RequestHeaders - The HTTP headers to transmit with the request. - RequestHeaders *[]HTTPHeader `json:"requestHeaders,omitempty"` - // ValidStatusCodeRanges - HTTP status codes to consider successful. For instance, "2xx,301-304,418". - ValidStatusCodeRanges *[]string `json:"validStatusCodeRanges,omitempty"` - // PreferHTTPS - Value indicating whether HTTPS is preferred over HTTP in cases where the choice is not explicit. - PreferHTTPS *bool `json:"preferHTTPS,omitempty"` -} - -// ConnectionMonitorIcmpConfiguration describes the ICMP configuration. -type ConnectionMonitorIcmpConfiguration struct { - // DisableTraceRoute - Value indicating whether path evaluation with trace route should be disabled. - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` -} - -// ConnectionMonitorListResult list of connection monitors. -type ConnectionMonitorListResult struct { - autorest.Response `json:"-"` - // Value - Information about connection monitors. - Value *[]ConnectionMonitorResult `json:"value,omitempty"` -} - -// ConnectionMonitorOutput describes a connection monitor output destination. -type ConnectionMonitorOutput struct { - // Type - Connection monitor output destination type. Currently, only "Workspace" is supported. Possible values include: 'Workspace' - Type OutputType `json:"type,omitempty"` - // WorkspaceSettings - Describes the settings for producing output into a log analytics workspace. - WorkspaceSettings *ConnectionMonitorWorkspaceSettings `json:"workspaceSettings,omitempty"` -} - -// ConnectionMonitorParameters parameters that define the operation to create a connection monitor. -type ConnectionMonitorParameters struct { - // Source - Describes the source of connection monitor. - Source *ConnectionMonitorSource `json:"source,omitempty"` - // Destination - Describes the destination of connection monitor. - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - // AutoStart - Determines if the connection monitor will start automatically once created. - AutoStart *bool `json:"autoStart,omitempty"` - // MonitoringIntervalInSeconds - Monitoring interval in seconds. - MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"` - // Endpoints - List of connection monitor endpoints. - Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - // TestConfigurations - List of connection monitor test configurations. - TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - // TestGroups - List of connection monitor test groups. - TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"` - // Outputs - List of connection monitor outputs. - Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"` - // Notes - Optional notes to be associated with the connection monitor. - Notes *string `json:"notes,omitempty"` -} - -// ConnectionMonitorQueryResult list of connection states snapshots. -type ConnectionMonitorQueryResult struct { - autorest.Response `json:"-"` - // SourceStatus - Status of connection monitor source. Possible values include: 'ConnectionMonitorSourceStatusUnknown', 'ConnectionMonitorSourceStatusActive', 'ConnectionMonitorSourceStatusInactive' - SourceStatus ConnectionMonitorSourceStatus `json:"sourceStatus,omitempty"` - // States - Information about connection states. - States *[]ConnectionStateSnapshot `json:"states,omitempty"` -} - -// ConnectionMonitorResult information about the connection monitor. -type ConnectionMonitorResult struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Name of the connection monitor. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; ID of the connection monitor. - ID *string `json:"id,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Connection monitor type. - Type *string `json:"type,omitempty"` - // Location - Connection monitor location. - Location *string `json:"location,omitempty"` - // Tags - Connection monitor tags. - Tags map[string]*string `json:"tags"` - // ConnectionMonitorResultProperties - Properties of the connection monitor result. - *ConnectionMonitorResultProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionMonitorResult. -func (cmr ConnectionMonitorResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cmr.Location != nil { - objectMap["location"] = cmr.Location - } - if cmr.Tags != nil { - objectMap["tags"] = cmr.Tags - } - if cmr.ConnectionMonitorResultProperties != nil { - objectMap["properties"] = cmr.ConnectionMonitorResultProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectionMonitorResult struct. -func (cmr *ConnectionMonitorResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cmr.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cmr.ID = &ID - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cmr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cmr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cmr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cmr.Tags = tags - } - case "properties": - if v != nil { - var connectionMonitorResultProperties ConnectionMonitorResultProperties - err = json.Unmarshal(*v, &connectionMonitorResultProperties) - if err != nil { - return err - } - cmr.ConnectionMonitorResultProperties = &connectionMonitorResultProperties - } - } - } - - return nil -} - -// ConnectionMonitorResultProperties describes the properties of a connection monitor. -type ConnectionMonitorResultProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the connection monitor. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // StartTime - READ-ONLY; The date and time when the connection monitor was started. - StartTime *date.Time `json:"startTime,omitempty"` - // MonitoringStatus - READ-ONLY; The monitoring status of the connection monitor. - MonitoringStatus *string `json:"monitoringStatus,omitempty"` - // ConnectionMonitorType - READ-ONLY; Type of connection monitor. Possible values include: 'MultiEndpoint', 'SingleSourceDestination' - ConnectionMonitorType ConnectionMonitorType `json:"connectionMonitorType,omitempty"` - // Source - Describes the source of connection monitor. - Source *ConnectionMonitorSource `json:"source,omitempty"` - // Destination - Describes the destination of connection monitor. - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - // AutoStart - Determines if the connection monitor will start automatically once created. - AutoStart *bool `json:"autoStart,omitempty"` - // MonitoringIntervalInSeconds - Monitoring interval in seconds. - MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"` - // Endpoints - List of connection monitor endpoints. - Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - // TestConfigurations - List of connection monitor test configurations. - TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - // TestGroups - List of connection monitor test groups. - TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"` - // Outputs - List of connection monitor outputs. - Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"` - // Notes - Optional notes to be associated with the connection monitor. - Notes *string `json:"notes,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionMonitorResultProperties. -func (cmrp ConnectionMonitorResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cmrp.Source != nil { - objectMap["source"] = cmrp.Source - } - if cmrp.Destination != nil { - objectMap["destination"] = cmrp.Destination - } - if cmrp.AutoStart != nil { - objectMap["autoStart"] = cmrp.AutoStart - } - if cmrp.MonitoringIntervalInSeconds != nil { - objectMap["monitoringIntervalInSeconds"] = cmrp.MonitoringIntervalInSeconds - } - if cmrp.Endpoints != nil { - objectMap["endpoints"] = cmrp.Endpoints - } - if cmrp.TestConfigurations != nil { - objectMap["testConfigurations"] = cmrp.TestConfigurations - } - if cmrp.TestGroups != nil { - objectMap["testGroups"] = cmrp.TestGroups - } - if cmrp.Outputs != nil { - objectMap["outputs"] = cmrp.Outputs - } - if cmrp.Notes != nil { - objectMap["notes"] = cmrp.Notes - } - return json.Marshal(objectMap) -} - -// ConnectionMonitorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ConnectionMonitorsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (ConnectionMonitorResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsCreateOrUpdateFuture.Result. -func (future *ConnectionMonitorsCreateOrUpdateFuture) result(client ConnectionMonitorsClient) (cmr ConnectionMonitorResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cmr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cmr.Response.Response, err = future.GetResult(sender); err == nil && cmr.Response.Response.StatusCode != http.StatusNoContent { - cmr, err = client.CreateOrUpdateResponder(cmr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", cmr.Response.Response, "Failure responding to request") - } - } - return -} - -// ConnectionMonitorsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ConnectionMonitorsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsDeleteFuture.Result. -func (future *ConnectionMonitorsDeleteFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ConnectionMonitorSource describes the source of connection monitor. -type ConnectionMonitorSource struct { - // ResourceID - The ID of the resource used as the source by connection monitor. - ResourceID *string `json:"resourceId,omitempty"` - // Port - The source port used by connection monitor. - Port *int32 `json:"port,omitempty"` -} - -// ConnectionMonitorsQueryFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ConnectionMonitorsQueryFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (ConnectionMonitorQueryResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsQueryFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsQueryFuture.Result. -func (future *ConnectionMonitorsQueryFuture) result(client ConnectionMonitorsClient) (cmqr ConnectionMonitorQueryResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cmqr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsQueryFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cmqr.Response.Response, err = future.GetResult(sender); err == nil && cmqr.Response.Response.StatusCode != http.StatusNoContent { - cmqr, err = client.QueryResponder(cmqr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", cmqr.Response.Response, "Failure responding to request") - } - } - return -} - -// ConnectionMonitorsStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ConnectionMonitorsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsStartFuture.Result. -func (future *ConnectionMonitorsStartFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// ConnectionMonitorsStopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ConnectionMonitorsStopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectionMonitorsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectionMonitorsStopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectionMonitorsStopFuture.Result. -func (future *ConnectionMonitorsStopFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStopFuture") - return - } - ar.Response = future.Response() - return -} - -// ConnectionMonitorSuccessThreshold describes the threshold for declaring a test successful. -type ConnectionMonitorSuccessThreshold struct { - // ChecksFailedPercent - The maximum percentage of failed checks permitted for a test to evaluate as successful. - ChecksFailedPercent *int32 `json:"checksFailedPercent,omitempty"` - // RoundTripTimeMs - The maximum round-trip time in milliseconds permitted for a test to evaluate as successful. - RoundTripTimeMs *float64 `json:"roundTripTimeMs,omitempty"` -} - -// ConnectionMonitorTCPConfiguration describes the TCP configuration. -type ConnectionMonitorTCPConfiguration struct { - // Port - The port to connect to. - Port *int32 `json:"port,omitempty"` - // DisableTraceRoute - Value indicating whether path evaluation with trace route should be disabled. - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` - // DestinationPortBehavior - Destination port behavior. Possible values include: 'DestinationPortBehaviorNone', 'DestinationPortBehaviorListenIfAvailable' - DestinationPortBehavior DestinationPortBehavior `json:"destinationPortBehavior,omitempty"` -} - -// ConnectionMonitorTestConfiguration describes a connection monitor test configuration. -type ConnectionMonitorTestConfiguration struct { - // Name - The name of the connection monitor test configuration. - Name *string `json:"name,omitempty"` - // TestFrequencySec - The frequency of test evaluation, in seconds. - TestFrequencySec *int32 `json:"testFrequencySec,omitempty"` - // Protocol - The protocol to use in test evaluation. Possible values include: 'ConnectionMonitorTestConfigurationProtocolTCP', 'ConnectionMonitorTestConfigurationProtocolHTTP', 'ConnectionMonitorTestConfigurationProtocolIcmp' - Protocol ConnectionMonitorTestConfigurationProtocol `json:"protocol,omitempty"` - // PreferredIPVersion - The preferred IP version to use in test evaluation. The connection monitor may choose to use a different version depending on other parameters. Possible values include: 'PreferredIPVersionIPv4', 'PreferredIPVersionIPv6' - PreferredIPVersion PreferredIPVersion `json:"preferredIPVersion,omitempty"` - // HTTPConfiguration - The parameters used to perform test evaluation over HTTP. - HTTPConfiguration *ConnectionMonitorHTTPConfiguration `json:"httpConfiguration,omitempty"` - // TCPConfiguration - The parameters used to perform test evaluation over TCP. - TCPConfiguration *ConnectionMonitorTCPConfiguration `json:"tcpConfiguration,omitempty"` - // IcmpConfiguration - The parameters used to perform test evaluation over ICMP. - IcmpConfiguration *ConnectionMonitorIcmpConfiguration `json:"icmpConfiguration,omitempty"` - // SuccessThreshold - The threshold for declaring a test successful. - SuccessThreshold *ConnectionMonitorSuccessThreshold `json:"successThreshold,omitempty"` -} - -// ConnectionMonitorTestGroup describes the connection monitor test group. -type ConnectionMonitorTestGroup struct { - // Name - The name of the connection monitor test group. - Name *string `json:"name,omitempty"` - // Disable - Value indicating whether test group is disabled. - Disable *bool `json:"disable,omitempty"` - // TestConfigurations - List of test configuration names. - TestConfigurations *[]string `json:"testConfigurations,omitempty"` - // Sources - List of source endpoint names. - Sources *[]string `json:"sources,omitempty"` - // Destinations - List of destination endpoint names. - Destinations *[]string `json:"destinations,omitempty"` -} - -// ConnectionMonitorWorkspaceSettings describes the settings for producing output into a log analytics -// workspace. -type ConnectionMonitorWorkspaceSettings struct { - // WorkspaceResourceID - Log analytics workspace resource ID. - WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` -} - -// ConnectionResetSharedKey the virtual network connection reset shared key. -type ConnectionResetSharedKey struct { - autorest.Response `json:"-"` - // KeyLength - The virtual network connection reset shared key length, should between 1 and 128. - KeyLength *int32 `json:"keyLength,omitempty"` -} - -// ConnectionSharedKey response for GetConnectionSharedKey API service call. -type ConnectionSharedKey struct { - autorest.Response `json:"-"` - // Value - The virtual network connection shared key value. - Value *string `json:"value,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// ConnectionStateSnapshot connection state snapshot. -type ConnectionStateSnapshot struct { - // ConnectionState - The connection state. Possible values include: 'ConnectionStateReachable', 'ConnectionStateUnreachable', 'ConnectionStateUnknown' - ConnectionState ConnectionState `json:"connectionState,omitempty"` - // StartTime - The start time of the connection snapshot. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time of the connection snapshot. - EndTime *date.Time `json:"endTime,omitempty"` - // EvaluationState - Connectivity analysis evaluation state. Possible values include: 'EvaluationStateNotStarted', 'EvaluationStateInProgress', 'EvaluationStateCompleted' - EvaluationState EvaluationState `json:"evaluationState,omitempty"` - // AvgLatencyInMs - Average latency in ms. - AvgLatencyInMs *int64 `json:"avgLatencyInMs,omitempty"` - // MinLatencyInMs - Minimum latency in ms. - MinLatencyInMs *int64 `json:"minLatencyInMs,omitempty"` - // MaxLatencyInMs - Maximum latency in ms. - MaxLatencyInMs *int64 `json:"maxLatencyInMs,omitempty"` - // ProbesSent - The number of sent probes. - ProbesSent *int64 `json:"probesSent,omitempty"` - // ProbesFailed - The number of failed probes. - ProbesFailed *int64 `json:"probesFailed,omitempty"` - // Hops - READ-ONLY; List of hops between the source and the destination. - Hops *[]ConnectivityHop `json:"hops,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectionStateSnapshot. -func (CSS ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if CSS.ConnectionState != "" { - objectMap["connectionState"] = CSS.ConnectionState - } - if CSS.StartTime != nil { - objectMap["startTime"] = CSS.StartTime - } - if CSS.EndTime != nil { - objectMap["endTime"] = CSS.EndTime - } - if CSS.EvaluationState != "" { - objectMap["evaluationState"] = CSS.EvaluationState - } - if CSS.AvgLatencyInMs != nil { - objectMap["avgLatencyInMs"] = CSS.AvgLatencyInMs - } - if CSS.MinLatencyInMs != nil { - objectMap["minLatencyInMs"] = CSS.MinLatencyInMs - } - if CSS.MaxLatencyInMs != nil { - objectMap["maxLatencyInMs"] = CSS.MaxLatencyInMs - } - if CSS.ProbesSent != nil { - objectMap["probesSent"] = CSS.ProbesSent - } - if CSS.ProbesFailed != nil { - objectMap["probesFailed"] = CSS.ProbesFailed - } - return json.Marshal(objectMap) -} - -// ConnectivityConfiguration the network manager connectivity configuration resource -type ConnectivityConfiguration struct { - autorest.Response `json:"-"` - // ConnectivityConfigurationProperties - Properties of a network manager connectivity configuration - *ConnectivityConfigurationProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectivityConfiguration. -func (cc ConnectivityConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cc.ConnectivityConfigurationProperties != nil { - objectMap["properties"] = cc.ConnectivityConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ConnectivityConfiguration struct. -func (cc *ConnectivityConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var connectivityConfigurationProperties ConnectivityConfigurationProperties - err = json.Unmarshal(*v, &connectivityConfigurationProperties) - if err != nil { - return err - } - cc.ConnectivityConfigurationProperties = &connectivityConfigurationProperties - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - cc.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cc.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cc.Etag = &etag - } - } - } - - return nil -} - -// ConnectivityConfigurationListResult result of the request to list network manager connectivity -// configurations. It contains a list of configurations and a link to get the next set of results. -type ConnectivityConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of Connectivity Configurations - Value *[]ConnectivityConfiguration `json:"value,omitempty"` - // NextLink - Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ConnectivityConfigurationListResultIterator provides access to a complete listing of -// ConnectivityConfiguration values. -type ConnectivityConfigurationListResultIterator struct { - i int - page ConnectivityConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ConnectivityConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ConnectivityConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ConnectivityConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ConnectivityConfigurationListResultIterator) Response() ConnectivityConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ConnectivityConfigurationListResultIterator) Value() ConnectivityConfiguration { - if !iter.page.NotDone() { - return ConnectivityConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ConnectivityConfigurationListResultIterator type. -func NewConnectivityConfigurationListResultIterator(page ConnectivityConfigurationListResultPage) ConnectivityConfigurationListResultIterator { - return ConnectivityConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cclr ConnectivityConfigurationListResult) IsEmpty() bool { - return cclr.Value == nil || len(*cclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cclr ConnectivityConfigurationListResult) hasNextLink() bool { - return cclr.NextLink != nil && len(*cclr.NextLink) != 0 -} - -// connectivityConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cclr ConnectivityConfigurationListResult) connectivityConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !cclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cclr.NextLink))) -} - -// ConnectivityConfigurationListResultPage contains a page of ConnectivityConfiguration values. -type ConnectivityConfigurationListResultPage struct { - fn func(context.Context, ConnectivityConfigurationListResult) (ConnectivityConfigurationListResult, error) - cclr ConnectivityConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ConnectivityConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cclr) - if err != nil { - return err - } - page.cclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ConnectivityConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ConnectivityConfigurationListResultPage) NotDone() bool { - return !page.cclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ConnectivityConfigurationListResultPage) Response() ConnectivityConfigurationListResult { - return page.cclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ConnectivityConfigurationListResultPage) Values() []ConnectivityConfiguration { - if page.cclr.IsEmpty() { - return nil - } - return *page.cclr.Value -} - -// Creates a new instance of the ConnectivityConfigurationListResultPage type. -func NewConnectivityConfigurationListResultPage(cur ConnectivityConfigurationListResult, getNextPage func(context.Context, ConnectivityConfigurationListResult) (ConnectivityConfigurationListResult, error)) ConnectivityConfigurationListResultPage { - return ConnectivityConfigurationListResultPage{ - fn: getNextPage, - cclr: cur, - } -} - -// ConnectivityConfigurationProperties properties of network manager connectivity configuration -type ConnectivityConfigurationProperties struct { - // Description - A description of the connectivity configuration. - Description *string `json:"description,omitempty"` - // ConnectivityTopology - Connectivity topology type. Possible values include: 'HubAndSpoke', 'Mesh' - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology,omitempty"` - // Hubs - List of hubItems - Hubs *[]Hub `json:"hubs,omitempty"` - // IsGlobal - Flag if global mesh is supported. Possible values include: 'IsGlobalFalse', 'IsGlobalTrue' - IsGlobal IsGlobal `json:"isGlobal,omitempty"` - // AppliesToGroups - Groups for configuration - AppliesToGroups *[]ConnectivityGroupItem `json:"appliesToGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the connectivity configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // DeleteExistingPeering - Flag if need to remove current existing peerings. Possible values include: 'False', 'True' - DeleteExistingPeering DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectivityConfigurationProperties. -func (ccp ConnectivityConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ccp.Description != nil { - objectMap["description"] = ccp.Description - } - if ccp.ConnectivityTopology != "" { - objectMap["connectivityTopology"] = ccp.ConnectivityTopology - } - if ccp.Hubs != nil { - objectMap["hubs"] = ccp.Hubs - } - if ccp.IsGlobal != "" { - objectMap["isGlobal"] = ccp.IsGlobal - } - if ccp.AppliesToGroups != nil { - objectMap["appliesToGroups"] = ccp.AppliesToGroups - } - if ccp.DeleteExistingPeering != "" { - objectMap["deleteExistingPeering"] = ccp.DeleteExistingPeering - } - return json.Marshal(objectMap) -} - -// ConnectivityConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ConnectivityConfigurationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ConnectivityConfigurationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ConnectivityConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ConnectivityConfigurationsDeleteFuture.Result. -func (future *ConnectivityConfigurationsDeleteFuture) result(client ConnectivityConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ConnectivityConfigurationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ConnectivityDestination parameters that define destination of connection. -type ConnectivityDestination struct { - // ResourceID - The ID of the resource to which a connection attempt will be made. - ResourceID *string `json:"resourceId,omitempty"` - // Address - The IP address or URI the resource to which a connection attempt will be made. - Address *string `json:"address,omitempty"` - // Port - Port on which check connectivity will be performed. - Port *int32 `json:"port,omitempty"` -} - -// ConnectivityGroupItem connectivity group item. -type ConnectivityGroupItem struct { - // NetworkGroupID - Network group Id. - NetworkGroupID *string `json:"networkGroupId,omitempty"` - // UseHubGateway - Flag if need to use hub gateway. Possible values include: 'UseHubGatewayFalse', 'UseHubGatewayTrue' - UseHubGateway UseHubGateway `json:"useHubGateway,omitempty"` - // IsGlobal - Flag if global is supported. Possible values include: 'IsGlobalFalse', 'IsGlobalTrue' - IsGlobal IsGlobal `json:"isGlobal,omitempty"` - // GroupConnectivity - Group connectivity type. Possible values include: 'GroupConnectivityNone', 'GroupConnectivityDirectlyConnected' - GroupConnectivity GroupConnectivity `json:"groupConnectivity,omitempty"` -} - -// ConnectivityHop information about a hop between the source and the destination. -type ConnectivityHop struct { - // Type - READ-ONLY; The type of the hop. - Type *string `json:"type,omitempty"` - // ID - READ-ONLY; The ID of the hop. - ID *string `json:"id,omitempty"` - // Address - READ-ONLY; The IP address of the hop. - Address *string `json:"address,omitempty"` - // ResourceID - READ-ONLY; The ID of the resource corresponding to this hop. - ResourceID *string `json:"resourceId,omitempty"` - // NextHopIds - READ-ONLY; List of next hop identifiers. - NextHopIds *[]string `json:"nextHopIds,omitempty"` - // PreviousHopIds - READ-ONLY; List of previous hop identifiers. - PreviousHopIds *[]string `json:"previousHopIds,omitempty"` - // Links - READ-ONLY; List of hop links. - Links *[]HopLink `json:"links,omitempty"` - // PreviousLinks - READ-ONLY; List of previous hop links. - PreviousLinks *[]HopLink `json:"previousLinks,omitempty"` - // Issues - READ-ONLY; List of issues. - Issues *[]ConnectivityIssue `json:"issues,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectivityHop. -func (ch ConnectivityHop) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ConnectivityInformation information on the connectivity status. -type ConnectivityInformation struct { - autorest.Response `json:"-"` - // Hops - READ-ONLY; List of hops between the source and the destination. - Hops *[]ConnectivityHop `json:"hops,omitempty"` - // ConnectionStatus - READ-ONLY; The connection status. Possible values include: 'ConnectionStatusUnknown', 'ConnectionStatusConnected', 'ConnectionStatusDisconnected', 'ConnectionStatusDegraded' - ConnectionStatus ConnectionStatus `json:"connectionStatus,omitempty"` - // AvgLatencyInMs - READ-ONLY; Average latency in milliseconds. - AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"` - // MinLatencyInMs - READ-ONLY; Minimum latency in milliseconds. - MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"` - // MaxLatencyInMs - READ-ONLY; Maximum latency in milliseconds. - MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"` - // ProbesSent - READ-ONLY; Total number of probes sent. - ProbesSent *int32 `json:"probesSent,omitempty"` - // ProbesFailed - READ-ONLY; Number of failed probes. - ProbesFailed *int32 `json:"probesFailed,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectivityInformation. -func (ci ConnectivityInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ConnectivityIssue information about an issue encountered in the process of checking for connectivity. -type ConnectivityIssue struct { - // Origin - READ-ONLY; The origin of the issue. Possible values include: 'OriginLocal', 'OriginInbound', 'OriginOutbound' - Origin Origin `json:"origin,omitempty"` - // Severity - READ-ONLY; The severity of the issue. Possible values include: 'SeverityError', 'SeverityWarning' - Severity Severity `json:"severity,omitempty"` - // Type - READ-ONLY; The type of issue. Possible values include: 'IssueTypeUnknown', 'IssueTypeAgentStopped', 'IssueTypeGuestFirewall', 'IssueTypeDNSResolution', 'IssueTypeSocketBind', 'IssueTypeNetworkSecurityRule', 'IssueTypeUserDefinedRoute', 'IssueTypePortThrottled', 'IssueTypePlatform' - Type IssueType `json:"type,omitempty"` - // Context - READ-ONLY; Provides additional context on the issue. - Context *[]map[string]*string `json:"context,omitempty"` -} - -// MarshalJSON is the custom marshaler for ConnectivityIssue. -func (ci ConnectivityIssue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ConnectivityParameters parameters that determine how the connectivity check will be performed. -type ConnectivityParameters struct { - // Source - The source of the connection. - Source *ConnectivitySource `json:"source,omitempty"` - // Destination - The destination of connection. - Destination *ConnectivityDestination `json:"destination,omitempty"` - // Protocol - Network protocol. Possible values include: 'ProtocolTCP', 'ProtocolHTTP', 'ProtocolHTTPS', 'ProtocolIcmp' - Protocol Protocol `json:"protocol,omitempty"` - // ProtocolConfiguration - Configuration of the protocol. - ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"` - // PreferredIPVersion - Preferred IP version of the connection. Possible values include: 'IPv4', 'IPv6' - PreferredIPVersion IPVersion `json:"preferredIPVersion,omitempty"` -} - -// ConnectivitySource parameters that define the source of the connection. -type ConnectivitySource struct { - // ResourceID - The ID of the resource from which a connectivity check will be initiated. - ResourceID *string `json:"resourceId,omitempty"` - // Port - The source port from which a connectivity check will be performed. - Port *int32 `json:"port,omitempty"` -} - -// Container reference to container resource in remote resource provider. -type Container struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// ContainerNetworkInterface container network interface child resource. -type ContainerNetworkInterface struct { - // ContainerNetworkInterfacePropertiesFormat - Container network interface properties. - *ContainerNetworkInterfacePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterface. -func (cni ContainerNetworkInterface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cni.ContainerNetworkInterfacePropertiesFormat != nil { - objectMap["properties"] = cni.ContainerNetworkInterfacePropertiesFormat - } - if cni.Name != nil { - objectMap["name"] = cni.Name - } - if cni.ID != nil { - objectMap["id"] = cni.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ContainerNetworkInterface struct. -func (cni *ContainerNetworkInterface) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerNetworkInterfacePropertiesFormat ContainerNetworkInterfacePropertiesFormat - err = json.Unmarshal(*v, &containerNetworkInterfacePropertiesFormat) - if err != nil { - return err - } - cni.ContainerNetworkInterfacePropertiesFormat = &containerNetworkInterfacePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cni.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cni.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cni.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cni.ID = &ID - } - } - } - - return nil -} - -// ContainerNetworkInterfaceConfiguration container network interface configuration child resource. -type ContainerNetworkInterfaceConfiguration struct { - // ContainerNetworkInterfaceConfigurationPropertiesFormat - Container network interface configuration properties. - *ContainerNetworkInterfaceConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceConfiguration. -func (cnic ContainerNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat != nil { - objectMap["properties"] = cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat - } - if cnic.Name != nil { - objectMap["name"] = cnic.Name - } - if cnic.ID != nil { - objectMap["id"] = cnic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ContainerNetworkInterfaceConfiguration struct. -func (cnic *ContainerNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerNetworkInterfaceConfigurationPropertiesFormat ContainerNetworkInterfaceConfigurationPropertiesFormat - err = json.Unmarshal(*v, &containerNetworkInterfaceConfigurationPropertiesFormat) - if err != nil { - return err - } - cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat = &containerNetworkInterfaceConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cnic.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cnic.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cnic.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cnic.ID = &ID - } - } - } - - return nil -} - -// ContainerNetworkInterfaceConfigurationPropertiesFormat container network interface configuration -// properties. -type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { - // IPConfigurations - A list of ip configurations of the container network interface configuration. - IPConfigurations *[]IPConfigurationProfile `json:"ipConfigurations,omitempty"` - // ContainerNetworkInterfaces - A list of container network interfaces created from this container network interface configuration. - ContainerNetworkInterfaces *[]SubResource `json:"containerNetworkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceConfigurationPropertiesFormat. -func (cnicpf ContainerNetworkInterfaceConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cnicpf.IPConfigurations != nil { - objectMap["ipConfigurations"] = cnicpf.IPConfigurations - } - if cnicpf.ContainerNetworkInterfaces != nil { - objectMap["containerNetworkInterfaces"] = cnicpf.ContainerNetworkInterfaces - } - return json.Marshal(objectMap) -} - -// ContainerNetworkInterfaceIPConfiguration the ip configuration for a container network interface. -type ContainerNetworkInterfaceIPConfiguration struct { - // ContainerNetworkInterfaceIPConfigurationPropertiesFormat - Properties of the container network interface IP configuration. - *ContainerNetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceIPConfiguration. -func (cniic ContainerNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat - } - if cniic.Name != nil { - objectMap["name"] = cniic.Name - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ContainerNetworkInterfaceIPConfiguration struct. -func (cniic *ContainerNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerNetworkInterfaceIPConfigurationPropertiesFormat ContainerNetworkInterfaceIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &containerNetworkInterfaceIPConfigurationPropertiesFormat) - if err != nil { - return err - } - cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat = &containerNetworkInterfaceIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cniic.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cniic.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cniic.Etag = &etag - } - } - } - - return nil -} - -// ContainerNetworkInterfaceIPConfigurationPropertiesFormat properties of the container network interface -// IP configuration. -type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfaceIPConfigurationPropertiesFormat. -func (cniicpf ContainerNetworkInterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ContainerNetworkInterfacePropertiesFormat properties of container network interface. -type ContainerNetworkInterfacePropertiesFormat struct { - // ContainerNetworkInterfaceConfiguration - READ-ONLY; Container network interface configuration from which this container network interface is created. - ContainerNetworkInterfaceConfiguration *ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfiguration,omitempty"` - // Container - Reference to the container to which this container network interface is attached. - Container *Container `json:"container,omitempty"` - // IPConfigurations - READ-ONLY; Reference to the ip configuration on this container nic. - IPConfigurations *[]ContainerNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the container network interface resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerNetworkInterfacePropertiesFormat. -func (cnipf ContainerNetworkInterfacePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cnipf.Container != nil { - objectMap["container"] = cnipf.Container - } - return json.Marshal(objectMap) -} - -// Criterion a matching criteria which matches routes based on route prefix, community, and AS path. -type Criterion struct { - // RoutePrefix - List of route prefixes which this criteria matches. - RoutePrefix *[]string `json:"routePrefix,omitempty"` - // Community - List of BGP communities which this criteria matches. - Community *[]string `json:"community,omitempty"` - // AsPath - List of AS paths which this criteria matches. - AsPath *[]string `json:"asPath,omitempty"` - // MatchCondition - Match condition to apply RouteMap rules. Possible values include: 'RouteMapMatchConditionUnknown', 'RouteMapMatchConditionContains', 'RouteMapMatchConditionEquals', 'RouteMapMatchConditionNotContains', 'RouteMapMatchConditionNotEquals' - MatchCondition RouteMapMatchCondition `json:"matchCondition,omitempty"` -} - -// CrossTenantScopes cross tenant scopes. -type CrossTenantScopes struct { - // TenantID - READ-ONLY; Tenant ID. - TenantID *string `json:"tenantId,omitempty"` - // ManagementGroups - READ-ONLY; List of management groups. - ManagementGroups *[]string `json:"managementGroups,omitempty"` - // Subscriptions - READ-ONLY; List of subscriptions. - Subscriptions *[]string `json:"subscriptions,omitempty"` -} - -// MarshalJSON is the custom marshaler for CrossTenantScopes. -func (cts CrossTenantScopes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CustomDNSConfigPropertiesFormat contains custom Dns resolution configuration from customer. -type CustomDNSConfigPropertiesFormat struct { - // Fqdn - Fqdn that resolves to private endpoint ip address. - Fqdn *string `json:"fqdn,omitempty"` - // IPAddresses - A list of private ip addresses of the private endpoint. - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} - -// CustomIPPrefix custom IP prefix resource. -type CustomIPPrefix struct { - autorest.Response `json:"-"` - // ExtendedLocation - The extended location of the custom IP prefix. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // CustomIPPrefixPropertiesFormat - Custom IP prefix properties. - *CustomIPPrefixPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for CustomIPPrefix. -func (cip CustomIPPrefix) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cip.ExtendedLocation != nil { - objectMap["extendedLocation"] = cip.ExtendedLocation - } - if cip.CustomIPPrefixPropertiesFormat != nil { - objectMap["properties"] = cip.CustomIPPrefixPropertiesFormat - } - if cip.Zones != nil { - objectMap["zones"] = cip.Zones - } - if cip.ID != nil { - objectMap["id"] = cip.ID - } - if cip.Location != nil { - objectMap["location"] = cip.Location - } - if cip.Tags != nil { - objectMap["tags"] = cip.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CustomIPPrefix struct. -func (cip *CustomIPPrefix) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - cip.ExtendedLocation = &extendedLocation - } - case "properties": - if v != nil { - var customIPPrefixPropertiesFormat CustomIPPrefixPropertiesFormat - err = json.Unmarshal(*v, &customIPPrefixPropertiesFormat) - if err != nil { - return err - } - cip.CustomIPPrefixPropertiesFormat = &customIPPrefixPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - cip.Etag = &etag - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - cip.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cip.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cip.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cip.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cip.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cip.Tags = tags - } - } - } - - return nil -} - -// CustomIPPrefixesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CustomIPPrefixesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CustomIPPrefixesClient) (CustomIPPrefix, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CustomIPPrefixesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CustomIPPrefixesCreateOrUpdateFuture.Result. -func (future *CustomIPPrefixesCreateOrUpdateFuture) result(client CustomIPPrefixesClient) (cip CustomIPPrefix, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cip.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.CustomIPPrefixesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cip.Response.Response, err = future.GetResult(sender); err == nil && cip.Response.Response.StatusCode != http.StatusNoContent { - cip, err = client.CreateOrUpdateResponder(cip.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesCreateOrUpdateFuture", "Result", cip.Response.Response, "Failure responding to request") - } - } - return -} - -// CustomIPPrefixesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type CustomIPPrefixesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CustomIPPrefixesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CustomIPPrefixesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for CustomIPPrefixesDeleteFuture.Result. -func (future *CustomIPPrefixesDeleteFuture) result(client CustomIPPrefixesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.CustomIPPrefixesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.CustomIPPrefixesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// CustomIPPrefixListResult response for ListCustomIpPrefixes API service call. -type CustomIPPrefixListResult struct { - autorest.Response `json:"-"` - // Value - A list of Custom IP prefixes that exists in a resource group. - Value *[]CustomIPPrefix `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// CustomIPPrefixListResultIterator provides access to a complete listing of CustomIPPrefix values. -type CustomIPPrefixListResultIterator struct { - i int - page CustomIPPrefixListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *CustomIPPrefixListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *CustomIPPrefixListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CustomIPPrefixListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter CustomIPPrefixListResultIterator) Response() CustomIPPrefixListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter CustomIPPrefixListResultIterator) Value() CustomIPPrefix { - if !iter.page.NotDone() { - return CustomIPPrefix{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the CustomIPPrefixListResultIterator type. -func NewCustomIPPrefixListResultIterator(page CustomIPPrefixListResultPage) CustomIPPrefixListResultIterator { - return CustomIPPrefixListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ciplr CustomIPPrefixListResult) IsEmpty() bool { - return ciplr.Value == nil || len(*ciplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ciplr CustomIPPrefixListResult) hasNextLink() bool { - return ciplr.NextLink != nil && len(*ciplr.NextLink) != 0 -} - -// customIPPrefixListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ciplr CustomIPPrefixListResult) customIPPrefixListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ciplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ciplr.NextLink))) -} - -// CustomIPPrefixListResultPage contains a page of CustomIPPrefix values. -type CustomIPPrefixListResultPage struct { - fn func(context.Context, CustomIPPrefixListResult) (CustomIPPrefixListResult, error) - ciplr CustomIPPrefixListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *CustomIPPrefixListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CustomIPPrefixListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ciplr) - if err != nil { - return err - } - page.ciplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *CustomIPPrefixListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CustomIPPrefixListResultPage) NotDone() bool { - return !page.ciplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page CustomIPPrefixListResultPage) Response() CustomIPPrefixListResult { - return page.ciplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page CustomIPPrefixListResultPage) Values() []CustomIPPrefix { - if page.ciplr.IsEmpty() { - return nil - } - return *page.ciplr.Value -} - -// Creates a new instance of the CustomIPPrefixListResultPage type. -func NewCustomIPPrefixListResultPage(cur CustomIPPrefixListResult, getNextPage func(context.Context, CustomIPPrefixListResult) (CustomIPPrefixListResult, error)) CustomIPPrefixListResultPage { - return CustomIPPrefixListResultPage{ - fn: getNextPage, - ciplr: cur, - } -} - -// CustomIPPrefixPropertiesFormat custom IP prefix properties. -type CustomIPPrefixPropertiesFormat struct { - // Asn - The ASN for CIDR advertising. Should be an integer as string. - Asn *string `json:"asn,omitempty"` - // Cidr - The prefix range in CIDR notation. Should include the start address and the prefix length. - Cidr *string `json:"cidr,omitempty"` - // SignedMessage - Signed message for WAN validation. - SignedMessage *string `json:"signedMessage,omitempty"` - // AuthorizationMessage - Authorization message for WAN validation. - AuthorizationMessage *string `json:"authorizationMessage,omitempty"` - // CustomIPPrefixParent - The Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. - CustomIPPrefixParent *SubResource `json:"customIpPrefixParent,omitempty"` - // ChildCustomIPPrefixes - READ-ONLY; The list of all Children for IPv6 /48 CustomIpPrefix. - ChildCustomIPPrefixes *[]SubResource `json:"childCustomIpPrefixes,omitempty"` - // CommissionedState - The commissioned state of the Custom IP Prefix. Possible values include: 'Provisioning', 'Provisioned', 'Commissioning', 'CommissionedNoInternetAdvertise', 'Commissioned', 'Decommissioning', 'Deprovisioning', 'Deprovisioned' - CommissionedState CommissionedState `json:"commissionedState,omitempty"` - // ExpressRouteAdvertise - Whether to do express route advertise. - ExpressRouteAdvertise *bool `json:"expressRouteAdvertise,omitempty"` - // Geo - The Geo for CIDR advertising. Should be an Geo code. Possible values include: 'GLOBAL', 'AFRI', 'APAC', 'EURO', 'LATAM', 'NAM', 'ME', 'OCEANIA', 'AQ' - Geo Geo `json:"geo,omitempty"` - // NoInternetAdvertise - Whether to Advertise the range to Internet. - NoInternetAdvertise *bool `json:"noInternetAdvertise,omitempty"` - // PrefixType - Type of custom IP prefix. Should be Singular, Parent, or Child. Possible values include: 'Singular', 'Parent', 'Child' - PrefixType CustomIPPrefixType `json:"prefixType,omitempty"` - // PublicIPPrefixes - READ-ONLY; The list of all referenced PublicIpPrefixes. - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the custom IP prefix resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // FailedReason - READ-ONLY; The reason why resource is in failed state. - FailedReason *string `json:"failedReason,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the custom IP prefix resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for CustomIPPrefixPropertiesFormat. -func (cippf CustomIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cippf.Asn != nil { - objectMap["asn"] = cippf.Asn - } - if cippf.Cidr != nil { - objectMap["cidr"] = cippf.Cidr - } - if cippf.SignedMessage != nil { - objectMap["signedMessage"] = cippf.SignedMessage - } - if cippf.AuthorizationMessage != nil { - objectMap["authorizationMessage"] = cippf.AuthorizationMessage - } - if cippf.CustomIPPrefixParent != nil { - objectMap["customIpPrefixParent"] = cippf.CustomIPPrefixParent - } - if cippf.CommissionedState != "" { - objectMap["commissionedState"] = cippf.CommissionedState - } - if cippf.ExpressRouteAdvertise != nil { - objectMap["expressRouteAdvertise"] = cippf.ExpressRouteAdvertise - } - if cippf.Geo != "" { - objectMap["geo"] = cippf.Geo - } - if cippf.NoInternetAdvertise != nil { - objectMap["noInternetAdvertise"] = cippf.NoInternetAdvertise - } - if cippf.PrefixType != "" { - objectMap["prefixType"] = cippf.PrefixType - } - return json.Marshal(objectMap) -} - -// DdosCustomPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DdosCustomPoliciesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DdosCustomPoliciesClient) (DdosCustomPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DdosCustomPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DdosCustomPoliciesCreateOrUpdateFuture.Result. -func (future *DdosCustomPoliciesCreateOrUpdateFuture) result(client DdosCustomPoliciesClient) (dcp DdosCustomPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dcp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dcp.Response.Response, err = future.GetResult(sender); err == nil && dcp.Response.Response.StatusCode != http.StatusNoContent { - dcp, err = client.CreateOrUpdateResponder(dcp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesCreateOrUpdateFuture", "Result", dcp.Response.Response, "Failure responding to request") - } - } - return -} - -// DdosCustomPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DdosCustomPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DdosCustomPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DdosCustomPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DdosCustomPoliciesDeleteFuture.Result. -func (future *DdosCustomPoliciesDeleteFuture) result(client DdosCustomPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DdosCustomPolicy a DDoS custom policy in a resource group. -type DdosCustomPolicy struct { - autorest.Response `json:"-"` - // DdosCustomPolicyPropertiesFormat - Properties of the DDoS custom policy. - *DdosCustomPolicyPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DdosCustomPolicy. -func (dcp DdosCustomPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcp.DdosCustomPolicyPropertiesFormat != nil { - objectMap["properties"] = dcp.DdosCustomPolicyPropertiesFormat - } - if dcp.ID != nil { - objectMap["id"] = dcp.ID - } - if dcp.Location != nil { - objectMap["location"] = dcp.Location - } - if dcp.Tags != nil { - objectMap["tags"] = dcp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DdosCustomPolicy struct. -func (dcp *DdosCustomPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var ddosCustomPolicyPropertiesFormat DdosCustomPolicyPropertiesFormat - err = json.Unmarshal(*v, &ddosCustomPolicyPropertiesFormat) - if err != nil { - return err - } - dcp.DdosCustomPolicyPropertiesFormat = &ddosCustomPolicyPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - dcp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dcp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dcp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dcp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dcp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dcp.Tags = tags - } - } - } - - return nil -} - -// DdosCustomPolicyPropertiesFormat dDoS custom policy properties. -type DdosCustomPolicyPropertiesFormat struct { - // ResourceGUID - READ-ONLY; The resource GUID property of the DDoS custom policy resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the DDoS custom policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for DdosCustomPolicyPropertiesFormat. -func (dcppf DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DdosProtectionPlan a DDoS protection plan in a resource group. -type DdosProtectionPlan struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // DdosProtectionPlanPropertiesFormat - Properties of the DDoS protection plan. - *DdosProtectionPlanPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for DdosProtectionPlan. -func (dpp DdosProtectionPlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpp.Location != nil { - objectMap["location"] = dpp.Location - } - if dpp.Tags != nil { - objectMap["tags"] = dpp.Tags - } - if dpp.DdosProtectionPlanPropertiesFormat != nil { - objectMap["properties"] = dpp.DdosProtectionPlanPropertiesFormat - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DdosProtectionPlan struct. -func (dpp *DdosProtectionPlan) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dpp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dpp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dpp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dpp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dpp.Tags = tags - } - case "properties": - if v != nil { - var ddosProtectionPlanPropertiesFormat DdosProtectionPlanPropertiesFormat - err = json.Unmarshal(*v, &ddosProtectionPlanPropertiesFormat) - if err != nil { - return err - } - dpp.DdosProtectionPlanPropertiesFormat = &ddosProtectionPlanPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - dpp.Etag = &etag - } - } - } - - return nil -} - -// DdosProtectionPlanListResult a list of DDoS protection plans. -type DdosProtectionPlanListResult struct { - autorest.Response `json:"-"` - // Value - A list of DDoS protection plans. - Value *[]DdosProtectionPlan `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for DdosProtectionPlanListResult. -func (dpplr DdosProtectionPlanListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dpplr.Value != nil { - objectMap["value"] = dpplr.Value - } - return json.Marshal(objectMap) -} - -// DdosProtectionPlanListResultIterator provides access to a complete listing of DdosProtectionPlan values. -type DdosProtectionPlanListResultIterator struct { - i int - page DdosProtectionPlanListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DdosProtectionPlanListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlanListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DdosProtectionPlanListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DdosProtectionPlanListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DdosProtectionPlanListResultIterator) Response() DdosProtectionPlanListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DdosProtectionPlanListResultIterator) Value() DdosProtectionPlan { - if !iter.page.NotDone() { - return DdosProtectionPlan{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DdosProtectionPlanListResultIterator type. -func NewDdosProtectionPlanListResultIterator(page DdosProtectionPlanListResultPage) DdosProtectionPlanListResultIterator { - return DdosProtectionPlanListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dpplr DdosProtectionPlanListResult) IsEmpty() bool { - return dpplr.Value == nil || len(*dpplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dpplr DdosProtectionPlanListResult) hasNextLink() bool { - return dpplr.NextLink != nil && len(*dpplr.NextLink) != 0 -} - -// ddosProtectionPlanListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dpplr DdosProtectionPlanListResult) ddosProtectionPlanListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dpplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dpplr.NextLink))) -} - -// DdosProtectionPlanListResultPage contains a page of DdosProtectionPlan values. -type DdosProtectionPlanListResultPage struct { - fn func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error) - dpplr DdosProtectionPlanListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DdosProtectionPlanListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlanListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dpplr) - if err != nil { - return err - } - page.dpplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DdosProtectionPlanListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DdosProtectionPlanListResultPage) NotDone() bool { - return !page.dpplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DdosProtectionPlanListResultPage) Response() DdosProtectionPlanListResult { - return page.dpplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DdosProtectionPlanListResultPage) Values() []DdosProtectionPlan { - if page.dpplr.IsEmpty() { - return nil - } - return *page.dpplr.Value -} - -// Creates a new instance of the DdosProtectionPlanListResultPage type. -func NewDdosProtectionPlanListResultPage(cur DdosProtectionPlanListResult, getNextPage func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error)) DdosProtectionPlanListResultPage { - return DdosProtectionPlanListResultPage{ - fn: getNextPage, - dpplr: cur, - } -} - -// DdosProtectionPlanPropertiesFormat dDoS protection plan properties. -type DdosProtectionPlanPropertiesFormat struct { - // ResourceGUID - READ-ONLY; The resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the DDoS protection plan resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PublicIPAddresses - READ-ONLY; The list of public IPs associated with the DDoS protection plan resource. This list is read-only. - PublicIPAddresses *[]SubResource `json:"publicIPAddresses,omitempty"` - // VirtualNetworks - READ-ONLY; The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. - VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"` -} - -// MarshalJSON is the custom marshaler for DdosProtectionPlanPropertiesFormat. -func (dpppf DdosProtectionPlanPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DdosProtectionPlansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DdosProtectionPlansCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DdosProtectionPlansClient) (DdosProtectionPlan, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DdosProtectionPlansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DdosProtectionPlansCreateOrUpdateFuture.Result. -func (future *DdosProtectionPlansCreateOrUpdateFuture) result(client DdosProtectionPlansClient) (dpp DdosProtectionPlan, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dpp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dpp.Response.Response, err = future.GetResult(sender); err == nil && dpp.Response.Response.StatusCode != http.StatusNoContent { - dpp, err = client.CreateOrUpdateResponder(dpp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansCreateOrUpdateFuture", "Result", dpp.Response.Response, "Failure responding to request") - } - } - return -} - -// DdosProtectionPlansDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DdosProtectionPlansDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DdosProtectionPlansClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DdosProtectionPlansDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DdosProtectionPlansDeleteFuture.Result. -func (future *DdosProtectionPlansDeleteFuture) result(client DdosProtectionPlansClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DdosSettings contains the DDoS protection settings of the public IP. -type DdosSettings struct { - // ProtectionMode - The DDoS protection mode of the public IP. Possible values include: 'DdosSettingsProtectionModeVirtualNetworkInherited', 'DdosSettingsProtectionModeEnabled', 'DdosSettingsProtectionModeDisabled' - ProtectionMode DdosSettingsProtectionMode `json:"protectionMode,omitempty"` - // DdosProtectionPlan - The DDoS protection plan associated with the public IP. Can only be set if ProtectionMode is Enabled - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` -} - -// DefaultAdminPropertiesFormat security default admin rule resource. -type DefaultAdminPropertiesFormat struct { - // Description - READ-ONLY; A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - // Flag - Default rule flag. - Flag *string `json:"flag,omitempty"` - // Protocol - READ-ONLY; Network protocol this rule applies to. Possible values include: 'SecurityConfigurationRuleProtocolTCP', 'SecurityConfigurationRuleProtocolUDP', 'SecurityConfigurationRuleProtocolIcmp', 'SecurityConfigurationRuleProtocolEsp', 'SecurityConfigurationRuleProtocolAny', 'SecurityConfigurationRuleProtocolAh' - Protocol SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - // Sources - READ-ONLY; The CIDR or source IP ranges. - Sources *[]AddressPrefixItem `json:"sources,omitempty"` - // Destinations - READ-ONLY; The destination address prefixes. CIDR or destination IP ranges. - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - // SourcePortRanges - READ-ONLY; The source port ranges. - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - // DestinationPortRanges - READ-ONLY; The destination port ranges. - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - // Access - READ-ONLY; Indicates the access allowed for this particular rule. Possible values include: 'SecurityConfigurationRuleAccessAllow', 'SecurityConfigurationRuleAccessDeny', 'SecurityConfigurationRuleAccessAlwaysAllow' - Access SecurityConfigurationRuleAccess `json:"access,omitempty"` - // Priority - READ-ONLY; The priority of the rule. The value can be between 1 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. - Priority *int32 `json:"priority,omitempty"` - // Direction - READ-ONLY; Indicates if the traffic matched against the rule in inbound or outbound. Possible values include: 'SecurityConfigurationRuleDirectionInbound', 'SecurityConfigurationRuleDirectionOutbound' - Direction SecurityConfigurationRuleDirection `json:"direction,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for DefaultAdminPropertiesFormat. -func (dapf DefaultAdminPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dapf.Flag != nil { - objectMap["flag"] = dapf.Flag - } - return json.Marshal(objectMap) -} - -// DefaultAdminRule network default admin rule. -type DefaultAdminRule struct { - // DefaultAdminPropertiesFormat - Indicates the properties of the security admin rule - *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // Kind - Possible values include: 'KindBasicBaseAdminRuleKindBaseAdminRule', 'KindBasicBaseAdminRuleKindCustom', 'KindBasicBaseAdminRuleKindDefault' - Kind KindBasicBaseAdminRule `json:"kind,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for DefaultAdminRule. -func (dar DefaultAdminRule) MarshalJSON() ([]byte, error) { - dar.Kind = KindBasicBaseAdminRuleKindDefault - objectMap := make(map[string]interface{}) - if dar.DefaultAdminPropertiesFormat != nil { - objectMap["properties"] = dar.DefaultAdminPropertiesFormat - } - if dar.Kind != "" { - objectMap["kind"] = dar.Kind - } - return json.Marshal(objectMap) -} - -// AsAdminRule is the BasicBaseAdminRule implementation for DefaultAdminRule. -func (dar DefaultAdminRule) AsAdminRule() (*AdminRule, bool) { - return nil, false -} - -// AsDefaultAdminRule is the BasicBaseAdminRule implementation for DefaultAdminRule. -func (dar DefaultAdminRule) AsDefaultAdminRule() (*DefaultAdminRule, bool) { - return &dar, true -} - -// AsBaseAdminRule is the BasicBaseAdminRule implementation for DefaultAdminRule. -func (dar DefaultAdminRule) AsBaseAdminRule() (*BaseAdminRule, bool) { - return nil, false -} - -// AsBasicBaseAdminRule is the BasicBaseAdminRule implementation for DefaultAdminRule. -func (dar DefaultAdminRule) AsBasicBaseAdminRule() (BasicBaseAdminRule, bool) { - return &dar, true -} - -// UnmarshalJSON is the custom unmarshaler for DefaultAdminRule struct. -func (dar *DefaultAdminRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var defaultAdminPropertiesFormat DefaultAdminPropertiesFormat - err = json.Unmarshal(*v, &defaultAdminPropertiesFormat) - if err != nil { - return err - } - dar.DefaultAdminPropertiesFormat = &defaultAdminPropertiesFormat - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - dar.SystemData = &systemData - } - case "kind": - if v != nil { - var kind KindBasicBaseAdminRule - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - dar.Kind = kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dar.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - dar.Etag = &etag - } - } - } - - return nil -} - -// DefaultRuleSetPropertyFormat the default web application firewall rule set. -type DefaultRuleSetPropertyFormat struct { - // RuleSetType - The type of the web application firewall rule set. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - The version of the web application firewall rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` -} - -// Delegation details the service to which the subnet is delegated. -type Delegation struct { - // ServiceDelegationPropertiesFormat - Properties of the subnet. - *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a subnet. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Delegation. -func (d Delegation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.ServiceDelegationPropertiesFormat != nil { - objectMap["properties"] = d.ServiceDelegationPropertiesFormat - } - if d.Name != nil { - objectMap["name"] = d.Name - } - if d.Type != nil { - objectMap["type"] = d.Type - } - if d.ID != nil { - objectMap["id"] = d.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Delegation struct. -func (d *Delegation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceDelegationPropertiesFormat ServiceDelegationPropertiesFormat - err = json.Unmarshal(*v, &serviceDelegationPropertiesFormat) - if err != nil { - return err - } - d.ServiceDelegationPropertiesFormat = &serviceDelegationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - d.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - d.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - d.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - d.ID = &ID - } - } - } - - return nil -} - -// DelegationProperties properties of the delegation. -type DelegationProperties struct { - // ServiceName - The service name to which the NVA is delegated. - ServiceName *string `json:"serviceName,omitempty"` - // ProvisioningState - READ-ONLY; Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for DelegationProperties. -func (dp DelegationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.ServiceName != nil { - objectMap["serviceName"] = dp.ServiceName - } - return json.Marshal(objectMap) -} - -// DeleteBastionShareableLinkFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DeleteBastionShareableLinkFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DeleteBastionShareableLinkFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DeleteBastionShareableLinkFuture.Result. -func (future *DeleteBastionShareableLinkFuture) result(client BaseClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DeleteBastionShareableLinkFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DeleteBastionShareableLinkFuture") - return - } - ar.Response = future.Response() - return -} - -// DeviceProperties list of properties of the device. -type DeviceProperties struct { - // DeviceVendor - Name of the device Vendor. - DeviceVendor *string `json:"deviceVendor,omitempty"` - // DeviceModel - Model of the device. - DeviceModel *string `json:"deviceModel,omitempty"` - // LinkSpeedInMbps - Link speed. - LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` -} - -// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual -// network. Standard DHCP option for a subnet overrides VNET DHCP options. -type DhcpOptions struct { - // DNSServers - The list of DNS servers IP addresses. - DNSServers *[]string `json:"dnsServers,omitempty"` -} - -// Dimension dimension of the metric. -type Dimension struct { - // Name - The name of the dimension. - Name *string `json:"name,omitempty"` - // DisplayName - The display name of the dimension. - DisplayName *string `json:"displayName,omitempty"` - // InternalName - The internal name of the dimension. - InternalName *string `json:"internalName,omitempty"` -} - -// DNSNameAvailabilityResult response for the CheckDnsNameAvailability API service call. -type DNSNameAvailabilityResult struct { - autorest.Response `json:"-"` - // Available - Domain availability (True/False). - Available *bool `json:"available,omitempty"` -} - -// DNSSettings DNS Proxy Settings in Firewall Policy. -type DNSSettings struct { - // Servers - List of Custom DNS Servers. - Servers *[]string `json:"servers,omitempty"` - // EnableProxy - Enable DNS Proxy on Firewalls attached to the Firewall Policy. - EnableProxy *bool `json:"enableProxy,omitempty"` - // RequireProxyForNetworkRules - FQDNs in Network Rules are supported when set to true. - RequireProxyForNetworkRules *bool `json:"requireProxyForNetworkRules,omitempty"` -} - -// DscpConfiguration differentiated Services Code Point configuration for any given network interface -type DscpConfiguration struct { - autorest.Response `json:"-"` - // DscpConfigurationPropertiesFormat - Properties of the network interface. - *DscpConfigurationPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DscpConfiguration. -func (dc DscpConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dc.DscpConfigurationPropertiesFormat != nil { - objectMap["properties"] = dc.DscpConfigurationPropertiesFormat - } - if dc.ID != nil { - objectMap["id"] = dc.ID - } - if dc.Location != nil { - objectMap["location"] = dc.Location - } - if dc.Tags != nil { - objectMap["tags"] = dc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DscpConfiguration struct. -func (dc *DscpConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dscpConfigurationPropertiesFormat DscpConfigurationPropertiesFormat - err = json.Unmarshal(*v, &dscpConfigurationPropertiesFormat) - if err != nil { - return err - } - dc.DscpConfigurationPropertiesFormat = &dscpConfigurationPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - dc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dc.Tags = tags - } - } - } - - return nil -} - -// DscpConfigurationCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DscpConfigurationCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DscpConfigurationClient) (DscpConfiguration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DscpConfigurationCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DscpConfigurationCreateOrUpdateFuture.Result. -func (future *DscpConfigurationCreateOrUpdateFuture) result(client DscpConfigurationClient) (dc DscpConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DscpConfigurationCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dc.Response.Response, err = future.GetResult(sender); err == nil && dc.Response.Response.StatusCode != http.StatusNoContent { - dc, err = client.CreateOrUpdateResponder(dc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationCreateOrUpdateFuture", "Result", dc.Response.Response, "Failure responding to request") - } - } - return -} - -// DscpConfigurationDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DscpConfigurationDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DscpConfigurationClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DscpConfigurationDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DscpConfigurationDeleteFuture.Result. -func (future *DscpConfigurationDeleteFuture) result(client DscpConfigurationClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.DscpConfigurationDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.DscpConfigurationDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DscpConfigurationListResult response for the DscpConfigurationList API service call. -type DscpConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - A list of dscp configurations in a resource group. - Value *[]DscpConfiguration `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscpConfigurationListResult. -func (dclr DscpConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dclr.Value != nil { - objectMap["value"] = dclr.Value - } - return json.Marshal(objectMap) -} - -// DscpConfigurationListResultIterator provides access to a complete listing of DscpConfiguration values. -type DscpConfigurationListResultIterator struct { - i int - page DscpConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DscpConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DscpConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DscpConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DscpConfigurationListResultIterator) Response() DscpConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DscpConfigurationListResultIterator) Value() DscpConfiguration { - if !iter.page.NotDone() { - return DscpConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DscpConfigurationListResultIterator type. -func NewDscpConfigurationListResultIterator(page DscpConfigurationListResultPage) DscpConfigurationListResultIterator { - return DscpConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dclr DscpConfigurationListResult) IsEmpty() bool { - return dclr.Value == nil || len(*dclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dclr DscpConfigurationListResult) hasNextLink() bool { - return dclr.NextLink != nil && len(*dclr.NextLink) != 0 -} - -// dscpConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dclr DscpConfigurationListResult) dscpConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dclr.NextLink))) -} - -// DscpConfigurationListResultPage contains a page of DscpConfiguration values. -type DscpConfigurationListResultPage struct { - fn func(context.Context, DscpConfigurationListResult) (DscpConfigurationListResult, error) - dclr DscpConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DscpConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DscpConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dclr) - if err != nil { - return err - } - page.dclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DscpConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DscpConfigurationListResultPage) NotDone() bool { - return !page.dclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DscpConfigurationListResultPage) Response() DscpConfigurationListResult { - return page.dclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DscpConfigurationListResultPage) Values() []DscpConfiguration { - if page.dclr.IsEmpty() { - return nil - } - return *page.dclr.Value -} - -// Creates a new instance of the DscpConfigurationListResultPage type. -func NewDscpConfigurationListResultPage(cur DscpConfigurationListResult, getNextPage func(context.Context, DscpConfigurationListResult) (DscpConfigurationListResult, error)) DscpConfigurationListResultPage { - return DscpConfigurationListResultPage{ - fn: getNextPage, - dclr: cur, - } -} - -// DscpConfigurationPropertiesFormat differentiated Services Code Point configuration properties. -type DscpConfigurationPropertiesFormat struct { - // Markings - List of markings to be used in the configuration. - Markings *[]int32 `json:"markings,omitempty"` - // SourceIPRanges - Source IP ranges. - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - // DestinationIPRanges - Destination IP ranges. - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - // SourcePortRanges - Sources port ranges. - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` - // DestinationPortRanges - Destination port ranges. - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - // Protocol - RNM supported protocol types. Possible values include: 'ProtocolTypeDoNotUse', 'ProtocolTypeIcmp', 'ProtocolTypeTCP', 'ProtocolTypeUDP', 'ProtocolTypeGre', 'ProtocolTypeEsp', 'ProtocolTypeAh', 'ProtocolTypeVxlan', 'ProtocolTypeAll' - Protocol ProtocolType `json:"protocol,omitempty"` - // QosDefinitionCollection - QoS object definitions - QosDefinitionCollection *[]QosDefinition `json:"qosDefinitionCollection,omitempty"` - // QosCollectionID - READ-ONLY; Qos Collection ID generated by RNM. - QosCollectionID *string `json:"qosCollectionId,omitempty"` - // AssociatedNetworkInterfaces - READ-ONLY; Associated Network Interfaces to the DSCP Configuration. - AssociatedNetworkInterfaces *[]Interface `json:"associatedNetworkInterfaces,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the DSCP Configuration resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the DSCP Configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for DscpConfigurationPropertiesFormat. -func (dcpf DscpConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dcpf.Markings != nil { - objectMap["markings"] = dcpf.Markings - } - if dcpf.SourceIPRanges != nil { - objectMap["sourceIpRanges"] = dcpf.SourceIPRanges - } - if dcpf.DestinationIPRanges != nil { - objectMap["destinationIpRanges"] = dcpf.DestinationIPRanges - } - if dcpf.SourcePortRanges != nil { - objectMap["sourcePortRanges"] = dcpf.SourcePortRanges - } - if dcpf.DestinationPortRanges != nil { - objectMap["destinationPortRanges"] = dcpf.DestinationPortRanges - } - if dcpf.Protocol != "" { - objectMap["protocol"] = dcpf.Protocol - } - if dcpf.QosDefinitionCollection != nil { - objectMap["qosDefinitionCollection"] = dcpf.QosDefinitionCollection - } - return json.Marshal(objectMap) -} - -// BasicEffectiveBaseSecurityAdminRule network base admin rule. -type BasicEffectiveBaseSecurityAdminRule interface { - AsEffectiveSecurityAdminRule() (*EffectiveSecurityAdminRule, bool) - AsEffectiveDefaultSecurityAdminRule() (*EffectiveDefaultSecurityAdminRule, bool) - AsEffectiveBaseSecurityAdminRule() (*EffectiveBaseSecurityAdminRule, bool) -} - -// EffectiveBaseSecurityAdminRule network base admin rule. -type EffectiveBaseSecurityAdminRule struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // ConfigurationDescription - A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - // RuleCollectionDescription - A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - // RuleCollectionAppliesToGroups - Groups for rule collection - RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - // RuleGroups - Effective configuration groups. - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` - // Kind - Possible values include: 'KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule', 'KindBasicEffectiveBaseSecurityAdminRuleKindCustom', 'KindBasicEffectiveBaseSecurityAdminRuleKindDefault' - Kind KindBasicEffectiveBaseSecurityAdminRule `json:"kind,omitempty"` -} - -func unmarshalBasicEffectiveBaseSecurityAdminRule(body []byte) (BasicEffectiveBaseSecurityAdminRule, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["kind"] { - case string(KindBasicEffectiveBaseSecurityAdminRuleKindCustom): - var esar EffectiveSecurityAdminRule - err := json.Unmarshal(body, &esar) - return esar, err - case string(KindBasicEffectiveBaseSecurityAdminRuleKindDefault): - var edsar EffectiveDefaultSecurityAdminRule - err := json.Unmarshal(body, &edsar) - return edsar, err - default: - var ebsar EffectiveBaseSecurityAdminRule - err := json.Unmarshal(body, &ebsar) - return ebsar, err - } -} -func unmarshalBasicEffectiveBaseSecurityAdminRuleArray(body []byte) ([]BasicEffectiveBaseSecurityAdminRule, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - ebsarArray := make([]BasicEffectiveBaseSecurityAdminRule, len(rawMessages)) - - for index, rawMessage := range rawMessages { - ebsar, err := unmarshalBasicEffectiveBaseSecurityAdminRule(*rawMessage) - if err != nil { - return nil, err - } - ebsarArray[index] = ebsar - } - return ebsarArray, nil -} - -// MarshalJSON is the custom marshaler for EffectiveBaseSecurityAdminRule. -func (ebsar EffectiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { - ebsar.Kind = KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule - objectMap := make(map[string]interface{}) - if ebsar.ID != nil { - objectMap["id"] = ebsar.ID - } - if ebsar.ConfigurationDescription != nil { - objectMap["configurationDescription"] = ebsar.ConfigurationDescription - } - if ebsar.RuleCollectionDescription != nil { - objectMap["ruleCollectionDescription"] = ebsar.RuleCollectionDescription - } - if ebsar.RuleCollectionAppliesToGroups != nil { - objectMap["ruleCollectionAppliesToGroups"] = ebsar.RuleCollectionAppliesToGroups - } - if ebsar.RuleGroups != nil { - objectMap["ruleGroups"] = ebsar.RuleGroups - } - if ebsar.Kind != "" { - objectMap["kind"] = ebsar.Kind - } - return json.Marshal(objectMap) -} - -// AsEffectiveSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveBaseSecurityAdminRule. -func (ebsar EffectiveBaseSecurityAdminRule) AsEffectiveSecurityAdminRule() (*EffectiveSecurityAdminRule, bool) { - return nil, false -} - -// AsEffectiveDefaultSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveBaseSecurityAdminRule. -func (ebsar EffectiveBaseSecurityAdminRule) AsEffectiveDefaultSecurityAdminRule() (*EffectiveDefaultSecurityAdminRule, bool) { - return nil, false -} - -// AsEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveBaseSecurityAdminRule. -func (ebsar EffectiveBaseSecurityAdminRule) AsEffectiveBaseSecurityAdminRule() (*EffectiveBaseSecurityAdminRule, bool) { - return &ebsar, true -} - -// AsBasicEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveBaseSecurityAdminRule. -func (ebsar EffectiveBaseSecurityAdminRule) AsBasicEffectiveBaseSecurityAdminRule() (BasicEffectiveBaseSecurityAdminRule, bool) { - return &ebsar, true -} - -// EffectiveConnectivityConfiguration the network manager effective connectivity configuration -type EffectiveConnectivityConfiguration struct { - // ID - Connectivity configuration ID. - ID *string `json:"id,omitempty"` - // ConnectivityConfigurationProperties - Properties of a network manager connectivity configuration - *ConnectivityConfigurationProperties `json:"properties,omitempty"` - // ConfigurationGroups - Effective configuration groups. - ConfigurationGroups *[]ConfigurationGroup `json:"configurationGroups,omitempty"` -} - -// MarshalJSON is the custom marshaler for EffectiveConnectivityConfiguration. -func (ecc EffectiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ecc.ID != nil { - objectMap["id"] = ecc.ID - } - if ecc.ConnectivityConfigurationProperties != nil { - objectMap["properties"] = ecc.ConnectivityConfigurationProperties - } - if ecc.ConfigurationGroups != nil { - objectMap["configurationGroups"] = ecc.ConfigurationGroups - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for EffectiveConnectivityConfiguration struct. -func (ecc *EffectiveConnectivityConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ecc.ID = &ID - } - case "properties": - if v != nil { - var connectivityConfigurationProperties ConnectivityConfigurationProperties - err = json.Unmarshal(*v, &connectivityConfigurationProperties) - if err != nil { - return err - } - ecc.ConnectivityConfigurationProperties = &connectivityConfigurationProperties - } - case "configurationGroups": - if v != nil { - var configurationGroups []ConfigurationGroup - err = json.Unmarshal(*v, &configurationGroups) - if err != nil { - return err - } - ecc.ConfigurationGroups = &configurationGroups - } - } - } - - return nil -} - -// EffectiveDefaultSecurityAdminRule network default admin rule. -type EffectiveDefaultSecurityAdminRule struct { - // DefaultAdminPropertiesFormat - Indicates the properties of the default security admin rule - *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // ConfigurationDescription - A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - // RuleCollectionDescription - A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - // RuleCollectionAppliesToGroups - Groups for rule collection - RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - // RuleGroups - Effective configuration groups. - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` - // Kind - Possible values include: 'KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule', 'KindBasicEffectiveBaseSecurityAdminRuleKindCustom', 'KindBasicEffectiveBaseSecurityAdminRuleKindDefault' - Kind KindBasicEffectiveBaseSecurityAdminRule `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for EffectiveDefaultSecurityAdminRule. -func (edsar EffectiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { - edsar.Kind = KindBasicEffectiveBaseSecurityAdminRuleKindDefault - objectMap := make(map[string]interface{}) - if edsar.DefaultAdminPropertiesFormat != nil { - objectMap["properties"] = edsar.DefaultAdminPropertiesFormat - } - if edsar.ID != nil { - objectMap["id"] = edsar.ID - } - if edsar.ConfigurationDescription != nil { - objectMap["configurationDescription"] = edsar.ConfigurationDescription - } - if edsar.RuleCollectionDescription != nil { - objectMap["ruleCollectionDescription"] = edsar.RuleCollectionDescription - } - if edsar.RuleCollectionAppliesToGroups != nil { - objectMap["ruleCollectionAppliesToGroups"] = edsar.RuleCollectionAppliesToGroups - } - if edsar.RuleGroups != nil { - objectMap["ruleGroups"] = edsar.RuleGroups - } - if edsar.Kind != "" { - objectMap["kind"] = edsar.Kind - } - return json.Marshal(objectMap) -} - -// AsEffectiveSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveDefaultSecurityAdminRule. -func (edsar EffectiveDefaultSecurityAdminRule) AsEffectiveSecurityAdminRule() (*EffectiveSecurityAdminRule, bool) { - return nil, false -} - -// AsEffectiveDefaultSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveDefaultSecurityAdminRule. -func (edsar EffectiveDefaultSecurityAdminRule) AsEffectiveDefaultSecurityAdminRule() (*EffectiveDefaultSecurityAdminRule, bool) { - return &edsar, true -} - -// AsEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveDefaultSecurityAdminRule. -func (edsar EffectiveDefaultSecurityAdminRule) AsEffectiveBaseSecurityAdminRule() (*EffectiveBaseSecurityAdminRule, bool) { - return nil, false -} - -// AsBasicEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveDefaultSecurityAdminRule. -func (edsar EffectiveDefaultSecurityAdminRule) AsBasicEffectiveBaseSecurityAdminRule() (BasicEffectiveBaseSecurityAdminRule, bool) { - return &edsar, true -} - -// UnmarshalJSON is the custom unmarshaler for EffectiveDefaultSecurityAdminRule struct. -func (edsar *EffectiveDefaultSecurityAdminRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var defaultAdminPropertiesFormat DefaultAdminPropertiesFormat - err = json.Unmarshal(*v, &defaultAdminPropertiesFormat) - if err != nil { - return err - } - edsar.DefaultAdminPropertiesFormat = &defaultAdminPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - edsar.ID = &ID - } - case "configurationDescription": - if v != nil { - var configurationDescription string - err = json.Unmarshal(*v, &configurationDescription) - if err != nil { - return err - } - edsar.ConfigurationDescription = &configurationDescription - } - case "ruleCollectionDescription": - if v != nil { - var ruleCollectionDescription string - err = json.Unmarshal(*v, &ruleCollectionDescription) - if err != nil { - return err - } - edsar.RuleCollectionDescription = &ruleCollectionDescription - } - case "ruleCollectionAppliesToGroups": - if v != nil { - var ruleCollectionAppliesToGroups []ManagerSecurityGroupItem - err = json.Unmarshal(*v, &ruleCollectionAppliesToGroups) - if err != nil { - return err - } - edsar.RuleCollectionAppliesToGroups = &ruleCollectionAppliesToGroups - } - case "ruleGroups": - if v != nil { - var ruleGroups []ConfigurationGroup - err = json.Unmarshal(*v, &ruleGroups) - if err != nil { - return err - } - edsar.RuleGroups = &ruleGroups - } - case "kind": - if v != nil { - var kind KindBasicEffectiveBaseSecurityAdminRule - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - edsar.Kind = kind - } - } - } - - return nil -} - -// EffectiveNetworkSecurityGroup effective network security group. -type EffectiveNetworkSecurityGroup struct { - // NetworkSecurityGroup - The ID of network security group that is applied. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // Association - Associated resources. - Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` - // EffectiveSecurityRules - A collection of effective security rules. - EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` - // TagMap - Mapping of tags to list of IP Addresses included within the tag. - TagMap map[string][]string `json:"tagMap"` -} - -// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroup. -func (ensg EffectiveNetworkSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ensg.NetworkSecurityGroup != nil { - objectMap["networkSecurityGroup"] = ensg.NetworkSecurityGroup - } - if ensg.Association != nil { - objectMap["association"] = ensg.Association - } - if ensg.EffectiveSecurityRules != nil { - objectMap["effectiveSecurityRules"] = ensg.EffectiveSecurityRules - } - if ensg.TagMap != nil { - objectMap["tagMap"] = ensg.TagMap - } - return json.Marshal(objectMap) -} - -// EffectiveNetworkSecurityGroupAssociation the effective network security group association. -type EffectiveNetworkSecurityGroupAssociation struct { - // NetworkManager - The ID of the Azure network manager if assigned. - NetworkManager *SubResource `json:"networkManager,omitempty"` - // Subnet - The ID of the subnet if assigned. - Subnet *SubResource `json:"subnet,omitempty"` - // NetworkInterface - The ID of the network interface if assigned. - NetworkInterface *SubResource `json:"networkInterface,omitempty"` -} - -// EffectiveNetworkSecurityGroupListResult response for list effective network security groups API service -// call. -type EffectiveNetworkSecurityGroupListResult struct { - autorest.Response `json:"-"` - // Value - A list of effective network security groups. - Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroupListResult. -func (ensglr EffectiveNetworkSecurityGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ensglr.Value != nil { - objectMap["value"] = ensglr.Value - } - return json.Marshal(objectMap) -} - -// EffectiveNetworkSecurityRule effective network security rules. -type EffectiveNetworkSecurityRule struct { - // Name - The name of the security rule specified by the user (if created by the user). - Name *string `json:"name,omitempty"` - // Protocol - The network protocol this rule applies to. Possible values include: 'EffectiveSecurityRuleProtocolTCP', 'EffectiveSecurityRuleProtocolUDP', 'EffectiveSecurityRuleProtocolAll' - Protocol EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` - // SourcePortRange - The source port or range. - SourcePortRange *string `json:"sourcePortRange,omitempty"` - // DestinationPortRange - The destination port or range. - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - // SourcePortRanges - The source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - // DestinationPortRanges - The destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - // SourceAddressPrefix - The source address prefix. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - // DestinationAddressPrefix - The destination address prefix. - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - // SourceAddressPrefixes - The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - // DestinationAddressPrefixes - The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - // ExpandedSourceAddressPrefix - The expanded source address prefix. - ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` - // ExpandedDestinationAddressPrefix - Expanded destination address prefix. - ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` - // Access - Whether network traffic is allowed or denied. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' - Access SecurityRuleAccess `json:"access,omitempty"` - // Priority - The priority of the rule. - Priority *int32 `json:"priority,omitempty"` - // Direction - The direction of the rule. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' - Direction SecurityRuleDirection `json:"direction,omitempty"` -} - -// EffectiveRoute effective Route. -type EffectiveRoute struct { - // Name - The name of the user defined route. This is optional. - Name *string `json:"name,omitempty"` - // DisableBgpRoutePropagation - If true, on-premises routes are not propagated to the network interfaces in the subnet. - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - // Source - Who created the route. Possible values include: 'EffectiveRouteSourceUnknown', 'EffectiveRouteSourceUser', 'EffectiveRouteSourceVirtualNetworkGateway', 'EffectiveRouteSourceDefault' - Source EffectiveRouteSource `json:"source,omitempty"` - // State - The value of effective route. Possible values include: 'Active', 'Invalid' - State EffectiveRouteState `json:"state,omitempty"` - // AddressPrefix - The address prefixes of the effective routes in CIDR notation. - AddressPrefix *[]string `json:"addressPrefix,omitempty"` - // NextHopIPAddress - The IP address of the next hop of the effective route. - NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"` - // NextHopType - The type of Azure hop the packet should be sent to. Possible values include: 'RouteNextHopTypeVirtualNetworkGateway', 'RouteNextHopTypeVnetLocal', 'RouteNextHopTypeInternet', 'RouteNextHopTypeVirtualAppliance', 'RouteNextHopTypeNone' - NextHopType RouteNextHopType `json:"nextHopType,omitempty"` -} - -// EffectiveRouteListResult response for list effective route API service call. -type EffectiveRouteListResult struct { - autorest.Response `json:"-"` - // Value - A list of effective routes. - Value *[]EffectiveRoute `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for EffectiveRouteListResult. -func (erlr EffectiveRouteListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erlr.Value != nil { - objectMap["value"] = erlr.Value - } - return json.Marshal(objectMap) -} - -// EffectiveRouteMapRoute the effective RouteMap route configured on the connection resource. -type EffectiveRouteMapRoute struct { - // Prefix - The address prefix of the route. - Prefix *[]string `json:"prefix,omitempty"` - // BgpCommunities - BGP communities of the route. - BgpCommunities *string `json:"bgpCommunities,omitempty"` - // AsPath - The ASPath of this route. - AsPath *string `json:"asPath,omitempty"` -} - -// EffectiveRoutesParameters the parameters specifying the resource whose effective routes are being -// requested. -type EffectiveRoutesParameters struct { - // ResourceID - The resource whose effective routes are being requested. - ResourceID *string `json:"resourceId,omitempty"` - // VirtualWanResourceType - The type of the specified resource like RouteTable, ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. - VirtualWanResourceType *string `json:"virtualWanResourceType,omitempty"` -} - -// EffectiveSecurityAdminRule network admin rule. -type EffectiveSecurityAdminRule struct { - // AdminPropertiesFormat - Indicates the properties of the security admin rule - *AdminPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // ConfigurationDescription - A description of the security admin configuration. - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - // RuleCollectionDescription - A description of the rule collection. - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - // RuleCollectionAppliesToGroups - Groups for rule collection - RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - // RuleGroups - Effective configuration groups. - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` - // Kind - Possible values include: 'KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule', 'KindBasicEffectiveBaseSecurityAdminRuleKindCustom', 'KindBasicEffectiveBaseSecurityAdminRuleKindDefault' - Kind KindBasicEffectiveBaseSecurityAdminRule `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for EffectiveSecurityAdminRule. -func (esar EffectiveSecurityAdminRule) MarshalJSON() ([]byte, error) { - esar.Kind = KindBasicEffectiveBaseSecurityAdminRuleKindCustom - objectMap := make(map[string]interface{}) - if esar.AdminPropertiesFormat != nil { - objectMap["properties"] = esar.AdminPropertiesFormat - } - if esar.ID != nil { - objectMap["id"] = esar.ID - } - if esar.ConfigurationDescription != nil { - objectMap["configurationDescription"] = esar.ConfigurationDescription - } - if esar.RuleCollectionDescription != nil { - objectMap["ruleCollectionDescription"] = esar.RuleCollectionDescription - } - if esar.RuleCollectionAppliesToGroups != nil { - objectMap["ruleCollectionAppliesToGroups"] = esar.RuleCollectionAppliesToGroups - } - if esar.RuleGroups != nil { - objectMap["ruleGroups"] = esar.RuleGroups - } - if esar.Kind != "" { - objectMap["kind"] = esar.Kind - } - return json.Marshal(objectMap) -} - -// AsEffectiveSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveSecurityAdminRule. -func (esar EffectiveSecurityAdminRule) AsEffectiveSecurityAdminRule() (*EffectiveSecurityAdminRule, bool) { - return &esar, true -} - -// AsEffectiveDefaultSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveSecurityAdminRule. -func (esar EffectiveSecurityAdminRule) AsEffectiveDefaultSecurityAdminRule() (*EffectiveDefaultSecurityAdminRule, bool) { - return nil, false -} - -// AsEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveSecurityAdminRule. -func (esar EffectiveSecurityAdminRule) AsEffectiveBaseSecurityAdminRule() (*EffectiveBaseSecurityAdminRule, bool) { - return nil, false -} - -// AsBasicEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveSecurityAdminRule. -func (esar EffectiveSecurityAdminRule) AsBasicEffectiveBaseSecurityAdminRule() (BasicEffectiveBaseSecurityAdminRule, bool) { - return &esar, true -} - -// UnmarshalJSON is the custom unmarshaler for EffectiveSecurityAdminRule struct. -func (esar *EffectiveSecurityAdminRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var adminPropertiesFormat AdminPropertiesFormat - err = json.Unmarshal(*v, &adminPropertiesFormat) - if err != nil { - return err - } - esar.AdminPropertiesFormat = &adminPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - esar.ID = &ID - } - case "configurationDescription": - if v != nil { - var configurationDescription string - err = json.Unmarshal(*v, &configurationDescription) - if err != nil { - return err - } - esar.ConfigurationDescription = &configurationDescription - } - case "ruleCollectionDescription": - if v != nil { - var ruleCollectionDescription string - err = json.Unmarshal(*v, &ruleCollectionDescription) - if err != nil { - return err - } - esar.RuleCollectionDescription = &ruleCollectionDescription - } - case "ruleCollectionAppliesToGroups": - if v != nil { - var ruleCollectionAppliesToGroups []ManagerSecurityGroupItem - err = json.Unmarshal(*v, &ruleCollectionAppliesToGroups) - if err != nil { - return err - } - esar.RuleCollectionAppliesToGroups = &ruleCollectionAppliesToGroups - } - case "ruleGroups": - if v != nil { - var ruleGroups []ConfigurationGroup - err = json.Unmarshal(*v, &ruleGroups) - if err != nil { - return err - } - esar.RuleGroups = &ruleGroups - } - case "kind": - if v != nil { - var kind KindBasicEffectiveBaseSecurityAdminRule - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - esar.Kind = kind - } - } - } - - return nil -} - -// EndpointServiceResult endpoint service. -type EndpointServiceResult struct { - // Name - READ-ONLY; Name of the endpoint service. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Type of the endpoint service. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for EndpointServiceResult. -func (esr EndpointServiceResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esr.ID != nil { - objectMap["id"] = esr.ID - } - return json.Marshal(objectMap) -} - -// EndpointServicesListResult response for the ListAvailableEndpointServices API service call. -type EndpointServicesListResult struct { - autorest.Response `json:"-"` - // Value - List of available endpoint services in a region. - Value *[]EndpointServiceResult `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// EndpointServicesListResultIterator provides access to a complete listing of EndpointServiceResult -// values. -type EndpointServicesListResultIterator struct { - i int - page EndpointServicesListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *EndpointServicesListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EndpointServicesListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *EndpointServicesListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EndpointServicesListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter EndpointServicesListResultIterator) Response() EndpointServicesListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter EndpointServicesListResultIterator) Value() EndpointServiceResult { - if !iter.page.NotDone() { - return EndpointServiceResult{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the EndpointServicesListResultIterator type. -func NewEndpointServicesListResultIterator(page EndpointServicesListResultPage) EndpointServicesListResultIterator { - return EndpointServicesListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (eslr EndpointServicesListResult) IsEmpty() bool { - return eslr.Value == nil || len(*eslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (eslr EndpointServicesListResult) hasNextLink() bool { - return eslr.NextLink != nil && len(*eslr.NextLink) != 0 -} - -// endpointServicesListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (eslr EndpointServicesListResult) endpointServicesListResultPreparer(ctx context.Context) (*http.Request, error) { - if !eslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(eslr.NextLink))) -} - -// EndpointServicesListResultPage contains a page of EndpointServiceResult values. -type EndpointServicesListResultPage struct { - fn func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error) - eslr EndpointServicesListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *EndpointServicesListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EndpointServicesListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.eslr) - if err != nil { - return err - } - page.eslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *EndpointServicesListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EndpointServicesListResultPage) NotDone() bool { - return !page.eslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page EndpointServicesListResultPage) Response() EndpointServicesListResult { - return page.eslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page EndpointServicesListResultPage) Values() []EndpointServiceResult { - if page.eslr.IsEmpty() { - return nil - } - return *page.eslr.Value -} - -// Creates a new instance of the EndpointServicesListResultPage type. -func NewEndpointServicesListResultPage(cur EndpointServicesListResult, getNextPage func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error)) EndpointServicesListResultPage { - return EndpointServicesListResultPage{ - fn: getNextPage, - eslr: cur, - } -} - -// Error common error representation. -type Error struct { - // Code - Error code. - Code *string `json:"code,omitempty"` - // Message - Error message. - Message *string `json:"message,omitempty"` - // Target - Error target. - Target *string `json:"target,omitempty"` - // Details - Error details. - Details *[]ErrorDetails `json:"details,omitempty"` - // InnerError - Inner error message. - InnerError *string `json:"innerError,omitempty"` -} - -// ErrorDetails common error details representation. -type ErrorDetails struct { - // Code - Error code. - Code *string `json:"code,omitempty"` - // Target - Error target. - Target *string `json:"target,omitempty"` - // Message - Error message. - Message *string `json:"message,omitempty"` -} - -// ErrorResponse the error object. -type ErrorResponse struct { - // Error - The error details object. - Error *ErrorDetails `json:"error,omitempty"` -} - -// EvaluatedNetworkSecurityGroup results of network security group evaluation. -type EvaluatedNetworkSecurityGroup struct { - // NetworkSecurityGroupID - Network security group ID. - NetworkSecurityGroupID *string `json:"networkSecurityGroupId,omitempty"` - // AppliedTo - Resource ID of nic or subnet to which network security group is applied. - AppliedTo *string `json:"appliedTo,omitempty"` - // MatchedRule - Matched network security rule. - MatchedRule *MatchedRule `json:"matchedRule,omitempty"` - // RulesEvaluationResult - READ-ONLY; List of network security rules evaluation results. - RulesEvaluationResult *[]SecurityRulesEvaluationResult `json:"rulesEvaluationResult,omitempty"` -} - -// MarshalJSON is the custom marshaler for EvaluatedNetworkSecurityGroup. -func (ensg EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ensg.NetworkSecurityGroupID != nil { - objectMap["networkSecurityGroupId"] = ensg.NetworkSecurityGroupID - } - if ensg.AppliedTo != nil { - objectMap["appliedTo"] = ensg.AppliedTo - } - if ensg.MatchedRule != nil { - objectMap["matchedRule"] = ensg.MatchedRule - } - return json.Marshal(objectMap) -} - -// ExclusionManagedRule defines a managed rule to use for exclusion. -type ExclusionManagedRule struct { - // RuleID - Identifier for the managed rule. - RuleID *string `json:"ruleId,omitempty"` -} - -// ExclusionManagedRuleGroup defines a managed rule group to use for exclusion. -type ExclusionManagedRuleGroup struct { - // RuleGroupName - The managed rule group for exclusion. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Rules - List of rules that will be excluded. If none specified, all rules in the group will be excluded. - Rules *[]ExclusionManagedRule `json:"rules,omitempty"` -} - -// ExclusionManagedRuleSet defines a managed rule set for Exclusions. -type ExclusionManagedRuleSet struct { - // RuleSetType - Defines the rule set type to use. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - Defines the version of the rule set to use. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroups - Defines the rule groups to apply to the rule set. - RuleGroups *[]ExclusionManagedRuleGroup `json:"ruleGroups,omitempty"` -} - -// ExplicitProxy explicit Proxy Settings in Firewall Policy. -type ExplicitProxy struct { - // EnableExplicitProxy - When set to true, explicit proxy mode is enabled. - EnableExplicitProxy *bool `json:"enableExplicitProxy,omitempty"` - // HTTPPort - Port number for explicit proxy http protocol, cannot be greater than 64000. - HTTPPort *int32 `json:"httpPort,omitempty"` - // HTTPSPort - Port number for explicit proxy https protocol, cannot be greater than 64000. - HTTPSPort *int32 `json:"httpsPort,omitempty"` - // EnablePacFile - When set to true, pac file port and url needs to be provided. - EnablePacFile *bool `json:"enablePacFile,omitempty"` - // PacFilePort - Port number for firewall to serve PAC file. - PacFilePort *int32 `json:"pacFilePort,omitempty"` - // PacFile - SAS URL for PAC file. - PacFile *string `json:"pacFile,omitempty"` -} - -// ExpressRouteCircuit expressRouteCircuit resource. -type ExpressRouteCircuit struct { - autorest.Response `json:"-"` - // Sku - The SKU. - Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` - // ExpressRouteCircuitPropertiesFormat - Properties of the express route circuit. - *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuit. -func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erc.Sku != nil { - objectMap["sku"] = erc.Sku - } - if erc.ExpressRouteCircuitPropertiesFormat != nil { - objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat - } - if erc.ID != nil { - objectMap["id"] = erc.ID - } - if erc.Location != nil { - objectMap["location"] = erc.Location - } - if erc.Tags != nil { - objectMap["tags"] = erc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct. -func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku ExpressRouteCircuitSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - erc.Sku = &sku - } - case "properties": - if v != nil { - var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat - err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat) - if err != nil { - return err - } - erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erc.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteCircuitArpTable the ARP table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitArpTable struct { - // Age - Entry age in minutes. - Age *int32 `json:"age,omitempty"` - // Interface - Interface address. - Interface *string `json:"interface,omitempty"` - // IPAddress - The IP address. - IPAddress *string `json:"ipAddress,omitempty"` - // MacAddress - The MAC address. - MacAddress *string `json:"macAddress,omitempty"` -} - -// ExpressRouteCircuitAuthorization authorization in an ExpressRouteCircuit resource. -type ExpressRouteCircuitAuthorization struct { - autorest.Response `json:"-"` - // AuthorizationPropertiesFormat - Properties of the express route circuit authorization. - *AuthorizationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitAuthorization. -func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erca.AuthorizationPropertiesFormat != nil { - objectMap["properties"] = erca.AuthorizationPropertiesFormat - } - if erca.Name != nil { - objectMap["name"] = erca.Name - } - if erca.ID != nil { - objectMap["id"] = erca.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct. -func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var authorizationPropertiesFormat AuthorizationPropertiesFormat - err = json.Unmarshal(*v, &authorizationPropertiesFormat) - if err != nil { - return err - } - erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erca.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erca.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erca.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erca.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitAuthorizationsClient) (ExpressRouteCircuitAuthorization, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erca.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erca.Response.Response, err = future.GetResult(sender); err == nil && erca.Response.Response.StatusCode != http.StatusNoContent { - erca, err = client.CreateOrUpdateResponder(erca.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", erca.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ExpressRouteCircuitAuthorizationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitAuthorizationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitAuthorizationsDeleteFuture.Result. -func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCircuitConnection express Route Circuit Connection in an ExpressRouteCircuitPeering -// resource. -type ExpressRouteCircuitConnection struct { - autorest.Response `json:"-"` - // ExpressRouteCircuitConnectionPropertiesFormat - Properties of the express route circuit connection. - *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitConnection. -func (ercc ExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercc.ExpressRouteCircuitConnectionPropertiesFormat != nil { - objectMap["properties"] = ercc.ExpressRouteCircuitConnectionPropertiesFormat - } - if ercc.Name != nil { - objectMap["name"] = ercc.Name - } - if ercc.ID != nil { - objectMap["id"] = ercc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitConnection struct. -func (ercc *ExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteCircuitConnectionPropertiesFormat ExpressRouteCircuitConnectionPropertiesFormat - err = json.Unmarshal(*v, &expressRouteCircuitConnectionPropertiesFormat) - if err != nil { - return err - } - ercc.ExpressRouteCircuitConnectionPropertiesFormat = &expressRouteCircuitConnectionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ercc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ercc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ercc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ercc.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteCircuitConnectionListResult response for ListConnections API service call retrieves all -// global reach connections that belongs to a Private Peering for an ExpressRouteCircuit. -type ExpressRouteCircuitConnectionListResult struct { - autorest.Response `json:"-"` - // Value - The global reach connection associated with Private Peering in an ExpressRoute Circuit. - Value *[]ExpressRouteCircuitConnection `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitConnectionListResultIterator provides access to a complete listing of -// ExpressRouteCircuitConnection values. -type ExpressRouteCircuitConnectionListResultIterator struct { - i int - page ExpressRouteCircuitConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCircuitConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCircuitConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCircuitConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCircuitConnectionListResultIterator) Response() ExpressRouteCircuitConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCircuitConnectionListResultIterator) Value() ExpressRouteCircuitConnection { - if !iter.page.NotDone() { - return ExpressRouteCircuitConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCircuitConnectionListResultIterator type. -func NewExpressRouteCircuitConnectionListResultIterator(page ExpressRouteCircuitConnectionListResultPage) ExpressRouteCircuitConnectionListResultIterator { - return ExpressRouteCircuitConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ercclr ExpressRouteCircuitConnectionListResult) IsEmpty() bool { - return ercclr.Value == nil || len(*ercclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ercclr ExpressRouteCircuitConnectionListResult) hasNextLink() bool { - return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 -} - -// expressRouteCircuitConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ercclr ExpressRouteCircuitConnectionListResult) expressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ercclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ercclr.NextLink))) -} - -// ExpressRouteCircuitConnectionListResultPage contains a page of ExpressRouteCircuitConnection values. -type ExpressRouteCircuitConnectionListResultPage struct { - fn func(context.Context, ExpressRouteCircuitConnectionListResult) (ExpressRouteCircuitConnectionListResult, error) - ercclr ExpressRouteCircuitConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ercclr) - if err != nil { - return err - } - page.ercclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCircuitConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCircuitConnectionListResultPage) NotDone() bool { - return !page.ercclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCircuitConnectionListResultPage) Response() ExpressRouteCircuitConnectionListResult { - return page.ercclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCircuitConnectionListResultPage) Values() []ExpressRouteCircuitConnection { - if page.ercclr.IsEmpty() { - return nil - } - return *page.ercclr.Value -} - -// Creates a new instance of the ExpressRouteCircuitConnectionListResultPage type. -func NewExpressRouteCircuitConnectionListResultPage(cur ExpressRouteCircuitConnectionListResult, getNextPage func(context.Context, ExpressRouteCircuitConnectionListResult) (ExpressRouteCircuitConnectionListResult, error)) ExpressRouteCircuitConnectionListResultPage { - return ExpressRouteCircuitConnectionListResultPage{ - fn: getNextPage, - ercclr: cur, - } -} - -// ExpressRouteCircuitConnectionPropertiesFormat properties of the express route circuit connection. -type ExpressRouteCircuitConnectionPropertiesFormat struct { - // ExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - // PeerExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the peered circuit. - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - // AddressPrefix - /29 IP address space to carve out Customer addresses for tunnels. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // AuthorizationKey - The authorization key. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // Ipv6CircuitConnectionConfig - IPv6 Address PrefixProperties of the express route circuit connection. - Ipv6CircuitConnectionConfig *Ipv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' - CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitConnectionPropertiesFormat. -func (erccpf ExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccpf.ExpressRouteCircuitPeering != nil { - objectMap["expressRouteCircuitPeering"] = erccpf.ExpressRouteCircuitPeering - } - if erccpf.PeerExpressRouteCircuitPeering != nil { - objectMap["peerExpressRouteCircuitPeering"] = erccpf.PeerExpressRouteCircuitPeering - } - if erccpf.AddressPrefix != nil { - objectMap["addressPrefix"] = erccpf.AddressPrefix - } - if erccpf.AuthorizationKey != nil { - objectMap["authorizationKey"] = erccpf.AuthorizationKey - } - if erccpf.Ipv6CircuitConnectionConfig != nil { - objectMap["ipv6CircuitConnectionConfig"] = erccpf.Ipv6CircuitConnectionConfig - } - if erccpf.CircuitConnectionStatus != "" { - objectMap["circuitConnectionStatus"] = erccpf.CircuitConnectionStatus - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuitConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCircuitConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitConnectionsClient) (ExpressRouteCircuitConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitConnectionsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) result(client ExpressRouteCircuitConnectionsClient) (ercc ExpressRouteCircuitConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent { - ercc, err = client.CreateOrUpdateResponder(ercc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture", "Result", ercc.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitConnectionsDeleteFuture.Result. -func (future *ExpressRouteCircuitConnectionsDeleteFuture) result(client ExpressRouteCircuitConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCircuitListResult response for ListExpressRouteCircuit API service call. -type ExpressRouteCircuitListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRouteCircuits in a resource group. - Value *[]ExpressRouteCircuit `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit -// values. -type ExpressRouteCircuitListResultIterator struct { - i int - page ExpressRouteCircuitListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCircuitListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCircuitListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCircuitListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCircuitListResultIterator) Response() ExpressRouteCircuitListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCircuitListResultIterator) Value() ExpressRouteCircuit { - if !iter.page.NotDone() { - return ExpressRouteCircuit{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCircuitListResultIterator type. -func NewExpressRouteCircuitListResultIterator(page ExpressRouteCircuitListResultPage) ExpressRouteCircuitListResultIterator { - return ExpressRouteCircuitListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erclr ExpressRouteCircuitListResult) IsEmpty() bool { - return erclr.Value == nil || len(*erclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erclr ExpressRouteCircuitListResult) hasNextLink() bool { - return erclr.NextLink != nil && len(*erclr.NextLink) != 0 -} - -// expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erclr.NextLink))) -} - -// ExpressRouteCircuitListResultPage contains a page of ExpressRouteCircuit values. -type ExpressRouteCircuitListResultPage struct { - fn func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error) - erclr ExpressRouteCircuitListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erclr) - if err != nil { - return err - } - page.erclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCircuitListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCircuitListResultPage) NotDone() bool { - return !page.erclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCircuitListResultPage) Response() ExpressRouteCircuitListResult { - return page.erclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit { - if page.erclr.IsEmpty() { - return nil - } - return *page.erclr.Value -} - -// Creates a new instance of the ExpressRouteCircuitListResultPage type. -func NewExpressRouteCircuitListResultPage(cur ExpressRouteCircuitListResult, getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage { - return ExpressRouteCircuitListResultPage{ - fn: getNextPage, - erclr: cur, - } -} - -// ExpressRouteCircuitPeering peering in an ExpressRouteCircuit resource. -type ExpressRouteCircuitPeering struct { - autorest.Response `json:"-"` - // ExpressRouteCircuitPeeringPropertiesFormat - Properties of the express route circuit peering. - *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeering. -func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil { - objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat - } - if ercp.Name != nil { - objectMap["name"] = ercp.Name - } - if ercp.ID != nil { - objectMap["id"] = ercp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct. -func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat - err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat) - if err != nil { - return err - } - ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ercp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ercp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ercp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ercp.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteCircuitPeeringConfig specifies the peering configuration. -type ExpressRouteCircuitPeeringConfig struct { - // AdvertisedPublicPrefixes - The reference to AdvertisedPublicPrefixes. - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - // AdvertisedCommunities - The communities of bgp peering. Specified for microsoft peering. - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - // AdvertisedPublicPrefixesState - READ-ONLY; The advertised public prefix state of the Peering resource. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' - AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - // LegacyMode - The legacy mode of the peering. - LegacyMode *int32 `json:"legacyMode,omitempty"` - // CustomerASN - The CustomerASN of the peering. - CustomerASN *int32 `json:"customerASN,omitempty"` - // RoutingRegistryName - The RoutingRegistryName of the configuration. - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeeringConfig. -func (ercpc ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercpc.AdvertisedPublicPrefixes != nil { - objectMap["advertisedPublicPrefixes"] = ercpc.AdvertisedPublicPrefixes - } - if ercpc.AdvertisedCommunities != nil { - objectMap["advertisedCommunities"] = ercpc.AdvertisedCommunities - } - if ercpc.LegacyMode != nil { - objectMap["legacyMode"] = ercpc.LegacyMode - } - if ercpc.CustomerASN != nil { - objectMap["customerASN"] = ercpc.CustomerASN - } - if ercpc.RoutingRegistryName != nil { - objectMap["routingRegistryName"] = ercpc.RoutingRegistryName - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuitPeeringID expressRoute circuit peering identifier. -type ExpressRouteCircuitPeeringID struct { - // ID - The ID of the ExpressRoute circuit peering. - ID *string `json:"id,omitempty"` -} - -// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings -// that belong to an ExpressRouteCircuit. -type ExpressRouteCircuitPeeringListResult struct { - autorest.Response `json:"-"` - // Value - The peerings in an express route circuit. - Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitPeeringListResultIterator provides access to a complete listing of -// ExpressRouteCircuitPeering values. -type ExpressRouteCircuitPeeringListResultIterator struct { - i int - page ExpressRouteCircuitPeeringListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCircuitPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCircuitPeeringListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCircuitPeeringListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCircuitPeeringListResultIterator) Response() ExpressRouteCircuitPeeringListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCircuitPeeringListResultIterator) Value() ExpressRouteCircuitPeering { - if !iter.page.NotDone() { - return ExpressRouteCircuitPeering{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCircuitPeeringListResultIterator type. -func NewExpressRouteCircuitPeeringListResultIterator(page ExpressRouteCircuitPeeringListResultPage) ExpressRouteCircuitPeeringListResultIterator { - return ExpressRouteCircuitPeeringListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool { - return ercplr.Value == nil || len(*ercplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool { - return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0 -} - -// expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ercplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ercplr.NextLink))) -} - -// ExpressRouteCircuitPeeringListResultPage contains a page of ExpressRouteCircuitPeering values. -type ExpressRouteCircuitPeeringListResultPage struct { - fn func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error) - ercplr ExpressRouteCircuitPeeringListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ercplr) - if err != nil { - return err - } - page.ercplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCircuitPeeringListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCircuitPeeringListResultPage) NotDone() bool { - return !page.ercplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCircuitPeeringListResultPage) Response() ExpressRouteCircuitPeeringListResult { - return page.ercplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCircuitPeering { - if page.ercplr.IsEmpty() { - return nil - } - return *page.ercplr.Value -} - -// Creates a new instance of the ExpressRouteCircuitPeeringListResultPage type. -func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringListResult, getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage { - return ExpressRouteCircuitPeeringListResultPage{ - fn: getNextPage, - ercplr: cur, - } -} - -// ExpressRouteCircuitPeeringPropertiesFormat properties of the express route circuit peering. -type ExpressRouteCircuitPeeringPropertiesFormat struct { - // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' - PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` - // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' - State ExpressRoutePeeringState `json:"state,omitempty"` - // AzureASN - The Azure ASN. - AzureASN *int32 `json:"azureASN,omitempty"` - // PeerASN - The peer ASN. - PeerASN *int64 `json:"peerASN,omitempty"` - // PrimaryPeerAddressPrefix - The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - // SecondaryPeerAddressPrefix - The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - // PrimaryAzurePort - The primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - // SecondaryAzurePort - The secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - // SharedKey - The shared key. - SharedKey *string `json:"sharedKey,omitempty"` - // VlanID - The VLAN ID. - VlanID *int32 `json:"vlanId,omitempty"` - // MicrosoftPeeringConfig - The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - // Stats - The peering stats of express route circuit. - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit peering resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // GatewayManagerEtag - The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - // LastModifiedBy - READ-ONLY; Who was the last to modify the peering. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // RouteFilter - The reference to the RouteFilter resource. - RouteFilter *SubResource `json:"routeFilter,omitempty"` - // Ipv6PeeringConfig - The IPv6 peering configuration. - Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - // ExpressRouteConnection - The ExpressRoute connection. - ExpressRouteConnection *ExpressRouteConnectionID `json:"expressRouteConnection,omitempty"` - // Connections - The list of circuit connections associated with Azure Private Peering for this circuit. - Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` - // PeeredConnections - READ-ONLY; The list of peered circuit connections associated with Azure Private Peering for this circuit. - PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeeringPropertiesFormat. -func (ercppf ExpressRouteCircuitPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercppf.PeeringType != "" { - objectMap["peeringType"] = ercppf.PeeringType - } - if ercppf.State != "" { - objectMap["state"] = ercppf.State - } - if ercppf.AzureASN != nil { - objectMap["azureASN"] = ercppf.AzureASN - } - if ercppf.PeerASN != nil { - objectMap["peerASN"] = ercppf.PeerASN - } - if ercppf.PrimaryPeerAddressPrefix != nil { - objectMap["primaryPeerAddressPrefix"] = ercppf.PrimaryPeerAddressPrefix - } - if ercppf.SecondaryPeerAddressPrefix != nil { - objectMap["secondaryPeerAddressPrefix"] = ercppf.SecondaryPeerAddressPrefix - } - if ercppf.PrimaryAzurePort != nil { - objectMap["primaryAzurePort"] = ercppf.PrimaryAzurePort - } - if ercppf.SecondaryAzurePort != nil { - objectMap["secondaryAzurePort"] = ercppf.SecondaryAzurePort - } - if ercppf.SharedKey != nil { - objectMap["sharedKey"] = ercppf.SharedKey - } - if ercppf.VlanID != nil { - objectMap["vlanId"] = ercppf.VlanID - } - if ercppf.MicrosoftPeeringConfig != nil { - objectMap["microsoftPeeringConfig"] = ercppf.MicrosoftPeeringConfig - } - if ercppf.Stats != nil { - objectMap["stats"] = ercppf.Stats - } - if ercppf.GatewayManagerEtag != nil { - objectMap["gatewayManagerEtag"] = ercppf.GatewayManagerEtag - } - if ercppf.RouteFilter != nil { - objectMap["routeFilter"] = ercppf.RouteFilter - } - if ercppf.Ipv6PeeringConfig != nil { - objectMap["ipv6PeeringConfig"] = ercppf.Ipv6PeeringConfig - } - if ercppf.ExpressRouteConnection != nil { - objectMap["expressRouteConnection"] = ercppf.ExpressRouteConnection - } - if ercppf.Connections != nil { - objectMap["connections"] = ercppf.Connections - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitPeeringsClient) (ExpressRouteCircuitPeering, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitPeeringsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercp.Response.Response, err = future.GetResult(sender); err == nil && ercp.Response.Response.StatusCode != http.StatusNoContent { - ercp, err = client.CreateOrUpdateResponder(ercp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", ercp.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitPeeringsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitPeeringsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitPeeringsDeleteFuture.Result. -func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCircuitPropertiesFormat properties of ExpressRouteCircuit. -type ExpressRouteCircuitPropertiesFormat struct { - // AllowClassicOperations - Allow classic operations. - AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` - // CircuitProvisioningState - The CircuitProvisioningState state of the resource. - CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` - // ServiceProviderProvisioningState - The ServiceProviderProvisioningState state of the resource. Possible values include: 'ServiceProviderProvisioningStateNotProvisioned', 'ServiceProviderProvisioningStateProvisioning', 'ServiceProviderProvisioningStateProvisioned', 'ServiceProviderProvisioningStateDeprovisioning' - ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - // Authorizations - The list of authorizations. - Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` - // Peerings - The list of peerings. - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - // ServiceKey - The ServiceKey. - ServiceKey *string `json:"serviceKey,omitempty"` - // ServiceProviderNotes - The ServiceProviderNotes. - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - // ServiceProviderProperties - The ServiceProviderProperties. - ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` - // ExpressRoutePort - The reference to the ExpressRoutePort resource when the circuit is provisioned on an ExpressRoutePort resource. - ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"` - // BandwidthInGbps - The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. - BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"` - // Stag - READ-ONLY; The identifier of the circuit traffic. Outer tag for QinQ encapsulation. - Stag *int32 `json:"stag,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // GatewayManagerEtag - The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - // GlobalReachEnabled - Flag denoting global reach status. - GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` - // AuthorizationKey - The authorizationKey. - AuthorizationKey *string `json:"authorizationKey,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCircuitPropertiesFormat. -func (ercpf ExpressRouteCircuitPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercpf.AllowClassicOperations != nil { - objectMap["allowClassicOperations"] = ercpf.AllowClassicOperations - } - if ercpf.CircuitProvisioningState != nil { - objectMap["circuitProvisioningState"] = ercpf.CircuitProvisioningState - } - if ercpf.ServiceProviderProvisioningState != "" { - objectMap["serviceProviderProvisioningState"] = ercpf.ServiceProviderProvisioningState - } - if ercpf.Authorizations != nil { - objectMap["authorizations"] = ercpf.Authorizations - } - if ercpf.Peerings != nil { - objectMap["peerings"] = ercpf.Peerings - } - if ercpf.ServiceKey != nil { - objectMap["serviceKey"] = ercpf.ServiceKey - } - if ercpf.ServiceProviderNotes != nil { - objectMap["serviceProviderNotes"] = ercpf.ServiceProviderNotes - } - if ercpf.ServiceProviderProperties != nil { - objectMap["serviceProviderProperties"] = ercpf.ServiceProviderProperties - } - if ercpf.ExpressRoutePort != nil { - objectMap["expressRoutePort"] = ercpf.ExpressRoutePort - } - if ercpf.BandwidthInGbps != nil { - objectMap["bandwidthInGbps"] = ercpf.BandwidthInGbps - } - if ercpf.GatewayManagerEtag != nil { - objectMap["gatewayManagerEtag"] = ercpf.GatewayManagerEtag - } - if ercpf.GlobalReachEnabled != nil { - objectMap["globalReachEnabled"] = ercpf.GlobalReachEnabled - } - if ercpf.AuthorizationKey != nil { - objectMap["authorizationKey"] = ercpf.AuthorizationKey - } - return json.Marshal(objectMap) -} - -// ExpressRouteCircuitReference reference to an express route circuit. -type ExpressRouteCircuitReference struct { - // ID - Corresponding Express Route Circuit Id. - ID *string `json:"id,omitempty"` -} - -// ExpressRouteCircuitRoutesTable the routes table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitRoutesTable struct { - // NetworkProperty - IP address of a network entity. - NetworkProperty *string `json:"network,omitempty"` - // NextHop - NextHop address. - NextHop *string `json:"nextHop,omitempty"` - // LocPrf - Local preference value as set with the set local-preference route-map configuration command. - LocPrf *string `json:"locPrf,omitempty"` - // Weight - Route Weight. - Weight *int32 `json:"weight,omitempty"` - // Path - Autonomous system paths to the destination network. - Path *string `json:"path,omitempty"` -} - -// ExpressRouteCircuitRoutesTableSummary the routes table associated with the ExpressRouteCircuit. -type ExpressRouteCircuitRoutesTableSummary struct { - // Neighbor - IP address of the neighbor. - Neighbor *string `json:"neighbor,omitempty"` - // V - BGP version number spoken to the neighbor. - V *int32 `json:"v,omitempty"` - // As - Autonomous system number. - As *int32 `json:"as,omitempty"` - // UpDown - The length of time that the BGP session has been in the Established state, or the current status if not in the Established state. - UpDown *string `json:"upDown,omitempty"` - // StatePfxRcd - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. - StatePfxRcd *string `json:"statePfxRcd,omitempty"` -} - -// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route -// Circuits API. -type ExpressRouteCircuitsArpTableListResult struct { - autorest.Response `json:"-"` - // Value - A list of the ARP tables. - Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent { - erc, err = client.CreateOrUpdateResponder(erc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsDeleteFuture.Result. -func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an -// ExpressRouteCircuit. -type ExpressRouteCircuitServiceProviderProperties struct { - // ServiceProviderName - The serviceProviderName. - ServiceProviderName *string `json:"serviceProviderName,omitempty"` - // PeeringLocation - The peering location. - PeeringLocation *string `json:"peeringLocation,omitempty"` - // BandwidthInMbps - The BandwidthInMbps. - BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` -} - -// ExpressRouteCircuitSku contains SKU in an ExpressRouteCircuit. -type ExpressRouteCircuitSku struct { - // Name - The name of the SKU. - Name *string `json:"name,omitempty"` - // Tier - The tier of the SKU. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium', 'ExpressRouteCircuitSkuTierBasic', 'ExpressRouteCircuitSkuTierLocal' - Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` - // Family - The family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData' - Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` -} - -// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitsListArpTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsArpTableListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsListArpTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsListArpTableFuture.Result. -func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercatlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent { - ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteCircuitsListRoutesTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsListRoutesTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsListRoutesTableFuture.Result. -func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercrtlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent { - ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCircuitsListRoutesTableSummaryFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableSummaryListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCircuitsListRoutesTableSummaryFuture.Result. -func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercrtslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercrtslr.Response.Response, err = future.GetResult(sender); err == nil && ercrtslr.Response.Response.StatusCode != http.StatusNoContent { - ercrtslr, err = client.ListRoutesTableSummaryResponder(ercrtslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", ercrtslr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route -// Circuits API. -type ExpressRouteCircuitsRoutesTableListResult struct { - autorest.Response `json:"-"` - // Value - The list of routes table. - Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the -// Express Route Circuits API. -type ExpressRouteCircuitsRoutesTableSummaryListResult struct { - autorest.Response `json:"-"` - // Value - A list of the routes table. - Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteCircuitStats contains stats associated with the peering. -type ExpressRouteCircuitStats struct { - autorest.Response `json:"-"` - // PrimarybytesIn - The Primary BytesIn of the peering. - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - // PrimarybytesOut - The primary BytesOut of the peering. - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - // SecondarybytesIn - The secondary BytesIn of the peering. - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - // SecondarybytesOut - The secondary BytesOut of the peering. - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} - -// ExpressRouteConnection expressRouteConnection resource. -type ExpressRouteConnection struct { - autorest.Response `json:"-"` - // ExpressRouteConnectionProperties - Properties of the express route connection. - *ExpressRouteConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource. - Name *string `json:"name,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteConnection. -func (erc ExpressRouteConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erc.ExpressRouteConnectionProperties != nil { - objectMap["properties"] = erc.ExpressRouteConnectionProperties - } - if erc.Name != nil { - objectMap["name"] = erc.Name - } - if erc.ID != nil { - objectMap["id"] = erc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteConnection struct. -func (erc *ExpressRouteConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteConnectionProperties ExpressRouteConnectionProperties - err = json.Unmarshal(*v, &expressRouteConnectionProperties) - if err != nil { - return err - } - erc.ExpressRouteConnectionProperties = &expressRouteConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erc.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erc.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteConnectionID the ID of the ExpressRouteConnection. -type ExpressRouteConnectionID struct { - // ID - READ-ONLY; The ID of the ExpressRouteConnection. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteConnectionID. -func (erci ExpressRouteConnectionID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ExpressRouteConnectionList expressRouteConnection list. -type ExpressRouteConnectionList struct { - autorest.Response `json:"-"` - // Value - The list of ExpressRoute connections. - Value *[]ExpressRouteConnection `json:"value,omitempty"` -} - -// ExpressRouteConnectionProperties properties of the ExpressRouteConnection subresource. -type ExpressRouteConnectionProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the express route connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ExpressRouteCircuitPeering - The ExpressRoute circuit peering. - ExpressRouteCircuitPeering *ExpressRouteCircuitPeeringID `json:"expressRouteCircuitPeering,omitempty"` - // AuthorizationKey - Authorization key to establish the connection. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // RoutingWeight - The routing weight associated to the connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // EnableInternetSecurity - Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - // ExpressRouteGatewayBypass - Enable FastPath to vWan Firewall hub. - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - // EnablePrivateLinkFastPath - Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteConnectionProperties. -func (ercp ExpressRouteConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercp.ExpressRouteCircuitPeering != nil { - objectMap["expressRouteCircuitPeering"] = ercp.ExpressRouteCircuitPeering - } - if ercp.AuthorizationKey != nil { - objectMap["authorizationKey"] = ercp.AuthorizationKey - } - if ercp.RoutingWeight != nil { - objectMap["routingWeight"] = ercp.RoutingWeight - } - if ercp.EnableInternetSecurity != nil { - objectMap["enableInternetSecurity"] = ercp.EnableInternetSecurity - } - if ercp.ExpressRouteGatewayBypass != nil { - objectMap["expressRouteGatewayBypass"] = ercp.ExpressRouteGatewayBypass - } - if ercp.EnablePrivateLinkFastPath != nil { - objectMap["enablePrivateLinkFastPath"] = ercp.EnablePrivateLinkFastPath - } - if ercp.RoutingConfiguration != nil { - objectMap["routingConfiguration"] = ercp.RoutingConfiguration - } - return json.Marshal(objectMap) -} - -// ExpressRouteConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ExpressRouteConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteConnectionsClient) (ExpressRouteConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteConnectionsCreateOrUpdateFuture.Result. -func (future *ExpressRouteConnectionsCreateOrUpdateFuture) result(client ExpressRouteConnectionsClient) (erc ExpressRouteConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent { - erc, err = client.CreateOrUpdateResponder(erc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteConnectionsDeleteFuture.Result. -func (future *ExpressRouteConnectionsDeleteFuture) result(client ExpressRouteConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCrossConnection expressRouteCrossConnection resource. -type ExpressRouteCrossConnection struct { - autorest.Response `json:"-"` - // ExpressRouteCrossConnectionProperties - Properties of the express route cross connection. - *ExpressRouteCrossConnectionProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnection. -func (ercc ExpressRouteCrossConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercc.ExpressRouteCrossConnectionProperties != nil { - objectMap["properties"] = ercc.ExpressRouteCrossConnectionProperties - } - if ercc.ID != nil { - objectMap["id"] = ercc.ID - } - if ercc.Location != nil { - objectMap["location"] = ercc.Location - } - if ercc.Tags != nil { - objectMap["tags"] = ercc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCrossConnection struct. -func (ercc *ExpressRouteCrossConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteCrossConnectionProperties ExpressRouteCrossConnectionProperties - err = json.Unmarshal(*v, &expressRouteCrossConnectionProperties) - if err != nil { - return err - } - ercc.ExpressRouteCrossConnectionProperties = &expressRouteCrossConnectionProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ercc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ercc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ercc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ercc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ercc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ercc.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteCrossConnectionListResult response for ListExpressRouteCrossConnection API service call. -type ExpressRouteCrossConnectionListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRouteCrossConnection resources. - Value *[]ExpressRouteCrossConnection `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionListResult. -func (ercclr ExpressRouteCrossConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ercclr.Value != nil { - objectMap["value"] = ercclr.Value - } - return json.Marshal(objectMap) -} - -// ExpressRouteCrossConnectionListResultIterator provides access to a complete listing of -// ExpressRouteCrossConnection values. -type ExpressRouteCrossConnectionListResultIterator struct { - i int - page ExpressRouteCrossConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCrossConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCrossConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCrossConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCrossConnectionListResultIterator) Response() ExpressRouteCrossConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCrossConnectionListResultIterator) Value() ExpressRouteCrossConnection { - if !iter.page.NotDone() { - return ExpressRouteCrossConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCrossConnectionListResultIterator type. -func NewExpressRouteCrossConnectionListResultIterator(page ExpressRouteCrossConnectionListResultPage) ExpressRouteCrossConnectionListResultIterator { - return ExpressRouteCrossConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ercclr ExpressRouteCrossConnectionListResult) IsEmpty() bool { - return ercclr.Value == nil || len(*ercclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ercclr ExpressRouteCrossConnectionListResult) hasNextLink() bool { - return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 -} - -// expressRouteCrossConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ercclr ExpressRouteCrossConnectionListResult) expressRouteCrossConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ercclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ercclr.NextLink))) -} - -// ExpressRouteCrossConnectionListResultPage contains a page of ExpressRouteCrossConnection values. -type ExpressRouteCrossConnectionListResultPage struct { - fn func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error) - ercclr ExpressRouteCrossConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCrossConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ercclr) - if err != nil { - return err - } - page.ercclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCrossConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCrossConnectionListResultPage) NotDone() bool { - return !page.ercclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCrossConnectionListResultPage) Response() ExpressRouteCrossConnectionListResult { - return page.ercclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCrossConnectionListResultPage) Values() []ExpressRouteCrossConnection { - if page.ercclr.IsEmpty() { - return nil - } - return *page.ercclr.Value -} - -// Creates a new instance of the ExpressRouteCrossConnectionListResultPage type. -func NewExpressRouteCrossConnectionListResultPage(cur ExpressRouteCrossConnectionListResult, getNextPage func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error)) ExpressRouteCrossConnectionListResultPage { - return ExpressRouteCrossConnectionListResultPage{ - fn: getNextPage, - ercclr: cur, - } -} - -// ExpressRouteCrossConnectionPeering peering in an ExpressRoute Cross Connection resource. -type ExpressRouteCrossConnectionPeering struct { - autorest.Response `json:"-"` - // ExpressRouteCrossConnectionPeeringProperties - Properties of the express route cross connection peering. - *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeering. -func (erccp ExpressRouteCrossConnectionPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccp.ExpressRouteCrossConnectionPeeringProperties != nil { - objectMap["properties"] = erccp.ExpressRouteCrossConnectionPeeringProperties - } - if erccp.Name != nil { - objectMap["name"] = erccp.Name - } - if erccp.ID != nil { - objectMap["id"] = erccp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteCrossConnectionPeering struct. -func (erccp *ExpressRouteCrossConnectionPeering) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteCrossConnectionPeeringProperties ExpressRouteCrossConnectionPeeringProperties - err = json.Unmarshal(*v, &expressRouteCrossConnectionPeeringProperties) - if err != nil { - return err - } - erccp.ExpressRouteCrossConnectionPeeringProperties = &expressRouteCrossConnectionPeeringProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erccp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erccp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erccp.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteCrossConnectionPeeringList response for ListPeering API service call retrieves all peerings -// that belong to an ExpressRouteCrossConnection. -type ExpressRouteCrossConnectionPeeringList struct { - autorest.Response `json:"-"` - // Value - The peerings in an express route cross connection. - Value *[]ExpressRouteCrossConnectionPeering `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringList. -func (erccpl ExpressRouteCrossConnectionPeeringList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccpl.Value != nil { - objectMap["value"] = erccpl.Value - } - return json.Marshal(objectMap) -} - -// ExpressRouteCrossConnectionPeeringListIterator provides access to a complete listing of -// ExpressRouteCrossConnectionPeering values. -type ExpressRouteCrossConnectionPeeringListIterator struct { - i int - page ExpressRouteCrossConnectionPeeringListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteCrossConnectionPeeringListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteCrossConnectionPeeringListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteCrossConnectionPeeringListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteCrossConnectionPeeringListIterator) Response() ExpressRouteCrossConnectionPeeringList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteCrossConnectionPeeringListIterator) Value() ExpressRouteCrossConnectionPeering { - if !iter.page.NotDone() { - return ExpressRouteCrossConnectionPeering{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteCrossConnectionPeeringListIterator type. -func NewExpressRouteCrossConnectionPeeringListIterator(page ExpressRouteCrossConnectionPeeringListPage) ExpressRouteCrossConnectionPeeringListIterator { - return ExpressRouteCrossConnectionPeeringListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erccpl ExpressRouteCrossConnectionPeeringList) IsEmpty() bool { - return erccpl.Value == nil || len(*erccpl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erccpl ExpressRouteCrossConnectionPeeringList) hasNextLink() bool { - return erccpl.NextLink != nil && len(*erccpl.NextLink) != 0 -} - -// expressRouteCrossConnectionPeeringListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erccpl ExpressRouteCrossConnectionPeeringList) expressRouteCrossConnectionPeeringListPreparer(ctx context.Context) (*http.Request, error) { - if !erccpl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erccpl.NextLink))) -} - -// ExpressRouteCrossConnectionPeeringListPage contains a page of ExpressRouteCrossConnectionPeering values. -type ExpressRouteCrossConnectionPeeringListPage struct { - fn func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error) - erccpl ExpressRouteCrossConnectionPeeringList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteCrossConnectionPeeringListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erccpl) - if err != nil { - return err - } - page.erccpl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteCrossConnectionPeeringListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteCrossConnectionPeeringListPage) NotDone() bool { - return !page.erccpl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteCrossConnectionPeeringListPage) Response() ExpressRouteCrossConnectionPeeringList { - return page.erccpl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteCrossConnectionPeeringListPage) Values() []ExpressRouteCrossConnectionPeering { - if page.erccpl.IsEmpty() { - return nil - } - return *page.erccpl.Value -} - -// Creates a new instance of the ExpressRouteCrossConnectionPeeringListPage type. -func NewExpressRouteCrossConnectionPeeringListPage(cur ExpressRouteCrossConnectionPeeringList, getNextPage func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error)) ExpressRouteCrossConnectionPeeringListPage { - return ExpressRouteCrossConnectionPeeringListPage{ - fn: getNextPage, - erccpl: cur, - } -} - -// ExpressRouteCrossConnectionPeeringProperties properties of express route cross connection peering. -type ExpressRouteCrossConnectionPeeringProperties struct { - // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' - PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` - // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' - State ExpressRoutePeeringState `json:"state,omitempty"` - // AzureASN - READ-ONLY; The Azure ASN. - AzureASN *int32 `json:"azureASN,omitempty"` - // PeerASN - The peer ASN. - PeerASN *int64 `json:"peerASN,omitempty"` - // PrimaryPeerAddressPrefix - The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - // SecondaryPeerAddressPrefix - The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - // PrimaryAzurePort - READ-ONLY; The primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - // SecondaryAzurePort - READ-ONLY; The secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - // SharedKey - The shared key. - SharedKey *string `json:"sharedKey,omitempty"` - // VlanID - The VLAN ID. - VlanID *int32 `json:"vlanId,omitempty"` - // MicrosoftPeeringConfig - The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route cross connection peering resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // GatewayManagerEtag - The GatewayManager Etag. - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - // LastModifiedBy - READ-ONLY; Who was the last to modify the peering. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // Ipv6PeeringConfig - The IPv6 peering configuration. - Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringProperties. -func (erccpp ExpressRouteCrossConnectionPeeringProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccpp.PeeringType != "" { - objectMap["peeringType"] = erccpp.PeeringType - } - if erccpp.State != "" { - objectMap["state"] = erccpp.State - } - if erccpp.PeerASN != nil { - objectMap["peerASN"] = erccpp.PeerASN - } - if erccpp.PrimaryPeerAddressPrefix != nil { - objectMap["primaryPeerAddressPrefix"] = erccpp.PrimaryPeerAddressPrefix - } - if erccpp.SecondaryPeerAddressPrefix != nil { - objectMap["secondaryPeerAddressPrefix"] = erccpp.SecondaryPeerAddressPrefix - } - if erccpp.SharedKey != nil { - objectMap["sharedKey"] = erccpp.SharedKey - } - if erccpp.VlanID != nil { - objectMap["vlanId"] = erccpp.VlanID - } - if erccpp.MicrosoftPeeringConfig != nil { - objectMap["microsoftPeeringConfig"] = erccpp.MicrosoftPeeringConfig - } - if erccpp.GatewayManagerEtag != nil { - objectMap["gatewayManagerEtag"] = erccpp.GatewayManagerEtag - } - if erccpp.Ipv6PeeringConfig != nil { - objectMap["ipv6PeeringConfig"] = erccpp.Ipv6PeeringConfig - } - return json.Marshal(objectMap) -} - -// ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionPeeringsClient) (ExpressRouteCrossConnectionPeering, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (erccp ExpressRouteCrossConnectionPeering, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erccp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erccp.Response.Response, err = future.GetResult(sender); err == nil && erccp.Response.Response.StatusCode != http.StatusNoContent { - erccp, err = client.CreateOrUpdateResponder(erccp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture", "Result", erccp.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionPeeringsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ExpressRouteCrossConnectionPeeringsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionPeeringsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionPeeringsDeleteFuture.Result. -func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteCrossConnectionProperties properties of ExpressRouteCrossConnection. -type ExpressRouteCrossConnectionProperties struct { - // PrimaryAzurePort - READ-ONLY; The name of the primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - // SecondaryAzurePort - READ-ONLY; The name of the secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - // STag - READ-ONLY; The identifier of the circuit traffic. - STag *int32 `json:"sTag,omitempty"` - // PeeringLocation - READ-ONLY; The peering location of the ExpressRoute circuit. - PeeringLocation *string `json:"peeringLocation,omitempty"` - // BandwidthInMbps - READ-ONLY; The circuit bandwidth In Mbps. - BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` - // ExpressRouteCircuit - The ExpressRouteCircuit. - ExpressRouteCircuit *ExpressRouteCircuitReference `json:"expressRouteCircuit,omitempty"` - // ServiceProviderProvisioningState - The provisioning state of the circuit in the connectivity provider system. Possible values include: 'ServiceProviderProvisioningStateNotProvisioned', 'ServiceProviderProvisioningStateProvisioning', 'ServiceProviderProvisioningStateProvisioned', 'ServiceProviderProvisioningStateDeprovisioning' - ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - // ServiceProviderNotes - Additional read only notes set by the connectivity provider. - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route cross connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Peerings - The list of peerings. - Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionProperties. -func (erccp ExpressRouteCrossConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccp.ExpressRouteCircuit != nil { - objectMap["expressRouteCircuit"] = erccp.ExpressRouteCircuit - } - if erccp.ServiceProviderProvisioningState != "" { - objectMap["serviceProviderProvisioningState"] = erccp.ServiceProviderProvisioningState - } - if erccp.ServiceProviderNotes != nil { - objectMap["serviceProviderNotes"] = erccp.ServiceProviderNotes - } - if erccp.Peerings != nil { - objectMap["peerings"] = erccp.Peerings - } - return json.Marshal(objectMap) -} - -// ExpressRouteCrossConnectionRoutesTableSummary the routes table associated with the ExpressRouteCircuit. -type ExpressRouteCrossConnectionRoutesTableSummary struct { - // Neighbor - IP address of Neighbor router. - Neighbor *string `json:"neighbor,omitempty"` - // Asn - Autonomous system number. - Asn *int32 `json:"asn,omitempty"` - // UpDown - The length of time that the BGP session has been in the Established state, or the current status if not in the Established state. - UpDown *string `json:"upDown,omitempty"` - // StateOrPrefixesReceived - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. - StateOrPrefixesReceived *string `json:"stateOrPrefixesReceived,omitempty"` -} - -// ExpressRouteCrossConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCrossConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionsCreateOrUpdateFuture.Result. -func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent { - ercc, err = client.CreateOrUpdateResponder(ercc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsCreateOrUpdateFuture", "Result", ercc.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionsListArpTableFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type ExpressRouteCrossConnectionsListArpTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsArpTableListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionsListArpTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionsListArpTableFuture.Result. -func (future *ExpressRouteCrossConnectionsListArpTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListArpTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercatlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListArpTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent { - ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionsListRoutesTableFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRouteCrossConnectionsListRoutesTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsRoutesTableListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionsListRoutesTableFuture.Result. -func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ercrtlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent { - ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type ExpressRouteCrossConnectionsListRoutesTableSummaryFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnectionsRoutesTableSummaryListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteCrossConnectionsListRoutesTableSummaryFuture.Result. -func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) result(client ExpressRouteCrossConnectionsClient) (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erccrtslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erccrtslr.Response.Response, err = future.GetResult(sender); err == nil && erccrtslr.Response.Response.StatusCode != http.StatusNoContent { - erccrtslr, err = client.ListRoutesTableSummaryResponder(erccrtslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture", "Result", erccrtslr.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteCrossConnectionsRoutesTableSummaryListResult response for ListRoutesTable associated with -// the Express Route Cross Connections. -type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { - autorest.Response `json:"-"` - // Value - A list of the routes table. - Value *[]ExpressRouteCrossConnectionRoutesTableSummary `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionsRoutesTableSummaryListResult. -func (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erccrtslr.Value != nil { - objectMap["value"] = erccrtslr.Value - } - return json.Marshal(objectMap) -} - -// ExpressRouteGateway expressRoute gateway resource. -type ExpressRouteGateway struct { - autorest.Response `json:"-"` - // ExpressRouteGatewayProperties - Properties of the express route gateway. - *ExpressRouteGatewayProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteGateway. -func (erg ExpressRouteGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erg.ExpressRouteGatewayProperties != nil { - objectMap["properties"] = erg.ExpressRouteGatewayProperties - } - if erg.ID != nil { - objectMap["id"] = erg.ID - } - if erg.Location != nil { - objectMap["location"] = erg.Location - } - if erg.Tags != nil { - objectMap["tags"] = erg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteGateway struct. -func (erg *ExpressRouteGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteGatewayProperties ExpressRouteGatewayProperties - err = json.Unmarshal(*v, &expressRouteGatewayProperties) - if err != nil { - return err - } - erg.ExpressRouteGatewayProperties = &expressRouteGatewayProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erg.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteGatewayList list of ExpressRoute gateways. -type ExpressRouteGatewayList struct { - autorest.Response `json:"-"` - // Value - List of ExpressRoute gateways. - Value *[]ExpressRouteGateway `json:"value,omitempty"` -} - -// ExpressRouteGatewayProperties expressRoute gateway resource properties. -type ExpressRouteGatewayProperties struct { - // AutoScaleConfiguration - Configuration for auto scaling. - AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - // ExpressRouteConnections - List of ExpressRoute connections to the ExpressRoute gateway. - ExpressRouteConnections *[]ExpressRouteConnection `json:"expressRouteConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VirtualHub - The Virtual Hub where the ExpressRoute gateway is or will be deployed. - VirtualHub *VirtualHubID `json:"virtualHub,omitempty"` - // AllowNonVirtualWanTraffic - Configures this gateway to accept traffic from non Virtual WAN networks. - AllowNonVirtualWanTraffic *bool `json:"allowNonVirtualWanTraffic,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteGatewayProperties. -func (ergp ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ergp.AutoScaleConfiguration != nil { - objectMap["autoScaleConfiguration"] = ergp.AutoScaleConfiguration - } - if ergp.ExpressRouteConnections != nil { - objectMap["expressRouteConnections"] = ergp.ExpressRouteConnections - } - if ergp.VirtualHub != nil { - objectMap["virtualHub"] = ergp.VirtualHub - } - if ergp.AllowNonVirtualWanTraffic != nil { - objectMap["allowNonVirtualWanTraffic"] = ergp.AllowNonVirtualWanTraffic - } - return json.Marshal(objectMap) -} - -// ExpressRouteGatewayPropertiesAutoScaleConfiguration configuration for auto scaling. -type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct { - // Bounds - Minimum and maximum number of scale units to deploy. - Bounds *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds `json:"bounds,omitempty"` -} - -// ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds minimum and maximum number of scale units to -// deploy. -type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct { - // Min - Minimum number of scale units deployed for ExpressRoute gateway. - Min *int32 `json:"min,omitempty"` - // Max - Maximum number of scale units deployed for ExpressRoute gateway. - Max *int32 `json:"max,omitempty"` -} - -// ExpressRouteGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteGatewaysClient) (ExpressRouteGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteGatewaysCreateOrUpdateFuture.Result. -func (future *ExpressRouteGatewaysCreateOrUpdateFuture) result(client ExpressRouteGatewaysClient) (erg ExpressRouteGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erg.Response.Response, err = future.GetResult(sender); err == nil && erg.Response.Response.StatusCode != http.StatusNoContent { - erg, err = client.CreateOrUpdateResponder(erg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysCreateOrUpdateFuture", "Result", erg.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteGatewaysDeleteFuture.Result. -func (future *ExpressRouteGatewaysDeleteFuture) result(client ExpressRouteGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRouteGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRouteGatewaysUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRouteGatewaysClient) (ExpressRouteGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRouteGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRouteGatewaysUpdateTagsFuture.Result. -func (future *ExpressRouteGatewaysUpdateTagsFuture) result(client ExpressRouteGatewaysClient) (erg ExpressRouteGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erg.Response.Response, err = future.GetResult(sender); err == nil && erg.Response.Response.StatusCode != http.StatusNoContent { - erg, err = client.UpdateTagsResponder(erg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysUpdateTagsFuture", "Result", erg.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRouteLink expressRouteLink child resource definition. -type ExpressRouteLink struct { - autorest.Response `json:"-"` - // ExpressRouteLinkPropertiesFormat - ExpressRouteLink properties. - *ExpressRouteLinkPropertiesFormat `json:"properties,omitempty"` - // Name - Name of child port resource that is unique among child port resources of the parent. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteLink. -func (erl ExpressRouteLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erl.ExpressRouteLinkPropertiesFormat != nil { - objectMap["properties"] = erl.ExpressRouteLinkPropertiesFormat - } - if erl.Name != nil { - objectMap["name"] = erl.Name - } - if erl.ID != nil { - objectMap["id"] = erl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteLink struct. -func (erl *ExpressRouteLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteLinkPropertiesFormat ExpressRouteLinkPropertiesFormat - err = json.Unmarshal(*v, &expressRouteLinkPropertiesFormat) - if err != nil { - return err - } - erl.ExpressRouteLinkPropertiesFormat = &expressRouteLinkPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erl.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erl.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erl.ID = &ID - } - } - } - - return nil -} - -// ExpressRouteLinkListResult response for ListExpressRouteLinks API service call. -type ExpressRouteLinkListResult struct { - autorest.Response `json:"-"` - // Value - The list of ExpressRouteLink sub-resources. - Value *[]ExpressRouteLink `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteLinkListResultIterator provides access to a complete listing of ExpressRouteLink values. -type ExpressRouteLinkListResultIterator struct { - i int - page ExpressRouteLinkListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteLinkListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinkListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteLinkListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteLinkListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteLinkListResultIterator) Response() ExpressRouteLinkListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteLinkListResultIterator) Value() ExpressRouteLink { - if !iter.page.NotDone() { - return ExpressRouteLink{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteLinkListResultIterator type. -func NewExpressRouteLinkListResultIterator(page ExpressRouteLinkListResultPage) ExpressRouteLinkListResultIterator { - return ExpressRouteLinkListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erllr ExpressRouteLinkListResult) IsEmpty() bool { - return erllr.Value == nil || len(*erllr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erllr ExpressRouteLinkListResult) hasNextLink() bool { - return erllr.NextLink != nil && len(*erllr.NextLink) != 0 -} - -// expressRouteLinkListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erllr ExpressRouteLinkListResult) expressRouteLinkListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erllr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erllr.NextLink))) -} - -// ExpressRouteLinkListResultPage contains a page of ExpressRouteLink values. -type ExpressRouteLinkListResultPage struct { - fn func(context.Context, ExpressRouteLinkListResult) (ExpressRouteLinkListResult, error) - erllr ExpressRouteLinkListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteLinkListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinkListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erllr) - if err != nil { - return err - } - page.erllr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteLinkListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteLinkListResultPage) NotDone() bool { - return !page.erllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteLinkListResultPage) Response() ExpressRouteLinkListResult { - return page.erllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteLinkListResultPage) Values() []ExpressRouteLink { - if page.erllr.IsEmpty() { - return nil - } - return *page.erllr.Value -} - -// Creates a new instance of the ExpressRouteLinkListResultPage type. -func NewExpressRouteLinkListResultPage(cur ExpressRouteLinkListResult, getNextPage func(context.Context, ExpressRouteLinkListResult) (ExpressRouteLinkListResult, error)) ExpressRouteLinkListResultPage { - return ExpressRouteLinkListResultPage{ - fn: getNextPage, - erllr: cur, - } -} - -// ExpressRouteLinkMacSecConfig expressRouteLink Mac Security Configuration. -type ExpressRouteLinkMacSecConfig struct { - // CknSecretIdentifier - Keyvault Secret Identifier URL containing Mac security CKN key. - CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` - // CakSecretIdentifier - Keyvault Secret Identifier URL containing Mac security CAK key. - CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - // Cipher - Mac security cipher. Possible values include: 'GcmAes256', 'GcmAes128', 'GcmAesXpn128', 'GcmAesXpn256' - Cipher ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` - // SciState - Sci mode enabled/disabled. Possible values include: 'ExpressRouteLinkMacSecSciStateDisabled', 'ExpressRouteLinkMacSecSciStateEnabled' - SciState ExpressRouteLinkMacSecSciState `json:"sciState,omitempty"` -} - -// ExpressRouteLinkPropertiesFormat properties specific to ExpressRouteLink resources. -type ExpressRouteLinkPropertiesFormat struct { - // RouterName - READ-ONLY; Name of Azure router associated with physical port. - RouterName *string `json:"routerName,omitempty"` - // InterfaceName - READ-ONLY; Name of Azure router interface. - InterfaceName *string `json:"interfaceName,omitempty"` - // PatchPanelID - READ-ONLY; Mapping between physical port to patch panel port. - PatchPanelID *string `json:"patchPanelId,omitempty"` - // RackID - READ-ONLY; Mapping of physical patch panel to rack. - RackID *string `json:"rackId,omitempty"` - // ColoLocation - READ-ONLY; Cololocation for ExpressRoute Hybrid Direct. - ColoLocation *string `json:"coloLocation,omitempty"` - // ConnectorType - READ-ONLY; Physical fiber port type. Possible values include: 'LC', 'SC' - ConnectorType ExpressRouteLinkConnectorType `json:"connectorType,omitempty"` - // AdminState - Administrative state of the physical port. Possible values include: 'ExpressRouteLinkAdminStateEnabled', 'ExpressRouteLinkAdminStateDisabled' - AdminState ExpressRouteLinkAdminState `json:"adminState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route link resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // MacSecConfig - MacSec configuration. - MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteLinkPropertiesFormat. -func (erlpf ExpressRouteLinkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erlpf.AdminState != "" { - objectMap["adminState"] = erlpf.AdminState - } - if erlpf.MacSecConfig != nil { - objectMap["macSecConfig"] = erlpf.MacSecConfig - } - return json.Marshal(objectMap) -} - -// ExpressRoutePort expressRoutePort resource definition. -type ExpressRoutePort struct { - autorest.Response `json:"-"` - // ExpressRoutePortPropertiesFormat - ExpressRoutePort properties. - *ExpressRoutePortPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Identity - The identity of ExpressRoutePort, if configured. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePort. -func (erp ExpressRoutePort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erp.ExpressRoutePortPropertiesFormat != nil { - objectMap["properties"] = erp.ExpressRoutePortPropertiesFormat - } - if erp.Identity != nil { - objectMap["identity"] = erp.Identity - } - if erp.ID != nil { - objectMap["id"] = erp.ID - } - if erp.Location != nil { - objectMap["location"] = erp.Location - } - if erp.Tags != nil { - objectMap["tags"] = erp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRoutePort struct. -func (erp *ExpressRoutePort) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRoutePortPropertiesFormat ExpressRoutePortPropertiesFormat - err = json.Unmarshal(*v, &expressRoutePortPropertiesFormat) - if err != nil { - return err - } - erp.ExpressRoutePortPropertiesFormat = &expressRoutePortPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erp.Etag = &etag - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - erp.Identity = &identity - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erp.Tags = tags - } - } - } - - return nil -} - -// ExpressRoutePortAuthorization expressRoutePort Authorization resource definition. -type ExpressRoutePortAuthorization struct { - autorest.Response `json:"-"` - // ExpressRoutePortAuthorizationPropertiesFormat - ExpressRoutePort properties. - *ExpressRoutePortAuthorizationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortAuthorization. -func (erpa ExpressRoutePortAuthorization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erpa.ExpressRoutePortAuthorizationPropertiesFormat != nil { - objectMap["properties"] = erpa.ExpressRoutePortAuthorizationPropertiesFormat - } - if erpa.Name != nil { - objectMap["name"] = erpa.Name - } - if erpa.ID != nil { - objectMap["id"] = erpa.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRoutePortAuthorization struct. -func (erpa *ExpressRoutePortAuthorization) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRoutePortAuthorizationPropertiesFormat ExpressRoutePortAuthorizationPropertiesFormat - err = json.Unmarshal(*v, &expressRoutePortAuthorizationPropertiesFormat) - if err != nil { - return err - } - erpa.ExpressRoutePortAuthorizationPropertiesFormat = &expressRoutePortAuthorizationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erpa.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erpa.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erpa.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erpa.ID = &ID - } - } - } - - return nil -} - -// ExpressRoutePortAuthorizationListResult response for ListExpressRoutePortAuthorizations API service -// call. -type ExpressRoutePortAuthorizationListResult struct { - autorest.Response `json:"-"` - // Value - The authorizations in an ExpressRoute Port. - Value *[]ExpressRoutePortAuthorization `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRoutePortAuthorizationListResultIterator provides access to a complete listing of -// ExpressRoutePortAuthorization values. -type ExpressRoutePortAuthorizationListResultIterator struct { - i int - page ExpressRoutePortAuthorizationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRoutePortAuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRoutePortAuthorizationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRoutePortAuthorizationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRoutePortAuthorizationListResultIterator) Response() ExpressRoutePortAuthorizationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRoutePortAuthorizationListResultIterator) Value() ExpressRoutePortAuthorization { - if !iter.page.NotDone() { - return ExpressRoutePortAuthorization{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRoutePortAuthorizationListResultIterator type. -func NewExpressRoutePortAuthorizationListResultIterator(page ExpressRoutePortAuthorizationListResultPage) ExpressRoutePortAuthorizationListResultIterator { - return ExpressRoutePortAuthorizationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erpalr ExpressRoutePortAuthorizationListResult) IsEmpty() bool { - return erpalr.Value == nil || len(*erpalr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erpalr ExpressRoutePortAuthorizationListResult) hasNextLink() bool { - return erpalr.NextLink != nil && len(*erpalr.NextLink) != 0 -} - -// expressRoutePortAuthorizationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erpalr ExpressRoutePortAuthorizationListResult) expressRoutePortAuthorizationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erpalr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erpalr.NextLink))) -} - -// ExpressRoutePortAuthorizationListResultPage contains a page of ExpressRoutePortAuthorization values. -type ExpressRoutePortAuthorizationListResultPage struct { - fn func(context.Context, ExpressRoutePortAuthorizationListResult) (ExpressRoutePortAuthorizationListResult, error) - erpalr ExpressRoutePortAuthorizationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRoutePortAuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortAuthorizationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erpalr) - if err != nil { - return err - } - page.erpalr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRoutePortAuthorizationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRoutePortAuthorizationListResultPage) NotDone() bool { - return !page.erpalr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRoutePortAuthorizationListResultPage) Response() ExpressRoutePortAuthorizationListResult { - return page.erpalr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRoutePortAuthorizationListResultPage) Values() []ExpressRoutePortAuthorization { - if page.erpalr.IsEmpty() { - return nil - } - return *page.erpalr.Value -} - -// Creates a new instance of the ExpressRoutePortAuthorizationListResultPage type. -func NewExpressRoutePortAuthorizationListResultPage(cur ExpressRoutePortAuthorizationListResult, getNextPage func(context.Context, ExpressRoutePortAuthorizationListResult) (ExpressRoutePortAuthorizationListResult, error)) ExpressRoutePortAuthorizationListResultPage { - return ExpressRoutePortAuthorizationListResultPage{ - fn: getNextPage, - erpalr: cur, - } -} - -// ExpressRoutePortAuthorizationPropertiesFormat properties of ExpressRoutePort Authorization. -type ExpressRoutePortAuthorizationPropertiesFormat struct { - // AuthorizationKey - READ-ONLY; The authorization key. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // AuthorizationUseStatus - READ-ONLY; The authorization use status. Possible values include: 'ExpressRoutePortAuthorizationUseStatusAvailable', 'ExpressRoutePortAuthorizationUseStatusInUse' - AuthorizationUseStatus ExpressRoutePortAuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - // CircuitResourceURI - READ-ONLY; The reference to the ExpressRoute circuit resource using the authorization. - CircuitResourceURI *string `json:"circuitResourceUri,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the authorization resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortAuthorizationPropertiesFormat. -func (erpapf ExpressRoutePortAuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ExpressRoutePortAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ExpressRoutePortAuthorizationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRoutePortAuthorizationsClient) (ExpressRoutePortAuthorization, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRoutePortAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRoutePortAuthorizationsCreateOrUpdateFuture.Result. -func (future *ExpressRoutePortAuthorizationsCreateOrUpdateFuture) result(client ExpressRoutePortAuthorizationsClient) (erpa ExpressRoutePortAuthorization, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erpa.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortAuthorizationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erpa.Response.Response, err = future.GetResult(sender); err == nil && erpa.Response.Response.StatusCode != http.StatusNoContent { - erpa, err = client.CreateOrUpdateResponder(erpa.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsCreateOrUpdateFuture", "Result", erpa.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRoutePortAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRoutePortAuthorizationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRoutePortAuthorizationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRoutePortAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRoutePortAuthorizationsDeleteFuture.Result. -func (future *ExpressRoutePortAuthorizationsDeleteFuture) result(client ExpressRoutePortAuthorizationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortAuthorizationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRoutePortListResult response for ListExpressRoutePorts API service call. -type ExpressRoutePortListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRoutePort resources. - Value *[]ExpressRoutePort `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRoutePortListResultIterator provides access to a complete listing of ExpressRoutePort values. -type ExpressRoutePortListResultIterator struct { - i int - page ExpressRoutePortListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRoutePortListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRoutePortListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRoutePortListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRoutePortListResultIterator) Response() ExpressRoutePortListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRoutePortListResultIterator) Value() ExpressRoutePort { - if !iter.page.NotDone() { - return ExpressRoutePort{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRoutePortListResultIterator type. -func NewExpressRoutePortListResultIterator(page ExpressRoutePortListResultPage) ExpressRoutePortListResultIterator { - return ExpressRoutePortListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erplr ExpressRoutePortListResult) IsEmpty() bool { - return erplr.Value == nil || len(*erplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erplr ExpressRoutePortListResult) hasNextLink() bool { - return erplr.NextLink != nil && len(*erplr.NextLink) != 0 -} - -// expressRoutePortListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erplr ExpressRoutePortListResult) expressRoutePortListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erplr.NextLink))) -} - -// ExpressRoutePortListResultPage contains a page of ExpressRoutePort values. -type ExpressRoutePortListResultPage struct { - fn func(context.Context, ExpressRoutePortListResult) (ExpressRoutePortListResult, error) - erplr ExpressRoutePortListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRoutePortListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erplr) - if err != nil { - return err - } - page.erplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRoutePortListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRoutePortListResultPage) NotDone() bool { - return !page.erplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRoutePortListResultPage) Response() ExpressRoutePortListResult { - return page.erplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRoutePortListResultPage) Values() []ExpressRoutePort { - if page.erplr.IsEmpty() { - return nil - } - return *page.erplr.Value -} - -// Creates a new instance of the ExpressRoutePortListResultPage type. -func NewExpressRoutePortListResultPage(cur ExpressRoutePortListResult, getNextPage func(context.Context, ExpressRoutePortListResult) (ExpressRoutePortListResult, error)) ExpressRoutePortListResultPage { - return ExpressRoutePortListResultPage{ - fn: getNextPage, - erplr: cur, - } -} - -// ExpressRoutePortPropertiesFormat properties specific to ExpressRoutePort resources. -type ExpressRoutePortPropertiesFormat struct { - // PeeringLocation - The name of the peering location that the ExpressRoutePort is mapped to physically. - PeeringLocation *string `json:"peeringLocation,omitempty"` - // BandwidthInGbps - Bandwidth of procured ports in Gbps. - BandwidthInGbps *int32 `json:"bandwidthInGbps,omitempty"` - // ProvisionedBandwidthInGbps - READ-ONLY; Aggregate Gbps of associated circuit bandwidths. - ProvisionedBandwidthInGbps *float64 `json:"provisionedBandwidthInGbps,omitempty"` - // Mtu - READ-ONLY; Maximum transmission unit of the physical port pair(s). - Mtu *string `json:"mtu,omitempty"` - // Encapsulation - Encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' - Encapsulation ExpressRoutePortsEncapsulation `json:"encapsulation,omitempty"` - // EtherType - READ-ONLY; Ether type of the physical port. - EtherType *string `json:"etherType,omitempty"` - // AllocationDate - READ-ONLY; Date of the physical port allocation to be used in Letter of Authorization. - AllocationDate *string `json:"allocationDate,omitempty"` - // Links - The set of physical links of the ExpressRoutePort resource. - Links *[]ExpressRouteLink `json:"links,omitempty"` - // Circuits - READ-ONLY; Reference the ExpressRoute circuit(s) that are provisioned on this ExpressRoutePort resource. - Circuits *[]SubResource `json:"circuits,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route port resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the express route port resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // BillingType - The billing type of the ExpressRoutePort resource. Possible values include: 'ExpressRoutePortsBillingTypeMeteredData', 'ExpressRoutePortsBillingTypeUnlimitedData' - BillingType ExpressRoutePortsBillingType `json:"billingType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortPropertiesFormat. -func (erppf ExpressRoutePortPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erppf.PeeringLocation != nil { - objectMap["peeringLocation"] = erppf.PeeringLocation - } - if erppf.BandwidthInGbps != nil { - objectMap["bandwidthInGbps"] = erppf.BandwidthInGbps - } - if erppf.Encapsulation != "" { - objectMap["encapsulation"] = erppf.Encapsulation - } - if erppf.Links != nil { - objectMap["links"] = erppf.Links - } - if erppf.BillingType != "" { - objectMap["billingType"] = erppf.BillingType - } - return json.Marshal(objectMap) -} - -// ExpressRoutePortsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ExpressRoutePortsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRoutePortsClient) (ExpressRoutePort, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRoutePortsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRoutePortsCreateOrUpdateFuture.Result. -func (future *ExpressRoutePortsCreateOrUpdateFuture) result(client ExpressRoutePortsClient) (erp ExpressRoutePort, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erp.Response.Response, err = future.GetResult(sender); err == nil && erp.Response.Response.StatusCode != http.StatusNoContent { - erp, err = client.CreateOrUpdateResponder(erp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsCreateOrUpdateFuture", "Result", erp.Response.Response, "Failure responding to request") - } - } - return -} - -// ExpressRoutePortsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ExpressRoutePortsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ExpressRoutePortsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ExpressRoutePortsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ExpressRoutePortsDeleteFuture.Result. -func (future *ExpressRoutePortsDeleteFuture) result(client ExpressRoutePortsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ExpressRoutePortsLocation definition of the ExpressRoutePorts peering location resource. -type ExpressRoutePortsLocation struct { - autorest.Response `json:"-"` - // ExpressRoutePortsLocationPropertiesFormat - ExpressRoutePort peering location properties. - *ExpressRoutePortsLocationPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortsLocation. -func (erpl ExpressRoutePortsLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erpl.ExpressRoutePortsLocationPropertiesFormat != nil { - objectMap["properties"] = erpl.ExpressRoutePortsLocationPropertiesFormat - } - if erpl.ID != nil { - objectMap["id"] = erpl.ID - } - if erpl.Location != nil { - objectMap["location"] = erpl.Location - } - if erpl.Tags != nil { - objectMap["tags"] = erpl.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRoutePortsLocation struct. -func (erpl *ExpressRoutePortsLocation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRoutePortsLocationPropertiesFormat ExpressRoutePortsLocationPropertiesFormat - err = json.Unmarshal(*v, &expressRoutePortsLocationPropertiesFormat) - if err != nil { - return err - } - erpl.ExpressRoutePortsLocationPropertiesFormat = &expressRoutePortsLocationPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erpl.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erpl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erpl.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erpl.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erpl.Tags = tags - } - } - } - - return nil -} - -// ExpressRoutePortsLocationBandwidths real-time inventory of available ExpressRoute port bandwidths. -type ExpressRoutePortsLocationBandwidths struct { - // OfferName - READ-ONLY; Bandwidth descriptive name. - OfferName *string `json:"offerName,omitempty"` - // ValueInGbps - READ-ONLY; Bandwidth value in Gbps. - ValueInGbps *int32 `json:"valueInGbps,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortsLocationBandwidths. -func (erplb ExpressRoutePortsLocationBandwidths) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ExpressRoutePortsLocationListResult response for ListExpressRoutePortsLocations API service call. -type ExpressRoutePortsLocationListResult struct { - autorest.Response `json:"-"` - // Value - The list of all ExpressRoutePort peering locations. - Value *[]ExpressRoutePortsLocation `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRoutePortsLocationListResultIterator provides access to a complete listing of -// ExpressRoutePortsLocation values. -type ExpressRoutePortsLocationListResultIterator struct { - i int - page ExpressRoutePortsLocationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRoutePortsLocationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRoutePortsLocationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRoutePortsLocationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRoutePortsLocationListResultIterator) Response() ExpressRoutePortsLocationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRoutePortsLocationListResultIterator) Value() ExpressRoutePortsLocation { - if !iter.page.NotDone() { - return ExpressRoutePortsLocation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRoutePortsLocationListResultIterator type. -func NewExpressRoutePortsLocationListResultIterator(page ExpressRoutePortsLocationListResultPage) ExpressRoutePortsLocationListResultIterator { - return ExpressRoutePortsLocationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (erpllr ExpressRoutePortsLocationListResult) IsEmpty() bool { - return erpllr.Value == nil || len(*erpllr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (erpllr ExpressRoutePortsLocationListResult) hasNextLink() bool { - return erpllr.NextLink != nil && len(*erpllr.NextLink) != 0 -} - -// expressRoutePortsLocationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (erpllr ExpressRoutePortsLocationListResult) expressRoutePortsLocationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !erpllr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(erpllr.NextLink))) -} - -// ExpressRoutePortsLocationListResultPage contains a page of ExpressRoutePortsLocation values. -type ExpressRoutePortsLocationListResultPage struct { - fn func(context.Context, ExpressRoutePortsLocationListResult) (ExpressRoutePortsLocationListResult, error) - erpllr ExpressRoutePortsLocationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRoutePortsLocationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.erpllr) - if err != nil { - return err - } - page.erpllr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRoutePortsLocationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRoutePortsLocationListResultPage) NotDone() bool { - return !page.erpllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRoutePortsLocationListResultPage) Response() ExpressRoutePortsLocationListResult { - return page.erpllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRoutePortsLocationListResultPage) Values() []ExpressRoutePortsLocation { - if page.erpllr.IsEmpty() { - return nil - } - return *page.erpllr.Value -} - -// Creates a new instance of the ExpressRoutePortsLocationListResultPage type. -func NewExpressRoutePortsLocationListResultPage(cur ExpressRoutePortsLocationListResult, getNextPage func(context.Context, ExpressRoutePortsLocationListResult) (ExpressRoutePortsLocationListResult, error)) ExpressRoutePortsLocationListResultPage { - return ExpressRoutePortsLocationListResultPage{ - fn: getNextPage, - erpllr: cur, - } -} - -// ExpressRoutePortsLocationPropertiesFormat properties specific to ExpressRoutePorts peering location -// resources. -type ExpressRoutePortsLocationPropertiesFormat struct { - // Address - READ-ONLY; Address of peering location. - Address *string `json:"address,omitempty"` - // Contact - READ-ONLY; Contact details of peering locations. - Contact *string `json:"contact,omitempty"` - // AvailableBandwidths - The inventory of available ExpressRoutePort bandwidths. - AvailableBandwidths *[]ExpressRoutePortsLocationBandwidths `json:"availableBandwidths,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route port location resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRoutePortsLocationPropertiesFormat. -func (erplpf ExpressRoutePortsLocationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erplpf.AvailableBandwidths != nil { - objectMap["availableBandwidths"] = erplpf.AvailableBandwidths - } - return json.Marshal(objectMap) -} - -// ExpressRouteProviderPort expressRouteProviderPort resource. -type ExpressRouteProviderPort struct { - autorest.Response `json:"-"` - // ExpressRouteProviderPortProperties - Properties of the express route Service Provider Port. - *ExpressRouteProviderPortProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteProviderPort. -func (erpp ExpressRouteProviderPort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erpp.ExpressRouteProviderPortProperties != nil { - objectMap["properties"] = erpp.ExpressRouteProviderPortProperties - } - if erpp.ID != nil { - objectMap["id"] = erpp.ID - } - if erpp.Location != nil { - objectMap["location"] = erpp.Location - } - if erpp.Tags != nil { - objectMap["tags"] = erpp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteProviderPort struct. -func (erpp *ExpressRouteProviderPort) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteProviderPortProperties ExpressRouteProviderPortProperties - err = json.Unmarshal(*v, &expressRouteProviderPortProperties) - if err != nil { - return err - } - erpp.ExpressRouteProviderPortProperties = &expressRouteProviderPortProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - erpp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - erpp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - erpp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - erpp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - erpp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - erpp.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteProviderPortListResult response for ListExpressRouteProviderPort API service call. -type ExpressRouteProviderPortListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRouteProviderPort resources. - Value *[]ExpressRouteProviderPort `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteProviderPortListResult. -func (erpplr ExpressRouteProviderPortListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erpplr.Value != nil { - objectMap["value"] = erpplr.Value - } - return json.Marshal(objectMap) -} - -// ExpressRouteProviderPortProperties properties of ExpressRouteProviderPort. -type ExpressRouteProviderPortProperties struct { - // PortPairDescriptor - READ-ONLY; The name of the port pair. - PortPairDescriptor *string `json:"portPairDescriptor,omitempty"` - // PrimaryAzurePort - READ-ONLY; The name of the primary port. - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - // SecondaryAzurePort - READ-ONLY; The name of the secondary port. - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - // PeeringLocation - The peering location of the port pair. - PeeringLocation *string `json:"peeringLocation,omitempty"` - // OverprovisionFactor - Overprovisioning factor for the port pair. - OverprovisionFactor *int32 `json:"overprovisionFactor,omitempty"` - // PortBandwidthInMbps - Bandwidth of the port in Mbps - PortBandwidthInMbps *int32 `json:"portBandwidthInMbps,omitempty"` - // UsedBandwidthInMbps - Used Bandwidth of the port in Mbps - UsedBandwidthInMbps *int32 `json:"usedBandwidthInMbps,omitempty"` - // RemainingBandwidthInMbps - Remaining Bandwidth of the port in Mbps - RemainingBandwidthInMbps *int32 `json:"remainingBandwidthInMbps,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteProviderPortProperties. -func (erppp ExpressRouteProviderPortProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if erppp.PeeringLocation != nil { - objectMap["peeringLocation"] = erppp.PeeringLocation - } - if erppp.OverprovisionFactor != nil { - objectMap["overprovisionFactor"] = erppp.OverprovisionFactor - } - if erppp.PortBandwidthInMbps != nil { - objectMap["portBandwidthInMbps"] = erppp.PortBandwidthInMbps - } - if erppp.UsedBandwidthInMbps != nil { - objectMap["usedBandwidthInMbps"] = erppp.UsedBandwidthInMbps - } - if erppp.RemainingBandwidthInMbps != nil { - objectMap["remainingBandwidthInMbps"] = erppp.RemainingBandwidthInMbps - } - return json.Marshal(objectMap) -} - -// ExpressRouteServiceProvider a ExpressRouteResourceProvider object. -type ExpressRouteServiceProvider struct { - // ExpressRouteServiceProviderPropertiesFormat - Properties of the express route service provider. - *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteServiceProvider. -func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ersp.ExpressRouteServiceProviderPropertiesFormat != nil { - objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat - } - if ersp.ID != nil { - objectMap["id"] = ersp.ID - } - if ersp.Location != nil { - objectMap["location"] = ersp.Location - } - if ersp.Tags != nil { - objectMap["tags"] = ersp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct. -func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat - err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat) - if err != nil { - return err - } - ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ersp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ersp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ersp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ersp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ersp.Tags = tags - } - } - } - - return nil -} - -// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider -// resources. -type ExpressRouteServiceProviderBandwidthsOffered struct { - // OfferName - The OfferName. - OfferName *string `json:"offerName,omitempty"` - // ValueInMbps - The ValueInMbps. - ValueInMbps *int32 `json:"valueInMbps,omitempty"` -} - -// ExpressRouteServiceProviderListResult response for the ListExpressRouteServiceProvider API service call. -type ExpressRouteServiceProviderListResult struct { - autorest.Response `json:"-"` - // Value - A list of ExpressRouteResourceProvider resources. - Value *[]ExpressRouteServiceProvider `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of -// ExpressRouteServiceProvider values. -type ExpressRouteServiceProviderListResultIterator struct { - i int - page ExpressRouteServiceProviderListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExpressRouteServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExpressRouteServiceProviderListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExpressRouteServiceProviderListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ExpressRouteServiceProviderListResultIterator) Response() ExpressRouteServiceProviderListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExpressRouteServiceProviderListResultIterator) Value() ExpressRouteServiceProvider { - if !iter.page.NotDone() { - return ExpressRouteServiceProvider{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ExpressRouteServiceProviderListResultIterator type. -func NewExpressRouteServiceProviderListResultIterator(page ExpressRouteServiceProviderListResultPage) ExpressRouteServiceProviderListResultIterator { - return ExpressRouteServiceProviderListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool { - return ersplr.Value == nil || len(*ersplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool { - return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0 -} - -// expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ersplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ersplr.NextLink))) -} - -// ExpressRouteServiceProviderListResultPage contains a page of ExpressRouteServiceProvider values. -type ExpressRouteServiceProviderListResultPage struct { - fn func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error) - ersplr ExpressRouteServiceProviderListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ersplr) - if err != nil { - return err - } - page.ersplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExpressRouteServiceProviderListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExpressRouteServiceProviderListResultPage) NotDone() bool { - return !page.ersplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ExpressRouteServiceProviderListResultPage) Response() ExpressRouteServiceProviderListResult { - return page.ersplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteServiceProvider { - if page.ersplr.IsEmpty() { - return nil - } - return *page.ersplr.Value -} - -// Creates a new instance of the ExpressRouteServiceProviderListResultPage type. -func NewExpressRouteServiceProviderListResultPage(cur ExpressRouteServiceProviderListResult, getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage { - return ExpressRouteServiceProviderListResultPage{ - fn: getNextPage, - ersplr: cur, - } -} - -// ExpressRouteServiceProviderPropertiesFormat properties of ExpressRouteServiceProvider. -type ExpressRouteServiceProviderPropertiesFormat struct { - // PeeringLocations - A list of peering locations. - PeeringLocations *[]string `json:"peeringLocations,omitempty"` - // BandwidthsOffered - A list of bandwidths offered. - BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the express route service provider resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ExpressRouteServiceProviderPropertiesFormat. -func (ersppf ExpressRouteServiceProviderPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ersppf.PeeringLocations != nil { - objectMap["peeringLocations"] = ersppf.PeeringLocations - } - if ersppf.BandwidthsOffered != nil { - objectMap["bandwidthsOffered"] = ersppf.BandwidthsOffered - } - return json.Marshal(objectMap) -} - -// ExtendedLocation extendedLocation complex type. -type ExtendedLocation struct { - // Name - The name of the extended location. - Name *string `json:"name,omitempty"` - // Type - The type of the extended location. Possible values include: 'EdgeZone' - Type ExtendedLocationTypes `json:"type,omitempty"` -} - -// FilterItems will contain the filter name and values to operate on -type FilterItems struct { - // Field - The name of the field we would like to filter - Field *string `json:"field,omitempty"` - // Values - List of values to filter the current field by - Values *[]string `json:"values,omitempty"` -} - -// FirewallPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type FirewallPoliciesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallPoliciesClient) (FirewallPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallPoliciesCreateOrUpdateFuture.Result. -func (future *FirewallPoliciesCreateOrUpdateFuture) result(client FirewallPoliciesClient) (fp FirewallPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FirewallPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fp.Response.Response, err = future.GetResult(sender); err == nil && fp.Response.Response.StatusCode != http.StatusNoContent { - fp, err = client.CreateOrUpdateResponder(fp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesCreateOrUpdateFuture", "Result", fp.Response.Response, "Failure responding to request") - } - } - return -} - -// FirewallPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FirewallPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallPoliciesDeleteFuture.Result. -func (future *FirewallPoliciesDeleteFuture) result(client FirewallPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FirewallPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// FirewallPolicy firewallPolicy Resource. -type FirewallPolicy struct { - autorest.Response `json:"-"` - // FirewallPolicyPropertiesFormat - Properties of the firewall policy. - *FirewallPolicyPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Identity - The identity of the firewall policy. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicy. -func (fp FirewallPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fp.FirewallPolicyPropertiesFormat != nil { - objectMap["properties"] = fp.FirewallPolicyPropertiesFormat - } - if fp.Identity != nil { - objectMap["identity"] = fp.Identity - } - if fp.ID != nil { - objectMap["id"] = fp.ID - } - if fp.Location != nil { - objectMap["location"] = fp.Location - } - if fp.Tags != nil { - objectMap["tags"] = fp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicy struct. -func (fp *FirewallPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var firewallPolicyPropertiesFormat FirewallPolicyPropertiesFormat - err = json.Unmarshal(*v, &firewallPolicyPropertiesFormat) - if err != nil { - return err - } - fp.FirewallPolicyPropertiesFormat = &firewallPolicyPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - fp.Etag = &etag - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - fp.Identity = &identity - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - fp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - fp.Tags = tags - } - } - } - - return nil -} - -// FirewallPolicyCertificateAuthority trusted Root certificates properties for tls. -type FirewallPolicyCertificateAuthority struct { - // KeyVaultSecretID - Secret Id of (base-64 encoded unencrypted pfx) 'Secret' or 'Certificate' object stored in KeyVault. - KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"` - // Name - Name of the CA certificate. - Name *string `json:"name,omitempty"` -} - -// FirewallPolicyFilterRuleCollection firewall Policy Filter Rule Collection. -type FirewallPolicyFilterRuleCollection struct { - // Action - The action type of a Filter rule collection. - Action *FirewallPolicyFilterRuleCollectionAction `json:"action,omitempty"` - // Rules - List of rules included in a rule collection. - Rules *[]BasicFirewallPolicyRule `json:"rules,omitempty"` - // Name - The name of the rule collection. - Name *string `json:"name,omitempty"` - // Priority - Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' - RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) MarshalJSON() ([]byte, error) { - fpfrc.RuleCollectionType = RuleCollectionTypeFirewallPolicyFilterRuleCollection - objectMap := make(map[string]interface{}) - if fpfrc.Action != nil { - objectMap["action"] = fpfrc.Action - } - if fpfrc.Rules != nil { - objectMap["rules"] = fpfrc.Rules - } - if fpfrc.Name != nil { - objectMap["name"] = fpfrc.Name - } - if fpfrc.Priority != nil { - objectMap["priority"] = fpfrc.Priority - } - if fpfrc.RuleCollectionType != "" { - objectMap["ruleCollectionType"] = fpfrc.RuleCollectionType - } - return json.Marshal(objectMap) -} - -// AsFirewallPolicyNatRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) AsFirewallPolicyNatRuleCollection() (*FirewallPolicyNatRuleCollection, bool) { - return nil, false -} - -// AsFirewallPolicyFilterRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) AsFirewallPolicyFilterRuleCollection() (*FirewallPolicyFilterRuleCollection, bool) { - return &fpfrc, true -} - -// AsFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) AsFirewallPolicyRuleCollection() (*FirewallPolicyRuleCollection, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyFilterRuleCollection. -func (fpfrc FirewallPolicyFilterRuleCollection) AsBasicFirewallPolicyRuleCollection() (BasicFirewallPolicyRuleCollection, bool) { - return &fpfrc, true -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicyFilterRuleCollection struct. -func (fpfrc *FirewallPolicyFilterRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "action": - if v != nil { - var action FirewallPolicyFilterRuleCollectionAction - err = json.Unmarshal(*v, &action) - if err != nil { - return err - } - fpfrc.Action = &action - } - case "rules": - if v != nil { - rules, err := unmarshalBasicFirewallPolicyRuleArray(*v) - if err != nil { - return err - } - fpfrc.Rules = &rules - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fpfrc.Name = &name - } - case "priority": - if v != nil { - var priority int32 - err = json.Unmarshal(*v, &priority) - if err != nil { - return err - } - fpfrc.Priority = &priority - } - case "ruleCollectionType": - if v != nil { - var ruleCollectionType RuleCollectionType - err = json.Unmarshal(*v, &ruleCollectionType) - if err != nil { - return err - } - fpfrc.RuleCollectionType = ruleCollectionType - } - } - } - - return nil -} - -// FirewallPolicyFilterRuleCollectionAction properties of the FirewallPolicyFilterRuleCollectionAction. -type FirewallPolicyFilterRuleCollectionAction struct { - // Type - The type of action. Possible values include: 'FirewallPolicyFilterRuleCollectionActionTypeAllow', 'FirewallPolicyFilterRuleCollectionActionTypeDeny' - Type FirewallPolicyFilterRuleCollectionActionType `json:"type,omitempty"` -} - -// FirewallPolicyInsights firewall Policy Insights. -type FirewallPolicyInsights struct { - // IsEnabled - A flag to indicate if the insights are enabled on the policy. - IsEnabled *bool `json:"isEnabled,omitempty"` - // RetentionDays - Number of days the insights should be enabled on the policy. - RetentionDays *int32 `json:"retentionDays,omitempty"` - // LogAnalyticsResources - Workspaces needed to configure the Firewall Policy Insights. - LogAnalyticsResources *FirewallPolicyLogAnalyticsResources `json:"logAnalyticsResources,omitempty"` -} - -// FirewallPolicyIntrusionDetection configuration for intrusion detection mode and rules. -type FirewallPolicyIntrusionDetection struct { - // Mode - Intrusion detection general state. Possible values include: 'FirewallPolicyIntrusionDetectionStateTypeOff', 'FirewallPolicyIntrusionDetectionStateTypeAlert', 'FirewallPolicyIntrusionDetectionStateTypeDeny' - Mode FirewallPolicyIntrusionDetectionStateType `json:"mode,omitempty"` - // Configuration - Intrusion detection configuration properties. - Configuration *FirewallPolicyIntrusionDetectionConfiguration `json:"configuration,omitempty"` -} - -// FirewallPolicyIntrusionDetectionBypassTrafficSpecifications intrusion detection bypass traffic -// specification. -type FirewallPolicyIntrusionDetectionBypassTrafficSpecifications struct { - // Name - Name of the bypass traffic rule. - Name *string `json:"name,omitempty"` - // Description - Description of the bypass traffic rule. - Description *string `json:"description,omitempty"` - // Protocol - The rule bypass protocol. Possible values include: 'FirewallPolicyIntrusionDetectionProtocolTCP', 'FirewallPolicyIntrusionDetectionProtocolUDP', 'FirewallPolicyIntrusionDetectionProtocolICMP', 'FirewallPolicyIntrusionDetectionProtocolANY' - Protocol FirewallPolicyIntrusionDetectionProtocol `json:"protocol,omitempty"` - // SourceAddresses - List of source IP addresses or ranges for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses or ranges for this rule. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports or ranges. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // DestinationIPGroups - List of destination IpGroups for this rule. - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` -} - -// FirewallPolicyIntrusionDetectionConfiguration the operation for configuring intrusion detection. -type FirewallPolicyIntrusionDetectionConfiguration struct { - // SignatureOverrides - List of specific signatures states. - SignatureOverrides *[]FirewallPolicyIntrusionDetectionSignatureSpecification `json:"signatureOverrides,omitempty"` - // BypassTrafficSettings - List of rules for traffic to bypass. - BypassTrafficSettings *[]FirewallPolicyIntrusionDetectionBypassTrafficSpecifications `json:"bypassTrafficSettings,omitempty"` - // PrivateRanges - IDPS Private IP address ranges are used to identify traffic direction (i.e. inbound, outbound, etc.). By default, only ranges defined by IANA RFC 1918 are considered private IP addresses. To modify default ranges, specify your Private IP address ranges with this property - PrivateRanges *[]string `json:"privateRanges,omitempty"` -} - -// FirewallPolicyIntrusionDetectionSignatureSpecification intrusion detection signatures specification -// states. -type FirewallPolicyIntrusionDetectionSignatureSpecification struct { - // ID - Signature id. - ID *string `json:"id,omitempty"` - // Mode - The signature state. Possible values include: 'FirewallPolicyIntrusionDetectionStateTypeOff', 'FirewallPolicyIntrusionDetectionStateTypeAlert', 'FirewallPolicyIntrusionDetectionStateTypeDeny' - Mode FirewallPolicyIntrusionDetectionStateType `json:"mode,omitempty"` -} - -// FirewallPolicyListResult response for ListFirewallPolicies API service call. -type FirewallPolicyListResult struct { - autorest.Response `json:"-"` - // Value - List of Firewall Policies in a resource group. - Value *[]FirewallPolicy `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// FirewallPolicyListResultIterator provides access to a complete listing of FirewallPolicy values. -type FirewallPolicyListResultIterator struct { - i int - page FirewallPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *FirewallPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *FirewallPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter FirewallPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter FirewallPolicyListResultIterator) Response() FirewallPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter FirewallPolicyListResultIterator) Value() FirewallPolicy { - if !iter.page.NotDone() { - return FirewallPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the FirewallPolicyListResultIterator type. -func NewFirewallPolicyListResultIterator(page FirewallPolicyListResultPage) FirewallPolicyListResultIterator { - return FirewallPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (fplr FirewallPolicyListResult) IsEmpty() bool { - return fplr.Value == nil || len(*fplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (fplr FirewallPolicyListResult) hasNextLink() bool { - return fplr.NextLink != nil && len(*fplr.NextLink) != 0 -} - -// firewallPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (fplr FirewallPolicyListResult) firewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if !fplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(fplr.NextLink))) -} - -// FirewallPolicyListResultPage contains a page of FirewallPolicy values. -type FirewallPolicyListResultPage struct { - fn func(context.Context, FirewallPolicyListResult) (FirewallPolicyListResult, error) - fplr FirewallPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *FirewallPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.fplr) - if err != nil { - return err - } - page.fplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *FirewallPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page FirewallPolicyListResultPage) NotDone() bool { - return !page.fplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page FirewallPolicyListResultPage) Response() FirewallPolicyListResult { - return page.fplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page FirewallPolicyListResultPage) Values() []FirewallPolicy { - if page.fplr.IsEmpty() { - return nil - } - return *page.fplr.Value -} - -// Creates a new instance of the FirewallPolicyListResultPage type. -func NewFirewallPolicyListResultPage(cur FirewallPolicyListResult, getNextPage func(context.Context, FirewallPolicyListResult) (FirewallPolicyListResult, error)) FirewallPolicyListResultPage { - return FirewallPolicyListResultPage{ - fn: getNextPage, - fplr: cur, - } -} - -// FirewallPolicyLogAnalyticsResources log Analytics Resources for Firewall Policy Insights. -type FirewallPolicyLogAnalyticsResources struct { - // Workspaces - List of workspaces for Firewall Policy Insights. - Workspaces *[]FirewallPolicyLogAnalyticsWorkspace `json:"workspaces,omitempty"` - // DefaultWorkspaceID - The default workspace Id for Firewall Policy Insights. - DefaultWorkspaceID *SubResource `json:"defaultWorkspaceId,omitempty"` -} - -// FirewallPolicyLogAnalyticsWorkspace log Analytics Workspace for Firewall Policy Insights. -type FirewallPolicyLogAnalyticsWorkspace struct { - // Region - Region to configure the Workspace. - Region *string `json:"region,omitempty"` - // WorkspaceID - The workspace Id for Firewall Policy Insights. - WorkspaceID *SubResource `json:"workspaceId,omitempty"` -} - -// FirewallPolicyNatRuleCollection firewall Policy NAT Rule Collection. -type FirewallPolicyNatRuleCollection struct { - // Action - The action type of a Nat rule collection. - Action *FirewallPolicyNatRuleCollectionAction `json:"action,omitempty"` - // Rules - List of rules included in a rule collection. - Rules *[]BasicFirewallPolicyRule `json:"rules,omitempty"` - // Name - The name of the rule collection. - Name *string `json:"name,omitempty"` - // Priority - Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' - RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) MarshalJSON() ([]byte, error) { - fpnrc.RuleCollectionType = RuleCollectionTypeFirewallPolicyNatRuleCollection - objectMap := make(map[string]interface{}) - if fpnrc.Action != nil { - objectMap["action"] = fpnrc.Action - } - if fpnrc.Rules != nil { - objectMap["rules"] = fpnrc.Rules - } - if fpnrc.Name != nil { - objectMap["name"] = fpnrc.Name - } - if fpnrc.Priority != nil { - objectMap["priority"] = fpnrc.Priority - } - if fpnrc.RuleCollectionType != "" { - objectMap["ruleCollectionType"] = fpnrc.RuleCollectionType - } - return json.Marshal(objectMap) -} - -// AsFirewallPolicyNatRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) AsFirewallPolicyNatRuleCollection() (*FirewallPolicyNatRuleCollection, bool) { - return &fpnrc, true -} - -// AsFirewallPolicyFilterRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) AsFirewallPolicyFilterRuleCollection() (*FirewallPolicyFilterRuleCollection, bool) { - return nil, false -} - -// AsFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) AsFirewallPolicyRuleCollection() (*FirewallPolicyRuleCollection, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyNatRuleCollection. -func (fpnrc FirewallPolicyNatRuleCollection) AsBasicFirewallPolicyRuleCollection() (BasicFirewallPolicyRuleCollection, bool) { - return &fpnrc, true -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicyNatRuleCollection struct. -func (fpnrc *FirewallPolicyNatRuleCollection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "action": - if v != nil { - var action FirewallPolicyNatRuleCollectionAction - err = json.Unmarshal(*v, &action) - if err != nil { - return err - } - fpnrc.Action = &action - } - case "rules": - if v != nil { - rules, err := unmarshalBasicFirewallPolicyRuleArray(*v) - if err != nil { - return err - } - fpnrc.Rules = &rules - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fpnrc.Name = &name - } - case "priority": - if v != nil { - var priority int32 - err = json.Unmarshal(*v, &priority) - if err != nil { - return err - } - fpnrc.Priority = &priority - } - case "ruleCollectionType": - if v != nil { - var ruleCollectionType RuleCollectionType - err = json.Unmarshal(*v, &ruleCollectionType) - if err != nil { - return err - } - fpnrc.RuleCollectionType = ruleCollectionType - } - } - } - - return nil -} - -// FirewallPolicyNatRuleCollectionAction properties of the FirewallPolicyNatRuleCollectionAction. -type FirewallPolicyNatRuleCollectionAction struct { - // Type - The type of action. Possible values include: 'DNAT' - Type FirewallPolicyNatRuleCollectionActionType `json:"type,omitempty"` -} - -// FirewallPolicyPropertiesFormat firewall Policy definition. -type FirewallPolicyPropertiesFormat struct { - // RuleCollectionGroups - READ-ONLY; List of references to FirewallPolicyRuleCollectionGroups. - RuleCollectionGroups *[]SubResource `json:"ruleCollectionGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the firewall policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // BasePolicy - The parent firewall policy from which rules are inherited. - BasePolicy *SubResource `json:"basePolicy,omitempty"` - // Firewalls - READ-ONLY; List of references to Azure Firewalls that this Firewall Policy is associated with. - Firewalls *[]SubResource `json:"firewalls,omitempty"` - // ChildPolicies - READ-ONLY; List of references to Child Firewall Policies. - ChildPolicies *[]SubResource `json:"childPolicies,omitempty"` - // ThreatIntelMode - The operation mode for Threat Intelligence. Possible values include: 'AzureFirewallThreatIntelModeAlert', 'AzureFirewallThreatIntelModeDeny', 'AzureFirewallThreatIntelModeOff' - ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - // ThreatIntelWhitelist - ThreatIntel Whitelist for Firewall Policy. - ThreatIntelWhitelist *FirewallPolicyThreatIntelWhitelist `json:"threatIntelWhitelist,omitempty"` - // Insights - Insights on Firewall Policy. - Insights *FirewallPolicyInsights `json:"insights,omitempty"` - // Snat - The private IP addresses/IP ranges to which traffic will not be SNAT. - Snat *FirewallPolicySNAT `json:"snat,omitempty"` - // SQL - SQL Settings definition. - SQL *FirewallPolicySQL `json:"sql,omitempty"` - // DNSSettings - DNS Proxy Settings definition. - DNSSettings *DNSSettings `json:"dnsSettings,omitempty"` - // ExplicitProxy - Explicit Proxy Settings definition. - ExplicitProxy *ExplicitProxy `json:"explicitProxy,omitempty"` - // IntrusionDetection - The configuration for Intrusion detection. - IntrusionDetection *FirewallPolicyIntrusionDetection `json:"intrusionDetection,omitempty"` - // TransportSecurity - TLS Configuration definition. - TransportSecurity *FirewallPolicyTransportSecurity `json:"transportSecurity,omitempty"` - // Sku - The Firewall Policy SKU. - Sku *FirewallPolicySku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyPropertiesFormat. -func (fppf FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fppf.BasePolicy != nil { - objectMap["basePolicy"] = fppf.BasePolicy - } - if fppf.ThreatIntelMode != "" { - objectMap["threatIntelMode"] = fppf.ThreatIntelMode - } - if fppf.ThreatIntelWhitelist != nil { - objectMap["threatIntelWhitelist"] = fppf.ThreatIntelWhitelist - } - if fppf.Insights != nil { - objectMap["insights"] = fppf.Insights - } - if fppf.Snat != nil { - objectMap["snat"] = fppf.Snat - } - if fppf.SQL != nil { - objectMap["sql"] = fppf.SQL - } - if fppf.DNSSettings != nil { - objectMap["dnsSettings"] = fppf.DNSSettings - } - if fppf.ExplicitProxy != nil { - objectMap["explicitProxy"] = fppf.ExplicitProxy - } - if fppf.IntrusionDetection != nil { - objectMap["intrusionDetection"] = fppf.IntrusionDetection - } - if fppf.TransportSecurity != nil { - objectMap["transportSecurity"] = fppf.TransportSecurity - } - if fppf.Sku != nil { - objectMap["sku"] = fppf.Sku - } - return json.Marshal(objectMap) -} - -// BasicFirewallPolicyRule properties of a rule. -type BasicFirewallPolicyRule interface { - AsApplicationRule() (*ApplicationRule, bool) - AsNatRule() (*NatRule, bool) - AsRule() (*Rule, bool) - AsFirewallPolicyRule() (*FirewallPolicyRule, bool) -} - -// FirewallPolicyRule properties of a rule. -type FirewallPolicyRule struct { - // Name - Name of the rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' - RuleType RuleType `json:"ruleType,omitempty"` -} - -func unmarshalBasicFirewallPolicyRule(body []byte) (BasicFirewallPolicyRule, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["ruleType"] { - case string(RuleTypeApplicationRule): - var ar ApplicationRule - err := json.Unmarshal(body, &ar) - return ar, err - case string(RuleTypeNatRule): - var nr NatRule - err := json.Unmarshal(body, &nr) - return nr, err - case string(RuleTypeNetworkRule): - var r Rule - err := json.Unmarshal(body, &r) - return r, err - default: - var fpr FirewallPolicyRule - err := json.Unmarshal(body, &fpr) - return fpr, err - } -} -func unmarshalBasicFirewallPolicyRuleArray(body []byte) ([]BasicFirewallPolicyRule, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fprArray := make([]BasicFirewallPolicyRule, len(rawMessages)) - - for index, rawMessage := range rawMessages { - fpr, err := unmarshalBasicFirewallPolicyRule(*rawMessage) - if err != nil { - return nil, err - } - fprArray[index] = fpr - } - return fprArray, nil -} - -// MarshalJSON is the custom marshaler for FirewallPolicyRule. -func (fpr FirewallPolicyRule) MarshalJSON() ([]byte, error) { - fpr.RuleType = RuleTypeFirewallPolicyRule - objectMap := make(map[string]interface{}) - if fpr.Name != nil { - objectMap["name"] = fpr.Name - } - if fpr.Description != nil { - objectMap["description"] = fpr.Description - } - if fpr.RuleType != "" { - objectMap["ruleType"] = fpr.RuleType - } - return json.Marshal(objectMap) -} - -// AsApplicationRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsApplicationRule() (*ApplicationRule, bool) { - return nil, false -} - -// AsNatRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsNatRule() (*NatRule, bool) { - return nil, false -} - -// AsRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsRule() (*Rule, bool) { - return nil, false -} - -// AsFirewallPolicyRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) { - return &fpr, true -} - -// AsBasicFirewallPolicyRule is the BasicFirewallPolicyRule implementation for FirewallPolicyRule. -func (fpr FirewallPolicyRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { - return &fpr, true -} - -// FirewallPolicyRuleApplicationProtocol properties of the application rule protocol. -type FirewallPolicyRuleApplicationProtocol struct { - // ProtocolType - Protocol type. Possible values include: 'FirewallPolicyRuleApplicationProtocolTypeHTTP', 'FirewallPolicyRuleApplicationProtocolTypeHTTPS' - ProtocolType FirewallPolicyRuleApplicationProtocolType `json:"protocolType,omitempty"` - // Port - Port number for the protocol, cannot be greater than 64000. - Port *int32 `json:"port,omitempty"` -} - -// BasicFirewallPolicyRuleCollection properties of the rule collection. -type BasicFirewallPolicyRuleCollection interface { - AsFirewallPolicyNatRuleCollection() (*FirewallPolicyNatRuleCollection, bool) - AsFirewallPolicyFilterRuleCollection() (*FirewallPolicyFilterRuleCollection, bool) - AsFirewallPolicyRuleCollection() (*FirewallPolicyRuleCollection, bool) -} - -// FirewallPolicyRuleCollection properties of the rule collection. -type FirewallPolicyRuleCollection struct { - // Name - The name of the rule collection. - Name *string `json:"name,omitempty"` - // Priority - Priority of the Firewall Policy Rule Collection resource. - Priority *int32 `json:"priority,omitempty"` - // RuleCollectionType - Possible values include: 'RuleCollectionTypeFirewallPolicyRuleCollection', 'RuleCollectionTypeFirewallPolicyNatRuleCollection', 'RuleCollectionTypeFirewallPolicyFilterRuleCollection' - RuleCollectionType RuleCollectionType `json:"ruleCollectionType,omitempty"` -} - -func unmarshalBasicFirewallPolicyRuleCollection(body []byte) (BasicFirewallPolicyRuleCollection, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } - - switch m["ruleCollectionType"] { - case string(RuleCollectionTypeFirewallPolicyNatRuleCollection): - var fpnrc FirewallPolicyNatRuleCollection - err := json.Unmarshal(body, &fpnrc) - return fpnrc, err - case string(RuleCollectionTypeFirewallPolicyFilterRuleCollection): - var fpfrc FirewallPolicyFilterRuleCollection - err := json.Unmarshal(body, &fpfrc) - return fpfrc, err - default: - var fprc FirewallPolicyRuleCollection - err := json.Unmarshal(body, &fprc) - return fprc, err - } -} -func unmarshalBasicFirewallPolicyRuleCollectionArray(body []byte) ([]BasicFirewallPolicyRuleCollection, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - - fprcArray := make([]BasicFirewallPolicyRuleCollection, len(rawMessages)) - - for index, rawMessage := range rawMessages { - fprc, err := unmarshalBasicFirewallPolicyRuleCollection(*rawMessage) - if err != nil { - return nil, err - } - fprcArray[index] = fprc - } - return fprcArray, nil -} - -// MarshalJSON is the custom marshaler for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) MarshalJSON() ([]byte, error) { - fprc.RuleCollectionType = RuleCollectionTypeFirewallPolicyRuleCollection - objectMap := make(map[string]interface{}) - if fprc.Name != nil { - objectMap["name"] = fprc.Name - } - if fprc.Priority != nil { - objectMap["priority"] = fprc.Priority - } - if fprc.RuleCollectionType != "" { - objectMap["ruleCollectionType"] = fprc.RuleCollectionType - } - return json.Marshal(objectMap) -} - -// AsFirewallPolicyNatRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) AsFirewallPolicyNatRuleCollection() (*FirewallPolicyNatRuleCollection, bool) { - return nil, false -} - -// AsFirewallPolicyFilterRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) AsFirewallPolicyFilterRuleCollection() (*FirewallPolicyFilterRuleCollection, bool) { - return nil, false -} - -// AsFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) AsFirewallPolicyRuleCollection() (*FirewallPolicyRuleCollection, bool) { - return &fprc, true -} - -// AsBasicFirewallPolicyRuleCollection is the BasicFirewallPolicyRuleCollection implementation for FirewallPolicyRuleCollection. -func (fprc FirewallPolicyRuleCollection) AsBasicFirewallPolicyRuleCollection() (BasicFirewallPolicyRuleCollection, bool) { - return &fprc, true -} - -// FirewallPolicyRuleCollectionGroup rule Collection Group resource. -type FirewallPolicyRuleCollectionGroup struct { - autorest.Response `json:"-"` - // FirewallPolicyRuleCollectionGroupProperties - The properties of the firewall policy rule collection group. - *FirewallPolicyRuleCollectionGroupProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Rule Group type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyRuleCollectionGroup. -func (fprcg FirewallPolicyRuleCollectionGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fprcg.FirewallPolicyRuleCollectionGroupProperties != nil { - objectMap["properties"] = fprcg.FirewallPolicyRuleCollectionGroupProperties - } - if fprcg.Name != nil { - objectMap["name"] = fprcg.Name - } - if fprcg.ID != nil { - objectMap["id"] = fprcg.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicyRuleCollectionGroup struct. -func (fprcg *FirewallPolicyRuleCollectionGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var firewallPolicyRuleCollectionGroupProperties FirewallPolicyRuleCollectionGroupProperties - err = json.Unmarshal(*v, &firewallPolicyRuleCollectionGroupProperties) - if err != nil { - return err - } - fprcg.FirewallPolicyRuleCollectionGroupProperties = &firewallPolicyRuleCollectionGroupProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fprcg.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - fprcg.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fprcg.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fprcg.ID = &ID - } - } - } - - return nil -} - -// FirewallPolicyRuleCollectionGroupListResult response for ListFirewallPolicyRuleCollectionGroups API -// service call. -type FirewallPolicyRuleCollectionGroupListResult struct { - autorest.Response `json:"-"` - // Value - List of FirewallPolicyRuleCollectionGroups in a FirewallPolicy. - Value *[]FirewallPolicyRuleCollectionGroup `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// FirewallPolicyRuleCollectionGroupListResultIterator provides access to a complete listing of -// FirewallPolicyRuleCollectionGroup values. -type FirewallPolicyRuleCollectionGroupListResultIterator struct { - i int - page FirewallPolicyRuleCollectionGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *FirewallPolicyRuleCollectionGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *FirewallPolicyRuleCollectionGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter FirewallPolicyRuleCollectionGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter FirewallPolicyRuleCollectionGroupListResultIterator) Response() FirewallPolicyRuleCollectionGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter FirewallPolicyRuleCollectionGroupListResultIterator) Value() FirewallPolicyRuleCollectionGroup { - if !iter.page.NotDone() { - return FirewallPolicyRuleCollectionGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the FirewallPolicyRuleCollectionGroupListResultIterator type. -func NewFirewallPolicyRuleCollectionGroupListResultIterator(page FirewallPolicyRuleCollectionGroupListResultPage) FirewallPolicyRuleCollectionGroupListResultIterator { - return FirewallPolicyRuleCollectionGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (fprcglr FirewallPolicyRuleCollectionGroupListResult) IsEmpty() bool { - return fprcglr.Value == nil || len(*fprcglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (fprcglr FirewallPolicyRuleCollectionGroupListResult) hasNextLink() bool { - return fprcglr.NextLink != nil && len(*fprcglr.NextLink) != 0 -} - -// firewallPolicyRuleCollectionGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (fprcglr FirewallPolicyRuleCollectionGroupListResult) firewallPolicyRuleCollectionGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !fprcglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(fprcglr.NextLink))) -} - -// FirewallPolicyRuleCollectionGroupListResultPage contains a page of FirewallPolicyRuleCollectionGroup -// values. -type FirewallPolicyRuleCollectionGroupListResultPage struct { - fn func(context.Context, FirewallPolicyRuleCollectionGroupListResult) (FirewallPolicyRuleCollectionGroupListResult, error) - fprcglr FirewallPolicyRuleCollectionGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *FirewallPolicyRuleCollectionGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleCollectionGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.fprcglr) - if err != nil { - return err - } - page.fprcglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *FirewallPolicyRuleCollectionGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page FirewallPolicyRuleCollectionGroupListResultPage) NotDone() bool { - return !page.fprcglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page FirewallPolicyRuleCollectionGroupListResultPage) Response() FirewallPolicyRuleCollectionGroupListResult { - return page.fprcglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page FirewallPolicyRuleCollectionGroupListResultPage) Values() []FirewallPolicyRuleCollectionGroup { - if page.fprcglr.IsEmpty() { - return nil - } - return *page.fprcglr.Value -} - -// Creates a new instance of the FirewallPolicyRuleCollectionGroupListResultPage type. -func NewFirewallPolicyRuleCollectionGroupListResultPage(cur FirewallPolicyRuleCollectionGroupListResult, getNextPage func(context.Context, FirewallPolicyRuleCollectionGroupListResult) (FirewallPolicyRuleCollectionGroupListResult, error)) FirewallPolicyRuleCollectionGroupListResultPage { - return FirewallPolicyRuleCollectionGroupListResultPage{ - fn: getNextPage, - fprcglr: cur, - } -} - -// FirewallPolicyRuleCollectionGroupProperties properties of the rule collection group. -type FirewallPolicyRuleCollectionGroupProperties struct { - // Priority - Priority of the Firewall Policy Rule Collection Group resource. - Priority *int32 `json:"priority,omitempty"` - // RuleCollections - Group of Firewall Policy rule collections. - RuleCollections *[]BasicFirewallPolicyRuleCollection `json:"ruleCollections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the firewall policy rule collection group resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for FirewallPolicyRuleCollectionGroupProperties. -func (fprcgp FirewallPolicyRuleCollectionGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fprcgp.Priority != nil { - objectMap["priority"] = fprcgp.Priority - } - if fprcgp.RuleCollections != nil { - objectMap["ruleCollections"] = fprcgp.RuleCollections - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FirewallPolicyRuleCollectionGroupProperties struct. -func (fprcgp *FirewallPolicyRuleCollectionGroupProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "priority": - if v != nil { - var priority int32 - err = json.Unmarshal(*v, &priority) - if err != nil { - return err - } - fprcgp.Priority = &priority - } - case "ruleCollections": - if v != nil { - ruleCollections, err := unmarshalBasicFirewallPolicyRuleCollectionArray(*v) - if err != nil { - return err - } - fprcgp.RuleCollections = &ruleCollections - } - case "provisioningState": - if v != nil { - var provisioningState ProvisioningState - err = json.Unmarshal(*v, &provisioningState) - if err != nil { - return err - } - fprcgp.ProvisioningState = provisioningState - } - } - } - - return nil -} - -// FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallPolicyRuleCollectionGroupsClient) (FirewallPolicyRuleCollectionGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture.Result. -func (future *FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture) result(client FirewallPolicyRuleCollectionGroupsClient) (fprcg FirewallPolicyRuleCollectionGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fprcg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fprcg.Response.Response, err = future.GetResult(sender); err == nil && fprcg.Response.Response.StatusCode != http.StatusNoContent { - fprcg, err = client.CreateOrUpdateResponder(fprcg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsCreateOrUpdateFuture", "Result", fprcg.Response.Response, "Failure responding to request") - } - } - return -} - -// FirewallPolicyRuleCollectionGroupsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type FirewallPolicyRuleCollectionGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FirewallPolicyRuleCollectionGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FirewallPolicyRuleCollectionGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FirewallPolicyRuleCollectionGroupsDeleteFuture.Result. -func (future *FirewallPolicyRuleCollectionGroupsDeleteFuture) result(client FirewallPolicyRuleCollectionGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleCollectionGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FirewallPolicyRuleCollectionGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// FirewallPolicySku SKU of Firewall policy. -type FirewallPolicySku struct { - // Tier - Tier of Firewall Policy. Possible values include: 'FirewallPolicySkuTierStandard', 'FirewallPolicySkuTierPremium', 'FirewallPolicySkuTierBasic' - Tier FirewallPolicySkuTier `json:"tier,omitempty"` -} - -// FirewallPolicySNAT the private IP addresses/IP ranges to which traffic will not be SNAT. -type FirewallPolicySNAT struct { - // PrivateRanges - List of private IP addresses/IP address ranges to not be SNAT. - PrivateRanges *[]string `json:"privateRanges,omitempty"` - // AutoLearnPrivateRanges - The operation mode for automatically learning private ranges to not be SNAT. Possible values include: 'AutoLearnPrivateRangesModeEnabled', 'AutoLearnPrivateRangesModeDisabled' - AutoLearnPrivateRanges AutoLearnPrivateRangesMode `json:"autoLearnPrivateRanges,omitempty"` -} - -// FirewallPolicySQL SQL Settings in Firewall Policy. -type FirewallPolicySQL struct { - // AllowSQLRedirect - A flag to indicate if SQL Redirect traffic filtering is enabled. Turning on the flag requires no rule using port 11000-11999. - AllowSQLRedirect *bool `json:"allowSqlRedirect,omitempty"` -} - -// FirewallPolicyThreatIntelWhitelist threatIntel Whitelist for Firewall Policy. -type FirewallPolicyThreatIntelWhitelist struct { - // IPAddresses - List of IP addresses for the ThreatIntel Whitelist. - IPAddresses *[]string `json:"ipAddresses,omitempty"` - // Fqdns - List of FQDNs for the ThreatIntel Whitelist. - Fqdns *[]string `json:"fqdns,omitempty"` -} - -// FirewallPolicyTransportSecurity configuration needed to perform TLS termination & initiation. -type FirewallPolicyTransportSecurity struct { - // CertificateAuthority - The CA used for intermediate CA generation. - CertificateAuthority *FirewallPolicyCertificateAuthority `json:"certificateAuthority,omitempty"` -} - -// FlowLog a flow log resource. -type FlowLog struct { - autorest.Response `json:"-"` - // FlowLogPropertiesFormat - Properties of the flow log. - *FlowLogPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for FlowLog. -func (fl FlowLog) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fl.FlowLogPropertiesFormat != nil { - objectMap["properties"] = fl.FlowLogPropertiesFormat - } - if fl.ID != nil { - objectMap["id"] = fl.ID - } - if fl.Location != nil { - objectMap["location"] = fl.Location - } - if fl.Tags != nil { - objectMap["tags"] = fl.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FlowLog struct. -func (fl *FlowLog) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var flowLogPropertiesFormat FlowLogPropertiesFormat - err = json.Unmarshal(*v, &flowLogPropertiesFormat) - if err != nil { - return err - } - fl.FlowLogPropertiesFormat = &flowLogPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - fl.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fl.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fl.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - fl.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - fl.Tags = tags - } - } - } - - return nil -} - -// FlowLogFormatParameters parameters that define the flow log format. -type FlowLogFormatParameters struct { - // Type - The file type of flow log. Possible values include: 'JSON' - Type FlowLogFormatType `json:"type,omitempty"` - // Version - The version (revision) of the flow log. - Version *int32 `json:"version,omitempty"` -} - -// FlowLogInformation information on the configuration of flow log and traffic analytics (optional) . -type FlowLogInformation struct { - autorest.Response `json:"-"` - // TargetResourceID - The ID of the resource to configure for flow log and traffic analytics (optional) . - TargetResourceID *string `json:"targetResourceId,omitempty"` - // FlowLogProperties - Properties of the flow log. - *FlowLogProperties `json:"properties,omitempty"` - // FlowAnalyticsConfiguration - Parameters that define the configuration of traffic analytics. - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for FlowLogInformation. -func (fli FlowLogInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fli.TargetResourceID != nil { - objectMap["targetResourceId"] = fli.TargetResourceID - } - if fli.FlowLogProperties != nil { - objectMap["properties"] = fli.FlowLogProperties - } - if fli.FlowAnalyticsConfiguration != nil { - objectMap["flowAnalyticsConfiguration"] = fli.FlowAnalyticsConfiguration - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FlowLogInformation struct. -func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "targetResourceId": - if v != nil { - var targetResourceID string - err = json.Unmarshal(*v, &targetResourceID) - if err != nil { - return err - } - fli.TargetResourceID = &targetResourceID - } - case "properties": - if v != nil { - var flowLogProperties FlowLogProperties - err = json.Unmarshal(*v, &flowLogProperties) - if err != nil { - return err - } - fli.FlowLogProperties = &flowLogProperties - } - case "flowAnalyticsConfiguration": - if v != nil { - var flowAnalyticsConfiguration TrafficAnalyticsProperties - err = json.Unmarshal(*v, &flowAnalyticsConfiguration) - if err != nil { - return err - } - fli.FlowAnalyticsConfiguration = &flowAnalyticsConfiguration - } - } - } - - return nil -} - -// FlowLogListResult list of flow logs. -type FlowLogListResult struct { - autorest.Response `json:"-"` - // Value - Information about flow log resource. - Value *[]FlowLog `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for FlowLogListResult. -func (fllr FlowLogListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fllr.Value != nil { - objectMap["value"] = fllr.Value - } - return json.Marshal(objectMap) -} - -// FlowLogListResultIterator provides access to a complete listing of FlowLog values. -type FlowLogListResultIterator struct { - i int - page FlowLogListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *FlowLogListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *FlowLogListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter FlowLogListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter FlowLogListResultIterator) Response() FlowLogListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter FlowLogListResultIterator) Value() FlowLog { - if !iter.page.NotDone() { - return FlowLog{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the FlowLogListResultIterator type. -func NewFlowLogListResultIterator(page FlowLogListResultPage) FlowLogListResultIterator { - return FlowLogListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (fllr FlowLogListResult) IsEmpty() bool { - return fllr.Value == nil || len(*fllr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (fllr FlowLogListResult) hasNextLink() bool { - return fllr.NextLink != nil && len(*fllr.NextLink) != 0 -} - -// flowLogListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (fllr FlowLogListResult) flowLogListResultPreparer(ctx context.Context) (*http.Request, error) { - if !fllr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(fllr.NextLink))) -} - -// FlowLogListResultPage contains a page of FlowLog values. -type FlowLogListResultPage struct { - fn func(context.Context, FlowLogListResult) (FlowLogListResult, error) - fllr FlowLogListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *FlowLogListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.fllr) - if err != nil { - return err - } - page.fllr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *FlowLogListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page FlowLogListResultPage) NotDone() bool { - return !page.fllr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page FlowLogListResultPage) Response() FlowLogListResult { - return page.fllr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page FlowLogListResultPage) Values() []FlowLog { - if page.fllr.IsEmpty() { - return nil - } - return *page.fllr.Value -} - -// Creates a new instance of the FlowLogListResultPage type. -func NewFlowLogListResultPage(cur FlowLogListResult, getNextPage func(context.Context, FlowLogListResult) (FlowLogListResult, error)) FlowLogListResultPage { - return FlowLogListResultPage{ - fn: getNextPage, - fllr: cur, - } -} - -// FlowLogProperties parameters that define the configuration of flow log. -type FlowLogProperties struct { - // StorageID - ID of the storage account which is used to store the flow log. - StorageID *string `json:"storageId,omitempty"` - // Enabled - Flag to enable/disable flow logging. - Enabled *bool `json:"enabled,omitempty"` - // RetentionPolicy - Parameters that define the retention policy for flow log. - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - // Format - Parameters that define the flow log format. - Format *FlowLogFormatParameters `json:"format,omitempty"` -} - -// FlowLogPropertiesFormat parameters that define the configuration of flow log. -type FlowLogPropertiesFormat struct { - // TargetResourceID - ID of network security group to which flow log will be applied. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // TargetResourceGUID - READ-ONLY; Guid of network security group to which flow log will be applied. - TargetResourceGUID *string `json:"targetResourceGuid,omitempty"` - // StorageID - ID of the storage account which is used to store the flow log. - StorageID *string `json:"storageId,omitempty"` - // Enabled - Flag to enable/disable flow logging. - Enabled *bool `json:"enabled,omitempty"` - // RetentionPolicy - Parameters that define the retention policy for flow log. - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - // Format - Parameters that define the flow log format. - Format *FlowLogFormatParameters `json:"format,omitempty"` - // FlowAnalyticsConfiguration - Parameters that define the configuration of traffic analytics. - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the flow log. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for FlowLogPropertiesFormat. -func (flpf FlowLogPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if flpf.TargetResourceID != nil { - objectMap["targetResourceId"] = flpf.TargetResourceID - } - if flpf.StorageID != nil { - objectMap["storageId"] = flpf.StorageID - } - if flpf.Enabled != nil { - objectMap["enabled"] = flpf.Enabled - } - if flpf.RetentionPolicy != nil { - objectMap["retentionPolicy"] = flpf.RetentionPolicy - } - if flpf.Format != nil { - objectMap["format"] = flpf.Format - } - if flpf.FlowAnalyticsConfiguration != nil { - objectMap["flowAnalyticsConfiguration"] = flpf.FlowAnalyticsConfiguration - } - return json.Marshal(objectMap) -} - -// FlowLogsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FlowLogsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FlowLogsClient) (FlowLog, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FlowLogsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FlowLogsCreateOrUpdateFuture.Result. -func (future *FlowLogsCreateOrUpdateFuture) result(client FlowLogsClient) (fl FlowLog, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fl.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FlowLogsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fl.Response.Response, err = future.GetResult(sender); err == nil && fl.Response.Response.StatusCode != http.StatusNoContent { - fl, err = client.CreateOrUpdateResponder(fl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsCreateOrUpdateFuture", "Result", fl.Response.Response, "Failure responding to request") - } - } - return -} - -// FlowLogsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FlowLogsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FlowLogsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FlowLogsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for FlowLogsDeleteFuture.Result. -func (future *FlowLogsDeleteFuture) result(client FlowLogsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.FlowLogsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.FlowLogsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// FlowLogStatusParameters parameters that define a resource to query flow log and traffic analytics -// (optional) status. -type FlowLogStatusParameters struct { - // TargetResourceID - The target resource where getting the flow log and traffic analytics (optional) status. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// FrontendIPConfiguration frontend IP address of the load balancer. -type FrontendIPConfiguration struct { - autorest.Response `json:"-"` - // FrontendIPConfigurationPropertiesFormat - Properties of the load balancer probe. - *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - 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 `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for FrontendIPConfiguration. -func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if fic.FrontendIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat - } - if fic.Name != nil { - objectMap["name"] = fic.Name - } - if fic.Zones != nil { - objectMap["zones"] = fic.Zones - } - if fic.ID != nil { - objectMap["id"] = fic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct. -func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat) - if err != nil { - return err - } - fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - fic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - fic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - fic.Type = &typeVar - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - fic.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - fic.ID = &ID - } - } - } - - return nil -} - -// FrontendIPConfigurationPropertiesFormat properties of Frontend IP Configuration of the load balancer. -type FrontendIPConfigurationPropertiesFormat struct { - // InboundNatRules - READ-ONLY; An array of references to inbound rules that use this frontend IP. - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - // InboundNatPools - READ-ONLY; An array of references to inbound pools that use this frontend IP. - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - // OutboundRules - READ-ONLY; An array of references to outbound rules that use this frontend IP. - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - // LoadBalancingRules - READ-ONLY; An array of references to load balancing rules that use this frontend IP. - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The Private IP allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // PrivateIPAddressVersion - Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - // PublicIPAddress - The reference to the Public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // PublicIPPrefix - The reference to the Public IP Prefix resource. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // GatewayLoadBalancer - The reference to gateway load balancer frontend IP. - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for FrontendIPConfigurationPropertiesFormat. -func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ficpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = ficpf.PrivateIPAddress - } - if ficpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = ficpf.PrivateIPAllocationMethod - } - if ficpf.PrivateIPAddressVersion != "" { - objectMap["privateIPAddressVersion"] = ficpf.PrivateIPAddressVersion - } - if ficpf.Subnet != nil { - objectMap["subnet"] = ficpf.Subnet - } - if ficpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = ficpf.PublicIPAddress - } - if ficpf.PublicIPPrefix != nil { - objectMap["publicIPPrefix"] = ficpf.PublicIPPrefix - } - if ficpf.GatewayLoadBalancer != nil { - objectMap["gatewayLoadBalancer"] = ficpf.GatewayLoadBalancer - } - return json.Marshal(objectMap) -} - -// GatewayCustomBgpIPAddressIPConfiguration gatewayCustomBgpIpAddressIpConfiguration for a virtual network -// gateway connection. -type GatewayCustomBgpIPAddressIPConfiguration struct { - // IPConfigurationID - The IpconfigurationId of ipconfiguration which belongs to gateway. - IPConfigurationID *string `json:"ipConfigurationId,omitempty"` - // CustomBgpIPAddress - The custom BgpPeeringAddress which belongs to IpconfigurationId. - CustomBgpIPAddress *string `json:"customBgpIpAddress,omitempty"` -} - -// GatewayLoadBalancerTunnelInterface gateway load balancer tunnel interface of a load balancer backend -// address pool. -type GatewayLoadBalancerTunnelInterface struct { - // Port - Port of gateway load balancer tunnel interface. - Port *int32 `json:"port,omitempty"` - // Identifier - Identifier of gateway load balancer tunnel interface. - Identifier *int32 `json:"identifier,omitempty"` - // Protocol - Protocol of gateway load balancer tunnel interface. Possible values include: 'GatewayLoadBalancerTunnelProtocolNone', 'GatewayLoadBalancerTunnelProtocolNative', 'GatewayLoadBalancerTunnelProtocolVXLAN' - Protocol GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - // Type - Traffic type of gateway load balancer tunnel interface. Possible values include: 'GatewayLoadBalancerTunnelInterfaceTypeNone', 'GatewayLoadBalancerTunnelInterfaceTypeInternal', 'GatewayLoadBalancerTunnelInterfaceTypeExternal' - Type GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} - -// GatewayRoute gateway routing details. -type GatewayRoute struct { - // LocalAddress - READ-ONLY; The gateway's local address. - LocalAddress *string `json:"localAddress,omitempty"` - // NetworkProperty - READ-ONLY; The route's network prefix. - NetworkProperty *string `json:"network,omitempty"` - // NextHop - READ-ONLY; The route's next hop. - NextHop *string `json:"nextHop,omitempty"` - // SourcePeer - READ-ONLY; The peer this route was learned from. - SourcePeer *string `json:"sourcePeer,omitempty"` - // Origin - READ-ONLY; The source this route was learned from. - Origin *string `json:"origin,omitempty"` - // AsPath - READ-ONLY; The route's AS path sequence. - AsPath *string `json:"asPath,omitempty"` - // Weight - READ-ONLY; The route's weight. - Weight *int32 `json:"weight,omitempty"` -} - -// MarshalJSON is the custom marshaler for GatewayRoute. -func (gr GatewayRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// GatewayRouteListResult list of virtual network gateway routes. -type GatewayRouteListResult struct { - autorest.Response `json:"-"` - // Value - List of gateway routes. - Value *[]GatewayRoute `json:"value,omitempty"` -} - -// GenerateExpressRoutePortsLOARequest the customer name to be printed on a letter of authorization. -type GenerateExpressRoutePortsLOARequest struct { - // CustomerName - The customer name. - CustomerName *string `json:"customerName,omitempty"` -} - -// GenerateExpressRoutePortsLOAResult response for GenerateExpressRoutePortsLOA API service call. -type GenerateExpressRoutePortsLOAResult struct { - autorest.Response `json:"-"` - // EncodedContent - The content as a base64 encoded string. - EncodedContent *string `json:"encodedContent,omitempty"` -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofileFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type GeneratevirtualwanvpnserverconfigurationvpnprofileFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (VpnProfileResponse, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GeneratevirtualwanvpnserverconfigurationvpnprofileFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GeneratevirtualwanvpnserverconfigurationvpnprofileFuture.Result. -func (future *GeneratevirtualwanvpnserverconfigurationvpnprofileFuture) result(client BaseClient) (vpr VpnProfileResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vpr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vpr.Response.Response, err = future.GetResult(sender); err == nil && vpr.Response.Response.StatusCode != http.StatusNoContent { - vpr, err = client.GeneratevirtualwanvpnserverconfigurationvpnprofileResponder(vpr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture", "Result", vpr.Response.Response, "Failure responding to request") - } - } - return -} - -// GetActiveSessionsAllFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GetActiveSessionsAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (BastionActiveSessionListResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GetActiveSessionsAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GetActiveSessionsAllFuture.Result. -func (future *GetActiveSessionsAllFuture) result(client BaseClient) (baslrp BastionActiveSessionListResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GetActiveSessionsAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - baslrp.baslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.GetActiveSessionsAllFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if baslrp.baslr.Response.Response, err = future.GetResult(sender); err == nil && baslrp.baslr.Response.Response.StatusCode != http.StatusNoContent { - baslrp, err = client.GetActiveSessionsResponder(baslrp.baslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GetActiveSessionsAllFuture", "Result", baslrp.baslr.Response.Response, "Failure responding to request") - } - } - return -} - -// GetActiveSessionsFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GetActiveSessionsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (BastionActiveSessionListResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GetActiveSessionsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GetActiveSessionsFuture.Result. -func (future *GetActiveSessionsFuture) result(client BaseClient) (baslrp BastionActiveSessionListResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GetActiveSessionsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - baslrp.baslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.GetActiveSessionsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if baslrp.baslr.Response.Response, err = future.GetResult(sender); err == nil && baslrp.baslr.Response.Response.StatusCode != http.StatusNoContent { - baslrp, err = client.GetActiveSessionsResponder(baslrp.baslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GetActiveSessionsFuture", "Result", baslrp.baslr.Response.Response, "Failure responding to request") - } - } - return -} - -// GetInboundRoutesParameters the parameters specifying the connection resource whose inbound routes are -// being requested. -type GetInboundRoutesParameters struct { - // ResourceURI - The connection resource whose inbound routes are being requested. - ResourceURI *string `json:"resourceUri,omitempty"` - // ConnectionType - The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. - ConnectionType *string `json:"connectionType,omitempty"` -} - -// GetOutboundRoutesParameters the parameters specifying the connection resource whose outbound routes are -// being requested. -type GetOutboundRoutesParameters struct { - // ResourceURI - The connection resource whose outbound routes are being requested. - ResourceURI *string `json:"resourceUri,omitempty"` - // ConnectionType - The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. - ConnectionType *string `json:"connectionType,omitempty"` -} - -// GetVpnSitesConfigurationRequest list of Vpn-Sites. -type GetVpnSitesConfigurationRequest struct { - // VpnSites - List of resource-ids of the vpn-sites for which config is to be downloaded. - VpnSites *[]string `json:"vpnSites,omitempty"` - // OutputBlobSasURL - The sas-url to download the configurations for vpn-sites. - OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` -} - -// Group the network group resource -type Group struct { - autorest.Response `json:"-"` - // GroupProperties - The Network Group properties - *GroupProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for Group. -func (g Group) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if g.GroupProperties != nil { - objectMap["properties"] = g.GroupProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Group struct. -func (g *Group) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var groupProperties GroupProperties - err = json.Unmarshal(*v, &groupProperties) - if err != nil { - return err - } - g.GroupProperties = &groupProperties - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - g.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - g.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - g.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - g.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - g.Etag = &etag - } - } - } - - return nil -} - -// GroupListResult result of the request to list NetworkGroup. It contains a list of groups and a URL link -// to get the next set of results. -type GroupListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of NetworkGroup - Value *[]Group `json:"value,omitempty"` - // NextLink - Gets the URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// GroupListResultIterator provides access to a complete listing of Group values. -type GroupListResultIterator struct { - i int - page GroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GroupListResultIterator) Response() GroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GroupListResultIterator) Value() Group { - if !iter.page.NotDone() { - return Group{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GroupListResultIterator type. -func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator { - return GroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (glr GroupListResult) IsEmpty() bool { - return glr.Value == nil || len(*glr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (glr GroupListResult) hasNextLink() bool { - return glr.NextLink != nil && len(*glr.NextLink) != 0 -} - -// groupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (glr GroupListResult) groupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !glr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(glr.NextLink))) -} - -// GroupListResultPage contains a page of Group values. -type GroupListResultPage struct { - fn func(context.Context, GroupListResult) (GroupListResult, error) - glr GroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.glr) - if err != nil { - return err - } - page.glr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GroupListResultPage) NotDone() bool { - return !page.glr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GroupListResultPage) Response() GroupListResult { - return page.glr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GroupListResultPage) Values() []Group { - if page.glr.IsEmpty() { - return nil - } - return *page.glr.Value -} - -// Creates a new instance of the GroupListResultPage type. -func NewGroupListResultPage(cur GroupListResult, getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { - return GroupListResultPage{ - fn: getNextPage, - glr: cur, - } -} - -// GroupProperties properties of network group -type GroupProperties struct { - // Description - A description of the network group. - Description *string `json:"description,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the scope assignment resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for GroupProperties. -func (gp GroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gp.Description != nil { - objectMap["description"] = gp.Description - } - return json.Marshal(objectMap) -} - -// GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type GroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GroupsDeleteFuture.Result. -func (future *GroupsDeleteFuture) result(client GroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.GroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.GroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// HopLink hop link. -type HopLink struct { - // NextHopID - READ-ONLY; The ID of the next hop. - NextHopID *string `json:"nextHopId,omitempty"` - // LinkType - READ-ONLY; Link type. - LinkType *string `json:"linkType,omitempty"` - // HopLinkProperties - Hop link properties. - *HopLinkProperties `json:"properties,omitempty"` - // Issues - READ-ONLY; List of issues. - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - // Context - READ-ONLY; Provides additional context on links. - Context map[string]*string `json:"context"` - // ResourceID - READ-ONLY; Resource ID. - ResourceID *string `json:"resourceId,omitempty"` -} - -// MarshalJSON is the custom marshaler for HopLink. -func (hl HopLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hl.HopLinkProperties != nil { - objectMap["properties"] = hl.HopLinkProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for HopLink struct. -func (hl *HopLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "nextHopId": - if v != nil { - var nextHopID string - err = json.Unmarshal(*v, &nextHopID) - if err != nil { - return err - } - hl.NextHopID = &nextHopID - } - case "linkType": - if v != nil { - var linkType string - err = json.Unmarshal(*v, &linkType) - if err != nil { - return err - } - hl.LinkType = &linkType - } - case "properties": - if v != nil { - var hopLinkProperties HopLinkProperties - err = json.Unmarshal(*v, &hopLinkProperties) - if err != nil { - return err - } - hl.HopLinkProperties = &hopLinkProperties - } - case "issues": - if v != nil { - var issues []ConnectivityIssue - err = json.Unmarshal(*v, &issues) - if err != nil { - return err - } - hl.Issues = &issues - } - case "context": - if v != nil { - var context map[string]*string - err = json.Unmarshal(*v, &context) - if err != nil { - return err - } - hl.Context = context - } - case "resourceId": - if v != nil { - var resourceID string - err = json.Unmarshal(*v, &resourceID) - if err != nil { - return err - } - hl.ResourceID = &resourceID - } - } - } - - return nil -} - -// HopLinkProperties hop link properties. -type HopLinkProperties struct { - // RoundTripTimeMin - READ-ONLY; Minimum roundtrip time in milliseconds. - RoundTripTimeMin *int64 `json:"roundTripTimeMin,omitempty"` - // RoundTripTimeAvg - READ-ONLY; Average roundtrip time in milliseconds. - RoundTripTimeAvg *int64 `json:"roundTripTimeAvg,omitempty"` - // RoundTripTimeMax - READ-ONLY; Maximum roundtrip time in milliseconds. - RoundTripTimeMax *int64 `json:"roundTripTimeMax,omitempty"` -} - -// MarshalJSON is the custom marshaler for HopLinkProperties. -func (hlp HopLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// HTTPConfiguration HTTP configuration of the connectivity check. -type HTTPConfiguration struct { - // Method - HTTP method. Possible values include: 'HTTPMethodGet' - Method HTTPMethod `json:"method,omitempty"` - // Headers - List of HTTP headers. - Headers *[]HTTPHeader `json:"headers,omitempty"` - // ValidStatusCodes - Valid status codes. - ValidStatusCodes *[]int32 `json:"validStatusCodes,omitempty"` -} - -// HTTPHeader the HTTP header. -type HTTPHeader struct { - // Name - The name in HTTP header. - Name *string `json:"name,omitempty"` - // Value - The value in HTTP header. - Value *string `json:"value,omitempty"` -} - -// Hub hub Item. -type Hub struct { - // ResourceID - Resource Id. - ResourceID *string `json:"resourceId,omitempty"` - // ResourceType - Resource Type. - ResourceType *string `json:"resourceType,omitempty"` -} - -// HubIPAddresses IP addresses associated with azure firewall. -type HubIPAddresses struct { - // PublicIPs - Public IP addresses associated with azure firewall. - PublicIPs *HubPublicIPAddresses `json:"publicIPs,omitempty"` - // PrivateIPAddress - Private IP Address associated with azure firewall. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} - -// HubIPConfiguration ipConfigurations. -type HubIPConfiguration struct { - autorest.Response `json:"-"` - // HubIPConfigurationPropertiesFormat - The properties of the Virtual Hub IPConfigurations. - *HubIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the Ip Configuration. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Ipconfiguration type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubIPConfiguration. -func (hic HubIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hic.HubIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = hic.HubIPConfigurationPropertiesFormat - } - if hic.Name != nil { - objectMap["name"] = hic.Name - } - if hic.ID != nil { - objectMap["id"] = hic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for HubIPConfiguration struct. -func (hic *HubIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var hubIPConfigurationPropertiesFormat HubIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &hubIPConfigurationPropertiesFormat) - if err != nil { - return err - } - hic.HubIPConfigurationPropertiesFormat = &hubIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - hic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - hic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - hic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - hic.ID = &ID - } - } - } - - return nil -} - -// HubIPConfigurationPropertiesFormat properties of IP configuration. -type HubIPConfigurationPropertiesFormat struct { - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - // PublicIPAddress - The reference to the public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubIPConfigurationPropertiesFormat. -func (hicpf HubIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hicpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = hicpf.PrivateIPAddress - } - if hicpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = hicpf.PrivateIPAllocationMethod - } - if hicpf.Subnet != nil { - objectMap["subnet"] = hicpf.Subnet - } - if hicpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = hicpf.PublicIPAddress - } - return json.Marshal(objectMap) -} - -// HubPublicIPAddresses public IP addresses associated with azure firewall. -type HubPublicIPAddresses struct { - // Addresses - The list of Public IP addresses associated with azure firewall or IP addresses to be retained. - Addresses *[]AzureFirewallPublicIPAddress `json:"addresses,omitempty"` - // Count - The number of Public IP addresses associated with azure firewall. - Count *int32 `json:"count,omitempty"` -} - -// HubRoute routeTable route. -type HubRoute struct { - // Name - The name of the Route that is unique within a RouteTable. This name can be used to access this route. - Name *string `json:"name,omitempty"` - // DestinationType - The type of destinations (eg: CIDR, ResourceId, Service). - DestinationType *string `json:"destinationType,omitempty"` - // Destinations - List of all destinations. - Destinations *[]string `json:"destinations,omitempty"` - // NextHopType - The type of next hop (eg: ResourceId). - NextHopType *string `json:"nextHopType,omitempty"` - // NextHop - NextHop resource ID. - NextHop *string `json:"nextHop,omitempty"` -} - -// HubRouteTable routeTable resource in a virtual hub. -type HubRouteTable struct { - autorest.Response `json:"-"` - // HubRouteTableProperties - Properties of the RouteTable resource. - *HubRouteTableProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubRouteTable. -func (hrt HubRouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hrt.HubRouteTableProperties != nil { - objectMap["properties"] = hrt.HubRouteTableProperties - } - if hrt.Name != nil { - objectMap["name"] = hrt.Name - } - if hrt.ID != nil { - objectMap["id"] = hrt.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for HubRouteTable struct. -func (hrt *HubRouteTable) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var hubRouteTableProperties HubRouteTableProperties - err = json.Unmarshal(*v, &hubRouteTableProperties) - if err != nil { - return err - } - hrt.HubRouteTableProperties = &hubRouteTableProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - hrt.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - hrt.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - hrt.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - hrt.ID = &ID - } - } - } - - return nil -} - -// HubRouteTableProperties parameters for RouteTable. -type HubRouteTableProperties struct { - // Routes - List of all routes. - Routes *[]HubRoute `json:"routes,omitempty"` - // Labels - List of labels associated with this route table. - Labels *[]string `json:"labels,omitempty"` - // AssociatedConnections - READ-ONLY; List of all connections associated with this route table. - AssociatedConnections *[]string `json:"associatedConnections,omitempty"` - // PropagatingConnections - READ-ONLY; List of all connections that advertise to this route table. - PropagatingConnections *[]string `json:"propagatingConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the RouteTable resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubRouteTableProperties. -func (hrtp HubRouteTableProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hrtp.Routes != nil { - objectMap["routes"] = hrtp.Routes - } - if hrtp.Labels != nil { - objectMap["labels"] = hrtp.Labels - } - return json.Marshal(objectMap) -} - -// HubRouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HubRouteTablesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(HubRouteTablesClient) (HubRouteTable, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *HubRouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for HubRouteTablesCreateOrUpdateFuture.Result. -func (future *HubRouteTablesCreateOrUpdateFuture) result(client HubRouteTablesClient) (hrt HubRouteTable, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - hrt.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.HubRouteTablesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hrt.Response.Response, err = future.GetResult(sender); err == nil && hrt.Response.Response.StatusCode != http.StatusNoContent { - hrt, err = client.CreateOrUpdateResponder(hrt.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesCreateOrUpdateFuture", "Result", hrt.Response.Response, "Failure responding to request") - } - } - return -} - -// HubRouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type HubRouteTablesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(HubRouteTablesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *HubRouteTablesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for HubRouteTablesDeleteFuture.Result. -func (future *HubRouteTablesDeleteFuture) result(client HubRouteTablesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubRouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.HubRouteTablesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// HubVirtualNetworkConnection hubVirtualNetworkConnection Resource. -type HubVirtualNetworkConnection struct { - autorest.Response `json:"-"` - // HubVirtualNetworkConnectionProperties - Properties of the hub virtual network connection. - *HubVirtualNetworkConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubVirtualNetworkConnection. -func (hvnc HubVirtualNetworkConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hvnc.HubVirtualNetworkConnectionProperties != nil { - objectMap["properties"] = hvnc.HubVirtualNetworkConnectionProperties - } - if hvnc.Name != nil { - objectMap["name"] = hvnc.Name - } - if hvnc.ID != nil { - objectMap["id"] = hvnc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for HubVirtualNetworkConnection struct. -func (hvnc *HubVirtualNetworkConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var hubVirtualNetworkConnectionProperties HubVirtualNetworkConnectionProperties - err = json.Unmarshal(*v, &hubVirtualNetworkConnectionProperties) - if err != nil { - return err - } - hvnc.HubVirtualNetworkConnectionProperties = &hubVirtualNetworkConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - hvnc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - hvnc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - hvnc.ID = &ID - } - } - } - - return nil -} - -// HubVirtualNetworkConnectionProperties parameters for HubVirtualNetworkConnection. -type HubVirtualNetworkConnectionProperties struct { - // RemoteVirtualNetwork - Reference to the remote virtual network. - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - // AllowHubToRemoteVnetTransit - Deprecated: VirtualHub to RemoteVnet transit to enabled or not. - AllowHubToRemoteVnetTransit *bool `json:"allowHubToRemoteVnetTransit,omitempty"` - // AllowRemoteVnetToUseHubVnetGateways - Deprecated: Allow RemoteVnet to use Virtual Hub's gateways. - AllowRemoteVnetToUseHubVnetGateways *bool `json:"allowRemoteVnetToUseHubVnetGateways,omitempty"` - // EnableInternetSecurity - Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the hub virtual network connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for HubVirtualNetworkConnectionProperties. -func (hvncp HubVirtualNetworkConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hvncp.RemoteVirtualNetwork != nil { - objectMap["remoteVirtualNetwork"] = hvncp.RemoteVirtualNetwork - } - if hvncp.AllowHubToRemoteVnetTransit != nil { - objectMap["allowHubToRemoteVnetTransit"] = hvncp.AllowHubToRemoteVnetTransit - } - if hvncp.AllowRemoteVnetToUseHubVnetGateways != nil { - objectMap["allowRemoteVnetToUseHubVnetGateways"] = hvncp.AllowRemoteVnetToUseHubVnetGateways - } - if hvncp.EnableInternetSecurity != nil { - objectMap["enableInternetSecurity"] = hvncp.EnableInternetSecurity - } - if hvncp.RoutingConfiguration != nil { - objectMap["routingConfiguration"] = hvncp.RoutingConfiguration - } - return json.Marshal(objectMap) -} - -// HubVirtualNetworkConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type HubVirtualNetworkConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(HubVirtualNetworkConnectionsClient) (HubVirtualNetworkConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *HubVirtualNetworkConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for HubVirtualNetworkConnectionsCreateOrUpdateFuture.Result. -func (future *HubVirtualNetworkConnectionsCreateOrUpdateFuture) result(client HubVirtualNetworkConnectionsClient) (hvnc HubVirtualNetworkConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - hvnc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.HubVirtualNetworkConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hvnc.Response.Response, err = future.GetResult(sender); err == nil && hvnc.Response.Response.StatusCode != http.StatusNoContent { - hvnc, err = client.CreateOrUpdateResponder(hvnc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsCreateOrUpdateFuture", "Result", hvnc.Response.Response, "Failure responding to request") - } - } - return -} - -// HubVirtualNetworkConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type HubVirtualNetworkConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(HubVirtualNetworkConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *HubVirtualNetworkConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for HubVirtualNetworkConnectionsDeleteFuture.Result. -func (future *HubVirtualNetworkConnectionsDeleteFuture) result(client HubVirtualNetworkConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.HubVirtualNetworkConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.HubVirtualNetworkConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// IDPSQueryObject will describe the query to run against the IDPS signatures DB -type IDPSQueryObject struct { - // Filters - Contain all filters names and values - Filters *[]FilterItems `json:"filters,omitempty"` - // Search - Search term in all columns - Search *string `json:"search,omitempty"` - // OrderBy - Column to sort response by - OrderBy *OrderBy `json:"orderBy,omitempty"` - // ResultsPerPage - The number of the results to return in each page - ResultsPerPage *int32 `json:"resultsPerPage,omitempty"` - // Skip - The number of records matching the filter to skip - Skip *int32 `json:"skip,omitempty"` -} - -// InboundNatPool inbound NAT pool of the load balancer. -type InboundNatPool struct { - // InboundNatPoolPropertiesFormat - Properties of load balancer inbound nat pool. - *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of inbound NAT pools used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatPool. -func (inp InboundNatPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inp.InboundNatPoolPropertiesFormat != nil { - objectMap["properties"] = inp.InboundNatPoolPropertiesFormat - } - if inp.Name != nil { - objectMap["name"] = inp.Name - } - if inp.ID != nil { - objectMap["id"] = inp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InboundNatPool struct. -func (inp *InboundNatPool) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat - err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat) - if err != nil { - return err - } - inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - inp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - inp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - inp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - inp.ID = &ID - } - } - } - - return nil -} - -// InboundNatPoolPropertiesFormat properties of Inbound NAT pool. -type InboundNatPoolPropertiesFormat struct { - // FrontendIPConfiguration - A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // Protocol - The reference to the transport protocol used by the inbound NAT pool. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' - Protocol TransportProtocol `json:"protocol,omitempty"` - // FrontendPortRangeStart - The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. - FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` - // FrontendPortRangeEnd - The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. - FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` - // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. - BackendPort *int32 `json:"backendPort,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatPoolPropertiesFormat. -func (inppf InboundNatPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inppf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = inppf.FrontendIPConfiguration - } - if inppf.Protocol != "" { - objectMap["protocol"] = inppf.Protocol - } - if inppf.FrontendPortRangeStart != nil { - objectMap["frontendPortRangeStart"] = inppf.FrontendPortRangeStart - } - if inppf.FrontendPortRangeEnd != nil { - objectMap["frontendPortRangeEnd"] = inppf.FrontendPortRangeEnd - } - if inppf.BackendPort != nil { - objectMap["backendPort"] = inppf.BackendPort - } - if inppf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = inppf.IdleTimeoutInMinutes - } - if inppf.EnableFloatingIP != nil { - objectMap["enableFloatingIP"] = inppf.EnableFloatingIP - } - if inppf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = inppf.EnableTCPReset - } - return json.Marshal(objectMap) -} - -// InboundNatRule inbound NAT rule of the load balancer. -type InboundNatRule struct { - autorest.Response `json:"-"` - // InboundNatRulePropertiesFormat - Properties of load balancer inbound NAT rule. - *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of inbound NAT rules used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatRule. -func (inr InboundNatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inr.InboundNatRulePropertiesFormat != nil { - objectMap["properties"] = inr.InboundNatRulePropertiesFormat - } - if inr.Name != nil { - objectMap["name"] = inr.Name - } - if inr.ID != nil { - objectMap["id"] = inr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InboundNatRule struct. -func (inr *InboundNatRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat - err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat) - if err != nil { - return err - } - inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - inr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - inr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - inr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - inr.ID = &ID - } - } - } - - return nil -} - -// InboundNatRuleListResult response for ListInboundNatRule API service call. -type InboundNatRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of inbound NAT rules in a load balancer. - Value *[]InboundNatRule `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatRuleListResult. -func (inrlr InboundNatRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inrlr.Value != nil { - objectMap["value"] = inrlr.Value - } - return json.Marshal(objectMap) -} - -// InboundNatRuleListResultIterator provides access to a complete listing of InboundNatRule values. -type InboundNatRuleListResultIterator struct { - i int - page InboundNatRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InboundNatRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InboundNatRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InboundNatRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InboundNatRuleListResultIterator) Response() InboundNatRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InboundNatRuleListResultIterator) Value() InboundNatRule { - if !iter.page.NotDone() { - return InboundNatRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InboundNatRuleListResultIterator type. -func NewInboundNatRuleListResultIterator(page InboundNatRuleListResultPage) InboundNatRuleListResultIterator { - return InboundNatRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (inrlr InboundNatRuleListResult) IsEmpty() bool { - return inrlr.Value == nil || len(*inrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (inrlr InboundNatRuleListResult) hasNextLink() bool { - return inrlr.NextLink != nil && len(*inrlr.NextLink) != 0 -} - -// inboundNatRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (inrlr InboundNatRuleListResult) inboundNatRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !inrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(inrlr.NextLink))) -} - -// InboundNatRuleListResultPage contains a page of InboundNatRule values. -type InboundNatRuleListResultPage struct { - fn func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error) - inrlr InboundNatRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InboundNatRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.inrlr) - if err != nil { - return err - } - page.inrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InboundNatRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InboundNatRuleListResultPage) NotDone() bool { - return !page.inrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InboundNatRuleListResultPage) Response() InboundNatRuleListResult { - return page.inrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InboundNatRuleListResultPage) Values() []InboundNatRule { - if page.inrlr.IsEmpty() { - return nil - } - return *page.inrlr.Value -} - -// Creates a new instance of the InboundNatRuleListResultPage type. -func NewInboundNatRuleListResultPage(cur InboundNatRuleListResult, getNextPage func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error)) InboundNatRuleListResultPage { - return InboundNatRuleListResultPage{ - fn: getNextPage, - inrlr: cur, - } -} - -// InboundNatRulePortMapping individual port mappings for inbound NAT rule created for backend pool. -type InboundNatRulePortMapping struct { - // InboundNatRuleName - READ-ONLY; Name of inbound NAT rule. - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` - // Protocol - READ-ONLY; The reference to the transport protocol used by the inbound NAT rule. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' - Protocol TransportProtocol `json:"protocol,omitempty"` - // FrontendPort - READ-ONLY; Frontend port. - FrontendPort *int32 `json:"frontendPort,omitempty"` - // BackendPort - READ-ONLY; Backend port. - BackendPort *int32 `json:"backendPort,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatRulePortMapping. -func (inrpm InboundNatRulePortMapping) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// InboundNatRulePropertiesFormat properties of the inbound NAT rule. -type InboundNatRulePropertiesFormat struct { - // FrontendIPConfiguration - A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // BackendIPConfiguration - READ-ONLY; A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. - BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - // Protocol - The reference to the transport protocol used by the load balancing rule. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' - Protocol TransportProtocol `json:"protocol,omitempty"` - // FrontendPort - The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. - FrontendPort *int32 `json:"frontendPort,omitempty"` - // BackendPort - The port used for the internal endpoint. Acceptable values range from 1 to 65535. - BackendPort *int32 `json:"backendPort,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // FrontendPortRangeStart - The port range start for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeEnd. Individual inbound NAT rule port mappings will be created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. - FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` - // FrontendPortRangeEnd - The port range end for the external endpoint. This property is used together with BackendAddressPool and FrontendPortRangeStart. Individual inbound NAT rule port mappings will be created for each backend address from BackendAddressPool. Acceptable values range from 1 to 65534. - FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` - // BackendAddressPool - A reference to backendAddressPool resource. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the inbound NAT rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundNatRulePropertiesFormat. -func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if inrpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = inrpf.FrontendIPConfiguration - } - if inrpf.Protocol != "" { - objectMap["protocol"] = inrpf.Protocol - } - if inrpf.FrontendPort != nil { - objectMap["frontendPort"] = inrpf.FrontendPort - } - if inrpf.BackendPort != nil { - objectMap["backendPort"] = inrpf.BackendPort - } - if inrpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = inrpf.IdleTimeoutInMinutes - } - if inrpf.EnableFloatingIP != nil { - objectMap["enableFloatingIP"] = inrpf.EnableFloatingIP - } - if inrpf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = inrpf.EnableTCPReset - } - if inrpf.FrontendPortRangeStart != nil { - objectMap["frontendPortRangeStart"] = inrpf.FrontendPortRangeStart - } - if inrpf.FrontendPortRangeEnd != nil { - objectMap["frontendPortRangeEnd"] = inrpf.FrontendPortRangeEnd - } - if inrpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = inrpf.BackendAddressPool - } - return json.Marshal(objectMap) -} - -// InboundNatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InboundNatRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InboundNatRulesClient) (InboundNatRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InboundNatRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InboundNatRulesCreateOrUpdateFuture.Result. -func (future *InboundNatRulesCreateOrUpdateFuture) result(client InboundNatRulesClient) (inr InboundNatRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - inr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if inr.Response.Response, err = future.GetResult(sender); err == nil && inr.Response.Response.StatusCode != http.StatusNoContent { - inr, err = client.CreateOrUpdateResponder(inr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", inr.Response.Response, "Failure responding to request") - } - } - return -} - -// InboundNatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type InboundNatRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InboundNatRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InboundNatRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InboundNatRulesDeleteFuture.Result. -func (future *InboundNatRulesDeleteFuture) result(client InboundNatRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// InboundSecurityRule NVA Inbound Security Rule resource. -type InboundSecurityRule struct { - autorest.Response `json:"-"` - // InboundSecurityRuleProperties - The properties of the Inbound Security Rules. - *InboundSecurityRuleProperties `json:"properties,omitempty"` - // Name - Name of security rule collection. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; NVA inbound security rule type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundSecurityRule. -func (isr InboundSecurityRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if isr.InboundSecurityRuleProperties != nil { - objectMap["properties"] = isr.InboundSecurityRuleProperties - } - if isr.Name != nil { - objectMap["name"] = isr.Name - } - if isr.ID != nil { - objectMap["id"] = isr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InboundSecurityRule struct. -func (isr *InboundSecurityRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var inboundSecurityRuleProperties InboundSecurityRuleProperties - err = json.Unmarshal(*v, &inboundSecurityRuleProperties) - if err != nil { - return err - } - isr.InboundSecurityRuleProperties = &inboundSecurityRuleProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - isr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - isr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - isr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - isr.ID = &ID - } - } - } - - return nil -} - -// InboundSecurityRuleCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InboundSecurityRuleCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InboundSecurityRuleClient) (InboundSecurityRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InboundSecurityRuleCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InboundSecurityRuleCreateOrUpdateFuture.Result. -func (future *InboundSecurityRuleCreateOrUpdateFuture) result(client InboundSecurityRuleClient) (isr InboundSecurityRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundSecurityRuleCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - isr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InboundSecurityRuleCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if isr.Response.Response, err = future.GetResult(sender); err == nil && isr.Response.Response.StatusCode != http.StatusNoContent { - isr, err = client.CreateOrUpdateResponder(isr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InboundSecurityRuleCreateOrUpdateFuture", "Result", isr.Response.Response, "Failure responding to request") - } - } - return -} - -// InboundSecurityRuleProperties properties of the Inbound Security Rules resource. -type InboundSecurityRuleProperties struct { - // Rules - List of allowed rules. - Rules *[]InboundSecurityRules `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for InboundSecurityRuleProperties. -func (isrp InboundSecurityRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if isrp.Rules != nil { - objectMap["rules"] = isrp.Rules - } - return json.Marshal(objectMap) -} - -// InboundSecurityRules properties of the Inbound Security Rules resource. -type InboundSecurityRules struct { - // Protocol - Protocol. This should be either TCP or UDP. Possible values include: 'InboundSecurityRulesProtocolTCP', 'InboundSecurityRulesProtocolUDP' - Protocol InboundSecurityRulesProtocol `json:"protocol,omitempty"` - // SourceAddressPrefix - The CIDR or source IP range. Only /30, /31 and /32 Ip ranges are allowed. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - // DestinationPortRange - NVA port ranges to be opened up. One needs to provide specific ports. - DestinationPortRange *int32 `json:"destinationPortRange,omitempty"` -} - -// IntentPolicy network Intent Policy resource. -type IntentPolicy struct { - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for IntentPolicy. -func (IP IntentPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if IP.ID != nil { - objectMap["id"] = IP.ID - } - if IP.Location != nil { - objectMap["location"] = IP.Location - } - if IP.Tags != nil { - objectMap["tags"] = IP.Tags - } - return json.Marshal(objectMap) -} - -// IntentPolicyConfiguration details of NetworkIntentPolicyConfiguration for PrepareNetworkPoliciesRequest. -type IntentPolicyConfiguration struct { - // NetworkIntentPolicyName - The name of the Network Intent Policy for storing in target subscription. - NetworkIntentPolicyName *string `json:"networkIntentPolicyName,omitempty"` - // SourceNetworkIntentPolicy - Source network intent policy. - SourceNetworkIntentPolicy *IntentPolicy `json:"sourceNetworkIntentPolicy,omitempty"` -} - -// Interface a network interface in a resource group. -type Interface struct { - autorest.Response `json:"-"` - // ExtendedLocation - The extended location of the network interface. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // InterfacePropertiesFormat - Properties of the network interface. - *InterfacePropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Interface. -func (i Interface) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i.ExtendedLocation != nil { - objectMap["extendedLocation"] = i.ExtendedLocation - } - if i.InterfacePropertiesFormat != nil { - objectMap["properties"] = i.InterfacePropertiesFormat - } - if i.ID != nil { - objectMap["id"] = i.ID - } - if i.Location != nil { - objectMap["location"] = i.Location - } - if i.Tags != nil { - objectMap["tags"] = i.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Interface struct. -func (i *Interface) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - i.ExtendedLocation = &extendedLocation - } - case "properties": - if v != nil { - var interfacePropertiesFormat InterfacePropertiesFormat - err = json.Unmarshal(*v, &interfacePropertiesFormat) - if err != nil { - return err - } - i.InterfacePropertiesFormat = &interfacePropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - i.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - i.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - i.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - i.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - i.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - i.Tags = tags - } - } - } - - return nil -} - -// InterfaceAssociation network interface and its custom security rules. -type InterfaceAssociation struct { - // ID - READ-ONLY; Network interface ID. - ID *string `json:"id,omitempty"` - // SecurityRules - Collection of custom security rules. - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceAssociation. -func (ia InterfaceAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ia.SecurityRules != nil { - objectMap["securityRules"] = ia.SecurityRules - } - return json.Marshal(objectMap) -} - -// InterfaceDNSSettings DNS settings of a network interface. -type InterfaceDNSSettings struct { - // DNSServers - List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. - DNSServers *[]string `json:"dnsServers,omitempty"` - // AppliedDNSServers - READ-ONLY; If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. - AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"` - // InternalDNSNameLabel - Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. - InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"` - // InternalFqdn - READ-ONLY; Fully qualified DNS name supporting internal communications between VMs in the same virtual network. - InternalFqdn *string `json:"internalFqdn,omitempty"` - // InternalDomainNameSuffix - READ-ONLY; Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceDNSSettings. -func (ids InterfaceDNSSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ids.DNSServers != nil { - objectMap["dnsServers"] = ids.DNSServers - } - if ids.InternalDNSNameLabel != nil { - objectMap["internalDnsNameLabel"] = ids.InternalDNSNameLabel - } - return json.Marshal(objectMap) -} - -// InterfaceIPConfiguration iPConfiguration in a network interface. -type InterfaceIPConfiguration struct { - autorest.Response `json:"-"` - // InterfaceIPConfigurationPropertiesFormat - Network interface IP configuration properties. - *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceIPConfiguration. -func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iic.InterfaceIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat - } - if iic.Name != nil { - objectMap["name"] = iic.Name - } - if iic.Type != nil { - objectMap["type"] = iic.Type - } - if iic.ID != nil { - objectMap["id"] = iic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct. -func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat) - if err != nil { - return err - } - iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - iic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - iic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - iic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - iic.ID = &ID - } - } - } - - return nil -} - -// InterfaceIPConfigurationListResult response for list ip configurations API service call. -type InterfaceIPConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - A list of ip configurations. - Value *[]InterfaceIPConfiguration `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceIPConfigurationListResult. -func (iiclr InterfaceIPConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iiclr.Value != nil { - objectMap["value"] = iiclr.Value - } - return json.Marshal(objectMap) -} - -// InterfaceIPConfigurationListResultIterator provides access to a complete listing of -// InterfaceIPConfiguration values. -type InterfaceIPConfigurationListResultIterator struct { - i int - page InterfaceIPConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InterfaceIPConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InterfaceIPConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InterfaceIPConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InterfaceIPConfigurationListResultIterator) Response() InterfaceIPConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InterfaceIPConfigurationListResultIterator) Value() InterfaceIPConfiguration { - if !iter.page.NotDone() { - return InterfaceIPConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InterfaceIPConfigurationListResultIterator type. -func NewInterfaceIPConfigurationListResultIterator(page InterfaceIPConfigurationListResultPage) InterfaceIPConfigurationListResultIterator { - return InterfaceIPConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (iiclr InterfaceIPConfigurationListResult) IsEmpty() bool { - return iiclr.Value == nil || len(*iiclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (iiclr InterfaceIPConfigurationListResult) hasNextLink() bool { - return iiclr.NextLink != nil && len(*iiclr.NextLink) != 0 -} - -// interfaceIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (iiclr InterfaceIPConfigurationListResult) interfaceIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !iiclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(iiclr.NextLink))) -} - -// InterfaceIPConfigurationListResultPage contains a page of InterfaceIPConfiguration values. -type InterfaceIPConfigurationListResultPage struct { - fn func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error) - iiclr InterfaceIPConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InterfaceIPConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.iiclr) - if err != nil { - return err - } - page.iiclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InterfaceIPConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InterfaceIPConfigurationListResultPage) NotDone() bool { - return !page.iiclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InterfaceIPConfigurationListResultPage) Response() InterfaceIPConfigurationListResult { - return page.iiclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InterfaceIPConfigurationListResultPage) Values() []InterfaceIPConfiguration { - if page.iiclr.IsEmpty() { - return nil - } - return *page.iiclr.Value -} - -// Creates a new instance of the InterfaceIPConfigurationListResultPage type. -func NewInterfaceIPConfigurationListResultPage(cur InterfaceIPConfigurationListResult, getNextPage func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error)) InterfaceIPConfigurationListResultPage { - return InterfaceIPConfigurationListResultPage{ - fn: getNextPage, - iiclr: cur, - } -} - -// InterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnection properties for the network -// interface. -type InterfaceIPConfigurationPrivateLinkConnectionProperties struct { - // GroupID - READ-ONLY; The group ID for current private link connection. - GroupID *string `json:"groupId,omitempty"` - // RequiredMemberName - READ-ONLY; The required member name for current private link connection. - RequiredMemberName *string `json:"requiredMemberName,omitempty"` - // Fqdns - READ-ONLY; List of FQDNs for current private link connection. - Fqdns *[]string `json:"fqdns,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceIPConfigurationPrivateLinkConnectionProperties. -func (iicplcp InterfaceIPConfigurationPrivateLinkConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// InterfaceIPConfigurationPropertiesFormat properties of IP configuration. -type InterfaceIPConfigurationPropertiesFormat struct { - // GatewayLoadBalancer - The reference to gateway load balancer frontend IP. - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - // VirtualNetworkTaps - The reference to Virtual Network Taps. - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` - // ApplicationGatewayBackendAddressPools - The reference to ApplicationGatewayBackendAddressPool resource. - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - // LoadBalancerBackendAddressPools - The reference to LoadBalancerBackendAddressPool resource. - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatRules - A list of references of LoadBalancerInboundNatRules. - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - // PrivateIPAddress - Private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // Subnet - Subnet bound to the IP configuration. - Subnet *Subnet `json:"subnet,omitempty"` - // Primary - Whether this is a primary customer address on the network interface. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddress - Public IP address bound to the IP configuration. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ApplicationSecurityGroups - Application security groups in which the IP configuration is included. - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface IP configuration. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateLinkConnectionProperties - READ-ONLY; PrivateLinkConnection properties for the network interface. - PrivateLinkConnectionProperties *InterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceIPConfigurationPropertiesFormat. -func (iicpf InterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iicpf.GatewayLoadBalancer != nil { - objectMap["gatewayLoadBalancer"] = iicpf.GatewayLoadBalancer - } - if iicpf.VirtualNetworkTaps != nil { - objectMap["virtualNetworkTaps"] = iicpf.VirtualNetworkTaps - } - if iicpf.ApplicationGatewayBackendAddressPools != nil { - objectMap["applicationGatewayBackendAddressPools"] = iicpf.ApplicationGatewayBackendAddressPools - } - if iicpf.LoadBalancerBackendAddressPools != nil { - objectMap["loadBalancerBackendAddressPools"] = iicpf.LoadBalancerBackendAddressPools - } - if iicpf.LoadBalancerInboundNatRules != nil { - objectMap["loadBalancerInboundNatRules"] = iicpf.LoadBalancerInboundNatRules - } - if iicpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = iicpf.PrivateIPAddress - } - if iicpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = iicpf.PrivateIPAllocationMethod - } - if iicpf.PrivateIPAddressVersion != "" { - objectMap["privateIPAddressVersion"] = iicpf.PrivateIPAddressVersion - } - if iicpf.Subnet != nil { - objectMap["subnet"] = iicpf.Subnet - } - if iicpf.Primary != nil { - objectMap["primary"] = iicpf.Primary - } - if iicpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = iicpf.PublicIPAddress - } - if iicpf.ApplicationSecurityGroups != nil { - objectMap["applicationSecurityGroups"] = iicpf.ApplicationSecurityGroups - } - return json.Marshal(objectMap) -} - -// InterfaceListResult response for the ListNetworkInterface API service call. -type InterfaceListResult struct { - autorest.Response `json:"-"` - // Value - A list of network interfaces in a resource group. - Value *[]Interface `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceListResult. -func (ilr InterfaceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ilr.Value != nil { - objectMap["value"] = ilr.Value - } - return json.Marshal(objectMap) -} - -// InterfaceListResultIterator provides access to a complete listing of Interface values. -type InterfaceListResultIterator struct { - i int - page InterfaceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InterfaceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InterfaceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InterfaceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InterfaceListResultIterator) Response() InterfaceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InterfaceListResultIterator) Value() Interface { - if !iter.page.NotDone() { - return Interface{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InterfaceListResultIterator type. -func NewInterfaceListResultIterator(page InterfaceListResultPage) InterfaceListResultIterator { - return InterfaceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ilr InterfaceListResult) IsEmpty() bool { - return ilr.Value == nil || len(*ilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ilr InterfaceListResult) hasNextLink() bool { - return ilr.NextLink != nil && len(*ilr.NextLink) != 0 -} - -// interfaceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ilr.NextLink))) -} - -// InterfaceListResultPage contains a page of Interface values. -type InterfaceListResultPage struct { - fn func(context.Context, InterfaceListResult) (InterfaceListResult, error) - ilr InterfaceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err - } - page.ilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InterfaceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InterfaceListResultPage) NotDone() bool { - return !page.ilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InterfaceListResultPage) Response() InterfaceListResult { - return page.ilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InterfaceListResultPage) Values() []Interface { - if page.ilr.IsEmpty() { - return nil - } - return *page.ilr.Value -} - -// Creates a new instance of the InterfaceListResultPage type. -func NewInterfaceListResultPage(cur InterfaceListResult, getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage { - return InterfaceListResultPage{ - fn: getNextPage, - ilr: cur, - } -} - -// InterfaceLoadBalancerListResult response for list ip configurations API service call. -type InterfaceLoadBalancerListResult struct { - autorest.Response `json:"-"` - // Value - A list of load balancers. - Value *[]LoadBalancer `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceLoadBalancerListResult. -func (ilblr InterfaceLoadBalancerListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ilblr.Value != nil { - objectMap["value"] = ilblr.Value - } - return json.Marshal(objectMap) -} - -// InterfaceLoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. -type InterfaceLoadBalancerListResultIterator struct { - i int - page InterfaceLoadBalancerListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InterfaceLoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancerListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InterfaceLoadBalancerListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InterfaceLoadBalancerListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InterfaceLoadBalancerListResultIterator) Response() InterfaceLoadBalancerListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InterfaceLoadBalancerListResultIterator) Value() LoadBalancer { - if !iter.page.NotDone() { - return LoadBalancer{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InterfaceLoadBalancerListResultIterator type. -func NewInterfaceLoadBalancerListResultIterator(page InterfaceLoadBalancerListResultPage) InterfaceLoadBalancerListResultIterator { - return InterfaceLoadBalancerListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ilblr InterfaceLoadBalancerListResult) IsEmpty() bool { - return ilblr.Value == nil || len(*ilblr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ilblr InterfaceLoadBalancerListResult) hasNextLink() bool { - return ilblr.NextLink != nil && len(*ilblr.NextLink) != 0 -} - -// interfaceLoadBalancerListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ilblr InterfaceLoadBalancerListResult) interfaceLoadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ilblr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ilblr.NextLink))) -} - -// InterfaceLoadBalancerListResultPage contains a page of LoadBalancer values. -type InterfaceLoadBalancerListResultPage struct { - fn func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error) - ilblr InterfaceLoadBalancerListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InterfaceLoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancerListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ilblr) - if err != nil { - return err - } - page.ilblr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InterfaceLoadBalancerListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InterfaceLoadBalancerListResultPage) NotDone() bool { - return !page.ilblr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InterfaceLoadBalancerListResultPage) Response() InterfaceLoadBalancerListResult { - return page.ilblr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InterfaceLoadBalancerListResultPage) Values() []LoadBalancer { - if page.ilblr.IsEmpty() { - return nil - } - return *page.ilblr.Value -} - -// Creates a new instance of the InterfaceLoadBalancerListResultPage type. -func NewInterfaceLoadBalancerListResultPage(cur InterfaceLoadBalancerListResult, getNextPage func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error)) InterfaceLoadBalancerListResultPage { - return InterfaceLoadBalancerListResultPage{ - fn: getNextPage, - ilblr: cur, - } -} - -// InterfacePropertiesFormat networkInterface properties. -type InterfacePropertiesFormat struct { - // VirtualMachine - READ-ONLY; The reference to a virtual machine. - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - // NetworkSecurityGroup - The reference to the NetworkSecurityGroup resource. - NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` - // PrivateEndpoint - READ-ONLY; A reference to the private endpoint to which the network interface is linked. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // IPConfigurations - A list of IPConfigurations of the network interface. - IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - // TapConfigurations - READ-ONLY; A list of TapConfigurations of the network interface. - TapConfigurations *[]InterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - // DNSSettings - The DNS settings in network interface. - DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` - // MacAddress - READ-ONLY; The MAC address of the network interface. - MacAddress *string `json:"macAddress,omitempty"` - // Primary - READ-ONLY; Whether this is a primary network interface on a virtual machine. - Primary *bool `json:"primary,omitempty"` - // VnetEncryptionSupported - READ-ONLY; Whether the virtual machine this nic is attached to supports encryption. - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - // EnableAcceleratedNetworking - If the network interface is configured for accelerated networking. Not applicable to VM sizes which require accelerated networking. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // DisableTCPStateTracking - Indicates whether to disable tcp state tracking. - DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - // EnableIPForwarding - Indicates whether IP forwarding is enabled on this network interface. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - // HostedWorkloads - READ-ONLY; A list of references to linked BareMetal resources. - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - // DscpConfiguration - READ-ONLY; A reference to the dscp configuration to which the network interface is linked. - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the network interface resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // WorkloadType - WorkloadType of the NetworkInterface for BareMetal resources - WorkloadType *string `json:"workloadType,omitempty"` - // NicType - Type of Network Interface resource. Possible values include: 'Standard', 'Elastic' - NicType InterfaceNicType `json:"nicType,omitempty"` - // PrivateLinkService - Privatelinkservice of the network interface resource. - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - // MigrationPhase - Migration phase of Network Interface resource. Possible values include: 'InterfaceMigrationPhaseNone', 'InterfaceMigrationPhasePrepare', 'InterfaceMigrationPhaseCommit', 'InterfaceMigrationPhaseAbort', 'InterfaceMigrationPhaseCommitted' - MigrationPhase InterfaceMigrationPhase `json:"migrationPhase,omitempty"` - // AuxiliaryMode - Auxiliary mode of Network Interface resource. Possible values include: 'InterfaceAuxiliaryModeNone', 'InterfaceAuxiliaryModeMaxConnections', 'InterfaceAuxiliaryModeFloating' - AuxiliaryMode InterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfacePropertiesFormat. -func (ipf InterfacePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ipf.NetworkSecurityGroup != nil { - objectMap["networkSecurityGroup"] = ipf.NetworkSecurityGroup - } - if ipf.IPConfigurations != nil { - objectMap["ipConfigurations"] = ipf.IPConfigurations - } - if ipf.DNSSettings != nil { - objectMap["dnsSettings"] = ipf.DNSSettings - } - if ipf.EnableAcceleratedNetworking != nil { - objectMap["enableAcceleratedNetworking"] = ipf.EnableAcceleratedNetworking - } - if ipf.DisableTCPStateTracking != nil { - objectMap["disableTcpStateTracking"] = ipf.DisableTCPStateTracking - } - if ipf.EnableIPForwarding != nil { - objectMap["enableIPForwarding"] = ipf.EnableIPForwarding - } - if ipf.WorkloadType != nil { - objectMap["workloadType"] = ipf.WorkloadType - } - if ipf.NicType != "" { - objectMap["nicType"] = ipf.NicType - } - if ipf.PrivateLinkService != nil { - objectMap["privateLinkService"] = ipf.PrivateLinkService - } - if ipf.MigrationPhase != "" { - objectMap["migrationPhase"] = ipf.MigrationPhase - } - if ipf.AuxiliaryMode != "" { - objectMap["auxiliaryMode"] = ipf.AuxiliaryMode - } - return json.Marshal(objectMap) -} - -// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InterfacesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfacesClient) (Interface, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfacesCreateOrUpdateFuture.Result. -func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i Interface, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.CreateOrUpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type InterfacesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfacesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfacesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfacesDeleteFuture.Result. -func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InterfacesGetEffectiveRouteTableFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfacesClient) (EffectiveRouteListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfacesGetEffectiveRouteTableFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfacesGetEffectiveRouteTableFuture.Result. -func (future *InterfacesGetEffectiveRouteTableFuture) result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - erlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if erlr.Response.Response, err = future.GetResult(sender); err == nil && erlr.Response.Response.StatusCode != http.StatusNoContent { - erlr, err = client.GetEffectiveRouteTableResponder(erlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", erlr.Response.Response, "Failure responding to request") - } - } - return -} - -// InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type InterfacesListEffectiveNetworkSecurityGroupsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfacesClient) (EffectiveNetworkSecurityGroupListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfacesListEffectiveNetworkSecurityGroupsFuture.Result. -func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ensglr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ensglr.Response.Response, err = future.GetResult(sender); err == nil && ensglr.Response.Response.StatusCode != http.StatusNoContent { - ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(ensglr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", ensglr.Response.Response, "Failure responding to request") - } - } - return -} - -// InterfaceTapConfiguration tap configuration in a Network Interface. -type InterfaceTapConfiguration struct { - autorest.Response `json:"-"` - // InterfaceTapConfigurationPropertiesFormat - Properties of the Virtual Network Tap configuration. - *InterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceTapConfiguration. -func (itc InterfaceTapConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if itc.InterfaceTapConfigurationPropertiesFormat != nil { - objectMap["properties"] = itc.InterfaceTapConfigurationPropertiesFormat - } - if itc.Name != nil { - objectMap["name"] = itc.Name - } - if itc.ID != nil { - objectMap["id"] = itc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for InterfaceTapConfiguration struct. -func (itc *InterfaceTapConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var interfaceTapConfigurationPropertiesFormat InterfaceTapConfigurationPropertiesFormat - err = json.Unmarshal(*v, &interfaceTapConfigurationPropertiesFormat) - if err != nil { - return err - } - itc.InterfaceTapConfigurationPropertiesFormat = &interfaceTapConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - itc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - itc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - itc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - itc.ID = &ID - } - } - } - - return nil -} - -// InterfaceTapConfigurationListResult response for list tap configurations API service call. -type InterfaceTapConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - A list of tap configurations. - Value *[]InterfaceTapConfiguration `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceTapConfigurationListResult. -func (itclr InterfaceTapConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if itclr.Value != nil { - objectMap["value"] = itclr.Value - } - return json.Marshal(objectMap) -} - -// InterfaceTapConfigurationListResultIterator provides access to a complete listing of -// InterfaceTapConfiguration values. -type InterfaceTapConfigurationListResultIterator struct { - i int - page InterfaceTapConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InterfaceTapConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InterfaceTapConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InterfaceTapConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter InterfaceTapConfigurationListResultIterator) Response() InterfaceTapConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InterfaceTapConfigurationListResultIterator) Value() InterfaceTapConfiguration { - if !iter.page.NotDone() { - return InterfaceTapConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the InterfaceTapConfigurationListResultIterator type. -func NewInterfaceTapConfigurationListResultIterator(page InterfaceTapConfigurationListResultPage) InterfaceTapConfigurationListResultIterator { - return InterfaceTapConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (itclr InterfaceTapConfigurationListResult) IsEmpty() bool { - return itclr.Value == nil || len(*itclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (itclr InterfaceTapConfigurationListResult) hasNextLink() bool { - return itclr.NextLink != nil && len(*itclr.NextLink) != 0 -} - -// interfaceTapConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (itclr InterfaceTapConfigurationListResult) interfaceTapConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !itclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(itclr.NextLink))) -} - -// InterfaceTapConfigurationListResultPage contains a page of InterfaceTapConfiguration values. -type InterfaceTapConfigurationListResultPage struct { - fn func(context.Context, InterfaceTapConfigurationListResult) (InterfaceTapConfigurationListResult, error) - itclr InterfaceTapConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InterfaceTapConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.itclr) - if err != nil { - return err - } - page.itclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InterfaceTapConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InterfaceTapConfigurationListResultPage) NotDone() bool { - return !page.itclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page InterfaceTapConfigurationListResultPage) Response() InterfaceTapConfigurationListResult { - return page.itclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page InterfaceTapConfigurationListResultPage) Values() []InterfaceTapConfiguration { - if page.itclr.IsEmpty() { - return nil - } - return *page.itclr.Value -} - -// Creates a new instance of the InterfaceTapConfigurationListResultPage type. -func NewInterfaceTapConfigurationListResultPage(cur InterfaceTapConfigurationListResult, getNextPage func(context.Context, InterfaceTapConfigurationListResult) (InterfaceTapConfigurationListResult, error)) InterfaceTapConfigurationListResultPage { - return InterfaceTapConfigurationListResultPage{ - fn: getNextPage, - itclr: cur, - } -} - -// InterfaceTapConfigurationPropertiesFormat properties of Virtual Network Tap configuration. -type InterfaceTapConfigurationPropertiesFormat struct { - // VirtualNetworkTap - The reference to the Virtual Network Tap resource. - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network interface tap configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for InterfaceTapConfigurationPropertiesFormat. -func (itcpf InterfaceTapConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if itcpf.VirtualNetworkTap != nil { - objectMap["virtualNetworkTap"] = itcpf.VirtualNetworkTap - } - return json.Marshal(objectMap) -} - -// InterfaceTapConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type InterfaceTapConfigurationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfaceTapConfigurationsClient) (InterfaceTapConfiguration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfaceTapConfigurationsCreateOrUpdateFuture.Result. -func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) result(client InterfaceTapConfigurationsClient) (itc InterfaceTapConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - itc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfaceTapConfigurationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if itc.Response.Response, err = future.GetResult(sender); err == nil && itc.Response.Response.StatusCode != http.StatusNoContent { - itc, err = client.CreateOrUpdateResponder(itc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsCreateOrUpdateFuture", "Result", itc.Response.Response, "Failure responding to request") - } - } - return -} - -// InterfaceTapConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type InterfaceTapConfigurationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(InterfaceTapConfigurationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *InterfaceTapConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for InterfaceTapConfigurationsDeleteFuture.Result. -func (future *InterfaceTapConfigurationsDeleteFuture) result(client InterfaceTapConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.InterfaceTapConfigurationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// IPAddressAvailabilityResult response for CheckIPAddressAvailability API service call. -type IPAddressAvailabilityResult struct { - autorest.Response `json:"-"` - // Available - Private IP address availability. - Available *bool `json:"available,omitempty"` - // AvailableIPAddresses - Contains other available private IP addresses if the asked for address is taken. - AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"` - // IsPlatformReserved - Private IP address platform reserved. - IsPlatformReserved *bool `json:"isPlatformReserved,omitempty"` -} - -// IPAllocation ipAllocation resource. -type IPAllocation struct { - autorest.Response `json:"-"` - // IPAllocationPropertiesFormat - Properties of the IpAllocation. - *IPAllocationPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for IPAllocation. -func (ia IPAllocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ia.IPAllocationPropertiesFormat != nil { - objectMap["properties"] = ia.IPAllocationPropertiesFormat - } - if ia.ID != nil { - objectMap["id"] = ia.ID - } - if ia.Location != nil { - objectMap["location"] = ia.Location - } - if ia.Tags != nil { - objectMap["tags"] = ia.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPAllocation struct. -func (ia *IPAllocation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPAllocationPropertiesFormat IPAllocationPropertiesFormat - err = json.Unmarshal(*v, &IPAllocationPropertiesFormat) - if err != nil { - return err - } - ia.IPAllocationPropertiesFormat = &IPAllocationPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ia.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ia.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ia.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ia.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ia.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ia.Tags = tags - } - } - } - - return nil -} - -// IPAllocationListResult response for the ListIpAllocations API service call. -type IPAllocationListResult struct { - autorest.Response `json:"-"` - // Value - A list of IpAllocation resources. - Value *[]IPAllocation `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// IPAllocationListResultIterator provides access to a complete listing of IPAllocation values. -type IPAllocationListResultIterator struct { - i int - page IPAllocationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *IPAllocationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *IPAllocationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IPAllocationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter IPAllocationListResultIterator) Response() IPAllocationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IPAllocationListResultIterator) Value() IPAllocation { - if !iter.page.NotDone() { - return IPAllocation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the IPAllocationListResultIterator type. -func NewIPAllocationListResultIterator(page IPAllocationListResultPage) IPAllocationListResultIterator { - return IPAllocationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ialr IPAllocationListResult) IsEmpty() bool { - return ialr.Value == nil || len(*ialr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ialr IPAllocationListResult) hasNextLink() bool { - return ialr.NextLink != nil && len(*ialr.NextLink) != 0 -} - -// iPAllocationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ialr IPAllocationListResult) iPAllocationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ialr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ialr.NextLink))) -} - -// IPAllocationListResultPage contains a page of IPAllocation values. -type IPAllocationListResultPage struct { - fn func(context.Context, IPAllocationListResult) (IPAllocationListResult, error) - ialr IPAllocationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *IPAllocationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ialr) - if err != nil { - return err - } - page.ialr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *IPAllocationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IPAllocationListResultPage) NotDone() bool { - return !page.ialr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IPAllocationListResultPage) Response() IPAllocationListResult { - return page.ialr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IPAllocationListResultPage) Values() []IPAllocation { - if page.ialr.IsEmpty() { - return nil - } - return *page.ialr.Value -} - -// Creates a new instance of the IPAllocationListResultPage type. -func NewIPAllocationListResultPage(cur IPAllocationListResult, getNextPage func(context.Context, IPAllocationListResult) (IPAllocationListResult, error)) IPAllocationListResultPage { - return IPAllocationListResultPage{ - fn: getNextPage, - ialr: cur, - } -} - -// IPAllocationPropertiesFormat properties of the IpAllocation. -type IPAllocationPropertiesFormat struct { - // Subnet - READ-ONLY; The Subnet that using the prefix of this IpAllocation resource. - Subnet *SubResource `json:"subnet,omitempty"` - // VirtualNetwork - READ-ONLY; The VirtualNetwork that using the prefix of this IpAllocation resource. - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` - // Type - The type for the IpAllocation. Possible values include: 'Undefined', 'Hypernet' - Type IPAllocationType `json:"type,omitempty"` - // Prefix - The address prefix for the IpAllocation. - Prefix *string `json:"prefix,omitempty"` - // PrefixLength - The address prefix length for the IpAllocation. - PrefixLength *int32 `json:"prefixLength,omitempty"` - // PrefixType - The address prefix Type for the IpAllocation. Possible values include: 'IPv4', 'IPv6' - PrefixType IPVersion `json:"prefixType,omitempty"` - // IpamAllocationID - The IPAM allocation ID. - IpamAllocationID *string `json:"ipamAllocationId,omitempty"` - // AllocationTags - IpAllocation tags. - AllocationTags map[string]*string `json:"allocationTags"` -} - -// MarshalJSON is the custom marshaler for IPAllocationPropertiesFormat. -func (iapf IPAllocationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iapf.Type != "" { - objectMap["type"] = iapf.Type - } - if iapf.Prefix != nil { - objectMap["prefix"] = iapf.Prefix - } - if iapf.PrefixLength != nil { - objectMap["prefixLength"] = iapf.PrefixLength - } - if iapf.PrefixType != "" { - objectMap["prefixType"] = iapf.PrefixType - } - if iapf.IpamAllocationID != nil { - objectMap["ipamAllocationId"] = iapf.IpamAllocationID - } - if iapf.AllocationTags != nil { - objectMap["allocationTags"] = iapf.AllocationTags - } - return json.Marshal(objectMap) -} - -// IPAllocationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type IPAllocationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IPAllocationsClient) (IPAllocation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IPAllocationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IPAllocationsCreateOrUpdateFuture.Result. -func (future *IPAllocationsCreateOrUpdateFuture) result(client IPAllocationsClient) (ia IPAllocation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ia.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.IPAllocationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ia.Response.Response, err = future.GetResult(sender); err == nil && ia.Response.Response.StatusCode != http.StatusNoContent { - ia, err = client.CreateOrUpdateResponder(ia.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsCreateOrUpdateFuture", "Result", ia.Response.Response, "Failure responding to request") - } - } - return -} - -// IPAllocationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IPAllocationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IPAllocationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IPAllocationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IPAllocationsDeleteFuture.Result. -func (future *IPAllocationsDeleteFuture) result(client IPAllocationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPAllocationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.IPAllocationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// IPConfiguration IP configuration. -type IPConfiguration struct { - // IPConfigurationPropertiesFormat - Properties of the IP configuration. - *IPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfiguration. -func (ic IPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ic.IPConfigurationPropertiesFormat != nil { - objectMap["properties"] = ic.IPConfigurationPropertiesFormat - } - if ic.Name != nil { - objectMap["name"] = ic.Name - } - if ic.ID != nil { - objectMap["id"] = ic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPConfiguration struct. -func (ic *IPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat) - if err != nil { - return err - } - ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ic.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ic.ID = &ID - } - } - } - - return nil -} - -// IPConfigurationBgpPeeringAddress properties of IPConfigurationBgpPeeringAddress. -type IPConfigurationBgpPeeringAddress struct { - // IpconfigurationID - The ID of IP configuration which belongs to gateway. - IpconfigurationID *string `json:"ipconfigurationId,omitempty"` - // DefaultBgpIPAddresses - READ-ONLY; The list of default BGP peering addresses which belong to IP configuration. - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - // CustomBgpIPAddresses - The list of custom BGP peering addresses which belong to IP configuration. - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - // TunnelIPAddresses - READ-ONLY; The list of tunnel public IP addresses which belong to IP configuration. - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfigurationBgpPeeringAddress. -func (icbpa IPConfigurationBgpPeeringAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icbpa.IpconfigurationID != nil { - objectMap["ipconfigurationId"] = icbpa.IpconfigurationID - } - if icbpa.CustomBgpIPAddresses != nil { - objectMap["customBgpIpAddresses"] = icbpa.CustomBgpIPAddresses - } - return json.Marshal(objectMap) -} - -// IPConfigurationProfile IP configuration profile child resource. -type IPConfigurationProfile struct { - // IPConfigurationProfilePropertiesFormat - Properties of the IP configuration profile. - *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Sub Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfigurationProfile. -func (icp IPConfigurationProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icp.IPConfigurationProfilePropertiesFormat != nil { - objectMap["properties"] = icp.IPConfigurationProfilePropertiesFormat - } - if icp.Name != nil { - objectMap["name"] = icp.Name - } - if icp.ID != nil { - objectMap["id"] = icp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPConfigurationProfile struct. -func (icp *IPConfigurationProfile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPConfigurationProfilePropertiesFormat IPConfigurationProfilePropertiesFormat - err = json.Unmarshal(*v, &IPConfigurationProfilePropertiesFormat) - if err != nil { - return err - } - icp.IPConfigurationProfilePropertiesFormat = &IPConfigurationProfilePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - icp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - icp.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - icp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - icp.ID = &ID - } - } - } - - return nil -} - -// IPConfigurationProfilePropertiesFormat IP configuration profile properties. -type IPConfigurationProfilePropertiesFormat struct { - // Subnet - The reference to the subnet resource to create a container network interface ip configuration. - Subnet *Subnet `json:"subnet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration profile resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfigurationProfilePropertiesFormat. -func (icppf IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icppf.Subnet != nil { - objectMap["subnet"] = icppf.Subnet - } - return json.Marshal(objectMap) -} - -// IPConfigurationPropertiesFormat properties of IP configuration. -type IPConfigurationPropertiesFormat struct { - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - // PublicIPAddress - The reference to the public IP resource. - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPConfigurationPropertiesFormat. -func (icpf IPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = icpf.PrivateIPAddress - } - if icpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = icpf.PrivateIPAllocationMethod - } - if icpf.Subnet != nil { - objectMap["subnet"] = icpf.Subnet - } - if icpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = icpf.PublicIPAddress - } - return json.Marshal(objectMap) -} - -// IPGroup the IpGroups resource information. -type IPGroup struct { - autorest.Response `json:"-"` - // IPGroupPropertiesFormat - Properties of the IpGroups. - *IPGroupPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for IPGroup. -func (ig IPGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ig.IPGroupPropertiesFormat != nil { - objectMap["properties"] = ig.IPGroupPropertiesFormat - } - if ig.ID != nil { - objectMap["id"] = ig.ID - } - if ig.Location != nil { - objectMap["location"] = ig.Location - } - if ig.Tags != nil { - objectMap["tags"] = ig.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IPGroup struct. -func (ig *IPGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var IPGroupPropertiesFormat IPGroupPropertiesFormat - err = json.Unmarshal(*v, &IPGroupPropertiesFormat) - if err != nil { - return err - } - ig.IPGroupPropertiesFormat = &IPGroupPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ig.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ig.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ig.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ig.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ig.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ig.Tags = tags - } - } - } - - return nil -} - -// IPGroupListResult response for the ListIpGroups API service call. -type IPGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of IpGroups information resources. - Value *[]IPGroup `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// IPGroupListResultIterator provides access to a complete listing of IPGroup values. -type IPGroupListResultIterator struct { - i int - page IPGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *IPGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *IPGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IPGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter IPGroupListResultIterator) Response() IPGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter IPGroupListResultIterator) Value() IPGroup { - if !iter.page.NotDone() { - return IPGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the IPGroupListResultIterator type. -func NewIPGroupListResultIterator(page IPGroupListResultPage) IPGroupListResultIterator { - return IPGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (iglr IPGroupListResult) IsEmpty() bool { - return iglr.Value == nil || len(*iglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (iglr IPGroupListResult) hasNextLink() bool { - return iglr.NextLink != nil && len(*iglr.NextLink) != 0 -} - -// iPGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (iglr IPGroupListResult) iPGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !iglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(iglr.NextLink))) -} - -// IPGroupListResultPage contains a page of IPGroup values. -type IPGroupListResultPage struct { - fn func(context.Context, IPGroupListResult) (IPGroupListResult, error) - iglr IPGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *IPGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.iglr) - if err != nil { - return err - } - page.iglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *IPGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IPGroupListResultPage) NotDone() bool { - return !page.iglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IPGroupListResultPage) Response() IPGroupListResult { - return page.iglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IPGroupListResultPage) Values() []IPGroup { - if page.iglr.IsEmpty() { - return nil - } - return *page.iglr.Value -} - -// Creates a new instance of the IPGroupListResultPage type. -func NewIPGroupListResultPage(cur IPGroupListResult, getNextPage func(context.Context, IPGroupListResult) (IPGroupListResult, error)) IPGroupListResultPage { - return IPGroupListResultPage{ - fn: getNextPage, - iglr: cur, - } -} - -// IPGroupPropertiesFormat the IpGroups property information. -type IPGroupPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the IpGroups resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // IPAddresses - IpAddresses/IpAddressPrefixes in the IpGroups resource. - IPAddresses *[]string `json:"ipAddresses,omitempty"` - // Firewalls - READ-ONLY; List of references to Firewall resources that this IpGroups is associated with. - Firewalls *[]SubResource `json:"firewalls,omitempty"` - // FirewallPolicies - READ-ONLY; List of references to Firewall Policies resources that this IpGroups is associated with. - FirewallPolicies *[]SubResource `json:"firewallPolicies,omitempty"` -} - -// MarshalJSON is the custom marshaler for IPGroupPropertiesFormat. -func (igpf IPGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if igpf.IPAddresses != nil { - objectMap["ipAddresses"] = igpf.IPAddresses - } - return json.Marshal(objectMap) -} - -// IPGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IPGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IPGroupsClient) (IPGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IPGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IPGroupsCreateOrUpdateFuture.Result. -func (future *IPGroupsCreateOrUpdateFuture) result(client IPGroupsClient) (ig IPGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ig.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.IPGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ig.Response.Response, err = future.GetResult(sender); err == nil && ig.Response.Response.StatusCode != http.StatusNoContent { - ig, err = client.CreateOrUpdateResponder(ig.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsCreateOrUpdateFuture", "Result", ig.Response.Response, "Failure responding to request") - } - } - return -} - -// IPGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type IPGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(IPGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *IPGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for IPGroupsDeleteFuture.Result. -func (future *IPGroupsDeleteFuture) result(client IPGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.IPGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.IPGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// IPPrefixesList list of SNAT IP Prefixes learnt by firewall to not SNAT -type IPPrefixesList struct { - autorest.Response `json:"-"` - // IPPrefixes - IP Prefix value. - IPPrefixes *[]string `json:"ipPrefixes,omitempty"` -} - -// IpsecPolicy an IPSec Policy configuration for a virtual network gateway connection. -type IpsecPolicy struct { - // SaLifeTimeSeconds - The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. - SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` - // SaDataSizeKilobytes - The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. - SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` - // IpsecEncryption - The IPSec encryption algorithm (IKE phase 1). Possible values include: 'IpsecEncryptionNone', 'IpsecEncryptionDES', 'IpsecEncryptionDES3', 'IpsecEncryptionAES128', 'IpsecEncryptionAES192', 'IpsecEncryptionAES256', 'IpsecEncryptionGCMAES128', 'IpsecEncryptionGCMAES192', 'IpsecEncryptionGCMAES256' - IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` - // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' - IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` - // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` - // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' - IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` - // DhGroup - The DH Group used in IKE Phase 1 for initial SA. Possible values include: 'DhGroupNone', 'DhGroupDHGroup1', 'DhGroupDHGroup2', 'DhGroupDHGroup14', 'DhGroupDHGroup2048', 'DhGroupECP256', 'DhGroupECP384', 'DhGroupDHGroup24' - DhGroup DhGroup `json:"dhGroup,omitempty"` - // PfsGroup - The Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'PfsGroupNone', 'PfsGroupPFS1', 'PfsGroupPFS2', 'PfsGroupPFS2048', 'PfsGroupECP256', 'PfsGroupECP384', 'PfsGroupPFS24', 'PfsGroupPFS14', 'PfsGroupPFSMM' - PfsGroup PfsGroup `json:"pfsGroup,omitempty"` -} - -// IPTag contains the IpTag associated with the object. -type IPTag struct { - // IPTagType - The IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - // Tag - The value of the IP tag associated with the public IP. Example: SQL. - Tag *string `json:"tag,omitempty"` -} - -// Ipv6CircuitConnectionConfig iPv6 Circuit Connection properties for global reach. -type Ipv6CircuitConnectionConfig struct { - // AddressPrefix - /125 IP address space to carve out customer addresses for global reach. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // CircuitConnectionStatus - READ-ONLY; Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' - CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for Ipv6CircuitConnectionConfig. -func (i6ccc Ipv6CircuitConnectionConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i6ccc.AddressPrefix != nil { - objectMap["addressPrefix"] = i6ccc.AddressPrefix - } - return json.Marshal(objectMap) -} - -// Ipv6ExpressRouteCircuitPeeringConfig contains IPv6 peering config. -type Ipv6ExpressRouteCircuitPeeringConfig struct { - // PrimaryPeerAddressPrefix - The primary address prefix. - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - // SecondaryPeerAddressPrefix - The secondary address prefix. - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - // MicrosoftPeeringConfig - The Microsoft peering configuration. - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - // RouteFilter - The reference to the RouteFilter resource. - RouteFilter *SubResource `json:"routeFilter,omitempty"` - // State - The state of peering. Possible values include: 'ExpressRouteCircuitPeeringStateDisabled', 'ExpressRouteCircuitPeeringStateEnabled' - State ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} - -// ListHubRouteTablesResult list of RouteTables and a URL nextLink to get the next set of results. -type ListHubRouteTablesResult struct { - autorest.Response `json:"-"` - // Value - List of RouteTables. - Value *[]HubRouteTable `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListHubRouteTablesResultIterator provides access to a complete listing of HubRouteTable values. -type ListHubRouteTablesResultIterator struct { - i int - page ListHubRouteTablesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListHubRouteTablesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListHubRouteTablesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListHubRouteTablesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListHubRouteTablesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListHubRouteTablesResultIterator) Response() ListHubRouteTablesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListHubRouteTablesResultIterator) Value() HubRouteTable { - if !iter.page.NotDone() { - return HubRouteTable{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListHubRouteTablesResultIterator type. -func NewListHubRouteTablesResultIterator(page ListHubRouteTablesResultPage) ListHubRouteTablesResultIterator { - return ListHubRouteTablesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lhrtr ListHubRouteTablesResult) IsEmpty() bool { - return lhrtr.Value == nil || len(*lhrtr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lhrtr ListHubRouteTablesResult) hasNextLink() bool { - return lhrtr.NextLink != nil && len(*lhrtr.NextLink) != 0 -} - -// listHubRouteTablesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lhrtr ListHubRouteTablesResult) listHubRouteTablesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lhrtr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lhrtr.NextLink))) -} - -// ListHubRouteTablesResultPage contains a page of HubRouteTable values. -type ListHubRouteTablesResultPage struct { - fn func(context.Context, ListHubRouteTablesResult) (ListHubRouteTablesResult, error) - lhrtr ListHubRouteTablesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListHubRouteTablesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListHubRouteTablesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lhrtr) - if err != nil { - return err - } - page.lhrtr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListHubRouteTablesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListHubRouteTablesResultPage) NotDone() bool { - return !page.lhrtr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListHubRouteTablesResultPage) Response() ListHubRouteTablesResult { - return page.lhrtr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListHubRouteTablesResultPage) Values() []HubRouteTable { - if page.lhrtr.IsEmpty() { - return nil - } - return *page.lhrtr.Value -} - -// Creates a new instance of the ListHubRouteTablesResultPage type. -func NewListHubRouteTablesResultPage(cur ListHubRouteTablesResult, getNextPage func(context.Context, ListHubRouteTablesResult) (ListHubRouteTablesResult, error)) ListHubRouteTablesResultPage { - return ListHubRouteTablesResultPage{ - fn: getNextPage, - lhrtr: cur, - } -} - -// ListHubVirtualNetworkConnectionsResult list of HubVirtualNetworkConnections and a URL nextLink to get -// the next set of results. -type ListHubVirtualNetworkConnectionsResult struct { - autorest.Response `json:"-"` - // Value - List of HubVirtualNetworkConnections. - Value *[]HubVirtualNetworkConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListHubVirtualNetworkConnectionsResultIterator provides access to a complete listing of -// HubVirtualNetworkConnection values. -type ListHubVirtualNetworkConnectionsResultIterator struct { - i int - page ListHubVirtualNetworkConnectionsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListHubVirtualNetworkConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListHubVirtualNetworkConnectionsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListHubVirtualNetworkConnectionsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListHubVirtualNetworkConnectionsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListHubVirtualNetworkConnectionsResultIterator) Response() ListHubVirtualNetworkConnectionsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListHubVirtualNetworkConnectionsResultIterator) Value() HubVirtualNetworkConnection { - if !iter.page.NotDone() { - return HubVirtualNetworkConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListHubVirtualNetworkConnectionsResultIterator type. -func NewListHubVirtualNetworkConnectionsResultIterator(page ListHubVirtualNetworkConnectionsResultPage) ListHubVirtualNetworkConnectionsResultIterator { - return ListHubVirtualNetworkConnectionsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lhvncr ListHubVirtualNetworkConnectionsResult) IsEmpty() bool { - return lhvncr.Value == nil || len(*lhvncr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lhvncr ListHubVirtualNetworkConnectionsResult) hasNextLink() bool { - return lhvncr.NextLink != nil && len(*lhvncr.NextLink) != 0 -} - -// listHubVirtualNetworkConnectionsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lhvncr ListHubVirtualNetworkConnectionsResult) listHubVirtualNetworkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lhvncr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lhvncr.NextLink))) -} - -// ListHubVirtualNetworkConnectionsResultPage contains a page of HubVirtualNetworkConnection values. -type ListHubVirtualNetworkConnectionsResultPage struct { - fn func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error) - lhvncr ListHubVirtualNetworkConnectionsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListHubVirtualNetworkConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListHubVirtualNetworkConnectionsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lhvncr) - if err != nil { - return err - } - page.lhvncr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListHubVirtualNetworkConnectionsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListHubVirtualNetworkConnectionsResultPage) NotDone() bool { - return !page.lhvncr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListHubVirtualNetworkConnectionsResultPage) Response() ListHubVirtualNetworkConnectionsResult { - return page.lhvncr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListHubVirtualNetworkConnectionsResultPage) Values() []HubVirtualNetworkConnection { - if page.lhvncr.IsEmpty() { - return nil - } - return *page.lhvncr.Value -} - -// Creates a new instance of the ListHubVirtualNetworkConnectionsResultPage type. -func NewListHubVirtualNetworkConnectionsResultPage(cur ListHubVirtualNetworkConnectionsResult, getNextPage func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error)) ListHubVirtualNetworkConnectionsResultPage { - return ListHubVirtualNetworkConnectionsResultPage{ - fn: getNextPage, - lhvncr: cur, - } -} - -// ListP2SVpnGatewaysResult result of the request to list P2SVpnGateways. It contains a list of -// P2SVpnGateways and a URL nextLink to get the next set of results. -type ListP2SVpnGatewaysResult struct { - autorest.Response `json:"-"` - // Value - List of P2SVpnGateways. - Value *[]P2SVpnGateway `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListP2SVpnGatewaysResultIterator provides access to a complete listing of P2SVpnGateway values. -type ListP2SVpnGatewaysResultIterator struct { - i int - page ListP2SVpnGatewaysResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListP2SVpnGatewaysResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListP2SVpnGatewaysResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListP2SVpnGatewaysResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListP2SVpnGatewaysResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListP2SVpnGatewaysResultIterator) Response() ListP2SVpnGatewaysResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListP2SVpnGatewaysResultIterator) Value() P2SVpnGateway { - if !iter.page.NotDone() { - return P2SVpnGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListP2SVpnGatewaysResultIterator type. -func NewListP2SVpnGatewaysResultIterator(page ListP2SVpnGatewaysResultPage) ListP2SVpnGatewaysResultIterator { - return ListP2SVpnGatewaysResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lpvgr ListP2SVpnGatewaysResult) IsEmpty() bool { - return lpvgr.Value == nil || len(*lpvgr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lpvgr ListP2SVpnGatewaysResult) hasNextLink() bool { - return lpvgr.NextLink != nil && len(*lpvgr.NextLink) != 0 -} - -// listP2SVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lpvgr ListP2SVpnGatewaysResult) listP2SVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { - if !lpvgr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lpvgr.NextLink))) -} - -// ListP2SVpnGatewaysResultPage contains a page of P2SVpnGateway values. -type ListP2SVpnGatewaysResultPage struct { - fn func(context.Context, ListP2SVpnGatewaysResult) (ListP2SVpnGatewaysResult, error) - lpvgr ListP2SVpnGatewaysResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListP2SVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListP2SVpnGatewaysResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lpvgr) - if err != nil { - return err - } - page.lpvgr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListP2SVpnGatewaysResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListP2SVpnGatewaysResultPage) NotDone() bool { - return !page.lpvgr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListP2SVpnGatewaysResultPage) Response() ListP2SVpnGatewaysResult { - return page.lpvgr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListP2SVpnGatewaysResultPage) Values() []P2SVpnGateway { - if page.lpvgr.IsEmpty() { - return nil - } - return *page.lpvgr.Value -} - -// Creates a new instance of the ListP2SVpnGatewaysResultPage type. -func NewListP2SVpnGatewaysResultPage(cur ListP2SVpnGatewaysResult, getNextPage func(context.Context, ListP2SVpnGatewaysResult) (ListP2SVpnGatewaysResult, error)) ListP2SVpnGatewaysResultPage { - return ListP2SVpnGatewaysResultPage{ - fn: getNextPage, - lpvgr: cur, - } -} - -// ListRouteMapsResult list of RouteMaps and a URL nextLink to get the next set of results. -type ListRouteMapsResult struct { - autorest.Response `json:"-"` - // Value - List of RouteMaps. - Value *[]RouteMap `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListRouteMapsResultIterator provides access to a complete listing of RouteMap values. -type ListRouteMapsResultIterator struct { - i int - page ListRouteMapsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListRouteMapsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListRouteMapsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListRouteMapsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListRouteMapsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListRouteMapsResultIterator) Response() ListRouteMapsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListRouteMapsResultIterator) Value() RouteMap { - if !iter.page.NotDone() { - return RouteMap{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListRouteMapsResultIterator type. -func NewListRouteMapsResultIterator(page ListRouteMapsResultPage) ListRouteMapsResultIterator { - return ListRouteMapsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lrmr ListRouteMapsResult) IsEmpty() bool { - return lrmr.Value == nil || len(*lrmr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lrmr ListRouteMapsResult) hasNextLink() bool { - return lrmr.NextLink != nil && len(*lrmr.NextLink) != 0 -} - -// listRouteMapsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lrmr ListRouteMapsResult) listRouteMapsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lrmr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lrmr.NextLink))) -} - -// ListRouteMapsResultPage contains a page of RouteMap values. -type ListRouteMapsResultPage struct { - fn func(context.Context, ListRouteMapsResult) (ListRouteMapsResult, error) - lrmr ListRouteMapsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListRouteMapsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListRouteMapsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lrmr) - if err != nil { - return err - } - page.lrmr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListRouteMapsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListRouteMapsResultPage) NotDone() bool { - return !page.lrmr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListRouteMapsResultPage) Response() ListRouteMapsResult { - return page.lrmr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListRouteMapsResultPage) Values() []RouteMap { - if page.lrmr.IsEmpty() { - return nil - } - return *page.lrmr.Value -} - -// Creates a new instance of the ListRouteMapsResultPage type. -func NewListRouteMapsResultPage(cur ListRouteMapsResult, getNextPage func(context.Context, ListRouteMapsResult) (ListRouteMapsResult, error)) ListRouteMapsResultPage { - return ListRouteMapsResultPage{ - fn: getNextPage, - lrmr: cur, - } -} - -// ListRoutingIntentResult list of the routing intent result and a URL nextLink to get the next set of -// results. -type ListRoutingIntentResult struct { - autorest.Response `json:"-"` - // Value - List of RoutingIntent resource. - Value *[]RoutingIntent `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListRoutingIntentResultIterator provides access to a complete listing of RoutingIntent values. -type ListRoutingIntentResultIterator struct { - i int - page ListRoutingIntentResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListRoutingIntentResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListRoutingIntentResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListRoutingIntentResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListRoutingIntentResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListRoutingIntentResultIterator) Response() ListRoutingIntentResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListRoutingIntentResultIterator) Value() RoutingIntent { - if !iter.page.NotDone() { - return RoutingIntent{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListRoutingIntentResultIterator type. -func NewListRoutingIntentResultIterator(page ListRoutingIntentResultPage) ListRoutingIntentResultIterator { - return ListRoutingIntentResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lrir ListRoutingIntentResult) IsEmpty() bool { - return lrir.Value == nil || len(*lrir.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lrir ListRoutingIntentResult) hasNextLink() bool { - return lrir.NextLink != nil && len(*lrir.NextLink) != 0 -} - -// listRoutingIntentResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lrir ListRoutingIntentResult) listRoutingIntentResultPreparer(ctx context.Context) (*http.Request, error) { - if !lrir.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lrir.NextLink))) -} - -// ListRoutingIntentResultPage contains a page of RoutingIntent values. -type ListRoutingIntentResultPage struct { - fn func(context.Context, ListRoutingIntentResult) (ListRoutingIntentResult, error) - lrir ListRoutingIntentResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListRoutingIntentResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListRoutingIntentResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lrir) - if err != nil { - return err - } - page.lrir = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListRoutingIntentResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListRoutingIntentResultPage) NotDone() bool { - return !page.lrir.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListRoutingIntentResultPage) Response() ListRoutingIntentResult { - return page.lrir -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListRoutingIntentResultPage) Values() []RoutingIntent { - if page.lrir.IsEmpty() { - return nil - } - return *page.lrir.Value -} - -// Creates a new instance of the ListRoutingIntentResultPage type. -func NewListRoutingIntentResultPage(cur ListRoutingIntentResult, getNextPage func(context.Context, ListRoutingIntentResult) (ListRoutingIntentResult, error)) ListRoutingIntentResultPage { - return ListRoutingIntentResultPage{ - fn: getNextPage, - lrir: cur, - } -} - -// ListString ... -type ListString struct { - autorest.Response `json:"-"` - Value *[]string `json:"value,omitempty"` -} - -// ListVirtualHubBgpConnectionResults virtualHubBgpConnections list. -type ListVirtualHubBgpConnectionResults struct { - autorest.Response `json:"-"` - // Value - The list of VirtualHubBgpConnections. - Value *[]BgpConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualHubBgpConnectionResultsIterator provides access to a complete listing of BgpConnection -// values. -type ListVirtualHubBgpConnectionResultsIterator struct { - i int - page ListVirtualHubBgpConnectionResultsPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubBgpConnectionResultsIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubBgpConnectionResultsIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubBgpConnectionResultsIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubBgpConnectionResultsIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualHubBgpConnectionResultsIterator) Response() ListVirtualHubBgpConnectionResults { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubBgpConnectionResultsIterator) Value() BgpConnection { - if !iter.page.NotDone() { - return BgpConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualHubBgpConnectionResultsIterator type. -func NewListVirtualHubBgpConnectionResultsIterator(page ListVirtualHubBgpConnectionResultsPage) ListVirtualHubBgpConnectionResultsIterator { - return ListVirtualHubBgpConnectionResultsIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvhbcr ListVirtualHubBgpConnectionResults) IsEmpty() bool { - return lvhbcr.Value == nil || len(*lvhbcr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvhbcr ListVirtualHubBgpConnectionResults) hasNextLink() bool { - return lvhbcr.NextLink != nil && len(*lvhbcr.NextLink) != 0 -} - -// listVirtualHubBgpConnectionResultsPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvhbcr ListVirtualHubBgpConnectionResults) listVirtualHubBgpConnectionResultsPreparer(ctx context.Context) (*http.Request, error) { - if !lvhbcr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhbcr.NextLink))) -} - -// ListVirtualHubBgpConnectionResultsPage contains a page of BgpConnection values. -type ListVirtualHubBgpConnectionResultsPage struct { - fn func(context.Context, ListVirtualHubBgpConnectionResults) (ListVirtualHubBgpConnectionResults, error) - lvhbcr ListVirtualHubBgpConnectionResults -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualHubBgpConnectionResultsPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubBgpConnectionResultsPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvhbcr) - if err != nil { - return err - } - page.lvhbcr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubBgpConnectionResultsPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubBgpConnectionResultsPage) NotDone() bool { - return !page.lvhbcr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualHubBgpConnectionResultsPage) Response() ListVirtualHubBgpConnectionResults { - return page.lvhbcr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubBgpConnectionResultsPage) Values() []BgpConnection { - if page.lvhbcr.IsEmpty() { - return nil - } - return *page.lvhbcr.Value -} - -// Creates a new instance of the ListVirtualHubBgpConnectionResultsPage type. -func NewListVirtualHubBgpConnectionResultsPage(cur ListVirtualHubBgpConnectionResults, getNextPage func(context.Context, ListVirtualHubBgpConnectionResults) (ListVirtualHubBgpConnectionResults, error)) ListVirtualHubBgpConnectionResultsPage { - return ListVirtualHubBgpConnectionResultsPage{ - fn: getNextPage, - lvhbcr: cur, - } -} - -// ListVirtualHubIPConfigurationResults virtualHubIpConfigurations list. -type ListVirtualHubIPConfigurationResults struct { - autorest.Response `json:"-"` - // Value - The list of VirtualHubIpConfigurations. - Value *[]HubIPConfiguration `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualHubIPConfigurationResultsIterator provides access to a complete listing of HubIPConfiguration -// values. -type ListVirtualHubIPConfigurationResultsIterator struct { - i int - page ListVirtualHubIPConfigurationResultsPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubIPConfigurationResultsIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubIPConfigurationResultsIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubIPConfigurationResultsIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubIPConfigurationResultsIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualHubIPConfigurationResultsIterator) Response() ListVirtualHubIPConfigurationResults { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubIPConfigurationResultsIterator) Value() HubIPConfiguration { - if !iter.page.NotDone() { - return HubIPConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualHubIPConfigurationResultsIterator type. -func NewListVirtualHubIPConfigurationResultsIterator(page ListVirtualHubIPConfigurationResultsPage) ListVirtualHubIPConfigurationResultsIterator { - return ListVirtualHubIPConfigurationResultsIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvhicr ListVirtualHubIPConfigurationResults) IsEmpty() bool { - return lvhicr.Value == nil || len(*lvhicr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvhicr ListVirtualHubIPConfigurationResults) hasNextLink() bool { - return lvhicr.NextLink != nil && len(*lvhicr.NextLink) != 0 -} - -// listVirtualHubIPConfigurationResultsPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvhicr ListVirtualHubIPConfigurationResults) listVirtualHubIPConfigurationResultsPreparer(ctx context.Context) (*http.Request, error) { - if !lvhicr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhicr.NextLink))) -} - -// ListVirtualHubIPConfigurationResultsPage contains a page of HubIPConfiguration values. -type ListVirtualHubIPConfigurationResultsPage struct { - fn func(context.Context, ListVirtualHubIPConfigurationResults) (ListVirtualHubIPConfigurationResults, error) - lvhicr ListVirtualHubIPConfigurationResults -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualHubIPConfigurationResultsPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubIPConfigurationResultsPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvhicr) - if err != nil { - return err - } - page.lvhicr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubIPConfigurationResultsPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubIPConfigurationResultsPage) NotDone() bool { - return !page.lvhicr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualHubIPConfigurationResultsPage) Response() ListVirtualHubIPConfigurationResults { - return page.lvhicr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubIPConfigurationResultsPage) Values() []HubIPConfiguration { - if page.lvhicr.IsEmpty() { - return nil - } - return *page.lvhicr.Value -} - -// Creates a new instance of the ListVirtualHubIPConfigurationResultsPage type. -func NewListVirtualHubIPConfigurationResultsPage(cur ListVirtualHubIPConfigurationResults, getNextPage func(context.Context, ListVirtualHubIPConfigurationResults) (ListVirtualHubIPConfigurationResults, error)) ListVirtualHubIPConfigurationResultsPage { - return ListVirtualHubIPConfigurationResultsPage{ - fn: getNextPage, - lvhicr: cur, - } -} - -// ListVirtualHubRouteTableV2sResult list of VirtualHubRouteTableV2s and a URL nextLink to get the next set -// of results. -type ListVirtualHubRouteTableV2sResult struct { - autorest.Response `json:"-"` - // Value - List of VirtualHubRouteTableV2s. - Value *[]VirtualHubRouteTableV2 `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualHubRouteTableV2sResultIterator provides access to a complete listing of -// VirtualHubRouteTableV2 values. -type ListVirtualHubRouteTableV2sResultIterator struct { - i int - page ListVirtualHubRouteTableV2sResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubRouteTableV2sResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubRouteTableV2sResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubRouteTableV2sResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubRouteTableV2sResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualHubRouteTableV2sResultIterator) Response() ListVirtualHubRouteTableV2sResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubRouteTableV2sResultIterator) Value() VirtualHubRouteTableV2 { - if !iter.page.NotDone() { - return VirtualHubRouteTableV2{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualHubRouteTableV2sResultIterator type. -func NewListVirtualHubRouteTableV2sResultIterator(page ListVirtualHubRouteTableV2sResultPage) ListVirtualHubRouteTableV2sResultIterator { - return ListVirtualHubRouteTableV2sResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvhrtvr ListVirtualHubRouteTableV2sResult) IsEmpty() bool { - return lvhrtvr.Value == nil || len(*lvhrtvr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvhrtvr ListVirtualHubRouteTableV2sResult) hasNextLink() bool { - return lvhrtvr.NextLink != nil && len(*lvhrtvr.NextLink) != 0 -} - -// listVirtualHubRouteTableV2sResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvhrtvr ListVirtualHubRouteTableV2sResult) listVirtualHubRouteTableV2sResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvhrtvr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhrtvr.NextLink))) -} - -// ListVirtualHubRouteTableV2sResultPage contains a page of VirtualHubRouteTableV2 values. -type ListVirtualHubRouteTableV2sResultPage struct { - fn func(context.Context, ListVirtualHubRouteTableV2sResult) (ListVirtualHubRouteTableV2sResult, error) - lvhrtvr ListVirtualHubRouteTableV2sResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualHubRouteTableV2sResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubRouteTableV2sResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvhrtvr) - if err != nil { - return err - } - page.lvhrtvr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubRouteTableV2sResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubRouteTableV2sResultPage) NotDone() bool { - return !page.lvhrtvr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualHubRouteTableV2sResultPage) Response() ListVirtualHubRouteTableV2sResult { - return page.lvhrtvr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubRouteTableV2sResultPage) Values() []VirtualHubRouteTableV2 { - if page.lvhrtvr.IsEmpty() { - return nil - } - return *page.lvhrtvr.Value -} - -// Creates a new instance of the ListVirtualHubRouteTableV2sResultPage type. -func NewListVirtualHubRouteTableV2sResultPage(cur ListVirtualHubRouteTableV2sResult, getNextPage func(context.Context, ListVirtualHubRouteTableV2sResult) (ListVirtualHubRouteTableV2sResult, error)) ListVirtualHubRouteTableV2sResultPage { - return ListVirtualHubRouteTableV2sResultPage{ - fn: getNextPage, - lvhrtvr: cur, - } -} - -// ListVirtualHubsResult result of the request to list VirtualHubs. It contains a list of VirtualHubs and a -// URL nextLink to get the next set of results. -type ListVirtualHubsResult struct { - autorest.Response `json:"-"` - // Value - List of VirtualHubs. - Value *[]VirtualHub `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualHubsResultIterator provides access to a complete listing of VirtualHub values. -type ListVirtualHubsResultIterator struct { - i int - page ListVirtualHubsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualHubsResultIterator) Response() ListVirtualHubsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubsResultIterator) Value() VirtualHub { - if !iter.page.NotDone() { - return VirtualHub{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualHubsResultIterator type. -func NewListVirtualHubsResultIterator(page ListVirtualHubsResultPage) ListVirtualHubsResultIterator { - return ListVirtualHubsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvhr ListVirtualHubsResult) IsEmpty() bool { - return lvhr.Value == nil || len(*lvhr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvhr ListVirtualHubsResult) hasNextLink() bool { - return lvhr.NextLink != nil && len(*lvhr.NextLink) != 0 -} - -// listVirtualHubsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvhr ListVirtualHubsResult) listVirtualHubsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvhr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhr.NextLink))) -} - -// ListVirtualHubsResultPage contains a page of VirtualHub values. -type ListVirtualHubsResultPage struct { - fn func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error) - lvhr ListVirtualHubsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualHubsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvhr) - if err != nil { - return err - } - page.lvhr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubsResultPage) NotDone() bool { - return !page.lvhr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualHubsResultPage) Response() ListVirtualHubsResult { - return page.lvhr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubsResultPage) Values() []VirtualHub { - if page.lvhr.IsEmpty() { - return nil - } - return *page.lvhr.Value -} - -// Creates a new instance of the ListVirtualHubsResultPage type. -func NewListVirtualHubsResultPage(cur ListVirtualHubsResult, getNextPage func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error)) ListVirtualHubsResultPage { - return ListVirtualHubsResultPage{ - fn: getNextPage, - lvhr: cur, - } -} - -// ListVirtualNetworkGatewayNatRulesResult result of the request to list all nat rules to a virtual network -// gateway. It contains a list of Nat rules and a URL nextLink to get the next set of results. -type ListVirtualNetworkGatewayNatRulesResult struct { - autorest.Response `json:"-"` - // Value - List of Nat Rules. - Value *[]VirtualNetworkGatewayNatRule `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualNetworkGatewayNatRulesResultIterator provides access to a complete listing of -// VirtualNetworkGatewayNatRule values. -type ListVirtualNetworkGatewayNatRulesResultIterator struct { - i int - page ListVirtualNetworkGatewayNatRulesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualNetworkGatewayNatRulesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualNetworkGatewayNatRulesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualNetworkGatewayNatRulesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualNetworkGatewayNatRulesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualNetworkGatewayNatRulesResultIterator) Response() ListVirtualNetworkGatewayNatRulesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualNetworkGatewayNatRulesResultIterator) Value() VirtualNetworkGatewayNatRule { - if !iter.page.NotDone() { - return VirtualNetworkGatewayNatRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualNetworkGatewayNatRulesResultIterator type. -func NewListVirtualNetworkGatewayNatRulesResultIterator(page ListVirtualNetworkGatewayNatRulesResultPage) ListVirtualNetworkGatewayNatRulesResultIterator { - return ListVirtualNetworkGatewayNatRulesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvngnrr ListVirtualNetworkGatewayNatRulesResult) IsEmpty() bool { - return lvngnrr.Value == nil || len(*lvngnrr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvngnrr ListVirtualNetworkGatewayNatRulesResult) hasNextLink() bool { - return lvngnrr.NextLink != nil && len(*lvngnrr.NextLink) != 0 -} - -// listVirtualNetworkGatewayNatRulesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvngnrr ListVirtualNetworkGatewayNatRulesResult) listVirtualNetworkGatewayNatRulesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvngnrr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvngnrr.NextLink))) -} - -// ListVirtualNetworkGatewayNatRulesResultPage contains a page of VirtualNetworkGatewayNatRule values. -type ListVirtualNetworkGatewayNatRulesResultPage struct { - fn func(context.Context, ListVirtualNetworkGatewayNatRulesResult) (ListVirtualNetworkGatewayNatRulesResult, error) - lvngnrr ListVirtualNetworkGatewayNatRulesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualNetworkGatewayNatRulesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualNetworkGatewayNatRulesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvngnrr) - if err != nil { - return err - } - page.lvngnrr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualNetworkGatewayNatRulesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualNetworkGatewayNatRulesResultPage) NotDone() bool { - return !page.lvngnrr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualNetworkGatewayNatRulesResultPage) Response() ListVirtualNetworkGatewayNatRulesResult { - return page.lvngnrr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualNetworkGatewayNatRulesResultPage) Values() []VirtualNetworkGatewayNatRule { - if page.lvngnrr.IsEmpty() { - return nil - } - return *page.lvngnrr.Value -} - -// Creates a new instance of the ListVirtualNetworkGatewayNatRulesResultPage type. -func NewListVirtualNetworkGatewayNatRulesResultPage(cur ListVirtualNetworkGatewayNatRulesResult, getNextPage func(context.Context, ListVirtualNetworkGatewayNatRulesResult) (ListVirtualNetworkGatewayNatRulesResult, error)) ListVirtualNetworkGatewayNatRulesResultPage { - return ListVirtualNetworkGatewayNatRulesResultPage{ - fn: getNextPage, - lvngnrr: cur, - } -} - -// ListVirtualWANsResult result of the request to list VirtualWANs. It contains a list of VirtualWANs and a -// URL nextLink to get the next set of results. -type ListVirtualWANsResult struct { - autorest.Response `json:"-"` - // Value - List of VirtualWANs. - Value *[]VirtualWAN `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVirtualWANsResultIterator provides access to a complete listing of VirtualWAN values. -type ListVirtualWANsResultIterator struct { - i int - page ListVirtualWANsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVirtualWANsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualWANsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualWANsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualWANsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVirtualWANsResultIterator) Response() ListVirtualWANsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVirtualWANsResultIterator) Value() VirtualWAN { - if !iter.page.NotDone() { - return VirtualWAN{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVirtualWANsResultIterator type. -func NewListVirtualWANsResultIterator(page ListVirtualWANsResultPage) ListVirtualWANsResultIterator { - return ListVirtualWANsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvwnr ListVirtualWANsResult) IsEmpty() bool { - return lvwnr.Value == nil || len(*lvwnr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvwnr ListVirtualWANsResult) hasNextLink() bool { - return lvwnr.NextLink != nil && len(*lvwnr.NextLink) != 0 -} - -// listVirtualWANsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvwnr ListVirtualWANsResult) listVirtualWANsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvwnr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvwnr.NextLink))) -} - -// ListVirtualWANsResultPage contains a page of VirtualWAN values. -type ListVirtualWANsResultPage struct { - fn func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error) - lvwnr ListVirtualWANsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVirtualWANsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualWANsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvwnr) - if err != nil { - return err - } - page.lvwnr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVirtualWANsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualWANsResultPage) NotDone() bool { - return !page.lvwnr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVirtualWANsResultPage) Response() ListVirtualWANsResult { - return page.lvwnr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualWANsResultPage) Values() []VirtualWAN { - if page.lvwnr.IsEmpty() { - return nil - } - return *page.lvwnr.Value -} - -// Creates a new instance of the ListVirtualWANsResultPage type. -func NewListVirtualWANsResultPage(cur ListVirtualWANsResult, getNextPage func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error)) ListVirtualWANsResultPage { - return ListVirtualWANsResultPage{ - fn: getNextPage, - lvwnr: cur, - } -} - -// ListVpnConnectionsResult result of the request to list all vpn connections to a virtual wan vpn gateway. -// It contains a list of Vpn Connections and a URL nextLink to get the next set of results. -type ListVpnConnectionsResult struct { - autorest.Response `json:"-"` - // Value - List of Vpn Connections. - Value *[]VpnConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnConnectionsResultIterator provides access to a complete listing of VpnConnection values. -type ListVpnConnectionsResultIterator struct { - i int - page ListVpnConnectionsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnConnectionsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnConnectionsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnConnectionsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnConnectionsResultIterator) Response() ListVpnConnectionsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnConnectionsResultIterator) Value() VpnConnection { - if !iter.page.NotDone() { - return VpnConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnConnectionsResultIterator type. -func NewListVpnConnectionsResultIterator(page ListVpnConnectionsResultPage) ListVpnConnectionsResultIterator { - return ListVpnConnectionsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvcr ListVpnConnectionsResult) IsEmpty() bool { - return lvcr.Value == nil || len(*lvcr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvcr ListVpnConnectionsResult) hasNextLink() bool { - return lvcr.NextLink != nil && len(*lvcr.NextLink) != 0 -} - -// listVpnConnectionsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvcr ListVpnConnectionsResult) listVpnConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvcr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvcr.NextLink))) -} - -// ListVpnConnectionsResultPage contains a page of VpnConnection values. -type ListVpnConnectionsResultPage struct { - fn func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error) - lvcr ListVpnConnectionsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnConnectionsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvcr) - if err != nil { - return err - } - page.lvcr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnConnectionsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnConnectionsResultPage) NotDone() bool { - return !page.lvcr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnConnectionsResultPage) Response() ListVpnConnectionsResult { - return page.lvcr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnConnectionsResultPage) Values() []VpnConnection { - if page.lvcr.IsEmpty() { - return nil - } - return *page.lvcr.Value -} - -// Creates a new instance of the ListVpnConnectionsResultPage type. -func NewListVpnConnectionsResultPage(cur ListVpnConnectionsResult, getNextPage func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error)) ListVpnConnectionsResultPage { - return ListVpnConnectionsResultPage{ - fn: getNextPage, - lvcr: cur, - } -} - -// ListVpnGatewayNatRulesResult result of the request to list all nat rules to a virtual wan vpn gateway. -// It contains a list of Nat rules and a URL nextLink to get the next set of results. -type ListVpnGatewayNatRulesResult struct { - autorest.Response `json:"-"` - // Value - List of Nat Rules. - Value *[]VpnGatewayNatRule `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnGatewayNatRulesResultIterator provides access to a complete listing of VpnGatewayNatRule values. -type ListVpnGatewayNatRulesResultIterator struct { - i int - page ListVpnGatewayNatRulesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnGatewayNatRulesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewayNatRulesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnGatewayNatRulesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnGatewayNatRulesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnGatewayNatRulesResultIterator) Response() ListVpnGatewayNatRulesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnGatewayNatRulesResultIterator) Value() VpnGatewayNatRule { - if !iter.page.NotDone() { - return VpnGatewayNatRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnGatewayNatRulesResultIterator type. -func NewListVpnGatewayNatRulesResultIterator(page ListVpnGatewayNatRulesResultPage) ListVpnGatewayNatRulesResultIterator { - return ListVpnGatewayNatRulesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvgnrr ListVpnGatewayNatRulesResult) IsEmpty() bool { - return lvgnrr.Value == nil || len(*lvgnrr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvgnrr ListVpnGatewayNatRulesResult) hasNextLink() bool { - return lvgnrr.NextLink != nil && len(*lvgnrr.NextLink) != 0 -} - -// listVpnGatewayNatRulesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvgnrr ListVpnGatewayNatRulesResult) listVpnGatewayNatRulesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvgnrr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvgnrr.NextLink))) -} - -// ListVpnGatewayNatRulesResultPage contains a page of VpnGatewayNatRule values. -type ListVpnGatewayNatRulesResultPage struct { - fn func(context.Context, ListVpnGatewayNatRulesResult) (ListVpnGatewayNatRulesResult, error) - lvgnrr ListVpnGatewayNatRulesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnGatewayNatRulesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewayNatRulesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvgnrr) - if err != nil { - return err - } - page.lvgnrr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnGatewayNatRulesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnGatewayNatRulesResultPage) NotDone() bool { - return !page.lvgnrr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnGatewayNatRulesResultPage) Response() ListVpnGatewayNatRulesResult { - return page.lvgnrr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnGatewayNatRulesResultPage) Values() []VpnGatewayNatRule { - if page.lvgnrr.IsEmpty() { - return nil - } - return *page.lvgnrr.Value -} - -// Creates a new instance of the ListVpnGatewayNatRulesResultPage type. -func NewListVpnGatewayNatRulesResultPage(cur ListVpnGatewayNatRulesResult, getNextPage func(context.Context, ListVpnGatewayNatRulesResult) (ListVpnGatewayNatRulesResult, error)) ListVpnGatewayNatRulesResultPage { - return ListVpnGatewayNatRulesResultPage{ - fn: getNextPage, - lvgnrr: cur, - } -} - -// ListVpnGatewaysResult result of the request to list VpnGateways. It contains a list of VpnGateways and a -// URL nextLink to get the next set of results. -type ListVpnGatewaysResult struct { - autorest.Response `json:"-"` - // Value - List of VpnGateways. - Value *[]VpnGateway `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnGatewaysResultIterator provides access to a complete listing of VpnGateway values. -type ListVpnGatewaysResultIterator struct { - i int - page ListVpnGatewaysResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnGatewaysResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewaysResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnGatewaysResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnGatewaysResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnGatewaysResultIterator) Response() ListVpnGatewaysResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnGatewaysResultIterator) Value() VpnGateway { - if !iter.page.NotDone() { - return VpnGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnGatewaysResultIterator type. -func NewListVpnGatewaysResultIterator(page ListVpnGatewaysResultPage) ListVpnGatewaysResultIterator { - return ListVpnGatewaysResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvgr ListVpnGatewaysResult) IsEmpty() bool { - return lvgr.Value == nil || len(*lvgr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvgr ListVpnGatewaysResult) hasNextLink() bool { - return lvgr.NextLink != nil && len(*lvgr.NextLink) != 0 -} - -// listVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvgr ListVpnGatewaysResult) listVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvgr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvgr.NextLink))) -} - -// ListVpnGatewaysResultPage contains a page of VpnGateway values. -type ListVpnGatewaysResultPage struct { - fn func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error) - lvgr ListVpnGatewaysResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewaysResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvgr) - if err != nil { - return err - } - page.lvgr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnGatewaysResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnGatewaysResultPage) NotDone() bool { - return !page.lvgr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnGatewaysResultPage) Response() ListVpnGatewaysResult { - return page.lvgr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnGatewaysResultPage) Values() []VpnGateway { - if page.lvgr.IsEmpty() { - return nil - } - return *page.lvgr.Value -} - -// Creates a new instance of the ListVpnGatewaysResultPage type. -func NewListVpnGatewaysResultPage(cur ListVpnGatewaysResult, getNextPage func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error)) ListVpnGatewaysResultPage { - return ListVpnGatewaysResultPage{ - fn: getNextPage, - lvgr: cur, - } -} - -// ListVpnServerConfigurationPolicyGroupsResult result of the request to list -// VpnServerConfigurationPolicyGroups. It contains a list of VpnServerConfigurationPolicyGroups and a URL -// nextLink to get the next set of results. -type ListVpnServerConfigurationPolicyGroupsResult struct { - autorest.Response `json:"-"` - // Value - List of VpnServerConfigurationPolicyGroups. - Value *[]VpnServerConfigurationPolicyGroup `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnServerConfigurationPolicyGroupsResultIterator provides access to a complete listing of -// VpnServerConfigurationPolicyGroup values. -type ListVpnServerConfigurationPolicyGroupsResultIterator struct { - i int - page ListVpnServerConfigurationPolicyGroupsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnServerConfigurationPolicyGroupsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationPolicyGroupsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnServerConfigurationPolicyGroupsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnServerConfigurationPolicyGroupsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnServerConfigurationPolicyGroupsResultIterator) Response() ListVpnServerConfigurationPolicyGroupsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnServerConfigurationPolicyGroupsResultIterator) Value() VpnServerConfigurationPolicyGroup { - if !iter.page.NotDone() { - return VpnServerConfigurationPolicyGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnServerConfigurationPolicyGroupsResultIterator type. -func NewListVpnServerConfigurationPolicyGroupsResultIterator(page ListVpnServerConfigurationPolicyGroupsResultPage) ListVpnServerConfigurationPolicyGroupsResultIterator { - return ListVpnServerConfigurationPolicyGroupsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvscpgr ListVpnServerConfigurationPolicyGroupsResult) IsEmpty() bool { - return lvscpgr.Value == nil || len(*lvscpgr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvscpgr ListVpnServerConfigurationPolicyGroupsResult) hasNextLink() bool { - return lvscpgr.NextLink != nil && len(*lvscpgr.NextLink) != 0 -} - -// listVpnServerConfigurationPolicyGroupsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvscpgr ListVpnServerConfigurationPolicyGroupsResult) listVpnServerConfigurationPolicyGroupsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvscpgr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvscpgr.NextLink))) -} - -// ListVpnServerConfigurationPolicyGroupsResultPage contains a page of VpnServerConfigurationPolicyGroup -// values. -type ListVpnServerConfigurationPolicyGroupsResultPage struct { - fn func(context.Context, ListVpnServerConfigurationPolicyGroupsResult) (ListVpnServerConfigurationPolicyGroupsResult, error) - lvscpgr ListVpnServerConfigurationPolicyGroupsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnServerConfigurationPolicyGroupsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationPolicyGroupsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvscpgr) - if err != nil { - return err - } - page.lvscpgr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnServerConfigurationPolicyGroupsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnServerConfigurationPolicyGroupsResultPage) NotDone() bool { - return !page.lvscpgr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnServerConfigurationPolicyGroupsResultPage) Response() ListVpnServerConfigurationPolicyGroupsResult { - return page.lvscpgr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnServerConfigurationPolicyGroupsResultPage) Values() []VpnServerConfigurationPolicyGroup { - if page.lvscpgr.IsEmpty() { - return nil - } - return *page.lvscpgr.Value -} - -// Creates a new instance of the ListVpnServerConfigurationPolicyGroupsResultPage type. -func NewListVpnServerConfigurationPolicyGroupsResultPage(cur ListVpnServerConfigurationPolicyGroupsResult, getNextPage func(context.Context, ListVpnServerConfigurationPolicyGroupsResult) (ListVpnServerConfigurationPolicyGroupsResult, error)) ListVpnServerConfigurationPolicyGroupsResultPage { - return ListVpnServerConfigurationPolicyGroupsResultPage{ - fn: getNextPage, - lvscpgr: cur, - } -} - -// ListVpnServerConfigurationsResult result of the request to list all VpnServerConfigurations. It contains -// a list of VpnServerConfigurations and a URL nextLink to get the next set of results. -type ListVpnServerConfigurationsResult struct { - autorest.Response `json:"-"` - // Value - List of VpnServerConfigurations. - Value *[]VpnServerConfiguration `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnServerConfigurationsResultIterator provides access to a complete listing of -// VpnServerConfiguration values. -type ListVpnServerConfigurationsResultIterator struct { - i int - page ListVpnServerConfigurationsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnServerConfigurationsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnServerConfigurationsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnServerConfigurationsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnServerConfigurationsResultIterator) Response() ListVpnServerConfigurationsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnServerConfigurationsResultIterator) Value() VpnServerConfiguration { - if !iter.page.NotDone() { - return VpnServerConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnServerConfigurationsResultIterator type. -func NewListVpnServerConfigurationsResultIterator(page ListVpnServerConfigurationsResultPage) ListVpnServerConfigurationsResultIterator { - return ListVpnServerConfigurationsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvscr ListVpnServerConfigurationsResult) IsEmpty() bool { - return lvscr.Value == nil || len(*lvscr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvscr ListVpnServerConfigurationsResult) hasNextLink() bool { - return lvscr.NextLink != nil && len(*lvscr.NextLink) != 0 -} - -// listVpnServerConfigurationsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvscr ListVpnServerConfigurationsResult) listVpnServerConfigurationsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvscr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvscr.NextLink))) -} - -// ListVpnServerConfigurationsResultPage contains a page of VpnServerConfiguration values. -type ListVpnServerConfigurationsResultPage struct { - fn func(context.Context, ListVpnServerConfigurationsResult) (ListVpnServerConfigurationsResult, error) - lvscr ListVpnServerConfigurationsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnServerConfigurationsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvscr) - if err != nil { - return err - } - page.lvscr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnServerConfigurationsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnServerConfigurationsResultPage) NotDone() bool { - return !page.lvscr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnServerConfigurationsResultPage) Response() ListVpnServerConfigurationsResult { - return page.lvscr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnServerConfigurationsResultPage) Values() []VpnServerConfiguration { - if page.lvscr.IsEmpty() { - return nil - } - return *page.lvscr.Value -} - -// Creates a new instance of the ListVpnServerConfigurationsResultPage type. -func NewListVpnServerConfigurationsResultPage(cur ListVpnServerConfigurationsResult, getNextPage func(context.Context, ListVpnServerConfigurationsResult) (ListVpnServerConfigurationsResult, error)) ListVpnServerConfigurationsResultPage { - return ListVpnServerConfigurationsResultPage{ - fn: getNextPage, - lvscr: cur, - } -} - -// ListVpnSiteLinkConnectionsResult result of the request to list all vpn connections to a virtual wan vpn -// gateway. It contains a list of Vpn Connections and a URL nextLink to get the next set of results. -type ListVpnSiteLinkConnectionsResult struct { - autorest.Response `json:"-"` - // Value - List of VpnSiteLinkConnections. - Value *[]VpnSiteLinkConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnSiteLinkConnectionsResultIterator provides access to a complete listing of VpnSiteLinkConnection -// values. -type ListVpnSiteLinkConnectionsResultIterator struct { - i int - page ListVpnSiteLinkConnectionsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnSiteLinkConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinkConnectionsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnSiteLinkConnectionsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnSiteLinkConnectionsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnSiteLinkConnectionsResultIterator) Response() ListVpnSiteLinkConnectionsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnSiteLinkConnectionsResultIterator) Value() VpnSiteLinkConnection { - if !iter.page.NotDone() { - return VpnSiteLinkConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnSiteLinkConnectionsResultIterator type. -func NewListVpnSiteLinkConnectionsResultIterator(page ListVpnSiteLinkConnectionsResultPage) ListVpnSiteLinkConnectionsResultIterator { - return ListVpnSiteLinkConnectionsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvslcr ListVpnSiteLinkConnectionsResult) IsEmpty() bool { - return lvslcr.Value == nil || len(*lvslcr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvslcr ListVpnSiteLinkConnectionsResult) hasNextLink() bool { - return lvslcr.NextLink != nil && len(*lvslcr.NextLink) != 0 -} - -// listVpnSiteLinkConnectionsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvslcr ListVpnSiteLinkConnectionsResult) listVpnSiteLinkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvslcr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvslcr.NextLink))) -} - -// ListVpnSiteLinkConnectionsResultPage contains a page of VpnSiteLinkConnection values. -type ListVpnSiteLinkConnectionsResultPage struct { - fn func(context.Context, ListVpnSiteLinkConnectionsResult) (ListVpnSiteLinkConnectionsResult, error) - lvslcr ListVpnSiteLinkConnectionsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnSiteLinkConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinkConnectionsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvslcr) - if err != nil { - return err - } - page.lvslcr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnSiteLinkConnectionsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnSiteLinkConnectionsResultPage) NotDone() bool { - return !page.lvslcr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnSiteLinkConnectionsResultPage) Response() ListVpnSiteLinkConnectionsResult { - return page.lvslcr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnSiteLinkConnectionsResultPage) Values() []VpnSiteLinkConnection { - if page.lvslcr.IsEmpty() { - return nil - } - return *page.lvslcr.Value -} - -// Creates a new instance of the ListVpnSiteLinkConnectionsResultPage type. -func NewListVpnSiteLinkConnectionsResultPage(cur ListVpnSiteLinkConnectionsResult, getNextPage func(context.Context, ListVpnSiteLinkConnectionsResult) (ListVpnSiteLinkConnectionsResult, error)) ListVpnSiteLinkConnectionsResultPage { - return ListVpnSiteLinkConnectionsResultPage{ - fn: getNextPage, - lvslcr: cur, - } -} - -// ListVpnSiteLinksResult result of the request to list VpnSiteLinks. It contains a list of VpnSiteLinks -// and a URL nextLink to get the next set of results. -type ListVpnSiteLinksResult struct { - autorest.Response `json:"-"` - // Value - List of VpnSitesLinks. - Value *[]VpnSiteLink `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnSiteLinksResultIterator provides access to a complete listing of VpnSiteLink values. -type ListVpnSiteLinksResultIterator struct { - i int - page ListVpnSiteLinksResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnSiteLinksResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinksResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnSiteLinksResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnSiteLinksResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnSiteLinksResultIterator) Response() ListVpnSiteLinksResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnSiteLinksResultIterator) Value() VpnSiteLink { - if !iter.page.NotDone() { - return VpnSiteLink{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnSiteLinksResultIterator type. -func NewListVpnSiteLinksResultIterator(page ListVpnSiteLinksResultPage) ListVpnSiteLinksResultIterator { - return ListVpnSiteLinksResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvslr ListVpnSiteLinksResult) IsEmpty() bool { - return lvslr.Value == nil || len(*lvslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvslr ListVpnSiteLinksResult) hasNextLink() bool { - return lvslr.NextLink != nil && len(*lvslr.NextLink) != 0 -} - -// listVpnSiteLinksResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvslr ListVpnSiteLinksResult) listVpnSiteLinksResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvslr.NextLink))) -} - -// ListVpnSiteLinksResultPage contains a page of VpnSiteLink values. -type ListVpnSiteLinksResultPage struct { - fn func(context.Context, ListVpnSiteLinksResult) (ListVpnSiteLinksResult, error) - lvslr ListVpnSiteLinksResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnSiteLinksResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinksResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvslr) - if err != nil { - return err - } - page.lvslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnSiteLinksResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnSiteLinksResultPage) NotDone() bool { - return !page.lvslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnSiteLinksResultPage) Response() ListVpnSiteLinksResult { - return page.lvslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnSiteLinksResultPage) Values() []VpnSiteLink { - if page.lvslr.IsEmpty() { - return nil - } - return *page.lvslr.Value -} - -// Creates a new instance of the ListVpnSiteLinksResultPage type. -func NewListVpnSiteLinksResultPage(cur ListVpnSiteLinksResult, getNextPage func(context.Context, ListVpnSiteLinksResult) (ListVpnSiteLinksResult, error)) ListVpnSiteLinksResultPage { - return ListVpnSiteLinksResultPage{ - fn: getNextPage, - lvslr: cur, - } -} - -// ListVpnSitesResult result of the request to list VpnSites. It contains a list of VpnSites and a URL -// nextLink to get the next set of results. -type ListVpnSitesResult struct { - autorest.Response `json:"-"` - // Value - List of VpnSites. - Value *[]VpnSite `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListVpnSitesResultIterator provides access to a complete listing of VpnSite values. -type ListVpnSitesResultIterator struct { - i int - page ListVpnSitesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListVpnSitesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSitesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListVpnSitesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVpnSitesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListVpnSitesResultIterator) Response() ListVpnSitesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListVpnSitesResultIterator) Value() VpnSite { - if !iter.page.NotDone() { - return VpnSite{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListVpnSitesResultIterator type. -func NewListVpnSitesResultIterator(page ListVpnSitesResultPage) ListVpnSitesResultIterator { - return ListVpnSitesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lvsr ListVpnSitesResult) IsEmpty() bool { - return lvsr.Value == nil || len(*lvsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lvsr ListVpnSitesResult) hasNextLink() bool { - return lvsr.NextLink != nil && len(*lvsr.NextLink) != 0 -} - -// listVpnSitesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lvsr ListVpnSitesResult) listVpnSitesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lvsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lvsr.NextLink))) -} - -// ListVpnSitesResultPage contains a page of VpnSite values. -type ListVpnSitesResultPage struct { - fn func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error) - lvsr ListVpnSitesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListVpnSitesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSitesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lvsr) - if err != nil { - return err - } - page.lvsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListVpnSitesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVpnSitesResultPage) NotDone() bool { - return !page.lvsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListVpnSitesResultPage) Response() ListVpnSitesResult { - return page.lvsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListVpnSitesResultPage) Values() []VpnSite { - if page.lvsr.IsEmpty() { - return nil - } - return *page.lvsr.Value -} - -// Creates a new instance of the ListVpnSitesResultPage type. -func NewListVpnSitesResultPage(cur ListVpnSitesResult, getNextPage func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error)) ListVpnSitesResultPage { - return ListVpnSitesResultPage{ - fn: getNextPage, - lvsr: cur, - } -} - -// LoadBalancer loadBalancer resource. -type LoadBalancer struct { - autorest.Response `json:"-"` - // ExtendedLocation - The extended location of the load balancer. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // Sku - The load balancer SKU. - Sku *LoadBalancerSku `json:"sku,omitempty"` - // LoadBalancerPropertiesFormat - Properties of load balancer. - *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for LoadBalancer. -func (lb LoadBalancer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lb.ExtendedLocation != nil { - objectMap["extendedLocation"] = lb.ExtendedLocation - } - if lb.Sku != nil { - objectMap["sku"] = lb.Sku - } - if lb.LoadBalancerPropertiesFormat != nil { - objectMap["properties"] = lb.LoadBalancerPropertiesFormat - } - if lb.ID != nil { - objectMap["id"] = lb.ID - } - if lb.Location != nil { - objectMap["location"] = lb.Location - } - if lb.Tags != nil { - objectMap["tags"] = lb.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct. -func (lb *LoadBalancer) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - lb.ExtendedLocation = &extendedLocation - } - case "sku": - if v != nil { - var sku LoadBalancerSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - lb.Sku = &sku - } - case "properties": - if v != nil { - var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat - err = json.Unmarshal(*v, &loadBalancerPropertiesFormat) - if err != nil { - return err - } - lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - lb.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lb.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lb.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lb.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - lb.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - lb.Tags = tags - } - } - } - - return nil -} - -// LoadBalancerBackendAddress load balancer backend addresses. -type LoadBalancerBackendAddress struct { - // LoadBalancerBackendAddressPropertiesFormat - Properties of load balancer backend address pool. - *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend address. - Name *string `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerBackendAddress. -func (lbba LoadBalancerBackendAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbba.LoadBalancerBackendAddressPropertiesFormat != nil { - objectMap["properties"] = lbba.LoadBalancerBackendAddressPropertiesFormat - } - if lbba.Name != nil { - objectMap["name"] = lbba.Name - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LoadBalancerBackendAddress struct. -func (lbba *LoadBalancerBackendAddress) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var loadBalancerBackendAddressPropertiesFormat LoadBalancerBackendAddressPropertiesFormat - err = json.Unmarshal(*v, &loadBalancerBackendAddressPropertiesFormat) - if err != nil { - return err - } - lbba.LoadBalancerBackendAddressPropertiesFormat = &loadBalancerBackendAddressPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lbba.Name = &name - } - } - } - - return nil -} - -// LoadBalancerBackendAddressPoolListResult response for ListBackendAddressPool API service call. -type LoadBalancerBackendAddressPoolListResult struct { - autorest.Response `json:"-"` - // Value - A list of backend address pools in a load balancer. - Value *[]BackendAddressPool `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerBackendAddressPoolListResult. -func (lbbaplr LoadBalancerBackendAddressPoolListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbbaplr.Value != nil { - objectMap["value"] = lbbaplr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerBackendAddressPoolListResultIterator provides access to a complete listing of -// BackendAddressPool values. -type LoadBalancerBackendAddressPoolListResultIterator struct { - i int - page LoadBalancerBackendAddressPoolListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerBackendAddressPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerBackendAddressPoolListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerBackendAddressPoolListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerBackendAddressPoolListResultIterator) Response() LoadBalancerBackendAddressPoolListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerBackendAddressPoolListResultIterator) Value() BackendAddressPool { - if !iter.page.NotDone() { - return BackendAddressPool{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerBackendAddressPoolListResultIterator type. -func NewLoadBalancerBackendAddressPoolListResultIterator(page LoadBalancerBackendAddressPoolListResultPage) LoadBalancerBackendAddressPoolListResultIterator { - return LoadBalancerBackendAddressPoolListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lbbaplr LoadBalancerBackendAddressPoolListResult) IsEmpty() bool { - return lbbaplr.Value == nil || len(*lbbaplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lbbaplr LoadBalancerBackendAddressPoolListResult) hasNextLink() bool { - return lbbaplr.NextLink != nil && len(*lbbaplr.NextLink) != 0 -} - -// loadBalancerBackendAddressPoolListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lbbaplr LoadBalancerBackendAddressPoolListResult) loadBalancerBackendAddressPoolListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lbbaplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lbbaplr.NextLink))) -} - -// LoadBalancerBackendAddressPoolListResultPage contains a page of BackendAddressPool values. -type LoadBalancerBackendAddressPoolListResultPage struct { - fn func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error) - lbbaplr LoadBalancerBackendAddressPoolListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerBackendAddressPoolListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lbbaplr) - if err != nil { - return err - } - page.lbbaplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerBackendAddressPoolListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerBackendAddressPoolListResultPage) NotDone() bool { - return !page.lbbaplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerBackendAddressPoolListResultPage) Response() LoadBalancerBackendAddressPoolListResult { - return page.lbbaplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerBackendAddressPoolListResultPage) Values() []BackendAddressPool { - if page.lbbaplr.IsEmpty() { - return nil - } - return *page.lbbaplr.Value -} - -// Creates a new instance of the LoadBalancerBackendAddressPoolListResultPage type. -func NewLoadBalancerBackendAddressPoolListResultPage(cur LoadBalancerBackendAddressPoolListResult, getNextPage func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error)) LoadBalancerBackendAddressPoolListResultPage { - return LoadBalancerBackendAddressPoolListResultPage{ - fn: getNextPage, - lbbaplr: cur, - } -} - -// LoadBalancerBackendAddressPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type LoadBalancerBackendAddressPoolsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancerBackendAddressPoolsClient) (BackendAddressPool, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancerBackendAddressPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancerBackendAddressPoolsCreateOrUpdateFuture.Result. -func (future *LoadBalancerBackendAddressPoolsCreateOrUpdateFuture) result(client LoadBalancerBackendAddressPoolsClient) (bap BackendAddressPool, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bap.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bap.Response.Response, err = future.GetResult(sender); err == nil && bap.Response.Response.StatusCode != http.StatusNoContent { - bap, err = client.CreateOrUpdateResponder(bap.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture", "Result", bap.Response.Response, "Failure responding to request") - } - } - return -} - -// LoadBalancerBackendAddressPoolsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type LoadBalancerBackendAddressPoolsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancerBackendAddressPoolsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancerBackendAddressPoolsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancerBackendAddressPoolsDeleteFuture.Result. -func (future *LoadBalancerBackendAddressPoolsDeleteFuture) result(client LoadBalancerBackendAddressPoolsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancerBackendAddressPoolsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LoadBalancerBackendAddressPropertiesFormat properties of the load balancer backend addresses. -type LoadBalancerBackendAddressPropertiesFormat struct { - // VirtualNetwork - Reference to an existing virtual network. - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` - // Subnet - Reference to an existing subnet. - Subnet *SubResource `json:"subnet,omitempty"` - // IPAddress - IP Address belonging to the referenced virtual network. - IPAddress *string `json:"ipAddress,omitempty"` - // NetworkInterfaceIPConfiguration - READ-ONLY; Reference to IP address defined in network interfaces. - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - // LoadBalancerFrontendIPConfiguration - Reference to the frontend ip address configuration defined in regional loadbalancer. - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - // InboundNatRulesPortMapping - READ-ONLY; Collection of inbound NAT rule port mappings. - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - // AdminState - A list of administrative states which once set can override health probe so that Load Balancer will always forward new connections to backend, or deny new connections and reset existing connections. Possible values include: 'LoadBalancerBackendAddressAdminStateNone', 'LoadBalancerBackendAddressAdminStateUp', 'LoadBalancerBackendAddressAdminStateDown', 'LoadBalancerBackendAddressAdminStateDrain' - AdminState LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerBackendAddressPropertiesFormat. -func (lbbapf LoadBalancerBackendAddressPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbbapf.VirtualNetwork != nil { - objectMap["virtualNetwork"] = lbbapf.VirtualNetwork - } - if lbbapf.Subnet != nil { - objectMap["subnet"] = lbbapf.Subnet - } - if lbbapf.IPAddress != nil { - objectMap["ipAddress"] = lbbapf.IPAddress - } - if lbbapf.LoadBalancerFrontendIPConfiguration != nil { - objectMap["loadBalancerFrontendIPConfiguration"] = lbbapf.LoadBalancerFrontendIPConfiguration - } - if lbbapf.AdminState != "" { - objectMap["adminState"] = lbbapf.AdminState - } - return json.Marshal(objectMap) -} - -// LoadBalancerFrontendIPConfigurationListResult response for ListFrontendIPConfiguration API service call. -type LoadBalancerFrontendIPConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - A list of frontend IP configurations in a load balancer. - Value *[]FrontendIPConfiguration `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerFrontendIPConfigurationListResult. -func (lbficlr LoadBalancerFrontendIPConfigurationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbficlr.Value != nil { - objectMap["value"] = lbficlr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerFrontendIPConfigurationListResultIterator provides access to a complete listing of -// FrontendIPConfiguration values. -type LoadBalancerFrontendIPConfigurationListResultIterator struct { - i int - page LoadBalancerFrontendIPConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerFrontendIPConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerFrontendIPConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerFrontendIPConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerFrontendIPConfigurationListResultIterator) Response() LoadBalancerFrontendIPConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerFrontendIPConfigurationListResultIterator) Value() FrontendIPConfiguration { - if !iter.page.NotDone() { - return FrontendIPConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerFrontendIPConfigurationListResultIterator type. -func NewLoadBalancerFrontendIPConfigurationListResultIterator(page LoadBalancerFrontendIPConfigurationListResultPage) LoadBalancerFrontendIPConfigurationListResultIterator { - return LoadBalancerFrontendIPConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lbficlr LoadBalancerFrontendIPConfigurationListResult) IsEmpty() bool { - return lbficlr.Value == nil || len(*lbficlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lbficlr LoadBalancerFrontendIPConfigurationListResult) hasNextLink() bool { - return lbficlr.NextLink != nil && len(*lbficlr.NextLink) != 0 -} - -// loadBalancerFrontendIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lbficlr LoadBalancerFrontendIPConfigurationListResult) loadBalancerFrontendIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lbficlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lbficlr.NextLink))) -} - -// LoadBalancerFrontendIPConfigurationListResultPage contains a page of FrontendIPConfiguration values. -type LoadBalancerFrontendIPConfigurationListResultPage struct { - fn func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error) - lbficlr LoadBalancerFrontendIPConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerFrontendIPConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lbficlr) - if err != nil { - return err - } - page.lbficlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerFrontendIPConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerFrontendIPConfigurationListResultPage) NotDone() bool { - return !page.lbficlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerFrontendIPConfigurationListResultPage) Response() LoadBalancerFrontendIPConfigurationListResult { - return page.lbficlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerFrontendIPConfigurationListResultPage) Values() []FrontendIPConfiguration { - if page.lbficlr.IsEmpty() { - return nil - } - return *page.lbficlr.Value -} - -// Creates a new instance of the LoadBalancerFrontendIPConfigurationListResultPage type. -func NewLoadBalancerFrontendIPConfigurationListResultPage(cur LoadBalancerFrontendIPConfigurationListResult, getNextPage func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error)) LoadBalancerFrontendIPConfigurationListResultPage { - return LoadBalancerFrontendIPConfigurationListResultPage{ - fn: getNextPage, - lbficlr: cur, - } -} - -// LoadBalancerListResult response for ListLoadBalancers API service call. -type LoadBalancerListResult struct { - autorest.Response `json:"-"` - // Value - A list of load balancers in a resource group. - Value *[]LoadBalancer `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerListResult. -func (lblr LoadBalancerListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lblr.Value != nil { - objectMap["value"] = lblr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. -type LoadBalancerListResultIterator struct { - i int - page LoadBalancerListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerListResultIterator) Response() LoadBalancerListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerListResultIterator) Value() LoadBalancer { - if !iter.page.NotDone() { - return LoadBalancer{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerListResultIterator type. -func NewLoadBalancerListResultIterator(page LoadBalancerListResultPage) LoadBalancerListResultIterator { - return LoadBalancerListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lblr LoadBalancerListResult) IsEmpty() bool { - return lblr.Value == nil || len(*lblr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lblr LoadBalancerListResult) hasNextLink() bool { - return lblr.NextLink != nil && len(*lblr.NextLink) != 0 -} - -// loadBalancerListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lblr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lblr.NextLink))) -} - -// LoadBalancerListResultPage contains a page of LoadBalancer values. -type LoadBalancerListResultPage struct { - fn func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error) - lblr LoadBalancerListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lblr) - if err != nil { - return err - } - page.lblr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerListResultPage) NotDone() bool { - return !page.lblr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerListResultPage) Response() LoadBalancerListResult { - return page.lblr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerListResultPage) Values() []LoadBalancer { - if page.lblr.IsEmpty() { - return nil - } - return *page.lblr.Value -} - -// Creates a new instance of the LoadBalancerListResultPage type. -func NewLoadBalancerListResultPage(cur LoadBalancerListResult, getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage { - return LoadBalancerListResultPage{ - fn: getNextPage, - lblr: cur, - } -} - -// LoadBalancerLoadBalancingRuleListResult response for ListLoadBalancingRule API service call. -type LoadBalancerLoadBalancingRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of load balancing rules in a load balancer. - Value *[]LoadBalancingRule `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerLoadBalancingRuleListResult. -func (lblbrlr LoadBalancerLoadBalancingRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lblbrlr.Value != nil { - objectMap["value"] = lblbrlr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerLoadBalancingRuleListResultIterator provides access to a complete listing of -// LoadBalancingRule values. -type LoadBalancerLoadBalancingRuleListResultIterator struct { - i int - page LoadBalancerLoadBalancingRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerLoadBalancingRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerLoadBalancingRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerLoadBalancingRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerLoadBalancingRuleListResultIterator) Response() LoadBalancerLoadBalancingRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerLoadBalancingRuleListResultIterator) Value() LoadBalancingRule { - if !iter.page.NotDone() { - return LoadBalancingRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerLoadBalancingRuleListResultIterator type. -func NewLoadBalancerLoadBalancingRuleListResultIterator(page LoadBalancerLoadBalancingRuleListResultPage) LoadBalancerLoadBalancingRuleListResultIterator { - return LoadBalancerLoadBalancingRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lblbrlr LoadBalancerLoadBalancingRuleListResult) IsEmpty() bool { - return lblbrlr.Value == nil || len(*lblbrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lblbrlr LoadBalancerLoadBalancingRuleListResult) hasNextLink() bool { - return lblbrlr.NextLink != nil && len(*lblbrlr.NextLink) != 0 -} - -// loadBalancerLoadBalancingRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lblbrlr LoadBalancerLoadBalancingRuleListResult) loadBalancerLoadBalancingRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lblbrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lblbrlr.NextLink))) -} - -// LoadBalancerLoadBalancingRuleListResultPage contains a page of LoadBalancingRule values. -type LoadBalancerLoadBalancingRuleListResultPage struct { - fn func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error) - lblbrlr LoadBalancerLoadBalancingRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerLoadBalancingRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lblbrlr) - if err != nil { - return err - } - page.lblbrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerLoadBalancingRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerLoadBalancingRuleListResultPage) NotDone() bool { - return !page.lblbrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerLoadBalancingRuleListResultPage) Response() LoadBalancerLoadBalancingRuleListResult { - return page.lblbrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerLoadBalancingRuleListResultPage) Values() []LoadBalancingRule { - if page.lblbrlr.IsEmpty() { - return nil - } - return *page.lblbrlr.Value -} - -// Creates a new instance of the LoadBalancerLoadBalancingRuleListResultPage type. -func NewLoadBalancerLoadBalancingRuleListResultPage(cur LoadBalancerLoadBalancingRuleListResult, getNextPage func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error)) LoadBalancerLoadBalancingRuleListResultPage { - return LoadBalancerLoadBalancingRuleListResultPage{ - fn: getNextPage, - lblbrlr: cur, - } -} - -// LoadBalancerOutboundRuleListResult response for ListOutboundRule API service call. -type LoadBalancerOutboundRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of outbound rules in a load balancer. - Value *[]OutboundRule `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerOutboundRuleListResult. -func (lborlr LoadBalancerOutboundRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lborlr.Value != nil { - objectMap["value"] = lborlr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerOutboundRuleListResultIterator provides access to a complete listing of OutboundRule values. -type LoadBalancerOutboundRuleListResultIterator struct { - i int - page LoadBalancerOutboundRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerOutboundRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerOutboundRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerOutboundRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerOutboundRuleListResultIterator) Response() LoadBalancerOutboundRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerOutboundRuleListResultIterator) Value() OutboundRule { - if !iter.page.NotDone() { - return OutboundRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerOutboundRuleListResultIterator type. -func NewLoadBalancerOutboundRuleListResultIterator(page LoadBalancerOutboundRuleListResultPage) LoadBalancerOutboundRuleListResultIterator { - return LoadBalancerOutboundRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lborlr LoadBalancerOutboundRuleListResult) IsEmpty() bool { - return lborlr.Value == nil || len(*lborlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lborlr LoadBalancerOutboundRuleListResult) hasNextLink() bool { - return lborlr.NextLink != nil && len(*lborlr.NextLink) != 0 -} - -// loadBalancerOutboundRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lborlr LoadBalancerOutboundRuleListResult) loadBalancerOutboundRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lborlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lborlr.NextLink))) -} - -// LoadBalancerOutboundRuleListResultPage contains a page of OutboundRule values. -type LoadBalancerOutboundRuleListResultPage struct { - fn func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error) - lborlr LoadBalancerOutboundRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerOutboundRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lborlr) - if err != nil { - return err - } - page.lborlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerOutboundRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerOutboundRuleListResultPage) NotDone() bool { - return !page.lborlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerOutboundRuleListResultPage) Response() LoadBalancerOutboundRuleListResult { - return page.lborlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerOutboundRuleListResultPage) Values() []OutboundRule { - if page.lborlr.IsEmpty() { - return nil - } - return *page.lborlr.Value -} - -// Creates a new instance of the LoadBalancerOutboundRuleListResultPage type. -func NewLoadBalancerOutboundRuleListResultPage(cur LoadBalancerOutboundRuleListResult, getNextPage func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error)) LoadBalancerOutboundRuleListResultPage { - return LoadBalancerOutboundRuleListResultPage{ - fn: getNextPage, - lborlr: cur, - } -} - -// LoadBalancerProbeListResult response for ListProbe API service call. -type LoadBalancerProbeListResult struct { - autorest.Response `json:"-"` - // Value - A list of probes in a load balancer. - Value *[]Probe `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerProbeListResult. -func (lbplr LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbplr.Value != nil { - objectMap["value"] = lbplr.Value - } - return json.Marshal(objectMap) -} - -// LoadBalancerProbeListResultIterator provides access to a complete listing of Probe values. -type LoadBalancerProbeListResultIterator struct { - i int - page LoadBalancerProbeListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerProbeListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerProbeListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerProbeListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerProbeListResultIterator) Response() LoadBalancerProbeListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerProbeListResultIterator) Value() Probe { - if !iter.page.NotDone() { - return Probe{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerProbeListResultIterator type. -func NewLoadBalancerProbeListResultIterator(page LoadBalancerProbeListResultPage) LoadBalancerProbeListResultIterator { - return LoadBalancerProbeListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lbplr LoadBalancerProbeListResult) IsEmpty() bool { - return lbplr.Value == nil || len(*lbplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lbplr LoadBalancerProbeListResult) hasNextLink() bool { - return lbplr.NextLink != nil && len(*lbplr.NextLink) != 0 -} - -// loadBalancerProbeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lbplr LoadBalancerProbeListResult) loadBalancerProbeListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lbplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lbplr.NextLink))) -} - -// LoadBalancerProbeListResultPage contains a page of Probe values. -type LoadBalancerProbeListResultPage struct { - fn func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error) - lbplr LoadBalancerProbeListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lbplr) - if err != nil { - return err - } - page.lbplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerProbeListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerProbeListResultPage) NotDone() bool { - return !page.lbplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerProbeListResultPage) Response() LoadBalancerProbeListResult { - return page.lbplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerProbeListResultPage) Values() []Probe { - if page.lbplr.IsEmpty() { - return nil - } - return *page.lbplr.Value -} - -// Creates a new instance of the LoadBalancerProbeListResultPage type. -func NewLoadBalancerProbeListResultPage(cur LoadBalancerProbeListResult, getNextPage func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)) LoadBalancerProbeListResultPage { - return LoadBalancerProbeListResultPage{ - fn: getNextPage, - lbplr: cur, - } -} - -// LoadBalancerPropertiesFormat properties of the load balancer. -type LoadBalancerPropertiesFormat struct { - // FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer. - FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - // BackendAddressPools - Collection of backend address pools used by a load balancer. - BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` - // LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning. - LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` - // Probes - Collection of probe objects used in the load balancer. - Probes *[]Probe `json:"probes,omitempty"` - // InboundNatRules - Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. - InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` - // InboundNatPools - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. - InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` - // OutboundRules - The outbound rules. - OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the load balancer resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the load balancer resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerPropertiesFormat. -func (lbpf LoadBalancerPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbpf.FrontendIPConfigurations != nil { - objectMap["frontendIPConfigurations"] = lbpf.FrontendIPConfigurations - } - if lbpf.BackendAddressPools != nil { - objectMap["backendAddressPools"] = lbpf.BackendAddressPools - } - if lbpf.LoadBalancingRules != nil { - objectMap["loadBalancingRules"] = lbpf.LoadBalancingRules - } - if lbpf.Probes != nil { - objectMap["probes"] = lbpf.Probes - } - if lbpf.InboundNatRules != nil { - objectMap["inboundNatRules"] = lbpf.InboundNatRules - } - if lbpf.InboundNatPools != nil { - objectMap["inboundNatPools"] = lbpf.InboundNatPools - } - if lbpf.OutboundRules != nil { - objectMap["outboundRules"] = lbpf.OutboundRules - } - return json.Marshal(objectMap) -} - -// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (LoadBalancer, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result. -func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - lb.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent { - lb, err = client.CreateOrUpdateResponder(lb.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request") - } - } - return -} - -// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type LoadBalancersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancersDeleteFuture.Result. -func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LoadBalancerSku SKU of a load balancer. -type LoadBalancerSku struct { - // Name - Name of a load balancer SKU. Possible values include: 'LoadBalancerSkuNameBasic', 'LoadBalancerSkuNameStandard', 'LoadBalancerSkuNameGateway' - Name LoadBalancerSkuName `json:"name,omitempty"` - // Tier - Tier of a load balancer SKU. Possible values include: 'Regional', 'Global' - Tier LoadBalancerSkuTier `json:"tier,omitempty"` -} - -// LoadBalancersListInboundNatRulePortMappingsFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type LoadBalancersListInboundNatRulePortMappingsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (BackendAddressInboundNatRulePortMappings, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersListInboundNatRulePortMappingsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancersListInboundNatRulePortMappingsFuture.Result. -func (future *LoadBalancersListInboundNatRulePortMappingsFuture) result(client LoadBalancersClient) (bainrpm BackendAddressInboundNatRulePortMappings, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersListInboundNatRulePortMappingsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bainrpm.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersListInboundNatRulePortMappingsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bainrpm.Response.Response, err = future.GetResult(sender); err == nil && bainrpm.Response.Response.StatusCode != http.StatusNoContent { - bainrpm, err = client.ListInboundNatRulePortMappingsResponder(bainrpm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersListInboundNatRulePortMappingsFuture", "Result", bainrpm.Response.Response, "Failure responding to request") - } - } - return -} - -// LoadBalancersSwapPublicIPAddressesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LoadBalancersSwapPublicIPAddressesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersSwapPublicIPAddressesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancersSwapPublicIPAddressesFuture.Result. -func (future *LoadBalancersSwapPublicIPAddressesFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersSwapPublicIPAddressesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersSwapPublicIPAddressesFuture") - return - } - ar.Response = future.Response() - return -} - -// LoadBalancerVipSwapRequest the request for a VIP swap. -type LoadBalancerVipSwapRequest struct { - // FrontendIPConfigurations - A list of frontend IP configuration resources that should swap VIPs. - FrontendIPConfigurations *[]LoadBalancerVipSwapRequestFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` -} - -// LoadBalancerVipSwapRequestFrontendIPConfiguration VIP swap request's frontend IP configuration object. -type LoadBalancerVipSwapRequestFrontendIPConfiguration struct { - // ID - The ID of frontend IP configuration resource. - ID *string `json:"id,omitempty"` - // LoadBalancerVipSwapRequestFrontendIPConfigurationProperties - The properties of VIP swap request's frontend IP configuration object. - *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancerVipSwapRequestFrontendIPConfiguration. -func (lbvsrfic LoadBalancerVipSwapRequestFrontendIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbvsrfic.ID != nil { - objectMap["id"] = lbvsrfic.ID - } - if lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties != nil { - objectMap["properties"] = lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LoadBalancerVipSwapRequestFrontendIPConfiguration struct. -func (lbvsrfic *LoadBalancerVipSwapRequestFrontendIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lbvsrfic.ID = &ID - } - case "properties": - if v != nil { - var loadBalancerVipSwapRequestFrontendIPConfigurationProperties LoadBalancerVipSwapRequestFrontendIPConfigurationProperties - err = json.Unmarshal(*v, &loadBalancerVipSwapRequestFrontendIPConfigurationProperties) - if err != nil { - return err - } - lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties = &loadBalancerVipSwapRequestFrontendIPConfigurationProperties - } - } - } - - return nil -} - -// LoadBalancerVipSwapRequestFrontendIPConfigurationProperties the properties of VIP swap request's -// frontend IP configuration object. -type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties struct { - // PublicIPAddress - A reference to public IP address resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` -} - -// LoadBalancingRule a load balancing rule for a load balancer. -type LoadBalancingRule struct { - autorest.Response `json:"-"` - // LoadBalancingRulePropertiesFormat - Properties of load balancer load balancing rule. - *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancingRule. -func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbr.LoadBalancingRulePropertiesFormat != nil { - objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat - } - if lbr.Name != nil { - objectMap["name"] = lbr.Name - } - if lbr.ID != nil { - objectMap["id"] = lbr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. -func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat - err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) - if err != nil { - return err - } - lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lbr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - lbr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lbr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lbr.ID = &ID - } - } - } - - return nil -} - -// LoadBalancingRulePropertiesFormat properties of the load balancer. -type LoadBalancingRulePropertiesFormat struct { - // FrontendIPConfiguration - A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // BackendAddressPool - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendAddressPools - An array of references to pool of DIPs. - BackendAddressPools *[]SubResource `json:"backendAddressPools,omitempty"` - // Probe - The reference to the load balancer probe used by the load balancing rule. - Probe *SubResource `json:"probe,omitempty"` - // Protocol - The reference to the transport protocol used by the load balancing rule. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' - Protocol TransportProtocol `json:"protocol,omitempty"` - // LoadDistribution - The load distribution policy for this rule. Possible values include: 'LoadDistributionDefault', 'LoadDistributionSourceIP', 'LoadDistributionSourceIPProtocol' - LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"` - // FrontendPort - The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - FrontendPort *int32 `json:"frontendPort,omitempty"` - // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". - BackendPort *int32 `json:"backendPort,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // DisableOutboundSnat - Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. - DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the load balancing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoadBalancingRulePropertiesFormat. -func (lbrpf LoadBalancingRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lbrpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = lbrpf.FrontendIPConfiguration - } - if lbrpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = lbrpf.BackendAddressPool - } - if lbrpf.BackendAddressPools != nil { - objectMap["backendAddressPools"] = lbrpf.BackendAddressPools - } - if lbrpf.Probe != nil { - objectMap["probe"] = lbrpf.Probe - } - if lbrpf.Protocol != "" { - objectMap["protocol"] = lbrpf.Protocol - } - if lbrpf.LoadDistribution != "" { - objectMap["loadDistribution"] = lbrpf.LoadDistribution - } - if lbrpf.FrontendPort != nil { - objectMap["frontendPort"] = lbrpf.FrontendPort - } - if lbrpf.BackendPort != nil { - objectMap["backendPort"] = lbrpf.BackendPort - } - if lbrpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = lbrpf.IdleTimeoutInMinutes - } - if lbrpf.EnableFloatingIP != nil { - objectMap["enableFloatingIP"] = lbrpf.EnableFloatingIP - } - if lbrpf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = lbrpf.EnableTCPReset - } - if lbrpf.DisableOutboundSnat != nil { - objectMap["disableOutboundSnat"] = lbrpf.DisableOutboundSnat - } - return json.Marshal(objectMap) -} - -// LocalNetworkGateway a common class for general resource information. -type LocalNetworkGateway struct { - autorest.Response `json:"-"` - // LocalNetworkGatewayPropertiesFormat - Properties of the local network gateway. - *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for LocalNetworkGateway. -func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lng.LocalNetworkGatewayPropertiesFormat != nil { - objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat - } - if lng.ID != nil { - objectMap["id"] = lng.ID - } - if lng.Location != nil { - objectMap["location"] = lng.Location - } - if lng.Tags != nil { - objectMap["tags"] = lng.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. -func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat - err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) - if err != nil { - return err - } - lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - lng.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lng.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lng.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lng.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - lng.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - lng.Tags = tags - } - } - } - - return nil -} - -// LocalNetworkGatewayListResult response for ListLocalNetworkGateways API service call. -type LocalNetworkGatewayListResult struct { - autorest.Response `json:"-"` - // Value - A list of local network gateways that exists in a resource group. - Value *[]LocalNetworkGateway `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for LocalNetworkGatewayListResult. -func (lnglr LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lnglr.Value != nil { - objectMap["value"] = lnglr.Value - } - return json.Marshal(objectMap) -} - -// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway -// values. -type LocalNetworkGatewayListResultIterator struct { - i int - page LocalNetworkGatewayListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LocalNetworkGatewayListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LocalNetworkGatewayListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway { - if !iter.page.NotDone() { - return LocalNetworkGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LocalNetworkGatewayListResultIterator type. -func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator { - return LocalNetworkGatewayListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { - return lnglr.Value == nil || len(*lnglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { - return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 -} - -// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lnglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lnglr.NextLink))) -} - -// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values. -type LocalNetworkGatewayListResultPage struct { - fn func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error) - lnglr LocalNetworkGatewayListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lnglr) - if err != nil { - return err - } - page.lnglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LocalNetworkGatewayListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LocalNetworkGatewayListResultPage) NotDone() bool { - return !page.lnglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult { - return page.lnglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { - if page.lnglr.IsEmpty() { - return nil - } - return *page.lnglr.Value -} - -// Creates a new instance of the LocalNetworkGatewayListResultPage type. -func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { - return LocalNetworkGatewayListResultPage{ - fn: getNextPage, - lnglr: cur, - } -} - -// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties. -type LocalNetworkGatewayPropertiesFormat struct { - // LocalNetworkAddressSpace - Local network site address space. - LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` - // GatewayIPAddress - IP address of local network gateway. - GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` - // Fqdn - FQDN of local network gateway. - Fqdn *string `json:"fqdn,omitempty"` - // BgpSettings - Local network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the local network gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the local network gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat. -func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lngpf.LocalNetworkAddressSpace != nil { - objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace - } - if lngpf.GatewayIPAddress != nil { - objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress - } - if lngpf.Fqdn != nil { - objectMap["fqdn"] = lngpf.Fqdn - } - if lngpf.BgpSettings != nil { - objectMap["bgpSettings"] = lngpf.BgpSettings - } - return json.Marshal(objectMap) -} - -// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LocalNetworkGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result. -func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - lng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent { - lng, err = client.CreateOrUpdateResponder(lng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request") - } - } - return -} - -// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LocalNetworkGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LocalNetworkGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result. -func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LogSpecification description of logging specification. -type LogSpecification struct { - // Name - The name of the specification. - Name *string `json:"name,omitempty"` - // DisplayName - The display name of the specification. - DisplayName *string `json:"displayName,omitempty"` - // BlobDuration - Duration of the blob. - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// ManagedRuleGroupOverride defines a managed rule group override setting. -type ManagedRuleGroupOverride struct { - // RuleGroupName - The managed rule group to override. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. - Rules *[]ManagedRuleOverride `json:"rules,omitempty"` -} - -// ManagedRuleOverride defines a managed rule group override setting. -type ManagedRuleOverride struct { - // RuleID - Identifier for the managed rule. - RuleID *string `json:"ruleId,omitempty"` - // State - The state of the managed rule. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' - State ManagedRuleEnabledState `json:"state,omitempty"` - // Action - Describes the override action to be applied when rule matches. Possible values include: 'ActionTypeAnomalyScoring', 'ActionTypeAllow', 'ActionTypeBlock', 'ActionTypeLog' - Action ActionType `json:"action,omitempty"` -} - -// ManagedRulesDefinition allow to exclude some variable satisfy the condition for the WAF check. -type ManagedRulesDefinition struct { - // Exclusions - The Exclusions that are applied on the policy. - Exclusions *[]OwaspCrsExclusionEntry `json:"exclusions,omitempty"` - // ManagedRuleSets - The managed rule sets that are associated with the policy. - ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` -} - -// ManagedRuleSet defines a managed rule set. -type ManagedRuleSet struct { - // RuleSetType - Defines the rule set type to use. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - Defines the version of the rule set to use. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroupOverrides - Defines the rule group overrides to apply to the rule set. - RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` -} - -// ManagedServiceIdentity identity for the resource. -type ManagedServiceIdentity struct { - // PrincipalID - READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the resource. 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. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with resource. 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]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for ManagedServiceIdentity. -func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if msi.Type != "" { - objectMap["type"] = msi.Type - } - if msi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// ManagedServiceIdentityUserAssignedIdentitiesValue ... -type ManagedServiceIdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagedServiceIdentityUserAssignedIdentitiesValue. -func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// Manager the Managed Network resource -type Manager struct { - autorest.Response `json:"-"` - // ManagerProperties - The network manager properties - *ManagerProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Manager. -func (mVar Manager) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mVar.ManagerProperties != nil { - objectMap["properties"] = mVar.ManagerProperties - } - if mVar.ID != nil { - objectMap["id"] = mVar.ID - } - if mVar.Location != nil { - objectMap["location"] = mVar.Location - } - if mVar.Tags != nil { - objectMap["tags"] = mVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Manager struct. -func (mVar *Manager) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managerProperties ManagerProperties - err = json.Unmarshal(*v, &managerProperties) - if err != nil { - return err - } - mVar.ManagerProperties = &managerProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - mVar.Etag = &etag - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - mVar.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - mVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - mVar.Tags = tags - } - } - } - - return nil -} - -// ManagerCommit network Manager Commit. -type ManagerCommit struct { - autorest.Response `json:"-"` - // CommitID - READ-ONLY; Commit Id. - CommitID *string `json:"commitId,omitempty"` - // TargetLocations - List of target locations. - TargetLocations *[]string `json:"targetLocations,omitempty"` - // ConfigurationIds - List of configuration ids. - ConfigurationIds *[]string `json:"configurationIds,omitempty"` - // CommitType - Commit Type. Possible values include: 'SecurityAdmin', 'Connectivity' - CommitType ConfigurationType `json:"commitType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagerCommit. -func (mc ManagerCommit) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mc.TargetLocations != nil { - objectMap["targetLocations"] = mc.TargetLocations - } - if mc.ConfigurationIds != nil { - objectMap["configurationIds"] = mc.ConfigurationIds - } - if mc.CommitType != "" { - objectMap["commitType"] = mc.CommitType - } - return json.Marshal(objectMap) -} - -// ManagerCommitsPostFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ManagerCommitsPostFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ManagerCommitsClient) (ManagerCommit, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ManagerCommitsPostFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ManagerCommitsPostFuture.Result. -func (future *ManagerCommitsPostFuture) result(client ManagerCommitsClient) (mc ManagerCommit, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagerCommitsPostFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - mc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ManagerCommitsPostFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { - mc, err = client.PostResponder(mc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagerCommitsPostFuture", "Result", mc.Response.Response, "Failure responding to request") - } - } - return -} - -// ManagerConnection the Network Manager Connection resource -type ManagerConnection struct { - autorest.Response `json:"-"` - // ManagerConnectionProperties - The scope connection properties - *ManagerConnectionProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagerConnection. -func (mc ManagerConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mc.ManagerConnectionProperties != nil { - objectMap["properties"] = mc.ManagerConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ManagerConnection struct. -func (mc *ManagerConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var managerConnectionProperties ManagerConnectionProperties - err = json.Unmarshal(*v, &managerConnectionProperties) - if err != nil { - return err - } - mc.ManagerConnectionProperties = &managerConnectionProperties - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - mc.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - mc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - mc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - mc.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - mc.Etag = &etag - } - } - } - - return nil -} - -// ManagerConnectionListResult list of network manager connections. -type ManagerConnectionListResult struct { - autorest.Response `json:"-"` - // Value - List of network manager connections. - Value *[]ManagerConnection `json:"value,omitempty"` - // NextLink - Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagerConnectionListResultIterator provides access to a complete listing of ManagerConnection values. -type ManagerConnectionListResultIterator struct { - i int - page ManagerConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagerConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagerConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagerConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagerConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagerConnectionListResultIterator) Response() ManagerConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagerConnectionListResultIterator) Value() ManagerConnection { - if !iter.page.NotDone() { - return ManagerConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagerConnectionListResultIterator type. -func NewManagerConnectionListResultIterator(page ManagerConnectionListResultPage) ManagerConnectionListResultIterator { - return ManagerConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mclr ManagerConnectionListResult) IsEmpty() bool { - return mclr.Value == nil || len(*mclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (mclr ManagerConnectionListResult) hasNextLink() bool { - return mclr.NextLink != nil && len(*mclr.NextLink) != 0 -} - -// managerConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mclr ManagerConnectionListResult) managerConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !mclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mclr.NextLink))) -} - -// ManagerConnectionListResultPage contains a page of ManagerConnection values. -type ManagerConnectionListResultPage struct { - fn func(context.Context, ManagerConnectionListResult) (ManagerConnectionListResult, error) - mclr ManagerConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagerConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagerConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.mclr) - if err != nil { - return err - } - page.mclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ManagerConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagerConnectionListResultPage) NotDone() bool { - return !page.mclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagerConnectionListResultPage) Response() ManagerConnectionListResult { - return page.mclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagerConnectionListResultPage) Values() []ManagerConnection { - if page.mclr.IsEmpty() { - return nil - } - return *page.mclr.Value -} - -// Creates a new instance of the ManagerConnectionListResultPage type. -func NewManagerConnectionListResultPage(cur ManagerConnectionListResult, getNextPage func(context.Context, ManagerConnectionListResult) (ManagerConnectionListResult, error)) ManagerConnectionListResultPage { - return ManagerConnectionListResultPage{ - fn: getNextPage, - mclr: cur, - } -} - -// ManagerConnectionProperties information about the network manager connection. -type ManagerConnectionProperties struct { - // NetworkManagerID - Network Manager Id. - NetworkManagerID *string `json:"networkManagerId,omitempty"` - // ConnectionState - Connection state. Possible values include: 'ScopeConnectionStateConnected', 'ScopeConnectionStatePending', 'ScopeConnectionStateConflict', 'ScopeConnectionStateRevoked', 'ScopeConnectionStateRejected' - ConnectionState ScopeConnectionState `json:"connectionState,omitempty"` - // Description - A description of the network manager connection. - Description *string `json:"description,omitempty"` -} - -// ManagerDeploymentStatus network Manager Deployment Status. -type ManagerDeploymentStatus struct { - // CommitTime - Commit Time. - CommitTime *date.Time `json:"commitTime,omitempty"` - // Region - Region Name. - Region *string `json:"region,omitempty"` - // DeploymentStatus - Deployment Status. Possible values include: 'NotStarted', 'Deploying', 'Deployed', 'Failed' - DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` - // ConfigurationIds - List of configuration ids. - ConfigurationIds *[]string `json:"configurationIds,omitempty"` - // DeploymentType - Possible values include: 'SecurityAdmin', 'Connectivity' - DeploymentType ConfigurationType `json:"deploymentType,omitempty"` - // ErrorMessage - Error Message. - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -// ManagerDeploymentStatusListResult a list of Network Manager Deployment Status -type ManagerDeploymentStatusListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of Network Manager Deployment Status - Value *[]ManagerDeploymentStatus `json:"value,omitempty"` - // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// ManagerDeploymentStatusParameter network Manager Deployment Status Parameter. -type ManagerDeploymentStatusParameter struct { - // Regions - List of locations. - Regions *[]string `json:"regions,omitempty"` - // DeploymentTypes - List of deployment types. - DeploymentTypes *[]ConfigurationType `json:"deploymentTypes,omitempty"` - // SkipToken - Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. - SkipToken *string `json:"skipToken,omitempty"` -} - -// ManagerEffectiveConnectivityConfigurationListResult result of the request to list -// networkManagerEffectiveConnectivityConfiguration. It contains a list of groups and a skiptoken to get -// the next set of results. -type ManagerEffectiveConnectivityConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of NetworkManagerEffectiveConnectivityConfiguration - Value *[]EffectiveConnectivityConfiguration `json:"value,omitempty"` - // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// ManagerEffectiveSecurityAdminRulesListResult result of the request to list -// networkManagerEffectiveSecurityAdminRules. It contains a list of groups and a skiptoken to get the next -// set of results. -type ManagerEffectiveSecurityAdminRulesListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of NetworkManagerEffectiveSecurityAdminRules - Value *[]BasicEffectiveBaseSecurityAdminRule `json:"value,omitempty"` - // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// UnmarshalJSON is the custom unmarshaler for ManagerEffectiveSecurityAdminRulesListResult struct. -func (mesarlr *ManagerEffectiveSecurityAdminRulesListResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "value": - if v != nil { - value, err := unmarshalBasicEffectiveBaseSecurityAdminRuleArray(*v) - if err != nil { - return err - } - mesarlr.Value = &value - } - case "skipToken": - if v != nil { - var skipToken string - err = json.Unmarshal(*v, &skipToken) - if err != nil { - return err - } - mesarlr.SkipToken = &skipToken - } - } - } - - return nil -} - -// ManagerListResult result of the request to list NetworkManager. It contains a list of network managers -// and a URL link to get the next set of results. -type ManagerListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of NetworkManager - Value *[]Manager `json:"value,omitempty"` - // NextLink - Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ManagerListResultIterator provides access to a complete listing of Manager values. -type ManagerListResultIterator struct { - i int - page ManagerListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ManagerListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagerListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ManagerListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ManagerListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ManagerListResultIterator) Response() ManagerListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ManagerListResultIterator) Value() Manager { - if !iter.page.NotDone() { - return Manager{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ManagerListResultIterator type. -func NewManagerListResultIterator(page ManagerListResultPage) ManagerListResultIterator { - return ManagerListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (mlr ManagerListResult) IsEmpty() bool { - return mlr.Value == nil || len(*mlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (mlr ManagerListResult) hasNextLink() bool { - return mlr.NextLink != nil && len(*mlr.NextLink) != 0 -} - -// managerListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (mlr ManagerListResult) managerListResultPreparer(ctx context.Context) (*http.Request, error) { - if !mlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(mlr.NextLink))) -} - -// ManagerListResultPage contains a page of Manager values. -type ManagerListResultPage struct { - fn func(context.Context, ManagerListResult) (ManagerListResult, error) - mlr ManagerListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ManagerListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ManagerListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.mlr) - if err != nil { - return err - } - page.mlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ManagerListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ManagerListResultPage) NotDone() bool { - return !page.mlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ManagerListResultPage) Response() ManagerListResult { - return page.mlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ManagerListResultPage) Values() []Manager { - if page.mlr.IsEmpty() { - return nil - } - return *page.mlr.Value -} - -// Creates a new instance of the ManagerListResultPage type. -func NewManagerListResultPage(cur ManagerListResult, getNextPage func(context.Context, ManagerListResult) (ManagerListResult, error)) ManagerListResultPage { - return ManagerListResultPage{ - fn: getNextPage, - mlr: cur, - } -} - -// ManagerProperties properties of Managed Network -type ManagerProperties struct { - // Description - A description of the network manager. - Description *string `json:"description,omitempty"` - // NetworkManagerScopes - Scope of Network Manager. - NetworkManagerScopes *ManagerPropertiesNetworkManagerScopes `json:"networkManagerScopes,omitempty"` - // NetworkManagerScopeAccesses - Scope Access. - NetworkManagerScopeAccesses *[]ConfigurationType `json:"networkManagerScopeAccesses,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network manager resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagerProperties. -func (mp ManagerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mp.Description != nil { - objectMap["description"] = mp.Description - } - if mp.NetworkManagerScopes != nil { - objectMap["networkManagerScopes"] = mp.NetworkManagerScopes - } - if mp.NetworkManagerScopeAccesses != nil { - objectMap["networkManagerScopeAccesses"] = mp.NetworkManagerScopeAccesses - } - return json.Marshal(objectMap) -} - -// ManagerPropertiesNetworkManagerScopes scope of Network Manager. -type ManagerPropertiesNetworkManagerScopes struct { - // ManagementGroups - List of management groups. - ManagementGroups *[]string `json:"managementGroups,omitempty"` - // Subscriptions - List of subscriptions. - Subscriptions *[]string `json:"subscriptions,omitempty"` - // CrossTenantScopes - READ-ONLY; List of cross tenant scopes. - CrossTenantScopes *[]CrossTenantScopes `json:"crossTenantScopes,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagerPropertiesNetworkManagerScopes. -func (mpMs ManagerPropertiesNetworkManagerScopes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if mpMs.ManagementGroups != nil { - objectMap["managementGroups"] = mpMs.ManagementGroups - } - if mpMs.Subscriptions != nil { - objectMap["subscriptions"] = mpMs.Subscriptions - } - return json.Marshal(objectMap) -} - -// ManagersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ManagersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ManagersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ManagersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ManagersDeleteFuture.Result. -func (future *ManagersDeleteFuture) result(client ManagersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ManagersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ManagersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ManagerSecurityGroupItem network manager security group item. -type ManagerSecurityGroupItem struct { - // NetworkGroupID - Network manager group Id. - NetworkGroupID *string `json:"networkGroupId,omitempty"` -} - -// MatchCondition define match conditions. -type MatchCondition struct { - // MatchVariables - List of match variables. - MatchVariables *[]MatchVariable `json:"matchVariables,omitempty"` - // Operator - The operator to be matched. Possible values include: 'WebApplicationFirewallOperatorIPMatch', 'WebApplicationFirewallOperatorEqual', 'WebApplicationFirewallOperatorContains', 'WebApplicationFirewallOperatorLessThan', 'WebApplicationFirewallOperatorGreaterThan', 'WebApplicationFirewallOperatorLessThanOrEqual', 'WebApplicationFirewallOperatorGreaterThanOrEqual', 'WebApplicationFirewallOperatorBeginsWith', 'WebApplicationFirewallOperatorEndsWith', 'WebApplicationFirewallOperatorRegex', 'WebApplicationFirewallOperatorGeoMatch', 'WebApplicationFirewallOperatorAny' - Operator WebApplicationFirewallOperator `json:"operator,omitempty"` - // NegationConditon - Whether this is negate condition or not. - NegationConditon *bool `json:"negationConditon,omitempty"` - // MatchValues - Match value. - MatchValues *[]string `json:"matchValues,omitempty"` - // Transforms - List of transforms. - Transforms *[]WebApplicationFirewallTransform `json:"transforms,omitempty"` -} - -// MatchedRule matched rule. -type MatchedRule struct { - // RuleName - Name of the matched network security rule. - RuleName *string `json:"ruleName,omitempty"` - // Action - The network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. - Action *string `json:"action,omitempty"` -} - -// MatchVariable define match variables. -type MatchVariable struct { - // VariableName - Match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeaders', 'RequestBody', 'RequestCookies' - VariableName WebApplicationFirewallMatchVariable `json:"variableName,omitempty"` - // Selector - The selector of match variable. - Selector *string `json:"selector,omitempty"` -} - -// MetricSpecification description of metrics specification. -type MetricSpecification struct { - // Name - The name of the metric. - Name *string `json:"name,omitempty"` - // DisplayName - The display name of the metric. - DisplayName *string `json:"displayName,omitempty"` - // DisplayDescription - The description of the metric. - DisplayDescription *string `json:"displayDescription,omitempty"` - // Unit - Units the metric to be displayed in. - Unit *string `json:"unit,omitempty"` - // AggregationType - The aggregation type. - AggregationType *string `json:"aggregationType,omitempty"` - // Availabilities - List of availability. - Availabilities *[]Availability `json:"availabilities,omitempty"` - // EnableRegionalMdmAccount - Whether regional MDM account enabled. - EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` - // FillGapWithZero - Whether gaps would be filled with zeros. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` - // MetricFilterPattern - Pattern for the filter of the metric. - MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` - // Dimensions - List of dimensions. - Dimensions *[]Dimension `json:"dimensions,omitempty"` - // IsInternal - Whether the metric is internal. - IsInternal *bool `json:"isInternal,omitempty"` - // SourceMdmAccount - The source MDM account. - SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` - // SourceMdmNamespace - The source MDM namespace. - SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` - // ResourceIDDimensionNameOverride - The resource Id dimension name override. - ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` -} - -// NatGateway nat Gateway resource. -type NatGateway struct { - autorest.Response `json:"-"` - // Sku - The nat gateway SKU. - Sku *NatGatewaySku `json:"sku,omitempty"` - // NatGatewayPropertiesFormat - Nat Gateway properties. - *NatGatewayPropertiesFormat `json:"properties,omitempty"` - // Zones - A list of availability zones denoting the zone in which Nat Gateway should be deployed. - Zones *[]string `json:"zones,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for NatGateway. -func (ng NatGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ng.Sku != nil { - objectMap["sku"] = ng.Sku - } - if ng.NatGatewayPropertiesFormat != nil { - objectMap["properties"] = ng.NatGatewayPropertiesFormat - } - if ng.Zones != nil { - objectMap["zones"] = ng.Zones - } - if ng.ID != nil { - objectMap["id"] = ng.ID - } - if ng.Location != nil { - objectMap["location"] = ng.Location - } - if ng.Tags != nil { - objectMap["tags"] = ng.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for NatGateway struct. -func (ng *NatGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku NatGatewaySku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - ng.Sku = &sku - } - case "properties": - if v != nil { - var natGatewayPropertiesFormat NatGatewayPropertiesFormat - err = json.Unmarshal(*v, &natGatewayPropertiesFormat) - if err != nil { - return err - } - ng.NatGatewayPropertiesFormat = &natGatewayPropertiesFormat - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - ng.Zones = &zones - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ng.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ng.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ng.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ng.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ng.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ng.Tags = tags - } - } - } - - return nil -} - -// NatGatewayListResult response for ListNatGateways API service call. -type NatGatewayListResult struct { - autorest.Response `json:"-"` - // Value - A list of Nat Gateways that exists in a resource group. - Value *[]NatGateway `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// NatGatewayListResultIterator provides access to a complete listing of NatGateway values. -type NatGatewayListResultIterator struct { - i int - page NatGatewayListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *NatGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewayListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *NatGatewayListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter NatGatewayListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter NatGatewayListResultIterator) Response() NatGatewayListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter NatGatewayListResultIterator) Value() NatGateway { - if !iter.page.NotDone() { - return NatGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the NatGatewayListResultIterator type. -func NewNatGatewayListResultIterator(page NatGatewayListResultPage) NatGatewayListResultIterator { - return NatGatewayListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (nglr NatGatewayListResult) IsEmpty() bool { - return nglr.Value == nil || len(*nglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (nglr NatGatewayListResult) hasNextLink() bool { - return nglr.NextLink != nil && len(*nglr.NextLink) != 0 -} - -// natGatewayListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (nglr NatGatewayListResult) natGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !nglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(nglr.NextLink))) -} - -// NatGatewayListResultPage contains a page of NatGateway values. -type NatGatewayListResultPage struct { - fn func(context.Context, NatGatewayListResult) (NatGatewayListResult, error) - nglr NatGatewayListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *NatGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewayListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.nglr) - if err != nil { - return err - } - page.nglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *NatGatewayListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page NatGatewayListResultPage) NotDone() bool { - return !page.nglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page NatGatewayListResultPage) Response() NatGatewayListResult { - return page.nglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page NatGatewayListResultPage) Values() []NatGateway { - if page.nglr.IsEmpty() { - return nil - } - return *page.nglr.Value -} - -// Creates a new instance of the NatGatewayListResultPage type. -func NewNatGatewayListResultPage(cur NatGatewayListResult, getNextPage func(context.Context, NatGatewayListResult) (NatGatewayListResult, error)) NatGatewayListResultPage { - return NatGatewayListResultPage{ - fn: getNextPage, - nglr: cur, - } -} - -// NatGatewayPropertiesFormat nat Gateway properties. -type NatGatewayPropertiesFormat struct { - // IdleTimeoutInMinutes - The idle timeout of the nat gateway. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // PublicIPAddresses - An array of public ip addresses associated with the nat gateway resource. - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - // PublicIPPrefixes - An array of public ip prefixes associated with the nat gateway resource. - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - // Subnets - READ-ONLY; An array of references to the subnets using this nat gateway resource. - Subnets *[]SubResource `json:"subnets,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the NAT gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the NAT gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for NatGatewayPropertiesFormat. -func (ngpf NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ngpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = ngpf.IdleTimeoutInMinutes - } - if ngpf.PublicIPAddresses != nil { - objectMap["publicIpAddresses"] = ngpf.PublicIPAddresses - } - if ngpf.PublicIPPrefixes != nil { - objectMap["publicIpPrefixes"] = ngpf.PublicIPPrefixes - } - return json.Marshal(objectMap) -} - -// NatGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type NatGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(NatGatewaysClient) (NatGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *NatGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for NatGatewaysCreateOrUpdateFuture.Result. -func (future *NatGatewaysCreateOrUpdateFuture) result(client NatGatewaysClient) (ng NatGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.NatGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ng.Response.Response, err = future.GetResult(sender); err == nil && ng.Response.Response.StatusCode != http.StatusNoContent { - ng, err = client.CreateOrUpdateResponder(ng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysCreateOrUpdateFuture", "Result", ng.Response.Response, "Failure responding to request") - } - } - return -} - -// NatGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type NatGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(NatGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *NatGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for NatGatewaysDeleteFuture.Result. -func (future *NatGatewaysDeleteFuture) result(client NatGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.NatGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// NatGatewaySku SKU of nat gateway. -type NatGatewaySku struct { - // Name - Name of Nat Gateway SKU. Possible values include: 'NatGatewaySkuNameStandard' - Name NatGatewaySkuName `json:"name,omitempty"` -} - -// NatRule rule of type nat. -type NatRule struct { - // IPProtocols - Array of FirewallPolicyRuleNetworkProtocols. - IPProtocols *[]FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses or Service Tags. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // TranslatedAddress - The translated address for this NAT rule. - TranslatedAddress *string `json:"translatedAddress,omitempty"` - // TranslatedPort - The translated port for this NAT rule. - TranslatedPort *string `json:"translatedPort,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // TranslatedFqdn - The translated FQDN for this NAT rule. - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - // Name - Name of the rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' - RuleType RuleType `json:"ruleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for NatRule. -func (nr NatRule) MarshalJSON() ([]byte, error) { - nr.RuleType = RuleTypeNatRule - objectMap := make(map[string]interface{}) - if nr.IPProtocols != nil { - objectMap["ipProtocols"] = nr.IPProtocols - } - if nr.SourceAddresses != nil { - objectMap["sourceAddresses"] = nr.SourceAddresses - } - if nr.DestinationAddresses != nil { - objectMap["destinationAddresses"] = nr.DestinationAddresses - } - if nr.DestinationPorts != nil { - objectMap["destinationPorts"] = nr.DestinationPorts - } - if nr.TranslatedAddress != nil { - objectMap["translatedAddress"] = nr.TranslatedAddress - } - if nr.TranslatedPort != nil { - objectMap["translatedPort"] = nr.TranslatedPort - } - if nr.SourceIPGroups != nil { - objectMap["sourceIpGroups"] = nr.SourceIPGroups - } - if nr.TranslatedFqdn != nil { - objectMap["translatedFqdn"] = nr.TranslatedFqdn - } - if nr.Name != nil { - objectMap["name"] = nr.Name - } - if nr.Description != nil { - objectMap["description"] = nr.Description - } - if nr.RuleType != "" { - objectMap["ruleType"] = nr.RuleType - } - return json.Marshal(objectMap) -} - -// AsApplicationRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsApplicationRule() (*ApplicationRule, bool) { - return nil, false -} - -// AsNatRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsNatRule() (*NatRule, bool) { - return &nr, true -} - -// AsRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsRule() (*Rule, bool) { - return nil, false -} - -// AsFirewallPolicyRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRule is the BasicFirewallPolicyRule implementation for NatRule. -func (nr NatRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { - return &nr, true -} - -// NatRulePortMapping individual port mappings for inbound NAT rule created for backend pool. -type NatRulePortMapping struct { - // InboundNatRuleName - Name of inbound NAT rule. - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` - // FrontendPort - Frontend port. - FrontendPort *int32 `json:"frontendPort,omitempty"` - // BackendPort - Backend port. - BackendPort *int32 `json:"backendPort,omitempty"` -} - -// NatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type NatRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(NatRulesClient) (VpnGatewayNatRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *NatRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for NatRulesCreateOrUpdateFuture.Result. -func (future *NatRulesCreateOrUpdateFuture) result(client NatRulesClient) (vgnr VpnGatewayNatRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vgnr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.NatRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vgnr.Response.Response, err = future.GetResult(sender); err == nil && vgnr.Response.Response.StatusCode != http.StatusNoContent { - vgnr, err = client.CreateOrUpdateResponder(vgnr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesCreateOrUpdateFuture", "Result", vgnr.Response.Response, "Failure responding to request") - } - } - return -} - -// NatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type NatRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(NatRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *NatRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for NatRulesDeleteFuture.Result. -func (future *NatRulesDeleteFuture) result(client NatRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.NatRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// NextHopParameters parameters that define the source and destination endpoint. -type NextHopParameters struct { - // TargetResourceID - The resource identifier of the target resource against which the action is to be performed. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // SourceIPAddress - The source IP address. - SourceIPAddress *string `json:"sourceIPAddress,omitempty"` - // DestinationIPAddress - The destination IP address. - DestinationIPAddress *string `json:"destinationIPAddress,omitempty"` - // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). - TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` -} - -// NextHopResult the information about next hop from the specified VM. -type NextHopResult struct { - autorest.Response `json:"-"` - // NextHopType - Next hop type. Possible values include: 'NextHopTypeInternet', 'NextHopTypeVirtualAppliance', 'NextHopTypeVirtualNetworkGateway', 'NextHopTypeVnetLocal', 'NextHopTypeHyperNetGateway', 'NextHopTypeNone' - NextHopType NextHopType `json:"nextHopType,omitempty"` - // NextHopIPAddress - Next hop IP Address. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - // RouteTableID - The resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. - RouteTableID *string `json:"routeTableId,omitempty"` -} - -// O365BreakOutCategoryPolicies office365 breakout categories. -type O365BreakOutCategoryPolicies struct { - // Allow - Flag to control allow category. - Allow *bool `json:"allow,omitempty"` - // Optimize - Flag to control optimize category. - Optimize *bool `json:"optimize,omitempty"` - // Default - Flag to control default category. - Default *bool `json:"default,omitempty"` -} - -// O365PolicyProperties the Office365 breakout policy. -type O365PolicyProperties struct { - // BreakOutCategories - Office365 breakout categories. - BreakOutCategories *O365BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} - -// Office365PolicyProperties network Virtual Appliance Sku Properties. -type Office365PolicyProperties struct { - // BreakOutCategories - Office 365 breakout categories. - BreakOutCategories *BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} - -// Operation network REST API operation definition. -type Operation struct { - // Name - Operation name: {provider}/{resource}/{operation}. - Name *string `json:"name,omitempty"` - // Display - Display metadata associated with the operation. - Display *OperationDisplay `json:"display,omitempty"` - // Origin - Origin of the operation. - Origin *string `json:"origin,omitempty"` - // OperationPropertiesFormat - Operation properties format. - *OperationPropertiesFormat `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for Operation. -func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if o.Name != nil { - objectMap["name"] = o.Name - } - if o.Display != nil { - objectMap["display"] = o.Display - } - if o.Origin != nil { - objectMap["origin"] = o.Origin - } - if o.OperationPropertiesFormat != nil { - objectMap["properties"] = o.OperationPropertiesFormat - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Operation struct. -func (o *Operation) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - o.Name = &name - } - case "display": - if v != nil { - var display OperationDisplay - err = json.Unmarshal(*v, &display) - if err != nil { - return err - } - o.Display = &display - } - case "origin": - if v != nil { - var origin string - err = json.Unmarshal(*v, &origin) - if err != nil { - return err - } - o.Origin = &origin - } - case "properties": - if v != nil { - var operationPropertiesFormat OperationPropertiesFormat - err = json.Unmarshal(*v, &operationPropertiesFormat) - if err != nil { - return err - } - o.OperationPropertiesFormat = &operationPropertiesFormat - } - } - } - - return nil -} - -// OperationDisplay display metadata associated with the operation. -type OperationDisplay struct { - // Provider - Service provider: Microsoft Network. - Provider *string `json:"provider,omitempty"` - // Resource - Resource on which the operation is performed. - Resource *string `json:"resource,omitempty"` - // Operation - Type of the operation: get, read, delete, etc. - Operation *string `json:"operation,omitempty"` - // Description - Description of the operation. - Description *string `json:"description,omitempty"` -} - -// OperationListResult result of the request to list Network operations. It contains a list of operations -// and a URL link to get the next set of results. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - List of Network operations supported by the Network resource provider. - Value *[]Operation `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// OperationListResultIterator provides access to a complete listing of Operation values. -type OperationListResultIterator struct { - i int - page OperationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *OperationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter OperationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter OperationListResultIterator) Response() OperationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter OperationListResultIterator) Value() Operation { - if !iter.page.NotDone() { - return Operation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the OperationListResultIterator type. -func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { - return OperationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (olr OperationListResult) IsEmpty() bool { - return olr.Value == nil || len(*olr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (olr OperationListResult) hasNextLink() bool { - return olr.NextLink != nil && len(*olr.NextLink) != 0 -} - -// operationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !olr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(olr.NextLink))) -} - -// OperationListResultPage contains a page of Operation values. -type OperationListResultPage struct { - fn func(context.Context, OperationListResult) (OperationListResult, error) - olr OperationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.olr) - if err != nil { - return err - } - page.olr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *OperationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page OperationListResultPage) NotDone() bool { - return !page.olr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page OperationListResultPage) Response() OperationListResult { - return page.olr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page OperationListResultPage) Values() []Operation { - if page.olr.IsEmpty() { - return nil - } - return *page.olr.Value -} - -// Creates a new instance of the OperationListResultPage type. -func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return OperationListResultPage{ - fn: getNextPage, - olr: cur, - } -} - -// OperationPropertiesFormat description of operation properties format. -type OperationPropertiesFormat struct { - // ServiceSpecification - Specification of the service. - ServiceSpecification *OperationPropertiesFormatServiceSpecification `json:"serviceSpecification,omitempty"` -} - -// OperationPropertiesFormatServiceSpecification specification of the service. -type OperationPropertiesFormatServiceSpecification struct { - // MetricSpecifications - Operation service specification. - MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` - // LogSpecifications - Operation log specification. - LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` -} - -// OrderBy describes a column to sort -type OrderBy struct { - // Field - Describes the actual column name to sort by - Field *string `json:"field,omitempty"` - // Order - Describes if results should be in ascending/descending order. Possible values include: 'Ascending', 'Descending' - Order FirewallPolicyIDPSQuerySortOrder `json:"order,omitempty"` -} - -// OutboundRule outbound rule of the load balancer. -type OutboundRule struct { - autorest.Response `json:"-"` - // OutboundRulePropertiesFormat - Properties of load balancer outbound rule. - *OutboundRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of outbound rules used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for OutboundRule. -func (or OutboundRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if or.OutboundRulePropertiesFormat != nil { - objectMap["properties"] = or.OutboundRulePropertiesFormat - } - if or.Name != nil { - objectMap["name"] = or.Name - } - if or.ID != nil { - objectMap["id"] = or.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OutboundRule struct. -func (or *OutboundRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var outboundRulePropertiesFormat OutboundRulePropertiesFormat - err = json.Unmarshal(*v, &outboundRulePropertiesFormat) - if err != nil { - return err - } - or.OutboundRulePropertiesFormat = &outboundRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - or.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - or.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - or.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - or.ID = &ID - } - } - } - - return nil -} - -// OutboundRulePropertiesFormat outbound rule of the load balancer. -type OutboundRulePropertiesFormat struct { - // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. - AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` - // FrontendIPConfigurations - The Frontend IP addresses of the load balancer. - FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"` - // BackendAddressPool - A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the outbound rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Protocol - The protocol for the outbound rule in load balancer. Possible values include: 'LoadBalancerOutboundRuleProtocolTCP', 'LoadBalancerOutboundRuleProtocolUDP', 'LoadBalancerOutboundRuleProtocolAll' - Protocol LoadBalancerOutboundRuleProtocol `json:"protocol,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` -} - -// MarshalJSON is the custom marshaler for OutboundRulePropertiesFormat. -func (orpf OutboundRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if orpf.AllocatedOutboundPorts != nil { - objectMap["allocatedOutboundPorts"] = orpf.AllocatedOutboundPorts - } - if orpf.FrontendIPConfigurations != nil { - objectMap["frontendIPConfigurations"] = orpf.FrontendIPConfigurations - } - if orpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = orpf.BackendAddressPool - } - if orpf.Protocol != "" { - objectMap["protocol"] = orpf.Protocol - } - if orpf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = orpf.EnableTCPReset - } - if orpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = orpf.IdleTimeoutInMinutes - } - return json.Marshal(objectMap) -} - -// OwaspCrsExclusionEntry allow to exclude some variable satisfy the condition for the WAF check. -type OwaspCrsExclusionEntry struct { - // MatchVariable - The variable to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'RequestArgNames', 'RequestHeaderKeys', 'RequestHeaderValues', 'RequestCookieKeys', 'RequestCookieValues', 'RequestArgKeys', 'RequestArgValues' - MatchVariable OwaspCrsExclusionEntryMatchVariable `json:"matchVariable,omitempty"` - // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. Possible values include: 'OwaspCrsExclusionEntrySelectorMatchOperatorEquals', 'OwaspCrsExclusionEntrySelectorMatchOperatorContains', 'OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny' - SelectorMatchOperator OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator,omitempty"` - // Selector - When matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. - Selector *string `json:"selector,omitempty"` - // ExclusionManagedRuleSets - The managed rule sets that are associated with the exclusion. - ExclusionManagedRuleSets *[]ExclusionManagedRuleSet `json:"exclusionManagedRuleSets,omitempty"` -} - -// P2SConnectionConfiguration p2SConnectionConfiguration Resource. -type P2SConnectionConfiguration struct { - // P2SConnectionConfigurationProperties - Properties of the P2S connection configuration. - *P2SConnectionConfigurationProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for P2SConnectionConfiguration. -func (pcc P2SConnectionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pcc.P2SConnectionConfigurationProperties != nil { - objectMap["properties"] = pcc.P2SConnectionConfigurationProperties - } - if pcc.Name != nil { - objectMap["name"] = pcc.Name - } - if pcc.ID != nil { - objectMap["id"] = pcc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for P2SConnectionConfiguration struct. -func (pcc *P2SConnectionConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var p2SConnectionConfigurationProperties P2SConnectionConfigurationProperties - err = json.Unmarshal(*v, &p2SConnectionConfigurationProperties) - if err != nil { - return err - } - pcc.P2SConnectionConfigurationProperties = &p2SConnectionConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pcc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcc.ID = &ID - } - } - } - - return nil -} - -// P2SConnectionConfigurationProperties parameters for P2SConnectionConfiguration. -type P2SConnectionConfigurationProperties struct { - // VpnClientAddressPool - The reference to the address space resource which represents Address space for P2S VpnClient. - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - // EnableInternetSecurity - Flag indicating whether the enable internet security flag is turned on for the P2S Connections or not. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - // ConfigurationPolicyGroupAssociations - READ-ONLY; List of Configuration Policy Groups that this P2SConnectionConfiguration is attached to. - ConfigurationPolicyGroupAssociations *[]SubResource `json:"configurationPolicyGroupAssociations,omitempty"` - // PreviousConfigurationPolicyGroupAssociations - READ-ONLY; List of previous Configuration Policy Groups that this P2SConnectionConfiguration was attached to. - PreviousConfigurationPolicyGroupAssociations *[]VpnServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the P2SConnectionConfiguration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for P2SConnectionConfigurationProperties. -func (pccp P2SConnectionConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pccp.VpnClientAddressPool != nil { - objectMap["vpnClientAddressPool"] = pccp.VpnClientAddressPool - } - if pccp.RoutingConfiguration != nil { - objectMap["routingConfiguration"] = pccp.RoutingConfiguration - } - if pccp.EnableInternetSecurity != nil { - objectMap["enableInternetSecurity"] = pccp.EnableInternetSecurity - } - return json.Marshal(objectMap) -} - -// P2SVpnConnectionHealth p2S Vpn connection detailed health written to sas url. -type P2SVpnConnectionHealth struct { - autorest.Response `json:"-"` - // SasURL - Returned sas url of the blob to which the p2s vpn connection detailed health will be written. - SasURL *string `json:"sasUrl,omitempty"` -} - -// P2SVpnConnectionHealthRequest list of P2S Vpn connection health request. -type P2SVpnConnectionHealthRequest struct { - // VpnUserNamesFilter - The list of p2s vpn user names whose p2s vpn connection detailed health to retrieve for. - VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"` - // OutputBlobSasURL - The sas-url to download the P2S Vpn connection health detail. - OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` -} - -// P2SVpnConnectionRequest list of p2s vpn connections to be disconnected. -type P2SVpnConnectionRequest struct { - // VpnConnectionIds - List of p2s vpn connection Ids. - VpnConnectionIds *[]string `json:"vpnConnectionIds,omitempty"` -} - -// P2SVpnGateway p2SVpnGateway Resource. -type P2SVpnGateway struct { - autorest.Response `json:"-"` - // P2SVpnGatewayProperties - Properties of the P2SVpnGateway. - *P2SVpnGatewayProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for P2SVpnGateway. -func (pvg P2SVpnGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pvg.P2SVpnGatewayProperties != nil { - objectMap["properties"] = pvg.P2SVpnGatewayProperties - } - if pvg.ID != nil { - objectMap["id"] = pvg.ID - } - if pvg.Location != nil { - objectMap["location"] = pvg.Location - } - if pvg.Tags != nil { - objectMap["tags"] = pvg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for P2SVpnGateway struct. -func (pvg *P2SVpnGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var p2SVpnGatewayProperties P2SVpnGatewayProperties - err = json.Unmarshal(*v, &p2SVpnGatewayProperties) - if err != nil { - return err - } - pvg.P2SVpnGatewayProperties = &p2SVpnGatewayProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pvg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pvg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pvg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pvg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pvg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pvg.Tags = tags - } - } - } - - return nil -} - -// P2SVpnGatewayProperties parameters for P2SVpnGateway. -type P2SVpnGatewayProperties struct { - // VirtualHub - The VirtualHub to which the gateway belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - // P2SConnectionConfigurations - List of all p2s connection configurations of the gateway. - P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the P2S VPN gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VpnGatewayScaleUnit - The scale unit for this p2s vpn gateway. - VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` - // VpnServerConfiguration - The VpnServerConfiguration to which the p2sVpnGateway is attached to. - VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` - // VpnClientConnectionHealth - READ-ONLY; All P2S VPN clients' connection health status. - VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` - // CustomDNSServers - List of all customer specified DNS servers IP addresses. - CustomDNSServers *[]string `json:"customDnsServers,omitempty"` - // IsRoutingPreferenceInternet - Enable Routing Preference property for the Public IP Interface of the P2SVpnGateway. - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` -} - -// MarshalJSON is the custom marshaler for P2SVpnGatewayProperties. -func (pvgp P2SVpnGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pvgp.VirtualHub != nil { - objectMap["virtualHub"] = pvgp.VirtualHub - } - if pvgp.P2SConnectionConfigurations != nil { - objectMap["p2SConnectionConfigurations"] = pvgp.P2SConnectionConfigurations - } - if pvgp.VpnGatewayScaleUnit != nil { - objectMap["vpnGatewayScaleUnit"] = pvgp.VpnGatewayScaleUnit - } - if pvgp.VpnServerConfiguration != nil { - objectMap["vpnServerConfiguration"] = pvgp.VpnServerConfiguration - } - if pvgp.CustomDNSServers != nil { - objectMap["customDnsServers"] = pvgp.CustomDNSServers - } - if pvgp.IsRoutingPreferenceInternet != nil { - objectMap["isRoutingPreferenceInternet"] = pvgp.IsRoutingPreferenceInternet - } - return json.Marshal(objectMap) -} - -// P2sVpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type P2sVpnGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysCreateOrUpdateFuture.Result. -func (future *P2sVpnGatewaysCreateOrUpdateFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pvg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pvg.Response.Response, err = future.GetResult(sender); err == nil && pvg.Response.Response.StatusCode != http.StatusNoContent { - pvg, err = client.CreateOrUpdateResponder(pvg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysCreateOrUpdateFuture", "Result", pvg.Response.Response, "Failure responding to request") - } - } - return -} - -// P2sVpnGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type P2sVpnGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysDeleteFuture.Result. -func (future *P2sVpnGatewaysDeleteFuture) result(client P2sVpnGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture.Result. -func (future *P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture) result(client P2sVpnGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture") - return - } - ar.Response = future.Response() - return -} - -// P2sVpnGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type P2sVpnGatewaysGenerateVpnProfileFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (VpnProfileResponse, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysGenerateVpnProfileFuture.Result. -func (future *P2sVpnGatewaysGenerateVpnProfileFuture) result(client P2sVpnGatewaysClient) (vpr VpnProfileResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vpr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGenerateVpnProfileFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vpr.Response.Response, err = future.GetResult(sender); err == nil && vpr.Response.Response.StatusCode != http.StatusNoContent { - vpr, err = client.GenerateVpnProfileResponder(vpr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGenerateVpnProfileFuture", "Result", vpr.Response.Response, "Failure responding to request") - } - } - return -} - -// P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (P2SVpnConnectionHealth, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture.Result. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture) result(client P2sVpnGatewaysClient) (pvch P2SVpnConnectionHealth, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pvch.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pvch.Response.Response, err = future.GetResult(sender); err == nil && pvch.Response.Response.StatusCode != http.StatusNoContent { - pvch, err = client.GetP2sVpnConnectionHealthDetailedResponder(pvch.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture", "Result", pvch.Response.Response, "Failure responding to request") - } - } - return -} - -// P2sVpnGatewaysGetP2sVpnConnectionHealthFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type P2sVpnGatewaysGetP2sVpnConnectionHealthFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysGetP2sVpnConnectionHealthFuture.Result. -func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pvg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pvg.Response.Response, err = future.GetResult(sender); err == nil && pvg.Response.Response.StatusCode != http.StatusNoContent { - pvg, err = client.GetP2sVpnConnectionHealthResponder(pvg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture", "Result", pvg.Response.Response, "Failure responding to request") - } - } - return -} - -// P2SVpnGatewaysResetFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type P2SVpnGatewaysResetFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2SVpnGatewaysResetFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2SVpnGatewaysResetFuture.Result. -func (future *P2SVpnGatewaysResetFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2SVpnGatewaysResetFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pvg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2SVpnGatewaysResetFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pvg.Response.Response, err = future.GetResult(sender); err == nil && pvg.Response.Response.StatusCode != http.StatusNoContent { - pvg, err = client.ResetResponder(pvg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2SVpnGatewaysResetFuture", "Result", pvg.Response.Response, "Failure responding to request") - } - } - return -} - -// P2sVpnGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type P2sVpnGatewaysUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *P2sVpnGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for P2sVpnGatewaysUpdateTagsFuture.Result. -func (future *P2sVpnGatewaysUpdateTagsFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pvg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pvg.Response.Response, err = future.GetResult(sender); err == nil && pvg.Response.Response.StatusCode != http.StatusNoContent { - pvg, err = client.UpdateTagsResponder(pvg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysUpdateTagsFuture", "Result", pvg.Response.Response, "Failure responding to request") - } - } - return -} - -// P2SVpnProfileParameters vpn Client Parameters for package generation. -type P2SVpnProfileParameters struct { - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' - AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` -} - -// PacketCapture parameters that define the create packet capture operation. -type PacketCapture struct { - // PacketCaptureParameters - Properties of the packet capture. - *PacketCaptureParameters `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for PacketCapture. -func (pc PacketCapture) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pc.PacketCaptureParameters != nil { - objectMap["properties"] = pc.PacketCaptureParameters - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PacketCapture struct. -func (pc *PacketCapture) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var packetCaptureParameters PacketCaptureParameters - err = json.Unmarshal(*v, &packetCaptureParameters) - if err != nil { - return err - } - pc.PacketCaptureParameters = &packetCaptureParameters - } - } - } - - return nil -} - -// PacketCaptureFilter filter that is applied to packet capture request. Multiple filters can be applied. -type PacketCaptureFilter struct { - // Protocol - Protocol to be filtered on. Possible values include: 'PcProtocolTCP', 'PcProtocolUDP', 'PcProtocolAny' - Protocol PcProtocol `json:"protocol,omitempty"` - // LocalIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - LocalIPAddress *string `json:"localIPAddress,omitempty"` - // RemoteIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` - // LocalPort - Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - LocalPort *string `json:"localPort,omitempty"` - // RemotePort - Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. - RemotePort *string `json:"remotePort,omitempty"` -} - -// PacketCaptureListResult list of packet capture sessions. -type PacketCaptureListResult struct { - autorest.Response `json:"-"` - // Value - Information about packet capture sessions. - Value *[]PacketCaptureResult `json:"value,omitempty"` -} - -// PacketCaptureMachineScope a list of AzureVMSS instances which can be included or excluded to run packet -// capture. If both included and excluded are empty, then the packet capture will run on all instances of -// AzureVMSS. -type PacketCaptureMachineScope struct { - // Include - List of AzureVMSS instances to run packet capture on. - Include *[]string `json:"include,omitempty"` - // Exclude - List of AzureVMSS instances which has to be excluded from the AzureVMSS from running packet capture. - Exclude *[]string `json:"exclude,omitempty"` -} - -// PacketCaptureParameters parameters that define the create packet capture operation. -type PacketCaptureParameters struct { - // Target - The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. - Target *string `json:"target,omitempty"` - // Scope - A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. - Scope *PacketCaptureMachineScope `json:"scope,omitempty"` - // TargetType - Target type of the resource provided. Possible values include: 'PacketCaptureTargetTypeAzureVM', 'PacketCaptureTargetTypeAzureVMSS' - TargetType PacketCaptureTargetType `json:"targetType,omitempty"` - // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. - BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` - // TotalBytesPerSession - Maximum size of the capture output. - TotalBytesPerSession *int64 `json:"totalBytesPerSession,omitempty"` - // TimeLimitInSeconds - Maximum duration of the capture session in seconds. - TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` - // StorageLocation - The storage location for a packet capture session. - StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` - // Filters - A list of packet capture filters. - Filters *[]PacketCaptureFilter `json:"filters,omitempty"` -} - -// PacketCaptureQueryStatusResult status of packet capture session. -type PacketCaptureQueryStatusResult struct { - autorest.Response `json:"-"` - // Name - The name of the packet capture resource. - Name *string `json:"name,omitempty"` - // ID - The ID of the packet capture resource. - ID *string `json:"id,omitempty"` - // CaptureStartTime - The start time of the packet capture session. - CaptureStartTime *date.Time `json:"captureStartTime,omitempty"` - // PacketCaptureStatus - The status of the packet capture session. Possible values include: 'PcStatusNotStarted', 'PcStatusRunning', 'PcStatusStopped', 'PcStatusError', 'PcStatusUnknown' - PacketCaptureStatus PcStatus `json:"packetCaptureStatus,omitempty"` - // StopReason - The reason the current packet capture session was stopped. - StopReason *string `json:"stopReason,omitempty"` - // PacketCaptureError - List of errors of packet capture session. - PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"` -} - -// PacketCaptureResult information about packet capture session. -type PacketCaptureResult struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; Name of the packet capture session. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; ID of the packet capture operation. - ID *string `json:"id,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // PacketCaptureResultProperties - Properties of the packet capture result. - *PacketCaptureResultProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for PacketCaptureResult. -func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pcr.PacketCaptureResultProperties != nil { - objectMap["properties"] = pcr.PacketCaptureResultProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PacketCaptureResult struct. -func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pcr.Name = &name - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pcr.ID = &ID - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pcr.Etag = &etag - } - case "properties": - if v != nil { - var packetCaptureResultProperties PacketCaptureResultProperties - err = json.Unmarshal(*v, &packetCaptureResultProperties) - if err != nil { - return err - } - pcr.PacketCaptureResultProperties = &packetCaptureResultProperties - } - } - } - - return nil -} - -// PacketCaptureResultProperties the properties of a packet capture session. -type PacketCaptureResultProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the packet capture session. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Target - The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. - Target *string `json:"target,omitempty"` - // Scope - A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. - Scope *PacketCaptureMachineScope `json:"scope,omitempty"` - // TargetType - Target type of the resource provided. Possible values include: 'PacketCaptureTargetTypeAzureVM', 'PacketCaptureTargetTypeAzureVMSS' - TargetType PacketCaptureTargetType `json:"targetType,omitempty"` - // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. - BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` - // TotalBytesPerSession - Maximum size of the capture output. - TotalBytesPerSession *int64 `json:"totalBytesPerSession,omitempty"` - // TimeLimitInSeconds - Maximum duration of the capture session in seconds. - TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` - // StorageLocation - The storage location for a packet capture session. - StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` - // Filters - A list of packet capture filters. - Filters *[]PacketCaptureFilter `json:"filters,omitempty"` -} - -// MarshalJSON is the custom marshaler for PacketCaptureResultProperties. -func (pcrp PacketCaptureResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pcrp.Target != nil { - objectMap["target"] = pcrp.Target - } - if pcrp.Scope != nil { - objectMap["scope"] = pcrp.Scope - } - if pcrp.TargetType != "" { - objectMap["targetType"] = pcrp.TargetType - } - if pcrp.BytesToCapturePerPacket != nil { - objectMap["bytesToCapturePerPacket"] = pcrp.BytesToCapturePerPacket - } - if pcrp.TotalBytesPerSession != nil { - objectMap["totalBytesPerSession"] = pcrp.TotalBytesPerSession - } - if pcrp.TimeLimitInSeconds != nil { - objectMap["timeLimitInSeconds"] = pcrp.TimeLimitInSeconds - } - if pcrp.StorageLocation != nil { - objectMap["storageLocation"] = pcrp.StorageLocation - } - if pcrp.Filters != nil { - objectMap["filters"] = pcrp.Filters - } - return json.Marshal(objectMap) -} - -// PacketCapturesCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PacketCapturesCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PacketCapturesClient) (PacketCaptureResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PacketCapturesCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PacketCapturesCreateFuture.Result. -func (future *PacketCapturesCreateFuture) result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pcr.Response.Response, err = future.GetResult(sender); err == nil && pcr.Response.Response.StatusCode != http.StatusNoContent { - pcr, err = client.CreateResponder(pcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", pcr.Response.Response, "Failure responding to request") - } - } - return -} - -// PacketCapturesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PacketCapturesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PacketCapturesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PacketCapturesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PacketCapturesDeleteFuture.Result. -func (future *PacketCapturesDeleteFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PacketCapturesGetStatusFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PacketCapturesClient) (PacketCaptureQueryStatusResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PacketCapturesGetStatusFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PacketCapturesGetStatusFuture.Result. -func (future *PacketCapturesGetStatusFuture) result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pcqsr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pcqsr.Response.Response, err = future.GetResult(sender); err == nil && pcqsr.Response.Response.StatusCode != http.StatusNoContent { - pcqsr, err = client.GetStatusResponder(pcqsr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", pcqsr.Response.Response, "Failure responding to request") - } - } - return -} - -// PacketCapturesStopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PacketCapturesStopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PacketCapturesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PacketCapturesStopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PacketCapturesStopFuture.Result. -func (future *PacketCapturesStopFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture") - return - } - ar.Response = future.Response() - return -} - -// PacketCaptureStorageLocation the storage location for a packet capture session. -type PacketCaptureStorageLocation struct { - // StorageID - The ID of the storage account to save the packet capture session. Required if no local file path is provided. - StorageID *string `json:"storageId,omitempty"` - // StoragePath - The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. - StoragePath *string `json:"storagePath,omitempty"` - // FilePath - A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. - FilePath *string `json:"filePath,omitempty"` -} - -// Parameter parameters for an Action. -type Parameter struct { - // RoutePrefix - List of route prefixes. - RoutePrefix *[]string `json:"routePrefix,omitempty"` - // Community - List of BGP communities. - Community *[]string `json:"community,omitempty"` - // AsPath - List of AS paths. - AsPath *[]string `json:"asPath,omitempty"` -} - -// PartnerManagedResourceProperties properties of the partner managed resource. -type PartnerManagedResourceProperties struct { - // ID - READ-ONLY; The partner managed resource id. - ID *string `json:"id,omitempty"` - // InternalLoadBalancerID - READ-ONLY; The partner managed ILB resource id - InternalLoadBalancerID *string `json:"internalLoadBalancerId,omitempty"` - // StandardLoadBalancerID - READ-ONLY; The partner managed SLB resource id - StandardLoadBalancerID *string `json:"standardLoadBalancerId,omitempty"` -} - -// MarshalJSON is the custom marshaler for PartnerManagedResourceProperties. -func (pmrp PartnerManagedResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PatchObject object for patch operations. -type PatchObject struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PatchObject. -func (po PatchObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if po.Tags != nil { - objectMap["tags"] = po.Tags - } - return json.Marshal(objectMap) -} - -// PatchRouteFilter route Filter Resource. -type PatchRouteFilter struct { - // RouteFilterPropertiesFormat - Properties of the route filter. - *RouteFilterPropertiesFormat `json:"properties,omitempty"` - // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PatchRouteFilter. -func (prf PatchRouteFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if prf.RouteFilterPropertiesFormat != nil { - objectMap["properties"] = prf.RouteFilterPropertiesFormat - } - if prf.Tags != nil { - objectMap["tags"] = prf.Tags - } - if prf.ID != nil { - objectMap["id"] = prf.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PatchRouteFilter struct. -func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeFilterPropertiesFormat RouteFilterPropertiesFormat - err = json.Unmarshal(*v, &routeFilterPropertiesFormat) - if err != nil { - return err - } - prf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - prf.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - prf.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - prf.Type = &typeVar - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - prf.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - prf.ID = &ID - } - } - } - - return nil -} - -// PatchRouteFilterRule route Filter Rule Resource. -type PatchRouteFilterRule struct { - // RouteFilterRulePropertiesFormat - Properties of the route filter rule. - *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` - // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PatchRouteFilterRule. -func (prfr PatchRouteFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if prfr.RouteFilterRulePropertiesFormat != nil { - objectMap["properties"] = prfr.RouteFilterRulePropertiesFormat - } - if prfr.ID != nil { - objectMap["id"] = prfr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PatchRouteFilterRule struct. -func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat - err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) - if err != nil { - return err - } - prfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - prfr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - prfr.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - prfr.ID = &ID - } - } - } - - return nil -} - -// PeerExpressRouteCircuitConnection peer Express Route Circuit Connection in an ExpressRouteCircuitPeering -// resource. -type PeerExpressRouteCircuitConnection struct { - autorest.Response `json:"-"` - // PeerExpressRouteCircuitConnectionPropertiesFormat - Properties of the peer express route circuit connection. - *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PeerExpressRouteCircuitConnection. -func (percc PeerExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if percc.PeerExpressRouteCircuitConnectionPropertiesFormat != nil { - objectMap["properties"] = percc.PeerExpressRouteCircuitConnectionPropertiesFormat - } - if percc.Name != nil { - objectMap["name"] = percc.Name - } - if percc.ID != nil { - objectMap["id"] = percc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PeerExpressRouteCircuitConnection struct. -func (percc *PeerExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var peerExpressRouteCircuitConnectionPropertiesFormat PeerExpressRouteCircuitConnectionPropertiesFormat - err = json.Unmarshal(*v, &peerExpressRouteCircuitConnectionPropertiesFormat) - if err != nil { - return err - } - percc.PeerExpressRouteCircuitConnectionPropertiesFormat = &peerExpressRouteCircuitConnectionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - percc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - percc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - percc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - percc.ID = &ID - } - } - } - - return nil -} - -// PeerExpressRouteCircuitConnectionListResult response for ListPeeredConnections API service call -// retrieves all global reach peer circuit connections that belongs to a Private Peering for an -// ExpressRouteCircuit. -type PeerExpressRouteCircuitConnectionListResult struct { - autorest.Response `json:"-"` - // Value - The global reach peer circuit connection associated with Private Peering in an ExpressRoute Circuit. - Value *[]PeerExpressRouteCircuitConnection `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// PeerExpressRouteCircuitConnectionListResultIterator provides access to a complete listing of -// PeerExpressRouteCircuitConnection values. -type PeerExpressRouteCircuitConnectionListResultIterator struct { - i int - page PeerExpressRouteCircuitConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PeerExpressRouteCircuitConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PeerExpressRouteCircuitConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PeerExpressRouteCircuitConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PeerExpressRouteCircuitConnectionListResultIterator) Response() PeerExpressRouteCircuitConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PeerExpressRouteCircuitConnectionListResultIterator) Value() PeerExpressRouteCircuitConnection { - if !iter.page.NotDone() { - return PeerExpressRouteCircuitConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PeerExpressRouteCircuitConnectionListResultIterator type. -func NewPeerExpressRouteCircuitConnectionListResultIterator(page PeerExpressRouteCircuitConnectionListResultPage) PeerExpressRouteCircuitConnectionListResultIterator { - return PeerExpressRouteCircuitConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (percclr PeerExpressRouteCircuitConnectionListResult) IsEmpty() bool { - return percclr.Value == nil || len(*percclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (percclr PeerExpressRouteCircuitConnectionListResult) hasNextLink() bool { - return percclr.NextLink != nil && len(*percclr.NextLink) != 0 -} - -// peerExpressRouteCircuitConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (percclr PeerExpressRouteCircuitConnectionListResult) peerExpressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !percclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(percclr.NextLink))) -} - -// PeerExpressRouteCircuitConnectionListResultPage contains a page of PeerExpressRouteCircuitConnection -// values. -type PeerExpressRouteCircuitConnectionListResultPage struct { - fn func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error) - percclr PeerExpressRouteCircuitConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PeerExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.percclr) - if err != nil { - return err - } - page.percclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PeerExpressRouteCircuitConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PeerExpressRouteCircuitConnectionListResultPage) NotDone() bool { - return !page.percclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PeerExpressRouteCircuitConnectionListResultPage) Response() PeerExpressRouteCircuitConnectionListResult { - return page.percclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PeerExpressRouteCircuitConnectionListResultPage) Values() []PeerExpressRouteCircuitConnection { - if page.percclr.IsEmpty() { - return nil - } - return *page.percclr.Value -} - -// Creates a new instance of the PeerExpressRouteCircuitConnectionListResultPage type. -func NewPeerExpressRouteCircuitConnectionListResultPage(cur PeerExpressRouteCircuitConnectionListResult, getNextPage func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error)) PeerExpressRouteCircuitConnectionListResultPage { - return PeerExpressRouteCircuitConnectionListResultPage{ - fn: getNextPage, - percclr: cur, - } -} - -// PeerExpressRouteCircuitConnectionPropertiesFormat properties of the peer express route circuit -// connection. -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - // ExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the circuit. - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - // PeerExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the peered circuit. - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - // AddressPrefix - /29 IP address space to carve out Customer addresses for tunnels. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' - CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - // ConnectionName - The name of the express route circuit connection resource. - ConnectionName *string `json:"connectionName,omitempty"` - // AuthResourceGUID - The resource guid of the authorization used for the express route circuit connection. - AuthResourceGUID *string `json:"authResourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the peer express route circuit connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PeerExpressRouteCircuitConnectionPropertiesFormat. -func (perccpf PeerExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if perccpf.ExpressRouteCircuitPeering != nil { - objectMap["expressRouteCircuitPeering"] = perccpf.ExpressRouteCircuitPeering - } - if perccpf.PeerExpressRouteCircuitPeering != nil { - objectMap["peerExpressRouteCircuitPeering"] = perccpf.PeerExpressRouteCircuitPeering - } - if perccpf.AddressPrefix != nil { - objectMap["addressPrefix"] = perccpf.AddressPrefix - } - if perccpf.CircuitConnectionStatus != "" { - objectMap["circuitConnectionStatus"] = perccpf.CircuitConnectionStatus - } - if perccpf.ConnectionName != nil { - objectMap["connectionName"] = perccpf.ConnectionName - } - if perccpf.AuthResourceGUID != nil { - objectMap["authResourceGuid"] = perccpf.AuthResourceGUID - } - return json.Marshal(objectMap) -} - -// PeerRoute peer routing details. -type PeerRoute struct { - // LocalAddress - READ-ONLY; The peer's local address. - LocalAddress *string `json:"localAddress,omitempty"` - // NetworkProperty - READ-ONLY; The route's network prefix. - NetworkProperty *string `json:"network,omitempty"` - // NextHop - READ-ONLY; The route's next hop. - NextHop *string `json:"nextHop,omitempty"` - // SourcePeer - READ-ONLY; The peer this route was learned from. - SourcePeer *string `json:"sourcePeer,omitempty"` - // Origin - READ-ONLY; The source this route was learned from. - Origin *string `json:"origin,omitempty"` - // AsPath - READ-ONLY; The route's AS path sequence. - AsPath *string `json:"asPath,omitempty"` - // Weight - READ-ONLY; The route's weight. - Weight *int32 `json:"weight,omitempty"` -} - -// MarshalJSON is the custom marshaler for PeerRoute. -func (pr PeerRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// PeerRouteList list of virtual router peer routes. -type PeerRouteList struct { - autorest.Response `json:"-"` - // Value - List of peer routes. - Value *[]PeerRoute `json:"value,omitempty"` -} - -// PolicySettings defines contents of a web application firewall global configuration. -type PolicySettings struct { - // State - The state of the policy. Possible values include: 'WebApplicationFirewallEnabledStateDisabled', 'WebApplicationFirewallEnabledStateEnabled' - State WebApplicationFirewallEnabledState `json:"state,omitempty"` - // Mode - The mode of the policy. Possible values include: 'WebApplicationFirewallModePrevention', 'WebApplicationFirewallModeDetection' - Mode WebApplicationFirewallMode `json:"mode,omitempty"` - // RequestBodyCheck - Whether to allow WAF to check request Body. - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - // MaxRequestBodySizeInKb - Maximum request body size in Kb for WAF. - MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"` - // FileUploadLimitInMb - Maximum file upload size in Mb for WAF. - FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"` - // CustomBlockResponseStatusCode - If the action type is block, customer can override the response status code. - CustomBlockResponseStatusCode *int32 `json:"customBlockResponseStatusCode,omitempty"` - // CustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. - CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` -} - -// PrepareNetworkPoliciesRequest details of PrepareNetworkPolicies for Subnet. -type PrepareNetworkPoliciesRequest struct { - // ServiceName - The name of the service for which subnet is being prepared for. - ServiceName *string `json:"serviceName,omitempty"` - // NetworkIntentPolicyConfigurations - A list of NetworkIntentPolicyConfiguration. - NetworkIntentPolicyConfigurations *[]IntentPolicyConfiguration `json:"networkIntentPolicyConfigurations,omitempty"` -} - -// PrivateDNSZoneConfig privateDnsZoneConfig resource. -type PrivateDNSZoneConfig struct { - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // PrivateDNSZonePropertiesFormat - Properties of the private dns zone configuration. - *PrivateDNSZonePropertiesFormat `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZoneConfig. -func (pdzc PrivateDNSZoneConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzc.Name != nil { - objectMap["name"] = pdzc.Name - } - if pdzc.PrivateDNSZonePropertiesFormat != nil { - objectMap["properties"] = pdzc.PrivateDNSZonePropertiesFormat - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateDNSZoneConfig struct. -func (pdzc *PrivateDNSZoneConfig) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pdzc.Name = &name - } - case "properties": - if v != nil { - var privateDNSZonePropertiesFormat PrivateDNSZonePropertiesFormat - err = json.Unmarshal(*v, &privateDNSZonePropertiesFormat) - if err != nil { - return err - } - pdzc.PrivateDNSZonePropertiesFormat = &privateDNSZonePropertiesFormat - } - } - } - - return nil -} - -// PrivateDNSZoneGroup private dns zone group resource. -type PrivateDNSZoneGroup struct { - autorest.Response `json:"-"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // PrivateDNSZoneGroupPropertiesFormat - Properties of the private dns zone group. - *PrivateDNSZoneGroupPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZoneGroup. -func (pdzg PrivateDNSZoneGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzg.Name != nil { - objectMap["name"] = pdzg.Name - } - if pdzg.PrivateDNSZoneGroupPropertiesFormat != nil { - objectMap["properties"] = pdzg.PrivateDNSZoneGroupPropertiesFormat - } - if pdzg.ID != nil { - objectMap["id"] = pdzg.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateDNSZoneGroup struct. -func (pdzg *PrivateDNSZoneGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pdzg.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pdzg.Etag = &etag - } - case "properties": - if v != nil { - var privateDNSZoneGroupPropertiesFormat PrivateDNSZoneGroupPropertiesFormat - err = json.Unmarshal(*v, &privateDNSZoneGroupPropertiesFormat) - if err != nil { - return err - } - pdzg.PrivateDNSZoneGroupPropertiesFormat = &privateDNSZoneGroupPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pdzg.ID = &ID - } - } - } - - return nil -} - -// PrivateDNSZoneGroupListResult response for the ListPrivateDnsZoneGroups API service call. -type PrivateDNSZoneGroupListResult struct { - autorest.Response `json:"-"` - // Value - A list of private dns zone group resources in a private endpoint. - Value *[]PrivateDNSZoneGroup `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZoneGroupListResult. -func (pdzglr PrivateDNSZoneGroupListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzglr.Value != nil { - objectMap["value"] = pdzglr.Value - } - return json.Marshal(objectMap) -} - -// PrivateDNSZoneGroupListResultIterator provides access to a complete listing of PrivateDNSZoneGroup -// values. -type PrivateDNSZoneGroupListResultIterator struct { - i int - page PrivateDNSZoneGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateDNSZoneGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateDNSZoneGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateDNSZoneGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateDNSZoneGroupListResultIterator) Response() PrivateDNSZoneGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateDNSZoneGroupListResultIterator) Value() PrivateDNSZoneGroup { - if !iter.page.NotDone() { - return PrivateDNSZoneGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateDNSZoneGroupListResultIterator type. -func NewPrivateDNSZoneGroupListResultIterator(page PrivateDNSZoneGroupListResultPage) PrivateDNSZoneGroupListResultIterator { - return PrivateDNSZoneGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pdzglr PrivateDNSZoneGroupListResult) IsEmpty() bool { - return pdzglr.Value == nil || len(*pdzglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pdzglr PrivateDNSZoneGroupListResult) hasNextLink() bool { - return pdzglr.NextLink != nil && len(*pdzglr.NextLink) != 0 -} - -// privateDNSZoneGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pdzglr PrivateDNSZoneGroupListResult) privateDNSZoneGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !pdzglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pdzglr.NextLink))) -} - -// PrivateDNSZoneGroupListResultPage contains a page of PrivateDNSZoneGroup values. -type PrivateDNSZoneGroupListResultPage struct { - fn func(context.Context, PrivateDNSZoneGroupListResult) (PrivateDNSZoneGroupListResult, error) - pdzglr PrivateDNSZoneGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateDNSZoneGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pdzglr) - if err != nil { - return err - } - page.pdzglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateDNSZoneGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateDNSZoneGroupListResultPage) NotDone() bool { - return !page.pdzglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateDNSZoneGroupListResultPage) Response() PrivateDNSZoneGroupListResult { - return page.pdzglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateDNSZoneGroupListResultPage) Values() []PrivateDNSZoneGroup { - if page.pdzglr.IsEmpty() { - return nil - } - return *page.pdzglr.Value -} - -// Creates a new instance of the PrivateDNSZoneGroupListResultPage type. -func NewPrivateDNSZoneGroupListResultPage(cur PrivateDNSZoneGroupListResult, getNextPage func(context.Context, PrivateDNSZoneGroupListResult) (PrivateDNSZoneGroupListResult, error)) PrivateDNSZoneGroupListResultPage { - return PrivateDNSZoneGroupListResultPage{ - fn: getNextPage, - pdzglr: cur, - } -} - -// PrivateDNSZoneGroupPropertiesFormat properties of the private dns zone group. -type PrivateDNSZoneGroupPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the private dns zone group resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateDNSZoneConfigs - A collection of private dns zone configurations of the private dns zone group. - PrivateDNSZoneConfigs *[]PrivateDNSZoneConfig `json:"privateDnsZoneConfigs,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZoneGroupPropertiesFormat. -func (pdzgpf PrivateDNSZoneGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzgpf.PrivateDNSZoneConfigs != nil { - objectMap["privateDnsZoneConfigs"] = pdzgpf.PrivateDNSZoneConfigs - } - return json.Marshal(objectMap) -} - -// PrivateDNSZoneGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateDNSZoneGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateDNSZoneGroupsClient) (PrivateDNSZoneGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateDNSZoneGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateDNSZoneGroupsCreateOrUpdateFuture.Result. -func (future *PrivateDNSZoneGroupsCreateOrUpdateFuture) result(client PrivateDNSZoneGroupsClient) (pdzg PrivateDNSZoneGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pdzg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateDNSZoneGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pdzg.Response.Response, err = future.GetResult(sender); err == nil && pdzg.Response.Response.StatusCode != http.StatusNoContent { - pdzg, err = client.CreateOrUpdateResponder(pdzg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsCreateOrUpdateFuture", "Result", pdzg.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateDNSZoneGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateDNSZoneGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateDNSZoneGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateDNSZoneGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateDNSZoneGroupsDeleteFuture.Result. -func (future *PrivateDNSZoneGroupsDeleteFuture) result(client PrivateDNSZoneGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateDNSZoneGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateDNSZonePropertiesFormat properties of the private dns zone configuration resource. -type PrivateDNSZonePropertiesFormat struct { - // PrivateDNSZoneID - The resource id of the private dns zone. - PrivateDNSZoneID *string `json:"privateDnsZoneId,omitempty"` - // RecordSets - READ-ONLY; A collection of information regarding a recordSet, holding information to identify private resources. - RecordSets *[]RecordSet `json:"recordSets,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateDNSZonePropertiesFormat. -func (pdzpf PrivateDNSZonePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pdzpf.PrivateDNSZoneID != nil { - objectMap["privateDnsZoneId"] = pdzpf.PrivateDNSZoneID - } - return json.Marshal(objectMap) -} - -// PrivateEndpoint private endpoint resource. -type PrivateEndpoint struct { - autorest.Response `json:"-"` - // ExtendedLocation - The extended location of the load balancer. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // PrivateEndpointProperties - Properties of the private endpoint. - *PrivateEndpointProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpoint. -func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if peVar.ExtendedLocation != nil { - objectMap["extendedLocation"] = peVar.ExtendedLocation - } - if peVar.PrivateEndpointProperties != nil { - objectMap["properties"] = peVar.PrivateEndpointProperties - } - if peVar.ID != nil { - objectMap["id"] = peVar.ID - } - if peVar.Location != nil { - objectMap["location"] = peVar.Location - } - if peVar.Tags != nil { - objectMap["tags"] = peVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpoint struct. -func (peVar *PrivateEndpoint) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - peVar.ExtendedLocation = &extendedLocation - } - case "properties": - if v != nil { - var privateEndpointProperties PrivateEndpointProperties - err = json.Unmarshal(*v, &privateEndpointProperties) - if err != nil { - return err - } - peVar.PrivateEndpointProperties = &privateEndpointProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - peVar.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - peVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - peVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - peVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - peVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - peVar.Tags = tags - } - } - } - - return nil -} - -// PrivateEndpointConnection privateEndpointConnection resource. -type PrivateEndpointConnection struct { - autorest.Response `json:"-"` - // PrivateEndpointConnectionProperties - Properties of the private end point connection. - *PrivateEndpointConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnection. -func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pec.PrivateEndpointConnectionProperties != nil { - objectMap["properties"] = pec.PrivateEndpointConnectionProperties - } - if pec.Name != nil { - objectMap["name"] = pec.Name - } - if pec.ID != nil { - objectMap["id"] = pec.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. -func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointConnectionProperties PrivateEndpointConnectionProperties - err = json.Unmarshal(*v, &privateEndpointConnectionProperties) - if err != nil { - return err - } - pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pec.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pec.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pec.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pec.ID = &ID - } - } - } - - return nil -} - -// PrivateEndpointConnectionListResult response for the ListPrivateEndpointConnection API service call. -type PrivateEndpointConnectionListResult struct { - autorest.Response `json:"-"` - // Value - A list of PrivateEndpointConnection resources for a specific private link service. - Value *[]PrivateEndpointConnection `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionListResult. -func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if peclr.Value != nil { - objectMap["value"] = peclr.Value - } - return json.Marshal(objectMap) -} - -// PrivateEndpointConnectionListResultIterator provides access to a complete listing of -// PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultIterator struct { - i int - page PrivateEndpointConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateEndpointConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { - if !iter.page.NotDone() { - return PrivateEndpointConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. -func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { - return PrivateEndpointConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { - return peclr.Value == nil || len(*peclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { - return peclr.NextLink != nil && len(*peclr.NextLink) != 0 -} - -// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !peclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(peclr.NextLink))) -} - -// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. -type PrivateEndpointConnectionListResultPage struct { - fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) - peclr PrivateEndpointConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.peclr) - if err != nil { - return err - } - page.peclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateEndpointConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointConnectionListResultPage) NotDone() bool { - return !page.peclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { - return page.peclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { - if page.peclr.IsEmpty() { - return nil - } - return *page.peclr.Value -} - -// Creates a new instance of the PrivateEndpointConnectionListResultPage type. -func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { - return PrivateEndpointConnectionListResultPage{ - fn: getNextPage, - peclr: cur, - } -} - -// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. -type PrivateEndpointConnectionProperties struct { - // PrivateEndpoint - READ-ONLY; The resource of private end point. - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // LinkIdentifier - READ-ONLY; The consumer link id. - LinkIdentifier *string `json:"linkIdentifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. -func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pecp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState - } - return json.Marshal(objectMap) -} - -// PrivateEndpointIPConfiguration an IP Configuration of the private endpoint. -type PrivateEndpointIPConfiguration struct { - // PrivateEndpointIPConfigurationProperties - Properties of private endpoint IP configurations. - *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointIPConfiguration. -func (peic PrivateEndpointIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if peic.PrivateEndpointIPConfigurationProperties != nil { - objectMap["properties"] = peic.PrivateEndpointIPConfigurationProperties - } - if peic.Name != nil { - objectMap["name"] = peic.Name - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateEndpointIPConfiguration struct. -func (peic *PrivateEndpointIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateEndpointIPConfigurationProperties PrivateEndpointIPConfigurationProperties - err = json.Unmarshal(*v, &privateEndpointIPConfigurationProperties) - if err != nil { - return err - } - peic.PrivateEndpointIPConfigurationProperties = &privateEndpointIPConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - peic.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - peic.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - peic.Etag = &etag - } - } - } - - return nil -} - -// PrivateEndpointIPConfigurationProperties properties of an IP Configuration of the private endpoint. -type PrivateEndpointIPConfigurationProperties struct { - // GroupID - The ID of a group obtained from the remote resource that this private endpoint should connect to. - GroupID *string `json:"groupId,omitempty"` - // MemberName - The member name of a group obtained from the remote resource that this private endpoint should connect to. - MemberName *string `json:"memberName,omitempty"` - // PrivateIPAddress - A private ip address obtained from the private endpoint's subnet. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} - -// PrivateEndpointListResult response for the ListPrivateEndpoints API service call. -type PrivateEndpointListResult struct { - autorest.Response `json:"-"` - // Value - A list of private endpoint resources in a resource group. - Value *[]PrivateEndpoint `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointListResult. -func (pelr PrivateEndpointListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pelr.Value != nil { - objectMap["value"] = pelr.Value - } - return json.Marshal(objectMap) -} - -// PrivateEndpointListResultIterator provides access to a complete listing of PrivateEndpoint values. -type PrivateEndpointListResultIterator struct { - i int - page PrivateEndpointListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateEndpointListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateEndpointListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateEndpointListResultIterator) Response() PrivateEndpointListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateEndpointListResultIterator) Value() PrivateEndpoint { - if !iter.page.NotDone() { - return PrivateEndpoint{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateEndpointListResultIterator type. -func NewPrivateEndpointListResultIterator(page PrivateEndpointListResultPage) PrivateEndpointListResultIterator { - return PrivateEndpointListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pelr PrivateEndpointListResult) IsEmpty() bool { - return pelr.Value == nil || len(*pelr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pelr PrivateEndpointListResult) hasNextLink() bool { - return pelr.NextLink != nil && len(*pelr.NextLink) != 0 -} - -// privateEndpointListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pelr PrivateEndpointListResult) privateEndpointListResultPreparer(ctx context.Context) (*http.Request, error) { - if !pelr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pelr.NextLink))) -} - -// PrivateEndpointListResultPage contains a page of PrivateEndpoint values. -type PrivateEndpointListResultPage struct { - fn func(context.Context, PrivateEndpointListResult) (PrivateEndpointListResult, error) - pelr PrivateEndpointListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateEndpointListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pelr) - if err != nil { - return err - } - page.pelr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateEndpointListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateEndpointListResultPage) NotDone() bool { - return !page.pelr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateEndpointListResultPage) Response() PrivateEndpointListResult { - return page.pelr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateEndpointListResultPage) Values() []PrivateEndpoint { - if page.pelr.IsEmpty() { - return nil - } - return *page.pelr.Value -} - -// Creates a new instance of the PrivateEndpointListResultPage type. -func NewPrivateEndpointListResultPage(cur PrivateEndpointListResult, getNextPage func(context.Context, PrivateEndpointListResult) (PrivateEndpointListResult, error)) PrivateEndpointListResultPage { - return PrivateEndpointListResultPage{ - fn: getNextPage, - pelr: cur, - } -} - -// PrivateEndpointProperties properties of the private endpoint. -type PrivateEndpointProperties struct { - // Subnet - The ID of the subnet from which the private IP will be allocated. - Subnet *Subnet `json:"subnet,omitempty"` - // NetworkInterfaces - READ-ONLY; An array of references to the network interfaces created for this private endpoint. - NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private endpoint resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateLinkServiceConnections - A grouping of information about the connection to the remote resource. - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - // ManualPrivateLinkServiceConnections - A grouping of information about the connection to the remote resource. Used when the network admin does not have access to approve connections to the remote resource. - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - // CustomDNSConfigs - An array of custom dns configurations. - CustomDNSConfigs *[]CustomDNSConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - // ApplicationSecurityGroups - Application security groups in which the private endpoint IP configuration is included. - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - // IPConfigurations - A list of IP configurations of the private endpoint. This will be used to map to the First Party Service's endpoints. - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - // CustomNetworkInterfaceName - The custom name of the network interface attached to the private endpoint. - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateEndpointProperties. -func (pep PrivateEndpointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pep.Subnet != nil { - objectMap["subnet"] = pep.Subnet - } - if pep.PrivateLinkServiceConnections != nil { - objectMap["privateLinkServiceConnections"] = pep.PrivateLinkServiceConnections - } - if pep.ManualPrivateLinkServiceConnections != nil { - objectMap["manualPrivateLinkServiceConnections"] = pep.ManualPrivateLinkServiceConnections - } - if pep.CustomDNSConfigs != nil { - objectMap["customDnsConfigs"] = pep.CustomDNSConfigs - } - if pep.ApplicationSecurityGroups != nil { - objectMap["applicationSecurityGroups"] = pep.ApplicationSecurityGroups - } - if pep.IPConfigurations != nil { - objectMap["ipConfigurations"] = pep.IPConfigurations - } - if pep.CustomNetworkInterfaceName != nil { - objectMap["customNetworkInterfaceName"] = pep.CustomNetworkInterfaceName - } - return json.Marshal(objectMap) -} - -// PrivateEndpointsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateEndpointsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointsClient) (PrivateEndpoint, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointsCreateOrUpdateFuture.Result. -func (future *PrivateEndpointsCreateOrUpdateFuture) result(client PrivateEndpointsClient) (peVar PrivateEndpoint, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - peVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateEndpointsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if peVar.Response.Response, err = future.GetResult(sender); err == nil && peVar.Response.Response.StatusCode != http.StatusNoContent { - peVar, err = client.CreateOrUpdateResponder(peVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsCreateOrUpdateFuture", "Result", peVar.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PrivateEndpointsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateEndpointsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateEndpointsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateEndpointsDeleteFuture.Result. -func (future *PrivateEndpointsDeleteFuture) result(client PrivateEndpointsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateEndpointsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateLinkService private link service resource. -type PrivateLinkService struct { - autorest.Response `json:"-"` - // ExtendedLocation - The extended location of the load balancer. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // PrivateLinkServiceProperties - Properties of the private link service. - *PrivateLinkServiceProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkService. -func (pls PrivateLinkService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pls.ExtendedLocation != nil { - objectMap["extendedLocation"] = pls.ExtendedLocation - } - if pls.PrivateLinkServiceProperties != nil { - objectMap["properties"] = pls.PrivateLinkServiceProperties - } - if pls.ID != nil { - objectMap["id"] = pls.ID - } - if pls.Location != nil { - objectMap["location"] = pls.Location - } - if pls.Tags != nil { - objectMap["tags"] = pls.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkService struct. -func (pls *PrivateLinkService) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - pls.ExtendedLocation = &extendedLocation - } - case "properties": - if v != nil { - var privateLinkServiceProperties PrivateLinkServiceProperties - err = json.Unmarshal(*v, &privateLinkServiceProperties) - if err != nil { - return err - } - pls.PrivateLinkServiceProperties = &privateLinkServiceProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pls.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pls.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pls.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pls.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pls.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pls.Tags = tags - } - } - } - - return nil -} - -// PrivateLinkServiceConnection privateLinkServiceConnection resource. -type PrivateLinkServiceConnection struct { - // PrivateLinkServiceConnectionProperties - Properties of the private link service connection. - *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceConnection. -func (plsc PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plsc.PrivateLinkServiceConnectionProperties != nil { - objectMap["properties"] = plsc.PrivateLinkServiceConnectionProperties - } - if plsc.Name != nil { - objectMap["name"] = plsc.Name - } - if plsc.ID != nil { - objectMap["id"] = plsc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkServiceConnection struct. -func (plsc *PrivateLinkServiceConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkServiceConnectionProperties PrivateLinkServiceConnectionProperties - err = json.Unmarshal(*v, &privateLinkServiceConnectionProperties) - if err != nil { - return err - } - plsc.PrivateLinkServiceConnectionProperties = &privateLinkServiceConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plsc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plsc.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - plsc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plsc.ID = &ID - } - } - } - - return nil -} - -// PrivateLinkServiceConnectionProperties properties of the PrivateLinkServiceConnection. -type PrivateLinkServiceConnectionProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the private link service connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateLinkServiceID - The resource id of private link service. - PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"` - // GroupIds - The ID(s) of the group(s) obtained from the remote resource that this private endpoint should connect to. - GroupIds *[]string `json:"groupIds,omitempty"` - // RequestMessage - A message passed to the owner of the remote resource with this connection request. Restricted to 140 chars. - RequestMessage *string `json:"requestMessage,omitempty"` - // PrivateLinkServiceConnectionState - A collection of read-only information about the state of the connection to the remote resource. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionProperties. -func (plscp PrivateLinkServiceConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plscp.PrivateLinkServiceID != nil { - objectMap["privateLinkServiceId"] = plscp.PrivateLinkServiceID - } - if plscp.GroupIds != nil { - objectMap["groupIds"] = plscp.GroupIds - } - if plscp.RequestMessage != nil { - objectMap["requestMessage"] = plscp.RequestMessage - } - if plscp.PrivateLinkServiceConnectionState != nil { - objectMap["privateLinkServiceConnectionState"] = plscp.PrivateLinkServiceConnectionState - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceConnectionState a collection of information about the state of the connection between -// service consumer and provider. -type PrivateLinkServiceConnectionState struct { - // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *string `json:"status,omitempty"` - // Description - The reason for approval/rejection of the connection. - Description *string `json:"description,omitempty"` - // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string `json:"actionsRequired,omitempty"` -} - -// PrivateLinkServiceIPConfiguration the private link service ip configuration. -type PrivateLinkServiceIPConfiguration struct { - // PrivateLinkServiceIPConfigurationProperties - Properties of the private link service ip configuration. - *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - // Name - The name of private link service ip configuration. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceIPConfiguration. -func (plsic PrivateLinkServiceIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plsic.PrivateLinkServiceIPConfigurationProperties != nil { - objectMap["properties"] = plsic.PrivateLinkServiceIPConfigurationProperties - } - if plsic.Name != nil { - objectMap["name"] = plsic.Name - } - if plsic.ID != nil { - objectMap["id"] = plsic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PrivateLinkServiceIPConfiguration struct. -func (plsic *PrivateLinkServiceIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var privateLinkServiceIPConfigurationProperties PrivateLinkServiceIPConfigurationProperties - err = json.Unmarshal(*v, &privateLinkServiceIPConfigurationProperties) - if err != nil { - return err - } - plsic.PrivateLinkServiceIPConfigurationProperties = &privateLinkServiceIPConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - plsic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - plsic.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - plsic.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - plsic.ID = &ID - } - } - } - - return nil -} - -// PrivateLinkServiceIPConfigurationProperties properties of private link service IP configuration. -type PrivateLinkServiceIPConfigurationProperties struct { - // PrivateIPAddress - The private IP address of the IP configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *Subnet `json:"subnet,omitempty"` - // Primary - Whether the ip configuration is primary or not. - Primary *bool `json:"primary,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private link service IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceIPConfigurationProperties. -func (plsicp PrivateLinkServiceIPConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plsicp.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = plsicp.PrivateIPAddress - } - if plsicp.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = plsicp.PrivateIPAllocationMethod - } - if plsicp.Subnet != nil { - objectMap["subnet"] = plsicp.Subnet - } - if plsicp.Primary != nil { - objectMap["primary"] = plsicp.Primary - } - if plsicp.PrivateIPAddressVersion != "" { - objectMap["privateIPAddressVersion"] = plsicp.PrivateIPAddressVersion - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceListResult response for the ListPrivateLinkService API service call. -type PrivateLinkServiceListResult struct { - autorest.Response `json:"-"` - // Value - A list of PrivateLinkService resources in a resource group. - Value *[]PrivateLinkService `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceListResult. -func (plslr PrivateLinkServiceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plslr.Value != nil { - objectMap["value"] = plslr.Value - } - return json.Marshal(objectMap) -} - -// PrivateLinkServiceListResultIterator provides access to a complete listing of PrivateLinkService values. -type PrivateLinkServiceListResultIterator struct { - i int - page PrivateLinkServiceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PrivateLinkServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServiceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PrivateLinkServiceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PrivateLinkServiceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PrivateLinkServiceListResultIterator) Response() PrivateLinkServiceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PrivateLinkServiceListResultIterator) Value() PrivateLinkService { - if !iter.page.NotDone() { - return PrivateLinkService{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PrivateLinkServiceListResultIterator type. -func NewPrivateLinkServiceListResultIterator(page PrivateLinkServiceListResultPage) PrivateLinkServiceListResultIterator { - return PrivateLinkServiceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (plslr PrivateLinkServiceListResult) IsEmpty() bool { - return plslr.Value == nil || len(*plslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (plslr PrivateLinkServiceListResult) hasNextLink() bool { - return plslr.NextLink != nil && len(*plslr.NextLink) != 0 -} - -// privateLinkServiceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plslr PrivateLinkServiceListResult) privateLinkServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !plslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plslr.NextLink))) -} - -// PrivateLinkServiceListResultPage contains a page of PrivateLinkService values. -type PrivateLinkServiceListResultPage struct { - fn func(context.Context, PrivateLinkServiceListResult) (PrivateLinkServiceListResult, error) - plslr PrivateLinkServiceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PrivateLinkServiceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServiceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.plslr) - if err != nil { - return err - } - page.plslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PrivateLinkServiceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PrivateLinkServiceListResultPage) NotDone() bool { - return !page.plslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PrivateLinkServiceListResultPage) Response() PrivateLinkServiceListResult { - return page.plslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PrivateLinkServiceListResultPage) Values() []PrivateLinkService { - if page.plslr.IsEmpty() { - return nil - } - return *page.plslr.Value -} - -// Creates a new instance of the PrivateLinkServiceListResultPage type. -func NewPrivateLinkServiceListResultPage(cur PrivateLinkServiceListResult, getNextPage func(context.Context, PrivateLinkServiceListResult) (PrivateLinkServiceListResult, error)) PrivateLinkServiceListResultPage { - return PrivateLinkServiceListResultPage{ - fn: getNextPage, - plslr: cur, - } -} - -// PrivateLinkServiceProperties properties of the private link service. -type PrivateLinkServiceProperties struct { - // LoadBalancerFrontendIPConfigurations - An array of references to the load balancer IP configurations. - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - // IPConfigurations - An array of private link service IP configurations. - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - // NetworkInterfaces - READ-ONLY; An array of references to the network interfaces created for this private link service. - NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the private link service resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateEndpointConnections - READ-ONLY; An array of list about connections to the private endpoint. - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - // Visibility - The visibility list of the private link service. - Visibility *PrivateLinkServicePropertiesVisibility `json:"visibility,omitempty"` - // AutoApproval - The auto-approval list of the private link service. - AutoApproval *PrivateLinkServicePropertiesAutoApproval `json:"autoApproval,omitempty"` - // Fqdns - The list of Fqdn. - Fqdns *[]string `json:"fqdns,omitempty"` - // Alias - READ-ONLY; The alias of the private link service. - Alias *string `json:"alias,omitempty"` - // EnableProxyProtocol - Whether the private link service is enabled for proxy protocol or not. - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` -} - -// MarshalJSON is the custom marshaler for PrivateLinkServiceProperties. -func (plsp PrivateLinkServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if plsp.LoadBalancerFrontendIPConfigurations != nil { - objectMap["loadBalancerFrontendIpConfigurations"] = plsp.LoadBalancerFrontendIPConfigurations - } - if plsp.IPConfigurations != nil { - objectMap["ipConfigurations"] = plsp.IPConfigurations - } - if plsp.Visibility != nil { - objectMap["visibility"] = plsp.Visibility - } - if plsp.AutoApproval != nil { - objectMap["autoApproval"] = plsp.AutoApproval - } - if plsp.Fqdns != nil { - objectMap["fqdns"] = plsp.Fqdns - } - if plsp.EnableProxyProtocol != nil { - objectMap["enableProxyProtocol"] = plsp.EnableProxyProtocol - } - return json.Marshal(objectMap) -} - -// PrivateLinkServicePropertiesAutoApproval the auto-approval list of the private link service. -type PrivateLinkServicePropertiesAutoApproval struct { - // Subscriptions - The list of subscriptions. - Subscriptions *[]string `json:"subscriptions,omitempty"` -} - -// PrivateLinkServicePropertiesVisibility the visibility list of the private link service. -type PrivateLinkServicePropertiesVisibility struct { - // Subscriptions - The list of subscriptions. - Subscriptions *[]string `json:"subscriptions,omitempty"` -} - -// PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture an abstraction for monitoring -// and retrieving the results of a long-running operation. -type PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (PrivateLinkServiceVisibility, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture.Result. -func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture) result(client PrivateLinkServicesClient) (plsv PrivateLinkServiceVisibility, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - plsv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if plsv.Response.Response, err = future.GetResult(sender); err == nil && plsv.Response.Response.StatusCode != http.StatusNoContent { - plsv, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupResponder(plsv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture", "Result", plsv.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (PrivateLinkServiceVisibility, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture.Result. -func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) result(client PrivateLinkServicesClient) (plsv PrivateLinkServiceVisibility, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - plsv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if plsv.Response.Response, err = future.GetResult(sender); err == nil && plsv.Response.Response.StatusCode != http.StatusNoContent { - plsv, err = client.CheckPrivateLinkServiceVisibilityResponder(plsv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture", "Result", plsv.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateLinkServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateLinkServicesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (PrivateLinkService, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesCreateOrUpdateFuture.Result. -func (future *PrivateLinkServicesCreateOrUpdateFuture) result(client PrivateLinkServicesClient) (pls PrivateLinkService, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pls.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pls.Response.Response, err = future.GetResult(sender); err == nil && pls.Response.Response.StatusCode != http.StatusNoContent { - pls, err = client.CreateOrUpdateResponder(pls.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCreateOrUpdateFuture", "Result", pls.Response.Response, "Failure responding to request") - } - } - return -} - -// PrivateLinkServicesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PrivateLinkServicesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesDeleteFuture.Result. -func (future *PrivateLinkServicesDeleteFuture) result(client PrivateLinkServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateLinkServicesDeletePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type PrivateLinkServicesDeletePrivateEndpointConnectionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PrivateLinkServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PrivateLinkServicesDeletePrivateEndpointConnectionFuture.Result. -func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) result(client PrivateLinkServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesDeletePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesDeletePrivateEndpointConnectionFuture") - return - } - ar.Response = future.Response() - return -} - -// PrivateLinkServiceVisibility response for the CheckPrivateLinkServiceVisibility API service call. -type PrivateLinkServiceVisibility struct { - autorest.Response `json:"-"` - // Visible - Private Link Service Visibility (True/False). - Visible *bool `json:"visible,omitempty"` -} - -// Probe a load balancer probe. -type Probe struct { - autorest.Response `json:"-"` - // ProbePropertiesFormat - Properties of load balancer probe. - *ProbePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of probes used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Probe. -func (p Probe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if p.ProbePropertiesFormat != nil { - objectMap["properties"] = p.ProbePropertiesFormat - } - if p.Name != nil { - objectMap["name"] = p.Name - } - if p.ID != nil { - objectMap["id"] = p.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Probe struct. -func (p *Probe) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var probePropertiesFormat ProbePropertiesFormat - err = json.Unmarshal(*v, &probePropertiesFormat) - if err != nil { - return err - } - p.ProbePropertiesFormat = &probePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - p.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - p.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - p.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - p.ID = &ID - } - } - } - - return nil -} - -// ProbePropertiesFormat load balancer probe resource. -type ProbePropertiesFormat struct { - // LoadBalancingRules - READ-ONLY; The load balancer rules that use this probe. - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - // Protocol - The protocol of the end point. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP', 'ProbeProtocolHTTPS' - Protocol ProbeProtocol `json:"protocol,omitempty"` - // Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive. - Port *int32 `json:"port,omitempty"` - // IntervalInSeconds - The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. - IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` - // NumberOfProbes - The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. - NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` - // ProbeThreshold - The number of consecutive successful or failed probes in order to allow or deny traffic from being delivered to this endpoint. After failing the number of consecutive probes equal to this value, the endpoint will be taken out of rotation and require the same number of successful consecutive probes to be placed back in rotation. - ProbeThreshold *int32 `json:"probeThreshold,omitempty"` - // RequestPath - The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. - RequestPath *string `json:"requestPath,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProbePropertiesFormat. -func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppf.Protocol != "" { - objectMap["protocol"] = ppf.Protocol - } - if ppf.Port != nil { - objectMap["port"] = ppf.Port - } - if ppf.IntervalInSeconds != nil { - objectMap["intervalInSeconds"] = ppf.IntervalInSeconds - } - if ppf.NumberOfProbes != nil { - objectMap["numberOfProbes"] = ppf.NumberOfProbes - } - if ppf.ProbeThreshold != nil { - objectMap["probeThreshold"] = ppf.ProbeThreshold - } - if ppf.RequestPath != nil { - objectMap["requestPath"] = ppf.RequestPath - } - return json.Marshal(objectMap) -} - -// Profile network profile resource. -type Profile struct { - autorest.Response `json:"-"` - // ProfilePropertiesFormat - Network profile properties. - *ProfilePropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Profile. -func (p Profile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if p.ProfilePropertiesFormat != nil { - objectMap["properties"] = p.ProfilePropertiesFormat - } - if p.ID != nil { - objectMap["id"] = p.ID - } - if p.Location != nil { - objectMap["location"] = p.Location - } - if p.Tags != nil { - objectMap["tags"] = p.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Profile struct. -func (p *Profile) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var profilePropertiesFormat ProfilePropertiesFormat - err = json.Unmarshal(*v, &profilePropertiesFormat) - if err != nil { - return err - } - p.ProfilePropertiesFormat = &profilePropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - p.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - p.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - p.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - p.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - p.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - p.Tags = tags - } - } - } - - return nil -} - -// ProfileListResult response for ListNetworkProfiles API service call. -type ProfileListResult struct { - autorest.Response `json:"-"` - // Value - A list of network profiles that exist in a resource group. - Value *[]Profile `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProfileListResultIterator provides access to a complete listing of Profile values. -type ProfileListResultIterator struct { - i int - page ProfileListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProfileListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProfileListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProfileListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ProfileListResultIterator) Response() ProfileListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProfileListResultIterator) Value() Profile { - if !iter.page.NotDone() { - return Profile{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProfileListResultIterator type. -func NewProfileListResultIterator(page ProfileListResultPage) ProfileListResultIterator { - return ProfileListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (plr ProfileListResult) IsEmpty() bool { - return plr.Value == nil || len(*plr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (plr ProfileListResult) hasNextLink() bool { - return plr.NextLink != nil && len(*plr.NextLink) != 0 -} - -// profileListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { - if !plr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(plr.NextLink))) -} - -// ProfileListResultPage contains a page of Profile values. -type ProfileListResultPage struct { - fn func(context.Context, ProfileListResult) (ProfileListResult, error) - plr ProfileListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.plr) - if err != nil { - return err - } - page.plr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProfileListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProfileListResultPage) NotDone() bool { - return !page.plr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProfileListResultPage) Response() ProfileListResult { - return page.plr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProfileListResultPage) Values() []Profile { - if page.plr.IsEmpty() { - return nil - } - return *page.plr.Value -} - -// Creates a new instance of the ProfileListResultPage type. -func NewProfileListResultPage(cur ProfileListResult, getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { - return ProfileListResultPage{ - fn: getNextPage, - plr: cur, - } -} - -// ProfilePropertiesFormat network profile properties. -type ProfilePropertiesFormat struct { - // ContainerNetworkInterfaces - READ-ONLY; List of child container network interfaces. - ContainerNetworkInterfaces *[]ContainerNetworkInterface `json:"containerNetworkInterfaces,omitempty"` - // ContainerNetworkInterfaceConfigurations - List of chid container network interface configurations. - ContainerNetworkInterfaceConfigurations *[]ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfigurations,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the network profile resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network profile resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProfilePropertiesFormat. -func (ppf ProfilePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppf.ContainerNetworkInterfaceConfigurations != nil { - objectMap["containerNetworkInterfaceConfigurations"] = ppf.ContainerNetworkInterfaceConfigurations - } - return json.Marshal(objectMap) -} - -// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ProfilesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ProfilesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ProfilesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ProfilesDeleteFuture.Result. -func (future *ProfilesDeleteFuture) result(client ProfilesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ProfilesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PropagatedRouteTable the list of RouteTables to advertise the routes to. -type PropagatedRouteTable struct { - // Labels - The list of labels. - Labels *[]string `json:"labels,omitempty"` - // Ids - The list of resource ids of all the RouteTables. - Ids *[]SubResource `json:"ids,omitempty"` -} - -// ProtocolConfiguration configuration of the protocol. -type ProtocolConfiguration struct { - // HTTPConfiguration - HTTP configuration of the connectivity check. - HTTPConfiguration *HTTPConfiguration `json:"HTTPConfiguration,omitempty"` -} - -// PublicIPAddress public IP address resource. -type PublicIPAddress struct { - autorest.Response `json:"-"` - // ExtendedLocation - The extended location of the public ip address. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // Sku - The public IP address SKU. - Sku *PublicIPAddressSku `json:"sku,omitempty"` - // PublicIPAddressPropertiesFormat - Public IP address properties. - *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PublicIPAddress. -func (pia PublicIPAddress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pia.ExtendedLocation != nil { - objectMap["extendedLocation"] = pia.ExtendedLocation - } - if pia.Sku != nil { - objectMap["sku"] = pia.Sku - } - if pia.PublicIPAddressPropertiesFormat != nil { - objectMap["properties"] = pia.PublicIPAddressPropertiesFormat - } - if pia.Zones != nil { - objectMap["zones"] = pia.Zones - } - if pia.ID != nil { - objectMap["id"] = pia.ID - } - if pia.Location != nil { - objectMap["location"] = pia.Location - } - if pia.Tags != nil { - objectMap["tags"] = pia.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct. -func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - pia.ExtendedLocation = &extendedLocation - } - case "sku": - if v != nil { - var sku PublicIPAddressSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - pia.Sku = &sku - } - case "properties": - if v != nil { - var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat - err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat) - if err != nil { - return err - } - pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pia.Etag = &etag - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - pia.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pia.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pia.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pia.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pia.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pia.Tags = tags - } - } - } - - return nil -} - -// PublicIPAddressDNSSettings contains FQDN of the DNS record associated with the public IP address. -type PublicIPAddressDNSSettings struct { - // DomainNameLabel - The domain name label. The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - // Fqdn - The Fully Qualified Domain Name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. - Fqdn *string `json:"fqdn,omitempty"` - // ReverseFqdn - The reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} - -// PublicIPAddressesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PublicIPAddressesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPAddressesClient) (PublicIPAddress, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPAddressesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPAddressesCreateOrUpdateFuture.Result. -func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pia.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pia.Response.Response, err = future.GetResult(sender); err == nil && pia.Response.Response.StatusCode != http.StatusNoContent { - pia, err = client.CreateOrUpdateResponder(pia.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", pia.Response.Response, "Failure responding to request") - } - } - return -} - -// PublicIPAddressesDdosProtectionStatusFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type PublicIPAddressesDdosProtectionStatusFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPAddressesClient) (PublicIPDdosProtectionStatusResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPAddressesDdosProtectionStatusFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPAddressesDdosProtectionStatusFuture.Result. -func (future *PublicIPAddressesDdosProtectionStatusFuture) result(client PublicIPAddressesClient) (pidpsr PublicIPDdosProtectionStatusResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDdosProtectionStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pidpsr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDdosProtectionStatusFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pidpsr.Response.Response, err = future.GetResult(sender); err == nil && pidpsr.Response.Response.StatusCode != http.StatusNoContent { - pidpsr, err = client.DdosProtectionStatusResponder(pidpsr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDdosProtectionStatusFuture", "Result", pidpsr.Response.Response, "Failure responding to request") - } - } - return -} - -// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PublicIPAddressesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPAddressesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPAddressesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPAddressesDeleteFuture.Result. -func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PublicIPAddressListResult response for ListPublicIpAddresses API service call. -type PublicIPAddressListResult struct { - autorest.Response `json:"-"` - // Value - A list of public IP addresses that exists in a resource group. - Value *[]PublicIPAddress `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// PublicIPAddressListResultIterator provides access to a complete listing of PublicIPAddress values. -type PublicIPAddressListResultIterator struct { - i int - page PublicIPAddressListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PublicIPAddressListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PublicIPAddressListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PublicIPAddressListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PublicIPAddressListResultIterator) Response() PublicIPAddressListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PublicIPAddressListResultIterator) Value() PublicIPAddress { - if !iter.page.NotDone() { - return PublicIPAddress{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PublicIPAddressListResultIterator type. -func NewPublicIPAddressListResultIterator(page PublicIPAddressListResultPage) PublicIPAddressListResultIterator { - return PublicIPAddressListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pialr PublicIPAddressListResult) IsEmpty() bool { - return pialr.Value == nil || len(*pialr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (pialr PublicIPAddressListResult) hasNextLink() bool { - return pialr.NextLink != nil && len(*pialr.NextLink) != 0 -} - -// publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) { - if !pialr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pialr.NextLink))) -} - -// PublicIPAddressListResultPage contains a page of PublicIPAddress values. -type PublicIPAddressListResultPage struct { - fn func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error) - pialr PublicIPAddressListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.pialr) - if err != nil { - return err - } - page.pialr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PublicIPAddressListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PublicIPAddressListResultPage) NotDone() bool { - return !page.pialr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PublicIPAddressListResultPage) Response() PublicIPAddressListResult { - return page.pialr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PublicIPAddressListResultPage) Values() []PublicIPAddress { - if page.pialr.IsEmpty() { - return nil - } - return *page.pialr.Value -} - -// Creates a new instance of the PublicIPAddressListResultPage type. -func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage { - return PublicIPAddressListResultPage{ - fn: getNextPage, - pialr: cur, - } -} - -// PublicIPAddressPropertiesFormat public IP address properties. -type PublicIPAddressPropertiesFormat struct { - // PublicIPAllocationMethod - The public IP address allocation method. Possible values include: 'Static', 'Dynamic' - PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPv4', 'IPv6' - PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` - // IPConfiguration - READ-ONLY; The IP configuration associated with the public IP address. - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - // DNSSettings - The FQDN of the DNS record associated with the public IP address. - DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"` - // DdosSettings - The DDoS protection custom policy associated with the public IP address. - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - // IPTags - The list of tags associated with the public IP address. - IPTags *[]IPTag `json:"ipTags,omitempty"` - // IPAddress - The IP address associated with the public IP address resource. - IPAddress *string `json:"ipAddress,omitempty"` - // PublicIPPrefix - The Public IP Prefix this Public IP Address should be allocated from. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the public IP address resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the public IP address resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ServicePublicIPAddress - The service public IP address of the public IP address resource. - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` - // NatGateway - The NatGateway for the Public IP address. - NatGateway *NatGateway `json:"natGateway,omitempty"` - // MigrationPhase - Migration phase of Public IP Address. Possible values include: 'PublicIPAddressMigrationPhaseNone', 'PublicIPAddressMigrationPhasePrepare', 'PublicIPAddressMigrationPhaseCommit', 'PublicIPAddressMigrationPhaseAbort', 'PublicIPAddressMigrationPhaseCommitted' - MigrationPhase PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - // LinkedPublicIPAddress - The linked public IP address of the public IP address resource. - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - // DeleteOption - Specify what happens to the public IP address when the VM using it is deleted. Possible values include: 'Delete', 'Detach' - DeleteOption DeleteOptions `json:"deleteOption,omitempty"` -} - -// MarshalJSON is the custom marshaler for PublicIPAddressPropertiesFormat. -func (piapf PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if piapf.PublicIPAllocationMethod != "" { - objectMap["publicIPAllocationMethod"] = piapf.PublicIPAllocationMethod - } - if piapf.PublicIPAddressVersion != "" { - objectMap["publicIPAddressVersion"] = piapf.PublicIPAddressVersion - } - if piapf.DNSSettings != nil { - objectMap["dnsSettings"] = piapf.DNSSettings - } - if piapf.DdosSettings != nil { - objectMap["ddosSettings"] = piapf.DdosSettings - } - if piapf.IPTags != nil { - objectMap["ipTags"] = piapf.IPTags - } - if piapf.IPAddress != nil { - objectMap["ipAddress"] = piapf.IPAddress - } - if piapf.PublicIPPrefix != nil { - objectMap["publicIPPrefix"] = piapf.PublicIPPrefix - } - if piapf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = piapf.IdleTimeoutInMinutes - } - if piapf.ServicePublicIPAddress != nil { - objectMap["servicePublicIPAddress"] = piapf.ServicePublicIPAddress - } - if piapf.NatGateway != nil { - objectMap["natGateway"] = piapf.NatGateway - } - if piapf.MigrationPhase != "" { - objectMap["migrationPhase"] = piapf.MigrationPhase - } - if piapf.LinkedPublicIPAddress != nil { - objectMap["linkedPublicIPAddress"] = piapf.LinkedPublicIPAddress - } - if piapf.DeleteOption != "" { - objectMap["deleteOption"] = piapf.DeleteOption - } - return json.Marshal(objectMap) -} - -// PublicIPAddressSku SKU of a public IP address. -type PublicIPAddressSku struct { - // Name - Name of a public IP address SKU. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' - Name PublicIPAddressSkuName `json:"name,omitempty"` - // Tier - Tier of a public IP address SKU. Possible values include: 'PublicIPAddressSkuTierRegional', 'PublicIPAddressSkuTierGlobal' - Tier PublicIPAddressSkuTier `json:"tier,omitempty"` -} - -// PublicIPDdosProtectionStatusResult response for GetPublicIpAddressDdosProtectionStatusOperation API -// service call. -type PublicIPDdosProtectionStatusResult struct { - autorest.Response `json:"-"` - // PublicIPAddressID - Public IP ARM resource ID - PublicIPAddressID *string `json:"publicIpAddressId,omitempty"` - // PublicIPAddress - IP Address of the Public IP Resource - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // IsWorkloadProtected - Value indicating whether the IP address is DDoS workload protected or not. Possible values include: 'IsWorkloadProtectedFalse', 'IsWorkloadProtectedTrue' - IsWorkloadProtected IsWorkloadProtected `json:"isWorkloadProtected,omitempty"` - // DdosProtectionPlanID - DDoS protection plan Resource Id of a if IP address is protected through a plan. - DdosProtectionPlanID *string `json:"ddosProtectionPlanId,omitempty"` -} - -// PublicIPPrefix public IP prefix resource. -type PublicIPPrefix struct { - autorest.Response `json:"-"` - // ExtendedLocation - The extended location of the public ip address. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // Sku - The public IP prefix SKU. - Sku *PublicIPPrefixSku `json:"sku,omitempty"` - // PublicIPPrefixPropertiesFormat - Public IP prefix properties. - *PublicIPPrefixPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PublicIPPrefix. -func (pip PublicIPPrefix) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pip.ExtendedLocation != nil { - objectMap["extendedLocation"] = pip.ExtendedLocation - } - if pip.Sku != nil { - objectMap["sku"] = pip.Sku - } - if pip.PublicIPPrefixPropertiesFormat != nil { - objectMap["properties"] = pip.PublicIPPrefixPropertiesFormat - } - if pip.Zones != nil { - objectMap["zones"] = pip.Zones - } - if pip.ID != nil { - objectMap["id"] = pip.ID - } - if pip.Location != nil { - objectMap["location"] = pip.Location - } - if pip.Tags != nil { - objectMap["tags"] = pip.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PublicIPPrefix struct. -func (pip *PublicIPPrefix) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - pip.ExtendedLocation = &extendedLocation - } - case "sku": - if v != nil { - var sku PublicIPPrefixSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - pip.Sku = &sku - } - case "properties": - if v != nil { - var publicIPPrefixPropertiesFormat PublicIPPrefixPropertiesFormat - err = json.Unmarshal(*v, &publicIPPrefixPropertiesFormat) - if err != nil { - return err - } - pip.PublicIPPrefixPropertiesFormat = &publicIPPrefixPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - pip.Etag = &etag - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - pip.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pip.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pip.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pip.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pip.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pip.Tags = tags - } - } - } - - return nil -} - -// PublicIPPrefixesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PublicIPPrefixesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPPrefixesClient) (PublicIPPrefix, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPPrefixesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPPrefixesCreateOrUpdateFuture.Result. -func (future *PublicIPPrefixesCreateOrUpdateFuture) result(client PublicIPPrefixesClient) (pip PublicIPPrefix, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - pip.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if pip.Response.Response, err = future.GetResult(sender); err == nil && pip.Response.Response.StatusCode != http.StatusNoContent { - pip, err = client.CreateOrUpdateResponder(pip.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesCreateOrUpdateFuture", "Result", pip.Response.Response, "Failure responding to request") - } - } - return -} - -// PublicIPPrefixesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PublicIPPrefixesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(PublicIPPrefixesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PublicIPPrefixesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PublicIPPrefixesDeleteFuture.Result. -func (future *PublicIPPrefixesDeleteFuture) result(client PublicIPPrefixesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// PublicIPPrefixListResult response for ListPublicIpPrefixes API service call. -type PublicIPPrefixListResult struct { - autorest.Response `json:"-"` - // Value - A list of public IP prefixes that exists in a resource group. - Value *[]PublicIPPrefix `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// PublicIPPrefixListResultIterator provides access to a complete listing of PublicIPPrefix values. -type PublicIPPrefixListResultIterator struct { - i int - page PublicIPPrefixListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *PublicIPPrefixListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *PublicIPPrefixListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PublicIPPrefixListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter PublicIPPrefixListResultIterator) Response() PublicIPPrefixListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter PublicIPPrefixListResultIterator) Value() PublicIPPrefix { - if !iter.page.NotDone() { - return PublicIPPrefix{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the PublicIPPrefixListResultIterator type. -func NewPublicIPPrefixListResultIterator(page PublicIPPrefixListResultPage) PublicIPPrefixListResultIterator { - return PublicIPPrefixListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (piplr PublicIPPrefixListResult) IsEmpty() bool { - return piplr.Value == nil || len(*piplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (piplr PublicIPPrefixListResult) hasNextLink() bool { - return piplr.NextLink != nil && len(*piplr.NextLink) != 0 -} - -// publicIPPrefixListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (piplr PublicIPPrefixListResult) publicIPPrefixListResultPreparer(ctx context.Context) (*http.Request, error) { - if !piplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(piplr.NextLink))) -} - -// PublicIPPrefixListResultPage contains a page of PublicIPPrefix values. -type PublicIPPrefixListResultPage struct { - fn func(context.Context, PublicIPPrefixListResult) (PublicIPPrefixListResult, error) - piplr PublicIPPrefixListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *PublicIPPrefixListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.piplr) - if err != nil { - return err - } - page.piplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *PublicIPPrefixListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PublicIPPrefixListResultPage) NotDone() bool { - return !page.piplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page PublicIPPrefixListResultPage) Response() PublicIPPrefixListResult { - return page.piplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page PublicIPPrefixListResultPage) Values() []PublicIPPrefix { - if page.piplr.IsEmpty() { - return nil - } - return *page.piplr.Value -} - -// Creates a new instance of the PublicIPPrefixListResultPage type. -func NewPublicIPPrefixListResultPage(cur PublicIPPrefixListResult, getNextPage func(context.Context, PublicIPPrefixListResult) (PublicIPPrefixListResult, error)) PublicIPPrefixListResultPage { - return PublicIPPrefixListResultPage{ - fn: getNextPage, - piplr: cur, - } -} - -// PublicIPPrefixPropertiesFormat public IP prefix properties. -type PublicIPPrefixPropertiesFormat struct { - // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPv4', 'IPv6' - PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` - // IPTags - The list of tags associated with the public IP prefix. - IPTags *[]IPTag `json:"ipTags,omitempty"` - // PrefixLength - The Length of the Public IP Prefix. - PrefixLength *int32 `json:"prefixLength,omitempty"` - // IPPrefix - READ-ONLY; The allocated Prefix. - IPPrefix *string `json:"ipPrefix,omitempty"` - // PublicIPAddresses - READ-ONLY; The list of all referenced PublicIPAddresses. - PublicIPAddresses *[]ReferencedPublicIPAddress `json:"publicIPAddresses,omitempty"` - // LoadBalancerFrontendIPConfiguration - READ-ONLY; The reference to load balancer frontend IP configuration associated with the public IP prefix. - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIpConfiguration,omitempty"` - // CustomIPPrefix - The customIpPrefix that this prefix is associated with. - CustomIPPrefix *SubResource `json:"customIPPrefix,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the public IP prefix resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the public IP prefix resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // NatGateway - NatGateway of Public IP Prefix. - NatGateway *NatGateway `json:"natGateway,omitempty"` -} - -// MarshalJSON is the custom marshaler for PublicIPPrefixPropertiesFormat. -func (pippf PublicIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pippf.PublicIPAddressVersion != "" { - objectMap["publicIPAddressVersion"] = pippf.PublicIPAddressVersion - } - if pippf.IPTags != nil { - objectMap["ipTags"] = pippf.IPTags - } - if pippf.PrefixLength != nil { - objectMap["prefixLength"] = pippf.PrefixLength - } - if pippf.CustomIPPrefix != nil { - objectMap["customIPPrefix"] = pippf.CustomIPPrefix - } - if pippf.NatGateway != nil { - objectMap["natGateway"] = pippf.NatGateway - } - return json.Marshal(objectMap) -} - -// PublicIPPrefixSku SKU of a public IP prefix. -type PublicIPPrefixSku struct { - // Name - Name of a public IP prefix SKU. Possible values include: 'PublicIPPrefixSkuNameStandard' - Name PublicIPPrefixSkuName `json:"name,omitempty"` - // Tier - Tier of a public IP prefix SKU. Possible values include: 'PublicIPPrefixSkuTierRegional', 'PublicIPPrefixSkuTierGlobal' - Tier PublicIPPrefixSkuTier `json:"tier,omitempty"` -} - -// PutBastionShareableLinkAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type PutBastionShareableLinkAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (BastionShareableLinkListResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PutBastionShareableLinkAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PutBastionShareableLinkAllFuture.Result. -func (future *PutBastionShareableLinkAllFuture) result(client BaseClient) (bsllrp BastionShareableLinkListResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bsllrp.bsllr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PutBastionShareableLinkAllFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bsllrp.bsllr.Response.Response, err = future.GetResult(sender); err == nil && bsllrp.bsllr.Response.Response.StatusCode != http.StatusNoContent { - bsllrp, err = client.PutBastionShareableLinkResponder(bsllrp.bsllr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkAllFuture", "Result", bsllrp.bsllr.Response.Response, "Failure responding to request") - } - } - return -} - -// PutBastionShareableLinkFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type PutBastionShareableLinkFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(BaseClient) (BastionShareableLinkListResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *PutBastionShareableLinkFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for PutBastionShareableLinkFuture.Result. -func (future *PutBastionShareableLinkFuture) result(client BaseClient) (bsllrp BastionShareableLinkListResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bsllrp.bsllr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.PutBastionShareableLinkFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bsllrp.bsllr.Response.Response, err = future.GetResult(sender); err == nil && bsllrp.bsllr.Response.Response.StatusCode != http.StatusNoContent { - bsllrp, err = client.PutBastionShareableLinkResponder(bsllrp.bsllr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkFuture", "Result", bsllrp.bsllr.Response.Response, "Failure responding to request") - } - } - return -} - -// QosDefinition quality of Service defines the traffic configuration between endpoints. Mandatory to have -// one marking. -type QosDefinition struct { - // Markings - List of markings to be used in the configuration. - Markings *[]int32 `json:"markings,omitempty"` - // SourceIPRanges - Source IP ranges. - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - // DestinationIPRanges - Destination IP ranges. - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - // SourcePortRanges - Sources port ranges. - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` - // DestinationPortRanges - Destination port ranges. - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - // Protocol - RNM supported protocol types. Possible values include: 'ProtocolTypeDoNotUse', 'ProtocolTypeIcmp', 'ProtocolTypeTCP', 'ProtocolTypeUDP', 'ProtocolTypeGre', 'ProtocolTypeEsp', 'ProtocolTypeAh', 'ProtocolTypeVxlan', 'ProtocolTypeAll' - Protocol ProtocolType `json:"protocol,omitempty"` -} - -// QosIPRange qos Traffic Profiler IP Range properties. -type QosIPRange struct { - // StartIP - Start IP Address. - StartIP *string `json:"startIP,omitempty"` - // EndIP - End IP Address. - EndIP *string `json:"endIP,omitempty"` -} - -// QosPortRange qos Traffic Profiler Port range properties. -type QosPortRange struct { - // Start - Qos Port Range start. - Start *int32 `json:"start,omitempty"` - // End - Qos Port Range end. - End *int32 `json:"end,omitempty"` -} - -// QueryInboundNatRulePortMappingRequest the request for a QueryInboundNatRulePortMapping API. Either -// IpConfiguration or IpAddress should be set -type QueryInboundNatRulePortMappingRequest struct { - // IPConfiguration - NetworkInterfaceIPConfiguration set in load balancer backend address. - IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` - // IPAddress - IP address set in load balancer backend address. - IPAddress *string `json:"ipAddress,omitempty"` -} - -// QueryRequestOptions query Request Options -type QueryRequestOptions struct { - // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. - SkipToken *string `json:"skipToken,omitempty"` -} - -// QueryResults query result -type QueryResults struct { - autorest.Response `json:"-"` - // MatchingRecordsCount - Number of total records matching the query. - MatchingRecordsCount *int64 `json:"matchingRecordsCount,omitempty"` - // Signatures - Array containing the results of the query - Signatures *[]SingleQueryResult `json:"signatures,omitempty"` -} - -// QueryTroubleshootingParameters parameters that define the resource to query the troubleshooting result. -type QueryTroubleshootingParameters struct { - // TargetResourceID - The target resource ID to query the troubleshooting result. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// RadiusServer radius Server Settings. -type RadiusServer struct { - // RadiusServerAddress - The address of this radius server. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - // RadiusServerScore - The initial score assigned to this radius server. - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - // RadiusServerSecret - The secret used for this radius server. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} - -// RecordSet a collective group of information about the record set information. -type RecordSet struct { - // RecordType - Resource record type. - RecordType *string `json:"recordType,omitempty"` - // RecordSetName - Recordset name. - RecordSetName *string `json:"recordSetName,omitempty"` - // Fqdn - Fqdn that resolves to private endpoint ip address. - Fqdn *string `json:"fqdn,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the recordset. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // TTL - Recordset time to live. - TTL *int32 `json:"ttl,omitempty"` - // IPAddresses - The private ip address of the private endpoint. - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecordSet. -func (rs RecordSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rs.RecordType != nil { - objectMap["recordType"] = rs.RecordType - } - if rs.RecordSetName != nil { - objectMap["recordSetName"] = rs.RecordSetName - } - if rs.Fqdn != nil { - objectMap["fqdn"] = rs.Fqdn - } - if rs.TTL != nil { - objectMap["ttl"] = rs.TTL - } - if rs.IPAddresses != nil { - objectMap["ipAddresses"] = rs.IPAddresses - } - return json.Marshal(objectMap) -} - -// ReferencedPublicIPAddress reference to a public IP address. -type ReferencedPublicIPAddress struct { - // ID - The PublicIPAddress Reference. - ID *string `json:"id,omitempty"` -} - -// Resource common resource representation. -type Resource struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.ID != nil { - objectMap["id"] = r.ID - } - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ResourceNavigationLink resourceNavigationLink resource. -type ResourceNavigationLink struct { - // ResourceNavigationLinkFormat - Resource navigation link properties format. - *ResourceNavigationLinkFormat `json:"properties,omitempty"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceNavigationLink. -func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rnl.ResourceNavigationLinkFormat != nil { - objectMap["properties"] = rnl.ResourceNavigationLinkFormat - } - if rnl.Name != nil { - objectMap["name"] = rnl.Name - } - if rnl.ID != nil { - objectMap["id"] = rnl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ResourceNavigationLink struct. -func (rnl *ResourceNavigationLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var resourceNavigationLinkFormat ResourceNavigationLinkFormat - err = json.Unmarshal(*v, &resourceNavigationLinkFormat) - if err != nil { - return err - } - rnl.ResourceNavigationLinkFormat = &resourceNavigationLinkFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rnl.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rnl.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rnl.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rnl.ID = &ID - } - } - } - - return nil -} - -// ResourceNavigationLinkFormat properties of ResourceNavigationLink. -type ResourceNavigationLinkFormat struct { - // LinkedResourceType - Resource type of the linked resource. - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - // Link - Link to the external resource. - Link *string `json:"link,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource navigation link resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceNavigationLinkFormat. -func (rnlf ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rnlf.LinkedResourceType != nil { - objectMap["linkedResourceType"] = rnlf.LinkedResourceType - } - if rnlf.Link != nil { - objectMap["link"] = rnlf.Link - } - return json.Marshal(objectMap) -} - -// ResourceNavigationLinksListResult response for ResourceNavigationLinks_List operation. -type ResourceNavigationLinksListResult struct { - autorest.Response `json:"-"` - // Value - The resource navigation links in a subnet. - Value *[]ResourceNavigationLink `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceNavigationLinksListResult. -func (rnllr ResourceNavigationLinksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rnllr.Value != nil { - objectMap["value"] = rnllr.Value - } - return json.Marshal(objectMap) -} - -// ResourceSet the base resource set for visibility and auto-approval. -type ResourceSet struct { - // Subscriptions - The list of subscriptions. - Subscriptions *[]string `json:"subscriptions,omitempty"` -} - -// RetentionPolicyParameters parameters that define the retention policy for flow log. -type RetentionPolicyParameters struct { - // Days - Number of days to retain flow log records. - Days *int32 `json:"days,omitempty"` - // Enabled - Flag to enable/disable retention. - Enabled *bool `json:"enabled,omitempty"` -} - -// Route route resource. -type Route struct { - autorest.Response `json:"-"` - // RoutePropertiesFormat - Properties of the route. - *RoutePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - The type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Route. -func (r Route) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.RoutePropertiesFormat != nil { - objectMap["properties"] = r.RoutePropertiesFormat - } - if r.Name != nil { - objectMap["name"] = r.Name - } - if r.Type != nil { - objectMap["type"] = r.Type - } - if r.ID != nil { - objectMap["id"] = r.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Route struct. -func (r *Route) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routePropertiesFormat RoutePropertiesFormat - err = json.Unmarshal(*v, &routePropertiesFormat) - if err != nil { - return err - } - r.RoutePropertiesFormat = &routePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - r.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - r.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - r.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - r.ID = &ID - } - } - } - - return nil -} - -// RouteFilter route Filter Resource. -type RouteFilter struct { - autorest.Response `json:"-"` - // RouteFilterPropertiesFormat - Properties of the route filter. - *RouteFilterPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RouteFilter. -func (rf RouteFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rf.RouteFilterPropertiesFormat != nil { - objectMap["properties"] = rf.RouteFilterPropertiesFormat - } - if rf.ID != nil { - objectMap["id"] = rf.ID - } - if rf.Location != nil { - objectMap["location"] = rf.Location - } - if rf.Tags != nil { - objectMap["tags"] = rf.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RouteFilter struct. -func (rf *RouteFilter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeFilterPropertiesFormat RouteFilterPropertiesFormat - err = json.Unmarshal(*v, &routeFilterPropertiesFormat) - if err != nil { - return err - } - rf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rf.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rf.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rf.Tags = tags - } - } - } - - return nil -} - -// RouteFilterListResult response for the ListRouteFilters API service call. -type RouteFilterListResult struct { - autorest.Response `json:"-"` - // Value - A list of route filters in a resource group. - Value *[]RouteFilter `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RouteFilterListResultIterator provides access to a complete listing of RouteFilter values. -type RouteFilterListResultIterator struct { - i int - page RouteFilterListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RouteFilterListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RouteFilterListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RouteFilterListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RouteFilterListResultIterator) Response() RouteFilterListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RouteFilterListResultIterator) Value() RouteFilter { - if !iter.page.NotDone() { - return RouteFilter{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RouteFilterListResultIterator type. -func NewRouteFilterListResultIterator(page RouteFilterListResultPage) RouteFilterListResultIterator { - return RouteFilterListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rflr RouteFilterListResult) IsEmpty() bool { - return rflr.Value == nil || len(*rflr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rflr RouteFilterListResult) hasNextLink() bool { - return rflr.NextLink != nil && len(*rflr.NextLink) != 0 -} - -// routeFilterListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rflr RouteFilterListResult) routeFilterListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rflr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rflr.NextLink))) -} - -// RouteFilterListResultPage contains a page of RouteFilter values. -type RouteFilterListResultPage struct { - fn func(context.Context, RouteFilterListResult) (RouteFilterListResult, error) - rflr RouteFilterListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RouteFilterListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rflr) - if err != nil { - return err - } - page.rflr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RouteFilterListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RouteFilterListResultPage) NotDone() bool { - return !page.rflr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RouteFilterListResultPage) Response() RouteFilterListResult { - return page.rflr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RouteFilterListResultPage) Values() []RouteFilter { - if page.rflr.IsEmpty() { - return nil - } - return *page.rflr.Value -} - -// Creates a new instance of the RouteFilterListResultPage type. -func NewRouteFilterListResultPage(cur RouteFilterListResult, getNextPage func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)) RouteFilterListResultPage { - return RouteFilterListResultPage{ - fn: getNextPage, - rflr: cur, - } -} - -// RouteFilterPropertiesFormat route Filter Resource. -type RouteFilterPropertiesFormat struct { - // Rules - Collection of RouteFilterRules contained within a route filter. - Rules *[]RouteFilterRule `json:"rules,omitempty"` - // Peerings - READ-ONLY; A collection of references to express route circuit peerings. - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - // Ipv6Peerings - READ-ONLY; A collection of references to express route circuit ipv6 peerings. - Ipv6Peerings *[]ExpressRouteCircuitPeering `json:"ipv6Peerings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route filter resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteFilterPropertiesFormat. -func (rfpf RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rfpf.Rules != nil { - objectMap["rules"] = rfpf.Rules - } - return json.Marshal(objectMap) -} - -// RouteFilterRule route Filter Rule Resource. -type RouteFilterRule struct { - autorest.Response `json:"-"` - // RouteFilterRulePropertiesFormat - Properties of the route filter rule. - *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteFilterRule. -func (rfr RouteFilterRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rfr.RouteFilterRulePropertiesFormat != nil { - objectMap["properties"] = rfr.RouteFilterRulePropertiesFormat - } - if rfr.Name != nil { - objectMap["name"] = rfr.Name - } - if rfr.Location != nil { - objectMap["location"] = rfr.Location - } - if rfr.ID != nil { - objectMap["id"] = rfr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RouteFilterRule struct. -func (rfr *RouteFilterRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat - err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) - if err != nil { - return err - } - rfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rfr.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rfr.Location = &location - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rfr.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rfr.ID = &ID - } - } - } - - return nil -} - -// RouteFilterRuleListResult response for the ListRouteFilterRules API service call. -type RouteFilterRuleListResult struct { - autorest.Response `json:"-"` - // Value - A list of RouteFilterRules in a resource group. - Value *[]RouteFilterRule `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RouteFilterRuleListResultIterator provides access to a complete listing of RouteFilterRule values. -type RouteFilterRuleListResultIterator struct { - i int - page RouteFilterRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RouteFilterRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RouteFilterRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RouteFilterRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RouteFilterRuleListResultIterator) Response() RouteFilterRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RouteFilterRuleListResultIterator) Value() RouteFilterRule { - if !iter.page.NotDone() { - return RouteFilterRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RouteFilterRuleListResultIterator type. -func NewRouteFilterRuleListResultIterator(page RouteFilterRuleListResultPage) RouteFilterRuleListResultIterator { - return RouteFilterRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rfrlr RouteFilterRuleListResult) IsEmpty() bool { - return rfrlr.Value == nil || len(*rfrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rfrlr RouteFilterRuleListResult) hasNextLink() bool { - return rfrlr.NextLink != nil && len(*rfrlr.NextLink) != 0 -} - -// routeFilterRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rfrlr RouteFilterRuleListResult) routeFilterRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rfrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rfrlr.NextLink))) -} - -// RouteFilterRuleListResultPage contains a page of RouteFilterRule values. -type RouteFilterRuleListResultPage struct { - fn func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error) - rfrlr RouteFilterRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RouteFilterRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rfrlr) - if err != nil { - return err - } - page.rfrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RouteFilterRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RouteFilterRuleListResultPage) NotDone() bool { - return !page.rfrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RouteFilterRuleListResultPage) Response() RouteFilterRuleListResult { - return page.rfrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RouteFilterRuleListResultPage) Values() []RouteFilterRule { - if page.rfrlr.IsEmpty() { - return nil - } - return *page.rfrlr.Value -} - -// Creates a new instance of the RouteFilterRuleListResultPage type. -func NewRouteFilterRuleListResultPage(cur RouteFilterRuleListResult, getNextPage func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)) RouteFilterRuleListResultPage { - return RouteFilterRuleListResultPage{ - fn: getNextPage, - rfrlr: cur, - } -} - -// RouteFilterRulePropertiesFormat route Filter Rule Resource. -type RouteFilterRulePropertiesFormat struct { - // Access - The access type of the rule. Possible values include: 'Allow', 'Deny' - Access Access `json:"access,omitempty"` - // RouteFilterRuleType - The rule type of the rule. - RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"` - // Communities - The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']. - Communities *[]string `json:"communities,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route filter rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteFilterRulePropertiesFormat. -func (rfrpf RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rfrpf.Access != "" { - objectMap["access"] = rfrpf.Access - } - if rfrpf.RouteFilterRuleType != nil { - objectMap["routeFilterRuleType"] = rfrpf.RouteFilterRuleType - } - if rfrpf.Communities != nil { - objectMap["communities"] = rfrpf.Communities - } - return json.Marshal(objectMap) -} - -// RouteFilterRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RouteFilterRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteFilterRulesClient) (RouteFilterRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteFilterRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteFilterRulesCreateOrUpdateFuture.Result. -func (future *RouteFilterRulesCreateOrUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rfr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rfr.Response.Response, err = future.GetResult(sender); err == nil && rfr.Response.Response.StatusCode != http.StatusNoContent { - rfr, err = client.CreateOrUpdateResponder(rfr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", rfr.Response.Response, "Failure responding to request") - } - } - return -} - -// RouteFilterRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RouteFilterRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteFilterRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteFilterRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteFilterRulesDeleteFuture.Result. -func (future *RouteFilterRulesDeleteFuture) result(client RouteFilterRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RouteFiltersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RouteFiltersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteFiltersClient) (RouteFilter, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteFiltersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteFiltersCreateOrUpdateFuture.Result. -func (future *RouteFiltersCreateOrUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rf.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteFiltersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rf.Response.Response, err = future.GetResult(sender); err == nil && rf.Response.Response.StatusCode != http.StatusNoContent { - rf, err = client.CreateOrUpdateResponder(rf.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", rf.Response.Response, "Failure responding to request") - } - } - return -} - -// RouteFiltersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RouteFiltersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteFiltersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteFiltersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteFiltersDeleteFuture.Result. -func (future *RouteFiltersDeleteFuture) result(client RouteFiltersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteFiltersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RouteListResult response for the ListRoute API service call. -type RouteListResult struct { - autorest.Response `json:"-"` - // Value - A list of routes in a resource group. - Value *[]Route `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RouteListResultIterator provides access to a complete listing of Route values. -type RouteListResultIterator struct { - i int - page RouteListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RouteListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RouteListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RouteListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RouteListResultIterator) Response() RouteListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RouteListResultIterator) Value() Route { - if !iter.page.NotDone() { - return Route{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RouteListResultIterator type. -func NewRouteListResultIterator(page RouteListResultPage) RouteListResultIterator { - return RouteListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rlr RouteListResult) IsEmpty() bool { - return rlr.Value == nil || len(*rlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rlr RouteListResult) hasNextLink() bool { - return rlr.NextLink != nil && len(*rlr.NextLink) != 0 -} - -// routeListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rlr.NextLink))) -} - -// RouteListResultPage contains a page of Route values. -type RouteListResultPage struct { - fn func(context.Context, RouteListResult) (RouteListResult, error) - rlr RouteListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rlr) - if err != nil { - return err - } - page.rlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RouteListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RouteListResultPage) NotDone() bool { - return !page.rlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RouteListResultPage) Response() RouteListResult { - return page.rlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RouteListResultPage) Values() []Route { - if page.rlr.IsEmpty() { - return nil - } - return *page.rlr.Value -} - -// Creates a new instance of the RouteListResultPage type. -func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage { - return RouteListResultPage{ - fn: getNextPage, - rlr: cur, - } -} - -// RouteMap the RouteMap child resource of a Virtual hub. -type RouteMap struct { - autorest.Response `json:"-"` - // RouteMapProperties - Properties of the RouteMap resource. - *RouteMapProperties `json:"properties,omitempty"` - // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteMap. -func (rm RouteMap) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rm.RouteMapProperties != nil { - objectMap["properties"] = rm.RouteMapProperties - } - if rm.ID != nil { - objectMap["id"] = rm.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RouteMap struct. -func (rm *RouteMap) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeMapProperties RouteMapProperties - err = json.Unmarshal(*v, &routeMapProperties) - if err != nil { - return err - } - rm.RouteMapProperties = &routeMapProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rm.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rm.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rm.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rm.ID = &ID - } - } - } - - return nil -} - -// RouteMapProperties properties of RouteMap resource -type RouteMapProperties struct { - // AssociatedInboundConnections - List of connections which have this RoutMap associated for inbound traffic. - AssociatedInboundConnections *[]string `json:"associatedInboundConnections,omitempty"` - // AssociatedOutboundConnections - List of connections which have this RoutMap associated for outbound traffic. - AssociatedOutboundConnections *[]string `json:"associatedOutboundConnections,omitempty"` - // Rules - List of RouteMap rules to be applied. - Rules *[]RouteMapRule `json:"rules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the RouteMap resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteMapProperties. -func (rmp RouteMapProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rmp.AssociatedInboundConnections != nil { - objectMap["associatedInboundConnections"] = rmp.AssociatedInboundConnections - } - if rmp.AssociatedOutboundConnections != nil { - objectMap["associatedOutboundConnections"] = rmp.AssociatedOutboundConnections - } - if rmp.Rules != nil { - objectMap["rules"] = rmp.Rules - } - return json.Marshal(objectMap) -} - -// RouteMapRule a RouteMap Rule. -type RouteMapRule struct { - // Name - The unique name for the rule. - Name *string `json:"name,omitempty"` - // MatchCriteria - List of matching criterion which will be applied to traffic. - MatchCriteria *[]Criterion `json:"matchCriteria,omitempty"` - // Actions - List of actions which will be applied on a match. - Actions *[]Action `json:"actions,omitempty"` - // NextStepIfMatched - Next step after rule is evaluated. Current supported behaviors are 'Continue'(to next rule) and 'Terminate'. Possible values include: 'NextStepUnknown', 'NextStepContinue', 'NextStepTerminate' - NextStepIfMatched NextStep `json:"nextStepIfMatched,omitempty"` -} - -// RouteMapsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RouteMapsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteMapsClient) (RouteMap, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteMapsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteMapsCreateOrUpdateFuture.Result. -func (future *RouteMapsCreateOrUpdateFuture) result(client RouteMapsClient) (rm RouteMap, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rm.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteMapsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rm.Response.Response, err = future.GetResult(sender); err == nil && rm.Response.Response.StatusCode != http.StatusNoContent { - rm, err = client.CreateOrUpdateResponder(rm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsCreateOrUpdateFuture", "Result", rm.Response.Response, "Failure responding to request") - } - } - return -} - -// RouteMapsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RouteMapsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteMapsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteMapsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteMapsDeleteFuture.Result. -func (future *RouteMapsDeleteFuture) result(client RouteMapsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteMapsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RoutePropertiesFormat route resource. -type RoutePropertiesFormat struct { - // AddressPrefix - The destination CIDR to which the route applies. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // NextHopType - The type of Azure hop the packet should be sent to. Possible values include: 'RouteNextHopTypeVirtualNetworkGateway', 'RouteNextHopTypeVnetLocal', 'RouteNextHopTypeInternet', 'RouteNextHopTypeVirtualAppliance', 'RouteNextHopTypeNone' - NextHopType RouteNextHopType `json:"nextHopType,omitempty"` - // NextHopIPAddress - The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // HasBgpOverride - A value indicating whether this route overrides overlapping BGP routes regardless of LPM. - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoutePropertiesFormat. -func (rpf RoutePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rpf.AddressPrefix != nil { - objectMap["addressPrefix"] = rpf.AddressPrefix - } - if rpf.NextHopType != "" { - objectMap["nextHopType"] = rpf.NextHopType - } - if rpf.NextHopIPAddress != nil { - objectMap["nextHopIpAddress"] = rpf.NextHopIPAddress - } - if rpf.HasBgpOverride != nil { - objectMap["hasBgpOverride"] = rpf.HasBgpOverride - } - return json.Marshal(objectMap) -} - -// RoutesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RoutesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RoutesClient) (Route, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RoutesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RoutesCreateOrUpdateFuture.Result. -func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - r.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { - r, err = client.CreateOrUpdateResponder(r.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", r.Response.Response, "Failure responding to request") - } - } - return -} - -// RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type RoutesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RoutesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RoutesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RoutesDeleteFuture.Result. -func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RouteTable route table resource. -type RouteTable struct { - autorest.Response `json:"-"` - // RouteTablePropertiesFormat - Properties of the route table. - *RouteTablePropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RouteTable. -func (rt RouteTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rt.RouteTablePropertiesFormat != nil { - objectMap["properties"] = rt.RouteTablePropertiesFormat - } - if rt.ID != nil { - objectMap["id"] = rt.ID - } - if rt.Location != nil { - objectMap["location"] = rt.Location - } - if rt.Tags != nil { - objectMap["tags"] = rt.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RouteTable struct. -func (rt *RouteTable) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routeTablePropertiesFormat RouteTablePropertiesFormat - err = json.Unmarshal(*v, &routeTablePropertiesFormat) - if err != nil { - return err - } - rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - rt.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rt.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rt.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rt.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rt.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rt.Tags = tags - } - } - } - - return nil -} - -// RouteTableListResult response for the ListRouteTable API service call. -type RouteTableListResult struct { - autorest.Response `json:"-"` - // Value - A list of route tables in a resource group. - Value *[]RouteTable `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// RouteTableListResultIterator provides access to a complete listing of RouteTable values. -type RouteTableListResultIterator struct { - i int - page RouteTableListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RouteTableListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RouteTableListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RouteTableListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RouteTableListResultIterator) Response() RouteTableListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RouteTableListResultIterator) Value() RouteTable { - if !iter.page.NotDone() { - return RouteTable{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RouteTableListResultIterator type. -func NewRouteTableListResultIterator(page RouteTableListResultPage) RouteTableListResultIterator { - return RouteTableListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rtlr RouteTableListResult) IsEmpty() bool { - return rtlr.Value == nil || len(*rtlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rtlr RouteTableListResult) hasNextLink() bool { - return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0 -} - -// routeTableListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rtlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rtlr.NextLink))) -} - -// RouteTableListResultPage contains a page of RouteTable values. -type RouteTableListResultPage struct { - fn func(context.Context, RouteTableListResult) (RouteTableListResult, error) - rtlr RouteTableListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rtlr) - if err != nil { - return err - } - page.rtlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RouteTableListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RouteTableListResultPage) NotDone() bool { - return !page.rtlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RouteTableListResultPage) Response() RouteTableListResult { - return page.rtlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RouteTableListResultPage) Values() []RouteTable { - if page.rtlr.IsEmpty() { - return nil - } - return *page.rtlr.Value -} - -// Creates a new instance of the RouteTableListResultPage type. -func NewRouteTableListResultPage(cur RouteTableListResult, getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage { - return RouteTableListResultPage{ - fn: getNextPage, - rtlr: cur, - } -} - -// RouteTablePropertiesFormat route Table resource. -type RouteTablePropertiesFormat struct { - // Routes - Collection of routes contained within a route table. - Routes *[]Route `json:"routes,omitempty"` - // Subnets - READ-ONLY; A collection of references to subnets. - Subnets *[]Subnet `json:"subnets,omitempty"` - // DisableBgpRoutePropagation - Whether to disable the routes learned by BGP on that route table. True means disable. - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the route table resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the route table. - ResourceGUID *string `json:"resourceGuid,omitempty"` -} - -// MarshalJSON is the custom marshaler for RouteTablePropertiesFormat. -func (rtpf RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rtpf.Routes != nil { - objectMap["routes"] = rtpf.Routes - } - if rtpf.DisableBgpRoutePropagation != nil { - objectMap["disableBgpRoutePropagation"] = rtpf.DisableBgpRoutePropagation - } - return json.Marshal(objectMap) -} - -// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RouteTablesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteTablesClient) (RouteTable, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteTablesCreateOrUpdateFuture.Result. -func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) (rt RouteTable, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rt.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { - rt, err = client.CreateOrUpdateResponder(rt.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request") - } - } - return -} - -// RouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RouteTablesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RouteTablesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RouteTablesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RouteTablesDeleteFuture.Result. -func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RoutingConfiguration routing Configuration indicating the associated and propagated route tables for -// this connection. -type RoutingConfiguration struct { - // AssociatedRouteTable - The resource id RouteTable associated with this RoutingConfiguration. - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - // PropagatedRouteTables - The list of RouteTables to advertise the routes to. - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - // VnetRoutes - List of routes that control routing from VirtualHub into a virtual network connection. - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` - // InboundRouteMap - The resource id of the RouteMap associated with this RoutingConfiguration for inbound learned routes. - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - // OutboundRouteMap - The resource id of theRouteMap associated with this RoutingConfiguration for outbound advertised routes. - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` -} - -// RoutingIntent the routing intent child resource of a Virtual hub. -type RoutingIntent struct { - autorest.Response `json:"-"` - // RoutingIntentProperties - Properties of the RoutingIntent resource. - *RoutingIntentProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoutingIntent. -func (ri RoutingIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ri.RoutingIntentProperties != nil { - objectMap["properties"] = ri.RoutingIntentProperties - } - if ri.Name != nil { - objectMap["name"] = ri.Name - } - if ri.ID != nil { - objectMap["id"] = ri.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RoutingIntent struct. -func (ri *RoutingIntent) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var routingIntentProperties RoutingIntentProperties - err = json.Unmarshal(*v, &routingIntentProperties) - if err != nil { - return err - } - ri.RoutingIntentProperties = &routingIntentProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ri.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ri.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ri.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ri.ID = &ID - } - } - } - - return nil -} - -// RoutingIntentCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type RoutingIntentCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RoutingIntentClient) (RoutingIntent, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RoutingIntentCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RoutingIntentCreateOrUpdateFuture.Result. -func (future *RoutingIntentCreateOrUpdateFuture) result(client RoutingIntentClient) (ri RoutingIntent, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ri.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RoutingIntentCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ri.Response.Response, err = future.GetResult(sender); err == nil && ri.Response.Response.StatusCode != http.StatusNoContent { - ri, err = client.CreateOrUpdateResponder(ri.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentCreateOrUpdateFuture", "Result", ri.Response.Response, "Failure responding to request") - } - } - return -} - -// RoutingIntentDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type RoutingIntentDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(RoutingIntentClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *RoutingIntentDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for RoutingIntentDeleteFuture.Result. -func (future *RoutingIntentDeleteFuture) result(client RoutingIntentClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.RoutingIntentDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// RoutingIntentProperties the properties of a RoutingIntent resource. -type RoutingIntentProperties struct { - // RoutingPolicies - List of routing policies. - RoutingPolicies *[]RoutingPolicy `json:"routingPolicies,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the RoutingIntent resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for RoutingIntentProperties. -func (rip RoutingIntentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rip.RoutingPolicies != nil { - objectMap["routingPolicies"] = rip.RoutingPolicies - } - return json.Marshal(objectMap) -} - -// RoutingPolicy the routing policy object used in a RoutingIntent resource. -type RoutingPolicy struct { - // Name - The unique name for the routing policy. - Name *string `json:"name,omitempty"` - // Destinations - List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic). - Destinations *[]string `json:"destinations,omitempty"` - // NextHop - The next hop resource id on which this routing policy is applicable to. - NextHop *string `json:"nextHop,omitempty"` -} - -// Rule rule of type network. -type Rule struct { - // IPProtocols - Array of FirewallPolicyRuleNetworkProtocols. - IPProtocols *[]FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - // SourceAddresses - List of source IP addresses for this rule. - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - // DestinationAddresses - List of destination IP addresses or Service Tags. - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - // DestinationPorts - List of destination ports. - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // SourceIPGroups - List of source IpGroups for this rule. - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - // DestinationIPGroups - List of destination IpGroups for this rule. - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` - // DestinationFqdns - List of destination FQDNs. - DestinationFqdns *[]string `json:"destinationFqdns,omitempty"` - // Name - Name of the rule. - Name *string `json:"name,omitempty"` - // Description - Description of the rule. - Description *string `json:"description,omitempty"` - // RuleType - Possible values include: 'RuleTypeFirewallPolicyRule', 'RuleTypeApplicationRule', 'RuleTypeNatRule', 'RuleTypeNetworkRule' - RuleType RuleType `json:"ruleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for Rule. -func (r Rule) MarshalJSON() ([]byte, error) { - r.RuleType = RuleTypeNetworkRule - objectMap := make(map[string]interface{}) - if r.IPProtocols != nil { - objectMap["ipProtocols"] = r.IPProtocols - } - if r.SourceAddresses != nil { - objectMap["sourceAddresses"] = r.SourceAddresses - } - if r.DestinationAddresses != nil { - objectMap["destinationAddresses"] = r.DestinationAddresses - } - if r.DestinationPorts != nil { - objectMap["destinationPorts"] = r.DestinationPorts - } - if r.SourceIPGroups != nil { - objectMap["sourceIpGroups"] = r.SourceIPGroups - } - if r.DestinationIPGroups != nil { - objectMap["destinationIpGroups"] = r.DestinationIPGroups - } - if r.DestinationFqdns != nil { - objectMap["destinationFqdns"] = r.DestinationFqdns - } - if r.Name != nil { - objectMap["name"] = r.Name - } - if r.Description != nil { - objectMap["description"] = r.Description - } - if r.RuleType != "" { - objectMap["ruleType"] = r.RuleType - } - return json.Marshal(objectMap) -} - -// AsApplicationRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsApplicationRule() (*ApplicationRule, bool) { - return nil, false -} - -// AsNatRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsNatRule() (*NatRule, bool) { - return nil, false -} - -// AsRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsRule() (*Rule, bool) { - return &r, true -} - -// AsFirewallPolicyRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) { - return nil, false -} - -// AsBasicFirewallPolicyRule is the BasicFirewallPolicyRule implementation for Rule. -func (r Rule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { - return &r, true -} - -// ScopeConnection the Scope Connections resource -type ScopeConnection struct { - autorest.Response `json:"-"` - // ScopeConnectionProperties - The scope connection properties - *ScopeConnectionProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for ScopeConnection. -func (sc ScopeConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sc.ScopeConnectionProperties != nil { - objectMap["properties"] = sc.ScopeConnectionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ScopeConnection struct. -func (sc *ScopeConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var scopeConnectionProperties ScopeConnectionProperties - err = json.Unmarshal(*v, &scopeConnectionProperties) - if err != nil { - return err - } - sc.ScopeConnectionProperties = &scopeConnectionProperties - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - sc.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sc.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sc.Etag = &etag - } - } - } - - return nil -} - -// ScopeConnectionListResult list of scope connections. -type ScopeConnectionListResult struct { - autorest.Response `json:"-"` - // Value - List of scope connections. - Value *[]ScopeConnection `json:"value,omitempty"` - // NextLink - Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ScopeConnectionListResultIterator provides access to a complete listing of ScopeConnection values. -type ScopeConnectionListResultIterator struct { - i int - page ScopeConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ScopeConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ScopeConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ScopeConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ScopeConnectionListResultIterator) Response() ScopeConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ScopeConnectionListResultIterator) Value() ScopeConnection { - if !iter.page.NotDone() { - return ScopeConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ScopeConnectionListResultIterator type. -func NewScopeConnectionListResultIterator(page ScopeConnectionListResultPage) ScopeConnectionListResultIterator { - return ScopeConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sclr ScopeConnectionListResult) IsEmpty() bool { - return sclr.Value == nil || len(*sclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sclr ScopeConnectionListResult) hasNextLink() bool { - return sclr.NextLink != nil && len(*sclr.NextLink) != 0 -} - -// scopeConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sclr ScopeConnectionListResult) scopeConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !sclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sclr.NextLink))) -} - -// ScopeConnectionListResultPage contains a page of ScopeConnection values. -type ScopeConnectionListResultPage struct { - fn func(context.Context, ScopeConnectionListResult) (ScopeConnectionListResult, error) - sclr ScopeConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ScopeConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sclr) - if err != nil { - return err - } - page.sclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ScopeConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ScopeConnectionListResultPage) NotDone() bool { - return !page.sclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ScopeConnectionListResultPage) Response() ScopeConnectionListResult { - return page.sclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ScopeConnectionListResultPage) Values() []ScopeConnection { - if page.sclr.IsEmpty() { - return nil - } - return *page.sclr.Value -} - -// Creates a new instance of the ScopeConnectionListResultPage type. -func NewScopeConnectionListResultPage(cur ScopeConnectionListResult, getNextPage func(context.Context, ScopeConnectionListResult) (ScopeConnectionListResult, error)) ScopeConnectionListResultPage { - return ScopeConnectionListResultPage{ - fn: getNextPage, - sclr: cur, - } -} - -// ScopeConnectionProperties scope connection. -type ScopeConnectionProperties struct { - // TenantID - Tenant ID. - TenantID *string `json:"tenantId,omitempty"` - // ResourceID - Resource ID. - ResourceID *string `json:"resourceId,omitempty"` - // ConnectionState - Connection State. Possible values include: 'ScopeConnectionStateConnected', 'ScopeConnectionStatePending', 'ScopeConnectionStateConflict', 'ScopeConnectionStateRevoked', 'ScopeConnectionStateRejected' - ConnectionState ScopeConnectionState `json:"connectionState,omitempty"` - // Description - A description of the scope connection. - Description *string `json:"description,omitempty"` -} - -// SecurityAdminConfiguration defines the security admin configuration -type SecurityAdminConfiguration struct { - autorest.Response `json:"-"` - // SecurityAdminConfigurationPropertiesFormat - Indicates the properties for the network manager security admin configuration. - *SecurityAdminConfigurationPropertiesFormat `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityAdminConfiguration. -func (sac SecurityAdminConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sac.SecurityAdminConfigurationPropertiesFormat != nil { - objectMap["properties"] = sac.SecurityAdminConfigurationPropertiesFormat - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecurityAdminConfiguration struct. -func (sac *SecurityAdminConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityAdminConfigurationPropertiesFormat SecurityAdminConfigurationPropertiesFormat - err = json.Unmarshal(*v, &securityAdminConfigurationPropertiesFormat) - if err != nil { - return err - } - sac.SecurityAdminConfigurationPropertiesFormat = &securityAdminConfigurationPropertiesFormat - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - sac.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sac.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sac.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sac.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sac.Etag = &etag - } - } - } - - return nil -} - -// SecurityAdminConfigurationListResult a list of network manager security admin configurations -type SecurityAdminConfigurationListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of security admin configurations - Value *[]SecurityAdminConfiguration `json:"value,omitempty"` - // NextLink - Gets the URL to get the next page of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecurityAdminConfigurationListResultIterator provides access to a complete listing of -// SecurityAdminConfiguration values. -type SecurityAdminConfigurationListResultIterator struct { - i int - page SecurityAdminConfigurationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SecurityAdminConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SecurityAdminConfigurationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecurityAdminConfigurationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SecurityAdminConfigurationListResultIterator) Response() SecurityAdminConfigurationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SecurityAdminConfigurationListResultIterator) Value() SecurityAdminConfiguration { - if !iter.page.NotDone() { - return SecurityAdminConfiguration{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecurityAdminConfigurationListResultIterator type. -func NewSecurityAdminConfigurationListResultIterator(page SecurityAdminConfigurationListResultPage) SecurityAdminConfigurationListResultIterator { - return SecurityAdminConfigurationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (saclr SecurityAdminConfigurationListResult) IsEmpty() bool { - return saclr.Value == nil || len(*saclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (saclr SecurityAdminConfigurationListResult) hasNextLink() bool { - return saclr.NextLink != nil && len(*saclr.NextLink) != 0 -} - -// securityAdminConfigurationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (saclr SecurityAdminConfigurationListResult) securityAdminConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !saclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(saclr.NextLink))) -} - -// SecurityAdminConfigurationListResultPage contains a page of SecurityAdminConfiguration values. -type SecurityAdminConfigurationListResultPage struct { - fn func(context.Context, SecurityAdminConfigurationListResult) (SecurityAdminConfigurationListResult, error) - saclr SecurityAdminConfigurationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SecurityAdminConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.saclr) - if err != nil { - return err - } - page.saclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SecurityAdminConfigurationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecurityAdminConfigurationListResultPage) NotDone() bool { - return !page.saclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecurityAdminConfigurationListResultPage) Response() SecurityAdminConfigurationListResult { - return page.saclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecurityAdminConfigurationListResultPage) Values() []SecurityAdminConfiguration { - if page.saclr.IsEmpty() { - return nil - } - return *page.saclr.Value -} - -// Creates a new instance of the SecurityAdminConfigurationListResultPage type. -func NewSecurityAdminConfigurationListResultPage(cur SecurityAdminConfigurationListResult, getNextPage func(context.Context, SecurityAdminConfigurationListResult) (SecurityAdminConfigurationListResult, error)) SecurityAdminConfigurationListResultPage { - return SecurityAdminConfigurationListResultPage{ - fn: getNextPage, - saclr: cur, - } -} - -// SecurityAdminConfigurationPropertiesFormat defines the security admin configuration properties. -type SecurityAdminConfigurationPropertiesFormat struct { - // Description - A description of the security configuration. - Description *string `json:"description,omitempty"` - // ApplyOnNetworkIntentPolicyBasedServices - Enum list of network intent policy based services. - ApplyOnNetworkIntentPolicyBasedServices *[]IntentPolicyBasedService `json:"applyOnNetworkIntentPolicyBasedServices,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityAdminConfigurationPropertiesFormat. -func (sacpf SecurityAdminConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sacpf.Description != nil { - objectMap["description"] = sacpf.Description - } - if sacpf.ApplyOnNetworkIntentPolicyBasedServices != nil { - objectMap["applyOnNetworkIntentPolicyBasedServices"] = sacpf.ApplyOnNetworkIntentPolicyBasedServices - } - return json.Marshal(objectMap) -} - -// SecurityAdminConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SecurityAdminConfigurationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityAdminConfigurationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityAdminConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityAdminConfigurationsDeleteFuture.Result. -func (future *SecurityAdminConfigurationsDeleteFuture) result(client SecurityAdminConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityAdminConfigurationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SecurityGroup networkSecurityGroup resource. -type SecurityGroup struct { - autorest.Response `json:"-"` - // SecurityGroupPropertiesFormat - Properties of the network security group. - *SecurityGroupPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for SecurityGroup. -func (sg SecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sg.SecurityGroupPropertiesFormat != nil { - objectMap["properties"] = sg.SecurityGroupPropertiesFormat - } - if sg.ID != nil { - objectMap["id"] = sg.ID - } - if sg.Location != nil { - objectMap["location"] = sg.Location - } - if sg.Tags != nil { - objectMap["tags"] = sg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct. -func (sg *SecurityGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityGroupPropertiesFormat SecurityGroupPropertiesFormat - err = json.Unmarshal(*v, &securityGroupPropertiesFormat) - if err != nil { - return err - } - sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sg.Tags = tags - } - } - } - - return nil -} - -// SecurityGroupListResult response for ListNetworkSecurityGroups API service call. -type SecurityGroupListResult struct { - autorest.Response `json:"-"` - // Value - A list of NetworkSecurityGroup resources. - Value *[]SecurityGroup `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecurityGroupListResultIterator provides access to a complete listing of SecurityGroup values. -type SecurityGroupListResultIterator struct { - i int - page SecurityGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SecurityGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecurityGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SecurityGroupListResultIterator) Response() SecurityGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SecurityGroupListResultIterator) Value() SecurityGroup { - if !iter.page.NotDone() { - return SecurityGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecurityGroupListResultIterator type. -func NewSecurityGroupListResultIterator(page SecurityGroupListResultPage) SecurityGroupListResultIterator { - return SecurityGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sglr SecurityGroupListResult) IsEmpty() bool { - return sglr.Value == nil || len(*sglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sglr SecurityGroupListResult) hasNextLink() bool { - return sglr.NextLink != nil && len(*sglr.NextLink) != 0 -} - -// securityGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !sglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sglr.NextLink))) -} - -// SecurityGroupListResultPage contains a page of SecurityGroup values. -type SecurityGroupListResultPage struct { - fn func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error) - sglr SecurityGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sglr) - if err != nil { - return err - } - page.sglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SecurityGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecurityGroupListResultPage) NotDone() bool { - return !page.sglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecurityGroupListResultPage) Response() SecurityGroupListResult { - return page.sglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecurityGroupListResultPage) Values() []SecurityGroup { - if page.sglr.IsEmpty() { - return nil - } - return *page.sglr.Value -} - -// Creates a new instance of the SecurityGroupListResultPage type. -func NewSecurityGroupListResultPage(cur SecurityGroupListResult, getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage { - return SecurityGroupListResultPage{ - fn: getNextPage, - sglr: cur, - } -} - -// SecurityGroupNetworkInterface network interface and all its associated security rules. -type SecurityGroupNetworkInterface struct { - // ID - ID of the network interface. - ID *string `json:"id,omitempty"` - // SecurityRuleAssociations - All security rules associated with the network interface. - SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` -} - -// SecurityGroupPropertiesFormat network Security Group resource. -type SecurityGroupPropertiesFormat struct { - // FlushConnection - When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. - FlushConnection *bool `json:"flushConnection,omitempty"` - // SecurityRules - A collection of security rules of the network security group. - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - // DefaultSecurityRules - READ-ONLY; The default security rules of network security group. - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - // NetworkInterfaces - READ-ONLY; A collection of references to network interfaces. - NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` - // Subnets - READ-ONLY; A collection of references to subnets. - Subnets *[]Subnet `json:"subnets,omitempty"` - // FlowLogs - READ-ONLY; A collection of references to flow log resources. - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the network security group resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the network security group resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityGroupPropertiesFormat. -func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgpf.FlushConnection != nil { - objectMap["flushConnection"] = sgpf.FlushConnection - } - if sgpf.SecurityRules != nil { - objectMap["securityRules"] = sgpf.SecurityRules - } - return json.Marshal(objectMap) -} - -// SecurityGroupResult network configuration diagnostic result corresponded provided traffic query. -type SecurityGroupResult struct { - // SecurityRuleAccessResult - The network traffic is allowed or denied. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' - SecurityRuleAccessResult SecurityRuleAccess `json:"securityRuleAccessResult,omitempty"` - // EvaluatedNetworkSecurityGroups - READ-ONLY; List of results network security groups diagnostic. - EvaluatedNetworkSecurityGroups *[]EvaluatedNetworkSecurityGroup `json:"evaluatedNetworkSecurityGroups,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityGroupResult. -func (sgr SecurityGroupResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sgr.SecurityRuleAccessResult != "" { - objectMap["securityRuleAccessResult"] = sgr.SecurityRuleAccessResult - } - return json.Marshal(objectMap) -} - -// SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SecurityGroupsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityGroupsClient) (SecurityGroup, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityGroupsCreateOrUpdateFuture.Result. -func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent { - sg, err = client.CreateOrUpdateResponder(sg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request") - } - } - return -} - -// SecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SecurityGroupsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityGroupsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityGroupsDeleteFuture.Result. -func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SecurityGroupViewParameters parameters that define the VM to check security groups for. -type SecurityGroupViewParameters struct { - // TargetResourceID - ID of the target VM. - TargetResourceID *string `json:"targetResourceId,omitempty"` -} - -// SecurityGroupViewResult the information about security rules applied to the specified VM. -type SecurityGroupViewResult struct { - autorest.Response `json:"-"` - // NetworkInterfaces - List of network interfaces on the specified VM. - NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` -} - -// SecurityPartnerProvider security Partner Provider resource. -type SecurityPartnerProvider struct { - autorest.Response `json:"-"` - // SecurityPartnerProviderPropertiesFormat - Properties of the Security Partner Provider. - *SecurityPartnerProviderPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for SecurityPartnerProvider. -func (spp SecurityPartnerProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spp.SecurityPartnerProviderPropertiesFormat != nil { - objectMap["properties"] = spp.SecurityPartnerProviderPropertiesFormat - } - if spp.ID != nil { - objectMap["id"] = spp.ID - } - if spp.Location != nil { - objectMap["location"] = spp.Location - } - if spp.Tags != nil { - objectMap["tags"] = spp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecurityPartnerProvider struct. -func (spp *SecurityPartnerProvider) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityPartnerProviderPropertiesFormat SecurityPartnerProviderPropertiesFormat - err = json.Unmarshal(*v, &securityPartnerProviderPropertiesFormat) - if err != nil { - return err - } - spp.SecurityPartnerProviderPropertiesFormat = &securityPartnerProviderPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - spp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - spp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - spp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - spp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - spp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - spp.Tags = tags - } - } - } - - return nil -} - -// SecurityPartnerProviderListResult response for ListSecurityPartnerProviders API service call. -type SecurityPartnerProviderListResult struct { - autorest.Response `json:"-"` - // Value - List of Security Partner Providers in a resource group. - Value *[]SecurityPartnerProvider `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecurityPartnerProviderListResultIterator provides access to a complete listing of -// SecurityPartnerProvider values. -type SecurityPartnerProviderListResultIterator struct { - i int - page SecurityPartnerProviderListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SecurityPartnerProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProviderListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SecurityPartnerProviderListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecurityPartnerProviderListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SecurityPartnerProviderListResultIterator) Response() SecurityPartnerProviderListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SecurityPartnerProviderListResultIterator) Value() SecurityPartnerProvider { - if !iter.page.NotDone() { - return SecurityPartnerProvider{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecurityPartnerProviderListResultIterator type. -func NewSecurityPartnerProviderListResultIterator(page SecurityPartnerProviderListResultPage) SecurityPartnerProviderListResultIterator { - return SecurityPartnerProviderListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (spplr SecurityPartnerProviderListResult) IsEmpty() bool { - return spplr.Value == nil || len(*spplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (spplr SecurityPartnerProviderListResult) hasNextLink() bool { - return spplr.NextLink != nil && len(*spplr.NextLink) != 0 -} - -// securityPartnerProviderListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (spplr SecurityPartnerProviderListResult) securityPartnerProviderListResultPreparer(ctx context.Context) (*http.Request, error) { - if !spplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(spplr.NextLink))) -} - -// SecurityPartnerProviderListResultPage contains a page of SecurityPartnerProvider values. -type SecurityPartnerProviderListResultPage struct { - fn func(context.Context, SecurityPartnerProviderListResult) (SecurityPartnerProviderListResult, error) - spplr SecurityPartnerProviderListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SecurityPartnerProviderListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProviderListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.spplr) - if err != nil { - return err - } - page.spplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SecurityPartnerProviderListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecurityPartnerProviderListResultPage) NotDone() bool { - return !page.spplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecurityPartnerProviderListResultPage) Response() SecurityPartnerProviderListResult { - return page.spplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecurityPartnerProviderListResultPage) Values() []SecurityPartnerProvider { - if page.spplr.IsEmpty() { - return nil - } - return *page.spplr.Value -} - -// Creates a new instance of the SecurityPartnerProviderListResultPage type. -func NewSecurityPartnerProviderListResultPage(cur SecurityPartnerProviderListResult, getNextPage func(context.Context, SecurityPartnerProviderListResult) (SecurityPartnerProviderListResult, error)) SecurityPartnerProviderListResultPage { - return SecurityPartnerProviderListResultPage{ - fn: getNextPage, - spplr: cur, - } -} - -// SecurityPartnerProviderPropertiesFormat properties of the Security Partner Provider. -type SecurityPartnerProviderPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the Security Partner Provider resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // SecurityProviderName - The security provider name. Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' - SecurityProviderName SecurityProviderName `json:"securityProviderName,omitempty"` - // ConnectionStatus - READ-ONLY; The connection status with the Security Partner Provider. Possible values include: 'SecurityPartnerProviderConnectionStatusUnknown', 'SecurityPartnerProviderConnectionStatusPartiallyConnected', 'SecurityPartnerProviderConnectionStatusConnected', 'SecurityPartnerProviderConnectionStatusNotConnected' - ConnectionStatus SecurityPartnerProviderConnectionStatus `json:"connectionStatus,omitempty"` - // VirtualHub - The virtualHub to which the Security Partner Provider belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityPartnerProviderPropertiesFormat. -func (spppf SecurityPartnerProviderPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spppf.SecurityProviderName != "" { - objectMap["securityProviderName"] = spppf.SecurityProviderName - } - if spppf.VirtualHub != nil { - objectMap["virtualHub"] = spppf.VirtualHub - } - return json.Marshal(objectMap) -} - -// SecurityPartnerProvidersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type SecurityPartnerProvidersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityPartnerProvidersClient) (SecurityPartnerProvider, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityPartnerProvidersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityPartnerProvidersCreateOrUpdateFuture.Result. -func (future *SecurityPartnerProvidersCreateOrUpdateFuture) result(client SecurityPartnerProvidersClient) (spp SecurityPartnerProvider, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - spp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityPartnerProvidersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if spp.Response.Response, err = future.GetResult(sender); err == nil && spp.Response.Response.StatusCode != http.StatusNoContent { - spp, err = client.CreateOrUpdateResponder(spp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersCreateOrUpdateFuture", "Result", spp.Response.Response, "Failure responding to request") - } - } - return -} - -// SecurityPartnerProvidersDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SecurityPartnerProvidersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityPartnerProvidersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityPartnerProvidersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityPartnerProvidersDeleteFuture.Result. -func (future *SecurityPartnerProvidersDeleteFuture) result(client SecurityPartnerProvidersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityPartnerProvidersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SecurityRule network security rule. -type SecurityRule struct { - autorest.Response `json:"-"` - // SecurityRulePropertiesFormat - Properties of the security rule. - *SecurityRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - The type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityRule. -func (sr SecurityRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sr.SecurityRulePropertiesFormat != nil { - objectMap["properties"] = sr.SecurityRulePropertiesFormat - } - if sr.Name != nil { - objectMap["name"] = sr.Name - } - if sr.Type != nil { - objectMap["type"] = sr.Type - } - if sr.ID != nil { - objectMap["id"] = sr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SecurityRule struct. -func (sr *SecurityRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var securityRulePropertiesFormat SecurityRulePropertiesFormat - err = json.Unmarshal(*v, &securityRulePropertiesFormat) - if err != nil { - return err - } - sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sr.ID = &ID - } - } - } - - return nil -} - -// SecurityRuleAssociations all security rules associated with the network interface. -type SecurityRuleAssociations struct { - // NetworkInterfaceAssociation - Network interface and it's custom security rules. - NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` - // SubnetAssociation - Subnet and it's custom security rules. - SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` - // DefaultSecurityRules - Collection of default security rules of the network security group. - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - // EffectiveSecurityRules - Collection of effective security rules. - EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` -} - -// SecurityRuleListResult response for ListSecurityRule API service call. Retrieves all security rules that -// belongs to a network security group. -type SecurityRuleListResult struct { - autorest.Response `json:"-"` - // Value - The security rules in a network security group. - Value *[]SecurityRule `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SecurityRuleListResultIterator provides access to a complete listing of SecurityRule values. -type SecurityRuleListResultIterator struct { - i int - page SecurityRuleListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SecurityRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SecurityRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SecurityRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SecurityRuleListResultIterator) Response() SecurityRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SecurityRuleListResultIterator) Value() SecurityRule { - if !iter.page.NotDone() { - return SecurityRule{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SecurityRuleListResultIterator type. -func NewSecurityRuleListResultIterator(page SecurityRuleListResultPage) SecurityRuleListResultIterator { - return SecurityRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (srlr SecurityRuleListResult) IsEmpty() bool { - return srlr.Value == nil || len(*srlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (srlr SecurityRuleListResult) hasNextLink() bool { - return srlr.NextLink != nil && len(*srlr.NextLink) != 0 -} - -// securityRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !srlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(srlr.NextLink))) -} - -// SecurityRuleListResultPage contains a page of SecurityRule values. -type SecurityRuleListResultPage struct { - fn func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error) - srlr SecurityRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.srlr) - if err != nil { - return err - } - page.srlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SecurityRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SecurityRuleListResultPage) NotDone() bool { - return !page.srlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SecurityRuleListResultPage) Response() SecurityRuleListResult { - return page.srlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SecurityRuleListResultPage) Values() []SecurityRule { - if page.srlr.IsEmpty() { - return nil - } - return *page.srlr.Value -} - -// Creates a new instance of the SecurityRuleListResultPage type. -func NewSecurityRuleListResultPage(cur SecurityRuleListResult, getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage { - return SecurityRuleListResultPage{ - fn: getNextPage, - srlr: cur, - } -} - -// SecurityRulePropertiesFormat security rule resource. -type SecurityRulePropertiesFormat struct { - // Description - A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - // Protocol - Network protocol this rule applies to. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolIcmp', 'SecurityRuleProtocolEsp', 'SecurityRuleProtocolAsterisk', 'SecurityRuleProtocolAh' - Protocol SecurityRuleProtocol `json:"protocol,omitempty"` - // SourcePortRange - The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. - SourcePortRange *string `json:"sourcePortRange,omitempty"` - // DestinationPortRange - The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - // SourceAddressPrefix - The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - // SourceAddressPrefixes - The CIDR or source IP ranges. - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - // SourceApplicationSecurityGroups - The application security group specified as source. - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - // DestinationAddressPrefix - The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - // DestinationAddressPrefixes - The destination address prefixes. CIDR or destination IP ranges. - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - // DestinationApplicationSecurityGroups - The application security group specified as destination. - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - // SourcePortRanges - The source port ranges. - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - // DestinationPortRanges - The destination port ranges. - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - // Access - The network traffic is allowed or denied. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' - Access SecurityRuleAccess `json:"access,omitempty"` - // Priority - The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. - Priority *int32 `json:"priority,omitempty"` - // Direction - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' - Direction SecurityRuleDirection `json:"direction,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the security rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for SecurityRulePropertiesFormat. -func (srpf SecurityRulePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if srpf.Description != nil { - objectMap["description"] = srpf.Description - } - if srpf.Protocol != "" { - objectMap["protocol"] = srpf.Protocol - } - if srpf.SourcePortRange != nil { - objectMap["sourcePortRange"] = srpf.SourcePortRange - } - if srpf.DestinationPortRange != nil { - objectMap["destinationPortRange"] = srpf.DestinationPortRange - } - if srpf.SourceAddressPrefix != nil { - objectMap["sourceAddressPrefix"] = srpf.SourceAddressPrefix - } - if srpf.SourceAddressPrefixes != nil { - objectMap["sourceAddressPrefixes"] = srpf.SourceAddressPrefixes - } - if srpf.SourceApplicationSecurityGroups != nil { - objectMap["sourceApplicationSecurityGroups"] = srpf.SourceApplicationSecurityGroups - } - if srpf.DestinationAddressPrefix != nil { - objectMap["destinationAddressPrefix"] = srpf.DestinationAddressPrefix - } - if srpf.DestinationAddressPrefixes != nil { - objectMap["destinationAddressPrefixes"] = srpf.DestinationAddressPrefixes - } - if srpf.DestinationApplicationSecurityGroups != nil { - objectMap["destinationApplicationSecurityGroups"] = srpf.DestinationApplicationSecurityGroups - } - if srpf.SourcePortRanges != nil { - objectMap["sourcePortRanges"] = srpf.SourcePortRanges - } - if srpf.DestinationPortRanges != nil { - objectMap["destinationPortRanges"] = srpf.DestinationPortRanges - } - if srpf.Access != "" { - objectMap["access"] = srpf.Access - } - if srpf.Priority != nil { - objectMap["priority"] = srpf.Priority - } - if srpf.Direction != "" { - objectMap["direction"] = srpf.Direction - } - return json.Marshal(objectMap) -} - -// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SecurityRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityRulesClient) (SecurityRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityRulesCreateOrUpdateFuture.Result. -func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClient) (sr SecurityRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { - sr, err = client.CreateOrUpdateResponder(sr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") - } - } - return -} - -// SecurityRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SecurityRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SecurityRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SecurityRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SecurityRulesDeleteFuture.Result. -func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SecurityRulesEvaluationResult network security rules evaluation result. -type SecurityRulesEvaluationResult struct { - // Name - Name of the network security rule. - Name *string `json:"name,omitempty"` - // ProtocolMatched - Value indicating whether protocol is matched. - ProtocolMatched *bool `json:"protocolMatched,omitempty"` - // SourceMatched - Value indicating whether source is matched. - SourceMatched *bool `json:"sourceMatched,omitempty"` - // SourcePortMatched - Value indicating whether source port is matched. - SourcePortMatched *bool `json:"sourcePortMatched,omitempty"` - // DestinationMatched - Value indicating whether destination is matched. - DestinationMatched *bool `json:"destinationMatched,omitempty"` - // DestinationPortMatched - Value indicating whether destination port is matched. - DestinationPortMatched *bool `json:"destinationPortMatched,omitempty"` -} - -// ServiceAssociationLink serviceAssociationLink resource. -type ServiceAssociationLink struct { - // ServiceAssociationLinkPropertiesFormat - Resource navigation link properties format. - *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceAssociationLink. -func (sal ServiceAssociationLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sal.ServiceAssociationLinkPropertiesFormat != nil { - objectMap["properties"] = sal.ServiceAssociationLinkPropertiesFormat - } - if sal.Name != nil { - objectMap["name"] = sal.Name - } - if sal.ID != nil { - objectMap["id"] = sal.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceAssociationLink struct. -func (sal *ServiceAssociationLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceAssociationLinkPropertiesFormat ServiceAssociationLinkPropertiesFormat - err = json.Unmarshal(*v, &serviceAssociationLinkPropertiesFormat) - if err != nil { - return err - } - sal.ServiceAssociationLinkPropertiesFormat = &serviceAssociationLinkPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sal.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sal.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sal.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sal.ID = &ID - } - } - } - - return nil -} - -// ServiceAssociationLinkPropertiesFormat properties of ServiceAssociationLink. -type ServiceAssociationLinkPropertiesFormat struct { - // LinkedResourceType - Resource type of the linked resource. - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - // Link - Link to the external resource. - Link *string `json:"link,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service association link resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // AllowDelete - If true, the resource can be deleted. - AllowDelete *bool `json:"allowDelete,omitempty"` - // Locations - A list of locations. - Locations *[]string `json:"locations,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceAssociationLinkPropertiesFormat. -func (salpf ServiceAssociationLinkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if salpf.LinkedResourceType != nil { - objectMap["linkedResourceType"] = salpf.LinkedResourceType - } - if salpf.Link != nil { - objectMap["link"] = salpf.Link - } - if salpf.AllowDelete != nil { - objectMap["allowDelete"] = salpf.AllowDelete - } - if salpf.Locations != nil { - objectMap["locations"] = salpf.Locations - } - return json.Marshal(objectMap) -} - -// ServiceAssociationLinksListResult response for ServiceAssociationLinks_List operation. -type ServiceAssociationLinksListResult struct { - autorest.Response `json:"-"` - // Value - The service association links in a subnet. - Value *[]ServiceAssociationLink `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceAssociationLinksListResult. -func (sallr ServiceAssociationLinksListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sallr.Value != nil { - objectMap["value"] = sallr.Value - } - return json.Marshal(objectMap) -} - -// ServiceDelegationPropertiesFormat properties of a service delegation. -type ServiceDelegationPropertiesFormat struct { - // ServiceName - The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers). - ServiceName *string `json:"serviceName,omitempty"` - // Actions - READ-ONLY; The actions permitted to the service upon delegation. - Actions *[]string `json:"actions,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service delegation resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceDelegationPropertiesFormat. -func (sdpf ServiceDelegationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sdpf.ServiceName != nil { - objectMap["serviceName"] = sdpf.ServiceName - } - return json.Marshal(objectMap) -} - -// ServiceEndpointPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ServiceEndpointPoliciesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServiceEndpointPoliciesClient) (ServiceEndpointPolicy, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServiceEndpointPoliciesCreateOrUpdateFuture.Result. -func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) result(client ServiceEndpointPoliciesClient) (sep ServiceEndpointPolicy, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sep.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sep.Response.Response, err = future.GetResult(sender); err == nil && sep.Response.Response.StatusCode != http.StatusNoContent { - sep, err = client.CreateOrUpdateResponder(sep.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesCreateOrUpdateFuture", "Result", sep.Response.Response, "Failure responding to request") - } - } - return -} - -// ServiceEndpointPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ServiceEndpointPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServiceEndpointPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServiceEndpointPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServiceEndpointPoliciesDeleteFuture.Result. -func (future *ServiceEndpointPoliciesDeleteFuture) result(client ServiceEndpointPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServiceEndpointPolicy service End point policy resource. -type ServiceEndpointPolicy struct { - autorest.Response `json:"-"` - // ServiceEndpointPolicyPropertiesFormat - Properties of the service end point policy. - *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Kind - READ-ONLY; Kind of service endpoint policy. This is metadata used for the Azure portal experience. - Kind *string `json:"kind,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicy. -func (sep ServiceEndpointPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sep.ServiceEndpointPolicyPropertiesFormat != nil { - objectMap["properties"] = sep.ServiceEndpointPolicyPropertiesFormat - } - if sep.ID != nil { - objectMap["id"] = sep.ID - } - if sep.Location != nil { - objectMap["location"] = sep.Location - } - if sep.Tags != nil { - objectMap["tags"] = sep.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceEndpointPolicy struct. -func (sep *ServiceEndpointPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceEndpointPolicyPropertiesFormat ServiceEndpointPolicyPropertiesFormat - err = json.Unmarshal(*v, &serviceEndpointPolicyPropertiesFormat) - if err != nil { - return err - } - sep.ServiceEndpointPolicyPropertiesFormat = &serviceEndpointPolicyPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sep.Etag = &etag - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - sep.Kind = &kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sep.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sep.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sep.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sep.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sep.Tags = tags - } - } - } - - return nil -} - -// ServiceEndpointPolicyDefinition service Endpoint policy definitions. -type ServiceEndpointPolicyDefinition struct { - autorest.Response `json:"-"` - // ServiceEndpointPolicyDefinitionPropertiesFormat - Properties of the service endpoint policy definition. - *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - The type of the resource. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicyDefinition. -func (sepd ServiceEndpointPolicyDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sepd.ServiceEndpointPolicyDefinitionPropertiesFormat != nil { - objectMap["properties"] = sepd.ServiceEndpointPolicyDefinitionPropertiesFormat - } - if sepd.Name != nil { - objectMap["name"] = sepd.Name - } - if sepd.Type != nil { - objectMap["type"] = sepd.Type - } - if sepd.ID != nil { - objectMap["id"] = sepd.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ServiceEndpointPolicyDefinition struct. -func (sepd *ServiceEndpointPolicyDefinition) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var serviceEndpointPolicyDefinitionPropertiesFormat ServiceEndpointPolicyDefinitionPropertiesFormat - err = json.Unmarshal(*v, &serviceEndpointPolicyDefinitionPropertiesFormat) - if err != nil { - return err - } - sepd.ServiceEndpointPolicyDefinitionPropertiesFormat = &serviceEndpointPolicyDefinitionPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sepd.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sepd.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sepd.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sepd.ID = &ID - } - } - } - - return nil -} - -// ServiceEndpointPolicyDefinitionListResult response for ListServiceEndpointPolicyDefinition API service -// call. Retrieves all service endpoint policy definition that belongs to a service endpoint policy. -type ServiceEndpointPolicyDefinitionListResult struct { - autorest.Response `json:"-"` - // Value - The service endpoint policy definition in a service endpoint policy. - Value *[]ServiceEndpointPolicyDefinition `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ServiceEndpointPolicyDefinitionListResultIterator provides access to a complete listing of -// ServiceEndpointPolicyDefinition values. -type ServiceEndpointPolicyDefinitionListResultIterator struct { - i int - page ServiceEndpointPolicyDefinitionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServiceEndpointPolicyDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServiceEndpointPolicyDefinitionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServiceEndpointPolicyDefinitionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServiceEndpointPolicyDefinitionListResultIterator) Response() ServiceEndpointPolicyDefinitionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServiceEndpointPolicyDefinitionListResultIterator) Value() ServiceEndpointPolicyDefinition { - if !iter.page.NotDone() { - return ServiceEndpointPolicyDefinition{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServiceEndpointPolicyDefinitionListResultIterator type. -func NewServiceEndpointPolicyDefinitionListResultIterator(page ServiceEndpointPolicyDefinitionListResultPage) ServiceEndpointPolicyDefinitionListResultIterator { - return ServiceEndpointPolicyDefinitionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sepdlr ServiceEndpointPolicyDefinitionListResult) IsEmpty() bool { - return sepdlr.Value == nil || len(*sepdlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sepdlr ServiceEndpointPolicyDefinitionListResult) hasNextLink() bool { - return sepdlr.NextLink != nil && len(*sepdlr.NextLink) != 0 -} - -// serviceEndpointPolicyDefinitionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sepdlr ServiceEndpointPolicyDefinitionListResult) serviceEndpointPolicyDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !sepdlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sepdlr.NextLink))) -} - -// ServiceEndpointPolicyDefinitionListResultPage contains a page of ServiceEndpointPolicyDefinition values. -type ServiceEndpointPolicyDefinitionListResultPage struct { - fn func(context.Context, ServiceEndpointPolicyDefinitionListResult) (ServiceEndpointPolicyDefinitionListResult, error) - sepdlr ServiceEndpointPolicyDefinitionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServiceEndpointPolicyDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sepdlr) - if err != nil { - return err - } - page.sepdlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ServiceEndpointPolicyDefinitionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServiceEndpointPolicyDefinitionListResultPage) NotDone() bool { - return !page.sepdlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServiceEndpointPolicyDefinitionListResultPage) Response() ServiceEndpointPolicyDefinitionListResult { - return page.sepdlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServiceEndpointPolicyDefinitionListResultPage) Values() []ServiceEndpointPolicyDefinition { - if page.sepdlr.IsEmpty() { - return nil - } - return *page.sepdlr.Value -} - -// Creates a new instance of the ServiceEndpointPolicyDefinitionListResultPage type. -func NewServiceEndpointPolicyDefinitionListResultPage(cur ServiceEndpointPolicyDefinitionListResult, getNextPage func(context.Context, ServiceEndpointPolicyDefinitionListResult) (ServiceEndpointPolicyDefinitionListResult, error)) ServiceEndpointPolicyDefinitionListResultPage { - return ServiceEndpointPolicyDefinitionListResultPage{ - fn: getNextPage, - sepdlr: cur, - } -} - -// ServiceEndpointPolicyDefinitionPropertiesFormat service Endpoint policy definition resource. -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - // Description - A description for this rule. Restricted to 140 chars. - Description *string `json:"description,omitempty"` - // Service - Service endpoint name. - Service *string `json:"service,omitempty"` - // ServiceResources - A list of service resources. - ServiceResources *[]string `json:"serviceResources,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy definition resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicyDefinitionPropertiesFormat. -func (sepdpf ServiceEndpointPolicyDefinitionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sepdpf.Description != nil { - objectMap["description"] = sepdpf.Description - } - if sepdpf.Service != nil { - objectMap["service"] = sepdpf.Service - } - if sepdpf.ServiceResources != nil { - objectMap["serviceResources"] = sepdpf.ServiceResources - } - return json.Marshal(objectMap) -} - -// ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServiceEndpointPolicyDefinitionsClient) (ServiceEndpointPolicyDefinition, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture.Result. -func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) result(client ServiceEndpointPolicyDefinitionsClient) (sepd ServiceEndpointPolicyDefinition, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sepd.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sepd.Response.Response, err = future.GetResult(sender); err == nil && sepd.Response.Response.StatusCode != http.StatusNoContent { - sepd, err = client.CreateOrUpdateResponder(sepd.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture", "Result", sepd.Response.Response, "Failure responding to request") - } - } - return -} - -// ServiceEndpointPolicyDefinitionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type ServiceEndpointPolicyDefinitionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ServiceEndpointPolicyDefinitionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ServiceEndpointPolicyDefinitionsDeleteFuture.Result. -func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) result(client ServiceEndpointPolicyDefinitionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPolicyDefinitionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ServiceEndpointPolicyListResult response for ListServiceEndpointPolicies API service call. -type ServiceEndpointPolicyListResult struct { - autorest.Response `json:"-"` - // Value - A list of ServiceEndpointPolicy resources. - Value *[]ServiceEndpointPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicyListResult. -func (seplr ServiceEndpointPolicyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if seplr.Value != nil { - objectMap["value"] = seplr.Value - } - return json.Marshal(objectMap) -} - -// ServiceEndpointPolicyListResultIterator provides access to a complete listing of ServiceEndpointPolicy -// values. -type ServiceEndpointPolicyListResultIterator struct { - i int - page ServiceEndpointPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServiceEndpointPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServiceEndpointPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServiceEndpointPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServiceEndpointPolicyListResultIterator) Response() ServiceEndpointPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServiceEndpointPolicyListResultIterator) Value() ServiceEndpointPolicy { - if !iter.page.NotDone() { - return ServiceEndpointPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServiceEndpointPolicyListResultIterator type. -func NewServiceEndpointPolicyListResultIterator(page ServiceEndpointPolicyListResultPage) ServiceEndpointPolicyListResultIterator { - return ServiceEndpointPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (seplr ServiceEndpointPolicyListResult) IsEmpty() bool { - return seplr.Value == nil || len(*seplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (seplr ServiceEndpointPolicyListResult) hasNextLink() bool { - return seplr.NextLink != nil && len(*seplr.NextLink) != 0 -} - -// serviceEndpointPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (seplr ServiceEndpointPolicyListResult) serviceEndpointPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if !seplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(seplr.NextLink))) -} - -// ServiceEndpointPolicyListResultPage contains a page of ServiceEndpointPolicy values. -type ServiceEndpointPolicyListResultPage struct { - fn func(context.Context, ServiceEndpointPolicyListResult) (ServiceEndpointPolicyListResult, error) - seplr ServiceEndpointPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServiceEndpointPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.seplr) - if err != nil { - return err - } - page.seplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ServiceEndpointPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServiceEndpointPolicyListResultPage) NotDone() bool { - return !page.seplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServiceEndpointPolicyListResultPage) Response() ServiceEndpointPolicyListResult { - return page.seplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServiceEndpointPolicyListResultPage) Values() []ServiceEndpointPolicy { - if page.seplr.IsEmpty() { - return nil - } - return *page.seplr.Value -} - -// Creates a new instance of the ServiceEndpointPolicyListResultPage type. -func NewServiceEndpointPolicyListResultPage(cur ServiceEndpointPolicyListResult, getNextPage func(context.Context, ServiceEndpointPolicyListResult) (ServiceEndpointPolicyListResult, error)) ServiceEndpointPolicyListResultPage { - return ServiceEndpointPolicyListResultPage{ - fn: getNextPage, - seplr: cur, - } -} - -// ServiceEndpointPolicyPropertiesFormat service Endpoint Policy resource. -type ServiceEndpointPolicyPropertiesFormat struct { - // ServiceEndpointPolicyDefinitions - A collection of service endpoint policy definitions of the service endpoint policy. - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - // Subnets - READ-ONLY; A collection of references to subnets. - Subnets *[]Subnet `json:"subnets,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the service endpoint policy resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ServiceAlias - The alias indicating if the policy belongs to a service - ServiceAlias *string `json:"serviceAlias,omitempty"` - // ContextualServiceEndpointPolicies - A collection of contextual service endpoint policy. - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPolicyPropertiesFormat. -func (seppf ServiceEndpointPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if seppf.ServiceEndpointPolicyDefinitions != nil { - objectMap["serviceEndpointPolicyDefinitions"] = seppf.ServiceEndpointPolicyDefinitions - } - if seppf.ServiceAlias != nil { - objectMap["serviceAlias"] = seppf.ServiceAlias - } - if seppf.ContextualServiceEndpointPolicies != nil { - objectMap["contextualServiceEndpointPolicies"] = seppf.ContextualServiceEndpointPolicies - } - return json.Marshal(objectMap) -} - -// ServiceEndpointPropertiesFormat the service endpoint properties. -type ServiceEndpointPropertiesFormat struct { - // Service - The type of the endpoint service. - Service *string `json:"service,omitempty"` - // Locations - A list of locations. - Locations *[]string `json:"locations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the service endpoint resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceEndpointPropertiesFormat. -func (sepf ServiceEndpointPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sepf.Service != nil { - objectMap["service"] = sepf.Service - } - if sepf.Locations != nil { - objectMap["locations"] = sepf.Locations - } - return json.Marshal(objectMap) -} - -// ServiceTagInformation the service tag information. -type ServiceTagInformation struct { - // Properties - READ-ONLY; Properties of the service tag information. - Properties *ServiceTagInformationPropertiesFormat `json:"properties,omitempty"` - // Name - READ-ONLY; The name of service tag. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; The ID of service tag. - ID *string `json:"id,omitempty"` - // ServiceTagChangeNumber - READ-ONLY; The iteration number of service tag object for region. - ServiceTagChangeNumber *string `json:"serviceTagChangeNumber,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceTagInformation. -func (sti ServiceTagInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ServiceTagInformationListResult response for Get ServiceTagInformation API service call. Retrieves the -// list of service tag information resources. -type ServiceTagInformationListResult struct { - autorest.Response `json:"-"` - // Value - The list of service tag information resources. - Value *[]ServiceTagInformation `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceTagInformationListResult. -func (stilr ServiceTagInformationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if stilr.Value != nil { - objectMap["value"] = stilr.Value - } - return json.Marshal(objectMap) -} - -// ServiceTagInformationListResultIterator provides access to a complete listing of ServiceTagInformation -// values. -type ServiceTagInformationListResultIterator struct { - i int - page ServiceTagInformationListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ServiceTagInformationListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ServiceTagInformationListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServiceTagInformationListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ServiceTagInformationListResultIterator) Response() ServiceTagInformationListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ServiceTagInformationListResultIterator) Value() ServiceTagInformation { - if !iter.page.NotDone() { - return ServiceTagInformation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ServiceTagInformationListResultIterator type. -func NewServiceTagInformationListResultIterator(page ServiceTagInformationListResultPage) ServiceTagInformationListResultIterator { - return ServiceTagInformationListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (stilr ServiceTagInformationListResult) IsEmpty() bool { - return stilr.Value == nil || len(*stilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (stilr ServiceTagInformationListResult) hasNextLink() bool { - return stilr.NextLink != nil && len(*stilr.NextLink) != 0 -} - -// serviceTagInformationListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (stilr ServiceTagInformationListResult) serviceTagInformationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !stilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(stilr.NextLink))) -} - -// ServiceTagInformationListResultPage contains a page of ServiceTagInformation values. -type ServiceTagInformationListResultPage struct { - fn func(context.Context, ServiceTagInformationListResult) (ServiceTagInformationListResult, error) - stilr ServiceTagInformationListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ServiceTagInformationListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.stilr) - if err != nil { - return err - } - page.stilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ServiceTagInformationListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServiceTagInformationListResultPage) NotDone() bool { - return !page.stilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ServiceTagInformationListResultPage) Response() ServiceTagInformationListResult { - return page.stilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ServiceTagInformationListResultPage) Values() []ServiceTagInformation { - if page.stilr.IsEmpty() { - return nil - } - return *page.stilr.Value -} - -// Creates a new instance of the ServiceTagInformationListResultPage type. -func NewServiceTagInformationListResultPage(cur ServiceTagInformationListResult, getNextPage func(context.Context, ServiceTagInformationListResult) (ServiceTagInformationListResult, error)) ServiceTagInformationListResultPage { - return ServiceTagInformationListResultPage{ - fn: getNextPage, - stilr: cur, - } -} - -// ServiceTagInformationPropertiesFormat properties of the service tag information. -type ServiceTagInformationPropertiesFormat struct { - // ChangeNumber - READ-ONLY; The iteration number of service tag. - ChangeNumber *string `json:"changeNumber,omitempty"` - // Region - READ-ONLY; The region of service tag. - Region *string `json:"region,omitempty"` - // SystemService - READ-ONLY; The name of system service. - SystemService *string `json:"systemService,omitempty"` - // AddressPrefixes - READ-ONLY; The list of IP address prefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // State - READ-ONLY; The state of the service tag. - State *string `json:"state,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceTagInformationPropertiesFormat. -func (stipf ServiceTagInformationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ServiceTagsListResult response for the ListServiceTags API service call. -type ServiceTagsListResult struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The name of the cloud. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; The ID of the cloud. - ID *string `json:"id,omitempty"` - // Type - READ-ONLY; The azure resource type. - Type *string `json:"type,omitempty"` - // ChangeNumber - READ-ONLY; The iteration number. - ChangeNumber *string `json:"changeNumber,omitempty"` - // Cloud - READ-ONLY; The name of the cloud. - Cloud *string `json:"cloud,omitempty"` - // Values - READ-ONLY; The list of service tag information resources. - Values *[]ServiceTagInformation `json:"values,omitempty"` - // NextLink - READ-ONLY; The URL to get next page of service tag information resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceTagsListResult. -func (stlr ServiceTagsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SessionIds list of session IDs. -type SessionIds struct { - // SessionIds - List of session IDs. - SessionIds *[]string `json:"sessionIds,omitempty"` -} - -// SignatureOverridesFilterValuesQuery describes the filter values possibles for a given column -type SignatureOverridesFilterValuesQuery struct { - // FilterName - Describes the name of the column which values will be returned - FilterName *string `json:"filterName,omitempty"` -} - -// SignatureOverridesFilterValuesResponse describes the list of all possible values for a specific filter -// value -type SignatureOverridesFilterValuesResponse struct { - autorest.Response `json:"-"` - // FilterValues - Describes the possible values - FilterValues *[]string `json:"filterValues,omitempty"` -} - -// SignaturesOverrides contains all specific policy signatures overrides for the IDPS -type SignaturesOverrides struct { - autorest.Response `json:"-"` - // Name - Contains the name of the resource (default) - Name *string `json:"name,omitempty"` - // ID - Will contain the resource id of the signature override resource - ID *string `json:"id,omitempty"` - // Type - Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides - Type *string `json:"type,omitempty"` - // Properties - Will contain the properties of the resource (the actual signature overrides) - Properties *SignaturesOverridesProperties `json:"properties,omitempty"` -} - -// SignaturesOverridesList describes an object containing an array with a single item -type SignaturesOverridesList struct { - autorest.Response `json:"-"` - // Value - Describes a list consisting exactly one item describing the policy's signature override status - Value *[]SignaturesOverrides `json:"value,omitempty"` -} - -// SignaturesOverridesProperties will contain the properties of the resource (the actual signature -// overrides) -type SignaturesOverridesProperties struct { - Signatures map[string]*string `json:"signatures"` -} - -// MarshalJSON is the custom marshaler for SignaturesOverridesProperties. -func (so SignaturesOverridesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if so.Signatures != nil { - objectMap["signatures"] = so.Signatures - } - return json.Marshal(objectMap) -} - -// SingleQueryResult ... -type SingleQueryResult struct { - // SignatureID - The ID of the signature - SignatureID *int32 `json:"signatureId,omitempty"` - // Mode - The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny - Mode *int32 `json:"mode,omitempty"` - // Severity - Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High - Severity *int32 `json:"severity,omitempty"` - // Direction - Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional - Direction *int32 `json:"direction,omitempty"` - // Group - Describes the groups the signature belongs to - Group *string `json:"group,omitempty"` - // Description - Describes what is the signature enforces - Description *string `json:"description,omitempty"` - // Protocol - Describes the protocol the signatures is being enforced in - Protocol *string `json:"protocol,omitempty"` - // SourcePorts - Describes the list of source ports related to this signature - SourcePorts *[]string `json:"sourcePorts,omitempty"` - // DestinationPorts - Describes the list of destination ports related to this signature - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // LastUpdated - Describes the last updated time of the signature (provided from 3rd party vendor) - LastUpdated *string `json:"lastUpdated,omitempty"` - // InheritedFromParentPolicy - Describes if this override is inherited from base policy or not - InheritedFromParentPolicy *bool `json:"inheritedFromParentPolicy,omitempty"` -} - -// Sku the sku of this Bastion Host. -type Sku struct { - // Name - The name of this Bastion Host. Possible values include: 'BastionHostSkuNameBasic', 'BastionHostSkuNameStandard' - Name BastionHostSkuName `json:"name,omitempty"` -} - -// StaticMember staticMember Item. -type StaticMember struct { - autorest.Response `json:"-"` - // StaticMemberProperties - The Static Member properties - *StaticMemberProperties `json:"properties,omitempty"` - // SystemData - READ-ONLY; The system metadata related to this resource. - SystemData *SystemData `json:"systemData,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for StaticMember. -func (sm StaticMember) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sm.StaticMemberProperties != nil { - objectMap["properties"] = sm.StaticMemberProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for StaticMember struct. -func (sm *StaticMember) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var staticMemberProperties StaticMemberProperties - err = json.Unmarshal(*v, &staticMemberProperties) - if err != nil { - return err - } - sm.StaticMemberProperties = &staticMemberProperties - } - case "systemData": - if v != nil { - var systemData SystemData - err = json.Unmarshal(*v, &systemData) - if err != nil { - return err - } - sm.SystemData = &systemData - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sm.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sm.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sm.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - sm.Etag = &etag - } - } - } - - return nil -} - -// StaticMemberListResult result of the request to list StaticMember. It contains a list of groups and a -// URL link to get the next set of results. -type StaticMemberListResult struct { - autorest.Response `json:"-"` - // Value - Gets a page of StaticMember - Value *[]StaticMember `json:"value,omitempty"` - // NextLink - Gets the URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// StaticMemberListResultIterator provides access to a complete listing of StaticMember values. -type StaticMemberListResultIterator struct { - i int - page StaticMemberListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *StaticMemberListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StaticMemberListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *StaticMemberListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter StaticMemberListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter StaticMemberListResultIterator) Response() StaticMemberListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter StaticMemberListResultIterator) Value() StaticMember { - if !iter.page.NotDone() { - return StaticMember{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the StaticMemberListResultIterator type. -func NewStaticMemberListResultIterator(page StaticMemberListResultPage) StaticMemberListResultIterator { - return StaticMemberListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (smlr StaticMemberListResult) IsEmpty() bool { - return smlr.Value == nil || len(*smlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (smlr StaticMemberListResult) hasNextLink() bool { - return smlr.NextLink != nil && len(*smlr.NextLink) != 0 -} - -// staticMemberListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (smlr StaticMemberListResult) staticMemberListResultPreparer(ctx context.Context) (*http.Request, error) { - if !smlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(smlr.NextLink))) -} - -// StaticMemberListResultPage contains a page of StaticMember values. -type StaticMemberListResultPage struct { - fn func(context.Context, StaticMemberListResult) (StaticMemberListResult, error) - smlr StaticMemberListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *StaticMemberListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StaticMemberListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.smlr) - if err != nil { - return err - } - page.smlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *StaticMemberListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page StaticMemberListResultPage) NotDone() bool { - return !page.smlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page StaticMemberListResultPage) Response() StaticMemberListResult { - return page.smlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page StaticMemberListResultPage) Values() []StaticMember { - if page.smlr.IsEmpty() { - return nil - } - return *page.smlr.Value -} - -// Creates a new instance of the StaticMemberListResultPage type. -func NewStaticMemberListResultPage(cur StaticMemberListResult, getNextPage func(context.Context, StaticMemberListResult) (StaticMemberListResult, error)) StaticMemberListResultPage { - return StaticMemberListResultPage{ - fn: getNextPage, - smlr: cur, - } -} - -// StaticMemberProperties properties of static member. -type StaticMemberProperties struct { - // ResourceID - Resource Id. - ResourceID *string `json:"resourceId,omitempty"` - // Region - READ-ONLY; Resource region. - Region *string `json:"region,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the scope assignment resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for StaticMemberProperties. -func (smp StaticMemberProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if smp.ResourceID != nil { - objectMap["resourceId"] = smp.ResourceID - } - return json.Marshal(objectMap) -} - -// StaticRoute list of all Static Routes. -type StaticRoute struct { - // Name - The name of the StaticRoute that is unique within a VnetRoute. - Name *string `json:"name,omitempty"` - // AddressPrefixes - List of all address prefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // NextHopIPAddress - The ip address of the next hop. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} - -// StaticRoutesConfig configuration for static routes on this HubVnetConnectionConfiguration for static -// routes on this HubVnetConnection. -type StaticRoutesConfig struct { - // PropagateStaticRoutes - READ-ONLY; Boolean indicating whether static routes on this connection are automatically propagate to route tables which this connection propagates to. - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - // VnetLocalRouteOverrideCriteria - Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination in spoke. Possible values include: 'VnetLocalRouteOverrideCriteriaContains', 'VnetLocalRouteOverrideCriteriaEqual' - VnetLocalRouteOverrideCriteria VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} - -// MarshalJSON is the custom marshaler for StaticRoutesConfig. -func (src StaticRoutesConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if src.VnetLocalRouteOverrideCriteria != "" { - objectMap["vnetLocalRouteOverrideCriteria"] = src.VnetLocalRouteOverrideCriteria - } - return json.Marshal(objectMap) -} - -// String ... -type String struct { - autorest.Response `json:"-"` - Value *string `json:"value,omitempty"` -} - -// Subnet subnet in a virtual network resource. -type Subnet struct { - autorest.Response `json:"-"` - // SubnetPropertiesFormat - Properties of the subnet. - *SubnetPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for Subnet. -func (s Subnet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.SubnetPropertiesFormat != nil { - objectMap["properties"] = s.SubnetPropertiesFormat - } - if s.Name != nil { - objectMap["name"] = s.Name - } - if s.Type != nil { - objectMap["type"] = s.Type - } - if s.ID != nil { - objectMap["id"] = s.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Subnet struct. -func (s *Subnet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var subnetPropertiesFormat SubnetPropertiesFormat - err = json.Unmarshal(*v, &subnetPropertiesFormat) - if err != nil { - return err - } - s.SubnetPropertiesFormat = &subnetPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - s.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - s.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - s.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - s.ID = &ID - } - } - } - - return nil -} - -// SubnetAssociation subnet and it's custom security rules. -type SubnetAssociation struct { - // ID - READ-ONLY; Subnet ID. - ID *string `json:"id,omitempty"` - // SecurityRules - Collection of custom security rules. - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubnetAssociation. -func (sa SubnetAssociation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sa.SecurityRules != nil { - objectMap["securityRules"] = sa.SecurityRules - } - return json.Marshal(objectMap) -} - -// SubnetListResult response for ListSubnets API service callRetrieves all subnet that belongs to a virtual -// network. -type SubnetListResult struct { - autorest.Response `json:"-"` - // Value - The subnets in a virtual network. - Value *[]Subnet `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// SubnetListResultIterator provides access to a complete listing of Subnet values. -type SubnetListResultIterator struct { - i int - page SubnetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SubnetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SubnetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SubnetListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SubnetListResultIterator) Response() SubnetListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SubnetListResultIterator) Value() Subnet { - if !iter.page.NotDone() { - return Subnet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SubnetListResultIterator type. -func NewSubnetListResultIterator(page SubnetListResultPage) SubnetListResultIterator { - return SubnetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (slr SubnetListResult) IsEmpty() bool { - return slr.Value == nil || len(*slr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (slr SubnetListResult) hasNextLink() bool { - return slr.NextLink != nil && len(*slr.NextLink) != 0 -} - -// subnetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !slr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(slr.NextLink))) -} - -// SubnetListResultPage contains a page of Subnet values. -type SubnetListResultPage struct { - fn func(context.Context, SubnetListResult) (SubnetListResult, error) - slr SubnetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.slr) - if err != nil { - return err - } - page.slr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SubnetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SubnetListResultPage) NotDone() bool { - return !page.slr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SubnetListResultPage) Response() SubnetListResult { - return page.slr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SubnetListResultPage) Values() []Subnet { - if page.slr.IsEmpty() { - return nil - } - return *page.slr.Value -} - -// Creates a new instance of the SubnetListResultPage type. -func NewSubnetListResultPage(cur SubnetListResult, getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage { - return SubnetListResultPage{ - fn: getNextPage, - slr: cur, - } -} - -// SubnetPropertiesFormat properties of the subnet. -type SubnetPropertiesFormat struct { - // AddressPrefix - The address prefix for the subnet. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // AddressPrefixes - List of address prefixes for the subnet. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // NetworkSecurityGroup - The reference to the NetworkSecurityGroup resource. - NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` - // RouteTable - The reference to the RouteTable resource. - RouteTable *RouteTable `json:"routeTable,omitempty"` - // NatGateway - Nat gateway associated with this subnet. - NatGateway *SubResource `json:"natGateway,omitempty"` - // ServiceEndpoints - An array of service endpoints. - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` - // ServiceEndpointPolicies - An array of service endpoint policies. - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - // PrivateEndpoints - READ-ONLY; An array of references to private endpoints. - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - // IPConfigurations - READ-ONLY; An array of references to the network interface IP configurations using subnet. - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - // IPConfigurationProfiles - READ-ONLY; Array of IP configuration profiles which reference this subnet. - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - // IPAllocations - Array of IpAllocation which reference this subnet. - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - // ResourceNavigationLinks - READ-ONLY; An array of references to the external resources using subnet. - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - // ServiceAssociationLinks - READ-ONLY; An array of references to services injecting into this subnet. - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - // Delegations - An array of references to the delegations on the subnet. - Delegations *[]Delegation `json:"delegations,omitempty"` - // Purpose - READ-ONLY; A read-only string identifying the intention of use for this subnet based on delegations and other user-defined properties. - Purpose *string `json:"purpose,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the subnet resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateEndpointNetworkPolicies - Enable or Disable apply network policies on private end point in the subnet. Possible values include: 'VirtualNetworkPrivateEndpointNetworkPoliciesEnabled', 'VirtualNetworkPrivateEndpointNetworkPoliciesDisabled' - PrivateEndpointNetworkPolicies VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - // PrivateLinkServiceNetworkPolicies - Enable or Disable apply network policies on private link service in the subnet. Possible values include: 'VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled', 'VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled' - PrivateLinkServiceNetworkPolicies VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - // ApplicationGatewayIPConfigurations - Application gateway IP configurations of virtual network resource. - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubnetPropertiesFormat. -func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if spf.AddressPrefix != nil { - objectMap["addressPrefix"] = spf.AddressPrefix - } - if spf.AddressPrefixes != nil { - objectMap["addressPrefixes"] = spf.AddressPrefixes - } - if spf.NetworkSecurityGroup != nil { - objectMap["networkSecurityGroup"] = spf.NetworkSecurityGroup - } - if spf.RouteTable != nil { - objectMap["routeTable"] = spf.RouteTable - } - if spf.NatGateway != nil { - objectMap["natGateway"] = spf.NatGateway - } - if spf.ServiceEndpoints != nil { - objectMap["serviceEndpoints"] = spf.ServiceEndpoints - } - if spf.ServiceEndpointPolicies != nil { - objectMap["serviceEndpointPolicies"] = spf.ServiceEndpointPolicies - } - if spf.IPAllocations != nil { - objectMap["ipAllocations"] = spf.IPAllocations - } - if spf.Delegations != nil { - objectMap["delegations"] = spf.Delegations - } - if spf.PrivateEndpointNetworkPolicies != "" { - objectMap["privateEndpointNetworkPolicies"] = spf.PrivateEndpointNetworkPolicies - } - if spf.PrivateLinkServiceNetworkPolicies != "" { - objectMap["privateLinkServiceNetworkPolicies"] = spf.PrivateLinkServiceNetworkPolicies - } - if spf.ApplicationGatewayIPConfigurations != nil { - objectMap["applicationGatewayIpConfigurations"] = spf.ApplicationGatewayIPConfigurations - } - return json.Marshal(objectMap) -} - -// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SubnetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SubnetsClient) (Subnet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SubnetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SubnetsCreateOrUpdateFuture.Result. -func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subnet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateOrUpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SubnetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SubnetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SubnetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SubnetsDeleteFuture.Result. -func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SubnetsPrepareNetworkPoliciesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SubnetsPrepareNetworkPoliciesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SubnetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SubnetsPrepareNetworkPoliciesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SubnetsPrepareNetworkPoliciesFuture.Result. -func (future *SubnetsPrepareNetworkPoliciesFuture) result(client SubnetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsPrepareNetworkPoliciesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SubnetsPrepareNetworkPoliciesFuture") - return - } - ar.Response = future.Response() - return -} - -// SubnetsUnprepareNetworkPoliciesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type SubnetsUnprepareNetworkPoliciesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SubnetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SubnetsUnprepareNetworkPoliciesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SubnetsUnprepareNetworkPoliciesFuture.Result. -func (future *SubnetsUnprepareNetworkPoliciesFuture) result(client SubnetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsUnprepareNetworkPoliciesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.SubnetsUnprepareNetworkPoliciesFuture") - return - } - ar.Response = future.Response() - return -} - -// SubResource reference to another subresource. -type SubResource struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// SwapResource swapResource to represent slot type on the specified cloud service. -type SwapResource struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - Properties *SwapResourceProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for SwapResource. -func (sr SwapResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sr.Properties != nil { - objectMap["properties"] = sr.Properties - } - return json.Marshal(objectMap) -} - -// SwapResourceListResult swapResource List with single entry to represent slot type on the specified cloud -// service. -type SwapResourceListResult struct { - autorest.Response `json:"-"` - Value *[]SwapResource `json:"value,omitempty"` -} - -// SwapResourceProperties swap resource properties -type SwapResourceProperties struct { - // SlotType - Specifies slot info on a cloud service. Possible values include: 'Production', 'Staging' - SlotType SlotType `json:"slotType,omitempty"` -} - -// SystemData metadata pertaining to creation and last modification of the resource. -type SystemData struct { - // CreatedBy - The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` - // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - CreatedByType CreatedByType `json:"createdByType,omitempty"` - // CreatedAt - The timestamp of resource creation (UTC). - CreatedAt *date.Time `json:"createdAt,omitempty"` - // LastModifiedBy - The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` - // LastModifiedAt - The type of identity that last modified the resource. - LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` -} - -// TagsObject tags object for patch operations. -type TagsObject struct { - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for TagsObject. -func (toVar TagsObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if toVar.Tags != nil { - objectMap["tags"] = toVar.Tags - } - return json.Marshal(objectMap) -} - -// Topology topology of the specified resource group. -type Topology struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; GUID representing the operation id. - ID *string `json:"id,omitempty"` - // CreatedDateTime - READ-ONLY; The datetime when the topology was initially created for the resource group. - CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` - // LastModified - READ-ONLY; The datetime when the topology was last modified. - LastModified *date.Time `json:"lastModified,omitempty"` - // Resources - A list of topology resources. - Resources *[]TopologyResource `json:"resources,omitempty"` -} - -// MarshalJSON is the custom marshaler for Topology. -func (t Topology) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if t.Resources != nil { - objectMap["resources"] = t.Resources - } - return json.Marshal(objectMap) -} - -// TopologyAssociation resources that have an association with the parent resource. -type TopologyAssociation struct { - // Name - The name of the resource that is associated with the parent resource. - Name *string `json:"name,omitempty"` - // ResourceID - The ID of the resource that is associated with the parent resource. - ResourceID *string `json:"resourceId,omitempty"` - // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains' - AssociationType AssociationType `json:"associationType,omitempty"` -} - -// TopologyParameters parameters that define the representation of topology. -type TopologyParameters struct { - // TargetResourceGroupName - The name of the target resource group to perform topology on. - TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` - // TargetVirtualNetwork - The reference to the Virtual Network resource. - TargetVirtualNetwork *SubResource `json:"targetVirtualNetwork,omitempty"` - // TargetSubnet - The reference to the Subnet resource. - TargetSubnet *SubResource `json:"targetSubnet,omitempty"` -} - -// TopologyResource the network resource topology information for the given resource group. -type TopologyResource struct { - // Name - Name of the resource. - Name *string `json:"name,omitempty"` - // ID - ID of the resource. - ID *string `json:"id,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Associations - Holds the associations the resource has with other resources in the resource group. - Associations *[]TopologyAssociation `json:"associations,omitempty"` -} - -// TrafficAnalyticsConfigurationProperties parameters that define the configuration of traffic analytics. -type TrafficAnalyticsConfigurationProperties struct { - // Enabled - Flag to enable/disable traffic analytics. - Enabled *bool `json:"enabled,omitempty"` - // WorkspaceID - The resource guid of the attached workspace. - WorkspaceID *string `json:"workspaceId,omitempty"` - // WorkspaceRegion - The location of the attached workspace. - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - // WorkspaceResourceID - Resource Id of the attached workspace. - WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` - // TrafficAnalyticsInterval - The interval in minutes which would decide how frequently TA service should do flow analytics. - TrafficAnalyticsInterval *int32 `json:"trafficAnalyticsInterval,omitempty"` -} - -// TrafficAnalyticsProperties parameters that define the configuration of traffic analytics. -type TrafficAnalyticsProperties struct { - // NetworkWatcherFlowAnalyticsConfiguration - Parameters that define the configuration of traffic analytics. - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} - -// TrafficSelectorPolicy an traffic selector policy for a virtual network gateway connection. -type TrafficSelectorPolicy struct { - // LocalAddressRanges - A collection of local address spaces in CIDR format. - LocalAddressRanges *[]string `json:"localAddressRanges,omitempty"` - // RemoteAddressRanges - A collection of remote address spaces in CIDR format. - RemoteAddressRanges *[]string `json:"remoteAddressRanges,omitempty"` -} - -// TroubleshootingDetails information gained from troubleshooting of specified resource. -type TroubleshootingDetails struct { - // ID - The id of the get troubleshoot operation. - ID *string `json:"id,omitempty"` - // ReasonType - Reason type of failure. - ReasonType *string `json:"reasonType,omitempty"` - // Summary - A summary of troubleshooting. - Summary *string `json:"summary,omitempty"` - // Detail - Details on troubleshooting results. - Detail *string `json:"detail,omitempty"` - // RecommendedActions - List of recommended actions. - RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` -} - -// TroubleshootingParameters parameters that define the resource to troubleshoot. -type TroubleshootingParameters struct { - // TargetResourceID - The target resource to troubleshoot. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // TroubleshootingProperties - Properties of the troubleshooting resource. - *TroubleshootingProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for TroubleshootingParameters. -func (tp TroubleshootingParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if tp.TargetResourceID != nil { - objectMap["targetResourceId"] = tp.TargetResourceID - } - if tp.TroubleshootingProperties != nil { - objectMap["properties"] = tp.TroubleshootingProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for TroubleshootingParameters struct. -func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "targetResourceId": - if v != nil { - var targetResourceID string - err = json.Unmarshal(*v, &targetResourceID) - if err != nil { - return err - } - tp.TargetResourceID = &targetResourceID - } - case "properties": - if v != nil { - var troubleshootingProperties TroubleshootingProperties - err = json.Unmarshal(*v, &troubleshootingProperties) - if err != nil { - return err - } - tp.TroubleshootingProperties = &troubleshootingProperties - } - } - } - - return nil -} - -// TroubleshootingProperties storage location provided for troubleshoot. -type TroubleshootingProperties struct { - // StorageID - The ID for the storage account to save the troubleshoot result. - StorageID *string `json:"storageId,omitempty"` - // StoragePath - The path to the blob to save the troubleshoot result in. - StoragePath *string `json:"storagePath,omitempty"` -} - -// TroubleshootingRecommendedActions recommended actions based on discovered issues. -type TroubleshootingRecommendedActions struct { - // ActionID - ID of the recommended action. - ActionID *string `json:"actionId,omitempty"` - // ActionText - Description of recommended actions. - ActionText *string `json:"actionText,omitempty"` - // ActionURI - The uri linking to a documentation for the recommended troubleshooting actions. - ActionURI *string `json:"actionUri,omitempty"` - // ActionURIText - The information from the URI for the recommended troubleshooting actions. - ActionURIText *string `json:"actionUriText,omitempty"` -} - -// TroubleshootingResult troubleshooting information gained from specified resource. -type TroubleshootingResult struct { - autorest.Response `json:"-"` - // StartTime - The start time of the troubleshooting. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - The end time of the troubleshooting. - EndTime *date.Time `json:"endTime,omitempty"` - // Code - The result code of the troubleshooting. - Code *string `json:"code,omitempty"` - // Results - Information from troubleshooting. - Results *[]TroubleshootingDetails `json:"results,omitempty"` -} - -// TunnelConnectionHealth virtualNetworkGatewayConnection properties. -type TunnelConnectionHealth struct { - // Tunnel - READ-ONLY; Tunnel name. - Tunnel *string `json:"tunnel,omitempty"` - // ConnectionStatus - READ-ONLY; Virtual Network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' - ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - // IngressBytesTransferred - READ-ONLY; The Ingress Bytes Transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // EgressBytesTransferred - READ-ONLY; The Egress Bytes Transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // LastConnectionEstablishedUtcTime - READ-ONLY; The time at which connection was established in Utc format. - LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for TunnelConnectionHealth. -func (tch TunnelConnectionHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UnprepareNetworkPoliciesRequest details of UnprepareNetworkPolicies for Subnet. -type UnprepareNetworkPoliciesRequest struct { - // ServiceName - The name of the service for which subnet is being unprepared for. - ServiceName *string `json:"serviceName,omitempty"` -} - -// Usage the network resource usage. -type Usage struct { - // ID - READ-ONLY; Resource identifier. - ID *string `json:"id,omitempty"` - // Unit - An enum describing the unit of measurement. - Unit *string `json:"unit,omitempty"` - // CurrentValue - The current value of the usage. - CurrentValue *int64 `json:"currentValue,omitempty"` - // Limit - The limit of usage. - Limit *int64 `json:"limit,omitempty"` - // Name - The name of the type of usage. - Name *UsageName `json:"name,omitempty"` -} - -// MarshalJSON is the custom marshaler for Usage. -func (u Usage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if u.Unit != nil { - objectMap["unit"] = u.Unit - } - if u.CurrentValue != nil { - objectMap["currentValue"] = u.CurrentValue - } - if u.Limit != nil { - objectMap["limit"] = u.Limit - } - if u.Name != nil { - objectMap["name"] = u.Name - } - return json.Marshal(objectMap) -} - -// UsageName the usage names. -type UsageName struct { - // Value - A string describing the resource name. - Value *string `json:"value,omitempty"` - // LocalizedValue - A localized string describing the resource name. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// UsagesListResult the list usages operation response. -type UsagesListResult struct { - autorest.Response `json:"-"` - // Value - The list network resource usages. - Value *[]Usage `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// UsagesListResultIterator provides access to a complete listing of Usage values. -type UsagesListResultIterator struct { - i int - page UsagesListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *UsagesListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *UsagesListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter UsagesListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter UsagesListResultIterator) Response() UsagesListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter UsagesListResultIterator) Value() Usage { - if !iter.page.NotDone() { - return Usage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the UsagesListResultIterator type. -func NewUsagesListResultIterator(page UsagesListResultPage) UsagesListResultIterator { - return UsagesListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ulr UsagesListResult) IsEmpty() bool { - return ulr.Value == nil || len(*ulr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ulr UsagesListResult) hasNextLink() bool { - return ulr.NextLink != nil && len(*ulr.NextLink) != 0 -} - -// usagesListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ulr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ulr.NextLink))) -} - -// UsagesListResultPage contains a page of Usage values. -type UsagesListResultPage struct { - fn func(context.Context, UsagesListResult) (UsagesListResult, error) - ulr UsagesListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ulr) - if err != nil { - return err - } - page.ulr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *UsagesListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page UsagesListResultPage) NotDone() bool { - return !page.ulr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page UsagesListResultPage) Response() UsagesListResult { - return page.ulr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page UsagesListResultPage) Values() []Usage { - if page.ulr.IsEmpty() { - return nil - } - return *page.ulr.Value -} - -// Creates a new instance of the UsagesListResultPage type. -func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage { - return UsagesListResultPage{ - fn: getNextPage, - ulr: cur, - } -} - -// VerificationIPFlowParameters parameters that define the IP flow to be verified. -type VerificationIPFlowParameters struct { - // TargetResourceID - The ID of the target resource to perform next-hop on. - TargetResourceID *string `json:"targetResourceId,omitempty"` - // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - Direction Direction `json:"direction,omitempty"` - // Protocol - Protocol to be verified on. Possible values include: 'IPFlowProtocolTCP', 'IPFlowProtocolUDP' - Protocol IPFlowProtocol `json:"protocol,omitempty"` - // LocalPort - The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. - LocalPort *string `json:"localPort,omitempty"` - // RemotePort - The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. - RemotePort *string `json:"remotePort,omitempty"` - // LocalIPAddress - The local IP address. Acceptable values are valid IPv4 addresses. - LocalIPAddress *string `json:"localIPAddress,omitempty"` - // RemoteIPAddress - The remote IP address. Acceptable values are valid IPv4 addresses. - RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` - // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). - TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` -} - -// VerificationIPFlowResult results of IP flow verification on the target resource. -type VerificationIPFlowResult struct { - autorest.Response `json:"-"` - // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' - Access Access `json:"access,omitempty"` - // RuleName - Name of the rule. If input is not matched against any security rule, it is not displayed. - RuleName *string `json:"ruleName,omitempty"` -} - -// VipSwapCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VipSwapCreateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VipSwapClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VipSwapCreateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VipSwapCreateFuture.Result. -func (future *VipSwapCreateFuture) result(client VipSwapClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VipSwapCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VipSwapCreateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualAppliance networkVirtualAppliance Resource. -type VirtualAppliance struct { - autorest.Response `json:"-"` - // VirtualAppliancePropertiesFormat - Properties of the Network Virtual Appliance. - *VirtualAppliancePropertiesFormat `json:"properties,omitempty"` - // Identity - The service principal that has read access to cloud-init and config blob. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualAppliance. -func (va VirtualAppliance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if va.VirtualAppliancePropertiesFormat != nil { - objectMap["properties"] = va.VirtualAppliancePropertiesFormat - } - if va.Identity != nil { - objectMap["identity"] = va.Identity - } - if va.ID != nil { - objectMap["id"] = va.ID - } - if va.Location != nil { - objectMap["location"] = va.Location - } - if va.Tags != nil { - objectMap["tags"] = va.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualAppliance struct. -func (va *VirtualAppliance) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualAppliancePropertiesFormat VirtualAppliancePropertiesFormat - err = json.Unmarshal(*v, &virtualAppliancePropertiesFormat) - if err != nil { - return err - } - va.VirtualAppliancePropertiesFormat = &virtualAppliancePropertiesFormat - } - case "identity": - if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - va.Identity = &identity - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - va.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - va.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - va.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - va.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - va.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - va.Tags = tags - } - } - } - - return nil -} - -// VirtualApplianceListResult response for ListNetworkVirtualAppliances API service call. -type VirtualApplianceListResult struct { - autorest.Response `json:"-"` - // Value - List of Network Virtual Appliances. - Value *[]VirtualAppliance `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualApplianceListResultIterator provides access to a complete listing of VirtualAppliance values. -type VirtualApplianceListResultIterator struct { - i int - page VirtualApplianceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualApplianceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualApplianceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualApplianceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualApplianceListResultIterator) Response() VirtualApplianceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualApplianceListResultIterator) Value() VirtualAppliance { - if !iter.page.NotDone() { - return VirtualAppliance{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualApplianceListResultIterator type. -func NewVirtualApplianceListResultIterator(page VirtualApplianceListResultPage) VirtualApplianceListResultIterator { - return VirtualApplianceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (valr VirtualApplianceListResult) IsEmpty() bool { - return valr.Value == nil || len(*valr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (valr VirtualApplianceListResult) hasNextLink() bool { - return valr.NextLink != nil && len(*valr.NextLink) != 0 -} - -// virtualApplianceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (valr VirtualApplianceListResult) virtualApplianceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !valr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(valr.NextLink))) -} - -// VirtualApplianceListResultPage contains a page of VirtualAppliance values. -type VirtualApplianceListResultPage struct { - fn func(context.Context, VirtualApplianceListResult) (VirtualApplianceListResult, error) - valr VirtualApplianceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualApplianceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.valr) - if err != nil { - return err - } - page.valr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualApplianceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualApplianceListResultPage) NotDone() bool { - return !page.valr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualApplianceListResultPage) Response() VirtualApplianceListResult { - return page.valr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualApplianceListResultPage) Values() []VirtualAppliance { - if page.valr.IsEmpty() { - return nil - } - return *page.valr.Value -} - -// Creates a new instance of the VirtualApplianceListResultPage type. -func NewVirtualApplianceListResultPage(cur VirtualApplianceListResult, getNextPage func(context.Context, VirtualApplianceListResult) (VirtualApplianceListResult, error)) VirtualApplianceListResultPage { - return VirtualApplianceListResultPage{ - fn: getNextPage, - valr: cur, - } -} - -// VirtualApplianceNicProperties network Virtual Appliance NIC properties. -type VirtualApplianceNicProperties struct { - // Name - READ-ONLY; NIC name. - Name *string `json:"name,omitempty"` - // PublicIPAddress - READ-ONLY; Public IP address. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // PrivateIPAddress - READ-ONLY; Private IP address. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceNicProperties. -func (vanp VirtualApplianceNicProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualAppliancePropertiesFormat network Virtual Appliance definition. -type VirtualAppliancePropertiesFormat struct { - // NvaSku - Network Virtual Appliance SKU. - NvaSku *VirtualApplianceSkuProperties `json:"nvaSku,omitempty"` - // AddressPrefix - READ-ONLY; Address Prefix. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // BootStrapConfigurationBlobs - BootStrapConfigurationBlobs storage URLs. - BootStrapConfigurationBlobs *[]string `json:"bootStrapConfigurationBlobs,omitempty"` - // VirtualHub - The Virtual Hub where Network Virtual Appliance is being deployed. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - // CloudInitConfigurationBlobs - CloudInitConfigurationBlob storage URLs. - CloudInitConfigurationBlobs *[]string `json:"cloudInitConfigurationBlobs,omitempty"` - // CloudInitConfiguration - CloudInitConfiguration string in plain text. - CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` - // VirtualApplianceAsn - VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are not supported. - VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` - // SSHPublicKey - Public key for SSH login. - SSHPublicKey *string `json:"sshPublicKey,omitempty"` - // VirtualApplianceNics - READ-ONLY; List of Virtual Appliance Network Interfaces. - VirtualApplianceNics *[]VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty"` - // VirtualApplianceSites - READ-ONLY; List of references to VirtualApplianceSite. - VirtualApplianceSites *[]SubResource `json:"virtualApplianceSites,omitempty"` - // InboundSecurityRules - READ-ONLY; List of references to InboundSecurityRules. - InboundSecurityRules *[]SubResource `json:"inboundSecurityRules,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // DeploymentType - READ-ONLY; The deployment type. PartnerManaged for the SaaS NVA - DeploymentType *string `json:"deploymentType,omitempty"` - // Delegation - The delegation for the Virtual Appliance - Delegation *DelegationProperties `json:"delegation,omitempty"` - // PartnerManagedResource - The delegation for the Virtual Appliance - PartnerManagedResource *PartnerManagedResourceProperties `json:"partnerManagedResource,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualAppliancePropertiesFormat. -func (vapf VirtualAppliancePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vapf.NvaSku != nil { - objectMap["nvaSku"] = vapf.NvaSku - } - if vapf.BootStrapConfigurationBlobs != nil { - objectMap["bootStrapConfigurationBlobs"] = vapf.BootStrapConfigurationBlobs - } - if vapf.VirtualHub != nil { - objectMap["virtualHub"] = vapf.VirtualHub - } - if vapf.CloudInitConfigurationBlobs != nil { - objectMap["cloudInitConfigurationBlobs"] = vapf.CloudInitConfigurationBlobs - } - if vapf.CloudInitConfiguration != nil { - objectMap["cloudInitConfiguration"] = vapf.CloudInitConfiguration - } - if vapf.VirtualApplianceAsn != nil { - objectMap["virtualApplianceAsn"] = vapf.VirtualApplianceAsn - } - if vapf.SSHPublicKey != nil { - objectMap["sshPublicKey"] = vapf.SSHPublicKey - } - if vapf.Delegation != nil { - objectMap["delegation"] = vapf.Delegation - } - if vapf.PartnerManagedResource != nil { - objectMap["partnerManagedResource"] = vapf.PartnerManagedResource - } - return json.Marshal(objectMap) -} - -// VirtualAppliancesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualAppliancesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualAppliancesClient) (VirtualAppliance, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualAppliancesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualAppliancesCreateOrUpdateFuture.Result. -func (future *VirtualAppliancesCreateOrUpdateFuture) result(client VirtualAppliancesClient) (va VirtualAppliance, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - va.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualAppliancesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if va.Response.Response, err = future.GetResult(sender); err == nil && va.Response.Response.StatusCode != http.StatusNoContent { - va, err = client.CreateOrUpdateResponder(va.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesCreateOrUpdateFuture", "Result", va.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualAppliancesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualAppliancesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualAppliancesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualAppliancesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualAppliancesDeleteFuture.Result. -func (future *VirtualAppliancesDeleteFuture) result(client VirtualAppliancesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualAppliancesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualApplianceSite virtual Appliance Site resource. -type VirtualApplianceSite struct { - autorest.Response `json:"-"` - // VirtualApplianceSiteProperties - The properties of the Virtual Appliance Sites. - *VirtualApplianceSiteProperties `json:"properties,omitempty"` - // Name - Name of the virtual appliance site. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Site type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSite. -func (vas VirtualApplianceSite) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vas.VirtualApplianceSiteProperties != nil { - objectMap["properties"] = vas.VirtualApplianceSiteProperties - } - if vas.Name != nil { - objectMap["name"] = vas.Name - } - if vas.ID != nil { - objectMap["id"] = vas.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualApplianceSite struct. -func (vas *VirtualApplianceSite) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualApplianceSiteProperties VirtualApplianceSiteProperties - err = json.Unmarshal(*v, &virtualApplianceSiteProperties) - if err != nil { - return err - } - vas.VirtualApplianceSiteProperties = &virtualApplianceSiteProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vas.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vas.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vas.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vas.ID = &ID - } - } - } - - return nil -} - -// VirtualApplianceSiteListResult response for ListNetworkVirtualApplianceSites API service call. -type VirtualApplianceSiteListResult struct { - autorest.Response `json:"-"` - // Value - List of Network Virtual Appliance sites. - Value *[]VirtualApplianceSite `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualApplianceSiteListResultIterator provides access to a complete listing of VirtualApplianceSite -// values. -type VirtualApplianceSiteListResultIterator struct { - i int - page VirtualApplianceSiteListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualApplianceSiteListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSiteListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualApplianceSiteListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualApplianceSiteListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualApplianceSiteListResultIterator) Response() VirtualApplianceSiteListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualApplianceSiteListResultIterator) Value() VirtualApplianceSite { - if !iter.page.NotDone() { - return VirtualApplianceSite{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualApplianceSiteListResultIterator type. -func NewVirtualApplianceSiteListResultIterator(page VirtualApplianceSiteListResultPage) VirtualApplianceSiteListResultIterator { - return VirtualApplianceSiteListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vaslr VirtualApplianceSiteListResult) IsEmpty() bool { - return vaslr.Value == nil || len(*vaslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vaslr VirtualApplianceSiteListResult) hasNextLink() bool { - return vaslr.NextLink != nil && len(*vaslr.NextLink) != 0 -} - -// virtualApplianceSiteListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vaslr VirtualApplianceSiteListResult) virtualApplianceSiteListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vaslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vaslr.NextLink))) -} - -// VirtualApplianceSiteListResultPage contains a page of VirtualApplianceSite values. -type VirtualApplianceSiteListResultPage struct { - fn func(context.Context, VirtualApplianceSiteListResult) (VirtualApplianceSiteListResult, error) - vaslr VirtualApplianceSiteListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualApplianceSiteListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSiteListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vaslr) - if err != nil { - return err - } - page.vaslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualApplianceSiteListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualApplianceSiteListResultPage) NotDone() bool { - return !page.vaslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualApplianceSiteListResultPage) Response() VirtualApplianceSiteListResult { - return page.vaslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualApplianceSiteListResultPage) Values() []VirtualApplianceSite { - if page.vaslr.IsEmpty() { - return nil - } - return *page.vaslr.Value -} - -// Creates a new instance of the VirtualApplianceSiteListResultPage type. -func NewVirtualApplianceSiteListResultPage(cur VirtualApplianceSiteListResult, getNextPage func(context.Context, VirtualApplianceSiteListResult) (VirtualApplianceSiteListResult, error)) VirtualApplianceSiteListResultPage { - return VirtualApplianceSiteListResultPage{ - fn: getNextPage, - vaslr: cur, - } -} - -// VirtualApplianceSiteProperties properties of the rule group. -type VirtualApplianceSiteProperties struct { - // AddressPrefix - Address Prefix. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // O365Policy - Office 365 Policy. - O365Policy *Office365PolicyProperties `json:"o365Policy,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSiteProperties. -func (vasp VirtualApplianceSiteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vasp.AddressPrefix != nil { - objectMap["addressPrefix"] = vasp.AddressPrefix - } - if vasp.O365Policy != nil { - objectMap["o365Policy"] = vasp.O365Policy - } - return json.Marshal(objectMap) -} - -// VirtualApplianceSitesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualApplianceSitesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualApplianceSitesClient) (VirtualApplianceSite, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualApplianceSitesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualApplianceSitesCreateOrUpdateFuture.Result. -func (future *VirtualApplianceSitesCreateOrUpdateFuture) result(client VirtualApplianceSitesClient) (vas VirtualApplianceSite, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vas.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualApplianceSitesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vas.Response.Response, err = future.GetResult(sender); err == nil && vas.Response.Response.StatusCode != http.StatusNoContent { - vas, err = client.CreateOrUpdateResponder(vas.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesCreateOrUpdateFuture", "Result", vas.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualApplianceSitesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualApplianceSitesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualApplianceSitesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualApplianceSitesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualApplianceSitesDeleteFuture.Result. -func (future *VirtualApplianceSitesDeleteFuture) result(client VirtualApplianceSitesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualApplianceSitesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualApplianceSku definition of the NetworkVirtualApplianceSkus resource. -type VirtualApplianceSku struct { - autorest.Response `json:"-"` - // VirtualApplianceSkuPropertiesFormat - NetworkVirtualApplianceSku properties. - *VirtualApplianceSkuPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSku. -func (vas VirtualApplianceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vas.VirtualApplianceSkuPropertiesFormat != nil { - objectMap["properties"] = vas.VirtualApplianceSkuPropertiesFormat - } - if vas.ID != nil { - objectMap["id"] = vas.ID - } - if vas.Location != nil { - objectMap["location"] = vas.Location - } - if vas.Tags != nil { - objectMap["tags"] = vas.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualApplianceSku struct. -func (vas *VirtualApplianceSku) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualApplianceSkuPropertiesFormat VirtualApplianceSkuPropertiesFormat - err = json.Unmarshal(*v, &virtualApplianceSkuPropertiesFormat) - if err != nil { - return err - } - vas.VirtualApplianceSkuPropertiesFormat = &virtualApplianceSkuPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vas.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vas.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vas.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vas.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vas.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vas.Tags = tags - } - } - } - - return nil -} - -// VirtualApplianceSkuInstances list of available Sku and instances. -type VirtualApplianceSkuInstances struct { - // ScaleUnit - READ-ONLY; Scale Unit. - ScaleUnit *string `json:"scaleUnit,omitempty"` - // InstanceCount - READ-ONLY; Instance Count. - InstanceCount *int32 `json:"instanceCount,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSkuInstances. -func (vasi VirtualApplianceSkuInstances) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualApplianceSkuListResult response for ListNetworkVirtualApplianceSkus API service call. -type VirtualApplianceSkuListResult struct { - autorest.Response `json:"-"` - // Value - List of Network Virtual Appliance Skus that are available. - Value *[]VirtualApplianceSku `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualApplianceSkuListResultIterator provides access to a complete listing of VirtualApplianceSku -// values. -type VirtualApplianceSkuListResultIterator struct { - i int - page VirtualApplianceSkuListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualApplianceSkuListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkuListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualApplianceSkuListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualApplianceSkuListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualApplianceSkuListResultIterator) Response() VirtualApplianceSkuListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualApplianceSkuListResultIterator) Value() VirtualApplianceSku { - if !iter.page.NotDone() { - return VirtualApplianceSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualApplianceSkuListResultIterator type. -func NewVirtualApplianceSkuListResultIterator(page VirtualApplianceSkuListResultPage) VirtualApplianceSkuListResultIterator { - return VirtualApplianceSkuListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vaslr VirtualApplianceSkuListResult) IsEmpty() bool { - return vaslr.Value == nil || len(*vaslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vaslr VirtualApplianceSkuListResult) hasNextLink() bool { - return vaslr.NextLink != nil && len(*vaslr.NextLink) != 0 -} - -// virtualApplianceSkuListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vaslr VirtualApplianceSkuListResult) virtualApplianceSkuListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vaslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vaslr.NextLink))) -} - -// VirtualApplianceSkuListResultPage contains a page of VirtualApplianceSku values. -type VirtualApplianceSkuListResultPage struct { - fn func(context.Context, VirtualApplianceSkuListResult) (VirtualApplianceSkuListResult, error) - vaslr VirtualApplianceSkuListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualApplianceSkuListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkuListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vaslr) - if err != nil { - return err - } - page.vaslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualApplianceSkuListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualApplianceSkuListResultPage) NotDone() bool { - return !page.vaslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualApplianceSkuListResultPage) Response() VirtualApplianceSkuListResult { - return page.vaslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualApplianceSkuListResultPage) Values() []VirtualApplianceSku { - if page.vaslr.IsEmpty() { - return nil - } - return *page.vaslr.Value -} - -// Creates a new instance of the VirtualApplianceSkuListResultPage type. -func NewVirtualApplianceSkuListResultPage(cur VirtualApplianceSkuListResult, getNextPage func(context.Context, VirtualApplianceSkuListResult) (VirtualApplianceSkuListResult, error)) VirtualApplianceSkuListResultPage { - return VirtualApplianceSkuListResultPage{ - fn: getNextPage, - vaslr: cur, - } -} - -// VirtualApplianceSkuProperties network Virtual Appliance Sku Properties. -type VirtualApplianceSkuProperties struct { - // Vendor - Virtual Appliance Vendor. - Vendor *string `json:"vendor,omitempty"` - // BundledScaleUnit - Virtual Appliance Scale Unit. - BundledScaleUnit *string `json:"bundledScaleUnit,omitempty"` - // MarketPlaceVersion - Virtual Appliance Version. - MarketPlaceVersion *string `json:"marketPlaceVersion,omitempty"` -} - -// VirtualApplianceSkuPropertiesFormat properties specific to NetworkVirtualApplianceSkus. -type VirtualApplianceSkuPropertiesFormat struct { - // Vendor - READ-ONLY; Network Virtual Appliance Sku vendor. - Vendor *string `json:"vendor,omitempty"` - // AvailableVersions - READ-ONLY; Available Network Virtual Appliance versions. - AvailableVersions *[]string `json:"availableVersions,omitempty"` - // AvailableScaleUnits - The list of scale units available. - AvailableScaleUnits *[]VirtualApplianceSkuInstances `json:"availableScaleUnits,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualApplianceSkuPropertiesFormat. -func (vaspf VirtualApplianceSkuPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vaspf.AvailableScaleUnits != nil { - objectMap["availableScaleUnits"] = vaspf.AvailableScaleUnits - } - return json.Marshal(objectMap) -} - -// VirtualHub virtualHub Resource. -type VirtualHub struct { - autorest.Response `json:"-"` - // VirtualHubProperties - Properties of the virtual hub. - *VirtualHubProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Kind - READ-ONLY; Kind of service virtual hub. This is metadata used for the Azure portal experience for Route Server. - Kind *string `json:"kind,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualHub. -func (vh VirtualHub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vh.VirtualHubProperties != nil { - objectMap["properties"] = vh.VirtualHubProperties - } - if vh.ID != nil { - objectMap["id"] = vh.ID - } - if vh.Location != nil { - objectMap["location"] = vh.Location - } - if vh.Tags != nil { - objectMap["tags"] = vh.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualHub struct. -func (vh *VirtualHub) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualHubProperties VirtualHubProperties - err = json.Unmarshal(*v, &virtualHubProperties) - if err != nil { - return err - } - vh.VirtualHubProperties = &virtualHubProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vh.Etag = &etag - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - vh.Kind = &kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vh.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vh.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vh.Tags = tags - } - } - } - - return nil -} - -// VirtualHubBgpConnectionCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualHubBgpConnectionCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubBgpConnectionClient) (BgpConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubBgpConnectionCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubBgpConnectionCreateOrUpdateFuture.Result. -func (future *VirtualHubBgpConnectionCreateOrUpdateFuture) result(client VirtualHubBgpConnectionClient) (bc BgpConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubBgpConnectionCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bc.Response.Response, err = future.GetResult(sender); err == nil && bc.Response.Response.StatusCode != http.StatusNoContent { - bc, err = client.CreateOrUpdateResponder(bc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionCreateOrUpdateFuture", "Result", bc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubBgpConnectionDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubBgpConnectionDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubBgpConnectionClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubBgpConnectionDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubBgpConnectionDeleteFuture.Result. -func (future *VirtualHubBgpConnectionDeleteFuture) result(client VirtualHubBgpConnectionClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubBgpConnectionDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubBgpConnectionsListAdvertisedRoutesFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualHubBgpConnectionsListAdvertisedRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubBgpConnectionsClient) (PeerRouteList, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubBgpConnectionsListAdvertisedRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubBgpConnectionsListAdvertisedRoutesFuture.Result. -func (future *VirtualHubBgpConnectionsListAdvertisedRoutesFuture) result(client VirtualHubBgpConnectionsClient) (prl PeerRouteList, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsListAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - prl.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubBgpConnectionsListAdvertisedRoutesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if prl.Response.Response, err = future.GetResult(sender); err == nil && prl.Response.Response.StatusCode != http.StatusNoContent { - prl, err = client.ListAdvertisedRoutesResponder(prl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsListAdvertisedRoutesFuture", "Result", prl.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubBgpConnectionsListLearnedRoutesFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualHubBgpConnectionsListLearnedRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubBgpConnectionsClient) (PeerRouteList, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubBgpConnectionsListLearnedRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubBgpConnectionsListLearnedRoutesFuture.Result. -func (future *VirtualHubBgpConnectionsListLearnedRoutesFuture) result(client VirtualHubBgpConnectionsClient) (prl PeerRouteList, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsListLearnedRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - prl.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubBgpConnectionsListLearnedRoutesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if prl.Response.Response, err = future.GetResult(sender); err == nil && prl.Response.Response.StatusCode != http.StatusNoContent { - prl, err = client.ListLearnedRoutesResponder(prl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsListLearnedRoutesFuture", "Result", prl.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubEffectiveRoute the effective route configured on the virtual hub or specified resource. -type VirtualHubEffectiveRoute struct { - // AddressPrefixes - The list of address prefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // NextHops - The list of next hops. - NextHops *[]string `json:"nextHops,omitempty"` - // NextHopType - The type of the next hop. - NextHopType *string `json:"nextHopType,omitempty"` - // AsPath - The ASPath of this route. - AsPath *string `json:"asPath,omitempty"` - // RouteOrigin - The origin of this route. - RouteOrigin *string `json:"routeOrigin,omitempty"` -} - -// VirtualHubEffectiveRouteList effectiveRoutes List. -type VirtualHubEffectiveRouteList struct { - // Value - The list of effective routes configured on the virtual hub or the specified resource. - Value *[]VirtualHubEffectiveRoute `json:"value,omitempty"` -} - -// VirtualHubID virtual Hub identifier. -type VirtualHubID struct { - // ID - The resource URI for the Virtual Hub where the ExpressRoute gateway is or will be deployed. The Virtual Hub resource and the ExpressRoute gateway resource reside in the same subscription. - ID *string `json:"id,omitempty"` -} - -// VirtualHubIPConfigurationCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualHubIPConfigurationCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubIPConfigurationClient) (HubIPConfiguration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubIPConfigurationCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubIPConfigurationCreateOrUpdateFuture.Result. -func (future *VirtualHubIPConfigurationCreateOrUpdateFuture) result(client VirtualHubIPConfigurationClient) (hic HubIPConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - hic.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubIPConfigurationCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if hic.Response.Response, err = future.GetResult(sender); err == nil && hic.Response.Response.StatusCode != http.StatusNoContent { - hic, err = client.CreateOrUpdateResponder(hic.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationCreateOrUpdateFuture", "Result", hic.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubIPConfigurationDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubIPConfigurationDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubIPConfigurationClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubIPConfigurationDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubIPConfigurationDeleteFuture.Result. -func (future *VirtualHubIPConfigurationDeleteFuture) result(client VirtualHubIPConfigurationClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubIPConfigurationDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubProperties parameters for VirtualHub. -type VirtualHubProperties struct { - // VirtualWan - The VirtualWAN to which the VirtualHub belongs. - VirtualWan *SubResource `json:"virtualWan,omitempty"` - // VpnGateway - The VpnGateway associated with this VirtualHub. - VpnGateway *SubResource `json:"vpnGateway,omitempty"` - // P2SVpnGateway - The P2SVpnGateway associated with this VirtualHub. - P2SVpnGateway *SubResource `json:"p2SVpnGateway,omitempty"` - // ExpressRouteGateway - The expressRouteGateway associated with this VirtualHub. - ExpressRouteGateway *SubResource `json:"expressRouteGateway,omitempty"` - // AzureFirewall - The azureFirewall associated with this VirtualHub. - AzureFirewall *SubResource `json:"azureFirewall,omitempty"` - // SecurityPartnerProvider - The securityPartnerProvider associated with this VirtualHub. - SecurityPartnerProvider *SubResource `json:"securityPartnerProvider,omitempty"` - // AddressPrefix - Address-prefix for this VirtualHub. - AddressPrefix *string `json:"addressPrefix,omitempty"` - // RouteTable - The routeTable associated with this virtual hub. - RouteTable *VirtualHubRouteTable `json:"routeTable,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual hub resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // SecurityProviderName - The Security Provider name. - SecurityProviderName *string `json:"securityProviderName,omitempty"` - // VirtualHubRouteTableV2s - List of all virtual hub route table v2s associated with this VirtualHub. - VirtualHubRouteTableV2s *[]VirtualHubRouteTableV2 `json:"virtualHubRouteTableV2s,omitempty"` - // Sku - The sku of this VirtualHub. - Sku *string `json:"sku,omitempty"` - // RoutingState - The routing state. Possible values include: 'RoutingStateNone', 'RoutingStateProvisioned', 'RoutingStateProvisioning', 'RoutingStateFailed' - RoutingState RoutingState `json:"routingState,omitempty"` - // BgpConnections - READ-ONLY; List of references to Bgp Connections. - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - // IPConfigurations - READ-ONLY; List of references to IpConfigurations. - IPConfigurations *[]SubResource `json:"ipConfigurations,omitempty"` - // RouteMaps - READ-ONLY; List of references to RouteMaps. - RouteMaps *[]SubResource `json:"routeMaps,omitempty"` - // VirtualRouterAsn - VirtualRouter ASN. - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - // VirtualRouterIps - VirtualRouter IPs. - VirtualRouterIps *[]string `json:"virtualRouterIps,omitempty"` - // AllowBranchToBranchTraffic - Flag to control transit for VirtualRouter hub. - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - // PreferredRoutingGateway - The preferred gateway to route on-prem traffic. Possible values include: 'PreferredRoutingGatewayExpressRoute', 'PreferredRoutingGatewayVpnGateway', 'PreferredRoutingGatewayNone' - PreferredRoutingGateway PreferredRoutingGateway `json:"preferredRoutingGateway,omitempty"` - // HubRoutingPreference - The hubRoutingPreference of this VirtualHub. Possible values include: 'HubRoutingPreferenceExpressRoute', 'HubRoutingPreferenceVpnGateway', 'HubRoutingPreferenceASPath' - HubRoutingPreference HubRoutingPreference `json:"hubRoutingPreference,omitempty"` - // VirtualRouterAutoScaleConfiguration - The VirtualHub Router autoscale configuration. - VirtualRouterAutoScaleConfiguration *VirtualRouterAutoScaleConfiguration `json:"virtualRouterAutoScaleConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualHubProperties. -func (vhp VirtualHubProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vhp.VirtualWan != nil { - objectMap["virtualWan"] = vhp.VirtualWan - } - if vhp.VpnGateway != nil { - objectMap["vpnGateway"] = vhp.VpnGateway - } - if vhp.P2SVpnGateway != nil { - objectMap["p2SVpnGateway"] = vhp.P2SVpnGateway - } - if vhp.ExpressRouteGateway != nil { - objectMap["expressRouteGateway"] = vhp.ExpressRouteGateway - } - if vhp.AzureFirewall != nil { - objectMap["azureFirewall"] = vhp.AzureFirewall - } - if vhp.SecurityPartnerProvider != nil { - objectMap["securityPartnerProvider"] = vhp.SecurityPartnerProvider - } - if vhp.AddressPrefix != nil { - objectMap["addressPrefix"] = vhp.AddressPrefix - } - if vhp.RouteTable != nil { - objectMap["routeTable"] = vhp.RouteTable - } - if vhp.SecurityProviderName != nil { - objectMap["securityProviderName"] = vhp.SecurityProviderName - } - if vhp.VirtualHubRouteTableV2s != nil { - objectMap["virtualHubRouteTableV2s"] = vhp.VirtualHubRouteTableV2s - } - if vhp.Sku != nil { - objectMap["sku"] = vhp.Sku - } - if vhp.RoutingState != "" { - objectMap["routingState"] = vhp.RoutingState - } - if vhp.VirtualRouterAsn != nil { - objectMap["virtualRouterAsn"] = vhp.VirtualRouterAsn - } - if vhp.VirtualRouterIps != nil { - objectMap["virtualRouterIps"] = vhp.VirtualRouterIps - } - if vhp.AllowBranchToBranchTraffic != nil { - objectMap["allowBranchToBranchTraffic"] = vhp.AllowBranchToBranchTraffic - } - if vhp.PreferredRoutingGateway != "" { - objectMap["preferredRoutingGateway"] = vhp.PreferredRoutingGateway - } - if vhp.HubRoutingPreference != "" { - objectMap["hubRoutingPreference"] = vhp.HubRoutingPreference - } - if vhp.VirtualRouterAutoScaleConfiguration != nil { - objectMap["virtualRouterAutoScaleConfiguration"] = vhp.VirtualRouterAutoScaleConfiguration - } - return json.Marshal(objectMap) -} - -// VirtualHubRoute virtualHub route. -type VirtualHubRoute struct { - // AddressPrefixes - List of all addressPrefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // NextHopIPAddress - NextHop ip address. - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} - -// VirtualHubRouteTable virtualHub route table. -type VirtualHubRouteTable struct { - // Routes - List of all routes. - Routes *[]VirtualHubRoute `json:"routes,omitempty"` -} - -// VirtualHubRouteTableV2 virtualHubRouteTableV2 Resource. -type VirtualHubRouteTableV2 struct { - autorest.Response `json:"-"` - // VirtualHubRouteTableV2Properties - Properties of the virtual hub route table v2. - *VirtualHubRouteTableV2Properties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualHubRouteTableV2. -func (vhrtv VirtualHubRouteTableV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vhrtv.VirtualHubRouteTableV2Properties != nil { - objectMap["properties"] = vhrtv.VirtualHubRouteTableV2Properties - } - if vhrtv.Name != nil { - objectMap["name"] = vhrtv.Name - } - if vhrtv.ID != nil { - objectMap["id"] = vhrtv.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualHubRouteTableV2 struct. -func (vhrtv *VirtualHubRouteTableV2) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualHubRouteTableV2Properties VirtualHubRouteTableV2Properties - err = json.Unmarshal(*v, &virtualHubRouteTableV2Properties) - if err != nil { - return err - } - vhrtv.VirtualHubRouteTableV2Properties = &virtualHubRouteTableV2Properties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vhrtv.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vhrtv.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vhrtv.ID = &ID - } - } - } - - return nil -} - -// VirtualHubRouteTableV2Properties parameters for VirtualHubRouteTableV2. -type VirtualHubRouteTableV2Properties struct { - // Routes - List of all routes. - Routes *[]VirtualHubRouteV2 `json:"routes,omitempty"` - // AttachedConnections - List of all connections attached to this route table v2. - AttachedConnections *[]string `json:"attachedConnections,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual hub route table v2 resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualHubRouteTableV2Properties. -func (vhrtvp VirtualHubRouteTableV2Properties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vhrtvp.Routes != nil { - objectMap["routes"] = vhrtvp.Routes - } - if vhrtvp.AttachedConnections != nil { - objectMap["attachedConnections"] = vhrtvp.AttachedConnections - } - return json.Marshal(objectMap) -} - -// VirtualHubRouteTableV2sCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualHubRouteTableV2sCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubRouteTableV2sClient) (VirtualHubRouteTableV2, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubRouteTableV2sCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubRouteTableV2sCreateOrUpdateFuture.Result. -func (future *VirtualHubRouteTableV2sCreateOrUpdateFuture) result(client VirtualHubRouteTableV2sClient) (vhrtv VirtualHubRouteTableV2, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vhrtv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubRouteTableV2sCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vhrtv.Response.Response, err = future.GetResult(sender); err == nil && vhrtv.Response.Response.StatusCode != http.StatusNoContent { - vhrtv, err = client.CreateOrUpdateResponder(vhrtv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sCreateOrUpdateFuture", "Result", vhrtv.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubRouteTableV2sDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubRouteTableV2sDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubRouteTableV2sClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubRouteTableV2sDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubRouteTableV2sDeleteFuture.Result. -func (future *VirtualHubRouteTableV2sDeleteFuture) result(client VirtualHubRouteTableV2sClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubRouteTableV2sDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubRouteV2 virtualHubRouteTableV2 route. -type VirtualHubRouteV2 struct { - // DestinationType - The type of destinations. - DestinationType *string `json:"destinationType,omitempty"` - // Destinations - List of all destinations. - Destinations *[]string `json:"destinations,omitempty"` - // NextHopType - The type of next hops. - NextHopType *string `json:"nextHopType,omitempty"` - // NextHops - NextHops ip address. - NextHops *[]string `json:"nextHops,omitempty"` -} - -// VirtualHubsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubsClient) (VirtualHub, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubsCreateOrUpdateFuture.Result. -func (future *VirtualHubsCreateOrUpdateFuture) result(client VirtualHubsClient) (vh VirtualHub, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vh.Response.Response, err = future.GetResult(sender); err == nil && vh.Response.Response.StatusCode != http.StatusNoContent { - vh, err = client.CreateOrUpdateResponder(vh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", vh.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualHubsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualHubsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubsDeleteFuture.Result. -func (future *VirtualHubsDeleteFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubsGetEffectiveVirtualHubRoutesFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualHubsGetEffectiveVirtualHubRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubsGetEffectiveVirtualHubRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubsGetEffectiveVirtualHubRoutesFuture.Result. -func (future *VirtualHubsGetEffectiveVirtualHubRoutesFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsGetEffectiveVirtualHubRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubsGetEffectiveVirtualHubRoutesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubsGetInboundRoutesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubsGetInboundRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubsGetInboundRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubsGetInboundRoutesFuture.Result. -func (future *VirtualHubsGetInboundRoutesFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsGetInboundRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubsGetInboundRoutesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualHubsGetOutboundRoutesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualHubsGetOutboundRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualHubsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualHubsGetOutboundRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualHubsGetOutboundRoutesFuture.Result. -func (future *VirtualHubsGetOutboundRoutesFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsGetOutboundRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualHubsGetOutboundRoutesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetwork virtual Network resource. -type VirtualNetwork struct { - autorest.Response `json:"-"` - // ExtendedLocation - The extended location of the virtual network. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // VirtualNetworkPropertiesFormat - Properties of the virtual network. - *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetwork. -func (vn VirtualNetwork) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vn.ExtendedLocation != nil { - objectMap["extendedLocation"] = vn.ExtendedLocation - } - if vn.VirtualNetworkPropertiesFormat != nil { - objectMap["properties"] = vn.VirtualNetworkPropertiesFormat - } - if vn.ID != nil { - objectMap["id"] = vn.ID - } - if vn.Location != nil { - objectMap["location"] = vn.Location - } - if vn.Tags != nil { - objectMap["tags"] = vn.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct. -func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - vn.ExtendedLocation = &extendedLocation - } - case "properties": - if v != nil { - var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat) - if err != nil { - return err - } - vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vn.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vn.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vn.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vn.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vn.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vn.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkBgpCommunities bgp Communities sent over ExpressRoute with each route corresponding to a -// prefix in this VNET. -type VirtualNetworkBgpCommunities struct { - // VirtualNetworkCommunity - The BGP community associated with the virtual network. - VirtualNetworkCommunity *string `json:"virtualNetworkCommunity,omitempty"` - // RegionalCommunity - READ-ONLY; The BGP community associated with the region of the virtual network. - RegionalCommunity *string `json:"regionalCommunity,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkBgpCommunities. -func (vnbc VirtualNetworkBgpCommunities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnbc.VirtualNetworkCommunity != nil { - objectMap["virtualNetworkCommunity"] = vnbc.VirtualNetworkCommunity - } - return json.Marshal(objectMap) -} - -// VirtualNetworkConnectionGatewayReference a reference to VirtualNetworkGateway or LocalNetworkGateway -// resource. -type VirtualNetworkConnectionGatewayReference struct { - // ID - The ID of VirtualNetworkGateway or LocalNetworkGateway resource. - ID *string `json:"id,omitempty"` -} - -// VirtualNetworkDdosProtectionStatusResult response for GetVirtualNetworkDdosProtectionStatusOperation. -type VirtualNetworkDdosProtectionStatusResult struct { - autorest.Response `json:"-"` - // Value - The Ddos Protection Status Result for each public ip under a virtual network. - Value *[]PublicIPDdosProtectionStatusResult `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkDdosProtectionStatusResultIterator provides access to a complete listing of -// PublicIPDdosProtectionStatusResult values. -type VirtualNetworkDdosProtectionStatusResultIterator struct { - i int - page VirtualNetworkDdosProtectionStatusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkDdosProtectionStatusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkDdosProtectionStatusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkDdosProtectionStatusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkDdosProtectionStatusResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkDdosProtectionStatusResultIterator) Response() VirtualNetworkDdosProtectionStatusResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkDdosProtectionStatusResultIterator) Value() PublicIPDdosProtectionStatusResult { - if !iter.page.NotDone() { - return PublicIPDdosProtectionStatusResult{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkDdosProtectionStatusResultIterator type. -func NewVirtualNetworkDdosProtectionStatusResultIterator(page VirtualNetworkDdosProtectionStatusResultPage) VirtualNetworkDdosProtectionStatusResultIterator { - return VirtualNetworkDdosProtectionStatusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vndpsr VirtualNetworkDdosProtectionStatusResult) IsEmpty() bool { - return vndpsr.Value == nil || len(*vndpsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vndpsr VirtualNetworkDdosProtectionStatusResult) hasNextLink() bool { - return vndpsr.NextLink != nil && len(*vndpsr.NextLink) != 0 -} - -// virtualNetworkDdosProtectionStatusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vndpsr VirtualNetworkDdosProtectionStatusResult) virtualNetworkDdosProtectionStatusResultPreparer(ctx context.Context) (*http.Request, error) { - if !vndpsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vndpsr.NextLink))) -} - -// VirtualNetworkDdosProtectionStatusResultPage contains a page of PublicIPDdosProtectionStatusResult -// values. -type VirtualNetworkDdosProtectionStatusResultPage struct { - fn func(context.Context, VirtualNetworkDdosProtectionStatusResult) (VirtualNetworkDdosProtectionStatusResult, error) - vndpsr VirtualNetworkDdosProtectionStatusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkDdosProtectionStatusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkDdosProtectionStatusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vndpsr) - if err != nil { - return err - } - page.vndpsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkDdosProtectionStatusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkDdosProtectionStatusResultPage) NotDone() bool { - return !page.vndpsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkDdosProtectionStatusResultPage) Response() VirtualNetworkDdosProtectionStatusResult { - return page.vndpsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkDdosProtectionStatusResultPage) Values() []PublicIPDdosProtectionStatusResult { - if page.vndpsr.IsEmpty() { - return nil - } - return *page.vndpsr.Value -} - -// Creates a new instance of the VirtualNetworkDdosProtectionStatusResultPage type. -func NewVirtualNetworkDdosProtectionStatusResultPage(cur VirtualNetworkDdosProtectionStatusResult, getNextPage func(context.Context, VirtualNetworkDdosProtectionStatusResult) (VirtualNetworkDdosProtectionStatusResult, error)) VirtualNetworkDdosProtectionStatusResultPage { - return VirtualNetworkDdosProtectionStatusResultPage{ - fn: getNextPage, - vndpsr: cur, - } -} - -// VirtualNetworkEncryption indicates if encryption is enabled on virtual network and if VM without -// encryption is allowed in encrypted VNet. -type VirtualNetworkEncryption struct { - // Enabled - Indicates if encryption is enabled on the virtual network. - Enabled *bool `json:"enabled,omitempty"` - // Enforcement - If the encrypted VNet allows VM that does not support encryption. Possible values include: 'DropUnencrypted', 'AllowUnencrypted' - Enforcement VirtualNetworkEncryptionEnforcement `json:"enforcement,omitempty"` -} - -// VirtualNetworkGateway a common class for general resource information. -type VirtualNetworkGateway struct { - autorest.Response `json:"-"` - // VirtualNetworkGatewayPropertiesFormat - Properties of the virtual network gateway. - *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - // ExtendedLocation - The extended location of type local virtual network gateway. - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGateway. -func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vng.VirtualNetworkGatewayPropertiesFormat != nil { - objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat - } - if vng.ExtendedLocation != nil { - objectMap["extendedLocation"] = vng.ExtendedLocation - } - if vng.ID != nil { - objectMap["id"] = vng.ID - } - if vng.Location != nil { - objectMap["location"] = vng.Location - } - if vng.Tags != nil { - objectMap["tags"] = vng.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct. -func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat) - if err != nil { - return err - } - vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat - } - case "extendedLocation": - if v != nil { - var extendedLocation ExtendedLocation - err = json.Unmarshal(*v, &extendedLocation) - if err != nil { - return err - } - vng.ExtendedLocation = &extendedLocation - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vng.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vng.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vng.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vng.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vng.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vng.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkGatewayConnection a common class for general resource information. -type VirtualNetworkGatewayConnection struct { - autorest.Response `json:"-"` - // VirtualNetworkGatewayConnectionPropertiesFormat - Properties of the virtual network gateway connection. - *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnection. -func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil { - objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat - } - if vngc.ID != nil { - objectMap["id"] = vngc.ID - } - if vngc.Location != nil { - objectMap["location"] = vngc.Location - } - if vngc.Tags != nil { - objectMap["tags"] = vngc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct. -func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat) - if err != nil { - return err - } - vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vngc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vngc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vngc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vngc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vngc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vngc.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkGatewayConnectionListEntity a common class for general resource information. -type VirtualNetworkGatewayConnectionListEntity struct { - // VirtualNetworkGatewayConnectionListEntityPropertiesFormat - Properties of the virtual network gateway connection. - *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntity. -func (vngcle VirtualNetworkGatewayConnectionListEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat != nil { - objectMap["properties"] = vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat - } - if vngcle.ID != nil { - objectMap["id"] = vngcle.ID - } - if vngcle.Location != nil { - objectMap["location"] = vngcle.Location - } - if vngcle.Tags != nil { - objectMap["tags"] = vngcle.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnectionListEntity struct. -func (vngcle *VirtualNetworkGatewayConnectionListEntity) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayConnectionListEntityPropertiesFormat VirtualNetworkGatewayConnectionListEntityPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionListEntityPropertiesFormat) - if err != nil { - return err - } - vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat = &virtualNetworkGatewayConnectionListEntityPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vngcle.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vngcle.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vngcle.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vngcle.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vngcle.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vngcle.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkGatewayConnectionListEntityPropertiesFormat virtualNetworkGatewayConnection properties. -type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { - // AuthorizationKey - The authorizationKey. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // VirtualNetworkGateway1 - The reference to virtual network gateway resource. - VirtualNetworkGateway1 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway1,omitempty"` - // VirtualNetworkGateway2 - The reference to virtual network gateway resource. - VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` - // LocalNetworkGateway2 - The reference to local network gateway resource. - LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` - // ConnectionType - Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' - ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - // RoutingWeight - The routing weight. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // ConnectionMode - The connection mode for this connection. Possible values include: 'VirtualNetworkGatewayConnectionModeDefault', 'VirtualNetworkGatewayConnectionModeResponderOnly', 'VirtualNetworkGatewayConnectionModeInitiatorOnly' - ConnectionMode VirtualNetworkGatewayConnectionMode `json:"connectionMode,omitempty"` - // SharedKey - The IPSec shared key. - SharedKey *string `json:"sharedKey,omitempty"` - // ConnectionStatus - READ-ONLY; Virtual Network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' - ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status. - TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` - // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // Peer - The reference to peerings resource. - Peer *SubResource `json:"peer,omitempty"` - // EnableBgp - EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - // GatewayCustomBgpIPAddresses - GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. - GatewayCustomBgpIPAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` - // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - // IpsecPolicies - The IPSec Policies to be considered by this connection. - IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` - // TrafficSelectorPolicies - The Traffic Selector Policies to be considered by this connection. - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway connection resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ExpressRouteGatewayBypass - Bypass ExpressRoute Gateway for data forwarding. - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - // EnablePrivateLinkFastPath - Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntityPropertiesFormat. -func (vngclepf VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngclepf.AuthorizationKey != nil { - objectMap["authorizationKey"] = vngclepf.AuthorizationKey - } - if vngclepf.VirtualNetworkGateway1 != nil { - objectMap["virtualNetworkGateway1"] = vngclepf.VirtualNetworkGateway1 - } - if vngclepf.VirtualNetworkGateway2 != nil { - objectMap["virtualNetworkGateway2"] = vngclepf.VirtualNetworkGateway2 - } - if vngclepf.LocalNetworkGateway2 != nil { - objectMap["localNetworkGateway2"] = vngclepf.LocalNetworkGateway2 - } - if vngclepf.ConnectionType != "" { - objectMap["connectionType"] = vngclepf.ConnectionType - } - if vngclepf.ConnectionProtocol != "" { - objectMap["connectionProtocol"] = vngclepf.ConnectionProtocol - } - if vngclepf.RoutingWeight != nil { - objectMap["routingWeight"] = vngclepf.RoutingWeight - } - if vngclepf.ConnectionMode != "" { - objectMap["connectionMode"] = vngclepf.ConnectionMode - } - if vngclepf.SharedKey != nil { - objectMap["sharedKey"] = vngclepf.SharedKey - } - if vngclepf.Peer != nil { - objectMap["peer"] = vngclepf.Peer - } - if vngclepf.EnableBgp != nil { - objectMap["enableBgp"] = vngclepf.EnableBgp - } - if vngclepf.GatewayCustomBgpIPAddresses != nil { - objectMap["gatewayCustomBgpIpAddresses"] = vngclepf.GatewayCustomBgpIPAddresses - } - if vngclepf.UsePolicyBasedTrafficSelectors != nil { - objectMap["usePolicyBasedTrafficSelectors"] = vngclepf.UsePolicyBasedTrafficSelectors - } - if vngclepf.IpsecPolicies != nil { - objectMap["ipsecPolicies"] = vngclepf.IpsecPolicies - } - if vngclepf.TrafficSelectorPolicies != nil { - objectMap["trafficSelectorPolicies"] = vngclepf.TrafficSelectorPolicies - } - if vngclepf.ExpressRouteGatewayBypass != nil { - objectMap["expressRouteGatewayBypass"] = vngclepf.ExpressRouteGatewayBypass - } - if vngclepf.EnablePrivateLinkFastPath != nil { - objectMap["enablePrivateLinkFastPath"] = vngclepf.EnablePrivateLinkFastPath - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API -// service call. -type VirtualNetworkGatewayConnectionListResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetworkGatewayConnection resources that exists in a resource group. - Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListResult. -func (vngclr VirtualNetworkGatewayConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngclr.Value != nil { - objectMap["value"] = vngclr.Value - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of -// VirtualNetworkGatewayConnection values. -type VirtualNetworkGatewayConnectionListResultIterator struct { - i int - page VirtualNetworkGatewayConnectionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkGatewayConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkGatewayConnectionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkGatewayConnectionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkGatewayConnectionListResultIterator) Response() VirtualNetworkGatewayConnectionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkGatewayConnectionListResultIterator) Value() VirtualNetworkGatewayConnection { - if !iter.page.NotDone() { - return VirtualNetworkGatewayConnection{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkGatewayConnectionListResultIterator type. -func NewVirtualNetworkGatewayConnectionListResultIterator(page VirtualNetworkGatewayConnectionListResultPage) VirtualNetworkGatewayConnectionListResultIterator { - return VirtualNetworkGatewayConnectionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool { - return vngclr.Value == nil || len(*vngclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool { - return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0 -} - -// virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vngclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vngclr.NextLink))) -} - -// VirtualNetworkGatewayConnectionListResultPage contains a page of VirtualNetworkGatewayConnection values. -type VirtualNetworkGatewayConnectionListResultPage struct { - fn func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error) - vngclr VirtualNetworkGatewayConnectionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vngclr) - if err != nil { - return err - } - page.vngclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkGatewayConnectionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkGatewayConnectionListResultPage) NotDone() bool { - return !page.vngclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkGatewayConnectionListResultPage) Response() VirtualNetworkGatewayConnectionListResult { - return page.vngclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetworkGatewayConnection { - if page.vngclr.IsEmpty() { - return nil - } - return *page.vngclr.Value -} - -// Creates a new instance of the VirtualNetworkGatewayConnectionListResultPage type. -func NewVirtualNetworkGatewayConnectionListResultPage(cur VirtualNetworkGatewayConnectionListResult, getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage { - return VirtualNetworkGatewayConnectionListResultPage{ - fn: getNextPage, - vngclr: cur, - } -} - -// VirtualNetworkGatewayConnectionPropertiesFormat virtualNetworkGatewayConnection properties. -type VirtualNetworkGatewayConnectionPropertiesFormat struct { - // AuthorizationKey - The authorizationKey. - AuthorizationKey *string `json:"authorizationKey,omitempty"` - // VirtualNetworkGateway1 - The reference to virtual network gateway resource. - VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` - // VirtualNetworkGateway2 - The reference to virtual network gateway resource. - VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` - // LocalNetworkGateway2 - The reference to local network gateway resource. - LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` - // IngressNatRules - List of ingress NatRules. - IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` - // EgressNatRules - List of egress NatRules. - EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` - // ConnectionType - Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' - ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' - ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - // RoutingWeight - The routing weight. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // DpdTimeoutSeconds - The dead peer detection timeout of this connection in seconds. - DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"` - // ConnectionMode - The connection mode for this connection. Possible values include: 'VirtualNetworkGatewayConnectionModeDefault', 'VirtualNetworkGatewayConnectionModeResponderOnly', 'VirtualNetworkGatewayConnectionModeInitiatorOnly' - ConnectionMode VirtualNetworkGatewayConnectionMode `json:"connectionMode,omitempty"` - // SharedKey - The IPSec shared key. - SharedKey *string `json:"sharedKey,omitempty"` - // ConnectionStatus - READ-ONLY; Virtual Network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' - ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status. - TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` - // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // Peer - The reference to peerings resource. - Peer *SubResource `json:"peer,omitempty"` - // EnableBgp - EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - // GatewayCustomBgpIPAddresses - GatewayCustomBgpIpAddresses to be used for virtual network gateway Connection. - GatewayCustomBgpIPAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` - // UseLocalAzureIPAddress - Use private local Azure IP for the connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - // IpsecPolicies - The IPSec Policies to be considered by this connection. - IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` - // TrafficSelectorPolicies - The Traffic Selector Policies to be considered by this connection. - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway connection resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ExpressRouteGatewayBypass - Bypass ExpressRoute Gateway for data forwarding. - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - // EnablePrivateLinkFastPath - Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionPropertiesFormat. -func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngcpf.AuthorizationKey != nil { - objectMap["authorizationKey"] = vngcpf.AuthorizationKey - } - if vngcpf.VirtualNetworkGateway1 != nil { - objectMap["virtualNetworkGateway1"] = vngcpf.VirtualNetworkGateway1 - } - if vngcpf.VirtualNetworkGateway2 != nil { - objectMap["virtualNetworkGateway2"] = vngcpf.VirtualNetworkGateway2 - } - if vngcpf.LocalNetworkGateway2 != nil { - objectMap["localNetworkGateway2"] = vngcpf.LocalNetworkGateway2 - } - if vngcpf.IngressNatRules != nil { - objectMap["ingressNatRules"] = vngcpf.IngressNatRules - } - if vngcpf.EgressNatRules != nil { - objectMap["egressNatRules"] = vngcpf.EgressNatRules - } - if vngcpf.ConnectionType != "" { - objectMap["connectionType"] = vngcpf.ConnectionType - } - if vngcpf.ConnectionProtocol != "" { - objectMap["connectionProtocol"] = vngcpf.ConnectionProtocol - } - if vngcpf.RoutingWeight != nil { - objectMap["routingWeight"] = vngcpf.RoutingWeight - } - if vngcpf.DpdTimeoutSeconds != nil { - objectMap["dpdTimeoutSeconds"] = vngcpf.DpdTimeoutSeconds - } - if vngcpf.ConnectionMode != "" { - objectMap["connectionMode"] = vngcpf.ConnectionMode - } - if vngcpf.SharedKey != nil { - objectMap["sharedKey"] = vngcpf.SharedKey - } - if vngcpf.Peer != nil { - objectMap["peer"] = vngcpf.Peer - } - if vngcpf.EnableBgp != nil { - objectMap["enableBgp"] = vngcpf.EnableBgp - } - if vngcpf.GatewayCustomBgpIPAddresses != nil { - objectMap["gatewayCustomBgpIpAddresses"] = vngcpf.GatewayCustomBgpIPAddresses - } - if vngcpf.UseLocalAzureIPAddress != nil { - objectMap["useLocalAzureIpAddress"] = vngcpf.UseLocalAzureIPAddress - } - if vngcpf.UsePolicyBasedTrafficSelectors != nil { - objectMap["usePolicyBasedTrafficSelectors"] = vngcpf.UsePolicyBasedTrafficSelectors - } - if vngcpf.IpsecPolicies != nil { - objectMap["ipsecPolicies"] = vngcpf.IpsecPolicies - } - if vngcpf.TrafficSelectorPolicies != nil { - objectMap["trafficSelectorPolicies"] = vngcpf.TrafficSelectorPolicies - } - if vngcpf.ExpressRouteGatewayBypass != nil { - objectMap["expressRouteGatewayBypass"] = vngcpf.ExpressRouteGatewayBypass - } - if vngcpf.EnablePrivateLinkFastPath != nil { - objectMap["enablePrivateLinkFastPath"] = vngcpf.EnablePrivateLinkFastPath - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.Result. -func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vngc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { - vngc, err = client.CreateOrUpdateResponder(vngc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", vngc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualNetworkGatewayConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsDeleteFuture.Result. -func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewayConnectionsGetIkeSasFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewayConnectionsGetIkeSasFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsGetIkeSasFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsGetIkeSasFuture.Result. -func (future *VirtualNetworkGatewayConnectionsGetIkeSasFuture) result(client VirtualNetworkGatewayConnectionsClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsGetIkeSasFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsGetIkeSasFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.GetIkeSasResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsGetIkeSasFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsResetConnectionFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsResetConnectionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsResetConnectionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsResetConnectionFuture.Result. -func (future *VirtualNetworkGatewayConnectionsResetConnectionFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetConnectionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetConnectionFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionResetSharedKey, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsResetSharedKeyFuture.Result. -func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - crsk.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if crsk.Response.Response, err = future.GetResult(sender); err == nil && crsk.Response.Response.StatusCode != http.StatusNoContent { - crsk, err = client.ResetSharedKeyResponder(crsk.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", crsk.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionSharedKey, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsSetSharedKeyFuture.Result. -func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - csk.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if csk.Response.Response, err = future.GetResult(sender); err == nil && csk.Response.Response.StatusCode != http.StatusNoContent { - csk, err = client.SetSharedKeyResponder(csk.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", csk.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsStartPacketCaptureFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualNetworkGatewayConnectionsStartPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsStartPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsStartPacketCaptureFuture.Result. -func (future *VirtualNetworkGatewayConnectionsStartPacketCaptureFuture) result(client VirtualNetworkGatewayConnectionsClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StartPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsStopPacketCaptureFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsStopPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsStopPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsStopPacketCaptureFuture.Result. -func (future *VirtualNetworkGatewayConnectionsStopPacketCaptureFuture) result(client VirtualNetworkGatewayConnectionsClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StopPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayConnectionsUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayConnectionsUpdateTagsFuture.Result. -func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vngc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { - vngc, err = client.UpdateTagsResponder(vngc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", vngc.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayIPConfiguration IP configuration for virtual network gateway. -type VirtualNetworkGatewayIPConfiguration struct { - // VirtualNetworkGatewayIPConfigurationPropertiesFormat - Properties of the virtual network gateway ip configuration. - *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfiguration. -func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat - } - if vngic.Name != nil { - objectMap["name"] = vngic.Name - } - if vngic.ID != nil { - objectMap["id"] = vngic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct. -func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat) - if err != nil { - return err - } - vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vngic.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vngic.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vngic.ID = &ID - } - } - } - - return nil -} - -// VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration. -type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - The reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - The reference to the public IP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // PrivateIPAddress - READ-ONLY; Private IP Address for this gateway. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfigurationPropertiesFormat. -func (vngicpf VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngicpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = vngicpf.PrivateIPAllocationMethod - } - if vngicpf.Subnet != nil { - objectMap["subnet"] = vngicpf.Subnet - } - if vngicpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = vngicpf.PublicIPAddress - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayListConnectionsResult response for the VirtualNetworkGatewayListConnections API -// service call. -type VirtualNetworkGatewayListConnectionsResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetworkGatewayConnection resources that exists in a resource group. - Value *[]VirtualNetworkGatewayConnectionListEntity `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListConnectionsResult. -func (vnglcr VirtualNetworkGatewayListConnectionsResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnglcr.Value != nil { - objectMap["value"] = vnglcr.Value - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayListConnectionsResultIterator provides access to a complete listing of -// VirtualNetworkGatewayConnectionListEntity values. -type VirtualNetworkGatewayListConnectionsResultIterator struct { - i int - page VirtualNetworkGatewayListConnectionsResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkGatewayListConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListConnectionsResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkGatewayListConnectionsResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkGatewayListConnectionsResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkGatewayListConnectionsResultIterator) Response() VirtualNetworkGatewayListConnectionsResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkGatewayListConnectionsResultIterator) Value() VirtualNetworkGatewayConnectionListEntity { - if !iter.page.NotDone() { - return VirtualNetworkGatewayConnectionListEntity{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkGatewayListConnectionsResultIterator type. -func NewVirtualNetworkGatewayListConnectionsResultIterator(page VirtualNetworkGatewayListConnectionsResultPage) VirtualNetworkGatewayListConnectionsResultIterator { - return VirtualNetworkGatewayListConnectionsResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnglcr VirtualNetworkGatewayListConnectionsResult) IsEmpty() bool { - return vnglcr.Value == nil || len(*vnglcr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnglcr VirtualNetworkGatewayListConnectionsResult) hasNextLink() bool { - return vnglcr.NextLink != nil && len(*vnglcr.NextLink) != 0 -} - -// virtualNetworkGatewayListConnectionsResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnglcr VirtualNetworkGatewayListConnectionsResult) virtualNetworkGatewayListConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnglcr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnglcr.NextLink))) -} - -// VirtualNetworkGatewayListConnectionsResultPage contains a page of -// VirtualNetworkGatewayConnectionListEntity values. -type VirtualNetworkGatewayListConnectionsResultPage struct { - fn func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error) - vnglcr VirtualNetworkGatewayListConnectionsResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkGatewayListConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListConnectionsResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnglcr) - if err != nil { - return err - } - page.vnglcr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkGatewayListConnectionsResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkGatewayListConnectionsResultPage) NotDone() bool { - return !page.vnglcr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkGatewayListConnectionsResultPage) Response() VirtualNetworkGatewayListConnectionsResult { - return page.vnglcr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkGatewayListConnectionsResultPage) Values() []VirtualNetworkGatewayConnectionListEntity { - if page.vnglcr.IsEmpty() { - return nil - } - return *page.vnglcr.Value -} - -// Creates a new instance of the VirtualNetworkGatewayListConnectionsResultPage type. -func NewVirtualNetworkGatewayListConnectionsResultPage(cur VirtualNetworkGatewayListConnectionsResult, getNextPage func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error)) VirtualNetworkGatewayListConnectionsResultPage { - return VirtualNetworkGatewayListConnectionsResultPage{ - fn: getNextPage, - vnglcr: cur, - } -} - -// VirtualNetworkGatewayListResult response for the ListVirtualNetworkGateways API service call. -type VirtualNetworkGatewayListResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetworkGateway resources that exists in a resource group. - Value *[]VirtualNetworkGateway `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListResult. -func (vnglr VirtualNetworkGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnglr.Value != nil { - objectMap["value"] = vnglr.Value - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway -// values. -type VirtualNetworkGatewayListResultIterator struct { - i int - page VirtualNetworkGatewayListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkGatewayListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkGatewayListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkGatewayListResultIterator) Response() VirtualNetworkGatewayListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkGatewayListResultIterator) Value() VirtualNetworkGateway { - if !iter.page.NotDone() { - return VirtualNetworkGateway{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkGatewayListResultIterator type. -func NewVirtualNetworkGatewayListResultIterator(page VirtualNetworkGatewayListResultPage) VirtualNetworkGatewayListResultIterator { - return VirtualNetworkGatewayListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool { - return vnglr.Value == nil || len(*vnglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool { - return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0 -} - -// virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnglr.NextLink))) -} - -// VirtualNetworkGatewayListResultPage contains a page of VirtualNetworkGateway values. -type VirtualNetworkGatewayListResultPage struct { - fn func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error) - vnglr VirtualNetworkGatewayListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnglr) - if err != nil { - return err - } - page.vnglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkGatewayListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkGatewayListResultPage) NotDone() bool { - return !page.vnglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkGatewayListResultPage) Response() VirtualNetworkGatewayListResult { - return page.vnglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway { - if page.vnglr.IsEmpty() { - return nil - } - return *page.vnglr.Value -} - -// Creates a new instance of the VirtualNetworkGatewayListResultPage type. -func NewVirtualNetworkGatewayListResultPage(cur VirtualNetworkGatewayListResult, getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage { - return VirtualNetworkGatewayListResultPage{ - fn: getNextPage, - vnglr: cur, - } -} - -// VirtualNetworkGatewayNatRule virtualNetworkGatewayNatRule Resource. -type VirtualNetworkGatewayNatRule struct { - autorest.Response `json:"-"` - // VirtualNetworkGatewayNatRuleProperties - Properties of the Virtual Network Gateway NAT rule. - *VirtualNetworkGatewayNatRuleProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayNatRule. -func (vngnr VirtualNetworkGatewayNatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngnr.VirtualNetworkGatewayNatRuleProperties != nil { - objectMap["properties"] = vngnr.VirtualNetworkGatewayNatRuleProperties - } - if vngnr.Name != nil { - objectMap["name"] = vngnr.Name - } - if vngnr.ID != nil { - objectMap["id"] = vngnr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayNatRule struct. -func (vngnr *VirtualNetworkGatewayNatRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayNatRuleProperties VirtualNetworkGatewayNatRuleProperties - err = json.Unmarshal(*v, &virtualNetworkGatewayNatRuleProperties) - if err != nil { - return err - } - vngnr.VirtualNetworkGatewayNatRuleProperties = &virtualNetworkGatewayNatRuleProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vngnr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vngnr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vngnr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vngnr.ID = &ID - } - } - } - - return nil -} - -// VirtualNetworkGatewayNatRuleProperties parameters for VirtualNetworkGatewayNatRule. -type VirtualNetworkGatewayNatRuleProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the NAT Rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Type - The type of NAT rule for VPN NAT. Possible values include: 'VpnNatRuleTypeStatic', 'VpnNatRuleTypeDynamic' - Type VpnNatRuleType `json:"type,omitempty"` - // Mode - The Source NAT direction of a VPN NAT. Possible values include: 'EgressSnat', 'IngressSnat' - Mode VpnNatRuleMode `json:"mode,omitempty"` - // InternalMappings - The private IP address internal mapping for NAT. - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - // ExternalMappings - The private IP address external mapping for NAT. - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - // IPConfigurationID - The IP Configuration ID this NAT rule applies to. - IPConfigurationID *string `json:"ipConfigurationId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayNatRuleProperties. -func (vngnrp VirtualNetworkGatewayNatRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngnrp.Type != "" { - objectMap["type"] = vngnrp.Type - } - if vngnrp.Mode != "" { - objectMap["mode"] = vngnrp.Mode - } - if vngnrp.InternalMappings != nil { - objectMap["internalMappings"] = vngnrp.InternalMappings - } - if vngnrp.ExternalMappings != nil { - objectMap["externalMappings"] = vngnrp.ExternalMappings - } - if vngnrp.IPConfigurationID != nil { - objectMap["ipConfigurationId"] = vngnrp.IPConfigurationID - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayNatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewayNatRulesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayNatRulesClient) (VirtualNetworkGatewayNatRule, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayNatRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayNatRulesCreateOrUpdateFuture.Result. -func (future *VirtualNetworkGatewayNatRulesCreateOrUpdateFuture) result(client VirtualNetworkGatewayNatRulesClient) (vngnr VirtualNetworkGatewayNatRule, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vngnr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayNatRulesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vngnr.Response.Response, err = future.GetResult(sender); err == nil && vngnr.Response.Response.StatusCode != http.StatusNoContent { - vngnr, err = client.CreateOrUpdateResponder(vngnr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesCreateOrUpdateFuture", "Result", vngnr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewayNatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewayNatRulesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewayNatRulesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewayNatRulesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewayNatRulesDeleteFuture.Result. -func (future *VirtualNetworkGatewayNatRulesDeleteFuture) result(client VirtualNetworkGatewayNatRulesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayNatRulesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewayPolicyGroup parameters for VirtualNetworkGatewayPolicyGroup. -type VirtualNetworkGatewayPolicyGroup struct { - // VirtualNetworkGatewayPolicyGroupProperties - Properties of tVirtualNetworkGatewayPolicyGroup. - *VirtualNetworkGatewayPolicyGroupProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPolicyGroup. -func (vngpg VirtualNetworkGatewayPolicyGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngpg.VirtualNetworkGatewayPolicyGroupProperties != nil { - objectMap["properties"] = vngpg.VirtualNetworkGatewayPolicyGroupProperties - } - if vngpg.Name != nil { - objectMap["name"] = vngpg.Name - } - if vngpg.ID != nil { - objectMap["id"] = vngpg.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayPolicyGroup struct. -func (vngpg *VirtualNetworkGatewayPolicyGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkGatewayPolicyGroupProperties VirtualNetworkGatewayPolicyGroupProperties - err = json.Unmarshal(*v, &virtualNetworkGatewayPolicyGroupProperties) - if err != nil { - return err - } - vngpg.VirtualNetworkGatewayPolicyGroupProperties = &virtualNetworkGatewayPolicyGroupProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vngpg.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vngpg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vngpg.ID = &ID - } - } - } - - return nil -} - -// VirtualNetworkGatewayPolicyGroupMember vpn Client Connection configuration PolicyGroup member -type VirtualNetworkGatewayPolicyGroupMember struct { - // Name - Name of the VirtualNetworkGatewayPolicyGroupMember. - Name *string `json:"name,omitempty"` - // AttributeType - The Vpn Policy member attribute type. Possible values include: 'CertificateGroupID', 'AADGroupID', 'RadiusAzureGroupID' - AttributeType VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - // AttributeValue - The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember. - AttributeValue *string `json:"attributeValue,omitempty"` -} - -// VirtualNetworkGatewayPolicyGroupProperties properties of VirtualNetworkGatewayPolicyGroup. -type VirtualNetworkGatewayPolicyGroupProperties struct { - // IsDefault - Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. - IsDefault *bool `json:"isDefault,omitempty"` - // Priority - Priority for VirtualNetworkGatewayPolicyGroup. - Priority *int32 `json:"priority,omitempty"` - // PolicyMembers - Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. - PolicyMembers *[]VirtualNetworkGatewayPolicyGroupMember `json:"policyMembers,omitempty"` - // VngClientConnectionConfigurations - READ-ONLY; List of references to vngClientConnectionConfigurations. - VngClientConnectionConfigurations *[]SubResource `json:"vngClientConnectionConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGatewayPolicyGroup resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPolicyGroupProperties. -func (vngpgp VirtualNetworkGatewayPolicyGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngpgp.IsDefault != nil { - objectMap["isDefault"] = vngpgp.IsDefault - } - if vngpgp.Priority != nil { - objectMap["priority"] = vngpgp.Priority - } - if vngpgp.PolicyMembers != nil { - objectMap["policyMembers"] = vngpgp.PolicyMembers - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties. -type VirtualNetworkGatewayPropertiesFormat struct { - // IPConfigurations - IP configurations for virtual network gateway. - IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - // GatewayType - The type of this virtual network gateway. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute', 'VirtualNetworkGatewayTypeLocalGateway' - GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - // VpnType - The type of this virtual network gateway. Possible values include: 'PolicyBased', 'RouteBased' - VpnType VpnType `json:"vpnType,omitempty"` - // VpnGatewayGeneration - The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. Possible values include: 'VpnGatewayGenerationNone', 'VpnGatewayGenerationGeneration1', 'VpnGatewayGenerationGeneration2' - VpnGatewayGeneration VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - // EnableBgp - Whether BGP is enabled for this virtual network gateway or not. - EnableBgp *bool `json:"enableBgp,omitempty"` - // EnablePrivateIPAddress - Whether private IP needs to be enabled on this gateway for connections or not. - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - // ActiveActive - ActiveActive flag. - ActiveActive *bool `json:"activeActive,omitempty"` - // DisableIPSecReplayProtection - disableIPSecReplayProtection flag. - DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` - // GatewayDefaultSite - The reference to the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - // Sku - The reference to the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. - Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` - // VpnClientConfiguration - The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations. - VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` - // VirtualNetworkGatewayPolicyGroups - The reference to the VirtualNetworkGatewayPolicyGroup resource which represents the available VirtualNetworkGatewayPolicyGroup for the gateway. - VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` - // BgpSettings - Virtual network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - // CustomRoutes - The reference to the address space resource which represents the custom routes address space specified by the customer for virtual network gateway and VpnClient. - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // EnableDNSForwarding - Whether dns forwarding is enabled or not. - EnableDNSForwarding *bool `json:"enableDnsForwarding,omitempty"` - // InboundDNSForwardingEndpoint - READ-ONLY; The IP address allocated by the gateway to which dns requests can be sent. - InboundDNSForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` - // VNetExtendedLocationResourceID - Customer vnet resource id. VirtualNetworkGateway of type local gateway is associated with the customer vnet. - VNetExtendedLocationResourceID *string `json:"vNetExtendedLocationResourceId,omitempty"` - // NatRules - NatRules for virtual network gateway. - NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` - // EnableBgpRouteTranslationForNat - EnableBgpRouteTranslationForNat flag. - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - // AllowVirtualWanTraffic - Configures this gateway to accept traffic from remote Virtual WAN networks. - AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` - // AllowRemoteVnetTraffic - Configure this gateway to accept traffic from other Azure Virtual Networks. This configuration does not support connectivity to Azure Virtual WAN. - AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat. -func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngpf.IPConfigurations != nil { - objectMap["ipConfigurations"] = vngpf.IPConfigurations - } - if vngpf.GatewayType != "" { - objectMap["gatewayType"] = vngpf.GatewayType - } - if vngpf.VpnType != "" { - objectMap["vpnType"] = vngpf.VpnType - } - if vngpf.VpnGatewayGeneration != "" { - objectMap["vpnGatewayGeneration"] = vngpf.VpnGatewayGeneration - } - if vngpf.EnableBgp != nil { - objectMap["enableBgp"] = vngpf.EnableBgp - } - if vngpf.EnablePrivateIPAddress != nil { - objectMap["enablePrivateIpAddress"] = vngpf.EnablePrivateIPAddress - } - if vngpf.ActiveActive != nil { - objectMap["activeActive"] = vngpf.ActiveActive - } - if vngpf.DisableIPSecReplayProtection != nil { - objectMap["disableIPSecReplayProtection"] = vngpf.DisableIPSecReplayProtection - } - if vngpf.GatewayDefaultSite != nil { - objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite - } - if vngpf.Sku != nil { - objectMap["sku"] = vngpf.Sku - } - if vngpf.VpnClientConfiguration != nil { - objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration - } - if vngpf.VirtualNetworkGatewayPolicyGroups != nil { - objectMap["virtualNetworkGatewayPolicyGroups"] = vngpf.VirtualNetworkGatewayPolicyGroups - } - if vngpf.BgpSettings != nil { - objectMap["bgpSettings"] = vngpf.BgpSettings - } - if vngpf.CustomRoutes != nil { - objectMap["customRoutes"] = vngpf.CustomRoutes - } - if vngpf.EnableDNSForwarding != nil { - objectMap["enableDnsForwarding"] = vngpf.EnableDNSForwarding - } - if vngpf.VNetExtendedLocationResourceID != nil { - objectMap["vNetExtendedLocationResourceId"] = vngpf.VNetExtendedLocationResourceID - } - if vngpf.NatRules != nil { - objectMap["natRules"] = vngpf.NatRules - } - if vngpf.EnableBgpRouteTranslationForNat != nil { - objectMap["enableBgpRouteTranslationForNat"] = vngpf.EnableBgpRouteTranslationForNat - } - if vngpf.AllowVirtualWanTraffic != nil { - objectMap["allowVirtualWanTraffic"] = vngpf.AllowVirtualWanTraffic - } - if vngpf.AllowRemoteVnetTraffic != nil { - objectMap["allowRemoteVnetTraffic"] = vngpf.AllowRemoteVnetTraffic - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysCreateOrUpdateFuture.Result. -func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { - vng, err = client.CreateOrUpdateResponder(vng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", vng.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysDeleteFuture.Result. -func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture an abstraction for monitoring -// and retrieving the results of a long-running operation. -type VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture.Result. -func (future *VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewaysGeneratevpnclientpackageFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGeneratevpnclientpackageFuture.Result. -func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.GeneratevpnclientpackageResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewaysGenerateVpnProfileFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGenerateVpnProfileFuture.Result. -func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGenerateVpnProfileFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.GenerateVpnProfileResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetAdvertisedRoutesFuture.Result. -func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - grlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent { - grlr, err = client.GetAdvertisedRoutesResponder(grlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (BgpPeerStatusListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetBgpPeerStatusFuture.Result. -func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - bpslr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bpslr.Response.Response, err = future.GetResult(sender); err == nil && bpslr.Response.Response.StatusCode != http.StatusNoContent { - bpslr, err = client.GetBgpPeerStatusResponder(bpslr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", bpslr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualNetworkGatewaysGetLearnedRoutesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetLearnedRoutesFuture.Result. -func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - grlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent { - grlr, err = client.GetLearnedRoutesResponder(grlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VpnClientConnectionHealthDetailListResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture.Result. -func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) result(client VirtualNetworkGatewaysClient) (vcchdlr VpnClientConnectionHealthDetailListResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vcchdlr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vcchdlr.Response.Response, err = future.GetResult(sender); err == nil && vcchdlr.Response.Response.StatusCode != http.StatusNoContent { - vcchdlr, err = client.GetVpnclientConnectionHealthResponder(vcchdlr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture", "Result", vcchdlr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture.Result. -func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vcipp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vcipp.Response.Response, err = future.GetResult(sender); err == nil && vcipp.Response.Response.StatusCode != http.StatusNoContent { - vcipp, err = client.GetVpnclientIpsecParametersResponder(vcipp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture", "Result", vcipp.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysGetVpnProfilePackageURLFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysGetVpnProfilePackageURLFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysGetVpnProfilePackageURLFuture.Result. -func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.GetVpnProfilePackageURLResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaySku virtualNetworkGatewaySku details. -type VirtualNetworkGatewaySku struct { - // Name - Gateway SKU name. Possible values include: 'VirtualNetworkGatewaySkuNameBasic', 'VirtualNetworkGatewaySkuNameHighPerformance', 'VirtualNetworkGatewaySkuNameStandard', 'VirtualNetworkGatewaySkuNameUltraPerformance', 'VirtualNetworkGatewaySkuNameVpnGw1', 'VirtualNetworkGatewaySkuNameVpnGw2', 'VirtualNetworkGatewaySkuNameVpnGw3', 'VirtualNetworkGatewaySkuNameVpnGw4', 'VirtualNetworkGatewaySkuNameVpnGw5', 'VirtualNetworkGatewaySkuNameVpnGw1AZ', 'VirtualNetworkGatewaySkuNameVpnGw2AZ', 'VirtualNetworkGatewaySkuNameVpnGw3AZ', 'VirtualNetworkGatewaySkuNameVpnGw4AZ', 'VirtualNetworkGatewaySkuNameVpnGw5AZ', 'VirtualNetworkGatewaySkuNameErGw1AZ', 'VirtualNetworkGatewaySkuNameErGw2AZ', 'VirtualNetworkGatewaySkuNameErGw3AZ' - Name VirtualNetworkGatewaySkuName `json:"name,omitempty"` - // Tier - Gateway SKU tier. Possible values include: 'VirtualNetworkGatewaySkuTierBasic', 'VirtualNetworkGatewaySkuTierHighPerformance', 'VirtualNetworkGatewaySkuTierStandard', 'VirtualNetworkGatewaySkuTierUltraPerformance', 'VirtualNetworkGatewaySkuTierVpnGw1', 'VirtualNetworkGatewaySkuTierVpnGw2', 'VirtualNetworkGatewaySkuTierVpnGw3', 'VirtualNetworkGatewaySkuTierVpnGw4', 'VirtualNetworkGatewaySkuTierVpnGw5', 'VirtualNetworkGatewaySkuTierVpnGw1AZ', 'VirtualNetworkGatewaySkuTierVpnGw2AZ', 'VirtualNetworkGatewaySkuTierVpnGw3AZ', 'VirtualNetworkGatewaySkuTierVpnGw4AZ', 'VirtualNetworkGatewaySkuTierVpnGw5AZ', 'VirtualNetworkGatewaySkuTierErGw1AZ', 'VirtualNetworkGatewaySkuTierErGw2AZ', 'VirtualNetworkGatewaySkuTierErGw3AZ' - Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` - // Capacity - READ-ONLY; The capacity. - Capacity *int32 `json:"capacity,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkGatewaySku. -func (vngs VirtualNetworkGatewaySku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vngs.Name != "" { - objectMap["name"] = vngs.Name - } - if vngs.Tier != "" { - objectMap["tier"] = vngs.Tier - } - return json.Marshal(objectMap) -} - -// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewaysResetFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysResetFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysResetFuture.Result. -func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { - vng, err = client.ResetResponder(vng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", vng.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysResetVpnClientSharedKeyFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysResetVpnClientSharedKeyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysResetVpnClientSharedKeyFuture.Result. -func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetVpnClientSharedKeyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetVpnClientSharedKeyFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture.Result. -func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vcipp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vcipp.Response.Response, err = future.GetResult(sender); err == nil && vcipp.Response.Response.StatusCode != http.StatusNoContent { - vcipp, err = client.SetVpnclientIpsecParametersResponder(vcipp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture", "Result", vcipp.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysStartPacketCaptureFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewaysStartPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysStartPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysStartPacketCaptureFuture.Result. -func (future *VirtualNetworkGatewaysStartPacketCaptureFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStartPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysStartPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StartPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStartPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysStopPacketCaptureFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworkGatewaysStopPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysStopPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysStopPacketCaptureFuture.Result. -func (future *VirtualNetworkGatewaysStopPacketCaptureFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStopPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysStopPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StopPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStopPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkGatewaysUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkGatewaysUpdateTagsFuture.Result. -func (future *VirtualNetworkGatewaysUpdateTagsFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { - vng, err = client.UpdateTagsResponder(vng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", vng.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkListResult response for the ListVirtualNetworks API service call. -type VirtualNetworkListResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetwork resources in a resource group. - Value *[]VirtualNetwork `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkListResultIterator provides access to a complete listing of VirtualNetwork values. -type VirtualNetworkListResultIterator struct { - i int - page VirtualNetworkListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkListResultIterator) Response() VirtualNetworkListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkListResultIterator) Value() VirtualNetwork { - if !iter.page.NotDone() { - return VirtualNetwork{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkListResultIterator type. -func NewVirtualNetworkListResultIterator(page VirtualNetworkListResultPage) VirtualNetworkListResultIterator { - return VirtualNetworkListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnlr VirtualNetworkListResult) IsEmpty() bool { - return vnlr.Value == nil || len(*vnlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnlr VirtualNetworkListResult) hasNextLink() bool { - return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0 -} - -// virtualNetworkListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnlr.NextLink))) -} - -// VirtualNetworkListResultPage contains a page of VirtualNetwork values. -type VirtualNetworkListResultPage struct { - fn func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error) - vnlr VirtualNetworkListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnlr) - if err != nil { - return err - } - page.vnlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkListResultPage) NotDone() bool { - return !page.vnlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkListResultPage) Response() VirtualNetworkListResult { - return page.vnlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkListResultPage) Values() []VirtualNetwork { - if page.vnlr.IsEmpty() { - return nil - } - return *page.vnlr.Value -} - -// Creates a new instance of the VirtualNetworkListResultPage type. -func NewVirtualNetworkListResultPage(cur VirtualNetworkListResult, getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage { - return VirtualNetworkListResultPage{ - fn: getNextPage, - vnlr: cur, - } -} - -// VirtualNetworkListUsageResult response for the virtual networks GetUsage API service call. -type VirtualNetworkListUsageResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; VirtualNetwork usage stats. - Value *[]VirtualNetworkUsage `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkListUsageResult. -func (vnlur VirtualNetworkListUsageResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnlur.NextLink != nil { - objectMap["nextLink"] = vnlur.NextLink - } - return json.Marshal(objectMap) -} - -// VirtualNetworkListUsageResultIterator provides access to a complete listing of VirtualNetworkUsage -// values. -type VirtualNetworkListUsageResultIterator struct { - i int - page VirtualNetworkListUsageResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkListUsageResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListUsageResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkListUsageResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkListUsageResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkListUsageResultIterator) Response() VirtualNetworkListUsageResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkListUsageResultIterator) Value() VirtualNetworkUsage { - if !iter.page.NotDone() { - return VirtualNetworkUsage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkListUsageResultIterator type. -func NewVirtualNetworkListUsageResultIterator(page VirtualNetworkListUsageResultPage) VirtualNetworkListUsageResultIterator { - return VirtualNetworkListUsageResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnlur VirtualNetworkListUsageResult) IsEmpty() bool { - return vnlur.Value == nil || len(*vnlur.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnlur VirtualNetworkListUsageResult) hasNextLink() bool { - return vnlur.NextLink != nil && len(*vnlur.NextLink) != 0 -} - -// virtualNetworkListUsageResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnlur VirtualNetworkListUsageResult) virtualNetworkListUsageResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnlur.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnlur.NextLink))) -} - -// VirtualNetworkListUsageResultPage contains a page of VirtualNetworkUsage values. -type VirtualNetworkListUsageResultPage struct { - fn func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error) - vnlur VirtualNetworkListUsageResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkListUsageResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListUsageResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnlur) - if err != nil { - return err - } - page.vnlur = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkListUsageResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkListUsageResultPage) NotDone() bool { - return !page.vnlur.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkListUsageResultPage) Response() VirtualNetworkListUsageResult { - return page.vnlur -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkListUsageResultPage) Values() []VirtualNetworkUsage { - if page.vnlur.IsEmpty() { - return nil - } - return *page.vnlur.Value -} - -// Creates a new instance of the VirtualNetworkListUsageResultPage type. -func NewVirtualNetworkListUsageResultPage(cur VirtualNetworkListUsageResult, getNextPage func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error)) VirtualNetworkListUsageResultPage { - return VirtualNetworkListUsageResultPage{ - fn: getNextPage, - vnlur: cur, - } -} - -// VirtualNetworkPeering peerings in a virtual network resource. -type VirtualNetworkPeering struct { - autorest.Response `json:"-"` - // VirtualNetworkPeeringPropertiesFormat - Properties of the virtual network peering. - *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkPeering. -func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnp.VirtualNetworkPeeringPropertiesFormat != nil { - objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat - } - if vnp.Name != nil { - objectMap["name"] = vnp.Name - } - if vnp.Type != nil { - objectMap["type"] = vnp.Type - } - if vnp.ID != nil { - objectMap["id"] = vnp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct. -func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat) - if err != nil { - return err - } - vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vnp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vnp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vnp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vnp.ID = &ID - } - } - } - - return nil -} - -// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that -// belong to a virtual network. -type VirtualNetworkPeeringListResult struct { - autorest.Response `json:"-"` - // Value - The peerings in a virtual network. - Value *[]VirtualNetworkPeering `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkPeeringListResultIterator provides access to a complete listing of VirtualNetworkPeering -// values. -type VirtualNetworkPeeringListResultIterator struct { - i int - page VirtualNetworkPeeringListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkPeeringListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkPeeringListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkPeeringListResultIterator) Response() VirtualNetworkPeeringListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkPeeringListResultIterator) Value() VirtualNetworkPeering { - if !iter.page.NotDone() { - return VirtualNetworkPeering{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkPeeringListResultIterator type. -func NewVirtualNetworkPeeringListResultIterator(page VirtualNetworkPeeringListResultPage) VirtualNetworkPeeringListResultIterator { - return VirtualNetworkPeeringListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool { - return vnplr.Value == nil || len(*vnplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vnplr VirtualNetworkPeeringListResult) hasNextLink() bool { - return vnplr.NextLink != nil && len(*vnplr.NextLink) != 0 -} - -// virtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vnplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vnplr.NextLink))) -} - -// VirtualNetworkPeeringListResultPage contains a page of VirtualNetworkPeering values. -type VirtualNetworkPeeringListResultPage struct { - fn func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error) - vnplr VirtualNetworkPeeringListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vnplr) - if err != nil { - return err - } - page.vnplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkPeeringListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkPeeringListResultPage) NotDone() bool { - return !page.vnplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkPeeringListResultPage) Response() VirtualNetworkPeeringListResult { - return page.vnplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkPeeringListResultPage) Values() []VirtualNetworkPeering { - if page.vnplr.IsEmpty() { - return nil - } - return *page.vnplr.Value -} - -// Creates a new instance of the VirtualNetworkPeeringListResultPage type. -func NewVirtualNetworkPeeringListResultPage(cur VirtualNetworkPeeringListResult, getNextPage func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)) VirtualNetworkPeeringListResultPage { - return VirtualNetworkPeeringListResultPage{ - fn: getNextPage, - vnplr: cur, - } -} - -// VirtualNetworkPeeringPropertiesFormat properties of the virtual network peering. -type VirtualNetworkPeeringPropertiesFormat struct { - // AllowVirtualNetworkAccess - Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space. - AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` - // AllowForwardedTraffic - Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network. - AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` - // AllowGatewayTransit - If gateway links can be used in remote virtual networking to link to this virtual network. - AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` - // UseRemoteGateways - If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. - UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` - // RemoteVirtualNetwork - The reference to the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - // RemoteAddressSpace - The reference to the address space peered with the remote virtual network. - RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` - // RemoteVirtualNetworkAddressSpace - The reference to the current address space of the remote virtual network. - RemoteVirtualNetworkAddressSpace *AddressSpace `json:"remoteVirtualNetworkAddressSpace,omitempty"` - // RemoteBgpCommunities - The reference to the remote virtual network's Bgp Communities. - RemoteBgpCommunities *VirtualNetworkBgpCommunities `json:"remoteBgpCommunities,omitempty"` - // RemoteVirtualNetworkEncryption - READ-ONLY; The reference to the remote virtual network's encryption - RemoteVirtualNetworkEncryption *VirtualNetworkEncryption `json:"remoteVirtualNetworkEncryption,omitempty"` - // PeeringState - The status of the virtual network peering. Possible values include: 'VirtualNetworkPeeringStateInitiated', 'VirtualNetworkPeeringStateConnected', 'VirtualNetworkPeeringStateDisconnected' - PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"` - // PeeringSyncLevel - The peering sync status of the virtual network peering. Possible values include: 'FullyInSync', 'RemoteNotInSync', 'LocalNotInSync', 'LocalAndRemoteNotInSync' - PeeringSyncLevel VirtualNetworkPeeringLevel `json:"peeringSyncLevel,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network peering resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // DoNotVerifyRemoteGateways - If we need to verify the provisioning state of the remote gateway. - DoNotVerifyRemoteGateways *bool `json:"doNotVerifyRemoteGateways,omitempty"` - // ResourceGUID - READ-ONLY; The resourceGuid property of the Virtual Network peering resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkPeeringPropertiesFormat. -func (vnppf VirtualNetworkPeeringPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnppf.AllowVirtualNetworkAccess != nil { - objectMap["allowVirtualNetworkAccess"] = vnppf.AllowVirtualNetworkAccess - } - if vnppf.AllowForwardedTraffic != nil { - objectMap["allowForwardedTraffic"] = vnppf.AllowForwardedTraffic - } - if vnppf.AllowGatewayTransit != nil { - objectMap["allowGatewayTransit"] = vnppf.AllowGatewayTransit - } - if vnppf.UseRemoteGateways != nil { - objectMap["useRemoteGateways"] = vnppf.UseRemoteGateways - } - if vnppf.RemoteVirtualNetwork != nil { - objectMap["remoteVirtualNetwork"] = vnppf.RemoteVirtualNetwork - } - if vnppf.RemoteAddressSpace != nil { - objectMap["remoteAddressSpace"] = vnppf.RemoteAddressSpace - } - if vnppf.RemoteVirtualNetworkAddressSpace != nil { - objectMap["remoteVirtualNetworkAddressSpace"] = vnppf.RemoteVirtualNetworkAddressSpace - } - if vnppf.RemoteBgpCommunities != nil { - objectMap["remoteBgpCommunities"] = vnppf.RemoteBgpCommunities - } - if vnppf.PeeringState != "" { - objectMap["peeringState"] = vnppf.PeeringState - } - if vnppf.PeeringSyncLevel != "" { - objectMap["peeringSyncLevel"] = vnppf.PeeringSyncLevel - } - if vnppf.DoNotVerifyRemoteGateways != nil { - objectMap["doNotVerifyRemoteGateways"] = vnppf.DoNotVerifyRemoteGateways - } - return json.Marshal(objectMap) -} - -// VirtualNetworkPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkPeeringsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkPeeringsClient) (VirtualNetworkPeering, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkPeeringsCreateOrUpdateFuture.Result. -func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vnp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vnp.Response.Response, err = future.GetResult(sender); err == nil && vnp.Response.Response.StatusCode != http.StatusNoContent { - vnp, err = client.CreateOrUpdateResponder(vnp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", vnp.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkPeeringsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkPeeringsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkPeeringsDeleteFuture.Result. -func (future *VirtualNetworkPeeringsDeleteFuture) result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkPropertiesFormat properties of the virtual network. -type VirtualNetworkPropertiesFormat struct { - // AddressSpace - The AddressSpace that contains an array of IP address ranges that can be used by subnets. - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - // DhcpOptions - The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. - DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` - // FlowTimeoutInMinutes - The FlowTimeout value (in minutes) for the Virtual Network - FlowTimeoutInMinutes *int32 `json:"flowTimeoutInMinutes,omitempty"` - // Subnets - A list of subnets in a Virtual Network. - Subnets *[]Subnet `json:"subnets,omitempty"` - // VirtualNetworkPeerings - A list of peerings in a Virtual Network. - VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` - // ResourceGUID - READ-ONLY; The resourceGuid property of the Virtual Network resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // EnableDdosProtection - Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. - EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` - // EnableVMProtection - Indicates if VM protection is enabled for all the subnets in the virtual network. - EnableVMProtection *bool `json:"enableVmProtection,omitempty"` - // DdosProtectionPlan - The DDoS protection plan associated with the virtual network. - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - // BgpCommunities - Bgp Communities sent over ExpressRoute with each route corresponding to a prefix in this VNET. - BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"` - // Encryption - Indicates if encryption is enabled on virtual network and if VM without encryption is allowed in encrypted VNet. - Encryption *VirtualNetworkEncryption `json:"encryption,omitempty"` - // IPAllocations - Array of IpAllocation which reference this VNET. - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkPropertiesFormat. -func (vnpf VirtualNetworkPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnpf.AddressSpace != nil { - objectMap["addressSpace"] = vnpf.AddressSpace - } - if vnpf.DhcpOptions != nil { - objectMap["dhcpOptions"] = vnpf.DhcpOptions - } - if vnpf.FlowTimeoutInMinutes != nil { - objectMap["flowTimeoutInMinutes"] = vnpf.FlowTimeoutInMinutes - } - if vnpf.Subnets != nil { - objectMap["subnets"] = vnpf.Subnets - } - if vnpf.VirtualNetworkPeerings != nil { - objectMap["virtualNetworkPeerings"] = vnpf.VirtualNetworkPeerings - } - if vnpf.EnableDdosProtection != nil { - objectMap["enableDdosProtection"] = vnpf.EnableDdosProtection - } - if vnpf.EnableVMProtection != nil { - objectMap["enableVmProtection"] = vnpf.EnableVMProtection - } - if vnpf.DdosProtectionPlan != nil { - objectMap["ddosProtectionPlan"] = vnpf.DdosProtectionPlan - } - if vnpf.BgpCommunities != nil { - objectMap["bgpCommunities"] = vnpf.BgpCommunities - } - if vnpf.Encryption != nil { - objectMap["encryption"] = vnpf.Encryption - } - if vnpf.IPAllocations != nil { - objectMap["ipAllocations"] = vnpf.IPAllocations - } - return json.Marshal(objectMap) -} - -// VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworksCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworksClient) (VirtualNetwork, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworksCreateOrUpdateFuture.Result. -func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vn.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent { - vn, err = client.CreateOrUpdateResponder(vn.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", vn.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualNetworksDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworksDeleteFuture.Result. -func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworksListDdosProtectionStatusAllFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualNetworksListDdosProtectionStatusAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworksClient) (VirtualNetworkDdosProtectionStatusResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworksListDdosProtectionStatusAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworksListDdosProtectionStatusAllFuture.Result. -func (future *VirtualNetworksListDdosProtectionStatusAllFuture) result(client VirtualNetworksClient) (vndpsrp VirtualNetworkDdosProtectionStatusResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksListDdosProtectionStatusAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vndpsrp.vndpsr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksListDdosProtectionStatusAllFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vndpsrp.vndpsr.Response.Response, err = future.GetResult(sender); err == nil && vndpsrp.vndpsr.Response.Response.StatusCode != http.StatusNoContent { - vndpsrp, err = client.ListDdosProtectionStatusResponder(vndpsrp.vndpsr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksListDdosProtectionStatusAllFuture", "Result", vndpsrp.vndpsr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworksListDdosProtectionStatusFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualNetworksListDdosProtectionStatusFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworksClient) (VirtualNetworkDdosProtectionStatusResultPage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworksListDdosProtectionStatusFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworksListDdosProtectionStatusFuture.Result. -func (future *VirtualNetworksListDdosProtectionStatusFuture) result(client VirtualNetworksClient) (vndpsrp VirtualNetworkDdosProtectionStatusResultPage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksListDdosProtectionStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vndpsrp.vndpsr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksListDdosProtectionStatusFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vndpsrp.vndpsr.Response.Response, err = future.GetResult(sender); err == nil && vndpsrp.vndpsr.Response.Response.StatusCode != http.StatusNoContent { - vndpsrp, err = client.ListDdosProtectionStatusResponder(vndpsrp.vndpsr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksListDdosProtectionStatusFuture", "Result", vndpsrp.vndpsr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkTap virtual Network Tap resource. -type VirtualNetworkTap struct { - autorest.Response `json:"-"` - // VirtualNetworkTapPropertiesFormat - Virtual Network Tap Properties. - *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkTap. -func (vnt VirtualNetworkTap) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vnt.VirtualNetworkTapPropertiesFormat != nil { - objectMap["properties"] = vnt.VirtualNetworkTapPropertiesFormat - } - if vnt.ID != nil { - objectMap["id"] = vnt.ID - } - if vnt.Location != nil { - objectMap["location"] = vnt.Location - } - if vnt.Tags != nil { - objectMap["tags"] = vnt.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualNetworkTap struct. -func (vnt *VirtualNetworkTap) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualNetworkTapPropertiesFormat VirtualNetworkTapPropertiesFormat - err = json.Unmarshal(*v, &virtualNetworkTapPropertiesFormat) - if err != nil { - return err - } - vnt.VirtualNetworkTapPropertiesFormat = &virtualNetworkTapPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vnt.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vnt.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vnt.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vnt.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vnt.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vnt.Tags = tags - } - } - } - - return nil -} - -// VirtualNetworkTapListResult response for ListVirtualNetworkTap API service call. -type VirtualNetworkTapListResult struct { - autorest.Response `json:"-"` - // Value - A list of VirtualNetworkTaps in a resource group. - Value *[]VirtualNetworkTap `json:"value,omitempty"` - // NextLink - The URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualNetworkTapListResultIterator provides access to a complete listing of VirtualNetworkTap values. -type VirtualNetworkTapListResultIterator struct { - i int - page VirtualNetworkTapListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualNetworkTapListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualNetworkTapListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualNetworkTapListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualNetworkTapListResultIterator) Response() VirtualNetworkTapListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualNetworkTapListResultIterator) Value() VirtualNetworkTap { - if !iter.page.NotDone() { - return VirtualNetworkTap{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualNetworkTapListResultIterator type. -func NewVirtualNetworkTapListResultIterator(page VirtualNetworkTapListResultPage) VirtualNetworkTapListResultIterator { - return VirtualNetworkTapListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vntlr VirtualNetworkTapListResult) IsEmpty() bool { - return vntlr.Value == nil || len(*vntlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vntlr VirtualNetworkTapListResult) hasNextLink() bool { - return vntlr.NextLink != nil && len(*vntlr.NextLink) != 0 -} - -// virtualNetworkTapListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vntlr VirtualNetworkTapListResult) virtualNetworkTapListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vntlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vntlr.NextLink))) -} - -// VirtualNetworkTapListResultPage contains a page of VirtualNetworkTap values. -type VirtualNetworkTapListResultPage struct { - fn func(context.Context, VirtualNetworkTapListResult) (VirtualNetworkTapListResult, error) - vntlr VirtualNetworkTapListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualNetworkTapListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vntlr) - if err != nil { - return err - } - page.vntlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualNetworkTapListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualNetworkTapListResultPage) NotDone() bool { - return !page.vntlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualNetworkTapListResultPage) Response() VirtualNetworkTapListResult { - return page.vntlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualNetworkTapListResultPage) Values() []VirtualNetworkTap { - if page.vntlr.IsEmpty() { - return nil - } - return *page.vntlr.Value -} - -// Creates a new instance of the VirtualNetworkTapListResultPage type. -func NewVirtualNetworkTapListResultPage(cur VirtualNetworkTapListResult, getNextPage func(context.Context, VirtualNetworkTapListResult) (VirtualNetworkTapListResult, error)) VirtualNetworkTapListResultPage { - return VirtualNetworkTapListResultPage{ - fn: getNextPage, - vntlr: cur, - } -} - -// VirtualNetworkTapPropertiesFormat virtual Network Tap properties. -type VirtualNetworkTapPropertiesFormat struct { - // NetworkInterfaceTapConfigurations - READ-ONLY; Specifies the list of resource IDs for the network interface IP configuration that needs to be tapped. - NetworkInterfaceTapConfigurations *[]InterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the virtual network tap resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual network tap resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // DestinationNetworkInterfaceIPConfiguration - The reference to the private IP Address of the collector nic that will receive the tap. - DestinationNetworkInterfaceIPConfiguration *InterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - // DestinationLoadBalancerFrontEndIPConfiguration - The reference to the private IP address on the internal Load Balancer that will receive the tap. - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - // DestinationPort - The VXLAN destination port that will receive the tapped traffic. - DestinationPort *int32 `json:"destinationPort,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkTapPropertiesFormat. -func (vntpf VirtualNetworkTapPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vntpf.DestinationNetworkInterfaceIPConfiguration != nil { - objectMap["destinationNetworkInterfaceIPConfiguration"] = vntpf.DestinationNetworkInterfaceIPConfiguration - } - if vntpf.DestinationLoadBalancerFrontEndIPConfiguration != nil { - objectMap["destinationLoadBalancerFrontEndIPConfiguration"] = vntpf.DestinationLoadBalancerFrontEndIPConfiguration - } - if vntpf.DestinationPort != nil { - objectMap["destinationPort"] = vntpf.DestinationPort - } - return json.Marshal(objectMap) -} - -// VirtualNetworkTapsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkTapsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkTapsClient) (VirtualNetworkTap, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkTapsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkTapsCreateOrUpdateFuture.Result. -func (future *VirtualNetworkTapsCreateOrUpdateFuture) result(client VirtualNetworkTapsClient) (vnt VirtualNetworkTap, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vnt.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vnt.Response.Response, err = future.GetResult(sender); err == nil && vnt.Response.Response.StatusCode != http.StatusNoContent { - vnt, err = client.CreateOrUpdateResponder(vnt.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsCreateOrUpdateFuture", "Result", vnt.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualNetworkTapsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualNetworkTapsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualNetworkTapsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualNetworkTapsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualNetworkTapsDeleteFuture.Result. -func (future *VirtualNetworkTapsDeleteFuture) result(client VirtualNetworkTapsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualNetworkUsage usage details for subnet. -type VirtualNetworkUsage struct { - // CurrentValue - READ-ONLY; Indicates number of IPs used from the Subnet. - CurrentValue *float64 `json:"currentValue,omitempty"` - // ID - READ-ONLY; Subnet identifier. - ID *string `json:"id,omitempty"` - // Limit - READ-ONLY; Indicates the size of the subnet. - Limit *float64 `json:"limit,omitempty"` - // Name - READ-ONLY; The name containing common and localized value for usage. - Name *VirtualNetworkUsageName `json:"name,omitempty"` - // Unit - READ-ONLY; Usage units. Returns 'Count'. - Unit *string `json:"unit,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkUsage. -func (vnu VirtualNetworkUsage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualNetworkUsageName usage strings container. -type VirtualNetworkUsageName struct { - // LocalizedValue - READ-ONLY; Localized subnet size and usage string. - LocalizedValue *string `json:"localizedValue,omitempty"` - // Value - READ-ONLY; Subnet size and usage string. - Value *string `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualNetworkUsageName. -func (vnun VirtualNetworkUsageName) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualRouter virtualRouter Resource. -type VirtualRouter struct { - autorest.Response `json:"-"` - // VirtualRouterPropertiesFormat - Properties of the Virtual Router. - *VirtualRouterPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualRouter. -func (vr VirtualRouter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vr.VirtualRouterPropertiesFormat != nil { - objectMap["properties"] = vr.VirtualRouterPropertiesFormat - } - if vr.ID != nil { - objectMap["id"] = vr.ID - } - if vr.Location != nil { - objectMap["location"] = vr.Location - } - if vr.Tags != nil { - objectMap["tags"] = vr.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualRouter struct. -func (vr *VirtualRouter) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualRouterPropertiesFormat VirtualRouterPropertiesFormat - err = json.Unmarshal(*v, &virtualRouterPropertiesFormat) - if err != nil { - return err - } - vr.VirtualRouterPropertiesFormat = &virtualRouterPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vr.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vr.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vr.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vr.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vr.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vr.Tags = tags - } - } - } - - return nil -} - -// VirtualRouterAutoScaleConfiguration the VirtualHub Router autoscale configuration. -type VirtualRouterAutoScaleConfiguration struct { - // MinCapacity - The minimum number of scale units for VirtualHub Router. - MinCapacity *int32 `json:"minCapacity,omitempty"` -} - -// VirtualRouterListResult response for ListVirtualRouters API service call. -type VirtualRouterListResult struct { - autorest.Response `json:"-"` - // Value - List of Virtual Routers. - Value *[]VirtualRouter `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualRouterListResultIterator provides access to a complete listing of VirtualRouter values. -type VirtualRouterListResultIterator struct { - i int - page VirtualRouterListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualRouterListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualRouterListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualRouterListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualRouterListResultIterator) Response() VirtualRouterListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualRouterListResultIterator) Value() VirtualRouter { - if !iter.page.NotDone() { - return VirtualRouter{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualRouterListResultIterator type. -func NewVirtualRouterListResultIterator(page VirtualRouterListResultPage) VirtualRouterListResultIterator { - return VirtualRouterListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vrlr VirtualRouterListResult) IsEmpty() bool { - return vrlr.Value == nil || len(*vrlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vrlr VirtualRouterListResult) hasNextLink() bool { - return vrlr.NextLink != nil && len(*vrlr.NextLink) != 0 -} - -// virtualRouterListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vrlr VirtualRouterListResult) virtualRouterListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vrlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vrlr.NextLink))) -} - -// VirtualRouterListResultPage contains a page of VirtualRouter values. -type VirtualRouterListResultPage struct { - fn func(context.Context, VirtualRouterListResult) (VirtualRouterListResult, error) - vrlr VirtualRouterListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualRouterListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vrlr) - if err != nil { - return err - } - page.vrlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualRouterListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualRouterListResultPage) NotDone() bool { - return !page.vrlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualRouterListResultPage) Response() VirtualRouterListResult { - return page.vrlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualRouterListResultPage) Values() []VirtualRouter { - if page.vrlr.IsEmpty() { - return nil - } - return *page.vrlr.Value -} - -// Creates a new instance of the VirtualRouterListResultPage type. -func NewVirtualRouterListResultPage(cur VirtualRouterListResult, getNextPage func(context.Context, VirtualRouterListResult) (VirtualRouterListResult, error)) VirtualRouterListResultPage { - return VirtualRouterListResultPage{ - fn: getNextPage, - vrlr: cur, - } -} - -// VirtualRouterPeering virtual Router Peering resource. -type VirtualRouterPeering struct { - autorest.Response `json:"-"` - // VirtualRouterPeeringProperties - The properties of the Virtual Router Peering. - *VirtualRouterPeeringProperties `json:"properties,omitempty"` - // Name - Name of the virtual router peering that is unique within a virtual router. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Peering type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualRouterPeering. -func (vrp VirtualRouterPeering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vrp.VirtualRouterPeeringProperties != nil { - objectMap["properties"] = vrp.VirtualRouterPeeringProperties - } - if vrp.Name != nil { - objectMap["name"] = vrp.Name - } - if vrp.ID != nil { - objectMap["id"] = vrp.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualRouterPeering struct. -func (vrp *VirtualRouterPeering) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualRouterPeeringProperties VirtualRouterPeeringProperties - err = json.Unmarshal(*v, &virtualRouterPeeringProperties) - if err != nil { - return err - } - vrp.VirtualRouterPeeringProperties = &virtualRouterPeeringProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vrp.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vrp.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vrp.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vrp.ID = &ID - } - } - } - - return nil -} - -// VirtualRouterPeeringListResult response for ListVirtualRouterPeerings API service call. -type VirtualRouterPeeringListResult struct { - autorest.Response `json:"-"` - // Value - List of VirtualRouterPeerings in a VirtualRouter. - Value *[]VirtualRouterPeering `json:"value,omitempty"` - // NextLink - URL to get the next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualRouterPeeringListResultIterator provides access to a complete listing of VirtualRouterPeering -// values. -type VirtualRouterPeeringListResultIterator struct { - i int - page VirtualRouterPeeringListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualRouterPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualRouterPeeringListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualRouterPeeringListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualRouterPeeringListResultIterator) Response() VirtualRouterPeeringListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualRouterPeeringListResultIterator) Value() VirtualRouterPeering { - if !iter.page.NotDone() { - return VirtualRouterPeering{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualRouterPeeringListResultIterator type. -func NewVirtualRouterPeeringListResultIterator(page VirtualRouterPeeringListResultPage) VirtualRouterPeeringListResultIterator { - return VirtualRouterPeeringListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vrplr VirtualRouterPeeringListResult) IsEmpty() bool { - return vrplr.Value == nil || len(*vrplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vrplr VirtualRouterPeeringListResult) hasNextLink() bool { - return vrplr.NextLink != nil && len(*vrplr.NextLink) != 0 -} - -// virtualRouterPeeringListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vrplr VirtualRouterPeeringListResult) virtualRouterPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vrplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vrplr.NextLink))) -} - -// VirtualRouterPeeringListResultPage contains a page of VirtualRouterPeering values. -type VirtualRouterPeeringListResultPage struct { - fn func(context.Context, VirtualRouterPeeringListResult) (VirtualRouterPeeringListResult, error) - vrplr VirtualRouterPeeringListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualRouterPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vrplr) - if err != nil { - return err - } - page.vrplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualRouterPeeringListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualRouterPeeringListResultPage) NotDone() bool { - return !page.vrplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualRouterPeeringListResultPage) Response() VirtualRouterPeeringListResult { - return page.vrplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualRouterPeeringListResultPage) Values() []VirtualRouterPeering { - if page.vrplr.IsEmpty() { - return nil - } - return *page.vrplr.Value -} - -// Creates a new instance of the VirtualRouterPeeringListResultPage type. -func NewVirtualRouterPeeringListResultPage(cur VirtualRouterPeeringListResult, getNextPage func(context.Context, VirtualRouterPeeringListResult) (VirtualRouterPeeringListResult, error)) VirtualRouterPeeringListResultPage { - return VirtualRouterPeeringListResultPage{ - fn: getNextPage, - vrplr: cur, - } -} - -// VirtualRouterPeeringProperties properties of the rule group. -type VirtualRouterPeeringProperties struct { - // PeerAsn - Peer ASN. - PeerAsn *int64 `json:"peerAsn,omitempty"` - // PeerIP - Peer IP. - PeerIP *string `json:"peerIp,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualRouterPeeringProperties. -func (vrpp VirtualRouterPeeringProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vrpp.PeerAsn != nil { - objectMap["peerAsn"] = vrpp.PeerAsn - } - if vrpp.PeerIP != nil { - objectMap["peerIp"] = vrpp.PeerIP - } - return json.Marshal(objectMap) -} - -// VirtualRouterPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualRouterPeeringsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualRouterPeeringsClient) (VirtualRouterPeering, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualRouterPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualRouterPeeringsCreateOrUpdateFuture.Result. -func (future *VirtualRouterPeeringsCreateOrUpdateFuture) result(client VirtualRouterPeeringsClient) (vrp VirtualRouterPeering, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vrp.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualRouterPeeringsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vrp.Response.Response, err = future.GetResult(sender); err == nil && vrp.Response.Response.StatusCode != http.StatusNoContent { - vrp, err = client.CreateOrUpdateResponder(vrp.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsCreateOrUpdateFuture", "Result", vrp.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualRouterPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualRouterPeeringsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualRouterPeeringsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualRouterPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualRouterPeeringsDeleteFuture.Result. -func (future *VirtualRouterPeeringsDeleteFuture) result(client VirtualRouterPeeringsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualRouterPeeringsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualRouterPropertiesFormat virtual Router definition. -type VirtualRouterPropertiesFormat struct { - // VirtualRouterAsn - VirtualRouter ASN. - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - // VirtualRouterIps - VirtualRouter IPs. - VirtualRouterIps *[]string `json:"virtualRouterIps,omitempty"` - // HostedSubnet - The Subnet on which VirtualRouter is hosted. - HostedSubnet *SubResource `json:"hostedSubnet,omitempty"` - // HostedGateway - The Gateway on which VirtualRouter is hosted. - HostedGateway *SubResource `json:"hostedGateway,omitempty"` - // Peerings - READ-ONLY; List of references to VirtualRouterPeerings. - Peerings *[]SubResource `json:"peerings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualRouterPropertiesFormat. -func (vrpf VirtualRouterPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vrpf.VirtualRouterAsn != nil { - objectMap["virtualRouterAsn"] = vrpf.VirtualRouterAsn - } - if vrpf.VirtualRouterIps != nil { - objectMap["virtualRouterIps"] = vrpf.VirtualRouterIps - } - if vrpf.HostedSubnet != nil { - objectMap["hostedSubnet"] = vrpf.HostedSubnet - } - if vrpf.HostedGateway != nil { - objectMap["hostedGateway"] = vrpf.HostedGateway - } - return json.Marshal(objectMap) -} - -// VirtualRoutersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualRoutersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualRoutersClient) (VirtualRouter, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualRoutersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualRoutersCreateOrUpdateFuture.Result. -func (future *VirtualRoutersCreateOrUpdateFuture) result(client VirtualRoutersClient) (vr VirtualRouter, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualRoutersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vr.Response.Response, err = future.GetResult(sender); err == nil && vr.Response.Response.StatusCode != http.StatusNoContent { - vr, err = client.CreateOrUpdateResponder(vr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersCreateOrUpdateFuture", "Result", vr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualRoutersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualRoutersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualRoutersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualRoutersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualRoutersDeleteFuture.Result. -func (future *VirtualRoutersDeleteFuture) result(client VirtualRoutersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualRoutersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualWAN virtualWAN Resource. -type VirtualWAN struct { - autorest.Response `json:"-"` - // VirtualWanProperties - Properties of the virtual WAN. - *VirtualWanProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualWAN. -func (vw VirtualWAN) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vw.VirtualWanProperties != nil { - objectMap["properties"] = vw.VirtualWanProperties - } - if vw.ID != nil { - objectMap["id"] = vw.ID - } - if vw.Location != nil { - objectMap["location"] = vw.Location - } - if vw.Tags != nil { - objectMap["tags"] = vw.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualWAN struct. -func (vw *VirtualWAN) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualWanProperties VirtualWanProperties - err = json.Unmarshal(*v, &virtualWanProperties) - if err != nil { - return err - } - vw.VirtualWanProperties = &virtualWanProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vw.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vw.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vw.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vw.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vw.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vw.Tags = tags - } - } - } - - return nil -} - -// VirtualWanProperties parameters for VirtualWAN. -type VirtualWanProperties struct { - // DisableVpnEncryption - Vpn encryption to be disabled or not. - DisableVpnEncryption *bool `json:"disableVpnEncryption,omitempty"` - // VirtualHubs - READ-ONLY; List of VirtualHubs in the VirtualWAN. - VirtualHubs *[]SubResource `json:"virtualHubs,omitempty"` - // VpnSites - READ-ONLY; List of VpnSites in the VirtualWAN. - VpnSites *[]SubResource `json:"vpnSites,omitempty"` - // AllowBranchToBranchTraffic - True if branch to branch traffic is allowed. - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - // AllowVnetToVnetTraffic - True if Vnet to Vnet traffic is allowed. - AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"` - // Office365LocalBreakoutCategory - The office local breakout category. Possible values include: 'OfficeTrafficCategoryOptimize', 'OfficeTrafficCategoryOptimizeAndAllow', 'OfficeTrafficCategoryAll', 'OfficeTrafficCategoryNone' - Office365LocalBreakoutCategory OfficeTrafficCategory `json:"office365LocalBreakoutCategory,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the virtual WAN resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Type - The type of the VirtualWAN. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualWanProperties. -func (vwp VirtualWanProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vwp.DisableVpnEncryption != nil { - objectMap["disableVpnEncryption"] = vwp.DisableVpnEncryption - } - if vwp.AllowBranchToBranchTraffic != nil { - objectMap["allowBranchToBranchTraffic"] = vwp.AllowBranchToBranchTraffic - } - if vwp.AllowVnetToVnetTraffic != nil { - objectMap["allowVnetToVnetTraffic"] = vwp.AllowVnetToVnetTraffic - } - if vwp.Office365LocalBreakoutCategory != "" { - objectMap["office365LocalBreakoutCategory"] = vwp.Office365LocalBreakoutCategory - } - if vwp.Type != nil { - objectMap["type"] = vwp.Type - } - return json.Marshal(objectMap) -} - -// VirtualWansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualWansCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualWansClient) (VirtualWAN, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualWansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualWansCreateOrUpdateFuture.Result. -func (future *VirtualWansCreateOrUpdateFuture) result(client VirtualWansClient) (vw VirtualWAN, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vw.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualWansCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vw.Response.Response, err = future.GetResult(sender); err == nil && vw.Response.Response.StatusCode != http.StatusNoContent { - vw, err = client.CreateOrUpdateResponder(vw.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansCreateOrUpdateFuture", "Result", vw.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualWansDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualWansDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualWansClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualWansDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualWansDeleteFuture.Result. -func (future *VirtualWansDeleteFuture) result(client VirtualWansClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VirtualWansDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualWanSecurityProvider collection of SecurityProviders. -type VirtualWanSecurityProvider struct { - // Name - Name of the security provider. - Name *string `json:"name,omitempty"` - // URL - Url of the security provider. - URL *string `json:"url,omitempty"` - // Type - Name of the security provider. Possible values include: 'External', 'Native' - Type VirtualWanSecurityProviderType `json:"type,omitempty"` -} - -// VirtualWanSecurityProviders collection of SecurityProviders. -type VirtualWanSecurityProviders struct { - autorest.Response `json:"-"` - // SupportedProviders - List of VirtualWAN security providers. - SupportedProviders *[]VirtualWanSecurityProvider `json:"supportedProviders,omitempty"` -} - -// VirtualWanVpnProfileParameters virtual Wan Vpn profile parameters Vpn profile generation. -type VirtualWanVpnProfileParameters struct { - // VpnServerConfigurationResourceID - VpnServerConfiguration partial resource uri with which VirtualWan is associated to. - VpnServerConfigurationResourceID *string `json:"vpnServerConfigurationResourceId,omitempty"` - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' - AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` -} - -// VM describes a Virtual Machine. -type VM struct { - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VM. -func (vVar VM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vVar.ID != nil { - objectMap["id"] = vVar.ID - } - if vVar.Location != nil { - objectMap["location"] = vVar.Location - } - if vVar.Tags != nil { - objectMap["tags"] = vVar.Tags - } - return json.Marshal(objectMap) -} - -// VnetRoute list of routes that control routing from VirtualHub into a virtual network connection. -type VnetRoute struct { - // StaticRoutesConfig - Configuration for static routes on this HubVnetConnection. - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` - // StaticRoutes - List of all Static Routes. - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - // BgpConnections - READ-ONLY; The list of references to HubBgpConnection objects. - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` -} - -// MarshalJSON is the custom marshaler for VnetRoute. -func (vr VnetRoute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vr.StaticRoutesConfig != nil { - objectMap["staticRoutesConfig"] = vr.StaticRoutesConfig - } - if vr.StaticRoutes != nil { - objectMap["staticRoutes"] = vr.StaticRoutes - } - return json.Marshal(objectMap) -} - -// VngClientConnectionConfiguration a vpn client connection configuration for client connection -// configuration. -type VngClientConnectionConfiguration struct { - // VngClientConnectionConfigurationProperties - Properties of the vpn client root certificate. - *VngClientConnectionConfigurationProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VngClientConnectionConfiguration. -func (vccc VngClientConnectionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vccc.VngClientConnectionConfigurationProperties != nil { - objectMap["properties"] = vccc.VngClientConnectionConfigurationProperties - } - if vccc.Name != nil { - objectMap["name"] = vccc.Name - } - if vccc.ID != nil { - objectMap["id"] = vccc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VngClientConnectionConfiguration struct. -func (vccc *VngClientConnectionConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vngClientConnectionConfigurationProperties VngClientConnectionConfigurationProperties - err = json.Unmarshal(*v, &vngClientConnectionConfigurationProperties) - if err != nil { - return err - } - vccc.VngClientConnectionConfigurationProperties = &vngClientConnectionConfigurationProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vccc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vccc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vccc.ID = &ID - } - } - } - - return nil -} - -// VngClientConnectionConfigurationProperties properties of VngClientConnectionConfiguration. -type VngClientConnectionConfigurationProperties struct { - // VpnClientAddressPool - The reference to the address space resource which represents Address space for P2S VpnClient. - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - // VirtualNetworkGatewayPolicyGroups - List of references to virtualNetworkGatewayPolicyGroups - VirtualNetworkGatewayPolicyGroups *[]SubResource `json:"virtualNetworkGatewayPolicyGroups,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VngClientConnectionConfiguration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VngClientConnectionConfigurationProperties. -func (vcccp VngClientConnectionConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcccp.VpnClientAddressPool != nil { - objectMap["vpnClientAddressPool"] = vcccp.VpnClientAddressPool - } - if vcccp.VirtualNetworkGatewayPolicyGroups != nil { - objectMap["virtualNetworkGatewayPolicyGroups"] = vcccp.VirtualNetworkGatewayPolicyGroups - } - return json.Marshal(objectMap) -} - -// VpnClientConfiguration vpnClientConfiguration for P2S client. -type VpnClientConfiguration struct { - // VpnClientAddressPool - The reference to the address space resource which represents Address space for P2S VpnClient. - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - // VpnClientRootCertificates - VpnClientRootCertificate for virtual network gateway. - VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - // VpnClientRevokedCertificates - VpnClientRevokedCertificate for Virtual network gateway. - VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - // VpnClientProtocols - VpnClientProtocols for Virtual network gateway. - VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` - // VpnAuthenticationTypes - VPN authentication types for the virtual network gateway.. - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - // VpnClientIpsecPolicies - VpnClientIpsecPolicies for virtual network gateway P2S client. - VpnClientIpsecPolicies *[]IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - // RadiusServerAddress - The radius server address property of the VirtualNetworkGateway resource for vpn client connection. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - // RadiusServerSecret - The radius secret property of the VirtualNetworkGateway resource for vpn client connection. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - // RadiusServers - The radiusServers property for multiple radius server configuration. - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - // AadTenant - The AADTenant property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AadTenant *string `json:"aadTenant,omitempty"` - // AadAudience - The AADAudience property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AadAudience *string `json:"aadAudience,omitempty"` - // AadIssuer - The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. - AadIssuer *string `json:"aadIssuer,omitempty"` - // VngClientConnectionConfigurations - per ip address pool connection policy for virtual network gateway P2S client. - VngClientConnectionConfigurations *[]VngClientConnectionConfiguration `json:"vngClientConnectionConfigurations,omitempty"` -} - -// VpnClientConnectionHealth vpnClientConnectionHealth properties. -type VpnClientConnectionHealth struct { - // TotalIngressBytesTransferred - READ-ONLY; Total of the Ingress Bytes Transferred in this P2S Vpn connection. - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"` - // TotalEgressBytesTransferred - READ-ONLY; Total of the Egress Bytes Transferred in this connection. - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"` - // VpnClientConnectionsCount - The total of p2s vpn clients connected at this time to this P2SVpnGateway. - VpnClientConnectionsCount *int32 `json:"vpnClientConnectionsCount,omitempty"` - // AllocatedIPAddresses - List of allocated ip addresses to the connected p2s vpn clients. - AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientConnectionHealth. -func (vcch VpnClientConnectionHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcch.VpnClientConnectionsCount != nil { - objectMap["vpnClientConnectionsCount"] = vcch.VpnClientConnectionsCount - } - if vcch.AllocatedIPAddresses != nil { - objectMap["allocatedIpAddresses"] = vcch.AllocatedIPAddresses - } - return json.Marshal(objectMap) -} - -// VpnClientConnectionHealthDetail VPN client connection health detail. -type VpnClientConnectionHealthDetail struct { - // VpnConnectionID - READ-ONLY; The vpn client Id. - VpnConnectionID *string `json:"vpnConnectionId,omitempty"` - // VpnConnectionDuration - READ-ONLY; The duration time of a connected vpn client. - VpnConnectionDuration *int64 `json:"vpnConnectionDuration,omitempty"` - // VpnConnectionTime - READ-ONLY; The start time of a connected vpn client. - VpnConnectionTime *string `json:"vpnConnectionTime,omitempty"` - // PublicIPAddress - READ-ONLY; The public Ip of a connected vpn client. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // PrivateIPAddress - READ-ONLY; The assigned private Ip of a connected vpn client. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - // VpnUserName - READ-ONLY; The user name of a connected vpn client. - VpnUserName *string `json:"vpnUserName,omitempty"` - // MaxBandwidth - READ-ONLY; The max band width. - MaxBandwidth *int64 `json:"maxBandwidth,omitempty"` - // EgressPacketsTransferred - READ-ONLY; The egress packets per second. - EgressPacketsTransferred *int64 `json:"egressPacketsTransferred,omitempty"` - // EgressBytesTransferred - READ-ONLY; The egress bytes per second. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // IngressPacketsTransferred - READ-ONLY; The ingress packets per second. - IngressPacketsTransferred *int64 `json:"ingressPacketsTransferred,omitempty"` - // IngressBytesTransferred - READ-ONLY; The ingress bytes per second. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // MaxPacketsPerSecond - READ-ONLY; The max packets transferred per second. - MaxPacketsPerSecond *int64 `json:"maxPacketsPerSecond,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientConnectionHealthDetail. -func (vcchd VpnClientConnectionHealthDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VpnClientConnectionHealthDetailListResult list of virtual network gateway vpn client connection health. -type VpnClientConnectionHealthDetailListResult struct { - autorest.Response `json:"-"` - // Value - List of vpn client connection health. - Value *[]VpnClientConnectionHealthDetail `json:"value,omitempty"` -} - -// VpnClientIPsecParameters an IPSec parameters for a virtual network gateway P2S connection. -type VpnClientIPsecParameters struct { - autorest.Response `json:"-"` - // SaLifeTimeSeconds - The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. - SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` - // SaDataSizeKilobytes - The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. - SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` - // IpsecEncryption - The IPSec encryption algorithm (IKE phase 1). Possible values include: 'IpsecEncryptionNone', 'IpsecEncryptionDES', 'IpsecEncryptionDES3', 'IpsecEncryptionAES128', 'IpsecEncryptionAES192', 'IpsecEncryptionAES256', 'IpsecEncryptionGCMAES128', 'IpsecEncryptionGCMAES192', 'IpsecEncryptionGCMAES256' - IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` - // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' - IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` - // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' - IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` - // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' - IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` - // DhGroup - The DH Group used in IKE Phase 1 for initial SA. Possible values include: 'DhGroupNone', 'DhGroupDHGroup1', 'DhGroupDHGroup2', 'DhGroupDHGroup14', 'DhGroupDHGroup2048', 'DhGroupECP256', 'DhGroupECP384', 'DhGroupDHGroup24' - DhGroup DhGroup `json:"dhGroup,omitempty"` - // PfsGroup - The Pfs Group used in IKE Phase 2 for new child SA. Possible values include: 'PfsGroupNone', 'PfsGroupPFS1', 'PfsGroupPFS2', 'PfsGroupPFS2048', 'PfsGroupECP256', 'PfsGroupECP384', 'PfsGroupPFS24', 'PfsGroupPFS14', 'PfsGroupPFSMM' - PfsGroup PfsGroup `json:"pfsGroup,omitempty"` -} - -// VpnClientParameters vpn Client Parameters for package generation. -type VpnClientParameters struct { - // ProcessorArchitecture - VPN client Processor Architecture. Possible values include: 'Amd64', 'X86' - ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"` - // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' - AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` - // RadiusServerAuthCertificate - The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. - RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` - // ClientRootCertificates - A list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. - ClientRootCertificates *[]string `json:"clientRootCertificates,omitempty"` -} - -// VpnClientRevokedCertificate VPN client revoked certificate of virtual network gateway. -type VpnClientRevokedCertificate struct { - // VpnClientRevokedCertificatePropertiesFormat - Properties of the vpn client revoked certificate. - *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientRevokedCertificate. -func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil { - objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat - } - if vcrc.Name != nil { - objectMap["name"] = vcrc.Name - } - if vcrc.ID != nil { - objectMap["id"] = vcrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct. -func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat - err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat) - if err != nil { - return err - } - vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vcrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vcrc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vcrc.ID = &ID - } - } - } - - return nil -} - -// VpnClientRevokedCertificatePropertiesFormat properties of the revoked VPN client certificate of virtual -// network gateway. -type VpnClientRevokedCertificatePropertiesFormat struct { - // Thumbprint - The revoked VPN client certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN client revoked certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientRevokedCertificatePropertiesFormat. -func (vcrcpf VpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcrcpf.Thumbprint != nil { - objectMap["thumbprint"] = vcrcpf.Thumbprint - } - return json.Marshal(objectMap) -} - -// VpnClientRootCertificate VPN client root certificate of virtual network gateway. -type VpnClientRootCertificate struct { - // VpnClientRootCertificatePropertiesFormat - Properties of the vpn client root certificate. - *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientRootCertificate. -func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcrc.VpnClientRootCertificatePropertiesFormat != nil { - objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat - } - if vcrc.Name != nil { - objectMap["name"] = vcrc.Name - } - if vcrc.ID != nil { - objectMap["id"] = vcrc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct. -func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat - err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat) - if err != nil { - return err - } - vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vcrc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vcrc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vcrc.ID = &ID - } - } - } - - return nil -} - -// VpnClientRootCertificatePropertiesFormat properties of SSL certificates of application gateway. -type VpnClientRootCertificatePropertiesFormat struct { - // PublicCertData - The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN client root certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnClientRootCertificatePropertiesFormat. -func (vcrcpf VpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcrcpf.PublicCertData != nil { - objectMap["publicCertData"] = vcrcpf.PublicCertData - } - return json.Marshal(objectMap) -} - -// VpnConnection vpnConnection Resource. -type VpnConnection struct { - autorest.Response `json:"-"` - // VpnConnectionProperties - Properties of the VPN connection. - *VpnConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnConnection. -func (vc VpnConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vc.VpnConnectionProperties != nil { - objectMap["properties"] = vc.VpnConnectionProperties - } - if vc.Name != nil { - objectMap["name"] = vc.Name - } - if vc.ID != nil { - objectMap["id"] = vc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnConnection struct. -func (vc *VpnConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnConnectionProperties VpnConnectionProperties - err = json.Unmarshal(*v, &vpnConnectionProperties) - if err != nil { - return err - } - vc.VpnConnectionProperties = &vpnConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vc.ID = &ID - } - } - } - - return nil -} - -// VpnConnectionPacketCaptureStartParameters vpn Connection packet capture parameters supplied to start -// packet capture on gateway connection. -type VpnConnectionPacketCaptureStartParameters struct { - // FilterData - Start Packet capture parameters on vpn connection. - FilterData *string `json:"filterData,omitempty"` - // LinkConnectionNames - List of site link connection names. - LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` -} - -// VpnConnectionPacketCaptureStopParameters vpn Connection packet capture parameters supplied to stop -// packet capture on gateway connection. -type VpnConnectionPacketCaptureStopParameters struct { - // SasURL - SAS url for packet capture on vpn connection. - SasURL *string `json:"sasUrl,omitempty"` - // LinkConnectionNames - List of site link connection names. - LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` -} - -// VpnConnectionProperties parameters for VpnConnection. -type VpnConnectionProperties struct { - // RemoteVpnSite - Id of the connected vpn site. - RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"` - // RoutingWeight - Routing weight for vpn connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // DpdTimeoutSeconds - DPD timeout in seconds for vpn connection. - DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"` - // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' - ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` - // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' - VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // EgressBytesTransferred - READ-ONLY; Egress bytes transferred. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // ConnectionBandwidth - Expected bandwidth in MBPS. - ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"` - // SharedKey - SharedKey for the vpn connection. - SharedKey *string `json:"sharedKey,omitempty"` - // EnableBgp - EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - // IpsecPolicies - The IPSec Policies to be considered by this connection. - IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` - // TrafficSelectorPolicies - The Traffic Selector Policies to be considered by this connection. - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - // EnableRateLimiting - EnableBgp flag. - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - // EnableInternetSecurity - Enable internet security. - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - // UseLocalAzureIPAddress - Use local azure ip to initiate connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VpnLinkConnections - List of all vpn site link connections to the gateway. - VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"` - // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnConnectionProperties. -func (vcp VpnConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vcp.RemoteVpnSite != nil { - objectMap["remoteVpnSite"] = vcp.RemoteVpnSite - } - if vcp.RoutingWeight != nil { - objectMap["routingWeight"] = vcp.RoutingWeight - } - if vcp.DpdTimeoutSeconds != nil { - objectMap["dpdTimeoutSeconds"] = vcp.DpdTimeoutSeconds - } - if vcp.ConnectionStatus != "" { - objectMap["connectionStatus"] = vcp.ConnectionStatus - } - if vcp.VpnConnectionProtocolType != "" { - objectMap["vpnConnectionProtocolType"] = vcp.VpnConnectionProtocolType - } - if vcp.ConnectionBandwidth != nil { - objectMap["connectionBandwidth"] = vcp.ConnectionBandwidth - } - if vcp.SharedKey != nil { - objectMap["sharedKey"] = vcp.SharedKey - } - if vcp.EnableBgp != nil { - objectMap["enableBgp"] = vcp.EnableBgp - } - if vcp.UsePolicyBasedTrafficSelectors != nil { - objectMap["usePolicyBasedTrafficSelectors"] = vcp.UsePolicyBasedTrafficSelectors - } - if vcp.IpsecPolicies != nil { - objectMap["ipsecPolicies"] = vcp.IpsecPolicies - } - if vcp.TrafficSelectorPolicies != nil { - objectMap["trafficSelectorPolicies"] = vcp.TrafficSelectorPolicies - } - if vcp.EnableRateLimiting != nil { - objectMap["enableRateLimiting"] = vcp.EnableRateLimiting - } - if vcp.EnableInternetSecurity != nil { - objectMap["enableInternetSecurity"] = vcp.EnableInternetSecurity - } - if vcp.UseLocalAzureIPAddress != nil { - objectMap["useLocalAzureIpAddress"] = vcp.UseLocalAzureIPAddress - } - if vcp.VpnLinkConnections != nil { - objectMap["vpnLinkConnections"] = vcp.VpnLinkConnections - } - if vcp.RoutingConfiguration != nil { - objectMap["routingConfiguration"] = vcp.RoutingConfiguration - } - return json.Marshal(objectMap) -} - -// VpnConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnConnectionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnConnectionsClient) (VpnConnection, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnConnectionsCreateOrUpdateFuture.Result. -func (future *VpnConnectionsCreateOrUpdateFuture) result(client VpnConnectionsClient) (vc VpnConnection, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { - vc, err = client.CreateOrUpdateResponder(vc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnConnectionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnConnectionsDeleteFuture.Result. -func (future *VpnConnectionsDeleteFuture) result(client VpnConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnConnectionsStartPacketCaptureFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnConnectionsStartPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnConnectionsClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnConnectionsStartPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnConnectionsStartPacketCaptureFuture.Result. -func (future *VpnConnectionsStartPacketCaptureFuture) result(client VpnConnectionsClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsStartPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsStartPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StartPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsStartPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnConnectionsStopPacketCaptureFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnConnectionsStopPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnConnectionsClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnConnectionsStopPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnConnectionsStopPacketCaptureFuture.Result. -func (future *VpnConnectionsStopPacketCaptureFuture) result(client VpnConnectionsClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsStopPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsStopPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StopPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsStopPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnDeviceScriptParameters vpn device configuration script generation parameters. -type VpnDeviceScriptParameters struct { - // Vendor - The vendor for the vpn device. - Vendor *string `json:"vendor,omitempty"` - // DeviceFamily - The device family for the vpn device. - DeviceFamily *string `json:"deviceFamily,omitempty"` - // FirmwareVersion - The firmware version for the vpn device. - FirmwareVersion *string `json:"firmwareVersion,omitempty"` -} - -// VpnGateway vpnGateway Resource. -type VpnGateway struct { - autorest.Response `json:"-"` - // VpnGatewayProperties - Properties of the VPN gateway. - *VpnGatewayProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VpnGateway. -func (vg VpnGateway) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vg.VpnGatewayProperties != nil { - objectMap["properties"] = vg.VpnGatewayProperties - } - if vg.ID != nil { - objectMap["id"] = vg.ID - } - if vg.Location != nil { - objectMap["location"] = vg.Location - } - if vg.Tags != nil { - objectMap["tags"] = vg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnGateway struct. -func (vg *VpnGateway) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnGatewayProperties VpnGatewayProperties - err = json.Unmarshal(*v, &vpnGatewayProperties) - if err != nil { - return err - } - vg.VpnGatewayProperties = &vpnGatewayProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vg.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vg.Tags = tags - } - } - } - - return nil -} - -// VpnGatewayIPConfiguration IP Configuration of a VPN Gateway Resource. -type VpnGatewayIPConfiguration struct { - // ID - The identifier of the IP configuration for a VPN Gateway. - ID *string `json:"id,omitempty"` - // PublicIPAddress - The public IP address of this IP configuration. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // PrivateIPAddress - The private IP address of this IP configuration. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` -} - -// VpnGatewayNatRule vpnGatewayNatRule Resource. -type VpnGatewayNatRule struct { - autorest.Response `json:"-"` - // VpnGatewayNatRuleProperties - Properties of the VpnGateway NAT rule. - *VpnGatewayNatRuleProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnGatewayNatRule. -func (vgnr VpnGatewayNatRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vgnr.VpnGatewayNatRuleProperties != nil { - objectMap["properties"] = vgnr.VpnGatewayNatRuleProperties - } - if vgnr.Name != nil { - objectMap["name"] = vgnr.Name - } - if vgnr.ID != nil { - objectMap["id"] = vgnr.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnGatewayNatRule struct. -func (vgnr *VpnGatewayNatRule) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnGatewayNatRuleProperties VpnGatewayNatRuleProperties - err = json.Unmarshal(*v, &vpnGatewayNatRuleProperties) - if err != nil { - return err - } - vgnr.VpnGatewayNatRuleProperties = &vpnGatewayNatRuleProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vgnr.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vgnr.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vgnr.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vgnr.ID = &ID - } - } - } - - return nil -} - -// VpnGatewayNatRuleProperties parameters for VpnGatewayNatRule. -type VpnGatewayNatRuleProperties struct { - // ProvisioningState - READ-ONLY; The provisioning state of the NAT Rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Type - The type of NAT rule for VPN NAT. Possible values include: 'VpnNatRuleTypeStatic', 'VpnNatRuleTypeDynamic' - Type VpnNatRuleType `json:"type,omitempty"` - // Mode - The Source NAT direction of a VPN NAT. Possible values include: 'EgressSnat', 'IngressSnat' - Mode VpnNatRuleMode `json:"mode,omitempty"` - // InternalMappings - The private IP address internal mapping for NAT. - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - // ExternalMappings - The private IP address external mapping for NAT. - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - // IPConfigurationID - The IP Configuration ID this NAT rule applies to. - IPConfigurationID *string `json:"ipConfigurationId,omitempty"` - // EgressVpnSiteLinkConnections - READ-ONLY; List of egress VpnSiteLinkConnections. - EgressVpnSiteLinkConnections *[]SubResource `json:"egressVpnSiteLinkConnections,omitempty"` - // IngressVpnSiteLinkConnections - READ-ONLY; List of ingress VpnSiteLinkConnections. - IngressVpnSiteLinkConnections *[]SubResource `json:"ingressVpnSiteLinkConnections,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnGatewayNatRuleProperties. -func (vgnrp VpnGatewayNatRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vgnrp.Type != "" { - objectMap["type"] = vgnrp.Type - } - if vgnrp.Mode != "" { - objectMap["mode"] = vgnrp.Mode - } - if vgnrp.InternalMappings != nil { - objectMap["internalMappings"] = vgnrp.InternalMappings - } - if vgnrp.ExternalMappings != nil { - objectMap["externalMappings"] = vgnrp.ExternalMappings - } - if vgnrp.IPConfigurationID != nil { - objectMap["ipConfigurationId"] = vgnrp.IPConfigurationID - } - return json.Marshal(objectMap) -} - -// VpnGatewayPacketCaptureStartParameters start packet capture parameters. -type VpnGatewayPacketCaptureStartParameters struct { - // FilterData - Start Packet capture parameters on vpn gateway. - FilterData *string `json:"filterData,omitempty"` -} - -// VpnGatewayPacketCaptureStopParameters stop packet capture parameters. -type VpnGatewayPacketCaptureStopParameters struct { - // SasURL - SAS url for packet capture on vpn gateway. - SasURL *string `json:"sasUrl,omitempty"` -} - -// VpnGatewayProperties parameters for VpnGateway. -type VpnGatewayProperties struct { - // VirtualHub - The VirtualHub to which the gateway belongs. - VirtualHub *SubResource `json:"virtualHub,omitempty"` - // Connections - List of all vpn connections to the gateway. - Connections *[]VpnConnection `json:"connections,omitempty"` - // BgpSettings - Local network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // VpnGatewayScaleUnit - The scale unit for this vpn gateway. - VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"` - // IPConfigurations - READ-ONLY; List of all IPs configured on the gateway. - IPConfigurations *[]VpnGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableBgpRouteTranslationForNat - Enable BGP routes translation for NAT on this VpnGateway. - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - // IsRoutingPreferenceInternet - Enable Routing Preference property for the Public IP Interface of the VpnGateway. - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - // NatRules - List of all the nat Rules associated with the gateway. - NatRules *[]VpnGatewayNatRule `json:"natRules,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnGatewayProperties. -func (vgp VpnGatewayProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vgp.VirtualHub != nil { - objectMap["virtualHub"] = vgp.VirtualHub - } - if vgp.Connections != nil { - objectMap["connections"] = vgp.Connections - } - if vgp.BgpSettings != nil { - objectMap["bgpSettings"] = vgp.BgpSettings - } - if vgp.VpnGatewayScaleUnit != nil { - objectMap["vpnGatewayScaleUnit"] = vgp.VpnGatewayScaleUnit - } - if vgp.EnableBgpRouteTranslationForNat != nil { - objectMap["enableBgpRouteTranslationForNat"] = vgp.EnableBgpRouteTranslationForNat - } - if vgp.IsRoutingPreferenceInternet != nil { - objectMap["isRoutingPreferenceInternet"] = vgp.IsRoutingPreferenceInternet - } - if vgp.NatRules != nil { - objectMap["natRules"] = vgp.NatRules - } - return json.Marshal(objectMap) -} - -// VpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (VpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysCreateOrUpdateFuture.Result. -func (future *VpnGatewaysCreateOrUpdateFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { - vg, err = client.CreateOrUpdateResponder(vg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", vg.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnGatewaysDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysDeleteFuture.Result. -func (future *VpnGatewaysDeleteFuture) result(client VpnGatewaysClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnGatewaysResetFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnGatewaysResetFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (VpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysResetFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysResetFuture.Result. -func (future *VpnGatewaysResetFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysResetFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysResetFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { - vg, err = client.ResetResponder(vg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysResetFuture", "Result", vg.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnGatewaysStartPacketCaptureFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnGatewaysStartPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysStartPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysStartPacketCaptureFuture.Result. -func (future *VpnGatewaysStartPacketCaptureFuture) result(client VpnGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysStartPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysStartPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StartPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysStartPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnGatewaysStopPacketCaptureFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnGatewaysStopPacketCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysStopPacketCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysStopPacketCaptureFuture.Result. -func (future *VpnGatewaysStopPacketCaptureFuture) result(client VpnGatewaysClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysStopPacketCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysStopPacketCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.StopPacketCaptureResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysStopPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnGatewaysUpdateTagsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnGatewaysClient) (VpnGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnGatewaysUpdateTagsFuture.Result. -func (future *VpnGatewaysUpdateTagsFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vg.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysUpdateTagsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { - vg, err = client.UpdateTagsResponder(vg.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysUpdateTagsFuture", "Result", vg.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnLinkBgpSettings BGP settings details for a link. -type VpnLinkBgpSettings struct { - // Asn - The BGP speaker's ASN. - Asn *int64 `json:"asn,omitempty"` - // BgpPeeringAddress - The BGP peering address and BGP identifier of this BGP speaker. - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` -} - -// VpnLinkConnectionsGetIkeSasFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnLinkConnectionsGetIkeSasFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnLinkConnectionsClient) (String, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnLinkConnectionsGetIkeSasFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnLinkConnectionsGetIkeSasFuture.Result. -func (future *VpnLinkConnectionsGetIkeSasFuture) result(client VpnLinkConnectionsClient) (s String, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsGetIkeSasFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnLinkConnectionsGetIkeSasFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.GetIkeSasResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsGetIkeSasFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnLinkConnectionsResetConnectionFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnLinkConnectionsResetConnectionFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnLinkConnectionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnLinkConnectionsResetConnectionFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnLinkConnectionsResetConnectionFuture.Result. -func (future *VpnLinkConnectionsResetConnectionFuture) result(client VpnLinkConnectionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsResetConnectionFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnLinkConnectionsResetConnectionFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnLinkProviderProperties list of properties of a link provider. -type VpnLinkProviderProperties struct { - // LinkProviderName - Name of the link provider. - LinkProviderName *string `json:"linkProviderName,omitempty"` - // LinkSpeedInMbps - Link speed. - LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` -} - -// VpnNatRuleMapping vpn NatRule mapping. -type VpnNatRuleMapping struct { - // AddressSpace - Address space for Vpn NatRule mapping. - AddressSpace *string `json:"addressSpace,omitempty"` - // PortRange - Port range for Vpn NatRule mapping. - PortRange *string `json:"portRange,omitempty"` -} - -// VpnPacketCaptureStartParameters start packet capture parameters on virtual network gateway. -type VpnPacketCaptureStartParameters struct { - // FilterData - Start Packet capture parameters. - FilterData *string `json:"filterData,omitempty"` -} - -// VpnPacketCaptureStopParameters stop packet capture parameters. -type VpnPacketCaptureStopParameters struct { - // SasURL - SAS url for packet capture on virtual network gateway. - SasURL *string `json:"sasUrl,omitempty"` -} - -// VpnProfileResponse vpn Profile Response for package generation. -type VpnProfileResponse struct { - autorest.Response `json:"-"` - // ProfileURL - URL to the VPN profile. - ProfileURL *string `json:"profileUrl,omitempty"` -} - -// VpnServerConfigRadiusClientRootCertificate properties of the Radius client root certificate of -// VpnServerConfiguration. -type VpnServerConfigRadiusClientRootCertificate struct { - // Name - The certificate name. - Name *string `json:"name,omitempty"` - // Thumbprint - The Radius client root certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// VpnServerConfigRadiusServerRootCertificate properties of Radius Server root certificate of -// VpnServerConfiguration. -type VpnServerConfigRadiusServerRootCertificate struct { - // Name - The certificate name. - Name *string `json:"name,omitempty"` - // PublicCertData - The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` -} - -// VpnServerConfiguration vpnServerConfiguration Resource. -type VpnServerConfiguration struct { - autorest.Response `json:"-"` - // VpnServerConfigurationProperties - Properties of the P2SVpnServer configuration. - *VpnServerConfigurationProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VpnServerConfiguration. -func (vsc VpnServerConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vsc.VpnServerConfigurationProperties != nil { - objectMap["properties"] = vsc.VpnServerConfigurationProperties - } - if vsc.ID != nil { - objectMap["id"] = vsc.ID - } - if vsc.Location != nil { - objectMap["location"] = vsc.Location - } - if vsc.Tags != nil { - objectMap["tags"] = vsc.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnServerConfiguration struct. -func (vsc *VpnServerConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnServerConfigurationProperties VpnServerConfigurationProperties - err = json.Unmarshal(*v, &vpnServerConfigurationProperties) - if err != nil { - return err - } - vsc.VpnServerConfigurationProperties = &vpnServerConfigurationProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vsc.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vsc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vsc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vsc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vsc.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vsc.Tags = tags - } - } - } - - return nil -} - -// VpnServerConfigurationPolicyGroup vpnServerConfigurationPolicyGroup Resource. -type VpnServerConfigurationPolicyGroup struct { - autorest.Response `json:"-"` - // VpnServerConfigurationPolicyGroupProperties - Properties of the VpnServerConfigurationPolicyGroup. - *VpnServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnServerConfigurationPolicyGroup. -func (vscpg VpnServerConfigurationPolicyGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vscpg.VpnServerConfigurationPolicyGroupProperties != nil { - objectMap["properties"] = vscpg.VpnServerConfigurationPolicyGroupProperties - } - if vscpg.Name != nil { - objectMap["name"] = vscpg.Name - } - if vscpg.ID != nil { - objectMap["id"] = vscpg.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnServerConfigurationPolicyGroup struct. -func (vscpg *VpnServerConfigurationPolicyGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnServerConfigurationPolicyGroupProperties VpnServerConfigurationPolicyGroupProperties - err = json.Unmarshal(*v, &vpnServerConfigurationPolicyGroupProperties) - if err != nil { - return err - } - vscpg.VpnServerConfigurationPolicyGroupProperties = &vpnServerConfigurationPolicyGroupProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vscpg.Etag = &etag - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vscpg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vscpg.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vscpg.ID = &ID - } - } - } - - return nil -} - -// VpnServerConfigurationPolicyGroupMember vpnServerConfiguration PolicyGroup member -type VpnServerConfigurationPolicyGroupMember struct { - // Name - Name of the VpnServerConfigurationPolicyGroupMember. - Name *string `json:"name,omitempty"` - // AttributeType - The Vpn Policy member attribute type. Possible values include: 'CertificateGroupID', 'AADGroupID', 'RadiusAzureGroupID' - AttributeType VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - // AttributeValue - The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. - AttributeValue *string `json:"attributeValue,omitempty"` -} - -// VpnServerConfigurationPolicyGroupProperties parameters for VpnServerConfigurationPolicyGroup. -type VpnServerConfigurationPolicyGroupProperties struct { - // IsDefault - Shows if this is a Default VpnServerConfigurationPolicyGroup or not. - IsDefault *bool `json:"isDefault,omitempty"` - // Priority - Priority for VpnServerConfigurationPolicyGroup. - Priority *int32 `json:"priority,omitempty"` - // PolicyMembers - Multiple PolicyMembers for VpnServerConfigurationPolicyGroup. - PolicyMembers *[]VpnServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` - // P2SConnectionConfigurations - READ-ONLY; List of references to P2SConnectionConfigurations. - P2SConnectionConfigurations *[]SubResource `json:"p2SConnectionConfigurations,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VpnServerConfigurationPolicyGroup resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnServerConfigurationPolicyGroupProperties. -func (vscpgp VpnServerConfigurationPolicyGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vscpgp.IsDefault != nil { - objectMap["isDefault"] = vscpgp.IsDefault - } - if vscpgp.Priority != nil { - objectMap["priority"] = vscpgp.Priority - } - if vscpgp.PolicyMembers != nil { - objectMap["policyMembers"] = vscpgp.PolicyMembers - } - return json.Marshal(objectMap) -} - -// VpnServerConfigurationProperties parameters for VpnServerConfiguration. -type VpnServerConfigurationProperties struct { - // Name - The name of the VpnServerConfiguration that is unique within a resource group. - Name *string `json:"name,omitempty"` - // VpnProtocols - VPN protocols for the VpnServerConfiguration. - VpnProtocols *[]VpnGatewayTunnelingProtocol `json:"vpnProtocols,omitempty"` - // VpnAuthenticationTypes - VPN authentication types for the VpnServerConfiguration. - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - // VpnClientRootCertificates - VPN client root certificate of VpnServerConfiguration. - VpnClientRootCertificates *[]VpnServerConfigVpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - // VpnClientRevokedCertificates - VPN client revoked certificate of VpnServerConfiguration. - VpnClientRevokedCertificates *[]VpnServerConfigVpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - // RadiusServerRootCertificates - Radius Server root certificate of VpnServerConfiguration. - RadiusServerRootCertificates *[]VpnServerConfigRadiusServerRootCertificate `json:"radiusServerRootCertificates,omitempty"` - // RadiusClientRootCertificates - Radius client root certificate of VpnServerConfiguration. - RadiusClientRootCertificates *[]VpnServerConfigRadiusClientRootCertificate `json:"radiusClientRootCertificates,omitempty"` - // VpnClientIpsecPolicies - VpnClientIpsecPolicies for VpnServerConfiguration. - VpnClientIpsecPolicies *[]IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - // RadiusServerAddress - The radius server address property of the VpnServerConfiguration resource for point to site client connection. - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - // RadiusServerSecret - The radius secret property of the VpnServerConfiguration resource for point to site client connection. - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - // RadiusServers - Multiple Radius Server configuration for VpnServerConfiguration. - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - // AadAuthenticationParameters - The set of aad vpn authentication parameters. - AadAuthenticationParameters *AadAuthenticationParameters `json:"aadAuthenticationParameters,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VpnServerConfiguration resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - ProvisioningState *string `json:"provisioningState,omitempty"` - // P2SVpnGateways - READ-ONLY; List of references to P2SVpnGateways. - P2SVpnGateways *[]P2SVpnGateway `json:"p2SVpnGateways,omitempty"` - // ConfigurationPolicyGroups - List of all VpnServerConfigurationPolicyGroups. - ConfigurationPolicyGroups *[]VpnServerConfigurationPolicyGroup `json:"configurationPolicyGroups,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnServerConfigurationProperties. -func (vscp VpnServerConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vscp.Name != nil { - objectMap["name"] = vscp.Name - } - if vscp.VpnProtocols != nil { - objectMap["vpnProtocols"] = vscp.VpnProtocols - } - if vscp.VpnAuthenticationTypes != nil { - objectMap["vpnAuthenticationTypes"] = vscp.VpnAuthenticationTypes - } - if vscp.VpnClientRootCertificates != nil { - objectMap["vpnClientRootCertificates"] = vscp.VpnClientRootCertificates - } - if vscp.VpnClientRevokedCertificates != nil { - objectMap["vpnClientRevokedCertificates"] = vscp.VpnClientRevokedCertificates - } - if vscp.RadiusServerRootCertificates != nil { - objectMap["radiusServerRootCertificates"] = vscp.RadiusServerRootCertificates - } - if vscp.RadiusClientRootCertificates != nil { - objectMap["radiusClientRootCertificates"] = vscp.RadiusClientRootCertificates - } - if vscp.VpnClientIpsecPolicies != nil { - objectMap["vpnClientIpsecPolicies"] = vscp.VpnClientIpsecPolicies - } - if vscp.RadiusServerAddress != nil { - objectMap["radiusServerAddress"] = vscp.RadiusServerAddress - } - if vscp.RadiusServerSecret != nil { - objectMap["radiusServerSecret"] = vscp.RadiusServerSecret - } - if vscp.RadiusServers != nil { - objectMap["radiusServers"] = vscp.RadiusServers - } - if vscp.AadAuthenticationParameters != nil { - objectMap["aadAuthenticationParameters"] = vscp.AadAuthenticationParameters - } - if vscp.ConfigurationPolicyGroups != nil { - objectMap["configurationPolicyGroups"] = vscp.ConfigurationPolicyGroups - } - return json.Marshal(objectMap) -} - -// VpnServerConfigurationsAssociatedWithVirtualWanListFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VpnServerConfigurationsAssociatedWithVirtualWanListFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnServerConfigurationsAssociatedWithVirtualWanClient) (VpnServerConfigurationsResponse, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnServerConfigurationsAssociatedWithVirtualWanListFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnServerConfigurationsAssociatedWithVirtualWanListFuture.Result. -func (future *VpnServerConfigurationsAssociatedWithVirtualWanListFuture) result(client VpnServerConfigurationsAssociatedWithVirtualWanClient) (vscr VpnServerConfigurationsResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vscr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vscr.Response.Response, err = future.GetResult(sender); err == nil && vscr.Response.Response.StatusCode != http.StatusNoContent { - vscr, err = client.ListResponder(vscr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture", "Result", vscr.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnServerConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VpnServerConfigurationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnServerConfigurationsClient) (VpnServerConfiguration, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnServerConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnServerConfigurationsCreateOrUpdateFuture.Result. -func (future *VpnServerConfigurationsCreateOrUpdateFuture) result(client VpnServerConfigurationsClient) (vsc VpnServerConfiguration, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vsc.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vsc.Response.Response, err = future.GetResult(sender); err == nil && vsc.Response.Response.StatusCode != http.StatusNoContent { - vsc, err = client.CreateOrUpdateResponder(vsc.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsCreateOrUpdateFuture", "Result", vsc.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnServerConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnServerConfigurationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnServerConfigurationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnServerConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnServerConfigurationsDeleteFuture.Result. -func (future *VpnServerConfigurationsDeleteFuture) result(client VpnServerConfigurationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnServerConfigurationsResponse vpnServerConfigurations list associated with VirtualWan Response. -type VpnServerConfigurationsResponse struct { - autorest.Response `json:"-"` - // VpnServerConfigurationResourceIds - List of VpnServerConfigurations associated with VirtualWan. - VpnServerConfigurationResourceIds *[]string `json:"vpnServerConfigurationResourceIds,omitempty"` -} - -// VpnServerConfigVpnClientRevokedCertificate properties of the revoked VPN client certificate of -// VpnServerConfiguration. -type VpnServerConfigVpnClientRevokedCertificate struct { - // Name - The certificate name. - Name *string `json:"name,omitempty"` - // Thumbprint - The revoked VPN client certificate thumbprint. - Thumbprint *string `json:"thumbprint,omitempty"` -} - -// VpnServerConfigVpnClientRootCertificate properties of VPN client root certificate of -// VpnServerConfiguration. -type VpnServerConfigVpnClientRootCertificate struct { - // Name - The certificate name. - Name *string `json:"name,omitempty"` - // PublicCertData - The certificate public data. - PublicCertData *string `json:"publicCertData,omitempty"` -} - -// VpnSite vpnSite Resource. -type VpnSite struct { - autorest.Response `json:"-"` - // VpnSiteProperties - Properties of the VPN site. - *VpnSiteProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VpnSite. -func (vs VpnSite) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vs.VpnSiteProperties != nil { - objectMap["properties"] = vs.VpnSiteProperties - } - if vs.ID != nil { - objectMap["id"] = vs.ID - } - if vs.Location != nil { - objectMap["location"] = vs.Location - } - if vs.Tags != nil { - objectMap["tags"] = vs.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnSite struct. -func (vs *VpnSite) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnSiteProperties VpnSiteProperties - err = json.Unmarshal(*v, &vpnSiteProperties) - if err != nil { - return err - } - vs.VpnSiteProperties = &vpnSiteProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vs.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vs.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vs.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vs.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vs.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vs.Tags = tags - } - } - } - - return nil -} - -// VpnSiteID vpnSite Resource. -type VpnSiteID struct { - // VpnSite - READ-ONLY; The resource-uri of the vpn-site for which config is to be fetched. - VpnSite *string `json:"vpnSite,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteID. -func (vsi VpnSiteID) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VpnSiteLink vpnSiteLink Resource. -type VpnSiteLink struct { - autorest.Response `json:"-"` - // VpnSiteLinkProperties - Properties of the VPN site link. - *VpnSiteLinkProperties `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteLink. -func (vsl VpnSiteLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vsl.VpnSiteLinkProperties != nil { - objectMap["properties"] = vsl.VpnSiteLinkProperties - } - if vsl.Name != nil { - objectMap["name"] = vsl.Name - } - if vsl.ID != nil { - objectMap["id"] = vsl.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnSiteLink struct. -func (vsl *VpnSiteLink) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnSiteLinkProperties VpnSiteLinkProperties - err = json.Unmarshal(*v, &vpnSiteLinkProperties) - if err != nil { - return err - } - vsl.VpnSiteLinkProperties = &vpnSiteLinkProperties - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vsl.Etag = &etag - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vsl.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vsl.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vsl.ID = &ID - } - } - } - - return nil -} - -// VpnSiteLinkConnection vpnSiteLinkConnection Resource. -type VpnSiteLinkConnection struct { - autorest.Response `json:"-"` - // VpnSiteLinkConnectionProperties - Properties of the VPN site link connection. - *VpnSiteLinkConnectionProperties `json:"properties,omitempty"` - // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteLinkConnection. -func (vslc VpnSiteLinkConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vslc.VpnSiteLinkConnectionProperties != nil { - objectMap["properties"] = vslc.VpnSiteLinkConnectionProperties - } - if vslc.Name != nil { - objectMap["name"] = vslc.Name - } - if vslc.ID != nil { - objectMap["id"] = vslc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VpnSiteLinkConnection struct. -func (vslc *VpnSiteLinkConnection) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var vpnSiteLinkConnectionProperties VpnSiteLinkConnectionProperties - err = json.Unmarshal(*v, &vpnSiteLinkConnectionProperties) - if err != nil { - return err - } - vslc.VpnSiteLinkConnectionProperties = &vpnSiteLinkConnectionProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vslc.Name = &name - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - vslc.Etag = &etag - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vslc.Type = &typeVar - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vslc.ID = &ID - } - } - } - - return nil -} - -// VpnSiteLinkConnectionProperties parameters for VpnConnection. -type VpnSiteLinkConnectionProperties struct { - // VpnSiteLink - Id of the connected vpn site link. - VpnSiteLink *SubResource `json:"vpnSiteLink,omitempty"` - // RoutingWeight - Routing weight for vpn connection. - RoutingWeight *int32 `json:"routingWeight,omitempty"` - // VpnLinkConnectionMode - Vpn link connection mode. Possible values include: 'VpnLinkConnectionModeDefault', 'VpnLinkConnectionModeResponderOnly', 'VpnLinkConnectionModeInitiatorOnly' - VpnLinkConnectionMode VpnLinkConnectionMode `json:"vpnLinkConnectionMode,omitempty"` - // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' - ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` - // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' - VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - // EgressBytesTransferred - READ-ONLY; Egress bytes transferred. - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - // ConnectionBandwidth - Expected bandwidth in MBPS. - ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"` - // SharedKey - SharedKey for the vpn connection. - SharedKey *string `json:"sharedKey,omitempty"` - // EnableBgp - EnableBgp flag. - EnableBgp *bool `json:"enableBgp,omitempty"` - // VpnGatewayCustomBgpAddresses - vpnGatewayCustomBgpAddresses used by this connection. - VpnGatewayCustomBgpAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"vpnGatewayCustomBgpAddresses,omitempty"` - // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - // IpsecPolicies - The IPSec Policies to be considered by this connection. - IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` - // EnableRateLimiting - EnableBgp flag. - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - // UseLocalAzureIPAddress - Use local azure ip to initiate connection. - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site link connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // IngressNatRules - List of ingress NatRules. - IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` - // EgressNatRules - List of egress NatRules. - EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteLinkConnectionProperties. -func (vslcp VpnSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vslcp.VpnSiteLink != nil { - objectMap["vpnSiteLink"] = vslcp.VpnSiteLink - } - if vslcp.RoutingWeight != nil { - objectMap["routingWeight"] = vslcp.RoutingWeight - } - if vslcp.VpnLinkConnectionMode != "" { - objectMap["vpnLinkConnectionMode"] = vslcp.VpnLinkConnectionMode - } - if vslcp.ConnectionStatus != "" { - objectMap["connectionStatus"] = vslcp.ConnectionStatus - } - if vslcp.VpnConnectionProtocolType != "" { - objectMap["vpnConnectionProtocolType"] = vslcp.VpnConnectionProtocolType - } - if vslcp.ConnectionBandwidth != nil { - objectMap["connectionBandwidth"] = vslcp.ConnectionBandwidth - } - if vslcp.SharedKey != nil { - objectMap["sharedKey"] = vslcp.SharedKey - } - if vslcp.EnableBgp != nil { - objectMap["enableBgp"] = vslcp.EnableBgp - } - if vslcp.VpnGatewayCustomBgpAddresses != nil { - objectMap["vpnGatewayCustomBgpAddresses"] = vslcp.VpnGatewayCustomBgpAddresses - } - if vslcp.UsePolicyBasedTrafficSelectors != nil { - objectMap["usePolicyBasedTrafficSelectors"] = vslcp.UsePolicyBasedTrafficSelectors - } - if vslcp.IpsecPolicies != nil { - objectMap["ipsecPolicies"] = vslcp.IpsecPolicies - } - if vslcp.EnableRateLimiting != nil { - objectMap["enableRateLimiting"] = vslcp.EnableRateLimiting - } - if vslcp.UseLocalAzureIPAddress != nil { - objectMap["useLocalAzureIpAddress"] = vslcp.UseLocalAzureIPAddress - } - if vslcp.IngressNatRules != nil { - objectMap["ingressNatRules"] = vslcp.IngressNatRules - } - if vslcp.EgressNatRules != nil { - objectMap["egressNatRules"] = vslcp.EgressNatRules - } - return json.Marshal(objectMap) -} - -// VpnSiteLinkProperties parameters for VpnSite. -type VpnSiteLinkProperties struct { - // LinkProperties - The link provider properties. - LinkProperties *VpnLinkProviderProperties `json:"linkProperties,omitempty"` - // IPAddress - The ip-address for the vpn-site-link. - IPAddress *string `json:"ipAddress,omitempty"` - // Fqdn - FQDN of vpn-site-link. - Fqdn *string `json:"fqdn,omitempty"` - // BgpProperties - The set of bgp properties. - BgpProperties *VpnLinkBgpSettings `json:"bgpProperties,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site link resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteLinkProperties. -func (vslp VpnSiteLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vslp.LinkProperties != nil { - objectMap["linkProperties"] = vslp.LinkProperties - } - if vslp.IPAddress != nil { - objectMap["ipAddress"] = vslp.IPAddress - } - if vslp.Fqdn != nil { - objectMap["fqdn"] = vslp.Fqdn - } - if vslp.BgpProperties != nil { - objectMap["bgpProperties"] = vslp.BgpProperties - } - return json.Marshal(objectMap) -} - -// VpnSiteProperties parameters for VpnSite. -type VpnSiteProperties struct { - // VirtualWan - The VirtualWAN to which the vpnSite belongs. - VirtualWan *SubResource `json:"virtualWan,omitempty"` - // DeviceProperties - The device properties. - DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` - // IPAddress - The ip-address for the vpn-site. - IPAddress *string `json:"ipAddress,omitempty"` - // SiteKey - The key for vpn-site that can be used for connections. - SiteKey *string `json:"siteKey,omitempty"` - // AddressSpace - The AddressSpace that contains an array of IP address ranges. - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - // BgpProperties - The set of bgp properties. - BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the VPN site resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // IsSecuritySite - IsSecuritySite flag. - IsSecuritySite *bool `json:"isSecuritySite,omitempty"` - // VpnSiteLinks - List of all vpn site links. - VpnSiteLinks *[]VpnSiteLink `json:"vpnSiteLinks,omitempty"` - // O365Policy - Office365 Policy. - O365Policy *O365PolicyProperties `json:"o365Policy,omitempty"` -} - -// MarshalJSON is the custom marshaler for VpnSiteProperties. -func (vsp VpnSiteProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vsp.VirtualWan != nil { - objectMap["virtualWan"] = vsp.VirtualWan - } - if vsp.DeviceProperties != nil { - objectMap["deviceProperties"] = vsp.DeviceProperties - } - if vsp.IPAddress != nil { - objectMap["ipAddress"] = vsp.IPAddress - } - if vsp.SiteKey != nil { - objectMap["siteKey"] = vsp.SiteKey - } - if vsp.AddressSpace != nil { - objectMap["addressSpace"] = vsp.AddressSpace - } - if vsp.BgpProperties != nil { - objectMap["bgpProperties"] = vsp.BgpProperties - } - if vsp.IsSecuritySite != nil { - objectMap["isSecuritySite"] = vsp.IsSecuritySite - } - if vsp.VpnSiteLinks != nil { - objectMap["vpnSiteLinks"] = vsp.VpnSiteLinks - } - if vsp.O365Policy != nil { - objectMap["o365Policy"] = vsp.O365Policy - } - return json.Marshal(objectMap) -} - -// VpnSitesConfigurationDownloadFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VpnSitesConfigurationDownloadFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnSitesConfigurationClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnSitesConfigurationDownloadFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnSitesConfigurationDownloadFuture.Result. -func (future *VpnSitesConfigurationDownloadFuture) result(client VpnSitesConfigurationClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationDownloadFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnSitesConfigurationDownloadFuture") - return - } - ar.Response = future.Response() - return -} - -// VpnSitesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnSitesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnSitesClient) (VpnSite, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnSitesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnSitesCreateOrUpdateFuture.Result. -func (future *VpnSitesCreateOrUpdateFuture) result(client VpnSitesClient) (vs VpnSite, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vs.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnSitesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { - vs, err = client.CreateOrUpdateResponder(vs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", vs.Response.Response, "Failure responding to request") - } - } - return -} - -// VpnSitesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VpnSitesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VpnSitesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VpnSitesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VpnSitesDeleteFuture.Result. -func (future *VpnSitesDeleteFuture) result(client VpnSitesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.VpnSitesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// Watcher network watcher in a resource group. -type Watcher struct { - autorest.Response `json:"-"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // WatcherPropertiesFormat - Properties of the network watcher. - *WatcherPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Watcher. -func (w Watcher) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if w.WatcherPropertiesFormat != nil { - objectMap["properties"] = w.WatcherPropertiesFormat - } - if w.ID != nil { - objectMap["id"] = w.ID - } - if w.Location != nil { - objectMap["location"] = w.Location - } - if w.Tags != nil { - objectMap["tags"] = w.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Watcher struct. -func (w *Watcher) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - w.Etag = &etag - } - case "properties": - if v != nil { - var watcherPropertiesFormat WatcherPropertiesFormat - err = json.Unmarshal(*v, &watcherPropertiesFormat) - if err != nil { - return err - } - w.WatcherPropertiesFormat = &watcherPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - w.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - w.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - w.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - w.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - w.Tags = tags - } - } - } - - return nil -} - -// WatcherListResult response for ListNetworkWatchers API service call. -type WatcherListResult struct { - autorest.Response `json:"-"` - // Value - List of network watcher resources. - Value *[]Watcher `json:"value,omitempty"` -} - -// WatcherPropertiesFormat the network watcher properties. -type WatcherPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the network watcher resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for WatcherPropertiesFormat. -func (wpf WatcherPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// WatchersCheckConnectivityFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersCheckConnectivityFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (ConnectivityInformation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersCheckConnectivityFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersCheckConnectivityFuture.Result. -func (future *WatchersCheckConnectivityFuture) result(client WatchersClient) (ci ConnectivityInformation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ci.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersCheckConnectivityFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ci.Response.Response, err = future.GetResult(sender); err == nil && ci.Response.Response.StatusCode != http.StatusNoContent { - ci, err = client.CheckConnectivityResponder(ci.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", ci.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WatchersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersDeleteFuture.Result. -func (future *WatchersDeleteFuture) result(client WatchersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// WatchersGetAzureReachabilityReportFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetAzureReachabilityReportFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (AzureReachabilityReport, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetAzureReachabilityReportFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetAzureReachabilityReportFuture.Result. -func (future *WatchersGetAzureReachabilityReportFuture) result(client WatchersClient) (arr AzureReachabilityReport, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - arr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetAzureReachabilityReportFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if arr.Response.Response, err = future.GetResult(sender); err == nil && arr.Response.Response.StatusCode != http.StatusNoContent { - arr, err = client.GetAzureReachabilityReportResponder(arr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", arr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetFlowLogStatusFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (FlowLogInformation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetFlowLogStatusFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetFlowLogStatusFuture.Result. -func (future *WatchersGetFlowLogStatusFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fli.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent { - fli, err = client.GetFlowLogStatusResponder(fli.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", fli.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetNetworkConfigurationDiagnosticFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type WatchersGetNetworkConfigurationDiagnosticFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (ConfigurationDiagnosticResponse, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetNetworkConfigurationDiagnosticFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetNetworkConfigurationDiagnosticFuture.Result. -func (future *WatchersGetNetworkConfigurationDiagnosticFuture) result(client WatchersClient) (cdr ConfigurationDiagnosticResponse, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetNetworkConfigurationDiagnosticFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cdr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetNetworkConfigurationDiagnosticFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cdr.Response.Response, err = future.GetResult(sender); err == nil && cdr.Response.Response.StatusCode != http.StatusNoContent { - cdr, err = client.GetNetworkConfigurationDiagnosticResponder(cdr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetNetworkConfigurationDiagnosticFuture", "Result", cdr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetNextHopFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WatchersGetNextHopFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (NextHopResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetNextHopFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetNextHopFuture.Result. -func (future *WatchersGetNextHopFuture) result(client WatchersClient) (nhr NextHopResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - nhr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if nhr.Response.Response, err = future.GetResult(sender); err == nil && nhr.Response.Response.StatusCode != http.StatusNoContent { - nhr, err = client.GetNextHopResponder(nhr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", nhr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetTroubleshootingFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (TroubleshootingResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetTroubleshootingFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetTroubleshootingFuture.Result. -func (future *WatchersGetTroubleshootingFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - tr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { - tr, err = client.GetTroubleshootingResponder(tr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", tr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetTroubleshootingResultFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (TroubleshootingResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetTroubleshootingResultFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetTroubleshootingResultFuture.Result. -func (future *WatchersGetTroubleshootingResultFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - tr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { - tr, err = client.GetTroubleshootingResultResponder(tr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", tr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersGetVMSecurityRulesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (SecurityGroupViewResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersGetVMSecurityRulesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersGetVMSecurityRulesFuture.Result. -func (future *WatchersGetVMSecurityRulesFuture) result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - sgvr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sgvr.Response.Response, err = future.GetResult(sender); err == nil && sgvr.Response.Response.StatusCode != http.StatusNoContent { - sgvr, err = client.GetVMSecurityRulesResponder(sgvr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", sgvr.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersListAvailableProvidersFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersListAvailableProvidersFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (AvailableProvidersList, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersListAvailableProvidersFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersListAvailableProvidersFuture.Result. -func (future *WatchersListAvailableProvidersFuture) result(client WatchersClient) (apl AvailableProvidersList, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - apl.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersListAvailableProvidersFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if apl.Response.Response, err = future.GetResult(sender); err == nil && apl.Response.Response.StatusCode != http.StatusNoContent { - apl, err = client.ListAvailableProvidersResponder(apl.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", apl.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersSetFlowLogConfigurationFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WatchersSetFlowLogConfigurationFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (FlowLogInformation, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersSetFlowLogConfigurationFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersSetFlowLogConfigurationFuture.Result. -func (future *WatchersSetFlowLogConfigurationFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - fli.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent { - fli, err = client.SetFlowLogConfigurationResponder(fli.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", fli.Response.Response, "Failure responding to request") - } - } - return -} - -// WatchersVerifyIPFlowFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type WatchersVerifyIPFlowFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WatchersClient) (VerificationIPFlowResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WatchersVerifyIPFlowFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WatchersVerifyIPFlowFuture.Result. -func (future *WatchersVerifyIPFlowFuture) result(client WatchersClient) (vifr VerificationIPFlowResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vifr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vifr.Response.Response, err = future.GetResult(sender); err == nil && vifr.Response.Response.StatusCode != http.StatusNoContent { - vifr, err = client.VerifyIPFlowResponder(vifr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", vifr.Response.Response, "Failure responding to request") - } - } - return -} - -// WebApplicationFirewallCustomRule defines contents of a web application rule. -type WebApplicationFirewallCustomRule struct { - // Name - The name of the resource that is unique within a policy. This name can be used to access the resource. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Priority - Priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. - Priority *int32 `json:"priority,omitempty"` - // RuleType - The rule type. Possible values include: 'WebApplicationFirewallRuleTypeMatchRule', 'WebApplicationFirewallRuleTypeInvalid' - RuleType WebApplicationFirewallRuleType `json:"ruleType,omitempty"` - // MatchConditions - List of match conditions. - MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` - // Action - Type of Actions. Possible values include: 'WebApplicationFirewallActionAllow', 'WebApplicationFirewallActionBlock', 'WebApplicationFirewallActionLog' - Action WebApplicationFirewallAction `json:"action,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebApplicationFirewallCustomRule. -func (wafcr WebApplicationFirewallCustomRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wafcr.Name != nil { - objectMap["name"] = wafcr.Name - } - if wafcr.Priority != nil { - objectMap["priority"] = wafcr.Priority - } - if wafcr.RuleType != "" { - objectMap["ruleType"] = wafcr.RuleType - } - if wafcr.MatchConditions != nil { - objectMap["matchConditions"] = wafcr.MatchConditions - } - if wafcr.Action != "" { - objectMap["action"] = wafcr.Action - } - return json.Marshal(objectMap) -} - -// WebApplicationFirewallPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type WebApplicationFirewallPoliciesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(WebApplicationFirewallPoliciesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *WebApplicationFirewallPoliciesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for WebApplicationFirewallPoliciesDeleteFuture.Result. -func (future *WebApplicationFirewallPoliciesDeleteFuture) result(client WebApplicationFirewallPoliciesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.WebApplicationFirewallPoliciesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// WebApplicationFirewallPolicy defines web application firewall policy. -type WebApplicationFirewallPolicy struct { - autorest.Response `json:"-"` - // WebApplicationFirewallPolicyPropertiesFormat - Properties of the web application firewall policy. - *WebApplicationFirewallPolicyPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicy. -func (wafp WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wafp.WebApplicationFirewallPolicyPropertiesFormat != nil { - objectMap["properties"] = wafp.WebApplicationFirewallPolicyPropertiesFormat - } - if wafp.ID != nil { - objectMap["id"] = wafp.ID - } - if wafp.Location != nil { - objectMap["location"] = wafp.Location - } - if wafp.Tags != nil { - objectMap["tags"] = wafp.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for WebApplicationFirewallPolicy struct. -func (wafp *WebApplicationFirewallPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var webApplicationFirewallPolicyPropertiesFormat WebApplicationFirewallPolicyPropertiesFormat - err = json.Unmarshal(*v, &webApplicationFirewallPolicyPropertiesFormat) - if err != nil { - return err - } - wafp.WebApplicationFirewallPolicyPropertiesFormat = &webApplicationFirewallPolicyPropertiesFormat - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - wafp.Etag = &etag - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - wafp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - wafp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - wafp.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - wafp.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - wafp.Tags = tags - } - } - } - - return nil -} - -// WebApplicationFirewallPolicyListResult result of the request to list WebApplicationFirewallPolicies. It -// contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. -type WebApplicationFirewallPolicyListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List of WebApplicationFirewallPolicies within a resource group. - Value *[]WebApplicationFirewallPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of WebApplicationFirewallPolicy objects if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyListResult. -func (wafplr WebApplicationFirewallPolicyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// WebApplicationFirewallPolicyListResultIterator provides access to a complete listing of -// WebApplicationFirewallPolicy values. -type WebApplicationFirewallPolicyListResultIterator struct { - i int - page WebApplicationFirewallPolicyListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *WebApplicationFirewallPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *WebApplicationFirewallPolicyListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter WebApplicationFirewallPolicyListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter WebApplicationFirewallPolicyListResultIterator) Response() WebApplicationFirewallPolicyListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter WebApplicationFirewallPolicyListResultIterator) Value() WebApplicationFirewallPolicy { - if !iter.page.NotDone() { - return WebApplicationFirewallPolicy{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the WebApplicationFirewallPolicyListResultIterator type. -func NewWebApplicationFirewallPolicyListResultIterator(page WebApplicationFirewallPolicyListResultPage) WebApplicationFirewallPolicyListResultIterator { - return WebApplicationFirewallPolicyListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (wafplr WebApplicationFirewallPolicyListResult) IsEmpty() bool { - return wafplr.Value == nil || len(*wafplr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (wafplr WebApplicationFirewallPolicyListResult) hasNextLink() bool { - return wafplr.NextLink != nil && len(*wafplr.NextLink) != 0 -} - -// webApplicationFirewallPolicyListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (wafplr WebApplicationFirewallPolicyListResult) webApplicationFirewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { - if !wafplr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(wafplr.NextLink))) -} - -// WebApplicationFirewallPolicyListResultPage contains a page of WebApplicationFirewallPolicy values. -type WebApplicationFirewallPolicyListResultPage struct { - fn func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error) - wafplr WebApplicationFirewallPolicyListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *WebApplicationFirewallPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.wafplr) - if err != nil { - return err - } - page.wafplr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *WebApplicationFirewallPolicyListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page WebApplicationFirewallPolicyListResultPage) NotDone() bool { - return !page.wafplr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page WebApplicationFirewallPolicyListResultPage) Response() WebApplicationFirewallPolicyListResult { - return page.wafplr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page WebApplicationFirewallPolicyListResultPage) Values() []WebApplicationFirewallPolicy { - if page.wafplr.IsEmpty() { - return nil - } - return *page.wafplr.Value -} - -// Creates a new instance of the WebApplicationFirewallPolicyListResultPage type. -func NewWebApplicationFirewallPolicyListResultPage(cur WebApplicationFirewallPolicyListResult, getNextPage func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error)) WebApplicationFirewallPolicyListResultPage { - return WebApplicationFirewallPolicyListResultPage{ - fn: getNextPage, - wafplr: cur, - } -} - -// WebApplicationFirewallPolicyPropertiesFormat defines web application firewall policy properties. -type WebApplicationFirewallPolicyPropertiesFormat struct { - // PolicySettings - The PolicySettings for policy. - PolicySettings *PolicySettings `json:"policySettings,omitempty"` - // CustomRules - The custom rules inside the policy. - CustomRules *[]WebApplicationFirewallCustomRule `json:"customRules,omitempty"` - // ApplicationGateways - READ-ONLY; A collection of references to application gateways. - ApplicationGateways *[]ApplicationGateway `json:"applicationGateways,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // ResourceState - READ-ONLY; Resource status of the policy. Possible values include: 'WebApplicationFirewallPolicyResourceStateCreating', 'WebApplicationFirewallPolicyResourceStateEnabling', 'WebApplicationFirewallPolicyResourceStateEnabled', 'WebApplicationFirewallPolicyResourceStateDisabling', 'WebApplicationFirewallPolicyResourceStateDisabled', 'WebApplicationFirewallPolicyResourceStateDeleting' - ResourceState WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"` - // ManagedRules - Describes the managedRules structure. - ManagedRules *ManagedRulesDefinition `json:"managedRules,omitempty"` - // HTTPListeners - READ-ONLY; A collection of references to application gateway http listeners. - HTTPListeners *[]SubResource `json:"httpListeners,omitempty"` - // PathBasedRules - READ-ONLY; A collection of references to application gateway path rules. - PathBasedRules *[]SubResource `json:"pathBasedRules,omitempty"` -} - -// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyPropertiesFormat. -func (wafppf WebApplicationFirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if wafppf.PolicySettings != nil { - objectMap["policySettings"] = wafppf.PolicySettings - } - if wafppf.CustomRules != nil { - objectMap["customRules"] = wafppf.CustomRules - } - if wafppf.ManagedRules != nil { - objectMap["managedRules"] = wafppf.ManagedRules - } - return json.Marshal(objectMap) -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natgateways.go deleted file mode 100644 index b64e8d6210ce..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natgateways.go +++ /dev/null @@ -1,580 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// NatGatewaysClient is the network Client -type NatGatewaysClient struct { - BaseClient -} - -// NewNatGatewaysClient creates an instance of the NatGatewaysClient client. -func NewNatGatewaysClient(subscriptionID string) NatGatewaysClient { - return NewNatGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewNatGatewaysClientWithBaseURI creates an instance of the NatGatewaysClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewNatGatewaysClientWithBaseURI(baseURI string, subscriptionID string) NatGatewaysClient { - return NatGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a nat gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// natGatewayName - the name of the nat gateway. -// parameters - parameters supplied to the create or update nat gateway operation. -func (client NatGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway) (result NatGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, natGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client NatGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, natGatewayName string, parameters NatGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natGatewayName": autorest.Encode("path", natGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) CreateOrUpdateSender(req *http.Request) (future NatGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result NatGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified nat gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// natGatewayName - the name of the nat gateway. -func (client NatGatewaysClient) Delete(ctx context.Context, resourceGroupName string, natGatewayName string) (result NatGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, natGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client NatGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, natGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natGatewayName": autorest.Encode("path", natGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) DeleteSender(req *http.Request) (future NatGatewaysDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified nat gateway in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// natGatewayName - the name of the nat gateway. -// expand - expands referenced resources. -func (client NatGatewaysClient) Get(ctx context.Context, resourceGroupName string, natGatewayName string, expand string) (result NatGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, natGatewayName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client NatGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, natGatewayName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natGatewayName": autorest.Encode("path", natGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) GetResponder(resp *http.Response) (result NatGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all nat gateways in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client NatGatewaysClient) List(ctx context.Context, resourceGroupName string) (result NatGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.List") - defer func() { - sc := -1 - if result.nglr.Response.Response != nil { - sc = result.nglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.nglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.nglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.nglr.hasNextLink() && result.nglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client NatGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) ListResponder(resp *http.Response) (result NatGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client NatGatewaysClient) listNextResults(ctx context.Context, lastResults NatGatewayListResult) (result NatGatewayListResult, err error) { - req, err := lastResults.natGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client NatGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result NatGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the Nat Gateways in a subscription. -func (client NatGatewaysClient) ListAll(ctx context.Context) (result NatGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.ListAll") - defer func() { - sc := -1 - if result.nglr.Response.Response != nil { - sc = result.nglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.nglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "ListAll", resp, "Failure sending request") - return - } - - result.nglr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "ListAll", resp, "Failure responding to request") - return - } - if result.nglr.hasNextLink() && result.nglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client NatGatewaysClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) ListAllResponder(resp *http.Response) (result NatGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client NatGatewaysClient) listAllNextResults(ctx context.Context, lastResults NatGatewayListResult) (result NatGatewayListResult, err error) { - req, err := lastResults.natGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client NatGatewaysClient) ListAllComplete(ctx context.Context) (result NatGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates nat gateway tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// natGatewayName - the name of the nat gateway. -// parameters - parameters supplied to update nat gateway tags. -func (client NatGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject) (result NatGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, natGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatGatewaysClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client NatGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, natGatewayName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natGatewayName": autorest.Encode("path", natGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client NatGatewaysClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client NatGatewaysClient) UpdateTagsResponder(resp *http.Response) (result NatGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natrules.go deleted file mode 100644 index 4def3d0c5e99..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natrules.go +++ /dev/null @@ -1,393 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// NatRulesClient is the network Client -type NatRulesClient struct { - BaseClient -} - -// NewNatRulesClient creates an instance of the NatRulesClient client. -func NewNatRulesClient(subscriptionID string) NatRulesClient { - return NewNatRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewNatRulesClientWithBaseURI creates an instance of the NatRulesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewNatRulesClientWithBaseURI(baseURI string, subscriptionID string) NatRulesClient { - return NatRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a nat rule to a scalable vpn gateway if it doesn't exist else updates the existing nat rules. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// natRuleName - the name of the nat rule. -// natRuleParameters - parameters supplied to create or Update a Nat Rule. -func (client NatRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VpnGatewayNatRule) (result NatRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, natRuleName, natRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client NatRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string, natRuleParameters VpnGatewayNatRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "natRuleName": autorest.Encode("path", natRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - natRuleParameters.Etag = nil - natRuleParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", pathParameters), - autorest.WithJSON(natRuleParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client NatRulesClient) CreateOrUpdateSender(req *http.Request) (future NatRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client NatRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnGatewayNatRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a nat rule. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// natRuleName - the name of the nat rule. -func (client NatRulesClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string) (result NatRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName, natRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client NatRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "natRuleName": autorest.Encode("path", natRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client NatRulesClient) DeleteSender(req *http.Request) (future NatRulesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client NatRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a nat ruleGet. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// natRuleName - the name of the nat rule. -func (client NatRulesClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string) (result VpnGatewayNatRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName, natRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client NatRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string, natRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "natRuleName": autorest.Encode("path", natRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules/{natRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client NatRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client NatRulesClient) GetResponder(resp *http.Response) (result VpnGatewayNatRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByVpnGateway retrieves all nat rules for a particular virtual wan vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -func (client NatRulesClient) ListByVpnGateway(ctx context.Context, resourceGroupName string, gatewayName string) (result ListVpnGatewayNatRulesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.ListByVpnGateway") - defer func() { - sc := -1 - if result.lvgnrr.Response.Response != nil { - sc = result.lvgnrr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVpnGatewayNextResults - req, err := client.ListByVpnGatewayPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "ListByVpnGateway", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVpnGatewaySender(req) - if err != nil { - result.lvgnrr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "ListByVpnGateway", resp, "Failure sending request") - return - } - - result.lvgnrr, err = client.ListByVpnGatewayResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "ListByVpnGateway", resp, "Failure responding to request") - return - } - if result.lvgnrr.hasNextLink() && result.lvgnrr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVpnGatewayPreparer prepares the ListByVpnGateway request. -func (client NatRulesClient) ListByVpnGatewayPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/natRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVpnGatewaySender sends the ListByVpnGateway request. The method will close the -// http.Response Body if it receives an error. -func (client NatRulesClient) ListByVpnGatewaySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVpnGatewayResponder handles the response to the ListByVpnGateway request. The method always -// closes the http.Response Body. -func (client NatRulesClient) ListByVpnGatewayResponder(resp *http.Response) (result ListVpnGatewayNatRulesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVpnGatewayNextResults retrieves the next set of results, if any. -func (client NatRulesClient) listByVpnGatewayNextResults(ctx context.Context, lastResults ListVpnGatewayNatRulesResult) (result ListVpnGatewayNatRulesResult, err error) { - req, err := lastResults.listVpnGatewayNatRulesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.NatRulesClient", "listByVpnGatewayNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVpnGatewaySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.NatRulesClient", "listByVpnGatewayNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVpnGatewayResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.NatRulesClient", "listByVpnGatewayNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVpnGatewayComplete enumerates all values, automatically crossing page boundaries as required. -func (client NatRulesClient) ListByVpnGatewayComplete(ctx context.Context, resourceGroupName string, gatewayName string) (result ListVpnGatewayNatRulesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/NatRulesClient.ListByVpnGateway") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVpnGateway(ctx, resourceGroupName, gatewayName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/operations.go deleted file mode 100644 index 3c3c885537af..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/operations.go +++ /dev/null @@ -1,140 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the network Client -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List lists all of the available Network Rest API operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.olr.Response.Response != nil { - sc = result.olr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.olr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.OperationsClient", "List", resp, "Failure sending request") - return - } - - result.olr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.OperationsClient", "List", resp, "Failure responding to request") - return - } - if result.olr.hasNextLink() && result.olr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Network/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { - req, err := lastResults.operationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.OperationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.OperationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.OperationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/p2svpngateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/p2svpngateways.go deleted file mode 100644 index 446ce1cafd36..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/p2svpngateways.go +++ /dev/null @@ -1,985 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// P2sVpnGatewaysClient is the network Client -type P2sVpnGatewaysClient struct { - BaseClient -} - -// NewP2sVpnGatewaysClient creates an instance of the P2sVpnGatewaysClient client. -func NewP2sVpnGatewaysClient(subscriptionID string) P2sVpnGatewaysClient { - return NewP2sVpnGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewP2sVpnGatewaysClientWithBaseURI creates an instance of the P2sVpnGatewaysClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewP2sVpnGatewaysClientWithBaseURI(baseURI string, subscriptionID string) P2sVpnGatewaysClient { - return P2sVpnGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a virtual wan p2s vpn gateway if it doesn't exist else updates the existing gateway. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -// p2SVpnGatewayParameters - parameters supplied to create or Update a virtual wan p2s vpn gateway. -func (client P2sVpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, p2SVpnGatewayParameters P2SVpnGateway) (result P2sVpnGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, p2SVpnGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client P2sVpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, p2SVpnGatewayParameters P2SVpnGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - p2SVpnGatewayParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", pathParameters), - autorest.WithJSON(p2SVpnGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (future P2sVpnGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a virtual wan p2s vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -func (client P2sVpnGatewaysClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string) (result P2sVpnGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client P2sVpnGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) DeleteSender(req *http.Request) (future P2sVpnGatewaysDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisconnectP2sVpnConnections disconnect P2S vpn connections of the virtual wan P2SVpnGateway in the specified -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// p2sVpnGatewayName - the name of the P2S Vpn Gateway. -// request - the parameters are supplied to disconnect p2s vpn connections. -func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnections(ctx context.Context, resourceGroupName string, p2sVpnGatewayName string, request P2SVpnConnectionRequest) (result P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.DisconnectP2sVpnConnections") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DisconnectP2sVpnConnectionsPreparer(ctx, resourceGroupName, p2sVpnGatewayName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "DisconnectP2sVpnConnections", nil, "Failure preparing request") - return - } - - result, err = client.DisconnectP2sVpnConnectionsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "DisconnectP2sVpnConnections", result.Response(), "Failure sending request") - return - } - - return -} - -// DisconnectP2sVpnConnectionsPreparer prepares the DisconnectP2sVpnConnections request. -func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsPreparer(ctx context.Context, resourceGroupName string, p2sVpnGatewayName string, request P2SVpnConnectionRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "p2sVpnGatewayName": autorest.Encode("path", p2sVpnGatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{p2sVpnGatewayName}/disconnectP2sVpnConnections", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisconnectP2sVpnConnectionsSender sends the DisconnectP2sVpnConnections request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsSender(req *http.Request) (future P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DisconnectP2sVpnConnectionsResponder handles the response to the DisconnectP2sVpnConnections request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GenerateVpnProfile generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the P2SVpnGateway. -// parameters - parameters supplied to the generate P2SVpnGateway VPN client package operation. -func (client P2sVpnGatewaysClient) GenerateVpnProfile(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVpnProfileParameters) (result P2sVpnGatewaysGenerateVpnProfileFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.GenerateVpnProfile") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GenerateVpnProfilePreparer(ctx, resourceGroupName, gatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GenerateVpnProfile", nil, "Failure preparing request") - return - } - - result, err = client.GenerateVpnProfileSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GenerateVpnProfile", result.Response(), "Failure sending request") - return - } - - return -} - -// GenerateVpnProfilePreparer prepares the GenerateVpnProfile request. -func (client P2sVpnGatewaysClient) GenerateVpnProfilePreparer(ctx context.Context, resourceGroupName string, gatewayName string, parameters P2SVpnProfileParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/generatevpnprofile", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateVpnProfileSender sends the GenerateVpnProfile request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) GenerateVpnProfileSender(req *http.Request) (future P2sVpnGatewaysGenerateVpnProfileFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GenerateVpnProfileResponder handles the response to the GenerateVpnProfile request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result VpnProfileResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get retrieves the details of a virtual wan p2s vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -func (client P2sVpnGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string) (result P2SVpnGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client P2sVpnGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) GetResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetP2sVpnConnectionHealth gets the connection health of P2S clients of the virtual wan P2SVpnGateway in the -// specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the P2SVpnGateway. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealth(ctx context.Context, resourceGroupName string, gatewayName string) (result P2sVpnGatewaysGetP2sVpnConnectionHealthFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.GetP2sVpnConnectionHealth") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetP2sVpnConnectionHealthPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealth", nil, "Failure preparing request") - return - } - - result, err = client.GetP2sVpnConnectionHealthSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealth", result.Response(), "Failure sending request") - return - } - - return -} - -// GetP2sVpnConnectionHealthPreparer prepares the GetP2sVpnConnectionHealth request. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealth", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetP2sVpnConnectionHealthSender sends the GetP2sVpnConnectionHealth request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthSender(req *http.Request) (future P2sVpnGatewaysGetP2sVpnConnectionHealthFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetP2sVpnConnectionHealthResponder handles the response to the GetP2sVpnConnectionHealth request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetP2sVpnConnectionHealthDetailed gets the sas url to get the connection health detail of P2S clients of the virtual -// wan P2SVpnGateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the P2SVpnGateway. -// request - request parameters supplied to get p2s vpn connections detailed health. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailed(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVpnConnectionHealthRequest) (result P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.GetP2sVpnConnectionHealthDetailed") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetP2sVpnConnectionHealthDetailedPreparer(ctx, resourceGroupName, gatewayName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealthDetailed", nil, "Failure preparing request") - return - } - - result, err = client.GetP2sVpnConnectionHealthDetailedSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "GetP2sVpnConnectionHealthDetailed", result.Response(), "Failure sending request") - return - } - - return -} - -// GetP2sVpnConnectionHealthDetailedPreparer prepares the GetP2sVpnConnectionHealthDetailed request. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedPreparer(ctx context.Context, resourceGroupName string, gatewayName string, request P2SVpnConnectionHealthRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/getP2sVpnConnectionHealthDetailed", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetP2sVpnConnectionHealthDetailedSender sends the GetP2sVpnConnectionHealthDetailed request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedSender(req *http.Request) (future P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetP2sVpnConnectionHealthDetailedResponder handles the response to the GetP2sVpnConnectionHealthDetailed request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedResponder(resp *http.Response) (result P2SVpnConnectionHealth, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the P2SVpnGateways in a subscription. -func (client P2sVpnGatewaysClient) List(ctx context.Context) (result ListP2SVpnGatewaysResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.List") - defer func() { - sc := -1 - if result.lpvgr.Response.Response != nil { - sc = result.lpvgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lpvgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.lpvgr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.lpvgr.hasNextLink() && result.lpvgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client P2sVpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/p2svpnGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) ListResponder(resp *http.Response) (result ListP2SVpnGatewaysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client P2sVpnGatewaysClient) listNextResults(ctx context.Context, lastResults ListP2SVpnGatewaysResult) (result ListP2SVpnGatewaysResult, err error) { - req, err := lastResults.listP2SVpnGatewaysResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client P2sVpnGatewaysClient) ListComplete(ctx context.Context) (result ListP2SVpnGatewaysResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the P2SVpnGateways in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -func (client P2sVpnGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListP2SVpnGatewaysResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lpvgr.Response.Response != nil { - sc = result.lpvgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lpvgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lpvgr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lpvgr.hasNextLink() && result.lpvgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client P2sVpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListP2SVpnGatewaysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client P2sVpnGatewaysClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListP2SVpnGatewaysResult) (result ListP2SVpnGatewaysResult, err error) { - req, err := lastResults.listP2SVpnGatewaysResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client P2sVpnGatewaysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListP2SVpnGatewaysResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Reset resets the primary of the p2s vpn gateway in the specified resource group. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -func (client P2sVpnGatewaysClient) Reset(ctx context.Context, resourceGroupName string, gatewayName string) (result P2SVpnGatewaysResetFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.Reset") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Reset", nil, "Failure preparing request") - return - } - - result, err = client.ResetSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "Reset", result.Response(), "Failure sending request") - return - } - - return -} - -// ResetPreparer prepares the Reset request. -func (client P2sVpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}/reset", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetSender sends the Reset request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) ResetSender(req *http.Request) (future P2SVpnGatewaysResetFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetResponder handles the response to the Reset request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) ResetResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates virtual wan p2s vpn gateway tags. -// Parameters: -// resourceGroupName - the resource group name of the P2SVpnGateway. -// gatewayName - the name of the gateway. -// p2SVpnGatewayParameters - parameters supplied to update a virtual wan p2s vpn gateway tags. -func (client P2sVpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, p2SVpnGatewayParameters TagsObject) (result P2sVpnGatewaysUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/P2sVpnGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, gatewayName, p2SVpnGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client P2sVpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, gatewayName string, p2SVpnGatewayParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/p2svpnGateways/{gatewayName}", pathParameters), - autorest.WithJSON(p2SVpnGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client P2sVpnGatewaysClient) UpdateTagsSender(req *http.Request) (future P2sVpnGatewaysUpdateTagsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client P2sVpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result P2SVpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/packetcaptures.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/packetcaptures.go deleted file mode 100644 index d6998421def3..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/packetcaptures.go +++ /dev/null @@ -1,532 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PacketCapturesClient is the network Client -type PacketCapturesClient struct { - BaseClient -} - -// NewPacketCapturesClient creates an instance of the PacketCapturesClient client. -func NewPacketCapturesClient(subscriptionID string) PacketCapturesClient { - return NewPacketCapturesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPacketCapturesClientWithBaseURI creates an instance of the PacketCapturesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPacketCapturesClientWithBaseURI(baseURI string, subscriptionID string) PacketCapturesClient { - return PacketCapturesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create create and start a packet capture on the specified VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// packetCaptureName - the name of the packet capture session. -// parameters - parameters that define the create packet capture operation. -func (client PacketCapturesClient) Create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture) (result PacketCapturesCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.PacketCaptureParameters", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.PacketCaptureParameters.Target", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.PacketCaptureParameters.BytesToCapturePerPacket", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PacketCaptureParameters.BytesToCapturePerPacket", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.PacketCaptureParameters.BytesToCapturePerPacket", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - {Target: "parameters.PacketCaptureParameters.TotalBytesPerSession", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PacketCaptureParameters.TotalBytesPerSession", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.PacketCaptureParameters.TotalBytesPerSession", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - {Target: "parameters.PacketCaptureParameters.TimeLimitInSeconds", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PacketCaptureParameters.TimeLimitInSeconds", Name: validation.InclusiveMaximum, Rule: int64(18000), Chain: nil}, - {Target: "parameters.PacketCaptureParameters.TimeLimitInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - {Target: "parameters.PacketCaptureParameters.StorageLocation", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.PacketCapturesClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) CreateSender(req *http.Request) (future PacketCapturesCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) CreateResponder(resp *http.Response) (result PacketCaptureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified packet capture session. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// packetCaptureName - the name of the packet capture session. -func (client PacketCapturesClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PacketCapturesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) DeleteSender(req *http.Request) (future PacketCapturesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a packet capture session by name. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// packetCaptureName - the name of the packet capture session. -func (client PacketCapturesClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCaptureResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PacketCapturesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) GetResponder(resp *http.Response) (result PacketCaptureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetStatus query the status of a running packet capture session. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the Network Watcher resource. -// packetCaptureName - the name given to the packet capture session. -func (client PacketCapturesClient) GetStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesGetStatusFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.GetStatus") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetStatusPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "GetStatus", nil, "Failure preparing request") - return - } - - result, err = client.GetStatusSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "GetStatus", result.Response(), "Failure sending request") - return - } - - return -} - -// GetStatusPreparer prepares the GetStatus request. -func (client PacketCapturesClient) GetStatusPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetStatusSender sends the GetStatus request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) GetStatusSender(req *http.Request) (future PacketCapturesGetStatusFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetStatusResponder handles the response to the GetStatus request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) GetStatusResponder(resp *http.Response) (result PacketCaptureQueryStatusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all packet capture sessions within the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the Network Watcher resource. -func (client PacketCapturesClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result PacketCaptureListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PacketCapturesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) ListResponder(resp *http.Response) (result PacketCaptureListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Stop stops a specified packet capture session. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// packetCaptureName - the name of the packet capture session. -func (client PacketCapturesClient) Stop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesStopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PacketCapturesClient.Stop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Stop", nil, "Failure preparing request") - return - } - - result, err = client.StopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PacketCapturesClient", "Stop", result.Response(), "Failure sending request") - return - } - - return -} - -// StopPreparer prepares the Stop request. -func (client PacketCapturesClient) StopPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "packetCaptureName": autorest.Encode("path", packetCaptureName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopSender sends the Stop request. The method will close the -// http.Response Body if it receives an error. -func (client PacketCapturesClient) StopSender(req *http.Request) (future PacketCapturesStopFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopResponder handles the response to the Stop request. The method always -// closes the http.Response Body. -func (client PacketCapturesClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/peerexpressroutecircuitconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/peerexpressroutecircuitconnections.go deleted file mode 100644 index dca72d3ce71b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/peerexpressroutecircuitconnections.go +++ /dev/null @@ -1,233 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PeerExpressRouteCircuitConnectionsClient is the network Client -type PeerExpressRouteCircuitConnectionsClient struct { - BaseClient -} - -// NewPeerExpressRouteCircuitConnectionsClient creates an instance of the PeerExpressRouteCircuitConnectionsClient -// client. -func NewPeerExpressRouteCircuitConnectionsClient(subscriptionID string) PeerExpressRouteCircuitConnectionsClient { - return NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPeerExpressRouteCircuitConnectionsClientWithBaseURI creates an instance of the -// PeerExpressRouteCircuitConnectionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PeerExpressRouteCircuitConnectionsClient { - return PeerExpressRouteCircuitConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified Peer Express Route Circuit Connection from the specified express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the express route circuit. -// peeringName - the name of the peering. -// connectionName - the name of the peer express route circuit connection. -func (client PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (result PeerExpressRouteCircuitConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, peeringName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PeerExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "connectionName": autorest.Encode("path", connectionName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PeerExpressRouteCircuitConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PeerExpressRouteCircuitConnectionsClient) GetResponder(resp *http.Response) (result PeerExpressRouteCircuitConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all global reach peer connections associated with a private peering in an express route circuit. -// Parameters: -// resourceGroupName - the name of the resource group. -// circuitName - the name of the circuit. -// peeringName - the name of the peering. -func (client PeerExpressRouteCircuitConnectionsClient) List(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result PeerExpressRouteCircuitConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionsClient.List") - defer func() { - sc := -1 - if result.percclr.Response.Response != nil { - sc = result.percclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, circuitName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.percclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.percclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.percclr.hasNextLink() && result.percclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PeerExpressRouteCircuitConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "circuitName": autorest.Encode("path", circuitName), - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/peerConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PeerExpressRouteCircuitConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PeerExpressRouteCircuitConnectionsClient) ListResponder(resp *http.Response) (result PeerExpressRouteCircuitConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PeerExpressRouteCircuitConnectionsClient) listNextResults(ctx context.Context, lastResults PeerExpressRouteCircuitConnectionListResult) (result PeerExpressRouteCircuitConnectionListResult, err error) { - req, err := lastResults.peerExpressRouteCircuitConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PeerExpressRouteCircuitConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PeerExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result PeerExpressRouteCircuitConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, circuitName, peeringName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatednszonegroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatednszonegroups.go deleted file mode 100644 index 362708731bc8..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatednszonegroups.go +++ /dev/null @@ -1,393 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateDNSZoneGroupsClient is the network Client -type PrivateDNSZoneGroupsClient struct { - BaseClient -} - -// NewPrivateDNSZoneGroupsClient creates an instance of the PrivateDNSZoneGroupsClient client. -func NewPrivateDNSZoneGroupsClient(subscriptionID string) PrivateDNSZoneGroupsClient { - return NewPrivateDNSZoneGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateDNSZoneGroupsClientWithBaseURI creates an instance of the PrivateDNSZoneGroupsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateDNSZoneGroupsClientWithBaseURI(baseURI string, subscriptionID string) PrivateDNSZoneGroupsClient { - return PrivateDNSZoneGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a private dns zone group in the specified private endpoint. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// privateDNSZoneGroupName - the name of the private dns zone group. -// parameters - parameters supplied to the create or update private dns zone group operation. -func (client PrivateDNSZoneGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup) (result PrivateDNSZoneGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateDNSZoneGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string, parameters PrivateDNSZoneGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateDnsZoneGroupName": autorest.Encode("path", privateDNSZoneGroupName), - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateDNSZoneGroupsClient) CreateOrUpdateSender(req *http.Request) (future PrivateDNSZoneGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateDNSZoneGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateDNSZoneGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified private dns zone group. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// privateDNSZoneGroupName - the name of the private dns zone group. -func (client PrivateDNSZoneGroupsClient) Delete(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (result PrivateDNSZoneGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateDNSZoneGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateDnsZoneGroupName": autorest.Encode("path", privateDNSZoneGroupName), - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateDNSZoneGroupsClient) DeleteSender(req *http.Request) (future PrivateDNSZoneGroupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateDNSZoneGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the private dns zone group resource by specified private dns zone group name. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// privateDNSZoneGroupName - the name of the private dns zone group. -func (client PrivateDNSZoneGroupsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (result PrivateDNSZoneGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, privateEndpointName, privateDNSZoneGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateDNSZoneGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, privateDNSZoneGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateDnsZoneGroupName": autorest.Encode("path", privateDNSZoneGroupName), - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups/{privateDnsZoneGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateDNSZoneGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateDNSZoneGroupsClient) GetResponder(resp *http.Response) (result PrivateDNSZoneGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all private dns zone groups in a private endpoint. -// Parameters: -// privateEndpointName - the name of the private endpoint. -// resourceGroupName - the name of the resource group. -func (client PrivateDNSZoneGroupsClient) List(ctx context.Context, privateEndpointName string, resourceGroupName string) (result PrivateDNSZoneGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.List") - defer func() { - sc := -1 - if result.pdzglr.Response.Response != nil { - sc = result.pdzglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, privateEndpointName, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pdzglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "List", resp, "Failure sending request") - return - } - - result.pdzglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.pdzglr.hasNextLink() && result.pdzglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PrivateDNSZoneGroupsClient) ListPreparer(ctx context.Context, privateEndpointName string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}/privateDnsZoneGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateDNSZoneGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PrivateDNSZoneGroupsClient) ListResponder(resp *http.Response) (result PrivateDNSZoneGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PrivateDNSZoneGroupsClient) listNextResults(ctx context.Context, lastResults PrivateDNSZoneGroupListResult) (result PrivateDNSZoneGroupListResult, err error) { - req, err := lastResults.privateDNSZoneGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateDNSZoneGroupsClient) ListComplete(ctx context.Context, privateEndpointName string, resourceGroupName string) (result PrivateDNSZoneGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, privateEndpointName, resourceGroupName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privateendpoints.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privateendpoints.go deleted file mode 100644 index f85e9b302271..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privateendpoints.go +++ /dev/null @@ -1,502 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateEndpointsClient is the network Client -type PrivateEndpointsClient struct { - BaseClient -} - -// NewPrivateEndpointsClient creates an instance of the PrivateEndpointsClient client. -func NewPrivateEndpointsClient(subscriptionID string) PrivateEndpointsClient { - return NewPrivateEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateEndpointsClientWithBaseURI creates an instance of the PrivateEndpointsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateEndpointsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointsClient { - return PrivateEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates an private endpoint in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// parameters - parameters supplied to the create or update private endpoint operation. -func (client PrivateEndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint) (result PrivateEndpointsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, privateEndpointName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, parameters PrivateEndpoint) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified private endpoint. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -func (client PrivateEndpointsClient) Delete(ctx context.Context, resourceGroupName string, privateEndpointName string) (result PrivateEndpointsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, privateEndpointName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateEndpointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, privateEndpointName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) DeleteSender(req *http.Request) (future PrivateEndpointsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified private endpoint by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// privateEndpointName - the name of the private endpoint. -// expand - expands referenced resources. -func (client PrivateEndpointsClient) Get(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (result PrivateEndpoint, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, privateEndpointName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateEndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, privateEndpointName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "privateEndpointName": autorest.Encode("path", privateEndpointName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) GetResponder(resp *http.Response) (result PrivateEndpoint, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all private endpoints in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client PrivateEndpointsClient) List(ctx context.Context, resourceGroupName string) (result PrivateEndpointListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.List") - defer func() { - sc := -1 - if result.pelr.Response.Response != nil { - sc = result.pelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "List", resp, "Failure sending request") - return - } - - result.pelr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "List", resp, "Failure responding to request") - return - } - if result.pelr.hasNextLink() && result.pelr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PrivateEndpointsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateEndpoints", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) ListResponder(resp *http.Response) (result PrivateEndpointListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PrivateEndpointsClient) listNextResults(ctx context.Context, lastResults PrivateEndpointListResult) (result PrivateEndpointListResult, err error) { - req, err := lastResults.privateEndpointListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateEndpointsClient) ListComplete(ctx context.Context, resourceGroupName string) (result PrivateEndpointListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListBySubscription gets all private endpoints in a subscription. -func (client PrivateEndpointsClient) ListBySubscription(ctx context.Context) (result PrivateEndpointListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.ListBySubscription") - defer func() { - sc := -1 - if result.pelr.Response.Response != nil { - sc = result.pelr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.pelr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.pelr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.pelr.hasNextLink() && result.pelr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client PrivateEndpointsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateEndpoints", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateEndpointsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client PrivateEndpointsClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateEndpointListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client PrivateEndpointsClient) listBySubscriptionNextResults(ctx context.Context, lastResults PrivateEndpointListResult) (result PrivateEndpointListResult, err error) { - req, err := lastResults.privateEndpointListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateEndpointsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateEndpointsClient) ListBySubscriptionComplete(ctx context.Context) (result PrivateEndpointListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatelinkservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatelinkservices.go deleted file mode 100644 index 15ddba895db5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatelinkservices.go +++ /dev/null @@ -1,1266 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PrivateLinkServicesClient is the network Client -type PrivateLinkServicesClient struct { - BaseClient -} - -// NewPrivateLinkServicesClient creates an instance of the PrivateLinkServicesClient client. -func NewPrivateLinkServicesClient(subscriptionID string) PrivateLinkServicesClient { - return NewPrivateLinkServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPrivateLinkServicesClientWithBaseURI creates an instance of the PrivateLinkServicesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPrivateLinkServicesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkServicesClient { - return PrivateLinkServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckPrivateLinkServiceVisibility checks whether the subscription is visible to private link service. -// Parameters: -// location - the location of the domain name. -// parameters - the request body of CheckPrivateLinkService API call. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibility(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CheckPrivateLinkServiceVisibilityPreparer(ctx, location, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", nil, "Failure preparing request") - return - } - - result, err = client.CheckPrivateLinkServiceVisibilitySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibility", result.Response(), "Failure sending request") - return - } - - return -} - -// CheckPrivateLinkServiceVisibilityPreparer prepares the CheckPrivateLinkServiceVisibility request. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityPreparer(ctx context.Context, location string, parameters CheckPrivateLinkServiceVisibilityRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckPrivateLinkServiceVisibilitySender sends the CheckPrivateLinkServiceVisibility request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilitySender(req *http.Request) (future PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CheckPrivateLinkServiceVisibilityResponder handles the response to the CheckPrivateLinkServiceVisibility request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityResponder(resp *http.Response) (result PrivateLinkServiceVisibility, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CheckPrivateLinkServiceVisibilityByResourceGroup checks whether the subscription is visible to private link service -// in the specified resource group. -// Parameters: -// location - the location of the domain name. -// resourceGroupName - the name of the resource group. -// parameters - the request body of CheckPrivateLinkService API call. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest) (result PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CheckPrivateLinkServiceVisibilityByResourceGroupPreparer(ctx, location, resourceGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", nil, "Failure preparing request") - return - } - - result, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CheckPrivateLinkServiceVisibilityByResourceGroup", result.Response(), "Failure sending request") - return - } - - return -} - -// CheckPrivateLinkServiceVisibilityByResourceGroupPreparer prepares the CheckPrivateLinkServiceVisibilityByResourceGroup request. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupPreparer(ctx context.Context, location string, resourceGroupName string, parameters CheckPrivateLinkServiceVisibilityRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckPrivateLinkServiceVisibilityByResourceGroupSender sends the CheckPrivateLinkServiceVisibilityByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupSender(req *http.Request) (future PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CheckPrivateLinkServiceVisibilityByResourceGroupResponder handles the response to the CheckPrivateLinkServiceVisibilityByResourceGroup request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupResponder(resp *http.Response) (result PrivateLinkServiceVisibility, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates an private link service in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// parameters - parameters supplied to the create or update private link service operation. -func (client PrivateLinkServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService) (result PrivateLinkServicesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PrivateLinkServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PrivateLinkService) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) CreateOrUpdateSender(req *http.Request) (future PrivateLinkServicesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateLinkService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified private link service. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -func (client PrivateLinkServicesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result PrivateLinkServicesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PrivateLinkServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) DeleteSender(req *http.Request) (future PrivateLinkServicesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeletePrivateEndpointConnection delete private end point connection for a private link service in a subscription. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// peConnectionName - the name of the private end point connection. -func (client PrivateLinkServicesClient) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string) (result PrivateLinkServicesDeletePrivateEndpointConnectionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.DeletePrivateEndpointConnection") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "DeletePrivateEndpointConnection", nil, "Failure preparing request") - return - } - - result, err = client.DeletePrivateEndpointConnectionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "DeletePrivateEndpointConnection", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePrivateEndpointConnectionPreparer prepares the DeletePrivateEndpointConnection request. -func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peConnectionName": autorest.Encode("path", peConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeletePrivateEndpointConnectionSender sends the DeletePrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionSender(req *http.Request) (future PrivateLinkServicesDeletePrivateEndpointConnectionFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeletePrivateEndpointConnectionResponder handles the response to the DeletePrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified private link service by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// expand - expands referenced resources. -func (client PrivateLinkServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, expand string) (result PrivateLinkService, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PrivateLinkServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) GetResponder(resp *http.Response) (result PrivateLinkService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetPrivateEndpointConnection get the specific private end point connection by specific private link service in the -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// peConnectionName - the name of the private end point connection. -// expand - expands referenced resources. -func (client PrivateLinkServicesClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, expand string) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.GetPrivateEndpointConnection") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "GetPrivateEndpointConnection", nil, "Failure preparing request") - return - } - - resp, err := client.GetPrivateEndpointConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "GetPrivateEndpointConnection", resp, "Failure sending request") - return - } - - result, err = client.GetPrivateEndpointConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "GetPrivateEndpointConnection", resp, "Failure responding to request") - return - } - - return -} - -// GetPrivateEndpointConnectionPreparer prepares the GetPrivateEndpointConnection request. -func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peConnectionName": autorest.Encode("path", peConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetPrivateEndpointConnectionSender sends the GetPrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetPrivateEndpointConnectionResponder handles the response to the GetPrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all private link services in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client PrivateLinkServicesClient) List(ctx context.Context, resourceGroupName string) (result PrivateLinkServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.List") - defer func() { - sc := -1 - if result.plslr.Response.Response != nil { - sc = result.plslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.plslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", resp, "Failure sending request") - return - } - - result.plslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "List", resp, "Failure responding to request") - return - } - if result.plslr.hasNextLink() && result.plslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PrivateLinkServicesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListResponder(resp *http.Response) (result PrivateLinkServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listNextResults(ctx context.Context, lastResults PrivateLinkServiceListResult) (result PrivateLinkServiceListResult, err error) { - req, err := lastResults.privateLinkServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListComplete(ctx context.Context, resourceGroupName string) (result PrivateLinkServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAutoApprovedPrivateLinkServices returns all of the private link service ids that can be linked to a Private -// Endpoint with auto approved in this subscription in this region. -// Parameters: -// location - the location of the domain name. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServices(ctx context.Context, location string) (result AutoApprovedPrivateLinkServicesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices") - defer func() { - sc := -1 - if result.aaplsr.Response.Response != nil { - sc = result.aaplsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAutoApprovedPrivateLinkServicesNextResults - req, err := client.ListAutoApprovedPrivateLinkServicesPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", nil, "Failure preparing request") - return - } - - resp, err := client.ListAutoApprovedPrivateLinkServicesSender(req) - if err != nil { - result.aaplsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", resp, "Failure sending request") - return - } - - result.aaplsr, err = client.ListAutoApprovedPrivateLinkServicesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServices", resp, "Failure responding to request") - return - } - if result.aaplsr.hasNextLink() && result.aaplsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAutoApprovedPrivateLinkServicesPreparer prepares the ListAutoApprovedPrivateLinkServices request. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAutoApprovedPrivateLinkServicesSender sends the ListAutoApprovedPrivateLinkServices request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAutoApprovedPrivateLinkServicesResponder handles the response to the ListAutoApprovedPrivateLinkServices request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesResponder(resp *http.Response) (result AutoApprovedPrivateLinkServicesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAutoApprovedPrivateLinkServicesNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesNextResults(ctx context.Context, lastResults AutoApprovedPrivateLinkServicesResult) (result AutoApprovedPrivateLinkServicesResult, err error) { - req, err := lastResults.autoApprovedPrivateLinkServicesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAutoApprovedPrivateLinkServicesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAutoApprovedPrivateLinkServicesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAutoApprovedPrivateLinkServicesComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesComplete(ctx context.Context, location string) (result AutoApprovedPrivateLinkServicesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAutoApprovedPrivateLinkServices(ctx, location) - return -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroup returns all of the private link service ids that can be linked to -// a Private Endpoint with auto approved in this subscription in this region. -// Parameters: -// location - the location of the domain name. -// resourceGroupName - the name of the resource group. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx context.Context, location string, resourceGroupName string) (result AutoApprovedPrivateLinkServicesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup") - defer func() { - sc := -1 - if result.aaplsr.Response.Response != nil { - sc = result.aaplsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAutoApprovedPrivateLinkServicesByResourceGroupNextResults - req, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer(ctx, location, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req) - if err != nil { - result.aaplsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", resp, "Failure sending request") - return - } - - result.aaplsr, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListAutoApprovedPrivateLinkServicesByResourceGroup", resp, "Failure responding to request") - return - } - if result.aaplsr.hasNextLink() && result.aaplsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer prepares the ListAutoApprovedPrivateLinkServicesByResourceGroup request. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupPreparer(ctx context.Context, location string, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/autoApprovedPrivateLinkServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupSender sends the ListAutoApprovedPrivateLinkServicesByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupResponder handles the response to the ListAutoApprovedPrivateLinkServicesByResourceGroup request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp *http.Response) (result AutoApprovedPrivateLinkServicesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAutoApprovedPrivateLinkServicesByResourceGroupNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listAutoApprovedPrivateLinkServicesByResourceGroupNextResults(ctx context.Context, lastResults AutoApprovedPrivateLinkServicesResult) (result AutoApprovedPrivateLinkServicesResult, err error) { - req, err := lastResults.autoApprovedPrivateLinkServicesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listAutoApprovedPrivateLinkServicesByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx context.Context, location string, resourceGroupName string) (result AutoApprovedPrivateLinkServicesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, location, resourceGroupName) - return -} - -// ListBySubscription gets all private link service in a subscription. -func (client PrivateLinkServicesClient) ListBySubscription(ctx context.Context) (result PrivateLinkServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListBySubscription") - defer func() { - sc := -1 - if result.plslr.Response.Response != nil { - sc = result.plslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.plslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.plslr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.plslr.hasNextLink() && result.plslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client PrivateLinkServicesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/privateLinkServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListBySubscriptionResponder(resp *http.Response) (result PrivateLinkServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults PrivateLinkServiceListResult) (result PrivateLinkServiceListResult, err error) { - req, err := lastResults.privateLinkServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListBySubscriptionComplete(ctx context.Context) (result PrivateLinkServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// ListPrivateEndpointConnections gets all private end point connections for a specific private link service. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnections(ctx context.Context, resourceGroupName string, serviceName string) (result PrivateEndpointConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListPrivateEndpointConnections") - defer func() { - sc := -1 - if result.peclr.Response.Response != nil { - sc = result.peclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listPrivateEndpointConnectionsNextResults - req, err := client.ListPrivateEndpointConnectionsPreparer(ctx, resourceGroupName, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListPrivateEndpointConnections", nil, "Failure preparing request") - return - } - - resp, err := client.ListPrivateEndpointConnectionsSender(req) - if err != nil { - result.peclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListPrivateEndpointConnections", resp, "Failure sending request") - return - } - - result.peclr, err = client.ListPrivateEndpointConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "ListPrivateEndpointConnections", resp, "Failure responding to request") - return - } - if result.peclr.hasNextLink() && result.peclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPrivateEndpointConnectionsPreparer prepares the ListPrivateEndpointConnections request. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPrivateEndpointConnectionsSender sends the ListPrivateEndpointConnections request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPrivateEndpointConnectionsResponder handles the response to the ListPrivateEndpointConnections request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listPrivateEndpointConnectionsNextResults retrieves the next set of results, if any. -func (client PrivateLinkServicesClient) listPrivateEndpointConnectionsNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { - req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listPrivateEndpointConnectionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListPrivateEndpointConnectionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListPrivateEndpointConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListPrivateEndpointConnectionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsComplete(ctx context.Context, resourceGroupName string, serviceName string) (result PrivateEndpointConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.ListPrivateEndpointConnections") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListPrivateEndpointConnections(ctx, resourceGroupName, serviceName) - return -} - -// UpdatePrivateEndpointConnection approve or reject private end point connection for a private link service in a -// subscription. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the private link service. -// peConnectionName - the name of the private end point connection. -// parameters - parameters supplied to approve or reject the private end point connection. -func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServicesClient.UpdatePrivateEndpointConnection") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePrivateEndpointConnectionPreparer(ctx, resourceGroupName, serviceName, peConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", nil, "Failure preparing request") - return - } - - resp, err := client.UpdatePrivateEndpointConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", resp, "Failure sending request") - return - } - - result, err = client.UpdatePrivateEndpointConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesClient", "UpdatePrivateEndpointConnection", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePrivateEndpointConnectionPreparer prepares the UpdatePrivateEndpointConnection request. -func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, serviceName string, peConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peConnectionName": autorest.Encode("path", peConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Type = nil - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdatePrivateEndpointConnectionSender sends the UpdatePrivateEndpointConnection request. The method will close the -// http.Response Body if it receives an error. -func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdatePrivateEndpointConnectionResponder handles the response to the UpdatePrivateEndpointConnection request. The method always -// closes the http.Response Body. -func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/profiles.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/profiles.go deleted file mode 100644 index 59e825dab152..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/profiles.go +++ /dev/null @@ -1,577 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProfilesClient is the network Client -type ProfilesClient struct { - BaseClient -} - -// NewProfilesClient creates an instance of the ProfilesClient client. -func NewProfilesClient(subscriptionID string) ProfilesClient { - return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient { - return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a network profile. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkProfileName - the name of the network profile. -// parameters - parameters supplied to the create or update network profile operation. -func (client ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile) (result Profile, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkProfileName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProfilesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkProfileName string, parameters Profile) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkProfileName": autorest.Encode("path", networkProfileName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network profile. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkProfileName - the name of the NetworkProfile. -func (client ProfilesClient) Delete(ctx context.Context, resourceGroupName string, networkProfileName string) (result ProfilesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkProfileName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProfilesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkProfileName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkProfileName": autorest.Encode("path", networkProfileName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) DeleteSender(req *http.Request) (future ProfilesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified network profile in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkProfileName - the name of the public IP prefix. -// expand - expands referenced resources. -func (client ProfilesClient) Get(ctx context.Context, resourceGroupName string, networkProfileName string, expand string) (result Profile, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkProfileName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProfilesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkProfileName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkProfileName": autorest.Encode("path", networkProfileName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all network profiles in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ProfilesClient) List(ctx context.Context, resourceGroupName string) (result ProfileListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.List") - defer func() { - sc := -1 - if result.plr.Response.Response != nil { - sc = result.plr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.plr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "List", resp, "Failure sending request") - return - } - - result.plr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "List", resp, "Failure responding to request") - return - } - if result.plr.hasNextLink() && result.plr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ProfilesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ProfilesClient) ListResponder(resp *http.Response) (result ProfileListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ProfilesClient) listNextResults(ctx context.Context, lastResults ProfileListResult) (result ProfileListResult, err error) { - req, err := lastResults.profileListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ProfilesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ProfilesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProfilesClient) ListComplete(ctx context.Context, resourceGroupName string) (result ProfileListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the network profiles in a subscription. -func (client ProfilesClient) ListAll(ctx context.Context) (result ProfileListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListAll") - defer func() { - sc := -1 - if result.plr.Response.Response != nil { - sc = result.plr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.plr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "ListAll", resp, "Failure sending request") - return - } - - result.plr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.plr.hasNextLink() && result.plr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client ProfilesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkProfiles", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client ProfilesClient) ListAllResponder(resp *http.Response) (result ProfileListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client ProfilesClient) listAllNextResults(ctx context.Context, lastResults ProfileListResult) (result ProfileListResult, err error) { - req, err := lastResults.profileListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ProfilesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ProfilesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProfilesClient) ListAllComplete(ctx context.Context) (result ProfileListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates network profile tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkProfileName - the name of the network profile. -// parameters - parameters supplied to update network profile tags. -func (client ProfilesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject) (result Profile, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkProfileName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ProfilesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ProfilesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkProfileName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkProfileName": autorest.Encode("path", networkProfileName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkProfiles/{networkProfileName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ProfilesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ProfilesClient) UpdateTagsResponder(resp *http.Response) (result Profile, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipaddresses.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipaddresses.go deleted file mode 100644 index 1e29520f8606..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipaddresses.go +++ /dev/null @@ -1,1337 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PublicIPAddressesClient is the network Client -type PublicIPAddressesClient struct { - BaseClient -} - -// NewPublicIPAddressesClient creates an instance of the PublicIPAddressesClient client. -func NewPublicIPAddressesClient(subscriptionID string) PublicIPAddressesClient { - return NewPublicIPAddressesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPublicIPAddressesClientWithBaseURI creates an instance of the PublicIPAddressesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPublicIPAddressesClientWithBaseURI(baseURI string, subscriptionID string) PublicIPAddressesClient { - return PublicIPAddressesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a static or dynamic public IP address. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -// parameters - parameters supplied to the create or update public IP address operation. -func (client PublicIPAddressesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress) (result PublicIPAddressesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - {Target: "parameters.PublicIPAddressPropertiesFormat.ServicePublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.PublicIPAddressPropertiesFormat.LinkedPublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.PublicIPAddressesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, publicIPAddressName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PublicIPAddressesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) CreateOrUpdateSender(req *http.Request) (future PublicIPAddressesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// DdosProtectionStatus gets the Ddos Protection Status of a Public IP Address -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -func (client PublicIPAddressesClient) DdosProtectionStatus(ctx context.Context, resourceGroupName string, publicIPAddressName string) (result PublicIPAddressesDdosProtectionStatusFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.DdosProtectionStatus") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DdosProtectionStatusPreparer(ctx, resourceGroupName, publicIPAddressName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "DdosProtectionStatus", nil, "Failure preparing request") - return - } - - result, err = client.DdosProtectionStatusSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "DdosProtectionStatus", result.Response(), "Failure sending request") - return - } - - return -} - -// DdosProtectionStatusPreparer prepares the DdosProtectionStatus request. -func (client PublicIPAddressesClient) DdosProtectionStatusPreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/ddosProtectionStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DdosProtectionStatusSender sends the DdosProtectionStatus request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) DdosProtectionStatusSender(req *http.Request) (future PublicIPAddressesDdosProtectionStatusFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DdosProtectionStatusResponder handles the response to the DdosProtectionStatus request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) DdosProtectionStatusResponder(resp *http.Response) (result PublicIPDdosProtectionStatusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified public IP address. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -func (client PublicIPAddressesClient) Delete(ctx context.Context, resourceGroupName string, publicIPAddressName string) (result PublicIPAddressesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, publicIPAddressName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PublicIPAddressesClient) DeletePreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) DeleteSender(req *http.Request) (future PublicIPAddressesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified public IP address in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -// expand - expands referenced resources. -func (client PublicIPAddressesClient) Get(ctx context.Context, resourceGroupName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, publicIPAddressName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PublicIPAddressesClient) GetPreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetCloudServicePublicIPAddress get the specified public IP address in a cloud service. -// Parameters: -// resourceGroupName - the name of the resource group. -// cloudServiceName - the name of the cloud service. -// roleInstanceName - the role instance name. -// networkInterfaceName - the name of the network interface. -// IPConfigurationName - the name of the IP configuration. -// publicIPAddressName - the name of the public IP Address. -// expand - expands referenced resources. -func (client PublicIPAddressesClient) GetCloudServicePublicIPAddress(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.GetCloudServicePublicIPAddress") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetCloudServicePublicIPAddressPreparer(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, IPConfigurationName, publicIPAddressName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetCloudServicePublicIPAddress", nil, "Failure preparing request") - return - } - - resp, err := client.GetCloudServicePublicIPAddressSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetCloudServicePublicIPAddress", resp, "Failure sending request") - return - } - - result, err = client.GetCloudServicePublicIPAddressResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetCloudServicePublicIPAddress", resp, "Failure responding to request") - return - } - - return -} - -// GetCloudServicePublicIPAddressPreparer prepares the GetCloudServicePublicIPAddress request. -func (client PublicIPAddressesClient) GetCloudServicePublicIPAddressPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetCloudServicePublicIPAddressSender sends the GetCloudServicePublicIPAddress request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) GetCloudServicePublicIPAddressSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetCloudServicePublicIPAddressResponder handles the response to the GetCloudServicePublicIPAddress request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) GetCloudServicePublicIPAddressResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVirtualMachineScaleSetPublicIPAddress get the specified public IP address in a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the name of the network interface. -// IPConfigurationName - the name of the IP configuration. -// publicIPAddressName - the name of the public IP Address. -// expand - expands referenced resources. -func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.GetVirtualMachineScaleSetPublicIPAddress") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVirtualMachineScaleSetPublicIPAddressPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, publicIPAddressName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", nil, "Failure preparing request") - return - } - - resp, err := client.GetVirtualMachineScaleSetPublicIPAddressSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", resp, "Failure sending request") - return - } - - result, err = client.GetVirtualMachineScaleSetPublicIPAddressResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", resp, "Failure responding to request") - return - } - - return -} - -// GetVirtualMachineScaleSetPublicIPAddressPreparer prepares the GetVirtualMachineScaleSetPublicIPAddress request. -func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVirtualMachineScaleSetPublicIPAddressSender sends the GetVirtualMachineScaleSetPublicIPAddress request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetVirtualMachineScaleSetPublicIPAddressResponder handles the response to the GetVirtualMachineScaleSetPublicIPAddress request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all public IP addresses in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client PublicIPAddressesClient) List(ctx context.Context, resourceGroupName string) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.List") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "List", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PublicIPAddressesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListComplete(ctx context.Context, resourceGroupName string) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the public IP addresses in a subscription. -func (client PublicIPAddressesClient) ListAll(ctx context.Context) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListAll") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client PublicIPAddressesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListAllResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listAllNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListAllComplete(ctx context.Context) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListCloudServicePublicIPAddresses gets information about all public IP addresses on a cloud service level. -// Parameters: -// resourceGroupName - the name of the resource group. -// cloudServiceName - the name of the cloud service. -func (client PublicIPAddressesClient) ListCloudServicePublicIPAddresses(ctx context.Context, resourceGroupName string, cloudServiceName string) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListCloudServicePublicIPAddresses") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listCloudServicePublicIPAddressesNextResults - req, err := client.ListCloudServicePublicIPAddressesPreparer(ctx, resourceGroupName, cloudServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListCloudServicePublicIPAddresses", nil, "Failure preparing request") - return - } - - resp, err := client.ListCloudServicePublicIPAddressesSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListCloudServicePublicIPAddresses", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListCloudServicePublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListCloudServicePublicIPAddresses", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListCloudServicePublicIPAddressesPreparer prepares the ListCloudServicePublicIPAddresses request. -func (client PublicIPAddressesClient) ListCloudServicePublicIPAddressesPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/publicipaddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCloudServicePublicIPAddressesSender sends the ListCloudServicePublicIPAddresses request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListCloudServicePublicIPAddressesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListCloudServicePublicIPAddressesResponder handles the response to the ListCloudServicePublicIPAddresses request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListCloudServicePublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listCloudServicePublicIPAddressesNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listCloudServicePublicIPAddressesNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listCloudServicePublicIPAddressesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListCloudServicePublicIPAddressesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listCloudServicePublicIPAddressesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListCloudServicePublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listCloudServicePublicIPAddressesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListCloudServicePublicIPAddressesComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListCloudServicePublicIPAddressesComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListCloudServicePublicIPAddresses") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListCloudServicePublicIPAddresses(ctx, resourceGroupName, cloudServiceName) - return -} - -// ListCloudServiceRoleInstancePublicIPAddresses gets information about all public IP addresses in a role instance IP -// configuration in a cloud service. -// Parameters: -// resourceGroupName - the name of the resource group. -// cloudServiceName - the name of the cloud service. -// roleInstanceName - the name of role instance. -// networkInterfaceName - the network interface name. -// IPConfigurationName - the IP configuration name. -func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddresses(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListCloudServiceRoleInstancePublicIPAddresses") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listCloudServiceRoleInstancePublicIPAddressesNextResults - req, err := client.ListCloudServiceRoleInstancePublicIPAddressesPreparer(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, IPConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListCloudServiceRoleInstancePublicIPAddresses", nil, "Failure preparing request") - return - } - - resp, err := client.ListCloudServiceRoleInstancePublicIPAddressesSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListCloudServiceRoleInstancePublicIPAddresses", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListCloudServiceRoleInstancePublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListCloudServiceRoleInstancePublicIPAddresses", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListCloudServiceRoleInstancePublicIPAddressesPreparer prepares the ListCloudServiceRoleInstancePublicIPAddresses request. -func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddressesPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, IPConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "cloudServiceName": autorest.Encode("path", cloudServiceName), - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "roleInstanceName": autorest.Encode("path", roleInstanceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListCloudServiceRoleInstancePublicIPAddressesSender sends the ListCloudServiceRoleInstancePublicIPAddresses request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddressesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListCloudServiceRoleInstancePublicIPAddressesResponder handles the response to the ListCloudServiceRoleInstancePublicIPAddresses request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listCloudServiceRoleInstancePublicIPAddressesNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listCloudServiceRoleInstancePublicIPAddressesNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listCloudServiceRoleInstancePublicIPAddressesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListCloudServiceRoleInstancePublicIPAddressesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listCloudServiceRoleInstancePublicIPAddressesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListCloudServiceRoleInstancePublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listCloudServiceRoleInstancePublicIPAddressesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListCloudServiceRoleInstancePublicIPAddressesComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddressesComplete(ctx context.Context, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListCloudServiceRoleInstancePublicIPAddresses") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListCloudServiceRoleInstancePublicIPAddresses(ctx, resourceGroupName, cloudServiceName, roleInstanceName, networkInterfaceName, IPConfigurationName) - return -} - -// ListVirtualMachineScaleSetPublicIPAddresses gets information about all public IP addresses on a virtual machine -// scale set level. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresses(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListVirtualMachineScaleSetPublicIPAddresses") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetPublicIPAddressesNextResults - req, err := client.ListVirtualMachineScaleSetPublicIPAddressesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetPublicIPAddressesSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListVirtualMachineScaleSetPublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetPublicIPAddressesPreparer prepares the ListVirtualMachineScaleSetPublicIPAddresses request. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetPublicIPAddressesSender sends the ListVirtualMachineScaleSetPublicIPAddresses request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetPublicIPAddressesResponder handles the response to the ListVirtualMachineScaleSetPublicIPAddresses request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetPublicIPAddressesNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listVirtualMachineScaleSetPublicIPAddressesNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetPublicIPAddressesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetPublicIPAddressesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetPublicIPAddressesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetPublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetPublicIPAddressesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetPublicIPAddressesComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListVirtualMachineScaleSetPublicIPAddresses") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetPublicIPAddresses(ctx, resourceGroupName, virtualMachineScaleSetName) - return -} - -// ListVirtualMachineScaleSetVMPublicIPAddresses gets information about all public IP addresses in a virtual machine IP -// configuration in a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the virtual machine scale set. -// virtualmachineIndex - the virtual machine index. -// networkInterfaceName - the network interface name. -// IPConfigurationName - the IP configuration name. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddresses(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListVirtualMachineScaleSetVMPublicIPAddresses") - defer func() { - sc := -1 - if result.pialr.Response.Response != nil { - sc = result.pialr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listVirtualMachineScaleSetVMPublicIPAddressesNextResults - req, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", nil, "Failure preparing request") - return - } - - resp, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesSender(req) - if err != nil { - result.pialr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure sending request") - return - } - - result.pialr, err = client.ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure responding to request") - return - } - if result.pialr.hasNextLink() && result.pialr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListVirtualMachineScaleSetVMPublicIPAddressesPreparer prepares the ListVirtualMachineScaleSetVMPublicIPAddresses request. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigurationName": autorest.Encode("path", IPConfigurationName), - "networkInterfaceName": autorest.Encode("path", networkInterfaceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2018-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVirtualMachineScaleSetVMPublicIPAddressesSender sends the ListVirtualMachineScaleSetVMPublicIPAddresses request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVirtualMachineScaleSetVMPublicIPAddressesResponder handles the response to the ListVirtualMachineScaleSetVMPublicIPAddresses request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listVirtualMachineScaleSetVMPublicIPAddressesNextResults retrieves the next set of results, if any. -func (client PublicIPAddressesClient) listVirtualMachineScaleSetVMPublicIPAddressesNextResults(ctx context.Context, lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { - req, err := lastResults.publicIPAddressListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetVMPublicIPAddressesNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetVMPublicIPAddressesNextResults", resp, "Failure sending next results request") - } - result, err = client.ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "listVirtualMachineScaleSetVMPublicIPAddressesNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListVirtualMachineScaleSetVMPublicIPAddressesComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.ListVirtualMachineScaleSetVMPublicIPAddresses") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListVirtualMachineScaleSetVMPublicIPAddresses(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName) - return -} - -// UpdateTags updates public IP address tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPAddressName - the name of the public IP address. -// parameters - parameters supplied to update public IP address tags. -func (client PublicIPAddressesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject) (result PublicIPAddress, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, publicIPAddressName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client PublicIPAddressesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpAddressName": autorest.Encode("path", publicIPAddressName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPAddressesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client PublicIPAddressesClient) UpdateTagsResponder(resp *http.Response) (result PublicIPAddress, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipprefixes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipprefixes.go deleted file mode 100644 index 4b076abe551d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipprefixes.go +++ /dev/null @@ -1,581 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// PublicIPPrefixesClient is the network Client -type PublicIPPrefixesClient struct { - BaseClient -} - -// NewPublicIPPrefixesClient creates an instance of the PublicIPPrefixesClient client. -func NewPublicIPPrefixesClient(subscriptionID string) PublicIPPrefixesClient { - return NewPublicIPPrefixesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewPublicIPPrefixesClientWithBaseURI creates an instance of the PublicIPPrefixesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewPublicIPPrefixesClientWithBaseURI(baseURI string, subscriptionID string) PublicIPPrefixesClient { - return PublicIPPrefixesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a static or dynamic public IP prefix. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPPrefixName - the name of the public IP prefix. -// parameters - parameters supplied to the create or update public IP prefix operation. -func (client PublicIPPrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix) (result PublicIPPrefixesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, publicIPPrefixName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PublicIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters PublicIPPrefix) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpPrefixName": autorest.Encode("path", publicIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) CreateOrUpdateSender(req *http.Request) (future PublicIPPrefixesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) CreateOrUpdateResponder(resp *http.Response) (result PublicIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified public IP prefix. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPPrefixName - the name of the PublicIpPrefix. -func (client PublicIPPrefixesClient) Delete(ctx context.Context, resourceGroupName string, publicIPPrefixName string) (result PublicIPPrefixesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, publicIPPrefixName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PublicIPPrefixesClient) DeletePreparer(ctx context.Context, resourceGroupName string, publicIPPrefixName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpPrefixName": autorest.Encode("path", publicIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) DeleteSender(req *http.Request) (future PublicIPPrefixesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified public IP prefix in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPPrefixName - the name of the public IP prefix. -// expand - expands referenced resources. -func (client PublicIPPrefixesClient) Get(ctx context.Context, resourceGroupName string, publicIPPrefixName string, expand string) (result PublicIPPrefix, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, publicIPPrefixName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client PublicIPPrefixesClient) GetPreparer(ctx context.Context, resourceGroupName string, publicIPPrefixName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpPrefixName": autorest.Encode("path", publicIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) GetResponder(resp *http.Response) (result PublicIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all public IP prefixes in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client PublicIPPrefixesClient) List(ctx context.Context, resourceGroupName string) (result PublicIPPrefixListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.List") - defer func() { - sc := -1 - if result.piplr.Response.Response != nil { - sc = result.piplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.piplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "List", resp, "Failure sending request") - return - } - - result.piplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "List", resp, "Failure responding to request") - return - } - if result.piplr.hasNextLink() && result.piplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client PublicIPPrefixesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) ListResponder(resp *http.Response) (result PublicIPPrefixListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client PublicIPPrefixesClient) listNextResults(ctx context.Context, lastResults PublicIPPrefixListResult) (result PublicIPPrefixListResult, err error) { - req, err := lastResults.publicIPPrefixListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPPrefixesClient) ListComplete(ctx context.Context, resourceGroupName string) (result PublicIPPrefixListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the public IP prefixes in a subscription. -func (client PublicIPPrefixesClient) ListAll(ctx context.Context) (result PublicIPPrefixListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.ListAll") - defer func() { - sc := -1 - if result.piplr.Response.Response != nil { - sc = result.piplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.piplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "ListAll", resp, "Failure sending request") - return - } - - result.piplr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.piplr.hasNextLink() && result.piplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client PublicIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) ListAllResponder(resp *http.Response) (result PublicIPPrefixListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client PublicIPPrefixesClient) listAllNextResults(ctx context.Context, lastResults PublicIPPrefixListResult) (result PublicIPPrefixListResult, err error) { - req, err := lastResults.publicIPPrefixListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client PublicIPPrefixesClient) ListAllComplete(ctx context.Context) (result PublicIPPrefixListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates public IP prefix tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// publicIPPrefixName - the name of the public IP prefix. -// parameters - parameters supplied to update public IP prefix tags. -func (client PublicIPPrefixesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject) (result PublicIPPrefix, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, publicIPPrefixName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client PublicIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, publicIPPrefixName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "publicIpPrefixName": autorest.Encode("path", publicIPPrefixName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client PublicIPPrefixesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client PublicIPPrefixesClient) UpdateTagsResponder(resp *http.Response) (result PublicIPPrefix, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/resourcenavigationlinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/resourcenavigationlinks.go deleted file mode 100644 index 0ac79d4c49e0..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/resourcenavigationlinks.go +++ /dev/null @@ -1,110 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceNavigationLinksClient is the network Client -type ResourceNavigationLinksClient struct { - BaseClient -} - -// NewResourceNavigationLinksClient creates an instance of the ResourceNavigationLinksClient client. -func NewResourceNavigationLinksClient(subscriptionID string) ResourceNavigationLinksClient { - return NewResourceNavigationLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceNavigationLinksClientWithBaseURI creates an instance of the ResourceNavigationLinksClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewResourceNavigationLinksClientWithBaseURI(baseURI string, subscriptionID string) ResourceNavigationLinksClient { - return ResourceNavigationLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of resource navigation links for a subnet. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -func (client ResourceNavigationLinksClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result ResourceNavigationLinksListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceNavigationLinksClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ResourceNavigationLinksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ResourceNavigationLinksClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ResourceNavigationLinksClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ResourceNavigationLinksClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ResourceNavigationLinks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceNavigationLinksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ResourceNavigationLinksClient) ListResponder(resp *http.Response) (result ResourceNavigationLinksListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilterrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilterrules.go deleted file mode 100644 index 179b1a7cb287..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilterrules.go +++ /dev/null @@ -1,403 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RouteFilterRulesClient is the network Client -type RouteFilterRulesClient struct { - BaseClient -} - -// NewRouteFilterRulesClient creates an instance of the RouteFilterRulesClient client. -func NewRouteFilterRulesClient(subscriptionID string) RouteFilterRulesClient { - return NewRouteFilterRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRouteFilterRulesClientWithBaseURI creates an instance of the RouteFilterRulesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewRouteFilterRulesClientWithBaseURI(baseURI string, subscriptionID string) RouteFilterRulesClient { - return RouteFilterRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a route in the specified route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// ruleName - the name of the route filter rule. -// routeFilterRuleParameters - parameters supplied to the create or update route filter rule operation. -func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (result RouteFilterRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: routeFilterRuleParameters, - Constraints: []validation.Constraint{{Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat.RouteFilterRuleType", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "routeFilterRuleParameters.RouteFilterRulePropertiesFormat.Communities", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.RouteFilterRulesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeFilterRuleParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), - autorest.WithJSON(routeFilterRuleParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFilterRulesClient) CreateOrUpdateSender(req *http.Request) (future RouteFilterRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilterRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified rule from a route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// ruleName - the name of the rule. -func (client RouteFilterRulesClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName, ruleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RouteFilterRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFilterRulesClient) DeleteSender(req *http.Request) (future RouteFilterRulesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified rule from a route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// ruleName - the name of the rule. -func (client RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, ruleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RouteFilterRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "ruleName": autorest.Encode("path", ruleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFilterRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RouteFilterRulesClient) GetResponder(resp *http.Response) (result RouteFilterRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByRouteFilter gets all RouteFilterRules in a route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -func (client RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.ListByRouteFilter") - defer func() { - sc := -1 - if result.rfrlr.Response.Response != nil { - sc = result.rfrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByRouteFilterNextResults - req, err := client.ListByRouteFilterPreparer(ctx, resourceGroupName, routeFilterName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", nil, "Failure preparing request") - return - } - - resp, err := client.ListByRouteFilterSender(req) - if err != nil { - result.rfrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", resp, "Failure sending request") - return - } - - result.rfrlr, err = client.ListByRouteFilterResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "ListByRouteFilter", resp, "Failure responding to request") - return - } - if result.rfrlr.hasNextLink() && result.rfrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByRouteFilterPreparer prepares the ListByRouteFilter request. -func (client RouteFilterRulesClient) ListByRouteFilterPreparer(ctx context.Context, resourceGroupName string, routeFilterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByRouteFilterSender sends the ListByRouteFilter request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFilterRulesClient) ListByRouteFilterSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByRouteFilterResponder handles the response to the ListByRouteFilter request. The method always -// closes the http.Response Body. -func (client RouteFilterRulesClient) ListByRouteFilterResponder(resp *http.Response) (result RouteFilterRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByRouteFilterNextResults retrieves the next set of results, if any. -func (client RouteFilterRulesClient) listByRouteFilterNextResults(ctx context.Context, lastResults RouteFilterRuleListResult) (result RouteFilterRuleListResult, err error) { - req, err := lastResults.routeFilterRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByRouteFilterSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByRouteFilterResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFilterRulesClient", "listByRouteFilterNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByRouteFilterComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteFilterRulesClient) ListByRouteFilterComplete(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRulesClient.ListByRouteFilter") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByRouteFilter(ctx, resourceGroupName, routeFilterName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilters.go deleted file mode 100644 index 2f6a25f21b94..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilters.go +++ /dev/null @@ -1,580 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RouteFiltersClient is the network Client -type RouteFiltersClient struct { - BaseClient -} - -// NewRouteFiltersClient creates an instance of the RouteFiltersClient client. -func NewRouteFiltersClient(subscriptionID string) RouteFiltersClient { - return NewRouteFiltersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRouteFiltersClientWithBaseURI creates an instance of the RouteFiltersClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRouteFiltersClientWithBaseURI(baseURI string, subscriptionID string) RouteFiltersClient { - return RouteFiltersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a route filter in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// routeFilterParameters - parameters supplied to the create or update route filter operation. -func (client RouteFiltersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter) (result RouteFiltersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeFilterName, routeFilterParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeFilterParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), - autorest.WithJSON(routeFilterParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) CreateOrUpdateSender(req *http.Request) (future RouteFiltersCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) CreateOrUpdateResponder(resp *http.Response) (result RouteFilter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -func (client RouteFiltersClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFiltersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RouteFiltersClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeFilterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) DeleteSender(req *http.Request) (future RouteFiltersDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// expand - expands referenced express route bgp peering resources. -func (client RouteFiltersClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, expand string) (result RouteFilter, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RouteFiltersClient) GetPreparer(ctx context.Context, resourceGroupName string, routeFilterName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) GetResponder(resp *http.Response) (result RouteFilter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all route filters in a subscription. -func (client RouteFiltersClient) List(ctx context.Context) (result RouteFilterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.List") - defer func() { - sc := -1 - if result.rflr.Response.Response != nil { - sc = result.rflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "List", resp, "Failure sending request") - return - } - - result.rflr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "List", resp, "Failure responding to request") - return - } - if result.rflr.hasNextLink() && result.rflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RouteFiltersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) ListResponder(resp *http.Response) (result RouteFilterListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RouteFiltersClient) listNextResults(ctx context.Context, lastResults RouteFilterListResult) (result RouteFilterListResult, err error) { - req, err := lastResults.routeFilterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteFiltersClient) ListComplete(ctx context.Context) (result RouteFilterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all route filters in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client RouteFiltersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result RouteFilterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.rflr.Response.Response != nil { - sc = result.rflr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.rflr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.rflr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.rflr.hasNextLink() && result.rflr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client RouteFiltersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) ListByResourceGroupResponder(resp *http.Response) (result RouteFilterListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client RouteFiltersClient) listByResourceGroupNextResults(ctx context.Context, lastResults RouteFilterListResult) (result RouteFilterListResult, err error) { - req, err := lastResults.routeFilterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteFiltersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result RouteFilterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates tags of a route filter. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeFilterName - the name of the route filter. -// parameters - parameters supplied to update route filter tags. -func (client RouteFiltersClient) UpdateTags(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject) (result RouteFilter, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteFiltersClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, routeFilterName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteFiltersClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client RouteFiltersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, routeFilterName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeFilterName": autorest.Encode("path", routeFilterName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client RouteFiltersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client RouteFiltersClient) UpdateTagsResponder(resp *http.Response) (result RouteFilter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routemaps.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routemaps.go deleted file mode 100644 index 1f31d110144d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routemaps.go +++ /dev/null @@ -1,394 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RouteMapsClient is the network Client -type RouteMapsClient struct { - BaseClient -} - -// NewRouteMapsClient creates an instance of the RouteMapsClient client. -func NewRouteMapsClient(subscriptionID string) RouteMapsClient { - return NewRouteMapsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRouteMapsClientWithBaseURI creates an instance of the RouteMapsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRouteMapsClientWithBaseURI(baseURI string, subscriptionID string) RouteMapsClient { - return RouteMapsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a RouteMap if it doesn't exist else updates the existing one. -// Parameters: -// resourceGroupName - the resource group name of the RouteMap's resource group. -// virtualHubName - the name of the VirtualHub containing the RouteMap. -// routeMapName - the name of the RouteMap. -// routeMapParameters - parameters supplied to create or update a RouteMap. -func (client RouteMapsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap) (result RouteMapsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, routeMapName, routeMapParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RouteMapsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeMapName": autorest.Encode("path", routeMapName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeMapParameters.Name = nil - routeMapParameters.Etag = nil - routeMapParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", pathParameters), - autorest.WithJSON(routeMapParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RouteMapsClient) CreateOrUpdateSender(req *http.Request) (future RouteMapsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RouteMapsClient) CreateOrUpdateResponder(resp *http.Response) (result RouteMap, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a RouteMap. -// Parameters: -// resourceGroupName - the resource group name of the RouteMap's resource group. -// virtualHubName - the name of the VirtualHub containing the RouteMap. -// routeMapName - the name of the RouteMap. -func (client RouteMapsClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string) (result RouteMapsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, routeMapName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RouteMapsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeMapName": autorest.Encode("path", routeMapName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RouteMapsClient) DeleteSender(req *http.Request) (future RouteMapsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RouteMapsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a RouteMap. -// Parameters: -// resourceGroupName - the resource group name of the RouteMap's resource group. -// virtualHubName - the name of the VirtualHub containing the RouteMap. -// routeMapName - the name of the RouteMap. -func (client RouteMapsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string) (result RouteMap, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, routeMapName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RouteMapsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeMapName": autorest.Encode("path", routeMapName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RouteMapsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RouteMapsClient) GetResponder(resp *http.Response) (result RouteMap, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all RouteMaps. -// Parameters: -// resourceGroupName - the resource group name of the RouteMap's resource group'. -// virtualHubName - the name of the VirtualHub containing the RouteMap. -func (client RouteMapsClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListRouteMapsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.List") - defer func() { - sc := -1 - if result.lrmr.Response.Response != nil { - sc = result.lrmr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lrmr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "List", resp, "Failure sending request") - return - } - - result.lrmr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "List", resp, "Failure responding to request") - return - } - if result.lrmr.hasNextLink() && result.lrmr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RouteMapsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RouteMapsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RouteMapsClient) ListResponder(resp *http.Response) (result ListRouteMapsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RouteMapsClient) listNextResults(ctx context.Context, lastResults ListRouteMapsResult) (result ListRouteMapsResult, err error) { - req, err := lastResults.listRouteMapsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteMapsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteMapsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteMapsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListRouteMapsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routes.go deleted file mode 100644 index fc2be63bfe36..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routes.go +++ /dev/null @@ -1,392 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RoutesClient is the network Client -type RoutesClient struct { - BaseClient -} - -// NewRoutesClient creates an instance of the RoutesClient client. -func NewRoutesClient(subscriptionID string) RoutesClient { - return NewRoutesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRoutesClientWithBaseURI creates an instance of the RoutesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesClient { - return RoutesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a route in the specified route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// routeName - the name of the route. -// routeParameters - parameters supplied to the create or update route operation. -func (client RoutesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (result RoutesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, routeName, routeParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeName": autorest.Encode("path", routeName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routeParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters), - autorest.WithJSON(routeParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RoutesClient) CreateOrUpdateSender(req *http.Request) (future RoutesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result Route, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified route from a route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// routeName - the name of the route. -func (client RoutesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result RoutesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName, routeName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RoutesClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeName": autorest.Encode("path", routeName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RoutesClient) DeleteSender(req *http.Request) (future RoutesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified route from a route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// routeName - the name of the route. -func (client RoutesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result Route, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, routeName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RoutesClient) GetPreparer(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeName": autorest.Encode("path", routeName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RoutesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all routes in a route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -func (client RoutesClient) List(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.List") - defer func() { - sc := -1 - if result.rlr.Response.Response != nil { - sc = result.rlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure sending request") - return - } - - result.rlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "List", resp, "Failure responding to request") - return - } - if result.rlr.hasNextLink() && result.rlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RoutesClient) ListPreparer(ctx context.Context, resourceGroupName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RoutesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RoutesClient) ListResponder(resp *http.Response) (result RouteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RoutesClient) listNextResults(ctx context.Context, lastResults RouteListResult) (result RouteListResult, err error) { - req, err := lastResults.routeListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RoutesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RoutesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RoutesClient) ListComplete(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, routeTableName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routetables.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routetables.go deleted file mode 100644 index 79d8c6e272e8..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routetables.go +++ /dev/null @@ -1,580 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RouteTablesClient is the network Client -type RouteTablesClient struct { - BaseClient -} - -// NewRouteTablesClient creates an instance of the RouteTablesClient client. -func NewRouteTablesClient(subscriptionID string) RouteTablesClient { - return NewRouteTablesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRouteTablesClientWithBaseURI creates an instance of the RouteTablesClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) RouteTablesClient { - return RouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or updates a route table in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// parameters - parameters supplied to the create or update route table operation. -func (client RouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable) (result RouteTablesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) CreateOrUpdateSender(req *http.Request) (future RouteTablesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (result RouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -func (client RouteTablesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteTablesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RouteTablesClient) DeletePreparer(ctx context.Context, resourceGroupName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) DeleteSender(req *http.Request) (future RouteTablesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified route table. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// expand - expands referenced resources. -func (client RouteTablesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RouteTablesClient) GetPreparer(ctx context.Context, resourceGroupName string, routeTableName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) GetResponder(resp *http.Response) (result RouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all route tables in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client RouteTablesClient) List(ctx context.Context, resourceGroupName string) (result RouteTableListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.List") - defer func() { - sc := -1 - if result.rtlr.Response.Response != nil { - sc = result.rtlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rtlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure sending request") - return - } - - result.rtlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "List", resp, "Failure responding to request") - return - } - if result.rtlr.hasNextLink() && result.rtlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RouteTablesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) ListResponder(resp *http.Response) (result RouteTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RouteTablesClient) listNextResults(ctx context.Context, lastResults RouteTableListResult) (result RouteTableListResult, err error) { - req, err := lastResults.routeTableListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteTablesClient) ListComplete(ctx context.Context, resourceGroupName string) (result RouteTableListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all route tables in a subscription. -func (client RouteTablesClient) ListAll(ctx context.Context) (result RouteTableListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.ListAll") - defer func() { - sc := -1 - if result.rtlr.Response.Response != nil { - sc = result.rtlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.rtlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure sending request") - return - } - - result.rtlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.rtlr.hasNextLink() && result.rtlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client RouteTablesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) ListAllResponder(resp *http.Response) (result RouteTableListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client RouteTablesClient) listAllNextResults(ctx context.Context, lastResults RouteTableListResult) (result RouteTableListResult, err error) { - req, err := lastResults.routeTableListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RouteTablesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client RouteTablesClient) ListAllComplete(ctx context.Context) (result RouteTableListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates a route table tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// routeTableName - the name of the route table. -// parameters - parameters supplied to update route table tags. -func (client RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject) (result RouteTable, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RouteTablesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, routeTableName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RouteTablesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client RouteTablesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client RouteTablesClient) UpdateTagsResponder(resp *http.Response) (result RouteTable, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routingintent.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routingintent.go deleted file mode 100644 index cafcec1b9fa6..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routingintent.go +++ /dev/null @@ -1,393 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// RoutingIntentClient is the network Client -type RoutingIntentClient struct { - BaseClient -} - -// NewRoutingIntentClient creates an instance of the RoutingIntentClient client. -func NewRoutingIntentClient(subscriptionID string) RoutingIntentClient { - return NewRoutingIntentClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewRoutingIntentClientWithBaseURI creates an instance of the RoutingIntentClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRoutingIntentClientWithBaseURI(baseURI string, subscriptionID string) RoutingIntentClient { - return RoutingIntentClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a RoutingIntent resource if it doesn't exist else updates the existing RoutingIntent. -// Parameters: -// resourceGroupName - the resource group name of the RoutingIntent. -// virtualHubName - the name of the VirtualHub. -// routingIntentName - the name of the per VirtualHub singleton Routing Intent resource. -// routingIntentParameters - parameters supplied to create or update RoutingIntent. -func (client RoutingIntentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent) (result RoutingIntentCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, routingIntentName, routingIntentParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client RoutingIntentClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string, routingIntentParameters RoutingIntent) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingIntentName": autorest.Encode("path", routingIntentName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - routingIntentParameters.Etag = nil - routingIntentParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", pathParameters), - autorest.WithJSON(routingIntentParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client RoutingIntentClient) CreateOrUpdateSender(req *http.Request) (future RoutingIntentCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client RoutingIntentClient) CreateOrUpdateResponder(resp *http.Response) (result RoutingIntent, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a RoutingIntent. -// Parameters: -// resourceGroupName - the resource group name of the RoutingIntent. -// virtualHubName - the name of the VirtualHub. -// routingIntentName - the name of the RoutingIntent. -func (client RoutingIntentClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string) (result RoutingIntentDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, routingIntentName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client RoutingIntentClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingIntentName": autorest.Encode("path", routingIntentName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client RoutingIntentClient) DeleteSender(req *http.Request) (future RoutingIntentDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client RoutingIntentClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a RoutingIntent. -// Parameters: -// resourceGroupName - the resource group name of the RoutingIntent. -// virtualHubName - the name of the VirtualHub. -// routingIntentName - the name of the RoutingIntent. -func (client RoutingIntentClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string) (result RoutingIntent, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, routingIntentName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client RoutingIntentClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routingIntentName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routingIntentName": autorest.Encode("path", routingIntentName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent/{routingIntentName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client RoutingIntentClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client RoutingIntentClient) GetResponder(resp *http.Response) (result RoutingIntent, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all RoutingIntent child resources of the VirtualHub. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client RoutingIntentClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListRoutingIntentResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.List") - defer func() { - sc := -1 - if result.lrir.Response.Response != nil { - sc = result.lrir.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lrir.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "List", resp, "Failure sending request") - return - } - - result.lrir, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "List", resp, "Failure responding to request") - return - } - if result.lrir.hasNextLink() && result.lrir.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client RoutingIntentClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routingIntent", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client RoutingIntentClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client RoutingIntentClient) ListResponder(resp *http.Response) (result ListRoutingIntentResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client RoutingIntentClient) listNextResults(ctx context.Context, lastResults ListRoutingIntentResult) (result ListRoutingIntentResult, err error) { - req, err := lastResults.listRoutingIntentResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.RoutingIntentClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.RoutingIntentClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.RoutingIntentClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client RoutingIntentClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListRoutingIntentResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RoutingIntentClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/scopeconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/scopeconnections.go deleted file mode 100644 index b08b24b972c9..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/scopeconnections.go +++ /dev/null @@ -1,408 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ScopeConnectionsClient is the network Client -type ScopeConnectionsClient struct { - BaseClient -} - -// NewScopeConnectionsClient creates an instance of the ScopeConnectionsClient client. -func NewScopeConnectionsClient(subscriptionID string) ScopeConnectionsClient { - return NewScopeConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewScopeConnectionsClientWithBaseURI creates an instance of the ScopeConnectionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewScopeConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ScopeConnectionsClient { - return ScopeConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates scope connection from Network Manager -// Parameters: -// parameters - scope connection to be created/updated. -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// scopeConnectionName - name for the cross-tenant connection. -func (client ScopeConnectionsClient) CreateOrUpdate(ctx context.Context, parameters ScopeConnection, resourceGroupName string, networkManagerName string, scopeConnectionName string) (result ScopeConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, parameters, resourceGroupName, networkManagerName, scopeConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ScopeConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, parameters ScopeConnection, resourceGroupName string, networkManagerName string, scopeConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scopeConnectionName": autorest.Encode("path", scopeConnectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ScopeConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ScopeConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ScopeConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete the pending scope connection created by this network manager. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// scopeConnectionName - name for the cross-tenant connection. -func (client ScopeConnectionsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, scopeConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ScopeConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scopeConnectionName": autorest.Encode("path", scopeConnectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ScopeConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ScopeConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get specified scope connection created by this Network Manager. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// scopeConnectionName - name for the cross-tenant connection. -func (client ScopeConnectionsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string) (result ScopeConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, scopeConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ScopeConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "scopeConnectionName": autorest.Encode("path", scopeConnectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ScopeConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ScopeConnectionsClient) GetResponder(resp *http.Response) (result ScopeConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all scope connections created by this network manager. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client ScopeConnectionsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result ScopeConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.List") - defer func() { - sc := -1 - if result.sclr.Response.Response != nil { - sc = result.sclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.ScopeConnectionsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.sclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.sclr.hasNextLink() && result.sclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ScopeConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ScopeConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ScopeConnectionsClient) ListResponder(resp *http.Response) (result ScopeConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ScopeConnectionsClient) listNextResults(ctx context.Context, lastResults ScopeConnectionListResult) (result ScopeConnectionListResult, err error) { - req, err := lastResults.scopeConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ScopeConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result ScopeConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkManagerName, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityadminconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityadminconfigurations.go deleted file mode 100644 index 4bea70a637e7..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityadminconfigurations.go +++ /dev/null @@ -1,416 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SecurityAdminConfigurationsClient is the network Client -type SecurityAdminConfigurationsClient struct { - BaseClient -} - -// NewSecurityAdminConfigurationsClient creates an instance of the SecurityAdminConfigurationsClient client. -func NewSecurityAdminConfigurationsClient(subscriptionID string) SecurityAdminConfigurationsClient { - return NewSecurityAdminConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecurityAdminConfigurationsClientWithBaseURI creates an instance of the SecurityAdminConfigurationsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewSecurityAdminConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SecurityAdminConfigurationsClient { - return SecurityAdminConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a network manager security admin configuration. -// Parameters: -// securityAdminConfiguration - the security admin configuration to create or update -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -func (client SecurityAdminConfigurationsClient) CreateOrUpdate(ctx context.Context, securityAdminConfiguration SecurityAdminConfiguration, resourceGroupName string, networkManagerName string, configurationName string) (result SecurityAdminConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SecurityAdminConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, securityAdminConfiguration SecurityAdminConfiguration, resourceGroupName string, networkManagerName string, configurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - securityAdminConfiguration.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", pathParameters), - autorest.WithJSON(securityAdminConfiguration), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityAdminConfigurationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SecurityAdminConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityAdminConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a network manager security admin configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been -// deployed, the service will do a cleanup deployment in the background, prior to the delete. -func (client SecurityAdminConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, force *bool) (result SecurityAdminConfigurationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, configurationName, force) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecurityAdminConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, force *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if force != nil { - queryParameters["force"] = autorest.Encode("query", *force) - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityAdminConfigurationsClient) DeleteSender(req *http.Request) (future SecurityAdminConfigurationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SecurityAdminConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves a network manager security admin configuration. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// configurationName - the name of the network manager Security Configuration. -func (client SecurityAdminConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string) (result SecurityAdminConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, configurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecurityAdminConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "configurationName": autorest.Encode("path", configurationName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityAdminConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SecurityAdminConfigurationsClient) GetResponder(resp *http.Response) (result SecurityAdminConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the network manager security admin configurations in a network manager, in a paginated format. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client SecurityAdminConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result SecurityAdminConfigurationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.List") - defer func() { - sc := -1 - if result.saclr.Response.Response != nil { - sc = result.saclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.SecurityAdminConfigurationsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.saclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.saclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.saclr.hasNextLink() && result.saclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SecurityAdminConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityAdminConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SecurityAdminConfigurationsClient) ListResponder(resp *http.Response) (result SecurityAdminConfigurationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SecurityAdminConfigurationsClient) listNextResults(ctx context.Context, lastResults SecurityAdminConfigurationListResult) (result SecurityAdminConfigurationListResult, err error) { - req, err := lastResults.securityAdminConfigurationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityAdminConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result SecurityAdminConfigurationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkManagerName, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitygroups.go deleted file mode 100644 index 365f7f33c536..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitygroups.go +++ /dev/null @@ -1,580 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SecurityGroupsClient is the network Client -type SecurityGroupsClient struct { - BaseClient -} - -// NewSecurityGroupsClient creates an instance of the SecurityGroupsClient client. -func NewSecurityGroupsClient(subscriptionID string) SecurityGroupsClient { - return NewSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecurityGroupsClientWithBaseURI creates an instance of the SecurityGroupsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) SecurityGroupsClient { - return SecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a network security group in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// parameters - parameters supplied to the create or update network security group operation. -func (client SecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (result SecurityGroupsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (future SecurityGroupsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -func (client SecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityGroupsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecurityGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) DeleteSender(req *http.Request) (future SecurityGroupsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// expand - expands referenced resources. -func (client SecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecurityGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) GetResponder(resp *http.Response) (result SecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all network security groups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SecurityGroupsClient) List(ctx context.Context, resourceGroupName string) (result SecurityGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.List") - defer func() { - sc := -1 - if result.sglr.Response.Response != nil { - sc = result.sglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure sending request") - return - } - - result.sglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "List", resp, "Failure responding to request") - return - } - if result.sglr.hasNextLink() && result.sglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SecurityGroupsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) ListResponder(resp *http.Response) (result SecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SecurityGroupsClient) listNextResults(ctx context.Context, lastResults SecurityGroupListResult) (result SecurityGroupListResult, err error) { - req, err := lastResults.securityGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityGroupsClient) ListComplete(ctx context.Context, resourceGroupName string) (result SecurityGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all network security groups in a subscription. -func (client SecurityGroupsClient) ListAll(ctx context.Context) (result SecurityGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.ListAll") - defer func() { - sc := -1 - if result.sglr.Response.Response != nil { - sc = result.sglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.sglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure sending request") - return - } - - result.sglr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.sglr.hasNextLink() && result.sglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client SecurityGroupsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) ListAllResponder(resp *http.Response) (result SecurityGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client SecurityGroupsClient) listAllNextResults(ctx context.Context, lastResults SecurityGroupListResult) (result SecurityGroupListResult, err error) { - req, err := lastResults.securityGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityGroupsClient) ListAllComplete(ctx context.Context) (result SecurityGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// UpdateTags updates a network security group tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// parameters - parameters supplied to update network security group tags. -func (client SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject) (result SecurityGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityGroupsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityGroupsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client SecurityGroupsClient) UpdateTagsResponder(resp *http.Response) (result SecurityGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitypartnerproviders.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitypartnerproviders.go deleted file mode 100644 index de93a91dffe5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitypartnerproviders.go +++ /dev/null @@ -1,577 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SecurityPartnerProvidersClient is the network Client -type SecurityPartnerProvidersClient struct { - BaseClient -} - -// NewSecurityPartnerProvidersClient creates an instance of the SecurityPartnerProvidersClient client. -func NewSecurityPartnerProvidersClient(subscriptionID string) SecurityPartnerProvidersClient { - return NewSecurityPartnerProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecurityPartnerProvidersClientWithBaseURI creates an instance of the SecurityPartnerProvidersClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewSecurityPartnerProvidersClientWithBaseURI(baseURI string, subscriptionID string) SecurityPartnerProvidersClient { - return SecurityPartnerProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Security Partner Provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// securityPartnerProviderName - the name of the Security Partner Provider. -// parameters - parameters supplied to the create or update Security Partner Provider operation. -func (client SecurityPartnerProvidersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider) (result SecurityPartnerProvidersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, securityPartnerProviderName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SecurityPartnerProvidersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters SecurityPartnerProvider) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityPartnerProviderName": autorest.Encode("path", securityPartnerProviderName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) CreateOrUpdateSender(req *http.Request) (future SecurityPartnerProvidersCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityPartnerProvider, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Security Partner Provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// securityPartnerProviderName - the name of the Security Partner Provider. -func (client SecurityPartnerProvidersClient) Delete(ctx context.Context, resourceGroupName string, securityPartnerProviderName string) (result SecurityPartnerProvidersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, securityPartnerProviderName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecurityPartnerProvidersClient) DeletePreparer(ctx context.Context, resourceGroupName string, securityPartnerProviderName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityPartnerProviderName": autorest.Encode("path", securityPartnerProviderName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) DeleteSender(req *http.Request) (future SecurityPartnerProvidersDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Security Partner Provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// securityPartnerProviderName - the name of the Security Partner Provider. -func (client SecurityPartnerProvidersClient) Get(ctx context.Context, resourceGroupName string, securityPartnerProviderName string) (result SecurityPartnerProvider, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, securityPartnerProviderName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecurityPartnerProvidersClient) GetPreparer(ctx context.Context, resourceGroupName string, securityPartnerProviderName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityPartnerProviderName": autorest.Encode("path", securityPartnerProviderName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) GetResponder(resp *http.Response) (result SecurityPartnerProvider, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the Security Partner Providers in a subscription. -func (client SecurityPartnerProvidersClient) List(ctx context.Context) (result SecurityPartnerProviderListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.List") - defer func() { - sc := -1 - if result.spplr.Response.Response != nil { - sc = result.spplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.spplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "List", resp, "Failure sending request") - return - } - - result.spplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "List", resp, "Failure responding to request") - return - } - if result.spplr.hasNextLink() && result.spplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SecurityPartnerProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/securityPartnerProviders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) ListResponder(resp *http.Response) (result SecurityPartnerProviderListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SecurityPartnerProvidersClient) listNextResults(ctx context.Context, lastResults SecurityPartnerProviderListResult) (result SecurityPartnerProviderListResult, err error) { - req, err := lastResults.securityPartnerProviderListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityPartnerProvidersClient) ListComplete(ctx context.Context) (result SecurityPartnerProviderListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all Security Partner Providers in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SecurityPartnerProvidersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SecurityPartnerProviderListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.spplr.Response.Response != nil { - sc = result.spplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.spplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.spplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.spplr.hasNextLink() && result.spplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SecurityPartnerProvidersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) ListByResourceGroupResponder(resp *http.Response) (result SecurityPartnerProviderListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SecurityPartnerProvidersClient) listByResourceGroupNextResults(ctx context.Context, lastResults SecurityPartnerProviderListResult) (result SecurityPartnerProviderListResult, err error) { - req, err := lastResults.securityPartnerProviderListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityPartnerProvidersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SecurityPartnerProviderListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates tags of a Security Partner Provider resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// securityPartnerProviderName - the name of the Security Partner Provider. -// parameters - parameters supplied to update Security Partner Provider tags. -func (client SecurityPartnerProvidersClient) UpdateTags(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject) (result SecurityPartnerProvider, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProvidersClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, securityPartnerProviderName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client SecurityPartnerProvidersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, securityPartnerProviderName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityPartnerProviderName": autorest.Encode("path", securityPartnerProviderName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityPartnerProvidersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client SecurityPartnerProvidersClient) UpdateTagsResponder(resp *http.Response) (result SecurityPartnerProvider, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityrules.go deleted file mode 100644 index 744c7cea7023..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityrules.go +++ /dev/null @@ -1,392 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SecurityRulesClient is the network Client -type SecurityRulesClient struct { - BaseClient -} - -// NewSecurityRulesClient creates an instance of the SecurityRulesClient client. -func NewSecurityRulesClient(subscriptionID string) SecurityRulesClient { - return NewSecurityRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSecurityRulesClientWithBaseURI creates an instance of the SecurityRulesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) SecurityRulesClient { - return SecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a security rule in the specified network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// securityRuleName - the name of the security rule. -// securityRuleParameters - parameters supplied to the create or update network security rule operation. -func (client SecurityRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (result SecurityRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityRuleName": autorest.Encode("path", securityRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - securityRuleParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters), - autorest.WithJSON(securityRuleParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityRulesClient) CreateOrUpdateSender(req *http.Request) (future SecurityRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network security rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// securityRuleName - the name of the security rule. -func (client SecurityRulesClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SecurityRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityRuleName": autorest.Encode("path", securityRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityRulesClient) DeleteSender(req *http.Request) (future SecurityRulesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the specified network security rule. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -// securityRuleName - the name of the security rule. -func (client SecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SecurityRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "securityRuleName": autorest.Encode("path", securityRuleName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all security rules in a network security group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkSecurityGroupName - the name of the network security group. -func (client SecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.List") - defer func() { - sc := -1 - if result.srlr.Response.Response != nil { - sc = result.srlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.srlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure sending request") - return - } - - result.srlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "List", resp, "Failure responding to request") - return - } - if result.srlr.hasNextLink() && result.srlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SecurityRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SecurityRulesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SecurityRulesClient) listNextResults(ctx context.Context, lastResults SecurityRuleListResult) (result SecurityRuleListResult, err error) { - req, err := lastResults.securityRuleListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SecurityRulesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SecurityRulesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecurityRulesClient) ListComplete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRulesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkSecurityGroupName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceassociationlinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceassociationlinks.go deleted file mode 100644 index c36939d2c79f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceassociationlinks.go +++ /dev/null @@ -1,110 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceAssociationLinksClient is the network Client -type ServiceAssociationLinksClient struct { - BaseClient -} - -// NewServiceAssociationLinksClient creates an instance of the ServiceAssociationLinksClient client. -func NewServiceAssociationLinksClient(subscriptionID string) ServiceAssociationLinksClient { - return NewServiceAssociationLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceAssociationLinksClientWithBaseURI creates an instance of the ServiceAssociationLinksClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewServiceAssociationLinksClientWithBaseURI(baseURI string, subscriptionID string) ServiceAssociationLinksClient { - return ServiceAssociationLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of service association links for a subnet. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -func (client ServiceAssociationLinksClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result ServiceAssociationLinksListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceAssociationLinksClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceAssociationLinksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceAssociationLinksClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceAssociationLinksClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceAssociationLinksClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/ServiceAssociationLinks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceAssociationLinksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServiceAssociationLinksClient) ListResponder(resp *http.Response) (result ServiceAssociationLinksListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicies.go deleted file mode 100644 index 4b74b9fff16e..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicies.go +++ /dev/null @@ -1,582 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceEndpointPoliciesClient is the network Client -type ServiceEndpointPoliciesClient struct { - BaseClient -} - -// NewServiceEndpointPoliciesClient creates an instance of the ServiceEndpointPoliciesClient client. -func NewServiceEndpointPoliciesClient(subscriptionID string) ServiceEndpointPoliciesClient { - return NewServiceEndpointPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceEndpointPoliciesClientWithBaseURI creates an instance of the ServiceEndpointPoliciesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewServiceEndpointPoliciesClientWithBaseURI(baseURI string, subscriptionID string) ServiceEndpointPoliciesClient { - return ServiceEndpointPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a service Endpoint Policies. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -// parameters - parameters supplied to the create or update service endpoint policy operation. -func (client ServiceEndpointPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy) (result ServiceEndpointPoliciesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceEndpointPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServiceEndpointPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters ServiceEndpointPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Kind = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) CreateOrUpdateSender(req *http.Request) (future ServiceEndpointPoliciesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified service endpoint policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -func (client ServiceEndpointPoliciesClient) Delete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (result ServiceEndpointPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceEndpointPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServiceEndpointPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) DeleteSender(req *http.Request) (future ServiceEndpointPoliciesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified service Endpoint Policies in a specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -// expand - expands referenced resources. -func (client ServiceEndpointPoliciesClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, expand string) (result ServiceEndpointPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceEndpointPolicyName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServiceEndpointPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) GetResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the service endpoint policies in a subscription. -func (client ServiceEndpointPoliciesClient) List(ctx context.Context) (result ServiceEndpointPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.List") - defer func() { - sc := -1 - if result.seplr.Response.Response != nil { - sc = result.seplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.seplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "List", resp, "Failure sending request") - return - } - - result.seplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "List", resp, "Failure responding to request") - return - } - if result.seplr.hasNextLink() && result.seplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceEndpointPoliciesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) ListResponder(resp *http.Response) (result ServiceEndpointPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ServiceEndpointPoliciesClient) listNextResults(ctx context.Context, lastResults ServiceEndpointPolicyListResult) (result ServiceEndpointPolicyListResult, err error) { - req, err := lastResults.serviceEndpointPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceEndpointPoliciesClient) ListComplete(ctx context.Context) (result ServiceEndpointPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets all service endpoint Policies in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ServiceEndpointPoliciesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServiceEndpointPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.seplr.Response.Response != nil { - sc = result.seplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.seplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.seplr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.seplr.hasNextLink() && result.seplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ServiceEndpointPoliciesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceEndpointPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ServiceEndpointPoliciesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServiceEndpointPolicyListResult) (result ServiceEndpointPolicyListResult, err error) { - req, err := lastResults.serviceEndpointPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceEndpointPoliciesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ServiceEndpointPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates tags of a service endpoint policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -// parameters - parameters supplied to update service endpoint policy tags. -func (client ServiceEndpointPoliciesClient) UpdateTags(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject) (result ServiceEndpointPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPoliciesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, serviceEndpointPolicyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client ServiceEndpointPoliciesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPoliciesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPoliciesClient) UpdateTagsResponder(resp *http.Response) (result ServiceEndpointPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicydefinitions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicydefinitions.go deleted file mode 100644 index 5206cad37abd..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicydefinitions.go +++ /dev/null @@ -1,394 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceEndpointPolicyDefinitionsClient is the network Client -type ServiceEndpointPolicyDefinitionsClient struct { - BaseClient -} - -// NewServiceEndpointPolicyDefinitionsClient creates an instance of the ServiceEndpointPolicyDefinitionsClient client. -func NewServiceEndpointPolicyDefinitionsClient(subscriptionID string) ServiceEndpointPolicyDefinitionsClient { - return NewServiceEndpointPolicyDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceEndpointPolicyDefinitionsClientWithBaseURI creates an instance of the -// ServiceEndpointPolicyDefinitionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewServiceEndpointPolicyDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) ServiceEndpointPolicyDefinitionsClient { - return ServiceEndpointPolicyDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a service endpoint policy definition in the specified service endpoint policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy. -// serviceEndpointPolicyDefinitionName - the name of the service endpoint policy definition name. -// serviceEndpointPolicyDefinitions - parameters supplied to the create or update service endpoint policy -// operation. -func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition) (result ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName, serviceEndpointPolicyDefinitions) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string, serviceEndpointPolicyDefinitions ServiceEndpointPolicyDefinition) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyDefinitionName": autorest.Encode("path", serviceEndpointPolicyDefinitionName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - serviceEndpointPolicyDefinitions.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", pathParameters), - autorest.WithJSON(serviceEndpointPolicyDefinitions), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateSender(req *http.Request) (future ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceEndpointPolicyDefinition, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified ServiceEndpoint policy definitions. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the Service Endpoint Policy. -// serviceEndpointPolicyDefinitionName - the name of the service endpoint policy definition. -func (client ServiceEndpointPolicyDefinitionsClient) Delete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) (result ServiceEndpointPolicyDefinitionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ServiceEndpointPolicyDefinitionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyDefinitionName": autorest.Encode("path", serviceEndpointPolicyDefinitionName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPolicyDefinitionsClient) DeleteSender(req *http.Request) (future ServiceEndpointPolicyDefinitionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPolicyDefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get the specified service endpoint policy definitions from service endpoint policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy name. -// serviceEndpointPolicyDefinitionName - the name of the service endpoint policy definition name. -func (client ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) (result ServiceEndpointPolicyDefinition, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ServiceEndpointPolicyDefinitionsClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyDefinitionName": autorest.Encode("path", serviceEndpointPolicyDefinitionName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions/{serviceEndpointPolicyDefinitionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPolicyDefinitionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPolicyDefinitionsClient) GetResponder(resp *http.Response) (result ServiceEndpointPolicyDefinition, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup gets all service endpoint policy definitions in a service end point policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceEndpointPolicyName - the name of the service endpoint policy name. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (result ServiceEndpointPolicyDefinitionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.sepdlr.Response.Response != nil { - sc = result.sepdlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, serviceEndpointPolicyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.sepdlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.sepdlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.sepdlr.hasNextLink() && result.sepdlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceEndpointPolicyName": autorest.Encode("path", serviceEndpointPolicyName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceEndpointPolicyDefinitionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ServiceEndpointPolicyDefinitionsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServiceEndpointPolicyDefinitionListResult) (result ServiceEndpointPolicyDefinitionListResult, err error) { - req, err := lastResults.serviceEndpointPolicyDefinitionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, serviceEndpointPolicyName string) (result ServiceEndpointPolicyDefinitionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, serviceEndpointPolicyName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetaginformation.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetaginformation.go deleted file mode 100644 index b57f55295f0a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetaginformation.go +++ /dev/null @@ -1,158 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceTagInformationClient is the network Client -type ServiceTagInformationClient struct { - BaseClient -} - -// NewServiceTagInformationClient creates an instance of the ServiceTagInformationClient client. -func NewServiceTagInformationClient(subscriptionID string) ServiceTagInformationClient { - return NewServiceTagInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceTagInformationClientWithBaseURI creates an instance of the ServiceTagInformationClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewServiceTagInformationClientWithBaseURI(baseURI string, subscriptionID string) ServiceTagInformationClient { - return ServiceTagInformationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of service tag information resources with pagination. -// Parameters: -// location - the location that will be used as a reference for cloud (not as a filter based on location, you -// will get the list of service tags with prefix details across all regions but limited to the cloud that your -// subscription belongs to). -// noAddressPrefixes - do not return address prefixes for the tag(s). -// tagName - return tag information for a particular tag. -func (client ServiceTagInformationClient) List(ctx context.Context, location string, noAddressPrefixes *bool, tagName string) (result ServiceTagInformationListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationClient.List") - defer func() { - sc := -1 - if result.stilr.Response.Response != nil { - sc = result.stilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location, noAddressPrefixes, tagName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.stilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "List", resp, "Failure sending request") - return - } - - result.stilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "List", resp, "Failure responding to request") - return - } - if result.stilr.hasNextLink() && result.stilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceTagInformationClient) ListPreparer(ctx context.Context, location string, noAddressPrefixes *bool, tagName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if noAddressPrefixes != nil { - queryParameters["noAddressPrefixes"] = autorest.Encode("query", *noAddressPrefixes) - } - if len(tagName) > 0 { - queryParameters["tagName"] = autorest.Encode("query", tagName) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTagDetails", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceTagInformationClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServiceTagInformationClient) ListResponder(resp *http.Response) (result ServiceTagInformationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ServiceTagInformationClient) listNextResults(ctx context.Context, lastResults ServiceTagInformationListResult) (result ServiceTagInformationListResult, err error) { - req, err := lastResults.serviceTagInformationListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceTagInformationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceTagInformationClient) ListComplete(ctx context.Context, location string, noAddressPrefixes *bool, tagName string) (result ServiceTagInformationListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location, noAddressPrefixes, tagName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetags.go deleted file mode 100644 index 3710ad39614b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetags.go +++ /dev/null @@ -1,107 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ServiceTagsClient is the network Client -type ServiceTagsClient struct { - BaseClient -} - -// NewServiceTagsClient creates an instance of the ServiceTagsClient client. -func NewServiceTagsClient(subscriptionID string) ServiceTagsClient { - return NewServiceTagsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewServiceTagsClientWithBaseURI creates an instance of the ServiceTagsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewServiceTagsClientWithBaseURI(baseURI string, subscriptionID string) ServiceTagsClient { - return ServiceTagsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of service tag information resources. -// Parameters: -// location - the location that will be used as a reference for version (not as a filter based on location, you -// will get the list of service tags with prefix details across all regions but limited to the cloud that your -// subscription belongs to). -func (client ServiceTagsClient) List(ctx context.Context, location string) (result ServiceTagsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceTagsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.ServiceTagsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.ServiceTagsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceTagsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/serviceTags", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceTagsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServiceTagsClient) ListResponder(resp *http.Response) (result ServiceTagsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/staticmembers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/staticmembers.go deleted file mode 100644 index 565741e30dc3..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/staticmembers.go +++ /dev/null @@ -1,415 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// StaticMembersClient is the network Client -type StaticMembersClient struct { - BaseClient -} - -// NewStaticMembersClient creates an instance of the StaticMembersClient client. -func NewStaticMembersClient(subscriptionID string) StaticMembersClient { - return NewStaticMembersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewStaticMembersClientWithBaseURI creates an instance of the StaticMembersClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewStaticMembersClientWithBaseURI(baseURI string, subscriptionID string) StaticMembersClient { - return StaticMembersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a static member. -// Parameters: -// parameters - parameters supplied to the specify the static member to create -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// networkGroupName - the name of the network group. -// staticMemberName - the name of the static member. -func (client StaticMembersClient) CreateOrUpdate(ctx context.Context, parameters StaticMember, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (result StaticMember, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, parameters, resourceGroupName, networkManagerName, networkGroupName, staticMemberName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client StaticMembersClient) CreateOrUpdatePreparer(ctx context.Context, parameters StaticMember, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkGroupName": autorest.Encode("path", networkGroupName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "staticMemberName": autorest.Encode("path", staticMemberName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client StaticMembersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client StaticMembersClient) CreateOrUpdateResponder(resp *http.Response) (result StaticMember, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a static member. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// networkGroupName - the name of the network group. -// staticMemberName - the name of the static member. -func (client StaticMembersClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client StaticMembersClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkGroupName": autorest.Encode("path", networkGroupName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "staticMemberName": autorest.Encode("path", staticMemberName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client StaticMembersClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client StaticMembersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified static member. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// networkGroupName - the name of the network group. -// staticMemberName - the name of the static member. -func (client StaticMembersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (result StaticMember, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client StaticMembersClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkGroupName": autorest.Encode("path", networkGroupName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "staticMemberName": autorest.Encode("path", staticMemberName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client StaticMembersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client StaticMembersClient) GetResponder(resp *http.Response) (result StaticMember, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists the specified static member. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkManagerName - the name of the network manager. -// networkGroupName - the name of the network group. -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client StaticMembersClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, top *int32, skipToken string) (result StaticMemberListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.List") - defer func() { - sc := -1 - if result.smlr.Response.Response != nil { - sc = result.smlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.StaticMembersClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, networkGroupName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.smlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "List", resp, "Failure sending request") - return - } - - result.smlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "List", resp, "Failure responding to request") - return - } - if result.smlr.hasNextLink() && result.smlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client StaticMembersClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkGroupName": autorest.Encode("path", networkGroupName), - "networkManagerName": autorest.Encode("path", networkManagerName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client StaticMembersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client StaticMembersClient) ListResponder(resp *http.Response) (result StaticMemberListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client StaticMembersClient) listNextResults(ctx context.Context, lastResults StaticMemberListResult) (result StaticMemberListResult, err error) { - req, err := lastResults.staticMemberListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.StaticMembersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.StaticMembersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client StaticMembersClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, top *int32, skipToken string) (result StaticMemberListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkManagerName, networkGroupName, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subnets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subnets.go deleted file mode 100644 index 3ef48cbbd0c2..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subnets.go +++ /dev/null @@ -1,564 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SubnetsClient is the network Client -type SubnetsClient struct { - BaseClient -} - -// NewSubnetsClient creates an instance of the SubnetsClient client. -func NewSubnetsClient(subscriptionID string) SubnetsClient { - return NewSubnetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSubnetsClientWithBaseURI creates an instance of the SubnetsClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsClient { - return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a subnet in the specified virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -// subnetParameters - parameters supplied to the create or update subnet operation. -func (client SubnetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet) (result SubnetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, subnetParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - subnetParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters), - autorest.WithJSON(subnetParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (future SubnetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result Subnet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified subnet. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -func (client SubnetsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result SubnetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SubnetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) DeleteSender(req *http.Request) (future SubnetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified subnet by virtual network and resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -// expand - expands referenced resources. -func (client SubnetsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SubnetsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all subnets in a virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client SubnetsClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result SubnetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.List") - defer func() { - sc := -1 - if result.slr.Response.Response != nil { - sc = result.slr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.slr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure sending request") - return - } - - result.slr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "List", resp, "Failure responding to request") - return - } - if result.slr.hasNextLink() && result.slr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SubnetsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SubnetsClient) ListResponder(resp *http.Response) (result SubnetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SubnetsClient) listNextResults(ctx context.Context, lastResults SubnetListResult) (result SubnetListResult, err error) { - req, err := lastResults.subnetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SubnetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SubnetsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result SubnetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualNetworkName) - return -} - -// PrepareNetworkPolicies prepares a subnet by applying network intent policies. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -// prepareNetworkPoliciesRequestParameters - parameters supplied to prepare subnet by applying network intent -// policies. -func (client SubnetsClient) PrepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest) (result SubnetsPrepareNetworkPoliciesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.PrepareNetworkPolicies") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PrepareNetworkPoliciesPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, prepareNetworkPoliciesRequestParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "PrepareNetworkPolicies", nil, "Failure preparing request") - return - } - - result, err = client.PrepareNetworkPoliciesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "PrepareNetworkPolicies", result.Response(), "Failure sending request") - return - } - - return -} - -// PrepareNetworkPoliciesPreparer prepares the PrepareNetworkPolicies request. -func (client SubnetsClient) PrepareNetworkPoliciesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, prepareNetworkPoliciesRequestParameters PrepareNetworkPoliciesRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/PrepareNetworkPolicies", pathParameters), - autorest.WithJSON(prepareNetworkPoliciesRequestParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PrepareNetworkPoliciesSender sends the PrepareNetworkPolicies request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) PrepareNetworkPoliciesSender(req *http.Request) (future SubnetsPrepareNetworkPoliciesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PrepareNetworkPoliciesResponder handles the response to the PrepareNetworkPolicies request. The method always -// closes the http.Response Body. -func (client SubnetsClient) PrepareNetworkPoliciesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// UnprepareNetworkPolicies unprepares a subnet by removing network intent policies. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// subnetName - the name of the subnet. -// unprepareNetworkPoliciesRequestParameters - parameters supplied to unprepare subnet to remove network intent -// policies. -func (client SubnetsClient) UnprepareNetworkPolicies(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest) (result SubnetsUnprepareNetworkPoliciesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubnetsClient.UnprepareNetworkPolicies") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UnprepareNetworkPoliciesPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, unprepareNetworkPoliciesRequestParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "UnprepareNetworkPolicies", nil, "Failure preparing request") - return - } - - result, err = client.UnprepareNetworkPoliciesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubnetsClient", "UnprepareNetworkPolicies", result.Response(), "Failure sending request") - return - } - - return -} - -// UnprepareNetworkPoliciesPreparer prepares the UnprepareNetworkPolicies request. -func (client SubnetsClient) UnprepareNetworkPoliciesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, unprepareNetworkPoliciesRequestParameters UnprepareNetworkPoliciesRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subnetName": autorest.Encode("path", subnetName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}/UnprepareNetworkPolicies", pathParameters), - autorest.WithJSON(unprepareNetworkPoliciesRequestParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UnprepareNetworkPoliciesSender sends the UnprepareNetworkPolicies request. The method will close the -// http.Response Body if it receives an error. -func (client SubnetsClient) UnprepareNetworkPoliciesSender(req *http.Request) (future SubnetsUnprepareNetworkPoliciesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UnprepareNetworkPoliciesResponder handles the response to the UnprepareNetworkPolicies request. The method always -// closes the http.Response Body. -func (client SubnetsClient) UnprepareNetworkPoliciesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subscriptionnetworkmanagerconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subscriptionnetworkmanagerconnections.go deleted file mode 100644 index 41256f35bde7..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subscriptionnetworkmanagerconnections.go +++ /dev/null @@ -1,393 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SubscriptionNetworkManagerConnectionsClient is the network Client -type SubscriptionNetworkManagerConnectionsClient struct { - BaseClient -} - -// NewSubscriptionNetworkManagerConnectionsClient creates an instance of the -// SubscriptionNetworkManagerConnectionsClient client. -func NewSubscriptionNetworkManagerConnectionsClient(subscriptionID string) SubscriptionNetworkManagerConnectionsClient { - return NewSubscriptionNetworkManagerConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSubscriptionNetworkManagerConnectionsClientWithBaseURI creates an instance of the -// SubscriptionNetworkManagerConnectionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSubscriptionNetworkManagerConnectionsClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionNetworkManagerConnectionsClient { - return SubscriptionNetworkManagerConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create a network manager connection on this subscription. -// Parameters: -// parameters - network manager connection to be created/updated. -// networkManagerConnectionName - name for the network manager connection. -func (client SubscriptionNetworkManagerConnectionsClient) CreateOrUpdate(ctx context.Context, parameters ManagerConnection, networkManagerConnectionName string) (result ManagerConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, parameters, networkManagerConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SubscriptionNetworkManagerConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, parameters ManagerConnection, networkManagerConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.SystemData = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SubscriptionNetworkManagerConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SubscriptionNetworkManagerConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagerConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete specified connection created by this subscription. -// Parameters: -// networkManagerConnectionName - name for the network manager connection. -func (client SubscriptionNetworkManagerConnectionsClient) Delete(ctx context.Context, networkManagerConnectionName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, networkManagerConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SubscriptionNetworkManagerConnectionsClient) DeletePreparer(ctx context.Context, networkManagerConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SubscriptionNetworkManagerConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SubscriptionNetworkManagerConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get a specified connection created by this subscription. -// Parameters: -// networkManagerConnectionName - name for the network manager connection. -func (client SubscriptionNetworkManagerConnectionsClient) Get(ctx context.Context, networkManagerConnectionName string) (result ManagerConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, networkManagerConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SubscriptionNetworkManagerConnectionsClient) GetPreparer(ctx context.Context, networkManagerConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SubscriptionNetworkManagerConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SubscriptionNetworkManagerConnectionsClient) GetResponder(resp *http.Response) (result ManagerConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all network manager connections created by this subscription. -// Parameters: -// top - an optional query parameter which specifies the maximum number of records to be returned by the -// server. -// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response -// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that -// specifies a starting point to use for subsequent calls. -func (client SubscriptionNetworkManagerConnectionsClient) List(ctx context.Context, top *int32, skipToken string) (result ManagerConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.List") - defer func() { - sc := -1 - if result.mclr.Response.Response != nil { - sc = result.mclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, - {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.SubscriptionNetworkManagerConnectionsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.mclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.mclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.mclr.hasNextLink() && result.mclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SubscriptionNetworkManagerConnectionsClient) ListPreparer(ctx context.Context, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["$skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SubscriptionNetworkManagerConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SubscriptionNetworkManagerConnectionsClient) ListResponder(resp *http.Response) (result ManagerConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SubscriptionNetworkManagerConnectionsClient) listNextResults(ctx context.Context, lastResults ManagerConnectionListResult) (result ManagerConnectionListResult, err error) { - req, err := lastResults.managerConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SubscriptionNetworkManagerConnectionsClient) ListComplete(ctx context.Context, top *int32, skipToken string) (result ManagerConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, top, skipToken) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/usages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/usages.go deleted file mode 100644 index 724cb1157826..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/usages.go +++ /dev/null @@ -1,154 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsagesClient is the network Client -type UsagesClient struct { - BaseClient -} - -// NewUsagesClient creates an instance of the UsagesClient client. -func NewUsagesClient(subscriptionID string) UsagesClient { - return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { - return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List list network usages for a subscription. -// Parameters: -// location - the location where resource usage is queried. -func (client UsagesClient) List(ctx context.Context, location string) (result UsagesListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") - defer func() { - sc := -1 - if result.ulr.Response.Response != nil { - sc = result.ulr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._ ]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.UsagesClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ulr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure sending request") - return - } - - result.ulr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.UsagesClient", "List", resp, "Failure responding to request") - return - } - if result.ulr.hasNextLink() && result.ulr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsagesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client UsagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsagesClient) ListResponder(resp *http.Response) (result UsagesListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client UsagesClient) listNextResults(ctx context.Context, lastResults UsagesListResult) (result UsagesListResult, err error) { - req, err := lastResults.usagesListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.UsagesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.UsagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.UsagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsagesClient) ListComplete(ctx context.Context, location string) (result UsagesListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/version.go deleted file mode 100644 index 0bc5ef088911..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package network - -import "github.com/Azure/azure-sdk-for-go/version" - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " network/2022-07-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vipswap.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vipswap.go deleted file mode 100644 index cc1f1ea744c5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vipswap.go +++ /dev/null @@ -1,272 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VipSwapClient is the network Client -type VipSwapClient struct { - BaseClient -} - -// NewVipSwapClient creates an instance of the VipSwapClient client. -func NewVipSwapClient(subscriptionID string) VipSwapClient { - return NewVipSwapClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVipSwapClientWithBaseURI creates an instance of the VipSwapClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVipSwapClientWithBaseURI(baseURI string, subscriptionID string) VipSwapClient { - return VipSwapClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Create performs vip swap operation on swappable cloud services. -// Parameters: -// groupName - the name of the resource group. -// resourceName - the name of the cloud service. -// parameters - swapResource object where slot type should be the target slot after vip swap for the specified -// cloud service. -func (client VipSwapClient) Create(ctx context.Context, groupName string, resourceName string, parameters SwapResource) (result VipSwapCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VipSwapClient.Create") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreatePreparer(ctx, groupName, resourceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client VipSwapClient) CreatePreparer(ctx context.Context, groupName string, resourceName string, parameters SwapResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "groupName": autorest.Encode("path", groupName), - "resourceName": autorest.Encode("path", resourceName), - "singletonResource": autorest.Encode("path", "swap"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.ID = nil - parameters.Name = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client VipSwapClient) CreateSender(req *http.Request) (future VipSwapCreateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client VipSwapClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud -// service can either be Staging or Production -// Parameters: -// groupName - the name of the resource group. -// resourceName - the name of the cloud service. -func (client VipSwapClient) Get(ctx context.Context, groupName string, resourceName string) (result SwapResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VipSwapClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, groupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VipSwapClient) GetPreparer(ctx context.Context, groupName string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "groupName": autorest.Encode("path", groupName), - "resourceName": autorest.Encode("path", resourceName), - "singletonResource": autorest.Encode("path", "swap"), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VipSwapClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VipSwapClient) GetResponder(resp *http.Response) (result SwapResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on -// a cloud service can either be Staging or Production -// Parameters: -// groupName - the name of the resource group. -// resourceName - the name of the cloud service. -func (client VipSwapClient) List(ctx context.Context, groupName string, resourceName string) (result SwapResourceListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VipSwapClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, groupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VipSwapClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VipSwapClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VipSwapClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VipSwapClient) ListPreparer(ctx context.Context, groupName string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "groupName": autorest.Encode("path", groupName), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VipSwapClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VipSwapClient) ListResponder(resp *http.Response) (result SwapResourceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliances.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliances.go deleted file mode 100644 index 97d9fb25a9b5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliances.go +++ /dev/null @@ -1,593 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualAppliancesClient is the network Client -type VirtualAppliancesClient struct { - BaseClient -} - -// NewVirtualAppliancesClient creates an instance of the VirtualAppliancesClient client. -func NewVirtualAppliancesClient(subscriptionID string) VirtualAppliancesClient { - return NewVirtualAppliancesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualAppliancesClientWithBaseURI creates an instance of the VirtualAppliancesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualAppliancesClientWithBaseURI(baseURI string, subscriptionID string) VirtualAppliancesClient { - return VirtualAppliancesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Network Virtual Appliance. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of Network Virtual Appliance. -// parameters - parameters supplied to the create or update Network Virtual Appliance. -func (client VirtualAppliancesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance) (result VirtualAppliancesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualAppliancePropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualAppliancePropertiesFormat.VirtualApplianceAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualAppliancePropertiesFormat.VirtualApplianceAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualAppliancePropertiesFormat.VirtualApplianceAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualAppliancesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkVirtualApplianceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualAppliancesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters VirtualAppliance) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) CreateOrUpdateSender(req *http.Request) (future VirtualAppliancesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualAppliance, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Network Virtual Appliance. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of Network Virtual Appliance. -func (client VirtualAppliancesClient) Delete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (result VirtualAppliancesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkVirtualApplianceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualAppliancesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) DeleteSender(req *http.Request) (future VirtualAppliancesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Network Virtual Appliance. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of Network Virtual Appliance. -// expand - expands referenced resources. -func (client VirtualAppliancesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, expand string) (result VirtualAppliance, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkVirtualApplianceName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualAppliancesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) GetResponder(resp *http.Response) (result VirtualAppliance, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all Network Virtual Appliances in a subscription. -func (client VirtualAppliancesClient) List(ctx context.Context) (result VirtualApplianceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.List") - defer func() { - sc := -1 - if result.valr.Response.Response != nil { - sc = result.valr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.valr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "List", resp, "Failure sending request") - return - } - - result.valr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "List", resp, "Failure responding to request") - return - } - if result.valr.hasNextLink() && result.valr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualAppliancesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualAppliances", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) ListResponder(resp *http.Response) (result VirtualApplianceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualAppliancesClient) listNextResults(ctx context.Context, lastResults VirtualApplianceListResult) (result VirtualApplianceListResult, err error) { - req, err := lastResults.virtualApplianceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualAppliancesClient) ListComplete(ctx context.Context) (result VirtualApplianceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all Network Virtual Appliances in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualAppliancesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result VirtualApplianceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.valr.Response.Response != nil { - sc = result.valr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.valr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.valr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.valr.hasNextLink() && result.valr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualAppliancesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualApplianceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualAppliancesClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualApplianceListResult) (result VirtualApplianceListResult, err error) { - req, err := lastResults.virtualApplianceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualAppliancesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result VirtualApplianceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates a Network Virtual Appliance. -// Parameters: -// resourceGroupName - the resource group name of Network Virtual Appliance. -// networkVirtualApplianceName - the name of Network Virtual Appliance being updated. -// parameters - parameters supplied to Update Network Virtual Appliance Tags. -func (client VirtualAppliancesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject) (result VirtualAppliance, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualAppliancesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkVirtualApplianceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualAppliancesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualAppliancesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualAppliancesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualAppliancesClient) UpdateTagsResponder(resp *http.Response) (result VirtualAppliance, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliancesites.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliancesites.go deleted file mode 100644 index 1a9d2668582c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliancesites.go +++ /dev/null @@ -1,394 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualApplianceSitesClient is the network Client -type VirtualApplianceSitesClient struct { - BaseClient -} - -// NewVirtualApplianceSitesClient creates an instance of the VirtualApplianceSitesClient client. -func NewVirtualApplianceSitesClient(subscriptionID string) VirtualApplianceSitesClient { - return NewVirtualApplianceSitesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualApplianceSitesClientWithBaseURI creates an instance of the VirtualApplianceSitesClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualApplianceSitesClientWithBaseURI(baseURI string, subscriptionID string) VirtualApplianceSitesClient { - return VirtualApplianceSitesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Network Virtual Appliance Site. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -// siteName - the name of the site. -// parameters - parameters supplied to the create or update Network Virtual Appliance Site operation. -func (client VirtualApplianceSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite) (result VirtualApplianceSitesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkVirtualApplianceName, siteName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualApplianceSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string, parameters VirtualApplianceSite) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteName": autorest.Encode("path", siteName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSitesClient) CreateOrUpdateSender(req *http.Request) (future VirtualApplianceSitesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualApplianceSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified site from a Virtual Appliance. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -// siteName - the name of the site. -func (client VirtualApplianceSitesClient) Delete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string) (result VirtualApplianceSitesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkVirtualApplianceName, siteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualApplianceSitesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteName": autorest.Encode("path", siteName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSitesClient) DeleteSender(req *http.Request) (future VirtualApplianceSitesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Virtual Appliance Site. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -// siteName - the name of the site. -func (client VirtualApplianceSitesClient) Get(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string) (result VirtualApplianceSite, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkVirtualApplianceName, siteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualApplianceSitesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string, siteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "siteName": autorest.Encode("path", siteName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites/{siteName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSitesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSitesClient) GetResponder(resp *http.Response) (result VirtualApplianceSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Network Virtual Appliance Sites in a Network Virtual Appliance resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkVirtualApplianceName - the name of the Network Virtual Appliance. -func (client VirtualApplianceSitesClient) List(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (result VirtualApplianceSiteListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.List") - defer func() { - sc := -1 - if result.vaslr.Response.Response != nil { - sc = result.vaslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, networkVirtualApplianceName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vaslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "List", resp, "Failure sending request") - return - } - - result.vaslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "List", resp, "Failure responding to request") - return - } - if result.vaslr.hasNextLink() && result.vaslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualApplianceSitesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkVirtualApplianceName": autorest.Encode("path", networkVirtualApplianceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkVirtualAppliances/{networkVirtualApplianceName}/virtualApplianceSites", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSitesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSitesClient) ListResponder(resp *http.Response) (result VirtualApplianceSiteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualApplianceSitesClient) listNextResults(ctx context.Context, lastResults VirtualApplianceSiteListResult) (result VirtualApplianceSiteListResult, err error) { - req, err := lastResults.virtualApplianceSiteListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSitesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualApplianceSitesClient) ListComplete(ctx context.Context, resourceGroupName string, networkVirtualApplianceName string) (result VirtualApplianceSiteListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSitesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, networkVirtualApplianceName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualapplianceskus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualapplianceskus.go deleted file mode 100644 index 3da40524df86..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualapplianceskus.go +++ /dev/null @@ -1,219 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualApplianceSkusClient is the network Client -type VirtualApplianceSkusClient struct { - BaseClient -} - -// NewVirtualApplianceSkusClient creates an instance of the VirtualApplianceSkusClient client. -func NewVirtualApplianceSkusClient(subscriptionID string) VirtualApplianceSkusClient { - return NewVirtualApplianceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualApplianceSkusClientWithBaseURI creates an instance of the VirtualApplianceSkusClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualApplianceSkusClientWithBaseURI(baseURI string, subscriptionID string) VirtualApplianceSkusClient { - return VirtualApplianceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves a single available sku for network virtual appliance. -// Parameters: -// skuName - name of the Sku. -func (client VirtualApplianceSkusClient) Get(ctx context.Context, skuName string) (result VirtualApplianceSku, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkusClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, skuName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualApplianceSkusClient) GetPreparer(ctx context.Context, skuName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "skuName": autorest.Encode("path", skuName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus/{skuName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSkusClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSkusClient) GetResponder(resp *http.Response) (result VirtualApplianceSku, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list all SKUs available for a virtual appliance. -func (client VirtualApplianceSkusClient) List(ctx context.Context) (result VirtualApplianceSkuListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkusClient.List") - defer func() { - sc := -1 - if result.vaslr.Response.Response != nil { - sc = result.vaslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vaslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "List", resp, "Failure sending request") - return - } - - result.vaslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "List", resp, "Failure responding to request") - return - } - if result.vaslr.hasNextLink() && result.vaslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualApplianceSkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkVirtualApplianceSkus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualApplianceSkusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualApplianceSkusClient) ListResponder(resp *http.Response) (result VirtualApplianceSkuListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualApplianceSkusClient) listNextResults(ctx context.Context, lastResults VirtualApplianceSkuListResult) (result VirtualApplianceSkuListResult, err error) { - req, err := lastResults.virtualApplianceSkuListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualApplianceSkusClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualApplianceSkusClient) ListComplete(ctx context.Context) (result VirtualApplianceSkuListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceSkusClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnection.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnection.go deleted file mode 100644 index 766d33159755..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnection.go +++ /dev/null @@ -1,289 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubBgpConnectionClient is the network Client -type VirtualHubBgpConnectionClient struct { - BaseClient -} - -// NewVirtualHubBgpConnectionClient creates an instance of the VirtualHubBgpConnectionClient client. -func NewVirtualHubBgpConnectionClient(subscriptionID string) VirtualHubBgpConnectionClient { - return NewVirtualHubBgpConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubBgpConnectionClientWithBaseURI creates an instance of the VirtualHubBgpConnectionClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualHubBgpConnectionClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubBgpConnectionClient { - return VirtualHubBgpConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualHubBgpConnection resource if it doesn't exist else updates the existing -// VirtualHubBgpConnection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the connection. -// parameters - parameters of Bgp connection. -func (client VirtualHubBgpConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection) (result VirtualHubBgpConnectionCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.BgpConnectionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BgpConnectionProperties.PeerAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.BgpConnectionProperties.PeerAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.BgpConnectionProperties.PeerAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualHubBgpConnectionClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, connectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualHubBgpConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string, parameters BgpConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubBgpConnectionCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionClient) CreateOrUpdateResponder(resp *http.Response) (result BgpConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualHubBgpConnection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHubBgpConnection. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the connection. -func (client VirtualHubBgpConnectionClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result VirtualHubBgpConnectionDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualHubBgpConnectionClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionClient) DeleteSender(req *http.Request) (future VirtualHubBgpConnectionDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a Virtual Hub Bgp Connection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// connectionName - the name of the connection. -func (client VirtualHubBgpConnectionClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (result BgpConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualHubBgpConnectionClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionClient) GetResponder(resp *http.Response) (result BgpConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnections.go deleted file mode 100644 index 430cb12af99b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnections.go +++ /dev/null @@ -1,312 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubBgpConnectionsClient is the network Client -type VirtualHubBgpConnectionsClient struct { - BaseClient -} - -// NewVirtualHubBgpConnectionsClient creates an instance of the VirtualHubBgpConnectionsClient client. -func NewVirtualHubBgpConnectionsClient(subscriptionID string) VirtualHubBgpConnectionsClient { - return NewVirtualHubBgpConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubBgpConnectionsClientWithBaseURI creates an instance of the VirtualHubBgpConnectionsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualHubBgpConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubBgpConnectionsClient { - return VirtualHubBgpConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List retrieves the details of all VirtualHubBgpConnections. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubBgpConnectionsClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubBgpConnectionResultsPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionsClient.List") - defer func() { - sc := -1 - if result.lvhbcr.Response.Response != nil { - sc = result.lvhbcr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvhbcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.lvhbcr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.lvhbcr.hasNextLink() && result.lvhbcr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualHubBgpConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/bgpConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionsClient) ListResponder(resp *http.Response) (result ListVirtualHubBgpConnectionResults, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualHubBgpConnectionsClient) listNextResults(ctx context.Context, lastResults ListVirtualHubBgpConnectionResults) (result ListVirtualHubBgpConnectionResults, err error) { - req, err := lastResults.listVirtualHubBgpConnectionResultsPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubBgpConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubBgpConnectionResultsIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} - -// ListAdvertisedRoutes retrieves a list of routes the virtual hub bgp connection is advertising to the specified peer. -// Parameters: -// resourceGroupName - the name of the resource group. -// hubName - the name of the virtual hub. -// connectionName - the name of the virtual hub bgp connection. -func (client VirtualHubBgpConnectionsClient) ListAdvertisedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string) (result VirtualHubBgpConnectionsListAdvertisedRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionsClient.ListAdvertisedRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAdvertisedRoutesPreparer(ctx, resourceGroupName, hubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "ListAdvertisedRoutes", nil, "Failure preparing request") - return - } - - result, err = client.ListAdvertisedRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "ListAdvertisedRoutes", result.Response(), "Failure sending request") - return - } - - return -} - -// ListAdvertisedRoutesPreparer prepares the ListAdvertisedRoutes request. -func (client VirtualHubBgpConnectionsClient) ListAdvertisedRoutesPreparer(ctx context.Context, resourceGroupName string, hubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "hubName": autorest.Encode("path", hubName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/advertisedRoutes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAdvertisedRoutesSender sends the ListAdvertisedRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionsClient) ListAdvertisedRoutesSender(req *http.Request) (future VirtualHubBgpConnectionsListAdvertisedRoutesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListAdvertisedRoutesResponder handles the response to the ListAdvertisedRoutes request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionsClient) ListAdvertisedRoutesResponder(resp *http.Response) (result PeerRouteList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListLearnedRoutes retrieves a list of routes the virtual hub bgp connection has learned. -// Parameters: -// resourceGroupName - the name of the resource group. -// hubName - the name of the virtual hub. -// connectionName - the name of the virtual hub bgp connection. -func (client VirtualHubBgpConnectionsClient) ListLearnedRoutes(ctx context.Context, resourceGroupName string, hubName string, connectionName string) (result VirtualHubBgpConnectionsListLearnedRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubBgpConnectionsClient.ListLearnedRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListLearnedRoutesPreparer(ctx, resourceGroupName, hubName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "ListLearnedRoutes", nil, "Failure preparing request") - return - } - - result, err = client.ListLearnedRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubBgpConnectionsClient", "ListLearnedRoutes", result.Response(), "Failure sending request") - return - } - - return -} - -// ListLearnedRoutesPreparer prepares the ListLearnedRoutes request. -func (client VirtualHubBgpConnectionsClient) ListLearnedRoutesPreparer(ctx context.Context, resourceGroupName string, hubName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "hubName": autorest.Encode("path", hubName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{hubName}/bgpConnections/{connectionName}/learnedRoutes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListLearnedRoutesSender sends the ListLearnedRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubBgpConnectionsClient) ListLearnedRoutesSender(req *http.Request) (future VirtualHubBgpConnectionsListLearnedRoutesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListLearnedRoutesResponder handles the response to the ListLearnedRoutes request. The method always -// closes the http.Response Body. -func (client VirtualHubBgpConnectionsClient) ListLearnedRoutesResponder(resp *http.Response) (result PeerRouteList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubipconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubipconfiguration.go deleted file mode 100644 index c6c84931f25c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubipconfiguration.go +++ /dev/null @@ -1,413 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubIPConfigurationClient is the network Client -type VirtualHubIPConfigurationClient struct { - BaseClient -} - -// NewVirtualHubIPConfigurationClient creates an instance of the VirtualHubIPConfigurationClient client. -func NewVirtualHubIPConfigurationClient(subscriptionID string) VirtualHubIPConfigurationClient { - return NewVirtualHubIPConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubIPConfigurationClientWithBaseURI creates an instance of the VirtualHubIPConfigurationClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualHubIPConfigurationClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubIPConfigurationClient { - return VirtualHubIPConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualHubIpConfiguration resource if it doesn't exist else updates the existing -// VirtualHubIpConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// IPConfigName - the name of the ipconfig. -// parameters - hub Ip Configuration parameters. -func (client VirtualHubIPConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string, parameters HubIPConfiguration) (result VirtualHubIPConfigurationCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - {Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.ServicePublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.HubIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.LinkedPublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualHubIPConfigurationClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, IPConfigName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualHubIPConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string, parameters HubIPConfiguration) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigName": autorest.Encode("path", IPConfigName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubIPConfigurationClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubIPConfigurationCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualHubIPConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result HubIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualHubIpConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHubBgpConnection. -// virtualHubName - the name of the VirtualHub. -// IPConfigName - the name of the ipconfig. -func (client VirtualHubIPConfigurationClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string) (result VirtualHubIPConfigurationDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, IPConfigName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualHubIPConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigName": autorest.Encode("path", IPConfigName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubIPConfigurationClient) DeleteSender(req *http.Request) (future VirtualHubIPConfigurationDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualHubIPConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a Virtual Hub Ip configuration. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// IPConfigName - the name of the ipconfig. -func (client VirtualHubIPConfigurationClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string) (result HubIPConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, IPConfigName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualHubIPConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, IPConfigName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "ipConfigName": autorest.Encode("path", IPConfigName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations/{ipConfigName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubIPConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualHubIPConfigurationClient) GetResponder(resp *http.Response) (result HubIPConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all VirtualHubIpConfigurations. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubIPConfigurationClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubIPConfigurationResultsPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.List") - defer func() { - sc := -1 - if result.lvhicr.Response.Response != nil { - sc = result.lvhicr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvhicr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "List", resp, "Failure sending request") - return - } - - result.lvhicr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "List", resp, "Failure responding to request") - return - } - if result.lvhicr.hasNextLink() && result.lvhicr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualHubIPConfigurationClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/ipConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubIPConfigurationClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualHubIPConfigurationClient) ListResponder(resp *http.Response) (result ListVirtualHubIPConfigurationResults, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualHubIPConfigurationClient) listNextResults(ctx context.Context, lastResults ListVirtualHubIPConfigurationResults) (result ListVirtualHubIPConfigurationResults, err error) { - req, err := lastResults.listVirtualHubIPConfigurationResultsPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubIPConfigurationClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubIPConfigurationClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubIPConfigurationResultsIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubIPConfigurationClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubroutetablev2s.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubroutetablev2s.go deleted file mode 100644 index 210a170e348c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubroutetablev2s.go +++ /dev/null @@ -1,394 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubRouteTableV2sClient is the network Client -type VirtualHubRouteTableV2sClient struct { - BaseClient -} - -// NewVirtualHubRouteTableV2sClient creates an instance of the VirtualHubRouteTableV2sClient client. -func NewVirtualHubRouteTableV2sClient(subscriptionID string) VirtualHubRouteTableV2sClient { - return NewVirtualHubRouteTableV2sClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubRouteTableV2sClientWithBaseURI creates an instance of the VirtualHubRouteTableV2sClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualHubRouteTableV2sClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubRouteTableV2sClient { - return VirtualHubRouteTableV2sClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualHubRouteTableV2 resource if it doesn't exist else updates the existing -// VirtualHubRouteTableV2. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the VirtualHubRouteTableV2. -// virtualHubRouteTableV2Parameters - parameters supplied to create or update VirtualHubRouteTableV2. -func (client VirtualHubRouteTableV2sClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2) (result VirtualHubRouteTableV2sCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, routeTableName, virtualHubRouteTableV2Parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualHubRouteTableV2sClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string, virtualHubRouteTableV2Parameters VirtualHubRouteTableV2) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - virtualHubRouteTableV2Parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", pathParameters), - autorest.WithJSON(virtualHubRouteTableV2Parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubRouteTableV2sClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubRouteTableV2sCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualHubRouteTableV2sClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualHubRouteTableV2, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualHubRouteTableV2. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHubRouteTableV2. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the VirtualHubRouteTableV2. -func (client VirtualHubRouteTableV2sClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (result VirtualHubRouteTableV2sDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualHubRouteTableV2sClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubRouteTableV2sClient) DeleteSender(req *http.Request) (future VirtualHubRouteTableV2sDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualHubRouteTableV2sClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VirtualHubRouteTableV2. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHubRouteTableV2. -// virtualHubName - the name of the VirtualHub. -// routeTableName - the name of the VirtualHubRouteTableV2. -func (client VirtualHubRouteTableV2sClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (result VirtualHubRouteTableV2, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, routeTableName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualHubRouteTableV2sClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeTableName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "routeTableName": autorest.Encode("path", routeTableName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables/{routeTableName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubRouteTableV2sClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualHubRouteTableV2sClient) GetResponder(resp *http.Response) (result VirtualHubRouteTableV2, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List retrieves the details of all VirtualHubRouteTableV2s. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubRouteTableV2sClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubRouteTableV2sResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.List") - defer func() { - sc := -1 - if result.lvhrtvr.Response.Response != nil { - sc = result.lvhrtvr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvhrtvr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "List", resp, "Failure sending request") - return - } - - result.lvhrtvr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "List", resp, "Failure responding to request") - return - } - if result.lvhrtvr.hasNextLink() && result.lvhrtvr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualHubRouteTableV2sClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeTables", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubRouteTableV2sClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualHubRouteTableV2sClient) ListResponder(resp *http.Response) (result ListVirtualHubRouteTableV2sResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualHubRouteTableV2sClient) listNextResults(ctx context.Context, lastResults ListVirtualHubRouteTableV2sResult) (result ListVirtualHubRouteTableV2sResult, err error) { - req, err := lastResults.listVirtualHubRouteTableV2sResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubRouteTableV2sClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListVirtualHubRouteTableV2sResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubRouteTableV2sClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualHubName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubs.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubs.go deleted file mode 100644 index 5ca1619791e3..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubs.go +++ /dev/null @@ -1,840 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualHubsClient is the network Client -type VirtualHubsClient struct { - BaseClient -} - -// NewVirtualHubsClient creates an instance of the VirtualHubsClient client. -func NewVirtualHubsClient(subscriptionID string) VirtualHubsClient { - return NewVirtualHubsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualHubsClientWithBaseURI creates an instance of the VirtualHubsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualHubsClientWithBaseURI(baseURI string, subscriptionID string) VirtualHubsClient { - return VirtualHubsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// virtualHubParameters - parameters supplied to create or update VirtualHub. -func (client VirtualHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub) (result VirtualHubsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: virtualHubParameters, - Constraints: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - {Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAutoScaleConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAutoScaleConfiguration.MinCapacity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAutoScaleConfiguration.MinCapacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualHubsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, virtualHubParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualHubsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters VirtualHub) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - virtualHubParameters.Etag = nil - virtualHubParameters.Kind = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), - autorest.WithJSON(virtualHubParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) CreateOrUpdateSender(req *http.Request) (future VirtualHubsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualHub, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualHub. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubsClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string) (result VirtualHubsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualHubsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) DeleteSender(req *http.Request) (future VirtualHubsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VirtualHub. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -func (client VirtualHubsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string) (result VirtualHub, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualHubsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) GetResponder(resp *http.Response) (result VirtualHub, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetEffectiveVirtualHubRoutes gets the effective routes configured for the Virtual Hub resource or the specified -// resource . -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// effectiveRoutesParameters - parameters supplied to get the effective routes for a specific resource. -func (client VirtualHubsClient) GetEffectiveVirtualHubRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, effectiveRoutesParameters *EffectiveRoutesParameters) (result VirtualHubsGetEffectiveVirtualHubRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.GetEffectiveVirtualHubRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetEffectiveVirtualHubRoutesPreparer(ctx, resourceGroupName, virtualHubName, effectiveRoutesParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetEffectiveVirtualHubRoutes", nil, "Failure preparing request") - return - } - - result, err = client.GetEffectiveVirtualHubRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetEffectiveVirtualHubRoutes", result.Response(), "Failure sending request") - return - } - - return -} - -// GetEffectiveVirtualHubRoutesPreparer prepares the GetEffectiveVirtualHubRoutes request. -func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, effectiveRoutesParameters *EffectiveRoutesParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/effectiveRoutes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if effectiveRoutesParameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(effectiveRoutesParameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetEffectiveVirtualHubRoutesSender sends the GetEffectiveVirtualHubRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesSender(req *http.Request) (future VirtualHubsGetEffectiveVirtualHubRoutesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetEffectiveVirtualHubRoutesResponder handles the response to the GetEffectiveVirtualHubRoutes request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetInboundRoutes gets the inbound routes configured for the Virtual Hub on a particular connection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// getInboundRoutesParameters - parameters supplied to get the inbound routes for a connection resource. -func (client VirtualHubsClient) GetInboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters) (result VirtualHubsGetInboundRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.GetInboundRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInboundRoutesPreparer(ctx, resourceGroupName, virtualHubName, getInboundRoutesParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetInboundRoutes", nil, "Failure preparing request") - return - } - - result, err = client.GetInboundRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetInboundRoutes", result.Response(), "Failure sending request") - return - } - - return -} - -// GetInboundRoutesPreparer prepares the GetInboundRoutes request. -func (client VirtualHubsClient) GetInboundRoutesPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/inboundRoutes", pathParameters), - autorest.WithJSON(getInboundRoutesParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInboundRoutesSender sends the GetInboundRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) GetInboundRoutesSender(req *http.Request) (future VirtualHubsGetInboundRoutesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetInboundRoutesResponder handles the response to the GetInboundRoutes request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) GetInboundRoutesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetOutboundRoutes gets the outbound routes configured for the Virtual Hub on a particular connection. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// getOutboundRoutesParameters - parameters supplied to get the outbound routes for a connection resource. -func (client VirtualHubsClient) GetOutboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters) (result VirtualHubsGetOutboundRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.GetOutboundRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetOutboundRoutesPreparer(ctx, resourceGroupName, virtualHubName, getOutboundRoutesParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetOutboundRoutes", nil, "Failure preparing request") - return - } - - result, err = client.GetOutboundRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetOutboundRoutes", result.Response(), "Failure sending request") - return - } - - return -} - -// GetOutboundRoutesPreparer prepares the GetOutboundRoutes request. -func (client VirtualHubsClient) GetOutboundRoutesPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/outboundRoutes", pathParameters), - autorest.WithJSON(getOutboundRoutesParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOutboundRoutesSender sends the GetOutboundRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) GetOutboundRoutesSender(req *http.Request) (future VirtualHubsGetOutboundRoutesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetOutboundRoutesResponder handles the response to the GetOutboundRoutes request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) GetOutboundRoutesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// List lists all the VirtualHubs in a subscription. -func (client VirtualHubsClient) List(ctx context.Context) (result ListVirtualHubsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.List") - defer func() { - sc := -1 - if result.lvhr.Response.Response != nil { - sc = result.lvhr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvhr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", resp, "Failure sending request") - return - } - - result.lvhr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "List", resp, "Failure responding to request") - return - } - if result.lvhr.hasNextLink() && result.lvhr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualHubsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualHubs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) ListResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualHubsClient) listNextResults(ctx context.Context, lastResults ListVirtualHubsResult) (result ListVirtualHubsResult, err error) { - req, err := lastResults.listVirtualHubsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubsClient) ListComplete(ctx context.Context) (result ListVirtualHubsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the VirtualHubs in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -func (client VirtualHubsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVirtualHubsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvhr.Response.Response != nil { - sc = result.lvhr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvhr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvhr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvhr.hasNextLink() && result.lvhr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualHubsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualHubsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualHubsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVirtualHubsResult) (result ListVirtualHubsResult, err error) { - req, err := lastResults.listVirtualHubsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualHubsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVirtualHubsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates VirtualHub tags. -// Parameters: -// resourceGroupName - the resource group name of the VirtualHub. -// virtualHubName - the name of the VirtualHub. -// virtualHubParameters - parameters supplied to update VirtualHub tags. -func (client VirtualHubsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject) (result VirtualHub, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualHubName, virtualHubParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualHubsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, virtualHubParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualHubName": autorest.Encode("path", virtualHubName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}", pathParameters), - autorest.WithJSON(virtualHubParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualHubsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualHubsClient) UpdateTagsResponder(resp *http.Response) (result VirtualHub, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewayconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewayconnections.go deleted file mode 100644 index 44549b8b8f52..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewayconnections.go +++ /dev/null @@ -1,1095 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkGatewayConnectionsClient is the network Client -type VirtualNetworkGatewayConnectionsClient struct { - BaseClient -} - -// NewVirtualNetworkGatewayConnectionsClient creates an instance of the VirtualNetworkGatewayConnectionsClient client. -func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string) VirtualNetworkGatewayConnectionsClient { - return NewVirtualNetworkGatewayConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkGatewayConnectionsClientWithBaseURI creates an instance of the -// VirtualNetworkGatewayConnectionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewayConnectionsClient { - return VirtualNetworkGatewayConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a virtual network gateway connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -// parameters - parameters supplied to the create or update virtual network gateway connection operation. -func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection) (result VirtualNetworkGatewayConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - }}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - }}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewayConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network Gateway connection. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -func (client VirtualNetworkGatewayConnectionsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewayConnectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified virtual network gateway connection by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -func (client VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkGatewayConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetIkeSas lists IKE Security Associations for the virtual network gateway connection in the specified resource -// group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway Connection. -func (client VirtualNetworkGatewayConnectionsClient) GetIkeSas(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnectionsGetIkeSasFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.GetIkeSas") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetIkeSasPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetIkeSas", nil, "Failure preparing request") - return - } - - result, err = client.GetIkeSasSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetIkeSas", result.Response(), "Failure sending request") - return - } - - return -} - -// GetIkeSasPreparer prepares the GetIkeSas request. -func (client VirtualNetworkGatewayConnectionsClient) GetIkeSasPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/getikesas", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetIkeSasSender sends the GetIkeSas request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) GetIkeSasSender(req *http.Request) (future VirtualNetworkGatewayConnectionsGetIkeSasFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetIkeSasResponder handles the response to the GetIkeSas request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) GetIkeSasResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetSharedKey the Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified -// virtual network gateway connection shared key through Network resource provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the virtual network gateway connection shared key name. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result ConnectionSharedKey, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.GetSharedKey") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", nil, "Failure preparing request") - return - } - - resp, err := client.GetSharedKeySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", resp, "Failure sending request") - return - } - - result, err = client.GetSharedKeyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", resp, "Failure responding to request") - return - } - - return -} - -// GetSharedKeyPreparer prepares the GetSharedKey request. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSharedKeySender sends the GetSharedKey request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetSharedKeyResponder handles the response to the GetSharedKey request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections -// created. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualNetworkGatewayConnectionsClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayConnectionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.List") - defer func() { - sc := -1 - if result.vngclr.Response.Response != nil { - sc = result.vngclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vngclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure sending request") - return - } - - result.vngclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "List", resp, "Failure responding to request") - return - } - if result.vngclr.hasNextLink() && result.vngclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworkGatewayConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayConnectionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualNetworkGatewayConnectionsClient) listNextResults(ctx context.Context, lastResults VirtualNetworkGatewayConnectionListResult) (result VirtualNetworkGatewayConnectionListResult, err error) { - req, err := lastResults.virtualNetworkGatewayConnectionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkGatewayConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayConnectionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ResetConnection resets the virtual network gateway connection specified. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway Connection. -func (client VirtualNetworkGatewayConnectionsClient) ResetConnection(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnectionsResetConnectionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.ResetConnection") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetConnectionPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetConnection", nil, "Failure preparing request") - return - } - - result, err = client.ResetConnectionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetConnection", result.Response(), "Failure sending request") - return - } - - return -} - -// ResetConnectionPreparer prepares the ResetConnection request. -func (client VirtualNetworkGatewayConnectionsClient) ResetConnectionPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/resetconnection", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetConnectionSender sends the ResetConnection request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) ResetConnectionSender(req *http.Request) (future VirtualNetworkGatewayConnectionsResetConnectionFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetConnectionResponder handles the response to the ResetConnection request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) ResetConnectionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ResetSharedKey the VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway -// connection shared key for passed virtual network gateway connection in the specified resource group through Network -// resource provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the virtual network gateway connection reset shared key Name. -// parameters - parameters supplied to the begin reset virtual network gateway connection shared key operation -// through network resource provider. -func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey) (result VirtualNetworkGatewayConnectionsResetSharedKeyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.ResetSharedKey") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: int64(128), Chain: nil}, - {Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", err.Error()) - } - - req, err := client.ResetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", nil, "Failure preparing request") - return - } - - result, err = client.ResetSharedKeySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", result.Response(), "Failure sending request") - return - } - - return -} - -// ResetSharedKeyPreparer prepares the ResetSharedKey request. -func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetSharedKeySender sends the ResetSharedKey request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeySender(req *http.Request) (future VirtualNetworkGatewayConnectionsResetSharedKeyFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetSharedKeyResponder handles the response to the ResetSharedKey request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(resp *http.Response) (result ConnectionResetSharedKey, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SetSharedKey the Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection -// shared key for passed virtual network gateway connection in the specified resource group through Network resource -// provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the virtual network gateway connection name. -// parameters - parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation -// throughNetwork resource provider. -func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey) (result VirtualNetworkGatewayConnectionsSetSharedKeyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.SetSharedKey") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", err.Error()) - } - - req, err := client.SetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", nil, "Failure preparing request") - return - } - - result, err = client.SetSharedKeySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", result.Response(), "Failure sending request") - return - } - - return -} - -// SetSharedKeyPreparer prepares the SetSharedKey request. -func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetSharedKeySender sends the SetSharedKey request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeySender(req *http.Request) (future VirtualNetworkGatewayConnectionsSetSharedKeyFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetSharedKeyResponder handles the response to the SetSharedKey request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StartPacketCapture starts packet capture on virtual network gateway connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -// parameters - virtual network gateway packet capture parameters supplied to start packet capture on gateway -// connection. -func (client VirtualNetworkGatewayConnectionsClient) StartPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters *VpnPacketCaptureStartParameters) (result VirtualNetworkGatewayConnectionsStartPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.StartPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPacketCapturePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "StartPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StartPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "StartPacketCapture", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPacketCapturePreparer prepares the StartPacketCapture request. -func (client VirtualNetworkGatewayConnectionsClient) StartPacketCapturePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters *VpnPacketCaptureStartParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/startPacketCapture", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartPacketCaptureSender sends the StartPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) StartPacketCaptureSender(req *http.Request) (future VirtualNetworkGatewayConnectionsStartPacketCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartPacketCaptureResponder handles the response to the StartPacketCapture request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) StartPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StopPacketCapture stops packet capture on virtual network gateway connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway Connection. -// parameters - virtual network gateway packet capture parameters supplied to stop packet capture on gateway -// connection. -func (client VirtualNetworkGatewayConnectionsClient) StopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnPacketCaptureStopParameters) (result VirtualNetworkGatewayConnectionsStopPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.StopPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPacketCapturePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "StopPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StopPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "StopPacketCapture", result.Response(), "Failure sending request") - return - } - - return -} - -// StopPacketCapturePreparer prepares the StopPacketCapture request. -func (client VirtualNetworkGatewayConnectionsClient) StopPacketCapturePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnPacketCaptureStopParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/stopPacketCapture", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopPacketCaptureSender sends the StopPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) StopPacketCaptureSender(req *http.Request) (future VirtualNetworkGatewayConnectionsStopPacketCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopPacketCaptureResponder handles the response to the StopPacketCapture request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) StopPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates a virtual network gateway connection tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection. -// parameters - parameters supplied to update virtual network gateway connection tags. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject) (result VirtualNetworkGatewayConnectionsUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionsClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "UpdateTags", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsSender(req *http.Request) (future VirtualNetworkGatewayConnectionsUpdateTagsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGatewayConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewaynatrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewaynatrules.go deleted file mode 100644 index 119619416b43..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewaynatrules.go +++ /dev/null @@ -1,395 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkGatewayNatRulesClient is the network Client -type VirtualNetworkGatewayNatRulesClient struct { - BaseClient -} - -// NewVirtualNetworkGatewayNatRulesClient creates an instance of the VirtualNetworkGatewayNatRulesClient client. -func NewVirtualNetworkGatewayNatRulesClient(subscriptionID string) VirtualNetworkGatewayNatRulesClient { - return NewVirtualNetworkGatewayNatRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkGatewayNatRulesClientWithBaseURI creates an instance of the VirtualNetworkGatewayNatRulesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewVirtualNetworkGatewayNatRulesClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewayNatRulesClient { - return VirtualNetworkGatewayNatRulesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a nat rule to a scalable virtual network gateway if it doesn't exist else updates the -// existing nat rules. -// Parameters: -// resourceGroupName - the resource group name of the Virtual Network Gateway. -// virtualNetworkGatewayName - the name of the gateway. -// natRuleName - the name of the nat rule. -// natRuleParameters - parameters supplied to create or Update a Nat Rule. -func (client VirtualNetworkGatewayNatRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule) (result VirtualNetworkGatewayNatRulesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayNatRulesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkGatewayNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string, natRuleParameters VirtualNetworkGatewayNatRule) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natRuleName": autorest.Encode("path", natRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - natRuleParameters.Etag = nil - natRuleParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}", pathParameters), - autorest.WithJSON(natRuleParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayNatRulesClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewayNatRulesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayNatRulesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGatewayNatRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a nat rule. -// Parameters: -// resourceGroupName - the resource group name of the Virtual Network Gateway. -// virtualNetworkGatewayName - the name of the gateway. -// natRuleName - the name of the nat rule. -func (client VirtualNetworkGatewayNatRulesClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string) (result VirtualNetworkGatewayNatRulesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayNatRulesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkGatewayNatRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natRuleName": autorest.Encode("path", natRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayNatRulesClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewayNatRulesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayNatRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a nat rule. -// Parameters: -// resourceGroupName - the resource group name of the Virtual Network Gateway. -// virtualNetworkGatewayName - the name of the gateway. -// natRuleName - the name of the nat rule. -func (client VirtualNetworkGatewayNatRulesClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string) (result VirtualNetworkGatewayNatRule, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayNatRulesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, natRuleName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkGatewayNatRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "natRuleName": autorest.Encode("path", natRuleName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules/{natRuleName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayNatRulesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayNatRulesClient) GetResponder(resp *http.Response) (result VirtualNetworkGatewayNatRule, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByVirtualNetworkGateway retrieves all nat rules for a particular virtual network gateway. -// Parameters: -// resourceGroupName - the resource group name of the virtual network gateway. -// virtualNetworkGatewayName - the name of the gateway. -func (client VirtualNetworkGatewayNatRulesClient) ListByVirtualNetworkGateway(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result ListVirtualNetworkGatewayNatRulesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayNatRulesClient.ListByVirtualNetworkGateway") - defer func() { - sc := -1 - if result.lvngnrr.Response.Response != nil { - sc = result.lvngnrr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVirtualNetworkGatewayNextResults - req, err := client.ListByVirtualNetworkGatewayPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "ListByVirtualNetworkGateway", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVirtualNetworkGatewaySender(req) - if err != nil { - result.lvngnrr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "ListByVirtualNetworkGateway", resp, "Failure sending request") - return - } - - result.lvngnrr, err = client.ListByVirtualNetworkGatewayResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "ListByVirtualNetworkGateway", resp, "Failure responding to request") - return - } - if result.lvngnrr.hasNextLink() && result.lvngnrr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVirtualNetworkGatewayPreparer prepares the ListByVirtualNetworkGateway request. -func (client VirtualNetworkGatewayNatRulesClient) ListByVirtualNetworkGatewayPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/natRules", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVirtualNetworkGatewaySender sends the ListByVirtualNetworkGateway request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewayNatRulesClient) ListByVirtualNetworkGatewaySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVirtualNetworkGatewayResponder handles the response to the ListByVirtualNetworkGateway request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewayNatRulesClient) ListByVirtualNetworkGatewayResponder(resp *http.Response) (result ListVirtualNetworkGatewayNatRulesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVirtualNetworkGatewayNextResults retrieves the next set of results, if any. -func (client VirtualNetworkGatewayNatRulesClient) listByVirtualNetworkGatewayNextResults(ctx context.Context, lastResults ListVirtualNetworkGatewayNatRulesResult) (result ListVirtualNetworkGatewayNatRulesResult, err error) { - req, err := lastResults.listVirtualNetworkGatewayNatRulesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "listByVirtualNetworkGatewayNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVirtualNetworkGatewaySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "listByVirtualNetworkGatewayNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVirtualNetworkGatewayResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayNatRulesClient", "listByVirtualNetworkGatewayNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVirtualNetworkGatewayComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkGatewayNatRulesClient) ListByVirtualNetworkGatewayComplete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result ListVirtualNetworkGatewayNatRulesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayNatRulesClient.ListByVirtualNetworkGateway") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVirtualNetworkGateway(ctx, resourceGroupName, virtualNetworkGatewayName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgateways.go deleted file mode 100644 index 1948dfbbd550..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgateways.go +++ /dev/null @@ -1,1910 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkGatewaysClient is the network Client -type VirtualNetworkGatewaysClient struct { - BaseClient -} - -// NewVirtualNetworkGatewaysClient creates an instance of the VirtualNetworkGatewaysClient client. -func NewVirtualNetworkGatewaysClient(subscriptionID string) VirtualNetworkGatewaysClient { - return NewVirtualNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkGatewaysClientWithBaseURI creates an instance of the VirtualNetworkGatewaysClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewaysClient { - return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a virtual network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - parameters supplied to create or update virtual network gateway operation. -func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualNetworkGatewayPropertiesFormat.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewaysDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DisconnectVirtualNetworkGatewayVpnConnections disconnect vpn connections of virtual network gateway in the specified -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// request - the parameters are supplied to disconnect vpn connections. -func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVpnConnectionRequest) (result VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.DisconnectVirtualNetworkGatewayVpnConnections") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DisconnectVirtualNetworkGatewayVpnConnectionsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "DisconnectVirtualNetworkGatewayVpnConnections", nil, "Failure preparing request") - return - } - - result, err = client.DisconnectVirtualNetworkGatewayVpnConnectionsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "DisconnectVirtualNetworkGatewayVpnConnections", result.Response(), "Failure sending request") - return - } - - return -} - -// DisconnectVirtualNetworkGatewayVpnConnectionsPreparer prepares the DisconnectVirtualNetworkGatewayVpnConnections request. -func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnectionsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, request P2SVpnConnectionRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/disconnectVirtualNetworkGatewayVpnConnections", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DisconnectVirtualNetworkGatewayVpnConnectionsSender sends the DisconnectVirtualNetworkGatewayVpnConnections request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnectionsSender(req *http.Request) (future VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DisconnectVirtualNetworkGatewayVpnConnectionsResponder handles the response to the DisconnectVirtualNetworkGatewayVpnConnections request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnectionsResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Generatevpnclientpackage generates VPN client package for P2S client of the virtual network gateway in the specified -// resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - parameters supplied to the generate virtual network gateway VPN client package operation. -func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Generatevpnclientpackage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GeneratevpnclientpackagePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure preparing request") - return - } - - result, err = client.GeneratevpnclientpackageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", result.Response(), "Failure sending request") - return - } - - return -} - -// GeneratevpnclientpackagePreparer prepares the Generatevpnclientpackage request. -func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *http.Request) (future VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GeneratevpnclientpackageResponder handles the response to the Generatevpnclientpackage request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GenerateVpnProfile generates VPN profile for P2S client of the virtual network gateway in the specified resource -// group. Used for IKEV2 and radius based authentication. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - parameters supplied to the generate virtual network gateway VPN client package operation. -func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGenerateVpnProfileFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GenerateVpnProfile") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GenerateVpnProfilePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", nil, "Failure preparing request") - return - } - - result, err = client.GenerateVpnProfileSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", result.Response(), "Failure sending request") - return - } - - return -} - -// GenerateVpnProfilePreparer prepares the GenerateVpnProfile request. -func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GenerateVpnProfileSender sends the GenerateVpnProfile request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Request) (future VirtualNetworkGatewaysGenerateVpnProfileFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GenerateVpnProfileResponder handles the response to the GenerateVpnProfile request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets the specified virtual network gateway by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAdvertisedRoutes this operation retrieves a list of routes the virtual network gateway is advertising to the -// specified peer. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// peer - the IP address of the peer. -func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (result VirtualNetworkGatewaysGetAdvertisedRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetAdvertisedRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetAdvertisedRoutesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, peer) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetAdvertisedRoutes", nil, "Failure preparing request") - return - } - - result, err = client.GetAdvertisedRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetAdvertisedRoutes", result.Response(), "Failure sending request") - return - } - - return -} - -// GetAdvertisedRoutesPreparer prepares the GetAdvertisedRoutes request. -func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "peer": autorest.Encode("query", peer), - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAdvertisedRoutesSender sends the GetAdvertisedRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesSender(req *http.Request) (future VirtualNetworkGatewaysGetAdvertisedRoutesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetAdvertisedRoutesResponder handles the response to the GetAdvertisedRoutes request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesResponder(resp *http.Response) (result GatewayRouteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetBgpPeerStatus the GetBgpPeerStatus operation retrieves the status of all BGP peers. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// peer - the IP address of the peer to retrieve the status of. -func (client VirtualNetworkGatewaysClient) GetBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (result VirtualNetworkGatewaysGetBgpPeerStatusFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetBgpPeerStatus") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetBgpPeerStatusPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, peer) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetBgpPeerStatus", nil, "Failure preparing request") - return - } - - result, err = client.GetBgpPeerStatusSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetBgpPeerStatus", result.Response(), "Failure sending request") - return - } - - return -} - -// GetBgpPeerStatusPreparer prepares the GetBgpPeerStatus request. -func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(peer) > 0 { - queryParameters["peer"] = autorest.Encode("query", peer) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetBgpPeerStatusSender sends the GetBgpPeerStatus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusSender(req *http.Request) (future VirtualNetworkGatewaysGetBgpPeerStatusFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetBgpPeerStatusResponder handles the response to the GetBgpPeerStatus request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusResponder(resp *http.Response) (result BgpPeerStatusListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetLearnedRoutes this operation retrieves a list of routes the virtual network gateway has learned, including routes -// learned from BGP peers. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) GetLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetLearnedRoutesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetLearnedRoutes") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetLearnedRoutesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetLearnedRoutes", nil, "Failure preparing request") - return - } - - result, err = client.GetLearnedRoutesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetLearnedRoutes", result.Response(), "Failure sending request") - return - } - - return -} - -// GetLearnedRoutesPreparer prepares the GetLearnedRoutes request. -func (client VirtualNetworkGatewaysClient) GetLearnedRoutesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetLearnedRoutesSender sends the GetLearnedRoutes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetLearnedRoutesSender(req *http.Request) (future VirtualNetworkGatewaysGetLearnedRoutesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetLearnedRoutesResponder handles the response to the GetLearnedRoutes request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetLearnedRoutesResponder(resp *http.Response) (result GatewayRouteListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVpnclientConnectionHealth get VPN client connection health detail per P2S client connection of the virtual -// network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealth(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnclientConnectionHealth") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVpnclientConnectionHealthPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientConnectionHealth", nil, "Failure preparing request") - return - } - - result, err = client.GetVpnclientConnectionHealthSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientConnectionHealth", result.Response(), "Failure sending request") - return - } - - return -} - -// GetVpnclientConnectionHealthPreparer prepares the GetVpnclientConnectionHealth request. -func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getVpnClientConnectionHealth", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVpnclientConnectionHealthSender sends the GetVpnclientConnectionHealth request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthSender(req *http.Request) (future VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetVpnclientConnectionHealthResponder handles the response to the GetVpnclientConnectionHealth request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthResponder(resp *http.Response) (result VpnClientConnectionHealthDetailListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVpnclientIpsecParameters the Get VpnclientIpsecParameters operation retrieves information about the vpnclient -// ipsec policy for P2S client of virtual network gateway in the specified resource group through Network resource -// provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the virtual network gateway name. -func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnclientIpsecParameters") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVpnclientIpsecParametersPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientIpsecParameters", nil, "Failure preparing request") - return - } - - result, err = client.GetVpnclientIpsecParametersSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnclientIpsecParameters", result.Response(), "Failure sending request") - return - } - - return -} - -// GetVpnclientIpsecParametersPreparer prepares the GetVpnclientIpsecParameters request. -func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnclientipsecparameters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVpnclientIpsecParametersSender sends the GetVpnclientIpsecParameters request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersSender(req *http.Request) (future VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetVpnclientIpsecParametersResponder handles the response to the GetVpnclientIpsecParameters request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersResponder(resp *http.Response) (result VpnClientIPsecParameters, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVpnProfilePackageURL gets pre-generated VPN profile for P2S client of the virtual network gateway in the -// specified resource group. The profile needs to be generated first using generateVpnProfile. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetVpnProfilePackageURLFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.GetVpnProfilePackageURL") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetVpnProfilePackageURLPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", nil, "Failure preparing request") - return - } - - result, err = client.GetVpnProfilePackageURLSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", result.Response(), "Failure sending request") - return - } - - return -} - -// GetVpnProfilePackageURLPreparer prepares the GetVpnProfilePackageURL request. -func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVpnProfilePackageURLSender sends the GetVpnProfilePackageURL request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLSender(req *http.Request) (future VirtualNetworkGatewaysGetVpnProfilePackageURLFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetVpnProfilePackageURLResponder handles the response to the GetVpnProfilePackageURL request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all virtual network gateways by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List") - defer func() { - sc := -1 - if result.vnglr.Response.Response != nil { - sc = result.vnglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vnglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.vnglr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.vnglr.hasNextLink() && result.vnglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworkGatewaysClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) ListResponder(resp *http.Response) (result VirtualNetworkGatewayListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualNetworkGatewaysClient) listNextResults(ctx context.Context, lastResults VirtualNetworkGatewayListResult) (result VirtualNetworkGatewayListResult, err error) { - req, err := lastResults.virtualNetworkGatewayListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListConnections gets all the connections in a virtual network gateway. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) ListConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewayListConnectionsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.ListConnections") - defer func() { - sc := -1 - if result.vnglcr.Response.Response != nil { - sc = result.vnglcr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listConnectionsNextResults - req, err := client.ListConnectionsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", nil, "Failure preparing request") - return - } - - resp, err := client.ListConnectionsSender(req) - if err != nil { - result.vnglcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure sending request") - return - } - - result.vnglcr, err = client.ListConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure responding to request") - return - } - if result.vnglcr.hasNextLink() && result.vnglcr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListConnectionsPreparer prepares the ListConnections request. -func (client VirtualNetworkGatewaysClient) ListConnectionsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListConnectionsSender sends the ListConnections request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) ListConnectionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListConnectionsResponder handles the response to the ListConnections request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) ListConnectionsResponder(resp *http.Response) (result VirtualNetworkGatewayListConnectionsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listConnectionsNextResults retrieves the next set of results, if any. -func (client VirtualNetworkGatewaysClient) listConnectionsNextResults(ctx context.Context, lastResults VirtualNetworkGatewayListConnectionsResult) (result VirtualNetworkGatewayListConnectionsResult, err error) { - req, err := lastResults.virtualNetworkGatewayListConnectionsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listConnectionsNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListConnectionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listConnectionsNextResults", resp, "Failure sending next results request") - } - result, err = client.ListConnectionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "listConnectionsNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListConnectionsComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkGatewaysClient) ListConnectionsComplete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewayListConnectionsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.ListConnections") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListConnections(ctx, resourceGroupName, virtualNetworkGatewayName) - return -} - -// Reset resets the primary of the virtual network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// gatewayVip - virtual network gateway vip address supplied to the begin reset of the active-active feature -// enabled gateway. -func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string) (result VirtualNetworkGatewaysResetFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.Reset") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, gatewayVip) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request") - return - } - - result, err = client.ResetSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", result.Response(), "Failure sending request") - return - } - - return -} - -// ResetPreparer prepares the Reset request. -func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(gatewayVip) > 0 { - queryParameters["gatewayVip"] = autorest.Encode("query", gatewayVip) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetSender sends the Reset request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (future VirtualNetworkGatewaysResetFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetResponder handles the response to the Reset request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ResetVpnClientSharedKey resets the VPN client shared key of the virtual network gateway in the specified resource -// group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysResetVpnClientSharedKeyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.ResetVpnClientSharedKey") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetVpnClientSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ResetVpnClientSharedKey", nil, "Failure preparing request") - return - } - - result, err = client.ResetVpnClientSharedKeySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ResetVpnClientSharedKey", result.Response(), "Failure sending request") - return - } - - return -} - -// ResetVpnClientSharedKeyPreparer prepares the ResetVpnClientSharedKey request. -func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/resetvpnclientsharedkey", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetVpnClientSharedKeySender sends the ResetVpnClientSharedKey request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeySender(req *http.Request) (future VirtualNetworkGatewaysResetVpnClientSharedKeyFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetVpnClientSharedKeyResponder handles the response to the ResetVpnClientSharedKey request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// SetVpnclientIpsecParameters the Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy for P2S -// client of virtual network gateway in the specified resource group through Network resource provider. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// vpnclientIpsecParams - parameters supplied to the Begin Set vpnclient ipsec parameters of Virtual Network -// Gateway P2S client operation through Network resource provider. -func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParameters(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIpsecParams VpnClientIPsecParameters) (result VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.SetVpnclientIpsecParameters") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: vpnclientIpsecParams, - Constraints: []validation.Constraint{{Target: "vpnclientIpsecParams.SaLifeTimeSeconds", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "vpnclientIpsecParams.SaDataSizeKilobytes", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkGatewaysClient", "SetVpnclientIpsecParameters", err.Error()) - } - - req, err := client.SetVpnclientIpsecParametersPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, vpnclientIpsecParams) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SetVpnclientIpsecParameters", nil, "Failure preparing request") - return - } - - result, err = client.SetVpnclientIpsecParametersSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SetVpnclientIpsecParameters", result.Response(), "Failure sending request") - return - } - - return -} - -// SetVpnclientIpsecParametersPreparer prepares the SetVpnclientIpsecParameters request. -func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, vpnclientIpsecParams VpnClientIPsecParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/setvpnclientipsecparameters", pathParameters), - autorest.WithJSON(vpnclientIpsecParams), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetVpnclientIpsecParametersSender sends the SetVpnclientIpsecParameters request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersSender(req *http.Request) (future VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetVpnclientIpsecParametersResponder handles the response to the SetVpnclientIpsecParameters request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersResponder(resp *http.Response) (result VpnClientIPsecParameters, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StartPacketCapture starts packet capture on virtual network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - virtual network gateway packet capture parameters supplied to start packet capture on gateway. -func (client VirtualNetworkGatewaysClient) StartPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters *VpnPacketCaptureStartParameters) (result VirtualNetworkGatewaysStartPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.StartPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPacketCapturePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "StartPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StartPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "StartPacketCapture", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPacketCapturePreparer prepares the StartPacketCapture request. -func (client VirtualNetworkGatewaysClient) StartPacketCapturePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters *VpnPacketCaptureStartParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/startPacketCapture", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartPacketCaptureSender sends the StartPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) StartPacketCaptureSender(req *http.Request) (future VirtualNetworkGatewaysStartPacketCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartPacketCaptureResponder handles the response to the StartPacketCapture request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) StartPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StopPacketCapture stops packet capture on virtual network gateway in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - virtual network gateway packet capture parameters supplied to stop packet capture on gateway. -func (client VirtualNetworkGatewaysClient) StopPacketCapture(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnPacketCaptureStopParameters) (result VirtualNetworkGatewaysStopPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.StopPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPacketCapturePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "StopPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StopPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "StopPacketCapture", result.Response(), "Failure sending request") - return - } - - return -} - -// StopPacketCapturePreparer prepares the StopPacketCapture request. -func (client VirtualNetworkGatewaysClient) StopPacketCapturePreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnPacketCaptureStopParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/stopPacketCapture", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopPacketCaptureSender sends the StopPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) StopPacketCaptureSender(req *http.Request) (future VirtualNetworkGatewaysStopPacketCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopPacketCaptureResponder handles the response to the StopPacketCapture request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) StopPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SupportedVpnDevices gets a xml format representation for supported vpn devices. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -func (client VirtualNetworkGatewaysClient) SupportedVpnDevices(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.SupportedVpnDevices") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.SupportedVpnDevicesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", nil, "Failure preparing request") - return - } - - resp, err := client.SupportedVpnDevicesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", resp, "Failure sending request") - return - } - - result, err = client.SupportedVpnDevicesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", resp, "Failure responding to request") - return - } - - return -} - -// SupportedVpnDevicesPreparer prepares the SupportedVpnDevices request. -func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SupportedVpnDevicesSender sends the SupportedVpnDevices request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// SupportedVpnDevicesResponder handles the response to the SupportedVpnDevices request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates a virtual network gateway tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayName - the name of the virtual network gateway. -// parameters - parameters supplied to update virtual network gateway tags. -func (client VirtualNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject) (result VirtualNetworkGatewaysUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (future VirtualNetworkGatewaysUpdateTagsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// VpnDeviceConfigurationScript gets a xml format representation for vpn device configuration script. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection for which the -// configuration script is generated. -// parameters - parameters supplied to the generate vpn device script operation. -func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScript(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnDeviceScriptParameters) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewaysClient.VpnDeviceConfigurationScript") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.VpnDeviceConfigurationScriptPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", nil, "Failure preparing request") - return - } - - resp, err := client.VpnDeviceConfigurationScriptSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", resp, "Failure sending request") - return - } - - result, err = client.VpnDeviceConfigurationScriptResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", resp, "Failure responding to request") - return - } - - return -} - -// VpnDeviceConfigurationScriptPreparer prepares the VpnDeviceConfigurationScript request. -func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptPreparer(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnDeviceScriptParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// VpnDeviceConfigurationScriptSender sends the VpnDeviceConfigurationScript request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// VpnDeviceConfigurationScriptResponder handles the response to the VpnDeviceConfigurationScript request. The method always -// closes the http.Response Body. -func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkpeerings.go deleted file mode 100644 index 03e63e845a7f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkpeerings.go +++ /dev/null @@ -1,411 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkPeeringsClient is the network Client -type VirtualNetworkPeeringsClient struct { - BaseClient -} - -// NewVirtualNetworkPeeringsClient creates an instance of the VirtualNetworkPeeringsClient client. -func NewVirtualNetworkPeeringsClient(subscriptionID string) VirtualNetworkPeeringsClient { - return NewVirtualNetworkPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkPeeringsClientWithBaseURI creates an instance of the VirtualNetworkPeeringsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualNetworkPeeringsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkPeeringsClient { - return VirtualNetworkPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a peering in the specified virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// virtualNetworkPeeringName - the name of the peering. -// virtualNetworkPeeringParameters - parameters supplied to the create or update virtual network peering -// operation. -// syncRemoteAddressSpace - parameter indicates the intention to sync the peering with the current address -// space on the remote vNet after it's updated. -func (client VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, syncRemoteAddressSpace SyncRemoteAddressSpace) (result VirtualNetworkPeeringsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: virtualNetworkPeeringParameters, - Constraints: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteBgpCommunities", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteBgpCommunities.VirtualNetworkCommunity", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteVirtualNetworkEncryption", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "virtualNetworkPeeringParameters.VirtualNetworkPeeringPropertiesFormat.RemoteVirtualNetworkEncryption.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkPeeringsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, syncRemoteAddressSpace SyncRemoteAddressSpace) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(syncRemoteAddressSpace)) > 0 { - queryParameters["syncRemoteAddressSpace"] = autorest.Encode("query", syncRemoteAddressSpace) - } - - virtualNetworkPeeringParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters), - autorest.WithJSON(virtualNetworkPeeringParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkPeeringsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkPeeringsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network peering. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// virtualNetworkPeeringName - the name of the virtual network peering. -func (client VirtualNetworkPeeringsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeeringsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkPeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkPeeringsClient) DeleteSender(req *http.Request) (future VirtualNetworkPeeringsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified virtual network peering. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// virtualNetworkPeeringName - the name of the virtual network peering. -func (client VirtualNetworkPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeering, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkPeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkPeeringsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (result VirtualNetworkPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all virtual network peerings in a virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client VirtualNetworkPeeringsClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkPeeringListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.List") - defer func() { - sc := -1 - if result.vnplr.Response.Response != nil { - sc = result.vnplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vnplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure sending request") - return - } - - result.vnplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure responding to request") - return - } - if result.vnplr.hasNextLink() && result.vnplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworkPeeringsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkPeeringsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualNetworkPeeringsClient) ListResponder(resp *http.Response) (result VirtualNetworkPeeringListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualNetworkPeeringsClient) listNextResults(ctx context.Context, lastResults VirtualNetworkPeeringListResult) (result VirtualNetworkPeeringListResult, err error) { - req, err := lastResults.virtualNetworkPeeringListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkPeeringsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkPeeringListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualNetworkName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworks.go deleted file mode 100644 index 9f8ef4ba6b10..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworks.go +++ /dev/null @@ -1,916 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworksClient is the network Client -type VirtualNetworksClient struct { - BaseClient -} - -// NewVirtualNetworksClient creates an instance of the VirtualNetworksClient client. -func NewVirtualNetworksClient(subscriptionID string) VirtualNetworksClient { - return NewVirtualNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworksClientWithBaseURI creates an instance of the VirtualNetworksClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworksClient { - return VirtualNetworksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckIPAddressAvailability checks whether a private IP address is available for use. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// IPAddress - the private IP address to be verified. -func (client VirtualNetworksClient) CheckIPAddressAvailability(ctx context.Context, resourceGroupName string, virtualNetworkName string, IPAddress string) (result IPAddressAvailabilityResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.CheckIPAddressAvailability") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CheckIPAddressAvailabilityPreparer(ctx, resourceGroupName, virtualNetworkName, IPAddress) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", nil, "Failure preparing request") - return - } - - resp, err := client.CheckIPAddressAvailabilitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", resp, "Failure sending request") - return - } - - result, err = client.CheckIPAddressAvailabilityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", resp, "Failure responding to request") - return - } - - return -} - -// CheckIPAddressAvailabilityPreparer prepares the CheckIPAddressAvailability request. -func (client VirtualNetworksClient) CheckIPAddressAvailabilityPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, IPAddress string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "ipAddress": autorest.Encode("query", IPAddress), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckIPAddressAvailabilitySender sends the CheckIPAddressAvailability request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) CheckIPAddressAvailabilitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckIPAddressAvailabilityResponder handles the response to the CheckIPAddressAvailability request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *http.Response) (result IPAddressAvailabilityResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates a virtual network in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// parameters - parameters supplied to the create or update virtual network operation. -func (client VirtualNetworksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork) (result VirtualNetworksCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat.BgpCommunities", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat.BgpCommunities.VirtualNetworkCommunity", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.VirtualNetworkPropertiesFormat.Encryption", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkPropertiesFormat.Encryption.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworksClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworksCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetwork, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client VirtualNetworksClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworksDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworksClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) DeleteSender(req *http.Request) (future VirtualNetworksDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified virtual network by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// expand - expands referenced resources. -func (client VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, expand string) (result VirtualNetwork, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworksClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) GetResponder(resp *http.Response) (result VirtualNetwork, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all virtual networks in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.List") - defer func() { - sc := -1 - if result.vnlr.Response.Response != nil { - sc = result.vnlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure sending request") - return - } - - result.vnlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "List", resp, "Failure responding to request") - return - } - if result.vnlr.hasNextLink() && result.vnlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualNetworksClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) ListResponder(resp *http.Response) (result VirtualNetworkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualNetworksClient) listNextResults(ctx context.Context, lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, err error) { - req, err := lastResults.virtualNetworkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all virtual networks in a subscription. -func (client VirtualNetworksClient) ListAll(ctx context.Context) (result VirtualNetworkListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListAll") - defer func() { - sc := -1 - if result.vnlr.Response.Response != nil { - sc = result.vnlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vnlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure sending request") - return - } - - result.vnlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vnlr.hasNextLink() && result.vnlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualNetworksClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) ListAllResponder(resp *http.Response) (result VirtualNetworkListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualNetworksClient) listAllNextResults(ctx context.Context, lastResults VirtualNetworkListResult) (result VirtualNetworkListResult, err error) { - req, err := lastResults.virtualNetworkListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksClient) ListAllComplete(ctx context.Context) (result VirtualNetworkListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListDdosProtectionStatus gets the Ddos Protection Status of all IP Addresses under the Virtual Network -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// top - the max number of ip addresses to return. -// skipToken - the skipToken that is given with nextLink. -func (client VirtualNetworksClient) ListDdosProtectionStatus(ctx context.Context, resourceGroupName string, virtualNetworkName string, top *int32, skipToken string) (result VirtualNetworksListDdosProtectionStatusFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListDdosProtectionStatus") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListDdosProtectionStatusPreparer(ctx, resourceGroupName, virtualNetworkName, top, skipToken) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListDdosProtectionStatus", nil, "Failure preparing request") - return - } - - result, err = client.ListDdosProtectionStatusSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListDdosProtectionStatus", result.Response(), "Failure sending request") - return - } - - return -} - -// ListDdosProtectionStatusPreparer prepares the ListDdosProtectionStatus request. -func (client VirtualNetworksClient) ListDdosProtectionStatusPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, top *int32, skipToken string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if top != nil { - queryParameters["top"] = autorest.Encode("query", *top) - } - if len(skipToken) > 0 { - queryParameters["skipToken"] = autorest.Encode("query", skipToken) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListDdosProtectionStatusSender sends the ListDdosProtectionStatus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) ListDdosProtectionStatusSender(req *http.Request) (future VirtualNetworksListDdosProtectionStatusFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListDdosProtectionStatusResponder handles the response to the ListDdosProtectionStatus request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) ListDdosProtectionStatusResponder(resp *http.Response) (result VirtualNetworkDdosProtectionStatusResultPage, err error) { - result.vndpsr, err = client.listDdosProtectionStatusResponder(resp) - result.fn = client.listDdosProtectionStatusNextResults - return -} - -func (client VirtualNetworksClient) listDdosProtectionStatusResponder(resp *http.Response) (result VirtualNetworkDdosProtectionStatusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listDdosProtectionStatusNextResults retrieves the next set of results, if any. -func (client VirtualNetworksClient) listDdosProtectionStatusNextResults(ctx context.Context, lastResults VirtualNetworkDdosProtectionStatusResult) (result VirtualNetworkDdosProtectionStatusResult, err error) { - req, err := lastResults.virtualNetworkDdosProtectionStatusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listDdosProtectionStatusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - var resp *http.Response - resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listDdosProtectionStatusNextResults", resp, "Failure sending next results request") - } - return client.listDdosProtectionStatusResponder(resp) -} - -// ListDdosProtectionStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksClient) ListDdosProtectionStatusComplete(ctx context.Context, resourceGroupName string, virtualNetworkName string, top *int32, skipToken string) (result VirtualNetworksListDdosProtectionStatusAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListDdosProtectionStatus") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - var future VirtualNetworksListDdosProtectionStatusFuture - future, err = client.ListDdosProtectionStatus(ctx, resourceGroupName, virtualNetworkName, top, skipToken) - result.FutureAPI = future.FutureAPI - return -} - -// ListUsage lists usage stats. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -func (client VirtualNetworksClient) ListUsage(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkListUsageResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListUsage") - defer func() { - sc := -1 - if result.vnlur.Response.Response != nil { - sc = result.vnlur.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listUsageNextResults - req, err := client.ListUsagePreparer(ctx, resourceGroupName, virtualNetworkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", nil, "Failure preparing request") - return - } - - resp, err := client.ListUsageSender(req) - if err != nil { - result.vnlur.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure sending request") - return - } - - result.vnlur, err = client.ListUsageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure responding to request") - return - } - if result.vnlur.hasNextLink() && result.vnlur.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListUsagePreparer prepares the ListUsage request. -func (client VirtualNetworksClient) ListUsagePreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListUsageSender sends the ListUsage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) ListUsageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListUsageResponder handles the response to the ListUsage request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) ListUsageResponder(resp *http.Response) (result VirtualNetworkListUsageResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listUsageNextResults retrieves the next set of results, if any. -func (client VirtualNetworksClient) listUsageNextResults(ctx context.Context, lastResults VirtualNetworkListUsageResult) (result VirtualNetworkListUsageResult, err error) { - req, err := lastResults.virtualNetworkListUsageResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listUsageNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListUsageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listUsageNextResults", resp, "Failure sending next results request") - } - result, err = client.ListUsageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listUsageNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListUsageComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksClient) ListUsageComplete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkListUsageResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListUsage") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListUsage(ctx, resourceGroupName, virtualNetworkName) - return -} - -// UpdateTags updates a virtual network tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualNetworkName - the name of the virtual network. -// parameters - parameters supplied to update virtual network tags. -func (client VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject) (result VirtualNetwork, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualNetworkName": autorest.Encode("path", virtualNetworkName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworksClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualNetworksClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetwork, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworktaps.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworktaps.go deleted file mode 100644 index ed7df95593d6..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworktaps.go +++ /dev/null @@ -1,613 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualNetworkTapsClient is the network Client -type VirtualNetworkTapsClient struct { - BaseClient -} - -// NewVirtualNetworkTapsClient creates an instance of the VirtualNetworkTapsClient client. -func NewVirtualNetworkTapsClient(subscriptionID string) VirtualNetworkTapsClient { - return NewVirtualNetworkTapsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualNetworkTapsClientWithBaseURI creates an instance of the VirtualNetworkTapsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualNetworkTapsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkTapsClient { - return VirtualNetworkTapsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a Virtual Network Tap. -// Parameters: -// resourceGroupName - the name of the resource group. -// tapName - the name of the virtual network tap. -// parameters - parameters supplied to the create or update virtual network tap operation. -func (client VirtualNetworkTapsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap) (result VirtualNetworkTapsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - {Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.ServicePublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationNetworkInterfaceIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.LinkedPublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - }}, - }}, - }}, - }}, - {Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, - }}, - {Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.ServicePublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - {Target: "parameters.VirtualNetworkTapPropertiesFormat.DestinationLoadBalancerFrontEndIPConfiguration.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.LinkedPublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualNetworkTapsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, tapName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualNetworkTapsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, tapName string, parameters VirtualNetworkTap) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapName": autorest.Encode("path", tapName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkTapsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualNetworkTap, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified virtual network tap. -// Parameters: -// resourceGroupName - the name of the resource group. -// tapName - the name of the virtual network tap. -func (client VirtualNetworkTapsClient) Delete(ctx context.Context, resourceGroupName string, tapName string) (result VirtualNetworkTapsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, tapName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualNetworkTapsClient) DeletePreparer(ctx context.Context, resourceGroupName string, tapName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapName": autorest.Encode("path", tapName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) DeleteSender(req *http.Request) (future VirtualNetworkTapsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about the specified virtual network tap. -// Parameters: -// resourceGroupName - the name of the resource group. -// tapName - the name of virtual network tap. -func (client VirtualNetworkTapsClient) Get(ctx context.Context, resourceGroupName string, tapName string) (result VirtualNetworkTap, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, tapName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualNetworkTapsClient) GetPreparer(ctx context.Context, resourceGroupName string, tapName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapName": autorest.Encode("path", tapName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) GetResponder(resp *http.Response) (result VirtualNetworkTap, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAll gets all the VirtualNetworkTaps in a subscription. -func (client VirtualNetworkTapsClient) ListAll(ctx context.Context) (result VirtualNetworkTapListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.ListAll") - defer func() { - sc := -1 - if result.vntlr.Response.Response != nil { - sc = result.vntlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vntlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListAll", resp, "Failure sending request") - return - } - - result.vntlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vntlr.hasNextLink() && result.vntlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualNetworkTapsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworkTaps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) ListAllResponder(resp *http.Response) (result VirtualNetworkTapListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualNetworkTapsClient) listAllNextResults(ctx context.Context, lastResults VirtualNetworkTapListResult) (result VirtualNetworkTapListResult, err error) { - req, err := lastResults.virtualNetworkTapListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkTapsClient) ListAllComplete(ctx context.Context) (result VirtualNetworkTapListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListByResourceGroup gets all the VirtualNetworkTaps in a subscription. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualNetworkTapsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result VirtualNetworkTapListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.vntlr.Response.Response != nil { - sc = result.vntlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.vntlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.vntlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.vntlr.hasNextLink() && result.vntlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualNetworkTapsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualNetworkTapListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualNetworkTapsClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualNetworkTapListResult) (result VirtualNetworkTapListResult, err error) { - req, err := lastResults.virtualNetworkTapListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworkTapsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result VirtualNetworkTapListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates an VirtualNetworkTap tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// tapName - the name of the tap. -// tapParameters - parameters supplied to update VirtualNetworkTap tags. -func (client VirtualNetworkTapsClient) UpdateTags(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject) (result VirtualNetworkTap, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, tapName, tapParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualNetworkTapsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, tapName string, tapParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tapName": autorest.Encode("path", tapName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkTaps/{tapName}", pathParameters), - autorest.WithJSON(tapParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualNetworkTapsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualNetworkTapsClient) UpdateTagsResponder(resp *http.Response) (result VirtualNetworkTap, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouterpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouterpeerings.go deleted file mode 100644 index 1b085b20789f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouterpeerings.go +++ /dev/null @@ -1,406 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualRouterPeeringsClient is the network Client -type VirtualRouterPeeringsClient struct { - BaseClient -} - -// NewVirtualRouterPeeringsClient creates an instance of the VirtualRouterPeeringsClient client. -func NewVirtualRouterPeeringsClient(subscriptionID string) VirtualRouterPeeringsClient { - return NewVirtualRouterPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualRouterPeeringsClientWithBaseURI creates an instance of the VirtualRouterPeeringsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualRouterPeeringsClientWithBaseURI(baseURI string, subscriptionID string) VirtualRouterPeeringsClient { - return VirtualRouterPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Virtual Router Peering. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// peeringName - the name of the Virtual Router Peering. -// parameters - parameters supplied to the create or update Virtual Router Peering operation. -func (client VirtualRouterPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering) (result VirtualRouterPeeringsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualRouterPeeringProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualRouterPeeringProperties.PeerAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualRouterPeeringProperties.PeerAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualRouterPeeringProperties.PeerAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualRouterPeeringsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualRouterName, peeringName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualRouterPeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string, parameters VirtualRouterPeering) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - parameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRouterPeeringsClient) CreateOrUpdateSender(req *http.Request) (future VirtualRouterPeeringsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualRouterPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualRouterPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified peering from a Virtual Router. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// peeringName - the name of the peering. -func (client VirtualRouterPeeringsClient) Delete(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string) (result VirtualRouterPeeringsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualRouterName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualRouterPeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRouterPeeringsClient) DeleteSender(req *http.Request) (future VirtualRouterPeeringsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualRouterPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Virtual Router Peering. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// peeringName - the name of the Virtual Router Peering. -func (client VirtualRouterPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string) (result VirtualRouterPeering, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualRouterName, peeringName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualRouterPeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, peeringName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "peeringName": autorest.Encode("path", peeringName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings/{peeringName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRouterPeeringsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualRouterPeeringsClient) GetResponder(resp *http.Response) (result VirtualRouterPeering, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all Virtual Router Peerings in a Virtual Router resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -func (client VirtualRouterPeeringsClient) List(ctx context.Context, resourceGroupName string, virtualRouterName string) (result VirtualRouterPeeringListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.List") - defer func() { - sc := -1 - if result.vrplr.Response.Response != nil { - sc = result.vrplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualRouterName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vrplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "List", resp, "Failure sending request") - return - } - - result.vrplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "List", resp, "Failure responding to request") - return - } - if result.vrplr.hasNextLink() && result.vrplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualRouterPeeringsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualRouterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}/peerings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRouterPeeringsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualRouterPeeringsClient) ListResponder(resp *http.Response) (result VirtualRouterPeeringListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualRouterPeeringsClient) listNextResults(ctx context.Context, lastResults VirtualRouterPeeringListResult) (result VirtualRouterPeeringListResult, err error) { - req, err := lastResults.virtualRouterPeeringListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualRouterPeeringsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualRouterName string) (result VirtualRouterPeeringListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualRouterName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouters.go deleted file mode 100644 index 83c98525aa87..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouters.go +++ /dev/null @@ -1,513 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualRoutersClient is the network Client -type VirtualRoutersClient struct { - BaseClient -} - -// NewVirtualRoutersClient creates an instance of the VirtualRoutersClient client. -func NewVirtualRoutersClient(subscriptionID string) VirtualRoutersClient { - return NewVirtualRoutersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualRoutersClientWithBaseURI creates an instance of the VirtualRoutersClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualRoutersClientWithBaseURI(baseURI string, subscriptionID string) VirtualRoutersClient { - return VirtualRoutersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates the specified Virtual Router. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// parameters - parameters supplied to the create or update Virtual Router. -func (client VirtualRoutersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter) (result VirtualRoutersCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualRouterPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualRouterPropertiesFormat.VirtualRouterAsn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualRouterPropertiesFormat.VirtualRouterAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "parameters.VirtualRouterPropertiesFormat.VirtualRouterAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VirtualRoutersClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualRouterName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualRoutersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, parameters VirtualRouter) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) CreateOrUpdateSender(req *http.Request) (future VirtualRoutersCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualRouter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Virtual Router. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -func (client VirtualRoutersClient) Delete(ctx context.Context, resourceGroupName string, virtualRouterName string) (result VirtualRoutersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualRouterName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualRoutersClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualRouterName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) DeleteSender(req *http.Request) (future VirtualRoutersDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified Virtual Router. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualRouterName - the name of the Virtual Router. -// expand - expands referenced resources. -func (client VirtualRoutersClient) Get(ctx context.Context, resourceGroupName string, virtualRouterName string, expand string) (result VirtualRouter, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualRouterName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualRoutersClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualRouterName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualRouterName": autorest.Encode("path", virtualRouterName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters/{virtualRouterName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) GetResponder(resp *http.Response) (result VirtualRouter, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all the Virtual Routers in a subscription. -func (client VirtualRoutersClient) List(ctx context.Context) (result VirtualRouterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.List") - defer func() { - sc := -1 - if result.vrlr.Response.Response != nil { - sc = result.vrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "List", resp, "Failure sending request") - return - } - - result.vrlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "List", resp, "Failure responding to request") - return - } - if result.vrlr.hasNextLink() && result.vrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualRoutersClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualRouters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) ListResponder(resp *http.Response) (result VirtualRouterListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualRoutersClient) listNextResults(ctx context.Context, lastResults VirtualRouterListResult) (result VirtualRouterListResult, err error) { - req, err := lastResults.virtualRouterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualRoutersClient) ListComplete(ctx context.Context) (result VirtualRouterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all Virtual Routers in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualRoutersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result VirtualRouterListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.vrlr.Response.Response != nil { - sc = result.vrlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.vrlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.vrlr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.vrlr.hasNextLink() && result.vrlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualRoutersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualRouters", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualRoutersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualRoutersClient) ListByResourceGroupResponder(resp *http.Response) (result VirtualRouterListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualRoutersClient) listByResourceGroupNextResults(ctx context.Context, lastResults VirtualRouterListResult) (result VirtualRouterListResult, err error) { - req, err := lastResults.virtualRouterListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualRoutersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualRoutersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result VirtualRouterListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRoutersClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualwans.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualwans.go deleted file mode 100644 index 840147910e05..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualwans.go +++ /dev/null @@ -1,576 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualWansClient is the network Client -type VirtualWansClient struct { - BaseClient -} - -// NewVirtualWansClient creates an instance of the VirtualWansClient client. -func NewVirtualWansClient(subscriptionID string) VirtualWansClient { - return NewVirtualWansClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualWansClientWithBaseURI creates an instance of the VirtualWansClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualWansClientWithBaseURI(baseURI string, subscriptionID string) VirtualWansClient { - return VirtualWansClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -// virtualWANName - the name of the VirtualWAN being created or updated. -// wANParameters - parameters supplied to create or update VirtualWAN. -func (client VirtualWansClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters VirtualWAN) (result VirtualWansCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualWANName, wANParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualWansClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters VirtualWAN) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "VirtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - wANParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), - autorest.WithJSON(wANParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) CreateOrUpdateSender(req *http.Request) (future VirtualWansCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualWAN, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VirtualWAN. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -// virtualWANName - the name of the VirtualWAN being deleted. -func (client VirtualWansClient) Delete(ctx context.Context, resourceGroupName string, virtualWANName string) (result VirtualWansDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, virtualWANName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualWansClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "VirtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) DeleteSender(req *http.Request) (future VirtualWansDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VirtualWAN. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -// virtualWANName - the name of the VirtualWAN being retrieved. -func (client VirtualWansClient) Get(ctx context.Context, resourceGroupName string, virtualWANName string) (result VirtualWAN, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, virtualWANName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualWansClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "VirtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) GetResponder(resp *http.Response) (result VirtualWAN, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the VirtualWANs in a subscription. -func (client VirtualWansClient) List(ctx context.Context) (result ListVirtualWANsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.List") - defer func() { - sc := -1 - if result.lvwnr.Response.Response != nil { - sc = result.lvwnr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvwnr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "List", resp, "Failure sending request") - return - } - - result.lvwnr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "List", resp, "Failure responding to request") - return - } - if result.lvwnr.hasNextLink() && result.lvwnr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualWansClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualWans", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) ListResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualWansClient) listNextResults(ctx context.Context, lastResults ListVirtualWANsResult) (result ListVirtualWANsResult, err error) { - req, err := lastResults.listVirtualWANsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualWansClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualWansClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualWansClient) ListComplete(ctx context.Context) (result ListVirtualWANsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the VirtualWANs in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -func (client VirtualWansClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVirtualWANsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvwnr.Response.Response != nil { - sc = result.lvwnr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvwnr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvwnr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvwnr.hasNextLink() && result.lvwnr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VirtualWansClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) ListByResourceGroupResponder(resp *http.Response) (result ListVirtualWANsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VirtualWansClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVirtualWANsResult) (result ListVirtualWANsResult, err error) { - req, err := lastResults.listVirtualWANsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VirtualWansClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VirtualWansClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualWansClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVirtualWANsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates a VirtualWAN tags. -// Parameters: -// resourceGroupName - the resource group name of the VirtualWan. -// virtualWANName - the name of the VirtualWAN being updated. -// wANParameters - parameters supplied to Update VirtualWAN tags. -func (client VirtualWansClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters TagsObject) (result VirtualWAN, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualWansClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualWANName, wANParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualWansClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VirtualWansClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, virtualWANName string, wANParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "VirtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{VirtualWANName}", pathParameters), - autorest.WithJSON(wANParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualWansClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VirtualWansClient) UpdateTagsResponder(resp *http.Response) (result VirtualWAN, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnconnections.go deleted file mode 100644 index 48663fa5f9b0..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnconnections.go +++ /dev/null @@ -1,568 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnConnectionsClient is the network Client -type VpnConnectionsClient struct { - BaseClient -} - -// NewVpnConnectionsClient creates an instance of the VpnConnectionsClient client. -func NewVpnConnectionsClient(subscriptionID string) VpnConnectionsClient { - return NewVpnConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnConnectionsClientWithBaseURI creates an instance of the VpnConnectionsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnConnectionsClient { - return VpnConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a vpn connection to a scalable vpn gateway if it doesn't exist else updates the existing -// connection. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// connectionName - the name of the connection. -// vpnConnectionParameters - parameters supplied to create or Update a VPN Connection. -func (client VpnConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VpnConnection) (result VpnConnectionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, connectionName, vpnConnectionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VpnConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, vpnConnectionParameters VpnConnection) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - vpnConnectionParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), - autorest.WithJSON(vpnConnectionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VpnConnectionsClient) CreateOrUpdateSender(req *http.Request) (future VpnConnectionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VpnConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a vpn connection. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// connectionName - the name of the connection. -func (client VpnConnectionsClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result VpnConnectionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VpnConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VpnConnectionsClient) DeleteSender(req *http.Request) (future VpnConnectionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VpnConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a vpn connection. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -func (client VpnConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result VpnConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnConnectionsClient) GetResponder(resp *http.Response) (result VpnConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByVpnGateway retrieves all vpn connections for a particular virtual wan vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -func (client VpnConnectionsClient) ListByVpnGateway(ctx context.Context, resourceGroupName string, gatewayName string) (result ListVpnConnectionsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.ListByVpnGateway") - defer func() { - sc := -1 - if result.lvcr.Response.Response != nil { - sc = result.lvcr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVpnGatewayNextResults - req, err := client.ListByVpnGatewayPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVpnGatewaySender(req) - if err != nil { - result.lvcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", resp, "Failure sending request") - return - } - - result.lvcr, err = client.ListByVpnGatewayResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "ListByVpnGateway", resp, "Failure responding to request") - return - } - if result.lvcr.hasNextLink() && result.lvcr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVpnGatewayPreparer prepares the ListByVpnGateway request. -func (client VpnConnectionsClient) ListByVpnGatewayPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVpnGatewaySender sends the ListByVpnGateway request. The method will close the -// http.Response Body if it receives an error. -func (client VpnConnectionsClient) ListByVpnGatewaySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVpnGatewayResponder handles the response to the ListByVpnGateway request. The method always -// closes the http.Response Body. -func (client VpnConnectionsClient) ListByVpnGatewayResponder(resp *http.Response) (result ListVpnConnectionsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVpnGatewayNextResults retrieves the next set of results, if any. -func (client VpnConnectionsClient) listByVpnGatewayNextResults(ctx context.Context, lastResults ListVpnConnectionsResult) (result ListVpnConnectionsResult, err error) { - req, err := lastResults.listVpnConnectionsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVpnGatewaySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVpnGatewayResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "listByVpnGatewayNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVpnGatewayComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnConnectionsClient) ListByVpnGatewayComplete(ctx context.Context, resourceGroupName string, gatewayName string) (result ListVpnConnectionsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.ListByVpnGateway") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVpnGateway(ctx, resourceGroupName, gatewayName) - return -} - -// StartPacketCapture starts packet capture on Vpn connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the gateway. -// vpnConnectionName - the name of the vpn connection. -// parameters - vpn Connection packet capture parameters supplied to start packet capture on gateway -// connection. -func (client VpnConnectionsClient) StartPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, parameters *VpnConnectionPacketCaptureStartParameters) (result VpnConnectionsStartPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.StartPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPacketCapturePreparer(ctx, resourceGroupName, gatewayName, vpnConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "StartPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StartPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "StartPacketCapture", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPacketCapturePreparer prepares the StartPacketCapture request. -func (client VpnConnectionsClient) StartPacketCapturePreparer(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, parameters *VpnConnectionPacketCaptureStartParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnConnectionName": autorest.Encode("path", vpnConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/startpacketcapture", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartPacketCaptureSender sends the StartPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VpnConnectionsClient) StartPacketCaptureSender(req *http.Request) (future VpnConnectionsStartPacketCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartPacketCaptureResponder handles the response to the StartPacketCapture request. The method always -// closes the http.Response Body. -func (client VpnConnectionsClient) StartPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StopPacketCapture stops packet capture on Vpn connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the gateway. -// vpnConnectionName - the name of the vpn connection. -// parameters - vpn Connection packet capture parameters supplied to stop packet capture on gateway connection. -func (client VpnConnectionsClient) StopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, parameters *VpnConnectionPacketCaptureStopParameters) (result VpnConnectionsStopPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnConnectionsClient.StopPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPacketCapturePreparer(ctx, resourceGroupName, gatewayName, vpnConnectionName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "StopPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StopPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnConnectionsClient", "StopPacketCapture", result.Response(), "Failure sending request") - return - } - - return -} - -// StopPacketCapturePreparer prepares the StopPacketCapture request. -func (client VpnConnectionsClient) StopPacketCapturePreparer(ctx context.Context, resourceGroupName string, gatewayName string, vpnConnectionName string, parameters *VpnConnectionPacketCaptureStopParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnConnectionName": autorest.Encode("path", vpnConnectionName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{vpnConnectionName}/stoppacketcapture", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopPacketCaptureSender sends the StopPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VpnConnectionsClient) StopPacketCaptureSender(req *http.Request) (future VpnConnectionsStopPacketCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopPacketCaptureResponder handles the response to the StopPacketCapture request. The method always -// closes the http.Response Body. -func (client VpnConnectionsClient) StopPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpngateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpngateways.go deleted file mode 100644 index 19e473877d6d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpngateways.go +++ /dev/null @@ -1,842 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnGatewaysClient is the network Client -type VpnGatewaysClient struct { - BaseClient -} - -// NewVpnGatewaysClient creates an instance of the VpnGatewaysClient client. -func NewVpnGatewaysClient(subscriptionID string) VpnGatewaysClient { - return NewVpnGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnGatewaysClientWithBaseURI creates an instance of the VpnGatewaysClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VpnGatewaysClient { - return VpnGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a virtual wan vpn gateway if it doesn't exist else updates the existing gateway. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// vpnGatewayParameters - parameters supplied to create or Update a virtual wan vpn gateway. -func (client VpnGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VpnGateway) (result VpnGatewaysCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: vpnGatewayParameters, - Constraints: []validation.Constraint{{Target: "vpnGatewayParameters.VpnGatewayProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnGatewayParameters.VpnGatewayProperties.BgpSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnGatewayParameters.VpnGatewayProperties.BgpSettings.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnGatewayParameters.VpnGatewayProperties.BgpSettings.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "vpnGatewayParameters.VpnGatewayProperties.BgpSettings.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VpnGatewaysClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, gatewayName, vpnGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters VpnGateway) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - vpnGatewayParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), - autorest.WithJSON(vpnGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VpnGatewaysCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) CreateOrUpdateResponder(resp *http.Response) (result VpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a virtual wan vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -func (client VpnGatewaysClient) Delete(ctx context.Context, resourceGroupName string, gatewayName string) (result VpnGatewaysDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VpnGatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) DeleteSender(req *http.Request) (future VpnGatewaysDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a virtual wan vpn gateway. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -func (client VpnGatewaysClient) Get(ctx context.Context, resourceGroupName string, gatewayName string) (result VpnGateway, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnGatewaysClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) GetResponder(resp *http.Response) (result VpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the VpnGateways in a subscription. -func (client VpnGatewaysClient) List(ctx context.Context) (result ListVpnGatewaysResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.List") - defer func() { - sc := -1 - if result.lvgr.Response.Response != nil { - sc = result.lvgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", resp, "Failure sending request") - return - } - - result.lvgr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "List", resp, "Failure responding to request") - return - } - if result.lvgr.hasNextLink() && result.lvgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) ListResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VpnGatewaysClient) listNextResults(ctx context.Context, lastResults ListVpnGatewaysResult) (result ListVpnGatewaysResult, err error) { - req, err := lastResults.listVpnGatewaysResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnGatewaysClient) ListComplete(ctx context.Context) (result ListVpnGatewaysResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the VpnGateways in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -func (client VpnGatewaysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnGatewaysResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvgr.Response.Response != nil { - sc = result.lvgr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvgr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvgr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvgr.hasNextLink() && result.lvgr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnGatewaysResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VpnGatewaysClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVpnGatewaysResult) (result ListVpnGatewaysResult, err error) { - req, err := lastResults.listVpnGatewaysResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnGatewaysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnGatewaysResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Reset resets the primary of the vpn gateway in the specified resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -func (client VpnGatewaysClient) Reset(ctx context.Context, resourceGroupName string, gatewayName string) (result VpnGatewaysResetFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.Reset") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetPreparer(ctx, resourceGroupName, gatewayName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Reset", nil, "Failure preparing request") - return - } - - result, err = client.ResetSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "Reset", result.Response(), "Failure sending request") - return - } - - return -} - -// ResetPreparer prepares the Reset request. -func (client VpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGroupName string, gatewayName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/reset", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetSender sends the Reset request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) ResetSender(req *http.Request) (future VpnGatewaysResetFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetResponder handles the response to the Reset request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) ResetResponder(resp *http.Response) (result VpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StartPacketCapture starts packet capture on vpn gateway in the specified resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// parameters - vpn gateway packet capture parameters supplied to start packet capture on vpn gateway. -func (client VpnGatewaysClient) StartPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, parameters *VpnGatewayPacketCaptureStartParameters) (result VpnGatewaysStartPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.StartPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPacketCapturePreparer(ctx, resourceGroupName, gatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "StartPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StartPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "StartPacketCapture", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPacketCapturePreparer prepares the StartPacketCapture request. -func (client VpnGatewaysClient) StartPacketCapturePreparer(ctx context.Context, resourceGroupName string, gatewayName string, parameters *VpnGatewayPacketCaptureStartParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/startpacketcapture", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartPacketCaptureSender sends the StartPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) StartPacketCaptureSender(req *http.Request) (future VpnGatewaysStartPacketCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartPacketCaptureResponder handles the response to the StartPacketCapture request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) StartPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StopPacketCapture stops packet capture on vpn gateway in the specified resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// parameters - vpn gateway packet capture parameters supplied to stop packet capture on vpn gateway. -func (client VpnGatewaysClient) StopPacketCapture(ctx context.Context, resourceGroupName string, gatewayName string, parameters *VpnGatewayPacketCaptureStopParameters) (result VpnGatewaysStopPacketCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.StopPacketCapture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StopPacketCapturePreparer(ctx, resourceGroupName, gatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "StopPacketCapture", nil, "Failure preparing request") - return - } - - result, err = client.StopPacketCaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "StopPacketCapture", result.Response(), "Failure sending request") - return - } - - return -} - -// StopPacketCapturePreparer prepares the StopPacketCapture request. -func (client VpnGatewaysClient) StopPacketCapturePreparer(ctx context.Context, resourceGroupName string, gatewayName string, parameters *VpnGatewayPacketCaptureStopParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/stoppacketcapture", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StopPacketCaptureSender sends the StopPacketCapture request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) StopPacketCaptureSender(req *http.Request) (future VpnGatewaysStopPacketCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StopPacketCaptureResponder handles the response to the StopPacketCapture request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) StopPacketCaptureResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates virtual wan vpn gateway tags. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// vpnGatewayParameters - parameters supplied to update a virtual wan vpn gateway tags. -func (client VpnGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject) (result VpnGatewaysUpdateTagsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnGatewaysClient.UpdateTags") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, gatewayName, vpnGatewayParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", nil, "Failure preparing request") - return - } - - result, err = client.UpdateTagsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnGatewaysClient", "UpdateTags", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, gatewayName string, vpnGatewayParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}", pathParameters), - autorest.WithJSON(vpnGatewayParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VpnGatewaysClient) UpdateTagsSender(req *http.Request) (future VpnGatewaysUpdateTagsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VpnGatewaysClient) UpdateTagsResponder(resp *http.Response) (result VpnGateway, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnlinkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnlinkconnections.go deleted file mode 100644 index 21927e1f1da2..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnlinkconnections.go +++ /dev/null @@ -1,317 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnLinkConnectionsClient is the network Client -type VpnLinkConnectionsClient struct { - BaseClient -} - -// NewVpnLinkConnectionsClient creates an instance of the VpnLinkConnectionsClient client. -func NewVpnLinkConnectionsClient(subscriptionID string) VpnLinkConnectionsClient { - return NewVpnLinkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnLinkConnectionsClientWithBaseURI creates an instance of the VpnLinkConnectionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVpnLinkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnLinkConnectionsClient { - return VpnLinkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// GetIkeSas lists IKE Security Associations for Vpn Site Link Connection in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -// linkConnectionName - the name of the vpn link connection. -func (client VpnLinkConnectionsClient) GetIkeSas(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (result VpnLinkConnectionsGetIkeSasFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.GetIkeSas") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetIkeSasPreparer(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "GetIkeSas", nil, "Failure preparing request") - return - } - - result, err = client.GetIkeSasSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "GetIkeSas", result.Response(), "Failure sending request") - return - } - - return -} - -// GetIkeSasPreparer prepares the GetIkeSas request. -func (client VpnLinkConnectionsClient) GetIkeSasPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "linkConnectionName": autorest.Encode("path", linkConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/getikesas", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetIkeSasSender sends the GetIkeSas request. The method will close the -// http.Response Body if it receives an error. -func (client VpnLinkConnectionsClient) GetIkeSasSender(req *http.Request) (future VpnLinkConnectionsGetIkeSasFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetIkeSasResponder handles the response to the GetIkeSas request. The method always -// closes the http.Response Body. -func (client VpnLinkConnectionsClient) GetIkeSasResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByVpnConnection retrieves all vpn site link connections for a particular virtual wan vpn gateway vpn connection. -// Parameters: -// resourceGroupName - the resource group name of the vpn gateway. -// gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -func (client VpnLinkConnectionsClient) ListByVpnConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result ListVpnSiteLinkConnectionsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ListByVpnConnection") - defer func() { - sc := -1 - if result.lvslcr.Response.Response != nil { - sc = result.lvslcr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVpnConnectionNextResults - req, err := client.ListByVpnConnectionPreparer(ctx, resourceGroupName, gatewayName, connectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVpnConnectionSender(req) - if err != nil { - result.lvslcr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure sending request") - return - } - - result.lvslcr, err = client.ListByVpnConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ListByVpnConnection", resp, "Failure responding to request") - return - } - if result.lvslcr.hasNextLink() && result.lvslcr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVpnConnectionPreparer prepares the ListByVpnConnection request. -func (client VpnLinkConnectionsClient) ListByVpnConnectionPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVpnConnectionSender sends the ListByVpnConnection request. The method will close the -// http.Response Body if it receives an error. -func (client VpnLinkConnectionsClient) ListByVpnConnectionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVpnConnectionResponder handles the response to the ListByVpnConnection request. The method always -// closes the http.Response Body. -func (client VpnLinkConnectionsClient) ListByVpnConnectionResponder(resp *http.Response) (result ListVpnSiteLinkConnectionsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVpnConnectionNextResults retrieves the next set of results, if any. -func (client VpnLinkConnectionsClient) listByVpnConnectionNextResults(ctx context.Context, lastResults ListVpnSiteLinkConnectionsResult) (result ListVpnSiteLinkConnectionsResult, err error) { - req, err := lastResults.listVpnSiteLinkConnectionsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVpnConnectionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVpnConnectionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "listByVpnConnectionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVpnConnectionComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnLinkConnectionsClient) ListByVpnConnectionComplete(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string) (result ListVpnSiteLinkConnectionsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ListByVpnConnection") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVpnConnection(ctx, resourceGroupName, gatewayName, connectionName) - return -} - -// ResetConnection resets the VpnLink connection specified. -// Parameters: -// resourceGroupName - the name of the resource group. -// gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -// linkConnectionName - the name of the vpn link connection. -func (client VpnLinkConnectionsClient) ResetConnection(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (result VpnLinkConnectionsResetConnectionFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnLinkConnectionsClient.ResetConnection") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ResetConnectionPreparer(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ResetConnection", nil, "Failure preparing request") - return - } - - result, err = client.ResetConnectionSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnLinkConnectionsClient", "ResetConnection", result.Response(), "Failure sending request") - return - } - - return -} - -// ResetConnectionPreparer prepares the ResetConnection request. -func (client VpnLinkConnectionsClient) ResetConnectionPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "linkConnectionName": autorest.Encode("path", linkConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}/resetconnection", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ResetConnectionSender sends the ResetConnection request. The method will close the -// http.Response Body if it receives an error. -func (client VpnLinkConnectionsClient) ResetConnectionSender(req *http.Request) (future VpnLinkConnectionsResetConnectionFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ResetConnectionResponder handles the response to the ResetConnection request. The method always -// closes the http.Response Body. -func (client VpnLinkConnectionsClient) ResetConnectionResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurations.go deleted file mode 100644 index 28d3c9535c58..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurations.go +++ /dev/null @@ -1,578 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnServerConfigurationsClient is the network Client -type VpnServerConfigurationsClient struct { - BaseClient -} - -// NewVpnServerConfigurationsClient creates an instance of the VpnServerConfigurationsClient client. -func NewVpnServerConfigurationsClient(subscriptionID string) VpnServerConfigurationsClient { - return NewVpnServerConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnServerConfigurationsClientWithBaseURI creates an instance of the VpnServerConfigurationsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVpnServerConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) VpnServerConfigurationsClient { - return VpnServerConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VpnServerConfiguration resource if it doesn't exist else updates the existing -// VpnServerConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration being created or updated. -// vpnServerConfigurationParameters - parameters supplied to create or update VpnServerConfiguration. -func (client VpnServerConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VpnServerConfiguration) (result VpnServerConfigurationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VpnServerConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters VpnServerConfiguration) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - vpnServerConfigurationParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", pathParameters), - autorest.WithJSON(vpnServerConfigurationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) CreateOrUpdateSender(req *http.Request) (future VpnServerConfigurationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result VpnServerConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VpnServerConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration being deleted. -func (client VpnServerConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (result VpnServerConfigurationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, vpnServerConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VpnServerConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) DeleteSender(req *http.Request) (future VpnServerConfigurationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VpnServerConfiguration. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration being retrieved. -func (client VpnServerConfigurationsClient) Get(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (result VpnServerConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, vpnServerConfigurationName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnServerConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) GetResponder(resp *http.Response) (result VpnServerConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the VpnServerConfigurations in a subscription. -func (client VpnServerConfigurationsClient) List(ctx context.Context) (result ListVpnServerConfigurationsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.List") - defer func() { - sc := -1 - if result.lvscr.Response.Response != nil { - sc = result.lvscr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvscr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "List", resp, "Failure sending request") - return - } - - result.lvscr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "List", resp, "Failure responding to request") - return - } - if result.lvscr.hasNextLink() && result.lvscr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VpnServerConfigurationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnServerConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) ListResponder(resp *http.Response) (result ListVpnServerConfigurationsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VpnServerConfigurationsClient) listNextResults(ctx context.Context, lastResults ListVpnServerConfigurationsResult) (result ListVpnServerConfigurationsResult, err error) { - req, err := lastResults.listVpnServerConfigurationsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnServerConfigurationsClient) ListComplete(ctx context.Context) (result ListVpnServerConfigurationsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the vpnServerConfigurations in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -func (client VpnServerConfigurationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnServerConfigurationsResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvscr.Response.Response != nil { - sc = result.lvscr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvscr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvscr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvscr.hasNextLink() && result.lvscr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VpnServerConfigurationsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnServerConfigurationsResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VpnServerConfigurationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVpnServerConfigurationsResult) (result ListVpnServerConfigurationsResult, err error) { - req, err := lastResults.listVpnServerConfigurationsResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnServerConfigurationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnServerConfigurationsResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates VpnServerConfiguration tags. -// Parameters: -// resourceGroupName - the resource group name of the VpnServerConfiguration. -// vpnServerConfigurationName - the name of the VpnServerConfiguration being updated. -// vpnServerConfigurationParameters - parameters supplied to update VpnServerConfiguration tags. -func (client VpnServerConfigurationsClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject) (result VpnServerConfiguration, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, vpnServerConfigurationName, vpnServerConfigurationParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VpnServerConfigurationsClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, vpnServerConfigurationName string, vpnServerConfigurationParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnServerConfigurations/{vpnServerConfigurationName}", pathParameters), - autorest.WithJSON(vpnServerConfigurationParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsClient) UpdateTagsResponder(resp *http.Response) (result VpnServerConfiguration, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go deleted file mode 100644 index fa7215ff90f0..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go +++ /dev/null @@ -1,112 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnServerConfigurationsAssociatedWithVirtualWanClient is the network Client -type VpnServerConfigurationsAssociatedWithVirtualWanClient struct { - BaseClient -} - -// NewVpnServerConfigurationsAssociatedWithVirtualWanClient creates an instance of the -// VpnServerConfigurationsAssociatedWithVirtualWanClient client. -func NewVpnServerConfigurationsAssociatedWithVirtualWanClient(subscriptionID string) VpnServerConfigurationsAssociatedWithVirtualWanClient { - return NewVpnServerConfigurationsAssociatedWithVirtualWanClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnServerConfigurationsAssociatedWithVirtualWanClientWithBaseURI creates an instance of the -// VpnServerConfigurationsAssociatedWithVirtualWanClient client using a custom endpoint. Use this when interacting -// with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnServerConfigurationsAssociatedWithVirtualWanClientWithBaseURI(baseURI string, subscriptionID string) VpnServerConfigurationsAssociatedWithVirtualWanClient { - return VpnServerConfigurationsAssociatedWithVirtualWanClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gives the list of VpnServerConfigurations associated with Virtual Wan in a resource group. -// Parameters: -// resourceGroupName - the resource group name. -// virtualWANName - the name of the VirtualWAN whose associated VpnServerConfigurations is needed. -func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) List(ctx context.Context, resourceGroupName string, virtualWANName string) (result VpnServerConfigurationsAssociatedWithVirtualWanListFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnServerConfigurationsAssociatedWithVirtualWanClient.List") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, virtualWANName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanClient", "List", nil, "Failure preparing request") - return - } - - result, err = client.ListSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanClient", "List", result.Response(), "Failure sending request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualWANName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnServerConfigurations", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListSender(req *http.Request) (future VpnServerConfigurationsAssociatedWithVirtualWanListFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListResponder(resp *http.Response) (result VpnServerConfigurationsResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinkconnections.go deleted file mode 100644 index e39710eedbd1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinkconnections.go +++ /dev/null @@ -1,112 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnSiteLinkConnectionsClient is the network Client -type VpnSiteLinkConnectionsClient struct { - BaseClient -} - -// NewVpnSiteLinkConnectionsClient creates an instance of the VpnSiteLinkConnectionsClient client. -func NewVpnSiteLinkConnectionsClient(subscriptionID string) VpnSiteLinkConnectionsClient { - return NewVpnSiteLinkConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnSiteLinkConnectionsClientWithBaseURI creates an instance of the VpnSiteLinkConnectionsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVpnSiteLinkConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VpnSiteLinkConnectionsClient { - return VpnSiteLinkConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves the details of a vpn site link connection. -// Parameters: -// resourceGroupName - the resource group name of the VpnGateway. -// gatewayName - the name of the gateway. -// connectionName - the name of the vpn connection. -// linkConnectionName - the name of the vpn connection. -func (client VpnSiteLinkConnectionsClient) Get(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (result VpnSiteLinkConnection, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSiteLinkConnectionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, gatewayName, connectionName, linkConnectionName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinkConnectionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSiteLinkConnectionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinkConnectionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnSiteLinkConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, gatewayName string, connectionName string, linkConnectionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "connectionName": autorest.Encode("path", connectionName), - "gatewayName": autorest.Encode("path", gatewayName), - "linkConnectionName": autorest.Encode("path", linkConnectionName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnGateways/{gatewayName}/vpnConnections/{connectionName}/vpnLinkConnections/{linkConnectionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSiteLinkConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnSiteLinkConnectionsClient) GetResponder(resp *http.Response) (result VpnSiteLinkConnection, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinks.go deleted file mode 100644 index 966f7e7a4cc9..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinks.go +++ /dev/null @@ -1,227 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnSiteLinksClient is the network Client -type VpnSiteLinksClient struct { - BaseClient -} - -// NewVpnSiteLinksClient creates an instance of the VpnSiteLinksClient client. -func NewVpnSiteLinksClient(subscriptionID string) VpnSiteLinksClient { - return NewVpnSiteLinksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnSiteLinksClientWithBaseURI creates an instance of the VpnSiteLinksClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnSiteLinksClientWithBaseURI(baseURI string, subscriptionID string) VpnSiteLinksClient { - return VpnSiteLinksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get retrieves the details of a VPN site link. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite. -// vpnSiteLinkName - the name of the VpnSiteLink being retrieved. -func (client VpnSiteLinksClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string) (result VpnSiteLink, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSiteLinksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteLinkName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnSiteLinksClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteLinkName": autorest.Encode("path", vpnSiteLinkName), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks/{vpnSiteLinkName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSiteLinksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnSiteLinksClient) GetResponder(resp *http.Response) (result VpnSiteLink, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByVpnSite lists all the vpnSiteLinks in a resource group for a vpn site. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite. -func (client VpnSiteLinksClient) ListByVpnSite(ctx context.Context, resourceGroupName string, vpnSiteName string) (result ListVpnSiteLinksResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSiteLinksClient.ListByVpnSite") - defer func() { - sc := -1 - if result.lvslr.Response.Response != nil { - sc = result.lvslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByVpnSiteNextResults - req, err := client.ListByVpnSitePreparer(ctx, resourceGroupName, vpnSiteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "ListByVpnSite", nil, "Failure preparing request") - return - } - - resp, err := client.ListByVpnSiteSender(req) - if err != nil { - result.lvslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "ListByVpnSite", resp, "Failure sending request") - return - } - - result.lvslr, err = client.ListByVpnSiteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "ListByVpnSite", resp, "Failure responding to request") - return - } - if result.lvslr.hasNextLink() && result.lvslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByVpnSitePreparer prepares the ListByVpnSite request. -func (client VpnSiteLinksClient) ListByVpnSitePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}/vpnSiteLinks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByVpnSiteSender sends the ListByVpnSite request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSiteLinksClient) ListByVpnSiteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByVpnSiteResponder handles the response to the ListByVpnSite request. The method always -// closes the http.Response Body. -func (client VpnSiteLinksClient) ListByVpnSiteResponder(resp *http.Response) (result ListVpnSiteLinksResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByVpnSiteNextResults retrieves the next set of results, if any. -func (client VpnSiteLinksClient) listByVpnSiteNextResults(ctx context.Context, lastResults ListVpnSiteLinksResult) (result ListVpnSiteLinksResult, err error) { - req, err := lastResults.listVpnSiteLinksResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "listByVpnSiteNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByVpnSiteSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "listByVpnSiteNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByVpnSiteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSiteLinksClient", "listByVpnSiteNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByVpnSiteComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnSiteLinksClient) ListByVpnSiteComplete(ctx context.Context, resourceGroupName string, vpnSiteName string) (result ListVpnSiteLinksResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSiteLinksClient.ListByVpnSite") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByVpnSite(ctx, resourceGroupName, vpnSiteName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsites.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsites.go deleted file mode 100644 index 6baf98b822ef..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsites.go +++ /dev/null @@ -1,590 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnSitesClient is the network Client -type VpnSitesClient struct { - BaseClient -} - -// NewVpnSitesClient creates an instance of the VpnSitesClient client. -func NewVpnSitesClient(subscriptionID string) VpnSitesClient { - return NewVpnSitesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnSitesClientWithBaseURI creates an instance of the VpnSitesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVpnSitesClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesClient { - return VpnSitesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite being created or updated. -// vpnSiteParameters - parameters supplied to create or update VpnSite. -func (client VpnSitesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (result VpnSitesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: vpnSiteParameters, - Constraints: []validation.Constraint{{Target: "vpnSiteParameters.VpnSiteProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnSiteParameters.VpnSiteProperties.BgpProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnSiteParameters.VpnSiteProperties.BgpProperties.Asn", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "vpnSiteParameters.VpnSiteProperties.BgpProperties.Asn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, - {Target: "vpnSiteParameters.VpnSiteProperties.BgpProperties.Asn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.VpnSitesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters VpnSite) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - vpnSiteParameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), - autorest.WithJSON(vpnSiteParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) CreateOrUpdateSender(req *http.Request) (future VpnSitesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) CreateOrUpdateResponder(resp *http.Response) (result VpnSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a VpnSite. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite being deleted. -func (client VpnSitesClient) Delete(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSitesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, vpnSiteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) DeleteSender(req *http.Request) (future VpnSitesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves the details of a VPN site. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite being retrieved. -func (client VpnSitesClient) Get(ctx context.Context, resourceGroupName string, vpnSiteName string) (result VpnSite, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, vpnSiteName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VpnSitesClient) GetPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) GetResponder(resp *http.Response) (result VpnSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the VpnSites in a subscription. -func (client VpnSitesClient) List(ctx context.Context) (result ListVpnSitesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.List") - defer func() { - sc := -1 - if result.lvsr.Response.Response != nil { - sc = result.lvsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lvsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure sending request") - return - } - - result.lvsr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "List", resp, "Failure responding to request") - return - } - if result.lvsr.hasNextLink() && result.lvsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VpnSitesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/vpnSites", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) ListResponder(resp *http.Response) (result ListVpnSitesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VpnSitesClient) listNextResults(ctx context.Context, lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) { - req, err := lastResults.listVpnSitesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnSitesClient) ListComplete(ctx context.Context) (result ListVpnSitesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the vpnSites in a resource group. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -func (client VpnSitesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.lvsr.Response.Response != nil { - sc = result.lvsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.lvsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.lvsr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.lvsr.hasNextLink() && result.lvsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client VpnSitesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) ListByResourceGroupResponder(resp *http.Response) (result ListVpnSitesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client VpnSitesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListVpnSitesResult) (result ListVpnSitesResult, err error) { - req, err := lastResults.listVpnSitesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client VpnSitesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListVpnSitesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// UpdateTags updates VpnSite tags. -// Parameters: -// resourceGroupName - the resource group name of the VpnSite. -// vpnSiteName - the name of the VpnSite being updated. -// vpnSiteParameters - parameters supplied to update VpnSite tags. -func (client VpnSitesClient) UpdateTags(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (result VpnSite, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, vpnSiteName, vpnSiteParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client VpnSitesClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, vpnSiteName string, vpnSiteParameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vpnSiteName": autorest.Encode("path", vpnSiteName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/vpnSites/{vpnSiteName}", pathParameters), - autorest.WithJSON(vpnSiteParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client VpnSitesClient) UpdateTagsResponder(resp *http.Response) (result VpnSite, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitesconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitesconfiguration.go deleted file mode 100644 index 91f1679b9c61..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitesconfiguration.go +++ /dev/null @@ -1,120 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VpnSitesConfigurationClient is the network Client -type VpnSitesConfigurationClient struct { - BaseClient -} - -// NewVpnSitesConfigurationClient creates an instance of the VpnSitesConfigurationClient client. -func NewVpnSitesConfigurationClient(subscriptionID string) VpnSitesConfigurationClient { - return NewVpnSitesConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVpnSitesConfigurationClientWithBaseURI creates an instance of the VpnSitesConfigurationClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVpnSitesConfigurationClientWithBaseURI(baseURI string, subscriptionID string) VpnSitesConfigurationClient { - return VpnSitesConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Download gives the sas-url to download the configurations for vpn-sites in a resource group. -// Parameters: -// resourceGroupName - the resource group name. -// virtualWANName - the name of the VirtualWAN for which configuration of all vpn-sites is needed. -// request - parameters supplied to download vpn-sites configuration. -func (client VpnSitesConfigurationClient) Download(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVpnSitesConfigurationRequest) (result VpnSitesConfigurationDownloadFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VpnSitesConfigurationClient.Download") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: request, - Constraints: []validation.Constraint{{Target: "request.OutputBlobSasURL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.VpnSitesConfigurationClient", "Download", err.Error()) - } - - req, err := client.DownloadPreparer(ctx, resourceGroupName, virtualWANName, request) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationClient", "Download", nil, "Failure preparing request") - return - } - - result, err = client.DownloadSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationClient", "Download", result.Response(), "Failure sending request") - return - } - - return -} - -// DownloadPreparer prepares the Download request. -func (client VpnSitesConfigurationClient) DownloadPreparer(ctx context.Context, resourceGroupName string, virtualWANName string, request GetVpnSitesConfigurationRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualWANName": autorest.Encode("path", virtualWANName), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/vpnConfiguration", pathParameters), - autorest.WithJSON(request), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DownloadSender sends the Download request. The method will close the -// http.Response Body if it receives an error. -func (client VpnSitesConfigurationClient) DownloadSender(req *http.Request) (future VpnSitesConfigurationDownloadFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DownloadResponder handles the response to the Download request. The method always -// closes the http.Response Body. -func (client VpnSitesConfigurationClient) DownloadResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/watchers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/watchers.go deleted file mode 100644 index b995d820c544..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/watchers.go +++ /dev/null @@ -1,1568 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WatchersClient is the network Client -type WatchersClient struct { - BaseClient -} - -// NewWatchersClient creates an instance of the WatchersClient client. -func NewWatchersClient(subscriptionID string) WatchersClient { - return NewWatchersClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWatchersClientWithBaseURI creates an instance of the WatchersClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWatchersClientWithBaseURI(baseURI string, subscriptionID string) WatchersClient { - return WatchersClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckConnectivity verifies the possibility of establishing a direct TCP connection from a virtual machine to a given -// endpoint including another VM or an arbitrary remote server. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that determine how the connectivity check will be performed. -func (client WatchersClient) CheckConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters) (result WatchersCheckConnectivityFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.CheckConnectivity") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Source.ResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Source.Port", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Source.Port", Name: validation.InclusiveMaximum, Rule: int64(65535), Chain: nil}, - {Target: "parameters.Source.Port", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - {Target: "parameters.Destination", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.Destination.Port", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Destination.Port", Name: validation.InclusiveMaximum, Rule: int64(65535), Chain: nil}, - {Target: "parameters.Destination.Port", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "CheckConnectivity", err.Error()) - } - - req, err := client.CheckConnectivityPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", nil, "Failure preparing request") - return - } - - result, err = client.CheckConnectivitySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", result.Response(), "Failure sending request") - return - } - - return -} - -// CheckConnectivityPreparer prepares the CheckConnectivity request. -func (client WatchersClient) CheckConnectivityPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckConnectivitySender sends the CheckConnectivity request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) CheckConnectivitySender(req *http.Request) (future WatchersCheckConnectivityFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CheckConnectivityResponder handles the response to the CheckConnectivity request. The method always -// closes the http.Response Body. -func (client WatchersClient) CheckConnectivityResponder(resp *http.Response) (result ConnectivityInformation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// CreateOrUpdate creates or updates a network watcher in the specified resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the network watcher resource. -func (client WatchersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WatchersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client WatchersClient) CreateOrUpdateResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified network watcher resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -func (client WatchersClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string) (result WatchersDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WatchersClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) DeleteSender(req *http.Request) (future WatchersDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WatchersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the specified network watcher by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -func (client WatchersClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WatchersClient) GetPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetAzureReachabilityReport nOTE: This feature is currently in preview and still being tested for stability. Gets the -// relative latency score for internet service providers from a specified location to Azure regions. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that determine Azure reachability report configuration. -func (client WatchersClient) GetAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters) (result WatchersGetAzureReachabilityReportFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetAzureReachabilityReport") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ProviderLocation", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ProviderLocation.Country", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.StartTime", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.EndTime", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetAzureReachabilityReport", err.Error()) - } - - req, err := client.GetAzureReachabilityReportPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", nil, "Failure preparing request") - return - } - - result, err = client.GetAzureReachabilityReportSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", result.Response(), "Failure sending request") - return - } - - return -} - -// GetAzureReachabilityReportPreparer prepares the GetAzureReachabilityReport request. -func (client WatchersClient) GetAzureReachabilityReportPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetAzureReachabilityReportSender sends the GetAzureReachabilityReport request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetAzureReachabilityReportSender(req *http.Request) (future WatchersGetAzureReachabilityReportFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetAzureReachabilityReportResponder handles the response to the GetAzureReachabilityReport request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetAzureReachabilityReportResponder(resp *http.Response) (result AzureReachabilityReport, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetFlowLogStatus queries status of flow log and traffic analytics (optional) on a specified resource. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that define a resource to query flow log and traffic analytics (optional) status. -func (client WatchersClient) GetFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters) (result WatchersGetFlowLogStatusFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetFlowLogStatus") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetFlowLogStatus", err.Error()) - } - - req, err := client.GetFlowLogStatusPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetFlowLogStatus", nil, "Failure preparing request") - return - } - - result, err = client.GetFlowLogStatusSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetFlowLogStatus", result.Response(), "Failure sending request") - return - } - - return -} - -// GetFlowLogStatusPreparer prepares the GetFlowLogStatus request. -func (client WatchersClient) GetFlowLogStatusPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetFlowLogStatusSender sends the GetFlowLogStatus request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetFlowLogStatusSender(req *http.Request) (future WatchersGetFlowLogStatusFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetFlowLogStatusResponder handles the response to the GetFlowLogStatus request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetFlowLogStatusResponder(resp *http.Response) (result FlowLogInformation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetNetworkConfigurationDiagnostic gets Network Configuration Diagnostic data to help customers understand and debug -// network behavior. It provides detailed information on what security rules were applied to a specified traffic flow -// and the result of evaluating these rules. Customers must provide details of a flow like source, destination, -// protocol, etc. The API returns whether traffic was allowed or denied, the rules evaluated for the specified flow and -// the evaluation results. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters to get network configuration diagnostic. -func (client WatchersClient) GetNetworkConfigurationDiagnostic(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters) (result WatchersGetNetworkConfigurationDiagnosticFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetNetworkConfigurationDiagnostic") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Profiles", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetNetworkConfigurationDiagnostic", err.Error()) - } - - req, err := client.GetNetworkConfigurationDiagnosticPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNetworkConfigurationDiagnostic", nil, "Failure preparing request") - return - } - - result, err = client.GetNetworkConfigurationDiagnosticSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNetworkConfigurationDiagnostic", result.Response(), "Failure sending request") - return - } - - return -} - -// GetNetworkConfigurationDiagnosticPreparer prepares the GetNetworkConfigurationDiagnostic request. -func (client WatchersClient) GetNetworkConfigurationDiagnosticPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConfigurationDiagnosticParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNetworkConfigurationDiagnosticSender sends the GetNetworkConfigurationDiagnostic request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetNetworkConfigurationDiagnosticSender(req *http.Request) (future WatchersGetNetworkConfigurationDiagnosticFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetNetworkConfigurationDiagnosticResponder handles the response to the GetNetworkConfigurationDiagnostic request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetNetworkConfigurationDiagnosticResponder(resp *http.Response) (result ConfigurationDiagnosticResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetNextHop gets the next hop from the specified VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the source and destination endpoint. -func (client WatchersClient) GetNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters) (result WatchersGetNextHopFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetNextHop") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.SourceIPAddress", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.DestinationIPAddress", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetNextHop", err.Error()) - } - - req, err := client.GetNextHopPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNextHop", nil, "Failure preparing request") - return - } - - result, err = client.GetNextHopSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetNextHop", result.Response(), "Failure sending request") - return - } - - return -} - -// GetNextHopPreparer prepares the GetNextHop request. -func (client WatchersClient) GetNextHopPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetNextHopSender sends the GetNextHop request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetNextHopSender(req *http.Request) (future WatchersGetNextHopFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetNextHopResponder handles the response to the GetNextHop request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetNextHopResponder(resp *http.Response) (result NextHopResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetTopology gets the current network topology by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the representation of topology. -func (client WatchersClient) GetTopology(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters) (result Topology, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetTopology") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetTopologyPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTopology", nil, "Failure preparing request") - return - } - - resp, err := client.GetTopologySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTopology", resp, "Failure sending request") - return - } - - result, err = client.GetTopologyResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTopology", resp, "Failure responding to request") - return - } - - return -} - -// GetTopologyPreparer prepares the GetTopology request. -func (client WatchersClient) GetTopologyPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTopologySender sends the GetTopology request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetTopologySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetTopologyResponder handles the response to the GetTopology request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetTopologyResponder(resp *http.Response) (result Topology, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetTroubleshooting initiate troubleshooting on a specified resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that define the resource to troubleshoot. -func (client WatchersClient) GetTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters) (result WatchersGetTroubleshootingFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetTroubleshooting") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TroubleshootingProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.TroubleshootingProperties.StorageID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.TroubleshootingProperties.StoragePath", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetTroubleshooting", err.Error()) - } - - req, err := client.GetTroubleshootingPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshooting", nil, "Failure preparing request") - return - } - - result, err = client.GetTroubleshootingSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshooting", result.Response(), "Failure sending request") - return - } - - return -} - -// GetTroubleshootingPreparer prepares the GetTroubleshooting request. -func (client WatchersClient) GetTroubleshootingPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTroubleshootingSender sends the GetTroubleshooting request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetTroubleshootingSender(req *http.Request) (future WatchersGetTroubleshootingFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetTroubleshootingResponder handles the response to the GetTroubleshooting request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetTroubleshootingResponder(resp *http.Response) (result TroubleshootingResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetTroubleshootingResult get the last completed troubleshooting result on a specified resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that define the resource to query the troubleshooting result. -func (client WatchersClient) GetTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters) (result WatchersGetTroubleshootingResultFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetTroubleshootingResult") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetTroubleshootingResult", err.Error()) - } - - req, err := client.GetTroubleshootingResultPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshootingResult", nil, "Failure preparing request") - return - } - - result, err = client.GetTroubleshootingResultSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetTroubleshootingResult", result.Response(), "Failure sending request") - return - } - - return -} - -// GetTroubleshootingResultPreparer prepares the GetTroubleshootingResult request. -func (client WatchersClient) GetTroubleshootingResultPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetTroubleshootingResultSender sends the GetTroubleshootingResult request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetTroubleshootingResultSender(req *http.Request) (future WatchersGetTroubleshootingResultFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetTroubleshootingResultResponder handles the response to the GetTroubleshootingResult request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetTroubleshootingResultResponder(resp *http.Response) (result TroubleshootingResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetVMSecurityRules gets the configured and effective security group rules on the specified VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the VM to check security groups for. -func (client WatchersClient) GetVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters) (result WatchersGetVMSecurityRulesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.GetVMSecurityRules") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "GetVMSecurityRules", err.Error()) - } - - req, err := client.GetVMSecurityRulesPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetVMSecurityRules", nil, "Failure preparing request") - return - } - - result, err = client.GetVMSecurityRulesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetVMSecurityRules", result.Response(), "Failure sending request") - return - } - - return -} - -// GetVMSecurityRulesPreparer prepares the GetVMSecurityRules request. -func (client WatchersClient) GetVMSecurityRulesPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetVMSecurityRulesSender sends the GetVMSecurityRules request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) GetVMSecurityRulesSender(req *http.Request) (future WatchersGetVMSecurityRulesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GetVMSecurityRulesResponder handles the response to the GetVMSecurityRules request. The method always -// closes the http.Response Body. -func (client WatchersClient) GetVMSecurityRulesResponder(resp *http.Response) (result SecurityGroupViewResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets all network watchers by resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client WatchersClient) List(ctx context.Context, resourceGroupName string) (result WatcherListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client WatchersClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client WatchersClient) ListResponder(resp *http.Response) (result WatcherListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAll gets all network watchers by subscription. -func (client WatchersClient) ListAll(ctx context.Context) (result WatcherListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.ListAll") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAll", resp, "Failure sending request") - return - } - - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAll", resp, "Failure responding to request") - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client WatchersClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client WatchersClient) ListAllResponder(resp *http.Response) (result WatcherListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListAvailableProviders nOTE: This feature is currently in preview and still being tested for stability. Lists all -// available internet service providers for a specified Azure region. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that scope the list of available providers. -func (client WatchersClient) ListAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters) (result WatchersListAvailableProvidersFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.ListAvailableProviders") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableProvidersPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", nil, "Failure preparing request") - return - } - - result, err = client.ListAvailableProvidersSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", result.Response(), "Failure sending request") - return - } - - return -} - -// ListAvailableProvidersPreparer prepares the ListAvailableProviders request. -func (client WatchersClient) ListAvailableProvidersPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableProvidersSender sends the ListAvailableProviders request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) ListAvailableProvidersSender(req *http.Request) (future WatchersListAvailableProvidersFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ListAvailableProvidersResponder handles the response to the ListAvailableProviders request. The method always -// closes the http.Response Body. -func (client WatchersClient) ListAvailableProvidersResponder(resp *http.Response) (result AvailableProvidersList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// SetFlowLogConfiguration configures flow log and traffic analytics (optional) on a specified resource. -// Parameters: -// resourceGroupName - the name of the network watcher resource group. -// networkWatcherName - the name of the network watcher resource. -// parameters - parameters that define the configuration of flow log. -func (client WatchersClient) SetFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation) (result WatchersSetFlowLogConfigurationFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.SetFlowLogConfiguration") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FlowLogProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.FlowLogProperties.StorageID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.FlowLogProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil}, - }}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "SetFlowLogConfiguration", err.Error()) - } - - req, err := client.SetFlowLogConfigurationPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "SetFlowLogConfiguration", nil, "Failure preparing request") - return - } - - result, err = client.SetFlowLogConfigurationSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "SetFlowLogConfiguration", result.Response(), "Failure sending request") - return - } - - return -} - -// SetFlowLogConfigurationPreparer prepares the SetFlowLogConfiguration request. -func (client WatchersClient) SetFlowLogConfigurationPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// SetFlowLogConfigurationSender sends the SetFlowLogConfiguration request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) SetFlowLogConfigurationSender(req *http.Request) (future WatchersSetFlowLogConfigurationFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// SetFlowLogConfigurationResponder handles the response to the SetFlowLogConfiguration request. The method always -// closes the http.Response Body. -func (client WatchersClient) SetFlowLogConfigurationResponder(resp *http.Response) (result FlowLogInformation, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateTags updates a network watcher tags. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters supplied to update network watcher tags. -func (client WatchersClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject) (result Watcher, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.UpdateTags") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "UpdateTags", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateTagsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WatchersClient", "UpdateTags", resp, "Failure sending request") - return - } - - result, err = client.UpdateTagsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "UpdateTags", resp, "Failure responding to request") - return - } - - return -} - -// UpdateTagsPreparer prepares the UpdateTags request. -func (client WatchersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateTagsSender sends the UpdateTags request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) UpdateTagsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateTagsResponder handles the response to the UpdateTags request. The method always -// closes the http.Response Body. -func (client WatchersClient) UpdateTagsResponder(resp *http.Response) (result Watcher, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// VerifyIPFlow verify IP flow from the specified VM to a location given the currently configured NSG rules. -// Parameters: -// resourceGroupName - the name of the resource group. -// networkWatcherName - the name of the network watcher. -// parameters - parameters that define the IP flow to be verified. -func (client WatchersClient) VerifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters) (result WatchersVerifyIPFlowFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WatchersClient.VerifyIPFlow") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.TargetResourceID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.LocalPort", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RemotePort", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.LocalIPAddress", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.RemoteIPAddress", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WatchersClient", "VerifyIPFlow", err.Error()) - } - - req, err := client.VerifyIPFlowPreparer(ctx, resourceGroupName, networkWatcherName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "VerifyIPFlow", nil, "Failure preparing request") - return - } - - result, err = client.VerifyIPFlowSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WatchersClient", "VerifyIPFlow", result.Response(), "Failure sending request") - return - } - - return -} - -// VerifyIPFlowPreparer prepares the VerifyIPFlow request. -func (client WatchersClient) VerifyIPFlowPreparer(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "networkWatcherName": autorest.Encode("path", networkWatcherName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// VerifyIPFlowSender sends the VerifyIPFlow request. The method will close the -// http.Response Body if it receives an error. -func (client WatchersClient) VerifyIPFlowSender(req *http.Request) (future WatchersVerifyIPFlowFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// VerifyIPFlowResponder handles the response to the VerifyIPFlow request. The method always -// closes the http.Response Body. -func (client WatchersClient) VerifyIPFlowResponder(resp *http.Response) (result VerificationIPFlowResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webapplicationfirewallpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webapplicationfirewallpolicies.go deleted file mode 100644 index db5c195a2573..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webapplicationfirewallpolicies.go +++ /dev/null @@ -1,531 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WebApplicationFirewallPoliciesClient is the network Client -type WebApplicationFirewallPoliciesClient struct { - BaseClient -} - -// NewWebApplicationFirewallPoliciesClient creates an instance of the WebApplicationFirewallPoliciesClient client. -func NewWebApplicationFirewallPoliciesClient(subscriptionID string) WebApplicationFirewallPoliciesClient { - return NewWebApplicationFirewallPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWebApplicationFirewallPoliciesClientWithBaseURI creates an instance of the WebApplicationFirewallPoliciesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewWebApplicationFirewallPoliciesClientWithBaseURI(baseURI string, subscriptionID string) WebApplicationFirewallPoliciesClient { - return WebApplicationFirewallPoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or update policy with specified rule set name within a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// policyName - the name of the policy. -// parameters - policy to be created. -func (client WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy) (result WebApplicationFirewallPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: policyName, - Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.MaxRequestBodySizeInKb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.MaxRequestBodySizeInKb", Name: validation.InclusiveMinimum, Rule: int64(8), Chain: nil}}}, - {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.FileUploadLimitInMb", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.FileUploadLimitInMb", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseStatusCode", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseStatusCode", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, - {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseBody", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseBody", Name: validation.MaxLength, Rule: 32768, Chain: nil}, - {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseBody", Name: validation.Pattern, Rule: `^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$`, Chain: nil}, - }}, - }}, - {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.ManagedRules", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.ManagedRules.ManagedRuleSets", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, policyName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client WebApplicationFirewallPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Etag = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes Policy. -// Parameters: -// resourceGroupName - the name of the resource group. -// policyName - the name of the policy. -func (client WebApplicationFirewallPoliciesClient) Delete(ctx context.Context, resourceGroupName string, policyName string) (result WebApplicationFirewallPoliciesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: policyName, - Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WebApplicationFirewallPoliciesClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, policyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client WebApplicationFirewallPoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) DeleteSender(req *http.Request) (future WebApplicationFirewallPoliciesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieve protection policy with specified name within a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -// policyName - the name of the policy. -func (client WebApplicationFirewallPoliciesClient) Get(ctx context.Context, resourceGroupName string, policyName string) (result WebApplicationFirewallPolicy, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: policyName, - Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { - return result, validation.NewError("network.WebApplicationFirewallPoliciesClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, policyName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WebApplicationFirewallPoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "policyName": autorest.Encode("path", policyName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/{policyName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) GetResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all of the protection policies within a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client WebApplicationFirewallPoliciesClient) List(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.List") - defer func() { - sc := -1 - if result.wafplr.Response.Response != nil { - sc = result.wafplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.wafplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "List", resp, "Failure sending request") - return - } - - result.wafplr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "List", resp, "Failure responding to request") - return - } - if result.wafplr.hasNextLink() && result.wafplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client WebApplicationFirewallPoliciesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) ListResponder(resp *http.Response) (result WebApplicationFirewallPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client WebApplicationFirewallPoliciesClient) listNextResults(ctx context.Context, lastResults WebApplicationFirewallPolicyListResult) (result WebApplicationFirewallPolicyListResult, err error) { - req, err := lastResults.webApplicationFirewallPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client WebApplicationFirewallPoliciesClient) ListComplete(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets all the WAF policies in a subscription. -func (client WebApplicationFirewallPoliciesClient) ListAll(ctx context.Context) (result WebApplicationFirewallPolicyListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.ListAll") - defer func() { - sc := -1 - if result.wafplr.Response.Response != nil { - sc = result.wafplr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.wafplr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "ListAll", resp, "Failure sending request") - return - } - - result.wafplr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.wafplr.hasNextLink() && result.wafplr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client WebApplicationFirewallPoliciesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client WebApplicationFirewallPoliciesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client WebApplicationFirewallPoliciesClient) ListAllResponder(resp *http.Response) (result WebApplicationFirewallPolicyListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client WebApplicationFirewallPoliciesClient) listAllNextResults(ctx context.Context, lastResults WebApplicationFirewallPolicyListResult) (result WebApplicationFirewallPolicyListResult, err error) { - req, err := lastResults.webApplicationFirewallPolicyListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client WebApplicationFirewallPoliciesClient) ListAllComplete(ctx context.Context) (result WebApplicationFirewallPolicyListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPoliciesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webcategories.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webcategories.go deleted file mode 100644 index bc9fa35445d1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webcategories.go +++ /dev/null @@ -1,222 +0,0 @@ -package network - -// 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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// WebCategoriesClient is the network Client -type WebCategoriesClient struct { - BaseClient -} - -// NewWebCategoriesClient creates an instance of the WebCategoriesClient client. -func NewWebCategoriesClient(subscriptionID string) WebCategoriesClient { - return NewWebCategoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWebCategoriesClientWithBaseURI creates an instance of the WebCategoriesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWebCategoriesClientWithBaseURI(baseURI string, subscriptionID string) WebCategoriesClient { - return WebCategoriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets the specified Azure Web Category. -// Parameters: -// name - the name of the azureWebCategory. -// expand - expands resourceIds back referenced by the azureWebCategory resource. -func (client WebCategoriesClient) Get(ctx context.Context, name string, expand string) (result AzureWebCategory, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebCategoriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, name, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebCategoriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebCategoriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebCategoriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client WebCategoriesClient) GetPreparer(ctx context.Context, name string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories/{name}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client WebCategoriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client WebCategoriesClient) GetResponder(resp *http.Response) (result AzureWebCategory, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySubscription gets all the Azure Web Categories in a subscription. -func (client WebCategoriesClient) ListBySubscription(ctx context.Context) (result AzureWebCategoryListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebCategoriesClient.ListBySubscription") - defer func() { - sc := -1 - if result.awclr.Response.Response != nil { - sc = result.awclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebCategoriesClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.awclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.WebCategoriesClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.awclr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebCategoriesClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.awclr.hasNextLink() && result.awclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client WebCategoriesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2022-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureWebCategories", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client WebCategoriesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client WebCategoriesClient) ListBySubscriptionResponder(resp *http.Response) (result AzureWebCategoryListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client WebCategoriesClient) listBySubscriptionNextResults(ctx context.Context, lastResults AzureWebCategoryListResult) (result AzureWebCategoryListResult, err error) { - req, err := lastResults.azureWebCategoryListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "network.WebCategoriesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "network.WebCategoriesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.WebCategoriesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client WebCategoriesClient) ListBySubscriptionComplete(ctx context.Context) (result AzureWebCategoryListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/WebCategoriesClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/.gitattributes b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/.gitattributes deleted file mode 100644 index 94f480de94e1..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/.golangci.yml b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/.golangci.yml deleted file mode 100644 index af403bb13a08..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/.golangci.yml +++ /dev/null @@ -1,144 +0,0 @@ -run: - skip-dirs: - - pkg/etw/sample - -linters: - enable: - # style - - containedctx # struct contains a context - - dupl # duplicate code - - errname # erorrs are named correctly - - goconst # strings that should be constants - - godot # comments end in a period - - misspell - - nolintlint # "//nolint" directives are properly explained - - revive # golint replacement - - stylecheck # golint replacement, less configurable than revive - - unconvert # unnecessary conversions - - wastedassign - - # bugs, performance, unused, etc ... - - contextcheck # function uses a non-inherited context - - errorlint # errors not wrapped for 1.13 - - exhaustive # check exhaustiveness of enum switch statements - - gofmt # files are gofmt'ed - - gosec # security - - nestif # deeply nested ifs - - nilerr # returns nil even with non-nil error - - prealloc # slices that can be pre-allocated - - structcheck # unused struct fields - - unparam # unused function params - -issues: - exclude-rules: - # err is very often shadowed in nested scopes - - linters: - - govet - text: '^shadow: declaration of "err" shadows declaration' - - # ignore long lines for skip autogen directives - - linters: - - revive - text: "^line-length-limit: " - source: "^//(go:generate|sys) " - - # allow unjustified ignores of error checks in defer statements - - linters: - - nolintlint - text: "^directive `//nolint:errcheck` should provide explanation" - source: '^\s*defer ' - - # allow unjustified ignores of error lints for io.EOF - - linters: - - nolintlint - text: "^directive `//nolint:errorlint` should provide explanation" - source: '[=|!]= io.EOF' - - -linters-settings: - govet: - enable-all: true - disable: - # struct order is often for Win32 compat - # also, ignore pointer bytes/GC issues for now until performance becomes an issue - - fieldalignment - check-shadowing: true - nolintlint: - allow-leading-space: false - require-explanation: true - require-specific: true - revive: - # revive is more configurable than static check, so likely the preferred alternative to static-check - # (once the perf issue is solved: https://github.com/golangci/golangci-lint/issues/2997) - enable-all-rules: - true - # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md - rules: - # rules with required arguments - - name: argument-limit - disabled: true - - name: banned-characters - disabled: true - - name: cognitive-complexity - disabled: true - - name: cyclomatic - disabled: true - - name: file-header - disabled: true - - name: function-length - disabled: true - - name: function-result-limit - disabled: true - - name: max-public-structs - disabled: true - # geneally annoying rules - - name: add-constant # complains about any and all strings and integers - disabled: true - - name: confusing-naming # we frequently use "Foo()" and "foo()" together - disabled: true - - name: flag-parameter # excessive, and a common idiom we use - disabled: true - # general config - - name: line-length-limit - arguments: - - 140 - - name: var-naming - arguments: - - [] - - - CID - - CRI - - CTRD - - DACL - - DLL - - DOS - - ETW - - FSCTL - - GCS - - GMSA - - HCS - - HV - - IO - - LCOW - - LDAP - - LPAC - - LTSC - - MMIO - - NT - - OCI - - PMEM - - PWSH - - RX - - SACl - - SID - - SMB - - TX - - VHD - - VHDX - - VMID - - VPCI - - WCOW - - WIM - stylecheck: - checks: - - "all" - - "-ST1003" # use revive's var naming diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/SECURITY.md b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/SECURITY.md deleted file mode 100644 index 869fdfe2b246..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). - - diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/doc.go b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/doc.go deleted file mode 100644 index 1f5bfe2d548e..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -// This package provides utilities for efficiently performing Win32 IO operations in Go. -// Currently, this package is provides support for genreal IO and management of -// - named pipes -// - files -// - [Hyper-V sockets] -// -// This code is similar to Go's [net] package, and uses IO completion ports to avoid -// blocking IO on system threads, allowing Go to reuse the thread to schedule other goroutines. -// -// This limits support to Windows Vista and newer operating systems. -// -// Additionally, this package provides support for: -// - creating and managing GUIDs -// - writing to [ETW] -// - opening and manageing VHDs -// - parsing [Windows Image files] -// - auto-generating Win32 API code -// -// [Hyper-V sockets]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service -// [ETW]: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw- -// [Windows Image files]: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/work-with-windows-images -package winio diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go deleted file mode 100644 index 7e82f9afa952..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go +++ /dev/null @@ -1,20 +0,0 @@ -package socket - -import ( - "unsafe" -) - -// RawSockaddr allows structs to be used with [Bind] and [ConnectEx]. The -// struct must meet the Win32 sockaddr requirements specified here: -// https://docs.microsoft.com/en-us/windows/win32/winsock/sockaddr-2 -// -// Specifically, the struct size must be least larger than an int16 (unsigned short) -// for the address family. -type RawSockaddr interface { - // Sockaddr returns a pointer to the RawSockaddr and its struct size, allowing - // for the RawSockaddr's data to be overwritten by syscalls (if necessary). - // - // It is the callers responsibility to validate that the values are valid; invalid - // pointers or size can cause a panic. - Sockaddr() (unsafe.Pointer, int32, error) -} diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go deleted file mode 100644 index 39e8c05f8f3f..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build windows - -package socket - -import ( - "errors" - "fmt" - "net" - "sync" - "syscall" - "unsafe" - - "github.com/Microsoft/go-winio/pkg/guid" - "golang.org/x/sys/windows" -) - -//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go socket.go - -//sys getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) [failretval==socketError] = ws2_32.getsockname -//sys getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) [failretval==socketError] = ws2_32.getpeername -//sys bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socketError] = ws2_32.bind - -const socketError = uintptr(^uint32(0)) - -var ( - // todo(helsaawy): create custom error types to store the desired vs actual size and addr family? - - ErrBufferSize = errors.New("buffer size") - ErrAddrFamily = errors.New("address family") - ErrInvalidPointer = errors.New("invalid pointer") - ErrSocketClosed = fmt.Errorf("socket closed: %w", net.ErrClosed) -) - -// todo(helsaawy): replace these with generics, ie: GetSockName[S RawSockaddr](s windows.Handle) (S, error) - -// GetSockName writes the local address of socket s to the [RawSockaddr] rsa. -// If rsa is not large enough, the [windows.WSAEFAULT] is returned. -func GetSockName(s windows.Handle, rsa RawSockaddr) error { - ptr, l, err := rsa.Sockaddr() - if err != nil { - return fmt.Errorf("could not retrieve socket pointer and size: %w", err) - } - - // although getsockname returns WSAEFAULT if the buffer is too small, it does not set - // &l to the correct size, so--apart from doubling the buffer repeatedly--there is no remedy - return getsockname(s, ptr, &l) -} - -// GetPeerName returns the remote address the socket is connected to. -// -// See [GetSockName] for more information. -func GetPeerName(s windows.Handle, rsa RawSockaddr) error { - ptr, l, err := rsa.Sockaddr() - if err != nil { - return fmt.Errorf("could not retrieve socket pointer and size: %w", err) - } - - return getpeername(s, ptr, &l) -} - -func Bind(s windows.Handle, rsa RawSockaddr) (err error) { - ptr, l, err := rsa.Sockaddr() - if err != nil { - return fmt.Errorf("could not retrieve socket pointer and size: %w", err) - } - - return bind(s, ptr, l) -} - -// "golang.org/x/sys/windows".ConnectEx and .Bind only accept internal implementations of the -// their sockaddr interface, so they cannot be used with HvsockAddr -// Replicate functionality here from -// https://cs.opensource.google/go/x/sys/+/master:windows/syscall_windows.go - -// The function pointers to `AcceptEx`, `ConnectEx` and `GetAcceptExSockaddrs` must be loaded at -// runtime via a WSAIoctl call: -// https://docs.microsoft.com/en-us/windows/win32/api/Mswsock/nc-mswsock-lpfn_connectex#remarks - -type runtimeFunc struct { - id guid.GUID - once sync.Once - addr uintptr - err error -} - -func (f *runtimeFunc) Load() error { - f.once.Do(func() { - var s windows.Handle - s, f.err = windows.Socket(windows.AF_INET, windows.SOCK_STREAM, windows.IPPROTO_TCP) - if f.err != nil { - return - } - defer windows.CloseHandle(s) //nolint:errcheck - - var n uint32 - f.err = windows.WSAIoctl(s, - windows.SIO_GET_EXTENSION_FUNCTION_POINTER, - (*byte)(unsafe.Pointer(&f.id)), - uint32(unsafe.Sizeof(f.id)), - (*byte)(unsafe.Pointer(&f.addr)), - uint32(unsafe.Sizeof(f.addr)), - &n, - nil, //overlapped - 0, //completionRoutine - ) - }) - return f.err -} - -var ( - // todo: add `AcceptEx` and `GetAcceptExSockaddrs` - WSAID_CONNECTEX = guid.GUID{ //revive:disable-line:var-naming ALL_CAPS - Data1: 0x25a207b9, - Data2: 0xddf3, - Data3: 0x4660, - Data4: [8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}, - } - - connectExFunc = runtimeFunc{id: WSAID_CONNECTEX} -) - -func ConnectEx( - fd windows.Handle, - rsa RawSockaddr, - sendBuf *byte, - sendDataLen uint32, - bytesSent *uint32, - overlapped *windows.Overlapped, -) error { - if err := connectExFunc.Load(); err != nil { - return fmt.Errorf("failed to load ConnectEx function pointer: %w", err) - } - ptr, n, err := rsa.Sockaddr() - if err != nil { - return err - } - return connectEx(fd, ptr, n, sendBuf, sendDataLen, bytesSent, overlapped) -} - -// BOOL LpfnConnectex( -// [in] SOCKET s, -// [in] const sockaddr *name, -// [in] int namelen, -// [in, optional] PVOID lpSendBuffer, -// [in] DWORD dwSendDataLength, -// [out] LPDWORD lpdwBytesSent, -// [in] LPOVERLAPPED lpOverlapped -// ) - -func connectEx( - s windows.Handle, - name unsafe.Pointer, - namelen int32, - sendBuf *byte, - sendDataLen uint32, - bytesSent *uint32, - overlapped *windows.Overlapped, -) (err error) { - // todo: after upgrading to 1.18, switch from syscall.Syscall9 to syscall.SyscallN - r1, _, e1 := syscall.Syscall9(connectExFunc.addr, - 7, - uintptr(s), - uintptr(name), - uintptr(namelen), - uintptr(unsafe.Pointer(sendBuf)), - uintptr(sendDataLen), - uintptr(unsafe.Pointer(bytesSent)), - uintptr(unsafe.Pointer(overlapped)), - 0, - 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return err -} diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go deleted file mode 100644 index 6d2e1a9e4438..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build windows - -// Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT. - -package socket - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var _ unsafe.Pointer - -// Do the interface allocations only once for common -// Errno values. -const ( - errnoERROR_IO_PENDING = 997 -) - -var ( - errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) - errERROR_EINVAL error = syscall.EINVAL -) - -// errnoErr returns common boxed Errno values, to prevent -// allocations at runtime. -func errnoErr(e syscall.Errno) error { - switch e { - case 0: - return errERROR_EINVAL - case errnoERROR_IO_PENDING: - return errERROR_IO_PENDING - } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) - return e -} - -var ( - modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") - - procbind = modws2_32.NewProc("bind") - procgetpeername = modws2_32.NewProc("getpeername") - procgetsockname = modws2_32.NewProc("getsockname") -) - -func bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) - if r1 == socketError { - err = errnoErr(e1) - } - return -} - -func getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) - if r1 == socketError { - err = errnoErr(e1) - } - return -} - -func getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) - if r1 == socketError { - err = errnoErr(e1) - } - return -} diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go deleted file mode 100644 index 805bd3548424..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go +++ /dev/null @@ -1,16 +0,0 @@ -//go:build !windows -// +build !windows - -package guid - -// GUID represents a GUID/UUID. It has the same structure as -// golang.org/x/sys/windows.GUID so that it can be used with functions expecting -// that type. It is defined as its own type as that is only available to builds -// targeted at `windows`. The representation matches that used by native Windows -// code. -type GUID struct { - Data1 uint32 - Data2 uint16 - Data3 uint16 - Data4 [8]byte -} diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go deleted file mode 100644 index 27e45ee5ccf9..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build windows -// +build windows - -package guid - -import "golang.org/x/sys/windows" - -// GUID represents a GUID/UUID. It has the same structure as -// golang.org/x/sys/windows.GUID so that it can be used with functions expecting -// that type. It is defined as its own type so that stringification and -// marshaling can be supported. The representation matches that used by native -// Windows code. -type GUID windows.GUID diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go deleted file mode 100644 index 4076d3132fdd..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by "stringer -type=Variant -trimprefix=Variant -linecomment"; DO NOT EDIT. - -package guid - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[VariantUnknown-0] - _ = x[VariantNCS-1] - _ = x[VariantRFC4122-2] - _ = x[VariantMicrosoft-3] - _ = x[VariantFuture-4] -} - -const _Variant_name = "UnknownNCSRFC 4122MicrosoftFuture" - -var _Variant_index = [...]uint8{0, 7, 10, 18, 27, 33} - -func (i Variant) String() string { - if i >= Variant(len(_Variant_index)-1) { - return "Variant(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _Variant_name[_Variant_index[i]:_Variant_index[i+1]] -} diff --git a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/tools.go b/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/tools.go deleted file mode 100644 index 2aa045843ea8..000000000000 --- a/cluster-autoscaler/vendor/github.com/Microsoft/go-winio/tools.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build tools - -package winio - -import _ "golang.org/x/tools/cmd/stringer" diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/MAINTAINERS.md b/cluster-autoscaler/vendor/github.com/cilium/ebpf/MAINTAINERS.md deleted file mode 100644 index 9c18e7e76f54..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/MAINTAINERS.md +++ /dev/null @@ -1,8 +0,0 @@ -# Maintainers - - * [Lorenz Bauer] - * [Timo Beckers] (Isovalent) - - -[Lorenz Bauer]: https://github.com/lmb -[Timo Beckers]: https://github.com/ti-mo diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/metadata.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/metadata.go deleted file mode 100644 index dd368a936036..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/asm/metadata.go +++ /dev/null @@ -1,80 +0,0 @@ -package asm - -// Metadata contains metadata about an instruction. -type Metadata struct { - head *metaElement -} - -type metaElement struct { - next *metaElement - key, value interface{} -} - -// Find the element containing key. -// -// Returns nil if there is no such element. -func (m *Metadata) find(key interface{}) *metaElement { - for e := m.head; e != nil; e = e.next { - if e.key == key { - return e - } - } - return nil -} - -// Remove an element from the linked list. -// -// Copies as many elements of the list as necessary to remove r, but doesn't -// perform a full copy. -func (m *Metadata) remove(r *metaElement) { - current := &m.head - for e := m.head; e != nil; e = e.next { - if e == r { - // We've found the element we want to remove. - *current = e.next - - // No need to copy the tail. - return - } - - // There is another element in front of the one we want to remove. - // We have to copy it to be able to change metaElement.next. - cpy := &metaElement{key: e.key, value: e.value} - *current = cpy - current = &cpy.next - } -} - -// Set a key to a value. -// -// If value is nil, the key is removed. Avoids modifying old metadata by -// copying if necessary. -func (m *Metadata) Set(key, value interface{}) { - if e := m.find(key); e != nil { - if e.value == value { - // Key is present and the value is the same. Nothing to do. - return - } - - // Key is present with a different value. Create a copy of the list - // which doesn't have the element in it. - m.remove(e) - } - - // m.head is now a linked list that doesn't contain key. - if value == nil { - return - } - - m.head = &metaElement{key: key, value: value, next: m.head} -} - -// Get the value of a key. -// -// Returns nil if no value with the given key is present. -func (m *Metadata) Get(key interface{}) interface{} { - if e := m.find(key); e != nil { - return e.value - } - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf.go deleted file mode 100644 index a5969332aaa8..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf.go +++ /dev/null @@ -1,897 +0,0 @@ -package btf - -import ( - "bufio" - "bytes" - "debug/elf" - "encoding/binary" - "errors" - "fmt" - "io" - "math" - "os" - "reflect" - - "github.com/cilium/ebpf/internal" - "github.com/cilium/ebpf/internal/sys" - "github.com/cilium/ebpf/internal/unix" -) - -const btfMagic = 0xeB9F - -// Errors returned by BTF functions. -var ( - ErrNotSupported = internal.ErrNotSupported - ErrNotFound = errors.New("not found") - ErrNoExtendedInfo = errors.New("no extended info") -) - -// ID represents the unique ID of a BTF object. -type ID = sys.BTFID - -// Spec represents decoded BTF. -type Spec struct { - // Data from .BTF. - rawTypes []rawType - strings *stringTable - - // All types contained by the spec. For the base type, the position of - // a type in the slice is its ID. - types types - - // Type IDs indexed by type. - typeIDs map[Type]TypeID - - // Types indexed by essential name. - // Includes all struct flavors and types with the same name. - namedTypes map[essentialName][]Type - - byteOrder binary.ByteOrder -} - -type btfHeader struct { - Magic uint16 - Version uint8 - Flags uint8 - HdrLen uint32 - - TypeOff uint32 - TypeLen uint32 - StringOff uint32 - StringLen uint32 -} - -// typeStart returns the offset from the beginning of the .BTF section -// to the start of its type entries. -func (h *btfHeader) typeStart() int64 { - return int64(h.HdrLen + h.TypeOff) -} - -// stringStart returns the offset from the beginning of the .BTF section -// to the start of its string table. -func (h *btfHeader) stringStart() int64 { - return int64(h.HdrLen + h.StringOff) -} - -// LoadSpec opens file and calls LoadSpecFromReader on it. -func LoadSpec(file string) (*Spec, error) { - fh, err := os.Open(file) - if err != nil { - return nil, err - } - defer fh.Close() - - return LoadSpecFromReader(fh) -} - -// LoadSpecFromReader reads from an ELF or a raw BTF blob. -// -// Returns ErrNotFound if reading from an ELF which contains no BTF. ExtInfos -// may be nil. -func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) { - file, err := internal.NewSafeELFFile(rd) - if err != nil { - if bo := guessRawBTFByteOrder(rd); bo != nil { - // Try to parse a naked BTF blob. This will return an error if - // we encounter a Datasec, since we can't fix it up. - spec, err := loadRawSpec(io.NewSectionReader(rd, 0, math.MaxInt64), bo, nil, nil) - return spec, err - } - - return nil, err - } - - return loadSpecFromELF(file) -} - -// LoadSpecAndExtInfosFromReader reads from an ELF. -// -// ExtInfos may be nil if the ELF doesn't contain section metadta. -// Returns ErrNotFound if the ELF contains no BTF. -func LoadSpecAndExtInfosFromReader(rd io.ReaderAt) (*Spec, *ExtInfos, error) { - file, err := internal.NewSafeELFFile(rd) - if err != nil { - return nil, nil, err - } - - spec, err := loadSpecFromELF(file) - if err != nil { - return nil, nil, err - } - - extInfos, err := loadExtInfosFromELF(file, spec.types, spec.strings) - if err != nil && !errors.Is(err, ErrNotFound) { - return nil, nil, err - } - - return spec, extInfos, nil -} - -// variableOffsets extracts all symbols offsets from an ELF and indexes them by -// section and variable name. -// -// References to variables in BTF data sections carry unsigned 32-bit offsets. -// Some ELF symbols (e.g. in vmlinux) may point to virtual memory that is well -// beyond this range. Since these symbols cannot be described by BTF info, -// ignore them here. -func variableOffsets(file *internal.SafeELFFile) (map[variable]uint32, error) { - symbols, err := file.Symbols() - if err != nil { - return nil, fmt.Errorf("can't read symbols: %v", err) - } - - variableOffsets := make(map[variable]uint32) - for _, symbol := range symbols { - if idx := symbol.Section; idx >= elf.SHN_LORESERVE && idx <= elf.SHN_HIRESERVE { - // Ignore things like SHN_ABS - continue - } - - if symbol.Value > math.MaxUint32 { - // VarSecinfo offset is u32, cannot reference symbols in higher regions. - continue - } - - if int(symbol.Section) >= len(file.Sections) { - return nil, fmt.Errorf("symbol %s: invalid section %d", symbol.Name, symbol.Section) - } - - secName := file.Sections[symbol.Section].Name - variableOffsets[variable{secName, symbol.Name}] = uint32(symbol.Value) - } - - return variableOffsets, nil -} - -func loadSpecFromELF(file *internal.SafeELFFile) (*Spec, error) { - var ( - btfSection *elf.Section - sectionSizes = make(map[string]uint32) - ) - - for _, sec := range file.Sections { - switch sec.Name { - case ".BTF": - btfSection = sec - default: - if sec.Type != elf.SHT_PROGBITS && sec.Type != elf.SHT_NOBITS { - break - } - - if sec.Size > math.MaxUint32 { - return nil, fmt.Errorf("section %s exceeds maximum size", sec.Name) - } - - sectionSizes[sec.Name] = uint32(sec.Size) - } - } - - if btfSection == nil { - return nil, fmt.Errorf("btf: %w", ErrNotFound) - } - - vars, err := variableOffsets(file) - if err != nil { - return nil, err - } - - if btfSection.ReaderAt == nil { - return nil, fmt.Errorf("compressed BTF is not supported") - } - - rawTypes, rawStrings, err := parseBTF(btfSection.ReaderAt, file.ByteOrder, nil) - if err != nil { - return nil, err - } - - err = fixupDatasec(rawTypes, rawStrings, sectionSizes, vars) - if err != nil { - return nil, err - } - - return inflateSpec(rawTypes, rawStrings, file.ByteOrder, nil) -} - -func loadRawSpec(btf io.ReaderAt, bo binary.ByteOrder, - baseTypes types, baseStrings *stringTable) (*Spec, error) { - - rawTypes, rawStrings, err := parseBTF(btf, bo, baseStrings) - if err != nil { - return nil, err - } - - return inflateSpec(rawTypes, rawStrings, bo, baseTypes) -} - -func inflateSpec(rawTypes []rawType, rawStrings *stringTable, bo binary.ByteOrder, - baseTypes types) (*Spec, error) { - - types, err := inflateRawTypes(rawTypes, baseTypes, rawStrings) - if err != nil { - return nil, err - } - - typeIDs, typesByName := indexTypes(types, TypeID(len(baseTypes))) - - return &Spec{ - rawTypes: rawTypes, - namedTypes: typesByName, - typeIDs: typeIDs, - types: types, - strings: rawStrings, - byteOrder: bo, - }, nil -} - -func indexTypes(types []Type, typeIDOffset TypeID) (map[Type]TypeID, map[essentialName][]Type) { - namedTypes := 0 - for _, typ := range types { - if typ.TypeName() != "" { - // Do a pre-pass to figure out how big types by name has to be. - // Most types have unique names, so it's OK to ignore essentialName - // here. - namedTypes++ - } - } - - typeIDs := make(map[Type]TypeID, len(types)) - typesByName := make(map[essentialName][]Type, namedTypes) - - for i, typ := range types { - if name := newEssentialName(typ.TypeName()); name != "" { - typesByName[name] = append(typesByName[name], typ) - } - typeIDs[typ] = TypeID(i) + typeIDOffset - } - - return typeIDs, typesByName -} - -// LoadKernelSpec returns the current kernel's BTF information. -// -// Defaults to /sys/kernel/btf/vmlinux and falls back to scanning the file system -// for vmlinux ELFs. Returns an error wrapping ErrNotSupported if BTF is not enabled. -func LoadKernelSpec() (*Spec, error) { - fh, err := os.Open("/sys/kernel/btf/vmlinux") - if err == nil { - defer fh.Close() - - return loadRawSpec(fh, internal.NativeEndian, nil, nil) - } - - file, err := findVMLinux() - if err != nil { - return nil, err - } - defer file.Close() - - return loadSpecFromELF(file) -} - -// findVMLinux scans multiple well-known paths for vmlinux kernel images. -func findVMLinux() (*internal.SafeELFFile, error) { - release, err := internal.KernelRelease() - if err != nil { - return nil, err - } - - // use same list of locations as libbpf - // https://github.com/libbpf/libbpf/blob/9a3a42608dbe3731256a5682a125ac1e23bced8f/src/btf.c#L3114-L3122 - locations := []string{ - "/boot/vmlinux-%s", - "/lib/modules/%s/vmlinux-%[1]s", - "/lib/modules/%s/build/vmlinux", - "/usr/lib/modules/%s/kernel/vmlinux", - "/usr/lib/debug/boot/vmlinux-%s", - "/usr/lib/debug/boot/vmlinux-%s.debug", - "/usr/lib/debug/lib/modules/%s/vmlinux", - } - - for _, loc := range locations { - file, err := internal.OpenSafeELFFile(fmt.Sprintf(loc, release)) - if errors.Is(err, os.ErrNotExist) { - continue - } - return file, err - } - - return nil, fmt.Errorf("no BTF found for kernel version %s: %w", release, internal.ErrNotSupported) -} - -// parseBTFHeader parses the header of the .BTF section. -func parseBTFHeader(r io.Reader, bo binary.ByteOrder) (*btfHeader, error) { - var header btfHeader - if err := binary.Read(r, bo, &header); err != nil { - return nil, fmt.Errorf("can't read header: %v", err) - } - - if header.Magic != btfMagic { - return nil, fmt.Errorf("incorrect magic value %v", header.Magic) - } - - if header.Version != 1 { - return nil, fmt.Errorf("unexpected version %v", header.Version) - } - - if header.Flags != 0 { - return nil, fmt.Errorf("unsupported flags %v", header.Flags) - } - - remainder := int64(header.HdrLen) - int64(binary.Size(&header)) - if remainder < 0 { - return nil, errors.New("header length shorter than btfHeader size") - } - - if _, err := io.CopyN(internal.DiscardZeroes{}, r, remainder); err != nil { - return nil, fmt.Errorf("header padding: %v", err) - } - - return &header, nil -} - -func guessRawBTFByteOrder(r io.ReaderAt) binary.ByteOrder { - buf := new(bufio.Reader) - for _, bo := range []binary.ByteOrder{ - binary.LittleEndian, - binary.BigEndian, - } { - buf.Reset(io.NewSectionReader(r, 0, math.MaxInt64)) - if _, err := parseBTFHeader(buf, bo); err == nil { - return bo - } - } - - return nil -} - -// parseBTF reads a .BTF section into memory and parses it into a list of -// raw types and a string table. -func parseBTF(btf io.ReaderAt, bo binary.ByteOrder, baseStrings *stringTable) ([]rawType, *stringTable, error) { - buf := internal.NewBufferedSectionReader(btf, 0, math.MaxInt64) - header, err := parseBTFHeader(buf, bo) - if err != nil { - return nil, nil, fmt.Errorf("parsing .BTF header: %v", err) - } - - rawStrings, err := readStringTable(io.NewSectionReader(btf, header.stringStart(), int64(header.StringLen)), - baseStrings) - if err != nil { - return nil, nil, fmt.Errorf("can't read type names: %w", err) - } - - buf.Reset(io.NewSectionReader(btf, header.typeStart(), int64(header.TypeLen))) - rawTypes, err := readTypes(buf, bo, header.TypeLen) - if err != nil { - return nil, nil, fmt.Errorf("can't read types: %w", err) - } - - return rawTypes, rawStrings, nil -} - -type variable struct { - section string - name string -} - -func fixupDatasec(rawTypes []rawType, rawStrings *stringTable, sectionSizes map[string]uint32, variableOffsets map[variable]uint32) error { - for i, rawType := range rawTypes { - if rawType.Kind() != kindDatasec { - continue - } - - name, err := rawStrings.Lookup(rawType.NameOff) - if err != nil { - return err - } - - if name == ".kconfig" || name == ".ksyms" { - return fmt.Errorf("reference to %s: %w", name, ErrNotSupported) - } - - if rawTypes[i].SizeType != 0 { - continue - } - - size, ok := sectionSizes[name] - if !ok { - return fmt.Errorf("data section %s: missing size", name) - } - - rawTypes[i].SizeType = size - - secinfos := rawType.data.([]btfVarSecinfo) - for j, secInfo := range secinfos { - id := int(secInfo.Type - 1) - if id >= len(rawTypes) { - return fmt.Errorf("data section %s: invalid type id %d for variable %d", name, id, j) - } - - varName, err := rawStrings.Lookup(rawTypes[id].NameOff) - if err != nil { - return fmt.Errorf("data section %s: can't get name for type %d: %w", name, id, err) - } - - offset, ok := variableOffsets[variable{name, varName}] - if !ok { - return fmt.Errorf("data section %s: missing offset for variable %s", name, varName) - } - - secinfos[j].Offset = offset - } - } - - return nil -} - -// Copy creates a copy of Spec. -func (s *Spec) Copy() *Spec { - types := copyTypes(s.types, nil) - - typeIDOffset := TypeID(0) - if len(s.types) != 0 { - typeIDOffset = s.typeIDs[s.types[0]] - } - typeIDs, typesByName := indexTypes(types, typeIDOffset) - - // NB: Other parts of spec are not copied since they are immutable. - return &Spec{ - s.rawTypes, - s.strings, - types, - typeIDs, - typesByName, - s.byteOrder, - } -} - -type marshalOpts struct { - ByteOrder binary.ByteOrder - StripFuncLinkage bool -} - -func (s *Spec) marshal(opts marshalOpts) ([]byte, error) { - var ( - buf bytes.Buffer - header = new(btfHeader) - headerLen = binary.Size(header) - ) - - // Reserve space for the header. We have to write it last since - // we don't know the size of the type section yet. - _, _ = buf.Write(make([]byte, headerLen)) - - // Write type section, just after the header. - for _, raw := range s.rawTypes { - switch { - case opts.StripFuncLinkage && raw.Kind() == kindFunc: - raw.SetLinkage(StaticFunc) - } - - if err := raw.Marshal(&buf, opts.ByteOrder); err != nil { - return nil, fmt.Errorf("can't marshal BTF: %w", err) - } - } - - typeLen := uint32(buf.Len() - headerLen) - - // Write string section after type section. - stringsLen := s.strings.Length() - buf.Grow(stringsLen) - if err := s.strings.Marshal(&buf); err != nil { - return nil, err - } - - // Fill out the header, and write it out. - header = &btfHeader{ - Magic: btfMagic, - Version: 1, - Flags: 0, - HdrLen: uint32(headerLen), - TypeOff: 0, - TypeLen: typeLen, - StringOff: typeLen, - StringLen: uint32(stringsLen), - } - - raw := buf.Bytes() - err := binary.Write(sliceWriter(raw[:headerLen]), opts.ByteOrder, header) - if err != nil { - return nil, fmt.Errorf("can't write header: %v", err) - } - - return raw, nil -} - -type sliceWriter []byte - -func (sw sliceWriter) Write(p []byte) (int, error) { - if len(p) != len(sw) { - return 0, errors.New("size doesn't match") - } - - return copy(sw, p), nil -} - -// TypeByID returns the BTF Type with the given type ID. -// -// Returns an error wrapping ErrNotFound if a Type with the given ID -// does not exist in the Spec. -func (s *Spec) TypeByID(id TypeID) (Type, error) { - return s.types.ByID(id) -} - -// TypeID returns the ID for a given Type. -// -// Returns an error wrapping ErrNoFound if the type isn't part of the Spec. -func (s *Spec) TypeID(typ Type) (TypeID, error) { - if _, ok := typ.(*Void); ok { - // Equality is weird for void, since it is a zero sized type. - return 0, nil - } - - id, ok := s.typeIDs[typ] - if !ok { - return 0, fmt.Errorf("no ID for type %s: %w", typ, ErrNotFound) - } - - return id, nil -} - -// AnyTypesByName returns a list of BTF Types with the given name. -// -// If the BTF blob describes multiple compilation units like vmlinux, multiple -// Types with the same name and kind can exist, but might not describe the same -// data structure. -// -// Returns an error wrapping ErrNotFound if no matching Type exists in the Spec. -func (s *Spec) AnyTypesByName(name string) ([]Type, error) { - types := s.namedTypes[newEssentialName(name)] - if len(types) == 0 { - return nil, fmt.Errorf("type name %s: %w", name, ErrNotFound) - } - - // Return a copy to prevent changes to namedTypes. - result := make([]Type, 0, len(types)) - for _, t := range types { - // Match against the full name, not just the essential one - // in case the type being looked up is a struct flavor. - if t.TypeName() == name { - result = append(result, t) - } - } - return result, nil -} - -// AnyTypeByName returns a Type with the given name. -// -// Returns an error if multiple types of that name exist. -func (s *Spec) AnyTypeByName(name string) (Type, error) { - types, err := s.AnyTypesByName(name) - if err != nil { - return nil, err - } - - if len(types) > 1 { - return nil, fmt.Errorf("found multiple types: %v", types) - } - - return types[0], nil -} - -// TypeByName searches for a Type with a specific name. Since multiple -// Types with the same name can exist, the parameter typ is taken to -// narrow down the search in case of a clash. -// -// typ must be a non-nil pointer to an implementation of a Type. -// On success, the address of the found Type will be copied to typ. -// -// Returns an error wrapping ErrNotFound if no matching -// Type exists in the Spec. If multiple candidates are found, -// an error is returned. -func (s *Spec) TypeByName(name string, typ interface{}) error { - typValue := reflect.ValueOf(typ) - if typValue.Kind() != reflect.Ptr { - return fmt.Errorf("%T is not a pointer", typ) - } - - typPtr := typValue.Elem() - if !typPtr.CanSet() { - return fmt.Errorf("%T cannot be set", typ) - } - - wanted := typPtr.Type() - if !wanted.AssignableTo(reflect.TypeOf((*Type)(nil)).Elem()) { - return fmt.Errorf("%T does not satisfy Type interface", typ) - } - - types, err := s.AnyTypesByName(name) - if err != nil { - return err - } - - var candidate Type - for _, typ := range types { - if reflect.TypeOf(typ) != wanted { - continue - } - - if candidate != nil { - return fmt.Errorf("type %s: multiple candidates for %T", name, typ) - } - - candidate = typ - } - - if candidate == nil { - return fmt.Errorf("type %s: %w", name, ErrNotFound) - } - - typPtr.Set(reflect.ValueOf(candidate)) - - return nil -} - -// LoadSplitSpecFromReader loads split BTF from a reader. -// -// Types from base are used to resolve references in the split BTF. -// The returned Spec only contains types from the split BTF, not from the base. -func LoadSplitSpecFromReader(r io.ReaderAt, base *Spec) (*Spec, error) { - return loadRawSpec(r, internal.NativeEndian, base.types, base.strings) -} - -// TypesIterator iterates over types of a given spec. -type TypesIterator struct { - spec *Spec - index int - // The last visited type in the spec. - Type Type -} - -// Iterate returns the types iterator. -func (s *Spec) Iterate() *TypesIterator { - return &TypesIterator{spec: s, index: 0} -} - -// Next returns true as long as there are any remaining types. -func (iter *TypesIterator) Next() bool { - if len(iter.spec.types) <= iter.index { - return false - } - - iter.Type = iter.spec.types[iter.index] - iter.index++ - return true -} - -// Handle is a reference to BTF loaded into the kernel. -type Handle struct { - fd *sys.FD - - // Size of the raw BTF in bytes. - size uint32 -} - -// NewHandle loads BTF into the kernel. -// -// Returns ErrNotSupported if BTF is not supported. -func NewHandle(spec *Spec) (*Handle, error) { - if err := haveBTF(); err != nil { - return nil, err - } - - if spec.byteOrder != internal.NativeEndian { - return nil, fmt.Errorf("can't load %s BTF on %s", spec.byteOrder, internal.NativeEndian) - } - - btf, err := spec.marshal(marshalOpts{ - ByteOrder: internal.NativeEndian, - StripFuncLinkage: haveFuncLinkage() != nil, - }) - if err != nil { - return nil, fmt.Errorf("can't marshal BTF: %w", err) - } - - if uint64(len(btf)) > math.MaxUint32 { - return nil, errors.New("BTF exceeds the maximum size") - } - - attr := &sys.BtfLoadAttr{ - Btf: sys.NewSlicePointer(btf), - BtfSize: uint32(len(btf)), - } - - fd, err := sys.BtfLoad(attr) - if err != nil { - logBuf := make([]byte, 64*1024) - attr.BtfLogBuf = sys.NewSlicePointer(logBuf) - attr.BtfLogSize = uint32(len(logBuf)) - attr.BtfLogLevel = 1 - // NB: The syscall will never return ENOSPC as of 5.18-rc4. - _, _ = sys.BtfLoad(attr) - return nil, internal.ErrorWithLog(err, logBuf) - } - - return &Handle{fd, attr.BtfSize}, nil -} - -// NewHandleFromID returns the BTF handle for a given id. -// -// Prefer calling [ebpf.Program.Handle] or [ebpf.Map.Handle] if possible. -// -// Returns ErrNotExist, if there is no BTF with the given id. -// -// Requires CAP_SYS_ADMIN. -func NewHandleFromID(id ID) (*Handle, error) { - fd, err := sys.BtfGetFdById(&sys.BtfGetFdByIdAttr{ - Id: uint32(id), - }) - if err != nil { - return nil, fmt.Errorf("get FD for ID %d: %w", id, err) - } - - info, err := newHandleInfoFromFD(fd) - if err != nil { - _ = fd.Close() - return nil, err - } - - return &Handle{fd, info.size}, nil -} - -// Spec parses the kernel BTF into Go types. -// -// base is used to decode split BTF and may be nil. -func (h *Handle) Spec(base *Spec) (*Spec, error) { - var btfInfo sys.BtfInfo - btfBuffer := make([]byte, h.size) - btfInfo.Btf, btfInfo.BtfSize = sys.NewSlicePointerLen(btfBuffer) - - if err := sys.ObjInfo(h.fd, &btfInfo); err != nil { - return nil, err - } - - var baseTypes types - var baseStrings *stringTable - if base != nil { - baseTypes = base.types - baseStrings = base.strings - } - - return loadRawSpec(bytes.NewReader(btfBuffer), internal.NativeEndian, baseTypes, baseStrings) -} - -// Close destroys the handle. -// -// Subsequent calls to FD will return an invalid value. -func (h *Handle) Close() error { - if h == nil { - return nil - } - - return h.fd.Close() -} - -// FD returns the file descriptor for the handle. -func (h *Handle) FD() int { - return h.fd.Int() -} - -// Info returns metadata about the handle. -func (h *Handle) Info() (*HandleInfo, error) { - return newHandleInfoFromFD(h.fd) -} - -func marshalBTF(types interface{}, strings []byte, bo binary.ByteOrder) []byte { - const minHeaderLength = 24 - - typesLen := uint32(binary.Size(types)) - header := btfHeader{ - Magic: btfMagic, - Version: 1, - HdrLen: minHeaderLength, - TypeOff: 0, - TypeLen: typesLen, - StringOff: typesLen, - StringLen: uint32(len(strings)), - } - - buf := new(bytes.Buffer) - _ = binary.Write(buf, bo, &header) - _ = binary.Write(buf, bo, types) - buf.Write(strings) - - return buf.Bytes() -} - -var haveBTF = internal.FeatureTest("BTF", "5.1", func() error { - var ( - types struct { - Integer btfType - Var btfType - btfVar struct{ Linkage uint32 } - } - strings = []byte{0, 'a', 0} - ) - - // We use a BTF_KIND_VAR here, to make sure that - // the kernel understands BTF at least as well as we - // do. BTF_KIND_VAR was introduced ~5.1. - types.Integer.SetKind(kindPointer) - types.Var.NameOff = 1 - types.Var.SetKind(kindVar) - types.Var.SizeType = 1 - - btf := marshalBTF(&types, strings, internal.NativeEndian) - - fd, err := sys.BtfLoad(&sys.BtfLoadAttr{ - Btf: sys.NewSlicePointer(btf), - BtfSize: uint32(len(btf)), - }) - if errors.Is(err, unix.EINVAL) || errors.Is(err, unix.EPERM) { - // Treat both EINVAL and EPERM as not supported: loading the program - // might still succeed without BTF. - return internal.ErrNotSupported - } - if err != nil { - return err - } - - fd.Close() - return nil -}) - -var haveFuncLinkage = internal.FeatureTest("BTF func linkage", "5.6", func() error { - if err := haveBTF(); err != nil { - return err - } - - var ( - types struct { - FuncProto btfType - Func btfType - } - strings = []byte{0, 'a', 0} - ) - - types.FuncProto.SetKind(kindFuncProto) - types.Func.SetKind(kindFunc) - types.Func.SizeType = 1 // aka FuncProto - types.Func.NameOff = 1 - types.Func.SetLinkage(GlobalFunc) - - btf := marshalBTF(&types, strings, internal.NativeEndian) - - fd, err := sys.BtfLoad(&sys.BtfLoadAttr{ - Btf: sys.NewSlicePointer(btf), - BtfSize: uint32(len(btf)), - }) - if errors.Is(err, unix.EINVAL) { - return internal.ErrNotSupported - } - if err != nil { - return err - } - - fd.Close() - return nil -}) diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf_types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf_types.go deleted file mode 100644 index 4810180494e6..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf_types.go +++ /dev/null @@ -1,343 +0,0 @@ -package btf - -import ( - "encoding/binary" - "fmt" - "io" -) - -//go:generate stringer -linecomment -output=btf_types_string.go -type=FuncLinkage,VarLinkage - -// btfKind describes a Type. -type btfKind uint8 - -// Equivalents of the BTF_KIND_* constants. -const ( - kindUnknown btfKind = iota - kindInt - kindPointer - kindArray - kindStruct - kindUnion - kindEnum - kindForward - kindTypedef - kindVolatile - kindConst - kindRestrict - // Added ~4.20 - kindFunc - kindFuncProto - // Added ~5.1 - kindVar - kindDatasec - // Added ~5.13 - kindFloat -) - -// FuncLinkage describes BTF function linkage metadata. -type FuncLinkage int - -// Equivalent of enum btf_func_linkage. -const ( - StaticFunc FuncLinkage = iota // static - GlobalFunc // global - ExternFunc // extern -) - -// VarLinkage describes BTF variable linkage metadata. -type VarLinkage int - -const ( - StaticVar VarLinkage = iota // static - GlobalVar // global - ExternVar // extern -) - -const ( - btfTypeKindShift = 24 - btfTypeKindLen = 5 - btfTypeVlenShift = 0 - btfTypeVlenMask = 16 - btfTypeKindFlagShift = 31 - btfTypeKindFlagMask = 1 -) - -// btfType is equivalent to struct btf_type in Documentation/bpf/btf.rst. -type btfType struct { - NameOff uint32 - /* "info" bits arrangement - * bits 0-15: vlen (e.g. # of struct's members), linkage - * bits 16-23: unused - * bits 24-28: kind (e.g. int, ptr, array...etc) - * bits 29-30: unused - * bit 31: kind_flag, currently used by - * struct, union and fwd - */ - Info uint32 - /* "size" is used by INT, ENUM, STRUCT and UNION. - * "size" tells the size of the type it is describing. - * - * "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT, - * FUNC and FUNC_PROTO. - * "type" is a type_id referring to another type. - */ - SizeType uint32 -} - -func (k btfKind) String() string { - switch k { - case kindUnknown: - return "Unknown" - case kindInt: - return "Integer" - case kindPointer: - return "Pointer" - case kindArray: - return "Array" - case kindStruct: - return "Struct" - case kindUnion: - return "Union" - case kindEnum: - return "Enumeration" - case kindForward: - return "Forward" - case kindTypedef: - return "Typedef" - case kindVolatile: - return "Volatile" - case kindConst: - return "Const" - case kindRestrict: - return "Restrict" - case kindFunc: - return "Function" - case kindFuncProto: - return "Function Proto" - case kindVar: - return "Variable" - case kindDatasec: - return "Section" - case kindFloat: - return "Float" - default: - return fmt.Sprintf("Unknown (%d)", k) - } -} - -func mask(len uint32) uint32 { - return (1 << len) - 1 -} - -func readBits(value, len, shift uint32) uint32 { - return (value >> shift) & mask(len) -} - -func writeBits(value, len, shift, new uint32) uint32 { - value &^= mask(len) << shift - value |= (new & mask(len)) << shift - return value -} - -func (bt *btfType) info(len, shift uint32) uint32 { - return readBits(bt.Info, len, shift) -} - -func (bt *btfType) setInfo(value, len, shift uint32) { - bt.Info = writeBits(bt.Info, len, shift, value) -} - -func (bt *btfType) Kind() btfKind { - return btfKind(bt.info(btfTypeKindLen, btfTypeKindShift)) -} - -func (bt *btfType) SetKind(kind btfKind) { - bt.setInfo(uint32(kind), btfTypeKindLen, btfTypeKindShift) -} - -func (bt *btfType) Vlen() int { - return int(bt.info(btfTypeVlenMask, btfTypeVlenShift)) -} - -func (bt *btfType) SetVlen(vlen int) { - bt.setInfo(uint32(vlen), btfTypeVlenMask, btfTypeVlenShift) -} - -func (bt *btfType) KindFlag() bool { - return bt.info(btfTypeKindFlagMask, btfTypeKindFlagShift) == 1 -} - -func (bt *btfType) Linkage() FuncLinkage { - return FuncLinkage(bt.info(btfTypeVlenMask, btfTypeVlenShift)) -} - -func (bt *btfType) SetLinkage(linkage FuncLinkage) { - bt.setInfo(uint32(linkage), btfTypeVlenMask, btfTypeVlenShift) -} - -func (bt *btfType) Type() TypeID { - // TODO: Panic here if wrong kind? - return TypeID(bt.SizeType) -} - -func (bt *btfType) Size() uint32 { - // TODO: Panic here if wrong kind? - return bt.SizeType -} - -func (bt *btfType) SetSize(size uint32) { - bt.SizeType = size -} - -type rawType struct { - btfType - data interface{} -} - -func (rt *rawType) Marshal(w io.Writer, bo binary.ByteOrder) error { - if err := binary.Write(w, bo, &rt.btfType); err != nil { - return err - } - - if rt.data == nil { - return nil - } - - return binary.Write(w, bo, rt.data) -} - -// btfInt encodes additional data for integers. -// -// ? ? ? ? e e e e o o o o o o o o ? ? ? ? ? ? ? ? b b b b b b b b -// ? = undefined -// e = encoding -// o = offset (bitfields?) -// b = bits (bitfields) -type btfInt struct { - Raw uint32 -} - -const ( - btfIntEncodingLen = 4 - btfIntEncodingShift = 24 - btfIntOffsetLen = 8 - btfIntOffsetShift = 16 - btfIntBitsLen = 8 - btfIntBitsShift = 0 -) - -func (bi btfInt) Encoding() IntEncoding { - return IntEncoding(readBits(bi.Raw, btfIntEncodingLen, btfIntEncodingShift)) -} - -func (bi *btfInt) SetEncoding(e IntEncoding) { - bi.Raw = writeBits(uint32(bi.Raw), btfIntEncodingLen, btfIntEncodingShift, uint32(e)) -} - -func (bi btfInt) Offset() Bits { - return Bits(readBits(bi.Raw, btfIntOffsetLen, btfIntOffsetShift)) -} - -func (bi *btfInt) SetOffset(offset uint32) { - bi.Raw = writeBits(bi.Raw, btfIntOffsetLen, btfIntOffsetShift, offset) -} - -func (bi btfInt) Bits() Bits { - return Bits(readBits(bi.Raw, btfIntBitsLen, btfIntBitsShift)) -} - -func (bi *btfInt) SetBits(bits byte) { - bi.Raw = writeBits(bi.Raw, btfIntBitsLen, btfIntBitsShift, uint32(bits)) -} - -type btfArray struct { - Type TypeID - IndexType TypeID - Nelems uint32 -} - -type btfMember struct { - NameOff uint32 - Type TypeID - Offset uint32 -} - -type btfVarSecinfo struct { - Type TypeID - Offset uint32 - Size uint32 -} - -type btfVariable struct { - Linkage uint32 -} - -type btfEnum struct { - NameOff uint32 - Val int32 -} - -type btfParam struct { - NameOff uint32 - Type TypeID -} - -func readTypes(r io.Reader, bo binary.ByteOrder, typeLen uint32) ([]rawType, error) { - var header btfType - // because of the interleaving between types and struct members it is difficult to - // precompute the numbers of raw types this will parse - // this "guess" is a good first estimation - sizeOfbtfType := uintptr(binary.Size(btfType{})) - tyMaxCount := uintptr(typeLen) / sizeOfbtfType / 2 - types := make([]rawType, 0, tyMaxCount) - - for id := TypeID(1); ; id++ { - if err := binary.Read(r, bo, &header); err == io.EOF { - return types, nil - } else if err != nil { - return nil, fmt.Errorf("can't read type info for id %v: %v", id, err) - } - - var data interface{} - switch header.Kind() { - case kindInt: - data = new(btfInt) - case kindPointer: - case kindArray: - data = new(btfArray) - case kindStruct: - fallthrough - case kindUnion: - data = make([]btfMember, header.Vlen()) - case kindEnum: - data = make([]btfEnum, header.Vlen()) - case kindForward: - case kindTypedef: - case kindVolatile: - case kindConst: - case kindRestrict: - case kindFunc: - case kindFuncProto: - data = make([]btfParam, header.Vlen()) - case kindVar: - data = new(btfVariable) - case kindDatasec: - data = make([]btfVarSecinfo, header.Vlen()) - case kindFloat: - default: - return nil, fmt.Errorf("type id %v: unknown kind: %v", id, header.Kind()) - } - - if data == nil { - types = append(types, rawType{header, nil}) - continue - } - - if err := binary.Read(r, bo, data); err != nil { - return nil, fmt.Errorf("type id %d: kind %v: can't read %T: %v", id, header.Kind(), data, err) - } - - types = append(types, rawType{header, data}) - } -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf_types_string.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf_types_string.go deleted file mode 100644 index 0e0c17d68ba9..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/btf_types_string.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by "stringer -linecomment -output=btf_types_string.go -type=FuncLinkage,VarLinkage"; DO NOT EDIT. - -package btf - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[StaticFunc-0] - _ = x[GlobalFunc-1] - _ = x[ExternFunc-2] -} - -const _FuncLinkage_name = "staticglobalextern" - -var _FuncLinkage_index = [...]uint8{0, 6, 12, 18} - -func (i FuncLinkage) String() string { - if i < 0 || i >= FuncLinkage(len(_FuncLinkage_index)-1) { - return "FuncLinkage(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _FuncLinkage_name[_FuncLinkage_index[i]:_FuncLinkage_index[i+1]] -} -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[StaticVar-0] - _ = x[GlobalVar-1] - _ = x[ExternVar-2] -} - -const _VarLinkage_name = "staticglobalextern" - -var _VarLinkage_index = [...]uint8{0, 6, 12, 18} - -func (i VarLinkage) String() string { - if i < 0 || i >= VarLinkage(len(_VarLinkage_index)-1) { - return "VarLinkage(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _VarLinkage_name[_VarLinkage_index[i]:_VarLinkage_index[i+1]] -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/core.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/core.go deleted file mode 100644 index c48754809355..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/core.go +++ /dev/null @@ -1,972 +0,0 @@ -package btf - -import ( - "encoding/binary" - "errors" - "fmt" - "math" - "reflect" - "strconv" - "strings" - - "github.com/cilium/ebpf/asm" -) - -// Code in this file is derived from libbpf, which is available under a BSD -// 2-Clause license. - -// COREFixup is the result of computing a CO-RE relocation for a target. -type COREFixup struct { - kind coreKind - local uint32 - target uint32 - // True if there is no valid fixup. The instruction is replaced with an - // invalid dummy. - poison bool - // True if the validation of the local value should be skipped. Used by - // some kinds of bitfield relocations. - skipLocalValidation bool -} - -func (f *COREFixup) equal(other COREFixup) bool { - return f.local == other.local && f.target == other.target -} - -func (f *COREFixup) String() string { - if f.poison { - return fmt.Sprintf("%s=poison", f.kind) - } - return fmt.Sprintf("%s=%d->%d", f.kind, f.local, f.target) -} - -func (f *COREFixup) Apply(ins *asm.Instruction) error { - if f.poison { - const badRelo = 0xbad2310 - - *ins = asm.BuiltinFunc(badRelo).Call() - return nil - } - - switch class := ins.OpCode.Class(); class { - case asm.LdXClass, asm.StClass, asm.StXClass: - if want := int16(f.local); !f.skipLocalValidation && want != ins.Offset { - return fmt.Errorf("invalid offset %d, expected %d", ins.Offset, f.local) - } - - if f.target > math.MaxInt16 { - return fmt.Errorf("offset %d exceeds MaxInt16", f.target) - } - - ins.Offset = int16(f.target) - - case asm.LdClass: - if !ins.IsConstantLoad(asm.DWord) { - return fmt.Errorf("not a dword-sized immediate load") - } - - if want := int64(f.local); !f.skipLocalValidation && want != ins.Constant { - return fmt.Errorf("invalid immediate %d, expected %d (fixup: %v)", ins.Constant, want, f) - } - - ins.Constant = int64(f.target) - - case asm.ALUClass: - if ins.OpCode.ALUOp() == asm.Swap { - return fmt.Errorf("relocation against swap") - } - - fallthrough - - case asm.ALU64Class: - if src := ins.OpCode.Source(); src != asm.ImmSource { - return fmt.Errorf("invalid source %s", src) - } - - if want := int64(f.local); !f.skipLocalValidation && want != ins.Constant { - return fmt.Errorf("invalid immediate %d, expected %d (fixup: %v, kind: %v, ins: %v)", ins.Constant, want, f, f.kind, ins) - } - - if f.target > math.MaxInt32 { - return fmt.Errorf("immediate %d exceeds MaxInt32", f.target) - } - - ins.Constant = int64(f.target) - - default: - return fmt.Errorf("invalid class %s", class) - } - - return nil -} - -func (f COREFixup) isNonExistant() bool { - return f.kind.checksForExistence() && f.target == 0 -} - -// coreKind is the type of CO-RE relocation as specified in BPF source code. -type coreKind uint32 - -const ( - reloFieldByteOffset coreKind = iota /* field byte offset */ - reloFieldByteSize /* field size in bytes */ - reloFieldExists /* field existence in target kernel */ - reloFieldSigned /* field signedness (0 - unsigned, 1 - signed) */ - reloFieldLShiftU64 /* bitfield-specific left bitshift */ - reloFieldRShiftU64 /* bitfield-specific right bitshift */ - reloTypeIDLocal /* type ID in local BPF object */ - reloTypeIDTarget /* type ID in target kernel */ - reloTypeExists /* type existence in target kernel */ - reloTypeSize /* type size in bytes */ - reloEnumvalExists /* enum value existence in target kernel */ - reloEnumvalValue /* enum value integer value */ -) - -func (k coreKind) checksForExistence() bool { - return k == reloEnumvalExists || k == reloTypeExists || k == reloFieldExists -} - -func (k coreKind) String() string { - switch k { - case reloFieldByteOffset: - return "byte_off" - case reloFieldByteSize: - return "byte_sz" - case reloFieldExists: - return "field_exists" - case reloFieldSigned: - return "signed" - case reloFieldLShiftU64: - return "lshift_u64" - case reloFieldRShiftU64: - return "rshift_u64" - case reloTypeIDLocal: - return "local_type_id" - case reloTypeIDTarget: - return "target_type_id" - case reloTypeExists: - return "type_exists" - case reloTypeSize: - return "type_size" - case reloEnumvalExists: - return "enumval_exists" - case reloEnumvalValue: - return "enumval_value" - default: - return "unknown" - } -} - -// CORERelocate calculates the difference in types between local and target. -// -// Returns a list of fixups which can be applied to instructions to make them -// match the target type(s). -// -// Fixups are returned in the order of relos, e.g. fixup[i] is the solution -// for relos[i]. -func CORERelocate(local, target *Spec, relos []*CORERelocation) ([]COREFixup, error) { - if local.byteOrder != target.byteOrder { - return nil, fmt.Errorf("can't relocate %s against %s", local.byteOrder, target.byteOrder) - } - - type reloGroup struct { - relos []*CORERelocation - // Position of each relocation in relos. - indices []int - } - - // Split relocations into per Type lists. - relosByType := make(map[Type]*reloGroup) - result := make([]COREFixup, len(relos)) - for i, relo := range relos { - if relo.kind == reloTypeIDLocal { - // Filtering out reloTypeIDLocal here makes our lives a lot easier - // down the line, since it doesn't have a target at all. - if len(relo.accessor) > 1 || relo.accessor[0] != 0 { - return nil, fmt.Errorf("%s: unexpected accessor %v", relo.kind, relo.accessor) - } - - id, err := local.TypeID(relo.typ) - if err != nil { - return nil, fmt.Errorf("%s: %w", relo.kind, err) - } - - result[i] = COREFixup{ - kind: relo.kind, - local: uint32(id), - target: uint32(id), - } - continue - } - - group, ok := relosByType[relo.typ] - if !ok { - group = &reloGroup{} - relosByType[relo.typ] = group - } - group.relos = append(group.relos, relo) - group.indices = append(group.indices, i) - } - - for localType, group := range relosByType { - localTypeName := localType.TypeName() - if localTypeName == "" { - return nil, fmt.Errorf("relocate unnamed or anonymous type %s: %w", localType, ErrNotSupported) - } - - targets := target.namedTypes[newEssentialName(localTypeName)] - fixups, err := coreCalculateFixups(local, target, localType, targets, group.relos) - if err != nil { - return nil, fmt.Errorf("relocate %s: %w", localType, err) - } - - for j, index := range group.indices { - result[index] = fixups[j] - } - } - - return result, nil -} - -var errAmbiguousRelocation = errors.New("ambiguous relocation") -var errImpossibleRelocation = errors.New("impossible relocation") - -// coreCalculateFixups calculates the fixups for the given relocations using -// the "best" target. -// -// The best target is determined by scoring: the less poisoning we have to do -// the better the target is. -func coreCalculateFixups(localSpec, targetSpec *Spec, local Type, targets []Type, relos []*CORERelocation) ([]COREFixup, error) { - localID, err := localSpec.TypeID(local) - if err != nil { - return nil, fmt.Errorf("local type ID: %w", err) - } - local = Copy(local, UnderlyingType) - - bestScore := len(relos) - var bestFixups []COREFixup - for i := range targets { - targetID, err := targetSpec.TypeID(targets[i]) - if err != nil { - return nil, fmt.Errorf("target type ID: %w", err) - } - target := Copy(targets[i], UnderlyingType) - - score := 0 // lower is better - fixups := make([]COREFixup, 0, len(relos)) - for _, relo := range relos { - fixup, err := coreCalculateFixup(localSpec.byteOrder, local, localID, target, targetID, relo) - if err != nil { - return nil, fmt.Errorf("target %s: %w", target, err) - } - if fixup.poison || fixup.isNonExistant() { - score++ - } - fixups = append(fixups, fixup) - } - - if score > bestScore { - // We have a better target already, ignore this one. - continue - } - - if score < bestScore { - // This is the best target yet, use it. - bestScore = score - bestFixups = fixups - continue - } - - // Some other target has the same score as the current one. Make sure - // the fixups agree with each other. - for i, fixup := range bestFixups { - if !fixup.equal(fixups[i]) { - return nil, fmt.Errorf("%s: multiple types match: %w", fixup.kind, errAmbiguousRelocation) - } - } - } - - if bestFixups == nil { - // Nothing at all matched, probably because there are no suitable - // targets at all. - // - // Poison everything except checksForExistence. - bestFixups = make([]COREFixup, len(relos)) - for i, relo := range relos { - if relo.kind.checksForExistence() { - bestFixups[i] = COREFixup{kind: relo.kind, local: 1, target: 0} - } else { - bestFixups[i] = COREFixup{kind: relo.kind, poison: true} - } - } - } - - return bestFixups, nil -} - -// coreCalculateFixup calculates the fixup for a single local type, target type -// and relocation. -func coreCalculateFixup(byteOrder binary.ByteOrder, local Type, localID TypeID, target Type, targetID TypeID, relo *CORERelocation) (COREFixup, error) { - fixup := func(local, target uint32) (COREFixup, error) { - return COREFixup{kind: relo.kind, local: local, target: target}, nil - } - fixupWithoutValidation := func(local, target uint32) (COREFixup, error) { - return COREFixup{kind: relo.kind, local: local, target: target, skipLocalValidation: true}, nil - } - poison := func() (COREFixup, error) { - if relo.kind.checksForExistence() { - return fixup(1, 0) - } - return COREFixup{kind: relo.kind, poison: true}, nil - } - zero := COREFixup{} - - switch relo.kind { - case reloTypeIDTarget, reloTypeSize, reloTypeExists: - if len(relo.accessor) > 1 || relo.accessor[0] != 0 { - return zero, fmt.Errorf("%s: unexpected accessor %v", relo.kind, relo.accessor) - } - - err := coreAreTypesCompatible(local, target) - if errors.Is(err, errImpossibleRelocation) { - return poison() - } - if err != nil { - return zero, fmt.Errorf("relocation %s: %w", relo.kind, err) - } - - switch relo.kind { - case reloTypeExists: - return fixup(1, 1) - - case reloTypeIDTarget: - return fixup(uint32(localID), uint32(targetID)) - - case reloTypeSize: - localSize, err := Sizeof(local) - if err != nil { - return zero, err - } - - targetSize, err := Sizeof(target) - if err != nil { - return zero, err - } - - return fixup(uint32(localSize), uint32(targetSize)) - } - - case reloEnumvalValue, reloEnumvalExists: - localValue, targetValue, err := coreFindEnumValue(local, relo.accessor, target) - if errors.Is(err, errImpossibleRelocation) { - return poison() - } - if err != nil { - return zero, fmt.Errorf("relocation %s: %w", relo.kind, err) - } - - switch relo.kind { - case reloEnumvalExists: - return fixup(1, 1) - - case reloEnumvalValue: - return fixup(uint32(localValue.Value), uint32(targetValue.Value)) - } - - case reloFieldSigned: - switch local.(type) { - case *Enum: - return fixup(1, 1) - case *Int: - return fixup( - uint32(local.(*Int).Encoding&Signed), - uint32(target.(*Int).Encoding&Signed), - ) - default: - return fixupWithoutValidation(0, 0) - } - - case reloFieldByteOffset, reloFieldByteSize, reloFieldExists, reloFieldLShiftU64, reloFieldRShiftU64: - if _, ok := target.(*Fwd); ok { - // We can't relocate fields using a forward declaration, so - // skip it. If a non-forward declaration is present in the BTF - // we'll find it in one of the other iterations. - return poison() - } - - localField, targetField, err := coreFindField(local, relo.accessor, target) - if errors.Is(err, errImpossibleRelocation) { - return poison() - } - if err != nil { - return zero, fmt.Errorf("target %s: %w", target, err) - } - - maybeSkipValidation := func(f COREFixup, err error) (COREFixup, error) { - f.skipLocalValidation = localField.bitfieldSize > 0 - return f, err - } - - switch relo.kind { - case reloFieldExists: - return fixup(1, 1) - - case reloFieldByteOffset: - return maybeSkipValidation(fixup(localField.offset, targetField.offset)) - - case reloFieldByteSize: - localSize, err := Sizeof(localField.Type) - if err != nil { - return zero, err - } - - targetSize, err := Sizeof(targetField.Type) - if err != nil { - return zero, err - } - return maybeSkipValidation(fixup(uint32(localSize), uint32(targetSize))) - - case reloFieldLShiftU64: - var target uint32 - if byteOrder == binary.LittleEndian { - targetSize, err := targetField.sizeBits() - if err != nil { - return zero, err - } - - target = uint32(64 - targetField.bitfieldOffset - targetSize) - } else { - loadWidth, err := Sizeof(targetField.Type) - if err != nil { - return zero, err - } - - target = uint32(64 - Bits(loadWidth*8) + targetField.bitfieldOffset) - } - return fixupWithoutValidation(0, target) - - case reloFieldRShiftU64: - targetSize, err := targetField.sizeBits() - if err != nil { - return zero, err - } - - return fixupWithoutValidation(0, uint32(64-targetSize)) - } - } - - return zero, fmt.Errorf("relocation %s: %w", relo.kind, ErrNotSupported) -} - -/* coreAccessor contains a path through a struct. It contains at least one index. - * - * The interpretation depends on the kind of the relocation. The following is - * taken from struct bpf_core_relo in libbpf_internal.h: - * - * - for field-based relocations, string encodes an accessed field using - * a sequence of field and array indices, separated by colon (:). It's - * conceptually very close to LLVM's getelementptr ([0]) instruction's - * arguments for identifying offset to a field. - * - for type-based relocations, strings is expected to be just "0"; - * - for enum value-based relocations, string contains an index of enum - * value within its enum type; - * - * Example to provide a better feel. - * - * struct sample { - * int a; - * struct { - * int b[10]; - * }; - * }; - * - * struct sample s = ...; - * int x = &s->a; // encoded as "0:0" (a is field #0) - * int y = &s->b[5]; // encoded as "0:1:0:5" (anon struct is field #1, - * // b is field #0 inside anon struct, accessing elem #5) - * int z = &s[10]->b; // encoded as "10:1" (ptr is used as an array) - */ -type coreAccessor []int - -func parseCOREAccessor(accessor string) (coreAccessor, error) { - if accessor == "" { - return nil, fmt.Errorf("empty accessor") - } - - parts := strings.Split(accessor, ":") - result := make(coreAccessor, 0, len(parts)) - for _, part := range parts { - // 31 bits to avoid overflowing int on 32 bit platforms. - index, err := strconv.ParseUint(part, 10, 31) - if err != nil { - return nil, fmt.Errorf("accessor index %q: %s", part, err) - } - - result = append(result, int(index)) - } - - return result, nil -} - -func (ca coreAccessor) String() string { - strs := make([]string, 0, len(ca)) - for _, i := range ca { - strs = append(strs, strconv.Itoa(i)) - } - return strings.Join(strs, ":") -} - -func (ca coreAccessor) enumValue(t Type) (*EnumValue, error) { - e, ok := t.(*Enum) - if !ok { - return nil, fmt.Errorf("not an enum: %s", t) - } - - if len(ca) > 1 { - return nil, fmt.Errorf("invalid accessor %s for enum", ca) - } - - i := ca[0] - if i >= len(e.Values) { - return nil, fmt.Errorf("invalid index %d for %s", i, e) - } - - return &e.Values[i], nil -} - -// coreField represents the position of a "child" of a composite type from the -// start of that type. -// -// /- start of composite -// | offset * 8 | bitfieldOffset | bitfieldSize | ... | -// \- start of field end of field -/ -type coreField struct { - Type Type - - // The position of the field from the start of the composite type in bytes. - offset uint32 - - // The offset of the bitfield in bits from the start of the field. - bitfieldOffset Bits - - // The size of the bitfield in bits. - // - // Zero if the field is not a bitfield. - bitfieldSize Bits -} - -func (cf *coreField) adjustOffsetToNthElement(n int) error { - size, err := Sizeof(cf.Type) - if err != nil { - return err - } - - cf.offset += uint32(n) * uint32(size) - return nil -} - -func (cf *coreField) adjustOffsetBits(offset Bits) error { - align, err := alignof(cf.Type) - if err != nil { - return err - } - - // We can compute the load offset by: - // 1) converting the bit offset to bytes with a flooring division. - // 2) dividing and multiplying that offset by the alignment, yielding the - // load size aligned offset. - offsetBytes := uint32(offset/8) / uint32(align) * uint32(align) - - // The number of bits remaining is the bit offset less the number of bits - // we can "skip" with the aligned offset. - cf.bitfieldOffset = offset - Bits(offsetBytes*8) - - // We know that cf.offset is aligned at to at least align since we get it - // from the compiler via BTF. Adding an aligned offsetBytes preserves the - // alignment. - cf.offset += offsetBytes - return nil -} - -func (cf *coreField) sizeBits() (Bits, error) { - if cf.bitfieldSize > 0 { - return cf.bitfieldSize, nil - } - - // Someone is trying to access a non-bitfield via a bit shift relocation. - // This happens when a field changes from a bitfield to a regular field - // between kernel versions. Synthesise the size to make the shifts work. - size, err := Sizeof(cf.Type) - if err != nil { - return 0, nil - } - return Bits(size * 8), nil -} - -// coreFindField descends into the local type using the accessor and tries to -// find an equivalent field in target at each step. -// -// Returns the field and the offset of the field from the start of -// target in bits. -func coreFindField(localT Type, localAcc coreAccessor, targetT Type) (coreField, coreField, error) { - local := coreField{Type: localT} - target := coreField{Type: targetT} - - // The first index is used to offset a pointer of the base type like - // when accessing an array. - if err := local.adjustOffsetToNthElement(localAcc[0]); err != nil { - return coreField{}, coreField{}, err - } - - if err := target.adjustOffsetToNthElement(localAcc[0]); err != nil { - return coreField{}, coreField{}, err - } - - if err := coreAreMembersCompatible(local.Type, target.Type); err != nil { - return coreField{}, coreField{}, fmt.Errorf("fields: %w", err) - } - - var localMaybeFlex, targetMaybeFlex bool - for i, acc := range localAcc[1:] { - switch localType := local.Type.(type) { - case composite: - // For composite types acc is used to find the field in the local type, - // and then we try to find a field in target with the same name. - localMembers := localType.members() - if acc >= len(localMembers) { - return coreField{}, coreField{}, fmt.Errorf("invalid accessor %d for %s", acc, localType) - } - - localMember := localMembers[acc] - if localMember.Name == "" { - _, ok := localMember.Type.(composite) - if !ok { - return coreField{}, coreField{}, fmt.Errorf("unnamed field with type %s: %s", localMember.Type, ErrNotSupported) - } - - // This is an anonymous struct or union, ignore it. - local = coreField{ - Type: localMember.Type, - offset: local.offset + localMember.Offset.Bytes(), - } - localMaybeFlex = false - continue - } - - targetType, ok := target.Type.(composite) - if !ok { - return coreField{}, coreField{}, fmt.Errorf("target not composite: %w", errImpossibleRelocation) - } - - targetMember, last, err := coreFindMember(targetType, localMember.Name) - if err != nil { - return coreField{}, coreField{}, err - } - - local = coreField{ - Type: localMember.Type, - offset: local.offset, - bitfieldSize: localMember.BitfieldSize, - } - localMaybeFlex = acc == len(localMembers)-1 - - target = coreField{ - Type: targetMember.Type, - offset: target.offset, - bitfieldSize: targetMember.BitfieldSize, - } - targetMaybeFlex = last - - if local.bitfieldSize == 0 && target.bitfieldSize == 0 { - local.offset += localMember.Offset.Bytes() - target.offset += targetMember.Offset.Bytes() - break - } - - // Either of the members is a bitfield. Make sure we're at the - // end of the accessor. - if next := i + 1; next < len(localAcc[1:]) { - return coreField{}, coreField{}, fmt.Errorf("can't descend into bitfield") - } - - if err := local.adjustOffsetBits(localMember.Offset); err != nil { - return coreField{}, coreField{}, err - } - - if err := target.adjustOffsetBits(targetMember.Offset); err != nil { - return coreField{}, coreField{}, err - } - - case *Array: - // For arrays, acc is the index in the target. - targetType, ok := target.Type.(*Array) - if !ok { - return coreField{}, coreField{}, fmt.Errorf("target not array: %w", errImpossibleRelocation) - } - - if localType.Nelems == 0 && !localMaybeFlex { - return coreField{}, coreField{}, fmt.Errorf("local type has invalid flexible array") - } - if targetType.Nelems == 0 && !targetMaybeFlex { - return coreField{}, coreField{}, fmt.Errorf("target type has invalid flexible array") - } - - if localType.Nelems > 0 && acc >= int(localType.Nelems) { - return coreField{}, coreField{}, fmt.Errorf("invalid access of %s at index %d", localType, acc) - } - if targetType.Nelems > 0 && acc >= int(targetType.Nelems) { - return coreField{}, coreField{}, fmt.Errorf("out of bounds access of target: %w", errImpossibleRelocation) - } - - local = coreField{ - Type: localType.Type, - offset: local.offset, - } - localMaybeFlex = false - - if err := local.adjustOffsetToNthElement(acc); err != nil { - return coreField{}, coreField{}, err - } - - target = coreField{ - Type: targetType.Type, - offset: target.offset, - } - targetMaybeFlex = false - - if err := target.adjustOffsetToNthElement(acc); err != nil { - return coreField{}, coreField{}, err - } - - default: - return coreField{}, coreField{}, fmt.Errorf("relocate field of %T: %w", localType, ErrNotSupported) - } - - if err := coreAreMembersCompatible(local.Type, target.Type); err != nil { - return coreField{}, coreField{}, err - } - } - - return local, target, nil -} - -// coreFindMember finds a member in a composite type while handling anonymous -// structs and unions. -func coreFindMember(typ composite, name string) (Member, bool, error) { - if name == "" { - return Member{}, false, errors.New("can't search for anonymous member") - } - - type offsetTarget struct { - composite - offset Bits - } - - targets := []offsetTarget{{typ, 0}} - visited := make(map[composite]bool) - - for i := 0; i < len(targets); i++ { - target := targets[i] - - // Only visit targets once to prevent infinite recursion. - if visited[target] { - continue - } - if len(visited) >= maxTypeDepth { - // This check is different than libbpf, which restricts the entire - // path to BPF_CORE_SPEC_MAX_LEN items. - return Member{}, false, fmt.Errorf("type is nested too deep") - } - visited[target] = true - - members := target.members() - for j, member := range members { - if member.Name == name { - // NB: This is safe because member is a copy. - member.Offset += target.offset - return member, j == len(members)-1, nil - } - - // The names don't match, but this member could be an anonymous struct - // or union. - if member.Name != "" { - continue - } - - comp, ok := member.Type.(composite) - if !ok { - return Member{}, false, fmt.Errorf("anonymous non-composite type %T not allowed", member.Type) - } - - targets = append(targets, offsetTarget{comp, target.offset + member.Offset}) - } - } - - return Member{}, false, fmt.Errorf("no matching member: %w", errImpossibleRelocation) -} - -// coreFindEnumValue follows localAcc to find the equivalent enum value in target. -func coreFindEnumValue(local Type, localAcc coreAccessor, target Type) (localValue, targetValue *EnumValue, _ error) { - localValue, err := localAcc.enumValue(local) - if err != nil { - return nil, nil, err - } - - targetEnum, ok := target.(*Enum) - if !ok { - return nil, nil, errImpossibleRelocation - } - - localName := newEssentialName(localValue.Name) - for i, targetValue := range targetEnum.Values { - if newEssentialName(targetValue.Name) != localName { - continue - } - - return localValue, &targetEnum.Values[i], nil - } - - return nil, nil, errImpossibleRelocation -} - -/* The comment below is from bpf_core_types_are_compat in libbpf.c: - * - * Check local and target types for compatibility. This check is used for - * type-based CO-RE relocations and follow slightly different rules than - * field-based relocations. This function assumes that root types were already - * checked for name match. Beyond that initial root-level name check, names - * are completely ignored. Compatibility rules are as follows: - * - any two STRUCTs/UNIONs/FWDs/ENUMs/INTs are considered compatible, but - * kind should match for local and target types (i.e., STRUCT is not - * compatible with UNION); - * - for ENUMs, the size is ignored; - * - for INT, size and signedness are ignored; - * - for ARRAY, dimensionality is ignored, element types are checked for - * compatibility recursively; - * - CONST/VOLATILE/RESTRICT modifiers are ignored; - * - TYPEDEFs/PTRs are compatible if types they pointing to are compatible; - * - FUNC_PROTOs are compatible if they have compatible signature: same - * number of input args and compatible return and argument types. - * These rules are not set in stone and probably will be adjusted as we get - * more experience with using BPF CO-RE relocations. - * - * Returns errImpossibleRelocation if types are not compatible. - */ -func coreAreTypesCompatible(localType Type, targetType Type) error { - var ( - localTs, targetTs typeDeque - l, t = &localType, &targetType - depth = 0 - ) - - for ; l != nil && t != nil; l, t = localTs.shift(), targetTs.shift() { - if depth >= maxTypeDepth { - return errors.New("types are nested too deep") - } - - localType = *l - targetType = *t - - if reflect.TypeOf(localType) != reflect.TypeOf(targetType) { - return fmt.Errorf("type mismatch: %w", errImpossibleRelocation) - } - - switch lv := (localType).(type) { - case *Void, *Struct, *Union, *Enum, *Fwd, *Int: - // Nothing to do here - - case *Pointer, *Array: - depth++ - localType.walk(&localTs) - targetType.walk(&targetTs) - - case *FuncProto: - tv := targetType.(*FuncProto) - if len(lv.Params) != len(tv.Params) { - return fmt.Errorf("function param mismatch: %w", errImpossibleRelocation) - } - - depth++ - localType.walk(&localTs) - targetType.walk(&targetTs) - - default: - return fmt.Errorf("unsupported type %T", localType) - } - } - - if l != nil { - return fmt.Errorf("dangling local type %T", *l) - } - - if t != nil { - return fmt.Errorf("dangling target type %T", *t) - } - - return nil -} - -/* coreAreMembersCompatible checks two types for field-based relocation compatibility. - * - * The comment below is from bpf_core_fields_are_compat in libbpf.c: - * - * Check two types for compatibility for the purpose of field access - * relocation. const/volatile/restrict and typedefs are skipped to ensure we - * are relocating semantically compatible entities: - * - any two STRUCTs/UNIONs are compatible and can be mixed; - * - any two FWDs are compatible, if their names match (modulo flavor suffix); - * - any two PTRs are always compatible; - * - for ENUMs, names should be the same (ignoring flavor suffix) or at - * least one of enums should be anonymous; - * - for ENUMs, check sizes, names are ignored; - * - for INT, size and signedness are ignored; - * - any two FLOATs are always compatible; - * - for ARRAY, dimensionality is ignored, element types are checked for - * compatibility recursively; - * [ NB: coreAreMembersCompatible doesn't recurse, this check is done - * by coreFindField. ] - * - everything else shouldn't be ever a target of relocation. - * These rules are not set in stone and probably will be adjusted as we get - * more experience with using BPF CO-RE relocations. - * - * Returns errImpossibleRelocation if the members are not compatible. - */ -func coreAreMembersCompatible(localType Type, targetType Type) error { - doNamesMatch := func(a, b string) error { - if a == "" || b == "" { - // allow anonymous and named type to match - return nil - } - - if newEssentialName(a) == newEssentialName(b) { - return nil - } - - return fmt.Errorf("names don't match: %w", errImpossibleRelocation) - } - - _, lok := localType.(composite) - _, tok := targetType.(composite) - if lok && tok { - return nil - } - - if reflect.TypeOf(localType) != reflect.TypeOf(targetType) { - return fmt.Errorf("type mismatch: %w", errImpossibleRelocation) - } - - switch lv := localType.(type) { - case *Array, *Pointer, *Float, *Int: - return nil - - case *Enum: - tv := targetType.(*Enum) - return doNamesMatch(lv.Name, tv.Name) - - case *Fwd: - tv := targetType.(*Fwd) - return doNamesMatch(lv.Name, tv.Name) - - default: - return fmt.Errorf("type %s: %w", localType, ErrNotSupported) - } -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/doc.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/doc.go deleted file mode 100644 index b1f4b1fc3eb5..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/doc.go +++ /dev/null @@ -1,5 +0,0 @@ -// Package btf handles data encoded according to the BPF Type Format. -// -// The canonical documentation lives in the Linux kernel repository and is -// available at https://www.kernel.org/doc/html/latest/bpf/btf.html -package btf diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/ext_info.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/ext_info.go deleted file mode 100644 index 2c0e1afe299a..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/ext_info.go +++ /dev/null @@ -1,721 +0,0 @@ -package btf - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "io" - "math" - "sort" - - "github.com/cilium/ebpf/asm" - "github.com/cilium/ebpf/internal" -) - -// ExtInfos contains ELF section metadata. -type ExtInfos struct { - // The slices are sorted by offset in ascending order. - funcInfos map[string][]funcInfo - lineInfos map[string][]lineInfo - relocationInfos map[string][]coreRelocationInfo -} - -// loadExtInfosFromELF parses ext infos from the .BTF.ext section in an ELF. -// -// Returns an error wrapping ErrNotFound if no ext infos are present. -func loadExtInfosFromELF(file *internal.SafeELFFile, ts types, strings *stringTable) (*ExtInfos, error) { - section := file.Section(".BTF.ext") - if section == nil { - return nil, fmt.Errorf("btf ext infos: %w", ErrNotFound) - } - - if section.ReaderAt == nil { - return nil, fmt.Errorf("compressed ext_info is not supported") - } - - return loadExtInfos(section.ReaderAt, file.ByteOrder, ts, strings) -} - -// loadExtInfos parses bare ext infos. -func loadExtInfos(r io.ReaderAt, bo binary.ByteOrder, ts types, strings *stringTable) (*ExtInfos, error) { - // Open unbuffered section reader. binary.Read() calls io.ReadFull on - // the header structs, resulting in one syscall per header. - headerRd := io.NewSectionReader(r, 0, math.MaxInt64) - extHeader, err := parseBTFExtHeader(headerRd, bo) - if err != nil { - return nil, fmt.Errorf("parsing BTF extension header: %w", err) - } - - coreHeader, err := parseBTFExtCOREHeader(headerRd, bo, extHeader) - if err != nil { - return nil, fmt.Errorf("parsing BTF CO-RE header: %w", err) - } - - buf := internal.NewBufferedSectionReader(r, extHeader.funcInfoStart(), int64(extHeader.FuncInfoLen)) - btfFuncInfos, err := parseFuncInfos(buf, bo, strings) - if err != nil { - return nil, fmt.Errorf("parsing BTF function info: %w", err) - } - - funcInfos := make(map[string][]funcInfo, len(btfFuncInfos)) - for section, bfis := range btfFuncInfos { - funcInfos[section], err = newFuncInfos(bfis, ts) - if err != nil { - return nil, fmt.Errorf("section %s: func infos: %w", section, err) - } - } - - buf = internal.NewBufferedSectionReader(r, extHeader.lineInfoStart(), int64(extHeader.LineInfoLen)) - btfLineInfos, err := parseLineInfos(buf, bo, strings) - if err != nil { - return nil, fmt.Errorf("parsing BTF line info: %w", err) - } - - lineInfos := make(map[string][]lineInfo, len(btfLineInfos)) - for section, blis := range btfLineInfos { - lineInfos[section], err = newLineInfos(blis, strings) - if err != nil { - return nil, fmt.Errorf("section %s: line infos: %w", section, err) - } - } - - if coreHeader == nil || coreHeader.COREReloLen == 0 { - return &ExtInfos{funcInfos, lineInfos, nil}, nil - } - - var btfCORERelos map[string][]bpfCORERelo - buf = internal.NewBufferedSectionReader(r, extHeader.coreReloStart(coreHeader), int64(coreHeader.COREReloLen)) - btfCORERelos, err = parseCORERelos(buf, bo, strings) - if err != nil { - return nil, fmt.Errorf("parsing CO-RE relocation info: %w", err) - } - - coreRelos := make(map[string][]coreRelocationInfo, len(btfCORERelos)) - for section, brs := range btfCORERelos { - coreRelos[section], err = newRelocationInfos(brs, ts, strings) - if err != nil { - return nil, fmt.Errorf("section %s: CO-RE relocations: %w", section, err) - } - } - - return &ExtInfos{funcInfos, lineInfos, coreRelos}, nil -} - -type funcInfoMeta struct{} -type coreRelocationMeta struct{} - -// Assign per-section metadata from BTF to a section's instructions. -func (ei *ExtInfos) Assign(insns asm.Instructions, section string) { - funcInfos := ei.funcInfos[section] - lineInfos := ei.lineInfos[section] - reloInfos := ei.relocationInfos[section] - - iter := insns.Iterate() - for iter.Next() { - if len(funcInfos) > 0 && funcInfos[0].offset == iter.Offset { - iter.Ins.Metadata.Set(funcInfoMeta{}, funcInfos[0].fn) - funcInfos = funcInfos[1:] - } - - if len(lineInfos) > 0 && lineInfos[0].offset == iter.Offset { - *iter.Ins = iter.Ins.WithSource(lineInfos[0].line) - lineInfos = lineInfos[1:] - } - - if len(reloInfos) > 0 && reloInfos[0].offset == iter.Offset { - iter.Ins.Metadata.Set(coreRelocationMeta{}, reloInfos[0].relo) - reloInfos = reloInfos[1:] - } - } -} - -// MarshalExtInfos encodes function and line info embedded in insns into kernel -// wire format. -func MarshalExtInfos(insns asm.Instructions, typeID func(Type) (TypeID, error)) (funcInfos, lineInfos []byte, _ error) { - iter := insns.Iterate() - var fiBuf, liBuf bytes.Buffer - for iter.Next() { - if fn := FuncMetadata(iter.Ins); fn != nil { - fi := &funcInfo{ - fn: fn, - offset: iter.Offset, - } - if err := fi.marshal(&fiBuf, typeID); err != nil { - return nil, nil, fmt.Errorf("write func info: %w", err) - } - } - - if line, ok := iter.Ins.Source().(*Line); ok { - li := &lineInfo{ - line: line, - offset: iter.Offset, - } - if err := li.marshal(&liBuf); err != nil { - return nil, nil, fmt.Errorf("write line info: %w", err) - } - } - } - return fiBuf.Bytes(), liBuf.Bytes(), nil -} - -// btfExtHeader is found at the start of the .BTF.ext section. -type btfExtHeader struct { - Magic uint16 - Version uint8 - Flags uint8 - - // HdrLen is larger than the size of struct btfExtHeader when it is - // immediately followed by a btfExtCOREHeader. - HdrLen uint32 - - FuncInfoOff uint32 - FuncInfoLen uint32 - LineInfoOff uint32 - LineInfoLen uint32 -} - -// parseBTFExtHeader parses the header of the .BTF.ext section. -func parseBTFExtHeader(r io.Reader, bo binary.ByteOrder) (*btfExtHeader, error) { - var header btfExtHeader - if err := binary.Read(r, bo, &header); err != nil { - return nil, fmt.Errorf("can't read header: %v", err) - } - - if header.Magic != btfMagic { - return nil, fmt.Errorf("incorrect magic value %v", header.Magic) - } - - if header.Version != 1 { - return nil, fmt.Errorf("unexpected version %v", header.Version) - } - - if header.Flags != 0 { - return nil, fmt.Errorf("unsupported flags %v", header.Flags) - } - - if int64(header.HdrLen) < int64(binary.Size(&header)) { - return nil, fmt.Errorf("header length shorter than btfExtHeader size") - } - - return &header, nil -} - -// funcInfoStart returns the offset from the beginning of the .BTF.ext section -// to the start of its func_info entries. -func (h *btfExtHeader) funcInfoStart() int64 { - return int64(h.HdrLen + h.FuncInfoOff) -} - -// lineInfoStart returns the offset from the beginning of the .BTF.ext section -// to the start of its line_info entries. -func (h *btfExtHeader) lineInfoStart() int64 { - return int64(h.HdrLen + h.LineInfoOff) -} - -// coreReloStart returns the offset from the beginning of the .BTF.ext section -// to the start of its CO-RE relocation entries. -func (h *btfExtHeader) coreReloStart(ch *btfExtCOREHeader) int64 { - return int64(h.HdrLen + ch.COREReloOff) -} - -// btfExtCOREHeader is found right after the btfExtHeader when its HdrLen -// field is larger than its size. -type btfExtCOREHeader struct { - COREReloOff uint32 - COREReloLen uint32 -} - -// parseBTFExtCOREHeader parses the tail of the .BTF.ext header. If additional -// header bytes are present, extHeader.HdrLen will be larger than the struct, -// indicating the presence of a CO-RE extension header. -func parseBTFExtCOREHeader(r io.Reader, bo binary.ByteOrder, extHeader *btfExtHeader) (*btfExtCOREHeader, error) { - extHdrSize := int64(binary.Size(&extHeader)) - remainder := int64(extHeader.HdrLen) - extHdrSize - - if remainder == 0 { - return nil, nil - } - - var coreHeader btfExtCOREHeader - if err := binary.Read(r, bo, &coreHeader); err != nil { - return nil, fmt.Errorf("can't read header: %v", err) - } - - return &coreHeader, nil -} - -type btfExtInfoSec struct { - SecNameOff uint32 - NumInfo uint32 -} - -// parseExtInfoSec parses a btf_ext_info_sec header within .BTF.ext, -// appearing within func_info and line_info sub-sections. -// These headers appear once for each program section in the ELF and are -// followed by one or more func/line_info records for the section. -func parseExtInfoSec(r io.Reader, bo binary.ByteOrder, strings *stringTable) (string, *btfExtInfoSec, error) { - var infoHeader btfExtInfoSec - if err := binary.Read(r, bo, &infoHeader); err != nil { - return "", nil, fmt.Errorf("read ext info header: %w", err) - } - - secName, err := strings.Lookup(infoHeader.SecNameOff) - if err != nil { - return "", nil, fmt.Errorf("get section name: %w", err) - } - if secName == "" { - return "", nil, fmt.Errorf("extinfo header refers to empty section name") - } - - if infoHeader.NumInfo == 0 { - return "", nil, fmt.Errorf("section %s has zero records", secName) - } - - return secName, &infoHeader, nil -} - -// parseExtInfoRecordSize parses the uint32 at the beginning of a func_infos -// or line_infos segment that describes the length of all extInfoRecords in -// that segment. -func parseExtInfoRecordSize(r io.Reader, bo binary.ByteOrder) (uint32, error) { - const maxRecordSize = 256 - - var recordSize uint32 - if err := binary.Read(r, bo, &recordSize); err != nil { - return 0, fmt.Errorf("can't read record size: %v", err) - } - - if recordSize < 4 { - // Need at least InsnOff worth of bytes per record. - return 0, errors.New("record size too short") - } - if recordSize > maxRecordSize { - return 0, fmt.Errorf("record size %v exceeds %v", recordSize, maxRecordSize) - } - - return recordSize, nil -} - -// The size of a FuncInfo in BTF wire format. -var FuncInfoSize = uint32(binary.Size(bpfFuncInfo{})) - -type funcInfo struct { - fn *Func - offset asm.RawInstructionOffset -} - -type bpfFuncInfo struct { - // Instruction offset of the function within an ELF section. - InsnOff uint32 - TypeID TypeID -} - -func newFuncInfo(fi bpfFuncInfo, ts types) (*funcInfo, error) { - typ, err := ts.ByID(fi.TypeID) - if err != nil { - return nil, err - } - - fn, ok := typ.(*Func) - if !ok { - return nil, fmt.Errorf("type ID %d is a %T, but expected a Func", fi.TypeID, typ) - } - - // C doesn't have anonymous functions, but check just in case. - if fn.Name == "" { - return nil, fmt.Errorf("func with type ID %d doesn't have a name", fi.TypeID) - } - - return &funcInfo{ - fn, - asm.RawInstructionOffset(fi.InsnOff), - }, nil -} - -func newFuncInfos(bfis []bpfFuncInfo, ts types) ([]funcInfo, error) { - fis := make([]funcInfo, 0, len(bfis)) - for _, bfi := range bfis { - fi, err := newFuncInfo(bfi, ts) - if err != nil { - return nil, fmt.Errorf("offset %d: %w", bfi.InsnOff, err) - } - fis = append(fis, *fi) - } - sort.Slice(fis, func(i, j int) bool { - return fis[i].offset <= fis[j].offset - }) - return fis, nil -} - -// marshal into the BTF wire format. -func (fi *funcInfo) marshal(w io.Writer, typeID func(Type) (TypeID, error)) error { - id, err := typeID(fi.fn) - if err != nil { - return err - } - bfi := bpfFuncInfo{ - InsnOff: uint32(fi.offset), - TypeID: id, - } - return binary.Write(w, internal.NativeEndian, &bfi) -} - -// parseLineInfos parses a func_info sub-section within .BTF.ext ito a map of -// func infos indexed by section name. -func parseFuncInfos(r io.Reader, bo binary.ByteOrder, strings *stringTable) (map[string][]bpfFuncInfo, error) { - recordSize, err := parseExtInfoRecordSize(r, bo) - if err != nil { - return nil, err - } - - result := make(map[string][]bpfFuncInfo) - for { - secName, infoHeader, err := parseExtInfoSec(r, bo, strings) - if errors.Is(err, io.EOF) { - return result, nil - } - if err != nil { - return nil, err - } - - records, err := parseFuncInfoRecords(r, bo, recordSize, infoHeader.NumInfo) - if err != nil { - return nil, fmt.Errorf("section %v: %w", secName, err) - } - - result[secName] = records - } -} - -// parseFuncInfoRecords parses a stream of func_infos into a funcInfos. -// These records appear after a btf_ext_info_sec header in the func_info -// sub-section of .BTF.ext. -func parseFuncInfoRecords(r io.Reader, bo binary.ByteOrder, recordSize uint32, recordNum uint32) ([]bpfFuncInfo, error) { - var out []bpfFuncInfo - var fi bpfFuncInfo - - if exp, got := FuncInfoSize, recordSize; exp != got { - // BTF blob's record size is longer than we know how to parse. - return nil, fmt.Errorf("expected FuncInfo record size %d, but BTF blob contains %d", exp, got) - } - - for i := uint32(0); i < recordNum; i++ { - if err := binary.Read(r, bo, &fi); err != nil { - return nil, fmt.Errorf("can't read function info: %v", err) - } - - if fi.InsnOff%asm.InstructionSize != 0 { - return nil, fmt.Errorf("offset %v is not aligned with instruction size", fi.InsnOff) - } - - // ELF tracks offset in bytes, the kernel expects raw BPF instructions. - // Convert as early as possible. - fi.InsnOff /= asm.InstructionSize - - out = append(out, fi) - } - - return out, nil -} - -var LineInfoSize = uint32(binary.Size(bpfLineInfo{})) - -// Line represents the location and contents of a single line of source -// code a BPF ELF was compiled from. -type Line struct { - fileName string - line string - lineNumber uint32 - lineColumn uint32 - - // TODO: We should get rid of the fields below, but for that we need to be - // able to write BTF. - - fileNameOff uint32 - lineOff uint32 -} - -func (li *Line) FileName() string { - return li.fileName -} - -func (li *Line) Line() string { - return li.line -} - -func (li *Line) LineNumber() uint32 { - return li.lineNumber -} - -func (li *Line) LineColumn() uint32 { - return li.lineColumn -} - -func (li *Line) String() string { - return li.line -} - -type lineInfo struct { - line *Line - offset asm.RawInstructionOffset -} - -// Constants for the format of bpfLineInfo.LineCol. -const ( - bpfLineShift = 10 - bpfLineMax = (1 << (32 - bpfLineShift)) - 1 - bpfColumnMax = (1 << bpfLineShift) - 1 -) - -type bpfLineInfo struct { - // Instruction offset of the line within the whole instruction stream, in instructions. - InsnOff uint32 - FileNameOff uint32 - LineOff uint32 - LineCol uint32 -} - -func newLineInfo(li bpfLineInfo, strings *stringTable) (*lineInfo, error) { - line, err := strings.Lookup(li.LineOff) - if err != nil { - return nil, fmt.Errorf("lookup of line: %w", err) - } - - fileName, err := strings.Lookup(li.FileNameOff) - if err != nil { - return nil, fmt.Errorf("lookup of filename: %w", err) - } - - lineNumber := li.LineCol >> bpfLineShift - lineColumn := li.LineCol & bpfColumnMax - - return &lineInfo{ - &Line{ - fileName, - line, - lineNumber, - lineColumn, - li.FileNameOff, - li.LineOff, - }, - asm.RawInstructionOffset(li.InsnOff), - }, nil -} - -func newLineInfos(blis []bpfLineInfo, strings *stringTable) ([]lineInfo, error) { - lis := make([]lineInfo, 0, len(blis)) - for _, bli := range blis { - li, err := newLineInfo(bli, strings) - if err != nil { - return nil, fmt.Errorf("offset %d: %w", bli.InsnOff, err) - } - lis = append(lis, *li) - } - sort.Slice(lis, func(i, j int) bool { - return lis[i].offset <= lis[j].offset - }) - return lis, nil -} - -// marshal writes the binary representation of the LineInfo to w. -func (li *lineInfo) marshal(w io.Writer) error { - line := li.line - if line.lineNumber > bpfLineMax { - return fmt.Errorf("line %d exceeds %d", line.lineNumber, bpfLineMax) - } - - if line.lineColumn > bpfColumnMax { - return fmt.Errorf("column %d exceeds %d", line.lineColumn, bpfColumnMax) - } - - bli := bpfLineInfo{ - uint32(li.offset), - line.fileNameOff, - line.lineOff, - (line.lineNumber << bpfLineShift) | line.lineColumn, - } - return binary.Write(w, internal.NativeEndian, &bli) -} - -// parseLineInfos parses a line_info sub-section within .BTF.ext ito a map of -// line infos indexed by section name. -func parseLineInfos(r io.Reader, bo binary.ByteOrder, strings *stringTable) (map[string][]bpfLineInfo, error) { - recordSize, err := parseExtInfoRecordSize(r, bo) - if err != nil { - return nil, err - } - - result := make(map[string][]bpfLineInfo) - for { - secName, infoHeader, err := parseExtInfoSec(r, bo, strings) - if errors.Is(err, io.EOF) { - return result, nil - } - if err != nil { - return nil, err - } - - records, err := parseLineInfoRecords(r, bo, recordSize, infoHeader.NumInfo) - if err != nil { - return nil, fmt.Errorf("section %v: %w", secName, err) - } - - result[secName] = records - } -} - -// parseLineInfoRecords parses a stream of line_infos into a lineInfos. -// These records appear after a btf_ext_info_sec header in the line_info -// sub-section of .BTF.ext. -func parseLineInfoRecords(r io.Reader, bo binary.ByteOrder, recordSize uint32, recordNum uint32) ([]bpfLineInfo, error) { - var out []bpfLineInfo - var li bpfLineInfo - - if exp, got := uint32(binary.Size(li)), recordSize; exp != got { - // BTF blob's record size is longer than we know how to parse. - return nil, fmt.Errorf("expected LineInfo record size %d, but BTF blob contains %d", exp, got) - } - - for i := uint32(0); i < recordNum; i++ { - if err := binary.Read(r, bo, &li); err != nil { - return nil, fmt.Errorf("can't read line info: %v", err) - } - - if li.InsnOff%asm.InstructionSize != 0 { - return nil, fmt.Errorf("offset %v is not aligned with instruction size", li.InsnOff) - } - - // ELF tracks offset in bytes, the kernel expects raw BPF instructions. - // Convert as early as possible. - li.InsnOff /= asm.InstructionSize - - out = append(out, li) - } - - return out, nil -} - -// bpfCORERelo matches the kernel's struct bpf_core_relo. -type bpfCORERelo struct { - InsnOff uint32 - TypeID TypeID - AccessStrOff uint32 - Kind coreKind -} - -type CORERelocation struct { - typ Type - accessor coreAccessor - kind coreKind -} - -func CORERelocationMetadata(ins *asm.Instruction) *CORERelocation { - relo, _ := ins.Metadata.Get(coreRelocationMeta{}).(*CORERelocation) - return relo -} - -type coreRelocationInfo struct { - relo *CORERelocation - offset asm.RawInstructionOffset -} - -func newRelocationInfo(relo bpfCORERelo, ts types, strings *stringTable) (*coreRelocationInfo, error) { - typ, err := ts.ByID(relo.TypeID) - if err != nil { - return nil, err - } - - accessorStr, err := strings.Lookup(relo.AccessStrOff) - if err != nil { - return nil, err - } - - accessor, err := parseCOREAccessor(accessorStr) - if err != nil { - return nil, fmt.Errorf("accessor %q: %s", accessorStr, err) - } - - return &coreRelocationInfo{ - &CORERelocation{ - typ, - accessor, - relo.Kind, - }, - asm.RawInstructionOffset(relo.InsnOff), - }, nil -} - -func newRelocationInfos(brs []bpfCORERelo, ts types, strings *stringTable) ([]coreRelocationInfo, error) { - rs := make([]coreRelocationInfo, 0, len(brs)) - for _, br := range brs { - relo, err := newRelocationInfo(br, ts, strings) - if err != nil { - return nil, fmt.Errorf("offset %d: %w", br.InsnOff, err) - } - rs = append(rs, *relo) - } - sort.Slice(rs, func(i, j int) bool { - return rs[i].offset < rs[j].offset - }) - return rs, nil -} - -var extInfoReloSize = binary.Size(bpfCORERelo{}) - -// parseCORERelos parses a core_relos sub-section within .BTF.ext ito a map of -// CO-RE relocations indexed by section name. -func parseCORERelos(r io.Reader, bo binary.ByteOrder, strings *stringTable) (map[string][]bpfCORERelo, error) { - recordSize, err := parseExtInfoRecordSize(r, bo) - if err != nil { - return nil, err - } - - if recordSize != uint32(extInfoReloSize) { - return nil, fmt.Errorf("expected record size %d, got %d", extInfoReloSize, recordSize) - } - - result := make(map[string][]bpfCORERelo) - for { - secName, infoHeader, err := parseExtInfoSec(r, bo, strings) - if errors.Is(err, io.EOF) { - return result, nil - } - if err != nil { - return nil, err - } - - records, err := parseCOREReloRecords(r, bo, recordSize, infoHeader.NumInfo) - if err != nil { - return nil, fmt.Errorf("section %v: %w", secName, err) - } - - result[secName] = records - } -} - -// parseCOREReloRecords parses a stream of CO-RE relocation entries into a -// coreRelos. These records appear after a btf_ext_info_sec header in the -// core_relos sub-section of .BTF.ext. -func parseCOREReloRecords(r io.Reader, bo binary.ByteOrder, recordSize uint32, recordNum uint32) ([]bpfCORERelo, error) { - var out []bpfCORERelo - - var relo bpfCORERelo - for i := uint32(0); i < recordNum; i++ { - if err := binary.Read(r, bo, &relo); err != nil { - return nil, fmt.Errorf("can't read CO-RE relocation: %v", err) - } - - if relo.InsnOff%asm.InstructionSize != 0 { - return nil, fmt.Errorf("offset %v is not aligned with instruction size", relo.InsnOff) - } - - // ELF tracks offset in bytes, the kernel expects raw BPF instructions. - // Convert as early as possible. - relo.InsnOff /= asm.InstructionSize - - out = append(out, relo) - } - - return out, nil -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/format.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/format.go deleted file mode 100644 index e7688a2a6e83..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/format.go +++ /dev/null @@ -1,319 +0,0 @@ -package btf - -import ( - "errors" - "fmt" - "strings" -) - -var errNestedTooDeep = errors.New("nested too deep") - -// GoFormatter converts a Type to Go syntax. -// -// A zero GoFormatter is valid to use. -type GoFormatter struct { - w strings.Builder - - // Types present in this map are referred to using the given name if they - // are encountered when outputting another type. - Names map[Type]string - - // Identifier is called for each field of struct-like types. By default the - // field name is used as is. - Identifier func(string) string - - // EnumIdentifier is called for each element of an enum. By default the - // name of the enum type is concatenated with Identifier(element). - EnumIdentifier func(name, element string) string -} - -// TypeDeclaration generates a Go type declaration for a BTF type. -func (gf *GoFormatter) TypeDeclaration(name string, typ Type) (string, error) { - gf.w.Reset() - if err := gf.writeTypeDecl(name, typ); err != nil { - return "", err - } - return gf.w.String(), nil -} - -func (gf *GoFormatter) identifier(s string) string { - if gf.Identifier != nil { - return gf.Identifier(s) - } - - return s -} - -func (gf *GoFormatter) enumIdentifier(name, element string) string { - if gf.EnumIdentifier != nil { - return gf.EnumIdentifier(name, element) - } - - return name + gf.identifier(element) -} - -// writeTypeDecl outputs a declaration of the given type. -// -// It encodes https://golang.org/ref/spec#Type_declarations: -// -// type foo struct { bar uint32; } -// type bar int32 -func (gf *GoFormatter) writeTypeDecl(name string, typ Type) error { - if name == "" { - return fmt.Errorf("need a name for type %s", typ) - } - - switch v := skipQualifiers(typ).(type) { - case *Enum: - fmt.Fprintf(&gf.w, "type %s ", name) - switch v.Size { - case 1: - gf.w.WriteString("int8") - case 2: - gf.w.WriteString("int16") - case 4: - gf.w.WriteString("int32") - case 8: - gf.w.WriteString("int64") - default: - return fmt.Errorf("%s: invalid enum size %d", typ, v.Size) - } - - if len(v.Values) == 0 { - return nil - } - - gf.w.WriteString("; const ( ") - for _, ev := range v.Values { - id := gf.enumIdentifier(name, ev.Name) - fmt.Fprintf(&gf.w, "%s %s = %d; ", id, name, ev.Value) - } - gf.w.WriteString(")") - - return nil - - default: - fmt.Fprintf(&gf.w, "type %s ", name) - return gf.writeTypeLit(v, 0) - } -} - -// writeType outputs the name of a named type or a literal describing the type. -// -// It encodes https://golang.org/ref/spec#Types. -// -// foo (if foo is a named type) -// uint32 -func (gf *GoFormatter) writeType(typ Type, depth int) error { - typ = skipQualifiers(typ) - - name := gf.Names[typ] - if name != "" { - gf.w.WriteString(name) - return nil - } - - return gf.writeTypeLit(typ, depth) -} - -// writeTypeLit outputs a literal describing the type. -// -// The function ignores named types. -// -// It encodes https://golang.org/ref/spec#TypeLit. -// -// struct { bar uint32; } -// uint32 -func (gf *GoFormatter) writeTypeLit(typ Type, depth int) error { - depth++ - if depth > maxTypeDepth { - return errNestedTooDeep - } - - var err error - switch v := skipQualifiers(typ).(type) { - case *Int: - gf.writeIntLit(v) - - case *Enum: - gf.w.WriteString("int32") - - case *Typedef: - err = gf.writeType(v.Type, depth) - - case *Array: - fmt.Fprintf(&gf.w, "[%d]", v.Nelems) - err = gf.writeType(v.Type, depth) - - case *Struct: - err = gf.writeStructLit(v.Size, v.Members, depth) - - case *Union: - // Always choose the first member to represent the union in Go. - err = gf.writeStructLit(v.Size, v.Members[:1], depth) - - case *Datasec: - err = gf.writeDatasecLit(v, depth) - - default: - return fmt.Errorf("type %T: %w", v, ErrNotSupported) - } - - if err != nil { - return fmt.Errorf("%s: %w", typ, err) - } - - return nil -} - -func (gf *GoFormatter) writeIntLit(i *Int) { - // NB: Encoding.IsChar is ignored. - if i.Encoding.IsBool() && i.Size == 1 { - gf.w.WriteString("bool") - return - } - - bits := i.Size * 8 - if i.Encoding.IsSigned() { - fmt.Fprintf(&gf.w, "int%d", bits) - } else { - fmt.Fprintf(&gf.w, "uint%d", bits) - } -} - -func (gf *GoFormatter) writeStructLit(size uint32, members []Member, depth int) error { - gf.w.WriteString("struct { ") - - prevOffset := uint32(0) - skippedBitfield := false - for i, m := range members { - if m.BitfieldSize > 0 { - skippedBitfield = true - continue - } - - offset := m.Offset.Bytes() - if n := offset - prevOffset; skippedBitfield && n > 0 { - fmt.Fprintf(&gf.w, "_ [%d]byte /* unsupported bitfield */; ", n) - } else { - gf.writePadding(n) - } - - size, err := Sizeof(m.Type) - if err != nil { - return fmt.Errorf("field %d: %w", i, err) - } - prevOffset = offset + uint32(size) - - if err := gf.writeStructField(m, depth); err != nil { - return fmt.Errorf("field %d: %w", i, err) - } - } - - gf.writePadding(size - prevOffset) - gf.w.WriteString("}") - return nil -} - -func (gf *GoFormatter) writeStructField(m Member, depth int) error { - if m.BitfieldSize > 0 { - return fmt.Errorf("bitfields are not supported") - } - if m.Offset%8 != 0 { - return fmt.Errorf("unsupported offset %d", m.Offset) - } - - if m.Name == "" { - // Special case a nested anonymous union like - // struct foo { union { int bar; int baz }; } - // by replacing the whole union with its first member. - union, ok := m.Type.(*Union) - if !ok { - return fmt.Errorf("anonymous fields are not supported") - - } - - if len(union.Members) == 0 { - return errors.New("empty anonymous union") - } - - depth++ - if depth > maxTypeDepth { - return errNestedTooDeep - } - - m := union.Members[0] - size, err := Sizeof(m.Type) - if err != nil { - return err - } - - if err := gf.writeStructField(m, depth); err != nil { - return err - } - - gf.writePadding(union.Size - uint32(size)) - return nil - - } - - fmt.Fprintf(&gf.w, "%s ", gf.identifier(m.Name)) - - if err := gf.writeType(m.Type, depth); err != nil { - return err - } - - gf.w.WriteString("; ") - return nil -} - -func (gf *GoFormatter) writeDatasecLit(ds *Datasec, depth int) error { - gf.w.WriteString("struct { ") - - prevOffset := uint32(0) - for i, vsi := range ds.Vars { - v := vsi.Type.(*Var) - if v.Linkage != GlobalVar { - // Ignore static, extern, etc. for now. - continue - } - - if v.Name == "" { - return fmt.Errorf("variable %d: empty name", i) - } - - gf.writePadding(vsi.Offset - prevOffset) - prevOffset = vsi.Offset + vsi.Size - - fmt.Fprintf(&gf.w, "%s ", gf.identifier(v.Name)) - - if err := gf.writeType(v.Type, depth); err != nil { - return fmt.Errorf("variable %d: %w", i, err) - } - - gf.w.WriteString("; ") - } - - gf.writePadding(ds.Size - prevOffset) - gf.w.WriteString("}") - return nil -} - -func (gf *GoFormatter) writePadding(bytes uint32) { - if bytes > 0 { - fmt.Fprintf(&gf.w, "_ [%d]byte; ", bytes) - } -} - -func skipQualifiers(typ Type) Type { - result := typ - for depth := 0; depth <= maxTypeDepth; depth++ { - switch v := (result).(type) { - case qualifier: - result = v.qualify() - default: - return result - } - } - return &cycle{typ} -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/handle.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/handle.go deleted file mode 100644 index 128e9b35cf3b..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/handle.go +++ /dev/null @@ -1,121 +0,0 @@ -package btf - -import ( - "errors" - "fmt" - "os" - - "github.com/cilium/ebpf/internal/sys" - "github.com/cilium/ebpf/internal/unix" -) - -// HandleInfo describes a Handle. -type HandleInfo struct { - // ID of this handle in the kernel. The ID is only valid as long as the - // associated handle is kept alive. - ID ID - - // Name is an identifying name for the BTF, currently only used by the - // kernel. - Name string - - // IsKernel is true if the BTF originated with the kernel and not - // userspace. - IsKernel bool - - // Size of the raw BTF in bytes. - size uint32 -} - -func newHandleInfoFromFD(fd *sys.FD) (*HandleInfo, error) { - // We invoke the syscall once with a empty BTF and name buffers to get size - // information to allocate buffers. Then we invoke it a second time with - // buffers to receive the data. - var btfInfo sys.BtfInfo - if err := sys.ObjInfo(fd, &btfInfo); err != nil { - return nil, fmt.Errorf("get BTF info for fd %s: %w", fd, err) - } - - if btfInfo.NameLen > 0 { - // NameLen doesn't account for the terminating NUL. - btfInfo.NameLen++ - } - - // Don't pull raw BTF by default, since it may be quite large. - btfSize := btfInfo.BtfSize - btfInfo.BtfSize = 0 - - nameBuffer := make([]byte, btfInfo.NameLen) - btfInfo.Name, btfInfo.NameLen = sys.NewSlicePointerLen(nameBuffer) - if err := sys.ObjInfo(fd, &btfInfo); err != nil { - return nil, err - } - - return &HandleInfo{ - ID: ID(btfInfo.Id), - Name: unix.ByteSliceToString(nameBuffer), - IsKernel: btfInfo.KernelBtf != 0, - size: btfSize, - }, nil -} - -// IsModule returns true if the BTF is for the kernel itself. -func (i *HandleInfo) IsVmlinux() bool { - return i.IsKernel && i.Name == "vmlinux" -} - -// IsModule returns true if the BTF is for a kernel module. -func (i *HandleInfo) IsModule() bool { - return i.IsKernel && i.Name != "vmlinux" -} - -// HandleIterator allows enumerating BTF blobs loaded into the kernel. -type HandleIterator struct { - // The ID of the last retrieved handle. Only valid after a call to Next. - ID ID - err error -} - -// Next retrieves a handle for the next BTF blob. -// -// [Handle.Close] is called if *handle is non-nil to avoid leaking fds. -// -// Returns true if another BTF blob was found. Call [HandleIterator.Err] after -// the function returns false. -func (it *HandleIterator) Next(handle **Handle) bool { - if *handle != nil { - (*handle).Close() - *handle = nil - } - - id := it.ID - for { - attr := &sys.BtfGetNextIdAttr{Id: id} - err := sys.BtfGetNextId(attr) - if errors.Is(err, os.ErrNotExist) { - // There are no more BTF objects. - return false - } else if err != nil { - it.err = fmt.Errorf("get next BTF ID: %w", err) - return false - } - - id = attr.NextId - *handle, err = NewHandleFromID(id) - if errors.Is(err, os.ErrNotExist) { - // Try again with the next ID. - continue - } else if err != nil { - it.err = fmt.Errorf("retrieve handle for ID %d: %w", id, err) - return false - } - - it.ID = id - return true - } -} - -// Err returns an error if iteration failed for some reason. -func (it *HandleIterator) Err() error { - return it.err -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/strings.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/strings.go deleted file mode 100644 index 67626e0dd172..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/strings.go +++ /dev/null @@ -1,128 +0,0 @@ -package btf - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" -) - -type stringTable struct { - base *stringTable - offsets []uint32 - strings []string -} - -// sizedReader is implemented by bytes.Reader, io.SectionReader, strings.Reader, etc. -type sizedReader interface { - io.Reader - Size() int64 -} - -func readStringTable(r sizedReader, base *stringTable) (*stringTable, error) { - // When parsing split BTF's string table, the first entry offset is derived - // from the last entry offset of the base BTF. - firstStringOffset := uint32(0) - if base != nil { - idx := len(base.offsets) - 1 - firstStringOffset = base.offsets[idx] + uint32(len(base.strings[idx])) + 1 - } - - // Derived from vmlinux BTF. - const averageStringLength = 16 - - n := int(r.Size() / averageStringLength) - offsets := make([]uint32, 0, n) - strings := make([]string, 0, n) - - offset := firstStringOffset - scanner := bufio.NewScanner(r) - scanner.Split(splitNull) - for scanner.Scan() { - str := scanner.Text() - offsets = append(offsets, offset) - strings = append(strings, str) - offset += uint32(len(str)) + 1 - } - if err := scanner.Err(); err != nil { - return nil, err - } - - if len(strings) == 0 { - return nil, errors.New("string table is empty") - } - - if firstStringOffset == 0 && strings[0] != "" { - return nil, errors.New("first item in string table is non-empty") - } - - return &stringTable{base, offsets, strings}, nil -} - -func splitNull(data []byte, atEOF bool) (advance int, token []byte, err error) { - i := bytes.IndexByte(data, 0) - if i == -1 { - if atEOF && len(data) > 0 { - return 0, nil, errors.New("string table isn't null terminated") - } - return 0, nil, nil - } - - return i + 1, data[:i], nil -} - -func (st *stringTable) Lookup(offset uint32) (string, error) { - if st.base != nil && offset <= st.base.offsets[len(st.base.offsets)-1] { - return st.base.lookup(offset) - } - return st.lookup(offset) -} - -func (st *stringTable) lookup(offset uint32) (string, error) { - i := search(st.offsets, offset) - if i == len(st.offsets) || st.offsets[i] != offset { - return "", fmt.Errorf("offset %d isn't start of a string", offset) - } - - return st.strings[i], nil -} - -func (st *stringTable) Length() int { - last := len(st.offsets) - 1 - return int(st.offsets[last]) + len(st.strings[last]) + 1 -} - -func (st *stringTable) Marshal(w io.Writer) error { - for _, str := range st.strings { - _, err := io.WriteString(w, str) - if err != nil { - return err - } - _, err = w.Write([]byte{0}) - if err != nil { - return err - } - } - return nil -} - -// search is a copy of sort.Search specialised for uint32. -// -// Licensed under https://go.dev/LICENSE -func search(ints []uint32, needle uint32) int { - // Define f(-1) == false and f(n) == true. - // Invariant: f(i-1) == false, f(j) == true. - i, j := 0, len(ints) - for i < j { - h := int(uint(i+j) >> 1) // avoid overflow when computing h - // i ≤ h < j - if !(ints[h] >= needle) { - i = h + 1 // preserves f(i-1) == false - } else { - j = h // preserves f(j) == true - } - } - // i == j, f(i-1) == false, and f(j) (= f(i)) == true => answer is i. - return i -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/types.go deleted file mode 100644 index 402a363c28ac..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/btf/types.go +++ /dev/null @@ -1,1212 +0,0 @@ -package btf - -import ( - "fmt" - "io" - "math" - "reflect" - "strings" - - "github.com/cilium/ebpf/asm" -) - -const maxTypeDepth = 32 - -// TypeID identifies a type in a BTF section. -type TypeID uint32 - -// Type represents a type described by BTF. -type Type interface { - // Type can be formatted using the %s and %v verbs. %s outputs only the - // identity of the type, without any detail. %v outputs additional detail. - // - // Use the '+' flag to include the address of the type. - // - // Use the width to specify how many levels of detail to output, for example - // %1v will output detail for the root type and a short description of its - // children. %2v would output details of the root type and its children - // as well as a short description of the grandchildren. - fmt.Formatter - - // Name of the type, empty for anonymous types and types that cannot - // carry a name, like Void and Pointer. - TypeName() string - - // Make a copy of the type, without copying Type members. - copy() Type - - // Enumerate all nested Types. Repeated calls must visit nested - // types in the same order. - walk(*typeDeque) -} - -var ( - _ Type = (*Int)(nil) - _ Type = (*Struct)(nil) - _ Type = (*Union)(nil) - _ Type = (*Enum)(nil) - _ Type = (*Fwd)(nil) - _ Type = (*Func)(nil) - _ Type = (*Typedef)(nil) - _ Type = (*Var)(nil) - _ Type = (*Datasec)(nil) - _ Type = (*Float)(nil) -) - -// types is a list of Type. -// -// The order determines the ID of a type. -type types []Type - -func (ts types) ByID(id TypeID) (Type, error) { - if int(id) > len(ts) { - return nil, fmt.Errorf("type ID %d: %w", id, ErrNotFound) - } - return ts[id], nil -} - -// Void is the unit type of BTF. -type Void struct{} - -func (v *Void) Format(fs fmt.State, verb rune) { formatType(fs, verb, v) } -func (v *Void) TypeName() string { return "" } -func (v *Void) size() uint32 { return 0 } -func (v *Void) copy() Type { return (*Void)(nil) } -func (v *Void) walk(*typeDeque) {} - -type IntEncoding byte - -const ( - Signed IntEncoding = 1 << iota - Char - Bool -) - -func (ie IntEncoding) IsSigned() bool { - return ie&Signed != 0 -} - -func (ie IntEncoding) IsChar() bool { - return ie&Char != 0 -} - -func (ie IntEncoding) IsBool() bool { - return ie&Bool != 0 -} - -func (ie IntEncoding) String() string { - switch { - case ie.IsChar() && ie.IsSigned(): - return "char" - case ie.IsChar() && !ie.IsSigned(): - return "uchar" - case ie.IsBool(): - return "bool" - case ie.IsSigned(): - return "signed" - default: - return "unsigned" - } -} - -// Int is an integer of a given length. -// -// See https://www.kernel.org/doc/html/latest/bpf/btf.html#btf-kind-int -type Int struct { - Name string - - // The size of the integer in bytes. - Size uint32 - Encoding IntEncoding -} - -func (i *Int) Format(fs fmt.State, verb rune) { - formatType(fs, verb, i, i.Encoding, "size=", i.Size*8) -} - -func (i *Int) TypeName() string { return i.Name } -func (i *Int) size() uint32 { return i.Size } -func (i *Int) walk(*typeDeque) {} -func (i *Int) copy() Type { - cpy := *i - return &cpy -} - -// Pointer is a pointer to another type. -type Pointer struct { - Target Type -} - -func (p *Pointer) Format(fs fmt.State, verb rune) { - formatType(fs, verb, p, "target=", p.Target) -} - -func (p *Pointer) TypeName() string { return "" } -func (p *Pointer) size() uint32 { return 8 } -func (p *Pointer) walk(tdq *typeDeque) { tdq.push(&p.Target) } -func (p *Pointer) copy() Type { - cpy := *p - return &cpy -} - -// Array is an array with a fixed number of elements. -type Array struct { - Index Type - Type Type - Nelems uint32 -} - -func (arr *Array) Format(fs fmt.State, verb rune) { - formatType(fs, verb, arr, "index=", arr.Index, "type=", arr.Type, "n=", arr.Nelems) -} - -func (arr *Array) TypeName() string { return "" } - -func (arr *Array) walk(tdq *typeDeque) { - tdq.push(&arr.Index) - tdq.push(&arr.Type) -} - -func (arr *Array) copy() Type { - cpy := *arr - return &cpy -} - -// Struct is a compound type of consecutive members. -type Struct struct { - Name string - // The size of the struct including padding, in bytes - Size uint32 - Members []Member -} - -func (s *Struct) Format(fs fmt.State, verb rune) { - formatType(fs, verb, s, "fields=", len(s.Members)) -} - -func (s *Struct) TypeName() string { return s.Name } - -func (s *Struct) size() uint32 { return s.Size } - -func (s *Struct) walk(tdq *typeDeque) { - for i := range s.Members { - tdq.push(&s.Members[i].Type) - } -} - -func (s *Struct) copy() Type { - cpy := *s - cpy.Members = copyMembers(s.Members) - return &cpy -} - -func (s *Struct) members() []Member { - return s.Members -} - -// Union is a compound type where members occupy the same memory. -type Union struct { - Name string - // The size of the union including padding, in bytes. - Size uint32 - Members []Member -} - -func (u *Union) Format(fs fmt.State, verb rune) { - formatType(fs, verb, u, "fields=", len(u.Members)) -} - -func (u *Union) TypeName() string { return u.Name } - -func (u *Union) size() uint32 { return u.Size } - -func (u *Union) walk(tdq *typeDeque) { - for i := range u.Members { - tdq.push(&u.Members[i].Type) - } -} - -func (u *Union) copy() Type { - cpy := *u - cpy.Members = copyMembers(u.Members) - return &cpy -} - -func (u *Union) members() []Member { - return u.Members -} - -func copyMembers(orig []Member) []Member { - cpy := make([]Member, len(orig)) - copy(cpy, orig) - return cpy -} - -type composite interface { - members() []Member -} - -var ( - _ composite = (*Struct)(nil) - _ composite = (*Union)(nil) -) - -// A value in bits. -type Bits uint32 - -// Bytes converts a bit value into bytes. -func (b Bits) Bytes() uint32 { - return uint32(b / 8) -} - -// Member is part of a Struct or Union. -// -// It is not a valid Type. -type Member struct { - Name string - Type Type - Offset Bits - BitfieldSize Bits -} - -// Enum lists possible values. -type Enum struct { - Name string - // Size of the enum value in bytes. - Size uint32 - Values []EnumValue -} - -func (e *Enum) Format(fs fmt.State, verb rune) { - formatType(fs, verb, e, "size=", e.Size, "values=", len(e.Values)) -} - -func (e *Enum) TypeName() string { return e.Name } - -// EnumValue is part of an Enum -// -// Is is not a valid Type -type EnumValue struct { - Name string - Value int32 -} - -func (e *Enum) size() uint32 { return e.Size } -func (e *Enum) walk(*typeDeque) {} -func (e *Enum) copy() Type { - cpy := *e - cpy.Values = make([]EnumValue, len(e.Values)) - copy(cpy.Values, e.Values) - return &cpy -} - -// FwdKind is the type of forward declaration. -type FwdKind int - -// Valid types of forward declaration. -const ( - FwdStruct FwdKind = iota - FwdUnion -) - -func (fk FwdKind) String() string { - switch fk { - case FwdStruct: - return "struct" - case FwdUnion: - return "union" - default: - return fmt.Sprintf("%T(%d)", fk, int(fk)) - } -} - -// Fwd is a forward declaration of a Type. -type Fwd struct { - Name string - Kind FwdKind -} - -func (f *Fwd) Format(fs fmt.State, verb rune) { - formatType(fs, verb, f, f.Kind) -} - -func (f *Fwd) TypeName() string { return f.Name } - -func (f *Fwd) walk(*typeDeque) {} -func (f *Fwd) copy() Type { - cpy := *f - return &cpy -} - -// Typedef is an alias of a Type. -type Typedef struct { - Name string - Type Type -} - -func (td *Typedef) Format(fs fmt.State, verb rune) { - formatType(fs, verb, td, td.Type) -} - -func (td *Typedef) TypeName() string { return td.Name } - -func (td *Typedef) walk(tdq *typeDeque) { tdq.push(&td.Type) } -func (td *Typedef) copy() Type { - cpy := *td - return &cpy -} - -// Volatile is a qualifier. -type Volatile struct { - Type Type -} - -func (v *Volatile) Format(fs fmt.State, verb rune) { - formatType(fs, verb, v, v.Type) -} - -func (v *Volatile) TypeName() string { return "" } - -func (v *Volatile) qualify() Type { return v.Type } -func (v *Volatile) walk(tdq *typeDeque) { tdq.push(&v.Type) } -func (v *Volatile) copy() Type { - cpy := *v - return &cpy -} - -// Const is a qualifier. -type Const struct { - Type Type -} - -func (c *Const) Format(fs fmt.State, verb rune) { - formatType(fs, verb, c, c.Type) -} - -func (c *Const) TypeName() string { return "" } - -func (c *Const) qualify() Type { return c.Type } -func (c *Const) walk(tdq *typeDeque) { tdq.push(&c.Type) } -func (c *Const) copy() Type { - cpy := *c - return &cpy -} - -// Restrict is a qualifier. -type Restrict struct { - Type Type -} - -func (r *Restrict) Format(fs fmt.State, verb rune) { - formatType(fs, verb, r, r.Type) -} - -func (r *Restrict) TypeName() string { return "" } - -func (r *Restrict) qualify() Type { return r.Type } -func (r *Restrict) walk(tdq *typeDeque) { tdq.push(&r.Type) } -func (r *Restrict) copy() Type { - cpy := *r - return &cpy -} - -// Func is a function definition. -type Func struct { - Name string - Type Type - Linkage FuncLinkage -} - -func FuncMetadata(ins *asm.Instruction) *Func { - fn, _ := ins.Metadata.Get(funcInfoMeta{}).(*Func) - return fn -} - -func (f *Func) Format(fs fmt.State, verb rune) { - formatType(fs, verb, f, f.Linkage, "proto=", f.Type) -} - -func (f *Func) TypeName() string { return f.Name } - -func (f *Func) walk(tdq *typeDeque) { tdq.push(&f.Type) } -func (f *Func) copy() Type { - cpy := *f - return &cpy -} - -// FuncProto is a function declaration. -type FuncProto struct { - Return Type - Params []FuncParam -} - -func (fp *FuncProto) Format(fs fmt.State, verb rune) { - formatType(fs, verb, fp, "args=", len(fp.Params), "return=", fp.Return) -} - -func (fp *FuncProto) TypeName() string { return "" } - -func (fp *FuncProto) walk(tdq *typeDeque) { - tdq.push(&fp.Return) - for i := range fp.Params { - tdq.push(&fp.Params[i].Type) - } -} - -func (fp *FuncProto) copy() Type { - cpy := *fp - cpy.Params = make([]FuncParam, len(fp.Params)) - copy(cpy.Params, fp.Params) - return &cpy -} - -type FuncParam struct { - Name string - Type Type -} - -// Var is a global variable. -type Var struct { - Name string - Type Type - Linkage VarLinkage -} - -func (v *Var) Format(fs fmt.State, verb rune) { - formatType(fs, verb, v, v.Linkage) -} - -func (v *Var) TypeName() string { return v.Name } - -func (v *Var) walk(tdq *typeDeque) { tdq.push(&v.Type) } -func (v *Var) copy() Type { - cpy := *v - return &cpy -} - -// Datasec is a global program section containing data. -type Datasec struct { - Name string - Size uint32 - Vars []VarSecinfo -} - -func (ds *Datasec) Format(fs fmt.State, verb rune) { - formatType(fs, verb, ds) -} - -func (ds *Datasec) TypeName() string { return ds.Name } - -func (ds *Datasec) size() uint32 { return ds.Size } - -func (ds *Datasec) walk(tdq *typeDeque) { - for i := range ds.Vars { - tdq.push(&ds.Vars[i].Type) - } -} - -func (ds *Datasec) copy() Type { - cpy := *ds - cpy.Vars = make([]VarSecinfo, len(ds.Vars)) - copy(cpy.Vars, ds.Vars) - return &cpy -} - -// VarSecinfo describes variable in a Datasec. -// -// It is not a valid Type. -type VarSecinfo struct { - Type Type - Offset uint32 - Size uint32 -} - -// Float is a float of a given length. -type Float struct { - Name string - - // The size of the float in bytes. - Size uint32 -} - -func (f *Float) Format(fs fmt.State, verb rune) { - formatType(fs, verb, f, "size=", f.Size*8) -} - -func (f *Float) TypeName() string { return f.Name } -func (f *Float) size() uint32 { return f.Size } -func (f *Float) walk(*typeDeque) {} -func (f *Float) copy() Type { - cpy := *f - return &cpy -} - -// cycle is a type which had to be elided since it exceeded maxTypeDepth. -type cycle struct { - root Type -} - -func (c *cycle) ID() TypeID { return math.MaxUint32 } -func (c *cycle) Format(fs fmt.State, verb rune) { formatType(fs, verb, c, "root=", c.root) } -func (c *cycle) TypeName() string { return "" } -func (c *cycle) walk(*typeDeque) {} -func (c *cycle) copy() Type { - cpy := *c - return &cpy -} - -type sizer interface { - size() uint32 -} - -var ( - _ sizer = (*Int)(nil) - _ sizer = (*Pointer)(nil) - _ sizer = (*Struct)(nil) - _ sizer = (*Union)(nil) - _ sizer = (*Enum)(nil) - _ sizer = (*Datasec)(nil) -) - -type qualifier interface { - qualify() Type -} - -var ( - _ qualifier = (*Const)(nil) - _ qualifier = (*Restrict)(nil) - _ qualifier = (*Volatile)(nil) -) - -// Sizeof returns the size of a type in bytes. -// -// Returns an error if the size can't be computed. -func Sizeof(typ Type) (int, error) { - var ( - n = int64(1) - elem int64 - ) - - for i := 0; i < maxTypeDepth; i++ { - switch v := typ.(type) { - case *Array: - if n > 0 && int64(v.Nelems) > math.MaxInt64/n { - return 0, fmt.Errorf("type %s: overflow", typ) - } - - // Arrays may be of zero length, which allows - // n to be zero as well. - n *= int64(v.Nelems) - typ = v.Type - continue - - case sizer: - elem = int64(v.size()) - - case *Typedef: - typ = v.Type - continue - - case qualifier: - typ = v.qualify() - continue - - default: - return 0, fmt.Errorf("unsized type %T", typ) - } - - if n > 0 && elem > math.MaxInt64/n { - return 0, fmt.Errorf("type %s: overflow", typ) - } - - size := n * elem - if int64(int(size)) != size { - return 0, fmt.Errorf("type %s: overflow", typ) - } - - return int(size), nil - } - - return 0, fmt.Errorf("type %s: exceeded type depth", typ) -} - -// alignof returns the alignment of a type. -// -// Currently only supports the subset of types necessary for bitfield relocations. -func alignof(typ Type) (int, error) { - switch t := UnderlyingType(typ).(type) { - case *Enum: - return int(t.size()), nil - case *Int: - return int(t.Size), nil - default: - return 0, fmt.Errorf("can't calculate alignment of %T", t) - } -} - -// Transformer modifies a given Type and returns the result. -// -// For example, UnderlyingType removes any qualifiers or typedefs from a type. -// See the example on Copy for how to use a transform. -type Transformer func(Type) Type - -// Copy a Type recursively. -// -// typ may form a cycle. If transform is not nil, it is called with the -// to be copied type, and the returned value is copied instead. -func Copy(typ Type, transform Transformer) Type { - copies := make(copier) - copies.copy(&typ, transform) - return typ -} - -// copy a slice of Types recursively. -// -// See Copy for the semantics. -func copyTypes(types []Type, transform Transformer) []Type { - result := make([]Type, len(types)) - copy(result, types) - - copies := make(copier) - for i := range result { - copies.copy(&result[i], transform) - } - - return result -} - -type copier map[Type]Type - -func (c copier) copy(typ *Type, transform Transformer) { - var work typeDeque - for t := typ; t != nil; t = work.pop() { - // *t is the identity of the type. - if cpy := c[*t]; cpy != nil { - *t = cpy - continue - } - - var cpy Type - if transform != nil { - cpy = transform(*t).copy() - } else { - cpy = (*t).copy() - } - - c[*t] = cpy - *t = cpy - - // Mark any nested types for copying. - cpy.walk(&work) - } -} - -// typeDeque keeps track of pointers to types which still -// need to be visited. -type typeDeque struct { - types []*Type - read, write uint64 - mask uint64 -} - -func (dq *typeDeque) empty() bool { - return dq.read == dq.write -} - -// push adds a type to the stack. -func (dq *typeDeque) push(t *Type) { - if dq.write-dq.read < uint64(len(dq.types)) { - dq.types[dq.write&dq.mask] = t - dq.write++ - return - } - - new := len(dq.types) * 2 - if new == 0 { - new = 8 - } - - types := make([]*Type, new) - pivot := dq.read & dq.mask - n := copy(types, dq.types[pivot:]) - n += copy(types[n:], dq.types[:pivot]) - types[n] = t - - dq.types = types - dq.mask = uint64(new) - 1 - dq.read, dq.write = 0, uint64(n+1) -} - -// shift returns the first element or null. -func (dq *typeDeque) shift() *Type { - if dq.empty() { - return nil - } - - index := dq.read & dq.mask - t := dq.types[index] - dq.types[index] = nil - dq.read++ - return t -} - -// pop returns the last element or null. -func (dq *typeDeque) pop() *Type { - if dq.empty() { - return nil - } - - dq.write-- - index := dq.write & dq.mask - t := dq.types[index] - dq.types[index] = nil - return t -} - -// all returns all elements. -// -// The deque is empty after calling this method. -func (dq *typeDeque) all() []*Type { - length := dq.write - dq.read - types := make([]*Type, 0, length) - for t := dq.shift(); t != nil; t = dq.shift() { - types = append(types, t) - } - return types -} - -// inflateRawTypes takes a list of raw btf types linked via type IDs, and turns -// it into a graph of Types connected via pointers. -// -// If baseTypes are provided, then the raw types are -// considered to be of a split BTF (e.g., a kernel module). -// -// Returns a slice of types indexed by TypeID. Since BTF ignores compilation -// units, multiple types may share the same name. A Type may form a cyclic graph -// by pointing at itself. -func inflateRawTypes(rawTypes []rawType, baseTypes types, rawStrings *stringTable) ([]Type, error) { - types := make([]Type, 0, len(rawTypes)+1) // +1 for Void added to base types - - typeIDOffset := TypeID(1) // Void is TypeID(0), so the rest starts from TypeID(1) - - if baseTypes == nil { - // Void is defined to always be type ID 0, and is thus omitted from BTF. - types = append(types, (*Void)(nil)) - } else { - // For split BTF, the next ID is max base BTF type ID + 1 - typeIDOffset = TypeID(len(baseTypes)) - } - - type fixupDef struct { - id TypeID - typ *Type - } - - var fixups []fixupDef - fixup := func(id TypeID, typ *Type) { - if id < TypeID(len(baseTypes)) { - *typ = baseTypes[id] - return - } - - idx := id - if baseTypes != nil { - idx = id - TypeID(len(baseTypes)) - } - if idx < TypeID(len(types)) { - // We've already inflated this type, fix it up immediately. - *typ = types[idx] - return - } - fixups = append(fixups, fixupDef{id, typ}) - } - - type assertion struct { - typ *Type - want reflect.Type - } - - var assertions []assertion - assert := func(typ *Type, want reflect.Type) error { - if *typ != nil { - // The type has already been fixed up, check the type immediately. - if reflect.TypeOf(*typ) != want { - return fmt.Errorf("expected %s, got %T", want, *typ) - } - return nil - } - assertions = append(assertions, assertion{typ, want}) - return nil - } - - type bitfieldFixupDef struct { - id TypeID - m *Member - } - - var ( - legacyBitfields = make(map[TypeID][2]Bits) // offset, size - bitfieldFixups []bitfieldFixupDef - ) - convertMembers := func(raw []btfMember, kindFlag bool) ([]Member, error) { - // NB: The fixup below relies on pre-allocating this array to - // work, since otherwise append might re-allocate members. - members := make([]Member, 0, len(raw)) - for i, btfMember := range raw { - name, err := rawStrings.Lookup(btfMember.NameOff) - if err != nil { - return nil, fmt.Errorf("can't get name for member %d: %w", i, err) - } - - members = append(members, Member{ - Name: name, - Offset: Bits(btfMember.Offset), - }) - - m := &members[i] - fixup(raw[i].Type, &m.Type) - - if kindFlag { - m.BitfieldSize = Bits(btfMember.Offset >> 24) - m.Offset &= 0xffffff - // We ignore legacy bitfield definitions if the current composite - // is a new-style bitfield. This is kind of safe since offset and - // size on the type of the member must be zero if kindFlat is set - // according to spec. - continue - } - - // This may be a legacy bitfield, try to fix it up. - data, ok := legacyBitfields[raw[i].Type] - if ok { - // Bingo! - m.Offset += data[0] - m.BitfieldSize = data[1] - continue - } - - if m.Type != nil { - // We couldn't find a legacy bitfield, but we know that the member's - // type has already been inflated. Hence we know that it can't be - // a legacy bitfield and there is nothing left to do. - continue - } - - // We don't have fixup data, and the type we're pointing - // at hasn't been inflated yet. No choice but to defer - // the fixup. - bitfieldFixups = append(bitfieldFixups, bitfieldFixupDef{ - raw[i].Type, - m, - }) - } - return members, nil - } - - for i, raw := range rawTypes { - var ( - id = typeIDOffset + TypeID(i) - typ Type - ) - - name, err := rawStrings.Lookup(raw.NameOff) - if err != nil { - return nil, fmt.Errorf("get name for type id %d: %w", id, err) - } - - switch raw.Kind() { - case kindInt: - size := raw.Size() - bi := raw.data.(*btfInt) - if bi.Offset() > 0 || bi.Bits().Bytes() != size { - legacyBitfields[id] = [2]Bits{bi.Offset(), bi.Bits()} - } - typ = &Int{name, raw.Size(), bi.Encoding()} - - case kindPointer: - ptr := &Pointer{nil} - fixup(raw.Type(), &ptr.Target) - typ = ptr - - case kindArray: - btfArr := raw.data.(*btfArray) - arr := &Array{nil, nil, btfArr.Nelems} - fixup(btfArr.IndexType, &arr.Index) - fixup(btfArr.Type, &arr.Type) - typ = arr - - case kindStruct: - members, err := convertMembers(raw.data.([]btfMember), raw.KindFlag()) - if err != nil { - return nil, fmt.Errorf("struct %s (id %d): %w", name, id, err) - } - typ = &Struct{name, raw.Size(), members} - - case kindUnion: - members, err := convertMembers(raw.data.([]btfMember), raw.KindFlag()) - if err != nil { - return nil, fmt.Errorf("union %s (id %d): %w", name, id, err) - } - typ = &Union{name, raw.Size(), members} - - case kindEnum: - rawvals := raw.data.([]btfEnum) - vals := make([]EnumValue, 0, len(rawvals)) - for i, btfVal := range rawvals { - name, err := rawStrings.Lookup(btfVal.NameOff) - if err != nil { - return nil, fmt.Errorf("get name for enum value %d: %s", i, err) - } - vals = append(vals, EnumValue{ - Name: name, - Value: btfVal.Val, - }) - } - typ = &Enum{name, raw.Size(), vals} - - case kindForward: - if raw.KindFlag() { - typ = &Fwd{name, FwdUnion} - } else { - typ = &Fwd{name, FwdStruct} - } - - case kindTypedef: - typedef := &Typedef{name, nil} - fixup(raw.Type(), &typedef.Type) - typ = typedef - - case kindVolatile: - volatile := &Volatile{nil} - fixup(raw.Type(), &volatile.Type) - typ = volatile - - case kindConst: - cnst := &Const{nil} - fixup(raw.Type(), &cnst.Type) - typ = cnst - - case kindRestrict: - restrict := &Restrict{nil} - fixup(raw.Type(), &restrict.Type) - typ = restrict - - case kindFunc: - fn := &Func{name, nil, raw.Linkage()} - fixup(raw.Type(), &fn.Type) - if err := assert(&fn.Type, reflect.TypeOf((*FuncProto)(nil))); err != nil { - return nil, err - } - typ = fn - - case kindFuncProto: - rawparams := raw.data.([]btfParam) - params := make([]FuncParam, 0, len(rawparams)) - for i, param := range rawparams { - name, err := rawStrings.Lookup(param.NameOff) - if err != nil { - return nil, fmt.Errorf("get name for func proto parameter %d: %s", i, err) - } - params = append(params, FuncParam{ - Name: name, - }) - } - for i := range params { - fixup(rawparams[i].Type, ¶ms[i].Type) - } - - fp := &FuncProto{nil, params} - fixup(raw.Type(), &fp.Return) - typ = fp - - case kindVar: - variable := raw.data.(*btfVariable) - v := &Var{name, nil, VarLinkage(variable.Linkage)} - fixup(raw.Type(), &v.Type) - typ = v - - case kindDatasec: - btfVars := raw.data.([]btfVarSecinfo) - vars := make([]VarSecinfo, 0, len(btfVars)) - for _, btfVar := range btfVars { - vars = append(vars, VarSecinfo{ - Offset: btfVar.Offset, - Size: btfVar.Size, - }) - } - for i := range vars { - fixup(btfVars[i].Type, &vars[i].Type) - if err := assert(&vars[i].Type, reflect.TypeOf((*Var)(nil))); err != nil { - return nil, err - } - } - typ = &Datasec{name, raw.SizeType, vars} - - case kindFloat: - typ = &Float{name, raw.Size()} - - default: - return nil, fmt.Errorf("type id %d: unknown kind: %v", id, raw.Kind()) - } - - types = append(types, typ) - } - - for _, fixup := range fixups { - i := int(fixup.id) - if i >= len(types)+len(baseTypes) { - return nil, fmt.Errorf("reference to invalid type id: %d", fixup.id) - } - if i < len(baseTypes) { - return nil, fmt.Errorf("fixup for base type id %d is not expected", i) - } - - *fixup.typ = types[i-len(baseTypes)] - } - - for _, bitfieldFixup := range bitfieldFixups { - if bitfieldFixup.id < TypeID(len(baseTypes)) { - return nil, fmt.Errorf("bitfield fixup from split to base types is not expected") - } - - data, ok := legacyBitfields[bitfieldFixup.id] - if ok { - // This is indeed a legacy bitfield, fix it up. - bitfieldFixup.m.Offset += data[0] - bitfieldFixup.m.BitfieldSize = data[1] - } - } - - for _, assertion := range assertions { - if reflect.TypeOf(*assertion.typ) != assertion.want { - return nil, fmt.Errorf("expected %s, got %T", assertion.want, *assertion.typ) - } - } - - return types, nil -} - -// essentialName represents the name of a BTF type stripped of any flavor -// suffixes after a ___ delimiter. -type essentialName string - -// newEssentialName returns name without a ___ suffix. -// -// CO-RE has the concept of 'struct flavors', which are used to deal with -// changes in kernel data structures. Anything after three underscores -// in a type name is ignored for the purpose of finding a candidate type -// in the kernel's BTF. -func newEssentialName(name string) essentialName { - if name == "" { - return "" - } - lastIdx := strings.LastIndex(name, "___") - if lastIdx > 0 { - return essentialName(name[:lastIdx]) - } - return essentialName(name) -} - -// UnderlyingType skips qualifiers and Typedefs. -func UnderlyingType(typ Type) Type { - result := typ - for depth := 0; depth <= maxTypeDepth; depth++ { - switch v := (result).(type) { - case qualifier: - result = v.qualify() - case *Typedef: - result = v.Type - default: - return result - } - } - return &cycle{typ} -} - -type formatState struct { - fmt.State - depth int -} - -// formattableType is a subset of Type, to ease unit testing of formatType. -type formattableType interface { - fmt.Formatter - TypeName() string -} - -// formatType formats a type in a canonical form. -// -// Handles cyclical types by only printing cycles up to a certain depth. Elements -// in extra are separated by spaces unless the preceding element is a string -// ending in '='. -func formatType(f fmt.State, verb rune, t formattableType, extra ...interface{}) { - if verb != 'v' && verb != 's' { - fmt.Fprintf(f, "{UNRECOGNIZED: %c}", verb) - return - } - - // This is the same as %T, but elides the package name. Assumes that - // formattableType is implemented by a pointer receiver. - goTypeName := reflect.TypeOf(t).Elem().Name() - _, _ = io.WriteString(f, goTypeName) - - if name := t.TypeName(); name != "" { - // Output BTF type name if present. - fmt.Fprintf(f, ":%q", name) - } - - if f.Flag('+') { - // Output address if requested. - fmt.Fprintf(f, ":%#p", t) - } - - if verb == 's' { - // %s omits details. - return - } - - var depth int - if ps, ok := f.(*formatState); ok { - depth = ps.depth - f = ps.State - } - - maxDepth, ok := f.Width() - if !ok { - maxDepth = 0 - } - - if depth > maxDepth { - // We've reached the maximum depth. This avoids infinite recursion even - // for cyclical types. - return - } - - if len(extra) == 0 { - return - } - - wantSpace := false - _, _ = io.WriteString(f, "[") - for _, arg := range extra { - if wantSpace { - _, _ = io.WriteString(f, " ") - } - - switch v := arg.(type) { - case string: - _, _ = io.WriteString(f, v) - wantSpace = len(v) > 0 && v[len(v)-1] != '=' - continue - - case formattableType: - v.Format(&formatState{f, depth + 1}, verb) - - default: - fmt.Fprint(f, arg) - } - - wantSpace = true - } - _, _ = io.WriteString(f, "]") -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/endian_be.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/endian_be.go deleted file mode 100644 index ad33cda8511b..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/endian_be.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build armbe || arm64be || mips || mips64 || mips64p32 || ppc64 || s390 || s390x || sparc || sparc64 -// +build armbe arm64be mips mips64 mips64p32 ppc64 s390 s390x sparc sparc64 - -package internal - -import "encoding/binary" - -// NativeEndian is set to either binary.BigEndian or binary.LittleEndian, -// depending on the host's endianness. -var NativeEndian binary.ByteOrder = binary.BigEndian - -// ClangEndian is set to either "el" or "eb" depending on the host's endianness. -const ClangEndian = "eb" diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/endian_le.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/endian_le.go deleted file mode 100644 index 41a68224c833..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/endian_le.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build 386 || amd64 || amd64p32 || arm || arm64 || mipsle || mips64le || mips64p32le || ppc64le || riscv64 -// +build 386 amd64 amd64p32 arm arm64 mipsle mips64le mips64p32le ppc64le riscv64 - -package internal - -import "encoding/binary" - -// NativeEndian is set to either binary.BigEndian or binary.LittleEndian, -// depending on the host's endianness. -var NativeEndian binary.ByteOrder = binary.LittleEndian - -// ClangEndian is set to either "el" or "eb" depending on the host's endianness. -const ClangEndian = "el" diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/output.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/output.go deleted file mode 100644 index aeab37fcfafe..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/output.go +++ /dev/null @@ -1,84 +0,0 @@ -package internal - -import ( - "bytes" - "errors" - "go/format" - "go/scanner" - "io" - "strings" - "unicode" -) - -// Identifier turns a C style type or field name into an exportable Go equivalent. -func Identifier(str string) string { - prev := rune(-1) - return strings.Map(func(r rune) rune { - // See https://golang.org/ref/spec#Identifiers - switch { - case unicode.IsLetter(r): - if prev == -1 { - r = unicode.ToUpper(r) - } - - case r == '_': - switch { - // The previous rune was deleted, or we are at the - // beginning of the string. - case prev == -1: - fallthrough - - // The previous rune is a lower case letter or a digit. - case unicode.IsDigit(prev) || (unicode.IsLetter(prev) && unicode.IsLower(prev)): - // delete the current rune, and force the - // next character to be uppercased. - r = -1 - } - - case unicode.IsDigit(r): - - default: - // Delete the current rune. prev is unchanged. - return -1 - } - - prev = r - return r - }, str) -} - -// WriteFormatted outputs a formatted src into out. -// -// If formatting fails it returns an informative error message. -func WriteFormatted(src []byte, out io.Writer) error { - formatted, err := format.Source(src) - if err == nil { - _, err = out.Write(formatted) - return err - } - - var el scanner.ErrorList - if !errors.As(err, &el) { - return err - } - - var nel scanner.ErrorList - for _, err := range el { - if !err.Pos.IsValid() { - nel = append(nel, err) - continue - } - - buf := src[err.Pos.Offset:] - nl := bytes.IndexRune(buf, '\n') - if nl == -1 { - nel = append(nel, err) - continue - } - - err.Msg += ": " + string(buf[:nl]) - nel = append(nel, err) - } - - return nel -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/doc.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/doc.go deleted file mode 100644 index dfe174448e1c..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package sys contains bindings for the BPF syscall. -package sys - -// Regenerate types.go by invoking go generate in the current directory. - -//go:generate go run github.com/cilium/ebpf/internal/cmd/gentypes ../../btf/testdata/vmlinux.btf.gz diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/fd.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/fd.go deleted file mode 100644 index 65517d45e26a..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/fd.go +++ /dev/null @@ -1,96 +0,0 @@ -package sys - -import ( - "fmt" - "math" - "os" - "runtime" - "strconv" - - "github.com/cilium/ebpf/internal/unix" -) - -var ErrClosedFd = unix.EBADF - -type FD struct { - raw int -} - -func newFD(value int) *FD { - fd := &FD{value} - runtime.SetFinalizer(fd, (*FD).Close) - return fd -} - -// NewFD wraps a raw fd with a finalizer. -// -// You must not use the raw fd after calling this function, since the underlying -// file descriptor number may change. This is because the BPF UAPI assumes that -// zero is not a valid fd value. -func NewFD(value int) (*FD, error) { - if value < 0 { - return nil, fmt.Errorf("invalid fd %d", value) - } - - fd := newFD(value) - if value != 0 { - return fd, nil - } - - dup, err := fd.Dup() - _ = fd.Close() - return dup, err -} - -func (fd *FD) String() string { - return strconv.FormatInt(int64(fd.raw), 10) -} - -func (fd *FD) Int() int { - return fd.raw -} - -func (fd *FD) Uint() uint32 { - if fd.raw < 0 || int64(fd.raw) > math.MaxUint32 { - // Best effort: this is the number most likely to be an invalid file - // descriptor. It is equal to -1 (on two's complement arches). - return math.MaxUint32 - } - return uint32(fd.raw) -} - -func (fd *FD) Close() error { - if fd.raw < 0 { - return nil - } - - value := int(fd.raw) - fd.raw = -1 - - fd.Forget() - return unix.Close(value) -} - -func (fd *FD) Forget() { - runtime.SetFinalizer(fd, nil) -} - -func (fd *FD) Dup() (*FD, error) { - if fd.raw < 0 { - return nil, ErrClosedFd - } - - // Always require the fd to be larger than zero: the BPF API treats the value - // as "no argument provided". - dup, err := unix.FcntlInt(uintptr(fd.raw), unix.F_DUPFD_CLOEXEC, 1) - if err != nil { - return nil, fmt.Errorf("can't dup fd: %v", err) - } - - return newFD(dup), nil -} - -func (fd *FD) File(name string) *os.File { - fd.Forget() - return os.NewFile(uintptr(fd.raw), name) -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr.go deleted file mode 100644 index a221006888d0..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr.go +++ /dev/null @@ -1,38 +0,0 @@ -package sys - -import ( - "unsafe" - - "github.com/cilium/ebpf/internal/unix" -) - -// NewPointer creates a 64-bit pointer from an unsafe Pointer. -func NewPointer(ptr unsafe.Pointer) Pointer { - return Pointer{ptr: ptr} -} - -// NewSlicePointer creates a 64-bit pointer from a byte slice. -func NewSlicePointer(buf []byte) Pointer { - if len(buf) == 0 { - return Pointer{} - } - - return Pointer{ptr: unsafe.Pointer(&buf[0])} -} - -// NewSlicePointer creates a 64-bit pointer from a byte slice. -// -// Useful to assign both the pointer and the length in one go. -func NewSlicePointerLen(buf []byte) (Pointer, uint32) { - return NewSlicePointer(buf), uint32(len(buf)) -} - -// NewStringPointer creates a 64-bit pointer from a string. -func NewStringPointer(str string) Pointer { - p, err := unix.BytePtrFromString(str) - if err != nil { - return Pointer{} - } - - return Pointer{ptr: unsafe.Pointer(p)} -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_32_be.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_32_be.go deleted file mode 100644 index df903d780b15..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_32_be.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build armbe || mips || mips64p32 -// +build armbe mips mips64p32 - -package sys - -import ( - "unsafe" -) - -// Pointer wraps an unsafe.Pointer to be 64bit to -// conform to the syscall specification. -type Pointer struct { - pad uint32 - ptr unsafe.Pointer -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_32_le.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_32_le.go deleted file mode 100644 index a6a51edb6e10..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_32_le.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build 386 || amd64p32 || arm || mipsle || mips64p32le -// +build 386 amd64p32 arm mipsle mips64p32le - -package sys - -import ( - "unsafe" -) - -// Pointer wraps an unsafe.Pointer to be 64bit to -// conform to the syscall specification. -type Pointer struct { - ptr unsafe.Pointer - pad uint32 -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_64.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_64.go deleted file mode 100644 index 7c0279e487c7..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/ptr_64.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build !386 && !amd64p32 && !arm && !mipsle && !mips64p32le && !armbe && !mips && !mips64p32 -// +build !386,!amd64p32,!arm,!mipsle,!mips64p32le,!armbe,!mips,!mips64p32 - -package sys - -import ( - "unsafe" -) - -// Pointer wraps an unsafe.Pointer to be 64bit to -// conform to the syscall specification. -type Pointer struct { - ptr unsafe.Pointer -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/syscall.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/syscall.go deleted file mode 100644 index 2a5935dc9123..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/syscall.go +++ /dev/null @@ -1,126 +0,0 @@ -package sys - -import ( - "runtime" - "syscall" - "unsafe" - - "github.com/cilium/ebpf/internal/unix" -) - -// BPF wraps SYS_BPF. -// -// Any pointers contained in attr must use the Pointer type from this package. -func BPF(cmd Cmd, attr unsafe.Pointer, size uintptr) (uintptr, error) { - for { - r1, _, errNo := unix.Syscall(unix.SYS_BPF, uintptr(cmd), uintptr(attr), size) - runtime.KeepAlive(attr) - - // As of ~4.20 the verifier can be interrupted by a signal, - // and returns EAGAIN in that case. - if errNo == unix.EAGAIN && cmd == BPF_PROG_LOAD { - continue - } - - var err error - if errNo != 0 { - err = wrappedErrno{errNo} - } - - return r1, err - } -} - -// Info is implemented by all structs that can be passed to the ObjInfo syscall. -// -// MapInfo -// ProgInfo -// LinkInfo -// BtfInfo -type Info interface { - info() (unsafe.Pointer, uint32) -} - -var _ Info = (*MapInfo)(nil) - -func (i *MapInfo) info() (unsafe.Pointer, uint32) { - return unsafe.Pointer(i), uint32(unsafe.Sizeof(*i)) -} - -var _ Info = (*ProgInfo)(nil) - -func (i *ProgInfo) info() (unsafe.Pointer, uint32) { - return unsafe.Pointer(i), uint32(unsafe.Sizeof(*i)) -} - -var _ Info = (*LinkInfo)(nil) - -func (i *LinkInfo) info() (unsafe.Pointer, uint32) { - return unsafe.Pointer(i), uint32(unsafe.Sizeof(*i)) -} - -var _ Info = (*BtfInfo)(nil) - -func (i *BtfInfo) info() (unsafe.Pointer, uint32) { - return unsafe.Pointer(i), uint32(unsafe.Sizeof(*i)) -} - -// ObjInfo retrieves information about a BPF Fd. -// -// info may be one of MapInfo, ProgInfo, LinkInfo and BtfInfo. -func ObjInfo(fd *FD, info Info) error { - ptr, len := info.info() - err := ObjGetInfoByFd(&ObjGetInfoByFdAttr{ - BpfFd: fd.Uint(), - InfoLen: len, - Info: NewPointer(ptr), - }) - runtime.KeepAlive(fd) - return err -} - -// BPFObjName is a null-terminated string made up of -// 'A-Za-z0-9_' characters. -type ObjName [unix.BPF_OBJ_NAME_LEN]byte - -// NewObjName truncates the result if it is too long. -func NewObjName(name string) ObjName { - var result ObjName - copy(result[:unix.BPF_OBJ_NAME_LEN-1], name) - return result -} - -// LinkID uniquely identifies a bpf_link. -type LinkID uint32 - -// BTFID uniquely identifies a BTF blob loaded into the kernel. -type BTFID uint32 - -// wrappedErrno wraps syscall.Errno to prevent direct comparisons with -// syscall.E* or unix.E* constants. -// -// You should never export an error of this type. -type wrappedErrno struct { - syscall.Errno -} - -func (we wrappedErrno) Unwrap() error { - return we.Errno -} - -type syscallError struct { - error - errno syscall.Errno -} - -func Error(err error, errno syscall.Errno) error { - return &syscallError{err, errno} -} - -func (se *syscallError) Is(target error) bool { - return target == se.error -} - -func (se *syscallError) Unwrap() error { - return se.errno -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/types.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/types.go deleted file mode 100644 index 291e3a6196cb..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/sys/types.go +++ /dev/null @@ -1,1052 +0,0 @@ -// Code generated by internal/cmd/gentypes; DO NOT EDIT. - -package sys - -import ( - "unsafe" -) - -type AdjRoomMode int32 - -const ( - BPF_ADJ_ROOM_NET AdjRoomMode = 0 - BPF_ADJ_ROOM_MAC AdjRoomMode = 1 -) - -type AttachType int32 - -const ( - BPF_CGROUP_INET_INGRESS AttachType = 0 - BPF_CGROUP_INET_EGRESS AttachType = 1 - BPF_CGROUP_INET_SOCK_CREATE AttachType = 2 - BPF_CGROUP_SOCK_OPS AttachType = 3 - BPF_SK_SKB_STREAM_PARSER AttachType = 4 - BPF_SK_SKB_STREAM_VERDICT AttachType = 5 - BPF_CGROUP_DEVICE AttachType = 6 - BPF_SK_MSG_VERDICT AttachType = 7 - BPF_CGROUP_INET4_BIND AttachType = 8 - BPF_CGROUP_INET6_BIND AttachType = 9 - BPF_CGROUP_INET4_CONNECT AttachType = 10 - BPF_CGROUP_INET6_CONNECT AttachType = 11 - BPF_CGROUP_INET4_POST_BIND AttachType = 12 - BPF_CGROUP_INET6_POST_BIND AttachType = 13 - BPF_CGROUP_UDP4_SENDMSG AttachType = 14 - BPF_CGROUP_UDP6_SENDMSG AttachType = 15 - BPF_LIRC_MODE2 AttachType = 16 - BPF_FLOW_DISSECTOR AttachType = 17 - BPF_CGROUP_SYSCTL AttachType = 18 - BPF_CGROUP_UDP4_RECVMSG AttachType = 19 - BPF_CGROUP_UDP6_RECVMSG AttachType = 20 - BPF_CGROUP_GETSOCKOPT AttachType = 21 - BPF_CGROUP_SETSOCKOPT AttachType = 22 - BPF_TRACE_RAW_TP AttachType = 23 - BPF_TRACE_FENTRY AttachType = 24 - BPF_TRACE_FEXIT AttachType = 25 - BPF_MODIFY_RETURN AttachType = 26 - BPF_LSM_MAC AttachType = 27 - BPF_TRACE_ITER AttachType = 28 - BPF_CGROUP_INET4_GETPEERNAME AttachType = 29 - BPF_CGROUP_INET6_GETPEERNAME AttachType = 30 - BPF_CGROUP_INET4_GETSOCKNAME AttachType = 31 - BPF_CGROUP_INET6_GETSOCKNAME AttachType = 32 - BPF_XDP_DEVMAP AttachType = 33 - BPF_CGROUP_INET_SOCK_RELEASE AttachType = 34 - BPF_XDP_CPUMAP AttachType = 35 - BPF_SK_LOOKUP AttachType = 36 - BPF_XDP AttachType = 37 - BPF_SK_SKB_VERDICT AttachType = 38 - BPF_SK_REUSEPORT_SELECT AttachType = 39 - BPF_SK_REUSEPORT_SELECT_OR_MIGRATE AttachType = 40 - BPF_PERF_EVENT AttachType = 41 - BPF_TRACE_KPROBE_MULTI AttachType = 42 - __MAX_BPF_ATTACH_TYPE AttachType = 43 -) - -type Cmd int32 - -const ( - BPF_MAP_CREATE Cmd = 0 - BPF_MAP_LOOKUP_ELEM Cmd = 1 - BPF_MAP_UPDATE_ELEM Cmd = 2 - BPF_MAP_DELETE_ELEM Cmd = 3 - BPF_MAP_GET_NEXT_KEY Cmd = 4 - BPF_PROG_LOAD Cmd = 5 - BPF_OBJ_PIN Cmd = 6 - BPF_OBJ_GET Cmd = 7 - BPF_PROG_ATTACH Cmd = 8 - BPF_PROG_DETACH Cmd = 9 - BPF_PROG_TEST_RUN Cmd = 10 - BPF_PROG_RUN Cmd = 10 - BPF_PROG_GET_NEXT_ID Cmd = 11 - BPF_MAP_GET_NEXT_ID Cmd = 12 - BPF_PROG_GET_FD_BY_ID Cmd = 13 - BPF_MAP_GET_FD_BY_ID Cmd = 14 - BPF_OBJ_GET_INFO_BY_FD Cmd = 15 - BPF_PROG_QUERY Cmd = 16 - BPF_RAW_TRACEPOINT_OPEN Cmd = 17 - BPF_BTF_LOAD Cmd = 18 - BPF_BTF_GET_FD_BY_ID Cmd = 19 - BPF_TASK_FD_QUERY Cmd = 20 - BPF_MAP_LOOKUP_AND_DELETE_ELEM Cmd = 21 - BPF_MAP_FREEZE Cmd = 22 - BPF_BTF_GET_NEXT_ID Cmd = 23 - BPF_MAP_LOOKUP_BATCH Cmd = 24 - BPF_MAP_LOOKUP_AND_DELETE_BATCH Cmd = 25 - BPF_MAP_UPDATE_BATCH Cmd = 26 - BPF_MAP_DELETE_BATCH Cmd = 27 - BPF_LINK_CREATE Cmd = 28 - BPF_LINK_UPDATE Cmd = 29 - BPF_LINK_GET_FD_BY_ID Cmd = 30 - BPF_LINK_GET_NEXT_ID Cmd = 31 - BPF_ENABLE_STATS Cmd = 32 - BPF_ITER_CREATE Cmd = 33 - BPF_LINK_DETACH Cmd = 34 - BPF_PROG_BIND_MAP Cmd = 35 -) - -type FunctionId int32 - -const ( - BPF_FUNC_unspec FunctionId = 0 - BPF_FUNC_map_lookup_elem FunctionId = 1 - BPF_FUNC_map_update_elem FunctionId = 2 - BPF_FUNC_map_delete_elem FunctionId = 3 - BPF_FUNC_probe_read FunctionId = 4 - BPF_FUNC_ktime_get_ns FunctionId = 5 - BPF_FUNC_trace_printk FunctionId = 6 - BPF_FUNC_get_prandom_u32 FunctionId = 7 - BPF_FUNC_get_smp_processor_id FunctionId = 8 - BPF_FUNC_skb_store_bytes FunctionId = 9 - BPF_FUNC_l3_csum_replace FunctionId = 10 - BPF_FUNC_l4_csum_replace FunctionId = 11 - BPF_FUNC_tail_call FunctionId = 12 - BPF_FUNC_clone_redirect FunctionId = 13 - BPF_FUNC_get_current_pid_tgid FunctionId = 14 - BPF_FUNC_get_current_uid_gid FunctionId = 15 - BPF_FUNC_get_current_comm FunctionId = 16 - BPF_FUNC_get_cgroup_classid FunctionId = 17 - BPF_FUNC_skb_vlan_push FunctionId = 18 - BPF_FUNC_skb_vlan_pop FunctionId = 19 - BPF_FUNC_skb_get_tunnel_key FunctionId = 20 - BPF_FUNC_skb_set_tunnel_key FunctionId = 21 - BPF_FUNC_perf_event_read FunctionId = 22 - BPF_FUNC_redirect FunctionId = 23 - BPF_FUNC_get_route_realm FunctionId = 24 - BPF_FUNC_perf_event_output FunctionId = 25 - BPF_FUNC_skb_load_bytes FunctionId = 26 - BPF_FUNC_get_stackid FunctionId = 27 - BPF_FUNC_csum_diff FunctionId = 28 - BPF_FUNC_skb_get_tunnel_opt FunctionId = 29 - BPF_FUNC_skb_set_tunnel_opt FunctionId = 30 - BPF_FUNC_skb_change_proto FunctionId = 31 - BPF_FUNC_skb_change_type FunctionId = 32 - BPF_FUNC_skb_under_cgroup FunctionId = 33 - BPF_FUNC_get_hash_recalc FunctionId = 34 - BPF_FUNC_get_current_task FunctionId = 35 - BPF_FUNC_probe_write_user FunctionId = 36 - BPF_FUNC_current_task_under_cgroup FunctionId = 37 - BPF_FUNC_skb_change_tail FunctionId = 38 - BPF_FUNC_skb_pull_data FunctionId = 39 - BPF_FUNC_csum_update FunctionId = 40 - BPF_FUNC_set_hash_invalid FunctionId = 41 - BPF_FUNC_get_numa_node_id FunctionId = 42 - BPF_FUNC_skb_change_head FunctionId = 43 - BPF_FUNC_xdp_adjust_head FunctionId = 44 - BPF_FUNC_probe_read_str FunctionId = 45 - BPF_FUNC_get_socket_cookie FunctionId = 46 - BPF_FUNC_get_socket_uid FunctionId = 47 - BPF_FUNC_set_hash FunctionId = 48 - BPF_FUNC_setsockopt FunctionId = 49 - BPF_FUNC_skb_adjust_room FunctionId = 50 - BPF_FUNC_redirect_map FunctionId = 51 - BPF_FUNC_sk_redirect_map FunctionId = 52 - BPF_FUNC_sock_map_update FunctionId = 53 - BPF_FUNC_xdp_adjust_meta FunctionId = 54 - BPF_FUNC_perf_event_read_value FunctionId = 55 - BPF_FUNC_perf_prog_read_value FunctionId = 56 - BPF_FUNC_getsockopt FunctionId = 57 - BPF_FUNC_override_return FunctionId = 58 - BPF_FUNC_sock_ops_cb_flags_set FunctionId = 59 - BPF_FUNC_msg_redirect_map FunctionId = 60 - BPF_FUNC_msg_apply_bytes FunctionId = 61 - BPF_FUNC_msg_cork_bytes FunctionId = 62 - BPF_FUNC_msg_pull_data FunctionId = 63 - BPF_FUNC_bind FunctionId = 64 - BPF_FUNC_xdp_adjust_tail FunctionId = 65 - BPF_FUNC_skb_get_xfrm_state FunctionId = 66 - BPF_FUNC_get_stack FunctionId = 67 - BPF_FUNC_skb_load_bytes_relative FunctionId = 68 - BPF_FUNC_fib_lookup FunctionId = 69 - BPF_FUNC_sock_hash_update FunctionId = 70 - BPF_FUNC_msg_redirect_hash FunctionId = 71 - BPF_FUNC_sk_redirect_hash FunctionId = 72 - BPF_FUNC_lwt_push_encap FunctionId = 73 - BPF_FUNC_lwt_seg6_store_bytes FunctionId = 74 - BPF_FUNC_lwt_seg6_adjust_srh FunctionId = 75 - BPF_FUNC_lwt_seg6_action FunctionId = 76 - BPF_FUNC_rc_repeat FunctionId = 77 - BPF_FUNC_rc_keydown FunctionId = 78 - BPF_FUNC_skb_cgroup_id FunctionId = 79 - BPF_FUNC_get_current_cgroup_id FunctionId = 80 - BPF_FUNC_get_local_storage FunctionId = 81 - BPF_FUNC_sk_select_reuseport FunctionId = 82 - BPF_FUNC_skb_ancestor_cgroup_id FunctionId = 83 - BPF_FUNC_sk_lookup_tcp FunctionId = 84 - BPF_FUNC_sk_lookup_udp FunctionId = 85 - BPF_FUNC_sk_release FunctionId = 86 - BPF_FUNC_map_push_elem FunctionId = 87 - BPF_FUNC_map_pop_elem FunctionId = 88 - BPF_FUNC_map_peek_elem FunctionId = 89 - BPF_FUNC_msg_push_data FunctionId = 90 - BPF_FUNC_msg_pop_data FunctionId = 91 - BPF_FUNC_rc_pointer_rel FunctionId = 92 - BPF_FUNC_spin_lock FunctionId = 93 - BPF_FUNC_spin_unlock FunctionId = 94 - BPF_FUNC_sk_fullsock FunctionId = 95 - BPF_FUNC_tcp_sock FunctionId = 96 - BPF_FUNC_skb_ecn_set_ce FunctionId = 97 - BPF_FUNC_get_listener_sock FunctionId = 98 - BPF_FUNC_skc_lookup_tcp FunctionId = 99 - BPF_FUNC_tcp_check_syncookie FunctionId = 100 - BPF_FUNC_sysctl_get_name FunctionId = 101 - BPF_FUNC_sysctl_get_current_value FunctionId = 102 - BPF_FUNC_sysctl_get_new_value FunctionId = 103 - BPF_FUNC_sysctl_set_new_value FunctionId = 104 - BPF_FUNC_strtol FunctionId = 105 - BPF_FUNC_strtoul FunctionId = 106 - BPF_FUNC_sk_storage_get FunctionId = 107 - BPF_FUNC_sk_storage_delete FunctionId = 108 - BPF_FUNC_send_signal FunctionId = 109 - BPF_FUNC_tcp_gen_syncookie FunctionId = 110 - BPF_FUNC_skb_output FunctionId = 111 - BPF_FUNC_probe_read_user FunctionId = 112 - BPF_FUNC_probe_read_kernel FunctionId = 113 - BPF_FUNC_probe_read_user_str FunctionId = 114 - BPF_FUNC_probe_read_kernel_str FunctionId = 115 - BPF_FUNC_tcp_send_ack FunctionId = 116 - BPF_FUNC_send_signal_thread FunctionId = 117 - BPF_FUNC_jiffies64 FunctionId = 118 - BPF_FUNC_read_branch_records FunctionId = 119 - BPF_FUNC_get_ns_current_pid_tgid FunctionId = 120 - BPF_FUNC_xdp_output FunctionId = 121 - BPF_FUNC_get_netns_cookie FunctionId = 122 - BPF_FUNC_get_current_ancestor_cgroup_id FunctionId = 123 - BPF_FUNC_sk_assign FunctionId = 124 - BPF_FUNC_ktime_get_boot_ns FunctionId = 125 - BPF_FUNC_seq_printf FunctionId = 126 - BPF_FUNC_seq_write FunctionId = 127 - BPF_FUNC_sk_cgroup_id FunctionId = 128 - BPF_FUNC_sk_ancestor_cgroup_id FunctionId = 129 - BPF_FUNC_ringbuf_output FunctionId = 130 - BPF_FUNC_ringbuf_reserve FunctionId = 131 - BPF_FUNC_ringbuf_submit FunctionId = 132 - BPF_FUNC_ringbuf_discard FunctionId = 133 - BPF_FUNC_ringbuf_query FunctionId = 134 - BPF_FUNC_csum_level FunctionId = 135 - BPF_FUNC_skc_to_tcp6_sock FunctionId = 136 - BPF_FUNC_skc_to_tcp_sock FunctionId = 137 - BPF_FUNC_skc_to_tcp_timewait_sock FunctionId = 138 - BPF_FUNC_skc_to_tcp_request_sock FunctionId = 139 - BPF_FUNC_skc_to_udp6_sock FunctionId = 140 - BPF_FUNC_get_task_stack FunctionId = 141 - BPF_FUNC_load_hdr_opt FunctionId = 142 - BPF_FUNC_store_hdr_opt FunctionId = 143 - BPF_FUNC_reserve_hdr_opt FunctionId = 144 - BPF_FUNC_inode_storage_get FunctionId = 145 - BPF_FUNC_inode_storage_delete FunctionId = 146 - BPF_FUNC_d_path FunctionId = 147 - BPF_FUNC_copy_from_user FunctionId = 148 - BPF_FUNC_snprintf_btf FunctionId = 149 - BPF_FUNC_seq_printf_btf FunctionId = 150 - BPF_FUNC_skb_cgroup_classid FunctionId = 151 - BPF_FUNC_redirect_neigh FunctionId = 152 - BPF_FUNC_per_cpu_ptr FunctionId = 153 - BPF_FUNC_this_cpu_ptr FunctionId = 154 - BPF_FUNC_redirect_peer FunctionId = 155 - BPF_FUNC_task_storage_get FunctionId = 156 - BPF_FUNC_task_storage_delete FunctionId = 157 - BPF_FUNC_get_current_task_btf FunctionId = 158 - BPF_FUNC_bprm_opts_set FunctionId = 159 - BPF_FUNC_ktime_get_coarse_ns FunctionId = 160 - BPF_FUNC_ima_inode_hash FunctionId = 161 - BPF_FUNC_sock_from_file FunctionId = 162 - BPF_FUNC_check_mtu FunctionId = 163 - BPF_FUNC_for_each_map_elem FunctionId = 164 - BPF_FUNC_snprintf FunctionId = 165 - BPF_FUNC_sys_bpf FunctionId = 166 - BPF_FUNC_btf_find_by_name_kind FunctionId = 167 - BPF_FUNC_sys_close FunctionId = 168 - BPF_FUNC_timer_init FunctionId = 169 - BPF_FUNC_timer_set_callback FunctionId = 170 - BPF_FUNC_timer_start FunctionId = 171 - BPF_FUNC_timer_cancel FunctionId = 172 - BPF_FUNC_get_func_ip FunctionId = 173 - BPF_FUNC_get_attach_cookie FunctionId = 174 - BPF_FUNC_task_pt_regs FunctionId = 175 - BPF_FUNC_get_branch_snapshot FunctionId = 176 - BPF_FUNC_trace_vprintk FunctionId = 177 - BPF_FUNC_skc_to_unix_sock FunctionId = 178 - BPF_FUNC_kallsyms_lookup_name FunctionId = 179 - BPF_FUNC_find_vma FunctionId = 180 - BPF_FUNC_loop FunctionId = 181 - BPF_FUNC_strncmp FunctionId = 182 - BPF_FUNC_get_func_arg FunctionId = 183 - BPF_FUNC_get_func_ret FunctionId = 184 - BPF_FUNC_get_func_arg_cnt FunctionId = 185 - BPF_FUNC_get_retval FunctionId = 186 - BPF_FUNC_set_retval FunctionId = 187 - BPF_FUNC_xdp_get_buff_len FunctionId = 188 - BPF_FUNC_xdp_load_bytes FunctionId = 189 - BPF_FUNC_xdp_store_bytes FunctionId = 190 - BPF_FUNC_copy_from_user_task FunctionId = 191 - BPF_FUNC_skb_set_tstamp FunctionId = 192 - BPF_FUNC_ima_file_hash FunctionId = 193 - __BPF_FUNC_MAX_ID FunctionId = 194 -) - -type HdrStartOff int32 - -const ( - BPF_HDR_START_MAC HdrStartOff = 0 - BPF_HDR_START_NET HdrStartOff = 1 -) - -type LinkType int32 - -const ( - BPF_LINK_TYPE_UNSPEC LinkType = 0 - BPF_LINK_TYPE_RAW_TRACEPOINT LinkType = 1 - BPF_LINK_TYPE_TRACING LinkType = 2 - BPF_LINK_TYPE_CGROUP LinkType = 3 - BPF_LINK_TYPE_ITER LinkType = 4 - BPF_LINK_TYPE_NETNS LinkType = 5 - BPF_LINK_TYPE_XDP LinkType = 6 - BPF_LINK_TYPE_PERF_EVENT LinkType = 7 - BPF_LINK_TYPE_KPROBE_MULTI LinkType = 8 - MAX_BPF_LINK_TYPE LinkType = 9 -) - -type MapType int32 - -const ( - BPF_MAP_TYPE_UNSPEC MapType = 0 - BPF_MAP_TYPE_HASH MapType = 1 - BPF_MAP_TYPE_ARRAY MapType = 2 - BPF_MAP_TYPE_PROG_ARRAY MapType = 3 - BPF_MAP_TYPE_PERF_EVENT_ARRAY MapType = 4 - BPF_MAP_TYPE_PERCPU_HASH MapType = 5 - BPF_MAP_TYPE_PERCPU_ARRAY MapType = 6 - BPF_MAP_TYPE_STACK_TRACE MapType = 7 - BPF_MAP_TYPE_CGROUP_ARRAY MapType = 8 - BPF_MAP_TYPE_LRU_HASH MapType = 9 - BPF_MAP_TYPE_LRU_PERCPU_HASH MapType = 10 - BPF_MAP_TYPE_LPM_TRIE MapType = 11 - BPF_MAP_TYPE_ARRAY_OF_MAPS MapType = 12 - BPF_MAP_TYPE_HASH_OF_MAPS MapType = 13 - BPF_MAP_TYPE_DEVMAP MapType = 14 - BPF_MAP_TYPE_SOCKMAP MapType = 15 - BPF_MAP_TYPE_CPUMAP MapType = 16 - BPF_MAP_TYPE_XSKMAP MapType = 17 - BPF_MAP_TYPE_SOCKHASH MapType = 18 - BPF_MAP_TYPE_CGROUP_STORAGE MapType = 19 - BPF_MAP_TYPE_REUSEPORT_SOCKARRAY MapType = 20 - BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE MapType = 21 - BPF_MAP_TYPE_QUEUE MapType = 22 - BPF_MAP_TYPE_STACK MapType = 23 - BPF_MAP_TYPE_SK_STORAGE MapType = 24 - BPF_MAP_TYPE_DEVMAP_HASH MapType = 25 - BPF_MAP_TYPE_STRUCT_OPS MapType = 26 - BPF_MAP_TYPE_RINGBUF MapType = 27 - BPF_MAP_TYPE_INODE_STORAGE MapType = 28 - BPF_MAP_TYPE_TASK_STORAGE MapType = 29 - BPF_MAP_TYPE_BLOOM_FILTER MapType = 30 -) - -type ProgType int32 - -const ( - BPF_PROG_TYPE_UNSPEC ProgType = 0 - BPF_PROG_TYPE_SOCKET_FILTER ProgType = 1 - BPF_PROG_TYPE_KPROBE ProgType = 2 - BPF_PROG_TYPE_SCHED_CLS ProgType = 3 - BPF_PROG_TYPE_SCHED_ACT ProgType = 4 - BPF_PROG_TYPE_TRACEPOINT ProgType = 5 - BPF_PROG_TYPE_XDP ProgType = 6 - BPF_PROG_TYPE_PERF_EVENT ProgType = 7 - BPF_PROG_TYPE_CGROUP_SKB ProgType = 8 - BPF_PROG_TYPE_CGROUP_SOCK ProgType = 9 - BPF_PROG_TYPE_LWT_IN ProgType = 10 - BPF_PROG_TYPE_LWT_OUT ProgType = 11 - BPF_PROG_TYPE_LWT_XMIT ProgType = 12 - BPF_PROG_TYPE_SOCK_OPS ProgType = 13 - BPF_PROG_TYPE_SK_SKB ProgType = 14 - BPF_PROG_TYPE_CGROUP_DEVICE ProgType = 15 - BPF_PROG_TYPE_SK_MSG ProgType = 16 - BPF_PROG_TYPE_RAW_TRACEPOINT ProgType = 17 - BPF_PROG_TYPE_CGROUP_SOCK_ADDR ProgType = 18 - BPF_PROG_TYPE_LWT_SEG6LOCAL ProgType = 19 - BPF_PROG_TYPE_LIRC_MODE2 ProgType = 20 - BPF_PROG_TYPE_SK_REUSEPORT ProgType = 21 - BPF_PROG_TYPE_FLOW_DISSECTOR ProgType = 22 - BPF_PROG_TYPE_CGROUP_SYSCTL ProgType = 23 - BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE ProgType = 24 - BPF_PROG_TYPE_CGROUP_SOCKOPT ProgType = 25 - BPF_PROG_TYPE_TRACING ProgType = 26 - BPF_PROG_TYPE_STRUCT_OPS ProgType = 27 - BPF_PROG_TYPE_EXT ProgType = 28 - BPF_PROG_TYPE_LSM ProgType = 29 - BPF_PROG_TYPE_SK_LOOKUP ProgType = 30 - BPF_PROG_TYPE_SYSCALL ProgType = 31 -) - -type RetCode int32 - -const ( - BPF_OK RetCode = 0 - BPF_DROP RetCode = 2 - BPF_REDIRECT RetCode = 7 - BPF_LWT_REROUTE RetCode = 128 -) - -type SkAction int32 - -const ( - SK_DROP SkAction = 0 - SK_PASS SkAction = 1 -) - -type StackBuildIdStatus int32 - -const ( - BPF_STACK_BUILD_ID_EMPTY StackBuildIdStatus = 0 - BPF_STACK_BUILD_ID_VALID StackBuildIdStatus = 1 - BPF_STACK_BUILD_ID_IP StackBuildIdStatus = 2 -) - -type StatsType int32 - -const ( - BPF_STATS_RUN_TIME StatsType = 0 -) - -type XdpAction int32 - -const ( - XDP_ABORTED XdpAction = 0 - XDP_DROP XdpAction = 1 - XDP_PASS XdpAction = 2 - XDP_TX XdpAction = 3 - XDP_REDIRECT XdpAction = 4 -) - -type BtfInfo struct { - Btf Pointer - BtfSize uint32 - Id BTFID - Name Pointer - NameLen uint32 - KernelBtf uint32 -} - -type FuncInfo struct { - InsnOff uint32 - TypeId uint32 -} - -type LineInfo struct { - InsnOff uint32 - FileNameOff uint32 - LineOff uint32 - LineCol uint32 -} - -type LinkInfo struct { - Type LinkType - Id LinkID - ProgId uint32 - _ [4]byte - Extra [16]uint8 -} - -type MapInfo struct { - Type uint32 - Id uint32 - KeySize uint32 - ValueSize uint32 - MaxEntries uint32 - MapFlags uint32 - Name ObjName - Ifindex uint32 - BtfVmlinuxValueTypeId uint32 - NetnsDev uint64 - NetnsIno uint64 - BtfId uint32 - BtfKeyTypeId uint32 - BtfValueTypeId uint32 - _ [4]byte - MapExtra uint64 -} - -type ProgInfo struct { - Type uint32 - Id uint32 - Tag [8]uint8 - JitedProgLen uint32 - XlatedProgLen uint32 - JitedProgInsns uint64 - XlatedProgInsns Pointer - LoadTime uint64 - CreatedByUid uint32 - NrMapIds uint32 - MapIds Pointer - Name ObjName - Ifindex uint32 - _ [4]byte /* unsupported bitfield */ - NetnsDev uint64 - NetnsIno uint64 - NrJitedKsyms uint32 - NrJitedFuncLens uint32 - JitedKsyms uint64 - JitedFuncLens uint64 - BtfId uint32 - FuncInfoRecSize uint32 - FuncInfo uint64 - NrFuncInfo uint32 - NrLineInfo uint32 - LineInfo uint64 - JitedLineInfo uint64 - NrJitedLineInfo uint32 - LineInfoRecSize uint32 - JitedLineInfoRecSize uint32 - NrProgTags uint32 - ProgTags uint64 - RunTimeNs uint64 - RunCnt uint64 - RecursionMisses uint64 - VerifiedInsns uint32 - _ [4]byte -} - -type SkLookup struct { - Cookie uint64 - Family uint32 - Protocol uint32 - RemoteIp4 [4]uint8 - RemoteIp6 [16]uint8 - RemotePort uint16 - _ [2]byte - LocalIp4 [4]uint8 - LocalIp6 [16]uint8 - LocalPort uint32 - IngressIfindex uint32 - _ [4]byte -} - -type XdpMd struct { - Data uint32 - DataEnd uint32 - DataMeta uint32 - IngressIfindex uint32 - RxQueueIndex uint32 - EgressIfindex uint32 -} - -type BtfGetFdByIdAttr struct{ Id uint32 } - -func BtfGetFdById(attr *BtfGetFdByIdAttr) (*FD, error) { - fd, err := BPF(BPF_BTF_GET_FD_BY_ID, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type BtfGetNextIdAttr struct { - Id BTFID - NextId BTFID -} - -func BtfGetNextId(attr *BtfGetNextIdAttr) error { - _, err := BPF(BPF_BTF_GET_NEXT_ID, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type BtfLoadAttr struct { - Btf Pointer - BtfLogBuf Pointer - BtfSize uint32 - BtfLogSize uint32 - BtfLogLevel uint32 - _ [4]byte -} - -func BtfLoad(attr *BtfLoadAttr) (*FD, error) { - fd, err := BPF(BPF_BTF_LOAD, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type EnableStatsAttr struct{ Type uint32 } - -func EnableStats(attr *EnableStatsAttr) (*FD, error) { - fd, err := BPF(BPF_ENABLE_STATS, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type IterCreateAttr struct { - LinkFd uint32 - Flags uint32 -} - -func IterCreate(attr *IterCreateAttr) (*FD, error) { - fd, err := BPF(BPF_ITER_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type LinkCreateAttr struct { - ProgFd uint32 - TargetFd uint32 - AttachType AttachType - Flags uint32 - TargetBtfId uint32 - _ [28]byte -} - -func LinkCreate(attr *LinkCreateAttr) (*FD, error) { - fd, err := BPF(BPF_LINK_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type LinkCreateIterAttr struct { - ProgFd uint32 - TargetFd uint32 - AttachType AttachType - Flags uint32 - IterInfo Pointer - IterInfoLen uint32 - _ [20]byte -} - -func LinkCreateIter(attr *LinkCreateIterAttr) (*FD, error) { - fd, err := BPF(BPF_LINK_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type LinkCreatePerfEventAttr struct { - ProgFd uint32 - TargetFd uint32 - AttachType AttachType - Flags uint32 - BpfCookie uint64 - _ [24]byte -} - -func LinkCreatePerfEvent(attr *LinkCreatePerfEventAttr) (*FD, error) { - fd, err := BPF(BPF_LINK_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type LinkUpdateAttr struct { - LinkFd uint32 - NewProgFd uint32 - Flags uint32 - OldProgFd uint32 -} - -func LinkUpdate(attr *LinkUpdateAttr) error { - _, err := BPF(BPF_LINK_UPDATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapCreateAttr struct { - MapType MapType - KeySize uint32 - ValueSize uint32 - MaxEntries uint32 - MapFlags uint32 - InnerMapFd uint32 - NumaNode uint32 - MapName ObjName - MapIfindex uint32 - BtfFd uint32 - BtfKeyTypeId uint32 - BtfValueTypeId uint32 - BtfVmlinuxValueTypeId uint32 - MapExtra uint64 -} - -func MapCreate(attr *MapCreateAttr) (*FD, error) { - fd, err := BPF(BPF_MAP_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type MapDeleteBatchAttr struct { - InBatch Pointer - OutBatch Pointer - Keys Pointer - Values Pointer - Count uint32 - MapFd uint32 - ElemFlags uint64 - Flags uint64 -} - -func MapDeleteBatch(attr *MapDeleteBatchAttr) error { - _, err := BPF(BPF_MAP_DELETE_BATCH, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapDeleteElemAttr struct { - MapFd uint32 - _ [4]byte - Key Pointer - Value Pointer - Flags uint64 -} - -func MapDeleteElem(attr *MapDeleteElemAttr) error { - _, err := BPF(BPF_MAP_DELETE_ELEM, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapFreezeAttr struct{ MapFd uint32 } - -func MapFreeze(attr *MapFreezeAttr) error { - _, err := BPF(BPF_MAP_FREEZE, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapGetFdByIdAttr struct{ Id uint32 } - -func MapGetFdById(attr *MapGetFdByIdAttr) (*FD, error) { - fd, err := BPF(BPF_MAP_GET_FD_BY_ID, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type MapGetNextIdAttr struct { - Id uint32 - NextId uint32 -} - -func MapGetNextId(attr *MapGetNextIdAttr) error { - _, err := BPF(BPF_MAP_GET_NEXT_ID, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapGetNextKeyAttr struct { - MapFd uint32 - _ [4]byte - Key Pointer - NextKey Pointer -} - -func MapGetNextKey(attr *MapGetNextKeyAttr) error { - _, err := BPF(BPF_MAP_GET_NEXT_KEY, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapLookupAndDeleteBatchAttr struct { - InBatch Pointer - OutBatch Pointer - Keys Pointer - Values Pointer - Count uint32 - MapFd uint32 - ElemFlags uint64 - Flags uint64 -} - -func MapLookupAndDeleteBatch(attr *MapLookupAndDeleteBatchAttr) error { - _, err := BPF(BPF_MAP_LOOKUP_AND_DELETE_BATCH, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapLookupAndDeleteElemAttr struct { - MapFd uint32 - _ [4]byte - Key Pointer - Value Pointer - Flags uint64 -} - -func MapLookupAndDeleteElem(attr *MapLookupAndDeleteElemAttr) error { - _, err := BPF(BPF_MAP_LOOKUP_AND_DELETE_ELEM, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapLookupBatchAttr struct { - InBatch Pointer - OutBatch Pointer - Keys Pointer - Values Pointer - Count uint32 - MapFd uint32 - ElemFlags uint64 - Flags uint64 -} - -func MapLookupBatch(attr *MapLookupBatchAttr) error { - _, err := BPF(BPF_MAP_LOOKUP_BATCH, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapLookupElemAttr struct { - MapFd uint32 - _ [4]byte - Key Pointer - Value Pointer - Flags uint64 -} - -func MapLookupElem(attr *MapLookupElemAttr) error { - _, err := BPF(BPF_MAP_LOOKUP_ELEM, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapUpdateBatchAttr struct { - InBatch Pointer - OutBatch Pointer - Keys Pointer - Values Pointer - Count uint32 - MapFd uint32 - ElemFlags uint64 - Flags uint64 -} - -func MapUpdateBatch(attr *MapUpdateBatchAttr) error { - _, err := BPF(BPF_MAP_UPDATE_BATCH, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type MapUpdateElemAttr struct { - MapFd uint32 - _ [4]byte - Key Pointer - Value Pointer - Flags uint64 -} - -func MapUpdateElem(attr *MapUpdateElemAttr) error { - _, err := BPF(BPF_MAP_UPDATE_ELEM, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type ObjGetAttr struct { - Pathname Pointer - BpfFd uint32 - FileFlags uint32 -} - -func ObjGet(attr *ObjGetAttr) (*FD, error) { - fd, err := BPF(BPF_OBJ_GET, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type ObjGetInfoByFdAttr struct { - BpfFd uint32 - InfoLen uint32 - Info Pointer -} - -func ObjGetInfoByFd(attr *ObjGetInfoByFdAttr) error { - _, err := BPF(BPF_OBJ_GET_INFO_BY_FD, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type ObjPinAttr struct { - Pathname Pointer - BpfFd uint32 - FileFlags uint32 -} - -func ObjPin(attr *ObjPinAttr) error { - _, err := BPF(BPF_OBJ_PIN, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type ProgAttachAttr struct { - TargetFd uint32 - AttachBpfFd uint32 - AttachType uint32 - AttachFlags uint32 - ReplaceBpfFd uint32 -} - -func ProgAttach(attr *ProgAttachAttr) error { - _, err := BPF(BPF_PROG_ATTACH, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type ProgBindMapAttr struct { - ProgFd uint32 - MapFd uint32 - Flags uint32 -} - -func ProgBindMap(attr *ProgBindMapAttr) error { - _, err := BPF(BPF_PROG_BIND_MAP, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type ProgDetachAttr struct { - TargetFd uint32 - AttachBpfFd uint32 - AttachType uint32 -} - -func ProgDetach(attr *ProgDetachAttr) error { - _, err := BPF(BPF_PROG_DETACH, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type ProgGetFdByIdAttr struct{ Id uint32 } - -func ProgGetFdById(attr *ProgGetFdByIdAttr) (*FD, error) { - fd, err := BPF(BPF_PROG_GET_FD_BY_ID, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type ProgGetNextIdAttr struct { - Id uint32 - NextId uint32 -} - -func ProgGetNextId(attr *ProgGetNextIdAttr) error { - _, err := BPF(BPF_PROG_GET_NEXT_ID, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type ProgLoadAttr struct { - ProgType ProgType - InsnCnt uint32 - Insns Pointer - License Pointer - LogLevel uint32 - LogSize uint32 - LogBuf Pointer - KernVersion uint32 - ProgFlags uint32 - ProgName ObjName - ProgIfindex uint32 - ExpectedAttachType AttachType - ProgBtfFd uint32 - FuncInfoRecSize uint32 - FuncInfo Pointer - FuncInfoCnt uint32 - LineInfoRecSize uint32 - LineInfo Pointer - LineInfoCnt uint32 - AttachBtfId uint32 - AttachProgFd uint32 - CoreReloCnt uint32 - FdArray Pointer - CoreRelos Pointer - CoreReloRecSize uint32 - _ [4]byte -} - -func ProgLoad(attr *ProgLoadAttr) (*FD, error) { - fd, err := BPF(BPF_PROG_LOAD, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type ProgRunAttr struct { - ProgFd uint32 - Retval uint32 - DataSizeIn uint32 - DataSizeOut uint32 - DataIn Pointer - DataOut Pointer - Repeat uint32 - Duration uint32 - CtxSizeIn uint32 - CtxSizeOut uint32 - CtxIn Pointer - CtxOut Pointer - Flags uint32 - Cpu uint32 - BatchSize uint32 - _ [4]byte -} - -func ProgRun(attr *ProgRunAttr) error { - _, err := BPF(BPF_PROG_TEST_RUN, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - return err -} - -type RawTracepointOpenAttr struct { - Name Pointer - ProgFd uint32 - _ [4]byte -} - -func RawTracepointOpen(attr *RawTracepointOpenAttr) (*FD, error) { - fd, err := BPF(BPF_RAW_TRACEPOINT_OPEN, unsafe.Pointer(attr), unsafe.Sizeof(*attr)) - if err != nil { - return nil, err - } - return NewFD(int(fd)) -} - -type CgroupLinkInfo struct { - CgroupId uint64 - AttachType AttachType - _ [4]byte -} - -type IterLinkInfo struct { - TargetName Pointer - TargetNameLen uint32 -} - -type NetNsLinkInfo struct { - NetnsIno uint32 - AttachType AttachType -} - -type RawTracepointLinkInfo struct { - TpName Pointer - TpNameLen uint32 - _ [4]byte -} - -type TracingLinkInfo struct { - AttachType AttachType - TargetObjId uint32 - TargetBtfId uint32 -} - -type XDPLinkInfo struct{ Ifindex uint32 } diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/vdso.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/vdso.go deleted file mode 100644 index ae4821de20c4..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/internal/vdso.go +++ /dev/null @@ -1,150 +0,0 @@ -package internal - -import ( - "debug/elf" - "encoding/binary" - "errors" - "fmt" - "io" - "math" - "os" - - "github.com/cilium/ebpf/internal/unix" -) - -var ( - errAuxvNoVDSO = errors.New("no vdso address found in auxv") -) - -// vdsoVersion returns the LINUX_VERSION_CODE embedded in the vDSO library -// linked into the current process image. -func vdsoVersion() (uint32, error) { - // Read data from the auxiliary vector, which is normally passed directly - // to the process. Go does not expose that data, so we must read it from procfs. - // https://man7.org/linux/man-pages/man3/getauxval.3.html - av, err := os.Open("/proc/self/auxv") - if err != nil { - return 0, fmt.Errorf("opening auxv: %w", err) - } - defer av.Close() - - vdsoAddr, err := vdsoMemoryAddress(av) - if err != nil { - return 0, fmt.Errorf("finding vDSO memory address: %w", err) - } - - // Use /proc/self/mem rather than unsafe.Pointer tricks. - mem, err := os.Open("/proc/self/mem") - if err != nil { - return 0, fmt.Errorf("opening mem: %w", err) - } - defer mem.Close() - - // Open ELF at provided memory address, as offset into /proc/self/mem. - c, err := vdsoLinuxVersionCode(io.NewSectionReader(mem, int64(vdsoAddr), math.MaxInt64)) - if err != nil { - return 0, fmt.Errorf("reading linux version code: %w", err) - } - - return c, nil -} - -// vdsoMemoryAddress returns the memory address of the vDSO library -// linked into the current process image. r is an io.Reader into an auxv blob. -func vdsoMemoryAddress(r io.Reader) (uint64, error) { - const ( - _AT_NULL = 0 // End of vector - _AT_SYSINFO_EHDR = 33 // Offset to vDSO blob in process image - ) - - // Loop through all tag/value pairs in auxv until we find `AT_SYSINFO_EHDR`, - // the address of a page containing the virtual Dynamic Shared Object (vDSO). - aux := struct{ Tag, Val uint64 }{} - for { - if err := binary.Read(r, NativeEndian, &aux); err != nil { - return 0, fmt.Errorf("reading auxv entry: %w", err) - } - - switch aux.Tag { - case _AT_SYSINFO_EHDR: - if aux.Val != 0 { - return aux.Val, nil - } - return 0, fmt.Errorf("invalid vDSO address in auxv") - // _AT_NULL is always the last tag/val pair in the aux vector - // and can be treated like EOF. - case _AT_NULL: - return 0, errAuxvNoVDSO - } - } -} - -// format described at https://www.man7.org/linux/man-pages/man5/elf.5.html in section 'Notes (Nhdr)' -type elfNoteHeader struct { - NameSize int32 - DescSize int32 - Type int32 -} - -// vdsoLinuxVersionCode returns the LINUX_VERSION_CODE embedded in -// the ELF notes section of the binary provided by the reader. -func vdsoLinuxVersionCode(r io.ReaderAt) (uint32, error) { - hdr, err := NewSafeELFFile(r) - if err != nil { - return 0, fmt.Errorf("reading vDSO ELF: %w", err) - } - - sections := hdr.SectionsByType(elf.SHT_NOTE) - if len(sections) == 0 { - return 0, fmt.Errorf("no note section found in vDSO ELF") - } - - for _, sec := range sections { - sr := sec.Open() - var n elfNoteHeader - - // Read notes until we find one named 'Linux'. - for { - if err := binary.Read(sr, hdr.ByteOrder, &n); err != nil { - if errors.Is(err, io.EOF) { - // We looked at all the notes in this section - break - } - return 0, fmt.Errorf("reading note header: %w", err) - } - - // If a note name is defined, it follows the note header. - var name string - if n.NameSize > 0 { - // Read the note name, aligned to 4 bytes. - buf := make([]byte, Align(int(n.NameSize), 4)) - if err := binary.Read(sr, hdr.ByteOrder, &buf); err != nil { - return 0, fmt.Errorf("reading note name: %w", err) - } - - // Read nul-terminated string. - name = unix.ByteSliceToString(buf[:n.NameSize]) - } - - // If a note descriptor is defined, it follows the name. - // It is possible for a note to have a descriptor but not a name. - if n.DescSize > 0 { - // LINUX_VERSION_CODE is a uint32 value. - if name == "Linux" && n.DescSize == 4 && n.Type == 0 { - var version uint32 - if err := binary.Read(sr, hdr.ByteOrder, &version); err != nil { - return 0, fmt.Errorf("reading note descriptor: %w", err) - } - return version, nil - } - - // Discard the note descriptor if it exists but we're not interested in it. - if _, err := io.CopyN(io.Discard, sr, int64(Align(int(n.DescSize), 4))); err != nil { - return 0, err - } - } - } - } - - return 0, fmt.Errorf("no Linux note in ELF") -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/socket_filter.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/socket_filter.go deleted file mode 100644 index 94f3958cc4d8..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/socket_filter.go +++ /dev/null @@ -1,40 +0,0 @@ -package link - -import ( - "syscall" - - "github.com/cilium/ebpf" - "github.com/cilium/ebpf/internal/unix" -) - -// AttachSocketFilter attaches a SocketFilter BPF program to a socket. -func AttachSocketFilter(conn syscall.Conn, program *ebpf.Program) error { - rawConn, err := conn.SyscallConn() - if err != nil { - return err - } - var ssoErr error - err = rawConn.Control(func(fd uintptr) { - ssoErr = syscall.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_ATTACH_BPF, program.FD()) - }) - if ssoErr != nil { - return ssoErr - } - return err -} - -// DetachSocketFilter detaches a SocketFilter BPF program from a socket. -func DetachSocketFilter(conn syscall.Conn) error { - rawConn, err := conn.SyscallConn() - if err != nil { - return err - } - var ssoErr error - err = rawConn.Control(func(fd uintptr) { - ssoErr = syscall.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_DETACH_BPF, 0) - }) - if ssoErr != nil { - return ssoErr - } - return err -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/tracing.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/tracing.go deleted file mode 100644 index e47e61a3b843..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/tracing.go +++ /dev/null @@ -1,141 +0,0 @@ -package link - -import ( - "fmt" - - "github.com/cilium/ebpf" - "github.com/cilium/ebpf/btf" - "github.com/cilium/ebpf/internal/sys" -) - -type tracing struct { - RawLink -} - -func (f *tracing) Update(new *ebpf.Program) error { - return fmt.Errorf("tracing update: %w", ErrNotSupported) -} - -// AttachFreplace attaches the given eBPF program to the function it replaces. -// -// The program and name can either be provided at link time, or can be provided -// at program load time. If they were provided at load time, they should be nil -// and empty respectively here, as they will be ignored by the kernel. -// Examples: -// -// AttachFreplace(dispatcher, "function", replacement) -// AttachFreplace(nil, "", replacement) -func AttachFreplace(targetProg *ebpf.Program, name string, prog *ebpf.Program) (Link, error) { - if (name == "") != (targetProg == nil) { - return nil, fmt.Errorf("must provide both or neither of name and targetProg: %w", errInvalidInput) - } - if prog == nil { - return nil, fmt.Errorf("prog cannot be nil: %w", errInvalidInput) - } - if prog.Type() != ebpf.Extension { - return nil, fmt.Errorf("eBPF program type %s is not an Extension: %w", prog.Type(), errInvalidInput) - } - - var ( - target int - typeID btf.TypeID - ) - if targetProg != nil { - btfHandle, err := targetProg.Handle() - if err != nil { - return nil, err - } - defer btfHandle.Close() - - spec, err := btfHandle.Spec(nil) - if err != nil { - return nil, err - } - - var function *btf.Func - if err := spec.TypeByName(name, &function); err != nil { - return nil, err - } - - target = targetProg.FD() - typeID, err = spec.TypeID(function) - if err != nil { - return nil, err - } - } - - link, err := AttachRawLink(RawLinkOptions{ - Target: target, - Program: prog, - Attach: ebpf.AttachNone, - BTF: typeID, - }) - if err != nil { - return nil, err - } - - return &tracing{*link}, nil -} - -type TracingOptions struct { - // Program must be of type Tracing with attach type - // AttachTraceFEntry/AttachTraceFExit/AttachModifyReturn or - // AttachTraceRawTp. - Program *ebpf.Program -} - -type LSMOptions struct { - // Program must be of type LSM with attach type - // AttachLSMMac. - Program *ebpf.Program -} - -// attachBTFID links all BPF program types (Tracing/LSM) that they attach to a btf_id. -func attachBTFID(program *ebpf.Program) (Link, error) { - if program.FD() < 0 { - return nil, fmt.Errorf("invalid program %w", sys.ErrClosedFd) - } - - fd, err := sys.RawTracepointOpen(&sys.RawTracepointOpenAttr{ - ProgFd: uint32(program.FD()), - }) - if err != nil { - return nil, err - } - - raw := RawLink{fd: fd} - info, err := raw.Info() - if err != nil { - raw.Close() - return nil, err - } - - if info.Type == RawTracepointType { - // Sadness upon sadness: a Tracing program with AttachRawTp returns - // a raw_tracepoint link. Other types return a tracing link. - return &rawTracepoint{raw}, nil - } - - return &tracing{RawLink: RawLink{fd: fd}}, nil -} - -// AttachTracing links a tracing (fentry/fexit/fmod_ret) BPF program or -// a BTF-powered raw tracepoint (tp_btf) BPF Program to a BPF hook defined -// in kernel modules. -func AttachTracing(opts TracingOptions) (Link, error) { - if t := opts.Program.Type(); t != ebpf.Tracing { - return nil, fmt.Errorf("invalid program type %s, expected Tracing", t) - } - - return attachBTFID(opts.Program) -} - -// AttachLSM links a Linux security module (LSM) BPF Program to a BPF -// hook defined in kernel modules. -func AttachLSM(opts LSMOptions) (Link, error) { - if t := opts.Program.Type(); t != ebpf.LSM { - return nil, fmt.Errorf("invalid program type %s, expected LSM", t) - } - - return attachBTFID(opts.Program) -} diff --git a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/xdp.go b/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/xdp.go deleted file mode 100644 index aa8dd3a4cb39..000000000000 --- a/cluster-autoscaler/vendor/github.com/cilium/ebpf/link/xdp.go +++ /dev/null @@ -1,54 +0,0 @@ -package link - -import ( - "fmt" - - "github.com/cilium/ebpf" -) - -// XDPAttachFlags represents how XDP program will be attached to interface. -type XDPAttachFlags uint32 - -const ( - // XDPGenericMode (SKB) links XDP BPF program for drivers which do - // not yet support native XDP. - XDPGenericMode XDPAttachFlags = 1 << (iota + 1) - // XDPDriverMode links XDP BPF program into the driver’s receive path. - XDPDriverMode - // XDPOffloadMode offloads the entire XDP BPF program into hardware. - XDPOffloadMode -) - -type XDPOptions struct { - // Program must be an XDP BPF program. - Program *ebpf.Program - - // Interface is the interface index to attach program to. - Interface int - - // Flags is one of XDPAttachFlags (optional). - // - // Only one XDP mode should be set, without flag defaults - // to driver/generic mode (best effort). - Flags XDPAttachFlags -} - -// AttachXDP links an XDP BPF program to an XDP hook. -func AttachXDP(opts XDPOptions) (Link, error) { - if t := opts.Program.Type(); t != ebpf.XDP { - return nil, fmt.Errorf("invalid program type %s, expected XDP", t) - } - - if opts.Interface < 1 { - return nil, fmt.Errorf("invalid interface index: %d", opts.Interface) - } - - rawLink, err := AttachRawLink(RawLinkOptions{ - Program: opts.Program, - Attach: ebpf.AttachXDP, - Target: opts.Interface, - Flags: uint32(opts.Flags), - }) - - return rawLink, err -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/.gitignore b/cluster-autoscaler/vendor/github.com/containerd/cgroups/.gitignore deleted file mode 100644 index 3465c14cf778..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -example/example -cmd/cgctl/cgctl diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/Makefile b/cluster-autoscaler/vendor/github.com/containerd/cgroups/Makefile deleted file mode 100644 index 19e6607561d5..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -PACKAGES=$(shell go list ./... | grep -v /vendor/) - -all: cgutil - go build -v - -cgutil: - cd cmd/cgctl && go build -v - -proto: - protobuild --quiet ${PACKAGES} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/Protobuild.toml b/cluster-autoscaler/vendor/github.com/containerd/cgroups/Protobuild.toml deleted file mode 100644 index 1c4c802fe12b..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/Protobuild.toml +++ /dev/null @@ -1,46 +0,0 @@ -version = "unstable" -generator = "gogoctrd" -plugins = ["grpc"] - -# Control protoc include paths. Below are usually some good defaults, but feel -# free to try it without them if it works for your project. -[includes] - # Include paths that will be added before all others. Typically, you want to - # treat the root of the project as an include, but this may not be necessary. - # before = ["."] - - # Paths that should be treated as include roots in relation to the vendor - # directory. These will be calculated with the vendor directory nearest the - # target package. - # vendored = ["github.com/gogo/protobuf"] - packages = ["github.com/gogo/protobuf"] - - # Paths that will be added untouched to the end of the includes. We use - # `/usr/local/include` to pickup the common install location of protobuf. - # This is the default. - after = ["/usr/local/include", "/usr/include"] - -# This section maps protobuf imports to Go packages. These will become -# `-M` directives in the call to the go protobuf generator. -[packages] - "gogoproto/gogo.proto" = "github.com/gogo/protobuf/gogoproto" - "google/protobuf/any.proto" = "github.com/gogo/protobuf/types" - "google/protobuf/descriptor.proto" = "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" - "google/protobuf/field_mask.proto" = "github.com/gogo/protobuf/types" - "google/protobuf/timestamp.proto" = "github.com/gogo/protobuf/types" - -# Aggregrate the API descriptors to lock down API changes. -[[descriptors]] -prefix = "github.com/containerd/cgroups/stats/v1" -target = "stats/v1/metrics.pb.txt" -ignore_files = [ - "google/protobuf/descriptor.proto", - "gogoproto/gogo.proto" -] -[[descriptors]] -prefix = "github.com/containerd/cgroups/v2/stats" -target = "v2/stats/metrics.pb.txt" -ignore_files = [ - "google/protobuf/descriptor.proto", - "gogoproto/gogo.proto" -] diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/README.md b/cluster-autoscaler/vendor/github.com/containerd/cgroups/README.md deleted file mode 100644 index d2073af3abc8..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# cgroups - -[![Build Status](https://github.com/containerd/cgroups/workflows/CI/badge.svg)](https://github.com/containerd/cgroups/actions?query=workflow%3ACI) -[![codecov](https://codecov.io/gh/containerd/cgroups/branch/main/graph/badge.svg)](https://codecov.io/gh/containerd/cgroups) -[![GoDoc](https://godoc.org/github.com/containerd/cgroups?status.svg)](https://godoc.org/github.com/containerd/cgroups) -[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/cgroups)](https://goreportcard.com/report/github.com/containerd/cgroups) - -Go package for creating, managing, inspecting, and destroying cgroups. -The resources format for settings on the cgroup uses the OCI runtime-spec found -[here](https://github.com/opencontainers/runtime-spec). - -## Examples (v1) - -### Create a new cgroup - -This creates a new cgroup using a static path for all subsystems under `/test`. - -* /sys/fs/cgroup/cpu/test -* /sys/fs/cgroup/memory/test -* etc.... - -It uses a single hierarchy and specifies cpu shares as a resource constraint and -uses the v1 implementation of cgroups. - - -```go -shares := uint64(100) -control, err := cgroups.New(cgroups.V1, cgroups.StaticPath("/test"), &specs.LinuxResources{ - CPU: &specs.LinuxCPU{ - Shares: &shares, - }, -}) -defer control.Delete() -``` - -### Create with systemd slice support - - -```go -control, err := cgroups.New(cgroups.Systemd, cgroups.Slice("system.slice", "runc-test"), &specs.LinuxResources{ - CPU: &specs.CPU{ - Shares: &shares, - }, -}) - -``` - -### Load an existing cgroup - -```go -control, err = cgroups.Load(cgroups.V1, cgroups.StaticPath("/test")) -``` - -### Add a process to the cgroup - -```go -if err := control.Add(cgroups.Process{Pid:1234}); err != nil { -} -``` - -### Update the cgroup - -To update the resources applied in the cgroup - -```go -shares = uint64(200) -if err := control.Update(&specs.LinuxResources{ - CPU: &specs.LinuxCPU{ - Shares: &shares, - }, -}); err != nil { -} -``` - -### Freeze and Thaw the cgroup - -```go -if err := control.Freeze(); err != nil { -} -if err := control.Thaw(); err != nil { -} -``` - -### List all processes in the cgroup or recursively - -```go -processes, err := control.Processes(cgroups.Devices, recursive) -``` - -### Get Stats on the cgroup - -```go -stats, err := control.Stat() -``` - -By adding `cgroups.IgnoreNotExist` all non-existent files will be ignored, e.g. swap memory stats without swap enabled -```go -stats, err := control.Stat(cgroups.IgnoreNotExist) -``` - -### Move process across cgroups - -This allows you to take processes from one cgroup and move them to another. - -```go -err := control.MoveTo(destination) -``` - -### Create subcgroup - -```go -subCgroup, err := control.New("child", resources) -``` - -### Registering for memory events - -This allows you to get notified by an eventfd for v1 memory cgroups events. - -```go -event := cgroups.MemoryThresholdEvent(50 * 1024 * 1024, false) -efd, err := control.RegisterMemoryEvent(event) -``` - -```go -event := cgroups.MemoryPressureEvent(cgroups.MediumPressure, cgroups.DefaultMode) -efd, err := control.RegisterMemoryEvent(event) -``` - -```go -efd, err := control.OOMEventFD() -// or by using RegisterMemoryEvent -event := cgroups.OOMEvent() -efd, err := control.RegisterMemoryEvent(event) -``` - -## Examples (v2/unified) - -### Check that the current system is running cgroups v2 - -```go -var cgroupV2 bool -if cgroups.Mode() == cgroups.Unified { - cgroupV2 = true -} -``` - -### Create a new cgroup - -This creates a new systemd v2 cgroup slice. Systemd slices consider ["-" a special character](https://www.freedesktop.org/software/systemd/man/systemd.slice.html), -so the resulting slice would be located here on disk: - -* /sys/fs/cgroup/my.slice/my-cgroup.slice/my-cgroup-abc.slice - -```go -import ( - cgroupsv2 "github.com/containerd/cgroups/v2" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -res := cgroupsv2.Resources{} -// dummy PID of -1 is used for creating a "general slice" to be used as a parent cgroup. -// see https://github.com/containerd/cgroups/blob/1df78138f1e1e6ee593db155c6b369466f577651/v2/manager.go#L732-L735 -m, err := cgroupsv2.NewSystemd("/", "my-cgroup-abc.slice", -1, &res) -if err != nil { - return err -} -``` - -### Load an existing cgroup - -```go -m, err := cgroupsv2.LoadSystemd("/", "my-cgroup-abc.slice") -if err != nil { - return err -} -``` - -### Delete a cgroup - -```go -m, err := cgroupsv2.LoadSystemd("/", "my-cgroup-abc.slice") -if err != nil { - return err -} -err = m.DeleteSystemd() -if err != nil { - return err -} -``` - -### Attention - -All static path should not include `/sys/fs/cgroup/` prefix, it should start with your own cgroups name - -## Project details - -Cgroups is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). -As a containerd sub-project, you will find the: - - * [Project governance](https://github.com/containerd/project/blob/main/GOVERNANCE.md), - * [Maintainers](https://github.com/containerd/project/blob/main/MAINTAINERS), - * and [Contributing guidelines](https://github.com/containerd/project/blob/main/CONTRIBUTING.md) - -information in our [`containerd/project`](https://github.com/containerd/project) repository. diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/blkio.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/blkio.go deleted file mode 100644 index f59c75bb5d1f..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/blkio.go +++ /dev/null @@ -1,361 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "bufio" - "fmt" - "io" - "os" - "path/filepath" - "strconv" - "strings" - - v1 "github.com/containerd/cgroups/stats/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -// NewBlkio returns a Blkio controller given the root folder of cgroups. -// It may optionally accept other configuration options, such as ProcRoot(path) -func NewBlkio(root string, options ...func(controller *blkioController)) *blkioController { - ctrl := &blkioController{ - root: filepath.Join(root, string(Blkio)), - procRoot: "/proc", - } - for _, opt := range options { - opt(ctrl) - } - return ctrl -} - -// ProcRoot overrides the default location of the "/proc" filesystem -func ProcRoot(path string) func(controller *blkioController) { - return func(c *blkioController) { - c.procRoot = path - } -} - -type blkioController struct { - root string - procRoot string -} - -func (b *blkioController) Name() Name { - return Blkio -} - -func (b *blkioController) Path(path string) string { - return filepath.Join(b.root, path) -} - -func (b *blkioController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(b.Path(path), defaultDirPerm); err != nil { - return err - } - if resources.BlockIO == nil { - return nil - } - for _, t := range createBlkioSettings(resources.BlockIO) { - if t.value != nil { - if err := retryingWriteFile( - filepath.Join(b.Path(path), "blkio."+t.name), - t.format(t.value), - defaultFilePerm, - ); err != nil { - return err - } - } - } - return nil -} - -func (b *blkioController) Update(path string, resources *specs.LinuxResources) error { - return b.Create(path, resources) -} - -func (b *blkioController) Stat(path string, stats *v1.Metrics) error { - stats.Blkio = &v1.BlkIOStat{} - - var settings []blkioStatSettings - - // Try to read CFQ stats available on all CFQ enabled kernels first - if _, err := os.Lstat(filepath.Join(b.Path(path), "blkio.io_serviced_recursive")); err == nil { - settings = []blkioStatSettings{ - { - name: "sectors_recursive", - entry: &stats.Blkio.SectorsRecursive, - }, - { - name: "io_service_bytes_recursive", - entry: &stats.Blkio.IoServiceBytesRecursive, - }, - { - name: "io_serviced_recursive", - entry: &stats.Blkio.IoServicedRecursive, - }, - { - name: "io_queued_recursive", - entry: &stats.Blkio.IoQueuedRecursive, - }, - { - name: "io_service_time_recursive", - entry: &stats.Blkio.IoServiceTimeRecursive, - }, - { - name: "io_wait_time_recursive", - entry: &stats.Blkio.IoWaitTimeRecursive, - }, - { - name: "io_merged_recursive", - entry: &stats.Blkio.IoMergedRecursive, - }, - { - name: "time_recursive", - entry: &stats.Blkio.IoTimeRecursive, - }, - } - } - - f, err := os.Open(filepath.Join(b.procRoot, "partitions")) - if err != nil { - return err - } - defer f.Close() - - devices, err := getDevices(f) - if err != nil { - return err - } - - var size int - for _, t := range settings { - if err := b.readEntry(devices, path, t.name, t.entry); err != nil { - return err - } - size += len(*t.entry) - } - if size > 0 { - return nil - } - - // Even the kernel is compiled with the CFQ scheduler, the cgroup may not use - // block devices with the CFQ scheduler. If so, we should fallback to throttle.* files. - settings = []blkioStatSettings{ - { - name: "throttle.io_serviced", - entry: &stats.Blkio.IoServicedRecursive, - }, - { - name: "throttle.io_service_bytes", - entry: &stats.Blkio.IoServiceBytesRecursive, - }, - } - for _, t := range settings { - if err := b.readEntry(devices, path, t.name, t.entry); err != nil { - return err - } - } - return nil -} - -func (b *blkioController) readEntry(devices map[deviceKey]string, path, name string, entry *[]*v1.BlkIOEntry) error { - f, err := os.Open(filepath.Join(b.Path(path), "blkio."+name)) - if err != nil { - return err - } - defer f.Close() - sc := bufio.NewScanner(f) - for sc.Scan() { - // format: dev type amount - fields := strings.FieldsFunc(sc.Text(), splitBlkIOStatLine) - if len(fields) < 3 { - if len(fields) == 2 && fields[0] == "Total" { - // skip total line - continue - } else { - return fmt.Errorf("invalid line found while parsing %s: %s", path, sc.Text()) - } - } - major, err := strconv.ParseUint(fields[0], 10, 64) - if err != nil { - return err - } - minor, err := strconv.ParseUint(fields[1], 10, 64) - if err != nil { - return err - } - op := "" - valueField := 2 - if len(fields) == 4 { - op = fields[2] - valueField = 3 - } - v, err := strconv.ParseUint(fields[valueField], 10, 64) - if err != nil { - return err - } - *entry = append(*entry, &v1.BlkIOEntry{ - Device: devices[deviceKey{major, minor}], - Major: major, - Minor: minor, - Op: op, - Value: v, - }) - } - return sc.Err() -} - -func createBlkioSettings(blkio *specs.LinuxBlockIO) []blkioSettings { - settings := []blkioSettings{} - - if blkio.Weight != nil { - settings = append(settings, - blkioSettings{ - name: "weight", - value: blkio.Weight, - format: uintf, - }) - } - if blkio.LeafWeight != nil { - settings = append(settings, - blkioSettings{ - name: "leaf_weight", - value: blkio.LeafWeight, - format: uintf, - }) - } - for _, wd := range blkio.WeightDevice { - if wd.Weight != nil { - settings = append(settings, - blkioSettings{ - name: "weight_device", - value: wd, - format: weightdev, - }) - } - if wd.LeafWeight != nil { - settings = append(settings, - blkioSettings{ - name: "leaf_weight_device", - value: wd, - format: weightleafdev, - }) - } - } - for _, t := range []struct { - name string - list []specs.LinuxThrottleDevice - }{ - { - name: "throttle.read_bps_device", - list: blkio.ThrottleReadBpsDevice, - }, - { - name: "throttle.read_iops_device", - list: blkio.ThrottleReadIOPSDevice, - }, - { - name: "throttle.write_bps_device", - list: blkio.ThrottleWriteBpsDevice, - }, - { - name: "throttle.write_iops_device", - list: blkio.ThrottleWriteIOPSDevice, - }, - } { - for _, td := range t.list { - settings = append(settings, blkioSettings{ - name: t.name, - value: td, - format: throttleddev, - }) - } - } - return settings -} - -type blkioSettings struct { - name string - value interface{} - format func(v interface{}) []byte -} - -type blkioStatSettings struct { - name string - entry *[]*v1.BlkIOEntry -} - -func uintf(v interface{}) []byte { - return []byte(strconv.FormatUint(uint64(*v.(*uint16)), 10)) -} - -func weightdev(v interface{}) []byte { - wd := v.(specs.LinuxWeightDevice) - return []byte(fmt.Sprintf("%d:%d %d", wd.Major, wd.Minor, *wd.Weight)) -} - -func weightleafdev(v interface{}) []byte { - wd := v.(specs.LinuxWeightDevice) - return []byte(fmt.Sprintf("%d:%d %d", wd.Major, wd.Minor, *wd.LeafWeight)) -} - -func throttleddev(v interface{}) []byte { - td := v.(specs.LinuxThrottleDevice) - return []byte(fmt.Sprintf("%d:%d %d", td.Major, td.Minor, td.Rate)) -} - -func splitBlkIOStatLine(r rune) bool { - return r == ' ' || r == ':' -} - -type deviceKey struct { - major, minor uint64 -} - -// getDevices makes a best effort attempt to read all the devices into a map -// keyed by major and minor number. Since devices may be mapped multiple times, -// we err on taking the first occurrence. -func getDevices(r io.Reader) (map[deviceKey]string, error) { - - var ( - s = bufio.NewScanner(r) - devices = make(map[deviceKey]string) - ) - for i := 0; s.Scan(); i++ { - if i < 2 { - continue - } - fields := strings.Fields(s.Text()) - major, err := strconv.Atoi(fields[0]) - if err != nil { - return nil, err - } - minor, err := strconv.Atoi(fields[1]) - if err != nil { - return nil, err - } - key := deviceKey{ - major: uint64(major), - minor: uint64(minor), - } - if _, ok := devices[key]; ok { - continue - } - devices[key] = filepath.Join("/dev", fields[3]) - } - return devices, s.Err() -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/cgroup.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/cgroup.go deleted file mode 100644 index c0eac5bf19d1..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/cgroup.go +++ /dev/null @@ -1,543 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "strconv" - "strings" - "sync" - - v1 "github.com/containerd/cgroups/stats/v1" - - "github.com/opencontainers/runtime-spec/specs-go" -) - -// New returns a new control via the cgroup cgroups interface -func New(hierarchy Hierarchy, path Path, resources *specs.LinuxResources, opts ...InitOpts) (Cgroup, error) { - config := newInitConfig() - for _, o := range opts { - if err := o(config); err != nil { - return nil, err - } - } - subsystems, err := hierarchy() - if err != nil { - return nil, err - } - var active []Subsystem - for _, s := range subsystems { - // check if subsystem exists - if err := initializeSubsystem(s, path, resources); err != nil { - if err == ErrControllerNotActive { - if config.InitCheck != nil { - if skerr := config.InitCheck(s, path, err); skerr != nil { - if skerr != ErrIgnoreSubsystem { - return nil, skerr - } - } - } - continue - } - return nil, err - } - active = append(active, s) - } - return &cgroup{ - path: path, - subsystems: active, - }, nil -} - -// Load will load an existing cgroup and allow it to be controlled -// All static path should not include `/sys/fs/cgroup/` prefix, it should start with your own cgroups name -func Load(hierarchy Hierarchy, path Path, opts ...InitOpts) (Cgroup, error) { - config := newInitConfig() - for _, o := range opts { - if err := o(config); err != nil { - return nil, err - } - } - var activeSubsystems []Subsystem - subsystems, err := hierarchy() - if err != nil { - return nil, err - } - // check that the subsystems still exist, and keep only those that actually exist - for _, s := range pathers(subsystems) { - p, err := path(s.Name()) - if err != nil { - if errors.Is(err, os.ErrNotExist) { - return nil, ErrCgroupDeleted - } - if err == ErrControllerNotActive { - if config.InitCheck != nil { - if skerr := config.InitCheck(s, path, err); skerr != nil { - if skerr != ErrIgnoreSubsystem { - return nil, skerr - } - } - } - continue - } - return nil, err - } - if _, err := os.Lstat(s.Path(p)); err != nil { - if os.IsNotExist(err) { - continue - } - return nil, err - } - activeSubsystems = append(activeSubsystems, s) - } - // if we do not have any active systems then the cgroup is deleted - if len(activeSubsystems) == 0 { - return nil, ErrCgroupDeleted - } - return &cgroup{ - path: path, - subsystems: activeSubsystems, - }, nil -} - -type cgroup struct { - path Path - - subsystems []Subsystem - mu sync.Mutex - err error -} - -// New returns a new sub cgroup -func (c *cgroup) New(name string, resources *specs.LinuxResources) (Cgroup, error) { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return nil, c.err - } - path := subPath(c.path, name) - for _, s := range c.subsystems { - if err := initializeSubsystem(s, path, resources); err != nil { - return nil, err - } - } - return &cgroup{ - path: path, - subsystems: c.subsystems, - }, nil -} - -// Subsystems returns all the subsystems that are currently being -// consumed by the group -func (c *cgroup) Subsystems() []Subsystem { - return c.subsystems -} - -func (c *cgroup) subsystemsFilter(subsystems ...Name) []Subsystem { - if len(subsystems) == 0 { - return c.subsystems - } - - var filteredSubsystems = []Subsystem{} - for _, s := range c.subsystems { - for _, f := range subsystems { - if s.Name() == f { - filteredSubsystems = append(filteredSubsystems, s) - break - } - } - } - - return filteredSubsystems -} - -// Add moves the provided process into the new cgroup. -// Without additional arguments, the process is added to all the cgroup subsystems. -// When giving Add a list of subsystem names, the process is only added to those -// subsystems, provided that they are active in the targeted cgroup. -func (c *cgroup) Add(process Process, subsystems ...Name) error { - return c.add(process, cgroupProcs, subsystems...) -} - -// AddProc moves the provided process id into the new cgroup. -// Without additional arguments, the process with the given id is added to all -// the cgroup subsystems. When giving AddProc a list of subsystem names, the process -// id is only added to those subsystems, provided that they are active in the targeted -// cgroup. -func (c *cgroup) AddProc(pid uint64, subsystems ...Name) error { - return c.add(Process{Pid: int(pid)}, cgroupProcs, subsystems...) -} - -// AddTask moves the provided tasks (threads) into the new cgroup. -// Without additional arguments, the task is added to all the cgroup subsystems. -// When giving AddTask a list of subsystem names, the task is only added to those -// subsystems, provided that they are active in the targeted cgroup. -func (c *cgroup) AddTask(process Process, subsystems ...Name) error { - return c.add(process, cgroupTasks, subsystems...) -} - -func (c *cgroup) add(process Process, pType procType, subsystems ...Name) error { - if process.Pid <= 0 { - return ErrInvalidPid - } - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return c.err - } - for _, s := range pathers(c.subsystemsFilter(subsystems...)) { - p, err := c.path(s.Name()) - if err != nil { - return err - } - err = retryingWriteFile( - filepath.Join(s.Path(p), pType), - []byte(strconv.Itoa(process.Pid)), - defaultFilePerm, - ) - if err != nil { - return err - } - } - return nil -} - -// Delete will remove the control group from each of the subsystems registered -func (c *cgroup) Delete() error { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return c.err - } - var errs []string - for _, s := range c.subsystems { - // kernel prevents cgroups with running process from being removed, check the tree is empty - procs, err := c.processes(s.Name(), true, cgroupProcs) - if err != nil { - return err - } - if len(procs) > 0 { - errs = append(errs, fmt.Sprintf("%s (contains running processes)", string(s.Name()))) - continue - } - if d, ok := s.(deleter); ok { - sp, err := c.path(s.Name()) - if err != nil { - return err - } - if err := d.Delete(sp); err != nil { - errs = append(errs, string(s.Name())) - } - continue - } - if p, ok := s.(pather); ok { - sp, err := c.path(s.Name()) - if err != nil { - return err - } - path := p.Path(sp) - if err := remove(path); err != nil { - errs = append(errs, path) - } - continue - } - } - if len(errs) > 0 { - return fmt.Errorf("cgroups: unable to remove paths %s", strings.Join(errs, ", ")) - } - c.err = ErrCgroupDeleted - return nil -} - -// Stat returns the current metrics for the cgroup -func (c *cgroup) Stat(handlers ...ErrorHandler) (*v1.Metrics, error) { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return nil, c.err - } - if len(handlers) == 0 { - handlers = append(handlers, errPassthrough) - } - var ( - stats = &v1.Metrics{ - CPU: &v1.CPUStat{ - Throttling: &v1.Throttle{}, - Usage: &v1.CPUUsage{}, - }, - } - wg = &sync.WaitGroup{} - errs = make(chan error, len(c.subsystems)) - ) - for _, s := range c.subsystems { - if ss, ok := s.(stater); ok { - sp, err := c.path(s.Name()) - if err != nil { - return nil, err - } - wg.Add(1) - go func() { - defer wg.Done() - if err := ss.Stat(sp, stats); err != nil { - for _, eh := range handlers { - if herr := eh(err); herr != nil { - errs <- herr - } - } - } - }() - } - } - wg.Wait() - close(errs) - for err := range errs { - return nil, err - } - return stats, nil -} - -// Update updates the cgroup with the new resource values provided -// -// Be prepared to handle EBUSY when trying to update a cgroup with -// live processes and other operations like Stats being performed at the -// same time -func (c *cgroup) Update(resources *specs.LinuxResources) error { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return c.err - } - for _, s := range c.subsystems { - if u, ok := s.(updater); ok { - sp, err := c.path(s.Name()) - if err != nil { - return err - } - if err := u.Update(sp, resources); err != nil { - return err - } - } - } - return nil -} - -// Processes returns the processes running inside the cgroup along -// with the subsystem used, pid, and path -func (c *cgroup) Processes(subsystem Name, recursive bool) ([]Process, error) { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return nil, c.err - } - return c.processes(subsystem, recursive, cgroupProcs) -} - -// Tasks returns the tasks running inside the cgroup along -// with the subsystem used, pid, and path -func (c *cgroup) Tasks(subsystem Name, recursive bool) ([]Task, error) { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return nil, c.err - } - return c.processes(subsystem, recursive, cgroupTasks) -} - -func (c *cgroup) processes(subsystem Name, recursive bool, pType procType) ([]Process, error) { - s := c.getSubsystem(subsystem) - sp, err := c.path(subsystem) - if err != nil { - return nil, err - } - if s == nil { - return nil, fmt.Errorf("cgroups: %s doesn't exist in %s subsystem", sp, subsystem) - } - path := s.(pather).Path(sp) - var processes []Process - err = filepath.Walk(path, func(p string, info os.FileInfo, err error) error { - if err != nil { - return err - } - if !recursive && info.IsDir() { - if p == path { - return nil - } - return filepath.SkipDir - } - dir, name := filepath.Split(p) - if name != pType { - return nil - } - procs, err := readPids(dir, subsystem, pType) - if err != nil { - return err - } - processes = append(processes, procs...) - return nil - }) - return processes, err -} - -// Freeze freezes the entire cgroup and all the processes inside it -func (c *cgroup) Freeze() error { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return c.err - } - s := c.getSubsystem(Freezer) - if s == nil { - return ErrFreezerNotSupported - } - sp, err := c.path(Freezer) - if err != nil { - return err - } - return s.(*freezerController).Freeze(sp) -} - -// Thaw thaws out the cgroup and all the processes inside it -func (c *cgroup) Thaw() error { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return c.err - } - s := c.getSubsystem(Freezer) - if s == nil { - return ErrFreezerNotSupported - } - sp, err := c.path(Freezer) - if err != nil { - return err - } - return s.(*freezerController).Thaw(sp) -} - -// OOMEventFD returns the memory cgroup's out of memory event fd that triggers -// when processes inside the cgroup receive an oom event. Returns -// ErrMemoryNotSupported if memory cgroups is not supported. -func (c *cgroup) OOMEventFD() (uintptr, error) { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return 0, c.err - } - s := c.getSubsystem(Memory) - if s == nil { - return 0, ErrMemoryNotSupported - } - sp, err := c.path(Memory) - if err != nil { - return 0, err - } - return s.(*memoryController).memoryEvent(sp, OOMEvent()) -} - -// RegisterMemoryEvent allows the ability to register for all v1 memory cgroups -// notifications. -func (c *cgroup) RegisterMemoryEvent(event MemoryEvent) (uintptr, error) { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return 0, c.err - } - s := c.getSubsystem(Memory) - if s == nil { - return 0, ErrMemoryNotSupported - } - sp, err := c.path(Memory) - if err != nil { - return 0, err - } - return s.(*memoryController).memoryEvent(sp, event) -} - -// State returns the state of the cgroup and its processes -func (c *cgroup) State() State { - c.mu.Lock() - defer c.mu.Unlock() - c.checkExists() - if c.err != nil && c.err == ErrCgroupDeleted { - return Deleted - } - s := c.getSubsystem(Freezer) - if s == nil { - return Thawed - } - sp, err := c.path(Freezer) - if err != nil { - return Unknown - } - state, err := s.(*freezerController).state(sp) - if err != nil { - return Unknown - } - return state -} - -// MoveTo does a recursive move subsystem by subsystem of all the processes -// inside the group -func (c *cgroup) MoveTo(destination Cgroup) error { - c.mu.Lock() - defer c.mu.Unlock() - if c.err != nil { - return c.err - } - for _, s := range c.subsystems { - processes, err := c.processes(s.Name(), true, cgroupProcs) - if err != nil { - return err - } - for _, p := range processes { - if err := destination.Add(p); err != nil { - if strings.Contains(err.Error(), "no such process") { - continue - } - return err - } - } - } - return nil -} - -func (c *cgroup) getSubsystem(n Name) Subsystem { - for _, s := range c.subsystems { - if s.Name() == n { - return s - } - } - return nil -} - -func (c *cgroup) checkExists() { - for _, s := range pathers(c.subsystems) { - p, err := c.path(s.Name()) - if err != nil { - return - } - if _, err := os.Lstat(s.Path(p)); err != nil { - if os.IsNotExist(err) { - c.err = ErrCgroupDeleted - return - } - } - } -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/control.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/control.go deleted file mode 100644 index 5fcaac6d0566..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/control.go +++ /dev/null @@ -1,99 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "os" - - v1 "github.com/containerd/cgroups/stats/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -type procType = string - -const ( - cgroupProcs procType = "cgroup.procs" - cgroupTasks procType = "tasks" - defaultDirPerm = 0755 -) - -// defaultFilePerm is a var so that the test framework can change the filemode -// of all files created when the tests are running. The difference between the -// tests and real world use is that files like "cgroup.procs" will exist when writing -// to a read cgroup filesystem and do not exist prior when running in the tests. -// this is set to a non 0 value in the test code -var defaultFilePerm = os.FileMode(0) - -type Process struct { - // Subsystem is the name of the subsystem that the process / task is in. - Subsystem Name - // Pid is the process id of the process / task. - Pid int - // Path is the full path of the subsystem and location that the process / task is in. - Path string -} - -type Task = Process - -// Cgroup handles interactions with the individual groups to perform -// actions on them as them main interface to this cgroup package -type Cgroup interface { - // New creates a new cgroup under the calling cgroup - New(string, *specs.LinuxResources) (Cgroup, error) - // Add adds a process to the cgroup (cgroup.procs). Without additional arguments, - // the process is added to all the cgroup subsystems. When giving Add a list of - // subsystem names, the process is only added to those subsystems, provided that - // they are active in the targeted cgroup. - Add(Process, ...Name) error - // AddProc adds the process with the given id to the cgroup (cgroup.procs). - // Without additional arguments, the process with the given id is added to all - // the cgroup subsystems. When giving AddProc a list of subsystem names, the process - // id is only added to those subsystems, provided that they are active in the targeted - // cgroup. - AddProc(uint64, ...Name) error - // AddTask adds a process to the cgroup (tasks). Without additional arguments, the - // task is added to all the cgroup subsystems. When giving AddTask a list of subsystem - // names, the task is only added to those subsystems, provided that they are active in - // the targeted cgroup. - AddTask(Process, ...Name) error - // Delete removes the cgroup as a whole - Delete() error - // MoveTo moves all the processes under the calling cgroup to the provided one - // subsystems are moved one at a time - MoveTo(Cgroup) error - // Stat returns the stats for all subsystems in the cgroup - Stat(...ErrorHandler) (*v1.Metrics, error) - // Update updates all the subsystems with the provided resource changes - Update(resources *specs.LinuxResources) error - // Processes returns all the processes in a select subsystem for the cgroup - Processes(Name, bool) ([]Process, error) - // Tasks returns all the tasks in a select subsystem for the cgroup - Tasks(Name, bool) ([]Task, error) - // Freeze freezes or pauses all processes inside the cgroup - Freeze() error - // Thaw thaw or resumes all processes inside the cgroup - Thaw() error - // OOMEventFD returns the memory subsystem's event fd for OOM events - OOMEventFD() (uintptr, error) - // RegisterMemoryEvent returns the memory subsystems event fd for whatever memory event was - // registered for. Can alternatively register for the oom event with this method. - RegisterMemoryEvent(MemoryEvent) (uintptr, error) - // State returns the cgroups current state - State() State - // Subsystems returns all the subsystems in the cgroup - Subsystems() []Subsystem -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpu.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpu.go deleted file mode 100644 index 27024f17b826..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpu.go +++ /dev/null @@ -1,125 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "bufio" - "os" - "path/filepath" - "strconv" - - v1 "github.com/containerd/cgroups/stats/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -func NewCpu(root string) *cpuController { - return &cpuController{ - root: filepath.Join(root, string(Cpu)), - } -} - -type cpuController struct { - root string -} - -func (c *cpuController) Name() Name { - return Cpu -} - -func (c *cpuController) Path(path string) string { - return filepath.Join(c.root, path) -} - -func (c *cpuController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(c.Path(path), defaultDirPerm); err != nil { - return err - } - if cpu := resources.CPU; cpu != nil { - for _, t := range []struct { - name string - ivalue *int64 - uvalue *uint64 - }{ - { - name: "rt_period_us", - uvalue: cpu.RealtimePeriod, - }, - { - name: "rt_runtime_us", - ivalue: cpu.RealtimeRuntime, - }, - { - name: "shares", - uvalue: cpu.Shares, - }, - { - name: "cfs_period_us", - uvalue: cpu.Period, - }, - { - name: "cfs_quota_us", - ivalue: cpu.Quota, - }, - } { - var value []byte - if t.uvalue != nil { - value = []byte(strconv.FormatUint(*t.uvalue, 10)) - } else if t.ivalue != nil { - value = []byte(strconv.FormatInt(*t.ivalue, 10)) - } - if value != nil { - if err := retryingWriteFile( - filepath.Join(c.Path(path), "cpu."+t.name), - value, - defaultFilePerm, - ); err != nil { - return err - } - } - } - } - return nil -} - -func (c *cpuController) Update(path string, resources *specs.LinuxResources) error { - return c.Create(path, resources) -} - -func (c *cpuController) Stat(path string, stats *v1.Metrics) error { - f, err := os.Open(filepath.Join(c.Path(path), "cpu.stat")) - if err != nil { - return err - } - defer f.Close() - // get or create the cpu field because cpuacct can also set values on this struct - sc := bufio.NewScanner(f) - for sc.Scan() { - key, v, err := parseKV(sc.Text()) - if err != nil { - return err - } - switch key { - case "nr_periods": - stats.CPU.Throttling.Periods = v - case "nr_throttled": - stats.CPU.Throttling.ThrottledPeriods = v - case "throttled_time": - stats.CPU.Throttling.ThrottledTime = v - } - } - return sc.Err() -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpuacct.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpuacct.go deleted file mode 100644 index 1022fa379b59..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpuacct.go +++ /dev/null @@ -1,129 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "bufio" - "fmt" - "os" - "path/filepath" - "strconv" - "strings" - - v1 "github.com/containerd/cgroups/stats/v1" -) - -const nanosecondsInSecond = 1000000000 - -var clockTicks = getClockTicks() - -func NewCpuacct(root string) *cpuacctController { - return &cpuacctController{ - root: filepath.Join(root, string(Cpuacct)), - } -} - -type cpuacctController struct { - root string -} - -func (c *cpuacctController) Name() Name { - return Cpuacct -} - -func (c *cpuacctController) Path(path string) string { - return filepath.Join(c.root, path) -} - -func (c *cpuacctController) Stat(path string, stats *v1.Metrics) error { - user, kernel, err := c.getUsage(path) - if err != nil { - return err - } - total, err := readUint(filepath.Join(c.Path(path), "cpuacct.usage")) - if err != nil { - return err - } - percpu, err := c.percpuUsage(path) - if err != nil { - return err - } - stats.CPU.Usage.Total = total - stats.CPU.Usage.User = user - stats.CPU.Usage.Kernel = kernel - stats.CPU.Usage.PerCPU = percpu - return nil -} - -func (c *cpuacctController) percpuUsage(path string) ([]uint64, error) { - var usage []uint64 - data, err := os.ReadFile(filepath.Join(c.Path(path), "cpuacct.usage_percpu")) - if err != nil { - return nil, err - } - for _, v := range strings.Fields(string(data)) { - u, err := strconv.ParseUint(v, 10, 64) - if err != nil { - return nil, err - } - usage = append(usage, u) - } - return usage, nil -} - -func (c *cpuacctController) getUsage(path string) (user uint64, kernel uint64, err error) { - statPath := filepath.Join(c.Path(path), "cpuacct.stat") - f, err := os.Open(statPath) - if err != nil { - return 0, 0, err - } - defer f.Close() - var ( - raw = make(map[string]uint64) - sc = bufio.NewScanner(f) - ) - for sc.Scan() { - key, v, err := parseKV(sc.Text()) - if err != nil { - return 0, 0, err - } - raw[key] = v - } - if err := sc.Err(); err != nil { - return 0, 0, err - } - for _, t := range []struct { - name string - value *uint64 - }{ - { - name: "user", - value: &user, - }, - { - name: "system", - value: &kernel, - }, - } { - v, ok := raw[t.name] - if !ok { - return 0, 0, fmt.Errorf("expected field %q but not found in %q", t.name, statPath) - } - *t.value = v - } - return (user * nanosecondsInSecond) / clockTicks, (kernel * nanosecondsInSecond) / clockTicks, nil -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpuset.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpuset.go deleted file mode 100644 index 8b56d3dbaa00..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/cpuset.go +++ /dev/null @@ -1,158 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "bytes" - "fmt" - "os" - "path/filepath" - - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -func NewCpuset(root string) *cpusetController { - return &cpusetController{ - root: filepath.Join(root, string(Cpuset)), - } -} - -type cpusetController struct { - root string -} - -func (c *cpusetController) Name() Name { - return Cpuset -} - -func (c *cpusetController) Path(path string) string { - return filepath.Join(c.root, path) -} - -func (c *cpusetController) Create(path string, resources *specs.LinuxResources) error { - if err := c.ensureParent(c.Path(path), c.root); err != nil { - return err - } - if err := os.MkdirAll(c.Path(path), defaultDirPerm); err != nil { - return err - } - if err := c.copyIfNeeded(c.Path(path), filepath.Dir(c.Path(path))); err != nil { - return err - } - if resources.CPU != nil { - for _, t := range []struct { - name string - value string - }{ - { - name: "cpus", - value: resources.CPU.Cpus, - }, - { - name: "mems", - value: resources.CPU.Mems, - }, - } { - if t.value != "" { - if err := retryingWriteFile( - filepath.Join(c.Path(path), "cpuset."+t.name), - []byte(t.value), - defaultFilePerm, - ); err != nil { - return err - } - } - } - } - return nil -} - -func (c *cpusetController) Update(path string, resources *specs.LinuxResources) error { - return c.Create(path, resources) -} - -func (c *cpusetController) getValues(path string) (cpus []byte, mems []byte, err error) { - if cpus, err = os.ReadFile(filepath.Join(path, "cpuset.cpus")); err != nil && !os.IsNotExist(err) { - return - } - if mems, err = os.ReadFile(filepath.Join(path, "cpuset.mems")); err != nil && !os.IsNotExist(err) { - return - } - return cpus, mems, nil -} - -// ensureParent makes sure that the parent directory of current is created -// and populated with the proper cpus and mems files copied from -// it's parent. -func (c *cpusetController) ensureParent(current, root string) error { - parent := filepath.Dir(current) - if _, err := filepath.Rel(root, parent); err != nil { - return nil - } - // Avoid infinite recursion. - if parent == current { - return fmt.Errorf("cpuset: cgroup parent path outside cgroup root") - } - if cleanPath(parent) != root { - if err := c.ensureParent(parent, root); err != nil { - return err - } - } - if err := os.MkdirAll(current, defaultDirPerm); err != nil { - return err - } - return c.copyIfNeeded(current, parent) -} - -// copyIfNeeded copies the cpuset.cpus and cpuset.mems from the parent -// directory to the current directory if the file's contents are 0 -func (c *cpusetController) copyIfNeeded(current, parent string) error { - var ( - err error - currentCpus, currentMems []byte - parentCpus, parentMems []byte - ) - if currentCpus, currentMems, err = c.getValues(current); err != nil { - return err - } - if parentCpus, parentMems, err = c.getValues(parent); err != nil { - return err - } - if isEmpty(currentCpus) { - if err := retryingWriteFile( - filepath.Join(current, "cpuset.cpus"), - parentCpus, - defaultFilePerm, - ); err != nil { - return err - } - } - if isEmpty(currentMems) { - if err := retryingWriteFile( - filepath.Join(current, "cpuset.mems"), - parentMems, - defaultFilePerm, - ); err != nil { - return err - } - } - return nil -} - -func isEmpty(b []byte) bool { - return len(bytes.Trim(b, "\n")) == 0 -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/devices.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/devices.go deleted file mode 100644 index 7792566d5ee4..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/devices.go +++ /dev/null @@ -1,92 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "fmt" - "os" - "path/filepath" - - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -const ( - allowDeviceFile = "devices.allow" - denyDeviceFile = "devices.deny" - wildcard = -1 -) - -func NewDevices(root string) *devicesController { - return &devicesController{ - root: filepath.Join(root, string(Devices)), - } -} - -type devicesController struct { - root string -} - -func (d *devicesController) Name() Name { - return Devices -} - -func (d *devicesController) Path(path string) string { - return filepath.Join(d.root, path) -} - -func (d *devicesController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(d.Path(path), defaultDirPerm); err != nil { - return err - } - for _, device := range resources.Devices { - file := denyDeviceFile - if device.Allow { - file = allowDeviceFile - } - if device.Type == "" { - device.Type = "a" - } - if err := retryingWriteFile( - filepath.Join(d.Path(path), file), - []byte(deviceString(device)), - defaultFilePerm, - ); err != nil { - return err - } - } - return nil -} - -func (d *devicesController) Update(path string, resources *specs.LinuxResources) error { - return d.Create(path, resources) -} - -func deviceString(device specs.LinuxDeviceCgroup) string { - return fmt.Sprintf("%s %s:%s %s", - device.Type, - deviceNumber(device.Major), - deviceNumber(device.Minor), - device.Access, - ) -} - -func deviceNumber(number *int64) string { - if number == nil || *number == wildcard { - return "*" - } - return fmt.Sprint(*number) -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/errors.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/errors.go deleted file mode 100644 index f1ad8315c81e..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/errors.go +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "errors" - "os" -) - -var ( - ErrInvalidPid = errors.New("cgroups: pid must be greater than 0") - ErrMountPointNotExist = errors.New("cgroups: cgroup mountpoint does not exist") - ErrInvalidFormat = errors.New("cgroups: parsing file with invalid format failed") - ErrFreezerNotSupported = errors.New("cgroups: freezer cgroup not supported on this system") - ErrMemoryNotSupported = errors.New("cgroups: memory cgroup not supported on this system") - ErrCgroupDeleted = errors.New("cgroups: cgroup deleted") - ErrNoCgroupMountDestination = errors.New("cgroups: cannot find cgroup mount destination") -) - -// ErrorHandler is a function that handles and acts on errors -type ErrorHandler func(err error) error - -// IgnoreNotExist ignores any errors that are for not existing files -func IgnoreNotExist(err error) error { - if os.IsNotExist(err) { - return nil - } - return err -} - -func errPassthrough(err error) error { - return err -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/freezer.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/freezer.go deleted file mode 100644 index 5783f0dcc741..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/freezer.go +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "os" - "path/filepath" - "strings" - "time" -) - -func NewFreezer(root string) *freezerController { - return &freezerController{ - root: filepath.Join(root, string(Freezer)), - } -} - -type freezerController struct { - root string -} - -func (f *freezerController) Name() Name { - return Freezer -} - -func (f *freezerController) Path(path string) string { - return filepath.Join(f.root, path) -} - -func (f *freezerController) Freeze(path string) error { - return f.waitState(path, Frozen) -} - -func (f *freezerController) Thaw(path string) error { - return f.waitState(path, Thawed) -} - -func (f *freezerController) changeState(path string, state State) error { - return retryingWriteFile( - filepath.Join(f.root, path, "freezer.state"), - []byte(strings.ToUpper(string(state))), - defaultFilePerm, - ) -} - -func (f *freezerController) state(path string) (State, error) { - current, err := os.ReadFile(filepath.Join(f.root, path, "freezer.state")) - if err != nil { - return "", err - } - return State(strings.ToLower(strings.TrimSpace(string(current)))), nil -} - -func (f *freezerController) waitState(path string, state State) error { - for { - if err := f.changeState(path, state); err != nil { - return err - } - current, err := f.state(path) - if err != nil { - return err - } - if current == state { - return nil - } - time.Sleep(1 * time.Millisecond) - } -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/hierarchy.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/hierarchy.go deleted file mode 100644 index ca3f1b9380b7..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/hierarchy.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -// Hierarchy enables both unified and split hierarchy for cgroups -type Hierarchy func() ([]Subsystem, error) diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/hugetlb.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/hugetlb.go deleted file mode 100644 index c0eb03b24da3..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/hugetlb.go +++ /dev/null @@ -1,109 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "os" - "path/filepath" - "strconv" - "strings" - - v1 "github.com/containerd/cgroups/stats/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -func NewHugetlb(root string) (*hugetlbController, error) { - sizes, err := hugePageSizes() - if err != nil { - return nil, err - } - - return &hugetlbController{ - root: filepath.Join(root, string(Hugetlb)), - sizes: sizes, - }, nil -} - -type hugetlbController struct { - root string - sizes []string -} - -func (h *hugetlbController) Name() Name { - return Hugetlb -} - -func (h *hugetlbController) Path(path string) string { - return filepath.Join(h.root, path) -} - -func (h *hugetlbController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(h.Path(path), defaultDirPerm); err != nil { - return err - } - for _, limit := range resources.HugepageLimits { - if err := retryingWriteFile( - filepath.Join(h.Path(path), strings.Join([]string{"hugetlb", limit.Pagesize, "limit_in_bytes"}, ".")), - []byte(strconv.FormatUint(limit.Limit, 10)), - defaultFilePerm, - ); err != nil { - return err - } - } - return nil -} - -func (h *hugetlbController) Stat(path string, stats *v1.Metrics) error { - for _, size := range h.sizes { - s, err := h.readSizeStat(path, size) - if err != nil { - return err - } - stats.Hugetlb = append(stats.Hugetlb, s) - } - return nil -} - -func (h *hugetlbController) readSizeStat(path, size string) (*v1.HugetlbStat, error) { - s := v1.HugetlbStat{ - Pagesize: size, - } - for _, t := range []struct { - name string - value *uint64 - }{ - { - name: "usage_in_bytes", - value: &s.Usage, - }, - { - name: "max_usage_in_bytes", - value: &s.Max, - }, - { - name: "failcnt", - value: &s.Failcnt, - }, - } { - v, err := readUint(filepath.Join(h.Path(path), strings.Join([]string{"hugetlb", size, t.name}, "."))) - if err != nil { - return nil, err - } - *t.value = v - } - return &s, nil -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/memory.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/memory.go deleted file mode 100644 index e271866ef94f..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/memory.go +++ /dev/null @@ -1,480 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "bufio" - "fmt" - "io" - "os" - "path/filepath" - "strconv" - "strings" - - v1 "github.com/containerd/cgroups/stats/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/sys/unix" -) - -// MemoryEvent is an interface that V1 memory Cgroup notifications implement. Arg returns the -// file name whose fd should be written to "cgroups.event_control". EventFile returns the name of -// the file that supports the notification api e.g. "memory.usage_in_bytes". -type MemoryEvent interface { - Arg() string - EventFile() string -} - -type memoryThresholdEvent struct { - threshold uint64 - swap bool -} - -// MemoryThresholdEvent returns a new memory threshold event to be used with RegisterMemoryEvent. -// If swap is true, the event will be registered using memory.memsw.usage_in_bytes -func MemoryThresholdEvent(threshold uint64, swap bool) MemoryEvent { - return &memoryThresholdEvent{ - threshold, - swap, - } -} - -func (m *memoryThresholdEvent) Arg() string { - return strconv.FormatUint(m.threshold, 10) -} - -func (m *memoryThresholdEvent) EventFile() string { - if m.swap { - return "memory.memsw.usage_in_bytes" - } - return "memory.usage_in_bytes" -} - -type oomEvent struct{} - -// OOMEvent returns a new oom event to be used with RegisterMemoryEvent. -func OOMEvent() MemoryEvent { - return &oomEvent{} -} - -func (oom *oomEvent) Arg() string { - return "" -} - -func (oom *oomEvent) EventFile() string { - return "memory.oom_control" -} - -type memoryPressureEvent struct { - pressureLevel MemoryPressureLevel - hierarchy EventNotificationMode -} - -// MemoryPressureEvent returns a new memory pressure event to be used with RegisterMemoryEvent. -func MemoryPressureEvent(pressureLevel MemoryPressureLevel, hierarchy EventNotificationMode) MemoryEvent { - return &memoryPressureEvent{ - pressureLevel, - hierarchy, - } -} - -func (m *memoryPressureEvent) Arg() string { - return string(m.pressureLevel) + "," + string(m.hierarchy) -} - -func (m *memoryPressureEvent) EventFile() string { - return "memory.pressure_level" -} - -// MemoryPressureLevel corresponds to the memory pressure levels defined -// for memory cgroups. -type MemoryPressureLevel string - -// The three memory pressure levels are as follows. -// - The "low" level means that the system is reclaiming memory for new -// allocations. Monitoring this reclaiming activity might be useful for -// maintaining cache level. Upon notification, the program (typically -// "Activity Manager") might analyze vmstat and act in advance (i.e. -// prematurely shutdown unimportant services). -// - The "medium" level means that the system is experiencing medium memory -// pressure, the system might be making swap, paging out active file caches, -// etc. Upon this event applications may decide to further analyze -// vmstat/zoneinfo/memcg or internal memory usage statistics and free any -// resources that can be easily reconstructed or re-read from a disk. -// - The "critical" level means that the system is actively thrashing, it is -// about to out of memory (OOM) or even the in-kernel OOM killer is on its -// way to trigger. Applications should do whatever they can to help the -// system. It might be too late to consult with vmstat or any other -// statistics, so it is advisable to take an immediate action. -// "https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt" Section 11 -const ( - LowPressure MemoryPressureLevel = "low" - MediumPressure MemoryPressureLevel = "medium" - CriticalPressure MemoryPressureLevel = "critical" -) - -// EventNotificationMode corresponds to the notification modes -// for the memory cgroups pressure level notifications. -type EventNotificationMode string - -// There are three optional modes that specify different propagation behavior: -// - "default": this is the default behavior specified above. This mode is the -// same as omitting the optional mode parameter, preserved by backwards -// compatibility. -// - "hierarchy": events always propagate up to the root, similar to the default -// behavior, except that propagation continues regardless of whether there are -// event listeners at each level, with the "hierarchy" mode. In the above -// example, groups A, B, and C will receive notification of memory pressure. -// - "local": events are pass-through, i.e. they only receive notifications when -// memory pressure is experienced in the memcg for which the notification is -// registered. In the above example, group C will receive notification if -// registered for "local" notification and the group experiences memory -// pressure. However, group B will never receive notification, regardless if -// there is an event listener for group C or not, if group B is registered for -// local notification. -// "https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt" Section 11 -const ( - DefaultMode EventNotificationMode = "default" - LocalMode EventNotificationMode = "local" - HierarchyMode EventNotificationMode = "hierarchy" -) - -// NewMemory returns a Memory controller given the root folder of cgroups. -// It may optionally accept other configuration options, such as IgnoreModules(...) -func NewMemory(root string, options ...func(*memoryController)) *memoryController { - mc := &memoryController{ - root: filepath.Join(root, string(Memory)), - ignored: map[string]struct{}{}, - } - for _, opt := range options { - opt(mc) - } - return mc -} - -// IgnoreModules configure the memory controller to not read memory metrics for some -// module names (e.g. passing "memsw" would avoid all the memory.memsw.* entries) -func IgnoreModules(names ...string) func(*memoryController) { - return func(mc *memoryController) { - for _, name := range names { - mc.ignored[name] = struct{}{} - } - } -} - -// OptionalSwap allows the memory controller to not fail if cgroups is not accounting -// Swap memory (there are no memory.memsw.* entries) -func OptionalSwap() func(*memoryController) { - return func(mc *memoryController) { - _, err := os.Stat(filepath.Join(mc.root, "memory.memsw.usage_in_bytes")) - if os.IsNotExist(err) { - mc.ignored["memsw"] = struct{}{} - } - } -} - -type memoryController struct { - root string - ignored map[string]struct{} -} - -func (m *memoryController) Name() Name { - return Memory -} - -func (m *memoryController) Path(path string) string { - return filepath.Join(m.root, path) -} - -func (m *memoryController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(m.Path(path), defaultDirPerm); err != nil { - return err - } - if resources.Memory == nil { - return nil - } - return m.set(path, getMemorySettings(resources)) -} - -func (m *memoryController) Update(path string, resources *specs.LinuxResources) error { - if resources.Memory == nil { - return nil - } - g := func(v *int64) bool { - return v != nil && *v > 0 - } - settings := getMemorySettings(resources) - if g(resources.Memory.Limit) && g(resources.Memory.Swap) { - // if the updated swap value is larger than the current memory limit set the swap changes first - // then set the memory limit as swap must always be larger than the current limit - current, err := readUint(filepath.Join(m.Path(path), "memory.limit_in_bytes")) - if err != nil { - return err - } - if current < uint64(*resources.Memory.Swap) { - settings[0], settings[1] = settings[1], settings[0] - } - } - return m.set(path, settings) -} - -func (m *memoryController) Stat(path string, stats *v1.Metrics) error { - fMemStat, err := os.Open(filepath.Join(m.Path(path), "memory.stat")) - if err != nil { - return err - } - defer fMemStat.Close() - stats.Memory = &v1.MemoryStat{ - Usage: &v1.MemoryEntry{}, - Swap: &v1.MemoryEntry{}, - Kernel: &v1.MemoryEntry{}, - KernelTCP: &v1.MemoryEntry{}, - } - if err := m.parseStats(fMemStat, stats.Memory); err != nil { - return err - } - - fMemOomControl, err := os.Open(filepath.Join(m.Path(path), "memory.oom_control")) - if err != nil { - return err - } - defer fMemOomControl.Close() - stats.MemoryOomControl = &v1.MemoryOomControl{} - if err := m.parseOomControlStats(fMemOomControl, stats.MemoryOomControl); err != nil { - return err - } - for _, t := range []struct { - module string - entry *v1.MemoryEntry - }{ - { - module: "", - entry: stats.Memory.Usage, - }, - { - module: "memsw", - entry: stats.Memory.Swap, - }, - { - module: "kmem", - entry: stats.Memory.Kernel, - }, - { - module: "kmem.tcp", - entry: stats.Memory.KernelTCP, - }, - } { - if _, ok := m.ignored[t.module]; ok { - continue - } - for _, tt := range []struct { - name string - value *uint64 - }{ - { - name: "usage_in_bytes", - value: &t.entry.Usage, - }, - { - name: "max_usage_in_bytes", - value: &t.entry.Max, - }, - { - name: "failcnt", - value: &t.entry.Failcnt, - }, - { - name: "limit_in_bytes", - value: &t.entry.Limit, - }, - } { - parts := []string{"memory"} - if t.module != "" { - parts = append(parts, t.module) - } - parts = append(parts, tt.name) - v, err := readUint(filepath.Join(m.Path(path), strings.Join(parts, "."))) - if err != nil { - return err - } - *tt.value = v - } - } - return nil -} - -func (m *memoryController) parseStats(r io.Reader, stat *v1.MemoryStat) error { - var ( - raw = make(map[string]uint64) - sc = bufio.NewScanner(r) - line int - ) - for sc.Scan() { - key, v, err := parseKV(sc.Text()) - if err != nil { - return fmt.Errorf("%d: %v", line, err) - } - raw[key] = v - line++ - } - if err := sc.Err(); err != nil { - return err - } - stat.Cache = raw["cache"] - stat.RSS = raw["rss"] - stat.RSSHuge = raw["rss_huge"] - stat.MappedFile = raw["mapped_file"] - stat.Dirty = raw["dirty"] - stat.Writeback = raw["writeback"] - stat.PgPgIn = raw["pgpgin"] - stat.PgPgOut = raw["pgpgout"] - stat.PgFault = raw["pgfault"] - stat.PgMajFault = raw["pgmajfault"] - stat.InactiveAnon = raw["inactive_anon"] - stat.ActiveAnon = raw["active_anon"] - stat.InactiveFile = raw["inactive_file"] - stat.ActiveFile = raw["active_file"] - stat.Unevictable = raw["unevictable"] - stat.HierarchicalMemoryLimit = raw["hierarchical_memory_limit"] - stat.HierarchicalSwapLimit = raw["hierarchical_memsw_limit"] - stat.TotalCache = raw["total_cache"] - stat.TotalRSS = raw["total_rss"] - stat.TotalRSSHuge = raw["total_rss_huge"] - stat.TotalMappedFile = raw["total_mapped_file"] - stat.TotalDirty = raw["total_dirty"] - stat.TotalWriteback = raw["total_writeback"] - stat.TotalPgPgIn = raw["total_pgpgin"] - stat.TotalPgPgOut = raw["total_pgpgout"] - stat.TotalPgFault = raw["total_pgfault"] - stat.TotalPgMajFault = raw["total_pgmajfault"] - stat.TotalInactiveAnon = raw["total_inactive_anon"] - stat.TotalActiveAnon = raw["total_active_anon"] - stat.TotalInactiveFile = raw["total_inactive_file"] - stat.TotalActiveFile = raw["total_active_file"] - stat.TotalUnevictable = raw["total_unevictable"] - return nil -} - -func (m *memoryController) parseOomControlStats(r io.Reader, stat *v1.MemoryOomControl) error { - var ( - raw = make(map[string]uint64) - sc = bufio.NewScanner(r) - line int - ) - for sc.Scan() { - key, v, err := parseKV(sc.Text()) - if err != nil { - return fmt.Errorf("%d: %v", line, err) - } - raw[key] = v - line++ - } - if err := sc.Err(); err != nil { - return err - } - stat.OomKillDisable = raw["oom_kill_disable"] - stat.UnderOom = raw["under_oom"] - stat.OomKill = raw["oom_kill"] - return nil -} - -func (m *memoryController) set(path string, settings []memorySettings) error { - for _, t := range settings { - if t.value != nil { - if err := retryingWriteFile( - filepath.Join(m.Path(path), "memory."+t.name), - []byte(strconv.FormatInt(*t.value, 10)), - defaultFilePerm, - ); err != nil { - return err - } - } - } - return nil -} - -type memorySettings struct { - name string - value *int64 -} - -func getMemorySettings(resources *specs.LinuxResources) []memorySettings { - mem := resources.Memory - var swappiness *int64 - if mem.Swappiness != nil { - v := int64(*mem.Swappiness) - swappiness = &v - } - return []memorySettings{ - { - name: "limit_in_bytes", - value: mem.Limit, - }, - { - name: "soft_limit_in_bytes", - value: mem.Reservation, - }, - { - name: "memsw.limit_in_bytes", - value: mem.Swap, - }, - { - name: "kmem.limit_in_bytes", - value: mem.Kernel, - }, - { - name: "kmem.tcp.limit_in_bytes", - value: mem.KernelTCP, - }, - { - name: "oom_control", - value: getOomControlValue(mem), - }, - { - name: "swappiness", - value: swappiness, - }, - } -} - -func getOomControlValue(mem *specs.LinuxMemory) *int64 { - if mem.DisableOOMKiller != nil && *mem.DisableOOMKiller { - i := int64(1) - return &i - } - return nil -} - -func (m *memoryController) memoryEvent(path string, event MemoryEvent) (uintptr, error) { - root := m.Path(path) - efd, err := unix.Eventfd(0, unix.EFD_CLOEXEC) - if err != nil { - return 0, err - } - evtFile, err := os.Open(filepath.Join(root, event.EventFile())) - if err != nil { - unix.Close(efd) - return 0, err - } - defer evtFile.Close() - data := fmt.Sprintf("%d %d %s", efd, evtFile.Fd(), event.Arg()) - evctlPath := filepath.Join(root, "cgroup.event_control") - if err := retryingWriteFile(evctlPath, []byte(data), 0700); err != nil { - unix.Close(efd) - return 0, err - } - return uintptr(efd), nil -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/named.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/named.go deleted file mode 100644 index 06b16c3b1573..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/named.go +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import "path/filepath" - -func NewNamed(root string, name Name) *namedController { - return &namedController{ - root: root, - name: name, - } -} - -type namedController struct { - root string - name Name -} - -func (n *namedController) Name() Name { - return n.name -} - -func (n *namedController) Path(path string) string { - return filepath.Join(n.root, string(n.name), path) -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/net_cls.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/net_cls.go deleted file mode 100644 index 839b06de080b..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/net_cls.go +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "os" - "path/filepath" - "strconv" - - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -func NewNetCls(root string) *netclsController { - return &netclsController{ - root: filepath.Join(root, string(NetCLS)), - } -} - -type netclsController struct { - root string -} - -func (n *netclsController) Name() Name { - return NetCLS -} - -func (n *netclsController) Path(path string) string { - return filepath.Join(n.root, path) -} - -func (n *netclsController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(n.Path(path), defaultDirPerm); err != nil { - return err - } - if resources.Network != nil && resources.Network.ClassID != nil && *resources.Network.ClassID > 0 { - return retryingWriteFile( - filepath.Join(n.Path(path), "net_cls.classid"), - []byte(strconv.FormatUint(uint64(*resources.Network.ClassID), 10)), - defaultFilePerm, - ) - } - return nil -} - -func (n *netclsController) Update(path string, resources *specs.LinuxResources) error { - return n.Create(path, resources) -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/net_prio.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/net_prio.go deleted file mode 100644 index 6362fd084f71..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/net_prio.go +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "fmt" - "os" - "path/filepath" - - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -func NewNetPrio(root string) *netprioController { - return &netprioController{ - root: filepath.Join(root, string(NetPrio)), - } -} - -type netprioController struct { - root string -} - -func (n *netprioController) Name() Name { - return NetPrio -} - -func (n *netprioController) Path(path string) string { - return filepath.Join(n.root, path) -} - -func (n *netprioController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(n.Path(path), defaultDirPerm); err != nil { - return err - } - if resources.Network != nil { - for _, prio := range resources.Network.Priorities { - if err := retryingWriteFile( - filepath.Join(n.Path(path), "net_prio.ifpriomap"), - formatPrio(prio.Name, prio.Priority), - defaultFilePerm, - ); err != nil { - return err - } - } - } - return nil -} - -func formatPrio(name string, prio uint32) []byte { - return []byte(fmt.Sprintf("%s %d", name, prio)) -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/opts.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/opts.go deleted file mode 100644 index 1e428d048079..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/opts.go +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "errors" -) - -var ( - // ErrIgnoreSubsystem allows the specific subsystem to be skipped - ErrIgnoreSubsystem = errors.New("skip subsystem") - // ErrDevicesRequired is returned when the devices subsystem is required but - // does not exist or is not active - ErrDevicesRequired = errors.New("devices subsystem is required") -) - -// InitOpts allows configuration for the creation or loading of a cgroup -type InitOpts func(*InitConfig) error - -// InitConfig provides configuration options for the creation -// or loading of a cgroup and its subsystems -type InitConfig struct { - // InitCheck can be used to check initialization errors from the subsystem - InitCheck InitCheck -} - -func newInitConfig() *InitConfig { - return &InitConfig{ - InitCheck: RequireDevices, - } -} - -// InitCheck allows subsystems errors to be checked when initialized or loaded -type InitCheck func(Subsystem, Path, error) error - -// AllowAny allows any subsystem errors to be skipped -func AllowAny(_ Subsystem, _ Path, _ error) error { - return ErrIgnoreSubsystem -} - -// RequireDevices requires the device subsystem but no others -func RequireDevices(s Subsystem, _ Path, _ error) error { - if s.Name() == Devices { - return ErrDevicesRequired - } - return ErrIgnoreSubsystem -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/paths.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/paths.go deleted file mode 100644 index bddc4e9cdcd7..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/paths.go +++ /dev/null @@ -1,106 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "errors" - "fmt" - "path/filepath" -) - -type Path func(subsystem Name) (string, error) - -func RootPath(subsystem Name) (string, error) { - return "/", nil -} - -// StaticPath returns a static path to use for all cgroups -func StaticPath(path string) Path { - return func(_ Name) (string, error) { - return path, nil - } -} - -// NestedPath will nest the cgroups based on the calling processes cgroup -// placing its child processes inside its own path -func NestedPath(suffix string) Path { - paths, err := ParseCgroupFile("/proc/self/cgroup") - if err != nil { - return errorPath(err) - } - return existingPath(paths, suffix) -} - -// PidPath will return the correct cgroup paths for an existing process running inside a cgroup -// This is commonly used for the Load function to restore an existing container -func PidPath(pid int) Path { - p := fmt.Sprintf("/proc/%d/cgroup", pid) - paths, err := ParseCgroupFile(p) - if err != nil { - return errorPath(fmt.Errorf("parse cgroup file %s: %w", p, err)) - } - return existingPath(paths, "") -} - -// ErrControllerNotActive is returned when a controller is not supported or enabled -var ErrControllerNotActive = errors.New("controller is not supported") - -func existingPath(paths map[string]string, suffix string) Path { - // localize the paths based on the root mount dest for nested cgroups - for n, p := range paths { - dest, err := getCgroupDestination(n) - if err != nil { - return errorPath(err) - } - rel, err := filepath.Rel(dest, p) - if err != nil { - return errorPath(err) - } - if rel == "." { - rel = dest - } - paths[n] = filepath.Join("/", rel) - } - return func(name Name) (string, error) { - root, ok := paths[string(name)] - if !ok { - if root, ok = paths["name="+string(name)]; !ok { - return "", ErrControllerNotActive - } - } - if suffix != "" { - return filepath.Join(root, suffix), nil - } - return root, nil - } -} - -func subPath(path Path, subName string) Path { - return func(name Name) (string, error) { - p, err := path(name) - if err != nil { - return "", err - } - return filepath.Join(p, subName), nil - } -} - -func errorPath(err error) Path { - return func(_ Name) (string, error) { - return "", err - } -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/perf_event.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/perf_event.go deleted file mode 100644 index 648786db68f6..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/perf_event.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import "path/filepath" - -func NewPerfEvent(root string) *PerfEventController { - return &PerfEventController{ - root: filepath.Join(root, string(PerfEvent)), - } -} - -type PerfEventController struct { - root string -} - -func (p *PerfEventController) Name() Name { - return PerfEvent -} - -func (p *PerfEventController) Path(path string) string { - return filepath.Join(p.root, path) -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/pids.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/pids.go deleted file mode 100644 index 66a1b6b44708..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/pids.go +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "os" - "path/filepath" - "strconv" - "strings" - - v1 "github.com/containerd/cgroups/stats/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -func NewPids(root string) *pidsController { - return &pidsController{ - root: filepath.Join(root, string(Pids)), - } -} - -type pidsController struct { - root string -} - -func (p *pidsController) Name() Name { - return Pids -} - -func (p *pidsController) Path(path string) string { - return filepath.Join(p.root, path) -} - -func (p *pidsController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(p.Path(path), defaultDirPerm); err != nil { - return err - } - if resources.Pids != nil && resources.Pids.Limit > 0 { - return retryingWriteFile( - filepath.Join(p.Path(path), "pids.max"), - []byte(strconv.FormatInt(resources.Pids.Limit, 10)), - defaultFilePerm, - ) - } - return nil -} - -func (p *pidsController) Update(path string, resources *specs.LinuxResources) error { - return p.Create(path, resources) -} - -func (p *pidsController) Stat(path string, stats *v1.Metrics) error { - current, err := readUint(filepath.Join(p.Path(path), "pids.current")) - if err != nil { - return err - } - var max uint64 - maxData, err := os.ReadFile(filepath.Join(p.Path(path), "pids.max")) - if err != nil { - return err - } - if maxS := strings.TrimSpace(string(maxData)); maxS != "max" { - if max, err = parseUint(maxS, 10, 64); err != nil { - return err - } - } - stats.Pids = &v1.PidsStat{ - Current: current, - Limit: max, - } - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/rdma.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/rdma.go deleted file mode 100644 index 9d414203e42e..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/rdma.go +++ /dev/null @@ -1,154 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "math" - "os" - "path/filepath" - "strconv" - "strings" - - v1 "github.com/containerd/cgroups/stats/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -type rdmaController struct { - root string -} - -func (p *rdmaController) Name() Name { - return Rdma -} - -func (p *rdmaController) Path(path string) string { - return filepath.Join(p.root, path) -} - -func NewRdma(root string) *rdmaController { - return &rdmaController{ - root: filepath.Join(root, string(Rdma)), - } -} - -func createCmdString(device string, limits *specs.LinuxRdma) string { - var cmdString string - - cmdString = device - if limits.HcaHandles != nil { - cmdString = cmdString + " " + "hca_handle=" + strconv.FormatUint(uint64(*limits.HcaHandles), 10) - } - - if limits.HcaObjects != nil { - cmdString = cmdString + " " + "hca_object=" + strconv.FormatUint(uint64(*limits.HcaObjects), 10) - } - return cmdString -} - -func (p *rdmaController) Create(path string, resources *specs.LinuxResources) error { - if err := os.MkdirAll(p.Path(path), defaultDirPerm); err != nil { - return err - } - - for device, limit := range resources.Rdma { - if device != "" && (limit.HcaHandles != nil || limit.HcaObjects != nil) { - limit := limit - return retryingWriteFile( - filepath.Join(p.Path(path), "rdma.max"), - []byte(createCmdString(device, &limit)), - defaultFilePerm, - ) - } - } - return nil -} - -func (p *rdmaController) Update(path string, resources *specs.LinuxResources) error { - return p.Create(path, resources) -} - -func parseRdmaKV(raw string, entry *v1.RdmaEntry) { - var value uint64 - var err error - - parts := strings.Split(raw, "=") - switch len(parts) { - case 2: - if parts[1] == "max" { - value = math.MaxUint32 - } else { - value, err = parseUint(parts[1], 10, 32) - if err != nil { - return - } - } - if parts[0] == "hca_handle" { - entry.HcaHandles = uint32(value) - } else if parts[0] == "hca_object" { - entry.HcaObjects = uint32(value) - } - } -} - -func toRdmaEntry(strEntries []string) []*v1.RdmaEntry { - var rdmaEntries []*v1.RdmaEntry - for i := range strEntries { - parts := strings.Fields(strEntries[i]) - switch len(parts) { - case 3: - entry := new(v1.RdmaEntry) - entry.Device = parts[0] - parseRdmaKV(parts[1], entry) - parseRdmaKV(parts[2], entry) - - rdmaEntries = append(rdmaEntries, entry) - default: - continue - } - } - return rdmaEntries -} - -func (p *rdmaController) Stat(path string, stats *v1.Metrics) error { - - currentData, err := os.ReadFile(filepath.Join(p.Path(path), "rdma.current")) - if err != nil { - return err - } - currentPerDevices := strings.Split(string(currentData), "\n") - - maxData, err := os.ReadFile(filepath.Join(p.Path(path), "rdma.max")) - if err != nil { - return err - } - maxPerDevices := strings.Split(string(maxData), "\n") - - // If device got removed between reading two files, ignore returning - // stats. - if len(currentPerDevices) != len(maxPerDevices) { - return nil - } - - currentEntries := toRdmaEntry(currentPerDevices) - maxEntries := toRdmaEntry(maxPerDevices) - - stats.Rdma = &v1.RdmaStat{ - Current: currentEntries, - Limit: maxEntries, - } - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/state.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/state.go deleted file mode 100644 index cfeabbbc60b3..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/state.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -// State is a type that represents the state of the current cgroup -type State string - -const ( - Unknown State = "" - Thawed State = "thawed" - Frozen State = "frozen" - Freezing State = "freezing" - Deleted State = "deleted" -) diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/subsystem.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/subsystem.go deleted file mode 100644 index b2f41854d2c5..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/subsystem.go +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "fmt" - "os" - - v1 "github.com/containerd/cgroups/stats/v1" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -// Name is a typed name for a cgroup subsystem -type Name string - -const ( - Devices Name = "devices" - Hugetlb Name = "hugetlb" - Freezer Name = "freezer" - Pids Name = "pids" - NetCLS Name = "net_cls" - NetPrio Name = "net_prio" - PerfEvent Name = "perf_event" - Cpuset Name = "cpuset" - Cpu Name = "cpu" - Cpuacct Name = "cpuacct" - Memory Name = "memory" - Blkio Name = "blkio" - Rdma Name = "rdma" -) - -// Subsystems returns a complete list of the default cgroups -// available on most linux systems -func Subsystems() []Name { - n := []Name{ - Freezer, - Pids, - NetCLS, - NetPrio, - PerfEvent, - Cpuset, - Cpu, - Cpuacct, - Memory, - Blkio, - Rdma, - } - if !RunningInUserNS() { - n = append(n, Devices) - } - if _, err := os.Stat("/sys/kernel/mm/hugepages"); err == nil { - n = append(n, Hugetlb) - } - return n -} - -type Subsystem interface { - Name() Name -} - -type pather interface { - Subsystem - Path(path string) string -} - -type creator interface { - Subsystem - Create(path string, resources *specs.LinuxResources) error -} - -type deleter interface { - Subsystem - Delete(path string) error -} - -type stater interface { - Subsystem - Stat(path string, stats *v1.Metrics) error -} - -type updater interface { - Subsystem - Update(path string, resources *specs.LinuxResources) error -} - -// SingleSubsystem returns a single cgroup subsystem within the base Hierarchy -func SingleSubsystem(baseHierarchy Hierarchy, subsystem Name) Hierarchy { - return func() ([]Subsystem, error) { - subsystems, err := baseHierarchy() - if err != nil { - return nil, err - } - for _, s := range subsystems { - if s.Name() == subsystem { - return []Subsystem{ - s, - }, nil - } - } - return nil, fmt.Errorf("unable to find subsystem %s", subsystem) - } -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/systemd.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/systemd.go deleted file mode 100644 index 4da57cb4b00b..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/systemd.go +++ /dev/null @@ -1,158 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "context" - "path/filepath" - "strings" - "sync" - - systemdDbus "github.com/coreos/go-systemd/v22/dbus" - "github.com/godbus/dbus/v5" - specs "github.com/opencontainers/runtime-spec/specs-go" -) - -const ( - SystemdDbus Name = "systemd" - defaultSlice = "system.slice" -) - -var ( - canDelegate bool - once sync.Once -) - -func Systemd() ([]Subsystem, error) { - root, err := v1MountPoint() - if err != nil { - return nil, err - } - defaultSubsystems, err := defaults(root) - if err != nil { - return nil, err - } - s, err := NewSystemd(root) - if err != nil { - return nil, err - } - // make sure the systemd controller is added first - return append([]Subsystem{s}, defaultSubsystems...), nil -} - -func Slice(slice, name string) Path { - if slice == "" { - slice = defaultSlice - } - return func(subsystem Name) (string, error) { - return filepath.Join(slice, name), nil - } -} - -func NewSystemd(root string) (*SystemdController, error) { - return &SystemdController{ - root: root, - }, nil -} - -type SystemdController struct { - mu sync.Mutex - root string -} - -func (s *SystemdController) Name() Name { - return SystemdDbus -} - -func (s *SystemdController) Create(path string, _ *specs.LinuxResources) error { - ctx := context.TODO() - conn, err := systemdDbus.NewWithContext(ctx) - if err != nil { - return err - } - defer conn.Close() - slice, name := splitName(path) - // We need to see if systemd can handle the delegate property - // Systemd will return an error if it cannot handle delegate regardless - // of its bool setting. - checkDelegate := func() { - canDelegate = true - dlSlice := newProperty("Delegate", true) - if _, err := conn.StartTransientUnitContext(ctx, slice, "testdelegate", []systemdDbus.Property{dlSlice}, nil); err != nil { - if dbusError, ok := err.(dbus.Error); ok { - // Starting with systemd v237, Delegate is not even a property of slices anymore, - // so the D-Bus call fails with "InvalidArgs" error. - if strings.Contains(dbusError.Name, "org.freedesktop.DBus.Error.PropertyReadOnly") || strings.Contains(dbusError.Name, "org.freedesktop.DBus.Error.InvalidArgs") { - canDelegate = false - } - } - } - - _, _ = conn.StopUnitContext(ctx, slice, "testDelegate", nil) - } - once.Do(checkDelegate) - properties := []systemdDbus.Property{ - systemdDbus.PropDescription("cgroup " + name), - systemdDbus.PropWants(slice), - newProperty("DefaultDependencies", false), - newProperty("MemoryAccounting", true), - newProperty("CPUAccounting", true), - newProperty("BlockIOAccounting", true), - } - - // If we can delegate, we add the property back in - if canDelegate { - properties = append(properties, newProperty("Delegate", true)) - } - - ch := make(chan string) - _, err = conn.StartTransientUnitContext(ctx, name, "replace", properties, ch) - if err != nil { - return err - } - <-ch - return nil -} - -func (s *SystemdController) Delete(path string) error { - ctx := context.TODO() - conn, err := systemdDbus.NewWithContext(ctx) - if err != nil { - return err - } - defer conn.Close() - _, name := splitName(path) - ch := make(chan string) - _, err = conn.StopUnitContext(ctx, name, "replace", ch) - if err != nil { - return err - } - <-ch - return nil -} - -func newProperty(name string, units interface{}) systemdDbus.Property { - return systemdDbus.Property{ - Name: name, - Value: dbus.MakeVariant(units), - } -} - -func splitName(path string) (slice string, unit string) { - slice, unit = filepath.Split(path) - return strings.TrimSuffix(slice, "/"), unit -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/ticks.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/ticks.go deleted file mode 100644 index 84dc38d0cc33..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/ticks.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -func getClockTicks() uint64 { - // The value comes from `C.sysconf(C._SC_CLK_TCK)`, and - // on Linux it's a constant which is safe to be hard coded, - // so we can avoid using cgo here. - // See https://github.com/containerd/cgroups/pull/12 for - // more details. - return 100 -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/utils.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/utils.go deleted file mode 100644 index c17a3a41423a..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/utils.go +++ /dev/null @@ -1,391 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "bufio" - "errors" - "fmt" - "io" - "os" - "path/filepath" - "strconv" - "strings" - "sync" - "syscall" - "time" - - units "github.com/docker/go-units" - specs "github.com/opencontainers/runtime-spec/specs-go" - "golang.org/x/sys/unix" -) - -var ( - nsOnce sync.Once - inUserNS bool - checkMode sync.Once - cgMode CGMode -) - -const unifiedMountpoint = "/sys/fs/cgroup" - -// CGMode is the cgroups mode of the host system -type CGMode int - -const ( - // Unavailable cgroup mountpoint - Unavailable CGMode = iota - // Legacy cgroups v1 - Legacy - // Hybrid with cgroups v1 and v2 controllers mounted - Hybrid - // Unified with only cgroups v2 mounted - Unified -) - -// Mode returns the cgroups mode running on the host -func Mode() CGMode { - checkMode.Do(func() { - var st unix.Statfs_t - if err := unix.Statfs(unifiedMountpoint, &st); err != nil { - cgMode = Unavailable - return - } - switch st.Type { - case unix.CGROUP2_SUPER_MAGIC: - cgMode = Unified - default: - cgMode = Legacy - if err := unix.Statfs(filepath.Join(unifiedMountpoint, "unified"), &st); err != nil { - return - } - if st.Type == unix.CGROUP2_SUPER_MAGIC { - cgMode = Hybrid - } - } - }) - return cgMode -} - -// RunningInUserNS detects whether we are currently running in a user namespace. -// Copied from github.com/lxc/lxd/shared/util.go -func RunningInUserNS() bool { - nsOnce.Do(func() { - file, err := os.Open("/proc/self/uid_map") - if err != nil { - // This kernel-provided file only exists if user namespaces are supported - return - } - defer file.Close() - - buf := bufio.NewReader(file) - l, _, err := buf.ReadLine() - if err != nil { - return - } - - line := string(l) - var a, b, c int64 - fmt.Sscanf(line, "%d %d %d", &a, &b, &c) - - /* - * We assume we are in the initial user namespace if we have a full - * range - 4294967295 uids starting at uid 0. - */ - if a == 0 && b == 0 && c == 4294967295 { - return - } - inUserNS = true - }) - return inUserNS -} - -// defaults returns all known groups -func defaults(root string) ([]Subsystem, error) { - h, err := NewHugetlb(root) - if err != nil && !os.IsNotExist(err) { - return nil, err - } - s := []Subsystem{ - NewNamed(root, "systemd"), - NewFreezer(root), - NewPids(root), - NewNetCls(root), - NewNetPrio(root), - NewPerfEvent(root), - NewCpuset(root), - NewCpu(root), - NewCpuacct(root), - NewMemory(root), - NewBlkio(root), - NewRdma(root), - } - // only add the devices cgroup if we are not in a user namespace - // because modifications are not allowed - if !RunningInUserNS() { - s = append(s, NewDevices(root)) - } - // add the hugetlb cgroup if error wasn't due to missing hugetlb - // cgroup support on the host - if err == nil { - s = append(s, h) - } - return s, nil -} - -// remove will remove a cgroup path handling EAGAIN and EBUSY errors and -// retrying the remove after a exp timeout -func remove(path string) error { - delay := 10 * time.Millisecond - for i := 0; i < 5; i++ { - if i != 0 { - time.Sleep(delay) - delay *= 2 - } - if err := os.RemoveAll(path); err == nil { - return nil - } - } - return fmt.Errorf("cgroups: unable to remove path %q", path) -} - -// readPids will read all the pids of processes or tasks in a cgroup by the provided path -func readPids(path string, subsystem Name, pType procType) ([]Process, error) { - f, err := os.Open(filepath.Join(path, pType)) - if err != nil { - return nil, err - } - defer f.Close() - var ( - out []Process - s = bufio.NewScanner(f) - ) - for s.Scan() { - if t := s.Text(); t != "" { - pid, err := strconv.Atoi(t) - if err != nil { - return nil, err - } - out = append(out, Process{ - Pid: pid, - Subsystem: subsystem, - Path: path, - }) - } - } - if err := s.Err(); err != nil { - // failed to read all pids? - return nil, err - } - return out, nil -} - -func hugePageSizes() ([]string, error) { - var ( - pageSizes []string - sizeList = []string{"B", "KB", "MB", "GB", "TB", "PB"} - ) - files, err := os.ReadDir("/sys/kernel/mm/hugepages") - if err != nil { - return nil, err - } - for _, st := range files { - nameArray := strings.Split(st.Name(), "-") - pageSize, err := units.RAMInBytes(nameArray[1]) - if err != nil { - return nil, err - } - pageSizes = append(pageSizes, units.CustomSize("%g%s", float64(pageSize), 1024.0, sizeList)) - } - return pageSizes, nil -} - -func readUint(path string) (uint64, error) { - v, err := os.ReadFile(path) - if err != nil { - return 0, err - } - return parseUint(strings.TrimSpace(string(v)), 10, 64) -} - -func parseUint(s string, base, bitSize int) (uint64, error) { - v, err := strconv.ParseUint(s, base, bitSize) - if err != nil { - intValue, intErr := strconv.ParseInt(s, base, bitSize) - // 1. Handle negative values greater than MinInt64 (and) - // 2. Handle negative values lesser than MinInt64 - if intErr == nil && intValue < 0 { - return 0, nil - } else if intErr != nil && - intErr.(*strconv.NumError).Err == strconv.ErrRange && - intValue < 0 { - return 0, nil - } - return 0, err - } - return v, nil -} - -func parseKV(raw string) (string, uint64, error) { - parts := strings.Fields(raw) - switch len(parts) { - case 2: - v, err := parseUint(parts[1], 10, 64) - if err != nil { - return "", 0, err - } - return parts[0], v, nil - default: - return "", 0, ErrInvalidFormat - } -} - -// ParseCgroupFile parses the given cgroup file, typically /proc/self/cgroup -// or /proc//cgroup, into a map of subsystems to cgroup paths, e.g. -// "cpu": "/user.slice/user-1000.slice" -// "pids": "/user.slice/user-1000.slice" -// etc. -// -// The resulting map does not have an element for cgroup v2 unified hierarchy. -// Use ParseCgroupFileUnified to get the unified path. -func ParseCgroupFile(path string) (map[string]string, error) { - x, _, err := ParseCgroupFileUnified(path) - return x, err -} - -// ParseCgroupFileUnified returns legacy subsystem paths as the first value, -// and returns the unified path as the second value. -func ParseCgroupFileUnified(path string) (map[string]string, string, error) { - f, err := os.Open(path) - if err != nil { - return nil, "", err - } - defer f.Close() - return parseCgroupFromReaderUnified(f) -} - -func parseCgroupFromReaderUnified(r io.Reader) (map[string]string, string, error) { - var ( - cgroups = make(map[string]string) - unified = "" - s = bufio.NewScanner(r) - ) - for s.Scan() { - var ( - text = s.Text() - parts = strings.SplitN(text, ":", 3) - ) - if len(parts) < 3 { - return nil, unified, fmt.Errorf("invalid cgroup entry: %q", text) - } - for _, subs := range strings.Split(parts[1], ",") { - if subs == "" { - unified = parts[2] - } else { - cgroups[subs] = parts[2] - } - } - } - if err := s.Err(); err != nil { - return nil, unified, err - } - return cgroups, unified, nil -} - -func getCgroupDestination(subsystem string) (string, error) { - f, err := os.Open("/proc/self/mountinfo") - if err != nil { - return "", err - } - defer f.Close() - s := bufio.NewScanner(f) - for s.Scan() { - fields := strings.Split(s.Text(), " ") - if len(fields) < 10 { - // broken mountinfo? - continue - } - if fields[len(fields)-3] != "cgroup" { - continue - } - for _, opt := range strings.Split(fields[len(fields)-1], ",") { - if opt == subsystem { - return fields[3], nil - } - } - } - if err := s.Err(); err != nil { - return "", err - } - return "", ErrNoCgroupMountDestination -} - -func pathers(subystems []Subsystem) []pather { - var out []pather - for _, s := range subystems { - if p, ok := s.(pather); ok { - out = append(out, p) - } - } - return out -} - -func initializeSubsystem(s Subsystem, path Path, resources *specs.LinuxResources) error { - if c, ok := s.(creator); ok { - p, err := path(s.Name()) - if err != nil { - return err - } - if err := c.Create(p, resources); err != nil { - return err - } - } else if c, ok := s.(pather); ok { - p, err := path(s.Name()) - if err != nil { - return err - } - // do the default create if the group does not have a custom one - if err := os.MkdirAll(c.Path(p), defaultDirPerm); err != nil { - return err - } - } - return nil -} - -func cleanPath(path string) string { - if path == "" { - return "" - } - path = filepath.Clean(path) - if !filepath.IsAbs(path) { - path, _ = filepath.Rel(string(os.PathSeparator), filepath.Clean(string(os.PathSeparator)+path)) - } - return path -} - -func retryingWriteFile(path string, data []byte, mode os.FileMode) error { - // Retry writes on EINTR; see: - // https://github.com/golang/go/issues/38033 - for { - err := os.WriteFile(path, data, mode) - if err == nil { - return nil - } else if !errors.Is(err, syscall.EINTR) { - return err - } - } -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/cgroups/v1.go b/cluster-autoscaler/vendor/github.com/containerd/cgroups/v1.go deleted file mode 100644 index 2ec215c06f42..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/cgroups/v1.go +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 cgroups - -import ( - "bufio" - "fmt" - "os" - "path/filepath" - "strings" -) - -// V1 returns all the groups in the default cgroups mountpoint in a single hierarchy -func V1() ([]Subsystem, error) { - root, err := v1MountPoint() - if err != nil { - return nil, err - } - subsystems, err := defaults(root) - if err != nil { - return nil, err - } - var enabled []Subsystem - for _, s := range pathers(subsystems) { - // check and remove the default groups that do not exist - if _, err := os.Lstat(s.Path("/")); err == nil { - enabled = append(enabled, s) - } - } - return enabled, nil -} - -// v1MountPoint returns the mount point where the cgroup -// mountpoints are mounted in a single hiearchy -func v1MountPoint() (string, error) { - f, err := os.Open("/proc/self/mountinfo") - if err != nil { - return "", err - } - defer f.Close() - scanner := bufio.NewScanner(f) - for scanner.Scan() { - var ( - text = scanner.Text() - fields = strings.Split(text, " ") - numFields = len(fields) - ) - if numFields < 10 { - return "", fmt.Errorf("mountinfo: bad entry %q", text) - } - if fields[numFields-3] == "cgroup" { - return filepath.Dir(fields[4]), nil - } - } - if err := scanner.Err(); err != nil { - return "", err - } - return "", ErrMountPointNotExist -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/.gitattributes b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/.gitattributes deleted file mode 100644 index d207b1802b20..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go text eol=lf diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/.golangci.yml b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/.golangci.yml deleted file mode 100644 index 6462e52f66ff..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/.golangci.yml +++ /dev/null @@ -1,52 +0,0 @@ -linters: - enable: - - staticcheck - - unconvert - - gofmt - - goimports - - revive - - ineffassign - - vet - - unused - - misspell - disable: - - errcheck - -linters-settings: - revive: - ignore-generated-headers: true - rules: - - name: blank-imports - - name: context-as-argument - - name: context-keys-type - - name: dot-imports - - name: error-return - - name: error-strings - - name: error-naming - - name: exported - - name: if-return - - name: increment-decrement - - name: var-naming - arguments: [["UID", "GID"], []] - - name: var-declaration - - name: package-comments - - name: range - - name: receiver-naming - - name: time-naming - - name: unexported-return - - name: indent-error-flow - - name: errorf - - name: empty-block - - name: superfluous-else - - name: unused-parameter - - name: unreachable-code - - name: redefines-builtin-id - -issues: - include: - - EXC0002 - -run: - timeout: 8m - skip-dirs: - - example diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/Makefile b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/Makefile deleted file mode 100644 index c3a497dcac01..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/Makefile +++ /dev/null @@ -1,180 +0,0 @@ -# Copyright The containerd Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT 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 command to use for build -GO ?= go -INSTALL ?= install - -# Root directory of the project (absolute path). -ROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST)))) - -WHALE = "🇩" -ONI = "👹" - -# Project binaries. -COMMANDS=protoc-gen-go-ttrpc protoc-gen-gogottrpc - -ifdef BUILDTAGS - GO_BUILDTAGS = ${BUILDTAGS} -endif -GO_BUILDTAGS ?= -GO_TAGS=$(if $(GO_BUILDTAGS),-tags "$(strip $(GO_BUILDTAGS))",) - -# Project packages. -PACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /example) -TESTPACKAGES=$(shell $(GO) list ${GO_TAGS} ./... | grep -v /cmd | grep -v /integration | grep -v /example) -BINPACKAGES=$(addprefix ./cmd/,$(COMMANDS)) - -#Replaces ":" (*nix), ";" (windows) with newline for easy parsing -GOPATHS=$(shell echo ${GOPATH} | tr ":" "\n" | tr ";" "\n") - -TESTFLAGS_RACE= -GO_BUILD_FLAGS= -# See Golang issue re: '-trimpath': https://github.com/golang/go/issues/13809 -GO_GCFLAGS=$(shell \ - set -- ${GOPATHS}; \ - echo "-gcflags=-trimpath=$${1}/src"; \ - ) - -BINARIES=$(addprefix bin/,$(COMMANDS)) - -# Flags passed to `go test` -TESTFLAGS ?= $(TESTFLAGS_RACE) $(EXTRA_TESTFLAGS) -TESTFLAGS_PARALLEL ?= 8 - -# Use this to replace `go test` with, for instance, `gotestsum` -GOTEST ?= $(GO) test - -.PHONY: clean all AUTHORS build binaries test integration generate protos check-protos coverage ci check help install vendor install-protobuf install-protobuild -.DEFAULT: default - -# Forcibly set the default goal to all, in case an include above brought in a rule definition. -.DEFAULT_GOAL := all - -all: binaries - -check: proto-fmt ## run all linters - @echo "$(WHALE) $@" - GOGC=75 golangci-lint run - -ci: check binaries check-protos coverage # coverage-integration ## to be used by the CI - -AUTHORS: .mailmap .git/HEAD - git log --format='%aN <%aE>' | sort -fu > $@ - -generate: protos - @echo "$(WHALE) $@" - @PATH="${ROOTDIR}/bin:${PATH}" $(GO) generate -x ${PACKAGES} - -protos: bin/protoc-gen-gogottrpc bin/protoc-gen-go-ttrpc ## generate protobuf - @echo "$(WHALE) $@" - @(PATH="${ROOTDIR}/bin:${PATH}" protobuild --quiet ${PACKAGES}) - -check-protos: protos ## check if protobufs needs to be generated again - @echo "$(WHALE) $@" - @test -z "$$(git status --short | grep ".pb.go" | tee /dev/stderr)" || \ - ((git diff | cat) && \ - (echo "$(ONI) please run 'make protos' when making changes to proto files" && false)) - -check-api-descriptors: protos ## check that protobuf changes aren't present. - @echo "$(WHALE) $@" - @test -z "$$(git status --short | grep ".pb.txt" | tee /dev/stderr)" || \ - ((git diff $$(find . -name '*.pb.txt') | cat) && \ - (echo "$(ONI) please run 'make protos' when making changes to proto files and check-in the generated descriptor file changes" && false)) - -proto-fmt: ## check format of proto files - @echo "$(WHALE) $@" - @test -z "$$(find . -name '*.proto' -type f -exec grep -Hn -e "^ " {} \; | tee /dev/stderr)" || \ - (echo "$(ONI) please indent proto files with tabs only" && false) - @test -z "$$(find . -name '*.proto' -type f -exec grep -Hn "Meta meta = " {} \; | grep -v '(gogoproto.nullable) = false' | tee /dev/stderr)" || \ - (echo "$(ONI) meta fields in proto files must have option (gogoproto.nullable) = false" && false) - -build: ## build the go packages - @echo "$(WHALE) $@" - @$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} ${EXTRA_FLAGS} ${PACKAGES} - -test: ## run tests, except integration tests and tests that require root - @echo "$(WHALE) $@" - @$(GOTEST) ${TESTFLAGS} ${TESTPACKAGES} - -integration: ## run integration tests - @echo "$(WHALE) $@" - @cd "${ROOTDIR}/integration" && $(GOTEST) -v ${TESTFLAGS} -parallel ${TESTFLAGS_PARALLEL} . - -benchmark: ## run benchmarks tests - @echo "$(WHALE) $@" - @$(GO) test ${TESTFLAGS} -bench . -run Benchmark - -FORCE: - -define BUILD_BINARY -@echo "$(WHALE) $@" -@$(GO) build ${DEBUG_GO_GCFLAGS} ${GO_GCFLAGS} ${GO_BUILD_FLAGS} -o $@ ${GO_TAGS} ./$< -endef - -# Build a binary from a cmd. -bin/%: cmd/% FORCE - $(call BUILD_BINARY) - -binaries: $(BINARIES) ## build binaries - @echo "$(WHALE) $@" - -clean: ## clean up binaries - @echo "$(WHALE) $@" - @rm -f $(BINARIES) - -install: ## install binaries - @echo "$(WHALE) $@ $(BINPACKAGES)" - @$(GO) install $(BINPACKAGES) - -install-protobuf: - @echo "$(WHALE) $@" - @script/install-protobuf - -install-protobuild: - @echo "$(WHALE) $@" - @$(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 - @$(GO) install github.com/containerd/protobuild@14832ccc41429f5c4f81028e5af08aa233a219cf - -coverage: ## generate coverprofiles from the unit tests, except tests that require root - @echo "$(WHALE) $@" - @rm -f coverage.txt - @$(GO) test ${TESTFLAGS} ${TESTPACKAGES} 2> /dev/null - @( for pkg in ${PACKAGES}; do \ - $(GO) test ${TESTFLAGS} \ - -cover \ - -coverprofile=profile.out \ - -covermode=atomic $$pkg || exit; \ - if [ -f profile.out ]; then \ - cat profile.out >> coverage.txt; \ - rm profile.out; \ - fi; \ - done ) - -vendor: ## ensure all the go.mod/go.sum files are up-to-date - @echo "$(WHALE) $@" - @$(GO) mod tidy - @$(GO) mod verify - -verify-vendor: ## verify if all the go.mod/go.sum files are up-to-date - @echo "$(WHALE) $@" - @$(GO) mod tidy - @$(GO) mod verify - @test -z "$$(git status --short | grep "go.sum" | tee /dev/stderr)" || \ - ((git diff | cat) && \ - (echo "$(ONI) make sure to checkin changes after go mod tidy" && false)) - -help: ## this help - @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/PROTOCOL.md b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/PROTOCOL.md deleted file mode 100644 index 12b43f6bd6e3..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/PROTOCOL.md +++ /dev/null @@ -1,240 +0,0 @@ -# Protocol Specification - -The ttrpc protocol is client/server protocol to support multiple request streams -over a single connection with lightweight framing. The client represents the -process which initiated the underlying connection and the server is the process -which accepted the connection. The protocol is currently defined as -asymmetrical, with clients sending requests and servers sending responses. Both -clients and servers are able to send stream data. The roles are also used in -determining the stream identifiers, with client initiated streams using odd -number identifiers and server initiated using even number. The protocol may be -extended in the future to support server initiated streams, that is not -supported in the latest version. - -## Purpose - -The ttrpc protocol is designed to be lightweight and optimized for low latency -and reliable connections between processes on the same host. The protocol does -not include features for handling unreliable connections such as handshakes, -resets, pings, or flow control. The protocol is designed to make low-overhead -implementations as simple as possible. It is not intended as a suitable -replacement for HTTP2/3 over the network. - -## Message Frame - -Each Message Frame consists of a 10-byte message header followed -by message data. The data length and stream ID are both big-endian -4-byte unsigned integers. The message type is an unsigned 1-byte -integer. The flags are also an unsigned 1-byte integer and -use is defined by the message type. - - +---------------------------------------------------------------+ - | Data Length (32) | - +---------------------------------------------------------------+ - | Stream ID (32) | - +---------------+-----------------------------------------------+ - | Msg Type (8) | - +---------------+ - | Flags (8) | - +---------------+-----------------------------------------------+ - | Data (*) | - +---------------------------------------------------------------+ - -The Data Length field represents the number of bytes in the Data field. The -total frame size will always be Data Length + 10 bytes. The maximum data length -is 4MB and any larger size should be rejected. Due to the maximum data size -being less than 16MB, the first frame byte should always be zero. This first -byte should be considered reserved for future use. - -The Stream ID must be odd for client initiated streams and even for server -initiated streams. Server initiated streams are not currently supported. - -## Mesage Types - -| Message Type | Name | Description | -|--------------|----------|----------------------------------| -| 0x01 | Request | Initiates stream | -| 0x02 | Response | Final stream data and terminates | -| 0x03 | Data | Stream data | - -### Request - -The request message is used to initiate stream and send along request data for -properly routing and handling the stream. The stream may indicate unary without -any inbound or outbound stream data with only a response is expected on the -stream. The request may also indicate the stream is still open for more data and -no response is expected until data is finished. If the remote indicates the -stream is closed, the request may be considered non-unary but without anymore -stream data sent. In the case of `remote closed`, the remote still expects to -receive a response or stream data. For compatibility with non streaming clients, -a request with empty flags indicates a unary request. - -#### Request Flags - -| Flag | Name | Description | -|------|-----------------|--------------------------------------------------| -| 0x01 | `remote closed` | Non-unary, but no more data expected from remote | -| 0x02 | `remote open` | Non-unary, remote is still sending data | - -### Response - -The response message is used to end a stream with data, an empty response, or -an error. A response message is the only expected message after a unary request. -A non-unary request does not require a response message if the server is sending -back stream data. A non-unary stream may return a single response message but no -other stream data may follow. - -#### Response Flags - -No response flags are defined at this time, flags should be empty. - -### Data - -The data message is used to send data on an already initialized stream. Either -client or server may send data. A data message is not allowed on a unary stream. -A data message should not be sent after indicating `remote closed` to the peer. -The last data message on a stream must set the `remote closed` flag. - -The `no data` flag is used to indicate that the data message does not include -any data. This is normally used with the `remote closed` flag to indicate the -stream is now closed without transmitting any data. Since ttrpc normally -transmits a single object per message, a zero length data message may be -interpreted as an empty object. For example, transmitting the number zero as a -protobuf message ends up with a data length of zero, but the message is still -considered data and should be processed. - -#### Data Flags - -| Flag | Name | Description | -|------|-----------------|-----------------------------------| -| 0x01 | `remote closed` | No more data expected from remote | -| 0x04 | `no data` | This message does not have data | - -## Streaming - -All ttrpc requests use streams to transfer data. Unary streams will only have -two messages sent per stream, a request from a client and a response from the -server. Non-unary streams, however, may send any numbers of messages from the -client and the server. This makes stream management more complicated than unary -streams since both client and server need to track additional state. To keep -this management as simple as possible, ttrpc minimizes the number of states and -uses two flags instead of control frames. Each stream has two states while a -stream is still alive: `local closed` and `remote closed`. Each peer considers -local and remote from their own perspective and sets flags from the other peer's -perspective. For example, if a client sends a data frame with the -`remote closed` flag, that is indicating that the client is now `local closed` -and the server will be `remote closed`. A unary operation does not need to send -these flags since each received message always indicates `remote closed`. Once a -peer is both `local closed` and `remote closed`, the stream is considered -finished and may be cleaned up. - -Due to the asymmetric nature of the current protocol, a client should -always be in the `local closed` state before `remote closed` and a server should -always be in the `remote closed` state before `local closed`. This happens -because the client is always initiating requests and a client always expects a -final response back from a server to indicate the initiated request has been -fulfilled. This may mean server sends a final empty response to finish a stream -even after it has already completed sending data before the client. - -### Unary State Diagram - - +--------+ +--------+ - | Client | | Server | - +---+----+ +----+---+ - | +---------+ | - local >---------------+ Request +--------------------> remote - closed | +---------+ | closed - | | - | +----------+ | - finished <--------------+ Response +--------------------< finished - | +----------+ | - | | - -### Non-Unary State Diagrams - -RC: `remote closed` flag -RO: `remote open` flag - - +--------+ +--------+ - | Client | | Server | - +---+----+ +----+---+ - | +--------------+ | - >-------------+ Request [RO] +-----------------> - | +--------------+ | - | | - | +------+ | - >-----------------+ Data +---------------------> - | +------+ | - | | - | +-----------+ | - local >---------------+ Data [RC] +------------------> remote - closed | +-----------+ | closed - | | - | +----------+ | - finished <--------------+ Response +--------------------< finished - | +----------+ | - | | - - +--------+ +--------+ - | Client | | Server | - +---+----+ +----+---+ - | +--------------+ | - local >-------------+ Request [RC] +-----------------> remote - closed | +--------------+ | closed - | | - | +------+ | - <-----------------+ Data +---------------------< - | +------+ | - | | - | +-----------+ | - finished <---------------+ Data [RC] +------------------< finished - | +-----------+ | - | | - - +--------+ +--------+ - | Client | | Server | - +---+----+ +----+---+ - | +--------------+ | - >-------------+ Request [RO] +-----------------> - | +--------------+ | - | | - | +------+ | - >-----------------+ Data +---------------------> - | +------+ | - | | - | +------+ | - <-----------------+ Data +---------------------< - | +------+ | - | | - | +------+ | - >-----------------+ Data +---------------------> - | +------+ | - | | - | +-----------+ | - local >---------------+ Data [RC] +------------------> remote - closed | +-----------+ | closed - | | - | +------+ | - <-----------------+ Data +---------------------< - | +------+ | - | | - | +-----------+ | - finished <---------------+ Data [RC] +------------------< finished - | +-----------+ | - | | - -## RPC - -While this protocol is defined primarily to support Remote Procedure Calls, the -protocol does not define the request and response types beyond the messages -defined in the protocol. The implementation provides a default protobuf -definition of request and response which may be used for cross language rpc. -All implementations should at least define a request type which support -routing by procedure name and a response type which supports call status. - -## Version History - -| Version | Features | -|---------|---------------------| -| 1.0 | Unary requests only | -| 1.2 | Streaming support | diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/Protobuild.toml b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/Protobuild.toml deleted file mode 100644 index 0f6ccbd1e81a..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/Protobuild.toml +++ /dev/null @@ -1,28 +0,0 @@ -version = "2" -generators = ["go"] - -# Control protoc include paths. Below are usually some good defaults, but feel -# free to try it without them if it works for your project. -[includes] - # Include paths that will be added before all others. Typically, you want to - # treat the root of the project as an include, but this may not be necessary. - before = ["."] - - # Paths that will be added untouched to the end of the includes. We use - # `/usr/local/include` to pickup the common install location of protobuf. - # This is the default. - after = ["/usr/local/include"] - -# This section maps protobuf imports to Go packages. These will become -# `-M` directives in the call to the go protobuf generator. -[packages] - "google/protobuf/any.proto" = "github.com/gogo/protobuf/types" - "proto/status.proto" = "google.golang.org/genproto/googleapis/rpc/status" - -[[overrides]] -# enable ttrpc and disable fieldpath and grpc for the shim -prefixes = ["github.com/containerd/ttrpc/integration/streaming"] -generators = ["go", "go-ttrpc"] - -[overrides.parameters.go-ttrpc] -prefix = "TTRPC" diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/doc.go b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/doc.go deleted file mode 100644 index d80cd424cc8b..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 ttrpc defines and implements a low level simple transfer protocol -optimized for low latency and reliable connections between processes on the same -host. The protocol uses simple framing for sending requests, responses, and data -using multiple streams. -*/ -package ttrpc diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/errors.go b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/errors.go deleted file mode 100644 index ec14b7952bfb..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/errors.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 ttrpc - -import "errors" - -var ( - // ErrProtocol is a general error in the handling the protocol. - ErrProtocol = errors.New("protocol error") - - // ErrClosed is returned by client methods when the underlying connection is - // closed. - ErrClosed = errors.New("ttrpc: closed") - - // ErrServerClosed is returned when the Server has closed its connection. - ErrServerClosed = errors.New("ttrpc: server closed") - - // ErrStreamClosed is when the streaming connection is closed. - ErrStreamClosed = errors.New("ttrpc: stream closed") -) diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/request.pb.go b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/request.pb.go deleted file mode 100644 index 3921ae5a356c..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/request.pb.go +++ /dev/null @@ -1,396 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/ttrpc/request.proto - -package ttrpc - -import ( - status "google.golang.org/genproto/googleapis/rpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type Request struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - TimeoutNano int64 `protobuf:"varint,4,opt,name=timeout_nano,json=timeoutNano,proto3" json:"timeout_nano,omitempty"` - Metadata []*KeyValue `protobuf:"bytes,5,rep,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (x *Request) Reset() { - *x = Request{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Request) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Request) ProtoMessage() {} - -func (x *Request) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Request.ProtoReflect.Descriptor instead. -func (*Request) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{0} -} - -func (x *Request) GetService() string { - if x != nil { - return x.Service - } - return "" -} - -func (x *Request) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *Request) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -func (x *Request) GetTimeoutNano() int64 { - if x != nil { - return x.TimeoutNano - } - return 0 -} - -func (x *Request) GetMetadata() []*KeyValue { - if x != nil { - return x.Metadata - } - return nil -} - -type Response struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status *status.Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (x *Response) Reset() { - *x = Response{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Response) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Response) ProtoMessage() {} - -func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Response.ProtoReflect.Descriptor instead. -func (*Response) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{1} -} - -func (x *Response) GetStatus() *status.Status { - if x != nil { - return x.Status - } - return nil -} - -func (x *Response) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -type StringList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []string `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *StringList) Reset() { - *x = StringList{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StringList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StringList) ProtoMessage() {} - -func (x *StringList) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StringList.ProtoReflect.Descriptor instead. -func (*StringList) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{2} -} - -func (x *StringList) GetList() []string { - if x != nil { - return x.List - } - return nil -} - -type KeyValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *KeyValue) Reset() { - *x = KeyValue{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyValue) ProtoMessage() {} - -func (x *KeyValue) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_ttrpc_request_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KeyValue.ProtoReflect.Descriptor instead. -func (*KeyValue) Descriptor() ([]byte, []int) { - return file_github_com_containerd_ttrpc_request_proto_rawDescGZIP(), []int{3} -} - -func (x *KeyValue) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *KeyValue) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -var File_github_com_containerd_ttrpc_request_proto protoreflect.FileDescriptor - -var file_github_com_containerd_ttrpc_request_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x74, 0x72, - 0x70, 0x63, 0x1a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x21, - 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x4e, 0x61, 0x6e, - 0x6f, 0x12, 0x2b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x4b, 0x65, 0x79, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x45, - 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x20, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4c, - 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, - 0x6c, 0x75, 0x65, 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, 0x42, 0x1d, 0x5a, 0x1b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x74, 0x74, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_github_com_containerd_ttrpc_request_proto_rawDescOnce sync.Once - file_github_com_containerd_ttrpc_request_proto_rawDescData = file_github_com_containerd_ttrpc_request_proto_rawDesc -) - -func file_github_com_containerd_ttrpc_request_proto_rawDescGZIP() []byte { - file_github_com_containerd_ttrpc_request_proto_rawDescOnce.Do(func() { - file_github_com_containerd_ttrpc_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_ttrpc_request_proto_rawDescData) - }) - return file_github_com_containerd_ttrpc_request_proto_rawDescData -} - -var file_github_com_containerd_ttrpc_request_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_github_com_containerd_ttrpc_request_proto_goTypes = []interface{}{ - (*Request)(nil), // 0: ttrpc.Request - (*Response)(nil), // 1: ttrpc.Response - (*StringList)(nil), // 2: ttrpc.StringList - (*KeyValue)(nil), // 3: ttrpc.KeyValue - (*status.Status)(nil), // 4: Status -} -var file_github_com_containerd_ttrpc_request_proto_depIdxs = []int32{ - 3, // 0: ttrpc.Request.metadata:type_name -> ttrpc.KeyValue - 4, // 1: ttrpc.Response.status:type_name -> Status - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_ttrpc_request_proto_init() } -func file_github_com_containerd_ttrpc_request_proto_init() { - if File_github_com_containerd_ttrpc_request_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_ttrpc_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Request); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_ttrpc_request_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Response); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_ttrpc_request_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StringList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_ttrpc_request_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_ttrpc_request_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_ttrpc_request_proto_goTypes, - DependencyIndexes: file_github_com_containerd_ttrpc_request_proto_depIdxs, - MessageInfos: file_github_com_containerd_ttrpc_request_proto_msgTypes, - }.Build() - File_github_com_containerd_ttrpc_request_proto = out.File - file_github_com_containerd_ttrpc_request_proto_rawDesc = nil - file_github_com_containerd_ttrpc_request_proto_goTypes = nil - file_github_com_containerd_ttrpc_request_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/request.proto b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/request.proto deleted file mode 100644 index 37da334fc2a9..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/request.proto +++ /dev/null @@ -1,29 +0,0 @@ -syntax = "proto3"; - -package ttrpc; - -import "proto/status.proto"; - -option go_package = "github.com/containerd/ttrpc"; - -message Request { - string service = 1; - string method = 2; - bytes payload = 3; - int64 timeout_nano = 4; - repeated KeyValue metadata = 5; -} - -message Response { - Status status = 1; - bytes payload = 2; -} - -message StringList { - repeated string list = 1; -} - -message KeyValue { - string key = 1; - string value = 2; -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/stream.go b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/stream.go deleted file mode 100644 index 739a4c9675b7..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/stream.go +++ /dev/null @@ -1,84 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 ttrpc - -import ( - "context" - "sync" -) - -type streamID uint32 - -type streamMessage struct { - header messageHeader - payload []byte -} - -type stream struct { - id streamID - sender sender - recv chan *streamMessage - - closeOnce sync.Once - recvErr error - recvClose chan struct{} -} - -func newStream(id streamID, send sender) *stream { - return &stream{ - id: id, - sender: send, - recv: make(chan *streamMessage, 1), - recvClose: make(chan struct{}), - } -} - -func (s *stream) closeWithError(err error) error { - s.closeOnce.Do(func() { - if err != nil { - s.recvErr = err - } else { - s.recvErr = ErrClosed - } - close(s.recvClose) - }) - return nil -} - -func (s *stream) send(mt messageType, flags uint8, b []byte) error { - return s.sender.send(uint32(s.id), mt, flags, b) -} - -func (s *stream) receive(ctx context.Context, msg *streamMessage) error { - select { - case <-s.recvClose: - return s.recvErr - default: - } - select { - case <-s.recvClose: - return s.recvErr - case s.recv <- msg: - return nil - case <-ctx.Done(): - return ctx.Err() - } -} - -type sender interface { - send(uint32, messageType, uint8, []byte) error -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/stream_server.go b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/stream_server.go deleted file mode 100644 index b6d1ba720a43..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/stream_server.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 ttrpc - -type StreamServer interface { - SendMsg(m interface{}) error - RecvMsg(m interface{}) error -} diff --git a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/test.proto b/cluster-autoscaler/vendor/github.com/containerd/ttrpc/test.proto deleted file mode 100644 index 0e114d556886..000000000000 --- a/cluster-autoscaler/vendor/github.com/containerd/ttrpc/test.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package ttrpc; - -option go_package = "github.com/containerd/ttrpc/internal"; - -message TestPayload { - string foo = 1; - int64 deadline = 2; - string metadata = 3; -} - -message EchoPayload { - int64 seq = 1; - string msg = 2; -} diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/.gitattributes b/cluster-autoscaler/vendor/github.com/distribution/reference/.gitattributes deleted file mode 100644 index d207b1802b20..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go text eol=lf diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/.gitignore b/cluster-autoscaler/vendor/github.com/distribution/reference/.gitignore deleted file mode 100644 index dc07e6b04a0e..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Cover profiles -*.out diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/.golangci.yml b/cluster-autoscaler/vendor/github.com/distribution/reference/.golangci.yml deleted file mode 100644 index 793f0bb7ec39..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/.golangci.yml +++ /dev/null @@ -1,18 +0,0 @@ -linters: - enable: - - bodyclose - - dupword # Checks for duplicate words in the source code - - gofmt - - goimports - - ineffassign - - misspell - - revive - - staticcheck - - unconvert - - unused - - vet - disable: - - errcheck - -run: - deadline: 2m diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md b/cluster-autoscaler/vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md deleted file mode 100644 index 48f6704c6d35..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md +++ /dev/null @@ -1,5 +0,0 @@ -# Code of Conduct - -We follow the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). - -Please contact the [CNCF Code of Conduct Committee](mailto:conduct@cncf.io) in order to report violations of the Code of Conduct. diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/CONTRIBUTING.md b/cluster-autoscaler/vendor/github.com/distribution/reference/CONTRIBUTING.md deleted file mode 100644 index ab2194665653..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/CONTRIBUTING.md +++ /dev/null @@ -1,114 +0,0 @@ -# Contributing to the reference library - -## Community help - -If you need help, please ask in the [#distribution](https://cloud-native.slack.com/archives/C01GVR8SY4R) channel on CNCF community slack. -[Click here for an invite to the CNCF community slack](https://slack.cncf.io/) - -## Reporting security issues - -The maintainers take security seriously. If you discover a security -issue, please bring it to their attention right away! - -Please **DO NOT** file a public issue, instead send your report privately to -[cncf-distribution-security@lists.cncf.io](mailto:cncf-distribution-security@lists.cncf.io). - -## Reporting an issue properly - -By following these simple rules you will get better and faster feedback on your issue. - - - search the bugtracker for an already reported issue - -### If you found an issue that describes your problem: - - - please read other user comments first, and confirm this is the same issue: a given error condition might be indicative of different problems - you may also find a workaround in the comments - - please refrain from adding "same thing here" or "+1" comments - - you don't need to comment on an issue to get notified of updates: just hit the "subscribe" button - - comment if you have some new, technical and relevant information to add to the case - - __DO NOT__ comment on closed issues or merged PRs. If you think you have a related problem, open up a new issue and reference the PR or issue. - -### If you have not found an existing issue that describes your problem: - - 1. create a new issue, with a succinct title that describes your issue: - - bad title: "It doesn't work with my docker" - - good title: "Private registry push fail: 400 error with E_INVALID_DIGEST" - 2. copy the output of (or similar for other container tools): - - `docker version` - - `docker info` - - `docker exec registry --version` - 3. copy the command line you used to launch your Registry - 4. restart your docker daemon in debug mode (add `-D` to the daemon launch arguments) - 5. reproduce your problem and get your docker daemon logs showing the error - 6. if relevant, copy your registry logs that show the error - 7. provide any relevant detail about your specific Registry configuration (e.g., storage backend used) - 8. indicate if you are using an enterprise proxy, Nginx, or anything else between you and your Registry - -## Contributing Code - -Contributions should be made via pull requests. Pull requests will be reviewed -by one or more maintainers or reviewers and merged when acceptable. - -You should follow the basic GitHub workflow: - - 1. Use your own [fork](https://help.github.com/en/articles/about-forks) - 2. Create your [change](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes) - 3. Test your code - 4. [Commit](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#commit-messages) your work, always [sign your commits](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#commit-messages) - 5. Push your change to your fork and create a [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) - -Refer to [containerd's contribution guide](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes) -for tips on creating a successful contribution. - -## Sign your work - -The sign-off is a simple line at the end of the explanation for the patch. Your -signature certifies that you wrote the patch or otherwise have the right to pass -it on as an open-source patch. The rules are pretty simple: if you can certify -the below (from [developercertificate.org](http://developercertificate.org/)): - -``` -Developer Certificate of Origin -Version 1.1 - -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -Developer's Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. -``` - -Then you just add a line to every git commit message: - - Signed-off-by: Joe Smith - -Use your real name (sorry, no pseudonyms or anonymous contributions.) - -If you set your `user.name` and `user.email` git configs, you can sign your -commit automatically with `git commit -s`. diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/GOVERNANCE.md b/cluster-autoscaler/vendor/github.com/distribution/reference/GOVERNANCE.md deleted file mode 100644 index 200045b05091..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/GOVERNANCE.md +++ /dev/null @@ -1,144 +0,0 @@ -# distribution/reference Project Governance - -Distribution [Code of Conduct](./CODE-OF-CONDUCT.md) can be found here. - -For specific guidance on practical contribution steps please -see our [CONTRIBUTING.md](./CONTRIBUTING.md) guide. - -## Maintainership - -There are different types of maintainers, with different responsibilities, but -all maintainers have 3 things in common: - -1) They share responsibility in the project's success. -2) They have made a long-term, recurring time investment to improve the project. -3) They spend that time doing whatever needs to be done, not necessarily what -is the most interesting or fun. - -Maintainers are often under-appreciated, because their work is harder to appreciate. -It's easy to appreciate a really cool and technically advanced feature. It's harder -to appreciate the absence of bugs, the slow but steady improvement in stability, -or the reliability of a release process. But those things distinguish a good -project from a great one. - -## Reviewers - -A reviewer is a core role within the project. -They share in reviewing issues and pull requests and their LGTM counts towards the -required LGTM count to merge a code change into the project. - -Reviewers are part of the organization but do not have write access. -Becoming a reviewer is a core aspect in the journey to becoming a maintainer. - -## Adding maintainers - -Maintainers are first and foremost contributors that have shown they are -committed to the long term success of a project. Contributors wanting to become -maintainers are expected to be deeply involved in contributing code, pull -request review, and triage of issues in the project for more than three months. - -Just contributing does not make you a maintainer, it is about building trust -with the current maintainers of the project and being a person that they can -depend on and trust to make decisions in the best interest of the project. - -Periodically, the existing maintainers curate a list of contributors that have -shown regular activity on the project over the prior months. From this list, -maintainer candidates are selected and proposed in a pull request or a -maintainers communication channel. - -After a candidate has been announced to the maintainers, the existing -maintainers are given five business days to discuss the candidate, raise -objections and cast their vote. Votes may take place on the communication -channel or via pull request comment. Candidates must be approved by at least 66% -of the current maintainers by adding their vote on the mailing list. The -reviewer role has the same process but only requires 33% of current maintainers. -Only maintainers of the repository that the candidate is proposed for are -allowed to vote. - -If a candidate is approved, a maintainer will contact the candidate to invite -the candidate to open a pull request that adds the contributor to the -MAINTAINERS file. The voting process may take place inside a pull request if a -maintainer has already discussed the candidacy with the candidate and a -maintainer is willing to be a sponsor by opening the pull request. The candidate -becomes a maintainer once the pull request is merged. - -## Stepping down policy - -Life priorities, interests, and passions can change. If you're a maintainer but -feel you must remove yourself from the list, inform other maintainers that you -intend to step down, and if possible, help find someone to pick up your work. -At the very least, ensure your work can be continued where you left off. - -After you've informed other maintainers, create a pull request to remove -yourself from the MAINTAINERS file. - -## Removal of inactive maintainers - -Similar to the procedure for adding new maintainers, existing maintainers can -be removed from the list if they do not show significant activity on the -project. Periodically, the maintainers review the list of maintainers and their -activity over the last three months. - -If a maintainer has shown insufficient activity over this period, a neutral -person will contact the maintainer to ask if they want to continue being -a maintainer. If the maintainer decides to step down as a maintainer, they -open a pull request to be removed from the MAINTAINERS file. - -If the maintainer wants to remain a maintainer, but is unable to perform the -required duties they can be removed with a vote of at least 66% of the current -maintainers. In this case, maintainers should first propose the change to -maintainers via the maintainers communication channel, then open a pull request -for voting. The voting period is five business days. The voting pull request -should not come as a surpise to any maintainer and any discussion related to -performance must not be discussed on the pull request. - -## How are decisions made? - -Docker distribution is an open-source project with an open design philosophy. -This means that the repository is the source of truth for EVERY aspect of the -project, including its philosophy, design, road map, and APIs. *If it's part of -the project, it's in the repo. If it's in the repo, it's part of the project.* - -As a result, all decisions can be expressed as changes to the repository. An -implementation change is a change to the source code. An API change is a change -to the API specification. A philosophy change is a change to the philosophy -manifesto, and so on. - -All decisions affecting distribution, big and small, follow the same 3 steps: - -* Step 1: Open a pull request. Anyone can do this. - -* Step 2: Discuss the pull request. Anyone can do this. - -* Step 3: Merge or refuse the pull request. Who does this depends on the nature -of the pull request and which areas of the project it affects. - -## Helping contributors with the DCO - -The [DCO or `Sign your work`](./CONTRIBUTING.md#sign-your-work) -requirement is not intended as a roadblock or speed bump. - -Some contributors are not as familiar with `git`, or have used a web -based editor, and thus asking them to `git commit --amend -s` is not the best -way forward. - -In this case, maintainers can update the commits based on clause (c) of the DCO. -The most trivial way for a contributor to allow the maintainer to do this, is to -add a DCO signature in a pull requests's comment, or a maintainer can simply -note that the change is sufficiently trivial that it does not substantially -change the existing contribution - i.e., a spelling change. - -When you add someone's DCO, please also add your own to keep a log. - -## I'm a maintainer. Should I make pull requests too? - -Yes. Nobody should ever push to master directly. All changes should be -made through a pull request. - -## Conflict Resolution - -If you have a technical dispute that you feel has reached an impasse with a -subset of the community, any contributor may open an issue, specifically -calling for a resolution vote of the current core maintainers to resolve the -dispute. The same voting quorums required (2/3) for adding and removing -maintainers will apply to conflict resolution. diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/LICENSE b/cluster-autoscaler/vendor/github.com/distribution/reference/LICENSE deleted file mode 100644 index e06d2081865a..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/MAINTAINERS b/cluster-autoscaler/vendor/github.com/distribution/reference/MAINTAINERS deleted file mode 100644 index 9e0a60c8bdcb..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/MAINTAINERS +++ /dev/null @@ -1,26 +0,0 @@ -# Distribution project maintainers & reviewers -# -# See GOVERNANCE.md for maintainer versus reviewer roles -# -# MAINTAINERS (cncf-distribution-maintainers@lists.cncf.io) -# GitHub ID, Name, Email address -"chrispat","Chris Patterson","chrispat@github.com" -"clarkbw","Bryan Clark","clarkbw@github.com" -"corhere","Cory Snider","csnider@mirantis.com" -"deleteriousEffect","Hayley Swimelar","hswimelar@gitlab.com" -"heww","He Weiwei","hweiwei@vmware.com" -"joaodrp","João Pereira","jpereira@gitlab.com" -"justincormack","Justin Cormack","justin.cormack@docker.com" -"squizzi","Kyle Squizzato","ksquizzato@mirantis.com" -"milosgajdos","Milos Gajdos","milosthegajdos@gmail.com" -"sargun","Sargun Dhillon","sargun@sargun.me" -"wy65701436","Wang Yan","wangyan@vmware.com" -"stevelasker","Steve Lasker","steve.lasker@microsoft.com" -# -# REVIEWERS -# GitHub ID, Name, Email address -"dmcgowan","Derek McGowan","derek@mcgstyle.net" -"stevvooe","Stephen Day","stevvooe@gmail.com" -"thajeztah","Sebastiaan van Stijn","github@gone.nl" -"DavidSpek", "David van der Spek", "vanderspek.david@gmail.com" -"Jamstah", "James Hewitt", "james.hewitt@gmail.com" diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/Makefile b/cluster-autoscaler/vendor/github.com/distribution/reference/Makefile deleted file mode 100644 index c78576b75d0f..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Project packages. -PACKAGES=$(shell go list ./...) - -# Flags passed to `go test` -BUILDFLAGS ?= -TESTFLAGS ?= - -.PHONY: all build test coverage -.DEFAULT: all - -all: build - -build: ## no binaries to build, so just check compilation suceeds - go build ${BUILDFLAGS} ./... - -test: ## run tests - go test ${TESTFLAGS} ./... - -coverage: ## generate coverprofiles from the unit tests - rm -f coverage.txt - go test ${TESTFLAGS} -cover -coverprofile=cover.out ./... - -.PHONY: help -help: - @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_\/%-]+:.*?##/ { printf " \033[36m%-27s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/README.md b/cluster-autoscaler/vendor/github.com/distribution/reference/README.md deleted file mode 100644 index e2531e49c4f9..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# Distribution reference - -Go library to handle references to container images. - - - -[![Build Status](https://github.com/distribution/reference/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/distribution/reference/actions?query=workflow%3ACI) -[![GoDoc](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/distribution/reference) -[![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE) -[![codecov](https://codecov.io/gh/distribution/reference/branch/main/graph/badge.svg)](https://codecov.io/gh/distribution/reference) -[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fdistribution%2Freference?ref=badge_shield) - -This repository contains a library for handling refrences to container images held in container registries. Please see [godoc](https://pkg.go.dev/github.com/distribution/reference) for details. - -## Contribution - -Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute -issues, fixes, and patches to this project. - -## Communication - -For async communication and long running discussions please use issues and pull requests on the github repo. -This will be the best place to discuss design and implementation. - -For sync communication we have a #distribution channel in the [CNCF Slack](https://slack.cncf.io/) -that everyone is welcome to join and chat about development. - -## Licenses - -The distribution codebase is released under the [Apache 2.0 license](LICENSE). diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/SECURITY.md b/cluster-autoscaler/vendor/github.com/distribution/reference/SECURITY.md deleted file mode 100644 index aaf983c0f054..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/SECURITY.md +++ /dev/null @@ -1,7 +0,0 @@ -# Security Policy - -## Reporting a Vulnerability - -The maintainers take security seriously. If you discover a security issue, please bring it to their attention right away! - -Please DO NOT file a public issue, instead send your report privately to cncf-distribution-security@lists.cncf.io. diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/distribution-logo.svg b/cluster-autoscaler/vendor/github.com/distribution/reference/distribution-logo.svg deleted file mode 100644 index cc9f4073b9ba..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/distribution-logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/helpers.go b/cluster-autoscaler/vendor/github.com/distribution/reference/helpers.go deleted file mode 100644 index d10c7ef83878..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/helpers.go +++ /dev/null @@ -1,42 +0,0 @@ -package reference - -import "path" - -// IsNameOnly returns true if reference only contains a repo name. -func IsNameOnly(ref Named) bool { - if _, ok := ref.(NamedTagged); ok { - return false - } - if _, ok := ref.(Canonical); ok { - return false - } - return true -} - -// FamiliarName returns the familiar name string -// for the given named, familiarizing if needed. -func FamiliarName(ref Named) string { - if nn, ok := ref.(normalizedNamed); ok { - return nn.Familiar().Name() - } - return ref.Name() -} - -// FamiliarString returns the familiar string representation -// for the given reference, familiarizing if needed. -func FamiliarString(ref Reference) string { - if nn, ok := ref.(normalizedNamed); ok { - return nn.Familiar().String() - } - return ref.String() -} - -// FamiliarMatch reports whether ref matches the specified pattern. -// See [path.Match] for supported patterns. -func FamiliarMatch(pattern string, ref Reference) (bool, error) { - matched, err := path.Match(pattern, FamiliarString(ref)) - if namedRef, isNamed := ref.(Named); isNamed && !matched { - matched, _ = path.Match(pattern, FamiliarName(namedRef)) - } - return matched, err -} diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/normalize.go b/cluster-autoscaler/vendor/github.com/distribution/reference/normalize.go deleted file mode 100644 index a30229d01bb4..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/normalize.go +++ /dev/null @@ -1,224 +0,0 @@ -package reference - -import ( - "fmt" - "strings" - - "github.com/opencontainers/go-digest" -) - -const ( - // legacyDefaultDomain is the legacy domain for Docker Hub (which was - // originally named "the Docker Index"). This domain is still used for - // authentication and image search, which were part of the "v1" Docker - // registry specification. - // - // This domain will continue to be supported, but there are plans to consolidate - // legacy domains to new "canonical" domains. Once those domains are decided - // on, we must update the normalization functions, but preserve compatibility - // with existing installs, clients, and user configuration. - legacyDefaultDomain = "index.docker.io" - - // defaultDomain is the default domain used for images on Docker Hub. - // It is used to normalize "familiar" names to canonical names, for example, - // to convert "ubuntu" to "docker.io/library/ubuntu:latest". - // - // Note that actual domain of Docker Hub's registry is registry-1.docker.io. - // This domain will continue to be supported, but there are plans to consolidate - // legacy domains to new "canonical" domains. Once those domains are decided - // on, we must update the normalization functions, but preserve compatibility - // with existing installs, clients, and user configuration. - defaultDomain = "docker.io" - - // officialRepoPrefix is the namespace used for official images on Docker Hub. - // It is used to normalize "familiar" names to canonical names, for example, - // to convert "ubuntu" to "docker.io/library/ubuntu:latest". - officialRepoPrefix = "library/" - - // defaultTag is the default tag if no tag is provided. - defaultTag = "latest" -) - -// normalizedNamed represents a name which has been -// normalized and has a familiar form. A familiar name -// is what is used in Docker UI. An example normalized -// name is "docker.io/library/ubuntu" and corresponding -// familiar name of "ubuntu". -type normalizedNamed interface { - Named - Familiar() Named -} - -// ParseNormalizedNamed parses a string into a named reference -// transforming a familiar name from Docker UI to a fully -// qualified reference. If the value may be an identifier -// use ParseAnyReference. -func ParseNormalizedNamed(s string) (Named, error) { - if ok := anchoredIdentifierRegexp.MatchString(s); ok { - return nil, fmt.Errorf("invalid repository name (%s), cannot specify 64-byte hexadecimal strings", s) - } - domain, remainder := splitDockerDomain(s) - var remote string - if tagSep := strings.IndexRune(remainder, ':'); tagSep > -1 { - remote = remainder[:tagSep] - } else { - remote = remainder - } - if strings.ToLower(remote) != remote { - return nil, fmt.Errorf("invalid reference format: repository name (%s) must be lowercase", remote) - } - - ref, err := Parse(domain + "/" + remainder) - if err != nil { - return nil, err - } - named, isNamed := ref.(Named) - if !isNamed { - return nil, fmt.Errorf("reference %s has no name", ref.String()) - } - return named, nil -} - -// namedTaggedDigested is a reference that has both a tag and a digest. -type namedTaggedDigested interface { - NamedTagged - Digested -} - -// ParseDockerRef normalizes the image reference following the docker convention, -// which allows for references to contain both a tag and a digest. It returns a -// reference that is either tagged or digested. For references containing both -// a tag and a digest, it returns a digested reference. For example, the following -// reference: -// -// docker.io/library/busybox:latest@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa -// -// Is returned as a digested reference (with the ":latest" tag removed): -// -// docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa -// -// References that are already "tagged" or "digested" are returned unmodified: -// -// // Already a digested reference -// docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa -// -// // Already a named reference -// docker.io/library/busybox:latest -func ParseDockerRef(ref string) (Named, error) { - named, err := ParseNormalizedNamed(ref) - if err != nil { - return nil, err - } - if canonical, ok := named.(namedTaggedDigested); ok { - // The reference is both tagged and digested; only return digested. - newNamed, err := WithName(canonical.Name()) - if err != nil { - return nil, err - } - return WithDigest(newNamed, canonical.Digest()) - } - return TagNameOnly(named), nil -} - -// splitDockerDomain splits a repository name to domain and remote-name. -// If no valid domain is found, the default domain is used. Repository name -// needs to be already validated before. -func splitDockerDomain(name string) (domain, remainder string) { - i := strings.IndexRune(name, '/') - if i == -1 || (!strings.ContainsAny(name[:i], ".:") && name[:i] != localhost && strings.ToLower(name[:i]) == name[:i]) { - domain, remainder = defaultDomain, name - } else { - domain, remainder = name[:i], name[i+1:] - } - if domain == legacyDefaultDomain { - domain = defaultDomain - } - if domain == defaultDomain && !strings.ContainsRune(remainder, '/') { - remainder = officialRepoPrefix + remainder - } - return -} - -// familiarizeName returns a shortened version of the name familiar -// to the Docker UI. Familiar names have the default domain -// "docker.io" and "library/" repository prefix removed. -// For example, "docker.io/library/redis" will have the familiar -// name "redis" and "docker.io/dmcgowan/myapp" will be "dmcgowan/myapp". -// Returns a familiarized named only reference. -func familiarizeName(named namedRepository) repository { - repo := repository{ - domain: named.Domain(), - path: named.Path(), - } - - if repo.domain == defaultDomain { - repo.domain = "" - // Handle official repositories which have the pattern "library/" - if strings.HasPrefix(repo.path, officialRepoPrefix) { - // TODO(thaJeztah): this check may be too strict, as it assumes the - // "library/" namespace does not have nested namespaces. While this - // is true (currently), technically it would be possible for Docker - // Hub to use those (e.g. "library/distros/ubuntu:latest"). - // See https://github.com/distribution/distribution/pull/3769#issuecomment-1302031785. - if remainder := strings.TrimPrefix(repo.path, officialRepoPrefix); !strings.ContainsRune(remainder, '/') { - repo.path = remainder - } - } - } - return repo -} - -func (r reference) Familiar() Named { - return reference{ - namedRepository: familiarizeName(r.namedRepository), - tag: r.tag, - digest: r.digest, - } -} - -func (r repository) Familiar() Named { - return familiarizeName(r) -} - -func (t taggedReference) Familiar() Named { - return taggedReference{ - namedRepository: familiarizeName(t.namedRepository), - tag: t.tag, - } -} - -func (c canonicalReference) Familiar() Named { - return canonicalReference{ - namedRepository: familiarizeName(c.namedRepository), - digest: c.digest, - } -} - -// TagNameOnly adds the default tag "latest" to a reference if it only has -// a repo name. -func TagNameOnly(ref Named) Named { - if IsNameOnly(ref) { - namedTagged, err := WithTag(ref, defaultTag) - if err != nil { - // Default tag must be valid, to create a NamedTagged - // type with non-validated input the WithTag function - // should be used instead - panic(err) - } - return namedTagged - } - return ref -} - -// ParseAnyReference parses a reference string as a possible identifier, -// full digest, or familiar name. -func ParseAnyReference(ref string) (Reference, error) { - if ok := anchoredIdentifierRegexp.MatchString(ref); ok { - return digestReference("sha256:" + ref), nil - } - if dgst, err := digest.Parse(ref); err == nil { - return digestReference(dgst), nil - } - - return ParseNormalizedNamed(ref) -} diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/reference.go b/cluster-autoscaler/vendor/github.com/distribution/reference/reference.go deleted file mode 100644 index e98c44daa2a8..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/reference.go +++ /dev/null @@ -1,436 +0,0 @@ -// Package reference provides a general type to represent any way of referencing images within the registry. -// Its main purpose is to abstract tags and digests (content-addressable hash). -// -// Grammar -// -// reference := name [ ":" tag ] [ "@" digest ] -// name := [domain '/'] remote-name -// domain := host [':' port-number] -// host := domain-name | IPv4address | \[ IPv6address \] ; rfc3986 appendix-A -// domain-name := domain-component ['.' domain-component]* -// domain-component := /([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])/ -// port-number := /[0-9]+/ -// path-component := alpha-numeric [separator alpha-numeric]* -// path (or "remote-name") := path-component ['/' path-component]* -// alpha-numeric := /[a-z0-9]+/ -// separator := /[_.]|__|[-]*/ -// -// tag := /[\w][\w.-]{0,127}/ -// -// digest := digest-algorithm ":" digest-hex -// digest-algorithm := digest-algorithm-component [ digest-algorithm-separator digest-algorithm-component ]* -// digest-algorithm-separator := /[+.-_]/ -// digest-algorithm-component := /[A-Za-z][A-Za-z0-9]*/ -// digest-hex := /[0-9a-fA-F]{32,}/ ; At least 128 bit digest value -// -// identifier := /[a-f0-9]{64}/ -package reference - -import ( - "errors" - "fmt" - "strings" - - "github.com/opencontainers/go-digest" -) - -const ( - // NameTotalLengthMax is the maximum total number of characters in a repository name. - NameTotalLengthMax = 255 -) - -var ( - // ErrReferenceInvalidFormat represents an error while trying to parse a string as a reference. - ErrReferenceInvalidFormat = errors.New("invalid reference format") - - // ErrTagInvalidFormat represents an error while trying to parse a string as a tag. - ErrTagInvalidFormat = errors.New("invalid tag format") - - // ErrDigestInvalidFormat represents an error while trying to parse a string as a tag. - ErrDigestInvalidFormat = errors.New("invalid digest format") - - // ErrNameContainsUppercase is returned for invalid repository names that contain uppercase characters. - ErrNameContainsUppercase = errors.New("repository name must be lowercase") - - // ErrNameEmpty is returned for empty, invalid repository names. - ErrNameEmpty = errors.New("repository name must have at least one component") - - // ErrNameTooLong is returned when a repository name is longer than NameTotalLengthMax. - ErrNameTooLong = fmt.Errorf("repository name must not be more than %v characters", NameTotalLengthMax) - - // ErrNameNotCanonical is returned when a name is not canonical. - ErrNameNotCanonical = errors.New("repository name must be canonical") -) - -// Reference is an opaque object reference identifier that may include -// modifiers such as a hostname, name, tag, and digest. -type Reference interface { - // String returns the full reference - String() string -} - -// Field provides a wrapper type for resolving correct reference types when -// working with encoding. -type Field struct { - reference Reference -} - -// AsField wraps a reference in a Field for encoding. -func AsField(reference Reference) Field { - return Field{reference} -} - -// Reference unwraps the reference type from the field to -// return the Reference object. This object should be -// of the appropriate type to further check for different -// reference types. -func (f Field) Reference() Reference { - return f.reference -} - -// MarshalText serializes the field to byte text which -// is the string of the reference. -func (f Field) MarshalText() (p []byte, err error) { - return []byte(f.reference.String()), nil -} - -// UnmarshalText parses text bytes by invoking the -// reference parser to ensure the appropriately -// typed reference object is wrapped by field. -func (f *Field) UnmarshalText(p []byte) error { - r, err := Parse(string(p)) - if err != nil { - return err - } - - f.reference = r - return nil -} - -// Named is an object with a full name -type Named interface { - Reference - Name() string -} - -// Tagged is an object which has a tag -type Tagged interface { - Reference - Tag() string -} - -// NamedTagged is an object including a name and tag. -type NamedTagged interface { - Named - Tag() string -} - -// Digested is an object which has a digest -// in which it can be referenced by -type Digested interface { - Reference - Digest() digest.Digest -} - -// Canonical reference is an object with a fully unique -// name including a name with domain and digest -type Canonical interface { - Named - Digest() digest.Digest -} - -// namedRepository is a reference to a repository with a name. -// A namedRepository has both domain and path components. -type namedRepository interface { - Named - Domain() string - Path() string -} - -// Domain returns the domain part of the [Named] reference. -func Domain(named Named) string { - if r, ok := named.(namedRepository); ok { - return r.Domain() - } - domain, _ := splitDomain(named.Name()) - return domain -} - -// Path returns the name without the domain part of the [Named] reference. -func Path(named Named) (name string) { - if r, ok := named.(namedRepository); ok { - return r.Path() - } - _, path := splitDomain(named.Name()) - return path -} - -func splitDomain(name string) (string, string) { - match := anchoredNameRegexp.FindStringSubmatch(name) - if len(match) != 3 { - return "", name - } - return match[1], match[2] -} - -// SplitHostname splits a named reference into a -// hostname and name string. If no valid hostname is -// found, the hostname is empty and the full value -// is returned as name -// -// Deprecated: Use [Domain] or [Path]. -func SplitHostname(named Named) (string, string) { - if r, ok := named.(namedRepository); ok { - return r.Domain(), r.Path() - } - return splitDomain(named.Name()) -} - -// Parse parses s and returns a syntactically valid Reference. -// If an error was encountered it is returned, along with a nil Reference. -func Parse(s string) (Reference, error) { - matches := ReferenceRegexp.FindStringSubmatch(s) - if matches == nil { - if s == "" { - return nil, ErrNameEmpty - } - if ReferenceRegexp.FindStringSubmatch(strings.ToLower(s)) != nil { - return nil, ErrNameContainsUppercase - } - return nil, ErrReferenceInvalidFormat - } - - if len(matches[1]) > NameTotalLengthMax { - return nil, ErrNameTooLong - } - - var repo repository - - nameMatch := anchoredNameRegexp.FindStringSubmatch(matches[1]) - if len(nameMatch) == 3 { - repo.domain = nameMatch[1] - repo.path = nameMatch[2] - } else { - repo.domain = "" - repo.path = matches[1] - } - - ref := reference{ - namedRepository: repo, - tag: matches[2], - } - if matches[3] != "" { - var err error - ref.digest, err = digest.Parse(matches[3]) - if err != nil { - return nil, err - } - } - - r := getBestReferenceType(ref) - if r == nil { - return nil, ErrNameEmpty - } - - return r, nil -} - -// ParseNamed parses s and returns a syntactically valid reference implementing -// the Named interface. The reference must have a name and be in the canonical -// form, otherwise an error is returned. -// If an error was encountered it is returned, along with a nil Reference. -func ParseNamed(s string) (Named, error) { - named, err := ParseNormalizedNamed(s) - if err != nil { - return nil, err - } - if named.String() != s { - return nil, ErrNameNotCanonical - } - return named, nil -} - -// WithName returns a named object representing the given string. If the input -// is invalid ErrReferenceInvalidFormat will be returned. -func WithName(name string) (Named, error) { - if len(name) > NameTotalLengthMax { - return nil, ErrNameTooLong - } - - match := anchoredNameRegexp.FindStringSubmatch(name) - if match == nil || len(match) != 3 { - return nil, ErrReferenceInvalidFormat - } - return repository{ - domain: match[1], - path: match[2], - }, nil -} - -// WithTag combines the name from "name" and the tag from "tag" to form a -// reference incorporating both the name and the tag. -func WithTag(name Named, tag string) (NamedTagged, error) { - if !anchoredTagRegexp.MatchString(tag) { - return nil, ErrTagInvalidFormat - } - var repo repository - if r, ok := name.(namedRepository); ok { - repo.domain = r.Domain() - repo.path = r.Path() - } else { - repo.path = name.Name() - } - if canonical, ok := name.(Canonical); ok { - return reference{ - namedRepository: repo, - tag: tag, - digest: canonical.Digest(), - }, nil - } - return taggedReference{ - namedRepository: repo, - tag: tag, - }, nil -} - -// WithDigest combines the name from "name" and the digest from "digest" to form -// a reference incorporating both the name and the digest. -func WithDigest(name Named, digest digest.Digest) (Canonical, error) { - if !anchoredDigestRegexp.MatchString(digest.String()) { - return nil, ErrDigestInvalidFormat - } - var repo repository - if r, ok := name.(namedRepository); ok { - repo.domain = r.Domain() - repo.path = r.Path() - } else { - repo.path = name.Name() - } - if tagged, ok := name.(Tagged); ok { - return reference{ - namedRepository: repo, - tag: tagged.Tag(), - digest: digest, - }, nil - } - return canonicalReference{ - namedRepository: repo, - digest: digest, - }, nil -} - -// TrimNamed removes any tag or digest from the named reference. -func TrimNamed(ref Named) Named { - repo := repository{} - if r, ok := ref.(namedRepository); ok { - repo.domain, repo.path = r.Domain(), r.Path() - } else { - repo.domain, repo.path = splitDomain(ref.Name()) - } - return repo -} - -func getBestReferenceType(ref reference) Reference { - if ref.Name() == "" { - // Allow digest only references - if ref.digest != "" { - return digestReference(ref.digest) - } - return nil - } - if ref.tag == "" { - if ref.digest != "" { - return canonicalReference{ - namedRepository: ref.namedRepository, - digest: ref.digest, - } - } - return ref.namedRepository - } - if ref.digest == "" { - return taggedReference{ - namedRepository: ref.namedRepository, - tag: ref.tag, - } - } - - return ref -} - -type reference struct { - namedRepository - tag string - digest digest.Digest -} - -func (r reference) String() string { - return r.Name() + ":" + r.tag + "@" + r.digest.String() -} - -func (r reference) Tag() string { - return r.tag -} - -func (r reference) Digest() digest.Digest { - return r.digest -} - -type repository struct { - domain string - path string -} - -func (r repository) String() string { - return r.Name() -} - -func (r repository) Name() string { - if r.domain == "" { - return r.path - } - return r.domain + "/" + r.path -} - -func (r repository) Domain() string { - return r.domain -} - -func (r repository) Path() string { - return r.path -} - -type digestReference digest.Digest - -func (d digestReference) String() string { - return digest.Digest(d).String() -} - -func (d digestReference) Digest() digest.Digest { - return digest.Digest(d) -} - -type taggedReference struct { - namedRepository - tag string -} - -func (t taggedReference) String() string { - return t.Name() + ":" + t.tag -} - -func (t taggedReference) Tag() string { - return t.tag -} - -type canonicalReference struct { - namedRepository - digest digest.Digest -} - -func (c canonicalReference) String() string { - return c.Name() + "@" + c.digest.String() -} - -func (c canonicalReference) Digest() digest.Digest { - return c.digest -} diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/regexp.go b/cluster-autoscaler/vendor/github.com/distribution/reference/regexp.go deleted file mode 100644 index 65bc49d79be2..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/regexp.go +++ /dev/null @@ -1,163 +0,0 @@ -package reference - -import ( - "regexp" - "strings" -) - -// DigestRegexp matches well-formed digests, including algorithm (e.g. "sha256:"). -var DigestRegexp = regexp.MustCompile(digestPat) - -// DomainRegexp matches hostname or IP-addresses, optionally including a port -// number. It defines the structure of potential domain components that may be -// part of image names. This is purposely a subset of what is allowed by DNS to -// ensure backwards compatibility with Docker image names. It may be a subset of -// DNS domain name, an IPv4 address in decimal format, or an IPv6 address between -// square brackets (excluding zone identifiers as defined by [RFC 6874] or special -// addresses such as IPv4-Mapped). -// -// [RFC 6874]: https://www.rfc-editor.org/rfc/rfc6874. -var DomainRegexp = regexp.MustCompile(domainAndPort) - -// IdentifierRegexp is the format for string identifier used as a -// content addressable identifier using sha256. These identifiers -// are like digests without the algorithm, since sha256 is used. -var IdentifierRegexp = regexp.MustCompile(identifier) - -// NameRegexp is the format for the name component of references, including -// an optional domain and port, but without tag or digest suffix. -var NameRegexp = regexp.MustCompile(namePat) - -// ReferenceRegexp is the full supported format of a reference. The regexp -// is anchored and has capturing groups for name, tag, and digest -// components. -var ReferenceRegexp = regexp.MustCompile(referencePat) - -// TagRegexp matches valid tag names. From [docker/docker:graph/tags.go]. -// -// [docker/docker:graph/tags.go]: https://github.com/moby/moby/blob/v1.6.0/graph/tags.go#L26-L28 -var TagRegexp = regexp.MustCompile(tag) - -const ( - // alphanumeric defines the alphanumeric atom, typically a - // component of names. This only allows lower case characters and digits. - alphanumeric = `[a-z0-9]+` - - // separator defines the separators allowed to be embedded in name - // components. This allows one period, one or two underscore and multiple - // dashes. Repeated dashes and underscores are intentionally treated - // differently. In order to support valid hostnames as name components, - // supporting repeated dash was added. Additionally double underscore is - // now allowed as a separator to loosen the restriction for previously - // supported names. - separator = `(?:[._]|__|[-]+)` - - // localhost is treated as a special value for domain-name. Any other - // domain-name without a "." or a ":port" are considered a path component. - localhost = `localhost` - - // domainNameComponent restricts the registry domain component of a - // repository name to start with a component as defined by DomainRegexp. - domainNameComponent = `(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])` - - // optionalPort matches an optional port-number including the port separator - // (e.g. ":80"). - optionalPort = `(?::[0-9]+)?` - - // tag matches valid tag names. From docker/docker:graph/tags.go. - tag = `[\w][\w.-]{0,127}` - - // digestPat matches well-formed digests, including algorithm (e.g. "sha256:"). - // - // TODO(thaJeztah): this should follow the same rules as https://pkg.go.dev/github.com/opencontainers/go-digest@v1.0.0#DigestRegexp - // so that go-digest defines the canonical format. Note that the go-digest is - // more relaxed: - // - it allows multiple algorithms (e.g. "sha256+b64:") to allow - // future expansion of supported algorithms. - // - it allows the "" value to use urlsafe base64 encoding as defined - // in [rfc4648, section 5]. - // - // [rfc4648, section 5]: https://www.rfc-editor.org/rfc/rfc4648#section-5. - digestPat = `[A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}` - - // identifier is the format for a content addressable identifier using sha256. - // These identifiers are like digests without the algorithm, since sha256 is used. - identifier = `([a-f0-9]{64})` - - // ipv6address are enclosed between square brackets and may be represented - // in many ways, see rfc5952. Only IPv6 in compressed or uncompressed format - // are allowed, IPv6 zone identifiers (rfc6874) or Special addresses such as - // IPv4-Mapped are deliberately excluded. - ipv6address = `\[(?:[a-fA-F0-9:]+)\]` -) - -var ( - // domainName defines the structure of potential domain components - // that may be part of image names. This is purposely a subset of what is - // allowed by DNS to ensure backwards compatibility with Docker image - // names. This includes IPv4 addresses on decimal format. - domainName = domainNameComponent + anyTimes(`\.`+domainNameComponent) - - // host defines the structure of potential domains based on the URI - // Host subcomponent on rfc3986. It may be a subset of DNS domain name, - // or an IPv4 address in decimal format, or an IPv6 address between square - // brackets (excluding zone identifiers as defined by rfc6874 or special - // addresses such as IPv4-Mapped). - host = `(?:` + domainName + `|` + ipv6address + `)` - - // allowed by the URI Host subcomponent on rfc3986 to ensure backwards - // compatibility with Docker image names. - domainAndPort = host + optionalPort - - // anchoredTagRegexp matches valid tag names, anchored at the start and - // end of the matched string. - anchoredTagRegexp = regexp.MustCompile(anchored(tag)) - - // anchoredDigestRegexp matches valid digests, anchored at the start and - // end of the matched string. - anchoredDigestRegexp = regexp.MustCompile(anchored(digestPat)) - - // pathComponent restricts path-components to start with an alphanumeric - // character, with following parts able to be separated by a separator - // (one period, one or two underscore and multiple dashes). - pathComponent = alphanumeric + anyTimes(separator+alphanumeric) - - // remoteName matches the remote-name of a repository. It consists of one - // or more forward slash (/) delimited path-components: - // - // pathComponent[[/pathComponent] ...] // e.g., "library/ubuntu" - remoteName = pathComponent + anyTimes(`/`+pathComponent) - namePat = optional(domainAndPort+`/`) + remoteName - - // anchoredNameRegexp is used to parse a name value, capturing the - // domain and trailing components. - anchoredNameRegexp = regexp.MustCompile(anchored(optional(capture(domainAndPort), `/`), capture(remoteName))) - - referencePat = anchored(capture(namePat), optional(`:`, capture(tag)), optional(`@`, capture(digestPat))) - - // anchoredIdentifierRegexp is used to check or match an - // identifier value, anchored at start and end of string. - anchoredIdentifierRegexp = regexp.MustCompile(anchored(identifier)) -) - -// optional wraps the expression in a non-capturing group and makes the -// production optional. -func optional(res ...string) string { - return `(?:` + strings.Join(res, "") + `)?` -} - -// anyTimes wraps the expression in a non-capturing group that can occur -// any number of times. -func anyTimes(res ...string) string { - return `(?:` + strings.Join(res, "") + `)*` -} - -// capture wraps the expression in a capturing group. -func capture(res ...string) string { - return `(` + strings.Join(res, "") + `)` -} - -// anchored anchors the regular expression by adding start and end delimiters. -func anchored(res ...string) string { - return `^` + strings.Join(res, "") + `$` -} diff --git a/cluster-autoscaler/vendor/github.com/distribution/reference/sort.go b/cluster-autoscaler/vendor/github.com/distribution/reference/sort.go deleted file mode 100644 index 416c37b076fd..000000000000 --- a/cluster-autoscaler/vendor/github.com/distribution/reference/sort.go +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT 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 reference - -import ( - "sort" -) - -// Sort sorts string references preferring higher information references. -// -// The precedence is as follows: -// -// 1. [Named] + [Tagged] + [Digested] (e.g., "docker.io/library/busybox:latest@sha256:") -// 2. [Named] + [Tagged] (e.g., "docker.io/library/busybox:latest") -// 3. [Named] + [Digested] (e.g., "docker.io/library/busybo@sha256:") -// 4. [Named] (e.g., "docker.io/library/busybox") -// 5. [Digested] (e.g., "docker.io@sha256:") -// 6. Parse error -func Sort(references []string) []string { - var prefs []Reference - var bad []string - - for _, ref := range references { - pref, err := ParseAnyReference(ref) - if err != nil { - bad = append(bad, ref) - } else { - prefs = append(prefs, pref) - } - } - sort.Slice(prefs, func(a, b int) bool { - ar := refRank(prefs[a]) - br := refRank(prefs[b]) - if ar == br { - return prefs[a].String() < prefs[b].String() - } - return ar < br - }) - sort.Strings(bad) - var refs []string - for _, pref := range prefs { - refs = append(refs, pref.String()) - } - return append(refs, bad...) -} - -func refRank(ref Reference) uint8 { - if _, ok := ref.(Named); ok { - if _, ok = ref.(Tagged); ok { - if _, ok = ref.(Digested); ok { - return 1 - } - return 2 - } - if _, ok = ref.(Digested); ok { - return 3 - } - return 4 - } - return 5 -} diff --git a/cluster-autoscaler/vendor/github.com/fsnotify/fsnotify/.cirrus.yml b/cluster-autoscaler/vendor/github.com/fsnotify/fsnotify/.cirrus.yml deleted file mode 100644 index ffc7b992b3c7..000000000000 --- a/cluster-autoscaler/vendor/github.com/fsnotify/fsnotify/.cirrus.yml +++ /dev/null @@ -1,13 +0,0 @@ -freebsd_task: - name: 'FreeBSD' - freebsd_instance: - image_family: freebsd-13-2 - install_script: - - pkg update -f - - pkg install -y go - test_script: - # run tests as user "cirrus" instead of root - - pw useradd cirrus -m - - chown -R cirrus:cirrus . - - FSNOTIFY_BUFFER=4096 sudo --preserve-env=FSNOTIFY_BUFFER -u cirrus go test -parallel 1 -race ./... - - sudo --preserve-env=FSNOTIFY_BUFFER -u cirrus go test -parallel 1 -race ./... diff --git a/cluster-autoscaler/vendor/github.com/go-logr/logr/SECURITY.md b/cluster-autoscaler/vendor/github.com/go-logr/logr/SECURITY.md deleted file mode 100644 index 1ca756fc7b36..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-logr/logr/SECURITY.md +++ /dev/null @@ -1,18 +0,0 @@ -# Security Policy - -If you have discovered a security vulnerability in this project, please report it -privately. **Do not disclose it as a public issue.** This gives us time to work with you -to fix the issue before public exposure, reducing the chance that the exploit will be -used before a patch is released. - -You may submit the report in the following ways: - -- send an email to go-logr-security@googlegroups.com -- send us a [private vulnerability report](https://github.com/go-logr/logr/security/advisories/new) - -Please provide the following information in your report: - -- A description of the vulnerability and its impact -- How to reproduce the issue - -We ask that you give us 90 days to work on a fix before public exposure. diff --git a/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/sloghandler.go b/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/sloghandler.go deleted file mode 100644 index ec6725ce2cdb..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/sloghandler.go +++ /dev/null @@ -1,168 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 slogr - -import ( - "context" - "log/slog" - - "github.com/go-logr/logr" -) - -type slogHandler struct { - // May be nil, in which case all logs get discarded. - sink logr.LogSink - // Non-nil if sink is non-nil and implements SlogSink. - slogSink SlogSink - - // groupPrefix collects values from WithGroup calls. It gets added as - // prefix to value keys when handling a log record. - groupPrefix string - - // levelBias can be set when constructing the handler to influence the - // slog.Level of log records. A positive levelBias reduces the - // slog.Level value. slog has no API to influence this value after the - // handler got created, so it can only be set indirectly through - // Logger.V. - levelBias slog.Level -} - -var _ slog.Handler = &slogHandler{} - -// groupSeparator is used to concatenate WithGroup names and attribute keys. -const groupSeparator = "." - -// GetLevel is used for black box unit testing. -func (l *slogHandler) GetLevel() slog.Level { - return l.levelBias -} - -func (l *slogHandler) Enabled(ctx context.Context, level slog.Level) bool { - return l.sink != nil && (level >= slog.LevelError || l.sink.Enabled(l.levelFromSlog(level))) -} - -func (l *slogHandler) Handle(ctx context.Context, record slog.Record) error { - if l.slogSink != nil { - // Only adjust verbosity level of log entries < slog.LevelError. - if record.Level < slog.LevelError { - record.Level -= l.levelBias - } - return l.slogSink.Handle(ctx, record) - } - - // No need to check for nil sink here because Handle will only be called - // when Enabled returned true. - - kvList := make([]any, 0, 2*record.NumAttrs()) - record.Attrs(func(attr slog.Attr) bool { - if attr.Key != "" { - kvList = append(kvList, l.addGroupPrefix(attr.Key), attr.Value.Resolve().Any()) - } - return true - }) - if record.Level >= slog.LevelError { - l.sinkWithCallDepth().Error(nil, record.Message, kvList...) - } else { - level := l.levelFromSlog(record.Level) - l.sinkWithCallDepth().Info(level, record.Message, kvList...) - } - return nil -} - -// sinkWithCallDepth adjusts the stack unwinding so that when Error or Info -// are called by Handle, code in slog gets skipped. -// -// This offset currently (Go 1.21.0) works for calls through -// slog.New(NewSlogHandler(...)). There's no guarantee that the call -// chain won't change. Wrapping the handler will also break unwinding. It's -// still better than not adjusting at all.... -// -// This cannot be done when constructing the handler because NewLogr needs -// access to the original sink without this adjustment. A second copy would -// work, but then WithAttrs would have to be called for both of them. -func (l *slogHandler) sinkWithCallDepth() logr.LogSink { - if sink, ok := l.sink.(logr.CallDepthLogSink); ok { - return sink.WithCallDepth(2) - } - return l.sink -} - -func (l *slogHandler) WithAttrs(attrs []slog.Attr) slog.Handler { - if l.sink == nil || len(attrs) == 0 { - return l - } - - copy := *l - if l.slogSink != nil { - copy.slogSink = l.slogSink.WithAttrs(attrs) - copy.sink = copy.slogSink - } else { - kvList := make([]any, 0, 2*len(attrs)) - for _, attr := range attrs { - if attr.Key != "" { - kvList = append(kvList, l.addGroupPrefix(attr.Key), attr.Value.Resolve().Any()) - } - } - copy.sink = l.sink.WithValues(kvList...) - } - return © -} - -func (l *slogHandler) WithGroup(name string) slog.Handler { - if l.sink == nil { - return l - } - copy := *l - if l.slogSink != nil { - copy.slogSink = l.slogSink.WithGroup(name) - copy.sink = l.slogSink - } else { - copy.groupPrefix = copy.addGroupPrefix(name) - } - return © -} - -func (l *slogHandler) addGroupPrefix(name string) string { - if l.groupPrefix == "" { - return name - } - return l.groupPrefix + groupSeparator + name -} - -// levelFromSlog adjusts the level by the logger's verbosity and negates it. -// It ensures that the result is >= 0. This is necessary because the result is -// passed to a logr.LogSink and that API did not historically document whether -// levels could be negative or what that meant. -// -// Some example usage: -// logrV0 := getMyLogger() -// logrV2 := logrV0.V(2) -// slogV2 := slog.New(slogr.NewSlogHandler(logrV2)) -// slogV2.Debug("msg") // =~ logrV2.V(4) =~ logrV0.V(6) -// slogV2.Info("msg") // =~ logrV2.V(0) =~ logrV0.V(2) -// slogv2.Warn("msg") // =~ logrV2.V(-4) =~ logrV0.V(0) -func (l *slogHandler) levelFromSlog(level slog.Level) int { - result := -level - result += l.levelBias // in case the original logr.Logger had a V level - if result < 0 { - result = 0 // because logr.LogSink doesn't expect negative V levels - } - return int(result) -} diff --git a/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/slogr.go b/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/slogr.go deleted file mode 100644 index eb519ae23f85..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/slogr.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 slogr enables usage of a slog.Handler with logr.Logger as front-end -// API and of a logr.LogSink through the slog.Handler and thus slog.Logger -// APIs. -// -// See the README in the top-level [./logr] package for a discussion of -// interoperability. -package slogr - -import ( - "context" - "log/slog" - - "github.com/go-logr/logr" -) - -// NewLogr returns a logr.Logger which writes to the slog.Handler. -// -// The logr verbosity level is mapped to slog levels such that V(0) becomes -// slog.LevelInfo and V(4) becomes slog.LevelDebug. -func NewLogr(handler slog.Handler) logr.Logger { - if handler, ok := handler.(*slogHandler); ok { - if handler.sink == nil { - return logr.Discard() - } - return logr.New(handler.sink).V(int(handler.levelBias)) - } - return logr.New(&slogSink{handler: handler}) -} - -// NewSlogHandler returns a slog.Handler which writes to the same sink as the logr.Logger. -// -// The returned logger writes all records with level >= slog.LevelError as -// error log entries with LogSink.Error, regardless of the verbosity level of -// the logr.Logger: -// -// logger := -// slog.New(NewSlogHandler(logger.V(10))).Error(...) -> logSink.Error(...) -// -// The level of all other records gets reduced by the verbosity -// level of the logr.Logger and the result is negated. If it happens -// to be negative, then it gets replaced by zero because a LogSink -// is not expected to handled negative levels: -// -// slog.New(NewSlogHandler(logger)).Debug(...) -> logger.GetSink().Info(level=4, ...) -// slog.New(NewSlogHandler(logger)).Warning(...) -> logger.GetSink().Info(level=0, ...) -// slog.New(NewSlogHandler(logger)).Info(...) -> logger.GetSink().Info(level=0, ...) -// slog.New(NewSlogHandler(logger.V(4))).Info(...) -> logger.GetSink().Info(level=4, ...) -func NewSlogHandler(logger logr.Logger) slog.Handler { - if sink, ok := logger.GetSink().(*slogSink); ok && logger.GetV() == 0 { - return sink.handler - } - - handler := &slogHandler{sink: logger.GetSink(), levelBias: slog.Level(logger.GetV())} - if slogSink, ok := handler.sink.(SlogSink); ok { - handler.slogSink = slogSink - } - return handler -} - -// SlogSink is an optional interface that a LogSink can implement to support -// logging through the slog.Logger or slog.Handler APIs better. It then should -// also support special slog values like slog.Group. When used as a -// slog.Handler, the advantages are: -// -// - stack unwinding gets avoided in favor of logging the pre-recorded PC, -// as intended by slog -// - proper grouping of key/value pairs via WithGroup -// - verbosity levels > slog.LevelInfo can be recorded -// - less overhead -// -// Both APIs (logr.Logger and slog.Logger/Handler) then are supported equally -// well. Developers can pick whatever API suits them better and/or mix -// packages which use either API in the same binary with a common logging -// implementation. -// -// This interface is necessary because the type implementing the LogSink -// interface cannot also implement the slog.Handler interface due to the -// different prototype of the common Enabled method. -// -// An implementation could support both interfaces in two different types, but then -// additional interfaces would be needed to convert between those types in NewLogr -// and NewSlogHandler. -type SlogSink interface { - logr.LogSink - - Handle(ctx context.Context, record slog.Record) error - WithAttrs(attrs []slog.Attr) SlogSink - WithGroup(name string) SlogSink -} diff --git a/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/slogsink.go b/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/slogsink.go deleted file mode 100644 index 6fbac561d98b..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-logr/logr/slogr/slogsink.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 slogr - -import ( - "context" - "log/slog" - "runtime" - "time" - - "github.com/go-logr/logr" -) - -var ( - _ logr.LogSink = &slogSink{} - _ logr.CallDepthLogSink = &slogSink{} - _ Underlier = &slogSink{} -) - -// Underlier is implemented by the LogSink returned by NewLogr. -type Underlier interface { - // GetUnderlying returns the Handler used by the LogSink. - GetUnderlying() slog.Handler -} - -const ( - // nameKey is used to log the `WithName` values as an additional attribute. - nameKey = "logger" - - // errKey is used to log the error parameter of Error as an additional attribute. - errKey = "err" -) - -type slogSink struct { - callDepth int - name string - handler slog.Handler -} - -func (l *slogSink) Init(info logr.RuntimeInfo) { - l.callDepth = info.CallDepth -} - -func (l *slogSink) GetUnderlying() slog.Handler { - return l.handler -} - -func (l *slogSink) WithCallDepth(depth int) logr.LogSink { - newLogger := *l - newLogger.callDepth += depth - return &newLogger -} - -func (l *slogSink) Enabled(level int) bool { - return l.handler.Enabled(context.Background(), slog.Level(-level)) -} - -func (l *slogSink) Info(level int, msg string, kvList ...interface{}) { - l.log(nil, msg, slog.Level(-level), kvList...) -} - -func (l *slogSink) Error(err error, msg string, kvList ...interface{}) { - l.log(err, msg, slog.LevelError, kvList...) -} - -func (l *slogSink) log(err error, msg string, level slog.Level, kvList ...interface{}) { - var pcs [1]uintptr - // skip runtime.Callers, this function, Info/Error, and all helper functions above that. - runtime.Callers(3+l.callDepth, pcs[:]) - - record := slog.NewRecord(time.Now(), level, msg, pcs[0]) - if l.name != "" { - record.AddAttrs(slog.String(nameKey, l.name)) - } - if err != nil { - record.AddAttrs(slog.Any(errKey, err)) - } - record.Add(kvList...) - l.handler.Handle(context.Background(), record) -} - -func (l slogSink) WithName(name string) logr.LogSink { - if l.name != "" { - l.name = l.name + "/" - } - l.name += name - return &l -} - -func (l slogSink) WithValues(kvList ...interface{}) logr.LogSink { - l.handler = l.handler.WithAttrs(kvListToAttrs(kvList...)) - return &l -} - -func kvListToAttrs(kvList ...interface{}) []slog.Attr { - // We don't need the record itself, only its Add method. - record := slog.NewRecord(time.Time{}, 0, "", 0) - record.Add(kvList...) - attrs := make([]slog.Attr, 0, record.NumAttrs()) - record.Attrs(func(attr slog.Attr) bool { - attrs = append(attrs, attr) - return true - }) - return attrs -} diff --git a/cluster-autoscaler/vendor/github.com/go-logr/zapr/.gitignore b/cluster-autoscaler/vendor/github.com/go-logr/zapr/.gitignore deleted file mode 100644 index b72f9be2042a..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-logr/zapr/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.swp diff --git a/cluster-autoscaler/vendor/github.com/go-logr/zapr/LICENSE b/cluster-autoscaler/vendor/github.com/go-logr/zapr/LICENSE deleted file mode 100644 index 8dada3edaf50..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-logr/zapr/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cluster-autoscaler/vendor/github.com/go-logr/zapr/README.md b/cluster-autoscaler/vendor/github.com/go-logr/zapr/README.md deleted file mode 100644 index 78f5f7653f6b..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-logr/zapr/README.md +++ /dev/null @@ -1,70 +0,0 @@ -Zapr :zap: -========== - -A [logr](https://github.com/go-logr/logr) implementation using -[Zap](https://github.com/uber-go/zap). - -Usage ------ - -```go -import ( - "fmt" - - "go.uber.org/zap" - "github.com/go-logr/logr" - "github.com/go-logr/zapr" -) - -func main() { - var log logr.Logger - - zapLog, err := zap.NewDevelopment() - if err != nil { - panic(fmt.Sprintf("who watches the watchmen (%v)?", err)) - } - log = zapr.NewLogger(zapLog) - - log.Info("Logr in action!", "the answer", 42) -} -``` - -Increasing Verbosity --------------------- - -Zap uses semantically named levels for logging (`DebugLevel`, `InfoLevel`, -`WarningLevel`, ...). Logr uses arbitrary numeric levels. By default logr's -`V(0)` is zap's `InfoLevel` and `V(1)` is zap's `DebugLevel` (which is -numerically -1). Zap does not have named levels that are more verbose than -`DebugLevel`, but it's possible to fake it. - -As of zap v1.19.0 you can do something like the following in your setup code: - -```go - zc := zap.NewProductionConfig() - zc.Level = zap.NewAtomicLevelAt(zapcore.Level(-2)) - z, err := zc.Build() - if err != nil { - // ... - } - log := zapr.NewLogger(z) -``` - -Zap's levels get more verbose as the number gets smaller and more important and -the number gets larger (`DebugLevel` is -1, `InfoLevel` is 0, `WarnLevel` is 1, -and so on). - -The `-2` in the above snippet means that `log.V(2).Info()` calls will be active. -`-3` would enable `log.V(3).Info()`, etc. Note that zap's levels are `int8` -which means the most verbose level you can give it is -128. The zapr -implementation will cap `V()` levels greater than 127 to 127, so setting the -zap level to -128 really means "activate all logs". - -Implementation Details ----------------------- - -For the most part, concepts in Zap correspond directly with those in logr. - -Unlike Zap, all fields *must* be in the form of sugared fields -- -it's illegal to pass a strongly-typed Zap field in a key position to any -of the logging methods (`Log`, `Error`). diff --git a/cluster-autoscaler/vendor/github.com/go-logr/zapr/zapr.go b/cluster-autoscaler/vendor/github.com/go-logr/zapr/zapr.go deleted file mode 100644 index 8bb7fceb3f0c..000000000000 --- a/cluster-autoscaler/vendor/github.com/go-logr/zapr/zapr.go +++ /dev/null @@ -1,316 +0,0 @@ -/* -Copyright 2019 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Copyright 2018 Solly Ross -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 zapr defines an implementation of the github.com/go-logr/logr -// interfaces built on top of Zap (go.uber.org/zap). -// -// Usage -// -// A new logr.Logger can be constructed from an existing zap.Logger using -// the NewLogger function: -// -// log := zapr.NewLogger(someZapLogger) -// -// Implementation Details -// -// For the most part, concepts in Zap correspond directly with those in -// logr. -// -// Unlike Zap, all fields *must* be in the form of sugared fields -- -// it's illegal to pass a strongly-typed Zap field in a key position -// to any of the log methods. -// -// Levels in logr correspond to custom debug levels in Zap. Any given level -// in logr is represents by its inverse in zap (`zapLevel = -1*logrLevel`). -// For example V(2) is equivalent to log level -2 in Zap, while V(1) is -// equivalent to Zap's DebugLevel. -package zapr - -import ( - "fmt" - - "github.com/go-logr/logr" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// NB: right now, we always use the equivalent of sugared logging. -// This is necessary, since logr doesn't define non-suggared types, -// and using zap-specific non-suggared types would make uses tied -// directly to Zap. - -// zapLogger is a logr.Logger that uses Zap to log. The level has already been -// converted to a Zap level, which is to say that `logrLevel = -1*zapLevel`. -type zapLogger struct { - // NB: this looks very similar to zap.SugaredLogger, but - // deals with our desire to have multiple verbosity levels. - l *zap.Logger - - // numericLevelKey controls whether the numeric logr level is - // added to each Info log message and with which key. - numericLevelKey string - - // errorKey is the field name used for the error in - // Logger.Error calls. - errorKey string - - // allowZapFields enables logging of strongly-typed Zap - // fields. It is off by default because it breaks - // implementation agnosticism. - allowZapFields bool - - // panicMessages enables log messages for invalid log calls - // that explain why a call was invalid (for example, - // non-string key). This is enabled by default. - panicMessages bool -} - -const ( - // noLevel tells handleFields to not inject a numeric log level field. - noLevel = -1 -) - -// handleFields converts a bunch of arbitrary key-value pairs into Zap fields. It takes -// additional pre-converted Zap fields, for use with automatically attached fields, like -// `error`. -func (zl *zapLogger) handleFields(lvl int, args []interface{}, additional ...zap.Field) []zap.Field { - injectNumericLevel := zl.numericLevelKey != "" && lvl != noLevel - - // a slightly modified version of zap.SugaredLogger.sweetenFields - if len(args) == 0 { - // fast-return if we have no suggared fields and no "v" field. - if !injectNumericLevel { - return additional - } - // Slightly slower fast path when we need to inject "v". - return append(additional, zap.Int(zl.numericLevelKey, lvl)) - } - - // unlike Zap, we can be pretty sure users aren't passing structured - // fields (since logr has no concept of that), so guess that we need a - // little less space. - numFields := len(args)/2 + len(additional) - if injectNumericLevel { - numFields++ - } - fields := make([]zap.Field, 0, numFields) - if injectNumericLevel { - fields = append(fields, zap.Int(zl.numericLevelKey, lvl)) - } - for i := 0; i < len(args); { - // Check just in case for strongly-typed Zap fields, - // which might be illegal (since it breaks - // implementation agnosticism). If disabled, we can - // give a better error message. - if field, ok := args[i].(zap.Field); ok { - if zl.allowZapFields { - fields = append(fields, field) - i++ - continue - } - if zl.panicMessages { - zl.l.WithOptions(zap.AddCallerSkip(1)).DPanic("strongly-typed Zap Field passed to logr", zapIt("zap field", args[i])) - } - break - } - - // make sure this isn't a mismatched key - if i == len(args)-1 { - if zl.panicMessages { - zl.l.WithOptions(zap.AddCallerSkip(1)).DPanic("odd number of arguments passed as key-value pairs for logging", zapIt("ignored key", args[i])) - } - break - } - - // process a key-value pair, - // ensuring that the key is a string - key, val := args[i], args[i+1] - keyStr, isString := key.(string) - if !isString { - // if the key isn't a string, DPanic and stop logging - if zl.panicMessages { - zl.l.WithOptions(zap.AddCallerSkip(1)).DPanic("non-string key argument passed to logging, ignoring all later arguments", zapIt("invalid key", key)) - } - break - } - - fields = append(fields, zapIt(keyStr, val)) - i += 2 - } - - return append(fields, additional...) -} - -func zapIt(field string, val interface{}) zap.Field { - // Handle types that implement logr.Marshaler: log the replacement - // object instead of the original one. - if marshaler, ok := val.(logr.Marshaler); ok { - field, val = invokeMarshaler(field, marshaler) - } - return zap.Any(field, val) -} - -func invokeMarshaler(field string, m logr.Marshaler) (f string, ret interface{}) { - defer func() { - if r := recover(); r != nil { - ret = fmt.Sprintf("PANIC=%s", r) - f = field + "Error" - } - }() - return field, m.MarshalLog() -} - -func (zl *zapLogger) Init(ri logr.RuntimeInfo) { - zl.l = zl.l.WithOptions(zap.AddCallerSkip(ri.CallDepth)) -} - -// Zap levels are int8 - make sure we stay in bounds. logr itself should -// ensure we never get negative values. -func toZapLevel(lvl int) zapcore.Level { - if lvl > 127 { - lvl = 127 - } - // zap levels are inverted. - return 0 - zapcore.Level(lvl) -} - -func (zl zapLogger) Enabled(lvl int) bool { - return zl.l.Core().Enabled(toZapLevel(lvl)) -} - -func (zl *zapLogger) Info(lvl int, msg string, keysAndVals ...interface{}) { - if checkedEntry := zl.l.Check(toZapLevel(lvl), msg); checkedEntry != nil { - checkedEntry.Write(zl.handleFields(lvl, keysAndVals)...) - } -} - -func (zl *zapLogger) Error(err error, msg string, keysAndVals ...interface{}) { - if checkedEntry := zl.l.Check(zap.ErrorLevel, msg); checkedEntry != nil { - checkedEntry.Write(zl.handleFields(noLevel, keysAndVals, zap.NamedError(zl.errorKey, err))...) - } -} - -func (zl *zapLogger) WithValues(keysAndValues ...interface{}) logr.LogSink { - newLogger := *zl - newLogger.l = zl.l.With(zl.handleFields(noLevel, keysAndValues)...) - return &newLogger -} - -func (zl *zapLogger) WithName(name string) logr.LogSink { - newLogger := *zl - newLogger.l = zl.l.Named(name) - return &newLogger -} - -func (zl *zapLogger) WithCallDepth(depth int) logr.LogSink { - newLogger := *zl - newLogger.l = zl.l.WithOptions(zap.AddCallerSkip(depth)) - return &newLogger -} - -// Underlier exposes access to the underlying logging implementation. Since -// callers only have a logr.Logger, they have to know which implementation is -// in use, so this interface is less of an abstraction and more of way to test -// type conversion. -type Underlier interface { - GetUnderlying() *zap.Logger -} - -func (zl *zapLogger) GetUnderlying() *zap.Logger { - return zl.l -} - -// NewLogger creates a new logr.Logger using the given Zap Logger to log. -func NewLogger(l *zap.Logger) logr.Logger { - return NewLoggerWithOptions(l) -} - -// NewLoggerWithOptions creates a new logr.Logger using the given Zap Logger to -// log and applies additional options. -func NewLoggerWithOptions(l *zap.Logger, opts ...Option) logr.Logger { - // creates a new logger skipping one level of callstack - log := l.WithOptions(zap.AddCallerSkip(1)) - zl := &zapLogger{ - l: log, - } - zl.errorKey = "error" - zl.panicMessages = true - for _, option := range opts { - option(zl) - } - return logr.New(zl) -} - -// Option is one additional parameter for NewLoggerWithOptions. -type Option func(*zapLogger) - -// LogInfoLevel controls whether a numeric log level is added to -// Info log message. The empty string disables this, a non-empty -// string is the key for the additional field. Errors and -// internal panic messages do not have a log level and thus -// are always logged without this extra field. -func LogInfoLevel(key string) Option { - return func(zl *zapLogger) { - zl.numericLevelKey = key - } -} - -// ErrorKey replaces the default "error" field name used for the error -// in Logger.Error calls. -func ErrorKey(key string) Option { - return func(zl *zapLogger) { - zl.errorKey = key - } -} - -// AllowZapFields controls whether strongly-typed Zap fields may -// be passed instead of a key/value pair. This is disabled by -// default because it breaks implementation agnosticism. -func AllowZapFields(allowed bool) Option { - return func(zl *zapLogger) { - zl.allowZapFields = allowed - } -} - -// DPanicOnBugs controls whether extra log messages are emitted for -// invalid log calls with zap's DPanic method. Depending on the -// configuration of the zap logger, the program then panics after -// emitting the log message which is useful in development because -// such invalid log calls are bugs in the program. The log messages -// explain why a call was invalid (for example, non-string -// key). Emitting them is enabled by default. -func DPanicOnBugs(enabled bool) Option { - return func(zl *zapLogger) { - zl.panicMessages = enabled - } -} - -var _ logr.LogSink = &zapLogger{} -var _ logr.CallDepthLogSink = &zapLogger{} diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/escape.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/escape.go deleted file mode 100644 index d1509d945818..000000000000 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/escape.go +++ /dev/null @@ -1,84 +0,0 @@ -package dbus - -import "net/url" - -// EscapeBusAddressValue implements a requirement to escape the values -// in D-Bus server addresses, as defined by the D-Bus specification at -// https://dbus.freedesktop.org/doc/dbus-specification.html#addresses. -func EscapeBusAddressValue(val string) string { - toEsc := strNeedsEscape(val) - if toEsc == 0 { - // Avoid unneeded allocation/copying. - return val - } - - // Avoid allocation for short paths. - var buf [64]byte - var out []byte - // Every to-be-escaped byte needs 2 extra bytes. - required := len(val) + 2*toEsc - if required <= len(buf) { - out = buf[:required] - } else { - out = make([]byte, required) - } - - j := 0 - for i := 0; i < len(val); i++ { - if ch := val[i]; needsEscape(ch) { - // Convert ch to %xx, where xx is hex value. - out[j] = '%' - out[j+1] = hexchar(ch >> 4) - out[j+2] = hexchar(ch & 0x0F) - j += 3 - } else { - out[j] = ch - j++ - } - } - - return string(out) -} - -// UnescapeBusAddressValue unescapes values in D-Bus server addresses, -// as defined by the D-Bus specification at -// https://dbus.freedesktop.org/doc/dbus-specification.html#addresses. -func UnescapeBusAddressValue(val string) (string, error) { - // Looks like url.PathUnescape does exactly what is required. - return url.PathUnescape(val) -} - -// hexchar returns an octal representation of a n, where n < 16. -// For invalid values of n, the function panics. -func hexchar(n byte) byte { - const hex = "0123456789abcdef" - - // For n >= len(hex), runtime will panic. - return hex[n] -} - -// needsEscape tells if a byte is NOT one of optionally-escaped bytes. -func needsEscape(c byte) bool { - if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { - return false - } - switch c { - case '-', '_', '/', '\\', '.', '*': - return false - } - - return true -} - -// strNeedsEscape tells how many bytes in the string need escaping. -func strNeedsEscape(val string) int { - count := 0 - - for i := 0; i < len(val); i++ { - if needsEscape(val[i]) { - count++ - } - } - - return count -} diff --git a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/transport_zos.go b/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/transport_zos.go deleted file mode 100644 index 1bba0d6bf781..000000000000 --- a/cluster-autoscaler/vendor/github.com/godbus/dbus/v5/transport_zos.go +++ /dev/null @@ -1,6 +0,0 @@ -package dbus - -func (t *unixTransport) SendNullByte() error { - _, err := t.Write([]byte{0}) - return err -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/cel/validator.go b/cluster-autoscaler/vendor/github.com/google/cel-go/cel/validator.go deleted file mode 100644 index 78b311381867..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/cel/validator.go +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright 2023 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 cel - -import ( - "fmt" - "reflect" - "regexp" - - "github.com/google/cel-go/common/ast" - "github.com/google/cel-go/common/overloads" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -const ( - homogeneousValidatorName = "cel.lib.std.validate.types.homogeneous" - - // HomogeneousAggregateLiteralExemptFunctions is the ValidatorConfig key used to configure - // the set of function names which are exempt from homogeneous type checks. The expected type - // is a string list of function names. - // - // As an example, the `.format([args])` call expects the input arguments list to be - // comprised of a variety of types which correspond to the types expected by the format control - // clauses; however, all other uses of a mixed element type list, would be unexpected. - HomogeneousAggregateLiteralExemptFunctions = homogeneousValidatorName + ".exempt" -) - -// ASTValidators configures a set of ASTValidator instances into the target environment. -// -// Validators are applied in the order in which the are specified and are treated as singletons. -// The same ASTValidator with a given name will not be applied more than once. -func ASTValidators(validators ...ASTValidator) EnvOption { - return func(e *Env) (*Env, error) { - for _, v := range validators { - if !e.HasValidator(v.Name()) { - e.validators = append(e.validators, v) - } - } - return e, nil - } -} - -// ASTValidator defines a singleton interface for validating a type-checked Ast against an environment. -// -// Note: the Issues argument is mutable in the sense that it is intended to collect errors which will be -// reported to the caller. -type ASTValidator interface { - // Name returns the name of the validator. Names must be unique. - Name() string - - // Validate validates a given Ast within an Environment and collects a set of potential issues. - // - // The ValidatorConfig is generated from the set of ASTValidatorConfigurer instances prior to - // the invocation of the Validate call. The expectation is that the validator configuration - // is created in sequence and immutable once provided to the Validate call. - // - // See individual validators for more information on their configuration keys and configuration - // properties. - Validate(*Env, ValidatorConfig, *ast.CheckedAST, *Issues) -} - -// ValidatorConfig provides an accessor method for querying validator configuration state. -type ValidatorConfig interface { - GetOrDefault(name string, value any) any -} - -// MutableValidatorConfig provides mutation methods for querying and updating validator configuration -// settings. -type MutableValidatorConfig interface { - ValidatorConfig - Set(name string, value any) error -} - -// ASTValidatorConfigurer indicates that this object, currently expected to be an ASTValidator, -// participates in validator configuration settings. -// -// This interface may be split from the expectation of being an ASTValidator instance in the future. -type ASTValidatorConfigurer interface { - Configure(MutableValidatorConfig) error -} - -// validatorConfig implements the ValidatorConfig and MutableValidatorConfig interfaces. -type validatorConfig struct { - data map[string]any -} - -// newValidatorConfig initializes the validator config with default values for core CEL validators. -func newValidatorConfig() *validatorConfig { - return &validatorConfig{ - data: map[string]any{ - HomogeneousAggregateLiteralExemptFunctions: []string{}, - }, - } -} - -// GetOrDefault returns the configured value for the name, if present, else the input default value. -// -// Note, the type-agreement between the input default and configured value is not checked on read. -func (config *validatorConfig) GetOrDefault(name string, value any) any { - v, found := config.data[name] - if !found { - return value - } - return v -} - -// Set configures a validator option with the given name and value. -// -// If the value had previously been set, the new value must have the same reflection type as the old one, -// or the call will error. -func (config *validatorConfig) Set(name string, value any) error { - v, found := config.data[name] - if found && reflect.TypeOf(v) != reflect.TypeOf(value) { - return fmt.Errorf("incompatible configuration type for %s, got %T, wanted %T", name, value, v) - } - config.data[name] = value - return nil -} - -// ExtendedValidations collects a set of common AST validations which reduce the likelihood of runtime errors. -// -// - Validate duration and timestamp literals -// - Ensure regex strings are valid -// - Disable mixed type list and map literals -func ExtendedValidations() EnvOption { - return ASTValidators( - ValidateDurationLiterals(), - ValidateTimestampLiterals(), - ValidateRegexLiterals(), - ValidateHomogeneousAggregateLiterals(), - ) -} - -// ValidateDurationLiterals ensures that duration literal arguments are valid immediately after type-check. -func ValidateDurationLiterals() ASTValidator { - return newFormatValidator(overloads.TypeConvertDuration, 0, evalCall) -} - -// ValidateTimestampLiterals ensures that timestamp literal arguments are valid immediately after type-check. -func ValidateTimestampLiterals() ASTValidator { - return newFormatValidator(overloads.TypeConvertTimestamp, 0, evalCall) -} - -// ValidateRegexLiterals ensures that regex patterns are validated after type-check. -func ValidateRegexLiterals() ASTValidator { - return newFormatValidator(overloads.Matches, 0, compileRegex) -} - -// ValidateHomogeneousAggregateLiterals checks that all list and map literals entries have the same types, i.e. -// no mixed list element types or mixed map key or map value types. -// -// Note: the string format call relies on a mixed element type list for ease of use, so this check skips all -// literals which occur within string format calls. -func ValidateHomogeneousAggregateLiterals() ASTValidator { - return homogeneousAggregateLiteralValidator{} -} - -// ValidateComprehensionNestingLimit ensures that comprehension nesting does not exceed the specified limit. -// -// This validator can be useful for preventing arbitrarily nested comprehensions which can take high polynomial -// time to complete. -// -// Note, this limit does not apply to comprehensions with an empty iteration range, as these comprehensions have -// no actual looping cost. The cel.bind() utilizes the comprehension structure to perform local variable -// assignments and supplies an empty iteration range, so they won't count against the nesting limit either. -func ValidateComprehensionNestingLimit(limit int) ASTValidator { - return nestingLimitValidator{limit: limit} -} - -type argChecker func(env *Env, call, arg ast.NavigableExpr) error - -func newFormatValidator(funcName string, argNum int, check argChecker) formatValidator { - return formatValidator{ - funcName: funcName, - check: check, - argNum: argNum, - } -} - -type formatValidator struct { - funcName string - argNum int - check argChecker -} - -// Name returns the unique name of this function format validator. -func (v formatValidator) Name() string { - return fmt.Sprintf("cel.lib.std.validate.functions.%s", v.funcName) -} - -// Validate searches the AST for uses of a given function name with a constant argument and performs a check -// on whether the argument is a valid literal value. -func (v formatValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST, iss *Issues) { - root := ast.NavigateCheckedAST(a) - funcCalls := ast.MatchDescendants(root, ast.FunctionMatcher(v.funcName)) - for _, call := range funcCalls { - callArgs := call.AsCall().Args() - if len(callArgs) <= v.argNum { - continue - } - litArg := callArgs[v.argNum] - if litArg.Kind() != ast.LiteralKind { - continue - } - if err := v.check(e, call, litArg); err != nil { - iss.ReportErrorAtID(litArg.ID(), "invalid %s argument", v.funcName) - } - } -} - -func evalCall(env *Env, call, arg ast.NavigableExpr) error { - ast := ParsedExprToAst(&exprpb.ParsedExpr{Expr: call.ToExpr()}) - prg, err := env.Program(ast) - if err != nil { - return err - } - _, _, err = prg.Eval(NoVars()) - return err -} - -func compileRegex(_ *Env, _, arg ast.NavigableExpr) error { - pattern := arg.AsLiteral().Value().(string) - _, err := regexp.Compile(pattern) - return err -} - -type homogeneousAggregateLiteralValidator struct{} - -// Name returns the unique name of the homogeneous type validator. -func (homogeneousAggregateLiteralValidator) Name() string { - return homogeneousValidatorName -} - -// Configure implements the ASTValidatorConfigurer interface and currently sets the list of standard -// and exempt functions from homogeneous aggregate literal checks. -// -// TODO: Move this call into the string.format() ASTValidator once ported. -func (homogeneousAggregateLiteralValidator) Configure(c MutableValidatorConfig) error { - emptyList := []string{} - exemptFunctions := c.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, emptyList).([]string) - exemptFunctions = append(exemptFunctions, "format") - return c.Set(HomogeneousAggregateLiteralExemptFunctions, exemptFunctions) -} - -// Validate validates that all lists and map literals have homogeneous types, i.e. don't contain dyn types. -// -// This validator makes an exception for list and map literals which occur at any level of nesting within -// string format calls. -func (v homogeneousAggregateLiteralValidator) Validate(_ *Env, c ValidatorConfig, a *ast.CheckedAST, iss *Issues) { - var exemptedFunctions []string - exemptedFunctions = c.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, exemptedFunctions).([]string) - root := ast.NavigateCheckedAST(a) - listExprs := ast.MatchDescendants(root, ast.KindMatcher(ast.ListKind)) - for _, listExpr := range listExprs { - if inExemptFunction(listExpr, exemptedFunctions) { - continue - } - l := listExpr.AsList() - elements := l.Elements() - optIndices := l.OptionalIndices() - var elemType *Type - for i, e := range elements { - et := e.Type() - if isOptionalIndex(i, optIndices) { - et = et.Parameters()[0] - } - if elemType == nil { - elemType = et - continue - } - if !elemType.IsEquivalentType(et) { - v.typeMismatch(iss, e.ID(), elemType, et) - break - } - } - } - mapExprs := ast.MatchDescendants(root, ast.KindMatcher(ast.MapKind)) - for _, mapExpr := range mapExprs { - if inExemptFunction(mapExpr, exemptedFunctions) { - continue - } - m := mapExpr.AsMap() - entries := m.Entries() - var keyType, valType *Type - for _, e := range entries { - key, val := e.Key(), e.Value() - kt, vt := key.Type(), val.Type() - if e.IsOptional() { - vt = vt.Parameters()[0] - } - if keyType == nil && valType == nil { - keyType, valType = kt, vt - continue - } - if !keyType.IsEquivalentType(kt) { - v.typeMismatch(iss, key.ID(), keyType, kt) - } - if !valType.IsEquivalentType(vt) { - v.typeMismatch(iss, val.ID(), valType, vt) - } - } - } -} - -func inExemptFunction(e ast.NavigableExpr, exemptFunctions []string) bool { - if parent, found := e.Parent(); found { - if parent.Kind() == ast.CallKind { - fnName := parent.AsCall().FunctionName() - for _, exempt := range exemptFunctions { - if exempt == fnName { - return true - } - } - } - if parent.Kind() == ast.ListKind || parent.Kind() == ast.MapKind { - return inExemptFunction(parent, exemptFunctions) - } - } - return false -} - -func isOptionalIndex(i int, optIndices []int32) bool { - for _, optInd := range optIndices { - if i == int(optInd) { - return true - } - } - return false -} - -func (homogeneousAggregateLiteralValidator) typeMismatch(iss *Issues, id int64, expected, actual *Type) { - iss.ReportErrorAtID(id, "expected type '%s' but found '%s'", FormatCELType(expected), FormatCELType(actual)) -} - -type nestingLimitValidator struct { - limit int -} - -func (v nestingLimitValidator) Name() string { - return "cel.lib.std.validate.comprehension_nesting_limit" -} - -func (v nestingLimitValidator) Validate(e *Env, _ ValidatorConfig, a *ast.CheckedAST, iss *Issues) { - root := ast.NavigateCheckedAST(a) - comprehensions := ast.MatchDescendants(root, ast.KindMatcher(ast.ComprehensionKind)) - if len(comprehensions) <= v.limit { - return - } - for _, comp := range comprehensions { - count := 0 - e := comp - hasParent := true - for hasParent { - // When the expression is not a comprehension, continue to the next ancestor. - if e.Kind() != ast.ComprehensionKind { - e, hasParent = e.Parent() - continue - } - // When the comprehension has an empty range, continue to the next ancestor - // as this comprehension does not have any associated cost. - iterRange := e.AsComprehension().IterRange() - if iterRange.Kind() == ast.ListKind && iterRange.AsList().Size() == 0 { - e, hasParent = e.Parent() - continue - } - // Otherwise check the nesting limit. - count++ - if count > v.limit { - iss.ReportErrorAtID(comp.ID(), "comprehension exceeds nesting limit") - break - } - e, hasParent = e.Parent() - } - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/checker/format.go b/cluster-autoscaler/vendor/github.com/google/cel-go/checker/format.go deleted file mode 100644 index 95842905e6d5..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/checker/format.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2023 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 checker - -import ( - "fmt" - "strings" - - chkdecls "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common/types" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -const ( - kindUnknown = iota + 1 - kindError - kindFunction - kindDyn - kindPrimitive - kindWellKnown - kindWrapper - kindNull - kindAbstract - kindType - kindList - kindMap - kindObject - kindTypeParam -) - -// FormatCheckedType converts a type message into a string representation. -func FormatCheckedType(t *exprpb.Type) string { - switch kindOf(t) { - case kindDyn: - return "dyn" - case kindFunction: - return formatFunctionExprType(t.GetFunction().GetResultType(), - t.GetFunction().GetArgTypes(), - false) - case kindList: - return fmt.Sprintf("list(%s)", FormatCheckedType(t.GetListType().GetElemType())) - case kindObject: - return t.GetMessageType() - case kindMap: - return fmt.Sprintf("map(%s, %s)", - FormatCheckedType(t.GetMapType().GetKeyType()), - FormatCheckedType(t.GetMapType().GetValueType())) - case kindNull: - return "null" - case kindPrimitive: - switch t.GetPrimitive() { - case exprpb.Type_UINT64: - return "uint" - case exprpb.Type_INT64: - return "int" - } - return strings.Trim(strings.ToLower(t.GetPrimitive().String()), " ") - case kindType: - if t.GetType() == nil || t.GetType().GetTypeKind() == nil { - return "type" - } - return fmt.Sprintf("type(%s)", FormatCheckedType(t.GetType())) - case kindWellKnown: - switch t.GetWellKnown() { - case exprpb.Type_ANY: - return "any" - case exprpb.Type_DURATION: - return "duration" - case exprpb.Type_TIMESTAMP: - return "timestamp" - } - case kindWrapper: - return fmt.Sprintf("wrapper(%s)", - FormatCheckedType(chkdecls.NewPrimitiveType(t.GetWrapper()))) - case kindError: - return "!error!" - case kindTypeParam: - return t.GetTypeParam() - case kindAbstract: - at := t.GetAbstractType() - params := at.GetParameterTypes() - paramStrs := make([]string, len(params)) - for i, p := range params { - paramStrs[i] = FormatCheckedType(p) - } - return fmt.Sprintf("%s(%s)", at.GetName(), strings.Join(paramStrs, ", ")) - } - return t.String() -} - -type formatter func(any) string - -// FormatCELType formats a types.Type value to a string representation. -// -// The type formatting is identical to FormatCheckedType. -func FormatCELType(t any) string { - dt := t.(*types.Type) - switch dt.Kind() { - case types.AnyKind: - return "any" - case types.DurationKind: - return "duration" - case types.ErrorKind: - return "!error!" - case types.NullTypeKind: - return "null" - case types.TimestampKind: - return "timestamp" - case types.TypeParamKind: - return dt.TypeName() - case types.OpaqueKind: - if dt.TypeName() == "function" { - // There is no explicit function type in the new types representation, so information like - // whether the function is a member function is absent. - return formatFunctionDeclType(dt.Parameters()[0], dt.Parameters()[1:], false) - } - case types.UnspecifiedKind: - return "" - } - if len(dt.Parameters()) == 0 { - return dt.DeclaredTypeName() - } - paramTypeNames := make([]string, 0, len(dt.Parameters())) - for _, p := range dt.Parameters() { - paramTypeNames = append(paramTypeNames, FormatCELType(p)) - } - return fmt.Sprintf("%s(%s)", dt.TypeName(), strings.Join(paramTypeNames, ", ")) -} - -func formatExprType(t any) string { - if t == nil { - return "" - } - return FormatCheckedType(t.(*exprpb.Type)) -} - -func formatFunctionExprType(resultType *exprpb.Type, argTypes []*exprpb.Type, isInstance bool) string { - return formatFunctionInternal[*exprpb.Type](resultType, argTypes, isInstance, formatExprType) -} - -func formatFunctionDeclType(resultType *types.Type, argTypes []*types.Type, isInstance bool) string { - return formatFunctionInternal[*types.Type](resultType, argTypes, isInstance, FormatCELType) -} - -func formatFunctionInternal[T any](resultType T, argTypes []T, isInstance bool, format formatter) string { - result := "" - if isInstance { - target := argTypes[0] - argTypes = argTypes[1:] - result += format(target) - result += "." - } - result += "(" - for i, arg := range argTypes { - if i > 0 { - result += ", " - } - result += format(arg) - } - result += ")" - rt := format(resultType) - if rt != "" { - result += " -> " - result += rt - } - return result -} - -// kindOf returns the kind of the type as defined in the checked.proto. -func kindOf(t *exprpb.Type) int { - if t == nil || t.TypeKind == nil { - return kindUnknown - } - switch t.GetTypeKind().(type) { - case *exprpb.Type_Error: - return kindError - case *exprpb.Type_Function: - return kindFunction - case *exprpb.Type_Dyn: - return kindDyn - case *exprpb.Type_Primitive: - return kindPrimitive - case *exprpb.Type_WellKnown: - return kindWellKnown - case *exprpb.Type_Wrapper: - return kindWrapper - case *exprpb.Type_Null: - return kindNull - case *exprpb.Type_Type: - return kindType - case *exprpb.Type_ListType_: - return kindList - case *exprpb.Type_MapType_: - return kindMap - case *exprpb.Type_MessageType: - return kindObject - case *exprpb.Type_TypeParam: - return kindTypeParam - case *exprpb.Type_AbstractType_: - return kindAbstract - } - return kindUnknown -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/checker/scopes.go b/cluster-autoscaler/vendor/github.com/google/cel-go/checker/scopes.go deleted file mode 100644 index 8bb73ddb6a29..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/checker/scopes.go +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2018 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 checker - -import ( - "github.com/google/cel-go/common/decls" -) - -// Scopes represents nested Decl sets where the Scopes value contains a Groups containing all -// identifiers in scope and an optional parent representing outer scopes. -// Each Groups value is a mapping of names to Decls in the ident and function namespaces. -// Lookups are performed such that bindings in inner scopes shadow those in outer scopes. -type Scopes struct { - parent *Scopes - scopes *Group -} - -// newScopes creates a new, empty Scopes. -// Some operations can't be safely performed until a Group is added with Push. -func newScopes() *Scopes { - return &Scopes{ - scopes: newGroup(), - } -} - -// Copy creates a copy of the current Scopes values, including a copy of its parent if non-nil. -func (s *Scopes) Copy() *Scopes { - cpy := newScopes() - if s == nil { - return cpy - } - if s.parent != nil { - cpy.parent = s.parent.Copy() - } - cpy.scopes = s.scopes.copy() - return cpy -} - -// Push creates a new Scopes value which references the current Scope as its parent. -func (s *Scopes) Push() *Scopes { - return &Scopes{ - parent: s, - scopes: newGroup(), - } -} - -// Pop returns the parent Scopes value for the current scope, or the current scope if the parent -// is nil. -func (s *Scopes) Pop() *Scopes { - if s.parent != nil { - return s.parent - } - // TODO: Consider whether this should be an error / panic. - return s -} - -// AddIdent adds the ident Decl in the current scope. -// Note: If the name collides with an existing identifier in the scope, the Decl is overwritten. -func (s *Scopes) AddIdent(decl *decls.VariableDecl) { - s.scopes.idents[decl.Name()] = decl -} - -// FindIdent finds the first ident Decl with a matching name in Scopes, or nil if one cannot be -// found. -// Note: The search is performed from innermost to outermost. -func (s *Scopes) FindIdent(name string) *decls.VariableDecl { - if ident, found := s.scopes.idents[name]; found { - return ident - } - if s.parent != nil { - return s.parent.FindIdent(name) - } - return nil -} - -// FindIdentInScope finds the first ident Decl with a matching name in the current Scopes value, or -// nil if one does not exist. -// Note: The search is only performed on the current scope and does not search outer scopes. -func (s *Scopes) FindIdentInScope(name string) *decls.VariableDecl { - if ident, found := s.scopes.idents[name]; found { - return ident - } - return nil -} - -// SetFunction adds the function Decl to the current scope. -// Note: Any previous entry for a function in the current scope with the same name is overwritten. -func (s *Scopes) SetFunction(fn *decls.FunctionDecl) { - s.scopes.functions[fn.Name()] = fn -} - -// FindFunction finds the first function Decl with a matching name in Scopes. -// The search is performed from innermost to outermost. -// Returns nil if no such function in Scopes. -func (s *Scopes) FindFunction(name string) *decls.FunctionDecl { - if fn, found := s.scopes.functions[name]; found { - return fn - } - if s.parent != nil { - return s.parent.FindFunction(name) - } - return nil -} - -// Group is a set of Decls that is pushed on or popped off a Scopes as a unit. -// Contains separate namespaces for identifier and function Decls. -// (Should be named "Scope" perhaps?) -type Group struct { - idents map[string]*decls.VariableDecl - functions map[string]*decls.FunctionDecl -} - -// copy creates a new Group instance with a shallow copy of the variables and functions. -// If callers need to mutate the exprpb.Decl definitions for a Function, they should copy-on-write. -func (g *Group) copy() *Group { - cpy := &Group{ - idents: make(map[string]*decls.VariableDecl, len(g.idents)), - functions: make(map[string]*decls.FunctionDecl, len(g.functions)), - } - for n, id := range g.idents { - cpy.idents[n] = id - } - for n, fn := range g.functions { - cpy.functions[n] = fn - } - return cpy -} - -// newGroup creates a new Group with empty maps for identifiers and functions. -func newGroup() *Group { - return &Group{ - idents: make(map[string]*decls.VariableDecl), - functions: make(map[string]*decls.FunctionDecl), - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/BUILD.bazel b/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/BUILD.bazel deleted file mode 100644 index 7269cdff5f7f..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/BUILD.bazel +++ /dev/null @@ -1,52 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = [ - "//cel:__subpackages__", - "//checker:__subpackages__", - "//common:__subpackages__", - "//interpreter:__subpackages__", - ], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "ast.go", - "expr.go", - ], - importpath = "github.com/google/cel-go/common/ast", - deps = [ - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//types/known/structpb:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "ast_test.go", - "expr_test.go", - ], - embed = [ - ":go_default_library", - ], - deps = [ - "//checker:go_default_library", - "//checker/decls:go_default_library", - "//common:go_default_library", - "//common/containers:go_default_library", - "//common/decls:go_default_library", - "//common/overloads:go_default_library", - "//common/stdlib:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//parser:go_default_library", - "//test/proto3pb:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - ], -) \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/ast.go b/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/ast.go deleted file mode 100644 index b3c150793a94..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/ast.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2023 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 ast declares data structures useful for parsed and checked abstract syntax trees -package ast - -import ( - "fmt" - - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - - structpb "google.golang.org/protobuf/types/known/structpb" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// CheckedAST contains a protobuf expression and source info along with CEL-native type and reference information. -type CheckedAST struct { - Expr *exprpb.Expr - SourceInfo *exprpb.SourceInfo - TypeMap map[int64]*types.Type - ReferenceMap map[int64]*ReferenceInfo -} - -// CheckedASTToCheckedExpr converts a CheckedAST to a CheckedExpr protobouf. -func CheckedASTToCheckedExpr(ast *CheckedAST) (*exprpb.CheckedExpr, error) { - refMap := make(map[int64]*exprpb.Reference, len(ast.ReferenceMap)) - for id, ref := range ast.ReferenceMap { - r, err := ReferenceInfoToReferenceExpr(ref) - if err != nil { - return nil, err - } - refMap[id] = r - } - typeMap := make(map[int64]*exprpb.Type, len(ast.TypeMap)) - for id, typ := range ast.TypeMap { - t, err := types.TypeToExprType(typ) - if err != nil { - return nil, err - } - typeMap[id] = t - } - return &exprpb.CheckedExpr{ - Expr: ast.Expr, - SourceInfo: ast.SourceInfo, - ReferenceMap: refMap, - TypeMap: typeMap, - }, nil -} - -// CheckedExprToCheckedAST converts a CheckedExpr protobuf to a CheckedAST instance. -func CheckedExprToCheckedAST(checked *exprpb.CheckedExpr) (*CheckedAST, error) { - refMap := make(map[int64]*ReferenceInfo, len(checked.GetReferenceMap())) - for id, ref := range checked.GetReferenceMap() { - r, err := ReferenceExprToReferenceInfo(ref) - if err != nil { - return nil, err - } - refMap[id] = r - } - typeMap := make(map[int64]*types.Type, len(checked.GetTypeMap())) - for id, typ := range checked.GetTypeMap() { - t, err := types.ExprTypeToType(typ) - if err != nil { - return nil, err - } - typeMap[id] = t - } - return &CheckedAST{ - Expr: checked.GetExpr(), - SourceInfo: checked.GetSourceInfo(), - ReferenceMap: refMap, - TypeMap: typeMap, - }, nil -} - -// ReferenceInfo contains a CEL native representation of an identifier reference which may refer to -// either a qualified identifier name, a set of overload ids, or a constant value from an enum. -type ReferenceInfo struct { - Name string - OverloadIDs []string - Value ref.Val -} - -// NewIdentReference creates a ReferenceInfo instance for an identifier with an optional constant value. -func NewIdentReference(name string, value ref.Val) *ReferenceInfo { - return &ReferenceInfo{Name: name, Value: value} -} - -// NewFunctionReference creates a ReferenceInfo instance for a set of function overloads. -func NewFunctionReference(overloads ...string) *ReferenceInfo { - info := &ReferenceInfo{} - for _, id := range overloads { - info.AddOverload(id) - } - return info -} - -// AddOverload appends a function overload ID to the ReferenceInfo. -func (r *ReferenceInfo) AddOverload(overloadID string) { - for _, id := range r.OverloadIDs { - if id == overloadID { - return - } - } - r.OverloadIDs = append(r.OverloadIDs, overloadID) -} - -// Equals returns whether two references are identical to each other. -func (r *ReferenceInfo) Equals(other *ReferenceInfo) bool { - if r.Name != other.Name { - return false - } - if len(r.OverloadIDs) != len(other.OverloadIDs) { - return false - } - if len(r.OverloadIDs) != 0 { - overloadMap := make(map[string]struct{}, len(r.OverloadIDs)) - for _, id := range r.OverloadIDs { - overloadMap[id] = struct{}{} - } - for _, id := range other.OverloadIDs { - _, found := overloadMap[id] - if !found { - return false - } - } - } - if r.Value == nil && other.Value == nil { - return true - } - if r.Value == nil && other.Value != nil || - r.Value != nil && other.Value == nil || - r.Value.Equal(other.Value) != types.True { - return false - } - return true -} - -// ReferenceInfoToReferenceExpr converts a ReferenceInfo instance to a protobuf Reference suitable for serialization. -func ReferenceInfoToReferenceExpr(info *ReferenceInfo) (*exprpb.Reference, error) { - c, err := ValToConstant(info.Value) - if err != nil { - return nil, err - } - return &exprpb.Reference{ - Name: info.Name, - OverloadId: info.OverloadIDs, - Value: c, - }, nil -} - -// ReferenceExprToReferenceInfo converts a protobuf Reference into a CEL-native ReferenceInfo instance. -func ReferenceExprToReferenceInfo(ref *exprpb.Reference) (*ReferenceInfo, error) { - v, err := ConstantToVal(ref.GetValue()) - if err != nil { - return nil, err - } - return &ReferenceInfo{ - Name: ref.GetName(), - OverloadIDs: ref.GetOverloadId(), - Value: v, - }, nil -} - -// ValToConstant converts a CEL-native ref.Val to a protobuf Constant. -// -// Only simple scalar types are supported by this method. -func ValToConstant(v ref.Val) (*exprpb.Constant, error) { - if v == nil { - return nil, nil - } - switch v.Type() { - case types.BoolType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_BoolValue{BoolValue: v.Value().(bool)}}, nil - case types.BytesType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_BytesValue{BytesValue: v.Value().([]byte)}}, nil - case types.DoubleType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_DoubleValue{DoubleValue: v.Value().(float64)}}, nil - case types.IntType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_Int64Value{Int64Value: v.Value().(int64)}}, nil - case types.NullType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_NullValue{NullValue: structpb.NullValue_NULL_VALUE}}, nil - case types.StringType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_StringValue{StringValue: v.Value().(string)}}, nil - case types.UintType: - return &exprpb.Constant{ConstantKind: &exprpb.Constant_Uint64Value{Uint64Value: v.Value().(uint64)}}, nil - } - return nil, fmt.Errorf("unsupported constant kind: %v", v.Type()) -} - -// ConstantToVal converts a protobuf Constant to a CEL-native ref.Val. -func ConstantToVal(c *exprpb.Constant) (ref.Val, error) { - if c == nil { - return nil, nil - } - switch c.GetConstantKind().(type) { - case *exprpb.Constant_BoolValue: - return types.Bool(c.GetBoolValue()), nil - case *exprpb.Constant_BytesValue: - return types.Bytes(c.GetBytesValue()), nil - case *exprpb.Constant_DoubleValue: - return types.Double(c.GetDoubleValue()), nil - case *exprpb.Constant_Int64Value: - return types.Int(c.GetInt64Value()), nil - case *exprpb.Constant_NullValue: - return types.NullValue, nil - case *exprpb.Constant_StringValue: - return types.String(c.GetStringValue()), nil - case *exprpb.Constant_Uint64Value: - return types.Uint(c.GetUint64Value()), nil - } - return nil, fmt.Errorf("unsupported constant kind: %v", c.GetConstantKind()) -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/expr.go b/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/expr.go deleted file mode 100644 index b63884a6028a..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/ast/expr.go +++ /dev/null @@ -1,709 +0,0 @@ -// Copyright 2023 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 ast - -import ( - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// ExprKind represents the expression node kind. -type ExprKind int - -const ( - // UnspecifiedKind represents an unset expression with no specified properties. - UnspecifiedKind ExprKind = iota - - // LiteralKind represents a primitive scalar literal. - LiteralKind - - // IdentKind represents a simple variable, constant, or type identifier. - IdentKind - - // SelectKind represents a field selection expression. - SelectKind - - // CallKind represents a function call. - CallKind - - // ListKind represents a list literal expression. - ListKind - - // MapKind represents a map literal expression. - MapKind - - // StructKind represents a struct literal expression. - StructKind - - // ComprehensionKind represents a comprehension expression generated by a macro. - ComprehensionKind -) - -// NavigateCheckedAST converts a CheckedAST to a NavigableExpr -func NavigateCheckedAST(ast *CheckedAST) NavigableExpr { - return newNavigableExpr(nil, ast.Expr, ast.TypeMap) -} - -// ExprMatcher takes a NavigableExpr in and indicates whether the value is a match. -// -// This function type should be use with the `Match` and `MatchList` calls. -type ExprMatcher func(NavigableExpr) bool - -// ConstantValueMatcher returns an ExprMatcher which will return true if the input NavigableExpr -// is comprised of all constant values, such as a simple literal or even list and map literal. -func ConstantValueMatcher() ExprMatcher { - return matchIsConstantValue -} - -// KindMatcher returns an ExprMatcher which will return true if the input NavigableExpr.Kind() matches -// the specified `kind`. -func KindMatcher(kind ExprKind) ExprMatcher { - return func(e NavigableExpr) bool { - return e.Kind() == kind - } -} - -// FunctionMatcher returns an ExprMatcher which will match NavigableExpr nodes of CallKind type whose -// function name is equal to `funcName`. -func FunctionMatcher(funcName string) ExprMatcher { - return func(e NavigableExpr) bool { - if e.Kind() != CallKind { - return false - } - return e.AsCall().FunctionName() == funcName - } -} - -// AllMatcher returns true for all descendants of a NavigableExpr, effectively flattening them into a list. -// -// Such a result would work well with subsequent MatchList calls. -func AllMatcher() ExprMatcher { - return func(NavigableExpr) bool { - return true - } -} - -// MatchDescendants takes a NavigableExpr and ExprMatcher and produces a list of NavigableExpr values of the -// descendants which match. -func MatchDescendants(expr NavigableExpr, matcher ExprMatcher) []NavigableExpr { - return matchListInternal([]NavigableExpr{expr}, matcher, true) -} - -// MatchSubset applies an ExprMatcher to a list of NavigableExpr values and their descendants, producing a -// subset of NavigableExpr values which match. -func MatchSubset(exprs []NavigableExpr, matcher ExprMatcher) []NavigableExpr { - visit := make([]NavigableExpr, len(exprs)) - copy(visit, exprs) - return matchListInternal(visit, matcher, false) -} - -func matchListInternal(visit []NavigableExpr, matcher ExprMatcher, visitDescendants bool) []NavigableExpr { - var matched []NavigableExpr - for len(visit) != 0 { - e := visit[0] - if matcher(e) { - matched = append(matched, e) - } - if visitDescendants { - visit = append(visit[1:], e.Children()...) - } else { - visit = visit[1:] - } - } - return matched -} - -func matchIsConstantValue(e NavigableExpr) bool { - if e.Kind() == LiteralKind { - return true - } - if e.Kind() == StructKind || e.Kind() == MapKind || e.Kind() == ListKind { - for _, child := range e.Children() { - if !matchIsConstantValue(child) { - return false - } - } - return true - } - return false -} - -// NavigableExpr represents the base navigable expression value. -// -// Depending on the `Kind()` value, the NavigableExpr may be converted to a concrete expression types -// as indicated by the `As` methods. -// -// NavigableExpr values and their concrete expression types should be nil-safe. Conversion of an expr -// to the wrong kind should produce a nil value. -type NavigableExpr interface { - // ID of the expression as it appears in the AST - ID() int64 - - // Kind of the expression node. See ExprKind for the valid enum values. - Kind() ExprKind - - // Type of the expression node. - Type() *types.Type - - // Parent returns the parent expression node, if one exists. - Parent() (NavigableExpr, bool) - - // Children returns a list of child expression nodes. - Children() []NavigableExpr - - // ToExpr adapts this NavigableExpr to a protobuf representation. - ToExpr() *exprpb.Expr - - // AsCall adapts the expr into a NavigableCallExpr - // - // The Kind() must be equal to a CallKind for the conversion to be well-defined. - AsCall() NavigableCallExpr - - // AsComprehension adapts the expr into a NavigableComprehensionExpr. - // - // The Kind() must be equal to a ComprehensionKind for the conversion to be well-defined. - AsComprehension() NavigableComprehensionExpr - - // AsIdent adapts the expr into an identifier string. - // - // The Kind() must be equal to an IdentKind for the conversion to be well-defined. - AsIdent() string - - // AsLiteral adapts the expr into a constant ref.Val. - // - // The Kind() must be equal to a LiteralKind for the conversion to be well-defined. - AsLiteral() ref.Val - - // AsList adapts the expr into a NavigableListExpr. - // - // The Kind() must be equal to a ListKind for the conversion to be well-defined. - AsList() NavigableListExpr - - // AsMap adapts the expr into a NavigableMapExpr. - // - // The Kind() must be equal to a MapKind for the conversion to be well-defined. - AsMap() NavigableMapExpr - - // AsSelect adapts the expr into a NavigableSelectExpr. - // - // The Kind() must be equal to a SelectKind for the conversion to be well-defined. - AsSelect() NavigableSelectExpr - - // AsStruct adapts the expr into a NavigableStructExpr. - // - // The Kind() must be equal to a StructKind for the conversion to be well-defined. - AsStruct() NavigableStructExpr - - // marker interface method - isNavigable() -} - -// NavigableCallExpr defines an interface for inspecting a function call and its arugments. -type NavigableCallExpr interface { - // FunctionName returns the name of the function. - FunctionName() string - - // Target returns the target of the expression if one is present. - Target() NavigableExpr - - // Args returns the list of call arguments, excluding the target. - Args() []NavigableExpr - - // ReturnType returns the result type of the call. - ReturnType() *types.Type - - // marker interface method - isNavigable() -} - -// NavigableListExpr defines an interface for inspecting a list literal expression. -type NavigableListExpr interface { - // Elements returns the list elements as navigable expressions. - Elements() []NavigableExpr - - // OptionalIndicies returns the list of optional indices in the list literal. - OptionalIndices() []int32 - - // Size returns the number of elements in the list. - Size() int - - // marker interface method - isNavigable() -} - -// NavigableSelectExpr defines an interface for inspecting a select expression. -type NavigableSelectExpr interface { - // Operand returns the selection operand expression. - Operand() NavigableExpr - - // FieldName returns the field name being selected from the operand. - FieldName() string - - // IsTestOnly indicates whether the select expression is a presence test generated by a macro. - IsTestOnly() bool - - // marker interface method - isNavigable() -} - -// NavigableMapExpr defines an interface for inspecting a map expression. -type NavigableMapExpr interface { - // Entries returns the map key value pairs as NavigableEntry values. - Entries() []NavigableEntry - - // Size returns the number of entries in the map. - Size() int - - // marker interface method - isNavigable() -} - -// NavigableEntry defines an interface for inspecting a map entry. -type NavigableEntry interface { - // Key returns the map entry key expression. - Key() NavigableExpr - - // Value returns the map entry value expression. - Value() NavigableExpr - - // IsOptional returns whether the entry is optional. - IsOptional() bool - - // marker interface method - isNavigable() -} - -// NavigableStructExpr defines an interfaces for inspecting a struct and its field initializers. -type NavigableStructExpr interface { - // TypeName returns the struct type name. - TypeName() string - - // Fields returns the set of field initializers in the struct expression as NavigableField values. - Fields() []NavigableField - - // marker interface method - isNavigable() -} - -// NavigableField defines an interface for inspecting a struct field initialization. -type NavigableField interface { - // FieldName returns the name of the field. - FieldName() string - - // Value returns the field initialization expression. - Value() NavigableExpr - - // IsOptional returns whether the field is optional. - IsOptional() bool - - // marker interface method - isNavigable() -} - -// NavigableComprehensionExpr defines an interface for inspecting a comprehension expression. -type NavigableComprehensionExpr interface { - // IterRange returns the iteration range expression. - IterRange() NavigableExpr - - // IterVar returns the iteration variable name. - IterVar() string - - // AccuVar returns the accumulation variable name. - AccuVar() string - - // AccuInit returns the accumulation variable initialization expression. - AccuInit() NavigableExpr - - // LoopCondition returns the loop condition expression. - LoopCondition() NavigableExpr - - // LoopStep returns the loop step expression. - LoopStep() NavigableExpr - - // Result returns the comprehension result expression. - Result() NavigableExpr - - // marker interface method - isNavigable() -} - -func newNavigableExpr(parent NavigableExpr, expr *exprpb.Expr, typeMap map[int64]*types.Type) NavigableExpr { - kind, factory := kindOf(expr) - nav := &navigableExprImpl{ - parent: parent, - kind: kind, - expr: expr, - typeMap: typeMap, - createChildren: factory, - } - return nav -} - -type navigableExprImpl struct { - parent NavigableExpr - kind ExprKind - expr *exprpb.Expr - typeMap map[int64]*types.Type - createChildren childFactory -} - -func (nav *navigableExprImpl) ID() int64 { - return nav.ToExpr().GetId() -} - -func (nav *navigableExprImpl) Kind() ExprKind { - return nav.kind -} - -func (nav *navigableExprImpl) Type() *types.Type { - if t, found := nav.typeMap[nav.ID()]; found { - return t - } - return types.DynType -} - -func (nav *navigableExprImpl) Parent() (NavigableExpr, bool) { - if nav.parent != nil { - return nav.parent, true - } - return nil, false -} - -func (nav *navigableExprImpl) Children() []NavigableExpr { - return nav.createChildren(nav) -} - -func (nav *navigableExprImpl) ToExpr() *exprpb.Expr { - return nav.expr -} - -func (nav *navigableExprImpl) AsCall() NavigableCallExpr { - return navigableCallImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsComprehension() NavigableComprehensionExpr { - return navigableComprehensionImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsIdent() string { - return nav.ToExpr().GetIdentExpr().GetName() -} - -func (nav *navigableExprImpl) AsLiteral() ref.Val { - if nav.Kind() != LiteralKind { - return nil - } - val, err := ConstantToVal(nav.ToExpr().GetConstExpr()) - if err != nil { - panic(err) - } - return val -} - -func (nav *navigableExprImpl) AsList() NavigableListExpr { - return navigableListImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsMap() NavigableMapExpr { - return navigableMapImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsSelect() NavigableSelectExpr { - return navigableSelectImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) AsStruct() NavigableStructExpr { - return navigableStructImpl{navigableExprImpl: nav} -} - -func (nav *navigableExprImpl) createChild(e *exprpb.Expr) NavigableExpr { - return newNavigableExpr(nav, e, nav.typeMap) -} - -func (nav *navigableExprImpl) isNavigable() {} - -type navigableCallImpl struct { - *navigableExprImpl -} - -func (call navigableCallImpl) FunctionName() string { - return call.ToExpr().GetCallExpr().GetFunction() -} - -func (call navigableCallImpl) Target() NavigableExpr { - t := call.ToExpr().GetCallExpr().GetTarget() - if t != nil { - return call.createChild(t) - } - return nil -} - -func (call navigableCallImpl) Args() []NavigableExpr { - args := call.ToExpr().GetCallExpr().GetArgs() - navArgs := make([]NavigableExpr, len(args)) - for i, a := range args { - navArgs[i] = call.createChild(a) - } - return navArgs -} - -func (call navigableCallImpl) ReturnType() *types.Type { - return call.Type() -} - -type navigableComprehensionImpl struct { - *navigableExprImpl -} - -func (comp navigableComprehensionImpl) IterRange() NavigableExpr { - return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetIterRange()) -} - -func (comp navigableComprehensionImpl) IterVar() string { - return comp.ToExpr().GetComprehensionExpr().GetIterVar() -} - -func (comp navigableComprehensionImpl) AccuVar() string { - return comp.ToExpr().GetComprehensionExpr().GetAccuVar() -} - -func (comp navigableComprehensionImpl) AccuInit() NavigableExpr { - return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetAccuInit()) -} - -func (comp navigableComprehensionImpl) LoopCondition() NavigableExpr { - return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetLoopCondition()) -} - -func (comp navigableComprehensionImpl) LoopStep() NavigableExpr { - return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetLoopStep()) -} - -func (comp navigableComprehensionImpl) Result() NavigableExpr { - return comp.createChild(comp.ToExpr().GetComprehensionExpr().GetResult()) -} - -type navigableListImpl struct { - *navigableExprImpl -} - -func (l navigableListImpl) Elements() []NavigableExpr { - return l.Children() -} - -func (l navigableListImpl) OptionalIndices() []int32 { - return l.ToExpr().GetListExpr().GetOptionalIndices() -} - -func (l navigableListImpl) Size() int { - return len(l.ToExpr().GetListExpr().GetElements()) -} - -type navigableMapImpl struct { - *navigableExprImpl -} - -func (m navigableMapImpl) Entries() []NavigableEntry { - mapExpr := m.ToExpr().GetStructExpr() - entries := make([]NavigableEntry, len(mapExpr.GetEntries())) - for i, e := range mapExpr.GetEntries() { - entries[i] = navigableEntryImpl{ - key: m.createChild(e.GetMapKey()), - val: m.createChild(e.GetValue()), - isOpt: e.GetOptionalEntry(), - } - } - return entries -} - -func (m navigableMapImpl) Size() int { - return len(m.ToExpr().GetStructExpr().GetEntries()) -} - -type navigableEntryImpl struct { - key NavigableExpr - val NavigableExpr - isOpt bool -} - -func (e navigableEntryImpl) Key() NavigableExpr { - return e.key -} - -func (e navigableEntryImpl) Value() NavigableExpr { - return e.val -} - -func (e navigableEntryImpl) IsOptional() bool { - return e.isOpt -} - -func (e navigableEntryImpl) isNavigable() {} - -type navigableSelectImpl struct { - *navigableExprImpl -} - -func (sel navigableSelectImpl) FieldName() string { - return sel.ToExpr().GetSelectExpr().GetField() -} - -func (sel navigableSelectImpl) IsTestOnly() bool { - return sel.ToExpr().GetSelectExpr().GetTestOnly() -} - -func (sel navigableSelectImpl) Operand() NavigableExpr { - return sel.createChild(sel.ToExpr().GetSelectExpr().GetOperand()) -} - -type navigableStructImpl struct { - *navigableExprImpl -} - -func (s navigableStructImpl) TypeName() string { - return s.ToExpr().GetStructExpr().GetMessageName() -} - -func (s navigableStructImpl) Fields() []NavigableField { - fieldInits := s.ToExpr().GetStructExpr().GetEntries() - fields := make([]NavigableField, len(fieldInits)) - for i, f := range fieldInits { - fields[i] = navigableFieldImpl{ - name: f.GetFieldKey(), - val: s.createChild(f.GetValue()), - isOpt: f.GetOptionalEntry(), - } - } - return fields -} - -type navigableFieldImpl struct { - name string - val NavigableExpr - isOpt bool -} - -func (f navigableFieldImpl) FieldName() string { - return f.name -} - -func (f navigableFieldImpl) Value() NavigableExpr { - return f.val -} - -func (f navigableFieldImpl) IsOptional() bool { - return f.isOpt -} - -func (f navigableFieldImpl) isNavigable() {} - -func kindOf(expr *exprpb.Expr) (ExprKind, childFactory) { - switch expr.GetExprKind().(type) { - case *exprpb.Expr_ConstExpr: - return LiteralKind, noopFactory - case *exprpb.Expr_IdentExpr: - return IdentKind, noopFactory - case *exprpb.Expr_SelectExpr: - return SelectKind, selectFactory - case *exprpb.Expr_CallExpr: - return CallKind, callArgFactory - case *exprpb.Expr_ListExpr: - return ListKind, listElemFactory - case *exprpb.Expr_StructExpr: - if expr.GetStructExpr().GetMessageName() != "" { - return StructKind, structEntryFactory - } - return MapKind, mapEntryFactory - case *exprpb.Expr_ComprehensionExpr: - return ComprehensionKind, comprehensionFactory - default: - return UnspecifiedKind, noopFactory - } -} - -type childFactory func(*navigableExprImpl) []NavigableExpr - -func noopFactory(*navigableExprImpl) []NavigableExpr { - return nil -} - -func selectFactory(nav *navigableExprImpl) []NavigableExpr { - return []NavigableExpr{ - nav.createChild(nav.ToExpr().GetSelectExpr().GetOperand()), - } -} - -func callArgFactory(nav *navigableExprImpl) []NavigableExpr { - call := nav.ToExpr().GetCallExpr() - argCount := len(call.GetArgs()) - if call.GetTarget() != nil { - argCount++ - } - navExprs := make([]NavigableExpr, argCount) - i := 0 - if call.GetTarget() != nil { - navExprs[i] = nav.createChild(call.GetTarget()) - i++ - } - for _, arg := range call.GetArgs() { - navExprs[i] = nav.createChild(arg) - i++ - } - return navExprs -} - -func listElemFactory(nav *navigableExprImpl) []NavigableExpr { - l := nav.ToExpr().GetListExpr() - navExprs := make([]NavigableExpr, len(l.GetElements())) - for i, e := range l.GetElements() { - navExprs[i] = nav.createChild(e) - } - return navExprs -} - -func structEntryFactory(nav *navigableExprImpl) []NavigableExpr { - s := nav.ToExpr().GetStructExpr() - entries := make([]NavigableExpr, len(s.GetEntries())) - for i, e := range s.GetEntries() { - - entries[i] = nav.createChild(e.GetValue()) - } - return entries -} - -func mapEntryFactory(nav *navigableExprImpl) []NavigableExpr { - s := nav.ToExpr().GetStructExpr() - entries := make([]NavigableExpr, len(s.GetEntries())*2) - j := 0 - for _, e := range s.GetEntries() { - entries[j] = nav.createChild(e.GetMapKey()) - entries[j+1] = nav.createChild(e.GetValue()) - j += 2 - } - return entries -} - -func comprehensionFactory(nav *navigableExprImpl) []NavigableExpr { - compre := nav.ToExpr().GetComprehensionExpr() - return []NavigableExpr{ - nav.createChild(compre.GetIterRange()), - nav.createChild(compre.GetAccuInit()), - nav.createChild(compre.GetLoopCondition()), - nav.createChild(compre.GetLoopStep()), - nav.createChild(compre.GetResult()), - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/decls/BUILD.bazel b/cluster-autoscaler/vendor/github.com/google/cel-go/common/decls/BUILD.bazel deleted file mode 100644 index 17791dce6a0d..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/decls/BUILD.bazel +++ /dev/null @@ -1,39 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "decls.go", - ], - importpath = "github.com/google/cel-go/common/decls", - deps = [ - "//checker/decls:go_default_library", - "//common/functions:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "decls_test.go", - ], - embed = [":go_default_library"], - deps = [ - "//checker/decls:go_default_library", - "//common/overloads:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - "@org_golang_google_protobuf//proto:go_default_library", - ], -) diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/decls/decls.go b/cluster-autoscaler/vendor/github.com/google/cel-go/common/decls/decls.go deleted file mode 100644 index 734ebe57e526..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/decls/decls.go +++ /dev/null @@ -1,844 +0,0 @@ -// Copyright 2023 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 decls contains function and variable declaration structs and helper methods. -package decls - -import ( - "fmt" - "strings" - - chkdecls "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common/functions" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// NewFunction creates a new function declaration with a set of function options to configure overloads -// and function definitions (implementations). -// -// Functions are checked for name collisions and singleton redefinition. -func NewFunction(name string, opts ...FunctionOpt) (*FunctionDecl, error) { - fn := &FunctionDecl{ - name: name, - overloads: map[string]*OverloadDecl{}, - overloadOrdinals: []string{}, - } - var err error - for _, opt := range opts { - fn, err = opt(fn) - if err != nil { - return nil, err - } - } - if len(fn.overloads) == 0 { - return nil, fmt.Errorf("function %s must have at least one overload", name) - } - return fn, nil -} - -// FunctionDecl defines a function name, overload set, and optionally a singleton definition for all -// overload instances. -type FunctionDecl struct { - name string - - // overloads associated with the function name. - overloads map[string]*OverloadDecl - - // singleton implementation of the function for all overloads. - // - // If this option is set, an error will occur if any overloads specify a per-overload implementation - // or if another function with the same name attempts to redefine the singleton. - singleton *functions.Overload - - // disableTypeGuards is a performance optimization to disable detailed runtime type checks which could - // add overhead on common operations. Setting this option true leaves error checks and argument checks - // intact. - disableTypeGuards bool - - // state indicates that the binding should be provided as a declaration, as a runtime binding, or both. - state declarationState - - // overloadOrdinals indicates the order in which the overload was declared. - overloadOrdinals []string -} - -type declarationState int - -const ( - declarationStateUnset declarationState = iota - declarationDisabled - declarationEnabled -) - -// Name returns the function name in human-readable terms, e.g. 'contains' of 'math.least' -func (f *FunctionDecl) Name() string { - if f == nil { - return "" - } - return f.name -} - -// IsDeclarationDisabled indicates that the function implementation should be added to the dispatcher, but the -// declaration should not be exposed for use in expressions. -func (f *FunctionDecl) IsDeclarationDisabled() bool { - return f.state == declarationDisabled -} - -// Merge combines an existing function declaration with another. -// -// If a function is extended, by say adding new overloads to an existing function, then it is merged with the -// prior definition of the function at which point its overloads must not collide with pre-existing overloads -// and its bindings (singleton, or per-overload) must not conflict with previous definitions either. -func (f *FunctionDecl) Merge(other *FunctionDecl) (*FunctionDecl, error) { - if f == other { - return f, nil - } - if f.Name() != other.Name() { - return nil, fmt.Errorf("cannot merge unrelated functions. %s and %s", f.Name(), other.Name()) - } - merged := &FunctionDecl{ - name: f.Name(), - overloads: make(map[string]*OverloadDecl, len(f.overloads)), - singleton: f.singleton, - overloadOrdinals: make([]string, len(f.overloads)), - // if one function is expecting type-guards and the other is not, then they - // must not be disabled. - disableTypeGuards: f.disableTypeGuards && other.disableTypeGuards, - // default to the current functions declaration state. - state: f.state, - } - // If the other state indicates that the declaration should be explicitly enabled or - // disabled, then update the merged state with the most recent value. - if other.state != declarationStateUnset { - merged.state = other.state - } - // baseline copy of the overloads and their ordinals - copy(merged.overloadOrdinals, f.overloadOrdinals) - for oID, o := range f.overloads { - merged.overloads[oID] = o - } - // overloads and their ordinals are added from the left - for _, oID := range other.overloadOrdinals { - o := other.overloads[oID] - err := merged.AddOverload(o) - if err != nil { - return nil, fmt.Errorf("function declaration merge failed: %v", err) - } - } - if other.singleton != nil { - if merged.singleton != nil && merged.singleton != other.singleton { - return nil, fmt.Errorf("function already has a singleton binding: %s", f.Name()) - } - merged.singleton = other.singleton - } - return merged, nil -} - -// AddOverload ensures that the new overload does not collide with an existing overload signature; -// however, if the function signatures are identical, the implementation may be rewritten as its -// difficult to compare functions by object identity. -func (f *FunctionDecl) AddOverload(overload *OverloadDecl) error { - if f == nil { - return fmt.Errorf("nil function cannot add overload: %s", overload.ID()) - } - for oID, o := range f.overloads { - if oID != overload.ID() && o.SignatureOverlaps(overload) { - return fmt.Errorf("overload signature collision in function %s: %s collides with %s", f.Name(), oID, overload.ID()) - } - if oID == overload.ID() { - if o.SignatureEquals(overload) && o.IsNonStrict() == overload.IsNonStrict() { - // Allow redefinition of an overload implementation so long as the signatures match. - f.overloads[oID] = overload - return nil - } - return fmt.Errorf("overload redefinition in function. %s: %s has multiple definitions", f.Name(), oID) - } - } - f.overloadOrdinals = append(f.overloadOrdinals, overload.ID()) - f.overloads[overload.ID()] = overload - return nil -} - -// OverloadDecls returns the overload declarations in the order in which they were declared. -func (f *FunctionDecl) OverloadDecls() []*OverloadDecl { - if f == nil { - return []*OverloadDecl{} - } - overloads := make([]*OverloadDecl, 0, len(f.overloads)) - for _, oID := range f.overloadOrdinals { - overloads = append(overloads, f.overloads[oID]) - } - return overloads -} - -// Bindings produces a set of function bindings, if any are defined. -func (f *FunctionDecl) Bindings() ([]*functions.Overload, error) { - if f == nil { - return []*functions.Overload{}, nil - } - overloads := []*functions.Overload{} - nonStrict := false - for _, oID := range f.overloadOrdinals { - o := f.overloads[oID] - if o.hasBinding() { - overload := &functions.Overload{ - Operator: o.ID(), - Unary: o.guardedUnaryOp(f.Name(), f.disableTypeGuards), - Binary: o.guardedBinaryOp(f.Name(), f.disableTypeGuards), - Function: o.guardedFunctionOp(f.Name(), f.disableTypeGuards), - OperandTrait: o.OperandTrait(), - NonStrict: o.IsNonStrict(), - } - overloads = append(overloads, overload) - nonStrict = nonStrict || o.IsNonStrict() - } - } - if f.singleton != nil { - if len(overloads) != 0 { - return nil, fmt.Errorf("singleton function incompatible with specialized overloads: %s", f.Name()) - } - overloads = []*functions.Overload{ - { - Operator: f.Name(), - Unary: f.singleton.Unary, - Binary: f.singleton.Binary, - Function: f.singleton.Function, - OperandTrait: f.singleton.OperandTrait, - }, - } - // fall-through to return single overload case. - } - if len(overloads) == 0 { - return overloads, nil - } - // Single overload. Replicate an entry for it using the function name as well. - if len(overloads) == 1 { - if overloads[0].Operator == f.Name() { - return overloads, nil - } - return append(overloads, &functions.Overload{ - Operator: f.Name(), - Unary: overloads[0].Unary, - Binary: overloads[0].Binary, - Function: overloads[0].Function, - NonStrict: overloads[0].NonStrict, - OperandTrait: overloads[0].OperandTrait, - }), nil - } - // All of the defined overloads are wrapped into a top-level function which - // performs dynamic dispatch to the proper overload based on the argument types. - bindings := append([]*functions.Overload{}, overloads...) - funcDispatch := func(args ...ref.Val) ref.Val { - for _, oID := range f.overloadOrdinals { - o := f.overloads[oID] - // During dynamic dispatch over multiple functions, signature agreement checks - // are preserved in order to assist with the function resolution step. - switch len(args) { - case 1: - if o.unaryOp != nil && o.matchesRuntimeSignature( /* disableTypeGuards=*/ false, args...) { - return o.unaryOp(args[0]) - } - case 2: - if o.binaryOp != nil && o.matchesRuntimeSignature( /* disableTypeGuards=*/ false, args...) { - return o.binaryOp(args[0], args[1]) - } - } - if o.functionOp != nil && o.matchesRuntimeSignature( /* disableTypeGuards=*/ false, args...) { - return o.functionOp(args...) - } - // eventually this will fall through to the noSuchOverload below. - } - return MaybeNoSuchOverload(f.Name(), args...) - } - function := &functions.Overload{ - Operator: f.Name(), - Function: funcDispatch, - NonStrict: nonStrict, - } - return append(bindings, function), nil -} - -// MaybeNoSuchOverload determines whether to propagate an error if one is provided as an argument, or -// to return an unknown set, or to produce a new error for a missing function signature. -func MaybeNoSuchOverload(funcName string, args ...ref.Val) ref.Val { - argTypes := make([]string, len(args)) - var unk *types.Unknown = nil - for i, arg := range args { - if types.IsError(arg) { - return arg - } - if types.IsUnknown(arg) { - unk = types.MergeUnknowns(arg.(*types.Unknown), unk) - } - argTypes[i] = arg.Type().TypeName() - } - if unk != nil { - return unk - } - signature := strings.Join(argTypes, ", ") - return types.NewErr("no such overload: %s(%s)", funcName, signature) -} - -// FunctionOpt defines a functional option for mutating a function declaration. -type FunctionOpt func(*FunctionDecl) (*FunctionDecl, error) - -// DisableTypeGuards disables automatically generated function invocation guards on direct overload calls. -// Type guards remain on during dynamic dispatch for parsed-only expressions. -func DisableTypeGuards(value bool) FunctionOpt { - return func(fn *FunctionDecl) (*FunctionDecl, error) { - fn.disableTypeGuards = value - return fn, nil - } -} - -// DisableDeclaration indicates that the function declaration should be disabled, but the runtime function -// binding should be provided. Marking a function as runtime-only is a safe way to manage deprecations -// of function declarations while still preserving the runtime behavior for previously compiled expressions. -func DisableDeclaration(value bool) FunctionOpt { - return func(fn *FunctionDecl) (*FunctionDecl, error) { - if value { - fn.state = declarationDisabled - } else { - fn.state = declarationEnabled - } - return fn, nil - } -} - -// SingletonUnaryBinding creates a singleton function definition to be used for all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonUnaryBinding(fn functions.UnaryOp, traits ...int) FunctionOpt { - trait := 0 - for _, t := range traits { - trait = trait | t - } - return func(f *FunctionDecl) (*FunctionDecl, error) { - if f.singleton != nil { - return nil, fmt.Errorf("function already has a singleton binding: %s", f.Name()) - } - f.singleton = &functions.Overload{ - Operator: f.Name(), - Unary: fn, - OperandTrait: trait, - } - return f, nil - } -} - -// SingletonBinaryBinding creates a singleton function definition to be used with all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonBinaryBinding(fn functions.BinaryOp, traits ...int) FunctionOpt { - trait := 0 - for _, t := range traits { - trait = trait | t - } - return func(f *FunctionDecl) (*FunctionDecl, error) { - if f.singleton != nil { - return nil, fmt.Errorf("function already has a singleton binding: %s", f.Name()) - } - f.singleton = &functions.Overload{ - Operator: f.Name(), - Binary: fn, - OperandTrait: trait, - } - return f, nil - } -} - -// SingletonFunctionBinding creates a singleton function definition to be used with all function overloads. -// -// Note, this approach works well if operand is expected to have a specific trait which it implements, -// e.g. traits.ContainerType. Otherwise, prefer per-overload function bindings. -func SingletonFunctionBinding(fn functions.FunctionOp, traits ...int) FunctionOpt { - trait := 0 - for _, t := range traits { - trait = trait | t - } - return func(f *FunctionDecl) (*FunctionDecl, error) { - if f.singleton != nil { - return nil, fmt.Errorf("function already has a singleton binding: %s", f.Name()) - } - f.singleton = &functions.Overload{ - Operator: f.Name(), - Function: fn, - OperandTrait: trait, - } - return f, nil - } -} - -// Overload defines a new global overload with an overload id, argument types, and result type. Through the -// use of OverloadOpt options, the overload may also be configured with a binding, an operand trait, and to -// be non-strict. -// -// Note: function bindings should be commonly configured with Overload instances whereas operand traits and -// strict-ness should be rare occurrences. -func Overload(overloadID string, - args []*types.Type, resultType *types.Type, - opts ...OverloadOpt) FunctionOpt { - return newOverload(overloadID, false, args, resultType, opts...) -} - -// MemberOverload defines a new receiver-style overload (or member function) with an overload id, argument types, -// and result type. Through the use of OverloadOpt options, the overload may also be configured with a binding, -// an operand trait, and to be non-strict. -// -// Note: function bindings should be commonly configured with Overload instances whereas operand traits and -// strict-ness should be rare occurrences. -func MemberOverload(overloadID string, - args []*types.Type, resultType *types.Type, - opts ...OverloadOpt) FunctionOpt { - return newOverload(overloadID, true, args, resultType, opts...) -} - -func newOverload(overloadID string, - memberFunction bool, args []*types.Type, resultType *types.Type, - opts ...OverloadOpt) FunctionOpt { - return func(f *FunctionDecl) (*FunctionDecl, error) { - overload, err := newOverloadInternal(overloadID, memberFunction, args, resultType, opts...) - if err != nil { - return nil, err - } - err = f.AddOverload(overload) - if err != nil { - return nil, err - } - return f, nil - } -} - -func newOverloadInternal(overloadID string, - memberFunction bool, args []*types.Type, resultType *types.Type, - opts ...OverloadOpt) (*OverloadDecl, error) { - overload := &OverloadDecl{ - id: overloadID, - argTypes: args, - resultType: resultType, - isMemberFunction: memberFunction, - } - var err error - for _, opt := range opts { - overload, err = opt(overload) - if err != nil { - return nil, err - } - } - return overload, nil -} - -// OverloadDecl contains the definition of a single overload id with a specific signature, and an optional -// implementation. -type OverloadDecl struct { - id string - argTypes []*types.Type - resultType *types.Type - isMemberFunction bool - // nonStrict indicates that the function will accept error and unknown arguments as inputs. - nonStrict bool - // operandTrait indicates whether the member argument should have a specific type-trait. - // - // This is useful for creating overloads which operate on a type-interface rather than a concrete type. - operandTrait int - - // Function implementation options. Optional, but encouraged. - // unaryOp is a function binding that takes a single argument. - unaryOp functions.UnaryOp - // binaryOp is a function binding that takes two arguments. - binaryOp functions.BinaryOp - // functionOp is a catch-all for zero-arity and three-plus arity functions. - functionOp functions.FunctionOp -} - -// ID mirrors the overload signature and provides a unique id which may be referenced within the type-checker -// and interpreter to optimize performance. -// -// The ID format is usually one of two styles: -// global: __ -// member: ___ -func (o *OverloadDecl) ID() string { - if o == nil { - return "" - } - return o.id -} - -// ArgTypes contains the set of argument types expected by the overload. -// -// For member functions ArgTypes[0] represents the member operand type. -func (o *OverloadDecl) ArgTypes() []*types.Type { - if o == nil { - return emptyArgs - } - return o.argTypes -} - -// IsMemberFunction indicates whether the overload is a member function -func (o *OverloadDecl) IsMemberFunction() bool { - if o == nil { - return false - } - return o.isMemberFunction -} - -// IsNonStrict returns whether the overload accepts errors and unknown values as arguments. -func (o *OverloadDecl) IsNonStrict() bool { - if o == nil { - return false - } - return o.nonStrict -} - -// OperandTrait returns the trait mask of the first operand to the overload call, e.g. -// `traits.Indexer` -func (o *OverloadDecl) OperandTrait() int { - if o == nil { - return 0 - } - return o.operandTrait -} - -// ResultType indicates the output type from calling the function. -func (o *OverloadDecl) ResultType() *types.Type { - if o == nil { - // *types.Type is nil-safe - return nil - } - return o.resultType -} - -// TypeParams returns the type parameter names associated with the overload. -func (o *OverloadDecl) TypeParams() []string { - typeParams := map[string]struct{}{} - collectParamNames(typeParams, o.ResultType()) - for _, arg := range o.ArgTypes() { - collectParamNames(typeParams, arg) - } - params := make([]string, 0, len(typeParams)) - for param := range typeParams { - params = append(params, param) - } - return params -} - -// SignatureEquals determines whether the incoming overload declaration signature is equal to the current signature. -// -// Result type, operand trait, and strict-ness are not considered as part of signature equality. -func (o *OverloadDecl) SignatureEquals(other *OverloadDecl) bool { - if o == other { - return true - } - if o.ID() != other.ID() || o.IsMemberFunction() != other.IsMemberFunction() || len(o.ArgTypes()) != len(other.ArgTypes()) { - return false - } - for i, at := range o.ArgTypes() { - oat := other.ArgTypes()[i] - if !at.IsEquivalentType(oat) { - return false - } - } - return o.ResultType().IsEquivalentType(other.ResultType()) -} - -// SignatureOverlaps indicates whether two functions have non-equal, but overloapping function signatures. -// -// For example, list(dyn) collides with list(string) since the 'dyn' type can contain a 'string' type. -func (o *OverloadDecl) SignatureOverlaps(other *OverloadDecl) bool { - if o.IsMemberFunction() != other.IsMemberFunction() || len(o.ArgTypes()) != len(other.ArgTypes()) { - return false - } - argsOverlap := true - for i, argType := range o.ArgTypes() { - otherArgType := other.ArgTypes()[i] - argsOverlap = argsOverlap && - (argType.IsAssignableType(otherArgType) || - otherArgType.IsAssignableType(argType)) - } - return argsOverlap -} - -// hasBinding indicates whether the overload already has a definition. -func (o *OverloadDecl) hasBinding() bool { - return o != nil && (o.unaryOp != nil || o.binaryOp != nil || o.functionOp != nil) -} - -// guardedUnaryOp creates an invocation guard around the provided unary operator, if one is defined. -func (o *OverloadDecl) guardedUnaryOp(funcName string, disableTypeGuards bool) functions.UnaryOp { - if o.unaryOp == nil { - return nil - } - return func(arg ref.Val) ref.Val { - if !o.matchesRuntimeUnarySignature(disableTypeGuards, arg) { - return MaybeNoSuchOverload(funcName, arg) - } - return o.unaryOp(arg) - } -} - -// guardedBinaryOp creates an invocation guard around the provided binary operator, if one is defined. -func (o *OverloadDecl) guardedBinaryOp(funcName string, disableTypeGuards bool) functions.BinaryOp { - if o.binaryOp == nil { - return nil - } - return func(arg1, arg2 ref.Val) ref.Val { - if !o.matchesRuntimeBinarySignature(disableTypeGuards, arg1, arg2) { - return MaybeNoSuchOverload(funcName, arg1, arg2) - } - return o.binaryOp(arg1, arg2) - } -} - -// guardedFunctionOp creates an invocation guard around the provided variadic function binding, if one is provided. -func (o *OverloadDecl) guardedFunctionOp(funcName string, disableTypeGuards bool) functions.FunctionOp { - if o.functionOp == nil { - return nil - } - return func(args ...ref.Val) ref.Val { - if !o.matchesRuntimeSignature(disableTypeGuards, args...) { - return MaybeNoSuchOverload(funcName, args...) - } - return o.functionOp(args...) - } -} - -// matchesRuntimeUnarySignature indicates whether the argument type is runtime assiganble to the overload's expected argument. -func (o *OverloadDecl) matchesRuntimeUnarySignature(disableTypeGuards bool, arg ref.Val) bool { - return matchRuntimeArgType(o.IsNonStrict(), disableTypeGuards, o.ArgTypes()[0], arg) && - matchOperandTrait(o.OperandTrait(), arg) -} - -// matchesRuntimeBinarySignature indicates whether the argument types are runtime assiganble to the overload's expected arguments. -func (o *OverloadDecl) matchesRuntimeBinarySignature(disableTypeGuards bool, arg1, arg2 ref.Val) bool { - return matchRuntimeArgType(o.IsNonStrict(), disableTypeGuards, o.ArgTypes()[0], arg1) && - matchRuntimeArgType(o.IsNonStrict(), disableTypeGuards, o.ArgTypes()[1], arg2) && - matchOperandTrait(o.OperandTrait(), arg1) -} - -// matchesRuntimeSignature indicates whether the argument types are runtime assiganble to the overload's expected arguments. -func (o *OverloadDecl) matchesRuntimeSignature(disableTypeGuards bool, args ...ref.Val) bool { - if len(args) != len(o.ArgTypes()) { - return false - } - if len(args) == 0 { - return true - } - for i, arg := range args { - if !matchRuntimeArgType(o.IsNonStrict(), disableTypeGuards, o.ArgTypes()[i], arg) { - return false - } - } - return matchOperandTrait(o.OperandTrait(), args[0]) -} - -func matchRuntimeArgType(nonStrict, disableTypeGuards bool, argType *types.Type, arg ref.Val) bool { - if nonStrict && (disableTypeGuards || types.IsUnknownOrError(arg)) { - return true - } - if types.IsUnknownOrError(arg) { - return false - } - return disableTypeGuards || argType.IsAssignableRuntimeType(arg) -} - -func matchOperandTrait(trait int, arg ref.Val) bool { - return trait == 0 || arg.Type().HasTrait(trait) || types.IsUnknownOrError(arg) -} - -// OverloadOpt is a functional option for configuring a function overload. -type OverloadOpt func(*OverloadDecl) (*OverloadDecl, error) - -// UnaryBinding provides the implementation of a unary overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func UnaryBinding(binding functions.UnaryOp) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - if o.hasBinding() { - return nil, fmt.Errorf("overload already has a binding: %s", o.ID()) - } - if len(o.ArgTypes()) != 1 { - return nil, fmt.Errorf("unary function bound to non-unary overload: %s", o.ID()) - } - o.unaryOp = binding - return o, nil - } -} - -// BinaryBinding provides the implementation of a binary overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func BinaryBinding(binding functions.BinaryOp) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - if o.hasBinding() { - return nil, fmt.Errorf("overload already has a binding: %s", o.ID()) - } - if len(o.ArgTypes()) != 2 { - return nil, fmt.Errorf("binary function bound to non-binary overload: %s", o.ID()) - } - o.binaryOp = binding - return o, nil - } -} - -// FunctionBinding provides the implementation of a variadic overload. The provided function is protected by a runtime -// type-guard which ensures runtime type agreement between the overload signature and runtime argument types. -func FunctionBinding(binding functions.FunctionOp) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - if o.hasBinding() { - return nil, fmt.Errorf("overload already has a binding: %s", o.ID()) - } - o.functionOp = binding - return o, nil - } -} - -// OverloadIsNonStrict enables the function to be called with error and unknown argument values. -// -// Note: do not use this option unless absoluately necessary as it should be an uncommon feature. -func OverloadIsNonStrict() OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - o.nonStrict = true - return o, nil - } -} - -// OverloadOperandTrait configures a set of traits which the first argument to the overload must implement in order to be -// successfully invoked. -func OverloadOperandTrait(trait int) OverloadOpt { - return func(o *OverloadDecl) (*OverloadDecl, error) { - o.operandTrait = trait - return o, nil - } -} - -// NewConstant creates a new constant declaration. -func NewConstant(name string, t *types.Type, v ref.Val) *VariableDecl { - return &VariableDecl{name: name, varType: t, value: v} -} - -// NewVariable creates a new variable declaration. -func NewVariable(name string, t *types.Type) *VariableDecl { - return &VariableDecl{name: name, varType: t} -} - -// VariableDecl defines a variable declaration which may optionally have a constant value. -type VariableDecl struct { - name string - varType *types.Type - value ref.Val -} - -// Name returns the fully-qualified variable name -func (v *VariableDecl) Name() string { - if v == nil { - return "" - } - return v.name -} - -// Type returns the types.Type value associated with the variable. -func (v *VariableDecl) Type() *types.Type { - if v == nil { - // types.Type is nil-safe - return nil - } - return v.varType -} - -// Value returns the constant value associated with the declaration. -func (v *VariableDecl) Value() ref.Val { - if v == nil { - return nil - } - return v.value -} - -// DeclarationIsEquivalent returns true if one variable declaration has the same name and same type as the input. -func (v *VariableDecl) DeclarationIsEquivalent(other *VariableDecl) bool { - if v == other { - return true - } - return v.Name() == other.Name() && v.Type().IsEquivalentType(other.Type()) -} - -// VariableDeclToExprDecl converts a go-native variable declaration into a protobuf-type variable declaration. -func VariableDeclToExprDecl(v *VariableDecl) (*exprpb.Decl, error) { - varType, err := types.TypeToExprType(v.Type()) - if err != nil { - return nil, err - } - return chkdecls.NewVar(v.Name(), varType), nil -} - -// TypeVariable creates a new type identifier for use within a types.Provider -func TypeVariable(t *types.Type) *VariableDecl { - return NewVariable(t.TypeName(), types.NewTypeTypeWithParam(t)) -} - -// FunctionDeclToExprDecl converts a go-native function declaration into a protobuf-typed function declaration. -func FunctionDeclToExprDecl(f *FunctionDecl) (*exprpb.Decl, error) { - overloads := make([]*exprpb.Decl_FunctionDecl_Overload, len(f.overloads)) - for i, oID := range f.overloadOrdinals { - o := f.overloads[oID] - paramNames := map[string]struct{}{} - argTypes := make([]*exprpb.Type, len(o.ArgTypes())) - for j, a := range o.ArgTypes() { - collectParamNames(paramNames, a) - at, err := types.TypeToExprType(a) - if err != nil { - return nil, err - } - argTypes[j] = at - } - collectParamNames(paramNames, o.ResultType()) - resultType, err := types.TypeToExprType(o.ResultType()) - if err != nil { - return nil, err - } - if len(paramNames) == 0 { - if o.IsMemberFunction() { - overloads[i] = chkdecls.NewInstanceOverload(oID, argTypes, resultType) - } else { - overloads[i] = chkdecls.NewOverload(oID, argTypes, resultType) - } - } else { - params := []string{} - for pn := range paramNames { - params = append(params, pn) - } - if o.IsMemberFunction() { - overloads[i] = chkdecls.NewParameterizedInstanceOverload(oID, argTypes, resultType, params) - } else { - overloads[i] = chkdecls.NewParameterizedOverload(oID, argTypes, resultType, params) - } - } - } - return chkdecls.NewFunction(f.Name(), overloads...), nil -} - -func collectParamNames(paramNames map[string]struct{}, arg *types.Type) { - if arg.Kind() == types.TypeParamKind { - paramNames[arg.TypeName()] = struct{}{} - } - for _, param := range arg.Parameters() { - collectParamNames(paramNames, param) - } -} - -var ( - emptyArgs = []*types.Type{} -) diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/functions/BUILD.bazel b/cluster-autoscaler/vendor/github.com/google/cel-go/common/functions/BUILD.bazel deleted file mode 100644 index 3cc27d60ce31..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/functions/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "functions.go", - ], - importpath = "github.com/google/cel-go/common/functions", - deps = [ - "//common/types/ref:go_default_library", - ], -) diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/functions/functions.go b/cluster-autoscaler/vendor/github.com/google/cel-go/common/functions/functions.go deleted file mode 100644 index 67f4a5944e15..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/functions/functions.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2023 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 functions defines the standard builtin functions supported by the interpreter -package functions - -import "github.com/google/cel-go/common/types/ref" - -// Overload defines a named overload of a function, indicating an operand trait -// which must be present on the first argument to the overload as well as one -// of either a unary, binary, or function implementation. -// -// The majority of operators within the expression language are unary or binary -// and the specializations simplify the call contract for implementers of -// types with operator overloads. Any added complexity is assumed to be handled -// by the generic FunctionOp. -type Overload struct { - // Operator name as written in an expression or defined within - // operators.go. - Operator string - - // Operand trait used to dispatch the call. The zero-value indicates a - // global function overload or that one of the Unary / Binary / Function - // definitions should be used to execute the call. - OperandTrait int - - // Unary defines the overload with a UnaryOp implementation. May be nil. - Unary UnaryOp - - // Binary defines the overload with a BinaryOp implementation. May be nil. - Binary BinaryOp - - // Function defines the overload with a FunctionOp implementation. May be - // nil. - Function FunctionOp - - // NonStrict specifies whether the Overload will tolerate arguments that - // are types.Err or types.Unknown. - NonStrict bool -} - -// UnaryOp is a function that takes a single value and produces an output. -type UnaryOp func(value ref.Val) ref.Val - -// BinaryOp is a function that takes two values and produces an output. -type BinaryOp func(lhs ref.Val, rhs ref.Val) ref.Val - -// FunctionOp is a function with accepts zero or more arguments and produces -// a value or error as a result. -type FunctionOp func(values ...ref.Val) ref.Val diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel b/cluster-autoscaler/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel deleted file mode 100644 index c130a93f63fe..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/stdlib/BUILD.bazel +++ /dev/null @@ -1,25 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package( - default_visibility = ["//visibility:public"], - licenses = ["notice"], # Apache 2.0 -) - -go_library( - name = "go_default_library", - srcs = [ - "standard.go", - ], - importpath = "github.com/google/cel-go/common/stdlib", - deps = [ - "//checker/decls:go_default_library", - "//common/decls:go_default_library", - "//common/functions:go_default_library", - "//common/operators:go_default_library", - "//common/overloads:go_default_library", - "//common/types:go_default_library", - "//common/types/ref:go_default_library", - "//common/types/traits:go_default_library", - "@org_golang_google_genproto_googleapis_api//expr/v1alpha1:go_default_library", - ], -) \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/stdlib/standard.go b/cluster-autoscaler/vendor/github.com/google/cel-go/common/stdlib/standard.go deleted file mode 100644 index d02cb64bf1f9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/stdlib/standard.go +++ /dev/null @@ -1,661 +0,0 @@ -// Copyright 2018 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 stdlib contains all of the standard library function declarations and definitions for CEL. -package stdlib - -import ( - "github.com/google/cel-go/common/decls" - "github.com/google/cel-go/common/functions" - "github.com/google/cel-go/common/operators" - "github.com/google/cel-go/common/overloads" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -var ( - stdFunctions []*decls.FunctionDecl - stdFnDecls []*exprpb.Decl - stdTypes []*decls.VariableDecl - stdTypeDecls []*exprpb.Decl -) - -func init() { - paramA := types.NewTypeParamType("A") - paramB := types.NewTypeParamType("B") - listOfA := types.NewListType(paramA) - mapOfAB := types.NewMapType(paramA, paramB) - - stdTypes = []*decls.VariableDecl{ - decls.TypeVariable(types.BoolType), - decls.TypeVariable(types.BytesType), - decls.TypeVariable(types.DoubleType), - decls.TypeVariable(types.DurationType), - decls.TypeVariable(types.IntType), - decls.TypeVariable(listOfA), - decls.TypeVariable(mapOfAB), - decls.TypeVariable(types.NullType), - decls.TypeVariable(types.StringType), - decls.TypeVariable(types.TimestampType), - decls.TypeVariable(types.TypeType), - decls.TypeVariable(types.UintType), - } - - stdTypeDecls = make([]*exprpb.Decl, 0, len(stdTypes)) - for _, stdType := range stdTypes { - typeVar, err := decls.VariableDeclToExprDecl(stdType) - if err != nil { - panic(err) - } - stdTypeDecls = append(stdTypeDecls, typeVar) - } - - stdFunctions = []*decls.FunctionDecl{ - // Logical operators. Special-cased within the interpreter. - // Note, the singleton binding prevents extensions from overriding the operator behavior. - function(operators.Conditional, - decls.Overload(overloads.Conditional, argTypes(types.BoolType, paramA, paramA), paramA, - decls.OverloadIsNonStrict()), - decls.SingletonFunctionBinding(noFunctionOverrides)), - function(operators.LogicalAnd, - decls.Overload(overloads.LogicalAnd, argTypes(types.BoolType, types.BoolType), types.BoolType, - decls.OverloadIsNonStrict()), - decls.SingletonBinaryBinding(noBinaryOverrides)), - function(operators.LogicalOr, - decls.Overload(overloads.LogicalOr, argTypes(types.BoolType, types.BoolType), types.BoolType, - decls.OverloadIsNonStrict()), - decls.SingletonBinaryBinding(noBinaryOverrides)), - function(operators.LogicalNot, - decls.Overload(overloads.LogicalNot, argTypes(types.BoolType), types.BoolType), - decls.SingletonUnaryBinding(func(val ref.Val) ref.Val { - b, ok := val.(types.Bool) - if !ok { - return types.MaybeNoSuchOverloadErr(val) - } - return b.Negate() - })), - - // Comprehension short-circuiting related function - function(operators.NotStrictlyFalse, - decls.Overload(overloads.NotStrictlyFalse, argTypes(types.BoolType), types.BoolType, - decls.OverloadIsNonStrict(), - decls.UnaryBinding(notStrictlyFalse))), - // Deprecated: __not_strictly_false__ - function(operators.OldNotStrictlyFalse, - decls.DisableDeclaration(true), // safe deprecation - decls.Overload(operators.OldNotStrictlyFalse, argTypes(types.BoolType), types.BoolType, - decls.OverloadIsNonStrict(), - decls.UnaryBinding(notStrictlyFalse))), - - // Equality / inequality. Special-cased in the interpreter - function(operators.Equals, - decls.Overload(overloads.Equals, argTypes(paramA, paramA), types.BoolType), - decls.SingletonBinaryBinding(noBinaryOverrides)), - function(operators.NotEquals, - decls.Overload(overloads.NotEquals, argTypes(paramA, paramA), types.BoolType), - decls.SingletonBinaryBinding(noBinaryOverrides)), - - // Mathematical operators - function(operators.Add, - decls.Overload(overloads.AddBytes, - argTypes(types.BytesType, types.BytesType), types.BytesType), - decls.Overload(overloads.AddDouble, - argTypes(types.DoubleType, types.DoubleType), types.DoubleType), - decls.Overload(overloads.AddDurationDuration, - argTypes(types.DurationType, types.DurationType), types.DurationType), - decls.Overload(overloads.AddDurationTimestamp, - argTypes(types.DurationType, types.TimestampType), types.TimestampType), - decls.Overload(overloads.AddTimestampDuration, - argTypes(types.TimestampType, types.DurationType), types.TimestampType), - decls.Overload(overloads.AddInt64, - argTypes(types.IntType, types.IntType), types.IntType), - decls.Overload(overloads.AddList, - argTypes(listOfA, listOfA), listOfA), - decls.Overload(overloads.AddString, - argTypes(types.StringType, types.StringType), types.StringType), - decls.Overload(overloads.AddUint64, - argTypes(types.UintType, types.UintType), types.UintType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Adder).Add(rhs) - }, traits.AdderType)), - function(operators.Divide, - decls.Overload(overloads.DivideDouble, - argTypes(types.DoubleType, types.DoubleType), types.DoubleType), - decls.Overload(overloads.DivideInt64, - argTypes(types.IntType, types.IntType), types.IntType), - decls.Overload(overloads.DivideUint64, - argTypes(types.UintType, types.UintType), types.UintType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Divider).Divide(rhs) - }, traits.DividerType)), - function(operators.Modulo, - decls.Overload(overloads.ModuloInt64, - argTypes(types.IntType, types.IntType), types.IntType), - decls.Overload(overloads.ModuloUint64, - argTypes(types.UintType, types.UintType), types.UintType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Modder).Modulo(rhs) - }, traits.ModderType)), - function(operators.Multiply, - decls.Overload(overloads.MultiplyDouble, - argTypes(types.DoubleType, types.DoubleType), types.DoubleType), - decls.Overload(overloads.MultiplyInt64, - argTypes(types.IntType, types.IntType), types.IntType), - decls.Overload(overloads.MultiplyUint64, - argTypes(types.UintType, types.UintType), types.UintType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Multiplier).Multiply(rhs) - }, traits.MultiplierType)), - function(operators.Negate, - decls.Overload(overloads.NegateDouble, argTypes(types.DoubleType), types.DoubleType), - decls.Overload(overloads.NegateInt64, argTypes(types.IntType), types.IntType), - decls.SingletonUnaryBinding(func(val ref.Val) ref.Val { - if types.IsBool(val) { - return types.MaybeNoSuchOverloadErr(val) - } - return val.(traits.Negater).Negate() - }, traits.NegatorType)), - function(operators.Subtract, - decls.Overload(overloads.SubtractDouble, - argTypes(types.DoubleType, types.DoubleType), types.DoubleType), - decls.Overload(overloads.SubtractDurationDuration, - argTypes(types.DurationType, types.DurationType), types.DurationType), - decls.Overload(overloads.SubtractInt64, - argTypes(types.IntType, types.IntType), types.IntType), - decls.Overload(overloads.SubtractTimestampDuration, - argTypes(types.TimestampType, types.DurationType), types.TimestampType), - decls.Overload(overloads.SubtractTimestampTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.DurationType), - decls.Overload(overloads.SubtractUint64, - argTypes(types.UintType, types.UintType), types.UintType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Subtractor).Subtract(rhs) - }, traits.SubtractorType)), - - // Relations operators - - function(operators.Less, - decls.Overload(overloads.LessBool, - argTypes(types.BoolType, types.BoolType), types.BoolType), - decls.Overload(overloads.LessInt64, - argTypes(types.IntType, types.IntType), types.BoolType), - decls.Overload(overloads.LessInt64Double, - argTypes(types.IntType, types.DoubleType), types.BoolType), - decls.Overload(overloads.LessInt64Uint64, - argTypes(types.IntType, types.UintType), types.BoolType), - decls.Overload(overloads.LessUint64, - argTypes(types.UintType, types.UintType), types.BoolType), - decls.Overload(overloads.LessUint64Double, - argTypes(types.UintType, types.DoubleType), types.BoolType), - decls.Overload(overloads.LessUint64Int64, - argTypes(types.UintType, types.IntType), types.BoolType), - decls.Overload(overloads.LessDouble, - argTypes(types.DoubleType, types.DoubleType), types.BoolType), - decls.Overload(overloads.LessDoubleInt64, - argTypes(types.DoubleType, types.IntType), types.BoolType), - decls.Overload(overloads.LessDoubleUint64, - argTypes(types.DoubleType, types.UintType), types.BoolType), - decls.Overload(overloads.LessString, - argTypes(types.StringType, types.StringType), types.BoolType), - decls.Overload(overloads.LessBytes, - argTypes(types.BytesType, types.BytesType), types.BoolType), - decls.Overload(overloads.LessTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.BoolType), - decls.Overload(overloads.LessDuration, - argTypes(types.DurationType, types.DurationType), types.BoolType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - cmp := lhs.(traits.Comparer).Compare(rhs) - if cmp == types.IntNegOne { - return types.True - } - if cmp == types.IntOne || cmp == types.IntZero { - return types.False - } - return cmp - }, traits.ComparerType)), - - function(operators.LessEquals, - decls.Overload(overloads.LessEqualsBool, - argTypes(types.BoolType, types.BoolType), types.BoolType), - decls.Overload(overloads.LessEqualsInt64, - argTypes(types.IntType, types.IntType), types.BoolType), - decls.Overload(overloads.LessEqualsInt64Double, - argTypes(types.IntType, types.DoubleType), types.BoolType), - decls.Overload(overloads.LessEqualsInt64Uint64, - argTypes(types.IntType, types.UintType), types.BoolType), - decls.Overload(overloads.LessEqualsUint64, - argTypes(types.UintType, types.UintType), types.BoolType), - decls.Overload(overloads.LessEqualsUint64Double, - argTypes(types.UintType, types.DoubleType), types.BoolType), - decls.Overload(overloads.LessEqualsUint64Int64, - argTypes(types.UintType, types.IntType), types.BoolType), - decls.Overload(overloads.LessEqualsDouble, - argTypes(types.DoubleType, types.DoubleType), types.BoolType), - decls.Overload(overloads.LessEqualsDoubleInt64, - argTypes(types.DoubleType, types.IntType), types.BoolType), - decls.Overload(overloads.LessEqualsDoubleUint64, - argTypes(types.DoubleType, types.UintType), types.BoolType), - decls.Overload(overloads.LessEqualsString, - argTypes(types.StringType, types.StringType), types.BoolType), - decls.Overload(overloads.LessEqualsBytes, - argTypes(types.BytesType, types.BytesType), types.BoolType), - decls.Overload(overloads.LessEqualsTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.BoolType), - decls.Overload(overloads.LessEqualsDuration, - argTypes(types.DurationType, types.DurationType), types.BoolType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - cmp := lhs.(traits.Comparer).Compare(rhs) - if cmp == types.IntNegOne || cmp == types.IntZero { - return types.True - } - if cmp == types.IntOne { - return types.False - } - return cmp - }, traits.ComparerType)), - - function(operators.Greater, - decls.Overload(overloads.GreaterBool, - argTypes(types.BoolType, types.BoolType), types.BoolType), - decls.Overload(overloads.GreaterInt64, - argTypes(types.IntType, types.IntType), types.BoolType), - decls.Overload(overloads.GreaterInt64Double, - argTypes(types.IntType, types.DoubleType), types.BoolType), - decls.Overload(overloads.GreaterInt64Uint64, - argTypes(types.IntType, types.UintType), types.BoolType), - decls.Overload(overloads.GreaterUint64, - argTypes(types.UintType, types.UintType), types.BoolType), - decls.Overload(overloads.GreaterUint64Double, - argTypes(types.UintType, types.DoubleType), types.BoolType), - decls.Overload(overloads.GreaterUint64Int64, - argTypes(types.UintType, types.IntType), types.BoolType), - decls.Overload(overloads.GreaterDouble, - argTypes(types.DoubleType, types.DoubleType), types.BoolType), - decls.Overload(overloads.GreaterDoubleInt64, - argTypes(types.DoubleType, types.IntType), types.BoolType), - decls.Overload(overloads.GreaterDoubleUint64, - argTypes(types.DoubleType, types.UintType), types.BoolType), - decls.Overload(overloads.GreaterString, - argTypes(types.StringType, types.StringType), types.BoolType), - decls.Overload(overloads.GreaterBytes, - argTypes(types.BytesType, types.BytesType), types.BoolType), - decls.Overload(overloads.GreaterTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.BoolType), - decls.Overload(overloads.GreaterDuration, - argTypes(types.DurationType, types.DurationType), types.BoolType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - cmp := lhs.(traits.Comparer).Compare(rhs) - if cmp == types.IntOne { - return types.True - } - if cmp == types.IntNegOne || cmp == types.IntZero { - return types.False - } - return cmp - }, traits.ComparerType)), - - function(operators.GreaterEquals, - decls.Overload(overloads.GreaterEqualsBool, - argTypes(types.BoolType, types.BoolType), types.BoolType), - decls.Overload(overloads.GreaterEqualsInt64, - argTypes(types.IntType, types.IntType), types.BoolType), - decls.Overload(overloads.GreaterEqualsInt64Double, - argTypes(types.IntType, types.DoubleType), types.BoolType), - decls.Overload(overloads.GreaterEqualsInt64Uint64, - argTypes(types.IntType, types.UintType), types.BoolType), - decls.Overload(overloads.GreaterEqualsUint64, - argTypes(types.UintType, types.UintType), types.BoolType), - decls.Overload(overloads.GreaterEqualsUint64Double, - argTypes(types.UintType, types.DoubleType), types.BoolType), - decls.Overload(overloads.GreaterEqualsUint64Int64, - argTypes(types.UintType, types.IntType), types.BoolType), - decls.Overload(overloads.GreaterEqualsDouble, - argTypes(types.DoubleType, types.DoubleType), types.BoolType), - decls.Overload(overloads.GreaterEqualsDoubleInt64, - argTypes(types.DoubleType, types.IntType), types.BoolType), - decls.Overload(overloads.GreaterEqualsDoubleUint64, - argTypes(types.DoubleType, types.UintType), types.BoolType), - decls.Overload(overloads.GreaterEqualsString, - argTypes(types.StringType, types.StringType), types.BoolType), - decls.Overload(overloads.GreaterEqualsBytes, - argTypes(types.BytesType, types.BytesType), types.BoolType), - decls.Overload(overloads.GreaterEqualsTimestamp, - argTypes(types.TimestampType, types.TimestampType), types.BoolType), - decls.Overload(overloads.GreaterEqualsDuration, - argTypes(types.DurationType, types.DurationType), types.BoolType), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - cmp := lhs.(traits.Comparer).Compare(rhs) - if cmp == types.IntOne || cmp == types.IntZero { - return types.True - } - if cmp == types.IntNegOne { - return types.False - } - return cmp - }, traits.ComparerType)), - - // Indexing - function(operators.Index, - decls.Overload(overloads.IndexList, argTypes(listOfA, types.IntType), paramA), - decls.Overload(overloads.IndexMap, argTypes(mapOfAB, paramA), paramB), - decls.SingletonBinaryBinding(func(lhs, rhs ref.Val) ref.Val { - return lhs.(traits.Indexer).Get(rhs) - }, traits.IndexerType)), - - // Collections operators - function(operators.In, - decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType), - decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType), - decls.SingletonBinaryBinding(inAggregate)), - function(operators.OldIn, - decls.DisableDeclaration(true), // safe deprecation - decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType), - decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType), - decls.SingletonBinaryBinding(inAggregate)), - function(overloads.DeprecatedIn, - decls.DisableDeclaration(true), // safe deprecation - decls.Overload(overloads.InList, argTypes(paramA, listOfA), types.BoolType), - decls.Overload(overloads.InMap, argTypes(paramA, mapOfAB), types.BoolType), - decls.SingletonBinaryBinding(inAggregate)), - function(overloads.Size, - decls.Overload(overloads.SizeBytes, argTypes(types.BytesType), types.IntType), - decls.MemberOverload(overloads.SizeBytesInst, argTypes(types.BytesType), types.IntType), - decls.Overload(overloads.SizeList, argTypes(listOfA), types.IntType), - decls.MemberOverload(overloads.SizeListInst, argTypes(listOfA), types.IntType), - decls.Overload(overloads.SizeMap, argTypes(mapOfAB), types.IntType), - decls.MemberOverload(overloads.SizeMapInst, argTypes(mapOfAB), types.IntType), - decls.Overload(overloads.SizeString, argTypes(types.StringType), types.IntType), - decls.MemberOverload(overloads.SizeStringInst, argTypes(types.StringType), types.IntType), - decls.SingletonUnaryBinding(func(val ref.Val) ref.Val { - return val.(traits.Sizer).Size() - }, traits.SizerType)), - - // Type conversions - function(overloads.TypeConvertType, - decls.Overload(overloads.TypeConvertType, argTypes(paramA), types.NewTypeTypeWithParam(paramA)), - decls.SingletonUnaryBinding(convertToType(types.TypeType))), - - // Bool conversions - function(overloads.TypeConvertBool, - decls.Overload(overloads.BoolToBool, argTypes(types.BoolType), types.BoolType, - decls.UnaryBinding(identity)), - decls.Overload(overloads.StringToBool, argTypes(types.StringType), types.BoolType, - decls.UnaryBinding(convertToType(types.BoolType)))), - - // Bytes conversions - function(overloads.TypeConvertBytes, - decls.Overload(overloads.BytesToBytes, argTypes(types.BytesType), types.BytesType, - decls.UnaryBinding(identity)), - decls.Overload(overloads.StringToBytes, argTypes(types.StringType), types.BytesType, - decls.UnaryBinding(convertToType(types.BytesType)))), - - // Double conversions - function(overloads.TypeConvertDouble, - decls.Overload(overloads.DoubleToDouble, argTypes(types.DoubleType), types.DoubleType, - decls.UnaryBinding(identity)), - decls.Overload(overloads.IntToDouble, argTypes(types.IntType), types.DoubleType, - decls.UnaryBinding(convertToType(types.DoubleType))), - decls.Overload(overloads.StringToDouble, argTypes(types.StringType), types.DoubleType, - decls.UnaryBinding(convertToType(types.DoubleType))), - decls.Overload(overloads.UintToDouble, argTypes(types.UintType), types.DoubleType, - decls.UnaryBinding(convertToType(types.DoubleType)))), - - // Duration conversions - function(overloads.TypeConvertDuration, - decls.Overload(overloads.DurationToDuration, argTypes(types.DurationType), types.DurationType, - decls.UnaryBinding(identity)), - decls.Overload(overloads.IntToDuration, argTypes(types.IntType), types.DurationType, - decls.UnaryBinding(convertToType(types.DurationType))), - decls.Overload(overloads.StringToDuration, argTypes(types.StringType), types.DurationType, - decls.UnaryBinding(convertToType(types.DurationType)))), - - // Dyn conversions - function(overloads.TypeConvertDyn, - decls.Overload(overloads.ToDyn, argTypes(paramA), types.DynType), - decls.SingletonUnaryBinding(identity)), - - // Int conversions - function(overloads.TypeConvertInt, - decls.Overload(overloads.IntToInt, argTypes(types.IntType), types.IntType, - decls.UnaryBinding(identity)), - decls.Overload(overloads.DoubleToInt, argTypes(types.DoubleType), types.IntType, - decls.UnaryBinding(convertToType(types.IntType))), - decls.Overload(overloads.DurationToInt, argTypes(types.DurationType), types.IntType, - decls.UnaryBinding(convertToType(types.IntType))), - decls.Overload(overloads.StringToInt, argTypes(types.StringType), types.IntType, - decls.UnaryBinding(convertToType(types.IntType))), - decls.Overload(overloads.TimestampToInt, argTypes(types.TimestampType), types.IntType, - decls.UnaryBinding(convertToType(types.IntType))), - decls.Overload(overloads.UintToInt, argTypes(types.UintType), types.IntType, - decls.UnaryBinding(convertToType(types.IntType))), - ), - - // String conversions - function(overloads.TypeConvertString, - decls.Overload(overloads.StringToString, argTypes(types.StringType), types.StringType, - decls.UnaryBinding(identity)), - decls.Overload(overloads.BoolToString, argTypes(types.BoolType), types.StringType, - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.BytesToString, argTypes(types.BytesType), types.StringType, - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.DoubleToString, argTypes(types.DoubleType), types.StringType, - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.DurationToString, argTypes(types.DurationType), types.StringType, - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.IntToString, argTypes(types.IntType), types.StringType, - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.TimestampToString, argTypes(types.TimestampType), types.StringType, - decls.UnaryBinding(convertToType(types.StringType))), - decls.Overload(overloads.UintToString, argTypes(types.UintType), types.StringType, - decls.UnaryBinding(convertToType(types.StringType)))), - - // Timestamp conversions - function(overloads.TypeConvertTimestamp, - decls.Overload(overloads.TimestampToTimestamp, argTypes(types.TimestampType), types.TimestampType, - decls.UnaryBinding(identity)), - decls.Overload(overloads.IntToTimestamp, argTypes(types.IntType), types.TimestampType, - decls.UnaryBinding(convertToType(types.TimestampType))), - decls.Overload(overloads.StringToTimestamp, argTypes(types.StringType), types.TimestampType, - decls.UnaryBinding(convertToType(types.TimestampType)))), - - // Uint conversions - function(overloads.TypeConvertUint, - decls.Overload(overloads.UintToUint, argTypes(types.UintType), types.UintType, - decls.UnaryBinding(identity)), - decls.Overload(overloads.DoubleToUint, argTypes(types.DoubleType), types.UintType, - decls.UnaryBinding(convertToType(types.UintType))), - decls.Overload(overloads.IntToUint, argTypes(types.IntType), types.UintType, - decls.UnaryBinding(convertToType(types.UintType))), - decls.Overload(overloads.StringToUint, argTypes(types.StringType), types.UintType, - decls.UnaryBinding(convertToType(types.UintType)))), - - // String functions - function(overloads.Contains, - decls.MemberOverload(overloads.ContainsString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.BinaryBinding(types.StringContains)), - decls.DisableTypeGuards(true)), - function(overloads.EndsWith, - decls.MemberOverload(overloads.EndsWithString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.BinaryBinding(types.StringEndsWith)), - decls.DisableTypeGuards(true)), - function(overloads.StartsWith, - decls.MemberOverload(overloads.StartsWithString, - argTypes(types.StringType, types.StringType), types.BoolType, - decls.BinaryBinding(types.StringStartsWith)), - decls.DisableTypeGuards(true)), - function(overloads.Matches, - decls.Overload(overloads.Matches, argTypes(types.StringType, types.StringType), types.BoolType), - decls.MemberOverload(overloads.MatchesString, - argTypes(types.StringType, types.StringType), types.BoolType), - decls.SingletonBinaryBinding(func(str, pat ref.Val) ref.Val { - return str.(traits.Matcher).Match(pat) - }, traits.MatcherType)), - - // Timestamp / duration functions - function(overloads.TimeGetFullYear, - decls.MemberOverload(overloads.TimestampToYear, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToYearWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType)), - - function(overloads.TimeGetMonth, - decls.MemberOverload(overloads.TimestampToMonth, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToMonthWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType)), - - function(overloads.TimeGetDayOfYear, - decls.MemberOverload(overloads.TimestampToDayOfYear, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToDayOfYearWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType)), - - function(overloads.TimeGetDayOfMonth, - decls.MemberOverload(overloads.TimestampToDayOfMonthZeroBased, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToDayOfMonthZeroBasedWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType)), - - function(overloads.TimeGetDate, - decls.MemberOverload(overloads.TimestampToDayOfMonthOneBased, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToDayOfMonthOneBasedWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType)), - - function(overloads.TimeGetDayOfWeek, - decls.MemberOverload(overloads.TimestampToDayOfWeek, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToDayOfWeekWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType)), - - function(overloads.TimeGetHours, - decls.MemberOverload(overloads.TimestampToHours, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToHoursWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType), - decls.MemberOverload(overloads.DurationToHours, - argTypes(types.DurationType), types.IntType)), - - function(overloads.TimeGetMinutes, - decls.MemberOverload(overloads.TimestampToMinutes, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToMinutesWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType), - decls.MemberOverload(overloads.DurationToMinutes, - argTypes(types.DurationType), types.IntType)), - - function(overloads.TimeGetSeconds, - decls.MemberOverload(overloads.TimestampToSeconds, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToSecondsWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType), - decls.MemberOverload(overloads.DurationToSeconds, - argTypes(types.DurationType), types.IntType)), - - function(overloads.TimeGetMilliseconds, - decls.MemberOverload(overloads.TimestampToMilliseconds, - argTypes(types.TimestampType), types.IntType), - decls.MemberOverload(overloads.TimestampToMillisecondsWithTz, - argTypes(types.TimestampType, types.StringType), types.IntType), - decls.MemberOverload(overloads.DurationToMilliseconds, - argTypes(types.DurationType), types.IntType)), - } - - stdFnDecls = make([]*exprpb.Decl, 0, len(stdFunctions)) - for _, fn := range stdFunctions { - if fn.IsDeclarationDisabled() { - continue - } - ed, err := decls.FunctionDeclToExprDecl(fn) - if err != nil { - panic(err) - } - stdFnDecls = append(stdFnDecls, ed) - } -} - -// Functions returns the set of standard library function declarations and definitions for CEL. -func Functions() []*decls.FunctionDecl { - return stdFunctions -} - -// FunctionExprDecls returns the legacy style protobuf-typed declarations for all functions and overloads -// in the CEL standard environment. -// -// Deprecated: use Functions -func FunctionExprDecls() []*exprpb.Decl { - return stdFnDecls -} - -// Types returns the set of standard library types for CEL. -func Types() []*decls.VariableDecl { - return stdTypes -} - -// TypeExprDecls returns the legacy style protobuf-typed declarations for all types in the CEL -// standard environment. -// -// Deprecated: use Types -func TypeExprDecls() []*exprpb.Decl { - return stdTypeDecls -} - -func notStrictlyFalse(value ref.Val) ref.Val { - if types.IsBool(value) { - return value - } - return types.True -} - -func inAggregate(lhs ref.Val, rhs ref.Val) ref.Val { - if rhs.Type().HasTrait(traits.ContainerType) { - return rhs.(traits.Container).Contains(lhs) - } - return types.ValOrErr(rhs, "no such overload") -} - -func function(name string, opts ...decls.FunctionOpt) *decls.FunctionDecl { - fn, err := decls.NewFunction(name, opts...) - if err != nil { - panic(err) - } - return fn -} - -func argTypes(args ...*types.Type) []*types.Type { - return args -} - -func noBinaryOverrides(rhs, lhs ref.Val) ref.Val { - return types.NoSuchOverloadErr() -} - -func noFunctionOverrides(args ...ref.Val) ref.Val { - return types.NoSuchOverloadErr() -} - -func identity(val ref.Val) ref.Val { - return val -} - -func convertToType(t ref.Type) functions.UnaryOp { - return func(val ref.Val) ref.Val { - return val.ConvertToType(t) - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/common/types/types.go b/cluster-autoscaler/vendor/github.com/google/cel-go/common/types/types.go deleted file mode 100644 index 76624eefdee3..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/common/types/types.go +++ /dev/null @@ -1,806 +0,0 @@ -// Copyright 2023 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 types - -import ( - "fmt" - "reflect" - "strings" - - chkdecls "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// Kind indicates a CEL type's kind which is used to differentiate quickly between simple -// and complex types. -type Kind uint - -const ( - // UnspecifiedKind is returned when the type is nil or its kind is not specified. - UnspecifiedKind Kind = iota - - // DynKind represents a dynamic type. This kind only exists at type-check time. - DynKind - - // AnyKind represents a google.protobuf.Any type. This kind only exists at type-check time. - // Prefer DynKind to AnyKind as AnyKind has a specific meaning which is based on protobuf - // well-known types. - AnyKind - - // BoolKind represents a boolean type. - BoolKind - - // BytesKind represents a bytes type. - BytesKind - - // DoubleKind represents a double type. - DoubleKind - - // DurationKind represents a CEL duration type. - DurationKind - - // ErrorKind represents a CEL error type. - ErrorKind - - // IntKind represents an integer type. - IntKind - - // ListKind represents a list type. - ListKind - - // MapKind represents a map type. - MapKind - - // NullTypeKind represents a null type. - NullTypeKind - - // OpaqueKind represents an abstract type which has no accessible fields. - OpaqueKind - - // StringKind represents a string type. - StringKind - - // StructKind represents a structured object with typed fields. - StructKind - - // TimestampKind represents a a CEL time type. - TimestampKind - - // TypeKind represents the CEL type. - TypeKind - - // TypeParamKind represents a parameterized type whose type name will be resolved at type-check time, if possible. - TypeParamKind - - // UintKind represents a uint type. - UintKind - - // UnknownKind represents an unknown value type. - UnknownKind -) - -var ( - // AnyType represents the google.protobuf.Any type. - AnyType = &Type{ - kind: AnyKind, - runtimeTypeName: "google.protobuf.Any", - traitMask: traits.FieldTesterType | - traits.IndexerType, - } - // BoolType represents the bool type. - BoolType = &Type{ - kind: BoolKind, - runtimeTypeName: "bool", - traitMask: traits.ComparerType | - traits.NegatorType, - } - // BytesType represents the bytes type. - BytesType = &Type{ - kind: BytesKind, - runtimeTypeName: "bytes", - traitMask: traits.AdderType | - traits.ComparerType | - traits.SizerType, - } - // DoubleType represents the double type. - DoubleType = &Type{ - kind: DoubleKind, - runtimeTypeName: "double", - traitMask: traits.AdderType | - traits.ComparerType | - traits.DividerType | - traits.MultiplierType | - traits.NegatorType | - traits.SubtractorType, - } - // DurationType represents the CEL duration type. - DurationType = &Type{ - kind: DurationKind, - runtimeTypeName: "google.protobuf.Duration", - traitMask: traits.AdderType | - traits.ComparerType | - traits.NegatorType | - traits.ReceiverType | - traits.SubtractorType, - } - // DynType represents a dynamic CEL type whose type will be determined at runtime from context. - DynType = &Type{ - kind: DynKind, - runtimeTypeName: "dyn", - } - // ErrorType represents a CEL error value. - ErrorType = &Type{ - kind: ErrorKind, - runtimeTypeName: "error", - } - // IntType represents the int type. - IntType = &Type{ - kind: IntKind, - runtimeTypeName: "int", - traitMask: traits.AdderType | - traits.ComparerType | - traits.DividerType | - traits.ModderType | - traits.MultiplierType | - traits.NegatorType | - traits.SubtractorType, - } - // ListType represents the runtime list type. - ListType = NewListType(nil) - // MapType represents the runtime map type. - MapType = NewMapType(nil, nil) - // NullType represents the type of a null value. - NullType = &Type{ - kind: NullTypeKind, - runtimeTypeName: "null_type", - } - // StringType represents the string type. - StringType = &Type{ - kind: StringKind, - runtimeTypeName: "string", - traitMask: traits.AdderType | - traits.ComparerType | - traits.MatcherType | - traits.ReceiverType | - traits.SizerType, - } - // TimestampType represents the time type. - TimestampType = &Type{ - kind: TimestampKind, - runtimeTypeName: "google.protobuf.Timestamp", - traitMask: traits.AdderType | - traits.ComparerType | - traits.ReceiverType | - traits.SubtractorType, - } - // TypeType represents a CEL type - TypeType = &Type{ - kind: TypeKind, - runtimeTypeName: "type", - } - // UintType represents a uint type. - UintType = &Type{ - kind: UintKind, - runtimeTypeName: "uint", - traitMask: traits.AdderType | - traits.ComparerType | - traits.DividerType | - traits.ModderType | - traits.MultiplierType | - traits.SubtractorType, - } - // UnknownType represents an unknown value type. - UnknownType = &Type{ - kind: UnknownKind, - runtimeTypeName: "unknown", - } -) - -var _ ref.Type = &Type{} -var _ ref.Val = &Type{} - -// Type holds a reference to a runtime type with an optional type-checked set of type parameters. -type Type struct { - // kind indicates general category of the type. - kind Kind - - // parameters holds the optional type-checked set of type Parameters that are used during static analysis. - parameters []*Type - - // runtimeTypeName indicates the runtime type name of the type. - runtimeTypeName string - - // isAssignableType function determines whether one type is assignable to this type. - // A nil value for the isAssignableType function falls back to equality of kind, runtimeType, and parameters. - isAssignableType func(other *Type) bool - - // isAssignableRuntimeType function determines whether the runtime type (with erasure) is assignable to this type. - // A nil value for the isAssignableRuntimeType function falls back to the equality of the type or type name. - isAssignableRuntimeType func(other ref.Val) bool - - // traitMask is a mask of flags which indicate the capabilities of the type. - traitMask int -} - -// ConvertToNative implements ref.Val.ConvertToNative. -func (t *Type) ConvertToNative(typeDesc reflect.Type) (any, error) { - return nil, fmt.Errorf("type conversion not supported for 'type'") -} - -// ConvertToType implements ref.Val.ConvertToType. -func (t *Type) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case TypeType: - return TypeType - case StringType: - return String(t.TypeName()) - } - return NewErr("type conversion error from '%s' to '%s'", TypeType, typeVal) -} - -// Equal indicates whether two types have the same runtime type name. -// -// The name Equal is a bit of a misnomer, but for historical reasons, this is the -// runtime behavior. For a more accurate definition see IsType(). -func (t *Type) Equal(other ref.Val) ref.Val { - otherType, ok := other.(ref.Type) - return Bool(ok && t.TypeName() == otherType.TypeName()) -} - -// HasTrait implements the ref.Type interface method. -func (t *Type) HasTrait(trait int) bool { - return trait&t.traitMask == trait -} - -// IsExactType indicates whether the two types are exactly the same. This check also verifies type parameter type names. -func (t *Type) IsExactType(other *Type) bool { - return t.isTypeInternal(other, true) -} - -// IsEquivalentType indicates whether two types are equivalent. This check ignores type parameter type names. -func (t *Type) IsEquivalentType(other *Type) bool { - return t.isTypeInternal(other, false) -} - -// Kind indicates general category of the type. -func (t *Type) Kind() Kind { - if t == nil { - return UnspecifiedKind - } - return t.kind -} - -// isTypeInternal checks whether the two types are equivalent or exactly the same based on the checkTypeParamName flag. -func (t *Type) isTypeInternal(other *Type, checkTypeParamName bool) bool { - if t == nil { - return false - } - if t == other { - return true - } - if t.Kind() != other.Kind() || len(t.Parameters()) != len(other.Parameters()) { - return false - } - if (checkTypeParamName || t.Kind() != TypeParamKind) && t.TypeName() != other.TypeName() { - return false - } - for i, p := range t.Parameters() { - if !p.isTypeInternal(other.Parameters()[i], checkTypeParamName) { - return false - } - } - return true -} - -// IsAssignableType determines whether the current type is type-check assignable from the input fromType. -func (t *Type) IsAssignableType(fromType *Type) bool { - if t == nil { - return false - } - if t.isAssignableType != nil { - return t.isAssignableType(fromType) - } - return t.defaultIsAssignableType(fromType) -} - -// IsAssignableRuntimeType determines whether the current type is runtime assignable from the input runtimeType. -// -// At runtime, parameterized types are erased and so a function which type-checks to support a map(string, string) -// will have a runtime assignable type of a map. -func (t *Type) IsAssignableRuntimeType(val ref.Val) bool { - if t == nil { - return false - } - if t.isAssignableRuntimeType != nil { - return t.isAssignableRuntimeType(val) - } - return t.defaultIsAssignableRuntimeType(val) -} - -// Parameters returns the list of type parameters if set. -// -// For ListKind, Parameters()[0] represents the list element type -// For MapKind, Parameters()[0] represents the map key type, and Parameters()[1] represents the map -// value type. -func (t *Type) Parameters() []*Type { - if t == nil { - return emptyParams - } - return t.parameters -} - -// DeclaredTypeName indicates the fully qualified and parameterized type-check type name. -func (t *Type) DeclaredTypeName() string { - // if the type itself is neither null, nor dyn, but is assignable to null, then it's a wrapper type. - if t.Kind() != NullTypeKind && !t.isDyn() && t.IsAssignableType(NullType) { - return fmt.Sprintf("wrapper(%s)", t.TypeName()) - } - return t.TypeName() -} - -// Type implements the ref.Val interface method. -func (t *Type) Type() ref.Type { - return TypeType -} - -// Value implements the ref.Val interface method. -func (t *Type) Value() any { - return t.TypeName() -} - -// TypeName returns the type-erased fully qualified runtime type name. -// -// TypeName implements the ref.Type interface method. -func (t *Type) TypeName() string { - if t == nil { - return "" - } - return t.runtimeTypeName -} - -// String returns a human-readable definition of the type name. -func (t *Type) String() string { - if len(t.Parameters()) == 0 { - return t.DeclaredTypeName() - } - params := make([]string, len(t.Parameters())) - for i, p := range t.Parameters() { - params[i] = p.String() - } - return fmt.Sprintf("%s(%s)", t.DeclaredTypeName(), strings.Join(params, ", ")) -} - -// isDyn indicates whether the type is dynamic in any way. -func (t *Type) isDyn() bool { - k := t.Kind() - return k == DynKind || k == AnyKind || k == TypeParamKind -} - -// defaultIsAssignableType provides the standard definition of what it means for one type to be assignable to another -// where any of the following may return a true result: -// - The from types are the same instance -// - The target type is dynamic -// - The fromType has the same kind and type name as the target type, and all parameters of the target type -// -// are IsAssignableType() from the parameters of the fromType. -func (t *Type) defaultIsAssignableType(fromType *Type) bool { - if t == fromType || t.isDyn() { - return true - } - if t.Kind() != fromType.Kind() || - t.TypeName() != fromType.TypeName() || - len(t.Parameters()) != len(fromType.Parameters()) { - return false - } - for i, tp := range t.Parameters() { - fp := fromType.Parameters()[i] - if !tp.IsAssignableType(fp) { - return false - } - } - return true -} - -// defaultIsAssignableRuntimeType inspects the type and in the case of list and map elements, the key and element types -// to determine whether a ref.Val is assignable to the declared type for a function signature. -func (t *Type) defaultIsAssignableRuntimeType(val ref.Val) bool { - valType := val.Type() - // If the current type and value type don't agree, then return - if !(t.isDyn() || t.TypeName() == valType.TypeName()) { - return false - } - switch t.Kind() { - case ListKind: - elemType := t.Parameters()[0] - l := val.(traits.Lister) - if l.Size() == IntZero { - return true - } - it := l.Iterator() - elemVal := it.Next() - return elemType.IsAssignableRuntimeType(elemVal) - case MapKind: - keyType := t.Parameters()[0] - elemType := t.Parameters()[1] - m := val.(traits.Mapper) - if m.Size() == IntZero { - return true - } - it := m.Iterator() - keyVal := it.Next() - elemVal := m.Get(keyVal) - return keyType.IsAssignableRuntimeType(keyVal) && elemType.IsAssignableRuntimeType(elemVal) - } - return true -} - -// NewListType creates an instances of a list type value with the provided element type. -func NewListType(elemType *Type) *Type { - return &Type{ - kind: ListKind, - parameters: []*Type{elemType}, - runtimeTypeName: "list", - traitMask: traits.AdderType | - traits.ContainerType | - traits.IndexerType | - traits.IterableType | - traits.SizerType, - } -} - -// NewMapType creates an instance of a map type value with the provided key and value types. -func NewMapType(keyType, valueType *Type) *Type { - return &Type{ - kind: MapKind, - parameters: []*Type{keyType, valueType}, - runtimeTypeName: "map", - traitMask: traits.ContainerType | - traits.IndexerType | - traits.IterableType | - traits.SizerType, - } -} - -// NewNullableType creates an instance of a nullable type with the provided wrapped type. -// -// Note: only primitive types are supported as wrapped types. -func NewNullableType(wrapped *Type) *Type { - return &Type{ - kind: wrapped.Kind(), - parameters: wrapped.Parameters(), - runtimeTypeName: wrapped.TypeName(), - traitMask: wrapped.traitMask, - isAssignableType: func(other *Type) bool { - return NullType.IsAssignableType(other) || wrapped.IsAssignableType(other) - }, - isAssignableRuntimeType: func(other ref.Val) bool { - return NullType.IsAssignableRuntimeType(other) || wrapped.IsAssignableRuntimeType(other) - }, - } -} - -// NewOptionalType creates an abstract parameterized type instance corresponding to CEL's notion of optional. -func NewOptionalType(param *Type) *Type { - return NewOpaqueType("optional", param) -} - -// NewOpaqueType creates an abstract parameterized type with a given name. -func NewOpaqueType(name string, params ...*Type) *Type { - return &Type{ - kind: OpaqueKind, - parameters: params, - runtimeTypeName: name, - } -} - -// NewObjectType creates a type reference to an externally defined type, e.g. a protobuf message type. -// -// An object type is assumed to support field presence testing and field indexing. Additionally, the -// type may also indicate additional traits through the use of the optional traits vararg argument. -func NewObjectType(typeName string, traits ...int) *Type { - // Function sanitizes object types on the fly - if wkt, found := checkedWellKnowns[typeName]; found { - return wkt - } - traitMask := 0 - for _, trait := range traits { - traitMask |= trait - } - return &Type{ - kind: StructKind, - parameters: emptyParams, - runtimeTypeName: typeName, - traitMask: structTypeTraitMask | traitMask, - } -} - -// NewObjectTypeValue creates a type reference to an externally defined type. -// -// Deprecated: use cel.ObjectType(typeName) -func NewObjectTypeValue(typeName string) *Type { - return NewObjectType(typeName) -} - -// NewTypeValue creates an opaque type which has a set of optional type traits as defined in -// the common/types/traits package. -// -// Deprecated: use cel.ObjectType(typeName, traits) -func NewTypeValue(typeName string, traits ...int) *Type { - traitMask := 0 - for _, trait := range traits { - traitMask |= trait - } - return &Type{ - kind: StructKind, - parameters: emptyParams, - runtimeTypeName: typeName, - traitMask: traitMask, - } -} - -// NewTypeParamType creates a parameterized type instance. -func NewTypeParamType(paramName string) *Type { - return &Type{ - kind: TypeParamKind, - runtimeTypeName: paramName, - } -} - -// NewTypeTypeWithParam creates a type with a type parameter. -// Used for type-checking purposes, but equivalent to TypeType otherwise. -func NewTypeTypeWithParam(param *Type) *Type { - return &Type{ - kind: TypeKind, - runtimeTypeName: "type", - parameters: []*Type{param}, - } -} - -// TypeToExprType converts a CEL-native type representation to a protobuf CEL Type representation. -func TypeToExprType(t *Type) (*exprpb.Type, error) { - switch t.Kind() { - case AnyKind: - return chkdecls.Any, nil - case BoolKind: - return maybeWrapper(t, chkdecls.Bool), nil - case BytesKind: - return maybeWrapper(t, chkdecls.Bytes), nil - case DoubleKind: - return maybeWrapper(t, chkdecls.Double), nil - case DurationKind: - return chkdecls.Duration, nil - case DynKind: - return chkdecls.Dyn, nil - case ErrorKind: - return chkdecls.Error, nil - case IntKind: - return maybeWrapper(t, chkdecls.Int), nil - case ListKind: - if len(t.Parameters()) != 1 { - return nil, fmt.Errorf("invalid list, got %d parameters, wanted one", len(t.Parameters())) - } - et, err := TypeToExprType(t.Parameters()[0]) - if err != nil { - return nil, err - } - return chkdecls.NewListType(et), nil - case MapKind: - if len(t.Parameters()) != 2 { - return nil, fmt.Errorf("invalid map, got %d parameters, wanted two", len(t.Parameters())) - } - kt, err := TypeToExprType(t.Parameters()[0]) - if err != nil { - return nil, err - } - vt, err := TypeToExprType(t.Parameters()[1]) - if err != nil { - return nil, err - } - return chkdecls.NewMapType(kt, vt), nil - case NullTypeKind: - return chkdecls.Null, nil - case OpaqueKind: - params := make([]*exprpb.Type, len(t.Parameters())) - for i, p := range t.Parameters() { - pt, err := TypeToExprType(p) - if err != nil { - return nil, err - } - params[i] = pt - } - return chkdecls.NewAbstractType(t.TypeName(), params...), nil - case StringKind: - return maybeWrapper(t, chkdecls.String), nil - case StructKind: - return chkdecls.NewObjectType(t.TypeName()), nil - case TimestampKind: - return chkdecls.Timestamp, nil - case TypeParamKind: - return chkdecls.NewTypeParamType(t.TypeName()), nil - case TypeKind: - if len(t.Parameters()) == 1 { - p, err := TypeToExprType(t.Parameters()[0]) - if err != nil { - return nil, err - } - return chkdecls.NewTypeType(p), nil - } - return chkdecls.NewTypeType(nil), nil - case UintKind: - return maybeWrapper(t, chkdecls.Uint), nil - } - return nil, fmt.Errorf("missing type conversion to proto: %v", t) -} - -// ExprTypeToType converts a protobuf CEL type representation to a CEL-native type representation. -func ExprTypeToType(t *exprpb.Type) (*Type, error) { - switch t.GetTypeKind().(type) { - case *exprpb.Type_Dyn: - return DynType, nil - case *exprpb.Type_AbstractType_: - paramTypes := make([]*Type, len(t.GetAbstractType().GetParameterTypes())) - for i, p := range t.GetAbstractType().GetParameterTypes() { - pt, err := ExprTypeToType(p) - if err != nil { - return nil, err - } - paramTypes[i] = pt - } - return NewOpaqueType(t.GetAbstractType().GetName(), paramTypes...), nil - case *exprpb.Type_ListType_: - et, err := ExprTypeToType(t.GetListType().GetElemType()) - if err != nil { - return nil, err - } - return NewListType(et), nil - case *exprpb.Type_MapType_: - kt, err := ExprTypeToType(t.GetMapType().GetKeyType()) - if err != nil { - return nil, err - } - vt, err := ExprTypeToType(t.GetMapType().GetValueType()) - if err != nil { - return nil, err - } - return NewMapType(kt, vt), nil - case *exprpb.Type_MessageType: - return NewObjectType(t.GetMessageType()), nil - case *exprpb.Type_Null: - return NullType, nil - case *exprpb.Type_Primitive: - switch t.GetPrimitive() { - case exprpb.Type_BOOL: - return BoolType, nil - case exprpb.Type_BYTES: - return BytesType, nil - case exprpb.Type_DOUBLE: - return DoubleType, nil - case exprpb.Type_INT64: - return IntType, nil - case exprpb.Type_STRING: - return StringType, nil - case exprpb.Type_UINT64: - return UintType, nil - default: - return nil, fmt.Errorf("unsupported primitive type: %v", t) - } - case *exprpb.Type_TypeParam: - return NewTypeParamType(t.GetTypeParam()), nil - case *exprpb.Type_Type: - if t.GetType().GetTypeKind() != nil { - p, err := ExprTypeToType(t.GetType()) - if err != nil { - return nil, err - } - return NewTypeTypeWithParam(p), nil - } - return TypeType, nil - case *exprpb.Type_WellKnown: - switch t.GetWellKnown() { - case exprpb.Type_ANY: - return AnyType, nil - case exprpb.Type_DURATION: - return DurationType, nil - case exprpb.Type_TIMESTAMP: - return TimestampType, nil - default: - return nil, fmt.Errorf("unsupported well-known type: %v", t) - } - case *exprpb.Type_Wrapper: - t, err := ExprTypeToType(&exprpb.Type{TypeKind: &exprpb.Type_Primitive{Primitive: t.GetWrapper()}}) - if err != nil { - return nil, err - } - return NewNullableType(t), nil - case *exprpb.Type_Error: - return ErrorType, nil - default: - return nil, fmt.Errorf("unsupported type: %v", t) - } -} - -func maybeWrapper(t *Type, pbType *exprpb.Type) *exprpb.Type { - if t.IsAssignableType(NullType) { - return chkdecls.NewWrapperType(pbType) - } - return pbType -} - -func maybeForeignType(t ref.Type) *Type { - if celType, ok := t.(*Type); ok { - return celType - } - // Inspect the incoming type to determine its traits. The assumption will be that the incoming - // type does not have any field values; however, if the trait mask indicates that field testing - // and indexing are supported, the foreign type is marked as a struct. - traitMask := 0 - for _, trait := range allTraits { - if t.HasTrait(trait) { - traitMask |= trait - } - } - // Treat the value like a struct. If it has no fields, this is harmless to denote the type - // as such since it basically becomes an opaque type by convention. - return NewObjectType(t.TypeName(), traitMask) -} - -var ( - checkedWellKnowns = map[string]*Type{ - // Wrapper types. - "google.protobuf.BoolValue": NewNullableType(BoolType), - "google.protobuf.BytesValue": NewNullableType(BytesType), - "google.protobuf.DoubleValue": NewNullableType(DoubleType), - "google.protobuf.FloatValue": NewNullableType(DoubleType), - "google.protobuf.Int64Value": NewNullableType(IntType), - "google.protobuf.Int32Value": NewNullableType(IntType), - "google.protobuf.UInt64Value": NewNullableType(UintType), - "google.protobuf.UInt32Value": NewNullableType(UintType), - "google.protobuf.StringValue": NewNullableType(StringType), - // Well-known types. - "google.protobuf.Any": AnyType, - "google.protobuf.Duration": DurationType, - "google.protobuf.Timestamp": TimestampType, - // Json types. - "google.protobuf.ListValue": NewListType(DynType), - "google.protobuf.NullValue": NullType, - "google.protobuf.Struct": NewMapType(StringType, DynType), - "google.protobuf.Value": DynType, - } - - emptyParams = []*Type{} - - allTraits = []int{ - traits.AdderType, - traits.ComparerType, - traits.ContainerType, - traits.DividerType, - traits.FieldTesterType, - traits.IndexerType, - traits.IterableType, - traits.IteratorType, - traits.MatcherType, - traits.ModderType, - traits.MultiplierType, - traits.NegatorType, - traits.ReceiverType, - traits.SizerType, - traits.SubtractorType, - } - - structTypeTraitMask = traits.FieldTesterType | traits.IndexerType -) diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/ext/bindings.go b/cluster-autoscaler/vendor/github.com/google/cel-go/ext/bindings.go deleted file mode 100644 index 4ac9a7f07fcc..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/ext/bindings.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 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 ext - -import ( - "github.com/google/cel-go/cel" - - exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" -) - -// Bindings returns a cel.EnvOption to configure support for local variable -// bindings in expressions. -// -// # Cel.Bind -// -// Binds a simple identifier to an initialization expression which may be used -// in a subsequenct result expression. Bindings may also be nested within each -// other. -// -// cel.bind(, , ) -// -// Examples: -// -// cel.bind(a, 'hello', -// cel.bind(b, 'world', a + b + b + a)) // "helloworldworldhello" -// -// // Avoid a list allocation within the exists comprehension. -// cel.bind(valid_values, [a, b, c], -// [d, e, f].exists(elem, elem in valid_values)) -// -// Local bindings are not guaranteed to be evaluated before use. -func Bindings() cel.EnvOption { - return cel.Lib(celBindings{}) -} - -const ( - celNamespace = "cel" - bindMacro = "bind" - unusedIterVar = "#unused" -) - -type celBindings struct{} - -func (celBindings) LibraryName() string { - return "cel.lib.ext.cel.bindings" -} - -func (celBindings) CompileOptions() []cel.EnvOption { - return []cel.EnvOption{ - cel.Macros( - // cel.bind(var, , ) - cel.NewReceiverMacro(bindMacro, 3, celBind), - ), - } -} - -func (celBindings) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -func celBind(meh cel.MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *cel.Error) { - if !macroTargetMatchesNamespace(celNamespace, target) { - return nil, nil - } - varIdent := args[0] - varName := "" - switch varIdent.GetExprKind().(type) { - case *exprpb.Expr_IdentExpr: - varName = varIdent.GetIdentExpr().GetName() - default: - return nil, meh.NewError(varIdent.GetId(), "cel.bind() variable names must be simple identifiers") - } - varInit := args[1] - resultExpr := args[2] - return meh.Fold( - unusedIterVar, - meh.NewList(), - varName, - varInit, - meh.LiteralBool(false), - meh.Ident(varName), - resultExpr, - ), nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/ext/lists.go b/cluster-autoscaler/vendor/github.com/google/cel-go/ext/lists.go deleted file mode 100644 index 08751d08a1e8..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/ext/lists.go +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2023 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 ext - -import ( - "fmt" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" -) - -// Lists returns a cel.EnvOption to configure extended functions for list manipulation. -// As a general note, all indices are zero-based. -// # Slice -// -// Returns a new sub-list using the indexes provided. -// -// .slice(, ) -> -// -// Examples: -// -// [1,2,3,4].slice(1, 3) // return [2, 3] -// [1,2,3,4].slice(2, 4) // return [3 ,4] -func Lists() cel.EnvOption { - return cel.Lib(listsLib{}) -} - -type listsLib struct{} - -// LibraryName implements the SingletonLibrary interface method. -func (listsLib) LibraryName() string { - return "cel.lib.ext.lists" -} - -// CompileOptions implements the Library interface method. -func (listsLib) CompileOptions() []cel.EnvOption { - listType := cel.ListType(cel.TypeParamType("T")) - return []cel.EnvOption{ - cel.Function("slice", - cel.MemberOverload("list_slice", - []*cel.Type{listType, cel.IntType, cel.IntType}, listType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - list := args[0].(traits.Lister) - start := args[1].(types.Int) - end := args[2].(types.Int) - result, err := slice(list, start, end) - if err != nil { - return types.WrapErr(err) - } - return result - }), - ), - ), - } -} - -// ProgramOptions implements the Library interface method. -func (listsLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -func slice(list traits.Lister, start, end types.Int) (ref.Val, error) { - listLength := list.Size().(types.Int) - if start < 0 || end < 0 { - return nil, fmt.Errorf("cannot slice(%d, %d), negative indexes not supported", start, end) - } - if start > end { - return nil, fmt.Errorf("cannot slice(%d, %d), start index must be less than or equal to end index", start, end) - } - if listLength < end { - return nil, fmt.Errorf("cannot slice(%d, %d), list is length %d", start, end, listLength) - } - - var newList []ref.Val - for i := types.Int(start); i < end; i++ { - val := list.Get(i) - newList = append(newList, val) - } - return types.DefaultTypeAdapter.NativeToValue(newList), nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/cel-go/ext/sets.go b/cluster-autoscaler/vendor/github.com/google/cel-go/ext/sets.go deleted file mode 100644 index 833c15f616f9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/cel-go/ext/sets.go +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2023 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 ext - -import ( - "math" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/checker" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - "github.com/google/cel-go/interpreter" -) - -// Sets returns a cel.EnvOption to configure namespaced set relationship -// functions. -// -// There is no set type within CEL, and while one may be introduced in the -// future, there are cases where a `list` type is known to behave like a set. -// For such cases, this library provides some basic functionality for -// determining set containment, equivalence, and intersection. -// -// # Sets.Contains -// -// Returns whether the first list argument contains all elements in the second -// list argument. The list may contain elements of any type and standard CEL -// equality is used to determine whether a value exists in both lists. If the -// second list is empty, the result will always return true. -// -// sets.contains(list(T), list(T)) -> bool -// -// Examples: -// -// sets.contains([], []) // true -// sets.contains([], [1]) // false -// sets.contains([1, 2, 3, 4], [2, 3]) // true -// sets.contains([1, 2.0, 3u], [1.0, 2u, 3]) // true -// -// # Sets.Equivalent -// -// Returns whether the first and second list are set equivalent. Lists are set -// equivalent if for every item in the first list, there is an element in the -// second which is equal. The lists may not be of the same size as they do not -// guarantee the elements within them are unique, so size does not factor into -// the computation. -// -// Examples: -// -// sets.equivalent([], []) // true -// sets.equivalent([1], [1, 1]) // true -// sets.equivalent([1], [1u, 1.0]) // true -// sets.equivalent([1, 2, 3], [3u, 2.0, 1]) // true -// -// # Sets.Intersects -// -// Returns whether the first list has at least one element whose value is equal -// to an element in the second list. If either list is empty, the result will -// be false. -// -// Examples: -// -// sets.intersects([1], []) // false -// sets.intersects([1], [1, 2]) // true -// sets.intersects([[1], [2, 3]], [[1, 2], [2, 3.0]]) // true -func Sets() cel.EnvOption { - return cel.Lib(setsLib{}) -} - -type setsLib struct{} - -// LibraryName implements the SingletonLibrary interface method. -func (setsLib) LibraryName() string { - return "cel.lib.ext.sets" -} - -// CompileOptions implements the Library interface method. -func (setsLib) CompileOptions() []cel.EnvOption { - listType := cel.ListType(cel.TypeParamType("T")) - return []cel.EnvOption{ - cel.Function("sets.contains", - cel.Overload("list_sets_contains_list", []*cel.Type{listType, listType}, cel.BoolType, - cel.BinaryBinding(setsContains))), - cel.Function("sets.equivalent", - cel.Overload("list_sets_equivalent_list", []*cel.Type{listType, listType}, cel.BoolType, - cel.BinaryBinding(setsEquivalent))), - cel.Function("sets.intersects", - cel.Overload("list_sets_intersects_list", []*cel.Type{listType, listType}, cel.BoolType, - cel.BinaryBinding(setsIntersects))), - cel.CostEstimatorOptions( - checker.OverloadCostEstimate("list_sets_contains_list", estimateSetsCost(1)), - checker.OverloadCostEstimate("list_sets_intersects_list", estimateSetsCost(1)), - // equivalence requires potentially two m*n comparisons to ensure each list is contained by the other - checker.OverloadCostEstimate("list_sets_equivalent_list", estimateSetsCost(2)), - ), - } -} - -// ProgramOptions implements the Library interface method. -func (setsLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{ - cel.CostTrackerOptions( - interpreter.OverloadCostTracker("list_sets_contains_list", trackSetsCost(1)), - interpreter.OverloadCostTracker("list_sets_intersects_list", trackSetsCost(1)), - interpreter.OverloadCostTracker("list_sets_equivalent_list", trackSetsCost(2)), - ), - } -} - -func setsIntersects(listA, listB ref.Val) ref.Val { - lA := listA.(traits.Lister) - lB := listB.(traits.Lister) - it := lA.Iterator() - for it.HasNext() == types.True { - exists := lB.Contains(it.Next()) - if exists == types.True { - return types.True - } - } - return types.False -} - -func setsContains(list, sublist ref.Val) ref.Val { - l := list.(traits.Lister) - sub := sublist.(traits.Lister) - it := sub.Iterator() - for it.HasNext() == types.True { - exists := l.Contains(it.Next()) - if exists != types.True { - return exists - } - } - return types.True -} - -func setsEquivalent(listA, listB ref.Val) ref.Val { - aContainsB := setsContains(listA, listB) - if aContainsB != types.True { - return aContainsB - } - return setsContains(listB, listA) -} - -func estimateSetsCost(costFactor float64) checker.FunctionEstimator { - return func(estimator checker.CostEstimator, target *checker.AstNode, args []checker.AstNode) *checker.CallEstimate { - if len(args) == 2 { - arg0Size := estimateSize(estimator, args[0]) - arg1Size := estimateSize(estimator, args[1]) - costEstimate := arg0Size.Multiply(arg1Size).MultiplyByCostFactor(costFactor).Add(callCostEstimate) - return &checker.CallEstimate{CostEstimate: costEstimate} - } - return nil - } -} - -func estimateSize(estimator checker.CostEstimator, node checker.AstNode) checker.SizeEstimate { - if l := node.ComputedSize(); l != nil { - return *l - } - if l := estimator.EstimateSize(node); l != nil { - return *l - } - return checker.SizeEstimate{Min: 0, Max: math.MaxUint64} -} - -func trackSetsCost(costFactor float64) interpreter.FunctionTracker { - return func(args []ref.Val, _ ref.Val) *uint64 { - lhsSize := actualSize(args[0]) - rhsSize := actualSize(args[1]) - cost := callCost + uint64(float64(lhsSize*rhsSize)*costFactor) - return &cost - } -} - -func actualSize(value ref.Val) uint64 { - if sz, ok := value.(traits.Sizer); ok { - return uint64(sz.Size().(types.Int)) - } - return 1 -} - -var ( - callCostEstimate = checker.CostEstimate{Min: 1, Max: 1} - callCost = uint64(1) -) diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/LICENSE b/cluster-autoscaler/vendor/github.com/google/gnostic-models/LICENSE deleted file mode 100644 index 6b0b1270ff0c..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/LICENSE +++ /dev/null @@ -1,203 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/README.md b/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/README.md deleted file mode 100644 index ee9783d232f4..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Compiler support code - -This directory contains compiler support code used by Gnostic and Gnostic -extensions. diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/context.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/context.go deleted file mode 100644 index 1bfe9612194b..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/context.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 compiler - -import ( - yaml "gopkg.in/yaml.v3" -) - -// Context contains state of the compiler as it traverses a document. -type Context struct { - Parent *Context - Name string - Node *yaml.Node - ExtensionHandlers *[]ExtensionHandler -} - -// NewContextWithExtensions returns a new object representing the compiler state -func NewContextWithExtensions(name string, node *yaml.Node, parent *Context, extensionHandlers *[]ExtensionHandler) *Context { - return &Context{Name: name, Node: node, Parent: parent, ExtensionHandlers: extensionHandlers} -} - -// NewContext returns a new object representing the compiler state -func NewContext(name string, node *yaml.Node, parent *Context) *Context { - if parent != nil { - return &Context{Name: name, Node: node, Parent: parent, ExtensionHandlers: parent.ExtensionHandlers} - } - return &Context{Name: name, Parent: parent, ExtensionHandlers: nil} -} - -// Description returns a text description of the compiler state -func (context *Context) Description() string { - name := context.Name - if context.Parent != nil { - name = context.Parent.Description() + "." + name - } - return name -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/error.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/error.go deleted file mode 100644 index 6f40515d6b6e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/error.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 compiler - -import "fmt" - -// Error represents compiler errors and their location in the document. -type Error struct { - Context *Context - Message string -} - -// NewError creates an Error. -func NewError(context *Context, message string) *Error { - return &Error{Context: context, Message: message} -} - -func (err *Error) locationDescription() string { - if err.Context.Node != nil { - return fmt.Sprintf("[%d,%d] %s", err.Context.Node.Line, err.Context.Node.Column, err.Context.Description()) - } - return err.Context.Description() -} - -// Error returns the string value of an Error. -func (err *Error) Error() string { - if err.Context == nil { - return err.Message - } - return err.locationDescription() + " " + err.Message -} - -// ErrorGroup is a container for groups of Error values. -type ErrorGroup struct { - Errors []error -} - -// NewErrorGroupOrNil returns a new ErrorGroup for a slice of errors or nil if the slice is empty. -func NewErrorGroupOrNil(errors []error) error { - if len(errors) == 0 { - return nil - } else if len(errors) == 1 { - return errors[0] - } else { - return &ErrorGroup{Errors: errors} - } -} - -func (group *ErrorGroup) Error() string { - result := "" - for i, err := range group.Errors { - if i > 0 { - result += "\n" - } - result += err.Error() - } - return result -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/extensions.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/extensions.go deleted file mode 100644 index 250c81e8c854..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/extensions.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 compiler - -import ( - "bytes" - "fmt" - "os/exec" - "strings" - - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/any" - yaml "gopkg.in/yaml.v3" - - extensions "github.com/google/gnostic-models/extensions" -) - -// ExtensionHandler describes a binary that is called by the compiler to handle specification extensions. -type ExtensionHandler struct { - Name string -} - -// CallExtension calls a binary extension handler. -func CallExtension(context *Context, in *yaml.Node, extensionName string) (handled bool, response *any.Any, err error) { - if context == nil || context.ExtensionHandlers == nil { - return false, nil, nil - } - handled = false - for _, handler := range *(context.ExtensionHandlers) { - response, err = handler.handle(in, extensionName) - if response == nil { - continue - } else { - handled = true - break - } - } - return handled, response, err -} - -func (extensionHandlers *ExtensionHandler) handle(in *yaml.Node, extensionName string) (*any.Any, error) { - if extensionHandlers.Name != "" { - yamlData, _ := yaml.Marshal(in) - request := &extensions.ExtensionHandlerRequest{ - CompilerVersion: &extensions.Version{ - Major: 0, - Minor: 1, - Patch: 0, - }, - Wrapper: &extensions.Wrapper{ - Version: "unknown", // TODO: set this to the type/version of spec being parsed. - Yaml: string(yamlData), - ExtensionName: extensionName, - }, - } - requestBytes, _ := proto.Marshal(request) - cmd := exec.Command(extensionHandlers.Name) - cmd.Stdin = bytes.NewReader(requestBytes) - output, err := cmd.Output() - if err != nil { - return nil, err - } - response := &extensions.ExtensionHandlerResponse{} - err = proto.Unmarshal(output, response) - if err != nil || !response.Handled { - return nil, err - } - if len(response.Errors) != 0 { - return nil, fmt.Errorf("Errors when parsing: %+v for field %s by vendor extension handler %s. Details %+v", in, extensionName, extensionHandlers.Name, strings.Join(response.Errors, ",")) - } - return response.Value, nil - } - return nil, nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/helpers.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/helpers.go deleted file mode 100644 index 975d65e8f8de..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/helpers.go +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 compiler - -import ( - "fmt" - "regexp" - "sort" - "strconv" - - "gopkg.in/yaml.v3" - - "github.com/google/gnostic-models/jsonschema" -) - -// compiler helper functions, usually called from generated code - -// UnpackMap gets a *yaml.Node if possible. -func UnpackMap(in *yaml.Node) (*yaml.Node, bool) { - if in == nil { - return nil, false - } - return in, true -} - -// SortedKeysForMap returns the sorted keys of a yamlv2.MapSlice. -func SortedKeysForMap(m *yaml.Node) []string { - keys := make([]string, 0) - if m.Kind == yaml.MappingNode { - for i := 0; i < len(m.Content); i += 2 { - keys = append(keys, m.Content[i].Value) - } - } - sort.Strings(keys) - return keys -} - -// MapHasKey returns true if a yamlv2.MapSlice contains a specified key. -func MapHasKey(m *yaml.Node, key string) bool { - if m == nil { - return false - } - if m.Kind == yaml.MappingNode { - for i := 0; i < len(m.Content); i += 2 { - itemKey := m.Content[i].Value - if key == itemKey { - return true - } - } - } - return false -} - -// MapValueForKey gets the value of a map value for a specified key. -func MapValueForKey(m *yaml.Node, key string) *yaml.Node { - if m == nil { - return nil - } - if m.Kind == yaml.MappingNode { - for i := 0; i < len(m.Content); i += 2 { - itemKey := m.Content[i].Value - if key == itemKey { - return m.Content[i+1] - } - } - } - return nil -} - -// ConvertInterfaceArrayToStringArray converts an array of interfaces to an array of strings, if possible. -func ConvertInterfaceArrayToStringArray(interfaceArray []interface{}) []string { - stringArray := make([]string, 0) - for _, item := range interfaceArray { - v, ok := item.(string) - if ok { - stringArray = append(stringArray, v) - } - } - return stringArray -} - -// SequenceNodeForNode returns a node if it is a SequenceNode. -func SequenceNodeForNode(node *yaml.Node) (*yaml.Node, bool) { - if node.Kind != yaml.SequenceNode { - return nil, false - } - return node, true -} - -// BoolForScalarNode returns the bool value of a node. -func BoolForScalarNode(node *yaml.Node) (bool, bool) { - if node == nil { - return false, false - } - if node.Kind == yaml.DocumentNode { - return BoolForScalarNode(node.Content[0]) - } - if node.Kind != yaml.ScalarNode { - return false, false - } - if node.Tag != "!!bool" { - return false, false - } - v, err := strconv.ParseBool(node.Value) - if err != nil { - return false, false - } - return v, true -} - -// IntForScalarNode returns the integer value of a node. -func IntForScalarNode(node *yaml.Node) (int64, bool) { - if node == nil { - return 0, false - } - if node.Kind == yaml.DocumentNode { - return IntForScalarNode(node.Content[0]) - } - if node.Kind != yaml.ScalarNode { - return 0, false - } - if node.Tag != "!!int" { - return 0, false - } - v, err := strconv.ParseInt(node.Value, 10, 64) - if err != nil { - return 0, false - } - return v, true -} - -// FloatForScalarNode returns the float value of a node. -func FloatForScalarNode(node *yaml.Node) (float64, bool) { - if node == nil { - return 0.0, false - } - if node.Kind == yaml.DocumentNode { - return FloatForScalarNode(node.Content[0]) - } - if node.Kind != yaml.ScalarNode { - return 0.0, false - } - if (node.Tag != "!!int") && (node.Tag != "!!float") { - return 0.0, false - } - v, err := strconv.ParseFloat(node.Value, 64) - if err != nil { - return 0.0, false - } - return v, true -} - -// StringForScalarNode returns the string value of a node. -func StringForScalarNode(node *yaml.Node) (string, bool) { - if node == nil { - return "", false - } - if node.Kind == yaml.DocumentNode { - return StringForScalarNode(node.Content[0]) - } - switch node.Kind { - case yaml.ScalarNode: - switch node.Tag { - case "!!int": - return node.Value, true - case "!!str": - return node.Value, true - case "!!timestamp": - return node.Value, true - case "!!null": - return "", true - default: - return "", false - } - default: - return "", false - } -} - -// StringArrayForSequenceNode converts a sequence node to an array of strings, if possible. -func StringArrayForSequenceNode(node *yaml.Node) []string { - stringArray := make([]string, 0) - for _, item := range node.Content { - v, ok := StringForScalarNode(item) - if ok { - stringArray = append(stringArray, v) - } - } - return stringArray -} - -// MissingKeysInMap identifies which keys from a list of required keys are not in a map. -func MissingKeysInMap(m *yaml.Node, requiredKeys []string) []string { - missingKeys := make([]string, 0) - for _, k := range requiredKeys { - if !MapHasKey(m, k) { - missingKeys = append(missingKeys, k) - } - } - return missingKeys -} - -// InvalidKeysInMap returns keys in a map that don't match a list of allowed keys and patterns. -func InvalidKeysInMap(m *yaml.Node, allowedKeys []string, allowedPatterns []*regexp.Regexp) []string { - invalidKeys := make([]string, 0) - if m == nil || m.Kind != yaml.MappingNode { - return invalidKeys - } - for i := 0; i < len(m.Content); i += 2 { - key := m.Content[i].Value - found := false - // does the key match an allowed key? - for _, allowedKey := range allowedKeys { - if key == allowedKey { - found = true - break - } - } - if !found { - // does the key match an allowed pattern? - for _, allowedPattern := range allowedPatterns { - if allowedPattern.MatchString(key) { - found = true - break - } - } - if !found { - invalidKeys = append(invalidKeys, key) - } - } - } - return invalidKeys -} - -// NewNullNode creates a new Null node. -func NewNullNode() *yaml.Node { - node := &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!null", - } - return node -} - -// NewMappingNode creates a new Mapping node. -func NewMappingNode() *yaml.Node { - return &yaml.Node{ - Kind: yaml.MappingNode, - Content: make([]*yaml.Node, 0), - } -} - -// NewSequenceNode creates a new Sequence node. -func NewSequenceNode() *yaml.Node { - node := &yaml.Node{ - Kind: yaml.SequenceNode, - Content: make([]*yaml.Node, 0), - } - return node -} - -// NewScalarNodeForString creates a new node to hold a string. -func NewScalarNodeForString(s string) *yaml.Node { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!str", - Value: s, - } -} - -// NewSequenceNodeForStringArray creates a new node to hold an array of strings. -func NewSequenceNodeForStringArray(strings []string) *yaml.Node { - node := &yaml.Node{ - Kind: yaml.SequenceNode, - Content: make([]*yaml.Node, 0), - } - for _, s := range strings { - node.Content = append(node.Content, NewScalarNodeForString(s)) - } - return node -} - -// NewScalarNodeForBool creates a new node to hold a bool. -func NewScalarNodeForBool(b bool) *yaml.Node { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!bool", - Value: fmt.Sprintf("%t", b), - } -} - -// NewScalarNodeForFloat creates a new node to hold a float. -func NewScalarNodeForFloat(f float64) *yaml.Node { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!float", - Value: fmt.Sprintf("%g", f), - } -} - -// NewScalarNodeForInt creates a new node to hold an integer. -func NewScalarNodeForInt(i int64) *yaml.Node { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!int", - Value: fmt.Sprintf("%d", i), - } -} - -// PluralProperties returns the string "properties" pluralized. -func PluralProperties(count int) string { - if count == 1 { - return "property" - } - return "properties" -} - -// StringArrayContainsValue returns true if a string array contains a specified value. -func StringArrayContainsValue(array []string, value string) bool { - for _, item := range array { - if item == value { - return true - } - } - return false -} - -// StringArrayContainsValues returns true if a string array contains all of a list of specified values. -func StringArrayContainsValues(array []string, values []string) bool { - for _, value := range values { - if !StringArrayContainsValue(array, value) { - return false - } - } - return true -} - -// StringValue returns the string value of an item. -func StringValue(item interface{}) (value string, ok bool) { - value, ok = item.(string) - if ok { - return value, ok - } - intValue, ok := item.(int) - if ok { - return strconv.Itoa(intValue), true - } - return "", false -} - -// Description returns a human-readable represention of an item. -func Description(item interface{}) string { - value, ok := item.(*yaml.Node) - if ok { - return jsonschema.Render(value) - } - return fmt.Sprintf("%+v", item) -} - -// Display returns a description of a node for use in error messages. -func Display(node *yaml.Node) string { - switch node.Kind { - case yaml.ScalarNode: - switch node.Tag { - case "!!str": - return fmt.Sprintf("%s (string)", node.Value) - } - } - return fmt.Sprintf("%+v (%T)", node, node) -} - -// Marshal creates a yaml version of a structure in our preferred style -func Marshal(in *yaml.Node) []byte { - clearStyle(in) - //bytes, _ := yaml.Marshal(&yaml.Node{Kind: yaml.DocumentNode, Content: []*yaml.Node{in}}) - bytes, _ := yaml.Marshal(in) - - return bytes -} - -func clearStyle(node *yaml.Node) { - node.Style = 0 - for _, c := range node.Content { - clearStyle(c) - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/main.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/main.go deleted file mode 100644 index ce9fcc456cc4..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/main.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 compiler provides support functions to generated compiler code. -package compiler diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/reader.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/reader.go deleted file mode 100644 index be0e8b40c8cd..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/compiler/reader.go +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 compiler - -import ( - "fmt" - "io/ioutil" - "log" - "net/http" - "net/url" - "path/filepath" - "strings" - "sync" - - yaml "gopkg.in/yaml.v3" -) - -var verboseReader = false - -var fileCache map[string][]byte -var infoCache map[string]*yaml.Node - -var fileCacheEnable = true -var infoCacheEnable = true - -// These locks are used to synchronize accesses to the fileCache and infoCache -// maps (above). They are global state and can throw thread-related errors -// when modified from separate goroutines. The general strategy is to protect -// all public functions in this file with mutex Lock() calls. As a result, to -// avoid deadlock, these public functions should not call other public -// functions, so some public functions have private equivalents. -// In the future, we might consider replacing the maps with sync.Map and -// eliminating these mutexes. -var fileCacheMutex sync.Mutex -var infoCacheMutex sync.Mutex - -func initializeFileCache() { - if fileCache == nil { - fileCache = make(map[string][]byte, 0) - } -} - -func initializeInfoCache() { - if infoCache == nil { - infoCache = make(map[string]*yaml.Node, 0) - } -} - -// EnableFileCache turns on file caching. -func EnableFileCache() { - fileCacheMutex.Lock() - defer fileCacheMutex.Unlock() - fileCacheEnable = true -} - -// EnableInfoCache turns on parsed info caching. -func EnableInfoCache() { - infoCacheMutex.Lock() - defer infoCacheMutex.Unlock() - infoCacheEnable = true -} - -// DisableFileCache turns off file caching. -func DisableFileCache() { - fileCacheMutex.Lock() - defer fileCacheMutex.Unlock() - fileCacheEnable = false -} - -// DisableInfoCache turns off parsed info caching. -func DisableInfoCache() { - infoCacheMutex.Lock() - defer infoCacheMutex.Unlock() - infoCacheEnable = false -} - -// RemoveFromFileCache removes an entry from the file cache. -func RemoveFromFileCache(fileurl string) { - fileCacheMutex.Lock() - defer fileCacheMutex.Unlock() - if !fileCacheEnable { - return - } - initializeFileCache() - delete(fileCache, fileurl) -} - -// RemoveFromInfoCache removes an entry from the info cache. -func RemoveFromInfoCache(filename string) { - infoCacheMutex.Lock() - defer infoCacheMutex.Unlock() - if !infoCacheEnable { - return - } - initializeInfoCache() - delete(infoCache, filename) -} - -// GetInfoCache returns the info cache map. -func GetInfoCache() map[string]*yaml.Node { - infoCacheMutex.Lock() - defer infoCacheMutex.Unlock() - if infoCache == nil { - initializeInfoCache() - } - return infoCache -} - -// ClearFileCache clears the file cache. -func ClearFileCache() { - fileCacheMutex.Lock() - defer fileCacheMutex.Unlock() - fileCache = make(map[string][]byte, 0) -} - -// ClearInfoCache clears the info cache. -func ClearInfoCache() { - infoCacheMutex.Lock() - defer infoCacheMutex.Unlock() - infoCache = make(map[string]*yaml.Node) -} - -// ClearCaches clears all caches. -func ClearCaches() { - ClearFileCache() - ClearInfoCache() -} - -// FetchFile gets a specified file from the local filesystem or a remote location. -func FetchFile(fileurl string) ([]byte, error) { - fileCacheMutex.Lock() - defer fileCacheMutex.Unlock() - return fetchFile(fileurl) -} - -func fetchFile(fileurl string) ([]byte, error) { - var bytes []byte - initializeFileCache() - if fileCacheEnable { - bytes, ok := fileCache[fileurl] - if ok { - if verboseReader { - log.Printf("Cache hit %s", fileurl) - } - return bytes, nil - } - if verboseReader { - log.Printf("Fetching %s", fileurl) - } - } - response, err := http.Get(fileurl) - if err != nil { - return nil, err - } - defer response.Body.Close() - if response.StatusCode != 200 { - return nil, fmt.Errorf("Error downloading %s: %s", fileurl, response.Status) - } - bytes, err = ioutil.ReadAll(response.Body) - if fileCacheEnable && err == nil { - fileCache[fileurl] = bytes - } - return bytes, err -} - -// ReadBytesForFile reads the bytes of a file. -func ReadBytesForFile(filename string) ([]byte, error) { - fileCacheMutex.Lock() - defer fileCacheMutex.Unlock() - return readBytesForFile(filename) -} - -func readBytesForFile(filename string) ([]byte, error) { - // is the filename a url? - fileurl, _ := url.Parse(filename) - if fileurl.Scheme != "" { - // yes, fetch it - bytes, err := fetchFile(filename) - if err != nil { - return nil, err - } - return bytes, nil - } - // no, it's a local filename - bytes, err := ioutil.ReadFile(filename) - if err != nil { - return nil, err - } - return bytes, nil -} - -// ReadInfoFromBytes unmarshals a file as a *yaml.Node. -func ReadInfoFromBytes(filename string, bytes []byte) (*yaml.Node, error) { - infoCacheMutex.Lock() - defer infoCacheMutex.Unlock() - return readInfoFromBytes(filename, bytes) -} - -func readInfoFromBytes(filename string, bytes []byte) (*yaml.Node, error) { - initializeInfoCache() - if infoCacheEnable { - cachedInfo, ok := infoCache[filename] - if ok { - if verboseReader { - log.Printf("Cache hit info for file %s", filename) - } - return cachedInfo, nil - } - if verboseReader { - log.Printf("Reading info for file %s", filename) - } - } - var info yaml.Node - err := yaml.Unmarshal(bytes, &info) - if err != nil { - return nil, err - } - if infoCacheEnable && len(filename) > 0 { - infoCache[filename] = &info - } - return &info, nil -} - -// ReadInfoForRef reads a file and return the fragment needed to resolve a $ref. -func ReadInfoForRef(basefile string, ref string) (*yaml.Node, error) { - fileCacheMutex.Lock() - defer fileCacheMutex.Unlock() - infoCacheMutex.Lock() - defer infoCacheMutex.Unlock() - initializeInfoCache() - if infoCacheEnable { - info, ok := infoCache[ref] - if ok { - if verboseReader { - log.Printf("Cache hit for ref %s#%s", basefile, ref) - } - return info, nil - } - if verboseReader { - log.Printf("Reading info for ref %s#%s", basefile, ref) - } - } - basedir, _ := filepath.Split(basefile) - parts := strings.Split(ref, "#") - var filename string - if parts[0] != "" { - filename = parts[0] - if _, err := url.ParseRequestURI(parts[0]); err != nil { - // It is not an URL, so the file is local - filename = basedir + parts[0] - } - } else { - filename = basefile - } - bytes, err := readBytesForFile(filename) - if err != nil { - return nil, err - } - info, err := readInfoFromBytes(filename, bytes) - if info != nil && info.Kind == yaml.DocumentNode { - info = info.Content[0] - } - if err != nil { - log.Printf("File error: %v\n", err) - } else { - if info == nil { - return nil, NewError(nil, fmt.Sprintf("could not resolve %s", ref)) - } - if len(parts) > 1 { - path := strings.Split(parts[1], "/") - for i, key := range path { - if i > 0 { - m := info - if true { - found := false - for i := 0; i < len(m.Content); i += 2 { - if m.Content[i].Value == key { - info = m.Content[i+1] - found = true - } - } - if !found { - infoCache[ref] = nil - return nil, NewError(nil, fmt.Sprintf("could not resolve %s", ref)) - } - } - } - } - } - } - if infoCacheEnable { - infoCache[ref] = info - } - return info, nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/README.md b/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/README.md deleted file mode 100644 index 4b5d63e5856d..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Extensions - -**Extension Support is experimental.** - -This directory contains support code for building Gnostic extensio handlers and -associated examples. - -Extension handlers can be used to compile vendor or specification extensions -into protocol buffer structures. - -Like plugins, extension handlers are built as separate executables. Extension -bodies are written to extension handlers as serialized -ExtensionHandlerRequests. diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extension.pb.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extension.pb.go deleted file mode 100644 index a71df8abecc6..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extension.pb.go +++ /dev/null @@ -1,461 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS 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.27.1 -// protoc v3.19.3 -// source: extensions/extension.proto - -package gnostic_extension_v1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - reflect "reflect" - sync "sync" -) - -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 version number of Gnostic. -type Version struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Major int32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"` - Minor int32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"` - Patch int32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"` - // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should - // be empty for mainline stable releases. - Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` -} - -func (x *Version) Reset() { - *x = Version{} - if protoimpl.UnsafeEnabled { - mi := &file_extensions_extension_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Version) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Version) ProtoMessage() {} - -func (x *Version) ProtoReflect() protoreflect.Message { - mi := &file_extensions_extension_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Version.ProtoReflect.Descriptor instead. -func (*Version) Descriptor() ([]byte, []int) { - return file_extensions_extension_proto_rawDescGZIP(), []int{0} -} - -func (x *Version) GetMajor() int32 { - if x != nil { - return x.Major - } - return 0 -} - -func (x *Version) GetMinor() int32 { - if x != nil { - return x.Minor - } - return 0 -} - -func (x *Version) GetPatch() int32 { - if x != nil { - return x.Patch - } - return 0 -} - -func (x *Version) GetSuffix() string { - if x != nil { - return x.Suffix - } - return "" -} - -// An encoded Request is written to the ExtensionHandler's stdin. -type ExtensionHandlerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The extension to process. - Wrapper *Wrapper `protobuf:"bytes,1,opt,name=wrapper,proto3" json:"wrapper,omitempty"` - // The version number of Gnostic. - CompilerVersion *Version `protobuf:"bytes,2,opt,name=compiler_version,json=compilerVersion,proto3" json:"compiler_version,omitempty"` -} - -func (x *ExtensionHandlerRequest) Reset() { - *x = ExtensionHandlerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_extensions_extension_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExtensionHandlerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExtensionHandlerRequest) ProtoMessage() {} - -func (x *ExtensionHandlerRequest) ProtoReflect() protoreflect.Message { - mi := &file_extensions_extension_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExtensionHandlerRequest.ProtoReflect.Descriptor instead. -func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int) { - return file_extensions_extension_proto_rawDescGZIP(), []int{1} -} - -func (x *ExtensionHandlerRequest) GetWrapper() *Wrapper { - if x != nil { - return x.Wrapper - } - return nil -} - -func (x *ExtensionHandlerRequest) GetCompilerVersion() *Version { - if x != nil { - return x.CompilerVersion - } - return nil -} - -// The extensions writes an encoded ExtensionHandlerResponse to stdout. -type ExtensionHandlerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // true if the extension is handled by the extension handler; false otherwise - Handled bool `protobuf:"varint,1,opt,name=handled,proto3" json:"handled,omitempty"` - // Error message(s). If non-empty, the extension handling failed. - // The extension handler process should exit with status code zero - // even if it reports an error in this way. - // - // This should be used to indicate errors which prevent the extension from - // operating as intended. Errors which indicate a problem in gnostic - // itself -- such as the input Document being unparseable -- should be - // reported by writing a message to stderr and exiting with a non-zero - // status code. - Errors []string `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"` - // text output - Value *anypb.Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *ExtensionHandlerResponse) Reset() { - *x = ExtensionHandlerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_extensions_extension_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExtensionHandlerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExtensionHandlerResponse) ProtoMessage() {} - -func (x *ExtensionHandlerResponse) ProtoReflect() protoreflect.Message { - mi := &file_extensions_extension_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExtensionHandlerResponse.ProtoReflect.Descriptor instead. -func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int) { - return file_extensions_extension_proto_rawDescGZIP(), []int{2} -} - -func (x *ExtensionHandlerResponse) GetHandled() bool { - if x != nil { - return x.Handled - } - return false -} - -func (x *ExtensionHandlerResponse) GetErrors() []string { - if x != nil { - return x.Errors - } - return nil -} - -func (x *ExtensionHandlerResponse) GetValue() *anypb.Any { - if x != nil { - return x.Value - } - return nil -} - -type Wrapper struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // version of the OpenAPI specification in which this extension was written. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Name of the extension. - ExtensionName string `protobuf:"bytes,2,opt,name=extension_name,json=extensionName,proto3" json:"extension_name,omitempty"` - // YAML-formatted extension value. - Yaml string `protobuf:"bytes,3,opt,name=yaml,proto3" json:"yaml,omitempty"` -} - -func (x *Wrapper) Reset() { - *x = Wrapper{} - if protoimpl.UnsafeEnabled { - mi := &file_extensions_extension_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Wrapper) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Wrapper) ProtoMessage() {} - -func (x *Wrapper) ProtoReflect() protoreflect.Message { - mi := &file_extensions_extension_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Wrapper.ProtoReflect.Descriptor instead. -func (*Wrapper) Descriptor() ([]byte, []int) { - return file_extensions_extension_proto_rawDescGZIP(), []int{3} -} - -func (x *Wrapper) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Wrapper) GetExtensionName() string { - if x != nil { - return x.ExtensionName - } - return "" -} - -func (x *Wrapper) GetYaml() string { - if x != nil { - return x.Yaml - } - return "" -} - -var File_extensions_extension_proto protoreflect.FileDescriptor - -var file_extensions_extension_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x67, 0x6e, - 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 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, 0x22, 0x63, 0x0a, - 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, - 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, - 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, - 0x66, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, - 0x69, 0x78, 0x22, 0x9c, 0x01, 0x0a, 0x17, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, - 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x07, - 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0x78, 0x0a, 0x18, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x12, - 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 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, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5e, 0x0a, 0x07, 0x57, - 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x42, 0x4d, 0x0a, 0x0e, 0x6f, - 0x72, 0x67, 0x2e, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x47, - 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x50, - 0x01, 0x5a, 0x21, 0x2e, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3b, - 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, 0x4e, 0x58, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_extensions_extension_proto_rawDescOnce sync.Once - file_extensions_extension_proto_rawDescData = file_extensions_extension_proto_rawDesc -) - -func file_extensions_extension_proto_rawDescGZIP() []byte { - file_extensions_extension_proto_rawDescOnce.Do(func() { - file_extensions_extension_proto_rawDescData = protoimpl.X.CompressGZIP(file_extensions_extension_proto_rawDescData) - }) - return file_extensions_extension_proto_rawDescData -} - -var file_extensions_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_extensions_extension_proto_goTypes = []interface{}{ - (*Version)(nil), // 0: gnostic.extension.v1.Version - (*ExtensionHandlerRequest)(nil), // 1: gnostic.extension.v1.ExtensionHandlerRequest - (*ExtensionHandlerResponse)(nil), // 2: gnostic.extension.v1.ExtensionHandlerResponse - (*Wrapper)(nil), // 3: gnostic.extension.v1.Wrapper - (*anypb.Any)(nil), // 4: google.protobuf.Any -} -var file_extensions_extension_proto_depIdxs = []int32{ - 3, // 0: gnostic.extension.v1.ExtensionHandlerRequest.wrapper:type_name -> gnostic.extension.v1.Wrapper - 0, // 1: gnostic.extension.v1.ExtensionHandlerRequest.compiler_version:type_name -> gnostic.extension.v1.Version - 4, // 2: gnostic.extension.v1.ExtensionHandlerResponse.value:type_name -> google.protobuf.Any - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_extensions_extension_proto_init() } -func file_extensions_extension_proto_init() { - if File_extensions_extension_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_extensions_extension_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Version); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_extensions_extension_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtensionHandlerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_extensions_extension_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtensionHandlerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_extensions_extension_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Wrapper); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_extensions_extension_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_extensions_extension_proto_goTypes, - DependencyIndexes: file_extensions_extension_proto_depIdxs, - MessageInfos: file_extensions_extension_proto_msgTypes, - }.Build() - File_extensions_extension_proto = out.File - file_extensions_extension_proto_rawDesc = nil - file_extensions_extension_proto_goTypes = nil - file_extensions_extension_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extension.proto b/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extension.proto deleted file mode 100644 index 875137c1a860..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extension.proto +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package gnostic.extension.v1; - -import "google/protobuf/any.proto"; - -// This option lets the proto compiler generate Java code inside the package -// name (see below) instead of inside an outer class. It creates a simpler -// developer experience by reducing one-level of name nesting and be -// consistent with most programming languages that don't support outer classes. -option java_multiple_files = true; - -// The Java outer classname should be the filename in UpperCamelCase. This -// class is only used to hold proto descriptor, so developers don't need to -// work with it directly. -option java_outer_classname = "GnosticExtension"; - -// The Java package name must be proto package name with proper prefix. -option java_package = "org.gnostic.v1"; - -// A reasonable prefix for the Objective-C symbols generated from the package. -// It should at a minimum be 3 characters long, all uppercase, and convention -// is to use an abbreviation of the package name. Something short, but -// hopefully unique enough to not conflict with things that may come along in -// the future. 'GPB' is reserved for the protocol buffer implementation itself. -// -// "Gnostic Extension" -option objc_class_prefix = "GNX"; - -// The Go package name. -option go_package = "./extensions;gnostic_extension_v1"; - -// The version number of Gnostic. -message Version { - int32 major = 1; - int32 minor = 2; - int32 patch = 3; - // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should - // be empty for mainline stable releases. - string suffix = 4; -} - -// An encoded Request is written to the ExtensionHandler's stdin. -message ExtensionHandlerRequest { - - // The extension to process. - Wrapper wrapper = 1; - - // The version number of Gnostic. - Version compiler_version = 2; -} - -// The extensions writes an encoded ExtensionHandlerResponse to stdout. -message ExtensionHandlerResponse { - - // true if the extension is handled by the extension handler; false otherwise - bool handled = 1; - - // Error message(s). If non-empty, the extension handling failed. - // The extension handler process should exit with status code zero - // even if it reports an error in this way. - // - // This should be used to indicate errors which prevent the extension from - // operating as intended. Errors which indicate a problem in gnostic - // itself -- such as the input Document being unparseable -- should be - // reported by writing a message to stderr and exiting with a non-zero - // status code. - repeated string errors = 2; - - // text output - google.protobuf.Any value = 3; -} - -message Wrapper { - // version of the OpenAPI specification in which this extension was written. - string version = 1; - - // Name of the extension. - string extension_name = 2; - - // YAML-formatted extension value. - string yaml = 3; -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extensions.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extensions.go deleted file mode 100644 index ec8afd009239..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/extensions/extensions.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 gnostic_extension_v1 - -import ( - "io/ioutil" - "log" - "os" - - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes" -) - -type extensionHandler func(name string, yamlInput string) (bool, proto.Message, error) - -// Main implements the main program of an extension handler. -func Main(handler extensionHandler) { - // unpack the request - data, err := ioutil.ReadAll(os.Stdin) - if err != nil { - log.Println("File error:", err.Error()) - os.Exit(1) - } - if len(data) == 0 { - log.Println("No input data.") - os.Exit(1) - } - request := &ExtensionHandlerRequest{} - err = proto.Unmarshal(data, request) - if err != nil { - log.Println("Input error:", err.Error()) - os.Exit(1) - } - // call the handler - handled, output, err := handler(request.Wrapper.ExtensionName, request.Wrapper.Yaml) - // respond with the output of the handler - response := &ExtensionHandlerResponse{ - Handled: false, // default assumption - Errors: make([]string, 0), - } - if err != nil { - response.Errors = append(response.Errors, err.Error()) - } else if handled { - response.Handled = true - response.Value, err = ptypes.MarshalAny(output) - if err != nil { - response.Errors = append(response.Errors, err.Error()) - } - } - responseBytes, _ := proto.Marshal(response) - os.Stdout.Write(responseBytes) -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/README.md b/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/README.md deleted file mode 100644 index 6793c5179c80..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# jsonschema - -This directory contains code for reading, writing, and manipulating JSON -schemas. diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/base.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/base.go deleted file mode 100644 index 5fcc4885a03c..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/base.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// THIS FILE IS AUTOMATICALLY GENERATED. - -package jsonschema - -import ( - "encoding/base64" -) - -func baseSchemaBytes() ([]byte, error){ - return base64.StdEncoding.DecodeString( -`ewogICAgImlkIjogImh0dHA6Ly9qc29uLXNjaGVtYS5vcmcvZHJhZnQtMDQvc2NoZW1hIyIsCiAgICAi -JHNjaGVtYSI6ICJodHRwOi8vanNvbi1zY2hlbWEub3JnL2RyYWZ0LTA0L3NjaGVtYSMiLAogICAgImRl -c2NyaXB0aW9uIjogIkNvcmUgc2NoZW1hIG1ldGEtc2NoZW1hIiwKICAgICJkZWZpbml0aW9ucyI6IHsK -ICAgICAgICAic2NoZW1hQXJyYXkiOiB7CiAgICAgICAgICAgICJ0eXBlIjogImFycmF5IiwKICAgICAg -ICAgICAgIm1pbkl0ZW1zIjogMSwKICAgICAgICAgICAgIml0ZW1zIjogeyAiJHJlZiI6ICIjIiB9CiAg -ICAgICAgfSwKICAgICAgICAicG9zaXRpdmVJbnRlZ2VyIjogewogICAgICAgICAgICAidHlwZSI6ICJp -bnRlZ2VyIiwKICAgICAgICAgICAgIm1pbmltdW0iOiAwCiAgICAgICAgfSwKICAgICAgICAicG9zaXRp -dmVJbnRlZ2VyRGVmYXVsdDAiOiB7CiAgICAgICAgICAgICJhbGxPZiI6IFsgeyAiJHJlZiI6ICIjL2Rl -ZmluaXRpb25zL3Bvc2l0aXZlSW50ZWdlciIgfSwgeyAiZGVmYXVsdCI6IDAgfSBdCiAgICAgICAgfSwK -ICAgICAgICAic2ltcGxlVHlwZXMiOiB7CiAgICAgICAgICAgICJlbnVtIjogWyAiYXJyYXkiLCAiYm9v -bGVhbiIsICJpbnRlZ2VyIiwgIm51bGwiLCAibnVtYmVyIiwgIm9iamVjdCIsICJzdHJpbmciIF0KICAg -ICAgICB9LAogICAgICAgICJzdHJpbmdBcnJheSI6IHsKICAgICAgICAgICAgInR5cGUiOiAiYXJyYXki -LAogICAgICAgICAgICAiaXRlbXMiOiB7ICJ0eXBlIjogInN0cmluZyIgfSwKICAgICAgICAgICAgIm1p -bkl0ZW1zIjogMSwKICAgICAgICAgICAgInVuaXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgIH0KICAgIH0s -CiAgICAidHlwZSI6ICJvYmplY3QiLAogICAgInByb3BlcnRpZXMiOiB7CiAgICAgICAgImlkIjogewog -ICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciLAogICAgICAgICAgICAiZm9ybWF0IjogInVyaSIKICAg -ICAgICB9LAogICAgICAgICIkc2NoZW1hIjogewogICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciLAog -ICAgICAgICAgICAiZm9ybWF0IjogInVyaSIKICAgICAgICB9LAogICAgICAgICJ0aXRsZSI6IHsKICAg -ICAgICAgICAgInR5cGUiOiAic3RyaW5nIgogICAgICAgIH0sCiAgICAgICAgImRlc2NyaXB0aW9uIjog -ewogICAgICAgICAgICAidHlwZSI6ICJzdHJpbmciCiAgICAgICAgfSwKICAgICAgICAiZGVmYXVsdCI6 -IHt9LAogICAgICAgICJtdWx0aXBsZU9mIjogewogICAgICAgICAgICAidHlwZSI6ICJudW1iZXIiLAog -ICAgICAgICAgICAibWluaW11bSI6IDAsCiAgICAgICAgICAgICJleGNsdXNpdmVNaW5pbXVtIjogdHJ1 -ZQogICAgICAgIH0sCiAgICAgICAgIm1heGltdW0iOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm51bWJl -ciIKICAgICAgICB9LAogICAgICAgICJleGNsdXNpdmVNYXhpbXVtIjogewogICAgICAgICAgICAidHlw -ZSI6ICJib29sZWFuIiwKICAgICAgICAgICAgImRlZmF1bHQiOiBmYWxzZQogICAgICAgIH0sCiAgICAg -ICAgIm1pbmltdW0iOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm51bWJlciIKICAgICAgICB9LAogICAg -ICAgICJleGNsdXNpdmVNaW5pbXVtIjogewogICAgICAgICAgICAidHlwZSI6ICJib29sZWFuIiwKICAg -ICAgICAgICAgImRlZmF1bHQiOiBmYWxzZQogICAgICAgIH0sCiAgICAgICAgIm1heExlbmd0aCI6IHsg -IiRyZWYiOiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXIiIH0sCiAgICAgICAgIm1pbkxlbmd0 -aCI6IHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MCIgfSwKICAg -ICAgICAicGF0dGVybiI6IHsKICAgICAgICAgICAgInR5cGUiOiAic3RyaW5nIiwKICAgICAgICAgICAg -ImZvcm1hdCI6ICJyZWdleCIKICAgICAgICB9LAogICAgICAgICJhZGRpdGlvbmFsSXRlbXMiOiB7CiAg -ICAgICAgICAgICJhbnlPZiI6IFsKICAgICAgICAgICAgICAgIHsgInR5cGUiOiAiYm9vbGVhbiIgfSwK -ICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfQogICAgICAgICAgICBdLAogICAgICAgICAgICAi -ZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAiaXRlbXMiOiB7CiAgICAgICAgICAgICJhbnlP -ZiI6IFsKICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAgICAgIHsgIiRy -ZWYiOiAiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheSIgfQogICAgICAgICAgICBdLAogICAgICAgICAg -ICAiZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAibWF4SXRlbXMiOiB7ICIkcmVmIjogIiMv -ZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyIiB9LAogICAgICAgICJtaW5JdGVtcyI6IHsgIiRyZWYi -OiAiIy9kZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXJEZWZhdWx0MCIgfSwKICAgICAgICAidW5pcXVl -SXRlbXMiOiB7CiAgICAgICAgICAgICJ0eXBlIjogImJvb2xlYW4iLAogICAgICAgICAgICAiZGVmYXVs -dCI6IGZhbHNlCiAgICAgICAgfSwKICAgICAgICAibWF4UHJvcGVydGllcyI6IHsgIiRyZWYiOiAiIy9k -ZWZpbml0aW9ucy9wb3NpdGl2ZUludGVnZXIiIH0sCiAgICAgICAgIm1pblByb3BlcnRpZXMiOiB7ICIk -cmVmIjogIiMvZGVmaW5pdGlvbnMvcG9zaXRpdmVJbnRlZ2VyRGVmYXVsdDAiIH0sCiAgICAgICAgInJl -cXVpcmVkIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3N0cmluZ0FycmF5IiB9LAogICAgICAgICJh -ZGRpdGlvbmFsUHJvcGVydGllcyI6IHsKICAgICAgICAgICAgImFueU9mIjogWwogICAgICAgICAgICAg -ICAgeyAidHlwZSI6ICJib29sZWFuIiB9LAogICAgICAgICAgICAgICAgeyAiJHJlZiI6ICIjIiB9CiAg -ICAgICAgICAgIF0sCiAgICAgICAgICAgICJkZWZhdWx0Ijoge30KICAgICAgICB9LAogICAgICAgICJk -ZWZpbml0aW9ucyI6IHsKICAgICAgICAgICAgInR5cGUiOiAib2JqZWN0IiwKICAgICAgICAgICAgImFk -ZGl0aW9uYWxQcm9wZXJ0aWVzIjogeyAiJHJlZiI6ICIjIiB9LAogICAgICAgICAgICAiZGVmYXVsdCI6 -IHt9CiAgICAgICAgfSwKICAgICAgICAicHJvcGVydGllcyI6IHsKICAgICAgICAgICAgInR5cGUiOiAi -b2JqZWN0IiwKICAgICAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIjogeyAiJHJlZiI6ICIjIiB9 -LAogICAgICAgICAgICAiZGVmYXVsdCI6IHt9CiAgICAgICAgfSwKICAgICAgICAicGF0dGVyblByb3Bl -cnRpZXMiOiB7CiAgICAgICAgICAgICJ0eXBlIjogIm9iamVjdCIsCiAgICAgICAgICAgICJhZGRpdGlv -bmFsUHJvcGVydGllcyI6IHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAgImRlZmF1bHQiOiB7fQog -ICAgICAgIH0sCiAgICAgICAgImRlcGVuZGVuY2llcyI6IHsKICAgICAgICAgICAgInR5cGUiOiAib2Jq -ZWN0IiwKICAgICAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIjogewogICAgICAgICAgICAgICAg -ImFueU9mIjogWwogICAgICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIyIgfSwKICAgICAgICAgICAg -ICAgICAgICB7ICIkcmVmIjogIiMvZGVmaW5pdGlvbnMvc3RyaW5nQXJyYXkiIH0KICAgICAgICAgICAg -ICAgIF0KICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgImVudW0iOiB7CiAgICAgICAgICAg -ICJ0eXBlIjogImFycmF5IiwKICAgICAgICAgICAgIm1pbkl0ZW1zIjogMSwKICAgICAgICAgICAgInVu -aXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgIH0sCiAgICAgICAgInR5cGUiOiB7CiAgICAgICAgICAgICJh -bnlPZiI6IFsKICAgICAgICAgICAgICAgIHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9zaW1wbGVUeXBl -cyIgfSwKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAidHlwZSI6ICJhcnJheSIs -CiAgICAgICAgICAgICAgICAgICAgIml0ZW1zIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3NpbXBs -ZVR5cGVzIiB9LAogICAgICAgICAgICAgICAgICAgICJtaW5JdGVtcyI6IDEsCiAgICAgICAgICAgICAg -ICAgICAgInVuaXF1ZUl0ZW1zIjogdHJ1ZQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBdCiAg -ICAgICAgfSwKICAgICAgICAiYWxsT2YiOiB7ICIkcmVmIjogIiMvZGVmaW5pdGlvbnMvc2NoZW1hQXJy -YXkiIH0sCiAgICAgICAgImFueU9mIjogeyAiJHJlZiI6ICIjL2RlZmluaXRpb25zL3NjaGVtYUFycmF5 -IiB9LAogICAgICAgICJvbmVPZiI6IHsgIiRyZWYiOiAiIy9kZWZpbml0aW9ucy9zY2hlbWFBcnJheSIg -fSwKICAgICAgICAibm90IjogeyAiJHJlZiI6ICIjIiB9CiAgICB9LAogICAgImRlcGVuZGVuY2llcyI6 -IHsKICAgICAgICAiZXhjbHVzaXZlTWF4aW11bSI6IFsgIm1heGltdW0iIF0sCiAgICAgICAgImV4Y2x1 -c2l2ZU1pbmltdW0iOiBbICJtaW5pbXVtIiBdCiAgICB9LAogICAgImRlZmF1bHQiOiB7fQp9Cg==`)} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/display.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/display.go deleted file mode 100644 index 028a760a91b5..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/display.go +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 jsonschema - -import ( - "fmt" - "strings" -) - -// -// DISPLAY -// The following methods display Schemas. -// - -// Description returns a string representation of a string or string array. -func (s *StringOrStringArray) Description() string { - if s.String != nil { - return *s.String - } - if s.StringArray != nil { - return strings.Join(*s.StringArray, ", ") - } - return "" -} - -// Returns a string representation of a Schema. -func (schema *Schema) String() string { - return schema.describeSchema("") -} - -// Helper: Returns a string representation of a Schema indented by a specified string. -func (schema *Schema) describeSchema(indent string) string { - result := "" - if schema.Schema != nil { - result += indent + "$schema: " + *(schema.Schema) + "\n" - } - if schema.ID != nil { - result += indent + "id: " + *(schema.ID) + "\n" - } - if schema.MultipleOf != nil { - result += indent + fmt.Sprintf("multipleOf: %+v\n", *(schema.MultipleOf)) - } - if schema.Maximum != nil { - result += indent + fmt.Sprintf("maximum: %+v\n", *(schema.Maximum)) - } - if schema.ExclusiveMaximum != nil { - result += indent + fmt.Sprintf("exclusiveMaximum: %+v\n", *(schema.ExclusiveMaximum)) - } - if schema.Minimum != nil { - result += indent + fmt.Sprintf("minimum: %+v\n", *(schema.Minimum)) - } - if schema.ExclusiveMinimum != nil { - result += indent + fmt.Sprintf("exclusiveMinimum: %+v\n", *(schema.ExclusiveMinimum)) - } - if schema.MaxLength != nil { - result += indent + fmt.Sprintf("maxLength: %+v\n", *(schema.MaxLength)) - } - if schema.MinLength != nil { - result += indent + fmt.Sprintf("minLength: %+v\n", *(schema.MinLength)) - } - if schema.Pattern != nil { - result += indent + fmt.Sprintf("pattern: %+v\n", *(schema.Pattern)) - } - if schema.AdditionalItems != nil { - s := schema.AdditionalItems.Schema - if s != nil { - result += indent + "additionalItems:\n" - result += s.describeSchema(indent + " ") - } else { - b := *(schema.AdditionalItems.Boolean) - result += indent + fmt.Sprintf("additionalItems: %+v\n", b) - } - } - if schema.Items != nil { - result += indent + "items:\n" - items := schema.Items - if items.SchemaArray != nil { - for i, s := range *(items.SchemaArray) { - result += indent + " " + fmt.Sprintf("%d", i) + ":\n" - result += s.describeSchema(indent + " " + " ") - } - } else if items.Schema != nil { - result += items.Schema.describeSchema(indent + " " + " ") - } - } - if schema.MaxItems != nil { - result += indent + fmt.Sprintf("maxItems: %+v\n", *(schema.MaxItems)) - } - if schema.MinItems != nil { - result += indent + fmt.Sprintf("minItems: %+v\n", *(schema.MinItems)) - } - if schema.UniqueItems != nil { - result += indent + fmt.Sprintf("uniqueItems: %+v\n", *(schema.UniqueItems)) - } - if schema.MaxProperties != nil { - result += indent + fmt.Sprintf("maxProperties: %+v\n", *(schema.MaxProperties)) - } - if schema.MinProperties != nil { - result += indent + fmt.Sprintf("minProperties: %+v\n", *(schema.MinProperties)) - } - if schema.Required != nil { - result += indent + fmt.Sprintf("required: %+v\n", *(schema.Required)) - } - if schema.AdditionalProperties != nil { - s := schema.AdditionalProperties.Schema - if s != nil { - result += indent + "additionalProperties:\n" - result += s.describeSchema(indent + " ") - } else { - b := *(schema.AdditionalProperties.Boolean) - result += indent + fmt.Sprintf("additionalProperties: %+v\n", b) - } - } - if schema.Properties != nil { - result += indent + "properties:\n" - for _, pair := range *(schema.Properties) { - name := pair.Name - s := pair.Value - result += indent + " " + name + ":\n" - result += s.describeSchema(indent + " " + " ") - } - } - if schema.PatternProperties != nil { - result += indent + "patternProperties:\n" - for _, pair := range *(schema.PatternProperties) { - name := pair.Name - s := pair.Value - result += indent + " " + name + ":\n" - result += s.describeSchema(indent + " " + " ") - } - } - if schema.Dependencies != nil { - result += indent + "dependencies:\n" - for _, pair := range *(schema.Dependencies) { - name := pair.Name - schemaOrStringArray := pair.Value - s := schemaOrStringArray.Schema - if s != nil { - result += indent + " " + name + ":\n" - result += s.describeSchema(indent + " " + " ") - } else { - a := schemaOrStringArray.StringArray - if a != nil { - result += indent + " " + name + ":\n" - for _, s2 := range *a { - result += indent + " " + " " + s2 + "\n" - } - } - } - - } - } - if schema.Enumeration != nil { - result += indent + "enumeration:\n" - for _, value := range *(schema.Enumeration) { - if value.String != nil { - result += indent + " " + fmt.Sprintf("%+v\n", *value.String) - } else { - result += indent + " " + fmt.Sprintf("%+v\n", *value.Bool) - } - } - } - if schema.Type != nil { - result += indent + fmt.Sprintf("type: %+v\n", schema.Type.Description()) - } - if schema.AllOf != nil { - result += indent + "allOf:\n" - for _, s := range *(schema.AllOf) { - result += s.describeSchema(indent + " ") - result += indent + "-\n" - } - } - if schema.AnyOf != nil { - result += indent + "anyOf:\n" - for _, s := range *(schema.AnyOf) { - result += s.describeSchema(indent + " ") - result += indent + "-\n" - } - } - if schema.OneOf != nil { - result += indent + "oneOf:\n" - for _, s := range *(schema.OneOf) { - result += s.describeSchema(indent + " ") - result += indent + "-\n" - } - } - if schema.Not != nil { - result += indent + "not:\n" - result += schema.Not.describeSchema(indent + " ") - } - if schema.Definitions != nil { - result += indent + "definitions:\n" - for _, pair := range *(schema.Definitions) { - name := pair.Name - s := pair.Value - result += indent + " " + name + ":\n" - result += s.describeSchema(indent + " " + " ") - } - } - if schema.Title != nil { - result += indent + "title: " + *(schema.Title) + "\n" - } - if schema.Description != nil { - result += indent + "description: " + *(schema.Description) + "\n" - } - if schema.Default != nil { - result += indent + "default:\n" - result += indent + fmt.Sprintf(" %+v\n", *(schema.Default)) - } - if schema.Format != nil { - result += indent + "format: " + *(schema.Format) + "\n" - } - if schema.Ref != nil { - result += indent + "$ref: " + *(schema.Ref) + "\n" - } - return result -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/models.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/models.go deleted file mode 100644 index 4781bdc5f500..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/models.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 jsonschema supports the reading, writing, and manipulation -// of JSON Schemas. -package jsonschema - -import "gopkg.in/yaml.v3" - -// The Schema struct models a JSON Schema and, because schemas are -// defined hierarchically, contains many references to itself. -// All fields are pointers and are nil if the associated values -// are not specified. -type Schema struct { - Schema *string // $schema - ID *string // id keyword used for $ref resolution scope - Ref *string // $ref, i.e. JSON Pointers - - // http://json-schema.org/latest/json-schema-validation.html - // 5.1. Validation keywords for numeric instances (number and integer) - MultipleOf *SchemaNumber - Maximum *SchemaNumber - ExclusiveMaximum *bool - Minimum *SchemaNumber - ExclusiveMinimum *bool - - // 5.2. Validation keywords for strings - MaxLength *int64 - MinLength *int64 - Pattern *string - - // 5.3. Validation keywords for arrays - AdditionalItems *SchemaOrBoolean - Items *SchemaOrSchemaArray - MaxItems *int64 - MinItems *int64 - UniqueItems *bool - - // 5.4. Validation keywords for objects - MaxProperties *int64 - MinProperties *int64 - Required *[]string - AdditionalProperties *SchemaOrBoolean - Properties *[]*NamedSchema - PatternProperties *[]*NamedSchema - Dependencies *[]*NamedSchemaOrStringArray - - // 5.5. Validation keywords for any instance type - Enumeration *[]SchemaEnumValue - Type *StringOrStringArray - AllOf *[]*Schema - AnyOf *[]*Schema - OneOf *[]*Schema - Not *Schema - Definitions *[]*NamedSchema - - // 6. Metadata keywords - Title *string - Description *string - Default *yaml.Node - - // 7. Semantic validation with "format" - Format *string -} - -// These helper structs represent "combination" types that generally can -// have values of one type or another. All are used to represent parts -// of Schemas. - -// SchemaNumber represents a value that can be either an Integer or a Float. -type SchemaNumber struct { - Integer *int64 - Float *float64 -} - -// NewSchemaNumberWithInteger creates and returns a new object -func NewSchemaNumberWithInteger(i int64) *SchemaNumber { - result := &SchemaNumber{} - result.Integer = &i - return result -} - -// NewSchemaNumberWithFloat creates and returns a new object -func NewSchemaNumberWithFloat(f float64) *SchemaNumber { - result := &SchemaNumber{} - result.Float = &f - return result -} - -// SchemaOrBoolean represents a value that can be either a Schema or a Boolean. -type SchemaOrBoolean struct { - Schema *Schema - Boolean *bool -} - -// NewSchemaOrBooleanWithSchema creates and returns a new object -func NewSchemaOrBooleanWithSchema(s *Schema) *SchemaOrBoolean { - result := &SchemaOrBoolean{} - result.Schema = s - return result -} - -// NewSchemaOrBooleanWithBoolean creates and returns a new object -func NewSchemaOrBooleanWithBoolean(b bool) *SchemaOrBoolean { - result := &SchemaOrBoolean{} - result.Boolean = &b - return result -} - -// StringOrStringArray represents a value that can be either -// a String or an Array of Strings. -type StringOrStringArray struct { - String *string - StringArray *[]string -} - -// NewStringOrStringArrayWithString creates and returns a new object -func NewStringOrStringArrayWithString(s string) *StringOrStringArray { - result := &StringOrStringArray{} - result.String = &s - return result -} - -// NewStringOrStringArrayWithStringArray creates and returns a new object -func NewStringOrStringArrayWithStringArray(a []string) *StringOrStringArray { - result := &StringOrStringArray{} - result.StringArray = &a - return result -} - -// SchemaOrStringArray represents a value that can be either -// a Schema or an Array of Strings. -type SchemaOrStringArray struct { - Schema *Schema - StringArray *[]string -} - -// SchemaOrSchemaArray represents a value that can be either -// a Schema or an Array of Schemas. -type SchemaOrSchemaArray struct { - Schema *Schema - SchemaArray *[]*Schema -} - -// NewSchemaOrSchemaArrayWithSchema creates and returns a new object -func NewSchemaOrSchemaArrayWithSchema(s *Schema) *SchemaOrSchemaArray { - result := &SchemaOrSchemaArray{} - result.Schema = s - return result -} - -// NewSchemaOrSchemaArrayWithSchemaArray creates and returns a new object -func NewSchemaOrSchemaArrayWithSchemaArray(a []*Schema) *SchemaOrSchemaArray { - result := &SchemaOrSchemaArray{} - result.SchemaArray = &a - return result -} - -// SchemaEnumValue represents a value that can be part of an -// enumeration in a Schema. -type SchemaEnumValue struct { - String *string - Bool *bool -} - -// NamedSchema is a name-value pair that is used to emulate maps -// with ordered keys. -type NamedSchema struct { - Name string - Value *Schema -} - -// NewNamedSchema creates and returns a new object -func NewNamedSchema(name string, value *Schema) *NamedSchema { - return &NamedSchema{Name: name, Value: value} -} - -// NamedSchemaOrStringArray is a name-value pair that is used -// to emulate maps with ordered keys. -type NamedSchemaOrStringArray struct { - Name string - Value *SchemaOrStringArray -} - -// Access named subschemas by name - -func namedSchemaArrayElementWithName(array *[]*NamedSchema, name string) *Schema { - if array == nil { - return nil - } - for _, pair := range *array { - if pair.Name == name { - return pair.Value - } - } - return nil -} - -// PropertyWithName returns the selected element. -func (s *Schema) PropertyWithName(name string) *Schema { - return namedSchemaArrayElementWithName(s.Properties, name) -} - -// PatternPropertyWithName returns the selected element. -func (s *Schema) PatternPropertyWithName(name string) *Schema { - return namedSchemaArrayElementWithName(s.PatternProperties, name) -} - -// DefinitionWithName returns the selected element. -func (s *Schema) DefinitionWithName(name string) *Schema { - return namedSchemaArrayElementWithName(s.Definitions, name) -} - -// AddProperty adds a named property. -func (s *Schema) AddProperty(name string, property *Schema) { - *s.Properties = append(*s.Properties, NewNamedSchema(name, property)) -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/operations.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/operations.go deleted file mode 100644 index ba8dd4a91b9e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/operations.go +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 jsonschema - -import ( - "fmt" - "log" - "strings" -) - -// -// OPERATIONS -// The following methods perform operations on Schemas. -// - -// IsEmpty returns true if no members of the Schema are specified. -func (schema *Schema) IsEmpty() bool { - return (schema.Schema == nil) && - (schema.ID == nil) && - (schema.MultipleOf == nil) && - (schema.Maximum == nil) && - (schema.ExclusiveMaximum == nil) && - (schema.Minimum == nil) && - (schema.ExclusiveMinimum == nil) && - (schema.MaxLength == nil) && - (schema.MinLength == nil) && - (schema.Pattern == nil) && - (schema.AdditionalItems == nil) && - (schema.Items == nil) && - (schema.MaxItems == nil) && - (schema.MinItems == nil) && - (schema.UniqueItems == nil) && - (schema.MaxProperties == nil) && - (schema.MinProperties == nil) && - (schema.Required == nil) && - (schema.AdditionalProperties == nil) && - (schema.Properties == nil) && - (schema.PatternProperties == nil) && - (schema.Dependencies == nil) && - (schema.Enumeration == nil) && - (schema.Type == nil) && - (schema.AllOf == nil) && - (schema.AnyOf == nil) && - (schema.OneOf == nil) && - (schema.Not == nil) && - (schema.Definitions == nil) && - (schema.Title == nil) && - (schema.Description == nil) && - (schema.Default == nil) && - (schema.Format == nil) && - (schema.Ref == nil) -} - -// IsEqual returns true if two schemas are equal. -func (schema *Schema) IsEqual(schema2 *Schema) bool { - return schema.String() == schema2.String() -} - -// SchemaOperation represents a function that can be applied to a Schema. -type SchemaOperation func(schema *Schema, context string) - -// Applies a specified function to a Schema and all of the Schemas that it contains. -func (schema *Schema) applyToSchemas(operation SchemaOperation, context string) { - - if schema.AdditionalItems != nil { - s := schema.AdditionalItems.Schema - if s != nil { - s.applyToSchemas(operation, "AdditionalItems") - } - } - - if schema.Items != nil { - if schema.Items.SchemaArray != nil { - for _, s := range *(schema.Items.SchemaArray) { - s.applyToSchemas(operation, "Items.SchemaArray") - } - } else if schema.Items.Schema != nil { - schema.Items.Schema.applyToSchemas(operation, "Items.Schema") - } - } - - if schema.AdditionalProperties != nil { - s := schema.AdditionalProperties.Schema - if s != nil { - s.applyToSchemas(operation, "AdditionalProperties") - } - } - - if schema.Properties != nil { - for _, pair := range *(schema.Properties) { - s := pair.Value - s.applyToSchemas(operation, "Properties") - } - } - if schema.PatternProperties != nil { - for _, pair := range *(schema.PatternProperties) { - s := pair.Value - s.applyToSchemas(operation, "PatternProperties") - } - } - - if schema.Dependencies != nil { - for _, pair := range *(schema.Dependencies) { - schemaOrStringArray := pair.Value - s := schemaOrStringArray.Schema - if s != nil { - s.applyToSchemas(operation, "Dependencies") - } - } - } - - if schema.AllOf != nil { - for _, s := range *(schema.AllOf) { - s.applyToSchemas(operation, "AllOf") - } - } - if schema.AnyOf != nil { - for _, s := range *(schema.AnyOf) { - s.applyToSchemas(operation, "AnyOf") - } - } - if schema.OneOf != nil { - for _, s := range *(schema.OneOf) { - s.applyToSchemas(operation, "OneOf") - } - } - if schema.Not != nil { - schema.Not.applyToSchemas(operation, "Not") - } - - if schema.Definitions != nil { - for _, pair := range *(schema.Definitions) { - s := pair.Value - s.applyToSchemas(operation, "Definitions") - } - } - - operation(schema, context) -} - -// CopyProperties copies all non-nil properties from the source Schema to the schema Schema. -func (schema *Schema) CopyProperties(source *Schema) { - if source.Schema != nil { - schema.Schema = source.Schema - } - if source.ID != nil { - schema.ID = source.ID - } - if source.MultipleOf != nil { - schema.MultipleOf = source.MultipleOf - } - if source.Maximum != nil { - schema.Maximum = source.Maximum - } - if source.ExclusiveMaximum != nil { - schema.ExclusiveMaximum = source.ExclusiveMaximum - } - if source.Minimum != nil { - schema.Minimum = source.Minimum - } - if source.ExclusiveMinimum != nil { - schema.ExclusiveMinimum = source.ExclusiveMinimum - } - if source.MaxLength != nil { - schema.MaxLength = source.MaxLength - } - if source.MinLength != nil { - schema.MinLength = source.MinLength - } - if source.Pattern != nil { - schema.Pattern = source.Pattern - } - if source.AdditionalItems != nil { - schema.AdditionalItems = source.AdditionalItems - } - if source.Items != nil { - schema.Items = source.Items - } - if source.MaxItems != nil { - schema.MaxItems = source.MaxItems - } - if source.MinItems != nil { - schema.MinItems = source.MinItems - } - if source.UniqueItems != nil { - schema.UniqueItems = source.UniqueItems - } - if source.MaxProperties != nil { - schema.MaxProperties = source.MaxProperties - } - if source.MinProperties != nil { - schema.MinProperties = source.MinProperties - } - if source.Required != nil { - schema.Required = source.Required - } - if source.AdditionalProperties != nil { - schema.AdditionalProperties = source.AdditionalProperties - } - if source.Properties != nil { - schema.Properties = source.Properties - } - if source.PatternProperties != nil { - schema.PatternProperties = source.PatternProperties - } - if source.Dependencies != nil { - schema.Dependencies = source.Dependencies - } - if source.Enumeration != nil { - schema.Enumeration = source.Enumeration - } - if source.Type != nil { - schema.Type = source.Type - } - if source.AllOf != nil { - schema.AllOf = source.AllOf - } - if source.AnyOf != nil { - schema.AnyOf = source.AnyOf - } - if source.OneOf != nil { - schema.OneOf = source.OneOf - } - if source.Not != nil { - schema.Not = source.Not - } - if source.Definitions != nil { - schema.Definitions = source.Definitions - } - if source.Title != nil { - schema.Title = source.Title - } - if source.Description != nil { - schema.Description = source.Description - } - if source.Default != nil { - schema.Default = source.Default - } - if source.Format != nil { - schema.Format = source.Format - } - if source.Ref != nil { - schema.Ref = source.Ref - } -} - -// TypeIs returns true if the Type of a Schema includes the specified type -func (schema *Schema) TypeIs(typeName string) bool { - if schema.Type != nil { - // the schema Type is either a string or an array of strings - if schema.Type.String != nil { - return (*(schema.Type.String) == typeName) - } else if schema.Type.StringArray != nil { - for _, n := range *(schema.Type.StringArray) { - if n == typeName { - return true - } - } - } - } - return false -} - -// ResolveRefs resolves "$ref" elements in a Schema and its children. -// But if a reference refers to an object type, is inside a oneOf, or contains a oneOf, -// the reference is kept and we expect downstream tools to separately model these -// referenced schemas. -func (schema *Schema) ResolveRefs() { - rootSchema := schema - count := 1 - for count > 0 { - count = 0 - schema.applyToSchemas( - func(schema *Schema, context string) { - if schema.Ref != nil { - resolvedRef, err := rootSchema.resolveJSONPointer(*(schema.Ref)) - if err != nil { - log.Printf("%+v", err) - } else if resolvedRef.TypeIs("object") { - // don't substitute for objects, we'll model the referenced schema with a class - } else if context == "OneOf" { - // don't substitute for references inside oneOf declarations - } else if resolvedRef.OneOf != nil { - // don't substitute for references that contain oneOf declarations - } else if resolvedRef.AdditionalProperties != nil { - // don't substitute for references that look like objects - } else { - schema.Ref = nil - schema.CopyProperties(resolvedRef) - count++ - } - } - }, "") - } -} - -// resolveJSONPointer resolves JSON pointers. -// This current implementation is very crude and custom for OpenAPI 2.0 schemas. -// It panics for any pointer that it is unable to resolve. -func (schema *Schema) resolveJSONPointer(ref string) (result *Schema, err error) { - parts := strings.Split(ref, "#") - if len(parts) == 2 { - documentName := parts[0] + "#" - if documentName == "#" && schema.ID != nil { - documentName = *(schema.ID) - } - path := parts[1] - document := schemas[documentName] - pathParts := strings.Split(path, "/") - - // we currently do a very limited (hard-coded) resolution of certain paths and log errors for missed cases - if len(pathParts) == 1 { - return document, nil - } else if len(pathParts) == 3 { - switch pathParts[1] { - case "definitions": - dictionary := document.Definitions - for _, pair := range *dictionary { - if pair.Name == pathParts[2] { - result = pair.Value - } - } - case "properties": - dictionary := document.Properties - for _, pair := range *dictionary { - if pair.Name == pathParts[2] { - result = pair.Value - } - } - default: - break - } - } - } - if result == nil { - return nil, fmt.Errorf("unresolved pointer: %+v", ref) - } - return result, nil -} - -// ResolveAllOfs replaces "allOf" elements by merging their properties into the parent Schema. -func (schema *Schema) ResolveAllOfs() { - schema.applyToSchemas( - func(schema *Schema, context string) { - if schema.AllOf != nil { - for _, allOf := range *(schema.AllOf) { - schema.CopyProperties(allOf) - } - schema.AllOf = nil - } - }, "resolveAllOfs") -} - -// ResolveAnyOfs replaces all "anyOf" elements with "oneOf". -func (schema *Schema) ResolveAnyOfs() { - schema.applyToSchemas( - func(schema *Schema, context string) { - if schema.AnyOf != nil { - schema.OneOf = schema.AnyOf - schema.AnyOf = nil - } - }, "resolveAnyOfs") -} - -// return a pointer to a copy of a passed-in string -func stringptr(input string) (output *string) { - return &input -} - -// CopyOfficialSchemaProperty copies a named property from the official JSON Schema definition -func (schema *Schema) CopyOfficialSchemaProperty(name string) { - *schema.Properties = append(*schema.Properties, - NewNamedSchema(name, - &Schema{Ref: stringptr("http://json-schema.org/draft-04/schema#/properties/" + name)})) -} - -// CopyOfficialSchemaProperties copies named properties from the official JSON Schema definition -func (schema *Schema) CopyOfficialSchemaProperties(names []string) { - for _, name := range names { - schema.CopyOfficialSchemaProperty(name) - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/reader.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/reader.go deleted file mode 100644 index b8583d466023..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/reader.go +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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:generate go run generate-base.go - -package jsonschema - -import ( - "fmt" - "io/ioutil" - "strconv" - - "gopkg.in/yaml.v3" -) - -// This is a global map of all known Schemas. -// It is initialized when the first Schema is created and inserted. -var schemas map[string]*Schema - -// NewBaseSchema builds a schema object from an embedded json representation. -func NewBaseSchema() (schema *Schema, err error) { - b, err := baseSchemaBytes() - if err != nil { - return nil, err - } - var node yaml.Node - err = yaml.Unmarshal(b, &node) - if err != nil { - return nil, err - } - return NewSchemaFromObject(&node), nil -} - -// NewSchemaFromFile reads a schema from a file. -// Currently this assumes that schemas are stored in the source distribution of this project. -func NewSchemaFromFile(filename string) (schema *Schema, err error) { - file, err := ioutil.ReadFile(filename) - if err != nil { - return nil, err - } - var node yaml.Node - err = yaml.Unmarshal(file, &node) - if err != nil { - return nil, err - } - return NewSchemaFromObject(&node), nil -} - -// NewSchemaFromObject constructs a schema from a parsed JSON object. -// Due to the complexity of the schema representation, this is a -// custom reader and not the standard Go JSON reader (encoding/json). -func NewSchemaFromObject(jsonData *yaml.Node) *Schema { - switch jsonData.Kind { - case yaml.DocumentNode: - return NewSchemaFromObject(jsonData.Content[0]) - case yaml.MappingNode: - schema := &Schema{} - - for i := 0; i < len(jsonData.Content); i += 2 { - k := jsonData.Content[i].Value - v := jsonData.Content[i+1] - - switch k { - case "$schema": - schema.Schema = schema.stringValue(v) - case "id": - schema.ID = schema.stringValue(v) - - case "multipleOf": - schema.MultipleOf = schema.numberValue(v) - case "maximum": - schema.Maximum = schema.numberValue(v) - case "exclusiveMaximum": - schema.ExclusiveMaximum = schema.boolValue(v) - case "minimum": - schema.Minimum = schema.numberValue(v) - case "exclusiveMinimum": - schema.ExclusiveMinimum = schema.boolValue(v) - - case "maxLength": - schema.MaxLength = schema.intValue(v) - case "minLength": - schema.MinLength = schema.intValue(v) - case "pattern": - schema.Pattern = schema.stringValue(v) - - case "additionalItems": - schema.AdditionalItems = schema.schemaOrBooleanValue(v) - case "items": - schema.Items = schema.schemaOrSchemaArrayValue(v) - case "maxItems": - schema.MaxItems = schema.intValue(v) - case "minItems": - schema.MinItems = schema.intValue(v) - case "uniqueItems": - schema.UniqueItems = schema.boolValue(v) - - case "maxProperties": - schema.MaxProperties = schema.intValue(v) - case "minProperties": - schema.MinProperties = schema.intValue(v) - case "required": - schema.Required = schema.arrayOfStringsValue(v) - case "additionalProperties": - schema.AdditionalProperties = schema.schemaOrBooleanValue(v) - case "properties": - schema.Properties = schema.mapOfSchemasValue(v) - case "patternProperties": - schema.PatternProperties = schema.mapOfSchemasValue(v) - case "dependencies": - schema.Dependencies = schema.mapOfSchemasOrStringArraysValue(v) - - case "enum": - schema.Enumeration = schema.arrayOfEnumValuesValue(v) - - case "type": - schema.Type = schema.stringOrStringArrayValue(v) - case "allOf": - schema.AllOf = schema.arrayOfSchemasValue(v) - case "anyOf": - schema.AnyOf = schema.arrayOfSchemasValue(v) - case "oneOf": - schema.OneOf = schema.arrayOfSchemasValue(v) - case "not": - schema.Not = NewSchemaFromObject(v) - case "definitions": - schema.Definitions = schema.mapOfSchemasValue(v) - - case "title": - schema.Title = schema.stringValue(v) - case "description": - schema.Description = schema.stringValue(v) - - case "default": - schema.Default = v - - case "format": - schema.Format = schema.stringValue(v) - case "$ref": - schema.Ref = schema.stringValue(v) - default: - fmt.Printf("UNSUPPORTED (%s)\n", k) - } - } - - // insert schema in global map - if schema.ID != nil { - if schemas == nil { - schemas = make(map[string]*Schema, 0) - } - schemas[*(schema.ID)] = schema - } - return schema - - default: - fmt.Printf("schemaValue: unexpected node %+v\n", jsonData) - return nil - } - - return nil -} - -// -// BUILDERS -// The following methods build elements of Schemas from interface{} values. -// Each returns nil if it is unable to build the desired element. -// - -// Gets the string value of an interface{} value if possible. -func (schema *Schema) stringValue(v *yaml.Node) *string { - switch v.Kind { - case yaml.ScalarNode: - return &v.Value - default: - fmt.Printf("stringValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets the numeric value of an interface{} value if possible. -func (schema *Schema) numberValue(v *yaml.Node) *SchemaNumber { - number := &SchemaNumber{} - switch v.Kind { - case yaml.ScalarNode: - switch v.Tag { - case "!!float": - v2, _ := strconv.ParseFloat(v.Value, 64) - number.Float = &v2 - return number - case "!!int": - v2, _ := strconv.ParseInt(v.Value, 10, 64) - number.Integer = &v2 - return number - default: - fmt.Printf("stringValue: unexpected node %+v\n", v) - } - default: - fmt.Printf("stringValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets the integer value of an interface{} value if possible. -func (schema *Schema) intValue(v *yaml.Node) *int64 { - switch v.Kind { - case yaml.ScalarNode: - switch v.Tag { - case "!!float": - v2, _ := strconv.ParseFloat(v.Value, 64) - v3 := int64(v2) - return &v3 - case "!!int": - v2, _ := strconv.ParseInt(v.Value, 10, 64) - return &v2 - default: - fmt.Printf("intValue: unexpected node %+v\n", v) - } - default: - fmt.Printf("intValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets the bool value of an interface{} value if possible. -func (schema *Schema) boolValue(v *yaml.Node) *bool { - switch v.Kind { - case yaml.ScalarNode: - switch v.Tag { - case "!!bool": - v2, _ := strconv.ParseBool(v.Value) - return &v2 - default: - fmt.Printf("boolValue: unexpected node %+v\n", v) - } - default: - fmt.Printf("boolValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets a map of Schemas from an interface{} value if possible. -func (schema *Schema) mapOfSchemasValue(v *yaml.Node) *[]*NamedSchema { - switch v.Kind { - case yaml.MappingNode: - m := make([]*NamedSchema, 0) - for i := 0; i < len(v.Content); i += 2 { - k2 := v.Content[i].Value - v2 := v.Content[i+1] - pair := &NamedSchema{Name: k2, Value: NewSchemaFromObject(v2)} - m = append(m, pair) - } - return &m - default: - fmt.Printf("mapOfSchemasValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets an array of Schemas from an interface{} value if possible. -func (schema *Schema) arrayOfSchemasValue(v *yaml.Node) *[]*Schema { - switch v.Kind { - case yaml.SequenceNode: - m := make([]*Schema, 0) - for _, v2 := range v.Content { - switch v2.Kind { - case yaml.MappingNode: - s := NewSchemaFromObject(v2) - m = append(m, s) - default: - fmt.Printf("arrayOfSchemasValue: unexpected node %+v\n", v2) - } - } - return &m - case yaml.MappingNode: - m := make([]*Schema, 0) - s := NewSchemaFromObject(v) - m = append(m, s) - return &m - default: - fmt.Printf("arrayOfSchemasValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets a Schema or an array of Schemas from an interface{} value if possible. -func (schema *Schema) schemaOrSchemaArrayValue(v *yaml.Node) *SchemaOrSchemaArray { - switch v.Kind { - case yaml.SequenceNode: - m := make([]*Schema, 0) - for _, v2 := range v.Content { - switch v2.Kind { - case yaml.MappingNode: - s := NewSchemaFromObject(v2) - m = append(m, s) - default: - fmt.Printf("schemaOrSchemaArrayValue: unexpected node %+v\n", v2) - } - } - return &SchemaOrSchemaArray{SchemaArray: &m} - case yaml.MappingNode: - s := NewSchemaFromObject(v) - return &SchemaOrSchemaArray{Schema: s} - default: - fmt.Printf("schemaOrSchemaArrayValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets an array of strings from an interface{} value if possible. -func (schema *Schema) arrayOfStringsValue(v *yaml.Node) *[]string { - switch v.Kind { - case yaml.ScalarNode: - a := []string{v.Value} - return &a - case yaml.SequenceNode: - a := make([]string, 0) - for _, v2 := range v.Content { - switch v2.Kind { - case yaml.ScalarNode: - a = append(a, v2.Value) - default: - fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v2) - } - } - return &a - default: - fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets a string or an array of strings from an interface{} value if possible. -func (schema *Schema) stringOrStringArrayValue(v *yaml.Node) *StringOrStringArray { - switch v.Kind { - case yaml.ScalarNode: - s := &StringOrStringArray{} - s.String = &v.Value - return s - case yaml.SequenceNode: - a := make([]string, 0) - for _, v2 := range v.Content { - switch v2.Kind { - case yaml.ScalarNode: - a = append(a, v2.Value) - default: - fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v2) - } - } - s := &StringOrStringArray{} - s.StringArray = &a - return s - default: - fmt.Printf("arrayOfStringsValue: unexpected node %+v\n", v) - } - return nil -} - -// Gets an array of enum values from an interface{} value if possible. -func (schema *Schema) arrayOfEnumValuesValue(v *yaml.Node) *[]SchemaEnumValue { - a := make([]SchemaEnumValue, 0) - switch v.Kind { - case yaml.SequenceNode: - for _, v2 := range v.Content { - switch v2.Kind { - case yaml.ScalarNode: - switch v2.Tag { - case "!!str": - a = append(a, SchemaEnumValue{String: &v2.Value}) - case "!!bool": - v3, _ := strconv.ParseBool(v2.Value) - a = append(a, SchemaEnumValue{Bool: &v3}) - default: - fmt.Printf("arrayOfEnumValuesValue: unexpected type %s\n", v2.Tag) - } - default: - fmt.Printf("arrayOfEnumValuesValue: unexpected node %+v\n", v2) - } - } - default: - fmt.Printf("arrayOfEnumValuesValue: unexpected node %+v\n", v) - } - return &a -} - -// Gets a map of schemas or string arrays from an interface{} value if possible. -func (schema *Schema) mapOfSchemasOrStringArraysValue(v *yaml.Node) *[]*NamedSchemaOrStringArray { - m := make([]*NamedSchemaOrStringArray, 0) - switch v.Kind { - case yaml.MappingNode: - for i := 0; i < len(v.Content); i += 2 { - k2 := v.Content[i].Value - v2 := v.Content[i+1] - switch v2.Kind { - case yaml.SequenceNode: - a := make([]string, 0) - for _, v3 := range v2.Content { - switch v3.Kind { - case yaml.ScalarNode: - a = append(a, v3.Value) - default: - fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v3) - } - } - s := &SchemaOrStringArray{} - s.StringArray = &a - pair := &NamedSchemaOrStringArray{Name: k2, Value: s} - m = append(m, pair) - default: - fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v2) - } - } - default: - fmt.Printf("mapOfSchemasOrStringArraysValue: unexpected node %+v\n", v) - } - return &m -} - -// Gets a schema or a boolean value from an interface{} value if possible. -func (schema *Schema) schemaOrBooleanValue(v *yaml.Node) *SchemaOrBoolean { - schemaOrBoolean := &SchemaOrBoolean{} - switch v.Kind { - case yaml.ScalarNode: - v2, _ := strconv.ParseBool(v.Value) - schemaOrBoolean.Boolean = &v2 - case yaml.MappingNode: - schemaOrBoolean.Schema = NewSchemaFromObject(v) - default: - fmt.Printf("schemaOrBooleanValue: unexpected node %+v\n", v) - } - return schemaOrBoolean -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/schema.json b/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/schema.json deleted file mode 100644 index 85eb502a680e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/schema.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "id": "http://json-schema.org/draft-04/schema#", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { "$ref": "#" } - }, - "positiveInteger": { - "type": "integer", - "minimum": 0 - }, - "positiveIntegerDefault0": { - "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] - }, - "simpleTypes": { - "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] - }, - "stringArray": { - "type": "array", - "items": { "type": "string" }, - "minItems": 1, - "uniqueItems": true - } - }, - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uri" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "multipleOf": { - "type": "number", - "minimum": 0, - "exclusiveMinimum": true - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "boolean", - "default": false - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "boolean", - "default": false - }, - "maxLength": { "$ref": "#/definitions/positiveInteger" }, - "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": { - "anyOf": [ - { "type": "boolean" }, - { "$ref": "#" } - ], - "default": {} - }, - "items": { - "anyOf": [ - { "$ref": "#" }, - { "$ref": "#/definitions/schemaArray" } - ], - "default": {} - }, - "maxItems": { "$ref": "#/definitions/positiveInteger" }, - "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxProperties": { "$ref": "#/definitions/positiveInteger" }, - "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "required": { "$ref": "#/definitions/stringArray" }, - "additionalProperties": { - "anyOf": [ - { "type": "boolean" }, - { "$ref": "#" } - ], - "default": {} - }, - "definitions": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { "$ref": "#" }, - { "$ref": "#/definitions/stringArray" } - ] - } - }, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - { "$ref": "#/definitions/simpleTypes" }, - { - "type": "array", - "items": { "$ref": "#/definitions/simpleTypes" }, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "allOf": { "$ref": "#/definitions/schemaArray" }, - "anyOf": { "$ref": "#/definitions/schemaArray" }, - "oneOf": { "$ref": "#/definitions/schemaArray" }, - "not": { "$ref": "#" } - }, - "dependencies": { - "exclusiveMaximum": [ "maximum" ], - "exclusiveMinimum": [ "minimum" ] - }, - "default": {} -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/writer.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/writer.go deleted file mode 100644 index 340dc5f93306..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/jsonschema/writer.go +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright 2017 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 jsonschema - -import ( - "fmt" - - "gopkg.in/yaml.v3" -) - -const indentation = " " - -func renderMappingNode(node *yaml.Node, indent string) (result string) { - result = "{\n" - innerIndent := indent + indentation - for i := 0; i < len(node.Content); i += 2 { - // first print the key - key := node.Content[i].Value - result += fmt.Sprintf("%s\"%+v\": ", innerIndent, key) - // then the value - value := node.Content[i+1] - switch value.Kind { - case yaml.ScalarNode: - result += "\"" + value.Value + "\"" - case yaml.MappingNode: - result += renderMappingNode(value, innerIndent) - case yaml.SequenceNode: - result += renderSequenceNode(value, innerIndent) - default: - result += fmt.Sprintf("???MapItem(Key:%+v, Value:%T)", value, value) - } - if i < len(node.Content)-2 { - result += "," - } - result += "\n" - } - - result += indent + "}" - return result -} - -func renderSequenceNode(node *yaml.Node, indent string) (result string) { - result = "[\n" - innerIndent := indent + indentation - for i := 0; i < len(node.Content); i++ { - item := node.Content[i] - switch item.Kind { - case yaml.ScalarNode: - result += innerIndent + "\"" + item.Value + "\"" - case yaml.MappingNode: - result += innerIndent + renderMappingNode(item, innerIndent) + "" - default: - result += innerIndent + fmt.Sprintf("???ArrayItem(%+v)", item) - } - if i < len(node.Content)-1 { - result += "," - } - result += "\n" - } - result += indent + "]" - return result -} - -func renderStringArray(array []string, indent string) (result string) { - result = "[\n" - innerIndent := indent + indentation - for i, item := range array { - result += innerIndent + "\"" + item + "\"" - if i < len(array)-1 { - result += "," - } - result += "\n" - } - result += indent + "]" - return result -} - -// Render renders a yaml.Node as JSON -func Render(node *yaml.Node) string { - if node.Kind == yaml.DocumentNode { - if len(node.Content) == 1 { - return Render(node.Content[0]) - } - } else if node.Kind == yaml.MappingNode { - return renderMappingNode(node, "") + "\n" - } else if node.Kind == yaml.SequenceNode { - return renderSequenceNode(node, "") + "\n" - } - return "" -} - -func (object *SchemaNumber) nodeValue() *yaml.Node { - if object.Integer != nil { - return nodeForInt64(*object.Integer) - } else if object.Float != nil { - return nodeForFloat64(*object.Float) - } else { - return nil - } -} - -func (object *SchemaOrBoolean) nodeValue() *yaml.Node { - if object.Schema != nil { - return object.Schema.nodeValue() - } else if object.Boolean != nil { - return nodeForBoolean(*object.Boolean) - } else { - return nil - } -} - -func nodeForStringArray(array []string) *yaml.Node { - content := make([]*yaml.Node, 0) - for _, item := range array { - content = append(content, nodeForString(item)) - } - return nodeForSequence(content) -} - -func nodeForSchemaArray(array []*Schema) *yaml.Node { - content := make([]*yaml.Node, 0) - for _, item := range array { - content = append(content, item.nodeValue()) - } - return nodeForSequence(content) -} - -func (object *StringOrStringArray) nodeValue() *yaml.Node { - if object.String != nil { - return nodeForString(*object.String) - } else if object.StringArray != nil { - return nodeForStringArray(*(object.StringArray)) - } else { - return nil - } -} - -func (object *SchemaOrStringArray) nodeValue() *yaml.Node { - if object.Schema != nil { - return object.Schema.nodeValue() - } else if object.StringArray != nil { - return nodeForStringArray(*(object.StringArray)) - } else { - return nil - } -} - -func (object *SchemaOrSchemaArray) nodeValue() *yaml.Node { - if object.Schema != nil { - return object.Schema.nodeValue() - } else if object.SchemaArray != nil { - return nodeForSchemaArray(*(object.SchemaArray)) - } else { - return nil - } -} - -func (object *SchemaEnumValue) nodeValue() *yaml.Node { - if object.String != nil { - return nodeForString(*object.String) - } else if object.Bool != nil { - return nodeForBoolean(*object.Bool) - } else { - return nil - } -} - -func nodeForNamedSchemaArray(array *[]*NamedSchema) *yaml.Node { - content := make([]*yaml.Node, 0) - for _, pair := range *(array) { - content = appendPair(content, pair.Name, pair.Value.nodeValue()) - } - return nodeForMapping(content) -} - -func nodeForNamedSchemaOrStringArray(array *[]*NamedSchemaOrStringArray) *yaml.Node { - content := make([]*yaml.Node, 0) - for _, pair := range *(array) { - content = appendPair(content, pair.Name, pair.Value.nodeValue()) - } - return nodeForMapping(content) -} - -func nodeForSchemaEnumArray(array *[]SchemaEnumValue) *yaml.Node { - content := make([]*yaml.Node, 0) - for _, item := range *array { - content = append(content, item.nodeValue()) - } - return nodeForSequence(content) -} - -func nodeForMapping(content []*yaml.Node) *yaml.Node { - return &yaml.Node{ - Kind: yaml.MappingNode, - Content: content, - } -} - -func nodeForSequence(content []*yaml.Node) *yaml.Node { - return &yaml.Node{ - Kind: yaml.SequenceNode, - Content: content, - } -} - -func nodeForString(value string) *yaml.Node { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!str", - Value: value, - } -} - -func nodeForBoolean(value bool) *yaml.Node { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!bool", - Value: fmt.Sprintf("%t", value), - } -} - -func nodeForInt64(value int64) *yaml.Node { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!int", - Value: fmt.Sprintf("%d", value), - } -} - -func nodeForFloat64(value float64) *yaml.Node { - return &yaml.Node{ - Kind: yaml.ScalarNode, - Tag: "!!float", - Value: fmt.Sprintf("%f", value), - } -} - -func appendPair(nodes []*yaml.Node, name string, value *yaml.Node) []*yaml.Node { - nodes = append(nodes, nodeForString(name)) - nodes = append(nodes, value) - return nodes -} - -func (schema *Schema) nodeValue() *yaml.Node { - n := &yaml.Node{Kind: yaml.MappingNode} - content := make([]*yaml.Node, 0) - if schema.Title != nil { - content = appendPair(content, "title", nodeForString(*schema.Title)) - } - if schema.ID != nil { - content = appendPair(content, "id", nodeForString(*schema.ID)) - } - if schema.Schema != nil { - content = appendPair(content, "$schema", nodeForString(*schema.Schema)) - } - if schema.Type != nil { - content = appendPair(content, "type", schema.Type.nodeValue()) - } - if schema.Items != nil { - content = appendPair(content, "items", schema.Items.nodeValue()) - } - if schema.Description != nil { - content = appendPair(content, "description", nodeForString(*schema.Description)) - } - if schema.Required != nil { - content = appendPair(content, "required", nodeForStringArray(*schema.Required)) - } - if schema.AdditionalProperties != nil { - content = appendPair(content, "additionalProperties", schema.AdditionalProperties.nodeValue()) - } - if schema.PatternProperties != nil { - content = appendPair(content, "patternProperties", nodeForNamedSchemaArray(schema.PatternProperties)) - } - if schema.Properties != nil { - content = appendPair(content, "properties", nodeForNamedSchemaArray(schema.Properties)) - } - if schema.Dependencies != nil { - content = appendPair(content, "dependencies", nodeForNamedSchemaOrStringArray(schema.Dependencies)) - } - if schema.Ref != nil { - content = appendPair(content, "$ref", nodeForString(*schema.Ref)) - } - if schema.MultipleOf != nil { - content = appendPair(content, "multipleOf", schema.MultipleOf.nodeValue()) - } - if schema.Maximum != nil { - content = appendPair(content, "maximum", schema.Maximum.nodeValue()) - } - if schema.ExclusiveMaximum != nil { - content = appendPair(content, "exclusiveMaximum", nodeForBoolean(*schema.ExclusiveMaximum)) - } - if schema.Minimum != nil { - content = appendPair(content, "minimum", schema.Minimum.nodeValue()) - } - if schema.ExclusiveMinimum != nil { - content = appendPair(content, "exclusiveMinimum", nodeForBoolean(*schema.ExclusiveMinimum)) - } - if schema.MaxLength != nil { - content = appendPair(content, "maxLength", nodeForInt64(*schema.MaxLength)) - } - if schema.MinLength != nil { - content = appendPair(content, "minLength", nodeForInt64(*schema.MinLength)) - } - if schema.Pattern != nil { - content = appendPair(content, "pattern", nodeForString(*schema.Pattern)) - } - if schema.AdditionalItems != nil { - content = appendPair(content, "additionalItems", schema.AdditionalItems.nodeValue()) - } - if schema.MaxItems != nil { - content = appendPair(content, "maxItems", nodeForInt64(*schema.MaxItems)) - } - if schema.MinItems != nil { - content = appendPair(content, "minItems", nodeForInt64(*schema.MinItems)) - } - if schema.UniqueItems != nil { - content = appendPair(content, "uniqueItems", nodeForBoolean(*schema.UniqueItems)) - } - if schema.MaxProperties != nil { - content = appendPair(content, "maxProperties", nodeForInt64(*schema.MaxProperties)) - } - if schema.MinProperties != nil { - content = appendPair(content, "minProperties", nodeForInt64(*schema.MinProperties)) - } - if schema.Enumeration != nil { - content = appendPair(content, "enum", nodeForSchemaEnumArray(schema.Enumeration)) - } - if schema.AllOf != nil { - content = appendPair(content, "allOf", nodeForSchemaArray(*schema.AllOf)) - } - if schema.AnyOf != nil { - content = appendPair(content, "anyOf", nodeForSchemaArray(*schema.AnyOf)) - } - if schema.OneOf != nil { - content = appendPair(content, "oneOf", nodeForSchemaArray(*schema.OneOf)) - } - if schema.Not != nil { - content = appendPair(content, "not", schema.Not.nodeValue()) - } - if schema.Definitions != nil { - content = appendPair(content, "definitions", nodeForNamedSchemaArray(schema.Definitions)) - } - if schema.Default != nil { - // m = append(m, yaml.MapItem{Key: "default", Value: *schema.Default}) - } - if schema.Format != nil { - content = appendPair(content, "format", nodeForString(*schema.Format)) - } - n.Content = content - return n -} - -// JSONString returns a json representation of a schema. -func (schema *Schema) JSONString() string { - node := schema.nodeValue() - return Render(node) -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.go deleted file mode 100644 index d71fe6d5451e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.go +++ /dev/null @@ -1,8820 +0,0 @@ -// Copyright 2020 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// THIS FILE IS AUTOMATICALLY GENERATED. - -package openapi_v2 - -import ( - "fmt" - "regexp" - "strings" - - "gopkg.in/yaml.v3" - - "github.com/google/gnostic-models/compiler" -) - -// Version returns the package name (and OpenAPI version). -func Version() string { - return "openapi_v2" -} - -// NewAdditionalPropertiesItem creates an object of type AdditionalPropertiesItem if possible, returning an error if not. -func NewAdditionalPropertiesItem(in *yaml.Node, context *compiler.Context) (*AdditionalPropertiesItem, error) { - errors := make([]error, 0) - x := &AdditionalPropertiesItem{} - matched := false - // Schema schema = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewSchema(m, compiler.NewContext("schema", m, context)) - if matchingError == nil { - x.Oneof = &AdditionalPropertiesItem_Schema{Schema: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // bool boolean = 2; - boolValue, ok := compiler.BoolForScalarNode(in) - if ok { - x.Oneof = &AdditionalPropertiesItem_Boolean{Boolean: boolValue} - matched = true - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid AdditionalPropertiesItem") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewAny creates an object of type Any if possible, returning an error if not. -func NewAny(in *yaml.Node, context *compiler.Context) (*Any, error) { - errors := make([]error, 0) - x := &Any{} - bytes := compiler.Marshal(in) - x.Yaml = string(bytes) - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewApiKeySecurity creates an object of type ApiKeySecurity if possible, returning an error if not. -func NewApiKeySecurity(in *yaml.Node, context *compiler.Context) (*ApiKeySecurity, error) { - errors := make([]error, 0) - x := &ApiKeySecurity{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"in", "name", "type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "in", "name", "type"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [apiKey] - if ok && !compiler.StringArrayContainsValue([]string{"apiKey"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string name = 2; - v2 := compiler.MapValueForKey(m, "name") - if v2 != nil { - x.Name, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string in = 3; - v3 := compiler.MapValueForKey(m, "in") - if v3 != nil { - x.In, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [header query] - if ok && !compiler.StringArrayContainsValue([]string{"header", "query"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 4; - v4 := compiler.MapValueForKey(m, "description") - if v4 != nil { - x.Description, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 5; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewBasicAuthenticationSecurity creates an object of type BasicAuthenticationSecurity if possible, returning an error if not. -func NewBasicAuthenticationSecurity(in *yaml.Node, context *compiler.Context) (*BasicAuthenticationSecurity, error) { - errors := make([]error, 0) - x := &BasicAuthenticationSecurity{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "type"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [basic] - if ok && !compiler.StringArrayContainsValue([]string{"basic"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 2; - v2 := compiler.MapValueForKey(m, "description") - if v2 != nil { - x.Description, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 3; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewBodyParameter creates an object of type BodyParameter if possible, returning an error if not. -func NewBodyParameter(in *yaml.Node, context *compiler.Context) (*BodyParameter, error) { - errors := make([]error, 0) - x := &BodyParameter{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"in", "name", "schema"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "in", "name", "required", "schema"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string description = 1; - v1 := compiler.MapValueForKey(m, "description") - if v1 != nil { - x.Description, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string name = 2; - v2 := compiler.MapValueForKey(m, "name") - if v2 != nil { - x.Name, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string in = 3; - v3 := compiler.MapValueForKey(m, "in") - if v3 != nil { - x.In, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [body] - if ok && !compiler.StringArrayContainsValue([]string{"body"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool required = 4; - v4 := compiler.MapValueForKey(m, "required") - if v4 != nil { - x.Required, ok = compiler.BoolForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Schema schema = 5; - v5 := compiler.MapValueForKey(m, "schema") - if v5 != nil { - var err error - x.Schema, err = NewSchema(v5, compiler.NewContext("schema", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny vendor_extension = 6; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewContact creates an object of type Contact if possible, returning an error if not. -func NewContact(in *yaml.Node, context *compiler.Context) (*Contact, error) { - errors := make([]error, 0) - x := &Contact{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"email", "name", "url"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string url = 2; - v2 := compiler.MapValueForKey(m, "url") - if v2 != nil { - x.Url, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string email = 3; - v3 := compiler.MapValueForKey(m, "email") - if v3 != nil { - x.Email, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for email: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 4; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewDefault creates an object of type Default if possible, returning an error if not. -func NewDefault(in *yaml.Node, context *compiler.Context) (*Default, error) { - errors := make([]error, 0) - x := &Default{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedAny additional_properties = 1; - // MAP: Any - x.AdditionalProperties = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewDefinitions creates an object of type Definitions if possible, returning an error if not. -func NewDefinitions(in *yaml.Node, context *compiler.Context) (*Definitions, error) { - errors := make([]error, 0) - x := &Definitions{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedSchema additional_properties = 1; - // MAP: Schema - x.AdditionalProperties = make([]*NamedSchema, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedSchema{} - pair.Name = k - var err error - pair.Value, err = NewSchema(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewDocument creates an object of type Document if possible, returning an error if not. -func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { - errors := make([]error, 0) - x := &Document{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"info", "paths", "swagger"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"basePath", "consumes", "definitions", "externalDocs", "host", "info", "parameters", "paths", "produces", "responses", "schemes", "security", "securityDefinitions", "swagger", "tags"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string swagger = 1; - v1 := compiler.MapValueForKey(m, "swagger") - if v1 != nil { - x.Swagger, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for swagger: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [2.0] - if ok && !compiler.StringArrayContainsValue([]string{"2.0"}, x.Swagger) { - message := fmt.Sprintf("has unexpected value for swagger: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Info info = 2; - v2 := compiler.MapValueForKey(m, "info") - if v2 != nil { - var err error - x.Info, err = NewInfo(v2, compiler.NewContext("info", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // string host = 3; - v3 := compiler.MapValueForKey(m, "host") - if v3 != nil { - x.Host, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for host: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string base_path = 4; - v4 := compiler.MapValueForKey(m, "basePath") - if v4 != nil { - x.BasePath, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for basePath: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated string schemes = 5; - v5 := compiler.MapValueForKey(m, "schemes") - if v5 != nil { - v, ok := compiler.SequenceNodeForNode(v5) - if ok { - x.Schemes = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [http https ws wss] - if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) { - message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated string consumes = 6; - v6 := compiler.MapValueForKey(m, "consumes") - if v6 != nil { - v, ok := compiler.SequenceNodeForNode(v6) - if ok { - x.Consumes = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for consumes: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated string produces = 7; - v7 := compiler.MapValueForKey(m, "produces") - if v7 != nil { - v, ok := compiler.SequenceNodeForNode(v7) - if ok { - x.Produces = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for produces: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Paths paths = 8; - v8 := compiler.MapValueForKey(m, "paths") - if v8 != nil { - var err error - x.Paths, err = NewPaths(v8, compiler.NewContext("paths", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // Definitions definitions = 9; - v9 := compiler.MapValueForKey(m, "definitions") - if v9 != nil { - var err error - x.Definitions, err = NewDefinitions(v9, compiler.NewContext("definitions", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // ParameterDefinitions parameters = 10; - v10 := compiler.MapValueForKey(m, "parameters") - if v10 != nil { - var err error - x.Parameters, err = NewParameterDefinitions(v10, compiler.NewContext("parameters", v10, context)) - if err != nil { - errors = append(errors, err) - } - } - // ResponseDefinitions responses = 11; - v11 := compiler.MapValueForKey(m, "responses") - if v11 != nil { - var err error - x.Responses, err = NewResponseDefinitions(v11, compiler.NewContext("responses", v11, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated SecurityRequirement security = 12; - v12 := compiler.MapValueForKey(m, "security") - if v12 != nil { - // repeated SecurityRequirement - x.Security = make([]*SecurityRequirement, 0) - a, ok := compiler.SequenceNodeForNode(v12) - if ok { - for _, item := range a.Content { - y, err := NewSecurityRequirement(item, compiler.NewContext("security", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Security = append(x.Security, y) - } - } - } - // SecurityDefinitions security_definitions = 13; - v13 := compiler.MapValueForKey(m, "securityDefinitions") - if v13 != nil { - var err error - x.SecurityDefinitions, err = NewSecurityDefinitions(v13, compiler.NewContext("securityDefinitions", v13, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated Tag tags = 14; - v14 := compiler.MapValueForKey(m, "tags") - if v14 != nil { - // repeated Tag - x.Tags = make([]*Tag, 0) - a, ok := compiler.SequenceNodeForNode(v14) - if ok { - for _, item := range a.Content { - y, err := NewTag(item, compiler.NewContext("tags", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Tags = append(x.Tags, y) - } - } - } - // ExternalDocs external_docs = 15; - v15 := compiler.MapValueForKey(m, "externalDocs") - if v15 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v15, compiler.NewContext("externalDocs", v15, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny vendor_extension = 16; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewExamples creates an object of type Examples if possible, returning an error if not. -func NewExamples(in *yaml.Node, context *compiler.Context) (*Examples, error) { - errors := make([]error, 0) - x := &Examples{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedAny additional_properties = 1; - // MAP: Any - x.AdditionalProperties = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewExternalDocs creates an object of type ExternalDocs if possible, returning an error if not. -func NewExternalDocs(in *yaml.Node, context *compiler.Context) (*ExternalDocs, error) { - errors := make([]error, 0) - x := &ExternalDocs{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"url"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "url"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string description = 1; - v1 := compiler.MapValueForKey(m, "description") - if v1 != nil { - x.Description, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string url = 2; - v2 := compiler.MapValueForKey(m, "url") - if v2 != nil { - x.Url, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 3; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewFileSchema creates an object of type FileSchema if possible, returning an error if not. -func NewFileSchema(in *yaml.Node, context *compiler.Context) (*FileSchema, error) { - errors := make([]error, 0) - x := &FileSchema{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"default", "description", "example", "externalDocs", "format", "readOnly", "required", "title", "type"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string format = 1; - v1 := compiler.MapValueForKey(m, "format") - if v1 != nil { - x.Format, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string title = 2; - v2 := compiler.MapValueForKey(m, "title") - if v2 != nil { - x.Title, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any default = 4; - v4 := compiler.MapValueForKey(m, "default") - if v4 != nil { - var err error - x.Default, err = NewAny(v4, compiler.NewContext("default", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated string required = 5; - v5 := compiler.MapValueForKey(m, "required") - if v5 != nil { - v, ok := compiler.SequenceNodeForNode(v5) - if ok { - x.Required = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string type = 6; - v6 := compiler.MapValueForKey(m, "type") - if v6 != nil { - x.Type, ok = compiler.StringForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [file] - if ok && !compiler.StringArrayContainsValue([]string{"file"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool read_only = 7; - v7 := compiler.MapValueForKey(m, "readOnly") - if v7 != nil { - x.ReadOnly, ok = compiler.BoolForScalarNode(v7) - if !ok { - message := fmt.Sprintf("has unexpected value for readOnly: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ExternalDocs external_docs = 8; - v8 := compiler.MapValueForKey(m, "externalDocs") - if v8 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v8, compiler.NewContext("externalDocs", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // Any example = 9; - v9 := compiler.MapValueForKey(m, "example") - if v9 != nil { - var err error - x.Example, err = NewAny(v9, compiler.NewContext("example", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny vendor_extension = 10; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewFormDataParameterSubSchema creates an object of type FormDataParameterSubSchema if possible, returning an error if not. -func NewFormDataParameterSubSchema(in *yaml.Node, context *compiler.Context) (*FormDataParameterSubSchema, error) { - errors := make([]error, 0) - x := &FormDataParameterSubSchema{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"allowEmptyValue", "collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // bool required = 1; - v1 := compiler.MapValueForKey(m, "required") - if v1 != nil { - x.Required, ok = compiler.BoolForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string in = 2; - v2 := compiler.MapValueForKey(m, "in") - if v2 != nil { - x.In, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [formData] - if ok && !compiler.StringArrayContainsValue([]string{"formData"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string name = 4; - v4 := compiler.MapValueForKey(m, "name") - if v4 != nil { - x.Name, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool allow_empty_value = 5; - v5 := compiler.MapValueForKey(m, "allowEmptyValue") - if v5 != nil { - x.AllowEmptyValue, ok = compiler.BoolForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for allowEmptyValue: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string type = 6; - v6 := compiler.MapValueForKey(m, "type") - if v6 != nil { - x.Type, ok = compiler.StringForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [string number boolean integer array file] - if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array", "file"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string format = 7; - v7 := compiler.MapValueForKey(m, "format") - if v7 != nil { - x.Format, ok = compiler.StringForScalarNode(v7) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // PrimitivesItems items = 8; - v8 := compiler.MapValueForKey(m, "items") - if v8 != nil { - var err error - x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // string collection_format = 9; - v9 := compiler.MapValueForKey(m, "collectionFormat") - if v9 != nil { - x.CollectionFormat, ok = compiler.StringForScalarNode(v9) - if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [csv ssv tsv pipes multi] - if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any default = 10; - v10 := compiler.MapValueForKey(m, "default") - if v10 != nil { - var err error - x.Default, err = NewAny(v10, compiler.NewContext("default", v10, context)) - if err != nil { - errors = append(errors, err) - } - } - // float maximum = 11; - v11 := compiler.MapValueForKey(m, "maximum") - if v11 != nil { - v, ok := compiler.FloatForScalarNode(v11) - if ok { - x.Maximum = v - } else { - message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_maximum = 12; - v12 := compiler.MapValueForKey(m, "exclusiveMaximum") - if v12 != nil { - x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v12) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v12)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float minimum = 13; - v13 := compiler.MapValueForKey(m, "minimum") - if v13 != nil { - v, ok := compiler.FloatForScalarNode(v13) - if ok { - x.Minimum = v - } else { - message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v13)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_minimum = 14; - v14 := compiler.MapValueForKey(m, "exclusiveMinimum") - if v14 != nil { - x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v14) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v14)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_length = 15; - v15 := compiler.MapValueForKey(m, "maxLength") - if v15 != nil { - t, ok := compiler.IntForScalarNode(v15) - if ok { - x.MaxLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v15)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_length = 16; - v16 := compiler.MapValueForKey(m, "minLength") - if v16 != nil { - t, ok := compiler.IntForScalarNode(v16) - if ok { - x.MinLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v16)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string pattern = 17; - v17 := compiler.MapValueForKey(m, "pattern") - if v17 != nil { - x.Pattern, ok = compiler.StringForScalarNode(v17) - if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v17)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_items = 18; - v18 := compiler.MapValueForKey(m, "maxItems") - if v18 != nil { - t, ok := compiler.IntForScalarNode(v18) - if ok { - x.MaxItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v18)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_items = 19; - v19 := compiler.MapValueForKey(m, "minItems") - if v19 != nil { - t, ok := compiler.IntForScalarNode(v19) - if ok { - x.MinItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v19)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool unique_items = 20; - v20 := compiler.MapValueForKey(m, "uniqueItems") - if v20 != nil { - x.UniqueItems, ok = compiler.BoolForScalarNode(v20) - if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v20)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated Any enum = 21; - v21 := compiler.MapValueForKey(m, "enum") - if v21 != nil { - // repeated Any - x.Enum = make([]*Any, 0) - a, ok := compiler.SequenceNodeForNode(v21) - if ok { - for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Enum = append(x.Enum, y) - } - } - } - // float multiple_of = 22; - v22 := compiler.MapValueForKey(m, "multipleOf") - if v22 != nil { - v, ok := compiler.FloatForScalarNode(v22) - if ok { - x.MultipleOf = v - } else { - message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v22)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 23; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewHeader creates an object of type Header if possible, returning an error if not. -func NewHeader(in *yaml.Node, context *compiler.Context) (*Header, error) { - errors := make([]error, 0) - x := &Header{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "pattern", "type", "uniqueItems"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [string number integer boolean array] - if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string format = 2; - v2 := compiler.MapValueForKey(m, "format") - if v2 != nil { - x.Format, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // PrimitivesItems items = 3; - v3 := compiler.MapValueForKey(m, "items") - if v3 != nil { - var err error - x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // string collection_format = 4; - v4 := compiler.MapValueForKey(m, "collectionFormat") - if v4 != nil { - x.CollectionFormat, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [csv ssv tsv pipes] - if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any default = 5; - v5 := compiler.MapValueForKey(m, "default") - if v5 != nil { - var err error - x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // float maximum = 6; - v6 := compiler.MapValueForKey(m, "maximum") - if v6 != nil { - v, ok := compiler.FloatForScalarNode(v6) - if ok { - x.Maximum = v - } else { - message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_maximum = 7; - v7 := compiler.MapValueForKey(m, "exclusiveMaximum") - if v7 != nil { - x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v7) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float minimum = 8; - v8 := compiler.MapValueForKey(m, "minimum") - if v8 != nil { - v, ok := compiler.FloatForScalarNode(v8) - if ok { - x.Minimum = v - } else { - message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_minimum = 9; - v9 := compiler.MapValueForKey(m, "exclusiveMinimum") - if v9 != nil { - x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v9) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_length = 10; - v10 := compiler.MapValueForKey(m, "maxLength") - if v10 != nil { - t, ok := compiler.IntForScalarNode(v10) - if ok { - x.MaxLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_length = 11; - v11 := compiler.MapValueForKey(m, "minLength") - if v11 != nil { - t, ok := compiler.IntForScalarNode(v11) - if ok { - x.MinLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string pattern = 12; - v12 := compiler.MapValueForKey(m, "pattern") - if v12 != nil { - x.Pattern, ok = compiler.StringForScalarNode(v12) - if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v12)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_items = 13; - v13 := compiler.MapValueForKey(m, "maxItems") - if v13 != nil { - t, ok := compiler.IntForScalarNode(v13) - if ok { - x.MaxItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v13)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_items = 14; - v14 := compiler.MapValueForKey(m, "minItems") - if v14 != nil { - t, ok := compiler.IntForScalarNode(v14) - if ok { - x.MinItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v14)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool unique_items = 15; - v15 := compiler.MapValueForKey(m, "uniqueItems") - if v15 != nil { - x.UniqueItems, ok = compiler.BoolForScalarNode(v15) - if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v15)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated Any enum = 16; - v16 := compiler.MapValueForKey(m, "enum") - if v16 != nil { - // repeated Any - x.Enum = make([]*Any, 0) - a, ok := compiler.SequenceNodeForNode(v16) - if ok { - for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Enum = append(x.Enum, y) - } - } - } - // float multiple_of = 17; - v17 := compiler.MapValueForKey(m, "multipleOf") - if v17 != nil { - v, ok := compiler.FloatForScalarNode(v17) - if ok { - x.MultipleOf = v - } else { - message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v17)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 18; - v18 := compiler.MapValueForKey(m, "description") - if v18 != nil { - x.Description, ok = compiler.StringForScalarNode(v18) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v18)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 19; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewHeaderParameterSubSchema creates an object of type HeaderParameterSubSchema if possible, returning an error if not. -func NewHeaderParameterSubSchema(in *yaml.Node, context *compiler.Context) (*HeaderParameterSubSchema, error) { - errors := make([]error, 0) - x := &HeaderParameterSubSchema{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // bool required = 1; - v1 := compiler.MapValueForKey(m, "required") - if v1 != nil { - x.Required, ok = compiler.BoolForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string in = 2; - v2 := compiler.MapValueForKey(m, "in") - if v2 != nil { - x.In, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [header] - if ok && !compiler.StringArrayContainsValue([]string{"header"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string name = 4; - v4 := compiler.MapValueForKey(m, "name") - if v4 != nil { - x.Name, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string type = 5; - v5 := compiler.MapValueForKey(m, "type") - if v5 != nil { - x.Type, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [string number boolean integer array] - if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string format = 6; - v6 := compiler.MapValueForKey(m, "format") - if v6 != nil { - x.Format, ok = compiler.StringForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // PrimitivesItems items = 7; - v7 := compiler.MapValueForKey(m, "items") - if v7 != nil { - var err error - x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", v7, context)) - if err != nil { - errors = append(errors, err) - } - } - // string collection_format = 8; - v8 := compiler.MapValueForKey(m, "collectionFormat") - if v8 != nil { - x.CollectionFormat, ok = compiler.StringForScalarNode(v8) - if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [csv ssv tsv pipes] - if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any default = 9; - v9 := compiler.MapValueForKey(m, "default") - if v9 != nil { - var err error - x.Default, err = NewAny(v9, compiler.NewContext("default", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // float maximum = 10; - v10 := compiler.MapValueForKey(m, "maximum") - if v10 != nil { - v, ok := compiler.FloatForScalarNode(v10) - if ok { - x.Maximum = v - } else { - message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_maximum = 11; - v11 := compiler.MapValueForKey(m, "exclusiveMaximum") - if v11 != nil { - x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v11) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float minimum = 12; - v12 := compiler.MapValueForKey(m, "minimum") - if v12 != nil { - v, ok := compiler.FloatForScalarNode(v12) - if ok { - x.Minimum = v - } else { - message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v12)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_minimum = 13; - v13 := compiler.MapValueForKey(m, "exclusiveMinimum") - if v13 != nil { - x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v13) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v13)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_length = 14; - v14 := compiler.MapValueForKey(m, "maxLength") - if v14 != nil { - t, ok := compiler.IntForScalarNode(v14) - if ok { - x.MaxLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v14)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_length = 15; - v15 := compiler.MapValueForKey(m, "minLength") - if v15 != nil { - t, ok := compiler.IntForScalarNode(v15) - if ok { - x.MinLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v15)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string pattern = 16; - v16 := compiler.MapValueForKey(m, "pattern") - if v16 != nil { - x.Pattern, ok = compiler.StringForScalarNode(v16) - if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v16)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_items = 17; - v17 := compiler.MapValueForKey(m, "maxItems") - if v17 != nil { - t, ok := compiler.IntForScalarNode(v17) - if ok { - x.MaxItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v17)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_items = 18; - v18 := compiler.MapValueForKey(m, "minItems") - if v18 != nil { - t, ok := compiler.IntForScalarNode(v18) - if ok { - x.MinItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v18)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool unique_items = 19; - v19 := compiler.MapValueForKey(m, "uniqueItems") - if v19 != nil { - x.UniqueItems, ok = compiler.BoolForScalarNode(v19) - if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v19)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated Any enum = 20; - v20 := compiler.MapValueForKey(m, "enum") - if v20 != nil { - // repeated Any - x.Enum = make([]*Any, 0) - a, ok := compiler.SequenceNodeForNode(v20) - if ok { - for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Enum = append(x.Enum, y) - } - } - } - // float multiple_of = 21; - v21 := compiler.MapValueForKey(m, "multipleOf") - if v21 != nil { - v, ok := compiler.FloatForScalarNode(v21) - if ok { - x.MultipleOf = v - } else { - message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v21)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 22; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewHeaders creates an object of type Headers if possible, returning an error if not. -func NewHeaders(in *yaml.Node, context *compiler.Context) (*Headers, error) { - errors := make([]error, 0) - x := &Headers{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedHeader additional_properties = 1; - // MAP: Header - x.AdditionalProperties = make([]*NamedHeader, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedHeader{} - pair.Name = k - var err error - pair.Value, err = NewHeader(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewInfo creates an object of type Info if possible, returning an error if not. -func NewInfo(in *yaml.Node, context *compiler.Context) (*Info, error) { - errors := make([]error, 0) - x := &Info{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"title", "version"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"contact", "description", "license", "termsOfService", "title", "version"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string title = 1; - v1 := compiler.MapValueForKey(m, "title") - if v1 != nil { - x.Title, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string version = 2; - v2 := compiler.MapValueForKey(m, "version") - if v2 != nil { - x.Version, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for version: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string terms_of_service = 4; - v4 := compiler.MapValueForKey(m, "termsOfService") - if v4 != nil { - x.TermsOfService, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for termsOfService: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Contact contact = 5; - v5 := compiler.MapValueForKey(m, "contact") - if v5 != nil { - var err error - x.Contact, err = NewContact(v5, compiler.NewContext("contact", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // License license = 6; - v6 := compiler.MapValueForKey(m, "license") - if v6 != nil { - var err error - x.License, err = NewLicense(v6, compiler.NewContext("license", v6, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny vendor_extension = 7; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewItemsItem creates an object of type ItemsItem if possible, returning an error if not. -func NewItemsItem(in *yaml.Node, context *compiler.Context) (*ItemsItem, error) { - errors := make([]error, 0) - x := &ItemsItem{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value for item array: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - x.Schema = make([]*Schema, 0) - y, err := NewSchema(m, compiler.NewContext("", m, context)) - if err != nil { - return nil, err - } - x.Schema = append(x.Schema, y) - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewJsonReference creates an object of type JsonReference if possible, returning an error if not. -func NewJsonReference(in *yaml.Node, context *compiler.Context) (*JsonReference, error) { - errors := make([]error, 0) - x := &JsonReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"$ref"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string _ref = 1; - v1 := compiler.MapValueForKey(m, "$ref") - if v1 != nil { - x.XRef, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 2; - v2 := compiler.MapValueForKey(m, "description") - if v2 != nil { - x.Description, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewLicense creates an object of type License if possible, returning an error if not. -func NewLicense(in *yaml.Node, context *compiler.Context) (*License, error) { - errors := make([]error, 0) - x := &License{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"name"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"name", "url"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string url = 2; - v2 := compiler.MapValueForKey(m, "url") - if v2 != nil { - x.Url, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 3; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedAny creates an object of type NamedAny if possible, returning an error if not. -func NewNamedAny(in *yaml.Node, context *compiler.Context) (*NamedAny, error) { - errors := make([]error, 0) - x := &NamedAny{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewAny(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedHeader creates an object of type NamedHeader if possible, returning an error if not. -func NewNamedHeader(in *yaml.Node, context *compiler.Context) (*NamedHeader, error) { - errors := make([]error, 0) - x := &NamedHeader{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Header value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewHeader(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedParameter creates an object of type NamedParameter if possible, returning an error if not. -func NewNamedParameter(in *yaml.Node, context *compiler.Context) (*NamedParameter, error) { - errors := make([]error, 0) - x := &NamedParameter{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Parameter value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewParameter(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedPathItem creates an object of type NamedPathItem if possible, returning an error if not. -func NewNamedPathItem(in *yaml.Node, context *compiler.Context) (*NamedPathItem, error) { - errors := make([]error, 0) - x := &NamedPathItem{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // PathItem value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewPathItem(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedResponse creates an object of type NamedResponse if possible, returning an error if not. -func NewNamedResponse(in *yaml.Node, context *compiler.Context) (*NamedResponse, error) { - errors := make([]error, 0) - x := &NamedResponse{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Response value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewResponse(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedResponseValue creates an object of type NamedResponseValue if possible, returning an error if not. -func NewNamedResponseValue(in *yaml.Node, context *compiler.Context) (*NamedResponseValue, error) { - errors := make([]error, 0) - x := &NamedResponseValue{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ResponseValue value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewResponseValue(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedSchema creates an object of type NamedSchema if possible, returning an error if not. -func NewNamedSchema(in *yaml.Node, context *compiler.Context) (*NamedSchema, error) { - errors := make([]error, 0) - x := &NamedSchema{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Schema value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewSchema(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedSecurityDefinitionsItem creates an object of type NamedSecurityDefinitionsItem if possible, returning an error if not. -func NewNamedSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*NamedSecurityDefinitionsItem, error) { - errors := make([]error, 0) - x := &NamedSecurityDefinitionsItem{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // SecurityDefinitionsItem value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewSecurityDefinitionsItem(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedString creates an object of type NamedString if possible, returning an error if not. -func NewNamedString(in *yaml.Node, context *compiler.Context) (*NamedString, error) { - errors := make([]error, 0) - x := &NamedString{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - x.Value, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for value: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedStringArray creates an object of type NamedStringArray if possible, returning an error if not. -func NewNamedStringArray(in *yaml.Node, context *compiler.Context) (*NamedStringArray, error) { - errors := make([]error, 0) - x := &NamedStringArray{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // StringArray value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewStringArray(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNonBodyParameter creates an object of type NonBodyParameter if possible, returning an error if not. -func NewNonBodyParameter(in *yaml.Node, context *compiler.Context) (*NonBodyParameter, error) { - errors := make([]error, 0) - x := &NonBodyParameter{} - matched := false - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"in", "name", "type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // HeaderParameterSubSchema header_parameter_sub_schema = 1; - { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewHeaderParameterSubSchema(m, compiler.NewContext("headerParameterSubSchema", m, context)) - if matchingError == nil { - x.Oneof = &NonBodyParameter_HeaderParameterSubSchema{HeaderParameterSubSchema: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - // FormDataParameterSubSchema form_data_parameter_sub_schema = 2; - { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewFormDataParameterSubSchema(m, compiler.NewContext("formDataParameterSubSchema", m, context)) - if matchingError == nil { - x.Oneof = &NonBodyParameter_FormDataParameterSubSchema{FormDataParameterSubSchema: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - // QueryParameterSubSchema query_parameter_sub_schema = 3; - { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewQueryParameterSubSchema(m, compiler.NewContext("queryParameterSubSchema", m, context)) - if matchingError == nil { - x.Oneof = &NonBodyParameter_QueryParameterSubSchema{QueryParameterSubSchema: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - // PathParameterSubSchema path_parameter_sub_schema = 4; - { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewPathParameterSubSchema(m, compiler.NewContext("pathParameterSubSchema", m, context)) - if matchingError == nil { - x.Oneof = &NonBodyParameter_PathParameterSubSchema{PathParameterSubSchema: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid NonBodyParameter") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOauth2AccessCodeSecurity creates an object of type Oauth2AccessCodeSecurity if possible, returning an error if not. -func NewOauth2AccessCodeSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2AccessCodeSecurity, error) { - errors := make([]error, 0) - x := &Oauth2AccessCodeSecurity{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"authorizationUrl", "flow", "tokenUrl", "type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"authorizationUrl", "description", "flow", "scopes", "tokenUrl", "type"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [oauth2] - if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string flow = 2; - v2 := compiler.MapValueForKey(m, "flow") - if v2 != nil { - x.Flow, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [accessCode] - if ok && !compiler.StringArrayContainsValue([]string{"accessCode"}, x.Flow) { - message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Oauth2Scopes scopes = 3; - v3 := compiler.MapValueForKey(m, "scopes") - if v3 != nil { - var err error - x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // string authorization_url = 4; - v4 := compiler.MapValueForKey(m, "authorizationUrl") - if v4 != nil { - x.AuthorizationUrl, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for authorizationUrl: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string token_url = 5; - v5 := compiler.MapValueForKey(m, "tokenUrl") - if v5 != nil { - x.TokenUrl, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 6; - v6 := compiler.MapValueForKey(m, "description") - if v6 != nil { - x.Description, ok = compiler.StringForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 7; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOauth2ApplicationSecurity creates an object of type Oauth2ApplicationSecurity if possible, returning an error if not. -func NewOauth2ApplicationSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2ApplicationSecurity, error) { - errors := make([]error, 0) - x := &Oauth2ApplicationSecurity{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"flow", "tokenUrl", "type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "flow", "scopes", "tokenUrl", "type"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [oauth2] - if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string flow = 2; - v2 := compiler.MapValueForKey(m, "flow") - if v2 != nil { - x.Flow, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [application] - if ok && !compiler.StringArrayContainsValue([]string{"application"}, x.Flow) { - message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Oauth2Scopes scopes = 3; - v3 := compiler.MapValueForKey(m, "scopes") - if v3 != nil { - var err error - x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // string token_url = 4; - v4 := compiler.MapValueForKey(m, "tokenUrl") - if v4 != nil { - x.TokenUrl, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 5; - v5 := compiler.MapValueForKey(m, "description") - if v5 != nil { - x.Description, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 6; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOauth2ImplicitSecurity creates an object of type Oauth2ImplicitSecurity if possible, returning an error if not. -func NewOauth2ImplicitSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2ImplicitSecurity, error) { - errors := make([]error, 0) - x := &Oauth2ImplicitSecurity{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"authorizationUrl", "flow", "type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"authorizationUrl", "description", "flow", "scopes", "type"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [oauth2] - if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string flow = 2; - v2 := compiler.MapValueForKey(m, "flow") - if v2 != nil { - x.Flow, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [implicit] - if ok && !compiler.StringArrayContainsValue([]string{"implicit"}, x.Flow) { - message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Oauth2Scopes scopes = 3; - v3 := compiler.MapValueForKey(m, "scopes") - if v3 != nil { - var err error - x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // string authorization_url = 4; - v4 := compiler.MapValueForKey(m, "authorizationUrl") - if v4 != nil { - x.AuthorizationUrl, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for authorizationUrl: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 5; - v5 := compiler.MapValueForKey(m, "description") - if v5 != nil { - x.Description, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 6; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOauth2PasswordSecurity creates an object of type Oauth2PasswordSecurity if possible, returning an error if not. -func NewOauth2PasswordSecurity(in *yaml.Node, context *compiler.Context) (*Oauth2PasswordSecurity, error) { - errors := make([]error, 0) - x := &Oauth2PasswordSecurity{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"flow", "tokenUrl", "type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "flow", "scopes", "tokenUrl", "type"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [oauth2] - if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string flow = 2; - v2 := compiler.MapValueForKey(m, "flow") - if v2 != nil { - x.Flow, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [password] - if ok && !compiler.StringArrayContainsValue([]string{"password"}, x.Flow) { - message := fmt.Sprintf("has unexpected value for flow: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Oauth2Scopes scopes = 3; - v3 := compiler.MapValueForKey(m, "scopes") - if v3 != nil { - var err error - x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // string token_url = 4; - v4 := compiler.MapValueForKey(m, "tokenUrl") - if v4 != nil { - x.TokenUrl, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 5; - v5 := compiler.MapValueForKey(m, "description") - if v5 != nil { - x.Description, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 6; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOauth2Scopes creates an object of type Oauth2Scopes if possible, returning an error if not. -func NewOauth2Scopes(in *yaml.Node, context *compiler.Context) (*Oauth2Scopes, error) { - errors := make([]error, 0) - x := &Oauth2Scopes{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedString additional_properties = 1; - // MAP: string - x.AdditionalProperties = make([]*NamedString, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedString{} - pair.Name = k - pair.Value, _ = compiler.StringForScalarNode(v) - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOperation creates an object of type Operation if possible, returning an error if not. -func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) { - errors := make([]error, 0) - x := &Operation{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"responses"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"consumes", "deprecated", "description", "externalDocs", "operationId", "parameters", "produces", "responses", "schemes", "security", "summary", "tags"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // repeated string tags = 1; - v1 := compiler.MapValueForKey(m, "tags") - if v1 != nil { - v, ok := compiler.SequenceNodeForNode(v1) - if ok { - x.Tags = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for tags: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string summary = 2; - v2 := compiler.MapValueForKey(m, "summary") - if v2 != nil { - x.Summary, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for summary: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ExternalDocs external_docs = 4; - v4 := compiler.MapValueForKey(m, "externalDocs") - if v4 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v4, compiler.NewContext("externalDocs", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // string operation_id = 5; - v5 := compiler.MapValueForKey(m, "operationId") - if v5 != nil { - x.OperationId, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for operationId: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated string produces = 6; - v6 := compiler.MapValueForKey(m, "produces") - if v6 != nil { - v, ok := compiler.SequenceNodeForNode(v6) - if ok { - x.Produces = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for produces: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated string consumes = 7; - v7 := compiler.MapValueForKey(m, "consumes") - if v7 != nil { - v, ok := compiler.SequenceNodeForNode(v7) - if ok { - x.Consumes = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for consumes: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated ParametersItem parameters = 8; - v8 := compiler.MapValueForKey(m, "parameters") - if v8 != nil { - // repeated ParametersItem - x.Parameters = make([]*ParametersItem, 0) - a, ok := compiler.SequenceNodeForNode(v8) - if ok { - for _, item := range a.Content { - y, err := NewParametersItem(item, compiler.NewContext("parameters", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Parameters = append(x.Parameters, y) - } - } - } - // Responses responses = 9; - v9 := compiler.MapValueForKey(m, "responses") - if v9 != nil { - var err error - x.Responses, err = NewResponses(v9, compiler.NewContext("responses", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated string schemes = 10; - v10 := compiler.MapValueForKey(m, "schemes") - if v10 != nil { - v, ok := compiler.SequenceNodeForNode(v10) - if ok { - x.Schemes = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [http https ws wss] - if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) { - message := fmt.Sprintf("has unexpected value for schemes: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool deprecated = 11; - v11 := compiler.MapValueForKey(m, "deprecated") - if v11 != nil { - x.Deprecated, ok = compiler.BoolForScalarNode(v11) - if !ok { - message := fmt.Sprintf("has unexpected value for deprecated: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated SecurityRequirement security = 12; - v12 := compiler.MapValueForKey(m, "security") - if v12 != nil { - // repeated SecurityRequirement - x.Security = make([]*SecurityRequirement, 0) - a, ok := compiler.SequenceNodeForNode(v12) - if ok { - for _, item := range a.Content { - y, err := NewSecurityRequirement(item, compiler.NewContext("security", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Security = append(x.Security, y) - } - } - } - // repeated NamedAny vendor_extension = 13; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewParameter creates an object of type Parameter if possible, returning an error if not. -func NewParameter(in *yaml.Node, context *compiler.Context) (*Parameter, error) { - errors := make([]error, 0) - x := &Parameter{} - matched := false - // BodyParameter body_parameter = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewBodyParameter(m, compiler.NewContext("bodyParameter", m, context)) - if matchingError == nil { - x.Oneof = &Parameter_BodyParameter{BodyParameter: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // NonBodyParameter non_body_parameter = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewNonBodyParameter(m, compiler.NewContext("nonBodyParameter", m, context)) - if matchingError == nil { - x.Oneof = &Parameter_NonBodyParameter{NonBodyParameter: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid Parameter") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewParameterDefinitions creates an object of type ParameterDefinitions if possible, returning an error if not. -func NewParameterDefinitions(in *yaml.Node, context *compiler.Context) (*ParameterDefinitions, error) { - errors := make([]error, 0) - x := &ParameterDefinitions{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedParameter additional_properties = 1; - // MAP: Parameter - x.AdditionalProperties = make([]*NamedParameter, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedParameter{} - pair.Name = k - var err error - pair.Value, err = NewParameter(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewParametersItem creates an object of type ParametersItem if possible, returning an error if not. -func NewParametersItem(in *yaml.Node, context *compiler.Context) (*ParametersItem, error) { - errors := make([]error, 0) - x := &ParametersItem{} - matched := false - // Parameter parameter = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewParameter(m, compiler.NewContext("parameter", m, context)) - if matchingError == nil { - x.Oneof = &ParametersItem_Parameter{Parameter: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // JsonReference json_reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", m, context)) - if matchingError == nil { - x.Oneof = &ParametersItem_JsonReference{JsonReference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid ParametersItem") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewPathItem creates an object of type PathItem if possible, returning an error if not. -func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { - errors := make([]error, 0) - x := &PathItem{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"$ref", "delete", "get", "head", "options", "parameters", "patch", "post", "put"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string _ref = 1; - v1 := compiler.MapValueForKey(m, "$ref") - if v1 != nil { - x.XRef, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Operation get = 2; - v2 := compiler.MapValueForKey(m, "get") - if v2 != nil { - var err error - x.Get, err = NewOperation(v2, compiler.NewContext("get", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation put = 3; - v3 := compiler.MapValueForKey(m, "put") - if v3 != nil { - var err error - x.Put, err = NewOperation(v3, compiler.NewContext("put", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation post = 4; - v4 := compiler.MapValueForKey(m, "post") - if v4 != nil { - var err error - x.Post, err = NewOperation(v4, compiler.NewContext("post", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation delete = 5; - v5 := compiler.MapValueForKey(m, "delete") - if v5 != nil { - var err error - x.Delete, err = NewOperation(v5, compiler.NewContext("delete", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation options = 6; - v6 := compiler.MapValueForKey(m, "options") - if v6 != nil { - var err error - x.Options, err = NewOperation(v6, compiler.NewContext("options", v6, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation head = 7; - v7 := compiler.MapValueForKey(m, "head") - if v7 != nil { - var err error - x.Head, err = NewOperation(v7, compiler.NewContext("head", v7, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation patch = 8; - v8 := compiler.MapValueForKey(m, "patch") - if v8 != nil { - var err error - x.Patch, err = NewOperation(v8, compiler.NewContext("patch", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated ParametersItem parameters = 9; - v9 := compiler.MapValueForKey(m, "parameters") - if v9 != nil { - // repeated ParametersItem - x.Parameters = make([]*ParametersItem, 0) - a, ok := compiler.SequenceNodeForNode(v9) - if ok { - for _, item := range a.Content { - y, err := NewParametersItem(item, compiler.NewContext("parameters", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Parameters = append(x.Parameters, y) - } - } - } - // repeated NamedAny vendor_extension = 10; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewPathParameterSubSchema creates an object of type PathParameterSubSchema if possible, returning an error if not. -func NewPathParameterSubSchema(in *yaml.Node, context *compiler.Context) (*PathParameterSubSchema, error) { - errors := make([]error, 0) - x := &PathParameterSubSchema{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"required"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // bool required = 1; - v1 := compiler.MapValueForKey(m, "required") - if v1 != nil { - x.Required, ok = compiler.BoolForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string in = 2; - v2 := compiler.MapValueForKey(m, "in") - if v2 != nil { - x.In, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [path] - if ok && !compiler.StringArrayContainsValue([]string{"path"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string name = 4; - v4 := compiler.MapValueForKey(m, "name") - if v4 != nil { - x.Name, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string type = 5; - v5 := compiler.MapValueForKey(m, "type") - if v5 != nil { - x.Type, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [string number boolean integer array] - if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string format = 6; - v6 := compiler.MapValueForKey(m, "format") - if v6 != nil { - x.Format, ok = compiler.StringForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // PrimitivesItems items = 7; - v7 := compiler.MapValueForKey(m, "items") - if v7 != nil { - var err error - x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", v7, context)) - if err != nil { - errors = append(errors, err) - } - } - // string collection_format = 8; - v8 := compiler.MapValueForKey(m, "collectionFormat") - if v8 != nil { - x.CollectionFormat, ok = compiler.StringForScalarNode(v8) - if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [csv ssv tsv pipes] - if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any default = 9; - v9 := compiler.MapValueForKey(m, "default") - if v9 != nil { - var err error - x.Default, err = NewAny(v9, compiler.NewContext("default", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // float maximum = 10; - v10 := compiler.MapValueForKey(m, "maximum") - if v10 != nil { - v, ok := compiler.FloatForScalarNode(v10) - if ok { - x.Maximum = v - } else { - message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_maximum = 11; - v11 := compiler.MapValueForKey(m, "exclusiveMaximum") - if v11 != nil { - x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v11) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float minimum = 12; - v12 := compiler.MapValueForKey(m, "minimum") - if v12 != nil { - v, ok := compiler.FloatForScalarNode(v12) - if ok { - x.Minimum = v - } else { - message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v12)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_minimum = 13; - v13 := compiler.MapValueForKey(m, "exclusiveMinimum") - if v13 != nil { - x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v13) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v13)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_length = 14; - v14 := compiler.MapValueForKey(m, "maxLength") - if v14 != nil { - t, ok := compiler.IntForScalarNode(v14) - if ok { - x.MaxLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v14)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_length = 15; - v15 := compiler.MapValueForKey(m, "minLength") - if v15 != nil { - t, ok := compiler.IntForScalarNode(v15) - if ok { - x.MinLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v15)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string pattern = 16; - v16 := compiler.MapValueForKey(m, "pattern") - if v16 != nil { - x.Pattern, ok = compiler.StringForScalarNode(v16) - if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v16)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_items = 17; - v17 := compiler.MapValueForKey(m, "maxItems") - if v17 != nil { - t, ok := compiler.IntForScalarNode(v17) - if ok { - x.MaxItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v17)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_items = 18; - v18 := compiler.MapValueForKey(m, "minItems") - if v18 != nil { - t, ok := compiler.IntForScalarNode(v18) - if ok { - x.MinItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v18)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool unique_items = 19; - v19 := compiler.MapValueForKey(m, "uniqueItems") - if v19 != nil { - x.UniqueItems, ok = compiler.BoolForScalarNode(v19) - if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v19)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated Any enum = 20; - v20 := compiler.MapValueForKey(m, "enum") - if v20 != nil { - // repeated Any - x.Enum = make([]*Any, 0) - a, ok := compiler.SequenceNodeForNode(v20) - if ok { - for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Enum = append(x.Enum, y) - } - } - } - // float multiple_of = 21; - v21 := compiler.MapValueForKey(m, "multipleOf") - if v21 != nil { - v, ok := compiler.FloatForScalarNode(v21) - if ok { - x.MultipleOf = v - } else { - message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v21)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 22; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewPaths creates an object of type Paths if possible, returning an error if not. -func NewPaths(in *yaml.Node, context *compiler.Context) (*Paths, error) { - errors := make([]error, 0) - x := &Paths{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{} - allowedPatterns := []*regexp.Regexp{pattern0, pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // repeated NamedAny vendor_extension = 1; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - // repeated NamedPathItem path = 2; - // MAP: PathItem ^/ - x.Path = make([]*NamedPathItem, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "/") { - pair := &NamedPathItem{} - pair.Name = k - var err error - pair.Value, err = NewPathItem(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.Path = append(x.Path, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewPrimitivesItems creates an object of type PrimitivesItems if possible, returning an error if not. -func NewPrimitivesItems(in *yaml.Node, context *compiler.Context) (*PrimitivesItems, error) { - errors := make([]error, 0) - x := &PrimitivesItems{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"collectionFormat", "default", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "pattern", "type", "uniqueItems"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [string number integer boolean array] - if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string format = 2; - v2 := compiler.MapValueForKey(m, "format") - if v2 != nil { - x.Format, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // PrimitivesItems items = 3; - v3 := compiler.MapValueForKey(m, "items") - if v3 != nil { - var err error - x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // string collection_format = 4; - v4 := compiler.MapValueForKey(m, "collectionFormat") - if v4 != nil { - x.CollectionFormat, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [csv ssv tsv pipes] - if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any default = 5; - v5 := compiler.MapValueForKey(m, "default") - if v5 != nil { - var err error - x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // float maximum = 6; - v6 := compiler.MapValueForKey(m, "maximum") - if v6 != nil { - v, ok := compiler.FloatForScalarNode(v6) - if ok { - x.Maximum = v - } else { - message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_maximum = 7; - v7 := compiler.MapValueForKey(m, "exclusiveMaximum") - if v7 != nil { - x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v7) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float minimum = 8; - v8 := compiler.MapValueForKey(m, "minimum") - if v8 != nil { - v, ok := compiler.FloatForScalarNode(v8) - if ok { - x.Minimum = v - } else { - message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_minimum = 9; - v9 := compiler.MapValueForKey(m, "exclusiveMinimum") - if v9 != nil { - x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v9) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_length = 10; - v10 := compiler.MapValueForKey(m, "maxLength") - if v10 != nil { - t, ok := compiler.IntForScalarNode(v10) - if ok { - x.MaxLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_length = 11; - v11 := compiler.MapValueForKey(m, "minLength") - if v11 != nil { - t, ok := compiler.IntForScalarNode(v11) - if ok { - x.MinLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string pattern = 12; - v12 := compiler.MapValueForKey(m, "pattern") - if v12 != nil { - x.Pattern, ok = compiler.StringForScalarNode(v12) - if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v12)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_items = 13; - v13 := compiler.MapValueForKey(m, "maxItems") - if v13 != nil { - t, ok := compiler.IntForScalarNode(v13) - if ok { - x.MaxItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v13)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_items = 14; - v14 := compiler.MapValueForKey(m, "minItems") - if v14 != nil { - t, ok := compiler.IntForScalarNode(v14) - if ok { - x.MinItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v14)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool unique_items = 15; - v15 := compiler.MapValueForKey(m, "uniqueItems") - if v15 != nil { - x.UniqueItems, ok = compiler.BoolForScalarNode(v15) - if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v15)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated Any enum = 16; - v16 := compiler.MapValueForKey(m, "enum") - if v16 != nil { - // repeated Any - x.Enum = make([]*Any, 0) - a, ok := compiler.SequenceNodeForNode(v16) - if ok { - for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Enum = append(x.Enum, y) - } - } - } - // float multiple_of = 17; - v17 := compiler.MapValueForKey(m, "multipleOf") - if v17 != nil { - v, ok := compiler.FloatForScalarNode(v17) - if ok { - x.MultipleOf = v - } else { - message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v17)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 18; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewProperties creates an object of type Properties if possible, returning an error if not. -func NewProperties(in *yaml.Node, context *compiler.Context) (*Properties, error) { - errors := make([]error, 0) - x := &Properties{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedSchema additional_properties = 1; - // MAP: Schema - x.AdditionalProperties = make([]*NamedSchema, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedSchema{} - pair.Name = k - var err error - pair.Value, err = NewSchema(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewQueryParameterSubSchema creates an object of type QueryParameterSubSchema if possible, returning an error if not. -func NewQueryParameterSubSchema(in *yaml.Node, context *compiler.Context) (*QueryParameterSubSchema, error) { - errors := make([]error, 0) - x := &QueryParameterSubSchema{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"allowEmptyValue", "collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // bool required = 1; - v1 := compiler.MapValueForKey(m, "required") - if v1 != nil { - x.Required, ok = compiler.BoolForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string in = 2; - v2 := compiler.MapValueForKey(m, "in") - if v2 != nil { - x.In, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [query] - if ok && !compiler.StringArrayContainsValue([]string{"query"}, x.In) { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string name = 4; - v4 := compiler.MapValueForKey(m, "name") - if v4 != nil { - x.Name, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool allow_empty_value = 5; - v5 := compiler.MapValueForKey(m, "allowEmptyValue") - if v5 != nil { - x.AllowEmptyValue, ok = compiler.BoolForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for allowEmptyValue: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string type = 6; - v6 := compiler.MapValueForKey(m, "type") - if v6 != nil { - x.Type, ok = compiler.StringForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [string number boolean integer array] - if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string format = 7; - v7 := compiler.MapValueForKey(m, "format") - if v7 != nil { - x.Format, ok = compiler.StringForScalarNode(v7) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // PrimitivesItems items = 8; - v8 := compiler.MapValueForKey(m, "items") - if v8 != nil { - var err error - x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // string collection_format = 9; - v9 := compiler.MapValueForKey(m, "collectionFormat") - if v9 != nil { - x.CollectionFormat, ok = compiler.StringForScalarNode(v9) - if !ok { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - // check for valid enum values - // [csv ssv tsv pipes multi] - if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) { - message := fmt.Sprintf("has unexpected value for collectionFormat: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any default = 10; - v10 := compiler.MapValueForKey(m, "default") - if v10 != nil { - var err error - x.Default, err = NewAny(v10, compiler.NewContext("default", v10, context)) - if err != nil { - errors = append(errors, err) - } - } - // float maximum = 11; - v11 := compiler.MapValueForKey(m, "maximum") - if v11 != nil { - v, ok := compiler.FloatForScalarNode(v11) - if ok { - x.Maximum = v - } else { - message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_maximum = 12; - v12 := compiler.MapValueForKey(m, "exclusiveMaximum") - if v12 != nil { - x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v12) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v12)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float minimum = 13; - v13 := compiler.MapValueForKey(m, "minimum") - if v13 != nil { - v, ok := compiler.FloatForScalarNode(v13) - if ok { - x.Minimum = v - } else { - message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v13)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_minimum = 14; - v14 := compiler.MapValueForKey(m, "exclusiveMinimum") - if v14 != nil { - x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v14) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v14)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_length = 15; - v15 := compiler.MapValueForKey(m, "maxLength") - if v15 != nil { - t, ok := compiler.IntForScalarNode(v15) - if ok { - x.MaxLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v15)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_length = 16; - v16 := compiler.MapValueForKey(m, "minLength") - if v16 != nil { - t, ok := compiler.IntForScalarNode(v16) - if ok { - x.MinLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v16)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string pattern = 17; - v17 := compiler.MapValueForKey(m, "pattern") - if v17 != nil { - x.Pattern, ok = compiler.StringForScalarNode(v17) - if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v17)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_items = 18; - v18 := compiler.MapValueForKey(m, "maxItems") - if v18 != nil { - t, ok := compiler.IntForScalarNode(v18) - if ok { - x.MaxItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v18)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_items = 19; - v19 := compiler.MapValueForKey(m, "minItems") - if v19 != nil { - t, ok := compiler.IntForScalarNode(v19) - if ok { - x.MinItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v19)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool unique_items = 20; - v20 := compiler.MapValueForKey(m, "uniqueItems") - if v20 != nil { - x.UniqueItems, ok = compiler.BoolForScalarNode(v20) - if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v20)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated Any enum = 21; - v21 := compiler.MapValueForKey(m, "enum") - if v21 != nil { - // repeated Any - x.Enum = make([]*Any, 0) - a, ok := compiler.SequenceNodeForNode(v21) - if ok { - for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Enum = append(x.Enum, y) - } - } - } - // float multiple_of = 22; - v22 := compiler.MapValueForKey(m, "multipleOf") - if v22 != nil { - v, ok := compiler.FloatForScalarNode(v22) - if ok { - x.MultipleOf = v - } else { - message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v22)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 23; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewResponse creates an object of type Response if possible, returning an error if not. -func NewResponse(in *yaml.Node, context *compiler.Context) (*Response, error) { - errors := make([]error, 0) - x := &Response{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"description"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "examples", "headers", "schema"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string description = 1; - v1 := compiler.MapValueForKey(m, "description") - if v1 != nil { - x.Description, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // SchemaItem schema = 2; - v2 := compiler.MapValueForKey(m, "schema") - if v2 != nil { - var err error - x.Schema, err = NewSchemaItem(v2, compiler.NewContext("schema", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // Headers headers = 3; - v3 := compiler.MapValueForKey(m, "headers") - if v3 != nil { - var err error - x.Headers, err = NewHeaders(v3, compiler.NewContext("headers", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // Examples examples = 4; - v4 := compiler.MapValueForKey(m, "examples") - if v4 != nil { - var err error - x.Examples, err = NewExamples(v4, compiler.NewContext("examples", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny vendor_extension = 5; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewResponseDefinitions creates an object of type ResponseDefinitions if possible, returning an error if not. -func NewResponseDefinitions(in *yaml.Node, context *compiler.Context) (*ResponseDefinitions, error) { - errors := make([]error, 0) - x := &ResponseDefinitions{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedResponse additional_properties = 1; - // MAP: Response - x.AdditionalProperties = make([]*NamedResponse, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedResponse{} - pair.Name = k - var err error - pair.Value, err = NewResponse(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewResponseValue creates an object of type ResponseValue if possible, returning an error if not. -func NewResponseValue(in *yaml.Node, context *compiler.Context) (*ResponseValue, error) { - errors := make([]error, 0) - x := &ResponseValue{} - matched := false - // Response response = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewResponse(m, compiler.NewContext("response", m, context)) - if matchingError == nil { - x.Oneof = &ResponseValue_Response{Response: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // JsonReference json_reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", m, context)) - if matchingError == nil { - x.Oneof = &ResponseValue_JsonReference{JsonReference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid ResponseValue") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewResponses creates an object of type Responses if possible, returning an error if not. -func NewResponses(in *yaml.Node, context *compiler.Context) (*Responses, error) { - errors := make([]error, 0) - x := &Responses{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{} - allowedPatterns := []*regexp.Regexp{pattern2, pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // repeated NamedResponseValue response_code = 1; - // MAP: ResponseValue ^([0-9]{3})$|^(default)$ - x.ResponseCode = make([]*NamedResponseValue, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if pattern2.MatchString(k) { - pair := &NamedResponseValue{} - pair.Name = k - var err error - pair.Value, err = NewResponseValue(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.ResponseCode = append(x.ResponseCode, pair) - } - } - } - // repeated NamedAny vendor_extension = 2; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSchema creates an object of type Schema if possible, returning an error if not. -func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { - errors := make([]error, 0) - x := &Schema{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"$ref", "additionalProperties", "allOf", "default", "description", "discriminator", "enum", "example", "exclusiveMaximum", "exclusiveMinimum", "externalDocs", "format", "items", "maxItems", "maxLength", "maxProperties", "maximum", "minItems", "minLength", "minProperties", "minimum", "multipleOf", "pattern", "properties", "readOnly", "required", "title", "type", "uniqueItems", "xml"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string _ref = 1; - v1 := compiler.MapValueForKey(m, "$ref") - if v1 != nil { - x.XRef, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string format = 2; - v2 := compiler.MapValueForKey(m, "format") - if v2 != nil { - x.Format, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string title = 3; - v3 := compiler.MapValueForKey(m, "title") - if v3 != nil { - x.Title, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 4; - v4 := compiler.MapValueForKey(m, "description") - if v4 != nil { - x.Description, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any default = 5; - v5 := compiler.MapValueForKey(m, "default") - if v5 != nil { - var err error - x.Default, err = NewAny(v5, compiler.NewContext("default", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // float multiple_of = 6; - v6 := compiler.MapValueForKey(m, "multipleOf") - if v6 != nil { - v, ok := compiler.FloatForScalarNode(v6) - if ok { - x.MultipleOf = v - } else { - message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float maximum = 7; - v7 := compiler.MapValueForKey(m, "maximum") - if v7 != nil { - v, ok := compiler.FloatForScalarNode(v7) - if ok { - x.Maximum = v - } else { - message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_maximum = 8; - v8 := compiler.MapValueForKey(m, "exclusiveMaximum") - if v8 != nil { - x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v8) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float minimum = 9; - v9 := compiler.MapValueForKey(m, "minimum") - if v9 != nil { - v, ok := compiler.FloatForScalarNode(v9) - if ok { - x.Minimum = v - } else { - message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_minimum = 10; - v10 := compiler.MapValueForKey(m, "exclusiveMinimum") - if v10 != nil { - x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v10) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_length = 11; - v11 := compiler.MapValueForKey(m, "maxLength") - if v11 != nil { - t, ok := compiler.IntForScalarNode(v11) - if ok { - x.MaxLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_length = 12; - v12 := compiler.MapValueForKey(m, "minLength") - if v12 != nil { - t, ok := compiler.IntForScalarNode(v12) - if ok { - x.MinLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v12)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string pattern = 13; - v13 := compiler.MapValueForKey(m, "pattern") - if v13 != nil { - x.Pattern, ok = compiler.StringForScalarNode(v13) - if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v13)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_items = 14; - v14 := compiler.MapValueForKey(m, "maxItems") - if v14 != nil { - t, ok := compiler.IntForScalarNode(v14) - if ok { - x.MaxItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v14)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_items = 15; - v15 := compiler.MapValueForKey(m, "minItems") - if v15 != nil { - t, ok := compiler.IntForScalarNode(v15) - if ok { - x.MinItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v15)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool unique_items = 16; - v16 := compiler.MapValueForKey(m, "uniqueItems") - if v16 != nil { - x.UniqueItems, ok = compiler.BoolForScalarNode(v16) - if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v16)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_properties = 17; - v17 := compiler.MapValueForKey(m, "maxProperties") - if v17 != nil { - t, ok := compiler.IntForScalarNode(v17) - if ok { - x.MaxProperties = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxProperties: %s", compiler.Display(v17)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_properties = 18; - v18 := compiler.MapValueForKey(m, "minProperties") - if v18 != nil { - t, ok := compiler.IntForScalarNode(v18) - if ok { - x.MinProperties = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minProperties: %s", compiler.Display(v18)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated string required = 19; - v19 := compiler.MapValueForKey(m, "required") - if v19 != nil { - v, ok := compiler.SequenceNodeForNode(v19) - if ok { - x.Required = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v19)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated Any enum = 20; - v20 := compiler.MapValueForKey(m, "enum") - if v20 != nil { - // repeated Any - x.Enum = make([]*Any, 0) - a, ok := compiler.SequenceNodeForNode(v20) - if ok { - for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Enum = append(x.Enum, y) - } - } - } - // AdditionalPropertiesItem additional_properties = 21; - v21 := compiler.MapValueForKey(m, "additionalProperties") - if v21 != nil { - var err error - x.AdditionalProperties, err = NewAdditionalPropertiesItem(v21, compiler.NewContext("additionalProperties", v21, context)) - if err != nil { - errors = append(errors, err) - } - } - // TypeItem type = 22; - v22 := compiler.MapValueForKey(m, "type") - if v22 != nil { - var err error - x.Type, err = NewTypeItem(v22, compiler.NewContext("type", v22, context)) - if err != nil { - errors = append(errors, err) - } - } - // ItemsItem items = 23; - v23 := compiler.MapValueForKey(m, "items") - if v23 != nil { - var err error - x.Items, err = NewItemsItem(v23, compiler.NewContext("items", v23, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated Schema all_of = 24; - v24 := compiler.MapValueForKey(m, "allOf") - if v24 != nil { - // repeated Schema - x.AllOf = make([]*Schema, 0) - a, ok := compiler.SequenceNodeForNode(v24) - if ok { - for _, item := range a.Content { - y, err := NewSchema(item, compiler.NewContext("allOf", item, context)) - if err != nil { - errors = append(errors, err) - } - x.AllOf = append(x.AllOf, y) - } - } - } - // Properties properties = 25; - v25 := compiler.MapValueForKey(m, "properties") - if v25 != nil { - var err error - x.Properties, err = NewProperties(v25, compiler.NewContext("properties", v25, context)) - if err != nil { - errors = append(errors, err) - } - } - // string discriminator = 26; - v26 := compiler.MapValueForKey(m, "discriminator") - if v26 != nil { - x.Discriminator, ok = compiler.StringForScalarNode(v26) - if !ok { - message := fmt.Sprintf("has unexpected value for discriminator: %s", compiler.Display(v26)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool read_only = 27; - v27 := compiler.MapValueForKey(m, "readOnly") - if v27 != nil { - x.ReadOnly, ok = compiler.BoolForScalarNode(v27) - if !ok { - message := fmt.Sprintf("has unexpected value for readOnly: %s", compiler.Display(v27)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Xml xml = 28; - v28 := compiler.MapValueForKey(m, "xml") - if v28 != nil { - var err error - x.Xml, err = NewXml(v28, compiler.NewContext("xml", v28, context)) - if err != nil { - errors = append(errors, err) - } - } - // ExternalDocs external_docs = 29; - v29 := compiler.MapValueForKey(m, "externalDocs") - if v29 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v29, compiler.NewContext("externalDocs", v29, context)) - if err != nil { - errors = append(errors, err) - } - } - // Any example = 30; - v30 := compiler.MapValueForKey(m, "example") - if v30 != nil { - var err error - x.Example, err = NewAny(v30, compiler.NewContext("example", v30, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny vendor_extension = 31; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSchemaItem creates an object of type SchemaItem if possible, returning an error if not. -func NewSchemaItem(in *yaml.Node, context *compiler.Context) (*SchemaItem, error) { - errors := make([]error, 0) - x := &SchemaItem{} - matched := false - // Schema schema = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewSchema(m, compiler.NewContext("schema", m, context)) - if matchingError == nil { - x.Oneof = &SchemaItem_Schema{Schema: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // FileSchema file_schema = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewFileSchema(m, compiler.NewContext("fileSchema", m, context)) - if matchingError == nil { - x.Oneof = &SchemaItem_FileSchema{FileSchema: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid SchemaItem") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSecurityDefinitions creates an object of type SecurityDefinitions if possible, returning an error if not. -func NewSecurityDefinitions(in *yaml.Node, context *compiler.Context) (*SecurityDefinitions, error) { - errors := make([]error, 0) - x := &SecurityDefinitions{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedSecurityDefinitionsItem additional_properties = 1; - // MAP: SecurityDefinitionsItem - x.AdditionalProperties = make([]*NamedSecurityDefinitionsItem, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedSecurityDefinitionsItem{} - pair.Name = k - var err error - pair.Value, err = NewSecurityDefinitionsItem(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSecurityDefinitionsItem creates an object of type SecurityDefinitionsItem if possible, returning an error if not. -func NewSecurityDefinitionsItem(in *yaml.Node, context *compiler.Context) (*SecurityDefinitionsItem, error) { - errors := make([]error, 0) - x := &SecurityDefinitionsItem{} - matched := false - // BasicAuthenticationSecurity basic_authentication_security = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewBasicAuthenticationSecurity(m, compiler.NewContext("basicAuthenticationSecurity", m, context)) - if matchingError == nil { - x.Oneof = &SecurityDefinitionsItem_BasicAuthenticationSecurity{BasicAuthenticationSecurity: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // ApiKeySecurity api_key_security = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewApiKeySecurity(m, compiler.NewContext("apiKeySecurity", m, context)) - if matchingError == nil { - x.Oneof = &SecurityDefinitionsItem_ApiKeySecurity{ApiKeySecurity: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Oauth2ImplicitSecurity oauth2_implicit_security = 3; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewOauth2ImplicitSecurity(m, compiler.NewContext("oauth2ImplicitSecurity", m, context)) - if matchingError == nil { - x.Oneof = &SecurityDefinitionsItem_Oauth2ImplicitSecurity{Oauth2ImplicitSecurity: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Oauth2PasswordSecurity oauth2_password_security = 4; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewOauth2PasswordSecurity(m, compiler.NewContext("oauth2PasswordSecurity", m, context)) - if matchingError == nil { - x.Oneof = &SecurityDefinitionsItem_Oauth2PasswordSecurity{Oauth2PasswordSecurity: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Oauth2ApplicationSecurity oauth2_application_security = 5; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewOauth2ApplicationSecurity(m, compiler.NewContext("oauth2ApplicationSecurity", m, context)) - if matchingError == nil { - x.Oneof = &SecurityDefinitionsItem_Oauth2ApplicationSecurity{Oauth2ApplicationSecurity: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Oauth2AccessCodeSecurity oauth2_access_code_security = 6; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewOauth2AccessCodeSecurity(m, compiler.NewContext("oauth2AccessCodeSecurity", m, context)) - if matchingError == nil { - x.Oneof = &SecurityDefinitionsItem_Oauth2AccessCodeSecurity{Oauth2AccessCodeSecurity: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid SecurityDefinitionsItem") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSecurityRequirement creates an object of type SecurityRequirement if possible, returning an error if not. -func NewSecurityRequirement(in *yaml.Node, context *compiler.Context) (*SecurityRequirement, error) { - errors := make([]error, 0) - x := &SecurityRequirement{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedStringArray additional_properties = 1; - // MAP: StringArray - x.AdditionalProperties = make([]*NamedStringArray, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedStringArray{} - pair.Name = k - var err error - pair.Value, err = NewStringArray(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewStringArray creates an object of type StringArray if possible, returning an error if not. -func NewStringArray(in *yaml.Node, context *compiler.Context) (*StringArray, error) { - errors := make([]error, 0) - x := &StringArray{} - x.Value = make([]string, 0) - for _, node := range in.Content { - s, _ := compiler.StringForScalarNode(node) - x.Value = append(x.Value, s) - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewTag creates an object of type Tag if possible, returning an error if not. -func NewTag(in *yaml.Node, context *compiler.Context) (*Tag, error) { - errors := make([]error, 0) - x := &Tag{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"name"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "externalDocs", "name"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 2; - v2 := compiler.MapValueForKey(m, "description") - if v2 != nil { - x.Description, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ExternalDocs external_docs = 3; - v3 := compiler.MapValueForKey(m, "externalDocs") - if v3 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v3, compiler.NewContext("externalDocs", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny vendor_extension = 4; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewTypeItem creates an object of type TypeItem if possible, returning an error if not. -func NewTypeItem(in *yaml.Node, context *compiler.Context) (*TypeItem, error) { - errors := make([]error, 0) - x := &TypeItem{} - v1 := in - switch v1.Kind { - case yaml.ScalarNode: - x.Value = make([]string, 0) - x.Value = append(x.Value, v1.Value) - case yaml.SequenceNode: - x.Value = make([]string, 0) - for _, v := range v1.Content { - value := v.Value - ok := v.Kind == yaml.ScalarNode - if ok { - x.Value = append(x.Value, value) - } else { - message := fmt.Sprintf("has unexpected value for string array element: %+v (%T)", value, value) - errors = append(errors, compiler.NewError(context, message)) - } - } - default: - message := fmt.Sprintf("has unexpected value for string array: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewVendorExtension creates an object of type VendorExtension if possible, returning an error if not. -func NewVendorExtension(in *yaml.Node, context *compiler.Context) (*VendorExtension, error) { - errors := make([]error, 0) - x := &VendorExtension{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedAny additional_properties = 1; - // MAP: Any - x.AdditionalProperties = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewXml creates an object of type Xml if possible, returning an error if not. -func NewXml(in *yaml.Node, context *compiler.Context) (*Xml, error) { - errors := make([]error, 0) - x := &Xml{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"attribute", "name", "namespace", "prefix", "wrapped"} - allowedPatterns := []*regexp.Regexp{pattern0} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string namespace = 2; - v2 := compiler.MapValueForKey(m, "namespace") - if v2 != nil { - x.Namespace, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for namespace: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string prefix = 3; - v3 := compiler.MapValueForKey(m, "prefix") - if v3 != nil { - x.Prefix, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for prefix: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool attribute = 4; - v4 := compiler.MapValueForKey(m, "attribute") - if v4 != nil { - x.Attribute, ok = compiler.BoolForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for attribute: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool wrapped = 5; - v5 := compiler.MapValueForKey(m, "wrapped") - if v5 != nil { - x.Wrapped, ok = compiler.BoolForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for wrapped: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny vendor_extension = 6; - // MAP: Any ^x- - x.VendorExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.VendorExtension = append(x.VendorExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside AdditionalPropertiesItem objects. -func (m *AdditionalPropertiesItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*AdditionalPropertiesItem_Schema) - if ok { - _, err := p.Schema.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Any objects. -func (m *Any) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ApiKeySecurity objects. -func (m *ApiKeySecurity) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside BasicAuthenticationSecurity objects. -func (m *BasicAuthenticationSecurity) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside BodyParameter objects. -func (m *BodyParameter) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Schema != nil { - _, err := m.Schema.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Contact objects. -func (m *Contact) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Default objects. -func (m *Default) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Definitions objects. -func (m *Definitions) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Document objects. -func (m *Document) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Info != nil { - _, err := m.Info.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Paths != nil { - _, err := m.Paths.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Definitions != nil { - _, err := m.Definitions.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Parameters != nil { - _, err := m.Parameters.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Responses != nil { - _, err := m.Responses.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Security { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.SecurityDefinitions != nil { - _, err := m.SecurityDefinitions.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Tags { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Examples objects. -func (m *Examples) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ExternalDocs objects. -func (m *ExternalDocs) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside FileSchema objects. -func (m *FileSchema) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Example != nil { - _, err := m.Example.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside FormDataParameterSubSchema objects. -func (m *FormDataParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Items != nil { - _, err := m.Items.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Enum { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Header objects. -func (m *Header) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Items != nil { - _, err := m.Items.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Enum { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside HeaderParameterSubSchema objects. -func (m *HeaderParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Items != nil { - _, err := m.Items.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Enum { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Headers objects. -func (m *Headers) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Info objects. -func (m *Info) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Contact != nil { - _, err := m.Contact.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.License != nil { - _, err := m.License.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ItemsItem objects. -func (m *ItemsItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.Schema { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside JsonReference objects. -func (m *JsonReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.XRef != "" { - info, err := compiler.ReadInfoForRef(root, m.XRef) - if err != nil { - return nil, err - } - if info != nil { - replacement, err := NewJsonReference(info, nil) - if err == nil { - *m = *replacement - return m.ResolveReferences(root) - } - } - return info, nil - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside License objects. -func (m *License) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedAny objects. -func (m *NamedAny) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedHeader objects. -func (m *NamedHeader) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedParameter objects. -func (m *NamedParameter) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedPathItem objects. -func (m *NamedPathItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedResponse objects. -func (m *NamedResponse) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedResponseValue objects. -func (m *NamedResponseValue) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedSchema objects. -func (m *NamedSchema) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedSecurityDefinitionsItem objects. -func (m *NamedSecurityDefinitionsItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedString objects. -func (m *NamedString) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedStringArray objects. -func (m *NamedStringArray) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NonBodyParameter objects. -func (m *NonBodyParameter) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*NonBodyParameter_HeaderParameterSubSchema) - if ok { - _, err := p.HeaderParameterSubSchema.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*NonBodyParameter_FormDataParameterSubSchema) - if ok { - _, err := p.FormDataParameterSubSchema.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*NonBodyParameter_QueryParameterSubSchema) - if ok { - _, err := p.QueryParameterSubSchema.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*NonBodyParameter_PathParameterSubSchema) - if ok { - _, err := p.PathParameterSubSchema.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Oauth2AccessCodeSecurity objects. -func (m *Oauth2AccessCodeSecurity) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Scopes != nil { - _, err := m.Scopes.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Oauth2ApplicationSecurity objects. -func (m *Oauth2ApplicationSecurity) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Scopes != nil { - _, err := m.Scopes.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Oauth2ImplicitSecurity objects. -func (m *Oauth2ImplicitSecurity) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Scopes != nil { - _, err := m.Scopes.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Oauth2PasswordSecurity objects. -func (m *Oauth2PasswordSecurity) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Scopes != nil { - _, err := m.Scopes.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Oauth2Scopes objects. -func (m *Oauth2Scopes) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Operation objects. -func (m *Operation) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Parameters { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.Responses != nil { - _, err := m.Responses.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Security { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Parameter objects. -func (m *Parameter) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*Parameter_BodyParameter) - if ok { - _, err := p.BodyParameter.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*Parameter_NonBodyParameter) - if ok { - _, err := p.NonBodyParameter.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ParameterDefinitions objects. -func (m *ParameterDefinitions) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ParametersItem objects. -func (m *ParametersItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*ParametersItem_Parameter) - if ok { - _, err := p.Parameter.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*ParametersItem_JsonReference) - if ok { - info, err := p.JsonReference.ResolveReferences(root) - if err != nil { - return nil, err - } else if info != nil { - n, err := NewParametersItem(info, nil) - if err != nil { - return nil, err - } else if n != nil { - *m = *n - return nil, nil - } - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside PathItem objects. -func (m *PathItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.XRef != "" { - info, err := compiler.ReadInfoForRef(root, m.XRef) - if err != nil { - return nil, err - } - if info != nil { - replacement, err := NewPathItem(info, nil) - if err == nil { - *m = *replacement - return m.ResolveReferences(root) - } - } - return info, nil - } - if m.Get != nil { - _, err := m.Get.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Put != nil { - _, err := m.Put.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Post != nil { - _, err := m.Post.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Delete != nil { - _, err := m.Delete.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Options != nil { - _, err := m.Options.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Head != nil { - _, err := m.Head.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Patch != nil { - _, err := m.Patch.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Parameters { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside PathParameterSubSchema objects. -func (m *PathParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Items != nil { - _, err := m.Items.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Enum { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Paths objects. -func (m *Paths) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.Path { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside PrimitivesItems objects. -func (m *PrimitivesItems) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Items != nil { - _, err := m.Items.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Enum { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Properties objects. -func (m *Properties) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside QueryParameterSubSchema objects. -func (m *QueryParameterSubSchema) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Items != nil { - _, err := m.Items.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Enum { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Response objects. -func (m *Response) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Schema != nil { - _, err := m.Schema.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Headers != nil { - _, err := m.Headers.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Examples != nil { - _, err := m.Examples.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ResponseDefinitions objects. -func (m *ResponseDefinitions) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ResponseValue objects. -func (m *ResponseValue) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*ResponseValue_Response) - if ok { - _, err := p.Response.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*ResponseValue_JsonReference) - if ok { - info, err := p.JsonReference.ResolveReferences(root) - if err != nil { - return nil, err - } else if info != nil { - n, err := NewResponseValue(info, nil) - if err != nil { - return nil, err - } else if n != nil { - *m = *n - return nil, nil - } - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Responses objects. -func (m *Responses) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.ResponseCode { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Schema objects. -func (m *Schema) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.XRef != "" { - info, err := compiler.ReadInfoForRef(root, m.XRef) - if err != nil { - return nil, err - } - if info != nil { - replacement, err := NewSchema(info, nil) - if err == nil { - *m = *replacement - return m.ResolveReferences(root) - } - } - return info, nil - } - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Enum { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.AdditionalProperties != nil { - _, err := m.AdditionalProperties.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Type != nil { - _, err := m.Type.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Items != nil { - _, err := m.Items.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.AllOf { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.Properties != nil { - _, err := m.Properties.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Xml != nil { - _, err := m.Xml.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Example != nil { - _, err := m.Example.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SchemaItem objects. -func (m *SchemaItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*SchemaItem_Schema) - if ok { - _, err := p.Schema.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*SchemaItem_FileSchema) - if ok { - _, err := p.FileSchema.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SecurityDefinitions objects. -func (m *SecurityDefinitions) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SecurityDefinitionsItem objects. -func (m *SecurityDefinitionsItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*SecurityDefinitionsItem_BasicAuthenticationSecurity) - if ok { - _, err := p.BasicAuthenticationSecurity.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*SecurityDefinitionsItem_ApiKeySecurity) - if ok { - _, err := p.ApiKeySecurity.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2ImplicitSecurity) - if ok { - _, err := p.Oauth2ImplicitSecurity.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2PasswordSecurity) - if ok { - _, err := p.Oauth2PasswordSecurity.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2ApplicationSecurity) - if ok { - _, err := p.Oauth2ApplicationSecurity.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) - if ok { - _, err := p.Oauth2AccessCodeSecurity.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SecurityRequirement objects. -func (m *SecurityRequirement) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside StringArray objects. -func (m *StringArray) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Tag objects. -func (m *Tag) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside TypeItem objects. -func (m *TypeItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside VendorExtension objects. -func (m *VendorExtension) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Xml objects. -func (m *Xml) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.VendorExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ToRawInfo returns a description of AdditionalPropertiesItem suitable for JSON or YAML export. -func (m *AdditionalPropertiesItem) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // AdditionalPropertiesItem - // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetSchema() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:boolean Type:bool StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - if v1, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { - return compiler.NewScalarNodeForBool(v1.Boolean) - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of Any suitable for JSON or YAML export. -func (m *Any) ToRawInfo() *yaml.Node { - var err error - var node yaml.Node - err = yaml.Unmarshal([]byte(m.Yaml), &node) - if err == nil { - if node.Kind == yaml.DocumentNode { - return node.Content[0] - } - return &node - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of ApiKeySecurity suitable for JSON or YAML export. -func (m *ApiKeySecurity) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of BasicAuthenticationSecurity suitable for JSON or YAML export. -func (m *BasicAuthenticationSecurity) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of BodyParameter suitable for JSON or YAML export. -func (m *BodyParameter) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) - if m.Required != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) - info.Content = append(info.Content, m.Schema.ToRawInfo()) - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Contact suitable for JSON or YAML export. -func (m *Contact) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Url != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) - } - if m.Email != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("email")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Email)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Default suitable for JSON or YAML export. -func (m *Default) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Definitions suitable for JSON or YAML export. -func (m *Definitions) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Document suitable for JSON or YAML export. -func (m *Document) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("swagger")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Swagger)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("info")) - info.Content = append(info.Content, m.Info.ToRawInfo()) - if m.Host != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("host")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Host)) - } - if m.BasePath != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("basePath")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.BasePath)) - } - if len(m.Schemes) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("schemes")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Schemes)) - } - if len(m.Consumes) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("consumes")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Consumes)) - } - if len(m.Produces) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("produces")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Produces)) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("paths")) - info.Content = append(info.Content, m.Paths.ToRawInfo()) - if m.Definitions != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("definitions")) - info.Content = append(info.Content, m.Definitions.ToRawInfo()) - } - if m.Parameters != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) - info.Content = append(info.Content, m.Parameters.ToRawInfo()) - } - if m.Responses != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("responses")) - info.Content = append(info.Content, m.Responses.ToRawInfo()) - } - if len(m.Security) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Security { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("security")) - info.Content = append(info.Content, items) - } - if m.SecurityDefinitions != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("securityDefinitions")) - info.Content = append(info.Content, m.SecurityDefinitions.ToRawInfo()) - } - if len(m.Tags) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Tags { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("tags")) - info.Content = append(info.Content, items) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Examples suitable for JSON or YAML export. -func (m *Examples) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ExternalDocs suitable for JSON or YAML export. -func (m *ExternalDocs) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of FileSchema suitable for JSON or YAML export. -func (m *FileSchema) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.Title != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if len(m.Required) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Required)) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - if m.ReadOnly != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("readOnly")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ReadOnly)) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.Example != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) - info.Content = append(info.Content, m.Example.ToRawInfo()) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of FormDataParameterSubSchema suitable for JSON or YAML export. -func (m *FormDataParameterSubSchema) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Required != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) - } - if m.In != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.AllowEmptyValue != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("allowEmptyValue")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowEmptyValue)) - } - if m.Type != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - } - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.Items != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) - info.Content = append(info.Content, m.Items.ToRawInfo()) - } - if m.CollectionFormat != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.Maximum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) - } - if m.ExclusiveMaximum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) - } - if m.Minimum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) - } - if m.ExclusiveMinimum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) - } - if m.MaxLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) - } - if m.MinLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) - } - if m.Pattern != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) - } - if m.MaxItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) - } - if m.MinItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) - } - if m.UniqueItems != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) - } - if len(m.Enum) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Enum { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, items) - } - if m.MultipleOf != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Header suitable for JSON or YAML export. -func (m *Header) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.Items != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) - info.Content = append(info.Content, m.Items.ToRawInfo()) - } - if m.CollectionFormat != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.Maximum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) - } - if m.ExclusiveMaximum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) - } - if m.Minimum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) - } - if m.ExclusiveMinimum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) - } - if m.MaxLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) - } - if m.MinLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) - } - if m.Pattern != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) - } - if m.MaxItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) - } - if m.MinItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) - } - if m.UniqueItems != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) - } - if len(m.Enum) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Enum { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, items) - } - if m.MultipleOf != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of HeaderParameterSubSchema suitable for JSON or YAML export. -func (m *HeaderParameterSubSchema) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Required != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) - } - if m.In != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Type != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - } - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.Items != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) - info.Content = append(info.Content, m.Items.ToRawInfo()) - } - if m.CollectionFormat != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.Maximum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) - } - if m.ExclusiveMaximum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) - } - if m.Minimum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) - } - if m.ExclusiveMinimum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) - } - if m.MaxLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) - } - if m.MinLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) - } - if m.Pattern != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) - } - if m.MaxItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) - } - if m.MinItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) - } - if m.UniqueItems != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) - } - if len(m.Enum) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Enum { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, items) - } - if m.MultipleOf != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Headers suitable for JSON or YAML export. -func (m *Headers) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Info suitable for JSON or YAML export. -func (m *Info) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("version")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Version)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.TermsOfService != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("termsOfService")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TermsOfService)) - } - if m.Contact != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("contact")) - info.Content = append(info.Content, m.Contact.ToRawInfo()) - } - if m.License != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("license")) - info.Content = append(info.Content, m.License.ToRawInfo()) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ItemsItem suitable for JSON or YAML export. -func (m *ItemsItem) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if len(m.Schema) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Schema { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) - info.Content = append(info.Content, items) - } - return info -} - -// ToRawInfo returns a description of JsonReference suitable for JSON or YAML export. -func (m *JsonReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - return info -} - -// ToRawInfo returns a description of License suitable for JSON or YAML export. -func (m *License) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - if m.Url != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of NamedAny suitable for JSON or YAML export. -func (m *NamedAny) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Value != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) - info.Content = append(info.Content, m.Value.ToRawInfo()) - } - return info -} - -// ToRawInfo returns a description of NamedHeader suitable for JSON or YAML export. -func (m *NamedHeader) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:Header StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedParameter suitable for JSON or YAML export. -func (m *NamedParameter) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedPathItem suitable for JSON or YAML export. -func (m *NamedPathItem) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:PathItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedResponse suitable for JSON or YAML export. -func (m *NamedResponse) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedResponseValue suitable for JSON or YAML export. -func (m *NamedResponseValue) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:ResponseValue StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedSchema suitable for JSON or YAML export. -func (m *NamedSchema) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedSecurityDefinitionsItem suitable for JSON or YAML export. -func (m *NamedSecurityDefinitionsItem) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:SecurityDefinitionsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedString suitable for JSON or YAML export. -func (m *NamedString) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Value != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Value)) - } - return info -} - -// ToRawInfo returns a description of NamedStringArray suitable for JSON or YAML export. -func (m *NamedStringArray) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:StringArray StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NonBodyParameter suitable for JSON or YAML export. -func (m *NonBodyParameter) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // NonBodyParameter - // {Name:headerParameterSubSchema Type:HeaderParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetHeaderParameterSubSchema() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:formDataParameterSubSchema Type:FormDataParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetFormDataParameterSubSchema() - if v1 != nil { - return v1.ToRawInfo() - } - // {Name:queryParameterSubSchema Type:QueryParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v2 := m.GetQueryParameterSubSchema() - if v2 != nil { - return v2.ToRawInfo() - } - // {Name:pathParameterSubSchema Type:PathParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v3 := m.GetPathParameterSubSchema() - if v3 != nil { - return v3.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of Oauth2AccessCodeSecurity suitable for JSON or YAML export. -func (m *Oauth2AccessCodeSecurity) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) - if m.Scopes != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) - info.Content = append(info.Content, m.Scopes.ToRawInfo()) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("authorizationUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.AuthorizationUrl)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Oauth2ApplicationSecurity suitable for JSON or YAML export. -func (m *Oauth2ApplicationSecurity) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) - if m.Scopes != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) - info.Content = append(info.Content, m.Scopes.ToRawInfo()) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Oauth2ImplicitSecurity suitable for JSON or YAML export. -func (m *Oauth2ImplicitSecurity) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) - if m.Scopes != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) - info.Content = append(info.Content, m.Scopes.ToRawInfo()) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("authorizationUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.AuthorizationUrl)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Oauth2PasswordSecurity suitable for JSON or YAML export. -func (m *Oauth2PasswordSecurity) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("flow")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Flow)) - if m.Scopes != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) - info.Content = append(info.Content, m.Scopes.ToRawInfo()) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Oauth2Scopes suitable for JSON or YAML export. -func (m *Oauth2Scopes) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:} - return info -} - -// ToRawInfo returns a description of Operation suitable for JSON or YAML export. -func (m *Operation) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if len(m.Tags) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("tags")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Tags)) - } - if m.Summary != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("summary")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Summary)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.OperationId != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("operationId")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.OperationId)) - } - if len(m.Produces) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("produces")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Produces)) - } - if len(m.Consumes) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("consumes")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Consumes)) - } - if len(m.Parameters) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Parameters { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) - info.Content = append(info.Content, items) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("responses")) - info.Content = append(info.Content, m.Responses.ToRawInfo()) - if len(m.Schemes) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("schemes")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Schemes)) - } - if m.Deprecated != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("deprecated")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Deprecated)) - } - if len(m.Security) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Security { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("security")) - info.Content = append(info.Content, items) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Parameter suitable for JSON or YAML export. -func (m *Parameter) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // Parameter - // {Name:bodyParameter Type:BodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetBodyParameter() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:nonBodyParameter Type:NonBodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetNonBodyParameter() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of ParameterDefinitions suitable for JSON or YAML export. -func (m *ParameterDefinitions) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ParametersItem suitable for JSON or YAML export. -func (m *ParametersItem) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // ParametersItem - // {Name:parameter Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetParameter() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:jsonReference Type:JsonReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetJsonReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of PathItem suitable for JSON or YAML export. -func (m *PathItem) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.XRef != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) - } - if m.Get != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("get")) - info.Content = append(info.Content, m.Get.ToRawInfo()) - } - if m.Put != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("put")) - info.Content = append(info.Content, m.Put.ToRawInfo()) - } - if m.Post != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("post")) - info.Content = append(info.Content, m.Post.ToRawInfo()) - } - if m.Delete != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("delete")) - info.Content = append(info.Content, m.Delete.ToRawInfo()) - } - if m.Options != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("options")) - info.Content = append(info.Content, m.Options.ToRawInfo()) - } - if m.Head != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("head")) - info.Content = append(info.Content, m.Head.ToRawInfo()) - } - if m.Patch != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("patch")) - info.Content = append(info.Content, m.Patch.ToRawInfo()) - } - if len(m.Parameters) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Parameters { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) - info.Content = append(info.Content, items) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of PathParameterSubSchema suitable for JSON or YAML export. -func (m *PathParameterSubSchema) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) - if m.In != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Type != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - } - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.Items != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) - info.Content = append(info.Content, m.Items.ToRawInfo()) - } - if m.CollectionFormat != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.Maximum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) - } - if m.ExclusiveMaximum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) - } - if m.Minimum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) - } - if m.ExclusiveMinimum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) - } - if m.MaxLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) - } - if m.MinLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) - } - if m.Pattern != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) - } - if m.MaxItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) - } - if m.MinItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) - } - if m.UniqueItems != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) - } - if len(m.Enum) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Enum { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, items) - } - if m.MultipleOf != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Paths suitable for JSON or YAML export. -func (m *Paths) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - if m.Path != nil { - for _, item := range m.Path { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of PrimitivesItems suitable for JSON or YAML export. -func (m *PrimitivesItems) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Type != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - } - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.Items != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) - info.Content = append(info.Content, m.Items.ToRawInfo()) - } - if m.CollectionFormat != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.Maximum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) - } - if m.ExclusiveMaximum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) - } - if m.Minimum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) - } - if m.ExclusiveMinimum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) - } - if m.MaxLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) - } - if m.MinLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) - } - if m.Pattern != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) - } - if m.MaxItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) - } - if m.MinItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) - } - if m.UniqueItems != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) - } - if len(m.Enum) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Enum { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, items) - } - if m.MultipleOf != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Properties suitable for JSON or YAML export. -func (m *Properties) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of QueryParameterSubSchema suitable for JSON or YAML export. -func (m *QueryParameterSubSchema) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Required != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) - } - if m.In != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.AllowEmptyValue != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("allowEmptyValue")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowEmptyValue)) - } - if m.Type != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - } - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.Items != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) - info.Content = append(info.Content, m.Items.ToRawInfo()) - } - if m.CollectionFormat != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("collectionFormat")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.CollectionFormat)) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.Maximum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) - } - if m.ExclusiveMaximum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) - } - if m.Minimum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) - } - if m.ExclusiveMinimum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) - } - if m.MaxLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) - } - if m.MinLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) - } - if m.Pattern != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) - } - if m.MaxItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) - } - if m.MinItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) - } - if m.UniqueItems != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) - } - if len(m.Enum) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Enum { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, items) - } - if m.MultipleOf != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Response suitable for JSON or YAML export. -func (m *Response) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - if m.Schema != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) - info.Content = append(info.Content, m.Schema.ToRawInfo()) - } - if m.Headers != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("headers")) - info.Content = append(info.Content, m.Headers.ToRawInfo()) - } - if m.Examples != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("examples")) - info.Content = append(info.Content, m.Examples.ToRawInfo()) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ResponseDefinitions suitable for JSON or YAML export. -func (m *ResponseDefinitions) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ResponseValue suitable for JSON or YAML export. -func (m *ResponseValue) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // ResponseValue - // {Name:response Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetResponse() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:jsonReference Type:JsonReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetJsonReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of Responses suitable for JSON or YAML export. -func (m *Responses) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.ResponseCode != nil { - for _, item := range m.ResponseCode { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Schema suitable for JSON or YAML export. -func (m *Schema) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.XRef != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) - } - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.Title != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.MultipleOf != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) - } - if m.Maximum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) - } - if m.ExclusiveMaximum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) - } - if m.Minimum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) - } - if m.ExclusiveMinimum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) - } - if m.MaxLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) - } - if m.MinLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) - } - if m.Pattern != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) - } - if m.MaxItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) - } - if m.MinItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) - } - if m.UniqueItems != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) - } - if m.MaxProperties != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxProperties")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxProperties)) - } - if m.MinProperties != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minProperties")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinProperties)) - } - if len(m.Required) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Required)) - } - if len(m.Enum) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Enum { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, items) - } - if m.AdditionalProperties != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("additionalProperties")) - info.Content = append(info.Content, m.AdditionalProperties.ToRawInfo()) - } - if m.Type != nil { - if len(m.Type.Value) == 1 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type.Value[0])) - } else { - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Type.Value)) - } - } - if m.Items != nil { - items := compiler.NewSequenceNode() - for _, item := range m.Items.Schema { - items.Content = append(items.Content, item.ToRawInfo()) - } - if len(items.Content) == 1 { - items = items.Content[0] - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) - info.Content = append(info.Content, items) - } - if len(m.AllOf) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.AllOf { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("allOf")) - info.Content = append(info.Content, items) - } - if m.Properties != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("properties")) - info.Content = append(info.Content, m.Properties.ToRawInfo()) - } - if m.Discriminator != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("discriminator")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Discriminator)) - } - if m.ReadOnly != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("readOnly")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ReadOnly)) - } - if m.Xml != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("xml")) - info.Content = append(info.Content, m.Xml.ToRawInfo()) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.Example != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) - info.Content = append(info.Content, m.Example.ToRawInfo()) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of SchemaItem suitable for JSON or YAML export. -func (m *SchemaItem) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // SchemaItem - // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetSchema() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:fileSchema Type:FileSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetFileSchema() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of SecurityDefinitions suitable for JSON or YAML export. -func (m *SecurityDefinitions) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of SecurityDefinitionsItem suitable for JSON or YAML export. -func (m *SecurityDefinitionsItem) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // SecurityDefinitionsItem - // {Name:basicAuthenticationSecurity Type:BasicAuthenticationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetBasicAuthenticationSecurity() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:apiKeySecurity Type:ApiKeySecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetApiKeySecurity() - if v1 != nil { - return v1.ToRawInfo() - } - // {Name:oauth2ImplicitSecurity Type:Oauth2ImplicitSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v2 := m.GetOauth2ImplicitSecurity() - if v2 != nil { - return v2.ToRawInfo() - } - // {Name:oauth2PasswordSecurity Type:Oauth2PasswordSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v3 := m.GetOauth2PasswordSecurity() - if v3 != nil { - return v3.ToRawInfo() - } - // {Name:oauth2ApplicationSecurity Type:Oauth2ApplicationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v4 := m.GetOauth2ApplicationSecurity() - if v4 != nil { - return v4.ToRawInfo() - } - // {Name:oauth2AccessCodeSecurity Type:Oauth2AccessCodeSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v5 := m.GetOauth2AccessCodeSecurity() - if v5 != nil { - return v5.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of SecurityRequirement suitable for JSON or YAML export. -func (m *SecurityRequirement) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of StringArray suitable for JSON or YAML export. -func (m *StringArray) ToRawInfo() *yaml.Node { - return compiler.NewSequenceNodeForStringArray(m.Value) -} - -// ToRawInfo returns a description of Tag suitable for JSON or YAML export. -func (m *Tag) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of TypeItem suitable for JSON or YAML export. -func (m *TypeItem) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if len(m.Value) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Value)) - } - return info -} - -// ToRawInfo returns a description of VendorExtension suitable for JSON or YAML export. -func (m *VendorExtension) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Xml suitable for JSON or YAML export. -func (m *Xml) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Namespace != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("namespace")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Namespace)) - } - if m.Prefix != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("prefix")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Prefix)) - } - if m.Attribute != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("attribute")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Attribute)) - } - if m.Wrapped != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("wrapped")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Wrapped)) - } - if m.VendorExtension != nil { - for _, item := range m.VendorExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -var ( - pattern0 = regexp.MustCompile("^x-") - pattern1 = regexp.MustCompile("^/") - pattern2 = regexp.MustCompile("^([0-9]{3})$|^(default)$") -) diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.pb.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.pb.go deleted file mode 100644 index 65c4c913ce70..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.pb.go +++ /dev/null @@ -1,7342 +0,0 @@ -// Copyright 2020 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// THIS FILE IS AUTOMATICALLY GENERATED. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.19.3 -// source: openapiv2/OpenAPIv2.proto - -package openapi_v2 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - reflect "reflect" - sync "sync" -) - -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) -) - -type AdditionalPropertiesItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *AdditionalPropertiesItem_Schema - // *AdditionalPropertiesItem_Boolean - Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"` -} - -func (x *AdditionalPropertiesItem) Reset() { - *x = AdditionalPropertiesItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AdditionalPropertiesItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdditionalPropertiesItem) ProtoMessage() {} - -func (x *AdditionalPropertiesItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AdditionalPropertiesItem.ProtoReflect.Descriptor instead. -func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{0} -} - -func (m *AdditionalPropertiesItem) GetOneof() isAdditionalPropertiesItem_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *AdditionalPropertiesItem) GetSchema() *Schema { - if x, ok := x.GetOneof().(*AdditionalPropertiesItem_Schema); ok { - return x.Schema - } - return nil -} - -func (x *AdditionalPropertiesItem) GetBoolean() bool { - if x, ok := x.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { - return x.Boolean - } - return false -} - -type isAdditionalPropertiesItem_Oneof interface { - isAdditionalPropertiesItem_Oneof() -} - -type AdditionalPropertiesItem_Schema struct { - Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` -} - -type AdditionalPropertiesItem_Boolean struct { - Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"` -} - -func (*AdditionalPropertiesItem_Schema) isAdditionalPropertiesItem_Oneof() {} - -func (*AdditionalPropertiesItem_Boolean) isAdditionalPropertiesItem_Oneof() {} - -type Any struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *anypb.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` -} - -func (x *Any) Reset() { - *x = Any{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Any) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Any) ProtoMessage() {} - -func (x *Any) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Any.ProtoReflect.Descriptor instead. -func (*Any) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{1} -} - -func (x *Any) GetValue() *anypb.Any { - if x != nil { - return x.Value - } - return nil -} - -func (x *Any) GetYaml() string { - if x != nil { - return x.Yaml - } - return "" -} - -type ApiKeySecurity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *ApiKeySecurity) Reset() { - *x = ApiKeySecurity{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ApiKeySecurity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApiKeySecurity) ProtoMessage() {} - -func (x *ApiKeySecurity) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ApiKeySecurity.ProtoReflect.Descriptor instead. -func (*ApiKeySecurity) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{2} -} - -func (x *ApiKeySecurity) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *ApiKeySecurity) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ApiKeySecurity) GetIn() string { - if x != nil { - return x.In - } - return "" -} - -func (x *ApiKeySecurity) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ApiKeySecurity) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type BasicAuthenticationSecurity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *BasicAuthenticationSecurity) Reset() { - *x = BasicAuthenticationSecurity{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BasicAuthenticationSecurity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BasicAuthenticationSecurity) ProtoMessage() {} - -func (x *BasicAuthenticationSecurity) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BasicAuthenticationSecurity.ProtoReflect.Descriptor instead. -func (*BasicAuthenticationSecurity) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{3} -} - -func (x *BasicAuthenticationSecurity) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *BasicAuthenticationSecurity) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *BasicAuthenticationSecurity) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type BodyParameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - // The name of the parameter. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Determines the location of the parameter. - In string `protobuf:"bytes,3,opt,name=in,proto3" json:"in,omitempty"` - // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` - Schema *Schema `protobuf:"bytes,5,opt,name=schema,proto3" json:"schema,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *BodyParameter) Reset() { - *x = BodyParameter{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BodyParameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BodyParameter) ProtoMessage() {} - -func (x *BodyParameter) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BodyParameter.ProtoReflect.Descriptor instead. -func (*BodyParameter) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{4} -} - -func (x *BodyParameter) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *BodyParameter) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *BodyParameter) GetIn() string { - if x != nil { - return x.In - } - return "" -} - -func (x *BodyParameter) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *BodyParameter) GetSchema() *Schema { - if x != nil { - return x.Schema - } - return nil -} - -func (x *BodyParameter) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -// Contact information for the owners of the API. -type Contact struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The identifying name of the contact person/organization. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The URL pointing to the contact information. - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - // The email address of the contact person/organization. - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Contact) Reset() { - *x = Contact{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Contact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Contact) ProtoMessage() {} - -func (x *Contact) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Contact.ProtoReflect.Descriptor instead. -func (*Contact) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{5} -} - -func (x *Contact) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Contact) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *Contact) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *Contact) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Default struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Default) Reset() { - *x = Default{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Default) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Default) ProtoMessage() {} - -func (x *Default) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Default.ProtoReflect.Descriptor instead. -func (*Default) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{6} -} - -func (x *Default) GetAdditionalProperties() []*NamedAny { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// One or more JSON objects describing the schemas being consumed and produced by the API. -type Definitions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Definitions) Reset() { - *x = Definitions{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Definitions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Definitions) ProtoMessage() {} - -func (x *Definitions) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Definitions.ProtoReflect.Descriptor instead. -func (*Definitions) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{7} -} - -func (x *Definitions) GetAdditionalProperties() []*NamedSchema { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type Document struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The Swagger version of this document. - Swagger string `protobuf:"bytes,1,opt,name=swagger,proto3" json:"swagger,omitempty"` - Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` - // The host (name or ip) of the API. Example: 'swagger.io' - Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` - // The base path to the API. Example: '/api'. - BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` - // The transfer protocol of the API. - Schemes []string `protobuf:"bytes,5,rep,name=schemes,proto3" json:"schemes,omitempty"` - // A list of MIME types accepted by the API. - Consumes []string `protobuf:"bytes,6,rep,name=consumes,proto3" json:"consumes,omitempty"` - // A list of MIME types the API can produce. - Produces []string `protobuf:"bytes,7,rep,name=produces,proto3" json:"produces,omitempty"` - Paths *Paths `protobuf:"bytes,8,opt,name=paths,proto3" json:"paths,omitempty"` - Definitions *Definitions `protobuf:"bytes,9,opt,name=definitions,proto3" json:"definitions,omitempty"` - Parameters *ParameterDefinitions `protobuf:"bytes,10,opt,name=parameters,proto3" json:"parameters,omitempty"` - Responses *ResponseDefinitions `protobuf:"bytes,11,opt,name=responses,proto3" json:"responses,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` - SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,13,opt,name=security_definitions,json=securityDefinitions,proto3" json:"security_definitions,omitempty"` - Tags []*Tag `protobuf:"bytes,14,rep,name=tags,proto3" json:"tags,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,15,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,16,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Document) Reset() { - *x = Document{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Document) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Document) ProtoMessage() {} - -func (x *Document) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Document.ProtoReflect.Descriptor instead. -func (*Document) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{8} -} - -func (x *Document) GetSwagger() string { - if x != nil { - return x.Swagger - } - return "" -} - -func (x *Document) GetInfo() *Info { - if x != nil { - return x.Info - } - return nil -} - -func (x *Document) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *Document) GetBasePath() string { - if x != nil { - return x.BasePath - } - return "" -} - -func (x *Document) GetSchemes() []string { - if x != nil { - return x.Schemes - } - return nil -} - -func (x *Document) GetConsumes() []string { - if x != nil { - return x.Consumes - } - return nil -} - -func (x *Document) GetProduces() []string { - if x != nil { - return x.Produces - } - return nil -} - -func (x *Document) GetPaths() *Paths { - if x != nil { - return x.Paths - } - return nil -} - -func (x *Document) GetDefinitions() *Definitions { - if x != nil { - return x.Definitions - } - return nil -} - -func (x *Document) GetParameters() *ParameterDefinitions { - if x != nil { - return x.Parameters - } - return nil -} - -func (x *Document) GetResponses() *ResponseDefinitions { - if x != nil { - return x.Responses - } - return nil -} - -func (x *Document) GetSecurity() []*SecurityRequirement { - if x != nil { - return x.Security - } - return nil -} - -func (x *Document) GetSecurityDefinitions() *SecurityDefinitions { - if x != nil { - return x.SecurityDefinitions - } - return nil -} - -func (x *Document) GetTags() []*Tag { - if x != nil { - return x.Tags - } - return nil -} - -func (x *Document) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *Document) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Examples struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Examples) Reset() { - *x = Examples{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Examples) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Examples) ProtoMessage() {} - -func (x *Examples) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Examples.ProtoReflect.Descriptor instead. -func (*Examples) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{9} -} - -func (x *Examples) GetAdditionalProperties() []*NamedAny { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// information about external documentation -type ExternalDocs struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *ExternalDocs) Reset() { - *x = ExternalDocs{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExternalDocs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExternalDocs) ProtoMessage() {} - -func (x *ExternalDocs) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExternalDocs.ProtoReflect.Descriptor instead. -func (*ExternalDocs) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{10} -} - -func (x *ExternalDocs) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ExternalDocs) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *ExternalDocs) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -// A deterministic version of a JSON Schema object. -type FileSchema struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Format string `protobuf:"bytes,1,opt,name=format,proto3" json:"format,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Default *Any `protobuf:"bytes,4,opt,name=default,proto3" json:"default,omitempty"` - Required []string `protobuf:"bytes,5,rep,name=required,proto3" json:"required,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - Example *Any `protobuf:"bytes,9,opt,name=example,proto3" json:"example,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *FileSchema) Reset() { - *x = FileSchema{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FileSchema) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileSchema) ProtoMessage() {} - -func (x *FileSchema) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileSchema.ProtoReflect.Descriptor instead. -func (*FileSchema) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{11} -} - -func (x *FileSchema) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *FileSchema) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *FileSchema) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *FileSchema) GetDefault() *Any { - if x != nil { - return x.Default - } - return nil -} - -func (x *FileSchema) GetRequired() []string { - if x != nil { - return x.Required - } - return nil -} - -func (x *FileSchema) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *FileSchema) GetReadOnly() bool { - if x != nil { - return x.ReadOnly - } - return false -} - -func (x *FileSchema) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *FileSchema) GetExample() *Any { - if x != nil { - return x.Example - } - return nil -} - -func (x *FileSchema) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type FormDataParameterSubSchema struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` - // Determines the location of the parameter. - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // allows sending a parameter by name only or with an empty value. - AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *FormDataParameterSubSchema) Reset() { - *x = FormDataParameterSubSchema{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FormDataParameterSubSchema) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FormDataParameterSubSchema) ProtoMessage() {} - -func (x *FormDataParameterSubSchema) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FormDataParameterSubSchema.ProtoReflect.Descriptor instead. -func (*FormDataParameterSubSchema) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{12} -} - -func (x *FormDataParameterSubSchema) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *FormDataParameterSubSchema) GetIn() string { - if x != nil { - return x.In - } - return "" -} - -func (x *FormDataParameterSubSchema) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *FormDataParameterSubSchema) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *FormDataParameterSubSchema) GetAllowEmptyValue() bool { - if x != nil { - return x.AllowEmptyValue - } - return false -} - -func (x *FormDataParameterSubSchema) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *FormDataParameterSubSchema) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *FormDataParameterSubSchema) GetItems() *PrimitivesItems { - if x != nil { - return x.Items - } - return nil -} - -func (x *FormDataParameterSubSchema) GetCollectionFormat() string { - if x != nil { - return x.CollectionFormat - } - return "" -} - -func (x *FormDataParameterSubSchema) GetDefault() *Any { - if x != nil { - return x.Default - } - return nil -} - -func (x *FormDataParameterSubSchema) GetMaximum() float64 { - if x != nil { - return x.Maximum - } - return 0 -} - -func (x *FormDataParameterSubSchema) GetExclusiveMaximum() bool { - if x != nil { - return x.ExclusiveMaximum - } - return false -} - -func (x *FormDataParameterSubSchema) GetMinimum() float64 { - if x != nil { - return x.Minimum - } - return 0 -} - -func (x *FormDataParameterSubSchema) GetExclusiveMinimum() bool { - if x != nil { - return x.ExclusiveMinimum - } - return false -} - -func (x *FormDataParameterSubSchema) GetMaxLength() int64 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *FormDataParameterSubSchema) GetMinLength() int64 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *FormDataParameterSubSchema) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *FormDataParameterSubSchema) GetMaxItems() int64 { - if x != nil { - return x.MaxItems - } - return 0 -} - -func (x *FormDataParameterSubSchema) GetMinItems() int64 { - if x != nil { - return x.MinItems - } - return 0 -} - -func (x *FormDataParameterSubSchema) GetUniqueItems() bool { - if x != nil { - return x.UniqueItems - } - return false -} - -func (x *FormDataParameterSubSchema) GetEnum() []*Any { - if x != nil { - return x.Enum - } - return nil -} - -func (x *FormDataParameterSubSchema) GetMultipleOf() float64 { - if x != nil { - return x.MultipleOf - } - return 0 -} - -func (x *FormDataParameterSubSchema) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Header struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - Description string `protobuf:"bytes,18,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,19,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Header) Reset() { - *x = Header{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Header) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Header) ProtoMessage() {} - -func (x *Header) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Header.ProtoReflect.Descriptor instead. -func (*Header) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{13} -} - -func (x *Header) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Header) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *Header) GetItems() *PrimitivesItems { - if x != nil { - return x.Items - } - return nil -} - -func (x *Header) GetCollectionFormat() string { - if x != nil { - return x.CollectionFormat - } - return "" -} - -func (x *Header) GetDefault() *Any { - if x != nil { - return x.Default - } - return nil -} - -func (x *Header) GetMaximum() float64 { - if x != nil { - return x.Maximum - } - return 0 -} - -func (x *Header) GetExclusiveMaximum() bool { - if x != nil { - return x.ExclusiveMaximum - } - return false -} - -func (x *Header) GetMinimum() float64 { - if x != nil { - return x.Minimum - } - return 0 -} - -func (x *Header) GetExclusiveMinimum() bool { - if x != nil { - return x.ExclusiveMinimum - } - return false -} - -func (x *Header) GetMaxLength() int64 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *Header) GetMinLength() int64 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *Header) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *Header) GetMaxItems() int64 { - if x != nil { - return x.MaxItems - } - return 0 -} - -func (x *Header) GetMinItems() int64 { - if x != nil { - return x.MinItems - } - return 0 -} - -func (x *Header) GetUniqueItems() bool { - if x != nil { - return x.UniqueItems - } - return false -} - -func (x *Header) GetEnum() []*Any { - if x != nil { - return x.Enum - } - return nil -} - -func (x *Header) GetMultipleOf() float64 { - if x != nil { - return x.MultipleOf - } - return 0 -} - -func (x *Header) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Header) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type HeaderParameterSubSchema struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` - // Determines the location of the parameter. - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *HeaderParameterSubSchema) Reset() { - *x = HeaderParameterSubSchema{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeaderParameterSubSchema) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeaderParameterSubSchema) ProtoMessage() {} - -func (x *HeaderParameterSubSchema) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeaderParameterSubSchema.ProtoReflect.Descriptor instead. -func (*HeaderParameterSubSchema) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{14} -} - -func (x *HeaderParameterSubSchema) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *HeaderParameterSubSchema) GetIn() string { - if x != nil { - return x.In - } - return "" -} - -func (x *HeaderParameterSubSchema) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *HeaderParameterSubSchema) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *HeaderParameterSubSchema) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *HeaderParameterSubSchema) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *HeaderParameterSubSchema) GetItems() *PrimitivesItems { - if x != nil { - return x.Items - } - return nil -} - -func (x *HeaderParameterSubSchema) GetCollectionFormat() string { - if x != nil { - return x.CollectionFormat - } - return "" -} - -func (x *HeaderParameterSubSchema) GetDefault() *Any { - if x != nil { - return x.Default - } - return nil -} - -func (x *HeaderParameterSubSchema) GetMaximum() float64 { - if x != nil { - return x.Maximum - } - return 0 -} - -func (x *HeaderParameterSubSchema) GetExclusiveMaximum() bool { - if x != nil { - return x.ExclusiveMaximum - } - return false -} - -func (x *HeaderParameterSubSchema) GetMinimum() float64 { - if x != nil { - return x.Minimum - } - return 0 -} - -func (x *HeaderParameterSubSchema) GetExclusiveMinimum() bool { - if x != nil { - return x.ExclusiveMinimum - } - return false -} - -func (x *HeaderParameterSubSchema) GetMaxLength() int64 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *HeaderParameterSubSchema) GetMinLength() int64 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *HeaderParameterSubSchema) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *HeaderParameterSubSchema) GetMaxItems() int64 { - if x != nil { - return x.MaxItems - } - return 0 -} - -func (x *HeaderParameterSubSchema) GetMinItems() int64 { - if x != nil { - return x.MinItems - } - return 0 -} - -func (x *HeaderParameterSubSchema) GetUniqueItems() bool { - if x != nil { - return x.UniqueItems - } - return false -} - -func (x *HeaderParameterSubSchema) GetEnum() []*Any { - if x != nil { - return x.Enum - } - return nil -} - -func (x *HeaderParameterSubSchema) GetMultipleOf() float64 { - if x != nil { - return x.MultipleOf - } - return 0 -} - -func (x *HeaderParameterSubSchema) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Headers struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedHeader `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Headers) Reset() { - *x = Headers{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Headers) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Headers) ProtoMessage() {} - -func (x *Headers) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Headers.ProtoReflect.Descriptor instead. -func (*Headers) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{15} -} - -func (x *Headers) GetAdditionalProperties() []*NamedHeader { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// General information about the API. -type Info struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A unique and precise title of the API. - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // A semantic version number of the API. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // The terms of service for the API. - TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"` - Contact *Contact `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` - License *License `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Info) Reset() { - *x = Info{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Info) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Info) ProtoMessage() {} - -func (x *Info) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Info.ProtoReflect.Descriptor instead. -func (*Info) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{16} -} - -func (x *Info) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *Info) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Info) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Info) GetTermsOfService() string { - if x != nil { - return x.TermsOfService - } - return "" -} - -func (x *Info) GetContact() *Contact { - if x != nil { - return x.Contact - } - return nil -} - -func (x *Info) GetLicense() *License { - if x != nil { - return x.License - } - return nil -} - -func (x *Info) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type ItemsItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Schema []*Schema `protobuf:"bytes,1,rep,name=schema,proto3" json:"schema,omitempty"` -} - -func (x *ItemsItem) Reset() { - *x = ItemsItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ItemsItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ItemsItem) ProtoMessage() {} - -func (x *ItemsItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ItemsItem.ProtoReflect.Descriptor instead. -func (*ItemsItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{17} -} - -func (x *ItemsItem) GetSchema() []*Schema { - if x != nil { - return x.Schema - } - return nil -} - -type JsonReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` -} - -func (x *JsonReference) Reset() { - *x = JsonReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JsonReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JsonReference) ProtoMessage() {} - -func (x *JsonReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use JsonReference.ProtoReflect.Descriptor instead. -func (*JsonReference) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{18} -} - -func (x *JsonReference) GetXRef() string { - if x != nil { - return x.XRef - } - return "" -} - -func (x *JsonReference) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -type License struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the license type. It's encouraged to use an OSI compatible license. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The URL pointing to the license. - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *License) Reset() { - *x = License{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *License) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*License) ProtoMessage() {} - -func (x *License) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use License.ProtoReflect.Descriptor instead. -func (*License) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{19} -} - -func (x *License) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *License) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *License) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. -type NamedAny struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedAny) Reset() { - *x = NamedAny{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedAny) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedAny) ProtoMessage() {} - -func (x *NamedAny) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedAny.ProtoReflect.Descriptor instead. -func (*NamedAny) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{20} -} - -func (x *NamedAny) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedAny) GetValue() *Any { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. -type NamedHeader struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *Header `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedHeader) Reset() { - *x = NamedHeader{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedHeader) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedHeader) ProtoMessage() {} - -func (x *NamedHeader) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedHeader.ProtoReflect.Descriptor instead. -func (*NamedHeader) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{21} -} - -func (x *NamedHeader) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedHeader) GetValue() *Header { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. -type NamedParameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *Parameter `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedParameter) Reset() { - *x = NamedParameter{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedParameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedParameter) ProtoMessage() {} - -func (x *NamedParameter) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedParameter.ProtoReflect.Descriptor instead. -func (*NamedParameter) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{22} -} - -func (x *NamedParameter) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedParameter) GetValue() *Parameter { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. -type NamedPathItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *PathItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedPathItem) Reset() { - *x = NamedPathItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedPathItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedPathItem) ProtoMessage() {} - -func (x *NamedPathItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedPathItem.ProtoReflect.Descriptor instead. -func (*NamedPathItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{23} -} - -func (x *NamedPathItem) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedPathItem) GetValue() *PathItem { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. -type NamedResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *Response `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedResponse) Reset() { - *x = NamedResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedResponse) ProtoMessage() {} - -func (x *NamedResponse) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedResponse.ProtoReflect.Descriptor instead. -func (*NamedResponse) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{24} -} - -func (x *NamedResponse) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedResponse) GetValue() *Response { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. -type NamedResponseValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *ResponseValue `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedResponseValue) Reset() { - *x = NamedResponseValue{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedResponseValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedResponseValue) ProtoMessage() {} - -func (x *NamedResponseValue) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedResponseValue.ProtoReflect.Descriptor instead. -func (*NamedResponseValue) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{25} -} - -func (x *NamedResponseValue) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedResponseValue) GetValue() *ResponseValue { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. -type NamedSchema struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *Schema `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedSchema) Reset() { - *x = NamedSchema{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedSchema) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedSchema) ProtoMessage() {} - -func (x *NamedSchema) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedSchema.ProtoReflect.Descriptor instead. -func (*NamedSchema) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{26} -} - -func (x *NamedSchema) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedSchema) GetValue() *Schema { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. -type NamedSecurityDefinitionsItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *SecurityDefinitionsItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedSecurityDefinitionsItem) Reset() { - *x = NamedSecurityDefinitionsItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedSecurityDefinitionsItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedSecurityDefinitionsItem) ProtoMessage() {} - -func (x *NamedSecurityDefinitionsItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedSecurityDefinitionsItem.ProtoReflect.Descriptor instead. -func (*NamedSecurityDefinitionsItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{27} -} - -func (x *NamedSecurityDefinitionsItem) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedSecurityDefinitionsItem) GetValue() *SecurityDefinitionsItem { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. -type NamedString struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedString) Reset() { - *x = NamedString{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedString) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedString) ProtoMessage() {} - -func (x *NamedString) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedString.ProtoReflect.Descriptor instead. -func (*NamedString) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{28} -} - -func (x *NamedString) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedString) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. -type NamedStringArray struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *StringArray `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedStringArray) Reset() { - *x = NamedStringArray{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedStringArray) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedStringArray) ProtoMessage() {} - -func (x *NamedStringArray) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedStringArray.ProtoReflect.Descriptor instead. -func (*NamedStringArray) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{29} -} - -func (x *NamedStringArray) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedStringArray) GetValue() *StringArray { - if x != nil { - return x.Value - } - return nil -} - -type NonBodyParameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *NonBodyParameter_HeaderParameterSubSchema - // *NonBodyParameter_FormDataParameterSubSchema - // *NonBodyParameter_QueryParameterSubSchema - // *NonBodyParameter_PathParameterSubSchema - Oneof isNonBodyParameter_Oneof `protobuf_oneof:"oneof"` -} - -func (x *NonBodyParameter) Reset() { - *x = NonBodyParameter{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NonBodyParameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NonBodyParameter) ProtoMessage() {} - -func (x *NonBodyParameter) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NonBodyParameter.ProtoReflect.Descriptor instead. -func (*NonBodyParameter) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{30} -} - -func (m *NonBodyParameter) GetOneof() isNonBodyParameter_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *NonBodyParameter) GetHeaderParameterSubSchema() *HeaderParameterSubSchema { - if x, ok := x.GetOneof().(*NonBodyParameter_HeaderParameterSubSchema); ok { - return x.HeaderParameterSubSchema - } - return nil -} - -func (x *NonBodyParameter) GetFormDataParameterSubSchema() *FormDataParameterSubSchema { - if x, ok := x.GetOneof().(*NonBodyParameter_FormDataParameterSubSchema); ok { - return x.FormDataParameterSubSchema - } - return nil -} - -func (x *NonBodyParameter) GetQueryParameterSubSchema() *QueryParameterSubSchema { - if x, ok := x.GetOneof().(*NonBodyParameter_QueryParameterSubSchema); ok { - return x.QueryParameterSubSchema - } - return nil -} - -func (x *NonBodyParameter) GetPathParameterSubSchema() *PathParameterSubSchema { - if x, ok := x.GetOneof().(*NonBodyParameter_PathParameterSubSchema); ok { - return x.PathParameterSubSchema - } - return nil -} - -type isNonBodyParameter_Oneof interface { - isNonBodyParameter_Oneof() -} - -type NonBodyParameter_HeaderParameterSubSchema struct { - HeaderParameterSubSchema *HeaderParameterSubSchema `protobuf:"bytes,1,opt,name=header_parameter_sub_schema,json=headerParameterSubSchema,proto3,oneof"` -} - -type NonBodyParameter_FormDataParameterSubSchema struct { - FormDataParameterSubSchema *FormDataParameterSubSchema `protobuf:"bytes,2,opt,name=form_data_parameter_sub_schema,json=formDataParameterSubSchema,proto3,oneof"` -} - -type NonBodyParameter_QueryParameterSubSchema struct { - QueryParameterSubSchema *QueryParameterSubSchema `protobuf:"bytes,3,opt,name=query_parameter_sub_schema,json=queryParameterSubSchema,proto3,oneof"` -} - -type NonBodyParameter_PathParameterSubSchema struct { - PathParameterSubSchema *PathParameterSubSchema `protobuf:"bytes,4,opt,name=path_parameter_sub_schema,json=pathParameterSubSchema,proto3,oneof"` -} - -func (*NonBodyParameter_HeaderParameterSubSchema) isNonBodyParameter_Oneof() {} - -func (*NonBodyParameter_FormDataParameterSubSchema) isNonBodyParameter_Oneof() {} - -func (*NonBodyParameter_QueryParameterSubSchema) isNonBodyParameter_Oneof() {} - -func (*NonBodyParameter_PathParameterSubSchema) isNonBodyParameter_Oneof() {} - -type Oauth2AccessCodeSecurity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` - TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Oauth2AccessCodeSecurity) Reset() { - *x = Oauth2AccessCodeSecurity{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Oauth2AccessCodeSecurity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Oauth2AccessCodeSecurity) ProtoMessage() {} - -func (x *Oauth2AccessCodeSecurity) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Oauth2AccessCodeSecurity.ProtoReflect.Descriptor instead. -func (*Oauth2AccessCodeSecurity) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{31} -} - -func (x *Oauth2AccessCodeSecurity) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Oauth2AccessCodeSecurity) GetFlow() string { - if x != nil { - return x.Flow - } - return "" -} - -func (x *Oauth2AccessCodeSecurity) GetScopes() *Oauth2Scopes { - if x != nil { - return x.Scopes - } - return nil -} - -func (x *Oauth2AccessCodeSecurity) GetAuthorizationUrl() string { - if x != nil { - return x.AuthorizationUrl - } - return "" -} - -func (x *Oauth2AccessCodeSecurity) GetTokenUrl() string { - if x != nil { - return x.TokenUrl - } - return "" -} - -func (x *Oauth2AccessCodeSecurity) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Oauth2AccessCodeSecurity) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Oauth2ApplicationSecurity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Oauth2ApplicationSecurity) Reset() { - *x = Oauth2ApplicationSecurity{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Oauth2ApplicationSecurity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Oauth2ApplicationSecurity) ProtoMessage() {} - -func (x *Oauth2ApplicationSecurity) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Oauth2ApplicationSecurity.ProtoReflect.Descriptor instead. -func (*Oauth2ApplicationSecurity) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{32} -} - -func (x *Oauth2ApplicationSecurity) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Oauth2ApplicationSecurity) GetFlow() string { - if x != nil { - return x.Flow - } - return "" -} - -func (x *Oauth2ApplicationSecurity) GetScopes() *Oauth2Scopes { - if x != nil { - return x.Scopes - } - return nil -} - -func (x *Oauth2ApplicationSecurity) GetTokenUrl() string { - if x != nil { - return x.TokenUrl - } - return "" -} - -func (x *Oauth2ApplicationSecurity) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Oauth2ApplicationSecurity) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Oauth2ImplicitSecurity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Oauth2ImplicitSecurity) Reset() { - *x = Oauth2ImplicitSecurity{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Oauth2ImplicitSecurity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Oauth2ImplicitSecurity) ProtoMessage() {} - -func (x *Oauth2ImplicitSecurity) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Oauth2ImplicitSecurity.ProtoReflect.Descriptor instead. -func (*Oauth2ImplicitSecurity) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{33} -} - -func (x *Oauth2ImplicitSecurity) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Oauth2ImplicitSecurity) GetFlow() string { - if x != nil { - return x.Flow - } - return "" -} - -func (x *Oauth2ImplicitSecurity) GetScopes() *Oauth2Scopes { - if x != nil { - return x.Scopes - } - return nil -} - -func (x *Oauth2ImplicitSecurity) GetAuthorizationUrl() string { - if x != nil { - return x.AuthorizationUrl - } - return "" -} - -func (x *Oauth2ImplicitSecurity) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Oauth2ImplicitSecurity) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Oauth2PasswordSecurity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes,proto3" json:"scopes,omitempty"` - TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Oauth2PasswordSecurity) Reset() { - *x = Oauth2PasswordSecurity{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Oauth2PasswordSecurity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Oauth2PasswordSecurity) ProtoMessage() {} - -func (x *Oauth2PasswordSecurity) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Oauth2PasswordSecurity.ProtoReflect.Descriptor instead. -func (*Oauth2PasswordSecurity) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{34} -} - -func (x *Oauth2PasswordSecurity) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Oauth2PasswordSecurity) GetFlow() string { - if x != nil { - return x.Flow - } - return "" -} - -func (x *Oauth2PasswordSecurity) GetScopes() *Oauth2Scopes { - if x != nil { - return x.Scopes - } - return nil -} - -func (x *Oauth2PasswordSecurity) GetTokenUrl() string { - if x != nil { - return x.TokenUrl - } - return "" -} - -func (x *Oauth2PasswordSecurity) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Oauth2PasswordSecurity) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Oauth2Scopes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedString `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Oauth2Scopes) Reset() { - *x = Oauth2Scopes{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Oauth2Scopes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Oauth2Scopes) ProtoMessage() {} - -func (x *Oauth2Scopes) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Oauth2Scopes.ProtoReflect.Descriptor instead. -func (*Oauth2Scopes) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{35} -} - -func (x *Oauth2Scopes) GetAdditionalProperties() []*NamedString { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type Operation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` - // A brief summary of the operation. - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - // A longer description of the operation, GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - // A unique identifier of the operation. - OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` - // A list of MIME types the API can produce. - Produces []string `protobuf:"bytes,6,rep,name=produces,proto3" json:"produces,omitempty"` - // A list of MIME types the API can consume. - Consumes []string `protobuf:"bytes,7,rep,name=consumes,proto3" json:"consumes,omitempty"` - // The parameters needed to send a valid API call. - Parameters []*ParametersItem `protobuf:"bytes,8,rep,name=parameters,proto3" json:"parameters,omitempty"` - Responses *Responses `protobuf:"bytes,9,opt,name=responses,proto3" json:"responses,omitempty"` - // The transfer protocol of the API. - Schemes []string `protobuf:"bytes,10,rep,name=schemes,proto3" json:"schemes,omitempty"` - Deprecated bool `protobuf:"varint,11,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security,proto3" json:"security,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,13,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Operation) Reset() { - *x = Operation{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Operation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Operation) ProtoMessage() {} - -func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Operation.ProtoReflect.Descriptor instead. -func (*Operation) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{36} -} - -func (x *Operation) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -func (x *Operation) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *Operation) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Operation) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *Operation) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -func (x *Operation) GetProduces() []string { - if x != nil { - return x.Produces - } - return nil -} - -func (x *Operation) GetConsumes() []string { - if x != nil { - return x.Consumes - } - return nil -} - -func (x *Operation) GetParameters() []*ParametersItem { - if x != nil { - return x.Parameters - } - return nil -} - -func (x *Operation) GetResponses() *Responses { - if x != nil { - return x.Responses - } - return nil -} - -func (x *Operation) GetSchemes() []string { - if x != nil { - return x.Schemes - } - return nil -} - -func (x *Operation) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *Operation) GetSecurity() []*SecurityRequirement { - if x != nil { - return x.Security - } - return nil -} - -func (x *Operation) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Parameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *Parameter_BodyParameter - // *Parameter_NonBodyParameter - Oneof isParameter_Oneof `protobuf_oneof:"oneof"` -} - -func (x *Parameter) Reset() { - *x = Parameter{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Parameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Parameter) ProtoMessage() {} - -func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Parameter.ProtoReflect.Descriptor instead. -func (*Parameter) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{37} -} - -func (m *Parameter) GetOneof() isParameter_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *Parameter) GetBodyParameter() *BodyParameter { - if x, ok := x.GetOneof().(*Parameter_BodyParameter); ok { - return x.BodyParameter - } - return nil -} - -func (x *Parameter) GetNonBodyParameter() *NonBodyParameter { - if x, ok := x.GetOneof().(*Parameter_NonBodyParameter); ok { - return x.NonBodyParameter - } - return nil -} - -type isParameter_Oneof interface { - isParameter_Oneof() -} - -type Parameter_BodyParameter struct { - BodyParameter *BodyParameter `protobuf:"bytes,1,opt,name=body_parameter,json=bodyParameter,proto3,oneof"` -} - -type Parameter_NonBodyParameter struct { - NonBodyParameter *NonBodyParameter `protobuf:"bytes,2,opt,name=non_body_parameter,json=nonBodyParameter,proto3,oneof"` -} - -func (*Parameter_BodyParameter) isParameter_Oneof() {} - -func (*Parameter_NonBodyParameter) isParameter_Oneof() {} - -// One or more JSON representations for parameters -type ParameterDefinitions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedParameter `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *ParameterDefinitions) Reset() { - *x = ParameterDefinitions{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParameterDefinitions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParameterDefinitions) ProtoMessage() {} - -func (x *ParameterDefinitions) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParameterDefinitions.ProtoReflect.Descriptor instead. -func (*ParameterDefinitions) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{38} -} - -func (x *ParameterDefinitions) GetAdditionalProperties() []*NamedParameter { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type ParametersItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *ParametersItem_Parameter - // *ParametersItem_JsonReference - Oneof isParametersItem_Oneof `protobuf_oneof:"oneof"` -} - -func (x *ParametersItem) Reset() { - *x = ParametersItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParametersItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParametersItem) ProtoMessage() {} - -func (x *ParametersItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParametersItem.ProtoReflect.Descriptor instead. -func (*ParametersItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{39} -} - -func (m *ParametersItem) GetOneof() isParametersItem_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *ParametersItem) GetParameter() *Parameter { - if x, ok := x.GetOneof().(*ParametersItem_Parameter); ok { - return x.Parameter - } - return nil -} - -func (x *ParametersItem) GetJsonReference() *JsonReference { - if x, ok := x.GetOneof().(*ParametersItem_JsonReference); ok { - return x.JsonReference - } - return nil -} - -type isParametersItem_Oneof interface { - isParametersItem_Oneof() -} - -type ParametersItem_Parameter struct { - Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,proto3,oneof"` -} - -type ParametersItem_JsonReference struct { - JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` -} - -func (*ParametersItem_Parameter) isParametersItem_Oneof() {} - -func (*ParametersItem_JsonReference) isParametersItem_Oneof() {} - -type PathItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Get *Operation `protobuf:"bytes,2,opt,name=get,proto3" json:"get,omitempty"` - Put *Operation `protobuf:"bytes,3,opt,name=put,proto3" json:"put,omitempty"` - Post *Operation `protobuf:"bytes,4,opt,name=post,proto3" json:"post,omitempty"` - Delete *Operation `protobuf:"bytes,5,opt,name=delete,proto3" json:"delete,omitempty"` - Options *Operation `protobuf:"bytes,6,opt,name=options,proto3" json:"options,omitempty"` - Head *Operation `protobuf:"bytes,7,opt,name=head,proto3" json:"head,omitempty"` - Patch *Operation `protobuf:"bytes,8,opt,name=patch,proto3" json:"patch,omitempty"` - // The parameters needed to send a valid API call. - Parameters []*ParametersItem `protobuf:"bytes,9,rep,name=parameters,proto3" json:"parameters,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *PathItem) Reset() { - *x = PathItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PathItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PathItem) ProtoMessage() {} - -func (x *PathItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[40] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PathItem.ProtoReflect.Descriptor instead. -func (*PathItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{40} -} - -func (x *PathItem) GetXRef() string { - if x != nil { - return x.XRef - } - return "" -} - -func (x *PathItem) GetGet() *Operation { - if x != nil { - return x.Get - } - return nil -} - -func (x *PathItem) GetPut() *Operation { - if x != nil { - return x.Put - } - return nil -} - -func (x *PathItem) GetPost() *Operation { - if x != nil { - return x.Post - } - return nil -} - -func (x *PathItem) GetDelete() *Operation { - if x != nil { - return x.Delete - } - return nil -} - -func (x *PathItem) GetOptions() *Operation { - if x != nil { - return x.Options - } - return nil -} - -func (x *PathItem) GetHead() *Operation { - if x != nil { - return x.Head - } - return nil -} - -func (x *PathItem) GetPatch() *Operation { - if x != nil { - return x.Patch - } - return nil -} - -func (x *PathItem) GetParameters() []*ParametersItem { - if x != nil { - return x.Parameters - } - return nil -} - -func (x *PathItem) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type PathParameterSubSchema struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` - // Determines the location of the parameter. - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,6,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,9,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,10,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,12,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,16,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *PathParameterSubSchema) Reset() { - *x = PathParameterSubSchema{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PathParameterSubSchema) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PathParameterSubSchema) ProtoMessage() {} - -func (x *PathParameterSubSchema) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[41] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PathParameterSubSchema.ProtoReflect.Descriptor instead. -func (*PathParameterSubSchema) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{41} -} - -func (x *PathParameterSubSchema) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *PathParameterSubSchema) GetIn() string { - if x != nil { - return x.In - } - return "" -} - -func (x *PathParameterSubSchema) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *PathParameterSubSchema) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PathParameterSubSchema) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *PathParameterSubSchema) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *PathParameterSubSchema) GetItems() *PrimitivesItems { - if x != nil { - return x.Items - } - return nil -} - -func (x *PathParameterSubSchema) GetCollectionFormat() string { - if x != nil { - return x.CollectionFormat - } - return "" -} - -func (x *PathParameterSubSchema) GetDefault() *Any { - if x != nil { - return x.Default - } - return nil -} - -func (x *PathParameterSubSchema) GetMaximum() float64 { - if x != nil { - return x.Maximum - } - return 0 -} - -func (x *PathParameterSubSchema) GetExclusiveMaximum() bool { - if x != nil { - return x.ExclusiveMaximum - } - return false -} - -func (x *PathParameterSubSchema) GetMinimum() float64 { - if x != nil { - return x.Minimum - } - return 0 -} - -func (x *PathParameterSubSchema) GetExclusiveMinimum() bool { - if x != nil { - return x.ExclusiveMinimum - } - return false -} - -func (x *PathParameterSubSchema) GetMaxLength() int64 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *PathParameterSubSchema) GetMinLength() int64 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *PathParameterSubSchema) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *PathParameterSubSchema) GetMaxItems() int64 { - if x != nil { - return x.MaxItems - } - return 0 -} - -func (x *PathParameterSubSchema) GetMinItems() int64 { - if x != nil { - return x.MinItems - } - return 0 -} - -func (x *PathParameterSubSchema) GetUniqueItems() bool { - if x != nil { - return x.UniqueItems - } - return false -} - -func (x *PathParameterSubSchema) GetEnum() []*Any { - if x != nil { - return x.Enum - } - return nil -} - -func (x *PathParameterSubSchema) GetMultipleOf() float64 { - if x != nil { - return x.MultipleOf - } - return 0 -} - -func (x *PathParameterSubSchema) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -// Relative paths to the individual endpoints. They must be relative to the 'basePath'. -type Paths struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - VendorExtension []*NamedAny `protobuf:"bytes,1,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` - Path []*NamedPathItem `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"` -} - -func (x *Paths) Reset() { - *x = Paths{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Paths) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Paths) ProtoMessage() {} - -func (x *Paths) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[42] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Paths.ProtoReflect.Descriptor instead. -func (*Paths) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{42} -} - -func (x *Paths) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -func (x *Paths) GetPath() []*NamedPathItem { - if x != nil { - return x.Path - } - return nil -} - -type PrimitivesItems struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,6,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,8,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,12,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,16,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,18,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *PrimitivesItems) Reset() { - *x = PrimitivesItems{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PrimitivesItems) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrimitivesItems) ProtoMessage() {} - -func (x *PrimitivesItems) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[43] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PrimitivesItems.ProtoReflect.Descriptor instead. -func (*PrimitivesItems) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{43} -} - -func (x *PrimitivesItems) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *PrimitivesItems) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *PrimitivesItems) GetItems() *PrimitivesItems { - if x != nil { - return x.Items - } - return nil -} - -func (x *PrimitivesItems) GetCollectionFormat() string { - if x != nil { - return x.CollectionFormat - } - return "" -} - -func (x *PrimitivesItems) GetDefault() *Any { - if x != nil { - return x.Default - } - return nil -} - -func (x *PrimitivesItems) GetMaximum() float64 { - if x != nil { - return x.Maximum - } - return 0 -} - -func (x *PrimitivesItems) GetExclusiveMaximum() bool { - if x != nil { - return x.ExclusiveMaximum - } - return false -} - -func (x *PrimitivesItems) GetMinimum() float64 { - if x != nil { - return x.Minimum - } - return 0 -} - -func (x *PrimitivesItems) GetExclusiveMinimum() bool { - if x != nil { - return x.ExclusiveMinimum - } - return false -} - -func (x *PrimitivesItems) GetMaxLength() int64 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *PrimitivesItems) GetMinLength() int64 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *PrimitivesItems) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *PrimitivesItems) GetMaxItems() int64 { - if x != nil { - return x.MaxItems - } - return 0 -} - -func (x *PrimitivesItems) GetMinItems() int64 { - if x != nil { - return x.MinItems - } - return 0 -} - -func (x *PrimitivesItems) GetUniqueItems() bool { - if x != nil { - return x.UniqueItems - } - return false -} - -func (x *PrimitivesItems) GetEnum() []*Any { - if x != nil { - return x.Enum - } - return nil -} - -func (x *PrimitivesItems) GetMultipleOf() float64 { - if x != nil { - return x.MultipleOf - } - return 0 -} - -func (x *PrimitivesItems) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Properties struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Properties) Reset() { - *x = Properties{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Properties) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Properties) ProtoMessage() {} - -func (x *Properties) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[44] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Properties.ProtoReflect.Descriptor instead. -func (*Properties) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{44} -} - -func (x *Properties) GetAdditionalProperties() []*NamedSchema { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type QueryParameterSubSchema struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Determines whether or not this parameter is required or optional. - Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` - // Determines the location of the parameter. - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - // The name of the parameter. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // allows sending a parameter by name only or with an empty value. - AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` - Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` - Format string `protobuf:"bytes,7,opt,name=format,proto3" json:"format,omitempty"` - Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items,proto3" json:"items,omitempty"` - CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat,proto3" json:"collection_format,omitempty"` - Default *Any `protobuf:"bytes,10,opt,name=default,proto3" json:"default,omitempty"` - Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - Enum []*Any `protobuf:"bytes,21,rep,name=enum,proto3" json:"enum,omitempty"` - MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *QueryParameterSubSchema) Reset() { - *x = QueryParameterSubSchema{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryParameterSubSchema) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryParameterSubSchema) ProtoMessage() {} - -func (x *QueryParameterSubSchema) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[45] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryParameterSubSchema.ProtoReflect.Descriptor instead. -func (*QueryParameterSubSchema) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{45} -} - -func (x *QueryParameterSubSchema) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *QueryParameterSubSchema) GetIn() string { - if x != nil { - return x.In - } - return "" -} - -func (x *QueryParameterSubSchema) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *QueryParameterSubSchema) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *QueryParameterSubSchema) GetAllowEmptyValue() bool { - if x != nil { - return x.AllowEmptyValue - } - return false -} - -func (x *QueryParameterSubSchema) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *QueryParameterSubSchema) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *QueryParameterSubSchema) GetItems() *PrimitivesItems { - if x != nil { - return x.Items - } - return nil -} - -func (x *QueryParameterSubSchema) GetCollectionFormat() string { - if x != nil { - return x.CollectionFormat - } - return "" -} - -func (x *QueryParameterSubSchema) GetDefault() *Any { - if x != nil { - return x.Default - } - return nil -} - -func (x *QueryParameterSubSchema) GetMaximum() float64 { - if x != nil { - return x.Maximum - } - return 0 -} - -func (x *QueryParameterSubSchema) GetExclusiveMaximum() bool { - if x != nil { - return x.ExclusiveMaximum - } - return false -} - -func (x *QueryParameterSubSchema) GetMinimum() float64 { - if x != nil { - return x.Minimum - } - return 0 -} - -func (x *QueryParameterSubSchema) GetExclusiveMinimum() bool { - if x != nil { - return x.ExclusiveMinimum - } - return false -} - -func (x *QueryParameterSubSchema) GetMaxLength() int64 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *QueryParameterSubSchema) GetMinLength() int64 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *QueryParameterSubSchema) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *QueryParameterSubSchema) GetMaxItems() int64 { - if x != nil { - return x.MaxItems - } - return 0 -} - -func (x *QueryParameterSubSchema) GetMinItems() int64 { - if x != nil { - return x.MinItems - } - return 0 -} - -func (x *QueryParameterSubSchema) GetUniqueItems() bool { - if x != nil { - return x.UniqueItems - } - return false -} - -func (x *QueryParameterSubSchema) GetEnum() []*Any { - if x != nil { - return x.Enum - } - return nil -} - -func (x *QueryParameterSubSchema) GetMultipleOf() float64 { - if x != nil { - return x.MultipleOf - } - return 0 -} - -func (x *QueryParameterSubSchema) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type Response struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Schema *SchemaItem `protobuf:"bytes,2,opt,name=schema,proto3" json:"schema,omitempty"` - Headers *Headers `protobuf:"bytes,3,opt,name=headers,proto3" json:"headers,omitempty"` - Examples *Examples `protobuf:"bytes,4,opt,name=examples,proto3" json:"examples,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Response) Reset() { - *x = Response{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Response) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Response) ProtoMessage() {} - -func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[46] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Response.ProtoReflect.Descriptor instead. -func (*Response) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{46} -} - -func (x *Response) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Response) GetSchema() *SchemaItem { - if x != nil { - return x.Schema - } - return nil -} - -func (x *Response) GetHeaders() *Headers { - if x != nil { - return x.Headers - } - return nil -} - -func (x *Response) GetExamples() *Examples { - if x != nil { - return x.Examples - } - return nil -} - -func (x *Response) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -// One or more JSON representations for responses -type ResponseDefinitions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedResponse `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *ResponseDefinitions) Reset() { - *x = ResponseDefinitions{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponseDefinitions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponseDefinitions) ProtoMessage() {} - -func (x *ResponseDefinitions) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[47] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponseDefinitions.ProtoReflect.Descriptor instead. -func (*ResponseDefinitions) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{47} -} - -func (x *ResponseDefinitions) GetAdditionalProperties() []*NamedResponse { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type ResponseValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *ResponseValue_Response - // *ResponseValue_JsonReference - Oneof isResponseValue_Oneof `protobuf_oneof:"oneof"` -} - -func (x *ResponseValue) Reset() { - *x = ResponseValue{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponseValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponseValue) ProtoMessage() {} - -func (x *ResponseValue) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[48] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponseValue.ProtoReflect.Descriptor instead. -func (*ResponseValue) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{48} -} - -func (m *ResponseValue) GetOneof() isResponseValue_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *ResponseValue) GetResponse() *Response { - if x, ok := x.GetOneof().(*ResponseValue_Response); ok { - return x.Response - } - return nil -} - -func (x *ResponseValue) GetJsonReference() *JsonReference { - if x, ok := x.GetOneof().(*ResponseValue_JsonReference); ok { - return x.JsonReference - } - return nil -} - -type isResponseValue_Oneof interface { - isResponseValue_Oneof() -} - -type ResponseValue_Response struct { - Response *Response `protobuf:"bytes,1,opt,name=response,proto3,oneof"` -} - -type ResponseValue_JsonReference struct { - JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,proto3,oneof"` -} - -func (*ResponseValue_Response) isResponseValue_Oneof() {} - -func (*ResponseValue_JsonReference) isResponseValue_Oneof() {} - -// Response objects names can either be any valid HTTP status code or 'default'. -type Responses struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ResponseCode []*NamedResponseValue `protobuf:"bytes,1,rep,name=response_code,json=responseCode,proto3" json:"response_code,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,2,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Responses) Reset() { - *x = Responses{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Responses) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Responses) ProtoMessage() {} - -func (x *Responses) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[49] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Responses.ProtoReflect.Descriptor instead. -func (*Responses) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{49} -} - -func (x *Responses) GetResponseCode() []*NamedResponseValue { - if x != nil { - return x.ResponseCode - } - return nil -} - -func (x *Responses) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -// A deterministic version of a JSON Schema object. -type Schema struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` - Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - Default *Any `protobuf:"bytes,5,opt,name=default,proto3" json:"default,omitempty"` - MultipleOf float64 `protobuf:"fixed64,6,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - Maximum float64 `protobuf:"fixed64,7,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,8,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,9,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,10,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,11,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,12,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,13,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,14,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,15,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,16,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - MaxProperties int64 `protobuf:"varint,17,opt,name=max_properties,json=maxProperties,proto3" json:"max_properties,omitempty"` - MinProperties int64 `protobuf:"varint,18,opt,name=min_properties,json=minProperties,proto3" json:"min_properties,omitempty"` - Required []string `protobuf:"bytes,19,rep,name=required,proto3" json:"required,omitempty"` - Enum []*Any `protobuf:"bytes,20,rep,name=enum,proto3" json:"enum,omitempty"` - AdditionalProperties *AdditionalPropertiesItem `protobuf:"bytes,21,opt,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - Type *TypeItem `protobuf:"bytes,22,opt,name=type,proto3" json:"type,omitempty"` - Items *ItemsItem `protobuf:"bytes,23,opt,name=items,proto3" json:"items,omitempty"` - AllOf []*Schema `protobuf:"bytes,24,rep,name=all_of,json=allOf,proto3" json:"all_of,omitempty"` - Properties *Properties `protobuf:"bytes,25,opt,name=properties,proto3" json:"properties,omitempty"` - Discriminator string `protobuf:"bytes,26,opt,name=discriminator,proto3" json:"discriminator,omitempty"` - ReadOnly bool `protobuf:"varint,27,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - Xml *Xml `protobuf:"bytes,28,opt,name=xml,proto3" json:"xml,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,29,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - Example *Any `protobuf:"bytes,30,opt,name=example,proto3" json:"example,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,31,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Schema) Reset() { - *x = Schema{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Schema) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Schema) ProtoMessage() {} - -func (x *Schema) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[50] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Schema.ProtoReflect.Descriptor instead. -func (*Schema) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{50} -} - -func (x *Schema) GetXRef() string { - if x != nil { - return x.XRef - } - return "" -} - -func (x *Schema) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *Schema) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *Schema) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Schema) GetDefault() *Any { - if x != nil { - return x.Default - } - return nil -} - -func (x *Schema) GetMultipleOf() float64 { - if x != nil { - return x.MultipleOf - } - return 0 -} - -func (x *Schema) GetMaximum() float64 { - if x != nil { - return x.Maximum - } - return 0 -} - -func (x *Schema) GetExclusiveMaximum() bool { - if x != nil { - return x.ExclusiveMaximum - } - return false -} - -func (x *Schema) GetMinimum() float64 { - if x != nil { - return x.Minimum - } - return 0 -} - -func (x *Schema) GetExclusiveMinimum() bool { - if x != nil { - return x.ExclusiveMinimum - } - return false -} - -func (x *Schema) GetMaxLength() int64 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *Schema) GetMinLength() int64 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *Schema) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *Schema) GetMaxItems() int64 { - if x != nil { - return x.MaxItems - } - return 0 -} - -func (x *Schema) GetMinItems() int64 { - if x != nil { - return x.MinItems - } - return 0 -} - -func (x *Schema) GetUniqueItems() bool { - if x != nil { - return x.UniqueItems - } - return false -} - -func (x *Schema) GetMaxProperties() int64 { - if x != nil { - return x.MaxProperties - } - return 0 -} - -func (x *Schema) GetMinProperties() int64 { - if x != nil { - return x.MinProperties - } - return 0 -} - -func (x *Schema) GetRequired() []string { - if x != nil { - return x.Required - } - return nil -} - -func (x *Schema) GetEnum() []*Any { - if x != nil { - return x.Enum - } - return nil -} - -func (x *Schema) GetAdditionalProperties() *AdditionalPropertiesItem { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -func (x *Schema) GetType() *TypeItem { - if x != nil { - return x.Type - } - return nil -} - -func (x *Schema) GetItems() *ItemsItem { - if x != nil { - return x.Items - } - return nil -} - -func (x *Schema) GetAllOf() []*Schema { - if x != nil { - return x.AllOf - } - return nil -} - -func (x *Schema) GetProperties() *Properties { - if x != nil { - return x.Properties - } - return nil -} - -func (x *Schema) GetDiscriminator() string { - if x != nil { - return x.Discriminator - } - return "" -} - -func (x *Schema) GetReadOnly() bool { - if x != nil { - return x.ReadOnly - } - return false -} - -func (x *Schema) GetXml() *Xml { - if x != nil { - return x.Xml - } - return nil -} - -func (x *Schema) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *Schema) GetExample() *Any { - if x != nil { - return x.Example - } - return nil -} - -func (x *Schema) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type SchemaItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *SchemaItem_Schema - // *SchemaItem_FileSchema - Oneof isSchemaItem_Oneof `protobuf_oneof:"oneof"` -} - -func (x *SchemaItem) Reset() { - *x = SchemaItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SchemaItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SchemaItem) ProtoMessage() {} - -func (x *SchemaItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[51] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SchemaItem.ProtoReflect.Descriptor instead. -func (*SchemaItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{51} -} - -func (m *SchemaItem) GetOneof() isSchemaItem_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *SchemaItem) GetSchema() *Schema { - if x, ok := x.GetOneof().(*SchemaItem_Schema); ok { - return x.Schema - } - return nil -} - -func (x *SchemaItem) GetFileSchema() *FileSchema { - if x, ok := x.GetOneof().(*SchemaItem_FileSchema); ok { - return x.FileSchema - } - return nil -} - -type isSchemaItem_Oneof interface { - isSchemaItem_Oneof() -} - -type SchemaItem_Schema struct { - Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` -} - -type SchemaItem_FileSchema struct { - FileSchema *FileSchema `protobuf:"bytes,2,opt,name=file_schema,json=fileSchema,proto3,oneof"` -} - -func (*SchemaItem_Schema) isSchemaItem_Oneof() {} - -func (*SchemaItem_FileSchema) isSchemaItem_Oneof() {} - -type SecurityDefinitions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedSecurityDefinitionsItem `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *SecurityDefinitions) Reset() { - *x = SecurityDefinitions{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecurityDefinitions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityDefinitions) ProtoMessage() {} - -func (x *SecurityDefinitions) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[52] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecurityDefinitions.ProtoReflect.Descriptor instead. -func (*SecurityDefinitions) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{52} -} - -func (x *SecurityDefinitions) GetAdditionalProperties() []*NamedSecurityDefinitionsItem { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type SecurityDefinitionsItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *SecurityDefinitionsItem_BasicAuthenticationSecurity - // *SecurityDefinitionsItem_ApiKeySecurity - // *SecurityDefinitionsItem_Oauth2ImplicitSecurity - // *SecurityDefinitionsItem_Oauth2PasswordSecurity - // *SecurityDefinitionsItem_Oauth2ApplicationSecurity - // *SecurityDefinitionsItem_Oauth2AccessCodeSecurity - Oneof isSecurityDefinitionsItem_Oneof `protobuf_oneof:"oneof"` -} - -func (x *SecurityDefinitionsItem) Reset() { - *x = SecurityDefinitionsItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecurityDefinitionsItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityDefinitionsItem) ProtoMessage() {} - -func (x *SecurityDefinitionsItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[53] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecurityDefinitionsItem.ProtoReflect.Descriptor instead. -func (*SecurityDefinitionsItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{53} -} - -func (m *SecurityDefinitionsItem) GetOneof() isSecurityDefinitionsItem_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *SecurityDefinitionsItem) GetBasicAuthenticationSecurity() *BasicAuthenticationSecurity { - if x, ok := x.GetOneof().(*SecurityDefinitionsItem_BasicAuthenticationSecurity); ok { - return x.BasicAuthenticationSecurity - } - return nil -} - -func (x *SecurityDefinitionsItem) GetApiKeySecurity() *ApiKeySecurity { - if x, ok := x.GetOneof().(*SecurityDefinitionsItem_ApiKeySecurity); ok { - return x.ApiKeySecurity - } - return nil -} - -func (x *SecurityDefinitionsItem) GetOauth2ImplicitSecurity() *Oauth2ImplicitSecurity { - if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2ImplicitSecurity); ok { - return x.Oauth2ImplicitSecurity - } - return nil -} - -func (x *SecurityDefinitionsItem) GetOauth2PasswordSecurity() *Oauth2PasswordSecurity { - if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2PasswordSecurity); ok { - return x.Oauth2PasswordSecurity - } - return nil -} - -func (x *SecurityDefinitionsItem) GetOauth2ApplicationSecurity() *Oauth2ApplicationSecurity { - if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2ApplicationSecurity); ok { - return x.Oauth2ApplicationSecurity - } - return nil -} - -func (x *SecurityDefinitionsItem) GetOauth2AccessCodeSecurity() *Oauth2AccessCodeSecurity { - if x, ok := x.GetOneof().(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity); ok { - return x.Oauth2AccessCodeSecurity - } - return nil -} - -type isSecurityDefinitionsItem_Oneof interface { - isSecurityDefinitionsItem_Oneof() -} - -type SecurityDefinitionsItem_BasicAuthenticationSecurity struct { - BasicAuthenticationSecurity *BasicAuthenticationSecurity `protobuf:"bytes,1,opt,name=basic_authentication_security,json=basicAuthenticationSecurity,proto3,oneof"` -} - -type SecurityDefinitionsItem_ApiKeySecurity struct { - ApiKeySecurity *ApiKeySecurity `protobuf:"bytes,2,opt,name=api_key_security,json=apiKeySecurity,proto3,oneof"` -} - -type SecurityDefinitionsItem_Oauth2ImplicitSecurity struct { - Oauth2ImplicitSecurity *Oauth2ImplicitSecurity `protobuf:"bytes,3,opt,name=oauth2_implicit_security,json=oauth2ImplicitSecurity,proto3,oneof"` -} - -type SecurityDefinitionsItem_Oauth2PasswordSecurity struct { - Oauth2PasswordSecurity *Oauth2PasswordSecurity `protobuf:"bytes,4,opt,name=oauth2_password_security,json=oauth2PasswordSecurity,proto3,oneof"` -} - -type SecurityDefinitionsItem_Oauth2ApplicationSecurity struct { - Oauth2ApplicationSecurity *Oauth2ApplicationSecurity `protobuf:"bytes,5,opt,name=oauth2_application_security,json=oauth2ApplicationSecurity,proto3,oneof"` -} - -type SecurityDefinitionsItem_Oauth2AccessCodeSecurity struct { - Oauth2AccessCodeSecurity *Oauth2AccessCodeSecurity `protobuf:"bytes,6,opt,name=oauth2_access_code_security,json=oauth2AccessCodeSecurity,proto3,oneof"` -} - -func (*SecurityDefinitionsItem_BasicAuthenticationSecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_ApiKeySecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_Oauth2ImplicitSecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_Oauth2PasswordSecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_Oauth2ApplicationSecurity) isSecurityDefinitionsItem_Oneof() {} - -func (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) isSecurityDefinitionsItem_Oneof() {} - -type SecurityRequirement struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *SecurityRequirement) Reset() { - *x = SecurityRequirement{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecurityRequirement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityRequirement) ProtoMessage() {} - -func (x *SecurityRequirement) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[54] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecurityRequirement.ProtoReflect.Descriptor instead. -func (*SecurityRequirement) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{54} -} - -func (x *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type StringArray struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` -} - -func (x *StringArray) Reset() { - *x = StringArray{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StringArray) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StringArray) ProtoMessage() {} - -func (x *StringArray) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[55] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StringArray.ProtoReflect.Descriptor instead. -func (*StringArray) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{55} -} - -func (x *StringArray) GetValue() []string { - if x != nil { - return x.Value - } - return nil -} - -type Tag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Tag) Reset() { - *x = Tag{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Tag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Tag) ProtoMessage() {} - -func (x *Tag) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[56] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Tag.ProtoReflect.Descriptor instead. -func (*Tag) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{56} -} - -func (x *Tag) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Tag) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Tag) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *Tag) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -type TypeItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` -} - -func (x *TypeItem) Reset() { - *x = TypeItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[57] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TypeItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TypeItem) ProtoMessage() {} - -func (x *TypeItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[57] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TypeItem.ProtoReflect.Descriptor instead. -func (*TypeItem) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{57} -} - -func (x *TypeItem) GetValue() []string { - if x != nil { - return x.Value - } - return nil -} - -// Any property starting with x- is valid. -type VendorExtension struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *VendorExtension) Reset() { - *x = VendorExtension{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[58] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VendorExtension) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VendorExtension) ProtoMessage() {} - -func (x *VendorExtension) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[58] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VendorExtension.ProtoReflect.Descriptor instead. -func (*VendorExtension) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{58} -} - -func (x *VendorExtension) GetAdditionalProperties() []*NamedAny { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type Xml struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Attribute bool `protobuf:"varint,4,opt,name=attribute,proto3" json:"attribute,omitempty"` - Wrapped bool `protobuf:"varint,5,opt,name=wrapped,proto3" json:"wrapped,omitempty"` - VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension,proto3" json:"vendor_extension,omitempty"` -} - -func (x *Xml) Reset() { - *x = Xml{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[59] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Xml) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Xml) ProtoMessage() {} - -func (x *Xml) ProtoReflect() protoreflect.Message { - mi := &file_openapiv2_OpenAPIv2_proto_msgTypes[59] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Xml.ProtoReflect.Descriptor instead. -func (*Xml) Descriptor() ([]byte, []int) { - return file_openapiv2_OpenAPIv2_proto_rawDescGZIP(), []int{59} -} - -func (x *Xml) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Xml) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *Xml) GetPrefix() string { - if x != nil { - return x.Prefix - } - return "" -} - -func (x *Xml) GetAttribute() bool { - if x != nil { - return x.Attribute - } - return false -} - -func (x *Xml) GetWrapped() bool { - if x != nil { - return x.Wrapped - } - return false -} - -func (x *Xml) GetVendorExtension() []*NamedAny { - if x != nil { - return x.VendorExtension - } - return nil -} - -var File_openapiv2_OpenAPIv2_proto protoreflect.FileDescriptor - -var file_openapiv2_OpenAPIv2_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x4f, 0x70, 0x65, 0x6e, - 0x41, 0x50, 0x49, 0x76, 0x32, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 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, 0x22, 0x6d, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2c, - 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x07, - 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, - 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, - 0x66, 0x22, 0x45, 0x0a, 0x03, 0x41, 0x6e, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x01, 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, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0xab, 0x01, 0x0a, 0x0e, 0x41, 0x70, 0x69, - 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, - 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x94, 0x01, 0x0a, 0x1b, 0x42, 0x61, 0x73, 0x69, 0x63, - 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, - 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, - 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, - 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xde, 0x01, - 0x0a, 0x0d, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, - 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x3f, 0x0a, - 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, - 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x86, - 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x54, 0x0a, 0x07, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x12, 0x49, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x5b, 0x0a, - 0x0b, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x15, - 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xe8, 0x05, 0x0a, 0x08, 0x44, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x77, 0x61, 0x67, 0x67, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x77, 0x61, 0x67, 0x67, 0x65, - 0x72, 0x12, 0x24, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x10, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, - 0x61, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x62, 0x61, 0x73, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, - 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x1a, - 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, - 0x74, 0x68, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x73, 0x52, 0x05, 0x70, 0x61, - 0x74, 0x68, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x0b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x40, - 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, - 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, - 0x3b, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x52, 0x0a, 0x14, - 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x13, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x23, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x61, 0x67, 0x52, - 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x44, 0x6f, 0x63, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, - 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x55, 0x0a, 0x08, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x73, 0x12, 0x49, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x83, 0x01, 0x0a, - 0x0c, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, - 0x6c, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, - 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0xff, 0x02, 0x0a, 0x0a, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, - 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x29, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xab, 0x06, 0x0a, 0x1a, 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x61, 0x74, - 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, - 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, - 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, - 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, - 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, - 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, - 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, - 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, - 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, - 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, - 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, - 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, - 0x6e, 0x75, 0x6d, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, - 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, - 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, - 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, - 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0xab, 0x05, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, - 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, - 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, - 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, - 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, - 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, - 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, - 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, - 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, - 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, - 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x11, 0x20, 0x01, 0x28, - 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, - 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x22, 0xfd, 0x05, 0x0a, 0x18, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, - 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, - 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, - 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, - 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, - 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, - 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, - 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, - 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, - 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, - 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x10, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, - 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, - 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, - 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, - 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, - 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, - 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, - 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x15, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, - 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, - 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x22, 0x57, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x61, - 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xa1, 0x02, 0x0a, 0x04, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x5f, 0x6f, 0x66, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x74, 0x65, 0x72, 0x6d, 0x73, 0x4f, 0x66, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, - 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x63, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x2d, 0x0a, - 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x63, 0x65, - 0x6e, 0x73, 0x65, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x10, - 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, - 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, - 0x09, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x44, 0x0a, 0x0d, 0x4a, 0x73, 0x6f, 0x6e, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x70, 0x0a, 0x07, - 0x4c, 0x69, 0x63, 0x65, 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, 0x75, - 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x3f, 0x0a, - 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, - 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x45, - 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4b, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x51, 0x0a, 0x0e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, - 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x64, 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, 0x2a, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x59, 0x0a, 0x12, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x4b, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x6d, 0x0a, 0x1c, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x37, - 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x55, 0x0a, 0x10, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xb5, - 0x03, 0x0a, 0x10, 0x4e, 0x6f, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x12, 0x65, 0x0a, 0x1b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, - 0x52, 0x18, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x6c, 0x0a, 0x1e, 0x66, 0x6f, - 0x72, 0x6d, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x46, 0x6f, 0x72, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x1a, 0x66, 0x6f, - 0x72, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, - 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x62, 0x0a, 0x1a, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x5f, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x48, 0x00, 0x52, 0x17, 0x71, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x5f, 0x0a, 0x19, - 0x70, 0x61, 0x74, 0x68, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x5f, 0x73, - 0x75, 0x62, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x74, - 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x16, 0x70, 0x61, 0x74, 0x68, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x07, 0x0a, - 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xa1, 0x02, 0x0a, 0x18, 0x4f, 0x61, 0x75, 0x74, 0x68, - 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, - 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2b, 0x0a, - 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, - 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, - 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xf5, 0x01, 0x0a, 0x19, 0x4f, - 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, - 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, - 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, - 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x82, 0x02, 0x0a, 0x16, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, - 0x6c, 0x69, 0x63, 0x69, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x52, - 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xf2, 0x01, 0x0a, 0x16, 0x4f, 0x61, 0x75, 0x74, - 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x63, - 0x6f, 0x70, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, - 0x6f, 0x70, 0x65, 0x73, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x76, - 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, - 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5c, 0x0a, 0x0c, - 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x4c, 0x0a, 0x15, - 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x9e, 0x04, 0x0a, 0x09, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, - 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x33, - 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x18, 0x0a, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x12, 0x1e, 0x0a, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x3b, 0x0a, - 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, - 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, - 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa6, 0x01, 0x0a, 0x09, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0e, 0x62, 0x6f, 0x64, - 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x42, - 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0d, - 0x62, 0x6f, 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x4c, 0x0a, - 0x12, 0x6e, 0x6f, 0x6e, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x6f, 0x6e, 0x42, 0x6f, 0x64, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x10, 0x6e, 0x6f, 0x6e, 0x42, 0x6f, - 0x64, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x42, 0x07, 0x0a, 0x05, 0x6f, - 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x67, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x15, - 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x94, 0x01, - 0x0a, 0x0e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, 0x65, 0x6d, - 0x12, 0x35, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x09, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0e, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4a, 0x73, 0x6f, - 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x6a, 0x73, - 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, - 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xcf, 0x03, 0x0a, 0x08, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, - 0x6d, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x52, 0x65, 0x66, 0x12, 0x27, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, - 0x03, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x70, 0x6f, 0x73, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x70, 0x6f, 0x73, - 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x29, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, 0x12, 0x2b, 0x0a, 0x05, - 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, - 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfb, 0x05, 0x0a, 0x16, 0x50, 0x61, 0x74, 0x68, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, - 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, - 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, - 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, - 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, - 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, - 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, - 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, - 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, - 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, - 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, - 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, - 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, - 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, - 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x11, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, - 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, - 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, - 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, - 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, - 0x66, 0x18, 0x15, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, - 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x77, 0x0a, 0x05, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x3f, 0x0a, - 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, - 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, - 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x92, 0x05, - 0x0a, 0x0f, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, - 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, - 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, - 0x6d, 0x75, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, - 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, - 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, - 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, - 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, - 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, - 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, - 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, - 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, - 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, - 0x6e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, - 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, - 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, - 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x5a, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, - 0x12, 0x4c, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, - 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xa8, - 0x06, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x53, 0x75, 0x62, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x11, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, - 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, - 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x69, - 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, - 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x1d, 0x0a, - 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, - 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, - 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, - 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, - 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, - 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x15, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, - 0x79, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, - 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x16, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, - 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, 0x66, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, - 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x17, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfe, 0x01, 0x0a, 0x08, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x49, 0x74, 0x65, 0x6d, - 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x2d, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x07, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x52, - 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, - 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x65, 0x0a, 0x13, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x4e, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, - 0x73, 0x22, 0x90, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0e, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4a, 0x73, 0x6f, - 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x6a, 0x73, - 0x6f, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, - 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x91, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, - 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xaf, 0x09, 0x0a, 0x06, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, - 0x4f, 0x66, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, - 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, - 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x76, 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, - 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, - 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, - 0x5f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, - 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, - 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, - 0x1d, 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, - 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, - 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, - 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, - 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, - 0x61, 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, - 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x12, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, - 0x69, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, - 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, - 0x23, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, - 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x59, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x15, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x69, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, - 0x28, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, - 0x6d, 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x6c, 0x6c, 0x5f, 0x6f, 0x66, - 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x4f, - 0x66, 0x12, 0x36, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, - 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x70, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x69, 0x73, - 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x1b, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x03, - 0x78, 0x6d, 0x6c, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x58, 0x6d, 0x6c, 0x52, 0x03, 0x78, 0x6d, 0x6c, 0x12, - 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, - 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, - 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x29, - 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, - 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x1f, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, - 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7e, 0x0a, 0x0a, 0x53, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x06, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x39, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x73, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x74, 0x0a, 0x13, 0x53, 0x65, - 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x5d, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, 0x69, 0x6e, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, - 0x22, 0xe9, 0x04, 0x0a, 0x17, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x65, 0x66, - 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x6d, 0x0a, 0x1d, - 0x62, 0x61, 0x73, 0x69, 0x63, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x1b, - 0x62, 0x61, 0x73, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x46, 0x0a, 0x10, 0x61, - 0x70, 0x69, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x41, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x48, 0x00, 0x52, 0x0e, 0x61, 0x70, 0x69, 0x4b, 0x65, 0x79, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x69, 0x6d, - 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, - 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x16, 0x6f, 0x61, 0x75, - 0x74, 0x68, 0x32, 0x49, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x16, 0x6f, 0x61, 0x75, - 0x74, 0x68, 0x32, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x67, 0x0a, 0x1b, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, - 0x00, 0x52, 0x19, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x65, 0x0a, 0x1b, - 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, - 0x64, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4f, - 0x61, 0x75, 0x74, 0x68, 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x18, 0x6f, 0x61, 0x75, 0x74, 0x68, - 0x32, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x68, 0x0a, 0x13, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, - 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x23, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x03, - 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, - 0x6f, 0x72, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x0a, 0x08, 0x54, 0x79, 0x70, - 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5c, 0x0a, 0x0f, 0x56, - 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x49, - 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xc8, 0x01, 0x0a, 0x03, 0x58, 0x6d, - 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x61, - 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, - 0x70, 0x70, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, - 0x70, 0x65, 0x64, 0x12, 0x3f, 0x0a, 0x10, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x41, 0x6e, 0x79, 0x52, 0x0f, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x3e, 0x0a, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0x42, 0x0c, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x16, 0x2e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x76, 0x32, 0x3b, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x32, 0xa2, 0x02, - 0x03, 0x4f, 0x41, 0x53, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_openapiv2_OpenAPIv2_proto_rawDescOnce sync.Once - file_openapiv2_OpenAPIv2_proto_rawDescData = file_openapiv2_OpenAPIv2_proto_rawDesc -) - -func file_openapiv2_OpenAPIv2_proto_rawDescGZIP() []byte { - file_openapiv2_OpenAPIv2_proto_rawDescOnce.Do(func() { - file_openapiv2_OpenAPIv2_proto_rawDescData = protoimpl.X.CompressGZIP(file_openapiv2_OpenAPIv2_proto_rawDescData) - }) - return file_openapiv2_OpenAPIv2_proto_rawDescData -} - -var file_openapiv2_OpenAPIv2_proto_msgTypes = make([]protoimpl.MessageInfo, 60) -var file_openapiv2_OpenAPIv2_proto_goTypes = []interface{}{ - (*AdditionalPropertiesItem)(nil), // 0: openapi.v2.AdditionalPropertiesItem - (*Any)(nil), // 1: openapi.v2.Any - (*ApiKeySecurity)(nil), // 2: openapi.v2.ApiKeySecurity - (*BasicAuthenticationSecurity)(nil), // 3: openapi.v2.BasicAuthenticationSecurity - (*BodyParameter)(nil), // 4: openapi.v2.BodyParameter - (*Contact)(nil), // 5: openapi.v2.Contact - (*Default)(nil), // 6: openapi.v2.Default - (*Definitions)(nil), // 7: openapi.v2.Definitions - (*Document)(nil), // 8: openapi.v2.Document - (*Examples)(nil), // 9: openapi.v2.Examples - (*ExternalDocs)(nil), // 10: openapi.v2.ExternalDocs - (*FileSchema)(nil), // 11: openapi.v2.FileSchema - (*FormDataParameterSubSchema)(nil), // 12: openapi.v2.FormDataParameterSubSchema - (*Header)(nil), // 13: openapi.v2.Header - (*HeaderParameterSubSchema)(nil), // 14: openapi.v2.HeaderParameterSubSchema - (*Headers)(nil), // 15: openapi.v2.Headers - (*Info)(nil), // 16: openapi.v2.Info - (*ItemsItem)(nil), // 17: openapi.v2.ItemsItem - (*JsonReference)(nil), // 18: openapi.v2.JsonReference - (*License)(nil), // 19: openapi.v2.License - (*NamedAny)(nil), // 20: openapi.v2.NamedAny - (*NamedHeader)(nil), // 21: openapi.v2.NamedHeader - (*NamedParameter)(nil), // 22: openapi.v2.NamedParameter - (*NamedPathItem)(nil), // 23: openapi.v2.NamedPathItem - (*NamedResponse)(nil), // 24: openapi.v2.NamedResponse - (*NamedResponseValue)(nil), // 25: openapi.v2.NamedResponseValue - (*NamedSchema)(nil), // 26: openapi.v2.NamedSchema - (*NamedSecurityDefinitionsItem)(nil), // 27: openapi.v2.NamedSecurityDefinitionsItem - (*NamedString)(nil), // 28: openapi.v2.NamedString - (*NamedStringArray)(nil), // 29: openapi.v2.NamedStringArray - (*NonBodyParameter)(nil), // 30: openapi.v2.NonBodyParameter - (*Oauth2AccessCodeSecurity)(nil), // 31: openapi.v2.Oauth2AccessCodeSecurity - (*Oauth2ApplicationSecurity)(nil), // 32: openapi.v2.Oauth2ApplicationSecurity - (*Oauth2ImplicitSecurity)(nil), // 33: openapi.v2.Oauth2ImplicitSecurity - (*Oauth2PasswordSecurity)(nil), // 34: openapi.v2.Oauth2PasswordSecurity - (*Oauth2Scopes)(nil), // 35: openapi.v2.Oauth2Scopes - (*Operation)(nil), // 36: openapi.v2.Operation - (*Parameter)(nil), // 37: openapi.v2.Parameter - (*ParameterDefinitions)(nil), // 38: openapi.v2.ParameterDefinitions - (*ParametersItem)(nil), // 39: openapi.v2.ParametersItem - (*PathItem)(nil), // 40: openapi.v2.PathItem - (*PathParameterSubSchema)(nil), // 41: openapi.v2.PathParameterSubSchema - (*Paths)(nil), // 42: openapi.v2.Paths - (*PrimitivesItems)(nil), // 43: openapi.v2.PrimitivesItems - (*Properties)(nil), // 44: openapi.v2.Properties - (*QueryParameterSubSchema)(nil), // 45: openapi.v2.QueryParameterSubSchema - (*Response)(nil), // 46: openapi.v2.Response - (*ResponseDefinitions)(nil), // 47: openapi.v2.ResponseDefinitions - (*ResponseValue)(nil), // 48: openapi.v2.ResponseValue - (*Responses)(nil), // 49: openapi.v2.Responses - (*Schema)(nil), // 50: openapi.v2.Schema - (*SchemaItem)(nil), // 51: openapi.v2.SchemaItem - (*SecurityDefinitions)(nil), // 52: openapi.v2.SecurityDefinitions - (*SecurityDefinitionsItem)(nil), // 53: openapi.v2.SecurityDefinitionsItem - (*SecurityRequirement)(nil), // 54: openapi.v2.SecurityRequirement - (*StringArray)(nil), // 55: openapi.v2.StringArray - (*Tag)(nil), // 56: openapi.v2.Tag - (*TypeItem)(nil), // 57: openapi.v2.TypeItem - (*VendorExtension)(nil), // 58: openapi.v2.VendorExtension - (*Xml)(nil), // 59: openapi.v2.Xml - (*anypb.Any)(nil), // 60: google.protobuf.Any -} -var file_openapiv2_OpenAPIv2_proto_depIdxs = []int32{ - 50, // 0: openapi.v2.AdditionalPropertiesItem.schema:type_name -> openapi.v2.Schema - 60, // 1: openapi.v2.Any.value:type_name -> google.protobuf.Any - 20, // 2: openapi.v2.ApiKeySecurity.vendor_extension:type_name -> openapi.v2.NamedAny - 20, // 3: openapi.v2.BasicAuthenticationSecurity.vendor_extension:type_name -> openapi.v2.NamedAny - 50, // 4: openapi.v2.BodyParameter.schema:type_name -> openapi.v2.Schema - 20, // 5: openapi.v2.BodyParameter.vendor_extension:type_name -> openapi.v2.NamedAny - 20, // 6: openapi.v2.Contact.vendor_extension:type_name -> openapi.v2.NamedAny - 20, // 7: openapi.v2.Default.additional_properties:type_name -> openapi.v2.NamedAny - 26, // 8: openapi.v2.Definitions.additional_properties:type_name -> openapi.v2.NamedSchema - 16, // 9: openapi.v2.Document.info:type_name -> openapi.v2.Info - 42, // 10: openapi.v2.Document.paths:type_name -> openapi.v2.Paths - 7, // 11: openapi.v2.Document.definitions:type_name -> openapi.v2.Definitions - 38, // 12: openapi.v2.Document.parameters:type_name -> openapi.v2.ParameterDefinitions - 47, // 13: openapi.v2.Document.responses:type_name -> openapi.v2.ResponseDefinitions - 54, // 14: openapi.v2.Document.security:type_name -> openapi.v2.SecurityRequirement - 52, // 15: openapi.v2.Document.security_definitions:type_name -> openapi.v2.SecurityDefinitions - 56, // 16: openapi.v2.Document.tags:type_name -> openapi.v2.Tag - 10, // 17: openapi.v2.Document.external_docs:type_name -> openapi.v2.ExternalDocs - 20, // 18: openapi.v2.Document.vendor_extension:type_name -> openapi.v2.NamedAny - 20, // 19: openapi.v2.Examples.additional_properties:type_name -> openapi.v2.NamedAny - 20, // 20: openapi.v2.ExternalDocs.vendor_extension:type_name -> openapi.v2.NamedAny - 1, // 21: openapi.v2.FileSchema.default:type_name -> openapi.v2.Any - 10, // 22: openapi.v2.FileSchema.external_docs:type_name -> openapi.v2.ExternalDocs - 1, // 23: openapi.v2.FileSchema.example:type_name -> openapi.v2.Any - 20, // 24: openapi.v2.FileSchema.vendor_extension:type_name -> openapi.v2.NamedAny - 43, // 25: openapi.v2.FormDataParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems - 1, // 26: openapi.v2.FormDataParameterSubSchema.default:type_name -> openapi.v2.Any - 1, // 27: openapi.v2.FormDataParameterSubSchema.enum:type_name -> openapi.v2.Any - 20, // 28: openapi.v2.FormDataParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny - 43, // 29: openapi.v2.Header.items:type_name -> openapi.v2.PrimitivesItems - 1, // 30: openapi.v2.Header.default:type_name -> openapi.v2.Any - 1, // 31: openapi.v2.Header.enum:type_name -> openapi.v2.Any - 20, // 32: openapi.v2.Header.vendor_extension:type_name -> openapi.v2.NamedAny - 43, // 33: openapi.v2.HeaderParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems - 1, // 34: openapi.v2.HeaderParameterSubSchema.default:type_name -> openapi.v2.Any - 1, // 35: openapi.v2.HeaderParameterSubSchema.enum:type_name -> openapi.v2.Any - 20, // 36: openapi.v2.HeaderParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny - 21, // 37: openapi.v2.Headers.additional_properties:type_name -> openapi.v2.NamedHeader - 5, // 38: openapi.v2.Info.contact:type_name -> openapi.v2.Contact - 19, // 39: openapi.v2.Info.license:type_name -> openapi.v2.License - 20, // 40: openapi.v2.Info.vendor_extension:type_name -> openapi.v2.NamedAny - 50, // 41: openapi.v2.ItemsItem.schema:type_name -> openapi.v2.Schema - 20, // 42: openapi.v2.License.vendor_extension:type_name -> openapi.v2.NamedAny - 1, // 43: openapi.v2.NamedAny.value:type_name -> openapi.v2.Any - 13, // 44: openapi.v2.NamedHeader.value:type_name -> openapi.v2.Header - 37, // 45: openapi.v2.NamedParameter.value:type_name -> openapi.v2.Parameter - 40, // 46: openapi.v2.NamedPathItem.value:type_name -> openapi.v2.PathItem - 46, // 47: openapi.v2.NamedResponse.value:type_name -> openapi.v2.Response - 48, // 48: openapi.v2.NamedResponseValue.value:type_name -> openapi.v2.ResponseValue - 50, // 49: openapi.v2.NamedSchema.value:type_name -> openapi.v2.Schema - 53, // 50: openapi.v2.NamedSecurityDefinitionsItem.value:type_name -> openapi.v2.SecurityDefinitionsItem - 55, // 51: openapi.v2.NamedStringArray.value:type_name -> openapi.v2.StringArray - 14, // 52: openapi.v2.NonBodyParameter.header_parameter_sub_schema:type_name -> openapi.v2.HeaderParameterSubSchema - 12, // 53: openapi.v2.NonBodyParameter.form_data_parameter_sub_schema:type_name -> openapi.v2.FormDataParameterSubSchema - 45, // 54: openapi.v2.NonBodyParameter.query_parameter_sub_schema:type_name -> openapi.v2.QueryParameterSubSchema - 41, // 55: openapi.v2.NonBodyParameter.path_parameter_sub_schema:type_name -> openapi.v2.PathParameterSubSchema - 35, // 56: openapi.v2.Oauth2AccessCodeSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes - 20, // 57: openapi.v2.Oauth2AccessCodeSecurity.vendor_extension:type_name -> openapi.v2.NamedAny - 35, // 58: openapi.v2.Oauth2ApplicationSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes - 20, // 59: openapi.v2.Oauth2ApplicationSecurity.vendor_extension:type_name -> openapi.v2.NamedAny - 35, // 60: openapi.v2.Oauth2ImplicitSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes - 20, // 61: openapi.v2.Oauth2ImplicitSecurity.vendor_extension:type_name -> openapi.v2.NamedAny - 35, // 62: openapi.v2.Oauth2PasswordSecurity.scopes:type_name -> openapi.v2.Oauth2Scopes - 20, // 63: openapi.v2.Oauth2PasswordSecurity.vendor_extension:type_name -> openapi.v2.NamedAny - 28, // 64: openapi.v2.Oauth2Scopes.additional_properties:type_name -> openapi.v2.NamedString - 10, // 65: openapi.v2.Operation.external_docs:type_name -> openapi.v2.ExternalDocs - 39, // 66: openapi.v2.Operation.parameters:type_name -> openapi.v2.ParametersItem - 49, // 67: openapi.v2.Operation.responses:type_name -> openapi.v2.Responses - 54, // 68: openapi.v2.Operation.security:type_name -> openapi.v2.SecurityRequirement - 20, // 69: openapi.v2.Operation.vendor_extension:type_name -> openapi.v2.NamedAny - 4, // 70: openapi.v2.Parameter.body_parameter:type_name -> openapi.v2.BodyParameter - 30, // 71: openapi.v2.Parameter.non_body_parameter:type_name -> openapi.v2.NonBodyParameter - 22, // 72: openapi.v2.ParameterDefinitions.additional_properties:type_name -> openapi.v2.NamedParameter - 37, // 73: openapi.v2.ParametersItem.parameter:type_name -> openapi.v2.Parameter - 18, // 74: openapi.v2.ParametersItem.json_reference:type_name -> openapi.v2.JsonReference - 36, // 75: openapi.v2.PathItem.get:type_name -> openapi.v2.Operation - 36, // 76: openapi.v2.PathItem.put:type_name -> openapi.v2.Operation - 36, // 77: openapi.v2.PathItem.post:type_name -> openapi.v2.Operation - 36, // 78: openapi.v2.PathItem.delete:type_name -> openapi.v2.Operation - 36, // 79: openapi.v2.PathItem.options:type_name -> openapi.v2.Operation - 36, // 80: openapi.v2.PathItem.head:type_name -> openapi.v2.Operation - 36, // 81: openapi.v2.PathItem.patch:type_name -> openapi.v2.Operation - 39, // 82: openapi.v2.PathItem.parameters:type_name -> openapi.v2.ParametersItem - 20, // 83: openapi.v2.PathItem.vendor_extension:type_name -> openapi.v2.NamedAny - 43, // 84: openapi.v2.PathParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems - 1, // 85: openapi.v2.PathParameterSubSchema.default:type_name -> openapi.v2.Any - 1, // 86: openapi.v2.PathParameterSubSchema.enum:type_name -> openapi.v2.Any - 20, // 87: openapi.v2.PathParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny - 20, // 88: openapi.v2.Paths.vendor_extension:type_name -> openapi.v2.NamedAny - 23, // 89: openapi.v2.Paths.path:type_name -> openapi.v2.NamedPathItem - 43, // 90: openapi.v2.PrimitivesItems.items:type_name -> openapi.v2.PrimitivesItems - 1, // 91: openapi.v2.PrimitivesItems.default:type_name -> openapi.v2.Any - 1, // 92: openapi.v2.PrimitivesItems.enum:type_name -> openapi.v2.Any - 20, // 93: openapi.v2.PrimitivesItems.vendor_extension:type_name -> openapi.v2.NamedAny - 26, // 94: openapi.v2.Properties.additional_properties:type_name -> openapi.v2.NamedSchema - 43, // 95: openapi.v2.QueryParameterSubSchema.items:type_name -> openapi.v2.PrimitivesItems - 1, // 96: openapi.v2.QueryParameterSubSchema.default:type_name -> openapi.v2.Any - 1, // 97: openapi.v2.QueryParameterSubSchema.enum:type_name -> openapi.v2.Any - 20, // 98: openapi.v2.QueryParameterSubSchema.vendor_extension:type_name -> openapi.v2.NamedAny - 51, // 99: openapi.v2.Response.schema:type_name -> openapi.v2.SchemaItem - 15, // 100: openapi.v2.Response.headers:type_name -> openapi.v2.Headers - 9, // 101: openapi.v2.Response.examples:type_name -> openapi.v2.Examples - 20, // 102: openapi.v2.Response.vendor_extension:type_name -> openapi.v2.NamedAny - 24, // 103: openapi.v2.ResponseDefinitions.additional_properties:type_name -> openapi.v2.NamedResponse - 46, // 104: openapi.v2.ResponseValue.response:type_name -> openapi.v2.Response - 18, // 105: openapi.v2.ResponseValue.json_reference:type_name -> openapi.v2.JsonReference - 25, // 106: openapi.v2.Responses.response_code:type_name -> openapi.v2.NamedResponseValue - 20, // 107: openapi.v2.Responses.vendor_extension:type_name -> openapi.v2.NamedAny - 1, // 108: openapi.v2.Schema.default:type_name -> openapi.v2.Any - 1, // 109: openapi.v2.Schema.enum:type_name -> openapi.v2.Any - 0, // 110: openapi.v2.Schema.additional_properties:type_name -> openapi.v2.AdditionalPropertiesItem - 57, // 111: openapi.v2.Schema.type:type_name -> openapi.v2.TypeItem - 17, // 112: openapi.v2.Schema.items:type_name -> openapi.v2.ItemsItem - 50, // 113: openapi.v2.Schema.all_of:type_name -> openapi.v2.Schema - 44, // 114: openapi.v2.Schema.properties:type_name -> openapi.v2.Properties - 59, // 115: openapi.v2.Schema.xml:type_name -> openapi.v2.Xml - 10, // 116: openapi.v2.Schema.external_docs:type_name -> openapi.v2.ExternalDocs - 1, // 117: openapi.v2.Schema.example:type_name -> openapi.v2.Any - 20, // 118: openapi.v2.Schema.vendor_extension:type_name -> openapi.v2.NamedAny - 50, // 119: openapi.v2.SchemaItem.schema:type_name -> openapi.v2.Schema - 11, // 120: openapi.v2.SchemaItem.file_schema:type_name -> openapi.v2.FileSchema - 27, // 121: openapi.v2.SecurityDefinitions.additional_properties:type_name -> openapi.v2.NamedSecurityDefinitionsItem - 3, // 122: openapi.v2.SecurityDefinitionsItem.basic_authentication_security:type_name -> openapi.v2.BasicAuthenticationSecurity - 2, // 123: openapi.v2.SecurityDefinitionsItem.api_key_security:type_name -> openapi.v2.ApiKeySecurity - 33, // 124: openapi.v2.SecurityDefinitionsItem.oauth2_implicit_security:type_name -> openapi.v2.Oauth2ImplicitSecurity - 34, // 125: openapi.v2.SecurityDefinitionsItem.oauth2_password_security:type_name -> openapi.v2.Oauth2PasswordSecurity - 32, // 126: openapi.v2.SecurityDefinitionsItem.oauth2_application_security:type_name -> openapi.v2.Oauth2ApplicationSecurity - 31, // 127: openapi.v2.SecurityDefinitionsItem.oauth2_access_code_security:type_name -> openapi.v2.Oauth2AccessCodeSecurity - 29, // 128: openapi.v2.SecurityRequirement.additional_properties:type_name -> openapi.v2.NamedStringArray - 10, // 129: openapi.v2.Tag.external_docs:type_name -> openapi.v2.ExternalDocs - 20, // 130: openapi.v2.Tag.vendor_extension:type_name -> openapi.v2.NamedAny - 20, // 131: openapi.v2.VendorExtension.additional_properties:type_name -> openapi.v2.NamedAny - 20, // 132: openapi.v2.Xml.vendor_extension:type_name -> openapi.v2.NamedAny - 133, // [133:133] is the sub-list for method output_type - 133, // [133:133] is the sub-list for method input_type - 133, // [133:133] is the sub-list for extension type_name - 133, // [133:133] is the sub-list for extension extendee - 0, // [0:133] is the sub-list for field type_name -} - -func init() { file_openapiv2_OpenAPIv2_proto_init() } -func file_openapiv2_OpenAPIv2_proto_init() { - if File_openapiv2_OpenAPIv2_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_openapiv2_OpenAPIv2_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AdditionalPropertiesItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Any); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApiKeySecurity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BasicAuthenticationSecurity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BodyParameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Contact); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Default); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Definitions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Document); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Examples); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExternalDocs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileSchema); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FormDataParameterSubSchema); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeaderParameterSubSchema); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Headers); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ItemsItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JsonReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*License); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedAny); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedHeader); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedParameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedPathItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedResponseValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedSchema); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedSecurityDefinitionsItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedString); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedStringArray); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NonBodyParameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Oauth2AccessCodeSecurity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Oauth2ApplicationSecurity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Oauth2ImplicitSecurity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Oauth2PasswordSecurity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Oauth2Scopes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Parameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParameterDefinitions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParametersItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PathItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PathParameterSubSchema); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Paths); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimitivesItems); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Properties); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryParameterSubSchema); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Response); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseDefinitions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Responses); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Schema); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SchemaItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityDefinitions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityDefinitionsItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityRequirement); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StringArray); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Tag); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TypeItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VendorExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Xml); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_openapiv2_OpenAPIv2_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*AdditionalPropertiesItem_Schema)(nil), - (*AdditionalPropertiesItem_Boolean)(nil), - } - file_openapiv2_OpenAPIv2_proto_msgTypes[30].OneofWrappers = []interface{}{ - (*NonBodyParameter_HeaderParameterSubSchema)(nil), - (*NonBodyParameter_FormDataParameterSubSchema)(nil), - (*NonBodyParameter_QueryParameterSubSchema)(nil), - (*NonBodyParameter_PathParameterSubSchema)(nil), - } - file_openapiv2_OpenAPIv2_proto_msgTypes[37].OneofWrappers = []interface{}{ - (*Parameter_BodyParameter)(nil), - (*Parameter_NonBodyParameter)(nil), - } - file_openapiv2_OpenAPIv2_proto_msgTypes[39].OneofWrappers = []interface{}{ - (*ParametersItem_Parameter)(nil), - (*ParametersItem_JsonReference)(nil), - } - file_openapiv2_OpenAPIv2_proto_msgTypes[48].OneofWrappers = []interface{}{ - (*ResponseValue_Response)(nil), - (*ResponseValue_JsonReference)(nil), - } - file_openapiv2_OpenAPIv2_proto_msgTypes[51].OneofWrappers = []interface{}{ - (*SchemaItem_Schema)(nil), - (*SchemaItem_FileSchema)(nil), - } - file_openapiv2_OpenAPIv2_proto_msgTypes[53].OneofWrappers = []interface{}{ - (*SecurityDefinitionsItem_BasicAuthenticationSecurity)(nil), - (*SecurityDefinitionsItem_ApiKeySecurity)(nil), - (*SecurityDefinitionsItem_Oauth2ImplicitSecurity)(nil), - (*SecurityDefinitionsItem_Oauth2PasswordSecurity)(nil), - (*SecurityDefinitionsItem_Oauth2ApplicationSecurity)(nil), - (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_openapiv2_OpenAPIv2_proto_rawDesc, - NumEnums: 0, - NumMessages: 60, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_openapiv2_OpenAPIv2_proto_goTypes, - DependencyIndexes: file_openapiv2_OpenAPIv2_proto_depIdxs, - MessageInfos: file_openapiv2_OpenAPIv2_proto_msgTypes, - }.Build() - File_openapiv2_OpenAPIv2_proto = out.File - file_openapiv2_OpenAPIv2_proto_rawDesc = nil - file_openapiv2_OpenAPIv2_proto_goTypes = nil - file_openapiv2_OpenAPIv2_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.proto b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.proto deleted file mode 100644 index 1c59b2f4ae13..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/OpenAPIv2.proto +++ /dev/null @@ -1,666 +0,0 @@ -// Copyright 2020 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// THIS FILE IS AUTOMATICALLY GENERATED. - -syntax = "proto3"; - -package openapi.v2; - -import "google/protobuf/any.proto"; - -// This option lets the proto compiler generate Java code inside the package -// name (see below) instead of inside an outer class. It creates a simpler -// developer experience by reducing one-level of name nesting and be -// consistent with most programming languages that don't support outer classes. -option java_multiple_files = true; - -// The Java outer classname should be the filename in UpperCamelCase. This -// class is only used to hold proto descriptor, so developers don't need to -// work with it directly. -option java_outer_classname = "OpenAPIProto"; - -// The Java package name must be proto package name with proper prefix. -option java_package = "org.openapi_v2"; - -// A reasonable prefix for the Objective-C symbols generated from the package. -// It should at a minimum be 3 characters long, all uppercase, and convention -// is to use an abbreviation of the package name. Something short, but -// hopefully unique enough to not conflict with things that may come along in -// the future. 'GPB' is reserved for the protocol buffer implementation itself. -option objc_class_prefix = "OAS"; - -// The Go package name. -option go_package = "./openapiv2;openapi_v2"; - -message AdditionalPropertiesItem { - oneof oneof { - Schema schema = 1; - bool boolean = 2; - } -} - -message Any { - google.protobuf.Any value = 1; - string yaml = 2; -} - -message ApiKeySecurity { - string type = 1; - string name = 2; - string in = 3; - string description = 4; - repeated NamedAny vendor_extension = 5; -} - -message BasicAuthenticationSecurity { - string type = 1; - string description = 2; - repeated NamedAny vendor_extension = 3; -} - -message BodyParameter { - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 1; - // The name of the parameter. - string name = 2; - // Determines the location of the parameter. - string in = 3; - // Determines whether or not this parameter is required or optional. - bool required = 4; - Schema schema = 5; - repeated NamedAny vendor_extension = 6; -} - -// Contact information for the owners of the API. -message Contact { - // The identifying name of the contact person/organization. - string name = 1; - // The URL pointing to the contact information. - string url = 2; - // The email address of the contact person/organization. - string email = 3; - repeated NamedAny vendor_extension = 4; -} - -message Default { - repeated NamedAny additional_properties = 1; -} - -// One or more JSON objects describing the schemas being consumed and produced by the API. -message Definitions { - repeated NamedSchema additional_properties = 1; -} - -message Document { - // The Swagger version of this document. - string swagger = 1; - Info info = 2; - // The host (name or ip) of the API. Example: 'swagger.io' - string host = 3; - // The base path to the API. Example: '/api'. - string base_path = 4; - // The transfer protocol of the API. - repeated string schemes = 5; - // A list of MIME types accepted by the API. - repeated string consumes = 6; - // A list of MIME types the API can produce. - repeated string produces = 7; - Paths paths = 8; - Definitions definitions = 9; - ParameterDefinitions parameters = 10; - ResponseDefinitions responses = 11; - repeated SecurityRequirement security = 12; - SecurityDefinitions security_definitions = 13; - repeated Tag tags = 14; - ExternalDocs external_docs = 15; - repeated NamedAny vendor_extension = 16; -} - -message Examples { - repeated NamedAny additional_properties = 1; -} - -// information about external documentation -message ExternalDocs { - string description = 1; - string url = 2; - repeated NamedAny vendor_extension = 3; -} - -// A deterministic version of a JSON Schema object. -message FileSchema { - string format = 1; - string title = 2; - string description = 3; - Any default = 4; - repeated string required = 5; - string type = 6; - bool read_only = 7; - ExternalDocs external_docs = 8; - Any example = 9; - repeated NamedAny vendor_extension = 10; -} - -message FormDataParameterSubSchema { - // Determines whether or not this parameter is required or optional. - bool required = 1; - // Determines the location of the parameter. - string in = 2; - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 3; - // The name of the parameter. - string name = 4; - // allows sending a parameter by name only or with an empty value. - bool allow_empty_value = 5; - string type = 6; - string format = 7; - PrimitivesItems items = 8; - string collection_format = 9; - Any default = 10; - double maximum = 11; - bool exclusive_maximum = 12; - double minimum = 13; - bool exclusive_minimum = 14; - int64 max_length = 15; - int64 min_length = 16; - string pattern = 17; - int64 max_items = 18; - int64 min_items = 19; - bool unique_items = 20; - repeated Any enum = 21; - double multiple_of = 22; - repeated NamedAny vendor_extension = 23; -} - -message Header { - string type = 1; - string format = 2; - PrimitivesItems items = 3; - string collection_format = 4; - Any default = 5; - double maximum = 6; - bool exclusive_maximum = 7; - double minimum = 8; - bool exclusive_minimum = 9; - int64 max_length = 10; - int64 min_length = 11; - string pattern = 12; - int64 max_items = 13; - int64 min_items = 14; - bool unique_items = 15; - repeated Any enum = 16; - double multiple_of = 17; - string description = 18; - repeated NamedAny vendor_extension = 19; -} - -message HeaderParameterSubSchema { - // Determines whether or not this parameter is required or optional. - bool required = 1; - // Determines the location of the parameter. - string in = 2; - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 3; - // The name of the parameter. - string name = 4; - string type = 5; - string format = 6; - PrimitivesItems items = 7; - string collection_format = 8; - Any default = 9; - double maximum = 10; - bool exclusive_maximum = 11; - double minimum = 12; - bool exclusive_minimum = 13; - int64 max_length = 14; - int64 min_length = 15; - string pattern = 16; - int64 max_items = 17; - int64 min_items = 18; - bool unique_items = 19; - repeated Any enum = 20; - double multiple_of = 21; - repeated NamedAny vendor_extension = 22; -} - -message Headers { - repeated NamedHeader additional_properties = 1; -} - -// General information about the API. -message Info { - // A unique and precise title of the API. - string title = 1; - // A semantic version number of the API. - string version = 2; - // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. - string description = 3; - // The terms of service for the API. - string terms_of_service = 4; - Contact contact = 5; - License license = 6; - repeated NamedAny vendor_extension = 7; -} - -message ItemsItem { - repeated Schema schema = 1; -} - -message JsonReference { - string _ref = 1; - string description = 2; -} - -message License { - // The name of the license type. It's encouraged to use an OSI compatible license. - string name = 1; - // The URL pointing to the license. - string url = 2; - repeated NamedAny vendor_extension = 3; -} - -// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. -message NamedAny { - // Map key - string name = 1; - // Mapped value - Any value = 2; -} - -// Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. -message NamedHeader { - // Map key - string name = 1; - // Mapped value - Header value = 2; -} - -// Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. -message NamedParameter { - // Map key - string name = 1; - // Mapped value - Parameter value = 2; -} - -// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. -message NamedPathItem { - // Map key - string name = 1; - // Mapped value - PathItem value = 2; -} - -// Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. -message NamedResponse { - // Map key - string name = 1; - // Mapped value - Response value = 2; -} - -// Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. -message NamedResponseValue { - // Map key - string name = 1; - // Mapped value - ResponseValue value = 2; -} - -// Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. -message NamedSchema { - // Map key - string name = 1; - // Mapped value - Schema value = 2; -} - -// Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. -message NamedSecurityDefinitionsItem { - // Map key - string name = 1; - // Mapped value - SecurityDefinitionsItem value = 2; -} - -// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. -message NamedString { - // Map key - string name = 1; - // Mapped value - string value = 2; -} - -// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. -message NamedStringArray { - // Map key - string name = 1; - // Mapped value - StringArray value = 2; -} - -message NonBodyParameter { - oneof oneof { - HeaderParameterSubSchema header_parameter_sub_schema = 1; - FormDataParameterSubSchema form_data_parameter_sub_schema = 2; - QueryParameterSubSchema query_parameter_sub_schema = 3; - PathParameterSubSchema path_parameter_sub_schema = 4; - } -} - -message Oauth2AccessCodeSecurity { - string type = 1; - string flow = 2; - Oauth2Scopes scopes = 3; - string authorization_url = 4; - string token_url = 5; - string description = 6; - repeated NamedAny vendor_extension = 7; -} - -message Oauth2ApplicationSecurity { - string type = 1; - string flow = 2; - Oauth2Scopes scopes = 3; - string token_url = 4; - string description = 5; - repeated NamedAny vendor_extension = 6; -} - -message Oauth2ImplicitSecurity { - string type = 1; - string flow = 2; - Oauth2Scopes scopes = 3; - string authorization_url = 4; - string description = 5; - repeated NamedAny vendor_extension = 6; -} - -message Oauth2PasswordSecurity { - string type = 1; - string flow = 2; - Oauth2Scopes scopes = 3; - string token_url = 4; - string description = 5; - repeated NamedAny vendor_extension = 6; -} - -message Oauth2Scopes { - repeated NamedString additional_properties = 1; -} - -message Operation { - repeated string tags = 1; - // A brief summary of the operation. - string summary = 2; - // A longer description of the operation, GitHub Flavored Markdown is allowed. - string description = 3; - ExternalDocs external_docs = 4; - // A unique identifier of the operation. - string operation_id = 5; - // A list of MIME types the API can produce. - repeated string produces = 6; - // A list of MIME types the API can consume. - repeated string consumes = 7; - // The parameters needed to send a valid API call. - repeated ParametersItem parameters = 8; - Responses responses = 9; - // The transfer protocol of the API. - repeated string schemes = 10; - bool deprecated = 11; - repeated SecurityRequirement security = 12; - repeated NamedAny vendor_extension = 13; -} - -message Parameter { - oneof oneof { - BodyParameter body_parameter = 1; - NonBodyParameter non_body_parameter = 2; - } -} - -// One or more JSON representations for parameters -message ParameterDefinitions { - repeated NamedParameter additional_properties = 1; -} - -message ParametersItem { - oneof oneof { - Parameter parameter = 1; - JsonReference json_reference = 2; - } -} - -message PathItem { - string _ref = 1; - Operation get = 2; - Operation put = 3; - Operation post = 4; - Operation delete = 5; - Operation options = 6; - Operation head = 7; - Operation patch = 8; - // The parameters needed to send a valid API call. - repeated ParametersItem parameters = 9; - repeated NamedAny vendor_extension = 10; -} - -message PathParameterSubSchema { - // Determines whether or not this parameter is required or optional. - bool required = 1; - // Determines the location of the parameter. - string in = 2; - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 3; - // The name of the parameter. - string name = 4; - string type = 5; - string format = 6; - PrimitivesItems items = 7; - string collection_format = 8; - Any default = 9; - double maximum = 10; - bool exclusive_maximum = 11; - double minimum = 12; - bool exclusive_minimum = 13; - int64 max_length = 14; - int64 min_length = 15; - string pattern = 16; - int64 max_items = 17; - int64 min_items = 18; - bool unique_items = 19; - repeated Any enum = 20; - double multiple_of = 21; - repeated NamedAny vendor_extension = 22; -} - -// Relative paths to the individual endpoints. They must be relative to the 'basePath'. -message Paths { - repeated NamedAny vendor_extension = 1; - repeated NamedPathItem path = 2; -} - -message PrimitivesItems { - string type = 1; - string format = 2; - PrimitivesItems items = 3; - string collection_format = 4; - Any default = 5; - double maximum = 6; - bool exclusive_maximum = 7; - double minimum = 8; - bool exclusive_minimum = 9; - int64 max_length = 10; - int64 min_length = 11; - string pattern = 12; - int64 max_items = 13; - int64 min_items = 14; - bool unique_items = 15; - repeated Any enum = 16; - double multiple_of = 17; - repeated NamedAny vendor_extension = 18; -} - -message Properties { - repeated NamedSchema additional_properties = 1; -} - -message QueryParameterSubSchema { - // Determines whether or not this parameter is required or optional. - bool required = 1; - // Determines the location of the parameter. - string in = 2; - // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. - string description = 3; - // The name of the parameter. - string name = 4; - // allows sending a parameter by name only or with an empty value. - bool allow_empty_value = 5; - string type = 6; - string format = 7; - PrimitivesItems items = 8; - string collection_format = 9; - Any default = 10; - double maximum = 11; - bool exclusive_maximum = 12; - double minimum = 13; - bool exclusive_minimum = 14; - int64 max_length = 15; - int64 min_length = 16; - string pattern = 17; - int64 max_items = 18; - int64 min_items = 19; - bool unique_items = 20; - repeated Any enum = 21; - double multiple_of = 22; - repeated NamedAny vendor_extension = 23; -} - -message Response { - string description = 1; - SchemaItem schema = 2; - Headers headers = 3; - Examples examples = 4; - repeated NamedAny vendor_extension = 5; -} - -// One or more JSON representations for responses -message ResponseDefinitions { - repeated NamedResponse additional_properties = 1; -} - -message ResponseValue { - oneof oneof { - Response response = 1; - JsonReference json_reference = 2; - } -} - -// Response objects names can either be any valid HTTP status code or 'default'. -message Responses { - repeated NamedResponseValue response_code = 1; - repeated NamedAny vendor_extension = 2; -} - -// A deterministic version of a JSON Schema object. -message Schema { - string _ref = 1; - string format = 2; - string title = 3; - string description = 4; - Any default = 5; - double multiple_of = 6; - double maximum = 7; - bool exclusive_maximum = 8; - double minimum = 9; - bool exclusive_minimum = 10; - int64 max_length = 11; - int64 min_length = 12; - string pattern = 13; - int64 max_items = 14; - int64 min_items = 15; - bool unique_items = 16; - int64 max_properties = 17; - int64 min_properties = 18; - repeated string required = 19; - repeated Any enum = 20; - AdditionalPropertiesItem additional_properties = 21; - TypeItem type = 22; - ItemsItem items = 23; - repeated Schema all_of = 24; - Properties properties = 25; - string discriminator = 26; - bool read_only = 27; - Xml xml = 28; - ExternalDocs external_docs = 29; - Any example = 30; - repeated NamedAny vendor_extension = 31; -} - -message SchemaItem { - oneof oneof { - Schema schema = 1; - FileSchema file_schema = 2; - } -} - -message SecurityDefinitions { - repeated NamedSecurityDefinitionsItem additional_properties = 1; -} - -message SecurityDefinitionsItem { - oneof oneof { - BasicAuthenticationSecurity basic_authentication_security = 1; - ApiKeySecurity api_key_security = 2; - Oauth2ImplicitSecurity oauth2_implicit_security = 3; - Oauth2PasswordSecurity oauth2_password_security = 4; - Oauth2ApplicationSecurity oauth2_application_security = 5; - Oauth2AccessCodeSecurity oauth2_access_code_security = 6; - } -} - -message SecurityRequirement { - repeated NamedStringArray additional_properties = 1; -} - -message StringArray { - repeated string value = 1; -} - -message Tag { - string name = 1; - string description = 2; - ExternalDocs external_docs = 3; - repeated NamedAny vendor_extension = 4; -} - -message TypeItem { - repeated string value = 1; -} - -// Any property starting with x- is valid. -message VendorExtension { - repeated NamedAny additional_properties = 1; -} - -message Xml { - string name = 1; - string namespace = 2; - string prefix = 3; - bool attribute = 4; - bool wrapped = 5; - repeated NamedAny vendor_extension = 6; -} - diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/README.md b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/README.md deleted file mode 100644 index 5276128d3b8e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# OpenAPI v2 Protocol Buffer Models - -This directory contains a Protocol Buffer-language model and related code for -supporting OpenAPI v2. - -Gnostic applications and plugins can use OpenAPIv2.proto to generate Protocol -Buffer support code for their preferred languages. - -OpenAPIv2.go is used by Gnostic to read JSON and YAML OpenAPI descriptions into -the Protocol Buffer-based datastructures generated from OpenAPIv2.proto. - -OpenAPIv2.proto and OpenAPIv2.go are generated by the Gnostic compiler -generator, and OpenAPIv2.pb.go is generated by protoc, the Protocol Buffer -compiler, and protoc-gen-go, the Protocol Buffer Go code generation plugin. diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/document.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/document.go deleted file mode 100644 index e96ac0d6dac2..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/document.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 openapi_v2 - -import ( - "gopkg.in/yaml.v3" - - "github.com/google/gnostic-models/compiler" -) - -// ParseDocument reads an OpenAPI v2 description from a YAML/JSON representation. -func ParseDocument(b []byte) (*Document, error) { - info, err := compiler.ReadInfoFromBytes("", b) - if err != nil { - return nil, err - } - root := info.Content[0] - return NewDocument(root, compiler.NewContextWithExtensions("$root", root, nil, nil)) -} - -// YAMLValue produces a serialized YAML representation of the document. -func (d *Document) YAMLValue(comment string) ([]byte, error) { - rawInfo := d.ToRawInfo() - rawInfo = &yaml.Node{ - Kind: yaml.DocumentNode, - Content: []*yaml.Node{rawInfo}, - HeadComment: comment, - } - return yaml.Marshal(rawInfo) -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/openapi-2.0.json b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/openapi-2.0.json deleted file mode 100644 index afa12b79b8fe..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv2/openapi-2.0.json +++ /dev/null @@ -1,1610 +0,0 @@ -{ - "title": "A JSON Schema for Swagger 2.0 API.", - "id": "http://swagger.io/v2/schema.json#", - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": [ - "swagger", - "info", - "paths" - ], - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "swagger": { - "type": "string", - "enum": [ - "2.0" - ], - "description": "The Swagger version of this document." - }, - "info": { - "$ref": "#/definitions/info" - }, - "host": { - "type": "string", - "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$", - "description": "The host (name or ip) of the API. Example: 'swagger.io'" - }, - "basePath": { - "type": "string", - "pattern": "^/", - "description": "The base path to the API. Example: '/api'." - }, - "schemes": { - "$ref": "#/definitions/schemesList" - }, - "consumes": { - "description": "A list of MIME types accepted by the API.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "produces": { - "description": "A list of MIME types the API can produce.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "paths": { - "$ref": "#/definitions/paths" - }, - "definitions": { - "$ref": "#/definitions/definitions" - }, - "parameters": { - "$ref": "#/definitions/parameterDefinitions" - }, - "responses": { - "$ref": "#/definitions/responseDefinitions" - }, - "security": { - "$ref": "#/definitions/security" - }, - "securityDefinitions": { - "$ref": "#/definitions/securityDefinitions" - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/tag" - }, - "uniqueItems": true - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - } - }, - "definitions": { - "info": { - "type": "object", - "description": "General information about the API.", - "required": [ - "version", - "title" - ], - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "title": { - "type": "string", - "description": "A unique and precise title of the API." - }, - "version": { - "type": "string", - "description": "A semantic version number of the API." - }, - "description": { - "type": "string", - "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed." - }, - "termsOfService": { - "type": "string", - "description": "The terms of service for the API." - }, - "contact": { - "$ref": "#/definitions/contact" - }, - "license": { - "$ref": "#/definitions/license" - } - } - }, - "contact": { - "type": "object", - "description": "Contact information for the owners of the API.", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "description": "The identifying name of the contact person/organization." - }, - "url": { - "type": "string", - "description": "The URL pointing to the contact information.", - "format": "uri" - }, - "email": { - "type": "string", - "description": "The email address of the contact person/organization.", - "format": "email" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "license": { - "type": "object", - "required": [ - "name" - ], - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "description": "The name of the license type. It's encouraged to use an OSI compatible license." - }, - "url": { - "type": "string", - "description": "The URL pointing to the license.", - "format": "uri" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "paths": { - "type": "object", - "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - }, - "^/": { - "$ref": "#/definitions/pathItem" - } - }, - "additionalProperties": false - }, - "definitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schema" - }, - "description": "One or more JSON objects describing the schemas being consumed and produced by the API." - }, - "parameterDefinitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/parameter" - }, - "description": "One or more JSON representations for parameters" - }, - "responseDefinitions": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/response" - }, - "description": "One or more JSON representations for responses" - }, - "externalDocs": { - "type": "object", - "additionalProperties": false, - "description": "information about external documentation", - "required": [ - "url" - ], - "properties": { - "description": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "examples": { - "type": "object", - "additionalProperties": true - }, - "mimeType": { - "type": "string", - "description": "The MIME type of the HTTP message." - }, - "operation": { - "type": "object", - "required": [ - "responses" - ], - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - }, - "summary": { - "type": "string", - "description": "A brief summary of the operation." - }, - "description": { - "type": "string", - "description": "A longer description of the operation, GitHub Flavored Markdown is allowed." - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "operationId": { - "type": "string", - "description": "A unique identifier of the operation." - }, - "produces": { - "description": "A list of MIME types the API can produce.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "consumes": { - "description": "A list of MIME types the API can consume.", - "allOf": [ - { - "$ref": "#/definitions/mediaTypeList" - } - ] - }, - "parameters": { - "$ref": "#/definitions/parametersList" - }, - "responses": { - "$ref": "#/definitions/responses" - }, - "schemes": { - "$ref": "#/definitions/schemesList" - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "security": { - "$ref": "#/definitions/security" - } - } - }, - "pathItem": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "$ref": { - "type": "string" - }, - "get": { - "$ref": "#/definitions/operation" - }, - "put": { - "$ref": "#/definitions/operation" - }, - "post": { - "$ref": "#/definitions/operation" - }, - "delete": { - "$ref": "#/definitions/operation" - }, - "options": { - "$ref": "#/definitions/operation" - }, - "head": { - "$ref": "#/definitions/operation" - }, - "patch": { - "$ref": "#/definitions/operation" - }, - "parameters": { - "$ref": "#/definitions/parametersList" - } - } - }, - "responses": { - "type": "object", - "description": "Response objects names can either be any valid HTTP status code or 'default'.", - "minProperties": 1, - "additionalProperties": false, - "patternProperties": { - "^([0-9]{3})$|^(default)$": { - "$ref": "#/definitions/responseValue" - }, - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "not": { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - } - }, - "responseValue": { - "oneOf": [ - { - "$ref": "#/definitions/response" - }, - { - "$ref": "#/definitions/jsonReference" - } - ] - }, - "response": { - "type": "object", - "required": [ - "description" - ], - "properties": { - "description": { - "type": "string" - }, - "schema": { - "oneOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "$ref": "#/definitions/fileSchema" - } - ] - }, - "headers": { - "$ref": "#/definitions/headers" - }, - "examples": { - "$ref": "#/definitions/examples" - } - }, - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "headers": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/header" - } - }, - "header": { - "type": "object", - "additionalProperties": false, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "integer", - "boolean", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "vendorExtension": { - "description": "Any property starting with x- is valid.", - "additionalProperties": true, - "additionalItems": true - }, - "bodyParameter": { - "type": "object", - "required": [ - "name", - "in", - "schema" - ], - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "body" - ] - }, - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "schema": { - "$ref": "#/definitions/schema" - } - }, - "additionalProperties": false - }, - "headerParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "header" - ] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "type": { - "type": "string", - "enum": [ - "string", - "number", - "boolean", - "integer", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "queryParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "query" - ] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "allowEmptyValue": { - "type": "boolean", - "default": false, - "description": "allows sending a parameter by name only or with an empty value." - }, - "type": { - "type": "string", - "enum": [ - "string", - "number", - "boolean", - "integer", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormatWithMulti" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "formDataParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "required": { - "type": "boolean", - "description": "Determines whether or not this parameter is required or optional.", - "default": false - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "formData" - ] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "allowEmptyValue": { - "type": "boolean", - "default": false, - "description": "allows sending a parameter by name only or with an empty value." - }, - "type": { - "type": "string", - "enum": [ - "string", - "number", - "boolean", - "integer", - "array", - "file" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormatWithMulti" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "pathParameterSubSchema": { - "additionalProperties": false, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "required": [ - "required" - ], - "properties": { - "required": { - "type": "boolean", - "enum": [ - true - ], - "description": "Determines whether or not this parameter is required or optional." - }, - "in": { - "type": "string", - "description": "Determines the location of the parameter.", - "enum": [ - "path" - ] - }, - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "name": { - "type": "string", - "description": "The name of the parameter." - }, - "type": { - "type": "string", - "enum": [ - "string", - "number", - "boolean", - "integer", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - } - }, - "nonBodyParameter": { - "type": "object", - "required": [ - "name", - "in", - "type" - ], - "oneOf": [ - { - "$ref": "#/definitions/headerParameterSubSchema" - }, - { - "$ref": "#/definitions/formDataParameterSubSchema" - }, - { - "$ref": "#/definitions/queryParameterSubSchema" - }, - { - "$ref": "#/definitions/pathParameterSubSchema" - } - ] - }, - "parameter": { - "oneOf": [ - { - "$ref": "#/definitions/bodyParameter" - }, - { - "$ref": "#/definitions/nonBodyParameter" - } - ] - }, - "schema": { - "type": "object", - "description": "A deterministic version of a JSON Schema object.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "properties": { - "$ref": { - "type": "string" - }, - "format": { - "type": "string" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "multipleOf": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" - }, - "maximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" - }, - "exclusiveMaximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" - }, - "minimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" - }, - "exclusiveMinimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" - }, - "maxLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "pattern": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" - }, - "maxItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "uniqueItems": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" - }, - "maxProperties": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minProperties": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "required": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" - }, - "enum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" - }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "type": "boolean" - } - ], - "default": {} - }, - "type": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/type" - }, - "items": { - "anyOf": [ - { - "$ref": "#/definitions/schema" - }, - { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/schema" - } - } - ], - "default": {} - }, - "allOf": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/schema" - } - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schema" - }, - "default": {} - }, - "discriminator": { - "type": "string" - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "xml": { - "$ref": "#/definitions/xml" - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "example": {} - }, - "additionalProperties": false - }, - "fileSchema": { - "type": "object", - "description": "A deterministic version of a JSON Schema object.", - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - }, - "required": [ - "type" - ], - "properties": { - "format": { - "type": "string" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "required": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" - }, - "type": { - "type": "string", - "enum": [ - "file" - ] - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - }, - "example": {} - }, - "additionalProperties": false - }, - "primitivesItems": { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "integer", - "boolean", - "array" - ] - }, - "format": { - "type": "string" - }, - "items": { - "$ref": "#/definitions/primitivesItems" - }, - "collectionFormat": { - "$ref": "#/definitions/collectionFormat" - }, - "default": { - "$ref": "#/definitions/default" - }, - "maximum": { - "$ref": "#/definitions/maximum" - }, - "exclusiveMaximum": { - "$ref": "#/definitions/exclusiveMaximum" - }, - "minimum": { - "$ref": "#/definitions/minimum" - }, - "exclusiveMinimum": { - "$ref": "#/definitions/exclusiveMinimum" - }, - "maxLength": { - "$ref": "#/definitions/maxLength" - }, - "minLength": { - "$ref": "#/definitions/minLength" - }, - "pattern": { - "$ref": "#/definitions/pattern" - }, - "maxItems": { - "$ref": "#/definitions/maxItems" - }, - "minItems": { - "$ref": "#/definitions/minItems" - }, - "uniqueItems": { - "$ref": "#/definitions/uniqueItems" - }, - "enum": { - "$ref": "#/definitions/enum" - }, - "multipleOf": { - "$ref": "#/definitions/multipleOf" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "security": { - "type": "array", - "items": { - "$ref": "#/definitions/securityRequirement" - }, - "uniqueItems": true - }, - "securityRequirement": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - }, - "xml": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "namespace": { - "type": "string" - }, - "prefix": { - "type": "string" - }, - "attribute": { - "type": "boolean", - "default": false - }, - "wrapped": { - "type": "boolean", - "default": false - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "tag": { - "type": "object", - "additionalProperties": false, - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "externalDocs": { - "$ref": "#/definitions/externalDocs" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "securityDefinitions": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/basicAuthenticationSecurity" - }, - { - "$ref": "#/definitions/apiKeySecurity" - }, - { - "$ref": "#/definitions/oauth2ImplicitSecurity" - }, - { - "$ref": "#/definitions/oauth2PasswordSecurity" - }, - { - "$ref": "#/definitions/oauth2ApplicationSecurity" - }, - { - "$ref": "#/definitions/oauth2AccessCodeSecurity" - } - ] - } - }, - "basicAuthenticationSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "basic" - ] - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "apiKeySecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "name", - "in" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apiKey" - ] - }, - "name": { - "type": "string" - }, - "in": { - "type": "string", - "enum": [ - "header", - "query" - ] - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2ImplicitSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "flow", - "authorizationUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flow": { - "type": "string", - "enum": [ - "implicit" - ] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "authorizationUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2PasswordSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "flow", - "tokenUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flow": { - "type": "string", - "enum": [ - "password" - ] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2ApplicationSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "flow", - "tokenUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flow": { - "type": "string", - "enum": [ - "application" - ] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2AccessCodeSecurity": { - "type": "object", - "additionalProperties": false, - "required": [ - "type", - "flow", - "authorizationUrl", - "tokenUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flow": { - "type": "string", - "enum": [ - "accessCode" - ] - }, - "scopes": { - "$ref": "#/definitions/oauth2Scopes" - }, - "authorizationUrl": { - "type": "string", - "format": "uri" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": { - "$ref": "#/definitions/vendorExtension" - } - } - }, - "oauth2Scopes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "mediaTypeList": { - "type": "array", - "items": { - "$ref": "#/definitions/mimeType" - }, - "uniqueItems": true - }, - "parametersList": { - "type": "array", - "description": "The parameters needed to send a valid API call.", - "additionalItems": false, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/parameter" - }, - { - "$ref": "#/definitions/jsonReference" - } - ] - }, - "uniqueItems": true - }, - "schemesList": { - "type": "array", - "description": "The transfer protocol of the API.", - "items": { - "type": "string", - "enum": [ - "http", - "https", - "ws", - "wss" - ] - }, - "uniqueItems": true - }, - "collectionFormat": { - "type": "string", - "enum": [ - "csv", - "ssv", - "tsv", - "pipes" - ], - "default": "csv" - }, - "collectionFormatWithMulti": { - "type": "string", - "enum": [ - "csv", - "ssv", - "tsv", - "pipes", - "multi" - ], - "default": "csv" - }, - "title": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/title" - }, - "description": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/description" - }, - "default": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/default" - }, - "multipleOf": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" - }, - "maximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" - }, - "exclusiveMaximum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" - }, - "minimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" - }, - "exclusiveMinimum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" - }, - "maxLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minLength": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "pattern": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" - }, - "maxItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" - }, - "minItems": { - "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" - }, - "uniqueItems": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" - }, - "enum": { - "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" - }, - "jsonReference": { - "type": "object", - "required": [ - "$ref" - ], - "additionalProperties": false, - "properties": { - "$ref": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.go deleted file mode 100644 index 4b1131ce1c2e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.go +++ /dev/null @@ -1,8633 +0,0 @@ -// Copyright 2020 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// THIS FILE IS AUTOMATICALLY GENERATED. - -package openapi_v3 - -import ( - "fmt" - "regexp" - "strings" - - "gopkg.in/yaml.v3" - - "github.com/google/gnostic-models/compiler" -) - -// Version returns the package name (and OpenAPI version). -func Version() string { - return "openapi_v3" -} - -// NewAdditionalPropertiesItem creates an object of type AdditionalPropertiesItem if possible, returning an error if not. -func NewAdditionalPropertiesItem(in *yaml.Node, context *compiler.Context) (*AdditionalPropertiesItem, error) { - errors := make([]error, 0) - x := &AdditionalPropertiesItem{} - matched := false - // SchemaOrReference schema_or_reference = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewSchemaOrReference(m, compiler.NewContext("schemaOrReference", m, context)) - if matchingError == nil { - x.Oneof = &AdditionalPropertiesItem_SchemaOrReference{SchemaOrReference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // bool boolean = 2; - boolValue, ok := compiler.BoolForScalarNode(in) - if ok { - x.Oneof = &AdditionalPropertiesItem_Boolean{Boolean: boolValue} - matched = true - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid AdditionalPropertiesItem") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewAny creates an object of type Any if possible, returning an error if not. -func NewAny(in *yaml.Node, context *compiler.Context) (*Any, error) { - errors := make([]error, 0) - x := &Any{} - bytes := compiler.Marshal(in) - x.Yaml = string(bytes) - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewAnyOrExpression creates an object of type AnyOrExpression if possible, returning an error if not. -func NewAnyOrExpression(in *yaml.Node, context *compiler.Context) (*AnyOrExpression, error) { - errors := make([]error, 0) - x := &AnyOrExpression{} - matched := false - // Any any = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewAny(m, compiler.NewContext("any", m, context)) - if matchingError == nil { - x.Oneof = &AnyOrExpression_Any{Any: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Expression expression = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewExpression(m, compiler.NewContext("expression", m, context)) - if matchingError == nil { - x.Oneof = &AnyOrExpression_Expression{Expression: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid AnyOrExpression") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewCallback creates an object of type Callback if possible, returning an error if not. -func NewCallback(in *yaml.Node, context *compiler.Context) (*Callback, error) { - errors := make([]error, 0) - x := &Callback{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{} - allowedPatterns := []*regexp.Regexp{pattern0, pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // repeated NamedPathItem path = 1; - // MAP: PathItem ^ - x.Path = make([]*NamedPathItem, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if true { - pair := &NamedPathItem{} - pair.Name = k - var err error - pair.Value, err = NewPathItem(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.Path = append(x.Path, pair) - } - } - } - // repeated NamedAny specification_extension = 2; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewCallbackOrReference creates an object of type CallbackOrReference if possible, returning an error if not. -func NewCallbackOrReference(in *yaml.Node, context *compiler.Context) (*CallbackOrReference, error) { - errors := make([]error, 0) - x := &CallbackOrReference{} - matched := false - // Callback callback = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewCallback(m, compiler.NewContext("callback", m, context)) - if matchingError == nil { - x.Oneof = &CallbackOrReference_Callback{Callback: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &CallbackOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid CallbackOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewCallbacksOrReferences creates an object of type CallbacksOrReferences if possible, returning an error if not. -func NewCallbacksOrReferences(in *yaml.Node, context *compiler.Context) (*CallbacksOrReferences, error) { - errors := make([]error, 0) - x := &CallbacksOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedCallbackOrReference additional_properties = 1; - // MAP: CallbackOrReference - x.AdditionalProperties = make([]*NamedCallbackOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedCallbackOrReference{} - pair.Name = k - var err error - pair.Value, err = NewCallbackOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewComponents creates an object of type Components if possible, returning an error if not. -func NewComponents(in *yaml.Node, context *compiler.Context) (*Components, error) { - errors := make([]error, 0) - x := &Components{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"callbacks", "examples", "headers", "links", "parameters", "requestBodies", "responses", "schemas", "securitySchemes"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // SchemasOrReferences schemas = 1; - v1 := compiler.MapValueForKey(m, "schemas") - if v1 != nil { - var err error - x.Schemas, err = NewSchemasOrReferences(v1, compiler.NewContext("schemas", v1, context)) - if err != nil { - errors = append(errors, err) - } - } - // ResponsesOrReferences responses = 2; - v2 := compiler.MapValueForKey(m, "responses") - if v2 != nil { - var err error - x.Responses, err = NewResponsesOrReferences(v2, compiler.NewContext("responses", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // ParametersOrReferences parameters = 3; - v3 := compiler.MapValueForKey(m, "parameters") - if v3 != nil { - var err error - x.Parameters, err = NewParametersOrReferences(v3, compiler.NewContext("parameters", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // ExamplesOrReferences examples = 4; - v4 := compiler.MapValueForKey(m, "examples") - if v4 != nil { - var err error - x.Examples, err = NewExamplesOrReferences(v4, compiler.NewContext("examples", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // RequestBodiesOrReferences request_bodies = 5; - v5 := compiler.MapValueForKey(m, "requestBodies") - if v5 != nil { - var err error - x.RequestBodies, err = NewRequestBodiesOrReferences(v5, compiler.NewContext("requestBodies", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // HeadersOrReferences headers = 6; - v6 := compiler.MapValueForKey(m, "headers") - if v6 != nil { - var err error - x.Headers, err = NewHeadersOrReferences(v6, compiler.NewContext("headers", v6, context)) - if err != nil { - errors = append(errors, err) - } - } - // SecuritySchemesOrReferences security_schemes = 7; - v7 := compiler.MapValueForKey(m, "securitySchemes") - if v7 != nil { - var err error - x.SecuritySchemes, err = NewSecuritySchemesOrReferences(v7, compiler.NewContext("securitySchemes", v7, context)) - if err != nil { - errors = append(errors, err) - } - } - // LinksOrReferences links = 8; - v8 := compiler.MapValueForKey(m, "links") - if v8 != nil { - var err error - x.Links, err = NewLinksOrReferences(v8, compiler.NewContext("links", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // CallbacksOrReferences callbacks = 9; - v9 := compiler.MapValueForKey(m, "callbacks") - if v9 != nil { - var err error - x.Callbacks, err = NewCallbacksOrReferences(v9, compiler.NewContext("callbacks", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 10; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewContact creates an object of type Contact if possible, returning an error if not. -func NewContact(in *yaml.Node, context *compiler.Context) (*Contact, error) { - errors := make([]error, 0) - x := &Contact{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"email", "name", "url"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string url = 2; - v2 := compiler.MapValueForKey(m, "url") - if v2 != nil { - x.Url, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string email = 3; - v3 := compiler.MapValueForKey(m, "email") - if v3 != nil { - x.Email, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for email: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 4; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewDefaultType creates an object of type DefaultType if possible, returning an error if not. -func NewDefaultType(in *yaml.Node, context *compiler.Context) (*DefaultType, error) { - errors := make([]error, 0) - x := &DefaultType{} - matched := false - switch in.Tag { - case "!!bool": - var v bool - v, matched = compiler.BoolForScalarNode(in) - x.Oneof = &DefaultType_Boolean{Boolean: v} - case "!!str": - var v string - v, matched = compiler.StringForScalarNode(in) - x.Oneof = &DefaultType_String_{String_: v} - case "!!float": - var v float64 - v, matched = compiler.FloatForScalarNode(in) - x.Oneof = &DefaultType_Number{Number: v} - case "!!int": - var v int64 - v, matched = compiler.IntForScalarNode(in) - x.Oneof = &DefaultType_Number{Number: float64(v)} - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewDiscriminator creates an object of type Discriminator if possible, returning an error if not. -func NewDiscriminator(in *yaml.Node, context *compiler.Context) (*Discriminator, error) { - errors := make([]error, 0) - x := &Discriminator{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"propertyName"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"mapping", "propertyName"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string property_name = 1; - v1 := compiler.MapValueForKey(m, "propertyName") - if v1 != nil { - x.PropertyName, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for propertyName: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Strings mapping = 2; - v2 := compiler.MapValueForKey(m, "mapping") - if v2 != nil { - var err error - x.Mapping, err = NewStrings(v2, compiler.NewContext("mapping", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 3; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewDocument creates an object of type Document if possible, returning an error if not. -func NewDocument(in *yaml.Node, context *compiler.Context) (*Document, error) { - errors := make([]error, 0) - x := &Document{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"info", "openapi", "paths"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"components", "externalDocs", "info", "openapi", "paths", "security", "servers", "tags"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string openapi = 1; - v1 := compiler.MapValueForKey(m, "openapi") - if v1 != nil { - x.Openapi, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for openapi: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Info info = 2; - v2 := compiler.MapValueForKey(m, "info") - if v2 != nil { - var err error - x.Info, err = NewInfo(v2, compiler.NewContext("info", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated Server servers = 3; - v3 := compiler.MapValueForKey(m, "servers") - if v3 != nil { - // repeated Server - x.Servers = make([]*Server, 0) - a, ok := compiler.SequenceNodeForNode(v3) - if ok { - for _, item := range a.Content { - y, err := NewServer(item, compiler.NewContext("servers", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Servers = append(x.Servers, y) - } - } - } - // Paths paths = 4; - v4 := compiler.MapValueForKey(m, "paths") - if v4 != nil { - var err error - x.Paths, err = NewPaths(v4, compiler.NewContext("paths", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // Components components = 5; - v5 := compiler.MapValueForKey(m, "components") - if v5 != nil { - var err error - x.Components, err = NewComponents(v5, compiler.NewContext("components", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated SecurityRequirement security = 6; - v6 := compiler.MapValueForKey(m, "security") - if v6 != nil { - // repeated SecurityRequirement - x.Security = make([]*SecurityRequirement, 0) - a, ok := compiler.SequenceNodeForNode(v6) - if ok { - for _, item := range a.Content { - y, err := NewSecurityRequirement(item, compiler.NewContext("security", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Security = append(x.Security, y) - } - } - } - // repeated Tag tags = 7; - v7 := compiler.MapValueForKey(m, "tags") - if v7 != nil { - // repeated Tag - x.Tags = make([]*Tag, 0) - a, ok := compiler.SequenceNodeForNode(v7) - if ok { - for _, item := range a.Content { - y, err := NewTag(item, compiler.NewContext("tags", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Tags = append(x.Tags, y) - } - } - } - // ExternalDocs external_docs = 8; - v8 := compiler.MapValueForKey(m, "externalDocs") - if v8 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v8, compiler.NewContext("externalDocs", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 9; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewEncoding creates an object of type Encoding if possible, returning an error if not. -func NewEncoding(in *yaml.Node, context *compiler.Context) (*Encoding, error) { - errors := make([]error, 0) - x := &Encoding{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"allowReserved", "contentType", "explode", "headers", "style"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string content_type = 1; - v1 := compiler.MapValueForKey(m, "contentType") - if v1 != nil { - x.ContentType, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for contentType: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // HeadersOrReferences headers = 2; - v2 := compiler.MapValueForKey(m, "headers") - if v2 != nil { - var err error - x.Headers, err = NewHeadersOrReferences(v2, compiler.NewContext("headers", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // string style = 3; - v3 := compiler.MapValueForKey(m, "style") - if v3 != nil { - x.Style, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for style: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool explode = 4; - v4 := compiler.MapValueForKey(m, "explode") - if v4 != nil { - x.Explode, ok = compiler.BoolForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for explode: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool allow_reserved = 5; - v5 := compiler.MapValueForKey(m, "allowReserved") - if v5 != nil { - x.AllowReserved, ok = compiler.BoolForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for allowReserved: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 6; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewEncodings creates an object of type Encodings if possible, returning an error if not. -func NewEncodings(in *yaml.Node, context *compiler.Context) (*Encodings, error) { - errors := make([]error, 0) - x := &Encodings{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedEncoding additional_properties = 1; - // MAP: Encoding - x.AdditionalProperties = make([]*NamedEncoding, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedEncoding{} - pair.Name = k - var err error - pair.Value, err = NewEncoding(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewExample creates an object of type Example if possible, returning an error if not. -func NewExample(in *yaml.Node, context *compiler.Context) (*Example, error) { - errors := make([]error, 0) - x := &Example{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"description", "externalValue", "summary", "value"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string summary = 1; - v1 := compiler.MapValueForKey(m, "summary") - if v1 != nil { - x.Summary, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for summary: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 2; - v2 := compiler.MapValueForKey(m, "description") - if v2 != nil { - x.Description, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any value = 3; - v3 := compiler.MapValueForKey(m, "value") - if v3 != nil { - var err error - x.Value, err = NewAny(v3, compiler.NewContext("value", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // string external_value = 4; - v4 := compiler.MapValueForKey(m, "externalValue") - if v4 != nil { - x.ExternalValue, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for externalValue: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 5; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewExampleOrReference creates an object of type ExampleOrReference if possible, returning an error if not. -func NewExampleOrReference(in *yaml.Node, context *compiler.Context) (*ExampleOrReference, error) { - errors := make([]error, 0) - x := &ExampleOrReference{} - matched := false - // Example example = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewExample(m, compiler.NewContext("example", m, context)) - if matchingError == nil { - x.Oneof = &ExampleOrReference_Example{Example: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &ExampleOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid ExampleOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewExamplesOrReferences creates an object of type ExamplesOrReferences if possible, returning an error if not. -func NewExamplesOrReferences(in *yaml.Node, context *compiler.Context) (*ExamplesOrReferences, error) { - errors := make([]error, 0) - x := &ExamplesOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedExampleOrReference additional_properties = 1; - // MAP: ExampleOrReference - x.AdditionalProperties = make([]*NamedExampleOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedExampleOrReference{} - pair.Name = k - var err error - pair.Value, err = NewExampleOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewExpression creates an object of type Expression if possible, returning an error if not. -func NewExpression(in *yaml.Node, context *compiler.Context) (*Expression, error) { - errors := make([]error, 0) - x := &Expression{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedAny additional_properties = 1; - // MAP: Any - x.AdditionalProperties = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewExternalDocs creates an object of type ExternalDocs if possible, returning an error if not. -func NewExternalDocs(in *yaml.Node, context *compiler.Context) (*ExternalDocs, error) { - errors := make([]error, 0) - x := &ExternalDocs{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"url"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "url"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string description = 1; - v1 := compiler.MapValueForKey(m, "description") - if v1 != nil { - x.Description, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string url = 2; - v2 := compiler.MapValueForKey(m, "url") - if v2 != nil { - x.Url, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 3; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewHeader creates an object of type Header if possible, returning an error if not. -func NewHeader(in *yaml.Node, context *compiler.Context) (*Header, error) { - errors := make([]error, 0) - x := &Header{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"allowEmptyValue", "allowReserved", "content", "deprecated", "description", "example", "examples", "explode", "required", "schema", "style"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string description = 1; - v1 := compiler.MapValueForKey(m, "description") - if v1 != nil { - x.Description, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool required = 2; - v2 := compiler.MapValueForKey(m, "required") - if v2 != nil { - x.Required, ok = compiler.BoolForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool deprecated = 3; - v3 := compiler.MapValueForKey(m, "deprecated") - if v3 != nil { - x.Deprecated, ok = compiler.BoolForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for deprecated: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool allow_empty_value = 4; - v4 := compiler.MapValueForKey(m, "allowEmptyValue") - if v4 != nil { - x.AllowEmptyValue, ok = compiler.BoolForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for allowEmptyValue: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string style = 5; - v5 := compiler.MapValueForKey(m, "style") - if v5 != nil { - x.Style, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for style: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool explode = 6; - v6 := compiler.MapValueForKey(m, "explode") - if v6 != nil { - x.Explode, ok = compiler.BoolForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for explode: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool allow_reserved = 7; - v7 := compiler.MapValueForKey(m, "allowReserved") - if v7 != nil { - x.AllowReserved, ok = compiler.BoolForScalarNode(v7) - if !ok { - message := fmt.Sprintf("has unexpected value for allowReserved: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // SchemaOrReference schema = 8; - v8 := compiler.MapValueForKey(m, "schema") - if v8 != nil { - var err error - x.Schema, err = NewSchemaOrReference(v8, compiler.NewContext("schema", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // Any example = 9; - v9 := compiler.MapValueForKey(m, "example") - if v9 != nil { - var err error - x.Example, err = NewAny(v9, compiler.NewContext("example", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // ExamplesOrReferences examples = 10; - v10 := compiler.MapValueForKey(m, "examples") - if v10 != nil { - var err error - x.Examples, err = NewExamplesOrReferences(v10, compiler.NewContext("examples", v10, context)) - if err != nil { - errors = append(errors, err) - } - } - // MediaTypes content = 11; - v11 := compiler.MapValueForKey(m, "content") - if v11 != nil { - var err error - x.Content, err = NewMediaTypes(v11, compiler.NewContext("content", v11, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 12; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewHeaderOrReference creates an object of type HeaderOrReference if possible, returning an error if not. -func NewHeaderOrReference(in *yaml.Node, context *compiler.Context) (*HeaderOrReference, error) { - errors := make([]error, 0) - x := &HeaderOrReference{} - matched := false - // Header header = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewHeader(m, compiler.NewContext("header", m, context)) - if matchingError == nil { - x.Oneof = &HeaderOrReference_Header{Header: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &HeaderOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid HeaderOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewHeadersOrReferences creates an object of type HeadersOrReferences if possible, returning an error if not. -func NewHeadersOrReferences(in *yaml.Node, context *compiler.Context) (*HeadersOrReferences, error) { - errors := make([]error, 0) - x := &HeadersOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedHeaderOrReference additional_properties = 1; - // MAP: HeaderOrReference - x.AdditionalProperties = make([]*NamedHeaderOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedHeaderOrReference{} - pair.Name = k - var err error - pair.Value, err = NewHeaderOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewInfo creates an object of type Info if possible, returning an error if not. -func NewInfo(in *yaml.Node, context *compiler.Context) (*Info, error) { - errors := make([]error, 0) - x := &Info{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"title", "version"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"contact", "description", "license", "summary", "termsOfService", "title", "version"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string title = 1; - v1 := compiler.MapValueForKey(m, "title") - if v1 != nil { - x.Title, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 2; - v2 := compiler.MapValueForKey(m, "description") - if v2 != nil { - x.Description, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string terms_of_service = 3; - v3 := compiler.MapValueForKey(m, "termsOfService") - if v3 != nil { - x.TermsOfService, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for termsOfService: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Contact contact = 4; - v4 := compiler.MapValueForKey(m, "contact") - if v4 != nil { - var err error - x.Contact, err = NewContact(v4, compiler.NewContext("contact", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // License license = 5; - v5 := compiler.MapValueForKey(m, "license") - if v5 != nil { - var err error - x.License, err = NewLicense(v5, compiler.NewContext("license", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // string version = 6; - v6 := compiler.MapValueForKey(m, "version") - if v6 != nil { - x.Version, ok = compiler.StringForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for version: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string summary = 7; - v7 := compiler.MapValueForKey(m, "summary") - if v7 != nil { - x.Summary, ok = compiler.StringForScalarNode(v7) - if !ok { - message := fmt.Sprintf("has unexpected value for summary: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 8; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewItemsItem creates an object of type ItemsItem if possible, returning an error if not. -func NewItemsItem(in *yaml.Node, context *compiler.Context) (*ItemsItem, error) { - errors := make([]error, 0) - x := &ItemsItem{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value for item array: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - x.SchemaOrReference = make([]*SchemaOrReference, 0) - y, err := NewSchemaOrReference(m, compiler.NewContext("", m, context)) - if err != nil { - return nil, err - } - x.SchemaOrReference = append(x.SchemaOrReference, y) - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewLicense creates an object of type License if possible, returning an error if not. -func NewLicense(in *yaml.Node, context *compiler.Context) (*License, error) { - errors := make([]error, 0) - x := &License{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"name"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"name", "url"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string url = 2; - v2 := compiler.MapValueForKey(m, "url") - if v2 != nil { - x.Url, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 3; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewLink creates an object of type Link if possible, returning an error if not. -func NewLink(in *yaml.Node, context *compiler.Context) (*Link, error) { - errors := make([]error, 0) - x := &Link{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"description", "operationId", "operationRef", "parameters", "requestBody", "server"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string operation_ref = 1; - v1 := compiler.MapValueForKey(m, "operationRef") - if v1 != nil { - x.OperationRef, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for operationRef: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string operation_id = 2; - v2 := compiler.MapValueForKey(m, "operationId") - if v2 != nil { - x.OperationId, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for operationId: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // AnyOrExpression parameters = 3; - v3 := compiler.MapValueForKey(m, "parameters") - if v3 != nil { - var err error - x.Parameters, err = NewAnyOrExpression(v3, compiler.NewContext("parameters", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // AnyOrExpression request_body = 4; - v4 := compiler.MapValueForKey(m, "requestBody") - if v4 != nil { - var err error - x.RequestBody, err = NewAnyOrExpression(v4, compiler.NewContext("requestBody", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // string description = 5; - v5 := compiler.MapValueForKey(m, "description") - if v5 != nil { - x.Description, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Server server = 6; - v6 := compiler.MapValueForKey(m, "server") - if v6 != nil { - var err error - x.Server, err = NewServer(v6, compiler.NewContext("server", v6, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 7; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewLinkOrReference creates an object of type LinkOrReference if possible, returning an error if not. -func NewLinkOrReference(in *yaml.Node, context *compiler.Context) (*LinkOrReference, error) { - errors := make([]error, 0) - x := &LinkOrReference{} - matched := false - // Link link = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewLink(m, compiler.NewContext("link", m, context)) - if matchingError == nil { - x.Oneof = &LinkOrReference_Link{Link: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &LinkOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid LinkOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewLinksOrReferences creates an object of type LinksOrReferences if possible, returning an error if not. -func NewLinksOrReferences(in *yaml.Node, context *compiler.Context) (*LinksOrReferences, error) { - errors := make([]error, 0) - x := &LinksOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedLinkOrReference additional_properties = 1; - // MAP: LinkOrReference - x.AdditionalProperties = make([]*NamedLinkOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedLinkOrReference{} - pair.Name = k - var err error - pair.Value, err = NewLinkOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewMediaType creates an object of type MediaType if possible, returning an error if not. -func NewMediaType(in *yaml.Node, context *compiler.Context) (*MediaType, error) { - errors := make([]error, 0) - x := &MediaType{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"encoding", "example", "examples", "schema"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // SchemaOrReference schema = 1; - v1 := compiler.MapValueForKey(m, "schema") - if v1 != nil { - var err error - x.Schema, err = NewSchemaOrReference(v1, compiler.NewContext("schema", v1, context)) - if err != nil { - errors = append(errors, err) - } - } - // Any example = 2; - v2 := compiler.MapValueForKey(m, "example") - if v2 != nil { - var err error - x.Example, err = NewAny(v2, compiler.NewContext("example", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // ExamplesOrReferences examples = 3; - v3 := compiler.MapValueForKey(m, "examples") - if v3 != nil { - var err error - x.Examples, err = NewExamplesOrReferences(v3, compiler.NewContext("examples", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // Encodings encoding = 4; - v4 := compiler.MapValueForKey(m, "encoding") - if v4 != nil { - var err error - x.Encoding, err = NewEncodings(v4, compiler.NewContext("encoding", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 5; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewMediaTypes creates an object of type MediaTypes if possible, returning an error if not. -func NewMediaTypes(in *yaml.Node, context *compiler.Context) (*MediaTypes, error) { - errors := make([]error, 0) - x := &MediaTypes{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedMediaType additional_properties = 1; - // MAP: MediaType - x.AdditionalProperties = make([]*NamedMediaType, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedMediaType{} - pair.Name = k - var err error - pair.Value, err = NewMediaType(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedAny creates an object of type NamedAny if possible, returning an error if not. -func NewNamedAny(in *yaml.Node, context *compiler.Context) (*NamedAny, error) { - errors := make([]error, 0) - x := &NamedAny{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Any value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewAny(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedCallbackOrReference creates an object of type NamedCallbackOrReference if possible, returning an error if not. -func NewNamedCallbackOrReference(in *yaml.Node, context *compiler.Context) (*NamedCallbackOrReference, error) { - errors := make([]error, 0) - x := &NamedCallbackOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // CallbackOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewCallbackOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedEncoding creates an object of type NamedEncoding if possible, returning an error if not. -func NewNamedEncoding(in *yaml.Node, context *compiler.Context) (*NamedEncoding, error) { - errors := make([]error, 0) - x := &NamedEncoding{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Encoding value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewEncoding(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedExampleOrReference creates an object of type NamedExampleOrReference if possible, returning an error if not. -func NewNamedExampleOrReference(in *yaml.Node, context *compiler.Context) (*NamedExampleOrReference, error) { - errors := make([]error, 0) - x := &NamedExampleOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ExampleOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewExampleOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedHeaderOrReference creates an object of type NamedHeaderOrReference if possible, returning an error if not. -func NewNamedHeaderOrReference(in *yaml.Node, context *compiler.Context) (*NamedHeaderOrReference, error) { - errors := make([]error, 0) - x := &NamedHeaderOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // HeaderOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewHeaderOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedLinkOrReference creates an object of type NamedLinkOrReference if possible, returning an error if not. -func NewNamedLinkOrReference(in *yaml.Node, context *compiler.Context) (*NamedLinkOrReference, error) { - errors := make([]error, 0) - x := &NamedLinkOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // LinkOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewLinkOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedMediaType creates an object of type NamedMediaType if possible, returning an error if not. -func NewNamedMediaType(in *yaml.Node, context *compiler.Context) (*NamedMediaType, error) { - errors := make([]error, 0) - x := &NamedMediaType{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // MediaType value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewMediaType(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedParameterOrReference creates an object of type NamedParameterOrReference if possible, returning an error if not. -func NewNamedParameterOrReference(in *yaml.Node, context *compiler.Context) (*NamedParameterOrReference, error) { - errors := make([]error, 0) - x := &NamedParameterOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ParameterOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewParameterOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedPathItem creates an object of type NamedPathItem if possible, returning an error if not. -func NewNamedPathItem(in *yaml.Node, context *compiler.Context) (*NamedPathItem, error) { - errors := make([]error, 0) - x := &NamedPathItem{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // PathItem value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewPathItem(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedRequestBodyOrReference creates an object of type NamedRequestBodyOrReference if possible, returning an error if not. -func NewNamedRequestBodyOrReference(in *yaml.Node, context *compiler.Context) (*NamedRequestBodyOrReference, error) { - errors := make([]error, 0) - x := &NamedRequestBodyOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // RequestBodyOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewRequestBodyOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedResponseOrReference creates an object of type NamedResponseOrReference if possible, returning an error if not. -func NewNamedResponseOrReference(in *yaml.Node, context *compiler.Context) (*NamedResponseOrReference, error) { - errors := make([]error, 0) - x := &NamedResponseOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ResponseOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewResponseOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedSchemaOrReference creates an object of type NamedSchemaOrReference if possible, returning an error if not. -func NewNamedSchemaOrReference(in *yaml.Node, context *compiler.Context) (*NamedSchemaOrReference, error) { - errors := make([]error, 0) - x := &NamedSchemaOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // SchemaOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewSchemaOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedSecuritySchemeOrReference creates an object of type NamedSecuritySchemeOrReference if possible, returning an error if not. -func NewNamedSecuritySchemeOrReference(in *yaml.Node, context *compiler.Context) (*NamedSecuritySchemeOrReference, error) { - errors := make([]error, 0) - x := &NamedSecuritySchemeOrReference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // SecuritySchemeOrReference value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewSecuritySchemeOrReference(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedServerVariable creates an object of type NamedServerVariable if possible, returning an error if not. -func NewNamedServerVariable(in *yaml.Node, context *compiler.Context) (*NamedServerVariable, error) { - errors := make([]error, 0) - x := &NamedServerVariable{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ServerVariable value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewServerVariable(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedString creates an object of type NamedString if possible, returning an error if not. -func NewNamedString(in *yaml.Node, context *compiler.Context) (*NamedString, error) { - errors := make([]error, 0) - x := &NamedString{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - x.Value, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for value: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewNamedStringArray creates an object of type NamedStringArray if possible, returning an error if not. -func NewNamedStringArray(in *yaml.Node, context *compiler.Context) (*NamedStringArray, error) { - errors := make([]error, 0) - x := &NamedStringArray{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"name", "value"} - var allowedPatterns []*regexp.Regexp - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // StringArray value = 2; - v2 := compiler.MapValueForKey(m, "value") - if v2 != nil { - var err error - x.Value, err = NewStringArray(v2, compiler.NewContext("value", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOauthFlow creates an object of type OauthFlow if possible, returning an error if not. -func NewOauthFlow(in *yaml.Node, context *compiler.Context) (*OauthFlow, error) { - errors := make([]error, 0) - x := &OauthFlow{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"authorizationUrl", "refreshUrl", "scopes", "tokenUrl"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string authorization_url = 1; - v1 := compiler.MapValueForKey(m, "authorizationUrl") - if v1 != nil { - x.AuthorizationUrl, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for authorizationUrl: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string token_url = 2; - v2 := compiler.MapValueForKey(m, "tokenUrl") - if v2 != nil { - x.TokenUrl, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for tokenUrl: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string refresh_url = 3; - v3 := compiler.MapValueForKey(m, "refreshUrl") - if v3 != nil { - x.RefreshUrl, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for refreshUrl: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Strings scopes = 4; - v4 := compiler.MapValueForKey(m, "scopes") - if v4 != nil { - var err error - x.Scopes, err = NewStrings(v4, compiler.NewContext("scopes", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 5; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOauthFlows creates an object of type OauthFlows if possible, returning an error if not. -func NewOauthFlows(in *yaml.Node, context *compiler.Context) (*OauthFlows, error) { - errors := make([]error, 0) - x := &OauthFlows{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"authorizationCode", "clientCredentials", "implicit", "password"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // OauthFlow implicit = 1; - v1 := compiler.MapValueForKey(m, "implicit") - if v1 != nil { - var err error - x.Implicit, err = NewOauthFlow(v1, compiler.NewContext("implicit", v1, context)) - if err != nil { - errors = append(errors, err) - } - } - // OauthFlow password = 2; - v2 := compiler.MapValueForKey(m, "password") - if v2 != nil { - var err error - x.Password, err = NewOauthFlow(v2, compiler.NewContext("password", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // OauthFlow client_credentials = 3; - v3 := compiler.MapValueForKey(m, "clientCredentials") - if v3 != nil { - var err error - x.ClientCredentials, err = NewOauthFlow(v3, compiler.NewContext("clientCredentials", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // OauthFlow authorization_code = 4; - v4 := compiler.MapValueForKey(m, "authorizationCode") - if v4 != nil { - var err error - x.AuthorizationCode, err = NewOauthFlow(v4, compiler.NewContext("authorizationCode", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 5; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewObject creates an object of type Object if possible, returning an error if not. -func NewObject(in *yaml.Node, context *compiler.Context) (*Object, error) { - errors := make([]error, 0) - x := &Object{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedAny additional_properties = 1; - // MAP: Any - x.AdditionalProperties = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewOperation creates an object of type Operation if possible, returning an error if not. -func NewOperation(in *yaml.Node, context *compiler.Context) (*Operation, error) { - errors := make([]error, 0) - x := &Operation{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"responses"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"callbacks", "deprecated", "description", "externalDocs", "operationId", "parameters", "requestBody", "responses", "security", "servers", "summary", "tags"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // repeated string tags = 1; - v1 := compiler.MapValueForKey(m, "tags") - if v1 != nil { - v, ok := compiler.SequenceNodeForNode(v1) - if ok { - x.Tags = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for tags: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string summary = 2; - v2 := compiler.MapValueForKey(m, "summary") - if v2 != nil { - x.Summary, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for summary: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ExternalDocs external_docs = 4; - v4 := compiler.MapValueForKey(m, "externalDocs") - if v4 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v4, compiler.NewContext("externalDocs", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // string operation_id = 5; - v5 := compiler.MapValueForKey(m, "operationId") - if v5 != nil { - x.OperationId, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for operationId: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated ParameterOrReference parameters = 6; - v6 := compiler.MapValueForKey(m, "parameters") - if v6 != nil { - // repeated ParameterOrReference - x.Parameters = make([]*ParameterOrReference, 0) - a, ok := compiler.SequenceNodeForNode(v6) - if ok { - for _, item := range a.Content { - y, err := NewParameterOrReference(item, compiler.NewContext("parameters", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Parameters = append(x.Parameters, y) - } - } - } - // RequestBodyOrReference request_body = 7; - v7 := compiler.MapValueForKey(m, "requestBody") - if v7 != nil { - var err error - x.RequestBody, err = NewRequestBodyOrReference(v7, compiler.NewContext("requestBody", v7, context)) - if err != nil { - errors = append(errors, err) - } - } - // Responses responses = 8; - v8 := compiler.MapValueForKey(m, "responses") - if v8 != nil { - var err error - x.Responses, err = NewResponses(v8, compiler.NewContext("responses", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // CallbacksOrReferences callbacks = 9; - v9 := compiler.MapValueForKey(m, "callbacks") - if v9 != nil { - var err error - x.Callbacks, err = NewCallbacksOrReferences(v9, compiler.NewContext("callbacks", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // bool deprecated = 10; - v10 := compiler.MapValueForKey(m, "deprecated") - if v10 != nil { - x.Deprecated, ok = compiler.BoolForScalarNode(v10) - if !ok { - message := fmt.Sprintf("has unexpected value for deprecated: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated SecurityRequirement security = 11; - v11 := compiler.MapValueForKey(m, "security") - if v11 != nil { - // repeated SecurityRequirement - x.Security = make([]*SecurityRequirement, 0) - a, ok := compiler.SequenceNodeForNode(v11) - if ok { - for _, item := range a.Content { - y, err := NewSecurityRequirement(item, compiler.NewContext("security", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Security = append(x.Security, y) - } - } - } - // repeated Server servers = 12; - v12 := compiler.MapValueForKey(m, "servers") - if v12 != nil { - // repeated Server - x.Servers = make([]*Server, 0) - a, ok := compiler.SequenceNodeForNode(v12) - if ok { - for _, item := range a.Content { - y, err := NewServer(item, compiler.NewContext("servers", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Servers = append(x.Servers, y) - } - } - } - // repeated NamedAny specification_extension = 13; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewParameter creates an object of type Parameter if possible, returning an error if not. -func NewParameter(in *yaml.Node, context *compiler.Context) (*Parameter, error) { - errors := make([]error, 0) - x := &Parameter{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"in", "name"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"allowEmptyValue", "allowReserved", "content", "deprecated", "description", "example", "examples", "explode", "in", "name", "required", "schema", "style"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string in = 2; - v2 := compiler.MapValueForKey(m, "in") - if v2 != nil { - x.In, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool required = 4; - v4 := compiler.MapValueForKey(m, "required") - if v4 != nil { - x.Required, ok = compiler.BoolForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool deprecated = 5; - v5 := compiler.MapValueForKey(m, "deprecated") - if v5 != nil { - x.Deprecated, ok = compiler.BoolForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for deprecated: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool allow_empty_value = 6; - v6 := compiler.MapValueForKey(m, "allowEmptyValue") - if v6 != nil { - x.AllowEmptyValue, ok = compiler.BoolForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for allowEmptyValue: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string style = 7; - v7 := compiler.MapValueForKey(m, "style") - if v7 != nil { - x.Style, ok = compiler.StringForScalarNode(v7) - if !ok { - message := fmt.Sprintf("has unexpected value for style: %s", compiler.Display(v7)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool explode = 8; - v8 := compiler.MapValueForKey(m, "explode") - if v8 != nil { - x.Explode, ok = compiler.BoolForScalarNode(v8) - if !ok { - message := fmt.Sprintf("has unexpected value for explode: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool allow_reserved = 9; - v9 := compiler.MapValueForKey(m, "allowReserved") - if v9 != nil { - x.AllowReserved, ok = compiler.BoolForScalarNode(v9) - if !ok { - message := fmt.Sprintf("has unexpected value for allowReserved: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // SchemaOrReference schema = 10; - v10 := compiler.MapValueForKey(m, "schema") - if v10 != nil { - var err error - x.Schema, err = NewSchemaOrReference(v10, compiler.NewContext("schema", v10, context)) - if err != nil { - errors = append(errors, err) - } - } - // Any example = 11; - v11 := compiler.MapValueForKey(m, "example") - if v11 != nil { - var err error - x.Example, err = NewAny(v11, compiler.NewContext("example", v11, context)) - if err != nil { - errors = append(errors, err) - } - } - // ExamplesOrReferences examples = 12; - v12 := compiler.MapValueForKey(m, "examples") - if v12 != nil { - var err error - x.Examples, err = NewExamplesOrReferences(v12, compiler.NewContext("examples", v12, context)) - if err != nil { - errors = append(errors, err) - } - } - // MediaTypes content = 13; - v13 := compiler.MapValueForKey(m, "content") - if v13 != nil { - var err error - x.Content, err = NewMediaTypes(v13, compiler.NewContext("content", v13, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 14; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewParameterOrReference creates an object of type ParameterOrReference if possible, returning an error if not. -func NewParameterOrReference(in *yaml.Node, context *compiler.Context) (*ParameterOrReference, error) { - errors := make([]error, 0) - x := &ParameterOrReference{} - matched := false - // Parameter parameter = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewParameter(m, compiler.NewContext("parameter", m, context)) - if matchingError == nil { - x.Oneof = &ParameterOrReference_Parameter{Parameter: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &ParameterOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid ParameterOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewParametersOrReferences creates an object of type ParametersOrReferences if possible, returning an error if not. -func NewParametersOrReferences(in *yaml.Node, context *compiler.Context) (*ParametersOrReferences, error) { - errors := make([]error, 0) - x := &ParametersOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedParameterOrReference additional_properties = 1; - // MAP: ParameterOrReference - x.AdditionalProperties = make([]*NamedParameterOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedParameterOrReference{} - pair.Name = k - var err error - pair.Value, err = NewParameterOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewPathItem creates an object of type PathItem if possible, returning an error if not. -func NewPathItem(in *yaml.Node, context *compiler.Context) (*PathItem, error) { - errors := make([]error, 0) - x := &PathItem{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"$ref", "delete", "description", "get", "head", "options", "parameters", "patch", "post", "put", "servers", "summary", "trace"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string _ref = 1; - v1 := compiler.MapValueForKey(m, "$ref") - if v1 != nil { - x.XRef, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string summary = 2; - v2 := compiler.MapValueForKey(m, "summary") - if v2 != nil { - x.Summary, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for summary: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Operation get = 4; - v4 := compiler.MapValueForKey(m, "get") - if v4 != nil { - var err error - x.Get, err = NewOperation(v4, compiler.NewContext("get", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation put = 5; - v5 := compiler.MapValueForKey(m, "put") - if v5 != nil { - var err error - x.Put, err = NewOperation(v5, compiler.NewContext("put", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation post = 6; - v6 := compiler.MapValueForKey(m, "post") - if v6 != nil { - var err error - x.Post, err = NewOperation(v6, compiler.NewContext("post", v6, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation delete = 7; - v7 := compiler.MapValueForKey(m, "delete") - if v7 != nil { - var err error - x.Delete, err = NewOperation(v7, compiler.NewContext("delete", v7, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation options = 8; - v8 := compiler.MapValueForKey(m, "options") - if v8 != nil { - var err error - x.Options, err = NewOperation(v8, compiler.NewContext("options", v8, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation head = 9; - v9 := compiler.MapValueForKey(m, "head") - if v9 != nil { - var err error - x.Head, err = NewOperation(v9, compiler.NewContext("head", v9, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation patch = 10; - v10 := compiler.MapValueForKey(m, "patch") - if v10 != nil { - var err error - x.Patch, err = NewOperation(v10, compiler.NewContext("patch", v10, context)) - if err != nil { - errors = append(errors, err) - } - } - // Operation trace = 11; - v11 := compiler.MapValueForKey(m, "trace") - if v11 != nil { - var err error - x.Trace, err = NewOperation(v11, compiler.NewContext("trace", v11, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated Server servers = 12; - v12 := compiler.MapValueForKey(m, "servers") - if v12 != nil { - // repeated Server - x.Servers = make([]*Server, 0) - a, ok := compiler.SequenceNodeForNode(v12) - if ok { - for _, item := range a.Content { - y, err := NewServer(item, compiler.NewContext("servers", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Servers = append(x.Servers, y) - } - } - } - // repeated ParameterOrReference parameters = 13; - v13 := compiler.MapValueForKey(m, "parameters") - if v13 != nil { - // repeated ParameterOrReference - x.Parameters = make([]*ParameterOrReference, 0) - a, ok := compiler.SequenceNodeForNode(v13) - if ok { - for _, item := range a.Content { - y, err := NewParameterOrReference(item, compiler.NewContext("parameters", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Parameters = append(x.Parameters, y) - } - } - } - // repeated NamedAny specification_extension = 14; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewPaths creates an object of type Paths if possible, returning an error if not. -func NewPaths(in *yaml.Node, context *compiler.Context) (*Paths, error) { - errors := make([]error, 0) - x := &Paths{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{} - allowedPatterns := []*regexp.Regexp{pattern2, pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // repeated NamedPathItem path = 1; - // MAP: PathItem ^/ - x.Path = make([]*NamedPathItem, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "/") { - pair := &NamedPathItem{} - pair.Name = k - var err error - pair.Value, err = NewPathItem(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.Path = append(x.Path, pair) - } - } - } - // repeated NamedAny specification_extension = 2; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewProperties creates an object of type Properties if possible, returning an error if not. -func NewProperties(in *yaml.Node, context *compiler.Context) (*Properties, error) { - errors := make([]error, 0) - x := &Properties{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedSchemaOrReference additional_properties = 1; - // MAP: SchemaOrReference - x.AdditionalProperties = make([]*NamedSchemaOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedSchemaOrReference{} - pair.Name = k - var err error - pair.Value, err = NewSchemaOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewReference creates an object of type Reference if possible, returning an error if not. -func NewReference(in *yaml.Node, context *compiler.Context) (*Reference, error) { - errors := make([]error, 0) - x := &Reference{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"$ref"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string _ref = 1; - v1 := compiler.MapValueForKey(m, "$ref") - if v1 != nil { - x.XRef, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for $ref: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string summary = 2; - v2 := compiler.MapValueForKey(m, "summary") - if v2 != nil { - x.Summary, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for summary: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewRequestBodiesOrReferences creates an object of type RequestBodiesOrReferences if possible, returning an error if not. -func NewRequestBodiesOrReferences(in *yaml.Node, context *compiler.Context) (*RequestBodiesOrReferences, error) { - errors := make([]error, 0) - x := &RequestBodiesOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedRequestBodyOrReference additional_properties = 1; - // MAP: RequestBodyOrReference - x.AdditionalProperties = make([]*NamedRequestBodyOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedRequestBodyOrReference{} - pair.Name = k - var err error - pair.Value, err = NewRequestBodyOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewRequestBody creates an object of type RequestBody if possible, returning an error if not. -func NewRequestBody(in *yaml.Node, context *compiler.Context) (*RequestBody, error) { - errors := make([]error, 0) - x := &RequestBody{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"content"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"content", "description", "required"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string description = 1; - v1 := compiler.MapValueForKey(m, "description") - if v1 != nil { - x.Description, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // MediaTypes content = 2; - v2 := compiler.MapValueForKey(m, "content") - if v2 != nil { - var err error - x.Content, err = NewMediaTypes(v2, compiler.NewContext("content", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // bool required = 3; - v3 := compiler.MapValueForKey(m, "required") - if v3 != nil { - x.Required, ok = compiler.BoolForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 4; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewRequestBodyOrReference creates an object of type RequestBodyOrReference if possible, returning an error if not. -func NewRequestBodyOrReference(in *yaml.Node, context *compiler.Context) (*RequestBodyOrReference, error) { - errors := make([]error, 0) - x := &RequestBodyOrReference{} - matched := false - // RequestBody request_body = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewRequestBody(m, compiler.NewContext("requestBody", m, context)) - if matchingError == nil { - x.Oneof = &RequestBodyOrReference_RequestBody{RequestBody: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &RequestBodyOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid RequestBodyOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewResponse creates an object of type Response if possible, returning an error if not. -func NewResponse(in *yaml.Node, context *compiler.Context) (*Response, error) { - errors := make([]error, 0) - x := &Response{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"description"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"content", "description", "headers", "links"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string description = 1; - v1 := compiler.MapValueForKey(m, "description") - if v1 != nil { - x.Description, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // HeadersOrReferences headers = 2; - v2 := compiler.MapValueForKey(m, "headers") - if v2 != nil { - var err error - x.Headers, err = NewHeadersOrReferences(v2, compiler.NewContext("headers", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // MediaTypes content = 3; - v3 := compiler.MapValueForKey(m, "content") - if v3 != nil { - var err error - x.Content, err = NewMediaTypes(v3, compiler.NewContext("content", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // LinksOrReferences links = 4; - v4 := compiler.MapValueForKey(m, "links") - if v4 != nil { - var err error - x.Links, err = NewLinksOrReferences(v4, compiler.NewContext("links", v4, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 5; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewResponseOrReference creates an object of type ResponseOrReference if possible, returning an error if not. -func NewResponseOrReference(in *yaml.Node, context *compiler.Context) (*ResponseOrReference, error) { - errors := make([]error, 0) - x := &ResponseOrReference{} - matched := false - // Response response = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewResponse(m, compiler.NewContext("response", m, context)) - if matchingError == nil { - x.Oneof = &ResponseOrReference_Response{Response: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &ResponseOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid ResponseOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewResponses creates an object of type Responses if possible, returning an error if not. -func NewResponses(in *yaml.Node, context *compiler.Context) (*Responses, error) { - errors := make([]error, 0) - x := &Responses{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"default"} - allowedPatterns := []*regexp.Regexp{pattern3, pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // ResponseOrReference default = 1; - v1 := compiler.MapValueForKey(m, "default") - if v1 != nil { - var err error - x.Default, err = NewResponseOrReference(v1, compiler.NewContext("default", v1, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedResponseOrReference response_or_reference = 2; - // MAP: ResponseOrReference ^([0-9X]{3})$ - x.ResponseOrReference = make([]*NamedResponseOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if pattern3.MatchString(k) { - pair := &NamedResponseOrReference{} - pair.Name = k - var err error - pair.Value, err = NewResponseOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.ResponseOrReference = append(x.ResponseOrReference, pair) - } - } - } - // repeated NamedAny specification_extension = 3; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewResponsesOrReferences creates an object of type ResponsesOrReferences if possible, returning an error if not. -func NewResponsesOrReferences(in *yaml.Node, context *compiler.Context) (*ResponsesOrReferences, error) { - errors := make([]error, 0) - x := &ResponsesOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedResponseOrReference additional_properties = 1; - // MAP: ResponseOrReference - x.AdditionalProperties = make([]*NamedResponseOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedResponseOrReference{} - pair.Name = k - var err error - pair.Value, err = NewResponseOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSchema creates an object of type Schema if possible, returning an error if not. -func NewSchema(in *yaml.Node, context *compiler.Context) (*Schema, error) { - errors := make([]error, 0) - x := &Schema{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"additionalProperties", "allOf", "anyOf", "default", "deprecated", "description", "discriminator", "enum", "example", "exclusiveMaximum", "exclusiveMinimum", "externalDocs", "format", "items", "maxItems", "maxLength", "maxProperties", "maximum", "minItems", "minLength", "minProperties", "minimum", "multipleOf", "not", "nullable", "oneOf", "pattern", "properties", "readOnly", "required", "title", "type", "uniqueItems", "writeOnly", "xml"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // bool nullable = 1; - v1 := compiler.MapValueForKey(m, "nullable") - if v1 != nil { - x.Nullable, ok = compiler.BoolForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for nullable: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Discriminator discriminator = 2; - v2 := compiler.MapValueForKey(m, "discriminator") - if v2 != nil { - var err error - x.Discriminator, err = NewDiscriminator(v2, compiler.NewContext("discriminator", v2, context)) - if err != nil { - errors = append(errors, err) - } - } - // bool read_only = 3; - v3 := compiler.MapValueForKey(m, "readOnly") - if v3 != nil { - x.ReadOnly, ok = compiler.BoolForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for readOnly: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool write_only = 4; - v4 := compiler.MapValueForKey(m, "writeOnly") - if v4 != nil { - x.WriteOnly, ok = compiler.BoolForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for writeOnly: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // Xml xml = 5; - v5 := compiler.MapValueForKey(m, "xml") - if v5 != nil { - var err error - x.Xml, err = NewXml(v5, compiler.NewContext("xml", v5, context)) - if err != nil { - errors = append(errors, err) - } - } - // ExternalDocs external_docs = 6; - v6 := compiler.MapValueForKey(m, "externalDocs") - if v6 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v6, compiler.NewContext("externalDocs", v6, context)) - if err != nil { - errors = append(errors, err) - } - } - // Any example = 7; - v7 := compiler.MapValueForKey(m, "example") - if v7 != nil { - var err error - x.Example, err = NewAny(v7, compiler.NewContext("example", v7, context)) - if err != nil { - errors = append(errors, err) - } - } - // bool deprecated = 8; - v8 := compiler.MapValueForKey(m, "deprecated") - if v8 != nil { - x.Deprecated, ok = compiler.BoolForScalarNode(v8) - if !ok { - message := fmt.Sprintf("has unexpected value for deprecated: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string title = 9; - v9 := compiler.MapValueForKey(m, "title") - if v9 != nil { - x.Title, ok = compiler.StringForScalarNode(v9) - if !ok { - message := fmt.Sprintf("has unexpected value for title: %s", compiler.Display(v9)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float multiple_of = 10; - v10 := compiler.MapValueForKey(m, "multipleOf") - if v10 != nil { - v, ok := compiler.FloatForScalarNode(v10) - if ok { - x.MultipleOf = v - } else { - message := fmt.Sprintf("has unexpected value for multipleOf: %s", compiler.Display(v10)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float maximum = 11; - v11 := compiler.MapValueForKey(m, "maximum") - if v11 != nil { - v, ok := compiler.FloatForScalarNode(v11) - if ok { - x.Maximum = v - } else { - message := fmt.Sprintf("has unexpected value for maximum: %s", compiler.Display(v11)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_maximum = 12; - v12 := compiler.MapValueForKey(m, "exclusiveMaximum") - if v12 != nil { - x.ExclusiveMaximum, ok = compiler.BoolForScalarNode(v12) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %s", compiler.Display(v12)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // float minimum = 13; - v13 := compiler.MapValueForKey(m, "minimum") - if v13 != nil { - v, ok := compiler.FloatForScalarNode(v13) - if ok { - x.Minimum = v - } else { - message := fmt.Sprintf("has unexpected value for minimum: %s", compiler.Display(v13)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool exclusive_minimum = 14; - v14 := compiler.MapValueForKey(m, "exclusiveMinimum") - if v14 != nil { - x.ExclusiveMinimum, ok = compiler.BoolForScalarNode(v14) - if !ok { - message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %s", compiler.Display(v14)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_length = 15; - v15 := compiler.MapValueForKey(m, "maxLength") - if v15 != nil { - t, ok := compiler.IntForScalarNode(v15) - if ok { - x.MaxLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxLength: %s", compiler.Display(v15)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_length = 16; - v16 := compiler.MapValueForKey(m, "minLength") - if v16 != nil { - t, ok := compiler.IntForScalarNode(v16) - if ok { - x.MinLength = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minLength: %s", compiler.Display(v16)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string pattern = 17; - v17 := compiler.MapValueForKey(m, "pattern") - if v17 != nil { - x.Pattern, ok = compiler.StringForScalarNode(v17) - if !ok { - message := fmt.Sprintf("has unexpected value for pattern: %s", compiler.Display(v17)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_items = 18; - v18 := compiler.MapValueForKey(m, "maxItems") - if v18 != nil { - t, ok := compiler.IntForScalarNode(v18) - if ok { - x.MaxItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxItems: %s", compiler.Display(v18)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_items = 19; - v19 := compiler.MapValueForKey(m, "minItems") - if v19 != nil { - t, ok := compiler.IntForScalarNode(v19) - if ok { - x.MinItems = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minItems: %s", compiler.Display(v19)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool unique_items = 20; - v20 := compiler.MapValueForKey(m, "uniqueItems") - if v20 != nil { - x.UniqueItems, ok = compiler.BoolForScalarNode(v20) - if !ok { - message := fmt.Sprintf("has unexpected value for uniqueItems: %s", compiler.Display(v20)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 max_properties = 21; - v21 := compiler.MapValueForKey(m, "maxProperties") - if v21 != nil { - t, ok := compiler.IntForScalarNode(v21) - if ok { - x.MaxProperties = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for maxProperties: %s", compiler.Display(v21)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // int64 min_properties = 22; - v22 := compiler.MapValueForKey(m, "minProperties") - if v22 != nil { - t, ok := compiler.IntForScalarNode(v22) - if ok { - x.MinProperties = int64(t) - } else { - message := fmt.Sprintf("has unexpected value for minProperties: %s", compiler.Display(v22)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated string required = 23; - v23 := compiler.MapValueForKey(m, "required") - if v23 != nil { - v, ok := compiler.SequenceNodeForNode(v23) - if ok { - x.Required = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for required: %s", compiler.Display(v23)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated Any enum = 24; - v24 := compiler.MapValueForKey(m, "enum") - if v24 != nil { - // repeated Any - x.Enum = make([]*Any, 0) - a, ok := compiler.SequenceNodeForNode(v24) - if ok { - for _, item := range a.Content { - y, err := NewAny(item, compiler.NewContext("enum", item, context)) - if err != nil { - errors = append(errors, err) - } - x.Enum = append(x.Enum, y) - } - } - } - // string type = 25; - v25 := compiler.MapValueForKey(m, "type") - if v25 != nil { - x.Type, ok = compiler.StringForScalarNode(v25) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v25)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated SchemaOrReference all_of = 26; - v26 := compiler.MapValueForKey(m, "allOf") - if v26 != nil { - // repeated SchemaOrReference - x.AllOf = make([]*SchemaOrReference, 0) - a, ok := compiler.SequenceNodeForNode(v26) - if ok { - for _, item := range a.Content { - y, err := NewSchemaOrReference(item, compiler.NewContext("allOf", item, context)) - if err != nil { - errors = append(errors, err) - } - x.AllOf = append(x.AllOf, y) - } - } - } - // repeated SchemaOrReference one_of = 27; - v27 := compiler.MapValueForKey(m, "oneOf") - if v27 != nil { - // repeated SchemaOrReference - x.OneOf = make([]*SchemaOrReference, 0) - a, ok := compiler.SequenceNodeForNode(v27) - if ok { - for _, item := range a.Content { - y, err := NewSchemaOrReference(item, compiler.NewContext("oneOf", item, context)) - if err != nil { - errors = append(errors, err) - } - x.OneOf = append(x.OneOf, y) - } - } - } - // repeated SchemaOrReference any_of = 28; - v28 := compiler.MapValueForKey(m, "anyOf") - if v28 != nil { - // repeated SchemaOrReference - x.AnyOf = make([]*SchemaOrReference, 0) - a, ok := compiler.SequenceNodeForNode(v28) - if ok { - for _, item := range a.Content { - y, err := NewSchemaOrReference(item, compiler.NewContext("anyOf", item, context)) - if err != nil { - errors = append(errors, err) - } - x.AnyOf = append(x.AnyOf, y) - } - } - } - // Schema not = 29; - v29 := compiler.MapValueForKey(m, "not") - if v29 != nil { - var err error - x.Not, err = NewSchema(v29, compiler.NewContext("not", v29, context)) - if err != nil { - errors = append(errors, err) - } - } - // ItemsItem items = 30; - v30 := compiler.MapValueForKey(m, "items") - if v30 != nil { - var err error - x.Items, err = NewItemsItem(v30, compiler.NewContext("items", v30, context)) - if err != nil { - errors = append(errors, err) - } - } - // Properties properties = 31; - v31 := compiler.MapValueForKey(m, "properties") - if v31 != nil { - var err error - x.Properties, err = NewProperties(v31, compiler.NewContext("properties", v31, context)) - if err != nil { - errors = append(errors, err) - } - } - // AdditionalPropertiesItem additional_properties = 32; - v32 := compiler.MapValueForKey(m, "additionalProperties") - if v32 != nil { - var err error - x.AdditionalProperties, err = NewAdditionalPropertiesItem(v32, compiler.NewContext("additionalProperties", v32, context)) - if err != nil { - errors = append(errors, err) - } - } - // DefaultType default = 33; - v33 := compiler.MapValueForKey(m, "default") - if v33 != nil { - var err error - x.Default, err = NewDefaultType(v33, compiler.NewContext("default", v33, context)) - if err != nil { - errors = append(errors, err) - } - } - // string description = 34; - v34 := compiler.MapValueForKey(m, "description") - if v34 != nil { - x.Description, ok = compiler.StringForScalarNode(v34) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v34)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string format = 35; - v35 := compiler.MapValueForKey(m, "format") - if v35 != nil { - x.Format, ok = compiler.StringForScalarNode(v35) - if !ok { - message := fmt.Sprintf("has unexpected value for format: %s", compiler.Display(v35)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 36; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSchemaOrReference creates an object of type SchemaOrReference if possible, returning an error if not. -func NewSchemaOrReference(in *yaml.Node, context *compiler.Context) (*SchemaOrReference, error) { - errors := make([]error, 0) - x := &SchemaOrReference{} - matched := false - // Schema schema = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewSchema(m, compiler.NewContext("schema", m, context)) - if matchingError == nil { - x.Oneof = &SchemaOrReference_Schema{Schema: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &SchemaOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid SchemaOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSchemasOrReferences creates an object of type SchemasOrReferences if possible, returning an error if not. -func NewSchemasOrReferences(in *yaml.Node, context *compiler.Context) (*SchemasOrReferences, error) { - errors := make([]error, 0) - x := &SchemasOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedSchemaOrReference additional_properties = 1; - // MAP: SchemaOrReference - x.AdditionalProperties = make([]*NamedSchemaOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedSchemaOrReference{} - pair.Name = k - var err error - pair.Value, err = NewSchemaOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSecurityRequirement creates an object of type SecurityRequirement if possible, returning an error if not. -func NewSecurityRequirement(in *yaml.Node, context *compiler.Context) (*SecurityRequirement, error) { - errors := make([]error, 0) - x := &SecurityRequirement{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedStringArray additional_properties = 1; - // MAP: StringArray - x.AdditionalProperties = make([]*NamedStringArray, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedStringArray{} - pair.Name = k - var err error - pair.Value, err = NewStringArray(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSecurityScheme creates an object of type SecurityScheme if possible, returning an error if not. -func NewSecurityScheme(in *yaml.Node, context *compiler.Context) (*SecurityScheme, error) { - errors := make([]error, 0) - x := &SecurityScheme{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"type"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"bearerFormat", "description", "flows", "in", "name", "openIdConnectUrl", "scheme", "type"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string type = 1; - v1 := compiler.MapValueForKey(m, "type") - if v1 != nil { - x.Type, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for type: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 2; - v2 := compiler.MapValueForKey(m, "description") - if v2 != nil { - x.Description, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string name = 3; - v3 := compiler.MapValueForKey(m, "name") - if v3 != nil { - x.Name, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string in = 4; - v4 := compiler.MapValueForKey(m, "in") - if v4 != nil { - x.In, ok = compiler.StringForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for in: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string scheme = 5; - v5 := compiler.MapValueForKey(m, "scheme") - if v5 != nil { - x.Scheme, ok = compiler.StringForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for scheme: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string bearer_format = 6; - v6 := compiler.MapValueForKey(m, "bearerFormat") - if v6 != nil { - x.BearerFormat, ok = compiler.StringForScalarNode(v6) - if !ok { - message := fmt.Sprintf("has unexpected value for bearerFormat: %s", compiler.Display(v6)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // OauthFlows flows = 7; - v7 := compiler.MapValueForKey(m, "flows") - if v7 != nil { - var err error - x.Flows, err = NewOauthFlows(v7, compiler.NewContext("flows", v7, context)) - if err != nil { - errors = append(errors, err) - } - } - // string open_id_connect_url = 8; - v8 := compiler.MapValueForKey(m, "openIdConnectUrl") - if v8 != nil { - x.OpenIdConnectUrl, ok = compiler.StringForScalarNode(v8) - if !ok { - message := fmt.Sprintf("has unexpected value for openIdConnectUrl: %s", compiler.Display(v8)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 9; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSecuritySchemeOrReference creates an object of type SecuritySchemeOrReference if possible, returning an error if not. -func NewSecuritySchemeOrReference(in *yaml.Node, context *compiler.Context) (*SecuritySchemeOrReference, error) { - errors := make([]error, 0) - x := &SecuritySchemeOrReference{} - matched := false - // SecurityScheme security_scheme = 1; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewSecurityScheme(m, compiler.NewContext("securityScheme", m, context)) - if matchingError == nil { - x.Oneof = &SecuritySchemeOrReference_SecurityScheme{SecurityScheme: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - // Reference reference = 2; - { - m, ok := compiler.UnpackMap(in) - if ok { - // errors might be ok here, they mean we just don't have the right subtype - t, matchingError := NewReference(m, compiler.NewContext("reference", m, context)) - if matchingError == nil { - x.Oneof = &SecuritySchemeOrReference_Reference{Reference: t} - matched = true - } else { - errors = append(errors, matchingError) - } - } - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } else { - message := fmt.Sprintf("contains an invalid SecuritySchemeOrReference") - err := compiler.NewError(context, message) - errors = []error{err} - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSecuritySchemesOrReferences creates an object of type SecuritySchemesOrReferences if possible, returning an error if not. -func NewSecuritySchemesOrReferences(in *yaml.Node, context *compiler.Context) (*SecuritySchemesOrReferences, error) { - errors := make([]error, 0) - x := &SecuritySchemesOrReferences{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedSecuritySchemeOrReference additional_properties = 1; - // MAP: SecuritySchemeOrReference - x.AdditionalProperties = make([]*NamedSecuritySchemeOrReference, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedSecuritySchemeOrReference{} - pair.Name = k - var err error - pair.Value, err = NewSecuritySchemeOrReference(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewServer creates an object of type Server if possible, returning an error if not. -func NewServer(in *yaml.Node, context *compiler.Context) (*Server, error) { - errors := make([]error, 0) - x := &Server{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"url"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "url", "variables"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string url = 1; - v1 := compiler.MapValueForKey(m, "url") - if v1 != nil { - x.Url, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for url: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 2; - v2 := compiler.MapValueForKey(m, "description") - if v2 != nil { - x.Description, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ServerVariables variables = 3; - v3 := compiler.MapValueForKey(m, "variables") - if v3 != nil { - var err error - x.Variables, err = NewServerVariables(v3, compiler.NewContext("variables", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 4; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewServerVariable creates an object of type ServerVariable if possible, returning an error if not. -func NewServerVariable(in *yaml.Node, context *compiler.Context) (*ServerVariable, error) { - errors := make([]error, 0) - x := &ServerVariable{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"default"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"default", "description", "enum"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // repeated string enum = 1; - v1 := compiler.MapValueForKey(m, "enum") - if v1 != nil { - v, ok := compiler.SequenceNodeForNode(v1) - if ok { - x.Enum = compiler.StringArrayForSequenceNode(v) - } else { - message := fmt.Sprintf("has unexpected value for enum: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string default = 2; - v2 := compiler.MapValueForKey(m, "default") - if v2 != nil { - x.Default, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for default: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 3; - v3 := compiler.MapValueForKey(m, "description") - if v3 != nil { - x.Description, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 4; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewServerVariables creates an object of type ServerVariables if possible, returning an error if not. -func NewServerVariables(in *yaml.Node, context *compiler.Context) (*ServerVariables, error) { - errors := make([]error, 0) - x := &ServerVariables{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedServerVariable additional_properties = 1; - // MAP: ServerVariable - x.AdditionalProperties = make([]*NamedServerVariable, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedServerVariable{} - pair.Name = k - var err error - pair.Value, err = NewServerVariable(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewSpecificationExtension creates an object of type SpecificationExtension if possible, returning an error if not. -func NewSpecificationExtension(in *yaml.Node, context *compiler.Context) (*SpecificationExtension, error) { - errors := make([]error, 0) - x := &SpecificationExtension{} - matched := false - switch in.Tag { - case "!!bool": - var v bool - v, matched = compiler.BoolForScalarNode(in) - x.Oneof = &SpecificationExtension_Boolean{Boolean: v} - case "!!str": - var v string - v, matched = compiler.StringForScalarNode(in) - x.Oneof = &SpecificationExtension_String_{String_: v} - case "!!float": - var v float64 - v, matched = compiler.FloatForScalarNode(in) - x.Oneof = &SpecificationExtension_Number{Number: v} - case "!!int": - var v int64 - v, matched = compiler.IntForScalarNode(in) - x.Oneof = &SpecificationExtension_Number{Number: float64(v)} - } - if matched { - // since the oneof matched one of its possibilities, discard any matching errors - errors = make([]error, 0) - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewStringArray creates an object of type StringArray if possible, returning an error if not. -func NewStringArray(in *yaml.Node, context *compiler.Context) (*StringArray, error) { - errors := make([]error, 0) - x := &StringArray{} - x.Value = make([]string, 0) - for _, node := range in.Content { - s, _ := compiler.StringForScalarNode(node) - x.Value = append(x.Value, s) - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewStrings creates an object of type Strings if possible, returning an error if not. -func NewStrings(in *yaml.Node, context *compiler.Context) (*Strings, error) { - errors := make([]error, 0) - x := &Strings{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - // repeated NamedString additional_properties = 1; - // MAP: string - x.AdditionalProperties = make([]*NamedString, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - pair := &NamedString{} - pair.Name = k - pair.Value, _ = compiler.StringForScalarNode(v) - x.AdditionalProperties = append(x.AdditionalProperties, pair) - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewTag creates an object of type Tag if possible, returning an error if not. -func NewTag(in *yaml.Node, context *compiler.Context) (*Tag, error) { - errors := make([]error, 0) - x := &Tag{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - requiredKeys := []string{"name"} - missingKeys := compiler.MissingKeysInMap(m, requiredKeys) - if len(missingKeys) > 0 { - message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - allowedKeys := []string{"description", "externalDocs", "name"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string description = 2; - v2 := compiler.MapValueForKey(m, "description") - if v2 != nil { - x.Description, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for description: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // ExternalDocs external_docs = 3; - v3 := compiler.MapValueForKey(m, "externalDocs") - if v3 != nil { - var err error - x.ExternalDocs, err = NewExternalDocs(v3, compiler.NewContext("externalDocs", v3, context)) - if err != nil { - errors = append(errors, err) - } - } - // repeated NamedAny specification_extension = 4; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// NewXml creates an object of type Xml if possible, returning an error if not. -func NewXml(in *yaml.Node, context *compiler.Context) (*Xml, error) { - errors := make([]error, 0) - x := &Xml{} - m, ok := compiler.UnpackMap(in) - if !ok { - message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) - errors = append(errors, compiler.NewError(context, message)) - } else { - allowedKeys := []string{"attribute", "name", "namespace", "prefix", "wrapped"} - allowedPatterns := []*regexp.Regexp{pattern1} - invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) - if len(invalidKeys) > 0 { - message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) - errors = append(errors, compiler.NewError(context, message)) - } - // string name = 1; - v1 := compiler.MapValueForKey(m, "name") - if v1 != nil { - x.Name, ok = compiler.StringForScalarNode(v1) - if !ok { - message := fmt.Sprintf("has unexpected value for name: %s", compiler.Display(v1)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string namespace = 2; - v2 := compiler.MapValueForKey(m, "namespace") - if v2 != nil { - x.Namespace, ok = compiler.StringForScalarNode(v2) - if !ok { - message := fmt.Sprintf("has unexpected value for namespace: %s", compiler.Display(v2)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // string prefix = 3; - v3 := compiler.MapValueForKey(m, "prefix") - if v3 != nil { - x.Prefix, ok = compiler.StringForScalarNode(v3) - if !ok { - message := fmt.Sprintf("has unexpected value for prefix: %s", compiler.Display(v3)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool attribute = 4; - v4 := compiler.MapValueForKey(m, "attribute") - if v4 != nil { - x.Attribute, ok = compiler.BoolForScalarNode(v4) - if !ok { - message := fmt.Sprintf("has unexpected value for attribute: %s", compiler.Display(v4)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // bool wrapped = 5; - v5 := compiler.MapValueForKey(m, "wrapped") - if v5 != nil { - x.Wrapped, ok = compiler.BoolForScalarNode(v5) - if !ok { - message := fmt.Sprintf("has unexpected value for wrapped: %s", compiler.Display(v5)) - errors = append(errors, compiler.NewError(context, message)) - } - } - // repeated NamedAny specification_extension = 6; - // MAP: Any ^x- - x.SpecificationExtension = make([]*NamedAny, 0) - for i := 0; i < len(m.Content); i += 2 { - k, ok := compiler.StringForScalarNode(m.Content[i]) - if ok { - v := m.Content[i+1] - if strings.HasPrefix(k, "x-") { - pair := &NamedAny{} - pair.Name = k - result := &Any{} - handled, resultFromExt, err := compiler.CallExtension(context, v, k) - if handled { - if err != nil { - errors = append(errors, err) - } else { - bytes := compiler.Marshal(v) - result.Yaml = string(bytes) - result.Value = resultFromExt - pair.Value = result - } - } else { - pair.Value, err = NewAny(v, compiler.NewContext(k, v, context)) - if err != nil { - errors = append(errors, err) - } - } - x.SpecificationExtension = append(x.SpecificationExtension, pair) - } - } - } - } - return x, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside AdditionalPropertiesItem objects. -func (m *AdditionalPropertiesItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*AdditionalPropertiesItem_SchemaOrReference) - if ok { - _, err := p.SchemaOrReference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Any objects. -func (m *Any) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside AnyOrExpression objects. -func (m *AnyOrExpression) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*AnyOrExpression_Any) - if ok { - _, err := p.Any.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*AnyOrExpression_Expression) - if ok { - _, err := p.Expression.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Callback objects. -func (m *Callback) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.Path { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside CallbackOrReference objects. -func (m *CallbackOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*CallbackOrReference_Callback) - if ok { - _, err := p.Callback.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*CallbackOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside CallbacksOrReferences objects. -func (m *CallbacksOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Components objects. -func (m *Components) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Schemas != nil { - _, err := m.Schemas.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Responses != nil { - _, err := m.Responses.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Parameters != nil { - _, err := m.Parameters.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Examples != nil { - _, err := m.Examples.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.RequestBodies != nil { - _, err := m.RequestBodies.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Headers != nil { - _, err := m.Headers.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.SecuritySchemes != nil { - _, err := m.SecuritySchemes.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Links != nil { - _, err := m.Links.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Callbacks != nil { - _, err := m.Callbacks.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Contact objects. -func (m *Contact) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside DefaultType objects. -func (m *DefaultType) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Discriminator objects. -func (m *Discriminator) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Mapping != nil { - _, err := m.Mapping.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Document objects. -func (m *Document) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Info != nil { - _, err := m.Info.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Servers { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.Paths != nil { - _, err := m.Paths.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Components != nil { - _, err := m.Components.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Security { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.Tags { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Encoding objects. -func (m *Encoding) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Headers != nil { - _, err := m.Headers.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Encodings objects. -func (m *Encodings) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Example objects. -func (m *Example) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ExampleOrReference objects. -func (m *ExampleOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*ExampleOrReference_Example) - if ok { - _, err := p.Example.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*ExampleOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ExamplesOrReferences objects. -func (m *ExamplesOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Expression objects. -func (m *Expression) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ExternalDocs objects. -func (m *ExternalDocs) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Header objects. -func (m *Header) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Schema != nil { - _, err := m.Schema.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Example != nil { - _, err := m.Example.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Examples != nil { - _, err := m.Examples.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Content != nil { - _, err := m.Content.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside HeaderOrReference objects. -func (m *HeaderOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*HeaderOrReference_Header) - if ok { - _, err := p.Header.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*HeaderOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside HeadersOrReferences objects. -func (m *HeadersOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Info objects. -func (m *Info) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Contact != nil { - _, err := m.Contact.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.License != nil { - _, err := m.License.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ItemsItem objects. -func (m *ItemsItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.SchemaOrReference { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside License objects. -func (m *License) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Link objects. -func (m *Link) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Parameters != nil { - _, err := m.Parameters.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.RequestBody != nil { - _, err := m.RequestBody.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Server != nil { - _, err := m.Server.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside LinkOrReference objects. -func (m *LinkOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*LinkOrReference_Link) - if ok { - _, err := p.Link.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*LinkOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside LinksOrReferences objects. -func (m *LinksOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside MediaType objects. -func (m *MediaType) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Schema != nil { - _, err := m.Schema.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Example != nil { - _, err := m.Example.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Examples != nil { - _, err := m.Examples.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Encoding != nil { - _, err := m.Encoding.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside MediaTypes objects. -func (m *MediaTypes) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedAny objects. -func (m *NamedAny) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedCallbackOrReference objects. -func (m *NamedCallbackOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedEncoding objects. -func (m *NamedEncoding) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedExampleOrReference objects. -func (m *NamedExampleOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedHeaderOrReference objects. -func (m *NamedHeaderOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedLinkOrReference objects. -func (m *NamedLinkOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedMediaType objects. -func (m *NamedMediaType) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedParameterOrReference objects. -func (m *NamedParameterOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedPathItem objects. -func (m *NamedPathItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedRequestBodyOrReference objects. -func (m *NamedRequestBodyOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedResponseOrReference objects. -func (m *NamedResponseOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedSchemaOrReference objects. -func (m *NamedSchemaOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedSecuritySchemeOrReference objects. -func (m *NamedSecuritySchemeOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedServerVariable objects. -func (m *NamedServerVariable) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedString objects. -func (m *NamedString) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside NamedStringArray objects. -func (m *NamedStringArray) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Value != nil { - _, err := m.Value.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside OauthFlow objects. -func (m *OauthFlow) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Scopes != nil { - _, err := m.Scopes.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside OauthFlows objects. -func (m *OauthFlows) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Implicit != nil { - _, err := m.Implicit.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Password != nil { - _, err := m.Password.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.ClientCredentials != nil { - _, err := m.ClientCredentials.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.AuthorizationCode != nil { - _, err := m.AuthorizationCode.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Object objects. -func (m *Object) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Operation objects. -func (m *Operation) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Parameters { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.RequestBody != nil { - _, err := m.RequestBody.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Responses != nil { - _, err := m.Responses.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Callbacks != nil { - _, err := m.Callbacks.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Security { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.Servers { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Parameter objects. -func (m *Parameter) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Schema != nil { - _, err := m.Schema.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Example != nil { - _, err := m.Example.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Examples != nil { - _, err := m.Examples.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Content != nil { - _, err := m.Content.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ParameterOrReference objects. -func (m *ParameterOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*ParameterOrReference_Parameter) - if ok { - _, err := p.Parameter.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*ParameterOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ParametersOrReferences objects. -func (m *ParametersOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside PathItem objects. -func (m *PathItem) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.XRef != "" { - info, err := compiler.ReadInfoForRef(root, m.XRef) - if err != nil { - return nil, err - } - if info != nil { - replacement, err := NewPathItem(info, nil) - if err == nil { - *m = *replacement - return m.ResolveReferences(root) - } - } - return info, nil - } - if m.Get != nil { - _, err := m.Get.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Put != nil { - _, err := m.Put.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Post != nil { - _, err := m.Post.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Delete != nil { - _, err := m.Delete.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Options != nil { - _, err := m.Options.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Head != nil { - _, err := m.Head.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Patch != nil { - _, err := m.Patch.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Trace != nil { - _, err := m.Trace.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Servers { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.Parameters { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Paths objects. -func (m *Paths) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.Path { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Properties objects. -func (m *Properties) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Reference objects. -func (m *Reference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.XRef != "" { - info, err := compiler.ReadInfoForRef(root, m.XRef) - if err != nil { - return nil, err - } - if info != nil { - replacement, err := NewReference(info, nil) - if err == nil { - *m = *replacement - return m.ResolveReferences(root) - } - } - return info, nil - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside RequestBodiesOrReferences objects. -func (m *RequestBodiesOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside RequestBody objects. -func (m *RequestBody) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Content != nil { - _, err := m.Content.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside RequestBodyOrReference objects. -func (m *RequestBodyOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*RequestBodyOrReference_RequestBody) - if ok { - _, err := p.RequestBody.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*RequestBodyOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Response objects. -func (m *Response) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Headers != nil { - _, err := m.Headers.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Content != nil { - _, err := m.Content.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Links != nil { - _, err := m.Links.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ResponseOrReference objects. -func (m *ResponseOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*ResponseOrReference_Response) - if ok { - _, err := p.Response.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*ResponseOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Responses objects. -func (m *Responses) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.ResponseOrReference { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ResponsesOrReferences objects. -func (m *ResponsesOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Schema objects. -func (m *Schema) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Discriminator != nil { - _, err := m.Discriminator.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Xml != nil { - _, err := m.Xml.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Example != nil { - _, err := m.Example.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.Enum { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.AllOf { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.OneOf { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - for _, item := range m.AnyOf { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - if m.Not != nil { - _, err := m.Not.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Items != nil { - _, err := m.Items.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Properties != nil { - _, err := m.Properties.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.AdditionalProperties != nil { - _, err := m.AdditionalProperties.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - if m.Default != nil { - _, err := m.Default.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SchemaOrReference objects. -func (m *SchemaOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*SchemaOrReference_Schema) - if ok { - _, err := p.Schema.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*SchemaOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SchemasOrReferences objects. -func (m *SchemasOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SecurityRequirement objects. -func (m *SecurityRequirement) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SecurityScheme objects. -func (m *SecurityScheme) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Flows != nil { - _, err := m.Flows.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SecuritySchemeOrReference objects. -func (m *SecuritySchemeOrReference) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - { - p, ok := m.Oneof.(*SecuritySchemeOrReference_SecurityScheme) - if ok { - _, err := p.SecurityScheme.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - { - p, ok := m.Oneof.(*SecuritySchemeOrReference_Reference) - if ok { - _, err := p.Reference.ResolveReferences(root) - if err != nil { - return nil, err - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SecuritySchemesOrReferences objects. -func (m *SecuritySchemesOrReferences) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Server objects. -func (m *Server) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.Variables != nil { - _, err := m.Variables.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ServerVariable objects. -func (m *ServerVariable) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside ServerVariables objects. -func (m *ServerVariables) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside SpecificationExtension objects. -func (m *SpecificationExtension) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside StringArray objects. -func (m *StringArray) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Strings objects. -func (m *Strings) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.AdditionalProperties { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Tag objects. -func (m *Tag) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - if m.ExternalDocs != nil { - _, err := m.ExternalDocs.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ResolveReferences resolves references found inside Xml objects. -func (m *Xml) ResolveReferences(root string) (*yaml.Node, error) { - errors := make([]error, 0) - for _, item := range m.SpecificationExtension { - if item != nil { - _, err := item.ResolveReferences(root) - if err != nil { - errors = append(errors, err) - } - } - } - return nil, compiler.NewErrorGroupOrNil(errors) -} - -// ToRawInfo returns a description of AdditionalPropertiesItem suitable for JSON or YAML export. -func (m *AdditionalPropertiesItem) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // AdditionalPropertiesItem - // {Name:schemaOrReference Type:SchemaOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetSchemaOrReference() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:boolean Type:bool StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - if v1, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { - return compiler.NewScalarNodeForBool(v1.Boolean) - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of Any suitable for JSON or YAML export. -func (m *Any) ToRawInfo() *yaml.Node { - var err error - var node yaml.Node - err = yaml.Unmarshal([]byte(m.Yaml), &node) - if err == nil { - if node.Kind == yaml.DocumentNode { - return node.Content[0] - } - return &node - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of AnyOrExpression suitable for JSON or YAML export. -func (m *AnyOrExpression) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // AnyOrExpression - // {Name:any Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetAny() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:expression Type:Expression StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetExpression() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of Callback suitable for JSON or YAML export. -func (m *Callback) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Path != nil { - for _, item := range m.Path { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of CallbackOrReference suitable for JSON or YAML export. -func (m *CallbackOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // CallbackOrReference - // {Name:callback Type:Callback StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetCallback() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of CallbacksOrReferences suitable for JSON or YAML export. -func (m *CallbacksOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Components suitable for JSON or YAML export. -func (m *Components) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Schemas != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("schemas")) - info.Content = append(info.Content, m.Schemas.ToRawInfo()) - } - if m.Responses != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("responses")) - info.Content = append(info.Content, m.Responses.ToRawInfo()) - } - if m.Parameters != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) - info.Content = append(info.Content, m.Parameters.ToRawInfo()) - } - if m.Examples != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("examples")) - info.Content = append(info.Content, m.Examples.ToRawInfo()) - } - if m.RequestBodies != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("requestBodies")) - info.Content = append(info.Content, m.RequestBodies.ToRawInfo()) - } - if m.Headers != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("headers")) - info.Content = append(info.Content, m.Headers.ToRawInfo()) - } - if m.SecuritySchemes != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("securitySchemes")) - info.Content = append(info.Content, m.SecuritySchemes.ToRawInfo()) - } - if m.Links != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("links")) - info.Content = append(info.Content, m.Links.ToRawInfo()) - } - if m.Callbacks != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("callbacks")) - info.Content = append(info.Content, m.Callbacks.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Contact suitable for JSON or YAML export. -func (m *Contact) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Url != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) - } - if m.Email != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("email")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Email)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of DefaultType suitable for JSON or YAML export. -func (m *DefaultType) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // DefaultType - // {Name:number Type:float StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - if v0, ok := m.GetOneof().(*DefaultType_Number); ok { - return compiler.NewScalarNodeForFloat(v0.Number) - } - // {Name:boolean Type:bool StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - if v1, ok := m.GetOneof().(*DefaultType_Boolean); ok { - return compiler.NewScalarNodeForBool(v1.Boolean) - } - // {Name:string Type:string StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - if v2, ok := m.GetOneof().(*DefaultType_String_); ok { - return compiler.NewScalarNodeForString(v2.String_) - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of Discriminator suitable for JSON or YAML export. -func (m *Discriminator) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("propertyName")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.PropertyName)) - if m.Mapping != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("mapping")) - info.Content = append(info.Content, m.Mapping.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Document suitable for JSON or YAML export. -func (m *Document) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("openapi")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Openapi)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("info")) - info.Content = append(info.Content, m.Info.ToRawInfo()) - if len(m.Servers) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Servers { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("servers")) - info.Content = append(info.Content, items) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("paths")) - info.Content = append(info.Content, m.Paths.ToRawInfo()) - if m.Components != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("components")) - info.Content = append(info.Content, m.Components.ToRawInfo()) - } - if len(m.Security) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Security { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("security")) - info.Content = append(info.Content, items) - } - if len(m.Tags) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Tags { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("tags")) - info.Content = append(info.Content, items) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Encoding suitable for JSON or YAML export. -func (m *Encoding) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.ContentType != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("contentType")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.ContentType)) - } - if m.Headers != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("headers")) - info.Content = append(info.Content, m.Headers.ToRawInfo()) - } - if m.Style != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("style")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Style)) - } - if m.Explode != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("explode")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Explode)) - } - if m.AllowReserved != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("allowReserved")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowReserved)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Encodings suitable for JSON or YAML export. -func (m *Encodings) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Example suitable for JSON or YAML export. -func (m *Example) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Summary != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("summary")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Summary)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Value != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) - info.Content = append(info.Content, m.Value.ToRawInfo()) - } - if m.ExternalValue != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalValue")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.ExternalValue)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ExampleOrReference suitable for JSON or YAML export. -func (m *ExampleOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // ExampleOrReference - // {Name:example Type:Example StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetExample() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of ExamplesOrReferences suitable for JSON or YAML export. -func (m *ExamplesOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Expression suitable for JSON or YAML export. -func (m *Expression) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ExternalDocs suitable for JSON or YAML export. -func (m *ExternalDocs) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Header suitable for JSON or YAML export. -func (m *Header) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Required != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) - } - if m.Deprecated != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("deprecated")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Deprecated)) - } - if m.AllowEmptyValue != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("allowEmptyValue")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowEmptyValue)) - } - if m.Style != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("style")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Style)) - } - if m.Explode != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("explode")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Explode)) - } - if m.AllowReserved != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("allowReserved")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowReserved)) - } - if m.Schema != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) - info.Content = append(info.Content, m.Schema.ToRawInfo()) - } - if m.Example != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) - info.Content = append(info.Content, m.Example.ToRawInfo()) - } - if m.Examples != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("examples")) - info.Content = append(info.Content, m.Examples.ToRawInfo()) - } - if m.Content != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("content")) - info.Content = append(info.Content, m.Content.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of HeaderOrReference suitable for JSON or YAML export. -func (m *HeaderOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // HeaderOrReference - // {Name:header Type:Header StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetHeader() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of HeadersOrReferences suitable for JSON or YAML export. -func (m *HeadersOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Info suitable for JSON or YAML export. -func (m *Info) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.TermsOfService != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("termsOfService")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TermsOfService)) - } - if m.Contact != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("contact")) - info.Content = append(info.Content, m.Contact.ToRawInfo()) - } - if m.License != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("license")) - info.Content = append(info.Content, m.License.ToRawInfo()) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("version")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Version)) - if m.Summary != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("summary")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Summary)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ItemsItem suitable for JSON or YAML export. -func (m *ItemsItem) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if len(m.SchemaOrReference) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.SchemaOrReference { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("schemaOrReference")) - info.Content = append(info.Content, items) - } - return info -} - -// ToRawInfo returns a description of License suitable for JSON or YAML export. -func (m *License) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - if m.Url != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Link suitable for JSON or YAML export. -func (m *Link) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.OperationRef != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("operationRef")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.OperationRef)) - } - if m.OperationId != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("operationId")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.OperationId)) - } - if m.Parameters != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) - info.Content = append(info.Content, m.Parameters.ToRawInfo()) - } - if m.RequestBody != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("requestBody")) - info.Content = append(info.Content, m.RequestBody.ToRawInfo()) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Server != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("server")) - info.Content = append(info.Content, m.Server.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of LinkOrReference suitable for JSON or YAML export. -func (m *LinkOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // LinkOrReference - // {Name:link Type:Link StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetLink() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of LinksOrReferences suitable for JSON or YAML export. -func (m *LinksOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of MediaType suitable for JSON or YAML export. -func (m *MediaType) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Schema != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) - info.Content = append(info.Content, m.Schema.ToRawInfo()) - } - if m.Example != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) - info.Content = append(info.Content, m.Example.ToRawInfo()) - } - if m.Examples != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("examples")) - info.Content = append(info.Content, m.Examples.ToRawInfo()) - } - if m.Encoding != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("encoding")) - info.Content = append(info.Content, m.Encoding.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of MediaTypes suitable for JSON or YAML export. -func (m *MediaTypes) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of NamedAny suitable for JSON or YAML export. -func (m *NamedAny) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Value != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) - info.Content = append(info.Content, m.Value.ToRawInfo()) - } - return info -} - -// ToRawInfo returns a description of NamedCallbackOrReference suitable for JSON or YAML export. -func (m *NamedCallbackOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:CallbackOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedEncoding suitable for JSON or YAML export. -func (m *NamedEncoding) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:Encoding StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedExampleOrReference suitable for JSON or YAML export. -func (m *NamedExampleOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:ExampleOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedHeaderOrReference suitable for JSON or YAML export. -func (m *NamedHeaderOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:HeaderOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedLinkOrReference suitable for JSON or YAML export. -func (m *NamedLinkOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:LinkOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedMediaType suitable for JSON or YAML export. -func (m *NamedMediaType) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:MediaType StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedParameterOrReference suitable for JSON or YAML export. -func (m *NamedParameterOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:ParameterOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedPathItem suitable for JSON or YAML export. -func (m *NamedPathItem) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:PathItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedRequestBodyOrReference suitable for JSON or YAML export. -func (m *NamedRequestBodyOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:RequestBodyOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedResponseOrReference suitable for JSON or YAML export. -func (m *NamedResponseOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:ResponseOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedSchemaOrReference suitable for JSON or YAML export. -func (m *NamedSchemaOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:SchemaOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedSecuritySchemeOrReference suitable for JSON or YAML export. -func (m *NamedSecuritySchemeOrReference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:SecuritySchemeOrReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedServerVariable suitable for JSON or YAML export. -func (m *NamedServerVariable) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:ServerVariable StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of NamedString suitable for JSON or YAML export. -func (m *NamedString) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Value != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("value")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Value)) - } - return info -} - -// ToRawInfo returns a description of NamedStringArray suitable for JSON or YAML export. -func (m *NamedStringArray) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - // &{Name:value Type:StringArray StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} - return info -} - -// ToRawInfo returns a description of OauthFlow suitable for JSON or YAML export. -func (m *OauthFlow) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AuthorizationUrl != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("authorizationUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.AuthorizationUrl)) - } - if m.TokenUrl != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("tokenUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.TokenUrl)) - } - if m.RefreshUrl != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("refreshUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.RefreshUrl)) - } - if m.Scopes != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("scopes")) - info.Content = append(info.Content, m.Scopes.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of OauthFlows suitable for JSON or YAML export. -func (m *OauthFlows) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Implicit != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("implicit")) - info.Content = append(info.Content, m.Implicit.ToRawInfo()) - } - if m.Password != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("password")) - info.Content = append(info.Content, m.Password.ToRawInfo()) - } - if m.ClientCredentials != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("clientCredentials")) - info.Content = append(info.Content, m.ClientCredentials.ToRawInfo()) - } - if m.AuthorizationCode != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("authorizationCode")) - info.Content = append(info.Content, m.AuthorizationCode.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Object suitable for JSON or YAML export. -func (m *Object) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Operation suitable for JSON or YAML export. -func (m *Operation) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if len(m.Tags) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("tags")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Tags)) - } - if m.Summary != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("summary")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Summary)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.OperationId != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("operationId")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.OperationId)) - } - if len(m.Parameters) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Parameters { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) - info.Content = append(info.Content, items) - } - if m.RequestBody != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("requestBody")) - info.Content = append(info.Content, m.RequestBody.ToRawInfo()) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("responses")) - info.Content = append(info.Content, m.Responses.ToRawInfo()) - if m.Callbacks != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("callbacks")) - info.Content = append(info.Content, m.Callbacks.ToRawInfo()) - } - if m.Deprecated != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("deprecated")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Deprecated)) - } - if len(m.Security) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Security { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("security")) - info.Content = append(info.Content, items) - } - if len(m.Servers) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Servers { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("servers")) - info.Content = append(info.Content, items) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Parameter suitable for JSON or YAML export. -func (m *Parameter) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Required != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) - } - if m.Deprecated != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("deprecated")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Deprecated)) - } - if m.AllowEmptyValue != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("allowEmptyValue")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowEmptyValue)) - } - if m.Style != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("style")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Style)) - } - if m.Explode != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("explode")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Explode)) - } - if m.AllowReserved != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("allowReserved")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.AllowReserved)) - } - if m.Schema != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("schema")) - info.Content = append(info.Content, m.Schema.ToRawInfo()) - } - if m.Example != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) - info.Content = append(info.Content, m.Example.ToRawInfo()) - } - if m.Examples != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("examples")) - info.Content = append(info.Content, m.Examples.ToRawInfo()) - } - if m.Content != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("content")) - info.Content = append(info.Content, m.Content.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ParameterOrReference suitable for JSON or YAML export. -func (m *ParameterOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // ParameterOrReference - // {Name:parameter Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetParameter() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of ParametersOrReferences suitable for JSON or YAML export. -func (m *ParametersOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of PathItem suitable for JSON or YAML export. -func (m *PathItem) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.XRef != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) - } - if m.Summary != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("summary")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Summary)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Get != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("get")) - info.Content = append(info.Content, m.Get.ToRawInfo()) - } - if m.Put != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("put")) - info.Content = append(info.Content, m.Put.ToRawInfo()) - } - if m.Post != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("post")) - info.Content = append(info.Content, m.Post.ToRawInfo()) - } - if m.Delete != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("delete")) - info.Content = append(info.Content, m.Delete.ToRawInfo()) - } - if m.Options != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("options")) - info.Content = append(info.Content, m.Options.ToRawInfo()) - } - if m.Head != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("head")) - info.Content = append(info.Content, m.Head.ToRawInfo()) - } - if m.Patch != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("patch")) - info.Content = append(info.Content, m.Patch.ToRawInfo()) - } - if m.Trace != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("trace")) - info.Content = append(info.Content, m.Trace.ToRawInfo()) - } - if len(m.Servers) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Servers { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("servers")) - info.Content = append(info.Content, items) - } - if len(m.Parameters) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Parameters { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("parameters")) - info.Content = append(info.Content, items) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Paths suitable for JSON or YAML export. -func (m *Paths) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Path != nil { - for _, item := range m.Path { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Properties suitable for JSON or YAML export. -func (m *Properties) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Reference suitable for JSON or YAML export. -func (m *Reference) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("$ref")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.XRef)) - if m.Summary != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("summary")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Summary)) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - return info -} - -// ToRawInfo returns a description of RequestBodiesOrReferences suitable for JSON or YAML export. -func (m *RequestBodiesOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of RequestBody suitable for JSON or YAML export. -func (m *RequestBody) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("content")) - info.Content = append(info.Content, m.Content.ToRawInfo()) - if m.Required != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Required)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of RequestBodyOrReference suitable for JSON or YAML export. -func (m *RequestBodyOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // RequestBodyOrReference - // {Name:requestBody Type:RequestBody StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetRequestBody() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of Response suitable for JSON or YAML export. -func (m *Response) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - if m.Headers != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("headers")) - info.Content = append(info.Content, m.Headers.ToRawInfo()) - } - if m.Content != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("content")) - info.Content = append(info.Content, m.Content.ToRawInfo()) - } - if m.Links != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("links")) - info.Content = append(info.Content, m.Links.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ResponseOrReference suitable for JSON or YAML export. -func (m *ResponseOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // ResponseOrReference - // {Name:response Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetResponse() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of Responses suitable for JSON or YAML export. -func (m *Responses) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.ResponseOrReference != nil { - for _, item := range m.ResponseOrReference { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ResponsesOrReferences suitable for JSON or YAML export. -func (m *ResponsesOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Schema suitable for JSON or YAML export. -func (m *Schema) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Nullable != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("nullable")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Nullable)) - } - if m.Discriminator != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("discriminator")) - info.Content = append(info.Content, m.Discriminator.ToRawInfo()) - } - if m.ReadOnly != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("readOnly")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ReadOnly)) - } - if m.WriteOnly != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("writeOnly")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.WriteOnly)) - } - if m.Xml != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("xml")) - info.Content = append(info.Content, m.Xml.ToRawInfo()) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.Example != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("example")) - info.Content = append(info.Content, m.Example.ToRawInfo()) - } - if m.Deprecated != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("deprecated")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Deprecated)) - } - if m.Title != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("title")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Title)) - } - if m.MultipleOf != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("multipleOf")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.MultipleOf)) - } - if m.Maximum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Maximum)) - } - if m.ExclusiveMaximum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMaximum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMaximum)) - } - if m.Minimum != 0.0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForFloat(m.Minimum)) - } - if m.ExclusiveMinimum != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("exclusiveMinimum")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.ExclusiveMinimum)) - } - if m.MaxLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxLength)) - } - if m.MinLength != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minLength")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinLength)) - } - if m.Pattern != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("pattern")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Pattern)) - } - if m.MaxItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxItems)) - } - if m.MinItems != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinItems)) - } - if m.UniqueItems != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("uniqueItems")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.UniqueItems)) - } - if m.MaxProperties != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("maxProperties")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MaxProperties)) - } - if m.MinProperties != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("minProperties")) - info.Content = append(info.Content, compiler.NewScalarNodeForInt(m.MinProperties)) - } - if len(m.Required) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("required")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Required)) - } - if len(m.Enum) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.Enum { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, items) - } - if m.Type != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - } - if len(m.AllOf) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.AllOf { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("allOf")) - info.Content = append(info.Content, items) - } - if len(m.OneOf) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.OneOf { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("oneOf")) - info.Content = append(info.Content, items) - } - if len(m.AnyOf) != 0 { - items := compiler.NewSequenceNode() - for _, item := range m.AnyOf { - items.Content = append(items.Content, item.ToRawInfo()) - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("anyOf")) - info.Content = append(info.Content, items) - } - if m.Not != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("not")) - info.Content = append(info.Content, m.Not.ToRawInfo()) - } - if m.Items != nil { - items := compiler.NewSequenceNode() - for _, item := range m.Items.SchemaOrReference { - items.Content = append(items.Content, item.ToRawInfo()) - } - if len(items.Content) == 1 { - items = items.Content[0] - } - info.Content = append(info.Content, compiler.NewScalarNodeForString("items")) - info.Content = append(info.Content, items) - } - if m.Properties != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("properties")) - info.Content = append(info.Content, m.Properties.ToRawInfo()) - } - if m.AdditionalProperties != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("additionalProperties")) - info.Content = append(info.Content, m.AdditionalProperties.ToRawInfo()) - } - if m.Default != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, m.Default.ToRawInfo()) - } - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Format != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("format")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Format)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of SchemaOrReference suitable for JSON or YAML export. -func (m *SchemaOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // SchemaOrReference - // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetSchema() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of SchemasOrReferences suitable for JSON or YAML export. -func (m *SchemasOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of SecurityRequirement suitable for JSON or YAML export. -func (m *SecurityRequirement) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of SecurityScheme suitable for JSON or YAML export. -func (m *SecurityScheme) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("type")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Type)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.In != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("in")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.In)) - } - if m.Scheme != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("scheme")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Scheme)) - } - if m.BearerFormat != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("bearerFormat")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.BearerFormat)) - } - if m.Flows != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("flows")) - info.Content = append(info.Content, m.Flows.ToRawInfo()) - } - if m.OpenIdConnectUrl != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("openIdConnectUrl")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.OpenIdConnectUrl)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of SecuritySchemeOrReference suitable for JSON or YAML export. -func (m *SecuritySchemeOrReference) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // SecuritySchemeOrReference - // {Name:securityScheme Type:SecurityScheme StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v0 := m.GetSecurityScheme() - if v0 != nil { - return v0.ToRawInfo() - } - // {Name:reference Type:Reference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - v1 := m.GetReference() - if v1 != nil { - return v1.ToRawInfo() - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of SecuritySchemesOrReferences suitable for JSON or YAML export. -func (m *SecuritySchemesOrReferences) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Server suitable for JSON or YAML export. -func (m *Server) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("url")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Url)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.Variables != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("variables")) - info.Content = append(info.Content, m.Variables.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ServerVariable suitable for JSON or YAML export. -func (m *ServerVariable) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if len(m.Enum) != 0 { - info.Content = append(info.Content, compiler.NewScalarNodeForString("enum")) - info.Content = append(info.Content, compiler.NewSequenceNodeForStringArray(m.Enum)) - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("default")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Default)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of ServerVariables suitable for JSON or YAML export. -func (m *ServerVariables) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.AdditionalProperties != nil { - for _, item := range m.AdditionalProperties { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of SpecificationExtension suitable for JSON or YAML export. -func (m *SpecificationExtension) ToRawInfo() *yaml.Node { - // ONE OF WRAPPER - // SpecificationExtension - // {Name:number Type:float StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - if v0, ok := m.GetOneof().(*SpecificationExtension_Number); ok { - return compiler.NewScalarNodeForFloat(v0.Number) - } - // {Name:boolean Type:bool StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - if v1, ok := m.GetOneof().(*SpecificationExtension_Boolean); ok { - return compiler.NewScalarNodeForBool(v1.Boolean) - } - // {Name:string Type:string StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} - if v2, ok := m.GetOneof().(*SpecificationExtension_String_); ok { - return compiler.NewScalarNodeForString(v2.String_) - } - return compiler.NewNullNode() -} - -// ToRawInfo returns a description of StringArray suitable for JSON or YAML export. -func (m *StringArray) ToRawInfo() *yaml.Node { - return compiler.NewSequenceNodeForStringArray(m.Value) -} - -// ToRawInfo returns a description of Strings suitable for JSON or YAML export. -func (m *Strings) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:} - return info -} - -// ToRawInfo returns a description of Tag suitable for JSON or YAML export. -func (m *Tag) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - // always include this required field. - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - if m.Description != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("description")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Description)) - } - if m.ExternalDocs != nil { - info.Content = append(info.Content, compiler.NewScalarNodeForString("externalDocs")) - info.Content = append(info.Content, m.ExternalDocs.ToRawInfo()) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -// ToRawInfo returns a description of Xml suitable for JSON or YAML export. -func (m *Xml) ToRawInfo() *yaml.Node { - info := compiler.NewMappingNode() - if m == nil { - return info - } - if m.Name != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("name")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Name)) - } - if m.Namespace != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("namespace")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Namespace)) - } - if m.Prefix != "" { - info.Content = append(info.Content, compiler.NewScalarNodeForString("prefix")) - info.Content = append(info.Content, compiler.NewScalarNodeForString(m.Prefix)) - } - if m.Attribute != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("attribute")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Attribute)) - } - if m.Wrapped != false { - info.Content = append(info.Content, compiler.NewScalarNodeForString("wrapped")) - info.Content = append(info.Content, compiler.NewScalarNodeForBool(m.Wrapped)) - } - if m.SpecificationExtension != nil { - for _, item := range m.SpecificationExtension { - info.Content = append(info.Content, compiler.NewScalarNodeForString(item.Name)) - info.Content = append(info.Content, item.Value.ToRawInfo()) - } - } - return info -} - -var ( - pattern0 = regexp.MustCompile("^") - pattern1 = regexp.MustCompile("^x-") - pattern2 = regexp.MustCompile("^/") - pattern3 = regexp.MustCompile("^([0-9X]{3})$") -) diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.pb.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.pb.go deleted file mode 100644 index 945b8d11ff59..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.pb.go +++ /dev/null @@ -1,8053 +0,0 @@ -// Copyright 2020 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// THIS FILE IS AUTOMATICALLY GENERATED. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc v3.19.3 -// source: openapiv3/OpenAPIv3.proto - -package openapi_v3 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - reflect "reflect" - sync "sync" -) - -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) -) - -type AdditionalPropertiesItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *AdditionalPropertiesItem_SchemaOrReference - // *AdditionalPropertiesItem_Boolean - Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"` -} - -func (x *AdditionalPropertiesItem) Reset() { - *x = AdditionalPropertiesItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AdditionalPropertiesItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdditionalPropertiesItem) ProtoMessage() {} - -func (x *AdditionalPropertiesItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AdditionalPropertiesItem.ProtoReflect.Descriptor instead. -func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{0} -} - -func (m *AdditionalPropertiesItem) GetOneof() isAdditionalPropertiesItem_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *AdditionalPropertiesItem) GetSchemaOrReference() *SchemaOrReference { - if x, ok := x.GetOneof().(*AdditionalPropertiesItem_SchemaOrReference); ok { - return x.SchemaOrReference - } - return nil -} - -func (x *AdditionalPropertiesItem) GetBoolean() bool { - if x, ok := x.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { - return x.Boolean - } - return false -} - -type isAdditionalPropertiesItem_Oneof interface { - isAdditionalPropertiesItem_Oneof() -} - -type AdditionalPropertiesItem_SchemaOrReference struct { - SchemaOrReference *SchemaOrReference `protobuf:"bytes,1,opt,name=schema_or_reference,json=schemaOrReference,proto3,oneof"` -} - -type AdditionalPropertiesItem_Boolean struct { - Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"` -} - -func (*AdditionalPropertiesItem_SchemaOrReference) isAdditionalPropertiesItem_Oneof() {} - -func (*AdditionalPropertiesItem_Boolean) isAdditionalPropertiesItem_Oneof() {} - -type Any struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value *anypb.Any `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Yaml string `protobuf:"bytes,2,opt,name=yaml,proto3" json:"yaml,omitempty"` -} - -func (x *Any) Reset() { - *x = Any{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Any) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Any) ProtoMessage() {} - -func (x *Any) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Any.ProtoReflect.Descriptor instead. -func (*Any) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{1} -} - -func (x *Any) GetValue() *anypb.Any { - if x != nil { - return x.Value - } - return nil -} - -func (x *Any) GetYaml() string { - if x != nil { - return x.Yaml - } - return "" -} - -type AnyOrExpression struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *AnyOrExpression_Any - // *AnyOrExpression_Expression - Oneof isAnyOrExpression_Oneof `protobuf_oneof:"oneof"` -} - -func (x *AnyOrExpression) Reset() { - *x = AnyOrExpression{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AnyOrExpression) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnyOrExpression) ProtoMessage() {} - -func (x *AnyOrExpression) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AnyOrExpression.ProtoReflect.Descriptor instead. -func (*AnyOrExpression) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{2} -} - -func (m *AnyOrExpression) GetOneof() isAnyOrExpression_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *AnyOrExpression) GetAny() *Any { - if x, ok := x.GetOneof().(*AnyOrExpression_Any); ok { - return x.Any - } - return nil -} - -func (x *AnyOrExpression) GetExpression() *Expression { - if x, ok := x.GetOneof().(*AnyOrExpression_Expression); ok { - return x.Expression - } - return nil -} - -type isAnyOrExpression_Oneof interface { - isAnyOrExpression_Oneof() -} - -type AnyOrExpression_Any struct { - Any *Any `protobuf:"bytes,1,opt,name=any,proto3,oneof"` -} - -type AnyOrExpression_Expression struct { - Expression *Expression `protobuf:"bytes,2,opt,name=expression,proto3,oneof"` -} - -func (*AnyOrExpression_Any) isAnyOrExpression_Oneof() {} - -func (*AnyOrExpression_Expression) isAnyOrExpression_Oneof() {} - -// A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. -type Callback struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Path []*NamedPathItem `protobuf:"bytes,1,rep,name=path,proto3" json:"path,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,2,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Callback) Reset() { - *x = Callback{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Callback) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Callback) ProtoMessage() {} - -func (x *Callback) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Callback.ProtoReflect.Descriptor instead. -func (*Callback) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{3} -} - -func (x *Callback) GetPath() []*NamedPathItem { - if x != nil { - return x.Path - } - return nil -} - -func (x *Callback) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type CallbackOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *CallbackOrReference_Callback - // *CallbackOrReference_Reference - Oneof isCallbackOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *CallbackOrReference) Reset() { - *x = CallbackOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CallbackOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallbackOrReference) ProtoMessage() {} - -func (x *CallbackOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CallbackOrReference.ProtoReflect.Descriptor instead. -func (*CallbackOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{4} -} - -func (m *CallbackOrReference) GetOneof() isCallbackOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *CallbackOrReference) GetCallback() *Callback { - if x, ok := x.GetOneof().(*CallbackOrReference_Callback); ok { - return x.Callback - } - return nil -} - -func (x *CallbackOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*CallbackOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isCallbackOrReference_Oneof interface { - isCallbackOrReference_Oneof() -} - -type CallbackOrReference_Callback struct { - Callback *Callback `protobuf:"bytes,1,opt,name=callback,proto3,oneof"` -} - -type CallbackOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*CallbackOrReference_Callback) isCallbackOrReference_Oneof() {} - -func (*CallbackOrReference_Reference) isCallbackOrReference_Oneof() {} - -type CallbacksOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedCallbackOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *CallbacksOrReferences) Reset() { - *x = CallbacksOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CallbacksOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallbacksOrReferences) ProtoMessage() {} - -func (x *CallbacksOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CallbacksOrReferences.ProtoReflect.Descriptor instead. -func (*CallbacksOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{5} -} - -func (x *CallbacksOrReferences) GetAdditionalProperties() []*NamedCallbackOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. -type Components struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Schemas *SchemasOrReferences `protobuf:"bytes,1,opt,name=schemas,proto3" json:"schemas,omitempty"` - Responses *ResponsesOrReferences `protobuf:"bytes,2,opt,name=responses,proto3" json:"responses,omitempty"` - Parameters *ParametersOrReferences `protobuf:"bytes,3,opt,name=parameters,proto3" json:"parameters,omitempty"` - Examples *ExamplesOrReferences `protobuf:"bytes,4,opt,name=examples,proto3" json:"examples,omitempty"` - RequestBodies *RequestBodiesOrReferences `protobuf:"bytes,5,opt,name=request_bodies,json=requestBodies,proto3" json:"request_bodies,omitempty"` - Headers *HeadersOrReferences `protobuf:"bytes,6,opt,name=headers,proto3" json:"headers,omitempty"` - SecuritySchemes *SecuritySchemesOrReferences `protobuf:"bytes,7,opt,name=security_schemes,json=securitySchemes,proto3" json:"security_schemes,omitempty"` - Links *LinksOrReferences `protobuf:"bytes,8,opt,name=links,proto3" json:"links,omitempty"` - Callbacks *CallbacksOrReferences `protobuf:"bytes,9,opt,name=callbacks,proto3" json:"callbacks,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,10,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Components) Reset() { - *x = Components{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Components) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Components) ProtoMessage() {} - -func (x *Components) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Components.ProtoReflect.Descriptor instead. -func (*Components) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{6} -} - -func (x *Components) GetSchemas() *SchemasOrReferences { - if x != nil { - return x.Schemas - } - return nil -} - -func (x *Components) GetResponses() *ResponsesOrReferences { - if x != nil { - return x.Responses - } - return nil -} - -func (x *Components) GetParameters() *ParametersOrReferences { - if x != nil { - return x.Parameters - } - return nil -} - -func (x *Components) GetExamples() *ExamplesOrReferences { - if x != nil { - return x.Examples - } - return nil -} - -func (x *Components) GetRequestBodies() *RequestBodiesOrReferences { - if x != nil { - return x.RequestBodies - } - return nil -} - -func (x *Components) GetHeaders() *HeadersOrReferences { - if x != nil { - return x.Headers - } - return nil -} - -func (x *Components) GetSecuritySchemes() *SecuritySchemesOrReferences { - if x != nil { - return x.SecuritySchemes - } - return nil -} - -func (x *Components) GetLinks() *LinksOrReferences { - if x != nil { - return x.Links - } - return nil -} - -func (x *Components) GetCallbacks() *CallbacksOrReferences { - if x != nil { - return x.Callbacks - } - return nil -} - -func (x *Components) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// Contact information for the exposed API. -type Contact struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,4,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Contact) Reset() { - *x = Contact{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Contact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Contact) ProtoMessage() {} - -func (x *Contact) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Contact.ProtoReflect.Descriptor instead. -func (*Contact) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{7} -} - -func (x *Contact) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Contact) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *Contact) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *Contact) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type DefaultType struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *DefaultType_Number - // *DefaultType_Boolean - // *DefaultType_String_ - Oneof isDefaultType_Oneof `protobuf_oneof:"oneof"` -} - -func (x *DefaultType) Reset() { - *x = DefaultType{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DefaultType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DefaultType) ProtoMessage() {} - -func (x *DefaultType) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DefaultType.ProtoReflect.Descriptor instead. -func (*DefaultType) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{8} -} - -func (m *DefaultType) GetOneof() isDefaultType_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *DefaultType) GetNumber() float64 { - if x, ok := x.GetOneof().(*DefaultType_Number); ok { - return x.Number - } - return 0 -} - -func (x *DefaultType) GetBoolean() bool { - if x, ok := x.GetOneof().(*DefaultType_Boolean); ok { - return x.Boolean - } - return false -} - -func (x *DefaultType) GetString_() string { - if x, ok := x.GetOneof().(*DefaultType_String_); ok { - return x.String_ - } - return "" -} - -type isDefaultType_Oneof interface { - isDefaultType_Oneof() -} - -type DefaultType_Number struct { - Number float64 `protobuf:"fixed64,1,opt,name=number,proto3,oneof"` -} - -type DefaultType_Boolean struct { - Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"` -} - -type DefaultType_String_ struct { - String_ string `protobuf:"bytes,3,opt,name=string,proto3,oneof"` -} - -func (*DefaultType_Number) isDefaultType_Oneof() {} - -func (*DefaultType_Boolean) isDefaultType_Oneof() {} - -func (*DefaultType_String_) isDefaultType_Oneof() {} - -// When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. -type Discriminator struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PropertyName string `protobuf:"bytes,1,opt,name=property_name,json=propertyName,proto3" json:"property_name,omitempty"` - Mapping *Strings `protobuf:"bytes,2,opt,name=mapping,proto3" json:"mapping,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,3,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Discriminator) Reset() { - *x = Discriminator{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Discriminator) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Discriminator) ProtoMessage() {} - -func (x *Discriminator) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Discriminator.ProtoReflect.Descriptor instead. -func (*Discriminator) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{9} -} - -func (x *Discriminator) GetPropertyName() string { - if x != nil { - return x.PropertyName - } - return "" -} - -func (x *Discriminator) GetMapping() *Strings { - if x != nil { - return x.Mapping - } - return nil -} - -func (x *Discriminator) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type Document struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Openapi string `protobuf:"bytes,1,opt,name=openapi,proto3" json:"openapi,omitempty"` - Info *Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` - Servers []*Server `protobuf:"bytes,3,rep,name=servers,proto3" json:"servers,omitempty"` - Paths *Paths `protobuf:"bytes,4,opt,name=paths,proto3" json:"paths,omitempty"` - Components *Components `protobuf:"bytes,5,opt,name=components,proto3" json:"components,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,6,rep,name=security,proto3" json:"security,omitempty"` - Tags []*Tag `protobuf:"bytes,7,rep,name=tags,proto3" json:"tags,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,9,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Document) Reset() { - *x = Document{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Document) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Document) ProtoMessage() {} - -func (x *Document) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Document.ProtoReflect.Descriptor instead. -func (*Document) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{10} -} - -func (x *Document) GetOpenapi() string { - if x != nil { - return x.Openapi - } - return "" -} - -func (x *Document) GetInfo() *Info { - if x != nil { - return x.Info - } - return nil -} - -func (x *Document) GetServers() []*Server { - if x != nil { - return x.Servers - } - return nil -} - -func (x *Document) GetPaths() *Paths { - if x != nil { - return x.Paths - } - return nil -} - -func (x *Document) GetComponents() *Components { - if x != nil { - return x.Components - } - return nil -} - -func (x *Document) GetSecurity() []*SecurityRequirement { - if x != nil { - return x.Security - } - return nil -} - -func (x *Document) GetTags() []*Tag { - if x != nil { - return x.Tags - } - return nil -} - -func (x *Document) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *Document) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// A single encoding definition applied to a single schema property. -type Encoding struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ContentType string `protobuf:"bytes,1,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` - Headers *HeadersOrReferences `protobuf:"bytes,2,opt,name=headers,proto3" json:"headers,omitempty"` - Style string `protobuf:"bytes,3,opt,name=style,proto3" json:"style,omitempty"` - Explode bool `protobuf:"varint,4,opt,name=explode,proto3" json:"explode,omitempty"` - AllowReserved bool `protobuf:"varint,5,opt,name=allow_reserved,json=allowReserved,proto3" json:"allow_reserved,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,6,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Encoding) Reset() { - *x = Encoding{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Encoding) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Encoding) ProtoMessage() {} - -func (x *Encoding) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Encoding.ProtoReflect.Descriptor instead. -func (*Encoding) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{11} -} - -func (x *Encoding) GetContentType() string { - if x != nil { - return x.ContentType - } - return "" -} - -func (x *Encoding) GetHeaders() *HeadersOrReferences { - if x != nil { - return x.Headers - } - return nil -} - -func (x *Encoding) GetStyle() string { - if x != nil { - return x.Style - } - return "" -} - -func (x *Encoding) GetExplode() bool { - if x != nil { - return x.Explode - } - return false -} - -func (x *Encoding) GetAllowReserved() bool { - if x != nil { - return x.AllowReserved - } - return false -} - -func (x *Encoding) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type Encodings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedEncoding `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Encodings) Reset() { - *x = Encodings{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Encodings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Encodings) ProtoMessage() {} - -func (x *Encodings) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Encodings.ProtoReflect.Descriptor instead. -func (*Encodings) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{12} -} - -func (x *Encodings) GetAdditionalProperties() []*NamedEncoding { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type Example struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Summary string `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Value *Any `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - ExternalValue string `protobuf:"bytes,4,opt,name=external_value,json=externalValue,proto3" json:"external_value,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,5,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Example) Reset() { - *x = Example{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Example) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Example) ProtoMessage() {} - -func (x *Example) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Example.ProtoReflect.Descriptor instead. -func (*Example) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{13} -} - -func (x *Example) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *Example) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Example) GetValue() *Any { - if x != nil { - return x.Value - } - return nil -} - -func (x *Example) GetExternalValue() string { - if x != nil { - return x.ExternalValue - } - return "" -} - -func (x *Example) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type ExampleOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *ExampleOrReference_Example - // *ExampleOrReference_Reference - Oneof isExampleOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *ExampleOrReference) Reset() { - *x = ExampleOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExampleOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExampleOrReference) ProtoMessage() {} - -func (x *ExampleOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExampleOrReference.ProtoReflect.Descriptor instead. -func (*ExampleOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{14} -} - -func (m *ExampleOrReference) GetOneof() isExampleOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *ExampleOrReference) GetExample() *Example { - if x, ok := x.GetOneof().(*ExampleOrReference_Example); ok { - return x.Example - } - return nil -} - -func (x *ExampleOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*ExampleOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isExampleOrReference_Oneof interface { - isExampleOrReference_Oneof() -} - -type ExampleOrReference_Example struct { - Example *Example `protobuf:"bytes,1,opt,name=example,proto3,oneof"` -} - -type ExampleOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*ExampleOrReference_Example) isExampleOrReference_Oneof() {} - -func (*ExampleOrReference_Reference) isExampleOrReference_Oneof() {} - -type ExamplesOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedExampleOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *ExamplesOrReferences) Reset() { - *x = ExamplesOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExamplesOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExamplesOrReferences) ProtoMessage() {} - -func (x *ExamplesOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExamplesOrReferences.ProtoReflect.Descriptor instead. -func (*ExamplesOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{15} -} - -func (x *ExamplesOrReferences) GetAdditionalProperties() []*NamedExampleOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -type Expression struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Expression) Reset() { - *x = Expression{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Expression) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Expression) ProtoMessage() {} - -func (x *Expression) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Expression.ProtoReflect.Descriptor instead. -func (*Expression) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{16} -} - -func (x *Expression) GetAdditionalProperties() []*NamedAny { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Allows referencing an external resource for extended documentation. -type ExternalDocs struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,3,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *ExternalDocs) Reset() { - *x = ExternalDocs{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExternalDocs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExternalDocs) ProtoMessage() {} - -func (x *ExternalDocs) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExternalDocs.ProtoReflect.Descriptor instead. -func (*ExternalDocs) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{17} -} - -func (x *ExternalDocs) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ExternalDocs) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *ExternalDocs) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). -type Header struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Required bool `protobuf:"varint,2,opt,name=required,proto3" json:"required,omitempty"` - Deprecated bool `protobuf:"varint,3,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - AllowEmptyValue bool `protobuf:"varint,4,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` - Style string `protobuf:"bytes,5,opt,name=style,proto3" json:"style,omitempty"` - Explode bool `protobuf:"varint,6,opt,name=explode,proto3" json:"explode,omitempty"` - AllowReserved bool `protobuf:"varint,7,opt,name=allow_reserved,json=allowReserved,proto3" json:"allow_reserved,omitempty"` - Schema *SchemaOrReference `protobuf:"bytes,8,opt,name=schema,proto3" json:"schema,omitempty"` - Example *Any `protobuf:"bytes,9,opt,name=example,proto3" json:"example,omitempty"` - Examples *ExamplesOrReferences `protobuf:"bytes,10,opt,name=examples,proto3" json:"examples,omitempty"` - Content *MediaTypes `protobuf:"bytes,11,opt,name=content,proto3" json:"content,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,12,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Header) Reset() { - *x = Header{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Header) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Header) ProtoMessage() {} - -func (x *Header) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Header.ProtoReflect.Descriptor instead. -func (*Header) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{18} -} - -func (x *Header) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Header) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *Header) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *Header) GetAllowEmptyValue() bool { - if x != nil { - return x.AllowEmptyValue - } - return false -} - -func (x *Header) GetStyle() string { - if x != nil { - return x.Style - } - return "" -} - -func (x *Header) GetExplode() bool { - if x != nil { - return x.Explode - } - return false -} - -func (x *Header) GetAllowReserved() bool { - if x != nil { - return x.AllowReserved - } - return false -} - -func (x *Header) GetSchema() *SchemaOrReference { - if x != nil { - return x.Schema - } - return nil -} - -func (x *Header) GetExample() *Any { - if x != nil { - return x.Example - } - return nil -} - -func (x *Header) GetExamples() *ExamplesOrReferences { - if x != nil { - return x.Examples - } - return nil -} - -func (x *Header) GetContent() *MediaTypes { - if x != nil { - return x.Content - } - return nil -} - -func (x *Header) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type HeaderOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *HeaderOrReference_Header - // *HeaderOrReference_Reference - Oneof isHeaderOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *HeaderOrReference) Reset() { - *x = HeaderOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeaderOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeaderOrReference) ProtoMessage() {} - -func (x *HeaderOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeaderOrReference.ProtoReflect.Descriptor instead. -func (*HeaderOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{19} -} - -func (m *HeaderOrReference) GetOneof() isHeaderOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *HeaderOrReference) GetHeader() *Header { - if x, ok := x.GetOneof().(*HeaderOrReference_Header); ok { - return x.Header - } - return nil -} - -func (x *HeaderOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*HeaderOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isHeaderOrReference_Oneof interface { - isHeaderOrReference_Oneof() -} - -type HeaderOrReference_Header struct { - Header *Header `protobuf:"bytes,1,opt,name=header,proto3,oneof"` -} - -type HeaderOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*HeaderOrReference_Header) isHeaderOrReference_Oneof() {} - -func (*HeaderOrReference_Reference) isHeaderOrReference_Oneof() {} - -type HeadersOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedHeaderOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *HeadersOrReferences) Reset() { - *x = HeadersOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HeadersOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HeadersOrReferences) ProtoMessage() {} - -func (x *HeadersOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HeadersOrReferences.ProtoReflect.Descriptor instead. -func (*HeadersOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{20} -} - -func (x *HeadersOrReferences) GetAdditionalProperties() []*NamedHeaderOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. -type Info struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - TermsOfService string `protobuf:"bytes,3,opt,name=terms_of_service,json=termsOfService,proto3" json:"terms_of_service,omitempty"` - Contact *Contact `protobuf:"bytes,4,opt,name=contact,proto3" json:"contact,omitempty"` - License *License `protobuf:"bytes,5,opt,name=license,proto3" json:"license,omitempty"` - Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,7,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` - Summary string `protobuf:"bytes,8,opt,name=summary,proto3" json:"summary,omitempty"` -} - -func (x *Info) Reset() { - *x = Info{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Info) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Info) ProtoMessage() {} - -func (x *Info) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Info.ProtoReflect.Descriptor instead. -func (*Info) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{21} -} - -func (x *Info) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *Info) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Info) GetTermsOfService() string { - if x != nil { - return x.TermsOfService - } - return "" -} - -func (x *Info) GetContact() *Contact { - if x != nil { - return x.Contact - } - return nil -} - -func (x *Info) GetLicense() *License { - if x != nil { - return x.License - } - return nil -} - -func (x *Info) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Info) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -func (x *Info) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -type ItemsItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SchemaOrReference []*SchemaOrReference `protobuf:"bytes,1,rep,name=schema_or_reference,json=schemaOrReference,proto3" json:"schema_or_reference,omitempty"` -} - -func (x *ItemsItem) Reset() { - *x = ItemsItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ItemsItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ItemsItem) ProtoMessage() {} - -func (x *ItemsItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ItemsItem.ProtoReflect.Descriptor instead. -func (*ItemsItem) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{22} -} - -func (x *ItemsItem) GetSchemaOrReference() []*SchemaOrReference { - if x != nil { - return x.SchemaOrReference - } - return nil -} - -// License information for the exposed API. -type License struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,3,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *License) Reset() { - *x = License{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *License) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*License) ProtoMessage() {} - -func (x *License) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use License.ProtoReflect.Descriptor instead. -func (*License) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{23} -} - -func (x *License) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *License) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *License) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. -type Link struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OperationRef string `protobuf:"bytes,1,opt,name=operation_ref,json=operationRef,proto3" json:"operation_ref,omitempty"` - OperationId string `protobuf:"bytes,2,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` - Parameters *AnyOrExpression `protobuf:"bytes,3,opt,name=parameters,proto3" json:"parameters,omitempty"` - RequestBody *AnyOrExpression `protobuf:"bytes,4,opt,name=request_body,json=requestBody,proto3" json:"request_body,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - Server *Server `protobuf:"bytes,6,opt,name=server,proto3" json:"server,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,7,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Link) Reset() { - *x = Link{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Link) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Link) ProtoMessage() {} - -func (x *Link) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Link.ProtoReflect.Descriptor instead. -func (*Link) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{24} -} - -func (x *Link) GetOperationRef() string { - if x != nil { - return x.OperationRef - } - return "" -} - -func (x *Link) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -func (x *Link) GetParameters() *AnyOrExpression { - if x != nil { - return x.Parameters - } - return nil -} - -func (x *Link) GetRequestBody() *AnyOrExpression { - if x != nil { - return x.RequestBody - } - return nil -} - -func (x *Link) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Link) GetServer() *Server { - if x != nil { - return x.Server - } - return nil -} - -func (x *Link) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type LinkOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *LinkOrReference_Link - // *LinkOrReference_Reference - Oneof isLinkOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *LinkOrReference) Reset() { - *x = LinkOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LinkOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LinkOrReference) ProtoMessage() {} - -func (x *LinkOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LinkOrReference.ProtoReflect.Descriptor instead. -func (*LinkOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{25} -} - -func (m *LinkOrReference) GetOneof() isLinkOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *LinkOrReference) GetLink() *Link { - if x, ok := x.GetOneof().(*LinkOrReference_Link); ok { - return x.Link - } - return nil -} - -func (x *LinkOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*LinkOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isLinkOrReference_Oneof interface { - isLinkOrReference_Oneof() -} - -type LinkOrReference_Link struct { - Link *Link `protobuf:"bytes,1,opt,name=link,proto3,oneof"` -} - -type LinkOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*LinkOrReference_Link) isLinkOrReference_Oneof() {} - -func (*LinkOrReference_Reference) isLinkOrReference_Oneof() {} - -type LinksOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedLinkOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *LinksOrReferences) Reset() { - *x = LinksOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LinksOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LinksOrReferences) ProtoMessage() {} - -func (x *LinksOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LinksOrReferences.ProtoReflect.Descriptor instead. -func (*LinksOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{26} -} - -func (x *LinksOrReferences) GetAdditionalProperties() []*NamedLinkOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Each Media Type Object provides schema and examples for the media type identified by its key. -type MediaType struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Schema *SchemaOrReference `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"` - Example *Any `protobuf:"bytes,2,opt,name=example,proto3" json:"example,omitempty"` - Examples *ExamplesOrReferences `protobuf:"bytes,3,opt,name=examples,proto3" json:"examples,omitempty"` - Encoding *Encodings `protobuf:"bytes,4,opt,name=encoding,proto3" json:"encoding,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,5,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *MediaType) Reset() { - *x = MediaType{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MediaType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MediaType) ProtoMessage() {} - -func (x *MediaType) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MediaType.ProtoReflect.Descriptor instead. -func (*MediaType) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{27} -} - -func (x *MediaType) GetSchema() *SchemaOrReference { - if x != nil { - return x.Schema - } - return nil -} - -func (x *MediaType) GetExample() *Any { - if x != nil { - return x.Example - } - return nil -} - -func (x *MediaType) GetExamples() *ExamplesOrReferences { - if x != nil { - return x.Examples - } - return nil -} - -func (x *MediaType) GetEncoding() *Encodings { - if x != nil { - return x.Encoding - } - return nil -} - -func (x *MediaType) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type MediaTypes struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedMediaType `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *MediaTypes) Reset() { - *x = MediaTypes{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MediaTypes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MediaTypes) ProtoMessage() {} - -func (x *MediaTypes) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MediaTypes.ProtoReflect.Descriptor instead. -func (*MediaTypes) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{28} -} - -func (x *MediaTypes) GetAdditionalProperties() []*NamedMediaType { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. -type NamedAny struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedAny) Reset() { - *x = NamedAny{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedAny) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedAny) ProtoMessage() {} - -func (x *NamedAny) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedAny.ProtoReflect.Descriptor instead. -func (*NamedAny) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{29} -} - -func (x *NamedAny) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedAny) GetValue() *Any { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. -type NamedCallbackOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *CallbackOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedCallbackOrReference) Reset() { - *x = NamedCallbackOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedCallbackOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedCallbackOrReference) ProtoMessage() {} - -func (x *NamedCallbackOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedCallbackOrReference.ProtoReflect.Descriptor instead. -func (*NamedCallbackOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{30} -} - -func (x *NamedCallbackOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedCallbackOrReference) GetValue() *CallbackOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. -type NamedEncoding struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *Encoding `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedEncoding) Reset() { - *x = NamedEncoding{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedEncoding) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedEncoding) ProtoMessage() {} - -func (x *NamedEncoding) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedEncoding.ProtoReflect.Descriptor instead. -func (*NamedEncoding) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{31} -} - -func (x *NamedEncoding) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedEncoding) GetValue() *Encoding { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. -type NamedExampleOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *ExampleOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedExampleOrReference) Reset() { - *x = NamedExampleOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedExampleOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedExampleOrReference) ProtoMessage() {} - -func (x *NamedExampleOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedExampleOrReference.ProtoReflect.Descriptor instead. -func (*NamedExampleOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{32} -} - -func (x *NamedExampleOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedExampleOrReference) GetValue() *ExampleOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. -type NamedHeaderOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *HeaderOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedHeaderOrReference) Reset() { - *x = NamedHeaderOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedHeaderOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedHeaderOrReference) ProtoMessage() {} - -func (x *NamedHeaderOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedHeaderOrReference.ProtoReflect.Descriptor instead. -func (*NamedHeaderOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{33} -} - -func (x *NamedHeaderOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedHeaderOrReference) GetValue() *HeaderOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. -type NamedLinkOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *LinkOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedLinkOrReference) Reset() { - *x = NamedLinkOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedLinkOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedLinkOrReference) ProtoMessage() {} - -func (x *NamedLinkOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedLinkOrReference.ProtoReflect.Descriptor instead. -func (*NamedLinkOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{34} -} - -func (x *NamedLinkOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedLinkOrReference) GetValue() *LinkOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. -type NamedMediaType struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *MediaType `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedMediaType) Reset() { - *x = NamedMediaType{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedMediaType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedMediaType) ProtoMessage() {} - -func (x *NamedMediaType) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedMediaType.ProtoReflect.Descriptor instead. -func (*NamedMediaType) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{35} -} - -func (x *NamedMediaType) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedMediaType) GetValue() *MediaType { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. -type NamedParameterOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *ParameterOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedParameterOrReference) Reset() { - *x = NamedParameterOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedParameterOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedParameterOrReference) ProtoMessage() {} - -func (x *NamedParameterOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedParameterOrReference.ProtoReflect.Descriptor instead. -func (*NamedParameterOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{36} -} - -func (x *NamedParameterOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedParameterOrReference) GetValue() *ParameterOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. -type NamedPathItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *PathItem `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedPathItem) Reset() { - *x = NamedPathItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedPathItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedPathItem) ProtoMessage() {} - -func (x *NamedPathItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedPathItem.ProtoReflect.Descriptor instead. -func (*NamedPathItem) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{37} -} - -func (x *NamedPathItem) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedPathItem) GetValue() *PathItem { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. -type NamedRequestBodyOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *RequestBodyOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedRequestBodyOrReference) Reset() { - *x = NamedRequestBodyOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedRequestBodyOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedRequestBodyOrReference) ProtoMessage() {} - -func (x *NamedRequestBodyOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedRequestBodyOrReference.ProtoReflect.Descriptor instead. -func (*NamedRequestBodyOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{38} -} - -func (x *NamedRequestBodyOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedRequestBodyOrReference) GetValue() *RequestBodyOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. -type NamedResponseOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *ResponseOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedResponseOrReference) Reset() { - *x = NamedResponseOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedResponseOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedResponseOrReference) ProtoMessage() {} - -func (x *NamedResponseOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedResponseOrReference.ProtoReflect.Descriptor instead. -func (*NamedResponseOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{39} -} - -func (x *NamedResponseOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedResponseOrReference) GetValue() *ResponseOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. -type NamedSchemaOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *SchemaOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedSchemaOrReference) Reset() { - *x = NamedSchemaOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedSchemaOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedSchemaOrReference) ProtoMessage() {} - -func (x *NamedSchemaOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[40] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedSchemaOrReference.ProtoReflect.Descriptor instead. -func (*NamedSchemaOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{40} -} - -func (x *NamedSchemaOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedSchemaOrReference) GetValue() *SchemaOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. -type NamedSecuritySchemeOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *SecuritySchemeOrReference `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedSecuritySchemeOrReference) Reset() { - *x = NamedSecuritySchemeOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedSecuritySchemeOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedSecuritySchemeOrReference) ProtoMessage() {} - -func (x *NamedSecuritySchemeOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[41] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedSecuritySchemeOrReference.ProtoReflect.Descriptor instead. -func (*NamedSecuritySchemeOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{41} -} - -func (x *NamedSecuritySchemeOrReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedSecuritySchemeOrReference) GetValue() *SecuritySchemeOrReference { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. -type NamedServerVariable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *ServerVariable `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedServerVariable) Reset() { - *x = NamedServerVariable{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedServerVariable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedServerVariable) ProtoMessage() {} - -func (x *NamedServerVariable) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[42] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedServerVariable.ProtoReflect.Descriptor instead. -func (*NamedServerVariable) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{42} -} - -func (x *NamedServerVariable) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedServerVariable) GetValue() *ServerVariable { - if x != nil { - return x.Value - } - return nil -} - -// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. -type NamedString struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedString) Reset() { - *x = NamedString{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedString) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedString) ProtoMessage() {} - -func (x *NamedString) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[43] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedString.ProtoReflect.Descriptor instead. -func (*NamedString) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{43} -} - -func (x *NamedString) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedString) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. -type NamedStringArray struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Map key - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Mapped value - Value *StringArray `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *NamedStringArray) Reset() { - *x = NamedStringArray{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NamedStringArray) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NamedStringArray) ProtoMessage() {} - -func (x *NamedStringArray) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[44] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NamedStringArray.ProtoReflect.Descriptor instead. -func (*NamedStringArray) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{44} -} - -func (x *NamedStringArray) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NamedStringArray) GetValue() *StringArray { - if x != nil { - return x.Value - } - return nil -} - -// Configuration details for a supported OAuth Flow -type OauthFlow struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthorizationUrl string `protobuf:"bytes,1,opt,name=authorization_url,json=authorizationUrl,proto3" json:"authorization_url,omitempty"` - TokenUrl string `protobuf:"bytes,2,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` - RefreshUrl string `protobuf:"bytes,3,opt,name=refresh_url,json=refreshUrl,proto3" json:"refresh_url,omitempty"` - Scopes *Strings `protobuf:"bytes,4,opt,name=scopes,proto3" json:"scopes,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,5,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *OauthFlow) Reset() { - *x = OauthFlow{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OauthFlow) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OauthFlow) ProtoMessage() {} - -func (x *OauthFlow) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[45] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OauthFlow.ProtoReflect.Descriptor instead. -func (*OauthFlow) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{45} -} - -func (x *OauthFlow) GetAuthorizationUrl() string { - if x != nil { - return x.AuthorizationUrl - } - return "" -} - -func (x *OauthFlow) GetTokenUrl() string { - if x != nil { - return x.TokenUrl - } - return "" -} - -func (x *OauthFlow) GetRefreshUrl() string { - if x != nil { - return x.RefreshUrl - } - return "" -} - -func (x *OauthFlow) GetScopes() *Strings { - if x != nil { - return x.Scopes - } - return nil -} - -func (x *OauthFlow) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// Allows configuration of the supported OAuth Flows. -type OauthFlows struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Implicit *OauthFlow `protobuf:"bytes,1,opt,name=implicit,proto3" json:"implicit,omitempty"` - Password *OauthFlow `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - ClientCredentials *OauthFlow `protobuf:"bytes,3,opt,name=client_credentials,json=clientCredentials,proto3" json:"client_credentials,omitempty"` - AuthorizationCode *OauthFlow `protobuf:"bytes,4,opt,name=authorization_code,json=authorizationCode,proto3" json:"authorization_code,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,5,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *OauthFlows) Reset() { - *x = OauthFlows{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OauthFlows) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OauthFlows) ProtoMessage() {} - -func (x *OauthFlows) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[46] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OauthFlows.ProtoReflect.Descriptor instead. -func (*OauthFlows) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{46} -} - -func (x *OauthFlows) GetImplicit() *OauthFlow { - if x != nil { - return x.Implicit - } - return nil -} - -func (x *OauthFlows) GetPassword() *OauthFlow { - if x != nil { - return x.Password - } - return nil -} - -func (x *OauthFlows) GetClientCredentials() *OauthFlow { - if x != nil { - return x.ClientCredentials - } - return nil -} - -func (x *OauthFlows) GetAuthorizationCode() *OauthFlow { - if x != nil { - return x.AuthorizationCode - } - return nil -} - -func (x *OauthFlows) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type Object struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Object) Reset() { - *x = Object{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Object) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Object) ProtoMessage() {} - -func (x *Object) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[47] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Object.ProtoReflect.Descriptor instead. -func (*Object) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{47} -} - -func (x *Object) GetAdditionalProperties() []*NamedAny { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Describes a single API operation on a path. -type Operation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tags []string `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` - Parameters []*ParameterOrReference `protobuf:"bytes,6,rep,name=parameters,proto3" json:"parameters,omitempty"` - RequestBody *RequestBodyOrReference `protobuf:"bytes,7,opt,name=request_body,json=requestBody,proto3" json:"request_body,omitempty"` - Responses *Responses `protobuf:"bytes,8,opt,name=responses,proto3" json:"responses,omitempty"` - Callbacks *CallbacksOrReferences `protobuf:"bytes,9,opt,name=callbacks,proto3" json:"callbacks,omitempty"` - Deprecated bool `protobuf:"varint,10,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - Security []*SecurityRequirement `protobuf:"bytes,11,rep,name=security,proto3" json:"security,omitempty"` - Servers []*Server `protobuf:"bytes,12,rep,name=servers,proto3" json:"servers,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,13,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Operation) Reset() { - *x = Operation{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Operation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Operation) ProtoMessage() {} - -func (x *Operation) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[48] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Operation.ProtoReflect.Descriptor instead. -func (*Operation) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{48} -} - -func (x *Operation) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -func (x *Operation) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *Operation) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Operation) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *Operation) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -func (x *Operation) GetParameters() []*ParameterOrReference { - if x != nil { - return x.Parameters - } - return nil -} - -func (x *Operation) GetRequestBody() *RequestBodyOrReference { - if x != nil { - return x.RequestBody - } - return nil -} - -func (x *Operation) GetResponses() *Responses { - if x != nil { - return x.Responses - } - return nil -} - -func (x *Operation) GetCallbacks() *CallbacksOrReferences { - if x != nil { - return x.Callbacks - } - return nil -} - -func (x *Operation) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *Operation) GetSecurity() []*SecurityRequirement { - if x != nil { - return x.Security - } - return nil -} - -func (x *Operation) GetServers() []*Server { - if x != nil { - return x.Servers - } - return nil -} - -func (x *Operation) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. -type Parameter struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - In string `protobuf:"bytes,2,opt,name=in,proto3" json:"in,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Required bool `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"` - Deprecated bool `protobuf:"varint,5,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - AllowEmptyValue bool `protobuf:"varint,6,opt,name=allow_empty_value,json=allowEmptyValue,proto3" json:"allow_empty_value,omitempty"` - Style string `protobuf:"bytes,7,opt,name=style,proto3" json:"style,omitempty"` - Explode bool `protobuf:"varint,8,opt,name=explode,proto3" json:"explode,omitempty"` - AllowReserved bool `protobuf:"varint,9,opt,name=allow_reserved,json=allowReserved,proto3" json:"allow_reserved,omitempty"` - Schema *SchemaOrReference `protobuf:"bytes,10,opt,name=schema,proto3" json:"schema,omitempty"` - Example *Any `protobuf:"bytes,11,opt,name=example,proto3" json:"example,omitempty"` - Examples *ExamplesOrReferences `protobuf:"bytes,12,opt,name=examples,proto3" json:"examples,omitempty"` - Content *MediaTypes `protobuf:"bytes,13,opt,name=content,proto3" json:"content,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,14,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Parameter) Reset() { - *x = Parameter{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Parameter) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Parameter) ProtoMessage() {} - -func (x *Parameter) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[49] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Parameter.ProtoReflect.Descriptor instead. -func (*Parameter) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{49} -} - -func (x *Parameter) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Parameter) GetIn() string { - if x != nil { - return x.In - } - return "" -} - -func (x *Parameter) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Parameter) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *Parameter) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *Parameter) GetAllowEmptyValue() bool { - if x != nil { - return x.AllowEmptyValue - } - return false -} - -func (x *Parameter) GetStyle() string { - if x != nil { - return x.Style - } - return "" -} - -func (x *Parameter) GetExplode() bool { - if x != nil { - return x.Explode - } - return false -} - -func (x *Parameter) GetAllowReserved() bool { - if x != nil { - return x.AllowReserved - } - return false -} - -func (x *Parameter) GetSchema() *SchemaOrReference { - if x != nil { - return x.Schema - } - return nil -} - -func (x *Parameter) GetExample() *Any { - if x != nil { - return x.Example - } - return nil -} - -func (x *Parameter) GetExamples() *ExamplesOrReferences { - if x != nil { - return x.Examples - } - return nil -} - -func (x *Parameter) GetContent() *MediaTypes { - if x != nil { - return x.Content - } - return nil -} - -func (x *Parameter) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type ParameterOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *ParameterOrReference_Parameter - // *ParameterOrReference_Reference - Oneof isParameterOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *ParameterOrReference) Reset() { - *x = ParameterOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParameterOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParameterOrReference) ProtoMessage() {} - -func (x *ParameterOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[50] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParameterOrReference.ProtoReflect.Descriptor instead. -func (*ParameterOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{50} -} - -func (m *ParameterOrReference) GetOneof() isParameterOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *ParameterOrReference) GetParameter() *Parameter { - if x, ok := x.GetOneof().(*ParameterOrReference_Parameter); ok { - return x.Parameter - } - return nil -} - -func (x *ParameterOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*ParameterOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isParameterOrReference_Oneof interface { - isParameterOrReference_Oneof() -} - -type ParameterOrReference_Parameter struct { - Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,proto3,oneof"` -} - -type ParameterOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*ParameterOrReference_Parameter) isParameterOrReference_Oneof() {} - -func (*ParameterOrReference_Reference) isParameterOrReference_Oneof() {} - -type ParametersOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedParameterOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *ParametersOrReferences) Reset() { - *x = ParametersOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParametersOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParametersOrReferences) ProtoMessage() {} - -func (x *ParametersOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[51] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ParametersOrReferences.ProtoReflect.Descriptor instead. -func (*ParametersOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{51} -} - -func (x *ParametersOrReferences) GetAdditionalProperties() []*NamedParameterOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. -type PathItem struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Get *Operation `protobuf:"bytes,4,opt,name=get,proto3" json:"get,omitempty"` - Put *Operation `protobuf:"bytes,5,opt,name=put,proto3" json:"put,omitempty"` - Post *Operation `protobuf:"bytes,6,opt,name=post,proto3" json:"post,omitempty"` - Delete *Operation `protobuf:"bytes,7,opt,name=delete,proto3" json:"delete,omitempty"` - Options *Operation `protobuf:"bytes,8,opt,name=options,proto3" json:"options,omitempty"` - Head *Operation `protobuf:"bytes,9,opt,name=head,proto3" json:"head,omitempty"` - Patch *Operation `protobuf:"bytes,10,opt,name=patch,proto3" json:"patch,omitempty"` - Trace *Operation `protobuf:"bytes,11,opt,name=trace,proto3" json:"trace,omitempty"` - Servers []*Server `protobuf:"bytes,12,rep,name=servers,proto3" json:"servers,omitempty"` - Parameters []*ParameterOrReference `protobuf:"bytes,13,rep,name=parameters,proto3" json:"parameters,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,14,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *PathItem) Reset() { - *x = PathItem{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PathItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PathItem) ProtoMessage() {} - -func (x *PathItem) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[52] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PathItem.ProtoReflect.Descriptor instead. -func (*PathItem) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{52} -} - -func (x *PathItem) GetXRef() string { - if x != nil { - return x.XRef - } - return "" -} - -func (x *PathItem) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *PathItem) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *PathItem) GetGet() *Operation { - if x != nil { - return x.Get - } - return nil -} - -func (x *PathItem) GetPut() *Operation { - if x != nil { - return x.Put - } - return nil -} - -func (x *PathItem) GetPost() *Operation { - if x != nil { - return x.Post - } - return nil -} - -func (x *PathItem) GetDelete() *Operation { - if x != nil { - return x.Delete - } - return nil -} - -func (x *PathItem) GetOptions() *Operation { - if x != nil { - return x.Options - } - return nil -} - -func (x *PathItem) GetHead() *Operation { - if x != nil { - return x.Head - } - return nil -} - -func (x *PathItem) GetPatch() *Operation { - if x != nil { - return x.Patch - } - return nil -} - -func (x *PathItem) GetTrace() *Operation { - if x != nil { - return x.Trace - } - return nil -} - -func (x *PathItem) GetServers() []*Server { - if x != nil { - return x.Servers - } - return nil -} - -func (x *PathItem) GetParameters() []*ParameterOrReference { - if x != nil { - return x.Parameters - } - return nil -} - -func (x *PathItem) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. -type Paths struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Path []*NamedPathItem `protobuf:"bytes,1,rep,name=path,proto3" json:"path,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,2,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Paths) Reset() { - *x = Paths{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Paths) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Paths) ProtoMessage() {} - -func (x *Paths) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[53] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Paths.ProtoReflect.Descriptor instead. -func (*Paths) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{53} -} - -func (x *Paths) GetPath() []*NamedPathItem { - if x != nil { - return x.Path - } - return nil -} - -func (x *Paths) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type Properties struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedSchemaOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Properties) Reset() { - *x = Properties{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Properties) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Properties) ProtoMessage() {} - -func (x *Properties) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[54] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Properties.ProtoReflect.Descriptor instead. -func (*Properties) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{54} -} - -func (x *Properties) GetAdditionalProperties() []*NamedSchemaOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. -type Reference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref,proto3" json:"_ref,omitempty"` - Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` -} - -func (x *Reference) Reset() { - *x = Reference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Reference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Reference) ProtoMessage() {} - -func (x *Reference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[55] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Reference.ProtoReflect.Descriptor instead. -func (*Reference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{55} -} - -func (x *Reference) GetXRef() string { - if x != nil { - return x.XRef - } - return "" -} - -func (x *Reference) GetSummary() string { - if x != nil { - return x.Summary - } - return "" -} - -func (x *Reference) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -type RequestBodiesOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedRequestBodyOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *RequestBodiesOrReferences) Reset() { - *x = RequestBodiesOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RequestBodiesOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RequestBodiesOrReferences) ProtoMessage() {} - -func (x *RequestBodiesOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[56] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RequestBodiesOrReferences.ProtoReflect.Descriptor instead. -func (*RequestBodiesOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{56} -} - -func (x *RequestBodiesOrReferences) GetAdditionalProperties() []*NamedRequestBodyOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Describes a single request body. -type RequestBody struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Content *MediaTypes `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` - Required bool `protobuf:"varint,3,opt,name=required,proto3" json:"required,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,4,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *RequestBody) Reset() { - *x = RequestBody{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[57] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RequestBody) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RequestBody) ProtoMessage() {} - -func (x *RequestBody) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[57] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RequestBody.ProtoReflect.Descriptor instead. -func (*RequestBody) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{57} -} - -func (x *RequestBody) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *RequestBody) GetContent() *MediaTypes { - if x != nil { - return x.Content - } - return nil -} - -func (x *RequestBody) GetRequired() bool { - if x != nil { - return x.Required - } - return false -} - -func (x *RequestBody) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type RequestBodyOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *RequestBodyOrReference_RequestBody - // *RequestBodyOrReference_Reference - Oneof isRequestBodyOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *RequestBodyOrReference) Reset() { - *x = RequestBodyOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[58] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RequestBodyOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RequestBodyOrReference) ProtoMessage() {} - -func (x *RequestBodyOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[58] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RequestBodyOrReference.ProtoReflect.Descriptor instead. -func (*RequestBodyOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{58} -} - -func (m *RequestBodyOrReference) GetOneof() isRequestBodyOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *RequestBodyOrReference) GetRequestBody() *RequestBody { - if x, ok := x.GetOneof().(*RequestBodyOrReference_RequestBody); ok { - return x.RequestBody - } - return nil -} - -func (x *RequestBodyOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*RequestBodyOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isRequestBodyOrReference_Oneof interface { - isRequestBodyOrReference_Oneof() -} - -type RequestBodyOrReference_RequestBody struct { - RequestBody *RequestBody `protobuf:"bytes,1,opt,name=request_body,json=requestBody,proto3,oneof"` -} - -type RequestBodyOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*RequestBodyOrReference_RequestBody) isRequestBodyOrReference_Oneof() {} - -func (*RequestBodyOrReference_Reference) isRequestBodyOrReference_Oneof() {} - -// Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. -type Response struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - Headers *HeadersOrReferences `protobuf:"bytes,2,opt,name=headers,proto3" json:"headers,omitempty"` - Content *MediaTypes `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` - Links *LinksOrReferences `protobuf:"bytes,4,opt,name=links,proto3" json:"links,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,5,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Response) Reset() { - *x = Response{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[59] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Response) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Response) ProtoMessage() {} - -func (x *Response) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[59] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Response.ProtoReflect.Descriptor instead. -func (*Response) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{59} -} - -func (x *Response) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Response) GetHeaders() *HeadersOrReferences { - if x != nil { - return x.Headers - } - return nil -} - -func (x *Response) GetContent() *MediaTypes { - if x != nil { - return x.Content - } - return nil -} - -func (x *Response) GetLinks() *LinksOrReferences { - if x != nil { - return x.Links - } - return nil -} - -func (x *Response) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type ResponseOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *ResponseOrReference_Response - // *ResponseOrReference_Reference - Oneof isResponseOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *ResponseOrReference) Reset() { - *x = ResponseOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[60] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponseOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponseOrReference) ProtoMessage() {} - -func (x *ResponseOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[60] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponseOrReference.ProtoReflect.Descriptor instead. -func (*ResponseOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{60} -} - -func (m *ResponseOrReference) GetOneof() isResponseOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *ResponseOrReference) GetResponse() *Response { - if x, ok := x.GetOneof().(*ResponseOrReference_Response); ok { - return x.Response - } - return nil -} - -func (x *ResponseOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*ResponseOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isResponseOrReference_Oneof interface { - isResponseOrReference_Oneof() -} - -type ResponseOrReference_Response struct { - Response *Response `protobuf:"bytes,1,opt,name=response,proto3,oneof"` -} - -type ResponseOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*ResponseOrReference_Response) isResponseOrReference_Oneof() {} - -func (*ResponseOrReference_Reference) isResponseOrReference_Oneof() {} - -// A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. -type Responses struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Default *ResponseOrReference `protobuf:"bytes,1,opt,name=default,proto3" json:"default,omitempty"` - ResponseOrReference []*NamedResponseOrReference `protobuf:"bytes,2,rep,name=response_or_reference,json=responseOrReference,proto3" json:"response_or_reference,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,3,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Responses) Reset() { - *x = Responses{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[61] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Responses) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Responses) ProtoMessage() {} - -func (x *Responses) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[61] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Responses.ProtoReflect.Descriptor instead. -func (*Responses) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{61} -} - -func (x *Responses) GetDefault() *ResponseOrReference { - if x != nil { - return x.Default - } - return nil -} - -func (x *Responses) GetResponseOrReference() []*NamedResponseOrReference { - if x != nil { - return x.ResponseOrReference - } - return nil -} - -func (x *Responses) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type ResponsesOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedResponseOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *ResponsesOrReferences) Reset() { - *x = ResponsesOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[62] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponsesOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponsesOrReferences) ProtoMessage() {} - -func (x *ResponsesOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[62] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponsesOrReferences.ProtoReflect.Descriptor instead. -func (*ResponsesOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{62} -} - -func (x *ResponsesOrReferences) GetAdditionalProperties() []*NamedResponseOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. -type Schema struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Nullable bool `protobuf:"varint,1,opt,name=nullable,proto3" json:"nullable,omitempty"` - Discriminator *Discriminator `protobuf:"bytes,2,opt,name=discriminator,proto3" json:"discriminator,omitempty"` - ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` - WriteOnly bool `protobuf:"varint,4,opt,name=write_only,json=writeOnly,proto3" json:"write_only,omitempty"` - Xml *Xml `protobuf:"bytes,5,opt,name=xml,proto3" json:"xml,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,6,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - Example *Any `protobuf:"bytes,7,opt,name=example,proto3" json:"example,omitempty"` - Deprecated bool `protobuf:"varint,8,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - Title string `protobuf:"bytes,9,opt,name=title,proto3" json:"title,omitempty"` - MultipleOf float64 `protobuf:"fixed64,10,opt,name=multiple_of,json=multipleOf,proto3" json:"multiple_of,omitempty"` - Maximum float64 `protobuf:"fixed64,11,opt,name=maximum,proto3" json:"maximum,omitempty"` - ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum,proto3" json:"exclusive_maximum,omitempty"` - Minimum float64 `protobuf:"fixed64,13,opt,name=minimum,proto3" json:"minimum,omitempty"` - ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum,proto3" json:"exclusive_minimum,omitempty"` - MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength,proto3" json:"max_length,omitempty"` - MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength,proto3" json:"min_length,omitempty"` - Pattern string `protobuf:"bytes,17,opt,name=pattern,proto3" json:"pattern,omitempty"` - MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems,proto3" json:"max_items,omitempty"` - MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems,proto3" json:"min_items,omitempty"` - UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems,proto3" json:"unique_items,omitempty"` - MaxProperties int64 `protobuf:"varint,21,opt,name=max_properties,json=maxProperties,proto3" json:"max_properties,omitempty"` - MinProperties int64 `protobuf:"varint,22,opt,name=min_properties,json=minProperties,proto3" json:"min_properties,omitempty"` - Required []string `protobuf:"bytes,23,rep,name=required,proto3" json:"required,omitempty"` - Enum []*Any `protobuf:"bytes,24,rep,name=enum,proto3" json:"enum,omitempty"` - Type string `protobuf:"bytes,25,opt,name=type,proto3" json:"type,omitempty"` - AllOf []*SchemaOrReference `protobuf:"bytes,26,rep,name=all_of,json=allOf,proto3" json:"all_of,omitempty"` - OneOf []*SchemaOrReference `protobuf:"bytes,27,rep,name=one_of,json=oneOf,proto3" json:"one_of,omitempty"` - AnyOf []*SchemaOrReference `protobuf:"bytes,28,rep,name=any_of,json=anyOf,proto3" json:"any_of,omitempty"` - Not *Schema `protobuf:"bytes,29,opt,name=not,proto3" json:"not,omitempty"` - Items *ItemsItem `protobuf:"bytes,30,opt,name=items,proto3" json:"items,omitempty"` - Properties *Properties `protobuf:"bytes,31,opt,name=properties,proto3" json:"properties,omitempty"` - AdditionalProperties *AdditionalPropertiesItem `protobuf:"bytes,32,opt,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` - Default *DefaultType `protobuf:"bytes,33,opt,name=default,proto3" json:"default,omitempty"` - Description string `protobuf:"bytes,34,opt,name=description,proto3" json:"description,omitempty"` - Format string `protobuf:"bytes,35,opt,name=format,proto3" json:"format,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,36,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Schema) Reset() { - *x = Schema{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[63] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Schema) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Schema) ProtoMessage() {} - -func (x *Schema) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[63] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Schema.ProtoReflect.Descriptor instead. -func (*Schema) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{63} -} - -func (x *Schema) GetNullable() bool { - if x != nil { - return x.Nullable - } - return false -} - -func (x *Schema) GetDiscriminator() *Discriminator { - if x != nil { - return x.Discriminator - } - return nil -} - -func (x *Schema) GetReadOnly() bool { - if x != nil { - return x.ReadOnly - } - return false -} - -func (x *Schema) GetWriteOnly() bool { - if x != nil { - return x.WriteOnly - } - return false -} - -func (x *Schema) GetXml() *Xml { - if x != nil { - return x.Xml - } - return nil -} - -func (x *Schema) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *Schema) GetExample() *Any { - if x != nil { - return x.Example - } - return nil -} - -func (x *Schema) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *Schema) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *Schema) GetMultipleOf() float64 { - if x != nil { - return x.MultipleOf - } - return 0 -} - -func (x *Schema) GetMaximum() float64 { - if x != nil { - return x.Maximum - } - return 0 -} - -func (x *Schema) GetExclusiveMaximum() bool { - if x != nil { - return x.ExclusiveMaximum - } - return false -} - -func (x *Schema) GetMinimum() float64 { - if x != nil { - return x.Minimum - } - return 0 -} - -func (x *Schema) GetExclusiveMinimum() bool { - if x != nil { - return x.ExclusiveMinimum - } - return false -} - -func (x *Schema) GetMaxLength() int64 { - if x != nil { - return x.MaxLength - } - return 0 -} - -func (x *Schema) GetMinLength() int64 { - if x != nil { - return x.MinLength - } - return 0 -} - -func (x *Schema) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *Schema) GetMaxItems() int64 { - if x != nil { - return x.MaxItems - } - return 0 -} - -func (x *Schema) GetMinItems() int64 { - if x != nil { - return x.MinItems - } - return 0 -} - -func (x *Schema) GetUniqueItems() bool { - if x != nil { - return x.UniqueItems - } - return false -} - -func (x *Schema) GetMaxProperties() int64 { - if x != nil { - return x.MaxProperties - } - return 0 -} - -func (x *Schema) GetMinProperties() int64 { - if x != nil { - return x.MinProperties - } - return 0 -} - -func (x *Schema) GetRequired() []string { - if x != nil { - return x.Required - } - return nil -} - -func (x *Schema) GetEnum() []*Any { - if x != nil { - return x.Enum - } - return nil -} - -func (x *Schema) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Schema) GetAllOf() []*SchemaOrReference { - if x != nil { - return x.AllOf - } - return nil -} - -func (x *Schema) GetOneOf() []*SchemaOrReference { - if x != nil { - return x.OneOf - } - return nil -} - -func (x *Schema) GetAnyOf() []*SchemaOrReference { - if x != nil { - return x.AnyOf - } - return nil -} - -func (x *Schema) GetNot() *Schema { - if x != nil { - return x.Not - } - return nil -} - -func (x *Schema) GetItems() *ItemsItem { - if x != nil { - return x.Items - } - return nil -} - -func (x *Schema) GetProperties() *Properties { - if x != nil { - return x.Properties - } - return nil -} - -func (x *Schema) GetAdditionalProperties() *AdditionalPropertiesItem { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -func (x *Schema) GetDefault() *DefaultType { - if x != nil { - return x.Default - } - return nil -} - -func (x *Schema) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Schema) GetFormat() string { - if x != nil { - return x.Format - } - return "" -} - -func (x *Schema) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type SchemaOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *SchemaOrReference_Schema - // *SchemaOrReference_Reference - Oneof isSchemaOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *SchemaOrReference) Reset() { - *x = SchemaOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[64] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SchemaOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SchemaOrReference) ProtoMessage() {} - -func (x *SchemaOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[64] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SchemaOrReference.ProtoReflect.Descriptor instead. -func (*SchemaOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{64} -} - -func (m *SchemaOrReference) GetOneof() isSchemaOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *SchemaOrReference) GetSchema() *Schema { - if x, ok := x.GetOneof().(*SchemaOrReference_Schema); ok { - return x.Schema - } - return nil -} - -func (x *SchemaOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*SchemaOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isSchemaOrReference_Oneof interface { - isSchemaOrReference_Oneof() -} - -type SchemaOrReference_Schema struct { - Schema *Schema `protobuf:"bytes,1,opt,name=schema,proto3,oneof"` -} - -type SchemaOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*SchemaOrReference_Schema) isSchemaOrReference_Oneof() {} - -func (*SchemaOrReference_Reference) isSchemaOrReference_Oneof() {} - -type SchemasOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedSchemaOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *SchemasOrReferences) Reset() { - *x = SchemasOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[65] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SchemasOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SchemasOrReferences) ProtoMessage() {} - -func (x *SchemasOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[65] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SchemasOrReferences.ProtoReflect.Descriptor instead. -func (*SchemasOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{65} -} - -func (x *SchemasOrReferences) GetAdditionalProperties() []*NamedSchemaOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. -type SecurityRequirement struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *SecurityRequirement) Reset() { - *x = SecurityRequirement{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[66] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecurityRequirement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityRequirement) ProtoMessage() {} - -func (x *SecurityRequirement) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[66] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecurityRequirement.ProtoReflect.Descriptor instead. -func (*SecurityRequirement) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{66} -} - -func (x *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. -type SecurityScheme struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - In string `protobuf:"bytes,4,opt,name=in,proto3" json:"in,omitempty"` - Scheme string `protobuf:"bytes,5,opt,name=scheme,proto3" json:"scheme,omitempty"` - BearerFormat string `protobuf:"bytes,6,opt,name=bearer_format,json=bearerFormat,proto3" json:"bearer_format,omitempty"` - Flows *OauthFlows `protobuf:"bytes,7,opt,name=flows,proto3" json:"flows,omitempty"` - OpenIdConnectUrl string `protobuf:"bytes,8,opt,name=open_id_connect_url,json=openIdConnectUrl,proto3" json:"open_id_connect_url,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,9,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *SecurityScheme) Reset() { - *x = SecurityScheme{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[67] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecurityScheme) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityScheme) ProtoMessage() {} - -func (x *SecurityScheme) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[67] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecurityScheme.ProtoReflect.Descriptor instead. -func (*SecurityScheme) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{67} -} - -func (x *SecurityScheme) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *SecurityScheme) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *SecurityScheme) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *SecurityScheme) GetIn() string { - if x != nil { - return x.In - } - return "" -} - -func (x *SecurityScheme) GetScheme() string { - if x != nil { - return x.Scheme - } - return "" -} - -func (x *SecurityScheme) GetBearerFormat() string { - if x != nil { - return x.BearerFormat - } - return "" -} - -func (x *SecurityScheme) GetFlows() *OauthFlows { - if x != nil { - return x.Flows - } - return nil -} - -func (x *SecurityScheme) GetOpenIdConnectUrl() string { - if x != nil { - return x.OpenIdConnectUrl - } - return "" -} - -func (x *SecurityScheme) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type SecuritySchemeOrReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *SecuritySchemeOrReference_SecurityScheme - // *SecuritySchemeOrReference_Reference - Oneof isSecuritySchemeOrReference_Oneof `protobuf_oneof:"oneof"` -} - -func (x *SecuritySchemeOrReference) Reset() { - *x = SecuritySchemeOrReference{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[68] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecuritySchemeOrReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecuritySchemeOrReference) ProtoMessage() {} - -func (x *SecuritySchemeOrReference) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[68] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecuritySchemeOrReference.ProtoReflect.Descriptor instead. -func (*SecuritySchemeOrReference) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{68} -} - -func (m *SecuritySchemeOrReference) GetOneof() isSecuritySchemeOrReference_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *SecuritySchemeOrReference) GetSecurityScheme() *SecurityScheme { - if x, ok := x.GetOneof().(*SecuritySchemeOrReference_SecurityScheme); ok { - return x.SecurityScheme - } - return nil -} - -func (x *SecuritySchemeOrReference) GetReference() *Reference { - if x, ok := x.GetOneof().(*SecuritySchemeOrReference_Reference); ok { - return x.Reference - } - return nil -} - -type isSecuritySchemeOrReference_Oneof interface { - isSecuritySchemeOrReference_Oneof() -} - -type SecuritySchemeOrReference_SecurityScheme struct { - SecurityScheme *SecurityScheme `protobuf:"bytes,1,opt,name=security_scheme,json=securityScheme,proto3,oneof"` -} - -type SecuritySchemeOrReference_Reference struct { - Reference *Reference `protobuf:"bytes,2,opt,name=reference,proto3,oneof"` -} - -func (*SecuritySchemeOrReference_SecurityScheme) isSecuritySchemeOrReference_Oneof() {} - -func (*SecuritySchemeOrReference_Reference) isSecuritySchemeOrReference_Oneof() {} - -type SecuritySchemesOrReferences struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedSecuritySchemeOrReference `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *SecuritySchemesOrReferences) Reset() { - *x = SecuritySchemesOrReferences{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[69] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecuritySchemesOrReferences) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecuritySchemesOrReferences) ProtoMessage() {} - -func (x *SecuritySchemesOrReferences) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[69] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecuritySchemesOrReferences.ProtoReflect.Descriptor instead. -func (*SecuritySchemesOrReferences) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{69} -} - -func (x *SecuritySchemesOrReferences) GetAdditionalProperties() []*NamedSecuritySchemeOrReference { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// An object representing a Server. -type Server struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Variables *ServerVariables `protobuf:"bytes,3,opt,name=variables,proto3" json:"variables,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,4,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Server) Reset() { - *x = Server{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[70] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Server) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Server) ProtoMessage() {} - -func (x *Server) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[70] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Server.ProtoReflect.Descriptor instead. -func (*Server) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{70} -} - -func (x *Server) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *Server) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Server) GetVariables() *ServerVariables { - if x != nil { - return x.Variables - } - return nil -} - -func (x *Server) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// An object representing a Server Variable for server URL template substitution. -type ServerVariable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Enum []string `protobuf:"bytes,1,rep,name=enum,proto3" json:"enum,omitempty"` - Default string `protobuf:"bytes,2,opt,name=default,proto3" json:"default,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,4,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *ServerVariable) Reset() { - *x = ServerVariable{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[71] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerVariable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerVariable) ProtoMessage() {} - -func (x *ServerVariable) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[71] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerVariable.ProtoReflect.Descriptor instead. -func (*ServerVariable) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{71} -} - -func (x *ServerVariable) GetEnum() []string { - if x != nil { - return x.Enum - } - return nil -} - -func (x *ServerVariable) GetDefault() string { - if x != nil { - return x.Default - } - return "" -} - -func (x *ServerVariable) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *ServerVariable) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -type ServerVariables struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedServerVariable `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *ServerVariables) Reset() { - *x = ServerVariables{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[72] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerVariables) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerVariables) ProtoMessage() {} - -func (x *ServerVariables) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[72] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerVariables.ProtoReflect.Descriptor instead. -func (*ServerVariables) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{72} -} - -func (x *ServerVariables) GetAdditionalProperties() []*NamedServerVariable { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Any property starting with x- is valid. -type SpecificationExtension struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Oneof: - // *SpecificationExtension_Number - // *SpecificationExtension_Boolean - // *SpecificationExtension_String_ - Oneof isSpecificationExtension_Oneof `protobuf_oneof:"oneof"` -} - -func (x *SpecificationExtension) Reset() { - *x = SpecificationExtension{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[73] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SpecificationExtension) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SpecificationExtension) ProtoMessage() {} - -func (x *SpecificationExtension) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[73] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SpecificationExtension.ProtoReflect.Descriptor instead. -func (*SpecificationExtension) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{73} -} - -func (m *SpecificationExtension) GetOneof() isSpecificationExtension_Oneof { - if m != nil { - return m.Oneof - } - return nil -} - -func (x *SpecificationExtension) GetNumber() float64 { - if x, ok := x.GetOneof().(*SpecificationExtension_Number); ok { - return x.Number - } - return 0 -} - -func (x *SpecificationExtension) GetBoolean() bool { - if x, ok := x.GetOneof().(*SpecificationExtension_Boolean); ok { - return x.Boolean - } - return false -} - -func (x *SpecificationExtension) GetString_() string { - if x, ok := x.GetOneof().(*SpecificationExtension_String_); ok { - return x.String_ - } - return "" -} - -type isSpecificationExtension_Oneof interface { - isSpecificationExtension_Oneof() -} - -type SpecificationExtension_Number struct { - Number float64 `protobuf:"fixed64,1,opt,name=number,proto3,oneof"` -} - -type SpecificationExtension_Boolean struct { - Boolean bool `protobuf:"varint,2,opt,name=boolean,proto3,oneof"` -} - -type SpecificationExtension_String_ struct { - String_ string `protobuf:"bytes,3,opt,name=string,proto3,oneof"` -} - -func (*SpecificationExtension_Number) isSpecificationExtension_Oneof() {} - -func (*SpecificationExtension_Boolean) isSpecificationExtension_Oneof() {} - -func (*SpecificationExtension_String_) isSpecificationExtension_Oneof() {} - -type StringArray struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` -} - -func (x *StringArray) Reset() { - *x = StringArray{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[74] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StringArray) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StringArray) ProtoMessage() {} - -func (x *StringArray) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[74] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StringArray.ProtoReflect.Descriptor instead. -func (*StringArray) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{74} -} - -func (x *StringArray) GetValue() []string { - if x != nil { - return x.Value - } - return nil -} - -type Strings struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AdditionalProperties []*NamedString `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties,proto3" json:"additional_properties,omitempty"` -} - -func (x *Strings) Reset() { - *x = Strings{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[75] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Strings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Strings) ProtoMessage() {} - -func (x *Strings) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[75] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Strings.ProtoReflect.Descriptor instead. -func (*Strings) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{75} -} - -func (x *Strings) GetAdditionalProperties() []*NamedString { - if x != nil { - return x.AdditionalProperties - } - return nil -} - -// Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. -type Tag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs,proto3" json:"external_docs,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,4,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Tag) Reset() { - *x = Tag{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[76] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Tag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Tag) ProtoMessage() {} - -func (x *Tag) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[76] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Tag.ProtoReflect.Descriptor instead. -func (*Tag) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{76} -} - -func (x *Tag) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Tag) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Tag) GetExternalDocs() *ExternalDocs { - if x != nil { - return x.ExternalDocs - } - return nil -} - -func (x *Tag) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -// A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. -type Xml struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Attribute bool `protobuf:"varint,4,opt,name=attribute,proto3" json:"attribute,omitempty"` - Wrapped bool `protobuf:"varint,5,opt,name=wrapped,proto3" json:"wrapped,omitempty"` - SpecificationExtension []*NamedAny `protobuf:"bytes,6,rep,name=specification_extension,json=specificationExtension,proto3" json:"specification_extension,omitempty"` -} - -func (x *Xml) Reset() { - *x = Xml{} - if protoimpl.UnsafeEnabled { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[77] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Xml) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Xml) ProtoMessage() {} - -func (x *Xml) ProtoReflect() protoreflect.Message { - mi := &file_openapiv3_OpenAPIv3_proto_msgTypes[77] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Xml.ProtoReflect.Descriptor instead. -func (*Xml) Descriptor() ([]byte, []int) { - return file_openapiv3_OpenAPIv3_proto_rawDescGZIP(), []int{77} -} - -func (x *Xml) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Xml) GetNamespace() string { - if x != nil { - return x.Namespace - } - return "" -} - -func (x *Xml) GetPrefix() string { - if x != nil { - return x.Prefix - } - return "" -} - -func (x *Xml) GetAttribute() bool { - if x != nil { - return x.Attribute - } - return false -} - -func (x *Xml) GetWrapped() bool { - if x != nil { - return x.Wrapped - } - return false -} - -func (x *Xml) GetSpecificationExtension() []*NamedAny { - if x != nil { - return x.SpecificationExtension - } - return nil -} - -var File_openapiv3_OpenAPIv3_proto protoreflect.FileDescriptor - -var file_openapiv3_OpenAPIv3_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x33, 0x2f, 0x4f, 0x70, 0x65, 0x6e, - 0x41, 0x50, 0x49, 0x76, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 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, 0x22, 0x90, 0x01, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, - 0x4f, 0x0a, 0x13, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x11, 0x73, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x1a, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x48, 0x00, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x42, 0x07, 0x0a, 0x05, - 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x45, 0x0a, 0x03, 0x41, 0x6e, 0x79, 0x12, 0x2a, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 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, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x79, 0x61, 0x6d, 0x6c, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x22, 0x79, 0x0a, 0x0f, - 0x41, 0x6e, 0x79, 0x4f, 0x72, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x23, 0x0a, 0x03, 0x61, 0x6e, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, 0x79, 0x48, 0x00, 0x52, - 0x03, 0x61, 0x6e, 0x79, 0x12, 0x38, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x48, 0x00, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x07, - 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x88, 0x01, 0x0a, 0x08, 0x43, 0x61, 0x6c, 0x6c, - 0x62, 0x61, 0x63, 0x6b, 0x12, 0x2d, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x89, 0x01, 0x0a, 0x13, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x4f, - 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x63, 0x61, - 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x48, 0x00, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x35, - 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x72, - 0x0a, 0x15, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x14, 0x61, 0x64, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, - 0x65, 0x73, 0x22, 0xac, 0x05, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x39, 0x0a, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x73, 0x52, 0x07, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x12, 0x3f, 0x0a, 0x09, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x42, 0x0a, - 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x73, 0x12, 0x3c, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, - 0x4c, 0x0a, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x69, 0x65, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x69, - 0x65, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x0d, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x69, 0x65, 0x73, 0x12, 0x39, 0x0a, - 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, - 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x73, 0x65, 0x63, 0x75, - 0x72, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x4f, - 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x0f, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x05, - 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x4f, 0x72, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b, - 0x73, 0x12, 0x3f, 0x0a, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x73, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0x94, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, - 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x66, 0x0a, 0x0b, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x12, 0x1a, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x18, 0x0a, - 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, - 0x22, 0xb2, 0x01, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, - 0x6f, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x6d, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x07, 0x6d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc9, 0x03, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x12, 0x24, 0x0a, 0x04, - 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, - 0x66, 0x6f, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x12, 0x27, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x74, - 0x68, 0x73, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x12, 0x36, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x23, - 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x61, 0x67, 0x52, 0x04, 0x74, - 0x61, 0x67, 0x73, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, - 0x64, 0x6f, 0x63, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, - 0x63, 0x73, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0x8e, 0x02, 0x0a, 0x08, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x21, - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x39, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x73, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x79, - 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x64, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x09, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x4e, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, - 0x64, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, - 0xe2, 0x01, 0x0a, 0x07, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, - 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x01, 0x0a, 0x12, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x48, 0x00, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x09, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x70, 0x0a, 0x14, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4f, 0x72, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x57, - 0x0a, 0x0a, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x15, - 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, - 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x4d, 0x0a, 0x17, - 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8a, 0x04, 0x0a, 0x06, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, - 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, - 0x69, 0x72, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x64, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x64, 0x65, - 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x29, - 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, 0x79, - 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x08, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, - 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, - 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, - 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x81, 0x01, 0x0a, 0x11, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2c, - 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x48, 0x00, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x09, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x6e, 0x0a, 0x13, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xc9, 0x02, 0x0a, - 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, - 0x10, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x4f, 0x66, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x2d, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x6c, 0x69, - 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x5a, 0x0a, 0x09, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x4d, 0x0a, 0x13, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, - 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x52, 0x11, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x22, 0x7e, 0x0a, 0x07, 0x4c, 0x69, 0x63, 0x65, 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, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xe8, 0x02, 0x0a, 0x04, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x23, 0x0a, - 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x66, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, 0x79, 0x4f, 0x72, 0x45, 0x78, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x0c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, 0x79, 0x4f, 0x72, 0x45, 0x78, 0x70, 0x72, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x79, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, - 0x6e, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x35, 0x0a, 0x09, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x6a, 0x0a, 0x11, 0x4c, 0x69, - 0x6e, 0x6b, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, - 0x55, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, - 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xad, 0x02, 0x0a, 0x09, 0x4d, 0x65, 0x64, 0x69, 0x61, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x29, 0x0a, 0x07, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x4f, 0x72, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x08, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x08, 0x65, - 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, - 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x0a, 0x0a, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, - 0x79, 0x70, 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x45, 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x18, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x4f, 0x72, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x6f, - 0x64, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x63, 0x0a, 0x17, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x45, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x61, 0x0a, 0x16, 0x4e, 0x61, 0x6d, - 0x65, 0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5d, 0x0a, 0x14, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x51, 0x0a, 0x0e, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, - 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x67, - 0x0a, 0x19, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, 0x0d, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, - 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x6b, 0x0a, 0x1b, 0x4e, 0x61, 0x6d, 0x65, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x4f, 0x72, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, - 0x6f, 0x64, 0x79, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x65, 0x0a, 0x18, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x61, 0x0a, 0x16, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x71, 0x0a, 0x1e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, - 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x5b, 0x0a, 0x13, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x37, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x55, 0x0a, 0x10, 0x4e, 0x61, 0x6d, 0x65, - 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0xf2, 0x01, 0x0a, 0x09, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x2b, 0x0a, - 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x75, - 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, - 0x66, 0x72, 0x65, 0x73, 0x68, 0x55, 0x72, 0x6c, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x06, 0x73, - 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xcd, 0x02, 0x0a, 0x0a, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x46, 0x6c, - 0x6f, 0x77, 0x73, 0x12, 0x31, 0x0a, 0x08, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x08, 0x69, 0x6d, - 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x46, 0x6c, 0x6f, 0x77, 0x52, - 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x44, 0x0a, 0x12, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x11, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, - 0x44, 0x0a, 0x12, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x61, 0x75, 0x74, 0x68, 0x46, 0x6c, - 0x6f, 0x77, 0x52, 0x11, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x53, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x49, - 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x41, 0x6e, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x96, 0x05, 0x0a, 0x09, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, - 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x0a, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, - 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x0c, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, - 0x64, 0x79, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x62, - 0x61, 0x63, 0x6b, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, - 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x09, 0x63, - 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, - 0x72, 0x69, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, - 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x73, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0xb1, 0x04, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x02, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, - 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x65, 0x6d, 0x70, 0x74, - 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, - 0x74, 0x79, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x64, 0x65, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x64, 0x65, 0x12, 0x25, - 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x29, 0x0a, 0x07, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, - 0x6c, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x4f, - 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x08, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, - 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8d, 0x01, 0x0a, 0x14, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x35, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x09, 0x70, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, - 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x74, 0x0a, 0x16, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, - 0x12, 0x5a, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, - 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xfa, 0x04, 0x0a, - 0x08, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, - 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x18, 0x0a, 0x07, - 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, - 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x67, 0x65, - 0x74, 0x12, 0x27, 0x0a, 0x03, 0x70, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x70, 0x75, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x70, 0x6f, - 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x04, 0x70, 0x6f, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x0a, 0x04, 0x68, 0x65, 0x61, 0x64, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x04, 0x68, 0x65, 0x61, 0x64, - 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x70, 0x61, 0x74, 0x63, 0x68, 0x12, 0x2b, 0x0a, - 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x40, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0a, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, - 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, - 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x85, 0x01, 0x0a, 0x05, 0x50, 0x61, - 0x74, 0x68, 0x73, 0x12, 0x2d, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x50, 0x61, 0x74, 0x68, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x22, 0x65, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, - 0x57, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, - 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x5a, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x11, 0x0a, 0x04, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x52, 0x65, 0x66, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x79, 0x0a, 0x19, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, - 0x6f, 0x64, 0x69, 0x65, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x73, 0x12, 0x5c, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x4f, 0x72, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, - 0xcc, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x30, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, - 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x96, - 0x01, 0x0a, 0x16, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x4f, 0x72, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x35, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, - 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x9d, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4f, 0x72, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x12, 0x30, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x4d, 0x65, 0x64, 0x69, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x4c, 0x69, 0x6e, 0x6b, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x73, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x6b, 0x73, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, - 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x89, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, - 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, - 0x65, 0x6f, 0x66, 0x22, 0xef, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x73, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x58, 0x0a, 0x15, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x52, 0x13, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x72, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x59, - 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, - 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xaf, 0x0b, 0x0a, 0x06, 0x53, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, - 0x12, 0x3f, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x0d, 0x64, 0x69, 0x73, 0x63, 0x72, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x1d, - 0x0a, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x21, 0x0a, - 0x03, 0x78, 0x6d, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x58, 0x6d, 0x6c, 0x52, 0x03, 0x78, 0x6d, 0x6c, - 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, - 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, - 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, - 0x29, 0x0a, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, - 0x79, 0x52, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, - 0x74, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x4f, - 0x66, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, - 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, - 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, - 0x65, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x69, - 0x6d, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x69, 0x6d, - 0x75, 0x6d, 0x12, 0x2b, 0x0a, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x5f, - 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x65, - 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x4d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x12, - 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1d, - 0x0a, 0x0a, 0x6d, 0x69, 0x6e, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x10, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x09, 0x6d, 0x69, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, - 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x69, - 0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, - 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6d, 0x69, 0x6e, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, - 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x61, - 0x78, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x6d, - 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x16, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, - 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x17, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x23, - 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, - 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x65, - 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x19, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x61, 0x6c, 0x6c, 0x5f, 0x6f, - 0x66, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x4f, 0x66, 0x12, 0x34, 0x0a, - 0x06, 0x6f, 0x6e, 0x65, 0x5f, 0x6f, 0x66, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x05, 0x6f, 0x6e, - 0x65, 0x4f, 0x66, 0x12, 0x34, 0x0a, 0x06, 0x61, 0x6e, 0x79, 0x5f, 0x6f, 0x66, 0x18, 0x1c, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x52, 0x05, 0x61, 0x6e, 0x79, 0x4f, 0x66, 0x12, 0x24, 0x0a, 0x03, 0x6e, 0x6f, 0x74, - 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x03, 0x6e, 0x6f, 0x74, 0x12, - 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x74, 0x65, 0x6d, - 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x0a, - 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x69, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x20, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, - 0x2e, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, - 0x72, 0x74, 0x69, 0x65, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, - 0x31, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x23, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x4d, 0x0a, 0x17, - 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x24, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, - 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x81, 0x01, 0x0a, 0x11, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x48, 0x00, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, - 0x35, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, - 0x6e, 0x0a, 0x13, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x57, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4f, 0x72, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, - 0x68, 0x0a, 0x13, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x69, - 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, - 0x72, 0x61, 0x79, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xd3, 0x02, 0x0a, 0x0e, 0x53, 0x65, - 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x65, 0x61, 0x72, 0x65, 0x72, 0x46, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x12, 0x2c, 0x0a, 0x05, 0x66, 0x6c, 0x6f, 0x77, 0x73, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x4f, 0x61, 0x75, 0x74, 0x68, 0x46, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x77, - 0x73, 0x12, 0x2d, 0x0a, 0x13, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x5f, 0x63, 0x6f, 0x6e, - 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, - 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x55, 0x72, 0x6c, - 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0xa2, 0x01, 0x0a, 0x19, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x45, 0x0a, - 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, - 0x68, 0x65, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, - 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x6f, - 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x7e, 0x0a, 0x1b, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x73, 0x12, 0x5f, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, - 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x65, 0x4f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x14, - 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x69, 0x65, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, - 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, - 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, - 0x6c, 0x65, 0x73, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x4d, - 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, - 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xaf, 0x01, - 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, - 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x67, 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, - 0x65, 0x73, 0x12, 0x54, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, - 0x61, 0x6d, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, - 0x6c, 0x65, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, 0x72, - 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x71, 0x0a, 0x16, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x01, 0x48, 0x00, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x07, - 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, - 0x07, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x23, 0x0a, 0x0b, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x57, 0x0a, 0x07, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4c, 0x0a, 0x15, 0x61, - 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, - 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x70, 0x65, - 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x14, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0xc9, 0x01, 0x0a, 0x03, 0x54, 0x61, - 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x6f, 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x45, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x44, 0x6f, 0x63, 0x73, 0x12, 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd6, 0x01, 0x0a, 0x03, 0x58, 0x6d, 0x6c, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x12, - 0x4d, 0x0a, 0x17, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x33, 0x2e, 0x4e, 0x61, - 0x6d, 0x65, 0x64, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x3e, - 0x0a, 0x0e, 0x6f, 0x72, 0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x33, - 0x42, 0x0c, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x50, 0x49, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x16, 0x2e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x33, 0x3b, 0x6f, 0x70, - 0x65, 0x6e, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x33, 0xa2, 0x02, 0x03, 0x4f, 0x41, 0x53, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_openapiv3_OpenAPIv3_proto_rawDescOnce sync.Once - file_openapiv3_OpenAPIv3_proto_rawDescData = file_openapiv3_OpenAPIv3_proto_rawDesc -) - -func file_openapiv3_OpenAPIv3_proto_rawDescGZIP() []byte { - file_openapiv3_OpenAPIv3_proto_rawDescOnce.Do(func() { - file_openapiv3_OpenAPIv3_proto_rawDescData = protoimpl.X.CompressGZIP(file_openapiv3_OpenAPIv3_proto_rawDescData) - }) - return file_openapiv3_OpenAPIv3_proto_rawDescData -} - -var file_openapiv3_OpenAPIv3_proto_msgTypes = make([]protoimpl.MessageInfo, 78) -var file_openapiv3_OpenAPIv3_proto_goTypes = []interface{}{ - (*AdditionalPropertiesItem)(nil), // 0: openapi.v3.AdditionalPropertiesItem - (*Any)(nil), // 1: openapi.v3.Any - (*AnyOrExpression)(nil), // 2: openapi.v3.AnyOrExpression - (*Callback)(nil), // 3: openapi.v3.Callback - (*CallbackOrReference)(nil), // 4: openapi.v3.CallbackOrReference - (*CallbacksOrReferences)(nil), // 5: openapi.v3.CallbacksOrReferences - (*Components)(nil), // 6: openapi.v3.Components - (*Contact)(nil), // 7: openapi.v3.Contact - (*DefaultType)(nil), // 8: openapi.v3.DefaultType - (*Discriminator)(nil), // 9: openapi.v3.Discriminator - (*Document)(nil), // 10: openapi.v3.Document - (*Encoding)(nil), // 11: openapi.v3.Encoding - (*Encodings)(nil), // 12: openapi.v3.Encodings - (*Example)(nil), // 13: openapi.v3.Example - (*ExampleOrReference)(nil), // 14: openapi.v3.ExampleOrReference - (*ExamplesOrReferences)(nil), // 15: openapi.v3.ExamplesOrReferences - (*Expression)(nil), // 16: openapi.v3.Expression - (*ExternalDocs)(nil), // 17: openapi.v3.ExternalDocs - (*Header)(nil), // 18: openapi.v3.Header - (*HeaderOrReference)(nil), // 19: openapi.v3.HeaderOrReference - (*HeadersOrReferences)(nil), // 20: openapi.v3.HeadersOrReferences - (*Info)(nil), // 21: openapi.v3.Info - (*ItemsItem)(nil), // 22: openapi.v3.ItemsItem - (*License)(nil), // 23: openapi.v3.License - (*Link)(nil), // 24: openapi.v3.Link - (*LinkOrReference)(nil), // 25: openapi.v3.LinkOrReference - (*LinksOrReferences)(nil), // 26: openapi.v3.LinksOrReferences - (*MediaType)(nil), // 27: openapi.v3.MediaType - (*MediaTypes)(nil), // 28: openapi.v3.MediaTypes - (*NamedAny)(nil), // 29: openapi.v3.NamedAny - (*NamedCallbackOrReference)(nil), // 30: openapi.v3.NamedCallbackOrReference - (*NamedEncoding)(nil), // 31: openapi.v3.NamedEncoding - (*NamedExampleOrReference)(nil), // 32: openapi.v3.NamedExampleOrReference - (*NamedHeaderOrReference)(nil), // 33: openapi.v3.NamedHeaderOrReference - (*NamedLinkOrReference)(nil), // 34: openapi.v3.NamedLinkOrReference - (*NamedMediaType)(nil), // 35: openapi.v3.NamedMediaType - (*NamedParameterOrReference)(nil), // 36: openapi.v3.NamedParameterOrReference - (*NamedPathItem)(nil), // 37: openapi.v3.NamedPathItem - (*NamedRequestBodyOrReference)(nil), // 38: openapi.v3.NamedRequestBodyOrReference - (*NamedResponseOrReference)(nil), // 39: openapi.v3.NamedResponseOrReference - (*NamedSchemaOrReference)(nil), // 40: openapi.v3.NamedSchemaOrReference - (*NamedSecuritySchemeOrReference)(nil), // 41: openapi.v3.NamedSecuritySchemeOrReference - (*NamedServerVariable)(nil), // 42: openapi.v3.NamedServerVariable - (*NamedString)(nil), // 43: openapi.v3.NamedString - (*NamedStringArray)(nil), // 44: openapi.v3.NamedStringArray - (*OauthFlow)(nil), // 45: openapi.v3.OauthFlow - (*OauthFlows)(nil), // 46: openapi.v3.OauthFlows - (*Object)(nil), // 47: openapi.v3.Object - (*Operation)(nil), // 48: openapi.v3.Operation - (*Parameter)(nil), // 49: openapi.v3.Parameter - (*ParameterOrReference)(nil), // 50: openapi.v3.ParameterOrReference - (*ParametersOrReferences)(nil), // 51: openapi.v3.ParametersOrReferences - (*PathItem)(nil), // 52: openapi.v3.PathItem - (*Paths)(nil), // 53: openapi.v3.Paths - (*Properties)(nil), // 54: openapi.v3.Properties - (*Reference)(nil), // 55: openapi.v3.Reference - (*RequestBodiesOrReferences)(nil), // 56: openapi.v3.RequestBodiesOrReferences - (*RequestBody)(nil), // 57: openapi.v3.RequestBody - (*RequestBodyOrReference)(nil), // 58: openapi.v3.RequestBodyOrReference - (*Response)(nil), // 59: openapi.v3.Response - (*ResponseOrReference)(nil), // 60: openapi.v3.ResponseOrReference - (*Responses)(nil), // 61: openapi.v3.Responses - (*ResponsesOrReferences)(nil), // 62: openapi.v3.ResponsesOrReferences - (*Schema)(nil), // 63: openapi.v3.Schema - (*SchemaOrReference)(nil), // 64: openapi.v3.SchemaOrReference - (*SchemasOrReferences)(nil), // 65: openapi.v3.SchemasOrReferences - (*SecurityRequirement)(nil), // 66: openapi.v3.SecurityRequirement - (*SecurityScheme)(nil), // 67: openapi.v3.SecurityScheme - (*SecuritySchemeOrReference)(nil), // 68: openapi.v3.SecuritySchemeOrReference - (*SecuritySchemesOrReferences)(nil), // 69: openapi.v3.SecuritySchemesOrReferences - (*Server)(nil), // 70: openapi.v3.Server - (*ServerVariable)(nil), // 71: openapi.v3.ServerVariable - (*ServerVariables)(nil), // 72: openapi.v3.ServerVariables - (*SpecificationExtension)(nil), // 73: openapi.v3.SpecificationExtension - (*StringArray)(nil), // 74: openapi.v3.StringArray - (*Strings)(nil), // 75: openapi.v3.Strings - (*Tag)(nil), // 76: openapi.v3.Tag - (*Xml)(nil), // 77: openapi.v3.Xml - (*anypb.Any)(nil), // 78: google.protobuf.Any -} -var file_openapiv3_OpenAPIv3_proto_depIdxs = []int32{ - 64, // 0: openapi.v3.AdditionalPropertiesItem.schema_or_reference:type_name -> openapi.v3.SchemaOrReference - 78, // 1: openapi.v3.Any.value:type_name -> google.protobuf.Any - 1, // 2: openapi.v3.AnyOrExpression.any:type_name -> openapi.v3.Any - 16, // 3: openapi.v3.AnyOrExpression.expression:type_name -> openapi.v3.Expression - 37, // 4: openapi.v3.Callback.path:type_name -> openapi.v3.NamedPathItem - 29, // 5: openapi.v3.Callback.specification_extension:type_name -> openapi.v3.NamedAny - 3, // 6: openapi.v3.CallbackOrReference.callback:type_name -> openapi.v3.Callback - 55, // 7: openapi.v3.CallbackOrReference.reference:type_name -> openapi.v3.Reference - 30, // 8: openapi.v3.CallbacksOrReferences.additional_properties:type_name -> openapi.v3.NamedCallbackOrReference - 65, // 9: openapi.v3.Components.schemas:type_name -> openapi.v3.SchemasOrReferences - 62, // 10: openapi.v3.Components.responses:type_name -> openapi.v3.ResponsesOrReferences - 51, // 11: openapi.v3.Components.parameters:type_name -> openapi.v3.ParametersOrReferences - 15, // 12: openapi.v3.Components.examples:type_name -> openapi.v3.ExamplesOrReferences - 56, // 13: openapi.v3.Components.request_bodies:type_name -> openapi.v3.RequestBodiesOrReferences - 20, // 14: openapi.v3.Components.headers:type_name -> openapi.v3.HeadersOrReferences - 69, // 15: openapi.v3.Components.security_schemes:type_name -> openapi.v3.SecuritySchemesOrReferences - 26, // 16: openapi.v3.Components.links:type_name -> openapi.v3.LinksOrReferences - 5, // 17: openapi.v3.Components.callbacks:type_name -> openapi.v3.CallbacksOrReferences - 29, // 18: openapi.v3.Components.specification_extension:type_name -> openapi.v3.NamedAny - 29, // 19: openapi.v3.Contact.specification_extension:type_name -> openapi.v3.NamedAny - 75, // 20: openapi.v3.Discriminator.mapping:type_name -> openapi.v3.Strings - 29, // 21: openapi.v3.Discriminator.specification_extension:type_name -> openapi.v3.NamedAny - 21, // 22: openapi.v3.Document.info:type_name -> openapi.v3.Info - 70, // 23: openapi.v3.Document.servers:type_name -> openapi.v3.Server - 53, // 24: openapi.v3.Document.paths:type_name -> openapi.v3.Paths - 6, // 25: openapi.v3.Document.components:type_name -> openapi.v3.Components - 66, // 26: openapi.v3.Document.security:type_name -> openapi.v3.SecurityRequirement - 76, // 27: openapi.v3.Document.tags:type_name -> openapi.v3.Tag - 17, // 28: openapi.v3.Document.external_docs:type_name -> openapi.v3.ExternalDocs - 29, // 29: openapi.v3.Document.specification_extension:type_name -> openapi.v3.NamedAny - 20, // 30: openapi.v3.Encoding.headers:type_name -> openapi.v3.HeadersOrReferences - 29, // 31: openapi.v3.Encoding.specification_extension:type_name -> openapi.v3.NamedAny - 31, // 32: openapi.v3.Encodings.additional_properties:type_name -> openapi.v3.NamedEncoding - 1, // 33: openapi.v3.Example.value:type_name -> openapi.v3.Any - 29, // 34: openapi.v3.Example.specification_extension:type_name -> openapi.v3.NamedAny - 13, // 35: openapi.v3.ExampleOrReference.example:type_name -> openapi.v3.Example - 55, // 36: openapi.v3.ExampleOrReference.reference:type_name -> openapi.v3.Reference - 32, // 37: openapi.v3.ExamplesOrReferences.additional_properties:type_name -> openapi.v3.NamedExampleOrReference - 29, // 38: openapi.v3.Expression.additional_properties:type_name -> openapi.v3.NamedAny - 29, // 39: openapi.v3.ExternalDocs.specification_extension:type_name -> openapi.v3.NamedAny - 64, // 40: openapi.v3.Header.schema:type_name -> openapi.v3.SchemaOrReference - 1, // 41: openapi.v3.Header.example:type_name -> openapi.v3.Any - 15, // 42: openapi.v3.Header.examples:type_name -> openapi.v3.ExamplesOrReferences - 28, // 43: openapi.v3.Header.content:type_name -> openapi.v3.MediaTypes - 29, // 44: openapi.v3.Header.specification_extension:type_name -> openapi.v3.NamedAny - 18, // 45: openapi.v3.HeaderOrReference.header:type_name -> openapi.v3.Header - 55, // 46: openapi.v3.HeaderOrReference.reference:type_name -> openapi.v3.Reference - 33, // 47: openapi.v3.HeadersOrReferences.additional_properties:type_name -> openapi.v3.NamedHeaderOrReference - 7, // 48: openapi.v3.Info.contact:type_name -> openapi.v3.Contact - 23, // 49: openapi.v3.Info.license:type_name -> openapi.v3.License - 29, // 50: openapi.v3.Info.specification_extension:type_name -> openapi.v3.NamedAny - 64, // 51: openapi.v3.ItemsItem.schema_or_reference:type_name -> openapi.v3.SchemaOrReference - 29, // 52: openapi.v3.License.specification_extension:type_name -> openapi.v3.NamedAny - 2, // 53: openapi.v3.Link.parameters:type_name -> openapi.v3.AnyOrExpression - 2, // 54: openapi.v3.Link.request_body:type_name -> openapi.v3.AnyOrExpression - 70, // 55: openapi.v3.Link.server:type_name -> openapi.v3.Server - 29, // 56: openapi.v3.Link.specification_extension:type_name -> openapi.v3.NamedAny - 24, // 57: openapi.v3.LinkOrReference.link:type_name -> openapi.v3.Link - 55, // 58: openapi.v3.LinkOrReference.reference:type_name -> openapi.v3.Reference - 34, // 59: openapi.v3.LinksOrReferences.additional_properties:type_name -> openapi.v3.NamedLinkOrReference - 64, // 60: openapi.v3.MediaType.schema:type_name -> openapi.v3.SchemaOrReference - 1, // 61: openapi.v3.MediaType.example:type_name -> openapi.v3.Any - 15, // 62: openapi.v3.MediaType.examples:type_name -> openapi.v3.ExamplesOrReferences - 12, // 63: openapi.v3.MediaType.encoding:type_name -> openapi.v3.Encodings - 29, // 64: openapi.v3.MediaType.specification_extension:type_name -> openapi.v3.NamedAny - 35, // 65: openapi.v3.MediaTypes.additional_properties:type_name -> openapi.v3.NamedMediaType - 1, // 66: openapi.v3.NamedAny.value:type_name -> openapi.v3.Any - 4, // 67: openapi.v3.NamedCallbackOrReference.value:type_name -> openapi.v3.CallbackOrReference - 11, // 68: openapi.v3.NamedEncoding.value:type_name -> openapi.v3.Encoding - 14, // 69: openapi.v3.NamedExampleOrReference.value:type_name -> openapi.v3.ExampleOrReference - 19, // 70: openapi.v3.NamedHeaderOrReference.value:type_name -> openapi.v3.HeaderOrReference - 25, // 71: openapi.v3.NamedLinkOrReference.value:type_name -> openapi.v3.LinkOrReference - 27, // 72: openapi.v3.NamedMediaType.value:type_name -> openapi.v3.MediaType - 50, // 73: openapi.v3.NamedParameterOrReference.value:type_name -> openapi.v3.ParameterOrReference - 52, // 74: openapi.v3.NamedPathItem.value:type_name -> openapi.v3.PathItem - 58, // 75: openapi.v3.NamedRequestBodyOrReference.value:type_name -> openapi.v3.RequestBodyOrReference - 60, // 76: openapi.v3.NamedResponseOrReference.value:type_name -> openapi.v3.ResponseOrReference - 64, // 77: openapi.v3.NamedSchemaOrReference.value:type_name -> openapi.v3.SchemaOrReference - 68, // 78: openapi.v3.NamedSecuritySchemeOrReference.value:type_name -> openapi.v3.SecuritySchemeOrReference - 71, // 79: openapi.v3.NamedServerVariable.value:type_name -> openapi.v3.ServerVariable - 74, // 80: openapi.v3.NamedStringArray.value:type_name -> openapi.v3.StringArray - 75, // 81: openapi.v3.OauthFlow.scopes:type_name -> openapi.v3.Strings - 29, // 82: openapi.v3.OauthFlow.specification_extension:type_name -> openapi.v3.NamedAny - 45, // 83: openapi.v3.OauthFlows.implicit:type_name -> openapi.v3.OauthFlow - 45, // 84: openapi.v3.OauthFlows.password:type_name -> openapi.v3.OauthFlow - 45, // 85: openapi.v3.OauthFlows.client_credentials:type_name -> openapi.v3.OauthFlow - 45, // 86: openapi.v3.OauthFlows.authorization_code:type_name -> openapi.v3.OauthFlow - 29, // 87: openapi.v3.OauthFlows.specification_extension:type_name -> openapi.v3.NamedAny - 29, // 88: openapi.v3.Object.additional_properties:type_name -> openapi.v3.NamedAny - 17, // 89: openapi.v3.Operation.external_docs:type_name -> openapi.v3.ExternalDocs - 50, // 90: openapi.v3.Operation.parameters:type_name -> openapi.v3.ParameterOrReference - 58, // 91: openapi.v3.Operation.request_body:type_name -> openapi.v3.RequestBodyOrReference - 61, // 92: openapi.v3.Operation.responses:type_name -> openapi.v3.Responses - 5, // 93: openapi.v3.Operation.callbacks:type_name -> openapi.v3.CallbacksOrReferences - 66, // 94: openapi.v3.Operation.security:type_name -> openapi.v3.SecurityRequirement - 70, // 95: openapi.v3.Operation.servers:type_name -> openapi.v3.Server - 29, // 96: openapi.v3.Operation.specification_extension:type_name -> openapi.v3.NamedAny - 64, // 97: openapi.v3.Parameter.schema:type_name -> openapi.v3.SchemaOrReference - 1, // 98: openapi.v3.Parameter.example:type_name -> openapi.v3.Any - 15, // 99: openapi.v3.Parameter.examples:type_name -> openapi.v3.ExamplesOrReferences - 28, // 100: openapi.v3.Parameter.content:type_name -> openapi.v3.MediaTypes - 29, // 101: openapi.v3.Parameter.specification_extension:type_name -> openapi.v3.NamedAny - 49, // 102: openapi.v3.ParameterOrReference.parameter:type_name -> openapi.v3.Parameter - 55, // 103: openapi.v3.ParameterOrReference.reference:type_name -> openapi.v3.Reference - 36, // 104: openapi.v3.ParametersOrReferences.additional_properties:type_name -> openapi.v3.NamedParameterOrReference - 48, // 105: openapi.v3.PathItem.get:type_name -> openapi.v3.Operation - 48, // 106: openapi.v3.PathItem.put:type_name -> openapi.v3.Operation - 48, // 107: openapi.v3.PathItem.post:type_name -> openapi.v3.Operation - 48, // 108: openapi.v3.PathItem.delete:type_name -> openapi.v3.Operation - 48, // 109: openapi.v3.PathItem.options:type_name -> openapi.v3.Operation - 48, // 110: openapi.v3.PathItem.head:type_name -> openapi.v3.Operation - 48, // 111: openapi.v3.PathItem.patch:type_name -> openapi.v3.Operation - 48, // 112: openapi.v3.PathItem.trace:type_name -> openapi.v3.Operation - 70, // 113: openapi.v3.PathItem.servers:type_name -> openapi.v3.Server - 50, // 114: openapi.v3.PathItem.parameters:type_name -> openapi.v3.ParameterOrReference - 29, // 115: openapi.v3.PathItem.specification_extension:type_name -> openapi.v3.NamedAny - 37, // 116: openapi.v3.Paths.path:type_name -> openapi.v3.NamedPathItem - 29, // 117: openapi.v3.Paths.specification_extension:type_name -> openapi.v3.NamedAny - 40, // 118: openapi.v3.Properties.additional_properties:type_name -> openapi.v3.NamedSchemaOrReference - 38, // 119: openapi.v3.RequestBodiesOrReferences.additional_properties:type_name -> openapi.v3.NamedRequestBodyOrReference - 28, // 120: openapi.v3.RequestBody.content:type_name -> openapi.v3.MediaTypes - 29, // 121: openapi.v3.RequestBody.specification_extension:type_name -> openapi.v3.NamedAny - 57, // 122: openapi.v3.RequestBodyOrReference.request_body:type_name -> openapi.v3.RequestBody - 55, // 123: openapi.v3.RequestBodyOrReference.reference:type_name -> openapi.v3.Reference - 20, // 124: openapi.v3.Response.headers:type_name -> openapi.v3.HeadersOrReferences - 28, // 125: openapi.v3.Response.content:type_name -> openapi.v3.MediaTypes - 26, // 126: openapi.v3.Response.links:type_name -> openapi.v3.LinksOrReferences - 29, // 127: openapi.v3.Response.specification_extension:type_name -> openapi.v3.NamedAny - 59, // 128: openapi.v3.ResponseOrReference.response:type_name -> openapi.v3.Response - 55, // 129: openapi.v3.ResponseOrReference.reference:type_name -> openapi.v3.Reference - 60, // 130: openapi.v3.Responses.default:type_name -> openapi.v3.ResponseOrReference - 39, // 131: openapi.v3.Responses.response_or_reference:type_name -> openapi.v3.NamedResponseOrReference - 29, // 132: openapi.v3.Responses.specification_extension:type_name -> openapi.v3.NamedAny - 39, // 133: openapi.v3.ResponsesOrReferences.additional_properties:type_name -> openapi.v3.NamedResponseOrReference - 9, // 134: openapi.v3.Schema.discriminator:type_name -> openapi.v3.Discriminator - 77, // 135: openapi.v3.Schema.xml:type_name -> openapi.v3.Xml - 17, // 136: openapi.v3.Schema.external_docs:type_name -> openapi.v3.ExternalDocs - 1, // 137: openapi.v3.Schema.example:type_name -> openapi.v3.Any - 1, // 138: openapi.v3.Schema.enum:type_name -> openapi.v3.Any - 64, // 139: openapi.v3.Schema.all_of:type_name -> openapi.v3.SchemaOrReference - 64, // 140: openapi.v3.Schema.one_of:type_name -> openapi.v3.SchemaOrReference - 64, // 141: openapi.v3.Schema.any_of:type_name -> openapi.v3.SchemaOrReference - 63, // 142: openapi.v3.Schema.not:type_name -> openapi.v3.Schema - 22, // 143: openapi.v3.Schema.items:type_name -> openapi.v3.ItemsItem - 54, // 144: openapi.v3.Schema.properties:type_name -> openapi.v3.Properties - 0, // 145: openapi.v3.Schema.additional_properties:type_name -> openapi.v3.AdditionalPropertiesItem - 8, // 146: openapi.v3.Schema.default:type_name -> openapi.v3.DefaultType - 29, // 147: openapi.v3.Schema.specification_extension:type_name -> openapi.v3.NamedAny - 63, // 148: openapi.v3.SchemaOrReference.schema:type_name -> openapi.v3.Schema - 55, // 149: openapi.v3.SchemaOrReference.reference:type_name -> openapi.v3.Reference - 40, // 150: openapi.v3.SchemasOrReferences.additional_properties:type_name -> openapi.v3.NamedSchemaOrReference - 44, // 151: openapi.v3.SecurityRequirement.additional_properties:type_name -> openapi.v3.NamedStringArray - 46, // 152: openapi.v3.SecurityScheme.flows:type_name -> openapi.v3.OauthFlows - 29, // 153: openapi.v3.SecurityScheme.specification_extension:type_name -> openapi.v3.NamedAny - 67, // 154: openapi.v3.SecuritySchemeOrReference.security_scheme:type_name -> openapi.v3.SecurityScheme - 55, // 155: openapi.v3.SecuritySchemeOrReference.reference:type_name -> openapi.v3.Reference - 41, // 156: openapi.v3.SecuritySchemesOrReferences.additional_properties:type_name -> openapi.v3.NamedSecuritySchemeOrReference - 72, // 157: openapi.v3.Server.variables:type_name -> openapi.v3.ServerVariables - 29, // 158: openapi.v3.Server.specification_extension:type_name -> openapi.v3.NamedAny - 29, // 159: openapi.v3.ServerVariable.specification_extension:type_name -> openapi.v3.NamedAny - 42, // 160: openapi.v3.ServerVariables.additional_properties:type_name -> openapi.v3.NamedServerVariable - 43, // 161: openapi.v3.Strings.additional_properties:type_name -> openapi.v3.NamedString - 17, // 162: openapi.v3.Tag.external_docs:type_name -> openapi.v3.ExternalDocs - 29, // 163: openapi.v3.Tag.specification_extension:type_name -> openapi.v3.NamedAny - 29, // 164: openapi.v3.Xml.specification_extension:type_name -> openapi.v3.NamedAny - 165, // [165:165] is the sub-list for method output_type - 165, // [165:165] is the sub-list for method input_type - 165, // [165:165] is the sub-list for extension type_name - 165, // [165:165] is the sub-list for extension extendee - 0, // [0:165] is the sub-list for field type_name -} - -func init() { file_openapiv3_OpenAPIv3_proto_init() } -func file_openapiv3_OpenAPIv3_proto_init() { - if File_openapiv3_OpenAPIv3_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_openapiv3_OpenAPIv3_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AdditionalPropertiesItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Any); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AnyOrExpression); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Callback); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CallbackOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CallbacksOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Components); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Contact); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DefaultType); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Discriminator); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Document); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Encoding); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Encodings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Example); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExampleOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExamplesOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Expression); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExternalDocs); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeaderOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HeadersOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Info); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ItemsItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*License); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Link); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LinkOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LinksOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaType); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaTypes); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedAny); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedCallbackOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedEncoding); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedExampleOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedHeaderOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedLinkOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedMediaType); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedParameterOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedPathItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedRequestBodyOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedResponseOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedSchemaOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedSecuritySchemeOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedServerVariable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedString); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NamedStringArray); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OauthFlow); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OauthFlows); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Object); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Operation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Parameter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParameterOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParametersOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PathItem); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Paths); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Properties); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Reference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestBodiesOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestBody); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestBodyOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Response); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Responses); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponsesOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Schema); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SchemaOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SchemasOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityRequirement); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityScheme); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecuritySchemeOrReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecuritySchemesOrReferences); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Server); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerVariable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerVariables); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SpecificationExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StringArray); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Strings); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Tag); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Xml); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_openapiv3_OpenAPIv3_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*AdditionalPropertiesItem_SchemaOrReference)(nil), - (*AdditionalPropertiesItem_Boolean)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*AnyOrExpression_Any)(nil), - (*AnyOrExpression_Expression)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[4].OneofWrappers = []interface{}{ - (*CallbackOrReference_Callback)(nil), - (*CallbackOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[8].OneofWrappers = []interface{}{ - (*DefaultType_Number)(nil), - (*DefaultType_Boolean)(nil), - (*DefaultType_String_)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[14].OneofWrappers = []interface{}{ - (*ExampleOrReference_Example)(nil), - (*ExampleOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[19].OneofWrappers = []interface{}{ - (*HeaderOrReference_Header)(nil), - (*HeaderOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[25].OneofWrappers = []interface{}{ - (*LinkOrReference_Link)(nil), - (*LinkOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[50].OneofWrappers = []interface{}{ - (*ParameterOrReference_Parameter)(nil), - (*ParameterOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[58].OneofWrappers = []interface{}{ - (*RequestBodyOrReference_RequestBody)(nil), - (*RequestBodyOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[60].OneofWrappers = []interface{}{ - (*ResponseOrReference_Response)(nil), - (*ResponseOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[64].OneofWrappers = []interface{}{ - (*SchemaOrReference_Schema)(nil), - (*SchemaOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[68].OneofWrappers = []interface{}{ - (*SecuritySchemeOrReference_SecurityScheme)(nil), - (*SecuritySchemeOrReference_Reference)(nil), - } - file_openapiv3_OpenAPIv3_proto_msgTypes[73].OneofWrappers = []interface{}{ - (*SpecificationExtension_Number)(nil), - (*SpecificationExtension_Boolean)(nil), - (*SpecificationExtension_String_)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_openapiv3_OpenAPIv3_proto_rawDesc, - NumEnums: 0, - NumMessages: 78, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_openapiv3_OpenAPIv3_proto_goTypes, - DependencyIndexes: file_openapiv3_OpenAPIv3_proto_depIdxs, - MessageInfos: file_openapiv3_OpenAPIv3_proto_msgTypes, - }.Build() - File_openapiv3_OpenAPIv3_proto = out.File - file_openapiv3_OpenAPIv3_proto_rawDesc = nil - file_openapiv3_OpenAPIv3_proto_goTypes = nil - file_openapiv3_OpenAPIv3_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.proto b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.proto deleted file mode 100644 index 1be335b89ba0..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/OpenAPIv3.proto +++ /dev/null @@ -1,672 +0,0 @@ -// Copyright 2020 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// THIS FILE IS AUTOMATICALLY GENERATED. - -syntax = "proto3"; - -package openapi.v3; - -import "google/protobuf/any.proto"; - -// This option lets the proto compiler generate Java code inside the package -// name (see below) instead of inside an outer class. It creates a simpler -// developer experience by reducing one-level of name nesting and be -// consistent with most programming languages that don't support outer classes. -option java_multiple_files = true; - -// The Java outer classname should be the filename in UpperCamelCase. This -// class is only used to hold proto descriptor, so developers don't need to -// work with it directly. -option java_outer_classname = "OpenAPIProto"; - -// The Java package name must be proto package name with proper prefix. -option java_package = "org.openapi_v3"; - -// A reasonable prefix for the Objective-C symbols generated from the package. -// It should at a minimum be 3 characters long, all uppercase, and convention -// is to use an abbreviation of the package name. Something short, but -// hopefully unique enough to not conflict with things that may come along in -// the future. 'GPB' is reserved for the protocol buffer implementation itself. -option objc_class_prefix = "OAS"; - -// The Go package name. -option go_package = "./openapiv3;openapi_v3"; - -message AdditionalPropertiesItem { - oneof oneof { - SchemaOrReference schema_or_reference = 1; - bool boolean = 2; - } -} - -message Any { - google.protobuf.Any value = 1; - string yaml = 2; -} - -message AnyOrExpression { - oneof oneof { - Any any = 1; - Expression expression = 2; - } -} - -// A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation. -message Callback { - repeated NamedPathItem path = 1; - repeated NamedAny specification_extension = 2; -} - -message CallbackOrReference { - oneof oneof { - Callback callback = 1; - Reference reference = 2; - } -} - -message CallbacksOrReferences { - repeated NamedCallbackOrReference additional_properties = 1; -} - -// Holds a set of reusable objects for different aspects of the OAS. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. -message Components { - SchemasOrReferences schemas = 1; - ResponsesOrReferences responses = 2; - ParametersOrReferences parameters = 3; - ExamplesOrReferences examples = 4; - RequestBodiesOrReferences request_bodies = 5; - HeadersOrReferences headers = 6; - SecuritySchemesOrReferences security_schemes = 7; - LinksOrReferences links = 8; - CallbacksOrReferences callbacks = 9; - repeated NamedAny specification_extension = 10; -} - -// Contact information for the exposed API. -message Contact { - string name = 1; - string url = 2; - string email = 3; - repeated NamedAny specification_extension = 4; -} - -message DefaultType { - oneof oneof { - double number = 1; - bool boolean = 2; - string string = 3; - } -} - -// When request bodies or response payloads may be one of a number of different schemas, a `discriminator` object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it. When using the discriminator, _inline_ schemas will not be considered. -message Discriminator { - string property_name = 1; - Strings mapping = 2; - repeated NamedAny specification_extension = 3; -} - -message Document { - string openapi = 1; - Info info = 2; - repeated Server servers = 3; - Paths paths = 4; - Components components = 5; - repeated SecurityRequirement security = 6; - repeated Tag tags = 7; - ExternalDocs external_docs = 8; - repeated NamedAny specification_extension = 9; -} - -// A single encoding definition applied to a single schema property. -message Encoding { - string content_type = 1; - HeadersOrReferences headers = 2; - string style = 3; - bool explode = 4; - bool allow_reserved = 5; - repeated NamedAny specification_extension = 6; -} - -message Encodings { - repeated NamedEncoding additional_properties = 1; -} - -message Example { - string summary = 1; - string description = 2; - Any value = 3; - string external_value = 4; - repeated NamedAny specification_extension = 5; -} - -message ExampleOrReference { - oneof oneof { - Example example = 1; - Reference reference = 2; - } -} - -message ExamplesOrReferences { - repeated NamedExampleOrReference additional_properties = 1; -} - -message Expression { - repeated NamedAny additional_properties = 1; -} - -// Allows referencing an external resource for extended documentation. -message ExternalDocs { - string description = 1; - string url = 2; - repeated NamedAny specification_extension = 3; -} - -// The Header Object follows the structure of the Parameter Object with the following changes: 1. `name` MUST NOT be specified, it is given in the corresponding `headers` map. 1. `in` MUST NOT be specified, it is implicitly in `header`. 1. All traits that are affected by the location MUST be applicable to a location of `header` (for example, `style`). -message Header { - string description = 1; - bool required = 2; - bool deprecated = 3; - bool allow_empty_value = 4; - string style = 5; - bool explode = 6; - bool allow_reserved = 7; - SchemaOrReference schema = 8; - Any example = 9; - ExamplesOrReferences examples = 10; - MediaTypes content = 11; - repeated NamedAny specification_extension = 12; -} - -message HeaderOrReference { - oneof oneof { - Header header = 1; - Reference reference = 2; - } -} - -message HeadersOrReferences { - repeated NamedHeaderOrReference additional_properties = 1; -} - -// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. -message Info { - string title = 1; - string description = 2; - string terms_of_service = 3; - Contact contact = 4; - License license = 5; - string version = 6; - repeated NamedAny specification_extension = 7; - string summary = 8; -} - -message ItemsItem { - repeated SchemaOrReference schema_or_reference = 1; -} - -// License information for the exposed API. -message License { - string name = 1; - string url = 2; - repeated NamedAny specification_extension = 3; -} - -// The `Link object` represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations. Unlike _dynamic_ links (i.e. links provided **in** the response payload), the OAS linking mechanism does not require link information in the runtime response. For computing links, and providing instructions to execute them, a runtime expression is used for accessing values in an operation and using them as parameters while invoking the linked operation. -message Link { - string operation_ref = 1; - string operation_id = 2; - AnyOrExpression parameters = 3; - AnyOrExpression request_body = 4; - string description = 5; - Server server = 6; - repeated NamedAny specification_extension = 7; -} - -message LinkOrReference { - oneof oneof { - Link link = 1; - Reference reference = 2; - } -} - -message LinksOrReferences { - repeated NamedLinkOrReference additional_properties = 1; -} - -// Each Media Type Object provides schema and examples for the media type identified by its key. -message MediaType { - SchemaOrReference schema = 1; - Any example = 2; - ExamplesOrReferences examples = 3; - Encodings encoding = 4; - repeated NamedAny specification_extension = 5; -} - -message MediaTypes { - repeated NamedMediaType additional_properties = 1; -} - -// Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. -message NamedAny { - // Map key - string name = 1; - // Mapped value - Any value = 2; -} - -// Automatically-generated message used to represent maps of CallbackOrReference as ordered (name,value) pairs. -message NamedCallbackOrReference { - // Map key - string name = 1; - // Mapped value - CallbackOrReference value = 2; -} - -// Automatically-generated message used to represent maps of Encoding as ordered (name,value) pairs. -message NamedEncoding { - // Map key - string name = 1; - // Mapped value - Encoding value = 2; -} - -// Automatically-generated message used to represent maps of ExampleOrReference as ordered (name,value) pairs. -message NamedExampleOrReference { - // Map key - string name = 1; - // Mapped value - ExampleOrReference value = 2; -} - -// Automatically-generated message used to represent maps of HeaderOrReference as ordered (name,value) pairs. -message NamedHeaderOrReference { - // Map key - string name = 1; - // Mapped value - HeaderOrReference value = 2; -} - -// Automatically-generated message used to represent maps of LinkOrReference as ordered (name,value) pairs. -message NamedLinkOrReference { - // Map key - string name = 1; - // Mapped value - LinkOrReference value = 2; -} - -// Automatically-generated message used to represent maps of MediaType as ordered (name,value) pairs. -message NamedMediaType { - // Map key - string name = 1; - // Mapped value - MediaType value = 2; -} - -// Automatically-generated message used to represent maps of ParameterOrReference as ordered (name,value) pairs. -message NamedParameterOrReference { - // Map key - string name = 1; - // Mapped value - ParameterOrReference value = 2; -} - -// Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. -message NamedPathItem { - // Map key - string name = 1; - // Mapped value - PathItem value = 2; -} - -// Automatically-generated message used to represent maps of RequestBodyOrReference as ordered (name,value) pairs. -message NamedRequestBodyOrReference { - // Map key - string name = 1; - // Mapped value - RequestBodyOrReference value = 2; -} - -// Automatically-generated message used to represent maps of ResponseOrReference as ordered (name,value) pairs. -message NamedResponseOrReference { - // Map key - string name = 1; - // Mapped value - ResponseOrReference value = 2; -} - -// Automatically-generated message used to represent maps of SchemaOrReference as ordered (name,value) pairs. -message NamedSchemaOrReference { - // Map key - string name = 1; - // Mapped value - SchemaOrReference value = 2; -} - -// Automatically-generated message used to represent maps of SecuritySchemeOrReference as ordered (name,value) pairs. -message NamedSecuritySchemeOrReference { - // Map key - string name = 1; - // Mapped value - SecuritySchemeOrReference value = 2; -} - -// Automatically-generated message used to represent maps of ServerVariable as ordered (name,value) pairs. -message NamedServerVariable { - // Map key - string name = 1; - // Mapped value - ServerVariable value = 2; -} - -// Automatically-generated message used to represent maps of string as ordered (name,value) pairs. -message NamedString { - // Map key - string name = 1; - // Mapped value - string value = 2; -} - -// Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. -message NamedStringArray { - // Map key - string name = 1; - // Mapped value - StringArray value = 2; -} - -// Configuration details for a supported OAuth Flow -message OauthFlow { - string authorization_url = 1; - string token_url = 2; - string refresh_url = 3; - Strings scopes = 4; - repeated NamedAny specification_extension = 5; -} - -// Allows configuration of the supported OAuth Flows. -message OauthFlows { - OauthFlow implicit = 1; - OauthFlow password = 2; - OauthFlow client_credentials = 3; - OauthFlow authorization_code = 4; - repeated NamedAny specification_extension = 5; -} - -message Object { - repeated NamedAny additional_properties = 1; -} - -// Describes a single API operation on a path. -message Operation { - repeated string tags = 1; - string summary = 2; - string description = 3; - ExternalDocs external_docs = 4; - string operation_id = 5; - repeated ParameterOrReference parameters = 6; - RequestBodyOrReference request_body = 7; - Responses responses = 8; - CallbacksOrReferences callbacks = 9; - bool deprecated = 10; - repeated SecurityRequirement security = 11; - repeated Server servers = 12; - repeated NamedAny specification_extension = 13; -} - -// Describes a single operation parameter. A unique parameter is defined by a combination of a name and location. -message Parameter { - string name = 1; - string in = 2; - string description = 3; - bool required = 4; - bool deprecated = 5; - bool allow_empty_value = 6; - string style = 7; - bool explode = 8; - bool allow_reserved = 9; - SchemaOrReference schema = 10; - Any example = 11; - ExamplesOrReferences examples = 12; - MediaTypes content = 13; - repeated NamedAny specification_extension = 14; -} - -message ParameterOrReference { - oneof oneof { - Parameter parameter = 1; - Reference reference = 2; - } -} - -message ParametersOrReferences { - repeated NamedParameterOrReference additional_properties = 1; -} - -// Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available. -message PathItem { - string _ref = 1; - string summary = 2; - string description = 3; - Operation get = 4; - Operation put = 5; - Operation post = 6; - Operation delete = 7; - Operation options = 8; - Operation head = 9; - Operation patch = 10; - Operation trace = 11; - repeated Server servers = 12; - repeated ParameterOrReference parameters = 13; - repeated NamedAny specification_extension = 14; -} - -// Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the `Server Object` in order to construct the full URL. The Paths MAY be empty, due to ACL constraints. -message Paths { - repeated NamedPathItem path = 1; - repeated NamedAny specification_extension = 2; -} - -message Properties { - repeated NamedSchemaOrReference additional_properties = 1; -} - -// A simple object to allow referencing other components in the specification, internally and externally. The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification. -message Reference { - string _ref = 1; - string summary = 2; - string description = 3; -} - -message RequestBodiesOrReferences { - repeated NamedRequestBodyOrReference additional_properties = 1; -} - -// Describes a single request body. -message RequestBody { - string description = 1; - MediaTypes content = 2; - bool required = 3; - repeated NamedAny specification_extension = 4; -} - -message RequestBodyOrReference { - oneof oneof { - RequestBody request_body = 1; - Reference reference = 2; - } -} - -// Describes a single response from an API Operation, including design-time, static `links` to operations based on the response. -message Response { - string description = 1; - HeadersOrReferences headers = 2; - MediaTypes content = 3; - LinksOrReferences links = 4; - repeated NamedAny specification_extension = 5; -} - -message ResponseOrReference { - oneof oneof { - Response response = 1; - Reference reference = 2; - } -} - -// A container for the expected responses of an operation. The container maps a HTTP response code to the expected response. The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors. The `default` MAY be used as a default response object for all HTTP codes that are not covered individually by the specification. The `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call. -message Responses { - ResponseOrReference default = 1; - repeated NamedResponseOrReference response_or_reference = 2; - repeated NamedAny specification_extension = 3; -} - -message ResponsesOrReferences { - repeated NamedResponseOrReference additional_properties = 1; -} - -// The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is an extended subset of the JSON Schema Specification Wright Draft 00. For more information about the properties, see JSON Schema Core and JSON Schema Validation. Unless stated otherwise, the property definitions follow the JSON Schema. -message Schema { - bool nullable = 1; - Discriminator discriminator = 2; - bool read_only = 3; - bool write_only = 4; - Xml xml = 5; - ExternalDocs external_docs = 6; - Any example = 7; - bool deprecated = 8; - string title = 9; - double multiple_of = 10; - double maximum = 11; - bool exclusive_maximum = 12; - double minimum = 13; - bool exclusive_minimum = 14; - int64 max_length = 15; - int64 min_length = 16; - string pattern = 17; - int64 max_items = 18; - int64 min_items = 19; - bool unique_items = 20; - int64 max_properties = 21; - int64 min_properties = 22; - repeated string required = 23; - repeated Any enum = 24; - string type = 25; - repeated SchemaOrReference all_of = 26; - repeated SchemaOrReference one_of = 27; - repeated SchemaOrReference any_of = 28; - Schema not = 29; - ItemsItem items = 30; - Properties properties = 31; - AdditionalPropertiesItem additional_properties = 32; - DefaultType default = 33; - string description = 34; - string format = 35; - repeated NamedAny specification_extension = 36; -} - -message SchemaOrReference { - oneof oneof { - Schema schema = 1; - Reference reference = 2; - } -} - -message SchemasOrReferences { - repeated NamedSchemaOrReference additional_properties = 1; -} - -// Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object. Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information. When a list of Security Requirement Objects is defined on the OpenAPI Object or Operation Object, only one of the Security Requirement Objects in the list needs to be satisfied to authorize the request. -message SecurityRequirement { - repeated NamedStringArray additional_properties = 1; -} - -// Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), mutual TLS (use of a client certificate), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect. Please note that currently (2019) the implicit flow is about to be deprecated OAuth 2.0 Security Best Current Practice. Recommended for most use case is Authorization Code Grant flow with PKCE. -message SecurityScheme { - string type = 1; - string description = 2; - string name = 3; - string in = 4; - string scheme = 5; - string bearer_format = 6; - OauthFlows flows = 7; - string open_id_connect_url = 8; - repeated NamedAny specification_extension = 9; -} - -message SecuritySchemeOrReference { - oneof oneof { - SecurityScheme security_scheme = 1; - Reference reference = 2; - } -} - -message SecuritySchemesOrReferences { - repeated NamedSecuritySchemeOrReference additional_properties = 1; -} - -// An object representing a Server. -message Server { - string url = 1; - string description = 2; - ServerVariables variables = 3; - repeated NamedAny specification_extension = 4; -} - -// An object representing a Server Variable for server URL template substitution. -message ServerVariable { - repeated string enum = 1; - string default = 2; - string description = 3; - repeated NamedAny specification_extension = 4; -} - -message ServerVariables { - repeated NamedServerVariable additional_properties = 1; -} - -// Any property starting with x- is valid. -message SpecificationExtension { - oneof oneof { - double number = 1; - bool boolean = 2; - string string = 3; - } -} - -message StringArray { - repeated string value = 1; -} - -message Strings { - repeated NamedString additional_properties = 1; -} - -// Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. -message Tag { - string name = 1; - string description = 2; - ExternalDocs external_docs = 3; - repeated NamedAny specification_extension = 4; -} - -// A metadata object that allows for more fine-tuned XML model definitions. When using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property SHOULD be used to add that information. See examples for expected behavior. -message Xml { - string name = 1; - string namespace = 2; - string prefix = 3; - bool attribute = 4; - bool wrapped = 5; - repeated NamedAny specification_extension = 6; -} - diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/README.md b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/README.md deleted file mode 100644 index 5ee12d92e24e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# OpenAPI v3 Protocol Buffer Models - -This directory contains a Protocol Buffer-language model and related code for -supporting OpenAPI v3. - -Gnostic applications and plugins can use OpenAPIv3.proto to generate Protocol -Buffer support code for their preferred languages. - -OpenAPIv3.go is used by Gnostic to read JSON and YAML OpenAPI descriptions into -the Protocol Buffer-based datastructures generated from OpenAPIv3.proto. - -OpenAPIv3.proto and OpenAPIv3.go are generated by the Gnostic compiler -generator, and OpenAPIv3.pb.go is generated by protoc, the Protocol Buffer -compiler, and protoc-gen-go, the Protocol Buffer Go code generation plugin. - -openapi-3.1.json is a JSON schema for OpenAPI 3.1 that is automatically -generated from the OpenAPI 3.1 specification. It is not an official JSON Schema -for OpenAPI. - -The schema-generator directory contains support code which generates -openapi-3.1.json from the OpenAPI 3.1 specification document (Markdown). diff --git a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/document.go b/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/document.go deleted file mode 100644 index 1cee4677350e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/gnostic-models/openapiv3/document.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 openapi_v3 - -import ( - "gopkg.in/yaml.v3" - - "github.com/google/gnostic-models/compiler" -) - -// ParseDocument reads an OpenAPI v3 description from a YAML/JSON representation. -func ParseDocument(b []byte) (*Document, error) { - info, err := compiler.ReadInfoFromBytes("", b) - if err != nil { - return nil, err - } - root := info.Content[0] - return NewDocument(root, compiler.NewContextWithExtensions("$root", root, nil, nil)) -} - -// YAMLValue produces a serialized YAML representation of the document. -func (d *Document) YAMLValue(comment string) ([]byte, error) { - rawInfo := d.ToRawInfo() - rawInfo = &yaml.Node{ - Kind: yaml.DocumentNode, - Content: []*yaml.Node{rawInfo}, - HeadComment: comment, - } - return yaml.Marshal(rawInfo) -} diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export.go deleted file mode 100644 index 29f82fe6b2f8..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/export.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017, The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cmp - -import ( - "reflect" - "unsafe" -) - -// retrieveUnexportedField uses unsafe to forcibly retrieve any field from -// a struct such that the value has read-write permissions. -// -// The parent struct, v, must be addressable, while f must be a StructField -// describing the field to retrieve. If addr is false, -// then the returned value will be shallowed copied to be non-addressable. -func retrieveUnexportedField(v reflect.Value, f reflect.StructField, addr bool) reflect.Value { - ve := reflect.NewAt(f.Type, unsafe.Pointer(uintptr(unsafe.Pointer(v.UnsafeAddr()))+f.Offset)).Elem() - if !addr { - // A field is addressable if and only if the struct is addressable. - // If the original parent value was not addressable, shallow copy the - // value to make it non-addressable to avoid leaking an implementation - // detail of how forcibly exporting a field works. - if ve.Kind() == reflect.Interface && ve.IsNil() { - return reflect.Zero(f.Type) - } - return reflect.ValueOf(ve.Interface()).Convert(f.Type) - } - return ve -} diff --git a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer.go b/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer.go deleted file mode 100644 index e5dfff69afa1..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/go-cmp/cmp/internal/value/pointer.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018, The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package value - -import ( - "reflect" - "unsafe" -) - -// Pointer is an opaque typed pointer and is guaranteed to be comparable. -type Pointer struct { - p unsafe.Pointer - t reflect.Type -} - -// PointerOf returns a Pointer from v, which must be a -// reflect.Ptr, reflect.Slice, or reflect.Map. -func PointerOf(v reflect.Value) Pointer { - // The proper representation of a pointer is unsafe.Pointer, - // which is necessary if the GC ever uses a moving collector. - return Pointer{unsafe.Pointer(v.Pointer()), v.Type()} -} - -// IsNil reports whether the pointer is nil. -func (p Pointer) IsNil() bool { - return p.p == nil -} - -// Uintptr returns the pointer as a uintptr. -func (p Pointer) Uintptr() uintptr { - return uintptr(p.p) -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/.gitignore b/cluster-autoscaler/vendor/github.com/google/s2a-go/.gitignore deleted file mode 100644 index 01764d1cdf23..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Ignore binaries without extension -//example/client/client -//example/server/server -//internal/v2/fakes2av2_server/fakes2av2_server - -.idea/ \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/CODE_OF_CONDUCT.md b/cluster-autoscaler/vendor/github.com/google/s2a-go/CODE_OF_CONDUCT.md deleted file mode 100644 index dc079b4d66eb..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,93 +0,0 @@ -# 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, 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. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the -Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/CONTRIBUTING.md b/cluster-autoscaler/vendor/github.com/google/s2a-go/CONTRIBUTING.md deleted file mode 100644 index 22b241cb732c..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/CONTRIBUTING.md +++ /dev/null @@ -1,29 +0,0 @@ -# How to Contribute - -We'd love to accept your patches and contributions to this project. There are -just a few small guidelines you need to follow. - -## Contributor License Agreement - -Contributions to this project must be accompanied by a Contributor License -Agreement (CLA). You (or your employer) retain the copyright to your -contribution; this simply gives us permission to use and redistribute your -contributions as part of the project. Head over to - to see your current agreements on file or -to sign a new one. - -You generally only need to submit a CLA once, so if you've already submitted one -(even if it was for a different project), you probably don't need to do it -again. - -## Code reviews - -All submissions, including submissions by project members, require review. We -use GitHub pull requests for this purpose. Consult -[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more -information on using pull requests. - -## Community Guidelines - -This project follows -[Google's Open Source Community Guidelines](https://opensource.google/conduct/). diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/LICENSE.md b/cluster-autoscaler/vendor/github.com/google/s2a-go/LICENSE.md deleted file mode 100644 index d64569567334..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/LICENSE.md +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/README.md b/cluster-autoscaler/vendor/github.com/google/s2a-go/README.md deleted file mode 100644 index fe0f5c1da813..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Secure Session Agent Client Libraries - -The Secure Session Agent is a service that enables a workload to offload select -operations from the mTLS handshake and protects a workload's private key -material from exfiltration. Specifically, the workload asks the Secure Session -Agent for the TLS configuration to use during the handshake, to perform private -key operations, and to validate the peer certificate chain. The Secure Session -Agent's client libraries enable applications to communicate with the Secure -Session Agent during the TLS handshake, and to encrypt traffic to the peer -after the TLS handshake is complete. - -This repository contains the source code for the Secure Session Agent's Go -client libraries, which allow gRPC and HTTP Go applications to use the Secure Session -Agent. diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/fallback/s2a_fallback.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/fallback/s2a_fallback.go deleted file mode 100644 index 034d1b912ca8..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/fallback/s2a_fallback.go +++ /dev/null @@ -1,167 +0,0 @@ -/* - * - * Copyright 2023 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. - * - */ - -// Package fallback provides default implementations of fallback options when S2A fails. -package fallback - -import ( - "context" - "crypto/tls" - "fmt" - "net" - - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/grpclog" -) - -const ( - alpnProtoStrH2 = "h2" - alpnProtoStrHTTP = "http/1.1" - defaultHTTPSPort = "443" -) - -// FallbackTLSConfigGRPC is a tls.Config used by the DefaultFallbackClientHandshakeFunc function. -// It supports GRPC use case, thus the alpn is set to 'h2'. -var FallbackTLSConfigGRPC = tls.Config{ - MinVersion: tls.VersionTLS13, - ClientSessionCache: nil, - NextProtos: []string{alpnProtoStrH2}, -} - -// FallbackTLSConfigHTTP is a tls.Config used by the DefaultFallbackDialerAndAddress func. -// It supports the HTTP use case and the alpn is set to both 'http/1.1' and 'h2'. -var FallbackTLSConfigHTTP = tls.Config{ - MinVersion: tls.VersionTLS13, - ClientSessionCache: nil, - NextProtos: []string{alpnProtoStrH2, alpnProtoStrHTTP}, -} - -// ClientHandshake establishes a TLS connection and returns it, plus its auth info. -// Inputs: -// -// targetServer: the server attempted with S2A. -// conn: the tcp connection to the server at address targetServer that was passed into S2A's ClientHandshake func. -// If fallback is successful, the `conn` should be closed. -// err: the error encountered when performing the client-side TLS handshake with S2A. -type ClientHandshake func(ctx context.Context, targetServer string, conn net.Conn, err error) (net.Conn, credentials.AuthInfo, error) - -// DefaultFallbackClientHandshakeFunc returns a ClientHandshake function, -// which establishes a TLS connection to the provided fallbackAddr, returns the new connection and its auth info. -// Example use: -// -// transportCreds, _ = s2a.NewClientCreds(&s2a.ClientOptions{ -// S2AAddress: s2aAddress, -// FallbackOpts: &s2a.FallbackOptions{ // optional -// FallbackClientHandshakeFunc: fallback.DefaultFallbackClientHandshakeFunc(fallbackAddr), -// }, -// }) -// -// The fallback server's certificate must be verifiable using OS root store. -// The fallbackAddr is expected to be a network address, e.g. example.com:port. If port is not specified, -// it uses default port 443. -// In the returned function's TLS config, ClientSessionCache is explicitly set to nil to disable TLS resumption, -// and min TLS version is set to 1.3. -func DefaultFallbackClientHandshakeFunc(fallbackAddr string) (ClientHandshake, error) { - var fallbackDialer = tls.Dialer{Config: &FallbackTLSConfigGRPC} - return defaultFallbackClientHandshakeFuncInternal(fallbackAddr, fallbackDialer.DialContext) -} - -func defaultFallbackClientHandshakeFuncInternal(fallbackAddr string, dialContextFunc func(context.Context, string, string) (net.Conn, error)) (ClientHandshake, error) { - fallbackServerAddr, err := processFallbackAddr(fallbackAddr) - if err != nil { - if grpclog.V(1) { - grpclog.Infof("error processing fallback address [%s]: %v", fallbackAddr, err) - } - return nil, err - } - return func(ctx context.Context, targetServer string, conn net.Conn, s2aErr error) (net.Conn, credentials.AuthInfo, error) { - fbConn, fbErr := dialContextFunc(ctx, "tcp", fallbackServerAddr) - if fbErr != nil { - grpclog.Infof("dialing to fallback server %s failed: %v", fallbackServerAddr, fbErr) - return nil, nil, fmt.Errorf("dialing to fallback server %s failed: %v; S2A client handshake with %s error: %w", fallbackServerAddr, fbErr, targetServer, s2aErr) - } - - tc, success := fbConn.(*tls.Conn) - if !success { - grpclog.Infof("the connection with fallback server is expected to be tls but isn't") - return nil, nil, fmt.Errorf("the connection with fallback server is expected to be tls but isn't; S2A client handshake with %s error: %w", targetServer, s2aErr) - } - - tlsInfo := credentials.TLSInfo{ - State: tc.ConnectionState(), - CommonAuthInfo: credentials.CommonAuthInfo{ - SecurityLevel: credentials.PrivacyAndIntegrity, - }, - } - if grpclog.V(1) { - grpclog.Infof("ConnectionState.NegotiatedProtocol: %v", tc.ConnectionState().NegotiatedProtocol) - grpclog.Infof("ConnectionState.HandshakeComplete: %v", tc.ConnectionState().HandshakeComplete) - grpclog.Infof("ConnectionState.ServerName: %v", tc.ConnectionState().ServerName) - } - conn.Close() - return fbConn, tlsInfo, nil - }, nil -} - -// DefaultFallbackDialerAndAddress returns a TLS dialer and the network address to dial. -// Example use: -// -// fallbackDialer, fallbackServerAddr := fallback.DefaultFallbackDialerAndAddress(fallbackAddr) -// dialTLSContext := s2a.NewS2aDialTLSContextFunc(&s2a.ClientOptions{ -// S2AAddress: s2aAddress, // required -// FallbackOpts: &s2a.FallbackOptions{ -// FallbackDialer: &s2a.FallbackDialer{ -// Dialer: fallbackDialer, -// ServerAddr: fallbackServerAddr, -// }, -// }, -// }) -// -// The fallback server's certificate should be verifiable using OS root store. -// The fallbackAddr is expected to be a network address, e.g. example.com:port. If port is not specified, -// it uses default port 443. -// In the returned function's TLS config, ClientSessionCache is explicitly set to nil to disable TLS resumption, -// and min TLS version is set to 1.3. -func DefaultFallbackDialerAndAddress(fallbackAddr string) (*tls.Dialer, string, error) { - fallbackServerAddr, err := processFallbackAddr(fallbackAddr) - if err != nil { - if grpclog.V(1) { - grpclog.Infof("error processing fallback address [%s]: %v", fallbackAddr, err) - } - return nil, "", err - } - return &tls.Dialer{Config: &FallbackTLSConfigHTTP}, fallbackServerAddr, nil -} - -func processFallbackAddr(fallbackAddr string) (string, error) { - var fallbackServerAddr string - var err error - - if fallbackAddr == "" { - return "", fmt.Errorf("empty fallback address") - } - _, _, err = net.SplitHostPort(fallbackAddr) - if err != nil { - // fallbackAddr does not have port suffix - fallbackServerAddr = net.JoinHostPort(fallbackAddr, defaultHTTPSPort) - } else { - // FallbackServerAddr already has port suffix - fallbackServerAddr = fallbackAddr - } - return fallbackServerAddr, nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/authinfo/authinfo.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/authinfo/authinfo.go deleted file mode 100644 index aa3967f9d1f9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/authinfo/authinfo.go +++ /dev/null @@ -1,119 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Package authinfo provides authentication and authorization information that -// results from the TLS handshake. -package authinfo - -import ( - "errors" - - commonpb "github.com/google/s2a-go/internal/proto/common_go_proto" - contextpb "github.com/google/s2a-go/internal/proto/s2a_context_go_proto" - grpcpb "github.com/google/s2a-go/internal/proto/s2a_go_proto" - "google.golang.org/grpc/credentials" -) - -var _ credentials.AuthInfo = (*S2AAuthInfo)(nil) - -const s2aAuthType = "s2a" - -// S2AAuthInfo exposes authentication and authorization information from the -// S2A session result to the gRPC stack. -type S2AAuthInfo struct { - s2aContext *contextpb.S2AContext - commonAuthInfo credentials.CommonAuthInfo -} - -// NewS2AAuthInfo returns a new S2AAuthInfo object from the S2A session result. -func NewS2AAuthInfo(result *grpcpb.SessionResult) (credentials.AuthInfo, error) { - return newS2AAuthInfo(result) -} - -func newS2AAuthInfo(result *grpcpb.SessionResult) (*S2AAuthInfo, error) { - if result == nil { - return nil, errors.New("NewS2aAuthInfo given nil session result") - } - return &S2AAuthInfo{ - s2aContext: &contextpb.S2AContext{ - ApplicationProtocol: result.GetApplicationProtocol(), - TlsVersion: result.GetState().GetTlsVersion(), - Ciphersuite: result.GetState().GetTlsCiphersuite(), - PeerIdentity: result.GetPeerIdentity(), - LocalIdentity: result.GetLocalIdentity(), - PeerCertFingerprint: result.GetPeerCertFingerprint(), - LocalCertFingerprint: result.GetLocalCertFingerprint(), - IsHandshakeResumed: result.GetState().GetIsHandshakeResumed(), - }, - commonAuthInfo: credentials.CommonAuthInfo{SecurityLevel: credentials.PrivacyAndIntegrity}, - }, nil -} - -// AuthType returns the authentication type. -func (s *S2AAuthInfo) AuthType() string { - return s2aAuthType -} - -// ApplicationProtocol returns the application protocol, e.g. "grpc". -func (s *S2AAuthInfo) ApplicationProtocol() string { - return s.s2aContext.GetApplicationProtocol() -} - -// TLSVersion returns the TLS version negotiated during the handshake. -func (s *S2AAuthInfo) TLSVersion() commonpb.TLSVersion { - return s.s2aContext.GetTlsVersion() -} - -// Ciphersuite returns the ciphersuite negotiated during the handshake. -func (s *S2AAuthInfo) Ciphersuite() commonpb.Ciphersuite { - return s.s2aContext.GetCiphersuite() -} - -// PeerIdentity returns the authenticated identity of the peer. -func (s *S2AAuthInfo) PeerIdentity() *commonpb.Identity { - return s.s2aContext.GetPeerIdentity() -} - -// LocalIdentity returns the local identity of the application used during -// session setup. -func (s *S2AAuthInfo) LocalIdentity() *commonpb.Identity { - return s.s2aContext.GetLocalIdentity() -} - -// PeerCertFingerprint returns the SHA256 hash of the peer certificate used in -// the S2A handshake. -func (s *S2AAuthInfo) PeerCertFingerprint() []byte { - return s.s2aContext.GetPeerCertFingerprint() -} - -// LocalCertFingerprint returns the SHA256 hash of the local certificate used -// in the S2A handshake. -func (s *S2AAuthInfo) LocalCertFingerprint() []byte { - return s.s2aContext.GetLocalCertFingerprint() -} - -// IsHandshakeResumed returns true if a cached session was used to resume -// the handshake. -func (s *S2AAuthInfo) IsHandshakeResumed() bool { - return s.s2aContext.GetIsHandshakeResumed() -} - -// SecurityLevel returns the security level of the connection. -func (s *S2AAuthInfo) SecurityLevel() credentials.SecurityLevel { - return s.commonAuthInfo.SecurityLevel -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/handshaker/handshaker.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/handshaker/handshaker.go deleted file mode 100644 index 8297c9a9746f..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/handshaker/handshaker.go +++ /dev/null @@ -1,438 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Package handshaker communicates with the S2A handshaker service. -package handshaker - -import ( - "context" - "errors" - "fmt" - "io" - "net" - "sync" - - "github.com/google/s2a-go/internal/authinfo" - commonpb "github.com/google/s2a-go/internal/proto/common_go_proto" - s2apb "github.com/google/s2a-go/internal/proto/s2a_go_proto" - "github.com/google/s2a-go/internal/record" - "github.com/google/s2a-go/internal/tokenmanager" - grpc "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/grpclog" -) - -var ( - // appProtocol contains the application protocol accepted by the handshaker. - appProtocol = "grpc" - // frameLimit is the maximum size of a frame in bytes. - frameLimit = 1024 * 64 - // peerNotRespondingError is the error thrown when the peer doesn't respond. - errPeerNotResponding = errors.New("peer is not responding and re-connection should be attempted") -) - -// Handshaker defines a handshaker interface. -type Handshaker interface { - // ClientHandshake starts and completes a TLS handshake from the client side, - // and returns a secure connection along with additional auth information. - ClientHandshake(ctx context.Context) (net.Conn, credentials.AuthInfo, error) - // ServerHandshake starts and completes a TLS handshake from the server side, - // and returns a secure connection along with additional auth information. - ServerHandshake(ctx context.Context) (net.Conn, credentials.AuthInfo, error) - // Close terminates the Handshaker. It should be called when the handshake - // is complete. - Close() error -} - -// ClientHandshakerOptions contains the options needed to configure the S2A -// handshaker service on the client-side. -type ClientHandshakerOptions struct { - // MinTLSVersion specifies the min TLS version supported by the client. - MinTLSVersion commonpb.TLSVersion - // MaxTLSVersion specifies the max TLS version supported by the client. - MaxTLSVersion commonpb.TLSVersion - // TLSCiphersuites is the ordered list of ciphersuites supported by the - // client. - TLSCiphersuites []commonpb.Ciphersuite - // TargetIdentities contains a list of allowed server identities. One of the - // target identities should match the peer identity in the handshake - // result; otherwise, the handshake fails. - TargetIdentities []*commonpb.Identity - // LocalIdentity is the local identity of the client application. If none is - // provided, then the S2A will choose the default identity. - LocalIdentity *commonpb.Identity - // TargetName is the allowed server name, which may be used for server - // authorization check by the S2A if it is provided. - TargetName string - // EnsureProcessSessionTickets allows users to wait and ensure that all - // available session tickets are sent to S2A before a process completes. - EnsureProcessSessionTickets *sync.WaitGroup -} - -// ServerHandshakerOptions contains the options needed to configure the S2A -// handshaker service on the server-side. -type ServerHandshakerOptions struct { - // MinTLSVersion specifies the min TLS version supported by the server. - MinTLSVersion commonpb.TLSVersion - // MaxTLSVersion specifies the max TLS version supported by the server. - MaxTLSVersion commonpb.TLSVersion - // TLSCiphersuites is the ordered list of ciphersuites supported by the - // server. - TLSCiphersuites []commonpb.Ciphersuite - // LocalIdentities is the list of local identities that may be assumed by - // the server. If no local identity is specified, then the S2A chooses a - // default local identity. - LocalIdentities []*commonpb.Identity -} - -// s2aHandshaker performs a TLS handshake using the S2A handshaker service. -type s2aHandshaker struct { - // stream is used to communicate with the S2A handshaker service. - stream s2apb.S2AService_SetUpSessionClient - // conn is the connection to the peer. - conn net.Conn - // clientOpts should be non-nil iff the handshaker is client-side. - clientOpts *ClientHandshakerOptions - // serverOpts should be non-nil iff the handshaker is server-side. - serverOpts *ServerHandshakerOptions - // isClient determines if the handshaker is client or server side. - isClient bool - // hsAddr stores the address of the S2A handshaker service. - hsAddr string - // tokenManager manages access tokens for authenticating to S2A. - tokenManager tokenmanager.AccessTokenManager - // localIdentities is the set of local identities for whom the - // tokenManager should fetch a token when preparing a request to be - // sent to S2A. - localIdentities []*commonpb.Identity -} - -// NewClientHandshaker creates an s2aHandshaker instance that performs a -// client-side TLS handshake using the S2A handshaker service. -func NewClientHandshaker(ctx context.Context, conn *grpc.ClientConn, c net.Conn, hsAddr string, opts *ClientHandshakerOptions) (Handshaker, error) { - stream, err := s2apb.NewS2AServiceClient(conn).SetUpSession(ctx, grpc.WaitForReady(true)) - if err != nil { - return nil, err - } - tokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager() - if err != nil { - grpclog.Infof("failed to create single token access token manager: %v", err) - } - return newClientHandshaker(stream, c, hsAddr, opts, tokenManager), nil -} - -func newClientHandshaker(stream s2apb.S2AService_SetUpSessionClient, c net.Conn, hsAddr string, opts *ClientHandshakerOptions, tokenManager tokenmanager.AccessTokenManager) *s2aHandshaker { - var localIdentities []*commonpb.Identity - if opts != nil { - localIdentities = []*commonpb.Identity{opts.LocalIdentity} - } - return &s2aHandshaker{ - stream: stream, - conn: c, - clientOpts: opts, - isClient: true, - hsAddr: hsAddr, - tokenManager: tokenManager, - localIdentities: localIdentities, - } -} - -// NewServerHandshaker creates an s2aHandshaker instance that performs a -// server-side TLS handshake using the S2A handshaker service. -func NewServerHandshaker(ctx context.Context, conn *grpc.ClientConn, c net.Conn, hsAddr string, opts *ServerHandshakerOptions) (Handshaker, error) { - stream, err := s2apb.NewS2AServiceClient(conn).SetUpSession(ctx, grpc.WaitForReady(true)) - if err != nil { - return nil, err - } - tokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager() - if err != nil { - grpclog.Infof("failed to create single token access token manager: %v", err) - } - return newServerHandshaker(stream, c, hsAddr, opts, tokenManager), nil -} - -func newServerHandshaker(stream s2apb.S2AService_SetUpSessionClient, c net.Conn, hsAddr string, opts *ServerHandshakerOptions, tokenManager tokenmanager.AccessTokenManager) *s2aHandshaker { - var localIdentities []*commonpb.Identity - if opts != nil { - localIdentities = opts.LocalIdentities - } - return &s2aHandshaker{ - stream: stream, - conn: c, - serverOpts: opts, - isClient: false, - hsAddr: hsAddr, - tokenManager: tokenManager, - localIdentities: localIdentities, - } -} - -// ClientHandshake performs a client-side TLS handshake using the S2A handshaker -// service. When complete, returns a TLS connection. -func (h *s2aHandshaker) ClientHandshake(_ context.Context) (net.Conn, credentials.AuthInfo, error) { - if !h.isClient { - return nil, nil, errors.New("only handshakers created using NewClientHandshaker can perform a client-side handshake") - } - // Extract the hostname from the target name. The target name is assumed to be an authority. - hostname, _, err := net.SplitHostPort(h.clientOpts.TargetName) - if err != nil { - // If the target name had no host port or could not be parsed, use it as is. - hostname = h.clientOpts.TargetName - } - - // Prepare a client start message to send to the S2A handshaker service. - req := &s2apb.SessionReq{ - ReqOneof: &s2apb.SessionReq_ClientStart{ - ClientStart: &s2apb.ClientSessionStartReq{ - ApplicationProtocols: []string{appProtocol}, - MinTlsVersion: h.clientOpts.MinTLSVersion, - MaxTlsVersion: h.clientOpts.MaxTLSVersion, - TlsCiphersuites: h.clientOpts.TLSCiphersuites, - TargetIdentities: h.clientOpts.TargetIdentities, - LocalIdentity: h.clientOpts.LocalIdentity, - TargetName: hostname, - }, - }, - AuthMechanisms: h.getAuthMechanisms(), - } - conn, result, err := h.setUpSession(req) - if err != nil { - return nil, nil, err - } - authInfo, err := authinfo.NewS2AAuthInfo(result) - if err != nil { - return nil, nil, err - } - return conn, authInfo, nil -} - -// ServerHandshake performs a server-side TLS handshake using the S2A handshaker -// service. When complete, returns a TLS connection. -func (h *s2aHandshaker) ServerHandshake(_ context.Context) (net.Conn, credentials.AuthInfo, error) { - if h.isClient { - return nil, nil, errors.New("only handshakers created using NewServerHandshaker can perform a server-side handshake") - } - p := make([]byte, frameLimit) - n, err := h.conn.Read(p) - if err != nil { - return nil, nil, err - } - // Prepare a server start message to send to the S2A handshaker service. - req := &s2apb.SessionReq{ - ReqOneof: &s2apb.SessionReq_ServerStart{ - ServerStart: &s2apb.ServerSessionStartReq{ - ApplicationProtocols: []string{appProtocol}, - MinTlsVersion: h.serverOpts.MinTLSVersion, - MaxTlsVersion: h.serverOpts.MaxTLSVersion, - TlsCiphersuites: h.serverOpts.TLSCiphersuites, - LocalIdentities: h.serverOpts.LocalIdentities, - InBytes: p[:n], - }, - }, - AuthMechanisms: h.getAuthMechanisms(), - } - conn, result, err := h.setUpSession(req) - if err != nil { - return nil, nil, err - } - authInfo, err := authinfo.NewS2AAuthInfo(result) - if err != nil { - return nil, nil, err - } - return conn, authInfo, nil -} - -// setUpSession proxies messages between the peer and the S2A handshaker -// service. -func (h *s2aHandshaker) setUpSession(req *s2apb.SessionReq) (net.Conn, *s2apb.SessionResult, error) { - resp, err := h.accessHandshakerService(req) - if err != nil { - return nil, nil, err - } - // Check if the returned status is an error. - if resp.GetStatus() != nil { - if got, want := resp.GetStatus().Code, uint32(codes.OK); got != want { - return nil, nil, fmt.Errorf("%v", resp.GetStatus().Details) - } - } - // Calculate the extra unread bytes from the Session. Attempting to consume - // more than the bytes sent will throw an error. - var extra []byte - if req.GetServerStart() != nil { - if resp.GetBytesConsumed() > uint32(len(req.GetServerStart().GetInBytes())) { - return nil, nil, errors.New("handshaker service consumed bytes value is out-of-bounds") - } - extra = req.GetServerStart().GetInBytes()[resp.GetBytesConsumed():] - } - result, extra, err := h.processUntilDone(resp, extra) - if err != nil { - return nil, nil, err - } - if result.GetLocalIdentity() == nil { - return nil, nil, errors.New("local identity must be populated in session result") - } - - // Create a new TLS record protocol using the Session Result. - newConn, err := record.NewConn(&record.ConnParameters{ - NetConn: h.conn, - Ciphersuite: result.GetState().GetTlsCiphersuite(), - TLSVersion: result.GetState().GetTlsVersion(), - InTrafficSecret: result.GetState().GetInKey(), - OutTrafficSecret: result.GetState().GetOutKey(), - UnusedBuf: extra, - InSequence: result.GetState().GetInSequence(), - OutSequence: result.GetState().GetOutSequence(), - HSAddr: h.hsAddr, - ConnectionID: result.GetState().GetConnectionId(), - LocalIdentity: result.GetLocalIdentity(), - EnsureProcessSessionTickets: h.ensureProcessSessionTickets(), - }) - if err != nil { - return nil, nil, err - } - return newConn, result, nil -} - -func (h *s2aHandshaker) ensureProcessSessionTickets() *sync.WaitGroup { - if h.clientOpts == nil { - return nil - } - return h.clientOpts.EnsureProcessSessionTickets -} - -// accessHandshakerService sends the session request to the S2A handshaker -// service and returns the session response. -func (h *s2aHandshaker) accessHandshakerService(req *s2apb.SessionReq) (*s2apb.SessionResp, error) { - if err := h.stream.Send(req); err != nil { - return nil, err - } - resp, err := h.stream.Recv() - if err != nil { - return nil, err - } - return resp, nil -} - -// processUntilDone continues proxying messages between the peer and the S2A -// handshaker service until the handshaker service returns the SessionResult at -// the end of the handshake or an error occurs. -func (h *s2aHandshaker) processUntilDone(resp *s2apb.SessionResp, unusedBytes []byte) (*s2apb.SessionResult, []byte, error) { - for { - if len(resp.OutFrames) > 0 { - if _, err := h.conn.Write(resp.OutFrames); err != nil { - return nil, nil, err - } - } - if resp.Result != nil { - return resp.Result, unusedBytes, nil - } - buf := make([]byte, frameLimit) - n, err := h.conn.Read(buf) - if err != nil && err != io.EOF { - return nil, nil, err - } - // If there is nothing to send to the handshaker service and nothing is - // received from the peer, then we are stuck. This covers the case when - // the peer is not responding. Note that handshaker service connection - // issues are caught in accessHandshakerService before we even get - // here. - if len(resp.OutFrames) == 0 && n == 0 { - return nil, nil, errPeerNotResponding - } - // Append extra bytes from the previous interaction with the handshaker - // service with the current buffer read from conn. - p := append(unusedBytes, buf[:n]...) - // From here on, p and unusedBytes point to the same slice. - resp, err = h.accessHandshakerService(&s2apb.SessionReq{ - ReqOneof: &s2apb.SessionReq_Next{ - Next: &s2apb.SessionNextReq{ - InBytes: p, - }, - }, - AuthMechanisms: h.getAuthMechanisms(), - }) - if err != nil { - return nil, nil, err - } - - // Cache the local identity returned by S2A, if it is populated. This - // overwrites any existing local identities. This is done because, once the - // S2A has selected a local identity, then only that local identity should - // be asserted in future requests until the end of the current handshake. - if resp.GetLocalIdentity() != nil { - h.localIdentities = []*commonpb.Identity{resp.GetLocalIdentity()} - } - - // Set unusedBytes based on the handshaker service response. - if resp.GetBytesConsumed() > uint32(len(p)) { - return nil, nil, errors.New("handshaker service consumed bytes value is out-of-bounds") - } - unusedBytes = p[resp.GetBytesConsumed():] - } -} - -// Close shuts down the handshaker and the stream to the S2A handshaker service -// when the handshake is complete. It should be called when the caller obtains -// the secure connection at the end of the handshake. -func (h *s2aHandshaker) Close() error { - return h.stream.CloseSend() -} - -func (h *s2aHandshaker) getAuthMechanisms() []*s2apb.AuthenticationMechanism { - if h.tokenManager == nil { - return nil - } - // First handle the special case when no local identities have been provided - // by the application. In this case, an AuthenticationMechanism with no local - // identity will be sent. - if len(h.localIdentities) == 0 { - token, err := h.tokenManager.DefaultToken() - if err != nil { - grpclog.Infof("unable to get token for empty local identity: %v", err) - return nil - } - return []*s2apb.AuthenticationMechanism{ - { - MechanismOneof: &s2apb.AuthenticationMechanism_Token{ - Token: token, - }, - }, - } - } - - // Next, handle the case where the application (or the S2A) has provided - // one or more local identities. - var authMechanisms []*s2apb.AuthenticationMechanism - for _, localIdentity := range h.localIdentities { - token, err := h.tokenManager.Token(localIdentity) - if err != nil { - grpclog.Infof("unable to get token for local identity %v: %v", localIdentity, err) - continue - } - - authMechanism := &s2apb.AuthenticationMechanism{ - Identity: localIdentity, - MechanismOneof: &s2apb.AuthenticationMechanism_Token{ - Token: token, - }, - } - authMechanisms = append(authMechanisms, authMechanism) - } - return authMechanisms -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/handshaker/service/service.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/handshaker/service/service.go deleted file mode 100644 index ed449653702e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/handshaker/service/service.go +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Package service is a utility for calling the S2A handshaker service. -package service - -import ( - "context" - "sync" - - grpc "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" -) - -var ( - // mu guards hsConnMap and hsDialer. - mu sync.Mutex - // hsConnMap represents a mapping from an S2A handshaker service address - // to a corresponding connection to an S2A handshaker service instance. - hsConnMap = make(map[string]*grpc.ClientConn) - // hsDialer will be reassigned in tests. - hsDialer = grpc.DialContext -) - -// Dial dials the S2A handshaker service. If a connection has already been -// established, this function returns it. Otherwise, a new connection is -// created. -func Dial(ctx context.Context, handshakerServiceAddress string, transportCreds credentials.TransportCredentials) (*grpc.ClientConn, error) { - mu.Lock() - defer mu.Unlock() - - hsConn, ok := hsConnMap[handshakerServiceAddress] - if !ok { - // Create a new connection to the S2A handshaker service. Note that - // this connection stays open until the application is closed. - var grpcOpts []grpc.DialOption - if transportCreds != nil { - grpcOpts = append(grpcOpts, grpc.WithTransportCredentials(transportCreds)) - } else { - grpcOpts = append(grpcOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) - } - var err error - hsConn, err = hsDialer(ctx, handshakerServiceAddress, grpcOpts...) - if err != nil { - return nil, err - } - hsConnMap[handshakerServiceAddress] = hsConn - } - return hsConn, nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go deleted file mode 100644 index 16278a1d995e..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/common_go_proto/common.pb.go +++ /dev/null @@ -1,389 +0,0 @@ -// Copyright 2021 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. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: internal/proto/common/common.proto - -package common_go_proto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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 ciphersuites supported by S2A. The name determines the confidentiality, -// and authentication ciphers as well as the hash algorithm used for PRF in -// TLS 1.2 or HKDF in TLS 1.3. Thus, the components of the name are: -// - AEAD -- for encryption and authentication, e.g., AES_128_GCM. -// - Hash algorithm -- used in PRF or HKDF, e.g., SHA256. -type Ciphersuite int32 - -const ( - Ciphersuite_AES_128_GCM_SHA256 Ciphersuite = 0 - Ciphersuite_AES_256_GCM_SHA384 Ciphersuite = 1 - Ciphersuite_CHACHA20_POLY1305_SHA256 Ciphersuite = 2 -) - -// Enum value maps for Ciphersuite. -var ( - Ciphersuite_name = map[int32]string{ - 0: "AES_128_GCM_SHA256", - 1: "AES_256_GCM_SHA384", - 2: "CHACHA20_POLY1305_SHA256", - } - Ciphersuite_value = map[string]int32{ - "AES_128_GCM_SHA256": 0, - "AES_256_GCM_SHA384": 1, - "CHACHA20_POLY1305_SHA256": 2, - } -) - -func (x Ciphersuite) Enum() *Ciphersuite { - p := new(Ciphersuite) - *p = x - return p -} - -func (x Ciphersuite) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Ciphersuite) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_common_common_proto_enumTypes[0].Descriptor() -} - -func (Ciphersuite) Type() protoreflect.EnumType { - return &file_internal_proto_common_common_proto_enumTypes[0] -} - -func (x Ciphersuite) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Ciphersuite.Descriptor instead. -func (Ciphersuite) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_common_common_proto_rawDescGZIP(), []int{0} -} - -// The TLS versions supported by S2A's handshaker module. -type TLSVersion int32 - -const ( - TLSVersion_TLS1_2 TLSVersion = 0 - TLSVersion_TLS1_3 TLSVersion = 1 -) - -// Enum value maps for TLSVersion. -var ( - TLSVersion_name = map[int32]string{ - 0: "TLS1_2", - 1: "TLS1_3", - } - TLSVersion_value = map[string]int32{ - "TLS1_2": 0, - "TLS1_3": 1, - } -) - -func (x TLSVersion) Enum() *TLSVersion { - p := new(TLSVersion) - *p = x - return p -} - -func (x TLSVersion) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TLSVersion) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_common_common_proto_enumTypes[1].Descriptor() -} - -func (TLSVersion) Type() protoreflect.EnumType { - return &file_internal_proto_common_common_proto_enumTypes[1] -} - -func (x TLSVersion) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TLSVersion.Descriptor instead. -func (TLSVersion) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_common_common_proto_rawDescGZIP(), []int{1} -} - -type Identity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to IdentityOneof: - // - // *Identity_SpiffeId - // *Identity_Hostname - // *Identity_Uid - // *Identity_MdbUsername - // *Identity_GaiaId - IdentityOneof isIdentity_IdentityOneof `protobuf_oneof:"identity_oneof"` - // Additional identity-specific attributes. - Attributes map[string]string `protobuf:"bytes,3,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *Identity) Reset() { - *x = Identity{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_common_common_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Identity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Identity) ProtoMessage() {} - -func (x *Identity) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_common_common_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Identity.ProtoReflect.Descriptor instead. -func (*Identity) Descriptor() ([]byte, []int) { - return file_internal_proto_common_common_proto_rawDescGZIP(), []int{0} -} - -func (m *Identity) GetIdentityOneof() isIdentity_IdentityOneof { - if m != nil { - return m.IdentityOneof - } - return nil -} - -func (x *Identity) GetSpiffeId() string { - if x, ok := x.GetIdentityOneof().(*Identity_SpiffeId); ok { - return x.SpiffeId - } - return "" -} - -func (x *Identity) GetHostname() string { - if x, ok := x.GetIdentityOneof().(*Identity_Hostname); ok { - return x.Hostname - } - return "" -} - -func (x *Identity) GetUid() string { - if x, ok := x.GetIdentityOneof().(*Identity_Uid); ok { - return x.Uid - } - return "" -} - -func (x *Identity) GetMdbUsername() string { - if x, ok := x.GetIdentityOneof().(*Identity_MdbUsername); ok { - return x.MdbUsername - } - return "" -} - -func (x *Identity) GetGaiaId() string { - if x, ok := x.GetIdentityOneof().(*Identity_GaiaId); ok { - return x.GaiaId - } - return "" -} - -func (x *Identity) GetAttributes() map[string]string { - if x != nil { - return x.Attributes - } - return nil -} - -type isIdentity_IdentityOneof interface { - isIdentity_IdentityOneof() -} - -type Identity_SpiffeId struct { - // The SPIFFE ID of a connection endpoint. - SpiffeId string `protobuf:"bytes,1,opt,name=spiffe_id,json=spiffeId,proto3,oneof"` -} - -type Identity_Hostname struct { - // The hostname of a connection endpoint. - Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3,oneof"` -} - -type Identity_Uid struct { - // The UID of a connection endpoint. - Uid string `protobuf:"bytes,4,opt,name=uid,proto3,oneof"` -} - -type Identity_MdbUsername struct { - // The MDB username of a connection endpoint. - MdbUsername string `protobuf:"bytes,5,opt,name=mdb_username,json=mdbUsername,proto3,oneof"` -} - -type Identity_GaiaId struct { - // The Gaia ID of a connection endpoint. - GaiaId string `protobuf:"bytes,6,opt,name=gaia_id,json=gaiaId,proto3,oneof"` -} - -func (*Identity_SpiffeId) isIdentity_IdentityOneof() {} - -func (*Identity_Hostname) isIdentity_IdentityOneof() {} - -func (*Identity_Uid) isIdentity_IdentityOneof() {} - -func (*Identity_MdbUsername) isIdentity_IdentityOneof() {} - -func (*Identity_GaiaId) isIdentity_IdentityOneof() {} - -var File_internal_proto_common_common_proto protoreflect.FileDescriptor - -var file_internal_proto_common_common_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xb1, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x09, - 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x08, 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x68, - 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x03, 0x75, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x23, 0x0a, - 0x0c, 0x6d, 0x64, 0x62, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x64, 0x62, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x07, 0x67, 0x61, 0x69, 0x61, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x67, 0x61, 0x69, 0x61, 0x49, 0x64, 0x12, 0x43, 0x0a, - 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 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, 0x42, 0x10, 0x0a, 0x0e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x6f, 0x6e, - 0x65, 0x6f, 0x66, 0x2a, 0x5b, 0x0a, 0x0b, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, - 0x74, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, - 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x45, - 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, - 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, - 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x02, - 0x2a, 0x24, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, - 0x0a, 0x06, 0x54, 0x4c, 0x53, 0x31, 0x5f, 0x32, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x4c, - 0x53, 0x31, 0x5f, 0x33, 0x10, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_internal_proto_common_common_proto_rawDescOnce sync.Once - file_internal_proto_common_common_proto_rawDescData = file_internal_proto_common_common_proto_rawDesc -) - -func file_internal_proto_common_common_proto_rawDescGZIP() []byte { - file_internal_proto_common_common_proto_rawDescOnce.Do(func() { - file_internal_proto_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_common_common_proto_rawDescData) - }) - return file_internal_proto_common_common_proto_rawDescData -} - -var file_internal_proto_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_internal_proto_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_internal_proto_common_common_proto_goTypes = []interface{}{ - (Ciphersuite)(0), // 0: s2a.proto.Ciphersuite - (TLSVersion)(0), // 1: s2a.proto.TLSVersion - (*Identity)(nil), // 2: s2a.proto.Identity - nil, // 3: s2a.proto.Identity.AttributesEntry -} -var file_internal_proto_common_common_proto_depIdxs = []int32{ - 3, // 0: s2a.proto.Identity.attributes:type_name -> s2a.proto.Identity.AttributesEntry - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_internal_proto_common_common_proto_init() } -func file_internal_proto_common_common_proto_init() { - if File_internal_proto_common_common_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_internal_proto_common_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Identity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_internal_proto_common_common_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Identity_SpiffeId)(nil), - (*Identity_Hostname)(nil), - (*Identity_Uid)(nil), - (*Identity_MdbUsername)(nil), - (*Identity_GaiaId)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_proto_common_common_proto_rawDesc, - NumEnums: 2, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_internal_proto_common_common_proto_goTypes, - DependencyIndexes: file_internal_proto_common_common_proto_depIdxs, - EnumInfos: file_internal_proto_common_common_proto_enumTypes, - MessageInfos: file_internal_proto_common_common_proto_msgTypes, - }.Build() - File_internal_proto_common_common_proto = out.File - file_internal_proto_common_common_proto_rawDesc = nil - file_internal_proto_common_common_proto_goTypes = nil - file_internal_proto_common_common_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go deleted file mode 100644 index f4f763ae1020..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_context_go_proto/s2a_context.pb.go +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2021 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. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: internal/proto/s2a_context/s2a_context.proto - -package s2a_context_go_proto - -import ( - common_go_proto "github.com/google/s2a-go/internal/proto/common_go_proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type S2AContext struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The application protocol negotiated for this connection, e.g., 'grpc'. - ApplicationProtocol string `protobuf:"bytes,1,opt,name=application_protocol,json=applicationProtocol,proto3" json:"application_protocol,omitempty"` - // The TLS version number that the S2A's handshaker module used to set up the - // session. - TlsVersion common_go_proto.TLSVersion `protobuf:"varint,2,opt,name=tls_version,json=tlsVersion,proto3,enum=s2a.proto.TLSVersion" json:"tls_version,omitempty"` - // The TLS ciphersuite negotiated by the S2A's handshaker module. - Ciphersuite common_go_proto.Ciphersuite `protobuf:"varint,3,opt,name=ciphersuite,proto3,enum=s2a.proto.Ciphersuite" json:"ciphersuite,omitempty"` - // The authenticated identity of the peer. - PeerIdentity *common_go_proto.Identity `protobuf:"bytes,4,opt,name=peer_identity,json=peerIdentity,proto3" json:"peer_identity,omitempty"` - // The local identity used during session setup. This could be: - // - The local identity that the client specifies in ClientSessionStartReq. - // - One of the local identities that the server specifies in - // ServerSessionStartReq. - // - If neither client or server specifies local identities, the S2A picks the - // default one. In this case, this field will contain that identity. - LocalIdentity *common_go_proto.Identity `protobuf:"bytes,5,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"` - // The SHA256 hash of the peer certificate used in the handshake. - PeerCertFingerprint []byte `protobuf:"bytes,6,opt,name=peer_cert_fingerprint,json=peerCertFingerprint,proto3" json:"peer_cert_fingerprint,omitempty"` - // The SHA256 hash of the local certificate used in the handshake. - LocalCertFingerprint []byte `protobuf:"bytes,7,opt,name=local_cert_fingerprint,json=localCertFingerprint,proto3" json:"local_cert_fingerprint,omitempty"` - // Set to true if a cached session was reused to resume the handshake. - IsHandshakeResumed bool `protobuf:"varint,8,opt,name=is_handshake_resumed,json=isHandshakeResumed,proto3" json:"is_handshake_resumed,omitempty"` -} - -func (x *S2AContext) Reset() { - *x = S2AContext{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_context_s2a_context_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *S2AContext) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*S2AContext) ProtoMessage() {} - -func (x *S2AContext) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_context_s2a_context_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use S2AContext.ProtoReflect.Descriptor instead. -func (*S2AContext) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_context_s2a_context_proto_rawDescGZIP(), []int{0} -} - -func (x *S2AContext) GetApplicationProtocol() string { - if x != nil { - return x.ApplicationProtocol - } - return "" -} - -func (x *S2AContext) GetTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.TlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *S2AContext) GetCiphersuite() common_go_proto.Ciphersuite { - if x != nil { - return x.Ciphersuite - } - return common_go_proto.Ciphersuite(0) -} - -func (x *S2AContext) GetPeerIdentity() *common_go_proto.Identity { - if x != nil { - return x.PeerIdentity - } - return nil -} - -func (x *S2AContext) GetLocalIdentity() *common_go_proto.Identity { - if x != nil { - return x.LocalIdentity - } - return nil -} - -func (x *S2AContext) GetPeerCertFingerprint() []byte { - if x != nil { - return x.PeerCertFingerprint - } - return nil -} - -func (x *S2AContext) GetLocalCertFingerprint() []byte { - if x != nil { - return x.LocalCertFingerprint - } - return nil -} - -func (x *S2AContext) GetIsHandshakeResumed() bool { - if x != nil { - return x.IsHandshakeResumed - } - return false -} - -var File_internal_proto_s2a_context_s2a_context_proto protoreflect.FileDescriptor - -var file_internal_proto_s2a_context_s2a_context_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x73, 0x32, 0x61, - 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, - 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc3, 0x03, - 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x31, 0x0a, 0x14, - 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x61, 0x70, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, - 0x36, 0x0a, 0x0b, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x74, 0x6c, 0x73, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0b, 0x63, 0x69, 0x70, 0x68, 0x65, - 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x73, - 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, - 0x75, 0x69, 0x74, 0x65, 0x52, 0x0b, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, - 0x65, 0x12, 0x38, 0x0a, 0x0d, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x70, - 0x65, 0x65, 0x72, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, - 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x65, 0x65, 0x72, 0x5f, - 0x63, 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x70, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, - 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x6c, - 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, - 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x6c, 0x6f, 0x63, - 0x61, 0x6c, 0x43, 0x65, 0x72, 0x74, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, - 0x74, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x73, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, - 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x12, 0x69, 0x73, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x75, - 0x6d, 0x65, 0x64, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x32, 0x61, 0x5f, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_internal_proto_s2a_context_s2a_context_proto_rawDescOnce sync.Once - file_internal_proto_s2a_context_s2a_context_proto_rawDescData = file_internal_proto_s2a_context_s2a_context_proto_rawDesc -) - -func file_internal_proto_s2a_context_s2a_context_proto_rawDescGZIP() []byte { - file_internal_proto_s2a_context_s2a_context_proto_rawDescOnce.Do(func() { - file_internal_proto_s2a_context_s2a_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_s2a_context_s2a_context_proto_rawDescData) - }) - return file_internal_proto_s2a_context_s2a_context_proto_rawDescData -} - -var file_internal_proto_s2a_context_s2a_context_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_internal_proto_s2a_context_s2a_context_proto_goTypes = []interface{}{ - (*S2AContext)(nil), // 0: s2a.proto.S2AContext - (common_go_proto.TLSVersion)(0), // 1: s2a.proto.TLSVersion - (common_go_proto.Ciphersuite)(0), // 2: s2a.proto.Ciphersuite - (*common_go_proto.Identity)(nil), // 3: s2a.proto.Identity -} -var file_internal_proto_s2a_context_s2a_context_proto_depIdxs = []int32{ - 1, // 0: s2a.proto.S2AContext.tls_version:type_name -> s2a.proto.TLSVersion - 2, // 1: s2a.proto.S2AContext.ciphersuite:type_name -> s2a.proto.Ciphersuite - 3, // 2: s2a.proto.S2AContext.peer_identity:type_name -> s2a.proto.Identity - 3, // 3: s2a.proto.S2AContext.local_identity:type_name -> s2a.proto.Identity - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_internal_proto_s2a_context_s2a_context_proto_init() } -func file_internal_proto_s2a_context_s2a_context_proto_init() { - if File_internal_proto_s2a_context_s2a_context_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_internal_proto_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*S2AContext); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_proto_s2a_context_s2a_context_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_internal_proto_s2a_context_s2a_context_proto_goTypes, - DependencyIndexes: file_internal_proto_s2a_context_s2a_context_proto_depIdxs, - MessageInfos: file_internal_proto_s2a_context_s2a_context_proto_msgTypes, - }.Build() - File_internal_proto_s2a_context_s2a_context_proto = out.File - file_internal_proto_s2a_context_s2a_context_proto_rawDesc = nil - file_internal_proto_s2a_context_s2a_context_proto_goTypes = nil - file_internal_proto_s2a_context_s2a_context_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go deleted file mode 100644 index 0a86ebee5925..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a.pb.go +++ /dev/null @@ -1,1377 +0,0 @@ -// Copyright 2021 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. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: internal/proto/s2a/s2a.proto - -package s2a_go_proto - -import ( - common_go_proto "github.com/google/s2a-go/internal/proto/common_go_proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type AuthenticationMechanism struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // (Optional) Application may specify an identity associated to an - // authentication mechanism. Otherwise, S2A assumes that the authentication - // mechanism is associated with the default identity. If the default identity - // cannot be determined, session setup fails. - Identity *common_go_proto.Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - // Types that are assignable to MechanismOneof: - // - // *AuthenticationMechanism_Token - MechanismOneof isAuthenticationMechanism_MechanismOneof `protobuf_oneof:"mechanism_oneof"` -} - -func (x *AuthenticationMechanism) Reset() { - *x = AuthenticationMechanism{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthenticationMechanism) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthenticationMechanism) ProtoMessage() {} - -func (x *AuthenticationMechanism) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthenticationMechanism.ProtoReflect.Descriptor instead. -func (*AuthenticationMechanism) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{0} -} - -func (x *AuthenticationMechanism) GetIdentity() *common_go_proto.Identity { - if x != nil { - return x.Identity - } - return nil -} - -func (m *AuthenticationMechanism) GetMechanismOneof() isAuthenticationMechanism_MechanismOneof { - if m != nil { - return m.MechanismOneof - } - return nil -} - -func (x *AuthenticationMechanism) GetToken() string { - if x, ok := x.GetMechanismOneof().(*AuthenticationMechanism_Token); ok { - return x.Token - } - return "" -} - -type isAuthenticationMechanism_MechanismOneof interface { - isAuthenticationMechanism_MechanismOneof() -} - -type AuthenticationMechanism_Token struct { - // A token that the application uses to authenticate itself to the S2A. - Token string `protobuf:"bytes,2,opt,name=token,proto3,oneof"` -} - -func (*AuthenticationMechanism_Token) isAuthenticationMechanism_MechanismOneof() {} - -type ClientSessionStartReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The application protocols supported by the client, e.g., "grpc". - ApplicationProtocols []string `protobuf:"bytes,1,rep,name=application_protocols,json=applicationProtocols,proto3" json:"application_protocols,omitempty"` - // (Optional) The minimum TLS version number that the S2A's handshaker module - // will use to set up the session. If this field is not provided, S2A will use - // the minimum version it supports. - MinTlsVersion common_go_proto.TLSVersion `protobuf:"varint,2,opt,name=min_tls_version,json=minTlsVersion,proto3,enum=s2a.proto.TLSVersion" json:"min_tls_version,omitempty"` - // (Optional) The maximum TLS version number that the S2A's handshaker module - // will use to set up the session. If this field is not provided, S2A will use - // the maximum version it supports. - MaxTlsVersion common_go_proto.TLSVersion `protobuf:"varint,3,opt,name=max_tls_version,json=maxTlsVersion,proto3,enum=s2a.proto.TLSVersion" json:"max_tls_version,omitempty"` - // The TLS ciphersuites that the client is willing to support. - TlsCiphersuites []common_go_proto.Ciphersuite `protobuf:"varint,4,rep,packed,name=tls_ciphersuites,json=tlsCiphersuites,proto3,enum=s2a.proto.Ciphersuite" json:"tls_ciphersuites,omitempty"` - // (Optional) Describes which server identities are acceptable by the client. - // If target identities are provided and none of them matches the peer - // identity of the server, session setup fails. - TargetIdentities []*common_go_proto.Identity `protobuf:"bytes,5,rep,name=target_identities,json=targetIdentities,proto3" json:"target_identities,omitempty"` - // (Optional) Application may specify a local identity. Otherwise, S2A chooses - // the default local identity. If the default identity cannot be determined, - // session setup fails. - LocalIdentity *common_go_proto.Identity `protobuf:"bytes,6,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"` - // The target name that is used by S2A to configure SNI in the TLS handshake. - // It is also used to perform server authorization check if avaiable. This - // check is intended to verify that the peer authenticated identity is - // authorized to run a service with the target name. - // This field MUST only contain the host portion of the server address. It - // MUST not contain the scheme or the port number. For example, if the server - // address is dns://www.example.com:443, the value of this field should be - // set to www.example.com. - TargetName string `protobuf:"bytes,7,opt,name=target_name,json=targetName,proto3" json:"target_name,omitempty"` -} - -func (x *ClientSessionStartReq) Reset() { - *x = ClientSessionStartReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientSessionStartReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientSessionStartReq) ProtoMessage() {} - -func (x *ClientSessionStartReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientSessionStartReq.ProtoReflect.Descriptor instead. -func (*ClientSessionStartReq) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{1} -} - -func (x *ClientSessionStartReq) GetApplicationProtocols() []string { - if x != nil { - return x.ApplicationProtocols - } - return nil -} - -func (x *ClientSessionStartReq) GetMinTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.MinTlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *ClientSessionStartReq) GetMaxTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.MaxTlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *ClientSessionStartReq) GetTlsCiphersuites() []common_go_proto.Ciphersuite { - if x != nil { - return x.TlsCiphersuites - } - return nil -} - -func (x *ClientSessionStartReq) GetTargetIdentities() []*common_go_proto.Identity { - if x != nil { - return x.TargetIdentities - } - return nil -} - -func (x *ClientSessionStartReq) GetLocalIdentity() *common_go_proto.Identity { - if x != nil { - return x.LocalIdentity - } - return nil -} - -func (x *ClientSessionStartReq) GetTargetName() string { - if x != nil { - return x.TargetName - } - return "" -} - -type ServerSessionStartReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The application protocols supported by the server, e.g., "grpc". - ApplicationProtocols []string `protobuf:"bytes,1,rep,name=application_protocols,json=applicationProtocols,proto3" json:"application_protocols,omitempty"` - // (Optional) The minimum TLS version number that the S2A's handshaker module - // will use to set up the session. If this field is not provided, S2A will use - // the minimum version it supports. - MinTlsVersion common_go_proto.TLSVersion `protobuf:"varint,2,opt,name=min_tls_version,json=minTlsVersion,proto3,enum=s2a.proto.TLSVersion" json:"min_tls_version,omitempty"` - // (Optional) The maximum TLS version number that the S2A's handshaker module - // will use to set up the session. If this field is not provided, S2A will use - // the maximum version it supports. - MaxTlsVersion common_go_proto.TLSVersion `protobuf:"varint,3,opt,name=max_tls_version,json=maxTlsVersion,proto3,enum=s2a.proto.TLSVersion" json:"max_tls_version,omitempty"` - // The TLS ciphersuites that the server is willing to support. - TlsCiphersuites []common_go_proto.Ciphersuite `protobuf:"varint,4,rep,packed,name=tls_ciphersuites,json=tlsCiphersuites,proto3,enum=s2a.proto.Ciphersuite" json:"tls_ciphersuites,omitempty"` - // (Optional) A list of local identities supported by the server, if - // specified. Otherwise, S2A chooses the default local identity. If the - // default identity cannot be determined, session setup fails. - LocalIdentities []*common_go_proto.Identity `protobuf:"bytes,5,rep,name=local_identities,json=localIdentities,proto3" json:"local_identities,omitempty"` - // The byte representation of the first handshake message received from the - // client peer. It is possible that this first message is split into multiple - // chunks. In this case, the first chunk is sent using this field and the - // following chunks are sent using the in_bytes field of SessionNextReq - // Specifically, if the client peer is using S2A, this field contains the - // bytes in the out_frames field of SessionResp message that the client peer - // received from its S2A after initiating the handshake. - InBytes []byte `protobuf:"bytes,6,opt,name=in_bytes,json=inBytes,proto3" json:"in_bytes,omitempty"` -} - -func (x *ServerSessionStartReq) Reset() { - *x = ServerSessionStartReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerSessionStartReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerSessionStartReq) ProtoMessage() {} - -func (x *ServerSessionStartReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerSessionStartReq.ProtoReflect.Descriptor instead. -func (*ServerSessionStartReq) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{2} -} - -func (x *ServerSessionStartReq) GetApplicationProtocols() []string { - if x != nil { - return x.ApplicationProtocols - } - return nil -} - -func (x *ServerSessionStartReq) GetMinTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.MinTlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *ServerSessionStartReq) GetMaxTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.MaxTlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *ServerSessionStartReq) GetTlsCiphersuites() []common_go_proto.Ciphersuite { - if x != nil { - return x.TlsCiphersuites - } - return nil -} - -func (x *ServerSessionStartReq) GetLocalIdentities() []*common_go_proto.Identity { - if x != nil { - return x.LocalIdentities - } - return nil -} - -func (x *ServerSessionStartReq) GetInBytes() []byte { - if x != nil { - return x.InBytes - } - return nil -} - -type SessionNextReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The byte representation of session setup, i.e., handshake messages. - // Specifically: - // - All handshake messages sent from the server to the client. - // - All, except for the first, handshake messages sent from the client to - // the server. Note that the first message is communicated to S2A using the - // in_bytes field of ServerSessionStartReq. - // - // If the peer is using S2A, this field contains the bytes in the out_frames - // field of SessionResp message that the peer received from its S2A. - InBytes []byte `protobuf:"bytes,1,opt,name=in_bytes,json=inBytes,proto3" json:"in_bytes,omitempty"` -} - -func (x *SessionNextReq) Reset() { - *x = SessionNextReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionNextReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionNextReq) ProtoMessage() {} - -func (x *SessionNextReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionNextReq.ProtoReflect.Descriptor instead. -func (*SessionNextReq) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{3} -} - -func (x *SessionNextReq) GetInBytes() []byte { - if x != nil { - return x.InBytes - } - return nil -} - -type ResumptionTicketReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The byte representation of a NewSessionTicket message received from the - // server. - InBytes [][]byte `protobuf:"bytes,1,rep,name=in_bytes,json=inBytes,proto3" json:"in_bytes,omitempty"` - // A connection identifier that was created and sent by S2A at the end of a - // handshake. - ConnectionId uint64 `protobuf:"varint,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - // The local identity that was used by S2A during session setup and included - // in |SessionResult|. - LocalIdentity *common_go_proto.Identity `protobuf:"bytes,3,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"` -} - -func (x *ResumptionTicketReq) Reset() { - *x = ResumptionTicketReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResumptionTicketReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResumptionTicketReq) ProtoMessage() {} - -func (x *ResumptionTicketReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResumptionTicketReq.ProtoReflect.Descriptor instead. -func (*ResumptionTicketReq) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{4} -} - -func (x *ResumptionTicketReq) GetInBytes() [][]byte { - if x != nil { - return x.InBytes - } - return nil -} - -func (x *ResumptionTicketReq) GetConnectionId() uint64 { - if x != nil { - return x.ConnectionId - } - return 0 -} - -func (x *ResumptionTicketReq) GetLocalIdentity() *common_go_proto.Identity { - if x != nil { - return x.LocalIdentity - } - return nil -} - -type SessionReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to ReqOneof: - // - // *SessionReq_ClientStart - // *SessionReq_ServerStart - // *SessionReq_Next - // *SessionReq_ResumptionTicket - ReqOneof isSessionReq_ReqOneof `protobuf_oneof:"req_oneof"` - // (Optional) The authentication mechanisms that the client wishes to use to - // authenticate to the S2A, ordered by preference. The S2A will always use the - // first authentication mechanism that appears in the list and is supported by - // the S2A. - AuthMechanisms []*AuthenticationMechanism `protobuf:"bytes,5,rep,name=auth_mechanisms,json=authMechanisms,proto3" json:"auth_mechanisms,omitempty"` -} - -func (x *SessionReq) Reset() { - *x = SessionReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionReq) ProtoMessage() {} - -func (x *SessionReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionReq.ProtoReflect.Descriptor instead. -func (*SessionReq) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{5} -} - -func (m *SessionReq) GetReqOneof() isSessionReq_ReqOneof { - if m != nil { - return m.ReqOneof - } - return nil -} - -func (x *SessionReq) GetClientStart() *ClientSessionStartReq { - if x, ok := x.GetReqOneof().(*SessionReq_ClientStart); ok { - return x.ClientStart - } - return nil -} - -func (x *SessionReq) GetServerStart() *ServerSessionStartReq { - if x, ok := x.GetReqOneof().(*SessionReq_ServerStart); ok { - return x.ServerStart - } - return nil -} - -func (x *SessionReq) GetNext() *SessionNextReq { - if x, ok := x.GetReqOneof().(*SessionReq_Next); ok { - return x.Next - } - return nil -} - -func (x *SessionReq) GetResumptionTicket() *ResumptionTicketReq { - if x, ok := x.GetReqOneof().(*SessionReq_ResumptionTicket); ok { - return x.ResumptionTicket - } - return nil -} - -func (x *SessionReq) GetAuthMechanisms() []*AuthenticationMechanism { - if x != nil { - return x.AuthMechanisms - } - return nil -} - -type isSessionReq_ReqOneof interface { - isSessionReq_ReqOneof() -} - -type SessionReq_ClientStart struct { - // The client session setup request message. - ClientStart *ClientSessionStartReq `protobuf:"bytes,1,opt,name=client_start,json=clientStart,proto3,oneof"` -} - -type SessionReq_ServerStart struct { - // The server session setup request message. - ServerStart *ServerSessionStartReq `protobuf:"bytes,2,opt,name=server_start,json=serverStart,proto3,oneof"` -} - -type SessionReq_Next struct { - // The next session setup message request message. - Next *SessionNextReq `protobuf:"bytes,3,opt,name=next,proto3,oneof"` -} - -type SessionReq_ResumptionTicket struct { - // The resumption ticket that is received from the server. This message is - // only accepted by S2A if it is running as a client and if it is received - // after session setup is complete. If S2A is running as a server and it - // receives this message, the session is terminated. - ResumptionTicket *ResumptionTicketReq `protobuf:"bytes,4,opt,name=resumption_ticket,json=resumptionTicket,proto3,oneof"` -} - -func (*SessionReq_ClientStart) isSessionReq_ReqOneof() {} - -func (*SessionReq_ServerStart) isSessionReq_ReqOneof() {} - -func (*SessionReq_Next) isSessionReq_ReqOneof() {} - -func (*SessionReq_ResumptionTicket) isSessionReq_ReqOneof() {} - -type SessionState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The TLS version number that the S2A's handshaker module used to set up the - // session. - TlsVersion common_go_proto.TLSVersion `protobuf:"varint,1,opt,name=tls_version,json=tlsVersion,proto3,enum=s2a.proto.TLSVersion" json:"tls_version,omitempty"` - // The TLS ciphersuite negotiated by the S2A's handshaker module. - TlsCiphersuite common_go_proto.Ciphersuite `protobuf:"varint,2,opt,name=tls_ciphersuite,json=tlsCiphersuite,proto3,enum=s2a.proto.Ciphersuite" json:"tls_ciphersuite,omitempty"` - // The sequence number of the next, incoming, TLS record. - InSequence uint64 `protobuf:"varint,3,opt,name=in_sequence,json=inSequence,proto3" json:"in_sequence,omitempty"` - // The sequence number of the next, outgoing, TLS record. - OutSequence uint64 `protobuf:"varint,4,opt,name=out_sequence,json=outSequence,proto3" json:"out_sequence,omitempty"` - // The key for the inbound direction. - InKey []byte `protobuf:"bytes,5,opt,name=in_key,json=inKey,proto3" json:"in_key,omitempty"` - // The key for the outbound direction. - OutKey []byte `protobuf:"bytes,6,opt,name=out_key,json=outKey,proto3" json:"out_key,omitempty"` - // The constant part of the record nonce for the outbound direction. - InFixedNonce []byte `protobuf:"bytes,7,opt,name=in_fixed_nonce,json=inFixedNonce,proto3" json:"in_fixed_nonce,omitempty"` - // The constant part of the record nonce for the inbound direction. - OutFixedNonce []byte `protobuf:"bytes,8,opt,name=out_fixed_nonce,json=outFixedNonce,proto3" json:"out_fixed_nonce,omitempty"` - // A connection identifier that can be provided to S2A to perform operations - // related to this connection. This identifier will be stored by the record - // protocol, and included in the |ResumptionTicketReq| message that is later - // sent back to S2A. This field is set only for client-side connections. - ConnectionId uint64 `protobuf:"varint,9,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` - // Set to true if a cached session was reused to do an abbreviated handshake. - IsHandshakeResumed bool `protobuf:"varint,10,opt,name=is_handshake_resumed,json=isHandshakeResumed,proto3" json:"is_handshake_resumed,omitempty"` -} - -func (x *SessionState) Reset() { - *x = SessionState{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionState) ProtoMessage() {} - -func (x *SessionState) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionState.ProtoReflect.Descriptor instead. -func (*SessionState) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{6} -} - -func (x *SessionState) GetTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.TlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *SessionState) GetTlsCiphersuite() common_go_proto.Ciphersuite { - if x != nil { - return x.TlsCiphersuite - } - return common_go_proto.Ciphersuite(0) -} - -func (x *SessionState) GetInSequence() uint64 { - if x != nil { - return x.InSequence - } - return 0 -} - -func (x *SessionState) GetOutSequence() uint64 { - if x != nil { - return x.OutSequence - } - return 0 -} - -func (x *SessionState) GetInKey() []byte { - if x != nil { - return x.InKey - } - return nil -} - -func (x *SessionState) GetOutKey() []byte { - if x != nil { - return x.OutKey - } - return nil -} - -func (x *SessionState) GetInFixedNonce() []byte { - if x != nil { - return x.InFixedNonce - } - return nil -} - -func (x *SessionState) GetOutFixedNonce() []byte { - if x != nil { - return x.OutFixedNonce - } - return nil -} - -func (x *SessionState) GetConnectionId() uint64 { - if x != nil { - return x.ConnectionId - } - return 0 -} - -func (x *SessionState) GetIsHandshakeResumed() bool { - if x != nil { - return x.IsHandshakeResumed - } - return false -} - -type SessionResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The application protocol negotiated for this session. - ApplicationProtocol string `protobuf:"bytes,1,opt,name=application_protocol,json=applicationProtocol,proto3" json:"application_protocol,omitempty"` - // The session state at the end. This state contains all cryptographic - // material required to initialize the record protocol object. - State *SessionState `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` - // The authenticated identity of the peer. - PeerIdentity *common_go_proto.Identity `protobuf:"bytes,4,opt,name=peer_identity,json=peerIdentity,proto3" json:"peer_identity,omitempty"` - // The local identity used during session setup. This could be: - // - The local identity that the client specifies in ClientSessionStartReq. - // - One of the local identities that the server specifies in - // ServerSessionStartReq. - // - If neither client or server specifies local identities, the S2A picks the - // default one. In this case, this field will contain that identity. - LocalIdentity *common_go_proto.Identity `protobuf:"bytes,5,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"` - // The SHA256 hash of the local certificate used in the handshake. - LocalCertFingerprint []byte `protobuf:"bytes,6,opt,name=local_cert_fingerprint,json=localCertFingerprint,proto3" json:"local_cert_fingerprint,omitempty"` - // The SHA256 hash of the peer certificate used in the handshake. - PeerCertFingerprint []byte `protobuf:"bytes,7,opt,name=peer_cert_fingerprint,json=peerCertFingerprint,proto3" json:"peer_cert_fingerprint,omitempty"` -} - -func (x *SessionResult) Reset() { - *x = SessionResult{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionResult) ProtoMessage() {} - -func (x *SessionResult) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionResult.ProtoReflect.Descriptor instead. -func (*SessionResult) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{7} -} - -func (x *SessionResult) GetApplicationProtocol() string { - if x != nil { - return x.ApplicationProtocol - } - return "" -} - -func (x *SessionResult) GetState() *SessionState { - if x != nil { - return x.State - } - return nil -} - -func (x *SessionResult) GetPeerIdentity() *common_go_proto.Identity { - if x != nil { - return x.PeerIdentity - } - return nil -} - -func (x *SessionResult) GetLocalIdentity() *common_go_proto.Identity { - if x != nil { - return x.LocalIdentity - } - return nil -} - -func (x *SessionResult) GetLocalCertFingerprint() []byte { - if x != nil { - return x.LocalCertFingerprint - } - return nil -} - -func (x *SessionResult) GetPeerCertFingerprint() []byte { - if x != nil { - return x.PeerCertFingerprint - } - return nil -} - -type SessionStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The status code that is specific to the application and the implementation - // of S2A, e.g., gRPC status code. - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - // The status details. - Details string `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` -} - -func (x *SessionStatus) Reset() { - *x = SessionStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionStatus) ProtoMessage() {} - -func (x *SessionStatus) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionStatus.ProtoReflect.Descriptor instead. -func (*SessionStatus) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{8} -} - -func (x *SessionStatus) GetCode() uint32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *SessionStatus) GetDetails() string { - if x != nil { - return x.Details - } - return "" -} - -type SessionResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The local identity used during session setup. This could be: - // - The local identity that the client specifies in ClientSessionStartReq. - // - One of the local identities that the server specifies in - // ServerSessionStartReq. - // - If neither client or server specifies local identities, the S2A picks the - // default one. In this case, this field will contain that identity. - // - // If the SessionResult is populated, then this must coincide with the local - // identity specified in the SessionResult; otherwise, the handshake must - // fail. - LocalIdentity *common_go_proto.Identity `protobuf:"bytes,1,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"` - // The byte representation of the frames that should be sent to the peer. May - // be empty if nothing needs to be sent to the peer or if in_bytes in the - // SessionReq is incomplete. All bytes in a non-empty out_frames must be sent - // to the peer even if the session setup status is not OK as these frames may - // contain appropriate alerts. - OutFrames []byte `protobuf:"bytes,2,opt,name=out_frames,json=outFrames,proto3" json:"out_frames,omitempty"` - // Number of bytes in the in_bytes field that are consumed by S2A. It is - // possible that part of in_bytes is unrelated to the session setup process. - BytesConsumed uint32 `protobuf:"varint,3,opt,name=bytes_consumed,json=bytesConsumed,proto3" json:"bytes_consumed,omitempty"` - // This is set if the session is successfully set up. out_frames may - // still be set to frames that needs to be forwarded to the peer. - Result *SessionResult `protobuf:"bytes,4,opt,name=result,proto3" json:"result,omitempty"` - // Status of session setup at the current stage. - Status *SessionStatus `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *SessionResp) Reset() { - *x = SessionResp{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionResp) ProtoMessage() {} - -func (x *SessionResp) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_s2a_s2a_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionResp.ProtoReflect.Descriptor instead. -func (*SessionResp) Descriptor() ([]byte, []int) { - return file_internal_proto_s2a_s2a_proto_rawDescGZIP(), []int{9} -} - -func (x *SessionResp) GetLocalIdentity() *common_go_proto.Identity { - if x != nil { - return x.LocalIdentity - } - return nil -} - -func (x *SessionResp) GetOutFrames() []byte { - if x != nil { - return x.OutFrames - } - return nil -} - -func (x *SessionResp) GetBytesConsumed() uint32 { - if x != nil { - return x.BytesConsumed - } - return 0 -} - -func (x *SessionResp) GetResult() *SessionResult { - if x != nil { - return x.Result - } - return nil -} - -func (x *SessionResp) GetStatus() *SessionStatus { - if x != nil { - return x.Status - } - return nil -} - -var File_internal_proto_s2a_s2a_proto protoreflect.FileDescriptor - -var file_internal_proto_s2a_s2a_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, - 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x75, 0x0a, - 0x17, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x12, 0x2f, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, - 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x5f, 0x6f, - 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xac, 0x03, 0x0a, 0x15, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x33, - 0x0a, 0x15, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x73, 0x12, 0x3d, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, - 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, 0x32, - 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x41, 0x0a, 0x10, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, - 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x73, 0x32, - 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, - 0x69, 0x74, 0x65, 0x52, 0x0f, 0x74, 0x6c, 0x73, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, - 0x69, 0x74, 0x65, 0x73, 0x12, 0x40, 0x0a, 0x11, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x52, 0x10, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, - 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0xe8, 0x02, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x33, 0x0a, - 0x15, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x61, 0x70, - 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x73, 0x12, 0x3d, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, 0x32, - 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x3d, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, 0x32, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x41, 0x0a, 0x10, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, - 0x69, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x73, 0x32, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, - 0x74, 0x65, 0x52, 0x0f, 0x74, 0x6c, 0x73, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, - 0x74, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x52, 0x0f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x69, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x2b, - 0x0a, 0x0e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, - 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x91, 0x01, 0x0a, 0x13, - 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x23, - 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, - 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, - 0xf4, 0x02, 0x0a, 0x0a, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x45, - 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x45, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x32, - 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, - 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x2f, 0x0a, 0x04, - 0x6e, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x32, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x65, - 0x78, 0x74, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x12, 0x4d, 0x0a, - 0x11, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x63, 0x6b, - 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x10, 0x72, 0x65, 0x73, 0x75, - 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x4b, 0x0a, 0x0f, - 0x61, 0x75, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x4d, - 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x71, - 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xa0, 0x03, 0x0a, 0x0c, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x0b, 0x74, 0x6c, 0x73, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x73, - 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x74, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x3f, 0x0a, 0x0f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, - 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, - 0x52, 0x0e, 0x74, 0x6c, 0x73, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x71, 0x75, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x6f, - 0x75, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x75, - 0x74, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x6e, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, - 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x69, 0x6e, - 0x46, 0x69, 0x78, 0x65, 0x64, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x6f, 0x75, - 0x74, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x6f, 0x75, 0x74, 0x46, 0x69, 0x78, 0x65, 0x64, 0x4e, 0x6f, 0x6e, - 0x63, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x73, 0x5f, 0x68, 0x61, - 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x73, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, - 0x6b, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x22, 0xd1, 0x02, 0x0a, 0x0d, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x31, 0x0a, 0x14, 0x61, - 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x61, 0x70, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x2d, - 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, - 0x0d, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x70, 0x65, 0x65, 0x72, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x34, 0x0a, 0x16, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x63, 0x65, 0x72, - 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x14, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x43, 0x65, 0x72, 0x74, 0x46, 0x69, - 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x65, 0x65, - 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, - 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x70, 0x65, 0x65, 0x72, 0x43, 0x65, - 0x72, 0x74, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x22, 0x3d, 0x0a, - 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xf3, 0x01, 0x0a, - 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x0e, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x5f, - 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6f, 0x75, - 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x73, - 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0d, 0x62, 0x79, 0x74, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x12, 0x30, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x30, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x32, 0x51, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x43, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x55, 0x70, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x15, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, - 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x32, - 0x61, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_internal_proto_s2a_s2a_proto_rawDescOnce sync.Once - file_internal_proto_s2a_s2a_proto_rawDescData = file_internal_proto_s2a_s2a_proto_rawDesc -) - -func file_internal_proto_s2a_s2a_proto_rawDescGZIP() []byte { - file_internal_proto_s2a_s2a_proto_rawDescOnce.Do(func() { - file_internal_proto_s2a_s2a_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_s2a_s2a_proto_rawDescData) - }) - return file_internal_proto_s2a_s2a_proto_rawDescData -} - -var file_internal_proto_s2a_s2a_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_internal_proto_s2a_s2a_proto_goTypes = []interface{}{ - (*AuthenticationMechanism)(nil), // 0: s2a.proto.AuthenticationMechanism - (*ClientSessionStartReq)(nil), // 1: s2a.proto.ClientSessionStartReq - (*ServerSessionStartReq)(nil), // 2: s2a.proto.ServerSessionStartReq - (*SessionNextReq)(nil), // 3: s2a.proto.SessionNextReq - (*ResumptionTicketReq)(nil), // 4: s2a.proto.ResumptionTicketReq - (*SessionReq)(nil), // 5: s2a.proto.SessionReq - (*SessionState)(nil), // 6: s2a.proto.SessionState - (*SessionResult)(nil), // 7: s2a.proto.SessionResult - (*SessionStatus)(nil), // 8: s2a.proto.SessionStatus - (*SessionResp)(nil), // 9: s2a.proto.SessionResp - (*common_go_proto.Identity)(nil), // 10: s2a.proto.Identity - (common_go_proto.TLSVersion)(0), // 11: s2a.proto.TLSVersion - (common_go_proto.Ciphersuite)(0), // 12: s2a.proto.Ciphersuite -} -var file_internal_proto_s2a_s2a_proto_depIdxs = []int32{ - 10, // 0: s2a.proto.AuthenticationMechanism.identity:type_name -> s2a.proto.Identity - 11, // 1: s2a.proto.ClientSessionStartReq.min_tls_version:type_name -> s2a.proto.TLSVersion - 11, // 2: s2a.proto.ClientSessionStartReq.max_tls_version:type_name -> s2a.proto.TLSVersion - 12, // 3: s2a.proto.ClientSessionStartReq.tls_ciphersuites:type_name -> s2a.proto.Ciphersuite - 10, // 4: s2a.proto.ClientSessionStartReq.target_identities:type_name -> s2a.proto.Identity - 10, // 5: s2a.proto.ClientSessionStartReq.local_identity:type_name -> s2a.proto.Identity - 11, // 6: s2a.proto.ServerSessionStartReq.min_tls_version:type_name -> s2a.proto.TLSVersion - 11, // 7: s2a.proto.ServerSessionStartReq.max_tls_version:type_name -> s2a.proto.TLSVersion - 12, // 8: s2a.proto.ServerSessionStartReq.tls_ciphersuites:type_name -> s2a.proto.Ciphersuite - 10, // 9: s2a.proto.ServerSessionStartReq.local_identities:type_name -> s2a.proto.Identity - 10, // 10: s2a.proto.ResumptionTicketReq.local_identity:type_name -> s2a.proto.Identity - 1, // 11: s2a.proto.SessionReq.client_start:type_name -> s2a.proto.ClientSessionStartReq - 2, // 12: s2a.proto.SessionReq.server_start:type_name -> s2a.proto.ServerSessionStartReq - 3, // 13: s2a.proto.SessionReq.next:type_name -> s2a.proto.SessionNextReq - 4, // 14: s2a.proto.SessionReq.resumption_ticket:type_name -> s2a.proto.ResumptionTicketReq - 0, // 15: s2a.proto.SessionReq.auth_mechanisms:type_name -> s2a.proto.AuthenticationMechanism - 11, // 16: s2a.proto.SessionState.tls_version:type_name -> s2a.proto.TLSVersion - 12, // 17: s2a.proto.SessionState.tls_ciphersuite:type_name -> s2a.proto.Ciphersuite - 6, // 18: s2a.proto.SessionResult.state:type_name -> s2a.proto.SessionState - 10, // 19: s2a.proto.SessionResult.peer_identity:type_name -> s2a.proto.Identity - 10, // 20: s2a.proto.SessionResult.local_identity:type_name -> s2a.proto.Identity - 10, // 21: s2a.proto.SessionResp.local_identity:type_name -> s2a.proto.Identity - 7, // 22: s2a.proto.SessionResp.result:type_name -> s2a.proto.SessionResult - 8, // 23: s2a.proto.SessionResp.status:type_name -> s2a.proto.SessionStatus - 5, // 24: s2a.proto.S2AService.SetUpSession:input_type -> s2a.proto.SessionReq - 9, // 25: s2a.proto.S2AService.SetUpSession:output_type -> s2a.proto.SessionResp - 25, // [25:26] is the sub-list for method output_type - 24, // [24:25] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name -} - -func init() { file_internal_proto_s2a_s2a_proto_init() } -func file_internal_proto_s2a_s2a_proto_init() { - if File_internal_proto_s2a_s2a_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_internal_proto_s2a_s2a_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthenticationMechanism); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientSessionStartReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerSessionStartReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionNextReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResumptionTicketReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_internal_proto_s2a_s2a_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*AuthenticationMechanism_Token)(nil), - } - file_internal_proto_s2a_s2a_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*SessionReq_ClientStart)(nil), - (*SessionReq_ServerStart)(nil), - (*SessionReq_Next)(nil), - (*SessionReq_ResumptionTicket)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_proto_s2a_s2a_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_internal_proto_s2a_s2a_proto_goTypes, - DependencyIndexes: file_internal_proto_s2a_s2a_proto_depIdxs, - MessageInfos: file_internal_proto_s2a_s2a_proto_msgTypes, - }.Build() - File_internal_proto_s2a_s2a_proto = out.File - file_internal_proto_s2a_s2a_proto_rawDesc = nil - file_internal_proto_s2a_s2a_proto_goTypes = nil - file_internal_proto_s2a_s2a_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go deleted file mode 100644 index 0fa582fc874d..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/s2a_go_proto/s2a_grpc.pb.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2021 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-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.12 -// source: internal/proto/s2a/s2a.proto - -package s2a_go_proto - -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 ( - S2AService_SetUpSession_FullMethodName = "/s2a.proto.S2AService/SetUpSession" -) - -// S2AServiceClient is the client API for S2AService 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 S2AServiceClient interface { - // S2A service accepts a stream of session setup requests and returns a stream - // of session setup responses. The client of this service is expected to send - // exactly one client_start or server_start message followed by at least one - // next message. Applications running TLS clients can send requests with - // resumption_ticket messages only after the session is successfully set up. - // - // Every time S2A client sends a request, this service sends a response. - // However, clients do not have to wait for service response before sending - // the next request. - SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) -} - -type s2AServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewS2AServiceClient(cc grpc.ClientConnInterface) S2AServiceClient { - return &s2AServiceClient{cc} -} - -func (c *s2AServiceClient) SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) { - stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &s2AServiceSetUpSessionClient{stream} - return x, nil -} - -type S2AService_SetUpSessionClient interface { - Send(*SessionReq) error - Recv() (*SessionResp, error) - grpc.ClientStream -} - -type s2AServiceSetUpSessionClient struct { - grpc.ClientStream -} - -func (x *s2AServiceSetUpSessionClient) Send(m *SessionReq) error { - return x.ClientStream.SendMsg(m) -} - -func (x *s2AServiceSetUpSessionClient) Recv() (*SessionResp, error) { - m := new(SessionResp) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// S2AServiceServer is the server API for S2AService service. -// All implementations must embed UnimplementedS2AServiceServer -// for forward compatibility -type S2AServiceServer interface { - // S2A service accepts a stream of session setup requests and returns a stream - // of session setup responses. The client of this service is expected to send - // exactly one client_start or server_start message followed by at least one - // next message. Applications running TLS clients can send requests with - // resumption_ticket messages only after the session is successfully set up. - // - // Every time S2A client sends a request, this service sends a response. - // However, clients do not have to wait for service response before sending - // the next request. - SetUpSession(S2AService_SetUpSessionServer) error - mustEmbedUnimplementedS2AServiceServer() -} - -// UnimplementedS2AServiceServer must be embedded to have forward compatible implementations. -type UnimplementedS2AServiceServer struct { -} - -func (UnimplementedS2AServiceServer) SetUpSession(S2AService_SetUpSessionServer) error { - return status.Errorf(codes.Unimplemented, "method SetUpSession not implemented") -} -func (UnimplementedS2AServiceServer) mustEmbedUnimplementedS2AServiceServer() {} - -// UnsafeS2AServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to S2AServiceServer will -// result in compilation errors. -type UnsafeS2AServiceServer interface { - mustEmbedUnimplementedS2AServiceServer() -} - -func RegisterS2AServiceServer(s grpc.ServiceRegistrar, srv S2AServiceServer) { - s.RegisterService(&S2AService_ServiceDesc, srv) -} - -func _S2AService_SetUpSession_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{stream}) -} - -type S2AService_SetUpSessionServer interface { - Send(*SessionResp) error - Recv() (*SessionReq, error) - grpc.ServerStream -} - -type s2AServiceSetUpSessionServer struct { - grpc.ServerStream -} - -func (x *s2AServiceSetUpSessionServer) Send(m *SessionResp) error { - return x.ServerStream.SendMsg(m) -} - -func (x *s2AServiceSetUpSessionServer) Recv() (*SessionReq, error) { - m := new(SessionReq) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// S2AService_ServiceDesc is the grpc.ServiceDesc for S2AService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var S2AService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "s2a.proto.S2AService", - HandlerType: (*S2AServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "SetUpSession", - Handler: _S2AService_SetUpSession_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "internal/proto/s2a/s2a.proto", -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go deleted file mode 100644 index c84bed977482..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/common_go_proto/common.pb.go +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright 2022 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. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: internal/proto/v2/common/common.proto - -package common_go_proto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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 TLS 1.0-1.2 ciphersuites that the application can negotiate when using -// S2A. -type Ciphersuite int32 - -const ( - Ciphersuite_CIPHERSUITE_UNSPECIFIED Ciphersuite = 0 - Ciphersuite_CIPHERSUITE_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 Ciphersuite = 1 - Ciphersuite_CIPHERSUITE_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 Ciphersuite = 2 - Ciphersuite_CIPHERSUITE_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 Ciphersuite = 3 - Ciphersuite_CIPHERSUITE_ECDHE_RSA_WITH_AES_128_GCM_SHA256 Ciphersuite = 4 - Ciphersuite_CIPHERSUITE_ECDHE_RSA_WITH_AES_256_GCM_SHA384 Ciphersuite = 5 - Ciphersuite_CIPHERSUITE_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 Ciphersuite = 6 -) - -// Enum value maps for Ciphersuite. -var ( - Ciphersuite_name = map[int32]string{ - 0: "CIPHERSUITE_UNSPECIFIED", - 1: "CIPHERSUITE_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - 2: "CIPHERSUITE_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - 3: "CIPHERSUITE_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", - 4: "CIPHERSUITE_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - 5: "CIPHERSUITE_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - 6: "CIPHERSUITE_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", - } - Ciphersuite_value = map[string]int32{ - "CIPHERSUITE_UNSPECIFIED": 0, - "CIPHERSUITE_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256": 1, - "CIPHERSUITE_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384": 2, - "CIPHERSUITE_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256": 3, - "CIPHERSUITE_ECDHE_RSA_WITH_AES_128_GCM_SHA256": 4, - "CIPHERSUITE_ECDHE_RSA_WITH_AES_256_GCM_SHA384": 5, - "CIPHERSUITE_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256": 6, - } -) - -func (x Ciphersuite) Enum() *Ciphersuite { - p := new(Ciphersuite) - *p = x - return p -} - -func (x Ciphersuite) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Ciphersuite) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_common_common_proto_enumTypes[0].Descriptor() -} - -func (Ciphersuite) Type() protoreflect.EnumType { - return &file_internal_proto_v2_common_common_proto_enumTypes[0] -} - -func (x Ciphersuite) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Ciphersuite.Descriptor instead. -func (Ciphersuite) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_common_common_proto_rawDescGZIP(), []int{0} -} - -// The TLS versions supported by S2A's handshaker module. -type TLSVersion int32 - -const ( - TLSVersion_TLS_VERSION_UNSPECIFIED TLSVersion = 0 - TLSVersion_TLS_VERSION_1_0 TLSVersion = 1 - TLSVersion_TLS_VERSION_1_1 TLSVersion = 2 - TLSVersion_TLS_VERSION_1_2 TLSVersion = 3 - TLSVersion_TLS_VERSION_1_3 TLSVersion = 4 -) - -// Enum value maps for TLSVersion. -var ( - TLSVersion_name = map[int32]string{ - 0: "TLS_VERSION_UNSPECIFIED", - 1: "TLS_VERSION_1_0", - 2: "TLS_VERSION_1_1", - 3: "TLS_VERSION_1_2", - 4: "TLS_VERSION_1_3", - } - TLSVersion_value = map[string]int32{ - "TLS_VERSION_UNSPECIFIED": 0, - "TLS_VERSION_1_0": 1, - "TLS_VERSION_1_1": 2, - "TLS_VERSION_1_2": 3, - "TLS_VERSION_1_3": 4, - } -) - -func (x TLSVersion) Enum() *TLSVersion { - p := new(TLSVersion) - *p = x - return p -} - -func (x TLSVersion) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TLSVersion) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_common_common_proto_enumTypes[1].Descriptor() -} - -func (TLSVersion) Type() protoreflect.EnumType { - return &file_internal_proto_v2_common_common_proto_enumTypes[1] -} - -func (x TLSVersion) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TLSVersion.Descriptor instead. -func (TLSVersion) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_common_common_proto_rawDescGZIP(), []int{1} -} - -// The side in the TLS connection. -type ConnectionSide int32 - -const ( - ConnectionSide_CONNECTION_SIDE_UNSPECIFIED ConnectionSide = 0 - ConnectionSide_CONNECTION_SIDE_CLIENT ConnectionSide = 1 - ConnectionSide_CONNECTION_SIDE_SERVER ConnectionSide = 2 -) - -// Enum value maps for ConnectionSide. -var ( - ConnectionSide_name = map[int32]string{ - 0: "CONNECTION_SIDE_UNSPECIFIED", - 1: "CONNECTION_SIDE_CLIENT", - 2: "CONNECTION_SIDE_SERVER", - } - ConnectionSide_value = map[string]int32{ - "CONNECTION_SIDE_UNSPECIFIED": 0, - "CONNECTION_SIDE_CLIENT": 1, - "CONNECTION_SIDE_SERVER": 2, - } -) - -func (x ConnectionSide) Enum() *ConnectionSide { - p := new(ConnectionSide) - *p = x - return p -} - -func (x ConnectionSide) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ConnectionSide) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_common_common_proto_enumTypes[2].Descriptor() -} - -func (ConnectionSide) Type() protoreflect.EnumType { - return &file_internal_proto_v2_common_common_proto_enumTypes[2] -} - -func (x ConnectionSide) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ConnectionSide.Descriptor instead. -func (ConnectionSide) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_common_common_proto_rawDescGZIP(), []int{2} -} - -// The ALPN protocols that the application can negotiate during a TLS handshake. -type AlpnProtocol int32 - -const ( - AlpnProtocol_ALPN_PROTOCOL_UNSPECIFIED AlpnProtocol = 0 - AlpnProtocol_ALPN_PROTOCOL_GRPC AlpnProtocol = 1 - AlpnProtocol_ALPN_PROTOCOL_HTTP2 AlpnProtocol = 2 - AlpnProtocol_ALPN_PROTOCOL_HTTP1_1 AlpnProtocol = 3 -) - -// Enum value maps for AlpnProtocol. -var ( - AlpnProtocol_name = map[int32]string{ - 0: "ALPN_PROTOCOL_UNSPECIFIED", - 1: "ALPN_PROTOCOL_GRPC", - 2: "ALPN_PROTOCOL_HTTP2", - 3: "ALPN_PROTOCOL_HTTP1_1", - } - AlpnProtocol_value = map[string]int32{ - "ALPN_PROTOCOL_UNSPECIFIED": 0, - "ALPN_PROTOCOL_GRPC": 1, - "ALPN_PROTOCOL_HTTP2": 2, - "ALPN_PROTOCOL_HTTP1_1": 3, - } -) - -func (x AlpnProtocol) Enum() *AlpnProtocol { - p := new(AlpnProtocol) - *p = x - return p -} - -func (x AlpnProtocol) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AlpnProtocol) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_common_common_proto_enumTypes[3].Descriptor() -} - -func (AlpnProtocol) Type() protoreflect.EnumType { - return &file_internal_proto_v2_common_common_proto_enumTypes[3] -} - -func (x AlpnProtocol) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AlpnProtocol.Descriptor instead. -func (AlpnProtocol) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_common_common_proto_rawDescGZIP(), []int{3} -} - -var File_internal_proto_v2_common_common_proto protoreflect.FileDescriptor - -var file_internal_proto_v2_common_common_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2a, 0xee, 0x02, 0x0a, 0x0b, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, - 0x73, 0x75, 0x69, 0x74, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, - 0x55, 0x49, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, - 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49, - 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, - 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x33, 0x0a, 0x2f, 0x43, 0x49, 0x50, 0x48, 0x45, - 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x45, 0x43, 0x44, - 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, - 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x39, 0x0a, 0x35, - 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, - 0x45, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41, - 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, - 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x03, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49, 0x50, 0x48, 0x45, - 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, 0x52, 0x53, 0x41, - 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, - 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x31, 0x0a, 0x2d, 0x43, 0x49, - 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, 0x48, 0x45, 0x5f, - 0x52, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, - 0x5f, 0x47, 0x43, 0x4d, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x05, 0x12, 0x37, 0x0a, - 0x33, 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x53, 0x55, 0x49, 0x54, 0x45, 0x5f, 0x45, 0x43, 0x44, - 0x48, 0x45, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x43, 0x48, 0x41, 0x43, - 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x5f, 0x53, 0x48, - 0x41, 0x32, 0x35, 0x36, 0x10, 0x06, 0x2a, 0x7d, 0x0a, 0x0a, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, - 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, - 0x5f, 0x31, 0x5f, 0x30, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, - 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x31, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x54, - 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x31, 0x5f, 0x32, 0x10, 0x03, - 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x4c, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, - 0x31, 0x5f, 0x33, 0x10, 0x04, 0x2a, 0x69, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x43, 0x4f, 0x4e, 0x4e, 0x45, - 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e, - 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, - 0x4e, 0x54, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x10, 0x02, - 0x2a, 0x79, 0x0a, 0x0c, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x12, 0x1d, 0x0a, 0x19, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, - 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x16, 0x0a, 0x12, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, - 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x4c, 0x50, 0x4e, 0x5f, - 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x32, 0x10, 0x02, - 0x12, 0x19, 0x0a, 0x15, 0x41, 0x4c, 0x50, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, - 0x4c, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x31, 0x5f, 0x31, 0x10, 0x03, 0x42, 0x39, 0x5a, 0x37, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x67, 0x6f, - 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_internal_proto_v2_common_common_proto_rawDescOnce sync.Once - file_internal_proto_v2_common_common_proto_rawDescData = file_internal_proto_v2_common_common_proto_rawDesc -) - -func file_internal_proto_v2_common_common_proto_rawDescGZIP() []byte { - file_internal_proto_v2_common_common_proto_rawDescOnce.Do(func() { - file_internal_proto_v2_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_v2_common_common_proto_rawDescData) - }) - return file_internal_proto_v2_common_common_proto_rawDescData -} - -var file_internal_proto_v2_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_internal_proto_v2_common_common_proto_goTypes = []interface{}{ - (Ciphersuite)(0), // 0: s2a.proto.v2.Ciphersuite - (TLSVersion)(0), // 1: s2a.proto.v2.TLSVersion - (ConnectionSide)(0), // 2: s2a.proto.v2.ConnectionSide - (AlpnProtocol)(0), // 3: s2a.proto.v2.AlpnProtocol -} -var file_internal_proto_v2_common_common_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_internal_proto_v2_common_common_proto_init() } -func file_internal_proto_v2_common_common_proto_init() { - if File_internal_proto_v2_common_common_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_proto_v2_common_common_proto_rawDesc, - NumEnums: 4, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_internal_proto_v2_common_common_proto_goTypes, - DependencyIndexes: file_internal_proto_v2_common_common_proto_depIdxs, - EnumInfos: file_internal_proto_v2_common_common_proto_enumTypes, - }.Build() - File_internal_proto_v2_common_common_proto = out.File - file_internal_proto_v2_common_common_proto_rawDesc = nil - file_internal_proto_v2_common_common_proto_goTypes = nil - file_internal_proto_v2_common_common_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go deleted file mode 100644 index b7fd871c7a75..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto/s2a_context.pb.go +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2022 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. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: internal/proto/v2/s2a_context/s2a_context.proto - -package s2a_context_go_proto - -import ( - common_go_proto "github.com/google/s2a-go/internal/proto/common_go_proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type S2AContext struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The SPIFFE ID from the peer leaf certificate, if present. - // - // This field is only populated if the leaf certificate is a valid SPIFFE - // SVID; in particular, there is a unique URI SAN and this URI SAN is a valid - // SPIFFE ID. - LeafCertSpiffeId string `protobuf:"bytes,1,opt,name=leaf_cert_spiffe_id,json=leafCertSpiffeId,proto3" json:"leaf_cert_spiffe_id,omitempty"` - // The URIs that are present in the SubjectAltName extension of the peer leaf - // certificate. - // - // Note that the extracted URIs are not validated and may not be properly - // formatted. - LeafCertUris []string `protobuf:"bytes,2,rep,name=leaf_cert_uris,json=leafCertUris,proto3" json:"leaf_cert_uris,omitempty"` - // The DNSNames that are present in the SubjectAltName extension of the peer - // leaf certificate. - LeafCertDnsnames []string `protobuf:"bytes,3,rep,name=leaf_cert_dnsnames,json=leafCertDnsnames,proto3" json:"leaf_cert_dnsnames,omitempty"` - // The (ordered) list of fingerprints in the certificate chain used to verify - // the given leaf certificate. The order MUST be from leaf certificate - // fingerprint to root certificate fingerprint. - // - // A fingerprint is the base-64 encoding of the SHA256 hash of the - // DER-encoding of a certificate. The list MAY be populated even if the peer - // certificate chain was NOT validated successfully. - PeerCertificateChainFingerprints []string `protobuf:"bytes,4,rep,name=peer_certificate_chain_fingerprints,json=peerCertificateChainFingerprints,proto3" json:"peer_certificate_chain_fingerprints,omitempty"` - // The local identity used during session setup. - LocalIdentity *common_go_proto.Identity `protobuf:"bytes,5,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"` - // The SHA256 hash of the DER-encoding of the local leaf certificate used in - // the handshake. - LocalLeafCertFingerprint []byte `protobuf:"bytes,6,opt,name=local_leaf_cert_fingerprint,json=localLeafCertFingerprint,proto3" json:"local_leaf_cert_fingerprint,omitempty"` -} - -func (x *S2AContext) Reset() { - *x = S2AContext{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *S2AContext) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*S2AContext) ProtoMessage() {} - -func (x *S2AContext) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use S2AContext.ProtoReflect.Descriptor instead. -func (*S2AContext) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescGZIP(), []int{0} -} - -func (x *S2AContext) GetLeafCertSpiffeId() string { - if x != nil { - return x.LeafCertSpiffeId - } - return "" -} - -func (x *S2AContext) GetLeafCertUris() []string { - if x != nil { - return x.LeafCertUris - } - return nil -} - -func (x *S2AContext) GetLeafCertDnsnames() []string { - if x != nil { - return x.LeafCertDnsnames - } - return nil -} - -func (x *S2AContext) GetPeerCertificateChainFingerprints() []string { - if x != nil { - return x.PeerCertificateChainFingerprints - } - return nil -} - -func (x *S2AContext) GetLocalIdentity() *common_go_proto.Identity { - if x != nil { - return x.LocalIdentity - } - return nil -} - -func (x *S2AContext) GetLocalLeafCertFingerprint() []byte { - if x != nil { - return x.LocalLeafCertFingerprint - } - return nil -} - -var File_internal_proto_v2_s2a_context_s2a_context_proto protoreflect.FileDescriptor - -var file_internal_proto_v2_s2a_context_s2a_context_proto_rawDesc = []byte{ - 0x0a, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f, - 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x1a, - 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xd9, 0x02, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65, - 0x78, 0x74, 0x12, 0x2d, 0x0a, 0x13, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, - 0x73, 0x70, 0x69, 0x66, 0x66, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x53, 0x70, 0x69, 0x66, 0x66, 0x65, 0x49, - 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, 0x75, - 0x72, 0x69, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x65, 0x61, 0x66, 0x43, - 0x65, 0x72, 0x74, 0x55, 0x72, 0x69, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x65, 0x61, 0x66, 0x5f, - 0x63, 0x65, 0x72, 0x74, 0x5f, 0x64, 0x6e, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x65, 0x61, 0x66, 0x43, 0x65, 0x72, 0x74, 0x44, 0x6e, 0x73, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x23, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, - 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x20, 0x70, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, - 0x69, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, - 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x12, 0x3d, 0x0a, 0x1b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x63, - 0x65, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x18, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4c, 0x65, 0x61, 0x66, - 0x43, 0x65, 0x72, 0x74, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x42, - 0x3e, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescOnce sync.Once - file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescData = file_internal_proto_v2_s2a_context_s2a_context_proto_rawDesc -) - -func file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescGZIP() []byte { - file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescOnce.Do(func() { - file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescData) - }) - return file_internal_proto_v2_s2a_context_s2a_context_proto_rawDescData -} - -var file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_internal_proto_v2_s2a_context_s2a_context_proto_goTypes = []interface{}{ - (*S2AContext)(nil), // 0: s2a.proto.v2.S2AContext - (*common_go_proto.Identity)(nil), // 1: s2a.proto.Identity -} -var file_internal_proto_v2_s2a_context_s2a_context_proto_depIdxs = []int32{ - 1, // 0: s2a.proto.v2.S2AContext.local_identity:type_name -> s2a.proto.Identity - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_internal_proto_v2_s2a_context_s2a_context_proto_init() } -func file_internal_proto_v2_s2a_context_s2a_context_proto_init() { - if File_internal_proto_v2_s2a_context_s2a_context_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*S2AContext); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_proto_v2_s2a_context_s2a_context_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_internal_proto_v2_s2a_context_s2a_context_proto_goTypes, - DependencyIndexes: file_internal_proto_v2_s2a_context_s2a_context_proto_depIdxs, - MessageInfos: file_internal_proto_v2_s2a_context_s2a_context_proto_msgTypes, - }.Build() - File_internal_proto_v2_s2a_context_s2a_context_proto = out.File - file_internal_proto_v2_s2a_context_s2a_context_proto_rawDesc = nil - file_internal_proto_v2_s2a_context_s2a_context_proto_goTypes = nil - file_internal_proto_v2_s2a_context_s2a_context_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go deleted file mode 100644 index e843450c7edb..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a.pb.go +++ /dev/null @@ -1,2494 +0,0 @@ -// Copyright 2022 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. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.21.12 -// source: internal/proto/v2/s2a/s2a.proto - -package s2a_go_proto - -import ( - common_go_proto1 "github.com/google/s2a-go/internal/proto/common_go_proto" - common_go_proto "github.com/google/s2a-go/internal/proto/v2/common_go_proto" - s2a_context_go_proto "github.com/google/s2a-go/internal/proto/v2/s2a_context_go_proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type SignatureAlgorithm int32 - -const ( - SignatureAlgorithm_S2A_SSL_SIGN_UNSPECIFIED SignatureAlgorithm = 0 - // RSA Public-Key Cryptography Standards #1. - SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA256 SignatureAlgorithm = 1 - SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA384 SignatureAlgorithm = 2 - SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA512 SignatureAlgorithm = 3 - // ECDSA. - SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP256R1_SHA256 SignatureAlgorithm = 4 - SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP384R1_SHA384 SignatureAlgorithm = 5 - SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP521R1_SHA512 SignatureAlgorithm = 6 - // RSA Probabilistic Signature Scheme. - SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA256 SignatureAlgorithm = 7 - SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA384 SignatureAlgorithm = 8 - SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA512 SignatureAlgorithm = 9 - // ED25519. - SignatureAlgorithm_S2A_SSL_SIGN_ED25519 SignatureAlgorithm = 10 -) - -// Enum value maps for SignatureAlgorithm. -var ( - SignatureAlgorithm_name = map[int32]string{ - 0: "S2A_SSL_SIGN_UNSPECIFIED", - 1: "S2A_SSL_SIGN_RSA_PKCS1_SHA256", - 2: "S2A_SSL_SIGN_RSA_PKCS1_SHA384", - 3: "S2A_SSL_SIGN_RSA_PKCS1_SHA512", - 4: "S2A_SSL_SIGN_ECDSA_SECP256R1_SHA256", - 5: "S2A_SSL_SIGN_ECDSA_SECP384R1_SHA384", - 6: "S2A_SSL_SIGN_ECDSA_SECP521R1_SHA512", - 7: "S2A_SSL_SIGN_RSA_PSS_RSAE_SHA256", - 8: "S2A_SSL_SIGN_RSA_PSS_RSAE_SHA384", - 9: "S2A_SSL_SIGN_RSA_PSS_RSAE_SHA512", - 10: "S2A_SSL_SIGN_ED25519", - } - SignatureAlgorithm_value = map[string]int32{ - "S2A_SSL_SIGN_UNSPECIFIED": 0, - "S2A_SSL_SIGN_RSA_PKCS1_SHA256": 1, - "S2A_SSL_SIGN_RSA_PKCS1_SHA384": 2, - "S2A_SSL_SIGN_RSA_PKCS1_SHA512": 3, - "S2A_SSL_SIGN_ECDSA_SECP256R1_SHA256": 4, - "S2A_SSL_SIGN_ECDSA_SECP384R1_SHA384": 5, - "S2A_SSL_SIGN_ECDSA_SECP521R1_SHA512": 6, - "S2A_SSL_SIGN_RSA_PSS_RSAE_SHA256": 7, - "S2A_SSL_SIGN_RSA_PSS_RSAE_SHA384": 8, - "S2A_SSL_SIGN_RSA_PSS_RSAE_SHA512": 9, - "S2A_SSL_SIGN_ED25519": 10, - } -) - -func (x SignatureAlgorithm) Enum() *SignatureAlgorithm { - p := new(SignatureAlgorithm) - *p = x - return p -} - -func (x SignatureAlgorithm) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SignatureAlgorithm) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_s2a_s2a_proto_enumTypes[0].Descriptor() -} - -func (SignatureAlgorithm) Type() protoreflect.EnumType { - return &file_internal_proto_v2_s2a_s2a_proto_enumTypes[0] -} - -func (x SignatureAlgorithm) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SignatureAlgorithm.Descriptor instead. -func (SignatureAlgorithm) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{0} -} - -type GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate int32 - -const ( - GetTlsConfigurationResp_ServerTlsConfiguration_UNSPECIFIED GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate = 0 - GetTlsConfigurationResp_ServerTlsConfiguration_DONT_REQUEST_CLIENT_CERTIFICATE GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate = 1 - GetTlsConfigurationResp_ServerTlsConfiguration_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate = 2 - GetTlsConfigurationResp_ServerTlsConfiguration_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate = 3 - GetTlsConfigurationResp_ServerTlsConfiguration_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate = 4 - GetTlsConfigurationResp_ServerTlsConfiguration_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate = 5 -) - -// Enum value maps for GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate. -var ( - GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "DONT_REQUEST_CLIENT_CERTIFICATE", - 2: "REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY", - 3: "REQUEST_CLIENT_CERTIFICATE_AND_VERIFY", - 4: "REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY", - 5: "REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY", - } - GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate_value = map[string]int32{ - "UNSPECIFIED": 0, - "DONT_REQUEST_CLIENT_CERTIFICATE": 1, - "REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY": 2, - "REQUEST_CLIENT_CERTIFICATE_AND_VERIFY": 3, - "REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY": 4, - "REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY": 5, - } -) - -func (x GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate) Enum() *GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate { - p := new(GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate) - *p = x - return p -} - -func (x GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_s2a_s2a_proto_enumTypes[1].Descriptor() -} - -func (GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate) Type() protoreflect.EnumType { - return &file_internal_proto_v2_s2a_s2a_proto_enumTypes[1] -} - -func (x GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate.Descriptor instead. -func (GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{4, 1, 0} -} - -type OffloadPrivateKeyOperationReq_PrivateKeyOperation int32 - -const ( - OffloadPrivateKeyOperationReq_UNSPECIFIED OffloadPrivateKeyOperationReq_PrivateKeyOperation = 0 - // When performing a TLS 1.2 or 1.3 handshake, the (partial) transcript of - // the TLS handshake must be signed to prove possession of the private key. - // - // See https://www.rfc-editor.org/rfc/rfc8446.html#section-4.4.3. - OffloadPrivateKeyOperationReq_SIGN OffloadPrivateKeyOperationReq_PrivateKeyOperation = 1 - // When performing a TLS 1.2 handshake using an RSA algorithm, the key - // exchange algorithm involves the client generating a premaster secret, - // encrypting it using the server's public key, and sending this encrypted - // blob to the server in a ClientKeyExchange message. - // - // See https://www.rfc-editor.org/rfc/rfc4346#section-7.4.7.1. - OffloadPrivateKeyOperationReq_DECRYPT OffloadPrivateKeyOperationReq_PrivateKeyOperation = 2 -) - -// Enum value maps for OffloadPrivateKeyOperationReq_PrivateKeyOperation. -var ( - OffloadPrivateKeyOperationReq_PrivateKeyOperation_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "SIGN", - 2: "DECRYPT", - } - OffloadPrivateKeyOperationReq_PrivateKeyOperation_value = map[string]int32{ - "UNSPECIFIED": 0, - "SIGN": 1, - "DECRYPT": 2, - } -) - -func (x OffloadPrivateKeyOperationReq_PrivateKeyOperation) Enum() *OffloadPrivateKeyOperationReq_PrivateKeyOperation { - p := new(OffloadPrivateKeyOperationReq_PrivateKeyOperation) - *p = x - return p -} - -func (x OffloadPrivateKeyOperationReq_PrivateKeyOperation) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OffloadPrivateKeyOperationReq_PrivateKeyOperation) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_s2a_s2a_proto_enumTypes[2].Descriptor() -} - -func (OffloadPrivateKeyOperationReq_PrivateKeyOperation) Type() protoreflect.EnumType { - return &file_internal_proto_v2_s2a_s2a_proto_enumTypes[2] -} - -func (x OffloadPrivateKeyOperationReq_PrivateKeyOperation) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OffloadPrivateKeyOperationReq_PrivateKeyOperation.Descriptor instead. -func (OffloadPrivateKeyOperationReq_PrivateKeyOperation) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{5, 0} -} - -type OffloadResumptionKeyOperationReq_ResumptionKeyOperation int32 - -const ( - OffloadResumptionKeyOperationReq_UNSPECIFIED OffloadResumptionKeyOperationReq_ResumptionKeyOperation = 0 - OffloadResumptionKeyOperationReq_ENCRYPT OffloadResumptionKeyOperationReq_ResumptionKeyOperation = 1 - OffloadResumptionKeyOperationReq_DECRYPT OffloadResumptionKeyOperationReq_ResumptionKeyOperation = 2 -) - -// Enum value maps for OffloadResumptionKeyOperationReq_ResumptionKeyOperation. -var ( - OffloadResumptionKeyOperationReq_ResumptionKeyOperation_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "ENCRYPT", - 2: "DECRYPT", - } - OffloadResumptionKeyOperationReq_ResumptionKeyOperation_value = map[string]int32{ - "UNSPECIFIED": 0, - "ENCRYPT": 1, - "DECRYPT": 2, - } -) - -func (x OffloadResumptionKeyOperationReq_ResumptionKeyOperation) Enum() *OffloadResumptionKeyOperationReq_ResumptionKeyOperation { - p := new(OffloadResumptionKeyOperationReq_ResumptionKeyOperation) - *p = x - return p -} - -func (x OffloadResumptionKeyOperationReq_ResumptionKeyOperation) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OffloadResumptionKeyOperationReq_ResumptionKeyOperation) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_s2a_s2a_proto_enumTypes[3].Descriptor() -} - -func (OffloadResumptionKeyOperationReq_ResumptionKeyOperation) Type() protoreflect.EnumType { - return &file_internal_proto_v2_s2a_s2a_proto_enumTypes[3] -} - -func (x OffloadResumptionKeyOperationReq_ResumptionKeyOperation) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OffloadResumptionKeyOperationReq_ResumptionKeyOperation.Descriptor instead. -func (OffloadResumptionKeyOperationReq_ResumptionKeyOperation) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{7, 0} -} - -type ValidatePeerCertificateChainReq_VerificationMode int32 - -const ( - // The default verification mode supported by S2A. - ValidatePeerCertificateChainReq_UNSPECIFIED ValidatePeerCertificateChainReq_VerificationMode = 0 - // The SPIFFE verification mode selects the set of trusted certificates to - // use for path building based on the SPIFFE trust domain in the peer's leaf - // certificate. - ValidatePeerCertificateChainReq_SPIFFE ValidatePeerCertificateChainReq_VerificationMode = 1 - // The connect-to-Google verification mode uses the trust bundle for - // connecting to Google, e.g. *.mtls.googleapis.com endpoints. - ValidatePeerCertificateChainReq_CONNECT_TO_GOOGLE ValidatePeerCertificateChainReq_VerificationMode = 2 -) - -// Enum value maps for ValidatePeerCertificateChainReq_VerificationMode. -var ( - ValidatePeerCertificateChainReq_VerificationMode_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "SPIFFE", - 2: "CONNECT_TO_GOOGLE", - } - ValidatePeerCertificateChainReq_VerificationMode_value = map[string]int32{ - "UNSPECIFIED": 0, - "SPIFFE": 1, - "CONNECT_TO_GOOGLE": 2, - } -) - -func (x ValidatePeerCertificateChainReq_VerificationMode) Enum() *ValidatePeerCertificateChainReq_VerificationMode { - p := new(ValidatePeerCertificateChainReq_VerificationMode) - *p = x - return p -} - -func (x ValidatePeerCertificateChainReq_VerificationMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ValidatePeerCertificateChainReq_VerificationMode) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_s2a_s2a_proto_enumTypes[4].Descriptor() -} - -func (ValidatePeerCertificateChainReq_VerificationMode) Type() protoreflect.EnumType { - return &file_internal_proto_v2_s2a_s2a_proto_enumTypes[4] -} - -func (x ValidatePeerCertificateChainReq_VerificationMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ValidatePeerCertificateChainReq_VerificationMode.Descriptor instead. -func (ValidatePeerCertificateChainReq_VerificationMode) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{9, 0} -} - -type ValidatePeerCertificateChainResp_ValidationResult int32 - -const ( - ValidatePeerCertificateChainResp_UNSPECIFIED ValidatePeerCertificateChainResp_ValidationResult = 0 - ValidatePeerCertificateChainResp_SUCCESS ValidatePeerCertificateChainResp_ValidationResult = 1 - ValidatePeerCertificateChainResp_FAILURE ValidatePeerCertificateChainResp_ValidationResult = 2 -) - -// Enum value maps for ValidatePeerCertificateChainResp_ValidationResult. -var ( - ValidatePeerCertificateChainResp_ValidationResult_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "SUCCESS", - 2: "FAILURE", - } - ValidatePeerCertificateChainResp_ValidationResult_value = map[string]int32{ - "UNSPECIFIED": 0, - "SUCCESS": 1, - "FAILURE": 2, - } -) - -func (x ValidatePeerCertificateChainResp_ValidationResult) Enum() *ValidatePeerCertificateChainResp_ValidationResult { - p := new(ValidatePeerCertificateChainResp_ValidationResult) - *p = x - return p -} - -func (x ValidatePeerCertificateChainResp_ValidationResult) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ValidatePeerCertificateChainResp_ValidationResult) Descriptor() protoreflect.EnumDescriptor { - return file_internal_proto_v2_s2a_s2a_proto_enumTypes[5].Descriptor() -} - -func (ValidatePeerCertificateChainResp_ValidationResult) Type() protoreflect.EnumType { - return &file_internal_proto_v2_s2a_s2a_proto_enumTypes[5] -} - -func (x ValidatePeerCertificateChainResp_ValidationResult) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ValidatePeerCertificateChainResp_ValidationResult.Descriptor instead. -func (ValidatePeerCertificateChainResp_ValidationResult) EnumDescriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{10, 0} -} - -type AlpnPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // If true, the application MUST perform ALPN negotiation. - EnableAlpnNegotiation bool `protobuf:"varint,1,opt,name=enable_alpn_negotiation,json=enableAlpnNegotiation,proto3" json:"enable_alpn_negotiation,omitempty"` - // The ordered list of ALPN protocols that specify how the application SHOULD - // negotiate ALPN during the TLS handshake. - // - // The application MAY ignore any ALPN protocols in this list that are not - // supported by the application. - AlpnProtocols []common_go_proto.AlpnProtocol `protobuf:"varint,2,rep,packed,name=alpn_protocols,json=alpnProtocols,proto3,enum=s2a.proto.v2.AlpnProtocol" json:"alpn_protocols,omitempty"` -} - -func (x *AlpnPolicy) Reset() { - *x = AlpnPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AlpnPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AlpnPolicy) ProtoMessage() {} - -func (x *AlpnPolicy) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AlpnPolicy.ProtoReflect.Descriptor instead. -func (*AlpnPolicy) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{0} -} - -func (x *AlpnPolicy) GetEnableAlpnNegotiation() bool { - if x != nil { - return x.EnableAlpnNegotiation - } - return false -} - -func (x *AlpnPolicy) GetAlpnProtocols() []common_go_proto.AlpnProtocol { - if x != nil { - return x.AlpnProtocols - } - return nil -} - -type AuthenticationMechanism struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Applications may specify an identity associated to an authentication - // mechanism. Otherwise, S2A assumes that the authentication mechanism is - // associated with the default identity. If the default identity cannot be - // determined, the request is rejected. - Identity *common_go_proto1.Identity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - // Types that are assignable to MechanismOneof: - // - // *AuthenticationMechanism_Token - MechanismOneof isAuthenticationMechanism_MechanismOneof `protobuf_oneof:"mechanism_oneof"` -} - -func (x *AuthenticationMechanism) Reset() { - *x = AuthenticationMechanism{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AuthenticationMechanism) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AuthenticationMechanism) ProtoMessage() {} - -func (x *AuthenticationMechanism) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AuthenticationMechanism.ProtoReflect.Descriptor instead. -func (*AuthenticationMechanism) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{1} -} - -func (x *AuthenticationMechanism) GetIdentity() *common_go_proto1.Identity { - if x != nil { - return x.Identity - } - return nil -} - -func (m *AuthenticationMechanism) GetMechanismOneof() isAuthenticationMechanism_MechanismOneof { - if m != nil { - return m.MechanismOneof - } - return nil -} - -func (x *AuthenticationMechanism) GetToken() string { - if x, ok := x.GetMechanismOneof().(*AuthenticationMechanism_Token); ok { - return x.Token - } - return "" -} - -type isAuthenticationMechanism_MechanismOneof interface { - isAuthenticationMechanism_MechanismOneof() -} - -type AuthenticationMechanism_Token struct { - // A token that the application uses to authenticate itself to S2A. - Token string `protobuf:"bytes,2,opt,name=token,proto3,oneof"` -} - -func (*AuthenticationMechanism_Token) isAuthenticationMechanism_MechanismOneof() {} - -type Status struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The status code that is specific to the application and the implementation - // of S2A, e.g., gRPC status code. - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - // The status details. - Details string `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` -} - -func (x *Status) Reset() { - *x = Status{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Status) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Status) ProtoMessage() {} - -func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Status.ProtoReflect.Descriptor instead. -func (*Status) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{2} -} - -func (x *Status) GetCode() uint32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *Status) GetDetails() string { - if x != nil { - return x.Details - } - return "" -} - -type GetTlsConfigurationReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The role of the application in the TLS connection. - ConnectionSide common_go_proto.ConnectionSide `protobuf:"varint,1,opt,name=connection_side,json=connectionSide,proto3,enum=s2a.proto.v2.ConnectionSide" json:"connection_side,omitempty"` - // The server name indication (SNI) extension, which MAY be populated when a - // server is offloading to S2A. The SNI is used to determine the server - // identity if the local identity in the request is empty. - Sni string `protobuf:"bytes,2,opt,name=sni,proto3" json:"sni,omitempty"` -} - -func (x *GetTlsConfigurationReq) Reset() { - *x = GetTlsConfigurationReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTlsConfigurationReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTlsConfigurationReq) ProtoMessage() {} - -func (x *GetTlsConfigurationReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTlsConfigurationReq.ProtoReflect.Descriptor instead. -func (*GetTlsConfigurationReq) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{3} -} - -func (x *GetTlsConfigurationReq) GetConnectionSide() common_go_proto.ConnectionSide { - if x != nil { - return x.ConnectionSide - } - return common_go_proto.ConnectionSide(0) -} - -func (x *GetTlsConfigurationReq) GetSni() string { - if x != nil { - return x.Sni - } - return "" -} - -type GetTlsConfigurationResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to TlsConfiguration: - // - // *GetTlsConfigurationResp_ClientTlsConfiguration_ - // *GetTlsConfigurationResp_ServerTlsConfiguration_ - TlsConfiguration isGetTlsConfigurationResp_TlsConfiguration `protobuf_oneof:"tls_configuration"` -} - -func (x *GetTlsConfigurationResp) Reset() { - *x = GetTlsConfigurationResp{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTlsConfigurationResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTlsConfigurationResp) ProtoMessage() {} - -func (x *GetTlsConfigurationResp) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTlsConfigurationResp.ProtoReflect.Descriptor instead. -func (*GetTlsConfigurationResp) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{4} -} - -func (m *GetTlsConfigurationResp) GetTlsConfiguration() isGetTlsConfigurationResp_TlsConfiguration { - if m != nil { - return m.TlsConfiguration - } - return nil -} - -func (x *GetTlsConfigurationResp) GetClientTlsConfiguration() *GetTlsConfigurationResp_ClientTlsConfiguration { - if x, ok := x.GetTlsConfiguration().(*GetTlsConfigurationResp_ClientTlsConfiguration_); ok { - return x.ClientTlsConfiguration - } - return nil -} - -func (x *GetTlsConfigurationResp) GetServerTlsConfiguration() *GetTlsConfigurationResp_ServerTlsConfiguration { - if x, ok := x.GetTlsConfiguration().(*GetTlsConfigurationResp_ServerTlsConfiguration_); ok { - return x.ServerTlsConfiguration - } - return nil -} - -type isGetTlsConfigurationResp_TlsConfiguration interface { - isGetTlsConfigurationResp_TlsConfiguration() -} - -type GetTlsConfigurationResp_ClientTlsConfiguration_ struct { - ClientTlsConfiguration *GetTlsConfigurationResp_ClientTlsConfiguration `protobuf:"bytes,1,opt,name=client_tls_configuration,json=clientTlsConfiguration,proto3,oneof"` -} - -type GetTlsConfigurationResp_ServerTlsConfiguration_ struct { - ServerTlsConfiguration *GetTlsConfigurationResp_ServerTlsConfiguration `protobuf:"bytes,2,opt,name=server_tls_configuration,json=serverTlsConfiguration,proto3,oneof"` -} - -func (*GetTlsConfigurationResp_ClientTlsConfiguration_) isGetTlsConfigurationResp_TlsConfiguration() { -} - -func (*GetTlsConfigurationResp_ServerTlsConfiguration_) isGetTlsConfigurationResp_TlsConfiguration() { -} - -type OffloadPrivateKeyOperationReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The operation the private key is used for. - Operation OffloadPrivateKeyOperationReq_PrivateKeyOperation `protobuf:"varint,1,opt,name=operation,proto3,enum=s2a.proto.v2.OffloadPrivateKeyOperationReq_PrivateKeyOperation" json:"operation,omitempty"` - // The signature algorithm to be used for signing operations. - SignatureAlgorithm SignatureAlgorithm `protobuf:"varint,2,opt,name=signature_algorithm,json=signatureAlgorithm,proto3,enum=s2a.proto.v2.SignatureAlgorithm" json:"signature_algorithm,omitempty"` - // The input bytes to be signed or decrypted. - // - // Types that are assignable to InBytes: - // - // *OffloadPrivateKeyOperationReq_RawBytes - // *OffloadPrivateKeyOperationReq_Sha256Digest - // *OffloadPrivateKeyOperationReq_Sha384Digest - // *OffloadPrivateKeyOperationReq_Sha512Digest - InBytes isOffloadPrivateKeyOperationReq_InBytes `protobuf_oneof:"in_bytes"` -} - -func (x *OffloadPrivateKeyOperationReq) Reset() { - *x = OffloadPrivateKeyOperationReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OffloadPrivateKeyOperationReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OffloadPrivateKeyOperationReq) ProtoMessage() {} - -func (x *OffloadPrivateKeyOperationReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OffloadPrivateKeyOperationReq.ProtoReflect.Descriptor instead. -func (*OffloadPrivateKeyOperationReq) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{5} -} - -func (x *OffloadPrivateKeyOperationReq) GetOperation() OffloadPrivateKeyOperationReq_PrivateKeyOperation { - if x != nil { - return x.Operation - } - return OffloadPrivateKeyOperationReq_UNSPECIFIED -} - -func (x *OffloadPrivateKeyOperationReq) GetSignatureAlgorithm() SignatureAlgorithm { - if x != nil { - return x.SignatureAlgorithm - } - return SignatureAlgorithm_S2A_SSL_SIGN_UNSPECIFIED -} - -func (m *OffloadPrivateKeyOperationReq) GetInBytes() isOffloadPrivateKeyOperationReq_InBytes { - if m != nil { - return m.InBytes - } - return nil -} - -func (x *OffloadPrivateKeyOperationReq) GetRawBytes() []byte { - if x, ok := x.GetInBytes().(*OffloadPrivateKeyOperationReq_RawBytes); ok { - return x.RawBytes - } - return nil -} - -func (x *OffloadPrivateKeyOperationReq) GetSha256Digest() []byte { - if x, ok := x.GetInBytes().(*OffloadPrivateKeyOperationReq_Sha256Digest); ok { - return x.Sha256Digest - } - return nil -} - -func (x *OffloadPrivateKeyOperationReq) GetSha384Digest() []byte { - if x, ok := x.GetInBytes().(*OffloadPrivateKeyOperationReq_Sha384Digest); ok { - return x.Sha384Digest - } - return nil -} - -func (x *OffloadPrivateKeyOperationReq) GetSha512Digest() []byte { - if x, ok := x.GetInBytes().(*OffloadPrivateKeyOperationReq_Sha512Digest); ok { - return x.Sha512Digest - } - return nil -} - -type isOffloadPrivateKeyOperationReq_InBytes interface { - isOffloadPrivateKeyOperationReq_InBytes() -} - -type OffloadPrivateKeyOperationReq_RawBytes struct { - // Raw bytes to be hashed and signed, or decrypted. - RawBytes []byte `protobuf:"bytes,4,opt,name=raw_bytes,json=rawBytes,proto3,oneof"` -} - -type OffloadPrivateKeyOperationReq_Sha256Digest struct { - // A SHA256 hash to be signed. Must be 32 bytes. - Sha256Digest []byte `protobuf:"bytes,5,opt,name=sha256_digest,json=sha256Digest,proto3,oneof"` -} - -type OffloadPrivateKeyOperationReq_Sha384Digest struct { - // A SHA384 hash to be signed. Must be 48 bytes. - Sha384Digest []byte `protobuf:"bytes,6,opt,name=sha384_digest,json=sha384Digest,proto3,oneof"` -} - -type OffloadPrivateKeyOperationReq_Sha512Digest struct { - // A SHA512 hash to be signed. Must be 64 bytes. - Sha512Digest []byte `protobuf:"bytes,7,opt,name=sha512_digest,json=sha512Digest,proto3,oneof"` -} - -func (*OffloadPrivateKeyOperationReq_RawBytes) isOffloadPrivateKeyOperationReq_InBytes() {} - -func (*OffloadPrivateKeyOperationReq_Sha256Digest) isOffloadPrivateKeyOperationReq_InBytes() {} - -func (*OffloadPrivateKeyOperationReq_Sha384Digest) isOffloadPrivateKeyOperationReq_InBytes() {} - -func (*OffloadPrivateKeyOperationReq_Sha512Digest) isOffloadPrivateKeyOperationReq_InBytes() {} - -type OffloadPrivateKeyOperationResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The signed or decrypted output bytes. - OutBytes []byte `protobuf:"bytes,1,opt,name=out_bytes,json=outBytes,proto3" json:"out_bytes,omitempty"` -} - -func (x *OffloadPrivateKeyOperationResp) Reset() { - *x = OffloadPrivateKeyOperationResp{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OffloadPrivateKeyOperationResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OffloadPrivateKeyOperationResp) ProtoMessage() {} - -func (x *OffloadPrivateKeyOperationResp) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OffloadPrivateKeyOperationResp.ProtoReflect.Descriptor instead. -func (*OffloadPrivateKeyOperationResp) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{6} -} - -func (x *OffloadPrivateKeyOperationResp) GetOutBytes() []byte { - if x != nil { - return x.OutBytes - } - return nil -} - -type OffloadResumptionKeyOperationReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The operation the resumption key is used for. - Operation OffloadResumptionKeyOperationReq_ResumptionKeyOperation `protobuf:"varint,1,opt,name=operation,proto3,enum=s2a.proto.v2.OffloadResumptionKeyOperationReq_ResumptionKeyOperation" json:"operation,omitempty"` - // The bytes to be encrypted or decrypted. - InBytes []byte `protobuf:"bytes,2,opt,name=in_bytes,json=inBytes,proto3" json:"in_bytes,omitempty"` -} - -func (x *OffloadResumptionKeyOperationReq) Reset() { - *x = OffloadResumptionKeyOperationReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OffloadResumptionKeyOperationReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OffloadResumptionKeyOperationReq) ProtoMessage() {} - -func (x *OffloadResumptionKeyOperationReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OffloadResumptionKeyOperationReq.ProtoReflect.Descriptor instead. -func (*OffloadResumptionKeyOperationReq) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{7} -} - -func (x *OffloadResumptionKeyOperationReq) GetOperation() OffloadResumptionKeyOperationReq_ResumptionKeyOperation { - if x != nil { - return x.Operation - } - return OffloadResumptionKeyOperationReq_UNSPECIFIED -} - -func (x *OffloadResumptionKeyOperationReq) GetInBytes() []byte { - if x != nil { - return x.InBytes - } - return nil -} - -type OffloadResumptionKeyOperationResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The encrypted or decrypted bytes. - OutBytes []byte `protobuf:"bytes,1,opt,name=out_bytes,json=outBytes,proto3" json:"out_bytes,omitempty"` -} - -func (x *OffloadResumptionKeyOperationResp) Reset() { - *x = OffloadResumptionKeyOperationResp{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OffloadResumptionKeyOperationResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OffloadResumptionKeyOperationResp) ProtoMessage() {} - -func (x *OffloadResumptionKeyOperationResp) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OffloadResumptionKeyOperationResp.ProtoReflect.Descriptor instead. -func (*OffloadResumptionKeyOperationResp) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{8} -} - -func (x *OffloadResumptionKeyOperationResp) GetOutBytes() []byte { - if x != nil { - return x.OutBytes - } - return nil -} - -type ValidatePeerCertificateChainReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The verification mode that S2A MUST use to validate the peer certificate - // chain. - Mode ValidatePeerCertificateChainReq_VerificationMode `protobuf:"varint,1,opt,name=mode,proto3,enum=s2a.proto.v2.ValidatePeerCertificateChainReq_VerificationMode" json:"mode,omitempty"` - // Types that are assignable to PeerOneof: - // - // *ValidatePeerCertificateChainReq_ClientPeer_ - // *ValidatePeerCertificateChainReq_ServerPeer_ - PeerOneof isValidatePeerCertificateChainReq_PeerOneof `protobuf_oneof:"peer_oneof"` -} - -func (x *ValidatePeerCertificateChainReq) Reset() { - *x = ValidatePeerCertificateChainReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ValidatePeerCertificateChainReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValidatePeerCertificateChainReq) ProtoMessage() {} - -func (x *ValidatePeerCertificateChainReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ValidatePeerCertificateChainReq.ProtoReflect.Descriptor instead. -func (*ValidatePeerCertificateChainReq) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{9} -} - -func (x *ValidatePeerCertificateChainReq) GetMode() ValidatePeerCertificateChainReq_VerificationMode { - if x != nil { - return x.Mode - } - return ValidatePeerCertificateChainReq_UNSPECIFIED -} - -func (m *ValidatePeerCertificateChainReq) GetPeerOneof() isValidatePeerCertificateChainReq_PeerOneof { - if m != nil { - return m.PeerOneof - } - return nil -} - -func (x *ValidatePeerCertificateChainReq) GetClientPeer() *ValidatePeerCertificateChainReq_ClientPeer { - if x, ok := x.GetPeerOneof().(*ValidatePeerCertificateChainReq_ClientPeer_); ok { - return x.ClientPeer - } - return nil -} - -func (x *ValidatePeerCertificateChainReq) GetServerPeer() *ValidatePeerCertificateChainReq_ServerPeer { - if x, ok := x.GetPeerOneof().(*ValidatePeerCertificateChainReq_ServerPeer_); ok { - return x.ServerPeer - } - return nil -} - -type isValidatePeerCertificateChainReq_PeerOneof interface { - isValidatePeerCertificateChainReq_PeerOneof() -} - -type ValidatePeerCertificateChainReq_ClientPeer_ struct { - ClientPeer *ValidatePeerCertificateChainReq_ClientPeer `protobuf:"bytes,2,opt,name=client_peer,json=clientPeer,proto3,oneof"` -} - -type ValidatePeerCertificateChainReq_ServerPeer_ struct { - ServerPeer *ValidatePeerCertificateChainReq_ServerPeer `protobuf:"bytes,3,opt,name=server_peer,json=serverPeer,proto3,oneof"` -} - -func (*ValidatePeerCertificateChainReq_ClientPeer_) isValidatePeerCertificateChainReq_PeerOneof() {} - -func (*ValidatePeerCertificateChainReq_ServerPeer_) isValidatePeerCertificateChainReq_PeerOneof() {} - -type ValidatePeerCertificateChainResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The result of validating the peer certificate chain. - ValidationResult ValidatePeerCertificateChainResp_ValidationResult `protobuf:"varint,1,opt,name=validation_result,json=validationResult,proto3,enum=s2a.proto.v2.ValidatePeerCertificateChainResp_ValidationResult" json:"validation_result,omitempty"` - // The validation details. This field is only populated when the validation - // result is NOT SUCCESS. - ValidationDetails string `protobuf:"bytes,2,opt,name=validation_details,json=validationDetails,proto3" json:"validation_details,omitempty"` - // The S2A context contains information from the peer certificate chain. - // - // The S2A context MAY be populated even if validation of the peer certificate - // chain fails. - Context *s2a_context_go_proto.S2AContext `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"` -} - -func (x *ValidatePeerCertificateChainResp) Reset() { - *x = ValidatePeerCertificateChainResp{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ValidatePeerCertificateChainResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValidatePeerCertificateChainResp) ProtoMessage() {} - -func (x *ValidatePeerCertificateChainResp) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ValidatePeerCertificateChainResp.ProtoReflect.Descriptor instead. -func (*ValidatePeerCertificateChainResp) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{10} -} - -func (x *ValidatePeerCertificateChainResp) GetValidationResult() ValidatePeerCertificateChainResp_ValidationResult { - if x != nil { - return x.ValidationResult - } - return ValidatePeerCertificateChainResp_UNSPECIFIED -} - -func (x *ValidatePeerCertificateChainResp) GetValidationDetails() string { - if x != nil { - return x.ValidationDetails - } - return "" -} - -func (x *ValidatePeerCertificateChainResp) GetContext() *s2a_context_go_proto.S2AContext { - if x != nil { - return x.Context - } - return nil -} - -type SessionReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The identity corresponding to the TLS configurations that MUST be used for - // the TLS handshake. - // - // If a managed identity already exists, the local identity and authentication - // mechanisms are ignored. If a managed identity doesn't exist and the local - // identity is not populated, S2A will try to deduce the managed identity to - // use from the SNI extension. If that also fails, S2A uses the default - // identity (if one exists). - LocalIdentity *common_go_proto1.Identity `protobuf:"bytes,1,opt,name=local_identity,json=localIdentity,proto3" json:"local_identity,omitempty"` - // The authentication mechanisms that the application wishes to use to - // authenticate to S2A, ordered by preference. S2A will always use the first - // authentication mechanism that matches the managed identity. - AuthenticationMechanisms []*AuthenticationMechanism `protobuf:"bytes,2,rep,name=authentication_mechanisms,json=authenticationMechanisms,proto3" json:"authentication_mechanisms,omitempty"` - // Types that are assignable to ReqOneof: - // - // *SessionReq_GetTlsConfigurationReq - // *SessionReq_OffloadPrivateKeyOperationReq - // *SessionReq_OffloadResumptionKeyOperationReq - // *SessionReq_ValidatePeerCertificateChainReq - ReqOneof isSessionReq_ReqOneof `protobuf_oneof:"req_oneof"` -} - -func (x *SessionReq) Reset() { - *x = SessionReq{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionReq) ProtoMessage() {} - -func (x *SessionReq) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionReq.ProtoReflect.Descriptor instead. -func (*SessionReq) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{11} -} - -func (x *SessionReq) GetLocalIdentity() *common_go_proto1.Identity { - if x != nil { - return x.LocalIdentity - } - return nil -} - -func (x *SessionReq) GetAuthenticationMechanisms() []*AuthenticationMechanism { - if x != nil { - return x.AuthenticationMechanisms - } - return nil -} - -func (m *SessionReq) GetReqOneof() isSessionReq_ReqOneof { - if m != nil { - return m.ReqOneof - } - return nil -} - -func (x *SessionReq) GetGetTlsConfigurationReq() *GetTlsConfigurationReq { - if x, ok := x.GetReqOneof().(*SessionReq_GetTlsConfigurationReq); ok { - return x.GetTlsConfigurationReq - } - return nil -} - -func (x *SessionReq) GetOffloadPrivateKeyOperationReq() *OffloadPrivateKeyOperationReq { - if x, ok := x.GetReqOneof().(*SessionReq_OffloadPrivateKeyOperationReq); ok { - return x.OffloadPrivateKeyOperationReq - } - return nil -} - -func (x *SessionReq) GetOffloadResumptionKeyOperationReq() *OffloadResumptionKeyOperationReq { - if x, ok := x.GetReqOneof().(*SessionReq_OffloadResumptionKeyOperationReq); ok { - return x.OffloadResumptionKeyOperationReq - } - return nil -} - -func (x *SessionReq) GetValidatePeerCertificateChainReq() *ValidatePeerCertificateChainReq { - if x, ok := x.GetReqOneof().(*SessionReq_ValidatePeerCertificateChainReq); ok { - return x.ValidatePeerCertificateChainReq - } - return nil -} - -type isSessionReq_ReqOneof interface { - isSessionReq_ReqOneof() -} - -type SessionReq_GetTlsConfigurationReq struct { - // Requests the certificate chain and TLS configuration corresponding to the - // local identity, which the application MUST use to negotiate the TLS - // handshake. - GetTlsConfigurationReq *GetTlsConfigurationReq `protobuf:"bytes,3,opt,name=get_tls_configuration_req,json=getTlsConfigurationReq,proto3,oneof"` -} - -type SessionReq_OffloadPrivateKeyOperationReq struct { - // Signs or decrypts the input bytes using a private key corresponding to - // the local identity in the request. - // - // WARNING: More than one OffloadPrivateKeyOperationReq may be sent to the - // S2Av2 by a server during a TLS 1.2 handshake. - OffloadPrivateKeyOperationReq *OffloadPrivateKeyOperationReq `protobuf:"bytes,4,opt,name=offload_private_key_operation_req,json=offloadPrivateKeyOperationReq,proto3,oneof"` -} - -type SessionReq_OffloadResumptionKeyOperationReq struct { - // Encrypts or decrypts the input bytes using a resumption key corresponding - // to the local identity in the request. - OffloadResumptionKeyOperationReq *OffloadResumptionKeyOperationReq `protobuf:"bytes,5,opt,name=offload_resumption_key_operation_req,json=offloadResumptionKeyOperationReq,proto3,oneof"` -} - -type SessionReq_ValidatePeerCertificateChainReq struct { - // Verifies the peer's certificate chain using - // (a) trust bundles corresponding to the local identity in the request, and - // (b) the verification mode in the request. - ValidatePeerCertificateChainReq *ValidatePeerCertificateChainReq `protobuf:"bytes,6,opt,name=validate_peer_certificate_chain_req,json=validatePeerCertificateChainReq,proto3,oneof"` -} - -func (*SessionReq_GetTlsConfigurationReq) isSessionReq_ReqOneof() {} - -func (*SessionReq_OffloadPrivateKeyOperationReq) isSessionReq_ReqOneof() {} - -func (*SessionReq_OffloadResumptionKeyOperationReq) isSessionReq_ReqOneof() {} - -func (*SessionReq_ValidatePeerCertificateChainReq) isSessionReq_ReqOneof() {} - -type SessionResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status of the session response. - // - // The status field is populated so that if an error occurs when making an - // individual request, then communication with the S2A may continue. If an - // error is returned directly (e.g. at the gRPC layer), then it may result - // that the bidirectional stream being closed. - Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` - // Types that are assignable to RespOneof: - // - // *SessionResp_GetTlsConfigurationResp - // *SessionResp_OffloadPrivateKeyOperationResp - // *SessionResp_OffloadResumptionKeyOperationResp - // *SessionResp_ValidatePeerCertificateChainResp - RespOneof isSessionResp_RespOneof `protobuf_oneof:"resp_oneof"` -} - -func (x *SessionResp) Reset() { - *x = SessionResp{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionResp) ProtoMessage() {} - -func (x *SessionResp) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionResp.ProtoReflect.Descriptor instead. -func (*SessionResp) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{12} -} - -func (x *SessionResp) GetStatus() *Status { - if x != nil { - return x.Status - } - return nil -} - -func (m *SessionResp) GetRespOneof() isSessionResp_RespOneof { - if m != nil { - return m.RespOneof - } - return nil -} - -func (x *SessionResp) GetGetTlsConfigurationResp() *GetTlsConfigurationResp { - if x, ok := x.GetRespOneof().(*SessionResp_GetTlsConfigurationResp); ok { - return x.GetTlsConfigurationResp - } - return nil -} - -func (x *SessionResp) GetOffloadPrivateKeyOperationResp() *OffloadPrivateKeyOperationResp { - if x, ok := x.GetRespOneof().(*SessionResp_OffloadPrivateKeyOperationResp); ok { - return x.OffloadPrivateKeyOperationResp - } - return nil -} - -func (x *SessionResp) GetOffloadResumptionKeyOperationResp() *OffloadResumptionKeyOperationResp { - if x, ok := x.GetRespOneof().(*SessionResp_OffloadResumptionKeyOperationResp); ok { - return x.OffloadResumptionKeyOperationResp - } - return nil -} - -func (x *SessionResp) GetValidatePeerCertificateChainResp() *ValidatePeerCertificateChainResp { - if x, ok := x.GetRespOneof().(*SessionResp_ValidatePeerCertificateChainResp); ok { - return x.ValidatePeerCertificateChainResp - } - return nil -} - -type isSessionResp_RespOneof interface { - isSessionResp_RespOneof() -} - -type SessionResp_GetTlsConfigurationResp struct { - // Contains the certificate chain and TLS configurations corresponding to - // the local identity. - GetTlsConfigurationResp *GetTlsConfigurationResp `protobuf:"bytes,2,opt,name=get_tls_configuration_resp,json=getTlsConfigurationResp,proto3,oneof"` -} - -type SessionResp_OffloadPrivateKeyOperationResp struct { - // Contains the signed or encrypted output bytes using the private key - // corresponding to the local identity. - OffloadPrivateKeyOperationResp *OffloadPrivateKeyOperationResp `protobuf:"bytes,3,opt,name=offload_private_key_operation_resp,json=offloadPrivateKeyOperationResp,proto3,oneof"` -} - -type SessionResp_OffloadResumptionKeyOperationResp struct { - // Contains the encrypted or decrypted output bytes using the resumption key - // corresponding to the local identity. - OffloadResumptionKeyOperationResp *OffloadResumptionKeyOperationResp `protobuf:"bytes,4,opt,name=offload_resumption_key_operation_resp,json=offloadResumptionKeyOperationResp,proto3,oneof"` -} - -type SessionResp_ValidatePeerCertificateChainResp struct { - // Contains the validation result, peer identity and fingerprints of peer - // certificates. - ValidatePeerCertificateChainResp *ValidatePeerCertificateChainResp `protobuf:"bytes,5,opt,name=validate_peer_certificate_chain_resp,json=validatePeerCertificateChainResp,proto3,oneof"` -} - -func (*SessionResp_GetTlsConfigurationResp) isSessionResp_RespOneof() {} - -func (*SessionResp_OffloadPrivateKeyOperationResp) isSessionResp_RespOneof() {} - -func (*SessionResp_OffloadResumptionKeyOperationResp) isSessionResp_RespOneof() {} - -func (*SessionResp_ValidatePeerCertificateChainResp) isSessionResp_RespOneof() {} - -// Next ID: 8 -type GetTlsConfigurationResp_ClientTlsConfiguration struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The certificate chain that the client MUST use for the TLS handshake. - // It's a list of PEM-encoded certificates, ordered from leaf to root, - // excluding the root. - CertificateChain []string `protobuf:"bytes,1,rep,name=certificate_chain,json=certificateChain,proto3" json:"certificate_chain,omitempty"` - // The minimum TLS version number that the client MUST use for the TLS - // handshake. If this field is not provided, the client MUST use the default - // minimum version of the client's TLS library. - MinTlsVersion common_go_proto.TLSVersion `protobuf:"varint,2,opt,name=min_tls_version,json=minTlsVersion,proto3,enum=s2a.proto.v2.TLSVersion" json:"min_tls_version,omitempty"` - // The maximum TLS version number that the client MUST use for the TLS - // handshake. If this field is not provided, the client MUST use the default - // maximum version of the client's TLS library. - MaxTlsVersion common_go_proto.TLSVersion `protobuf:"varint,3,opt,name=max_tls_version,json=maxTlsVersion,proto3,enum=s2a.proto.v2.TLSVersion" json:"max_tls_version,omitempty"` - // The ordered list of TLS 1.0-1.2 ciphersuites that the client MAY offer to - // negotiate in the TLS handshake. - Ciphersuites []common_go_proto.Ciphersuite `protobuf:"varint,6,rep,packed,name=ciphersuites,proto3,enum=s2a.proto.v2.Ciphersuite" json:"ciphersuites,omitempty"` - // The policy that dictates how the client negotiates ALPN during the TLS - // handshake. - AlpnPolicy *AlpnPolicy `protobuf:"bytes,7,opt,name=alpn_policy,json=alpnPolicy,proto3" json:"alpn_policy,omitempty"` -} - -func (x *GetTlsConfigurationResp_ClientTlsConfiguration) Reset() { - *x = GetTlsConfigurationResp_ClientTlsConfiguration{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTlsConfigurationResp_ClientTlsConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTlsConfigurationResp_ClientTlsConfiguration) ProtoMessage() {} - -func (x *GetTlsConfigurationResp_ClientTlsConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTlsConfigurationResp_ClientTlsConfiguration.ProtoReflect.Descriptor instead. -func (*GetTlsConfigurationResp_ClientTlsConfiguration) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{4, 0} -} - -func (x *GetTlsConfigurationResp_ClientTlsConfiguration) GetCertificateChain() []string { - if x != nil { - return x.CertificateChain - } - return nil -} - -func (x *GetTlsConfigurationResp_ClientTlsConfiguration) GetMinTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.MinTlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *GetTlsConfigurationResp_ClientTlsConfiguration) GetMaxTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.MaxTlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *GetTlsConfigurationResp_ClientTlsConfiguration) GetCiphersuites() []common_go_proto.Ciphersuite { - if x != nil { - return x.Ciphersuites - } - return nil -} - -func (x *GetTlsConfigurationResp_ClientTlsConfiguration) GetAlpnPolicy() *AlpnPolicy { - if x != nil { - return x.AlpnPolicy - } - return nil -} - -// Next ID: 12 -type GetTlsConfigurationResp_ServerTlsConfiguration struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The certificate chain that the server MUST use for the TLS handshake. - // It's a list of PEM-encoded certificates, ordered from leaf to root, - // excluding the root. - CertificateChain []string `protobuf:"bytes,1,rep,name=certificate_chain,json=certificateChain,proto3" json:"certificate_chain,omitempty"` - // The minimum TLS version number that the server MUST use for the TLS - // handshake. If this field is not provided, the server MUST use the default - // minimum version of the server's TLS library. - MinTlsVersion common_go_proto.TLSVersion `protobuf:"varint,2,opt,name=min_tls_version,json=minTlsVersion,proto3,enum=s2a.proto.v2.TLSVersion" json:"min_tls_version,omitempty"` - // The maximum TLS version number that the server MUST use for the TLS - // handshake. If this field is not provided, the server MUST use the default - // maximum version of the server's TLS library. - MaxTlsVersion common_go_proto.TLSVersion `protobuf:"varint,3,opt,name=max_tls_version,json=maxTlsVersion,proto3,enum=s2a.proto.v2.TLSVersion" json:"max_tls_version,omitempty"` - // The ordered list of TLS 1.0-1.2 ciphersuites that the server MAY offer to - // negotiate in the TLS handshake. - Ciphersuites []common_go_proto.Ciphersuite `protobuf:"varint,10,rep,packed,name=ciphersuites,proto3,enum=s2a.proto.v2.Ciphersuite" json:"ciphersuites,omitempty"` - // Whether to enable TLS resumption. - TlsResumptionEnabled bool `protobuf:"varint,6,opt,name=tls_resumption_enabled,json=tlsResumptionEnabled,proto3" json:"tls_resumption_enabled,omitempty"` - // Whether the server MUST request a client certificate (i.e. to negotiate - // TLS vs. mTLS). - RequestClientCertificate GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate `protobuf:"varint,7,opt,name=request_client_certificate,json=requestClientCertificate,proto3,enum=s2a.proto.v2.GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate" json:"request_client_certificate,omitempty"` - // Returns the maximum number of extra bytes that - // |OffloadResumptionKeyOperation| can add to the number of unencrypted - // bytes to form the encrypted bytes. - MaxOverheadOfTicketAead uint32 `protobuf:"varint,9,opt,name=max_overhead_of_ticket_aead,json=maxOverheadOfTicketAead,proto3" json:"max_overhead_of_ticket_aead,omitempty"` - // The policy that dictates how the server negotiates ALPN during the TLS - // handshake. - AlpnPolicy *AlpnPolicy `protobuf:"bytes,11,opt,name=alpn_policy,json=alpnPolicy,proto3" json:"alpn_policy,omitempty"` -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) Reset() { - *x = GetTlsConfigurationResp_ServerTlsConfiguration{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTlsConfigurationResp_ServerTlsConfiguration) ProtoMessage() {} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTlsConfigurationResp_ServerTlsConfiguration.ProtoReflect.Descriptor instead. -func (*GetTlsConfigurationResp_ServerTlsConfiguration) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{4, 1} -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) GetCertificateChain() []string { - if x != nil { - return x.CertificateChain - } - return nil -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) GetMinTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.MinTlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) GetMaxTlsVersion() common_go_proto.TLSVersion { - if x != nil { - return x.MaxTlsVersion - } - return common_go_proto.TLSVersion(0) -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) GetCiphersuites() []common_go_proto.Ciphersuite { - if x != nil { - return x.Ciphersuites - } - return nil -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) GetTlsResumptionEnabled() bool { - if x != nil { - return x.TlsResumptionEnabled - } - return false -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) GetRequestClientCertificate() GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate { - if x != nil { - return x.RequestClientCertificate - } - return GetTlsConfigurationResp_ServerTlsConfiguration_UNSPECIFIED -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) GetMaxOverheadOfTicketAead() uint32 { - if x != nil { - return x.MaxOverheadOfTicketAead - } - return 0 -} - -func (x *GetTlsConfigurationResp_ServerTlsConfiguration) GetAlpnPolicy() *AlpnPolicy { - if x != nil { - return x.AlpnPolicy - } - return nil -} - -type ValidatePeerCertificateChainReq_ClientPeer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The certificate chain to be verified. The chain MUST be a list of - // DER-encoded certificates, ordered from leaf to root, excluding the root. - CertificateChain [][]byte `protobuf:"bytes,1,rep,name=certificate_chain,json=certificateChain,proto3" json:"certificate_chain,omitempty"` -} - -func (x *ValidatePeerCertificateChainReq_ClientPeer) Reset() { - *x = ValidatePeerCertificateChainReq_ClientPeer{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ValidatePeerCertificateChainReq_ClientPeer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValidatePeerCertificateChainReq_ClientPeer) ProtoMessage() {} - -func (x *ValidatePeerCertificateChainReq_ClientPeer) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ValidatePeerCertificateChainReq_ClientPeer.ProtoReflect.Descriptor instead. -func (*ValidatePeerCertificateChainReq_ClientPeer) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{9, 0} -} - -func (x *ValidatePeerCertificateChainReq_ClientPeer) GetCertificateChain() [][]byte { - if x != nil { - return x.CertificateChain - } - return nil -} - -type ValidatePeerCertificateChainReq_ServerPeer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The certificate chain to be verified. The chain MUST be a list of - // DER-encoded certificates, ordered from leaf to root, excluding the root. - CertificateChain [][]byte `protobuf:"bytes,1,rep,name=certificate_chain,json=certificateChain,proto3" json:"certificate_chain,omitempty"` - // The expected hostname of the server. - ServerHostname string `protobuf:"bytes,2,opt,name=server_hostname,json=serverHostname,proto3" json:"server_hostname,omitempty"` - // The UnrestrictedClientPolicy specified by the user. - SerializedUnrestrictedClientPolicy []byte `protobuf:"bytes,3,opt,name=serialized_unrestricted_client_policy,json=serializedUnrestrictedClientPolicy,proto3" json:"serialized_unrestricted_client_policy,omitempty"` -} - -func (x *ValidatePeerCertificateChainReq_ServerPeer) Reset() { - *x = ValidatePeerCertificateChainReq_ServerPeer{} - if protoimpl.UnsafeEnabled { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ValidatePeerCertificateChainReq_ServerPeer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValidatePeerCertificateChainReq_ServerPeer) ProtoMessage() {} - -func (x *ValidatePeerCertificateChainReq_ServerPeer) ProtoReflect() protoreflect.Message { - mi := &file_internal_proto_v2_s2a_s2a_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ValidatePeerCertificateChainReq_ServerPeer.ProtoReflect.Descriptor instead. -func (*ValidatePeerCertificateChainReq_ServerPeer) Descriptor() ([]byte, []int) { - return file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP(), []int{9, 1} -} - -func (x *ValidatePeerCertificateChainReq_ServerPeer) GetCertificateChain() [][]byte { - if x != nil { - return x.CertificateChain - } - return nil -} - -func (x *ValidatePeerCertificateChainReq_ServerPeer) GetServerHostname() string { - if x != nil { - return x.ServerHostname - } - return "" -} - -func (x *ValidatePeerCertificateChainReq_ServerPeer) GetSerializedUnrestrictedClientPolicy() []byte { - if x != nil { - return x.SerializedUnrestrictedClientPolicy - } - return nil -} - -var File_internal_proto_v2_s2a_s2a_proto protoreflect.FileDescriptor - -var file_internal_proto_v2_s2a_s2a_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x2f, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0c, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x1a, - 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, - 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, 0x0a, 0x0a, - 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x36, 0x0a, 0x17, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x6e, 0x65, 0x67, 0x6f, 0x74, 0x69, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x70, 0x6e, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0e, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x73, 0x32, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x0d, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x22, 0x75, 0x0a, 0x17, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, - 0x12, 0x2f, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x6d, 0x65, 0x63, - 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x22, 0x36, 0x0a, 0x06, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x22, 0x71, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x45, - 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x64, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x69, 0x64, 0x65, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x69, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x6e, 0x69, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x73, 0x6e, 0x69, 0x22, 0xf1, 0x0b, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x54, - 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x78, 0x0a, 0x18, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6c, - 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x16, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x78, 0x0a, - 0x18, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x3c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, - 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, - 0x16, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xcf, 0x02, 0x0a, 0x16, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x12, - 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, - 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, - 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, 0x69, 0x74, - 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x52, 0x0a, 0x61, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x4a, 0x04, 0x08, - 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x1a, 0xfa, 0x06, 0x0a, 0x16, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, - 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x69, 0x6e, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, - 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x54, 0x4c, 0x53, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x54, 0x6c, 0x73, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, - 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x73, 0x32, - 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, - 0x72, 0x73, 0x75, 0x69, 0x74, 0x65, 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x75, - 0x69, 0x74, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x74, 0x6c, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x75, - 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x74, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x93, 0x01, 0x0a, 0x1a, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x55, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, - 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x18, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x12, 0x3c, 0x0a, 0x1b, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, - 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x61, 0x65, 0x61, 0x64, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x6d, 0x61, 0x78, 0x4f, 0x76, 0x65, 0x72, 0x68, 0x65, - 0x61, 0x64, 0x4f, 0x66, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x65, 0x61, 0x64, 0x12, 0x39, - 0x0a, 0x0b, 0x61, 0x6c, 0x70, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x76, 0x32, 0x2e, 0x41, 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0a, 0x61, - 0x6c, 0x70, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x9e, 0x02, 0x0a, 0x18, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x44, 0x4f, 0x4e, 0x54, 0x5f, - 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, - 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x2e, 0x0a, 0x2a, - 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, - 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x44, - 0x4f, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x02, 0x12, 0x29, 0x0a, 0x25, - 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, - 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x56, - 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x03, 0x12, 0x3a, 0x0a, 0x36, 0x52, 0x45, 0x51, 0x55, 0x45, - 0x53, 0x54, 0x5f, 0x41, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5f, 0x43, - 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, - 0x45, 0x5f, 0x42, 0x55, 0x54, 0x5f, 0x44, 0x4f, 0x4e, 0x54, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, - 0x59, 0x10, 0x04, 0x12, 0x35, 0x0a, 0x31, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x41, - 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x45, 0x4e, - 0x54, 0x5f, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x4e, - 0x44, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, - 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x42, 0x13, 0x0a, 0x11, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb0, 0x03, 0x0a, 0x1d, - 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, - 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x5d, 0x0a, - 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, - 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, - 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x50, 0x72, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x13, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x73, 0x32, 0x61, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x12, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, - 0x1d, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x48, 0x00, 0x52, 0x08, 0x72, 0x61, 0x77, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x25, - 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x44, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x5f, - 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, - 0x73, 0x68, 0x61, 0x33, 0x38, 0x34, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0d, - 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x35, 0x31, 0x32, 0x44, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, - 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x53, - 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x52, 0x59, 0x50, 0x54, - 0x10, 0x02, 0x42, 0x0a, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x3d, - 0x0a, 0x1e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe7, 0x01, - 0x0a, 0x20, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x12, 0x63, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x45, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, - 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6e, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x69, 0x6e, 0x42, 0x79, 0x74, - 0x65, 0x73, 0x22, 0x43, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x45, 0x4e, 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, - 0x43, 0x52, 0x59, 0x50, 0x54, 0x10, 0x02, 0x22, 0x40, 0x0a, 0x21, 0x4f, 0x66, 0x66, 0x6c, 0x6f, - 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x09, - 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x08, 0x6f, 0x75, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xf8, 0x04, 0x0a, 0x1f, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x52, 0x0a, - 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x73, 0x32, - 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, - 0x65, 0x12, 0x5b, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x65, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, - 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, - 0x48, 0x00, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x5b, - 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, - 0x65, 0x71, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x48, 0x00, 0x52, - 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0a, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x1a, 0xb5, 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, - 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x68, 0x6f, 0x73, - 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x51, 0x0a, 0x25, 0x73, - 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x73, 0x74, - 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x22, 0x73, 0x65, 0x72, 0x69, - 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, - 0x65, 0x64, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x46, - 0x0a, 0x10, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, - 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x50, 0x49, 0x46, 0x46, 0x45, 0x10, 0x01, 0x12, - 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x4f, 0x5f, 0x47, 0x4f, - 0x4f, 0x47, 0x4c, 0x45, 0x10, 0x02, 0x42, 0x0c, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6f, - 0x6e, 0x65, 0x6f, 0x66, 0x22, 0xb2, 0x02, 0x0a, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x6c, 0x0a, 0x11, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, - 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x32, 0x41, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3d, 0x0a, 0x10, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0f, - 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, - 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x22, 0x97, 0x05, 0x0a, 0x0a, 0x53, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x3a, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x49, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x12, 0x62, 0x0a, 0x19, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x52, 0x18, - 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, - 0x63, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x6d, 0x73, 0x12, 0x61, 0x0a, 0x19, 0x67, 0x65, 0x74, 0x5f, - 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x32, - 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, - 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x48, 0x00, 0x52, 0x16, 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x77, 0x0a, 0x21, 0x6f, - 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, - 0x65, 0x79, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1d, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, - 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x20, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, - 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x7d, 0x0a, 0x23, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, - 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, - 0x52, 0x65, 0x71, 0x48, 0x00, 0x52, 0x1f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x5f, 0x6f, 0x6e, - 0x65, 0x6f, 0x66, 0x22, 0xb4, 0x04, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x64, 0x0a, 0x1a, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x17, - 0x67, 0x65, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x7a, 0x0a, 0x22, 0x6f, 0x66, 0x66, 0x6c, 0x6f, - 0x61, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x48, 0x00, 0x52, 0x1e, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x83, 0x01, 0x0a, 0x25, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x5f, - 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x21, 0x6f, 0x66, 0x66, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x80, 0x01, 0x0a, 0x24, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65, - 0x73, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, - 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x48, 0x00, 0x52, 0x20, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0c, 0x0a, 0x0a, - 0x72, 0x65, 0x73, 0x70, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2a, 0xa2, 0x03, 0x0a, 0x12, 0x53, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, - 0x6d, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, - 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, - 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, - 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, - 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, 0x53, 0x48, 0x41, - 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, - 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x4b, 0x43, 0x53, 0x31, 0x5f, - 0x53, 0x48, 0x41, 0x35, 0x31, 0x32, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f, - 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, - 0x45, 0x43, 0x50, 0x32, 0x35, 0x36, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, - 0x04, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, - 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x33, 0x38, 0x34, 0x52, - 0x31, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x05, 0x12, 0x27, 0x0a, 0x23, 0x53, 0x32, - 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x43, 0x44, 0x53, 0x41, - 0x5f, 0x53, 0x45, 0x43, 0x50, 0x35, 0x32, 0x31, 0x52, 0x31, 0x5f, 0x53, 0x48, 0x41, 0x35, 0x31, - 0x32, 0x10, 0x06, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, - 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, - 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x07, 0x12, 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, - 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53, - 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x33, 0x38, 0x34, 0x10, 0x08, 0x12, - 0x24, 0x0a, 0x20, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, - 0x52, 0x53, 0x41, 0x5f, 0x50, 0x53, 0x53, 0x5f, 0x52, 0x53, 0x41, 0x45, 0x5f, 0x53, 0x48, 0x41, - 0x35, 0x31, 0x32, 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x32, 0x41, 0x5f, 0x53, 0x53, 0x4c, - 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x5f, 0x45, 0x44, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x0a, 0x32, - 0x57, 0x0a, 0x0a, 0x53, 0x32, 0x41, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x49, 0x0a, - 0x0c, 0x53, 0x65, 0x74, 0x55, 0x70, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x2e, - 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x73, 0x32, 0x61, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x73, 0x32, - 0x61, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x32, 0x61, 0x5f, 0x67, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_internal_proto_v2_s2a_s2a_proto_rawDescOnce sync.Once - file_internal_proto_v2_s2a_s2a_proto_rawDescData = file_internal_proto_v2_s2a_s2a_proto_rawDesc -) - -func file_internal_proto_v2_s2a_s2a_proto_rawDescGZIP() []byte { - file_internal_proto_v2_s2a_s2a_proto_rawDescOnce.Do(func() { - file_internal_proto_v2_s2a_s2a_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_proto_v2_s2a_s2a_proto_rawDescData) - }) - return file_internal_proto_v2_s2a_s2a_proto_rawDescData -} - -var file_internal_proto_v2_s2a_s2a_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_internal_proto_v2_s2a_s2a_proto_msgTypes = make([]protoimpl.MessageInfo, 17) -var file_internal_proto_v2_s2a_s2a_proto_goTypes = []interface{}{ - (SignatureAlgorithm)(0), // 0: s2a.proto.v2.SignatureAlgorithm - (GetTlsConfigurationResp_ServerTlsConfiguration_RequestClientCertificate)(0), // 1: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.RequestClientCertificate - (OffloadPrivateKeyOperationReq_PrivateKeyOperation)(0), // 2: s2a.proto.v2.OffloadPrivateKeyOperationReq.PrivateKeyOperation - (OffloadResumptionKeyOperationReq_ResumptionKeyOperation)(0), // 3: s2a.proto.v2.OffloadResumptionKeyOperationReq.ResumptionKeyOperation - (ValidatePeerCertificateChainReq_VerificationMode)(0), // 4: s2a.proto.v2.ValidatePeerCertificateChainReq.VerificationMode - (ValidatePeerCertificateChainResp_ValidationResult)(0), // 5: s2a.proto.v2.ValidatePeerCertificateChainResp.ValidationResult - (*AlpnPolicy)(nil), // 6: s2a.proto.v2.AlpnPolicy - (*AuthenticationMechanism)(nil), // 7: s2a.proto.v2.AuthenticationMechanism - (*Status)(nil), // 8: s2a.proto.v2.Status - (*GetTlsConfigurationReq)(nil), // 9: s2a.proto.v2.GetTlsConfigurationReq - (*GetTlsConfigurationResp)(nil), // 10: s2a.proto.v2.GetTlsConfigurationResp - (*OffloadPrivateKeyOperationReq)(nil), // 11: s2a.proto.v2.OffloadPrivateKeyOperationReq - (*OffloadPrivateKeyOperationResp)(nil), // 12: s2a.proto.v2.OffloadPrivateKeyOperationResp - (*OffloadResumptionKeyOperationReq)(nil), // 13: s2a.proto.v2.OffloadResumptionKeyOperationReq - (*OffloadResumptionKeyOperationResp)(nil), // 14: s2a.proto.v2.OffloadResumptionKeyOperationResp - (*ValidatePeerCertificateChainReq)(nil), // 15: s2a.proto.v2.ValidatePeerCertificateChainReq - (*ValidatePeerCertificateChainResp)(nil), // 16: s2a.proto.v2.ValidatePeerCertificateChainResp - (*SessionReq)(nil), // 17: s2a.proto.v2.SessionReq - (*SessionResp)(nil), // 18: s2a.proto.v2.SessionResp - (*GetTlsConfigurationResp_ClientTlsConfiguration)(nil), // 19: s2a.proto.v2.GetTlsConfigurationResp.ClientTlsConfiguration - (*GetTlsConfigurationResp_ServerTlsConfiguration)(nil), // 20: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration - (*ValidatePeerCertificateChainReq_ClientPeer)(nil), // 21: s2a.proto.v2.ValidatePeerCertificateChainReq.ClientPeer - (*ValidatePeerCertificateChainReq_ServerPeer)(nil), // 22: s2a.proto.v2.ValidatePeerCertificateChainReq.ServerPeer - (common_go_proto.AlpnProtocol)(0), // 23: s2a.proto.v2.AlpnProtocol - (*common_go_proto1.Identity)(nil), // 24: s2a.proto.Identity - (common_go_proto.ConnectionSide)(0), // 25: s2a.proto.v2.ConnectionSide - (*s2a_context_go_proto.S2AContext)(nil), // 26: s2a.proto.v2.S2AContext - (common_go_proto.TLSVersion)(0), // 27: s2a.proto.v2.TLSVersion - (common_go_proto.Ciphersuite)(0), // 28: s2a.proto.v2.Ciphersuite -} -var file_internal_proto_v2_s2a_s2a_proto_depIdxs = []int32{ - 23, // 0: s2a.proto.v2.AlpnPolicy.alpn_protocols:type_name -> s2a.proto.v2.AlpnProtocol - 24, // 1: s2a.proto.v2.AuthenticationMechanism.identity:type_name -> s2a.proto.Identity - 25, // 2: s2a.proto.v2.GetTlsConfigurationReq.connection_side:type_name -> s2a.proto.v2.ConnectionSide - 19, // 3: s2a.proto.v2.GetTlsConfigurationResp.client_tls_configuration:type_name -> s2a.proto.v2.GetTlsConfigurationResp.ClientTlsConfiguration - 20, // 4: s2a.proto.v2.GetTlsConfigurationResp.server_tls_configuration:type_name -> s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration - 2, // 5: s2a.proto.v2.OffloadPrivateKeyOperationReq.operation:type_name -> s2a.proto.v2.OffloadPrivateKeyOperationReq.PrivateKeyOperation - 0, // 6: s2a.proto.v2.OffloadPrivateKeyOperationReq.signature_algorithm:type_name -> s2a.proto.v2.SignatureAlgorithm - 3, // 7: s2a.proto.v2.OffloadResumptionKeyOperationReq.operation:type_name -> s2a.proto.v2.OffloadResumptionKeyOperationReq.ResumptionKeyOperation - 4, // 8: s2a.proto.v2.ValidatePeerCertificateChainReq.mode:type_name -> s2a.proto.v2.ValidatePeerCertificateChainReq.VerificationMode - 21, // 9: s2a.proto.v2.ValidatePeerCertificateChainReq.client_peer:type_name -> s2a.proto.v2.ValidatePeerCertificateChainReq.ClientPeer - 22, // 10: s2a.proto.v2.ValidatePeerCertificateChainReq.server_peer:type_name -> s2a.proto.v2.ValidatePeerCertificateChainReq.ServerPeer - 5, // 11: s2a.proto.v2.ValidatePeerCertificateChainResp.validation_result:type_name -> s2a.proto.v2.ValidatePeerCertificateChainResp.ValidationResult - 26, // 12: s2a.proto.v2.ValidatePeerCertificateChainResp.context:type_name -> s2a.proto.v2.S2AContext - 24, // 13: s2a.proto.v2.SessionReq.local_identity:type_name -> s2a.proto.Identity - 7, // 14: s2a.proto.v2.SessionReq.authentication_mechanisms:type_name -> s2a.proto.v2.AuthenticationMechanism - 9, // 15: s2a.proto.v2.SessionReq.get_tls_configuration_req:type_name -> s2a.proto.v2.GetTlsConfigurationReq - 11, // 16: s2a.proto.v2.SessionReq.offload_private_key_operation_req:type_name -> s2a.proto.v2.OffloadPrivateKeyOperationReq - 13, // 17: s2a.proto.v2.SessionReq.offload_resumption_key_operation_req:type_name -> s2a.proto.v2.OffloadResumptionKeyOperationReq - 15, // 18: s2a.proto.v2.SessionReq.validate_peer_certificate_chain_req:type_name -> s2a.proto.v2.ValidatePeerCertificateChainReq - 8, // 19: s2a.proto.v2.SessionResp.status:type_name -> s2a.proto.v2.Status - 10, // 20: s2a.proto.v2.SessionResp.get_tls_configuration_resp:type_name -> s2a.proto.v2.GetTlsConfigurationResp - 12, // 21: s2a.proto.v2.SessionResp.offload_private_key_operation_resp:type_name -> s2a.proto.v2.OffloadPrivateKeyOperationResp - 14, // 22: s2a.proto.v2.SessionResp.offload_resumption_key_operation_resp:type_name -> s2a.proto.v2.OffloadResumptionKeyOperationResp - 16, // 23: s2a.proto.v2.SessionResp.validate_peer_certificate_chain_resp:type_name -> s2a.proto.v2.ValidatePeerCertificateChainResp - 27, // 24: s2a.proto.v2.GetTlsConfigurationResp.ClientTlsConfiguration.min_tls_version:type_name -> s2a.proto.v2.TLSVersion - 27, // 25: s2a.proto.v2.GetTlsConfigurationResp.ClientTlsConfiguration.max_tls_version:type_name -> s2a.proto.v2.TLSVersion - 28, // 26: s2a.proto.v2.GetTlsConfigurationResp.ClientTlsConfiguration.ciphersuites:type_name -> s2a.proto.v2.Ciphersuite - 6, // 27: s2a.proto.v2.GetTlsConfigurationResp.ClientTlsConfiguration.alpn_policy:type_name -> s2a.proto.v2.AlpnPolicy - 27, // 28: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.min_tls_version:type_name -> s2a.proto.v2.TLSVersion - 27, // 29: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.max_tls_version:type_name -> s2a.proto.v2.TLSVersion - 28, // 30: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.ciphersuites:type_name -> s2a.proto.v2.Ciphersuite - 1, // 31: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.request_client_certificate:type_name -> s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.RequestClientCertificate - 6, // 32: s2a.proto.v2.GetTlsConfigurationResp.ServerTlsConfiguration.alpn_policy:type_name -> s2a.proto.v2.AlpnPolicy - 17, // 33: s2a.proto.v2.S2AService.SetUpSession:input_type -> s2a.proto.v2.SessionReq - 18, // 34: s2a.proto.v2.S2AService.SetUpSession:output_type -> s2a.proto.v2.SessionResp - 34, // [34:35] is the sub-list for method output_type - 33, // [33:34] 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_internal_proto_v2_s2a_s2a_proto_init() } -func file_internal_proto_v2_s2a_s2a_proto_init() { - if File_internal_proto_v2_s2a_s2a_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_internal_proto_v2_s2a_s2a_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AlpnPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AuthenticationMechanism); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Status); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTlsConfigurationReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTlsConfigurationResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OffloadPrivateKeyOperationReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OffloadPrivateKeyOperationResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OffloadResumptionKeyOperationReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OffloadResumptionKeyOperationResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatePeerCertificateChainReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatePeerCertificateChainResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTlsConfigurationResp_ClientTlsConfiguration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTlsConfigurationResp_ServerTlsConfiguration); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatePeerCertificateChainReq_ClientPeer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatePeerCertificateChainReq_ServerPeer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*AuthenticationMechanism_Token)(nil), - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[4].OneofWrappers = []interface{}{ - (*GetTlsConfigurationResp_ClientTlsConfiguration_)(nil), - (*GetTlsConfigurationResp_ServerTlsConfiguration_)(nil), - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[5].OneofWrappers = []interface{}{ - (*OffloadPrivateKeyOperationReq_RawBytes)(nil), - (*OffloadPrivateKeyOperationReq_Sha256Digest)(nil), - (*OffloadPrivateKeyOperationReq_Sha384Digest)(nil), - (*OffloadPrivateKeyOperationReq_Sha512Digest)(nil), - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[9].OneofWrappers = []interface{}{ - (*ValidatePeerCertificateChainReq_ClientPeer_)(nil), - (*ValidatePeerCertificateChainReq_ServerPeer_)(nil), - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[11].OneofWrappers = []interface{}{ - (*SessionReq_GetTlsConfigurationReq)(nil), - (*SessionReq_OffloadPrivateKeyOperationReq)(nil), - (*SessionReq_OffloadResumptionKeyOperationReq)(nil), - (*SessionReq_ValidatePeerCertificateChainReq)(nil), - } - file_internal_proto_v2_s2a_s2a_proto_msgTypes[12].OneofWrappers = []interface{}{ - (*SessionResp_GetTlsConfigurationResp)(nil), - (*SessionResp_OffloadPrivateKeyOperationResp)(nil), - (*SessionResp_OffloadResumptionKeyOperationResp)(nil), - (*SessionResp_ValidatePeerCertificateChainResp)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_proto_v2_s2a_s2a_proto_rawDesc, - NumEnums: 6, - NumMessages: 17, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_internal_proto_v2_s2a_s2a_proto_goTypes, - DependencyIndexes: file_internal_proto_v2_s2a_s2a_proto_depIdxs, - EnumInfos: file_internal_proto_v2_s2a_s2a_proto_enumTypes, - MessageInfos: file_internal_proto_v2_s2a_s2a_proto_msgTypes, - }.Build() - File_internal_proto_v2_s2a_s2a_proto = out.File - file_internal_proto_v2_s2a_s2a_proto_rawDesc = nil - file_internal_proto_v2_s2a_s2a_proto_goTypes = nil - file_internal_proto_v2_s2a_s2a_proto_depIdxs = nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go deleted file mode 100644 index 2566df6c3040..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2022 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-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.21.12 -// source: internal/proto/v2/s2a/s2a.proto - -package s2a_go_proto - -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 ( - S2AService_SetUpSession_FullMethodName = "/s2a.proto.v2.S2AService/SetUpSession" -) - -// S2AServiceClient is the client API for S2AService 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 S2AServiceClient interface { - // SetUpSession is a bidirectional stream used by applications to offload - // operations from the TLS handshake. - SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) -} - -type s2AServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewS2AServiceClient(cc grpc.ClientConnInterface) S2AServiceClient { - return &s2AServiceClient{cc} -} - -func (c *s2AServiceClient) SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) { - stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &s2AServiceSetUpSessionClient{stream} - return x, nil -} - -type S2AService_SetUpSessionClient interface { - Send(*SessionReq) error - Recv() (*SessionResp, error) - grpc.ClientStream -} - -type s2AServiceSetUpSessionClient struct { - grpc.ClientStream -} - -func (x *s2AServiceSetUpSessionClient) Send(m *SessionReq) error { - return x.ClientStream.SendMsg(m) -} - -func (x *s2AServiceSetUpSessionClient) Recv() (*SessionResp, error) { - m := new(SessionResp) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// S2AServiceServer is the server API for S2AService service. -// All implementations must embed UnimplementedS2AServiceServer -// for forward compatibility -type S2AServiceServer interface { - // SetUpSession is a bidirectional stream used by applications to offload - // operations from the TLS handshake. - SetUpSession(S2AService_SetUpSessionServer) error - mustEmbedUnimplementedS2AServiceServer() -} - -// UnimplementedS2AServiceServer must be embedded to have forward compatible implementations. -type UnimplementedS2AServiceServer struct { -} - -func (UnimplementedS2AServiceServer) SetUpSession(S2AService_SetUpSessionServer) error { - return status.Errorf(codes.Unimplemented, "method SetUpSession not implemented") -} -func (UnimplementedS2AServiceServer) mustEmbedUnimplementedS2AServiceServer() {} - -// UnsafeS2AServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to S2AServiceServer will -// result in compilation errors. -type UnsafeS2AServiceServer interface { - mustEmbedUnimplementedS2AServiceServer() -} - -func RegisterS2AServiceServer(s grpc.ServiceRegistrar, srv S2AServiceServer) { - s.RegisterService(&S2AService_ServiceDesc, srv) -} - -func _S2AService_SetUpSession_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{stream}) -} - -type S2AService_SetUpSessionServer interface { - Send(*SessionResp) error - Recv() (*SessionReq, error) - grpc.ServerStream -} - -type s2AServiceSetUpSessionServer struct { - grpc.ServerStream -} - -func (x *s2AServiceSetUpSessionServer) Send(m *SessionResp) error { - return x.ServerStream.SendMsg(m) -} - -func (x *s2AServiceSetUpSessionServer) Recv() (*SessionReq, error) { - m := new(SessionReq) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// S2AService_ServiceDesc is the grpc.ServiceDesc for S2AService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var S2AService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "s2a.proto.v2.S2AService", - HandlerType: (*S2AServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "SetUpSession", - Handler: _S2AService_SetUpSession_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "internal/proto/v2/s2a/s2a.proto", -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/aeadcrypter.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/aeadcrypter.go deleted file mode 100644 index 486f4ec4f2a6..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/aeadcrypter.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Package aeadcrypter provides the interface for AEAD cipher implementations -// used by S2A's record protocol. -package aeadcrypter - -// S2AAEADCrypter is the interface for an AEAD cipher used by the S2A record -// protocol. -type S2AAEADCrypter interface { - // Encrypt encrypts the plaintext and computes the tag of dst and plaintext. - // dst and plaintext may fully overlap or not at all. - Encrypt(dst, plaintext, nonce, aad []byte) ([]byte, error) - // Decrypt decrypts ciphertext and verifies the tag. dst and ciphertext may - // fully overlap or not at all. - Decrypt(dst, ciphertext, nonce, aad []byte) ([]byte, error) - // TagSize returns the tag size in bytes. - TagSize() int -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/aesgcm.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/aesgcm.go deleted file mode 100644 index 85c4e595d756..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/aesgcm.go +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package aeadcrypter - -import ( - "crypto/aes" - "crypto/cipher" - "fmt" -) - -// Supported key sizes in bytes. -const ( - AES128GCMKeySize = 16 - AES256GCMKeySize = 32 -) - -// aesgcm is the struct that holds an AES-GCM cipher for the S2A AEAD crypter. -type aesgcm struct { - aead cipher.AEAD -} - -// NewAESGCM creates an AES-GCM crypter instance. Note that the key must be -// either 128 bits or 256 bits. -func NewAESGCM(key []byte) (S2AAEADCrypter, error) { - if len(key) != AES128GCMKeySize && len(key) != AES256GCMKeySize { - return nil, fmt.Errorf("%d or %d bytes, given: %d", AES128GCMKeySize, AES256GCMKeySize, len(key)) - } - c, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - a, err := cipher.NewGCM(c) - if err != nil { - return nil, err - } - return &aesgcm{aead: a}, nil -} - -// Encrypt is the encryption function. dst can contain bytes at the beginning of -// the ciphertext that will not be encrypted but will be authenticated. If dst -// has enough capacity to hold these bytes, the ciphertext and the tag, no -// allocation and copy operations will be performed. dst and plaintext may -// fully overlap or not at all. -func (s *aesgcm) Encrypt(dst, plaintext, nonce, aad []byte) ([]byte, error) { - return encrypt(s.aead, dst, plaintext, nonce, aad) -} - -func (s *aesgcm) Decrypt(dst, ciphertext, nonce, aad []byte) ([]byte, error) { - return decrypt(s.aead, dst, ciphertext, nonce, aad) -} - -func (s *aesgcm) TagSize() int { - return TagSize -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/chachapoly.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/chachapoly.go deleted file mode 100644 index 214df4ca415d..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/chachapoly.go +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package aeadcrypter - -import ( - "crypto/cipher" - "fmt" - - "golang.org/x/crypto/chacha20poly1305" -) - -// Supported key size in bytes. -const ( - Chacha20Poly1305KeySize = 32 -) - -// chachapoly is the struct that holds a CHACHA-POLY cipher for the S2A AEAD -// crypter. -type chachapoly struct { - aead cipher.AEAD -} - -// NewChachaPoly creates a Chacha-Poly crypter instance. Note that the key must -// be Chacha20Poly1305KeySize bytes in length. -func NewChachaPoly(key []byte) (S2AAEADCrypter, error) { - if len(key) != Chacha20Poly1305KeySize { - return nil, fmt.Errorf("%d bytes, given: %d", Chacha20Poly1305KeySize, len(key)) - } - c, err := chacha20poly1305.New(key) - if err != nil { - return nil, err - } - return &chachapoly{aead: c}, nil -} - -// Encrypt is the encryption function. dst can contain bytes at the beginning of -// the ciphertext that will not be encrypted but will be authenticated. If dst -// has enough capacity to hold these bytes, the ciphertext and the tag, no -// allocation and copy operations will be performed. dst and plaintext may -// fully overlap or not at all. -func (s *chachapoly) Encrypt(dst, plaintext, nonce, aad []byte) ([]byte, error) { - return encrypt(s.aead, dst, plaintext, nonce, aad) -} - -func (s *chachapoly) Decrypt(dst, ciphertext, nonce, aad []byte) ([]byte, error) { - return decrypt(s.aead, dst, ciphertext, nonce, aad) -} - -func (s *chachapoly) TagSize() int { - return TagSize -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/common.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/common.go deleted file mode 100644 index b3c36ad95dc5..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/aeadcrypter/common.go +++ /dev/null @@ -1,92 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package aeadcrypter - -import ( - "crypto/cipher" - "fmt" -) - -const ( - // TagSize is the tag size in bytes for AES-128-GCM-SHA256, - // AES-256-GCM-SHA384, and CHACHA20-POLY1305-SHA256. - TagSize = 16 - // NonceSize is the size of the nonce in number of bytes for - // AES-128-GCM-SHA256, AES-256-GCM-SHA384, and CHACHA20-POLY1305-SHA256. - NonceSize = 12 - // SHA256DigestSize is the digest size of sha256 in bytes. - SHA256DigestSize = 32 - // SHA384DigestSize is the digest size of sha384 in bytes. - SHA384DigestSize = 48 -) - -// sliceForAppend takes a slice and a requested number of bytes. It returns a -// slice with the contents of the given slice followed by that many bytes and a -// second slice that aliases into it and contains only the extra bytes. If the -// original slice has sufficient capacity then no allocation is performed. -func sliceForAppend(in []byte, n int) (head, tail []byte) { - if total := len(in) + n; cap(in) >= total { - head = in[:total] - } else { - head = make([]byte, total) - copy(head, in) - } - tail = head[len(in):] - return head, tail -} - -// encrypt is the encryption function for an AEAD crypter. aead determines -// the type of AEAD crypter. dst can contain bytes at the beginning of the -// ciphertext that will not be encrypted but will be authenticated. If dst has -// enough capacity to hold these bytes, the ciphertext and the tag, no -// allocation and copy operations will be performed. dst and plaintext may -// fully overlap or not at all. -func encrypt(aead cipher.AEAD, dst, plaintext, nonce, aad []byte) ([]byte, error) { - if len(nonce) != NonceSize { - return nil, fmt.Errorf("nonce size must be %d bytes. received: %d", NonceSize, len(nonce)) - } - // If we need to allocate an output buffer, we want to include space for - // the tag to avoid forcing the caller to reallocate as well. - dlen := len(dst) - dst, out := sliceForAppend(dst, len(plaintext)+TagSize) - data := out[:len(plaintext)] - copy(data, plaintext) // data may fully overlap plaintext - - // Seal appends the ciphertext and the tag to its first argument and - // returns the updated slice. However, sliceForAppend above ensures that - // dst has enough capacity to avoid a reallocation and copy due to the - // append. - dst = aead.Seal(dst[:dlen], nonce, data, aad) - return dst, nil -} - -// decrypt is the decryption function for an AEAD crypter, where aead determines -// the type of AEAD crypter, and dst the destination bytes for the decrypted -// ciphertext. The dst buffer may fully overlap with plaintext or not at all. -func decrypt(aead cipher.AEAD, dst, ciphertext, nonce, aad []byte) ([]byte, error) { - if len(nonce) != NonceSize { - return nil, fmt.Errorf("nonce size must be %d bytes. received: %d", NonceSize, len(nonce)) - } - // If dst is equal to ciphertext[:0], ciphertext storage is reused. - plaintext, err := aead.Open(dst, nonce, ciphertext, aad) - if err != nil { - return nil, fmt.Errorf("message auth failed: %v", err) - } - return plaintext, nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/ciphersuite.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/ciphersuite.go deleted file mode 100644 index ddeaa6d77d72..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/ciphersuite.go +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package halfconn - -import ( - "crypto/sha256" - "crypto/sha512" - "fmt" - "hash" - - s2apb "github.com/google/s2a-go/internal/proto/common_go_proto" - "github.com/google/s2a-go/internal/record/internal/aeadcrypter" -) - -// ciphersuite is the interface for retrieving ciphersuite-specific information -// and utilities. -type ciphersuite interface { - // keySize returns the key size in bytes. This refers to the key used by - // the AEAD crypter. This is derived by calling HKDF expand on the traffic - // secret. - keySize() int - // nonceSize returns the nonce size in bytes. - nonceSize() int - // trafficSecretSize returns the traffic secret size in bytes. This refers - // to the secret used to derive the traffic key and nonce, as specified in - // https://tools.ietf.org/html/rfc8446#section-7. - trafficSecretSize() int - // hashFunction returns the hash function for the ciphersuite. - hashFunction() func() hash.Hash - // aeadCrypter takes a key and creates an AEAD crypter for the ciphersuite - // using that key. - aeadCrypter(key []byte) (aeadcrypter.S2AAEADCrypter, error) -} - -func newCiphersuite(ciphersuite s2apb.Ciphersuite) (ciphersuite, error) { - switch ciphersuite { - case s2apb.Ciphersuite_AES_128_GCM_SHA256: - return &aesgcm128sha256{}, nil - case s2apb.Ciphersuite_AES_256_GCM_SHA384: - return &aesgcm256sha384{}, nil - case s2apb.Ciphersuite_CHACHA20_POLY1305_SHA256: - return &chachapolysha256{}, nil - default: - return nil, fmt.Errorf("unrecognized ciphersuite: %v", ciphersuite) - } -} - -// aesgcm128sha256 is the AES-128-GCM-SHA256 implementation of the ciphersuite -// interface. -type aesgcm128sha256 struct{} - -func (aesgcm128sha256) keySize() int { return aeadcrypter.AES128GCMKeySize } -func (aesgcm128sha256) nonceSize() int { return aeadcrypter.NonceSize } -func (aesgcm128sha256) trafficSecretSize() int { return aeadcrypter.SHA256DigestSize } -func (aesgcm128sha256) hashFunction() func() hash.Hash { return sha256.New } -func (aesgcm128sha256) aeadCrypter(key []byte) (aeadcrypter.S2AAEADCrypter, error) { - return aeadcrypter.NewAESGCM(key) -} - -// aesgcm256sha384 is the AES-256-GCM-SHA384 implementation of the ciphersuite -// interface. -type aesgcm256sha384 struct{} - -func (aesgcm256sha384) keySize() int { return aeadcrypter.AES256GCMKeySize } -func (aesgcm256sha384) nonceSize() int { return aeadcrypter.NonceSize } -func (aesgcm256sha384) trafficSecretSize() int { return aeadcrypter.SHA384DigestSize } -func (aesgcm256sha384) hashFunction() func() hash.Hash { return sha512.New384 } -func (aesgcm256sha384) aeadCrypter(key []byte) (aeadcrypter.S2AAEADCrypter, error) { - return aeadcrypter.NewAESGCM(key) -} - -// chachapolysha256 is the ChaChaPoly-SHA256 implementation of the ciphersuite -// interface. -type chachapolysha256 struct{} - -func (chachapolysha256) keySize() int { return aeadcrypter.Chacha20Poly1305KeySize } -func (chachapolysha256) nonceSize() int { return aeadcrypter.NonceSize } -func (chachapolysha256) trafficSecretSize() int { return aeadcrypter.SHA256DigestSize } -func (chachapolysha256) hashFunction() func() hash.Hash { return sha256.New } -func (chachapolysha256) aeadCrypter(key []byte) (aeadcrypter.S2AAEADCrypter, error) { - return aeadcrypter.NewChachaPoly(key) -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/counter.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/counter.go deleted file mode 100644 index 9499cdca7590..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/counter.go +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package halfconn - -import "errors" - -// counter is a 64-bit counter. -type counter struct { - val uint64 - hasOverflowed bool -} - -// newCounter creates a new counter with the initial value set to val. -func newCounter(val uint64) counter { - return counter{val: val} -} - -// value returns the current value of the counter. -func (c *counter) value() (uint64, error) { - if c.hasOverflowed { - return 0, errors.New("counter has overflowed") - } - return c.val, nil -} - -// increment increments the counter and checks for overflow. -func (c *counter) increment() { - // If the counter is already invalid due to overflow, there is no need to - // increase it. We check for the hasOverflowed flag in the call to value(). - if c.hasOverflowed { - return - } - c.val++ - if c.val == 0 { - c.hasOverflowed = true - } -} - -// reset sets the counter value to zero and sets the hasOverflowed flag to -// false. -func (c *counter) reset() { - c.val = 0 - c.hasOverflowed = false -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/expander.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/expander.go deleted file mode 100644 index e05f2c36a6d5..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/expander.go +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package halfconn - -import ( - "fmt" - "hash" - - "golang.org/x/crypto/hkdf" -) - -// hkdfExpander is the interface for the HKDF expansion function; see -// https://tools.ietf.org/html/rfc5869 for details. its use in TLS 1.3 is -// specified in https://tools.ietf.org/html/rfc8446#section-7.2 -type hkdfExpander interface { - // expand takes a secret, a label, and the output length in bytes, and - // returns the resulting expanded key. - expand(secret, label []byte, length int) ([]byte, error) -} - -// defaultHKDFExpander is the default HKDF expander which uses Go's crypto/hkdf -// for HKDF expansion. -type defaultHKDFExpander struct { - h func() hash.Hash -} - -// newDefaultHKDFExpander creates an instance of the default HKDF expander -// using the given hash function. -func newDefaultHKDFExpander(h func() hash.Hash) hkdfExpander { - return &defaultHKDFExpander{h: h} -} - -func (d *defaultHKDFExpander) expand(secret, label []byte, length int) ([]byte, error) { - outBuf := make([]byte, length) - n, err := hkdf.Expand(d.h, secret, label).Read(outBuf) - if err != nil { - return nil, fmt.Errorf("hkdf.Expand.Read failed with error: %v", err) - } - if n < length { - return nil, fmt.Errorf("hkdf.Expand.Read returned unexpected length, got %d, want %d", n, length) - } - return outBuf, nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/halfconn.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/halfconn.go deleted file mode 100644 index dff99ff59401..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/internal/halfconn/halfconn.go +++ /dev/null @@ -1,193 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Package halfconn manages the inbound or outbound traffic of a TLS 1.3 -// connection. -package halfconn - -import ( - "fmt" - "sync" - - s2apb "github.com/google/s2a-go/internal/proto/common_go_proto" - "github.com/google/s2a-go/internal/record/internal/aeadcrypter" - "golang.org/x/crypto/cryptobyte" -) - -// The constants below were taken from Section 7.2 and 7.3 in -// https://tools.ietf.org/html/rfc8446#section-7. They are used as the label -// in HKDF-Expand-Label. -const ( - tls13Key = "tls13 key" - tls13Nonce = "tls13 iv" - tls13Update = "tls13 traffic upd" -) - -// S2AHalfConnection stores the state of the TLS 1.3 connection in the -// inbound or outbound direction. -type S2AHalfConnection struct { - cs ciphersuite - expander hkdfExpander - // mutex guards sequence, aeadCrypter, trafficSecret, and nonce. - mutex sync.Mutex - aeadCrypter aeadcrypter.S2AAEADCrypter - sequence counter - trafficSecret []byte - nonce []byte -} - -// New creates a new instance of S2AHalfConnection given a ciphersuite and a -// traffic secret. -func New(ciphersuite s2apb.Ciphersuite, trafficSecret []byte, sequence uint64) (*S2AHalfConnection, error) { - cs, err := newCiphersuite(ciphersuite) - if err != nil { - return nil, fmt.Errorf("failed to create new ciphersuite: %v", ciphersuite) - } - if cs.trafficSecretSize() != len(trafficSecret) { - return nil, fmt.Errorf("supplied traffic secret must be %v bytes, given: %v bytes", cs.trafficSecretSize(), len(trafficSecret)) - } - - hc := &S2AHalfConnection{cs: cs, expander: newDefaultHKDFExpander(cs.hashFunction()), sequence: newCounter(sequence), trafficSecret: trafficSecret} - if err = hc.updateCrypterAndNonce(hc.trafficSecret); err != nil { - return nil, fmt.Errorf("failed to create half connection using traffic secret: %v", err) - } - - return hc, nil -} - -// Encrypt encrypts the plaintext and computes the tag of dst and plaintext. -// dst and plaintext may fully overlap or not at all. Note that the sequence -// number will still be incremented on failure, unless the sequence has -// overflowed. -func (hc *S2AHalfConnection) Encrypt(dst, plaintext, aad []byte) ([]byte, error) { - hc.mutex.Lock() - sequence, err := hc.getAndIncrementSequence() - if err != nil { - hc.mutex.Unlock() - return nil, err - } - nonce := hc.maskedNonce(sequence) - crypter := hc.aeadCrypter - hc.mutex.Unlock() - return crypter.Encrypt(dst, plaintext, nonce, aad) -} - -// Decrypt decrypts ciphertext and verifies the tag. dst and ciphertext may -// fully overlap or not at all. Note that the sequence number will still be -// incremented on failure, unless the sequence has overflowed. -func (hc *S2AHalfConnection) Decrypt(dst, ciphertext, aad []byte) ([]byte, error) { - hc.mutex.Lock() - sequence, err := hc.getAndIncrementSequence() - if err != nil { - hc.mutex.Unlock() - return nil, err - } - nonce := hc.maskedNonce(sequence) - crypter := hc.aeadCrypter - hc.mutex.Unlock() - return crypter.Decrypt(dst, ciphertext, nonce, aad) -} - -// UpdateKey advances the traffic secret key, as specified in -// https://tools.ietf.org/html/rfc8446#section-7.2. In addition, it derives -// a new key and nonce, and resets the sequence number. -func (hc *S2AHalfConnection) UpdateKey() error { - hc.mutex.Lock() - defer hc.mutex.Unlock() - - var err error - hc.trafficSecret, err = hc.deriveSecret(hc.trafficSecret, []byte(tls13Update), hc.cs.trafficSecretSize()) - if err != nil { - return fmt.Errorf("failed to derive traffic secret: %v", err) - } - - if err = hc.updateCrypterAndNonce(hc.trafficSecret); err != nil { - return fmt.Errorf("failed to update half connection: %v", err) - } - - hc.sequence.reset() - return nil -} - -// TagSize returns the tag size in bytes of the underlying AEAD crypter. -func (hc *S2AHalfConnection) TagSize() int { - return hc.aeadCrypter.TagSize() -} - -// updateCrypterAndNonce takes a new traffic secret and updates the crypter -// and nonce. Note that the mutex must be held while calling this function. -func (hc *S2AHalfConnection) updateCrypterAndNonce(newTrafficSecret []byte) error { - key, err := hc.deriveSecret(newTrafficSecret, []byte(tls13Key), hc.cs.keySize()) - if err != nil { - return fmt.Errorf("failed to update key: %v", err) - } - - hc.nonce, err = hc.deriveSecret(newTrafficSecret, []byte(tls13Nonce), hc.cs.nonceSize()) - if err != nil { - return fmt.Errorf("failed to update nonce: %v", err) - } - - hc.aeadCrypter, err = hc.cs.aeadCrypter(key) - if err != nil { - return fmt.Errorf("failed to update AEAD crypter: %v", err) - } - return nil -} - -// getAndIncrement returns the current sequence number and increments it. Note -// that the mutex must be held while calling this function. -func (hc *S2AHalfConnection) getAndIncrementSequence() (uint64, error) { - sequence, err := hc.sequence.value() - if err != nil { - return 0, err - } - hc.sequence.increment() - return sequence, nil -} - -// maskedNonce creates a copy of the nonce that is masked with the sequence -// number. Note that the mutex must be held while calling this function. -func (hc *S2AHalfConnection) maskedNonce(sequence uint64) []byte { - const uint64Size = 8 - nonce := make([]byte, len(hc.nonce)) - copy(nonce, hc.nonce) - for i := 0; i < uint64Size; i++ { - nonce[aeadcrypter.NonceSize-uint64Size+i] ^= byte(sequence >> uint64(56-uint64Size*i)) - } - return nonce -} - -// deriveSecret implements the Derive-Secret function, as specified in -// https://tools.ietf.org/html/rfc8446#section-7.1. -func (hc *S2AHalfConnection) deriveSecret(secret, label []byte, length int) ([]byte, error) { - var hkdfLabel cryptobyte.Builder - hkdfLabel.AddUint16(uint16(length)) - hkdfLabel.AddUint8LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes(label) - }) - // Append an empty `Context` field to the label, as specified in the RFC. - // The half connection does not use the `Context` field. - hkdfLabel.AddUint8LengthPrefixed(func(b *cryptobyte.Builder) { - b.AddBytes([]byte("")) - }) - hkdfLabelBytes, err := hkdfLabel.Bytes() - if err != nil { - return nil, fmt.Errorf("deriveSecret failed: %v", err) - } - return hc.expander.expand(secret, hkdfLabelBytes, length) -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/record.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/record.go deleted file mode 100644 index c60515510a7a..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/record.go +++ /dev/null @@ -1,757 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Package record implements the TLS 1.3 record protocol used by the S2A -// transport credentials. -package record - -import ( - "encoding/binary" - "errors" - "fmt" - "math" - "net" - "sync" - - commonpb "github.com/google/s2a-go/internal/proto/common_go_proto" - "github.com/google/s2a-go/internal/record/internal/halfconn" - "github.com/google/s2a-go/internal/tokenmanager" - "google.golang.org/grpc/grpclog" -) - -// recordType is the `ContentType` as described in -// https://tools.ietf.org/html/rfc8446#section-5.1. -type recordType byte - -const ( - alert recordType = 21 - handshake recordType = 22 - applicationData recordType = 23 -) - -// keyUpdateRequest is the `KeyUpdateRequest` as described in -// https://tools.ietf.org/html/rfc8446#section-4.6.3. -type keyUpdateRequest byte - -const ( - updateNotRequested keyUpdateRequest = 0 - updateRequested keyUpdateRequest = 1 -) - -// alertDescription is the `AlertDescription` as described in -// https://tools.ietf.org/html/rfc8446#section-6. -type alertDescription byte - -const ( - closeNotify alertDescription = 0 -) - -// sessionTicketState is used to determine whether session tickets have not yet -// been received, are in the process of being received, or have finished -// receiving. -type sessionTicketState byte - -const ( - ticketsNotYetReceived sessionTicketState = 0 - receivingTickets sessionTicketState = 1 - notReceivingTickets sessionTicketState = 2 -) - -const ( - // The TLS 1.3-specific constants below (tlsRecordMaxPlaintextSize, - // tlsRecordHeaderSize, tlsRecordTypeSize) were taken from - // https://tools.ietf.org/html/rfc8446#section-5.1. - - // tlsRecordMaxPlaintextSize is the maximum size in bytes of the plaintext - // in a single TLS 1.3 record. - tlsRecordMaxPlaintextSize = 16384 // 2^14 - // tlsRecordTypeSize is the size in bytes of the TLS 1.3 record type. - tlsRecordTypeSize = 1 - // tlsTagSize is the size in bytes of the tag of the following three - // ciphersuites: AES-128-GCM-SHA256, AES-256-GCM-SHA384, - // CHACHA20-POLY1305-SHA256. - tlsTagSize = 16 - // tlsRecordMaxPayloadSize is the maximum size in bytes of the payload in a - // single TLS 1.3 record. This is the maximum size of the plaintext plus the - // record type byte and 16 bytes of the tag. - tlsRecordMaxPayloadSize = tlsRecordMaxPlaintextSize + tlsRecordTypeSize + tlsTagSize - // tlsRecordHeaderTypeSize is the size in bytes of the TLS 1.3 record - // header type. - tlsRecordHeaderTypeSize = 1 - // tlsRecordHeaderLegacyRecordVersionSize is the size in bytes of the TLS - // 1.3 record header legacy record version. - tlsRecordHeaderLegacyRecordVersionSize = 2 - // tlsRecordHeaderPayloadLengthSize is the size in bytes of the TLS 1.3 - // record header payload length. - tlsRecordHeaderPayloadLengthSize = 2 - // tlsRecordHeaderSize is the size in bytes of the TLS 1.3 record header. - tlsRecordHeaderSize = tlsRecordHeaderTypeSize + tlsRecordHeaderLegacyRecordVersionSize + tlsRecordHeaderPayloadLengthSize - // tlsRecordMaxSize - tlsRecordMaxSize = tlsRecordMaxPayloadSize + tlsRecordHeaderSize - // tlsApplicationData is the application data type of the TLS 1.3 record - // header. - tlsApplicationData = 23 - // tlsLegacyRecordVersion is the legacy record version of the TLS record. - tlsLegacyRecordVersion = 3 - // tlsAlertSize is the size in bytes of an alert of TLS 1.3. - tlsAlertSize = 2 -) - -const ( - // These are TLS 1.3 handshake-specific constants. - - // tlsHandshakeNewSessionTicketType is the prefix of a handshake new session - // ticket message of TLS 1.3. - tlsHandshakeNewSessionTicketType = 4 - // tlsHandshakeKeyUpdateType is the prefix of a handshake key update message - // of TLS 1.3. - tlsHandshakeKeyUpdateType = 24 - // tlsHandshakeMsgTypeSize is the size in bytes of the TLS 1.3 handshake - // message type field. - tlsHandshakeMsgTypeSize = 1 - // tlsHandshakeLengthSize is the size in bytes of the TLS 1.3 handshake - // message length field. - tlsHandshakeLengthSize = 3 - // tlsHandshakeKeyUpdateMsgSize is the size in bytes of the TLS 1.3 - // handshake key update message. - tlsHandshakeKeyUpdateMsgSize = 1 - // tlsHandshakePrefixSize is the size in bytes of the prefix of the TLS 1.3 - // handshake message. - tlsHandshakePrefixSize = 4 - // tlsMaxSessionTicketSize is the maximum size of a NewSessionTicket message - // in TLS 1.3. This is the sum of the max sizes of all the fields in the - // NewSessionTicket struct specified in - // https://tools.ietf.org/html/rfc8446#section-4.6.1. - tlsMaxSessionTicketSize = 131338 -) - -const ( - // outBufMaxRecords is the maximum number of records that can fit in the - // ourRecordsBuf buffer. - outBufMaxRecords = 16 - // outBufMaxSize is the maximum size (in bytes) of the outRecordsBuf buffer. - outBufMaxSize = outBufMaxRecords * tlsRecordMaxSize - // maxAllowedTickets is the maximum number of session tickets that are - // allowed. The number of tickets are limited to ensure that the size of the - // ticket queue does not grow indefinitely. S2A also keeps a limit on the - // number of tickets that it caches. - maxAllowedTickets = 5 -) - -// preConstructedKeyUpdateMsg holds the key update message. This is needed as an -// optimization so that the same message does not need to be constructed every -// time a key update message is sent. -var preConstructedKeyUpdateMsg = buildKeyUpdateRequest() - -// conn represents a secured TLS connection. It implements the net.Conn -// interface. -type conn struct { - net.Conn - // inConn is the half connection responsible for decrypting incoming bytes. - inConn *halfconn.S2AHalfConnection - // outConn is the half connection responsible for encrypting outgoing bytes. - outConn *halfconn.S2AHalfConnection - // pendingApplicationData holds data that has been read from the connection - // and decrypted, but has not yet been returned by Read. - pendingApplicationData []byte - // unusedBuf holds data read from the network that has not yet been - // decrypted. This data might not consist of a complete record. It may - // consist of several records, the last of which could be incomplete. - unusedBuf []byte - // outRecordsBuf is a buffer used to store outgoing TLS records before - // they are written to the network. - outRecordsBuf []byte - // nextRecord stores the next record info in the unusedBuf buffer. - nextRecord []byte - // overheadSize is the overhead size in bytes of each TLS 1.3 record, which - // is computed as overheadSize = header size + record type byte + tag size. - // Note that there is no padding by zeros in the overhead calculation. - overheadSize int - // readMutex guards against concurrent calls to Read. This is required since - // Close may be called during a Read. - readMutex sync.Mutex - // writeMutex guards against concurrent calls to Write. This is required - // since Close may be called during a Write, and also because a key update - // message may be written during a Read. - writeMutex sync.Mutex - // handshakeBuf holds handshake messages while they are being processed. - handshakeBuf []byte - // ticketState is the current processing state of the session tickets. - ticketState sessionTicketState - // sessionTickets holds the completed session tickets until they are sent to - // the handshaker service for processing. - sessionTickets [][]byte - // ticketSender sends session tickets to the S2A handshaker service. - ticketSender s2aTicketSender - // callComplete is a channel that blocks closing the record protocol until a - // pending call to the S2A completes. - callComplete chan bool -} - -// ConnParameters holds the parameters used for creating a new conn object. -type ConnParameters struct { - // NetConn is the TCP connection to the peer. This parameter is required. - NetConn net.Conn - // Ciphersuite is the TLS ciphersuite negotiated by the S2A handshaker - // service. This parameter is required. - Ciphersuite commonpb.Ciphersuite - // TLSVersion is the TLS version number negotiated by the S2A handshaker - // service. This parameter is required. - TLSVersion commonpb.TLSVersion - // InTrafficSecret is the traffic secret used to derive the session key for - // the inbound direction. This parameter is required. - InTrafficSecret []byte - // OutTrafficSecret is the traffic secret used to derive the session key - // for the outbound direction. This parameter is required. - OutTrafficSecret []byte - // UnusedBuf is the data read from the network that has not yet been - // decrypted. This parameter is optional. If not provided, then no - // application data was sent in the same flight of messages as the final - // handshake message. - UnusedBuf []byte - // InSequence is the sequence number of the next, incoming, TLS record. - // This parameter is required. - InSequence uint64 - // OutSequence is the sequence number of the next, outgoing, TLS record. - // This parameter is required. - OutSequence uint64 - // HSAddr stores the address of the S2A handshaker service. This parameter - // is optional. If not provided, then TLS resumption is disabled. - HSAddr string - // ConnectionId is the connection identifier that was created and sent by - // S2A at the end of a handshake. - ConnectionID uint64 - // LocalIdentity is the local identity that was used by S2A during session - // setup and included in the session result. - LocalIdentity *commonpb.Identity - // EnsureProcessSessionTickets allows users to wait and ensure that all - // available session tickets are sent to S2A before a process completes. - EnsureProcessSessionTickets *sync.WaitGroup -} - -// NewConn creates a TLS record protocol that wraps the TCP connection. -func NewConn(o *ConnParameters) (net.Conn, error) { - if o == nil { - return nil, errors.New("conn options must not be nil") - } - if o.TLSVersion != commonpb.TLSVersion_TLS1_3 { - return nil, errors.New("TLS version must be TLS 1.3") - } - - inConn, err := halfconn.New(o.Ciphersuite, o.InTrafficSecret, o.InSequence) - if err != nil { - return nil, fmt.Errorf("failed to create inbound half connection: %v", err) - } - outConn, err := halfconn.New(o.Ciphersuite, o.OutTrafficSecret, o.OutSequence) - if err != nil { - return nil, fmt.Errorf("failed to create outbound half connection: %v", err) - } - - // The tag size for the in/out connections should be the same. - overheadSize := tlsRecordHeaderSize + tlsRecordTypeSize + inConn.TagSize() - var unusedBuf []byte - if o.UnusedBuf == nil { - // We pre-allocate unusedBuf to be of size - // 2*tlsRecordMaxSize-1 during initialization. We only read from the - // network into unusedBuf when unusedBuf does not contain a complete - // record and the incomplete record is at most tlsRecordMaxSize-1 - // (bytes). And we read at most tlsRecordMaxSize bytes of data from the - // network into unusedBuf at one time. Therefore, 2*tlsRecordMaxSize-1 - // is large enough to buffer data read from the network. - unusedBuf = make([]byte, 0, 2*tlsRecordMaxSize-1) - } else { - unusedBuf = make([]byte, len(o.UnusedBuf)) - copy(unusedBuf, o.UnusedBuf) - } - - tokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager() - if err != nil { - grpclog.Infof("failed to create single token access token manager: %v", err) - } - - s2aConn := &conn{ - Conn: o.NetConn, - inConn: inConn, - outConn: outConn, - unusedBuf: unusedBuf, - outRecordsBuf: make([]byte, tlsRecordMaxSize), - nextRecord: unusedBuf, - overheadSize: overheadSize, - ticketState: ticketsNotYetReceived, - // Pre-allocate the buffer for one session ticket message and the max - // plaintext size. This is the largest size that handshakeBuf will need - // to hold. The largest incomplete handshake message is the - // [handshake header size] + [max session ticket size] - 1. - // Then, tlsRecordMaxPlaintextSize is the maximum size that will be - // appended to the handshakeBuf before the handshake message is - // completed. Therefore, the buffer size below should be large enough to - // buffer any handshake messages. - handshakeBuf: make([]byte, 0, tlsHandshakePrefixSize+tlsMaxSessionTicketSize+tlsRecordMaxPlaintextSize-1), - ticketSender: &ticketSender{ - hsAddr: o.HSAddr, - connectionID: o.ConnectionID, - localIdentity: o.LocalIdentity, - tokenManager: tokenManager, - ensureProcessSessionTickets: o.EnsureProcessSessionTickets, - }, - callComplete: make(chan bool), - } - return s2aConn, nil -} - -// Read reads and decrypts a TLS 1.3 record from the underlying connection, and -// copies any application data received from the peer into b. If the size of the -// payload is greater than len(b), Read retains the remaining bytes in an -// internal buffer, and subsequent calls to Read will read from this buffer -// until it is exhausted. At most 1 TLS record worth of application data is -// written to b for each call to Read. -// -// Note that for the user to efficiently call this method, the user should -// ensure that the buffer b is allocated such that the buffer does not have any -// unused segments. This can be done by calling Read via io.ReadFull, which -// continually calls Read until the specified buffer has been filled. Also note -// that the user should close the connection via Close() if an error is thrown -// by a call to Read. -func (p *conn) Read(b []byte) (n int, err error) { - p.readMutex.Lock() - defer p.readMutex.Unlock() - // Check if p.pendingApplication data has leftover application data from - // the previous call to Read. - if len(p.pendingApplicationData) == 0 { - // Read a full record from the wire. - record, err := p.readFullRecord() - if err != nil { - return 0, err - } - // Now we have a complete record, so split the header and validate it - // The TLS record is split into 2 pieces: the record header and the - // payload. The payload has the following form: - // [payload] = [ciphertext of application data] - // + [ciphertext of record type byte] - // + [(optionally) ciphertext of padding by zeros] - // + [tag] - header, payload, err := splitAndValidateHeader(record) - if err != nil { - return 0, err - } - // Decrypt the ciphertext. - p.pendingApplicationData, err = p.inConn.Decrypt(payload[:0], payload, header) - if err != nil { - return 0, err - } - // Remove the padding by zeros and the record type byte from the - // p.pendingApplicationData buffer. - msgType, err := p.stripPaddingAndType() - if err != nil { - return 0, err - } - // Check that the length of the plaintext after stripping the padding - // and record type byte is under the maximum plaintext size. - if len(p.pendingApplicationData) > tlsRecordMaxPlaintextSize { - return 0, errors.New("plaintext size larger than maximum") - } - // The expected message types are application data, alert, and - // handshake. For application data, the bytes are directly copied into - // b. For an alert, the type of the alert is checked and the connection - // is closed on a close notify alert. For a handshake message, the - // handshake message type is checked. The handshake message type can be - // a key update type, for which we advance the traffic secret, and a - // new session ticket type, for which we send the received ticket to S2A - // for processing. - switch msgType { - case applicationData: - if len(p.handshakeBuf) > 0 { - return 0, errors.New("application data received while processing fragmented handshake messages") - } - if p.ticketState == receivingTickets { - p.ticketState = notReceivingTickets - grpclog.Infof("Sending session tickets to S2A.") - p.ticketSender.sendTicketsToS2A(p.sessionTickets, p.callComplete) - } - case alert: - return 0, p.handleAlertMessage() - case handshake: - if err = p.handleHandshakeMessage(); err != nil { - return 0, err - } - return 0, nil - default: - return 0, errors.New("unknown record type") - } - } - // Write as much application data as possible to b, the output buffer. - n = copy(b, p.pendingApplicationData) - p.pendingApplicationData = p.pendingApplicationData[n:] - return n, nil -} - -// Write divides b into segments of size tlsRecordMaxPlaintextSize, builds a -// TLS 1.3 record (of type "application data") from each segment, and sends -// the record to the peer. It returns the number of plaintext bytes that were -// successfully sent to the peer. -func (p *conn) Write(b []byte) (n int, err error) { - p.writeMutex.Lock() - defer p.writeMutex.Unlock() - return p.writeTLSRecord(b, tlsApplicationData) -} - -// writeTLSRecord divides b into segments of size maxPlaintextBytesPerRecord, -// builds a TLS 1.3 record (of type recordType) from each segment, and sends -// the record to the peer. It returns the number of plaintext bytes that were -// successfully sent to the peer. -func (p *conn) writeTLSRecord(b []byte, recordType byte) (n int, err error) { - // Create a record of only header, record type, and tag if given empty - // byte array. - if len(b) == 0 { - recordEndIndex, _, err := p.buildRecord(b, recordType, 0) - if err != nil { - return 0, err - } - - // Write the bytes stored in outRecordsBuf to p.Conn. Since we return - // the number of plaintext bytes written without overhead, we will - // always return 0 while p.Conn.Write returns the entire record length. - _, err = p.Conn.Write(p.outRecordsBuf[:recordEndIndex]) - return 0, err - } - - numRecords := int(math.Ceil(float64(len(b)) / float64(tlsRecordMaxPlaintextSize))) - totalRecordsSize := len(b) + numRecords*p.overheadSize - partialBSize := len(b) - if totalRecordsSize > outBufMaxSize { - totalRecordsSize = outBufMaxSize - partialBSize = outBufMaxRecords * tlsRecordMaxPlaintextSize - } - if len(p.outRecordsBuf) < totalRecordsSize { - p.outRecordsBuf = make([]byte, totalRecordsSize) - } - for bStart := 0; bStart < len(b); bStart += partialBSize { - bEnd := bStart + partialBSize - if bEnd > len(b) { - bEnd = len(b) - } - partialB := b[bStart:bEnd] - recordEndIndex := 0 - for len(partialB) > 0 { - recordEndIndex, partialB, err = p.buildRecord(partialB, recordType, recordEndIndex) - if err != nil { - // Return the amount of bytes written prior to the error. - return bStart, err - } - } - // Write the bytes stored in outRecordsBuf to p.Conn. If there is an - // error, calculate the total number of plaintext bytes of complete - // records successfully written to the peer and return it. - nn, err := p.Conn.Write(p.outRecordsBuf[:recordEndIndex]) - if err != nil { - numberOfCompletedRecords := int(math.Floor(float64(nn) / float64(tlsRecordMaxSize))) - return bStart + numberOfCompletedRecords*tlsRecordMaxPlaintextSize, err - } - } - return len(b), nil -} - -// buildRecord builds a TLS 1.3 record of type recordType from plaintext, -// and writes the record to outRecordsBuf at recordStartIndex. The record will -// have at most tlsRecordMaxPlaintextSize bytes of payload. It returns the -// index of outRecordsBuf where the current record ends, as well as any -// remaining plaintext bytes. -func (p *conn) buildRecord(plaintext []byte, recordType byte, recordStartIndex int) (n int, remainingPlaintext []byte, err error) { - // Construct the payload, which consists of application data and record type. - dataLen := len(plaintext) - if dataLen > tlsRecordMaxPlaintextSize { - dataLen = tlsRecordMaxPlaintextSize - } - remainingPlaintext = plaintext[dataLen:] - newRecordBuf := p.outRecordsBuf[recordStartIndex:] - - copy(newRecordBuf[tlsRecordHeaderSize:], plaintext[:dataLen]) - newRecordBuf[tlsRecordHeaderSize+dataLen] = recordType - payload := newRecordBuf[tlsRecordHeaderSize : tlsRecordHeaderSize+dataLen+1] // 1 is for the recordType. - // Construct the header. - newRecordBuf[0] = tlsApplicationData - newRecordBuf[1] = tlsLegacyRecordVersion - newRecordBuf[2] = tlsLegacyRecordVersion - binary.BigEndian.PutUint16(newRecordBuf[3:], uint16(len(payload)+tlsTagSize)) - header := newRecordBuf[:tlsRecordHeaderSize] - - // Encrypt the payload using header as aad. - encryptedPayload, err := p.outConn.Encrypt(newRecordBuf[tlsRecordHeaderSize:][:0], payload, header) - if err != nil { - return 0, plaintext, err - } - recordStartIndex += len(header) + len(encryptedPayload) - return recordStartIndex, remainingPlaintext, nil -} - -func (p *conn) Close() error { - p.readMutex.Lock() - defer p.readMutex.Unlock() - p.writeMutex.Lock() - defer p.writeMutex.Unlock() - // If p.ticketState is equal to notReceivingTickets, then S2A has - // been sent a flight of session tickets, and we must wait for the - // call to S2A to complete before closing the record protocol. - if p.ticketState == notReceivingTickets { - <-p.callComplete - grpclog.Infof("Safe to close the connection because sending tickets to S2A is (already) complete.") - } - return p.Conn.Close() -} - -// stripPaddingAndType strips the padding by zeros and record type from -// p.pendingApplicationData and returns the record type. Note that -// p.pendingApplicationData should be of the form: -// [application data] + [record type byte] + [trailing zeros] -func (p *conn) stripPaddingAndType() (recordType, error) { - if len(p.pendingApplicationData) == 0 { - return 0, errors.New("application data had length 0") - } - i := len(p.pendingApplicationData) - 1 - // Search for the index of the record type byte. - for i > 0 { - if p.pendingApplicationData[i] != 0 { - break - } - i-- - } - rt := recordType(p.pendingApplicationData[i]) - p.pendingApplicationData = p.pendingApplicationData[:i] - return rt, nil -} - -// readFullRecord reads from the wire until a record is completed and returns -// the full record. -func (p *conn) readFullRecord() (fullRecord []byte, err error) { - fullRecord, p.nextRecord, err = parseReadBuffer(p.nextRecord, tlsRecordMaxPayloadSize) - if err != nil { - return nil, err - } - // Check whether the next record to be decrypted has been completely - // received. - if len(fullRecord) == 0 { - copy(p.unusedBuf, p.nextRecord) - p.unusedBuf = p.unusedBuf[:len(p.nextRecord)] - // Always copy next incomplete record to the beginning of the - // unusedBuf buffer and reset nextRecord to it. - p.nextRecord = p.unusedBuf - } - // Keep reading from the wire until we have a complete record. - for len(fullRecord) == 0 { - if len(p.unusedBuf) == cap(p.unusedBuf) { - tmp := make([]byte, len(p.unusedBuf), cap(p.unusedBuf)+tlsRecordMaxSize) - copy(tmp, p.unusedBuf) - p.unusedBuf = tmp - } - n, err := p.Conn.Read(p.unusedBuf[len(p.unusedBuf):min(cap(p.unusedBuf), len(p.unusedBuf)+tlsRecordMaxSize)]) - if err != nil { - return nil, err - } - p.unusedBuf = p.unusedBuf[:len(p.unusedBuf)+n] - fullRecord, p.nextRecord, err = parseReadBuffer(p.unusedBuf, tlsRecordMaxPayloadSize) - if err != nil { - return nil, err - } - } - return fullRecord, nil -} - -// parseReadBuffer parses the provided buffer and returns a full record and any -// remaining bytes in that buffer. If the record is incomplete, nil is returned -// for the first return value and the given byte buffer is returned for the -// second return value. The length of the payload specified by the header should -// not be greater than maxLen, otherwise an error is returned. Note that this -// function does not allocate or copy any buffers. -func parseReadBuffer(b []byte, maxLen uint16) (fullRecord, remaining []byte, err error) { - // If the header is not complete, return the provided buffer as remaining - // buffer. - if len(b) < tlsRecordHeaderSize { - return nil, b, nil - } - msgLenField := b[tlsRecordHeaderTypeSize+tlsRecordHeaderLegacyRecordVersionSize : tlsRecordHeaderSize] - length := binary.BigEndian.Uint16(msgLenField) - if length > maxLen { - return nil, nil, fmt.Errorf("record length larger than the limit %d", maxLen) - } - if len(b) < int(length)+tlsRecordHeaderSize { - // Record is not complete yet. - return nil, b, nil - } - return b[:tlsRecordHeaderSize+length], b[tlsRecordHeaderSize+length:], nil -} - -// splitAndValidateHeader splits the header from the payload in the TLS 1.3 -// record and returns them. Note that the header is checked for validity, and an -// error is returned when an invalid header is parsed. Also note that this -// function does not allocate or copy any buffers. -func splitAndValidateHeader(record []byte) (header, payload []byte, err error) { - if len(record) < tlsRecordHeaderSize { - return nil, nil, fmt.Errorf("record was smaller than the header size") - } - header = record[:tlsRecordHeaderSize] - payload = record[tlsRecordHeaderSize:] - if header[0] != tlsApplicationData { - return nil, nil, fmt.Errorf("incorrect type in the header") - } - // Check the legacy record version, which should be 0x03, 0x03. - if header[1] != 0x03 || header[2] != 0x03 { - return nil, nil, fmt.Errorf("incorrect legacy record version in the header") - } - return header, payload, nil -} - -// handleAlertMessage handles an alert message. -func (p *conn) handleAlertMessage() error { - if len(p.pendingApplicationData) != tlsAlertSize { - return errors.New("invalid alert message size") - } - alertType := p.pendingApplicationData[1] - // Clear the body of the alert message. - p.pendingApplicationData = p.pendingApplicationData[:0] - if alertType == byte(closeNotify) { - return errors.New("received a close notify alert") - } - // TODO(matthewstevenson88): Add support for more alert types. - return fmt.Errorf("received an unrecognized alert type: %v", alertType) -} - -// parseHandshakeHeader parses a handshake message from the handshake buffer. -// It returns the message type, the message length, the message, the raw message -// that includes the type and length bytes and a flag indicating whether the -// handshake message has been fully parsed. i.e. whether the entire handshake -// message was in the handshake buffer. -func (p *conn) parseHandshakeMsg() (msgType byte, msgLen uint32, msg []byte, rawMsg []byte, ok bool) { - // Handle the case where the 4 byte handshake header is fragmented. - if len(p.handshakeBuf) < tlsHandshakePrefixSize { - return 0, 0, nil, nil, false - } - msgType = p.handshakeBuf[0] - msgLen = bigEndianInt24(p.handshakeBuf[tlsHandshakeMsgTypeSize : tlsHandshakeMsgTypeSize+tlsHandshakeLengthSize]) - if msgLen > uint32(len(p.handshakeBuf)-tlsHandshakePrefixSize) { - return 0, 0, nil, nil, false - } - msg = p.handshakeBuf[tlsHandshakePrefixSize : tlsHandshakePrefixSize+msgLen] - rawMsg = p.handshakeBuf[:tlsHandshakeMsgTypeSize+tlsHandshakeLengthSize+msgLen] - p.handshakeBuf = p.handshakeBuf[tlsHandshakePrefixSize+msgLen:] - return msgType, msgLen, msg, rawMsg, true -} - -// handleHandshakeMessage handles a handshake message. Note that the first -// complete handshake message from the handshake buffer is removed, if it -// exists. -func (p *conn) handleHandshakeMessage() error { - // Copy the pending application data to the handshake buffer. At this point, - // we are guaranteed that the pending application data contains only parts - // of a handshake message. - p.handshakeBuf = append(p.handshakeBuf, p.pendingApplicationData...) - p.pendingApplicationData = p.pendingApplicationData[:0] - // Several handshake messages may be coalesced into a single record. - // Continue reading them until the handshake buffer is empty. - for len(p.handshakeBuf) > 0 { - handshakeMsgType, msgLen, msg, rawMsg, ok := p.parseHandshakeMsg() - if !ok { - // The handshake could not be fully parsed, so read in another - // record and try again later. - break - } - switch handshakeMsgType { - case tlsHandshakeKeyUpdateType: - if msgLen != tlsHandshakeKeyUpdateMsgSize { - return errors.New("invalid handshake key update message length") - } - if len(p.handshakeBuf) != 0 { - return errors.New("key update message must be the last message of a handshake record") - } - if err := p.handleKeyUpdateMsg(msg); err != nil { - return err - } - case tlsHandshakeNewSessionTicketType: - // Ignore tickets that are received after a batch of tickets has - // been sent to S2A. - if p.ticketState == notReceivingTickets { - continue - } - if p.ticketState == ticketsNotYetReceived { - p.ticketState = receivingTickets - } - p.sessionTickets = append(p.sessionTickets, rawMsg) - if len(p.sessionTickets) == maxAllowedTickets { - p.ticketState = notReceivingTickets - grpclog.Infof("Sending session tickets to S2A.") - p.ticketSender.sendTicketsToS2A(p.sessionTickets, p.callComplete) - } - default: - return errors.New("unknown handshake message type") - } - } - return nil -} - -func buildKeyUpdateRequest() []byte { - b := make([]byte, tlsHandshakePrefixSize+tlsHandshakeKeyUpdateMsgSize) - b[0] = tlsHandshakeKeyUpdateType - b[1] = 0 - b[2] = 0 - b[3] = tlsHandshakeKeyUpdateMsgSize - b[4] = byte(updateNotRequested) - return b -} - -// handleKeyUpdateMsg handles a key update message. -func (p *conn) handleKeyUpdateMsg(msg []byte) error { - keyUpdateRequest := msg[0] - if keyUpdateRequest != byte(updateNotRequested) && - keyUpdateRequest != byte(updateRequested) { - return errors.New("invalid handshake key update message") - } - if err := p.inConn.UpdateKey(); err != nil { - return err - } - // Send a key update message back to the peer if requested. - if keyUpdateRequest == byte(updateRequested) { - p.writeMutex.Lock() - defer p.writeMutex.Unlock() - n, err := p.writeTLSRecord(preConstructedKeyUpdateMsg, byte(handshake)) - if err != nil { - return err - } - if n != tlsHandshakePrefixSize+tlsHandshakeKeyUpdateMsgSize { - return errors.New("key update request message wrote less bytes than expected") - } - if err = p.outConn.UpdateKey(); err != nil { - return err - } - } - return nil -} - -// bidEndianInt24 converts the given byte buffer of at least size 3 and -// outputs the resulting 24 bit integer as a uint32. This is needed because -// TLS 1.3 requires 3 byte integers, and the binary.BigEndian package does -// not provide a way to transform a byte buffer into a 3 byte integer. -func bigEndianInt24(b []byte) uint32 { - _ = b[2] // bounds check hint to compiler; see golang.org/issue/14808 - return uint32(b[2]) | uint32(b[1])<<8 | uint32(b[0])<<16 -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/ticketsender.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/ticketsender.go deleted file mode 100644 index e51199ab3ac2..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/record/ticketsender.go +++ /dev/null @@ -1,178 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package record - -import ( - "context" - "fmt" - "sync" - "time" - - "github.com/google/s2a-go/internal/handshaker/service" - commonpb "github.com/google/s2a-go/internal/proto/common_go_proto" - s2apb "github.com/google/s2a-go/internal/proto/s2a_go_proto" - "github.com/google/s2a-go/internal/tokenmanager" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" -) - -// sessionTimeout is the timeout for creating a session with the S2A handshaker -// service. -const sessionTimeout = time.Second * 5 - -// s2aTicketSender sends session tickets to the S2A handshaker service. -type s2aTicketSender interface { - // sendTicketsToS2A sends the given session tickets to the S2A handshaker - // service. - sendTicketsToS2A(sessionTickets [][]byte, callComplete chan bool) -} - -// ticketStream is the stream used to send and receive session information. -type ticketStream interface { - Send(*s2apb.SessionReq) error - Recv() (*s2apb.SessionResp, error) -} - -type ticketSender struct { - // hsAddr stores the address of the S2A handshaker service. - hsAddr string - // connectionID is the connection identifier that was created and sent by - // S2A at the end of a handshake. - connectionID uint64 - // localIdentity is the local identity that was used by S2A during session - // setup and included in the session result. - localIdentity *commonpb.Identity - // tokenManager manages access tokens for authenticating to S2A. - tokenManager tokenmanager.AccessTokenManager - // ensureProcessSessionTickets allows users to wait and ensure that all - // available session tickets are sent to S2A before a process completes. - ensureProcessSessionTickets *sync.WaitGroup -} - -// sendTicketsToS2A sends the given sessionTickets to the S2A handshaker -// service. This is done asynchronously and writes to the error logs if an error -// occurs. -func (t *ticketSender) sendTicketsToS2A(sessionTickets [][]byte, callComplete chan bool) { - // Note that the goroutine is in the function rather than at the caller - // because the fake ticket sender used for testing must run synchronously - // so that the session tickets can be accessed from it after the tests have - // been run. - if t.ensureProcessSessionTickets != nil { - t.ensureProcessSessionTickets.Add(1) - } - go func() { - if err := func() error { - defer func() { - if t.ensureProcessSessionTickets != nil { - t.ensureProcessSessionTickets.Done() - } - }() - ctx, cancel := context.WithTimeout(context.Background(), sessionTimeout) - defer cancel() - // The transportCreds only needs to be set when talking to S2AV2 and also - // if mTLS is required. - hsConn, err := service.Dial(ctx, t.hsAddr, nil) - if err != nil { - return err - } - client := s2apb.NewS2AServiceClient(hsConn) - session, err := client.SetUpSession(ctx) - if err != nil { - return err - } - defer func() { - if err := session.CloseSend(); err != nil { - grpclog.Error(err) - } - }() - return t.writeTicketsToStream(session, sessionTickets) - }(); err != nil { - grpclog.Errorf("failed to send resumption tickets to S2A with identity: %v, %v", - t.localIdentity, err) - } - callComplete <- true - close(callComplete) - }() -} - -// writeTicketsToStream writes the given session tickets to the given stream. -func (t *ticketSender) writeTicketsToStream(stream ticketStream, sessionTickets [][]byte) error { - if err := stream.Send( - &s2apb.SessionReq{ - ReqOneof: &s2apb.SessionReq_ResumptionTicket{ - ResumptionTicket: &s2apb.ResumptionTicketReq{ - InBytes: sessionTickets, - ConnectionId: t.connectionID, - LocalIdentity: t.localIdentity, - }, - }, - AuthMechanisms: t.getAuthMechanisms(), - }, - ); err != nil { - return err - } - sessionResp, err := stream.Recv() - if err != nil { - return err - } - if sessionResp.GetStatus().GetCode() != uint32(codes.OK) { - return fmt.Errorf("s2a session ticket response had error status: %v, %v", - sessionResp.GetStatus().GetCode(), sessionResp.GetStatus().GetDetails()) - } - return nil -} - -func (t *ticketSender) getAuthMechanisms() []*s2apb.AuthenticationMechanism { - if t.tokenManager == nil { - return nil - } - // First handle the special case when no local identity has been provided - // by the application. In this case, an AuthenticationMechanism with no local - // identity will be sent. - if t.localIdentity == nil { - token, err := t.tokenManager.DefaultToken() - if err != nil { - grpclog.Infof("unable to get token for empty local identity: %v", err) - return nil - } - return []*s2apb.AuthenticationMechanism{ - { - MechanismOneof: &s2apb.AuthenticationMechanism_Token{ - Token: token, - }, - }, - } - } - - // Next, handle the case where the application (or the S2A) has specified - // a local identity. - token, err := t.tokenManager.Token(t.localIdentity) - if err != nil { - grpclog.Infof("unable to get token for local identity %v: %v", t.localIdentity, err) - return nil - } - return []*s2apb.AuthenticationMechanism{ - { - Identity: t.localIdentity, - MechanismOneof: &s2apb.AuthenticationMechanism_Token{ - Token: token, - }, - }, - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go deleted file mode 100644 index ec96ba3b6a66..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/tokenmanager/tokenmanager.go +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Package tokenmanager provides tokens for authenticating to S2A. -package tokenmanager - -import ( - "fmt" - "os" - - commonpb "github.com/google/s2a-go/internal/proto/common_go_proto" -) - -const ( - s2aAccessTokenEnvironmentVariable = "S2A_ACCESS_TOKEN" -) - -// AccessTokenManager manages tokens for authenticating to S2A. -type AccessTokenManager interface { - // DefaultToken returns a token that an application with no specified local - // identity must use to authenticate to S2A. - DefaultToken() (token string, err error) - // Token returns a token that an application with local identity equal to - // identity must use to authenticate to S2A. - Token(identity *commonpb.Identity) (token string, err error) -} - -type singleTokenAccessTokenManager struct { - token string -} - -// NewSingleTokenAccessTokenManager returns a new AccessTokenManager instance -// that will always manage the same token. -// -// The token to be managed is read from the s2aAccessTokenEnvironmentVariable -// environment variable. If this environment variable is not set, then this -// function returns an error. -func NewSingleTokenAccessTokenManager() (AccessTokenManager, error) { - token, variableExists := os.LookupEnv(s2aAccessTokenEnvironmentVariable) - if !variableExists { - return nil, fmt.Errorf("%s environment variable is not set", s2aAccessTokenEnvironmentVariable) - } - return &singleTokenAccessTokenManager{token: token}, nil -} - -// DefaultToken always returns the token managed by the -// singleTokenAccessTokenManager. -func (m *singleTokenAccessTokenManager) DefaultToken() (string, error) { - return m.token, nil -} - -// Token always returns the token managed by the singleTokenAccessTokenManager. -func (m *singleTokenAccessTokenManager) Token(*commonpb.Identity) (string, error) { - return m.token, nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/README.md b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/README.md deleted file mode 100644 index 3806d1e9ccc9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/README.md +++ /dev/null @@ -1 +0,0 @@ -**This directory has the implementation of the S2Av2's gRPC-Go client libraries** diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/certverifier.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/certverifier.go deleted file mode 100644 index cc811879b532..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/certverifier.go +++ /dev/null @@ -1,122 +0,0 @@ -/* - * - * Copyright 2022 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. - * - */ - -// Package certverifier offloads verifications to S2Av2. -package certverifier - -import ( - "crypto/x509" - "fmt" - - "github.com/google/s2a-go/stream" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - - s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto" -) - -// VerifyClientCertificateChain builds a SessionReq, sends it to S2Av2 and -// receives a SessionResp. -func VerifyClientCertificateChain(verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, s2AStream stream.S2AStream) func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { - return func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { - // Offload verification to S2Av2. - if grpclog.V(1) { - grpclog.Infof("Sending request to S2Av2 for client peer cert chain validation.") - } - if err := s2AStream.Send(&s2av2pb.SessionReq{ - ReqOneof: &s2av2pb.SessionReq_ValidatePeerCertificateChainReq{ - ValidatePeerCertificateChainReq: &s2av2pb.ValidatePeerCertificateChainReq{ - Mode: verificationMode, - PeerOneof: &s2av2pb.ValidatePeerCertificateChainReq_ClientPeer_{ - ClientPeer: &s2av2pb.ValidatePeerCertificateChainReq_ClientPeer{ - CertificateChain: rawCerts, - }, - }, - }, - }, - }); err != nil { - grpclog.Infof("Failed to send request to S2Av2 for client peer cert chain validation.") - return err - } - - // Get the response from S2Av2. - resp, err := s2AStream.Recv() - if err != nil { - grpclog.Infof("Failed to receive client peer cert chain validation response from S2Av2.") - return err - } - - // Parse the response. - if (resp.GetStatus() != nil) && (resp.GetStatus().Code != uint32(codes.OK)) { - return fmt.Errorf("failed to offload client cert verification to S2A: %d, %v", resp.GetStatus().Code, resp.GetStatus().Details) - - } - - if resp.GetValidatePeerCertificateChainResp().ValidationResult != s2av2pb.ValidatePeerCertificateChainResp_SUCCESS { - return fmt.Errorf("client cert verification failed: %v", resp.GetValidatePeerCertificateChainResp().ValidationDetails) - } - - return nil - } -} - -// VerifyServerCertificateChain builds a SessionReq, sends it to S2Av2 and -// receives a SessionResp. -func VerifyServerCertificateChain(hostname string, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, s2AStream stream.S2AStream, serverAuthorizationPolicy []byte) func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { - return func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { - // Offload verification to S2Av2. - if grpclog.V(1) { - grpclog.Infof("Sending request to S2Av2 for server peer cert chain validation.") - } - if err := s2AStream.Send(&s2av2pb.SessionReq{ - ReqOneof: &s2av2pb.SessionReq_ValidatePeerCertificateChainReq{ - ValidatePeerCertificateChainReq: &s2av2pb.ValidatePeerCertificateChainReq{ - Mode: verificationMode, - PeerOneof: &s2av2pb.ValidatePeerCertificateChainReq_ServerPeer_{ - ServerPeer: &s2av2pb.ValidatePeerCertificateChainReq_ServerPeer{ - CertificateChain: rawCerts, - ServerHostname: hostname, - SerializedUnrestrictedClientPolicy: serverAuthorizationPolicy, - }, - }, - }, - }, - }); err != nil { - grpclog.Infof("Failed to send request to S2Av2 for server peer cert chain validation.") - return err - } - - // Get the response from S2Av2. - resp, err := s2AStream.Recv() - if err != nil { - grpclog.Infof("Failed to receive server peer cert chain validation response from S2Av2.") - return err - } - - // Parse the response. - if (resp.GetStatus() != nil) && (resp.GetStatus().Code != uint32(codes.OK)) { - return fmt.Errorf("failed to offload server cert verification to S2A: %d, %v", resp.GetStatus().Code, resp.GetStatus().Details) - } - - if resp.GetValidatePeerCertificateChainResp().ValidationResult != s2av2pb.ValidatePeerCertificateChainResp_SUCCESS { - return fmt.Errorf("server cert verification failed: %v", resp.GetValidatePeerCertificateChainResp().ValidationDetails) - } - - return nil - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_intermediate_cert.der b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_intermediate_cert.der deleted file mode 100644 index 958f3cfaddf3..000000000000 Binary files a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_intermediate_cert.der and /dev/null differ diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_leaf_cert.der b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_leaf_cert.der deleted file mode 100644 index d2817641bafb..000000000000 Binary files a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_leaf_cert.der and /dev/null differ diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_root_cert.der b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_root_cert.der deleted file mode 100644 index d8c3710c85f9..000000000000 Binary files a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/client_root_cert.der and /dev/null differ diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_intermediate_cert.der b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_intermediate_cert.der deleted file mode 100644 index dae619c09751..000000000000 Binary files a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_intermediate_cert.der and /dev/null differ diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_leaf_cert.der b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_leaf_cert.der deleted file mode 100644 index ce7f8d31d680..000000000000 Binary files a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_leaf_cert.der and /dev/null differ diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_root_cert.der b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_root_cert.der deleted file mode 100644 index 04b0d73600b7..000000000000 Binary files a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/certverifier/testdata/server_root_cert.der and /dev/null differ diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/remotesigner.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/remotesigner.go deleted file mode 100644 index e7478d43fbc2..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/remotesigner.go +++ /dev/null @@ -1,186 +0,0 @@ -/* - * - * Copyright 2022 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. - * - */ - -// Package remotesigner offloads private key operations to S2Av2. -package remotesigner - -import ( - "crypto" - "crypto/rsa" - "crypto/x509" - "fmt" - "io" - - "github.com/google/s2a-go/stream" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - - s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto" -) - -// remoteSigner implementes the crypto.Signer interface. -type remoteSigner struct { - leafCert *x509.Certificate - s2AStream stream.S2AStream -} - -// New returns an instance of RemoteSigner, an implementation of the -// crypto.Signer interface. -func New(leafCert *x509.Certificate, s2AStream stream.S2AStream) crypto.Signer { - return &remoteSigner{leafCert, s2AStream} -} - -func (s *remoteSigner) Public() crypto.PublicKey { - return s.leafCert.PublicKey -} - -func (s *remoteSigner) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error) { - signatureAlgorithm, err := getSignatureAlgorithm(opts, s.leafCert) - if err != nil { - return nil, err - } - - req, err := getSignReq(signatureAlgorithm, digest) - if err != nil { - return nil, err - } - if grpclog.V(1) { - grpclog.Infof("Sending request to S2Av2 for signing operation.") - } - if err := s.s2AStream.Send(&s2av2pb.SessionReq{ - ReqOneof: &s2av2pb.SessionReq_OffloadPrivateKeyOperationReq{ - OffloadPrivateKeyOperationReq: req, - }, - }); err != nil { - grpclog.Infof("Failed to send request to S2Av2 for signing operation.") - return nil, err - } - - resp, err := s.s2AStream.Recv() - if err != nil { - grpclog.Infof("Failed to receive signing operation response from S2Av2.") - return nil, err - } - - if (resp.GetStatus() != nil) && (resp.GetStatus().Code != uint32(codes.OK)) { - return nil, fmt.Errorf("failed to offload signing with private key to S2A: %d, %v", resp.GetStatus().Code, resp.GetStatus().Details) - } - - return resp.GetOffloadPrivateKeyOperationResp().GetOutBytes(), nil -} - -// getCert returns the leafCert field in s. -func (s *remoteSigner) getCert() *x509.Certificate { - return s.leafCert -} - -// getStream returns the s2AStream field in s. -func (s *remoteSigner) getStream() stream.S2AStream { - return s.s2AStream -} - -func getSignReq(signatureAlgorithm s2av2pb.SignatureAlgorithm, digest []byte) (*s2av2pb.OffloadPrivateKeyOperationReq, error) { - if (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA256) || (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP256R1_SHA256) || (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA256) { - return &s2av2pb.OffloadPrivateKeyOperationReq{ - Operation: s2av2pb.OffloadPrivateKeyOperationReq_SIGN, - SignatureAlgorithm: signatureAlgorithm, - InBytes: &s2av2pb.OffloadPrivateKeyOperationReq_Sha256Digest{ - Sha256Digest: digest, - }, - }, nil - } else if (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA384) || (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP384R1_SHA384) || (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA384) { - return &s2av2pb.OffloadPrivateKeyOperationReq{ - Operation: s2av2pb.OffloadPrivateKeyOperationReq_SIGN, - SignatureAlgorithm: signatureAlgorithm, - InBytes: &s2av2pb.OffloadPrivateKeyOperationReq_Sha384Digest{ - Sha384Digest: digest, - }, - }, nil - } else if (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA512) || (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP521R1_SHA512) || (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA512) || (signatureAlgorithm == s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_ED25519) { - return &s2av2pb.OffloadPrivateKeyOperationReq{ - Operation: s2av2pb.OffloadPrivateKeyOperationReq_SIGN, - SignatureAlgorithm: signatureAlgorithm, - InBytes: &s2av2pb.OffloadPrivateKeyOperationReq_Sha512Digest{ - Sha512Digest: digest, - }, - }, nil - } else { - return nil, fmt.Errorf("unknown signature algorithm: %v", signatureAlgorithm) - } -} - -// getSignatureAlgorithm returns the signature algorithm that S2A must use when -// performing a signing operation that has been offloaded by an application -// using the crypto/tls libraries. -func getSignatureAlgorithm(opts crypto.SignerOpts, leafCert *x509.Certificate) (s2av2pb.SignatureAlgorithm, error) { - if opts == nil || leafCert == nil { - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_UNSPECIFIED, fmt.Errorf("unknown signature algorithm") - } - switch leafCert.PublicKeyAlgorithm { - case x509.RSA: - if rsaPSSOpts, ok := opts.(*rsa.PSSOptions); ok { - return rsaPSSAlgorithm(rsaPSSOpts) - } - return rsaPPKCS1Algorithm(opts) - case x509.ECDSA: - return ecdsaAlgorithm(opts) - case x509.Ed25519: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_ED25519, nil - default: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_UNSPECIFIED, fmt.Errorf("unknown signature algorithm: %q", leafCert.PublicKeyAlgorithm) - } -} - -func rsaPSSAlgorithm(opts *rsa.PSSOptions) (s2av2pb.SignatureAlgorithm, error) { - switch opts.HashFunc() { - case crypto.SHA256: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA256, nil - case crypto.SHA384: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA384, nil - case crypto.SHA512: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PSS_RSAE_SHA512, nil - default: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_UNSPECIFIED, fmt.Errorf("unknown signature algorithm") - } -} - -func rsaPPKCS1Algorithm(opts crypto.SignerOpts) (s2av2pb.SignatureAlgorithm, error) { - switch opts.HashFunc() { - case crypto.SHA256: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA256, nil - case crypto.SHA384: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA384, nil - case crypto.SHA512: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_RSA_PKCS1_SHA512, nil - default: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_UNSPECIFIED, fmt.Errorf("unknown signature algorithm") - } -} - -func ecdsaAlgorithm(opts crypto.SignerOpts) (s2av2pb.SignatureAlgorithm, error) { - switch opts.HashFunc() { - case crypto.SHA256: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP256R1_SHA256, nil - case crypto.SHA384: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP384R1_SHA384, nil - case crypto.SHA512: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_ECDSA_SECP521R1_SHA512, nil - default: - return s2av2pb.SignatureAlgorithm_S2A_SSL_SIGN_UNSPECIFIED, fmt.Errorf("unknown signature algorithm") - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.der b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.der deleted file mode 100644 index d8c3710c85f9..000000000000 Binary files a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.der and /dev/null differ diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.pem deleted file mode 100644 index 493a5a264810..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_cert.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIUKXNlBRVe6UepjQUijIFPZBd/4qYwDQYJKoZIhvcNAQEL -BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 -YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE -AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN -MjIwNTMxMjAwMzE1WhcNNDIwNTI2MjAwMzE1WjCBhzELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx -ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ -KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAOOFuIucH7XXfohGxKd3uR/ihUA/LdduR9I8kfpUEbq5BOt8xZe5/Yn9 -a1ozEHVW6cOAbHbnwAR8tkSgZ/t42QIA2k77HWU1Jh2xiEIsJivo3imm4/kZWuR0 -OqPh7MhzxpR/hvNwpI5mJsAVBWFMa5KtecFZLnyZtwHylrRN1QXzuLrOxuKFufK3 -RKbTABScn5RbZL976H/jgfSeXrbt242NrIoBnVe6fRbekbq2DQ6zFArbQMUgHjHK -P0UqBgdr1QmHfi9KytFyx9BTP3gXWnWIu+bY7/v7qKJMHFwGETo+dCLWYevJL316 -HnLfhApDMfP8U+Yv/y1N/YvgaSOSlEcCAwEAAaNTMFEwHQYDVR0OBBYEFKhAU4nu -0h/lrnggbIGvx4ej0WklMB8GA1UdIwQYMBaAFKhAU4nu0h/lrnggbIGvx4ej0Wkl -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/6NghzQ5fu6yR6 -EHKbj/YMrFdT7aGn5n2sAf7wJ33LIhiFHkpWBsVlm7rDtZtwhe891ZK/P60anlg9 -/P0Ua53tSRVRmCvTnEbXWOVMN4is6MsR7BlmzUxl4AtIn7jbeifEwRL7B4xDYmdA -QrQnsqoz45dLgS5xK4WDqXATP09Q91xQDuhud/b+A4jrvgwFASmL7rMIZbp4f1JQ -nlnl/9VoTBQBvJiWkDUtQDMpRLtauddEkv4AGz75p5IspXWD6cOemuh2iQec11xD -X20rs2WZbAcAiUa3nmy8OKYw435vmpj8gp39WYbX/Yx9TymrFFbVY92wYn+quTco -pKklVz0= ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_key.pem deleted file mode 100644 index 55a7f10c742d..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/client_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEA44W4i5wftdd+iEbEp3e5H+KFQD8t125H0jyR+lQRurkE63zF -l7n9if1rWjMQdVbpw4BsdufABHy2RKBn+3jZAgDaTvsdZTUmHbGIQiwmK+jeKabj -+Rla5HQ6o+HsyHPGlH+G83CkjmYmwBUFYUxrkq15wVkufJm3AfKWtE3VBfO4us7G -4oW58rdEptMAFJyflFtkv3vof+OB9J5etu3bjY2sigGdV7p9Ft6RurYNDrMUCttA -xSAeMco/RSoGB2vVCYd+L0rK0XLH0FM/eBdadYi75tjv+/uookwcXAYROj50ItZh -68kvfXoect+ECkMx8/xT5i//LU39i+BpI5KURwIDAQABAoIBABgyjo/6iLzUMFbZ -/+w3pW6orrdIgN2akvTfED9pVYFgUA+jc3hRhY95bkNnjuaL2cy7Cc4Tk65mfRQL -Y0OxdJLr+EvSFSxAXM9npDA1ddHRsF8JqtFBSxNk8R+g1Yf0GDiO35Fgd3/ViWWA -VtQkRoSRApP3oiQKTRZd8H04keFR+PvmDk/Lq11l3Kc24A1PevKIPX1oI990ggw9 -9i4uSV+cnuMxmcI9xxJtgwdDFdjr39l2arLOHr4s6LGoV2IOdXHNlv5xRqWUZ0FH -MDHowkLgwDrdSTnNeaVNkce14Gqx+bd4hNaLCdKXMpedBTEmrut3f3hdV1kKjaKt -aqRYr8ECgYEA/YDGZY2jvFoHHBywlqmEMFrrCvQGH51m5R1Ntpkzr+Rh3YCmrpvq -xgwJXING0PUw3dz+xrH5lJICrfNE5Kt3fPu1rAEy+13mYsNowghtUq2Rtu0Hsjjx -2E3Bf8vEB6RNBMmGkUpTTIAroGF5tpJoRvfnWax+k4pFdrKYFtyZdNcCgYEA5cNv -EPltvOobjTXlUmtVP3n27KZN2aXexTcagLzRxE9CV4cYySENl3KuOMmccaZpIl6z -aHk6BT4X+M0LqElNUczrInfVqI+SGAFLGy7W6CJaqSr6cpyFUP/fosKpm6wKGgLq -udHfpvz5rckhKd8kJxFLvhGOK9yN5qpzih0gfhECgYAJfwRvk3G5wYmYpP58dlcs -VIuPenqsPoI3PPTHTU/hW+XKnWIhElgmGRdUrto9Q6IT/Y5RtSMLTLjq+Tzwb/fm -56rziYv2XJsfwgAvnI8z1Kqrto9ePsHYf3krJ1/thVsZPc9bq/QY3ohD1sLvcuaT -GgBBnLOVJU3a12/ZE2RwOwKBgF0csWMAoj8/5IB6if+3ral2xOGsl7oPZVMo/J2V -Z7EVqb4M6rd/pKFugTpUQgkwtkSOekhpcGD1hAN5HTNK2YG/+L5UMAsKe9sskwJm -HgOfAHy0BSDzW3ey6i9skg2bT9Cww+0gJ3Hl7U1HSCBO5LjMYpSZSrNtwzfqdb5Q -BX3xAoGARZdR28Ej3+/+0+fz47Yu2h4z0EI/EbrudLOWY936jIeAVwHckI3+BuqH -qR4poj1gfbnMxNuI9UzIXzjEmGewx9kDZ7IYnvloZKqoVQODO5GlKF2ja6IcMNlh -GCNdD6PSAS6HcmalmWo9sj+1YMkrl+GJikKZqVBHrHNwMGAG67w= ------END RSA PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.der b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.der deleted file mode 100644 index 04b0d73600b7..000000000000 Binary files a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.der and /dev/null differ diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.pem deleted file mode 100644 index 0f98322c7244..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_cert.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIUKCoDuLtiZXvhsBY2RoDm0ugizJ8wDQYJKoZIhvcNAQEL -BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 -YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE -AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN -MjIwNTMxMjAwODI1WhcNNDIwNTI2MjAwODI1WjCBhzELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx -ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ -KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKK1++PXQ+M3hjYH/v0K4UEYl5ljzpNM1i52eQM+gFooojT87PDSaphT -fs0PXy/PTAjHBEvPhWpOpmQXfJNYzjwcCvg66hbqkv++/VTZiFLAsHagzkEz+FRJ -qT5Eq7G5FLyw1izX1uxyPN7tAEWEEg7eqsiaXD3Cq8+TYN9cjirPeF7RZF8yFCYE -xqvbo+Yc6RL6xw19iXVTfctRgQe581KQuIY5/LXo3dWDEilFdsADAe8XAEcO64es -Ow0g1UvXLnpXSE151kXBFb3sKH/ZjCecDYMCIMEb4sWLSblkSxJ5sNSmXIG4wtr2 -Qnii7CXZgnVYraQE/Jyh+NMQANuoSdMCAwEAAaNTMFEwHQYDVR0OBBYEFAyQQQuM -ab+YUQqjK8dVVOoHVFmXMB8GA1UdIwQYMBaAFAyQQQuMab+YUQqjK8dVVOoHVFmX -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADj0vQ6ykWhicoqR -e6VZMwlEJV7/DSvWWKBd9MUjfKye0A4565ya5lmnzP3DiD3nqGe3miqmLsXKDs+X -POqlPXTWIamP7D4MJ32XtSLwZB4ru+I+Ao/P/VngPepoRPQoBnzHe7jww0rokqxl -AZERjlbTUwUAy/BPWPSzSJZ2j0tcs6ZLDNyYzpK4ao8R9/1VmQ92Tcp3feJs1QTg -odRQc3om/AkWOwsll+oyX0UbJeHkFHiLanUPXbdh+/BkSvZJ8ynL+feSDdaurPe+ -PSfnqLtQft9/neecGRdEaQzzzSFVQUVQzTdK1Q7hA7b55b2HvIa3ktDiks+sJsYN -Dhm6uZM= ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_key.pem deleted file mode 100644 index 81afea783df9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/remotesigner/testdata/server_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAorX749dD4zeGNgf+/QrhQRiXmWPOk0zWLnZ5Az6AWiiiNPzs -8NJqmFN+zQ9fL89MCMcES8+Fak6mZBd8k1jOPBwK+DrqFuqS/779VNmIUsCwdqDO -QTP4VEmpPkSrsbkUvLDWLNfW7HI83u0ARYQSDt6qyJpcPcKrz5Ng31yOKs94XtFk -XzIUJgTGq9uj5hzpEvrHDX2JdVN9y1GBB7nzUpC4hjn8tejd1YMSKUV2wAMB7xcA -Rw7rh6w7DSDVS9cueldITXnWRcEVvewof9mMJ5wNgwIgwRvixYtJuWRLEnmw1KZc -gbjC2vZCeKLsJdmCdVitpAT8nKH40xAA26hJ0wIDAQABAoIBACaNR+lsD8G+XiZf -LqN1+HkcAo9tfnyYMAdCOtnx7SdviT9Uzi8hK/B7mAeuJLeHPlS2EuaDfPD7QaFl -jza6S+MiIdc+3kgfvESsVAnOoOY6kZUJ9NSuI6CU82y1iJjLaYZrv9NQMLRFPPb0 -4KOX709mosB1EnXvshW0rbc+jtDFhrm1SxMt+k9TuzmMxjbOeW4LOLXPgU8X1T3Q -Xy0hMZZtcgBs9wFIo8yCtmOixax9pnFE8rRltgDxTodn9LLdz1FieyntNgDksZ0P -nt4kV7Mqly7ELaea+Foaj244mKsesic2e3GhAlMRLun/VSunSf7mOCxfpITB8dp1 -drDhOYECgYEA19151dVxRcviuovN6Dar+QszMTnU8pDJ8BjLFjXjP/hNBBwMTHDE -duMuWk2qnwZqMooI/shxrF/ufmTgS0CFrh2+ANBZu27vWConJNXcyNtdigI4wt50 -L0Y2qcZn2mg67qFXHwoR3QNwrwnPwEjRXA09at9CSRZzcwDQ0ETXhYsCgYEAwPaG -06QdK8Zyly7TTzZJwxzv9uGiqzodmGtX6NEKjgij2JaCxHpukqZBJoqa0jKeK1cm -eNVkOvT5ff9TMzarSHQLr3pZen2/oVLb5gaFkbcJt/klv9Fd+ZRilHY3i6QwS6pD -uMiPOWS4DrLHDRVoVlAZTDjT1RVwwTs+P2NhJdkCgYEAsriXysbxBYyMp05gqEW7 -lHIFbFgpSrs9th+Q5U6wW6JEgYaHWDJ1NslY80MiZI93FWjbkbZ7BvBWESeL3EIL -a+EMErht0pVCbIhZ6FF4foPAqia0wAJVx14mm+G80kNBp5jE/NnleEsE3KcO7nBb -hg8gLn+x7bk81JZ0TDrzBYkCgYEAuQKluv47SeF3tSScTfKLPpvcKCWmxe1uutkQ -7JShPhVioyOMNb39jnYBOWbjkm4d4QgqRuiytSR0oi3QI+Ziy5EYMyNn713qAk9j -r2TJZDDPDKnBW+zt4YI4EohWMXk3JRUW4XDKggjjwJQA7bZ812TtHHvP/xoThfG7 -eSNb3eECgYBw6ssgCtMrdvQiEmjKVX/9yI38mvC2kSGyzbrQnGUfgqRGomRpeZuD -B5E3kysA4td5pT5lvcLgSW0TbOz+YbiriXjwOihPIelCvc9gE2eOUI71/byUWPFz -7u5F/xQ4NaGr5suLF+lBC6h7pSbM4El9lIHQAQadpuEdzHqrw+hs3g== ------END RSA PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/s2av2.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/s2av2.go deleted file mode 100644 index 85a8379d8332..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/s2av2.go +++ /dev/null @@ -1,391 +0,0 @@ -/* - * - * Copyright 2022 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. - * - */ - -// Package v2 provides the S2Av2 transport credentials used by a gRPC -// application. -package v2 - -import ( - "context" - "crypto/tls" - "errors" - "net" - "os" - "time" - - "github.com/golang/protobuf/proto" - "github.com/google/s2a-go/fallback" - "github.com/google/s2a-go/internal/handshaker/service" - "github.com/google/s2a-go/internal/tokenmanager" - "github.com/google/s2a-go/internal/v2/tlsconfigstore" - "github.com/google/s2a-go/retry" - "github.com/google/s2a-go/stream" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/grpclog" - - commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto" - s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto" -) - -const ( - s2aSecurityProtocol = "tls" - defaultS2ATimeout = 6 * time.Second -) - -// An environment variable, which sets the timeout enforced on the connection to the S2A service for handshake. -const s2aTimeoutEnv = "S2A_TIMEOUT" - -type s2av2TransportCreds struct { - info *credentials.ProtocolInfo - isClient bool - serverName string - s2av2Address string - transportCreds credentials.TransportCredentials - tokenManager *tokenmanager.AccessTokenManager - // localIdentity should only be used by the client. - localIdentity *commonpbv1.Identity - // localIdentities should only be used by the server. - localIdentities []*commonpbv1.Identity - verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode - fallbackClientHandshake fallback.ClientHandshake - getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error) - serverAuthorizationPolicy []byte -} - -// NewClientCreds returns a client-side transport credentials object that uses -// the S2Av2 to establish a secure connection with a server. -func NewClientCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentity *commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, fallbackClientHandshakeFunc fallback.ClientHandshake, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error), serverAuthorizationPolicy []byte) (credentials.TransportCredentials, error) { - // Create an AccessTokenManager instance to use to authenticate to S2Av2. - accessTokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager() - - creds := &s2av2TransportCreds{ - info: &credentials.ProtocolInfo{ - SecurityProtocol: s2aSecurityProtocol, - }, - isClient: true, - serverName: "", - s2av2Address: s2av2Address, - transportCreds: transportCreds, - localIdentity: localIdentity, - verificationMode: verificationMode, - fallbackClientHandshake: fallbackClientHandshakeFunc, - getS2AStream: getS2AStream, - serverAuthorizationPolicy: serverAuthorizationPolicy, - } - if err != nil { - creds.tokenManager = nil - } else { - creds.tokenManager = &accessTokenManager - } - if grpclog.V(1) { - grpclog.Info("Created client S2Av2 transport credentials.") - } - return creds, nil -} - -// NewServerCreds returns a server-side transport credentials object that uses -// the S2Av2 to establish a secure connection with a client. -func NewServerCreds(s2av2Address string, transportCreds credentials.TransportCredentials, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error)) (credentials.TransportCredentials, error) { - // Create an AccessTokenManager instance to use to authenticate to S2Av2. - accessTokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager() - creds := &s2av2TransportCreds{ - info: &credentials.ProtocolInfo{ - SecurityProtocol: s2aSecurityProtocol, - }, - isClient: false, - s2av2Address: s2av2Address, - transportCreds: transportCreds, - localIdentities: localIdentities, - verificationMode: verificationMode, - getS2AStream: getS2AStream, - } - if err != nil { - creds.tokenManager = nil - } else { - creds.tokenManager = &accessTokenManager - } - if grpclog.V(1) { - grpclog.Info("Created server S2Av2 transport credentials.") - } - return creds, nil -} - -// ClientHandshake performs a client-side mTLS handshake using the S2Av2. -func (c *s2av2TransportCreds) ClientHandshake(ctx context.Context, serverAuthority string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { - if !c.isClient { - return nil, nil, errors.New("client handshake called using server transport credentials") - } - // Remove the port from serverAuthority. - serverName := removeServerNamePort(serverAuthority) - timeoutCtx, cancel := context.WithTimeout(ctx, GetS2ATimeout()) - defer cancel() - var s2AStream stream.S2AStream - var err error - retry.Run(timeoutCtx, - func() error { - s2AStream, err = createStream(timeoutCtx, c.s2av2Address, c.transportCreds, c.getS2AStream) - return err - }) - if err != nil { - grpclog.Infof("Failed to connect to S2Av2: %v", err) - if c.fallbackClientHandshake != nil { - return c.fallbackClientHandshake(ctx, serverAuthority, rawConn, err) - } - return nil, nil, err - } - defer s2AStream.CloseSend() - if grpclog.V(1) { - grpclog.Infof("Connected to S2Av2.") - } - var config *tls.Config - - var tokenManager tokenmanager.AccessTokenManager - if c.tokenManager == nil { - tokenManager = nil - } else { - tokenManager = *c.tokenManager - } - - sn := serverName - if c.serverName != "" { - sn = c.serverName - } - retry.Run(timeoutCtx, - func() error { - config, err = tlsconfigstore.GetTLSConfigurationForClient(sn, s2AStream, tokenManager, c.localIdentity, c.verificationMode, c.serverAuthorizationPolicy) - return err - }) - if err != nil { - grpclog.Info("Failed to get client TLS config from S2Av2: %v", err) - if c.fallbackClientHandshake != nil { - return c.fallbackClientHandshake(ctx, serverAuthority, rawConn, err) - } - return nil, nil, err - } - if grpclog.V(1) { - grpclog.Infof("Got client TLS config from S2Av2.") - } - - creds := credentials.NewTLS(config) - var conn net.Conn - var authInfo credentials.AuthInfo - retry.Run(timeoutCtx, - func() error { - conn, authInfo, err = creds.ClientHandshake(timeoutCtx, serverName, rawConn) - return err - }) - if err != nil { - grpclog.Infof("Failed to do client handshake using S2Av2: %v", err) - if c.fallbackClientHandshake != nil { - return c.fallbackClientHandshake(ctx, serverAuthority, rawConn, err) - } - return nil, nil, err - } - grpclog.Infof("Successfully done client handshake using S2Av2 to: %s", serverName) - - return conn, authInfo, err -} - -// ServerHandshake performs a server-side mTLS handshake using the S2Av2. -func (c *s2av2TransportCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { - if c.isClient { - return nil, nil, errors.New("server handshake called using client transport credentials") - } - ctx, cancel := context.WithTimeout(context.Background(), GetS2ATimeout()) - defer cancel() - var s2AStream stream.S2AStream - var err error - retry.Run(ctx, - func() error { - s2AStream, err = createStream(ctx, c.s2av2Address, c.transportCreds, c.getS2AStream) - return err - }) - if err != nil { - grpclog.Infof("Failed to connect to S2Av2: %v", err) - return nil, nil, err - } - defer s2AStream.CloseSend() - if grpclog.V(1) { - grpclog.Infof("Connected to S2Av2.") - } - - var tokenManager tokenmanager.AccessTokenManager - if c.tokenManager == nil { - tokenManager = nil - } else { - tokenManager = *c.tokenManager - } - - var config *tls.Config - retry.Run(ctx, - func() error { - config, err = tlsconfigstore.GetTLSConfigurationForServer(s2AStream, tokenManager, c.localIdentities, c.verificationMode) - return err - }) - if err != nil { - grpclog.Infof("Failed to get server TLS config from S2Av2: %v", err) - return nil, nil, err - } - if grpclog.V(1) { - grpclog.Infof("Got server TLS config from S2Av2.") - } - - creds := credentials.NewTLS(config) - var conn net.Conn - var authInfo credentials.AuthInfo - retry.Run(ctx, - func() error { - conn, authInfo, err = creds.ServerHandshake(rawConn) - return err - }) - if err != nil { - grpclog.Infof("Failed to do server handshake using S2Av2: %v", err) - return nil, nil, err - } - return conn, authInfo, err -} - -// Info returns protocol info of s2av2TransportCreds. -func (c *s2av2TransportCreds) Info() credentials.ProtocolInfo { - return *c.info -} - -// Clone makes a deep copy of s2av2TransportCreds. -func (c *s2av2TransportCreds) Clone() credentials.TransportCredentials { - info := *c.info - serverName := c.serverName - fallbackClientHandshake := c.fallbackClientHandshake - - s2av2Address := c.s2av2Address - var tokenManager tokenmanager.AccessTokenManager - if c.tokenManager == nil { - tokenManager = nil - } else { - tokenManager = *c.tokenManager - } - verificationMode := c.verificationMode - var localIdentity *commonpbv1.Identity - if c.localIdentity != nil { - localIdentity = proto.Clone(c.localIdentity).(*commonpbv1.Identity) - } - var localIdentities []*commonpbv1.Identity - if c.localIdentities != nil { - localIdentities = make([]*commonpbv1.Identity, len(c.localIdentities)) - for i, localIdentity := range c.localIdentities { - localIdentities[i] = proto.Clone(localIdentity).(*commonpbv1.Identity) - } - } - creds := &s2av2TransportCreds{ - info: &info, - isClient: c.isClient, - serverName: serverName, - fallbackClientHandshake: fallbackClientHandshake, - s2av2Address: s2av2Address, - localIdentity: localIdentity, - localIdentities: localIdentities, - verificationMode: verificationMode, - } - if c.tokenManager == nil { - creds.tokenManager = nil - } else { - creds.tokenManager = &tokenManager - } - return creds -} - -// NewClientTLSConfig returns a tls.Config instance that uses S2Av2 to establish a TLS connection as -// a client. The tls.Config MUST only be used to establish a single TLS connection. -func NewClientTLSConfig( - ctx context.Context, - s2av2Address string, - transportCreds credentials.TransportCredentials, - tokenManager tokenmanager.AccessTokenManager, - verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, - serverName string, - serverAuthorizationPolicy []byte) (*tls.Config, error) { - s2AStream, err := createStream(ctx, s2av2Address, transportCreds, nil) - if err != nil { - grpclog.Infof("Failed to connect to S2Av2: %v", err) - return nil, err - } - - return tlsconfigstore.GetTLSConfigurationForClient(removeServerNamePort(serverName), s2AStream, tokenManager, nil, verificationMode, serverAuthorizationPolicy) -} - -// OverrideServerName sets the ServerName in the s2av2TransportCreds protocol -// info. The ServerName MUST be a hostname. -func (c *s2av2TransportCreds) OverrideServerName(serverNameOverride string) error { - serverName := removeServerNamePort(serverNameOverride) - c.info.ServerName = serverName - c.serverName = serverName - return nil -} - -// Remove the trailing port from server name. -func removeServerNamePort(serverName string) string { - name, _, err := net.SplitHostPort(serverName) - if err != nil { - name = serverName - } - return name -} - -type s2AGrpcStream struct { - stream s2av2pb.S2AService_SetUpSessionClient -} - -func (x s2AGrpcStream) Send(m *s2av2pb.SessionReq) error { - return x.stream.Send(m) -} - -func (x s2AGrpcStream) Recv() (*s2av2pb.SessionResp, error) { - return x.stream.Recv() -} - -func (x s2AGrpcStream) CloseSend() error { - return x.stream.CloseSend() -} - -func createStream(ctx context.Context, s2av2Address string, transportCreds credentials.TransportCredentials, getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error)) (stream.S2AStream, error) { - if getS2AStream != nil { - return getS2AStream(ctx, s2av2Address) - } - // TODO(rmehta19): Consider whether to close the connection to S2Av2. - conn, err := service.Dial(ctx, s2av2Address, transportCreds) - if err != nil { - return nil, err - } - client := s2av2pb.NewS2AServiceClient(conn) - gRPCStream, err := client.SetUpSession(ctx, []grpc.CallOption{}...) - if err != nil { - return nil, err - } - return &s2AGrpcStream{ - stream: gRPCStream, - }, nil -} - -// GetS2ATimeout returns the timeout enforced on the connection to the S2A service for handshake. -func GetS2ATimeout() time.Duration { - timeout, err := time.ParseDuration(os.Getenv(s2aTimeoutEnv)) - if err != nil { - return defaultS2ATimeout - } - return timeout -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/client_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/client_cert.pem deleted file mode 100644 index 493a5a264810..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/client_cert.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIUKXNlBRVe6UepjQUijIFPZBd/4qYwDQYJKoZIhvcNAQEL -BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 -YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE -AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN -MjIwNTMxMjAwMzE1WhcNNDIwNTI2MjAwMzE1WjCBhzELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx -ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ -KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAOOFuIucH7XXfohGxKd3uR/ihUA/LdduR9I8kfpUEbq5BOt8xZe5/Yn9 -a1ozEHVW6cOAbHbnwAR8tkSgZ/t42QIA2k77HWU1Jh2xiEIsJivo3imm4/kZWuR0 -OqPh7MhzxpR/hvNwpI5mJsAVBWFMa5KtecFZLnyZtwHylrRN1QXzuLrOxuKFufK3 -RKbTABScn5RbZL976H/jgfSeXrbt242NrIoBnVe6fRbekbq2DQ6zFArbQMUgHjHK -P0UqBgdr1QmHfi9KytFyx9BTP3gXWnWIu+bY7/v7qKJMHFwGETo+dCLWYevJL316 -HnLfhApDMfP8U+Yv/y1N/YvgaSOSlEcCAwEAAaNTMFEwHQYDVR0OBBYEFKhAU4nu -0h/lrnggbIGvx4ej0WklMB8GA1UdIwQYMBaAFKhAU4nu0h/lrnggbIGvx4ej0Wkl -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/6NghzQ5fu6yR6 -EHKbj/YMrFdT7aGn5n2sAf7wJ33LIhiFHkpWBsVlm7rDtZtwhe891ZK/P60anlg9 -/P0Ua53tSRVRmCvTnEbXWOVMN4is6MsR7BlmzUxl4AtIn7jbeifEwRL7B4xDYmdA -QrQnsqoz45dLgS5xK4WDqXATP09Q91xQDuhud/b+A4jrvgwFASmL7rMIZbp4f1JQ -nlnl/9VoTBQBvJiWkDUtQDMpRLtauddEkv4AGz75p5IspXWD6cOemuh2iQec11xD -X20rs2WZbAcAiUa3nmy8OKYw435vmpj8gp39WYbX/Yx9TymrFFbVY92wYn+quTco -pKklVz0= ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/client_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/client_key.pem deleted file mode 100644 index 55a7f10c742d..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/client_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEA44W4i5wftdd+iEbEp3e5H+KFQD8t125H0jyR+lQRurkE63zF -l7n9if1rWjMQdVbpw4BsdufABHy2RKBn+3jZAgDaTvsdZTUmHbGIQiwmK+jeKabj -+Rla5HQ6o+HsyHPGlH+G83CkjmYmwBUFYUxrkq15wVkufJm3AfKWtE3VBfO4us7G -4oW58rdEptMAFJyflFtkv3vof+OB9J5etu3bjY2sigGdV7p9Ft6RurYNDrMUCttA -xSAeMco/RSoGB2vVCYd+L0rK0XLH0FM/eBdadYi75tjv+/uookwcXAYROj50ItZh -68kvfXoect+ECkMx8/xT5i//LU39i+BpI5KURwIDAQABAoIBABgyjo/6iLzUMFbZ -/+w3pW6orrdIgN2akvTfED9pVYFgUA+jc3hRhY95bkNnjuaL2cy7Cc4Tk65mfRQL -Y0OxdJLr+EvSFSxAXM9npDA1ddHRsF8JqtFBSxNk8R+g1Yf0GDiO35Fgd3/ViWWA -VtQkRoSRApP3oiQKTRZd8H04keFR+PvmDk/Lq11l3Kc24A1PevKIPX1oI990ggw9 -9i4uSV+cnuMxmcI9xxJtgwdDFdjr39l2arLOHr4s6LGoV2IOdXHNlv5xRqWUZ0FH -MDHowkLgwDrdSTnNeaVNkce14Gqx+bd4hNaLCdKXMpedBTEmrut3f3hdV1kKjaKt -aqRYr8ECgYEA/YDGZY2jvFoHHBywlqmEMFrrCvQGH51m5R1Ntpkzr+Rh3YCmrpvq -xgwJXING0PUw3dz+xrH5lJICrfNE5Kt3fPu1rAEy+13mYsNowghtUq2Rtu0Hsjjx -2E3Bf8vEB6RNBMmGkUpTTIAroGF5tpJoRvfnWax+k4pFdrKYFtyZdNcCgYEA5cNv -EPltvOobjTXlUmtVP3n27KZN2aXexTcagLzRxE9CV4cYySENl3KuOMmccaZpIl6z -aHk6BT4X+M0LqElNUczrInfVqI+SGAFLGy7W6CJaqSr6cpyFUP/fosKpm6wKGgLq -udHfpvz5rckhKd8kJxFLvhGOK9yN5qpzih0gfhECgYAJfwRvk3G5wYmYpP58dlcs -VIuPenqsPoI3PPTHTU/hW+XKnWIhElgmGRdUrto9Q6IT/Y5RtSMLTLjq+Tzwb/fm -56rziYv2XJsfwgAvnI8z1Kqrto9ePsHYf3krJ1/thVsZPc9bq/QY3ohD1sLvcuaT -GgBBnLOVJU3a12/ZE2RwOwKBgF0csWMAoj8/5IB6if+3ral2xOGsl7oPZVMo/J2V -Z7EVqb4M6rd/pKFugTpUQgkwtkSOekhpcGD1hAN5HTNK2YG/+L5UMAsKe9sskwJm -HgOfAHy0BSDzW3ey6i9skg2bT9Cww+0gJ3Hl7U1HSCBO5LjMYpSZSrNtwzfqdb5Q -BX3xAoGARZdR28Ej3+/+0+fz47Yu2h4z0EI/EbrudLOWY936jIeAVwHckI3+BuqH -qR4poj1gfbnMxNuI9UzIXzjEmGewx9kDZ7IYnvloZKqoVQODO5GlKF2ja6IcMNlh -GCNdD6PSAS6HcmalmWo9sj+1YMkrl+GJikKZqVBHrHNwMGAG67w= ------END RSA PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/server_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/server_cert.pem deleted file mode 100644 index 0f98322c7244..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/server_cert.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIUKCoDuLtiZXvhsBY2RoDm0ugizJ8wDQYJKoZIhvcNAQEL -BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 -YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE -AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN -MjIwNTMxMjAwODI1WhcNNDIwNTI2MjAwODI1WjCBhzELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx -ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ -KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKK1++PXQ+M3hjYH/v0K4UEYl5ljzpNM1i52eQM+gFooojT87PDSaphT -fs0PXy/PTAjHBEvPhWpOpmQXfJNYzjwcCvg66hbqkv++/VTZiFLAsHagzkEz+FRJ -qT5Eq7G5FLyw1izX1uxyPN7tAEWEEg7eqsiaXD3Cq8+TYN9cjirPeF7RZF8yFCYE -xqvbo+Yc6RL6xw19iXVTfctRgQe581KQuIY5/LXo3dWDEilFdsADAe8XAEcO64es -Ow0g1UvXLnpXSE151kXBFb3sKH/ZjCecDYMCIMEb4sWLSblkSxJ5sNSmXIG4wtr2 -Qnii7CXZgnVYraQE/Jyh+NMQANuoSdMCAwEAAaNTMFEwHQYDVR0OBBYEFAyQQQuM -ab+YUQqjK8dVVOoHVFmXMB8GA1UdIwQYMBaAFAyQQQuMab+YUQqjK8dVVOoHVFmX -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADj0vQ6ykWhicoqR -e6VZMwlEJV7/DSvWWKBd9MUjfKye0A4565ya5lmnzP3DiD3nqGe3miqmLsXKDs+X -POqlPXTWIamP7D4MJ32XtSLwZB4ru+I+Ao/P/VngPepoRPQoBnzHe7jww0rokqxl -AZERjlbTUwUAy/BPWPSzSJZ2j0tcs6ZLDNyYzpK4ao8R9/1VmQ92Tcp3feJs1QTg -odRQc3om/AkWOwsll+oyX0UbJeHkFHiLanUPXbdh+/BkSvZJ8ynL+feSDdaurPe+ -PSfnqLtQft9/neecGRdEaQzzzSFVQUVQzTdK1Q7hA7b55b2HvIa3ktDiks+sJsYN -Dhm6uZM= ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/server_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/server_key.pem deleted file mode 100644 index 81afea783df9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/testdata/server_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAorX749dD4zeGNgf+/QrhQRiXmWPOk0zWLnZ5Az6AWiiiNPzs -8NJqmFN+zQ9fL89MCMcES8+Fak6mZBd8k1jOPBwK+DrqFuqS/779VNmIUsCwdqDO -QTP4VEmpPkSrsbkUvLDWLNfW7HI83u0ARYQSDt6qyJpcPcKrz5Ng31yOKs94XtFk -XzIUJgTGq9uj5hzpEvrHDX2JdVN9y1GBB7nzUpC4hjn8tejd1YMSKUV2wAMB7xcA -Rw7rh6w7DSDVS9cueldITXnWRcEVvewof9mMJ5wNgwIgwRvixYtJuWRLEnmw1KZc -gbjC2vZCeKLsJdmCdVitpAT8nKH40xAA26hJ0wIDAQABAoIBACaNR+lsD8G+XiZf -LqN1+HkcAo9tfnyYMAdCOtnx7SdviT9Uzi8hK/B7mAeuJLeHPlS2EuaDfPD7QaFl -jza6S+MiIdc+3kgfvESsVAnOoOY6kZUJ9NSuI6CU82y1iJjLaYZrv9NQMLRFPPb0 -4KOX709mosB1EnXvshW0rbc+jtDFhrm1SxMt+k9TuzmMxjbOeW4LOLXPgU8X1T3Q -Xy0hMZZtcgBs9wFIo8yCtmOixax9pnFE8rRltgDxTodn9LLdz1FieyntNgDksZ0P -nt4kV7Mqly7ELaea+Foaj244mKsesic2e3GhAlMRLun/VSunSf7mOCxfpITB8dp1 -drDhOYECgYEA19151dVxRcviuovN6Dar+QszMTnU8pDJ8BjLFjXjP/hNBBwMTHDE -duMuWk2qnwZqMooI/shxrF/ufmTgS0CFrh2+ANBZu27vWConJNXcyNtdigI4wt50 -L0Y2qcZn2mg67qFXHwoR3QNwrwnPwEjRXA09at9CSRZzcwDQ0ETXhYsCgYEAwPaG -06QdK8Zyly7TTzZJwxzv9uGiqzodmGtX6NEKjgij2JaCxHpukqZBJoqa0jKeK1cm -eNVkOvT5ff9TMzarSHQLr3pZen2/oVLb5gaFkbcJt/klv9Fd+ZRilHY3i6QwS6pD -uMiPOWS4DrLHDRVoVlAZTDjT1RVwwTs+P2NhJdkCgYEAsriXysbxBYyMp05gqEW7 -lHIFbFgpSrs9th+Q5U6wW6JEgYaHWDJ1NslY80MiZI93FWjbkbZ7BvBWESeL3EIL -a+EMErht0pVCbIhZ6FF4foPAqia0wAJVx14mm+G80kNBp5jE/NnleEsE3KcO7nBb -hg8gLn+x7bk81JZ0TDrzBYkCgYEAuQKluv47SeF3tSScTfKLPpvcKCWmxe1uutkQ -7JShPhVioyOMNb39jnYBOWbjkm4d4QgqRuiytSR0oi3QI+Ziy5EYMyNn713qAk9j -r2TJZDDPDKnBW+zt4YI4EohWMXk3JRUW4XDKggjjwJQA7bZ812TtHHvP/xoThfG7 -eSNb3eECgYBw6ssgCtMrdvQiEmjKVX/9yI38mvC2kSGyzbrQnGUfgqRGomRpeZuD -B5E3kysA4td5pT5lvcLgSW0TbOz+YbiriXjwOihPIelCvc9gE2eOUI71/byUWPFz -7u5F/xQ4NaGr5suLF+lBC6h7pSbM4El9lIHQAQadpuEdzHqrw+hs3g== ------END RSA PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_cert.pem deleted file mode 100644 index 493a5a264810..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_cert.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIUKXNlBRVe6UepjQUijIFPZBd/4qYwDQYJKoZIhvcNAQEL -BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 -YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE -AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN -MjIwNTMxMjAwMzE1WhcNNDIwNTI2MjAwMzE1WjCBhzELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx -ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ -KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAOOFuIucH7XXfohGxKd3uR/ihUA/LdduR9I8kfpUEbq5BOt8xZe5/Yn9 -a1ozEHVW6cOAbHbnwAR8tkSgZ/t42QIA2k77HWU1Jh2xiEIsJivo3imm4/kZWuR0 -OqPh7MhzxpR/hvNwpI5mJsAVBWFMa5KtecFZLnyZtwHylrRN1QXzuLrOxuKFufK3 -RKbTABScn5RbZL976H/jgfSeXrbt242NrIoBnVe6fRbekbq2DQ6zFArbQMUgHjHK -P0UqBgdr1QmHfi9KytFyx9BTP3gXWnWIu+bY7/v7qKJMHFwGETo+dCLWYevJL316 -HnLfhApDMfP8U+Yv/y1N/YvgaSOSlEcCAwEAAaNTMFEwHQYDVR0OBBYEFKhAU4nu -0h/lrnggbIGvx4ej0WklMB8GA1UdIwQYMBaAFKhAU4nu0h/lrnggbIGvx4ej0Wkl -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/6NghzQ5fu6yR6 -EHKbj/YMrFdT7aGn5n2sAf7wJ33LIhiFHkpWBsVlm7rDtZtwhe891ZK/P60anlg9 -/P0Ua53tSRVRmCvTnEbXWOVMN4is6MsR7BlmzUxl4AtIn7jbeifEwRL7B4xDYmdA -QrQnsqoz45dLgS5xK4WDqXATP09Q91xQDuhud/b+A4jrvgwFASmL7rMIZbp4f1JQ -nlnl/9VoTBQBvJiWkDUtQDMpRLtauddEkv4AGz75p5IspXWD6cOemuh2iQec11xD -X20rs2WZbAcAiUa3nmy8OKYw435vmpj8gp39WYbX/Yx9TymrFFbVY92wYn+quTco -pKklVz0= ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_key.pem deleted file mode 100644 index 55a7f10c742d..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/client_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEA44W4i5wftdd+iEbEp3e5H+KFQD8t125H0jyR+lQRurkE63zF -l7n9if1rWjMQdVbpw4BsdufABHy2RKBn+3jZAgDaTvsdZTUmHbGIQiwmK+jeKabj -+Rla5HQ6o+HsyHPGlH+G83CkjmYmwBUFYUxrkq15wVkufJm3AfKWtE3VBfO4us7G -4oW58rdEptMAFJyflFtkv3vof+OB9J5etu3bjY2sigGdV7p9Ft6RurYNDrMUCttA -xSAeMco/RSoGB2vVCYd+L0rK0XLH0FM/eBdadYi75tjv+/uookwcXAYROj50ItZh -68kvfXoect+ECkMx8/xT5i//LU39i+BpI5KURwIDAQABAoIBABgyjo/6iLzUMFbZ -/+w3pW6orrdIgN2akvTfED9pVYFgUA+jc3hRhY95bkNnjuaL2cy7Cc4Tk65mfRQL -Y0OxdJLr+EvSFSxAXM9npDA1ddHRsF8JqtFBSxNk8R+g1Yf0GDiO35Fgd3/ViWWA -VtQkRoSRApP3oiQKTRZd8H04keFR+PvmDk/Lq11l3Kc24A1PevKIPX1oI990ggw9 -9i4uSV+cnuMxmcI9xxJtgwdDFdjr39l2arLOHr4s6LGoV2IOdXHNlv5xRqWUZ0FH -MDHowkLgwDrdSTnNeaVNkce14Gqx+bd4hNaLCdKXMpedBTEmrut3f3hdV1kKjaKt -aqRYr8ECgYEA/YDGZY2jvFoHHBywlqmEMFrrCvQGH51m5R1Ntpkzr+Rh3YCmrpvq -xgwJXING0PUw3dz+xrH5lJICrfNE5Kt3fPu1rAEy+13mYsNowghtUq2Rtu0Hsjjx -2E3Bf8vEB6RNBMmGkUpTTIAroGF5tpJoRvfnWax+k4pFdrKYFtyZdNcCgYEA5cNv -EPltvOobjTXlUmtVP3n27KZN2aXexTcagLzRxE9CV4cYySENl3KuOMmccaZpIl6z -aHk6BT4X+M0LqElNUczrInfVqI+SGAFLGy7W6CJaqSr6cpyFUP/fosKpm6wKGgLq -udHfpvz5rckhKd8kJxFLvhGOK9yN5qpzih0gfhECgYAJfwRvk3G5wYmYpP58dlcs -VIuPenqsPoI3PPTHTU/hW+XKnWIhElgmGRdUrto9Q6IT/Y5RtSMLTLjq+Tzwb/fm -56rziYv2XJsfwgAvnI8z1Kqrto9ePsHYf3krJ1/thVsZPc9bq/QY3ohD1sLvcuaT -GgBBnLOVJU3a12/ZE2RwOwKBgF0csWMAoj8/5IB6if+3ral2xOGsl7oPZVMo/J2V -Z7EVqb4M6rd/pKFugTpUQgkwtkSOekhpcGD1hAN5HTNK2YG/+L5UMAsKe9sskwJm -HgOfAHy0BSDzW3ey6i9skg2bT9Cww+0gJ3Hl7U1HSCBO5LjMYpSZSrNtwzfqdb5Q -BX3xAoGARZdR28Ej3+/+0+fz47Yu2h4z0EI/EbrudLOWY936jIeAVwHckI3+BuqH -qR4poj1gfbnMxNuI9UzIXzjEmGewx9kDZ7IYnvloZKqoVQODO5GlKF2ja6IcMNlh -GCNdD6PSAS6HcmalmWo9sj+1YMkrl+GJikKZqVBHrHNwMGAG67w= ------END RSA PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_cert.pem deleted file mode 100644 index 0f98322c7244..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_cert.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIUKCoDuLtiZXvhsBY2RoDm0ugizJ8wDQYJKoZIhvcNAQEL -BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 -YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE -AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN -MjIwNTMxMjAwODI1WhcNNDIwNTI2MjAwODI1WjCBhzELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx -ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ -KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKK1++PXQ+M3hjYH/v0K4UEYl5ljzpNM1i52eQM+gFooojT87PDSaphT -fs0PXy/PTAjHBEvPhWpOpmQXfJNYzjwcCvg66hbqkv++/VTZiFLAsHagzkEz+FRJ -qT5Eq7G5FLyw1izX1uxyPN7tAEWEEg7eqsiaXD3Cq8+TYN9cjirPeF7RZF8yFCYE -xqvbo+Yc6RL6xw19iXVTfctRgQe581KQuIY5/LXo3dWDEilFdsADAe8XAEcO64es -Ow0g1UvXLnpXSE151kXBFb3sKH/ZjCecDYMCIMEb4sWLSblkSxJ5sNSmXIG4wtr2 -Qnii7CXZgnVYraQE/Jyh+NMQANuoSdMCAwEAAaNTMFEwHQYDVR0OBBYEFAyQQQuM -ab+YUQqjK8dVVOoHVFmXMB8GA1UdIwQYMBaAFAyQQQuMab+YUQqjK8dVVOoHVFmX -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADj0vQ6ykWhicoqR -e6VZMwlEJV7/DSvWWKBd9MUjfKye0A4565ya5lmnzP3DiD3nqGe3miqmLsXKDs+X -POqlPXTWIamP7D4MJ32XtSLwZB4ru+I+Ao/P/VngPepoRPQoBnzHe7jww0rokqxl -AZERjlbTUwUAy/BPWPSzSJZ2j0tcs6ZLDNyYzpK4ao8R9/1VmQ92Tcp3feJs1QTg -odRQc3om/AkWOwsll+oyX0UbJeHkFHiLanUPXbdh+/BkSvZJ8ynL+feSDdaurPe+ -PSfnqLtQft9/neecGRdEaQzzzSFVQUVQzTdK1Q7hA7b55b2HvIa3ktDiks+sJsYN -Dhm6uZM= ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_key.pem deleted file mode 100644 index 81afea783df9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/testdata/server_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAorX749dD4zeGNgf+/QrhQRiXmWPOk0zWLnZ5Az6AWiiiNPzs -8NJqmFN+zQ9fL89MCMcES8+Fak6mZBd8k1jOPBwK+DrqFuqS/779VNmIUsCwdqDO -QTP4VEmpPkSrsbkUvLDWLNfW7HI83u0ARYQSDt6qyJpcPcKrz5Ng31yOKs94XtFk -XzIUJgTGq9uj5hzpEvrHDX2JdVN9y1GBB7nzUpC4hjn8tejd1YMSKUV2wAMB7xcA -Rw7rh6w7DSDVS9cueldITXnWRcEVvewof9mMJ5wNgwIgwRvixYtJuWRLEnmw1KZc -gbjC2vZCeKLsJdmCdVitpAT8nKH40xAA26hJ0wIDAQABAoIBACaNR+lsD8G+XiZf -LqN1+HkcAo9tfnyYMAdCOtnx7SdviT9Uzi8hK/B7mAeuJLeHPlS2EuaDfPD7QaFl -jza6S+MiIdc+3kgfvESsVAnOoOY6kZUJ9NSuI6CU82y1iJjLaYZrv9NQMLRFPPb0 -4KOX709mosB1EnXvshW0rbc+jtDFhrm1SxMt+k9TuzmMxjbOeW4LOLXPgU8X1T3Q -Xy0hMZZtcgBs9wFIo8yCtmOixax9pnFE8rRltgDxTodn9LLdz1FieyntNgDksZ0P -nt4kV7Mqly7ELaea+Foaj244mKsesic2e3GhAlMRLun/VSunSf7mOCxfpITB8dp1 -drDhOYECgYEA19151dVxRcviuovN6Dar+QszMTnU8pDJ8BjLFjXjP/hNBBwMTHDE -duMuWk2qnwZqMooI/shxrF/ufmTgS0CFrh2+ANBZu27vWConJNXcyNtdigI4wt50 -L0Y2qcZn2mg67qFXHwoR3QNwrwnPwEjRXA09at9CSRZzcwDQ0ETXhYsCgYEAwPaG -06QdK8Zyly7TTzZJwxzv9uGiqzodmGtX6NEKjgij2JaCxHpukqZBJoqa0jKeK1cm -eNVkOvT5ff9TMzarSHQLr3pZen2/oVLb5gaFkbcJt/klv9Fd+ZRilHY3i6QwS6pD -uMiPOWS4DrLHDRVoVlAZTDjT1RVwwTs+P2NhJdkCgYEAsriXysbxBYyMp05gqEW7 -lHIFbFgpSrs9th+Q5U6wW6JEgYaHWDJ1NslY80MiZI93FWjbkbZ7BvBWESeL3EIL -a+EMErht0pVCbIhZ6FF4foPAqia0wAJVx14mm+G80kNBp5jE/NnleEsE3KcO7nBb -hg8gLn+x7bk81JZ0TDrzBYkCgYEAuQKluv47SeF3tSScTfKLPpvcKCWmxe1uutkQ -7JShPhVioyOMNb39jnYBOWbjkm4d4QgqRuiytSR0oi3QI+Ziy5EYMyNn713qAk9j -r2TJZDDPDKnBW+zt4YI4EohWMXk3JRUW4XDKggjjwJQA7bZ812TtHHvP/xoThfG7 -eSNb3eECgYBw6ssgCtMrdvQiEmjKVX/9yI38mvC2kSGyzbrQnGUfgqRGomRpeZuD -B5E3kysA4td5pT5lvcLgSW0TbOz+YbiriXjwOihPIelCvc9gE2eOUI71/byUWPFz -7u5F/xQ4NaGr5suLF+lBC6h7pSbM4El9lIHQAQadpuEdzHqrw+hs3g== ------END RSA PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go deleted file mode 100644 index 4d919132295b..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/internal/v2/tlsconfigstore/tlsconfigstore.go +++ /dev/null @@ -1,404 +0,0 @@ -/* - * - * Copyright 2022 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. - * - */ - -// Package tlsconfigstore offloads operations to S2Av2. -package tlsconfigstore - -import ( - "crypto/tls" - "crypto/x509" - "encoding/pem" - "errors" - "fmt" - - "github.com/google/s2a-go/internal/tokenmanager" - "github.com/google/s2a-go/internal/v2/certverifier" - "github.com/google/s2a-go/internal/v2/remotesigner" - "github.com/google/s2a-go/stream" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - - commonpbv1 "github.com/google/s2a-go/internal/proto/common_go_proto" - commonpb "github.com/google/s2a-go/internal/proto/v2/common_go_proto" - s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto" -) - -const ( - // HTTP/2 - h2 = "h2" -) - -// GetTLSConfigurationForClient returns a tls.Config instance for use by a client application. -func GetTLSConfigurationForClient(serverHostname string, s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentity *commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, serverAuthorizationPolicy []byte) (*tls.Config, error) { - authMechanisms := getAuthMechanisms(tokenManager, []*commonpbv1.Identity{localIdentity}) - - if grpclog.V(1) { - grpclog.Infof("Sending request to S2Av2 for client TLS config.") - } - // Send request to S2Av2 for config. - if err := s2AStream.Send(&s2av2pb.SessionReq{ - LocalIdentity: localIdentity, - AuthenticationMechanisms: authMechanisms, - ReqOneof: &s2av2pb.SessionReq_GetTlsConfigurationReq{ - GetTlsConfigurationReq: &s2av2pb.GetTlsConfigurationReq{ - ConnectionSide: commonpb.ConnectionSide_CONNECTION_SIDE_CLIENT, - }, - }, - }); err != nil { - grpclog.Infof("Failed to send request to S2Av2 for client TLS config") - return nil, err - } - - // Get the response containing config from S2Av2. - resp, err := s2AStream.Recv() - if err != nil { - grpclog.Infof("Failed to receive client TLS config response from S2Av2.") - return nil, err - } - - // TODO(rmehta19): Add unit test for this if statement. - if (resp.GetStatus() != nil) && (resp.GetStatus().Code != uint32(codes.OK)) { - return nil, fmt.Errorf("failed to get TLS configuration from S2A: %d, %v", resp.GetStatus().Code, resp.GetStatus().Details) - } - - // Extract TLS configiguration from SessionResp. - tlsConfig := resp.GetGetTlsConfigurationResp().GetClientTlsConfiguration() - - var cert tls.Certificate - for i, v := range tlsConfig.CertificateChain { - // Populate Certificates field. - block, _ := pem.Decode([]byte(v)) - if block == nil { - return nil, errors.New("certificate in CertificateChain obtained from S2Av2 is empty") - } - x509Cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - return nil, err - } - cert.Certificate = append(cert.Certificate, x509Cert.Raw) - if i == 0 { - cert.Leaf = x509Cert - } - } - - if len(tlsConfig.CertificateChain) > 0 { - cert.PrivateKey = remotesigner.New(cert.Leaf, s2AStream) - if cert.PrivateKey == nil { - return nil, errors.New("failed to retrieve Private Key from Remote Signer Library") - } - } - - minVersion, maxVersion, err := getTLSMinMaxVersionsClient(tlsConfig) - if err != nil { - return nil, err - } - - // Create mTLS credentials for client. - config := &tls.Config{ - VerifyPeerCertificate: certverifier.VerifyServerCertificateChain(serverHostname, verificationMode, s2AStream, serverAuthorizationPolicy), - ServerName: serverHostname, - InsecureSkipVerify: true, // NOLINT - ClientSessionCache: nil, - SessionTicketsDisabled: true, - MinVersion: minVersion, - MaxVersion: maxVersion, - NextProtos: []string{h2}, - } - if len(tlsConfig.CertificateChain) > 0 { - config.Certificates = []tls.Certificate{cert} - } - return config, nil -} - -// GetTLSConfigurationForServer returns a tls.Config instance for use by a server application. -func GetTLSConfigurationForServer(s2AStream stream.S2AStream, tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode) (*tls.Config, error) { - return &tls.Config{ - GetConfigForClient: ClientConfig(tokenManager, localIdentities, verificationMode, s2AStream), - }, nil -} - -// ClientConfig builds a TLS config for a server to establish a secure -// connection with a client, based on SNI communicated during ClientHello. -// Ensures that server presents the correct certificate to establish a TLS -// connection. -func ClientConfig(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode, s2AStream stream.S2AStream) func(chi *tls.ClientHelloInfo) (*tls.Config, error) { - return func(chi *tls.ClientHelloInfo) (*tls.Config, error) { - tlsConfig, err := getServerConfigFromS2Av2(tokenManager, localIdentities, chi.ServerName, s2AStream) - if err != nil { - return nil, err - } - - var cert tls.Certificate - for i, v := range tlsConfig.CertificateChain { - // Populate Certificates field. - block, _ := pem.Decode([]byte(v)) - if block == nil { - return nil, errors.New("certificate in CertificateChain obtained from S2Av2 is empty") - } - x509Cert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - return nil, err - } - cert.Certificate = append(cert.Certificate, x509Cert.Raw) - if i == 0 { - cert.Leaf = x509Cert - } - } - - cert.PrivateKey = remotesigner.New(cert.Leaf, s2AStream) - if cert.PrivateKey == nil { - return nil, errors.New("failed to retrieve Private Key from Remote Signer Library") - } - - minVersion, maxVersion, err := getTLSMinMaxVersionsServer(tlsConfig) - if err != nil { - return nil, err - } - - clientAuth := getTLSClientAuthType(tlsConfig) - - var cipherSuites []uint16 - cipherSuites = getCipherSuites(tlsConfig.Ciphersuites) - - // Create mTLS credentials for server. - return &tls.Config{ - Certificates: []tls.Certificate{cert}, - VerifyPeerCertificate: certverifier.VerifyClientCertificateChain(verificationMode, s2AStream), - ClientAuth: clientAuth, - CipherSuites: cipherSuites, - SessionTicketsDisabled: true, - MinVersion: minVersion, - MaxVersion: maxVersion, - NextProtos: []string{h2}, - }, nil - } -} - -func getCipherSuites(tlsConfigCipherSuites []commonpb.Ciphersuite) []uint16 { - var tlsGoCipherSuites []uint16 - for _, v := range tlsConfigCipherSuites { - s := getTLSCipherSuite(v) - if s != 0xffff { - tlsGoCipherSuites = append(tlsGoCipherSuites, s) - } - } - return tlsGoCipherSuites -} - -func getTLSCipherSuite(tlsCipherSuite commonpb.Ciphersuite) uint16 { - switch tlsCipherSuite { - case commonpb.Ciphersuite_CIPHERSUITE_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: - return tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - case commonpb.Ciphersuite_CIPHERSUITE_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: - return tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - case commonpb.Ciphersuite_CIPHERSUITE_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256: - return tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 - case commonpb.Ciphersuite_CIPHERSUITE_ECDHE_RSA_WITH_AES_128_GCM_SHA256: - return tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - case commonpb.Ciphersuite_CIPHERSUITE_ECDHE_RSA_WITH_AES_256_GCM_SHA384: - return tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - case commonpb.Ciphersuite_CIPHERSUITE_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256: - return tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 - default: - return 0xffff - } -} - -func getServerConfigFromS2Av2(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity, sni string, s2AStream stream.S2AStream) (*s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration, error) { - authMechanisms := getAuthMechanisms(tokenManager, localIdentities) - var locID *commonpbv1.Identity - if localIdentities != nil { - locID = localIdentities[0] - } - - if err := s2AStream.Send(&s2av2pb.SessionReq{ - LocalIdentity: locID, - AuthenticationMechanisms: authMechanisms, - ReqOneof: &s2av2pb.SessionReq_GetTlsConfigurationReq{ - GetTlsConfigurationReq: &s2av2pb.GetTlsConfigurationReq{ - ConnectionSide: commonpb.ConnectionSide_CONNECTION_SIDE_SERVER, - Sni: sni, - }, - }, - }); err != nil { - return nil, err - } - - resp, err := s2AStream.Recv() - if err != nil { - return nil, err - } - - // TODO(rmehta19): Add unit test for this if statement. - if (resp.GetStatus() != nil) && (resp.GetStatus().Code != uint32(codes.OK)) { - return nil, fmt.Errorf("failed to get TLS configuration from S2A: %d, %v", resp.GetStatus().Code, resp.GetStatus().Details) - } - - return resp.GetGetTlsConfigurationResp().GetServerTlsConfiguration(), nil -} - -func getTLSClientAuthType(tlsConfig *s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration) tls.ClientAuthType { - var clientAuth tls.ClientAuthType - switch x := tlsConfig.RequestClientCertificate; x { - case s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration_DONT_REQUEST_CLIENT_CERTIFICATE: - clientAuth = tls.NoClientCert - case s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY: - clientAuth = tls.RequestClientCert - case s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY: - // This case actually maps to tls.VerifyClientCertIfGiven. However this - // mapping triggers normal verification, followed by custom verification, - // specified in VerifyPeerCertificate. To bypass normal verification, and - // only do custom verification we set clientAuth to RequireAnyClientCert or - // RequestClientCert. See https://github.com/google/s2a-go/pull/43 for full - // discussion. - clientAuth = tls.RequireAnyClientCert - case s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY: - clientAuth = tls.RequireAnyClientCert - case s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY: - // This case actually maps to tls.RequireAndVerifyClientCert. However this - // mapping triggers normal verification, followed by custom verification, - // specified in VerifyPeerCertificate. To bypass normal verification, and - // only do custom verification we set clientAuth to RequireAnyClientCert or - // RequestClientCert. See https://github.com/google/s2a-go/pull/43 for full - // discussion. - clientAuth = tls.RequireAnyClientCert - default: - clientAuth = tls.RequireAnyClientCert - } - return clientAuth -} - -func getAuthMechanisms(tokenManager tokenmanager.AccessTokenManager, localIdentities []*commonpbv1.Identity) []*s2av2pb.AuthenticationMechanism { - if tokenManager == nil { - return nil - } - if len(localIdentities) == 0 { - token, err := tokenManager.DefaultToken() - if err != nil { - grpclog.Infof("Unable to get token for empty local identity: %v", err) - return nil - } - return []*s2av2pb.AuthenticationMechanism{ - { - MechanismOneof: &s2av2pb.AuthenticationMechanism_Token{ - Token: token, - }, - }, - } - } - var authMechanisms []*s2av2pb.AuthenticationMechanism - for _, localIdentity := range localIdentities { - if localIdentity == nil { - token, err := tokenManager.DefaultToken() - if err != nil { - grpclog.Infof("Unable to get default token for local identity %v: %v", localIdentity, err) - continue - } - authMechanisms = append(authMechanisms, &s2av2pb.AuthenticationMechanism{ - Identity: localIdentity, - MechanismOneof: &s2av2pb.AuthenticationMechanism_Token{ - Token: token, - }, - }) - } else { - token, err := tokenManager.Token(localIdentity) - if err != nil { - grpclog.Infof("Unable to get token for local identity %v: %v", localIdentity, err) - continue - } - authMechanisms = append(authMechanisms, &s2av2pb.AuthenticationMechanism{ - Identity: localIdentity, - MechanismOneof: &s2av2pb.AuthenticationMechanism_Token{ - Token: token, - }, - }) - } - } - return authMechanisms -} - -// TODO(rmehta19): refactor switch statements into a helper function. -func getTLSMinMaxVersionsClient(tlsConfig *s2av2pb.GetTlsConfigurationResp_ClientTlsConfiguration) (uint16, uint16, error) { - // Map S2Av2 TLSVersion to consts defined in tls package. - var minVersion uint16 - var maxVersion uint16 - switch x := tlsConfig.MinTlsVersion; x { - case commonpb.TLSVersion_TLS_VERSION_1_0: - minVersion = tls.VersionTLS10 - case commonpb.TLSVersion_TLS_VERSION_1_1: - minVersion = tls.VersionTLS11 - case commonpb.TLSVersion_TLS_VERSION_1_2: - minVersion = tls.VersionTLS12 - case commonpb.TLSVersion_TLS_VERSION_1_3: - minVersion = tls.VersionTLS13 - default: - return minVersion, maxVersion, fmt.Errorf("S2Av2 provided invalid MinTlsVersion: %v", x) - } - - switch x := tlsConfig.MaxTlsVersion; x { - case commonpb.TLSVersion_TLS_VERSION_1_0: - maxVersion = tls.VersionTLS10 - case commonpb.TLSVersion_TLS_VERSION_1_1: - maxVersion = tls.VersionTLS11 - case commonpb.TLSVersion_TLS_VERSION_1_2: - maxVersion = tls.VersionTLS12 - case commonpb.TLSVersion_TLS_VERSION_1_3: - maxVersion = tls.VersionTLS13 - default: - return minVersion, maxVersion, fmt.Errorf("S2Av2 provided invalid MaxTlsVersion: %v", x) - } - if minVersion > maxVersion { - return minVersion, maxVersion, errors.New("S2Av2 provided minVersion > maxVersion") - } - return minVersion, maxVersion, nil -} - -func getTLSMinMaxVersionsServer(tlsConfig *s2av2pb.GetTlsConfigurationResp_ServerTlsConfiguration) (uint16, uint16, error) { - // Map S2Av2 TLSVersion to consts defined in tls package. - var minVersion uint16 - var maxVersion uint16 - switch x := tlsConfig.MinTlsVersion; x { - case commonpb.TLSVersion_TLS_VERSION_1_0: - minVersion = tls.VersionTLS10 - case commonpb.TLSVersion_TLS_VERSION_1_1: - minVersion = tls.VersionTLS11 - case commonpb.TLSVersion_TLS_VERSION_1_2: - minVersion = tls.VersionTLS12 - case commonpb.TLSVersion_TLS_VERSION_1_3: - minVersion = tls.VersionTLS13 - default: - return minVersion, maxVersion, fmt.Errorf("S2Av2 provided invalid MinTlsVersion: %v", x) - } - - switch x := tlsConfig.MaxTlsVersion; x { - case commonpb.TLSVersion_TLS_VERSION_1_0: - maxVersion = tls.VersionTLS10 - case commonpb.TLSVersion_TLS_VERSION_1_1: - maxVersion = tls.VersionTLS11 - case commonpb.TLSVersion_TLS_VERSION_1_2: - maxVersion = tls.VersionTLS12 - case commonpb.TLSVersion_TLS_VERSION_1_3: - maxVersion = tls.VersionTLS13 - default: - return minVersion, maxVersion, fmt.Errorf("S2Av2 provided invalid MaxTlsVersion: %v", x) - } - if minVersion > maxVersion { - return minVersion, maxVersion, errors.New("S2Av2 provided minVersion > maxVersion") - } - return minVersion, maxVersion, nil -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/retry/retry.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/retry/retry.go deleted file mode 100644 index f7e0a23779f4..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/retry/retry.go +++ /dev/null @@ -1,144 +0,0 @@ -/* - * - * Copyright 2023 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. - * - */ - -// Package retry provides a retry helper for talking to S2A gRPC server. -// The implementation is modeled after -// https://github.com/googleapis/google-cloud-go/blob/main/compute/metadata/retry.go -package retry - -import ( - "context" - "math/rand" - "time" - - "google.golang.org/grpc/grpclog" -) - -const ( - maxRetryAttempts = 5 - maxRetryForLoops = 10 -) - -type defaultBackoff struct { - max time.Duration - mul float64 - cur time.Duration -} - -// Pause returns a duration, which is used as the backoff wait time -// before the next retry. -func (b *defaultBackoff) Pause() time.Duration { - d := time.Duration(1 + rand.Int63n(int64(b.cur))) - b.cur = time.Duration(float64(b.cur) * b.mul) - if b.cur > b.max { - b.cur = b.max - } - return d -} - -// Sleep will wait for the specified duration or return on context -// expiration. -func Sleep(ctx context.Context, d time.Duration) error { - t := time.NewTimer(d) - select { - case <-ctx.Done(): - t.Stop() - return ctx.Err() - case <-t.C: - return nil - } -} - -// NewRetryer creates an instance of S2ARetryer using the defaultBackoff -// implementation. -var NewRetryer = func() *S2ARetryer { - return &S2ARetryer{bo: &defaultBackoff{ - cur: 100 * time.Millisecond, - max: 30 * time.Second, - mul: 2, - }} -} - -type backoff interface { - Pause() time.Duration -} - -// S2ARetryer implements a retry helper for talking to S2A gRPC server. -type S2ARetryer struct { - bo backoff - attempts int -} - -// Attempts return the number of retries attempted. -func (r *S2ARetryer) Attempts() int { - return r.attempts -} - -// Retry returns a boolean indicating whether retry should be performed -// and the backoff duration. -func (r *S2ARetryer) Retry(err error) (time.Duration, bool) { - if err == nil { - return 0, false - } - if r.attempts >= maxRetryAttempts { - return 0, false - } - r.attempts++ - return r.bo.Pause(), true -} - -// Run uses S2ARetryer to execute the function passed in, until success or reaching -// max number of retry attempts. -func Run(ctx context.Context, f func() error) { - retryer := NewRetryer() - forLoopCnt := 0 - var err error - for { - err = f() - if bo, shouldRetry := retryer.Retry(err); shouldRetry { - if grpclog.V(1) { - grpclog.Infof("will attempt retry: %v", err) - } - if ctx.Err() != nil { - if grpclog.V(1) { - grpclog.Infof("exit retry loop due to context error: %v", ctx.Err()) - } - break - } - if errSleep := Sleep(ctx, bo); errSleep != nil { - if grpclog.V(1) { - grpclog.Infof("exit retry loop due to sleep error: %v", errSleep) - } - break - } - // This shouldn't happen, just make sure we are not stuck in the for loops. - forLoopCnt++ - if forLoopCnt > maxRetryForLoops { - if grpclog.V(1) { - grpclog.Infof("exit the for loop after too many retries") - } - break - } - continue - } - if grpclog.V(1) { - grpclog.Infof("retry conditions not met, exit the loop") - } - break - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a.go deleted file mode 100644 index 5ecb06f930eb..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a.go +++ /dev/null @@ -1,427 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -// Package s2a provides the S2A transport credentials used by a gRPC -// application. -package s2a - -import ( - "context" - "crypto/tls" - "errors" - "fmt" - "net" - "sync" - "time" - - "github.com/golang/protobuf/proto" - "github.com/google/s2a-go/fallback" - "github.com/google/s2a-go/internal/handshaker" - "github.com/google/s2a-go/internal/handshaker/service" - "github.com/google/s2a-go/internal/tokenmanager" - "github.com/google/s2a-go/internal/v2" - "github.com/google/s2a-go/retry" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/grpclog" - - commonpb "github.com/google/s2a-go/internal/proto/common_go_proto" - s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto" -) - -const ( - s2aSecurityProtocol = "tls" - // defaultTimeout specifies the default server handshake timeout. - defaultTimeout = 30.0 * time.Second -) - -// s2aTransportCreds are the transport credentials required for establishing -// a secure connection using the S2A. They implement the -// credentials.TransportCredentials interface. -type s2aTransportCreds struct { - info *credentials.ProtocolInfo - minTLSVersion commonpb.TLSVersion - maxTLSVersion commonpb.TLSVersion - // tlsCiphersuites contains the ciphersuites used in the S2A connection. - // Note that these are currently unconfigurable. - tlsCiphersuites []commonpb.Ciphersuite - // localIdentity should only be used by the client. - localIdentity *commonpb.Identity - // localIdentities should only be used by the server. - localIdentities []*commonpb.Identity - // targetIdentities should only be used by the client. - targetIdentities []*commonpb.Identity - isClient bool - s2aAddr string - ensureProcessSessionTickets *sync.WaitGroup -} - -// NewClientCreds returns a client-side transport credentials object that uses -// the S2A to establish a secure connection with a server. -func NewClientCreds(opts *ClientOptions) (credentials.TransportCredentials, error) { - if opts == nil { - return nil, errors.New("nil client options") - } - var targetIdentities []*commonpb.Identity - for _, targetIdentity := range opts.TargetIdentities { - protoTargetIdentity, err := toProtoIdentity(targetIdentity) - if err != nil { - return nil, err - } - targetIdentities = append(targetIdentities, protoTargetIdentity) - } - localIdentity, err := toProtoIdentity(opts.LocalIdentity) - if err != nil { - return nil, err - } - if opts.EnableLegacyMode { - return &s2aTransportCreds{ - info: &credentials.ProtocolInfo{ - SecurityProtocol: s2aSecurityProtocol, - }, - minTLSVersion: commonpb.TLSVersion_TLS1_3, - maxTLSVersion: commonpb.TLSVersion_TLS1_3, - tlsCiphersuites: []commonpb.Ciphersuite{ - commonpb.Ciphersuite_AES_128_GCM_SHA256, - commonpb.Ciphersuite_AES_256_GCM_SHA384, - commonpb.Ciphersuite_CHACHA20_POLY1305_SHA256, - }, - localIdentity: localIdentity, - targetIdentities: targetIdentities, - isClient: true, - s2aAddr: opts.S2AAddress, - ensureProcessSessionTickets: opts.EnsureProcessSessionTickets, - }, nil - } - verificationMode := getVerificationMode(opts.VerificationMode) - var fallbackFunc fallback.ClientHandshake - if opts.FallbackOpts != nil && opts.FallbackOpts.FallbackClientHandshakeFunc != nil { - fallbackFunc = opts.FallbackOpts.FallbackClientHandshakeFunc - } - return v2.NewClientCreds(opts.S2AAddress, opts.TransportCreds, localIdentity, verificationMode, fallbackFunc, opts.getS2AStream, opts.serverAuthorizationPolicy) -} - -// NewServerCreds returns a server-side transport credentials object that uses -// the S2A to establish a secure connection with a client. -func NewServerCreds(opts *ServerOptions) (credentials.TransportCredentials, error) { - if opts == nil { - return nil, errors.New("nil server options") - } - var localIdentities []*commonpb.Identity - for _, localIdentity := range opts.LocalIdentities { - protoLocalIdentity, err := toProtoIdentity(localIdentity) - if err != nil { - return nil, err - } - localIdentities = append(localIdentities, protoLocalIdentity) - } - if opts.EnableLegacyMode { - return &s2aTransportCreds{ - info: &credentials.ProtocolInfo{ - SecurityProtocol: s2aSecurityProtocol, - }, - minTLSVersion: commonpb.TLSVersion_TLS1_3, - maxTLSVersion: commonpb.TLSVersion_TLS1_3, - tlsCiphersuites: []commonpb.Ciphersuite{ - commonpb.Ciphersuite_AES_128_GCM_SHA256, - commonpb.Ciphersuite_AES_256_GCM_SHA384, - commonpb.Ciphersuite_CHACHA20_POLY1305_SHA256, - }, - localIdentities: localIdentities, - isClient: false, - s2aAddr: opts.S2AAddress, - }, nil - } - verificationMode := getVerificationMode(opts.VerificationMode) - return v2.NewServerCreds(opts.S2AAddress, opts.TransportCreds, localIdentities, verificationMode, opts.getS2AStream) -} - -// ClientHandshake initiates a client-side TLS handshake using the S2A. -func (c *s2aTransportCreds) ClientHandshake(ctx context.Context, serverAuthority string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { - if !c.isClient { - return nil, nil, errors.New("client handshake called using server transport credentials") - } - - var cancel context.CancelFunc - ctx, cancel = context.WithCancel(ctx) - defer cancel() - - // Connect to the S2A. - hsConn, err := service.Dial(ctx, c.s2aAddr, nil) - if err != nil { - grpclog.Infof("Failed to connect to S2A: %v", err) - return nil, nil, err - } - - opts := &handshaker.ClientHandshakerOptions{ - MinTLSVersion: c.minTLSVersion, - MaxTLSVersion: c.maxTLSVersion, - TLSCiphersuites: c.tlsCiphersuites, - TargetIdentities: c.targetIdentities, - LocalIdentity: c.localIdentity, - TargetName: serverAuthority, - EnsureProcessSessionTickets: c.ensureProcessSessionTickets, - } - chs, err := handshaker.NewClientHandshaker(ctx, hsConn, rawConn, c.s2aAddr, opts) - if err != nil { - grpclog.Infof("Call to handshaker.NewClientHandshaker failed: %v", err) - return nil, nil, err - } - defer func() { - if err != nil { - if closeErr := chs.Close(); closeErr != nil { - grpclog.Infof("Close failed unexpectedly: %v", err) - err = fmt.Errorf("%v: close unexpectedly failed: %v", err, closeErr) - } - } - }() - - secConn, authInfo, err := chs.ClientHandshake(context.Background()) - if err != nil { - grpclog.Infof("Handshake failed: %v", err) - return nil, nil, err - } - return secConn, authInfo, nil -} - -// ServerHandshake initiates a server-side TLS handshake using the S2A. -func (c *s2aTransportCreds) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { - if c.isClient { - return nil, nil, errors.New("server handshake called using client transport credentials") - } - - ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout) - defer cancel() - - // Connect to the S2A. - hsConn, err := service.Dial(ctx, c.s2aAddr, nil) - if err != nil { - grpclog.Infof("Failed to connect to S2A: %v", err) - return nil, nil, err - } - - opts := &handshaker.ServerHandshakerOptions{ - MinTLSVersion: c.minTLSVersion, - MaxTLSVersion: c.maxTLSVersion, - TLSCiphersuites: c.tlsCiphersuites, - LocalIdentities: c.localIdentities, - } - shs, err := handshaker.NewServerHandshaker(ctx, hsConn, rawConn, c.s2aAddr, opts) - if err != nil { - grpclog.Infof("Call to handshaker.NewServerHandshaker failed: %v", err) - return nil, nil, err - } - defer func() { - if err != nil { - if closeErr := shs.Close(); closeErr != nil { - grpclog.Infof("Close failed unexpectedly: %v", err) - err = fmt.Errorf("%v: close unexpectedly failed: %v", err, closeErr) - } - } - }() - - secConn, authInfo, err := shs.ServerHandshake(context.Background()) - if err != nil { - grpclog.Infof("Handshake failed: %v", err) - return nil, nil, err - } - return secConn, authInfo, nil -} - -func (c *s2aTransportCreds) Info() credentials.ProtocolInfo { - return *c.info -} - -func (c *s2aTransportCreds) Clone() credentials.TransportCredentials { - info := *c.info - var localIdentity *commonpb.Identity - if c.localIdentity != nil { - localIdentity = proto.Clone(c.localIdentity).(*commonpb.Identity) - } - var localIdentities []*commonpb.Identity - if c.localIdentities != nil { - localIdentities = make([]*commonpb.Identity, len(c.localIdentities)) - for i, localIdentity := range c.localIdentities { - localIdentities[i] = proto.Clone(localIdentity).(*commonpb.Identity) - } - } - var targetIdentities []*commonpb.Identity - if c.targetIdentities != nil { - targetIdentities = make([]*commonpb.Identity, len(c.targetIdentities)) - for i, targetIdentity := range c.targetIdentities { - targetIdentities[i] = proto.Clone(targetIdentity).(*commonpb.Identity) - } - } - return &s2aTransportCreds{ - info: &info, - minTLSVersion: c.minTLSVersion, - maxTLSVersion: c.maxTLSVersion, - tlsCiphersuites: c.tlsCiphersuites, - localIdentity: localIdentity, - localIdentities: localIdentities, - targetIdentities: targetIdentities, - isClient: c.isClient, - s2aAddr: c.s2aAddr, - } -} - -func (c *s2aTransportCreds) OverrideServerName(serverNameOverride string) error { - c.info.ServerName = serverNameOverride - return nil -} - -// TLSClientConfigOptions specifies parameters for creating client TLS config. -type TLSClientConfigOptions struct { - // ServerName is required by s2a as the expected name when verifying the hostname found in server's certificate. - // tlsConfig, _ := factory.Build(ctx, &s2a.TLSClientConfigOptions{ - // ServerName: "example.com", - // }) - ServerName string -} - -// TLSClientConfigFactory defines the interface for a client TLS config factory. -type TLSClientConfigFactory interface { - Build(ctx context.Context, opts *TLSClientConfigOptions) (*tls.Config, error) -} - -// NewTLSClientConfigFactory returns an instance of s2aTLSClientConfigFactory. -func NewTLSClientConfigFactory(opts *ClientOptions) (TLSClientConfigFactory, error) { - if opts == nil { - return nil, fmt.Errorf("opts must be non-nil") - } - if opts.EnableLegacyMode { - return nil, fmt.Errorf("NewTLSClientConfigFactory only supports S2Av2") - } - tokenManager, err := tokenmanager.NewSingleTokenAccessTokenManager() - if err != nil { - // The only possible error is: access token not set in the environment, - // which is okay in environments other than serverless. - grpclog.Infof("Access token manager not initialized: %v", err) - return &s2aTLSClientConfigFactory{ - s2av2Address: opts.S2AAddress, - transportCreds: opts.TransportCreds, - tokenManager: nil, - verificationMode: getVerificationMode(opts.VerificationMode), - serverAuthorizationPolicy: opts.serverAuthorizationPolicy, - }, nil - } - return &s2aTLSClientConfigFactory{ - s2av2Address: opts.S2AAddress, - transportCreds: opts.TransportCreds, - tokenManager: tokenManager, - verificationMode: getVerificationMode(opts.VerificationMode), - serverAuthorizationPolicy: opts.serverAuthorizationPolicy, - }, nil -} - -type s2aTLSClientConfigFactory struct { - s2av2Address string - transportCreds credentials.TransportCredentials - tokenManager tokenmanager.AccessTokenManager - verificationMode s2av2pb.ValidatePeerCertificateChainReq_VerificationMode - serverAuthorizationPolicy []byte -} - -func (f *s2aTLSClientConfigFactory) Build( - ctx context.Context, opts *TLSClientConfigOptions) (*tls.Config, error) { - serverName := "" - if opts != nil && opts.ServerName != "" { - serverName = opts.ServerName - } - return v2.NewClientTLSConfig(ctx, f.s2av2Address, f.transportCreds, f.tokenManager, f.verificationMode, serverName, f.serverAuthorizationPolicy) -} - -func getVerificationMode(verificationMode VerificationModeType) s2av2pb.ValidatePeerCertificateChainReq_VerificationMode { - switch verificationMode { - case ConnectToGoogle: - return s2av2pb.ValidatePeerCertificateChainReq_CONNECT_TO_GOOGLE - case Spiffe: - return s2av2pb.ValidatePeerCertificateChainReq_SPIFFE - default: - return s2av2pb.ValidatePeerCertificateChainReq_UNSPECIFIED - } -} - -// NewS2ADialTLSContextFunc returns a dialer which establishes an MTLS connection using S2A. -// Example use with http.RoundTripper: -// -// dialTLSContext := s2a.NewS2aDialTLSContextFunc(&s2a.ClientOptions{ -// S2AAddress: s2aAddress, // required -// }) -// transport := http.DefaultTransport -// transport.DialTLSContext = dialTLSContext -func NewS2ADialTLSContextFunc(opts *ClientOptions) func(ctx context.Context, network, addr string) (net.Conn, error) { - - return func(ctx context.Context, network, addr string) (net.Conn, error) { - - fallback := func(err error) (net.Conn, error) { - if opts.FallbackOpts != nil && opts.FallbackOpts.FallbackDialer != nil && - opts.FallbackOpts.FallbackDialer.Dialer != nil && opts.FallbackOpts.FallbackDialer.ServerAddr != "" { - fbDialer := opts.FallbackOpts.FallbackDialer - grpclog.Infof("fall back to dial: %s", fbDialer.ServerAddr) - fbConn, fbErr := fbDialer.Dialer.DialContext(ctx, network, fbDialer.ServerAddr) - if fbErr != nil { - return nil, fmt.Errorf("error fallback to %s: %v; S2A error: %w", fbDialer.ServerAddr, fbErr, err) - } - return fbConn, nil - } - return nil, err - } - - factory, err := NewTLSClientConfigFactory(opts) - if err != nil { - grpclog.Infof("error creating S2A client config factory: %v", err) - return fallback(err) - } - - serverName, _, err := net.SplitHostPort(addr) - if err != nil { - serverName = addr - } - timeoutCtx, cancel := context.WithTimeout(ctx, v2.GetS2ATimeout()) - defer cancel() - - var s2aTLSConfig *tls.Config - retry.Run(timeoutCtx, - func() error { - s2aTLSConfig, err = factory.Build(timeoutCtx, &TLSClientConfigOptions{ - ServerName: serverName, - }) - return err - }) - if err != nil { - grpclog.Infof("error building S2A TLS config: %v", err) - return fallback(err) - } - - s2aDialer := &tls.Dialer{ - Config: s2aTLSConfig, - } - var c net.Conn - retry.Run(timeoutCtx, - func() error { - c, err = s2aDialer.DialContext(timeoutCtx, network, addr) - return err - }) - if err != nil { - grpclog.Infof("error dialing with S2A to %s: %v", addr, err) - return fallback(err) - } - grpclog.Infof("success dialing MTLS to %s with S2A", addr) - return c, nil - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a_options.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a_options.go deleted file mode 100644 index fcdbc1621bd1..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a_options.go +++ /dev/null @@ -1,215 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package s2a - -import ( - "context" - "crypto/tls" - "errors" - "sync" - - "github.com/google/s2a-go/fallback" - "github.com/google/s2a-go/stream" - "google.golang.org/grpc/credentials" - - s2apb "github.com/google/s2a-go/internal/proto/common_go_proto" -) - -// Identity is the interface for S2A identities. -type Identity interface { - // Name returns the name of the identity. - Name() string -} - -type spiffeID struct { - spiffeID string -} - -func (s *spiffeID) Name() string { return s.spiffeID } - -// NewSpiffeID creates a SPIFFE ID from id. -func NewSpiffeID(id string) Identity { - return &spiffeID{spiffeID: id} -} - -type hostname struct { - hostname string -} - -func (h *hostname) Name() string { return h.hostname } - -// NewHostname creates a hostname from name. -func NewHostname(name string) Identity { - return &hostname{hostname: name} -} - -type uid struct { - uid string -} - -func (h *uid) Name() string { return h.uid } - -// NewUID creates a UID from name. -func NewUID(name string) Identity { - return &uid{uid: name} -} - -// VerificationModeType specifies the mode that S2A must use to verify the peer -// certificate chain. -type VerificationModeType int - -// Three types of verification modes. -const ( - Unspecified = iota - ConnectToGoogle - Spiffe -) - -// ClientOptions contains the client-side options used to establish a secure -// channel using the S2A handshaker service. -type ClientOptions struct { - // TargetIdentities contains a list of allowed server identities. One of the - // target identities should match the peer identity in the handshake - // result; otherwise, the handshake fails. - TargetIdentities []Identity - // LocalIdentity is the local identity of the client application. If none is - // provided, then the S2A will choose the default identity, if one exists. - LocalIdentity Identity - // S2AAddress is the address of the S2A. - S2AAddress string - // Optional transport credentials. - // If set, this will be used for the gRPC connection to the S2A server. - TransportCreds credentials.TransportCredentials - // EnsureProcessSessionTickets waits for all session tickets to be sent to - // S2A before a process completes. - // - // This functionality is crucial for processes that complete very soon after - // using S2A to establish a TLS connection, but it can be ignored for longer - // lived processes. - // - // Usage example: - // func main() { - // var ensureProcessSessionTickets sync.WaitGroup - // clientOpts := &s2a.ClientOptions{ - // EnsureProcessSessionTickets: &ensureProcessSessionTickets, - // // Set other members. - // } - // creds, _ := s2a.NewClientCreds(clientOpts) - // conn, _ := grpc.Dial(serverAddr, grpc.WithTransportCredentials(creds)) - // defer conn.Close() - // - // // Make RPC call. - // - // // The process terminates right after the RPC call ends. - // // ensureProcessSessionTickets can be used to ensure resumption - // // tickets are fully processed. If the process is long-lived, using - // // ensureProcessSessionTickets is not necessary. - // ensureProcessSessionTickets.Wait() - // } - EnsureProcessSessionTickets *sync.WaitGroup - // If true, enables the use of legacy S2Av1. - EnableLegacyMode bool - // VerificationMode specifies the mode that S2A must use to verify the - // peer certificate chain. - VerificationMode VerificationModeType - - // Optional fallback after dialing with S2A fails. - FallbackOpts *FallbackOptions - - // Generates an S2AStream interface for talking to the S2A server. - getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error) - - // Serialized user specified policy for server authorization. - serverAuthorizationPolicy []byte -} - -// FallbackOptions prescribes the fallback logic that should be taken if the application fails to connect with S2A. -type FallbackOptions struct { - // FallbackClientHandshakeFunc is used to specify fallback behavior when calling s2a.NewClientCreds(). - // It will be called by ClientHandshake function, after handshake with S2A fails. - // s2a.NewClientCreds() ignores the other FallbackDialer field. - FallbackClientHandshakeFunc fallback.ClientHandshake - - // FallbackDialer is used to specify fallback behavior when calling s2a.NewS2aDialTLSContextFunc(). - // It passes in a custom fallback dialer and server address to use after dialing with S2A fails. - // s2a.NewS2aDialTLSContextFunc() ignores the other FallbackClientHandshakeFunc field. - FallbackDialer *FallbackDialer -} - -// FallbackDialer contains a fallback tls.Dialer and a server address to connect to. -type FallbackDialer struct { - // Dialer specifies a fallback tls.Dialer. - Dialer *tls.Dialer - // ServerAddr is used by Dialer to establish fallback connection. - ServerAddr string -} - -// DefaultClientOptions returns the default client options. -func DefaultClientOptions(s2aAddress string) *ClientOptions { - return &ClientOptions{ - S2AAddress: s2aAddress, - VerificationMode: ConnectToGoogle, - } -} - -// ServerOptions contains the server-side options used to establish a secure -// channel using the S2A handshaker service. -type ServerOptions struct { - // LocalIdentities is the list of local identities that may be assumed by - // the server. If no local identity is specified, then the S2A chooses a - // default local identity, if one exists. - LocalIdentities []Identity - // S2AAddress is the address of the S2A. - S2AAddress string - // Optional transport credentials. - // If set, this will be used for the gRPC connection to the S2A server. - TransportCreds credentials.TransportCredentials - // If true, enables the use of legacy S2Av1. - EnableLegacyMode bool - // VerificationMode specifies the mode that S2A must use to verify the - // peer certificate chain. - VerificationMode VerificationModeType - - // Generates an S2AStream interface for talking to the S2A server. - getS2AStream func(ctx context.Context, s2av2Address string) (stream.S2AStream, error) -} - -// DefaultServerOptions returns the default server options. -func DefaultServerOptions(s2aAddress string) *ServerOptions { - return &ServerOptions{ - S2AAddress: s2aAddress, - VerificationMode: ConnectToGoogle, - } -} - -func toProtoIdentity(identity Identity) (*s2apb.Identity, error) { - if identity == nil { - return nil, nil - } - switch id := identity.(type) { - case *spiffeID: - return &s2apb.Identity{IdentityOneof: &s2apb.Identity_SpiffeId{SpiffeId: id.Name()}}, nil - case *hostname: - return &s2apb.Identity{IdentityOneof: &s2apb.Identity_Hostname{Hostname: id.Name()}}, nil - case *uid: - return &s2apb.Identity{IdentityOneof: &s2apb.Identity_Uid{Uid: id.Name()}}, nil - default: - return nil, errors.New("unrecognized identity type") - } -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a_utils.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a_utils.go deleted file mode 100644 index d649cc46148c..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/s2a_utils.go +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Copyright 2021 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. - * - */ - -package s2a - -import ( - "context" - "errors" - - commonpb "github.com/google/s2a-go/internal/proto/common_go_proto" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/peer" -) - -// AuthInfo exposes security information from the S2A to the application. -type AuthInfo interface { - // AuthType returns the authentication type. - AuthType() string - // ApplicationProtocol returns the application protocol, e.g. "grpc". - ApplicationProtocol() string - // TLSVersion returns the TLS version negotiated during the handshake. - TLSVersion() commonpb.TLSVersion - // Ciphersuite returns the ciphersuite negotiated during the handshake. - Ciphersuite() commonpb.Ciphersuite - // PeerIdentity returns the authenticated identity of the peer. - PeerIdentity() *commonpb.Identity - // LocalIdentity returns the local identity of the application used during - // session setup. - LocalIdentity() *commonpb.Identity - // PeerCertFingerprint returns the SHA256 hash of the peer certificate used in - // the S2A handshake. - PeerCertFingerprint() []byte - // LocalCertFingerprint returns the SHA256 hash of the local certificate used - // in the S2A handshake. - LocalCertFingerprint() []byte - // IsHandshakeResumed returns true if a cached session was used to resume - // the handshake. - IsHandshakeResumed() bool - // SecurityLevel returns the security level of the connection. - SecurityLevel() credentials.SecurityLevel -} - -// AuthInfoFromPeer extracts the authinfo.S2AAuthInfo object from the given -// peer, if it exists. This API should be used by gRPC clients after -// obtaining a peer object using the grpc.Peer() CallOption. -func AuthInfoFromPeer(p *peer.Peer) (AuthInfo, error) { - s2aAuthInfo, ok := p.AuthInfo.(AuthInfo) - if !ok { - return nil, errors.New("no S2AAuthInfo found in Peer") - } - return s2aAuthInfo, nil -} - -// AuthInfoFromContext extracts the authinfo.S2AAuthInfo object from the given -// context, if it exists. This API should be used by gRPC server RPC handlers -// to get information about the peer. On the client-side, use the grpc.Peer() -// CallOption and the AuthInfoFromPeer function. -func AuthInfoFromContext(ctx context.Context) (AuthInfo, error) { - p, ok := peer.FromContext(ctx) - if !ok { - return nil, errors.New("no Peer found in Context") - } - return AuthInfoFromPeer(p) -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/stream/s2a_stream.go b/cluster-autoscaler/vendor/github.com/google/s2a-go/stream/s2a_stream.go deleted file mode 100644 index 584bf32b1c7f..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/stream/s2a_stream.go +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright 2023 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. - * - */ - -// Package stream provides an interface for bidirectional streaming to the S2A server. -package stream - -import ( - s2av2pb "github.com/google/s2a-go/internal/proto/v2/s2a_go_proto" -) - -// S2AStream defines the operation for communicating with the S2A server over a bidirectional stream. -type S2AStream interface { - // Send sends the message to the S2A server. - Send(*s2av2pb.SessionReq) error - // Recv receives the message from the S2A server. - Recv() (*s2av2pb.SessionResp, error) - // Closes the channel to the S2A server. - CloseSend() error -} diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/client_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/client_cert.pem deleted file mode 100644 index 493a5a264810..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/client_cert.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIUKXNlBRVe6UepjQUijIFPZBd/4qYwDQYJKoZIhvcNAQEL -BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 -YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE -AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN -MjIwNTMxMjAwMzE1WhcNNDIwNTI2MjAwMzE1WjCBhzELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx -ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ -KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAOOFuIucH7XXfohGxKd3uR/ihUA/LdduR9I8kfpUEbq5BOt8xZe5/Yn9 -a1ozEHVW6cOAbHbnwAR8tkSgZ/t42QIA2k77HWU1Jh2xiEIsJivo3imm4/kZWuR0 -OqPh7MhzxpR/hvNwpI5mJsAVBWFMa5KtecFZLnyZtwHylrRN1QXzuLrOxuKFufK3 -RKbTABScn5RbZL976H/jgfSeXrbt242NrIoBnVe6fRbekbq2DQ6zFArbQMUgHjHK -P0UqBgdr1QmHfi9KytFyx9BTP3gXWnWIu+bY7/v7qKJMHFwGETo+dCLWYevJL316 -HnLfhApDMfP8U+Yv/y1N/YvgaSOSlEcCAwEAAaNTMFEwHQYDVR0OBBYEFKhAU4nu -0h/lrnggbIGvx4ej0WklMB8GA1UdIwQYMBaAFKhAU4nu0h/lrnggbIGvx4ej0Wkl -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAE/6NghzQ5fu6yR6 -EHKbj/YMrFdT7aGn5n2sAf7wJ33LIhiFHkpWBsVlm7rDtZtwhe891ZK/P60anlg9 -/P0Ua53tSRVRmCvTnEbXWOVMN4is6MsR7BlmzUxl4AtIn7jbeifEwRL7B4xDYmdA -QrQnsqoz45dLgS5xK4WDqXATP09Q91xQDuhud/b+A4jrvgwFASmL7rMIZbp4f1JQ -nlnl/9VoTBQBvJiWkDUtQDMpRLtauddEkv4AGz75p5IspXWD6cOemuh2iQec11xD -X20rs2WZbAcAiUa3nmy8OKYw435vmpj8gp39WYbX/Yx9TymrFFbVY92wYn+quTco -pKklVz0= ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/client_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/client_key.pem deleted file mode 100644 index 55a7f10c742d..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/client_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEA44W4i5wftdd+iEbEp3e5H+KFQD8t125H0jyR+lQRurkE63zF -l7n9if1rWjMQdVbpw4BsdufABHy2RKBn+3jZAgDaTvsdZTUmHbGIQiwmK+jeKabj -+Rla5HQ6o+HsyHPGlH+G83CkjmYmwBUFYUxrkq15wVkufJm3AfKWtE3VBfO4us7G -4oW58rdEptMAFJyflFtkv3vof+OB9J5etu3bjY2sigGdV7p9Ft6RurYNDrMUCttA -xSAeMco/RSoGB2vVCYd+L0rK0XLH0FM/eBdadYi75tjv+/uookwcXAYROj50ItZh -68kvfXoect+ECkMx8/xT5i//LU39i+BpI5KURwIDAQABAoIBABgyjo/6iLzUMFbZ -/+w3pW6orrdIgN2akvTfED9pVYFgUA+jc3hRhY95bkNnjuaL2cy7Cc4Tk65mfRQL -Y0OxdJLr+EvSFSxAXM9npDA1ddHRsF8JqtFBSxNk8R+g1Yf0GDiO35Fgd3/ViWWA -VtQkRoSRApP3oiQKTRZd8H04keFR+PvmDk/Lq11l3Kc24A1PevKIPX1oI990ggw9 -9i4uSV+cnuMxmcI9xxJtgwdDFdjr39l2arLOHr4s6LGoV2IOdXHNlv5xRqWUZ0FH -MDHowkLgwDrdSTnNeaVNkce14Gqx+bd4hNaLCdKXMpedBTEmrut3f3hdV1kKjaKt -aqRYr8ECgYEA/YDGZY2jvFoHHBywlqmEMFrrCvQGH51m5R1Ntpkzr+Rh3YCmrpvq -xgwJXING0PUw3dz+xrH5lJICrfNE5Kt3fPu1rAEy+13mYsNowghtUq2Rtu0Hsjjx -2E3Bf8vEB6RNBMmGkUpTTIAroGF5tpJoRvfnWax+k4pFdrKYFtyZdNcCgYEA5cNv -EPltvOobjTXlUmtVP3n27KZN2aXexTcagLzRxE9CV4cYySENl3KuOMmccaZpIl6z -aHk6BT4X+M0LqElNUczrInfVqI+SGAFLGy7W6CJaqSr6cpyFUP/fosKpm6wKGgLq -udHfpvz5rckhKd8kJxFLvhGOK9yN5qpzih0gfhECgYAJfwRvk3G5wYmYpP58dlcs -VIuPenqsPoI3PPTHTU/hW+XKnWIhElgmGRdUrto9Q6IT/Y5RtSMLTLjq+Tzwb/fm -56rziYv2XJsfwgAvnI8z1Kqrto9ePsHYf3krJ1/thVsZPc9bq/QY3ohD1sLvcuaT -GgBBnLOVJU3a12/ZE2RwOwKBgF0csWMAoj8/5IB6if+3ral2xOGsl7oPZVMo/J2V -Z7EVqb4M6rd/pKFugTpUQgkwtkSOekhpcGD1hAN5HTNK2YG/+L5UMAsKe9sskwJm -HgOfAHy0BSDzW3ey6i9skg2bT9Cww+0gJ3Hl7U1HSCBO5LjMYpSZSrNtwzfqdb5Q -BX3xAoGARZdR28Ej3+/+0+fz47Yu2h4z0EI/EbrudLOWY936jIeAVwHckI3+BuqH -qR4poj1gfbnMxNuI9UzIXzjEmGewx9kDZ7IYnvloZKqoVQODO5GlKF2ja6IcMNlh -GCNdD6PSAS6HcmalmWo9sj+1YMkrl+GJikKZqVBHrHNwMGAG67w= ------END RSA PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_client_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_client_cert.pem deleted file mode 100644 index 60c4cf069157..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_client_cert.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDCDCCAfACFFlYsYCFit01ZpYmfjxpo7/6wMEbMA0GCSqGSIb3DQEBCwUAMEgx -CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEPMA0GA1UECgwGR29vZ2xlMRswGQYD -VQQDDBJ0ZXN0LXMyYS1tdGxzLXJvb3QwHhcNMjMwODIyMTY0NTE4WhcNNDMwODIy -MTY0NTE4WjA5MQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExHTAbBgNVBAMMFHRl -c3QtczJhLW10bHMtY2xpZW50MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAqrQQMyxNtmdCB+uY3szgRsfPrKC+TV9Fusnd8PfaCVuGTGcSBKM018nV2TDn -3IYFQ1HgLpGwGwOFDBb3y0o9i2/l2VJySriX1GSNX6nDmVasQlO1wuOLCP7/LRmO -7b6Kise5W0IFhYaptKyWnekn2pS0tAjimqpfn2w0U6FDGtQUqg/trQQmGtTSJHjb -A+OFd0EFC18KGP8Q+jOMaMkJRmpeEiAPyHPDoMhqQNT26RApv9j2Uzo4SuXzHH6T -cAdm1+zG+EXY/UZKX9oDkSbwIJvN+gCmNyORLalJ12gsGYOCjMd8K0mlXBqrmmbO -VHVbUm9062lhE7x59AA8DK4DoQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQCPOvtL -dq2hxFHlIy0YUK8jp/DtwJZPwzx1id5FtWwd0CxBS1StIgmkHMxtkJGz1iyQLplI -je+Msd4sTsb5zZi/8kGKehi8Wj4lghp4oP30cpob41OvM68M9RC/wSOVk9igSww+ -l3zof6wKRIswsi5VHrL16ruIVVoDlyFbKr8yk+cp9OPOV8hNNN7ewY9xC8OgnTt8 -YtdaLe6uTplKBLW+j3GtshigRhyfkGJyPFYL4LAeDJCHlC1qmBnkyP0ijMp6vneM -E8TLavnMTMcpihWTWpyKeRkO6HDRsP4AofQAp7VAiAdSOplga+w2qgrVICV+m8MK -BTq2PBvc59T6OFLq ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_client_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_client_key.pem deleted file mode 100644 index 9d112d1e9ff9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_client_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCqtBAzLE22Z0IH -65jezOBGx8+soL5NX0W6yd3w99oJW4ZMZxIEozTXydXZMOfchgVDUeAukbAbA4UM -FvfLSj2Lb+XZUnJKuJfUZI1fqcOZVqxCU7XC44sI/v8tGY7tvoqKx7lbQgWFhqm0 -rJad6SfalLS0COKaql+fbDRToUMa1BSqD+2tBCYa1NIkeNsD44V3QQULXwoY/xD6 -M4xoyQlGal4SIA/Ic8OgyGpA1PbpECm/2PZTOjhK5fMcfpNwB2bX7Mb4Rdj9Rkpf -2gORJvAgm836AKY3I5EtqUnXaCwZg4KMx3wrSaVcGquaZs5UdVtSb3TraWETvHn0 -ADwMrgOhAgMBAAECggEAUccupZ1ZY4OHTi0PkNk8rpwFwTFGyeFVEf2ofkr24RnA -NnUAXEllxOUUNlcoFOz9s3kTeavg3qgqgpa0QmdAIb9LMXg+ec6CKkW7trMpGho8 -LxBUWNfSoU4sKEqAvyPT0lWJVo9D/up6/avbAi6TIbOw+Djzel4ZrlHTpabxc3WT -EilXzn4q54b3MzxCQeQjcnzTieW4Q5semG2kLiXFToHIY2di01P/O8awUjgrD+uW -/Cb6H49MnHm9VPkqea1iwZeMQd6Gh5FrC7RezsBjdB1JBcfsv6PFt2ySInjB8SF+ -XR5Gr3Cc5sh9s0LfprZ9Dq0rlSWmwasPMI1COK6SswKBgQDczgeWd3erQ1JX9LEI -wollawqC9y7uJhEsw1hrPqA3uqZYiLUc7Nmi4laZ12mcGoXNDS3R3XmD58qGmGaU -lxEVTb8KDVWBgw450VoBKzSMQnCP6zn4nZxTYxeqMKjDGf6TRB6TZc843qsG3eRC -k91yxrCQ/0HV6PT48C+lieDzLwKBgQDF6aNKiyrswr457undBnM1H8q/Y6xC5ZlK -UtiQdhuyBnicvz0U8WPxBY/8gha0OXWuSnBqq/z77iFVNv/zT6p9K7kM7nBGd8cB -8KO6FNbyaHWFrhCI5zNzRTH4oha0hfvUOoti09vqavCtWD4L+D/63ba1wNLKPO9o -4gWbCnUCLwKBgQC/vus372csgrnvR761LLrEJ8BpGt7WUJh5luoht7DKtHvgRleB -Vu1oVcV+s2Iy/ZVUDC3OIdZ0hcWKPK5YOxfKuEk+IXYvke+4peTTPwHTC59UW6Fs -FPK8N0FFuhvT0a8RlAY5WiAp8rPysp6WcnHMSl7qi8BQUozp4Sp/RsziYQKBgBXv -r4mzoy5a53rEYGd/L4XT4EUWZyGDEVqLlDVu4eL5lKTLDZokp08vrqXuRVX0iHap -CYzJQ2EpI8iuL/BoBB2bmwcz5n3pCMXORld5t9lmeqA2it6hwbIlGUTVsm6P6zm6 -w3hQwy9YaxTLkxUAjxbfPEEo/jQsTNzzMGve3NlBAoGAbgJExpDyMDnaD2Vi5eyr -63b54BsqeLHqxJmADifyRCj7G1SJMm3zMKkNNOS0vsXgoiId973STFf1XQiojiv8 -Slbxyv5rczcY0n3LOuQYcM5OzsjzpNFZsT2dDnMfNRUF3rx3Geu/FuJ9scF1b00r -fVMrcL3jSf/W1Xh4TgtyoU8= ------END PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_root_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_root_cert.pem deleted file mode 100644 index 44e436f6ec7c..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_root_cert.pem +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDcTCCAlmgAwIBAgIUDUkgI+2FZtuUHyUUi0ZBH7JvN00wDQYJKoZIhvcNAQEL -BQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ8wDQYDVQQKDAZHb29nbGUx -GzAZBgNVBAMMEnRlc3QtczJhLW10bHMtcm9vdDAeFw0yMzA4MjEyMTI5MTVaFw00 -MzA4MjEyMTI5MTVaMEgxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEPMA0GA1UE -CgwGR29vZ2xlMRswGQYDVQQDDBJ0ZXN0LXMyYS1tdGxzLXJvb3QwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbFEQfpvla27bATedrN4BAWsI9GSwSnJLW -QWzXcnAk6cKxQBAhnaKHRxHY8ttLhNTtxQeub894CLzJvHE/0xDhuMzjtCCCZ7i2 -r08tKZ1KcEzPJCPNlxlzAXPA45XU3LRlbGvju/PBPhm6n1hCEKTNI/KETJ5DEaYg -Cf2LcXVsl/zW20MwDZ+e2w/9a2a6n6DdpW1ekOR550hXAUOIxvmXRBeYeGLFvp1n -rQgZBhRaxP03UB+PQD2oMi/4mfsS96uGCXdzzX8qV46O8m132HUbnA/wagIwboEe -d7Bx237dERDyHw5GFnll7orgA0FOtoEufXdeQxWVvTjO0+PVPgsvAgMBAAGjUzBR -MB0GA1UdDgQWBBRyMtg/yutV8hw8vOq0i8x0eBQi7DAfBgNVHSMEGDAWgBRyMtg/ -yutV8hw8vOq0i8x0eBQi7DAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUA -A4IBAQArN/gdqWMxd5Rvq2eJMTp6I4RepJOT7Go4sMsRsy1caJqqcoS2EvREDZMN -XNEBcyQBB5kYd6TCcZGoLnEtWYXQ4jjEiXG1g7/+rWxyqw0ZYuP7FWzuHg3Uor/x -fApbEKwptP5ywVc+33h4qreGcqXkVCCn+sAcstGgrqubdGZW2T5gazUMyammOOuN -9IWL1PbvXmgEKD+80NUIrk09zanYyrElGdU/zw/kUbZ3Jf6WUBtJGhTzRQ1qZeKa -VnpCbLoG3vObEB8mxDUAlIzwAtfvw4U32BVIZA8xrocz6OOoAnSW1bTlo3EOIo/G -MTV7jmY9TBPtfhRuO/cG650+F+cw ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_server_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_server_cert.pem deleted file mode 100644 index 68c60613458a..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_server_cert.pem +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDbjCCAlagAwIBAgIUbexZ5sZl86Al9dsI2PkOgtqKnkgwDQYJKoZIhvcNAQEL -BQAwSDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMQ8wDQYDVQQKDAZHb29nbGUx -GzAZBgNVBAMMEnRlc3QtczJhLW10bHMtcm9vdDAeFw0yMzA4MjIwMDMyMDRaFw00 -MzA4MjIwMDMyMDRaMDkxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTEdMBsGA1UE -AwwUdGVzdC1zMmEtbXRscy1zZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCMEzybsGPqfh92GLwy43mt8kQDF3ztr8y06RwU1hVnY7QqYK4obpvh -HkJVnTz9gwNBF3n5nUalqRzactlf2PCydN9oSYNCO8svVmo7vw1CleKAKFAiV5Qn -H76QlqD15oJreh7nSM8R4qj5KukIHvt0cN0gD6CJQzIURDtsKJwkW3yQjYyT/FAK -GYtFrB6buDn3Eg3Hsw6z7uj7CzLBsSl7BIGrQILbpbI9nFNT3rUTUhXZKY/3UtJA -Ob66AjTmMbD16RGYZR4JsPx6CstheifJ6YSI79r5KgD37zX0jMXFWimvb2SmZmFe -LoohtC8K7uTyjm/dROx6nHXdDt5TQYXHAgMBAAGjXzBdMBsGA1UdEQQUMBKHEAAA -AAAAAAAAAAAAAAAAAAAwHQYDVR0OBBYEFI3i2+tIk6YYn0MIxC0q93jk1VsUMB8G -A1UdIwQYMBaAFHIy2D/K61XyHDy86rSLzHR4FCLsMA0GCSqGSIb3DQEBCwUAA4IB -AQAUhk+s/lrIAULBbU7E22C8f93AzTxE1mhyHGNlfPPJP3t1Dl+h4X4WkFpkz5gT -EcNXB//Vvoq99HbEK5/92sxsIPexKdJBdcggeHXIgLDkOrEZEb0Nnh9eaAuU2QDn -JW44hMB+aF6mEaJvOHE6DRkQw3hwFYFisFKKHtlQ3TyOhw5CHGzSExPZusdSFNIe -2E7V/0QzGPJEFnEFUNe9N8nTH2P385Paoi+5+Iizlp/nztVXfzv0Cj/i+qGgtDUs -HB+gBU2wxMw8eYyuNzACH70wqGR1Parj8/JoyYhx0S4+Gjzy3JH3CcAMaxyfH/dI -4Wcvfz/isxgmH1UqIt3oc6ad ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_server_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_server_key.pem deleted file mode 100644 index b14ad0f724ee..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/mds_server_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCMEzybsGPqfh92 -GLwy43mt8kQDF3ztr8y06RwU1hVnY7QqYK4obpvhHkJVnTz9gwNBF3n5nUalqRza -ctlf2PCydN9oSYNCO8svVmo7vw1CleKAKFAiV5QnH76QlqD15oJreh7nSM8R4qj5 -KukIHvt0cN0gD6CJQzIURDtsKJwkW3yQjYyT/FAKGYtFrB6buDn3Eg3Hsw6z7uj7 -CzLBsSl7BIGrQILbpbI9nFNT3rUTUhXZKY/3UtJAOb66AjTmMbD16RGYZR4JsPx6 -CstheifJ6YSI79r5KgD37zX0jMXFWimvb2SmZmFeLoohtC8K7uTyjm/dROx6nHXd -Dt5TQYXHAgMBAAECggEAIB5zGdIG/yh/Z1GBqfuOFaxFGx5iJ5BVlLAVH9P9IXFz -yPnVRXEjbinFlSMSbqEBeIX9EpcVMXxHIPIP1RIGEy2IYr3kiqXyT771ahDDZh6/ -Spqz0UQatSPqyvW3H9uE0Uc12dvQm23JSCUmPRX5m7gbhDQBIChXzdzdcU4Yi59V -4xmJUvbsAcLw5CBM6kwV+1NGVH9+3mUdhrr9M6B6+sVB/xnaqMGEDfQGiwL8U7EY -QOuc46KXu3Pd/qCdVLn60IrdjSzDJKeC5UZZ+ejNAo+DfbtOovBj3qu3OCUg4XVy -0CDBJ1sTdLvUfF4Gb+crjPsd+qBbXcjVfqdadwhsoQKBgQDBF1Pys/NitW8okJwp -2fiDIASP3TiI+MthWHGyuoZGPvmXQ3H6iuLSm8c/iYI2WPTf53Xff1VcFm1GmQms -GCsYM8Ax94zCeO6Ei1sYYxwcBloEZfOeV37MPA4pjJF4Lt+n5nveNxP+lrsjksJz -wToSEgWPDT1b/xcdt4/5j9J85wKBgQC5tiLx+33mwH4DoaFRmSl0+VuSNYFw6DTQ -SQ+kWqWGH4NENc9wf4Dj2VUZQhpXNhXVSxj+aP2d/ck1NrTJAWqYEXCDtFQOGSa2 -cGPRr+Fhy5NIEaEvR7IXcMBZzx3koYmWVBHricyrXs5FvHrT3N14mGDUG8n24U3f -R799bau0IQKBgQC97UM+lHCPJCWNggiJRgSifcje9VtZp1btjoBvq/bNe74nYkjn -htsrC91Fiu1Qpdlfr50K1IXSyaB886VG6JLjAGxI+dUzqJ38M9LLvxj0G+9JKjsi -AbAQFfZcOg8QZxLJZPVsE0MQhZTXndC06VhEVAOxvPUg214Sde8hK61/+wKBgCRw -O10VhnePT2pw/VEgZ0T/ZFtEylgYB7zSiRIrgwzVBBGPKVueePC8BPmGwdpYz2Hh -cU8B1Ll6QU+Co2hJMdwSl+wPpup5PuJPHRbYlrV0lzpt0x2OyL/WrLcyb2Ab3f40 -EqwPhqwdVwXR3JvTW1U9OMqFhVQ+kuP7lPQMX8NhAoGBAJOgZ7Tokipc4Mi68Olw -SCaOPvjjy4sW2rTRuKyjc1wTAzy7SJ3vXHfGkkN99nTLJFwAyJhWUpnRdwAXGi+x -gyOa95ImsEfRSwEjbluWfF8/P0IU8GR+ZTqT4NnNCOsi8T/xst4Szd1ECJNnnZDe -1ChfPP1AH+/75MJCvu6wQBQv ------END PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/self_signed_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/self_signed_cert.pem deleted file mode 100644 index ad1bad598459..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/self_signed_cert.pem +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDITCCAgkCFBS8mLoytMpMWBwpAtnRaq3eIKnsMA0GCSqGSIb3DQEBCwUAME0x -CzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UECgwEVGVzdDEiMCAGA1UE -AwwZdGVzdC1zMmEtbXRscy1zZWxmLXNpZ25lZDAeFw0yMzA4MjIyMTE2MDFaFw00 -MzA4MjIyMTE2MDFaME0xCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTENMAsGA1UE -CgwEVGVzdDEiMCAGA1UEAwwZdGVzdC1zMmEtbXRscy1zZWxmLXNpZ25lZDCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKFFPsYasKZeCFLEXl3RpE/ZOXFe -2lhutIalSpZvCmso+mQGoZ4cHK7At+kDjBi5CrnXkYcw7quQAhHgU0frhWdj7tsW -HUUtq7T8eaGWKBnVD9fl+MjtAl1BmhXwV9qRBbj4EesSKGDSGpKf66dOtzw83JbB -cU7XlPAH1c1zo2GXC1himcZ+SVGHVrOjn4NmeFs8g94/Dke8dWkHwv5YTMVugFK4 -5KxKgSOKkr4ka7PCBzgxCnW4wYSZNRHcxrqkiArO2HAQq0ACr7u+fVDYH//9mP2Z -ADo/zch7O5yhkiNbjXJIRrptDWEuVYMRloYDhT773h7bV/Q0Wo0NQGtasJ8CAwEA -ATANBgkqhkiG9w0BAQsFAAOCAQEAPjbH0TMyegF/MDvglkc0sXr6DqlmTxDCZZmG -lYPZ5Xy062+rxIHghMARbvO4BxepiG37KsP2agvOldm4TtU8nQ8LyswmSIFm4BQ+ -XQWwdsWyYyd8l0d5sXAdaN6AXwy50fvqCepmEqyreMY6dtLzlwo9gVCBFB7QuAPt -Nc14phpEUZt/KPNuY6cUlB7bz3tmnFbwxUrWj1p0KBEYsr7+KEVZxR+z0wtlU7S9 -ZBrmUvx0fq5Ef7JWtHW0w4ofg1op742sdYl+53C26GZ76ts4MmqVz2/94DScgRaU -gT0GLVuuCZXRDVeTXqTb4mditRCfzFPe9cCegYhGhSqBs8yh5A== ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/self_signed_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/self_signed_key.pem deleted file mode 100644 index bcf08e4f12f4..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/self_signed_key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQChRT7GGrCmXghS -xF5d0aRP2TlxXtpYbrSGpUqWbwprKPpkBqGeHByuwLfpA4wYuQq515GHMO6rkAIR -4FNH64VnY+7bFh1FLau0/HmhligZ1Q/X5fjI7QJdQZoV8FfakQW4+BHrEihg0hqS -n+unTrc8PNyWwXFO15TwB9XNc6NhlwtYYpnGfklRh1azo5+DZnhbPIPePw5HvHVp -B8L+WEzFboBSuOSsSoEjipK+JGuzwgc4MQp1uMGEmTUR3Ma6pIgKzthwEKtAAq+7 -vn1Q2B///Zj9mQA6P83IezucoZIjW41ySEa6bQ1hLlWDEZaGA4U++94e21f0NFqN -DUBrWrCfAgMBAAECggEAR8e8YwyqJ8KezcgdgIC5M9kp2i4v3UCZFX0or8CI0J2S -pUbWVLuKgLXCpfIwPyjNf15Vpei/spkMcsx4BQDthdFTFSzIpmvni0z9DlD5VFYj -ESOJElV7wepbHPy2/c+izmuL/ic81aturGiFyRgeMq+cN3WuaztFTXkPTrzzsZGF -p/Mx3gqm7Hoc3d2xlv+8L5GjCtEJPlQgZJV+s3ennBjOAd8CC7d9qJetE3Er46pn -r5jedV3bQRZYBzmooYNHjbAs26++wYac/jTE0/U6nKS17eWq4BQZUtlMXUw5N81B -7LKn7C03rj2KCn+Nf5uin9ALmoy888LXCDdvL/NZkQKBgQDduv1Heu+tOZuNYUdQ -Hswmd8sVNAAWGZxdxixHMv58zrgbLFXSX6K89X2l5Sj9XON8TH46MuSFdjSwwWw5 -fBrhVEhA5srcqpvVWIBE05yqPpt0s1NQktMWJKELWlG8jOhVKwM5OYDpdxtwehpz -1g70XJz+nF/LTV8RdTK+OWDDpQKBgQC6MhdbGHUz/56dY3gZpE5TXnN2hkNbZCgk -emr6z85VHhQflZbedhCzB9PUnZnCKWOGQHQdxRTtRfd46LVboZqCdYO1ZNQv6toP -ysS7dTpZZFy7CpQaW0Y6/jS65jW6xIDKR1W40vgltZ3sfpG37JaowpzWdw2WuOnw -Bg0rcJAf8wKBgQCqE+p/z97UwuF8eufWnyj9QNo382E1koOMspv4KTdnyLETtthF -vDH6O1wbykG8xmmASLRyM+NyNA+KnXNETNvZh2q8zctBpGRQK8iIAsGjHM7ln0AD -B/x+ea5GJQuZU4RK/+lDFca6TjBwAFkWDVX/PqL18kDQkxKfM4SuwRhmOQKBgDGh -eoJIsa0LnP787Z2AI3Srf4F/ZmLs/ppCm1OBotEjdF+64v0nYWonUvqgi8SqfaHi -elEZIGvis4ViGj1zhRjzNAlc+AZRxpBhDzGcnNIJI4Kj3jhsTfsZmXqcNIQ1LtM8 -Uogyi/yZPaA1WKg7Aym2vlGYaGHdplXZdxc2KOSrAoGABRkD9l2OVcwK7RyNgFxo -mjxx0tfUdDBhHIi2igih1FiHpeP9E+4/kE/K7PnU9DoDrL1jW1MTpXaYV4seOylk -k9z/9QfcRa9ePD2N4FqbHWSYp5n3aLoIcGq/9jyjTwayZbbIhWO+vNuHE9wIvecZ -8x3gNkxJRb4NaLIoNzAhCoo= ------END PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/server_cert.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/server_cert.pem deleted file mode 100644 index 0f98322c7244..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/server_cert.pem +++ /dev/null @@ -1,24 +0,0 @@ ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIUKCoDuLtiZXvhsBY2RoDm0ugizJ8wDQYJKoZIhvcNAQEL -BQAwgYcxCzAJBgNVBAYTAlVTMQswCQYDVQQIDAJDQTESMBAGA1UEBwwJU3Vubnl2 -YWxlMRAwDgYDVQQKDAdDb21wYW55MREwDwYDVQQLDAhEaXZpc2lvbjEWMBQGA1UE -AwwNczJhX3Rlc3RfY2VydDEaMBgGCSqGSIb3DQEJARYLeHl6QHh5ei5jb20wHhcN -MjIwNTMxMjAwODI1WhcNNDIwNTI2MjAwODI1WjCBhzELMAkGA1UEBhMCVVMxCzAJ -BgNVBAgMAkNBMRIwEAYDVQQHDAlTdW5ueXZhbGUxEDAOBgNVBAoMB0NvbXBhbnkx -ETAPBgNVBAsMCERpdmlzaW9uMRYwFAYDVQQDDA1zMmFfdGVzdF9jZXJ0MRowGAYJ -KoZIhvcNAQkBFgt4eXpAeHl6LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKK1++PXQ+M3hjYH/v0K4UEYl5ljzpNM1i52eQM+gFooojT87PDSaphT -fs0PXy/PTAjHBEvPhWpOpmQXfJNYzjwcCvg66hbqkv++/VTZiFLAsHagzkEz+FRJ -qT5Eq7G5FLyw1izX1uxyPN7tAEWEEg7eqsiaXD3Cq8+TYN9cjirPeF7RZF8yFCYE -xqvbo+Yc6RL6xw19iXVTfctRgQe581KQuIY5/LXo3dWDEilFdsADAe8XAEcO64es -Ow0g1UvXLnpXSE151kXBFb3sKH/ZjCecDYMCIMEb4sWLSblkSxJ5sNSmXIG4wtr2 -Qnii7CXZgnVYraQE/Jyh+NMQANuoSdMCAwEAAaNTMFEwHQYDVR0OBBYEFAyQQQuM -ab+YUQqjK8dVVOoHVFmXMB8GA1UdIwQYMBaAFAyQQQuMab+YUQqjK8dVVOoHVFmX -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBADj0vQ6ykWhicoqR -e6VZMwlEJV7/DSvWWKBd9MUjfKye0A4565ya5lmnzP3DiD3nqGe3miqmLsXKDs+X -POqlPXTWIamP7D4MJ32XtSLwZB4ru+I+Ao/P/VngPepoRPQoBnzHe7jww0rokqxl -AZERjlbTUwUAy/BPWPSzSJZ2j0tcs6ZLDNyYzpK4ao8R9/1VmQ92Tcp3feJs1QTg -odRQc3om/AkWOwsll+oyX0UbJeHkFHiLanUPXbdh+/BkSvZJ8ynL+feSDdaurPe+ -PSfnqLtQft9/neecGRdEaQzzzSFVQUVQzTdK1Q7hA7b55b2HvIa3ktDiks+sJsYN -Dhm6uZM= ------END CERTIFICATE----- diff --git a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/server_key.pem b/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/server_key.pem deleted file mode 100644 index 81afea783df9..000000000000 --- a/cluster-autoscaler/vendor/github.com/google/s2a-go/testdata/server_key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAorX749dD4zeGNgf+/QrhQRiXmWPOk0zWLnZ5Az6AWiiiNPzs -8NJqmFN+zQ9fL89MCMcES8+Fak6mZBd8k1jOPBwK+DrqFuqS/779VNmIUsCwdqDO -QTP4VEmpPkSrsbkUvLDWLNfW7HI83u0ARYQSDt6qyJpcPcKrz5Ng31yOKs94XtFk -XzIUJgTGq9uj5hzpEvrHDX2JdVN9y1GBB7nzUpC4hjn8tejd1YMSKUV2wAMB7xcA -Rw7rh6w7DSDVS9cueldITXnWRcEVvewof9mMJ5wNgwIgwRvixYtJuWRLEnmw1KZc -gbjC2vZCeKLsJdmCdVitpAT8nKH40xAA26hJ0wIDAQABAoIBACaNR+lsD8G+XiZf -LqN1+HkcAo9tfnyYMAdCOtnx7SdviT9Uzi8hK/B7mAeuJLeHPlS2EuaDfPD7QaFl -jza6S+MiIdc+3kgfvESsVAnOoOY6kZUJ9NSuI6CU82y1iJjLaYZrv9NQMLRFPPb0 -4KOX709mosB1EnXvshW0rbc+jtDFhrm1SxMt+k9TuzmMxjbOeW4LOLXPgU8X1T3Q -Xy0hMZZtcgBs9wFIo8yCtmOixax9pnFE8rRltgDxTodn9LLdz1FieyntNgDksZ0P -nt4kV7Mqly7ELaea+Foaj244mKsesic2e3GhAlMRLun/VSunSf7mOCxfpITB8dp1 -drDhOYECgYEA19151dVxRcviuovN6Dar+QszMTnU8pDJ8BjLFjXjP/hNBBwMTHDE -duMuWk2qnwZqMooI/shxrF/ufmTgS0CFrh2+ANBZu27vWConJNXcyNtdigI4wt50 -L0Y2qcZn2mg67qFXHwoR3QNwrwnPwEjRXA09at9CSRZzcwDQ0ETXhYsCgYEAwPaG -06QdK8Zyly7TTzZJwxzv9uGiqzodmGtX6NEKjgij2JaCxHpukqZBJoqa0jKeK1cm -eNVkOvT5ff9TMzarSHQLr3pZen2/oVLb5gaFkbcJt/klv9Fd+ZRilHY3i6QwS6pD -uMiPOWS4DrLHDRVoVlAZTDjT1RVwwTs+P2NhJdkCgYEAsriXysbxBYyMp05gqEW7 -lHIFbFgpSrs9th+Q5U6wW6JEgYaHWDJ1NslY80MiZI93FWjbkbZ7BvBWESeL3EIL -a+EMErht0pVCbIhZ6FF4foPAqia0wAJVx14mm+G80kNBp5jE/NnleEsE3KcO7nBb -hg8gLn+x7bk81JZ0TDrzBYkCgYEAuQKluv47SeF3tSScTfKLPpvcKCWmxe1uutkQ -7JShPhVioyOMNb39jnYBOWbjkm4d4QgqRuiytSR0oi3QI+Ziy5EYMyNn713qAk9j -r2TJZDDPDKnBW+zt4YI4EohWMXk3JRUW4XDKggjjwJQA7bZ812TtHHvP/xoThfG7 -eSNb3eECgYBw6ssgCtMrdvQiEmjKVX/9yI38mvC2kSGyzbrQnGUfgqRGomRpeZuD -B5E3kysA4td5pT5lvcLgSW0TbOz+YbiriXjwOihPIelCvc9gE2eOUI71/byUWPFz -7u5F/xQ4NaGr5suLF+lBC6h7pSbM4El9lIHQAQadpuEdzHqrw+hs3g== ------END RSA PRIVATE KEY----- diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/.gitignore b/cluster-autoscaler/vendor/github.com/gorilla/websocket/.gitignore deleted file mode 100644 index cd3fcd1ef72a..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe - -.idea/ -*.iml diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/AUTHORS b/cluster-autoscaler/vendor/github.com/gorilla/websocket/AUTHORS deleted file mode 100644 index 1931f400682c..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/AUTHORS +++ /dev/null @@ -1,9 +0,0 @@ -# This is the official list of Gorilla WebSocket authors for copyright -# purposes. -# -# Please keep the list sorted. - -Gary Burd -Google LLC (https://opensource.google.com/) -Joachim Bauch - diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/LICENSE b/cluster-autoscaler/vendor/github.com/gorilla/websocket/LICENSE deleted file mode 100644 index 9171c9722522..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/README.md b/cluster-autoscaler/vendor/github.com/gorilla/websocket/README.md deleted file mode 100644 index 2517a28715fa..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Gorilla WebSocket - -[![GoDoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket) -[![CircleCI](https://circleci.com/gh/gorilla/websocket.svg?style=svg)](https://circleci.com/gh/gorilla/websocket) - -Gorilla WebSocket is a [Go](http://golang.org/) implementation of the -[WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. - - ---- - -⚠️ **[The Gorilla WebSocket Package is looking for a new maintainer](https://github.com/gorilla/websocket/issues/370)** - ---- - -### Documentation - -* [API Reference](https://pkg.go.dev/github.com/gorilla/websocket?tab=doc) -* [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat) -* [Command example](https://github.com/gorilla/websocket/tree/master/examples/command) -* [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo) -* [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch) - -### Status - -The Gorilla WebSocket package provides a complete and tested implementation of -the [WebSocket](http://www.rfc-editor.org/rfc/rfc6455.txt) protocol. The -package API is stable. - -### Installation - - go get github.com/gorilla/websocket - -### Protocol Compliance - -The Gorilla WebSocket package passes the server tests in the [Autobahn Test -Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn -subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn). - diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/client.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/client.go deleted file mode 100644 index 2efd83555d37..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/client.go +++ /dev/null @@ -1,422 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bytes" - "context" - "crypto/tls" - "errors" - "io" - "io/ioutil" - "net" - "net/http" - "net/http/httptrace" - "net/url" - "strings" - "time" -) - -// ErrBadHandshake is returned when the server response to opening handshake is -// invalid. -var ErrBadHandshake = errors.New("websocket: bad handshake") - -var errInvalidCompression = errors.New("websocket: invalid compression negotiation") - -// NewClient creates a new client connection using the given net connection. -// The URL u specifies the host and request URI. Use requestHeader to specify -// the origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies -// (Cookie). Use the response.Header to get the selected subprotocol -// (Sec-WebSocket-Protocol) and cookies (Set-Cookie). -// -// If the WebSocket handshake fails, ErrBadHandshake is returned along with a -// non-nil *http.Response so that callers can handle redirects, authentication, -// etc. -// -// Deprecated: Use Dialer instead. -func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, readBufSize, writeBufSize int) (c *Conn, response *http.Response, err error) { - d := Dialer{ - ReadBufferSize: readBufSize, - WriteBufferSize: writeBufSize, - NetDial: func(net, addr string) (net.Conn, error) { - return netConn, nil - }, - } - return d.Dial(u.String(), requestHeader) -} - -// A Dialer contains options for connecting to WebSocket server. -// -// It is safe to call Dialer's methods concurrently. -type Dialer struct { - // NetDial specifies the dial function for creating TCP connections. If - // NetDial is nil, net.Dial is used. - NetDial func(network, addr string) (net.Conn, error) - - // NetDialContext specifies the dial function for creating TCP connections. If - // NetDialContext is nil, NetDial is used. - NetDialContext func(ctx context.Context, network, addr string) (net.Conn, error) - - // NetDialTLSContext specifies the dial function for creating TLS/TCP connections. If - // NetDialTLSContext is nil, NetDialContext is used. - // If NetDialTLSContext is set, Dial assumes the TLS handshake is done there and - // TLSClientConfig is ignored. - NetDialTLSContext func(ctx context.Context, network, addr string) (net.Conn, error) - - // Proxy specifies a function to return a proxy for a given - // Request. If the function returns a non-nil error, the - // request is aborted with the provided error. - // If Proxy is nil or returns a nil *URL, no proxy is used. - Proxy func(*http.Request) (*url.URL, error) - - // TLSClientConfig specifies the TLS configuration to use with tls.Client. - // If nil, the default configuration is used. - // If either NetDialTLS or NetDialTLSContext are set, Dial assumes the TLS handshake - // is done there and TLSClientConfig is ignored. - TLSClientConfig *tls.Config - - // HandshakeTimeout specifies the duration for the handshake to complete. - HandshakeTimeout time.Duration - - // ReadBufferSize and WriteBufferSize specify I/O buffer sizes in bytes. If a buffer - // size is zero, then a useful default size is used. The I/O buffer sizes - // do not limit the size of the messages that can be sent or received. - ReadBufferSize, WriteBufferSize int - - // WriteBufferPool is a pool of buffers for write operations. If the value - // is not set, then write buffers are allocated to the connection for the - // lifetime of the connection. - // - // A pool is most useful when the application has a modest volume of writes - // across a large number of connections. - // - // Applications should use a single pool for each unique value of - // WriteBufferSize. - WriteBufferPool BufferPool - - // Subprotocols specifies the client's requested subprotocols. - Subprotocols []string - - // EnableCompression specifies if the client should attempt to negotiate - // per message compression (RFC 7692). Setting this value to true does not - // guarantee that compression will be supported. Currently only "no context - // takeover" modes are supported. - EnableCompression bool - - // Jar specifies the cookie jar. - // If Jar is nil, cookies are not sent in requests and ignored - // in responses. - Jar http.CookieJar -} - -// Dial creates a new client connection by calling DialContext with a background context. -func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Response, error) { - return d.DialContext(context.Background(), urlStr, requestHeader) -} - -var errMalformedURL = errors.New("malformed ws or wss URL") - -func hostPortNoPort(u *url.URL) (hostPort, hostNoPort string) { - hostPort = u.Host - hostNoPort = u.Host - if i := strings.LastIndex(u.Host, ":"); i > strings.LastIndex(u.Host, "]") { - hostNoPort = hostNoPort[:i] - } else { - switch u.Scheme { - case "wss": - hostPort += ":443" - case "https": - hostPort += ":443" - default: - hostPort += ":80" - } - } - return hostPort, hostNoPort -} - -// DefaultDialer is a dialer with all fields set to the default values. -var DefaultDialer = &Dialer{ - Proxy: http.ProxyFromEnvironment, - HandshakeTimeout: 45 * time.Second, -} - -// nilDialer is dialer to use when receiver is nil. -var nilDialer = *DefaultDialer - -// DialContext creates a new client connection. Use requestHeader to specify the -// origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies (Cookie). -// Use the response.Header to get the selected subprotocol -// (Sec-WebSocket-Protocol) and cookies (Set-Cookie). -// -// The context will be used in the request and in the Dialer. -// -// If the WebSocket handshake fails, ErrBadHandshake is returned along with a -// non-nil *http.Response so that callers can handle redirects, authentication, -// etcetera. The response body may not contain the entire response and does not -// need to be closed by the application. -func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader http.Header) (*Conn, *http.Response, error) { - if d == nil { - d = &nilDialer - } - - challengeKey, err := generateChallengeKey() - if err != nil { - return nil, nil, err - } - - u, err := url.Parse(urlStr) - if err != nil { - return nil, nil, err - } - - switch u.Scheme { - case "ws": - u.Scheme = "http" - case "wss": - u.Scheme = "https" - default: - return nil, nil, errMalformedURL - } - - if u.User != nil { - // User name and password are not allowed in websocket URIs. - return nil, nil, errMalformedURL - } - - req := &http.Request{ - Method: http.MethodGet, - URL: u, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Header: make(http.Header), - Host: u.Host, - } - req = req.WithContext(ctx) - - // Set the cookies present in the cookie jar of the dialer - if d.Jar != nil { - for _, cookie := range d.Jar.Cookies(u) { - req.AddCookie(cookie) - } - } - - // Set the request headers using the capitalization for names and values in - // RFC examples. Although the capitalization shouldn't matter, there are - // servers that depend on it. The Header.Set method is not used because the - // method canonicalizes the header names. - req.Header["Upgrade"] = []string{"websocket"} - req.Header["Connection"] = []string{"Upgrade"} - req.Header["Sec-WebSocket-Key"] = []string{challengeKey} - req.Header["Sec-WebSocket-Version"] = []string{"13"} - if len(d.Subprotocols) > 0 { - req.Header["Sec-WebSocket-Protocol"] = []string{strings.Join(d.Subprotocols, ", ")} - } - for k, vs := range requestHeader { - switch { - case k == "Host": - if len(vs) > 0 { - req.Host = vs[0] - } - case k == "Upgrade" || - k == "Connection" || - k == "Sec-Websocket-Key" || - k == "Sec-Websocket-Version" || - k == "Sec-Websocket-Extensions" || - (k == "Sec-Websocket-Protocol" && len(d.Subprotocols) > 0): - return nil, nil, errors.New("websocket: duplicate header not allowed: " + k) - case k == "Sec-Websocket-Protocol": - req.Header["Sec-WebSocket-Protocol"] = vs - default: - req.Header[k] = vs - } - } - - if d.EnableCompression { - req.Header["Sec-WebSocket-Extensions"] = []string{"permessage-deflate; server_no_context_takeover; client_no_context_takeover"} - } - - if d.HandshakeTimeout != 0 { - var cancel func() - ctx, cancel = context.WithTimeout(ctx, d.HandshakeTimeout) - defer cancel() - } - - // Get network dial function. - var netDial func(network, add string) (net.Conn, error) - - switch u.Scheme { - case "http": - if d.NetDialContext != nil { - netDial = func(network, addr string) (net.Conn, error) { - return d.NetDialContext(ctx, network, addr) - } - } else if d.NetDial != nil { - netDial = d.NetDial - } - case "https": - if d.NetDialTLSContext != nil { - netDial = func(network, addr string) (net.Conn, error) { - return d.NetDialTLSContext(ctx, network, addr) - } - } else if d.NetDialContext != nil { - netDial = func(network, addr string) (net.Conn, error) { - return d.NetDialContext(ctx, network, addr) - } - } else if d.NetDial != nil { - netDial = d.NetDial - } - default: - return nil, nil, errMalformedURL - } - - if netDial == nil { - netDialer := &net.Dialer{} - netDial = func(network, addr string) (net.Conn, error) { - return netDialer.DialContext(ctx, network, addr) - } - } - - // If needed, wrap the dial function to set the connection deadline. - if deadline, ok := ctx.Deadline(); ok { - forwardDial := netDial - netDial = func(network, addr string) (net.Conn, error) { - c, err := forwardDial(network, addr) - if err != nil { - return nil, err - } - err = c.SetDeadline(deadline) - if err != nil { - c.Close() - return nil, err - } - return c, nil - } - } - - // If needed, wrap the dial function to connect through a proxy. - if d.Proxy != nil { - proxyURL, err := d.Proxy(req) - if err != nil { - return nil, nil, err - } - if proxyURL != nil { - dialer, err := proxy_FromURL(proxyURL, netDialerFunc(netDial)) - if err != nil { - return nil, nil, err - } - netDial = dialer.Dial - } - } - - hostPort, hostNoPort := hostPortNoPort(u) - trace := httptrace.ContextClientTrace(ctx) - if trace != nil && trace.GetConn != nil { - trace.GetConn(hostPort) - } - - netConn, err := netDial("tcp", hostPort) - if trace != nil && trace.GotConn != nil { - trace.GotConn(httptrace.GotConnInfo{ - Conn: netConn, - }) - } - if err != nil { - return nil, nil, err - } - - defer func() { - if netConn != nil { - netConn.Close() - } - }() - - if u.Scheme == "https" && d.NetDialTLSContext == nil { - // If NetDialTLSContext is set, assume that the TLS handshake has already been done - - cfg := cloneTLSConfig(d.TLSClientConfig) - if cfg.ServerName == "" { - cfg.ServerName = hostNoPort - } - tlsConn := tls.Client(netConn, cfg) - netConn = tlsConn - - if trace != nil && trace.TLSHandshakeStart != nil { - trace.TLSHandshakeStart() - } - err := doHandshake(ctx, tlsConn, cfg) - if trace != nil && trace.TLSHandshakeDone != nil { - trace.TLSHandshakeDone(tlsConn.ConnectionState(), err) - } - - if err != nil { - return nil, nil, err - } - } - - conn := newConn(netConn, false, d.ReadBufferSize, d.WriteBufferSize, d.WriteBufferPool, nil, nil) - - if err := req.Write(netConn); err != nil { - return nil, nil, err - } - - if trace != nil && trace.GotFirstResponseByte != nil { - if peek, err := conn.br.Peek(1); err == nil && len(peek) == 1 { - trace.GotFirstResponseByte() - } - } - - resp, err := http.ReadResponse(conn.br, req) - if err != nil { - return nil, nil, err - } - - if d.Jar != nil { - if rc := resp.Cookies(); len(rc) > 0 { - d.Jar.SetCookies(u, rc) - } - } - - if resp.StatusCode != 101 || - !tokenListContainsValue(resp.Header, "Upgrade", "websocket") || - !tokenListContainsValue(resp.Header, "Connection", "upgrade") || - resp.Header.Get("Sec-Websocket-Accept") != computeAcceptKey(challengeKey) { - // Before closing the network connection on return from this - // function, slurp up some of the response to aid application - // debugging. - buf := make([]byte, 1024) - n, _ := io.ReadFull(resp.Body, buf) - resp.Body = ioutil.NopCloser(bytes.NewReader(buf[:n])) - return nil, resp, ErrBadHandshake - } - - for _, ext := range parseExtensions(resp.Header) { - if ext[""] != "permessage-deflate" { - continue - } - _, snct := ext["server_no_context_takeover"] - _, cnct := ext["client_no_context_takeover"] - if !snct || !cnct { - return nil, resp, errInvalidCompression - } - conn.newCompressionWriter = compressNoContextTakeover - conn.newDecompressionReader = decompressNoContextTakeover - break - } - - resp.Body = ioutil.NopCloser(bytes.NewReader([]byte{})) - conn.subprotocol = resp.Header.Get("Sec-Websocket-Protocol") - - netConn.SetDeadline(time.Time{}) - netConn = nil // to avoid close in defer. - return conn, resp, nil -} - -func cloneTLSConfig(cfg *tls.Config) *tls.Config { - if cfg == nil { - return &tls.Config{} - } - return cfg.Clone() -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/compression.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/compression.go deleted file mode 100644 index 813ffb1e8433..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/compression.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "compress/flate" - "errors" - "io" - "strings" - "sync" -) - -const ( - minCompressionLevel = -2 // flate.HuffmanOnly not defined in Go < 1.6 - maxCompressionLevel = flate.BestCompression - defaultCompressionLevel = 1 -) - -var ( - flateWriterPools [maxCompressionLevel - minCompressionLevel + 1]sync.Pool - flateReaderPool = sync.Pool{New: func() interface{} { - return flate.NewReader(nil) - }} -) - -func decompressNoContextTakeover(r io.Reader) io.ReadCloser { - const tail = - // Add four bytes as specified in RFC - "\x00\x00\xff\xff" + - // Add final block to squelch unexpected EOF error from flate reader. - "\x01\x00\x00\xff\xff" - - fr, _ := flateReaderPool.Get().(io.ReadCloser) - fr.(flate.Resetter).Reset(io.MultiReader(r, strings.NewReader(tail)), nil) - return &flateReadWrapper{fr} -} - -func isValidCompressionLevel(level int) bool { - return minCompressionLevel <= level && level <= maxCompressionLevel -} - -func compressNoContextTakeover(w io.WriteCloser, level int) io.WriteCloser { - p := &flateWriterPools[level-minCompressionLevel] - tw := &truncWriter{w: w} - fw, _ := p.Get().(*flate.Writer) - if fw == nil { - fw, _ = flate.NewWriter(tw, level) - } else { - fw.Reset(tw) - } - return &flateWriteWrapper{fw: fw, tw: tw, p: p} -} - -// truncWriter is an io.Writer that writes all but the last four bytes of the -// stream to another io.Writer. -type truncWriter struct { - w io.WriteCloser - n int - p [4]byte -} - -func (w *truncWriter) Write(p []byte) (int, error) { - n := 0 - - // fill buffer first for simplicity. - if w.n < len(w.p) { - n = copy(w.p[w.n:], p) - p = p[n:] - w.n += n - if len(p) == 0 { - return n, nil - } - } - - m := len(p) - if m > len(w.p) { - m = len(w.p) - } - - if nn, err := w.w.Write(w.p[:m]); err != nil { - return n + nn, err - } - - copy(w.p[:], w.p[m:]) - copy(w.p[len(w.p)-m:], p[len(p)-m:]) - nn, err := w.w.Write(p[:len(p)-m]) - return n + nn, err -} - -type flateWriteWrapper struct { - fw *flate.Writer - tw *truncWriter - p *sync.Pool -} - -func (w *flateWriteWrapper) Write(p []byte) (int, error) { - if w.fw == nil { - return 0, errWriteClosed - } - return w.fw.Write(p) -} - -func (w *flateWriteWrapper) Close() error { - if w.fw == nil { - return errWriteClosed - } - err1 := w.fw.Flush() - w.p.Put(w.fw) - w.fw = nil - if w.tw.p != [4]byte{0, 0, 0xff, 0xff} { - return errors.New("websocket: internal error, unexpected bytes at end of flate stream") - } - err2 := w.tw.w.Close() - if err1 != nil { - return err1 - } - return err2 -} - -type flateReadWrapper struct { - fr io.ReadCloser -} - -func (r *flateReadWrapper) Read(p []byte) (int, error) { - if r.fr == nil { - return 0, io.ErrClosedPipe - } - n, err := r.fr.Read(p) - if err == io.EOF { - // Preemptively place the reader back in the pool. This helps with - // scenarios where the application does not call NextReader() soon after - // this final read. - r.Close() - } - return n, err -} - -func (r *flateReadWrapper) Close() error { - if r.fr == nil { - return io.ErrClosedPipe - } - err := r.fr.Close() - flateReaderPool.Put(r.fr) - r.fr = nil - return err -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/conn.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/conn.go deleted file mode 100644 index 331eebc85009..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/conn.go +++ /dev/null @@ -1,1230 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "encoding/binary" - "errors" - "io" - "io/ioutil" - "math/rand" - "net" - "strconv" - "strings" - "sync" - "time" - "unicode/utf8" -) - -const ( - // Frame header byte 0 bits from Section 5.2 of RFC 6455 - finalBit = 1 << 7 - rsv1Bit = 1 << 6 - rsv2Bit = 1 << 5 - rsv3Bit = 1 << 4 - - // Frame header byte 1 bits from Section 5.2 of RFC 6455 - maskBit = 1 << 7 - - maxFrameHeaderSize = 2 + 8 + 4 // Fixed header + length + mask - maxControlFramePayloadSize = 125 - - writeWait = time.Second - - defaultReadBufferSize = 4096 - defaultWriteBufferSize = 4096 - - continuationFrame = 0 - noFrame = -1 -) - -// Close codes defined in RFC 6455, section 11.7. -const ( - CloseNormalClosure = 1000 - CloseGoingAway = 1001 - CloseProtocolError = 1002 - CloseUnsupportedData = 1003 - CloseNoStatusReceived = 1005 - CloseAbnormalClosure = 1006 - CloseInvalidFramePayloadData = 1007 - ClosePolicyViolation = 1008 - CloseMessageTooBig = 1009 - CloseMandatoryExtension = 1010 - CloseInternalServerErr = 1011 - CloseServiceRestart = 1012 - CloseTryAgainLater = 1013 - CloseTLSHandshake = 1015 -) - -// The message types are defined in RFC 6455, section 11.8. -const ( - // TextMessage denotes a text data message. The text message payload is - // interpreted as UTF-8 encoded text data. - TextMessage = 1 - - // BinaryMessage denotes a binary data message. - BinaryMessage = 2 - - // CloseMessage denotes a close control message. The optional message - // payload contains a numeric code and text. Use the FormatCloseMessage - // function to format a close message payload. - CloseMessage = 8 - - // PingMessage denotes a ping control message. The optional message payload - // is UTF-8 encoded text. - PingMessage = 9 - - // PongMessage denotes a pong control message. The optional message payload - // is UTF-8 encoded text. - PongMessage = 10 -) - -// ErrCloseSent is returned when the application writes a message to the -// connection after sending a close message. -var ErrCloseSent = errors.New("websocket: close sent") - -// ErrReadLimit is returned when reading a message that is larger than the -// read limit set for the connection. -var ErrReadLimit = errors.New("websocket: read limit exceeded") - -// netError satisfies the net Error interface. -type netError struct { - msg string - temporary bool - timeout bool -} - -func (e *netError) Error() string { return e.msg } -func (e *netError) Temporary() bool { return e.temporary } -func (e *netError) Timeout() bool { return e.timeout } - -// CloseError represents a close message. -type CloseError struct { - // Code is defined in RFC 6455, section 11.7. - Code int - - // Text is the optional text payload. - Text string -} - -func (e *CloseError) Error() string { - s := []byte("websocket: close ") - s = strconv.AppendInt(s, int64(e.Code), 10) - switch e.Code { - case CloseNormalClosure: - s = append(s, " (normal)"...) - case CloseGoingAway: - s = append(s, " (going away)"...) - case CloseProtocolError: - s = append(s, " (protocol error)"...) - case CloseUnsupportedData: - s = append(s, " (unsupported data)"...) - case CloseNoStatusReceived: - s = append(s, " (no status)"...) - case CloseAbnormalClosure: - s = append(s, " (abnormal closure)"...) - case CloseInvalidFramePayloadData: - s = append(s, " (invalid payload data)"...) - case ClosePolicyViolation: - s = append(s, " (policy violation)"...) - case CloseMessageTooBig: - s = append(s, " (message too big)"...) - case CloseMandatoryExtension: - s = append(s, " (mandatory extension missing)"...) - case CloseInternalServerErr: - s = append(s, " (internal server error)"...) - case CloseTLSHandshake: - s = append(s, " (TLS handshake error)"...) - } - if e.Text != "" { - s = append(s, ": "...) - s = append(s, e.Text...) - } - return string(s) -} - -// IsCloseError returns boolean indicating whether the error is a *CloseError -// with one of the specified codes. -func IsCloseError(err error, codes ...int) bool { - if e, ok := err.(*CloseError); ok { - for _, code := range codes { - if e.Code == code { - return true - } - } - } - return false -} - -// IsUnexpectedCloseError returns boolean indicating whether the error is a -// *CloseError with a code not in the list of expected codes. -func IsUnexpectedCloseError(err error, expectedCodes ...int) bool { - if e, ok := err.(*CloseError); ok { - for _, code := range expectedCodes { - if e.Code == code { - return false - } - } - return true - } - return false -} - -var ( - errWriteTimeout = &netError{msg: "websocket: write timeout", timeout: true, temporary: true} - errUnexpectedEOF = &CloseError{Code: CloseAbnormalClosure, Text: io.ErrUnexpectedEOF.Error()} - errBadWriteOpCode = errors.New("websocket: bad write message type") - errWriteClosed = errors.New("websocket: write closed") - errInvalidControlFrame = errors.New("websocket: invalid control frame") -) - -func newMaskKey() [4]byte { - n := rand.Uint32() - return [4]byte{byte(n), byte(n >> 8), byte(n >> 16), byte(n >> 24)} -} - -func hideTempErr(err error) error { - if e, ok := err.(net.Error); ok && e.Temporary() { - err = &netError{msg: e.Error(), timeout: e.Timeout()} - } - return err -} - -func isControl(frameType int) bool { - return frameType == CloseMessage || frameType == PingMessage || frameType == PongMessage -} - -func isData(frameType int) bool { - return frameType == TextMessage || frameType == BinaryMessage -} - -var validReceivedCloseCodes = map[int]bool{ - // see http://www.iana.org/assignments/websocket/websocket.xhtml#close-code-number - - CloseNormalClosure: true, - CloseGoingAway: true, - CloseProtocolError: true, - CloseUnsupportedData: true, - CloseNoStatusReceived: false, - CloseAbnormalClosure: false, - CloseInvalidFramePayloadData: true, - ClosePolicyViolation: true, - CloseMessageTooBig: true, - CloseMandatoryExtension: true, - CloseInternalServerErr: true, - CloseServiceRestart: true, - CloseTryAgainLater: true, - CloseTLSHandshake: false, -} - -func isValidReceivedCloseCode(code int) bool { - return validReceivedCloseCodes[code] || (code >= 3000 && code <= 4999) -} - -// BufferPool represents a pool of buffers. The *sync.Pool type satisfies this -// interface. The type of the value stored in a pool is not specified. -type BufferPool interface { - // Get gets a value from the pool or returns nil if the pool is empty. - Get() interface{} - // Put adds a value to the pool. - Put(interface{}) -} - -// writePoolData is the type added to the write buffer pool. This wrapper is -// used to prevent applications from peeking at and depending on the values -// added to the pool. -type writePoolData struct{ buf []byte } - -// The Conn type represents a WebSocket connection. -type Conn struct { - conn net.Conn - isServer bool - subprotocol string - - // Write fields - mu chan struct{} // used as mutex to protect write to conn - writeBuf []byte // frame is constructed in this buffer. - writePool BufferPool - writeBufSize int - writeDeadline time.Time - writer io.WriteCloser // the current writer returned to the application - isWriting bool // for best-effort concurrent write detection - - writeErrMu sync.Mutex - writeErr error - - enableWriteCompression bool - compressionLevel int - newCompressionWriter func(io.WriteCloser, int) io.WriteCloser - - // Read fields - reader io.ReadCloser // the current reader returned to the application - readErr error - br *bufio.Reader - // bytes remaining in current frame. - // set setReadRemaining to safely update this value and prevent overflow - readRemaining int64 - readFinal bool // true the current message has more frames. - readLength int64 // Message size. - readLimit int64 // Maximum message size. - readMaskPos int - readMaskKey [4]byte - handlePong func(string) error - handlePing func(string) error - handleClose func(int, string) error - readErrCount int - messageReader *messageReader // the current low-level reader - - readDecompress bool // whether last read frame had RSV1 set - newDecompressionReader func(io.Reader) io.ReadCloser -} - -func newConn(conn net.Conn, isServer bool, readBufferSize, writeBufferSize int, writeBufferPool BufferPool, br *bufio.Reader, writeBuf []byte) *Conn { - - if br == nil { - if readBufferSize == 0 { - readBufferSize = defaultReadBufferSize - } else if readBufferSize < maxControlFramePayloadSize { - // must be large enough for control frame - readBufferSize = maxControlFramePayloadSize - } - br = bufio.NewReaderSize(conn, readBufferSize) - } - - if writeBufferSize <= 0 { - writeBufferSize = defaultWriteBufferSize - } - writeBufferSize += maxFrameHeaderSize - - if writeBuf == nil && writeBufferPool == nil { - writeBuf = make([]byte, writeBufferSize) - } - - mu := make(chan struct{}, 1) - mu <- struct{}{} - c := &Conn{ - isServer: isServer, - br: br, - conn: conn, - mu: mu, - readFinal: true, - writeBuf: writeBuf, - writePool: writeBufferPool, - writeBufSize: writeBufferSize, - enableWriteCompression: true, - compressionLevel: defaultCompressionLevel, - } - c.SetCloseHandler(nil) - c.SetPingHandler(nil) - c.SetPongHandler(nil) - return c -} - -// setReadRemaining tracks the number of bytes remaining on the connection. If n -// overflows, an ErrReadLimit is returned. -func (c *Conn) setReadRemaining(n int64) error { - if n < 0 { - return ErrReadLimit - } - - c.readRemaining = n - return nil -} - -// Subprotocol returns the negotiated protocol for the connection. -func (c *Conn) Subprotocol() string { - return c.subprotocol -} - -// Close closes the underlying network connection without sending or waiting -// for a close message. -func (c *Conn) Close() error { - return c.conn.Close() -} - -// LocalAddr returns the local network address. -func (c *Conn) LocalAddr() net.Addr { - return c.conn.LocalAddr() -} - -// RemoteAddr returns the remote network address. -func (c *Conn) RemoteAddr() net.Addr { - return c.conn.RemoteAddr() -} - -// Write methods - -func (c *Conn) writeFatal(err error) error { - err = hideTempErr(err) - c.writeErrMu.Lock() - if c.writeErr == nil { - c.writeErr = err - } - c.writeErrMu.Unlock() - return err -} - -func (c *Conn) read(n int) ([]byte, error) { - p, err := c.br.Peek(n) - if err == io.EOF { - err = errUnexpectedEOF - } - c.br.Discard(len(p)) - return p, err -} - -func (c *Conn) write(frameType int, deadline time.Time, buf0, buf1 []byte) error { - <-c.mu - defer func() { c.mu <- struct{}{} }() - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - if err != nil { - return err - } - - c.conn.SetWriteDeadline(deadline) - if len(buf1) == 0 { - _, err = c.conn.Write(buf0) - } else { - err = c.writeBufs(buf0, buf1) - } - if err != nil { - return c.writeFatal(err) - } - if frameType == CloseMessage { - c.writeFatal(ErrCloseSent) - } - return nil -} - -func (c *Conn) writeBufs(bufs ...[]byte) error { - b := net.Buffers(bufs) - _, err := b.WriteTo(c.conn) - return err -} - -// WriteControl writes a control message with the given deadline. The allowed -// message types are CloseMessage, PingMessage and PongMessage. -func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) error { - if !isControl(messageType) { - return errBadWriteOpCode - } - if len(data) > maxControlFramePayloadSize { - return errInvalidControlFrame - } - - b0 := byte(messageType) | finalBit - b1 := byte(len(data)) - if !c.isServer { - b1 |= maskBit - } - - buf := make([]byte, 0, maxFrameHeaderSize+maxControlFramePayloadSize) - buf = append(buf, b0, b1) - - if c.isServer { - buf = append(buf, data...) - } else { - key := newMaskKey() - buf = append(buf, key[:]...) - buf = append(buf, data...) - maskBytes(key, 0, buf[6:]) - } - - d := 1000 * time.Hour - if !deadline.IsZero() { - d = deadline.Sub(time.Now()) - if d < 0 { - return errWriteTimeout - } - } - - timer := time.NewTimer(d) - select { - case <-c.mu: - timer.Stop() - case <-timer.C: - return errWriteTimeout - } - defer func() { c.mu <- struct{}{} }() - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - if err != nil { - return err - } - - c.conn.SetWriteDeadline(deadline) - _, err = c.conn.Write(buf) - if err != nil { - return c.writeFatal(err) - } - if messageType == CloseMessage { - c.writeFatal(ErrCloseSent) - } - return err -} - -// beginMessage prepares a connection and message writer for a new message. -func (c *Conn) beginMessage(mw *messageWriter, messageType int) error { - // Close previous writer if not already closed by the application. It's - // probably better to return an error in this situation, but we cannot - // change this without breaking existing applications. - if c.writer != nil { - c.writer.Close() - c.writer = nil - } - - if !isControl(messageType) && !isData(messageType) { - return errBadWriteOpCode - } - - c.writeErrMu.Lock() - err := c.writeErr - c.writeErrMu.Unlock() - if err != nil { - return err - } - - mw.c = c - mw.frameType = messageType - mw.pos = maxFrameHeaderSize - - if c.writeBuf == nil { - wpd, ok := c.writePool.Get().(writePoolData) - if ok { - c.writeBuf = wpd.buf - } else { - c.writeBuf = make([]byte, c.writeBufSize) - } - } - return nil -} - -// NextWriter returns a writer for the next message to send. The writer's Close -// method flushes the complete message to the network. -// -// There can be at most one open writer on a connection. NextWriter closes the -// previous writer if the application has not already done so. -// -// All message types (TextMessage, BinaryMessage, CloseMessage, PingMessage and -// PongMessage) are supported. -func (c *Conn) NextWriter(messageType int) (io.WriteCloser, error) { - var mw messageWriter - if err := c.beginMessage(&mw, messageType); err != nil { - return nil, err - } - c.writer = &mw - if c.newCompressionWriter != nil && c.enableWriteCompression && isData(messageType) { - w := c.newCompressionWriter(c.writer, c.compressionLevel) - mw.compress = true - c.writer = w - } - return c.writer, nil -} - -type messageWriter struct { - c *Conn - compress bool // whether next call to flushFrame should set RSV1 - pos int // end of data in writeBuf. - frameType int // type of the current frame. - err error -} - -func (w *messageWriter) endMessage(err error) error { - if w.err != nil { - return err - } - c := w.c - w.err = err - c.writer = nil - if c.writePool != nil { - c.writePool.Put(writePoolData{buf: c.writeBuf}) - c.writeBuf = nil - } - return err -} - -// flushFrame writes buffered data and extra as a frame to the network. The -// final argument indicates that this is the last frame in the message. -func (w *messageWriter) flushFrame(final bool, extra []byte) error { - c := w.c - length := w.pos - maxFrameHeaderSize + len(extra) - - // Check for invalid control frames. - if isControl(w.frameType) && - (!final || length > maxControlFramePayloadSize) { - return w.endMessage(errInvalidControlFrame) - } - - b0 := byte(w.frameType) - if final { - b0 |= finalBit - } - if w.compress { - b0 |= rsv1Bit - } - w.compress = false - - b1 := byte(0) - if !c.isServer { - b1 |= maskBit - } - - // Assume that the frame starts at beginning of c.writeBuf. - framePos := 0 - if c.isServer { - // Adjust up if mask not included in the header. - framePos = 4 - } - - switch { - case length >= 65536: - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | 127 - binary.BigEndian.PutUint64(c.writeBuf[framePos+2:], uint64(length)) - case length > 125: - framePos += 6 - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | 126 - binary.BigEndian.PutUint16(c.writeBuf[framePos+2:], uint16(length)) - default: - framePos += 8 - c.writeBuf[framePos] = b0 - c.writeBuf[framePos+1] = b1 | byte(length) - } - - if !c.isServer { - key := newMaskKey() - copy(c.writeBuf[maxFrameHeaderSize-4:], key[:]) - maskBytes(key, 0, c.writeBuf[maxFrameHeaderSize:w.pos]) - if len(extra) > 0 { - return w.endMessage(c.writeFatal(errors.New("websocket: internal error, extra used in client mode"))) - } - } - - // Write the buffers to the connection with best-effort detection of - // concurrent writes. See the concurrency section in the package - // documentation for more info. - - if c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = true - - err := c.write(w.frameType, c.writeDeadline, c.writeBuf[framePos:w.pos], extra) - - if !c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = false - - if err != nil { - return w.endMessage(err) - } - - if final { - w.endMessage(errWriteClosed) - return nil - } - - // Setup for next frame. - w.pos = maxFrameHeaderSize - w.frameType = continuationFrame - return nil -} - -func (w *messageWriter) ncopy(max int) (int, error) { - n := len(w.c.writeBuf) - w.pos - if n <= 0 { - if err := w.flushFrame(false, nil); err != nil { - return 0, err - } - n = len(w.c.writeBuf) - w.pos - } - if n > max { - n = max - } - return n, nil -} - -func (w *messageWriter) Write(p []byte) (int, error) { - if w.err != nil { - return 0, w.err - } - - if len(p) > 2*len(w.c.writeBuf) && w.c.isServer { - // Don't buffer large messages. - err := w.flushFrame(false, p) - if err != nil { - return 0, err - } - return len(p), nil - } - - nn := len(p) - for len(p) > 0 { - n, err := w.ncopy(len(p)) - if err != nil { - return 0, err - } - copy(w.c.writeBuf[w.pos:], p[:n]) - w.pos += n - p = p[n:] - } - return nn, nil -} - -func (w *messageWriter) WriteString(p string) (int, error) { - if w.err != nil { - return 0, w.err - } - - nn := len(p) - for len(p) > 0 { - n, err := w.ncopy(len(p)) - if err != nil { - return 0, err - } - copy(w.c.writeBuf[w.pos:], p[:n]) - w.pos += n - p = p[n:] - } - return nn, nil -} - -func (w *messageWriter) ReadFrom(r io.Reader) (nn int64, err error) { - if w.err != nil { - return 0, w.err - } - for { - if w.pos == len(w.c.writeBuf) { - err = w.flushFrame(false, nil) - if err != nil { - break - } - } - var n int - n, err = r.Read(w.c.writeBuf[w.pos:]) - w.pos += n - nn += int64(n) - if err != nil { - if err == io.EOF { - err = nil - } - break - } - } - return nn, err -} - -func (w *messageWriter) Close() error { - if w.err != nil { - return w.err - } - return w.flushFrame(true, nil) -} - -// WritePreparedMessage writes prepared message into connection. -func (c *Conn) WritePreparedMessage(pm *PreparedMessage) error { - frameType, frameData, err := pm.frame(prepareKey{ - isServer: c.isServer, - compress: c.newCompressionWriter != nil && c.enableWriteCompression && isData(pm.messageType), - compressionLevel: c.compressionLevel, - }) - if err != nil { - return err - } - if c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = true - err = c.write(frameType, c.writeDeadline, frameData, nil) - if !c.isWriting { - panic("concurrent write to websocket connection") - } - c.isWriting = false - return err -} - -// WriteMessage is a helper method for getting a writer using NextWriter, -// writing the message and closing the writer. -func (c *Conn) WriteMessage(messageType int, data []byte) error { - - if c.isServer && (c.newCompressionWriter == nil || !c.enableWriteCompression) { - // Fast path with no allocations and single frame. - - var mw messageWriter - if err := c.beginMessage(&mw, messageType); err != nil { - return err - } - n := copy(c.writeBuf[mw.pos:], data) - mw.pos += n - data = data[n:] - return mw.flushFrame(true, data) - } - - w, err := c.NextWriter(messageType) - if err != nil { - return err - } - if _, err = w.Write(data); err != nil { - return err - } - return w.Close() -} - -// SetWriteDeadline sets the write deadline on the underlying network -// connection. After a write has timed out, the websocket state is corrupt and -// all future writes will return an error. A zero value for t means writes will -// not time out. -func (c *Conn) SetWriteDeadline(t time.Time) error { - c.writeDeadline = t - return nil -} - -// Read methods - -func (c *Conn) advanceFrame() (int, error) { - // 1. Skip remainder of previous frame. - - if c.readRemaining > 0 { - if _, err := io.CopyN(ioutil.Discard, c.br, c.readRemaining); err != nil { - return noFrame, err - } - } - - // 2. Read and parse first two bytes of frame header. - // To aid debugging, collect and report all errors in the first two bytes - // of the header. - - var errors []string - - p, err := c.read(2) - if err != nil { - return noFrame, err - } - - frameType := int(p[0] & 0xf) - final := p[0]&finalBit != 0 - rsv1 := p[0]&rsv1Bit != 0 - rsv2 := p[0]&rsv2Bit != 0 - rsv3 := p[0]&rsv3Bit != 0 - mask := p[1]&maskBit != 0 - c.setReadRemaining(int64(p[1] & 0x7f)) - - c.readDecompress = false - if rsv1 { - if c.newDecompressionReader != nil { - c.readDecompress = true - } else { - errors = append(errors, "RSV1 set") - } - } - - if rsv2 { - errors = append(errors, "RSV2 set") - } - - if rsv3 { - errors = append(errors, "RSV3 set") - } - - switch frameType { - case CloseMessage, PingMessage, PongMessage: - if c.readRemaining > maxControlFramePayloadSize { - errors = append(errors, "len > 125 for control") - } - if !final { - errors = append(errors, "FIN not set on control") - } - case TextMessage, BinaryMessage: - if !c.readFinal { - errors = append(errors, "data before FIN") - } - c.readFinal = final - case continuationFrame: - if c.readFinal { - errors = append(errors, "continuation after FIN") - } - c.readFinal = final - default: - errors = append(errors, "bad opcode "+strconv.Itoa(frameType)) - } - - if mask != c.isServer { - errors = append(errors, "bad MASK") - } - - if len(errors) > 0 { - return noFrame, c.handleProtocolError(strings.Join(errors, ", ")) - } - - // 3. Read and parse frame length as per - // https://tools.ietf.org/html/rfc6455#section-5.2 - // - // The length of the "Payload data", in bytes: if 0-125, that is the payload - // length. - // - If 126, the following 2 bytes interpreted as a 16-bit unsigned - // integer are the payload length. - // - If 127, the following 8 bytes interpreted as - // a 64-bit unsigned integer (the most significant bit MUST be 0) are the - // payload length. Multibyte length quantities are expressed in network byte - // order. - - switch c.readRemaining { - case 126: - p, err := c.read(2) - if err != nil { - return noFrame, err - } - - if err := c.setReadRemaining(int64(binary.BigEndian.Uint16(p))); err != nil { - return noFrame, err - } - case 127: - p, err := c.read(8) - if err != nil { - return noFrame, err - } - - if err := c.setReadRemaining(int64(binary.BigEndian.Uint64(p))); err != nil { - return noFrame, err - } - } - - // 4. Handle frame masking. - - if mask { - c.readMaskPos = 0 - p, err := c.read(len(c.readMaskKey)) - if err != nil { - return noFrame, err - } - copy(c.readMaskKey[:], p) - } - - // 5. For text and binary messages, enforce read limit and return. - - if frameType == continuationFrame || frameType == TextMessage || frameType == BinaryMessage { - - c.readLength += c.readRemaining - // Don't allow readLength to overflow in the presence of a large readRemaining - // counter. - if c.readLength < 0 { - return noFrame, ErrReadLimit - } - - if c.readLimit > 0 && c.readLength > c.readLimit { - c.WriteControl(CloseMessage, FormatCloseMessage(CloseMessageTooBig, ""), time.Now().Add(writeWait)) - return noFrame, ErrReadLimit - } - - return frameType, nil - } - - // 6. Read control frame payload. - - var payload []byte - if c.readRemaining > 0 { - payload, err = c.read(int(c.readRemaining)) - c.setReadRemaining(0) - if err != nil { - return noFrame, err - } - if c.isServer { - maskBytes(c.readMaskKey, 0, payload) - } - } - - // 7. Process control frame payload. - - switch frameType { - case PongMessage: - if err := c.handlePong(string(payload)); err != nil { - return noFrame, err - } - case PingMessage: - if err := c.handlePing(string(payload)); err != nil { - return noFrame, err - } - case CloseMessage: - closeCode := CloseNoStatusReceived - closeText := "" - if len(payload) >= 2 { - closeCode = int(binary.BigEndian.Uint16(payload)) - if !isValidReceivedCloseCode(closeCode) { - return noFrame, c.handleProtocolError("bad close code " + strconv.Itoa(closeCode)) - } - closeText = string(payload[2:]) - if !utf8.ValidString(closeText) { - return noFrame, c.handleProtocolError("invalid utf8 payload in close frame") - } - } - if err := c.handleClose(closeCode, closeText); err != nil { - return noFrame, err - } - return noFrame, &CloseError{Code: closeCode, Text: closeText} - } - - return frameType, nil -} - -func (c *Conn) handleProtocolError(message string) error { - data := FormatCloseMessage(CloseProtocolError, message) - if len(data) > maxControlFramePayloadSize { - data = data[:maxControlFramePayloadSize] - } - c.WriteControl(CloseMessage, data, time.Now().Add(writeWait)) - return errors.New("websocket: " + message) -} - -// NextReader returns the next data message received from the peer. The -// returned messageType is either TextMessage or BinaryMessage. -// -// There can be at most one open reader on a connection. NextReader discards -// the previous message if the application has not already consumed it. -// -// Applications must break out of the application's read loop when this method -// returns a non-nil error value. Errors returned from this method are -// permanent. Once this method returns a non-nil error, all subsequent calls to -// this method return the same error. -func (c *Conn) NextReader() (messageType int, r io.Reader, err error) { - // Close previous reader, only relevant for decompression. - if c.reader != nil { - c.reader.Close() - c.reader = nil - } - - c.messageReader = nil - c.readLength = 0 - - for c.readErr == nil { - frameType, err := c.advanceFrame() - if err != nil { - c.readErr = hideTempErr(err) - break - } - - if frameType == TextMessage || frameType == BinaryMessage { - c.messageReader = &messageReader{c} - c.reader = c.messageReader - if c.readDecompress { - c.reader = c.newDecompressionReader(c.reader) - } - return frameType, c.reader, nil - } - } - - // Applications that do handle the error returned from this method spin in - // tight loop on connection failure. To help application developers detect - // this error, panic on repeated reads to the failed connection. - c.readErrCount++ - if c.readErrCount >= 1000 { - panic("repeated read on failed websocket connection") - } - - return noFrame, nil, c.readErr -} - -type messageReader struct{ c *Conn } - -func (r *messageReader) Read(b []byte) (int, error) { - c := r.c - if c.messageReader != r { - return 0, io.EOF - } - - for c.readErr == nil { - - if c.readRemaining > 0 { - if int64(len(b)) > c.readRemaining { - b = b[:c.readRemaining] - } - n, err := c.br.Read(b) - c.readErr = hideTempErr(err) - if c.isServer { - c.readMaskPos = maskBytes(c.readMaskKey, c.readMaskPos, b[:n]) - } - rem := c.readRemaining - rem -= int64(n) - c.setReadRemaining(rem) - if c.readRemaining > 0 && c.readErr == io.EOF { - c.readErr = errUnexpectedEOF - } - return n, c.readErr - } - - if c.readFinal { - c.messageReader = nil - return 0, io.EOF - } - - frameType, err := c.advanceFrame() - switch { - case err != nil: - c.readErr = hideTempErr(err) - case frameType == TextMessage || frameType == BinaryMessage: - c.readErr = errors.New("websocket: internal error, unexpected text or binary in Reader") - } - } - - err := c.readErr - if err == io.EOF && c.messageReader == r { - err = errUnexpectedEOF - } - return 0, err -} - -func (r *messageReader) Close() error { - return nil -} - -// ReadMessage is a helper method for getting a reader using NextReader and -// reading from that reader to a buffer. -func (c *Conn) ReadMessage() (messageType int, p []byte, err error) { - var r io.Reader - messageType, r, err = c.NextReader() - if err != nil { - return messageType, nil, err - } - p, err = ioutil.ReadAll(r) - return messageType, p, err -} - -// SetReadDeadline sets the read deadline on the underlying network connection. -// After a read has timed out, the websocket connection state is corrupt and -// all future reads will return an error. A zero value for t means reads will -// not time out. -func (c *Conn) SetReadDeadline(t time.Time) error { - return c.conn.SetReadDeadline(t) -} - -// SetReadLimit sets the maximum size in bytes for a message read from the peer. If a -// message exceeds the limit, the connection sends a close message to the peer -// and returns ErrReadLimit to the application. -func (c *Conn) SetReadLimit(limit int64) { - c.readLimit = limit -} - -// CloseHandler returns the current close handler -func (c *Conn) CloseHandler() func(code int, text string) error { - return c.handleClose -} - -// SetCloseHandler sets the handler for close messages received from the peer. -// The code argument to h is the received close code or CloseNoStatusReceived -// if the close message is empty. The default close handler sends a close -// message back to the peer. -// -// The handler function is called from the NextReader, ReadMessage and message -// reader Read methods. The application must read the connection to process -// close messages as described in the section on Control Messages above. -// -// The connection read methods return a CloseError when a close message is -// received. Most applications should handle close messages as part of their -// normal error handling. Applications should only set a close handler when the -// application must perform some action before sending a close message back to -// the peer. -func (c *Conn) SetCloseHandler(h func(code int, text string) error) { - if h == nil { - h = func(code int, text string) error { - message := FormatCloseMessage(code, "") - c.WriteControl(CloseMessage, message, time.Now().Add(writeWait)) - return nil - } - } - c.handleClose = h -} - -// PingHandler returns the current ping handler -func (c *Conn) PingHandler() func(appData string) error { - return c.handlePing -} - -// SetPingHandler sets the handler for ping messages received from the peer. -// The appData argument to h is the PING message application data. The default -// ping handler sends a pong to the peer. -// -// The handler function is called from the NextReader, ReadMessage and message -// reader Read methods. The application must read the connection to process -// ping messages as described in the section on Control Messages above. -func (c *Conn) SetPingHandler(h func(appData string) error) { - if h == nil { - h = func(message string) error { - err := c.WriteControl(PongMessage, []byte(message), time.Now().Add(writeWait)) - if err == ErrCloseSent { - return nil - } else if e, ok := err.(net.Error); ok && e.Temporary() { - return nil - } - return err - } - } - c.handlePing = h -} - -// PongHandler returns the current pong handler -func (c *Conn) PongHandler() func(appData string) error { - return c.handlePong -} - -// SetPongHandler sets the handler for pong messages received from the peer. -// The appData argument to h is the PONG message application data. The default -// pong handler does nothing. -// -// The handler function is called from the NextReader, ReadMessage and message -// reader Read methods. The application must read the connection to process -// pong messages as described in the section on Control Messages above. -func (c *Conn) SetPongHandler(h func(appData string) error) { - if h == nil { - h = func(string) error { return nil } - } - c.handlePong = h -} - -// UnderlyingConn returns the internal net.Conn. This can be used to further -// modifications to connection specific flags. -func (c *Conn) UnderlyingConn() net.Conn { - return c.conn -} - -// EnableWriteCompression enables and disables write compression of -// subsequent text and binary messages. This function is a noop if -// compression was not negotiated with the peer. -func (c *Conn) EnableWriteCompression(enable bool) { - c.enableWriteCompression = enable -} - -// SetCompressionLevel sets the flate compression level for subsequent text and -// binary messages. This function is a noop if compression was not negotiated -// with the peer. See the compress/flate package for a description of -// compression levels. -func (c *Conn) SetCompressionLevel(level int) error { - if !isValidCompressionLevel(level) { - return errors.New("websocket: invalid compression level") - } - c.compressionLevel = level - return nil -} - -// FormatCloseMessage formats closeCode and text as a WebSocket close message. -// An empty message is returned for code CloseNoStatusReceived. -func FormatCloseMessage(closeCode int, text string) []byte { - if closeCode == CloseNoStatusReceived { - // Return empty message because it's illegal to send - // CloseNoStatusReceived. Return non-nil value in case application - // checks for nil. - return []byte{} - } - buf := make([]byte, 2+len(text)) - binary.BigEndian.PutUint16(buf, uint16(closeCode)) - copy(buf[2:], text) - return buf -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/doc.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/doc.go deleted file mode 100644 index 8db0cef95a29..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/doc.go +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package websocket implements the WebSocket protocol defined in RFC 6455. -// -// Overview -// -// The Conn type represents a WebSocket connection. A server application calls -// the Upgrader.Upgrade method from an HTTP request handler to get a *Conn: -// -// var upgrader = websocket.Upgrader{ -// ReadBufferSize: 1024, -// WriteBufferSize: 1024, -// } -// -// func handler(w http.ResponseWriter, r *http.Request) { -// conn, err := upgrader.Upgrade(w, r, nil) -// if err != nil { -// log.Println(err) -// return -// } -// ... Use conn to send and receive messages. -// } -// -// Call the connection's WriteMessage and ReadMessage methods to send and -// receive messages as a slice of bytes. This snippet of code shows how to echo -// messages using these methods: -// -// for { -// messageType, p, err := conn.ReadMessage() -// if err != nil { -// log.Println(err) -// return -// } -// if err := conn.WriteMessage(messageType, p); err != nil { -// log.Println(err) -// return -// } -// } -// -// In above snippet of code, p is a []byte and messageType is an int with value -// websocket.BinaryMessage or websocket.TextMessage. -// -// An application can also send and receive messages using the io.WriteCloser -// and io.Reader interfaces. To send a message, call the connection NextWriter -// method to get an io.WriteCloser, write the message to the writer and close -// the writer when done. To receive a message, call the connection NextReader -// method to get an io.Reader and read until io.EOF is returned. This snippet -// shows how to echo messages using the NextWriter and NextReader methods: -// -// for { -// messageType, r, err := conn.NextReader() -// if err != nil { -// return -// } -// w, err := conn.NextWriter(messageType) -// if err != nil { -// return err -// } -// if _, err := io.Copy(w, r); err != nil { -// return err -// } -// if err := w.Close(); err != nil { -// return err -// } -// } -// -// Data Messages -// -// The WebSocket protocol distinguishes between text and binary data messages. -// Text messages are interpreted as UTF-8 encoded text. The interpretation of -// binary messages is left to the application. -// -// This package uses the TextMessage and BinaryMessage integer constants to -// identify the two data message types. The ReadMessage and NextReader methods -// return the type of the received message. The messageType argument to the -// WriteMessage and NextWriter methods specifies the type of a sent message. -// -// It is the application's responsibility to ensure that text messages are -// valid UTF-8 encoded text. -// -// Control Messages -// -// The WebSocket protocol defines three types of control messages: close, ping -// and pong. Call the connection WriteControl, WriteMessage or NextWriter -// methods to send a control message to the peer. -// -// Connections handle received close messages by calling the handler function -// set with the SetCloseHandler method and by returning a *CloseError from the -// NextReader, ReadMessage or the message Read method. The default close -// handler sends a close message to the peer. -// -// Connections handle received ping messages by calling the handler function -// set with the SetPingHandler method. The default ping handler sends a pong -// message to the peer. -// -// Connections handle received pong messages by calling the handler function -// set with the SetPongHandler method. The default pong handler does nothing. -// If an application sends ping messages, then the application should set a -// pong handler to receive the corresponding pong. -// -// The control message handler functions are called from the NextReader, -// ReadMessage and message reader Read methods. The default close and ping -// handlers can block these methods for a short time when the handler writes to -// the connection. -// -// The application must read the connection to process close, ping and pong -// messages sent from the peer. If the application is not otherwise interested -// in messages from the peer, then the application should start a goroutine to -// read and discard messages from the peer. A simple example is: -// -// func readLoop(c *websocket.Conn) { -// for { -// if _, _, err := c.NextReader(); err != nil { -// c.Close() -// break -// } -// } -// } -// -// Concurrency -// -// Connections support one concurrent reader and one concurrent writer. -// -// Applications are responsible for ensuring that no more than one goroutine -// calls the write methods (NextWriter, SetWriteDeadline, WriteMessage, -// WriteJSON, EnableWriteCompression, SetCompressionLevel) concurrently and -// that no more than one goroutine calls the read methods (NextReader, -// SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler, SetPingHandler) -// concurrently. -// -// The Close and WriteControl methods can be called concurrently with all other -// methods. -// -// Origin Considerations -// -// Web browsers allow Javascript applications to open a WebSocket connection to -// any host. It's up to the server to enforce an origin policy using the Origin -// request header sent by the browser. -// -// The Upgrader calls the function specified in the CheckOrigin field to check -// the origin. If the CheckOrigin function returns false, then the Upgrade -// method fails the WebSocket handshake with HTTP status 403. -// -// If the CheckOrigin field is nil, then the Upgrader uses a safe default: fail -// the handshake if the Origin request header is present and the Origin host is -// not equal to the Host request header. -// -// The deprecated package-level Upgrade function does not perform origin -// checking. The application is responsible for checking the Origin header -// before calling the Upgrade function. -// -// Buffers -// -// Connections buffer network input and output to reduce the number -// of system calls when reading or writing messages. -// -// Write buffers are also used for constructing WebSocket frames. See RFC 6455, -// Section 5 for a discussion of message framing. A WebSocket frame header is -// written to the network each time a write buffer is flushed to the network. -// Decreasing the size of the write buffer can increase the amount of framing -// overhead on the connection. -// -// The buffer sizes in bytes are specified by the ReadBufferSize and -// WriteBufferSize fields in the Dialer and Upgrader. The Dialer uses a default -// size of 4096 when a buffer size field is set to zero. The Upgrader reuses -// buffers created by the HTTP server when a buffer size field is set to zero. -// The HTTP server buffers have a size of 4096 at the time of this writing. -// -// The buffer sizes do not limit the size of a message that can be read or -// written by a connection. -// -// Buffers are held for the lifetime of the connection by default. If the -// Dialer or Upgrader WriteBufferPool field is set, then a connection holds the -// write buffer only when writing a message. -// -// Applications should tune the buffer sizes to balance memory use and -// performance. Increasing the buffer size uses more memory, but can reduce the -// number of system calls to read or write the network. In the case of writing, -// increasing the buffer size can reduce the number of frame headers written to -// the network. -// -// Some guidelines for setting buffer parameters are: -// -// Limit the buffer sizes to the maximum expected message size. Buffers larger -// than the largest message do not provide any benefit. -// -// Depending on the distribution of message sizes, setting the buffer size to -// a value less than the maximum expected message size can greatly reduce memory -// use with a small impact on performance. Here's an example: If 99% of the -// messages are smaller than 256 bytes and the maximum message size is 512 -// bytes, then a buffer size of 256 bytes will result in 1.01 more system calls -// than a buffer size of 512 bytes. The memory savings is 50%. -// -// A write buffer pool is useful when the application has a modest number -// writes over a large number of connections. when buffers are pooled, a larger -// buffer size has a reduced impact on total memory use and has the benefit of -// reducing system calls and frame overhead. -// -// Compression EXPERIMENTAL -// -// Per message compression extensions (RFC 7692) are experimentally supported -// by this package in a limited capacity. Setting the EnableCompression option -// to true in Dialer or Upgrader will attempt to negotiate per message deflate -// support. -// -// var upgrader = websocket.Upgrader{ -// EnableCompression: true, -// } -// -// If compression was successfully negotiated with the connection's peer, any -// message received in compressed form will be automatically decompressed. -// All Read methods will return uncompressed bytes. -// -// Per message compression of messages written to a connection can be enabled -// or disabled by calling the corresponding Conn method: -// -// conn.EnableWriteCompression(false) -// -// Currently this package does not support compression with "context takeover". -// This means that messages must be compressed and decompressed in isolation, -// without retaining sliding window or dictionary state across messages. For -// more details refer to RFC 7692. -// -// Use of compression is experimental and may result in decreased performance. -package websocket diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/join.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/join.go deleted file mode 100644 index c64f8c82901a..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/join.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2019 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "io" - "strings" -) - -// JoinMessages concatenates received messages to create a single io.Reader. -// The string term is appended to each message. The returned reader does not -// support concurrent calls to the Read method. -func JoinMessages(c *Conn, term string) io.Reader { - return &joinReader{c: c, term: term} -} - -type joinReader struct { - c *Conn - term string - r io.Reader -} - -func (r *joinReader) Read(p []byte) (int, error) { - if r.r == nil { - var err error - _, r.r, err = r.c.NextReader() - if err != nil { - return 0, err - } - if r.term != "" { - r.r = io.MultiReader(r.r, strings.NewReader(r.term)) - } - } - n, err := r.r.Read(p) - if err == io.EOF { - err = nil - r.r = nil - } - return n, err -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/json.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/json.go deleted file mode 100644 index dc2c1f6415ff..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/json.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "encoding/json" - "io" -) - -// WriteJSON writes the JSON encoding of v as a message. -// -// Deprecated: Use c.WriteJSON instead. -func WriteJSON(c *Conn, v interface{}) error { - return c.WriteJSON(v) -} - -// WriteJSON writes the JSON encoding of v as a message. -// -// See the documentation for encoding/json Marshal for details about the -// conversion of Go values to JSON. -func (c *Conn) WriteJSON(v interface{}) error { - w, err := c.NextWriter(TextMessage) - if err != nil { - return err - } - err1 := json.NewEncoder(w).Encode(v) - err2 := w.Close() - if err1 != nil { - return err1 - } - return err2 -} - -// ReadJSON reads the next JSON-encoded message from the connection and stores -// it in the value pointed to by v. -// -// Deprecated: Use c.ReadJSON instead. -func ReadJSON(c *Conn, v interface{}) error { - return c.ReadJSON(v) -} - -// ReadJSON reads the next JSON-encoded message from the connection and stores -// it in the value pointed to by v. -// -// See the documentation for the encoding/json Unmarshal function for details -// about the conversion of JSON to a Go value. -func (c *Conn) ReadJSON(v interface{}) error { - _, r, err := c.NextReader() - if err != nil { - return err - } - err = json.NewDecoder(r).Decode(v) - if err == io.EOF { - // One value is expected in the message. - err = io.ErrUnexpectedEOF - } - return err -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/mask.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/mask.go deleted file mode 100644 index d0742bf2a551..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/mask.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of -// this source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -//go:build !appengine -// +build !appengine - -package websocket - -import "unsafe" - -const wordSize = int(unsafe.Sizeof(uintptr(0))) - -func maskBytes(key [4]byte, pos int, b []byte) int { - // Mask one byte at a time for small buffers. - if len(b) < 2*wordSize { - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - return pos & 3 - } - - // Mask one byte at a time to word boundary. - if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 { - n = wordSize - n - for i := range b[:n] { - b[i] ^= key[pos&3] - pos++ - } - b = b[n:] - } - - // Create aligned word size key. - var k [wordSize]byte - for i := range k { - k[i] = key[(pos+i)&3] - } - kw := *(*uintptr)(unsafe.Pointer(&k)) - - // Mask one word at a time. - n := (len(b) / wordSize) * wordSize - for i := 0; i < n; i += wordSize { - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw - } - - // Mask one byte at a time for remaining bytes. - b = b[n:] - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - - return pos & 3 -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/mask_safe.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/mask_safe.go deleted file mode 100644 index 36250ca7c47e..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/mask_safe.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of -// this source code is governed by a BSD-style license that can be found in the -// LICENSE file. - -//go:build appengine -// +build appengine - -package websocket - -func maskBytes(key [4]byte, pos int, b []byte) int { - for i := range b { - b[i] ^= key[pos&3] - pos++ - } - return pos & 3 -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/prepared.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/prepared.go deleted file mode 100644 index c854225e9676..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/prepared.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bytes" - "net" - "sync" - "time" -) - -// PreparedMessage caches on the wire representations of a message payload. -// Use PreparedMessage to efficiently send a message payload to multiple -// connections. PreparedMessage is especially useful when compression is used -// because the CPU and memory expensive compression operation can be executed -// once for a given set of compression options. -type PreparedMessage struct { - messageType int - data []byte - mu sync.Mutex - frames map[prepareKey]*preparedFrame -} - -// prepareKey defines a unique set of options to cache prepared frames in PreparedMessage. -type prepareKey struct { - isServer bool - compress bool - compressionLevel int -} - -// preparedFrame contains data in wire representation. -type preparedFrame struct { - once sync.Once - data []byte -} - -// NewPreparedMessage returns an initialized PreparedMessage. You can then send -// it to connection using WritePreparedMessage method. Valid wire -// representation will be calculated lazily only once for a set of current -// connection options. -func NewPreparedMessage(messageType int, data []byte) (*PreparedMessage, error) { - pm := &PreparedMessage{ - messageType: messageType, - frames: make(map[prepareKey]*preparedFrame), - data: data, - } - - // Prepare a plain server frame. - _, frameData, err := pm.frame(prepareKey{isServer: true, compress: false}) - if err != nil { - return nil, err - } - - // To protect against caller modifying the data argument, remember the data - // copied to the plain server frame. - pm.data = frameData[len(frameData)-len(data):] - return pm, nil -} - -func (pm *PreparedMessage) frame(key prepareKey) (int, []byte, error) { - pm.mu.Lock() - frame, ok := pm.frames[key] - if !ok { - frame = &preparedFrame{} - pm.frames[key] = frame - } - pm.mu.Unlock() - - var err error - frame.once.Do(func() { - // Prepare a frame using a 'fake' connection. - // TODO: Refactor code in conn.go to allow more direct construction of - // the frame. - mu := make(chan struct{}, 1) - mu <- struct{}{} - var nc prepareConn - c := &Conn{ - conn: &nc, - mu: mu, - isServer: key.isServer, - compressionLevel: key.compressionLevel, - enableWriteCompression: true, - writeBuf: make([]byte, defaultWriteBufferSize+maxFrameHeaderSize), - } - if key.compress { - c.newCompressionWriter = compressNoContextTakeover - } - err = c.WriteMessage(pm.messageType, pm.data) - frame.data = nc.buf.Bytes() - }) - return pm.messageType, frame.data, err -} - -type prepareConn struct { - buf bytes.Buffer - net.Conn -} - -func (pc *prepareConn) Write(p []byte) (int, error) { return pc.buf.Write(p) } -func (pc *prepareConn) SetWriteDeadline(t time.Time) error { return nil } diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/proxy.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/proxy.go deleted file mode 100644 index e0f466b72fbb..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/proxy.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2017 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "encoding/base64" - "errors" - "net" - "net/http" - "net/url" - "strings" -) - -type netDialerFunc func(network, addr string) (net.Conn, error) - -func (fn netDialerFunc) Dial(network, addr string) (net.Conn, error) { - return fn(network, addr) -} - -func init() { - proxy_RegisterDialerType("http", func(proxyURL *url.URL, forwardDialer proxy_Dialer) (proxy_Dialer, error) { - return &httpProxyDialer{proxyURL: proxyURL, forwardDial: forwardDialer.Dial}, nil - }) -} - -type httpProxyDialer struct { - proxyURL *url.URL - forwardDial func(network, addr string) (net.Conn, error) -} - -func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) { - hostPort, _ := hostPortNoPort(hpd.proxyURL) - conn, err := hpd.forwardDial(network, hostPort) - if err != nil { - return nil, err - } - - connectHeader := make(http.Header) - if user := hpd.proxyURL.User; user != nil { - proxyUser := user.Username() - if proxyPassword, passwordSet := user.Password(); passwordSet { - credential := base64.StdEncoding.EncodeToString([]byte(proxyUser + ":" + proxyPassword)) - connectHeader.Set("Proxy-Authorization", "Basic "+credential) - } - } - - connectReq := &http.Request{ - Method: http.MethodConnect, - URL: &url.URL{Opaque: addr}, - Host: addr, - Header: connectHeader, - } - - if err := connectReq.Write(conn); err != nil { - conn.Close() - return nil, err - } - - // Read response. It's OK to use and discard buffered reader here becaue - // the remote server does not speak until spoken to. - br := bufio.NewReader(conn) - resp, err := http.ReadResponse(br, connectReq) - if err != nil { - conn.Close() - return nil, err - } - - if resp.StatusCode != 200 { - conn.Close() - f := strings.SplitN(resp.Status, " ", 2) - return nil, errors.New(f[1]) - } - return conn, nil -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/server.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/server.go deleted file mode 100644 index 24d53b38abed..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/server.go +++ /dev/null @@ -1,365 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "bufio" - "errors" - "io" - "net/http" - "net/url" - "strings" - "time" -) - -// HandshakeError describes an error with the handshake from the peer. -type HandshakeError struct { - message string -} - -func (e HandshakeError) Error() string { return e.message } - -// Upgrader specifies parameters for upgrading an HTTP connection to a -// WebSocket connection. -// -// It is safe to call Upgrader's methods concurrently. -type Upgrader struct { - // HandshakeTimeout specifies the duration for the handshake to complete. - HandshakeTimeout time.Duration - - // ReadBufferSize and WriteBufferSize specify I/O buffer sizes in bytes. If a buffer - // size is zero, then buffers allocated by the HTTP server are used. The - // I/O buffer sizes do not limit the size of the messages that can be sent - // or received. - ReadBufferSize, WriteBufferSize int - - // WriteBufferPool is a pool of buffers for write operations. If the value - // is not set, then write buffers are allocated to the connection for the - // lifetime of the connection. - // - // A pool is most useful when the application has a modest volume of writes - // across a large number of connections. - // - // Applications should use a single pool for each unique value of - // WriteBufferSize. - WriteBufferPool BufferPool - - // Subprotocols specifies the server's supported protocols in order of - // preference. If this field is not nil, then the Upgrade method negotiates a - // subprotocol by selecting the first match in this list with a protocol - // requested by the client. If there's no match, then no protocol is - // negotiated (the Sec-Websocket-Protocol header is not included in the - // handshake response). - Subprotocols []string - - // Error specifies the function for generating HTTP error responses. If Error - // is nil, then http.Error is used to generate the HTTP response. - Error func(w http.ResponseWriter, r *http.Request, status int, reason error) - - // CheckOrigin returns true if the request Origin header is acceptable. If - // CheckOrigin is nil, then a safe default is used: return false if the - // Origin request header is present and the origin host is not equal to - // request Host header. - // - // A CheckOrigin function should carefully validate the request origin to - // prevent cross-site request forgery. - CheckOrigin func(r *http.Request) bool - - // EnableCompression specify if the server should attempt to negotiate per - // message compression (RFC 7692). Setting this value to true does not - // guarantee that compression will be supported. Currently only "no context - // takeover" modes are supported. - EnableCompression bool -} - -func (u *Upgrader) returnError(w http.ResponseWriter, r *http.Request, status int, reason string) (*Conn, error) { - err := HandshakeError{reason} - if u.Error != nil { - u.Error(w, r, status, err) - } else { - w.Header().Set("Sec-Websocket-Version", "13") - http.Error(w, http.StatusText(status), status) - } - return nil, err -} - -// checkSameOrigin returns true if the origin is not set or is equal to the request host. -func checkSameOrigin(r *http.Request) bool { - origin := r.Header["Origin"] - if len(origin) == 0 { - return true - } - u, err := url.Parse(origin[0]) - if err != nil { - return false - } - return equalASCIIFold(u.Host, r.Host) -} - -func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header) string { - if u.Subprotocols != nil { - clientProtocols := Subprotocols(r) - for _, serverProtocol := range u.Subprotocols { - for _, clientProtocol := range clientProtocols { - if clientProtocol == serverProtocol { - return clientProtocol - } - } - } - } else if responseHeader != nil { - return responseHeader.Get("Sec-Websocket-Protocol") - } - return "" -} - -// Upgrade upgrades the HTTP server connection to the WebSocket protocol. -// -// The responseHeader is included in the response to the client's upgrade -// request. Use the responseHeader to specify cookies (Set-Cookie). To specify -// subprotocols supported by the server, set Upgrader.Subprotocols directly. -// -// If the upgrade fails, then Upgrade replies to the client with an HTTP error -// response. -func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error) { - const badHandshake = "websocket: the client is not using the websocket protocol: " - - if !tokenListContainsValue(r.Header, "Connection", "upgrade") { - return u.returnError(w, r, http.StatusBadRequest, badHandshake+"'upgrade' token not found in 'Connection' header") - } - - if !tokenListContainsValue(r.Header, "Upgrade", "websocket") { - return u.returnError(w, r, http.StatusBadRequest, badHandshake+"'websocket' token not found in 'Upgrade' header") - } - - if r.Method != http.MethodGet { - return u.returnError(w, r, http.StatusMethodNotAllowed, badHandshake+"request method is not GET") - } - - if !tokenListContainsValue(r.Header, "Sec-Websocket-Version", "13") { - return u.returnError(w, r, http.StatusBadRequest, "websocket: unsupported version: 13 not found in 'Sec-Websocket-Version' header") - } - - if _, ok := responseHeader["Sec-Websocket-Extensions"]; ok { - return u.returnError(w, r, http.StatusInternalServerError, "websocket: application specific 'Sec-WebSocket-Extensions' headers are unsupported") - } - - checkOrigin := u.CheckOrigin - if checkOrigin == nil { - checkOrigin = checkSameOrigin - } - if !checkOrigin(r) { - return u.returnError(w, r, http.StatusForbidden, "websocket: request origin not allowed by Upgrader.CheckOrigin") - } - - challengeKey := r.Header.Get("Sec-Websocket-Key") - if challengeKey == "" { - return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: 'Sec-WebSocket-Key' header is missing or blank") - } - - subprotocol := u.selectSubprotocol(r, responseHeader) - - // Negotiate PMCE - var compress bool - if u.EnableCompression { - for _, ext := range parseExtensions(r.Header) { - if ext[""] != "permessage-deflate" { - continue - } - compress = true - break - } - } - - h, ok := w.(http.Hijacker) - if !ok { - return u.returnError(w, r, http.StatusInternalServerError, "websocket: response does not implement http.Hijacker") - } - var brw *bufio.ReadWriter - netConn, brw, err := h.Hijack() - if err != nil { - return u.returnError(w, r, http.StatusInternalServerError, err.Error()) - } - - if brw.Reader.Buffered() > 0 { - netConn.Close() - return nil, errors.New("websocket: client sent data before handshake is complete") - } - - var br *bufio.Reader - if u.ReadBufferSize == 0 && bufioReaderSize(netConn, brw.Reader) > 256 { - // Reuse hijacked buffered reader as connection reader. - br = brw.Reader - } - - buf := bufioWriterBuffer(netConn, brw.Writer) - - var writeBuf []byte - if u.WriteBufferPool == nil && u.WriteBufferSize == 0 && len(buf) >= maxFrameHeaderSize+256 { - // Reuse hijacked write buffer as connection buffer. - writeBuf = buf - } - - c := newConn(netConn, true, u.ReadBufferSize, u.WriteBufferSize, u.WriteBufferPool, br, writeBuf) - c.subprotocol = subprotocol - - if compress { - c.newCompressionWriter = compressNoContextTakeover - c.newDecompressionReader = decompressNoContextTakeover - } - - // Use larger of hijacked buffer and connection write buffer for header. - p := buf - if len(c.writeBuf) > len(p) { - p = c.writeBuf - } - p = p[:0] - - p = append(p, "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: "...) - p = append(p, computeAcceptKey(challengeKey)...) - p = append(p, "\r\n"...) - if c.subprotocol != "" { - p = append(p, "Sec-WebSocket-Protocol: "...) - p = append(p, c.subprotocol...) - p = append(p, "\r\n"...) - } - if compress { - p = append(p, "Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover\r\n"...) - } - for k, vs := range responseHeader { - if k == "Sec-Websocket-Protocol" { - continue - } - for _, v := range vs { - p = append(p, k...) - p = append(p, ": "...) - for i := 0; i < len(v); i++ { - b := v[i] - if b <= 31 { - // prevent response splitting. - b = ' ' - } - p = append(p, b) - } - p = append(p, "\r\n"...) - } - } - p = append(p, "\r\n"...) - - // Clear deadlines set by HTTP server. - netConn.SetDeadline(time.Time{}) - - if u.HandshakeTimeout > 0 { - netConn.SetWriteDeadline(time.Now().Add(u.HandshakeTimeout)) - } - if _, err = netConn.Write(p); err != nil { - netConn.Close() - return nil, err - } - if u.HandshakeTimeout > 0 { - netConn.SetWriteDeadline(time.Time{}) - } - - return c, nil -} - -// Upgrade upgrades the HTTP server connection to the WebSocket protocol. -// -// Deprecated: Use websocket.Upgrader instead. -// -// Upgrade does not perform origin checking. The application is responsible for -// checking the Origin header before calling Upgrade. An example implementation -// of the same origin policy check is: -// -// if req.Header.Get("Origin") != "http://"+req.Host { -// http.Error(w, "Origin not allowed", http.StatusForbidden) -// return -// } -// -// If the endpoint supports subprotocols, then the application is responsible -// for negotiating the protocol used on the connection. Use the Subprotocols() -// function to get the subprotocols requested by the client. Use the -// Sec-Websocket-Protocol response header to specify the subprotocol selected -// by the application. -// -// The responseHeader is included in the response to the client's upgrade -// request. Use the responseHeader to specify cookies (Set-Cookie) and the -// negotiated subprotocol (Sec-Websocket-Protocol). -// -// The connection buffers IO to the underlying network connection. The -// readBufSize and writeBufSize parameters specify the size of the buffers to -// use. Messages can be larger than the buffers. -// -// If the request is not a valid WebSocket handshake, then Upgrade returns an -// error of type HandshakeError. Applications should handle this error by -// replying to the client with an HTTP error response. -func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header, readBufSize, writeBufSize int) (*Conn, error) { - u := Upgrader{ReadBufferSize: readBufSize, WriteBufferSize: writeBufSize} - u.Error = func(w http.ResponseWriter, r *http.Request, status int, reason error) { - // don't return errors to maintain backwards compatibility - } - u.CheckOrigin = func(r *http.Request) bool { - // allow all connections by default - return true - } - return u.Upgrade(w, r, responseHeader) -} - -// Subprotocols returns the subprotocols requested by the client in the -// Sec-Websocket-Protocol header. -func Subprotocols(r *http.Request) []string { - h := strings.TrimSpace(r.Header.Get("Sec-Websocket-Protocol")) - if h == "" { - return nil - } - protocols := strings.Split(h, ",") - for i := range protocols { - protocols[i] = strings.TrimSpace(protocols[i]) - } - return protocols -} - -// IsWebSocketUpgrade returns true if the client requested upgrade to the -// WebSocket protocol. -func IsWebSocketUpgrade(r *http.Request) bool { - return tokenListContainsValue(r.Header, "Connection", "upgrade") && - tokenListContainsValue(r.Header, "Upgrade", "websocket") -} - -// bufioReaderSize size returns the size of a bufio.Reader. -func bufioReaderSize(originalReader io.Reader, br *bufio.Reader) int { - // This code assumes that peek on a reset reader returns - // bufio.Reader.buf[:0]. - // TODO: Use bufio.Reader.Size() after Go 1.10 - br.Reset(originalReader) - if p, err := br.Peek(0); err == nil { - return cap(p) - } - return 0 -} - -// writeHook is an io.Writer that records the last slice passed to it vio -// io.Writer.Write. -type writeHook struct { - p []byte -} - -func (wh *writeHook) Write(p []byte) (int, error) { - wh.p = p - return len(p), nil -} - -// bufioWriterBuffer grabs the buffer from a bufio.Writer. -func bufioWriterBuffer(originalWriter io.Writer, bw *bufio.Writer) []byte { - // This code assumes that bufio.Writer.buf[:1] is passed to the - // bufio.Writer's underlying writer. - var wh writeHook - bw.Reset(&wh) - bw.WriteByte(0) - bw.Flush() - - bw.Reset(originalWriter) - - return wh.p[:cap(wh.p)] -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/tls_handshake.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/tls_handshake.go deleted file mode 100644 index a62b68ccb11e..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/tls_handshake.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build go1.17 -// +build go1.17 - -package websocket - -import ( - "context" - "crypto/tls" -) - -func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error { - if err := tlsConn.HandshakeContext(ctx); err != nil { - return err - } - if !cfg.InsecureSkipVerify { - if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil { - return err - } - } - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/tls_handshake_116.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/tls_handshake_116.go deleted file mode 100644 index e1b2b44f6e6c..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/tls_handshake_116.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build !go1.17 -// +build !go1.17 - -package websocket - -import ( - "context" - "crypto/tls" -) - -func doHandshake(ctx context.Context, tlsConn *tls.Conn, cfg *tls.Config) error { - if err := tlsConn.Handshake(); err != nil { - return err - } - if !cfg.InsecureSkipVerify { - if err := tlsConn.VerifyHostname(cfg.ServerName); err != nil { - return err - } - } - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/util.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/util.go deleted file mode 100644 index 7bf2f66c6747..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/util.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package websocket - -import ( - "crypto/rand" - "crypto/sha1" - "encoding/base64" - "io" - "net/http" - "strings" - "unicode/utf8" -) - -var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11") - -func computeAcceptKey(challengeKey string) string { - h := sha1.New() - h.Write([]byte(challengeKey)) - h.Write(keyGUID) - return base64.StdEncoding.EncodeToString(h.Sum(nil)) -} - -func generateChallengeKey() (string, error) { - p := make([]byte, 16) - if _, err := io.ReadFull(rand.Reader, p); err != nil { - return "", err - } - return base64.StdEncoding.EncodeToString(p), nil -} - -// Token octets per RFC 2616. -var isTokenOctet = [256]bool{ - '!': true, - '#': true, - '$': true, - '%': true, - '&': true, - '\'': true, - '*': true, - '+': true, - '-': true, - '.': true, - '0': true, - '1': true, - '2': true, - '3': true, - '4': true, - '5': true, - '6': true, - '7': true, - '8': true, - '9': true, - 'A': true, - 'B': true, - 'C': true, - 'D': true, - 'E': true, - 'F': true, - 'G': true, - 'H': true, - 'I': true, - 'J': true, - 'K': true, - 'L': true, - 'M': true, - 'N': true, - 'O': true, - 'P': true, - 'Q': true, - 'R': true, - 'S': true, - 'T': true, - 'U': true, - 'W': true, - 'V': true, - 'X': true, - 'Y': true, - 'Z': true, - '^': true, - '_': true, - '`': true, - 'a': true, - 'b': true, - 'c': true, - 'd': true, - 'e': true, - 'f': true, - 'g': true, - 'h': true, - 'i': true, - 'j': true, - 'k': true, - 'l': true, - 'm': true, - 'n': true, - 'o': true, - 'p': true, - 'q': true, - 'r': true, - 's': true, - 't': true, - 'u': true, - 'v': true, - 'w': true, - 'x': true, - 'y': true, - 'z': true, - '|': true, - '~': true, -} - -// skipSpace returns a slice of the string s with all leading RFC 2616 linear -// whitespace removed. -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if b := s[i]; b != ' ' && b != '\t' { - break - } - } - return s[i:] -} - -// nextToken returns the leading RFC 2616 token of s and the string following -// the token. -func nextToken(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - if !isTokenOctet[s[i]] { - break - } - } - return s[:i], s[i:] -} - -// nextTokenOrQuoted returns the leading token or quoted string per RFC 2616 -// and the string following the token or quoted string. -func nextTokenOrQuoted(s string) (value string, rest string) { - if !strings.HasPrefix(s, "\"") { - return nextToken(s) - } - s = s[1:] - for i := 0; i < len(s); i++ { - switch s[i] { - case '"': - return s[:i], s[i+1:] - case '\\': - p := make([]byte, len(s)-1) - j := copy(p, s[:i]) - escape := true - for i = i + 1; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - p[j] = b - j++ - case b == '\\': - escape = true - case b == '"': - return string(p[:j]), s[i+1:] - default: - p[j] = b - j++ - } - } - return "", "" - } - } - return "", "" -} - -// equalASCIIFold returns true if s is equal to t with ASCII case folding as -// defined in RFC 4790. -func equalASCIIFold(s, t string) bool { - for s != "" && t != "" { - sr, size := utf8.DecodeRuneInString(s) - s = s[size:] - tr, size := utf8.DecodeRuneInString(t) - t = t[size:] - if sr == tr { - continue - } - if 'A' <= sr && sr <= 'Z' { - sr = sr + 'a' - 'A' - } - if 'A' <= tr && tr <= 'Z' { - tr = tr + 'a' - 'A' - } - if sr != tr { - return false - } - } - return s == t -} - -// tokenListContainsValue returns true if the 1#token header with the given -// name contains a token equal to value with ASCII case folding. -func tokenListContainsValue(header http.Header, name string, value string) bool { -headers: - for _, s := range header[name] { - for { - var t string - t, s = nextToken(skipSpace(s)) - if t == "" { - continue headers - } - s = skipSpace(s) - if s != "" && s[0] != ',' { - continue headers - } - if equalASCIIFold(t, value) { - return true - } - if s == "" { - continue headers - } - s = s[1:] - } - } - return false -} - -// parseExtensions parses WebSocket extensions from a header. -func parseExtensions(header http.Header) []map[string]string { - // From RFC 6455: - // - // Sec-WebSocket-Extensions = extension-list - // extension-list = 1#extension - // extension = extension-token *( ";" extension-param ) - // extension-token = registered-token - // registered-token = token - // extension-param = token [ "=" (token | quoted-string) ] - // ;When using the quoted-string syntax variant, the value - // ;after quoted-string unescaping MUST conform to the - // ;'token' ABNF. - - var result []map[string]string -headers: - for _, s := range header["Sec-Websocket-Extensions"] { - for { - var t string - t, s = nextToken(skipSpace(s)) - if t == "" { - continue headers - } - ext := map[string]string{"": t} - for { - s = skipSpace(s) - if !strings.HasPrefix(s, ";") { - break - } - var k string - k, s = nextToken(skipSpace(s[1:])) - if k == "" { - continue headers - } - s = skipSpace(s) - var v string - if strings.HasPrefix(s, "=") { - v, s = nextTokenOrQuoted(skipSpace(s[1:])) - s = skipSpace(s) - } - if s != "" && s[0] != ',' && s[0] != ';' { - continue headers - } - ext[k] = v - } - if s != "" && s[0] != ',' { - continue headers - } - result = append(result, ext) - if s == "" { - continue headers - } - s = s[1:] - } - } - return result -} diff --git a/cluster-autoscaler/vendor/github.com/gorilla/websocket/x_net_proxy.go b/cluster-autoscaler/vendor/github.com/gorilla/websocket/x_net_proxy.go deleted file mode 100644 index 2e668f6b8821..000000000000 --- a/cluster-autoscaler/vendor/github.com/gorilla/websocket/x_net_proxy.go +++ /dev/null @@ -1,473 +0,0 @@ -// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT. -//go:generate bundle -o x_net_proxy.go golang.org/x/net/proxy - -// Package proxy provides support for a variety of protocols to proxy network -// data. -// - -package websocket - -import ( - "errors" - "io" - "net" - "net/url" - "os" - "strconv" - "strings" - "sync" -) - -type proxy_direct struct{} - -// Direct is a direct proxy: one that makes network connections directly. -var proxy_Direct = proxy_direct{} - -func (proxy_direct) Dial(network, addr string) (net.Conn, error) { - return net.Dial(network, addr) -} - -// A PerHost directs connections to a default Dialer unless the host name -// requested matches one of a number of exceptions. -type proxy_PerHost struct { - def, bypass proxy_Dialer - - bypassNetworks []*net.IPNet - bypassIPs []net.IP - bypassZones []string - bypassHosts []string -} - -// NewPerHost returns a PerHost Dialer that directs connections to either -// defaultDialer or bypass, depending on whether the connection matches one of -// the configured rules. -func proxy_NewPerHost(defaultDialer, bypass proxy_Dialer) *proxy_PerHost { - return &proxy_PerHost{ - def: defaultDialer, - bypass: bypass, - } -} - -// Dial connects to the address addr on the given network through either -// defaultDialer or bypass. -func (p *proxy_PerHost) Dial(network, addr string) (c net.Conn, err error) { - host, _, err := net.SplitHostPort(addr) - if err != nil { - return nil, err - } - - return p.dialerForRequest(host).Dial(network, addr) -} - -func (p *proxy_PerHost) dialerForRequest(host string) proxy_Dialer { - if ip := net.ParseIP(host); ip != nil { - for _, net := range p.bypassNetworks { - if net.Contains(ip) { - return p.bypass - } - } - for _, bypassIP := range p.bypassIPs { - if bypassIP.Equal(ip) { - return p.bypass - } - } - return p.def - } - - for _, zone := range p.bypassZones { - if strings.HasSuffix(host, zone) { - return p.bypass - } - if host == zone[1:] { - // For a zone ".example.com", we match "example.com" - // too. - return p.bypass - } - } - for _, bypassHost := range p.bypassHosts { - if bypassHost == host { - return p.bypass - } - } - return p.def -} - -// AddFromString parses a string that contains comma-separated values -// specifying hosts that should use the bypass proxy. Each value is either an -// IP address, a CIDR range, a zone (*.example.com) or a host name -// (localhost). A best effort is made to parse the string and errors are -// ignored. -func (p *proxy_PerHost) AddFromString(s string) { - hosts := strings.Split(s, ",") - for _, host := range hosts { - host = strings.TrimSpace(host) - if len(host) == 0 { - continue - } - if strings.Contains(host, "/") { - // We assume that it's a CIDR address like 127.0.0.0/8 - if _, net, err := net.ParseCIDR(host); err == nil { - p.AddNetwork(net) - } - continue - } - if ip := net.ParseIP(host); ip != nil { - p.AddIP(ip) - continue - } - if strings.HasPrefix(host, "*.") { - p.AddZone(host[1:]) - continue - } - p.AddHost(host) - } -} - -// AddIP specifies an IP address that will use the bypass proxy. Note that -// this will only take effect if a literal IP address is dialed. A connection -// to a named host will never match an IP. -func (p *proxy_PerHost) AddIP(ip net.IP) { - p.bypassIPs = append(p.bypassIPs, ip) -} - -// AddNetwork specifies an IP range that will use the bypass proxy. Note that -// this will only take effect if a literal IP address is dialed. A connection -// to a named host will never match. -func (p *proxy_PerHost) AddNetwork(net *net.IPNet) { - p.bypassNetworks = append(p.bypassNetworks, net) -} - -// AddZone specifies a DNS suffix that will use the bypass proxy. A zone of -// "example.com" matches "example.com" and all of its subdomains. -func (p *proxy_PerHost) AddZone(zone string) { - if strings.HasSuffix(zone, ".") { - zone = zone[:len(zone)-1] - } - if !strings.HasPrefix(zone, ".") { - zone = "." + zone - } - p.bypassZones = append(p.bypassZones, zone) -} - -// AddHost specifies a host name that will use the bypass proxy. -func (p *proxy_PerHost) AddHost(host string) { - if strings.HasSuffix(host, ".") { - host = host[:len(host)-1] - } - p.bypassHosts = append(p.bypassHosts, host) -} - -// A Dialer is a means to establish a connection. -type proxy_Dialer interface { - // Dial connects to the given address via the proxy. - Dial(network, addr string) (c net.Conn, err error) -} - -// Auth contains authentication parameters that specific Dialers may require. -type proxy_Auth struct { - User, Password string -} - -// FromEnvironment returns the dialer specified by the proxy related variables in -// the environment. -func proxy_FromEnvironment() proxy_Dialer { - allProxy := proxy_allProxyEnv.Get() - if len(allProxy) == 0 { - return proxy_Direct - } - - proxyURL, err := url.Parse(allProxy) - if err != nil { - return proxy_Direct - } - proxy, err := proxy_FromURL(proxyURL, proxy_Direct) - if err != nil { - return proxy_Direct - } - - noProxy := proxy_noProxyEnv.Get() - if len(noProxy) == 0 { - return proxy - } - - perHost := proxy_NewPerHost(proxy, proxy_Direct) - perHost.AddFromString(noProxy) - return perHost -} - -// proxySchemes is a map from URL schemes to a function that creates a Dialer -// from a URL with such a scheme. -var proxy_proxySchemes map[string]func(*url.URL, proxy_Dialer) (proxy_Dialer, error) - -// RegisterDialerType takes a URL scheme and a function to generate Dialers from -// a URL with that scheme and a forwarding Dialer. Registered schemes are used -// by FromURL. -func proxy_RegisterDialerType(scheme string, f func(*url.URL, proxy_Dialer) (proxy_Dialer, error)) { - if proxy_proxySchemes == nil { - proxy_proxySchemes = make(map[string]func(*url.URL, proxy_Dialer) (proxy_Dialer, error)) - } - proxy_proxySchemes[scheme] = f -} - -// FromURL returns a Dialer given a URL specification and an underlying -// Dialer for it to make network requests. -func proxy_FromURL(u *url.URL, forward proxy_Dialer) (proxy_Dialer, error) { - var auth *proxy_Auth - if u.User != nil { - auth = new(proxy_Auth) - auth.User = u.User.Username() - if p, ok := u.User.Password(); ok { - auth.Password = p - } - } - - switch u.Scheme { - case "socks5": - return proxy_SOCKS5("tcp", u.Host, auth, forward) - } - - // If the scheme doesn't match any of the built-in schemes, see if it - // was registered by another package. - if proxy_proxySchemes != nil { - if f, ok := proxy_proxySchemes[u.Scheme]; ok { - return f(u, forward) - } - } - - return nil, errors.New("proxy: unknown scheme: " + u.Scheme) -} - -var ( - proxy_allProxyEnv = &proxy_envOnce{ - names: []string{"ALL_PROXY", "all_proxy"}, - } - proxy_noProxyEnv = &proxy_envOnce{ - names: []string{"NO_PROXY", "no_proxy"}, - } -) - -// envOnce looks up an environment variable (optionally by multiple -// names) once. It mitigates expensive lookups on some platforms -// (e.g. Windows). -// (Borrowed from net/http/transport.go) -type proxy_envOnce struct { - names []string - once sync.Once - val string -} - -func (e *proxy_envOnce) Get() string { - e.once.Do(e.init) - return e.val -} - -func (e *proxy_envOnce) init() { - for _, n := range e.names { - e.val = os.Getenv(n) - if e.val != "" { - return - } - } -} - -// SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given address -// with an optional username and password. See RFC 1928 and RFC 1929. -func proxy_SOCKS5(network, addr string, auth *proxy_Auth, forward proxy_Dialer) (proxy_Dialer, error) { - s := &proxy_socks5{ - network: network, - addr: addr, - forward: forward, - } - if auth != nil { - s.user = auth.User - s.password = auth.Password - } - - return s, nil -} - -type proxy_socks5 struct { - user, password string - network, addr string - forward proxy_Dialer -} - -const proxy_socks5Version = 5 - -const ( - proxy_socks5AuthNone = 0 - proxy_socks5AuthPassword = 2 -) - -const proxy_socks5Connect = 1 - -const ( - proxy_socks5IP4 = 1 - proxy_socks5Domain = 3 - proxy_socks5IP6 = 4 -) - -var proxy_socks5Errors = []string{ - "", - "general failure", - "connection forbidden", - "network unreachable", - "host unreachable", - "connection refused", - "TTL expired", - "command not supported", - "address type not supported", -} - -// Dial connects to the address addr on the given network via the SOCKS5 proxy. -func (s *proxy_socks5) Dial(network, addr string) (net.Conn, error) { - switch network { - case "tcp", "tcp6", "tcp4": - default: - return nil, errors.New("proxy: no support for SOCKS5 proxy connections of type " + network) - } - - conn, err := s.forward.Dial(s.network, s.addr) - if err != nil { - return nil, err - } - if err := s.connect(conn, addr); err != nil { - conn.Close() - return nil, err - } - return conn, nil -} - -// connect takes an existing connection to a socks5 proxy server, -// and commands the server to extend that connection to target, -// which must be a canonical address with a host and port. -func (s *proxy_socks5) connect(conn net.Conn, target string) error { - host, portStr, err := net.SplitHostPort(target) - if err != nil { - return err - } - - port, err := strconv.Atoi(portStr) - if err != nil { - return errors.New("proxy: failed to parse port number: " + portStr) - } - if port < 1 || port > 0xffff { - return errors.New("proxy: port number out of range: " + portStr) - } - - // the size here is just an estimate - buf := make([]byte, 0, 6+len(host)) - - buf = append(buf, proxy_socks5Version) - if len(s.user) > 0 && len(s.user) < 256 && len(s.password) < 256 { - buf = append(buf, 2 /* num auth methods */, proxy_socks5AuthNone, proxy_socks5AuthPassword) - } else { - buf = append(buf, 1 /* num auth methods */, proxy_socks5AuthNone) - } - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write greeting to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read greeting from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - if buf[0] != 5 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " has unexpected version " + strconv.Itoa(int(buf[0]))) - } - if buf[1] == 0xff { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " requires authentication") - } - - // See RFC 1929 - if buf[1] == proxy_socks5AuthPassword { - buf = buf[:0] - buf = append(buf, 1 /* password protocol version */) - buf = append(buf, uint8(len(s.user))) - buf = append(buf, s.user...) - buf = append(buf, uint8(len(s.password))) - buf = append(buf, s.password...) - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write authentication request to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read authentication reply from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if buf[1] != 0 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " rejected username/password") - } - } - - buf = buf[:0] - buf = append(buf, proxy_socks5Version, proxy_socks5Connect, 0 /* reserved */) - - if ip := net.ParseIP(host); ip != nil { - if ip4 := ip.To4(); ip4 != nil { - buf = append(buf, proxy_socks5IP4) - ip = ip4 - } else { - buf = append(buf, proxy_socks5IP6) - } - buf = append(buf, ip...) - } else { - if len(host) > 255 { - return errors.New("proxy: destination host name too long: " + host) - } - buf = append(buf, proxy_socks5Domain) - buf = append(buf, byte(len(host))) - buf = append(buf, host...) - } - buf = append(buf, byte(port>>8), byte(port)) - - if _, err := conn.Write(buf); err != nil { - return errors.New("proxy: failed to write connect request to SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - if _, err := io.ReadFull(conn, buf[:4]); err != nil { - return errors.New("proxy: failed to read connect reply from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - failure := "unknown error" - if int(buf[1]) < len(proxy_socks5Errors) { - failure = proxy_socks5Errors[buf[1]] - } - - if len(failure) > 0 { - return errors.New("proxy: SOCKS5 proxy at " + s.addr + " failed to connect: " + failure) - } - - bytesToDiscard := 0 - switch buf[3] { - case proxy_socks5IP4: - bytesToDiscard = net.IPv4len - case proxy_socks5IP6: - bytesToDiscard = net.IPv6len - case proxy_socks5Domain: - _, err := io.ReadFull(conn, buf[:1]) - if err != nil { - return errors.New("proxy: failed to read domain length from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - bytesToDiscard = int(buf[0]) - default: - return errors.New("proxy: got unknown address type " + strconv.Itoa(int(buf[3])) + " from SOCKS5 proxy at " + s.addr) - } - - if cap(buf) < bytesToDiscard { - buf = make([]byte, bytesToDiscard) - } else { - buf = buf[:bytesToDiscard] - } - if _, err := io.ReadFull(conn, buf); err != nil { - return errors.New("proxy: failed to read address from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - // Also need to discard the port number - if _, err := io.ReadFull(conn, buf[:2]); err != nil { - return errors.New("proxy: failed to read port from SOCKS5 proxy at " + s.addr + ": " + err.Error()) - } - - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/eaccess_go119.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/eaccess_go119.go deleted file mode 100644 index cc1e2079a795..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/eaccess_go119.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build !go1.20 -// +build !go1.20 - -package libcontainer - -import "golang.org/x/sys/unix" - -func eaccess(path string) error { - // This check is similar to access(2) with X_OK except for - // setuid/setgid binaries where it checks against the effective - // (rather than real) uid and gid. It is not needed in go 1.20 - // and beyond and will be removed later. - - // Relies on code added in https://go-review.googlesource.com/c/sys/+/468877 - // and older CLs linked from there. - return unix.Faccessat(unix.AT_FDCWD, path, unix.X_OK, unix.AT_EACCESS) -} diff --git a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/eaccess_stub.go b/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/eaccess_stub.go deleted file mode 100644 index 7c049fd7aa02..000000000000 --- a/cluster-autoscaler/vendor/github.com/opencontainers/runc/libcontainer/eaccess_stub.go +++ /dev/null @@ -1,10 +0,0 @@ -//go:build go1.20 - -package libcontainer - -func eaccess(path string) error { - // Not needed in Go 1.20+ as the functionality is already in there - // (added by https://go.dev/cl/416115, https://go.dev/cl/414824, - // and fixed in Go 1.20.2 by https://go.dev/cl/469956). - return nil -} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/vnext.go b/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/vnext.go deleted file mode 100644 index 42bc3a8f0661..000000000000 --- a/cluster-autoscaler/vendor/github.com/prometheus/client_golang/prometheus/vnext.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2022 The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 prometheus - -type v2 struct{} - -// V2 is a struct that can be referenced to access experimental API that might -// be present in v2 of client golang someday. It offers extended functionality -// of v1 with slightly changed API. It is acceptable to use some pieces from v1 -// and e.g `prometheus.NewGauge` and some from v2 e.g. `prometheus.V2.NewDesc` -// in the same codebase. -var V2 = v2{} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/fs_statfs_notype.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/fs_statfs_notype.go deleted file mode 100644 index 800576968966..000000000000 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/fs_statfs_notype.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2018 The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 netbsd || openbsd || solaris || windows -// +build netbsd openbsd solaris windows - -package procfs - -// isRealProc returns true on architectures that don't have a Type argument -// in their Statfs_t struct -func isRealProc(mountPoint string) (bool, error) { - return true, nil -} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/fs_statfs_type.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/fs_statfs_type.go deleted file mode 100644 index 6233217ad292..000000000000 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/fs_statfs_type.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2018 The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 !netbsd && !openbsd && !solaris && !windows -// +build !netbsd,!openbsd,!solaris,!windows - -package procfs - -import ( - "syscall" -) - -// isRealProc determines whether supplied mountpoint is really a proc filesystem. -func isRealProc(mountPoint string) (bool, error) { - stat := syscall.Statfs_t{} - err := syscall.Statfs(mountPoint, &stat) - if err != nil { - return false, err - } - - // 0x9fa0 is PROC_SUPER_MAGIC: https://elixir.bootlin.com/linux/v6.1/source/include/uapi/linux/magic.h#L87 - return stat.Type == 0x9fa0, nil -} diff --git a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_wireless.go b/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_wireless.go deleted file mode 100644 index c80fb154247c..000000000000 --- a/cluster-autoscaler/vendor/github.com/prometheus/procfs/net_wireless.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2023 The Prometheus Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 procfs - -import ( - "bufio" - "bytes" - "fmt" - "io" - "strconv" - "strings" - - "github.com/prometheus/procfs/internal/util" -) - -// Wireless models the content of /proc/net/wireless. -type Wireless struct { - Name string - - // Status is the current 4-digit hex value status of the interface. - Status uint64 - - // QualityLink is the link quality. - QualityLink int - - // QualityLevel is the signal gain (dBm). - QualityLevel int - - // QualityNoise is the signal noise baseline (dBm). - QualityNoise int - - // DiscardedNwid is the number of discarded packets with wrong nwid/essid. - DiscardedNwid int - - // DiscardedCrypt is the number of discarded packets with wrong code/decode (WEP). - DiscardedCrypt int - - // DiscardedFrag is the number of discarded packets that can't perform MAC reassembly. - DiscardedFrag int - - // DiscardedRetry is the number of discarded packets that reached max MAC retries. - DiscardedRetry int - - // DiscardedMisc is the number of discarded packets for other reasons. - DiscardedMisc int - - // MissedBeacon is the number of missed beacons/superframe. - MissedBeacon int -} - -// Wireless returns kernel wireless statistics. -func (fs FS) Wireless() ([]*Wireless, error) { - b, err := util.ReadFileNoStat(fs.proc.Path("net/wireless")) - if err != nil { - return nil, err - } - - m, err := parseWireless(bytes.NewReader(b)) - if err != nil { - return nil, fmt.Errorf("failed to parse wireless: %w", err) - } - - return m, nil -} - -// parseWireless parses the contents of /proc/net/wireless. -/* -Inter-| sta-| Quality | Discarded packets | Missed | WE -face | tus | link level noise | nwid crypt frag retry misc | beacon | 22 - eth1: 0000 5. -256. -10. 0 1 0 3 0 0 - eth2: 0000 5. -256. -20. 0 2 0 4 0 0 -*/ -func parseWireless(r io.Reader) ([]*Wireless, error) { - var ( - interfaces []*Wireless - scanner = bufio.NewScanner(r) - ) - - for n := 0; scanner.Scan(); n++ { - // Skip the 2 header lines. - if n < 2 { - continue - } - - line := scanner.Text() - - parts := strings.Split(line, ":") - if len(parts) != 2 { - return nil, fmt.Errorf("expected 2 parts after splitting line by ':', got %d for line %q", len(parts), line) - } - - name := strings.TrimSpace(parts[0]) - stats := strings.Fields(parts[1]) - - if len(stats) < 10 { - return nil, fmt.Errorf("invalid number of fields in line %d, expected at least 10, got %d: %q", n, len(stats), line) - } - - status, err := strconv.ParseUint(stats[0], 16, 16) - if err != nil { - return nil, fmt.Errorf("invalid status in line %d: %q", n, line) - } - - qlink, err := strconv.Atoi(strings.TrimSuffix(stats[1], ".")) - if err != nil { - return nil, fmt.Errorf("failed to parse Quality:link as integer %q: %w", qlink, err) - } - - qlevel, err := strconv.Atoi(strings.TrimSuffix(stats[2], ".")) - if err != nil { - return nil, fmt.Errorf("failed to parse Quality:level as integer %q: %w", qlevel, err) - } - - qnoise, err := strconv.Atoi(strings.TrimSuffix(stats[3], ".")) - if err != nil { - return nil, fmt.Errorf("failed to parse Quality:noise as integer %q: %w", qnoise, err) - } - - dnwid, err := strconv.Atoi(stats[4]) - if err != nil { - return nil, fmt.Errorf("failed to parse Discarded:nwid as integer %q: %w", dnwid, err) - } - - dcrypt, err := strconv.Atoi(stats[5]) - if err != nil { - return nil, fmt.Errorf("failed to parse Discarded:crypt as integer %q: %w", dcrypt, err) - } - - dfrag, err := strconv.Atoi(stats[6]) - if err != nil { - return nil, fmt.Errorf("failed to parse Discarded:frag as integer %q: %w", dfrag, err) - } - - dretry, err := strconv.Atoi(stats[7]) - if err != nil { - return nil, fmt.Errorf("failed to parse Discarded:retry as integer %q: %w", dretry, err) - } - - dmisc, err := strconv.Atoi(stats[8]) - if err != nil { - return nil, fmt.Errorf("failed to parse Discarded:misc as integer %q: %w", dmisc, err) - } - - mbeacon, err := strconv.Atoi(stats[9]) - if err != nil { - return nil, fmt.Errorf("failed to parse Missed:beacon as integer %q: %w", mbeacon, err) - } - - w := &Wireless{ - Name: name, - Status: status, - QualityLink: qlink, - QualityLevel: qlevel, - QualityNoise: qnoise, - DiscardedNwid: dnwid, - DiscardedCrypt: dcrypt, - DiscardedFrag: dfrag, - DiscardedRetry: dretry, - DiscardedMisc: dmisc, - MissedBeacon: mbeacon, - } - - interfaces = append(interfaces, w) - } - - if err := scanner.Err(); err != nil { - return nil, fmt.Errorf("failed to scan /proc/net/wireless: %w", err) - } - - return interfaces, nil -} diff --git a/cluster-autoscaler/vendor/github.com/vishvananda/netns/.golangci.yml b/cluster-autoscaler/vendor/github.com/vishvananda/netns/.golangci.yml deleted file mode 100644 index 600bef78e2b7..000000000000 --- a/cluster-autoscaler/vendor/github.com/vishvananda/netns/.golangci.yml +++ /dev/null @@ -1,2 +0,0 @@ -run: - timeout: 5m diff --git a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/versions.go b/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/versions.go deleted file mode 100644 index ffcecd8c670f..000000000000 --- a/cluster-autoscaler/vendor/go.etcd.io/etcd/client/pkg/v3/tlsutil/versions.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2023 The etcd Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 tlsutil - -import ( - "crypto/tls" - "fmt" -) - -type TLSVersion string - -// Constants for TLS versions. -const ( - TLSVersionDefault TLSVersion = "" - TLSVersion12 TLSVersion = "TLS1.2" - TLSVersion13 TLSVersion = "TLS1.3" -) - -// GetTLSVersion returns the corresponding tls.Version or error. -func GetTLSVersion(version string) (uint16, error) { - var v uint16 - - switch version { - case string(TLSVersionDefault): - v = 0 // 0 means let Go decide. - case string(TLSVersion12): - v = tls.VersionTLS12 - case string(TLSVersion13): - v = tls.VersionTLS13 - default: - return 0, fmt.Errorf("unexpected TLS version %q (must be one of: TLS1.2, TLS1.3)", version) - } - - return v, nil -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go deleted file mode 100644 index edf4ce3d315a..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/gen.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil" - -// Generate semconvutil package: -//go:generate gotmpl --body=../../../../../../internal/shared/semconvutil/httpconv_test.go.tmpl "--data={}" --out=httpconv_test.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconvutil/httpconv.go.tmpl "--data={}" --out=httpconv.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconvutil/netconv_test.go.tmpl "--data={}" --out=netconv_test.go -//go:generate gotmpl --body=../../../../../../internal/shared/semconvutil/netconv.go.tmpl "--data={}" --out=netconv.go diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go deleted file mode 100644 index d3dede9ebbda..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go +++ /dev/null @@ -1,552 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/semconvutil/httpconv.go.tmpl - -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil" - -import ( - "fmt" - "net/http" - "strings" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" -) - -// HTTPClientResponse returns trace attributes for an HTTP response received by a -// client from a server. It will return the following attributes if the related -// values are defined in resp: "http.status.code", -// "http.response_content_length". -// -// This does not add all OpenTelemetry required attributes for an HTTP event, -// it assumes ClientRequest was used to create the span with a complete set of -// attributes. If a complete set of attributes can be generated using the -// request contained in resp. For example: -// -// append(HTTPClientResponse(resp), ClientRequest(resp.Request)...) -func HTTPClientResponse(resp *http.Response) []attribute.KeyValue { - return hc.ClientResponse(resp) -} - -// HTTPClientRequest returns trace attributes for an HTTP request made by a client. -// The following attributes are always returned: "http.url", "http.flavor", -// "http.method", "net.peer.name". The following attributes are returned if the -// related values are defined in req: "net.peer.port", "http.user_agent", -// "http.request_content_length", "enduser.id". -func HTTPClientRequest(req *http.Request) []attribute.KeyValue { - return hc.ClientRequest(req) -} - -// HTTPClientStatus returns a span status code and message for an HTTP status code -// value received by a client. -func HTTPClientStatus(code int) (codes.Code, string) { - return hc.ClientStatus(code) -} - -// HTTPServerRequest returns trace attributes for an HTTP request received by a -// server. -// -// The server must be the primary server name if it is known. For example this -// would be the ServerName directive -// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache -// server, and the server_name directive -// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an -// nginx server. More generically, the primary server name would be the host -// header value that matches the default virtual host of an HTTP server. It -// should include the host identifier and if a port is used to route to the -// server that port identifier should be included as an appropriate port -// suffix. -// -// If the primary server name is not known, server should be an empty string. -// The req Host will be used to determine the server instead. -// -// The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". -func HTTPServerRequest(server string, req *http.Request) []attribute.KeyValue { - return hc.ServerRequest(server, req) -} - -// HTTPServerRequestMetrics returns metric attributes for an HTTP request received by a -// server. -// -// The server must be the primary server name if it is known. For example this -// would be the ServerName directive -// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache -// server, and the server_name directive -// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an -// nginx server. More generically, the primary server name would be the host -// header value that matches the default virtual host of an HTTP server. It -// should include the host identifier and if a port is used to route to the -// server that port identifier should be included as an appropriate port -// suffix. -// -// If the primary server name is not known, server should be an empty string. -// The req Host will be used to determine the server instead. -// -// The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port". -func HTTPServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { - return hc.ServerRequestMetrics(server, req) -} - -// HTTPServerStatus returns a span status code and message for an HTTP status code -// value returned by a server. Status codes in the 400-499 range are not -// returned as errors. -func HTTPServerStatus(code int) (codes.Code, string) { - return hc.ServerStatus(code) -} - -// HTTPRequestHeader returns the contents of h as attributes. -// -// Instrumentation should require an explicit configuration of which headers to -// captured and then prune what they pass here. Including all headers can be a -// security risk - explicit configuration helps avoid leaking sensitive -// information. -// -// The User-Agent header is already captured in the http.user_agent attribute -// from ClientRequest and ServerRequest. Instrumentation may provide an option -// to capture that header here even though it is not recommended. Otherwise, -// instrumentation should filter that out of what is passed. -func HTTPRequestHeader(h http.Header) []attribute.KeyValue { - return hc.RequestHeader(h) -} - -// HTTPResponseHeader returns the contents of h as attributes. -// -// Instrumentation should require an explicit configuration of which headers to -// captured and then prune what they pass here. Including all headers can be a -// security risk - explicit configuration helps avoid leaking sensitive -// information. -// -// The User-Agent header is already captured in the http.user_agent attribute -// from ClientRequest and ServerRequest. Instrumentation may provide an option -// to capture that header here even though it is not recommended. Otherwise, -// instrumentation should filter that out of what is passed. -func HTTPResponseHeader(h http.Header) []attribute.KeyValue { - return hc.ResponseHeader(h) -} - -// httpConv are the HTTP semantic convention attributes defined for a version -// of the OpenTelemetry specification. -type httpConv struct { - NetConv *netConv - - EnduserIDKey attribute.Key - HTTPClientIPKey attribute.Key - HTTPFlavorKey attribute.Key - HTTPMethodKey attribute.Key - HTTPRequestContentLengthKey attribute.Key - HTTPResponseContentLengthKey attribute.Key - HTTPRouteKey attribute.Key - HTTPSchemeHTTP attribute.KeyValue - HTTPSchemeHTTPS attribute.KeyValue - HTTPStatusCodeKey attribute.Key - HTTPTargetKey attribute.Key - HTTPURLKey attribute.Key - HTTPUserAgentKey attribute.Key -} - -var hc = &httpConv{ - NetConv: nc, - - EnduserIDKey: semconv.EnduserIDKey, - HTTPClientIPKey: semconv.HTTPClientIPKey, - HTTPFlavorKey: semconv.HTTPFlavorKey, - HTTPMethodKey: semconv.HTTPMethodKey, - HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey, - HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey, - HTTPRouteKey: semconv.HTTPRouteKey, - HTTPSchemeHTTP: semconv.HTTPSchemeHTTP, - HTTPSchemeHTTPS: semconv.HTTPSchemeHTTPS, - HTTPStatusCodeKey: semconv.HTTPStatusCodeKey, - HTTPTargetKey: semconv.HTTPTargetKey, - HTTPURLKey: semconv.HTTPURLKey, - HTTPUserAgentKey: semconv.HTTPUserAgentKey, -} - -// ClientResponse returns attributes for an HTTP response received by a client -// from a server. The following attributes are returned if the related values -// are defined in resp: "http.status.code", "http.response_content_length". -// -// This does not add all OpenTelemetry required attributes for an HTTP event, -// it assumes ClientRequest was used to create the span with a complete set of -// attributes. If a complete set of attributes can be generated using the -// request contained in resp. For example: -// -// append(ClientResponse(resp), ClientRequest(resp.Request)...) -func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue { - var n int - if resp.StatusCode > 0 { - n++ - } - if resp.ContentLength > 0 { - n++ - } - - attrs := make([]attribute.KeyValue, 0, n) - if resp.StatusCode > 0 { - attrs = append(attrs, c.HTTPStatusCodeKey.Int(resp.StatusCode)) - } - if resp.ContentLength > 0 { - attrs = append(attrs, c.HTTPResponseContentLengthKey.Int(int(resp.ContentLength))) - } - return attrs -} - -// ClientRequest returns attributes for an HTTP request made by a client. The -// following attributes are always returned: "http.url", "http.flavor", -// "http.method", "net.peer.name". The following attributes are returned if the -// related values are defined in req: "net.peer.port", "http.user_agent", -// "http.request_content_length", "enduser.id". -func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue { - n := 3 // URL, peer name, proto, and method. - var h string - if req.URL != nil { - h = req.URL.Host - } - peer, p := firstHostPort(h, req.Header.Get("Host")) - port := requiredHTTPPort(req.URL != nil && req.URL.Scheme == "https", p) - if port > 0 { - n++ - } - useragent := req.UserAgent() - if useragent != "" { - n++ - } - if req.ContentLength > 0 { - n++ - } - userID, _, hasUserID := req.BasicAuth() - if hasUserID { - n++ - } - attrs := make([]attribute.KeyValue, 0, n) - - attrs = append(attrs, c.method(req.Method)) - attrs = append(attrs, c.flavor(req.Proto)) - - var u string - if req.URL != nil { - // Remove any username/password info that may be in the URL. - userinfo := req.URL.User - req.URL.User = nil - u = req.URL.String() - // Restore any username/password info that was removed. - req.URL.User = userinfo - } - attrs = append(attrs, c.HTTPURLKey.String(u)) - - attrs = append(attrs, c.NetConv.PeerName(peer)) - if port > 0 { - attrs = append(attrs, c.NetConv.PeerPort(port)) - } - - if useragent != "" { - attrs = append(attrs, c.HTTPUserAgentKey.String(useragent)) - } - - if l := req.ContentLength; l > 0 { - attrs = append(attrs, c.HTTPRequestContentLengthKey.Int64(l)) - } - - if hasUserID { - attrs = append(attrs, c.EnduserIDKey.String(userID)) - } - - return attrs -} - -// ServerRequest returns attributes for an HTTP request received by a server. -// -// The server must be the primary server name if it is known. For example this -// would be the ServerName directive -// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache -// server, and the server_name directive -// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an -// nginx server. More generically, the primary server name would be the host -// header value that matches the default virtual host of an HTTP server. It -// should include the host identifier and if a port is used to route to the -// server that port identifier should be included as an appropriate port -// suffix. -// -// If the primary server name is not known, server should be an empty string. -// The req Host will be used to determine the server instead. -// -// The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". -func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.KeyValue { - // TODO: This currently does not add the specification required - // `http.target` attribute. It has too high of a cardinality to safely be - // added. An alternate should be added, or this comment removed, when it is - // addressed by the specification. If it is ultimately decided to continue - // not including the attribute, the HTTPTargetKey field of the httpConv - // should be removed as well. - - n := 4 // Method, scheme, proto, and host name. - var host string - var p int - if server == "" { - host, p = splitHostPort(req.Host) - } else { - // Prioritize the primary server name. - host, p = splitHostPort(server) - if p < 0 { - _, p = splitHostPort(req.Host) - } - } - hostPort := requiredHTTPPort(req.TLS != nil, p) - if hostPort > 0 { - n++ - } - peer, peerPort := splitHostPort(req.RemoteAddr) - if peer != "" { - n++ - if peerPort > 0 { - n++ - } - } - useragent := req.UserAgent() - if useragent != "" { - n++ - } - userID, _, hasUserID := req.BasicAuth() - if hasUserID { - n++ - } - clientIP := serverClientIP(req.Header.Get("X-Forwarded-For")) - if clientIP != "" { - n++ - } - attrs := make([]attribute.KeyValue, 0, n) - - attrs = append(attrs, c.method(req.Method)) - attrs = append(attrs, c.scheme(req.TLS != nil)) - attrs = append(attrs, c.flavor(req.Proto)) - attrs = append(attrs, c.NetConv.HostName(host)) - - if hostPort > 0 { - attrs = append(attrs, c.NetConv.HostPort(hostPort)) - } - - if peer != "" { - // The Go HTTP server sets RemoteAddr to "IP:port", this will not be a - // file-path that would be interpreted with a sock family. - attrs = append(attrs, c.NetConv.SockPeerAddr(peer)) - if peerPort > 0 { - attrs = append(attrs, c.NetConv.SockPeerPort(peerPort)) - } - } - - if useragent != "" { - attrs = append(attrs, c.HTTPUserAgentKey.String(useragent)) - } - - if hasUserID { - attrs = append(attrs, c.EnduserIDKey.String(userID)) - } - - if clientIP != "" { - attrs = append(attrs, c.HTTPClientIPKey.String(clientIP)) - } - - return attrs -} - -// ServerRequestMetrics returns metric attributes for an HTTP request received -// by a server. -// -// The server must be the primary server name if it is known. For example this -// would be the ServerName directive -// (https://httpd.apache.org/docs/2.4/mod/core.html#servername) for an Apache -// server, and the server_name directive -// (http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name) for an -// nginx server. More generically, the primary server name would be the host -// header value that matches the default virtual host of an HTTP server. It -// should include the host identifier and if a port is used to route to the -// server that port identifier should be included as an appropriate port -// suffix. -// -// If the primary server name is not known, server should be an empty string. -// The req Host will be used to determine the server instead. -// -// The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port". -func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { - // TODO: This currently does not add the specification required - // `http.target` attribute. It has too high of a cardinality to safely be - // added. An alternate should be added, or this comment removed, when it is - // addressed by the specification. If it is ultimately decided to continue - // not including the attribute, the HTTPTargetKey field of the httpConv - // should be removed as well. - - n := 4 // Method, scheme, proto, and host name. - var host string - var p int - if server == "" { - host, p = splitHostPort(req.Host) - } else { - // Prioritize the primary server name. - host, p = splitHostPort(server) - if p < 0 { - _, p = splitHostPort(req.Host) - } - } - hostPort := requiredHTTPPort(req.TLS != nil, p) - if hostPort > 0 { - n++ - } - attrs := make([]attribute.KeyValue, 0, n) - - attrs = append(attrs, c.methodMetric(req.Method)) - attrs = append(attrs, c.scheme(req.TLS != nil)) - attrs = append(attrs, c.flavor(req.Proto)) - attrs = append(attrs, c.NetConv.HostName(host)) - - if hostPort > 0 { - attrs = append(attrs, c.NetConv.HostPort(hostPort)) - } - - return attrs -} - -func (c *httpConv) method(method string) attribute.KeyValue { - if method == "" { - return c.HTTPMethodKey.String(http.MethodGet) - } - return c.HTTPMethodKey.String(method) -} - -func (c *httpConv) methodMetric(method string) attribute.KeyValue { - method = strings.ToUpper(method) - switch method { - case http.MethodConnect, http.MethodDelete, http.MethodGet, http.MethodHead, http.MethodOptions, http.MethodPatch, http.MethodPost, http.MethodPut, http.MethodTrace: - default: - method = "_OTHER" - } - return c.HTTPMethodKey.String(method) -} - -func (c *httpConv) scheme(https bool) attribute.KeyValue { // nolint:revive - if https { - return c.HTTPSchemeHTTPS - } - return c.HTTPSchemeHTTP -} - -func (c *httpConv) flavor(proto string) attribute.KeyValue { - switch proto { - case "HTTP/1.0": - return c.HTTPFlavorKey.String("1.0") - case "HTTP/1.1": - return c.HTTPFlavorKey.String("1.1") - case "HTTP/2": - return c.HTTPFlavorKey.String("2.0") - case "HTTP/3": - return c.HTTPFlavorKey.String("3.0") - default: - return c.HTTPFlavorKey.String(proto) - } -} - -func serverClientIP(xForwardedFor string) string { - if idx := strings.Index(xForwardedFor, ","); idx >= 0 { - xForwardedFor = xForwardedFor[:idx] - } - return xForwardedFor -} - -func requiredHTTPPort(https bool, port int) int { // nolint:revive - if https { - if port > 0 && port != 443 { - return port - } - } else { - if port > 0 && port != 80 { - return port - } - } - return -1 -} - -// Return the request host and port from the first non-empty source. -func firstHostPort(source ...string) (host string, port int) { - for _, hostport := range source { - host, port = splitHostPort(hostport) - if host != "" || port > 0 { - break - } - } - return -} - -// RequestHeader returns the contents of h as OpenTelemetry attributes. -func (c *httpConv) RequestHeader(h http.Header) []attribute.KeyValue { - return c.header("http.request.header", h) -} - -// ResponseHeader returns the contents of h as OpenTelemetry attributes. -func (c *httpConv) ResponseHeader(h http.Header) []attribute.KeyValue { - return c.header("http.response.header", h) -} - -func (c *httpConv) header(prefix string, h http.Header) []attribute.KeyValue { - key := func(k string) attribute.Key { - k = strings.ToLower(k) - k = strings.ReplaceAll(k, "-", "_") - k = fmt.Sprintf("%s.%s", prefix, k) - return attribute.Key(k) - } - - attrs := make([]attribute.KeyValue, 0, len(h)) - for k, v := range h { - attrs = append(attrs, key(k).StringSlice(v)) - } - return attrs -} - -// ClientStatus returns a span status code and message for an HTTP status code -// value received by a client. -func (c *httpConv) ClientStatus(code int) (codes.Code, string) { - if code < 100 || code >= 600 { - return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code) - } - if code >= 400 { - return codes.Error, "" - } - return codes.Unset, "" -} - -// ServerStatus returns a span status code and message for an HTTP status code -// value returned by a server. Status codes in the 400-499 range are not -// returned as errors. -func (c *httpConv) ServerStatus(code int) (codes.Code, string) { - if code < 100 || code >= 600 { - return codes.Error, fmt.Sprintf("Invalid HTTP status code %d", code) - } - if code >= 500 { - return codes.Error, "" - } - return codes.Unset, "" -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go b/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go deleted file mode 100644 index bde8893437d7..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go +++ /dev/null @@ -1,368 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/semconvutil/netconv.go.tmpl - -// Copyright The OpenTelemetry Authors -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 semconvutil // import "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil" - -import ( - "net" - "strconv" - "strings" - - "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" -) - -// NetTransport returns a trace attribute describing the transport protocol of the -// passed network. See the net.Dial for information about acceptable network -// values. -func NetTransport(network string) attribute.KeyValue { - return nc.Transport(network) -} - -// NetClient returns trace attributes for a client network connection to address. -// See net.Dial for information about acceptable address values, address should -// be the same as the one used to create conn. If conn is nil, only network -// peer attributes will be returned that describe address. Otherwise, the -// socket level information about conn will also be included. -func NetClient(address string, conn net.Conn) []attribute.KeyValue { - return nc.Client(address, conn) -} - -// NetServer returns trace attributes for a network listener listening at address. -// See net.Listen for information about acceptable address values, address -// should be the same as the one used to create ln. If ln is nil, only network -// host attributes will be returned that describe address. Otherwise, the -// socket level information about ln will also be included. -func NetServer(address string, ln net.Listener) []attribute.KeyValue { - return nc.Server(address, ln) -} - -// netConv are the network semantic convention attributes defined for a version -// of the OpenTelemetry specification. -type netConv struct { - NetHostNameKey attribute.Key - NetHostPortKey attribute.Key - NetPeerNameKey attribute.Key - NetPeerPortKey attribute.Key - NetSockFamilyKey attribute.Key - NetSockPeerAddrKey attribute.Key - NetSockPeerPortKey attribute.Key - NetSockHostAddrKey attribute.Key - NetSockHostPortKey attribute.Key - NetTransportOther attribute.KeyValue - NetTransportTCP attribute.KeyValue - NetTransportUDP attribute.KeyValue - NetTransportInProc attribute.KeyValue -} - -var nc = &netConv{ - NetHostNameKey: semconv.NetHostNameKey, - NetHostPortKey: semconv.NetHostPortKey, - NetPeerNameKey: semconv.NetPeerNameKey, - NetPeerPortKey: semconv.NetPeerPortKey, - NetSockFamilyKey: semconv.NetSockFamilyKey, - NetSockPeerAddrKey: semconv.NetSockPeerAddrKey, - NetSockPeerPortKey: semconv.NetSockPeerPortKey, - NetSockHostAddrKey: semconv.NetSockHostAddrKey, - NetSockHostPortKey: semconv.NetSockHostPortKey, - NetTransportOther: semconv.NetTransportOther, - NetTransportTCP: semconv.NetTransportTCP, - NetTransportUDP: semconv.NetTransportUDP, - NetTransportInProc: semconv.NetTransportInProc, -} - -func (c *netConv) Transport(network string) attribute.KeyValue { - switch network { - case "tcp", "tcp4", "tcp6": - return c.NetTransportTCP - case "udp", "udp4", "udp6": - return c.NetTransportUDP - case "unix", "unixgram", "unixpacket": - return c.NetTransportInProc - default: - // "ip:*", "ip4:*", and "ip6:*" all are considered other. - return c.NetTransportOther - } -} - -// Host returns attributes for a network host address. -func (c *netConv) Host(address string) []attribute.KeyValue { - h, p := splitHostPort(address) - var n int - if h != "" { - n++ - if p > 0 { - n++ - } - } - - if n == 0 { - return nil - } - - attrs := make([]attribute.KeyValue, 0, n) - attrs = append(attrs, c.HostName(h)) - if p > 0 { - attrs = append(attrs, c.HostPort(int(p))) - } - return attrs -} - -// Server returns attributes for a network listener listening at address. See -// net.Listen for information about acceptable address values, address should -// be the same as the one used to create ln. If ln is nil, only network host -// attributes will be returned that describe address. Otherwise, the socket -// level information about ln will also be included. -func (c *netConv) Server(address string, ln net.Listener) []attribute.KeyValue { - if ln == nil { - return c.Host(address) - } - - lAddr := ln.Addr() - if lAddr == nil { - return c.Host(address) - } - - hostName, hostPort := splitHostPort(address) - sockHostAddr, sockHostPort := splitHostPort(lAddr.String()) - network := lAddr.Network() - sockFamily := family(network, sockHostAddr) - - n := nonZeroStr(hostName, network, sockHostAddr, sockFamily) - n += positiveInt(hostPort, sockHostPort) - attr := make([]attribute.KeyValue, 0, n) - if hostName != "" { - attr = append(attr, c.HostName(hostName)) - if hostPort > 0 { - // Only if net.host.name is set should net.host.port be. - attr = append(attr, c.HostPort(hostPort)) - } - } - if network != "" { - attr = append(attr, c.Transport(network)) - } - if sockFamily != "" { - attr = append(attr, c.NetSockFamilyKey.String(sockFamily)) - } - if sockHostAddr != "" { - attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr)) - if sockHostPort > 0 { - // Only if net.sock.host.addr is set should net.sock.host.port be. - attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort)) - } - } - return attr -} - -func (c *netConv) HostName(name string) attribute.KeyValue { - return c.NetHostNameKey.String(name) -} - -func (c *netConv) HostPort(port int) attribute.KeyValue { - return c.NetHostPortKey.Int(port) -} - -// Client returns attributes for a client network connection to address. See -// net.Dial for information about acceptable address values, address should be -// the same as the one used to create conn. If conn is nil, only network peer -// attributes will be returned that describe address. Otherwise, the socket -// level information about conn will also be included. -func (c *netConv) Client(address string, conn net.Conn) []attribute.KeyValue { - if conn == nil { - return c.Peer(address) - } - - lAddr, rAddr := conn.LocalAddr(), conn.RemoteAddr() - - var network string - switch { - case lAddr != nil: - network = lAddr.Network() - case rAddr != nil: - network = rAddr.Network() - default: - return c.Peer(address) - } - - peerName, peerPort := splitHostPort(address) - var ( - sockFamily string - sockPeerAddr string - sockPeerPort int - sockHostAddr string - sockHostPort int - ) - - if lAddr != nil { - sockHostAddr, sockHostPort = splitHostPort(lAddr.String()) - } - - if rAddr != nil { - sockPeerAddr, sockPeerPort = splitHostPort(rAddr.String()) - } - - switch { - case sockHostAddr != "": - sockFamily = family(network, sockHostAddr) - case sockPeerAddr != "": - sockFamily = family(network, sockPeerAddr) - } - - n := nonZeroStr(peerName, network, sockPeerAddr, sockHostAddr, sockFamily) - n += positiveInt(peerPort, sockPeerPort, sockHostPort) - attr := make([]attribute.KeyValue, 0, n) - if peerName != "" { - attr = append(attr, c.PeerName(peerName)) - if peerPort > 0 { - // Only if net.peer.name is set should net.peer.port be. - attr = append(attr, c.PeerPort(peerPort)) - } - } - if network != "" { - attr = append(attr, c.Transport(network)) - } - if sockFamily != "" { - attr = append(attr, c.NetSockFamilyKey.String(sockFamily)) - } - if sockPeerAddr != "" { - attr = append(attr, c.NetSockPeerAddrKey.String(sockPeerAddr)) - if sockPeerPort > 0 { - // Only if net.sock.peer.addr is set should net.sock.peer.port be. - attr = append(attr, c.NetSockPeerPortKey.Int(sockPeerPort)) - } - } - if sockHostAddr != "" { - attr = append(attr, c.NetSockHostAddrKey.String(sockHostAddr)) - if sockHostPort > 0 { - // Only if net.sock.host.addr is set should net.sock.host.port be. - attr = append(attr, c.NetSockHostPortKey.Int(sockHostPort)) - } - } - return attr -} - -func family(network, address string) string { - switch network { - case "unix", "unixgram", "unixpacket": - return "unix" - default: - if ip := net.ParseIP(address); ip != nil { - if ip.To4() == nil { - return "inet6" - } - return "inet" - } - } - return "" -} - -func nonZeroStr(strs ...string) int { - var n int - for _, str := range strs { - if str != "" { - n++ - } - } - return n -} - -func positiveInt(ints ...int) int { - var n int - for _, i := range ints { - if i > 0 { - n++ - } - } - return n -} - -// Peer returns attributes for a network peer address. -func (c *netConv) Peer(address string) []attribute.KeyValue { - h, p := splitHostPort(address) - var n int - if h != "" { - n++ - if p > 0 { - n++ - } - } - - if n == 0 { - return nil - } - - attrs := make([]attribute.KeyValue, 0, n) - attrs = append(attrs, c.PeerName(h)) - if p > 0 { - attrs = append(attrs, c.PeerPort(int(p))) - } - return attrs -} - -func (c *netConv) PeerName(name string) attribute.KeyValue { - return c.NetPeerNameKey.String(name) -} - -func (c *netConv) PeerPort(port int) attribute.KeyValue { - return c.NetPeerPortKey.Int(port) -} - -func (c *netConv) SockPeerAddr(addr string) attribute.KeyValue { - return c.NetSockPeerAddrKey.String(addr) -} - -func (c *netConv) SockPeerPort(port int) attribute.KeyValue { - return c.NetSockPeerPortKey.Int(port) -} - -// splitHostPort splits a network address hostport of the form "host", -// "host%zone", "[host]", "[host%zone], "host:port", "host%zone:port", -// "[host]:port", "[host%zone]:port", or ":port" into host or host%zone and -// port. -// -// An empty host is returned if it is not provided or unparsable. A negative -// port is returned if it is not provided or unparsable. -func splitHostPort(hostport string) (host string, port int) { - port = -1 - - if strings.HasPrefix(hostport, "[") { - addrEnd := strings.LastIndex(hostport, "]") - if addrEnd < 0 { - // Invalid hostport. - return - } - if i := strings.LastIndex(hostport[addrEnd:], ":"); i < 0 { - host = hostport[1:addrEnd] - return - } - } else { - if i := strings.LastIndex(hostport, ":"); i < 0 { - host = hostport - return - } - } - - host, pStr, err := net.SplitHostPort(hostport) - if err != nil { - return - } - - p, err := strconv.ParseUint(pStr, 10, 16) - if err != nil { - return - } - return host, int(p) -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.codespellignore b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.codespellignore deleted file mode 100644 index ae6a3bcf12c8..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.codespellignore +++ /dev/null @@ -1,5 +0,0 @@ -ot -fo -te -collison -consequentially diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.codespellrc b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.codespellrc deleted file mode 100644 index 4afbb1fb3bd7..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/.codespellrc +++ /dev/null @@ -1,10 +0,0 @@ -# https://github.com/codespell-project/codespell -[codespell] -builtin = clear,rare,informal -check-filenames = -check-hidden = -ignore-words = .codespellignore -interactive = 1 -skip = .git,go.mod,go.sum,semconv,venv,.tools -uri-ignore-words-list = * -write = diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/filter.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/filter.go deleted file mode 100644 index 638c213d59ab..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/attribute/filter.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 attribute // import "go.opentelemetry.io/otel/attribute" - -// Filter supports removing certain attributes from attribute sets. When -// the filter returns true, the attribute will be kept in the filtered -// attribute set. When the filter returns false, the attribute is excluded -// from the filtered attribute set, and the attribute instead appears in -// the removed list of excluded attributes. -type Filter func(KeyValue) bool - -// NewAllowKeysFilter returns a Filter that only allows attributes with one of -// the provided keys. -// -// If keys is empty a deny-all filter is returned. -func NewAllowKeysFilter(keys ...Key) Filter { - if len(keys) <= 0 { - return func(kv KeyValue) bool { return false } - } - - allowed := make(map[Key]struct{}) - for _, k := range keys { - allowed[k] = struct{}{} - } - return func(kv KeyValue) bool { - _, ok := allowed[kv.Key] - return ok - } -} - -// NewDenyKeysFilter returns a Filter that only allows attributes -// that do not have one of the provided keys. -// -// If keys is empty an allow-all filter is returned. -func NewDenyKeysFilter(keys ...Key) Filter { - if len(keys) <= 0 { - return func(kv KeyValue) bool { return true } - } - - forbid := make(map[Key]struct{}) - for _, k := range keys { - forbid[k] = struct{}{} - } - return func(kv KeyValue) bool { - _, ok := forbid[kv.Key] - return !ok - } -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go deleted file mode 100644 index becb1f0fbbe6..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig/envconfig.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/envconfig/envconfig.go.tmpl - -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 envconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig" - -import ( - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "net/url" - "strconv" - "strings" - "time" - - "go.opentelemetry.io/otel/internal/global" -) - -// ConfigFn is the generic function used to set a config. -type ConfigFn func(*EnvOptionsReader) - -// EnvOptionsReader reads the required environment variables. -type EnvOptionsReader struct { - GetEnv func(string) string - ReadFile func(string) ([]byte, error) - Namespace string -} - -// Apply runs every ConfigFn. -func (e *EnvOptionsReader) Apply(opts ...ConfigFn) { - for _, o := range opts { - o(e) - } -} - -// GetEnvValue gets an OTLP environment variable value of the specified key -// using the GetEnv function. -// This function prepends the OTLP specified namespace to all key lookups. -func (e *EnvOptionsReader) GetEnvValue(key string) (string, bool) { - v := strings.TrimSpace(e.GetEnv(keyWithNamespace(e.Namespace, key))) - return v, v != "" -} - -// WithString retrieves the specified config and passes it to ConfigFn as a string. -func WithString(n string, fn func(string)) func(e *EnvOptionsReader) { - return func(e *EnvOptionsReader) { - if v, ok := e.GetEnvValue(n); ok { - fn(v) - } - } -} - -// WithBool returns a ConfigFn that reads the environment variable n and if it exists passes its parsed bool value to fn. -func WithBool(n string, fn func(bool)) ConfigFn { - return func(e *EnvOptionsReader) { - if v, ok := e.GetEnvValue(n); ok { - b := strings.ToLower(v) == "true" - fn(b) - } - } -} - -// WithDuration retrieves the specified config and passes it to ConfigFn as a duration. -func WithDuration(n string, fn func(time.Duration)) func(e *EnvOptionsReader) { - return func(e *EnvOptionsReader) { - if v, ok := e.GetEnvValue(n); ok { - d, err := strconv.Atoi(v) - if err != nil { - global.Error(err, "parse duration", "input", v) - return - } - fn(time.Duration(d) * time.Millisecond) - } - } -} - -// WithHeaders retrieves the specified config and passes it to ConfigFn as a map of HTTP headers. -func WithHeaders(n string, fn func(map[string]string)) func(e *EnvOptionsReader) { - return func(e *EnvOptionsReader) { - if v, ok := e.GetEnvValue(n); ok { - fn(stringToHeader(v)) - } - } -} - -// WithURL retrieves the specified config and passes it to ConfigFn as a net/url.URL. -func WithURL(n string, fn func(*url.URL)) func(e *EnvOptionsReader) { - return func(e *EnvOptionsReader) { - if v, ok := e.GetEnvValue(n); ok { - u, err := url.Parse(v) - if err != nil { - global.Error(err, "parse url", "input", v) - return - } - fn(u) - } - } -} - -// WithCertPool returns a ConfigFn that reads the environment variable n as a filepath to a TLS certificate pool. If it exists, it is parsed as a crypto/x509.CertPool and it is passed to fn. -func WithCertPool(n string, fn func(*x509.CertPool)) ConfigFn { - return func(e *EnvOptionsReader) { - if v, ok := e.GetEnvValue(n); ok { - b, err := e.ReadFile(v) - if err != nil { - global.Error(err, "read tls ca cert file", "file", v) - return - } - c, err := createCertPool(b) - if err != nil { - global.Error(err, "create tls cert pool") - return - } - fn(c) - } - } -} - -// WithClientCert returns a ConfigFn that reads the environment variable nc and nk as filepaths to a client certificate and key pair. If they exists, they are parsed as a crypto/tls.Certificate and it is passed to fn. -func WithClientCert(nc, nk string, fn func(tls.Certificate)) ConfigFn { - return func(e *EnvOptionsReader) { - vc, okc := e.GetEnvValue(nc) - vk, okk := e.GetEnvValue(nk) - if !okc || !okk { - return - } - cert, err := e.ReadFile(vc) - if err != nil { - global.Error(err, "read tls client cert", "file", vc) - return - } - key, err := e.ReadFile(vk) - if err != nil { - global.Error(err, "read tls client key", "file", vk) - return - } - crt, err := tls.X509KeyPair(cert, key) - if err != nil { - global.Error(err, "create tls client key pair") - return - } - fn(crt) - } -} - -func keyWithNamespace(ns, key string) string { - if ns == "" { - return key - } - return fmt.Sprintf("%s_%s", ns, key) -} - -func stringToHeader(value string) map[string]string { - headersPairs := strings.Split(value, ",") - headers := make(map[string]string) - - for _, header := range headersPairs { - n, v, found := strings.Cut(header, "=") - if !found { - global.Error(errors.New("missing '="), "parse headers", "input", header) - continue - } - name, err := url.QueryUnescape(n) - if err != nil { - global.Error(err, "escape header key", "key", n) - continue - } - trimmedName := strings.TrimSpace(name) - value, err := url.QueryUnescape(v) - if err != nil { - global.Error(err, "escape header value", "value", v) - continue - } - trimmedValue := strings.TrimSpace(value) - - headers[trimmedName] = trimmedValue - } - - return headers -} - -func createCertPool(certBytes []byte) (*x509.CertPool, error) { - cp := x509.NewCertPool() - if ok := cp.AppendCertsFromPEM(certBytes); !ok { - return nil, errors.New("failed to append certificate to the cert pool") - } - return cp, nil -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go deleted file mode 100644 index 1fb29061894c..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/gen.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal" - -//go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess.go.tmpl "--data={}" --out=partialsuccess.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/partialsuccess_test.go.tmpl "--data={}" --out=partialsuccess_test.go - -//go:generate gotmpl --body=../../../../../internal/shared/otlp/retry/retry.go.tmpl "--data={}" --out=retry/retry.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/retry/retry_test.go.tmpl "--data={}" --out=retry/retry_test.go - -//go:generate gotmpl --body=../../../../../internal/shared/otlp/envconfig/envconfig.go.tmpl "--data={}" --out=envconfig/envconfig.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/envconfig/envconfig_test.go.tmpl "--data={}" --out=envconfig/envconfig_test.go - -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl "--data={\"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig\"}" --out=otlpconfig/envconfig.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl "--data={\"retryImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry\"}" --out=otlpconfig/options.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/options_test.go.tmpl "--data={\"envconfigImportPath\": \"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig\"}" --out=otlpconfig/options_test.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl "--data={}" --out=otlpconfig/optiontypes.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl "--data={}" --out=otlpconfig/tls.go - -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlptracetest/client.go.tmpl "--data={}" --out=otlptracetest/client.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlptracetest/collector.go.tmpl "--data={}" --out=otlptracetest/collector.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlptracetest/data.go.tmpl "--data={}" --out=otlptracetest/data.go -//go:generate gotmpl --body=../../../../../internal/shared/otlp/otlptrace/otlptracetest/otlptest.go.tmpl "--data={}" --out=otlptracetest/otlptest.go diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go deleted file mode 100644 index 32f6dddb4f6f..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/envconfig.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/otlptrace/otlpconfig/envconfig.go.tmpl - -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" - -import ( - "crypto/tls" - "crypto/x509" - "net/url" - "os" - "path" - "strings" - "time" - - "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/envconfig" -) - -// DefaultEnvOptionsReader is the default environments reader. -var DefaultEnvOptionsReader = envconfig.EnvOptionsReader{ - GetEnv: os.Getenv, - ReadFile: os.ReadFile, - Namespace: "OTEL_EXPORTER_OTLP", -} - -// ApplyGRPCEnvConfigs applies the env configurations for gRPC. -func ApplyGRPCEnvConfigs(cfg Config) Config { - opts := getOptionsFromEnv() - for _, opt := range opts { - cfg = opt.ApplyGRPCOption(cfg) - } - return cfg -} - -// ApplyHTTPEnvConfigs applies the env configurations for HTTP. -func ApplyHTTPEnvConfigs(cfg Config) Config { - opts := getOptionsFromEnv() - for _, opt := range opts { - cfg = opt.ApplyHTTPOption(cfg) - } - return cfg -} - -func getOptionsFromEnv() []GenericOption { - opts := []GenericOption{} - - tlsConf := &tls.Config{} - DefaultEnvOptionsReader.Apply( - envconfig.WithURL("ENDPOINT", func(u *url.URL) { - opts = append(opts, withEndpointScheme(u)) - opts = append(opts, newSplitOption(func(cfg Config) Config { - cfg.Traces.Endpoint = u.Host - // For OTLP/HTTP endpoint URLs without a per-signal - // configuration, the passed endpoint is used as a base URL - // and the signals are sent to these paths relative to that. - cfg.Traces.URLPath = path.Join(u.Path, DefaultTracesPath) - return cfg - }, withEndpointForGRPC(u))) - }), - envconfig.WithURL("TRACES_ENDPOINT", func(u *url.URL) { - opts = append(opts, withEndpointScheme(u)) - opts = append(opts, newSplitOption(func(cfg Config) Config { - cfg.Traces.Endpoint = u.Host - // For endpoint URLs for OTLP/HTTP per-signal variables, the - // URL MUST be used as-is without any modification. The only - // exception is that if an URL contains no path part, the root - // path / MUST be used. - path := u.Path - if path == "" { - path = "/" - } - cfg.Traces.URLPath = path - return cfg - }, withEndpointForGRPC(u))) - }), - envconfig.WithCertPool("CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }), - envconfig.WithCertPool("TRACES_CERTIFICATE", func(p *x509.CertPool) { tlsConf.RootCAs = p }), - envconfig.WithClientCert("CLIENT_CERTIFICATE", "CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }), - envconfig.WithClientCert("TRACES_CLIENT_CERTIFICATE", "TRACES_CLIENT_KEY", func(c tls.Certificate) { tlsConf.Certificates = []tls.Certificate{c} }), - withTLSConfig(tlsConf, func(c *tls.Config) { opts = append(opts, WithTLSClientConfig(c)) }), - envconfig.WithBool("INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }), - envconfig.WithBool("TRACES_INSECURE", func(b bool) { opts = append(opts, withInsecure(b)) }), - envconfig.WithHeaders("HEADERS", func(h map[string]string) { opts = append(opts, WithHeaders(h)) }), - envconfig.WithHeaders("TRACES_HEADERS", func(h map[string]string) { opts = append(opts, WithHeaders(h)) }), - WithEnvCompression("COMPRESSION", func(c Compression) { opts = append(opts, WithCompression(c)) }), - WithEnvCompression("TRACES_COMPRESSION", func(c Compression) { opts = append(opts, WithCompression(c)) }), - envconfig.WithDuration("TIMEOUT", func(d time.Duration) { opts = append(opts, WithTimeout(d)) }), - envconfig.WithDuration("TRACES_TIMEOUT", func(d time.Duration) { opts = append(opts, WithTimeout(d)) }), - ) - - return opts -} - -func withEndpointScheme(u *url.URL) GenericOption { - switch strings.ToLower(u.Scheme) { - case "http", "unix": - return WithInsecure() - default: - return WithSecure() - } -} - -func withEndpointForGRPC(u *url.URL) func(cfg Config) Config { - return func(cfg Config) Config { - // For OTLP/gRPC endpoints, this is the target to which the - // exporter is going to send telemetry. - cfg.Traces.Endpoint = path.Join(u.Host, u.Path) - return cfg - } -} - -// WithEnvCompression retrieves the specified config and passes it to ConfigFn as a Compression. -func WithEnvCompression(n string, fn func(Compression)) func(e *envconfig.EnvOptionsReader) { - return func(e *envconfig.EnvOptionsReader) { - if v, ok := e.GetEnvValue(n); ok { - cp := NoCompression - if v == "gzip" { - cp = GzipCompression - } - - fn(cp) - } - } -} - -// revive:disable-next-line:flag-parameter -func withInsecure(b bool) GenericOption { - if b { - return WithInsecure() - } - return WithSecure() -} - -func withTLSConfig(c *tls.Config, fn func(*tls.Config)) func(e *envconfig.EnvOptionsReader) { - return func(e *envconfig.EnvOptionsReader) { - if c.RootCAs != nil || len(c.Certificates) > 0 { - fn(c) - } - } -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go deleted file mode 100644 index 19b8434d4d2c..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/options.go +++ /dev/null @@ -1,328 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/otlptrace/otlpconfig/options.go.tmpl - -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" - -import ( - "crypto/tls" - "fmt" - "path" - "strings" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/backoff" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/encoding/gzip" - - "go.opentelemetry.io/otel/exporters/otlp/otlptrace" - "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry" -) - -const ( - // DefaultTracesPath is a default URL path for endpoint that - // receives spans. - DefaultTracesPath string = "/v1/traces" - // DefaultTimeout is a default max waiting time for the backend to process - // each span batch. - DefaultTimeout time.Duration = 10 * time.Second -) - -type ( - SignalConfig struct { - Endpoint string - Insecure bool - TLSCfg *tls.Config - Headers map[string]string - Compression Compression - Timeout time.Duration - URLPath string - - // gRPC configurations - GRPCCredentials credentials.TransportCredentials - } - - Config struct { - // Signal specific configurations - Traces SignalConfig - - RetryConfig retry.Config - - // gRPC configurations - ReconnectionPeriod time.Duration - ServiceConfig string - DialOptions []grpc.DialOption - GRPCConn *grpc.ClientConn - } -) - -// NewHTTPConfig returns a new Config with all settings applied from opts and -// any unset setting using the default HTTP config values. -func NewHTTPConfig(opts ...HTTPOption) Config { - cfg := Config{ - Traces: SignalConfig{ - Endpoint: fmt.Sprintf("%s:%d", DefaultCollectorHost, DefaultCollectorHTTPPort), - URLPath: DefaultTracesPath, - Compression: NoCompression, - Timeout: DefaultTimeout, - }, - RetryConfig: retry.DefaultConfig, - } - cfg = ApplyHTTPEnvConfigs(cfg) - for _, opt := range opts { - cfg = opt.ApplyHTTPOption(cfg) - } - cfg.Traces.URLPath = cleanPath(cfg.Traces.URLPath, DefaultTracesPath) - return cfg -} - -// cleanPath returns a path with all spaces trimmed and all redundancies -// removed. If urlPath is empty or cleaning it results in an empty string, -// defaultPath is returned instead. -func cleanPath(urlPath string, defaultPath string) string { - tmp := path.Clean(strings.TrimSpace(urlPath)) - if tmp == "." { - return defaultPath - } - if !path.IsAbs(tmp) { - tmp = fmt.Sprintf("/%s", tmp) - } - return tmp -} - -// NewGRPCConfig returns a new Config with all settings applied from opts and -// any unset setting using the default gRPC config values. -func NewGRPCConfig(opts ...GRPCOption) Config { - userAgent := "OTel OTLP Exporter Go/" + otlptrace.Version() - cfg := Config{ - Traces: SignalConfig{ - Endpoint: fmt.Sprintf("%s:%d", DefaultCollectorHost, DefaultCollectorGRPCPort), - URLPath: DefaultTracesPath, - Compression: NoCompression, - Timeout: DefaultTimeout, - }, - RetryConfig: retry.DefaultConfig, - DialOptions: []grpc.DialOption{grpc.WithUserAgent(userAgent)}, - } - cfg = ApplyGRPCEnvConfigs(cfg) - for _, opt := range opts { - cfg = opt.ApplyGRPCOption(cfg) - } - - if cfg.ServiceConfig != "" { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultServiceConfig(cfg.ServiceConfig)) - } - // Priroritize GRPCCredentials over Insecure (passing both is an error). - if cfg.Traces.GRPCCredentials != nil { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(cfg.Traces.GRPCCredentials)) - } else if cfg.Traces.Insecure { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(insecure.NewCredentials())) - } else { - // Default to using the host's root CA. - creds := credentials.NewTLS(nil) - cfg.Traces.GRPCCredentials = creds - cfg.DialOptions = append(cfg.DialOptions, grpc.WithTransportCredentials(creds)) - } - if cfg.Traces.Compression == GzipCompression { - cfg.DialOptions = append(cfg.DialOptions, grpc.WithDefaultCallOptions(grpc.UseCompressor(gzip.Name))) - } - if len(cfg.DialOptions) != 0 { - cfg.DialOptions = append(cfg.DialOptions, cfg.DialOptions...) - } - if cfg.ReconnectionPeriod != 0 { - p := grpc.ConnectParams{ - Backoff: backoff.DefaultConfig, - MinConnectTimeout: cfg.ReconnectionPeriod, - } - cfg.DialOptions = append(cfg.DialOptions, grpc.WithConnectParams(p)) - } - - return cfg -} - -type ( - // GenericOption applies an option to the HTTP or gRPC driver. - GenericOption interface { - ApplyHTTPOption(Config) Config - ApplyGRPCOption(Config) Config - - // A private method to prevent users implementing the - // interface and so future additions to it will not - // violate compatibility. - private() - } - - // HTTPOption applies an option to the HTTP driver. - HTTPOption interface { - ApplyHTTPOption(Config) Config - - // A private method to prevent users implementing the - // interface and so future additions to it will not - // violate compatibility. - private() - } - - // GRPCOption applies an option to the gRPC driver. - GRPCOption interface { - ApplyGRPCOption(Config) Config - - // A private method to prevent users implementing the - // interface and so future additions to it will not - // violate compatibility. - private() - } -) - -// genericOption is an option that applies the same logic -// for both gRPC and HTTP. -type genericOption struct { - fn func(Config) Config -} - -func (g *genericOption) ApplyGRPCOption(cfg Config) Config { - return g.fn(cfg) -} - -func (g *genericOption) ApplyHTTPOption(cfg Config) Config { - return g.fn(cfg) -} - -func (genericOption) private() {} - -func newGenericOption(fn func(cfg Config) Config) GenericOption { - return &genericOption{fn: fn} -} - -// splitOption is an option that applies different logics -// for gRPC and HTTP. -type splitOption struct { - httpFn func(Config) Config - grpcFn func(Config) Config -} - -func (g *splitOption) ApplyGRPCOption(cfg Config) Config { - return g.grpcFn(cfg) -} - -func (g *splitOption) ApplyHTTPOption(cfg Config) Config { - return g.httpFn(cfg) -} - -func (splitOption) private() {} - -func newSplitOption(httpFn func(cfg Config) Config, grpcFn func(cfg Config) Config) GenericOption { - return &splitOption{httpFn: httpFn, grpcFn: grpcFn} -} - -// httpOption is an option that is only applied to the HTTP driver. -type httpOption struct { - fn func(Config) Config -} - -func (h *httpOption) ApplyHTTPOption(cfg Config) Config { - return h.fn(cfg) -} - -func (httpOption) private() {} - -func NewHTTPOption(fn func(cfg Config) Config) HTTPOption { - return &httpOption{fn: fn} -} - -// grpcOption is an option that is only applied to the gRPC driver. -type grpcOption struct { - fn func(Config) Config -} - -func (h *grpcOption) ApplyGRPCOption(cfg Config) Config { - return h.fn(cfg) -} - -func (grpcOption) private() {} - -func NewGRPCOption(fn func(cfg Config) Config) GRPCOption { - return &grpcOption{fn: fn} -} - -// Generic Options - -func WithEndpoint(endpoint string) GenericOption { - return newGenericOption(func(cfg Config) Config { - cfg.Traces.Endpoint = endpoint - return cfg - }) -} - -func WithCompression(compression Compression) GenericOption { - return newGenericOption(func(cfg Config) Config { - cfg.Traces.Compression = compression - return cfg - }) -} - -func WithURLPath(urlPath string) GenericOption { - return newGenericOption(func(cfg Config) Config { - cfg.Traces.URLPath = urlPath - return cfg - }) -} - -func WithRetry(rc retry.Config) GenericOption { - return newGenericOption(func(cfg Config) Config { - cfg.RetryConfig = rc - return cfg - }) -} - -func WithTLSClientConfig(tlsCfg *tls.Config) GenericOption { - return newSplitOption(func(cfg Config) Config { - cfg.Traces.TLSCfg = tlsCfg.Clone() - return cfg - }, func(cfg Config) Config { - cfg.Traces.GRPCCredentials = credentials.NewTLS(tlsCfg) - return cfg - }) -} - -func WithInsecure() GenericOption { - return newGenericOption(func(cfg Config) Config { - cfg.Traces.Insecure = true - return cfg - }) -} - -func WithSecure() GenericOption { - return newGenericOption(func(cfg Config) Config { - cfg.Traces.Insecure = false - return cfg - }) -} - -func WithHeaders(headers map[string]string) GenericOption { - return newGenericOption(func(cfg Config) Config { - cfg.Traces.Headers = headers - return cfg - }) -} - -func WithTimeout(duration time.Duration) GenericOption { - return newGenericOption(func(cfg Config) Config { - cfg.Traces.Timeout = duration - return cfg - }) -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go deleted file mode 100644 index d9dcdc96e7da..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/optiontypes.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/otlptrace/otlpconfig/optiontypes.go.tmpl - -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" - -const ( - // DefaultCollectorGRPCPort is the default gRPC port of the collector. - DefaultCollectorGRPCPort uint16 = 4317 - // DefaultCollectorHTTPPort is the default HTTP port of the collector. - DefaultCollectorHTTPPort uint16 = 4318 - // DefaultCollectorHost is the host address the Exporter will attempt - // connect to if no collector address is provided. - DefaultCollectorHost string = "localhost" -) - -// Compression describes the compression used for payloads sent to the -// collector. -type Compression int - -const ( - // NoCompression tells the driver to send payloads without - // compression. - NoCompression Compression = iota - // GzipCompression tells the driver to send payloads after - // compressing them with gzip. - GzipCompression -) - -// Marshaler describes the kind of message format sent to the collector. -type Marshaler int - -const ( - // MarshalProto tells the driver to send using the protobuf binary format. - MarshalProto Marshaler = iota - // MarshalJSON tells the driver to send using json format. - MarshalJSON -) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go deleted file mode 100644 index 19b6d4b21f99..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig/tls.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/otlptrace/otlpconfig/tls.go.tmpl - -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/otlpconfig" - -import ( - "crypto/tls" - "crypto/x509" - "errors" -) - -// CreateTLSConfig creates a tls.Config from a raw certificate bytes -// to verify a server certificate. -func CreateTLSConfig(certBytes []byte) (*tls.Config, error) { - cp := x509.NewCertPool() - if ok := cp.AppendCertsFromPEM(certBytes); !ok { - return nil, errors.New("failed to append certificate to the cert pool") - } - - return &tls.Config{ - RootCAs: cp, - }, nil -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go deleted file mode 100644 index 076905e54bfc..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/partialsuccess.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/partialsuccess.go - -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 internal // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal" - -import "fmt" - -// PartialSuccess represents the underlying error for all handling -// OTLP partial success messages. Use `errors.Is(err, -// PartialSuccess{})` to test whether an error passed to the OTel -// error handler belongs to this category. -type PartialSuccess struct { - ErrorMessage string - RejectedItems int64 - RejectedKind string -} - -var _ error = PartialSuccess{} - -// Error implements the error interface. -func (ps PartialSuccess) Error() string { - msg := ps.ErrorMessage - if msg == "" { - msg = "empty message" - } - return fmt.Sprintf("OTLP partial success: %s (%d %s rejected)", msg, ps.RejectedItems, ps.RejectedKind) -} - -// Is supports the errors.Is() interface. -func (ps PartialSuccess) Is(err error) bool { - _, ok := err.(PartialSuccess) - return ok -} - -// TracePartialSuccessError returns an error describing a partial success -// response for the trace signal. -func TracePartialSuccessError(itemsRejected int64, errorMessage string) error { - return PartialSuccess{ - ErrorMessage: errorMessage, - RejectedItems: itemsRejected, - RejectedKind: "spans", - } -} - -// MetricPartialSuccessError returns an error describing a partial success -// response for the metric signal. -func MetricPartialSuccessError(itemsRejected int64, errorMessage string) error { - return PartialSuccess{ - ErrorMessage: errorMessage, - RejectedItems: itemsRejected, - RejectedKind: "metric data points", - } -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go deleted file mode 100644 index 3ce7d6632b86..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry/retry.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code created by gotmpl. DO NOT MODIFY. -// source: internal/shared/otlp/retry/retry.go.tmpl - -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 retry provides request retry functionality that can perform -// configurable exponential backoff for transient errors and honor any -// explicit throttle responses received. -package retry // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/internal/retry" - -import ( - "context" - "fmt" - "time" - - "github.com/cenkalti/backoff/v4" -) - -// DefaultConfig are the recommended defaults to use. -var DefaultConfig = Config{ - Enabled: true, - InitialInterval: 5 * time.Second, - MaxInterval: 30 * time.Second, - MaxElapsedTime: time.Minute, -} - -// Config defines configuration for retrying batches in case of export failure -// using an exponential backoff. -type Config struct { - // Enabled indicates whether to not retry sending batches in case of - // export failure. - Enabled bool - // InitialInterval the time to wait after the first failure before - // retrying. - InitialInterval time.Duration - // MaxInterval is the upper bound on backoff interval. Once this value is - // reached the delay between consecutive retries will always be - // `MaxInterval`. - MaxInterval time.Duration - // MaxElapsedTime is the maximum amount of time (including retries) spent - // trying to send a request/batch. Once this value is reached, the data - // is discarded. - MaxElapsedTime time.Duration -} - -// RequestFunc wraps a request with retry logic. -type RequestFunc func(context.Context, func(context.Context) error) error - -// EvaluateFunc returns if an error is retry-able and if an explicit throttle -// duration should be honored that was included in the error. -// -// The function must return true if the error argument is retry-able, -// otherwise it must return false for the first return parameter. -// -// The function must return a non-zero time.Duration if the error contains -// explicit throttle duration that should be honored, otherwise it must return -// a zero valued time.Duration. -type EvaluateFunc func(error) (bool, time.Duration) - -// RequestFunc returns a RequestFunc using the evaluate function to determine -// if requests can be retried and based on the exponential backoff -// configuration of c. -func (c Config) RequestFunc(evaluate EvaluateFunc) RequestFunc { - if !c.Enabled { - return func(ctx context.Context, fn func(context.Context) error) error { - return fn(ctx) - } - } - - return func(ctx context.Context, fn func(context.Context) error) error { - // Do not use NewExponentialBackOff since it calls Reset and the code here - // must call Reset after changing the InitialInterval (this saves an - // unnecessary call to Now). - b := &backoff.ExponentialBackOff{ - InitialInterval: c.InitialInterval, - RandomizationFactor: backoff.DefaultRandomizationFactor, - Multiplier: backoff.DefaultMultiplier, - MaxInterval: c.MaxInterval, - MaxElapsedTime: c.MaxElapsedTime, - Stop: backoff.Stop, - Clock: backoff.SystemClock, - } - b.Reset() - - for { - err := fn(ctx) - if err == nil { - return nil - } - - retryable, throttle := evaluate(err) - if !retryable { - return err - } - - bOff := b.NextBackOff() - if bOff == backoff.Stop { - return fmt.Errorf("max retry time elapsed: %w", err) - } - - // Wait for the greater of the backoff or throttle delay. - var delay time.Duration - if bOff > throttle { - delay = bOff - } else { - elapsed := b.GetElapsedTime() - if b.MaxElapsedTime != 0 && elapsed+throttle > b.MaxElapsedTime { - return fmt.Errorf("max retry time would elapse: %w", err) - } - delay = throttle - } - - if ctxErr := waitFunc(ctx, delay); ctxErr != nil { - return fmt.Errorf("%w: %s", ctxErr, err) - } - } - } -} - -// Allow override for testing. -var waitFunc = wait - -// wait takes the caller's context, and the amount of time to wait. It will -// return nil if the timer fires before or at the same time as the context's -// deadline. This indicates that the call can be retried. -func wait(ctx context.Context, delay time.Duration) error { - timer := time.NewTimer(delay) - defer timer.Stop() - - select { - case <-ctx.Done(): - // Handle the case where the timer and context deadline end - // simultaneously by prioritizing the timer expiration nil value - // response. - select { - case <-timer.C: - default: - return ctx.Err() - } - case <-timer.C: - } - - return nil -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go deleted file mode 100644 index 10ac73ee3b8e..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/version.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 otlptrace // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace" - -// Version is the current release version of the OpenTelemetry OTLP trace exporter in use. -func Version() string { - return "1.19.0" -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/gen.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/gen.go deleted file mode 100644 index f532f07e9e52..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/gen.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 internal // import "go.opentelemetry.io/otel/internal" - -//go:generate gotmpl --body=./shared/matchers/expectation.go.tmpl "--data={}" --out=matchers/expectation.go -//go:generate gotmpl --body=./shared/matchers/expecter.go.tmpl "--data={}" --out=matchers/expecter.go -//go:generate gotmpl --body=./shared/matchers/temporal_matcher.go.tmpl "--data={}" --out=matchers/temporal_matcher.go - -//go:generate gotmpl --body=./shared/internaltest/alignment.go.tmpl "--data={}" --out=internaltest/alignment.go -//go:generate gotmpl --body=./shared/internaltest/env.go.tmpl "--data={}" --out=internaltest/env.go -//go:generate gotmpl --body=./shared/internaltest/env_test.go.tmpl "--data={}" --out=internaltest/env_test.go -//go:generate gotmpl --body=./shared/internaltest/errors.go.tmpl "--data={}" --out=internaltest/errors.go -//go:generate gotmpl --body=./shared/internaltest/harness.go.tmpl "--data={\"matchersImportPath\": \"go.opentelemetry.io/otel/internal/matchers\"}" --out=internaltest/harness.go -//go:generate gotmpl --body=./shared/internaltest/text_map_carrier.go.tmpl "--data={}" --out=internaltest/text_map_carrier.go -//go:generate gotmpl --body=./shared/internaltest/text_map_carrier_test.go.tmpl "--data={}" --out=internaltest/text_map_carrier_test.go -//go:generate gotmpl --body=./shared/internaltest/text_map_propagator.go.tmpl "--data={}" --out=internaltest/text_map_propagator.go -//go:generate gotmpl --body=./shared/internaltest/text_map_propagator_test.go.tmpl "--data={}" --out=internaltest/text_map_propagator_test.go diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/handler.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/handler.go deleted file mode 100644 index 5e9b83047924..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/handler.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 global // import "go.opentelemetry.io/otel/internal/global" - -import ( - "log" - "os" - "sync/atomic" -) - -var ( - // GlobalErrorHandler provides an ErrorHandler that can be used - // throughout an OpenTelemetry instrumented project. When a user - // specified ErrorHandler is registered (`SetErrorHandler`) all calls to - // `Handle` and will be delegated to the registered ErrorHandler. - GlobalErrorHandler = defaultErrorHandler() - - // Compile-time check that delegator implements ErrorHandler. - _ ErrorHandler = (*ErrDelegator)(nil) - // Compile-time check that errLogger implements ErrorHandler. - _ ErrorHandler = (*ErrLogger)(nil) -) - -// ErrorHandler handles irremediable events. -type ErrorHandler interface { - // Handle handles any error deemed irremediable by an OpenTelemetry - // component. - Handle(error) -} - -type ErrDelegator struct { - delegate atomic.Pointer[ErrorHandler] -} - -func (d *ErrDelegator) Handle(err error) { - d.getDelegate().Handle(err) -} - -func (d *ErrDelegator) getDelegate() ErrorHandler { - return *d.delegate.Load() -} - -// setDelegate sets the ErrorHandler delegate. -func (d *ErrDelegator) setDelegate(eh ErrorHandler) { - d.delegate.Store(&eh) -} - -func defaultErrorHandler() *ErrDelegator { - d := &ErrDelegator{} - d.setDelegate(&ErrLogger{l: log.New(os.Stderr, "", log.LstdFlags)}) - return d -} - -// ErrLogger logs errors if no delegate is set, otherwise they are delegated. -type ErrLogger struct { - l *log.Logger -} - -// Handle logs err if no delegate is set, otherwise it is delegated. -func (h *ErrLogger) Handle(err error) { - h.l.Print(err) -} - -// GetErrorHandler returns the global ErrorHandler instance. -// -// The default ErrorHandler instance returned will log all errors to STDERR -// until an override ErrorHandler is set with SetErrorHandler. All -// ErrorHandler returned prior to this will automatically forward errors to -// the set instance instead of logging. -// -// Subsequent calls to SetErrorHandler after the first will not forward errors -// to the new ErrorHandler for prior returned instances. -func GetErrorHandler() ErrorHandler { - return GlobalErrorHandler -} - -// SetErrorHandler sets the global ErrorHandler to h. -// -// The first time this is called all ErrorHandler previously returned from -// GetErrorHandler will send errors to h instead of the default logging -// ErrorHandler. Subsequent calls will set the global ErrorHandler, but not -// delegate errors to h. -func SetErrorHandler(h ErrorHandler) { - GlobalErrorHandler.setDelegate(h) -} - -// Handle is a convenience function for ErrorHandler().Handle(err). -func Handle(err error) { - GetErrorHandler().Handle(err) -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/instruments.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/instruments.go deleted file mode 100644 index a33eded872a3..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/instruments.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 global // import "go.opentelemetry.io/otel/internal/global" - -import ( - "context" - "sync/atomic" - - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/embedded" -) - -// unwrapper unwraps to return the underlying instrument implementation. -type unwrapper interface { - Unwrap() metric.Observable -} - -type afCounter struct { - embedded.Float64ObservableCounter - metric.Float64Observable - - name string - opts []metric.Float64ObservableCounterOption - - delegate atomic.Value //metric.Float64ObservableCounter -} - -var _ unwrapper = (*afCounter)(nil) -var _ metric.Float64ObservableCounter = (*afCounter)(nil) - -func (i *afCounter) setDelegate(m metric.Meter) { - ctr, err := m.Float64ObservableCounter(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *afCounter) Unwrap() metric.Observable { - if ctr := i.delegate.Load(); ctr != nil { - return ctr.(metric.Float64ObservableCounter) - } - return nil -} - -type afUpDownCounter struct { - embedded.Float64ObservableUpDownCounter - metric.Float64Observable - - name string - opts []metric.Float64ObservableUpDownCounterOption - - delegate atomic.Value //metric.Float64ObservableUpDownCounter -} - -var _ unwrapper = (*afUpDownCounter)(nil) -var _ metric.Float64ObservableUpDownCounter = (*afUpDownCounter)(nil) - -func (i *afUpDownCounter) setDelegate(m metric.Meter) { - ctr, err := m.Float64ObservableUpDownCounter(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *afUpDownCounter) Unwrap() metric.Observable { - if ctr := i.delegate.Load(); ctr != nil { - return ctr.(metric.Float64ObservableUpDownCounter) - } - return nil -} - -type afGauge struct { - embedded.Float64ObservableGauge - metric.Float64Observable - - name string - opts []metric.Float64ObservableGaugeOption - - delegate atomic.Value //metric.Float64ObservableGauge -} - -var _ unwrapper = (*afGauge)(nil) -var _ metric.Float64ObservableGauge = (*afGauge)(nil) - -func (i *afGauge) setDelegate(m metric.Meter) { - ctr, err := m.Float64ObservableGauge(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *afGauge) Unwrap() metric.Observable { - if ctr := i.delegate.Load(); ctr != nil { - return ctr.(metric.Float64ObservableGauge) - } - return nil -} - -type aiCounter struct { - embedded.Int64ObservableCounter - metric.Int64Observable - - name string - opts []metric.Int64ObservableCounterOption - - delegate atomic.Value //metric.Int64ObservableCounter -} - -var _ unwrapper = (*aiCounter)(nil) -var _ metric.Int64ObservableCounter = (*aiCounter)(nil) - -func (i *aiCounter) setDelegate(m metric.Meter) { - ctr, err := m.Int64ObservableCounter(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *aiCounter) Unwrap() metric.Observable { - if ctr := i.delegate.Load(); ctr != nil { - return ctr.(metric.Int64ObservableCounter) - } - return nil -} - -type aiUpDownCounter struct { - embedded.Int64ObservableUpDownCounter - metric.Int64Observable - - name string - opts []metric.Int64ObservableUpDownCounterOption - - delegate atomic.Value //metric.Int64ObservableUpDownCounter -} - -var _ unwrapper = (*aiUpDownCounter)(nil) -var _ metric.Int64ObservableUpDownCounter = (*aiUpDownCounter)(nil) - -func (i *aiUpDownCounter) setDelegate(m metric.Meter) { - ctr, err := m.Int64ObservableUpDownCounter(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *aiUpDownCounter) Unwrap() metric.Observable { - if ctr := i.delegate.Load(); ctr != nil { - return ctr.(metric.Int64ObservableUpDownCounter) - } - return nil -} - -type aiGauge struct { - embedded.Int64ObservableGauge - metric.Int64Observable - - name string - opts []metric.Int64ObservableGaugeOption - - delegate atomic.Value //metric.Int64ObservableGauge -} - -var _ unwrapper = (*aiGauge)(nil) -var _ metric.Int64ObservableGauge = (*aiGauge)(nil) - -func (i *aiGauge) setDelegate(m metric.Meter) { - ctr, err := m.Int64ObservableGauge(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *aiGauge) Unwrap() metric.Observable { - if ctr := i.delegate.Load(); ctr != nil { - return ctr.(metric.Int64ObservableGauge) - } - return nil -} - -// Sync Instruments. -type sfCounter struct { - embedded.Float64Counter - - name string - opts []metric.Float64CounterOption - - delegate atomic.Value //metric.Float64Counter -} - -var _ metric.Float64Counter = (*sfCounter)(nil) - -func (i *sfCounter) setDelegate(m metric.Meter) { - ctr, err := m.Float64Counter(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *sfCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { - if ctr := i.delegate.Load(); ctr != nil { - ctr.(metric.Float64Counter).Add(ctx, incr, opts...) - } -} - -type sfUpDownCounter struct { - embedded.Float64UpDownCounter - - name string - opts []metric.Float64UpDownCounterOption - - delegate atomic.Value //metric.Float64UpDownCounter -} - -var _ metric.Float64UpDownCounter = (*sfUpDownCounter)(nil) - -func (i *sfUpDownCounter) setDelegate(m metric.Meter) { - ctr, err := m.Float64UpDownCounter(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *sfUpDownCounter) Add(ctx context.Context, incr float64, opts ...metric.AddOption) { - if ctr := i.delegate.Load(); ctr != nil { - ctr.(metric.Float64UpDownCounter).Add(ctx, incr, opts...) - } -} - -type sfHistogram struct { - embedded.Float64Histogram - - name string - opts []metric.Float64HistogramOption - - delegate atomic.Value //metric.Float64Histogram -} - -var _ metric.Float64Histogram = (*sfHistogram)(nil) - -func (i *sfHistogram) setDelegate(m metric.Meter) { - ctr, err := m.Float64Histogram(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *sfHistogram) Record(ctx context.Context, x float64, opts ...metric.RecordOption) { - if ctr := i.delegate.Load(); ctr != nil { - ctr.(metric.Float64Histogram).Record(ctx, x, opts...) - } -} - -type siCounter struct { - embedded.Int64Counter - - name string - opts []metric.Int64CounterOption - - delegate atomic.Value //metric.Int64Counter -} - -var _ metric.Int64Counter = (*siCounter)(nil) - -func (i *siCounter) setDelegate(m metric.Meter) { - ctr, err := m.Int64Counter(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *siCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { - if ctr := i.delegate.Load(); ctr != nil { - ctr.(metric.Int64Counter).Add(ctx, x, opts...) - } -} - -type siUpDownCounter struct { - embedded.Int64UpDownCounter - - name string - opts []metric.Int64UpDownCounterOption - - delegate atomic.Value //metric.Int64UpDownCounter -} - -var _ metric.Int64UpDownCounter = (*siUpDownCounter)(nil) - -func (i *siUpDownCounter) setDelegate(m metric.Meter) { - ctr, err := m.Int64UpDownCounter(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *siUpDownCounter) Add(ctx context.Context, x int64, opts ...metric.AddOption) { - if ctr := i.delegate.Load(); ctr != nil { - ctr.(metric.Int64UpDownCounter).Add(ctx, x, opts...) - } -} - -type siHistogram struct { - embedded.Int64Histogram - - name string - opts []metric.Int64HistogramOption - - delegate atomic.Value //metric.Int64Histogram -} - -var _ metric.Int64Histogram = (*siHistogram)(nil) - -func (i *siHistogram) setDelegate(m metric.Meter) { - ctr, err := m.Int64Histogram(i.name, i.opts...) - if err != nil { - GetErrorHandler().Handle(err) - return - } - i.delegate.Store(ctr) -} - -func (i *siHistogram) Record(ctx context.Context, x int64, opts ...metric.RecordOption) { - if ctr := i.delegate.Load(); ctr != nil { - ctr.(metric.Int64Histogram).Record(ctx, x, opts...) - } -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/meter.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/meter.go deleted file mode 100644 index 0097db478c6a..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/internal/global/meter.go +++ /dev/null @@ -1,354 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 global // import "go.opentelemetry.io/otel/internal/global" - -import ( - "container/list" - "sync" - "sync/atomic" - - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/embedded" -) - -// meterProvider is a placeholder for a configured SDK MeterProvider. -// -// All MeterProvider functionality is forwarded to a delegate once -// configured. -type meterProvider struct { - embedded.MeterProvider - - mtx sync.Mutex - meters map[il]*meter - - delegate metric.MeterProvider -} - -// setDelegate configures p to delegate all MeterProvider functionality to -// provider. -// -// All Meters provided prior to this function call are switched out to be -// Meters provided by provider. All instruments and callbacks are recreated and -// delegated. -// -// It is guaranteed by the caller that this happens only once. -func (p *meterProvider) setDelegate(provider metric.MeterProvider) { - p.mtx.Lock() - defer p.mtx.Unlock() - - p.delegate = provider - - if len(p.meters) == 0 { - return - } - - for _, meter := range p.meters { - meter.setDelegate(provider) - } - - p.meters = nil -} - -// Meter implements MeterProvider. -func (p *meterProvider) Meter(name string, opts ...metric.MeterOption) metric.Meter { - p.mtx.Lock() - defer p.mtx.Unlock() - - if p.delegate != nil { - return p.delegate.Meter(name, opts...) - } - - // At this moment it is guaranteed that no sdk is installed, save the meter in the meters map. - - c := metric.NewMeterConfig(opts...) - key := il{ - name: name, - version: c.InstrumentationVersion(), - } - - if p.meters == nil { - p.meters = make(map[il]*meter) - } - - if val, ok := p.meters[key]; ok { - return val - } - - t := &meter{name: name, opts: opts} - p.meters[key] = t - return t -} - -// meter is a placeholder for a metric.Meter. -// -// All Meter functionality is forwarded to a delegate once configured. -// Otherwise, all functionality is forwarded to a NoopMeter. -type meter struct { - embedded.Meter - - name string - opts []metric.MeterOption - - mtx sync.Mutex - instruments []delegatedInstrument - - registry list.List - - delegate atomic.Value // metric.Meter -} - -type delegatedInstrument interface { - setDelegate(metric.Meter) -} - -// setDelegate configures m to delegate all Meter functionality to Meters -// created by provider. -// -// All subsequent calls to the Meter methods will be passed to the delegate. -// -// It is guaranteed by the caller that this happens only once. -func (m *meter) setDelegate(provider metric.MeterProvider) { - meter := provider.Meter(m.name, m.opts...) - m.delegate.Store(meter) - - m.mtx.Lock() - defer m.mtx.Unlock() - - for _, inst := range m.instruments { - inst.setDelegate(meter) - } - - for e := m.registry.Front(); e != nil; e = e.Next() { - r := e.Value.(*registration) - r.setDelegate(meter) - m.registry.Remove(e) - } - - m.instruments = nil - m.registry.Init() -} - -func (m *meter) Int64Counter(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64Counter(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &siCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Int64UpDownCounter(name string, options ...metric.Int64UpDownCounterOption) (metric.Int64UpDownCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64UpDownCounter(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &siUpDownCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Int64Histogram(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64Histogram(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &siHistogram{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Int64ObservableCounter(name string, options ...metric.Int64ObservableCounterOption) (metric.Int64ObservableCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64ObservableCounter(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &aiCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Int64ObservableUpDownCounter(name string, options ...metric.Int64ObservableUpDownCounterOption) (metric.Int64ObservableUpDownCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64ObservableUpDownCounter(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &aiUpDownCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Int64ObservableGauge(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Int64ObservableGauge(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &aiGauge{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Float64Counter(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64Counter(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &sfCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Float64UpDownCounter(name string, options ...metric.Float64UpDownCounterOption) (metric.Float64UpDownCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64UpDownCounter(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &sfUpDownCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Float64Histogram(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64Histogram(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &sfHistogram{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Float64ObservableCounter(name string, options ...metric.Float64ObservableCounterOption) (metric.Float64ObservableCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64ObservableCounter(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &afCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Float64ObservableUpDownCounter(name string, options ...metric.Float64ObservableUpDownCounterOption) (metric.Float64ObservableUpDownCounter, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64ObservableUpDownCounter(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &afUpDownCounter{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -func (m *meter) Float64ObservableGauge(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - return del.Float64ObservableGauge(name, options...) - } - m.mtx.Lock() - defer m.mtx.Unlock() - i := &afGauge{name: name, opts: options} - m.instruments = append(m.instruments, i) - return i, nil -} - -// RegisterCallback captures the function that will be called during Collect. -func (m *meter) RegisterCallback(f metric.Callback, insts ...metric.Observable) (metric.Registration, error) { - if del, ok := m.delegate.Load().(metric.Meter); ok { - insts = unwrapInstruments(insts) - return del.RegisterCallback(f, insts...) - } - - m.mtx.Lock() - defer m.mtx.Unlock() - - reg := ®istration{instruments: insts, function: f} - e := m.registry.PushBack(reg) - reg.unreg = func() error { - m.mtx.Lock() - _ = m.registry.Remove(e) - m.mtx.Unlock() - return nil - } - return reg, nil -} - -type wrapped interface { - unwrap() metric.Observable -} - -func unwrapInstruments(instruments []metric.Observable) []metric.Observable { - out := make([]metric.Observable, 0, len(instruments)) - - for _, inst := range instruments { - if in, ok := inst.(wrapped); ok { - out = append(out, in.unwrap()) - } else { - out = append(out, inst) - } - } - - return out -} - -type registration struct { - embedded.Registration - - instruments []metric.Observable - function metric.Callback - - unreg func() error - unregMu sync.Mutex -} - -func (c *registration) setDelegate(m metric.Meter) { - insts := unwrapInstruments(c.instruments) - - c.unregMu.Lock() - defer c.unregMu.Unlock() - - if c.unreg == nil { - // Unregister already called. - return - } - - reg, err := m.RegisterCallback(c.function, insts...) - if err != nil { - GetErrorHandler().Handle(err) - } - - c.unreg = reg.Unregister -} - -func (c *registration) Unregister() error { - c.unregMu.Lock() - defer c.unregMu.Unlock() - if c.unreg == nil { - // Unregister already called. - return nil - } - - var err error - err, c.unreg = c.unreg(), nil - return err -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric.go deleted file mode 100644 index f955171951fd..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 otel // import "go.opentelemetry.io/otel" - -import ( - "go.opentelemetry.io/otel/internal/global" - "go.opentelemetry.io/otel/metric" -) - -// Meter returns a Meter from the global MeterProvider. The name must be the -// name of the library providing instrumentation. This name may be the same as -// the instrumented code only if that code provides built-in instrumentation. -// If the name is empty, then a implementation defined default name will be -// used instead. -// -// If this is called before a global MeterProvider is registered the returned -// Meter will be a No-op implementation of a Meter. When a global MeterProvider -// is registered for the first time, the returned Meter, and all the -// instruments it has created or will create, are recreated automatically from -// the new MeterProvider. -// -// This is short for GetMeterProvider().Meter(name). -func Meter(name string, opts ...metric.MeterOption) metric.Meter { - return GetMeterProvider().Meter(name, opts...) -} - -// GetMeterProvider returns the registered global meter provider. -// -// If no global GetMeterProvider has been registered, a No-op GetMeterProvider -// implementation is returned. When a global GetMeterProvider is registered for -// the first time, the returned GetMeterProvider, and all the Meters it has -// created or will create, are recreated automatically from the new -// GetMeterProvider. -func GetMeterProvider() metric.MeterProvider { - return global.MeterProvider() -} - -// SetMeterProvider registers mp as the global MeterProvider. -func SetMeterProvider(mp metric.MeterProvider) { - global.SetMeterProvider(mp) -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go deleted file mode 100644 index 072baa8e8d0a..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 metric // import "go.opentelemetry.io/otel/metric" - -import ( - "context" - - "go.opentelemetry.io/otel/metric/embedded" -) - -// Float64Observable describes a set of instruments used asynchronously to -// record float64 measurements once per collection cycle. Observations of -// these instruments are only made within a callback. -// -// Warning: Methods may be added to this interface in minor releases. -type Float64Observable interface { - Observable - - float64Observable() -} - -// Float64ObservableCounter is an instrument used to asynchronously record -// increasing float64 measurements once per collection cycle. Observations are -// only made within a callback for this instrument. The value observed is -// assumed the to be the cumulative sum of the count. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for -// unimplemented methods. -type Float64ObservableCounter interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Float64ObservableCounter - - Float64Observable -} - -// Float64ObservableCounterConfig contains options for asynchronous counter -// instruments that record int64 values. -type Float64ObservableCounterConfig struct { - description string - unit string - callbacks []Float64Callback -} - -// NewFloat64ObservableCounterConfig returns a new -// [Float64ObservableCounterConfig] with all opts applied. -func NewFloat64ObservableCounterConfig(opts ...Float64ObservableCounterOption) Float64ObservableCounterConfig { - var config Float64ObservableCounterConfig - for _, o := range opts { - config = o.applyFloat64ObservableCounter(config) - } - return config -} - -// Description returns the configured description. -func (c Float64ObservableCounterConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Float64ObservableCounterConfig) Unit() string { - return c.unit -} - -// Callbacks returns the configured callbacks. -func (c Float64ObservableCounterConfig) Callbacks() []Float64Callback { - return c.callbacks -} - -// Float64ObservableCounterOption applies options to a -// [Float64ObservableCounterConfig]. See [Float64ObservableOption] and -// [InstrumentOption] for other options that can be used as a -// Float64ObservableCounterOption. -type Float64ObservableCounterOption interface { - applyFloat64ObservableCounter(Float64ObservableCounterConfig) Float64ObservableCounterConfig -} - -// Float64ObservableUpDownCounter is an instrument used to asynchronously -// record float64 measurements once per collection cycle. Observations are only -// made within a callback for this instrument. The value observed is assumed -// the to be the cumulative sum of the count. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Float64ObservableUpDownCounter interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Float64ObservableUpDownCounter - - Float64Observable -} - -// Float64ObservableUpDownCounterConfig contains options for asynchronous -// counter instruments that record int64 values. -type Float64ObservableUpDownCounterConfig struct { - description string - unit string - callbacks []Float64Callback -} - -// NewFloat64ObservableUpDownCounterConfig returns a new -// [Float64ObservableUpDownCounterConfig] with all opts applied. -func NewFloat64ObservableUpDownCounterConfig(opts ...Float64ObservableUpDownCounterOption) Float64ObservableUpDownCounterConfig { - var config Float64ObservableUpDownCounterConfig - for _, o := range opts { - config = o.applyFloat64ObservableUpDownCounter(config) - } - return config -} - -// Description returns the configured description. -func (c Float64ObservableUpDownCounterConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Float64ObservableUpDownCounterConfig) Unit() string { - return c.unit -} - -// Callbacks returns the configured callbacks. -func (c Float64ObservableUpDownCounterConfig) Callbacks() []Float64Callback { - return c.callbacks -} - -// Float64ObservableUpDownCounterOption applies options to a -// [Float64ObservableUpDownCounterConfig]. See [Float64ObservableOption] and -// [InstrumentOption] for other options that can be used as a -// Float64ObservableUpDownCounterOption. -type Float64ObservableUpDownCounterOption interface { - applyFloat64ObservableUpDownCounter(Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig -} - -// Float64ObservableGauge is an instrument used to asynchronously record -// instantaneous float64 measurements once per collection cycle. Observations -// are only made within a callback for this instrument. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Float64ObservableGauge interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Float64ObservableGauge - - Float64Observable -} - -// Float64ObservableGaugeConfig contains options for asynchronous counter -// instruments that record int64 values. -type Float64ObservableGaugeConfig struct { - description string - unit string - callbacks []Float64Callback -} - -// NewFloat64ObservableGaugeConfig returns a new [Float64ObservableGaugeConfig] -// with all opts applied. -func NewFloat64ObservableGaugeConfig(opts ...Float64ObservableGaugeOption) Float64ObservableGaugeConfig { - var config Float64ObservableGaugeConfig - for _, o := range opts { - config = o.applyFloat64ObservableGauge(config) - } - return config -} - -// Description returns the configured description. -func (c Float64ObservableGaugeConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Float64ObservableGaugeConfig) Unit() string { - return c.unit -} - -// Callbacks returns the configured callbacks. -func (c Float64ObservableGaugeConfig) Callbacks() []Float64Callback { - return c.callbacks -} - -// Float64ObservableGaugeOption applies options to a -// [Float64ObservableGaugeConfig]. See [Float64ObservableOption] and -// [InstrumentOption] for other options that can be used as a -// Float64ObservableGaugeOption. -type Float64ObservableGaugeOption interface { - applyFloat64ObservableGauge(Float64ObservableGaugeConfig) Float64ObservableGaugeConfig -} - -// Float64Observer is a recorder of float64 measurements. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Float64Observer interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Float64Observer - - // Observe records the float64 value. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Observe(value float64, options ...ObserveOption) -} - -// Float64Callback is a function registered with a Meter that makes -// observations for a Float64Observerable instrument it is registered with. -// Calls to the Float64Observer record measurement values for the -// Float64Observable. -// -// The function needs to complete in a finite amount of time and the deadline -// of the passed context is expected to be honored. -// -// The function needs to make unique observations across all registered -// Float64Callbacks. Meaning, it should not report measurements with the same -// attributes as another Float64Callbacks also registered for the same -// instrument. -// -// The function needs to be concurrent safe. -type Float64Callback func(context.Context, Float64Observer) error - -// Float64ObservableOption applies options to float64 Observer instruments. -type Float64ObservableOption interface { - Float64ObservableCounterOption - Float64ObservableUpDownCounterOption - Float64ObservableGaugeOption -} - -type float64CallbackOpt struct { - cback Float64Callback -} - -func (o float64CallbackOpt) applyFloat64ObservableCounter(cfg Float64ObservableCounterConfig) Float64ObservableCounterConfig { - cfg.callbacks = append(cfg.callbacks, o.cback) - return cfg -} - -func (o float64CallbackOpt) applyFloat64ObservableUpDownCounter(cfg Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { - cfg.callbacks = append(cfg.callbacks, o.cback) - return cfg -} - -func (o float64CallbackOpt) applyFloat64ObservableGauge(cfg Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { - cfg.callbacks = append(cfg.callbacks, o.cback) - return cfg -} - -// WithFloat64Callback adds callback to be called for an instrument. -func WithFloat64Callback(callback Float64Callback) Float64ObservableOption { - return float64CallbackOpt{callback} -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/asyncint64.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/asyncint64.go deleted file mode 100644 index 9bd6ebf02054..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/asyncint64.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 metric // import "go.opentelemetry.io/otel/metric" - -import ( - "context" - - "go.opentelemetry.io/otel/metric/embedded" -) - -// Int64Observable describes a set of instruments used asynchronously to record -// int64 measurements once per collection cycle. Observations of these -// instruments are only made within a callback. -// -// Warning: Methods may be added to this interface in minor releases. -type Int64Observable interface { - Observable - - int64Observable() -} - -// Int64ObservableCounter is an instrument used to asynchronously record -// increasing int64 measurements once per collection cycle. Observations are -// only made within a callback for this instrument. The value observed is -// assumed the to be the cumulative sum of the count. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Int64ObservableCounter interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Int64ObservableCounter - - Int64Observable -} - -// Int64ObservableCounterConfig contains options for asynchronous counter -// instruments that record int64 values. -type Int64ObservableCounterConfig struct { - description string - unit string - callbacks []Int64Callback -} - -// NewInt64ObservableCounterConfig returns a new [Int64ObservableCounterConfig] -// with all opts applied. -func NewInt64ObservableCounterConfig(opts ...Int64ObservableCounterOption) Int64ObservableCounterConfig { - var config Int64ObservableCounterConfig - for _, o := range opts { - config = o.applyInt64ObservableCounter(config) - } - return config -} - -// Description returns the configured description. -func (c Int64ObservableCounterConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Int64ObservableCounterConfig) Unit() string { - return c.unit -} - -// Callbacks returns the configured callbacks. -func (c Int64ObservableCounterConfig) Callbacks() []Int64Callback { - return c.callbacks -} - -// Int64ObservableCounterOption applies options to a -// [Int64ObservableCounterConfig]. See [Int64ObservableOption] and -// [InstrumentOption] for other options that can be used as an -// Int64ObservableCounterOption. -type Int64ObservableCounterOption interface { - applyInt64ObservableCounter(Int64ObservableCounterConfig) Int64ObservableCounterConfig -} - -// Int64ObservableUpDownCounter is an instrument used to asynchronously record -// int64 measurements once per collection cycle. Observations are only made -// within a callback for this instrument. The value observed is assumed the to -// be the cumulative sum of the count. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Int64ObservableUpDownCounter interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Int64ObservableUpDownCounter - - Int64Observable -} - -// Int64ObservableUpDownCounterConfig contains options for asynchronous counter -// instruments that record int64 values. -type Int64ObservableUpDownCounterConfig struct { - description string - unit string - callbacks []Int64Callback -} - -// NewInt64ObservableUpDownCounterConfig returns a new -// [Int64ObservableUpDownCounterConfig] with all opts applied. -func NewInt64ObservableUpDownCounterConfig(opts ...Int64ObservableUpDownCounterOption) Int64ObservableUpDownCounterConfig { - var config Int64ObservableUpDownCounterConfig - for _, o := range opts { - config = o.applyInt64ObservableUpDownCounter(config) - } - return config -} - -// Description returns the configured description. -func (c Int64ObservableUpDownCounterConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Int64ObservableUpDownCounterConfig) Unit() string { - return c.unit -} - -// Callbacks returns the configured callbacks. -func (c Int64ObservableUpDownCounterConfig) Callbacks() []Int64Callback { - return c.callbacks -} - -// Int64ObservableUpDownCounterOption applies options to a -// [Int64ObservableUpDownCounterConfig]. See [Int64ObservableOption] and -// [InstrumentOption] for other options that can be used as an -// Int64ObservableUpDownCounterOption. -type Int64ObservableUpDownCounterOption interface { - applyInt64ObservableUpDownCounter(Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig -} - -// Int64ObservableGauge is an instrument used to asynchronously record -// instantaneous int64 measurements once per collection cycle. Observations are -// only made within a callback for this instrument. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Int64ObservableGauge interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Int64ObservableGauge - - Int64Observable -} - -// Int64ObservableGaugeConfig contains options for asynchronous counter -// instruments that record int64 values. -type Int64ObservableGaugeConfig struct { - description string - unit string - callbacks []Int64Callback -} - -// NewInt64ObservableGaugeConfig returns a new [Int64ObservableGaugeConfig] -// with all opts applied. -func NewInt64ObservableGaugeConfig(opts ...Int64ObservableGaugeOption) Int64ObservableGaugeConfig { - var config Int64ObservableGaugeConfig - for _, o := range opts { - config = o.applyInt64ObservableGauge(config) - } - return config -} - -// Description returns the configured description. -func (c Int64ObservableGaugeConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Int64ObservableGaugeConfig) Unit() string { - return c.unit -} - -// Callbacks returns the configured callbacks. -func (c Int64ObservableGaugeConfig) Callbacks() []Int64Callback { - return c.callbacks -} - -// Int64ObservableGaugeOption applies options to a -// [Int64ObservableGaugeConfig]. See [Int64ObservableOption] and -// [InstrumentOption] for other options that can be used as an -// Int64ObservableGaugeOption. -type Int64ObservableGaugeOption interface { - applyInt64ObservableGauge(Int64ObservableGaugeConfig) Int64ObservableGaugeConfig -} - -// Int64Observer is a recorder of int64 measurements. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Int64Observer interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Int64Observer - - // Observe records the int64 value. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Observe(value int64, options ...ObserveOption) -} - -// Int64Callback is a function registered with a Meter that makes observations -// for an Int64Observerable instrument it is registered with. Calls to the -// Int64Observer record measurement values for the Int64Observable. -// -// The function needs to complete in a finite amount of time and the deadline -// of the passed context is expected to be honored. -// -// The function needs to make unique observations across all registered -// Int64Callbacks. Meaning, it should not report measurements with the same -// attributes as another Int64Callbacks also registered for the same -// instrument. -// -// The function needs to be concurrent safe. -type Int64Callback func(context.Context, Int64Observer) error - -// Int64ObservableOption applies options to int64 Observer instruments. -type Int64ObservableOption interface { - Int64ObservableCounterOption - Int64ObservableUpDownCounterOption - Int64ObservableGaugeOption -} - -type int64CallbackOpt struct { - cback Int64Callback -} - -func (o int64CallbackOpt) applyInt64ObservableCounter(cfg Int64ObservableCounterConfig) Int64ObservableCounterConfig { - cfg.callbacks = append(cfg.callbacks, o.cback) - return cfg -} - -func (o int64CallbackOpt) applyInt64ObservableUpDownCounter(cfg Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { - cfg.callbacks = append(cfg.callbacks, o.cback) - return cfg -} - -func (o int64CallbackOpt) applyInt64ObservableGauge(cfg Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { - cfg.callbacks = append(cfg.callbacks, o.cback) - return cfg -} - -// WithInt64Callback adds callback to be called for an instrument. -func WithInt64Callback(callback Int64Callback) Int64ObservableOption { - return int64CallbackOpt{callback} -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go deleted file mode 100644 index ae0bdbd2e645..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 embedded provides interfaces embedded within the [OpenTelemetry -// metric API]. -// -// Implementers of the [OpenTelemetry metric API] can embed the relevant type -// from this package into their implementation directly. Doing so will result -// in a compilation error for users when the [OpenTelemetry metric API] is -// extended (which is something that can happen without a major version bump of -// the API package). -// -// [OpenTelemetry metric API]: https://pkg.go.dev/go.opentelemetry.io/otel/metric -package embedded // import "go.opentelemetry.io/otel/metric/embedded" - -// MeterProvider is embedded in -// [go.opentelemetry.io/otel/metric.MeterProvider]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.MeterProvider] if you want users to -// experience a compilation error, signaling they need to update to your latest -// implementation, when the [go.opentelemetry.io/otel/metric.MeterProvider] -// interface is extended (which is something that can happen without a major -// version bump of the API package). -type MeterProvider interface{ meterProvider() } - -// Meter is embedded in [go.opentelemetry.io/otel/metric.Meter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Meter] if you want users to experience a -// compilation error, signaling they need to update to your latest -// implementation, when the [go.opentelemetry.io/otel/metric.Meter] interface -// is extended (which is something that can happen without a major version bump -// of the API package). -type Meter interface{ meter() } - -// Float64Observer is embedded in -// [go.opentelemetry.io/otel/metric.Float64Observer]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Float64Observer] if you want -// users to experience a compilation error, signaling they need to update to -// your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Float64Observer] interface is -// extended (which is something that can happen without a major version bump of -// the API package). -type Float64Observer interface{ float64Observer() } - -// Int64Observer is embedded in -// [go.opentelemetry.io/otel/metric.Int64Observer]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Int64Observer] if you want users -// to experience a compilation error, signaling they need to update to your -// latest implementation, when the -// [go.opentelemetry.io/otel/metric.Int64Observer] interface is -// extended (which is something that can happen without a major version bump of -// the API package). -type Int64Observer interface{ int64Observer() } - -// Observer is embedded in [go.opentelemetry.io/otel/metric.Observer]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Observer] if you want users to experience a -// compilation error, signaling they need to update to your latest -// implementation, when the [go.opentelemetry.io/otel/metric.Observer] -// interface is extended (which is something that can happen without a major -// version bump of the API package). -type Observer interface{ observer() } - -// Registration is embedded in [go.opentelemetry.io/otel/metric.Registration]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Registration] if you want users to -// experience a compilation error, signaling they need to update to your latest -// implementation, when the [go.opentelemetry.io/otel/metric.Registration] -// interface is extended (which is something that can happen without a major -// version bump of the API package). -type Registration interface{ registration() } - -// Float64Counter is embedded in -// [go.opentelemetry.io/otel/metric.Float64Counter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Float64Counter] if you want -// users to experience a compilation error, signaling they need to update to -// your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Float64Counter] interface is -// extended (which is something that can happen without a major version bump of -// the API package). -type Float64Counter interface{ float64Counter() } - -// Float64Histogram is embedded in -// [go.opentelemetry.io/otel/metric.Float64Histogram]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Float64Histogram] if you want -// users to experience a compilation error, signaling they need to update to -// your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Float64Histogram] interface is -// extended (which is something that can happen without a major version bump of -// the API package). -type Float64Histogram interface{ float64Histogram() } - -// Float64ObservableCounter is embedded in -// [go.opentelemetry.io/otel/metric.Float64ObservableCounter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Float64ObservableCounter] if you -// want users to experience a compilation error, signaling they need to update -// to your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Float64ObservableCounter] -// interface is extended (which is something that can happen without a major -// version bump of the API package). -type Float64ObservableCounter interface{ float64ObservableCounter() } - -// Float64ObservableGauge is embedded in -// [go.opentelemetry.io/otel/metric.Float64ObservableGauge]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Float64ObservableGauge] if you -// want users to experience a compilation error, signaling they need to update -// to your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Float64ObservableGauge] -// interface is extended (which is something that can happen without a major -// version bump of the API package). -type Float64ObservableGauge interface{ float64ObservableGauge() } - -// Float64ObservableUpDownCounter is embedded in -// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] -// if you want users to experience a compilation error, signaling they need to -// update to your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Float64ObservableUpDownCounter] -// interface is extended (which is something that can happen without a major -// version bump of the API package). -type Float64ObservableUpDownCounter interface{ float64ObservableUpDownCounter() } - -// Float64UpDownCounter is embedded in -// [go.opentelemetry.io/otel/metric.Float64UpDownCounter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Float64UpDownCounter] if you -// want users to experience a compilation error, signaling they need to update -// to your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Float64UpDownCounter] interface -// is extended (which is something that can happen without a major version bump -// of the API package). -type Float64UpDownCounter interface{ float64UpDownCounter() } - -// Int64Counter is embedded in -// [go.opentelemetry.io/otel/metric.Int64Counter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Int64Counter] if you want users -// to experience a compilation error, signaling they need to update to your -// latest implementation, when the -// [go.opentelemetry.io/otel/metric.Int64Counter] interface is -// extended (which is something that can happen without a major version bump of -// the API package). -type Int64Counter interface{ int64Counter() } - -// Int64Histogram is embedded in -// [go.opentelemetry.io/otel/metric.Int64Histogram]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Int64Histogram] if you want -// users to experience a compilation error, signaling they need to update to -// your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Int64Histogram] interface is -// extended (which is something that can happen without a major version bump of -// the API package). -type Int64Histogram interface{ int64Histogram() } - -// Int64ObservableCounter is embedded in -// [go.opentelemetry.io/otel/metric.Int64ObservableCounter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Int64ObservableCounter] if you -// want users to experience a compilation error, signaling they need to update -// to your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Int64ObservableCounter] -// interface is extended (which is something that can happen without a major -// version bump of the API package). -type Int64ObservableCounter interface{ int64ObservableCounter() } - -// Int64ObservableGauge is embedded in -// [go.opentelemetry.io/otel/metric.Int64ObservableGauge]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Int64ObservableGauge] if you -// want users to experience a compilation error, signaling they need to update -// to your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Int64ObservableGauge] interface -// is extended (which is something that can happen without a major version bump -// of the API package). -type Int64ObservableGauge interface{ int64ObservableGauge() } - -// Int64ObservableUpDownCounter is embedded in -// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] if -// you want users to experience a compilation error, signaling they need to -// update to your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Int64ObservableUpDownCounter] -// interface is extended (which is something that can happen without a major -// version bump of the API package). -type Int64ObservableUpDownCounter interface{ int64ObservableUpDownCounter() } - -// Int64UpDownCounter is embedded in -// [go.opentelemetry.io/otel/metric.Int64UpDownCounter]. -// -// Embed this interface in your implementation of the -// [go.opentelemetry.io/otel/metric.Int64UpDownCounter] if you want -// users to experience a compilation error, signaling they need to update to -// your latest implementation, when the -// [go.opentelemetry.io/otel/metric.Int64UpDownCounter] interface is -// extended (which is something that can happen without a major version bump of -// the API package). -type Int64UpDownCounter interface{ int64UpDownCounter() } diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/instrument.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/instrument.go deleted file mode 100644 index cdca00058c68..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/instrument.go +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 metric // import "go.opentelemetry.io/otel/metric" - -import "go.opentelemetry.io/otel/attribute" - -// Observable is used as a grouping mechanism for all instruments that are -// updated within a Callback. -type Observable interface { - observable() -} - -// InstrumentOption applies options to all instruments. -type InstrumentOption interface { - Int64CounterOption - Int64UpDownCounterOption - Int64HistogramOption - Int64ObservableCounterOption - Int64ObservableUpDownCounterOption - Int64ObservableGaugeOption - - Float64CounterOption - Float64UpDownCounterOption - Float64HistogramOption - Float64ObservableCounterOption - Float64ObservableUpDownCounterOption - Float64ObservableGaugeOption -} - -type descOpt string - -func (o descOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { - c.description = string(o) - return c -} - -func (o descOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { - c.description = string(o) - return c -} - -// WithDescription sets the instrument description. -func WithDescription(desc string) InstrumentOption { return descOpt(desc) } - -type unitOpt string - -func (o unitOpt) applyFloat64Counter(c Float64CounterConfig) Float64CounterConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyFloat64UpDownCounter(c Float64UpDownCounterConfig) Float64UpDownCounterConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyFloat64Histogram(c Float64HistogramConfig) Float64HistogramConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyFloat64ObservableCounter(c Float64ObservableCounterConfig) Float64ObservableCounterConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyFloat64ObservableUpDownCounter(c Float64ObservableUpDownCounterConfig) Float64ObservableUpDownCounterConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyFloat64ObservableGauge(c Float64ObservableGaugeConfig) Float64ObservableGaugeConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyInt64Counter(c Int64CounterConfig) Int64CounterConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyInt64UpDownCounter(c Int64UpDownCounterConfig) Int64UpDownCounterConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyInt64Histogram(c Int64HistogramConfig) Int64HistogramConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyInt64ObservableCounter(c Int64ObservableCounterConfig) Int64ObservableCounterConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyInt64ObservableUpDownCounter(c Int64ObservableUpDownCounterConfig) Int64ObservableUpDownCounterConfig { - c.unit = string(o) - return c -} - -func (o unitOpt) applyInt64ObservableGauge(c Int64ObservableGaugeConfig) Int64ObservableGaugeConfig { - c.unit = string(o) - return c -} - -// WithUnit sets the instrument unit. -// -// The unit u should be defined using the appropriate [UCUM](https://ucum.org) case-sensitive code. -func WithUnit(u string) InstrumentOption { return unitOpt(u) } - -// AddOption applies options to an addition measurement. See -// [MeasurementOption] for other options that can be used as an AddOption. -type AddOption interface { - applyAdd(AddConfig) AddConfig -} - -// AddConfig contains options for an addition measurement. -type AddConfig struct { - attrs attribute.Set -} - -// NewAddConfig returns a new [AddConfig] with all opts applied. -func NewAddConfig(opts []AddOption) AddConfig { - config := AddConfig{attrs: *attribute.EmptySet()} - for _, o := range opts { - config = o.applyAdd(config) - } - return config -} - -// Attributes returns the configured attribute set. -func (c AddConfig) Attributes() attribute.Set { - return c.attrs -} - -// RecordOption applies options to an addition measurement. See -// [MeasurementOption] for other options that can be used as a RecordOption. -type RecordOption interface { - applyRecord(RecordConfig) RecordConfig -} - -// RecordConfig contains options for a recorded measurement. -type RecordConfig struct { - attrs attribute.Set -} - -// NewRecordConfig returns a new [RecordConfig] with all opts applied. -func NewRecordConfig(opts []RecordOption) RecordConfig { - config := RecordConfig{attrs: *attribute.EmptySet()} - for _, o := range opts { - config = o.applyRecord(config) - } - return config -} - -// Attributes returns the configured attribute set. -func (c RecordConfig) Attributes() attribute.Set { - return c.attrs -} - -// ObserveOption applies options to an addition measurement. See -// [MeasurementOption] for other options that can be used as a ObserveOption. -type ObserveOption interface { - applyObserve(ObserveConfig) ObserveConfig -} - -// ObserveConfig contains options for an observed measurement. -type ObserveConfig struct { - attrs attribute.Set -} - -// NewObserveConfig returns a new [ObserveConfig] with all opts applied. -func NewObserveConfig(opts []ObserveOption) ObserveConfig { - config := ObserveConfig{attrs: *attribute.EmptySet()} - for _, o := range opts { - config = o.applyObserve(config) - } - return config -} - -// Attributes returns the configured attribute set. -func (c ObserveConfig) Attributes() attribute.Set { - return c.attrs -} - -// MeasurementOption applies options to all instrument measurement. -type MeasurementOption interface { - AddOption - RecordOption - ObserveOption -} - -type attrOpt struct { - set attribute.Set -} - -// mergeSets returns the union of keys between a and b. Any duplicate keys will -// use the value associated with b. -func mergeSets(a, b attribute.Set) attribute.Set { - // NewMergeIterator uses the first value for any duplicates. - iter := attribute.NewMergeIterator(&b, &a) - merged := make([]attribute.KeyValue, 0, a.Len()+b.Len()) - for iter.Next() { - merged = append(merged, iter.Attribute()) - } - return attribute.NewSet(merged...) -} - -func (o attrOpt) applyAdd(c AddConfig) AddConfig { - switch { - case o.set.Len() == 0: - case c.attrs.Len() == 0: - c.attrs = o.set - default: - c.attrs = mergeSets(c.attrs, o.set) - } - return c -} - -func (o attrOpt) applyRecord(c RecordConfig) RecordConfig { - switch { - case o.set.Len() == 0: - case c.attrs.Len() == 0: - c.attrs = o.set - default: - c.attrs = mergeSets(c.attrs, o.set) - } - return c -} - -func (o attrOpt) applyObserve(c ObserveConfig) ObserveConfig { - switch { - case o.set.Len() == 0: - case c.attrs.Len() == 0: - c.attrs = o.set - default: - c.attrs = mergeSets(c.attrs, o.set) - } - return c -} - -// WithAttributeSet sets the attribute Set associated with a measurement is -// made with. -// -// If multiple WithAttributeSet or WithAttributes options are passed the -// attributes will be merged together in the order they are passed. Attributes -// with duplicate keys will use the last value passed. -func WithAttributeSet(attributes attribute.Set) MeasurementOption { - return attrOpt{set: attributes} -} - -// WithAttributes converts attributes into an attribute Set and sets the Set to -// be associated with a measurement. This is shorthand for: -// -// cp := make([]attribute.KeyValue, len(attributes)) -// copy(cp, attributes) -// WithAttributes(attribute.NewSet(cp...)) -// -// [attribute.NewSet] may modify the passed attributes so this will make a copy -// of attributes before creating a set in order to ensure this function is -// concurrent safe. This makes this option function less optimized in -// comparison to [WithAttributeSet]. Therefore, [WithAttributeSet] should be -// preferred for performance sensitive code. -// -// See [WithAttributeSet] for information about how multiple WithAttributes are -// merged. -func WithAttributes(attributes ...attribute.KeyValue) MeasurementOption { - cp := make([]attribute.KeyValue, len(attributes)) - copy(cp, attributes) - return attrOpt{set: attribute.NewSet(cp...)} -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go deleted file mode 100644 index f0b063721d81..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/syncfloat64.go +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 metric // import "go.opentelemetry.io/otel/metric" - -import ( - "context" - - "go.opentelemetry.io/otel/metric/embedded" -) - -// Float64Counter is an instrument that records increasing float64 values. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Float64Counter interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Float64Counter - - // Add records a change to the counter. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Add(ctx context.Context, incr float64, options ...AddOption) -} - -// Float64CounterConfig contains options for synchronous counter instruments that -// record int64 values. -type Float64CounterConfig struct { - description string - unit string -} - -// NewFloat64CounterConfig returns a new [Float64CounterConfig] with all opts -// applied. -func NewFloat64CounterConfig(opts ...Float64CounterOption) Float64CounterConfig { - var config Float64CounterConfig - for _, o := range opts { - config = o.applyFloat64Counter(config) - } - return config -} - -// Description returns the configured description. -func (c Float64CounterConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Float64CounterConfig) Unit() string { - return c.unit -} - -// Float64CounterOption applies options to a [Float64CounterConfig]. See -// [InstrumentOption] for other options that can be used as a -// Float64CounterOption. -type Float64CounterOption interface { - applyFloat64Counter(Float64CounterConfig) Float64CounterConfig -} - -// Float64UpDownCounter is an instrument that records increasing or decreasing -// float64 values. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Float64UpDownCounter interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Float64UpDownCounter - - // Add records a change to the counter. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Add(ctx context.Context, incr float64, options ...AddOption) -} - -// Float64UpDownCounterConfig contains options for synchronous counter -// instruments that record int64 values. -type Float64UpDownCounterConfig struct { - description string - unit string -} - -// NewFloat64UpDownCounterConfig returns a new [Float64UpDownCounterConfig] -// with all opts applied. -func NewFloat64UpDownCounterConfig(opts ...Float64UpDownCounterOption) Float64UpDownCounterConfig { - var config Float64UpDownCounterConfig - for _, o := range opts { - config = o.applyFloat64UpDownCounter(config) - } - return config -} - -// Description returns the configured description. -func (c Float64UpDownCounterConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Float64UpDownCounterConfig) Unit() string { - return c.unit -} - -// Float64UpDownCounterOption applies options to a -// [Float64UpDownCounterConfig]. See [InstrumentOption] for other options that -// can be used as a Float64UpDownCounterOption. -type Float64UpDownCounterOption interface { - applyFloat64UpDownCounter(Float64UpDownCounterConfig) Float64UpDownCounterConfig -} - -// Float64Histogram is an instrument that records a distribution of float64 -// values. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Float64Histogram interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Float64Histogram - - // Record adds an additional value to the distribution. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Record(ctx context.Context, incr float64, options ...RecordOption) -} - -// Float64HistogramConfig contains options for synchronous counter instruments -// that record int64 values. -type Float64HistogramConfig struct { - description string - unit string -} - -// NewFloat64HistogramConfig returns a new [Float64HistogramConfig] with all -// opts applied. -func NewFloat64HistogramConfig(opts ...Float64HistogramOption) Float64HistogramConfig { - var config Float64HistogramConfig - for _, o := range opts { - config = o.applyFloat64Histogram(config) - } - return config -} - -// Description returns the configured description. -func (c Float64HistogramConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Float64HistogramConfig) Unit() string { - return c.unit -} - -// Float64HistogramOption applies options to a [Float64HistogramConfig]. See -// [InstrumentOption] for other options that can be used as a -// Float64HistogramOption. -type Float64HistogramOption interface { - applyFloat64Histogram(Float64HistogramConfig) Float64HistogramConfig -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/syncint64.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/syncint64.go deleted file mode 100644 index 6f508eb66d40..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/metric/syncint64.go +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 metric // import "go.opentelemetry.io/otel/metric" - -import ( - "context" - - "go.opentelemetry.io/otel/metric/embedded" -) - -// Int64Counter is an instrument that records increasing int64 values. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Int64Counter interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Int64Counter - - // Add records a change to the counter. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Add(ctx context.Context, incr int64, options ...AddOption) -} - -// Int64CounterConfig contains options for synchronous counter instruments that -// record int64 values. -type Int64CounterConfig struct { - description string - unit string -} - -// NewInt64CounterConfig returns a new [Int64CounterConfig] with all opts -// applied. -func NewInt64CounterConfig(opts ...Int64CounterOption) Int64CounterConfig { - var config Int64CounterConfig - for _, o := range opts { - config = o.applyInt64Counter(config) - } - return config -} - -// Description returns the configured description. -func (c Int64CounterConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Int64CounterConfig) Unit() string { - return c.unit -} - -// Int64CounterOption applies options to a [Int64CounterConfig]. See -// [InstrumentOption] for other options that can be used as an -// Int64CounterOption. -type Int64CounterOption interface { - applyInt64Counter(Int64CounterConfig) Int64CounterConfig -} - -// Int64UpDownCounter is an instrument that records increasing or decreasing -// int64 values. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Int64UpDownCounter interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Int64UpDownCounter - - // Add records a change to the counter. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Add(ctx context.Context, incr int64, options ...AddOption) -} - -// Int64UpDownCounterConfig contains options for synchronous counter -// instruments that record int64 values. -type Int64UpDownCounterConfig struct { - description string - unit string -} - -// NewInt64UpDownCounterConfig returns a new [Int64UpDownCounterConfig] with -// all opts applied. -func NewInt64UpDownCounterConfig(opts ...Int64UpDownCounterOption) Int64UpDownCounterConfig { - var config Int64UpDownCounterConfig - for _, o := range opts { - config = o.applyInt64UpDownCounter(config) - } - return config -} - -// Description returns the configured description. -func (c Int64UpDownCounterConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Int64UpDownCounterConfig) Unit() string { - return c.unit -} - -// Int64UpDownCounterOption applies options to a [Int64UpDownCounterConfig]. -// See [InstrumentOption] for other options that can be used as an -// Int64UpDownCounterOption. -type Int64UpDownCounterOption interface { - applyInt64UpDownCounter(Int64UpDownCounterConfig) Int64UpDownCounterConfig -} - -// Int64Histogram is an instrument that records a distribution of int64 -// values. -// -// Warning: Methods may be added to this interface in minor releases. See -// package documentation on API implementation for information on how to set -// default behavior for unimplemented methods. -type Int64Histogram interface { - // Users of the interface can ignore this. This embedded type is only used - // by implementations of this interface. See the "API Implementations" - // section of the package documentation for more information. - embedded.Int64Histogram - - // Record adds an additional value to the distribution. - // - // Use the WithAttributeSet (or, if performance is not a concern, - // the WithAttributes) option to include measurement attributes. - Record(ctx context.Context, incr int64, options ...RecordOption) -} - -// Int64HistogramConfig contains options for synchronous counter instruments -// that record int64 values. -type Int64HistogramConfig struct { - description string - unit string -} - -// NewInt64HistogramConfig returns a new [Int64HistogramConfig] with all opts -// applied. -func NewInt64HistogramConfig(opts ...Int64HistogramOption) Int64HistogramConfig { - var config Int64HistogramConfig - for _, o := range opts { - config = o.applyInt64Histogram(config) - } - return config -} - -// Description returns the configured description. -func (c Int64HistogramConfig) Description() string { - return c.description -} - -// Unit returns the configured unit. -func (c Int64HistogramConfig) Unit() string { - return c.unit -} - -// Int64HistogramOption applies options to a [Int64HistogramConfig]. See -// [InstrumentOption] for other options that can be used as an -// Int64HistogramOption. -type Int64HistogramOption interface { - applyInt64Histogram(Int64HistogramConfig) Int64HistogramConfig -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/requirements.txt b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/requirements.txt deleted file mode 100644 index ddff454685c8..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -codespell==2.2.5 diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go deleted file mode 100644 index bd84f624b45d..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/internal/gen.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 internal // import "go.opentelemetry.io/otel/sdk/internal" - -//go:generate gotmpl --body=../../internal/shared/matchers/expectation.go.tmpl "--data={}" --out=matchers/expectation.go -//go:generate gotmpl --body=../../internal/shared/matchers/expecter.go.tmpl "--data={}" --out=matchers/expecter.go -//go:generate gotmpl --body=../../internal/shared/matchers/temporal_matcher.go.tmpl "--data={}" --out=matchers/temporal_matcher.go - -//go:generate gotmpl --body=../../internal/shared/internaltest/alignment.go.tmpl "--data={}" --out=internaltest/alignment.go -//go:generate gotmpl --body=../../internal/shared/internaltest/env.go.tmpl "--data={}" --out=internaltest/env.go -//go:generate gotmpl --body=../../internal/shared/internaltest/env_test.go.tmpl "--data={}" --out=internaltest/env_test.go -//go:generate gotmpl --body=../../internal/shared/internaltest/errors.go.tmpl "--data={}" --out=internaltest/errors.go -//go:generate gotmpl --body=../../internal/shared/internaltest/harness.go.tmpl "--data={\"matchersImportPath\": \"go.opentelemetry.io/otel/sdk/internal/matchers\"}" --out=internaltest/harness.go -//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_carrier.go.tmpl "--data={}" --out=internaltest/text_map_carrier.go -//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_carrier_test.go.tmpl "--data={}" --out=internaltest/text_map_carrier_test.go -//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_propagator.go.tmpl "--data={}" --out=internaltest/text_map_propagator.go -//go:generate gotmpl --body=../../internal/shared/internaltest/text_map_propagator_test.go.tmpl "--data={}" --out=internaltest/text_map_propagator_test.go diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go deleted file mode 100644 index fb1ebf2cab29..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 resource // import "go.opentelemetry.io/otel/sdk/resource" - -import ( - "context" - "errors" - "strings" - - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" -) - -type hostIDProvider func() (string, error) - -var defaultHostIDProvider hostIDProvider = platformHostIDReader.read - -var hostID = defaultHostIDProvider - -type hostIDReader interface { - read() (string, error) -} - -type fileReader func(string) (string, error) - -type commandExecutor func(string, ...string) (string, error) - -// hostIDReaderBSD implements hostIDReader. -type hostIDReaderBSD struct { - execCommand commandExecutor - readFile fileReader -} - -// read attempts to read the machine-id from /etc/hostid. If not found it will -// execute `kenv -q smbios.system.uuid`. If neither location yields an id an -// error will be returned. -func (r *hostIDReaderBSD) read() (string, error) { - if result, err := r.readFile("/etc/hostid"); err == nil { - return strings.TrimSpace(result), nil - } - - if result, err := r.execCommand("kenv", "-q", "smbios.system.uuid"); err == nil { - return strings.TrimSpace(result), nil - } - - return "", errors.New("host id not found in: /etc/hostid or kenv") -} - -// hostIDReaderDarwin implements hostIDReader. -type hostIDReaderDarwin struct { - execCommand commandExecutor -} - -// read executes `ioreg -rd1 -c "IOPlatformExpertDevice"` and parses host id -// from the IOPlatformUUID line. If the command fails or the uuid cannot be -// parsed an error will be returned. -func (r *hostIDReaderDarwin) read() (string, error) { - result, err := r.execCommand("ioreg", "-rd1", "-c", "IOPlatformExpertDevice") - if err != nil { - return "", err - } - - lines := strings.Split(result, "\n") - for _, line := range lines { - if strings.Contains(line, "IOPlatformUUID") { - parts := strings.Split(line, " = ") - if len(parts) == 2 { - return strings.Trim(parts[1], "\""), nil - } - break - } - } - - return "", errors.New("could not parse IOPlatformUUID") -} - -type hostIDReaderLinux struct { - readFile fileReader -} - -// read attempts to read the machine-id from /etc/machine-id followed by -// /var/lib/dbus/machine-id. If neither location yields an ID an error will -// be returned. -func (r *hostIDReaderLinux) read() (string, error) { - if result, err := r.readFile("/etc/machine-id"); err == nil { - return strings.TrimSpace(result), nil - } - - if result, err := r.readFile("/var/lib/dbus/machine-id"); err == nil { - return strings.TrimSpace(result), nil - } - - return "", errors.New("host id not found in: /etc/machine-id or /var/lib/dbus/machine-id") -} - -type hostIDDetector struct{} - -// Detect returns a *Resource containing the platform specific host id. -func (hostIDDetector) Detect(ctx context.Context) (*Resource, error) { - hostID, err := hostID() - if err != nil { - return nil, err - } - - return NewWithAttributes( - semconv.SchemaURL, - semconv.HostID(hostID), - ), nil -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go deleted file mode 100644 index 1778bbacf059..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 dragonfly || freebsd || netbsd || openbsd || solaris -// +build dragonfly freebsd netbsd openbsd solaris - -package resource // import "go.opentelemetry.io/otel/sdk/resource" - -var platformHostIDReader hostIDReader = &hostIDReaderBSD{ - execCommand: execCommand, - readFile: readFile, -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go deleted file mode 100644 index ba41409b23ca..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 resource // import "go.opentelemetry.io/otel/sdk/resource" - -var platformHostIDReader hostIDReader = &hostIDReaderDarwin{ - execCommand: execCommand, -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go deleted file mode 100644 index 207acb0ed3aa..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 darwin || dragonfly || freebsd || netbsd || openbsd || solaris - -package resource // import "go.opentelemetry.io/otel/sdk/resource" - -import "os/exec" - -func execCommand(name string, arg ...string) (string, error) { - cmd := exec.Command(name, arg...) - b, err := cmd.Output() - if err != nil { - return "", err - } - - return string(b), nil -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go deleted file mode 100644 index 410579b8fc97..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 linux -// +build linux - -package resource // import "go.opentelemetry.io/otel/sdk/resource" - -var platformHostIDReader hostIDReader = &hostIDReaderLinux{ - readFile: readFile, -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go deleted file mode 100644 index 721e3ca6e7d3..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 linux || dragonfly || freebsd || netbsd || openbsd || solaris - -package resource // import "go.opentelemetry.io/otel/sdk/resource" - -import "os" - -func readFile(filename string) (string, error) { - b, err := os.ReadFile(filename) - if err != nil { - return "", err - } - - return string(b), nil -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go deleted file mode 100644 index 89df9d6882e5..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build !darwin -// +build !dragonfly -// +build !freebsd -// +build !linux -// +build !netbsd -// +build !openbsd -// +build !solaris -// +build !windows - -package resource // import "go.opentelemetry.io/otel/sdk/resource" - -// hostIDReaderUnsupported is a placeholder implementation for operating systems -// for which this project currently doesn't support host.id -// attribute detection. See build tags declaration early on this file -// for a list of unsupported OSes. -type hostIDReaderUnsupported struct{} - -func (*hostIDReaderUnsupported) read() (string, error) { - return "", nil -} - -var platformHostIDReader hostIDReader = &hostIDReaderUnsupported{} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go deleted file mode 100644 index 5b431c6ee6e3..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 windows -// +build windows - -package resource // import "go.opentelemetry.io/otel/sdk/resource" - -import ( - "golang.org/x/sys/windows/registry" -) - -// implements hostIDReader -type hostIDReaderWindows struct{} - -// read reads MachineGuid from the windows registry key: -// SOFTWARE\Microsoft\Cryptography -func (*hostIDReaderWindows) read() (string, error) { - k, err := registry.OpenKey( - registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Cryptography`, - registry.QUERY_VALUE|registry.WOW64_64KEY, - ) - - if err != nil { - return "", err - } - defer k.Close() - - guid, _, err := k.GetStringValue("MachineGuid") - if err != nil { - return "", err - } - - return guid, nil -} - -var platformHostIDReader hostIDReader = &hostIDReaderWindows{} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/version.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/version.go deleted file mode 100644 index d3457ed1355a..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/trace/version.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 trace // import "go.opentelemetry.io/otel/sdk/trace" - -// version is the current release version of the metric SDK in use. -func version() string { - return "1.16.0-rc.1" -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/version.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/version.go deleted file mode 100644 index 72d2cb09f7bf..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/sdk/version.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 sdk // import "go.opentelemetry.io/otel/sdk" - -// Version is the current release version of the OpenTelemetry SDK in use. -func Version() string { - return "1.19.0" -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go deleted file mode 100644 index e6cf89510536..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go +++ /dev/null @@ -1,1877 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -import "go.opentelemetry.io/otel/attribute" - -// These attributes may be used to describe the client in a connection-based -// network interaction where there is one side that initiates the connection -// (the client is the side that initiates the connection). This covers all TCP -// network interactions since TCP is connection-based and one side initiates -// the connection (an exception is made for peer-to-peer communication over TCP -// where the "user-facing" surface of the protocol / API does not expose a -// clear notion of client and server). This also covers UDP network -// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) -// and DNS. -const ( - // ClientAddressKey is the attribute Key conforming to the "client.address" - // semantic conventions. It represents the client address - unix domain - // socket name, IPv4 or IPv6 address. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/tmp/my.sock', '10.1.2.80' - // Note: When observed from the server side, and when communicating through - // an intermediary, `client.address` SHOULD represent client address behind - // any intermediaries (e.g. proxies) if it's available. - ClientAddressKey = attribute.Key("client.address") - - // ClientPortKey is the attribute Key conforming to the "client.port" - // semantic conventions. It represents the client port number - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 65123 - // Note: When observed from the server side, and when communicating through - // an intermediary, `client.port` SHOULD represent client port behind any - // intermediaries (e.g. proxies) if it's available. - ClientPortKey = attribute.Key("client.port") - - // ClientSocketAddressKey is the attribute Key conforming to the - // "client.socket.address" semantic conventions. It represents the - // immediate client peer address - unix domain socket name, IPv4 or IPv6 - // address. - // - // Type: string - // RequirementLevel: Recommended (If different than `client.address`.) - // Stability: stable - // Examples: '/tmp/my.sock', '127.0.0.1' - ClientSocketAddressKey = attribute.Key("client.socket.address") - - // ClientSocketPortKey is the attribute Key conforming to the - // "client.socket.port" semantic conventions. It represents the immediate - // client peer port number - // - // Type: int - // RequirementLevel: Recommended (If different than `client.port`.) - // Stability: stable - // Examples: 35555 - ClientSocketPortKey = attribute.Key("client.socket.port") -) - -// ClientAddress returns an attribute KeyValue conforming to the -// "client.address" semantic conventions. It represents the client address - -// unix domain socket name, IPv4 or IPv6 address. -func ClientAddress(val string) attribute.KeyValue { - return ClientAddressKey.String(val) -} - -// ClientPort returns an attribute KeyValue conforming to the "client.port" -// semantic conventions. It represents the client port number -func ClientPort(val int) attribute.KeyValue { - return ClientPortKey.Int(val) -} - -// ClientSocketAddress returns an attribute KeyValue conforming to the -// "client.socket.address" semantic conventions. It represents the immediate -// client peer address - unix domain socket name, IPv4 or IPv6 address. -func ClientSocketAddress(val string) attribute.KeyValue { - return ClientSocketAddressKey.String(val) -} - -// ClientSocketPort returns an attribute KeyValue conforming to the -// "client.socket.port" semantic conventions. It represents the immediate -// client peer port number -func ClientSocketPort(val int) attribute.KeyValue { - return ClientSocketPortKey.Int(val) -} - -// Describes deprecated HTTP attributes. -const ( - // HTTPMethodKey is the attribute Key conforming to the "http.method" - // semantic conventions. It represents the deprecated, use - // `http.request.method` instead. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'GET', 'POST', 'HEAD' - HTTPMethodKey = attribute.Key("http.method") - - // HTTPStatusCodeKey is the attribute Key conforming to the - // "http.status_code" semantic conventions. It represents the deprecated, - // use `http.response.status_code` instead. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 200 - HTTPStatusCodeKey = attribute.Key("http.status_code") - - // HTTPSchemeKey is the attribute Key conforming to the "http.scheme" - // semantic conventions. It represents the deprecated, use `url.scheme` - // instead. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'http', 'https' - HTTPSchemeKey = attribute.Key("http.scheme") - - // HTTPURLKey is the attribute Key conforming to the "http.url" semantic - // conventions. It represents the deprecated, use `url.full` instead. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv' - HTTPURLKey = attribute.Key("http.url") - - // HTTPTargetKey is the attribute Key conforming to the "http.target" - // semantic conventions. It represents the deprecated, use `url.path` and - // `url.query` instead. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '/search?q=OpenTelemetry#SemConv' - HTTPTargetKey = attribute.Key("http.target") - - // HTTPRequestContentLengthKey is the attribute Key conforming to the - // "http.request_content_length" semantic conventions. It represents the - // deprecated, use `http.request.body.size` instead. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 3495 - HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") - - // HTTPResponseContentLengthKey is the attribute Key conforming to the - // "http.response_content_length" semantic conventions. It represents the - // deprecated, use `http.response.body.size` instead. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 3495 - HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") -) - -// HTTPMethod returns an attribute KeyValue conforming to the "http.method" -// semantic conventions. It represents the deprecated, use -// `http.request.method` instead. -func HTTPMethod(val string) attribute.KeyValue { - return HTTPMethodKey.String(val) -} - -// HTTPStatusCode returns an attribute KeyValue conforming to the -// "http.status_code" semantic conventions. It represents the deprecated, use -// `http.response.status_code` instead. -func HTTPStatusCode(val int) attribute.KeyValue { - return HTTPStatusCodeKey.Int(val) -} - -// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme" -// semantic conventions. It represents the deprecated, use `url.scheme` -// instead. -func HTTPScheme(val string) attribute.KeyValue { - return HTTPSchemeKey.String(val) -} - -// HTTPURL returns an attribute KeyValue conforming to the "http.url" -// semantic conventions. It represents the deprecated, use `url.full` instead. -func HTTPURL(val string) attribute.KeyValue { - return HTTPURLKey.String(val) -} - -// HTTPTarget returns an attribute KeyValue conforming to the "http.target" -// semantic conventions. It represents the deprecated, use `url.path` and -// `url.query` instead. -func HTTPTarget(val string) attribute.KeyValue { - return HTTPTargetKey.String(val) -} - -// HTTPRequestContentLength returns an attribute KeyValue conforming to the -// "http.request_content_length" semantic conventions. It represents the -// deprecated, use `http.request.body.size` instead. -func HTTPRequestContentLength(val int) attribute.KeyValue { - return HTTPRequestContentLengthKey.Int(val) -} - -// HTTPResponseContentLength returns an attribute KeyValue conforming to the -// "http.response_content_length" semantic conventions. It represents the -// deprecated, use `http.response.body.size` instead. -func HTTPResponseContentLength(val int) attribute.KeyValue { - return HTTPResponseContentLengthKey.Int(val) -} - -// These attributes may be used for any network related operation. -const ( - // NetSockPeerNameKey is the attribute Key conforming to the - // "net.sock.peer.name" semantic conventions. It represents the deprecated, - // use `server.socket.domain` on client spans. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '/var/my.sock' - NetSockPeerNameKey = attribute.Key("net.sock.peer.name") - - // NetSockPeerAddrKey is the attribute Key conforming to the - // "net.sock.peer.addr" semantic conventions. It represents the deprecated, - // use `server.socket.address` on client spans and `client.socket.address` - // on server spans. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '192.168.0.1' - NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr") - - // NetSockPeerPortKey is the attribute Key conforming to the - // "net.sock.peer.port" semantic conventions. It represents the deprecated, - // use `server.socket.port` on client spans and `client.socket.port` on - // server spans. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 65531 - NetSockPeerPortKey = attribute.Key("net.sock.peer.port") - - // NetPeerNameKey is the attribute Key conforming to the "net.peer.name" - // semantic conventions. It represents the deprecated, use `server.address` - // on client spans and `client.address` on server spans. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'example.com' - NetPeerNameKey = attribute.Key("net.peer.name") - - // NetPeerPortKey is the attribute Key conforming to the "net.peer.port" - // semantic conventions. It represents the deprecated, use `server.port` on - // client spans and `client.port` on server spans. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 8080 - NetPeerPortKey = attribute.Key("net.peer.port") - - // NetHostNameKey is the attribute Key conforming to the "net.host.name" - // semantic conventions. It represents the deprecated, use - // `server.address`. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'example.com' - NetHostNameKey = attribute.Key("net.host.name") - - // NetHostPortKey is the attribute Key conforming to the "net.host.port" - // semantic conventions. It represents the deprecated, use `server.port`. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 8080 - NetHostPortKey = attribute.Key("net.host.port") - - // NetSockHostAddrKey is the attribute Key conforming to the - // "net.sock.host.addr" semantic conventions. It represents the deprecated, - // use `server.socket.address`. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '/var/my.sock' - NetSockHostAddrKey = attribute.Key("net.sock.host.addr") - - // NetSockHostPortKey is the attribute Key conforming to the - // "net.sock.host.port" semantic conventions. It represents the deprecated, - // use `server.socket.port`. - // - // Type: int - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 8080 - NetSockHostPortKey = attribute.Key("net.sock.host.port") - - // NetTransportKey is the attribute Key conforming to the "net.transport" - // semantic conventions. It represents the deprecated, use - // `network.transport`. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: deprecated - NetTransportKey = attribute.Key("net.transport") - - // NetProtocolNameKey is the attribute Key conforming to the - // "net.protocol.name" semantic conventions. It represents the deprecated, - // use `network.protocol.name`. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'amqp', 'http', 'mqtt' - NetProtocolNameKey = attribute.Key("net.protocol.name") - - // NetProtocolVersionKey is the attribute Key conforming to the - // "net.protocol.version" semantic conventions. It represents the - // deprecated, use `network.protocol.version`. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '3.1.1' - NetProtocolVersionKey = attribute.Key("net.protocol.version") - - // NetSockFamilyKey is the attribute Key conforming to the - // "net.sock.family" semantic conventions. It represents the deprecated, - // use `network.transport` and `network.type`. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: deprecated - NetSockFamilyKey = attribute.Key("net.sock.family") -) - -var ( - // ip_tcp - NetTransportTCP = NetTransportKey.String("ip_tcp") - // ip_udp - NetTransportUDP = NetTransportKey.String("ip_udp") - // Named or anonymous pipe - NetTransportPipe = NetTransportKey.String("pipe") - // In-process communication - NetTransportInProc = NetTransportKey.String("inproc") - // Something else (non IP-based) - NetTransportOther = NetTransportKey.String("other") -) - -var ( - // IPv4 address - NetSockFamilyInet = NetSockFamilyKey.String("inet") - // IPv6 address - NetSockFamilyInet6 = NetSockFamilyKey.String("inet6") - // Unix domain socket path - NetSockFamilyUnix = NetSockFamilyKey.String("unix") -) - -// NetSockPeerName returns an attribute KeyValue conforming to the -// "net.sock.peer.name" semantic conventions. It represents the deprecated, use -// `server.socket.domain` on client spans. -func NetSockPeerName(val string) attribute.KeyValue { - return NetSockPeerNameKey.String(val) -} - -// NetSockPeerAddr returns an attribute KeyValue conforming to the -// "net.sock.peer.addr" semantic conventions. It represents the deprecated, use -// `server.socket.address` on client spans and `client.socket.address` on -// server spans. -func NetSockPeerAddr(val string) attribute.KeyValue { - return NetSockPeerAddrKey.String(val) -} - -// NetSockPeerPort returns an attribute KeyValue conforming to the -// "net.sock.peer.port" semantic conventions. It represents the deprecated, use -// `server.socket.port` on client spans and `client.socket.port` on server -// spans. -func NetSockPeerPort(val int) attribute.KeyValue { - return NetSockPeerPortKey.Int(val) -} - -// NetPeerName returns an attribute KeyValue conforming to the -// "net.peer.name" semantic conventions. It represents the deprecated, use -// `server.address` on client spans and `client.address` on server spans. -func NetPeerName(val string) attribute.KeyValue { - return NetPeerNameKey.String(val) -} - -// NetPeerPort returns an attribute KeyValue conforming to the -// "net.peer.port" semantic conventions. It represents the deprecated, use -// `server.port` on client spans and `client.port` on server spans. -func NetPeerPort(val int) attribute.KeyValue { - return NetPeerPortKey.Int(val) -} - -// NetHostName returns an attribute KeyValue conforming to the -// "net.host.name" semantic conventions. It represents the deprecated, use -// `server.address`. -func NetHostName(val string) attribute.KeyValue { - return NetHostNameKey.String(val) -} - -// NetHostPort returns an attribute KeyValue conforming to the -// "net.host.port" semantic conventions. It represents the deprecated, use -// `server.port`. -func NetHostPort(val int) attribute.KeyValue { - return NetHostPortKey.Int(val) -} - -// NetSockHostAddr returns an attribute KeyValue conforming to the -// "net.sock.host.addr" semantic conventions. It represents the deprecated, use -// `server.socket.address`. -func NetSockHostAddr(val string) attribute.KeyValue { - return NetSockHostAddrKey.String(val) -} - -// NetSockHostPort returns an attribute KeyValue conforming to the -// "net.sock.host.port" semantic conventions. It represents the deprecated, use -// `server.socket.port`. -func NetSockHostPort(val int) attribute.KeyValue { - return NetSockHostPortKey.Int(val) -} - -// NetProtocolName returns an attribute KeyValue conforming to the -// "net.protocol.name" semantic conventions. It represents the deprecated, use -// `network.protocol.name`. -func NetProtocolName(val string) attribute.KeyValue { - return NetProtocolNameKey.String(val) -} - -// NetProtocolVersion returns an attribute KeyValue conforming to the -// "net.protocol.version" semantic conventions. It represents the deprecated, -// use `network.protocol.version`. -func NetProtocolVersion(val string) attribute.KeyValue { - return NetProtocolVersionKey.String(val) -} - -// These attributes may be used to describe the receiver of a network -// exchange/packet. These should be used when there is no client/server -// relationship between the two sides, or when that relationship is unknown. -// This covers low-level network interactions (e.g. packet tracing) where you -// don't know if there was a connection or which side initiated it. This also -// covers unidirectional UDP flows and peer-to-peer communication where the -// "user-facing" surface of the protocol / API does not expose a clear notion -// of client and server. -const ( - // DestinationDomainKey is the attribute Key conforming to the - // "destination.domain" semantic conventions. It represents the domain name - // of the destination system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'foo.example.com' - // Note: This value may be a host name, a fully qualified domain name, or - // another host naming format. - DestinationDomainKey = attribute.Key("destination.domain") - - // DestinationAddressKey is the attribute Key conforming to the - // "destination.address" semantic conventions. It represents the peer - // address, for example IP address or UNIX socket name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '10.5.3.2' - DestinationAddressKey = attribute.Key("destination.address") - - // DestinationPortKey is the attribute Key conforming to the - // "destination.port" semantic conventions. It represents the peer port - // number - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3389, 2888 - DestinationPortKey = attribute.Key("destination.port") -) - -// DestinationDomain returns an attribute KeyValue conforming to the -// "destination.domain" semantic conventions. It represents the domain name of -// the destination system. -func DestinationDomain(val string) attribute.KeyValue { - return DestinationDomainKey.String(val) -} - -// DestinationAddress returns an attribute KeyValue conforming to the -// "destination.address" semantic conventions. It represents the peer address, -// for example IP address or UNIX socket name. -func DestinationAddress(val string) attribute.KeyValue { - return DestinationAddressKey.String(val) -} - -// DestinationPort returns an attribute KeyValue conforming to the -// "destination.port" semantic conventions. It represents the peer port number -func DestinationPort(val int) attribute.KeyValue { - return DestinationPortKey.Int(val) -} - -// Describes HTTP attributes. -const ( - // HTTPRequestMethodKey is the attribute Key conforming to the - // "http.request.method" semantic conventions. It represents the hTTP - // request method. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Examples: 'GET', 'POST', 'HEAD' - // Note: HTTP request method value SHOULD be "known" to the - // instrumentation. - // By default, this convention defines "known" methods as the ones listed - // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) - // and the PATCH method defined in - // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). - // - // If the HTTP request method is not known to instrumentation, it MUST set - // the `http.request.method` attribute to `_OTHER` and, except if reporting - // a metric, MUST - // set the exact method received in the request line as value of the - // `http.request.method_original` attribute. - // - // If the HTTP instrumentation could end up converting valid HTTP request - // methods to `_OTHER`, then it MUST provide a way to override - // the list of known HTTP methods. If this override is done via environment - // variable, then the environment variable MUST be named - // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated - // list of case-sensitive known HTTP methods - // (this list MUST be a full override of the default known method, it is - // not a list of known methods in addition to the defaults). - // - // HTTP method names are case-sensitive and `http.request.method` attribute - // value MUST match a known HTTP method name exactly. - // Instrumentations for specific web frameworks that consider HTTP methods - // to be case insensitive, SHOULD populate a canonical equivalent. - // Tracing instrumentations that do so, MUST also set - // `http.request.method_original` to the original value. - HTTPRequestMethodKey = attribute.Key("http.request.method") - - // HTTPResponseStatusCodeKey is the attribute Key conforming to the - // "http.response.status_code" semantic conventions. It represents the - // [HTTP response status - // code](https://tools.ietf.org/html/rfc7231#section-6). - // - // Type: int - // RequirementLevel: ConditionallyRequired (If and only if one was - // received/sent.) - // Stability: stable - // Examples: 200 - HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") -) - -var ( - // CONNECT method - HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT") - // DELETE method - HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE") - // GET method - HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET") - // HEAD method - HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD") - // OPTIONS method - HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS") - // PATCH method - HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH") - // POST method - HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST") - // PUT method - HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT") - // TRACE method - HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") - // Any HTTP method that the instrumentation has no prior knowledge of - HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") -) - -// HTTPResponseStatusCode returns an attribute KeyValue conforming to the -// "http.response.status_code" semantic conventions. It represents the [HTTP -// response status code](https://tools.ietf.org/html/rfc7231#section-6). -func HTTPResponseStatusCode(val int) attribute.KeyValue { - return HTTPResponseStatusCodeKey.Int(val) -} - -// HTTP Server attributes -const ( - // HTTPRouteKey is the attribute Key conforming to the "http.route" - // semantic conventions. It represents the matched route (path template in - // the format used by the respective server framework). See note below - // - // Type: string - // RequirementLevel: ConditionallyRequired (If and only if it's available) - // Stability: stable - // Examples: '/users/:userID?', '{controller}/{action}/{id?}' - // Note: MUST NOT be populated when this is not supported by the HTTP - // server framework as the route attribute should have low-cardinality and - // the URI path can NOT substitute it. - // SHOULD include the [application - // root](/docs/http/http-spans.md#http-server-definitions) if there is one. - HTTPRouteKey = attribute.Key("http.route") -) - -// HTTPRoute returns an attribute KeyValue conforming to the "http.route" -// semantic conventions. It represents the matched route (path template in the -// format used by the respective server framework). See note below -func HTTPRoute(val string) attribute.KeyValue { - return HTTPRouteKey.String(val) -} - -// Attributes for Events represented using Log Records. -const ( - // EventNameKey is the attribute Key conforming to the "event.name" - // semantic conventions. It represents the name identifies the event. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'click', 'exception' - EventNameKey = attribute.Key("event.name") - - // EventDomainKey is the attribute Key conforming to the "event.domain" - // semantic conventions. It represents the domain identifies the business - // context for the events. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Note: Events across different domains may have same `event.name`, yet be - // unrelated events. - EventDomainKey = attribute.Key("event.domain") -) - -var ( - // Events from browser apps - EventDomainBrowser = EventDomainKey.String("browser") - // Events from mobile apps - EventDomainDevice = EventDomainKey.String("device") - // Events from Kubernetes - EventDomainK8S = EventDomainKey.String("k8s") -) - -// EventName returns an attribute KeyValue conforming to the "event.name" -// semantic conventions. It represents the name identifies the event. -func EventName(val string) attribute.KeyValue { - return EventNameKey.String(val) -} - -// The attributes described in this section are rather generic. They may be -// used in any Log Record they apply to. -const ( - // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid" - // semantic conventions. It represents a unique identifier for the Log - // Record. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV' - // Note: If an id is provided, other log records with the same id will be - // considered duplicates and can be removed safely. This means, that two - // distinguishable log records MUST have different values. - // The id MAY be an [Universally Unique Lexicographically Sortable - // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers - // (e.g. UUID) may be used as needed. - LogRecordUIDKey = attribute.Key("log.record.uid") -) - -// LogRecordUID returns an attribute KeyValue conforming to the -// "log.record.uid" semantic conventions. It represents a unique identifier for -// the Log Record. -func LogRecordUID(val string) attribute.KeyValue { - return LogRecordUIDKey.String(val) -} - -// Describes Log attributes -const ( - // LogIostreamKey is the attribute Key conforming to the "log.iostream" - // semantic conventions. It represents the stream associated with the log. - // See below for a list of well-known values. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - LogIostreamKey = attribute.Key("log.iostream") -) - -var ( - // Logs from stdout stream - LogIostreamStdout = LogIostreamKey.String("stdout") - // Events from stderr stream - LogIostreamStderr = LogIostreamKey.String("stderr") -) - -// A file to which log was emitted. -const ( - // LogFileNameKey is the attribute Key conforming to the "log.file.name" - // semantic conventions. It represents the basename of the file. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'audit.log' - LogFileNameKey = attribute.Key("log.file.name") - - // LogFilePathKey is the attribute Key conforming to the "log.file.path" - // semantic conventions. It represents the full path to the file. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/var/log/mysql/audit.log' - LogFilePathKey = attribute.Key("log.file.path") - - // LogFileNameResolvedKey is the attribute Key conforming to the - // "log.file.name_resolved" semantic conventions. It represents the - // basename of the file, with symlinks resolved. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'uuid.log' - LogFileNameResolvedKey = attribute.Key("log.file.name_resolved") - - // LogFilePathResolvedKey is the attribute Key conforming to the - // "log.file.path_resolved" semantic conventions. It represents the full - // path to the file, with symlinks resolved. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/var/lib/docker/uuid.log' - LogFilePathResolvedKey = attribute.Key("log.file.path_resolved") -) - -// LogFileName returns an attribute KeyValue conforming to the -// "log.file.name" semantic conventions. It represents the basename of the -// file. -func LogFileName(val string) attribute.KeyValue { - return LogFileNameKey.String(val) -} - -// LogFilePath returns an attribute KeyValue conforming to the -// "log.file.path" semantic conventions. It represents the full path to the -// file. -func LogFilePath(val string) attribute.KeyValue { - return LogFilePathKey.String(val) -} - -// LogFileNameResolved returns an attribute KeyValue conforming to the -// "log.file.name_resolved" semantic conventions. It represents the basename of -// the file, with symlinks resolved. -func LogFileNameResolved(val string) attribute.KeyValue { - return LogFileNameResolvedKey.String(val) -} - -// LogFilePathResolved returns an attribute KeyValue conforming to the -// "log.file.path_resolved" semantic conventions. It represents the full path -// to the file, with symlinks resolved. -func LogFilePathResolved(val string) attribute.KeyValue { - return LogFilePathResolvedKey.String(val) -} - -// Describes JVM memory metric attributes. -const ( - // TypeKey is the attribute Key conforming to the "type" semantic - // conventions. It represents the type of memory. - // - // Type: Enum - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'heap', 'non_heap' - TypeKey = attribute.Key("type") - - // PoolKey is the attribute Key conforming to the "pool" semantic - // conventions. It represents the name of the memory pool. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space' - // Note: Pool names are generally obtained via - // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). - PoolKey = attribute.Key("pool") -) - -var ( - // Heap memory - TypeHeap = TypeKey.String("heap") - // Non-heap memory - TypeNonHeap = TypeKey.String("non_heap") -) - -// Pool returns an attribute KeyValue conforming to the "pool" semantic -// conventions. It represents the name of the memory pool. -func Pool(val string) attribute.KeyValue { - return PoolKey.String(val) -} - -// These attributes may be used to describe the server in a connection-based -// network interaction where there is one side that initiates the connection -// (the client is the side that initiates the connection). This covers all TCP -// network interactions since TCP is connection-based and one side initiates -// the connection (an exception is made for peer-to-peer communication over TCP -// where the "user-facing" surface of the protocol / API does not expose a -// clear notion of client and server). This also covers UDP network -// interactions where one side initiates the interaction, e.g. QUIC (HTTP/3) -// and DNS. -const ( - // ServerAddressKey is the attribute Key conforming to the "server.address" - // semantic conventions. It represents the logical server hostname, matches - // server FQDN if available, and IP or socket address if FQDN is not known. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'example.com' - ServerAddressKey = attribute.Key("server.address") - - // ServerPortKey is the attribute Key conforming to the "server.port" - // semantic conventions. It represents the logical server port number - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 80, 8080, 443 - ServerPortKey = attribute.Key("server.port") - - // ServerSocketDomainKey is the attribute Key conforming to the - // "server.socket.domain" semantic conventions. It represents the domain - // name of an immediate peer. - // - // Type: string - // RequirementLevel: Recommended (If different than `server.address`.) - // Stability: stable - // Examples: 'proxy.example.com' - // Note: Typically observed from the client side, and represents a proxy or - // other intermediary domain name. - ServerSocketDomainKey = attribute.Key("server.socket.domain") - - // ServerSocketAddressKey is the attribute Key conforming to the - // "server.socket.address" semantic conventions. It represents the physical - // server IP address or Unix socket address. If set from the client, should - // simply use the socket's peer address, and not attempt to find any actual - // server IP (i.e., if set from client, this may represent some proxy - // server instead of the logical server). - // - // Type: string - // RequirementLevel: Recommended (If different than `server.address`.) - // Stability: stable - // Examples: '10.5.3.2' - ServerSocketAddressKey = attribute.Key("server.socket.address") - - // ServerSocketPortKey is the attribute Key conforming to the - // "server.socket.port" semantic conventions. It represents the physical - // server port. - // - // Type: int - // RequirementLevel: Recommended (If different than `server.port`.) - // Stability: stable - // Examples: 16456 - ServerSocketPortKey = attribute.Key("server.socket.port") -) - -// ServerAddress returns an attribute KeyValue conforming to the -// "server.address" semantic conventions. It represents the logical server -// hostname, matches server FQDN if available, and IP or socket address if FQDN -// is not known. -func ServerAddress(val string) attribute.KeyValue { - return ServerAddressKey.String(val) -} - -// ServerPort returns an attribute KeyValue conforming to the "server.port" -// semantic conventions. It represents the logical server port number -func ServerPort(val int) attribute.KeyValue { - return ServerPortKey.Int(val) -} - -// ServerSocketDomain returns an attribute KeyValue conforming to the -// "server.socket.domain" semantic conventions. It represents the domain name -// of an immediate peer. -func ServerSocketDomain(val string) attribute.KeyValue { - return ServerSocketDomainKey.String(val) -} - -// ServerSocketAddress returns an attribute KeyValue conforming to the -// "server.socket.address" semantic conventions. It represents the physical -// server IP address or Unix socket address. If set from the client, should -// simply use the socket's peer address, and not attempt to find any actual -// server IP (i.e., if set from client, this may represent some proxy server -// instead of the logical server). -func ServerSocketAddress(val string) attribute.KeyValue { - return ServerSocketAddressKey.String(val) -} - -// ServerSocketPort returns an attribute KeyValue conforming to the -// "server.socket.port" semantic conventions. It represents the physical server -// port. -func ServerSocketPort(val int) attribute.KeyValue { - return ServerSocketPortKey.Int(val) -} - -// These attributes may be used to describe the sender of a network -// exchange/packet. These should be used when there is no client/server -// relationship between the two sides, or when that relationship is unknown. -// This covers low-level network interactions (e.g. packet tracing) where you -// don't know if there was a connection or which side initiated it. This also -// covers unidirectional UDP flows and peer-to-peer communication where the -// "user-facing" surface of the protocol / API does not expose a clear notion -// of client and server. -const ( - // SourceDomainKey is the attribute Key conforming to the "source.domain" - // semantic conventions. It represents the domain name of the source - // system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'foo.example.com' - // Note: This value may be a host name, a fully qualified domain name, or - // another host naming format. - SourceDomainKey = attribute.Key("source.domain") - - // SourceAddressKey is the attribute Key conforming to the "source.address" - // semantic conventions. It represents the source address, for example IP - // address or Unix socket name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '10.5.3.2' - SourceAddressKey = attribute.Key("source.address") - - // SourcePortKey is the attribute Key conforming to the "source.port" - // semantic conventions. It represents the source port number - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3389, 2888 - SourcePortKey = attribute.Key("source.port") -) - -// SourceDomain returns an attribute KeyValue conforming to the -// "source.domain" semantic conventions. It represents the domain name of the -// source system. -func SourceDomain(val string) attribute.KeyValue { - return SourceDomainKey.String(val) -} - -// SourceAddress returns an attribute KeyValue conforming to the -// "source.address" semantic conventions. It represents the source address, for -// example IP address or Unix socket name. -func SourceAddress(val string) attribute.KeyValue { - return SourceAddressKey.String(val) -} - -// SourcePort returns an attribute KeyValue conforming to the "source.port" -// semantic conventions. It represents the source port number -func SourcePort(val int) attribute.KeyValue { - return SourcePortKey.Int(val) -} - -// These attributes may be used for any network related operation. -const ( - // NetworkTransportKey is the attribute Key conforming to the - // "network.transport" semantic conventions. It represents the [OSI - // Transport Layer](https://osi-model.com/transport-layer/) or - // [Inter-process Communication - // method](https://en.wikipedia.org/wiki/Inter-process_communication). The - // value SHOULD be normalized to lowercase. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'tcp', 'udp' - NetworkTransportKey = attribute.Key("network.transport") - - // NetworkTypeKey is the attribute Key conforming to the "network.type" - // semantic conventions. It represents the [OSI Network - // Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The - // value SHOULD be normalized to lowercase. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'ipv4', 'ipv6' - NetworkTypeKey = attribute.Key("network.type") - - // NetworkProtocolNameKey is the attribute Key conforming to the - // "network.protocol.name" semantic conventions. It represents the [OSI - // Application Layer](https://osi-model.com/application-layer/) or non-OSI - // equivalent. The value SHOULD be normalized to lowercase. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'amqp', 'http', 'mqtt' - NetworkProtocolNameKey = attribute.Key("network.protocol.name") - - // NetworkProtocolVersionKey is the attribute Key conforming to the - // "network.protocol.version" semantic conventions. It represents the - // version of the application layer protocol used. See note below. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '3.1.1' - // Note: `network.protocol.version` refers to the version of the protocol - // used and might be different from the protocol client's version. If the - // HTTP client used has a version of `0.27.2`, but sends HTTP version - // `1.1`, this attribute should be set to `1.1`. - NetworkProtocolVersionKey = attribute.Key("network.protocol.version") -) - -var ( - // TCP - NetworkTransportTCP = NetworkTransportKey.String("tcp") - // UDP - NetworkTransportUDP = NetworkTransportKey.String("udp") - // Named or anonymous pipe. See note below - NetworkTransportPipe = NetworkTransportKey.String("pipe") - // Unix domain socket - NetworkTransportUnix = NetworkTransportKey.String("unix") -) - -var ( - // IPv4 - NetworkTypeIpv4 = NetworkTypeKey.String("ipv4") - // IPv6 - NetworkTypeIpv6 = NetworkTypeKey.String("ipv6") -) - -// NetworkProtocolName returns an attribute KeyValue conforming to the -// "network.protocol.name" semantic conventions. It represents the [OSI -// Application Layer](https://osi-model.com/application-layer/) or non-OSI -// equivalent. The value SHOULD be normalized to lowercase. -func NetworkProtocolName(val string) attribute.KeyValue { - return NetworkProtocolNameKey.String(val) -} - -// NetworkProtocolVersion returns an attribute KeyValue conforming to the -// "network.protocol.version" semantic conventions. It represents the version -// of the application layer protocol used. See note below. -func NetworkProtocolVersion(val string) attribute.KeyValue { - return NetworkProtocolVersionKey.String(val) -} - -// These attributes may be used for any network related operation. -const ( - // NetworkConnectionTypeKey is the attribute Key conforming to the - // "network.connection.type" semantic conventions. It represents the - // internet connection type. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'wifi' - NetworkConnectionTypeKey = attribute.Key("network.connection.type") - - // NetworkConnectionSubtypeKey is the attribute Key conforming to the - // "network.connection.subtype" semantic conventions. It represents the - // this describes more details regarding the connection.type. It may be the - // type of cell technology connection, but it could be used for describing - // details about a wifi connection. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'LTE' - NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype") - - // NetworkCarrierNameKey is the attribute Key conforming to the - // "network.carrier.name" semantic conventions. It represents the name of - // the mobile carrier. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'sprint' - NetworkCarrierNameKey = attribute.Key("network.carrier.name") - - // NetworkCarrierMccKey is the attribute Key conforming to the - // "network.carrier.mcc" semantic conventions. It represents the mobile - // carrier country code. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '310' - NetworkCarrierMccKey = attribute.Key("network.carrier.mcc") - - // NetworkCarrierMncKey is the attribute Key conforming to the - // "network.carrier.mnc" semantic conventions. It represents the mobile - // carrier network code. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '001' - NetworkCarrierMncKey = attribute.Key("network.carrier.mnc") - - // NetworkCarrierIccKey is the attribute Key conforming to the - // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 - // alpha-2 2-character country code associated with the mobile carrier - // network. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'DE' - NetworkCarrierIccKey = attribute.Key("network.carrier.icc") -) - -var ( - // wifi - NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi") - // wired - NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired") - // cell - NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell") - // unavailable - NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable") - // unknown - NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown") -) - -var ( - // GPRS - NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs") - // EDGE - NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge") - // UMTS - NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts") - // CDMA - NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma") - // EVDO Rel. 0 - NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0") - // EVDO Rev. A - NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a") - // CDMA2000 1XRTT - NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt") - // HSDPA - NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa") - // HSUPA - NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa") - // HSPA - NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa") - // IDEN - NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden") - // EVDO Rev. B - NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b") - // LTE - NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte") - // EHRPD - NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd") - // HSPAP - NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap") - // GSM - NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm") - // TD-SCDMA - NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma") - // IWLAN - NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan") - // 5G NR (New Radio) - NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr") - // 5G NRNSA (New Radio Non-Standalone) - NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa") - // LTE CA - NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca") -) - -// NetworkCarrierName returns an attribute KeyValue conforming to the -// "network.carrier.name" semantic conventions. It represents the name of the -// mobile carrier. -func NetworkCarrierName(val string) attribute.KeyValue { - return NetworkCarrierNameKey.String(val) -} - -// NetworkCarrierMcc returns an attribute KeyValue conforming to the -// "network.carrier.mcc" semantic conventions. It represents the mobile carrier -// country code. -func NetworkCarrierMcc(val string) attribute.KeyValue { - return NetworkCarrierMccKey.String(val) -} - -// NetworkCarrierMnc returns an attribute KeyValue conforming to the -// "network.carrier.mnc" semantic conventions. It represents the mobile carrier -// network code. -func NetworkCarrierMnc(val string) attribute.KeyValue { - return NetworkCarrierMncKey.String(val) -} - -// NetworkCarrierIcc returns an attribute KeyValue conforming to the -// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 -// alpha-2 2-character country code associated with the mobile carrier network. -func NetworkCarrierIcc(val string) attribute.KeyValue { - return NetworkCarrierIccKey.String(val) -} - -// Semantic conventions for HTTP client and server Spans. -const ( - // HTTPRequestMethodOriginalKey is the attribute Key conforming to the - // "http.request.method_original" semantic conventions. It represents the - // original HTTP method sent by the client in the request line. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If and only if it's different - // than `http.request.method`.) - // Stability: stable - // Examples: 'GeT', 'ACL', 'foo' - HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original") - - // HTTPRequestBodySizeKey is the attribute Key conforming to the - // "http.request.body.size" semantic conventions. It represents the size of - // the request payload body in bytes. This is the number of bytes - // transferred excluding headers and is often, but not always, present as - // the - // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) - // header. For requests using transport encoding, this should be the - // compressed size. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3495 - HTTPRequestBodySizeKey = attribute.Key("http.request.body.size") - - // HTTPResponseBodySizeKey is the attribute Key conforming to the - // "http.response.body.size" semantic conventions. It represents the size - // of the response payload body in bytes. This is the number of bytes - // transferred excluding headers and is often, but not always, present as - // the - // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) - // header. For requests using transport encoding, this should be the - // compressed size. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3495 - HTTPResponseBodySizeKey = attribute.Key("http.response.body.size") -) - -// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the -// "http.request.method_original" semantic conventions. It represents the -// original HTTP method sent by the client in the request line. -func HTTPRequestMethodOriginal(val string) attribute.KeyValue { - return HTTPRequestMethodOriginalKey.String(val) -} - -// HTTPRequestBodySize returns an attribute KeyValue conforming to the -// "http.request.body.size" semantic conventions. It represents the size of the -// request payload body in bytes. This is the number of bytes transferred -// excluding headers and is often, but not always, present as the -// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) -// header. For requests using transport encoding, this should be the compressed -// size. -func HTTPRequestBodySize(val int) attribute.KeyValue { - return HTTPRequestBodySizeKey.Int(val) -} - -// HTTPResponseBodySize returns an attribute KeyValue conforming to the -// "http.response.body.size" semantic conventions. It represents the size of -// the response payload body in bytes. This is the number of bytes transferred -// excluding headers and is often, but not always, present as the -// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) -// header. For requests using transport encoding, this should be the compressed -// size. -func HTTPResponseBodySize(val int) attribute.KeyValue { - return HTTPResponseBodySizeKey.Int(val) -} - -// Semantic convention describing per-message attributes populated on messaging -// spans or links. -const ( - // MessagingMessageIDKey is the attribute Key conforming to the - // "messaging.message.id" semantic conventions. It represents a value used - // by the messaging system as an identifier for the message, represented as - // a string. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '452a7c7c7c7048c2f887f61572b18fc2' - MessagingMessageIDKey = attribute.Key("messaging.message.id") - - // MessagingMessageConversationIDKey is the attribute Key conforming to the - // "messaging.message.conversation_id" semantic conventions. It represents - // the [conversation ID](#conversations) identifying the conversation to - // which the message belongs, represented as a string. Sometimes called - // "Correlation ID". - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'MyConversationID' - MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") - - // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to - // the "messaging.message.payload_size_bytes" semantic conventions. It - // represents the (uncompressed) size of the message payload in bytes. Also - // use this attribute if it is unknown whether the compressed or - // uncompressed payload size is reported. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 2738 - MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes") - - // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key - // conforming to the "messaging.message.payload_compressed_size_bytes" - // semantic conventions. It represents the compressed size of the message - // payload in bytes. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 2048 - MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes") -) - -// MessagingMessageID returns an attribute KeyValue conforming to the -// "messaging.message.id" semantic conventions. It represents a value used by -// the messaging system as an identifier for the message, represented as a -// string. -func MessagingMessageID(val string) attribute.KeyValue { - return MessagingMessageIDKey.String(val) -} - -// MessagingMessageConversationID returns an attribute KeyValue conforming -// to the "messaging.message.conversation_id" semantic conventions. It -// represents the [conversation ID](#conversations) identifying the -// conversation to which the message belongs, represented as a string. -// Sometimes called "Correlation ID". -func MessagingMessageConversationID(val string) attribute.KeyValue { - return MessagingMessageConversationIDKey.String(val) -} - -// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming -// to the "messaging.message.payload_size_bytes" semantic conventions. It -// represents the (uncompressed) size of the message payload in bytes. Also use -// this attribute if it is unknown whether the compressed or uncompressed -// payload size is reported. -func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue { - return MessagingMessagePayloadSizeBytesKey.Int(val) -} - -// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue -// conforming to the "messaging.message.payload_compressed_size_bytes" semantic -// conventions. It represents the compressed size of the message payload in -// bytes. -func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue { - return MessagingMessagePayloadCompressedSizeBytesKey.Int(val) -} - -// Semantic convention for attributes that describe messaging destination on -// broker -const ( - // MessagingDestinationNameKey is the attribute Key conforming to the - // "messaging.destination.name" semantic conventions. It represents the - // message destination name - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'MyQueue', 'MyTopic' - // Note: Destination name SHOULD uniquely identify a specific queue, topic - // or other entity within the broker. If - // the broker does not have such notion, the destination name SHOULD - // uniquely identify the broker. - MessagingDestinationNameKey = attribute.Key("messaging.destination.name") - - // MessagingDestinationTemplateKey is the attribute Key conforming to the - // "messaging.destination.template" semantic conventions. It represents the - // low cardinality representation of the messaging destination name - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/customers/{customerID}' - // Note: Destination names could be constructed from templates. An example - // would be a destination name involving a user name or product id. - // Although the destination name in this case is of high cardinality, the - // underlying template is of low cardinality and can be effectively used - // for grouping and aggregation. - MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") - - // MessagingDestinationTemporaryKey is the attribute Key conforming to the - // "messaging.destination.temporary" semantic conventions. It represents a - // boolean that is true if the message destination is temporary and might - // not exist anymore after messages are processed. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") - - // MessagingDestinationAnonymousKey is the attribute Key conforming to the - // "messaging.destination.anonymous" semantic conventions. It represents a - // boolean that is true if the message destination is anonymous (could be - // unnamed or have auto-generated name). - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") -) - -// MessagingDestinationName returns an attribute KeyValue conforming to the -// "messaging.destination.name" semantic conventions. It represents the message -// destination name -func MessagingDestinationName(val string) attribute.KeyValue { - return MessagingDestinationNameKey.String(val) -} - -// MessagingDestinationTemplate returns an attribute KeyValue conforming to -// the "messaging.destination.template" semantic conventions. It represents the -// low cardinality representation of the messaging destination name -func MessagingDestinationTemplate(val string) attribute.KeyValue { - return MessagingDestinationTemplateKey.String(val) -} - -// MessagingDestinationTemporary returns an attribute KeyValue conforming to -// the "messaging.destination.temporary" semantic conventions. It represents a -// boolean that is true if the message destination is temporary and might not -// exist anymore after messages are processed. -func MessagingDestinationTemporary(val bool) attribute.KeyValue { - return MessagingDestinationTemporaryKey.Bool(val) -} - -// MessagingDestinationAnonymous returns an attribute KeyValue conforming to -// the "messaging.destination.anonymous" semantic conventions. It represents a -// boolean that is true if the message destination is anonymous (could be -// unnamed or have auto-generated name). -func MessagingDestinationAnonymous(val bool) attribute.KeyValue { - return MessagingDestinationAnonymousKey.Bool(val) -} - -// Attributes for RabbitMQ -const ( - // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key - // conforming to the "messaging.rabbitmq.destination.routing_key" semantic - // conventions. It represents the rabbitMQ message routing key. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If not empty.) - // Stability: stable - // Examples: 'myKey' - MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") -) - -// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue -// conforming to the "messaging.rabbitmq.destination.routing_key" semantic -// conventions. It represents the rabbitMQ message routing key. -func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue { - return MessagingRabbitmqDestinationRoutingKeyKey.String(val) -} - -// Attributes for Apache Kafka -const ( - // MessagingKafkaMessageKeyKey is the attribute Key conforming to the - // "messaging.kafka.message.key" semantic conventions. It represents the - // message keys in Kafka are used for grouping alike messages to ensure - // they're processed on the same partition. They differ from - // `messaging.message.id` in that they're not unique. If the key is `null`, - // the attribute MUST NOT be set. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'myKey' - // Note: If the key type is not string, it's string representation has to - // be supplied for the attribute. If the key has no unambiguous, canonical - // string form, don't include its value. - MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") - - // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the - // "messaging.kafka.consumer.group" semantic conventions. It represents the - // name of the Kafka Consumer Group that is handling the message. Only - // applies to consumers, not producers. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'my-group' - MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group") - - // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to - // the "messaging.kafka.destination.partition" semantic conventions. It - // represents the partition the message is sent to. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 2 - MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition") - - // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the - // "messaging.kafka.message.offset" semantic conventions. It represents the - // offset of a record in the corresponding Kafka partition. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 42 - MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset") - - // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the - // "messaging.kafka.message.tombstone" semantic conventions. It represents - // a boolean that is true if the message is a tombstone. - // - // Type: boolean - // RequirementLevel: ConditionallyRequired (If value is `true`. When - // missing, the value is assumed to be `false`.) - // Stability: stable - MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") -) - -// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the -// "messaging.kafka.message.key" semantic conventions. It represents the -// message keys in Kafka are used for grouping alike messages to ensure they're -// processed on the same partition. They differ from `messaging.message.id` in -// that they're not unique. If the key is `null`, the attribute MUST NOT be -// set. -func MessagingKafkaMessageKey(val string) attribute.KeyValue { - return MessagingKafkaMessageKeyKey.String(val) -} - -// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to -// the "messaging.kafka.consumer.group" semantic conventions. It represents the -// name of the Kafka Consumer Group that is handling the message. Only applies -// to consumers, not producers. -func MessagingKafkaConsumerGroup(val string) attribute.KeyValue { - return MessagingKafkaConsumerGroupKey.String(val) -} - -// MessagingKafkaDestinationPartition returns an attribute KeyValue -// conforming to the "messaging.kafka.destination.partition" semantic -// conventions. It represents the partition the message is sent to. -func MessagingKafkaDestinationPartition(val int) attribute.KeyValue { - return MessagingKafkaDestinationPartitionKey.Int(val) -} - -// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to -// the "messaging.kafka.message.offset" semantic conventions. It represents the -// offset of a record in the corresponding Kafka partition. -func MessagingKafkaMessageOffset(val int) attribute.KeyValue { - return MessagingKafkaMessageOffsetKey.Int(val) -} - -// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming -// to the "messaging.kafka.message.tombstone" semantic conventions. It -// represents a boolean that is true if the message is a tombstone. -func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { - return MessagingKafkaMessageTombstoneKey.Bool(val) -} - -// Attributes for Apache RocketMQ -const ( - // MessagingRocketmqNamespaceKey is the attribute Key conforming to the - // "messaging.rocketmq.namespace" semantic conventions. It represents the - // namespace of RocketMQ resources, resources in different namespaces are - // individual. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'myNamespace' - MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") - - // MessagingRocketmqClientGroupKey is the attribute Key conforming to the - // "messaging.rocketmq.client_group" semantic conventions. It represents - // the name of the RocketMQ producer/consumer group that is handling the - // message. The client type is identified by the SpanKind. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'myConsumerGroup' - MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group") - - // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key - // conforming to the "messaging.rocketmq.message.delivery_timestamp" - // semantic conventions. It represents the timestamp in milliseconds that - // the delay message is expected to be delivered to consumer. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If the message type is delay - // and delay time level is not specified.) - // Stability: stable - // Examples: 1665987217045 - MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") - - // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key - // conforming to the "messaging.rocketmq.message.delay_time_level" semantic - // conventions. It represents the delay time level for delay message, which - // determines the message delay time. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If the message type is delay - // and delivery timestamp is not specified.) - // Stability: stable - // Examples: 3 - MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") - - // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the - // "messaging.rocketmq.message.group" semantic conventions. It represents - // the it is essential for FIFO message. Messages that belong to the same - // message group are always processed one by one within the same consumer - // group. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If the message type is FIFO.) - // Stability: stable - // Examples: 'myMessageGroup' - MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") - - // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the - // "messaging.rocketmq.message.type" semantic conventions. It represents - // the type of message. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") - - // MessagingRocketmqMessageTagKey is the attribute Key conforming to the - // "messaging.rocketmq.message.tag" semantic conventions. It represents the - // secondary classifier of message besides topic. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'tagA' - MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") - - // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the - // "messaging.rocketmq.message.keys" semantic conventions. It represents - // the key(s) of message, another way to mark message besides message id. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'keyA', 'keyB' - MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") - - // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to - // the "messaging.rocketmq.consumption_model" semantic conventions. It - // represents the model of message consumption. This only applies to - // consumer spans. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") -) - -var ( - // Normal message - MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") - // FIFO message - MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") - // Delay message - MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") - // Transaction message - MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") -) - -var ( - // Clustering consumption model - MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") - // Broadcasting consumption model - MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") -) - -// MessagingRocketmqNamespace returns an attribute KeyValue conforming to -// the "messaging.rocketmq.namespace" semantic conventions. It represents the -// namespace of RocketMQ resources, resources in different namespaces are -// individual. -func MessagingRocketmqNamespace(val string) attribute.KeyValue { - return MessagingRocketmqNamespaceKey.String(val) -} - -// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to -// the "messaging.rocketmq.client_group" semantic conventions. It represents -// the name of the RocketMQ producer/consumer group that is handling the -// message. The client type is identified by the SpanKind. -func MessagingRocketmqClientGroup(val string) attribute.KeyValue { - return MessagingRocketmqClientGroupKey.String(val) -} - -// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue -// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic -// conventions. It represents the timestamp in milliseconds that the delay -// message is expected to be delivered to consumer. -func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue { - return MessagingRocketmqMessageDeliveryTimestampKey.Int(val) -} - -// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue -// conforming to the "messaging.rocketmq.message.delay_time_level" semantic -// conventions. It represents the delay time level for delay message, which -// determines the message delay time. -func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue { - return MessagingRocketmqMessageDelayTimeLevelKey.Int(val) -} - -// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to -// the "messaging.rocketmq.message.group" semantic conventions. It represents -// the it is essential for FIFO message. Messages that belong to the same -// message group are always processed one by one within the same consumer -// group. -func MessagingRocketmqMessageGroup(val string) attribute.KeyValue { - return MessagingRocketmqMessageGroupKey.String(val) -} - -// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to -// the "messaging.rocketmq.message.tag" semantic conventions. It represents the -// secondary classifier of message besides topic. -func MessagingRocketmqMessageTag(val string) attribute.KeyValue { - return MessagingRocketmqMessageTagKey.String(val) -} - -// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to -// the "messaging.rocketmq.message.keys" semantic conventions. It represents -// the key(s) of message, another way to mark message besides message id. -func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue { - return MessagingRocketmqMessageKeysKey.StringSlice(val) -} - -// Attributes describing URL. -const ( - // URLSchemeKey is the attribute Key conforming to the "url.scheme" - // semantic conventions. It represents the [URI - // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component - // identifying the used protocol. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'https', 'ftp', 'telnet' - URLSchemeKey = attribute.Key("url.scheme") - - // URLFullKey is the attribute Key conforming to the "url.full" semantic - // conventions. It represents the absolute URL describing a network - // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv', - // '//localhost' - // Note: For network calls, URL usually has - // `scheme://host[:port][path][?query][#fragment]` format, where the - // fragment is not transmitted over HTTP, but if it is known, it should be - // included nevertheless. - // `url.full` MUST NOT contain credentials passed via URL in form of - // `https://username:password@www.example.com/`. In such case username and - // password should be redacted and attribute's value should be - // `https://REDACTED:REDACTED@www.example.com/`. - // `url.full` SHOULD capture the absolute URL when it is available (or can - // be reconstructed) and SHOULD NOT be validated or modified except for - // sanitizing purposes. - URLFullKey = attribute.Key("url.full") - - // URLPathKey is the attribute Key conforming to the "url.path" semantic - // conventions. It represents the [URI - // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/search' - // Note: When missing, the value is assumed to be `/` - URLPathKey = attribute.Key("url.path") - - // URLQueryKey is the attribute Key conforming to the "url.query" semantic - // conventions. It represents the [URI - // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'q=OpenTelemetry' - // Note: Sensitive content provided in query string SHOULD be scrubbed when - // instrumentations can identify it. - URLQueryKey = attribute.Key("url.query") - - // URLFragmentKey is the attribute Key conforming to the "url.fragment" - // semantic conventions. It represents the [URI - // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'SemConv' - URLFragmentKey = attribute.Key("url.fragment") -) - -// URLScheme returns an attribute KeyValue conforming to the "url.scheme" -// semantic conventions. It represents the [URI -// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component -// identifying the used protocol. -func URLScheme(val string) attribute.KeyValue { - return URLSchemeKey.String(val) -} - -// URLFull returns an attribute KeyValue conforming to the "url.full" -// semantic conventions. It represents the absolute URL describing a network -// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) -func URLFull(val string) attribute.KeyValue { - return URLFullKey.String(val) -} - -// URLPath returns an attribute KeyValue conforming to the "url.path" -// semantic conventions. It represents the [URI -// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component -func URLPath(val string) attribute.KeyValue { - return URLPathKey.String(val) -} - -// URLQuery returns an attribute KeyValue conforming to the "url.query" -// semantic conventions. It represents the [URI -// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component -func URLQuery(val string) attribute.KeyValue { - return URLQueryKey.String(val) -} - -// URLFragment returns an attribute KeyValue conforming to the -// "url.fragment" semantic conventions. It represents the [URI -// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component -func URLFragment(val string) attribute.KeyValue { - return URLFragmentKey.String(val) -} - -// Describes user-agent attributes. -const ( - // UserAgentOriginalKey is the attribute Key conforming to the - // "user_agent.original" semantic conventions. It represents the value of - // the [HTTP - // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) - // header sent by the client. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'CERN-LineMode/2.15 libwww/2.17b3' - UserAgentOriginalKey = attribute.Key("user_agent.original") -) - -// UserAgentOriginal returns an attribute KeyValue conforming to the -// "user_agent.original" semantic conventions. It represents the value of the -// [HTTP -// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) -// header sent by the client. -func UserAgentOriginal(val string) attribute.KeyValue { - return UserAgentOriginalKey.String(val) -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go deleted file mode 100644 index 7cf424855e9d..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 semconv implements OpenTelemetry semantic conventions. -// -// OpenTelemetry semantic conventions are agreed standardized naming -// patterns for OpenTelemetry things. This package represents the conventions -// as of the v1.21.0 version of the OpenTelemetry specification. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go deleted file mode 100644 index 30ae34fe4782..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -import "go.opentelemetry.io/otel/attribute" - -// This semantic convention defines the attributes used to represent a feature -// flag evaluation as an event. -const ( - // FeatureFlagKeyKey is the attribute Key conforming to the - // "feature_flag.key" semantic conventions. It represents the unique - // identifier of the feature flag. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'logo-color' - FeatureFlagKeyKey = attribute.Key("feature_flag.key") - - // FeatureFlagProviderNameKey is the attribute Key conforming to the - // "feature_flag.provider_name" semantic conventions. It represents the - // name of the service provider that performs the flag evaluation. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'Flag Manager' - FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name") - - // FeatureFlagVariantKey is the attribute Key conforming to the - // "feature_flag.variant" semantic conventions. It represents the sHOULD be - // a semantic identifier for a value. If one is unavailable, a stringified - // version of the value can be used. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'red', 'true', 'on' - // Note: A semantic identifier, commonly referred to as a variant, provides - // a means - // for referring to a value without including the value itself. This can - // provide additional context for understanding the meaning behind a value. - // For example, the variant `red` maybe be used for the value `#c05543`. - // - // A stringified version of the value can be used in situations where a - // semantic identifier is unavailable. String representation of the value - // should be determined by the implementer. - FeatureFlagVariantKey = attribute.Key("feature_flag.variant") -) - -// FeatureFlagKey returns an attribute KeyValue conforming to the -// "feature_flag.key" semantic conventions. It represents the unique identifier -// of the feature flag. -func FeatureFlagKey(val string) attribute.KeyValue { - return FeatureFlagKeyKey.String(val) -} - -// FeatureFlagProviderName returns an attribute KeyValue conforming to the -// "feature_flag.provider_name" semantic conventions. It represents the name of -// the service provider that performs the flag evaluation. -func FeatureFlagProviderName(val string) attribute.KeyValue { - return FeatureFlagProviderNameKey.String(val) -} - -// FeatureFlagVariant returns an attribute KeyValue conforming to the -// "feature_flag.variant" semantic conventions. It represents the sHOULD be a -// semantic identifier for a value. If one is unavailable, a stringified -// version of the value can be used. -func FeatureFlagVariant(val string) attribute.KeyValue { - return FeatureFlagVariantKey.String(val) -} - -// RPC received/sent message. -const ( - // MessageTypeKey is the attribute Key conforming to the "message.type" - // semantic conventions. It represents the whether this is a received or - // sent message. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - MessageTypeKey = attribute.Key("message.type") - - // MessageIDKey is the attribute Key conforming to the "message.id" - // semantic conventions. It represents the mUST be calculated as two - // different counters starting from `1` one for sent messages and one for - // received message. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Note: This way we guarantee that the values will be consistent between - // different implementations. - MessageIDKey = attribute.Key("message.id") - - // MessageCompressedSizeKey is the attribute Key conforming to the - // "message.compressed_size" semantic conventions. It represents the - // compressed size of the message in bytes. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - MessageCompressedSizeKey = attribute.Key("message.compressed_size") - - // MessageUncompressedSizeKey is the attribute Key conforming to the - // "message.uncompressed_size" semantic conventions. It represents the - // uncompressed size of the message in bytes. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") -) - -var ( - // sent - MessageTypeSent = MessageTypeKey.String("SENT") - // received - MessageTypeReceived = MessageTypeKey.String("RECEIVED") -) - -// MessageID returns an attribute KeyValue conforming to the "message.id" -// semantic conventions. It represents the mUST be calculated as two different -// counters starting from `1` one for sent messages and one for received -// message. -func MessageID(val int) attribute.KeyValue { - return MessageIDKey.Int(val) -} - -// MessageCompressedSize returns an attribute KeyValue conforming to the -// "message.compressed_size" semantic conventions. It represents the compressed -// size of the message in bytes. -func MessageCompressedSize(val int) attribute.KeyValue { - return MessageCompressedSizeKey.Int(val) -} - -// MessageUncompressedSize returns an attribute KeyValue conforming to the -// "message.uncompressed_size" semantic conventions. It represents the -// uncompressed size of the message in bytes. -func MessageUncompressedSize(val int) attribute.KeyValue { - return MessageUncompressedSizeKey.Int(val) -} - -// The attributes used to report a single exception associated with a span. -const ( - // ExceptionEscapedKey is the attribute Key conforming to the - // "exception.escaped" semantic conventions. It represents the sHOULD be - // set to true if the exception event is recorded at a point where it is - // known that the exception is escaping the scope of the span. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - // Note: An exception is considered to have escaped (or left) the scope of - // a span, - // if that span is ended while the exception is still logically "in - // flight". - // This may be actually "in flight" in some languages (e.g. if the - // exception - // is passed to a Context manager's `__exit__` method in Python) but will - // usually be caught at the point of recording the exception in most - // languages. - // - // It is usually not possible to determine at the point where an exception - // is thrown - // whether it will escape the scope of a span. - // However, it is trivial to know that an exception - // will escape, if one checks for an active exception just before ending - // the span, - // as done in the [example above](#recording-an-exception). - // - // It follows that an exception may still escape the scope of the span - // even if the `exception.escaped` attribute was not set or set to false, - // since the event might have been recorded at a time where it was not - // clear whether the exception will escape. - ExceptionEscapedKey = attribute.Key("exception.escaped") -) - -// ExceptionEscaped returns an attribute KeyValue conforming to the -// "exception.escaped" semantic conventions. It represents the sHOULD be set to -// true if the exception event is recorded at a point where it is known that -// the exception is escaping the scope of the span. -func ExceptionEscaped(val bool) attribute.KeyValue { - return ExceptionEscapedKey.Bool(val) -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go deleted file mode 100644 index 93d3c1760c92..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -const ( - // ExceptionEventName is the name of the Span event representing an exception. - ExceptionEventName = "exception" -) diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go deleted file mode 100644 index b6d8935cf973..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go +++ /dev/null @@ -1,2310 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -import "go.opentelemetry.io/otel/attribute" - -// The web browser in which the application represented by the resource is -// running. The `browser.*` attributes MUST be used only for resources that -// represent applications running in a web browser (regardless of whether -// running on a mobile or desktop device). -const ( - // BrowserBrandsKey is the attribute Key conforming to the "browser.brands" - // semantic conventions. It represents the array of brand name and version - // separated by a space - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99' - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.brands`). - BrowserBrandsKey = attribute.Key("browser.brands") - - // BrowserPlatformKey is the attribute Key conforming to the - // "browser.platform" semantic conventions. It represents the platform on - // which the browser is running - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Windows', 'macOS', 'Android' - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.platform`). If unavailable, the legacy - // `navigator.platform` API SHOULD NOT be used instead and this attribute - // SHOULD be left unset in order for the values to be consistent. - // The list of possible values is defined in the [W3C User-Agent Client - // Hints - // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). - // Note that some (but not all) of these values can overlap with values in - // the [`os.type` and `os.name` attributes](./os.md). However, for - // consistency, the values in the `browser.platform` attribute should - // capture the exact value that the user agent provides. - BrowserPlatformKey = attribute.Key("browser.platform") - - // BrowserMobileKey is the attribute Key conforming to the "browser.mobile" - // semantic conventions. It represents a boolean that is true if the - // browser is running on a mobile device - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.mobile`). If unavailable, this attribute - // SHOULD be left unset. - BrowserMobileKey = attribute.Key("browser.mobile") - - // BrowserLanguageKey is the attribute Key conforming to the - // "browser.language" semantic conventions. It represents the preferred - // language of the user using the browser - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'en', 'en-US', 'fr', 'fr-FR' - // Note: This value is intended to be taken from the Navigator API - // `navigator.language`. - BrowserLanguageKey = attribute.Key("browser.language") -) - -// BrowserBrands returns an attribute KeyValue conforming to the -// "browser.brands" semantic conventions. It represents the array of brand name -// and version separated by a space -func BrowserBrands(val ...string) attribute.KeyValue { - return BrowserBrandsKey.StringSlice(val) -} - -// BrowserPlatform returns an attribute KeyValue conforming to the -// "browser.platform" semantic conventions. It represents the platform on which -// the browser is running -func BrowserPlatform(val string) attribute.KeyValue { - return BrowserPlatformKey.String(val) -} - -// BrowserMobile returns an attribute KeyValue conforming to the -// "browser.mobile" semantic conventions. It represents a boolean that is true -// if the browser is running on a mobile device -func BrowserMobile(val bool) attribute.KeyValue { - return BrowserMobileKey.Bool(val) -} - -// BrowserLanguage returns an attribute KeyValue conforming to the -// "browser.language" semantic conventions. It represents the preferred -// language of the user using the browser -func BrowserLanguage(val string) attribute.KeyValue { - return BrowserLanguageKey.String(val) -} - -// A cloud environment (e.g. GCP, Azure, AWS) -const ( - // CloudProviderKey is the attribute Key conforming to the "cloud.provider" - // semantic conventions. It represents the name of the cloud provider. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - CloudProviderKey = attribute.Key("cloud.provider") - - // CloudAccountIDKey is the attribute Key conforming to the - // "cloud.account.id" semantic conventions. It represents the cloud account - // ID the resource is assigned to. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '111111111111', 'opentelemetry' - CloudAccountIDKey = attribute.Key("cloud.account.id") - - // CloudRegionKey is the attribute Key conforming to the "cloud.region" - // semantic conventions. It represents the geographical region the resource - // is running. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'us-central1', 'us-east-1' - // Note: Refer to your provider's docs to see the available regions, for - // example [Alibaba Cloud - // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS - // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), - // [Azure - // regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), - // [Google Cloud regions](https://cloud.google.com/about/locations), or - // [Tencent Cloud - // regions](https://www.tencentcloud.com/document/product/213/6091). - CloudRegionKey = attribute.Key("cloud.region") - - // CloudResourceIDKey is the attribute Key conforming to the - // "cloud.resource_id" semantic conventions. It represents the cloud - // provider-specific native identifier of the monitored cloud resource - // (e.g. an - // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // on AWS, a [fully qualified resource - // ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) - // on Azure, a [full resource - // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) - // on GCP) - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function', - // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID', - // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/' - // Note: On some cloud providers, it may not be possible to determine the - // full ID at startup, - // so it may be necessary to set `cloud.resource_id` as a span attribute - // instead. - // - // The exact value to use for `cloud.resource_id` depends on the cloud - // provider. - // The following well-known definitions MUST be used if you set this - // attribute and they apply: - // - // * **AWS Lambda:** The function - // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // Take care not to use the "invoked ARN" directly but replace any - // [alias - // suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) - // with the resolved function version, as the same runtime instance may - // be invokable with - // multiple different aliases. - // * **GCP:** The [URI of the - // resource](https://cloud.google.com/iam/docs/full-resource-names) - // * **Azure:** The [Fully Qualified Resource - // ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) - // of the invoked function, - // *not* the function app, having the form - // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. - // This means that a span attribute MUST be used, as an Azure function - // app can host multiple functions that would usually share - // a TracerProvider. - CloudResourceIDKey = attribute.Key("cloud.resource_id") - - // CloudAvailabilityZoneKey is the attribute Key conforming to the - // "cloud.availability_zone" semantic conventions. It represents the cloud - // regions often have multiple, isolated locations known as zones to - // increase availability. Availability zone represents the zone where the - // resource is running. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'us-east-1c' - // Note: Availability zones are called "zones" on Alibaba Cloud and Google - // Cloud. - CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") - - // CloudPlatformKey is the attribute Key conforming to the "cloud.platform" - // semantic conventions. It represents the cloud platform in use. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Note: The prefix of the service SHOULD match the one specified in - // `cloud.provider`. - CloudPlatformKey = attribute.Key("cloud.platform") -) - -var ( - // Alibaba Cloud - CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") - // Amazon Web Services - CloudProviderAWS = CloudProviderKey.String("aws") - // Microsoft Azure - CloudProviderAzure = CloudProviderKey.String("azure") - // Google Cloud Platform - CloudProviderGCP = CloudProviderKey.String("gcp") - // Heroku Platform as a Service - CloudProviderHeroku = CloudProviderKey.String("heroku") - // IBM Cloud - CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud") - // Tencent Cloud - CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") -) - -var ( - // Alibaba Cloud Elastic Compute Service - CloudPlatformAlibabaCloudECS = CloudPlatformKey.String("alibaba_cloud_ecs") - // Alibaba Cloud Function Compute - CloudPlatformAlibabaCloudFc = CloudPlatformKey.String("alibaba_cloud_fc") - // Red Hat OpenShift on Alibaba Cloud - CloudPlatformAlibabaCloudOpenshift = CloudPlatformKey.String("alibaba_cloud_openshift") - // AWS Elastic Compute Cloud - CloudPlatformAWSEC2 = CloudPlatformKey.String("aws_ec2") - // AWS Elastic Container Service - CloudPlatformAWSECS = CloudPlatformKey.String("aws_ecs") - // AWS Elastic Kubernetes Service - CloudPlatformAWSEKS = CloudPlatformKey.String("aws_eks") - // AWS Lambda - CloudPlatformAWSLambda = CloudPlatformKey.String("aws_lambda") - // AWS Elastic Beanstalk - CloudPlatformAWSElasticBeanstalk = CloudPlatformKey.String("aws_elastic_beanstalk") - // AWS App Runner - CloudPlatformAWSAppRunner = CloudPlatformKey.String("aws_app_runner") - // Red Hat OpenShift on AWS (ROSA) - CloudPlatformAWSOpenshift = CloudPlatformKey.String("aws_openshift") - // Azure Virtual Machines - CloudPlatformAzureVM = CloudPlatformKey.String("azure_vm") - // Azure Container Instances - CloudPlatformAzureContainerInstances = CloudPlatformKey.String("azure_container_instances") - // Azure Kubernetes Service - CloudPlatformAzureAKS = CloudPlatformKey.String("azure_aks") - // Azure Functions - CloudPlatformAzureFunctions = CloudPlatformKey.String("azure_functions") - // Azure App Service - CloudPlatformAzureAppService = CloudPlatformKey.String("azure_app_service") - // Azure Red Hat OpenShift - CloudPlatformAzureOpenshift = CloudPlatformKey.String("azure_openshift") - // Google Bare Metal Solution (BMS) - CloudPlatformGCPBareMetalSolution = CloudPlatformKey.String("gcp_bare_metal_solution") - // Google Cloud Compute Engine (GCE) - CloudPlatformGCPComputeEngine = CloudPlatformKey.String("gcp_compute_engine") - // Google Cloud Run - CloudPlatformGCPCloudRun = CloudPlatformKey.String("gcp_cloud_run") - // Google Cloud Kubernetes Engine (GKE) - CloudPlatformGCPKubernetesEngine = CloudPlatformKey.String("gcp_kubernetes_engine") - // Google Cloud Functions (GCF) - CloudPlatformGCPCloudFunctions = CloudPlatformKey.String("gcp_cloud_functions") - // Google Cloud App Engine (GAE) - CloudPlatformGCPAppEngine = CloudPlatformKey.String("gcp_app_engine") - // Red Hat OpenShift on Google Cloud - CloudPlatformGCPOpenshift = CloudPlatformKey.String("gcp_openshift") - // Red Hat OpenShift on IBM Cloud - CloudPlatformIbmCloudOpenshift = CloudPlatformKey.String("ibm_cloud_openshift") - // Tencent Cloud Cloud Virtual Machine (CVM) - CloudPlatformTencentCloudCvm = CloudPlatformKey.String("tencent_cloud_cvm") - // Tencent Cloud Elastic Kubernetes Service (EKS) - CloudPlatformTencentCloudEKS = CloudPlatformKey.String("tencent_cloud_eks") - // Tencent Cloud Serverless Cloud Function (SCF) - CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf") -) - -// CloudAccountID returns an attribute KeyValue conforming to the -// "cloud.account.id" semantic conventions. It represents the cloud account ID -// the resource is assigned to. -func CloudAccountID(val string) attribute.KeyValue { - return CloudAccountIDKey.String(val) -} - -// CloudRegion returns an attribute KeyValue conforming to the -// "cloud.region" semantic conventions. It represents the geographical region -// the resource is running. -func CloudRegion(val string) attribute.KeyValue { - return CloudRegionKey.String(val) -} - -// CloudResourceID returns an attribute KeyValue conforming to the -// "cloud.resource_id" semantic conventions. It represents the cloud -// provider-specific native identifier of the monitored cloud resource (e.g. an -// [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) -// on AWS, a [fully qualified resource -// ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) -// on Azure, a [full resource -// name](https://cloud.google.com/apis/design/resource_names#full_resource_name) -// on GCP) -func CloudResourceID(val string) attribute.KeyValue { - return CloudResourceIDKey.String(val) -} - -// CloudAvailabilityZone returns an attribute KeyValue conforming to the -// "cloud.availability_zone" semantic conventions. It represents the cloud -// regions often have multiple, isolated locations known as zones to increase -// availability. Availability zone represents the zone where the resource is -// running. -func CloudAvailabilityZone(val string) attribute.KeyValue { - return CloudAvailabilityZoneKey.String(val) -} - -// Resources used by AWS Elastic Container Service (ECS). -const ( - // AWSECSContainerARNKey is the attribute Key conforming to the - // "aws.ecs.container.arn" semantic conventions. It represents the Amazon - // Resource Name (ARN) of an [ECS container - // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9' - AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") - - // AWSECSClusterARNKey is the attribute Key conforming to the - // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an - // [ECS - // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' - AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") - - // AWSECSLaunchtypeKey is the attribute Key conforming to the - // "aws.ecs.launchtype" semantic conventions. It represents the [launch - // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) - // for an ECS task. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") - - // AWSECSTaskARNKey is the attribute Key conforming to the - // "aws.ecs.task.arn" semantic conventions. It represents the ARN of an - // [ECS task - // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b' - AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") - - // AWSECSTaskFamilyKey is the attribute Key conforming to the - // "aws.ecs.task.family" semantic conventions. It represents the task - // definition family this task definition is a member of. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-family' - AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") - - // AWSECSTaskRevisionKey is the attribute Key conforming to the - // "aws.ecs.task.revision" semantic conventions. It represents the revision - // for this task definition. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '8', '26' - AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") -) - -var ( - // ec2 - AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") - // fargate - AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") -) - -// AWSECSContainerARN returns an attribute KeyValue conforming to the -// "aws.ecs.container.arn" semantic conventions. It represents the Amazon -// Resource Name (ARN) of an [ECS container -// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). -func AWSECSContainerARN(val string) attribute.KeyValue { - return AWSECSContainerARNKey.String(val) -} - -// AWSECSClusterARN returns an attribute KeyValue conforming to the -// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS -// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). -func AWSECSClusterARN(val string) attribute.KeyValue { - return AWSECSClusterARNKey.String(val) -} - -// AWSECSTaskARN returns an attribute KeyValue conforming to the -// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS -// task -// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). -func AWSECSTaskARN(val string) attribute.KeyValue { - return AWSECSTaskARNKey.String(val) -} - -// AWSECSTaskFamily returns an attribute KeyValue conforming to the -// "aws.ecs.task.family" semantic conventions. It represents the task -// definition family this task definition is a member of. -func AWSECSTaskFamily(val string) attribute.KeyValue { - return AWSECSTaskFamilyKey.String(val) -} - -// AWSECSTaskRevision returns an attribute KeyValue conforming to the -// "aws.ecs.task.revision" semantic conventions. It represents the revision for -// this task definition. -func AWSECSTaskRevision(val string) attribute.KeyValue { - return AWSECSTaskRevisionKey.String(val) -} - -// Resources used by AWS Elastic Kubernetes Service (EKS). -const ( - // AWSEKSClusterARNKey is the attribute Key conforming to the - // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an - // EKS cluster. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' - AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") -) - -// AWSEKSClusterARN returns an attribute KeyValue conforming to the -// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS -// cluster. -func AWSEKSClusterARN(val string) attribute.KeyValue { - return AWSEKSClusterARNKey.String(val) -} - -// Resources specific to Amazon Web Services. -const ( - // AWSLogGroupNamesKey is the attribute Key conforming to the - // "aws.log.group.names" semantic conventions. It represents the name(s) of - // the AWS log group(s) an application is writing to. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '/aws/lambda/my-function', 'opentelemetry-service' - // Note: Multiple log groups must be supported for cases like - // multi-container applications, where a single application has sidecar - // containers, and each write to their own log group. - AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") - - // AWSLogGroupARNsKey is the attribute Key conforming to the - // "aws.log.group.arns" semantic conventions. It represents the Amazon - // Resource Name(s) (ARN) of the AWS log group(s). - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*' - // Note: See the [log group ARN format - // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") - - // AWSLogStreamNamesKey is the attribute Key conforming to the - // "aws.log.stream.names" semantic conventions. It represents the name(s) - // of the AWS log stream(s) an application is writing to. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' - AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") - - // AWSLogStreamARNsKey is the attribute Key conforming to the - // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of - // the AWS log stream(s). - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' - // Note: See the [log stream ARN format - // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - // One log group can contain several log streams, so these ARNs necessarily - // identify both a log group and a log stream. - AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") -) - -// AWSLogGroupNames returns an attribute KeyValue conforming to the -// "aws.log.group.names" semantic conventions. It represents the name(s) of the -// AWS log group(s) an application is writing to. -func AWSLogGroupNames(val ...string) attribute.KeyValue { - return AWSLogGroupNamesKey.StringSlice(val) -} - -// AWSLogGroupARNs returns an attribute KeyValue conforming to the -// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource -// Name(s) (ARN) of the AWS log group(s). -func AWSLogGroupARNs(val ...string) attribute.KeyValue { - return AWSLogGroupARNsKey.StringSlice(val) -} - -// AWSLogStreamNames returns an attribute KeyValue conforming to the -// "aws.log.stream.names" semantic conventions. It represents the name(s) of -// the AWS log stream(s) an application is writing to. -func AWSLogStreamNames(val ...string) attribute.KeyValue { - return AWSLogStreamNamesKey.StringSlice(val) -} - -// AWSLogStreamARNs returns an attribute KeyValue conforming to the -// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the -// AWS log stream(s). -func AWSLogStreamARNs(val ...string) attribute.KeyValue { - return AWSLogStreamARNsKey.StringSlice(val) -} - -// Resource used by Google Cloud Run. -const ( - // GCPCloudRunJobExecutionKey is the attribute Key conforming to the - // "gcp.cloud_run.job.execution" semantic conventions. It represents the - // name of the Cloud Run - // [execution](https://cloud.google.com/run/docs/managing/job-executions) - // being run for the Job, as set by the - // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) - // environment variable. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'job-name-xxxx', 'sample-job-mdw84' - GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution") - - // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the - // "gcp.cloud_run.job.task_index" semantic conventions. It represents the - // index for a task within an execution as provided by the - // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) - // environment variable. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 1 - GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index") -) - -// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the -// "gcp.cloud_run.job.execution" semantic conventions. It represents the name -// of the Cloud Run -// [execution](https://cloud.google.com/run/docs/managing/job-executions) being -// run for the Job, as set by the -// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) -// environment variable. -func GCPCloudRunJobExecution(val string) attribute.KeyValue { - return GCPCloudRunJobExecutionKey.String(val) -} - -// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the -// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index -// for a task within an execution as provided by the -// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) -// environment variable. -func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue { - return GCPCloudRunJobTaskIndexKey.Int(val) -} - -// Resources used by Google Compute Engine (GCE). -const ( - // GCPGceInstanceNameKey is the attribute Key conforming to the - // "gcp.gce.instance.name" semantic conventions. It represents the instance - // name of a GCE instance. This is the value provided by `host.name`, the - // visible name of the instance in the Cloud Console UI, and the prefix for - // the default hostname of the instance as defined by the [default internal - // DNS - // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'instance-1', 'my-vm-name' - GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name") - - // GCPGceInstanceHostnameKey is the attribute Key conforming to the - // "gcp.gce.instance.hostname" semantic conventions. It represents the - // hostname of a GCE instance. This is the full value of the default or - // [custom - // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'my-host1234.example.com', - // 'sample-vm.us-west1-b.c.my-project.internal' - GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname") -) - -// GCPGceInstanceName returns an attribute KeyValue conforming to the -// "gcp.gce.instance.name" semantic conventions. It represents the instance -// name of a GCE instance. This is the value provided by `host.name`, the -// visible name of the instance in the Cloud Console UI, and the prefix for the -// default hostname of the instance as defined by the [default internal DNS -// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). -func GCPGceInstanceName(val string) attribute.KeyValue { - return GCPGceInstanceNameKey.String(val) -} - -// GCPGceInstanceHostname returns an attribute KeyValue conforming to the -// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname -// of a GCE instance. This is the full value of the default or [custom -// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). -func GCPGceInstanceHostname(val string) attribute.KeyValue { - return GCPGceInstanceHostnameKey.String(val) -} - -// Heroku dyno metadata -const ( - // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the - // "heroku.release.creation_timestamp" semantic conventions. It represents - // the time and date the release was created - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2022-10-23T18:00:42Z' - HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp") - - // HerokuReleaseCommitKey is the attribute Key conforming to the - // "heroku.release.commit" semantic conventions. It represents the commit - // hash for the current release - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec' - HerokuReleaseCommitKey = attribute.Key("heroku.release.commit") - - // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id" - // semantic conventions. It represents the unique identifier for the - // application - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da' - HerokuAppIDKey = attribute.Key("heroku.app.id") -) - -// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming -// to the "heroku.release.creation_timestamp" semantic conventions. It -// represents the time and date the release was created -func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue { - return HerokuReleaseCreationTimestampKey.String(val) -} - -// HerokuReleaseCommit returns an attribute KeyValue conforming to the -// "heroku.release.commit" semantic conventions. It represents the commit hash -// for the current release -func HerokuReleaseCommit(val string) attribute.KeyValue { - return HerokuReleaseCommitKey.String(val) -} - -// HerokuAppID returns an attribute KeyValue conforming to the -// "heroku.app.id" semantic conventions. It represents the unique identifier -// for the application -func HerokuAppID(val string) attribute.KeyValue { - return HerokuAppIDKey.String(val) -} - -// A container instance. -const ( - // ContainerNameKey is the attribute Key conforming to the "container.name" - // semantic conventions. It represents the container name used by container - // runtime. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-autoconf' - ContainerNameKey = attribute.Key("container.name") - - // ContainerIDKey is the attribute Key conforming to the "container.id" - // semantic conventions. It represents the container ID. Usually a UUID, as - // for example used to [identify Docker - // containers](https://docs.docker.com/engine/reference/run/#container-identification). - // The UUID might be abbreviated. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'a3bf90e006b2' - ContainerIDKey = attribute.Key("container.id") - - // ContainerRuntimeKey is the attribute Key conforming to the - // "container.runtime" semantic conventions. It represents the container - // runtime managing this container. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'docker', 'containerd', 'rkt' - ContainerRuntimeKey = attribute.Key("container.runtime") - - // ContainerImageNameKey is the attribute Key conforming to the - // "container.image.name" semantic conventions. It represents the name of - // the image the container was built on. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'gcr.io/opentelemetry/operator' - ContainerImageNameKey = attribute.Key("container.image.name") - - // ContainerImageTagKey is the attribute Key conforming to the - // "container.image.tag" semantic conventions. It represents the container - // image tag. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '0.1' - ContainerImageTagKey = attribute.Key("container.image.tag") - - // ContainerImageIDKey is the attribute Key conforming to the - // "container.image.id" semantic conventions. It represents the runtime - // specific image identifier. Usually a hash algorithm followed by a UUID. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f' - // Note: Docker defines a sha256 of the image id; `container.image.id` - // corresponds to the `Image` field from the Docker container inspect - // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) - // endpoint. - // K8S defines a link to the container registry repository with digest - // `"imageID": "registry.azurecr.io - // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. - // OCI defines a digest of manifest. - ContainerImageIDKey = attribute.Key("container.image.id") - - // ContainerCommandKey is the attribute Key conforming to the - // "container.command" semantic conventions. It represents the command used - // to run the container (i.e. the command name). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol' - // Note: If using embedded credentials or sensitive data, it is recommended - // to remove them to prevent potential leakage. - ContainerCommandKey = attribute.Key("container.command") - - // ContainerCommandLineKey is the attribute Key conforming to the - // "container.command_line" semantic conventions. It represents the full - // command run by the container as a single string representing the full - // command. [2] - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol --config config.yaml' - ContainerCommandLineKey = attribute.Key("container.command_line") - - // ContainerCommandArgsKey is the attribute Key conforming to the - // "container.command_args" semantic conventions. It represents the all the - // command arguments (including the command/executable itself) run by the - // container. [2] - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol, --config, config.yaml' - ContainerCommandArgsKey = attribute.Key("container.command_args") -) - -// ContainerName returns an attribute KeyValue conforming to the -// "container.name" semantic conventions. It represents the container name used -// by container runtime. -func ContainerName(val string) attribute.KeyValue { - return ContainerNameKey.String(val) -} - -// ContainerID returns an attribute KeyValue conforming to the -// "container.id" semantic conventions. It represents the container ID. Usually -// a UUID, as for example used to [identify Docker -// containers](https://docs.docker.com/engine/reference/run/#container-identification). -// The UUID might be abbreviated. -func ContainerID(val string) attribute.KeyValue { - return ContainerIDKey.String(val) -} - -// ContainerRuntime returns an attribute KeyValue conforming to the -// "container.runtime" semantic conventions. It represents the container -// runtime managing this container. -func ContainerRuntime(val string) attribute.KeyValue { - return ContainerRuntimeKey.String(val) -} - -// ContainerImageName returns an attribute KeyValue conforming to the -// "container.image.name" semantic conventions. It represents the name of the -// image the container was built on. -func ContainerImageName(val string) attribute.KeyValue { - return ContainerImageNameKey.String(val) -} - -// ContainerImageTag returns an attribute KeyValue conforming to the -// "container.image.tag" semantic conventions. It represents the container -// image tag. -func ContainerImageTag(val string) attribute.KeyValue { - return ContainerImageTagKey.String(val) -} - -// ContainerImageID returns an attribute KeyValue conforming to the -// "container.image.id" semantic conventions. It represents the runtime -// specific image identifier. Usually a hash algorithm followed by a UUID. -func ContainerImageID(val string) attribute.KeyValue { - return ContainerImageIDKey.String(val) -} - -// ContainerCommand returns an attribute KeyValue conforming to the -// "container.command" semantic conventions. It represents the command used to -// run the container (i.e. the command name). -func ContainerCommand(val string) attribute.KeyValue { - return ContainerCommandKey.String(val) -} - -// ContainerCommandLine returns an attribute KeyValue conforming to the -// "container.command_line" semantic conventions. It represents the full -// command run by the container as a single string representing the full -// command. [2] -func ContainerCommandLine(val string) attribute.KeyValue { - return ContainerCommandLineKey.String(val) -} - -// ContainerCommandArgs returns an attribute KeyValue conforming to the -// "container.command_args" semantic conventions. It represents the all the -// command arguments (including the command/executable itself) run by the -// container. [2] -func ContainerCommandArgs(val ...string) attribute.KeyValue { - return ContainerCommandArgsKey.StringSlice(val) -} - -// The software deployment. -const ( - // DeploymentEnvironmentKey is the attribute Key conforming to the - // "deployment.environment" semantic conventions. It represents the name of - // the [deployment - // environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka - // deployment tier). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'staging', 'production' - DeploymentEnvironmentKey = attribute.Key("deployment.environment") -) - -// DeploymentEnvironment returns an attribute KeyValue conforming to the -// "deployment.environment" semantic conventions. It represents the name of the -// [deployment -// environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka -// deployment tier). -func DeploymentEnvironment(val string) attribute.KeyValue { - return DeploymentEnvironmentKey.String(val) -} - -// The device on which the process represented by this resource is running. -const ( - // DeviceIDKey is the attribute Key conforming to the "device.id" semantic - // conventions. It represents a unique identifier representing the device - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092' - // Note: The device identifier MUST only be defined using the values - // outlined below. This value is not an advertising identifier and MUST NOT - // be used as such. On iOS (Swift or Objective-C), this value MUST be equal - // to the [vendor - // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). - // On Android (Java or Kotlin), this value MUST be equal to the Firebase - // Installation ID or a globally unique UUID which is persisted across - // sessions in your application. More information can be found - // [here](https://developer.android.com/training/articles/user-data-ids) on - // best practices and exact implementation details. Caution should be taken - // when storing personal data or anything which can identify a user. GDPR - // and data protection laws may apply, ensure you do your own due - // diligence. - DeviceIDKey = attribute.Key("device.id") - - // DeviceModelIdentifierKey is the attribute Key conforming to the - // "device.model.identifier" semantic conventions. It represents the model - // identifier for the device - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'iPhone3,4', 'SM-G920F' - // Note: It's recommended this value represents a machine readable version - // of the model identifier rather than the market or consumer-friendly name - // of the device. - DeviceModelIdentifierKey = attribute.Key("device.model.identifier") - - // DeviceModelNameKey is the attribute Key conforming to the - // "device.model.name" semantic conventions. It represents the marketing - // name for the device model - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6' - // Note: It's recommended this value represents a human readable version of - // the device model rather than a machine readable alternative. - DeviceModelNameKey = attribute.Key("device.model.name") - - // DeviceManufacturerKey is the attribute Key conforming to the - // "device.manufacturer" semantic conventions. It represents the name of - // the device manufacturer - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Apple', 'Samsung' - // Note: The Android OS provides this field via - // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). - // iOS apps SHOULD hardcode the value `Apple`. - DeviceManufacturerKey = attribute.Key("device.manufacturer") -) - -// DeviceID returns an attribute KeyValue conforming to the "device.id" -// semantic conventions. It represents a unique identifier representing the -// device -func DeviceID(val string) attribute.KeyValue { - return DeviceIDKey.String(val) -} - -// DeviceModelIdentifier returns an attribute KeyValue conforming to the -// "device.model.identifier" semantic conventions. It represents the model -// identifier for the device -func DeviceModelIdentifier(val string) attribute.KeyValue { - return DeviceModelIdentifierKey.String(val) -} - -// DeviceModelName returns an attribute KeyValue conforming to the -// "device.model.name" semantic conventions. It represents the marketing name -// for the device model -func DeviceModelName(val string) attribute.KeyValue { - return DeviceModelNameKey.String(val) -} - -// DeviceManufacturer returns an attribute KeyValue conforming to the -// "device.manufacturer" semantic conventions. It represents the name of the -// device manufacturer -func DeviceManufacturer(val string) attribute.KeyValue { - return DeviceManufacturerKey.String(val) -} - -// A serverless instance. -const ( - // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic - // conventions. It represents the name of the single function that this - // runtime instance executes. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'my-function', 'myazurefunctionapp/some-function-name' - // Note: This is the name of the function as configured/deployed on the - // FaaS - // platform and is usually different from the name of the callback - // function (which may be stored in the - // [`code.namespace`/`code.function`](/docs/general/general-attributes.md#source-code-attributes) - // span attributes). - // - // For some cloud providers, the above definition is ambiguous. The - // following - // definition of function name MUST be used for this attribute - // (and consequently the span name) for the listed cloud - // providers/products: - // - // * **Azure:** The full name `/`, i.e., function app name - // followed by a forward slash followed by the function name (this form - // can also be seen in the resource JSON for the function). - // This means that a span attribute MUST be used, as an Azure function - // app can host multiple functions that would usually share - // a TracerProvider (see also the `cloud.resource_id` attribute). - FaaSNameKey = attribute.Key("faas.name") - - // FaaSVersionKey is the attribute Key conforming to the "faas.version" - // semantic conventions. It represents the immutable version of the - // function being executed. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '26', 'pinkfroid-00002' - // Note: Depending on the cloud provider and platform, use: - // - // * **AWS Lambda:** The [function - // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - // (an integer represented as a decimal string). - // * **Google Cloud Run (Services):** The - // [revision](https://cloud.google.com/run/docs/managing/revisions) - // (i.e., the function name plus the revision suffix). - // * **Google Cloud Functions:** The value of the - // [`K_REVISION` environment - // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - // * **Azure Functions:** Not applicable. Do not set this attribute. - FaaSVersionKey = attribute.Key("faas.version") - - // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" - // semantic conventions. It represents the execution environment ID as a - // string, that will be potentially reused for other invocations to the - // same function/function version. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de' - // Note: * **AWS Lambda:** Use the (full) log stream name. - FaaSInstanceKey = attribute.Key("faas.instance") - - // FaaSMaxMemoryKey is the attribute Key conforming to the - // "faas.max_memory" semantic conventions. It represents the amount of - // memory available to the serverless function converted to Bytes. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 134217728 - // Note: It's recommended to set this attribute since e.g. too little - // memory can easily stop a Java AWS Lambda function from working - // correctly. On AWS Lambda, the environment variable - // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must - // be multiplied by 1,048,576). - FaaSMaxMemoryKey = attribute.Key("faas.max_memory") -) - -// FaaSName returns an attribute KeyValue conforming to the "faas.name" -// semantic conventions. It represents the name of the single function that -// this runtime instance executes. -func FaaSName(val string) attribute.KeyValue { - return FaaSNameKey.String(val) -} - -// FaaSVersion returns an attribute KeyValue conforming to the -// "faas.version" semantic conventions. It represents the immutable version of -// the function being executed. -func FaaSVersion(val string) attribute.KeyValue { - return FaaSVersionKey.String(val) -} - -// FaaSInstance returns an attribute KeyValue conforming to the -// "faas.instance" semantic conventions. It represents the execution -// environment ID as a string, that will be potentially reused for other -// invocations to the same function/function version. -func FaaSInstance(val string) attribute.KeyValue { - return FaaSInstanceKey.String(val) -} - -// FaaSMaxMemory returns an attribute KeyValue conforming to the -// "faas.max_memory" semantic conventions. It represents the amount of memory -// available to the serverless function converted to Bytes. -func FaaSMaxMemory(val int) attribute.KeyValue { - return FaaSMaxMemoryKey.Int(val) -} - -// A host is defined as a computing instance. For example, physical servers, -// virtual machines, switches or disk array. -const ( - // HostIDKey is the attribute Key conforming to the "host.id" semantic - // conventions. It represents the unique host ID. For Cloud, this must be - // the instance_id assigned by the cloud provider. For non-containerized - // systems, this should be the `machine-id`. See the table below for the - // sources to use to determine the `machine-id` based on operating system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'fdbf79e8af94cb7f9e8df36789187052' - HostIDKey = attribute.Key("host.id") - - // HostNameKey is the attribute Key conforming to the "host.name" semantic - // conventions. It represents the name of the host. On Unix systems, it may - // contain what the hostname command returns, or the fully qualified - // hostname, or another name specified by the user. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-test' - HostNameKey = attribute.Key("host.name") - - // HostTypeKey is the attribute Key conforming to the "host.type" semantic - // conventions. It represents the type of host. For Cloud, this must be the - // machine type. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'n1-standard-1' - HostTypeKey = attribute.Key("host.type") - - // HostArchKey is the attribute Key conforming to the "host.arch" semantic - // conventions. It represents the CPU architecture the host system is - // running on. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - HostArchKey = attribute.Key("host.arch") - - // HostImageNameKey is the attribute Key conforming to the - // "host.image.name" semantic conventions. It represents the name of the VM - // image or OS install the host was instantiated from. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905' - HostImageNameKey = attribute.Key("host.image.name") - - // HostImageIDKey is the attribute Key conforming to the "host.image.id" - // semantic conventions. It represents the vM image ID or host OS image ID. - // For Cloud, this value is from the provider. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'ami-07b06b442921831e5' - HostImageIDKey = attribute.Key("host.image.id") - - // HostImageVersionKey is the attribute Key conforming to the - // "host.image.version" semantic conventions. It represents the version - // string of the VM image or host OS as defined in [Version - // Attributes](README.md#version-attributes). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '0.1' - HostImageVersionKey = attribute.Key("host.image.version") -) - -var ( - // AMD64 - HostArchAMD64 = HostArchKey.String("amd64") - // ARM32 - HostArchARM32 = HostArchKey.String("arm32") - // ARM64 - HostArchARM64 = HostArchKey.String("arm64") - // Itanium - HostArchIA64 = HostArchKey.String("ia64") - // 32-bit PowerPC - HostArchPPC32 = HostArchKey.String("ppc32") - // 64-bit PowerPC - HostArchPPC64 = HostArchKey.String("ppc64") - // IBM z/Architecture - HostArchS390x = HostArchKey.String("s390x") - // 32-bit x86 - HostArchX86 = HostArchKey.String("x86") -) - -// HostID returns an attribute KeyValue conforming to the "host.id" semantic -// conventions. It represents the unique host ID. For Cloud, this must be the -// instance_id assigned by the cloud provider. For non-containerized systems, -// this should be the `machine-id`. See the table below for the sources to use -// to determine the `machine-id` based on operating system. -func HostID(val string) attribute.KeyValue { - return HostIDKey.String(val) -} - -// HostName returns an attribute KeyValue conforming to the "host.name" -// semantic conventions. It represents the name of the host. On Unix systems, -// it may contain what the hostname command returns, or the fully qualified -// hostname, or another name specified by the user. -func HostName(val string) attribute.KeyValue { - return HostNameKey.String(val) -} - -// HostType returns an attribute KeyValue conforming to the "host.type" -// semantic conventions. It represents the type of host. For Cloud, this must -// be the machine type. -func HostType(val string) attribute.KeyValue { - return HostTypeKey.String(val) -} - -// HostImageName returns an attribute KeyValue conforming to the -// "host.image.name" semantic conventions. It represents the name of the VM -// image or OS install the host was instantiated from. -func HostImageName(val string) attribute.KeyValue { - return HostImageNameKey.String(val) -} - -// HostImageID returns an attribute KeyValue conforming to the -// "host.image.id" semantic conventions. It represents the vM image ID or host -// OS image ID. For Cloud, this value is from the provider. -func HostImageID(val string) attribute.KeyValue { - return HostImageIDKey.String(val) -} - -// HostImageVersion returns an attribute KeyValue conforming to the -// "host.image.version" semantic conventions. It represents the version string -// of the VM image or host OS as defined in [Version -// Attributes](README.md#version-attributes). -func HostImageVersion(val string) attribute.KeyValue { - return HostImageVersionKey.String(val) -} - -// A Kubernetes Cluster. -const ( - // K8SClusterNameKey is the attribute Key conforming to the - // "k8s.cluster.name" semantic conventions. It represents the name of the - // cluster. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-cluster' - K8SClusterNameKey = attribute.Key("k8s.cluster.name") - - // K8SClusterUIDKey is the attribute Key conforming to the - // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for - // the cluster, set to the UID of the `kube-system` namespace. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d' - // Note: K8S does not have support for obtaining a cluster ID. If this is - // ever - // added, we will recommend collecting the `k8s.cluster.uid` through the - // official APIs. In the meantime, we are able to use the `uid` of the - // `kube-system` namespace as a proxy for cluster ID. Read on for the - // rationale. - // - // Every object created in a K8S cluster is assigned a distinct UID. The - // `kube-system` namespace is used by Kubernetes itself and will exist - // for the lifetime of the cluster. Using the `uid` of the `kube-system` - // namespace is a reasonable proxy for the K8S ClusterID as it will only - // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are - // UUIDs as standardized by - // [ISO/IEC 9834-8 and ITU-T - // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). - // Which states: - // - // > If generated according to one of the mechanisms defined in Rec. - // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be - // different from all other UUIDs generated before 3603 A.D., or is - // extremely likely to be different (depending on the mechanism chosen). - // - // Therefore, UIDs between clusters should be extremely unlikely to - // conflict. - K8SClusterUIDKey = attribute.Key("k8s.cluster.uid") -) - -// K8SClusterName returns an attribute KeyValue conforming to the -// "k8s.cluster.name" semantic conventions. It represents the name of the -// cluster. -func K8SClusterName(val string) attribute.KeyValue { - return K8SClusterNameKey.String(val) -} - -// K8SClusterUID returns an attribute KeyValue conforming to the -// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the -// cluster, set to the UID of the `kube-system` namespace. -func K8SClusterUID(val string) attribute.KeyValue { - return K8SClusterUIDKey.String(val) -} - -// A Kubernetes Node object. -const ( - // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name" - // semantic conventions. It represents the name of the Node. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'node-1' - K8SNodeNameKey = attribute.Key("k8s.node.name") - - // K8SNodeUIDKey is the attribute Key conforming to the "k8s.node.uid" - // semantic conventions. It represents the UID of the Node. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2' - K8SNodeUIDKey = attribute.Key("k8s.node.uid") -) - -// K8SNodeName returns an attribute KeyValue conforming to the -// "k8s.node.name" semantic conventions. It represents the name of the Node. -func K8SNodeName(val string) attribute.KeyValue { - return K8SNodeNameKey.String(val) -} - -// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" -// semantic conventions. It represents the UID of the Node. -func K8SNodeUID(val string) attribute.KeyValue { - return K8SNodeUIDKey.String(val) -} - -// A Kubernetes Namespace. -const ( - // K8SNamespaceNameKey is the attribute Key conforming to the - // "k8s.namespace.name" semantic conventions. It represents the name of the - // namespace that the pod is running in. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'default' - K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") -) - -// K8SNamespaceName returns an attribute KeyValue conforming to the -// "k8s.namespace.name" semantic conventions. It represents the name of the -// namespace that the pod is running in. -func K8SNamespaceName(val string) attribute.KeyValue { - return K8SNamespaceNameKey.String(val) -} - -// A Kubernetes Pod object. -const ( - // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" - // semantic conventions. It represents the UID of the Pod. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SPodUIDKey = attribute.Key("k8s.pod.uid") - - // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" - // semantic conventions. It represents the name of the Pod. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-pod-autoconf' - K8SPodNameKey = attribute.Key("k8s.pod.name") -) - -// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" -// semantic conventions. It represents the UID of the Pod. -func K8SPodUID(val string) attribute.KeyValue { - return K8SPodUIDKey.String(val) -} - -// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" -// semantic conventions. It represents the name of the Pod. -func K8SPodName(val string) attribute.KeyValue { - return K8SPodNameKey.String(val) -} - -// A container in a -// [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). -const ( - // K8SContainerNameKey is the attribute Key conforming to the - // "k8s.container.name" semantic conventions. It represents the name of the - // Container from Pod specification, must be unique within a Pod. Container - // runtime usually uses different globally unique name (`container.name`). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'redis' - K8SContainerNameKey = attribute.Key("k8s.container.name") - - // K8SContainerRestartCountKey is the attribute Key conforming to the - // "k8s.container.restart_count" semantic conventions. It represents the - // number of times the container was restarted. This attribute can be used - // to identify a particular container (running or stopped) within a - // container spec. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 2 - K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") -) - -// K8SContainerName returns an attribute KeyValue conforming to the -// "k8s.container.name" semantic conventions. It represents the name of the -// Container from Pod specification, must be unique within a Pod. Container -// runtime usually uses different globally unique name (`container.name`). -func K8SContainerName(val string) attribute.KeyValue { - return K8SContainerNameKey.String(val) -} - -// K8SContainerRestartCount returns an attribute KeyValue conforming to the -// "k8s.container.restart_count" semantic conventions. It represents the number -// of times the container was restarted. This attribute can be used to identify -// a particular container (running or stopped) within a container spec. -func K8SContainerRestartCount(val int) attribute.KeyValue { - return K8SContainerRestartCountKey.Int(val) -} - -// A Kubernetes ReplicaSet object. -const ( - // K8SReplicaSetUIDKey is the attribute Key conforming to the - // "k8s.replicaset.uid" semantic conventions. It represents the UID of the - // ReplicaSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") - - // K8SReplicaSetNameKey is the attribute Key conforming to the - // "k8s.replicaset.name" semantic conventions. It represents the name of - // the ReplicaSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") -) - -// K8SReplicaSetUID returns an attribute KeyValue conforming to the -// "k8s.replicaset.uid" semantic conventions. It represents the UID of the -// ReplicaSet. -func K8SReplicaSetUID(val string) attribute.KeyValue { - return K8SReplicaSetUIDKey.String(val) -} - -// K8SReplicaSetName returns an attribute KeyValue conforming to the -// "k8s.replicaset.name" semantic conventions. It represents the name of the -// ReplicaSet. -func K8SReplicaSetName(val string) attribute.KeyValue { - return K8SReplicaSetNameKey.String(val) -} - -// A Kubernetes Deployment object. -const ( - // K8SDeploymentUIDKey is the attribute Key conforming to the - // "k8s.deployment.uid" semantic conventions. It represents the UID of the - // Deployment. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") - - // K8SDeploymentNameKey is the attribute Key conforming to the - // "k8s.deployment.name" semantic conventions. It represents the name of - // the Deployment. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") -) - -// K8SDeploymentUID returns an attribute KeyValue conforming to the -// "k8s.deployment.uid" semantic conventions. It represents the UID of the -// Deployment. -func K8SDeploymentUID(val string) attribute.KeyValue { - return K8SDeploymentUIDKey.String(val) -} - -// K8SDeploymentName returns an attribute KeyValue conforming to the -// "k8s.deployment.name" semantic conventions. It represents the name of the -// Deployment. -func K8SDeploymentName(val string) attribute.KeyValue { - return K8SDeploymentNameKey.String(val) -} - -// A Kubernetes StatefulSet object. -const ( - // K8SStatefulSetUIDKey is the attribute Key conforming to the - // "k8s.statefulset.uid" semantic conventions. It represents the UID of the - // StatefulSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") - - // K8SStatefulSetNameKey is the attribute Key conforming to the - // "k8s.statefulset.name" semantic conventions. It represents the name of - // the StatefulSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") -) - -// K8SStatefulSetUID returns an attribute KeyValue conforming to the -// "k8s.statefulset.uid" semantic conventions. It represents the UID of the -// StatefulSet. -func K8SStatefulSetUID(val string) attribute.KeyValue { - return K8SStatefulSetUIDKey.String(val) -} - -// K8SStatefulSetName returns an attribute KeyValue conforming to the -// "k8s.statefulset.name" semantic conventions. It represents the name of the -// StatefulSet. -func K8SStatefulSetName(val string) attribute.KeyValue { - return K8SStatefulSetNameKey.String(val) -} - -// A Kubernetes DaemonSet object. -const ( - // K8SDaemonSetUIDKey is the attribute Key conforming to the - // "k8s.daemonset.uid" semantic conventions. It represents the UID of the - // DaemonSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") - - // K8SDaemonSetNameKey is the attribute Key conforming to the - // "k8s.daemonset.name" semantic conventions. It represents the name of the - // DaemonSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") -) - -// K8SDaemonSetUID returns an attribute KeyValue conforming to the -// "k8s.daemonset.uid" semantic conventions. It represents the UID of the -// DaemonSet. -func K8SDaemonSetUID(val string) attribute.KeyValue { - return K8SDaemonSetUIDKey.String(val) -} - -// K8SDaemonSetName returns an attribute KeyValue conforming to the -// "k8s.daemonset.name" semantic conventions. It represents the name of the -// DaemonSet. -func K8SDaemonSetName(val string) attribute.KeyValue { - return K8SDaemonSetNameKey.String(val) -} - -// A Kubernetes Job object. -const ( - // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" - // semantic conventions. It represents the UID of the Job. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SJobUIDKey = attribute.Key("k8s.job.uid") - - // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" - // semantic conventions. It represents the name of the Job. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SJobNameKey = attribute.Key("k8s.job.name") -) - -// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" -// semantic conventions. It represents the UID of the Job. -func K8SJobUID(val string) attribute.KeyValue { - return K8SJobUIDKey.String(val) -} - -// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" -// semantic conventions. It represents the name of the Job. -func K8SJobName(val string) attribute.KeyValue { - return K8SJobNameKey.String(val) -} - -// A Kubernetes CronJob object. -const ( - // K8SCronJobUIDKey is the attribute Key conforming to the - // "k8s.cronjob.uid" semantic conventions. It represents the UID of the - // CronJob. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") - - // K8SCronJobNameKey is the attribute Key conforming to the - // "k8s.cronjob.name" semantic conventions. It represents the name of the - // CronJob. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") -) - -// K8SCronJobUID returns an attribute KeyValue conforming to the -// "k8s.cronjob.uid" semantic conventions. It represents the UID of the -// CronJob. -func K8SCronJobUID(val string) attribute.KeyValue { - return K8SCronJobUIDKey.String(val) -} - -// K8SCronJobName returns an attribute KeyValue conforming to the -// "k8s.cronjob.name" semantic conventions. It represents the name of the -// CronJob. -func K8SCronJobName(val string) attribute.KeyValue { - return K8SCronJobNameKey.String(val) -} - -// The operating system (OS) on which the process represented by this resource -// is running. -const ( - // OSTypeKey is the attribute Key conforming to the "os.type" semantic - // conventions. It represents the operating system type. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - OSTypeKey = attribute.Key("os.type") - - // OSDescriptionKey is the attribute Key conforming to the "os.description" - // semantic conventions. It represents the human readable (not intended to - // be parsed) OS version information, like e.g. reported by `ver` or - // `lsb_release -a` commands. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 - // LTS' - OSDescriptionKey = attribute.Key("os.description") - - // OSNameKey is the attribute Key conforming to the "os.name" semantic - // conventions. It represents the human readable operating system name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'iOS', 'Android', 'Ubuntu' - OSNameKey = attribute.Key("os.name") - - // OSVersionKey is the attribute Key conforming to the "os.version" - // semantic conventions. It represents the version string of the operating - // system as defined in [Version - // Attributes](/docs/resource/README.md#version-attributes). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '14.2.1', '18.04.1' - OSVersionKey = attribute.Key("os.version") -) - -var ( - // Microsoft Windows - OSTypeWindows = OSTypeKey.String("windows") - // Linux - OSTypeLinux = OSTypeKey.String("linux") - // Apple Darwin - OSTypeDarwin = OSTypeKey.String("darwin") - // FreeBSD - OSTypeFreeBSD = OSTypeKey.String("freebsd") - // NetBSD - OSTypeNetBSD = OSTypeKey.String("netbsd") - // OpenBSD - OSTypeOpenBSD = OSTypeKey.String("openbsd") - // DragonFly BSD - OSTypeDragonflyBSD = OSTypeKey.String("dragonflybsd") - // HP-UX (Hewlett Packard Unix) - OSTypeHPUX = OSTypeKey.String("hpux") - // AIX (Advanced Interactive eXecutive) - OSTypeAIX = OSTypeKey.String("aix") - // SunOS, Oracle Solaris - OSTypeSolaris = OSTypeKey.String("solaris") - // IBM z/OS - OSTypeZOS = OSTypeKey.String("z_os") -) - -// OSDescription returns an attribute KeyValue conforming to the -// "os.description" semantic conventions. It represents the human readable (not -// intended to be parsed) OS version information, like e.g. reported by `ver` -// or `lsb_release -a` commands. -func OSDescription(val string) attribute.KeyValue { - return OSDescriptionKey.String(val) -} - -// OSName returns an attribute KeyValue conforming to the "os.name" semantic -// conventions. It represents the human readable operating system name. -func OSName(val string) attribute.KeyValue { - return OSNameKey.String(val) -} - -// OSVersion returns an attribute KeyValue conforming to the "os.version" -// semantic conventions. It represents the version string of the operating -// system as defined in [Version -// Attributes](/docs/resource/README.md#version-attributes). -func OSVersion(val string) attribute.KeyValue { - return OSVersionKey.String(val) -} - -// An operating system process. -const ( - // ProcessPIDKey is the attribute Key conforming to the "process.pid" - // semantic conventions. It represents the process identifier (PID). - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 1234 - ProcessPIDKey = attribute.Key("process.pid") - - // ProcessParentPIDKey is the attribute Key conforming to the - // "process.parent_pid" semantic conventions. It represents the parent - // Process identifier (PID). - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 111 - ProcessParentPIDKey = attribute.Key("process.parent_pid") - - // ProcessExecutableNameKey is the attribute Key conforming to the - // "process.executable.name" semantic conventions. It represents the name - // of the process executable. On Linux based systems, can be set to the - // `Name` in `proc/[pid]/status`. On Windows, can be set to the base name - // of `GetProcessImageFileNameW`. - // - // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'otelcol' - ProcessExecutableNameKey = attribute.Key("process.executable.name") - - // ProcessExecutablePathKey is the attribute Key conforming to the - // "process.executable.path" semantic conventions. It represents the full - // path to the process executable. On Linux based systems, can be set to - // the target of `proc/[pid]/exe`. On Windows, can be set to the result of - // `GetProcessImageFileNameW`. - // - // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: '/usr/bin/cmd/otelcol' - ProcessExecutablePathKey = attribute.Key("process.executable.path") - - // ProcessCommandKey is the attribute Key conforming to the - // "process.command" semantic conventions. It represents the command used - // to launch the process (i.e. the command name). On Linux based systems, - // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can - // be set to the first parameter extracted from `GetCommandLineW`. - // - // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'cmd/otelcol' - ProcessCommandKey = attribute.Key("process.command") - - // ProcessCommandLineKey is the attribute Key conforming to the - // "process.command_line" semantic conventions. It represents the full - // command used to launch the process as a single string representing the - // full command. On Windows, can be set to the result of `GetCommandLineW`. - // Do not set this if you have to assemble it just for monitoring; use - // `process.command_args` instead. - // - // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"' - ProcessCommandLineKey = attribute.Key("process.command_line") - - // ProcessCommandArgsKey is the attribute Key conforming to the - // "process.command_args" semantic conventions. It represents the all the - // command arguments (including the command/executable itself) as received - // by the process. On Linux-based systems (and some other Unixoid systems - // supporting procfs), can be set according to the list of null-delimited - // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, - // this would be the full argv vector passed to `main`. - // - // Type: string[] - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'cmd/otecol', '--config=config.yaml' - ProcessCommandArgsKey = attribute.Key("process.command_args") - - // ProcessOwnerKey is the attribute Key conforming to the "process.owner" - // semantic conventions. It represents the username of the user that owns - // the process. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'root' - ProcessOwnerKey = attribute.Key("process.owner") -) - -// ProcessPID returns an attribute KeyValue conforming to the "process.pid" -// semantic conventions. It represents the process identifier (PID). -func ProcessPID(val int) attribute.KeyValue { - return ProcessPIDKey.Int(val) -} - -// ProcessParentPID returns an attribute KeyValue conforming to the -// "process.parent_pid" semantic conventions. It represents the parent Process -// identifier (PID). -func ProcessParentPID(val int) attribute.KeyValue { - return ProcessParentPIDKey.Int(val) -} - -// ProcessExecutableName returns an attribute KeyValue conforming to the -// "process.executable.name" semantic conventions. It represents the name of -// the process executable. On Linux based systems, can be set to the `Name` in -// `proc/[pid]/status`. On Windows, can be set to the base name of -// `GetProcessImageFileNameW`. -func ProcessExecutableName(val string) attribute.KeyValue { - return ProcessExecutableNameKey.String(val) -} - -// ProcessExecutablePath returns an attribute KeyValue conforming to the -// "process.executable.path" semantic conventions. It represents the full path -// to the process executable. On Linux based systems, can be set to the target -// of `proc/[pid]/exe`. On Windows, can be set to the result of -// `GetProcessImageFileNameW`. -func ProcessExecutablePath(val string) attribute.KeyValue { - return ProcessExecutablePathKey.String(val) -} - -// ProcessCommand returns an attribute KeyValue conforming to the -// "process.command" semantic conventions. It represents the command used to -// launch the process (i.e. the command name). On Linux based systems, can be -// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to -// the first parameter extracted from `GetCommandLineW`. -func ProcessCommand(val string) attribute.KeyValue { - return ProcessCommandKey.String(val) -} - -// ProcessCommandLine returns an attribute KeyValue conforming to the -// "process.command_line" semantic conventions. It represents the full command -// used to launch the process as a single string representing the full command. -// On Windows, can be set to the result of `GetCommandLineW`. Do not set this -// if you have to assemble it just for monitoring; use `process.command_args` -// instead. -func ProcessCommandLine(val string) attribute.KeyValue { - return ProcessCommandLineKey.String(val) -} - -// ProcessCommandArgs returns an attribute KeyValue conforming to the -// "process.command_args" semantic conventions. It represents the all the -// command arguments (including the command/executable itself) as received by -// the process. On Linux-based systems (and some other Unixoid systems -// supporting procfs), can be set according to the list of null-delimited -// strings extracted from `proc/[pid]/cmdline`. For libc-based executables, -// this would be the full argv vector passed to `main`. -func ProcessCommandArgs(val ...string) attribute.KeyValue { - return ProcessCommandArgsKey.StringSlice(val) -} - -// ProcessOwner returns an attribute KeyValue conforming to the -// "process.owner" semantic conventions. It represents the username of the user -// that owns the process. -func ProcessOwner(val string) attribute.KeyValue { - return ProcessOwnerKey.String(val) -} - -// The single (language) runtime instance which is monitored. -const ( - // ProcessRuntimeNameKey is the attribute Key conforming to the - // "process.runtime.name" semantic conventions. It represents the name of - // the runtime of this process. For compiled native binaries, this SHOULD - // be the name of the compiler. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'OpenJDK Runtime Environment' - ProcessRuntimeNameKey = attribute.Key("process.runtime.name") - - // ProcessRuntimeVersionKey is the attribute Key conforming to the - // "process.runtime.version" semantic conventions. It represents the - // version of the runtime of this process, as returned by the runtime - // without modification. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '14.0.2' - ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") - - // ProcessRuntimeDescriptionKey is the attribute Key conforming to the - // "process.runtime.description" semantic conventions. It represents an - // additional description about the runtime of the process, for example a - // specific vendor customization of the runtime environment. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' - ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") -) - -// ProcessRuntimeName returns an attribute KeyValue conforming to the -// "process.runtime.name" semantic conventions. It represents the name of the -// runtime of this process. For compiled native binaries, this SHOULD be the -// name of the compiler. -func ProcessRuntimeName(val string) attribute.KeyValue { - return ProcessRuntimeNameKey.String(val) -} - -// ProcessRuntimeVersion returns an attribute KeyValue conforming to the -// "process.runtime.version" semantic conventions. It represents the version of -// the runtime of this process, as returned by the runtime without -// modification. -func ProcessRuntimeVersion(val string) attribute.KeyValue { - return ProcessRuntimeVersionKey.String(val) -} - -// ProcessRuntimeDescription returns an attribute KeyValue conforming to the -// "process.runtime.description" semantic conventions. It represents an -// additional description about the runtime of the process, for example a -// specific vendor customization of the runtime environment. -func ProcessRuntimeDescription(val string) attribute.KeyValue { - return ProcessRuntimeDescriptionKey.String(val) -} - -// A service instance. -const ( - // ServiceNameKey is the attribute Key conforming to the "service.name" - // semantic conventions. It represents the logical name of the service. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'shoppingcart' - // Note: MUST be the same for all instances of horizontally scaled - // services. If the value was not specified, SDKs MUST fallback to - // `unknown_service:` concatenated with - // [`process.executable.name`](process.md#process), e.g. - // `unknown_service:bash`. If `process.executable.name` is not available, - // the value MUST be set to `unknown_service`. - ServiceNameKey = attribute.Key("service.name") - - // ServiceVersionKey is the attribute Key conforming to the - // "service.version" semantic conventions. It represents the version string - // of the service API or implementation. The format is not defined by these - // conventions. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2.0.0', 'a01dbef8a' - ServiceVersionKey = attribute.Key("service.version") -) - -// ServiceName returns an attribute KeyValue conforming to the -// "service.name" semantic conventions. It represents the logical name of the -// service. -func ServiceName(val string) attribute.KeyValue { - return ServiceNameKey.String(val) -} - -// ServiceVersion returns an attribute KeyValue conforming to the -// "service.version" semantic conventions. It represents the version string of -// the service API or implementation. The format is not defined by these -// conventions. -func ServiceVersion(val string) attribute.KeyValue { - return ServiceVersionKey.String(val) -} - -// A service instance. -const ( - // ServiceNamespaceKey is the attribute Key conforming to the - // "service.namespace" semantic conventions. It represents a namespace for - // `service.name`. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Shop' - // Note: A string value having a meaning that helps to distinguish a group - // of services, for example the team name that owns a group of services. - // `service.name` is expected to be unique within the same namespace. If - // `service.namespace` is not specified in the Resource then `service.name` - // is expected to be unique for all services that have no explicit - // namespace defined (so the empty/unspecified namespace is simply one more - // valid namespace). Zero-length namespace string is assumed equal to - // unspecified namespace. - ServiceNamespaceKey = attribute.Key("service.namespace") - - // ServiceInstanceIDKey is the attribute Key conforming to the - // "service.instance.id" semantic conventions. It represents the string ID - // of the service instance. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'my-k8s-pod-deployment-1', - // '627cc493-f310-47de-96bd-71410b7dec09' - // Note: MUST be unique for each instance of the same - // `service.namespace,service.name` pair (in other words - // `service.namespace,service.name,service.instance.id` triplet MUST be - // globally unique). The ID helps to distinguish instances of the same - // service that exist at the same time (e.g. instances of a horizontally - // scaled service). It is preferable for the ID to be persistent and stay - // the same for the lifetime of the service instance, however it is - // acceptable that the ID is ephemeral and changes during important - // lifetime events for the service (e.g. service restarts). If the service - // has no inherent unique ID that can be used as the value of this - // attribute it is recommended to generate a random Version 1 or Version 4 - // RFC 4122 UUID (services aiming for reproducible UUIDs may also use - // Version 5, see RFC 4122 for more recommendations). - ServiceInstanceIDKey = attribute.Key("service.instance.id") -) - -// ServiceNamespace returns an attribute KeyValue conforming to the -// "service.namespace" semantic conventions. It represents a namespace for -// `service.name`. -func ServiceNamespace(val string) attribute.KeyValue { - return ServiceNamespaceKey.String(val) -} - -// ServiceInstanceID returns an attribute KeyValue conforming to the -// "service.instance.id" semantic conventions. It represents the string ID of -// the service instance. -func ServiceInstanceID(val string) attribute.KeyValue { - return ServiceInstanceIDKey.String(val) -} - -// The telemetry SDK used to capture data recorded by the instrumentation -// libraries. -const ( - // TelemetrySDKNameKey is the attribute Key conforming to the - // "telemetry.sdk.name" semantic conventions. It represents the name of the - // telemetry SDK as defined above. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'opentelemetry' - // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute - // to `opentelemetry`. - // If another SDK, like a fork or a vendor-provided implementation, is - // used, this SDK MUST set the - // `telemetry.sdk.name` attribute to the fully-qualified class or module - // name of this SDK's main entry point - // or another suitable identifier depending on the language. - // The identifier `opentelemetry` is reserved and MUST NOT be used in this - // case. - // All custom identifiers SHOULD be stable across different versions of an - // implementation. - TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") - - // TelemetrySDKLanguageKey is the attribute Key conforming to the - // "telemetry.sdk.language" semantic conventions. It represents the - // language of the telemetry SDK. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") - - // TelemetrySDKVersionKey is the attribute Key conforming to the - // "telemetry.sdk.version" semantic conventions. It represents the version - // string of the telemetry SDK. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: '1.2.3' - TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") -) - -var ( - // cpp - TelemetrySDKLanguageCPP = TelemetrySDKLanguageKey.String("cpp") - // dotnet - TelemetrySDKLanguageDotnet = TelemetrySDKLanguageKey.String("dotnet") - // erlang - TelemetrySDKLanguageErlang = TelemetrySDKLanguageKey.String("erlang") - // go - TelemetrySDKLanguageGo = TelemetrySDKLanguageKey.String("go") - // java - TelemetrySDKLanguageJava = TelemetrySDKLanguageKey.String("java") - // nodejs - TelemetrySDKLanguageNodejs = TelemetrySDKLanguageKey.String("nodejs") - // php - TelemetrySDKLanguagePHP = TelemetrySDKLanguageKey.String("php") - // python - TelemetrySDKLanguagePython = TelemetrySDKLanguageKey.String("python") - // ruby - TelemetrySDKLanguageRuby = TelemetrySDKLanguageKey.String("ruby") - // rust - TelemetrySDKLanguageRust = TelemetrySDKLanguageKey.String("rust") - // swift - TelemetrySDKLanguageSwift = TelemetrySDKLanguageKey.String("swift") - // webjs - TelemetrySDKLanguageWebjs = TelemetrySDKLanguageKey.String("webjs") -) - -// TelemetrySDKName returns an attribute KeyValue conforming to the -// "telemetry.sdk.name" semantic conventions. It represents the name of the -// telemetry SDK as defined above. -func TelemetrySDKName(val string) attribute.KeyValue { - return TelemetrySDKNameKey.String(val) -} - -// TelemetrySDKVersion returns an attribute KeyValue conforming to the -// "telemetry.sdk.version" semantic conventions. It represents the version -// string of the telemetry SDK. -func TelemetrySDKVersion(val string) attribute.KeyValue { - return TelemetrySDKVersionKey.String(val) -} - -// The telemetry SDK used to capture data recorded by the instrumentation -// libraries. -const ( - // TelemetryAutoVersionKey is the attribute Key conforming to the - // "telemetry.auto.version" semantic conventions. It represents the version - // string of the auto instrumentation agent, if used. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '1.2.3' - TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version") -) - -// TelemetryAutoVersion returns an attribute KeyValue conforming to the -// "telemetry.auto.version" semantic conventions. It represents the version -// string of the auto instrumentation agent, if used. -func TelemetryAutoVersion(val string) attribute.KeyValue { - return TelemetryAutoVersionKey.String(val) -} - -// Resource describing the packaged software running the application code. Web -// engines are typically executed using process.runtime. -const ( - // WebEngineNameKey is the attribute Key conforming to the "webengine.name" - // semantic conventions. It represents the name of the web engine. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'WildFly' - WebEngineNameKey = attribute.Key("webengine.name") - - // WebEngineVersionKey is the attribute Key conforming to the - // "webengine.version" semantic conventions. It represents the version of - // the web engine. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '21.0.0' - WebEngineVersionKey = attribute.Key("webengine.version") - - // WebEngineDescriptionKey is the attribute Key conforming to the - // "webengine.description" semantic conventions. It represents the - // additional description of the web engine (e.g. detailed version and - // edition information). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - - // 2.2.2.Final' - WebEngineDescriptionKey = attribute.Key("webengine.description") -) - -// WebEngineName returns an attribute KeyValue conforming to the -// "webengine.name" semantic conventions. It represents the name of the web -// engine. -func WebEngineName(val string) attribute.KeyValue { - return WebEngineNameKey.String(val) -} - -// WebEngineVersion returns an attribute KeyValue conforming to the -// "webengine.version" semantic conventions. It represents the version of the -// web engine. -func WebEngineVersion(val string) attribute.KeyValue { - return WebEngineVersionKey.String(val) -} - -// WebEngineDescription returns an attribute KeyValue conforming to the -// "webengine.description" semantic conventions. It represents the additional -// description of the web engine (e.g. detailed version and edition -// information). -func WebEngineDescription(val string) attribute.KeyValue { - return WebEngineDescriptionKey.String(val) -} - -// Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's -// concepts. -const ( - // OTelScopeNameKey is the attribute Key conforming to the - // "otel.scope.name" semantic conventions. It represents the name of the - // instrumentation scope - (`InstrumentationScope.Name` in OTLP). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'io.opentelemetry.contrib.mongodb' - OTelScopeNameKey = attribute.Key("otel.scope.name") - - // OTelScopeVersionKey is the attribute Key conforming to the - // "otel.scope.version" semantic conventions. It represents the version of - // the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '1.0.0' - OTelScopeVersionKey = attribute.Key("otel.scope.version") -) - -// OTelScopeName returns an attribute KeyValue conforming to the -// "otel.scope.name" semantic conventions. It represents the name of the -// instrumentation scope - (`InstrumentationScope.Name` in OTLP). -func OTelScopeName(val string) attribute.KeyValue { - return OTelScopeNameKey.String(val) -} - -// OTelScopeVersion returns an attribute KeyValue conforming to the -// "otel.scope.version" semantic conventions. It represents the version of the -// instrumentation scope - (`InstrumentationScope.Version` in OTLP). -func OTelScopeVersion(val string) attribute.KeyValue { - return OTelScopeVersionKey.String(val) -} - -// Span attributes used by non-OTLP exporters to represent OpenTelemetry -// Scope's concepts. -const ( - // OTelLibraryNameKey is the attribute Key conforming to the - // "otel.library.name" semantic conventions. It represents the deprecated, - // use the `otel.scope.name` attribute. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: 'io.opentelemetry.contrib.mongodb' - OTelLibraryNameKey = attribute.Key("otel.library.name") - - // OTelLibraryVersionKey is the attribute Key conforming to the - // "otel.library.version" semantic conventions. It represents the - // deprecated, use the `otel.scope.version` attribute. - // - // Type: string - // RequirementLevel: Optional - // Stability: deprecated - // Examples: '1.0.0' - OTelLibraryVersionKey = attribute.Key("otel.library.version") -) - -// OTelLibraryName returns an attribute KeyValue conforming to the -// "otel.library.name" semantic conventions. It represents the deprecated, use -// the `otel.scope.name` attribute. -func OTelLibraryName(val string) attribute.KeyValue { - return OTelLibraryNameKey.String(val) -} - -// OTelLibraryVersion returns an attribute KeyValue conforming to the -// "otel.library.version" semantic conventions. It represents the deprecated, -// use the `otel.scope.version` attribute. -func OTelLibraryVersion(val string) attribute.KeyValue { - return OTelLibraryVersionKey.String(val) -} diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go deleted file mode 100644 index 66ffd5989f34..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -// SchemaURL is the schema URL that matches the version of the semantic conventions -// that this package defines. Semconv packages starting from v1.4.0 must declare -// non-empty schema URL in the form https://opentelemetry.io/schemas/ -const SchemaURL = "https://opentelemetry.io/schemas/1.21.0" diff --git a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go b/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go deleted file mode 100644 index b5a91450d420..000000000000 --- a/cluster-autoscaler/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go +++ /dev/null @@ -1,2495 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated from semantic convention specification. DO NOT EDIT. - -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" - -import "go.opentelemetry.io/otel/attribute" - -// The shared attributes used to report a single exception associated with a -// span or log. -const ( - // ExceptionTypeKey is the attribute Key conforming to the "exception.type" - // semantic conventions. It represents the type of the exception (its - // fully-qualified class name, if applicable). The dynamic type of the - // exception should be preferred over the static type in languages that - // support it. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'java.net.ConnectException', 'OSError' - ExceptionTypeKey = attribute.Key("exception.type") - - // ExceptionMessageKey is the attribute Key conforming to the - // "exception.message" semantic conventions. It represents the exception - // message. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Division by zero', "Can't convert 'int' object to str - // implicitly" - ExceptionMessageKey = attribute.Key("exception.message") - - // ExceptionStacktraceKey is the attribute Key conforming to the - // "exception.stacktrace" semantic conventions. It represents a stacktrace - // as a string in the natural representation for the language runtime. The - // representation is to be determined and documented by each language SIG. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test - // exception\\n at ' - // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at ' - // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at ' - // 'com.example.GenerateTrace.main(GenerateTrace.java:5)' - ExceptionStacktraceKey = attribute.Key("exception.stacktrace") -) - -// ExceptionType returns an attribute KeyValue conforming to the -// "exception.type" semantic conventions. It represents the type of the -// exception (its fully-qualified class name, if applicable). The dynamic type -// of the exception should be preferred over the static type in languages that -// support it. -func ExceptionType(val string) attribute.KeyValue { - return ExceptionTypeKey.String(val) -} - -// ExceptionMessage returns an attribute KeyValue conforming to the -// "exception.message" semantic conventions. It represents the exception -// message. -func ExceptionMessage(val string) attribute.KeyValue { - return ExceptionMessageKey.String(val) -} - -// ExceptionStacktrace returns an attribute KeyValue conforming to the -// "exception.stacktrace" semantic conventions. It represents a stacktrace as a -// string in the natural representation for the language runtime. The -// representation is to be determined and documented by each language SIG. -func ExceptionStacktrace(val string) attribute.KeyValue { - return ExceptionStacktraceKey.String(val) -} - -// Span attributes used by AWS Lambda (in addition to general `faas` -// attributes). -const ( - // AWSLambdaInvokedARNKey is the attribute Key conforming to the - // "aws.lambda.invoked_arn" semantic conventions. It represents the full - // invoked ARN as provided on the `Context` passed to the function - // (`Lambda-Runtime-Invoked-Function-ARN` header on the - // `/runtime/invocation/next` applicable). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias' - // Note: This may be different from `cloud.resource_id` if an alias is - // involved. - AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") -) - -// AWSLambdaInvokedARN returns an attribute KeyValue conforming to the -// "aws.lambda.invoked_arn" semantic conventions. It represents the full -// invoked ARN as provided on the `Context` passed to the function -// (`Lambda-Runtime-Invoked-Function-ARN` header on the -// `/runtime/invocation/next` applicable). -func AWSLambdaInvokedARN(val string) attribute.KeyValue { - return AWSLambdaInvokedARNKey.String(val) -} - -// Attributes for CloudEvents. CloudEvents is a specification on how to define -// event data in a standard way. These attributes can be attached to spans when -// performing operations with CloudEvents, regardless of the protocol being -// used. -const ( - // CloudeventsEventIDKey is the attribute Key conforming to the - // "cloudevents.event_id" semantic conventions. It represents the - // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) - // uniquely identifies the event. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001' - CloudeventsEventIDKey = attribute.Key("cloudevents.event_id") - - // CloudeventsEventSourceKey is the attribute Key conforming to the - // "cloudevents.event_source" semantic conventions. It represents the - // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) - // identifies the context in which an event happened. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'https://github.com/cloudevents', - // '/cloudevents/spec/pull/123', 'my-service' - CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source") - - // CloudeventsEventSpecVersionKey is the attribute Key conforming to the - // "cloudevents.event_spec_version" semantic conventions. It represents the - // [version of the CloudEvents - // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) - // which the event uses. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '1.0' - CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") - - // CloudeventsEventTypeKey is the attribute Key conforming to the - // "cloudevents.event_type" semantic conventions. It represents the - // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) - // contains a value describing the type of event related to the originating - // occurrence. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'com.github.pull_request.opened', - // 'com.example.object.deleted.v2' - CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type") - - // CloudeventsEventSubjectKey is the attribute Key conforming to the - // "cloudevents.event_subject" semantic conventions. It represents the - // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) - // of the event in the context of the event producer (identified by - // source). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'mynewfile.jpg' - CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") -) - -// CloudeventsEventID returns an attribute KeyValue conforming to the -// "cloudevents.event_id" semantic conventions. It represents the -// [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) -// uniquely identifies the event. -func CloudeventsEventID(val string) attribute.KeyValue { - return CloudeventsEventIDKey.String(val) -} - -// CloudeventsEventSource returns an attribute KeyValue conforming to the -// "cloudevents.event_source" semantic conventions. It represents the -// [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) -// identifies the context in which an event happened. -func CloudeventsEventSource(val string) attribute.KeyValue { - return CloudeventsEventSourceKey.String(val) -} - -// CloudeventsEventSpecVersion returns an attribute KeyValue conforming to -// the "cloudevents.event_spec_version" semantic conventions. It represents the -// [version of the CloudEvents -// specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) -// which the event uses. -func CloudeventsEventSpecVersion(val string) attribute.KeyValue { - return CloudeventsEventSpecVersionKey.String(val) -} - -// CloudeventsEventType returns an attribute KeyValue conforming to the -// "cloudevents.event_type" semantic conventions. It represents the -// [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) -// contains a value describing the type of event related to the originating -// occurrence. -func CloudeventsEventType(val string) attribute.KeyValue { - return CloudeventsEventTypeKey.String(val) -} - -// CloudeventsEventSubject returns an attribute KeyValue conforming to the -// "cloudevents.event_subject" semantic conventions. It represents the -// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) -// of the event in the context of the event producer (identified by source). -func CloudeventsEventSubject(val string) attribute.KeyValue { - return CloudeventsEventSubjectKey.String(val) -} - -// Semantic conventions for the OpenTracing Shim -const ( - // OpentracingRefTypeKey is the attribute Key conforming to the - // "opentracing.ref_type" semantic conventions. It represents the - // parent-child Reference type - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Note: The causal relationship between a child Span and a parent Span. - OpentracingRefTypeKey = attribute.Key("opentracing.ref_type") -) - -var ( - // The parent Span depends on the child Span in some capacity - OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of") - // The parent Span does not depend in any way on the result of the child Span - OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from") -) - -// The attributes used to perform database client calls. -const ( - // DBSystemKey is the attribute Key conforming to the "db.system" semantic - // conventions. It represents an identifier for the database management - // system (DBMS) product being used. See below for a list of well-known - // identifiers. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - DBSystemKey = attribute.Key("db.system") - - // DBConnectionStringKey is the attribute Key conforming to the - // "db.connection_string" semantic conventions. It represents the - // connection string used to connect to the database. It is recommended to - // remove embedded credentials. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;' - DBConnectionStringKey = attribute.Key("db.connection_string") - - // DBUserKey is the attribute Key conforming to the "db.user" semantic - // conventions. It represents the username for accessing the database. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'readonly_user', 'reporting_user' - DBUserKey = attribute.Key("db.user") - - // DBJDBCDriverClassnameKey is the attribute Key conforming to the - // "db.jdbc.driver_classname" semantic conventions. It represents the - // fully-qualified class name of the [Java Database Connectivity - // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) - // driver used to connect. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'org.postgresql.Driver', - // 'com.microsoft.sqlserver.jdbc.SQLServerDriver' - DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname") - - // DBNameKey is the attribute Key conforming to the "db.name" semantic - // conventions. It represents the this attribute is used to report the name - // of the database being accessed. For commands that switch the database, - // this should be set to the target database (even if the command fails). - // - // Type: string - // RequirementLevel: ConditionallyRequired (If applicable.) - // Stability: stable - // Examples: 'customers', 'main' - // Note: In some SQL databases, the database name to be used is called - // "schema name". In case there are multiple layers that could be - // considered for database name (e.g. Oracle instance name and schema - // name), the database name to be used is the more specific layer (e.g. - // Oracle schema name). - DBNameKey = attribute.Key("db.name") - - // DBStatementKey is the attribute Key conforming to the "db.statement" - // semantic conventions. It represents the database statement being - // executed. - // - // Type: string - // RequirementLevel: Recommended (Should be collected by default only if - // there is sanitization that excludes sensitive information.) - // Stability: stable - // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' - DBStatementKey = attribute.Key("db.statement") - - // DBOperationKey is the attribute Key conforming to the "db.operation" - // semantic conventions. It represents the name of the operation being - // executed, e.g. the [MongoDB command - // name](https://docs.mongodb.com/manual/reference/command/#database-operations) - // such as `findAndModify`, or the SQL keyword. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If `db.statement` is not - // applicable.) - // Stability: stable - // Examples: 'findAndModify', 'HMSET', 'SELECT' - // Note: When setting this to an SQL keyword, it is not recommended to - // attempt any client-side parsing of `db.statement` just to get this - // property, but it should be set if the operation name is provided by the - // library being instrumented. If the SQL statement has an ambiguous - // operation, or performs more than one operation, this value may be - // omitted. - DBOperationKey = attribute.Key("db.operation") -) - -var ( - // Some other SQL database. Fallback only. See notes - DBSystemOtherSQL = DBSystemKey.String("other_sql") - // Microsoft SQL Server - DBSystemMSSQL = DBSystemKey.String("mssql") - // Microsoft SQL Server Compact - DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact") - // MySQL - DBSystemMySQL = DBSystemKey.String("mysql") - // Oracle Database - DBSystemOracle = DBSystemKey.String("oracle") - // IBM DB2 - DBSystemDB2 = DBSystemKey.String("db2") - // PostgreSQL - DBSystemPostgreSQL = DBSystemKey.String("postgresql") - // Amazon Redshift - DBSystemRedshift = DBSystemKey.String("redshift") - // Apache Hive - DBSystemHive = DBSystemKey.String("hive") - // Cloudscape - DBSystemCloudscape = DBSystemKey.String("cloudscape") - // HyperSQL DataBase - DBSystemHSQLDB = DBSystemKey.String("hsqldb") - // Progress Database - DBSystemProgress = DBSystemKey.String("progress") - // SAP MaxDB - DBSystemMaxDB = DBSystemKey.String("maxdb") - // SAP HANA - DBSystemHanaDB = DBSystemKey.String("hanadb") - // Ingres - DBSystemIngres = DBSystemKey.String("ingres") - // FirstSQL - DBSystemFirstSQL = DBSystemKey.String("firstsql") - // EnterpriseDB - DBSystemEDB = DBSystemKey.String("edb") - // InterSystems Caché - DBSystemCache = DBSystemKey.String("cache") - // Adabas (Adaptable Database System) - DBSystemAdabas = DBSystemKey.String("adabas") - // Firebird - DBSystemFirebird = DBSystemKey.String("firebird") - // Apache Derby - DBSystemDerby = DBSystemKey.String("derby") - // FileMaker - DBSystemFilemaker = DBSystemKey.String("filemaker") - // Informix - DBSystemInformix = DBSystemKey.String("informix") - // InstantDB - DBSystemInstantDB = DBSystemKey.String("instantdb") - // InterBase - DBSystemInterbase = DBSystemKey.String("interbase") - // MariaDB - DBSystemMariaDB = DBSystemKey.String("mariadb") - // Netezza - DBSystemNetezza = DBSystemKey.String("netezza") - // Pervasive PSQL - DBSystemPervasive = DBSystemKey.String("pervasive") - // PointBase - DBSystemPointbase = DBSystemKey.String("pointbase") - // SQLite - DBSystemSqlite = DBSystemKey.String("sqlite") - // Sybase - DBSystemSybase = DBSystemKey.String("sybase") - // Teradata - DBSystemTeradata = DBSystemKey.String("teradata") - // Vertica - DBSystemVertica = DBSystemKey.String("vertica") - // H2 - DBSystemH2 = DBSystemKey.String("h2") - // ColdFusion IMQ - DBSystemColdfusion = DBSystemKey.String("coldfusion") - // Apache Cassandra - DBSystemCassandra = DBSystemKey.String("cassandra") - // Apache HBase - DBSystemHBase = DBSystemKey.String("hbase") - // MongoDB - DBSystemMongoDB = DBSystemKey.String("mongodb") - // Redis - DBSystemRedis = DBSystemKey.String("redis") - // Couchbase - DBSystemCouchbase = DBSystemKey.String("couchbase") - // CouchDB - DBSystemCouchDB = DBSystemKey.String("couchdb") - // Microsoft Azure Cosmos DB - DBSystemCosmosDB = DBSystemKey.String("cosmosdb") - // Amazon DynamoDB - DBSystemDynamoDB = DBSystemKey.String("dynamodb") - // Neo4j - DBSystemNeo4j = DBSystemKey.String("neo4j") - // Apache Geode - DBSystemGeode = DBSystemKey.String("geode") - // Elasticsearch - DBSystemElasticsearch = DBSystemKey.String("elasticsearch") - // Memcached - DBSystemMemcached = DBSystemKey.String("memcached") - // CockroachDB - DBSystemCockroachdb = DBSystemKey.String("cockroachdb") - // OpenSearch - DBSystemOpensearch = DBSystemKey.String("opensearch") - // ClickHouse - DBSystemClickhouse = DBSystemKey.String("clickhouse") - // Cloud Spanner - DBSystemSpanner = DBSystemKey.String("spanner") - // Trino - DBSystemTrino = DBSystemKey.String("trino") -) - -// DBConnectionString returns an attribute KeyValue conforming to the -// "db.connection_string" semantic conventions. It represents the connection -// string used to connect to the database. It is recommended to remove embedded -// credentials. -func DBConnectionString(val string) attribute.KeyValue { - return DBConnectionStringKey.String(val) -} - -// DBUser returns an attribute KeyValue conforming to the "db.user" semantic -// conventions. It represents the username for accessing the database. -func DBUser(val string) attribute.KeyValue { - return DBUserKey.String(val) -} - -// DBJDBCDriverClassname returns an attribute KeyValue conforming to the -// "db.jdbc.driver_classname" semantic conventions. It represents the -// fully-qualified class name of the [Java Database Connectivity -// (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver -// used to connect. -func DBJDBCDriverClassname(val string) attribute.KeyValue { - return DBJDBCDriverClassnameKey.String(val) -} - -// DBName returns an attribute KeyValue conforming to the "db.name" semantic -// conventions. It represents the this attribute is used to report the name of -// the database being accessed. For commands that switch the database, this -// should be set to the target database (even if the command fails). -func DBName(val string) attribute.KeyValue { - return DBNameKey.String(val) -} - -// DBStatement returns an attribute KeyValue conforming to the -// "db.statement" semantic conventions. It represents the database statement -// being executed. -func DBStatement(val string) attribute.KeyValue { - return DBStatementKey.String(val) -} - -// DBOperation returns an attribute KeyValue conforming to the -// "db.operation" semantic conventions. It represents the name of the operation -// being executed, e.g. the [MongoDB command -// name](https://docs.mongodb.com/manual/reference/command/#database-operations) -// such as `findAndModify`, or the SQL keyword. -func DBOperation(val string) attribute.KeyValue { - return DBOperationKey.String(val) -} - -// Connection-level attributes for Microsoft SQL Server -const ( - // DBMSSQLInstanceNameKey is the attribute Key conforming to the - // "db.mssql.instance_name" semantic conventions. It represents the - // Microsoft SQL Server [instance - // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) - // connecting to. This name is used to determine the port of a named - // instance. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'MSSQLSERVER' - // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer - // required (but still recommended if non-standard). - DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") -) - -// DBMSSQLInstanceName returns an attribute KeyValue conforming to the -// "db.mssql.instance_name" semantic conventions. It represents the Microsoft -// SQL Server [instance -// name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) -// connecting to. This name is used to determine the port of a named instance. -func DBMSSQLInstanceName(val string) attribute.KeyValue { - return DBMSSQLInstanceNameKey.String(val) -} - -// Call-level attributes for Cassandra -const ( - // DBCassandraPageSizeKey is the attribute Key conforming to the - // "db.cassandra.page_size" semantic conventions. It represents the fetch - // size used for paging, i.e. how many rows will be returned at once. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 5000 - DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") - - // DBCassandraConsistencyLevelKey is the attribute Key conforming to the - // "db.cassandra.consistency_level" semantic conventions. It represents the - // consistency level of the query. Based on consistency values from - // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") - - // DBCassandraTableKey is the attribute Key conforming to the - // "db.cassandra.table" semantic conventions. It represents the name of the - // primary table that the operation is acting upon, including the keyspace - // name (if applicable). - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'mytable' - // Note: This mirrors the db.sql.table attribute but references cassandra - // rather than sql. It is not recommended to attempt any client-side - // parsing of `db.statement` just to get this property, but it should be - // set if it is provided by the library being instrumented. If the - // operation is acting upon an anonymous table, or more than one table, - // this value MUST NOT be set. - DBCassandraTableKey = attribute.Key("db.cassandra.table") - - // DBCassandraIdempotenceKey is the attribute Key conforming to the - // "db.cassandra.idempotence" semantic conventions. It represents the - // whether or not the query is idempotent. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") - - // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming - // to the "db.cassandra.speculative_execution_count" semantic conventions. - // It represents the number of times a query was speculatively executed. - // Not set or `0` if the query was not executed speculatively. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 2 - DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") - - // DBCassandraCoordinatorIDKey is the attribute Key conforming to the - // "db.cassandra.coordinator.id" semantic conventions. It represents the ID - // of the coordinating node for a query. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' - DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") - - // DBCassandraCoordinatorDCKey is the attribute Key conforming to the - // "db.cassandra.coordinator.dc" semantic conventions. It represents the - // data center of the coordinating node for a query. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'us-west-2' - DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") -) - -var ( - // all - DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") - // each_quorum - DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") - // quorum - DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") - // local_quorum - DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") - // one - DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") - // two - DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") - // three - DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") - // local_one - DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") - // any - DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") - // serial - DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") - // local_serial - DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") -) - -// DBCassandraPageSize returns an attribute KeyValue conforming to the -// "db.cassandra.page_size" semantic conventions. It represents the fetch size -// used for paging, i.e. how many rows will be returned at once. -func DBCassandraPageSize(val int) attribute.KeyValue { - return DBCassandraPageSizeKey.Int(val) -} - -// DBCassandraTable returns an attribute KeyValue conforming to the -// "db.cassandra.table" semantic conventions. It represents the name of the -// primary table that the operation is acting upon, including the keyspace name -// (if applicable). -func DBCassandraTable(val string) attribute.KeyValue { - return DBCassandraTableKey.String(val) -} - -// DBCassandraIdempotence returns an attribute KeyValue conforming to the -// "db.cassandra.idempotence" semantic conventions. It represents the whether -// or not the query is idempotent. -func DBCassandraIdempotence(val bool) attribute.KeyValue { - return DBCassandraIdempotenceKey.Bool(val) -} - -// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue -// conforming to the "db.cassandra.speculative_execution_count" semantic -// conventions. It represents the number of times a query was speculatively -// executed. Not set or `0` if the query was not executed speculatively. -func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue { - return DBCassandraSpeculativeExecutionCountKey.Int(val) -} - -// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the -// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of -// the coordinating node for a query. -func DBCassandraCoordinatorID(val string) attribute.KeyValue { - return DBCassandraCoordinatorIDKey.String(val) -} - -// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the -// "db.cassandra.coordinator.dc" semantic conventions. It represents the data -// center of the coordinating node for a query. -func DBCassandraCoordinatorDC(val string) attribute.KeyValue { - return DBCassandraCoordinatorDCKey.String(val) -} - -// Call-level attributes for Redis -const ( - // DBRedisDBIndexKey is the attribute Key conforming to the - // "db.redis.database_index" semantic conventions. It represents the index - // of the database being accessed as used in the [`SELECT` - // command](https://redis.io/commands/select), provided as an integer. To - // be used instead of the generic `db.name` attribute. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If other than the default - // database (`0`).) - // Stability: stable - // Examples: 0, 1, 15 - DBRedisDBIndexKey = attribute.Key("db.redis.database_index") -) - -// DBRedisDBIndex returns an attribute KeyValue conforming to the -// "db.redis.database_index" semantic conventions. It represents the index of -// the database being accessed as used in the [`SELECT` -// command](https://redis.io/commands/select), provided as an integer. To be -// used instead of the generic `db.name` attribute. -func DBRedisDBIndex(val int) attribute.KeyValue { - return DBRedisDBIndexKey.Int(val) -} - -// Call-level attributes for MongoDB -const ( - // DBMongoDBCollectionKey is the attribute Key conforming to the - // "db.mongodb.collection" semantic conventions. It represents the - // collection being accessed within the database stated in `db.name`. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'customers', 'products' - DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") -) - -// DBMongoDBCollection returns an attribute KeyValue conforming to the -// "db.mongodb.collection" semantic conventions. It represents the collection -// being accessed within the database stated in `db.name`. -func DBMongoDBCollection(val string) attribute.KeyValue { - return DBMongoDBCollectionKey.String(val) -} - -// Call-level attributes for SQL databases -const ( - // DBSQLTableKey is the attribute Key conforming to the "db.sql.table" - // semantic conventions. It represents the name of the primary table that - // the operation is acting upon, including the database name (if - // applicable). - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'public.users', 'customers' - // Note: It is not recommended to attempt any client-side parsing of - // `db.statement` just to get this property, but it should be set if it is - // provided by the library being instrumented. If the operation is acting - // upon an anonymous table, or more than one table, this value MUST NOT be - // set. - DBSQLTableKey = attribute.Key("db.sql.table") -) - -// DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table" -// semantic conventions. It represents the name of the primary table that the -// operation is acting upon, including the database name (if applicable). -func DBSQLTable(val string) attribute.KeyValue { - return DBSQLTableKey.String(val) -} - -// Call-level attributes for Cosmos DB. -const ( - // DBCosmosDBClientIDKey is the attribute Key conforming to the - // "db.cosmosdb.client_id" semantic conventions. It represents the unique - // Cosmos client instance id. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d' - DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id") - - // DBCosmosDBOperationTypeKey is the attribute Key conforming to the - // "db.cosmosdb.operation_type" semantic conventions. It represents the - // cosmosDB Operation Type. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (when performing one of the - // operations in this list) - // Stability: stable - DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type") - - // DBCosmosDBConnectionModeKey is the attribute Key conforming to the - // "db.cosmosdb.connection_mode" semantic conventions. It represents the - // cosmos client connection mode. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (if not `direct` (or pick gw as - // default)) - // Stability: stable - DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode") - - // DBCosmosDBContainerKey is the attribute Key conforming to the - // "db.cosmosdb.container" semantic conventions. It represents the cosmos - // DB container name. - // - // Type: string - // RequirementLevel: ConditionallyRequired (if available) - // Stability: stable - // Examples: 'anystring' - DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container") - - // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the - // "db.cosmosdb.request_content_length" semantic conventions. It represents - // the request payload size in bytes - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length") - - // DBCosmosDBStatusCodeKey is the attribute Key conforming to the - // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos - // DB status code. - // - // Type: int - // RequirementLevel: ConditionallyRequired (if response was received) - // Stability: stable - // Examples: 200, 201 - DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code") - - // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the - // "db.cosmosdb.sub_status_code" semantic conventions. It represents the - // cosmos DB sub status code. - // - // Type: int - // RequirementLevel: ConditionallyRequired (when response was received and - // contained sub-code.) - // Stability: stable - // Examples: 1000, 1002 - DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code") - - // DBCosmosDBRequestChargeKey is the attribute Key conforming to the - // "db.cosmosdb.request_charge" semantic conventions. It represents the rU - // consumed for that operation - // - // Type: double - // RequirementLevel: ConditionallyRequired (when available) - // Stability: stable - // Examples: 46.18, 1.0 - DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge") -) - -var ( - // invalid - DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid") - // create - DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create") - // patch - DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch") - // read - DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read") - // read_feed - DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed") - // delete - DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete") - // replace - DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace") - // execute - DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute") - // query - DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query") - // head - DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head") - // head_feed - DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed") - // upsert - DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert") - // batch - DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch") - // query_plan - DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan") - // execute_javascript - DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript") -) - -var ( - // Gateway (HTTP) connections mode - DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway") - // Direct connection - DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct") -) - -// DBCosmosDBClientID returns an attribute KeyValue conforming to the -// "db.cosmosdb.client_id" semantic conventions. It represents the unique -// Cosmos client instance id. -func DBCosmosDBClientID(val string) attribute.KeyValue { - return DBCosmosDBClientIDKey.String(val) -} - -// DBCosmosDBContainer returns an attribute KeyValue conforming to the -// "db.cosmosdb.container" semantic conventions. It represents the cosmos DB -// container name. -func DBCosmosDBContainer(val string) attribute.KeyValue { - return DBCosmosDBContainerKey.String(val) -} - -// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming -// to the "db.cosmosdb.request_content_length" semantic conventions. It -// represents the request payload size in bytes -func DBCosmosDBRequestContentLength(val int) attribute.KeyValue { - return DBCosmosDBRequestContentLengthKey.Int(val) -} - -// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the -// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB -// status code. -func DBCosmosDBStatusCode(val int) attribute.KeyValue { - return DBCosmosDBStatusCodeKey.Int(val) -} - -// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the -// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos -// DB sub status code. -func DBCosmosDBSubStatusCode(val int) attribute.KeyValue { - return DBCosmosDBSubStatusCodeKey.Int(val) -} - -// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the -// "db.cosmosdb.request_charge" semantic conventions. It represents the rU -// consumed for that operation -func DBCosmosDBRequestCharge(val float64) attribute.KeyValue { - return DBCosmosDBRequestChargeKey.Float64(val) -} - -// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's -// concepts. -const ( - // OTelStatusCodeKey is the attribute Key conforming to the - // "otel.status_code" semantic conventions. It represents the name of the - // code, either "OK" or "ERROR". MUST NOT be set if the status code is - // UNSET. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - OTelStatusCodeKey = attribute.Key("otel.status_code") - - // OTelStatusDescriptionKey is the attribute Key conforming to the - // "otel.status_description" semantic conventions. It represents the - // description of the Status if it has a value, otherwise not set. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'resource not found' - OTelStatusDescriptionKey = attribute.Key("otel.status_description") -) - -var ( - // The operation has been validated by an Application developer or Operator to have completed successfully - OTelStatusCodeOk = OTelStatusCodeKey.String("OK") - // The operation contains an error - OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") -) - -// OTelStatusDescription returns an attribute KeyValue conforming to the -// "otel.status_description" semantic conventions. It represents the -// description of the Status if it has a value, otherwise not set. -func OTelStatusDescription(val string) attribute.KeyValue { - return OTelStatusDescriptionKey.String(val) -} - -// This semantic convention describes an instance of a function that runs -// without provisioning or managing of servers (also known as serverless -// functions or Function as a Service (FaaS)) with spans. -const ( - // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" - // semantic conventions. It represents the type of the trigger which caused - // this function invocation. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Note: For the server/consumer span on the incoming side, - // `faas.trigger` MUST be set. - // - // Clients invoking FaaS instances usually cannot set `faas.trigger`, - // since they would typically need to look in the payload to determine - // the event type. If clients set it, it should be the same as the - // trigger that corresponding incoming would have (i.e., this has - // nothing to do with the underlying transport used to make the API - // call to invoke the lambda, which is often HTTP). - FaaSTriggerKey = attribute.Key("faas.trigger") - - // FaaSInvocationIDKey is the attribute Key conforming to the - // "faas.invocation_id" semantic conventions. It represents the invocation - // ID of the current function invocation. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28' - FaaSInvocationIDKey = attribute.Key("faas.invocation_id") -) - -var ( - // A response to some data source operation such as a database or filesystem read/write - FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") - // To provide an answer to an inbound HTTP request - FaaSTriggerHTTP = FaaSTriggerKey.String("http") - // A function is set to be executed when messages are sent to a messaging system - FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") - // A function is scheduled to be executed regularly - FaaSTriggerTimer = FaaSTriggerKey.String("timer") - // If none of the others apply - FaaSTriggerOther = FaaSTriggerKey.String("other") -) - -// FaaSInvocationID returns an attribute KeyValue conforming to the -// "faas.invocation_id" semantic conventions. It represents the invocation ID -// of the current function invocation. -func FaaSInvocationID(val string) attribute.KeyValue { - return FaaSInvocationIDKey.String(val) -} - -// Semantic Convention for FaaS triggered as a response to some data source -// operation such as a database or filesystem read/write. -const ( - // FaaSDocumentCollectionKey is the attribute Key conforming to the - // "faas.document.collection" semantic conventions. It represents the name - // of the source on which the triggering operation was performed. For - // example, in Cloud Storage or S3 corresponds to the bucket name, and in - // Cosmos DB to the database name. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'myBucketName', 'myDBName' - FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") - - // FaaSDocumentOperationKey is the attribute Key conforming to the - // "faas.document.operation" semantic conventions. It represents the - // describes the type of the operation that was performed on the data. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - FaaSDocumentOperationKey = attribute.Key("faas.document.operation") - - // FaaSDocumentTimeKey is the attribute Key conforming to the - // "faas.document.time" semantic conventions. It represents a string - // containing the time when the data was accessed in the [ISO - // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format - // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2020-01-23T13:47:06Z' - FaaSDocumentTimeKey = attribute.Key("faas.document.time") - - // FaaSDocumentNameKey is the attribute Key conforming to the - // "faas.document.name" semantic conventions. It represents the document - // name/table subjected to the operation. For example, in Cloud Storage or - // S3 is the name of the file, and in Cosmos DB the table name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'myFile.txt', 'myTableName' - FaaSDocumentNameKey = attribute.Key("faas.document.name") -) - -var ( - // When a new object is created - FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") - // When an object is modified - FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") - // When an object is deleted - FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") -) - -// FaaSDocumentCollection returns an attribute KeyValue conforming to the -// "faas.document.collection" semantic conventions. It represents the name of -// the source on which the triggering operation was performed. For example, in -// Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the -// database name. -func FaaSDocumentCollection(val string) attribute.KeyValue { - return FaaSDocumentCollectionKey.String(val) -} - -// FaaSDocumentTime returns an attribute KeyValue conforming to the -// "faas.document.time" semantic conventions. It represents a string containing -// the time when the data was accessed in the [ISO -// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format -// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -func FaaSDocumentTime(val string) attribute.KeyValue { - return FaaSDocumentTimeKey.String(val) -} - -// FaaSDocumentName returns an attribute KeyValue conforming to the -// "faas.document.name" semantic conventions. It represents the document -// name/table subjected to the operation. For example, in Cloud Storage or S3 -// is the name of the file, and in Cosmos DB the table name. -func FaaSDocumentName(val string) attribute.KeyValue { - return FaaSDocumentNameKey.String(val) -} - -// Semantic Convention for FaaS scheduled to be executed regularly. -const ( - // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic - // conventions. It represents a string containing the function invocation - // time in the [ISO - // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format - // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2020-01-23T13:47:06Z' - FaaSTimeKey = attribute.Key("faas.time") - - // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic - // conventions. It represents a string containing the schedule period as - // [Cron - // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '0/5 * * * ? *' - FaaSCronKey = attribute.Key("faas.cron") -) - -// FaaSTime returns an attribute KeyValue conforming to the "faas.time" -// semantic conventions. It represents a string containing the function -// invocation time in the [ISO -// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format -// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -func FaaSTime(val string) attribute.KeyValue { - return FaaSTimeKey.String(val) -} - -// FaaSCron returns an attribute KeyValue conforming to the "faas.cron" -// semantic conventions. It represents a string containing the schedule period -// as [Cron -// Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). -func FaaSCron(val string) attribute.KeyValue { - return FaaSCronKey.String(val) -} - -// Contains additional attributes for incoming FaaS spans. -const ( - // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" - // semantic conventions. It represents a boolean that is true if the - // serverless function is executed for the first time (aka cold-start). - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - FaaSColdstartKey = attribute.Key("faas.coldstart") -) - -// FaaSColdstart returns an attribute KeyValue conforming to the -// "faas.coldstart" semantic conventions. It represents a boolean that is true -// if the serverless function is executed for the first time (aka cold-start). -func FaaSColdstart(val bool) attribute.KeyValue { - return FaaSColdstartKey.Bool(val) -} - -// Contains additional attributes for outgoing FaaS spans. -const ( - // FaaSInvokedNameKey is the attribute Key conforming to the - // "faas.invoked_name" semantic conventions. It represents the name of the - // invoked function. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'my-function' - // Note: SHOULD be equal to the `faas.name` resource attribute of the - // invoked function. - FaaSInvokedNameKey = attribute.Key("faas.invoked_name") - - // FaaSInvokedProviderKey is the attribute Key conforming to the - // "faas.invoked_provider" semantic conventions. It represents the cloud - // provider of the invoked function. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Note: SHOULD be equal to the `cloud.provider` resource attribute of the - // invoked function. - FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") - - // FaaSInvokedRegionKey is the attribute Key conforming to the - // "faas.invoked_region" semantic conventions. It represents the cloud - // region of the invoked function. - // - // Type: string - // RequirementLevel: ConditionallyRequired (For some cloud providers, like - // AWS or GCP, the region in which a function is hosted is essential to - // uniquely identify the function and also part of its endpoint. Since it's - // part of the endpoint being called, the region is always known to - // clients. In these cases, `faas.invoked_region` MUST be set accordingly. - // If the region is unknown to the client or not required for identifying - // the invoked function, setting `faas.invoked_region` is optional.) - // Stability: stable - // Examples: 'eu-central-1' - // Note: SHOULD be equal to the `cloud.region` resource attribute of the - // invoked function. - FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") -) - -var ( - // Alibaba Cloud - FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") - // Amazon Web Services - FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") - // Microsoft Azure - FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") - // Google Cloud Platform - FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") - // Tencent Cloud - FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") -) - -// FaaSInvokedName returns an attribute KeyValue conforming to the -// "faas.invoked_name" semantic conventions. It represents the name of the -// invoked function. -func FaaSInvokedName(val string) attribute.KeyValue { - return FaaSInvokedNameKey.String(val) -} - -// FaaSInvokedRegion returns an attribute KeyValue conforming to the -// "faas.invoked_region" semantic conventions. It represents the cloud region -// of the invoked function. -func FaaSInvokedRegion(val string) attribute.KeyValue { - return FaaSInvokedRegionKey.String(val) -} - -// Operations that access some remote service. -const ( - // PeerServiceKey is the attribute Key conforming to the "peer.service" - // semantic conventions. It represents the - // [`service.name`](/docs/resource/README.md#service) of the remote - // service. SHOULD be equal to the actual `service.name` resource attribute - // of the remote service if any. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'AuthTokenCache' - PeerServiceKey = attribute.Key("peer.service") -) - -// PeerService returns an attribute KeyValue conforming to the -// "peer.service" semantic conventions. It represents the -// [`service.name`](/docs/resource/README.md#service) of the remote service. -// SHOULD be equal to the actual `service.name` resource attribute of the -// remote service if any. -func PeerService(val string) attribute.KeyValue { - return PeerServiceKey.String(val) -} - -// These attributes may be used for any operation with an authenticated and/or -// authorized enduser. -const ( - // EnduserIDKey is the attribute Key conforming to the "enduser.id" - // semantic conventions. It represents the username or client_id extracted - // from the access token or - // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header - // in the inbound request from outside the system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'username' - EnduserIDKey = attribute.Key("enduser.id") - - // EnduserRoleKey is the attribute Key conforming to the "enduser.role" - // semantic conventions. It represents the actual/assumed role the client - // is making the request under extracted from token or application security - // context. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'admin' - EnduserRoleKey = attribute.Key("enduser.role") - - // EnduserScopeKey is the attribute Key conforming to the "enduser.scope" - // semantic conventions. It represents the scopes or granted authorities - // the client currently possesses extracted from token or application - // security context. The value would come from the scope associated with an - // [OAuth 2.0 Access - // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute - // value in a [SAML 2.0 - // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'read:message, write:files' - EnduserScopeKey = attribute.Key("enduser.scope") -) - -// EnduserID returns an attribute KeyValue conforming to the "enduser.id" -// semantic conventions. It represents the username or client_id extracted from -// the access token or -// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in -// the inbound request from outside the system. -func EnduserID(val string) attribute.KeyValue { - return EnduserIDKey.String(val) -} - -// EnduserRole returns an attribute KeyValue conforming to the -// "enduser.role" semantic conventions. It represents the actual/assumed role -// the client is making the request under extracted from token or application -// security context. -func EnduserRole(val string) attribute.KeyValue { - return EnduserRoleKey.String(val) -} - -// EnduserScope returns an attribute KeyValue conforming to the -// "enduser.scope" semantic conventions. It represents the scopes or granted -// authorities the client currently possesses extracted from token or -// application security context. The value would come from the scope associated -// with an [OAuth 2.0 Access -// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute -// value in a [SAML 2.0 -// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). -func EnduserScope(val string) attribute.KeyValue { - return EnduserScopeKey.String(val) -} - -// These attributes may be used for any operation to store information about a -// thread that started a span. -const ( - // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic - // conventions. It represents the current "managed" thread ID (as opposed - // to OS thread ID). - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 42 - ThreadIDKey = attribute.Key("thread.id") - - // ThreadNameKey is the attribute Key conforming to the "thread.name" - // semantic conventions. It represents the current thread name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'main' - ThreadNameKey = attribute.Key("thread.name") -) - -// ThreadID returns an attribute KeyValue conforming to the "thread.id" -// semantic conventions. It represents the current "managed" thread ID (as -// opposed to OS thread ID). -func ThreadID(val int) attribute.KeyValue { - return ThreadIDKey.Int(val) -} - -// ThreadName returns an attribute KeyValue conforming to the "thread.name" -// semantic conventions. It represents the current thread name. -func ThreadName(val string) attribute.KeyValue { - return ThreadNameKey.String(val) -} - -// These attributes allow to report this unit of code and therefore to provide -// more context about the span. -const ( - // CodeFunctionKey is the attribute Key conforming to the "code.function" - // semantic conventions. It represents the method or function name, or - // equivalent (usually rightmost part of the code unit's name). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'serveRequest' - CodeFunctionKey = attribute.Key("code.function") - - // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" - // semantic conventions. It represents the "namespace" within which - // `code.function` is defined. Usually the qualified class or module name, - // such that `code.namespace` + some separator + `code.function` form a - // unique identifier for the code unit. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'com.example.MyHTTPService' - CodeNamespaceKey = attribute.Key("code.namespace") - - // CodeFilepathKey is the attribute Key conforming to the "code.filepath" - // semantic conventions. It represents the source code file name that - // identifies the code unit as uniquely as possible (preferably an absolute - // file path). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/usr/local/MyApplication/content_root/app/index.php' - CodeFilepathKey = attribute.Key("code.filepath") - - // CodeLineNumberKey is the attribute Key conforming to the "code.lineno" - // semantic conventions. It represents the line number in `code.filepath` - // best representing the operation. It SHOULD point within the code unit - // named in `code.function`. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 42 - CodeLineNumberKey = attribute.Key("code.lineno") - - // CodeColumnKey is the attribute Key conforming to the "code.column" - // semantic conventions. It represents the column number in `code.filepath` - // best representing the operation. It SHOULD point within the code unit - // named in `code.function`. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 16 - CodeColumnKey = attribute.Key("code.column") -) - -// CodeFunction returns an attribute KeyValue conforming to the -// "code.function" semantic conventions. It represents the method or function -// name, or equivalent (usually rightmost part of the code unit's name). -func CodeFunction(val string) attribute.KeyValue { - return CodeFunctionKey.String(val) -} - -// CodeNamespace returns an attribute KeyValue conforming to the -// "code.namespace" semantic conventions. It represents the "namespace" within -// which `code.function` is defined. Usually the qualified class or module -// name, such that `code.namespace` + some separator + `code.function` form a -// unique identifier for the code unit. -func CodeNamespace(val string) attribute.KeyValue { - return CodeNamespaceKey.String(val) -} - -// CodeFilepath returns an attribute KeyValue conforming to the -// "code.filepath" semantic conventions. It represents the source code file -// name that identifies the code unit as uniquely as possible (preferably an -// absolute file path). -func CodeFilepath(val string) attribute.KeyValue { - return CodeFilepathKey.String(val) -} - -// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno" -// semantic conventions. It represents the line number in `code.filepath` best -// representing the operation. It SHOULD point within the code unit named in -// `code.function`. -func CodeLineNumber(val int) attribute.KeyValue { - return CodeLineNumberKey.Int(val) -} - -// CodeColumn returns an attribute KeyValue conforming to the "code.column" -// semantic conventions. It represents the column number in `code.filepath` -// best representing the operation. It SHOULD point within the code unit named -// in `code.function`. -func CodeColumn(val int) attribute.KeyValue { - return CodeColumnKey.Int(val) -} - -// Semantic Convention for HTTP Client -const ( - // HTTPResendCountKey is the attribute Key conforming to the - // "http.resend_count" semantic conventions. It represents the ordinal - // number of request resending attempt (for any reason, including - // redirects). - // - // Type: int - // RequirementLevel: Recommended (if and only if request was retried.) - // Stability: stable - // Examples: 3 - // Note: The resend count SHOULD be updated each time an HTTP request gets - // resent by the client, regardless of what was the cause of the resending - // (e.g. redirection, authorization failure, 503 Server Unavailable, - // network issues, or any other). - HTTPResendCountKey = attribute.Key("http.resend_count") -) - -// HTTPResendCount returns an attribute KeyValue conforming to the -// "http.resend_count" semantic conventions. It represents the ordinal number -// of request resending attempt (for any reason, including redirects). -func HTTPResendCount(val int) attribute.KeyValue { - return HTTPResendCountKey.Int(val) -} - -// The `aws` conventions apply to operations using the AWS SDK. They map -// request or response parameters in AWS SDK API calls to attributes on a Span. -// The conventions have been collected over time based on feedback from AWS -// users of tracing and will continue to evolve as new interesting conventions -// are found. -// Some descriptions are also provided for populating general OpenTelemetry -// semantic conventions based on these APIs. -const ( - // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id" - // semantic conventions. It represents the AWS request ID as returned in - // the response headers `x-amz-request-id` or `x-amz-requestid`. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ' - AWSRequestIDKey = attribute.Key("aws.request_id") -) - -// AWSRequestID returns an attribute KeyValue conforming to the -// "aws.request_id" semantic conventions. It represents the AWS request ID as -// returned in the response headers `x-amz-request-id` or `x-amz-requestid`. -func AWSRequestID(val string) attribute.KeyValue { - return AWSRequestIDKey.String(val) -} - -// Attributes that exist for multiple DynamoDB request types. -const ( - // AWSDynamoDBTableNamesKey is the attribute Key conforming to the - // "aws.dynamodb.table_names" semantic conventions. It represents the keys - // in the `RequestItems` object field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Users', 'Cats' - AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") - - // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the - // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the - // JSON-serialized value of each item in the `ConsumedCapacity` response - // field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { - // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, - // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : - // { "CapacityUnits": number, "ReadCapacityUnits": number, - // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": - // { "CapacityUnits": number, "ReadCapacityUnits": number, - // "WriteCapacityUnits": number }, "TableName": "string", - // "WriteCapacityUnits": number }' - AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") - - // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to - // the "aws.dynamodb.item_collection_metrics" semantic conventions. It - // represents the JSON-serialized value of the `ItemCollectionMetrics` - // response field. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": - // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { - // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], - // "NULL": boolean, "S": "string", "SS": [ "string" ] } }, - // "SizeEstimateRangeGB": [ number ] } ] }' - AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") - - // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to - // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It - // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` - // request parameter. - // - // Type: double - // RequirementLevel: Optional - // Stability: stable - // Examples: 1.0, 2.0 - AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") - - // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming - // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. - // It represents the value of the - // `ProvisionedThroughput.WriteCapacityUnits` request parameter. - // - // Type: double - // RequirementLevel: Optional - // Stability: stable - // Examples: 1.0, 2.0 - AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") - - // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the - // "aws.dynamodb.consistent_read" semantic conventions. It represents the - // value of the `ConsistentRead` request parameter. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") - - // AWSDynamoDBProjectionKey is the attribute Key conforming to the - // "aws.dynamodb.projection" semantic conventions. It represents the value - // of the `ProjectionExpression` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Title', 'Title, Price, Color', 'Title, Description, - // RelatedItems, ProductReviews' - AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") - - // AWSDynamoDBLimitKey is the attribute Key conforming to the - // "aws.dynamodb.limit" semantic conventions. It represents the value of - // the `Limit` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 10 - AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") - - // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the - // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the - // value of the `AttributesToGet` request parameter. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'lives', 'id' - AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") - - // AWSDynamoDBIndexNameKey is the attribute Key conforming to the - // "aws.dynamodb.index_name" semantic conventions. It represents the value - // of the `IndexName` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'name_to_group' - AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") - - // AWSDynamoDBSelectKey is the attribute Key conforming to the - // "aws.dynamodb.select" semantic conventions. It represents the value of - // the `Select` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'ALL_ATTRIBUTES', 'COUNT' - AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") -) - -// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the -// "aws.dynamodb.table_names" semantic conventions. It represents the keys in -// the `RequestItems` object field. -func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { - return AWSDynamoDBTableNamesKey.StringSlice(val) -} - -// AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to -// the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the -// JSON-serialized value of each item in the `ConsumedCapacity` response field. -func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { - return AWSDynamoDBConsumedCapacityKey.StringSlice(val) -} - -// AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming -// to the "aws.dynamodb.item_collection_metrics" semantic conventions. It -// represents the JSON-serialized value of the `ItemCollectionMetrics` response -// field. -func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { - return AWSDynamoDBItemCollectionMetricsKey.String(val) -} - -// AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue -// conforming to the "aws.dynamodb.provisioned_read_capacity" semantic -// conventions. It represents the value of the -// `ProvisionedThroughput.ReadCapacityUnits` request parameter. -func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { - return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) -} - -// AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue -// conforming to the "aws.dynamodb.provisioned_write_capacity" semantic -// conventions. It represents the value of the -// `ProvisionedThroughput.WriteCapacityUnits` request parameter. -func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { - return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) -} - -// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the -// "aws.dynamodb.consistent_read" semantic conventions. It represents the value -// of the `ConsistentRead` request parameter. -func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { - return AWSDynamoDBConsistentReadKey.Bool(val) -} - -// AWSDynamoDBProjection returns an attribute KeyValue conforming to the -// "aws.dynamodb.projection" semantic conventions. It represents the value of -// the `ProjectionExpression` request parameter. -func AWSDynamoDBProjection(val string) attribute.KeyValue { - return AWSDynamoDBProjectionKey.String(val) -} - -// AWSDynamoDBLimit returns an attribute KeyValue conforming to the -// "aws.dynamodb.limit" semantic conventions. It represents the value of the -// `Limit` request parameter. -func AWSDynamoDBLimit(val int) attribute.KeyValue { - return AWSDynamoDBLimitKey.Int(val) -} - -// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to -// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the -// value of the `AttributesToGet` request parameter. -func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { - return AWSDynamoDBAttributesToGetKey.StringSlice(val) -} - -// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the -// "aws.dynamodb.index_name" semantic conventions. It represents the value of -// the `IndexName` request parameter. -func AWSDynamoDBIndexName(val string) attribute.KeyValue { - return AWSDynamoDBIndexNameKey.String(val) -} - -// AWSDynamoDBSelect returns an attribute KeyValue conforming to the -// "aws.dynamodb.select" semantic conventions. It represents the value of the -// `Select` request parameter. -func AWSDynamoDBSelect(val string) attribute.KeyValue { - return AWSDynamoDBSelectKey.String(val) -} - -// DynamoDB.CreateTable -const ( - // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to - // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It - // represents the JSON-serialized value of each item of the - // `GlobalSecondaryIndexes` request field - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": - // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ - // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { - // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }' - AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") - - // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to - // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It - // represents the JSON-serialized value of each item of the - // `LocalSecondaryIndexes` request field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "IndexARN": "string", "IndexName": "string", - // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { - // "AttributeName": "string", "KeyType": "string" } ], "Projection": { - // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }' - AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") -) - -// AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue -// conforming to the "aws.dynamodb.global_secondary_indexes" semantic -// conventions. It represents the JSON-serialized value of each item of the -// `GlobalSecondaryIndexes` request field -func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { - return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) -} - -// AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming -// to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It -// represents the JSON-serialized value of each item of the -// `LocalSecondaryIndexes` request field. -func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { - return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) -} - -// DynamoDB.ListTables -const ( - // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the - // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents - // the value of the `ExclusiveStartTableName` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Users', 'CatsTable' - AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") - - // AWSDynamoDBTableCountKey is the attribute Key conforming to the - // "aws.dynamodb.table_count" semantic conventions. It represents the the - // number of items in the `TableNames` response parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 20 - AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") -) - -// AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming -// to the "aws.dynamodb.exclusive_start_table" semantic conventions. It -// represents the value of the `ExclusiveStartTableName` request parameter. -func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { - return AWSDynamoDBExclusiveStartTableKey.String(val) -} - -// AWSDynamoDBTableCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.table_count" semantic conventions. It represents the the -// number of items in the `TableNames` response parameter. -func AWSDynamoDBTableCount(val int) attribute.KeyValue { - return AWSDynamoDBTableCountKey.Int(val) -} - -// DynamoDB.Query -const ( - // AWSDynamoDBScanForwardKey is the attribute Key conforming to the - // "aws.dynamodb.scan_forward" semantic conventions. It represents the - // value of the `ScanIndexForward` request parameter. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") -) - -// AWSDynamoDBScanForward returns an attribute KeyValue conforming to the -// "aws.dynamodb.scan_forward" semantic conventions. It represents the value of -// the `ScanIndexForward` request parameter. -func AWSDynamoDBScanForward(val bool) attribute.KeyValue { - return AWSDynamoDBScanForwardKey.Bool(val) -} - -// DynamoDB.Scan -const ( - // AWSDynamoDBSegmentKey is the attribute Key conforming to the - // "aws.dynamodb.segment" semantic conventions. It represents the value of - // the `Segment` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 10 - AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") - - // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the - // "aws.dynamodb.total_segments" semantic conventions. It represents the - // value of the `TotalSegments` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 100 - AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") - - // AWSDynamoDBCountKey is the attribute Key conforming to the - // "aws.dynamodb.count" semantic conventions. It represents the value of - // the `Count` response parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 10 - AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") - - // AWSDynamoDBScannedCountKey is the attribute Key conforming to the - // "aws.dynamodb.scanned_count" semantic conventions. It represents the - // value of the `ScannedCount` response parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 50 - AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") -) - -// AWSDynamoDBSegment returns an attribute KeyValue conforming to the -// "aws.dynamodb.segment" semantic conventions. It represents the value of the -// `Segment` request parameter. -func AWSDynamoDBSegment(val int) attribute.KeyValue { - return AWSDynamoDBSegmentKey.Int(val) -} - -// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the -// "aws.dynamodb.total_segments" semantic conventions. It represents the value -// of the `TotalSegments` request parameter. -func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { - return AWSDynamoDBTotalSegmentsKey.Int(val) -} - -// AWSDynamoDBCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.count" semantic conventions. It represents the value of the -// `Count` response parameter. -func AWSDynamoDBCount(val int) attribute.KeyValue { - return AWSDynamoDBCountKey.Int(val) -} - -// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.scanned_count" semantic conventions. It represents the value -// of the `ScannedCount` response parameter. -func AWSDynamoDBScannedCount(val int) attribute.KeyValue { - return AWSDynamoDBScannedCountKey.Int(val) -} - -// DynamoDB.UpdateTable -const ( - // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to - // the "aws.dynamodb.attribute_definitions" semantic conventions. It - // represents the JSON-serialized value of each item in the - // `AttributeDefinitions` request field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "AttributeName": "string", "AttributeType": "string" }' - AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") - - // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key - // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic - // conventions. It represents the JSON-serialized value of each item in the - // the `GlobalSecondaryIndexUpdates` request field. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ { - // "AttributeName": "string", "KeyType": "string" } ], "Projection": { - // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, - // "ProvisionedThroughput": { "ReadCapacityUnits": number, - // "WriteCapacityUnits": number } }' - AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") -) - -// AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming -// to the "aws.dynamodb.attribute_definitions" semantic conventions. It -// represents the JSON-serialized value of each item in the -// `AttributeDefinitions` request field. -func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { - return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) -} - -// AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue -// conforming to the "aws.dynamodb.global_secondary_index_updates" semantic -// conventions. It represents the JSON-serialized value of each item in the the -// `GlobalSecondaryIndexUpdates` request field. -func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { - return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) -} - -// Attributes that exist for S3 request types. -const ( - // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket" - // semantic conventions. It represents the S3 bucket name the request - // refers to. Corresponds to the `--bucket` parameter of the [S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) - // operations. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'some-bucket-name' - // Note: The `bucket` attribute is applicable to all S3 operations that - // reference a bucket, i.e. that require the bucket name as a mandatory - // parameter. - // This applies to almost all S3 operations except `list-buckets`. - AWSS3BucketKey = attribute.Key("aws.s3.bucket") - - // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic - // conventions. It represents the S3 object key the request refers to. - // Corresponds to the `--key` parameter of the [S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) - // operations. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'someFile.yml' - // Note: The `key` attribute is applicable to all object-related S3 - // operations, i.e. that require the object key as a mandatory parameter. - // This applies in particular to the following operations: - // - // - - // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - // - - // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - // - - // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) - // - - // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) - // - - // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) - // - - // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) - // - - // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) - // - - // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - // - - // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - // - - // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) - // - - // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - // - - // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - // - - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - AWSS3KeyKey = attribute.Key("aws.s3.key") - - // AWSS3CopySourceKey is the attribute Key conforming to the - // "aws.s3.copy_source" semantic conventions. It represents the source - // object (in the form `bucket`/`key`) for the copy operation. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'someFile.yml' - // Note: The `copy_source` attribute applies to S3 copy operations and - // corresponds to the `--copy-source` parameter - // of the [copy-object operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). - // This applies in particular to the following operations: - // - // - - // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - // - - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") - - // AWSS3UploadIDKey is the attribute Key conforming to the - // "aws.s3.upload_id" semantic conventions. It represents the upload ID - // that identifies the multipart upload. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ' - // Note: The `upload_id` attribute applies to S3 multipart-upload - // operations and corresponds to the `--upload-id` parameter - // of the [S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) - // multipart operations. - // This applies in particular to the following operations: - // - // - - // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) - // - - // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) - // - - // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) - // - - // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - // - - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id") - - // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" - // semantic conventions. It represents the delete request container that - // specifies the objects to be deleted. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean' - // Note: The `delete` attribute is only applicable to the - // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - // operation. - // The `delete` attribute corresponds to the `--delete` parameter of the - // [delete-objects operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). - AWSS3DeleteKey = attribute.Key("aws.s3.delete") - - // AWSS3PartNumberKey is the attribute Key conforming to the - // "aws.s3.part_number" semantic conventions. It represents the part number - // of the part being uploaded in a multipart-upload operation. This is a - // positive integer between 1 and 10,000. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3456 - // Note: The `part_number` attribute is only applicable to the - // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - // and - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - // operations. - // The `part_number` attribute corresponds to the `--part-number` parameter - // of the - // [upload-part operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). - AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") -) - -// AWSS3Bucket returns an attribute KeyValue conforming to the -// "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the -// request refers to. Corresponds to the `--bucket` parameter of the [S3 -// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) -// operations. -func AWSS3Bucket(val string) attribute.KeyValue { - return AWSS3BucketKey.String(val) -} - -// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" -// semantic conventions. It represents the S3 object key the request refers to. -// Corresponds to the `--key` parameter of the [S3 -// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) -// operations. -func AWSS3Key(val string) attribute.KeyValue { - return AWSS3KeyKey.String(val) -} - -// AWSS3CopySource returns an attribute KeyValue conforming to the -// "aws.s3.copy_source" semantic conventions. It represents the source object -// (in the form `bucket`/`key`) for the copy operation. -func AWSS3CopySource(val string) attribute.KeyValue { - return AWSS3CopySourceKey.String(val) -} - -// AWSS3UploadID returns an attribute KeyValue conforming to the -// "aws.s3.upload_id" semantic conventions. It represents the upload ID that -// identifies the multipart upload. -func AWSS3UploadID(val string) attribute.KeyValue { - return AWSS3UploadIDKey.String(val) -} - -// AWSS3Delete returns an attribute KeyValue conforming to the -// "aws.s3.delete" semantic conventions. It represents the delete request -// container that specifies the objects to be deleted. -func AWSS3Delete(val string) attribute.KeyValue { - return AWSS3DeleteKey.String(val) -} - -// AWSS3PartNumber returns an attribute KeyValue conforming to the -// "aws.s3.part_number" semantic conventions. It represents the part number of -// the part being uploaded in a multipart-upload operation. This is a positive -// integer between 1 and 10,000. -func AWSS3PartNumber(val int) attribute.KeyValue { - return AWSS3PartNumberKey.Int(val) -} - -// Semantic conventions to apply when instrumenting the GraphQL implementation. -// They map GraphQL operations to attributes on a Span. -const ( - // GraphqlOperationNameKey is the attribute Key conforming to the - // "graphql.operation.name" semantic conventions. It represents the name of - // the operation being executed. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'findBookByID' - GraphqlOperationNameKey = attribute.Key("graphql.operation.name") - - // GraphqlOperationTypeKey is the attribute Key conforming to the - // "graphql.operation.type" semantic conventions. It represents the type of - // the operation being executed. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Examples: 'query', 'mutation', 'subscription' - GraphqlOperationTypeKey = attribute.Key("graphql.operation.type") - - // GraphqlDocumentKey is the attribute Key conforming to the - // "graphql.document" semantic conventions. It represents the GraphQL - // document being executed. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'query findBookByID { bookByID(id: ?) { name } }' - // Note: The value may be sanitized to exclude sensitive information. - GraphqlDocumentKey = attribute.Key("graphql.document") -) - -var ( - // GraphQL query - GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query") - // GraphQL mutation - GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation") - // GraphQL subscription - GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription") -) - -// GraphqlOperationName returns an attribute KeyValue conforming to the -// "graphql.operation.name" semantic conventions. It represents the name of the -// operation being executed. -func GraphqlOperationName(val string) attribute.KeyValue { - return GraphqlOperationNameKey.String(val) -} - -// GraphqlDocument returns an attribute KeyValue conforming to the -// "graphql.document" semantic conventions. It represents the GraphQL document -// being executed. -func GraphqlDocument(val string) attribute.KeyValue { - return GraphqlDocumentKey.String(val) -} - -// General attributes used in messaging systems. -const ( - // MessagingSystemKey is the attribute Key conforming to the - // "messaging.system" semantic conventions. It represents a string - // identifying the messaging system. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' - MessagingSystemKey = attribute.Key("messaging.system") - - // MessagingOperationKey is the attribute Key conforming to the - // "messaging.operation" semantic conventions. It represents a string - // identifying the kind of messaging operation as defined in the [Operation - // names](#operation-names) section above. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Note: If a custom value is used, it MUST be of low cardinality. - MessagingOperationKey = attribute.Key("messaging.operation") - - // MessagingBatchMessageCountKey is the attribute Key conforming to the - // "messaging.batch.message_count" semantic conventions. It represents the - // number of messages sent, received, or processed in the scope of the - // batching operation. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If the span describes an - // operation on a batch of messages.) - // Stability: stable - // Examples: 0, 1, 2 - // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on - // spans that operate with a single message. When a messaging client - // library supports both batch and single-message API for the same - // operation, instrumentations SHOULD use `messaging.batch.message_count` - // for batching APIs and SHOULD NOT use it for single-message APIs. - MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") - - // MessagingClientIDKey is the attribute Key conforming to the - // "messaging.client_id" semantic conventions. It represents a unique - // identifier for the client that consumes or produces a message. - // - // Type: string - // RequirementLevel: Recommended (If a client id is available) - // Stability: stable - // Examples: 'client-5', 'myhost@8742@s8083jm' - MessagingClientIDKey = attribute.Key("messaging.client_id") -) - -var ( - // publish - MessagingOperationPublish = MessagingOperationKey.String("publish") - // receive - MessagingOperationReceive = MessagingOperationKey.String("receive") - // process - MessagingOperationProcess = MessagingOperationKey.String("process") -) - -// MessagingSystem returns an attribute KeyValue conforming to the -// "messaging.system" semantic conventions. It represents a string identifying -// the messaging system. -func MessagingSystem(val string) attribute.KeyValue { - return MessagingSystemKey.String(val) -} - -// MessagingBatchMessageCount returns an attribute KeyValue conforming to -// the "messaging.batch.message_count" semantic conventions. It represents the -// number of messages sent, received, or processed in the scope of the batching -// operation. -func MessagingBatchMessageCount(val int) attribute.KeyValue { - return MessagingBatchMessageCountKey.Int(val) -} - -// MessagingClientID returns an attribute KeyValue conforming to the -// "messaging.client_id" semantic conventions. It represents a unique -// identifier for the client that consumes or produces a message. -func MessagingClientID(val string) attribute.KeyValue { - return MessagingClientIDKey.String(val) -} - -// Semantic conventions for remote procedure calls. -const ( - // RPCSystemKey is the attribute Key conforming to the "rpc.system" - // semantic conventions. It represents a string identifying the remoting - // system. See below for a list of well-known identifiers. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - RPCSystemKey = attribute.Key("rpc.system") - - // RPCServiceKey is the attribute Key conforming to the "rpc.service" - // semantic conventions. It represents the full (logical) name of the - // service being called, including its package name, if applicable. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'myservice.EchoService' - // Note: This is the logical name of the service from the RPC interface - // perspective, which can be different from the name of any implementing - // class. The `code.namespace` attribute may be used to store the latter - // (despite the attribute name, it may include a class name; e.g., class - // with method actually executing the call on the server side, RPC client - // stub class on the client side). - RPCServiceKey = attribute.Key("rpc.service") - - // RPCMethodKey is the attribute Key conforming to the "rpc.method" - // semantic conventions. It represents the name of the (logical) method - // being called, must be equal to the $method part in the span name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'exampleMethod' - // Note: This is the logical name of the method from the RPC interface - // perspective, which can be different from the name of any implementing - // method/function. The `code.function` attribute may be used to store the - // latter (e.g., method actually executing the call on the server side, RPC - // client stub method on the client side). - RPCMethodKey = attribute.Key("rpc.method") -) - -var ( - // gRPC - RPCSystemGRPC = RPCSystemKey.String("grpc") - // Java RMI - RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") - // .NET WCF - RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") - // Apache Dubbo - RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") - // Connect RPC - RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") -) - -// RPCService returns an attribute KeyValue conforming to the "rpc.service" -// semantic conventions. It represents the full (logical) name of the service -// being called, including its package name, if applicable. -func RPCService(val string) attribute.KeyValue { - return RPCServiceKey.String(val) -} - -// RPCMethod returns an attribute KeyValue conforming to the "rpc.method" -// semantic conventions. It represents the name of the (logical) method being -// called, must be equal to the $method part in the span name. -func RPCMethod(val string) attribute.KeyValue { - return RPCMethodKey.String(val) -} - -// Tech-specific attributes for gRPC. -const ( - // RPCGRPCStatusCodeKey is the attribute Key conforming to the - // "rpc.grpc.status_code" semantic conventions. It represents the [numeric - // status - // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of - // the gRPC request. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") -) - -var ( - // OK - RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) - // CANCELLED - RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) - // UNKNOWN - RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) - // INVALID_ARGUMENT - RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) - // DEADLINE_EXCEEDED - RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) - // NOT_FOUND - RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) - // ALREADY_EXISTS - RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) - // PERMISSION_DENIED - RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) - // RESOURCE_EXHAUSTED - RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) - // FAILED_PRECONDITION - RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) - // ABORTED - RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) - // OUT_OF_RANGE - RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) - // UNIMPLEMENTED - RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) - // INTERNAL - RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) - // UNAVAILABLE - RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) - // DATA_LOSS - RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) - // UNAUTHENTICATED - RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) -) - -// Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/). -const ( - // RPCJsonrpcVersionKey is the attribute Key conforming to the - // "rpc.jsonrpc.version" semantic conventions. It represents the protocol - // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 - // does not specify this, the value can be omitted. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If other than the default - // version (`1.0`)) - // Stability: stable - // Examples: '2.0', '1.0' - RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") - - // RPCJsonrpcRequestIDKey is the attribute Key conforming to the - // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` - // property of request or response. Since protocol allows id to be int, - // string, `null` or missing (for notifications), value is expected to be - // cast to string for simplicity. Use empty string in case of `null` value. - // Omit entirely if this is a notification. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '10', 'request-7', '' - RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") - - // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_code" semantic conventions. It represents the - // `error.code` property of response if it is an error response. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If response is not successful.) - // Stability: stable - // Examples: -32700, 100 - RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") - - // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_message" semantic conventions. It represents the - // `error.message` property of response if it is an error response. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Parse error', 'User already exists' - RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") -) - -// RPCJsonrpcVersion returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.version" semantic conventions. It represents the protocol -// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 -// does not specify this, the value can be omitted. -func RPCJsonrpcVersion(val string) attribute.KeyValue { - return RPCJsonrpcVersionKey.String(val) -} - -// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` -// property of request or response. Since protocol allows id to be int, string, -// `null` or missing (for notifications), value is expected to be cast to -// string for simplicity. Use empty string in case of `null` value. Omit -// entirely if this is a notification. -func RPCJsonrpcRequestID(val string) attribute.KeyValue { - return RPCJsonrpcRequestIDKey.String(val) -} - -// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_code" semantic conventions. It represents the -// `error.code` property of response if it is an error response. -func RPCJsonrpcErrorCode(val int) attribute.KeyValue { - return RPCJsonrpcErrorCodeKey.Int(val) -} - -// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_message" semantic conventions. It represents the -// `error.message` property of response if it is an error response. -func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { - return RPCJsonrpcErrorMessageKey.String(val) -} - -// Tech-specific attributes for Connect RPC. -const ( - // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the - // "rpc.connect_rpc.error_code" semantic conventions. It represents the - // [error codes](https://connect.build/docs/protocol/#error-codes) of the - // Connect request. Error codes are always string values. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (If response is not successful - // and if error code available.) - // Stability: stable - RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") -) - -var ( - // cancelled - RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") - // unknown - RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") - // invalid_argument - RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") - // deadline_exceeded - RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") - // not_found - RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") - // already_exists - RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") - // permission_denied - RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") - // resource_exhausted - RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") - // failed_precondition - RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") - // aborted - RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") - // out_of_range - RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") - // unimplemented - RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") - // internal - RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") - // unavailable - RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") - // data_loss - RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") - // unauthenticated - RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") -) diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go deleted file mode 100644 index 5dfacbb98395..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_arm64.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build gc && !purego -// +build gc,!purego - -package chacha20 - -const bufSize = 256 - -//go:noescape -func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) - -func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { - xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s deleted file mode 100644 index f1f66230d1c2..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_arm64.s +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build gc && !purego -// +build gc,!purego - -#include "textflag.h" - -#define NUM_ROUNDS 10 - -// func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) -TEXT ·xorKeyStreamVX(SB), NOSPLIT, $0 - MOVD dst+0(FP), R1 - MOVD src+24(FP), R2 - MOVD src_len+32(FP), R3 - MOVD key+48(FP), R4 - MOVD nonce+56(FP), R6 - MOVD counter+64(FP), R7 - - MOVD $·constants(SB), R10 - MOVD $·incRotMatrix(SB), R11 - - MOVW (R7), R20 - - AND $~255, R3, R13 - ADD R2, R13, R12 // R12 for block end - AND $255, R3, R13 -loop: - MOVD $NUM_ROUNDS, R21 - VLD1 (R11), [V30.S4, V31.S4] - - // load contants - // VLD4R (R10), [V0.S4, V1.S4, V2.S4, V3.S4] - WORD $0x4D60E940 - - // load keys - // VLD4R 16(R4), [V4.S4, V5.S4, V6.S4, V7.S4] - WORD $0x4DFFE884 - // VLD4R 16(R4), [V8.S4, V9.S4, V10.S4, V11.S4] - WORD $0x4DFFE888 - SUB $32, R4 - - // load counter + nonce - // VLD1R (R7), [V12.S4] - WORD $0x4D40C8EC - - // VLD3R (R6), [V13.S4, V14.S4, V15.S4] - WORD $0x4D40E8CD - - // update counter - VADD V30.S4, V12.S4, V12.S4 - -chacha: - // V0..V3 += V4..V7 - // V12..V15 <<<= ((V12..V15 XOR V0..V3), 16) - VADD V0.S4, V4.S4, V0.S4 - VADD V1.S4, V5.S4, V1.S4 - VADD V2.S4, V6.S4, V2.S4 - VADD V3.S4, V7.S4, V3.S4 - VEOR V12.B16, V0.B16, V12.B16 - VEOR V13.B16, V1.B16, V13.B16 - VEOR V14.B16, V2.B16, V14.B16 - VEOR V15.B16, V3.B16, V15.B16 - VREV32 V12.H8, V12.H8 - VREV32 V13.H8, V13.H8 - VREV32 V14.H8, V14.H8 - VREV32 V15.H8, V15.H8 - // V8..V11 += V12..V15 - // V4..V7 <<<= ((V4..V7 XOR V8..V11), 12) - VADD V8.S4, V12.S4, V8.S4 - VADD V9.S4, V13.S4, V9.S4 - VADD V10.S4, V14.S4, V10.S4 - VADD V11.S4, V15.S4, V11.S4 - VEOR V8.B16, V4.B16, V16.B16 - VEOR V9.B16, V5.B16, V17.B16 - VEOR V10.B16, V6.B16, V18.B16 - VEOR V11.B16, V7.B16, V19.B16 - VSHL $12, V16.S4, V4.S4 - VSHL $12, V17.S4, V5.S4 - VSHL $12, V18.S4, V6.S4 - VSHL $12, V19.S4, V7.S4 - VSRI $20, V16.S4, V4.S4 - VSRI $20, V17.S4, V5.S4 - VSRI $20, V18.S4, V6.S4 - VSRI $20, V19.S4, V7.S4 - - // V0..V3 += V4..V7 - // V12..V15 <<<= ((V12..V15 XOR V0..V3), 8) - VADD V0.S4, V4.S4, V0.S4 - VADD V1.S4, V5.S4, V1.S4 - VADD V2.S4, V6.S4, V2.S4 - VADD V3.S4, V7.S4, V3.S4 - VEOR V12.B16, V0.B16, V12.B16 - VEOR V13.B16, V1.B16, V13.B16 - VEOR V14.B16, V2.B16, V14.B16 - VEOR V15.B16, V3.B16, V15.B16 - VTBL V31.B16, [V12.B16], V12.B16 - VTBL V31.B16, [V13.B16], V13.B16 - VTBL V31.B16, [V14.B16], V14.B16 - VTBL V31.B16, [V15.B16], V15.B16 - - // V8..V11 += V12..V15 - // V4..V7 <<<= ((V4..V7 XOR V8..V11), 7) - VADD V12.S4, V8.S4, V8.S4 - VADD V13.S4, V9.S4, V9.S4 - VADD V14.S4, V10.S4, V10.S4 - VADD V15.S4, V11.S4, V11.S4 - VEOR V8.B16, V4.B16, V16.B16 - VEOR V9.B16, V5.B16, V17.B16 - VEOR V10.B16, V6.B16, V18.B16 - VEOR V11.B16, V7.B16, V19.B16 - VSHL $7, V16.S4, V4.S4 - VSHL $7, V17.S4, V5.S4 - VSHL $7, V18.S4, V6.S4 - VSHL $7, V19.S4, V7.S4 - VSRI $25, V16.S4, V4.S4 - VSRI $25, V17.S4, V5.S4 - VSRI $25, V18.S4, V6.S4 - VSRI $25, V19.S4, V7.S4 - - // V0..V3 += V5..V7, V4 - // V15,V12-V14 <<<= ((V15,V12-V14 XOR V0..V3), 16) - VADD V0.S4, V5.S4, V0.S4 - VADD V1.S4, V6.S4, V1.S4 - VADD V2.S4, V7.S4, V2.S4 - VADD V3.S4, V4.S4, V3.S4 - VEOR V15.B16, V0.B16, V15.B16 - VEOR V12.B16, V1.B16, V12.B16 - VEOR V13.B16, V2.B16, V13.B16 - VEOR V14.B16, V3.B16, V14.B16 - VREV32 V12.H8, V12.H8 - VREV32 V13.H8, V13.H8 - VREV32 V14.H8, V14.H8 - VREV32 V15.H8, V15.H8 - - // V10 += V15; V5 <<<= ((V10 XOR V5), 12) - // ... - VADD V15.S4, V10.S4, V10.S4 - VADD V12.S4, V11.S4, V11.S4 - VADD V13.S4, V8.S4, V8.S4 - VADD V14.S4, V9.S4, V9.S4 - VEOR V10.B16, V5.B16, V16.B16 - VEOR V11.B16, V6.B16, V17.B16 - VEOR V8.B16, V7.B16, V18.B16 - VEOR V9.B16, V4.B16, V19.B16 - VSHL $12, V16.S4, V5.S4 - VSHL $12, V17.S4, V6.S4 - VSHL $12, V18.S4, V7.S4 - VSHL $12, V19.S4, V4.S4 - VSRI $20, V16.S4, V5.S4 - VSRI $20, V17.S4, V6.S4 - VSRI $20, V18.S4, V7.S4 - VSRI $20, V19.S4, V4.S4 - - // V0 += V5; V15 <<<= ((V0 XOR V15), 8) - // ... - VADD V5.S4, V0.S4, V0.S4 - VADD V6.S4, V1.S4, V1.S4 - VADD V7.S4, V2.S4, V2.S4 - VADD V4.S4, V3.S4, V3.S4 - VEOR V0.B16, V15.B16, V15.B16 - VEOR V1.B16, V12.B16, V12.B16 - VEOR V2.B16, V13.B16, V13.B16 - VEOR V3.B16, V14.B16, V14.B16 - VTBL V31.B16, [V12.B16], V12.B16 - VTBL V31.B16, [V13.B16], V13.B16 - VTBL V31.B16, [V14.B16], V14.B16 - VTBL V31.B16, [V15.B16], V15.B16 - - // V10 += V15; V5 <<<= ((V10 XOR V5), 7) - // ... - VADD V15.S4, V10.S4, V10.S4 - VADD V12.S4, V11.S4, V11.S4 - VADD V13.S4, V8.S4, V8.S4 - VADD V14.S4, V9.S4, V9.S4 - VEOR V10.B16, V5.B16, V16.B16 - VEOR V11.B16, V6.B16, V17.B16 - VEOR V8.B16, V7.B16, V18.B16 - VEOR V9.B16, V4.B16, V19.B16 - VSHL $7, V16.S4, V5.S4 - VSHL $7, V17.S4, V6.S4 - VSHL $7, V18.S4, V7.S4 - VSHL $7, V19.S4, V4.S4 - VSRI $25, V16.S4, V5.S4 - VSRI $25, V17.S4, V6.S4 - VSRI $25, V18.S4, V7.S4 - VSRI $25, V19.S4, V4.S4 - - SUB $1, R21 - CBNZ R21, chacha - - // VLD4R (R10), [V16.S4, V17.S4, V18.S4, V19.S4] - WORD $0x4D60E950 - - // VLD4R 16(R4), [V20.S4, V21.S4, V22.S4, V23.S4] - WORD $0x4DFFE894 - VADD V30.S4, V12.S4, V12.S4 - VADD V16.S4, V0.S4, V0.S4 - VADD V17.S4, V1.S4, V1.S4 - VADD V18.S4, V2.S4, V2.S4 - VADD V19.S4, V3.S4, V3.S4 - // VLD4R 16(R4), [V24.S4, V25.S4, V26.S4, V27.S4] - WORD $0x4DFFE898 - // restore R4 - SUB $32, R4 - - // load counter + nonce - // VLD1R (R7), [V28.S4] - WORD $0x4D40C8FC - // VLD3R (R6), [V29.S4, V30.S4, V31.S4] - WORD $0x4D40E8DD - - VADD V20.S4, V4.S4, V4.S4 - VADD V21.S4, V5.S4, V5.S4 - VADD V22.S4, V6.S4, V6.S4 - VADD V23.S4, V7.S4, V7.S4 - VADD V24.S4, V8.S4, V8.S4 - VADD V25.S4, V9.S4, V9.S4 - VADD V26.S4, V10.S4, V10.S4 - VADD V27.S4, V11.S4, V11.S4 - VADD V28.S4, V12.S4, V12.S4 - VADD V29.S4, V13.S4, V13.S4 - VADD V30.S4, V14.S4, V14.S4 - VADD V31.S4, V15.S4, V15.S4 - - VZIP1 V1.S4, V0.S4, V16.S4 - VZIP2 V1.S4, V0.S4, V17.S4 - VZIP1 V3.S4, V2.S4, V18.S4 - VZIP2 V3.S4, V2.S4, V19.S4 - VZIP1 V5.S4, V4.S4, V20.S4 - VZIP2 V5.S4, V4.S4, V21.S4 - VZIP1 V7.S4, V6.S4, V22.S4 - VZIP2 V7.S4, V6.S4, V23.S4 - VZIP1 V9.S4, V8.S4, V24.S4 - VZIP2 V9.S4, V8.S4, V25.S4 - VZIP1 V11.S4, V10.S4, V26.S4 - VZIP2 V11.S4, V10.S4, V27.S4 - VZIP1 V13.S4, V12.S4, V28.S4 - VZIP2 V13.S4, V12.S4, V29.S4 - VZIP1 V15.S4, V14.S4, V30.S4 - VZIP2 V15.S4, V14.S4, V31.S4 - VZIP1 V18.D2, V16.D2, V0.D2 - VZIP2 V18.D2, V16.D2, V4.D2 - VZIP1 V19.D2, V17.D2, V8.D2 - VZIP2 V19.D2, V17.D2, V12.D2 - VLD1.P 64(R2), [V16.B16, V17.B16, V18.B16, V19.B16] - - VZIP1 V22.D2, V20.D2, V1.D2 - VZIP2 V22.D2, V20.D2, V5.D2 - VZIP1 V23.D2, V21.D2, V9.D2 - VZIP2 V23.D2, V21.D2, V13.D2 - VLD1.P 64(R2), [V20.B16, V21.B16, V22.B16, V23.B16] - VZIP1 V26.D2, V24.D2, V2.D2 - VZIP2 V26.D2, V24.D2, V6.D2 - VZIP1 V27.D2, V25.D2, V10.D2 - VZIP2 V27.D2, V25.D2, V14.D2 - VLD1.P 64(R2), [V24.B16, V25.B16, V26.B16, V27.B16] - VZIP1 V30.D2, V28.D2, V3.D2 - VZIP2 V30.D2, V28.D2, V7.D2 - VZIP1 V31.D2, V29.D2, V11.D2 - VZIP2 V31.D2, V29.D2, V15.D2 - VLD1.P 64(R2), [V28.B16, V29.B16, V30.B16, V31.B16] - VEOR V0.B16, V16.B16, V16.B16 - VEOR V1.B16, V17.B16, V17.B16 - VEOR V2.B16, V18.B16, V18.B16 - VEOR V3.B16, V19.B16, V19.B16 - VST1.P [V16.B16, V17.B16, V18.B16, V19.B16], 64(R1) - VEOR V4.B16, V20.B16, V20.B16 - VEOR V5.B16, V21.B16, V21.B16 - VEOR V6.B16, V22.B16, V22.B16 - VEOR V7.B16, V23.B16, V23.B16 - VST1.P [V20.B16, V21.B16, V22.B16, V23.B16], 64(R1) - VEOR V8.B16, V24.B16, V24.B16 - VEOR V9.B16, V25.B16, V25.B16 - VEOR V10.B16, V26.B16, V26.B16 - VEOR V11.B16, V27.B16, V27.B16 - VST1.P [V24.B16, V25.B16, V26.B16, V27.B16], 64(R1) - VEOR V12.B16, V28.B16, V28.B16 - VEOR V13.B16, V29.B16, V29.B16 - VEOR V14.B16, V30.B16, V30.B16 - VEOR V15.B16, V31.B16, V31.B16 - VST1.P [V28.B16, V29.B16, V30.B16, V31.B16], 64(R1) - - ADD $4, R20 - MOVW R20, (R7) // update counter - - CMP R2, R12 - BGT loop - - RET - - -DATA ·constants+0x00(SB)/4, $0x61707865 -DATA ·constants+0x04(SB)/4, $0x3320646e -DATA ·constants+0x08(SB)/4, $0x79622d32 -DATA ·constants+0x0c(SB)/4, $0x6b206574 -GLOBL ·constants(SB), NOPTR|RODATA, $32 - -DATA ·incRotMatrix+0x00(SB)/4, $0x00000000 -DATA ·incRotMatrix+0x04(SB)/4, $0x00000001 -DATA ·incRotMatrix+0x08(SB)/4, $0x00000002 -DATA ·incRotMatrix+0x0c(SB)/4, $0x00000003 -DATA ·incRotMatrix+0x10(SB)/4, $0x02010003 -DATA ·incRotMatrix+0x14(SB)/4, $0x06050407 -DATA ·incRotMatrix+0x18(SB)/4, $0x0A09080B -DATA ·incRotMatrix+0x1c(SB)/4, $0x0E0D0C0F -GLOBL ·incRotMatrix(SB), NOPTR|RODATA, $32 diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_generic.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_generic.go deleted file mode 100644 index 93eb5ae6de6f..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_generic.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package chacha20 implements the ChaCha20 and XChaCha20 encryption algorithms -// as specified in RFC 8439 and draft-irtf-cfrg-xchacha-01. -package chacha20 - -import ( - "crypto/cipher" - "encoding/binary" - "errors" - "math/bits" - - "golang.org/x/crypto/internal/alias" -) - -const ( - // KeySize is the size of the key used by this cipher, in bytes. - KeySize = 32 - - // NonceSize is the size of the nonce used with the standard variant of this - // cipher, in bytes. - // - // Note that this is too short to be safely generated at random if the same - // key is reused more than 2³² times. - NonceSize = 12 - - // NonceSizeX is the size of the nonce used with the XChaCha20 variant of - // this cipher, in bytes. - NonceSizeX = 24 -) - -// Cipher is a stateful instance of ChaCha20 or XChaCha20 using a particular key -// and nonce. A *Cipher implements the cipher.Stream interface. -type Cipher struct { - // The ChaCha20 state is 16 words: 4 constant, 8 of key, 1 of counter - // (incremented after each block), and 3 of nonce. - key [8]uint32 - counter uint32 - nonce [3]uint32 - - // The last len bytes of buf are leftover key stream bytes from the previous - // XORKeyStream invocation. The size of buf depends on how many blocks are - // computed at a time by xorKeyStreamBlocks. - buf [bufSize]byte - len int - - // overflow is set when the counter overflowed, no more blocks can be - // generated, and the next XORKeyStream call should panic. - overflow bool - - // The counter-independent results of the first round are cached after they - // are computed the first time. - precompDone bool - p1, p5, p9, p13 uint32 - p2, p6, p10, p14 uint32 - p3, p7, p11, p15 uint32 -} - -var _ cipher.Stream = (*Cipher)(nil) - -// NewUnauthenticatedCipher creates a new ChaCha20 stream cipher with the given -// 32 bytes key and a 12 or 24 bytes nonce. If a nonce of 24 bytes is provided, -// the XChaCha20 construction will be used. It returns an error if key or nonce -// have any other length. -// -// Note that ChaCha20, like all stream ciphers, is not authenticated and allows -// attackers to silently tamper with the plaintext. For this reason, it is more -// appropriate as a building block than as a standalone encryption mechanism. -// Instead, consider using package golang.org/x/crypto/chacha20poly1305. -func NewUnauthenticatedCipher(key, nonce []byte) (*Cipher, error) { - // This function is split into a wrapper so that the Cipher allocation will - // be inlined, and depending on how the caller uses the return value, won't - // escape to the heap. - c := &Cipher{} - return newUnauthenticatedCipher(c, key, nonce) -} - -func newUnauthenticatedCipher(c *Cipher, key, nonce []byte) (*Cipher, error) { - if len(key) != KeySize { - return nil, errors.New("chacha20: wrong key size") - } - if len(nonce) == NonceSizeX { - // XChaCha20 uses the ChaCha20 core to mix 16 bytes of the nonce into a - // derived key, allowing it to operate on a nonce of 24 bytes. See - // draft-irtf-cfrg-xchacha-01, Section 2.3. - key, _ = HChaCha20(key, nonce[0:16]) - cNonce := make([]byte, NonceSize) - copy(cNonce[4:12], nonce[16:24]) - nonce = cNonce - } else if len(nonce) != NonceSize { - return nil, errors.New("chacha20: wrong nonce size") - } - - key, nonce = key[:KeySize], nonce[:NonceSize] // bounds check elimination hint - c.key = [8]uint32{ - binary.LittleEndian.Uint32(key[0:4]), - binary.LittleEndian.Uint32(key[4:8]), - binary.LittleEndian.Uint32(key[8:12]), - binary.LittleEndian.Uint32(key[12:16]), - binary.LittleEndian.Uint32(key[16:20]), - binary.LittleEndian.Uint32(key[20:24]), - binary.LittleEndian.Uint32(key[24:28]), - binary.LittleEndian.Uint32(key[28:32]), - } - c.nonce = [3]uint32{ - binary.LittleEndian.Uint32(nonce[0:4]), - binary.LittleEndian.Uint32(nonce[4:8]), - binary.LittleEndian.Uint32(nonce[8:12]), - } - return c, nil -} - -// The constant first 4 words of the ChaCha20 state. -const ( - j0 uint32 = 0x61707865 // expa - j1 uint32 = 0x3320646e // nd 3 - j2 uint32 = 0x79622d32 // 2-by - j3 uint32 = 0x6b206574 // te k -) - -const blockSize = 64 - -// quarterRound is the core of ChaCha20. It shuffles the bits of 4 state words. -// It's executed 4 times for each of the 20 ChaCha20 rounds, operating on all 16 -// words each round, in columnar or diagonal groups of 4 at a time. -func quarterRound(a, b, c, d uint32) (uint32, uint32, uint32, uint32) { - a += b - d ^= a - d = bits.RotateLeft32(d, 16) - c += d - b ^= c - b = bits.RotateLeft32(b, 12) - a += b - d ^= a - d = bits.RotateLeft32(d, 8) - c += d - b ^= c - b = bits.RotateLeft32(b, 7) - return a, b, c, d -} - -// SetCounter sets the Cipher counter. The next invocation of XORKeyStream will -// behave as if (64 * counter) bytes had been encrypted so far. -// -// To prevent accidental counter reuse, SetCounter panics if counter is less -// than the current value. -// -// Note that the execution time of XORKeyStream is not independent of the -// counter value. -func (s *Cipher) SetCounter(counter uint32) { - // Internally, s may buffer multiple blocks, which complicates this - // implementation slightly. When checking whether the counter has rolled - // back, we must use both s.counter and s.len to determine how many blocks - // we have already output. - outputCounter := s.counter - uint32(s.len)/blockSize - if s.overflow || counter < outputCounter { - panic("chacha20: SetCounter attempted to rollback counter") - } - - // In the general case, we set the new counter value and reset s.len to 0, - // causing the next call to XORKeyStream to refill the buffer. However, if - // we're advancing within the existing buffer, we can save work by simply - // setting s.len. - if counter < s.counter { - s.len = int(s.counter-counter) * blockSize - } else { - s.counter = counter - s.len = 0 - } -} - -// XORKeyStream XORs each byte in the given slice with a byte from the -// cipher's key stream. Dst and src must overlap entirely or not at all. -// -// If len(dst) < len(src), XORKeyStream will panic. It is acceptable -// to pass a dst bigger than src, and in that case, XORKeyStream will -// only update dst[:len(src)] and will not touch the rest of dst. -// -// Multiple calls to XORKeyStream behave as if the concatenation of -// the src buffers was passed in a single run. That is, Cipher -// maintains state and does not reset at each XORKeyStream call. -func (s *Cipher) XORKeyStream(dst, src []byte) { - if len(src) == 0 { - return - } - if len(dst) < len(src) { - panic("chacha20: output smaller than input") - } - dst = dst[:len(src)] - if alias.InexactOverlap(dst, src) { - panic("chacha20: invalid buffer overlap") - } - - // First, drain any remaining key stream from a previous XORKeyStream. - if s.len != 0 { - keyStream := s.buf[bufSize-s.len:] - if len(src) < len(keyStream) { - keyStream = keyStream[:len(src)] - } - _ = src[len(keyStream)-1] // bounds check elimination hint - for i, b := range keyStream { - dst[i] = src[i] ^ b - } - s.len -= len(keyStream) - dst, src = dst[len(keyStream):], src[len(keyStream):] - } - if len(src) == 0 { - return - } - - // If we'd need to let the counter overflow and keep generating output, - // panic immediately. If instead we'd only reach the last block, remember - // not to generate any more output after the buffer is drained. - numBlocks := (uint64(len(src)) + blockSize - 1) / blockSize - if s.overflow || uint64(s.counter)+numBlocks > 1<<32 { - panic("chacha20: counter overflow") - } else if uint64(s.counter)+numBlocks == 1<<32 { - s.overflow = true - } - - // xorKeyStreamBlocks implementations expect input lengths that are a - // multiple of bufSize. Platform-specific ones process multiple blocks at a - // time, so have bufSizes that are a multiple of blockSize. - - full := len(src) - len(src)%bufSize - if full > 0 { - s.xorKeyStreamBlocks(dst[:full], src[:full]) - } - dst, src = dst[full:], src[full:] - - // If using a multi-block xorKeyStreamBlocks would overflow, use the generic - // one that does one block at a time. - const blocksPerBuf = bufSize / blockSize - if uint64(s.counter)+blocksPerBuf > 1<<32 { - s.buf = [bufSize]byte{} - numBlocks := (len(src) + blockSize - 1) / blockSize - buf := s.buf[bufSize-numBlocks*blockSize:] - copy(buf, src) - s.xorKeyStreamBlocksGeneric(buf, buf) - s.len = len(buf) - copy(dst, buf) - return - } - - // If we have a partial (multi-)block, pad it for xorKeyStreamBlocks, and - // keep the leftover keystream for the next XORKeyStream invocation. - if len(src) > 0 { - s.buf = [bufSize]byte{} - copy(s.buf[:], src) - s.xorKeyStreamBlocks(s.buf[:], s.buf[:]) - s.len = bufSize - copy(dst, s.buf[:]) - } -} - -func (s *Cipher) xorKeyStreamBlocksGeneric(dst, src []byte) { - if len(dst) != len(src) || len(dst)%blockSize != 0 { - panic("chacha20: internal error: wrong dst and/or src length") - } - - // To generate each block of key stream, the initial cipher state - // (represented below) is passed through 20 rounds of shuffling, - // alternatively applying quarterRounds by columns (like 1, 5, 9, 13) - // or by diagonals (like 1, 6, 11, 12). - // - // 0:cccccccc 1:cccccccc 2:cccccccc 3:cccccccc - // 4:kkkkkkkk 5:kkkkkkkk 6:kkkkkkkk 7:kkkkkkkk - // 8:kkkkkkkk 9:kkkkkkkk 10:kkkkkkkk 11:kkkkkkkk - // 12:bbbbbbbb 13:nnnnnnnn 14:nnnnnnnn 15:nnnnnnnn - // - // c=constant k=key b=blockcount n=nonce - var ( - c0, c1, c2, c3 = j0, j1, j2, j3 - c4, c5, c6, c7 = s.key[0], s.key[1], s.key[2], s.key[3] - c8, c9, c10, c11 = s.key[4], s.key[5], s.key[6], s.key[7] - _, c13, c14, c15 = s.counter, s.nonce[0], s.nonce[1], s.nonce[2] - ) - - // Three quarters of the first round don't depend on the counter, so we can - // calculate them here, and reuse them for multiple blocks in the loop, and - // for future XORKeyStream invocations. - if !s.precompDone { - s.p1, s.p5, s.p9, s.p13 = quarterRound(c1, c5, c9, c13) - s.p2, s.p6, s.p10, s.p14 = quarterRound(c2, c6, c10, c14) - s.p3, s.p7, s.p11, s.p15 = quarterRound(c3, c7, c11, c15) - s.precompDone = true - } - - // A condition of len(src) > 0 would be sufficient, but this also - // acts as a bounds check elimination hint. - for len(src) >= 64 && len(dst) >= 64 { - // The remainder of the first column round. - fcr0, fcr4, fcr8, fcr12 := quarterRound(c0, c4, c8, s.counter) - - // The second diagonal round. - x0, x5, x10, x15 := quarterRound(fcr0, s.p5, s.p10, s.p15) - x1, x6, x11, x12 := quarterRound(s.p1, s.p6, s.p11, fcr12) - x2, x7, x8, x13 := quarterRound(s.p2, s.p7, fcr8, s.p13) - x3, x4, x9, x14 := quarterRound(s.p3, fcr4, s.p9, s.p14) - - // The remaining 18 rounds. - for i := 0; i < 9; i++ { - // Column round. - x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) - x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) - x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) - x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) - - // Diagonal round. - x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) - x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) - x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) - x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) - } - - // Add back the initial state to generate the key stream, then - // XOR the key stream with the source and write out the result. - addXor(dst[0:4], src[0:4], x0, c0) - addXor(dst[4:8], src[4:8], x1, c1) - addXor(dst[8:12], src[8:12], x2, c2) - addXor(dst[12:16], src[12:16], x3, c3) - addXor(dst[16:20], src[16:20], x4, c4) - addXor(dst[20:24], src[20:24], x5, c5) - addXor(dst[24:28], src[24:28], x6, c6) - addXor(dst[28:32], src[28:32], x7, c7) - addXor(dst[32:36], src[32:36], x8, c8) - addXor(dst[36:40], src[36:40], x9, c9) - addXor(dst[40:44], src[40:44], x10, c10) - addXor(dst[44:48], src[44:48], x11, c11) - addXor(dst[48:52], src[48:52], x12, s.counter) - addXor(dst[52:56], src[52:56], x13, c13) - addXor(dst[56:60], src[56:60], x14, c14) - addXor(dst[60:64], src[60:64], x15, c15) - - s.counter += 1 - - src, dst = src[blockSize:], dst[blockSize:] - } -} - -// HChaCha20 uses the ChaCha20 core to generate a derived key from a 32 bytes -// key and a 16 bytes nonce. It returns an error if key or nonce have any other -// length. It is used as part of the XChaCha20 construction. -func HChaCha20(key, nonce []byte) ([]byte, error) { - // This function is split into a wrapper so that the slice allocation will - // be inlined, and depending on how the caller uses the return value, won't - // escape to the heap. - out := make([]byte, 32) - return hChaCha20(out, key, nonce) -} - -func hChaCha20(out, key, nonce []byte) ([]byte, error) { - if len(key) != KeySize { - return nil, errors.New("chacha20: wrong HChaCha20 key size") - } - if len(nonce) != 16 { - return nil, errors.New("chacha20: wrong HChaCha20 nonce size") - } - - x0, x1, x2, x3 := j0, j1, j2, j3 - x4 := binary.LittleEndian.Uint32(key[0:4]) - x5 := binary.LittleEndian.Uint32(key[4:8]) - x6 := binary.LittleEndian.Uint32(key[8:12]) - x7 := binary.LittleEndian.Uint32(key[12:16]) - x8 := binary.LittleEndian.Uint32(key[16:20]) - x9 := binary.LittleEndian.Uint32(key[20:24]) - x10 := binary.LittleEndian.Uint32(key[24:28]) - x11 := binary.LittleEndian.Uint32(key[28:32]) - x12 := binary.LittleEndian.Uint32(nonce[0:4]) - x13 := binary.LittleEndian.Uint32(nonce[4:8]) - x14 := binary.LittleEndian.Uint32(nonce[8:12]) - x15 := binary.LittleEndian.Uint32(nonce[12:16]) - - for i := 0; i < 10; i++ { - // Diagonal round. - x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) - x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) - x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) - x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) - - // Column round. - x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) - x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) - x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) - x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) - } - - _ = out[31] // bounds check elimination hint - binary.LittleEndian.PutUint32(out[0:4], x0) - binary.LittleEndian.PutUint32(out[4:8], x1) - binary.LittleEndian.PutUint32(out[8:12], x2) - binary.LittleEndian.PutUint32(out[12:16], x3) - binary.LittleEndian.PutUint32(out[16:20], x12) - binary.LittleEndian.PutUint32(out[20:24], x13) - binary.LittleEndian.PutUint32(out[24:28], x14) - binary.LittleEndian.PutUint32(out[28:32], x15) - return out, nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go deleted file mode 100644 index 02ff3d05e9ae..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_noasm.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (!arm64 && !s390x && !ppc64le) || !gc || purego -// +build !arm64,!s390x,!ppc64le !gc purego - -package chacha20 - -const bufSize = blockSize - -func (s *Cipher) xorKeyStreamBlocks(dst, src []byte) { - s.xorKeyStreamBlocksGeneric(dst, src) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go deleted file mode 100644 index da420b2e97b0..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build gc && !purego -// +build gc,!purego - -package chacha20 - -const bufSize = 256 - -//go:noescape -func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) - -func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { - chaCha20_ctr32_vsx(&dst[0], &src[0], len(src), &c.key, &c.counter) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s deleted file mode 100644 index 5c0fed26f850..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Based on CRYPTOGAMS code with the following comment: -// # ==================================================================== -// # Written by Andy Polyakov for the OpenSSL -// # project. The module is, however, dual licensed under OpenSSL and -// # CRYPTOGAMS licenses depending on where you obtain it. For further -// # details see http://www.openssl.org/~appro/cryptogams/. -// # ==================================================================== - -// Code for the perl script that generates the ppc64 assembler -// can be found in the cryptogams repository at the link below. It is based on -// the original from openssl. - -// https://github.com/dot-asm/cryptogams/commit/a60f5b50ed908e91 - -// The differences in this and the original implementation are -// due to the calling conventions and initialization of constants. - -//go:build gc && !purego -// +build gc,!purego - -#include "textflag.h" - -#define OUT R3 -#define INP R4 -#define LEN R5 -#define KEY R6 -#define CNT R7 -#define TMP R15 - -#define CONSTBASE R16 -#define BLOCKS R17 - -DATA consts<>+0x00(SB)/8, $0x3320646e61707865 -DATA consts<>+0x08(SB)/8, $0x6b20657479622d32 -DATA consts<>+0x10(SB)/8, $0x0000000000000001 -DATA consts<>+0x18(SB)/8, $0x0000000000000000 -DATA consts<>+0x20(SB)/8, $0x0000000000000004 -DATA consts<>+0x28(SB)/8, $0x0000000000000000 -DATA consts<>+0x30(SB)/8, $0x0a0b08090e0f0c0d -DATA consts<>+0x38(SB)/8, $0x0203000106070405 -DATA consts<>+0x40(SB)/8, $0x090a0b080d0e0f0c -DATA consts<>+0x48(SB)/8, $0x0102030005060704 -DATA consts<>+0x50(SB)/8, $0x6170786561707865 -DATA consts<>+0x58(SB)/8, $0x6170786561707865 -DATA consts<>+0x60(SB)/8, $0x3320646e3320646e -DATA consts<>+0x68(SB)/8, $0x3320646e3320646e -DATA consts<>+0x70(SB)/8, $0x79622d3279622d32 -DATA consts<>+0x78(SB)/8, $0x79622d3279622d32 -DATA consts<>+0x80(SB)/8, $0x6b2065746b206574 -DATA consts<>+0x88(SB)/8, $0x6b2065746b206574 -DATA consts<>+0x90(SB)/8, $0x0000000100000000 -DATA consts<>+0x98(SB)/8, $0x0000000300000002 -GLOBL consts<>(SB), RODATA, $0xa0 - -//func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) -TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 - MOVD out+0(FP), OUT - MOVD inp+8(FP), INP - MOVD len+16(FP), LEN - MOVD key+24(FP), KEY - MOVD counter+32(FP), CNT - - // Addressing for constants - MOVD $consts<>+0x00(SB), CONSTBASE - MOVD $16, R8 - MOVD $32, R9 - MOVD $48, R10 - MOVD $64, R11 - SRD $6, LEN, BLOCKS - // V16 - LXVW4X (CONSTBASE)(R0), VS48 - ADD $80,CONSTBASE - - // Load key into V17,V18 - LXVW4X (KEY)(R0), VS49 - LXVW4X (KEY)(R8), VS50 - - // Load CNT, NONCE into V19 - LXVW4X (CNT)(R0), VS51 - - // Clear V27 - VXOR V27, V27, V27 - - // V28 - LXVW4X (CONSTBASE)(R11), VS60 - - // splat slot from V19 -> V26 - VSPLTW $0, V19, V26 - - VSLDOI $4, V19, V27, V19 - VSLDOI $12, V27, V19, V19 - - VADDUWM V26, V28, V26 - - MOVD $10, R14 - MOVD R14, CTR - -loop_outer_vsx: - // V0, V1, V2, V3 - LXVW4X (R0)(CONSTBASE), VS32 - LXVW4X (R8)(CONSTBASE), VS33 - LXVW4X (R9)(CONSTBASE), VS34 - LXVW4X (R10)(CONSTBASE), VS35 - - // splat values from V17, V18 into V4-V11 - VSPLTW $0, V17, V4 - VSPLTW $1, V17, V5 - VSPLTW $2, V17, V6 - VSPLTW $3, V17, V7 - VSPLTW $0, V18, V8 - VSPLTW $1, V18, V9 - VSPLTW $2, V18, V10 - VSPLTW $3, V18, V11 - - // VOR - VOR V26, V26, V12 - - // splat values from V19 -> V13, V14, V15 - VSPLTW $1, V19, V13 - VSPLTW $2, V19, V14 - VSPLTW $3, V19, V15 - - // splat const values - VSPLTISW $-16, V27 - VSPLTISW $12, V28 - VSPLTISW $8, V29 - VSPLTISW $7, V30 - -loop_vsx: - VADDUWM V0, V4, V0 - VADDUWM V1, V5, V1 - VADDUWM V2, V6, V2 - VADDUWM V3, V7, V3 - - VXOR V12, V0, V12 - VXOR V13, V1, V13 - VXOR V14, V2, V14 - VXOR V15, V3, V15 - - VRLW V12, V27, V12 - VRLW V13, V27, V13 - VRLW V14, V27, V14 - VRLW V15, V27, V15 - - VADDUWM V8, V12, V8 - VADDUWM V9, V13, V9 - VADDUWM V10, V14, V10 - VADDUWM V11, V15, V11 - - VXOR V4, V8, V4 - VXOR V5, V9, V5 - VXOR V6, V10, V6 - VXOR V7, V11, V7 - - VRLW V4, V28, V4 - VRLW V5, V28, V5 - VRLW V6, V28, V6 - VRLW V7, V28, V7 - - VADDUWM V0, V4, V0 - VADDUWM V1, V5, V1 - VADDUWM V2, V6, V2 - VADDUWM V3, V7, V3 - - VXOR V12, V0, V12 - VXOR V13, V1, V13 - VXOR V14, V2, V14 - VXOR V15, V3, V15 - - VRLW V12, V29, V12 - VRLW V13, V29, V13 - VRLW V14, V29, V14 - VRLW V15, V29, V15 - - VADDUWM V8, V12, V8 - VADDUWM V9, V13, V9 - VADDUWM V10, V14, V10 - VADDUWM V11, V15, V11 - - VXOR V4, V8, V4 - VXOR V5, V9, V5 - VXOR V6, V10, V6 - VXOR V7, V11, V7 - - VRLW V4, V30, V4 - VRLW V5, V30, V5 - VRLW V6, V30, V6 - VRLW V7, V30, V7 - - VADDUWM V0, V5, V0 - VADDUWM V1, V6, V1 - VADDUWM V2, V7, V2 - VADDUWM V3, V4, V3 - - VXOR V15, V0, V15 - VXOR V12, V1, V12 - VXOR V13, V2, V13 - VXOR V14, V3, V14 - - VRLW V15, V27, V15 - VRLW V12, V27, V12 - VRLW V13, V27, V13 - VRLW V14, V27, V14 - - VADDUWM V10, V15, V10 - VADDUWM V11, V12, V11 - VADDUWM V8, V13, V8 - VADDUWM V9, V14, V9 - - VXOR V5, V10, V5 - VXOR V6, V11, V6 - VXOR V7, V8, V7 - VXOR V4, V9, V4 - - VRLW V5, V28, V5 - VRLW V6, V28, V6 - VRLW V7, V28, V7 - VRLW V4, V28, V4 - - VADDUWM V0, V5, V0 - VADDUWM V1, V6, V1 - VADDUWM V2, V7, V2 - VADDUWM V3, V4, V3 - - VXOR V15, V0, V15 - VXOR V12, V1, V12 - VXOR V13, V2, V13 - VXOR V14, V3, V14 - - VRLW V15, V29, V15 - VRLW V12, V29, V12 - VRLW V13, V29, V13 - VRLW V14, V29, V14 - - VADDUWM V10, V15, V10 - VADDUWM V11, V12, V11 - VADDUWM V8, V13, V8 - VADDUWM V9, V14, V9 - - VXOR V5, V10, V5 - VXOR V6, V11, V6 - VXOR V7, V8, V7 - VXOR V4, V9, V4 - - VRLW V5, V30, V5 - VRLW V6, V30, V6 - VRLW V7, V30, V7 - VRLW V4, V30, V4 - BC 16, LT, loop_vsx - - VADDUWM V12, V26, V12 - - WORD $0x13600F8C // VMRGEW V0, V1, V27 - WORD $0x13821F8C // VMRGEW V2, V3, V28 - - WORD $0x10000E8C // VMRGOW V0, V1, V0 - WORD $0x10421E8C // VMRGOW V2, V3, V2 - - WORD $0x13A42F8C // VMRGEW V4, V5, V29 - WORD $0x13C63F8C // VMRGEW V6, V7, V30 - - XXPERMDI VS32, VS34, $0, VS33 - XXPERMDI VS32, VS34, $3, VS35 - XXPERMDI VS59, VS60, $0, VS32 - XXPERMDI VS59, VS60, $3, VS34 - - WORD $0x10842E8C // VMRGOW V4, V5, V4 - WORD $0x10C63E8C // VMRGOW V6, V7, V6 - - WORD $0x13684F8C // VMRGEW V8, V9, V27 - WORD $0x138A5F8C // VMRGEW V10, V11, V28 - - XXPERMDI VS36, VS38, $0, VS37 - XXPERMDI VS36, VS38, $3, VS39 - XXPERMDI VS61, VS62, $0, VS36 - XXPERMDI VS61, VS62, $3, VS38 - - WORD $0x11084E8C // VMRGOW V8, V9, V8 - WORD $0x114A5E8C // VMRGOW V10, V11, V10 - - WORD $0x13AC6F8C // VMRGEW V12, V13, V29 - WORD $0x13CE7F8C // VMRGEW V14, V15, V30 - - XXPERMDI VS40, VS42, $0, VS41 - XXPERMDI VS40, VS42, $3, VS43 - XXPERMDI VS59, VS60, $0, VS40 - XXPERMDI VS59, VS60, $3, VS42 - - WORD $0x118C6E8C // VMRGOW V12, V13, V12 - WORD $0x11CE7E8C // VMRGOW V14, V15, V14 - - VSPLTISW $4, V27 - VADDUWM V26, V27, V26 - - XXPERMDI VS44, VS46, $0, VS45 - XXPERMDI VS44, VS46, $3, VS47 - XXPERMDI VS61, VS62, $0, VS44 - XXPERMDI VS61, VS62, $3, VS46 - - VADDUWM V0, V16, V0 - VADDUWM V4, V17, V4 - VADDUWM V8, V18, V8 - VADDUWM V12, V19, V12 - - CMPU LEN, $64 - BLT tail_vsx - - // Bottom of loop - LXVW4X (INP)(R0), VS59 - LXVW4X (INP)(R8), VS60 - LXVW4X (INP)(R9), VS61 - LXVW4X (INP)(R10), VS62 - - VXOR V27, V0, V27 - VXOR V28, V4, V28 - VXOR V29, V8, V29 - VXOR V30, V12, V30 - - STXVW4X VS59, (OUT)(R0) - STXVW4X VS60, (OUT)(R8) - ADD $64, INP - STXVW4X VS61, (OUT)(R9) - ADD $-64, LEN - STXVW4X VS62, (OUT)(R10) - ADD $64, OUT - BEQ done_vsx - - VADDUWM V1, V16, V0 - VADDUWM V5, V17, V4 - VADDUWM V9, V18, V8 - VADDUWM V13, V19, V12 - - CMPU LEN, $64 - BLT tail_vsx - - LXVW4X (INP)(R0), VS59 - LXVW4X (INP)(R8), VS60 - LXVW4X (INP)(R9), VS61 - LXVW4X (INP)(R10), VS62 - VXOR V27, V0, V27 - - VXOR V28, V4, V28 - VXOR V29, V8, V29 - VXOR V30, V12, V30 - - STXVW4X VS59, (OUT)(R0) - STXVW4X VS60, (OUT)(R8) - ADD $64, INP - STXVW4X VS61, (OUT)(R9) - ADD $-64, LEN - STXVW4X VS62, (OUT)(V10) - ADD $64, OUT - BEQ done_vsx - - VADDUWM V2, V16, V0 - VADDUWM V6, V17, V4 - VADDUWM V10, V18, V8 - VADDUWM V14, V19, V12 - - CMPU LEN, $64 - BLT tail_vsx - - LXVW4X (INP)(R0), VS59 - LXVW4X (INP)(R8), VS60 - LXVW4X (INP)(R9), VS61 - LXVW4X (INP)(R10), VS62 - - VXOR V27, V0, V27 - VXOR V28, V4, V28 - VXOR V29, V8, V29 - VXOR V30, V12, V30 - - STXVW4X VS59, (OUT)(R0) - STXVW4X VS60, (OUT)(R8) - ADD $64, INP - STXVW4X VS61, (OUT)(R9) - ADD $-64, LEN - STXVW4X VS62, (OUT)(R10) - ADD $64, OUT - BEQ done_vsx - - VADDUWM V3, V16, V0 - VADDUWM V7, V17, V4 - VADDUWM V11, V18, V8 - VADDUWM V15, V19, V12 - - CMPU LEN, $64 - BLT tail_vsx - - LXVW4X (INP)(R0), VS59 - LXVW4X (INP)(R8), VS60 - LXVW4X (INP)(R9), VS61 - LXVW4X (INP)(R10), VS62 - - VXOR V27, V0, V27 - VXOR V28, V4, V28 - VXOR V29, V8, V29 - VXOR V30, V12, V30 - - STXVW4X VS59, (OUT)(R0) - STXVW4X VS60, (OUT)(R8) - ADD $64, INP - STXVW4X VS61, (OUT)(R9) - ADD $-64, LEN - STXVW4X VS62, (OUT)(R10) - ADD $64, OUT - - MOVD $10, R14 - MOVD R14, CTR - BNE loop_outer_vsx - -done_vsx: - // Increment counter by number of 64 byte blocks - MOVD (CNT), R14 - ADD BLOCKS, R14 - MOVD R14, (CNT) - RET - -tail_vsx: - ADD $32, R1, R11 - MOVD LEN, CTR - - // Save values on stack to copy from - STXVW4X VS32, (R11)(R0) - STXVW4X VS36, (R11)(R8) - STXVW4X VS40, (R11)(R9) - STXVW4X VS44, (R11)(R10) - ADD $-1, R11, R12 - ADD $-1, INP - ADD $-1, OUT - -looptail_vsx: - // Copying the result to OUT - // in bytes. - MOVBZU 1(R12), KEY - MOVBZU 1(INP), TMP - XOR KEY, TMP, KEY - MOVBU KEY, 1(OUT) - BC 16, LT, looptail_vsx - - // Clear the stack values - STXVW4X VS48, (R11)(R0) - STXVW4X VS48, (R11)(R8) - STXVW4X VS48, (R11)(R9) - STXVW4X VS48, (R11)(R10) - BR done_vsx diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go deleted file mode 100644 index 4652247b8a63..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_s390x.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build gc && !purego -// +build gc,!purego - -package chacha20 - -import "golang.org/x/sys/cpu" - -var haveAsm = cpu.S390X.HasVX - -const bufSize = 256 - -// xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only -// be called when the vector facility is available. Implementation in asm_s390x.s. -// -//go:noescape -func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) - -func (c *Cipher) xorKeyStreamBlocks(dst, src []byte) { - if cpu.S390X.HasVX { - xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) - } else { - c.xorKeyStreamBlocksGeneric(dst, src) - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_s390x.s b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_s390x.s deleted file mode 100644 index f3ef5a019d95..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/chacha_s390x.s +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build gc && !purego -// +build gc,!purego - -#include "go_asm.h" -#include "textflag.h" - -// This is an implementation of the ChaCha20 encryption algorithm as -// specified in RFC 7539. It uses vector instructions to compute -// 4 keystream blocks in parallel (256 bytes) which are then XORed -// with the bytes in the input slice. - -GLOBL ·constants<>(SB), RODATA|NOPTR, $32 -// BSWAP: swap bytes in each 4-byte element -DATA ·constants<>+0x00(SB)/4, $0x03020100 -DATA ·constants<>+0x04(SB)/4, $0x07060504 -DATA ·constants<>+0x08(SB)/4, $0x0b0a0908 -DATA ·constants<>+0x0c(SB)/4, $0x0f0e0d0c -// J0: [j0, j1, j2, j3] -DATA ·constants<>+0x10(SB)/4, $0x61707865 -DATA ·constants<>+0x14(SB)/4, $0x3320646e -DATA ·constants<>+0x18(SB)/4, $0x79622d32 -DATA ·constants<>+0x1c(SB)/4, $0x6b206574 - -#define BSWAP V5 -#define J0 V6 -#define KEY0 V7 -#define KEY1 V8 -#define NONCE V9 -#define CTR V10 -#define M0 V11 -#define M1 V12 -#define M2 V13 -#define M3 V14 -#define INC V15 -#define X0 V16 -#define X1 V17 -#define X2 V18 -#define X3 V19 -#define X4 V20 -#define X5 V21 -#define X6 V22 -#define X7 V23 -#define X8 V24 -#define X9 V25 -#define X10 V26 -#define X11 V27 -#define X12 V28 -#define X13 V29 -#define X14 V30 -#define X15 V31 - -#define NUM_ROUNDS 20 - -#define ROUND4(a0, a1, a2, a3, b0, b1, b2, b3, c0, c1, c2, c3, d0, d1, d2, d3) \ - VAF a1, a0, a0 \ - VAF b1, b0, b0 \ - VAF c1, c0, c0 \ - VAF d1, d0, d0 \ - VX a0, a2, a2 \ - VX b0, b2, b2 \ - VX c0, c2, c2 \ - VX d0, d2, d2 \ - VERLLF $16, a2, a2 \ - VERLLF $16, b2, b2 \ - VERLLF $16, c2, c2 \ - VERLLF $16, d2, d2 \ - VAF a2, a3, a3 \ - VAF b2, b3, b3 \ - VAF c2, c3, c3 \ - VAF d2, d3, d3 \ - VX a3, a1, a1 \ - VX b3, b1, b1 \ - VX c3, c1, c1 \ - VX d3, d1, d1 \ - VERLLF $12, a1, a1 \ - VERLLF $12, b1, b1 \ - VERLLF $12, c1, c1 \ - VERLLF $12, d1, d1 \ - VAF a1, a0, a0 \ - VAF b1, b0, b0 \ - VAF c1, c0, c0 \ - VAF d1, d0, d0 \ - VX a0, a2, a2 \ - VX b0, b2, b2 \ - VX c0, c2, c2 \ - VX d0, d2, d2 \ - VERLLF $8, a2, a2 \ - VERLLF $8, b2, b2 \ - VERLLF $8, c2, c2 \ - VERLLF $8, d2, d2 \ - VAF a2, a3, a3 \ - VAF b2, b3, b3 \ - VAF c2, c3, c3 \ - VAF d2, d3, d3 \ - VX a3, a1, a1 \ - VX b3, b1, b1 \ - VX c3, c1, c1 \ - VX d3, d1, d1 \ - VERLLF $7, a1, a1 \ - VERLLF $7, b1, b1 \ - VERLLF $7, c1, c1 \ - VERLLF $7, d1, d1 - -#define PERMUTE(mask, v0, v1, v2, v3) \ - VPERM v0, v0, mask, v0 \ - VPERM v1, v1, mask, v1 \ - VPERM v2, v2, mask, v2 \ - VPERM v3, v3, mask, v3 - -#define ADDV(x, v0, v1, v2, v3) \ - VAF x, v0, v0 \ - VAF x, v1, v1 \ - VAF x, v2, v2 \ - VAF x, v3, v3 - -#define XORV(off, dst, src, v0, v1, v2, v3) \ - VLM off(src), M0, M3 \ - PERMUTE(BSWAP, v0, v1, v2, v3) \ - VX v0, M0, M0 \ - VX v1, M1, M1 \ - VX v2, M2, M2 \ - VX v3, M3, M3 \ - VSTM M0, M3, off(dst) - -#define SHUFFLE(a, b, c, d, t, u, v, w) \ - VMRHF a, c, t \ // t = {a[0], c[0], a[1], c[1]} - VMRHF b, d, u \ // u = {b[0], d[0], b[1], d[1]} - VMRLF a, c, v \ // v = {a[2], c[2], a[3], c[3]} - VMRLF b, d, w \ // w = {b[2], d[2], b[3], d[3]} - VMRHF t, u, a \ // a = {a[0], b[0], c[0], d[0]} - VMRLF t, u, b \ // b = {a[1], b[1], c[1], d[1]} - VMRHF v, w, c \ // c = {a[2], b[2], c[2], d[2]} - VMRLF v, w, d // d = {a[3], b[3], c[3], d[3]} - -// func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) -TEXT ·xorKeyStreamVX(SB), NOSPLIT, $0 - MOVD $·constants<>(SB), R1 - MOVD dst+0(FP), R2 // R2=&dst[0] - LMG src+24(FP), R3, R4 // R3=&src[0] R4=len(src) - MOVD key+48(FP), R5 // R5=key - MOVD nonce+56(FP), R6 // R6=nonce - MOVD counter+64(FP), R7 // R7=counter - - // load BSWAP and J0 - VLM (R1), BSWAP, J0 - - // setup - MOVD $95, R0 - VLM (R5), KEY0, KEY1 - VLL R0, (R6), NONCE - VZERO M0 - VLEIB $7, $32, M0 - VSRLB M0, NONCE, NONCE - - // initialize counter values - VLREPF (R7), CTR - VZERO INC - VLEIF $1, $1, INC - VLEIF $2, $2, INC - VLEIF $3, $3, INC - VAF INC, CTR, CTR - VREPIF $4, INC - -chacha: - VREPF $0, J0, X0 - VREPF $1, J0, X1 - VREPF $2, J0, X2 - VREPF $3, J0, X3 - VREPF $0, KEY0, X4 - VREPF $1, KEY0, X5 - VREPF $2, KEY0, X6 - VREPF $3, KEY0, X7 - VREPF $0, KEY1, X8 - VREPF $1, KEY1, X9 - VREPF $2, KEY1, X10 - VREPF $3, KEY1, X11 - VLR CTR, X12 - VREPF $1, NONCE, X13 - VREPF $2, NONCE, X14 - VREPF $3, NONCE, X15 - - MOVD $(NUM_ROUNDS/2), R1 - -loop: - ROUND4(X0, X4, X12, X8, X1, X5, X13, X9, X2, X6, X14, X10, X3, X7, X15, X11) - ROUND4(X0, X5, X15, X10, X1, X6, X12, X11, X2, X7, X13, X8, X3, X4, X14, X9) - - ADD $-1, R1 - BNE loop - - // decrement length - ADD $-256, R4 - - // rearrange vectors - SHUFFLE(X0, X1, X2, X3, M0, M1, M2, M3) - ADDV(J0, X0, X1, X2, X3) - SHUFFLE(X4, X5, X6, X7, M0, M1, M2, M3) - ADDV(KEY0, X4, X5, X6, X7) - SHUFFLE(X8, X9, X10, X11, M0, M1, M2, M3) - ADDV(KEY1, X8, X9, X10, X11) - VAF CTR, X12, X12 - SHUFFLE(X12, X13, X14, X15, M0, M1, M2, M3) - ADDV(NONCE, X12, X13, X14, X15) - - // increment counters - VAF INC, CTR, CTR - - // xor keystream with plaintext - XORV(0*64, R2, R3, X0, X4, X8, X12) - XORV(1*64, R2, R3, X1, X5, X9, X13) - XORV(2*64, R2, R3, X2, X6, X10, X14) - XORV(3*64, R2, R3, X3, X7, X11, X15) - - // increment pointers - MOVD $256(R2), R2 - MOVD $256(R3), R3 - - CMPBNE R4, $0, chacha - - VSTEF $0, CTR, (R7) - RET diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/xor.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/xor.go deleted file mode 100644 index c2d04851e0d1..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20/xor.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found src the LICENSE file. - -package chacha20 - -import "runtime" - -// Platforms that have fast unaligned 32-bit little endian accesses. -const unaligned = runtime.GOARCH == "386" || - runtime.GOARCH == "amd64" || - runtime.GOARCH == "arm64" || - runtime.GOARCH == "ppc64le" || - runtime.GOARCH == "s390x" - -// addXor reads a little endian uint32 from src, XORs it with (a + b) and -// places the result in little endian byte order in dst. -func addXor(dst, src []byte, a, b uint32) { - _, _ = src[3], dst[3] // bounds check elimination hint - if unaligned { - // The compiler should optimize this code into - // 32-bit unaligned little endian loads and stores. - // TODO: delete once the compiler does a reliably - // good job with the generic code below. - // See issue #25111 for more details. - v := uint32(src[0]) - v |= uint32(src[1]) << 8 - v |= uint32(src[2]) << 16 - v |= uint32(src[3]) << 24 - v ^= a + b - dst[0] = byte(v) - dst[1] = byte(v >> 8) - dst[2] = byte(v >> 16) - dst[3] = byte(v >> 24) - } else { - a += b - dst[0] = src[0] ^ byte(a) - dst[1] = src[1] ^ byte(a>>8) - dst[2] = src[2] ^ byte(a>>16) - dst[3] = src[3] ^ byte(a>>24) - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go deleted file mode 100644 index 93da7322bc48..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package chacha20poly1305 implements the ChaCha20-Poly1305 AEAD and its -// extended nonce variant XChaCha20-Poly1305, as specified in RFC 8439 and -// draft-irtf-cfrg-xchacha-01. -package chacha20poly1305 // import "golang.org/x/crypto/chacha20poly1305" - -import ( - "crypto/cipher" - "errors" -) - -const ( - // KeySize is the size of the key used by this AEAD, in bytes. - KeySize = 32 - - // NonceSize is the size of the nonce used with the standard variant of this - // AEAD, in bytes. - // - // Note that this is too short to be safely generated at random if the same - // key is reused more than 2³² times. - NonceSize = 12 - - // NonceSizeX is the size of the nonce used with the XChaCha20-Poly1305 - // variant of this AEAD, in bytes. - NonceSizeX = 24 - - // Overhead is the size of the Poly1305 authentication tag, and the - // difference between a ciphertext length and its plaintext. - Overhead = 16 -) - -type chacha20poly1305 struct { - key [KeySize]byte -} - -// New returns a ChaCha20-Poly1305 AEAD that uses the given 256-bit key. -func New(key []byte) (cipher.AEAD, error) { - if len(key) != KeySize { - return nil, errors.New("chacha20poly1305: bad key length") - } - ret := new(chacha20poly1305) - copy(ret.key[:], key) - return ret, nil -} - -func (c *chacha20poly1305) NonceSize() int { - return NonceSize -} - -func (c *chacha20poly1305) Overhead() int { - return Overhead -} - -func (c *chacha20poly1305) Seal(dst, nonce, plaintext, additionalData []byte) []byte { - if len(nonce) != NonceSize { - panic("chacha20poly1305: bad nonce length passed to Seal") - } - - if uint64(len(plaintext)) > (1<<38)-64 { - panic("chacha20poly1305: plaintext too large") - } - - return c.seal(dst, nonce, plaintext, additionalData) -} - -var errOpen = errors.New("chacha20poly1305: message authentication failed") - -func (c *chacha20poly1305) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { - if len(nonce) != NonceSize { - panic("chacha20poly1305: bad nonce length passed to Open") - } - if len(ciphertext) < 16 { - return nil, errOpen - } - if uint64(len(ciphertext)) > (1<<38)-48 { - panic("chacha20poly1305: ciphertext too large") - } - - return c.open(dst, nonce, ciphertext, additionalData) -} - -// sliceForAppend takes a slice and a requested number of bytes. It returns a -// slice with the contents of the given slice followed by that many bytes and a -// second slice that aliases into it and contains only the extra bytes. If the -// original slice has sufficient capacity then no allocation is performed. -func sliceForAppend(in []byte, n int) (head, tail []byte) { - if total := len(in) + n; cap(in) >= total { - head = in[:total] - } else { - head = make([]byte, total) - copy(head, in) - } - tail = head[len(in):] - return -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go deleted file mode 100644 index 0c408c57094c..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build gc && !purego -// +build gc,!purego - -package chacha20poly1305 - -import ( - "encoding/binary" - - "golang.org/x/crypto/internal/alias" - "golang.org/x/sys/cpu" -) - -//go:noescape -func chacha20Poly1305Open(dst []byte, key []uint32, src, ad []byte) bool - -//go:noescape -func chacha20Poly1305Seal(dst []byte, key []uint32, src, ad []byte) - -var ( - useAVX2 = cpu.X86.HasAVX2 && cpu.X86.HasBMI2 -) - -// setupState writes a ChaCha20 input matrix to state. See -// https://tools.ietf.org/html/rfc7539#section-2.3. -func setupState(state *[16]uint32, key *[32]byte, nonce []byte) { - state[0] = 0x61707865 - state[1] = 0x3320646e - state[2] = 0x79622d32 - state[3] = 0x6b206574 - - state[4] = binary.LittleEndian.Uint32(key[0:4]) - state[5] = binary.LittleEndian.Uint32(key[4:8]) - state[6] = binary.LittleEndian.Uint32(key[8:12]) - state[7] = binary.LittleEndian.Uint32(key[12:16]) - state[8] = binary.LittleEndian.Uint32(key[16:20]) - state[9] = binary.LittleEndian.Uint32(key[20:24]) - state[10] = binary.LittleEndian.Uint32(key[24:28]) - state[11] = binary.LittleEndian.Uint32(key[28:32]) - - state[12] = 0 - state[13] = binary.LittleEndian.Uint32(nonce[0:4]) - state[14] = binary.LittleEndian.Uint32(nonce[4:8]) - state[15] = binary.LittleEndian.Uint32(nonce[8:12]) -} - -func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { - if !cpu.X86.HasSSSE3 { - return c.sealGeneric(dst, nonce, plaintext, additionalData) - } - - var state [16]uint32 - setupState(&state, &c.key, nonce) - - ret, out := sliceForAppend(dst, len(plaintext)+16) - if alias.InexactOverlap(out, plaintext) { - panic("chacha20poly1305: invalid buffer overlap") - } - chacha20Poly1305Seal(out[:], state[:], plaintext, additionalData) - return ret -} - -func (c *chacha20poly1305) open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { - if !cpu.X86.HasSSSE3 { - return c.openGeneric(dst, nonce, ciphertext, additionalData) - } - - var state [16]uint32 - setupState(&state, &c.key, nonce) - - ciphertext = ciphertext[:len(ciphertext)-16] - ret, out := sliceForAppend(dst, len(ciphertext)) - if alias.InexactOverlap(out, ciphertext) { - panic("chacha20poly1305: invalid buffer overlap") - } - if !chacha20Poly1305Open(out, state[:], ciphertext, additionalData) { - for i := range out { - out[i] = 0 - } - return nil, errOpen - } - - return ret, nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s deleted file mode 100644 index 867c181a14c0..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s +++ /dev/null @@ -1,2696 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file was originally from https://golang.org/cl/24717 by Vlad Krasnov of CloudFlare. - -//go:build gc && !purego -// +build gc,!purego - -#include "textflag.h" -// General register allocation -#define oup DI -#define inp SI -#define inl BX -#define adp CX // free to reuse, after we hash the additional data -#define keyp R8 // free to reuse, when we copy the key to stack -#define itr2 R9 // general iterator -#define itr1 CX // general iterator -#define acc0 R10 -#define acc1 R11 -#define acc2 R12 -#define t0 R13 -#define t1 R14 -#define t2 R15 -#define t3 R8 -// Register and stack allocation for the SSE code -#define rStore (0*16)(BP) -#define sStore (1*16)(BP) -#define state1Store (2*16)(BP) -#define state2Store (3*16)(BP) -#define tmpStore (4*16)(BP) -#define ctr0Store (5*16)(BP) -#define ctr1Store (6*16)(BP) -#define ctr2Store (7*16)(BP) -#define ctr3Store (8*16)(BP) -#define A0 X0 -#define A1 X1 -#define A2 X2 -#define B0 X3 -#define B1 X4 -#define B2 X5 -#define C0 X6 -#define C1 X7 -#define C2 X8 -#define D0 X9 -#define D1 X10 -#define D2 X11 -#define T0 X12 -#define T1 X13 -#define T2 X14 -#define T3 X15 -#define A3 T0 -#define B3 T1 -#define C3 T2 -#define D3 T3 -// Register and stack allocation for the AVX2 code -#define rsStoreAVX2 (0*32)(BP) -#define state1StoreAVX2 (1*32)(BP) -#define state2StoreAVX2 (2*32)(BP) -#define ctr0StoreAVX2 (3*32)(BP) -#define ctr1StoreAVX2 (4*32)(BP) -#define ctr2StoreAVX2 (5*32)(BP) -#define ctr3StoreAVX2 (6*32)(BP) -#define tmpStoreAVX2 (7*32)(BP) // 256 bytes on stack -#define AA0 Y0 -#define AA1 Y5 -#define AA2 Y6 -#define AA3 Y7 -#define BB0 Y14 -#define BB1 Y9 -#define BB2 Y10 -#define BB3 Y11 -#define CC0 Y12 -#define CC1 Y13 -#define CC2 Y8 -#define CC3 Y15 -#define DD0 Y4 -#define DD1 Y1 -#define DD2 Y2 -#define DD3 Y3 -#define TT0 DD3 -#define TT1 AA3 -#define TT2 BB3 -#define TT3 CC3 -// ChaCha20 constants -DATA ·chacha20Constants<>+0x00(SB)/4, $0x61707865 -DATA ·chacha20Constants<>+0x04(SB)/4, $0x3320646e -DATA ·chacha20Constants<>+0x08(SB)/4, $0x79622d32 -DATA ·chacha20Constants<>+0x0c(SB)/4, $0x6b206574 -DATA ·chacha20Constants<>+0x10(SB)/4, $0x61707865 -DATA ·chacha20Constants<>+0x14(SB)/4, $0x3320646e -DATA ·chacha20Constants<>+0x18(SB)/4, $0x79622d32 -DATA ·chacha20Constants<>+0x1c(SB)/4, $0x6b206574 -// <<< 16 with PSHUFB -DATA ·rol16<>+0x00(SB)/8, $0x0504070601000302 -DATA ·rol16<>+0x08(SB)/8, $0x0D0C0F0E09080B0A -DATA ·rol16<>+0x10(SB)/8, $0x0504070601000302 -DATA ·rol16<>+0x18(SB)/8, $0x0D0C0F0E09080B0A -// <<< 8 with PSHUFB -DATA ·rol8<>+0x00(SB)/8, $0x0605040702010003 -DATA ·rol8<>+0x08(SB)/8, $0x0E0D0C0F0A09080B -DATA ·rol8<>+0x10(SB)/8, $0x0605040702010003 -DATA ·rol8<>+0x18(SB)/8, $0x0E0D0C0F0A09080B - -DATA ·avx2InitMask<>+0x00(SB)/8, $0x0 -DATA ·avx2InitMask<>+0x08(SB)/8, $0x0 -DATA ·avx2InitMask<>+0x10(SB)/8, $0x1 -DATA ·avx2InitMask<>+0x18(SB)/8, $0x0 - -DATA ·avx2IncMask<>+0x00(SB)/8, $0x2 -DATA ·avx2IncMask<>+0x08(SB)/8, $0x0 -DATA ·avx2IncMask<>+0x10(SB)/8, $0x2 -DATA ·avx2IncMask<>+0x18(SB)/8, $0x0 -// Poly1305 key clamp -DATA ·polyClampMask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF -DATA ·polyClampMask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC -DATA ·polyClampMask<>+0x10(SB)/8, $0xFFFFFFFFFFFFFFFF -DATA ·polyClampMask<>+0x18(SB)/8, $0xFFFFFFFFFFFFFFFF - -DATA ·sseIncMask<>+0x00(SB)/8, $0x1 -DATA ·sseIncMask<>+0x08(SB)/8, $0x0 -// To load/store the last < 16 bytes in a buffer -DATA ·andMask<>+0x00(SB)/8, $0x00000000000000ff -DATA ·andMask<>+0x08(SB)/8, $0x0000000000000000 -DATA ·andMask<>+0x10(SB)/8, $0x000000000000ffff -DATA ·andMask<>+0x18(SB)/8, $0x0000000000000000 -DATA ·andMask<>+0x20(SB)/8, $0x0000000000ffffff -DATA ·andMask<>+0x28(SB)/8, $0x0000000000000000 -DATA ·andMask<>+0x30(SB)/8, $0x00000000ffffffff -DATA ·andMask<>+0x38(SB)/8, $0x0000000000000000 -DATA ·andMask<>+0x40(SB)/8, $0x000000ffffffffff -DATA ·andMask<>+0x48(SB)/8, $0x0000000000000000 -DATA ·andMask<>+0x50(SB)/8, $0x0000ffffffffffff -DATA ·andMask<>+0x58(SB)/8, $0x0000000000000000 -DATA ·andMask<>+0x60(SB)/8, $0x00ffffffffffffff -DATA ·andMask<>+0x68(SB)/8, $0x0000000000000000 -DATA ·andMask<>+0x70(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+0x78(SB)/8, $0x0000000000000000 -DATA ·andMask<>+0x80(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+0x88(SB)/8, $0x00000000000000ff -DATA ·andMask<>+0x90(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+0x98(SB)/8, $0x000000000000ffff -DATA ·andMask<>+0xa0(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+0xa8(SB)/8, $0x0000000000ffffff -DATA ·andMask<>+0xb0(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+0xb8(SB)/8, $0x00000000ffffffff -DATA ·andMask<>+0xc0(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+0xc8(SB)/8, $0x000000ffffffffff -DATA ·andMask<>+0xd0(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+0xd8(SB)/8, $0x0000ffffffffffff -DATA ·andMask<>+0xe0(SB)/8, $0xffffffffffffffff -DATA ·andMask<>+0xe8(SB)/8, $0x00ffffffffffffff - -GLOBL ·chacha20Constants<>(SB), (NOPTR+RODATA), $32 -GLOBL ·rol16<>(SB), (NOPTR+RODATA), $32 -GLOBL ·rol8<>(SB), (NOPTR+RODATA), $32 -GLOBL ·sseIncMask<>(SB), (NOPTR+RODATA), $16 -GLOBL ·avx2IncMask<>(SB), (NOPTR+RODATA), $32 -GLOBL ·avx2InitMask<>(SB), (NOPTR+RODATA), $32 -GLOBL ·polyClampMask<>(SB), (NOPTR+RODATA), $32 -GLOBL ·andMask<>(SB), (NOPTR+RODATA), $240 -// No PALIGNR in Go ASM yet (but VPALIGNR is present). -#define shiftB0Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x04 // PALIGNR $4, X3, X3 -#define shiftB1Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xe4; BYTE $0x04 // PALIGNR $4, X4, X4 -#define shiftB2Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x04 // PALIGNR $4, X5, X5 -#define shiftB3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x04 // PALIGNR $4, X13, X13 -#define shiftC0Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xf6; BYTE $0x08 // PALIGNR $8, X6, X6 -#define shiftC1Left BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x08 // PALIGNR $8, X7, X7 -#define shiftC2Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc0; BYTE $0x08 // PALIGNR $8, X8, X8 -#define shiftC3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xf6; BYTE $0x08 // PALIGNR $8, X14, X14 -#define shiftD0Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc9; BYTE $0x0c // PALIGNR $12, X9, X9 -#define shiftD1Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xd2; BYTE $0x0c // PALIGNR $12, X10, X10 -#define shiftD2Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x0c // PALIGNR $12, X11, X11 -#define shiftD3Left BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x0c // PALIGNR $12, X15, X15 -#define shiftB0Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x0c // PALIGNR $12, X3, X3 -#define shiftB1Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xe4; BYTE $0x0c // PALIGNR $12, X4, X4 -#define shiftB2Right BYTE $0x66; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x0c // PALIGNR $12, X5, X5 -#define shiftB3Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xed; BYTE $0x0c // PALIGNR $12, X13, X13 -#define shiftC0Right shiftC0Left -#define shiftC1Right shiftC1Left -#define shiftC2Right shiftC2Left -#define shiftC3Right shiftC3Left -#define shiftD0Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xc9; BYTE $0x04 // PALIGNR $4, X9, X9 -#define shiftD1Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xd2; BYTE $0x04 // PALIGNR $4, X10, X10 -#define shiftD2Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xdb; BYTE $0x04 // PALIGNR $4, X11, X11 -#define shiftD3Right BYTE $0x66; BYTE $0x45; BYTE $0x0f; BYTE $0x3a; BYTE $0x0f; BYTE $0xff; BYTE $0x04 // PALIGNR $4, X15, X15 -// Some macros -#define chachaQR(A, B, C, D, T) \ - PADDD B, A; PXOR A, D; PSHUFB ·rol16<>(SB), D \ - PADDD D, C; PXOR C, B; MOVO B, T; PSLLL $12, T; PSRLL $20, B; PXOR T, B \ - PADDD B, A; PXOR A, D; PSHUFB ·rol8<>(SB), D \ - PADDD D, C; PXOR C, B; MOVO B, T; PSLLL $7, T; PSRLL $25, B; PXOR T, B - -#define chachaQR_AVX2(A, B, C, D, T) \ - VPADDD B, A, A; VPXOR A, D, D; VPSHUFB ·rol16<>(SB), D, D \ - VPADDD D, C, C; VPXOR C, B, B; VPSLLD $12, B, T; VPSRLD $20, B, B; VPXOR T, B, B \ - VPADDD B, A, A; VPXOR A, D, D; VPSHUFB ·rol8<>(SB), D, D \ - VPADDD D, C, C; VPXOR C, B, B; VPSLLD $7, B, T; VPSRLD $25, B, B; VPXOR T, B, B - -#define polyAdd(S) ADDQ S, acc0; ADCQ 8+S, acc1; ADCQ $1, acc2 -#define polyMulStage1 MOVQ (0*8)(BP), AX; MOVQ AX, t2; MULQ acc0; MOVQ AX, t0; MOVQ DX, t1; MOVQ (0*8)(BP), AX; MULQ acc1; IMULQ acc2, t2; ADDQ AX, t1; ADCQ DX, t2 -#define polyMulStage2 MOVQ (1*8)(BP), AX; MOVQ AX, t3; MULQ acc0; ADDQ AX, t1; ADCQ $0, DX; MOVQ DX, acc0; MOVQ (1*8)(BP), AX; MULQ acc1; ADDQ AX, t2; ADCQ $0, DX -#define polyMulStage3 IMULQ acc2, t3; ADDQ acc0, t2; ADCQ DX, t3 -#define polyMulReduceStage MOVQ t0, acc0; MOVQ t1, acc1; MOVQ t2, acc2; ANDQ $3, acc2; MOVQ t2, t0; ANDQ $-4, t0; MOVQ t3, t1; SHRQ $2, t3, t2; SHRQ $2, t3; ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $0, acc2; ADDQ t2, acc0; ADCQ t3, acc1; ADCQ $0, acc2 - -#define polyMulStage1_AVX2 MOVQ (0*8)(BP), DX; MOVQ DX, t2; MULXQ acc0, t0, t1; IMULQ acc2, t2; MULXQ acc1, AX, DX; ADDQ AX, t1; ADCQ DX, t2 -#define polyMulStage2_AVX2 MOVQ (1*8)(BP), DX; MULXQ acc0, acc0, AX; ADDQ acc0, t1; MULXQ acc1, acc1, t3; ADCQ acc1, t2; ADCQ $0, t3 -#define polyMulStage3_AVX2 IMULQ acc2, DX; ADDQ AX, t2; ADCQ DX, t3 - -#define polyMul polyMulStage1; polyMulStage2; polyMulStage3; polyMulReduceStage -#define polyMulAVX2 polyMulStage1_AVX2; polyMulStage2_AVX2; polyMulStage3_AVX2; polyMulReduceStage -// ---------------------------------------------------------------------------- -TEXT polyHashADInternal<>(SB), NOSPLIT, $0 - // adp points to beginning of additional data - // itr2 holds ad length - XORQ acc0, acc0 - XORQ acc1, acc1 - XORQ acc2, acc2 - CMPQ itr2, $13 - JNE hashADLoop - -openFastTLSAD: - // Special treatment for the TLS case of 13 bytes - MOVQ (adp), acc0 - MOVQ 5(adp), acc1 - SHRQ $24, acc1 - MOVQ $1, acc2 - polyMul - RET - -hashADLoop: - // Hash in 16 byte chunks - CMPQ itr2, $16 - JB hashADTail - polyAdd(0(adp)) - LEAQ (1*16)(adp), adp - SUBQ $16, itr2 - polyMul - JMP hashADLoop - -hashADTail: - CMPQ itr2, $0 - JE hashADDone - - // Hash last < 16 byte tail - XORQ t0, t0 - XORQ t1, t1 - XORQ t2, t2 - ADDQ itr2, adp - -hashADTailLoop: - SHLQ $8, t0, t1 - SHLQ $8, t0 - MOVB -1(adp), t2 - XORQ t2, t0 - DECQ adp - DECQ itr2 - JNE hashADTailLoop - -hashADTailFinish: - ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2 - polyMul - - // Finished AD -hashADDone: - RET - -// ---------------------------------------------------------------------------- -// func chacha20Poly1305Open(dst, key, src, ad []byte) bool -TEXT ·chacha20Poly1305Open(SB), 0, $288-97 - // For aligned stack access - MOVQ SP, BP - ADDQ $32, BP - ANDQ $-32, BP - MOVQ dst+0(FP), oup - MOVQ key+24(FP), keyp - MOVQ src+48(FP), inp - MOVQ src_len+56(FP), inl - MOVQ ad+72(FP), adp - - // Check for AVX2 support - CMPB ·useAVX2(SB), $1 - JE chacha20Poly1305Open_AVX2 - - // Special optimization, for very short buffers - CMPQ inl, $128 - JBE openSSE128 // About 16% faster - - // For long buffers, prepare the poly key first - MOVOU ·chacha20Constants<>(SB), A0 - MOVOU (1*16)(keyp), B0 - MOVOU (2*16)(keyp), C0 - MOVOU (3*16)(keyp), D0 - MOVO D0, T1 - - // Store state on stack for future use - MOVO B0, state1Store - MOVO C0, state2Store - MOVO D0, ctr3Store - MOVQ $10, itr2 - -openSSEPreparePolyKey: - chachaQR(A0, B0, C0, D0, T0) - shiftB0Left; shiftC0Left; shiftD0Left - chachaQR(A0, B0, C0, D0, T0) - shiftB0Right; shiftC0Right; shiftD0Right - DECQ itr2 - JNE openSSEPreparePolyKey - - // A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded - PADDL ·chacha20Constants<>(SB), A0; PADDL state1Store, B0 - - // Clamp and store the key - PAND ·polyClampMask<>(SB), A0 - MOVO A0, rStore; MOVO B0, sStore - - // Hash AAD - MOVQ ad_len+80(FP), itr2 - CALL polyHashADInternal<>(SB) - -openSSEMainLoop: - CMPQ inl, $256 - JB openSSEMainLoopDone - - // Load state, increment counter blocks - MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0 - MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 - MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 - MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3 - - // Store counters - MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store - - // There are 10 ChaCha20 iterations of 2QR each, so for 6 iterations we hash 2 blocks, and for the remaining 4 only 1 block - for a total of 16 - MOVQ $4, itr1 - MOVQ inp, itr2 - -openSSEInternalLoop: - MOVO C3, tmpStore - chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) - MOVO tmpStore, C3 - MOVO C1, tmpStore - chachaQR(A3, B3, C3, D3, C1) - MOVO tmpStore, C1 - polyAdd(0(itr2)) - shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left - shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left - shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left - polyMulStage1 - polyMulStage2 - LEAQ (2*8)(itr2), itr2 - MOVO C3, tmpStore - chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) - MOVO tmpStore, C3 - MOVO C1, tmpStore - polyMulStage3 - chachaQR(A3, B3, C3, D3, C1) - MOVO tmpStore, C1 - polyMulReduceStage - shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right - shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right - shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right - DECQ itr1 - JGE openSSEInternalLoop - - polyAdd(0(itr2)) - polyMul - LEAQ (2*8)(itr2), itr2 - - CMPQ itr1, $-6 - JG openSSEInternalLoop - - // Add in the state - PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3 - PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3 - PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3 - PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3 - - // Load - xor - store - MOVO D3, tmpStore - MOVOU (0*16)(inp), D3; PXOR D3, A0; MOVOU A0, (0*16)(oup) - MOVOU (1*16)(inp), D3; PXOR D3, B0; MOVOU B0, (1*16)(oup) - MOVOU (2*16)(inp), D3; PXOR D3, C0; MOVOU C0, (2*16)(oup) - MOVOU (3*16)(inp), D3; PXOR D3, D0; MOVOU D0, (3*16)(oup) - MOVOU (4*16)(inp), D0; PXOR D0, A1; MOVOU A1, (4*16)(oup) - MOVOU (5*16)(inp), D0; PXOR D0, B1; MOVOU B1, (5*16)(oup) - MOVOU (6*16)(inp), D0; PXOR D0, C1; MOVOU C1, (6*16)(oup) - MOVOU (7*16)(inp), D0; PXOR D0, D1; MOVOU D1, (7*16)(oup) - MOVOU (8*16)(inp), D0; PXOR D0, A2; MOVOU A2, (8*16)(oup) - MOVOU (9*16)(inp), D0; PXOR D0, B2; MOVOU B2, (9*16)(oup) - MOVOU (10*16)(inp), D0; PXOR D0, C2; MOVOU C2, (10*16)(oup) - MOVOU (11*16)(inp), D0; PXOR D0, D2; MOVOU D2, (11*16)(oup) - MOVOU (12*16)(inp), D0; PXOR D0, A3; MOVOU A3, (12*16)(oup) - MOVOU (13*16)(inp), D0; PXOR D0, B3; MOVOU B3, (13*16)(oup) - MOVOU (14*16)(inp), D0; PXOR D0, C3; MOVOU C3, (14*16)(oup) - MOVOU (15*16)(inp), D0; PXOR tmpStore, D0; MOVOU D0, (15*16)(oup) - LEAQ 256(inp), inp - LEAQ 256(oup), oup - SUBQ $256, inl - JMP openSSEMainLoop - -openSSEMainLoopDone: - // Handle the various tail sizes efficiently - TESTQ inl, inl - JE openSSEFinalize - CMPQ inl, $64 - JBE openSSETail64 - CMPQ inl, $128 - JBE openSSETail128 - CMPQ inl, $192 - JBE openSSETail192 - JMP openSSETail256 - -openSSEFinalize: - // Hash in the PT, AAD lengths - ADDQ ad_len+80(FP), acc0; ADCQ src_len+56(FP), acc1; ADCQ $1, acc2 - polyMul - - // Final reduce - MOVQ acc0, t0 - MOVQ acc1, t1 - MOVQ acc2, t2 - SUBQ $-5, acc0 - SBBQ $-1, acc1 - SBBQ $3, acc2 - CMOVQCS t0, acc0 - CMOVQCS t1, acc1 - CMOVQCS t2, acc2 - - // Add in the "s" part of the key - ADDQ 0+sStore, acc0 - ADCQ 8+sStore, acc1 - - // Finally, constant time compare to the tag at the end of the message - XORQ AX, AX - MOVQ $1, DX - XORQ (0*8)(inp), acc0 - XORQ (1*8)(inp), acc1 - ORQ acc1, acc0 - CMOVQEQ DX, AX - - // Return true iff tags are equal - MOVB AX, ret+96(FP) - RET - -// ---------------------------------------------------------------------------- -// Special optimization for buffers smaller than 129 bytes -openSSE128: - // For up to 128 bytes of ciphertext and 64 bytes for the poly key, we require to process three blocks - MOVOU ·chacha20Constants<>(SB), A0; MOVOU (1*16)(keyp), B0; MOVOU (2*16)(keyp), C0; MOVOU (3*16)(keyp), D0 - MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 - MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 - MOVO B0, T1; MOVO C0, T2; MOVO D1, T3 - MOVQ $10, itr2 - -openSSE128InnerCipherLoop: - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) - shiftB0Left; shiftB1Left; shiftB2Left - shiftC0Left; shiftC1Left; shiftC2Left - shiftD0Left; shiftD1Left; shiftD2Left - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) - shiftB0Right; shiftB1Right; shiftB2Right - shiftC0Right; shiftC1Right; shiftC2Right - shiftD0Right; shiftD1Right; shiftD2Right - DECQ itr2 - JNE openSSE128InnerCipherLoop - - // A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded - PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2 - PADDL T1, B0; PADDL T1, B1; PADDL T1, B2 - PADDL T2, C1; PADDL T2, C2 - PADDL T3, D1; PADDL ·sseIncMask<>(SB), T3; PADDL T3, D2 - - // Clamp and store the key - PAND ·polyClampMask<>(SB), A0 - MOVOU A0, rStore; MOVOU B0, sStore - - // Hash - MOVQ ad_len+80(FP), itr2 - CALL polyHashADInternal<>(SB) - -openSSE128Open: - CMPQ inl, $16 - JB openSSETail16 - SUBQ $16, inl - - // Load for hashing - polyAdd(0(inp)) - - // Load for decryption - MOVOU (inp), T0; PXOR T0, A1; MOVOU A1, (oup) - LEAQ (1*16)(inp), inp - LEAQ (1*16)(oup), oup - polyMul - - // Shift the stream "left" - MOVO B1, A1 - MOVO C1, B1 - MOVO D1, C1 - MOVO A2, D1 - MOVO B2, A2 - MOVO C2, B2 - MOVO D2, C2 - JMP openSSE128Open - -openSSETail16: - TESTQ inl, inl - JE openSSEFinalize - - // We can safely load the CT from the end, because it is padded with the MAC - MOVQ inl, itr2 - SHLQ $4, itr2 - LEAQ ·andMask<>(SB), t0 - MOVOU (inp), T0 - ADDQ inl, inp - PAND -16(t0)(itr2*1), T0 - MOVO T0, 0+tmpStore - MOVQ T0, t0 - MOVQ 8+tmpStore, t1 - PXOR A1, T0 - - // We can only store one byte at a time, since plaintext can be shorter than 16 bytes -openSSETail16Store: - MOVQ T0, t3 - MOVB t3, (oup) - PSRLDQ $1, T0 - INCQ oup - DECQ inl - JNE openSSETail16Store - ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2 - polyMul - JMP openSSEFinalize - -// ---------------------------------------------------------------------------- -// Special optimization for the last 64 bytes of ciphertext -openSSETail64: - // Need to decrypt up to 64 bytes - prepare single block - MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store - XORQ itr2, itr2 - MOVQ inl, itr1 - CMPQ itr1, $16 - JB openSSETail64LoopB - -openSSETail64LoopA: - // Perform ChaCha rounds, while hashing the remaining input - polyAdd(0(inp)(itr2*1)) - polyMul - SUBQ $16, itr1 - -openSSETail64LoopB: - ADDQ $16, itr2 - chachaQR(A0, B0, C0, D0, T0) - shiftB0Left; shiftC0Left; shiftD0Left - chachaQR(A0, B0, C0, D0, T0) - shiftB0Right; shiftC0Right; shiftD0Right - - CMPQ itr1, $16 - JAE openSSETail64LoopA - - CMPQ itr2, $160 - JNE openSSETail64LoopB - - PADDL ·chacha20Constants<>(SB), A0; PADDL state1Store, B0; PADDL state2Store, C0; PADDL ctr0Store, D0 - -openSSETail64DecLoop: - CMPQ inl, $16 - JB openSSETail64DecLoopDone - SUBQ $16, inl - MOVOU (inp), T0 - PXOR T0, A0 - MOVOU A0, (oup) - LEAQ 16(inp), inp - LEAQ 16(oup), oup - MOVO B0, A0 - MOVO C0, B0 - MOVO D0, C0 - JMP openSSETail64DecLoop - -openSSETail64DecLoopDone: - MOVO A0, A1 - JMP openSSETail16 - -// ---------------------------------------------------------------------------- -// Special optimization for the last 128 bytes of ciphertext -openSSETail128: - // Need to decrypt up to 128 bytes - prepare two blocks - MOVO ·chacha20Constants<>(SB), A1; MOVO state1Store, B1; MOVO state2Store, C1; MOVO ctr3Store, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr0Store - MOVO A1, A0; MOVO B1, B0; MOVO C1, C0; MOVO D1, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr1Store - XORQ itr2, itr2 - MOVQ inl, itr1 - ANDQ $-16, itr1 - -openSSETail128LoopA: - // Perform ChaCha rounds, while hashing the remaining input - polyAdd(0(inp)(itr2*1)) - polyMul - -openSSETail128LoopB: - ADDQ $16, itr2 - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0) - shiftB0Left; shiftC0Left; shiftD0Left - shiftB1Left; shiftC1Left; shiftD1Left - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0) - shiftB0Right; shiftC0Right; shiftD0Right - shiftB1Right; shiftC1Right; shiftD1Right - - CMPQ itr2, itr1 - JB openSSETail128LoopA - - CMPQ itr2, $160 - JNE openSSETail128LoopB - - PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1 - PADDL state1Store, B0; PADDL state1Store, B1 - PADDL state2Store, C0; PADDL state2Store, C1 - PADDL ctr1Store, D0; PADDL ctr0Store, D1 - - MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3 - PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1 - MOVOU A1, (0*16)(oup); MOVOU B1, (1*16)(oup); MOVOU C1, (2*16)(oup); MOVOU D1, (3*16)(oup) - - SUBQ $64, inl - LEAQ 64(inp), inp - LEAQ 64(oup), oup - JMP openSSETail64DecLoop - -// ---------------------------------------------------------------------------- -// Special optimization for the last 192 bytes of ciphertext -openSSETail192: - // Need to decrypt up to 192 bytes - prepare three blocks - MOVO ·chacha20Constants<>(SB), A2; MOVO state1Store, B2; MOVO state2Store, C2; MOVO ctr3Store, D2; PADDL ·sseIncMask<>(SB), D2; MOVO D2, ctr0Store - MOVO A2, A1; MOVO B2, B1; MOVO C2, C1; MOVO D2, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store - MOVO A1, A0; MOVO B1, B0; MOVO C1, C0; MOVO D1, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr2Store - - MOVQ inl, itr1 - MOVQ $160, itr2 - CMPQ itr1, $160 - CMOVQGT itr2, itr1 - ANDQ $-16, itr1 - XORQ itr2, itr2 - -openSSLTail192LoopA: - // Perform ChaCha rounds, while hashing the remaining input - polyAdd(0(inp)(itr2*1)) - polyMul - -openSSLTail192LoopB: - ADDQ $16, itr2 - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) - shiftB0Left; shiftC0Left; shiftD0Left - shiftB1Left; shiftC1Left; shiftD1Left - shiftB2Left; shiftC2Left; shiftD2Left - - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) - shiftB0Right; shiftC0Right; shiftD0Right - shiftB1Right; shiftC1Right; shiftD1Right - shiftB2Right; shiftC2Right; shiftD2Right - - CMPQ itr2, itr1 - JB openSSLTail192LoopA - - CMPQ itr2, $160 - JNE openSSLTail192LoopB - - CMPQ inl, $176 - JB openSSLTail192Store - - polyAdd(160(inp)) - polyMul - - CMPQ inl, $192 - JB openSSLTail192Store - - polyAdd(176(inp)) - polyMul - -openSSLTail192Store: - PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2 - PADDL state1Store, B0; PADDL state1Store, B1; PADDL state1Store, B2 - PADDL state2Store, C0; PADDL state2Store, C1; PADDL state2Store, C2 - PADDL ctr2Store, D0; PADDL ctr1Store, D1; PADDL ctr0Store, D2 - - MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3 - PXOR T0, A2; PXOR T1, B2; PXOR T2, C2; PXOR T3, D2 - MOVOU A2, (0*16)(oup); MOVOU B2, (1*16)(oup); MOVOU C2, (2*16)(oup); MOVOU D2, (3*16)(oup) - - MOVOU (4*16)(inp), T0; MOVOU (5*16)(inp), T1; MOVOU (6*16)(inp), T2; MOVOU (7*16)(inp), T3 - PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1 - MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup) - - SUBQ $128, inl - LEAQ 128(inp), inp - LEAQ 128(oup), oup - JMP openSSETail64DecLoop - -// ---------------------------------------------------------------------------- -// Special optimization for the last 256 bytes of ciphertext -openSSETail256: - // Need to decrypt up to 256 bytes - prepare four blocks - MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0 - MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 - MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 - MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3 - - // Store counters - MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store - XORQ itr2, itr2 - -openSSETail256Loop: - // This loop inteleaves 8 ChaCha quarter rounds with 1 poly multiplication - polyAdd(0(inp)(itr2*1)) - MOVO C3, tmpStore - chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) - MOVO tmpStore, C3 - MOVO C1, tmpStore - chachaQR(A3, B3, C3, D3, C1) - MOVO tmpStore, C1 - shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left - shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left - shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left - polyMulStage1 - polyMulStage2 - MOVO C3, tmpStore - chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) - MOVO tmpStore, C3 - MOVO C1, tmpStore - chachaQR(A3, B3, C3, D3, C1) - MOVO tmpStore, C1 - polyMulStage3 - polyMulReduceStage - shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right - shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right - shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right - ADDQ $2*8, itr2 - CMPQ itr2, $160 - JB openSSETail256Loop - MOVQ inl, itr1 - ANDQ $-16, itr1 - -openSSETail256HashLoop: - polyAdd(0(inp)(itr2*1)) - polyMul - ADDQ $2*8, itr2 - CMPQ itr2, itr1 - JB openSSETail256HashLoop - - // Add in the state - PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3 - PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3 - PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3 - PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3 - MOVO D3, tmpStore - - // Load - xor - store - MOVOU (0*16)(inp), D3; PXOR D3, A0 - MOVOU (1*16)(inp), D3; PXOR D3, B0 - MOVOU (2*16)(inp), D3; PXOR D3, C0 - MOVOU (3*16)(inp), D3; PXOR D3, D0 - MOVOU A0, (0*16)(oup) - MOVOU B0, (1*16)(oup) - MOVOU C0, (2*16)(oup) - MOVOU D0, (3*16)(oup) - MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0 - PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1 - MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup) - MOVOU (8*16)(inp), A0; MOVOU (9*16)(inp), B0; MOVOU (10*16)(inp), C0; MOVOU (11*16)(inp), D0 - PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2 - MOVOU A2, (8*16)(oup); MOVOU B2, (9*16)(oup); MOVOU C2, (10*16)(oup); MOVOU D2, (11*16)(oup) - LEAQ 192(inp), inp - LEAQ 192(oup), oup - SUBQ $192, inl - MOVO A3, A0 - MOVO B3, B0 - MOVO C3, C0 - MOVO tmpStore, D0 - - JMP openSSETail64DecLoop - -// ---------------------------------------------------------------------------- -// ------------------------- AVX2 Code ---------------------------------------- -chacha20Poly1305Open_AVX2: - VZEROUPPER - VMOVDQU ·chacha20Constants<>(SB), AA0 - BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x70; BYTE $0x10 // broadcasti128 16(r8), ymm14 - BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x20 // broadcasti128 32(r8), ymm12 - BYTE $0xc4; BYTE $0xc2; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x30 // broadcasti128 48(r8), ymm4 - VPADDD ·avx2InitMask<>(SB), DD0, DD0 - - // Special optimization, for very short buffers - CMPQ inl, $192 - JBE openAVX2192 - CMPQ inl, $320 - JBE openAVX2320 - - // For the general key prepare the key first - as a byproduct we have 64 bytes of cipher stream - VMOVDQA BB0, state1StoreAVX2 - VMOVDQA CC0, state2StoreAVX2 - VMOVDQA DD0, ctr3StoreAVX2 - MOVQ $10, itr2 - -openAVX2PreparePolyKey: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0) - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0) - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0 - DECQ itr2 - JNE openAVX2PreparePolyKey - - VPADDD ·chacha20Constants<>(SB), AA0, AA0 - VPADDD state1StoreAVX2, BB0, BB0 - VPADDD state2StoreAVX2, CC0, CC0 - VPADDD ctr3StoreAVX2, DD0, DD0 - - VPERM2I128 $0x02, AA0, BB0, TT0 - - // Clamp and store poly key - VPAND ·polyClampMask<>(SB), TT0, TT0 - VMOVDQA TT0, rsStoreAVX2 - - // Stream for the first 64 bytes - VPERM2I128 $0x13, AA0, BB0, AA0 - VPERM2I128 $0x13, CC0, DD0, BB0 - - // Hash AD + first 64 bytes - MOVQ ad_len+80(FP), itr2 - CALL polyHashADInternal<>(SB) - XORQ itr1, itr1 - -openAVX2InitialHash64: - polyAdd(0(inp)(itr1*1)) - polyMulAVX2 - ADDQ $16, itr1 - CMPQ itr1, $64 - JNE openAVX2InitialHash64 - - // Decrypt the first 64 bytes - VPXOR (0*32)(inp), AA0, AA0 - VPXOR (1*32)(inp), BB0, BB0 - VMOVDQU AA0, (0*32)(oup) - VMOVDQU BB0, (1*32)(oup) - LEAQ (2*32)(inp), inp - LEAQ (2*32)(oup), oup - SUBQ $64, inl - -openAVX2MainLoop: - CMPQ inl, $512 - JB openAVX2MainLoopDone - - // Load state, increment counter blocks, store the incremented counters - VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 - VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 - VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 - XORQ itr1, itr1 - -openAVX2InternalLoop: - // Lets just say this spaghetti loop interleaves 2 quarter rounds with 3 poly multiplications - // Effectively per 512 bytes of stream we hash 480 bytes of ciphertext - polyAdd(0*8(inp)(itr1*1)) - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - polyMulStage1_AVX2 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - polyMulStage2_AVX2 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - polyMulStage3_AVX2 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyMulReduceStage - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 - polyAdd(2*8(inp)(itr1*1)) - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - polyMulStage1_AVX2 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyMulStage2_AVX2 - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - polyMulStage3_AVX2 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - polyMulReduceStage - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - polyAdd(4*8(inp)(itr1*1)) - LEAQ (6*8)(itr1), itr1 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyMulStage1_AVX2 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - polyMulStage2_AVX2 - VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - polyMulStage3_AVX2 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyMulReduceStage - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3 - CMPQ itr1, $480 - JNE openAVX2InternalLoop - - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 - VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 - VMOVDQA CC3, tmpStoreAVX2 - - // We only hashed 480 of the 512 bytes available - hash the remaining 32 here - polyAdd(480(inp)) - polyMulAVX2 - VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0 - VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0 - VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup) - VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 - VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0 - VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup) - - // and here - polyAdd(496(inp)) - polyMulAVX2 - VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 - VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0 - VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup) - VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0 - VPXOR (12*32)(inp), AA0, AA0; VPXOR (13*32)(inp), BB0, BB0; VPXOR (14*32)(inp), CC0, CC0; VPXOR (15*32)(inp), DD0, DD0 - VMOVDQU AA0, (12*32)(oup); VMOVDQU BB0, (13*32)(oup); VMOVDQU CC0, (14*32)(oup); VMOVDQU DD0, (15*32)(oup) - LEAQ (32*16)(inp), inp - LEAQ (32*16)(oup), oup - SUBQ $(32*16), inl - JMP openAVX2MainLoop - -openAVX2MainLoopDone: - // Handle the various tail sizes efficiently - TESTQ inl, inl - JE openSSEFinalize - CMPQ inl, $128 - JBE openAVX2Tail128 - CMPQ inl, $256 - JBE openAVX2Tail256 - CMPQ inl, $384 - JBE openAVX2Tail384 - JMP openAVX2Tail512 - -// ---------------------------------------------------------------------------- -// Special optimization for buffers smaller than 193 bytes -openAVX2192: - // For up to 192 bytes of ciphertext and 64 bytes for the poly key, we process four blocks - VMOVDQA AA0, AA1 - VMOVDQA BB0, BB1 - VMOVDQA CC0, CC1 - VPADDD ·avx2IncMask<>(SB), DD0, DD1 - VMOVDQA AA0, AA2 - VMOVDQA BB0, BB2 - VMOVDQA CC0, CC2 - VMOVDQA DD0, DD2 - VMOVDQA DD1, TT3 - MOVQ $10, itr2 - -openAVX2192InnerCipherLoop: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1 - DECQ itr2 - JNE openAVX2192InnerCipherLoop - VPADDD AA2, AA0, AA0; VPADDD AA2, AA1, AA1 - VPADDD BB2, BB0, BB0; VPADDD BB2, BB1, BB1 - VPADDD CC2, CC0, CC0; VPADDD CC2, CC1, CC1 - VPADDD DD2, DD0, DD0; VPADDD TT3, DD1, DD1 - VPERM2I128 $0x02, AA0, BB0, TT0 - - // Clamp and store poly key - VPAND ·polyClampMask<>(SB), TT0, TT0 - VMOVDQA TT0, rsStoreAVX2 - - // Stream for up to 192 bytes - VPERM2I128 $0x13, AA0, BB0, AA0 - VPERM2I128 $0x13, CC0, DD0, BB0 - VPERM2I128 $0x02, AA1, BB1, CC0 - VPERM2I128 $0x02, CC1, DD1, DD0 - VPERM2I128 $0x13, AA1, BB1, AA1 - VPERM2I128 $0x13, CC1, DD1, BB1 - -openAVX2ShortOpen: - // Hash - MOVQ ad_len+80(FP), itr2 - CALL polyHashADInternal<>(SB) - -openAVX2ShortOpenLoop: - CMPQ inl, $32 - JB openAVX2ShortTail32 - SUBQ $32, inl - - // Load for hashing - polyAdd(0*8(inp)) - polyMulAVX2 - polyAdd(2*8(inp)) - polyMulAVX2 - - // Load for decryption - VPXOR (inp), AA0, AA0 - VMOVDQU AA0, (oup) - LEAQ (1*32)(inp), inp - LEAQ (1*32)(oup), oup - - // Shift stream left - VMOVDQA BB0, AA0 - VMOVDQA CC0, BB0 - VMOVDQA DD0, CC0 - VMOVDQA AA1, DD0 - VMOVDQA BB1, AA1 - VMOVDQA CC1, BB1 - VMOVDQA DD1, CC1 - VMOVDQA AA2, DD1 - VMOVDQA BB2, AA2 - JMP openAVX2ShortOpenLoop - -openAVX2ShortTail32: - CMPQ inl, $16 - VMOVDQA A0, A1 - JB openAVX2ShortDone - - SUBQ $16, inl - - // Load for hashing - polyAdd(0*8(inp)) - polyMulAVX2 - - // Load for decryption - VPXOR (inp), A0, T0 - VMOVDQU T0, (oup) - LEAQ (1*16)(inp), inp - LEAQ (1*16)(oup), oup - VPERM2I128 $0x11, AA0, AA0, AA0 - VMOVDQA A0, A1 - -openAVX2ShortDone: - VZEROUPPER - JMP openSSETail16 - -// ---------------------------------------------------------------------------- -// Special optimization for buffers smaller than 321 bytes -openAVX2320: - // For up to 320 bytes of ciphertext and 64 bytes for the poly key, we process six blocks - VMOVDQA AA0, AA1; VMOVDQA BB0, BB1; VMOVDQA CC0, CC1; VPADDD ·avx2IncMask<>(SB), DD0, DD1 - VMOVDQA AA0, AA2; VMOVDQA BB0, BB2; VMOVDQA CC0, CC2; VPADDD ·avx2IncMask<>(SB), DD1, DD2 - VMOVDQA BB0, TT1; VMOVDQA CC0, TT2; VMOVDQA DD0, TT3 - MOVQ $10, itr2 - -openAVX2320InnerCipherLoop: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2 - DECQ itr2 - JNE openAVX2320InnerCipherLoop - - VMOVDQA ·chacha20Constants<>(SB), TT0 - VPADDD TT0, AA0, AA0; VPADDD TT0, AA1, AA1; VPADDD TT0, AA2, AA2 - VPADDD TT1, BB0, BB0; VPADDD TT1, BB1, BB1; VPADDD TT1, BB2, BB2 - VPADDD TT2, CC0, CC0; VPADDD TT2, CC1, CC1; VPADDD TT2, CC2, CC2 - VMOVDQA ·avx2IncMask<>(SB), TT0 - VPADDD TT3, DD0, DD0; VPADDD TT0, TT3, TT3 - VPADDD TT3, DD1, DD1; VPADDD TT0, TT3, TT3 - VPADDD TT3, DD2, DD2 - - // Clamp and store poly key - VPERM2I128 $0x02, AA0, BB0, TT0 - VPAND ·polyClampMask<>(SB), TT0, TT0 - VMOVDQA TT0, rsStoreAVX2 - - // Stream for up to 320 bytes - VPERM2I128 $0x13, AA0, BB0, AA0 - VPERM2I128 $0x13, CC0, DD0, BB0 - VPERM2I128 $0x02, AA1, BB1, CC0 - VPERM2I128 $0x02, CC1, DD1, DD0 - VPERM2I128 $0x13, AA1, BB1, AA1 - VPERM2I128 $0x13, CC1, DD1, BB1 - VPERM2I128 $0x02, AA2, BB2, CC1 - VPERM2I128 $0x02, CC2, DD2, DD1 - VPERM2I128 $0x13, AA2, BB2, AA2 - VPERM2I128 $0x13, CC2, DD2, BB2 - JMP openAVX2ShortOpen - -// ---------------------------------------------------------------------------- -// Special optimization for the last 128 bytes of ciphertext -openAVX2Tail128: - // Need to decrypt up to 128 bytes - prepare two blocks - VMOVDQA ·chacha20Constants<>(SB), AA1 - VMOVDQA state1StoreAVX2, BB1 - VMOVDQA state2StoreAVX2, CC1 - VMOVDQA ctr3StoreAVX2, DD1 - VPADDD ·avx2IncMask<>(SB), DD1, DD1 - VMOVDQA DD1, DD0 - - XORQ itr2, itr2 - MOVQ inl, itr1 - ANDQ $-16, itr1 - TESTQ itr1, itr1 - JE openAVX2Tail128LoopB - -openAVX2Tail128LoopA: - // Perform ChaCha rounds, while hashing the remaining input - polyAdd(0(inp)(itr2*1)) - polyMulAVX2 - -openAVX2Tail128LoopB: - ADDQ $16, itr2 - chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - VPALIGNR $4, BB1, BB1, BB1 - VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $12, DD1, DD1, DD1 - chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - VPALIGNR $12, BB1, BB1, BB1 - VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $4, DD1, DD1, DD1 - CMPQ itr2, itr1 - JB openAVX2Tail128LoopA - CMPQ itr2, $160 - JNE openAVX2Tail128LoopB - - VPADDD ·chacha20Constants<>(SB), AA1, AA1 - VPADDD state1StoreAVX2, BB1, BB1 - VPADDD state2StoreAVX2, CC1, CC1 - VPADDD DD0, DD1, DD1 - VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 - -openAVX2TailLoop: - CMPQ inl, $32 - JB openAVX2Tail - SUBQ $32, inl - - // Load for decryption - VPXOR (inp), AA0, AA0 - VMOVDQU AA0, (oup) - LEAQ (1*32)(inp), inp - LEAQ (1*32)(oup), oup - VMOVDQA BB0, AA0 - VMOVDQA CC0, BB0 - VMOVDQA DD0, CC0 - JMP openAVX2TailLoop - -openAVX2Tail: - CMPQ inl, $16 - VMOVDQA A0, A1 - JB openAVX2TailDone - SUBQ $16, inl - - // Load for decryption - VPXOR (inp), A0, T0 - VMOVDQU T0, (oup) - LEAQ (1*16)(inp), inp - LEAQ (1*16)(oup), oup - VPERM2I128 $0x11, AA0, AA0, AA0 - VMOVDQA A0, A1 - -openAVX2TailDone: - VZEROUPPER - JMP openSSETail16 - -// ---------------------------------------------------------------------------- -// Special optimization for the last 256 bytes of ciphertext -openAVX2Tail256: - // Need to decrypt up to 256 bytes - prepare four blocks - VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1 - VMOVDQA ctr3StoreAVX2, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD1 - VMOVDQA DD0, TT1 - VMOVDQA DD1, TT2 - - // Compute the number of iterations that will hash data - MOVQ inl, tmpStoreAVX2 - MOVQ inl, itr1 - SUBQ $128, itr1 - SHRQ $4, itr1 - MOVQ $10, itr2 - CMPQ itr1, $10 - CMOVQGT itr2, itr1 - MOVQ inp, inl - XORQ itr2, itr2 - -openAVX2Tail256LoopA: - polyAdd(0(inl)) - polyMulAVX2 - LEAQ 16(inl), inl - - // Perform ChaCha rounds, while hashing the remaining input -openAVX2Tail256LoopB: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1 - INCQ itr2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1 - CMPQ itr2, itr1 - JB openAVX2Tail256LoopA - - CMPQ itr2, $10 - JNE openAVX2Tail256LoopB - - MOVQ inl, itr2 - SUBQ inp, inl - MOVQ inl, itr1 - MOVQ tmpStoreAVX2, inl - - // Hash the remainder of data (if any) -openAVX2Tail256Hash: - ADDQ $16, itr1 - CMPQ itr1, inl - JGT openAVX2Tail256HashEnd - polyAdd (0(itr2)) - polyMulAVX2 - LEAQ 16(itr2), itr2 - JMP openAVX2Tail256Hash - -// Store 128 bytes safely, then go to store loop -openAVX2Tail256HashEnd: - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1 - VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1 - VPERM2I128 $0x02, AA0, BB0, AA2; VPERM2I128 $0x02, CC0, DD0, BB2; VPERM2I128 $0x13, AA0, BB0, CC2; VPERM2I128 $0x13, CC0, DD0, DD2 - VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 - - VPXOR (0*32)(inp), AA2, AA2; VPXOR (1*32)(inp), BB2, BB2; VPXOR (2*32)(inp), CC2, CC2; VPXOR (3*32)(inp), DD2, DD2 - VMOVDQU AA2, (0*32)(oup); VMOVDQU BB2, (1*32)(oup); VMOVDQU CC2, (2*32)(oup); VMOVDQU DD2, (3*32)(oup) - LEAQ (4*32)(inp), inp - LEAQ (4*32)(oup), oup - SUBQ $4*32, inl - - JMP openAVX2TailLoop - -// ---------------------------------------------------------------------------- -// Special optimization for the last 384 bytes of ciphertext -openAVX2Tail384: - // Need to decrypt up to 384 bytes - prepare six blocks - VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2 - VMOVDQA ctr3StoreAVX2, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD1 - VPADDD ·avx2IncMask<>(SB), DD1, DD2 - VMOVDQA DD0, ctr0StoreAVX2 - VMOVDQA DD1, ctr1StoreAVX2 - VMOVDQA DD2, ctr2StoreAVX2 - - // Compute the number of iterations that will hash two blocks of data - MOVQ inl, tmpStoreAVX2 - MOVQ inl, itr1 - SUBQ $256, itr1 - SHRQ $4, itr1 - ADDQ $6, itr1 - MOVQ $10, itr2 - CMPQ itr1, $10 - CMOVQGT itr2, itr1 - MOVQ inp, inl - XORQ itr2, itr2 - - // Perform ChaCha rounds, while hashing the remaining input -openAVX2Tail384LoopB: - polyAdd(0(inl)) - polyMulAVX2 - LEAQ 16(inl), inl - -openAVX2Tail384LoopA: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2 - polyAdd(0(inl)) - polyMulAVX2 - LEAQ 16(inl), inl - INCQ itr2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2 - - CMPQ itr2, itr1 - JB openAVX2Tail384LoopB - - CMPQ itr2, $10 - JNE openAVX2Tail384LoopA - - MOVQ inl, itr2 - SUBQ inp, inl - MOVQ inl, itr1 - MOVQ tmpStoreAVX2, inl - -openAVX2Tail384Hash: - ADDQ $16, itr1 - CMPQ itr1, inl - JGT openAVX2Tail384HashEnd - polyAdd(0(itr2)) - polyMulAVX2 - LEAQ 16(itr2), itr2 - JMP openAVX2Tail384Hash - -// Store 256 bytes safely, then go to store loop -openAVX2Tail384HashEnd: - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2 - VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2 - VPERM2I128 $0x02, AA0, BB0, TT0; VPERM2I128 $0x02, CC0, DD0, TT1; VPERM2I128 $0x13, AA0, BB0, TT2; VPERM2I128 $0x13, CC0, DD0, TT3 - VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3 - VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup) - VPERM2I128 $0x02, AA1, BB1, TT0; VPERM2I128 $0x02, CC1, DD1, TT1; VPERM2I128 $0x13, AA1, BB1, TT2; VPERM2I128 $0x13, CC1, DD1, TT3 - VPXOR (4*32)(inp), TT0, TT0; VPXOR (5*32)(inp), TT1, TT1; VPXOR (6*32)(inp), TT2, TT2; VPXOR (7*32)(inp), TT3, TT3 - VMOVDQU TT0, (4*32)(oup); VMOVDQU TT1, (5*32)(oup); VMOVDQU TT2, (6*32)(oup); VMOVDQU TT3, (7*32)(oup) - VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 - LEAQ (8*32)(inp), inp - LEAQ (8*32)(oup), oup - SUBQ $8*32, inl - JMP openAVX2TailLoop - -// ---------------------------------------------------------------------------- -// Special optimization for the last 512 bytes of ciphertext -openAVX2Tail512: - VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 - VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 - VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 - XORQ itr1, itr1 - MOVQ inp, itr2 - -openAVX2Tail512LoopB: - polyAdd(0(itr2)) - polyMulAVX2 - LEAQ (2*8)(itr2), itr2 - -openAVX2Tail512LoopA: - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyAdd(0*8(itr2)) - polyMulAVX2 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - polyAdd(2*8(itr2)) - polyMulAVX2 - LEAQ (4*8)(itr2), itr2 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3 - INCQ itr1 - CMPQ itr1, $4 - JLT openAVX2Tail512LoopB - - CMPQ itr1, $10 - JNE openAVX2Tail512LoopA - - MOVQ inl, itr1 - SUBQ $384, itr1 - ANDQ $-16, itr1 - -openAVX2Tail512HashLoop: - TESTQ itr1, itr1 - JE openAVX2Tail512HashEnd - polyAdd(0(itr2)) - polyMulAVX2 - LEAQ 16(itr2), itr2 - SUBQ $16, itr1 - JMP openAVX2Tail512HashLoop - -openAVX2Tail512HashEnd: - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 - VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 - VMOVDQA CC3, tmpStoreAVX2 - VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0 - VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0 - VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup) - VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 - VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0 - VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup) - VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 - VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0 - VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup) - VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0 - - LEAQ (12*32)(inp), inp - LEAQ (12*32)(oup), oup - SUBQ $12*32, inl - - JMP openAVX2TailLoop - -// ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- -// func chacha20Poly1305Seal(dst, key, src, ad []byte) -TEXT ·chacha20Poly1305Seal(SB), 0, $288-96 - // For aligned stack access - MOVQ SP, BP - ADDQ $32, BP - ANDQ $-32, BP - MOVQ dst+0(FP), oup - MOVQ key+24(FP), keyp - MOVQ src+48(FP), inp - MOVQ src_len+56(FP), inl - MOVQ ad+72(FP), adp - - CMPB ·useAVX2(SB), $1 - JE chacha20Poly1305Seal_AVX2 - - // Special optimization, for very short buffers - CMPQ inl, $128 - JBE sealSSE128 // About 15% faster - - // In the seal case - prepare the poly key + 3 blocks of stream in the first iteration - MOVOU ·chacha20Constants<>(SB), A0 - MOVOU (1*16)(keyp), B0 - MOVOU (2*16)(keyp), C0 - MOVOU (3*16)(keyp), D0 - - // Store state on stack for future use - MOVO B0, state1Store - MOVO C0, state2Store - - // Load state, increment counter blocks - MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 - MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 - MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3 - - // Store counters - MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store - MOVQ $10, itr2 - -sealSSEIntroLoop: - MOVO C3, tmpStore - chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) - MOVO tmpStore, C3 - MOVO C1, tmpStore - chachaQR(A3, B3, C3, D3, C1) - MOVO tmpStore, C1 - shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left - shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left - shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left - - MOVO C3, tmpStore - chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) - MOVO tmpStore, C3 - MOVO C1, tmpStore - chachaQR(A3, B3, C3, D3, C1) - MOVO tmpStore, C1 - shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right - shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right - shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right - DECQ itr2 - JNE sealSSEIntroLoop - - // Add in the state - PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3 - PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3 - PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3 - PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3 - - // Clamp and store the key - PAND ·polyClampMask<>(SB), A0 - MOVO A0, rStore - MOVO B0, sStore - - // Hash AAD - MOVQ ad_len+80(FP), itr2 - CALL polyHashADInternal<>(SB) - - MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0 - PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1 - MOVOU A1, (0*16)(oup); MOVOU B1, (1*16)(oup); MOVOU C1, (2*16)(oup); MOVOU D1, (3*16)(oup) - MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0 - PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2 - MOVOU A2, (4*16)(oup); MOVOU B2, (5*16)(oup); MOVOU C2, (6*16)(oup); MOVOU D2, (7*16)(oup) - - MOVQ $128, itr1 - SUBQ $128, inl - LEAQ 128(inp), inp - - MOVO A3, A1; MOVO B3, B1; MOVO C3, C1; MOVO D3, D1 - - CMPQ inl, $64 - JBE sealSSE128SealHash - - MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0 - PXOR A0, A3; PXOR B0, B3; PXOR C0, C3; PXOR D0, D3 - MOVOU A3, (8*16)(oup); MOVOU B3, (9*16)(oup); MOVOU C3, (10*16)(oup); MOVOU D3, (11*16)(oup) - - ADDQ $64, itr1 - SUBQ $64, inl - LEAQ 64(inp), inp - - MOVQ $2, itr1 - MOVQ $8, itr2 - - CMPQ inl, $64 - JBE sealSSETail64 - CMPQ inl, $128 - JBE sealSSETail128 - CMPQ inl, $192 - JBE sealSSETail192 - -sealSSEMainLoop: - // Load state, increment counter blocks - MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0 - MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 - MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 - MOVO A2, A3; MOVO B2, B3; MOVO C2, C3; MOVO D2, D3; PADDL ·sseIncMask<>(SB), D3 - - // Store counters - MOVO D0, ctr0Store; MOVO D1, ctr1Store; MOVO D2, ctr2Store; MOVO D3, ctr3Store - -sealSSEInnerLoop: - MOVO C3, tmpStore - chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) - MOVO tmpStore, C3 - MOVO C1, tmpStore - chachaQR(A3, B3, C3, D3, C1) - MOVO tmpStore, C1 - polyAdd(0(oup)) - shiftB0Left; shiftB1Left; shiftB2Left; shiftB3Left - shiftC0Left; shiftC1Left; shiftC2Left; shiftC3Left - shiftD0Left; shiftD1Left; shiftD2Left; shiftD3Left - polyMulStage1 - polyMulStage2 - LEAQ (2*8)(oup), oup - MOVO C3, tmpStore - chachaQR(A0, B0, C0, D0, C3); chachaQR(A1, B1, C1, D1, C3); chachaQR(A2, B2, C2, D2, C3) - MOVO tmpStore, C3 - MOVO C1, tmpStore - polyMulStage3 - chachaQR(A3, B3, C3, D3, C1) - MOVO tmpStore, C1 - polyMulReduceStage - shiftB0Right; shiftB1Right; shiftB2Right; shiftB3Right - shiftC0Right; shiftC1Right; shiftC2Right; shiftC3Right - shiftD0Right; shiftD1Right; shiftD2Right; shiftD3Right - DECQ itr2 - JGE sealSSEInnerLoop - polyAdd(0(oup)) - polyMul - LEAQ (2*8)(oup), oup - DECQ itr1 - JG sealSSEInnerLoop - - // Add in the state - PADDD ·chacha20Constants<>(SB), A0; PADDD ·chacha20Constants<>(SB), A1; PADDD ·chacha20Constants<>(SB), A2; PADDD ·chacha20Constants<>(SB), A3 - PADDD state1Store, B0; PADDD state1Store, B1; PADDD state1Store, B2; PADDD state1Store, B3 - PADDD state2Store, C0; PADDD state2Store, C1; PADDD state2Store, C2; PADDD state2Store, C3 - PADDD ctr0Store, D0; PADDD ctr1Store, D1; PADDD ctr2Store, D2; PADDD ctr3Store, D3 - MOVO D3, tmpStore - - // Load - xor - store - MOVOU (0*16)(inp), D3; PXOR D3, A0 - MOVOU (1*16)(inp), D3; PXOR D3, B0 - MOVOU (2*16)(inp), D3; PXOR D3, C0 - MOVOU (3*16)(inp), D3; PXOR D3, D0 - MOVOU A0, (0*16)(oup) - MOVOU B0, (1*16)(oup) - MOVOU C0, (2*16)(oup) - MOVOU D0, (3*16)(oup) - MOVO tmpStore, D3 - - MOVOU (4*16)(inp), A0; MOVOU (5*16)(inp), B0; MOVOU (6*16)(inp), C0; MOVOU (7*16)(inp), D0 - PXOR A0, A1; PXOR B0, B1; PXOR C0, C1; PXOR D0, D1 - MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup) - MOVOU (8*16)(inp), A0; MOVOU (9*16)(inp), B0; MOVOU (10*16)(inp), C0; MOVOU (11*16)(inp), D0 - PXOR A0, A2; PXOR B0, B2; PXOR C0, C2; PXOR D0, D2 - MOVOU A2, (8*16)(oup); MOVOU B2, (9*16)(oup); MOVOU C2, (10*16)(oup); MOVOU D2, (11*16)(oup) - ADDQ $192, inp - MOVQ $192, itr1 - SUBQ $192, inl - MOVO A3, A1 - MOVO B3, B1 - MOVO C3, C1 - MOVO D3, D1 - CMPQ inl, $64 - JBE sealSSE128SealHash - MOVOU (0*16)(inp), A0; MOVOU (1*16)(inp), B0; MOVOU (2*16)(inp), C0; MOVOU (3*16)(inp), D0 - PXOR A0, A3; PXOR B0, B3; PXOR C0, C3; PXOR D0, D3 - MOVOU A3, (12*16)(oup); MOVOU B3, (13*16)(oup); MOVOU C3, (14*16)(oup); MOVOU D3, (15*16)(oup) - LEAQ 64(inp), inp - SUBQ $64, inl - MOVQ $6, itr1 - MOVQ $4, itr2 - CMPQ inl, $192 - JG sealSSEMainLoop - - MOVQ inl, itr1 - TESTQ inl, inl - JE sealSSE128SealHash - MOVQ $6, itr1 - CMPQ inl, $64 - JBE sealSSETail64 - CMPQ inl, $128 - JBE sealSSETail128 - JMP sealSSETail192 - -// ---------------------------------------------------------------------------- -// Special optimization for the last 64 bytes of plaintext -sealSSETail64: - // Need to encrypt up to 64 bytes - prepare single block, hash 192 or 256 bytes - MOVO ·chacha20Constants<>(SB), A1 - MOVO state1Store, B1 - MOVO state2Store, C1 - MOVO ctr3Store, D1 - PADDL ·sseIncMask<>(SB), D1 - MOVO D1, ctr0Store - -sealSSETail64LoopA: - // Perform ChaCha rounds, while hashing the previously encrypted ciphertext - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - -sealSSETail64LoopB: - chachaQR(A1, B1, C1, D1, T1) - shiftB1Left; shiftC1Left; shiftD1Left - chachaQR(A1, B1, C1, D1, T1) - shiftB1Right; shiftC1Right; shiftD1Right - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - - DECQ itr1 - JG sealSSETail64LoopA - - DECQ itr2 - JGE sealSSETail64LoopB - PADDL ·chacha20Constants<>(SB), A1 - PADDL state1Store, B1 - PADDL state2Store, C1 - PADDL ctr0Store, D1 - - JMP sealSSE128Seal - -// ---------------------------------------------------------------------------- -// Special optimization for the last 128 bytes of plaintext -sealSSETail128: - // Need to encrypt up to 128 bytes - prepare two blocks, hash 192 or 256 bytes - MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store - MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store - -sealSSETail128LoopA: - // Perform ChaCha rounds, while hashing the previously encrypted ciphertext - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - -sealSSETail128LoopB: - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0) - shiftB0Left; shiftC0Left; shiftD0Left - shiftB1Left; shiftC1Left; shiftD1Left - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0) - shiftB0Right; shiftC0Right; shiftD0Right - shiftB1Right; shiftC1Right; shiftD1Right - - DECQ itr1 - JG sealSSETail128LoopA - - DECQ itr2 - JGE sealSSETail128LoopB - - PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1 - PADDL state1Store, B0; PADDL state1Store, B1 - PADDL state2Store, C0; PADDL state2Store, C1 - PADDL ctr0Store, D0; PADDL ctr1Store, D1 - - MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3 - PXOR T0, A0; PXOR T1, B0; PXOR T2, C0; PXOR T3, D0 - MOVOU A0, (0*16)(oup); MOVOU B0, (1*16)(oup); MOVOU C0, (2*16)(oup); MOVOU D0, (3*16)(oup) - - MOVQ $64, itr1 - LEAQ 64(inp), inp - SUBQ $64, inl - - JMP sealSSE128SealHash - -// ---------------------------------------------------------------------------- -// Special optimization for the last 192 bytes of plaintext -sealSSETail192: - // Need to encrypt up to 192 bytes - prepare three blocks, hash 192 or 256 bytes - MOVO ·chacha20Constants<>(SB), A0; MOVO state1Store, B0; MOVO state2Store, C0; MOVO ctr3Store, D0; PADDL ·sseIncMask<>(SB), D0; MOVO D0, ctr0Store - MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1; MOVO D1, ctr1Store - MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2; MOVO D2, ctr2Store - -sealSSETail192LoopA: - // Perform ChaCha rounds, while hashing the previously encrypted ciphertext - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - -sealSSETail192LoopB: - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) - shiftB0Left; shiftC0Left; shiftD0Left - shiftB1Left; shiftC1Left; shiftD1Left - shiftB2Left; shiftC2Left; shiftD2Left - - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) - shiftB0Right; shiftC0Right; shiftD0Right - shiftB1Right; shiftC1Right; shiftD1Right - shiftB2Right; shiftC2Right; shiftD2Right - - DECQ itr1 - JG sealSSETail192LoopA - - DECQ itr2 - JGE sealSSETail192LoopB - - PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2 - PADDL state1Store, B0; PADDL state1Store, B1; PADDL state1Store, B2 - PADDL state2Store, C0; PADDL state2Store, C1; PADDL state2Store, C2 - PADDL ctr0Store, D0; PADDL ctr1Store, D1; PADDL ctr2Store, D2 - - MOVOU (0*16)(inp), T0; MOVOU (1*16)(inp), T1; MOVOU (2*16)(inp), T2; MOVOU (3*16)(inp), T3 - PXOR T0, A0; PXOR T1, B0; PXOR T2, C0; PXOR T3, D0 - MOVOU A0, (0*16)(oup); MOVOU B0, (1*16)(oup); MOVOU C0, (2*16)(oup); MOVOU D0, (3*16)(oup) - MOVOU (4*16)(inp), T0; MOVOU (5*16)(inp), T1; MOVOU (6*16)(inp), T2; MOVOU (7*16)(inp), T3 - PXOR T0, A1; PXOR T1, B1; PXOR T2, C1; PXOR T3, D1 - MOVOU A1, (4*16)(oup); MOVOU B1, (5*16)(oup); MOVOU C1, (6*16)(oup); MOVOU D1, (7*16)(oup) - - MOVO A2, A1 - MOVO B2, B1 - MOVO C2, C1 - MOVO D2, D1 - MOVQ $128, itr1 - LEAQ 128(inp), inp - SUBQ $128, inl - - JMP sealSSE128SealHash - -// ---------------------------------------------------------------------------- -// Special seal optimization for buffers smaller than 129 bytes -sealSSE128: - // For up to 128 bytes of ciphertext and 64 bytes for the poly key, we require to process three blocks - MOVOU ·chacha20Constants<>(SB), A0; MOVOU (1*16)(keyp), B0; MOVOU (2*16)(keyp), C0; MOVOU (3*16)(keyp), D0 - MOVO A0, A1; MOVO B0, B1; MOVO C0, C1; MOVO D0, D1; PADDL ·sseIncMask<>(SB), D1 - MOVO A1, A2; MOVO B1, B2; MOVO C1, C2; MOVO D1, D2; PADDL ·sseIncMask<>(SB), D2 - MOVO B0, T1; MOVO C0, T2; MOVO D1, T3 - MOVQ $10, itr2 - -sealSSE128InnerCipherLoop: - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) - shiftB0Left; shiftB1Left; shiftB2Left - shiftC0Left; shiftC1Left; shiftC2Left - shiftD0Left; shiftD1Left; shiftD2Left - chachaQR(A0, B0, C0, D0, T0); chachaQR(A1, B1, C1, D1, T0); chachaQR(A2, B2, C2, D2, T0) - shiftB0Right; shiftB1Right; shiftB2Right - shiftC0Right; shiftC1Right; shiftC2Right - shiftD0Right; shiftD1Right; shiftD2Right - DECQ itr2 - JNE sealSSE128InnerCipherLoop - - // A0|B0 hold the Poly1305 32-byte key, C0,D0 can be discarded - PADDL ·chacha20Constants<>(SB), A0; PADDL ·chacha20Constants<>(SB), A1; PADDL ·chacha20Constants<>(SB), A2 - PADDL T1, B0; PADDL T1, B1; PADDL T1, B2 - PADDL T2, C1; PADDL T2, C2 - PADDL T3, D1; PADDL ·sseIncMask<>(SB), T3; PADDL T3, D2 - PAND ·polyClampMask<>(SB), A0 - MOVOU A0, rStore - MOVOU B0, sStore - - // Hash - MOVQ ad_len+80(FP), itr2 - CALL polyHashADInternal<>(SB) - XORQ itr1, itr1 - -sealSSE128SealHash: - // itr1 holds the number of bytes encrypted but not yet hashed - CMPQ itr1, $16 - JB sealSSE128Seal - polyAdd(0(oup)) - polyMul - - SUBQ $16, itr1 - ADDQ $16, oup - - JMP sealSSE128SealHash - -sealSSE128Seal: - CMPQ inl, $16 - JB sealSSETail - SUBQ $16, inl - - // Load for decryption - MOVOU (inp), T0 - PXOR T0, A1 - MOVOU A1, (oup) - LEAQ (1*16)(inp), inp - LEAQ (1*16)(oup), oup - - // Extract for hashing - MOVQ A1, t0 - PSRLDQ $8, A1 - MOVQ A1, t1 - ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2 - polyMul - - // Shift the stream "left" - MOVO B1, A1 - MOVO C1, B1 - MOVO D1, C1 - MOVO A2, D1 - MOVO B2, A2 - MOVO C2, B2 - MOVO D2, C2 - JMP sealSSE128Seal - -sealSSETail: - TESTQ inl, inl - JE sealSSEFinalize - - // We can only load the PT one byte at a time to avoid read after end of buffer - MOVQ inl, itr2 - SHLQ $4, itr2 - LEAQ ·andMask<>(SB), t0 - MOVQ inl, itr1 - LEAQ -1(inp)(inl*1), inp - XORQ t2, t2 - XORQ t3, t3 - XORQ AX, AX - -sealSSETailLoadLoop: - SHLQ $8, t2, t3 - SHLQ $8, t2 - MOVB (inp), AX - XORQ AX, t2 - LEAQ -1(inp), inp - DECQ itr1 - JNE sealSSETailLoadLoop - MOVQ t2, 0+tmpStore - MOVQ t3, 8+tmpStore - PXOR 0+tmpStore, A1 - MOVOU A1, (oup) - MOVOU -16(t0)(itr2*1), T0 - PAND T0, A1 - MOVQ A1, t0 - PSRLDQ $8, A1 - MOVQ A1, t1 - ADDQ t0, acc0; ADCQ t1, acc1; ADCQ $1, acc2 - polyMul - - ADDQ inl, oup - -sealSSEFinalize: - // Hash in the buffer lengths - ADDQ ad_len+80(FP), acc0 - ADCQ src_len+56(FP), acc1 - ADCQ $1, acc2 - polyMul - - // Final reduce - MOVQ acc0, t0 - MOVQ acc1, t1 - MOVQ acc2, t2 - SUBQ $-5, acc0 - SBBQ $-1, acc1 - SBBQ $3, acc2 - CMOVQCS t0, acc0 - CMOVQCS t1, acc1 - CMOVQCS t2, acc2 - - // Add in the "s" part of the key - ADDQ 0+sStore, acc0 - ADCQ 8+sStore, acc1 - - // Finally store the tag at the end of the message - MOVQ acc0, (0*8)(oup) - MOVQ acc1, (1*8)(oup) - RET - -// ---------------------------------------------------------------------------- -// ------------------------- AVX2 Code ---------------------------------------- -chacha20Poly1305Seal_AVX2: - VZEROUPPER - VMOVDQU ·chacha20Constants<>(SB), AA0 - BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x70; BYTE $0x10 // broadcasti128 16(r8), ymm14 - BYTE $0xc4; BYTE $0x42; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x20 // broadcasti128 32(r8), ymm12 - BYTE $0xc4; BYTE $0xc2; BYTE $0x7d; BYTE $0x5a; BYTE $0x60; BYTE $0x30 // broadcasti128 48(r8), ymm4 - VPADDD ·avx2InitMask<>(SB), DD0, DD0 - - // Special optimizations, for very short buffers - CMPQ inl, $192 - JBE seal192AVX2 // 33% faster - CMPQ inl, $320 - JBE seal320AVX2 // 17% faster - - // For the general key prepare the key first - as a byproduct we have 64 bytes of cipher stream - VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 - VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3; VMOVDQA BB0, state1StoreAVX2 - VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3; VMOVDQA CC0, state2StoreAVX2 - VPADDD ·avx2IncMask<>(SB), DD0, DD1; VMOVDQA DD0, ctr0StoreAVX2 - VPADDD ·avx2IncMask<>(SB), DD1, DD2; VMOVDQA DD1, ctr1StoreAVX2 - VPADDD ·avx2IncMask<>(SB), DD2, DD3; VMOVDQA DD2, ctr2StoreAVX2 - VMOVDQA DD3, ctr3StoreAVX2 - MOVQ $10, itr2 - -sealAVX2IntroLoop: - VMOVDQA CC3, tmpStoreAVX2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3) - VMOVDQA tmpStoreAVX2, CC3 - VMOVDQA CC1, tmpStoreAVX2 - chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1) - VMOVDQA tmpStoreAVX2, CC1 - - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0 - VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $12, DD1, DD1, DD1 - VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $12, DD2, DD2, DD2 - VPALIGNR $4, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $12, DD3, DD3, DD3 - - VMOVDQA CC3, tmpStoreAVX2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3) - VMOVDQA tmpStoreAVX2, CC3 - VMOVDQA CC1, tmpStoreAVX2 - chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1) - VMOVDQA tmpStoreAVX2, CC1 - - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0 - VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $4, DD1, DD1, DD1 - VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $4, DD2, DD2, DD2 - VPALIGNR $12, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $4, DD3, DD3, DD3 - DECQ itr2 - JNE sealAVX2IntroLoop - - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 - VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 - - VPERM2I128 $0x13, CC0, DD0, CC0 // Stream bytes 96 - 127 - VPERM2I128 $0x02, AA0, BB0, DD0 // The Poly1305 key - VPERM2I128 $0x13, AA0, BB0, AA0 // Stream bytes 64 - 95 - - // Clamp and store poly key - VPAND ·polyClampMask<>(SB), DD0, DD0 - VMOVDQA DD0, rsStoreAVX2 - - // Hash AD - MOVQ ad_len+80(FP), itr2 - CALL polyHashADInternal<>(SB) - - // Can store at least 320 bytes - VPXOR (0*32)(inp), AA0, AA0 - VPXOR (1*32)(inp), CC0, CC0 - VMOVDQU AA0, (0*32)(oup) - VMOVDQU CC0, (1*32)(oup) - - VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 - VPXOR (2*32)(inp), AA0, AA0; VPXOR (3*32)(inp), BB0, BB0; VPXOR (4*32)(inp), CC0, CC0; VPXOR (5*32)(inp), DD0, DD0 - VMOVDQU AA0, (2*32)(oup); VMOVDQU BB0, (3*32)(oup); VMOVDQU CC0, (4*32)(oup); VMOVDQU DD0, (5*32)(oup) - VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 - VPXOR (6*32)(inp), AA0, AA0; VPXOR (7*32)(inp), BB0, BB0; VPXOR (8*32)(inp), CC0, CC0; VPXOR (9*32)(inp), DD0, DD0 - VMOVDQU AA0, (6*32)(oup); VMOVDQU BB0, (7*32)(oup); VMOVDQU CC0, (8*32)(oup); VMOVDQU DD0, (9*32)(oup) - - MOVQ $320, itr1 - SUBQ $320, inl - LEAQ 320(inp), inp - - VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, CC3, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, CC3, DD3, DD0 - CMPQ inl, $128 - JBE sealAVX2SealHash - - VPXOR (0*32)(inp), AA0, AA0; VPXOR (1*32)(inp), BB0, BB0; VPXOR (2*32)(inp), CC0, CC0; VPXOR (3*32)(inp), DD0, DD0 - VMOVDQU AA0, (10*32)(oup); VMOVDQU BB0, (11*32)(oup); VMOVDQU CC0, (12*32)(oup); VMOVDQU DD0, (13*32)(oup) - SUBQ $128, inl - LEAQ 128(inp), inp - - MOVQ $8, itr1 - MOVQ $2, itr2 - - CMPQ inl, $128 - JBE sealAVX2Tail128 - CMPQ inl, $256 - JBE sealAVX2Tail256 - CMPQ inl, $384 - JBE sealAVX2Tail384 - CMPQ inl, $512 - JBE sealAVX2Tail512 - - // We have 448 bytes to hash, but main loop hashes 512 bytes at a time - perform some rounds, before the main loop - VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 - VMOVDQA ctr3StoreAVX2, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 - VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 - - VMOVDQA CC3, tmpStoreAVX2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3) - VMOVDQA tmpStoreAVX2, CC3 - VMOVDQA CC1, tmpStoreAVX2 - chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1) - VMOVDQA tmpStoreAVX2, CC1 - - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $12, DD0, DD0, DD0 - VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $12, DD1, DD1, DD1 - VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $12, DD2, DD2, DD2 - VPALIGNR $4, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $12, DD3, DD3, DD3 - - VMOVDQA CC3, tmpStoreAVX2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, CC3); chachaQR_AVX2(AA1, BB1, CC1, DD1, CC3); chachaQR_AVX2(AA2, BB2, CC2, DD2, CC3) - VMOVDQA tmpStoreAVX2, CC3 - VMOVDQA CC1, tmpStoreAVX2 - chachaQR_AVX2(AA3, BB3, CC3, DD3, CC1) - VMOVDQA tmpStoreAVX2, CC1 - - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $4, DD0, DD0, DD0 - VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $4, DD1, DD1, DD1 - VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $4, DD2, DD2, DD2 - VPALIGNR $12, BB3, BB3, BB3; VPALIGNR $8, CC3, CC3, CC3; VPALIGNR $4, DD3, DD3, DD3 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - - SUBQ $16, oup // Adjust the pointer - MOVQ $9, itr1 - JMP sealAVX2InternalLoopStart - -sealAVX2MainLoop: - // Load state, increment counter blocks, store the incremented counters - VMOVDQU ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 - VMOVDQA ctr3StoreAVX2, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 - VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 - MOVQ $10, itr1 - -sealAVX2InternalLoop: - polyAdd(0*8(oup)) - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - polyMulStage1_AVX2 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - polyMulStage2_AVX2 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - polyMulStage3_AVX2 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyMulReduceStage - -sealAVX2InternalLoopStart: - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 - polyAdd(2*8(oup)) - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - polyMulStage1_AVX2 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyMulStage2_AVX2 - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - polyMulStage3_AVX2 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - polyMulReduceStage - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - polyAdd(4*8(oup)) - LEAQ (6*8)(oup), oup - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyMulStage1_AVX2 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - polyMulStage2_AVX2 - VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - polyMulStage3_AVX2 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyMulReduceStage - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3 - DECQ itr1 - JNE sealAVX2InternalLoop - - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 - VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 - VMOVDQA CC3, tmpStoreAVX2 - - // We only hashed 480 of the 512 bytes available - hash the remaining 32 here - polyAdd(0*8(oup)) - polyMulAVX2 - LEAQ (4*8)(oup), oup - VPERM2I128 $0x02, AA0, BB0, CC3; VPERM2I128 $0x13, AA0, BB0, BB0; VPERM2I128 $0x02, CC0, DD0, AA0; VPERM2I128 $0x13, CC0, DD0, CC0 - VPXOR (0*32)(inp), CC3, CC3; VPXOR (1*32)(inp), AA0, AA0; VPXOR (2*32)(inp), BB0, BB0; VPXOR (3*32)(inp), CC0, CC0 - VMOVDQU CC3, (0*32)(oup); VMOVDQU AA0, (1*32)(oup); VMOVDQU BB0, (2*32)(oup); VMOVDQU CC0, (3*32)(oup) - VPERM2I128 $0x02, AA1, BB1, AA0; VPERM2I128 $0x02, CC1, DD1, BB0; VPERM2I128 $0x13, AA1, BB1, CC0; VPERM2I128 $0x13, CC1, DD1, DD0 - VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0 - VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup) - - // and here - polyAdd(-2*8(oup)) - polyMulAVX2 - VPERM2I128 $0x02, AA2, BB2, AA0; VPERM2I128 $0x02, CC2, DD2, BB0; VPERM2I128 $0x13, AA2, BB2, CC0; VPERM2I128 $0x13, CC2, DD2, DD0 - VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0 - VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup) - VPERM2I128 $0x02, AA3, BB3, AA0; VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0; VPERM2I128 $0x13, AA3, BB3, CC0; VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0 - VPXOR (12*32)(inp), AA0, AA0; VPXOR (13*32)(inp), BB0, BB0; VPXOR (14*32)(inp), CC0, CC0; VPXOR (15*32)(inp), DD0, DD0 - VMOVDQU AA0, (12*32)(oup); VMOVDQU BB0, (13*32)(oup); VMOVDQU CC0, (14*32)(oup); VMOVDQU DD0, (15*32)(oup) - LEAQ (32*16)(inp), inp - SUBQ $(32*16), inl - CMPQ inl, $512 - JG sealAVX2MainLoop - - // Tail can only hash 480 bytes - polyAdd(0*8(oup)) - polyMulAVX2 - polyAdd(2*8(oup)) - polyMulAVX2 - LEAQ 32(oup), oup - - MOVQ $10, itr1 - MOVQ $0, itr2 - CMPQ inl, $128 - JBE sealAVX2Tail128 - CMPQ inl, $256 - JBE sealAVX2Tail256 - CMPQ inl, $384 - JBE sealAVX2Tail384 - JMP sealAVX2Tail512 - -// ---------------------------------------------------------------------------- -// Special optimization for buffers smaller than 193 bytes -seal192AVX2: - // For up to 192 bytes of ciphertext and 64 bytes for the poly key, we process four blocks - VMOVDQA AA0, AA1 - VMOVDQA BB0, BB1 - VMOVDQA CC0, CC1 - VPADDD ·avx2IncMask<>(SB), DD0, DD1 - VMOVDQA AA0, AA2 - VMOVDQA BB0, BB2 - VMOVDQA CC0, CC2 - VMOVDQA DD0, DD2 - VMOVDQA DD1, TT3 - MOVQ $10, itr2 - -sealAVX2192InnerCipherLoop: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1 - DECQ itr2 - JNE sealAVX2192InnerCipherLoop - VPADDD AA2, AA0, AA0; VPADDD AA2, AA1, AA1 - VPADDD BB2, BB0, BB0; VPADDD BB2, BB1, BB1 - VPADDD CC2, CC0, CC0; VPADDD CC2, CC1, CC1 - VPADDD DD2, DD0, DD0; VPADDD TT3, DD1, DD1 - VPERM2I128 $0x02, AA0, BB0, TT0 - - // Clamp and store poly key - VPAND ·polyClampMask<>(SB), TT0, TT0 - VMOVDQA TT0, rsStoreAVX2 - - // Stream for up to 192 bytes - VPERM2I128 $0x13, AA0, BB0, AA0 - VPERM2I128 $0x13, CC0, DD0, BB0 - VPERM2I128 $0x02, AA1, BB1, CC0 - VPERM2I128 $0x02, CC1, DD1, DD0 - VPERM2I128 $0x13, AA1, BB1, AA1 - VPERM2I128 $0x13, CC1, DD1, BB1 - -sealAVX2ShortSeal: - // Hash aad - MOVQ ad_len+80(FP), itr2 - CALL polyHashADInternal<>(SB) - XORQ itr1, itr1 - -sealAVX2SealHash: - // itr1 holds the number of bytes encrypted but not yet hashed - CMPQ itr1, $16 - JB sealAVX2ShortSealLoop - polyAdd(0(oup)) - polyMul - SUBQ $16, itr1 - ADDQ $16, oup - JMP sealAVX2SealHash - -sealAVX2ShortSealLoop: - CMPQ inl, $32 - JB sealAVX2ShortTail32 - SUBQ $32, inl - - // Load for encryption - VPXOR (inp), AA0, AA0 - VMOVDQU AA0, (oup) - LEAQ (1*32)(inp), inp - - // Now can hash - polyAdd(0*8(oup)) - polyMulAVX2 - polyAdd(2*8(oup)) - polyMulAVX2 - LEAQ (1*32)(oup), oup - - // Shift stream left - VMOVDQA BB0, AA0 - VMOVDQA CC0, BB0 - VMOVDQA DD0, CC0 - VMOVDQA AA1, DD0 - VMOVDQA BB1, AA1 - VMOVDQA CC1, BB1 - VMOVDQA DD1, CC1 - VMOVDQA AA2, DD1 - VMOVDQA BB2, AA2 - JMP sealAVX2ShortSealLoop - -sealAVX2ShortTail32: - CMPQ inl, $16 - VMOVDQA A0, A1 - JB sealAVX2ShortDone - - SUBQ $16, inl - - // Load for encryption - VPXOR (inp), A0, T0 - VMOVDQU T0, (oup) - LEAQ (1*16)(inp), inp - - // Hash - polyAdd(0*8(oup)) - polyMulAVX2 - LEAQ (1*16)(oup), oup - VPERM2I128 $0x11, AA0, AA0, AA0 - VMOVDQA A0, A1 - -sealAVX2ShortDone: - VZEROUPPER - JMP sealSSETail - -// ---------------------------------------------------------------------------- -// Special optimization for buffers smaller than 321 bytes -seal320AVX2: - // For up to 320 bytes of ciphertext and 64 bytes for the poly key, we process six blocks - VMOVDQA AA0, AA1; VMOVDQA BB0, BB1; VMOVDQA CC0, CC1; VPADDD ·avx2IncMask<>(SB), DD0, DD1 - VMOVDQA AA0, AA2; VMOVDQA BB0, BB2; VMOVDQA CC0, CC2; VPADDD ·avx2IncMask<>(SB), DD1, DD2 - VMOVDQA BB0, TT1; VMOVDQA CC0, TT2; VMOVDQA DD0, TT3 - MOVQ $10, itr2 - -sealAVX2320InnerCipherLoop: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2 - DECQ itr2 - JNE sealAVX2320InnerCipherLoop - - VMOVDQA ·chacha20Constants<>(SB), TT0 - VPADDD TT0, AA0, AA0; VPADDD TT0, AA1, AA1; VPADDD TT0, AA2, AA2 - VPADDD TT1, BB0, BB0; VPADDD TT1, BB1, BB1; VPADDD TT1, BB2, BB2 - VPADDD TT2, CC0, CC0; VPADDD TT2, CC1, CC1; VPADDD TT2, CC2, CC2 - VMOVDQA ·avx2IncMask<>(SB), TT0 - VPADDD TT3, DD0, DD0; VPADDD TT0, TT3, TT3 - VPADDD TT3, DD1, DD1; VPADDD TT0, TT3, TT3 - VPADDD TT3, DD2, DD2 - - // Clamp and store poly key - VPERM2I128 $0x02, AA0, BB0, TT0 - VPAND ·polyClampMask<>(SB), TT0, TT0 - VMOVDQA TT0, rsStoreAVX2 - - // Stream for up to 320 bytes - VPERM2I128 $0x13, AA0, BB0, AA0 - VPERM2I128 $0x13, CC0, DD0, BB0 - VPERM2I128 $0x02, AA1, BB1, CC0 - VPERM2I128 $0x02, CC1, DD1, DD0 - VPERM2I128 $0x13, AA1, BB1, AA1 - VPERM2I128 $0x13, CC1, DD1, BB1 - VPERM2I128 $0x02, AA2, BB2, CC1 - VPERM2I128 $0x02, CC2, DD2, DD1 - VPERM2I128 $0x13, AA2, BB2, AA2 - VPERM2I128 $0x13, CC2, DD2, BB2 - JMP sealAVX2ShortSeal - -// ---------------------------------------------------------------------------- -// Special optimization for the last 128 bytes of ciphertext -sealAVX2Tail128: - // Need to decrypt up to 128 bytes - prepare two blocks - // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed - // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed - VMOVDQA ·chacha20Constants<>(SB), AA0 - VMOVDQA state1StoreAVX2, BB0 - VMOVDQA state2StoreAVX2, CC0 - VMOVDQA ctr3StoreAVX2, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD0 - VMOVDQA DD0, DD1 - -sealAVX2Tail128LoopA: - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - -sealAVX2Tail128LoopB: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0) - polyAdd(0(oup)) - polyMul - VPALIGNR $4, BB0, BB0, BB0 - VPALIGNR $8, CC0, CC0, CC0 - VPALIGNR $12, DD0, DD0, DD0 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0) - polyAdd(16(oup)) - polyMul - LEAQ 32(oup), oup - VPALIGNR $12, BB0, BB0, BB0 - VPALIGNR $8, CC0, CC0, CC0 - VPALIGNR $4, DD0, DD0, DD0 - DECQ itr1 - JG sealAVX2Tail128LoopA - DECQ itr2 - JGE sealAVX2Tail128LoopB - - VPADDD ·chacha20Constants<>(SB), AA0, AA1 - VPADDD state1StoreAVX2, BB0, BB1 - VPADDD state2StoreAVX2, CC0, CC1 - VPADDD DD1, DD0, DD1 - - VPERM2I128 $0x02, AA1, BB1, AA0 - VPERM2I128 $0x02, CC1, DD1, BB0 - VPERM2I128 $0x13, AA1, BB1, CC0 - VPERM2I128 $0x13, CC1, DD1, DD0 - JMP sealAVX2ShortSealLoop - -// ---------------------------------------------------------------------------- -// Special optimization for the last 256 bytes of ciphertext -sealAVX2Tail256: - // Need to decrypt up to 256 bytes - prepare two blocks - // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed - // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed - VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA ·chacha20Constants<>(SB), AA1 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA state1StoreAVX2, BB1 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA state2StoreAVX2, CC1 - VMOVDQA ctr3StoreAVX2, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD1 - VMOVDQA DD0, TT1 - VMOVDQA DD1, TT2 - -sealAVX2Tail256LoopA: - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - -sealAVX2Tail256LoopB: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - polyAdd(0(oup)) - polyMul - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0) - polyAdd(16(oup)) - polyMul - LEAQ 32(oup), oup - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1 - DECQ itr1 - JG sealAVX2Tail256LoopA - DECQ itr2 - JGE sealAVX2Tail256LoopB - - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1 - VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1 - VPERM2I128 $0x02, AA0, BB0, TT0 - VPERM2I128 $0x02, CC0, DD0, TT1 - VPERM2I128 $0x13, AA0, BB0, TT2 - VPERM2I128 $0x13, CC0, DD0, TT3 - VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3 - VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup) - MOVQ $128, itr1 - LEAQ 128(inp), inp - SUBQ $128, inl - VPERM2I128 $0x02, AA1, BB1, AA0 - VPERM2I128 $0x02, CC1, DD1, BB0 - VPERM2I128 $0x13, AA1, BB1, CC0 - VPERM2I128 $0x13, CC1, DD1, DD0 - - JMP sealAVX2SealHash - -// ---------------------------------------------------------------------------- -// Special optimization for the last 384 bytes of ciphertext -sealAVX2Tail384: - // Need to decrypt up to 384 bytes - prepare two blocks - // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed - // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed - VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2 - VMOVDQA ctr3StoreAVX2, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2 - VMOVDQA DD0, TT1; VMOVDQA DD1, TT2; VMOVDQA DD2, TT3 - -sealAVX2Tail384LoopA: - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - -sealAVX2Tail384LoopB: - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) - polyAdd(0(oup)) - polyMul - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2 - chachaQR_AVX2(AA0, BB0, CC0, DD0, TT0); chachaQR_AVX2(AA1, BB1, CC1, DD1, TT0); chachaQR_AVX2(AA2, BB2, CC2, DD2, TT0) - polyAdd(16(oup)) - polyMul - LEAQ 32(oup), oup - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2 - DECQ itr1 - JG sealAVX2Tail384LoopA - DECQ itr2 - JGE sealAVX2Tail384LoopB - - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2 - VPADDD TT1, DD0, DD0; VPADDD TT2, DD1, DD1; VPADDD TT3, DD2, DD2 - VPERM2I128 $0x02, AA0, BB0, TT0 - VPERM2I128 $0x02, CC0, DD0, TT1 - VPERM2I128 $0x13, AA0, BB0, TT2 - VPERM2I128 $0x13, CC0, DD0, TT3 - VPXOR (0*32)(inp), TT0, TT0; VPXOR (1*32)(inp), TT1, TT1; VPXOR (2*32)(inp), TT2, TT2; VPXOR (3*32)(inp), TT3, TT3 - VMOVDQU TT0, (0*32)(oup); VMOVDQU TT1, (1*32)(oup); VMOVDQU TT2, (2*32)(oup); VMOVDQU TT3, (3*32)(oup) - VPERM2I128 $0x02, AA1, BB1, TT0 - VPERM2I128 $0x02, CC1, DD1, TT1 - VPERM2I128 $0x13, AA1, BB1, TT2 - VPERM2I128 $0x13, CC1, DD1, TT3 - VPXOR (4*32)(inp), TT0, TT0; VPXOR (5*32)(inp), TT1, TT1; VPXOR (6*32)(inp), TT2, TT2; VPXOR (7*32)(inp), TT3, TT3 - VMOVDQU TT0, (4*32)(oup); VMOVDQU TT1, (5*32)(oup); VMOVDQU TT2, (6*32)(oup); VMOVDQU TT3, (7*32)(oup) - MOVQ $256, itr1 - LEAQ 256(inp), inp - SUBQ $256, inl - VPERM2I128 $0x02, AA2, BB2, AA0 - VPERM2I128 $0x02, CC2, DD2, BB0 - VPERM2I128 $0x13, AA2, BB2, CC0 - VPERM2I128 $0x13, CC2, DD2, DD0 - - JMP sealAVX2SealHash - -// ---------------------------------------------------------------------------- -// Special optimization for the last 512 bytes of ciphertext -sealAVX2Tail512: - // Need to decrypt up to 512 bytes - prepare two blocks - // If we got here after the main loop - there are 512 encrypted bytes waiting to be hashed - // If we got here before the main loop - there are 448 encrpyred bytes waiting to be hashed - VMOVDQA ·chacha20Constants<>(SB), AA0; VMOVDQA AA0, AA1; VMOVDQA AA0, AA2; VMOVDQA AA0, AA3 - VMOVDQA state1StoreAVX2, BB0; VMOVDQA BB0, BB1; VMOVDQA BB0, BB2; VMOVDQA BB0, BB3 - VMOVDQA state2StoreAVX2, CC0; VMOVDQA CC0, CC1; VMOVDQA CC0, CC2; VMOVDQA CC0, CC3 - VMOVDQA ctr3StoreAVX2, DD0 - VPADDD ·avx2IncMask<>(SB), DD0, DD0; VPADDD ·avx2IncMask<>(SB), DD0, DD1; VPADDD ·avx2IncMask<>(SB), DD1, DD2; VPADDD ·avx2IncMask<>(SB), DD2, DD3 - VMOVDQA DD0, ctr0StoreAVX2; VMOVDQA DD1, ctr1StoreAVX2; VMOVDQA DD2, ctr2StoreAVX2; VMOVDQA DD3, ctr3StoreAVX2 - -sealAVX2Tail512LoopA: - polyAdd(0(oup)) - polyMul - LEAQ 16(oup), oup - -sealAVX2Tail512LoopB: - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - polyAdd(0*8(oup)) - polyMulAVX2 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - VPALIGNR $4, BB0, BB0, BB0; VPALIGNR $4, BB1, BB1, BB1; VPALIGNR $4, BB2, BB2, BB2; VPALIGNR $4, BB3, BB3, BB3 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 - VPALIGNR $12, DD0, DD0, DD0; VPALIGNR $12, DD1, DD1, DD1; VPALIGNR $12, DD2, DD2, DD2; VPALIGNR $12, DD3, DD3, DD3 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol16<>(SB), DD0, DD0; VPSHUFB ·rol16<>(SB), DD1, DD1; VPSHUFB ·rol16<>(SB), DD2, DD2; VPSHUFB ·rol16<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - polyAdd(2*8(oup)) - polyMulAVX2 - LEAQ (4*8)(oup), oup - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $12, BB0, CC3; VPSRLD $20, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $12, BB1, CC3; VPSRLD $20, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $12, BB2, CC3; VPSRLD $20, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $12, BB3, CC3; VPSRLD $20, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - VPADDD BB0, AA0, AA0; VPADDD BB1, AA1, AA1; VPADDD BB2, AA2, AA2; VPADDD BB3, AA3, AA3 - VPXOR AA0, DD0, DD0; VPXOR AA1, DD1, DD1; VPXOR AA2, DD2, DD2; VPXOR AA3, DD3, DD3 - VPSHUFB ·rol8<>(SB), DD0, DD0; VPSHUFB ·rol8<>(SB), DD1, DD1; VPSHUFB ·rol8<>(SB), DD2, DD2; VPSHUFB ·rol8<>(SB), DD3, DD3 - VPADDD DD0, CC0, CC0; VPADDD DD1, CC1, CC1; VPADDD DD2, CC2, CC2; VPADDD DD3, CC3, CC3 - VPXOR CC0, BB0, BB0; VPXOR CC1, BB1, BB1; VPXOR CC2, BB2, BB2; VPXOR CC3, BB3, BB3 - VMOVDQA CC3, tmpStoreAVX2 - VPSLLD $7, BB0, CC3; VPSRLD $25, BB0, BB0; VPXOR CC3, BB0, BB0 - VPSLLD $7, BB1, CC3; VPSRLD $25, BB1, BB1; VPXOR CC3, BB1, BB1 - VPSLLD $7, BB2, CC3; VPSRLD $25, BB2, BB2; VPXOR CC3, BB2, BB2 - VPSLLD $7, BB3, CC3; VPSRLD $25, BB3, BB3; VPXOR CC3, BB3, BB3 - VMOVDQA tmpStoreAVX2, CC3 - VPALIGNR $12, BB0, BB0, BB0; VPALIGNR $12, BB1, BB1, BB1; VPALIGNR $12, BB2, BB2, BB2; VPALIGNR $12, BB3, BB3, BB3 - VPALIGNR $8, CC0, CC0, CC0; VPALIGNR $8, CC1, CC1, CC1; VPALIGNR $8, CC2, CC2, CC2; VPALIGNR $8, CC3, CC3, CC3 - VPALIGNR $4, DD0, DD0, DD0; VPALIGNR $4, DD1, DD1, DD1; VPALIGNR $4, DD2, DD2, DD2; VPALIGNR $4, DD3, DD3, DD3 - - DECQ itr1 - JG sealAVX2Tail512LoopA - DECQ itr2 - JGE sealAVX2Tail512LoopB - - VPADDD ·chacha20Constants<>(SB), AA0, AA0; VPADDD ·chacha20Constants<>(SB), AA1, AA1; VPADDD ·chacha20Constants<>(SB), AA2, AA2; VPADDD ·chacha20Constants<>(SB), AA3, AA3 - VPADDD state1StoreAVX2, BB0, BB0; VPADDD state1StoreAVX2, BB1, BB1; VPADDD state1StoreAVX2, BB2, BB2; VPADDD state1StoreAVX2, BB3, BB3 - VPADDD state2StoreAVX2, CC0, CC0; VPADDD state2StoreAVX2, CC1, CC1; VPADDD state2StoreAVX2, CC2, CC2; VPADDD state2StoreAVX2, CC3, CC3 - VPADDD ctr0StoreAVX2, DD0, DD0; VPADDD ctr1StoreAVX2, DD1, DD1; VPADDD ctr2StoreAVX2, DD2, DD2; VPADDD ctr3StoreAVX2, DD3, DD3 - VMOVDQA CC3, tmpStoreAVX2 - VPERM2I128 $0x02, AA0, BB0, CC3 - VPXOR (0*32)(inp), CC3, CC3 - VMOVDQU CC3, (0*32)(oup) - VPERM2I128 $0x02, CC0, DD0, CC3 - VPXOR (1*32)(inp), CC3, CC3 - VMOVDQU CC3, (1*32)(oup) - VPERM2I128 $0x13, AA0, BB0, CC3 - VPXOR (2*32)(inp), CC3, CC3 - VMOVDQU CC3, (2*32)(oup) - VPERM2I128 $0x13, CC0, DD0, CC3 - VPXOR (3*32)(inp), CC3, CC3 - VMOVDQU CC3, (3*32)(oup) - - VPERM2I128 $0x02, AA1, BB1, AA0 - VPERM2I128 $0x02, CC1, DD1, BB0 - VPERM2I128 $0x13, AA1, BB1, CC0 - VPERM2I128 $0x13, CC1, DD1, DD0 - VPXOR (4*32)(inp), AA0, AA0; VPXOR (5*32)(inp), BB0, BB0; VPXOR (6*32)(inp), CC0, CC0; VPXOR (7*32)(inp), DD0, DD0 - VMOVDQU AA0, (4*32)(oup); VMOVDQU BB0, (5*32)(oup); VMOVDQU CC0, (6*32)(oup); VMOVDQU DD0, (7*32)(oup) - - VPERM2I128 $0x02, AA2, BB2, AA0 - VPERM2I128 $0x02, CC2, DD2, BB0 - VPERM2I128 $0x13, AA2, BB2, CC0 - VPERM2I128 $0x13, CC2, DD2, DD0 - VPXOR (8*32)(inp), AA0, AA0; VPXOR (9*32)(inp), BB0, BB0; VPXOR (10*32)(inp), CC0, CC0; VPXOR (11*32)(inp), DD0, DD0 - VMOVDQU AA0, (8*32)(oup); VMOVDQU BB0, (9*32)(oup); VMOVDQU CC0, (10*32)(oup); VMOVDQU DD0, (11*32)(oup) - - MOVQ $384, itr1 - LEAQ 384(inp), inp - SUBQ $384, inl - VPERM2I128 $0x02, AA3, BB3, AA0 - VPERM2I128 $0x02, tmpStoreAVX2, DD3, BB0 - VPERM2I128 $0x13, AA3, BB3, CC0 - VPERM2I128 $0x13, tmpStoreAVX2, DD3, DD0 - - JMP sealAVX2SealHash diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go deleted file mode 100644 index 6313898f0a75..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package chacha20poly1305 - -import ( - "encoding/binary" - - "golang.org/x/crypto/chacha20" - "golang.org/x/crypto/internal/alias" - "golang.org/x/crypto/internal/poly1305" -) - -func writeWithPadding(p *poly1305.MAC, b []byte) { - p.Write(b) - if rem := len(b) % 16; rem != 0 { - var buf [16]byte - padLen := 16 - rem - p.Write(buf[:padLen]) - } -} - -func writeUint64(p *poly1305.MAC, n int) { - var buf [8]byte - binary.LittleEndian.PutUint64(buf[:], uint64(n)) - p.Write(buf[:]) -} - -func (c *chacha20poly1305) sealGeneric(dst, nonce, plaintext, additionalData []byte) []byte { - ret, out := sliceForAppend(dst, len(plaintext)+poly1305.TagSize) - ciphertext, tag := out[:len(plaintext)], out[len(plaintext):] - if alias.InexactOverlap(out, plaintext) { - panic("chacha20poly1305: invalid buffer overlap") - } - - var polyKey [32]byte - s, _ := chacha20.NewUnauthenticatedCipher(c.key[:], nonce) - s.XORKeyStream(polyKey[:], polyKey[:]) - s.SetCounter(1) // set the counter to 1, skipping 32 bytes - s.XORKeyStream(ciphertext, plaintext) - - p := poly1305.New(&polyKey) - writeWithPadding(p, additionalData) - writeWithPadding(p, ciphertext) - writeUint64(p, len(additionalData)) - writeUint64(p, len(plaintext)) - p.Sum(tag[:0]) - - return ret -} - -func (c *chacha20poly1305) openGeneric(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { - tag := ciphertext[len(ciphertext)-16:] - ciphertext = ciphertext[:len(ciphertext)-16] - - var polyKey [32]byte - s, _ := chacha20.NewUnauthenticatedCipher(c.key[:], nonce) - s.XORKeyStream(polyKey[:], polyKey[:]) - s.SetCounter(1) // set the counter to 1, skipping 32 bytes - - p := poly1305.New(&polyKey) - writeWithPadding(p, additionalData) - writeWithPadding(p, ciphertext) - writeUint64(p, len(additionalData)) - writeUint64(p, len(ciphertext)) - - ret, out := sliceForAppend(dst, len(ciphertext)) - if alias.InexactOverlap(out, ciphertext) { - panic("chacha20poly1305: invalid buffer overlap") - } - if !p.Verify(tag) { - for i := range out { - out[i] = 0 - } - return nil, errOpen - } - - s.XORKeyStream(out, ciphertext) - return ret, nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go deleted file mode 100644 index f832b33d45f2..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !amd64 || !gc || purego -// +build !amd64 !gc purego - -package chacha20poly1305 - -func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { - return c.sealGeneric(dst, nonce, plaintext, additionalData) -} - -func (c *chacha20poly1305) open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { - return c.openGeneric(dst, nonce, ciphertext, additionalData) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/xchacha20poly1305.go b/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/xchacha20poly1305.go deleted file mode 100644 index 1cebfe946f44..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/chacha20poly1305/xchacha20poly1305.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package chacha20poly1305 - -import ( - "crypto/cipher" - "errors" - - "golang.org/x/crypto/chacha20" -) - -type xchacha20poly1305 struct { - key [KeySize]byte -} - -// NewX returns a XChaCha20-Poly1305 AEAD that uses the given 256-bit key. -// -// XChaCha20-Poly1305 is a ChaCha20-Poly1305 variant that takes a longer nonce, -// suitable to be generated randomly without risk of collisions. It should be -// preferred when nonce uniqueness cannot be trivially ensured, or whenever -// nonces are randomly generated. -func NewX(key []byte) (cipher.AEAD, error) { - if len(key) != KeySize { - return nil, errors.New("chacha20poly1305: bad key length") - } - ret := new(xchacha20poly1305) - copy(ret.key[:], key) - return ret, nil -} - -func (*xchacha20poly1305) NonceSize() int { - return NonceSizeX -} - -func (*xchacha20poly1305) Overhead() int { - return Overhead -} - -func (x *xchacha20poly1305) Seal(dst, nonce, plaintext, additionalData []byte) []byte { - if len(nonce) != NonceSizeX { - panic("chacha20poly1305: bad nonce length passed to Seal") - } - - // XChaCha20-Poly1305 technically supports a 64-bit counter, so there is no - // size limit. However, since we reuse the ChaCha20-Poly1305 implementation, - // the second half of the counter is not available. This is unlikely to be - // an issue because the cipher.AEAD API requires the entire message to be in - // memory, and the counter overflows at 256 GB. - if uint64(len(plaintext)) > (1<<38)-64 { - panic("chacha20poly1305: plaintext too large") - } - - c := new(chacha20poly1305) - hKey, _ := chacha20.HChaCha20(x.key[:], nonce[0:16]) - copy(c.key[:], hKey) - - // The first 4 bytes of the final nonce are unused counter space. - cNonce := make([]byte, NonceSize) - copy(cNonce[4:12], nonce[16:24]) - - return c.seal(dst, cNonce[:], plaintext, additionalData) -} - -func (x *xchacha20poly1305) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { - if len(nonce) != NonceSizeX { - panic("chacha20poly1305: bad nonce length passed to Open") - } - if len(ciphertext) < 16 { - return nil, errOpen - } - if uint64(len(ciphertext)) > (1<<38)-48 { - panic("chacha20poly1305: ciphertext too large") - } - - c := new(chacha20poly1305) - hKey, _ := chacha20.HChaCha20(x.key[:], nonce[0:16]) - copy(c.key[:], hKey) - - // The first 4 bytes of the final nonce are unused counter space. - cNonce := make([]byte, NonceSize) - copy(cNonce[4:12], nonce[16:24]) - - return c.open(dst, cNonce[:], ciphertext, additionalData) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/hkdf/hkdf.go b/cluster-autoscaler/vendor/golang.org/x/crypto/hkdf/hkdf.go deleted file mode 100644 index dda3f143bec5..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/hkdf/hkdf.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package hkdf implements the HMAC-based Extract-and-Expand Key Derivation -// Function (HKDF) as defined in RFC 5869. -// -// HKDF is a cryptographic key derivation function (KDF) with the goal of -// expanding limited input keying material into one or more cryptographically -// strong secret keys. -package hkdf // import "golang.org/x/crypto/hkdf" - -import ( - "crypto/hmac" - "errors" - "hash" - "io" -) - -// Extract generates a pseudorandom key for use with Expand from an input secret -// and an optional independent salt. -// -// Only use this function if you need to reuse the extracted key with multiple -// Expand invocations and different context values. Most common scenarios, -// including the generation of multiple keys, should use New instead. -func Extract(hash func() hash.Hash, secret, salt []byte) []byte { - if salt == nil { - salt = make([]byte, hash().Size()) - } - extractor := hmac.New(hash, salt) - extractor.Write(secret) - return extractor.Sum(nil) -} - -type hkdf struct { - expander hash.Hash - size int - - info []byte - counter byte - - prev []byte - buf []byte -} - -func (f *hkdf) Read(p []byte) (int, error) { - // Check whether enough data can be generated - need := len(p) - remains := len(f.buf) + int(255-f.counter+1)*f.size - if remains < need { - return 0, errors.New("hkdf: entropy limit reached") - } - // Read any leftover from the buffer - n := copy(p, f.buf) - p = p[n:] - - // Fill the rest of the buffer - for len(p) > 0 { - f.expander.Reset() - f.expander.Write(f.prev) - f.expander.Write(f.info) - f.expander.Write([]byte{f.counter}) - f.prev = f.expander.Sum(f.prev[:0]) - f.counter++ - - // Copy the new batch into p - f.buf = f.prev - n = copy(p, f.buf) - p = p[n:] - } - // Save leftovers for next run - f.buf = f.buf[n:] - - return need, nil -} - -// Expand returns a Reader, from which keys can be read, using the given -// pseudorandom key and optional context info, skipping the extraction step. -// -// The pseudorandomKey should have been generated by Extract, or be a uniformly -// random or pseudorandom cryptographically strong key. See RFC 5869, Section -// 3.3. Most common scenarios will want to use New instead. -func Expand(hash func() hash.Hash, pseudorandomKey, info []byte) io.Reader { - expander := hmac.New(hash, pseudorandomKey) - return &hkdf{expander, expander.Size(), info, 1, nil, nil} -} - -// New returns a Reader, from which keys can be read, using the given hash, -// secret, salt and context info. Salt and info can be nil. -func New(hash func() hash.Hash, secret, salt, info []byte) io.Reader { - prk := Extract(hash, secret, salt) - return Expand(hash, prk, info) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/mod/LICENSE b/cluster-autoscaler/vendor/golang.org/x/mod/LICENSE deleted file mode 100644 index 6a66aea5eafe..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/mod/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cluster-autoscaler/vendor/golang.org/x/mod/PATENTS b/cluster-autoscaler/vendor/golang.org/x/mod/PATENTS deleted file mode 100644 index 733099041f84..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/mod/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/cluster-autoscaler/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go b/cluster-autoscaler/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go deleted file mode 100644 index 150f887e7a4b..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/mod/internal/lazyregexp/lazyre.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package lazyregexp is a thin wrapper over regexp, allowing the use of global -// regexp variables without forcing them to be compiled at init. -package lazyregexp - -import ( - "os" - "regexp" - "strings" - "sync" -) - -// Regexp is a wrapper around [regexp.Regexp], where the underlying regexp will be -// compiled the first time it is needed. -type Regexp struct { - str string - once sync.Once - rx *regexp.Regexp -} - -func (r *Regexp) re() *regexp.Regexp { - r.once.Do(r.build) - return r.rx -} - -func (r *Regexp) build() { - r.rx = regexp.MustCompile(r.str) - r.str = "" -} - -func (r *Regexp) FindSubmatch(s []byte) [][]byte { - return r.re().FindSubmatch(s) -} - -func (r *Regexp) FindStringSubmatch(s string) []string { - return r.re().FindStringSubmatch(s) -} - -func (r *Regexp) FindStringSubmatchIndex(s string) []int { - return r.re().FindStringSubmatchIndex(s) -} - -func (r *Regexp) ReplaceAllString(src, repl string) string { - return r.re().ReplaceAllString(src, repl) -} - -func (r *Regexp) FindString(s string) string { - return r.re().FindString(s) -} - -func (r *Regexp) FindAllString(s string, n int) []string { - return r.re().FindAllString(s, n) -} - -func (r *Regexp) MatchString(s string) bool { - return r.re().MatchString(s) -} - -func (r *Regexp) SubexpNames() []string { - return r.re().SubexpNames() -} - -var inTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test") - -// New creates a new lazy regexp, delaying the compiling work until it is first -// needed. If the code is being run as part of tests, the regexp compiling will -// happen immediately. -func New(str string) *Regexp { - lr := &Regexp{str: str} - if inTest { - // In tests, always compile the regexps early. - lr.re() - } - return lr -} diff --git a/cluster-autoscaler/vendor/golang.org/x/mod/module/module.go b/cluster-autoscaler/vendor/golang.org/x/mod/module/module.go deleted file mode 100644 index 2a364b229b9f..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/mod/module/module.go +++ /dev/null @@ -1,841 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package module defines the module.Version type along with support code. -// -// The [module.Version] type is a simple Path, Version pair: -// -// type Version struct { -// Path string -// Version string -// } -// -// There are no restrictions imposed directly by use of this structure, -// but additional checking functions, most notably [Check], verify that -// a particular path, version pair is valid. -// -// # Escaped Paths -// -// Module paths appear as substrings of file system paths -// (in the download cache) and of web server URLs in the proxy protocol. -// In general we cannot rely on file systems to be case-sensitive, -// nor can we rely on web servers, since they read from file systems. -// That is, we cannot rely on the file system to keep rsc.io/QUOTE -// and rsc.io/quote separate. Windows and macOS don't. -// Instead, we must never require two different casings of a file path. -// Because we want the download cache to match the proxy protocol, -// and because we want the proxy protocol to be possible to serve -// from a tree of static files (which might be stored on a case-insensitive -// file system), the proxy protocol must never require two different casings -// of a URL path either. -// -// One possibility would be to make the escaped form be the lowercase -// hexadecimal encoding of the actual path bytes. This would avoid ever -// needing different casings of a file path, but it would be fairly illegible -// to most programmers when those paths appeared in the file system -// (including in file paths in compiler errors and stack traces) -// in web server logs, and so on. Instead, we want a safe escaped form that -// leaves most paths unaltered. -// -// The safe escaped form is to replace every uppercase letter -// with an exclamation mark followed by the letter's lowercase equivalent. -// -// For example, -// -// github.com/Azure/azure-sdk-for-go -> github.com/!azure/azure-sdk-for-go. -// github.com/GoogleCloudPlatform/cloudsql-proxy -> github.com/!google!cloud!platform/cloudsql-proxy -// github.com/Sirupsen/logrus -> github.com/!sirupsen/logrus. -// -// Import paths that avoid upper-case letters are left unchanged. -// Note that because import paths are ASCII-only and avoid various -// problematic punctuation (like : < and >), the escaped form is also ASCII-only -// and avoids the same problematic punctuation. -// -// Import paths have never allowed exclamation marks, so there is no -// need to define how to escape a literal !. -// -// # Unicode Restrictions -// -// Today, paths are disallowed from using Unicode. -// -// Although paths are currently disallowed from using Unicode, -// we would like at some point to allow Unicode letters as well, to assume that -// file systems and URLs are Unicode-safe (storing UTF-8), and apply -// the !-for-uppercase convention for escaping them in the file system. -// But there are at least two subtle considerations. -// -// First, note that not all case-fold equivalent distinct runes -// form an upper/lower pair. -// For example, U+004B ('K'), U+006B ('k'), and U+212A ('K' for Kelvin) -// are three distinct runes that case-fold to each other. -// When we do add Unicode letters, we must not assume that upper/lower -// are the only case-equivalent pairs. -// Perhaps the Kelvin symbol would be disallowed entirely, for example. -// Or perhaps it would escape as "!!k", or perhaps as "(212A)". -// -// Second, it would be nice to allow Unicode marks as well as letters, -// but marks include combining marks, and then we must deal not -// only with case folding but also normalization: both U+00E9 ('é') -// and U+0065 U+0301 ('e' followed by combining acute accent) -// look the same on the page and are treated by some file systems -// as the same path. If we do allow Unicode marks in paths, there -// must be some kind of normalization to allow only one canonical -// encoding of any character used in an import path. -package module - -// IMPORTANT NOTE -// -// This file essentially defines the set of valid import paths for the go command. -// There are many subtle considerations, including Unicode ambiguity, -// security, network, and file system representations. -// -// This file also defines the set of valid module path and version combinations, -// another topic with many subtle considerations. -// -// Changes to the semantics in this file require approval from rsc. - -import ( - "errors" - "fmt" - "path" - "sort" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/mod/semver" -) - -// A Version (for clients, a module.Version) is defined by a module path and version pair. -// These are stored in their plain (unescaped) form. -type Version struct { - // Path is a module path, like "golang.org/x/text" or "rsc.io/quote/v2". - Path string - - // Version is usually a semantic version in canonical form. - // There are three exceptions to this general rule. - // First, the top-level target of a build has no specific version - // and uses Version = "". - // Second, during MVS calculations the version "none" is used - // to represent the decision to take no version of a given module. - // Third, filesystem paths found in "replace" directives are - // represented by a path with an empty version. - Version string `json:",omitempty"` -} - -// String returns a representation of the Version suitable for logging -// (Path@Version, or just Path if Version is empty). -func (m Version) String() string { - if m.Version == "" { - return m.Path - } - return m.Path + "@" + m.Version -} - -// A ModuleError indicates an error specific to a module. -type ModuleError struct { - Path string - Version string - Err error -} - -// VersionError returns a [ModuleError] derived from a [Version] and error, -// or err itself if it is already such an error. -func VersionError(v Version, err error) error { - var mErr *ModuleError - if errors.As(err, &mErr) && mErr.Path == v.Path && mErr.Version == v.Version { - return err - } - return &ModuleError{ - Path: v.Path, - Version: v.Version, - Err: err, - } -} - -func (e *ModuleError) Error() string { - if v, ok := e.Err.(*InvalidVersionError); ok { - return fmt.Sprintf("%s@%s: invalid %s: %v", e.Path, v.Version, v.noun(), v.Err) - } - if e.Version != "" { - return fmt.Sprintf("%s@%s: %v", e.Path, e.Version, e.Err) - } - return fmt.Sprintf("module %s: %v", e.Path, e.Err) -} - -func (e *ModuleError) Unwrap() error { return e.Err } - -// An InvalidVersionError indicates an error specific to a version, with the -// module path unknown or specified externally. -// -// A [ModuleError] may wrap an InvalidVersionError, but an InvalidVersionError -// must not wrap a ModuleError. -type InvalidVersionError struct { - Version string - Pseudo bool - Err error -} - -// noun returns either "version" or "pseudo-version", depending on whether -// e.Version is a pseudo-version. -func (e *InvalidVersionError) noun() string { - if e.Pseudo { - return "pseudo-version" - } - return "version" -} - -func (e *InvalidVersionError) Error() string { - return fmt.Sprintf("%s %q invalid: %s", e.noun(), e.Version, e.Err) -} - -func (e *InvalidVersionError) Unwrap() error { return e.Err } - -// An InvalidPathError indicates a module, import, or file path doesn't -// satisfy all naming constraints. See [CheckPath], [CheckImportPath], -// and [CheckFilePath] for specific restrictions. -type InvalidPathError struct { - Kind string // "module", "import", or "file" - Path string - Err error -} - -func (e *InvalidPathError) Error() string { - return fmt.Sprintf("malformed %s path %q: %v", e.Kind, e.Path, e.Err) -} - -func (e *InvalidPathError) Unwrap() error { return e.Err } - -// Check checks that a given module path, version pair is valid. -// In addition to the path being a valid module path -// and the version being a valid semantic version, -// the two must correspond. -// For example, the path "yaml/v2" only corresponds to -// semantic versions beginning with "v2.". -func Check(path, version string) error { - if err := CheckPath(path); err != nil { - return err - } - if !semver.IsValid(version) { - return &ModuleError{ - Path: path, - Err: &InvalidVersionError{Version: version, Err: errors.New("not a semantic version")}, - } - } - _, pathMajor, _ := SplitPathVersion(path) - if err := CheckPathMajor(version, pathMajor); err != nil { - return &ModuleError{Path: path, Err: err} - } - return nil -} - -// firstPathOK reports whether r can appear in the first element of a module path. -// The first element of the path must be an LDH domain name, at least for now. -// To avoid case ambiguity, the domain name must be entirely lower case. -func firstPathOK(r rune) bool { - return r == '-' || r == '.' || - '0' <= r && r <= '9' || - 'a' <= r && r <= 'z' -} - -// modPathOK reports whether r can appear in a module path element. -// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~. -// -// This matches what "go get" has historically recognized in import paths, -// and avoids confusing sequences like '%20' or '+' that would change meaning -// if used in a URL. -// -// TODO(rsc): We would like to allow Unicode letters, but that requires additional -// care in the safe encoding (see "escaped paths" above). -func modPathOK(r rune) bool { - if r < utf8.RuneSelf { - return r == '-' || r == '.' || r == '_' || r == '~' || - '0' <= r && r <= '9' || - 'A' <= r && r <= 'Z' || - 'a' <= r && r <= 'z' - } - return false -} - -// importPathOK reports whether r can appear in a package import path element. -// -// Import paths are intermediate between module paths and file paths: we allow -// disallow characters that would be confusing or ambiguous as arguments to -// 'go get' (such as '@' and ' ' ), but allow certain characters that are -// otherwise-unambiguous on the command line and historically used for some -// binary names (such as '++' as a suffix for compiler binaries and wrappers). -func importPathOK(r rune) bool { - return modPathOK(r) || r == '+' -} - -// fileNameOK reports whether r can appear in a file name. -// For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters. -// If we expand the set of allowed characters here, we have to -// work harder at detecting potential case-folding and normalization collisions. -// See note about "escaped paths" above. -func fileNameOK(r rune) bool { - if r < utf8.RuneSelf { - // Entire set of ASCII punctuation, from which we remove characters: - // ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ - // We disallow some shell special characters: " ' * < > ? ` | - // (Note that some of those are disallowed by the Windows file system as well.) - // We also disallow path separators / : and \ (fileNameOK is only called on path element characters). - // We allow spaces (U+0020) in file names. - const allowed = "!#$%&()+,-.=@[]^_{}~ " - if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' { - return true - } - return strings.ContainsRune(allowed, r) - } - // It may be OK to add more ASCII punctuation here, but only carefully. - // For example Windows disallows < > \, and macOS disallows :, so we must not allow those. - return unicode.IsLetter(r) -} - -// CheckPath checks that a module path is valid. -// A valid module path is a valid import path, as checked by [CheckImportPath], -// with three additional constraints. -// First, the leading path element (up to the first slash, if any), -// by convention a domain name, must contain only lower-case ASCII letters, -// ASCII digits, dots (U+002E), and dashes (U+002D); -// it must contain at least one dot and cannot start with a dash. -// Second, for a final path element of the form /vN, where N looks numeric -// (ASCII digits and dots) must not begin with a leading zero, must not be /v1, -// and must not contain any dots. For paths beginning with "gopkg.in/", -// this second requirement is replaced by a requirement that the path -// follow the gopkg.in server's conventions. -// Third, no path element may begin with a dot. -func CheckPath(path string) (err error) { - defer func() { - if err != nil { - err = &InvalidPathError{Kind: "module", Path: path, Err: err} - } - }() - - if err := checkPath(path, modulePath); err != nil { - return err - } - i := strings.Index(path, "/") - if i < 0 { - i = len(path) - } - if i == 0 { - return fmt.Errorf("leading slash") - } - if !strings.Contains(path[:i], ".") { - return fmt.Errorf("missing dot in first path element") - } - if path[0] == '-' { - return fmt.Errorf("leading dash in first path element") - } - for _, r := range path[:i] { - if !firstPathOK(r) { - return fmt.Errorf("invalid char %q in first path element", r) - } - } - if _, _, ok := SplitPathVersion(path); !ok { - return fmt.Errorf("invalid version") - } - return nil -} - -// CheckImportPath checks that an import path is valid. -// -// A valid import path consists of one or more valid path elements -// separated by slashes (U+002F). (It must not begin with nor end in a slash.) -// -// A valid path element is a non-empty string made up of -// ASCII letters, ASCII digits, and limited ASCII punctuation: - . _ and ~. -// It must not end with a dot (U+002E), nor contain two dots in a row. -// -// The element prefix up to the first dot must not be a reserved file name -// on Windows, regardless of case (CON, com1, NuL, and so on). The element -// must not have a suffix of a tilde followed by one or more ASCII digits -// (to exclude paths elements that look like Windows short-names). -// -// CheckImportPath may be less restrictive in the future, but see the -// top-level package documentation for additional information about -// subtleties of Unicode. -func CheckImportPath(path string) error { - if err := checkPath(path, importPath); err != nil { - return &InvalidPathError{Kind: "import", Path: path, Err: err} - } - return nil -} - -// pathKind indicates what kind of path we're checking. Module paths, -// import paths, and file paths have different restrictions. -type pathKind int - -const ( - modulePath pathKind = iota - importPath - filePath -) - -// checkPath checks that a general path is valid. kind indicates what -// specific constraints should be applied. -// -// checkPath returns an error describing why the path is not valid. -// Because these checks apply to module, import, and file paths, -// and because other checks may be applied, the caller is expected to wrap -// this error with [InvalidPathError]. -func checkPath(path string, kind pathKind) error { - if !utf8.ValidString(path) { - return fmt.Errorf("invalid UTF-8") - } - if path == "" { - return fmt.Errorf("empty string") - } - if path[0] == '-' && kind != filePath { - return fmt.Errorf("leading dash") - } - if strings.Contains(path, "//") { - return fmt.Errorf("double slash") - } - if path[len(path)-1] == '/' { - return fmt.Errorf("trailing slash") - } - elemStart := 0 - for i, r := range path { - if r == '/' { - if err := checkElem(path[elemStart:i], kind); err != nil { - return err - } - elemStart = i + 1 - } - } - if err := checkElem(path[elemStart:], kind); err != nil { - return err - } - return nil -} - -// checkElem checks whether an individual path element is valid. -func checkElem(elem string, kind pathKind) error { - if elem == "" { - return fmt.Errorf("empty path element") - } - if strings.Count(elem, ".") == len(elem) { - return fmt.Errorf("invalid path element %q", elem) - } - if elem[0] == '.' && kind == modulePath { - return fmt.Errorf("leading dot in path element") - } - if elem[len(elem)-1] == '.' { - return fmt.Errorf("trailing dot in path element") - } - for _, r := range elem { - ok := false - switch kind { - case modulePath: - ok = modPathOK(r) - case importPath: - ok = importPathOK(r) - case filePath: - ok = fileNameOK(r) - default: - panic(fmt.Sprintf("internal error: invalid kind %v", kind)) - } - if !ok { - return fmt.Errorf("invalid char %q", r) - } - } - - // Windows disallows a bunch of path elements, sadly. - // See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file - short := elem - if i := strings.Index(short, "."); i >= 0 { - short = short[:i] - } - for _, bad := range badWindowsNames { - if strings.EqualFold(bad, short) { - return fmt.Errorf("%q disallowed as path element component on Windows", short) - } - } - - if kind == filePath { - // don't check for Windows short-names in file names. They're - // only an issue for import paths. - return nil - } - - // Reject path components that look like Windows short-names. - // Those usually end in a tilde followed by one or more ASCII digits. - if tilde := strings.LastIndexByte(short, '~'); tilde >= 0 && tilde < len(short)-1 { - suffix := short[tilde+1:] - suffixIsDigits := true - for _, r := range suffix { - if r < '0' || r > '9' { - suffixIsDigits = false - break - } - } - if suffixIsDigits { - return fmt.Errorf("trailing tilde and digits in path element") - } - } - - return nil -} - -// CheckFilePath checks that a slash-separated file path is valid. -// The definition of a valid file path is the same as the definition -// of a valid import path except that the set of allowed characters is larger: -// all Unicode letters, ASCII digits, the ASCII space character (U+0020), -// and the ASCII punctuation characters -// “!#$%&()+,-.=@[]^_{}~”. -// (The excluded punctuation characters, " * < > ? ` ' | / \ and :, -// have special meanings in certain shells or operating systems.) -// -// CheckFilePath may be less restrictive in the future, but see the -// top-level package documentation for additional information about -// subtleties of Unicode. -func CheckFilePath(path string) error { - if err := checkPath(path, filePath); err != nil { - return &InvalidPathError{Kind: "file", Path: path, Err: err} - } - return nil -} - -// badWindowsNames are the reserved file path elements on Windows. -// See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file -var badWindowsNames = []string{ - "CON", - "PRN", - "AUX", - "NUL", - "COM1", - "COM2", - "COM3", - "COM4", - "COM5", - "COM6", - "COM7", - "COM8", - "COM9", - "LPT1", - "LPT2", - "LPT3", - "LPT4", - "LPT5", - "LPT6", - "LPT7", - "LPT8", - "LPT9", -} - -// SplitPathVersion returns prefix and major version such that prefix+pathMajor == path -// and version is either empty or "/vN" for N >= 2. -// As a special case, gopkg.in paths are recognized directly; -// they require ".vN" instead of "/vN", and for all N, not just N >= 2. -// SplitPathVersion returns with ok = false when presented with -// a path whose last path element does not satisfy the constraints -// applied by [CheckPath], such as "example.com/pkg/v1" or "example.com/pkg/v1.2". -func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) { - if strings.HasPrefix(path, "gopkg.in/") { - return splitGopkgIn(path) - } - - i := len(path) - dot := false - for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9' || path[i-1] == '.') { - if path[i-1] == '.' { - dot = true - } - i-- - } - if i <= 1 || i == len(path) || path[i-1] != 'v' || path[i-2] != '/' { - return path, "", true - } - prefix, pathMajor = path[:i-2], path[i-2:] - if dot || len(pathMajor) <= 2 || pathMajor[2] == '0' || pathMajor == "/v1" { - return path, "", false - } - return prefix, pathMajor, true -} - -// splitGopkgIn is like SplitPathVersion but only for gopkg.in paths. -func splitGopkgIn(path string) (prefix, pathMajor string, ok bool) { - if !strings.HasPrefix(path, "gopkg.in/") { - return path, "", false - } - i := len(path) - if strings.HasSuffix(path, "-unstable") { - i -= len("-unstable") - } - for i > 0 && ('0' <= path[i-1] && path[i-1] <= '9') { - i-- - } - if i <= 1 || path[i-1] != 'v' || path[i-2] != '.' { - // All gopkg.in paths must end in vN for some N. - return path, "", false - } - prefix, pathMajor = path[:i-2], path[i-2:] - if len(pathMajor) <= 2 || pathMajor[2] == '0' && pathMajor != ".v0" { - return path, "", false - } - return prefix, pathMajor, true -} - -// MatchPathMajor reports whether the semantic version v -// matches the path major version pathMajor. -// -// MatchPathMajor returns true if and only if [CheckPathMajor] returns nil. -func MatchPathMajor(v, pathMajor string) bool { - return CheckPathMajor(v, pathMajor) == nil -} - -// CheckPathMajor returns a non-nil error if the semantic version v -// does not match the path major version pathMajor. -func CheckPathMajor(v, pathMajor string) error { - // TODO(jayconrod): return errors or panic for invalid inputs. This function - // (and others) was covered by integration tests for cmd/go, and surrounding - // code protected against invalid inputs like non-canonical versions. - if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { - pathMajor = strings.TrimSuffix(pathMajor, "-unstable") - } - if strings.HasPrefix(v, "v0.0.0-") && pathMajor == ".v1" { - // Allow old bug in pseudo-versions that generated v0.0.0- pseudoversion for gopkg .v1. - // For example, gopkg.in/yaml.v2@v2.2.1's go.mod requires gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405. - return nil - } - m := semver.Major(v) - if pathMajor == "" { - if m == "v0" || m == "v1" || semver.Build(v) == "+incompatible" { - return nil - } - pathMajor = "v0 or v1" - } else if pathMajor[0] == '/' || pathMajor[0] == '.' { - if m == pathMajor[1:] { - return nil - } - pathMajor = pathMajor[1:] - } - return &InvalidVersionError{ - Version: v, - Err: fmt.Errorf("should be %s, not %s", pathMajor, semver.Major(v)), - } -} - -// PathMajorPrefix returns the major-version tag prefix implied by pathMajor. -// An empty PathMajorPrefix allows either v0 or v1. -// -// Note that [MatchPathMajor] may accept some versions that do not actually begin -// with this prefix: namely, it accepts a 'v0.0.0-' prefix for a '.v1' -// pathMajor, even though that pathMajor implies 'v1' tagging. -func PathMajorPrefix(pathMajor string) string { - if pathMajor == "" { - return "" - } - if pathMajor[0] != '/' && pathMajor[0] != '.' { - panic("pathMajor suffix " + pathMajor + " passed to PathMajorPrefix lacks separator") - } - if strings.HasPrefix(pathMajor, ".v") && strings.HasSuffix(pathMajor, "-unstable") { - pathMajor = strings.TrimSuffix(pathMajor, "-unstable") - } - m := pathMajor[1:] - if m != semver.Major(m) { - panic("pathMajor suffix " + pathMajor + "passed to PathMajorPrefix is not a valid major version") - } - return m -} - -// CanonicalVersion returns the canonical form of the version string v. -// It is the same as [semver.Canonical] except that it preserves the special build suffix "+incompatible". -func CanonicalVersion(v string) string { - cv := semver.Canonical(v) - if semver.Build(v) == "+incompatible" { - cv += "+incompatible" - } - return cv -} - -// Sort sorts the list by Path, breaking ties by comparing [Version] fields. -// The Version fields are interpreted as semantic versions (using [semver.Compare]) -// optionally followed by a tie-breaking suffix introduced by a slash character, -// like in "v0.0.1/go.mod". -func Sort(list []Version) { - sort.Slice(list, func(i, j int) bool { - mi := list[i] - mj := list[j] - if mi.Path != mj.Path { - return mi.Path < mj.Path - } - // To help go.sum formatting, allow version/file. - // Compare semver prefix by semver rules, - // file by string order. - vi := mi.Version - vj := mj.Version - var fi, fj string - if k := strings.Index(vi, "/"); k >= 0 { - vi, fi = vi[:k], vi[k:] - } - if k := strings.Index(vj, "/"); k >= 0 { - vj, fj = vj[:k], vj[k:] - } - if vi != vj { - return semver.Compare(vi, vj) < 0 - } - return fi < fj - }) -} - -// EscapePath returns the escaped form of the given module path. -// It fails if the module path is invalid. -func EscapePath(path string) (escaped string, err error) { - if err := CheckPath(path); err != nil { - return "", err - } - - return escapeString(path) -} - -// EscapeVersion returns the escaped form of the given module version. -// Versions are allowed to be in non-semver form but must be valid file names -// and not contain exclamation marks. -func EscapeVersion(v string) (escaped string, err error) { - if err := checkElem(v, filePath); err != nil || strings.Contains(v, "!") { - return "", &InvalidVersionError{ - Version: v, - Err: fmt.Errorf("disallowed version string"), - } - } - return escapeString(v) -} - -func escapeString(s string) (escaped string, err error) { - haveUpper := false - for _, r := range s { - if r == '!' || r >= utf8.RuneSelf { - // This should be disallowed by CheckPath, but diagnose anyway. - // The correctness of the escaping loop below depends on it. - return "", fmt.Errorf("internal error: inconsistency in EscapePath") - } - if 'A' <= r && r <= 'Z' { - haveUpper = true - } - } - - if !haveUpper { - return s, nil - } - - var buf []byte - for _, r := range s { - if 'A' <= r && r <= 'Z' { - buf = append(buf, '!', byte(r+'a'-'A')) - } else { - buf = append(buf, byte(r)) - } - } - return string(buf), nil -} - -// UnescapePath returns the module path for the given escaped path. -// It fails if the escaped path is invalid or describes an invalid path. -func UnescapePath(escaped string) (path string, err error) { - path, ok := unescapeString(escaped) - if !ok { - return "", fmt.Errorf("invalid escaped module path %q", escaped) - } - if err := CheckPath(path); err != nil { - return "", fmt.Errorf("invalid escaped module path %q: %v", escaped, err) - } - return path, nil -} - -// UnescapeVersion returns the version string for the given escaped version. -// It fails if the escaped form is invalid or describes an invalid version. -// Versions are allowed to be in non-semver form but must be valid file names -// and not contain exclamation marks. -func UnescapeVersion(escaped string) (v string, err error) { - v, ok := unescapeString(escaped) - if !ok { - return "", fmt.Errorf("invalid escaped version %q", escaped) - } - if err := checkElem(v, filePath); err != nil { - return "", fmt.Errorf("invalid escaped version %q: %v", v, err) - } - return v, nil -} - -func unescapeString(escaped string) (string, bool) { - var buf []byte - - bang := false - for _, r := range escaped { - if r >= utf8.RuneSelf { - return "", false - } - if bang { - bang = false - if r < 'a' || 'z' < r { - return "", false - } - buf = append(buf, byte(r+'A'-'a')) - continue - } - if r == '!' { - bang = true - continue - } - if 'A' <= r && r <= 'Z' { - return "", false - } - buf = append(buf, byte(r)) - } - if bang { - return "", false - } - return string(buf), true -} - -// MatchPrefixPatterns reports whether any path prefix of target matches one of -// the glob patterns (as defined by [path.Match]) in the comma-separated globs -// list. This implements the algorithm used when matching a module path to the -// GOPRIVATE environment variable, as described by 'go help module-private'. -// -// It ignores any empty or malformed patterns in the list. -// Trailing slashes on patterns are ignored. -func MatchPrefixPatterns(globs, target string) bool { - for globs != "" { - // Extract next non-empty glob in comma-separated list. - var glob string - if i := strings.Index(globs, ","); i >= 0 { - glob, globs = globs[:i], globs[i+1:] - } else { - glob, globs = globs, "" - } - glob = strings.TrimSuffix(glob, "/") - if glob == "" { - continue - } - - // A glob with N+1 path elements (N slashes) needs to be matched - // against the first N+1 path elements of target, - // which end just before the N+1'th slash. - n := strings.Count(glob, "/") - prefix := target - // Walk target, counting slashes, truncating at the N+1'th slash. - for i := 0; i < len(target); i++ { - if target[i] == '/' { - if n == 0 { - prefix = target[:i] - break - } - n-- - } - } - if n > 0 { - // Not enough prefix elements. - continue - } - matched, _ := path.Match(glob, prefix) - if matched { - return true - } - } - return false -} diff --git a/cluster-autoscaler/vendor/golang.org/x/mod/module/pseudo.go b/cluster-autoscaler/vendor/golang.org/x/mod/module/pseudo.go deleted file mode 100644 index 9cf19d3254eb..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/mod/module/pseudo.go +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Pseudo-versions -// -// Code authors are expected to tag the revisions they want users to use, -// including prereleases. However, not all authors tag versions at all, -// and not all commits a user might want to try will have tags. -// A pseudo-version is a version with a special form that allows us to -// address an untagged commit and order that version with respect to -// other versions we might encounter. -// -// A pseudo-version takes one of the general forms: -// -// (1) vX.0.0-yyyymmddhhmmss-abcdef123456 -// (2) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 -// (3) vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456+incompatible -// (4) vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456 -// (5) vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456+incompatible -// -// If there is no recently tagged version with the right major version vX, -// then form (1) is used, creating a space of pseudo-versions at the bottom -// of the vX version range, less than any tagged version, including the unlikely v0.0.0. -// -// If the most recent tagged version before the target commit is vX.Y.Z or vX.Y.Z+incompatible, -// then the pseudo-version uses form (2) or (3), making it a prerelease for the next -// possible semantic version after vX.Y.Z. The leading 0 segment in the prerelease string -// ensures that the pseudo-version compares less than possible future explicit prereleases -// like vX.Y.(Z+1)-rc1 or vX.Y.(Z+1)-1. -// -// If the most recent tagged version before the target commit is vX.Y.Z-pre or vX.Y.Z-pre+incompatible, -// then the pseudo-version uses form (4) or (5), making it a slightly later prerelease. - -package module - -import ( - "errors" - "fmt" - "strings" - "time" - - "golang.org/x/mod/internal/lazyregexp" - "golang.org/x/mod/semver" -) - -var pseudoVersionRE = lazyregexp.New(`^v[0-9]+\.(0\.0-|\d+\.\d+-([^+]*\.)?0\.)\d{14}-[A-Za-z0-9]+(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$`) - -const PseudoVersionTimestampFormat = "20060102150405" - -// PseudoVersion returns a pseudo-version for the given major version ("v1") -// preexisting older tagged version ("" or "v1.2.3" or "v1.2.3-pre"), revision time, -// and revision identifier (usually a 12-byte commit hash prefix). -func PseudoVersion(major, older string, t time.Time, rev string) string { - if major == "" { - major = "v0" - } - segment := fmt.Sprintf("%s-%s", t.UTC().Format(PseudoVersionTimestampFormat), rev) - build := semver.Build(older) - older = semver.Canonical(older) - if older == "" { - return major + ".0.0-" + segment // form (1) - } - if semver.Prerelease(older) != "" { - return older + ".0." + segment + build // form (4), (5) - } - - // Form (2), (3). - // Extract patch from vMAJOR.MINOR.PATCH - i := strings.LastIndex(older, ".") + 1 - v, patch := older[:i], older[i:] - - // Reassemble. - return v + incDecimal(patch) + "-0." + segment + build -} - -// ZeroPseudoVersion returns a pseudo-version with a zero timestamp and -// revision, which may be used as a placeholder. -func ZeroPseudoVersion(major string) string { - return PseudoVersion(major, "", time.Time{}, "000000000000") -} - -// incDecimal returns the decimal string incremented by 1. -func incDecimal(decimal string) string { - // Scan right to left turning 9s to 0s until you find a digit to increment. - digits := []byte(decimal) - i := len(digits) - 1 - for ; i >= 0 && digits[i] == '9'; i-- { - digits[i] = '0' - } - if i >= 0 { - digits[i]++ - } else { - // digits is all zeros - digits[0] = '1' - digits = append(digits, '0') - } - return string(digits) -} - -// decDecimal returns the decimal string decremented by 1, or the empty string -// if the decimal is all zeroes. -func decDecimal(decimal string) string { - // Scan right to left turning 0s to 9s until you find a digit to decrement. - digits := []byte(decimal) - i := len(digits) - 1 - for ; i >= 0 && digits[i] == '0'; i-- { - digits[i] = '9' - } - if i < 0 { - // decimal is all zeros - return "" - } - if i == 0 && digits[i] == '1' && len(digits) > 1 { - digits = digits[1:] - } else { - digits[i]-- - } - return string(digits) -} - -// IsPseudoVersion reports whether v is a pseudo-version. -func IsPseudoVersion(v string) bool { - return strings.Count(v, "-") >= 2 && semver.IsValid(v) && pseudoVersionRE.MatchString(v) -} - -// IsZeroPseudoVersion returns whether v is a pseudo-version with a zero base, -// timestamp, and revision, as returned by [ZeroPseudoVersion]. -func IsZeroPseudoVersion(v string) bool { - return v == ZeroPseudoVersion(semver.Major(v)) -} - -// PseudoVersionTime returns the time stamp of the pseudo-version v. -// It returns an error if v is not a pseudo-version or if the time stamp -// embedded in the pseudo-version is not a valid time. -func PseudoVersionTime(v string) (time.Time, error) { - _, timestamp, _, _, err := parsePseudoVersion(v) - if err != nil { - return time.Time{}, err - } - t, err := time.Parse("20060102150405", timestamp) - if err != nil { - return time.Time{}, &InvalidVersionError{ - Version: v, - Pseudo: true, - Err: fmt.Errorf("malformed time %q", timestamp), - } - } - return t, nil -} - -// PseudoVersionRev returns the revision identifier of the pseudo-version v. -// It returns an error if v is not a pseudo-version. -func PseudoVersionRev(v string) (rev string, err error) { - _, _, rev, _, err = parsePseudoVersion(v) - return -} - -// PseudoVersionBase returns the canonical parent version, if any, upon which -// the pseudo-version v is based. -// -// If v has no parent version (that is, if it is "vX.0.0-[…]"), -// PseudoVersionBase returns the empty string and a nil error. -func PseudoVersionBase(v string) (string, error) { - base, _, _, build, err := parsePseudoVersion(v) - if err != nil { - return "", err - } - - switch pre := semver.Prerelease(base); pre { - case "": - // vX.0.0-yyyymmddhhmmss-abcdef123456 → "" - if build != "" { - // Pseudo-versions of the form vX.0.0-yyyymmddhhmmss-abcdef123456+incompatible - // are nonsensical: the "vX.0.0-" prefix implies that there is no parent tag, - // but the "+incompatible" suffix implies that the major version of - // the parent tag is not compatible with the module's import path. - // - // There are a few such entries in the index generated by proxy.golang.org, - // but we believe those entries were generated by the proxy itself. - return "", &InvalidVersionError{ - Version: v, - Pseudo: true, - Err: fmt.Errorf("lacks base version, but has build metadata %q", build), - } - } - return "", nil - - case "-0": - // vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456 → vX.Y.Z - // vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdef123456+incompatible → vX.Y.Z+incompatible - base = strings.TrimSuffix(base, pre) - i := strings.LastIndexByte(base, '.') - if i < 0 { - panic("base from parsePseudoVersion missing patch number: " + base) - } - patch := decDecimal(base[i+1:]) - if patch == "" { - // vX.0.0-0 is invalid, but has been observed in the wild in the index - // generated by requests to proxy.golang.org. - // - // NOTE(bcmills): I cannot find a historical bug that accounts for - // pseudo-versions of this form, nor have I seen such versions in any - // actual go.mod files. If we find actual examples of this form and a - // reasonable theory of how they came into existence, it seems fine to - // treat them as equivalent to vX.0.0 (especially since the invalid - // pseudo-versions have lower precedence than the real ones). For now, we - // reject them. - return "", &InvalidVersionError{ - Version: v, - Pseudo: true, - Err: fmt.Errorf("version before %s would have negative patch number", base), - } - } - return base[:i+1] + patch + build, nil - - default: - // vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456 → vX.Y.Z-pre - // vX.Y.Z-pre.0.yyyymmddhhmmss-abcdef123456+incompatible → vX.Y.Z-pre+incompatible - if !strings.HasSuffix(base, ".0") { - panic(`base from parsePseudoVersion missing ".0" before date: ` + base) - } - return strings.TrimSuffix(base, ".0") + build, nil - } -} - -var errPseudoSyntax = errors.New("syntax error") - -func parsePseudoVersion(v string) (base, timestamp, rev, build string, err error) { - if !IsPseudoVersion(v) { - return "", "", "", "", &InvalidVersionError{ - Version: v, - Pseudo: true, - Err: errPseudoSyntax, - } - } - build = semver.Build(v) - v = strings.TrimSuffix(v, build) - j := strings.LastIndex(v, "-") - v, rev = v[:j], v[j+1:] - i := strings.LastIndex(v, "-") - if j := strings.LastIndex(v, "."); j > i { - base = v[:j] // "vX.Y.Z-pre.0" or "vX.Y.(Z+1)-0" - timestamp = v[j+1:] - } else { - base = v[:i] // "vX.0.0" - timestamp = v[i+1:] - } - return base, timestamp, rev, build, nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/mod/semver/semver.go b/cluster-autoscaler/vendor/golang.org/x/mod/semver/semver.go deleted file mode 100644 index 9a2dfd33a770..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/mod/semver/semver.go +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package semver implements comparison of semantic version strings. -// In this package, semantic version strings must begin with a leading "v", -// as in "v1.0.0". -// -// The general form of a semantic version string accepted by this package is -// -// vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]] -// -// where square brackets indicate optional parts of the syntax; -// MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros; -// PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers -// using only alphanumeric characters and hyphens; and -// all-numeric PRERELEASE identifiers must not have leading zeros. -// -// This package follows Semantic Versioning 2.0.0 (see semver.org) -// with two exceptions. First, it requires the "v" prefix. Second, it recognizes -// vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes) -// as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. -package semver - -import "sort" - -// parsed returns the parsed form of a semantic version string. -type parsed struct { - major string - minor string - patch string - short string - prerelease string - build string -} - -// IsValid reports whether v is a valid semantic version string. -func IsValid(v string) bool { - _, ok := parse(v) - return ok -} - -// Canonical returns the canonical formatting of the semantic version v. -// It fills in any missing .MINOR or .PATCH and discards build metadata. -// Two semantic versions compare equal only if their canonical formattings -// are identical strings. -// The canonical invalid semantic version is the empty string. -func Canonical(v string) string { - p, ok := parse(v) - if !ok { - return "" - } - if p.build != "" { - return v[:len(v)-len(p.build)] - } - if p.short != "" { - return v + p.short - } - return v -} - -// Major returns the major version prefix of the semantic version v. -// For example, Major("v2.1.0") == "v2". -// If v is an invalid semantic version string, Major returns the empty string. -func Major(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return v[:1+len(pv.major)] -} - -// MajorMinor returns the major.minor version prefix of the semantic version v. -// For example, MajorMinor("v2.1.0") == "v2.1". -// If v is an invalid semantic version string, MajorMinor returns the empty string. -func MajorMinor(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - i := 1 + len(pv.major) - if j := i + 1 + len(pv.minor); j <= len(v) && v[i] == '.' && v[i+1:j] == pv.minor { - return v[:j] - } - return v[:i] + "." + pv.minor -} - -// Prerelease returns the prerelease suffix of the semantic version v. -// For example, Prerelease("v2.1.0-pre+meta") == "-pre". -// If v is an invalid semantic version string, Prerelease returns the empty string. -func Prerelease(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.prerelease -} - -// Build returns the build suffix of the semantic version v. -// For example, Build("v2.1.0+meta") == "+meta". -// If v is an invalid semantic version string, Build returns the empty string. -func Build(v string) string { - pv, ok := parse(v) - if !ok { - return "" - } - return pv.build -} - -// Compare returns an integer comparing two versions according to -// semantic version precedence. -// The result will be 0 if v == w, -1 if v < w, or +1 if v > w. -// -// An invalid semantic version string is considered less than a valid one. -// All invalid semantic version strings compare equal to each other. -func Compare(v, w string) int { - pv, ok1 := parse(v) - pw, ok2 := parse(w) - if !ok1 && !ok2 { - return 0 - } - if !ok1 { - return -1 - } - if !ok2 { - return +1 - } - if c := compareInt(pv.major, pw.major); c != 0 { - return c - } - if c := compareInt(pv.minor, pw.minor); c != 0 { - return c - } - if c := compareInt(pv.patch, pw.patch); c != 0 { - return c - } - return comparePrerelease(pv.prerelease, pw.prerelease) -} - -// Max canonicalizes its arguments and then returns the version string -// that compares greater. -// -// Deprecated: use [Compare] instead. In most cases, returning a canonicalized -// version is not expected or desired. -func Max(v, w string) string { - v = Canonical(v) - w = Canonical(w) - if Compare(v, w) > 0 { - return v - } - return w -} - -// ByVersion implements [sort.Interface] for sorting semantic version strings. -type ByVersion []string - -func (vs ByVersion) Len() int { return len(vs) } -func (vs ByVersion) Swap(i, j int) { vs[i], vs[j] = vs[j], vs[i] } -func (vs ByVersion) Less(i, j int) bool { - cmp := Compare(vs[i], vs[j]) - if cmp != 0 { - return cmp < 0 - } - return vs[i] < vs[j] -} - -// Sort sorts a list of semantic version strings using [ByVersion]. -func Sort(list []string) { - sort.Sort(ByVersion(list)) -} - -func parse(v string) (p parsed, ok bool) { - if v == "" || v[0] != 'v' { - return - } - p.major, v, ok = parseInt(v[1:]) - if !ok { - return - } - if v == "" { - p.minor = "0" - p.patch = "0" - p.short = ".0.0" - return - } - if v[0] != '.' { - ok = false - return - } - p.minor, v, ok = parseInt(v[1:]) - if !ok { - return - } - if v == "" { - p.patch = "0" - p.short = ".0" - return - } - if v[0] != '.' { - ok = false - return - } - p.patch, v, ok = parseInt(v[1:]) - if !ok { - return - } - if len(v) > 0 && v[0] == '-' { - p.prerelease, v, ok = parsePrerelease(v) - if !ok { - return - } - } - if len(v) > 0 && v[0] == '+' { - p.build, v, ok = parseBuild(v) - if !ok { - return - } - } - if v != "" { - ok = false - return - } - ok = true - return -} - -func parseInt(v string) (t, rest string, ok bool) { - if v == "" { - return - } - if v[0] < '0' || '9' < v[0] { - return - } - i := 1 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - if v[0] == '0' && i != 1 { - return - } - return v[:i], v[i:], true -} - -func parsePrerelease(v string) (t, rest string, ok bool) { - // "A pre-release version MAY be denoted by appending a hyphen and - // a series of dot separated identifiers immediately following the patch version. - // Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. - // Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes." - if v == "" || v[0] != '-' { - return - } - i := 1 - start := 1 - for i < len(v) && v[i] != '+' { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i || isBadNum(v[start:i]) { - return - } - start = i + 1 - } - i++ - } - if start == i || isBadNum(v[start:i]) { - return - } - return v[:i], v[i:], true -} - -func parseBuild(v string) (t, rest string, ok bool) { - if v == "" || v[0] != '+' { - return - } - i := 1 - start := 1 - for i < len(v) { - if !isIdentChar(v[i]) && v[i] != '.' { - return - } - if v[i] == '.' { - if start == i { - return - } - start = i + 1 - } - i++ - } - if start == i { - return - } - return v[:i], v[i:], true -} - -func isIdentChar(c byte) bool { - return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' || c == '-' -} - -func isBadNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) && i > 1 && v[0] == '0' -} - -func isNum(v string) bool { - i := 0 - for i < len(v) && '0' <= v[i] && v[i] <= '9' { - i++ - } - return i == len(v) -} - -func compareInt(x, y string) int { - if x == y { - return 0 - } - if len(x) < len(y) { - return -1 - } - if len(x) > len(y) { - return +1 - } - if x < y { - return -1 - } else { - return +1 - } -} - -func comparePrerelease(x, y string) int { - // "When major, minor, and patch are equal, a pre-release version has - // lower precedence than a normal version. - // Example: 1.0.0-alpha < 1.0.0. - // Precedence for two pre-release versions with the same major, minor, - // and patch version MUST be determined by comparing each dot separated - // identifier from left to right until a difference is found as follows: - // identifiers consisting of only digits are compared numerically and - // identifiers with letters or hyphens are compared lexically in ASCII - // sort order. Numeric identifiers always have lower precedence than - // non-numeric identifiers. A larger set of pre-release fields has a - // higher precedence than a smaller set, if all of the preceding - // identifiers are equal. - // Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < - // 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0." - if x == y { - return 0 - } - if x == "" { - return +1 - } - if y == "" { - return -1 - } - for x != "" && y != "" { - x = x[1:] // skip - or . - y = y[1:] // skip - or . - var dx, dy string - dx, x = nextIdent(x) - dy, y = nextIdent(y) - if dx != dy { - ix := isNum(dx) - iy := isNum(dy) - if ix != iy { - if ix { - return -1 - } else { - return +1 - } - } - if ix { - if len(dx) < len(dy) { - return -1 - } - if len(dx) > len(dy) { - return +1 - } - } - if dx < dy { - return -1 - } else { - return +1 - } - } - } - if x == "" { - return -1 - } else { - return +1 - } -} - -func nextIdent(x string) (dx, rest string) { - i := 0 - for i < len(x) && x[i] != '.' { - i++ - } - return x[:i], x[i:] -} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs.go b/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs.go deleted file mode 100644 index 3bf40fdfecd5..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package execabs is a drop-in replacement for os/exec -// that requires PATH lookups to find absolute paths. -// That is, execabs.Command("cmd") runs the same PATH lookup -// as exec.Command("cmd"), but if the result is a path -// which is relative, the Run and Start methods will report -// an error instead of running the executable. -// -// See https://blog.golang.org/path-security for more information -// about when it may be necessary or appropriate to use this package. -package execabs - -import ( - "context" - "fmt" - "os/exec" - "path/filepath" - "reflect" - "unsafe" -) - -// ErrNotFound is the error resulting if a path search failed to find an executable file. -// It is an alias for exec.ErrNotFound. -var ErrNotFound = exec.ErrNotFound - -// Cmd represents an external command being prepared or run. -// It is an alias for exec.Cmd. -type Cmd = exec.Cmd - -// Error is returned by LookPath when it fails to classify a file as an executable. -// It is an alias for exec.Error. -type Error = exec.Error - -// An ExitError reports an unsuccessful exit by a command. -// It is an alias for exec.ExitError. -type ExitError = exec.ExitError - -func relError(file, path string) error { - return fmt.Errorf("%s resolves to executable in current directory (.%c%s)", file, filepath.Separator, path) -} - -// LookPath searches for an executable named file in the directories -// named by the PATH environment variable. If file contains a slash, -// it is tried directly and the PATH is not consulted. The result will be -// an absolute path. -// -// LookPath differs from exec.LookPath in its handling of PATH lookups, -// which are used for file names without slashes. If exec.LookPath's -// PATH lookup would have returned an executable from the current directory, -// LookPath instead returns an error. -func LookPath(file string) (string, error) { - path, err := exec.LookPath(file) - if err != nil && !isGo119ErrDot(err) { - return "", err - } - if filepath.Base(file) == file && !filepath.IsAbs(path) { - return "", relError(file, path) - } - return path, nil -} - -func fixCmd(name string, cmd *exec.Cmd) { - if filepath.Base(name) == name && !filepath.IsAbs(cmd.Path) && !isGo119ErrFieldSet(cmd) { - // exec.Command was called with a bare binary name and - // exec.LookPath returned a path which is not absolute. - // Set cmd.lookPathErr and clear cmd.Path so that it - // cannot be run. - lookPathErr := (*error)(unsafe.Pointer(reflect.ValueOf(cmd).Elem().FieldByName("lookPathErr").Addr().Pointer())) - if *lookPathErr == nil { - *lookPathErr = relError(name, cmd.Path) - } - cmd.Path = "" - } -} - -// CommandContext is like Command but includes a context. -// -// The provided context is used to kill the process (by calling os.Process.Kill) -// if the context becomes done before the command completes on its own. -func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd { - cmd := exec.CommandContext(ctx, name, arg...) - fixCmd(name, cmd) - return cmd - -} - -// Command returns the Cmd struct to execute the named program with the given arguments. -// See exec.Command for most details. -// -// Command differs from exec.Command in its handling of PATH lookups, -// which are used when the program name contains no slashes. -// If exec.Command would have returned an exec.Cmd configured to run an -// executable from the current directory, Command instead -// returns an exec.Cmd that will return an error from Start or Run. -func Command(name string, arg ...string) *exec.Cmd { - cmd := exec.Command(name, arg...) - fixCmd(name, cmd) - return cmd -} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs_go118.go b/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs_go118.go deleted file mode 100644 index 2000064a8124..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs_go118.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.19 -// +build !go1.19 - -package execabs - -import "os/exec" - -func isGo119ErrDot(err error) bool { - return false -} - -func isGo119ErrFieldSet(cmd *exec.Cmd) bool { - return false -} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs_go119.go b/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs_go119.go deleted file mode 100644 index f364b3418926..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/sys/execabs/execabs_go119.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.19 -// +build go1.19 - -package execabs - -import ( - "errors" - "os/exec" -) - -func isGo119ErrDot(err error) bool { - return errors.Is(err, exec.ErrDot) -} - -func isGo119ErrFieldSet(cmd *exec.Cmd) bool { - return cmd.Err != nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/cmd/stringer/stringer.go b/cluster-autoscaler/vendor/golang.org/x/tools/cmd/stringer/stringer.go deleted file mode 100644 index 998d1a51bfd0..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/cmd/stringer/stringer.go +++ /dev/null @@ -1,657 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer -// interface. Given the name of a (signed or unsigned) integer type T that has constants -// defined, stringer will create a new self-contained Go source file implementing -// -// func (t T) String() string -// -// The file is created in the same package and directory as the package that defines T. -// It has helpful defaults designed for use with go generate. -// -// Stringer works best with constants that are consecutive values such as created using iota, -// but creates good code regardless. In the future it might also provide custom support for -// constant sets that are bit patterns. -// -// For example, given this snippet, -// -// package painkiller -// -// type Pill int -// -// const ( -// Placebo Pill = iota -// Aspirin -// Ibuprofen -// Paracetamol -// Acetaminophen = Paracetamol -// ) -// -// running this command -// -// stringer -type=Pill -// -// in the same directory will create the file pill_string.go, in package painkiller, -// containing a definition of -// -// func (Pill) String() string -// -// That method will translate the value of a Pill constant to the string representation -// of the respective constant name, so that the call fmt.Print(painkiller.Aspirin) will -// print the string "Aspirin". -// -// Typically this process would be run using go generate, like this: -// -// //go:generate stringer -type=Pill -// -// If multiple constants have the same value, the lexically first matching name will -// be used (in the example, Acetaminophen will print as "Paracetamol"). -// -// With no arguments, it processes the package in the current directory. -// Otherwise, the arguments must name a single directory holding a Go package -// or a set of Go source files that represent a single Go package. -// -// The -type flag accepts a comma-separated list of types so a single run can -// generate methods for multiple types. The default output file is t_string.go, -// where t is the lower-cased name of the first type listed. It can be overridden -// with the -output flag. -// -// The -linecomment flag tells stringer to generate the text of any line comment, trimmed -// of leading spaces, instead of the constant name. For instance, if the constants above had a -// Pill prefix, one could write -// -// PillAspirin // Aspirin -// -// to suppress it in the output. -package main // import "golang.org/x/tools/cmd/stringer" - -import ( - "bytes" - "flag" - "fmt" - "go/ast" - "go/constant" - "go/format" - "go/token" - "go/types" - "log" - "os" - "path/filepath" - "sort" - "strings" - - "golang.org/x/tools/go/packages" -) - -var ( - typeNames = flag.String("type", "", "comma-separated list of type names; must be set") - output = flag.String("output", "", "output file name; default srcdir/_string.go") - trimprefix = flag.String("trimprefix", "", "trim the `prefix` from the generated constant names") - linecomment = flag.Bool("linecomment", false, "use line comment text as printed text when present") - buildTags = flag.String("tags", "", "comma-separated list of build tags to apply") -) - -// Usage is a replacement usage function for the flags package. -func Usage() { - fmt.Fprintf(os.Stderr, "Usage of stringer:\n") - fmt.Fprintf(os.Stderr, "\tstringer [flags] -type T [directory]\n") - fmt.Fprintf(os.Stderr, "\tstringer [flags] -type T files... # Must be a single package\n") - fmt.Fprintf(os.Stderr, "For more information, see:\n") - fmt.Fprintf(os.Stderr, "\thttps://pkg.go.dev/golang.org/x/tools/cmd/stringer\n") - fmt.Fprintf(os.Stderr, "Flags:\n") - flag.PrintDefaults() -} - -func main() { - log.SetFlags(0) - log.SetPrefix("stringer: ") - flag.Usage = Usage - flag.Parse() - if len(*typeNames) == 0 { - flag.Usage() - os.Exit(2) - } - types := strings.Split(*typeNames, ",") - var tags []string - if len(*buildTags) > 0 { - tags = strings.Split(*buildTags, ",") - } - - // We accept either one directory or a list of files. Which do we have? - args := flag.Args() - if len(args) == 0 { - // Default: process whole package in current directory. - args = []string{"."} - } - - // Parse the package once. - var dir string - g := Generator{ - trimPrefix: *trimprefix, - lineComment: *linecomment, - } - // TODO(suzmue): accept other patterns for packages (directories, list of files, import paths, etc). - if len(args) == 1 && isDirectory(args[0]) { - dir = args[0] - } else { - if len(tags) != 0 { - log.Fatal("-tags option applies only to directories, not when files are specified") - } - dir = filepath.Dir(args[0]) - } - - g.parsePackage(args, tags) - - // Print the header and package clause. - g.Printf("// Code generated by \"stringer %s\"; DO NOT EDIT.\n", strings.Join(os.Args[1:], " ")) - g.Printf("\n") - g.Printf("package %s", g.pkg.name) - g.Printf("\n") - g.Printf("import \"strconv\"\n") // Used by all methods. - - // Run generate for each type. - for _, typeName := range types { - g.generate(typeName) - } - - // Format the output. - src := g.format() - - // Write to file. - outputName := *output - if outputName == "" { - baseName := fmt.Sprintf("%s_string.go", types[0]) - outputName = filepath.Join(dir, strings.ToLower(baseName)) - } - err := os.WriteFile(outputName, src, 0644) - if err != nil { - log.Fatalf("writing output: %s", err) - } -} - -// isDirectory reports whether the named file is a directory. -func isDirectory(name string) bool { - info, err := os.Stat(name) - if err != nil { - log.Fatal(err) - } - return info.IsDir() -} - -// Generator holds the state of the analysis. Primarily used to buffer -// the output for format.Source. -type Generator struct { - buf bytes.Buffer // Accumulated output. - pkg *Package // Package we are scanning. - - trimPrefix string - lineComment bool -} - -func (g *Generator) Printf(format string, args ...interface{}) { - fmt.Fprintf(&g.buf, format, args...) -} - -// File holds a single parsed file and associated data. -type File struct { - pkg *Package // Package to which this file belongs. - file *ast.File // Parsed AST. - // These fields are reset for each type being generated. - typeName string // Name of the constant type. - values []Value // Accumulator for constant values of that type. - - trimPrefix string - lineComment bool -} - -type Package struct { - name string - defs map[*ast.Ident]types.Object - files []*File -} - -// parsePackage analyzes the single package constructed from the patterns and tags. -// parsePackage exits if there is an error. -func (g *Generator) parsePackage(patterns []string, tags []string) { - cfg := &packages.Config{ - Mode: packages.NeedName | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedSyntax, - // TODO: Need to think about constants in test files. Maybe write type_string_test.go - // in a separate pass? For later. - Tests: false, - BuildFlags: []string{fmt.Sprintf("-tags=%s", strings.Join(tags, " "))}, - } - pkgs, err := packages.Load(cfg, patterns...) - if err != nil { - log.Fatal(err) - } - if len(pkgs) != 1 { - log.Fatalf("error: %d packages found", len(pkgs)) - } - g.addPackage(pkgs[0]) -} - -// addPackage adds a type checked Package and its syntax files to the generator. -func (g *Generator) addPackage(pkg *packages.Package) { - g.pkg = &Package{ - name: pkg.Name, - defs: pkg.TypesInfo.Defs, - files: make([]*File, len(pkg.Syntax)), - } - - for i, file := range pkg.Syntax { - g.pkg.files[i] = &File{ - file: file, - pkg: g.pkg, - trimPrefix: g.trimPrefix, - lineComment: g.lineComment, - } - } -} - -// generate produces the String method for the named type. -func (g *Generator) generate(typeName string) { - values := make([]Value, 0, 100) - for _, file := range g.pkg.files { - // Set the state for this run of the walker. - file.typeName = typeName - file.values = nil - if file.file != nil { - ast.Inspect(file.file, file.genDecl) - values = append(values, file.values...) - } - } - - if len(values) == 0 { - log.Fatalf("no values defined for type %s", typeName) - } - // Generate code that will fail if the constants change value. - g.Printf("func _() {\n") - g.Printf("\t// An \"invalid array index\" compiler error signifies that the constant values have changed.\n") - g.Printf("\t// Re-run the stringer command to generate them again.\n") - g.Printf("\tvar x [1]struct{}\n") - for _, v := range values { - g.Printf("\t_ = x[%s - %s]\n", v.originalName, v.str) - } - g.Printf("}\n") - runs := splitIntoRuns(values) - // The decision of which pattern to use depends on the number of - // runs in the numbers. If there's only one, it's easy. For more than - // one, there's a tradeoff between complexity and size of the data - // and code vs. the simplicity of a map. A map takes more space, - // but so does the code. The decision here (crossover at 10) is - // arbitrary, but considers that for large numbers of runs the cost - // of the linear scan in the switch might become important, and - // rather than use yet another algorithm such as binary search, - // we punt and use a map. In any case, the likelihood of a map - // being necessary for any realistic example other than bitmasks - // is very low. And bitmasks probably deserve their own analysis, - // to be done some other day. - switch { - case len(runs) == 1: - g.buildOneRun(runs, typeName) - case len(runs) <= 10: - g.buildMultipleRuns(runs, typeName) - default: - g.buildMap(runs, typeName) - } -} - -// splitIntoRuns breaks the values into runs of contiguous sequences. -// For example, given 1,2,3,5,6,7 it returns {1,2,3},{5,6,7}. -// The input slice is known to be non-empty. -func splitIntoRuns(values []Value) [][]Value { - // We use stable sort so the lexically first name is chosen for equal elements. - sort.Stable(byValue(values)) - // Remove duplicates. Stable sort has put the one we want to print first, - // so use that one. The String method won't care about which named constant - // was the argument, so the first name for the given value is the only one to keep. - // We need to do this because identical values would cause the switch or map - // to fail to compile. - j := 1 - for i := 1; i < len(values); i++ { - if values[i].value != values[i-1].value { - values[j] = values[i] - j++ - } - } - values = values[:j] - runs := make([][]Value, 0, 10) - for len(values) > 0 { - // One contiguous sequence per outer loop. - i := 1 - for i < len(values) && values[i].value == values[i-1].value+1 { - i++ - } - runs = append(runs, values[:i]) - values = values[i:] - } - return runs -} - -// format returns the gofmt-ed contents of the Generator's buffer. -func (g *Generator) format() []byte { - src, err := format.Source(g.buf.Bytes()) - if err != nil { - // Should never happen, but can arise when developing this code. - // The user can compile the output to see the error. - log.Printf("warning: internal error: invalid Go generated: %s", err) - log.Printf("warning: compile the package to analyze the error") - return g.buf.Bytes() - } - return src -} - -// Value represents a declared constant. -type Value struct { - originalName string // The name of the constant. - name string // The name with trimmed prefix. - // The value is stored as a bit pattern alone. The boolean tells us - // whether to interpret it as an int64 or a uint64; the only place - // this matters is when sorting. - // Much of the time the str field is all we need; it is printed - // by Value.String. - value uint64 // Will be converted to int64 when needed. - signed bool // Whether the constant is a signed type. - str string // The string representation given by the "go/constant" package. -} - -func (v *Value) String() string { - return v.str -} - -// byValue lets us sort the constants into increasing order. -// We take care in the Less method to sort in signed or unsigned order, -// as appropriate. -type byValue []Value - -func (b byValue) Len() int { return len(b) } -func (b byValue) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b byValue) Less(i, j int) bool { - if b[i].signed { - return int64(b[i].value) < int64(b[j].value) - } - return b[i].value < b[j].value -} - -// genDecl processes one declaration clause. -func (f *File) genDecl(node ast.Node) bool { - decl, ok := node.(*ast.GenDecl) - if !ok || decl.Tok != token.CONST { - // We only care about const declarations. - return true - } - // The name of the type of the constants we are declaring. - // Can change if this is a multi-element declaration. - typ := "" - // Loop over the elements of the declaration. Each element is a ValueSpec: - // a list of names possibly followed by a type, possibly followed by values. - // If the type and value are both missing, we carry down the type (and value, - // but the "go/types" package takes care of that). - for _, spec := range decl.Specs { - vspec := spec.(*ast.ValueSpec) // Guaranteed to succeed as this is CONST. - if vspec.Type == nil && len(vspec.Values) > 0 { - // "X = 1". With no type but a value. If the constant is untyped, - // skip this vspec and reset the remembered type. - typ = "" - - // If this is a simple type conversion, remember the type. - // We don't mind if this is actually a call; a qualified call won't - // be matched (that will be SelectorExpr, not Ident), and only unusual - // situations will result in a function call that appears to be - // a type conversion. - ce, ok := vspec.Values[0].(*ast.CallExpr) - if !ok { - continue - } - id, ok := ce.Fun.(*ast.Ident) - if !ok { - continue - } - typ = id.Name - } - if vspec.Type != nil { - // "X T". We have a type. Remember it. - ident, ok := vspec.Type.(*ast.Ident) - if !ok { - continue - } - typ = ident.Name - } - if typ != f.typeName { - // This is not the type we're looking for. - continue - } - // We now have a list of names (from one line of source code) all being - // declared with the desired type. - // Grab their names and actual values and store them in f.values. - for _, name := range vspec.Names { - if name.Name == "_" { - continue - } - // This dance lets the type checker find the values for us. It's a - // bit tricky: look up the object declared by the name, find its - // types.Const, and extract its value. - obj, ok := f.pkg.defs[name] - if !ok { - log.Fatalf("no value for constant %s", name) - } - info := obj.Type().Underlying().(*types.Basic).Info() - if info&types.IsInteger == 0 { - log.Fatalf("can't handle non-integer constant type %s", typ) - } - value := obj.(*types.Const).Val() // Guaranteed to succeed as this is CONST. - if value.Kind() != constant.Int { - log.Fatalf("can't happen: constant is not an integer %s", name) - } - i64, isInt := constant.Int64Val(value) - u64, isUint := constant.Uint64Val(value) - if !isInt && !isUint { - log.Fatalf("internal error: value of %s is not an integer: %s", name, value.String()) - } - if !isInt { - u64 = uint64(i64) - } - v := Value{ - originalName: name.Name, - value: u64, - signed: info&types.IsUnsigned == 0, - str: value.String(), - } - if c := vspec.Comment; f.lineComment && c != nil && len(c.List) == 1 { - v.name = strings.TrimSpace(c.Text()) - } else { - v.name = strings.TrimPrefix(v.originalName, f.trimPrefix) - } - f.values = append(f.values, v) - } - } - return false -} - -// Helpers - -// usize returns the number of bits of the smallest unsigned integer -// type that will hold n. Used to create the smallest possible slice of -// integers to use as indexes into the concatenated strings. -func usize(n int) int { - switch { - case n < 1<<8: - return 8 - case n < 1<<16: - return 16 - default: - // 2^32 is enough constants for anyone. - return 32 - } -} - -// declareIndexAndNameVars declares the index slices and concatenated names -// strings representing the runs of values. -func (g *Generator) declareIndexAndNameVars(runs [][]Value, typeName string) { - var indexes, names []string - for i, run := range runs { - index, name := g.createIndexAndNameDecl(run, typeName, fmt.Sprintf("_%d", i)) - if len(run) != 1 { - indexes = append(indexes, index) - } - names = append(names, name) - } - g.Printf("const (\n") - for _, name := range names { - g.Printf("\t%s\n", name) - } - g.Printf(")\n\n") - - if len(indexes) > 0 { - g.Printf("var (") - for _, index := range indexes { - g.Printf("\t%s\n", index) - } - g.Printf(")\n\n") - } -} - -// declareIndexAndNameVar is the single-run version of declareIndexAndNameVars -func (g *Generator) declareIndexAndNameVar(run []Value, typeName string) { - index, name := g.createIndexAndNameDecl(run, typeName, "") - g.Printf("const %s\n", name) - g.Printf("var %s\n", index) -} - -// createIndexAndNameDecl returns the pair of declarations for the run. The caller will add "const" and "var". -func (g *Generator) createIndexAndNameDecl(run []Value, typeName string, suffix string) (string, string) { - b := new(bytes.Buffer) - indexes := make([]int, len(run)) - for i := range run { - b.WriteString(run[i].name) - indexes[i] = b.Len() - } - nameConst := fmt.Sprintf("_%s_name%s = %q", typeName, suffix, b.String()) - nameLen := b.Len() - b.Reset() - fmt.Fprintf(b, "_%s_index%s = [...]uint%d{0, ", typeName, suffix, usize(nameLen)) - for i, v := range indexes { - if i > 0 { - fmt.Fprintf(b, ", ") - } - fmt.Fprintf(b, "%d", v) - } - fmt.Fprintf(b, "}") - return b.String(), nameConst -} - -// declareNameVars declares the concatenated names string representing all the values in the runs. -func (g *Generator) declareNameVars(runs [][]Value, typeName string, suffix string) { - g.Printf("const _%s_name%s = \"", typeName, suffix) - for _, run := range runs { - for i := range run { - g.Printf("%s", run[i].name) - } - } - g.Printf("\"\n") -} - -// buildOneRun generates the variables and String method for a single run of contiguous values. -func (g *Generator) buildOneRun(runs [][]Value, typeName string) { - values := runs[0] - g.Printf("\n") - g.declareIndexAndNameVar(values, typeName) - // The generated code is simple enough to write as a Printf format. - lessThanZero := "" - if values[0].signed { - lessThanZero = "i < 0 || " - } - if values[0].value == 0 { // Signed or unsigned, 0 is still 0. - g.Printf(stringOneRun, typeName, usize(len(values)), lessThanZero) - } else { - g.Printf(stringOneRunWithOffset, typeName, values[0].String(), usize(len(values)), lessThanZero) - } -} - -// Arguments to format are: -// -// [1]: type name -// [2]: size of index element (8 for uint8 etc.) -// [3]: less than zero check (for signed types) -const stringOneRun = `func (i %[1]s) String() string { - if %[3]si >= %[1]s(len(_%[1]s_index)-1) { - return "%[1]s(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _%[1]s_name[_%[1]s_index[i]:_%[1]s_index[i+1]] -} -` - -// Arguments to format are: -// [1]: type name -// [2]: lowest defined value for type, as a string -// [3]: size of index element (8 for uint8 etc.) -// [4]: less than zero check (for signed types) -/* - */ -const stringOneRunWithOffset = `func (i %[1]s) String() string { - i -= %[2]s - if %[4]si >= %[1]s(len(_%[1]s_index)-1) { - return "%[1]s(" + strconv.FormatInt(int64(i + %[2]s), 10) + ")" - } - return _%[1]s_name[_%[1]s_index[i] : _%[1]s_index[i+1]] -} -` - -// buildMultipleRuns generates the variables and String method for multiple runs of contiguous values. -// For this pattern, a single Printf format won't do. -func (g *Generator) buildMultipleRuns(runs [][]Value, typeName string) { - g.Printf("\n") - g.declareIndexAndNameVars(runs, typeName) - g.Printf("func (i %s) String() string {\n", typeName) - g.Printf("\tswitch {\n") - for i, values := range runs { - if len(values) == 1 { - g.Printf("\tcase i == %s:\n", &values[0]) - g.Printf("\t\treturn _%s_name_%d\n", typeName, i) - continue - } - if values[0].value == 0 && !values[0].signed { - // For an unsigned lower bound of 0, "0 <= i" would be redundant. - g.Printf("\tcase i <= %s:\n", &values[len(values)-1]) - } else { - g.Printf("\tcase %s <= i && i <= %s:\n", &values[0], &values[len(values)-1]) - } - if values[0].value != 0 { - g.Printf("\t\ti -= %s\n", &values[0]) - } - g.Printf("\t\treturn _%s_name_%d[_%s_index_%d[i]:_%s_index_%d[i+1]]\n", - typeName, i, typeName, i, typeName, i) - } - g.Printf("\tdefault:\n") - g.Printf("\t\treturn \"%s(\" + strconv.FormatInt(int64(i), 10) + \")\"\n", typeName) - g.Printf("\t}\n") - g.Printf("}\n") -} - -// buildMap handles the case where the space is so sparse a map is a reasonable fallback. -// It's a rare situation but has simple code. -func (g *Generator) buildMap(runs [][]Value, typeName string) { - g.Printf("\n") - g.declareNameVars(runs, typeName, "") - g.Printf("\nvar _%s_map = map[%s]string{\n", typeName, typeName) - n := 0 - for _, values := range runs { - for _, value := range values { - g.Printf("\t%s: _%s_name[%d:%d],\n", &value, typeName, n, n+len(value.name)) - n += len(value.name) - } - } - g.Printf("}\n\n") - g.Printf(stringMap, typeName) -} - -// Argument to format is the type name. -const stringMap = `func (i %[1]s) String() string { - if str, ok := _%[1]s_map[i]; ok { - return str - } - return "%[1]s(" + strconv.FormatInt(int64(i), 10) + ")" -} -` diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go deleted file mode 100644 index 9fa5aa192c29..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go +++ /dev/null @@ -1,636 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package astutil - -// This file defines utilities for working with source positions. - -import ( - "fmt" - "go/ast" - "go/token" - "sort" - - "golang.org/x/tools/internal/typeparams" -) - -// PathEnclosingInterval returns the node that encloses the source -// interval [start, end), and all its ancestors up to the AST root. -// -// The definition of "enclosing" used by this function considers -// additional whitespace abutting a node to be enclosed by it. -// In this example: -// -// z := x + y // add them -// <-A-> -// <----B-----> -// -// the ast.BinaryExpr(+) node is considered to enclose interval B -// even though its [Pos()..End()) is actually only interval A. -// This behaviour makes user interfaces more tolerant of imperfect -// input. -// -// This function treats tokens as nodes, though they are not included -// in the result. e.g. PathEnclosingInterval("+") returns the -// enclosing ast.BinaryExpr("x + y"). -// -// If start==end, the 1-char interval following start is used instead. -// -// The 'exact' result is true if the interval contains only path[0] -// and perhaps some adjacent whitespace. It is false if the interval -// overlaps multiple children of path[0], or if it contains only -// interior whitespace of path[0]. -// In this example: -// -// z := x + y // add them -// <--C--> <---E--> -// ^ -// D -// -// intervals C, D and E are inexact. C is contained by the -// z-assignment statement, because it spans three of its children (:=, -// x, +). So too is the 1-char interval D, because it contains only -// interior whitespace of the assignment. E is considered interior -// whitespace of the BlockStmt containing the assignment. -// -// The resulting path is never empty; it always contains at least the -// 'root' *ast.File. Ideally PathEnclosingInterval would reject -// intervals that lie wholly or partially outside the range of the -// file, but unfortunately ast.File records only the token.Pos of -// the 'package' keyword, but not of the start of the file itself. -func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Node, exact bool) { - // fmt.Printf("EnclosingInterval %d %d\n", start, end) // debugging - - // Precondition: node.[Pos..End) and adjoining whitespace contain [start, end). - var visit func(node ast.Node) bool - visit = func(node ast.Node) bool { - path = append(path, node) - - nodePos := node.Pos() - nodeEnd := node.End() - - // fmt.Printf("visit(%T, %d, %d)\n", node, nodePos, nodeEnd) // debugging - - // Intersect [start, end) with interval of node. - if start < nodePos { - start = nodePos - } - if end > nodeEnd { - end = nodeEnd - } - - // Find sole child that contains [start, end). - children := childrenOf(node) - l := len(children) - for i, child := range children { - // [childPos, childEnd) is unaugmented interval of child. - childPos := child.Pos() - childEnd := child.End() - - // [augPos, augEnd) is whitespace-augmented interval of child. - augPos := childPos - augEnd := childEnd - if i > 0 { - augPos = children[i-1].End() // start of preceding whitespace - } - if i < l-1 { - nextChildPos := children[i+1].Pos() - // Does [start, end) lie between child and next child? - if start >= augEnd && end <= nextChildPos { - return false // inexact match - } - augEnd = nextChildPos // end of following whitespace - } - - // fmt.Printf("\tchild %d: [%d..%d)\tcontains interval [%d..%d)?\n", - // i, augPos, augEnd, start, end) // debugging - - // Does augmented child strictly contain [start, end)? - if augPos <= start && end <= augEnd { - _, isToken := child.(tokenNode) - return isToken || visit(child) - } - - // Does [start, end) overlap multiple children? - // i.e. left-augmented child contains start - // but LR-augmented child does not contain end. - if start < childEnd && end > augEnd { - break - } - } - - // No single child contained [start, end), - // so node is the result. Is it exact? - - // (It's tempting to put this condition before the - // child loop, but it gives the wrong result in the - // case where a node (e.g. ExprStmt) and its sole - // child have equal intervals.) - if start == nodePos && end == nodeEnd { - return true // exact match - } - - return false // inexact: overlaps multiple children - } - - // Ensure [start,end) is nondecreasing. - if start > end { - start, end = end, start - } - - if start < root.End() && end > root.Pos() { - if start == end { - end = start + 1 // empty interval => interval of size 1 - } - exact = visit(root) - - // Reverse the path: - for i, l := 0, len(path); i < l/2; i++ { - path[i], path[l-1-i] = path[l-1-i], path[i] - } - } else { - // Selection lies within whitespace preceding the - // first (or following the last) declaration in the file. - // The result nonetheless always includes the ast.File. - path = append(path, root) - } - - return -} - -// tokenNode is a dummy implementation of ast.Node for a single token. -// They are used transiently by PathEnclosingInterval but never escape -// this package. -type tokenNode struct { - pos token.Pos - end token.Pos -} - -func (n tokenNode) Pos() token.Pos { - return n.pos -} - -func (n tokenNode) End() token.Pos { - return n.end -} - -func tok(pos token.Pos, len int) ast.Node { - return tokenNode{pos, pos + token.Pos(len)} -} - -// childrenOf returns the direct non-nil children of ast.Node n. -// It may include fake ast.Node implementations for bare tokens. -// it is not safe to call (e.g.) ast.Walk on such nodes. -func childrenOf(n ast.Node) []ast.Node { - var children []ast.Node - - // First add nodes for all true subtrees. - ast.Inspect(n, func(node ast.Node) bool { - if node == n { // push n - return true // recur - } - if node != nil { // push child - children = append(children, node) - } - return false // no recursion - }) - - // Then add fake Nodes for bare tokens. - switch n := n.(type) { - case *ast.ArrayType: - children = append(children, - tok(n.Lbrack, len("[")), - tok(n.Elt.End(), len("]"))) - - case *ast.AssignStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.BasicLit: - children = append(children, - tok(n.ValuePos, len(n.Value))) - - case *ast.BinaryExpr: - children = append(children, tok(n.OpPos, len(n.Op.String()))) - - case *ast.BlockStmt: - children = append(children, - tok(n.Lbrace, len("{")), - tok(n.Rbrace, len("}"))) - - case *ast.BranchStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.CallExpr: - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - if n.Ellipsis != 0 { - children = append(children, tok(n.Ellipsis, len("..."))) - } - - case *ast.CaseClause: - if n.List == nil { - children = append(children, - tok(n.Case, len("default"))) - } else { - children = append(children, - tok(n.Case, len("case"))) - } - children = append(children, tok(n.Colon, len(":"))) - - case *ast.ChanType: - switch n.Dir { - case ast.RECV: - children = append(children, tok(n.Begin, len("<-chan"))) - case ast.SEND: - children = append(children, tok(n.Begin, len("chan<-"))) - case ast.RECV | ast.SEND: - children = append(children, tok(n.Begin, len("chan"))) - } - - case *ast.CommClause: - if n.Comm == nil { - children = append(children, - tok(n.Case, len("default"))) - } else { - children = append(children, - tok(n.Case, len("case"))) - } - children = append(children, tok(n.Colon, len(":"))) - - case *ast.Comment: - // nop - - case *ast.CommentGroup: - // nop - - case *ast.CompositeLit: - children = append(children, - tok(n.Lbrace, len("{")), - tok(n.Rbrace, len("{"))) - - case *ast.DeclStmt: - // nop - - case *ast.DeferStmt: - children = append(children, - tok(n.Defer, len("defer"))) - - case *ast.Ellipsis: - children = append(children, - tok(n.Ellipsis, len("..."))) - - case *ast.EmptyStmt: - // nop - - case *ast.ExprStmt: - // nop - - case *ast.Field: - // TODO(adonovan): Field.{Doc,Comment,Tag}? - - case *ast.FieldList: - children = append(children, - tok(n.Opening, len("(")), // or len("[") - tok(n.Closing, len(")"))) // or len("]") - - case *ast.File: - // TODO test: Doc - children = append(children, - tok(n.Package, len("package"))) - - case *ast.ForStmt: - children = append(children, - tok(n.For, len("for"))) - - case *ast.FuncDecl: - // TODO(adonovan): FuncDecl.Comment? - - // Uniquely, FuncDecl breaks the invariant that - // preorder traversal yields tokens in lexical order: - // in fact, FuncDecl.Recv precedes FuncDecl.Type.Func. - // - // As a workaround, we inline the case for FuncType - // here and order things correctly. - // - children = nil // discard ast.Walk(FuncDecl) info subtrees - children = append(children, tok(n.Type.Func, len("func"))) - if n.Recv != nil { - children = append(children, n.Recv) - } - children = append(children, n.Name) - if tparams := typeparams.ForFuncType(n.Type); tparams != nil { - children = append(children, tparams) - } - if n.Type.Params != nil { - children = append(children, n.Type.Params) - } - if n.Type.Results != nil { - children = append(children, n.Type.Results) - } - if n.Body != nil { - children = append(children, n.Body) - } - - case *ast.FuncLit: - // nop - - case *ast.FuncType: - if n.Func != 0 { - children = append(children, - tok(n.Func, len("func"))) - } - - case *ast.GenDecl: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - if n.Lparen != 0 { - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - } - - case *ast.GoStmt: - children = append(children, - tok(n.Go, len("go"))) - - case *ast.Ident: - children = append(children, - tok(n.NamePos, len(n.Name))) - - case *ast.IfStmt: - children = append(children, - tok(n.If, len("if"))) - - case *ast.ImportSpec: - // TODO(adonovan): ImportSpec.{Doc,EndPos}? - - case *ast.IncDecStmt: - children = append(children, - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.IndexExpr: - children = append(children, - tok(n.Lbrack, len("[")), - tok(n.Rbrack, len("]"))) - - case *typeparams.IndexListExpr: - children = append(children, - tok(n.Lbrack, len("[")), - tok(n.Rbrack, len("]"))) - - case *ast.InterfaceType: - children = append(children, - tok(n.Interface, len("interface"))) - - case *ast.KeyValueExpr: - children = append(children, - tok(n.Colon, len(":"))) - - case *ast.LabeledStmt: - children = append(children, - tok(n.Colon, len(":"))) - - case *ast.MapType: - children = append(children, - tok(n.Map, len("map"))) - - case *ast.ParenExpr: - children = append(children, - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - - case *ast.RangeStmt: - children = append(children, - tok(n.For, len("for")), - tok(n.TokPos, len(n.Tok.String()))) - - case *ast.ReturnStmt: - children = append(children, - tok(n.Return, len("return"))) - - case *ast.SelectStmt: - children = append(children, - tok(n.Select, len("select"))) - - case *ast.SelectorExpr: - // nop - - case *ast.SendStmt: - children = append(children, - tok(n.Arrow, len("<-"))) - - case *ast.SliceExpr: - children = append(children, - tok(n.Lbrack, len("[")), - tok(n.Rbrack, len("]"))) - - case *ast.StarExpr: - children = append(children, tok(n.Star, len("*"))) - - case *ast.StructType: - children = append(children, tok(n.Struct, len("struct"))) - - case *ast.SwitchStmt: - children = append(children, tok(n.Switch, len("switch"))) - - case *ast.TypeAssertExpr: - children = append(children, - tok(n.Lparen-1, len(".")), - tok(n.Lparen, len("(")), - tok(n.Rparen, len(")"))) - - case *ast.TypeSpec: - // TODO(adonovan): TypeSpec.{Doc,Comment}? - - case *ast.TypeSwitchStmt: - children = append(children, tok(n.Switch, len("switch"))) - - case *ast.UnaryExpr: - children = append(children, tok(n.OpPos, len(n.Op.String()))) - - case *ast.ValueSpec: - // TODO(adonovan): ValueSpec.{Doc,Comment}? - - case *ast.BadDecl, *ast.BadExpr, *ast.BadStmt: - // nop - } - - // TODO(adonovan): opt: merge the logic of ast.Inspect() into - // the switch above so we can make interleaved callbacks for - // both Nodes and Tokens in the right order and avoid the need - // to sort. - sort.Sort(byPos(children)) - - return children -} - -type byPos []ast.Node - -func (sl byPos) Len() int { - return len(sl) -} -func (sl byPos) Less(i, j int) bool { - return sl[i].Pos() < sl[j].Pos() -} -func (sl byPos) Swap(i, j int) { - sl[i], sl[j] = sl[j], sl[i] -} - -// NodeDescription returns a description of the concrete type of n suitable -// for a user interface. -// -// TODO(adonovan): in some cases (e.g. Field, FieldList, Ident, -// StarExpr) we could be much more specific given the path to the AST -// root. Perhaps we should do that. -func NodeDescription(n ast.Node) string { - switch n := n.(type) { - case *ast.ArrayType: - return "array type" - case *ast.AssignStmt: - return "assignment" - case *ast.BadDecl: - return "bad declaration" - case *ast.BadExpr: - return "bad expression" - case *ast.BadStmt: - return "bad statement" - case *ast.BasicLit: - return "basic literal" - case *ast.BinaryExpr: - return fmt.Sprintf("binary %s operation", n.Op) - case *ast.BlockStmt: - return "block" - case *ast.BranchStmt: - switch n.Tok { - case token.BREAK: - return "break statement" - case token.CONTINUE: - return "continue statement" - case token.GOTO: - return "goto statement" - case token.FALLTHROUGH: - return "fall-through statement" - } - case *ast.CallExpr: - if len(n.Args) == 1 && !n.Ellipsis.IsValid() { - return "function call (or conversion)" - } - return "function call" - case *ast.CaseClause: - return "case clause" - case *ast.ChanType: - return "channel type" - case *ast.CommClause: - return "communication clause" - case *ast.Comment: - return "comment" - case *ast.CommentGroup: - return "comment group" - case *ast.CompositeLit: - return "composite literal" - case *ast.DeclStmt: - return NodeDescription(n.Decl) + " statement" - case *ast.DeferStmt: - return "defer statement" - case *ast.Ellipsis: - return "ellipsis" - case *ast.EmptyStmt: - return "empty statement" - case *ast.ExprStmt: - return "expression statement" - case *ast.Field: - // Can be any of these: - // struct {x, y int} -- struct field(s) - // struct {T} -- anon struct field - // interface {I} -- interface embedding - // interface {f()} -- interface method - // func (A) func(B) C -- receiver, param(s), result(s) - return "field/method/parameter" - case *ast.FieldList: - return "field/method/parameter list" - case *ast.File: - return "source file" - case *ast.ForStmt: - return "for loop" - case *ast.FuncDecl: - return "function declaration" - case *ast.FuncLit: - return "function literal" - case *ast.FuncType: - return "function type" - case *ast.GenDecl: - switch n.Tok { - case token.IMPORT: - return "import declaration" - case token.CONST: - return "constant declaration" - case token.TYPE: - return "type declaration" - case token.VAR: - return "variable declaration" - } - case *ast.GoStmt: - return "go statement" - case *ast.Ident: - return "identifier" - case *ast.IfStmt: - return "if statement" - case *ast.ImportSpec: - return "import specification" - case *ast.IncDecStmt: - if n.Tok == token.INC { - return "increment statement" - } - return "decrement statement" - case *ast.IndexExpr: - return "index expression" - case *typeparams.IndexListExpr: - return "index list expression" - case *ast.InterfaceType: - return "interface type" - case *ast.KeyValueExpr: - return "key/value association" - case *ast.LabeledStmt: - return "statement label" - case *ast.MapType: - return "map type" - case *ast.Package: - return "package" - case *ast.ParenExpr: - return "parenthesized " + NodeDescription(n.X) - case *ast.RangeStmt: - return "range loop" - case *ast.ReturnStmt: - return "return statement" - case *ast.SelectStmt: - return "select statement" - case *ast.SelectorExpr: - return "selector" - case *ast.SendStmt: - return "channel send" - case *ast.SliceExpr: - return "slice expression" - case *ast.StarExpr: - return "*-operation" // load/store expr or pointer type - case *ast.StructType: - return "struct type" - case *ast.SwitchStmt: - return "switch statement" - case *ast.TypeAssertExpr: - return "type assertion" - case *ast.TypeSpec: - return "type specification" - case *ast.TypeSwitchStmt: - return "type switch" - case *ast.UnaryExpr: - return fmt.Sprintf("unary %s operation", n.Op) - case *ast.ValueSpec: - return "value specification" - - } - panic(fmt.Sprintf("unexpected node type: %T", n)) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/imports.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/imports.go deleted file mode 100644 index 18d1adb05ddc..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/imports.go +++ /dev/null @@ -1,485 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package astutil contains common utilities for working with the Go AST. -package astutil // import "golang.org/x/tools/go/ast/astutil" - -import ( - "fmt" - "go/ast" - "go/token" - "strconv" - "strings" -) - -// AddImport adds the import path to the file f, if absent. -func AddImport(fset *token.FileSet, f *ast.File, path string) (added bool) { - return AddNamedImport(fset, f, "", path) -} - -// AddNamedImport adds the import with the given name and path to the file f, if absent. -// If name is not empty, it is used to rename the import. -// -// For example, calling -// -// AddNamedImport(fset, f, "pathpkg", "path") -// -// adds -// -// import pathpkg "path" -func AddNamedImport(fset *token.FileSet, f *ast.File, name, path string) (added bool) { - if imports(f, name, path) { - return false - } - - newImport := &ast.ImportSpec{ - Path: &ast.BasicLit{ - Kind: token.STRING, - Value: strconv.Quote(path), - }, - } - if name != "" { - newImport.Name = &ast.Ident{Name: name} - } - - // Find an import decl to add to. - // The goal is to find an existing import - // whose import path has the longest shared - // prefix with path. - var ( - bestMatch = -1 // length of longest shared prefix - lastImport = -1 // index in f.Decls of the file's final import decl - impDecl *ast.GenDecl // import decl containing the best match - impIndex = -1 // spec index in impDecl containing the best match - - isThirdPartyPath = isThirdParty(path) - ) - for i, decl := range f.Decls { - gen, ok := decl.(*ast.GenDecl) - if ok && gen.Tok == token.IMPORT { - lastImport = i - // Do not add to import "C", to avoid disrupting the - // association with its doc comment, breaking cgo. - if declImports(gen, "C") { - continue - } - - // Match an empty import decl if that's all that is available. - if len(gen.Specs) == 0 && bestMatch == -1 { - impDecl = gen - } - - // Compute longest shared prefix with imports in this group and find best - // matched import spec. - // 1. Always prefer import spec with longest shared prefix. - // 2. While match length is 0, - // - for stdlib package: prefer first import spec. - // - for third party package: prefer first third party import spec. - // We cannot use last import spec as best match for third party package - // because grouped imports are usually placed last by goimports -local - // flag. - // See issue #19190. - seenAnyThirdParty := false - for j, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - p := importPath(impspec) - n := matchLen(p, path) - if n > bestMatch || (bestMatch == 0 && !seenAnyThirdParty && isThirdPartyPath) { - bestMatch = n - impDecl = gen - impIndex = j - } - seenAnyThirdParty = seenAnyThirdParty || isThirdParty(p) - } - } - } - - // If no import decl found, add one after the last import. - if impDecl == nil { - impDecl = &ast.GenDecl{ - Tok: token.IMPORT, - } - if lastImport >= 0 { - impDecl.TokPos = f.Decls[lastImport].End() - } else { - // There are no existing imports. - // Our new import, preceded by a blank line, goes after the package declaration - // and after the comment, if any, that starts on the same line as the - // package declaration. - impDecl.TokPos = f.Package - - file := fset.File(f.Package) - pkgLine := file.Line(f.Package) - for _, c := range f.Comments { - if file.Line(c.Pos()) > pkgLine { - break - } - // +2 for a blank line - impDecl.TokPos = c.End() + 2 - } - } - f.Decls = append(f.Decls, nil) - copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:]) - f.Decls[lastImport+1] = impDecl - } - - // Insert new import at insertAt. - insertAt := 0 - if impIndex >= 0 { - // insert after the found import - insertAt = impIndex + 1 - } - impDecl.Specs = append(impDecl.Specs, nil) - copy(impDecl.Specs[insertAt+1:], impDecl.Specs[insertAt:]) - impDecl.Specs[insertAt] = newImport - pos := impDecl.Pos() - if insertAt > 0 { - // If there is a comment after an existing import, preserve the comment - // position by adding the new import after the comment. - if spec, ok := impDecl.Specs[insertAt-1].(*ast.ImportSpec); ok && spec.Comment != nil { - pos = spec.Comment.End() - } else { - // Assign same position as the previous import, - // so that the sorter sees it as being in the same block. - pos = impDecl.Specs[insertAt-1].Pos() - } - } - if newImport.Name != nil { - newImport.Name.NamePos = pos - } - newImport.Path.ValuePos = pos - newImport.EndPos = pos - - // Clean up parens. impDecl contains at least one spec. - if len(impDecl.Specs) == 1 { - // Remove unneeded parens. - impDecl.Lparen = token.NoPos - } else if !impDecl.Lparen.IsValid() { - // impDecl needs parens added. - impDecl.Lparen = impDecl.Specs[0].Pos() - } - - f.Imports = append(f.Imports, newImport) - - if len(f.Decls) <= 1 { - return true - } - - // Merge all the import declarations into the first one. - var first *ast.GenDecl - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT || declImports(gen, "C") { - continue - } - if first == nil { - first = gen - continue // Don't touch the first one. - } - // We now know there is more than one package in this import - // declaration. Ensure that it ends up parenthesized. - first.Lparen = first.Pos() - // Move the imports of the other import declaration to the first one. - for _, spec := range gen.Specs { - spec.(*ast.ImportSpec).Path.ValuePos = first.Pos() - first.Specs = append(first.Specs, spec) - } - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - i-- - } - - return true -} - -func isThirdParty(importPath string) bool { - // Third party package import path usually contains "." (".com", ".org", ...) - // This logic is taken from golang.org/x/tools/imports package. - return strings.Contains(importPath, ".") -} - -// DeleteImport deletes the import path from the file f, if present. -// If there are duplicate import declarations, all matching ones are deleted. -func DeleteImport(fset *token.FileSet, f *ast.File, path string) (deleted bool) { - return DeleteNamedImport(fset, f, "", path) -} - -// DeleteNamedImport deletes the import with the given name and path from the file f, if present. -// If there are duplicate import declarations, all matching ones are deleted. -func DeleteNamedImport(fset *token.FileSet, f *ast.File, name, path string) (deleted bool) { - var delspecs []*ast.ImportSpec - var delcomments []*ast.CommentGroup - - // Find the import nodes that import path, if any. - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT { - continue - } - for j := 0; j < len(gen.Specs); j++ { - spec := gen.Specs[j] - impspec := spec.(*ast.ImportSpec) - if importName(impspec) != name || importPath(impspec) != path { - continue - } - - // We found an import spec that imports path. - // Delete it. - delspecs = append(delspecs, impspec) - deleted = true - copy(gen.Specs[j:], gen.Specs[j+1:]) - gen.Specs = gen.Specs[:len(gen.Specs)-1] - - // If this was the last import spec in this decl, - // delete the decl, too. - if len(gen.Specs) == 0 { - copy(f.Decls[i:], f.Decls[i+1:]) - f.Decls = f.Decls[:len(f.Decls)-1] - i-- - break - } else if len(gen.Specs) == 1 { - if impspec.Doc != nil { - delcomments = append(delcomments, impspec.Doc) - } - if impspec.Comment != nil { - delcomments = append(delcomments, impspec.Comment) - } - for _, cg := range f.Comments { - // Found comment on the same line as the import spec. - if cg.End() < impspec.Pos() && fset.Position(cg.End()).Line == fset.Position(impspec.Pos()).Line { - delcomments = append(delcomments, cg) - break - } - } - - spec := gen.Specs[0].(*ast.ImportSpec) - - // Move the documentation right after the import decl. - if spec.Doc != nil { - for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Doc.Pos()).Line { - fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) - } - } - for _, cg := range f.Comments { - if cg.End() < spec.Pos() && fset.Position(cg.End()).Line == fset.Position(spec.Pos()).Line { - for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Pos()).Line { - fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) - } - break - } - } - } - if j > 0 { - lastImpspec := gen.Specs[j-1].(*ast.ImportSpec) - lastLine := fset.PositionFor(lastImpspec.Path.ValuePos, false).Line - line := fset.PositionFor(impspec.Path.ValuePos, false).Line - - // We deleted an entry but now there may be - // a blank line-sized hole where the import was. - if line-lastLine > 1 || !gen.Rparen.IsValid() { - // There was a blank line immediately preceding the deleted import, - // so there's no need to close the hole. The right parenthesis is - // invalid after AddImport to an import statement without parenthesis. - // Do nothing. - } else if line != fset.File(gen.Rparen).LineCount() { - // There was no blank line. Close the hole. - fset.File(gen.Rparen).MergeLine(line) - } - } - j-- - } - } - - // Delete imports from f.Imports. - for i := 0; i < len(f.Imports); i++ { - imp := f.Imports[i] - for j, del := range delspecs { - if imp == del { - copy(f.Imports[i:], f.Imports[i+1:]) - f.Imports = f.Imports[:len(f.Imports)-1] - copy(delspecs[j:], delspecs[j+1:]) - delspecs = delspecs[:len(delspecs)-1] - i-- - break - } - } - } - - // Delete comments from f.Comments. - for i := 0; i < len(f.Comments); i++ { - cg := f.Comments[i] - for j, del := range delcomments { - if cg == del { - copy(f.Comments[i:], f.Comments[i+1:]) - f.Comments = f.Comments[:len(f.Comments)-1] - copy(delcomments[j:], delcomments[j+1:]) - delcomments = delcomments[:len(delcomments)-1] - i-- - break - } - } - } - - if len(delspecs) > 0 { - panic(fmt.Sprintf("deleted specs from Decls but not Imports: %v", delspecs)) - } - - return -} - -// RewriteImport rewrites any import of path oldPath to path newPath. -func RewriteImport(fset *token.FileSet, f *ast.File, oldPath, newPath string) (rewrote bool) { - for _, imp := range f.Imports { - if importPath(imp) == oldPath { - rewrote = true - // record old End, because the default is to compute - // it using the length of imp.Path.Value. - imp.EndPos = imp.End() - imp.Path.Value = strconv.Quote(newPath) - } - } - return -} - -// UsesImport reports whether a given import is used. -func UsesImport(f *ast.File, path string) (used bool) { - spec := importSpec(f, path) - if spec == nil { - return - } - - name := spec.Name.String() - switch name { - case "": - // If the package name is not explicitly specified, - // make an educated guess. This is not guaranteed to be correct. - lastSlash := strings.LastIndex(path, "/") - if lastSlash == -1 { - name = path - } else { - name = path[lastSlash+1:] - } - case "_", ".": - // Not sure if this import is used - err on the side of caution. - return true - } - - ast.Walk(visitFn(func(n ast.Node) { - sel, ok := n.(*ast.SelectorExpr) - if ok && isTopName(sel.X, name) { - used = true - } - }), f) - - return -} - -type visitFn func(node ast.Node) - -func (fn visitFn) Visit(node ast.Node) ast.Visitor { - fn(node) - return fn -} - -// imports reports whether f has an import with the specified name and path. -func imports(f *ast.File, name, path string) bool { - for _, s := range f.Imports { - if importName(s) == name && importPath(s) == path { - return true - } - } - return false -} - -// importSpec returns the import spec if f imports path, -// or nil otherwise. -func importSpec(f *ast.File, path string) *ast.ImportSpec { - for _, s := range f.Imports { - if importPath(s) == path { - return s - } - } - return nil -} - -// importName returns the name of s, -// or "" if the import is not named. -func importName(s *ast.ImportSpec) string { - if s.Name == nil { - return "" - } - return s.Name.Name -} - -// importPath returns the unquoted import path of s, -// or "" if the path is not properly quoted. -func importPath(s *ast.ImportSpec) string { - t, err := strconv.Unquote(s.Path.Value) - if err != nil { - return "" - } - return t -} - -// declImports reports whether gen contains an import of path. -func declImports(gen *ast.GenDecl, path string) bool { - if gen.Tok != token.IMPORT { - return false - } - for _, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - if importPath(impspec) == path { - return true - } - } - return false -} - -// matchLen returns the length of the longest path segment prefix shared by x and y. -func matchLen(x, y string) int { - n := 0 - for i := 0; i < len(x) && i < len(y) && x[i] == y[i]; i++ { - if x[i] == '/' { - n++ - } - } - return n -} - -// isTopName returns true if n is a top-level unresolved identifier with the given name. -func isTopName(n ast.Expr, name string) bool { - id, ok := n.(*ast.Ident) - return ok && id.Name == name && id.Obj == nil -} - -// Imports returns the file imports grouped by paragraph. -func Imports(fset *token.FileSet, f *ast.File) [][]*ast.ImportSpec { - var groups [][]*ast.ImportSpec - - for _, decl := range f.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok || genDecl.Tok != token.IMPORT { - break - } - - group := []*ast.ImportSpec{} - - var lastLine int - for _, spec := range genDecl.Specs { - importSpec := spec.(*ast.ImportSpec) - pos := importSpec.Path.ValuePos - line := fset.Position(pos).Line - if lastLine > 0 && pos > 0 && line-lastLine > 1 { - groups = append(groups, group) - group = []*ast.ImportSpec{} - } - group = append(group, importSpec) - lastLine = line - } - groups = append(groups, group) - } - - return groups -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go deleted file mode 100644 index f430b21b9b9a..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/rewrite.go +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package astutil - -import ( - "fmt" - "go/ast" - "reflect" - "sort" - - "golang.org/x/tools/internal/typeparams" -) - -// An ApplyFunc is invoked by Apply for each node n, even if n is nil, -// before and/or after the node's children, using a Cursor describing -// the current node and providing operations on it. -// -// The return value of ApplyFunc controls the syntax tree traversal. -// See Apply for details. -type ApplyFunc func(*Cursor) bool - -// Apply traverses a syntax tree recursively, starting with root, -// and calling pre and post for each node as described below. -// Apply returns the syntax tree, possibly modified. -// -// If pre is not nil, it is called for each node before the node's -// children are traversed (pre-order). If pre returns false, no -// children are traversed, and post is not called for that node. -// -// If post is not nil, and a prior call of pre didn't return false, -// post is called for each node after its children are traversed -// (post-order). If post returns false, traversal is terminated and -// Apply returns immediately. -// -// Only fields that refer to AST nodes are considered children; -// i.e., token.Pos, Scopes, Objects, and fields of basic types -// (strings, etc.) are ignored. -// -// Children are traversed in the order in which they appear in the -// respective node's struct definition. A package's files are -// traversed in the filenames' alphabetical order. -func Apply(root ast.Node, pre, post ApplyFunc) (result ast.Node) { - parent := &struct{ ast.Node }{root} - defer func() { - if r := recover(); r != nil && r != abort { - panic(r) - } - result = parent.Node - }() - a := &application{pre: pre, post: post} - a.apply(parent, "Node", nil, root) - return -} - -var abort = new(int) // singleton, to signal termination of Apply - -// A Cursor describes a node encountered during Apply. -// Information about the node and its parent is available -// from the Node, Parent, Name, and Index methods. -// -// If p is a variable of type and value of the current parent node -// c.Parent(), and f is the field identifier with name c.Name(), -// the following invariants hold: -// -// p.f == c.Node() if c.Index() < 0 -// p.f[c.Index()] == c.Node() if c.Index() >= 0 -// -// The methods Replace, Delete, InsertBefore, and InsertAfter -// can be used to change the AST without disrupting Apply. -type Cursor struct { - parent ast.Node - name string - iter *iterator // valid if non-nil - node ast.Node -} - -// Node returns the current Node. -func (c *Cursor) Node() ast.Node { return c.node } - -// Parent returns the parent of the current Node. -func (c *Cursor) Parent() ast.Node { return c.parent } - -// Name returns the name of the parent Node field that contains the current Node. -// If the parent is a *ast.Package and the current Node is a *ast.File, Name returns -// the filename for the current Node. -func (c *Cursor) Name() string { return c.name } - -// Index reports the index >= 0 of the current Node in the slice of Nodes that -// contains it, or a value < 0 if the current Node is not part of a slice. -// The index of the current node changes if InsertBefore is called while -// processing the current node. -func (c *Cursor) Index() int { - if c.iter != nil { - return c.iter.index - } - return -1 -} - -// field returns the current node's parent field value. -func (c *Cursor) field() reflect.Value { - return reflect.Indirect(reflect.ValueOf(c.parent)).FieldByName(c.name) -} - -// Replace replaces the current Node with n. -// The replacement node is not walked by Apply. -func (c *Cursor) Replace(n ast.Node) { - if _, ok := c.node.(*ast.File); ok { - file, ok := n.(*ast.File) - if !ok { - panic("attempt to replace *ast.File with non-*ast.File") - } - c.parent.(*ast.Package).Files[c.name] = file - return - } - - v := c.field() - if i := c.Index(); i >= 0 { - v = v.Index(i) - } - v.Set(reflect.ValueOf(n)) -} - -// Delete deletes the current Node from its containing slice. -// If the current Node is not part of a slice, Delete panics. -// As a special case, if the current node is a package file, -// Delete removes it from the package's Files map. -func (c *Cursor) Delete() { - if _, ok := c.node.(*ast.File); ok { - delete(c.parent.(*ast.Package).Files, c.name) - return - } - - i := c.Index() - if i < 0 { - panic("Delete node not contained in slice") - } - v := c.field() - l := v.Len() - reflect.Copy(v.Slice(i, l), v.Slice(i+1, l)) - v.Index(l - 1).Set(reflect.Zero(v.Type().Elem())) - v.SetLen(l - 1) - c.iter.step-- -} - -// InsertAfter inserts n after the current Node in its containing slice. -// If the current Node is not part of a slice, InsertAfter panics. -// Apply does not walk n. -func (c *Cursor) InsertAfter(n ast.Node) { - i := c.Index() - if i < 0 { - panic("InsertAfter node not contained in slice") - } - v := c.field() - v.Set(reflect.Append(v, reflect.Zero(v.Type().Elem()))) - l := v.Len() - reflect.Copy(v.Slice(i+2, l), v.Slice(i+1, l)) - v.Index(i + 1).Set(reflect.ValueOf(n)) - c.iter.step++ -} - -// InsertBefore inserts n before the current Node in its containing slice. -// If the current Node is not part of a slice, InsertBefore panics. -// Apply will not walk n. -func (c *Cursor) InsertBefore(n ast.Node) { - i := c.Index() - if i < 0 { - panic("InsertBefore node not contained in slice") - } - v := c.field() - v.Set(reflect.Append(v, reflect.Zero(v.Type().Elem()))) - l := v.Len() - reflect.Copy(v.Slice(i+1, l), v.Slice(i, l)) - v.Index(i).Set(reflect.ValueOf(n)) - c.iter.index++ -} - -// application carries all the shared data so we can pass it around cheaply. -type application struct { - pre, post ApplyFunc - cursor Cursor - iter iterator -} - -func (a *application) apply(parent ast.Node, name string, iter *iterator, n ast.Node) { - // convert typed nil into untyped nil - if v := reflect.ValueOf(n); v.Kind() == reflect.Ptr && v.IsNil() { - n = nil - } - - // avoid heap-allocating a new cursor for each apply call; reuse a.cursor instead - saved := a.cursor - a.cursor.parent = parent - a.cursor.name = name - a.cursor.iter = iter - a.cursor.node = n - - if a.pre != nil && !a.pre(&a.cursor) { - a.cursor = saved - return - } - - // walk children - // (the order of the cases matches the order of the corresponding node types in go/ast) - switch n := n.(type) { - case nil: - // nothing to do - - // Comments and fields - case *ast.Comment: - // nothing to do - - case *ast.CommentGroup: - if n != nil { - a.applyList(n, "List") - } - - case *ast.Field: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Names") - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Tag", nil, n.Tag) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.FieldList: - a.applyList(n, "List") - - // Expressions - case *ast.BadExpr, *ast.Ident, *ast.BasicLit: - // nothing to do - - case *ast.Ellipsis: - a.apply(n, "Elt", nil, n.Elt) - - case *ast.FuncLit: - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Body", nil, n.Body) - - case *ast.CompositeLit: - a.apply(n, "Type", nil, n.Type) - a.applyList(n, "Elts") - - case *ast.ParenExpr: - a.apply(n, "X", nil, n.X) - - case *ast.SelectorExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Sel", nil, n.Sel) - - case *ast.IndexExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Index", nil, n.Index) - - case *typeparams.IndexListExpr: - a.apply(n, "X", nil, n.X) - a.applyList(n, "Indices") - - case *ast.SliceExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Low", nil, n.Low) - a.apply(n, "High", nil, n.High) - a.apply(n, "Max", nil, n.Max) - - case *ast.TypeAssertExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Type", nil, n.Type) - - case *ast.CallExpr: - a.apply(n, "Fun", nil, n.Fun) - a.applyList(n, "Args") - - case *ast.StarExpr: - a.apply(n, "X", nil, n.X) - - case *ast.UnaryExpr: - a.apply(n, "X", nil, n.X) - - case *ast.BinaryExpr: - a.apply(n, "X", nil, n.X) - a.apply(n, "Y", nil, n.Y) - - case *ast.KeyValueExpr: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - - // Types - case *ast.ArrayType: - a.apply(n, "Len", nil, n.Len) - a.apply(n, "Elt", nil, n.Elt) - - case *ast.StructType: - a.apply(n, "Fields", nil, n.Fields) - - case *ast.FuncType: - if tparams := typeparams.ForFuncType(n); tparams != nil { - a.apply(n, "TypeParams", nil, tparams) - } - a.apply(n, "Params", nil, n.Params) - a.apply(n, "Results", nil, n.Results) - - case *ast.InterfaceType: - a.apply(n, "Methods", nil, n.Methods) - - case *ast.MapType: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - - case *ast.ChanType: - a.apply(n, "Value", nil, n.Value) - - // Statements - case *ast.BadStmt: - // nothing to do - - case *ast.DeclStmt: - a.apply(n, "Decl", nil, n.Decl) - - case *ast.EmptyStmt: - // nothing to do - - case *ast.LabeledStmt: - a.apply(n, "Label", nil, n.Label) - a.apply(n, "Stmt", nil, n.Stmt) - - case *ast.ExprStmt: - a.apply(n, "X", nil, n.X) - - case *ast.SendStmt: - a.apply(n, "Chan", nil, n.Chan) - a.apply(n, "Value", nil, n.Value) - - case *ast.IncDecStmt: - a.apply(n, "X", nil, n.X) - - case *ast.AssignStmt: - a.applyList(n, "Lhs") - a.applyList(n, "Rhs") - - case *ast.GoStmt: - a.apply(n, "Call", nil, n.Call) - - case *ast.DeferStmt: - a.apply(n, "Call", nil, n.Call) - - case *ast.ReturnStmt: - a.applyList(n, "Results") - - case *ast.BranchStmt: - a.apply(n, "Label", nil, n.Label) - - case *ast.BlockStmt: - a.applyList(n, "List") - - case *ast.IfStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Cond", nil, n.Cond) - a.apply(n, "Body", nil, n.Body) - a.apply(n, "Else", nil, n.Else) - - case *ast.CaseClause: - a.applyList(n, "List") - a.applyList(n, "Body") - - case *ast.SwitchStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Tag", nil, n.Tag) - a.apply(n, "Body", nil, n.Body) - - case *ast.TypeSwitchStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Assign", nil, n.Assign) - a.apply(n, "Body", nil, n.Body) - - case *ast.CommClause: - a.apply(n, "Comm", nil, n.Comm) - a.applyList(n, "Body") - - case *ast.SelectStmt: - a.apply(n, "Body", nil, n.Body) - - case *ast.ForStmt: - a.apply(n, "Init", nil, n.Init) - a.apply(n, "Cond", nil, n.Cond) - a.apply(n, "Post", nil, n.Post) - a.apply(n, "Body", nil, n.Body) - - case *ast.RangeStmt: - a.apply(n, "Key", nil, n.Key) - a.apply(n, "Value", nil, n.Value) - a.apply(n, "X", nil, n.X) - a.apply(n, "Body", nil, n.Body) - - // Declarations - case *ast.ImportSpec: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - a.apply(n, "Path", nil, n.Path) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.ValueSpec: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Names") - a.apply(n, "Type", nil, n.Type) - a.applyList(n, "Values") - a.apply(n, "Comment", nil, n.Comment) - - case *ast.TypeSpec: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - if tparams := typeparams.ForTypeSpec(n); tparams != nil { - a.apply(n, "TypeParams", nil, tparams) - } - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Comment", nil, n.Comment) - - case *ast.BadDecl: - // nothing to do - - case *ast.GenDecl: - a.apply(n, "Doc", nil, n.Doc) - a.applyList(n, "Specs") - - case *ast.FuncDecl: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Recv", nil, n.Recv) - a.apply(n, "Name", nil, n.Name) - a.apply(n, "Type", nil, n.Type) - a.apply(n, "Body", nil, n.Body) - - // Files and packages - case *ast.File: - a.apply(n, "Doc", nil, n.Doc) - a.apply(n, "Name", nil, n.Name) - a.applyList(n, "Decls") - // Don't walk n.Comments; they have either been walked already if - // they are Doc comments, or they can be easily walked explicitly. - - case *ast.Package: - // collect and sort names for reproducible behavior - var names []string - for name := range n.Files { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - a.apply(n, name, nil, n.Files[name]) - } - - default: - panic(fmt.Sprintf("Apply: unexpected node type %T", n)) - } - - if a.post != nil && !a.post(&a.cursor) { - panic(abort) - } - - a.cursor = saved -} - -// An iterator controls iteration over a slice of nodes. -type iterator struct { - index, step int -} - -func (a *application) applyList(parent ast.Node, name string) { - // avoid heap-allocating a new iterator for each applyList call; reuse a.iter instead - saved := a.iter - a.iter.index = 0 - for { - // must reload parent.name each time, since cursor modifications might change it - v := reflect.Indirect(reflect.ValueOf(parent)).FieldByName(name) - if a.iter.index >= v.Len() { - break - } - - // element x may be nil in a bad AST - be cautious - var x ast.Node - if e := v.Index(a.iter.index); e.IsValid() { - x = e.Interface().(ast.Node) - } - - a.iter.step = 1 - a.apply(parent, name, &a.iter, x) - a.iter.index += a.iter.step - } - a.iter = saved -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/util.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/util.go deleted file mode 100644 index 919d5305ab42..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/ast/astutil/util.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package astutil - -import "go/ast" - -// Unparen returns e with any enclosing parentheses stripped. -func Unparen(e ast.Expr) ast.Expr { - for { - p, ok := e.(*ast.ParenExpr) - if !ok { - return e - } - e = p.X - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go deleted file mode 100644 index 03543bd4bb8f..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gcexportdata provides functions for locating, reading, and -// writing export data files containing type information produced by the -// gc compiler. This package supports go1.7 export data format and all -// later versions. -// -// Although it might seem convenient for this package to live alongside -// go/types in the standard library, this would cause version skew -// problems for developer tools that use it, since they must be able to -// consume the outputs of the gc compiler both before and after a Go -// update such as from Go 1.7 to Go 1.8. Because this package lives in -// golang.org/x/tools, sites can update their version of this repo some -// time before the Go 1.8 release and rebuild and redeploy their -// developer tools, which will then be able to consume both Go 1.7 and -// Go 1.8 export data files, so they will work before and after the -// Go update. (See discussion at https://golang.org/issue/15651.) -package gcexportdata // import "golang.org/x/tools/go/gcexportdata" - -import ( - "bufio" - "bytes" - "encoding/json" - "fmt" - "go/token" - "go/types" - "io" - "os/exec" - - "golang.org/x/tools/internal/gcimporter" -) - -// Find returns the name of an object (.o) or archive (.a) file -// containing type information for the specified import path, -// using the go command. -// If no file was found, an empty filename is returned. -// -// A relative srcDir is interpreted relative to the current working directory. -// -// Find also returns the package's resolved (canonical) import path, -// reflecting the effects of srcDir and vendoring on importPath. -// -// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages, -// which is more efficient. -func Find(importPath, srcDir string) (filename, path string) { - cmd := exec.Command("go", "list", "-json", "-export", "--", importPath) - cmd.Dir = srcDir - out, err := cmd.CombinedOutput() - if err != nil { - return "", "" - } - var data struct { - ImportPath string - Export string - } - json.Unmarshal(out, &data) - return data.Export, data.ImportPath -} - -// NewReader returns a reader for the export data section of an object -// (.o) or archive (.a) file read from r. The new reader may provide -// additional trailing data beyond the end of the export data. -func NewReader(r io.Reader) (io.Reader, error) { - buf := bufio.NewReader(r) - _, size, err := gcimporter.FindExportData(buf) - if err != nil { - return nil, err - } - - if size >= 0 { - // We were given an archive and found the __.PKGDEF in it. - // This tells us the size of the export data, and we don't - // need to return the entire file. - return &io.LimitedReader{ - R: buf, - N: size, - }, nil - } else { - // We were given an object file. As such, we don't know how large - // the export data is and must return the entire file. - return buf, nil - } -} - -// readAll works the same way as io.ReadAll, but avoids allocations and copies -// by preallocating a byte slice of the necessary size if the size is known up -// front. This is always possible when the input is an archive. In that case, -// NewReader will return the known size using an io.LimitedReader. -func readAll(r io.Reader) ([]byte, error) { - if lr, ok := r.(*io.LimitedReader); ok { - data := make([]byte, lr.N) - _, err := io.ReadFull(lr, data) - return data, err - } - return io.ReadAll(r) -} - -// Read reads export data from in, decodes it, and returns type -// information for the package. -// -// The package path (effectively its linker symbol prefix) is -// specified by path, since unlike the package name, this information -// may not be recorded in the export data. -// -// File position information is added to fset. -// -// Read may inspect and add to the imports map to ensure that references -// within the export data to other packages are consistent. The caller -// must ensure that imports[path] does not exist, or exists but is -// incomplete (see types.Package.Complete), and Read inserts the -// resulting package into this map entry. -// -// On return, the state of the reader is undefined. -func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package, path string) (*types.Package, error) { - data, err := readAll(in) - if err != nil { - return nil, fmt.Errorf("reading export data for %q: %v", path, err) - } - - if bytes.HasPrefix(data, []byte("!")) { - return nil, fmt.Errorf("can't read export data for %q directly from an archive file (call gcexportdata.NewReader first to extract export data)", path) - } - - // The indexed export format starts with an 'i'; the older - // binary export format starts with a 'c', 'd', or 'v' - // (from "version"). Select appropriate importer. - if len(data) > 0 { - switch data[0] { - case 'v', 'c', 'd': // binary, till go1.10 - return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0]) - - case 'i': // indexed, till go1.19 - _, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path) - return pkg, err - - case 'u': // unified, from go1.20 - _, pkg, err := gcimporter.UImportData(fset, imports, data[1:], path) - return pkg, err - - default: - l := len(data) - if l > 10 { - l = 10 - } - return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), path) - } - } - return nil, fmt.Errorf("empty export data for %s", path) -} - -// Write writes encoded type information for the specified package to out. -// The FileSet provides file position information for named objects. -func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - if _, err := io.WriteString(out, "i"); err != nil { - return err - } - return gcimporter.IExportData(out, fset, pkg) -} - -// ReadBundle reads an export bundle from in, decodes it, and returns type -// information for the packages. -// File position information is added to fset. -// -// ReadBundle may inspect and add to the imports map to ensure that references -// within the export bundle to other packages are consistent. -// -// On return, the state of the reader is undefined. -// -// Experimental: This API is experimental and may change in the future. -func ReadBundle(in io.Reader, fset *token.FileSet, imports map[string]*types.Package) ([]*types.Package, error) { - data, err := readAll(in) - if err != nil { - return nil, fmt.Errorf("reading export bundle: %v", err) - } - return gcimporter.IImportBundle(fset, imports, data) -} - -// WriteBundle writes encoded type information for the specified packages to out. -// The FileSet provides file position information for named objects. -// -// Experimental: This API is experimental and may change in the future. -func WriteBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { - return gcimporter.IExportBundle(out, fset, pkgs) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/gcexportdata/importer.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/gcexportdata/importer.go deleted file mode 100644 index 37a7247e2686..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/gcexportdata/importer.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gcexportdata - -import ( - "fmt" - "go/token" - "go/types" - "os" -) - -// NewImporter returns a new instance of the types.Importer interface -// that reads type information from export data files written by gc. -// The Importer also satisfies types.ImporterFrom. -// -// Export data files are located using "go build" workspace conventions -// and the build.Default context. -// -// Use this importer instead of go/importer.For("gc", ...) to avoid the -// version-skew problems described in the documentation of this package, -// or to control the FileSet or access the imports map populated during -// package loading. -// -// Deprecated: Use the higher-level API in golang.org/x/tools/go/packages, -// which is more efficient. -func NewImporter(fset *token.FileSet, imports map[string]*types.Package) types.ImporterFrom { - return importer{fset, imports} -} - -type importer struct { - fset *token.FileSet - imports map[string]*types.Package -} - -func (imp importer) Import(importPath string) (*types.Package, error) { - return imp.ImportFrom(importPath, "", 0) -} - -func (imp importer) ImportFrom(importPath, srcDir string, mode types.ImportMode) (_ *types.Package, err error) { - filename, path := Find(importPath, srcDir) - if filename == "" { - if importPath == "unsafe" { - // Even for unsafe, call Find first in case - // the package was vendored. - return types.Unsafe, nil - } - return nil, fmt.Errorf("can't find import: %s", importPath) - } - - if pkg, ok := imp.imports[path]; ok && pkg.Complete() { - return pkg, nil // cache hit - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - f.Close() - if err != nil { - // add file name to error - err = fmt.Errorf("reading export data: %s: %v", filename, err) - } - }() - - r, err := NewReader(f) - if err != nil { - return nil, err - } - - return Read(r, imp.fset, imp.imports, path) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go deleted file mode 100644 index 18a002f82a1f..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package packagesdriver fetches type sizes for go/packages and go/analysis. -package packagesdriver - -import ( - "context" - "fmt" - "go/types" - "strings" - - "golang.org/x/tools/internal/gocommand" -) - -var debug = false - -func GetSizesGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (types.Sizes, error) { - inv.Verb = "list" - inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} - stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) - var goarch, compiler string - if rawErr != nil { - if rawErrMsg := rawErr.Error(); strings.Contains(rawErrMsg, "cannot find main module") || strings.Contains(rawErrMsg, "go.mod file not found") { - // User's running outside of a module. All bets are off. Get GOARCH and guess compiler is gc. - // TODO(matloob): Is this a problem in practice? - inv.Verb = "env" - inv.Args = []string{"GOARCH"} - envout, enverr := gocmdRunner.Run(ctx, inv) - if enverr != nil { - return nil, enverr - } - goarch = strings.TrimSpace(envout.String()) - compiler = "gc" - } else { - return nil, friendlyErr - } - } else { - fields := strings.Fields(stdout.String()) - if len(fields) < 2 { - return nil, fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", - stdout.String(), stderr.String()) - } - goarch = fields[0] - compiler = fields[1] - } - return types.SizesFor(compiler, goarch), nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/doc.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/doc.go deleted file mode 100644 index da4ab89fe63f..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/doc.go +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package packages loads Go packages for inspection and analysis. - -The Load function takes as input a list of patterns and return a list of Package -structs describing individual packages matched by those patterns. -The LoadMode controls the amount of detail in the loaded packages. - -Load passes most patterns directly to the underlying build tool, -but all patterns with the prefix "query=", where query is a -non-empty string of letters from [a-z], are reserved and may be -interpreted as query operators. - -Two query operators are currently supported: "file" and "pattern". - -The query "file=path/to/file.go" matches the package or packages enclosing -the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go" -might return the packages "fmt" and "fmt [fmt.test]". - -The query "pattern=string" causes "string" to be passed directly to -the underlying build tool. In most cases this is unnecessary, -but an application can use Load("pattern=" + x) as an escaping mechanism -to ensure that x is not interpreted as a query operator if it contains '='. - -All other query operators are reserved for future use and currently -cause Load to report an error. - -The Package struct provides basic information about the package, including - - - ID, a unique identifier for the package in the returned set; - - GoFiles, the names of the package's Go source files; - - Imports, a map from source import strings to the Packages they name; - - Types, the type information for the package's exported symbols; - - Syntax, the parsed syntax trees for the package's source code; and - - TypeInfo, the result of a complete type-check of the package syntax trees. - -(See the documentation for type Package for the complete list of fields -and more detailed descriptions.) - -For example, - - Load(nil, "bytes", "unicode...") - -returns four Package structs describing the standard library packages -bytes, unicode, unicode/utf16, and unicode/utf8. Note that one pattern -can match multiple packages and that a package might be matched by -multiple patterns: in general it is not possible to determine which -packages correspond to which patterns. - -Note that the list returned by Load contains only the packages matched -by the patterns. Their dependencies can be found by walking the import -graph using the Imports fields. - -The Load function can be configured by passing a pointer to a Config as -the first argument. A nil Config is equivalent to the zero Config, which -causes Load to run in LoadFiles mode, collecting minimal information. -See the documentation for type Config for details. - -As noted earlier, the Config.Mode controls the amount of detail -reported about the loaded packages. See the documentation for type LoadMode -for details. - -Most tools should pass their command-line arguments (after any flags) -uninterpreted to the loader, so that the loader can interpret them -according to the conventions of the underlying build system. -See the Example function for typical usage. -*/ -package packages // import "golang.org/x/tools/go/packages" - -/* - -Motivation and design considerations - -The new package's design solves problems addressed by two existing -packages: go/build, which locates and describes packages, and -golang.org/x/tools/go/loader, which loads, parses and type-checks them. -The go/build.Package structure encodes too much of the 'go build' way -of organizing projects, leaving us in need of a data type that describes a -package of Go source code independent of the underlying build system. -We wanted something that works equally well with go build and vgo, and -also other build systems such as Bazel and Blaze, making it possible to -construct analysis tools that work in all these environments. -Tools such as errcheck and staticcheck were essentially unavailable to -the Go community at Google, and some of Google's internal tools for Go -are unavailable externally. -This new package provides a uniform way to obtain package metadata by -querying each of these build systems, optionally supporting their -preferred command-line notations for packages, so that tools integrate -neatly with users' build environments. The Metadata query function -executes an external query tool appropriate to the current workspace. - -Loading packages always returns the complete import graph "all the way down", -even if all you want is information about a single package, because the query -mechanisms of all the build systems we currently support ({go,vgo} list, and -blaze/bazel aspect-based query) cannot provide detailed information -about one package without visiting all its dependencies too, so there is -no additional asymptotic cost to providing transitive information. -(This property might not be true of a hypothetical 5th build system.) - -In calls to TypeCheck, all initial packages, and any package that -transitively depends on one of them, must be loaded from source. -Consider A->B->C->D->E: if A,C are initial, A,B,C must be loaded from -source; D may be loaded from export data, and E may not be loaded at all -(though it's possible that D's export data mentions it, so a -types.Package may be created for it and exposed.) - -The old loader had a feature to suppress type-checking of function -bodies on a per-package basis, primarily intended to reduce the work of -obtaining type information for imported packages. Now that imports are -satisfied by export data, the optimization no longer seems necessary. - -Despite some early attempts, the old loader did not exploit export data, -instead always using the equivalent of WholeProgram mode. This was due -to the complexity of mixing source and export data packages (now -resolved by the upward traversal mentioned above), and because export data -files were nearly always missing or stale. Now that 'go build' supports -caching, all the underlying build systems can guarantee to produce -export data in a reasonable (amortized) time. - -Test "main" packages synthesized by the build system are now reported as -first-class packages, avoiding the need for clients (such as go/ssa) to -reinvent this generation logic. - -One way in which go/packages is simpler than the old loader is in its -treatment of in-package tests. In-package tests are packages that -consist of all the files of the library under test, plus the test files. -The old loader constructed in-package tests by a two-phase process of -mutation called "augmentation": first it would construct and type check -all the ordinary library packages and type-check the packages that -depend on them; then it would add more (test) files to the package and -type-check again. This two-phase approach had four major problems: -1) in processing the tests, the loader modified the library package, - leaving no way for a client application to see both the test - package and the library package; one would mutate into the other. -2) because test files can declare additional methods on types defined in - the library portion of the package, the dispatch of method calls in - the library portion was affected by the presence of the test files. - This should have been a clue that the packages were logically - different. -3) this model of "augmentation" assumed at most one in-package test - per library package, which is true of projects using 'go build', - but not other build systems. -4) because of the two-phase nature of test processing, all packages that - import the library package had to be processed before augmentation, - forcing a "one-shot" API and preventing the client from calling Load - in several times in sequence as is now possible in WholeProgram mode. - (TypeCheck mode has a similar one-shot restriction for a different reason.) - -Early drafts of this package supported "multi-shot" operation. -Although it allowed clients to make a sequence of calls (or concurrent -calls) to Load, building up the graph of Packages incrementally, -it was of marginal value: it complicated the API -(since it allowed some options to vary across calls but not others), -it complicated the implementation, -it cannot be made to work in Types mode, as explained above, -and it was less efficient than making one combined call (when this is possible). -Among the clients we have inspected, none made multiple calls to load -but could not be easily and satisfactorily modified to make only a single call. -However, applications changes may be required. -For example, the ssadump command loads the user-specified packages -and in addition the runtime package. It is tempting to simply append -"runtime" to the user-provided list, but that does not work if the user -specified an ad-hoc package such as [a.go b.go]. -Instead, ssadump no longer requests the runtime package, -but seeks it among the dependencies of the user-specified packages, -and emits an error if it is not found. - -Overlays: The Overlay field in the Config allows providing alternate contents -for Go source files, by providing a mapping from file path to contents. -go/packages will pull in new imports added in overlay files when go/packages -is run in LoadImports mode or greater. -Overlay support for the go list driver isn't complete yet: if the file doesn't -exist on disk, it will only be recognized in an overlay if it is a non-test file -and the package would be reported even without the overlay. - -Questions & Tasks - -- Add GOARCH/GOOS? - They are not portable concepts, but could be made portable. - Our goal has been to allow users to express themselves using the conventions - of the underlying build system: if the build system honors GOARCH - during a build and during a metadata query, then so should - applications built atop that query mechanism. - Conversely, if the target architecture of the build is determined by - command-line flags, the application can pass the relevant - flags through to the build system using a command such as: - myapp -query_flag="--cpu=amd64" -query_flag="--os=darwin" - However, this approach is low-level, unwieldy, and non-portable. - GOOS and GOARCH seem important enough to warrant a dedicated option. - -- How should we handle partial failures such as a mixture of good and - malformed patterns, existing and non-existent packages, successful and - failed builds, import failures, import cycles, and so on, in a call to - Load? - -- Support bazel, blaze, and go1.10 list, not just go1.11 list. - -- Handle (and test) various partial success cases, e.g. - a mixture of good packages and: - invalid patterns - nonexistent packages - empty packages - packages with malformed package or import declarations - unreadable files - import cycles - other parse errors - type errors - Make sure we record errors at the correct place in the graph. - -- Missing packages among initial arguments are not reported. - Return bogus packages for them, like golist does. - -- "undeclared name" errors (for example) are reported out of source file - order. I suspect this is due to the breadth-first resolution now used - by go/types. Is that a bug? Discuss with gri. - -*/ diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/external.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/external.go deleted file mode 100644 index 7242a0a7d2be..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/external.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file enables an external tool to intercept package requests. -// If the tool is present then its results are used in preference to -// the go list command. - -package packages - -import ( - "bytes" - "encoding/json" - "fmt" - exec "golang.org/x/sys/execabs" - "os" - "strings" -) - -// The Driver Protocol -// -// The driver, given the inputs to a call to Load, returns metadata about the packages specified. -// This allows for different build systems to support go/packages by telling go/packages how the -// packages' source is organized. -// The driver is a binary, either specified by the GOPACKAGESDRIVER environment variable or in -// the path as gopackagesdriver. It's given the inputs to load in its argv. See the package -// documentation in doc.go for the full description of the patterns that need to be supported. -// A driver receives as a JSON-serialized driverRequest struct in standard input and will -// produce a JSON-serialized driverResponse (see definition in packages.go) in its standard output. - -// driverRequest is used to provide the portion of Load's Config that is needed by a driver. -type driverRequest struct { - Mode LoadMode `json:"mode"` - // Env specifies the environment the underlying build system should be run in. - Env []string `json:"env"` - // BuildFlags are flags that should be passed to the underlying build system. - BuildFlags []string `json:"build_flags"` - // Tests specifies whether the patterns should also return test packages. - Tests bool `json:"tests"` - // Overlay maps file paths (relative to the driver's working directory) to the byte contents - // of overlay files. - Overlay map[string][]byte `json:"overlay"` -} - -// findExternalDriver returns the file path of a tool that supplies -// the build system package structure, or "" if not found." -// If GOPACKAGESDRIVER is set in the environment findExternalTool returns its -// value, otherwise it searches for a binary named gopackagesdriver on the PATH. -func findExternalDriver(cfg *Config) driver { - const toolPrefix = "GOPACKAGESDRIVER=" - tool := "" - for _, env := range cfg.Env { - if val := strings.TrimPrefix(env, toolPrefix); val != env { - tool = val - } - } - if tool != "" && tool == "off" { - return nil - } - if tool == "" { - var err error - tool, err = exec.LookPath("gopackagesdriver") - if err != nil { - return nil - } - } - return func(cfg *Config, words ...string) (*driverResponse, error) { - req, err := json.Marshal(driverRequest{ - Mode: cfg.Mode, - Env: cfg.Env, - BuildFlags: cfg.BuildFlags, - Tests: cfg.Tests, - Overlay: cfg.Overlay, - }) - if err != nil { - return nil, fmt.Errorf("failed to encode message to driver tool: %v", err) - } - - buf := new(bytes.Buffer) - stderr := new(bytes.Buffer) - cmd := exec.CommandContext(cfg.Context, tool, words...) - cmd.Dir = cfg.Dir - cmd.Env = cfg.Env - cmd.Stdin = bytes.NewReader(req) - cmd.Stdout = buf - cmd.Stderr = stderr - - if err := cmd.Run(); err != nil { - return nil, fmt.Errorf("%v: %v: %s", tool, err, cmd.Stderr) - } - if len(stderr.Bytes()) != 0 && os.Getenv("GOPACKAGESPRINTDRIVERERRORS") != "" { - fmt.Fprintf(os.Stderr, "%s stderr: <<%s>>\n", cmdDebugStr(cmd), stderr) - } - - var response driverResponse - if err := json.Unmarshal(buf.Bytes(), &response); err != nil { - return nil, err - } - return &response, nil - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/golist.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/golist.go deleted file mode 100644 index 58230038a7ce..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/golist.go +++ /dev/null @@ -1,1183 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "go/types" - "io/ioutil" - "log" - "os" - "path" - "path/filepath" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "unicode" - - exec "golang.org/x/sys/execabs" - "golang.org/x/tools/go/internal/packagesdriver" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/packagesinternal" -) - -// debug controls verbose logging. -var debug, _ = strconv.ParseBool(os.Getenv("GOPACKAGESDEBUG")) - -// A goTooOldError reports that the go command -// found by exec.LookPath is too old to use the new go list behavior. -type goTooOldError struct { - error -} - -// responseDeduper wraps a driverResponse, deduplicating its contents. -type responseDeduper struct { - seenRoots map[string]bool - seenPackages map[string]*Package - dr *driverResponse -} - -func newDeduper() *responseDeduper { - return &responseDeduper{ - dr: &driverResponse{}, - seenRoots: map[string]bool{}, - seenPackages: map[string]*Package{}, - } -} - -// addAll fills in r with a driverResponse. -func (r *responseDeduper) addAll(dr *driverResponse) { - for _, pkg := range dr.Packages { - r.addPackage(pkg) - } - for _, root := range dr.Roots { - r.addRoot(root) - } - r.dr.GoVersion = dr.GoVersion -} - -func (r *responseDeduper) addPackage(p *Package) { - if r.seenPackages[p.ID] != nil { - return - } - r.seenPackages[p.ID] = p - r.dr.Packages = append(r.dr.Packages, p) -} - -func (r *responseDeduper) addRoot(id string) { - if r.seenRoots[id] { - return - } - r.seenRoots[id] = true - r.dr.Roots = append(r.dr.Roots, id) -} - -type golistState struct { - cfg *Config - ctx context.Context - - envOnce sync.Once - goEnvError error - goEnv map[string]string - - rootsOnce sync.Once - rootDirsError error - rootDirs map[string]string - - goVersionOnce sync.Once - goVersionError error - goVersion int // The X in Go 1.X. - - // vendorDirs caches the (non)existence of vendor directories. - vendorDirs map[string]bool -} - -// getEnv returns Go environment variables. Only specific variables are -// populated -- computing all of them is slow. -func (state *golistState) getEnv() (map[string]string, error) { - state.envOnce.Do(func() { - var b *bytes.Buffer - b, state.goEnvError = state.invokeGo("env", "-json", "GOMOD", "GOPATH") - if state.goEnvError != nil { - return - } - - state.goEnv = make(map[string]string) - decoder := json.NewDecoder(b) - if state.goEnvError = decoder.Decode(&state.goEnv); state.goEnvError != nil { - return - } - }) - return state.goEnv, state.goEnvError -} - -// mustGetEnv is a convenience function that can be used if getEnv has already succeeded. -func (state *golistState) mustGetEnv() map[string]string { - env, err := state.getEnv() - if err != nil { - panic(fmt.Sprintf("mustGetEnv: %v", err)) - } - return env -} - -// goListDriver uses the go list command to interpret the patterns and produce -// the build system package structure. -// See driver for more details. -func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { - // Make sure that any asynchronous go commands are killed when we return. - parentCtx := cfg.Context - if parentCtx == nil { - parentCtx = context.Background() - } - ctx, cancel := context.WithCancel(parentCtx) - defer cancel() - - response := newDeduper() - - state := &golistState{ - cfg: cfg, - ctx: ctx, - vendorDirs: map[string]bool{}, - } - - // Fill in response.Sizes asynchronously if necessary. - var sizeserr error - var sizeswg sync.WaitGroup - if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 { - sizeswg.Add(1) - go func() { - var sizes types.Sizes - sizes, sizeserr = packagesdriver.GetSizesGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner) - // types.SizesFor always returns nil or a *types.StdSizes. - response.dr.Sizes, _ = sizes.(*types.StdSizes) - sizeswg.Done() - }() - } - - // Determine files requested in contains patterns - var containFiles []string - restPatterns := make([]string, 0, len(patterns)) - // Extract file= and other [querytype]= patterns. Report an error if querytype - // doesn't exist. -extractQueries: - for _, pattern := range patterns { - eqidx := strings.Index(pattern, "=") - if eqidx < 0 { - restPatterns = append(restPatterns, pattern) - } else { - query, value := pattern[:eqidx], pattern[eqidx+len("="):] - switch query { - case "file": - containFiles = append(containFiles, value) - case "pattern": - restPatterns = append(restPatterns, value) - case "": // not a reserved query - restPatterns = append(restPatterns, pattern) - default: - for _, rune := range query { - if rune < 'a' || rune > 'z' { // not a reserved query - restPatterns = append(restPatterns, pattern) - continue extractQueries - } - } - // Reject all other patterns containing "=" - return nil, fmt.Errorf("invalid query type %q in query pattern %q", query, pattern) - } - } - } - - // See if we have any patterns to pass through to go list. Zero initial - // patterns also requires a go list call, since it's the equivalent of - // ".". - if len(restPatterns) > 0 || len(patterns) == 0 { - dr, err := state.createDriverResponse(restPatterns...) - if err != nil { - return nil, err - } - response.addAll(dr) - } - - if len(containFiles) != 0 { - if err := state.runContainsQueries(response, containFiles); err != nil { - return nil, err - } - } - - // Only use go/packages' overlay processing if we're using a Go version - // below 1.16. Otherwise, go list handles it. - if goVersion, err := state.getGoVersion(); err == nil && goVersion < 16 { - modifiedPkgs, needPkgs, err := state.processGolistOverlay(response) - if err != nil { - return nil, err - } - - var containsCandidates []string - if len(containFiles) > 0 { - containsCandidates = append(containsCandidates, modifiedPkgs...) - containsCandidates = append(containsCandidates, needPkgs...) - } - if err := state.addNeededOverlayPackages(response, needPkgs); err != nil { - return nil, err - } - // Check candidate packages for containFiles. - if len(containFiles) > 0 { - for _, id := range containsCandidates { - pkg, ok := response.seenPackages[id] - if !ok { - response.addPackage(&Package{ - ID: id, - Errors: []Error{{ - Kind: ListError, - Msg: fmt.Sprintf("package %s expected but not seen", id), - }}, - }) - continue - } - for _, f := range containFiles { - for _, g := range pkg.GoFiles { - if sameFile(f, g) { - response.addRoot(id) - } - } - } - } - } - // Add root for any package that matches a pattern. This applies only to - // packages that are modified by overlays, since they are not added as - // roots automatically. - for _, pattern := range restPatterns { - match := matchPattern(pattern) - for _, pkgID := range modifiedPkgs { - pkg, ok := response.seenPackages[pkgID] - if !ok { - continue - } - if match(pkg.PkgPath) { - response.addRoot(pkg.ID) - } - } - } - } - - sizeswg.Wait() - if sizeserr != nil { - return nil, sizeserr - } - return response.dr, nil -} - -func (state *golistState) addNeededOverlayPackages(response *responseDeduper, pkgs []string) error { - if len(pkgs) == 0 { - return nil - } - dr, err := state.createDriverResponse(pkgs...) - if err != nil { - return err - } - for _, pkg := range dr.Packages { - response.addPackage(pkg) - } - _, needPkgs, err := state.processGolistOverlay(response) - if err != nil { - return err - } - return state.addNeededOverlayPackages(response, needPkgs) -} - -func (state *golistState) runContainsQueries(response *responseDeduper, queries []string) error { - for _, query := range queries { - // TODO(matloob): Do only one query per directory. - fdir := filepath.Dir(query) - // Pass absolute path of directory to go list so that it knows to treat it as a directory, - // not a package path. - pattern, err := filepath.Abs(fdir) - if err != nil { - return fmt.Errorf("could not determine absolute path of file= query path %q: %v", query, err) - } - dirResponse, err := state.createDriverResponse(pattern) - - // If there was an error loading the package, or no packages are returned, - // or the package is returned with errors, try to load the file as an - // ad-hoc package. - // Usually the error will appear in a returned package, but may not if we're - // in module mode and the ad-hoc is located outside a module. - if err != nil || len(dirResponse.Packages) == 0 || len(dirResponse.Packages) == 1 && len(dirResponse.Packages[0].GoFiles) == 0 && - len(dirResponse.Packages[0].Errors) == 1 { - var queryErr error - if dirResponse, queryErr = state.adhocPackage(pattern, query); queryErr != nil { - return err // return the original error - } - } - isRoot := make(map[string]bool, len(dirResponse.Roots)) - for _, root := range dirResponse.Roots { - isRoot[root] = true - } - for _, pkg := range dirResponse.Packages { - // Add any new packages to the main set - // We don't bother to filter packages that will be dropped by the changes of roots, - // that will happen anyway during graph construction outside this function. - // Over-reporting packages is not a problem. - response.addPackage(pkg) - // if the package was not a root one, it cannot have the file - if !isRoot[pkg.ID] { - continue - } - for _, pkgFile := range pkg.GoFiles { - if filepath.Base(query) == filepath.Base(pkgFile) { - response.addRoot(pkg.ID) - break - } - } - } - } - return nil -} - -// adhocPackage attempts to load or construct an ad-hoc package for a given -// query, if the original call to the driver produced inadequate results. -func (state *golistState) adhocPackage(pattern, query string) (*driverResponse, error) { - response, err := state.createDriverResponse(query) - if err != nil { - return nil, err - } - // If we get nothing back from `go list`, - // try to make this file into its own ad-hoc package. - // TODO(rstambler): Should this check against the original response? - if len(response.Packages) == 0 { - response.Packages = append(response.Packages, &Package{ - ID: "command-line-arguments", - PkgPath: query, - GoFiles: []string{query}, - CompiledGoFiles: []string{query}, - Imports: make(map[string]*Package), - }) - response.Roots = append(response.Roots, "command-line-arguments") - } - // Handle special cases. - if len(response.Packages) == 1 { - // golang/go#33482: If this is a file= query for ad-hoc packages where - // the file only exists on an overlay, and exists outside of a module, - // add the file to the package and remove the errors. - if response.Packages[0].ID == "command-line-arguments" || - filepath.ToSlash(response.Packages[0].PkgPath) == filepath.ToSlash(query) { - if len(response.Packages[0].GoFiles) == 0 { - filename := filepath.Join(pattern, filepath.Base(query)) // avoid recomputing abspath - // TODO(matloob): check if the file is outside of a root dir? - for path := range state.cfg.Overlay { - if path == filename { - response.Packages[0].Errors = nil - response.Packages[0].GoFiles = []string{path} - response.Packages[0].CompiledGoFiles = []string{path} - } - } - } - } - } - return response, nil -} - -// Fields must match go list; -// see $GOROOT/src/cmd/go/internal/load/pkg.go. -type jsonPackage struct { - ImportPath string - Dir string - Name string - Export string - GoFiles []string - CompiledGoFiles []string - IgnoredGoFiles []string - IgnoredOtherFiles []string - EmbedPatterns []string - EmbedFiles []string - CFiles []string - CgoFiles []string - CXXFiles []string - MFiles []string - HFiles []string - FFiles []string - SFiles []string - SwigFiles []string - SwigCXXFiles []string - SysoFiles []string - Imports []string - ImportMap map[string]string - Deps []string - Module *Module - TestGoFiles []string - TestImports []string - XTestGoFiles []string - XTestImports []string - ForTest string // q in a "p [q.test]" package, else "" - DepOnly bool - - Error *packagesinternal.PackageError - DepsErrors []*packagesinternal.PackageError -} - -type jsonPackageError struct { - ImportStack []string - Pos string - Err string -} - -func otherFiles(p *jsonPackage) [][]string { - return [][]string{p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.FFiles, p.SFiles, p.SwigFiles, p.SwigCXXFiles, p.SysoFiles} -} - -// createDriverResponse uses the "go list" command to expand the pattern -// words and return a response for the specified packages. -func (state *golistState) createDriverResponse(words ...string) (*driverResponse, error) { - // go list uses the following identifiers in ImportPath and Imports: - // - // "p" -- importable package or main (command) - // "q.test" -- q's test executable - // "p [q.test]" -- variant of p as built for q's test executable - // "q_test [q.test]" -- q's external test package - // - // The packages p that are built differently for a test q.test - // are q itself, plus any helpers used by the external test q_test, - // typically including "testing" and all its dependencies. - - // Run "go list" for complete - // information on the specified packages. - goVersion, err := state.getGoVersion() - if err != nil { - return nil, err - } - buf, err := state.invokeGo("list", golistargs(state.cfg, words, goVersion)...) - if err != nil { - return nil, err - } - - seen := make(map[string]*jsonPackage) - pkgs := make(map[string]*Package) - additionalErrors := make(map[string][]Error) - // Decode the JSON and convert it to Package form. - response := &driverResponse{ - GoVersion: goVersion, - } - for dec := json.NewDecoder(buf); dec.More(); { - p := new(jsonPackage) - if err := dec.Decode(p); err != nil { - return nil, fmt.Errorf("JSON decoding failed: %v", err) - } - - if p.ImportPath == "" { - // The documentation for go list says that “[e]rroneous packages will have - // a non-empty ImportPath”. If for some reason it comes back empty, we - // prefer to error out rather than silently discarding data or handing - // back a package without any way to refer to it. - if p.Error != nil { - return nil, Error{ - Pos: p.Error.Pos, - Msg: p.Error.Err, - } - } - return nil, fmt.Errorf("package missing import path: %+v", p) - } - - // Work around https://golang.org/issue/33157: - // go list -e, when given an absolute path, will find the package contained at - // that directory. But when no package exists there, it will return a fake package - // with an error and the ImportPath set to the absolute path provided to go list. - // Try to convert that absolute path to what its package path would be if it's - // contained in a known module or GOPATH entry. This will allow the package to be - // properly "reclaimed" when overlays are processed. - if filepath.IsAbs(p.ImportPath) && p.Error != nil { - pkgPath, ok, err := state.getPkgPath(p.ImportPath) - if err != nil { - return nil, err - } - if ok { - p.ImportPath = pkgPath - } - } - - if old, found := seen[p.ImportPath]; found { - // If one version of the package has an error, and the other doesn't, assume - // that this is a case where go list is reporting a fake dependency variant - // of the imported package: When a package tries to invalidly import another - // package, go list emits a variant of the imported package (with the same - // import path, but with an error on it, and the package will have a - // DepError set on it). An example of when this can happen is for imports of - // main packages: main packages can not be imported, but they may be - // separately matched and listed by another pattern. - // See golang.org/issue/36188 for more details. - - // The plan is that eventually, hopefully in Go 1.15, the error will be - // reported on the importing package rather than the duplicate "fake" - // version of the imported package. Once all supported versions of Go - // have the new behavior this logic can be deleted. - // TODO(matloob): delete the workaround logic once all supported versions of - // Go return the errors on the proper package. - - // There should be exactly one version of a package that doesn't have an - // error. - if old.Error == nil && p.Error == nil { - if !reflect.DeepEqual(p, old) { - return nil, fmt.Errorf("internal error: go list gives conflicting information for package %v", p.ImportPath) - } - continue - } - - // Determine if this package's error needs to be bubbled up. - // This is a hack, and we expect for go list to eventually set the error - // on the package. - if old.Error != nil { - var errkind string - if strings.Contains(old.Error.Err, "not an importable package") { - errkind = "not an importable package" - } else if strings.Contains(old.Error.Err, "use of internal package") && strings.Contains(old.Error.Err, "not allowed") { - errkind = "use of internal package not allowed" - } - if errkind != "" { - if len(old.Error.ImportStack) < 1 { - return nil, fmt.Errorf(`internal error: go list gave a %q error with empty import stack`, errkind) - } - importingPkg := old.Error.ImportStack[len(old.Error.ImportStack)-1] - if importingPkg == old.ImportPath { - // Using an older version of Go which put this package itself on top of import - // stack, instead of the importer. Look for importer in second from top - // position. - if len(old.Error.ImportStack) < 2 { - return nil, fmt.Errorf(`internal error: go list gave a %q error with an import stack without importing package`, errkind) - } - importingPkg = old.Error.ImportStack[len(old.Error.ImportStack)-2] - } - additionalErrors[importingPkg] = append(additionalErrors[importingPkg], Error{ - Pos: old.Error.Pos, - Msg: old.Error.Err, - Kind: ListError, - }) - } - } - - // Make sure that if there's a version of the package without an error, - // that's the one reported to the user. - if old.Error == nil { - continue - } - - // This package will replace the old one at the end of the loop. - } - seen[p.ImportPath] = p - - pkg := &Package{ - Name: p.Name, - ID: p.ImportPath, - GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles), - CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles), - OtherFiles: absJoin(p.Dir, otherFiles(p)...), - EmbedFiles: absJoin(p.Dir, p.EmbedFiles), - EmbedPatterns: absJoin(p.Dir, p.EmbedPatterns), - IgnoredFiles: absJoin(p.Dir, p.IgnoredGoFiles, p.IgnoredOtherFiles), - forTest: p.ForTest, - depsErrors: p.DepsErrors, - Module: p.Module, - } - - if (state.cfg.Mode&typecheckCgo) != 0 && len(p.CgoFiles) != 0 { - if len(p.CompiledGoFiles) > len(p.GoFiles) { - // We need the cgo definitions, which are in the first - // CompiledGoFile after the non-cgo ones. This is a hack but there - // isn't currently a better way to find it. We also need the pure - // Go files and unprocessed cgo files, all of which are already - // in pkg.GoFiles. - cgoTypes := p.CompiledGoFiles[len(p.GoFiles)] - pkg.CompiledGoFiles = append([]string{cgoTypes}, pkg.GoFiles...) - } else { - // golang/go#38990: go list silently fails to do cgo processing - pkg.CompiledGoFiles = nil - pkg.Errors = append(pkg.Errors, Error{ - Msg: "go list failed to return CompiledGoFiles. This may indicate failure to perform cgo processing; try building at the command line. See https://golang.org/issue/38990.", - Kind: ListError, - }) - } - } - - // Work around https://golang.org/issue/28749: - // cmd/go puts assembly, C, and C++ files in CompiledGoFiles. - // Remove files from CompiledGoFiles that are non-go files - // (or are not files that look like they are from the cache). - if len(pkg.CompiledGoFiles) > 0 { - out := pkg.CompiledGoFiles[:0] - for _, f := range pkg.CompiledGoFiles { - if ext := filepath.Ext(f); ext != ".go" && ext != "" { // ext == "" means the file is from the cache, so probably cgo-processed file - continue - } - out = append(out, f) - } - pkg.CompiledGoFiles = out - } - - // Extract the PkgPath from the package's ID. - if i := strings.IndexByte(pkg.ID, ' '); i >= 0 { - pkg.PkgPath = pkg.ID[:i] - } else { - pkg.PkgPath = pkg.ID - } - - if pkg.PkgPath == "unsafe" { - pkg.CompiledGoFiles = nil // ignore fake unsafe.go file (#59929) - } else if len(pkg.CompiledGoFiles) == 0 { - // Work around for pre-go.1.11 versions of go list. - // TODO(matloob): they should be handled by the fallback. - // Can we delete this? - pkg.CompiledGoFiles = pkg.GoFiles - } - - // Assume go list emits only absolute paths for Dir. - if p.Dir != "" && !filepath.IsAbs(p.Dir) { - log.Fatalf("internal error: go list returned non-absolute Package.Dir: %s", p.Dir) - } - - if p.Export != "" && !filepath.IsAbs(p.Export) { - pkg.ExportFile = filepath.Join(p.Dir, p.Export) - } else { - pkg.ExportFile = p.Export - } - - // imports - // - // Imports contains the IDs of all imported packages. - // ImportsMap records (path, ID) only where they differ. - ids := make(map[string]bool) - for _, id := range p.Imports { - ids[id] = true - } - pkg.Imports = make(map[string]*Package) - for path, id := range p.ImportMap { - pkg.Imports[path] = &Package{ID: id} // non-identity import - delete(ids, id) - } - for id := range ids { - if id == "C" { - continue - } - - pkg.Imports[id] = &Package{ID: id} // identity import - } - if !p.DepOnly { - response.Roots = append(response.Roots, pkg.ID) - } - - // Temporary work-around for golang/go#39986. Parse filenames out of - // error messages. This happens if there are unrecoverable syntax - // errors in the source, so we can't match on a specific error message. - // - // TODO(rfindley): remove this heuristic, in favor of considering - // InvalidGoFiles from the list driver. - if err := p.Error; err != nil && state.shouldAddFilenameFromError(p) { - addFilenameFromPos := func(pos string) bool { - split := strings.Split(pos, ":") - if len(split) < 1 { - return false - } - filename := strings.TrimSpace(split[0]) - if filename == "" { - return false - } - if !filepath.IsAbs(filename) { - filename = filepath.Join(state.cfg.Dir, filename) - } - info, _ := os.Stat(filename) - if info == nil { - return false - } - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, filename) - pkg.GoFiles = append(pkg.GoFiles, filename) - return true - } - found := addFilenameFromPos(err.Pos) - // In some cases, go list only reports the error position in the - // error text, not the error position. One such case is when the - // file's package name is a keyword (see golang.org/issue/39763). - if !found { - addFilenameFromPos(err.Err) - } - } - - if p.Error != nil { - msg := strings.TrimSpace(p.Error.Err) // Trim to work around golang.org/issue/32363. - // Address golang.org/issue/35964 by appending import stack to error message. - if msg == "import cycle not allowed" && len(p.Error.ImportStack) != 0 { - msg += fmt.Sprintf(": import stack: %v", p.Error.ImportStack) - } - pkg.Errors = append(pkg.Errors, Error{ - Pos: p.Error.Pos, - Msg: msg, - Kind: ListError, - }) - } - - pkgs[pkg.ID] = pkg - } - - for id, errs := range additionalErrors { - if p, ok := pkgs[id]; ok { - p.Errors = append(p.Errors, errs...) - } - } - for _, pkg := range pkgs { - response.Packages = append(response.Packages, pkg) - } - sort.Slice(response.Packages, func(i, j int) bool { return response.Packages[i].ID < response.Packages[j].ID }) - - return response, nil -} - -func (state *golistState) shouldAddFilenameFromError(p *jsonPackage) bool { - if len(p.GoFiles) > 0 || len(p.CompiledGoFiles) > 0 { - return false - } - - goV, err := state.getGoVersion() - if err != nil { - return false - } - - // On Go 1.14 and earlier, only add filenames from errors if the import stack is empty. - // The import stack behaves differently for these versions than newer Go versions. - if goV < 15 { - return len(p.Error.ImportStack) == 0 - } - - // On Go 1.15 and later, only parse filenames out of error if there's no import stack, - // or the current package is at the top of the import stack. This is not guaranteed - // to work perfectly, but should avoid some cases where files in errors don't belong to this - // package. - return len(p.Error.ImportStack) == 0 || p.Error.ImportStack[len(p.Error.ImportStack)-1] == p.ImportPath -} - -// getGoVersion returns the effective minor version of the go command. -func (state *golistState) getGoVersion() (int, error) { - state.goVersionOnce.Do(func() { - state.goVersion, state.goVersionError = gocommand.GoVersion(state.ctx, state.cfgInvocation(), state.cfg.gocmdRunner) - }) - return state.goVersion, state.goVersionError -} - -// getPkgPath finds the package path of a directory if it's relative to a root -// directory. -func (state *golistState) getPkgPath(dir string) (string, bool, error) { - absDir, err := filepath.Abs(dir) - if err != nil { - return "", false, err - } - roots, err := state.determineRootDirs() - if err != nil { - return "", false, err - } - - for rdir, rpath := range roots { - // Make sure that the directory is in the module, - // to avoid creating a path relative to another module. - if !strings.HasPrefix(absDir, rdir) { - continue - } - // TODO(matloob): This doesn't properly handle symlinks. - r, err := filepath.Rel(rdir, dir) - if err != nil { - continue - } - if rpath != "" { - // We choose only one root even though the directory even it can belong in multiple modules - // or GOPATH entries. This is okay because we only need to work with absolute dirs when a - // file is missing from disk, for instance when gopls calls go/packages in an overlay. - // Once the file is saved, gopls, or the next invocation of the tool will get the correct - // result straight from golist. - // TODO(matloob): Implement module tiebreaking? - return path.Join(rpath, filepath.ToSlash(r)), true, nil - } - return filepath.ToSlash(r), true, nil - } - return "", false, nil -} - -// absJoin absolutizes and flattens the lists of files. -func absJoin(dir string, fileses ...[]string) (res []string) { - for _, files := range fileses { - for _, file := range files { - if !filepath.IsAbs(file) { - file = filepath.Join(dir, file) - } - res = append(res, file) - } - } - return res -} - -func jsonFlag(cfg *Config, goVersion int) string { - if goVersion < 19 { - return "-json" - } - var fields []string - added := make(map[string]bool) - addFields := func(fs ...string) { - for _, f := range fs { - if !added[f] { - added[f] = true - fields = append(fields, f) - } - } - } - addFields("Name", "ImportPath", "Error") // These fields are always needed - if cfg.Mode&NeedFiles != 0 || cfg.Mode&NeedTypes != 0 { - addFields("Dir", "GoFiles", "IgnoredGoFiles", "IgnoredOtherFiles", "CFiles", - "CgoFiles", "CXXFiles", "MFiles", "HFiles", "FFiles", "SFiles", - "SwigFiles", "SwigCXXFiles", "SysoFiles") - if cfg.Tests { - addFields("TestGoFiles", "XTestGoFiles") - } - } - if cfg.Mode&NeedTypes != 0 { - // CompiledGoFiles seems to be required for the test case TestCgoNoSyntax, - // even when -compiled isn't passed in. - // TODO(#52435): Should we make the test ask for -compiled, or automatically - // request CompiledGoFiles in certain circumstances? - addFields("Dir", "CompiledGoFiles") - } - if cfg.Mode&NeedCompiledGoFiles != 0 { - addFields("Dir", "CompiledGoFiles", "Export") - } - if cfg.Mode&NeedImports != 0 { - // When imports are requested, DepOnly is used to distinguish between packages - // explicitly requested and transitive imports of those packages. - addFields("DepOnly", "Imports", "ImportMap") - if cfg.Tests { - addFields("TestImports", "XTestImports") - } - } - if cfg.Mode&NeedDeps != 0 { - addFields("DepOnly") - } - if usesExportData(cfg) { - // Request Dir in the unlikely case Export is not absolute. - addFields("Dir", "Export") - } - if cfg.Mode&needInternalForTest != 0 { - addFields("ForTest") - } - if cfg.Mode&needInternalDepsErrors != 0 { - addFields("DepsErrors") - } - if cfg.Mode&NeedModule != 0 { - addFields("Module") - } - if cfg.Mode&NeedEmbedFiles != 0 { - addFields("EmbedFiles") - } - if cfg.Mode&NeedEmbedPatterns != 0 { - addFields("EmbedPatterns") - } - return "-json=" + strings.Join(fields, ",") -} - -func golistargs(cfg *Config, words []string, goVersion int) []string { - const findFlags = NeedImports | NeedTypes | NeedSyntax | NeedTypesInfo - fullargs := []string{ - "-e", jsonFlag(cfg, goVersion), - fmt.Sprintf("-compiled=%t", cfg.Mode&(NeedCompiledGoFiles|NeedSyntax|NeedTypes|NeedTypesInfo|NeedTypesSizes) != 0), - fmt.Sprintf("-test=%t", cfg.Tests), - fmt.Sprintf("-export=%t", usesExportData(cfg)), - fmt.Sprintf("-deps=%t", cfg.Mode&NeedImports != 0), - // go list doesn't let you pass -test and -find together, - // probably because you'd just get the TestMain. - fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0 && !usesExportData(cfg)), - } - - // golang/go#60456: with go1.21 and later, go list serves pgo variants, which - // can be costly to compute and may result in redundant processing for the - // caller. Disable these variants. If someone wants to add e.g. a NeedPGO - // mode flag, that should be a separate proposal. - if goVersion >= 21 { - fullargs = append(fullargs, "-pgo=off") - } - - fullargs = append(fullargs, cfg.BuildFlags...) - fullargs = append(fullargs, "--") - fullargs = append(fullargs, words...) - return fullargs -} - -// cfgInvocation returns an Invocation that reflects cfg's settings. -func (state *golistState) cfgInvocation() gocommand.Invocation { - cfg := state.cfg - return gocommand.Invocation{ - BuildFlags: cfg.BuildFlags, - ModFile: cfg.modFile, - ModFlag: cfg.modFlag, - CleanEnv: cfg.Env != nil, - Env: cfg.Env, - Logf: cfg.Logf, - WorkingDir: cfg.Dir, - } -} - -// invokeGo returns the stdout of a go command invocation. -func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) { - cfg := state.cfg - - inv := state.cfgInvocation() - - // For Go versions 1.16 and above, `go list` accepts overlays directly via - // the -overlay flag. Set it, if it's available. - // - // The check for "list" is not necessarily required, but we should avoid - // getting the go version if possible. - if verb == "list" { - goVersion, err := state.getGoVersion() - if err != nil { - return nil, err - } - if goVersion >= 16 { - filename, cleanup, err := state.writeOverlays() - if err != nil { - return nil, err - } - defer cleanup() - inv.Overlay = filename - } - } - inv.Verb = verb - inv.Args = args - gocmdRunner := cfg.gocmdRunner - if gocmdRunner == nil { - gocmdRunner = &gocommand.Runner{} - } - stdout, stderr, friendlyErr, err := gocmdRunner.RunRaw(cfg.Context, inv) - if err != nil { - // Check for 'go' executable not being found. - if ee, ok := err.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - return nil, fmt.Errorf("'go list' driver requires 'go', but %s", exec.ErrNotFound) - } - - exitErr, ok := err.(*exec.ExitError) - if !ok { - // Catastrophic error: - // - context cancellation - return nil, fmt.Errorf("couldn't run 'go': %w", err) - } - - // Old go version? - if strings.Contains(stderr.String(), "flag provided but not defined") { - return nil, goTooOldError{fmt.Errorf("unsupported version of go: %s: %s", exitErr, stderr)} - } - - // Related to #24854 - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "unexpected directory layout") { - return nil, friendlyErr - } - - // Is there an error running the C compiler in cgo? This will be reported in the "Error" field - // and should be suppressed by go list -e. - // - // This condition is not perfect yet because the error message can include other error messages than runtime/cgo. - isPkgPathRune := func(r rune) bool { - // From https://golang.org/ref/spec#Import_declarations: - // Implementation restriction: A compiler may restrict ImportPaths to non-empty strings - // using only characters belonging to Unicode's L, M, N, P, and S general categories - // (the Graphic characters without spaces) and may also exclude the - // characters !"#$%&'()*,:;<=>?[\]^`{|} and the Unicode replacement character U+FFFD. - return unicode.IsOneOf([]*unicode.RangeTable{unicode.L, unicode.M, unicode.N, unicode.P, unicode.S}, r) && - !strings.ContainsRune("!\"#$%&'()*,:;<=>?[\\]^`{|}\uFFFD", r) - } - // golang/go#36770: Handle case where cmd/go prints module download messages before the error. - msg := stderr.String() - for strings.HasPrefix(msg, "go: downloading") { - msg = msg[strings.IndexRune(msg, '\n')+1:] - } - if len(stderr.String()) > 0 && strings.HasPrefix(stderr.String(), "# ") { - msg := msg[len("# "):] - if strings.HasPrefix(strings.TrimLeftFunc(msg, isPkgPathRune), "\n") { - return stdout, nil - } - // Treat pkg-config errors as a special case (golang.org/issue/36770). - if strings.HasPrefix(msg, "pkg-config") { - return stdout, nil - } - } - - // This error only appears in stderr. See golang.org/cl/166398 for a fix in go list to show - // the error in the Err section of stdout in case -e option is provided. - // This fix is provided for backwards compatibility. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must be .go files") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Similar to the previous error, but currently lacks a fix in Go. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "named files must all be in one directory") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Backwards compatibility for Go 1.11 because 1.12 and 1.13 put the directory in the ImportPath. - // If the package doesn't exist, put the absolute path of the directory into the error message, - // as Go 1.13 list does. - const noSuchDirectory = "no such directory" - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), noSuchDirectory) { - errstr := stderr.String() - abspath := strings.TrimSpace(errstr[strings.Index(errstr, noSuchDirectory)+len(noSuchDirectory):]) - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - abspath, strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for #29280: go list -e has incorrect behavior when an ad-hoc package doesn't exist. - // Note that the error message we look for in this case is different that the one looked for above. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no such file or directory") { - output := fmt.Sprintf(`{"ImportPath": "command-line-arguments","Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for #34273. go list -e with GO111MODULE=on has incorrect behavior when listing a - // directory outside any module. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside available modules") { - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - // TODO(matloob): command-line-arguments isn't correct here. - "command-line-arguments", strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Another variation of the previous error - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "outside module root") { - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - // TODO(matloob): command-line-arguments isn't correct here. - "command-line-arguments", strings.Trim(stderr.String(), "\n")) - return bytes.NewBufferString(output), nil - } - - // Workaround for an instance of golang.org/issue/26755: go list -e will return a non-zero exit - // status if there's a dependency on a package that doesn't exist. But it should return - // a zero exit status and set an error on that package. - if len(stderr.String()) > 0 && strings.Contains(stderr.String(), "no Go files in") { - // Don't clobber stdout if `go list` actually returned something. - if len(stdout.String()) > 0 { - return stdout, nil - } - // try to extract package name from string - stderrStr := stderr.String() - var importPath string - colon := strings.Index(stderrStr, ":") - if colon > 0 && strings.HasPrefix(stderrStr, "go build ") { - importPath = stderrStr[len("go build "):colon] - } - output := fmt.Sprintf(`{"ImportPath": %q,"Incomplete": true,"Error": {"Pos": "","Err": %q}}`, - importPath, strings.Trim(stderrStr, "\n")) - return bytes.NewBufferString(output), nil - } - - // Export mode entails a build. - // If that build fails, errors appear on stderr - // (despite the -e flag) and the Export field is blank. - // Do not fail in that case. - // The same is true if an ad-hoc package given to go list doesn't exist. - // TODO(matloob): Remove these once we can depend on go list to exit with a zero status with -e even when - // packages don't exist or a build fails. - if !usesExportData(cfg) && !containsGoFile(args) { - return nil, friendlyErr - } - } - return stdout, nil -} - -// OverlayJSON is the format overlay files are expected to be in. -// The Replace map maps from overlaid paths to replacement paths: -// the Go command will forward all reads trying to open -// each overlaid path to its replacement path, or consider the overlaid -// path not to exist if the replacement path is empty. -// -// From golang/go#39958. -type OverlayJSON struct { - Replace map[string]string `json:"replace,omitempty"` -} - -// writeOverlays writes out files for go list's -overlay flag, as described -// above. -func (state *golistState) writeOverlays() (filename string, cleanup func(), err error) { - // Do nothing if there are no overlays in the config. - if len(state.cfg.Overlay) == 0 { - return "", func() {}, nil - } - dir, err := ioutil.TempDir("", "gopackages-*") - if err != nil { - return "", nil, err - } - // The caller must clean up this directory, unless this function returns an - // error. - cleanup = func() { - os.RemoveAll(dir) - } - defer func() { - if err != nil { - cleanup() - } - }() - overlays := map[string]string{} - for k, v := range state.cfg.Overlay { - // Create a unique filename for the overlaid files, to avoid - // creating nested directories. - noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "") - f, err := ioutil.TempFile(dir, fmt.Sprintf("*-%s", noSeparator)) - if err != nil { - return "", func() {}, err - } - if _, err := f.Write(v); err != nil { - return "", func() {}, err - } - if err := f.Close(); err != nil { - return "", func() {}, err - } - overlays[k] = f.Name() - } - b, err := json.Marshal(OverlayJSON{Replace: overlays}) - if err != nil { - return "", func() {}, err - } - // Write out the overlay file that contains the filepath mappings. - filename = filepath.Join(dir, "overlay.json") - if err := ioutil.WriteFile(filename, b, 0665); err != nil { - return "", func() {}, err - } - return filename, cleanup, nil -} - -func containsGoFile(s []string) bool { - for _, f := range s { - if strings.HasSuffix(f, ".go") { - return true - } - } - return false -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.SplitN(kv, "=", 2) - k, v := split[0], split[1] - env[k] = v - } - - var args []string - for _, arg := range cmd.Args { - quoted := strconv.Quote(arg) - if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { - args = append(args, quoted) - } else { - args = append(args, arg) - } - } - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/golist_overlay.go deleted file mode 100644 index 9576b472f9cc..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/golist_overlay.go +++ /dev/null @@ -1,575 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "encoding/json" - "fmt" - "go/parser" - "go/token" - "os" - "path/filepath" - "regexp" - "sort" - "strconv" - "strings" - - "golang.org/x/tools/internal/gocommand" -) - -// processGolistOverlay provides rudimentary support for adding -// files that don't exist on disk to an overlay. The results can be -// sometimes incorrect. -// TODO(matloob): Handle unsupported cases, including the following: -// - determining the correct package to add given a new import path -func (state *golistState) processGolistOverlay(response *responseDeduper) (modifiedPkgs, needPkgs []string, err error) { - havePkgs := make(map[string]string) // importPath -> non-test package ID - needPkgsSet := make(map[string]bool) - modifiedPkgsSet := make(map[string]bool) - - pkgOfDir := make(map[string][]*Package) - for _, pkg := range response.dr.Packages { - // This is an approximation of import path to id. This can be - // wrong for tests, vendored packages, and a number of other cases. - havePkgs[pkg.PkgPath] = pkg.ID - dir, err := commonDir(pkg.GoFiles) - if err != nil { - return nil, nil, err - } - if dir != "" { - pkgOfDir[dir] = append(pkgOfDir[dir], pkg) - } - } - - // If no new imports are added, it is safe to avoid loading any needPkgs. - // Otherwise, it's hard to tell which package is actually being loaded - // (due to vendoring) and whether any modified package will show up - // in the transitive set of dependencies (because new imports are added, - // potentially modifying the transitive set of dependencies). - var overlayAddsImports bool - - // If both a package and its test package are created by the overlay, we - // need the real package first. Process all non-test files before test - // files, and make the whole process deterministic while we're at it. - var overlayFiles []string - for opath := range state.cfg.Overlay { - overlayFiles = append(overlayFiles, opath) - } - sort.Slice(overlayFiles, func(i, j int) bool { - iTest := strings.HasSuffix(overlayFiles[i], "_test.go") - jTest := strings.HasSuffix(overlayFiles[j], "_test.go") - if iTest != jTest { - return !iTest // non-tests are before tests. - } - return overlayFiles[i] < overlayFiles[j] - }) - for _, opath := range overlayFiles { - contents := state.cfg.Overlay[opath] - base := filepath.Base(opath) - dir := filepath.Dir(opath) - var pkg *Package // if opath belongs to both a package and its test variant, this will be the test variant - var testVariantOf *Package // if opath is a test file, this is the package it is testing - var fileExists bool - isTestFile := strings.HasSuffix(opath, "_test.go") - pkgName, ok := extractPackageName(opath, contents) - if !ok { - // Don't bother adding a file that doesn't even have a parsable package statement - // to the overlay. - continue - } - // If all the overlay files belong to a different package, change the - // package name to that package. - maybeFixPackageName(pkgName, isTestFile, pkgOfDir[dir]) - nextPackage: - for _, p := range response.dr.Packages { - if pkgName != p.Name && p.ID != "command-line-arguments" { - continue - } - for _, f := range p.GoFiles { - if !sameFile(filepath.Dir(f), dir) { - continue - } - // Make sure to capture information on the package's test variant, if needed. - if isTestFile && !hasTestFiles(p) { - // TODO(matloob): Are there packages other than the 'production' variant - // of a package that this can match? This shouldn't match the test main package - // because the file is generated in another directory. - testVariantOf = p - continue nextPackage - } else if !isTestFile && hasTestFiles(p) { - // We're examining a test variant, but the overlaid file is - // a non-test file. Because the overlay implementation - // (currently) only adds a file to one package, skip this - // package, so that we can add the file to the production - // variant of the package. (https://golang.org/issue/36857 - // tracks handling overlays on both the production and test - // variant of a package). - continue nextPackage - } - if pkg != nil && p != pkg && pkg.PkgPath == p.PkgPath { - // We have already seen the production version of the - // for which p is a test variant. - if hasTestFiles(p) { - testVariantOf = pkg - } - } - pkg = p - if filepath.Base(f) == base { - fileExists = true - } - } - } - // The overlay could have included an entirely new package or an - // ad-hoc package. An ad-hoc package is one that we have manually - // constructed from inadequate `go list` results for a file= query. - // It will have the ID command-line-arguments. - if pkg == nil || pkg.ID == "command-line-arguments" { - // Try to find the module or gopath dir the file is contained in. - // Then for modules, add the module opath to the beginning. - pkgPath, ok, err := state.getPkgPath(dir) - if err != nil { - return nil, nil, err - } - if !ok { - break - } - var forTest string // only set for x tests - isXTest := strings.HasSuffix(pkgName, "_test") - if isXTest { - forTest = pkgPath - pkgPath += "_test" - } - id := pkgPath - if isTestFile { - if isXTest { - id = fmt.Sprintf("%s [%s.test]", pkgPath, forTest) - } else { - id = fmt.Sprintf("%s [%s.test]", pkgPath, pkgPath) - } - } - if pkg != nil { - // TODO(rstambler): We should change the package's path and ID - // here. The only issue is that this messes with the roots. - } else { - // Try to reclaim a package with the same ID, if it exists in the response. - for _, p := range response.dr.Packages { - if reclaimPackage(p, id, opath, contents) { - pkg = p - break - } - } - // Otherwise, create a new package. - if pkg == nil { - pkg = &Package{ - PkgPath: pkgPath, - ID: id, - Name: pkgName, - Imports: make(map[string]*Package), - } - response.addPackage(pkg) - havePkgs[pkg.PkgPath] = id - // Add the production package's sources for a test variant. - if isTestFile && !isXTest && testVariantOf != nil { - pkg.GoFiles = append(pkg.GoFiles, testVariantOf.GoFiles...) - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, testVariantOf.CompiledGoFiles...) - // Add the package under test and its imports to the test variant. - pkg.forTest = testVariantOf.PkgPath - for k, v := range testVariantOf.Imports { - pkg.Imports[k] = &Package{ID: v.ID} - } - } - if isXTest { - pkg.forTest = forTest - } - } - } - } - if !fileExists { - pkg.GoFiles = append(pkg.GoFiles, opath) - // TODO(matloob): Adding the file to CompiledGoFiles can exhibit the wrong behavior - // if the file will be ignored due to its build tags. - pkg.CompiledGoFiles = append(pkg.CompiledGoFiles, opath) - modifiedPkgsSet[pkg.ID] = true - } - imports, err := extractImports(opath, contents) - if err != nil { - // Let the parser or type checker report errors later. - continue - } - for _, imp := range imports { - // TODO(rstambler): If the package is an x test and the import has - // a test variant, make sure to replace it. - if _, found := pkg.Imports[imp]; found { - continue - } - overlayAddsImports = true - id, ok := havePkgs[imp] - if !ok { - var err error - id, err = state.resolveImport(dir, imp) - if err != nil { - return nil, nil, err - } - } - pkg.Imports[imp] = &Package{ID: id} - // Add dependencies to the non-test variant version of this package as well. - if testVariantOf != nil { - testVariantOf.Imports[imp] = &Package{ID: id} - } - } - } - - // toPkgPath guesses the package path given the id. - toPkgPath := func(sourceDir, id string) (string, error) { - if i := strings.IndexByte(id, ' '); i >= 0 { - return state.resolveImport(sourceDir, id[:i]) - } - return state.resolveImport(sourceDir, id) - } - - // Now that new packages have been created, do another pass to determine - // the new set of missing packages. - for _, pkg := range response.dr.Packages { - for _, imp := range pkg.Imports { - if len(pkg.GoFiles) == 0 { - return nil, nil, fmt.Errorf("cannot resolve imports for package %q with no Go files", pkg.PkgPath) - } - pkgPath, err := toPkgPath(filepath.Dir(pkg.GoFiles[0]), imp.ID) - if err != nil { - return nil, nil, err - } - if _, ok := havePkgs[pkgPath]; !ok { - needPkgsSet[pkgPath] = true - } - } - } - - if overlayAddsImports { - needPkgs = make([]string, 0, len(needPkgsSet)) - for pkg := range needPkgsSet { - needPkgs = append(needPkgs, pkg) - } - } - modifiedPkgs = make([]string, 0, len(modifiedPkgsSet)) - for pkg := range modifiedPkgsSet { - modifiedPkgs = append(modifiedPkgs, pkg) - } - return modifiedPkgs, needPkgs, err -} - -// resolveImport finds the ID of a package given its import path. -// In particular, it will find the right vendored copy when in GOPATH mode. -func (state *golistState) resolveImport(sourceDir, importPath string) (string, error) { - env, err := state.getEnv() - if err != nil { - return "", err - } - if env["GOMOD"] != "" { - return importPath, nil - } - - searchDir := sourceDir - for { - vendorDir := filepath.Join(searchDir, "vendor") - exists, ok := state.vendorDirs[vendorDir] - if !ok { - info, err := os.Stat(vendorDir) - exists = err == nil && info.IsDir() - state.vendorDirs[vendorDir] = exists - } - - if exists { - vendoredPath := filepath.Join(vendorDir, importPath) - if info, err := os.Stat(vendoredPath); err == nil && info.IsDir() { - // We should probably check for .go files here, but shame on anyone who fools us. - path, ok, err := state.getPkgPath(vendoredPath) - if err != nil { - return "", err - } - if ok { - return path, nil - } - } - } - - // We know we've hit the top of the filesystem when we Dir / and get /, - // or C:\ and get C:\, etc. - next := filepath.Dir(searchDir) - if next == searchDir { - break - } - searchDir = next - } - return importPath, nil -} - -func hasTestFiles(p *Package) bool { - for _, f := range p.GoFiles { - if strings.HasSuffix(f, "_test.go") { - return true - } - } - return false -} - -// determineRootDirs returns a mapping from absolute directories that could -// contain code to their corresponding import path prefixes. -func (state *golistState) determineRootDirs() (map[string]string, error) { - env, err := state.getEnv() - if err != nil { - return nil, err - } - if env["GOMOD"] != "" { - state.rootsOnce.Do(func() { - state.rootDirs, state.rootDirsError = state.determineRootDirsModules() - }) - } else { - state.rootsOnce.Do(func() { - state.rootDirs, state.rootDirsError = state.determineRootDirsGOPATH() - }) - } - return state.rootDirs, state.rootDirsError -} - -func (state *golistState) determineRootDirsModules() (map[string]string, error) { - // List all of the modules--the first will be the directory for the main - // module. Any replaced modules will also need to be treated as roots. - // Editing files in the module cache isn't a great idea, so we don't - // plan to ever support that. - out, err := state.invokeGo("list", "-m", "-json", "all") - if err != nil { - // 'go list all' will fail if we're outside of a module and - // GO111MODULE=on. Try falling back without 'all'. - var innerErr error - out, innerErr = state.invokeGo("list", "-m", "-json") - if innerErr != nil { - return nil, err - } - } - roots := map[string]string{} - modules := map[string]string{} - var i int - for dec := json.NewDecoder(out); dec.More(); { - mod := new(gocommand.ModuleJSON) - if err := dec.Decode(mod); err != nil { - return nil, err - } - if mod.Dir != "" && mod.Path != "" { - // This is a valid module; add it to the map. - absDir, err := filepath.Abs(mod.Dir) - if err != nil { - return nil, err - } - modules[absDir] = mod.Path - // The first result is the main module. - if i == 0 || mod.Replace != nil && mod.Replace.Path != "" { - roots[absDir] = mod.Path - } - } - i++ - } - return roots, nil -} - -func (state *golistState) determineRootDirsGOPATH() (map[string]string, error) { - m := map[string]string{} - for _, dir := range filepath.SplitList(state.mustGetEnv()["GOPATH"]) { - absDir, err := filepath.Abs(dir) - if err != nil { - return nil, err - } - m[filepath.Join(absDir, "src")] = "" - } - return m, nil -} - -func extractImports(filename string, contents []byte) ([]string, error) { - f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.ImportsOnly) // TODO(matloob): reuse fileset? - if err != nil { - return nil, err - } - var res []string - for _, imp := range f.Imports { - quotedPath := imp.Path.Value - path, err := strconv.Unquote(quotedPath) - if err != nil { - return nil, err - } - res = append(res, path) - } - return res, nil -} - -// reclaimPackage attempts to reuse a package that failed to load in an overlay. -// -// If the package has errors and has no Name, GoFiles, or Imports, -// then it's possible that it doesn't yet exist on disk. -func reclaimPackage(pkg *Package, id string, filename string, contents []byte) bool { - // TODO(rstambler): Check the message of the actual error? - // It differs between $GOPATH and module mode. - if pkg.ID != id { - return false - } - if len(pkg.Errors) != 1 { - return false - } - if pkg.Name != "" || pkg.ExportFile != "" { - return false - } - if len(pkg.GoFiles) > 0 || len(pkg.CompiledGoFiles) > 0 || len(pkg.OtherFiles) > 0 { - return false - } - if len(pkg.Imports) > 0 { - return false - } - pkgName, ok := extractPackageName(filename, contents) - if !ok { - return false - } - pkg.Name = pkgName - pkg.Errors = nil - return true -} - -func extractPackageName(filename string, contents []byte) (string, bool) { - // TODO(rstambler): Check the message of the actual error? - // It differs between $GOPATH and module mode. - f, err := parser.ParseFile(token.NewFileSet(), filename, contents, parser.PackageClauseOnly) // TODO(matloob): reuse fileset? - if err != nil { - return "", false - } - return f.Name.Name, true -} - -// commonDir returns the directory that all files are in, "" if files is empty, -// or an error if they aren't in the same directory. -func commonDir(files []string) (string, error) { - seen := make(map[string]bool) - for _, f := range files { - seen[filepath.Dir(f)] = true - } - if len(seen) > 1 { - return "", fmt.Errorf("files (%v) are in more than one directory: %v", files, seen) - } - for k := range seen { - // seen has only one element; return it. - return k, nil - } - return "", nil // no files -} - -// It is possible that the files in the disk directory dir have a different package -// name from newName, which is deduced from the overlays. If they all have a different -// package name, and they all have the same package name, then that name becomes -// the package name. -// It returns true if it changes the package name, false otherwise. -func maybeFixPackageName(newName string, isTestFile bool, pkgsOfDir []*Package) { - names := make(map[string]int) - for _, p := range pkgsOfDir { - names[p.Name]++ - } - if len(names) != 1 { - // some files are in different packages - return - } - var oldName string - for k := range names { - oldName = k - } - if newName == oldName { - return - } - // We might have a case where all of the package names in the directory are - // the same, but the overlay file is for an x test, which belongs to its - // own package. If the x test does not yet exist on disk, we may not yet - // have its package name on disk, but we should not rename the packages. - // - // We use a heuristic to determine if this file belongs to an x test: - // The test file should have a package name whose package name has a _test - // suffix or looks like "newName_test". - maybeXTest := strings.HasPrefix(oldName+"_test", newName) || strings.HasSuffix(newName, "_test") - if isTestFile && maybeXTest { - return - } - for _, p := range pkgsOfDir { - p.Name = newName - } -} - -// This function is copy-pasted from -// https://github.com/golang/go/blob/9706f510a5e2754595d716bd64be8375997311fb/src/cmd/go/internal/search/search.go#L360. -// It should be deleted when we remove support for overlays from go/packages. -// -// NOTE: This does not handle any ./... or ./ style queries, as this function -// doesn't know the working directory. -// -// matchPattern(pattern)(name) reports whether -// name matches pattern. Pattern is a limited glob -// pattern in which '...' means 'any string' and there -// is no other special syntax. -// Unfortunately, there are two special cases. Quoting "go help packages": -// -// First, /... at the end of the pattern can match an empty string, -// so that net/... matches both net and packages in its subdirectories, like net/http. -// Second, any slash-separated pattern element containing a wildcard never -// participates in a match of the "vendor" element in the path of a vendored -// package, so that ./... does not match packages in subdirectories of -// ./vendor or ./mycode/vendor, but ./vendor/... and ./mycode/vendor/... do. -// Note, however, that a directory named vendor that itself contains code -// is not a vendored package: cmd/vendor would be a command named vendor, -// and the pattern cmd/... matches it. -func matchPattern(pattern string) func(name string) bool { - // Convert pattern to regular expression. - // The strategy for the trailing /... is to nest it in an explicit ? expression. - // The strategy for the vendor exclusion is to change the unmatchable - // vendor strings to a disallowed code point (vendorChar) and to use - // "(anything but that codepoint)*" as the implementation of the ... wildcard. - // This is a bit complicated but the obvious alternative, - // namely a hand-written search like in most shell glob matchers, - // is too easy to make accidentally exponential. - // Using package regexp guarantees linear-time matching. - - const vendorChar = "\x00" - - if strings.Contains(pattern, vendorChar) { - return func(name string) bool { return false } - } - - re := regexp.QuoteMeta(pattern) - re = replaceVendor(re, vendorChar) - switch { - case strings.HasSuffix(re, `/`+vendorChar+`/\.\.\.`): - re = strings.TrimSuffix(re, `/`+vendorChar+`/\.\.\.`) + `(/vendor|/` + vendorChar + `/\.\.\.)` - case re == vendorChar+`/\.\.\.`: - re = `(/vendor|/` + vendorChar + `/\.\.\.)` - case strings.HasSuffix(re, `/\.\.\.`): - re = strings.TrimSuffix(re, `/\.\.\.`) + `(/\.\.\.)?` - } - re = strings.ReplaceAll(re, `\.\.\.`, `[^`+vendorChar+`]*`) - - reg := regexp.MustCompile(`^` + re + `$`) - - return func(name string) bool { - if strings.Contains(name, vendorChar) { - return false - } - return reg.MatchString(replaceVendor(name, vendorChar)) - } -} - -// replaceVendor returns the result of replacing -// non-trailing vendor path elements in x with repl. -func replaceVendor(x, repl string) string { - if !strings.Contains(x, "vendor") { - return x - } - elem := strings.Split(x, "/") - for i := 0; i < len(elem)-1; i++ { - if elem[i] == "vendor" { - elem[i] = repl - } - } - return strings.Join(elem, "/") -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/loadmode_string.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/loadmode_string.go deleted file mode 100644 index 5c080d21b54a..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/loadmode_string.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "fmt" - "strings" -) - -var allModes = []LoadMode{ - NeedName, - NeedFiles, - NeedCompiledGoFiles, - NeedImports, - NeedDeps, - NeedExportFile, - NeedTypes, - NeedSyntax, - NeedTypesInfo, - NeedTypesSizes, -} - -var modeStrings = []string{ - "NeedName", - "NeedFiles", - "NeedCompiledGoFiles", - "NeedImports", - "NeedDeps", - "NeedExportFile", - "NeedTypes", - "NeedSyntax", - "NeedTypesInfo", - "NeedTypesSizes", -} - -func (mod LoadMode) String() string { - m := mod - if m == 0 { - return "LoadMode(0)" - } - var out []string - for i, x := range allModes { - if x > m { - break - } - if (m & x) != 0 { - out = append(out, modeStrings[i]) - m = m ^ x - } - } - if m != 0 { - out = append(out, "Unknown") - } - return fmt.Sprintf("LoadMode(%s)", strings.Join(out, "|")) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/packages.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/packages.go deleted file mode 100644 index da1a27eea62e..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/packages.go +++ /dev/null @@ -1,1332 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -// See doc.go for package documentation and implementation notes. - -import ( - "context" - "encoding/json" - "fmt" - "go/ast" - "go/parser" - "go/scanner" - "go/token" - "go/types" - "io" - "io/ioutil" - "log" - "os" - "path/filepath" - "runtime" - "strings" - "sync" - "time" - - "golang.org/x/tools/go/gcexportdata" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/packagesinternal" - "golang.org/x/tools/internal/typeparams" - "golang.org/x/tools/internal/typesinternal" -) - -// A LoadMode controls the amount of detail to return when loading. -// The bits below can be combined to specify which fields should be -// filled in the result packages. -// The zero value is a special case, equivalent to combining -// the NeedName, NeedFiles, and NeedCompiledGoFiles bits. -// ID and Errors (if present) will always be filled. -// Load may return more information than requested. -type LoadMode int - -const ( - // NeedName adds Name and PkgPath. - NeedName LoadMode = 1 << iota - - // NeedFiles adds GoFiles and OtherFiles. - NeedFiles - - // NeedCompiledGoFiles adds CompiledGoFiles. - NeedCompiledGoFiles - - // NeedImports adds Imports. If NeedDeps is not set, the Imports field will contain - // "placeholder" Packages with only the ID set. - NeedImports - - // NeedDeps adds the fields requested by the LoadMode in the packages in Imports. - NeedDeps - - // NeedExportFile adds ExportFile. - NeedExportFile - - // NeedTypes adds Types, Fset, and IllTyped. - NeedTypes - - // NeedSyntax adds Syntax. - NeedSyntax - - // NeedTypesInfo adds TypesInfo. - NeedTypesInfo - - // NeedTypesSizes adds TypesSizes. - NeedTypesSizes - - // needInternalDepsErrors adds the internal deps errors field for use by gopls. - needInternalDepsErrors - - // needInternalForTest adds the internal forTest field. - // Tests must also be set on the context for this field to be populated. - needInternalForTest - - // typecheckCgo enables full support for type checking cgo. Requires Go 1.15+. - // Modifies CompiledGoFiles and Types, and has no effect on its own. - typecheckCgo - - // NeedModule adds Module. - NeedModule - - // NeedEmbedFiles adds EmbedFiles. - NeedEmbedFiles - - // NeedEmbedPatterns adds EmbedPatterns. - NeedEmbedPatterns -) - -const ( - // Deprecated: LoadFiles exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadFiles = NeedName | NeedFiles | NeedCompiledGoFiles - - // Deprecated: LoadImports exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadImports = LoadFiles | NeedImports - - // Deprecated: LoadTypes exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadTypes = LoadImports | NeedTypes | NeedTypesSizes - - // Deprecated: LoadSyntax exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadSyntax = LoadTypes | NeedSyntax | NeedTypesInfo - - // Deprecated: LoadAllSyntax exists for historical compatibility - // and should not be used. Please directly specify the needed fields using the Need values. - LoadAllSyntax = LoadSyntax | NeedDeps - - // Deprecated: NeedExportsFile is a historical misspelling of NeedExportFile. - NeedExportsFile = NeedExportFile -) - -// A Config specifies details about how packages should be loaded. -// The zero value is a valid configuration. -// Calls to Load do not modify this struct. -type Config struct { - // Mode controls the level of information returned for each package. - Mode LoadMode - - // Context specifies the context for the load operation. - // If the context is cancelled, the loader may stop early - // and return an ErrCancelled error. - // If Context is nil, the load cannot be cancelled. - Context context.Context - - // Logf is the logger for the config. - // If the user provides a logger, debug logging is enabled. - // If the GOPACKAGESDEBUG environment variable is set to true, - // but the logger is nil, default to log.Printf. - Logf func(format string, args ...interface{}) - - // Dir is the directory in which to run the build system's query tool - // that provides information about the packages. - // If Dir is empty, the tool is run in the current directory. - Dir string - - // Env is the environment to use when invoking the build system's query tool. - // If Env is nil, the current environment is used. - // As in os/exec's Cmd, only the last value in the slice for - // each environment key is used. To specify the setting of only - // a few variables, append to the current environment, as in: - // - // opt.Env = append(os.Environ(), "GOOS=plan9", "GOARCH=386") - // - Env []string - - // gocmdRunner guards go command calls from concurrency errors. - gocmdRunner *gocommand.Runner - - // BuildFlags is a list of command-line flags to be passed through to - // the build system's query tool. - BuildFlags []string - - // modFile will be used for -modfile in go command invocations. - modFile string - - // modFlag will be used for -modfile in go command invocations. - modFlag string - - // Fset provides source position information for syntax trees and types. - // If Fset is nil, Load will use a new fileset, but preserve Fset's value. - Fset *token.FileSet - - // ParseFile is called to read and parse each file - // when preparing a package's type-checked syntax tree. - // It must be safe to call ParseFile simultaneously from multiple goroutines. - // If ParseFile is nil, the loader will uses parser.ParseFile. - // - // ParseFile should parse the source from src and use filename only for - // recording position information. - // - // An application may supply a custom implementation of ParseFile - // to change the effective file contents or the behavior of the parser, - // or to modify the syntax tree. For example, selectively eliminating - // unwanted function bodies can significantly accelerate type checking. - ParseFile func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) - - // If Tests is set, the loader includes not just the packages - // matching a particular pattern but also any related test packages, - // including test-only variants of the package and the test executable. - // - // For example, when using the go command, loading "fmt" with Tests=true - // returns four packages, with IDs "fmt" (the standard package), - // "fmt [fmt.test]" (the package as compiled for the test), - // "fmt_test" (the test functions from source files in package fmt_test), - // and "fmt.test" (the test binary). - // - // In build systems with explicit names for tests, - // setting Tests may have no effect. - Tests bool - - // Overlay provides a mapping of absolute file paths to file contents. - // If the file with the given path already exists, the parser will use the - // alternative file contents provided by the map. - // - // Overlays provide incomplete support for when a given file doesn't - // already exist on disk. See the package doc above for more details. - Overlay map[string][]byte -} - -// driver is the type for functions that query the build system for the -// packages named by the patterns. -type driver func(cfg *Config, patterns ...string) (*driverResponse, error) - -// driverResponse contains the results for a driver query. -type driverResponse struct { - // NotHandled is returned if the request can't be handled by the current - // driver. If an external driver returns a response with NotHandled, the - // rest of the driverResponse is ignored, and go/packages will fallback - // to the next driver. If go/packages is extended in the future to support - // lists of multiple drivers, go/packages will fall back to the next driver. - NotHandled bool - - // Sizes, if not nil, is the types.Sizes to use when type checking. - Sizes *types.StdSizes - - // Roots is the set of package IDs that make up the root packages. - // We have to encode this separately because when we encode a single package - // we cannot know if it is one of the roots as that requires knowledge of the - // graph it is part of. - Roots []string `json:",omitempty"` - - // Packages is the full set of packages in the graph. - // The packages are not connected into a graph. - // The Imports if populated will be stubs that only have their ID set. - // Imports will be connected and then type and syntax information added in a - // later pass (see refine). - Packages []*Package - - // GoVersion is the minor version number used by the driver - // (e.g. the go command on the PATH) when selecting .go files. - // Zero means unknown. - GoVersion int -} - -// Load loads and returns the Go packages named by the given patterns. -// -// Config specifies loading options; -// nil behaves the same as an empty Config. -// -// Load returns an error if any of the patterns was invalid -// as defined by the underlying build system. -// It may return an empty list of packages without an error, -// for instance for an empty expansion of a valid wildcard. -// Errors associated with a particular package are recorded in the -// corresponding Package's Errors list, and do not cause Load to -// return an error. Clients may need to handle such errors before -// proceeding with further analysis. The PrintErrors function is -// provided for convenient display of all errors. -func Load(cfg *Config, patterns ...string) ([]*Package, error) { - l := newLoader(cfg) - response, err := defaultDriver(&l.Config, patterns...) - if err != nil { - return nil, err - } - l.sizes = response.Sizes - return l.refine(response) -} - -// defaultDriver is a driver that implements go/packages' fallback behavior. -// It will try to request to an external driver, if one exists. If there's -// no external driver, or the driver returns a response with NotHandled set, -// defaultDriver will fall back to the go list driver. -func defaultDriver(cfg *Config, patterns ...string) (*driverResponse, error) { - driver := findExternalDriver(cfg) - if driver == nil { - driver = goListDriver - } - response, err := driver(cfg, patterns...) - if err != nil { - return response, err - } else if response.NotHandled { - return goListDriver(cfg, patterns...) - } - return response, nil -} - -// A Package describes a loaded Go package. -type Package struct { - // ID is a unique identifier for a package, - // in a syntax provided by the underlying build system. - // - // Because the syntax varies based on the build system, - // clients should treat IDs as opaque and not attempt to - // interpret them. - ID string - - // Name is the package name as it appears in the package source code. - Name string - - // PkgPath is the package path as used by the go/types package. - PkgPath string - - // Errors contains any errors encountered querying the metadata - // of the package, or while parsing or type-checking its files. - Errors []Error - - // TypeErrors contains the subset of errors produced during type checking. - TypeErrors []types.Error - - // GoFiles lists the absolute file paths of the package's Go source files. - // It may include files that should not be compiled, for example because - // they contain non-matching build tags, are documentary pseudo-files such as - // unsafe/unsafe.go or builtin/builtin.go, or are subject to cgo preprocessing. - GoFiles []string - - // CompiledGoFiles lists the absolute file paths of the package's source - // files that are suitable for type checking. - // This may differ from GoFiles if files are processed before compilation. - CompiledGoFiles []string - - // OtherFiles lists the absolute file paths of the package's non-Go source files, - // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on. - OtherFiles []string - - // EmbedFiles lists the absolute file paths of the package's files - // embedded with go:embed. - EmbedFiles []string - - // EmbedPatterns lists the absolute file patterns of the package's - // files embedded with go:embed. - EmbedPatterns []string - - // IgnoredFiles lists source files that are not part of the package - // using the current build configuration but that might be part of - // the package using other build configurations. - IgnoredFiles []string - - // ExportFile is the absolute path to a file containing type - // information for the package as provided by the build system. - ExportFile string - - // Imports maps import paths appearing in the package's Go source files - // to corresponding loaded Packages. - Imports map[string]*Package - - // Types provides type information for the package. - // The NeedTypes LoadMode bit sets this field for packages matching the - // patterns; type information for dependencies may be missing or incomplete, - // unless NeedDeps and NeedImports are also set. - Types *types.Package - - // Fset provides position information for Types, TypesInfo, and Syntax. - // It is set only when Types is set. - Fset *token.FileSet - - // IllTyped indicates whether the package or any dependency contains errors. - // It is set only when Types is set. - IllTyped bool - - // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles. - // - // The NeedSyntax LoadMode bit populates this field for packages matching the patterns. - // If NeedDeps and NeedImports are also set, this field will also be populated - // for dependencies. - // - // Syntax is kept in the same order as CompiledGoFiles, with the caveat that nils are - // removed. If parsing returned nil, Syntax may be shorter than CompiledGoFiles. - Syntax []*ast.File - - // TypesInfo provides type information about the package's syntax trees. - // It is set only when Syntax is set. - TypesInfo *types.Info - - // TypesSizes provides the effective size function for types in TypesInfo. - TypesSizes types.Sizes - - // forTest is the package under test, if any. - forTest string - - // depsErrors is the DepsErrors field from the go list response, if any. - depsErrors []*packagesinternal.PackageError - - // module is the module information for the package if it exists. - Module *Module -} - -// Module provides module information for a package. -type Module struct { - Path string // module path - Version string // module version - Replace *Module // replaced by this module - Time *time.Time // time version was created - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file used when loading this module, if any - GoVersion string // go version used in module - Error *ModuleError // error loading module -} - -// ModuleError holds errors loading a module. -type ModuleError struct { - Err string // the error itself -} - -func init() { - packagesinternal.GetForTest = func(p interface{}) string { - return p.(*Package).forTest - } - packagesinternal.GetDepsErrors = func(p interface{}) []*packagesinternal.PackageError { - return p.(*Package).depsErrors - } - packagesinternal.GetGoCmdRunner = func(config interface{}) *gocommand.Runner { - return config.(*Config).gocmdRunner - } - packagesinternal.SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) { - config.(*Config).gocmdRunner = runner - } - packagesinternal.SetModFile = func(config interface{}, value string) { - config.(*Config).modFile = value - } - packagesinternal.SetModFlag = func(config interface{}, value string) { - config.(*Config).modFlag = value - } - packagesinternal.TypecheckCgo = int(typecheckCgo) - packagesinternal.DepsErrors = int(needInternalDepsErrors) - packagesinternal.ForTest = int(needInternalForTest) -} - -// An Error describes a problem with a package's metadata, syntax, or types. -type Error struct { - Pos string // "file:line:col" or "file:line" or "" or "-" - Msg string - Kind ErrorKind -} - -// ErrorKind describes the source of the error, allowing the user to -// differentiate between errors generated by the driver, the parser, or the -// type-checker. -type ErrorKind int - -const ( - UnknownError ErrorKind = iota - ListError - ParseError - TypeError -) - -func (err Error) Error() string { - pos := err.Pos - if pos == "" { - pos = "-" // like token.Position{}.String() - } - return pos + ": " + err.Msg -} - -// flatPackage is the JSON form of Package -// It drops all the type and syntax fields, and transforms the Imports -// -// TODO(adonovan): identify this struct with Package, effectively -// publishing the JSON protocol. -type flatPackage struct { - ID string - Name string `json:",omitempty"` - PkgPath string `json:",omitempty"` - Errors []Error `json:",omitempty"` - GoFiles []string `json:",omitempty"` - CompiledGoFiles []string `json:",omitempty"` - OtherFiles []string `json:",omitempty"` - EmbedFiles []string `json:",omitempty"` - EmbedPatterns []string `json:",omitempty"` - IgnoredFiles []string `json:",omitempty"` - ExportFile string `json:",omitempty"` - Imports map[string]string `json:",omitempty"` -} - -// MarshalJSON returns the Package in its JSON form. -// For the most part, the structure fields are written out unmodified, and -// the type and syntax fields are skipped. -// The imports are written out as just a map of path to package id. -// The errors are written using a custom type that tries to preserve the -// structure of error types we know about. -// -// This method exists to enable support for additional build systems. It is -// not intended for use by clients of the API and we may change the format. -func (p *Package) MarshalJSON() ([]byte, error) { - flat := &flatPackage{ - ID: p.ID, - Name: p.Name, - PkgPath: p.PkgPath, - Errors: p.Errors, - GoFiles: p.GoFiles, - CompiledGoFiles: p.CompiledGoFiles, - OtherFiles: p.OtherFiles, - EmbedFiles: p.EmbedFiles, - EmbedPatterns: p.EmbedPatterns, - IgnoredFiles: p.IgnoredFiles, - ExportFile: p.ExportFile, - } - if len(p.Imports) > 0 { - flat.Imports = make(map[string]string, len(p.Imports)) - for path, ipkg := range p.Imports { - flat.Imports[path] = ipkg.ID - } - } - return json.Marshal(flat) -} - -// UnmarshalJSON reads in a Package from its JSON format. -// See MarshalJSON for details about the format accepted. -func (p *Package) UnmarshalJSON(b []byte) error { - flat := &flatPackage{} - if err := json.Unmarshal(b, &flat); err != nil { - return err - } - *p = Package{ - ID: flat.ID, - Name: flat.Name, - PkgPath: flat.PkgPath, - Errors: flat.Errors, - GoFiles: flat.GoFiles, - CompiledGoFiles: flat.CompiledGoFiles, - OtherFiles: flat.OtherFiles, - EmbedFiles: flat.EmbedFiles, - EmbedPatterns: flat.EmbedPatterns, - ExportFile: flat.ExportFile, - } - if len(flat.Imports) > 0 { - p.Imports = make(map[string]*Package, len(flat.Imports)) - for path, id := range flat.Imports { - p.Imports[path] = &Package{ID: id} - } - } - return nil -} - -func (p *Package) String() string { return p.ID } - -// loaderPackage augments Package with state used during the loading phase -type loaderPackage struct { - *Package - importErrors map[string]error // maps each bad import to its error - loadOnce sync.Once - color uint8 // for cycle detection - needsrc bool // load from source (Mode >= LoadTypes) - needtypes bool // type information is either requested or depended on - initial bool // package was matched by a pattern - goVersion int // minor version number of go command on PATH -} - -// loader holds the working state of a single call to load. -type loader struct { - pkgs map[string]*loaderPackage - Config - sizes types.Sizes - parseCache map[string]*parseValue - parseCacheMu sync.Mutex - exportMu sync.Mutex // enforces mutual exclusion of exportdata operations - - // Config.Mode contains the implied mode (see impliedLoadMode). - // Implied mode contains all the fields we need the data for. - // In requestedMode there are the actually requested fields. - // We'll zero them out before returning packages to the user. - // This makes it easier for us to get the conditions where - // we need certain modes right. - requestedMode LoadMode -} - -type parseValue struct { - f *ast.File - err error - ready chan struct{} -} - -func newLoader(cfg *Config) *loader { - ld := &loader{ - parseCache: map[string]*parseValue{}, - } - if cfg != nil { - ld.Config = *cfg - // If the user has provided a logger, use it. - ld.Config.Logf = cfg.Logf - } - if ld.Config.Logf == nil { - // If the GOPACKAGESDEBUG environment variable is set to true, - // but the user has not provided a logger, default to log.Printf. - if debug { - ld.Config.Logf = log.Printf - } else { - ld.Config.Logf = func(format string, args ...interface{}) {} - } - } - if ld.Config.Mode == 0 { - ld.Config.Mode = NeedName | NeedFiles | NeedCompiledGoFiles // Preserve zero behavior of Mode for backwards compatibility. - } - if ld.Config.Env == nil { - ld.Config.Env = os.Environ() - } - if ld.Config.gocmdRunner == nil { - ld.Config.gocmdRunner = &gocommand.Runner{} - } - if ld.Context == nil { - ld.Context = context.Background() - } - if ld.Dir == "" { - if dir, err := os.Getwd(); err == nil { - ld.Dir = dir - } - } - - // Save the actually requested fields. We'll zero them out before returning packages to the user. - ld.requestedMode = ld.Mode - ld.Mode = impliedLoadMode(ld.Mode) - - if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { - if ld.Fset == nil { - ld.Fset = token.NewFileSet() - } - - // ParseFile is required even in LoadTypes mode - // because we load source if export data is missing. - if ld.ParseFile == nil { - ld.ParseFile = func(fset *token.FileSet, filename string, src []byte) (*ast.File, error) { - const mode = parser.AllErrors | parser.ParseComments - return parser.ParseFile(fset, filename, src, mode) - } - } - } - - return ld -} - -// refine connects the supplied packages into a graph and then adds type -// and syntax information as requested by the LoadMode. -func (ld *loader) refine(response *driverResponse) ([]*Package, error) { - roots := response.Roots - rootMap := make(map[string]int, len(roots)) - for i, root := range roots { - rootMap[root] = i - } - ld.pkgs = make(map[string]*loaderPackage) - // first pass, fixup and build the map and roots - var initial = make([]*loaderPackage, len(roots)) - for _, pkg := range response.Packages { - rootIndex := -1 - if i, found := rootMap[pkg.ID]; found { - rootIndex = i - } - - // Overlays can invalidate export data. - // TODO(matloob): make this check fine-grained based on dependencies on overlaid files - exportDataInvalid := len(ld.Overlay) > 0 || pkg.ExportFile == "" && pkg.PkgPath != "unsafe" - // This package needs type information if the caller requested types and the package is - // either a root, or it's a non-root and the user requested dependencies ... - needtypes := (ld.Mode&NeedTypes|NeedTypesInfo != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) - // This package needs source if the call requested source (or types info, which implies source) - // and the package is either a root, or itas a non- root and the user requested dependencies... - needsrc := ((ld.Mode&(NeedSyntax|NeedTypesInfo) != 0 && (rootIndex >= 0 || ld.Mode&NeedDeps != 0)) || - // ... or if we need types and the exportData is invalid. We fall back to (incompletely) - // typechecking packages from source if they fail to compile. - (ld.Mode&(NeedTypes|NeedTypesInfo) != 0 && exportDataInvalid)) && pkg.PkgPath != "unsafe" - lpkg := &loaderPackage{ - Package: pkg, - needtypes: needtypes, - needsrc: needsrc, - goVersion: response.GoVersion, - } - ld.pkgs[lpkg.ID] = lpkg - if rootIndex >= 0 { - initial[rootIndex] = lpkg - lpkg.initial = true - } - } - for i, root := range roots { - if initial[i] == nil { - return nil, fmt.Errorf("root package %v is missing", root) - } - } - - // Materialize the import graph. - - const ( - white = 0 // new - grey = 1 // in progress - black = 2 // complete - ) - - // visit traverses the import graph, depth-first, - // and materializes the graph as Packages.Imports. - // - // Valid imports are saved in the Packages.Import map. - // Invalid imports (cycles and missing nodes) are saved in the importErrors map. - // Thus, even in the presence of both kinds of errors, the Import graph remains a DAG. - // - // visit returns whether the package needs src or has a transitive - // dependency on a package that does. These are the only packages - // for which we load source code. - var stack []*loaderPackage - var visit func(lpkg *loaderPackage) bool - var srcPkgs []*loaderPackage - visit = func(lpkg *loaderPackage) bool { - switch lpkg.color { - case black: - return lpkg.needsrc - case grey: - panic("internal error: grey node") - } - lpkg.color = grey - stack = append(stack, lpkg) // push - stubs := lpkg.Imports // the structure form has only stubs with the ID in the Imports - // If NeedImports isn't set, the imports fields will all be zeroed out. - if ld.Mode&NeedImports != 0 { - lpkg.Imports = make(map[string]*Package, len(stubs)) - for importPath, ipkg := range stubs { - var importErr error - imp := ld.pkgs[ipkg.ID] - if imp == nil { - // (includes package "C" when DisableCgo) - importErr = fmt.Errorf("missing package: %q", ipkg.ID) - } else if imp.color == grey { - importErr = fmt.Errorf("import cycle: %s", stack) - } - if importErr != nil { - if lpkg.importErrors == nil { - lpkg.importErrors = make(map[string]error) - } - lpkg.importErrors[importPath] = importErr - continue - } - - if visit(imp) { - lpkg.needsrc = true - } - lpkg.Imports[importPath] = imp.Package - } - } - if lpkg.needsrc { - srcPkgs = append(srcPkgs, lpkg) - } - if ld.Mode&NeedTypesSizes != 0 { - lpkg.TypesSizes = ld.sizes - } - stack = stack[:len(stack)-1] // pop - lpkg.color = black - - return lpkg.needsrc - } - - if ld.Mode&NeedImports == 0 { - // We do this to drop the stub import packages that we are not even going to try to resolve. - for _, lpkg := range initial { - lpkg.Imports = nil - } - } else { - // For each initial package, create its import DAG. - for _, lpkg := range initial { - visit(lpkg) - } - } - if ld.Mode&NeedImports != 0 && ld.Mode&NeedTypes != 0 { - for _, lpkg := range srcPkgs { - // Complete type information is required for the - // immediate dependencies of each source package. - for _, ipkg := range lpkg.Imports { - imp := ld.pkgs[ipkg.ID] - imp.needtypes = true - } - } - } - // Load type data and syntax if needed, starting at - // the initial packages (roots of the import DAG). - if ld.Mode&NeedTypes != 0 || ld.Mode&NeedSyntax != 0 { - var wg sync.WaitGroup - for _, lpkg := range initial { - wg.Add(1) - go func(lpkg *loaderPackage) { - ld.loadRecursive(lpkg) - wg.Done() - }(lpkg) - } - wg.Wait() - } - - result := make([]*Package, len(initial)) - for i, lpkg := range initial { - result[i] = lpkg.Package - } - for i := range ld.pkgs { - // Clear all unrequested fields, - // to catch programs that use more than they request. - if ld.requestedMode&NeedName == 0 { - ld.pkgs[i].Name = "" - ld.pkgs[i].PkgPath = "" - } - if ld.requestedMode&NeedFiles == 0 { - ld.pkgs[i].GoFiles = nil - ld.pkgs[i].OtherFiles = nil - ld.pkgs[i].IgnoredFiles = nil - } - if ld.requestedMode&NeedEmbedFiles == 0 { - ld.pkgs[i].EmbedFiles = nil - } - if ld.requestedMode&NeedEmbedPatterns == 0 { - ld.pkgs[i].EmbedPatterns = nil - } - if ld.requestedMode&NeedCompiledGoFiles == 0 { - ld.pkgs[i].CompiledGoFiles = nil - } - if ld.requestedMode&NeedImports == 0 { - ld.pkgs[i].Imports = nil - } - if ld.requestedMode&NeedExportFile == 0 { - ld.pkgs[i].ExportFile = "" - } - if ld.requestedMode&NeedTypes == 0 { - ld.pkgs[i].Types = nil - ld.pkgs[i].Fset = nil - ld.pkgs[i].IllTyped = false - } - if ld.requestedMode&NeedSyntax == 0 { - ld.pkgs[i].Syntax = nil - } - if ld.requestedMode&NeedTypesInfo == 0 { - ld.pkgs[i].TypesInfo = nil - } - if ld.requestedMode&NeedTypesSizes == 0 { - ld.pkgs[i].TypesSizes = nil - } - if ld.requestedMode&NeedModule == 0 { - ld.pkgs[i].Module = nil - } - } - - return result, nil -} - -// loadRecursive loads the specified package and its dependencies, -// recursively, in parallel, in topological order. -// It is atomic and idempotent. -// Precondition: ld.Mode&NeedTypes. -func (ld *loader) loadRecursive(lpkg *loaderPackage) { - lpkg.loadOnce.Do(func() { - // Load the direct dependencies, in parallel. - var wg sync.WaitGroup - for _, ipkg := range lpkg.Imports { - imp := ld.pkgs[ipkg.ID] - wg.Add(1) - go func(imp *loaderPackage) { - ld.loadRecursive(imp) - wg.Done() - }(imp) - } - wg.Wait() - ld.loadPackage(lpkg) - }) -} - -// loadPackage loads the specified package. -// It must be called only once per Package, -// after immediate dependencies are loaded. -// Precondition: ld.Mode & NeedTypes. -func (ld *loader) loadPackage(lpkg *loaderPackage) { - if lpkg.PkgPath == "unsafe" { - // Fill in the blanks to avoid surprises. - lpkg.Types = types.Unsafe - lpkg.Fset = ld.Fset - lpkg.Syntax = []*ast.File{} - lpkg.TypesInfo = new(types.Info) - lpkg.TypesSizes = ld.sizes - return - } - - // Call NewPackage directly with explicit name. - // This avoids skew between golist and go/types when the files' - // package declarations are inconsistent. - lpkg.Types = types.NewPackage(lpkg.PkgPath, lpkg.Name) - lpkg.Fset = ld.Fset - - // Subtle: we populate all Types fields with an empty Package - // before loading export data so that export data processing - // never has to create a types.Package for an indirect dependency, - // which would then require that such created packages be explicitly - // inserted back into the Import graph as a final step after export data loading. - // (Hence this return is after the Types assignment.) - // The Diamond test exercises this case. - if !lpkg.needtypes && !lpkg.needsrc { - return - } - if !lpkg.needsrc { - if err := ld.loadFromExportData(lpkg); err != nil { - lpkg.Errors = append(lpkg.Errors, Error{ - Pos: "-", - Msg: err.Error(), - Kind: UnknownError, // e.g. can't find/open/parse export data - }) - } - return // not a source package, don't get syntax trees - } - - appendError := func(err error) { - // Convert various error types into the one true Error. - var errs []Error - switch err := err.(type) { - case Error: - // from driver - errs = append(errs, err) - - case *os.PathError: - // from parser - errs = append(errs, Error{ - Pos: err.Path + ":1", - Msg: err.Err.Error(), - Kind: ParseError, - }) - - case scanner.ErrorList: - // from parser - for _, err := range err { - errs = append(errs, Error{ - Pos: err.Pos.String(), - Msg: err.Msg, - Kind: ParseError, - }) - } - - case types.Error: - // from type checker - lpkg.TypeErrors = append(lpkg.TypeErrors, err) - errs = append(errs, Error{ - Pos: err.Fset.Position(err.Pos).String(), - Msg: err.Msg, - Kind: TypeError, - }) - - default: - // unexpected impoverished error from parser? - errs = append(errs, Error{ - Pos: "-", - Msg: err.Error(), - Kind: UnknownError, - }) - - // If you see this error message, please file a bug. - log.Printf("internal error: error %q (%T) without position", err, err) - } - - lpkg.Errors = append(lpkg.Errors, errs...) - } - - // If the go command on the PATH is newer than the runtime, - // then the go/{scanner,ast,parser,types} packages from the - // standard library may be unable to process the files - // selected by go list. - // - // There is currently no way to downgrade the effective - // version of the go command (see issue 52078), so we proceed - // with the newer go command but, in case of parse or type - // errors, we emit an additional diagnostic. - // - // See: - // - golang.org/issue/52078 (flag to set release tags) - // - golang.org/issue/50825 (gopls legacy version support) - // - golang.org/issue/55883 (go/packages confusing error) - // - // Should we assert a hard minimum of (currently) go1.16 here? - var runtimeVersion int - if _, err := fmt.Sscanf(runtime.Version(), "go1.%d", &runtimeVersion); err == nil && runtimeVersion < lpkg.goVersion { - defer func() { - if len(lpkg.Errors) > 0 { - appendError(Error{ - Pos: "-", - Msg: fmt.Sprintf("This application uses version go1.%d of the source-processing packages but runs version go1.%d of 'go list'. It may fail to process source files that rely on newer language features. If so, rebuild the application using a newer version of Go.", runtimeVersion, lpkg.goVersion), - Kind: UnknownError, - }) - } - }() - } - - if ld.Config.Mode&NeedTypes != 0 && len(lpkg.CompiledGoFiles) == 0 && lpkg.ExportFile != "" { - // The config requested loading sources and types, but sources are missing. - // Add an error to the package and fall back to loading from export data. - appendError(Error{"-", fmt.Sprintf("sources missing for package %s", lpkg.ID), ParseError}) - _ = ld.loadFromExportData(lpkg) // ignore any secondary errors - - return // can't get syntax trees for this package - } - - files, errs := ld.parseFiles(lpkg.CompiledGoFiles) - for _, err := range errs { - appendError(err) - } - - lpkg.Syntax = files - if ld.Config.Mode&NeedTypes == 0 { - return - } - - lpkg.TypesInfo = &types.Info{ - Types: make(map[ast.Expr]types.TypeAndValue), - Defs: make(map[*ast.Ident]types.Object), - Uses: make(map[*ast.Ident]types.Object), - Implicits: make(map[ast.Node]types.Object), - Scopes: make(map[ast.Node]*types.Scope), - Selections: make(map[*ast.SelectorExpr]*types.Selection), - } - typeparams.InitInstanceInfo(lpkg.TypesInfo) - lpkg.TypesSizes = ld.sizes - - importer := importerFunc(func(path string) (*types.Package, error) { - if path == "unsafe" { - return types.Unsafe, nil - } - - // The imports map is keyed by import path. - ipkg := lpkg.Imports[path] - if ipkg == nil { - if err := lpkg.importErrors[path]; err != nil { - return nil, err - } - // There was skew between the metadata and the - // import declarations, likely due to an edit - // race, or because the ParseFile feature was - // used to supply alternative file contents. - return nil, fmt.Errorf("no metadata for %s", path) - } - - if ipkg.Types != nil && ipkg.Types.Complete() { - return ipkg.Types, nil - } - log.Fatalf("internal error: package %q without types was imported from %q", path, lpkg) - panic("unreachable") - }) - - // type-check - tc := &types.Config{ - Importer: importer, - - // Type-check bodies of functions only in initial packages. - // Example: for import graph A->B->C and initial packages {A,C}, - // we can ignore function bodies in B. - IgnoreFuncBodies: ld.Mode&NeedDeps == 0 && !lpkg.initial, - - Error: appendError, - Sizes: ld.sizes, - } - if lpkg.Module != nil && lpkg.Module.GoVersion != "" { - typesinternal.SetGoVersion(tc, "go"+lpkg.Module.GoVersion) - } - if (ld.Mode & typecheckCgo) != 0 { - if !typesinternal.SetUsesCgo(tc) { - appendError(Error{ - Msg: "typecheckCgo requires Go 1.15+", - Kind: ListError, - }) - return - } - } - types.NewChecker(tc, ld.Fset, lpkg.Types, lpkg.TypesInfo).Files(lpkg.Syntax) - - lpkg.importErrors = nil // no longer needed - - // If !Cgo, the type-checker uses FakeImportC mode, so - // it doesn't invoke the importer for import "C", - // nor report an error for the import, - // or for any undefined C.f reference. - // We must detect this explicitly and correctly - // mark the package as IllTyped (by reporting an error). - // TODO(adonovan): if these errors are annoying, - // we could just set IllTyped quietly. - if tc.FakeImportC { - outer: - for _, f := range lpkg.Syntax { - for _, imp := range f.Imports { - if imp.Path.Value == `"C"` { - err := types.Error{Fset: ld.Fset, Pos: imp.Pos(), Msg: `import "C" ignored`} - appendError(err) - break outer - } - } - } - } - - // Record accumulated errors. - illTyped := len(lpkg.Errors) > 0 - if !illTyped { - for _, imp := range lpkg.Imports { - if imp.IllTyped { - illTyped = true - break - } - } - } - lpkg.IllTyped = illTyped -} - -// An importFunc is an implementation of the single-method -// types.Importer interface based on a function value. -type importerFunc func(path string) (*types.Package, error) - -func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } - -// We use a counting semaphore to limit -// the number of parallel I/O calls per process. -var ioLimit = make(chan bool, 20) - -func (ld *loader) parseFile(filename string) (*ast.File, error) { - ld.parseCacheMu.Lock() - v, ok := ld.parseCache[filename] - if ok { - // cache hit - ld.parseCacheMu.Unlock() - <-v.ready - } else { - // cache miss - v = &parseValue{ready: make(chan struct{})} - ld.parseCache[filename] = v - ld.parseCacheMu.Unlock() - - var src []byte - for f, contents := range ld.Config.Overlay { - if sameFile(f, filename) { - src = contents - } - } - var err error - if src == nil { - ioLimit <- true // wait - src, err = ioutil.ReadFile(filename) - <-ioLimit // signal - } - if err != nil { - v.err = err - } else { - v.f, v.err = ld.ParseFile(ld.Fset, filename, src) - } - - close(v.ready) - } - return v.f, v.err -} - -// parseFiles reads and parses the Go source files and returns the ASTs -// of the ones that could be at least partially parsed, along with a -// list of I/O and parse errors encountered. -// -// Because files are scanned in parallel, the token.Pos -// positions of the resulting ast.Files are not ordered. -func (ld *loader) parseFiles(filenames []string) ([]*ast.File, []error) { - var wg sync.WaitGroup - n := len(filenames) - parsed := make([]*ast.File, n) - errors := make([]error, n) - for i, file := range filenames { - if ld.Config.Context.Err() != nil { - parsed[i] = nil - errors[i] = ld.Config.Context.Err() - continue - } - wg.Add(1) - go func(i int, filename string) { - parsed[i], errors[i] = ld.parseFile(filename) - wg.Done() - }(i, file) - } - wg.Wait() - - // Eliminate nils, preserving order. - var o int - for _, f := range parsed { - if f != nil { - parsed[o] = f - o++ - } - } - parsed = parsed[:o] - - o = 0 - for _, err := range errors { - if err != nil { - errors[o] = err - o++ - } - } - errors = errors[:o] - - return parsed, errors -} - -// sameFile returns true if x and y have the same basename and denote -// the same file. -func sameFile(x, y string) bool { - if x == y { - // It could be the case that y doesn't exist. - // For instance, it may be an overlay file that - // hasn't been written to disk. To handle that case - // let x == y through. (We added the exact absolute path - // string to the CompiledGoFiles list, so the unwritten - // overlay case implies x==y.) - return true - } - if strings.EqualFold(filepath.Base(x), filepath.Base(y)) { // (optimisation) - if xi, err := os.Stat(x); err == nil { - if yi, err := os.Stat(y); err == nil { - return os.SameFile(xi, yi) - } - } - } - return false -} - -// loadFromExportData ensures that type information is present for the specified -// package, loading it from an export data file on the first request. -// On success it sets lpkg.Types to a new Package. -func (ld *loader) loadFromExportData(lpkg *loaderPackage) error { - if lpkg.PkgPath == "" { - log.Fatalf("internal error: Package %s has no PkgPath", lpkg) - } - - // Because gcexportdata.Read has the potential to create or - // modify the types.Package for each node in the transitive - // closure of dependencies of lpkg, all exportdata operations - // must be sequential. (Finer-grained locking would require - // changes to the gcexportdata API.) - // - // The exportMu lock guards the lpkg.Types field and the - // types.Package it points to, for each loaderPackage in the graph. - // - // Not all accesses to Package.Pkg need to be protected by exportMu: - // graph ordering ensures that direct dependencies of source - // packages are fully loaded before the importer reads their Pkg field. - ld.exportMu.Lock() - defer ld.exportMu.Unlock() - - if tpkg := lpkg.Types; tpkg != nil && tpkg.Complete() { - return nil // cache hit - } - - lpkg.IllTyped = true // fail safe - - if lpkg.ExportFile == "" { - // Errors while building export data will have been printed to stderr. - return fmt.Errorf("no export data file") - } - f, err := os.Open(lpkg.ExportFile) - if err != nil { - return err - } - defer f.Close() - - // Read gc export data. - // - // We don't currently support gccgo export data because all - // underlying workspaces use the gc toolchain. (Even build - // systems that support gccgo don't use it for workspace - // queries.) - r, err := gcexportdata.NewReader(f) - if err != nil { - return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) - } - - // Build the view. - // - // The gcexportdata machinery has no concept of package ID. - // It identifies packages by their PkgPath, which although not - // globally unique is unique within the scope of one invocation - // of the linker, type-checker, or gcexportdata. - // - // So, we must build a PkgPath-keyed view of the global - // (conceptually ID-keyed) cache of packages and pass it to - // gcexportdata. The view must contain every existing - // package that might possibly be mentioned by the - // current package---its transitive closure. - // - // In loadPackage, we unconditionally create a types.Package for - // each dependency so that export data loading does not - // create new ones. - // - // TODO(adonovan): it would be simpler and more efficient - // if the export data machinery invoked a callback to - // get-or-create a package instead of a map. - // - view := make(map[string]*types.Package) // view seen by gcexportdata - seen := make(map[*loaderPackage]bool) // all visited packages - var visit func(pkgs map[string]*Package) - visit = func(pkgs map[string]*Package) { - for _, p := range pkgs { - lpkg := ld.pkgs[p.ID] - if !seen[lpkg] { - seen[lpkg] = true - view[lpkg.PkgPath] = lpkg.Types - visit(lpkg.Imports) - } - } - } - visit(lpkg.Imports) - - viewLen := len(view) + 1 // adding the self package - // Parse the export data. - // (May modify incomplete packages in view but not create new ones.) - tpkg, err := gcexportdata.Read(r, ld.Fset, view, lpkg.PkgPath) - if err != nil { - return fmt.Errorf("reading %s: %v", lpkg.ExportFile, err) - } - if _, ok := view["go.shape"]; ok { - // Account for the pseudopackage "go.shape" that gets - // created by generic code. - viewLen++ - } - if viewLen != len(view) { - log.Panicf("golang.org/x/tools/go/packages: unexpected new packages during load of %s", lpkg.PkgPath) - } - - lpkg.Types = tpkg - lpkg.IllTyped = false - return nil -} - -// impliedLoadMode returns loadMode with its dependencies. -func impliedLoadMode(loadMode LoadMode) LoadMode { - if loadMode&(NeedDeps|NeedTypes|NeedTypesInfo) != 0 { - // All these things require knowing the import graph. - loadMode |= NeedImports - } - - return loadMode -} - -func usesExportData(cfg *Config) bool { - return cfg.Mode&NeedExportFile != 0 || cfg.Mode&NeedTypes != 0 && cfg.Mode&NeedDeps == 0 -} - -var _ interface{} = io.Discard // assert build toolchain is go1.16 or later diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/visit.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/visit.go deleted file mode 100644 index a1dcc40b7270..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/packages/visit.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packages - -import ( - "fmt" - "os" - "sort" -) - -// Visit visits all the packages in the import graph whose roots are -// pkgs, calling the optional pre function the first time each package -// is encountered (preorder), and the optional post function after a -// package's dependencies have been visited (postorder). -// The boolean result of pre(pkg) determines whether -// the imports of package pkg are visited. -func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) { - seen := make(map[*Package]bool) - var visit func(*Package) - visit = func(pkg *Package) { - if !seen[pkg] { - seen[pkg] = true - - if pre == nil || pre(pkg) { - paths := make([]string, 0, len(pkg.Imports)) - for path := range pkg.Imports { - paths = append(paths, path) - } - sort.Strings(paths) // Imports is a map, this makes visit stable - for _, path := range paths { - visit(pkg.Imports[path]) - } - } - - if post != nil { - post(pkg) - } - } - } - for _, pkg := range pkgs { - visit(pkg) - } -} - -// PrintErrors prints to os.Stderr the accumulated errors of all -// packages in the import graph rooted at pkgs, dependencies first. -// PrintErrors returns the number of errors printed. -func PrintErrors(pkgs []*Package) int { - var n int - Visit(pkgs, nil, func(pkg *Package) { - for _, err := range pkg.Errors { - fmt.Fprintln(os.Stderr, err) - n++ - } - }) - return n -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/cluster-autoscaler/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go deleted file mode 100644 index c725d839ba15..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go +++ /dev/null @@ -1,824 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package objectpath defines a naming scheme for types.Objects -// (that is, named entities in Go programs) relative to their enclosing -// package. -// -// Type-checker objects are canonical, so they are usually identified by -// their address in memory (a pointer), but a pointer has meaning only -// within one address space. By contrast, objectpath names allow the -// identity of an object to be sent from one program to another, -// establishing a correspondence between types.Object variables that are -// distinct but logically equivalent. -// -// A single object may have multiple paths. In this example, -// -// type A struct{ X int } -// type B A -// -// the field X has two paths due to its membership of both A and B. -// The For(obj) function always returns one of these paths, arbitrarily -// but consistently. -package objectpath - -import ( - "fmt" - "go/types" - "sort" - "strconv" - "strings" - _ "unsafe" - - "golang.org/x/tools/internal/typeparams" -) - -// A Path is an opaque name that identifies a types.Object -// relative to its package. Conceptually, the name consists of a -// sequence of destructuring operations applied to the package scope -// to obtain the original object. -// The name does not include the package itself. -type Path string - -// Encoding -// -// An object path is a textual and (with training) human-readable encoding -// of a sequence of destructuring operators, starting from a types.Package. -// The sequences represent a path through the package/object/type graph. -// We classify these operators by their type: -// -// PO package->object Package.Scope.Lookup -// OT object->type Object.Type -// TT type->type Type.{Elem,Key,Params,Results,Underlying} [EKPRU] -// TO type->object Type.{At,Field,Method,Obj} [AFMO] -// -// All valid paths start with a package and end at an object -// and thus may be defined by the regular language: -// -// objectpath = PO (OT TT* TO)* -// -// The concrete encoding follows directly: -// - The only PO operator is Package.Scope.Lookup, which requires an identifier. -// - The only OT operator is Object.Type, -// which we encode as '.' because dot cannot appear in an identifier. -// - The TT operators are encoded as [EKPRUTC]; -// one of these (TypeParam) requires an integer operand, -// which is encoded as a string of decimal digits. -// - The TO operators are encoded as [AFMO]; -// three of these (At,Field,Method) require an integer operand, -// which is encoded as a string of decimal digits. -// These indices are stable across different representations -// of the same package, even source and export data. -// The indices used are implementation specific and may not correspond to -// the argument to the go/types function. -// -// In the example below, -// -// package p -// -// type T interface { -// f() (a string, b struct{ X int }) -// } -// -// field X has the path "T.UM0.RA1.F0", -// representing the following sequence of operations: -// -// p.Lookup("T") T -// .Type().Underlying().Method(0). f -// .Type().Results().At(1) b -// .Type().Field(0) X -// -// The encoding is not maximally compact---every R or P is -// followed by an A, for example---but this simplifies the -// encoder and decoder. -const ( - // object->type operators - opType = '.' // .Type() (Object) - - // type->type operators - opElem = 'E' // .Elem() (Pointer, Slice, Array, Chan, Map) - opKey = 'K' // .Key() (Map) - opParams = 'P' // .Params() (Signature) - opResults = 'R' // .Results() (Signature) - opUnderlying = 'U' // .Underlying() (Named) - opTypeParam = 'T' // .TypeParams.At(i) (Named, Signature) - opConstraint = 'C' // .Constraint() (TypeParam) - - // type->object operators - opAt = 'A' // .At(i) (Tuple) - opField = 'F' // .Field(i) (Struct) - opMethod = 'M' // .Method(i) (Named or Interface; not Struct: "promoted" names are ignored) - opObj = 'O' // .Obj() (Named, TypeParam) -) - -// For is equivalent to new(Encoder).For(obj). -// -// It may be more efficient to reuse a single Encoder across several calls. -func For(obj types.Object) (Path, error) { - return new(Encoder).For(obj) -} - -// An Encoder amortizes the cost of encoding the paths of multiple objects. -// The zero value of an Encoder is ready to use. -type Encoder struct { - scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects - namedMethodsMemo map[*types.Named][]*types.Func // memoization of namedMethods() - skipMethodSorting bool -} - -// Exposed to gopls via golang.org/x/tools/internal/typesinternal -// TODO(golang/go#61443): eliminate this parameter one way or the other. -// -//go:linkname skipMethodSorting -func skipMethodSorting(enc *Encoder) { - enc.skipMethodSorting = true -} - -// For returns the path to an object relative to its package, -// or an error if the object is not accessible from the package's Scope. -// -// The For function guarantees to return a path only for the following objects: -// - package-level types -// - exported package-level non-types -// - methods -// - parameter and result variables -// - struct fields -// These objects are sufficient to define the API of their package. -// The objects described by a package's export data are drawn from this set. -// -// The set of objects accessible from a package's Scope depends on -// whether the package was produced by type-checking syntax, or -// reading export data; the latter may have a smaller Scope since -// export data trims objects that are not reachable from an exported -// declaration. For example, the For function will return a path for -// an exported method of an unexported type that is not reachable -// from any public declaration; this path will cause the Object -// function to fail if called on a package loaded from export data. -// TODO(adonovan): is this a bug or feature? Should this package -// compute accessibility in the same way? -// -// For does not return a path for predeclared names, imported package -// names, local names, and unexported package-level names (except -// types). -// -// Example: given this definition, -// -// package p -// -// type T interface { -// f() (a string, b struct{ X int }) -// } -// -// For(X) would return a path that denotes the following sequence of operations: -// -// p.Scope().Lookup("T") (TypeName T) -// .Type().Underlying().Method(0). (method Func f) -// .Type().Results().At(1) (field Var b) -// .Type().Field(0) (field Var X) -// -// where p is the package (*types.Package) to which X belongs. -func (enc *Encoder) For(obj types.Object) (Path, error) { - pkg := obj.Pkg() - - // This table lists the cases of interest. - // - // Object Action - // ------ ------ - // nil reject - // builtin reject - // pkgname reject - // label reject - // var - // package-level accept - // func param/result accept - // local reject - // struct field accept - // const - // package-level accept - // local reject - // func - // package-level accept - // init functions reject - // concrete method accept - // interface method accept - // type - // package-level accept - // local reject - // - // The only accessible package-level objects are members of pkg itself. - // - // The cases are handled in four steps: - // - // 1. reject nil and builtin - // 2. accept package-level objects - // 3. reject obviously invalid objects - // 4. search the API for the path to the param/result/field/method. - - // 1. reference to nil or builtin? - if pkg == nil { - return "", fmt.Errorf("predeclared %s has no path", obj) - } - scope := pkg.Scope() - - // 2. package-level object? - if scope.Lookup(obj.Name()) == obj { - // Only exported objects (and non-exported types) have a path. - // Non-exported types may be referenced by other objects. - if _, ok := obj.(*types.TypeName); !ok && !obj.Exported() { - return "", fmt.Errorf("no path for non-exported %v", obj) - } - return Path(obj.Name()), nil - } - - // 3. Not a package-level object. - // Reject obviously non-viable cases. - switch obj := obj.(type) { - case *types.TypeName: - if _, ok := obj.Type().(*typeparams.TypeParam); !ok { - // With the exception of type parameters, only package-level type names - // have a path. - return "", fmt.Errorf("no path for %v", obj) - } - case *types.Const, // Only package-level constants have a path. - *types.Label, // Labels are function-local. - *types.PkgName: // PkgNames are file-local. - return "", fmt.Errorf("no path for %v", obj) - - case *types.Var: - // Could be: - // - a field (obj.IsField()) - // - a func parameter or result - // - a local var. - // Sadly there is no way to distinguish - // a param/result from a local - // so we must proceed to the find. - - case *types.Func: - // A func, if not package-level, must be a method. - if recv := obj.Type().(*types.Signature).Recv(); recv == nil { - return "", fmt.Errorf("func is not a method: %v", obj) - } - - if path, ok := enc.concreteMethod(obj); ok { - // Fast path for concrete methods that avoids looping over scope. - return path, nil - } - - default: - panic(obj) - } - - // 4. Search the API for the path to the var (field/param/result) or method. - - // First inspect package-level named types. - // In the presence of path aliases, these give - // the best paths because non-types may - // refer to types, but not the reverse. - empty := make([]byte, 0, 48) // initial space - objs := enc.scopeObjects(scope) - for _, o := range objs { - tname, ok := o.(*types.TypeName) - if !ok { - continue // handle non-types in second pass - } - - path := append(empty, o.Name()...) - path = append(path, opType) - - T := o.Type() - - if tname.IsAlias() { - // type alias - if r := find(obj, T, path, nil); r != nil { - return Path(r), nil - } - } else { - if named, _ := T.(*types.Named); named != nil { - if r := findTypeParam(obj, typeparams.ForNamed(named), path, nil); r != nil { - // generic named type - return Path(r), nil - } - } - // defined (named) type - if r := find(obj, T.Underlying(), append(path, opUnderlying), nil); r != nil { - return Path(r), nil - } - } - } - - // Then inspect everything else: - // non-types, and declared methods of defined types. - for _, o := range objs { - path := append(empty, o.Name()...) - if _, ok := o.(*types.TypeName); !ok { - if o.Exported() { - // exported non-type (const, var, func) - if r := find(obj, o.Type(), append(path, opType), nil); r != nil { - return Path(r), nil - } - } - continue - } - - // Inspect declared methods of defined types. - if T, ok := o.Type().(*types.Named); ok { - path = append(path, opType) - if !enc.skipMethodSorting { - // Note that method index here is always with respect - // to canonical ordering of methods, regardless of how - // they appear in the underlying type. - for i, m := range enc.namedMethods(T) { - path2 := appendOpArg(path, opMethod, i) - if m == obj { - return Path(path2), nil // found declared method - } - if r := find(obj, m.Type(), append(path2, opType), nil); r != nil { - return Path(r), nil - } - } - } else { - // This branch must match the logic in the branch above, using go/types - // APIs without sorting. - for i := 0; i < T.NumMethods(); i++ { - m := T.Method(i) - path2 := appendOpArg(path, opMethod, i) - if m == obj { - return Path(path2), nil // found declared method - } - if r := find(obj, m.Type(), append(path2, opType), nil); r != nil { - return Path(r), nil - } - } - } - } - } - - return "", fmt.Errorf("can't find path for %v in %s", obj, pkg.Path()) -} - -func appendOpArg(path []byte, op byte, arg int) []byte { - path = append(path, op) - path = strconv.AppendInt(path, int64(arg), 10) - return path -} - -// concreteMethod returns the path for meth, which must have a non-nil receiver. -// The second return value indicates success and may be false if the method is -// an interface method or if it is an instantiated method. -// -// This function is just an optimization that avoids the general scope walking -// approach. You are expected to fall back to the general approach if this -// function fails. -func (enc *Encoder) concreteMethod(meth *types.Func) (Path, bool) { - // Concrete methods can only be declared on package-scoped named types. For - // that reason we can skip the expensive walk over the package scope: the - // path will always be package -> named type -> method. We can trivially get - // the type name from the receiver, and only have to look over the type's - // methods to find the method index. - // - // Methods on generic types require special consideration, however. Consider - // the following package: - // - // L1: type S[T any] struct{} - // L2: func (recv S[A]) Foo() { recv.Bar() } - // L3: func (recv S[B]) Bar() { } - // L4: type Alias = S[int] - // L5: func _[T any]() { var s S[int]; s.Foo() } - // - // The receivers of methods on generic types are instantiations. L2 and L3 - // instantiate S with the type-parameters A and B, which are scoped to the - // respective methods. L4 and L5 each instantiate S with int. Each of these - // instantiations has its own method set, full of methods (and thus objects) - // with receivers whose types are the respective instantiations. In other - // words, we have - // - // S[A].Foo, S[A].Bar - // S[B].Foo, S[B].Bar - // S[int].Foo, S[int].Bar - // - // We may thus be trying to produce object paths for any of these objects. - // - // S[A].Foo and S[B].Bar are the origin methods, and their paths are S.Foo - // and S.Bar, which are the paths that this function naturally produces. - // - // S[A].Bar, S[B].Foo, and both methods on S[int] are instantiations that - // don't correspond to the origin methods. For S[int], this is significant. - // The most precise object path for S[int].Foo, for example, is Alias.Foo, - // not S.Foo. Our function, however, would produce S.Foo, which would - // resolve to a different object. - // - // For S[A].Bar and S[B].Foo it could be argued that S.Bar and S.Foo are - // still the correct paths, since only the origin methods have meaningful - // paths. But this is likely only true for trivial cases and has edge cases. - // Since this function is only an optimization, we err on the side of giving - // up, deferring to the slower but definitely correct algorithm. Most users - // of objectpath will only be giving us origin methods, anyway, as referring - // to instantiated methods is usually not useful. - - if typeparams.OriginMethod(meth) != meth { - return "", false - } - - recvT := meth.Type().(*types.Signature).Recv().Type() - if ptr, ok := recvT.(*types.Pointer); ok { - recvT = ptr.Elem() - } - - named, ok := recvT.(*types.Named) - if !ok { - return "", false - } - - if types.IsInterface(named) { - // Named interfaces don't have to be package-scoped - // - // TODO(dominikh): opt: if scope.Lookup(name) == named, then we can apply this optimization to interface - // methods, too, I think. - return "", false - } - - // Preallocate space for the name, opType, opMethod, and some digits. - name := named.Obj().Name() - path := make([]byte, 0, len(name)+8) - path = append(path, name...) - path = append(path, opType) - - if !enc.skipMethodSorting { - for i, m := range enc.namedMethods(named) { - if m == meth { - path = appendOpArg(path, opMethod, i) - return Path(path), true - } - } - } else { - // This branch must match the logic of the branch above, using go/types - // APIs without sorting. - for i := 0; i < named.NumMethods(); i++ { - m := named.Method(i) - if m == meth { - path = appendOpArg(path, opMethod, i) - return Path(path), true - } - } - } - - // Due to golang/go#59944, go/types fails to associate the receiver with - // certain methods on cgo types. - // - // TODO(rfindley): replace this panic once golang/go#59944 is fixed in all Go - // versions gopls supports. - return "", false - // panic(fmt.Sprintf("couldn't find method %s on type %s; methods: %#v", meth, named, enc.namedMethods(named))) -} - -// find finds obj within type T, returning the path to it, or nil if not found. -// -// The seen map is used to short circuit cycles through type parameters. If -// nil, it will be allocated as necessary. -func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName]bool) []byte { - switch T := T.(type) { - case *types.Basic, *types.Named: - // Named types belonging to pkg were handled already, - // so T must belong to another package. No path. - return nil - case *types.Pointer: - return find(obj, T.Elem(), append(path, opElem), seen) - case *types.Slice: - return find(obj, T.Elem(), append(path, opElem), seen) - case *types.Array: - return find(obj, T.Elem(), append(path, opElem), seen) - case *types.Chan: - return find(obj, T.Elem(), append(path, opElem), seen) - case *types.Map: - if r := find(obj, T.Key(), append(path, opKey), seen); r != nil { - return r - } - return find(obj, T.Elem(), append(path, opElem), seen) - case *types.Signature: - if r := findTypeParam(obj, typeparams.ForSignature(T), path, seen); r != nil { - return r - } - if r := find(obj, T.Params(), append(path, opParams), seen); r != nil { - return r - } - return find(obj, T.Results(), append(path, opResults), seen) - case *types.Struct: - for i := 0; i < T.NumFields(); i++ { - fld := T.Field(i) - path2 := appendOpArg(path, opField, i) - if fld == obj { - return path2 // found field var - } - if r := find(obj, fld.Type(), append(path2, opType), seen); r != nil { - return r - } - } - return nil - case *types.Tuple: - for i := 0; i < T.Len(); i++ { - v := T.At(i) - path2 := appendOpArg(path, opAt, i) - if v == obj { - return path2 // found param/result var - } - if r := find(obj, v.Type(), append(path2, opType), seen); r != nil { - return r - } - } - return nil - case *types.Interface: - for i := 0; i < T.NumMethods(); i++ { - m := T.Method(i) - path2 := appendOpArg(path, opMethod, i) - if m == obj { - return path2 // found interface method - } - if r := find(obj, m.Type(), append(path2, opType), seen); r != nil { - return r - } - } - return nil - case *typeparams.TypeParam: - name := T.Obj() - if name == obj { - return append(path, opObj) - } - if seen[name] { - return nil - } - if seen == nil { - seen = make(map[*types.TypeName]bool) - } - seen[name] = true - if r := find(obj, T.Constraint(), append(path, opConstraint), seen); r != nil { - return r - } - return nil - } - panic(T) -} - -func findTypeParam(obj types.Object, list *typeparams.TypeParamList, path []byte, seen map[*types.TypeName]bool) []byte { - for i := 0; i < list.Len(); i++ { - tparam := list.At(i) - path2 := appendOpArg(path, opTypeParam, i) - if r := find(obj, tparam, path2, seen); r != nil { - return r - } - } - return nil -} - -// Object returns the object denoted by path p within the package pkg. -func Object(pkg *types.Package, p Path) (types.Object, error) { - return object(pkg, p, false) -} - -// Note: the skipMethodSorting parameter must match the value of -// Encoder.skipMethodSorting used during encoding. -func object(pkg *types.Package, p Path, skipMethodSorting bool) (types.Object, error) { - if p == "" { - return nil, fmt.Errorf("empty path") - } - - pathstr := string(p) - var pkgobj, suffix string - if dot := strings.IndexByte(pathstr, opType); dot < 0 { - pkgobj = pathstr - } else { - pkgobj = pathstr[:dot] - suffix = pathstr[dot:] // suffix starts with "." - } - - obj := pkg.Scope().Lookup(pkgobj) - if obj == nil { - return nil, fmt.Errorf("package %s does not contain %q", pkg.Path(), pkgobj) - } - - // abstraction of *types.{Pointer,Slice,Array,Chan,Map} - type hasElem interface { - Elem() types.Type - } - // abstraction of *types.{Named,Signature} - type hasTypeParams interface { - TypeParams() *typeparams.TypeParamList - } - // abstraction of *types.{Named,TypeParam} - type hasObj interface { - Obj() *types.TypeName - } - - // The loop state is the pair (t, obj), - // exactly one of which is non-nil, initially obj. - // All suffixes start with '.' (the only object->type operation), - // followed by optional type->type operations, - // then a type->object operation. - // The cycle then repeats. - var t types.Type - for suffix != "" { - code := suffix[0] - suffix = suffix[1:] - - // Codes [AFM] have an integer operand. - var index int - switch code { - case opAt, opField, opMethod, opTypeParam: - rest := strings.TrimLeft(suffix, "0123456789") - numerals := suffix[:len(suffix)-len(rest)] - suffix = rest - i, err := strconv.Atoi(numerals) - if err != nil { - return nil, fmt.Errorf("invalid path: bad numeric operand %q for code %q", numerals, code) - } - index = int(i) - case opObj: - // no operand - default: - // The suffix must end with a type->object operation. - if suffix == "" { - return nil, fmt.Errorf("invalid path: ends with %q, want [AFMO]", code) - } - } - - if code == opType { - if t != nil { - return nil, fmt.Errorf("invalid path: unexpected %q in type context", opType) - } - t = obj.Type() - obj = nil - continue - } - - if t == nil { - return nil, fmt.Errorf("invalid path: code %q in object context", code) - } - - // Inv: t != nil, obj == nil - - switch code { - case opElem: - hasElem, ok := t.(hasElem) // Pointer, Slice, Array, Chan, Map - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want pointer, slice, array, chan or map)", code, t, t) - } - t = hasElem.Elem() - - case opKey: - mapType, ok := t.(*types.Map) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want map)", code, t, t) - } - t = mapType.Key() - - case opParams: - sig, ok := t.(*types.Signature) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) - } - t = sig.Params() - - case opResults: - sig, ok := t.(*types.Signature) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) - } - t = sig.Results() - - case opUnderlying: - named, ok := t.(*types.Named) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named)", code, t, t) - } - t = named.Underlying() - - case opTypeParam: - hasTypeParams, ok := t.(hasTypeParams) // Named, Signature - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or signature)", code, t, t) - } - tparams := hasTypeParams.TypeParams() - if n := tparams.Len(); index >= n { - return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) - } - t = tparams.At(index) - - case opConstraint: - tparam, ok := t.(*typeparams.TypeParam) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want type parameter)", code, t, t) - } - t = tparam.Constraint() - - case opAt: - tuple, ok := t.(*types.Tuple) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want tuple)", code, t, t) - } - if n := tuple.Len(); index >= n { - return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) - } - obj = tuple.At(index) - t = nil - - case opField: - structType, ok := t.(*types.Struct) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want struct)", code, t, t) - } - if n := structType.NumFields(); index >= n { - return nil, fmt.Errorf("field index %d out of range [0-%d)", index, n) - } - obj = structType.Field(index) - t = nil - - case opMethod: - switch t := t.(type) { - case *types.Interface: - if index >= t.NumMethods() { - return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) - } - obj = t.Method(index) // Id-ordered - - case *types.Named: - if index >= t.NumMethods() { - return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods()) - } - if skipMethodSorting { - obj = t.Method(index) - } else { - methods := namedMethods(t) // (unmemoized) - obj = methods[index] // Id-ordered - } - - default: - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want interface or named)", code, t, t) - } - t = nil - - case opObj: - hasObj, ok := t.(hasObj) - if !ok { - return nil, fmt.Errorf("cannot apply %q to %s (got %T, want named or type param)", code, t, t) - } - obj = hasObj.Obj() - t = nil - - default: - return nil, fmt.Errorf("invalid path: unknown code %q", code) - } - } - - if obj.Pkg() != pkg { - return nil, fmt.Errorf("path denotes %s, which belongs to a different package", obj) - } - - return obj, nil // success -} - -// namedMethods returns the methods of a Named type in ascending Id order. -func namedMethods(named *types.Named) []*types.Func { - methods := make([]*types.Func, named.NumMethods()) - for i := range methods { - methods[i] = named.Method(i) - } - sort.Slice(methods, func(i, j int) bool { - return methods[i].Id() < methods[j].Id() - }) - return methods -} - -// namedMethods is a memoization of the namedMethods function. Callers must not modify the result. -func (enc *Encoder) namedMethods(named *types.Named) []*types.Func { - m := enc.namedMethodsMemo - if m == nil { - m = make(map[*types.Named][]*types.Func) - enc.namedMethodsMemo = m - } - methods, ok := m[named] - if !ok { - methods = namedMethods(named) // allocates and sorts - m[named] = methods - } - return methods -} - -// scopeObjects is a memoization of scope objects. -// Callers must not modify the result. -func (enc *Encoder) scopeObjects(scope *types.Scope) []types.Object { - m := enc.scopeMemo - if m == nil { - m = make(map[*types.Scope][]types.Object) - enc.scopeMemo = m - } - objs, ok := m[scope] - if !ok { - names := scope.Names() // allocates and sorts - objs = make([]types.Object, len(names)) - for i, name := range names { - objs[i] = scope.Lookup(name) - } - m[scope] = objs - } - return objs -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/imports/forward.go b/cluster-autoscaler/vendor/golang.org/x/tools/imports/forward.go deleted file mode 100644 index d2547c743382..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/imports/forward.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package imports implements a Go pretty-printer (like package "go/format") -// that also adds or removes import statements as necessary. -package imports // import "golang.org/x/tools/imports" - -import ( - "io/ioutil" - "log" - - "golang.org/x/tools/internal/gocommand" - intimp "golang.org/x/tools/internal/imports" -) - -// Options specifies options for processing files. -type Options struct { - Fragment bool // Accept fragment of a source file (no package statement) - AllErrors bool // Report all errors (not just the first 10 on different lines) - - Comments bool // Print comments (true if nil *Options provided) - TabIndent bool // Use tabs for indent (true if nil *Options provided) - TabWidth int // Tab width (8 if nil *Options provided) - - FormatOnly bool // Disable the insertion and deletion of imports -} - -// Debug controls verbose logging. -var Debug = false - -// LocalPrefix is a comma-separated string of import path prefixes, which, if -// set, instructs Process to sort the import paths with the given prefixes -// into another group after 3rd-party packages. -var LocalPrefix string - -// Process formats and adjusts imports for the provided file. -// If opt is nil the defaults are used, and if src is nil the source -// is read from the filesystem. -// -// Note that filename's directory influences which imports can be chosen, -// so it is important that filename be accurate. -// To process data “as if” it were in filename, pass the data as a non-nil src. -func Process(filename string, src []byte, opt *Options) ([]byte, error) { - var err error - if src == nil { - src, err = ioutil.ReadFile(filename) - if err != nil { - return nil, err - } - } - if opt == nil { - opt = &Options{Comments: true, TabIndent: true, TabWidth: 8} - } - intopt := &intimp.Options{ - Env: &intimp.ProcessEnv{ - GocmdRunner: &gocommand.Runner{}, - }, - LocalPrefix: LocalPrefix, - AllErrors: opt.AllErrors, - Comments: opt.Comments, - FormatOnly: opt.FormatOnly, - Fragment: opt.Fragment, - TabIndent: opt.TabIndent, - TabWidth: opt.TabWidth, - } - if Debug { - intopt.Env.Logf = log.Printf - } - return intimp.Process(filename, src, intopt) -} - -// VendorlessPath returns the devendorized version of the import path ipath. -// For example, VendorlessPath("foo/bar/vendor/a/b") returns "a/b". -func VendorlessPath(ipath string) string { - return intimp.VendorlessPath(ipath) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/event.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/event.go deleted file mode 100644 index a6cf0e64a4b1..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/event.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package core provides support for event based telemetry. -package core - -import ( - "fmt" - "time" - - "golang.org/x/tools/internal/event/label" -) - -// Event holds the information about an event of note that occurred. -type Event struct { - at time.Time - - // As events are often on the stack, storing the first few labels directly - // in the event can avoid an allocation at all for the very common cases of - // simple events. - // The length needs to be large enough to cope with the majority of events - // but no so large as to cause undue stack pressure. - // A log message with two values will use 3 labels (one for each value and - // one for the message itself). - - static [3]label.Label // inline storage for the first few labels - dynamic []label.Label // dynamically sized storage for remaining labels -} - -// eventLabelMap implements label.Map for a the labels of an Event. -type eventLabelMap struct { - event Event -} - -func (ev Event) At() time.Time { return ev.at } - -func (ev Event) Format(f fmt.State, r rune) { - if !ev.at.IsZero() { - fmt.Fprint(f, ev.at.Format("2006/01/02 15:04:05 ")) - } - for index := 0; ev.Valid(index); index++ { - if l := ev.Label(index); l.Valid() { - fmt.Fprintf(f, "\n\t%v", l) - } - } -} - -func (ev Event) Valid(index int) bool { - return index >= 0 && index < len(ev.static)+len(ev.dynamic) -} - -func (ev Event) Label(index int) label.Label { - if index < len(ev.static) { - return ev.static[index] - } - return ev.dynamic[index-len(ev.static)] -} - -func (ev Event) Find(key label.Key) label.Label { - for _, l := range ev.static { - if l.Key() == key { - return l - } - } - for _, l := range ev.dynamic { - if l.Key() == key { - return l - } - } - return label.Label{} -} - -func MakeEvent(static [3]label.Label, labels []label.Label) Event { - return Event{ - static: static, - dynamic: labels, - } -} - -// CloneEvent event returns a copy of the event with the time adjusted to at. -func CloneEvent(ev Event, at time.Time) Event { - ev.at = at - return ev -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/export.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/export.go deleted file mode 100644 index 05f3a9a5791a..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/export.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - "sync/atomic" - "time" - "unsafe" - - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, Event, label.Map) context.Context - -var ( - exporter unsafe.Pointer -) - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - p := unsafe.Pointer(&e) - if e == nil { - // &e is always valid, and so p is always valid, but for the early abort - // of ProcessEvent to be efficient it needs to make the nil check on the - // pointer without having to dereference it, so we make the nil function - // also a nil pointer - p = nil - } - atomic.StorePointer(&exporter, p) -} - -// deliver is called to deliver an event to the supplied exporter. -// it will fill in the time. -func deliver(ctx context.Context, exporter Exporter, ev Event) context.Context { - // add the current time to the event - ev.at = time.Now() - // hand the event off to the current exporter - return exporter(ctx, ev, ev) -} - -// Export is called to deliver an event to the global exporter if set. -func Export(ctx context.Context, ev Event) context.Context { - // get the global exporter and abort early if there is not one - exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) - if exporterPtr == nil { - return ctx - } - return deliver(ctx, *exporterPtr, ev) -} - -// ExportPair is called to deliver a start event to the supplied exporter. -// It also returns a function that will deliver the end event to the same -// exporter. -// It will fill in the time. -func ExportPair(ctx context.Context, begin, end Event) (context.Context, func()) { - // get the global exporter and abort early if there is not one - exporterPtr := (*Exporter)(atomic.LoadPointer(&exporter)) - if exporterPtr == nil { - return ctx, func() {} - } - ctx = deliver(ctx, *exporterPtr, begin) - return ctx, func() { deliver(ctx, *exporterPtr, end) } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/fast.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/fast.go deleted file mode 100644 index 06c1d4615e6b..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/core/fast.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package core - -import ( - "context" - - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Log1 takes a message and one label delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log1(ctx context.Context, message string, t1 label.Label) { - Export(ctx, MakeEvent([3]label.Label{ - keys.Msg.Of(message), - t1, - }, nil)) -} - -// Log2 takes a message and two labels and delivers a log event to the exporter. -// It is a customized version of Print that is faster and does no allocation. -func Log2(ctx context.Context, message string, t1 label.Label, t2 label.Label) { - Export(ctx, MakeEvent([3]label.Label{ - keys.Msg.Of(message), - t1, - t2, - }, nil)) -} - -// Metric1 sends a label event to the exporter with the supplied labels. -func Metric1(ctx context.Context, t1 label.Label) context.Context { - return Export(ctx, MakeEvent([3]label.Label{ - keys.Metric.New(), - t1, - }, nil)) -} - -// Metric2 sends a label event to the exporter with the supplied labels. -func Metric2(ctx context.Context, t1, t2 label.Label) context.Context { - return Export(ctx, MakeEvent([3]label.Label{ - keys.Metric.New(), - t1, - t2, - }, nil)) -} - -// Start1 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start1(ctx context.Context, name string, t1 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent([3]label.Label{ - keys.Start.Of(name), - t1, - }, nil), - MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} - -// Start2 sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start2(ctx context.Context, name string, t1, t2 label.Label) (context.Context, func()) { - return ExportPair(ctx, - MakeEvent([3]label.Label{ - keys.Start.Of(name), - t1, - t2, - }, nil), - MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/doc.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/doc.go deleted file mode 100644 index 5dc6e6babedd..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package event provides a set of packages that cover the main -// concepts of telemetry in an implementation agnostic way. -package event diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/event.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/event.go deleted file mode 100644 index 4d55e577d1a8..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/event.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package event - -import ( - "context" - - "golang.org/x/tools/internal/event/core" - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" -) - -// Exporter is a function that handles events. -// It may return a modified context and event. -type Exporter func(context.Context, core.Event, label.Map) context.Context - -// SetExporter sets the global exporter function that handles all events. -// The exporter is called synchronously from the event call site, so it should -// return quickly so as not to hold up user code. -func SetExporter(e Exporter) { - core.SetExporter(core.Exporter(e)) -} - -// Log takes a message and a label list and combines them into a single event -// before delivering them to the exporter. -func Log(ctx context.Context, message string, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Msg.Of(message), - }, labels)) -} - -// IsLog returns true if the event was built by the Log function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsLog(ev core.Event) bool { - return ev.Label(0).Key() == keys.Msg -} - -// Error takes a message and a label list and combines them into a single event -// before delivering them to the exporter. It captures the error in the -// delivered event. -func Error(ctx context.Context, message string, err error, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Msg.Of(message), - keys.Err.Of(err), - }, labels)) -} - -// IsError returns true if the event was built by the Error function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsError(ev core.Event) bool { - return ev.Label(0).Key() == keys.Msg && - ev.Label(1).Key() == keys.Err -} - -// Metric sends a label event to the exporter with the supplied labels. -func Metric(ctx context.Context, labels ...label.Label) { - core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Metric.New(), - }, labels)) -} - -// IsMetric returns true if the event was built by the Metric function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsMetric(ev core.Event) bool { - return ev.Label(0).Key() == keys.Metric -} - -// Label sends a label event to the exporter with the supplied labels. -func Label(ctx context.Context, labels ...label.Label) context.Context { - return core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Label.New(), - }, labels)) -} - -// IsLabel returns true if the event was built by the Label function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsLabel(ev core.Event) bool { - return ev.Label(0).Key() == keys.Label -} - -// Start sends a span start event with the supplied label list to the exporter. -// It also returns a function that will end the span, which should normally be -// deferred. -func Start(ctx context.Context, name string, labels ...label.Label) (context.Context, func()) { - return core.ExportPair(ctx, - core.MakeEvent([3]label.Label{ - keys.Start.Of(name), - }, labels), - core.MakeEvent([3]label.Label{ - keys.End.New(), - }, nil)) -} - -// IsStart returns true if the event was built by the Start function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsStart(ev core.Event) bool { - return ev.Label(0).Key() == keys.Start -} - -// IsEnd returns true if the event was built by the End function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsEnd(ev core.Event) bool { - return ev.Label(0).Key() == keys.End -} - -// Detach returns a context without an associated span. -// This allows the creation of spans that are not children of the current span. -func Detach(ctx context.Context) context.Context { - return core.Export(ctx, core.MakeEvent([3]label.Label{ - keys.Detach.New(), - }, nil)) -} - -// IsDetach returns true if the event was built by the Detach function. -// It is intended to be used in exporters to identify the semantics of the -// event when deciding what to do with it. -func IsDetach(ev core.Event) bool { - return ev.Label(0).Key() == keys.Detach -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/keys/keys.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/keys/keys.go deleted file mode 100644 index a02206e30150..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/keys/keys.go +++ /dev/null @@ -1,564 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -import ( - "fmt" - "io" - "math" - "strconv" - - "golang.org/x/tools/internal/event/label" -) - -// Value represents a key for untyped values. -type Value struct { - name string - description string -} - -// New creates a new Key for untyped values. -func New(name, description string) *Value { - return &Value{name: name, description: description} -} - -func (k *Value) Name() string { return k.name } -func (k *Value) Description() string { return k.description } - -func (k *Value) Format(w io.Writer, buf []byte, l label.Label) { - fmt.Fprint(w, k.From(l)) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Value) Get(lm label.Map) interface{} { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From can be used to get a value from a Label. -func (k *Value) From(t label.Label) interface{} { return t.UnpackValue() } - -// Of creates a new Label with this key and the supplied value. -func (k *Value) Of(value interface{}) label.Label { return label.OfValue(k, value) } - -// Tag represents a key for tagging labels that have no value. -// These are used when the existence of the label is the entire information it -// carries, such as marking events to be of a specific kind, or from a specific -// package. -type Tag struct { - name string - description string -} - -// NewTag creates a new Key for tagging labels. -func NewTag(name, description string) *Tag { - return &Tag{name: name, description: description} -} - -func (k *Tag) Name() string { return k.name } -func (k *Tag) Description() string { return k.description } - -func (k *Tag) Format(w io.Writer, buf []byte, l label.Label) {} - -// New creates a new Label with this key. -func (k *Tag) New() label.Label { return label.OfValue(k, nil) } - -// Int represents a key -type Int struct { - name string - description string -} - -// NewInt creates a new Key for int values. -func NewInt(name, description string) *Int { - return &Int{name: name, description: description} -} - -func (k *Int) Name() string { return k.name } -func (k *Int) Description() string { return k.description } - -func (k *Int) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int) Of(v int) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int) Get(lm label.Map) int { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int) From(t label.Label) int { return int(t.Unpack64()) } - -// Int8 represents a key -type Int8 struct { - name string - description string -} - -// NewInt8 creates a new Key for int8 values. -func NewInt8(name, description string) *Int8 { - return &Int8{name: name, description: description} -} - -func (k *Int8) Name() string { return k.name } -func (k *Int8) Description() string { return k.description } - -func (k *Int8) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int8) Of(v int8) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int8) Get(lm label.Map) int8 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int8) From(t label.Label) int8 { return int8(t.Unpack64()) } - -// Int16 represents a key -type Int16 struct { - name string - description string -} - -// NewInt16 creates a new Key for int16 values. -func NewInt16(name, description string) *Int16 { - return &Int16{name: name, description: description} -} - -func (k *Int16) Name() string { return k.name } -func (k *Int16) Description() string { return k.description } - -func (k *Int16) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int16) Of(v int16) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int16) Get(lm label.Map) int16 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int16) From(t label.Label) int16 { return int16(t.Unpack64()) } - -// Int32 represents a key -type Int32 struct { - name string - description string -} - -// NewInt32 creates a new Key for int32 values. -func NewInt32(name, description string) *Int32 { - return &Int32{name: name, description: description} -} - -func (k *Int32) Name() string { return k.name } -func (k *Int32) Description() string { return k.description } - -func (k *Int32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, int64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int32) Of(v int32) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int32) Get(lm label.Map) int32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int32) From(t label.Label) int32 { return int32(t.Unpack64()) } - -// Int64 represents a key -type Int64 struct { - name string - description string -} - -// NewInt64 creates a new Key for int64 values. -func NewInt64(name, description string) *Int64 { - return &Int64{name: name, description: description} -} - -func (k *Int64) Name() string { return k.name } -func (k *Int64) Description() string { return k.description } - -func (k *Int64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendInt(buf, k.From(l), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Int64) Of(v int64) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Int64) Get(lm label.Map) int64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Int64) From(t label.Label) int64 { return int64(t.Unpack64()) } - -// UInt represents a key -type UInt struct { - name string - description string -} - -// NewUInt creates a new Key for uint values. -func NewUInt(name, description string) *UInt { - return &UInt{name: name, description: description} -} - -func (k *UInt) Name() string { return k.name } -func (k *UInt) Description() string { return k.description } - -func (k *UInt) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt) Of(v uint) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt) Get(lm label.Map) uint { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt) From(t label.Label) uint { return uint(t.Unpack64()) } - -// UInt8 represents a key -type UInt8 struct { - name string - description string -} - -// NewUInt8 creates a new Key for uint8 values. -func NewUInt8(name, description string) *UInt8 { - return &UInt8{name: name, description: description} -} - -func (k *UInt8) Name() string { return k.name } -func (k *UInt8) Description() string { return k.description } - -func (k *UInt8) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt8) Of(v uint8) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt8) Get(lm label.Map) uint8 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt8) From(t label.Label) uint8 { return uint8(t.Unpack64()) } - -// UInt16 represents a key -type UInt16 struct { - name string - description string -} - -// NewUInt16 creates a new Key for uint16 values. -func NewUInt16(name, description string) *UInt16 { - return &UInt16{name: name, description: description} -} - -func (k *UInt16) Name() string { return k.name } -func (k *UInt16) Description() string { return k.description } - -func (k *UInt16) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt16) Of(v uint16) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt16) Get(lm label.Map) uint16 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt16) From(t label.Label) uint16 { return uint16(t.Unpack64()) } - -// UInt32 represents a key -type UInt32 struct { - name string - description string -} - -// NewUInt32 creates a new Key for uint32 values. -func NewUInt32(name, description string) *UInt32 { - return &UInt32{name: name, description: description} -} - -func (k *UInt32) Name() string { return k.name } -func (k *UInt32) Description() string { return k.description } - -func (k *UInt32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, uint64(k.From(l)), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt32) Of(v uint32) label.Label { return label.Of64(k, uint64(v)) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt32) Get(lm label.Map) uint32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt32) From(t label.Label) uint32 { return uint32(t.Unpack64()) } - -// UInt64 represents a key -type UInt64 struct { - name string - description string -} - -// NewUInt64 creates a new Key for uint64 values. -func NewUInt64(name, description string) *UInt64 { - return &UInt64{name: name, description: description} -} - -func (k *UInt64) Name() string { return k.name } -func (k *UInt64) Description() string { return k.description } - -func (k *UInt64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendUint(buf, k.From(l), 10)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *UInt64) Of(v uint64) label.Label { return label.Of64(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *UInt64) Get(lm label.Map) uint64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *UInt64) From(t label.Label) uint64 { return t.Unpack64() } - -// Float32 represents a key -type Float32 struct { - name string - description string -} - -// NewFloat32 creates a new Key for float32 values. -func NewFloat32(name, description string) *Float32 { - return &Float32{name: name, description: description} -} - -func (k *Float32) Name() string { return k.name } -func (k *Float32) Description() string { return k.description } - -func (k *Float32) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendFloat(buf, float64(k.From(l)), 'E', -1, 32)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Float32) Of(v float32) label.Label { - return label.Of64(k, uint64(math.Float32bits(v))) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Float32) Get(lm label.Map) float32 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Float32) From(t label.Label) float32 { - return math.Float32frombits(uint32(t.Unpack64())) -} - -// Float64 represents a key -type Float64 struct { - name string - description string -} - -// NewFloat64 creates a new Key for int64 values. -func NewFloat64(name, description string) *Float64 { - return &Float64{name: name, description: description} -} - -func (k *Float64) Name() string { return k.name } -func (k *Float64) Description() string { return k.description } - -func (k *Float64) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendFloat(buf, k.From(l), 'E', -1, 64)) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Float64) Of(v float64) label.Label { - return label.Of64(k, math.Float64bits(v)) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Float64) Get(lm label.Map) float64 { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return 0 -} - -// From can be used to get a value from a Label. -func (k *Float64) From(t label.Label) float64 { - return math.Float64frombits(t.Unpack64()) -} - -// String represents a key -type String struct { - name string - description string -} - -// NewString creates a new Key for int64 values. -func NewString(name, description string) *String { - return &String{name: name, description: description} -} - -func (k *String) Name() string { return k.name } -func (k *String) Description() string { return k.description } - -func (k *String) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendQuote(buf, k.From(l))) -} - -// Of creates a new Label with this key and the supplied value. -func (k *String) Of(v string) label.Label { return label.OfString(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *String) Get(lm label.Map) string { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return "" -} - -// From can be used to get a value from a Label. -func (k *String) From(t label.Label) string { return t.UnpackString() } - -// Boolean represents a key -type Boolean struct { - name string - description string -} - -// NewBoolean creates a new Key for bool values. -func NewBoolean(name, description string) *Boolean { - return &Boolean{name: name, description: description} -} - -func (k *Boolean) Name() string { return k.name } -func (k *Boolean) Description() string { return k.description } - -func (k *Boolean) Format(w io.Writer, buf []byte, l label.Label) { - w.Write(strconv.AppendBool(buf, k.From(l))) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Boolean) Of(v bool) label.Label { - if v { - return label.Of64(k, 1) - } - return label.Of64(k, 0) -} - -// Get can be used to get a label for the key from a label.Map. -func (k *Boolean) Get(lm label.Map) bool { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return false -} - -// From can be used to get a value from a Label. -func (k *Boolean) From(t label.Label) bool { return t.Unpack64() > 0 } - -// Error represents a key -type Error struct { - name string - description string -} - -// NewError creates a new Key for int64 values. -func NewError(name, description string) *Error { - return &Error{name: name, description: description} -} - -func (k *Error) Name() string { return k.name } -func (k *Error) Description() string { return k.description } - -func (k *Error) Format(w io.Writer, buf []byte, l label.Label) { - io.WriteString(w, k.From(l).Error()) -} - -// Of creates a new Label with this key and the supplied value. -func (k *Error) Of(v error) label.Label { return label.OfValue(k, v) } - -// Get can be used to get a label for the key from a label.Map. -func (k *Error) Get(lm label.Map) error { - if t := lm.Find(k); t.Valid() { - return k.From(t) - } - return nil -} - -// From can be used to get a value from a Label. -func (k *Error) From(t label.Label) error { - err, _ := t.UnpackValue().(error) - return err -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/keys/standard.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/keys/standard.go deleted file mode 100644 index 7e9586659213..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/keys/standard.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package keys - -var ( - // Msg is a key used to add message strings to label lists. - Msg = NewString("message", "a readable message") - // Label is a key used to indicate an event adds labels to the context. - Label = NewTag("label", "a label context marker") - // Start is used for things like traces that have a name. - Start = NewString("start", "span start") - // Metric is a key used to indicate an event records metrics. - End = NewTag("end", "a span end marker") - // Metric is a key used to indicate an event records metrics. - Detach = NewTag("detach", "a span detach marker") - // Err is a key used to add error values to label lists. - Err = NewError("error", "an error that occurred") - // Metric is a key used to indicate an event records metrics. - Metric = NewTag("metric", "a metric event marker") -) diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/label/label.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/label/label.go deleted file mode 100644 index 0f526e1f9ab4..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/label/label.go +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package label - -import ( - "fmt" - "io" - "reflect" - "unsafe" -) - -// Key is used as the identity of a Label. -// Keys are intended to be compared by pointer only, the name should be unique -// for communicating with external systems, but it is not required or enforced. -type Key interface { - // Name returns the key name. - Name() string - // Description returns a string that can be used to describe the value. - Description() string - - // Format is used in formatting to append the value of the label to the - // supplied buffer. - // The formatter may use the supplied buf as a scratch area to avoid - // allocations. - Format(w io.Writer, buf []byte, l Label) -} - -// Label holds a key and value pair. -// It is normally used when passing around lists of labels. -type Label struct { - key Key - packed uint64 - untyped interface{} -} - -// Map is the interface to a collection of Labels indexed by key. -type Map interface { - // Find returns the label that matches the supplied key. - Find(key Key) Label -} - -// List is the interface to something that provides an iterable -// list of labels. -// Iteration should start from 0 and continue until Valid returns false. -type List interface { - // Valid returns true if the index is within range for the list. - // It does not imply the label at that index will itself be valid. - Valid(index int) bool - // Label returns the label at the given index. - Label(index int) Label -} - -// list implements LabelList for a list of Labels. -type list struct { - labels []Label -} - -// filter wraps a LabelList filtering out specific labels. -type filter struct { - keys []Key - underlying List -} - -// listMap implements LabelMap for a simple list of labels. -type listMap struct { - labels []Label -} - -// mapChain implements LabelMap for a list of underlying LabelMap. -type mapChain struct { - maps []Map -} - -// OfValue creates a new label from the key and value. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfValue(k Key, value interface{}) Label { return Label{key: k, untyped: value} } - -// UnpackValue assumes the label was built using LabelOfValue and returns the value -// that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackValue() interface{} { return t.untyped } - -// Of64 creates a new label from a key and a uint64. This is often -// used for non uint64 values that can be packed into a uint64. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func Of64(k Key, v uint64) Label { return Label{key: k, packed: v} } - -// Unpack64 assumes the label was built using LabelOf64 and returns the value that -// was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) Unpack64() uint64 { return t.packed } - -type stringptr unsafe.Pointer - -// OfString creates a new label from a key and a string. -// This method is for implementing new key types, label creation should -// normally be done with the Of method of the key. -func OfString(k Key, v string) Label { - hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) - return Label{ - key: k, - packed: uint64(hdr.Len), - untyped: stringptr(hdr.Data), - } -} - -// UnpackString assumes the label was built using LabelOfString and returns the -// value that was passed to that constructor. -// This method is for implementing new key types, for type safety normal -// access should be done with the From method of the key. -func (t Label) UnpackString() string { - var v string - hdr := (*reflect.StringHeader)(unsafe.Pointer(&v)) - hdr.Data = uintptr(t.untyped.(stringptr)) - hdr.Len = int(t.packed) - return v -} - -// Valid returns true if the Label is a valid one (it has a key). -func (t Label) Valid() bool { return t.key != nil } - -// Key returns the key of this Label. -func (t Label) Key() Key { return t.key } - -// Format is used for debug printing of labels. -func (t Label) Format(f fmt.State, r rune) { - if !t.Valid() { - io.WriteString(f, `nil`) - return - } - io.WriteString(f, t.Key().Name()) - io.WriteString(f, "=") - var buf [128]byte - t.Key().Format(f, buf[:0], t) -} - -func (l *list) Valid(index int) bool { - return index >= 0 && index < len(l.labels) -} - -func (l *list) Label(index int) Label { - return l.labels[index] -} - -func (f *filter) Valid(index int) bool { - return f.underlying.Valid(index) -} - -func (f *filter) Label(index int) Label { - l := f.underlying.Label(index) - for _, f := range f.keys { - if l.Key() == f { - return Label{} - } - } - return l -} - -func (lm listMap) Find(key Key) Label { - for _, l := range lm.labels { - if l.Key() == key { - return l - } - } - return Label{} -} - -func (c mapChain) Find(key Key) Label { - for _, src := range c.maps { - l := src.Find(key) - if l.Valid() { - return l - } - } - return Label{} -} - -var emptyList = &list{} - -func NewList(labels ...Label) List { - if len(labels) == 0 { - return emptyList - } - return &list{labels: labels} -} - -func Filter(l List, keys ...Key) List { - if len(keys) == 0 { - return l - } - return &filter{keys: keys, underlying: l} -} - -func NewMap(labels ...Label) Map { - return listMap{labels: labels} -} - -func MergeMaps(srcs ...Map) Map { - var nonNil []Map - for _, src := range srcs { - if src != nil { - nonNil = append(nonNil, src) - } - } - if len(nonNil) == 1 { - return nonNil[0] - } - return mapChain{maps: nonNil} -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/tag/tag.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/tag/tag.go deleted file mode 100644 index 581b26c2041f..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/event/tag/tag.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package tag provides the labels used for telemetry throughout gopls. -package tag - -import ( - "golang.org/x/tools/internal/event/keys" -) - -var ( - // create the label keys we use - Method = keys.NewString("method", "") - StatusCode = keys.NewString("status.code", "") - StatusMessage = keys.NewString("status.message", "") - RPCID = keys.NewString("id", "") - RPCDirection = keys.NewString("direction", "") - File = keys.NewString("file", "") - Directory = keys.New("directory", "") - URI = keys.New("URI", "") - Package = keys.NewString("package", "") // sorted comma-separated list of Package IDs - PackagePath = keys.NewString("package_path", "") - Query = keys.New("query", "") - Snapshot = keys.NewUInt64("snapshot", "") - Operation = keys.NewString("operation", "") - - Position = keys.New("position", "") - Category = keys.NewString("category", "") - PackageCount = keys.NewInt("packages", "") - Files = keys.New("files", "") - Port = keys.NewInt("port", "") - Type = keys.New("type", "") - HoverKind = keys.NewString("hoverkind", "") - - NewServer = keys.NewString("new_server", "A new server was added") - EndServer = keys.NewString("end_server", "A server was shut down") - - ServerID = keys.NewString("server", "The server ID an event is related to") - Logfile = keys.NewString("logfile", "") - DebugAddress = keys.NewString("debug_address", "") - GoplsPath = keys.NewString("gopls_path", "") - ClientID = keys.NewString("client_id", "") - - Level = keys.NewInt("level", "The logging level") -) - -var ( - // create the stats we measure - Started = keys.NewInt64("started", "Count of started RPCs.") - ReceivedBytes = keys.NewInt64("received_bytes", "Bytes received.") //, unit.Bytes) - SentBytes = keys.NewInt64("sent_bytes", "Bytes sent.") //, unit.Bytes) - Latency = keys.NewFloat64("latency_ms", "Elapsed time in milliseconds") //, unit.Milliseconds) -) - -const ( - Inbound = "in" - Outbound = "out" -) diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go deleted file mode 100644 index c40c7e931066..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package fastwalk provides a faster version of [filepath.Walk] for file system -// scanning tools. -package fastwalk - -import ( - "errors" - "os" - "path/filepath" - "runtime" - "sync" -) - -// ErrTraverseLink is used as a return value from WalkFuncs to indicate that the -// symlink named in the call may be traversed. -var ErrTraverseLink = errors.New("fastwalk: traverse symlink, assuming target is a directory") - -// ErrSkipFiles is a used as a return value from WalkFuncs to indicate that the -// callback should not be called for any other files in the current directory. -// Child directories will still be traversed. -var ErrSkipFiles = errors.New("fastwalk: skip remaining files in directory") - -// Walk is a faster implementation of [filepath.Walk]. -// -// [filepath.Walk]'s design necessarily calls [os.Lstat] on each file, -// even if the caller needs less info. -// Many tools need only the type of each file. -// On some platforms, this information is provided directly by the readdir -// system call, avoiding the need to stat each file individually. -// fastwalk_unix.go contains a fork of the syscall routines. -// -// See golang.org/issue/16399. -// -// Walk walks the file tree rooted at root, calling walkFn for -// each file or directory in the tree, including root. -// -// If Walk returns [filepath.SkipDir], the directory is skipped. -// -// Unlike [filepath.Walk]: -// - file stat calls must be done by the user. -// The only provided metadata is the file type, which does not include -// any permission bits. -// - multiple goroutines stat the filesystem concurrently. The provided -// walkFn must be safe for concurrent use. -// - Walk can follow symlinks if walkFn returns the TraverseLink -// sentinel error. It is the walkFn's responsibility to prevent -// Walk from going into symlink cycles. -func Walk(root string, walkFn func(path string, typ os.FileMode) error) error { - // TODO(bradfitz): make numWorkers configurable? We used a - // minimum of 4 to give the kernel more info about multiple - // things we want, in hopes its I/O scheduling can take - // advantage of that. Hopefully most are in cache. Maybe 4 is - // even too low of a minimum. Profile more. - numWorkers := 4 - if n := runtime.NumCPU(); n > numWorkers { - numWorkers = n - } - - // Make sure to wait for all workers to finish, otherwise - // walkFn could still be called after returning. This Wait call - // runs after close(e.donec) below. - var wg sync.WaitGroup - defer wg.Wait() - - w := &walker{ - fn: walkFn, - enqueuec: make(chan walkItem, numWorkers), // buffered for performance - workc: make(chan walkItem, numWorkers), // buffered for performance - donec: make(chan struct{}), - - // buffered for correctness & not leaking goroutines: - resc: make(chan error, numWorkers), - } - defer close(w.donec) - - for i := 0; i < numWorkers; i++ { - wg.Add(1) - go w.doWork(&wg) - } - todo := []walkItem{{dir: root}} - out := 0 - for { - workc := w.workc - var workItem walkItem - if len(todo) == 0 { - workc = nil - } else { - workItem = todo[len(todo)-1] - } - select { - case workc <- workItem: - todo = todo[:len(todo)-1] - out++ - case it := <-w.enqueuec: - todo = append(todo, it) - case err := <-w.resc: - out-- - if err != nil { - return err - } - if out == 0 && len(todo) == 0 { - // It's safe to quit here, as long as the buffered - // enqueue channel isn't also readable, which might - // happen if the worker sends both another unit of - // work and its result before the other select was - // scheduled and both w.resc and w.enqueuec were - // readable. - select { - case it := <-w.enqueuec: - todo = append(todo, it) - default: - return nil - } - } - } - } -} - -// doWork reads directories as instructed (via workc) and runs the -// user's callback function. -func (w *walker) doWork(wg *sync.WaitGroup) { - defer wg.Done() - for { - select { - case <-w.donec: - return - case it := <-w.workc: - select { - case <-w.donec: - return - case w.resc <- w.walk(it.dir, !it.callbackDone): - } - } - } -} - -type walker struct { - fn func(path string, typ os.FileMode) error - - donec chan struct{} // closed on fastWalk's return - workc chan walkItem // to workers - enqueuec chan walkItem // from workers - resc chan error // from workers -} - -type walkItem struct { - dir string - callbackDone bool // callback already called; don't do it again -} - -func (w *walker) enqueue(it walkItem) { - select { - case w.enqueuec <- it: - case <-w.donec: - } -} - -func (w *walker) onDirEnt(dirName, baseName string, typ os.FileMode) error { - joined := dirName + string(os.PathSeparator) + baseName - if typ == os.ModeDir { - w.enqueue(walkItem{dir: joined}) - return nil - } - - err := w.fn(joined, typ) - if typ == os.ModeSymlink { - if err == ErrTraverseLink { - // Set callbackDone so we don't call it twice for both the - // symlink-as-symlink and the symlink-as-directory later: - w.enqueue(walkItem{dir: joined, callbackDone: true}) - return nil - } - if err == filepath.SkipDir { - // Permit SkipDir on symlinks too. - return nil - } - } - return err -} - -func (w *walker) walk(root string, runUserCallback bool) error { - if runUserCallback { - err := w.fn(root, os.ModeDir) - if err == filepath.SkipDir { - return nil - } - if err != nil { - return err - } - } - - return readDir(root, w.onDirEnt) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go deleted file mode 100644 index 0ca55e0d56f2..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build darwin && cgo -// +build darwin,cgo - -package fastwalk - -/* -#include - -// fastwalk_readdir_r wraps readdir_r so that we don't have to pass a dirent** -// result pointer which triggers CGO's "Go pointer to Go pointer" check unless -// we allocat the result dirent* with malloc. -// -// fastwalk_readdir_r returns 0 on success, -1 upon reaching the end of the -// directory, or a positive error number to indicate failure. -static int fastwalk_readdir_r(DIR *fd, struct dirent *entry) { - struct dirent *result; - int ret = readdir_r(fd, entry, &result); - if (ret == 0 && result == NULL) { - ret = -1; // EOF - } - return ret; -} -*/ -import "C" - -import ( - "os" - "syscall" - "unsafe" -) - -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fd, err := openDir(dirName) - if err != nil { - return &os.PathError{Op: "opendir", Path: dirName, Err: err} - } - defer C.closedir(fd) - - skipFiles := false - var dirent syscall.Dirent - for { - ret := int(C.fastwalk_readdir_r(fd, (*C.struct_dirent)(unsafe.Pointer(&dirent)))) - if ret != 0 { - if ret == -1 { - break // EOF - } - if ret == int(syscall.EINTR) { - continue - } - return &os.PathError{Op: "readdir", Path: dirName, Err: syscall.Errno(ret)} - } - if dirent.Ino == 0 { - continue - } - typ := dtToType(dirent.Type) - if skipFiles && typ.IsRegular() { - continue - } - name := (*[len(syscall.Dirent{}.Name)]byte)(unsafe.Pointer(&dirent.Name))[:] - name = name[:dirent.Namlen] - for i, c := range name { - if c == 0 { - name = name[:i] - break - } - } - // Check for useless names before allocating a string. - if string(name) == "." || string(name) == ".." { - continue - } - if err := fn(dirName, string(name), typ); err != nil { - if err != ErrSkipFiles { - return err - } - skipFiles = true - } - } - - return nil -} - -func dtToType(typ uint8) os.FileMode { - switch typ { - case syscall.DT_BLK: - return os.ModeDevice - case syscall.DT_CHR: - return os.ModeDevice | os.ModeCharDevice - case syscall.DT_DIR: - return os.ModeDir - case syscall.DT_FIFO: - return os.ModeNamedPipe - case syscall.DT_LNK: - return os.ModeSymlink - case syscall.DT_REG: - return 0 - case syscall.DT_SOCK: - return os.ModeSocket - } - return ^os.FileMode(0) -} - -// openDir wraps opendir(3) and handles any EINTR errors. The returned *DIR -// needs to be closed with closedir(3). -func openDir(path string) (*C.DIR, error) { - name, err := syscall.BytePtrFromString(path) - if err != nil { - return nil, err - } - for { - fd, err := C.opendir((*C.char)(unsafe.Pointer(name))) - if err != syscall.EINTR { - return fd, err - } - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go deleted file mode 100644 index d58595dbd3f6..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_fileno.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build freebsd || openbsd || netbsd -// +build freebsd openbsd netbsd - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Fileno) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go deleted file mode 100644 index d3922890b0b1..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_ino.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (linux || (darwin && !cgo)) && !appengine -// +build linux darwin,!cgo -// +build !appengine - -package fastwalk - -import "syscall" - -func direntInode(dirent *syscall.Dirent) uint64 { - return dirent.Ino -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go deleted file mode 100644 index 38a4db6af3ae..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_bsd.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (darwin && !cgo) || freebsd || openbsd || netbsd -// +build darwin,!cgo freebsd openbsd netbsd - -package fastwalk - -import "syscall" - -func direntNamlen(dirent *syscall.Dirent) uint64 { - return uint64(dirent.Namlen) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go deleted file mode 100644 index c82e57df85ef..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_dirent_namlen_linux.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build linux && !appengine -// +build linux,!appengine - -package fastwalk - -import ( - "bytes" - "syscall" - "unsafe" -) - -func direntNamlen(dirent *syscall.Dirent) uint64 { - const fixedHdr = uint16(unsafe.Offsetof(syscall.Dirent{}.Name)) - nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) - const nameBufLen = uint16(len(nameBuf)) - limit := dirent.Reclen - fixedHdr - if limit > nameBufLen { - limit = nameBufLen - } - nameLen := bytes.IndexByte(nameBuf[:limit], 0) - if nameLen < 0 { - panic("failed to find terminating 0 byte in dirent") - } - return uint64(nameLen) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go deleted file mode 100644 index 085d311600be..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_portable.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build appengine || (!linux && !darwin && !freebsd && !openbsd && !netbsd) -// +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd - -package fastwalk - -import ( - "io/ioutil" - "os" -) - -// readDir calls fn for each directory entry in dirName. -// It does not descend into directories or follow symlinks. -// If fn returns a non-nil error, readDir returns with that error -// immediately. -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fis, err := ioutil.ReadDir(dirName) - if err != nil { - return err - } - skipFiles := false - for _, fi := range fis { - if fi.Mode().IsRegular() && skipFiles { - continue - } - if err := fn(dirName, fi.Name(), fi.Mode()&os.ModeType); err != nil { - if err == ErrSkipFiles { - skipFiles = true - continue - } - return err - } - } - return nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go deleted file mode 100644 index f12f1a734cc9..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (linux || freebsd || openbsd || netbsd || (darwin && !cgo)) && !appengine -// +build linux freebsd openbsd netbsd darwin,!cgo -// +build !appengine - -package fastwalk - -import ( - "fmt" - "os" - "syscall" - "unsafe" -) - -const blockSize = 8 << 10 - -// unknownFileMode is a sentinel (and bogus) os.FileMode -// value used to represent a syscall.DT_UNKNOWN Dirent.Type. -const unknownFileMode os.FileMode = os.ModeNamedPipe | os.ModeSocket | os.ModeDevice - -func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) error) error { - fd, err := open(dirName, 0, 0) - if err != nil { - return &os.PathError{Op: "open", Path: dirName, Err: err} - } - defer syscall.Close(fd) - - // The buffer must be at least a block long. - buf := make([]byte, blockSize) // stack-allocated; doesn't escape - bufp := 0 // starting read position in buf - nbuf := 0 // end valid data in buf - skipFiles := false - for { - if bufp >= nbuf { - bufp = 0 - nbuf, err = readDirent(fd, buf) - if err != nil { - return os.NewSyscallError("readdirent", err) - } - if nbuf <= 0 { - return nil - } - } - consumed, name, typ := parseDirEnt(buf[bufp:nbuf]) - bufp += consumed - if name == "" || name == "." || name == ".." { - continue - } - // Fallback for filesystems (like old XFS) that don't - // support Dirent.Type and have DT_UNKNOWN (0) there - // instead. - if typ == unknownFileMode { - fi, err := os.Lstat(dirName + "/" + name) - if err != nil { - // It got deleted in the meantime. - if os.IsNotExist(err) { - continue - } - return err - } - typ = fi.Mode() & os.ModeType - } - if skipFiles && typ.IsRegular() { - continue - } - if err := fn(dirName, name, typ); err != nil { - if err == ErrSkipFiles { - skipFiles = true - continue - } - return err - } - } -} - -func parseDirEnt(buf []byte) (consumed int, name string, typ os.FileMode) { - // golang.org/issue/37269 - dirent := &syscall.Dirent{} - copy((*[unsafe.Sizeof(syscall.Dirent{})]byte)(unsafe.Pointer(dirent))[:], buf) - if v := unsafe.Offsetof(dirent.Reclen) + unsafe.Sizeof(dirent.Reclen); uintptr(len(buf)) < v { - panic(fmt.Sprintf("buf size of %d smaller than dirent header size %d", len(buf), v)) - } - if len(buf) < int(dirent.Reclen) { - panic(fmt.Sprintf("buf size %d < record length %d", len(buf), dirent.Reclen)) - } - consumed = int(dirent.Reclen) - if direntInode(dirent) == 0 { // File absent in directory. - return - } - switch dirent.Type { - case syscall.DT_REG: - typ = 0 - case syscall.DT_DIR: - typ = os.ModeDir - case syscall.DT_LNK: - typ = os.ModeSymlink - case syscall.DT_BLK: - typ = os.ModeDevice - case syscall.DT_FIFO: - typ = os.ModeNamedPipe - case syscall.DT_SOCK: - typ = os.ModeSocket - case syscall.DT_UNKNOWN: - typ = unknownFileMode - default: - // Skip weird things. - // It's probably a DT_WHT (http://lwn.net/Articles/325369/) - // or something. Revisit if/when this package is moved outside - // of goimports. goimports only cares about regular files, - // symlinks, and directories. - return - } - - nameBuf := (*[unsafe.Sizeof(dirent.Name)]byte)(unsafe.Pointer(&dirent.Name[0])) - nameLen := direntNamlen(dirent) - - // Special cases for common things: - if nameLen == 1 && nameBuf[0] == '.' { - name = "." - } else if nameLen == 2 && nameBuf[0] == '.' && nameBuf[1] == '.' { - name = ".." - } else { - name = string(nameBuf[:nameLen]) - } - return -} - -// According to https://golang.org/doc/go1.14#runtime -// A consequence of the implementation of preemption is that on Unix systems, including Linux and macOS -// systems, programs built with Go 1.14 will receive more signals than programs built with earlier releases. -// -// This causes syscall.Open and syscall.ReadDirent sometimes fail with EINTR errors. -// We need to retry in this case. -func open(path string, mode int, perm uint32) (fd int, err error) { - for { - fd, err := syscall.Open(path, mode, perm) - if err != syscall.EINTR { - return fd, err - } - } -} - -func readDirent(fd int, buf []byte) (n int, err error) { - for { - nbuf, err := syscall.ReadDirent(fd, buf) - if err != syscall.EINTR { - return nbuf, err - } - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/bimport.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/bimport.go deleted file mode 100644 index d98b0db2a9a9..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/bimport.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains the remaining vestiges of -// $GOROOT/src/go/internal/gcimporter/bimport.go. - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" - "sync" -) - -func errorf(format string, args ...interface{}) { - panic(fmt.Sprintf(format, args...)) -} - -const deltaNewFile = -64 // see cmd/compile/internal/gc/bexport.go - -// Synthesize a token.Pos -type fakeFileSet struct { - fset *token.FileSet - files map[string]*fileInfo -} - -type fileInfo struct { - file *token.File - lastline int -} - -const maxlines = 64 * 1024 - -func (s *fakeFileSet) pos(file string, line, column int) token.Pos { - // TODO(mdempsky): Make use of column. - - // Since we don't know the set of needed file positions, we reserve maxlines - // positions per file. We delay calling token.File.SetLines until all - // positions have been calculated (by way of fakeFileSet.setLines), so that - // we can avoid setting unnecessary lines. See also golang/go#46586. - f := s.files[file] - if f == nil { - f = &fileInfo{file: s.fset.AddFile(file, -1, maxlines)} - s.files[file] = f - } - if line > maxlines { - line = 1 - } - if line > f.lastline { - f.lastline = line - } - - // Return a fake position assuming that f.file consists only of newlines. - return token.Pos(f.file.Base() + line - 1) -} - -func (s *fakeFileSet) setLines() { - fakeLinesOnce.Do(func() { - fakeLines = make([]int, maxlines) - for i := range fakeLines { - fakeLines[i] = i - } - }) - for _, f := range s.files { - f.file.SetLines(fakeLines[:f.lastline]) - } -} - -var ( - fakeLines []int - fakeLinesOnce sync.Once -) - -func chanDir(d int) types.ChanDir { - // tag values must match the constants in cmd/compile/internal/gc/go.go - switch d { - case 1 /* Crecv */ : - return types.RecvOnly - case 2 /* Csend */ : - return types.SendOnly - case 3 /* Cboth */ : - return types.SendRecv - default: - errorf("unexpected channel dir %d", d) - return 0 - } -} - -var predeclOnce sync.Once -var predecl []types.Type // initialized lazily - -func predeclared() []types.Type { - predeclOnce.Do(func() { - // initialize lazily to be sure that all - // elements have been initialized before - predecl = []types.Type{ // basic types - types.Typ[types.Bool], - types.Typ[types.Int], - types.Typ[types.Int8], - types.Typ[types.Int16], - types.Typ[types.Int32], - types.Typ[types.Int64], - types.Typ[types.Uint], - types.Typ[types.Uint8], - types.Typ[types.Uint16], - types.Typ[types.Uint32], - types.Typ[types.Uint64], - types.Typ[types.Uintptr], - types.Typ[types.Float32], - types.Typ[types.Float64], - types.Typ[types.Complex64], - types.Typ[types.Complex128], - types.Typ[types.String], - - // basic type aliases - types.Universe.Lookup("byte").Type(), - types.Universe.Lookup("rune").Type(), - - // error - types.Universe.Lookup("error").Type(), - - // untyped types - types.Typ[types.UntypedBool], - types.Typ[types.UntypedInt], - types.Typ[types.UntypedRune], - types.Typ[types.UntypedFloat], - types.Typ[types.UntypedComplex], - types.Typ[types.UntypedString], - types.Typ[types.UntypedNil], - - // package unsafe - types.Typ[types.UnsafePointer], - - // invalid type - types.Typ[types.Invalid], // only appears in packages with errors - - // used internally by gc; never used by this package or in .a files - anyType{}, - } - predecl = append(predecl, additionalPredeclared()...) - }) - return predecl -} - -type anyType struct{} - -func (t anyType) Underlying() types.Type { return t } -func (t anyType) String() string { return "any" } diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go deleted file mode 100644 index f6437feb1cfd..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/exportdata.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a copy of $GOROOT/src/go/internal/gcimporter/exportdata.go. - -// This file implements FindExportData. - -package gcimporter - -import ( - "bufio" - "fmt" - "io" - "strconv" - "strings" -) - -func readGopackHeader(r *bufio.Reader) (name string, size int64, err error) { - // See $GOROOT/include/ar.h. - hdr := make([]byte, 16+12+6+6+8+10+2) - _, err = io.ReadFull(r, hdr) - if err != nil { - return - } - // leave for debugging - if false { - fmt.Printf("header: %s", hdr) - } - s := strings.TrimSpace(string(hdr[16+12+6+6+8:][:10])) - length, err := strconv.Atoi(s) - size = int64(length) - if err != nil || hdr[len(hdr)-2] != '`' || hdr[len(hdr)-1] != '\n' { - err = fmt.Errorf("invalid archive header") - return - } - name = strings.TrimSpace(string(hdr[:16])) - return -} - -// FindExportData positions the reader r at the beginning of the -// export data section of an underlying GC-created object/archive -// file by reading from it. The reader must be positioned at the -// start of the file before calling this function. The hdr result -// is the string before the export data, either "$$" or "$$B". -// The size result is the length of the export data in bytes, or -1 if not known. -func FindExportData(r *bufio.Reader) (hdr string, size int64, err error) { - // Read first line to make sure this is an object file. - line, err := r.ReadSlice('\n') - if err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - - if string(line) == "!\n" { - // Archive file. Scan to __.PKGDEF. - var name string - if name, size, err = readGopackHeader(r); err != nil { - return - } - - // First entry should be __.PKGDEF. - if name != "__.PKGDEF" { - err = fmt.Errorf("go archive is missing __.PKGDEF") - return - } - - // Read first line of __.PKGDEF data, so that line - // is once again the first line of the input. - if line, err = r.ReadSlice('\n'); err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - size -= int64(len(line)) - } - - // Now at __.PKGDEF in archive or still at beginning of file. - // Either way, line should begin with "go object ". - if !strings.HasPrefix(string(line), "go object ") { - err = fmt.Errorf("not a Go object file") - return - } - - // Skip over object header to export data. - // Begins after first line starting with $$. - for line[0] != '$' { - if line, err = r.ReadSlice('\n'); err != nil { - err = fmt.Errorf("can't find export data (%v)", err) - return - } - size -= int64(len(line)) - } - hdr = string(line) - if size < 0 { - size = -1 - } - - return -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go deleted file mode 100644 index b1223713b940..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file is a reduced copy of $GOROOT/src/go/internal/gcimporter/gcimporter.go. - -// Package gcimporter provides various functions for reading -// gc-generated object files that can be used to implement the -// Importer interface defined by the Go 1.5 standard library package. -// -// The encoding is deterministic: if the encoder is applied twice to -// the same types.Package data structure, both encodings are equal. -// This property may be important to avoid spurious changes in -// applications such as build systems. -// -// However, the encoder is not necessarily idempotent. Importing an -// exported package may yield a types.Package that, while it -// represents the same set of Go types as the original, may differ in -// the details of its internal representation. Because of these -// differences, re-encoding the imported package may yield a -// different, but equally valid, encoding of the package. -package gcimporter // import "golang.org/x/tools/internal/gcimporter" - -import ( - "bufio" - "bytes" - "fmt" - "go/build" - "go/token" - "go/types" - "io" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strings" - "sync" -) - -const ( - // Enable debug during development: it adds some additional checks, and - // prevents errors from being recovered. - debug = false - - // If trace is set, debugging output is printed to std out. - trace = false -) - -var exportMap sync.Map // package dir → func() (string, bool) - -// lookupGorootExport returns the location of the export data -// (normally found in the build cache, but located in GOROOT/pkg -// in prior Go releases) for the package located in pkgDir. -// -// (We use the package's directory instead of its import path -// mainly to simplify handling of the packages in src/vendor -// and cmd/vendor.) -func lookupGorootExport(pkgDir string) (string, bool) { - f, ok := exportMap.Load(pkgDir) - if !ok { - var ( - listOnce sync.Once - exportPath string - ) - f, _ = exportMap.LoadOrStore(pkgDir, func() (string, bool) { - listOnce.Do(func() { - cmd := exec.Command("go", "list", "-export", "-f", "{{.Export}}", pkgDir) - cmd.Dir = build.Default.GOROOT - var output []byte - output, err := cmd.Output() - if err != nil { - return - } - - exports := strings.Split(string(bytes.TrimSpace(output)), "\n") - if len(exports) != 1 { - return - } - - exportPath = exports[0] - }) - - return exportPath, exportPath != "" - }) - } - - return f.(func() (string, bool))() -} - -var pkgExts = [...]string{".a", ".o"} - -// FindPkg returns the filename and unique package id for an import -// path based on package information provided by build.Import (using -// the build.Default build.Context). A relative srcDir is interpreted -// relative to the current working directory. -// If no file was found, an empty filename is returned. -func FindPkg(path, srcDir string) (filename, id string) { - if path == "" { - return - } - - var noext string - switch { - default: - // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" - // Don't require the source files to be present. - if abs, err := filepath.Abs(srcDir); err == nil { // see issue 14282 - srcDir = abs - } - bp, _ := build.Import(path, srcDir, build.FindOnly|build.AllowBinary) - if bp.PkgObj == "" { - var ok bool - if bp.Goroot && bp.Dir != "" { - filename, ok = lookupGorootExport(bp.Dir) - } - if !ok { - id = path // make sure we have an id to print in error message - return - } - } else { - noext = strings.TrimSuffix(bp.PkgObj, ".a") - id = bp.ImportPath - } - - case build.IsLocalImport(path): - // "./x" -> "/this/directory/x.ext", "/this/directory/x" - noext = filepath.Join(srcDir, path) - id = noext - - case filepath.IsAbs(path): - // for completeness only - go/build.Import - // does not support absolute imports - // "/x" -> "/x.ext", "/x" - noext = path - id = path - } - - if false { // for debugging - if path != id { - fmt.Printf("%s -> %s\n", path, id) - } - } - - if filename != "" { - if f, err := os.Stat(filename); err == nil && !f.IsDir() { - return - } - } - - // try extensions - for _, ext := range pkgExts { - filename = noext + ext - if f, err := os.Stat(filename); err == nil && !f.IsDir() { - return - } - } - - filename = "" // not found - return -} - -// Import imports a gc-generated package given its import path and srcDir, adds -// the corresponding package object to the packages map, and returns the object. -// The packages map must contain all packages already imported. -func Import(packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { - var rc io.ReadCloser - var filename, id string - if lookup != nil { - // With custom lookup specified, assume that caller has - // converted path to a canonical import path for use in the map. - if path == "unsafe" { - return types.Unsafe, nil - } - id = path - - // No need to re-import if the package was imported completely before. - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - f, err := lookup(path) - if err != nil { - return nil, err - } - rc = f - } else { - filename, id = FindPkg(path, srcDir) - if filename == "" { - if path == "unsafe" { - return types.Unsafe, nil - } - return nil, fmt.Errorf("can't find import: %q", id) - } - - // no need to re-import if the package was imported completely before - if pkg = packages[id]; pkg != nil && pkg.Complete() { - return - } - - // open file - f, err := os.Open(filename) - if err != nil { - return nil, err - } - defer func() { - if err != nil { - // add file name to error - err = fmt.Errorf("%s: %v", filename, err) - } - }() - rc = f - } - defer rc.Close() - - var hdr string - var size int64 - buf := bufio.NewReader(rc) - if hdr, size, err = FindExportData(buf); err != nil { - return - } - - switch hdr { - case "$$B\n": - var data []byte - data, err = ioutil.ReadAll(buf) - if err != nil { - break - } - - // TODO(gri): allow clients of go/importer to provide a FileSet. - // Or, define a new standard go/types/gcexportdata package. - fset := token.NewFileSet() - - // Select appropriate importer. - if len(data) > 0 { - switch data[0] { - case 'v', 'c', 'd': // binary, till go1.10 - return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0]) - - case 'i': // indexed, till go1.19 - _, pkg, err := IImportData(fset, packages, data[1:], id) - return pkg, err - - case 'u': // unified, from go1.20 - _, pkg, err := UImportData(fset, packages, data[1:size], id) - return pkg, err - - default: - l := len(data) - if l > 10 { - l = 10 - } - return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), id) - } - } - - default: - err = fmt.Errorf("unknown export data header: %q", hdr) - } - - return -} - -func deref(typ types.Type) types.Type { - if p, _ := typ.(*types.Pointer); p != nil { - return p.Elem() - } - return typ -} - -type byPath []*types.Package - -func (a byPath) Len() int { return len(a) } -func (a byPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byPath) Less(i, j int) bool { return a[i].Path() < a[j].Path() } diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/iexport.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/iexport.go deleted file mode 100644 index 6103dd7102b3..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/iexport.go +++ /dev/null @@ -1,1322 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed binary package export. -// This file was derived from $GOROOT/src/cmd/compile/internal/gc/iexport.go; -// see that file for specification of the format. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "io" - "math/big" - "reflect" - "sort" - "strconv" - "strings" - - "golang.org/x/tools/go/types/objectpath" - "golang.org/x/tools/internal/tokeninternal" - "golang.org/x/tools/internal/typeparams" -) - -// IExportShallow encodes "shallow" export data for the specified package. -// -// No promises are made about the encoding other than that it can be decoded by -// the same version of IIExportShallow. If you plan to save export data in the -// file system, be sure to include a cryptographic digest of the executable in -// the key to avoid version skew. -// -// If the provided reportf func is non-nil, it will be used for reporting bugs -// encountered during export. -// TODO(rfindley): remove reportf when we are confident enough in the new -// objectpath encoding. -func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) { - // In principle this operation can only fail if out.Write fails, - // but that's impossible for bytes.Buffer---and as a matter of - // fact iexportCommon doesn't even check for I/O errors. - // TODO(adonovan): handle I/O errors properly. - // TODO(adonovan): use byte slices throughout, avoiding copying. - const bundle, shallow = false, true - var out bytes.Buffer - err := iexportCommon(&out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}) - return out.Bytes(), err -} - -// IImportShallow decodes "shallow" types.Package data encoded by -// IExportShallow in the same executable. This function cannot import data from -// cmd/compile or gcexportdata.Write. -// -// The importer calls getPackages to obtain package symbols for all -// packages mentioned in the export data, including the one being -// decoded. -// -// If the provided reportf func is non-nil, it will be used for reporting bugs -// encountered during import. -// TODO(rfindley): remove reportf when we are confident enough in the new -// objectpath encoding. -func IImportShallow(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, path string, reportf ReportFunc) (*types.Package, error) { - const bundle = false - const shallow = true - pkgs, err := iimportCommon(fset, getPackages, data, bundle, path, shallow, reportf) - if err != nil { - return nil, err - } - return pkgs[0], nil -} - -// ReportFunc is the type of a function used to report formatted bugs. -type ReportFunc = func(string, ...interface{}) - -// Current bundled export format version. Increase with each format change. -// 0: initial implementation -const bundleVersion = 0 - -// IExportData writes indexed export data for pkg to out. -// -// If no file set is provided, position info will be missing. -// The package path of the top-level package will not be recorded, -// so that calls to IImportData can override with a provided package path. -func IExportData(out io.Writer, fset *token.FileSet, pkg *types.Package) error { - const bundle, shallow = false, false - return iexportCommon(out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}) -} - -// IExportBundle writes an indexed export bundle for pkgs to out. -func IExportBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { - const bundle, shallow = true, false - return iexportCommon(out, fset, bundle, shallow, iexportVersion, pkgs) -} - -func iexportCommon(out io.Writer, fset *token.FileSet, bundle, shallow bool, version int, pkgs []*types.Package) (err error) { - if !debug { - defer func() { - if e := recover(); e != nil { - if ierr, ok := e.(internalError); ok { - err = ierr - return - } - // Not an internal error; panic again. - panic(e) - } - }() - } - - p := iexporter{ - fset: fset, - version: version, - shallow: shallow, - allPkgs: map[*types.Package]bool{}, - stringIndex: map[string]uint64{}, - declIndex: map[types.Object]uint64{}, - tparamNames: map[types.Object]string{}, - typIndex: map[types.Type]uint64{}, - } - if !bundle { - p.localpkg = pkgs[0] - } - - for i, pt := range predeclared() { - p.typIndex[pt] = uint64(i) - } - if len(p.typIndex) > predeclReserved { - panic(internalErrorf("too many predeclared types: %d > %d", len(p.typIndex), predeclReserved)) - } - - // Initialize work queue with exported declarations. - for _, pkg := range pkgs { - scope := pkg.Scope() - for _, name := range scope.Names() { - if token.IsExported(name) { - p.pushDecl(scope.Lookup(name)) - } - } - - if bundle { - // Ensure pkg and its imports are included in the index. - p.allPkgs[pkg] = true - for _, imp := range pkg.Imports() { - p.allPkgs[imp] = true - } - } - } - - // Loop until no more work. - for !p.declTodo.empty() { - p.doDecl(p.declTodo.popHead()) - } - - // Produce index of offset of each file record in files. - var files intWriter - var fileOffset []uint64 // fileOffset[i] is offset in files of file encoded as i - if p.shallow { - fileOffset = make([]uint64, len(p.fileInfos)) - for i, info := range p.fileInfos { - fileOffset[i] = uint64(files.Len()) - p.encodeFile(&files, info.file, info.needed) - } - } - - // Append indices to data0 section. - dataLen := uint64(p.data0.Len()) - w := p.newWriter() - w.writeIndex(p.declIndex) - - if bundle { - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.pkg(pkg) - imps := pkg.Imports() - w.uint64(uint64(len(imps))) - for _, imp := range imps { - w.pkg(imp) - } - } - } - w.flush() - - // Assemble header. - var hdr intWriter - if bundle { - hdr.uint64(bundleVersion) - } - hdr.uint64(uint64(p.version)) - hdr.uint64(uint64(p.strings.Len())) - if p.shallow { - hdr.uint64(uint64(files.Len())) - hdr.uint64(uint64(len(fileOffset))) - for _, offset := range fileOffset { - hdr.uint64(offset) - } - } - hdr.uint64(dataLen) - - // Flush output. - io.Copy(out, &hdr) - io.Copy(out, &p.strings) - if p.shallow { - io.Copy(out, &files) - } - io.Copy(out, &p.data0) - - return nil -} - -// encodeFile writes to w a representation of the file sufficient to -// faithfully restore position information about all needed offsets. -// Mutates the needed array. -func (p *iexporter) encodeFile(w *intWriter, file *token.File, needed []uint64) { - _ = needed[0] // precondition: needed is non-empty - - w.uint64(p.stringOff(file.Name())) - - size := uint64(file.Size()) - w.uint64(size) - - // Sort the set of needed offsets. Duplicates are harmless. - sort.Slice(needed, func(i, j int) bool { return needed[i] < needed[j] }) - - lines := tokeninternal.GetLines(file) // byte offset of each line start - w.uint64(uint64(len(lines))) - - // Rather than record the entire array of line start offsets, - // we save only a sparse list of (index, offset) pairs for - // the start of each line that contains a needed position. - var sparse [][2]int // (index, offset) pairs -outer: - for i, lineStart := range lines { - lineEnd := size - if i < len(lines)-1 { - lineEnd = uint64(lines[i+1]) - } - // Does this line contains a needed offset? - if needed[0] < lineEnd { - sparse = append(sparse, [2]int{i, lineStart}) - for needed[0] < lineEnd { - needed = needed[1:] - if len(needed) == 0 { - break outer - } - } - } - } - - // Delta-encode the columns. - w.uint64(uint64(len(sparse))) - var prev [2]int - for _, pair := range sparse { - w.uint64(uint64(pair[0] - prev[0])) - w.uint64(uint64(pair[1] - prev[1])) - prev = pair - } -} - -// writeIndex writes out an object index. mainIndex indicates whether -// we're writing out the main index, which is also read by -// non-compiler tools and includes a complete package description -// (i.e., name and height). -func (w *exportWriter) writeIndex(index map[types.Object]uint64) { - type pkgObj struct { - obj types.Object - name string // qualified name; differs from obj.Name for type params - } - // Build a map from packages to objects from that package. - pkgObjs := map[*types.Package][]pkgObj{} - - // For the main index, make sure to include every package that - // we reference, even if we're not exporting (or reexporting) - // any symbols from it. - if w.p.localpkg != nil { - pkgObjs[w.p.localpkg] = nil - } - for pkg := range w.p.allPkgs { - pkgObjs[pkg] = nil - } - - for obj := range index { - name := w.p.exportName(obj) - pkgObjs[obj.Pkg()] = append(pkgObjs[obj.Pkg()], pkgObj{obj, name}) - } - - var pkgs []*types.Package - for pkg, objs := range pkgObjs { - pkgs = append(pkgs, pkg) - - sort.Slice(objs, func(i, j int) bool { - return objs[i].name < objs[j].name - }) - } - - sort.Slice(pkgs, func(i, j int) bool { - return w.exportPath(pkgs[i]) < w.exportPath(pkgs[j]) - }) - - w.uint64(uint64(len(pkgs))) - for _, pkg := range pkgs { - w.string(w.exportPath(pkg)) - w.string(pkg.Name()) - w.uint64(uint64(0)) // package height is not needed for go/types - - objs := pkgObjs[pkg] - w.uint64(uint64(len(objs))) - for _, obj := range objs { - w.string(obj.name) - w.uint64(index[obj.obj]) - } - } -} - -// exportName returns the 'exported' name of an object. It differs from -// obj.Name() only for type parameters (see tparamExportName for details). -func (p *iexporter) exportName(obj types.Object) (res string) { - if name := p.tparamNames[obj]; name != "" { - return name - } - return obj.Name() -} - -type iexporter struct { - fset *token.FileSet - out *bytes.Buffer - version int - - shallow bool // don't put types from other packages in the index - objEncoder *objectpath.Encoder // encodes objects from other packages in shallow mode; lazily allocated - localpkg *types.Package // (nil in bundle mode) - - // allPkgs tracks all packages that have been referenced by - // the export data, so we can ensure to include them in the - // main index. - allPkgs map[*types.Package]bool - - declTodo objQueue - - strings intWriter - stringIndex map[string]uint64 - - // In shallow mode, object positions are encoded as (file, offset). - // Each file is recorded as a line-number table. - // Only the lines of needed positions are saved faithfully. - fileInfo map[*token.File]uint64 // value is index in fileInfos - fileInfos []*filePositions - - data0 intWriter - declIndex map[types.Object]uint64 - tparamNames map[types.Object]string // typeparam->exported name - typIndex map[types.Type]uint64 - - indent int // for tracing support -} - -type filePositions struct { - file *token.File - needed []uint64 // unordered list of needed file offsets -} - -func (p *iexporter) trace(format string, args ...interface{}) { - if !trace { - // Call sites should also be guarded, but having this check here allows - // easily enabling/disabling debug trace statements. - return - } - fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) -} - -// objectpathEncoder returns the lazily allocated objectpath.Encoder to use -// when encoding objects in other packages during shallow export. -// -// Using a shared Encoder amortizes some of cost of objectpath search. -func (p *iexporter) objectpathEncoder() *objectpath.Encoder { - if p.objEncoder == nil { - p.objEncoder = new(objectpath.Encoder) - } - return p.objEncoder -} - -// stringOff returns the offset of s within the string section. -// If not already present, it's added to the end. -func (p *iexporter) stringOff(s string) uint64 { - off, ok := p.stringIndex[s] - if !ok { - off = uint64(p.strings.Len()) - p.stringIndex[s] = off - - p.strings.uint64(uint64(len(s))) - p.strings.WriteString(s) - } - return off -} - -// fileIndexAndOffset returns the index of the token.File and the byte offset of pos within it. -func (p *iexporter) fileIndexAndOffset(file *token.File, pos token.Pos) (uint64, uint64) { - index, ok := p.fileInfo[file] - if !ok { - index = uint64(len(p.fileInfo)) - p.fileInfos = append(p.fileInfos, &filePositions{file: file}) - if p.fileInfo == nil { - p.fileInfo = make(map[*token.File]uint64) - } - p.fileInfo[file] = index - } - // Record each needed offset. - info := p.fileInfos[index] - offset := uint64(file.Offset(pos)) - info.needed = append(info.needed, offset) - - return index, offset -} - -// pushDecl adds n to the declaration work queue, if not already present. -func (p *iexporter) pushDecl(obj types.Object) { - // Package unsafe is known to the compiler and predeclared. - // Caller should not ask us to do export it. - if obj.Pkg() == types.Unsafe { - panic("cannot export package unsafe") - } - - // Shallow export data: don't index decls from other packages. - if p.shallow && obj.Pkg() != p.localpkg { - return - } - - if _, ok := p.declIndex[obj]; ok { - return - } - - p.declIndex[obj] = ^uint64(0) // mark obj present in work queue - p.declTodo.pushTail(obj) -} - -// exportWriter handles writing out individual data section chunks. -type exportWriter struct { - p *iexporter - - data intWriter - prevFile string - prevLine int64 - prevColumn int64 -} - -func (w *exportWriter) exportPath(pkg *types.Package) string { - if pkg == w.p.localpkg { - return "" - } - return pkg.Path() -} - -func (p *iexporter) doDecl(obj types.Object) { - if trace { - p.trace("exporting decl %v (%T)", obj, obj) - p.indent++ - defer func() { - p.indent-- - p.trace("=> %s", obj) - }() - } - w := p.newWriter() - - switch obj := obj.(type) { - case *types.Var: - w.tag('V') - w.pos(obj.Pos()) - w.typ(obj.Type(), obj.Pkg()) - - case *types.Func: - sig, _ := obj.Type().(*types.Signature) - if sig.Recv() != nil { - // We shouldn't see methods in the package scope, - // but the type checker may repair "func () F() {}" - // to "func (Invalid) F()" and then treat it like "func F()", - // so allow that. See golang/go#57729. - if sig.Recv().Type() != types.Typ[types.Invalid] { - panic(internalErrorf("unexpected method: %v", sig)) - } - } - - // Function. - if typeparams.ForSignature(sig).Len() == 0 { - w.tag('F') - } else { - w.tag('G') - } - w.pos(obj.Pos()) - // The tparam list of the function type is the declaration of the type - // params. So, write out the type params right now. Then those type params - // will be referenced via their type offset (via typOff) in all other - // places in the signature and function where they are used. - // - // While importing the type parameters, tparamList computes and records - // their export name, so that it can be later used when writing the index. - if tparams := typeparams.ForSignature(sig); tparams.Len() > 0 { - w.tparamList(obj.Name(), tparams, obj.Pkg()) - } - w.signature(sig) - - case *types.Const: - w.tag('C') - w.pos(obj.Pos()) - w.value(obj.Type(), obj.Val()) - - case *types.TypeName: - t := obj.Type() - - if tparam, ok := t.(*typeparams.TypeParam); ok { - w.tag('P') - w.pos(obj.Pos()) - constraint := tparam.Constraint() - if p.version >= iexportVersionGo1_18 { - implicit := false - if iface, _ := constraint.(*types.Interface); iface != nil { - implicit = typeparams.IsImplicit(iface) - } - w.bool(implicit) - } - w.typ(constraint, obj.Pkg()) - break - } - - if obj.IsAlias() { - w.tag('A') - w.pos(obj.Pos()) - w.typ(t, obj.Pkg()) - break - } - - // Defined type. - named, ok := t.(*types.Named) - if !ok { - panic(internalErrorf("%s is not a defined type", t)) - } - - if typeparams.ForNamed(named).Len() == 0 { - w.tag('T') - } else { - w.tag('U') - } - w.pos(obj.Pos()) - - if typeparams.ForNamed(named).Len() > 0 { - // While importing the type parameters, tparamList computes and records - // their export name, so that it can be later used when writing the index. - w.tparamList(obj.Name(), typeparams.ForNamed(named), obj.Pkg()) - } - - underlying := obj.Type().Underlying() - w.typ(underlying, obj.Pkg()) - - if types.IsInterface(t) { - break - } - - n := named.NumMethods() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - m := named.Method(i) - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - - // Receiver type parameters are type arguments of the receiver type, so - // their name must be qualified before exporting recv. - if rparams := typeparams.RecvTypeParams(sig); rparams.Len() > 0 { - prefix := obj.Name() + "." + m.Name() - for i := 0; i < rparams.Len(); i++ { - rparam := rparams.At(i) - name := tparamExportName(prefix, rparam) - w.p.tparamNames[rparam.Obj()] = name - } - } - w.param(sig.Recv()) - w.signature(sig) - } - - default: - panic(internalErrorf("unexpected object: %v", obj)) - } - - p.declIndex[obj] = w.flush() -} - -func (w *exportWriter) tag(tag byte) { - w.data.WriteByte(tag) -} - -func (w *exportWriter) pos(pos token.Pos) { - if w.p.shallow { - w.posV2(pos) - } else if w.p.version >= iexportVersionPosCol { - w.posV1(pos) - } else { - w.posV0(pos) - } -} - -// posV2 encoding (used only in shallow mode) records positions as -// (file, offset), where file is the index in the token.File table -// (which records the file name and newline offsets) and offset is a -// byte offset. It effectively ignores //line directives. -func (w *exportWriter) posV2(pos token.Pos) { - if pos == token.NoPos { - w.uint64(0) - return - } - file := w.p.fset.File(pos) // fset must be non-nil - index, offset := w.p.fileIndexAndOffset(file, pos) - w.uint64(1 + index) - w.uint64(offset) -} - -func (w *exportWriter) posV1(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - column := int64(p.Column) - - deltaColumn := (column - w.prevColumn) << 1 - deltaLine := (line - w.prevLine) << 1 - - if file != w.prevFile { - deltaLine |= 1 - } - if deltaLine != 0 { - deltaColumn |= 1 - } - - w.int64(deltaColumn) - if deltaColumn&1 != 0 { - w.int64(deltaLine) - if deltaLine&1 != 0 { - w.string(file) - } - } - - w.prevFile = file - w.prevLine = line - w.prevColumn = column -} - -func (w *exportWriter) posV0(pos token.Pos) { - if w.p.fset == nil { - w.int64(0) - return - } - - p := w.p.fset.Position(pos) - file := p.Filename - line := int64(p.Line) - - // When file is the same as the last position (common case), - // we can save a few bytes by delta encoding just the line - // number. - // - // Note: Because data objects may be read out of order (or not - // at all), we can only apply delta encoding within a single - // object. This is handled implicitly by tracking prevFile and - // prevLine as fields of exportWriter. - - if file == w.prevFile { - delta := line - w.prevLine - w.int64(delta) - if delta == deltaNewFile { - w.int64(-1) - } - } else { - w.int64(deltaNewFile) - w.int64(line) // line >= 0 - w.string(file) - w.prevFile = file - } - w.prevLine = line -} - -func (w *exportWriter) pkg(pkg *types.Package) { - // Ensure any referenced packages are declared in the main index. - w.p.allPkgs[pkg] = true - - w.string(w.exportPath(pkg)) -} - -func (w *exportWriter) qualifiedType(obj *types.TypeName) { - name := w.p.exportName(obj) - - // Ensure any referenced declarations are written out too. - w.p.pushDecl(obj) - w.string(name) - w.pkg(obj.Pkg()) -} - -// TODO(rfindley): what does 'pkg' even mean here? It would be better to pass -// it in explicitly into signatures and structs that may use it for -// constructing fields. -func (w *exportWriter) typ(t types.Type, pkg *types.Package) { - w.data.uint64(w.p.typOff(t, pkg)) -} - -func (p *iexporter) newWriter() *exportWriter { - return &exportWriter{p: p} -} - -func (w *exportWriter) flush() uint64 { - off := uint64(w.p.data0.Len()) - io.Copy(&w.p.data0, &w.data) - return off -} - -func (p *iexporter) typOff(t types.Type, pkg *types.Package) uint64 { - off, ok := p.typIndex[t] - if !ok { - w := p.newWriter() - w.doTyp(t, pkg) - off = predeclReserved + w.flush() - p.typIndex[t] = off - } - return off -} - -func (w *exportWriter) startType(k itag) { - w.data.uint64(uint64(k)) -} - -func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) { - if trace { - w.p.trace("exporting type %s (%T)", t, t) - w.p.indent++ - defer func() { - w.p.indent-- - w.p.trace("=> %s", t) - }() - } - switch t := t.(type) { - case *types.Named: - if targs := typeparams.NamedTypeArgs(t); targs.Len() > 0 { - w.startType(instanceType) - // TODO(rfindley): investigate if this position is correct, and if it - // matters. - w.pos(t.Obj().Pos()) - w.typeList(targs, pkg) - w.typ(typeparams.NamedTypeOrigin(t), pkg) - return - } - w.startType(definedType) - w.qualifiedType(t.Obj()) - - case *typeparams.TypeParam: - w.startType(typeParamType) - w.qualifiedType(t.Obj()) - - case *types.Pointer: - w.startType(pointerType) - w.typ(t.Elem(), pkg) - - case *types.Slice: - w.startType(sliceType) - w.typ(t.Elem(), pkg) - - case *types.Array: - w.startType(arrayType) - w.uint64(uint64(t.Len())) - w.typ(t.Elem(), pkg) - - case *types.Chan: - w.startType(chanType) - // 1 RecvOnly; 2 SendOnly; 3 SendRecv - var dir uint64 - switch t.Dir() { - case types.RecvOnly: - dir = 1 - case types.SendOnly: - dir = 2 - case types.SendRecv: - dir = 3 - } - w.uint64(dir) - w.typ(t.Elem(), pkg) - - case *types.Map: - w.startType(mapType) - w.typ(t.Key(), pkg) - w.typ(t.Elem(), pkg) - - case *types.Signature: - w.startType(signatureType) - w.pkg(pkg) - w.signature(t) - - case *types.Struct: - w.startType(structType) - n := t.NumFields() - // Even for struct{} we must emit some qualifying package, because that's - // what the compiler does, and thus that's what the importer expects. - fieldPkg := pkg - if n > 0 { - fieldPkg = t.Field(0).Pkg() - } - if fieldPkg == nil { - // TODO(rfindley): improve this very hacky logic. - // - // The importer expects a package to be set for all struct types, even - // those with no fields. A better encoding might be to set NumFields - // before pkg. setPkg panics with a nil package, which may be possible - // to reach with invalid packages (and perhaps valid packages, too?), so - // (arbitrarily) set the localpkg if available. - // - // Alternatively, we may be able to simply guarantee that pkg != nil, by - // reconsidering the encoding of constant values. - if w.p.shallow { - fieldPkg = w.p.localpkg - } else { - panic(internalErrorf("no package to set for empty struct")) - } - } - w.pkg(fieldPkg) - w.uint64(uint64(n)) - - for i := 0; i < n; i++ { - f := t.Field(i) - if w.p.shallow { - w.objectPath(f) - } - w.pos(f.Pos()) - w.string(f.Name()) // unexported fields implicitly qualified by prior setPkg - w.typ(f.Type(), fieldPkg) - w.bool(f.Anonymous()) - w.string(t.Tag(i)) // note (or tag) - } - - case *types.Interface: - w.startType(interfaceType) - w.pkg(pkg) - - n := t.NumEmbeddeds() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - ft := t.EmbeddedType(i) - tPkg := pkg - if named, _ := ft.(*types.Named); named != nil { - w.pos(named.Obj().Pos()) - } else { - w.pos(token.NoPos) - } - w.typ(ft, tPkg) - } - - // See comment for struct fields. In shallow mode we change the encoding - // for interface methods that are promoted from other packages. - - n = t.NumExplicitMethods() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - m := t.ExplicitMethod(i) - if w.p.shallow { - w.objectPath(m) - } - w.pos(m.Pos()) - w.string(m.Name()) - sig, _ := m.Type().(*types.Signature) - w.signature(sig) - } - - case *typeparams.Union: - w.startType(unionType) - nt := t.Len() - w.uint64(uint64(nt)) - for i := 0; i < nt; i++ { - term := t.Term(i) - w.bool(term.Tilde()) - w.typ(term.Type(), pkg) - } - - default: - panic(internalErrorf("unexpected type: %v, %v", t, reflect.TypeOf(t))) - } -} - -// objectPath writes the package and objectPath to use to look up obj in a -// different package, when encoding in "shallow" mode. -// -// When doing a shallow import, the importer creates only the local package, -// and requests package symbols for dependencies from the client. -// However, certain types defined in the local package may hold objects defined -// (perhaps deeply) within another package. -// -// For example, consider the following: -// -// package a -// func F() chan * map[string] struct { X int } -// -// package b -// import "a" -// var B = a.F() -// -// In this example, the type of b.B holds fields defined in package a. -// In order to have the correct canonical objects for the field defined in the -// type of B, they are encoded as objectPaths and later looked up in the -// importer. The same problem applies to interface methods. -func (w *exportWriter) objectPath(obj types.Object) { - if obj.Pkg() == nil || obj.Pkg() == w.p.localpkg { - // obj.Pkg() may be nil for the builtin error.Error. - // In this case, or if obj is declared in the local package, no need to - // encode. - w.string("") - return - } - objectPath, err := w.p.objectpathEncoder().For(obj) - if err != nil { - // Fall back to the empty string, which will cause the importer to create a - // new object, which matches earlier behavior. Creating a new object is - // sufficient for many purposes (such as type checking), but causes certain - // references algorithms to fail (golang/go#60819). However, we didn't - // notice this problem during months of gopls@v0.12.0 testing. - // - // TODO(golang/go#61674): this workaround is insufficient, as in the case - // where the field forwarded from an instantiated type that may not appear - // in the export data of the original package: - // - // // package a - // type A[P any] struct{ F P } - // - // // package b - // type B a.A[int] - // - // We need to update references algorithms not to depend on this - // de-duplication, at which point we may want to simply remove the - // workaround here. - w.string("") - return - } - w.string(string(objectPath)) - w.pkg(obj.Pkg()) -} - -func (w *exportWriter) signature(sig *types.Signature) { - w.paramList(sig.Params()) - w.paramList(sig.Results()) - if sig.Params().Len() > 0 { - w.bool(sig.Variadic()) - } -} - -func (w *exportWriter) typeList(ts *typeparams.TypeList, pkg *types.Package) { - w.uint64(uint64(ts.Len())) - for i := 0; i < ts.Len(); i++ { - w.typ(ts.At(i), pkg) - } -} - -func (w *exportWriter) tparamList(prefix string, list *typeparams.TypeParamList, pkg *types.Package) { - ll := uint64(list.Len()) - w.uint64(ll) - for i := 0; i < list.Len(); i++ { - tparam := list.At(i) - // Set the type parameter exportName before exporting its type. - exportName := tparamExportName(prefix, tparam) - w.p.tparamNames[tparam.Obj()] = exportName - w.typ(list.At(i), pkg) - } -} - -const blankMarker = "$" - -// tparamExportName returns the 'exported' name of a type parameter, which -// differs from its actual object name: it is prefixed with a qualifier, and -// blank type parameter names are disambiguated by their index in the type -// parameter list. -func tparamExportName(prefix string, tparam *typeparams.TypeParam) string { - assert(prefix != "") - name := tparam.Obj().Name() - if name == "_" { - name = blankMarker + strconv.Itoa(tparam.Index()) - } - return prefix + "." + name -} - -// tparamName returns the real name of a type parameter, after stripping its -// qualifying prefix and reverting blank-name encoding. See tparamExportName -// for details. -func tparamName(exportName string) string { - // Remove the "path" from the type param name that makes it unique. - ix := strings.LastIndex(exportName, ".") - if ix < 0 { - errorf("malformed type parameter export name %s: missing prefix", exportName) - } - name := exportName[ix+1:] - if strings.HasPrefix(name, blankMarker) { - return "_" - } - return name -} - -func (w *exportWriter) paramList(tup *types.Tuple) { - n := tup.Len() - w.uint64(uint64(n)) - for i := 0; i < n; i++ { - w.param(tup.At(i)) - } -} - -func (w *exportWriter) param(obj types.Object) { - w.pos(obj.Pos()) - w.localIdent(obj) - w.typ(obj.Type(), obj.Pkg()) -} - -func (w *exportWriter) value(typ types.Type, v constant.Value) { - w.typ(typ, nil) - if w.p.version >= iexportVersionGo1_18 { - w.int64(int64(v.Kind())) - } - - if v.Kind() == constant.Unknown { - // golang/go#60605: treat unknown constant values as if they have invalid type - // - // This loses some fidelity over the package type-checked from source, but that - // is acceptable. - // - // TODO(rfindley): we should switch on the recorded constant kind rather - // than the constant type - return - } - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - w.bool(constant.BoolVal(v)) - case types.IsInteger: - var i big.Int - if i64, exact := constant.Int64Val(v); exact { - i.SetInt64(i64) - } else if ui64, exact := constant.Uint64Val(v); exact { - i.SetUint64(ui64) - } else { - i.SetString(v.ExactString(), 10) - } - w.mpint(&i, typ) - case types.IsFloat: - f := constantToFloat(v) - w.mpfloat(f, typ) - case types.IsComplex: - w.mpfloat(constantToFloat(constant.Real(v)), typ) - w.mpfloat(constantToFloat(constant.Imag(v)), typ) - case types.IsString: - w.string(constant.StringVal(v)) - default: - if b.Kind() == types.Invalid { - // package contains type errors - break - } - panic(internalErrorf("unexpected type %v (%v)", typ, typ.Underlying())) - } -} - -// constantToFloat converts a constant.Value with kind constant.Float to a -// big.Float. -func constantToFloat(x constant.Value) *big.Float { - x = constant.ToFloat(x) - // Use the same floating-point precision (512) as cmd/compile - // (see Mpprec in cmd/compile/internal/gc/mpfloat.go). - const mpprec = 512 - var f big.Float - f.SetPrec(mpprec) - if v, exact := constant.Float64Val(x); exact { - // float64 - f.SetFloat64(v) - } else if num, denom := constant.Num(x), constant.Denom(x); num.Kind() == constant.Int { - // TODO(gri): add big.Rat accessor to constant.Value. - n := valueToRat(num) - d := valueToRat(denom) - f.SetRat(n.Quo(n, d)) - } else { - // Value too large to represent as a fraction => inaccessible. - // TODO(gri): add big.Float accessor to constant.Value. - _, ok := f.SetString(x.ExactString()) - assert(ok) - } - return &f -} - -func valueToRat(x constant.Value) *big.Rat { - // Convert little-endian to big-endian. - // I can't believe this is necessary. - bytes := constant.Bytes(x) - for i := 0; i < len(bytes)/2; i++ { - bytes[i], bytes[len(bytes)-1-i] = bytes[len(bytes)-1-i], bytes[i] - } - return new(big.Rat).SetInt(new(big.Int).SetBytes(bytes)) -} - -// mpint exports a multi-precision integer. -// -// For unsigned types, small values are written out as a single -// byte. Larger values are written out as a length-prefixed big-endian -// byte string, where the length prefix is encoded as its complement. -// For example, bytes 0, 1, and 2 directly represent the integer -// values 0, 1, and 2; while bytes 255, 254, and 253 indicate a 1-, -// 2-, and 3-byte big-endian string follow. -// -// Encoding for signed types use the same general approach as for -// unsigned types, except small values use zig-zag encoding and the -// bottom bit of length prefix byte for large values is reserved as a -// sign bit. -// -// The exact boundary between small and large encodings varies -// according to the maximum number of bytes needed to encode a value -// of type typ. As a special case, 8-bit types are always encoded as a -// single byte. -// -// TODO(mdempsky): Is this level of complexity really worthwhile? -func (w *exportWriter) mpint(x *big.Int, typ types.Type) { - basic, ok := typ.Underlying().(*types.Basic) - if !ok { - panic(internalErrorf("unexpected type %v (%T)", typ.Underlying(), typ.Underlying())) - } - - signed, maxBytes := intSize(basic) - - negative := x.Sign() < 0 - if !signed && negative { - panic(internalErrorf("negative unsigned integer; type %v, value %v", typ, x)) - } - - b := x.Bytes() - if len(b) > 0 && b[0] == 0 { - panic(internalErrorf("leading zeros")) - } - if uint(len(b)) > maxBytes { - panic(internalErrorf("bad mpint length: %d > %d (type %v, value %v)", len(b), maxBytes, typ, x)) - } - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - // Check if x can use small value encoding. - if len(b) <= 1 { - var ux uint - if len(b) == 1 { - ux = uint(b[0]) - } - if signed { - ux <<= 1 - if negative { - ux-- - } - } - if ux < maxSmall { - w.data.WriteByte(byte(ux)) - return - } - } - - n := 256 - uint(len(b)) - if signed { - n = 256 - 2*uint(len(b)) - if negative { - n |= 1 - } - } - if n < maxSmall || n >= 256 { - panic(internalErrorf("encoding mistake: %d, %v, %v => %d", len(b), signed, negative, n)) - } - - w.data.WriteByte(byte(n)) - w.data.Write(b) -} - -// mpfloat exports a multi-precision floating point number. -// -// The number's value is decomposed into mantissa × 2**exponent, where -// mantissa is an integer. The value is written out as mantissa (as a -// multi-precision integer) and then the exponent, except exponent is -// omitted if mantissa is zero. -func (w *exportWriter) mpfloat(f *big.Float, typ types.Type) { - if f.IsInf() { - panic("infinite constant") - } - - // Break into f = mant × 2**exp, with 0.5 <= mant < 1. - var mant big.Float - exp := int64(f.MantExp(&mant)) - - // Scale so that mant is an integer. - prec := mant.MinPrec() - mant.SetMantExp(&mant, int(prec)) - exp -= int64(prec) - - manti, acc := mant.Int(nil) - if acc != big.Exact { - panic(internalErrorf("mantissa scaling failed for %f (%s)", f, acc)) - } - w.mpint(manti, typ) - if manti.Sign() != 0 { - w.int64(exp) - } -} - -func (w *exportWriter) bool(b bool) bool { - var x uint64 - if b { - x = 1 - } - w.uint64(x) - return b -} - -func (w *exportWriter) int64(x int64) { w.data.int64(x) } -func (w *exportWriter) uint64(x uint64) { w.data.uint64(x) } -func (w *exportWriter) string(s string) { w.uint64(w.p.stringOff(s)) } - -func (w *exportWriter) localIdent(obj types.Object) { - // Anonymous parameters. - if obj == nil { - w.string("") - return - } - - name := obj.Name() - if name == "_" { - w.string("_") - return - } - - w.string(name) -} - -type intWriter struct { - bytes.Buffer -} - -func (w *intWriter) int64(x int64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutVarint(buf[:], x) - w.Write(buf[:n]) -} - -func (w *intWriter) uint64(x uint64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutUvarint(buf[:], x) - w.Write(buf[:n]) -} - -func assert(cond bool) { - if !cond { - panic("internal error: assertion failed") - } -} - -// The below is copied from go/src/cmd/compile/internal/gc/syntax.go. - -// objQueue is a FIFO queue of types.Object. The zero value of objQueue is -// a ready-to-use empty queue. -type objQueue struct { - ring []types.Object - head, tail int -} - -// empty returns true if q contains no Nodes. -func (q *objQueue) empty() bool { - return q.head == q.tail -} - -// pushTail appends n to the tail of the queue. -func (q *objQueue) pushTail(obj types.Object) { - if len(q.ring) == 0 { - q.ring = make([]types.Object, 16) - } else if q.head+len(q.ring) == q.tail { - // Grow the ring. - nring := make([]types.Object, len(q.ring)*2) - // Copy the old elements. - part := q.ring[q.head%len(q.ring):] - if q.tail-q.head <= len(part) { - part = part[:q.tail-q.head] - copy(nring, part) - } else { - pos := copy(nring, part) - copy(nring[pos:], q.ring[:q.tail%len(q.ring)]) - } - q.ring, q.head, q.tail = nring, 0, q.tail-q.head - } - - q.ring[q.tail%len(q.ring)] = obj - q.tail++ -} - -// popHead pops a node from the head of the queue. It panics if q is empty. -func (q *objQueue) popHead() types.Object { - if q.empty() { - panic("dequeue empty") - } - obj := q.ring[q.head%len(q.ring)] - q.head++ - return obj -} - -// internalError represents an error generated inside this package. -type internalError string - -func (e internalError) Error() string { return "gcimporter: " + string(e) } - -// TODO(adonovan): make this call panic, so that it's symmetric with errorf. -// Otherwise it's easy to forget to do anything with the error. -// -// TODO(adonovan): also, consider switching the names "errorf" and -// "internalErrorf" as the former is used for bugs, whose cause is -// internal inconsistency, whereas the latter is used for ordinary -// situations like bad input, whose cause is external. -func internalErrorf(format string, args ...interface{}) error { - return internalError(fmt.Sprintf(format, args...)) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/iimport.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/iimport.go deleted file mode 100644 index 8e64cf644fce..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/iimport.go +++ /dev/null @@ -1,1083 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Indexed package import. -// See cmd/compile/internal/gc/iexport.go for the export data format. - -// This file is a copy of $GOROOT/src/go/internal/gcimporter/iimport.go. - -package gcimporter - -import ( - "bytes" - "encoding/binary" - "fmt" - "go/constant" - "go/token" - "go/types" - "io" - "math/big" - "sort" - "strings" - - "golang.org/x/tools/go/types/objectpath" - "golang.org/x/tools/internal/typeparams" -) - -type intReader struct { - *bytes.Reader - path string -} - -func (r *intReader) int64() int64 { - i, err := binary.ReadVarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -func (r *intReader) uint64() uint64 { - i, err := binary.ReadUvarint(r.Reader) - if err != nil { - errorf("import %q: read varint error: %v", r.path, err) - } - return i -} - -// Keep this in sync with constants in iexport.go. -const ( - iexportVersionGo1_11 = 0 - iexportVersionPosCol = 1 - iexportVersionGo1_18 = 2 - iexportVersionGenerics = 2 - - iexportVersionCurrent = 2 -) - -type ident struct { - pkg *types.Package - name string -} - -const predeclReserved = 32 - -type itag uint64 - -const ( - // Types - definedType itag = iota - pointerType - sliceType - arrayType - chanType - mapType - signatureType - structType - interfaceType - typeParamType - instanceType - unionType -) - -// IImportData imports a package from the serialized package data -// and returns 0 and a reference to the package. -// If the export data version is not recognized or the format is otherwise -// compromised, an error is returned. -func IImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (int, *types.Package, error) { - pkgs, err := iimportCommon(fset, GetPackagesFromMap(imports), data, false, path, false, nil) - if err != nil { - return 0, nil, err - } - return 0, pkgs[0], nil -} - -// IImportBundle imports a set of packages from the serialized package bundle. -func IImportBundle(fset *token.FileSet, imports map[string]*types.Package, data []byte) ([]*types.Package, error) { - return iimportCommon(fset, GetPackagesFromMap(imports), data, true, "", false, nil) -} - -// A GetPackagesFunc function obtains the non-nil symbols for a set of -// packages, creating and recursively importing them as needed. An -// implementation should store each package symbol is in the Pkg -// field of the items array. -// -// Any error causes importing to fail. This can be used to quickly read -// the import manifest of an export data file without fully decoding it. -type GetPackagesFunc = func(items []GetPackagesItem) error - -// A GetPackagesItem is a request from the importer for the package -// symbol of the specified name and path. -type GetPackagesItem struct { - Name, Path string - Pkg *types.Package // to be filled in by GetPackagesFunc call - - // private importer state - pathOffset uint64 - nameIndex map[string]uint64 -} - -// GetPackagesFromMap returns a GetPackagesFunc that retrieves -// packages from the given map of package path to package. -// -// The returned function may mutate m: each requested package that is not -// found is created with types.NewPackage and inserted into m. -func GetPackagesFromMap(m map[string]*types.Package) GetPackagesFunc { - return func(items []GetPackagesItem) error { - for i, item := range items { - pkg, ok := m[item.Path] - if !ok { - pkg = types.NewPackage(item.Path, item.Name) - m[item.Path] = pkg - } - items[i].Pkg = pkg - } - return nil - } -} - -func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte, bundle bool, path string, shallow bool, reportf ReportFunc) (pkgs []*types.Package, err error) { - const currentVersion = iexportVersionCurrent - version := int64(-1) - if !debug { - defer func() { - if e := recover(); e != nil { - if bundle { - err = fmt.Errorf("%v", e) - } else if version > currentVersion { - err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e) - } else { - err = fmt.Errorf("internal error while importing %q (%v); please report an issue", path, e) - } - } - }() - } - - r := &intReader{bytes.NewReader(data), path} - - if bundle { - if v := r.uint64(); v != bundleVersion { - errorf("unknown bundle format version %d", v) - } - } - - version = int64(r.uint64()) - switch version { - case iexportVersionGo1_18, iexportVersionPosCol, iexportVersionGo1_11: - default: - if version > iexportVersionGo1_18 { - errorf("unstable iexport format version %d, just rebuild compiler and std library", version) - } else { - errorf("unknown iexport format version %d", version) - } - } - - sLen := int64(r.uint64()) - var fLen int64 - var fileOffset []uint64 - if shallow { - // Shallow mode uses a different position encoding. - fLen = int64(r.uint64()) - fileOffset = make([]uint64, r.uint64()) - for i := range fileOffset { - fileOffset[i] = r.uint64() - } - } - dLen := int64(r.uint64()) - - whence, _ := r.Seek(0, io.SeekCurrent) - stringData := data[whence : whence+sLen] - fileData := data[whence+sLen : whence+sLen+fLen] - declData := data[whence+sLen+fLen : whence+sLen+fLen+dLen] - r.Seek(sLen+fLen+dLen, io.SeekCurrent) - - p := iimporter{ - version: int(version), - ipath: path, - shallow: shallow, - reportf: reportf, - - stringData: stringData, - stringCache: make(map[uint64]string), - fileOffset: fileOffset, - fileData: fileData, - fileCache: make([]*token.File, len(fileOffset)), - pkgCache: make(map[uint64]*types.Package), - - declData: declData, - pkgIndex: make(map[*types.Package]map[string]uint64), - typCache: make(map[uint64]types.Type), - // Separate map for typeparams, keyed by their package and unique - // name. - tparamIndex: make(map[ident]types.Type), - - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*fileInfo), - }, - } - defer p.fake.setLines() // set lines for files in fset - - for i, pt := range predeclared() { - p.typCache[uint64(i)] = pt - } - - // Gather the relevant packages from the manifest. - items := make([]GetPackagesItem, r.uint64()) - for i := range items { - pkgPathOff := r.uint64() - pkgPath := p.stringAt(pkgPathOff) - pkgName := p.stringAt(r.uint64()) - _ = r.uint64() // package height; unused by go/types - - if pkgPath == "" { - pkgPath = path - } - items[i].Name = pkgName - items[i].Path = pkgPath - items[i].pathOffset = pkgPathOff - - // Read index for package. - nameIndex := make(map[string]uint64) - nSyms := r.uint64() - // In shallow mode, only the current package (i=0) has an index. - assert(!(shallow && i > 0 && nSyms != 0)) - for ; nSyms > 0; nSyms-- { - name := p.stringAt(r.uint64()) - nameIndex[name] = r.uint64() - } - - items[i].nameIndex = nameIndex - } - - // Request packages all at once from the client, - // enabling a parallel implementation. - if err := getPackages(items); err != nil { - return nil, err // don't wrap this error - } - - // Check the results and complete the index. - pkgList := make([]*types.Package, len(items)) - for i, item := range items { - pkg := item.Pkg - if pkg == nil { - errorf("internal error: getPackages returned nil package for %q", item.Path) - } else if pkg.Path() != item.Path { - errorf("internal error: getPackages returned wrong path %q, want %q", pkg.Path(), item.Path) - } else if pkg.Name() != item.Name { - errorf("internal error: getPackages returned wrong name %s for package %q, want %s", pkg.Name(), item.Path, item.Name) - } - p.pkgCache[item.pathOffset] = pkg - p.pkgIndex[pkg] = item.nameIndex - pkgList[i] = pkg - } - - if bundle { - pkgs = make([]*types.Package, r.uint64()) - for i := range pkgs { - pkg := p.pkgAt(r.uint64()) - imps := make([]*types.Package, r.uint64()) - for j := range imps { - imps[j] = p.pkgAt(r.uint64()) - } - pkg.SetImports(imps) - pkgs[i] = pkg - } - } else { - if len(pkgList) == 0 { - errorf("no packages found for %s", path) - panic("unreachable") - } - pkgs = pkgList[:1] - - // record all referenced packages as imports - list := append(([]*types.Package)(nil), pkgList[1:]...) - sort.Sort(byPath(list)) - pkgs[0].SetImports(list) - } - - for _, pkg := range pkgs { - if pkg.Complete() { - continue - } - - names := make([]string, 0, len(p.pkgIndex[pkg])) - for name := range p.pkgIndex[pkg] { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - p.doDecl(pkg, name) - } - - // package was imported completely and without errors - pkg.MarkComplete() - } - - // SetConstraint can't be called if the constraint type is not yet complete. - // When type params are created in the 'P' case of (*importReader).obj(), - // the associated constraint type may not be complete due to recursion. - // Therefore, we defer calling SetConstraint there, and call it here instead - // after all types are complete. - for _, d := range p.later { - typeparams.SetTypeParamConstraint(d.t, d.constraint) - } - - for _, typ := range p.interfaceList { - typ.Complete() - } - - // Workaround for golang/go#61561. See the doc for instanceList for details. - for _, typ := range p.instanceList { - if iface, _ := typ.Underlying().(*types.Interface); iface != nil { - iface.Complete() - } - } - - return pkgs, nil -} - -type setConstraintArgs struct { - t *typeparams.TypeParam - constraint types.Type -} - -type iimporter struct { - version int - ipath string - - shallow bool - reportf ReportFunc // if non-nil, used to report bugs - - stringData []byte - stringCache map[uint64]string - fileOffset []uint64 // fileOffset[i] is offset in fileData for info about file encoded as i - fileData []byte - fileCache []*token.File // memoized decoding of file encoded as i - pkgCache map[uint64]*types.Package - - declData []byte - pkgIndex map[*types.Package]map[string]uint64 - typCache map[uint64]types.Type - tparamIndex map[ident]types.Type - - fake fakeFileSet - interfaceList []*types.Interface - - // Workaround for the go/types bug golang/go#61561: instances produced during - // instantiation may contain incomplete interfaces. Here we only complete the - // underlying type of the instance, which is the most common case but doesn't - // handle parameterized interface literals defined deeper in the type. - instanceList []types.Type // instances for later completion (see golang/go#61561) - - // Arguments for calls to SetConstraint that are deferred due to recursive types - later []setConstraintArgs - - indent int // for tracing support -} - -func (p *iimporter) trace(format string, args ...interface{}) { - if !trace { - // Call sites should also be guarded, but having this check here allows - // easily enabling/disabling debug trace statements. - return - } - fmt.Printf(strings.Repeat("..", p.indent)+format+"\n", args...) -} - -func (p *iimporter) doDecl(pkg *types.Package, name string) { - if debug { - p.trace("import decl %s", name) - p.indent++ - defer func() { - p.indent-- - p.trace("=> %s", name) - }() - } - // See if we've already imported this declaration. - if obj := pkg.Scope().Lookup(name); obj != nil { - return - } - - off, ok := p.pkgIndex[pkg][name] - if !ok { - // In deep mode, the index should be complete. In shallow - // mode, we should have already recursively loaded necessary - // dependencies so the above Lookup succeeds. - errorf("%v.%v not in index", pkg, name) - } - - r := &importReader{p: p, currPkg: pkg} - r.declReader.Reset(p.declData[off:]) - - r.obj(name) -} - -func (p *iimporter) stringAt(off uint64) string { - if s, ok := p.stringCache[off]; ok { - return s - } - - slen, n := binary.Uvarint(p.stringData[off:]) - if n <= 0 { - errorf("varint failed") - } - spos := off + uint64(n) - s := string(p.stringData[spos : spos+slen]) - p.stringCache[off] = s - return s -} - -func (p *iimporter) fileAt(index uint64) *token.File { - file := p.fileCache[index] - if file == nil { - off := p.fileOffset[index] - file = p.decodeFile(intReader{bytes.NewReader(p.fileData[off:]), p.ipath}) - p.fileCache[index] = file - } - return file -} - -func (p *iimporter) decodeFile(rd intReader) *token.File { - filename := p.stringAt(rd.uint64()) - size := int(rd.uint64()) - file := p.fake.fset.AddFile(filename, -1, size) - - // SetLines requires a nondecreasing sequence. - // Because it is common for clients to derive the interval - // [start, start+len(name)] from a start position, and we - // want to ensure that the end offset is on the same line, - // we fill in the gaps of the sparse encoding with values - // that strictly increase by the largest possible amount. - // This allows us to avoid having to record the actual end - // offset of each needed line. - - lines := make([]int, int(rd.uint64())) - var index, offset int - for i, n := 0, int(rd.uint64()); i < n; i++ { - index += int(rd.uint64()) - offset += int(rd.uint64()) - lines[index] = offset - - // Ensure monotonicity between points. - for j := index - 1; j > 0 && lines[j] == 0; j-- { - lines[j] = lines[j+1] - 1 - } - } - - // Ensure monotonicity after last point. - for j := len(lines) - 1; j > 0 && lines[j] == 0; j-- { - size-- - lines[j] = size - } - - if !file.SetLines(lines) { - errorf("SetLines failed: %d", lines) // can't happen - } - return file -} - -func (p *iimporter) pkgAt(off uint64) *types.Package { - if pkg, ok := p.pkgCache[off]; ok { - return pkg - } - path := p.stringAt(off) - errorf("missing package %q in %q", path, p.ipath) - return nil -} - -func (p *iimporter) typAt(off uint64, base *types.Named) types.Type { - if t, ok := p.typCache[off]; ok && canReuse(base, t) { - return t - } - - if off < predeclReserved { - errorf("predeclared type missing from cache: %v", off) - } - - r := &importReader{p: p} - r.declReader.Reset(p.declData[off-predeclReserved:]) - t := r.doType(base) - - if canReuse(base, t) { - p.typCache[off] = t - } - return t -} - -// canReuse reports whether the type rhs on the RHS of the declaration for def -// may be re-used. -// -// Specifically, if def is non-nil and rhs is an interface type with methods, it -// may not be re-used because we have a convention of setting the receiver type -// for interface methods to def. -func canReuse(def *types.Named, rhs types.Type) bool { - if def == nil { - return true - } - iface, _ := rhs.(*types.Interface) - if iface == nil { - return true - } - // Don't use iface.Empty() here as iface may not be complete. - return iface.NumEmbeddeds() == 0 && iface.NumExplicitMethods() == 0 -} - -type importReader struct { - p *iimporter - declReader bytes.Reader - currPkg *types.Package - prevFile string - prevLine int64 - prevColumn int64 -} - -func (r *importReader) obj(name string) { - tag := r.byte() - pos := r.pos() - - switch tag { - case 'A': - typ := r.typ() - - r.declare(types.NewTypeName(pos, r.currPkg, name, typ)) - - case 'C': - typ, val := r.value() - - r.declare(types.NewConst(pos, r.currPkg, name, typ, val)) - - case 'F', 'G': - var tparams []*typeparams.TypeParam - if tag == 'G' { - tparams = r.tparamList() - } - sig := r.signature(nil, nil, tparams) - r.declare(types.NewFunc(pos, r.currPkg, name, sig)) - - case 'T', 'U': - // Types can be recursive. We need to setup a stub - // declaration before recursing. - obj := types.NewTypeName(pos, r.currPkg, name, nil) - named := types.NewNamed(obj, nil, nil) - // Declare obj before calling r.tparamList, so the new type name is recognized - // if used in the constraint of one of its own typeparams (see #48280). - r.declare(obj) - if tag == 'U' { - tparams := r.tparamList() - typeparams.SetForNamed(named, tparams) - } - - underlying := r.p.typAt(r.uint64(), named).Underlying() - named.SetUnderlying(underlying) - - if !isInterface(underlying) { - for n := r.uint64(); n > 0; n-- { - mpos := r.pos() - mname := r.ident() - recv := r.param() - - // If the receiver has any targs, set those as the - // rparams of the method (since those are the - // typeparams being used in the method sig/body). - base := baseType(recv.Type()) - assert(base != nil) - targs := typeparams.NamedTypeArgs(base) - var rparams []*typeparams.TypeParam - if targs.Len() > 0 { - rparams = make([]*typeparams.TypeParam, targs.Len()) - for i := range rparams { - rparams[i] = targs.At(i).(*typeparams.TypeParam) - } - } - msig := r.signature(recv, rparams, nil) - - named.AddMethod(types.NewFunc(mpos, r.currPkg, mname, msig)) - } - } - - case 'P': - // We need to "declare" a typeparam in order to have a name that - // can be referenced recursively (if needed) in the type param's - // bound. - if r.p.version < iexportVersionGenerics { - errorf("unexpected type param type") - } - name0 := tparamName(name) - tn := types.NewTypeName(pos, r.currPkg, name0, nil) - t := typeparams.NewTypeParam(tn, nil) - - // To handle recursive references to the typeparam within its - // bound, save the partial type in tparamIndex before reading the bounds. - id := ident{r.currPkg, name} - r.p.tparamIndex[id] = t - var implicit bool - if r.p.version >= iexportVersionGo1_18 { - implicit = r.bool() - } - constraint := r.typ() - if implicit { - iface, _ := constraint.(*types.Interface) - if iface == nil { - errorf("non-interface constraint marked implicit") - } - typeparams.MarkImplicit(iface) - } - // The constraint type may not be complete, if we - // are in the middle of a type recursion involving type - // constraints. So, we defer SetConstraint until we have - // completely set up all types in ImportData. - r.p.later = append(r.p.later, setConstraintArgs{t: t, constraint: constraint}) - - case 'V': - typ := r.typ() - - r.declare(types.NewVar(pos, r.currPkg, name, typ)) - - default: - errorf("unexpected tag: %v", tag) - } -} - -func (r *importReader) declare(obj types.Object) { - obj.Pkg().Scope().Insert(obj) -} - -func (r *importReader) value() (typ types.Type, val constant.Value) { - typ = r.typ() - if r.p.version >= iexportVersionGo1_18 { - // TODO: add support for using the kind. - _ = constant.Kind(r.int64()) - } - - switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { - case types.IsBoolean: - val = constant.MakeBool(r.bool()) - - case types.IsString: - val = constant.MakeString(r.string()) - - case types.IsInteger: - var x big.Int - r.mpint(&x, b) - val = constant.Make(&x) - - case types.IsFloat: - val = r.mpfloat(b) - - case types.IsComplex: - re := r.mpfloat(b) - im := r.mpfloat(b) - val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im)) - - default: - if b.Kind() == types.Invalid { - val = constant.MakeUnknown() - return - } - errorf("unexpected type %v", typ) // panics - panic("unreachable") - } - - return -} - -func intSize(b *types.Basic) (signed bool, maxBytes uint) { - if (b.Info() & types.IsUntyped) != 0 { - return true, 64 - } - - switch b.Kind() { - case types.Float32, types.Complex64: - return true, 3 - case types.Float64, types.Complex128: - return true, 7 - } - - signed = (b.Info() & types.IsUnsigned) == 0 - switch b.Kind() { - case types.Int8, types.Uint8: - maxBytes = 1 - case types.Int16, types.Uint16: - maxBytes = 2 - case types.Int32, types.Uint32: - maxBytes = 4 - default: - maxBytes = 8 - } - - return -} - -func (r *importReader) mpint(x *big.Int, typ *types.Basic) { - signed, maxBytes := intSize(typ) - - maxSmall := 256 - maxBytes - if signed { - maxSmall = 256 - 2*maxBytes - } - if maxBytes == 1 { - maxSmall = 256 - } - - n, _ := r.declReader.ReadByte() - if uint(n) < maxSmall { - v := int64(n) - if signed { - v >>= 1 - if n&1 != 0 { - v = ^v - } - } - x.SetInt64(v) - return - } - - v := -n - if signed { - v = -(n &^ 1) >> 1 - } - if v < 1 || uint(v) > maxBytes { - errorf("weird decoding: %v, %v => %v", n, signed, v) - } - b := make([]byte, v) - io.ReadFull(&r.declReader, b) - x.SetBytes(b) - if signed && n&1 != 0 { - x.Neg(x) - } -} - -func (r *importReader) mpfloat(typ *types.Basic) constant.Value { - var mant big.Int - r.mpint(&mant, typ) - var f big.Float - f.SetInt(&mant) - if f.Sign() != 0 { - f.SetMantExp(&f, int(r.int64())) - } - return constant.Make(&f) -} - -func (r *importReader) ident() string { - return r.string() -} - -func (r *importReader) qualifiedIdent() (*types.Package, string) { - name := r.string() - pkg := r.pkg() - return pkg, name -} - -func (r *importReader) pos() token.Pos { - if r.p.shallow { - // precise offsets are encoded only in shallow mode - return r.posv2() - } - if r.p.version >= iexportVersionPosCol { - r.posv1() - } else { - r.posv0() - } - - if r.prevFile == "" && r.prevLine == 0 && r.prevColumn == 0 { - return token.NoPos - } - return r.p.fake.pos(r.prevFile, int(r.prevLine), int(r.prevColumn)) -} - -func (r *importReader) posv0() { - delta := r.int64() - if delta != deltaNewFile { - r.prevLine += delta - } else if l := r.int64(); l == -1 { - r.prevLine += deltaNewFile - } else { - r.prevFile = r.string() - r.prevLine = l - } -} - -func (r *importReader) posv1() { - delta := r.int64() - r.prevColumn += delta >> 1 - if delta&1 != 0 { - delta = r.int64() - r.prevLine += delta >> 1 - if delta&1 != 0 { - r.prevFile = r.string() - } - } -} - -func (r *importReader) posv2() token.Pos { - file := r.uint64() - if file == 0 { - return token.NoPos - } - tf := r.p.fileAt(file - 1) - return tf.Pos(int(r.uint64())) -} - -func (r *importReader) typ() types.Type { - return r.p.typAt(r.uint64(), nil) -} - -func isInterface(t types.Type) bool { - _, ok := t.(*types.Interface) - return ok -} - -func (r *importReader) pkg() *types.Package { return r.p.pkgAt(r.uint64()) } -func (r *importReader) string() string { return r.p.stringAt(r.uint64()) } - -func (r *importReader) doType(base *types.Named) (res types.Type) { - k := r.kind() - if debug { - r.p.trace("importing type %d (base: %s)", k, base) - r.p.indent++ - defer func() { - r.p.indent-- - r.p.trace("=> %s", res) - }() - } - switch k { - default: - errorf("unexpected kind tag in %q: %v", r.p.ipath, k) - return nil - - case definedType: - pkg, name := r.qualifiedIdent() - r.p.doDecl(pkg, name) - return pkg.Scope().Lookup(name).(*types.TypeName).Type() - case pointerType: - return types.NewPointer(r.typ()) - case sliceType: - return types.NewSlice(r.typ()) - case arrayType: - n := r.uint64() - return types.NewArray(r.typ(), int64(n)) - case chanType: - dir := chanDir(int(r.uint64())) - return types.NewChan(dir, r.typ()) - case mapType: - return types.NewMap(r.typ(), r.typ()) - case signatureType: - r.currPkg = r.pkg() - return r.signature(nil, nil, nil) - - case structType: - r.currPkg = r.pkg() - - fields := make([]*types.Var, r.uint64()) - tags := make([]string, len(fields)) - for i := range fields { - var field *types.Var - if r.p.shallow { - field, _ = r.objectPathObject().(*types.Var) - } - - fpos := r.pos() - fname := r.ident() - ftyp := r.typ() - emb := r.bool() - tag := r.string() - - // Either this is not a shallow import, the field is local, or the - // encoded objectPath failed to produce an object (a bug). - // - // Even in this last, buggy case, fall back on creating a new field. As - // discussed in iexport.go, this is not correct, but mostly works and is - // preferable to failing (for now at least). - if field == nil { - field = types.NewField(fpos, r.currPkg, fname, ftyp, emb) - } - - fields[i] = field - tags[i] = tag - } - return types.NewStruct(fields, tags) - - case interfaceType: - r.currPkg = r.pkg() - - embeddeds := make([]types.Type, r.uint64()) - for i := range embeddeds { - _ = r.pos() - embeddeds[i] = r.typ() - } - - methods := make([]*types.Func, r.uint64()) - for i := range methods { - var method *types.Func - if r.p.shallow { - method, _ = r.objectPathObject().(*types.Func) - } - - mpos := r.pos() - mname := r.ident() - - // TODO(mdempsky): Matches bimport.go, but I - // don't agree with this. - var recv *types.Var - if base != nil { - recv = types.NewVar(token.NoPos, r.currPkg, "", base) - } - msig := r.signature(recv, nil, nil) - - if method == nil { - method = types.NewFunc(mpos, r.currPkg, mname, msig) - } - methods[i] = method - } - - typ := newInterface(methods, embeddeds) - r.p.interfaceList = append(r.p.interfaceList, typ) - return typ - - case typeParamType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected type param type") - } - pkg, name := r.qualifiedIdent() - id := ident{pkg, name} - if t, ok := r.p.tparamIndex[id]; ok { - // We're already in the process of importing this typeparam. - return t - } - // Otherwise, import the definition of the typeparam now. - r.p.doDecl(pkg, name) - return r.p.tparamIndex[id] - - case instanceType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected instantiation type") - } - // pos does not matter for instances: they are positioned on the original - // type. - _ = r.pos() - len := r.uint64() - targs := make([]types.Type, len) - for i := range targs { - targs[i] = r.typ() - } - baseType := r.typ() - // The imported instantiated type doesn't include any methods, so - // we must always use the methods of the base (orig) type. - // TODO provide a non-nil *Environment - t, _ := typeparams.Instantiate(nil, baseType, targs, false) - - // Workaround for golang/go#61561. See the doc for instanceList for details. - r.p.instanceList = append(r.p.instanceList, t) - return t - - case unionType: - if r.p.version < iexportVersionGenerics { - errorf("unexpected instantiation type") - } - terms := make([]*typeparams.Term, r.uint64()) - for i := range terms { - terms[i] = typeparams.NewTerm(r.bool(), r.typ()) - } - return typeparams.NewUnion(terms) - } -} - -func (r *importReader) kind() itag { - return itag(r.uint64()) -} - -// objectPathObject is the inverse of exportWriter.objectPath. -// -// In shallow mode, certain fields and methods may need to be looked up in an -// imported package. See the doc for exportWriter.objectPath for a full -// explanation. -func (r *importReader) objectPathObject() types.Object { - objPath := objectpath.Path(r.string()) - if objPath == "" { - return nil - } - pkg := r.pkg() - obj, err := objectpath.Object(pkg, objPath) - if err != nil { - if r.p.reportf != nil { - r.p.reportf("failed to find object for objectPath %q: %v", objPath, err) - } - } - return obj -} - -func (r *importReader) signature(recv *types.Var, rparams []*typeparams.TypeParam, tparams []*typeparams.TypeParam) *types.Signature { - params := r.paramList() - results := r.paramList() - variadic := params.Len() > 0 && r.bool() - return typeparams.NewSignatureType(recv, rparams, tparams, params, results, variadic) -} - -func (r *importReader) tparamList() []*typeparams.TypeParam { - n := r.uint64() - if n == 0 { - return nil - } - xs := make([]*typeparams.TypeParam, n) - for i := range xs { - // Note: the standard library importer is tolerant of nil types here, - // though would panic in SetTypeParams. - xs[i] = r.typ().(*typeparams.TypeParam) - } - return xs -} - -func (r *importReader) paramList() *types.Tuple { - xs := make([]*types.Var, r.uint64()) - for i := range xs { - xs[i] = r.param() - } - return types.NewTuple(xs...) -} - -func (r *importReader) param() *types.Var { - pos := r.pos() - name := r.ident() - typ := r.typ() - return types.NewParam(pos, r.currPkg, name, typ) -} - -func (r *importReader) bool() bool { - return r.uint64() != 0 -} - -func (r *importReader) int64() int64 { - n, err := binary.ReadVarint(&r.declReader) - if err != nil { - errorf("readVarint: %v", err) - } - return n -} - -func (r *importReader) uint64() uint64 { - n, err := binary.ReadUvarint(&r.declReader) - if err != nil { - errorf("readUvarint: %v", err) - } - return n -} - -func (r *importReader) byte() byte { - x, err := r.declReader.ReadByte() - if err != nil { - errorf("declReader.ReadByte: %v", err) - } - return x -} - -func baseType(typ types.Type) *types.Named { - // pointer receivers are never types.Named types - if p, _ := typ.(*types.Pointer); p != nil { - typ = p.Elem() - } - // receiver base types are always (possibly generic) types.Named types - n, _ := typ.(*types.Named) - return n -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/newInterface10.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/newInterface10.go deleted file mode 100644 index 8b163e3d058a..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/newInterface10.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.11 -// +build !go1.11 - -package gcimporter - -import "go/types" - -func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { - named := make([]*types.Named, len(embeddeds)) - for i, e := range embeddeds { - var ok bool - named[i], ok = e.(*types.Named) - if !ok { - panic("embedding of non-defined interfaces in interfaces is not supported before Go 1.11") - } - } - return types.NewInterface(methods, named) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/newInterface11.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/newInterface11.go deleted file mode 100644 index 49984f40fd80..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/newInterface11.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.11 -// +build go1.11 - -package gcimporter - -import "go/types" - -func newInterface(methods []*types.Func, embeddeds []types.Type) *types.Interface { - return types.NewInterfaceType(methods, embeddeds) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go deleted file mode 100644 index d892273efb61..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/support_go117.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.18 -// +build !go1.18 - -package gcimporter - -import "go/types" - -const iexportVersion = iexportVersionGo1_11 - -func additionalPredeclared() []types.Type { - return nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go deleted file mode 100644 index edbe6ea7041d..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/support_go118.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.18 -// +build go1.18 - -package gcimporter - -import "go/types" - -const iexportVersion = iexportVersionGenerics - -// additionalPredeclared returns additional predeclared types in go.1.18. -func additionalPredeclared() []types.Type { - return []types.Type{ - // comparable - types.Universe.Lookup("comparable").Type(), - - // any - types.Universe.Lookup("any").Type(), - } -} - -// See cmd/compile/internal/types.SplitVargenSuffix. -func splitVargenSuffix(name string) (base, suffix string) { - i := len(name) - for i > 0 && name[i-1] >= '0' && name[i-1] <= '9' { - i-- - } - const dot = "·" - if i >= len(dot) && name[i-len(dot):i] == dot { - i -= len(dot) - return name[:i], name[i:] - } - return name, "" -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go deleted file mode 100644 index 286bf445483d..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/unified_no.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !(go1.18 && goexperiment.unified) -// +build !go1.18 !goexperiment.unified - -package gcimporter - -const unifiedIR = false diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go deleted file mode 100644 index b5d69ffbe682..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/unified_yes.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.18 && goexperiment.unified -// +build go1.18,goexperiment.unified - -package gcimporter - -const unifiedIR = true diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go deleted file mode 100644 index 8eb20729c2ad..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/ureader_no.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.18 -// +build !go1.18 - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" -) - -func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - err = fmt.Errorf("go/tools compiled with a Go version earlier than 1.18 cannot read unified IR export data") - return -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go deleted file mode 100644 index b977435f626d..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go +++ /dev/null @@ -1,728 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Derived from go/internal/gcimporter/ureader.go - -//go:build go1.18 -// +build go1.18 - -package gcimporter - -import ( - "fmt" - "go/token" - "go/types" - "sort" - "strings" - - "golang.org/x/tools/internal/pkgbits" -) - -// A pkgReader holds the shared state for reading a unified IR package -// description. -type pkgReader struct { - pkgbits.PkgDecoder - - fake fakeFileSet - - ctxt *types.Context - imports map[string]*types.Package // previously imported packages, indexed by path - - // lazily initialized arrays corresponding to the unified IR - // PosBase, Pkg, and Type sections, respectively. - posBases []string // position bases (i.e., file names) - pkgs []*types.Package - typs []types.Type - - // laterFns holds functions that need to be invoked at the end of - // import reading. - laterFns []func() - // laterFors is used in case of 'type A B' to ensure that B is processed before A. - laterFors map[types.Type]int - - // ifaces holds a list of constructed Interfaces, which need to have - // Complete called after importing is done. - ifaces []*types.Interface -} - -// later adds a function to be invoked at the end of import reading. -func (pr *pkgReader) later(fn func()) { - pr.laterFns = append(pr.laterFns, fn) -} - -// See cmd/compile/internal/noder.derivedInfo. -type derivedInfo struct { - idx pkgbits.Index - needed bool -} - -// See cmd/compile/internal/noder.typeInfo. -type typeInfo struct { - idx pkgbits.Index - derived bool -} - -func UImportData(fset *token.FileSet, imports map[string]*types.Package, data []byte, path string) (_ int, pkg *types.Package, err error) { - if !debug { - defer func() { - if x := recover(); x != nil { - err = fmt.Errorf("internal error in importing %q (%v); please report an issue", path, x) - } - }() - } - - s := string(data) - s = s[:strings.LastIndex(s, "\n$$\n")] - input := pkgbits.NewPkgDecoder(path, s) - pkg = readUnifiedPackage(fset, nil, imports, input) - return -} - -// laterFor adds a function to be invoked at the end of import reading, and records the type that function is finishing. -func (pr *pkgReader) laterFor(t types.Type, fn func()) { - if pr.laterFors == nil { - pr.laterFors = make(map[types.Type]int) - } - pr.laterFors[t] = len(pr.laterFns) - pr.laterFns = append(pr.laterFns, fn) -} - -// readUnifiedPackage reads a package description from the given -// unified IR export data decoder. -func readUnifiedPackage(fset *token.FileSet, ctxt *types.Context, imports map[string]*types.Package, input pkgbits.PkgDecoder) *types.Package { - pr := pkgReader{ - PkgDecoder: input, - - fake: fakeFileSet{ - fset: fset, - files: make(map[string]*fileInfo), - }, - - ctxt: ctxt, - imports: imports, - - posBases: make([]string, input.NumElems(pkgbits.RelocPosBase)), - pkgs: make([]*types.Package, input.NumElems(pkgbits.RelocPkg)), - typs: make([]types.Type, input.NumElems(pkgbits.RelocType)), - } - defer pr.fake.setLines() - - r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic) - pkg := r.pkg() - r.Bool() // has init - - for i, n := 0, r.Len(); i < n; i++ { - // As if r.obj(), but avoiding the Scope.Lookup call, - // to avoid eager loading of imports. - r.Sync(pkgbits.SyncObject) - assert(!r.Bool()) - r.p.objIdx(r.Reloc(pkgbits.RelocObj)) - assert(r.Len() == 0) - } - - r.Sync(pkgbits.SyncEOF) - - for _, fn := range pr.laterFns { - fn() - } - - for _, iface := range pr.ifaces { - iface.Complete() - } - - // Imports() of pkg are all of the transitive packages that were loaded. - var imps []*types.Package - for _, imp := range pr.pkgs { - if imp != nil && imp != pkg { - imps = append(imps, imp) - } - } - sort.Sort(byPath(imps)) - pkg.SetImports(imps) - - pkg.MarkComplete() - return pkg -} - -// A reader holds the state for reading a single unified IR element -// within a package. -type reader struct { - pkgbits.Decoder - - p *pkgReader - - dict *readerDict -} - -// A readerDict holds the state for type parameters that parameterize -// the current unified IR element. -type readerDict struct { - // bounds is a slice of typeInfos corresponding to the underlying - // bounds of the element's type parameters. - bounds []typeInfo - - // tparams is a slice of the constructed TypeParams for the element. - tparams []*types.TypeParam - - // devived is a slice of types derived from tparams, which may be - // instantiated while reading the current element. - derived []derivedInfo - derivedTypes []types.Type // lazily instantiated from derived -} - -func (pr *pkgReader) newReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader { - return &reader{ - Decoder: pr.NewDecoder(k, idx, marker), - p: pr, - } -} - -func (pr *pkgReader) tempReader(k pkgbits.RelocKind, idx pkgbits.Index, marker pkgbits.SyncMarker) *reader { - return &reader{ - Decoder: pr.TempDecoder(k, idx, marker), - p: pr, - } -} - -func (pr *pkgReader) retireReader(r *reader) { - pr.RetireDecoder(&r.Decoder) -} - -// @@@ Positions - -func (r *reader) pos() token.Pos { - r.Sync(pkgbits.SyncPos) - if !r.Bool() { - return token.NoPos - } - - // TODO(mdempsky): Delta encoding. - posBase := r.posBase() - line := r.Uint() - col := r.Uint() - return r.p.fake.pos(posBase, int(line), int(col)) -} - -func (r *reader) posBase() string { - return r.p.posBaseIdx(r.Reloc(pkgbits.RelocPosBase)) -} - -func (pr *pkgReader) posBaseIdx(idx pkgbits.Index) string { - if b := pr.posBases[idx]; b != "" { - return b - } - - var filename string - { - r := pr.tempReader(pkgbits.RelocPosBase, idx, pkgbits.SyncPosBase) - - // Within types2, position bases have a lot more details (e.g., - // keeping track of where //line directives appeared exactly). - // - // For go/types, we just track the file name. - - filename = r.String() - - if r.Bool() { // file base - // Was: "b = token.NewTrimmedFileBase(filename, true)" - } else { // line base - pos := r.pos() - line := r.Uint() - col := r.Uint() - - // Was: "b = token.NewLineBase(pos, filename, true, line, col)" - _, _, _ = pos, line, col - } - pr.retireReader(r) - } - b := filename - pr.posBases[idx] = b - return b -} - -// @@@ Packages - -func (r *reader) pkg() *types.Package { - r.Sync(pkgbits.SyncPkg) - return r.p.pkgIdx(r.Reloc(pkgbits.RelocPkg)) -} - -func (pr *pkgReader) pkgIdx(idx pkgbits.Index) *types.Package { - // TODO(mdempsky): Consider using some non-nil pointer to indicate - // the universe scope, so we don't need to keep re-reading it. - if pkg := pr.pkgs[idx]; pkg != nil { - return pkg - } - - pkg := pr.newReader(pkgbits.RelocPkg, idx, pkgbits.SyncPkgDef).doPkg() - pr.pkgs[idx] = pkg - return pkg -} - -func (r *reader) doPkg() *types.Package { - path := r.String() - switch path { - case "": - path = r.p.PkgPath() - case "builtin": - return nil // universe - case "unsafe": - return types.Unsafe - } - - if pkg := r.p.imports[path]; pkg != nil { - return pkg - } - - name := r.String() - - pkg := types.NewPackage(path, name) - r.p.imports[path] = pkg - - return pkg -} - -// @@@ Types - -func (r *reader) typ() types.Type { - return r.p.typIdx(r.typInfo(), r.dict) -} - -func (r *reader) typInfo() typeInfo { - r.Sync(pkgbits.SyncType) - if r.Bool() { - return typeInfo{idx: pkgbits.Index(r.Len()), derived: true} - } - return typeInfo{idx: r.Reloc(pkgbits.RelocType), derived: false} -} - -func (pr *pkgReader) typIdx(info typeInfo, dict *readerDict) types.Type { - idx := info.idx - var where *types.Type - if info.derived { - where = &dict.derivedTypes[idx] - idx = dict.derived[idx].idx - } else { - where = &pr.typs[idx] - } - - if typ := *where; typ != nil { - return typ - } - - var typ types.Type - { - r := pr.tempReader(pkgbits.RelocType, idx, pkgbits.SyncTypeIdx) - r.dict = dict - - typ = r.doTyp() - assert(typ != nil) - pr.retireReader(r) - } - // See comment in pkgReader.typIdx explaining how this happens. - if prev := *where; prev != nil { - return prev - } - - *where = typ - return typ -} - -func (r *reader) doTyp() (res types.Type) { - switch tag := pkgbits.CodeType(r.Code(pkgbits.SyncType)); tag { - default: - errorf("unhandled type tag: %v", tag) - panic("unreachable") - - case pkgbits.TypeBasic: - return types.Typ[r.Len()] - - case pkgbits.TypeNamed: - obj, targs := r.obj() - name := obj.(*types.TypeName) - if len(targs) != 0 { - t, _ := types.Instantiate(r.p.ctxt, name.Type(), targs, false) - return t - } - return name.Type() - - case pkgbits.TypeTypeParam: - return r.dict.tparams[r.Len()] - - case pkgbits.TypeArray: - len := int64(r.Uint64()) - return types.NewArray(r.typ(), len) - case pkgbits.TypeChan: - dir := types.ChanDir(r.Len()) - return types.NewChan(dir, r.typ()) - case pkgbits.TypeMap: - return types.NewMap(r.typ(), r.typ()) - case pkgbits.TypePointer: - return types.NewPointer(r.typ()) - case pkgbits.TypeSignature: - return r.signature(nil, nil, nil) - case pkgbits.TypeSlice: - return types.NewSlice(r.typ()) - case pkgbits.TypeStruct: - return r.structType() - case pkgbits.TypeInterface: - return r.interfaceType() - case pkgbits.TypeUnion: - return r.unionType() - } -} - -func (r *reader) structType() *types.Struct { - fields := make([]*types.Var, r.Len()) - var tags []string - for i := range fields { - pos := r.pos() - pkg, name := r.selector() - ftyp := r.typ() - tag := r.String() - embedded := r.Bool() - - fields[i] = types.NewField(pos, pkg, name, ftyp, embedded) - if tag != "" { - for len(tags) < i { - tags = append(tags, "") - } - tags = append(tags, tag) - } - } - return types.NewStruct(fields, tags) -} - -func (r *reader) unionType() *types.Union { - terms := make([]*types.Term, r.Len()) - for i := range terms { - terms[i] = types.NewTerm(r.Bool(), r.typ()) - } - return types.NewUnion(terms) -} - -func (r *reader) interfaceType() *types.Interface { - methods := make([]*types.Func, r.Len()) - embeddeds := make([]types.Type, r.Len()) - implicit := len(methods) == 0 && len(embeddeds) == 1 && r.Bool() - - for i := range methods { - pos := r.pos() - pkg, name := r.selector() - mtyp := r.signature(nil, nil, nil) - methods[i] = types.NewFunc(pos, pkg, name, mtyp) - } - - for i := range embeddeds { - embeddeds[i] = r.typ() - } - - iface := types.NewInterfaceType(methods, embeddeds) - if implicit { - iface.MarkImplicit() - } - - // We need to call iface.Complete(), but if there are any embedded - // defined types, then we may not have set their underlying - // interface type yet. So we need to defer calling Complete until - // after we've called SetUnderlying everywhere. - // - // TODO(mdempsky): After CL 424876 lands, it should be safe to call - // iface.Complete() immediately. - r.p.ifaces = append(r.p.ifaces, iface) - - return iface -} - -func (r *reader) signature(recv *types.Var, rtparams, tparams []*types.TypeParam) *types.Signature { - r.Sync(pkgbits.SyncSignature) - - params := r.params() - results := r.params() - variadic := r.Bool() - - return types.NewSignatureType(recv, rtparams, tparams, params, results, variadic) -} - -func (r *reader) params() *types.Tuple { - r.Sync(pkgbits.SyncParams) - - params := make([]*types.Var, r.Len()) - for i := range params { - params[i] = r.param() - } - - return types.NewTuple(params...) -} - -func (r *reader) param() *types.Var { - r.Sync(pkgbits.SyncParam) - - pos := r.pos() - pkg, name := r.localIdent() - typ := r.typ() - - return types.NewParam(pos, pkg, name, typ) -} - -// @@@ Objects - -func (r *reader) obj() (types.Object, []types.Type) { - r.Sync(pkgbits.SyncObject) - - assert(!r.Bool()) - - pkg, name := r.p.objIdx(r.Reloc(pkgbits.RelocObj)) - obj := pkgScope(pkg).Lookup(name) - - targs := make([]types.Type, r.Len()) - for i := range targs { - targs[i] = r.typ() - } - - return obj, targs -} - -func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { - - var objPkg *types.Package - var objName string - var tag pkgbits.CodeObj - { - rname := pr.tempReader(pkgbits.RelocName, idx, pkgbits.SyncObject1) - - objPkg, objName = rname.qualifiedIdent() - assert(objName != "") - - tag = pkgbits.CodeObj(rname.Code(pkgbits.SyncCodeObj)) - pr.retireReader(rname) - } - - if tag == pkgbits.ObjStub { - assert(objPkg == nil || objPkg == types.Unsafe) - return objPkg, objName - } - - // Ignore local types promoted to global scope (#55110). - if _, suffix := splitVargenSuffix(objName); suffix != "" { - return objPkg, objName - } - - if objPkg.Scope().Lookup(objName) == nil { - dict := pr.objDictIdx(idx) - - r := pr.newReader(pkgbits.RelocObj, idx, pkgbits.SyncObject1) - r.dict = dict - - declare := func(obj types.Object) { - objPkg.Scope().Insert(obj) - } - - switch tag { - default: - panic("weird") - - case pkgbits.ObjAlias: - pos := r.pos() - typ := r.typ() - declare(types.NewTypeName(pos, objPkg, objName, typ)) - - case pkgbits.ObjConst: - pos := r.pos() - typ := r.typ() - val := r.Value() - declare(types.NewConst(pos, objPkg, objName, typ, val)) - - case pkgbits.ObjFunc: - pos := r.pos() - tparams := r.typeParamNames() - sig := r.signature(nil, nil, tparams) - declare(types.NewFunc(pos, objPkg, objName, sig)) - - case pkgbits.ObjType: - pos := r.pos() - - obj := types.NewTypeName(pos, objPkg, objName, nil) - named := types.NewNamed(obj, nil, nil) - declare(obj) - - named.SetTypeParams(r.typeParamNames()) - - setUnderlying := func(underlying types.Type) { - // If the underlying type is an interface, we need to - // duplicate its methods so we can replace the receiver - // parameter's type (#49906). - if iface, ok := underlying.(*types.Interface); ok && iface.NumExplicitMethods() != 0 { - methods := make([]*types.Func, iface.NumExplicitMethods()) - for i := range methods { - fn := iface.ExplicitMethod(i) - sig := fn.Type().(*types.Signature) - - recv := types.NewVar(fn.Pos(), fn.Pkg(), "", named) - methods[i] = types.NewFunc(fn.Pos(), fn.Pkg(), fn.Name(), types.NewSignature(recv, sig.Params(), sig.Results(), sig.Variadic())) - } - - embeds := make([]types.Type, iface.NumEmbeddeds()) - for i := range embeds { - embeds[i] = iface.EmbeddedType(i) - } - - newIface := types.NewInterfaceType(methods, embeds) - r.p.ifaces = append(r.p.ifaces, newIface) - underlying = newIface - } - - named.SetUnderlying(underlying) - } - - // Since go.dev/cl/455279, we can assume rhs.Underlying() will - // always be non-nil. However, to temporarily support users of - // older snapshot releases, we continue to fallback to the old - // behavior for now. - // - // TODO(mdempsky): Remove fallback code and simplify after - // allowing time for snapshot users to upgrade. - rhs := r.typ() - if underlying := rhs.Underlying(); underlying != nil { - setUnderlying(underlying) - } else { - pk := r.p - pk.laterFor(named, func() { - // First be sure that the rhs is initialized, if it needs to be initialized. - delete(pk.laterFors, named) // prevent cycles - if i, ok := pk.laterFors[rhs]; ok { - f := pk.laterFns[i] - pk.laterFns[i] = func() {} // function is running now, so replace it with a no-op - f() // initialize RHS - } - setUnderlying(rhs.Underlying()) - }) - } - - for i, n := 0, r.Len(); i < n; i++ { - named.AddMethod(r.method()) - } - - case pkgbits.ObjVar: - pos := r.pos() - typ := r.typ() - declare(types.NewVar(pos, objPkg, objName, typ)) - } - } - - return objPkg, objName -} - -func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDict { - - var dict readerDict - - { - r := pr.tempReader(pkgbits.RelocObjDict, idx, pkgbits.SyncObject1) - if implicits := r.Len(); implicits != 0 { - errorf("unexpected object with %v implicit type parameter(s)", implicits) - } - - dict.bounds = make([]typeInfo, r.Len()) - for i := range dict.bounds { - dict.bounds[i] = r.typInfo() - } - - dict.derived = make([]derivedInfo, r.Len()) - dict.derivedTypes = make([]types.Type, len(dict.derived)) - for i := range dict.derived { - dict.derived[i] = derivedInfo{r.Reloc(pkgbits.RelocType), r.Bool()} - } - - pr.retireReader(r) - } - // function references follow, but reader doesn't need those - - return &dict -} - -func (r *reader) typeParamNames() []*types.TypeParam { - r.Sync(pkgbits.SyncTypeParamNames) - - // Note: This code assumes it only processes objects without - // implement type parameters. This is currently fine, because - // reader is only used to read in exported declarations, which are - // always package scoped. - - if len(r.dict.bounds) == 0 { - return nil - } - - // Careful: Type parameter lists may have cycles. To allow for this, - // we construct the type parameter list in two passes: first we - // create all the TypeNames and TypeParams, then we construct and - // set the bound type. - - r.dict.tparams = make([]*types.TypeParam, len(r.dict.bounds)) - for i := range r.dict.bounds { - pos := r.pos() - pkg, name := r.localIdent() - - tname := types.NewTypeName(pos, pkg, name, nil) - r.dict.tparams[i] = types.NewTypeParam(tname, nil) - } - - typs := make([]types.Type, len(r.dict.bounds)) - for i, bound := range r.dict.bounds { - typs[i] = r.p.typIdx(bound, r.dict) - } - - // TODO(mdempsky): This is subtle, elaborate further. - // - // We have to save tparams outside of the closure, because - // typeParamNames() can be called multiple times with the same - // dictionary instance. - // - // Also, this needs to happen later to make sure SetUnderlying has - // been called. - // - // TODO(mdempsky): Is it safe to have a single "later" slice or do - // we need to have multiple passes? See comments on CL 386002 and - // go.dev/issue/52104. - tparams := r.dict.tparams - r.p.later(func() { - for i, typ := range typs { - tparams[i].SetConstraint(typ) - } - }) - - return r.dict.tparams -} - -func (r *reader) method() *types.Func { - r.Sync(pkgbits.SyncMethod) - pos := r.pos() - pkg, name := r.selector() - - rparams := r.typeParamNames() - sig := r.signature(r.param(), rparams, nil) - - _ = r.pos() // TODO(mdempsky): Remove; this is a hacker for linker.go. - return types.NewFunc(pos, pkg, name, sig) -} - -func (r *reader) qualifiedIdent() (*types.Package, string) { return r.ident(pkgbits.SyncSym) } -func (r *reader) localIdent() (*types.Package, string) { return r.ident(pkgbits.SyncLocalIdent) } -func (r *reader) selector() (*types.Package, string) { return r.ident(pkgbits.SyncSelector) } - -func (r *reader) ident(marker pkgbits.SyncMarker) (*types.Package, string) { - r.Sync(marker) - return r.pkg(), r.String() -} - -// pkgScope returns pkg.Scope(). -// If pkg is nil, it returns types.Universe instead. -// -// TODO(mdempsky): Remove after x/tools can depend on Go 1.19. -func pkgScope(pkg *types.Package) *types.Scope { - if pkg != nil { - return pkg.Scope() - } - return types.Universe -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/invoke.go deleted file mode 100644 index 53cf66da0193..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gocommand is a helper for calling the go command. -package gocommand - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "log" - "os" - "reflect" - "regexp" - "runtime" - "strconv" - "strings" - "sync" - "time" - - exec "golang.org/x/sys/execabs" - - "golang.org/x/tools/internal/event" - "golang.org/x/tools/internal/event/keys" - "golang.org/x/tools/internal/event/label" - "golang.org/x/tools/internal/event/tag" -) - -// An Runner will run go command invocations and serialize -// them if it sees a concurrency error. -type Runner struct { - // once guards the runner initialization. - once sync.Once - - // inFlight tracks available workers. - inFlight chan struct{} - - // serialized guards the ability to run a go command serially, - // to avoid deadlocks when claiming workers. - serialized chan struct{} -} - -const maxInFlight = 10 - -func (runner *Runner) initialize() { - runner.once.Do(func() { - runner.inFlight = make(chan struct{}, maxInFlight) - runner.serialized = make(chan struct{}, 1) - }) -} - -// 1.13: go: updates to go.mod needed, but contents have changed -// 1.14: go: updating go.mod: existing contents have changed since last read -var modConcurrencyError = regexp.MustCompile(`go:.*go.mod.*contents have changed`) - -// verb is an event label for the go command verb. -var verb = keys.NewString("verb", "go command verb") - -func invLabels(inv Invocation) []label.Label { - return []label.Label{verb.Of(inv.Verb), tag.Directory.Of(inv.WorkingDir)} -} - -// Run is a convenience wrapper around RunRaw. -// It returns only stdout and a "friendly" error. -func (runner *Runner) Run(ctx context.Context, inv Invocation) (*bytes.Buffer, error) { - ctx, done := event.Start(ctx, "gocommand.Runner.Run", invLabels(inv)...) - defer done() - - stdout, _, friendly, _ := runner.RunRaw(ctx, inv) - return stdout, friendly -} - -// RunPiped runs the invocation serially, always waiting for any concurrent -// invocations to complete first. -func (runner *Runner) RunPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) error { - ctx, done := event.Start(ctx, "gocommand.Runner.RunPiped", invLabels(inv)...) - defer done() - - _, err := runner.runPiped(ctx, inv, stdout, stderr) - return err -} - -// RunRaw runs the invocation, serializing requests only if they fight over -// go.mod changes. -func (runner *Runner) RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - ctx, done := event.Start(ctx, "gocommand.Runner.RunRaw", invLabels(inv)...) - defer done() - // Make sure the runner is always initialized. - runner.initialize() - - // First, try to run the go command concurrently. - stdout, stderr, friendlyErr, err := runner.runConcurrent(ctx, inv) - - // If we encounter a load concurrency error, we need to retry serially. - if friendlyErr == nil || !modConcurrencyError.MatchString(friendlyErr.Error()) { - return stdout, stderr, friendlyErr, err - } - event.Error(ctx, "Load concurrency error, will retry serially", err) - - // Run serially by calling runPiped. - stdout.Reset() - stderr.Reset() - friendlyErr, err = runner.runPiped(ctx, inv, stdout, stderr) - return stdout, stderr, friendlyErr, err -} - -func (runner *Runner) runConcurrent(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) { - // Wait for 1 worker to become available. - select { - case <-ctx.Done(): - return nil, nil, nil, ctx.Err() - case runner.inFlight <- struct{}{}: - defer func() { <-runner.inFlight }() - } - - stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{} - friendlyErr, err := inv.runWithFriendlyError(ctx, stdout, stderr) - return stdout, stderr, friendlyErr, err -} - -func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) (error, error) { - // Make sure the runner is always initialized. - runner.initialize() - - // Acquire the serialization lock. This avoids deadlocks between two - // runPiped commands. - select { - case <-ctx.Done(): - return nil, ctx.Err() - case runner.serialized <- struct{}{}: - defer func() { <-runner.serialized }() - } - - // Wait for all in-progress go commands to return before proceeding, - // to avoid load concurrency errors. - for i := 0; i < maxInFlight; i++ { - select { - case <-ctx.Done(): - return nil, ctx.Err() - case runner.inFlight <- struct{}{}: - // Make sure we always "return" any workers we took. - defer func() { <-runner.inFlight }() - } - } - - return inv.runWithFriendlyError(ctx, stdout, stderr) -} - -// An Invocation represents a call to the go command. -type Invocation struct { - Verb string - Args []string - BuildFlags []string - - // If ModFlag is set, the go command is invoked with -mod=ModFlag. - ModFlag string - - // If ModFile is set, the go command is invoked with -modfile=ModFile. - ModFile string - - // If Overlay is set, the go command is invoked with -overlay=Overlay. - Overlay string - - // If CleanEnv is set, the invocation will run only with the environment - // in Env, not starting with os.Environ. - CleanEnv bool - Env []string - WorkingDir string - Logf func(format string, args ...interface{}) -} - -func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io.Writer) (friendlyError error, rawError error) { - rawError = i.run(ctx, stdout, stderr) - if rawError != nil { - friendlyError = rawError - // Check for 'go' executable not being found. - if ee, ok := rawError.(*exec.Error); ok && ee.Err == exec.ErrNotFound { - friendlyError = fmt.Errorf("go command required, not found: %v", ee) - } - if ctx.Err() != nil { - friendlyError = ctx.Err() - } - friendlyError = fmt.Errorf("err: %v: stderr: %s", friendlyError, stderr) - } - return -} - -func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { - log := i.Logf - if log == nil { - log = func(string, ...interface{}) {} - } - - goArgs := []string{i.Verb} - - appendModFile := func() { - if i.ModFile != "" { - goArgs = append(goArgs, "-modfile="+i.ModFile) - } - } - appendModFlag := func() { - if i.ModFlag != "" { - goArgs = append(goArgs, "-mod="+i.ModFlag) - } - } - appendOverlayFlag := func() { - if i.Overlay != "" { - goArgs = append(goArgs, "-overlay="+i.Overlay) - } - } - - switch i.Verb { - case "env", "version": - goArgs = append(goArgs, i.Args...) - case "mod": - // mod needs the sub-verb before flags. - goArgs = append(goArgs, i.Args[0]) - appendModFile() - goArgs = append(goArgs, i.Args[1:]...) - case "get": - goArgs = append(goArgs, i.BuildFlags...) - appendModFile() - goArgs = append(goArgs, i.Args...) - - default: // notably list and build. - goArgs = append(goArgs, i.BuildFlags...) - appendModFile() - appendModFlag() - appendOverlayFlag() - goArgs = append(goArgs, i.Args...) - } - cmd := exec.Command("go", goArgs...) - cmd.Stdout = stdout - cmd.Stderr = stderr - - // cmd.WaitDelay was added only in go1.20 (see #50436). - if waitDelay := reflect.ValueOf(cmd).Elem().FieldByName("WaitDelay"); waitDelay.IsValid() { - // https://go.dev/issue/59541: don't wait forever copying stderr - // after the command has exited. - // After CL 484741 we copy stdout manually, so we we'll stop reading that as - // soon as ctx is done. However, we also don't want to wait around forever - // for stderr. Give a much-longer-than-reasonable delay and then assume that - // something has wedged in the kernel or runtime. - waitDelay.Set(reflect.ValueOf(30 * time.Second)) - } - - // On darwin the cwd gets resolved to the real path, which breaks anything that - // expects the working directory to keep the original path, including the - // go command when dealing with modules. - // The Go stdlib has a special feature where if the cwd and the PWD are the - // same node then it trusts the PWD, so by setting it in the env for the child - // process we fix up all the paths returned by the go command. - if !i.CleanEnv { - cmd.Env = os.Environ() - } - cmd.Env = append(cmd.Env, i.Env...) - if i.WorkingDir != "" { - cmd.Env = append(cmd.Env, "PWD="+i.WorkingDir) - cmd.Dir = i.WorkingDir - } - - defer func(start time.Time) { log("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now()) - - return runCmdContext(ctx, cmd) -} - -// DebugHangingGoCommands may be set by tests to enable additional -// instrumentation (including panics) for debugging hanging Go commands. -// -// See golang/go#54461 for details. -var DebugHangingGoCommands = false - -// runCmdContext is like exec.CommandContext except it sends os.Interrupt -// before os.Kill. -func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { - // If cmd.Stdout is not an *os.File, the exec package will create a pipe and - // copy it to the Writer in a goroutine until the process has finished and - // either the pipe reaches EOF or command's WaitDelay expires. - // - // However, the output from 'go list' can be quite large, and we don't want to - // keep reading (and allocating buffers) if we've already decided we don't - // care about the output. We don't want to wait for the process to finish, and - // we don't wait to wait for the WaitDelay to expire either. - // - // Instead, if cmd.Stdout requires a copying goroutine we explicitly replace - // it with a pipe (which is an *os.File), which we can close in order to stop - // copying output as soon as we realize we don't care about it. - var stdoutW *os.File - if cmd.Stdout != nil { - if _, ok := cmd.Stdout.(*os.File); !ok { - var stdoutR *os.File - stdoutR, stdoutW, err = os.Pipe() - if err != nil { - return err - } - prevStdout := cmd.Stdout - cmd.Stdout = stdoutW - - stdoutErr := make(chan error, 1) - go func() { - _, err := io.Copy(prevStdout, stdoutR) - if err != nil { - err = fmt.Errorf("copying stdout: %w", err) - } - stdoutErr <- err - }() - defer func() { - // We started a goroutine to copy a stdout pipe. - // Wait for it to finish, or terminate it if need be. - var err2 error - select { - case err2 = <-stdoutErr: - stdoutR.Close() - case <-ctx.Done(): - stdoutR.Close() - // Per https://pkg.go.dev/os#File.Close, the call to stdoutR.Close - // should cause the Read call in io.Copy to unblock and return - // immediately, but we still need to receive from stdoutErr to confirm - // that it has happened. - <-stdoutErr - err2 = ctx.Err() - } - if err == nil { - err = err2 - } - }() - - // Per https://pkg.go.dev/os/exec#Cmd, “If Stdout and Stderr are the - // same writer, and have a type that can be compared with ==, at most - // one goroutine at a time will call Write.” - // - // Since we're starting a goroutine that writes to cmd.Stdout, we must - // also update cmd.Stderr so that it still holds. - func() { - defer func() { recover() }() - if cmd.Stderr == prevStdout { - cmd.Stderr = cmd.Stdout - } - }() - } - } - - err = cmd.Start() - if stdoutW != nil { - // The child process has inherited the pipe file, - // so close the copy held in this process. - stdoutW.Close() - stdoutW = nil - } - if err != nil { - return err - } - - resChan := make(chan error, 1) - go func() { - resChan <- cmd.Wait() - }() - - // If we're interested in debugging hanging Go commands, stop waiting after a - // minute and panic with interesting information. - debug := DebugHangingGoCommands - if debug { - timer := time.NewTimer(1 * time.Minute) - defer timer.Stop() - select { - case err := <-resChan: - return err - case <-timer.C: - HandleHangingGoCommand(cmd.Process) - case <-ctx.Done(): - } - } else { - select { - case err := <-resChan: - return err - case <-ctx.Done(): - } - } - - // Cancelled. Interrupt and see if it ends voluntarily. - if err := cmd.Process.Signal(os.Interrupt); err == nil { - // (We used to wait only 1s but this proved - // fragile on loaded builder machines.) - timer := time.NewTimer(5 * time.Second) - defer timer.Stop() - select { - case err := <-resChan: - return err - case <-timer.C: - } - } - - // Didn't shut down in response to interrupt. Kill it hard. - // TODO(rfindley): per advice from bcmills@, it may be better to send SIGQUIT - // on certain platforms, such as unix. - if err := cmd.Process.Kill(); err != nil && !errors.Is(err, os.ErrProcessDone) && debug { - log.Printf("error killing the Go command: %v", err) - } - - return <-resChan -} - -func HandleHangingGoCommand(proc *os.Process) { - switch runtime.GOOS { - case "linux", "darwin", "freebsd", "netbsd": - fmt.Fprintln(os.Stderr, `DETECTED A HANGING GO COMMAND - -The gopls test runner has detected a hanging go command. In order to debug -this, the output of ps and lsof/fstat is printed below. - -See golang/go#54461 for more details.`) - - fmt.Fprintln(os.Stderr, "\nps axo ppid,pid,command:") - fmt.Fprintln(os.Stderr, "-------------------------") - psCmd := exec.Command("ps", "axo", "ppid,pid,command") - psCmd.Stdout = os.Stderr - psCmd.Stderr = os.Stderr - if err := psCmd.Run(); err != nil { - panic(fmt.Sprintf("running ps: %v", err)) - } - - listFiles := "lsof" - if runtime.GOOS == "freebsd" || runtime.GOOS == "netbsd" { - listFiles = "fstat" - } - - fmt.Fprintln(os.Stderr, "\n"+listFiles+":") - fmt.Fprintln(os.Stderr, "-----") - listFilesCmd := exec.Command(listFiles) - listFilesCmd.Stdout = os.Stderr - listFilesCmd.Stderr = os.Stderr - if err := listFilesCmd.Run(); err != nil { - panic(fmt.Sprintf("running %s: %v", listFiles, err)) - } - } - panic(fmt.Sprintf("detected hanging go command (pid %d): see golang/go#54461 for more details", proc.Pid)) -} - -func cmdDebugStr(cmd *exec.Cmd) string { - env := make(map[string]string) - for _, kv := range cmd.Env { - split := strings.SplitN(kv, "=", 2) - if len(split) == 2 { - k, v := split[0], split[1] - env[k] = v - } - } - - var args []string - for _, arg := range cmd.Args { - quoted := strconv.Quote(arg) - if quoted[1:len(quoted)-1] != arg || strings.Contains(arg, " ") { - args = append(args, quoted) - } else { - args = append(args, arg) - } - } - return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/vendor.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/vendor.go deleted file mode 100644 index 2d3d408c0bed..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/vendor.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocommand - -import ( - "bytes" - "context" - "fmt" - "os" - "path/filepath" - "regexp" - "strings" - "time" - - "golang.org/x/mod/semver" -) - -// ModuleJSON holds information about a module. -type ModuleJSON struct { - Path string // module path - Version string // module version - Versions []string // available module versions (with -versions) - Replace *ModuleJSON // replaced by this module - Time *time.Time // time version was created - Update *ModuleJSON // available update, if any (with -u) - Main bool // is this the main module? - Indirect bool // is this module only an indirect dependency of main module? - Dir string // directory holding files for this module, if any - GoMod string // path to go.mod file used when loading this module, if any - GoVersion string // go version used in module -} - -var modFlagRegexp = regexp.MustCompile(`-mod[ =](\w+)`) - -// VendorEnabled reports whether vendoring is enabled. It takes a *Runner to execute Go commands -// with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields, -// of which only Verb and Args are modified to run the appropriate Go command. -// Inspired by setDefaultBuildMod in modload/init.go -func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, *ModuleJSON, error) { - mainMod, go114, err := getMainModuleAnd114(ctx, inv, r) - if err != nil { - return false, nil, err - } - - // We check the GOFLAGS to see if there is anything overridden or not. - inv.Verb = "env" - inv.Args = []string{"GOFLAGS"} - stdout, err := r.Run(ctx, inv) - if err != nil { - return false, nil, err - } - goflags := string(bytes.TrimSpace(stdout.Bytes())) - matches := modFlagRegexp.FindStringSubmatch(goflags) - var modFlag string - if len(matches) != 0 { - modFlag = matches[1] - } - // Don't override an explicit '-mod=' argument. - if modFlag == "vendor" { - return true, mainMod, nil - } else if modFlag != "" { - return false, nil, nil - } - if mainMod == nil || !go114 { - return false, nil, nil - } - // Check 1.14's automatic vendor mode. - if fi, err := os.Stat(filepath.Join(mainMod.Dir, "vendor")); err == nil && fi.IsDir() { - if mainMod.GoVersion != "" && semver.Compare("v"+mainMod.GoVersion, "v1.14") >= 0 { - // The Go version is at least 1.14, and a vendor directory exists. - // Set -mod=vendor by default. - return true, mainMod, nil - } - } - return false, nil, nil -} - -// getMainModuleAnd114 gets one of the main modules' information and whether the -// go command in use is 1.14+. This is the information needed to figure out -// if vendoring should be enabled. -func getMainModuleAnd114(ctx context.Context, inv Invocation, r *Runner) (*ModuleJSON, bool, error) { - const format = `{{.Path}} -{{.Dir}} -{{.GoMod}} -{{.GoVersion}} -{{range context.ReleaseTags}}{{if eq . "go1.14"}}{{.}}{{end}}{{end}} -` - inv.Verb = "list" - inv.Args = []string{"-m", "-f", format} - stdout, err := r.Run(ctx, inv) - if err != nil { - return nil, false, err - } - - lines := strings.Split(stdout.String(), "\n") - if len(lines) < 5 { - return nil, false, fmt.Errorf("unexpected stdout: %q", stdout.String()) - } - mod := &ModuleJSON{ - Path: lines[0], - Dir: lines[1], - GoMod: lines[2], - GoVersion: lines[3], - Main: true, - } - return mod, lines[4] == "go1.14", nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/version.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/version.go deleted file mode 100644 index 446c5846a60f..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gocommand/version.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocommand - -import ( - "context" - "fmt" - "regexp" - "strings" -) - -// GoVersion reports the minor version number of the highest release -// tag built into the go command on the PATH. -// -// Note that this may be higher than the version of the go tool used -// to build this application, and thus the versions of the standard -// go/{scanner,parser,ast,types} packages that are linked into it. -// In that case, callers should either downgrade to the version of -// go used to build the application, or report an error that the -// application is too old to use the go command on the PATH. -func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) { - inv.Verb = "list" - inv.Args = []string{"-e", "-f", `{{context.ReleaseTags}}`, `--`, `unsafe`} - inv.BuildFlags = nil // This is not a build command. - inv.ModFlag = "" - inv.ModFile = "" - inv.Env = append(inv.Env[:len(inv.Env):len(inv.Env)], "GO111MODULE=off") - - stdoutBytes, err := r.Run(ctx, inv) - if err != nil { - return 0, err - } - stdout := stdoutBytes.String() - if len(stdout) < 3 { - return 0, fmt.Errorf("bad ReleaseTags output: %q", stdout) - } - // Split up "[go1.1 go1.15]" and return highest go1.X value. - tags := strings.Fields(stdout[1 : len(stdout)-2]) - for i := len(tags) - 1; i >= 0; i-- { - var version int - if _, err := fmt.Sscanf(tags[i], "go1.%d", &version); err != nil { - continue - } - return version, nil - } - return 0, fmt.Errorf("no parseable ReleaseTags in %v", tags) -} - -// GoVersionOutput returns the complete output of the go version command. -func GoVersionOutput(ctx context.Context, inv Invocation, r *Runner) (string, error) { - inv.Verb = "version" - goVersion, err := r.Run(ctx, inv) - if err != nil { - return "", err - } - return goVersion.String(), nil -} - -// ParseGoVersionOutput extracts the Go version string -// from the output of the "go version" command. -// Given an unrecognized form, it returns an empty string. -func ParseGoVersionOutput(data string) string { - re := regexp.MustCompile(`^go version (go\S+|devel \S+)`) - m := re.FindStringSubmatch(data) - if len(m) != 2 { - return "" // unrecognized version - } - return m[1] -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gopathwalk/walk.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/gopathwalk/walk.go deleted file mode 100644 index 452e342c559c..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/gopathwalk/walk.go +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gopathwalk is like filepath.Walk but specialized for finding Go -// packages, particularly in $GOPATH and $GOROOT. -package gopathwalk - -import ( - "bufio" - "bytes" - "log" - "os" - "path/filepath" - "strings" - "time" - - "golang.org/x/tools/internal/fastwalk" -) - -// Options controls the behavior of a Walk call. -type Options struct { - // If Logf is non-nil, debug logging is enabled through this function. - Logf func(format string, args ...interface{}) - // Search module caches. Also disables legacy goimports ignore rules. - ModulesEnabled bool -} - -// RootType indicates the type of a Root. -type RootType int - -const ( - RootUnknown RootType = iota - RootGOROOT - RootGOPATH - RootCurrentModule - RootModuleCache - RootOther -) - -// A Root is a starting point for a Walk. -type Root struct { - Path string - Type RootType -} - -// Walk walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute -// paths of the containing source directory and the package directory. -// add will be called concurrently. -func Walk(roots []Root, add func(root Root, dir string), opts Options) { - WalkSkip(roots, add, func(Root, string) bool { return false }, opts) -} - -// WalkSkip walks Go source directories ($GOROOT, $GOPATH, etc) to find packages. -// For each package found, add will be called (concurrently) with the absolute -// paths of the containing source directory and the package directory. -// For each directory that will be scanned, skip will be called (concurrently) -// with the absolute paths of the containing source directory and the directory. -// If skip returns false on a directory it will be processed. -// add will be called concurrently. -// skip will be called concurrently. -func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root, dir string) bool, opts Options) { - for _, root := range roots { - walkDir(root, add, skip, opts) - } -} - -// walkDir creates a walker and starts fastwalk with this walker. -func walkDir(root Root, add func(Root, string), skip func(root Root, dir string) bool, opts Options) { - if _, err := os.Stat(root.Path); os.IsNotExist(err) { - if opts.Logf != nil { - opts.Logf("skipping nonexistent directory: %v", root.Path) - } - return - } - start := time.Now() - if opts.Logf != nil { - opts.Logf("scanning %s", root.Path) - } - w := &walker{ - root: root, - add: add, - skip: skip, - opts: opts, - } - w.init() - if err := fastwalk.Walk(root.Path, w.walk); err != nil { - logf := opts.Logf - if logf == nil { - logf = log.Printf - } - logf("scanning directory %v: %v", root.Path, err) - } - - if opts.Logf != nil { - opts.Logf("scanned %s in %v", root.Path, time.Since(start)) - } -} - -// walker is the callback for fastwalk.Walk. -type walker struct { - root Root // The source directory to scan. - add func(Root, string) // The callback that will be invoked for every possible Go package dir. - skip func(Root, string) bool // The callback that will be invoked for every dir. dir is skipped if it returns true. - opts Options // Options passed to Walk by the user. - - ignoredDirs []os.FileInfo // The ignored directories, loaded from .goimportsignore files. -} - -// init initializes the walker based on its Options -func (w *walker) init() { - var ignoredPaths []string - if w.root.Type == RootModuleCache { - ignoredPaths = []string{"cache"} - } - if !w.opts.ModulesEnabled && w.root.Type == RootGOPATH { - ignoredPaths = w.getIgnoredDirs(w.root.Path) - ignoredPaths = append(ignoredPaths, "v", "mod") - } - - for _, p := range ignoredPaths { - full := filepath.Join(w.root.Path, p) - if fi, err := os.Stat(full); err == nil { - w.ignoredDirs = append(w.ignoredDirs, fi) - if w.opts.Logf != nil { - w.opts.Logf("Directory added to ignore list: %s", full) - } - } else if w.opts.Logf != nil { - w.opts.Logf("Error statting ignored directory: %v", err) - } - } -} - -// getIgnoredDirs reads an optional config file at /.goimportsignore -// of relative directories to ignore when scanning for go files. -// The provided path is one of the $GOPATH entries with "src" appended. -func (w *walker) getIgnoredDirs(path string) []string { - file := filepath.Join(path, ".goimportsignore") - slurp, err := os.ReadFile(file) - if w.opts.Logf != nil { - if err != nil { - w.opts.Logf("%v", err) - } else { - w.opts.Logf("Read %s", file) - } - } - if err != nil { - return nil - } - - var ignoredDirs []string - bs := bufio.NewScanner(bytes.NewReader(slurp)) - for bs.Scan() { - line := strings.TrimSpace(bs.Text()) - if line == "" || strings.HasPrefix(line, "#") { - continue - } - ignoredDirs = append(ignoredDirs, line) - } - return ignoredDirs -} - -// shouldSkipDir reports whether the file should be skipped or not. -func (w *walker) shouldSkipDir(fi os.FileInfo, dir string) bool { - for _, ignoredDir := range w.ignoredDirs { - if os.SameFile(fi, ignoredDir) { - return true - } - } - if w.skip != nil { - // Check with the user specified callback. - return w.skip(w.root, dir) - } - return false -} - -// walk walks through the given path. -func (w *walker) walk(path string, typ os.FileMode) error { - if typ.IsRegular() { - dir := filepath.Dir(path) - if dir == w.root.Path && (w.root.Type == RootGOROOT || w.root.Type == RootGOPATH) { - // Doesn't make sense to have regular files - // directly in your $GOPATH/src or $GOROOT/src. - return fastwalk.ErrSkipFiles - } - if !strings.HasSuffix(path, ".go") { - return nil - } - - w.add(w.root, dir) - return fastwalk.ErrSkipFiles - } - if typ == os.ModeDir { - base := filepath.Base(path) - if base == "" || base[0] == '.' || base[0] == '_' || - base == "testdata" || - (w.root.Type == RootGOROOT && w.opts.ModulesEnabled && base == "vendor") || - (!w.opts.ModulesEnabled && base == "node_modules") { - return filepath.SkipDir - } - fi, err := os.Lstat(path) - if err == nil && w.shouldSkipDir(fi, path) { - return filepath.SkipDir - } - return nil - } - if typ == os.ModeSymlink { - base := filepath.Base(path) - if strings.HasPrefix(base, ".#") { - // Emacs noise. - return nil - } - if w.shouldTraverse(path) { - return fastwalk.ErrTraverseLink - } - } - return nil -} - -// shouldTraverse reports whether the symlink fi, found in dir, -// should be followed. It makes sure symlinks were never visited -// before to avoid symlink loops. -func (w *walker) shouldTraverse(path string) bool { - ts, err := os.Stat(path) - if err != nil { - logf := w.opts.Logf - if logf == nil { - logf = log.Printf - } - logf("%v", err) - return false - } - if !ts.IsDir() { - return false - } - if w.shouldSkipDir(ts, filepath.Dir(path)) { - return false - } - // Check for symlink loops by statting each directory component - // and seeing if any are the same file as ts. - for { - parent := filepath.Dir(path) - if parent == path { - // Made it to the root without seeing a cycle. - // Use this symlink. - return true - } - parentInfo, err := os.Stat(parent) - if err != nil { - return false - } - if os.SameFile(ts, parentInfo) { - // Cycle. Don't traverse. - return false - } - path = parent - } - -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/fix.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/fix.go deleted file mode 100644 index d4f1b4e8a0f2..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/fix.go +++ /dev/null @@ -1,1766 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package imports - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - "io/ioutil" - "os" - "path" - "path/filepath" - "reflect" - "sort" - "strconv" - "strings" - "sync" - "unicode" - "unicode/utf8" - - "golang.org/x/tools/go/ast/astutil" - "golang.org/x/tools/internal/event" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/gopathwalk" -) - -// importToGroup is a list of functions which map from an import path to -// a group number. -var importToGroup = []func(localPrefix, importPath string) (num int, ok bool){ - func(localPrefix, importPath string) (num int, ok bool) { - if localPrefix == "" { - return - } - for _, p := range strings.Split(localPrefix, ",") { - if strings.HasPrefix(importPath, p) || strings.TrimSuffix(p, "/") == importPath { - return 3, true - } - } - return - }, - func(_, importPath string) (num int, ok bool) { - if strings.HasPrefix(importPath, "appengine") { - return 2, true - } - return - }, - func(_, importPath string) (num int, ok bool) { - firstComponent := strings.Split(importPath, "/")[0] - if strings.Contains(firstComponent, ".") { - return 1, true - } - return - }, -} - -func importGroup(localPrefix, importPath string) int { - for _, fn := range importToGroup { - if n, ok := fn(localPrefix, importPath); ok { - return n - } - } - return 0 -} - -type ImportFixType int - -const ( - AddImport ImportFixType = iota - DeleteImport - SetImportName -) - -type ImportFix struct { - // StmtInfo represents the import statement this fix will add, remove, or change. - StmtInfo ImportInfo - // IdentName is the identifier that this fix will add or remove. - IdentName string - // FixType is the type of fix this is (AddImport, DeleteImport, SetImportName). - FixType ImportFixType - Relevance float64 // see pkg -} - -// An ImportInfo represents a single import statement. -type ImportInfo struct { - ImportPath string // import path, e.g. "crypto/rand". - Name string // import name, e.g. "crand", or "" if none. -} - -// A packageInfo represents what's known about a package. -type packageInfo struct { - name string // real package name, if known. - exports map[string]bool // known exports. -} - -// parseOtherFiles parses all the Go files in srcDir except filename, including -// test files if filename looks like a test. -func parseOtherFiles(fset *token.FileSet, srcDir, filename string) []*ast.File { - // This could use go/packages but it doesn't buy much, and it fails - // with https://golang.org/issue/26296 in LoadFiles mode in some cases. - considerTests := strings.HasSuffix(filename, "_test.go") - - fileBase := filepath.Base(filename) - packageFileInfos, err := ioutil.ReadDir(srcDir) - if err != nil { - return nil - } - - var files []*ast.File - for _, fi := range packageFileInfos { - if fi.Name() == fileBase || !strings.HasSuffix(fi.Name(), ".go") { - continue - } - if !considerTests && strings.HasSuffix(fi.Name(), "_test.go") { - continue - } - - f, err := parser.ParseFile(fset, filepath.Join(srcDir, fi.Name()), nil, 0) - if err != nil { - continue - } - - files = append(files, f) - } - - return files -} - -// addGlobals puts the names of package vars into the provided map. -func addGlobals(f *ast.File, globals map[string]bool) { - for _, decl := range f.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - - for _, spec := range genDecl.Specs { - valueSpec, ok := spec.(*ast.ValueSpec) - if !ok { - continue - } - globals[valueSpec.Names[0].Name] = true - } - } -} - -// collectReferences builds a map of selector expressions, from -// left hand side (X) to a set of right hand sides (Sel). -func collectReferences(f *ast.File) references { - refs := references{} - - var visitor visitFn - visitor = func(node ast.Node) ast.Visitor { - if node == nil { - return visitor - } - switch v := node.(type) { - case *ast.SelectorExpr: - xident, ok := v.X.(*ast.Ident) - if !ok { - break - } - if xident.Obj != nil { - // If the parser can resolve it, it's not a package ref. - break - } - if !ast.IsExported(v.Sel.Name) { - // Whatever this is, it's not exported from a package. - break - } - pkgName := xident.Name - r := refs[pkgName] - if r == nil { - r = make(map[string]bool) - refs[pkgName] = r - } - r[v.Sel.Name] = true - } - return visitor - } - ast.Walk(visitor, f) - return refs -} - -// collectImports returns all the imports in f. -// Unnamed imports (., _) and "C" are ignored. -func collectImports(f *ast.File) []*ImportInfo { - var imports []*ImportInfo - for _, imp := range f.Imports { - var name string - if imp.Name != nil { - name = imp.Name.Name - } - if imp.Path.Value == `"C"` || name == "_" || name == "." { - continue - } - path := strings.Trim(imp.Path.Value, `"`) - imports = append(imports, &ImportInfo{ - Name: name, - ImportPath: path, - }) - } - return imports -} - -// findMissingImport searches pass's candidates for an import that provides -// pkg, containing all of syms. -func (p *pass) findMissingImport(pkg string, syms map[string]bool) *ImportInfo { - for _, candidate := range p.candidates { - pkgInfo, ok := p.knownPackages[candidate.ImportPath] - if !ok { - continue - } - if p.importIdentifier(candidate) != pkg { - continue - } - - allFound := true - for right := range syms { - if !pkgInfo.exports[right] { - allFound = false - break - } - } - - if allFound { - return candidate - } - } - return nil -} - -// references is set of references found in a Go file. The first map key is the -// left hand side of a selector expression, the second key is the right hand -// side, and the value should always be true. -type references map[string]map[string]bool - -// A pass contains all the inputs and state necessary to fix a file's imports. -// It can be modified in some ways during use; see comments below. -type pass struct { - // Inputs. These must be set before a call to load, and not modified after. - fset *token.FileSet // fset used to parse f and its siblings. - f *ast.File // the file being fixed. - srcDir string // the directory containing f. - env *ProcessEnv // the environment to use for go commands, etc. - loadRealPackageNames bool // if true, load package names from disk rather than guessing them. - otherFiles []*ast.File // sibling files. - - // Intermediate state, generated by load. - existingImports map[string]*ImportInfo - allRefs references - missingRefs references - - // Inputs to fix. These can be augmented between successive fix calls. - lastTry bool // indicates that this is the last call and fix should clean up as best it can. - candidates []*ImportInfo // candidate imports in priority order. - knownPackages map[string]*packageInfo // information about all known packages. -} - -// loadPackageNames saves the package names for everything referenced by imports. -func (p *pass) loadPackageNames(imports []*ImportInfo) error { - if p.env.Logf != nil { - p.env.Logf("loading package names for %v packages", len(imports)) - defer func() { - p.env.Logf("done loading package names for %v packages", len(imports)) - }() - } - var unknown []string - for _, imp := range imports { - if _, ok := p.knownPackages[imp.ImportPath]; ok { - continue - } - unknown = append(unknown, imp.ImportPath) - } - - resolver, err := p.env.GetResolver() - if err != nil { - return err - } - - names, err := resolver.loadPackageNames(unknown, p.srcDir) - if err != nil { - return err - } - - for path, name := range names { - p.knownPackages[path] = &packageInfo{ - name: name, - exports: map[string]bool{}, - } - } - return nil -} - -// importIdentifier returns the identifier that imp will introduce. It will -// guess if the package name has not been loaded, e.g. because the source -// is not available. -func (p *pass) importIdentifier(imp *ImportInfo) string { - if imp.Name != "" { - return imp.Name - } - known := p.knownPackages[imp.ImportPath] - if known != nil && known.name != "" { - return known.name - } - return ImportPathToAssumedName(imp.ImportPath) -} - -// load reads in everything necessary to run a pass, and reports whether the -// file already has all the imports it needs. It fills in p.missingRefs with the -// file's missing symbols, if any, or removes unused imports if not. -func (p *pass) load() ([]*ImportFix, bool) { - p.knownPackages = map[string]*packageInfo{} - p.missingRefs = references{} - p.existingImports = map[string]*ImportInfo{} - - // Load basic information about the file in question. - p.allRefs = collectReferences(p.f) - - // Load stuff from other files in the same package: - // global variables so we know they don't need resolving, and imports - // that we might want to mimic. - globals := map[string]bool{} - for _, otherFile := range p.otherFiles { - // Don't load globals from files that are in the same directory - // but a different package. Using them to suggest imports is OK. - if p.f.Name.Name == otherFile.Name.Name { - addGlobals(otherFile, globals) - } - p.candidates = append(p.candidates, collectImports(otherFile)...) - } - - // Resolve all the import paths we've seen to package names, and store - // f's imports by the identifier they introduce. - imports := collectImports(p.f) - if p.loadRealPackageNames { - err := p.loadPackageNames(append(imports, p.candidates...)) - if err != nil { - if p.env.Logf != nil { - p.env.Logf("loading package names: %v", err) - } - return nil, false - } - } - for _, imp := range imports { - p.existingImports[p.importIdentifier(imp)] = imp - } - - // Find missing references. - for left, rights := range p.allRefs { - if globals[left] { - continue - } - _, ok := p.existingImports[left] - if !ok { - p.missingRefs[left] = rights - continue - } - } - if len(p.missingRefs) != 0 { - return nil, false - } - - return p.fix() -} - -// fix attempts to satisfy missing imports using p.candidates. If it finds -// everything, or if p.lastTry is true, it updates fixes to add the imports it found, -// delete anything unused, and update import names, and returns true. -func (p *pass) fix() ([]*ImportFix, bool) { - // Find missing imports. - var selected []*ImportInfo - for left, rights := range p.missingRefs { - if imp := p.findMissingImport(left, rights); imp != nil { - selected = append(selected, imp) - } - } - - if !p.lastTry && len(selected) != len(p.missingRefs) { - return nil, false - } - - // Found everything, or giving up. Add the new imports and remove any unused. - var fixes []*ImportFix - for _, imp := range p.existingImports { - // We deliberately ignore globals here, because we can't be sure - // they're in the same package. People do things like put multiple - // main packages in the same directory, and we don't want to - // remove imports if they happen to have the same name as a var in - // a different package. - if _, ok := p.allRefs[p.importIdentifier(imp)]; !ok { - fixes = append(fixes, &ImportFix{ - StmtInfo: *imp, - IdentName: p.importIdentifier(imp), - FixType: DeleteImport, - }) - continue - } - - // An existing import may need to update its import name to be correct. - if name := p.importSpecName(imp); name != imp.Name { - fixes = append(fixes, &ImportFix{ - StmtInfo: ImportInfo{ - Name: name, - ImportPath: imp.ImportPath, - }, - IdentName: p.importIdentifier(imp), - FixType: SetImportName, - }) - } - } - // Collecting fixes involved map iteration, so sort for stability. See - // golang/go#59976. - sortFixes(fixes) - - // collect selected fixes in a separate slice, so that it can be sorted - // separately. Note that these fixes must occur after fixes to existing - // imports. TODO(rfindley): figure out why. - var selectedFixes []*ImportFix - for _, imp := range selected { - selectedFixes = append(selectedFixes, &ImportFix{ - StmtInfo: ImportInfo{ - Name: p.importSpecName(imp), - ImportPath: imp.ImportPath, - }, - IdentName: p.importIdentifier(imp), - FixType: AddImport, - }) - } - sortFixes(selectedFixes) - - return append(fixes, selectedFixes...), true -} - -func sortFixes(fixes []*ImportFix) { - sort.Slice(fixes, func(i, j int) bool { - fi, fj := fixes[i], fixes[j] - if fi.StmtInfo.ImportPath != fj.StmtInfo.ImportPath { - return fi.StmtInfo.ImportPath < fj.StmtInfo.ImportPath - } - if fi.StmtInfo.Name != fj.StmtInfo.Name { - return fi.StmtInfo.Name < fj.StmtInfo.Name - } - if fi.IdentName != fj.IdentName { - return fi.IdentName < fj.IdentName - } - return fi.FixType < fj.FixType - }) -} - -// importSpecName gets the import name of imp in the import spec. -// -// When the import identifier matches the assumed import name, the import name does -// not appear in the import spec. -func (p *pass) importSpecName(imp *ImportInfo) string { - // If we did not load the real package names, or the name is already set, - // we just return the existing name. - if !p.loadRealPackageNames || imp.Name != "" { - return imp.Name - } - - ident := p.importIdentifier(imp) - if ident == ImportPathToAssumedName(imp.ImportPath) { - return "" // ident not needed since the assumed and real names are the same. - } - return ident -} - -// apply will perform the fixes on f in order. -func apply(fset *token.FileSet, f *ast.File, fixes []*ImportFix) { - for _, fix := range fixes { - switch fix.FixType { - case DeleteImport: - astutil.DeleteNamedImport(fset, f, fix.StmtInfo.Name, fix.StmtInfo.ImportPath) - case AddImport: - astutil.AddNamedImport(fset, f, fix.StmtInfo.Name, fix.StmtInfo.ImportPath) - case SetImportName: - // Find the matching import path and change the name. - for _, spec := range f.Imports { - path := strings.Trim(spec.Path.Value, `"`) - if path == fix.StmtInfo.ImportPath { - spec.Name = &ast.Ident{ - Name: fix.StmtInfo.Name, - NamePos: spec.Pos(), - } - } - } - } - } -} - -// assumeSiblingImportsValid assumes that siblings' use of packages is valid, -// adding the exports they use. -func (p *pass) assumeSiblingImportsValid() { - for _, f := range p.otherFiles { - refs := collectReferences(f) - imports := collectImports(f) - importsByName := map[string]*ImportInfo{} - for _, imp := range imports { - importsByName[p.importIdentifier(imp)] = imp - } - for left, rights := range refs { - if imp, ok := importsByName[left]; ok { - if m, ok := stdlib[imp.ImportPath]; ok { - // We have the stdlib in memory; no need to guess. - rights = copyExports(m) - } - p.addCandidate(imp, &packageInfo{ - // no name; we already know it. - exports: rights, - }) - } - } - } -} - -// addCandidate adds a candidate import to p, and merges in the information -// in pkg. -func (p *pass) addCandidate(imp *ImportInfo, pkg *packageInfo) { - p.candidates = append(p.candidates, imp) - if existing, ok := p.knownPackages[imp.ImportPath]; ok { - if existing.name == "" { - existing.name = pkg.name - } - for export := range pkg.exports { - existing.exports[export] = true - } - } else { - p.knownPackages[imp.ImportPath] = pkg - } -} - -// fixImports adds and removes imports from f so that all its references are -// satisfied and there are no unused imports. -// -// This is declared as a variable rather than a function so goimports can -// easily be extended by adding a file with an init function. -var fixImports = fixImportsDefault - -func fixImportsDefault(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) error { - fixes, err := getFixes(context.Background(), fset, f, filename, env) - if err != nil { - return err - } - apply(fset, f, fixes) - return err -} - -// getFixes gets the import fixes that need to be made to f in order to fix the imports. -// It does not modify the ast. -func getFixes(ctx context.Context, fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv) ([]*ImportFix, error) { - abs, err := filepath.Abs(filename) - if err != nil { - return nil, err - } - srcDir := filepath.Dir(abs) - if env.Logf != nil { - env.Logf("fixImports(filename=%q), abs=%q, srcDir=%q ...", filename, abs, srcDir) - } - - // First pass: looking only at f, and using the naive algorithm to - // derive package names from import paths, see if the file is already - // complete. We can't add any imports yet, because we don't know - // if missing references are actually package vars. - p := &pass{fset: fset, f: f, srcDir: srcDir, env: env} - if fixes, done := p.load(); done { - return fixes, nil - } - - otherFiles := parseOtherFiles(fset, srcDir, filename) - - // Second pass: add information from other files in the same package, - // like their package vars and imports. - p.otherFiles = otherFiles - if fixes, done := p.load(); done { - return fixes, nil - } - - // Now we can try adding imports from the stdlib. - p.assumeSiblingImportsValid() - addStdlibCandidates(p, p.missingRefs) - if fixes, done := p.fix(); done { - return fixes, nil - } - - // Third pass: get real package names where we had previously used - // the naive algorithm. - p = &pass{fset: fset, f: f, srcDir: srcDir, env: env} - p.loadRealPackageNames = true - p.otherFiles = otherFiles - if fixes, done := p.load(); done { - return fixes, nil - } - - if err := addStdlibCandidates(p, p.missingRefs); err != nil { - return nil, err - } - p.assumeSiblingImportsValid() - if fixes, done := p.fix(); done { - return fixes, nil - } - - // Go look for candidates in $GOPATH, etc. We don't necessarily load - // the real exports of sibling imports, so keep assuming their contents. - if err := addExternalCandidates(ctx, p, p.missingRefs, filename); err != nil { - return nil, err - } - - p.lastTry = true - fixes, _ := p.fix() - return fixes, nil -} - -// MaxRelevance is the highest relevance, used for the standard library. -// Chosen arbitrarily to match pre-existing gopls code. -const MaxRelevance = 7.0 - -// getCandidatePkgs works with the passed callback to find all acceptable packages. -// It deduplicates by import path, and uses a cached stdlib rather than reading -// from disk. -func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filename, filePkg string, env *ProcessEnv) error { - notSelf := func(p *pkg) bool { - return p.packageName != filePkg || p.dir != filepath.Dir(filename) - } - goenv, err := env.goEnv() - if err != nil { - return err - } - - var mu sync.Mutex // to guard asynchronous access to dupCheck - dupCheck := map[string]struct{}{} - - // Start off with the standard library. - for importPath, exports := range stdlib { - p := &pkg{ - dir: filepath.Join(goenv["GOROOT"], "src", importPath), - importPathShort: importPath, - packageName: path.Base(importPath), - relevance: MaxRelevance, - } - dupCheck[importPath] = struct{}{} - if notSelf(p) && wrappedCallback.dirFound(p) && wrappedCallback.packageNameLoaded(p) { - wrappedCallback.exportsLoaded(p, exports) - } - } - - scanFilter := &scanCallback{ - rootFound: func(root gopathwalk.Root) bool { - // Exclude goroot results -- getting them is relatively expensive, not cached, - // and generally redundant with the in-memory version. - return root.Type != gopathwalk.RootGOROOT && wrappedCallback.rootFound(root) - }, - dirFound: wrappedCallback.dirFound, - packageNameLoaded: func(pkg *pkg) bool { - mu.Lock() - defer mu.Unlock() - if _, ok := dupCheck[pkg.importPathShort]; ok { - return false - } - dupCheck[pkg.importPathShort] = struct{}{} - return notSelf(pkg) && wrappedCallback.packageNameLoaded(pkg) - }, - exportsLoaded: func(pkg *pkg, exports []string) { - // If we're an x_test, load the package under test's test variant. - if strings.HasSuffix(filePkg, "_test") && pkg.dir == filepath.Dir(filename) { - var err error - _, exports, err = loadExportsFromFiles(ctx, env, pkg.dir, true) - if err != nil { - return - } - } - wrappedCallback.exportsLoaded(pkg, exports) - }, - } - resolver, err := env.GetResolver() - if err != nil { - return err - } - return resolver.scan(ctx, scanFilter) -} - -func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) (map[string]float64, error) { - result := make(map[string]float64) - resolver, err := env.GetResolver() - if err != nil { - return nil, err - } - for _, path := range paths { - result[path] = resolver.scoreImportPath(ctx, path) - } - return result, nil -} - -func PrimeCache(ctx context.Context, env *ProcessEnv) error { - // Fully scan the disk for directories, but don't actually read any Go files. - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - return false - }, - packageNameLoaded: func(pkg *pkg) bool { - return false - }, - } - return getCandidatePkgs(ctx, callback, "", "", env) -} - -func candidateImportName(pkg *pkg) string { - if ImportPathToAssumedName(pkg.importPathShort) != pkg.packageName { - return pkg.packageName - } - return "" -} - -// GetAllCandidates calls wrapped for each package whose name starts with -// searchPrefix, and can be imported from filename with the package name filePkg. -// -// Beware that the wrapped function may be called multiple times concurrently. -// TODO(adonovan): encapsulate the concurrency. -func GetAllCandidates(ctx context.Context, wrapped func(ImportFix), searchPrefix, filename, filePkg string, env *ProcessEnv) error { - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - if !canUse(filename, pkg.dir) { - return false - } - // Try the assumed package name first, then a simpler path match - // in case of packages named vN, which are not uncommon. - return strings.HasPrefix(ImportPathToAssumedName(pkg.importPathShort), searchPrefix) || - strings.HasPrefix(path.Base(pkg.importPathShort), searchPrefix) - }, - packageNameLoaded: func(pkg *pkg) bool { - if !strings.HasPrefix(pkg.packageName, searchPrefix) { - return false - } - wrapped(ImportFix{ - StmtInfo: ImportInfo{ - ImportPath: pkg.importPathShort, - Name: candidateImportName(pkg), - }, - IdentName: pkg.packageName, - FixType: AddImport, - Relevance: pkg.relevance, - }) - return false - }, - } - return getCandidatePkgs(ctx, callback, filename, filePkg, env) -} - -// GetImportPaths calls wrapped for each package whose import path starts with -// searchPrefix, and can be imported from filename with the package name filePkg. -func GetImportPaths(ctx context.Context, wrapped func(ImportFix), searchPrefix, filename, filePkg string, env *ProcessEnv) error { - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - if !canUse(filename, pkg.dir) { - return false - } - return strings.HasPrefix(pkg.importPathShort, searchPrefix) - }, - packageNameLoaded: func(pkg *pkg) bool { - wrapped(ImportFix{ - StmtInfo: ImportInfo{ - ImportPath: pkg.importPathShort, - Name: candidateImportName(pkg), - }, - IdentName: pkg.packageName, - FixType: AddImport, - Relevance: pkg.relevance, - }) - return false - }, - } - return getCandidatePkgs(ctx, callback, filename, filePkg, env) -} - -// A PackageExport is a package and its exports. -type PackageExport struct { - Fix *ImportFix - Exports []string -} - -// GetPackageExports returns all known packages with name pkg and their exports. -func GetPackageExports(ctx context.Context, wrapped func(PackageExport), searchPkg, filename, filePkg string, env *ProcessEnv) error { - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true - }, - dirFound: func(pkg *pkg) bool { - return pkgIsCandidate(filename, references{searchPkg: nil}, pkg) - }, - packageNameLoaded: func(pkg *pkg) bool { - return pkg.packageName == searchPkg - }, - exportsLoaded: func(pkg *pkg, exports []string) { - sort.Strings(exports) - wrapped(PackageExport{ - Fix: &ImportFix{ - StmtInfo: ImportInfo{ - ImportPath: pkg.importPathShort, - Name: candidateImportName(pkg), - }, - IdentName: pkg.packageName, - FixType: AddImport, - Relevance: pkg.relevance, - }, - Exports: exports, - }) - }, - } - return getCandidatePkgs(ctx, callback, filename, filePkg, env) -} - -var requiredGoEnvVars = []string{"GO111MODULE", "GOFLAGS", "GOINSECURE", "GOMOD", "GOMODCACHE", "GONOPROXY", "GONOSUMDB", "GOPATH", "GOPROXY", "GOROOT", "GOSUMDB", "GOWORK"} - -// ProcessEnv contains environment variables and settings that affect the use of -// the go command, the go/build package, etc. -type ProcessEnv struct { - GocmdRunner *gocommand.Runner - - BuildFlags []string - ModFlag string - ModFile string - - // SkipPathInScan returns true if the path should be skipped from scans of - // the RootCurrentModule root type. The function argument is a clean, - // absolute path. - SkipPathInScan func(string) bool - - // Env overrides the OS environment, and can be used to specify - // GOPROXY, GO111MODULE, etc. PATH cannot be set here, because - // exec.Command will not honor it. - // Specifying all of RequiredGoEnvVars avoids a call to `go env`. - Env map[string]string - - WorkingDir string - - // If Logf is non-nil, debug logging is enabled through this function. - Logf func(format string, args ...interface{}) - - initialized bool - - resolver Resolver -} - -func (e *ProcessEnv) goEnv() (map[string]string, error) { - if err := e.init(); err != nil { - return nil, err - } - return e.Env, nil -} - -func (e *ProcessEnv) matchFile(dir, name string) (bool, error) { - bctx, err := e.buildContext() - if err != nil { - return false, err - } - return bctx.MatchFile(dir, name) -} - -// CopyConfig copies the env's configuration into a new env. -func (e *ProcessEnv) CopyConfig() *ProcessEnv { - copy := &ProcessEnv{ - GocmdRunner: e.GocmdRunner, - initialized: e.initialized, - BuildFlags: e.BuildFlags, - Logf: e.Logf, - WorkingDir: e.WorkingDir, - resolver: nil, - Env: map[string]string{}, - } - for k, v := range e.Env { - copy.Env[k] = v - } - return copy -} - -func (e *ProcessEnv) init() error { - if e.initialized { - return nil - } - - foundAllRequired := true - for _, k := range requiredGoEnvVars { - if _, ok := e.Env[k]; !ok { - foundAllRequired = false - break - } - } - if foundAllRequired { - e.initialized = true - return nil - } - - if e.Env == nil { - e.Env = map[string]string{} - } - - goEnv := map[string]string{} - stdout, err := e.invokeGo(context.TODO(), "env", append([]string{"-json"}, requiredGoEnvVars...)...) - if err != nil { - return err - } - if err := json.Unmarshal(stdout.Bytes(), &goEnv); err != nil { - return err - } - for k, v := range goEnv { - e.Env[k] = v - } - e.initialized = true - return nil -} - -func (e *ProcessEnv) env() []string { - var env []string // the gocommand package will prepend os.Environ. - for k, v := range e.Env { - env = append(env, k+"="+v) - } - return env -} - -func (e *ProcessEnv) GetResolver() (Resolver, error) { - if e.resolver != nil { - return e.resolver, nil - } - if err := e.init(); err != nil { - return nil, err - } - if len(e.Env["GOMOD"]) == 0 && len(e.Env["GOWORK"]) == 0 { - e.resolver = newGopathResolver(e) - return e.resolver, nil - } - e.resolver = newModuleResolver(e) - return e.resolver, nil -} - -func (e *ProcessEnv) buildContext() (*build.Context, error) { - ctx := build.Default - goenv, err := e.goEnv() - if err != nil { - return nil, err - } - ctx.GOROOT = goenv["GOROOT"] - ctx.GOPATH = goenv["GOPATH"] - - // As of Go 1.14, build.Context has a Dir field - // (see golang.org/issue/34860). - // Populate it only if present. - rc := reflect.ValueOf(&ctx).Elem() - dir := rc.FieldByName("Dir") - if dir.IsValid() && dir.Kind() == reflect.String { - dir.SetString(e.WorkingDir) - } - - // Since Go 1.11, go/build.Context.Import may invoke 'go list' depending on - // the value in GO111MODULE in the process's environment. We always want to - // run in GOPATH mode when calling Import, so we need to prevent this from - // happening. In Go 1.16, GO111MODULE defaults to "on", so this problem comes - // up more frequently. - // - // HACK: setting any of the Context I/O hooks prevents Import from invoking - // 'go list', regardless of GO111MODULE. This is undocumented, but it's - // unlikely to change before GOPATH support is removed. - ctx.ReadDir = ioutil.ReadDir - - return &ctx, nil -} - -func (e *ProcessEnv) invokeGo(ctx context.Context, verb string, args ...string) (*bytes.Buffer, error) { - inv := gocommand.Invocation{ - Verb: verb, - Args: args, - BuildFlags: e.BuildFlags, - Env: e.env(), - Logf: e.Logf, - WorkingDir: e.WorkingDir, - } - return e.GocmdRunner.Run(ctx, inv) -} - -func addStdlibCandidates(pass *pass, refs references) error { - goenv, err := pass.env.goEnv() - if err != nil { - return err - } - add := func(pkg string) { - // Prevent self-imports. - if path.Base(pkg) == pass.f.Name.Name && filepath.Join(goenv["GOROOT"], "src", pkg) == pass.srcDir { - return - } - exports := copyExports(stdlib[pkg]) - pass.addCandidate( - &ImportInfo{ImportPath: pkg}, - &packageInfo{name: path.Base(pkg), exports: exports}) - } - for left := range refs { - if left == "rand" { - // Make sure we try crypto/rand before math/rand. - add("crypto/rand") - add("math/rand") - continue - } - for importPath := range stdlib { - if path.Base(importPath) == left { - add(importPath) - } - } - } - return nil -} - -// A Resolver does the build-system-specific parts of goimports. -type Resolver interface { - // loadPackageNames loads the package names in importPaths. - loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) - // scan works with callback to search for packages. See scanCallback for details. - scan(ctx context.Context, callback *scanCallback) error - // loadExports returns the set of exported symbols in the package at dir. - // loadExports may be called concurrently. - loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) - // scoreImportPath returns the relevance for an import path. - scoreImportPath(ctx context.Context, path string) float64 - - ClearForNewScan() -} - -// A scanCallback controls a call to scan and receives its results. -// In general, minor errors will be silently discarded; a user should not -// expect to receive a full series of calls for everything. -type scanCallback struct { - // rootFound is called before scanning a new root dir. If it returns true, - // the root will be scanned. Returning false will not necessarily prevent - // directories from that root making it to dirFound. - rootFound func(gopathwalk.Root) bool - // dirFound is called when a directory is found that is possibly a Go package. - // pkg will be populated with everything except packageName. - // If it returns true, the package's name will be loaded. - dirFound func(pkg *pkg) bool - // packageNameLoaded is called when a package is found and its name is loaded. - // If it returns true, the package's exports will be loaded. - packageNameLoaded func(pkg *pkg) bool - // exportsLoaded is called when a package's exports have been loaded. - exportsLoaded func(pkg *pkg, exports []string) -} - -func addExternalCandidates(ctx context.Context, pass *pass, refs references, filename string) error { - ctx, done := event.Start(ctx, "imports.addExternalCandidates") - defer done() - - var mu sync.Mutex - found := make(map[string][]pkgDistance) - callback := &scanCallback{ - rootFound: func(gopathwalk.Root) bool { - return true // We want everything. - }, - dirFound: func(pkg *pkg) bool { - return pkgIsCandidate(filename, refs, pkg) - }, - packageNameLoaded: func(pkg *pkg) bool { - if _, want := refs[pkg.packageName]; !want { - return false - } - if pkg.dir == pass.srcDir && pass.f.Name.Name == pkg.packageName { - // The candidate is in the same directory and has the - // same package name. Don't try to import ourselves. - return false - } - if !canUse(filename, pkg.dir) { - return false - } - mu.Lock() - defer mu.Unlock() - found[pkg.packageName] = append(found[pkg.packageName], pkgDistance{pkg, distance(pass.srcDir, pkg.dir)}) - return false // We'll do our own loading after we sort. - }, - } - resolver, err := pass.env.GetResolver() - if err != nil { - return err - } - if err = resolver.scan(context.Background(), callback); err != nil { - return err - } - - // Search for imports matching potential package references. - type result struct { - imp *ImportInfo - pkg *packageInfo - } - results := make(chan result, len(refs)) - - ctx, cancel := context.WithCancel(context.TODO()) - var wg sync.WaitGroup - defer func() { - cancel() - wg.Wait() - }() - var ( - firstErr error - firstErrOnce sync.Once - ) - for pkgName, symbols := range refs { - wg.Add(1) - go func(pkgName string, symbols map[string]bool) { - defer wg.Done() - - found, err := findImport(ctx, pass, found[pkgName], pkgName, symbols, filename) - - if err != nil { - firstErrOnce.Do(func() { - firstErr = err - cancel() - }) - return - } - - if found == nil { - return // No matching package. - } - - imp := &ImportInfo{ - ImportPath: found.importPathShort, - } - - pkg := &packageInfo{ - name: pkgName, - exports: symbols, - } - results <- result{imp, pkg} - }(pkgName, symbols) - } - go func() { - wg.Wait() - close(results) - }() - - for result := range results { - pass.addCandidate(result.imp, result.pkg) - } - return firstErr -} - -// notIdentifier reports whether ch is an invalid identifier character. -func notIdentifier(ch rune) bool { - return !('a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || - '0' <= ch && ch <= '9' || - ch == '_' || - ch >= utf8.RuneSelf && (unicode.IsLetter(ch) || unicode.IsDigit(ch))) -} - -// ImportPathToAssumedName returns the assumed package name of an import path. -// It does this using only string parsing of the import path. -// It picks the last element of the path that does not look like a major -// version, and then picks the valid identifier off the start of that element. -// It is used to determine if a local rename should be added to an import for -// clarity. -// This function could be moved to a standard package and exported if we want -// for use in other tools. -func ImportPathToAssumedName(importPath string) string { - base := path.Base(importPath) - if strings.HasPrefix(base, "v") { - if _, err := strconv.Atoi(base[1:]); err == nil { - dir := path.Dir(importPath) - if dir != "." { - base = path.Base(dir) - } - } - } - base = strings.TrimPrefix(base, "go-") - if i := strings.IndexFunc(base, notIdentifier); i >= 0 { - base = base[:i] - } - return base -} - -// gopathResolver implements resolver for GOPATH workspaces. -type gopathResolver struct { - env *ProcessEnv - walked bool - cache *dirInfoCache - scanSema chan struct{} // scanSema prevents concurrent scans. -} - -func newGopathResolver(env *ProcessEnv) *gopathResolver { - r := &gopathResolver{ - env: env, - cache: &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - }, - scanSema: make(chan struct{}, 1), - } - r.scanSema <- struct{}{} - return r -} - -func (r *gopathResolver) ClearForNewScan() { - <-r.scanSema - r.cache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - r.walked = false - r.scanSema <- struct{}{} -} - -func (r *gopathResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { - names := map[string]string{} - bctx, err := r.env.buildContext() - if err != nil { - return nil, err - } - for _, path := range importPaths { - names[path] = importPathToName(bctx, path, srcDir) - } - return names, nil -} - -// importPathToName finds out the actual package name, as declared in its .go files. -func importPathToName(bctx *build.Context, importPath, srcDir string) string { - // Fast path for standard library without going to disk. - if _, ok := stdlib[importPath]; ok { - return path.Base(importPath) // stdlib packages always match their paths. - } - - buildPkg, err := bctx.Import(importPath, srcDir, build.FindOnly) - if err != nil { - return "" - } - pkgName, err := packageDirToName(buildPkg.Dir) - if err != nil { - return "" - } - return pkgName -} - -// packageDirToName is a faster version of build.Import if -// the only thing desired is the package name. Given a directory, -// packageDirToName then only parses one file in the package, -// trusting that the files in the directory are consistent. -func packageDirToName(dir string) (packageName string, err error) { - d, err := os.Open(dir) - if err != nil { - return "", err - } - names, err := d.Readdirnames(-1) - d.Close() - if err != nil { - return "", err - } - sort.Strings(names) // to have predictable behavior - var lastErr error - var nfile int - for _, name := range names { - if !strings.HasSuffix(name, ".go") { - continue - } - if strings.HasSuffix(name, "_test.go") { - continue - } - nfile++ - fullFile := filepath.Join(dir, name) - - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, fullFile, nil, parser.PackageClauseOnly) - if err != nil { - lastErr = err - continue - } - pkgName := f.Name.Name - if pkgName == "documentation" { - // Special case from go/build.ImportDir, not - // handled by ctx.MatchFile. - continue - } - if pkgName == "main" { - // Also skip package main, assuming it's a +build ignore generator or example. - // Since you can't import a package main anyway, there's no harm here. - continue - } - return pkgName, nil - } - if lastErr != nil { - return "", lastErr - } - return "", fmt.Errorf("no importable package found in %d Go files", nfile) -} - -type pkg struct { - dir string // absolute file path to pkg directory ("/usr/lib/go/src/net/http") - importPathShort string // vendorless import path ("net/http", "a/b") - packageName string // package name loaded from source if requested - relevance float64 // a weakly-defined score of how relevant a package is. 0 is most relevant. -} - -type pkgDistance struct { - pkg *pkg - distance int // relative distance to target -} - -// byDistanceOrImportPathShortLength sorts by relative distance breaking ties -// on the short import path length and then the import string itself. -type byDistanceOrImportPathShortLength []pkgDistance - -func (s byDistanceOrImportPathShortLength) Len() int { return len(s) } -func (s byDistanceOrImportPathShortLength) Less(i, j int) bool { - di, dj := s[i].distance, s[j].distance - if di == -1 { - return false - } - if dj == -1 { - return true - } - if di != dj { - return di < dj - } - - vi, vj := s[i].pkg.importPathShort, s[j].pkg.importPathShort - if len(vi) != len(vj) { - return len(vi) < len(vj) - } - return vi < vj -} -func (s byDistanceOrImportPathShortLength) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -func distance(basepath, targetpath string) int { - p, err := filepath.Rel(basepath, targetpath) - if err != nil { - return -1 - } - if p == "." { - return 0 - } - return strings.Count(p, string(filepath.Separator)) + 1 -} - -func (r *gopathResolver) scan(ctx context.Context, callback *scanCallback) error { - add := func(root gopathwalk.Root, dir string) { - // We assume cached directories have not changed. We can skip them and their - // children. - if _, ok := r.cache.Load(dir); ok { - return - } - - importpath := filepath.ToSlash(dir[len(root.Path)+len("/"):]) - info := directoryPackageInfo{ - status: directoryScanned, - dir: dir, - rootType: root.Type, - nonCanonicalImportPath: VendorlessPath(importpath), - } - r.cache.Store(dir, info) - } - processDir := func(info directoryPackageInfo) { - // Skip this directory if we were not able to get the package information successfully. - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return - } - - p := &pkg{ - importPathShort: info.nonCanonicalImportPath, - dir: info.dir, - relevance: MaxRelevance - 1, - } - if info.rootType == gopathwalk.RootGOROOT { - p.relevance = MaxRelevance - } - - if !callback.dirFound(p) { - return - } - var err error - p.packageName, err = r.cache.CachePackageName(info) - if err != nil { - return - } - - if !callback.packageNameLoaded(p) { - return - } - if _, exports, err := r.loadExports(ctx, p, false); err == nil { - callback.exportsLoaded(p, exports) - } - } - stop := r.cache.ScanAndListen(ctx, processDir) - defer stop() - - goenv, err := r.env.goEnv() - if err != nil { - return err - } - var roots []gopathwalk.Root - roots = append(roots, gopathwalk.Root{Path: filepath.Join(goenv["GOROOT"], "src"), Type: gopathwalk.RootGOROOT}) - for _, p := range filepath.SplitList(goenv["GOPATH"]) { - roots = append(roots, gopathwalk.Root{Path: filepath.Join(p, "src"), Type: gopathwalk.RootGOPATH}) - } - // The callback is not necessarily safe to use in the goroutine below. Process roots eagerly. - roots = filterRoots(roots, callback.rootFound) - // We can't cancel walks, because we need them to finish to have a usable - // cache. Instead, run them in a separate goroutine and detach. - scanDone := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - return - case <-r.scanSema: - } - defer func() { r.scanSema <- struct{}{} }() - gopathwalk.Walk(roots, add, gopathwalk.Options{Logf: r.env.Logf, ModulesEnabled: false}) - close(scanDone) - }() - select { - case <-ctx.Done(): - case <-scanDone: - } - return nil -} - -func (r *gopathResolver) scoreImportPath(ctx context.Context, path string) float64 { - if _, ok := stdlib[path]; ok { - return MaxRelevance - } - return MaxRelevance - 1 -} - -func filterRoots(roots []gopathwalk.Root, include func(gopathwalk.Root) bool) []gopathwalk.Root { - var result []gopathwalk.Root - for _, root := range roots { - if !include(root) { - continue - } - result = append(result, root) - } - return result -} - -func (r *gopathResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { - if info, ok := r.cache.Load(pkg.dir); ok && !includeTest { - return r.cache.CacheExports(ctx, r.env, info) - } - return loadExportsFromFiles(ctx, r.env, pkg.dir, includeTest) -} - -// VendorlessPath returns the devendorized version of the import path ipath. -// For example, VendorlessPath("foo/bar/vendor/a/b") returns "a/b". -func VendorlessPath(ipath string) string { - // Devendorize for use in import statement. - if i := strings.LastIndex(ipath, "/vendor/"); i >= 0 { - return ipath[i+len("/vendor/"):] - } - if strings.HasPrefix(ipath, "vendor/") { - return ipath[len("vendor/"):] - } - return ipath -} - -func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, includeTest bool) (string, []string, error) { - // Look for non-test, buildable .go files which could provide exports. - all, err := ioutil.ReadDir(dir) - if err != nil { - return "", nil, err - } - var files []os.FileInfo - for _, fi := range all { - name := fi.Name() - if !strings.HasSuffix(name, ".go") || (!includeTest && strings.HasSuffix(name, "_test.go")) { - continue - } - match, err := env.matchFile(dir, fi.Name()) - if err != nil || !match { - continue - } - files = append(files, fi) - } - - if len(files) == 0 { - return "", nil, fmt.Errorf("dir %v contains no buildable, non-test .go files", dir) - } - - var pkgName string - var exports []string - fset := token.NewFileSet() - for _, fi := range files { - select { - case <-ctx.Done(): - return "", nil, ctx.Err() - default: - } - - fullFile := filepath.Join(dir, fi.Name()) - f, err := parser.ParseFile(fset, fullFile, nil, 0) - if err != nil { - if env.Logf != nil { - env.Logf("error parsing %v: %v", fullFile, err) - } - continue - } - if f.Name.Name == "documentation" { - // Special case from go/build.ImportDir, not - // handled by MatchFile above. - continue - } - if includeTest && strings.HasSuffix(f.Name.Name, "_test") { - // x_test package. We want internal test files only. - continue - } - pkgName = f.Name.Name - for name := range f.Scope.Objects { - if ast.IsExported(name) { - exports = append(exports, name) - } - } - } - - if env.Logf != nil { - sortedExports := append([]string(nil), exports...) - sort.Strings(sortedExports) - env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, strings.Join(sortedExports, ", ")) - } - return pkgName, exports, nil -} - -// findImport searches for a package with the given symbols. -// If no package is found, findImport returns ("", false, nil) -func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgName string, symbols map[string]bool, filename string) (*pkg, error) { - // Sort the candidates by their import package length, - // assuming that shorter package names are better than long - // ones. Note that this sorts by the de-vendored name, so - // there's no "penalty" for vendoring. - sort.Sort(byDistanceOrImportPathShortLength(candidates)) - if pass.env.Logf != nil { - for i, c := range candidates { - pass.env.Logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir) - } - } - resolver, err := pass.env.GetResolver() - if err != nil { - return nil, err - } - - // Collect exports for packages with matching names. - rescv := make([]chan *pkg, len(candidates)) - for i := range candidates { - rescv[i] = make(chan *pkg, 1) - } - const maxConcurrentPackageImport = 4 - loadExportsSem := make(chan struct{}, maxConcurrentPackageImport) - - ctx, cancel := context.WithCancel(ctx) - var wg sync.WaitGroup - defer func() { - cancel() - wg.Wait() - }() - - wg.Add(1) - go func() { - defer wg.Done() - for i, c := range candidates { - select { - case loadExportsSem <- struct{}{}: - case <-ctx.Done(): - return - } - - wg.Add(1) - go func(c pkgDistance, resc chan<- *pkg) { - defer func() { - <-loadExportsSem - wg.Done() - }() - - if pass.env.Logf != nil { - pass.env.Logf("loading exports in dir %s (seeking package %s)", c.pkg.dir, pkgName) - } - // If we're an x_test, load the package under test's test variant. - includeTest := strings.HasSuffix(pass.f.Name.Name, "_test") && c.pkg.dir == pass.srcDir - _, exports, err := resolver.loadExports(ctx, c.pkg, includeTest) - if err != nil { - if pass.env.Logf != nil { - pass.env.Logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err) - } - resc <- nil - return - } - - exportsMap := make(map[string]bool, len(exports)) - for _, sym := range exports { - exportsMap[sym] = true - } - - // If it doesn't have the right - // symbols, send nil to mean no match. - for symbol := range symbols { - if !exportsMap[symbol] { - resc <- nil - return - } - } - resc <- c.pkg - }(c, rescv[i]) - } - }() - - for _, resc := range rescv { - pkg := <-resc - if pkg == nil { - continue - } - return pkg, nil - } - return nil, nil -} - -// pkgIsCandidate reports whether pkg is a candidate for satisfying the -// finding which package pkgIdent in the file named by filename is trying -// to refer to. -// -// This check is purely lexical and is meant to be as fast as possible -// because it's run over all $GOPATH directories to filter out poor -// candidates in order to limit the CPU and I/O later parsing the -// exports in candidate packages. -// -// filename is the file being formatted. -// pkgIdent is the package being searched for, like "client" (if -// searching for "client.New") -func pkgIsCandidate(filename string, refs references, pkg *pkg) bool { - // Check "internal" and "vendor" visibility: - if !canUse(filename, pkg.dir) { - return false - } - - // Speed optimization to minimize disk I/O: - // the last two components on disk must contain the - // package name somewhere. - // - // This permits mismatch naming like directory - // "go-foo" being package "foo", or "pkg.v3" being "pkg", - // or directory "google.golang.org/api/cloudbilling/v1" - // being package "cloudbilling", but doesn't - // permit a directory "foo" to be package - // "bar", which is strongly discouraged - // anyway. There's no reason goimports needs - // to be slow just to accommodate that. - for pkgIdent := range refs { - lastTwo := lastTwoComponents(pkg.importPathShort) - if strings.Contains(lastTwo, pkgIdent) { - return true - } - if hasHyphenOrUpperASCII(lastTwo) && !hasHyphenOrUpperASCII(pkgIdent) { - lastTwo = lowerASCIIAndRemoveHyphen(lastTwo) - if strings.Contains(lastTwo, pkgIdent) { - return true - } - } - } - return false -} - -func hasHyphenOrUpperASCII(s string) bool { - for i := 0; i < len(s); i++ { - b := s[i] - if b == '-' || ('A' <= b && b <= 'Z') { - return true - } - } - return false -} - -func lowerASCIIAndRemoveHyphen(s string) (ret string) { - buf := make([]byte, 0, len(s)) - for i := 0; i < len(s); i++ { - b := s[i] - switch { - case b == '-': - continue - case 'A' <= b && b <= 'Z': - buf = append(buf, b+('a'-'A')) - default: - buf = append(buf, b) - } - } - return string(buf) -} - -// canUse reports whether the package in dir is usable from filename, -// respecting the Go "internal" and "vendor" visibility rules. -func canUse(filename, dir string) bool { - // Fast path check, before any allocations. If it doesn't contain vendor - // or internal, it's not tricky: - // Note that this can false-negative on directories like "notinternal", - // but we check it correctly below. This is just a fast path. - if !strings.Contains(dir, "vendor") && !strings.Contains(dir, "internal") { - return true - } - - dirSlash := filepath.ToSlash(dir) - if !strings.Contains(dirSlash, "/vendor/") && !strings.Contains(dirSlash, "/internal/") && !strings.HasSuffix(dirSlash, "/internal") { - return true - } - // Vendor or internal directory only visible from children of parent. - // That means the path from the current directory to the target directory - // can contain ../vendor or ../internal but not ../foo/vendor or ../foo/internal - // or bar/vendor or bar/internal. - // After stripping all the leading ../, the only okay place to see vendor or internal - // is at the very beginning of the path. - absfile, err := filepath.Abs(filename) - if err != nil { - return false - } - absdir, err := filepath.Abs(dir) - if err != nil { - return false - } - rel, err := filepath.Rel(absfile, absdir) - if err != nil { - return false - } - relSlash := filepath.ToSlash(rel) - if i := strings.LastIndex(relSlash, "../"); i >= 0 { - relSlash = relSlash[i+len("../"):] - } - return !strings.Contains(relSlash, "/vendor/") && !strings.Contains(relSlash, "/internal/") && !strings.HasSuffix(relSlash, "/internal") -} - -// lastTwoComponents returns at most the last two path components -// of v, using either / or \ as the path separator. -func lastTwoComponents(v string) string { - nslash := 0 - for i := len(v) - 1; i >= 0; i-- { - if v[i] == '/' || v[i] == '\\' { - nslash++ - if nslash == 2 { - return v[i:] - } - } - } - return v -} - -type visitFn func(node ast.Node) ast.Visitor - -func (fn visitFn) Visit(node ast.Node) ast.Visitor { - return fn(node) -} - -func copyExports(pkg []string) map[string]bool { - m := make(map[string]bool, len(pkg)) - for _, v := range pkg { - m[v] = true - } - return m -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/imports.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/imports.go deleted file mode 100644 index 58e637b90f24..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/imports.go +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate go run mkstdlib.go - -// Package imports implements a Go pretty-printer (like package "go/format") -// that also adds or removes import statements as necessary. -package imports - -import ( - "bufio" - "bytes" - "context" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/printer" - "go/token" - "io" - "regexp" - "strconv" - "strings" - - "golang.org/x/tools/go/ast/astutil" - "golang.org/x/tools/internal/event" -) - -// Options is golang.org/x/tools/imports.Options with extra internal-only options. -type Options struct { - Env *ProcessEnv // The environment to use. Note: this contains the cached module and filesystem state. - - // LocalPrefix is a comma-separated string of import path prefixes, which, if - // set, instructs Process to sort the import paths with the given prefixes - // into another group after 3rd-party packages. - LocalPrefix string - - Fragment bool // Accept fragment of a source file (no package statement) - AllErrors bool // Report all errors (not just the first 10 on different lines) - - Comments bool // Print comments (true if nil *Options provided) - TabIndent bool // Use tabs for indent (true if nil *Options provided) - TabWidth int // Tab width (8 if nil *Options provided) - - FormatOnly bool // Disable the insertion and deletion of imports -} - -// Process implements golang.org/x/tools/imports.Process with explicit context in opt.Env. -func Process(filename string, src []byte, opt *Options) (formatted []byte, err error) { - fileSet := token.NewFileSet() - file, adjust, err := parse(fileSet, filename, src, opt) - if err != nil { - return nil, err - } - - if !opt.FormatOnly { - if err := fixImports(fileSet, file, filename, opt.Env); err != nil { - return nil, err - } - } - return formatFile(fileSet, file, src, adjust, opt) -} - -// FixImports returns a list of fixes to the imports that, when applied, -// will leave the imports in the same state as Process. src and opt must -// be specified. -// -// Note that filename's directory influences which imports can be chosen, -// so it is important that filename be accurate. -func FixImports(ctx context.Context, filename string, src []byte, opt *Options) (fixes []*ImportFix, err error) { - ctx, done := event.Start(ctx, "imports.FixImports") - defer done() - - fileSet := token.NewFileSet() - file, _, err := parse(fileSet, filename, src, opt) - if err != nil { - return nil, err - } - - return getFixes(ctx, fileSet, file, filename, opt.Env) -} - -// ApplyFixes applies all of the fixes to the file and formats it. extraMode -// is added in when parsing the file. src and opts must be specified, but no -// env is needed. -func ApplyFixes(fixes []*ImportFix, filename string, src []byte, opt *Options, extraMode parser.Mode) (formatted []byte, err error) { - // Don't use parse() -- we don't care about fragments or statement lists - // here, and we need to work with unparseable files. - fileSet := token.NewFileSet() - parserMode := parser.Mode(0) - if opt.Comments { - parserMode |= parser.ParseComments - } - if opt.AllErrors { - parserMode |= parser.AllErrors - } - parserMode |= extraMode - - file, err := parser.ParseFile(fileSet, filename, src, parserMode) - if file == nil { - return nil, err - } - - // Apply the fixes to the file. - apply(fileSet, file, fixes) - - return formatFile(fileSet, file, src, nil, opt) -} - -// formatFile formats the file syntax tree. -// It may mutate the token.FileSet. -// -// If an adjust function is provided, it is called after formatting -// with the original source (formatFile's src parameter) and the -// formatted file, and returns the postpocessed result. -func formatFile(fset *token.FileSet, file *ast.File, src []byte, adjust func(orig []byte, src []byte) []byte, opt *Options) ([]byte, error) { - mergeImports(file) - sortImports(opt.LocalPrefix, fset.File(file.Pos()), file) - var spacesBefore []string // import paths we need spaces before - for _, impSection := range astutil.Imports(fset, file) { - // Within each block of contiguous imports, see if any - // import lines are in different group numbers. If so, - // we'll need to put a space between them so it's - // compatible with gofmt. - lastGroup := -1 - for _, importSpec := range impSection { - importPath, _ := strconv.Unquote(importSpec.Path.Value) - groupNum := importGroup(opt.LocalPrefix, importPath) - if groupNum != lastGroup && lastGroup != -1 { - spacesBefore = append(spacesBefore, importPath) - } - lastGroup = groupNum - } - - } - - printerMode := printer.UseSpaces - if opt.TabIndent { - printerMode |= printer.TabIndent - } - printConfig := &printer.Config{Mode: printerMode, Tabwidth: opt.TabWidth} - - var buf bytes.Buffer - err := printConfig.Fprint(&buf, fset, file) - if err != nil { - return nil, err - } - out := buf.Bytes() - if adjust != nil { - out = adjust(src, out) - } - if len(spacesBefore) > 0 { - out, err = addImportSpaces(bytes.NewReader(out), spacesBefore) - if err != nil { - return nil, err - } - } - - out, err = format.Source(out) - if err != nil { - return nil, err - } - return out, nil -} - -// parse parses src, which was read from filename, -// as a Go source file or statement list. -func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast.File, func(orig, src []byte) []byte, error) { - parserMode := parser.Mode(0) - if opt.Comments { - parserMode |= parser.ParseComments - } - if opt.AllErrors { - parserMode |= parser.AllErrors - } - - // Try as whole source file. - file, err := parser.ParseFile(fset, filename, src, parserMode) - if err == nil { - return file, nil, nil - } - // If the error is that the source file didn't begin with a - // package line and we accept fragmented input, fall through to - // try as a source fragment. Stop and return on any other error. - if !opt.Fragment || !strings.Contains(err.Error(), "expected 'package'") { - return nil, nil, err - } - - // If this is a declaration list, make it a source file - // by inserting a package clause. - // Insert using a ;, not a newline, so that parse errors are on - // the correct line. - const prefix = "package main;" - psrc := append([]byte(prefix), src...) - file, err = parser.ParseFile(fset, filename, psrc, parserMode) - if err == nil { - // Gofmt will turn the ; into a \n. - // Do that ourselves now and update the file contents, - // so that positions and line numbers are correct going forward. - psrc[len(prefix)-1] = '\n' - fset.File(file.Package).SetLinesForContent(psrc) - - // If a main function exists, we will assume this is a main - // package and leave the file. - if containsMainFunc(file) { - return file, nil, nil - } - - adjust := func(orig, src []byte) []byte { - // Remove the package clause. - src = src[len(prefix):] - return matchSpace(orig, src) - } - return file, adjust, nil - } - // If the error is that the source file didn't begin with a - // declaration, fall through to try as a statement list. - // Stop and return on any other error. - if !strings.Contains(err.Error(), "expected declaration") { - return nil, nil, err - } - - // If this is a statement list, make it a source file - // by inserting a package clause and turning the list - // into a function body. This handles expressions too. - // Insert using a ;, not a newline, so that the line numbers - // in fsrc match the ones in src. - fsrc := append(append([]byte("package p; func _() {"), src...), '}') - file, err = parser.ParseFile(fset, filename, fsrc, parserMode) - if err == nil { - adjust := func(orig, src []byte) []byte { - // Remove the wrapping. - // Gofmt has turned the ; into a \n\n. - src = src[len("package p\n\nfunc _() {"):] - src = src[:len(src)-len("}\n")] - // Gofmt has also indented the function body one level. - // Remove that indent. - src = bytes.Replace(src, []byte("\n\t"), []byte("\n"), -1) - return matchSpace(orig, src) - } - return file, adjust, nil - } - - // Failed, and out of options. - return nil, nil, err -} - -// containsMainFunc checks if a file contains a function declaration with the -// function signature 'func main()' -func containsMainFunc(file *ast.File) bool { - for _, decl := range file.Decls { - if f, ok := decl.(*ast.FuncDecl); ok { - if f.Name.Name != "main" { - continue - } - - if len(f.Type.Params.List) != 0 { - continue - } - - if f.Type.Results != nil && len(f.Type.Results.List) != 0 { - continue - } - - return true - } - } - - return false -} - -func cutSpace(b []byte) (before, middle, after []byte) { - i := 0 - for i < len(b) && (b[i] == ' ' || b[i] == '\t' || b[i] == '\n') { - i++ - } - j := len(b) - for j > 0 && (b[j-1] == ' ' || b[j-1] == '\t' || b[j-1] == '\n') { - j-- - } - if i <= j { - return b[:i], b[i:j], b[j:] - } - return nil, nil, b[j:] -} - -// matchSpace reformats src to use the same space context as orig. -// 1. If orig begins with blank lines, matchSpace inserts them at the beginning of src. -// 2. matchSpace copies the indentation of the first non-blank line in orig -// to every non-blank line in src. -// 3. matchSpace copies the trailing space from orig and uses it in place -// of src's trailing space. -func matchSpace(orig []byte, src []byte) []byte { - before, _, after := cutSpace(orig) - i := bytes.LastIndex(before, []byte{'\n'}) - before, indent := before[:i+1], before[i+1:] - - _, src, _ = cutSpace(src) - - var b bytes.Buffer - b.Write(before) - for len(src) > 0 { - line := src - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, src = line[:i+1], line[i+1:] - } else { - src = nil - } - if len(line) > 0 && line[0] != '\n' { // not blank - b.Write(indent) - } - b.Write(line) - } - b.Write(after) - return b.Bytes() -} - -var impLine = regexp.MustCompile(`^\s+(?:[\w\.]+\s+)?"(.+?)"`) - -func addImportSpaces(r io.Reader, breaks []string) ([]byte, error) { - var out bytes.Buffer - in := bufio.NewReader(r) - inImports := false - done := false - for { - s, err := in.ReadString('\n') - if err == io.EOF { - break - } else if err != nil { - return nil, err - } - - if !inImports && !done && strings.HasPrefix(s, "import") { - inImports = true - } - if inImports && (strings.HasPrefix(s, "var") || - strings.HasPrefix(s, "func") || - strings.HasPrefix(s, "const") || - strings.HasPrefix(s, "type")) { - done = true - inImports = false - } - if inImports && len(breaks) > 0 { - if m := impLine.FindStringSubmatch(s); m != nil { - if m[1] == breaks[0] { - out.WriteByte('\n') - breaks = breaks[1:] - } - } - } - - fmt.Fprint(&out, s) - } - return out.Bytes(), nil -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/mod.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/mod.go deleted file mode 100644 index 977d2389da12..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/mod.go +++ /dev/null @@ -1,724 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package imports - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path" - "path/filepath" - "regexp" - "sort" - "strconv" - "strings" - - "golang.org/x/mod/module" - "golang.org/x/tools/internal/event" - "golang.org/x/tools/internal/gocommand" - "golang.org/x/tools/internal/gopathwalk" -) - -// ModuleResolver implements resolver for modules using the go command as little -// as feasible. -type ModuleResolver struct { - env *ProcessEnv - moduleCacheDir string - dummyVendorMod *gocommand.ModuleJSON // If vendoring is enabled, the pseudo-module that represents the /vendor directory. - roots []gopathwalk.Root - scanSema chan struct{} // scanSema prevents concurrent scans and guards scannedRoots. - scannedRoots map[gopathwalk.Root]bool - - initialized bool - mains []*gocommand.ModuleJSON - mainByDir map[string]*gocommand.ModuleJSON - modsByModPath []*gocommand.ModuleJSON // All modules, ordered by # of path components in module Path... - modsByDir []*gocommand.ModuleJSON // ...or number of path components in their Dir. - - // moduleCacheCache stores information about the module cache. - moduleCacheCache *dirInfoCache - otherCache *dirInfoCache -} - -func newModuleResolver(e *ProcessEnv) *ModuleResolver { - r := &ModuleResolver{ - env: e, - scanSema: make(chan struct{}, 1), - } - r.scanSema <- struct{}{} - return r -} - -func (r *ModuleResolver) init() error { - if r.initialized { - return nil - } - - goenv, err := r.env.goEnv() - if err != nil { - return err - } - inv := gocommand.Invocation{ - BuildFlags: r.env.BuildFlags, - ModFlag: r.env.ModFlag, - ModFile: r.env.ModFile, - Env: r.env.env(), - Logf: r.env.Logf, - WorkingDir: r.env.WorkingDir, - } - - vendorEnabled := false - var mainModVendor *gocommand.ModuleJSON - - // Module vendor directories are ignored in workspace mode: - // https://go.googlesource.com/proposal/+/master/design/45713-workspace.md - if len(r.env.Env["GOWORK"]) == 0 { - vendorEnabled, mainModVendor, err = gocommand.VendorEnabled(context.TODO(), inv, r.env.GocmdRunner) - if err != nil { - return err - } - } - - if mainModVendor != nil && vendorEnabled { - // Vendor mode is on, so all the non-Main modules are irrelevant, - // and we need to search /vendor for everything. - r.mains = []*gocommand.ModuleJSON{mainModVendor} - r.dummyVendorMod = &gocommand.ModuleJSON{ - Path: "", - Dir: filepath.Join(mainModVendor.Dir, "vendor"), - } - r.modsByModPath = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} - r.modsByDir = []*gocommand.ModuleJSON{mainModVendor, r.dummyVendorMod} - } else { - // Vendor mode is off, so run go list -m ... to find everything. - err := r.initAllMods() - // We expect an error when running outside of a module with - // GO111MODULE=on. Other errors are fatal. - if err != nil { - if errMsg := err.Error(); !strings.Contains(errMsg, "working directory is not part of a module") && !strings.Contains(errMsg, "go.mod file not found") { - return err - } - } - } - - if gmc := r.env.Env["GOMODCACHE"]; gmc != "" { - r.moduleCacheDir = gmc - } else { - gopaths := filepath.SplitList(goenv["GOPATH"]) - if len(gopaths) == 0 { - return fmt.Errorf("empty GOPATH") - } - r.moduleCacheDir = filepath.Join(gopaths[0], "/pkg/mod") - } - - sort.Slice(r.modsByModPath, func(i, j int) bool { - count := func(x int) int { - return strings.Count(r.modsByModPath[x].Path, "/") - } - return count(j) < count(i) // descending order - }) - sort.Slice(r.modsByDir, func(i, j int) bool { - count := func(x int) int { - return strings.Count(r.modsByDir[x].Dir, string(filepath.Separator)) - } - return count(j) < count(i) // descending order - }) - - r.roots = []gopathwalk.Root{ - {Path: filepath.Join(goenv["GOROOT"], "/src"), Type: gopathwalk.RootGOROOT}, - } - r.mainByDir = make(map[string]*gocommand.ModuleJSON) - for _, main := range r.mains { - r.roots = append(r.roots, gopathwalk.Root{Path: main.Dir, Type: gopathwalk.RootCurrentModule}) - r.mainByDir[main.Dir] = main - } - if vendorEnabled { - r.roots = append(r.roots, gopathwalk.Root{Path: r.dummyVendorMod.Dir, Type: gopathwalk.RootOther}) - } else { - addDep := func(mod *gocommand.ModuleJSON) { - if mod.Replace == nil { - // This is redundant with the cache, but we'll skip it cheaply enough. - r.roots = append(r.roots, gopathwalk.Root{Path: mod.Dir, Type: gopathwalk.RootModuleCache}) - } else { - r.roots = append(r.roots, gopathwalk.Root{Path: mod.Dir, Type: gopathwalk.RootOther}) - } - } - // Walk dependent modules before scanning the full mod cache, direct deps first. - for _, mod := range r.modsByModPath { - if !mod.Indirect && !mod.Main { - addDep(mod) - } - } - for _, mod := range r.modsByModPath { - if mod.Indirect && !mod.Main { - addDep(mod) - } - } - r.roots = append(r.roots, gopathwalk.Root{Path: r.moduleCacheDir, Type: gopathwalk.RootModuleCache}) - } - - r.scannedRoots = map[gopathwalk.Root]bool{} - if r.moduleCacheCache == nil { - r.moduleCacheCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - } - if r.otherCache == nil { - r.otherCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - } - r.initialized = true - return nil -} - -func (r *ModuleResolver) initAllMods() error { - stdout, err := r.env.invokeGo(context.TODO(), "list", "-m", "-e", "-json", "...") - if err != nil { - return err - } - for dec := json.NewDecoder(stdout); dec.More(); { - mod := &gocommand.ModuleJSON{} - if err := dec.Decode(mod); err != nil { - return err - } - if mod.Dir == "" { - if r.env.Logf != nil { - r.env.Logf("module %v has not been downloaded and will be ignored", mod.Path) - } - // Can't do anything with a module that's not downloaded. - continue - } - // golang/go#36193: the go command doesn't always clean paths. - mod.Dir = filepath.Clean(mod.Dir) - r.modsByModPath = append(r.modsByModPath, mod) - r.modsByDir = append(r.modsByDir, mod) - if mod.Main { - r.mains = append(r.mains, mod) - } - } - return nil -} - -func (r *ModuleResolver) ClearForNewScan() { - <-r.scanSema - r.scannedRoots = map[gopathwalk.Root]bool{} - r.otherCache = &dirInfoCache{ - dirs: map[string]*directoryPackageInfo{}, - listeners: map[*int]cacheListener{}, - } - r.scanSema <- struct{}{} -} - -func (r *ModuleResolver) ClearForNewMod() { - <-r.scanSema - *r = ModuleResolver{ - env: r.env, - moduleCacheCache: r.moduleCacheCache, - otherCache: r.otherCache, - scanSema: r.scanSema, - } - r.init() - r.scanSema <- struct{}{} -} - -// findPackage returns the module and directory that contains the package at -// the given import path, or returns nil, "" if no module is in scope. -func (r *ModuleResolver) findPackage(importPath string) (*gocommand.ModuleJSON, string) { - // This can't find packages in the stdlib, but that's harmless for all - // the existing code paths. - for _, m := range r.modsByModPath { - if !strings.HasPrefix(importPath, m.Path) { - continue - } - pathInModule := importPath[len(m.Path):] - pkgDir := filepath.Join(m.Dir, pathInModule) - if r.dirIsNestedModule(pkgDir, m) { - continue - } - - if info, ok := r.cacheLoad(pkgDir); ok { - if loaded, err := info.reachedStatus(nameLoaded); loaded { - if err != nil { - continue // No package in this dir. - } - return m, pkgDir - } - if scanned, err := info.reachedStatus(directoryScanned); scanned && err != nil { - continue // Dir is unreadable, etc. - } - // This is slightly wrong: a directory doesn't have to have an - // importable package to count as a package for package-to-module - // resolution. package main or _test files should count but - // don't. - // TODO(heschi): fix this. - if _, err := r.cachePackageName(info); err == nil { - return m, pkgDir - } - } - - // Not cached. Read the filesystem. - pkgFiles, err := ioutil.ReadDir(pkgDir) - if err != nil { - continue - } - // A module only contains a package if it has buildable go - // files in that directory. If not, it could be provided by an - // outer module. See #29736. - for _, fi := range pkgFiles { - if ok, _ := r.env.matchFile(pkgDir, fi.Name()); ok { - return m, pkgDir - } - } - } - return nil, "" -} - -func (r *ModuleResolver) cacheLoad(dir string) (directoryPackageInfo, bool) { - if info, ok := r.moduleCacheCache.Load(dir); ok { - return info, ok - } - return r.otherCache.Load(dir) -} - -func (r *ModuleResolver) cacheStore(info directoryPackageInfo) { - if info.rootType == gopathwalk.RootModuleCache { - r.moduleCacheCache.Store(info.dir, info) - } else { - r.otherCache.Store(info.dir, info) - } -} - -func (r *ModuleResolver) cacheKeys() []string { - return append(r.moduleCacheCache.Keys(), r.otherCache.Keys()...) -} - -// cachePackageName caches the package name for a dir already in the cache. -func (r *ModuleResolver) cachePackageName(info directoryPackageInfo) (string, error) { - if info.rootType == gopathwalk.RootModuleCache { - return r.moduleCacheCache.CachePackageName(info) - } - return r.otherCache.CachePackageName(info) -} - -func (r *ModuleResolver) cacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { - if info.rootType == gopathwalk.RootModuleCache { - return r.moduleCacheCache.CacheExports(ctx, env, info) - } - return r.otherCache.CacheExports(ctx, env, info) -} - -// findModuleByDir returns the module that contains dir, or nil if no such -// module is in scope. -func (r *ModuleResolver) findModuleByDir(dir string) *gocommand.ModuleJSON { - // This is quite tricky and may not be correct. dir could be: - // - a package in the main module. - // - a replace target underneath the main module's directory. - // - a nested module in the above. - // - a replace target somewhere totally random. - // - a nested module in the above. - // - in the mod cache. - // - in /vendor/ in -mod=vendor mode. - // - nested module? Dunno. - // Rumor has it that replace targets cannot contain other replace targets. - // - // Note that it is critical here that modsByDir is sorted to have deeper dirs - // first. This ensures that findModuleByDir finds the innermost module. - // See also golang/go#56291. - for _, m := range r.modsByDir { - if !strings.HasPrefix(dir, m.Dir) { - continue - } - - if r.dirIsNestedModule(dir, m) { - continue - } - - return m - } - return nil -} - -// dirIsNestedModule reports if dir is contained in a nested module underneath -// mod, not actually in mod. -func (r *ModuleResolver) dirIsNestedModule(dir string, mod *gocommand.ModuleJSON) bool { - if !strings.HasPrefix(dir, mod.Dir) { - return false - } - if r.dirInModuleCache(dir) { - // Nested modules in the module cache are pruned, - // so it cannot be a nested module. - return false - } - if mod != nil && mod == r.dummyVendorMod { - // The /vendor pseudomodule is flattened and doesn't actually count. - return false - } - modDir, _ := r.modInfo(dir) - if modDir == "" { - return false - } - return modDir != mod.Dir -} - -func (r *ModuleResolver) modInfo(dir string) (modDir string, modName string) { - readModName := func(modFile string) string { - modBytes, err := ioutil.ReadFile(modFile) - if err != nil { - return "" - } - return modulePath(modBytes) - } - - if r.dirInModuleCache(dir) { - if matches := modCacheRegexp.FindStringSubmatch(dir); len(matches) == 3 { - index := strings.Index(dir, matches[1]+"@"+matches[2]) - modDir := filepath.Join(dir[:index], matches[1]+"@"+matches[2]) - return modDir, readModName(filepath.Join(modDir, "go.mod")) - } - } - for { - if info, ok := r.cacheLoad(dir); ok { - return info.moduleDir, info.moduleName - } - f := filepath.Join(dir, "go.mod") - info, err := os.Stat(f) - if err == nil && !info.IsDir() { - return dir, readModName(f) - } - - d := filepath.Dir(dir) - if len(d) >= len(dir) { - return "", "" // reached top of file system, no go.mod - } - dir = d - } -} - -func (r *ModuleResolver) dirInModuleCache(dir string) bool { - if r.moduleCacheDir == "" { - return false - } - return strings.HasPrefix(dir, r.moduleCacheDir) -} - -func (r *ModuleResolver) loadPackageNames(importPaths []string, srcDir string) (map[string]string, error) { - if err := r.init(); err != nil { - return nil, err - } - names := map[string]string{} - for _, path := range importPaths { - _, packageDir := r.findPackage(path) - if packageDir == "" { - continue - } - name, err := packageDirToName(packageDir) - if err != nil { - continue - } - names[path] = name - } - return names, nil -} - -func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error { - ctx, done := event.Start(ctx, "imports.ModuleResolver.scan") - defer done() - - if err := r.init(); err != nil { - return err - } - - processDir := func(info directoryPackageInfo) { - // Skip this directory if we were not able to get the package information successfully. - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return - } - pkg, err := r.canonicalize(info) - if err != nil { - return - } - - if !callback.dirFound(pkg) { - return - } - pkg.packageName, err = r.cachePackageName(info) - if err != nil { - return - } - - if !callback.packageNameLoaded(pkg) { - return - } - _, exports, err := r.loadExports(ctx, pkg, false) - if err != nil { - return - } - callback.exportsLoaded(pkg, exports) - } - - // Start processing everything in the cache, and listen for the new stuff - // we discover in the walk below. - stop1 := r.moduleCacheCache.ScanAndListen(ctx, processDir) - defer stop1() - stop2 := r.otherCache.ScanAndListen(ctx, processDir) - defer stop2() - - // We assume cached directories are fully cached, including all their - // children, and have not changed. We can skip them. - skip := func(root gopathwalk.Root, dir string) bool { - if r.env.SkipPathInScan != nil && root.Type == gopathwalk.RootCurrentModule { - if root.Path == dir { - return false - } - - if r.env.SkipPathInScan(filepath.Clean(dir)) { - return true - } - } - - info, ok := r.cacheLoad(dir) - if !ok { - return false - } - // This directory can be skipped as long as we have already scanned it. - // Packages with errors will continue to have errors, so there is no need - // to rescan them. - packageScanned, _ := info.reachedStatus(directoryScanned) - return packageScanned - } - - // Add anything new to the cache, and process it if we're still listening. - add := func(root gopathwalk.Root, dir string) { - r.cacheStore(r.scanDirForPackage(root, dir)) - } - - // r.roots and the callback are not necessarily safe to use in the - // goroutine below. Process them eagerly. - roots := filterRoots(r.roots, callback.rootFound) - // We can't cancel walks, because we need them to finish to have a usable - // cache. Instead, run them in a separate goroutine and detach. - scanDone := make(chan struct{}) - go func() { - select { - case <-ctx.Done(): - return - case <-r.scanSema: - } - defer func() { r.scanSema <- struct{}{} }() - // We have the lock on r.scannedRoots, and no other scans can run. - for _, root := range roots { - if ctx.Err() != nil { - return - } - - if r.scannedRoots[root] { - continue - } - gopathwalk.WalkSkip([]gopathwalk.Root{root}, add, skip, gopathwalk.Options{Logf: r.env.Logf, ModulesEnabled: true}) - r.scannedRoots[root] = true - } - close(scanDone) - }() - select { - case <-ctx.Done(): - case <-scanDone: - } - return nil -} - -func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) float64 { - if _, ok := stdlib[path]; ok { - return MaxRelevance - } - mod, _ := r.findPackage(path) - return modRelevance(mod) -} - -func modRelevance(mod *gocommand.ModuleJSON) float64 { - var relevance float64 - switch { - case mod == nil: // out of scope - return MaxRelevance - 4 - case mod.Indirect: - relevance = MaxRelevance - 3 - case !mod.Main: - relevance = MaxRelevance - 2 - default: - relevance = MaxRelevance - 1 // main module ties with stdlib - } - - _, versionString, ok := module.SplitPathVersion(mod.Path) - if ok { - index := strings.Index(versionString, "v") - if index == -1 { - return relevance - } - if versionNumber, err := strconv.ParseFloat(versionString[index+1:], 64); err == nil { - relevance += versionNumber / 1000 - } - } - - return relevance -} - -// canonicalize gets the result of canonicalizing the packages using the results -// of initializing the resolver from 'go list -m'. -func (r *ModuleResolver) canonicalize(info directoryPackageInfo) (*pkg, error) { - // Packages in GOROOT are already canonical, regardless of the std/cmd modules. - if info.rootType == gopathwalk.RootGOROOT { - return &pkg{ - importPathShort: info.nonCanonicalImportPath, - dir: info.dir, - packageName: path.Base(info.nonCanonicalImportPath), - relevance: MaxRelevance, - }, nil - } - - importPath := info.nonCanonicalImportPath - mod := r.findModuleByDir(info.dir) - // Check if the directory is underneath a module that's in scope. - if mod != nil { - // It is. If dir is the target of a replace directive, - // our guessed import path is wrong. Use the real one. - if mod.Dir == info.dir { - importPath = mod.Path - } else { - dirInMod := info.dir[len(mod.Dir)+len("/"):] - importPath = path.Join(mod.Path, filepath.ToSlash(dirInMod)) - } - } else if !strings.HasPrefix(importPath, info.moduleName) { - // The module's name doesn't match the package's import path. It - // probably needs a replace directive we don't have. - return nil, fmt.Errorf("package in %q is not valid without a replace statement", info.dir) - } - - res := &pkg{ - importPathShort: importPath, - dir: info.dir, - relevance: modRelevance(mod), - } - // We may have discovered a package that has a different version - // in scope already. Canonicalize to that one if possible. - if _, canonicalDir := r.findPackage(importPath); canonicalDir != "" { - res.dir = canonicalDir - } - return res, nil -} - -func (r *ModuleResolver) loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) { - if err := r.init(); err != nil { - return "", nil, err - } - if info, ok := r.cacheLoad(pkg.dir); ok && !includeTest { - return r.cacheExports(ctx, r.env, info) - } - return loadExportsFromFiles(ctx, r.env, pkg.dir, includeTest) -} - -func (r *ModuleResolver) scanDirForPackage(root gopathwalk.Root, dir string) directoryPackageInfo { - subdir := "" - if dir != root.Path { - subdir = dir[len(root.Path)+len("/"):] - } - importPath := filepath.ToSlash(subdir) - if strings.HasPrefix(importPath, "vendor/") { - // Only enter vendor directories if they're explicitly requested as a root. - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("unwanted vendor directory"), - } - } - switch root.Type { - case gopathwalk.RootCurrentModule: - importPath = path.Join(r.mainByDir[root.Path].Path, filepath.ToSlash(subdir)) - case gopathwalk.RootModuleCache: - matches := modCacheRegexp.FindStringSubmatch(subdir) - if len(matches) == 0 { - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("invalid module cache path: %v", subdir), - } - } - modPath, err := module.UnescapePath(filepath.ToSlash(matches[1])) - if err != nil { - if r.env.Logf != nil { - r.env.Logf("decoding module cache path %q: %v", subdir, err) - } - return directoryPackageInfo{ - status: directoryScanned, - err: fmt.Errorf("decoding module cache path %q: %v", subdir, err), - } - } - importPath = path.Join(modPath, filepath.ToSlash(matches[3])) - } - - modDir, modName := r.modInfo(dir) - result := directoryPackageInfo{ - status: directoryScanned, - dir: dir, - rootType: root.Type, - nonCanonicalImportPath: importPath, - moduleDir: modDir, - moduleName: modName, - } - if root.Type == gopathwalk.RootGOROOT { - // stdlib packages are always in scope, despite the confusing go.mod - return result - } - return result -} - -// modCacheRegexp splits a path in a module cache into module, module version, and package. -var modCacheRegexp = regexp.MustCompile(`(.*)@([^/\\]*)(.*)`) - -var ( - slashSlash = []byte("//") - moduleStr = []byte("module") -) - -// modulePath returns the module path from the gomod file text. -// If it cannot find a module path, it returns an empty string. -// It is tolerant of unrelated problems in the go.mod file. -// -// Copied from cmd/go/internal/modfile. -func modulePath(mod []byte) string { - for len(mod) > 0 { - line := mod - mod = nil - if i := bytes.IndexByte(line, '\n'); i >= 0 { - line, mod = line[:i], line[i+1:] - } - if i := bytes.Index(line, slashSlash); i >= 0 { - line = line[:i] - } - line = bytes.TrimSpace(line) - if !bytes.HasPrefix(line, moduleStr) { - continue - } - line = line[len(moduleStr):] - n := len(line) - line = bytes.TrimSpace(line) - if len(line) == n || len(line) == 0 { - continue - } - - if line[0] == '"' || line[0] == '`' { - p, err := strconv.Unquote(string(line)) - if err != nil { - return "" // malformed quoted string or multiline module path - } - return p - } - - return string(line) - } - return "" // missing module path -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/mod_cache.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/mod_cache.go deleted file mode 100644 index 45690abbb4f1..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/mod_cache.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package imports - -import ( - "context" - "fmt" - "sync" - - "golang.org/x/tools/internal/gopathwalk" -) - -// To find packages to import, the resolver needs to know about all of -// the packages that could be imported. This includes packages that are -// already in modules that are in (1) the current module, (2) replace targets, -// and (3) packages in the module cache. Packages in (1) and (2) may change over -// time, as the client may edit the current module and locally replaced modules. -// The module cache (which includes all of the packages in (3)) can only -// ever be added to. -// -// The resolver can thus save state about packages in the module cache -// and guarantee that this will not change over time. To obtain information -// about new modules added to the module cache, the module cache should be -// rescanned. -// -// It is OK to serve information about modules that have been deleted, -// as they do still exist. -// TODO(suzmue): can we share information with the caller about -// what module needs to be downloaded to import this package? - -type directoryPackageStatus int - -const ( - _ directoryPackageStatus = iota - directoryScanned - nameLoaded - exportsLoaded -) - -type directoryPackageInfo struct { - // status indicates the extent to which this struct has been filled in. - status directoryPackageStatus - // err is non-nil when there was an error trying to reach status. - err error - - // Set when status >= directoryScanned. - - // dir is the absolute directory of this package. - dir string - rootType gopathwalk.RootType - // nonCanonicalImportPath is the package's expected import path. It may - // not actually be importable at that path. - nonCanonicalImportPath string - - // Module-related information. - moduleDir string // The directory that is the module root of this dir. - moduleName string // The module name that contains this dir. - - // Set when status >= nameLoaded. - - packageName string // the package name, as declared in the source. - - // Set when status >= exportsLoaded. - - exports []string -} - -// reachedStatus returns true when info has a status at least target and any error associated with -// an attempt to reach target. -func (info *directoryPackageInfo) reachedStatus(target directoryPackageStatus) (bool, error) { - if info.err == nil { - return info.status >= target, nil - } - if info.status == target { - return true, info.err - } - return true, nil -} - -// dirInfoCache is a concurrency safe map for storing information about -// directories that may contain packages. -// -// The information in this cache is built incrementally. Entries are initialized in scan. -// No new keys should be added in any other functions, as all directories containing -// packages are identified in scan. -// -// Other functions, including loadExports and findPackage, may update entries in this cache -// as they discover new things about the directory. -// -// The information in the cache is not expected to change for the cache's -// lifetime, so there is no protection against competing writes. Users should -// take care not to hold the cache across changes to the underlying files. -// -// TODO(suzmue): consider other concurrency strategies and data structures (RWLocks, sync.Map, etc) -type dirInfoCache struct { - mu sync.Mutex - // dirs stores information about packages in directories, keyed by absolute path. - dirs map[string]*directoryPackageInfo - listeners map[*int]cacheListener -} - -type cacheListener func(directoryPackageInfo) - -// ScanAndListen calls listener on all the items in the cache, and on anything -// newly added. The returned stop function waits for all in-flight callbacks to -// finish and blocks new ones. -func (d *dirInfoCache) ScanAndListen(ctx context.Context, listener cacheListener) func() { - ctx, cancel := context.WithCancel(ctx) - - // Flushing out all the callbacks is tricky without knowing how many there - // are going to be. Setting an arbitrary limit makes it much easier. - const maxInFlight = 10 - sema := make(chan struct{}, maxInFlight) - for i := 0; i < maxInFlight; i++ { - sema <- struct{}{} - } - - cookie := new(int) // A unique ID we can use for the listener. - - // We can't hold mu while calling the listener. - d.mu.Lock() - var keys []string - for key := range d.dirs { - keys = append(keys, key) - } - d.listeners[cookie] = func(info directoryPackageInfo) { - select { - case <-ctx.Done(): - return - case <-sema: - } - listener(info) - sema <- struct{}{} - } - d.mu.Unlock() - - stop := func() { - cancel() - d.mu.Lock() - delete(d.listeners, cookie) - d.mu.Unlock() - for i := 0; i < maxInFlight; i++ { - <-sema - } - } - - // Process the pre-existing keys. - for _, k := range keys { - select { - case <-ctx.Done(): - return stop - default: - } - if v, ok := d.Load(k); ok { - listener(v) - } - } - - return stop -} - -// Store stores the package info for dir. -func (d *dirInfoCache) Store(dir string, info directoryPackageInfo) { - d.mu.Lock() - _, old := d.dirs[dir] - d.dirs[dir] = &info - var listeners []cacheListener - for _, l := range d.listeners { - listeners = append(listeners, l) - } - d.mu.Unlock() - - if !old { - for _, l := range listeners { - l(info) - } - } -} - -// Load returns a copy of the directoryPackageInfo for absolute directory dir. -func (d *dirInfoCache) Load(dir string) (directoryPackageInfo, bool) { - d.mu.Lock() - defer d.mu.Unlock() - info, ok := d.dirs[dir] - if !ok { - return directoryPackageInfo{}, false - } - return *info, true -} - -// Keys returns the keys currently present in d. -func (d *dirInfoCache) Keys() (keys []string) { - d.mu.Lock() - defer d.mu.Unlock() - for key := range d.dirs { - keys = append(keys, key) - } - return keys -} - -func (d *dirInfoCache) CachePackageName(info directoryPackageInfo) (string, error) { - if loaded, err := info.reachedStatus(nameLoaded); loaded { - return info.packageName, err - } - if scanned, err := info.reachedStatus(directoryScanned); !scanned || err != nil { - return "", fmt.Errorf("cannot read package name, scan error: %v", err) - } - info.packageName, info.err = packageDirToName(info.dir) - info.status = nameLoaded - d.Store(info.dir, info) - return info.packageName, info.err -} - -func (d *dirInfoCache) CacheExports(ctx context.Context, env *ProcessEnv, info directoryPackageInfo) (string, []string, error) { - if reached, _ := info.reachedStatus(exportsLoaded); reached { - return info.packageName, info.exports, info.err - } - if reached, err := info.reachedStatus(nameLoaded); reached && err != nil { - return "", nil, err - } - info.packageName, info.exports, info.err = loadExportsFromFiles(ctx, env, info.dir, false) - if info.err == context.Canceled || info.err == context.DeadlineExceeded { - return info.packageName, info.exports, info.err - } - // The cache structure wants things to proceed linearly. We can skip a - // step here, but only if we succeed. - if info.status == nameLoaded || info.err == nil { - info.status = exportsLoaded - } else { - info.status = nameLoaded - } - d.Store(info.dir, info) - return info.packageName, info.exports, info.err -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/sortimports.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/sortimports.go deleted file mode 100644 index 1a0a7ebd9e4d..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/sortimports.go +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Hacked up copy of go/ast/import.go -// Modified to use a single token.File in preference to a FileSet. - -package imports - -import ( - "go/ast" - "go/token" - "log" - "sort" - "strconv" -) - -// sortImports sorts runs of consecutive import lines in import blocks in f. -// It also removes duplicate imports when it is possible to do so without data loss. -// -// It may mutate the token.File. -func sortImports(localPrefix string, tokFile *token.File, f *ast.File) { - for i, d := range f.Decls { - d, ok := d.(*ast.GenDecl) - if !ok || d.Tok != token.IMPORT { - // Not an import declaration, so we're done. - // Imports are always first. - break - } - - if len(d.Specs) == 0 { - // Empty import block, remove it. - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - } - - if !d.Lparen.IsValid() { - // Not a block: sorted by default. - continue - } - - // Identify and sort runs of specs on successive lines. - i := 0 - specs := d.Specs[:0] - for j, s := range d.Specs { - if j > i && tokFile.Line(s.Pos()) > 1+tokFile.Line(d.Specs[j-1].End()) { - // j begins a new run. End this one. - specs = append(specs, sortSpecs(localPrefix, tokFile, f, d.Specs[i:j])...) - i = j - } - } - specs = append(specs, sortSpecs(localPrefix, tokFile, f, d.Specs[i:])...) - d.Specs = specs - - // Deduping can leave a blank line before the rparen; clean that up. - // Ignore line directives. - if len(d.Specs) > 0 { - lastSpec := d.Specs[len(d.Specs)-1] - lastLine := tokFile.PositionFor(lastSpec.Pos(), false).Line - if rParenLine := tokFile.PositionFor(d.Rparen, false).Line; rParenLine > lastLine+1 { - tokFile.MergeLine(rParenLine - 1) // has side effects! - } - } - } -} - -// mergeImports merges all the import declarations into the first one. -// Taken from golang.org/x/tools/ast/astutil. -// This does not adjust line numbers properly -func mergeImports(f *ast.File) { - if len(f.Decls) <= 1 { - return - } - - // Merge all the import declarations into the first one. - var first *ast.GenDecl - for i := 0; i < len(f.Decls); i++ { - decl := f.Decls[i] - gen, ok := decl.(*ast.GenDecl) - if !ok || gen.Tok != token.IMPORT || declImports(gen, "C") { - continue - } - if first == nil { - first = gen - continue // Don't touch the first one. - } - // We now know there is more than one package in this import - // declaration. Ensure that it ends up parenthesized. - first.Lparen = first.Pos() - // Move the imports of the other import declaration to the first one. - for _, spec := range gen.Specs { - spec.(*ast.ImportSpec).Path.ValuePos = first.Pos() - first.Specs = append(first.Specs, spec) - } - f.Decls = append(f.Decls[:i], f.Decls[i+1:]...) - i-- - } -} - -// declImports reports whether gen contains an import of path. -// Taken from golang.org/x/tools/ast/astutil. -func declImports(gen *ast.GenDecl, path string) bool { - if gen.Tok != token.IMPORT { - return false - } - for _, spec := range gen.Specs { - impspec := spec.(*ast.ImportSpec) - if importPath(impspec) == path { - return true - } - } - return false -} - -func importPath(s ast.Spec) string { - t, err := strconv.Unquote(s.(*ast.ImportSpec).Path.Value) - if err == nil { - return t - } - return "" -} - -func importName(s ast.Spec) string { - n := s.(*ast.ImportSpec).Name - if n == nil { - return "" - } - return n.Name -} - -func importComment(s ast.Spec) string { - c := s.(*ast.ImportSpec).Comment - if c == nil { - return "" - } - return c.Text() -} - -// collapse indicates whether prev may be removed, leaving only next. -func collapse(prev, next ast.Spec) bool { - if importPath(next) != importPath(prev) || importName(next) != importName(prev) { - return false - } - return prev.(*ast.ImportSpec).Comment == nil -} - -type posSpan struct { - Start token.Pos - End token.Pos -} - -// sortSpecs sorts the import specs within each import decl. -// It may mutate the token.File. -func sortSpecs(localPrefix string, tokFile *token.File, f *ast.File, specs []ast.Spec) []ast.Spec { - // Can't short-circuit here even if specs are already sorted, - // since they might yet need deduplication. - // A lone import, however, may be safely ignored. - if len(specs) <= 1 { - return specs - } - - // Record positions for specs. - pos := make([]posSpan, len(specs)) - for i, s := range specs { - pos[i] = posSpan{s.Pos(), s.End()} - } - - // Identify comments in this range. - // Any comment from pos[0].Start to the final line counts. - lastLine := tokFile.Line(pos[len(pos)-1].End) - cstart := len(f.Comments) - cend := len(f.Comments) - for i, g := range f.Comments { - if g.Pos() < pos[0].Start { - continue - } - if i < cstart { - cstart = i - } - if tokFile.Line(g.End()) > lastLine { - cend = i - break - } - } - comments := f.Comments[cstart:cend] - - // Assign each comment to the import spec preceding it. - importComment := map[*ast.ImportSpec][]*ast.CommentGroup{} - specIndex := 0 - for _, g := range comments { - for specIndex+1 < len(specs) && pos[specIndex+1].Start <= g.Pos() { - specIndex++ - } - s := specs[specIndex].(*ast.ImportSpec) - importComment[s] = append(importComment[s], g) - } - - // Sort the import specs by import path. - // Remove duplicates, when possible without data loss. - // Reassign the import paths to have the same position sequence. - // Reassign each comment to abut the end of its spec. - // Sort the comments by new position. - sort.Sort(byImportSpec{localPrefix, specs}) - - // Dedup. Thanks to our sorting, we can just consider - // adjacent pairs of imports. - deduped := specs[:0] - for i, s := range specs { - if i == len(specs)-1 || !collapse(s, specs[i+1]) { - deduped = append(deduped, s) - } else { - p := s.Pos() - tokFile.MergeLine(tokFile.Line(p)) // has side effects! - } - } - specs = deduped - - // Fix up comment positions - for i, s := range specs { - s := s.(*ast.ImportSpec) - if s.Name != nil { - s.Name.NamePos = pos[i].Start - } - s.Path.ValuePos = pos[i].Start - s.EndPos = pos[i].End - nextSpecPos := pos[i].End - - for _, g := range importComment[s] { - for _, c := range g.List { - c.Slash = pos[i].End - nextSpecPos = c.End() - } - } - if i < len(specs)-1 { - pos[i+1].Start = nextSpecPos - pos[i+1].End = nextSpecPos - } - } - - sort.Sort(byCommentPos(comments)) - - // Fixup comments can insert blank lines, because import specs are on different lines. - // We remove those blank lines here by merging import spec to the first import spec line. - firstSpecLine := tokFile.Line(specs[0].Pos()) - for _, s := range specs[1:] { - p := s.Pos() - line := tokFile.Line(p) - for previousLine := line - 1; previousLine >= firstSpecLine; { - // MergeLine can panic. Avoid the panic at the cost of not removing the blank line - // golang/go#50329 - if previousLine > 0 && previousLine < tokFile.LineCount() { - tokFile.MergeLine(previousLine) // has side effects! - previousLine-- - } else { - // try to gather some data to diagnose how this could happen - req := "Please report what the imports section of your go file looked like." - log.Printf("panic avoided: first:%d line:%d previous:%d max:%d. %s", - firstSpecLine, line, previousLine, tokFile.LineCount(), req) - } - } - } - return specs -} - -type byImportSpec struct { - localPrefix string - specs []ast.Spec // slice of *ast.ImportSpec -} - -func (x byImportSpec) Len() int { return len(x.specs) } -func (x byImportSpec) Swap(i, j int) { x.specs[i], x.specs[j] = x.specs[j], x.specs[i] } -func (x byImportSpec) Less(i, j int) bool { - ipath := importPath(x.specs[i]) - jpath := importPath(x.specs[j]) - - igroup := importGroup(x.localPrefix, ipath) - jgroup := importGroup(x.localPrefix, jpath) - if igroup != jgroup { - return igroup < jgroup - } - - if ipath != jpath { - return ipath < jpath - } - iname := importName(x.specs[i]) - jname := importName(x.specs[j]) - - if iname != jname { - return iname < jname - } - return importComment(x.specs[i]) < importComment(x.specs[j]) -} - -type byCommentPos []*ast.CommentGroup - -func (x byCommentPos) Len() int { return len(x) } -func (x byCommentPos) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x byCommentPos) Less(i, j int) bool { return x[i].Pos() < x[j].Pos() } diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/zstdlib.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/zstdlib.go deleted file mode 100644 index 31a75949cdc5..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/imports/zstdlib.go +++ /dev/null @@ -1,11115 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Code generated by mkstdlib.go. DO NOT EDIT. - -package imports - -var stdlib = map[string][]string{ - "archive/tar": { - "ErrFieldTooLong", - "ErrHeader", - "ErrInsecurePath", - "ErrWriteAfterClose", - "ErrWriteTooLong", - "FileInfoHeader", - "Format", - "FormatGNU", - "FormatPAX", - "FormatUSTAR", - "FormatUnknown", - "Header", - "NewReader", - "NewWriter", - "Reader", - "TypeBlock", - "TypeChar", - "TypeCont", - "TypeDir", - "TypeFifo", - "TypeGNULongLink", - "TypeGNULongName", - "TypeGNUSparse", - "TypeLink", - "TypeReg", - "TypeRegA", - "TypeSymlink", - "TypeXGlobalHeader", - "TypeXHeader", - "Writer", - }, - "archive/zip": { - "Compressor", - "Decompressor", - "Deflate", - "ErrAlgorithm", - "ErrChecksum", - "ErrFormat", - "ErrInsecurePath", - "File", - "FileHeader", - "FileInfoHeader", - "NewReader", - "NewWriter", - "OpenReader", - "ReadCloser", - "Reader", - "RegisterCompressor", - "RegisterDecompressor", - "Store", - "Writer", - }, - "bufio": { - "ErrAdvanceTooFar", - "ErrBadReadCount", - "ErrBufferFull", - "ErrFinalToken", - "ErrInvalidUnreadByte", - "ErrInvalidUnreadRune", - "ErrNegativeAdvance", - "ErrNegativeCount", - "ErrTooLong", - "MaxScanTokenSize", - "NewReadWriter", - "NewReader", - "NewReaderSize", - "NewScanner", - "NewWriter", - "NewWriterSize", - "ReadWriter", - "Reader", - "ScanBytes", - "ScanLines", - "ScanRunes", - "ScanWords", - "Scanner", - "SplitFunc", - "Writer", - }, - "bytes": { - "Buffer", - "Clone", - "Compare", - "Contains", - "ContainsAny", - "ContainsRune", - "Count", - "Cut", - "CutPrefix", - "CutSuffix", - "Equal", - "EqualFold", - "ErrTooLarge", - "Fields", - "FieldsFunc", - "HasPrefix", - "HasSuffix", - "Index", - "IndexAny", - "IndexByte", - "IndexFunc", - "IndexRune", - "Join", - "LastIndex", - "LastIndexAny", - "LastIndexByte", - "LastIndexFunc", - "Map", - "MinRead", - "NewBuffer", - "NewBufferString", - "NewReader", - "Reader", - "Repeat", - "Replace", - "ReplaceAll", - "Runes", - "Split", - "SplitAfter", - "SplitAfterN", - "SplitN", - "Title", - "ToLower", - "ToLowerSpecial", - "ToTitle", - "ToTitleSpecial", - "ToUpper", - "ToUpperSpecial", - "ToValidUTF8", - "Trim", - "TrimFunc", - "TrimLeft", - "TrimLeftFunc", - "TrimPrefix", - "TrimRight", - "TrimRightFunc", - "TrimSpace", - "TrimSuffix", - }, - "compress/bzip2": { - "NewReader", - "StructuralError", - }, - "compress/flate": { - "BestCompression", - "BestSpeed", - "CorruptInputError", - "DefaultCompression", - "HuffmanOnly", - "InternalError", - "NewReader", - "NewReaderDict", - "NewWriter", - "NewWriterDict", - "NoCompression", - "ReadError", - "Reader", - "Resetter", - "WriteError", - "Writer", - }, - "compress/gzip": { - "BestCompression", - "BestSpeed", - "DefaultCompression", - "ErrChecksum", - "ErrHeader", - "Header", - "HuffmanOnly", - "NewReader", - "NewWriter", - "NewWriterLevel", - "NoCompression", - "Reader", - "Writer", - }, - "compress/lzw": { - "LSB", - "MSB", - "NewReader", - "NewWriter", - "Order", - "Reader", - "Writer", - }, - "compress/zlib": { - "BestCompression", - "BestSpeed", - "DefaultCompression", - "ErrChecksum", - "ErrDictionary", - "ErrHeader", - "HuffmanOnly", - "NewReader", - "NewReaderDict", - "NewWriter", - "NewWriterLevel", - "NewWriterLevelDict", - "NoCompression", - "Resetter", - "Writer", - }, - "container/heap": { - "Fix", - "Init", - "Interface", - "Pop", - "Push", - "Remove", - }, - "container/list": { - "Element", - "List", - "New", - }, - "container/ring": { - "New", - "Ring", - }, - "context": { - "Background", - "CancelCauseFunc", - "CancelFunc", - "Canceled", - "Cause", - "Context", - "DeadlineExceeded", - "TODO", - "WithCancel", - "WithCancelCause", - "WithDeadline", - "WithTimeout", - "WithValue", - }, - "crypto": { - "BLAKE2b_256", - "BLAKE2b_384", - "BLAKE2b_512", - "BLAKE2s_256", - "Decrypter", - "DecrypterOpts", - "Hash", - "MD4", - "MD5", - "MD5SHA1", - "PrivateKey", - "PublicKey", - "RIPEMD160", - "RegisterHash", - "SHA1", - "SHA224", - "SHA256", - "SHA384", - "SHA3_224", - "SHA3_256", - "SHA3_384", - "SHA3_512", - "SHA512", - "SHA512_224", - "SHA512_256", - "Signer", - "SignerOpts", - }, - "crypto/aes": { - "BlockSize", - "KeySizeError", - "NewCipher", - }, - "crypto/cipher": { - "AEAD", - "Block", - "BlockMode", - "NewCBCDecrypter", - "NewCBCEncrypter", - "NewCFBDecrypter", - "NewCFBEncrypter", - "NewCTR", - "NewGCM", - "NewGCMWithNonceSize", - "NewGCMWithTagSize", - "NewOFB", - "Stream", - "StreamReader", - "StreamWriter", - }, - "crypto/des": { - "BlockSize", - "KeySizeError", - "NewCipher", - "NewTripleDESCipher", - }, - "crypto/dsa": { - "ErrInvalidPublicKey", - "GenerateKey", - "GenerateParameters", - "L1024N160", - "L2048N224", - "L2048N256", - "L3072N256", - "ParameterSizes", - "Parameters", - "PrivateKey", - "PublicKey", - "Sign", - "Verify", - }, - "crypto/ecdh": { - "Curve", - "P256", - "P384", - "P521", - "PrivateKey", - "PublicKey", - "X25519", - }, - "crypto/ecdsa": { - "GenerateKey", - "PrivateKey", - "PublicKey", - "Sign", - "SignASN1", - "Verify", - "VerifyASN1", - }, - "crypto/ed25519": { - "GenerateKey", - "NewKeyFromSeed", - "Options", - "PrivateKey", - "PrivateKeySize", - "PublicKey", - "PublicKeySize", - "SeedSize", - "Sign", - "SignatureSize", - "Verify", - "VerifyWithOptions", - }, - "crypto/elliptic": { - "Curve", - "CurveParams", - "GenerateKey", - "Marshal", - "MarshalCompressed", - "P224", - "P256", - "P384", - "P521", - "Unmarshal", - "UnmarshalCompressed", - }, - "crypto/hmac": { - "Equal", - "New", - }, - "crypto/md5": { - "BlockSize", - "New", - "Size", - "Sum", - }, - "crypto/rand": { - "Int", - "Prime", - "Read", - "Reader", - }, - "crypto/rc4": { - "Cipher", - "KeySizeError", - "NewCipher", - }, - "crypto/rsa": { - "CRTValue", - "DecryptOAEP", - "DecryptPKCS1v15", - "DecryptPKCS1v15SessionKey", - "EncryptOAEP", - "EncryptPKCS1v15", - "ErrDecryption", - "ErrMessageTooLong", - "ErrVerification", - "GenerateKey", - "GenerateMultiPrimeKey", - "OAEPOptions", - "PKCS1v15DecryptOptions", - "PSSOptions", - "PSSSaltLengthAuto", - "PSSSaltLengthEqualsHash", - "PrecomputedValues", - "PrivateKey", - "PublicKey", - "SignPKCS1v15", - "SignPSS", - "VerifyPKCS1v15", - "VerifyPSS", - }, - "crypto/sha1": { - "BlockSize", - "New", - "Size", - "Sum", - }, - "crypto/sha256": { - "BlockSize", - "New", - "New224", - "Size", - "Size224", - "Sum224", - "Sum256", - }, - "crypto/sha512": { - "BlockSize", - "New", - "New384", - "New512_224", - "New512_256", - "Size", - "Size224", - "Size256", - "Size384", - "Sum384", - "Sum512", - "Sum512_224", - "Sum512_256", - }, - "crypto/subtle": { - "ConstantTimeByteEq", - "ConstantTimeCompare", - "ConstantTimeCopy", - "ConstantTimeEq", - "ConstantTimeLessOrEq", - "ConstantTimeSelect", - "XORBytes", - }, - "crypto/tls": { - "Certificate", - "CertificateRequestInfo", - "CertificateVerificationError", - "CipherSuite", - "CipherSuiteName", - "CipherSuites", - "Client", - "ClientAuthType", - "ClientHelloInfo", - "ClientSessionCache", - "ClientSessionState", - "Config", - "Conn", - "ConnectionState", - "CurveID", - "CurveP256", - "CurveP384", - "CurveP521", - "Dial", - "DialWithDialer", - "Dialer", - "ECDSAWithP256AndSHA256", - "ECDSAWithP384AndSHA384", - "ECDSAWithP521AndSHA512", - "ECDSAWithSHA1", - "Ed25519", - "InsecureCipherSuites", - "Listen", - "LoadX509KeyPair", - "NewLRUClientSessionCache", - "NewListener", - "NoClientCert", - "PKCS1WithSHA1", - "PKCS1WithSHA256", - "PKCS1WithSHA384", - "PKCS1WithSHA512", - "PSSWithSHA256", - "PSSWithSHA384", - "PSSWithSHA512", - "RecordHeaderError", - "RenegotiateFreelyAsClient", - "RenegotiateNever", - "RenegotiateOnceAsClient", - "RenegotiationSupport", - "RequestClientCert", - "RequireAndVerifyClientCert", - "RequireAnyClientCert", - "Server", - "SignatureScheme", - "TLS_AES_128_GCM_SHA256", - "TLS_AES_256_GCM_SHA384", - "TLS_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - "TLS_FALLBACK_SCSV", - "TLS_RSA_WITH_3DES_EDE_CBC_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_RSA_WITH_AES_128_CBC_SHA256", - "TLS_RSA_WITH_AES_128_GCM_SHA256", - "TLS_RSA_WITH_AES_256_CBC_SHA", - "TLS_RSA_WITH_AES_256_GCM_SHA384", - "TLS_RSA_WITH_RC4_128_SHA", - "VerifyClientCertIfGiven", - "VersionSSL30", - "VersionTLS10", - "VersionTLS11", - "VersionTLS12", - "VersionTLS13", - "X25519", - "X509KeyPair", - }, - "crypto/x509": { - "CANotAuthorizedForExtKeyUsage", - "CANotAuthorizedForThisName", - "CertPool", - "Certificate", - "CertificateInvalidError", - "CertificateRequest", - "ConstraintViolationError", - "CreateCertificate", - "CreateCertificateRequest", - "CreateRevocationList", - "DSA", - "DSAWithSHA1", - "DSAWithSHA256", - "DecryptPEMBlock", - "ECDSA", - "ECDSAWithSHA1", - "ECDSAWithSHA256", - "ECDSAWithSHA384", - "ECDSAWithSHA512", - "Ed25519", - "EncryptPEMBlock", - "ErrUnsupportedAlgorithm", - "Expired", - "ExtKeyUsage", - "ExtKeyUsageAny", - "ExtKeyUsageClientAuth", - "ExtKeyUsageCodeSigning", - "ExtKeyUsageEmailProtection", - "ExtKeyUsageIPSECEndSystem", - "ExtKeyUsageIPSECTunnel", - "ExtKeyUsageIPSECUser", - "ExtKeyUsageMicrosoftCommercialCodeSigning", - "ExtKeyUsageMicrosoftKernelCodeSigning", - "ExtKeyUsageMicrosoftServerGatedCrypto", - "ExtKeyUsageNetscapeServerGatedCrypto", - "ExtKeyUsageOCSPSigning", - "ExtKeyUsageServerAuth", - "ExtKeyUsageTimeStamping", - "HostnameError", - "IncompatibleUsage", - "IncorrectPasswordError", - "InsecureAlgorithmError", - "InvalidReason", - "IsEncryptedPEMBlock", - "KeyUsage", - "KeyUsageCRLSign", - "KeyUsageCertSign", - "KeyUsageContentCommitment", - "KeyUsageDataEncipherment", - "KeyUsageDecipherOnly", - "KeyUsageDigitalSignature", - "KeyUsageEncipherOnly", - "KeyUsageKeyAgreement", - "KeyUsageKeyEncipherment", - "MD2WithRSA", - "MD5WithRSA", - "MarshalECPrivateKey", - "MarshalPKCS1PrivateKey", - "MarshalPKCS1PublicKey", - "MarshalPKCS8PrivateKey", - "MarshalPKIXPublicKey", - "NameConstraintsWithoutSANs", - "NameMismatch", - "NewCertPool", - "NotAuthorizedToSign", - "PEMCipher", - "PEMCipher3DES", - "PEMCipherAES128", - "PEMCipherAES192", - "PEMCipherAES256", - "PEMCipherDES", - "ParseCRL", - "ParseCertificate", - "ParseCertificateRequest", - "ParseCertificates", - "ParseDERCRL", - "ParseECPrivateKey", - "ParsePKCS1PrivateKey", - "ParsePKCS1PublicKey", - "ParsePKCS8PrivateKey", - "ParsePKIXPublicKey", - "ParseRevocationList", - "PublicKeyAlgorithm", - "PureEd25519", - "RSA", - "RevocationList", - "SHA1WithRSA", - "SHA256WithRSA", - "SHA256WithRSAPSS", - "SHA384WithRSA", - "SHA384WithRSAPSS", - "SHA512WithRSA", - "SHA512WithRSAPSS", - "SetFallbackRoots", - "SignatureAlgorithm", - "SystemCertPool", - "SystemRootsError", - "TooManyConstraints", - "TooManyIntermediates", - "UnconstrainedName", - "UnhandledCriticalExtension", - "UnknownAuthorityError", - "UnknownPublicKeyAlgorithm", - "UnknownSignatureAlgorithm", - "VerifyOptions", - }, - "crypto/x509/pkix": { - "AlgorithmIdentifier", - "AttributeTypeAndValue", - "AttributeTypeAndValueSET", - "CertificateList", - "Extension", - "Name", - "RDNSequence", - "RelativeDistinguishedNameSET", - "RevokedCertificate", - "TBSCertificateList", - }, - "database/sql": { - "ColumnType", - "Conn", - "DB", - "DBStats", - "Drivers", - "ErrConnDone", - "ErrNoRows", - "ErrTxDone", - "IsolationLevel", - "LevelDefault", - "LevelLinearizable", - "LevelReadCommitted", - "LevelReadUncommitted", - "LevelRepeatableRead", - "LevelSerializable", - "LevelSnapshot", - "LevelWriteCommitted", - "Named", - "NamedArg", - "NullBool", - "NullByte", - "NullFloat64", - "NullInt16", - "NullInt32", - "NullInt64", - "NullString", - "NullTime", - "Open", - "OpenDB", - "Out", - "RawBytes", - "Register", - "Result", - "Row", - "Rows", - "Scanner", - "Stmt", - "Tx", - "TxOptions", - }, - "database/sql/driver": { - "Bool", - "ColumnConverter", - "Conn", - "ConnBeginTx", - "ConnPrepareContext", - "Connector", - "DefaultParameterConverter", - "Driver", - "DriverContext", - "ErrBadConn", - "ErrRemoveArgument", - "ErrSkip", - "Execer", - "ExecerContext", - "Int32", - "IsScanValue", - "IsValue", - "IsolationLevel", - "NamedValue", - "NamedValueChecker", - "NotNull", - "Null", - "Pinger", - "Queryer", - "QueryerContext", - "Result", - "ResultNoRows", - "Rows", - "RowsAffected", - "RowsColumnTypeDatabaseTypeName", - "RowsColumnTypeLength", - "RowsColumnTypeNullable", - "RowsColumnTypePrecisionScale", - "RowsColumnTypeScanType", - "RowsNextResultSet", - "SessionResetter", - "Stmt", - "StmtExecContext", - "StmtQueryContext", - "String", - "Tx", - "TxOptions", - "Validator", - "Value", - "ValueConverter", - "Valuer", - }, - "debug/buildinfo": { - "BuildInfo", - "Read", - "ReadFile", - }, - "debug/dwarf": { - "AddrType", - "ArrayType", - "Attr", - "AttrAbstractOrigin", - "AttrAccessibility", - "AttrAddrBase", - "AttrAddrClass", - "AttrAlignment", - "AttrAllocated", - "AttrArtificial", - "AttrAssociated", - "AttrBaseTypes", - "AttrBinaryScale", - "AttrBitOffset", - "AttrBitSize", - "AttrByteSize", - "AttrCallAllCalls", - "AttrCallAllSourceCalls", - "AttrCallAllTailCalls", - "AttrCallColumn", - "AttrCallDataLocation", - "AttrCallDataValue", - "AttrCallFile", - "AttrCallLine", - "AttrCallOrigin", - "AttrCallPC", - "AttrCallParameter", - "AttrCallReturnPC", - "AttrCallTailCall", - "AttrCallTarget", - "AttrCallTargetClobbered", - "AttrCallValue", - "AttrCalling", - "AttrCommonRef", - "AttrCompDir", - "AttrConstExpr", - "AttrConstValue", - "AttrContainingType", - "AttrCount", - "AttrDataBitOffset", - "AttrDataLocation", - "AttrDataMemberLoc", - "AttrDecimalScale", - "AttrDecimalSign", - "AttrDeclColumn", - "AttrDeclFile", - "AttrDeclLine", - "AttrDeclaration", - "AttrDefaultValue", - "AttrDefaulted", - "AttrDeleted", - "AttrDescription", - "AttrDigitCount", - "AttrDiscr", - "AttrDiscrList", - "AttrDiscrValue", - "AttrDwoName", - "AttrElemental", - "AttrEncoding", - "AttrEndianity", - "AttrEntrypc", - "AttrEnumClass", - "AttrExplicit", - "AttrExportSymbols", - "AttrExtension", - "AttrExternal", - "AttrFrameBase", - "AttrFriend", - "AttrHighpc", - "AttrIdentifierCase", - "AttrImport", - "AttrInline", - "AttrIsOptional", - "AttrLanguage", - "AttrLinkageName", - "AttrLocation", - "AttrLoclistsBase", - "AttrLowerBound", - "AttrLowpc", - "AttrMacroInfo", - "AttrMacros", - "AttrMainSubprogram", - "AttrMutable", - "AttrName", - "AttrNamelistItem", - "AttrNoreturn", - "AttrObjectPointer", - "AttrOrdering", - "AttrPictureString", - "AttrPriority", - "AttrProducer", - "AttrPrototyped", - "AttrPure", - "AttrRanges", - "AttrRank", - "AttrRecursive", - "AttrReference", - "AttrReturnAddr", - "AttrRnglistsBase", - "AttrRvalueReference", - "AttrSegment", - "AttrSibling", - "AttrSignature", - "AttrSmall", - "AttrSpecification", - "AttrStartScope", - "AttrStaticLink", - "AttrStmtList", - "AttrStrOffsetsBase", - "AttrStride", - "AttrStrideSize", - "AttrStringLength", - "AttrStringLengthBitSize", - "AttrStringLengthByteSize", - "AttrThreadsScaled", - "AttrTrampoline", - "AttrType", - "AttrUpperBound", - "AttrUseLocation", - "AttrUseUTF8", - "AttrVarParam", - "AttrVirtuality", - "AttrVisibility", - "AttrVtableElemLoc", - "BasicType", - "BoolType", - "CharType", - "Class", - "ClassAddrPtr", - "ClassAddress", - "ClassBlock", - "ClassConstant", - "ClassExprLoc", - "ClassFlag", - "ClassLinePtr", - "ClassLocList", - "ClassLocListPtr", - "ClassMacPtr", - "ClassRangeListPtr", - "ClassReference", - "ClassReferenceAlt", - "ClassReferenceSig", - "ClassRngList", - "ClassRngListsPtr", - "ClassStrOffsetsPtr", - "ClassString", - "ClassStringAlt", - "ClassUnknown", - "CommonType", - "ComplexType", - "Data", - "DecodeError", - "DotDotDotType", - "Entry", - "EnumType", - "EnumValue", - "ErrUnknownPC", - "Field", - "FloatType", - "FuncType", - "IntType", - "LineEntry", - "LineFile", - "LineReader", - "LineReaderPos", - "New", - "Offset", - "PtrType", - "QualType", - "Reader", - "StructField", - "StructType", - "Tag", - "TagAccessDeclaration", - "TagArrayType", - "TagAtomicType", - "TagBaseType", - "TagCallSite", - "TagCallSiteParameter", - "TagCatchDwarfBlock", - "TagClassType", - "TagCoarrayType", - "TagCommonDwarfBlock", - "TagCommonInclusion", - "TagCompileUnit", - "TagCondition", - "TagConstType", - "TagConstant", - "TagDwarfProcedure", - "TagDynamicType", - "TagEntryPoint", - "TagEnumerationType", - "TagEnumerator", - "TagFileType", - "TagFormalParameter", - "TagFriend", - "TagGenericSubrange", - "TagImmutableType", - "TagImportedDeclaration", - "TagImportedModule", - "TagImportedUnit", - "TagInheritance", - "TagInlinedSubroutine", - "TagInterfaceType", - "TagLabel", - "TagLexDwarfBlock", - "TagMember", - "TagModule", - "TagMutableType", - "TagNamelist", - "TagNamelistItem", - "TagNamespace", - "TagPackedType", - "TagPartialUnit", - "TagPointerType", - "TagPtrToMemberType", - "TagReferenceType", - "TagRestrictType", - "TagRvalueReferenceType", - "TagSetType", - "TagSharedType", - "TagSkeletonUnit", - "TagStringType", - "TagStructType", - "TagSubprogram", - "TagSubrangeType", - "TagSubroutineType", - "TagTemplateAlias", - "TagTemplateTypeParameter", - "TagTemplateValueParameter", - "TagThrownType", - "TagTryDwarfBlock", - "TagTypeUnit", - "TagTypedef", - "TagUnionType", - "TagUnspecifiedParameters", - "TagUnspecifiedType", - "TagVariable", - "TagVariant", - "TagVariantPart", - "TagVolatileType", - "TagWithStmt", - "Type", - "TypedefType", - "UcharType", - "UintType", - "UnspecifiedType", - "UnsupportedType", - "VoidType", - }, - "debug/elf": { - "ARM_MAGIC_TRAMP_NUMBER", - "COMPRESS_HIOS", - "COMPRESS_HIPROC", - "COMPRESS_LOOS", - "COMPRESS_LOPROC", - "COMPRESS_ZLIB", - "Chdr32", - "Chdr64", - "Class", - "CompressionType", - "DF_BIND_NOW", - "DF_ORIGIN", - "DF_STATIC_TLS", - "DF_SYMBOLIC", - "DF_TEXTREL", - "DT_ADDRRNGHI", - "DT_ADDRRNGLO", - "DT_AUDIT", - "DT_AUXILIARY", - "DT_BIND_NOW", - "DT_CHECKSUM", - "DT_CONFIG", - "DT_DEBUG", - "DT_DEPAUDIT", - "DT_ENCODING", - "DT_FEATURE", - "DT_FILTER", - "DT_FINI", - "DT_FINI_ARRAY", - "DT_FINI_ARRAYSZ", - "DT_FLAGS", - "DT_FLAGS_1", - "DT_GNU_CONFLICT", - "DT_GNU_CONFLICTSZ", - "DT_GNU_HASH", - "DT_GNU_LIBLIST", - "DT_GNU_LIBLISTSZ", - "DT_GNU_PRELINKED", - "DT_HASH", - "DT_HIOS", - "DT_HIPROC", - "DT_INIT", - "DT_INIT_ARRAY", - "DT_INIT_ARRAYSZ", - "DT_JMPREL", - "DT_LOOS", - "DT_LOPROC", - "DT_MIPS_AUX_DYNAMIC", - "DT_MIPS_BASE_ADDRESS", - "DT_MIPS_COMPACT_SIZE", - "DT_MIPS_CONFLICT", - "DT_MIPS_CONFLICTNO", - "DT_MIPS_CXX_FLAGS", - "DT_MIPS_DELTA_CLASS", - "DT_MIPS_DELTA_CLASSSYM", - "DT_MIPS_DELTA_CLASSSYM_NO", - "DT_MIPS_DELTA_CLASS_NO", - "DT_MIPS_DELTA_INSTANCE", - "DT_MIPS_DELTA_INSTANCE_NO", - "DT_MIPS_DELTA_RELOC", - "DT_MIPS_DELTA_RELOC_NO", - "DT_MIPS_DELTA_SYM", - "DT_MIPS_DELTA_SYM_NO", - "DT_MIPS_DYNSTR_ALIGN", - "DT_MIPS_FLAGS", - "DT_MIPS_GOTSYM", - "DT_MIPS_GP_VALUE", - "DT_MIPS_HIDDEN_GOTIDX", - "DT_MIPS_HIPAGENO", - "DT_MIPS_ICHECKSUM", - "DT_MIPS_INTERFACE", - "DT_MIPS_INTERFACE_SIZE", - "DT_MIPS_IVERSION", - "DT_MIPS_LIBLIST", - "DT_MIPS_LIBLISTNO", - "DT_MIPS_LOCALPAGE_GOTIDX", - "DT_MIPS_LOCAL_GOTIDX", - "DT_MIPS_LOCAL_GOTNO", - "DT_MIPS_MSYM", - "DT_MIPS_OPTIONS", - "DT_MIPS_PERF_SUFFIX", - "DT_MIPS_PIXIE_INIT", - "DT_MIPS_PLTGOT", - "DT_MIPS_PROTECTED_GOTIDX", - "DT_MIPS_RLD_MAP", - "DT_MIPS_RLD_MAP_REL", - "DT_MIPS_RLD_TEXT_RESOLVE_ADDR", - "DT_MIPS_RLD_VERSION", - "DT_MIPS_RWPLT", - "DT_MIPS_SYMBOL_LIB", - "DT_MIPS_SYMTABNO", - "DT_MIPS_TIME_STAMP", - "DT_MIPS_UNREFEXTNO", - "DT_MOVEENT", - "DT_MOVESZ", - "DT_MOVETAB", - "DT_NEEDED", - "DT_NULL", - "DT_PLTGOT", - "DT_PLTPAD", - "DT_PLTPADSZ", - "DT_PLTREL", - "DT_PLTRELSZ", - "DT_POSFLAG_1", - "DT_PPC64_GLINK", - "DT_PPC64_OPD", - "DT_PPC64_OPDSZ", - "DT_PPC64_OPT", - "DT_PPC_GOT", - "DT_PPC_OPT", - "DT_PREINIT_ARRAY", - "DT_PREINIT_ARRAYSZ", - "DT_REL", - "DT_RELA", - "DT_RELACOUNT", - "DT_RELAENT", - "DT_RELASZ", - "DT_RELCOUNT", - "DT_RELENT", - "DT_RELSZ", - "DT_RPATH", - "DT_RUNPATH", - "DT_SONAME", - "DT_SPARC_REGISTER", - "DT_STRSZ", - "DT_STRTAB", - "DT_SYMBOLIC", - "DT_SYMENT", - "DT_SYMINENT", - "DT_SYMINFO", - "DT_SYMINSZ", - "DT_SYMTAB", - "DT_SYMTAB_SHNDX", - "DT_TEXTREL", - "DT_TLSDESC_GOT", - "DT_TLSDESC_PLT", - "DT_USED", - "DT_VALRNGHI", - "DT_VALRNGLO", - "DT_VERDEF", - "DT_VERDEFNUM", - "DT_VERNEED", - "DT_VERNEEDNUM", - "DT_VERSYM", - "Data", - "Dyn32", - "Dyn64", - "DynFlag", - "DynTag", - "EI_ABIVERSION", - "EI_CLASS", - "EI_DATA", - "EI_NIDENT", - "EI_OSABI", - "EI_PAD", - "EI_VERSION", - "ELFCLASS32", - "ELFCLASS64", - "ELFCLASSNONE", - "ELFDATA2LSB", - "ELFDATA2MSB", - "ELFDATANONE", - "ELFMAG", - "ELFOSABI_86OPEN", - "ELFOSABI_AIX", - "ELFOSABI_ARM", - "ELFOSABI_AROS", - "ELFOSABI_CLOUDABI", - "ELFOSABI_FENIXOS", - "ELFOSABI_FREEBSD", - "ELFOSABI_HPUX", - "ELFOSABI_HURD", - "ELFOSABI_IRIX", - "ELFOSABI_LINUX", - "ELFOSABI_MODESTO", - "ELFOSABI_NETBSD", - "ELFOSABI_NONE", - "ELFOSABI_NSK", - "ELFOSABI_OPENBSD", - "ELFOSABI_OPENVMS", - "ELFOSABI_SOLARIS", - "ELFOSABI_STANDALONE", - "ELFOSABI_TRU64", - "EM_386", - "EM_486", - "EM_56800EX", - "EM_68HC05", - "EM_68HC08", - "EM_68HC11", - "EM_68HC12", - "EM_68HC16", - "EM_68K", - "EM_78KOR", - "EM_8051", - "EM_860", - "EM_88K", - "EM_960", - "EM_AARCH64", - "EM_ALPHA", - "EM_ALPHA_STD", - "EM_ALTERA_NIOS2", - "EM_AMDGPU", - "EM_ARC", - "EM_ARCA", - "EM_ARC_COMPACT", - "EM_ARC_COMPACT2", - "EM_ARM", - "EM_AVR", - "EM_AVR32", - "EM_BA1", - "EM_BA2", - "EM_BLACKFIN", - "EM_BPF", - "EM_C166", - "EM_CDP", - "EM_CE", - "EM_CLOUDSHIELD", - "EM_COGE", - "EM_COLDFIRE", - "EM_COOL", - "EM_COREA_1ST", - "EM_COREA_2ND", - "EM_CR", - "EM_CR16", - "EM_CRAYNV2", - "EM_CRIS", - "EM_CRX", - "EM_CSR_KALIMBA", - "EM_CUDA", - "EM_CYPRESS_M8C", - "EM_D10V", - "EM_D30V", - "EM_DSP24", - "EM_DSPIC30F", - "EM_DXP", - "EM_ECOG1", - "EM_ECOG16", - "EM_ECOG1X", - "EM_ECOG2", - "EM_ETPU", - "EM_EXCESS", - "EM_F2MC16", - "EM_FIREPATH", - "EM_FR20", - "EM_FR30", - "EM_FT32", - "EM_FX66", - "EM_H8S", - "EM_H8_300", - "EM_H8_300H", - "EM_H8_500", - "EM_HUANY", - "EM_IA_64", - "EM_INTEL205", - "EM_INTEL206", - "EM_INTEL207", - "EM_INTEL208", - "EM_INTEL209", - "EM_IP2K", - "EM_JAVELIN", - "EM_K10M", - "EM_KM32", - "EM_KMX16", - "EM_KMX32", - "EM_KMX8", - "EM_KVARC", - "EM_L10M", - "EM_LANAI", - "EM_LATTICEMICO32", - "EM_LOONGARCH", - "EM_M16C", - "EM_M32", - "EM_M32C", - "EM_M32R", - "EM_MANIK", - "EM_MAX", - "EM_MAXQ30", - "EM_MCHP_PIC", - "EM_MCST_ELBRUS", - "EM_ME16", - "EM_METAG", - "EM_MICROBLAZE", - "EM_MIPS", - "EM_MIPS_RS3_LE", - "EM_MIPS_RS4_BE", - "EM_MIPS_X", - "EM_MMA", - "EM_MMDSP_PLUS", - "EM_MMIX", - "EM_MN10200", - "EM_MN10300", - "EM_MOXIE", - "EM_MSP430", - "EM_NCPU", - "EM_NDR1", - "EM_NDS32", - "EM_NONE", - "EM_NORC", - "EM_NS32K", - "EM_OPEN8", - "EM_OPENRISC", - "EM_PARISC", - "EM_PCP", - "EM_PDP10", - "EM_PDP11", - "EM_PDSP", - "EM_PJ", - "EM_PPC", - "EM_PPC64", - "EM_PRISM", - "EM_QDSP6", - "EM_R32C", - "EM_RCE", - "EM_RH32", - "EM_RISCV", - "EM_RL78", - "EM_RS08", - "EM_RX", - "EM_S370", - "EM_S390", - "EM_SCORE7", - "EM_SEP", - "EM_SE_C17", - "EM_SE_C33", - "EM_SH", - "EM_SHARC", - "EM_SLE9X", - "EM_SNP1K", - "EM_SPARC", - "EM_SPARC32PLUS", - "EM_SPARCV9", - "EM_ST100", - "EM_ST19", - "EM_ST200", - "EM_ST7", - "EM_ST9PLUS", - "EM_STARCORE", - "EM_STM8", - "EM_STXP7X", - "EM_SVX", - "EM_TILE64", - "EM_TILEGX", - "EM_TILEPRO", - "EM_TINYJ", - "EM_TI_ARP32", - "EM_TI_C2000", - "EM_TI_C5500", - "EM_TI_C6000", - "EM_TI_PRU", - "EM_TMM_GPP", - "EM_TPC", - "EM_TRICORE", - "EM_TRIMEDIA", - "EM_TSK3000", - "EM_UNICORE", - "EM_V800", - "EM_V850", - "EM_VAX", - "EM_VIDEOCORE", - "EM_VIDEOCORE3", - "EM_VIDEOCORE5", - "EM_VISIUM", - "EM_VPP500", - "EM_X86_64", - "EM_XCORE", - "EM_XGATE", - "EM_XIMO16", - "EM_XTENSA", - "EM_Z80", - "EM_ZSP", - "ET_CORE", - "ET_DYN", - "ET_EXEC", - "ET_HIOS", - "ET_HIPROC", - "ET_LOOS", - "ET_LOPROC", - "ET_NONE", - "ET_REL", - "EV_CURRENT", - "EV_NONE", - "ErrNoSymbols", - "File", - "FileHeader", - "FormatError", - "Header32", - "Header64", - "ImportedSymbol", - "Machine", - "NT_FPREGSET", - "NT_PRPSINFO", - "NT_PRSTATUS", - "NType", - "NewFile", - "OSABI", - "Open", - "PF_MASKOS", - "PF_MASKPROC", - "PF_R", - "PF_W", - "PF_X", - "PT_AARCH64_ARCHEXT", - "PT_AARCH64_UNWIND", - "PT_ARM_ARCHEXT", - "PT_ARM_EXIDX", - "PT_DYNAMIC", - "PT_GNU_EH_FRAME", - "PT_GNU_MBIND_HI", - "PT_GNU_MBIND_LO", - "PT_GNU_PROPERTY", - "PT_GNU_RELRO", - "PT_GNU_STACK", - "PT_HIOS", - "PT_HIPROC", - "PT_INTERP", - "PT_LOAD", - "PT_LOOS", - "PT_LOPROC", - "PT_MIPS_ABIFLAGS", - "PT_MIPS_OPTIONS", - "PT_MIPS_REGINFO", - "PT_MIPS_RTPROC", - "PT_NOTE", - "PT_NULL", - "PT_OPENBSD_BOOTDATA", - "PT_OPENBSD_RANDOMIZE", - "PT_OPENBSD_WXNEEDED", - "PT_PAX_FLAGS", - "PT_PHDR", - "PT_S390_PGSTE", - "PT_SHLIB", - "PT_SUNWSTACK", - "PT_SUNW_EH_FRAME", - "PT_TLS", - "Prog", - "Prog32", - "Prog64", - "ProgFlag", - "ProgHeader", - "ProgType", - "R_386", - "R_386_16", - "R_386_32", - "R_386_32PLT", - "R_386_8", - "R_386_COPY", - "R_386_GLOB_DAT", - "R_386_GOT32", - "R_386_GOT32X", - "R_386_GOTOFF", - "R_386_GOTPC", - "R_386_IRELATIVE", - "R_386_JMP_SLOT", - "R_386_NONE", - "R_386_PC16", - "R_386_PC32", - "R_386_PC8", - "R_386_PLT32", - "R_386_RELATIVE", - "R_386_SIZE32", - "R_386_TLS_DESC", - "R_386_TLS_DESC_CALL", - "R_386_TLS_DTPMOD32", - "R_386_TLS_DTPOFF32", - "R_386_TLS_GD", - "R_386_TLS_GD_32", - "R_386_TLS_GD_CALL", - "R_386_TLS_GD_POP", - "R_386_TLS_GD_PUSH", - "R_386_TLS_GOTDESC", - "R_386_TLS_GOTIE", - "R_386_TLS_IE", - "R_386_TLS_IE_32", - "R_386_TLS_LDM", - "R_386_TLS_LDM_32", - "R_386_TLS_LDM_CALL", - "R_386_TLS_LDM_POP", - "R_386_TLS_LDM_PUSH", - "R_386_TLS_LDO_32", - "R_386_TLS_LE", - "R_386_TLS_LE_32", - "R_386_TLS_TPOFF", - "R_386_TLS_TPOFF32", - "R_390", - "R_390_12", - "R_390_16", - "R_390_20", - "R_390_32", - "R_390_64", - "R_390_8", - "R_390_COPY", - "R_390_GLOB_DAT", - "R_390_GOT12", - "R_390_GOT16", - "R_390_GOT20", - "R_390_GOT32", - "R_390_GOT64", - "R_390_GOTENT", - "R_390_GOTOFF", - "R_390_GOTOFF16", - "R_390_GOTOFF64", - "R_390_GOTPC", - "R_390_GOTPCDBL", - "R_390_GOTPLT12", - "R_390_GOTPLT16", - "R_390_GOTPLT20", - "R_390_GOTPLT32", - "R_390_GOTPLT64", - "R_390_GOTPLTENT", - "R_390_GOTPLTOFF16", - "R_390_GOTPLTOFF32", - "R_390_GOTPLTOFF64", - "R_390_JMP_SLOT", - "R_390_NONE", - "R_390_PC16", - "R_390_PC16DBL", - "R_390_PC32", - "R_390_PC32DBL", - "R_390_PC64", - "R_390_PLT16DBL", - "R_390_PLT32", - "R_390_PLT32DBL", - "R_390_PLT64", - "R_390_RELATIVE", - "R_390_TLS_DTPMOD", - "R_390_TLS_DTPOFF", - "R_390_TLS_GD32", - "R_390_TLS_GD64", - "R_390_TLS_GDCALL", - "R_390_TLS_GOTIE12", - "R_390_TLS_GOTIE20", - "R_390_TLS_GOTIE32", - "R_390_TLS_GOTIE64", - "R_390_TLS_IE32", - "R_390_TLS_IE64", - "R_390_TLS_IEENT", - "R_390_TLS_LDCALL", - "R_390_TLS_LDM32", - "R_390_TLS_LDM64", - "R_390_TLS_LDO32", - "R_390_TLS_LDO64", - "R_390_TLS_LE32", - "R_390_TLS_LE64", - "R_390_TLS_LOAD", - "R_390_TLS_TPOFF", - "R_AARCH64", - "R_AARCH64_ABS16", - "R_AARCH64_ABS32", - "R_AARCH64_ABS64", - "R_AARCH64_ADD_ABS_LO12_NC", - "R_AARCH64_ADR_GOT_PAGE", - "R_AARCH64_ADR_PREL_LO21", - "R_AARCH64_ADR_PREL_PG_HI21", - "R_AARCH64_ADR_PREL_PG_HI21_NC", - "R_AARCH64_CALL26", - "R_AARCH64_CONDBR19", - "R_AARCH64_COPY", - "R_AARCH64_GLOB_DAT", - "R_AARCH64_GOT_LD_PREL19", - "R_AARCH64_IRELATIVE", - "R_AARCH64_JUMP26", - "R_AARCH64_JUMP_SLOT", - "R_AARCH64_LD64_GOTOFF_LO15", - "R_AARCH64_LD64_GOTPAGE_LO15", - "R_AARCH64_LD64_GOT_LO12_NC", - "R_AARCH64_LDST128_ABS_LO12_NC", - "R_AARCH64_LDST16_ABS_LO12_NC", - "R_AARCH64_LDST32_ABS_LO12_NC", - "R_AARCH64_LDST64_ABS_LO12_NC", - "R_AARCH64_LDST8_ABS_LO12_NC", - "R_AARCH64_LD_PREL_LO19", - "R_AARCH64_MOVW_SABS_G0", - "R_AARCH64_MOVW_SABS_G1", - "R_AARCH64_MOVW_SABS_G2", - "R_AARCH64_MOVW_UABS_G0", - "R_AARCH64_MOVW_UABS_G0_NC", - "R_AARCH64_MOVW_UABS_G1", - "R_AARCH64_MOVW_UABS_G1_NC", - "R_AARCH64_MOVW_UABS_G2", - "R_AARCH64_MOVW_UABS_G2_NC", - "R_AARCH64_MOVW_UABS_G3", - "R_AARCH64_NONE", - "R_AARCH64_NULL", - "R_AARCH64_P32_ABS16", - "R_AARCH64_P32_ABS32", - "R_AARCH64_P32_ADD_ABS_LO12_NC", - "R_AARCH64_P32_ADR_GOT_PAGE", - "R_AARCH64_P32_ADR_PREL_LO21", - "R_AARCH64_P32_ADR_PREL_PG_HI21", - "R_AARCH64_P32_CALL26", - "R_AARCH64_P32_CONDBR19", - "R_AARCH64_P32_COPY", - "R_AARCH64_P32_GLOB_DAT", - "R_AARCH64_P32_GOT_LD_PREL19", - "R_AARCH64_P32_IRELATIVE", - "R_AARCH64_P32_JUMP26", - "R_AARCH64_P32_JUMP_SLOT", - "R_AARCH64_P32_LD32_GOT_LO12_NC", - "R_AARCH64_P32_LDST128_ABS_LO12_NC", - "R_AARCH64_P32_LDST16_ABS_LO12_NC", - "R_AARCH64_P32_LDST32_ABS_LO12_NC", - "R_AARCH64_P32_LDST64_ABS_LO12_NC", - "R_AARCH64_P32_LDST8_ABS_LO12_NC", - "R_AARCH64_P32_LD_PREL_LO19", - "R_AARCH64_P32_MOVW_SABS_G0", - "R_AARCH64_P32_MOVW_UABS_G0", - "R_AARCH64_P32_MOVW_UABS_G0_NC", - "R_AARCH64_P32_MOVW_UABS_G1", - "R_AARCH64_P32_PREL16", - "R_AARCH64_P32_PREL32", - "R_AARCH64_P32_RELATIVE", - "R_AARCH64_P32_TLSDESC", - "R_AARCH64_P32_TLSDESC_ADD_LO12_NC", - "R_AARCH64_P32_TLSDESC_ADR_PAGE21", - "R_AARCH64_P32_TLSDESC_ADR_PREL21", - "R_AARCH64_P32_TLSDESC_CALL", - "R_AARCH64_P32_TLSDESC_LD32_LO12_NC", - "R_AARCH64_P32_TLSDESC_LD_PREL19", - "R_AARCH64_P32_TLSGD_ADD_LO12_NC", - "R_AARCH64_P32_TLSGD_ADR_PAGE21", - "R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21", - "R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC", - "R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19", - "R_AARCH64_P32_TLSLE_ADD_TPREL_HI12", - "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12", - "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC", - "R_AARCH64_P32_TLSLE_MOVW_TPREL_G1", - "R_AARCH64_P32_TLS_DTPMOD", - "R_AARCH64_P32_TLS_DTPREL", - "R_AARCH64_P32_TLS_TPREL", - "R_AARCH64_P32_TSTBR14", - "R_AARCH64_PREL16", - "R_AARCH64_PREL32", - "R_AARCH64_PREL64", - "R_AARCH64_RELATIVE", - "R_AARCH64_TLSDESC", - "R_AARCH64_TLSDESC_ADD", - "R_AARCH64_TLSDESC_ADD_LO12_NC", - "R_AARCH64_TLSDESC_ADR_PAGE21", - "R_AARCH64_TLSDESC_ADR_PREL21", - "R_AARCH64_TLSDESC_CALL", - "R_AARCH64_TLSDESC_LD64_LO12_NC", - "R_AARCH64_TLSDESC_LDR", - "R_AARCH64_TLSDESC_LD_PREL19", - "R_AARCH64_TLSDESC_OFF_G0_NC", - "R_AARCH64_TLSDESC_OFF_G1", - "R_AARCH64_TLSGD_ADD_LO12_NC", - "R_AARCH64_TLSGD_ADR_PAGE21", - "R_AARCH64_TLSGD_ADR_PREL21", - "R_AARCH64_TLSGD_MOVW_G0_NC", - "R_AARCH64_TLSGD_MOVW_G1", - "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21", - "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC", - "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19", - "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC", - "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1", - "R_AARCH64_TLSLD_ADR_PAGE21", - "R_AARCH64_TLSLD_ADR_PREL21", - "R_AARCH64_TLSLD_LDST128_DTPREL_LO12", - "R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC", - "R_AARCH64_TLSLE_ADD_TPREL_HI12", - "R_AARCH64_TLSLE_ADD_TPREL_LO12", - "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC", - "R_AARCH64_TLSLE_LDST128_TPREL_LO12", - "R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G0", - "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G1", - "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC", - "R_AARCH64_TLSLE_MOVW_TPREL_G2", - "R_AARCH64_TLS_DTPMOD64", - "R_AARCH64_TLS_DTPREL64", - "R_AARCH64_TLS_TPREL64", - "R_AARCH64_TSTBR14", - "R_ALPHA", - "R_ALPHA_BRADDR", - "R_ALPHA_COPY", - "R_ALPHA_GLOB_DAT", - "R_ALPHA_GPDISP", - "R_ALPHA_GPREL32", - "R_ALPHA_GPRELHIGH", - "R_ALPHA_GPRELLOW", - "R_ALPHA_GPVALUE", - "R_ALPHA_HINT", - "R_ALPHA_IMMED_BR_HI32", - "R_ALPHA_IMMED_GP_16", - "R_ALPHA_IMMED_GP_HI32", - "R_ALPHA_IMMED_LO32", - "R_ALPHA_IMMED_SCN_HI32", - "R_ALPHA_JMP_SLOT", - "R_ALPHA_LITERAL", - "R_ALPHA_LITUSE", - "R_ALPHA_NONE", - "R_ALPHA_OP_PRSHIFT", - "R_ALPHA_OP_PSUB", - "R_ALPHA_OP_PUSH", - "R_ALPHA_OP_STORE", - "R_ALPHA_REFLONG", - "R_ALPHA_REFQUAD", - "R_ALPHA_RELATIVE", - "R_ALPHA_SREL16", - "R_ALPHA_SREL32", - "R_ALPHA_SREL64", - "R_ARM", - "R_ARM_ABS12", - "R_ARM_ABS16", - "R_ARM_ABS32", - "R_ARM_ABS32_NOI", - "R_ARM_ABS8", - "R_ARM_ALU_PCREL_15_8", - "R_ARM_ALU_PCREL_23_15", - "R_ARM_ALU_PCREL_7_0", - "R_ARM_ALU_PC_G0", - "R_ARM_ALU_PC_G0_NC", - "R_ARM_ALU_PC_G1", - "R_ARM_ALU_PC_G1_NC", - "R_ARM_ALU_PC_G2", - "R_ARM_ALU_SBREL_19_12_NC", - "R_ARM_ALU_SBREL_27_20_CK", - "R_ARM_ALU_SB_G0", - "R_ARM_ALU_SB_G0_NC", - "R_ARM_ALU_SB_G1", - "R_ARM_ALU_SB_G1_NC", - "R_ARM_ALU_SB_G2", - "R_ARM_AMP_VCALL9", - "R_ARM_BASE_ABS", - "R_ARM_CALL", - "R_ARM_COPY", - "R_ARM_GLOB_DAT", - "R_ARM_GNU_VTENTRY", - "R_ARM_GNU_VTINHERIT", - "R_ARM_GOT32", - "R_ARM_GOTOFF", - "R_ARM_GOTOFF12", - "R_ARM_GOTPC", - "R_ARM_GOTRELAX", - "R_ARM_GOT_ABS", - "R_ARM_GOT_BREL12", - "R_ARM_GOT_PREL", - "R_ARM_IRELATIVE", - "R_ARM_JUMP24", - "R_ARM_JUMP_SLOT", - "R_ARM_LDC_PC_G0", - "R_ARM_LDC_PC_G1", - "R_ARM_LDC_PC_G2", - "R_ARM_LDC_SB_G0", - "R_ARM_LDC_SB_G1", - "R_ARM_LDC_SB_G2", - "R_ARM_LDRS_PC_G0", - "R_ARM_LDRS_PC_G1", - "R_ARM_LDRS_PC_G2", - "R_ARM_LDRS_SB_G0", - "R_ARM_LDRS_SB_G1", - "R_ARM_LDRS_SB_G2", - "R_ARM_LDR_PC_G1", - "R_ARM_LDR_PC_G2", - "R_ARM_LDR_SBREL_11_10_NC", - "R_ARM_LDR_SB_G0", - "R_ARM_LDR_SB_G1", - "R_ARM_LDR_SB_G2", - "R_ARM_ME_TOO", - "R_ARM_MOVT_ABS", - "R_ARM_MOVT_BREL", - "R_ARM_MOVT_PREL", - "R_ARM_MOVW_ABS_NC", - "R_ARM_MOVW_BREL", - "R_ARM_MOVW_BREL_NC", - "R_ARM_MOVW_PREL_NC", - "R_ARM_NONE", - "R_ARM_PC13", - "R_ARM_PC24", - "R_ARM_PLT32", - "R_ARM_PLT32_ABS", - "R_ARM_PREL31", - "R_ARM_PRIVATE_0", - "R_ARM_PRIVATE_1", - "R_ARM_PRIVATE_10", - "R_ARM_PRIVATE_11", - "R_ARM_PRIVATE_12", - "R_ARM_PRIVATE_13", - "R_ARM_PRIVATE_14", - "R_ARM_PRIVATE_15", - "R_ARM_PRIVATE_2", - "R_ARM_PRIVATE_3", - "R_ARM_PRIVATE_4", - "R_ARM_PRIVATE_5", - "R_ARM_PRIVATE_6", - "R_ARM_PRIVATE_7", - "R_ARM_PRIVATE_8", - "R_ARM_PRIVATE_9", - "R_ARM_RABS32", - "R_ARM_RBASE", - "R_ARM_REL32", - "R_ARM_REL32_NOI", - "R_ARM_RELATIVE", - "R_ARM_RPC24", - "R_ARM_RREL32", - "R_ARM_RSBREL32", - "R_ARM_RXPC25", - "R_ARM_SBREL31", - "R_ARM_SBREL32", - "R_ARM_SWI24", - "R_ARM_TARGET1", - "R_ARM_TARGET2", - "R_ARM_THM_ABS5", - "R_ARM_THM_ALU_ABS_G0_NC", - "R_ARM_THM_ALU_ABS_G1_NC", - "R_ARM_THM_ALU_ABS_G2_NC", - "R_ARM_THM_ALU_ABS_G3", - "R_ARM_THM_ALU_PREL_11_0", - "R_ARM_THM_GOT_BREL12", - "R_ARM_THM_JUMP11", - "R_ARM_THM_JUMP19", - "R_ARM_THM_JUMP24", - "R_ARM_THM_JUMP6", - "R_ARM_THM_JUMP8", - "R_ARM_THM_MOVT_ABS", - "R_ARM_THM_MOVT_BREL", - "R_ARM_THM_MOVT_PREL", - "R_ARM_THM_MOVW_ABS_NC", - "R_ARM_THM_MOVW_BREL", - "R_ARM_THM_MOVW_BREL_NC", - "R_ARM_THM_MOVW_PREL_NC", - "R_ARM_THM_PC12", - "R_ARM_THM_PC22", - "R_ARM_THM_PC8", - "R_ARM_THM_RPC22", - "R_ARM_THM_SWI8", - "R_ARM_THM_TLS_CALL", - "R_ARM_THM_TLS_DESCSEQ16", - "R_ARM_THM_TLS_DESCSEQ32", - "R_ARM_THM_XPC22", - "R_ARM_TLS_CALL", - "R_ARM_TLS_DESCSEQ", - "R_ARM_TLS_DTPMOD32", - "R_ARM_TLS_DTPOFF32", - "R_ARM_TLS_GD32", - "R_ARM_TLS_GOTDESC", - "R_ARM_TLS_IE12GP", - "R_ARM_TLS_IE32", - "R_ARM_TLS_LDM32", - "R_ARM_TLS_LDO12", - "R_ARM_TLS_LDO32", - "R_ARM_TLS_LE12", - "R_ARM_TLS_LE32", - "R_ARM_TLS_TPOFF32", - "R_ARM_V4BX", - "R_ARM_XPC25", - "R_INFO", - "R_INFO32", - "R_LARCH", - "R_LARCH_32", - "R_LARCH_32_PCREL", - "R_LARCH_64", - "R_LARCH_ABS64_HI12", - "R_LARCH_ABS64_LO20", - "R_LARCH_ABS_HI20", - "R_LARCH_ABS_LO12", - "R_LARCH_ADD16", - "R_LARCH_ADD24", - "R_LARCH_ADD32", - "R_LARCH_ADD64", - "R_LARCH_ADD8", - "R_LARCH_B16", - "R_LARCH_B21", - "R_LARCH_B26", - "R_LARCH_COPY", - "R_LARCH_GNU_VTENTRY", - "R_LARCH_GNU_VTINHERIT", - "R_LARCH_GOT64_HI12", - "R_LARCH_GOT64_LO20", - "R_LARCH_GOT64_PC_HI12", - "R_LARCH_GOT64_PC_LO20", - "R_LARCH_GOT_HI20", - "R_LARCH_GOT_LO12", - "R_LARCH_GOT_PC_HI20", - "R_LARCH_GOT_PC_LO12", - "R_LARCH_IRELATIVE", - "R_LARCH_JUMP_SLOT", - "R_LARCH_MARK_LA", - "R_LARCH_MARK_PCREL", - "R_LARCH_NONE", - "R_LARCH_PCALA64_HI12", - "R_LARCH_PCALA64_LO20", - "R_LARCH_PCALA_HI20", - "R_LARCH_PCALA_LO12", - "R_LARCH_RELATIVE", - "R_LARCH_RELAX", - "R_LARCH_SOP_ADD", - "R_LARCH_SOP_AND", - "R_LARCH_SOP_ASSERT", - "R_LARCH_SOP_IF_ELSE", - "R_LARCH_SOP_NOT", - "R_LARCH_SOP_POP_32_S_0_10_10_16_S2", - "R_LARCH_SOP_POP_32_S_0_5_10_16_S2", - "R_LARCH_SOP_POP_32_S_10_12", - "R_LARCH_SOP_POP_32_S_10_16", - "R_LARCH_SOP_POP_32_S_10_16_S2", - "R_LARCH_SOP_POP_32_S_10_5", - "R_LARCH_SOP_POP_32_S_5_20", - "R_LARCH_SOP_POP_32_U", - "R_LARCH_SOP_POP_32_U_10_12", - "R_LARCH_SOP_PUSH_ABSOLUTE", - "R_LARCH_SOP_PUSH_DUP", - "R_LARCH_SOP_PUSH_GPREL", - "R_LARCH_SOP_PUSH_PCREL", - "R_LARCH_SOP_PUSH_PLT_PCREL", - "R_LARCH_SOP_PUSH_TLS_GD", - "R_LARCH_SOP_PUSH_TLS_GOT", - "R_LARCH_SOP_PUSH_TLS_TPREL", - "R_LARCH_SOP_SL", - "R_LARCH_SOP_SR", - "R_LARCH_SOP_SUB", - "R_LARCH_SUB16", - "R_LARCH_SUB24", - "R_LARCH_SUB32", - "R_LARCH_SUB64", - "R_LARCH_SUB8", - "R_LARCH_TLS_DTPMOD32", - "R_LARCH_TLS_DTPMOD64", - "R_LARCH_TLS_DTPREL32", - "R_LARCH_TLS_DTPREL64", - "R_LARCH_TLS_GD_HI20", - "R_LARCH_TLS_GD_PC_HI20", - "R_LARCH_TLS_IE64_HI12", - "R_LARCH_TLS_IE64_LO20", - "R_LARCH_TLS_IE64_PC_HI12", - "R_LARCH_TLS_IE64_PC_LO20", - "R_LARCH_TLS_IE_HI20", - "R_LARCH_TLS_IE_LO12", - "R_LARCH_TLS_IE_PC_HI20", - "R_LARCH_TLS_IE_PC_LO12", - "R_LARCH_TLS_LD_HI20", - "R_LARCH_TLS_LD_PC_HI20", - "R_LARCH_TLS_LE64_HI12", - "R_LARCH_TLS_LE64_LO20", - "R_LARCH_TLS_LE_HI20", - "R_LARCH_TLS_LE_LO12", - "R_LARCH_TLS_TPREL32", - "R_LARCH_TLS_TPREL64", - "R_MIPS", - "R_MIPS_16", - "R_MIPS_26", - "R_MIPS_32", - "R_MIPS_64", - "R_MIPS_ADD_IMMEDIATE", - "R_MIPS_CALL16", - "R_MIPS_CALL_HI16", - "R_MIPS_CALL_LO16", - "R_MIPS_DELETE", - "R_MIPS_GOT16", - "R_MIPS_GOT_DISP", - "R_MIPS_GOT_HI16", - "R_MIPS_GOT_LO16", - "R_MIPS_GOT_OFST", - "R_MIPS_GOT_PAGE", - "R_MIPS_GPREL16", - "R_MIPS_GPREL32", - "R_MIPS_HI16", - "R_MIPS_HIGHER", - "R_MIPS_HIGHEST", - "R_MIPS_INSERT_A", - "R_MIPS_INSERT_B", - "R_MIPS_JALR", - "R_MIPS_LITERAL", - "R_MIPS_LO16", - "R_MIPS_NONE", - "R_MIPS_PC16", - "R_MIPS_PJUMP", - "R_MIPS_REL16", - "R_MIPS_REL32", - "R_MIPS_RELGOT", - "R_MIPS_SCN_DISP", - "R_MIPS_SHIFT5", - "R_MIPS_SHIFT6", - "R_MIPS_SUB", - "R_MIPS_TLS_DTPMOD32", - "R_MIPS_TLS_DTPMOD64", - "R_MIPS_TLS_DTPREL32", - "R_MIPS_TLS_DTPREL64", - "R_MIPS_TLS_DTPREL_HI16", - "R_MIPS_TLS_DTPREL_LO16", - "R_MIPS_TLS_GD", - "R_MIPS_TLS_GOTTPREL", - "R_MIPS_TLS_LDM", - "R_MIPS_TLS_TPREL32", - "R_MIPS_TLS_TPREL64", - "R_MIPS_TLS_TPREL_HI16", - "R_MIPS_TLS_TPREL_LO16", - "R_PPC", - "R_PPC64", - "R_PPC64_ADDR14", - "R_PPC64_ADDR14_BRNTAKEN", - "R_PPC64_ADDR14_BRTAKEN", - "R_PPC64_ADDR16", - "R_PPC64_ADDR16_DS", - "R_PPC64_ADDR16_HA", - "R_PPC64_ADDR16_HI", - "R_PPC64_ADDR16_HIGH", - "R_PPC64_ADDR16_HIGHA", - "R_PPC64_ADDR16_HIGHER", - "R_PPC64_ADDR16_HIGHER34", - "R_PPC64_ADDR16_HIGHERA", - "R_PPC64_ADDR16_HIGHERA34", - "R_PPC64_ADDR16_HIGHEST", - "R_PPC64_ADDR16_HIGHEST34", - "R_PPC64_ADDR16_HIGHESTA", - "R_PPC64_ADDR16_HIGHESTA34", - "R_PPC64_ADDR16_LO", - "R_PPC64_ADDR16_LO_DS", - "R_PPC64_ADDR24", - "R_PPC64_ADDR32", - "R_PPC64_ADDR64", - "R_PPC64_ADDR64_LOCAL", - "R_PPC64_COPY", - "R_PPC64_D28", - "R_PPC64_D34", - "R_PPC64_D34_HA30", - "R_PPC64_D34_HI30", - "R_PPC64_D34_LO", - "R_PPC64_DTPMOD64", - "R_PPC64_DTPREL16", - "R_PPC64_DTPREL16_DS", - "R_PPC64_DTPREL16_HA", - "R_PPC64_DTPREL16_HI", - "R_PPC64_DTPREL16_HIGH", - "R_PPC64_DTPREL16_HIGHA", - "R_PPC64_DTPREL16_HIGHER", - "R_PPC64_DTPREL16_HIGHERA", - "R_PPC64_DTPREL16_HIGHEST", - "R_PPC64_DTPREL16_HIGHESTA", - "R_PPC64_DTPREL16_LO", - "R_PPC64_DTPREL16_LO_DS", - "R_PPC64_DTPREL34", - "R_PPC64_DTPREL64", - "R_PPC64_ENTRY", - "R_PPC64_GLOB_DAT", - "R_PPC64_GNU_VTENTRY", - "R_PPC64_GNU_VTINHERIT", - "R_PPC64_GOT16", - "R_PPC64_GOT16_DS", - "R_PPC64_GOT16_HA", - "R_PPC64_GOT16_HI", - "R_PPC64_GOT16_LO", - "R_PPC64_GOT16_LO_DS", - "R_PPC64_GOT_DTPREL16_DS", - "R_PPC64_GOT_DTPREL16_HA", - "R_PPC64_GOT_DTPREL16_HI", - "R_PPC64_GOT_DTPREL16_LO_DS", - "R_PPC64_GOT_DTPREL_PCREL34", - "R_PPC64_GOT_PCREL34", - "R_PPC64_GOT_TLSGD16", - "R_PPC64_GOT_TLSGD16_HA", - "R_PPC64_GOT_TLSGD16_HI", - "R_PPC64_GOT_TLSGD16_LO", - "R_PPC64_GOT_TLSGD_PCREL34", - "R_PPC64_GOT_TLSLD16", - "R_PPC64_GOT_TLSLD16_HA", - "R_PPC64_GOT_TLSLD16_HI", - "R_PPC64_GOT_TLSLD16_LO", - "R_PPC64_GOT_TLSLD_PCREL34", - "R_PPC64_GOT_TPREL16_DS", - "R_PPC64_GOT_TPREL16_HA", - "R_PPC64_GOT_TPREL16_HI", - "R_PPC64_GOT_TPREL16_LO_DS", - "R_PPC64_GOT_TPREL_PCREL34", - "R_PPC64_IRELATIVE", - "R_PPC64_JMP_IREL", - "R_PPC64_JMP_SLOT", - "R_PPC64_NONE", - "R_PPC64_PCREL28", - "R_PPC64_PCREL34", - "R_PPC64_PCREL_OPT", - "R_PPC64_PLT16_HA", - "R_PPC64_PLT16_HI", - "R_PPC64_PLT16_LO", - "R_PPC64_PLT16_LO_DS", - "R_PPC64_PLT32", - "R_PPC64_PLT64", - "R_PPC64_PLTCALL", - "R_PPC64_PLTCALL_NOTOC", - "R_PPC64_PLTGOT16", - "R_PPC64_PLTGOT16_DS", - "R_PPC64_PLTGOT16_HA", - "R_PPC64_PLTGOT16_HI", - "R_PPC64_PLTGOT16_LO", - "R_PPC64_PLTGOT_LO_DS", - "R_PPC64_PLTREL32", - "R_PPC64_PLTREL64", - "R_PPC64_PLTSEQ", - "R_PPC64_PLTSEQ_NOTOC", - "R_PPC64_PLT_PCREL34", - "R_PPC64_PLT_PCREL34_NOTOC", - "R_PPC64_REL14", - "R_PPC64_REL14_BRNTAKEN", - "R_PPC64_REL14_BRTAKEN", - "R_PPC64_REL16", - "R_PPC64_REL16DX_HA", - "R_PPC64_REL16_HA", - "R_PPC64_REL16_HI", - "R_PPC64_REL16_HIGH", - "R_PPC64_REL16_HIGHA", - "R_PPC64_REL16_HIGHER", - "R_PPC64_REL16_HIGHER34", - "R_PPC64_REL16_HIGHERA", - "R_PPC64_REL16_HIGHERA34", - "R_PPC64_REL16_HIGHEST", - "R_PPC64_REL16_HIGHEST34", - "R_PPC64_REL16_HIGHESTA", - "R_PPC64_REL16_HIGHESTA34", - "R_PPC64_REL16_LO", - "R_PPC64_REL24", - "R_PPC64_REL24_NOTOC", - "R_PPC64_REL30", - "R_PPC64_REL32", - "R_PPC64_REL64", - "R_PPC64_RELATIVE", - "R_PPC64_SECTOFF", - "R_PPC64_SECTOFF_DS", - "R_PPC64_SECTOFF_HA", - "R_PPC64_SECTOFF_HI", - "R_PPC64_SECTOFF_LO", - "R_PPC64_SECTOFF_LO_DS", - "R_PPC64_TLS", - "R_PPC64_TLSGD", - "R_PPC64_TLSLD", - "R_PPC64_TOC", - "R_PPC64_TOC16", - "R_PPC64_TOC16_DS", - "R_PPC64_TOC16_HA", - "R_PPC64_TOC16_HI", - "R_PPC64_TOC16_LO", - "R_PPC64_TOC16_LO_DS", - "R_PPC64_TOCSAVE", - "R_PPC64_TPREL16", - "R_PPC64_TPREL16_DS", - "R_PPC64_TPREL16_HA", - "R_PPC64_TPREL16_HI", - "R_PPC64_TPREL16_HIGH", - "R_PPC64_TPREL16_HIGHA", - "R_PPC64_TPREL16_HIGHER", - "R_PPC64_TPREL16_HIGHERA", - "R_PPC64_TPREL16_HIGHEST", - "R_PPC64_TPREL16_HIGHESTA", - "R_PPC64_TPREL16_LO", - "R_PPC64_TPREL16_LO_DS", - "R_PPC64_TPREL34", - "R_PPC64_TPREL64", - "R_PPC64_UADDR16", - "R_PPC64_UADDR32", - "R_PPC64_UADDR64", - "R_PPC_ADDR14", - "R_PPC_ADDR14_BRNTAKEN", - "R_PPC_ADDR14_BRTAKEN", - "R_PPC_ADDR16", - "R_PPC_ADDR16_HA", - "R_PPC_ADDR16_HI", - "R_PPC_ADDR16_LO", - "R_PPC_ADDR24", - "R_PPC_ADDR32", - "R_PPC_COPY", - "R_PPC_DTPMOD32", - "R_PPC_DTPREL16", - "R_PPC_DTPREL16_HA", - "R_PPC_DTPREL16_HI", - "R_PPC_DTPREL16_LO", - "R_PPC_DTPREL32", - "R_PPC_EMB_BIT_FLD", - "R_PPC_EMB_MRKREF", - "R_PPC_EMB_NADDR16", - "R_PPC_EMB_NADDR16_HA", - "R_PPC_EMB_NADDR16_HI", - "R_PPC_EMB_NADDR16_LO", - "R_PPC_EMB_NADDR32", - "R_PPC_EMB_RELSDA", - "R_PPC_EMB_RELSEC16", - "R_PPC_EMB_RELST_HA", - "R_PPC_EMB_RELST_HI", - "R_PPC_EMB_RELST_LO", - "R_PPC_EMB_SDA21", - "R_PPC_EMB_SDA2I16", - "R_PPC_EMB_SDA2REL", - "R_PPC_EMB_SDAI16", - "R_PPC_GLOB_DAT", - "R_PPC_GOT16", - "R_PPC_GOT16_HA", - "R_PPC_GOT16_HI", - "R_PPC_GOT16_LO", - "R_PPC_GOT_TLSGD16", - "R_PPC_GOT_TLSGD16_HA", - "R_PPC_GOT_TLSGD16_HI", - "R_PPC_GOT_TLSGD16_LO", - "R_PPC_GOT_TLSLD16", - "R_PPC_GOT_TLSLD16_HA", - "R_PPC_GOT_TLSLD16_HI", - "R_PPC_GOT_TLSLD16_LO", - "R_PPC_GOT_TPREL16", - "R_PPC_GOT_TPREL16_HA", - "R_PPC_GOT_TPREL16_HI", - "R_PPC_GOT_TPREL16_LO", - "R_PPC_JMP_SLOT", - "R_PPC_LOCAL24PC", - "R_PPC_NONE", - "R_PPC_PLT16_HA", - "R_PPC_PLT16_HI", - "R_PPC_PLT16_LO", - "R_PPC_PLT32", - "R_PPC_PLTREL24", - "R_PPC_PLTREL32", - "R_PPC_REL14", - "R_PPC_REL14_BRNTAKEN", - "R_PPC_REL14_BRTAKEN", - "R_PPC_REL24", - "R_PPC_REL32", - "R_PPC_RELATIVE", - "R_PPC_SDAREL16", - "R_PPC_SECTOFF", - "R_PPC_SECTOFF_HA", - "R_PPC_SECTOFF_HI", - "R_PPC_SECTOFF_LO", - "R_PPC_TLS", - "R_PPC_TPREL16", - "R_PPC_TPREL16_HA", - "R_PPC_TPREL16_HI", - "R_PPC_TPREL16_LO", - "R_PPC_TPREL32", - "R_PPC_UADDR16", - "R_PPC_UADDR32", - "R_RISCV", - "R_RISCV_32", - "R_RISCV_32_PCREL", - "R_RISCV_64", - "R_RISCV_ADD16", - "R_RISCV_ADD32", - "R_RISCV_ADD64", - "R_RISCV_ADD8", - "R_RISCV_ALIGN", - "R_RISCV_BRANCH", - "R_RISCV_CALL", - "R_RISCV_CALL_PLT", - "R_RISCV_COPY", - "R_RISCV_GNU_VTENTRY", - "R_RISCV_GNU_VTINHERIT", - "R_RISCV_GOT_HI20", - "R_RISCV_GPREL_I", - "R_RISCV_GPREL_S", - "R_RISCV_HI20", - "R_RISCV_JAL", - "R_RISCV_JUMP_SLOT", - "R_RISCV_LO12_I", - "R_RISCV_LO12_S", - "R_RISCV_NONE", - "R_RISCV_PCREL_HI20", - "R_RISCV_PCREL_LO12_I", - "R_RISCV_PCREL_LO12_S", - "R_RISCV_RELATIVE", - "R_RISCV_RELAX", - "R_RISCV_RVC_BRANCH", - "R_RISCV_RVC_JUMP", - "R_RISCV_RVC_LUI", - "R_RISCV_SET16", - "R_RISCV_SET32", - "R_RISCV_SET6", - "R_RISCV_SET8", - "R_RISCV_SUB16", - "R_RISCV_SUB32", - "R_RISCV_SUB6", - "R_RISCV_SUB64", - "R_RISCV_SUB8", - "R_RISCV_TLS_DTPMOD32", - "R_RISCV_TLS_DTPMOD64", - "R_RISCV_TLS_DTPREL32", - "R_RISCV_TLS_DTPREL64", - "R_RISCV_TLS_GD_HI20", - "R_RISCV_TLS_GOT_HI20", - "R_RISCV_TLS_TPREL32", - "R_RISCV_TLS_TPREL64", - "R_RISCV_TPREL_ADD", - "R_RISCV_TPREL_HI20", - "R_RISCV_TPREL_I", - "R_RISCV_TPREL_LO12_I", - "R_RISCV_TPREL_LO12_S", - "R_RISCV_TPREL_S", - "R_SPARC", - "R_SPARC_10", - "R_SPARC_11", - "R_SPARC_13", - "R_SPARC_16", - "R_SPARC_22", - "R_SPARC_32", - "R_SPARC_5", - "R_SPARC_6", - "R_SPARC_64", - "R_SPARC_7", - "R_SPARC_8", - "R_SPARC_COPY", - "R_SPARC_DISP16", - "R_SPARC_DISP32", - "R_SPARC_DISP64", - "R_SPARC_DISP8", - "R_SPARC_GLOB_DAT", - "R_SPARC_GLOB_JMP", - "R_SPARC_GOT10", - "R_SPARC_GOT13", - "R_SPARC_GOT22", - "R_SPARC_H44", - "R_SPARC_HH22", - "R_SPARC_HI22", - "R_SPARC_HIPLT22", - "R_SPARC_HIX22", - "R_SPARC_HM10", - "R_SPARC_JMP_SLOT", - "R_SPARC_L44", - "R_SPARC_LM22", - "R_SPARC_LO10", - "R_SPARC_LOPLT10", - "R_SPARC_LOX10", - "R_SPARC_M44", - "R_SPARC_NONE", - "R_SPARC_OLO10", - "R_SPARC_PC10", - "R_SPARC_PC22", - "R_SPARC_PCPLT10", - "R_SPARC_PCPLT22", - "R_SPARC_PCPLT32", - "R_SPARC_PC_HH22", - "R_SPARC_PC_HM10", - "R_SPARC_PC_LM22", - "R_SPARC_PLT32", - "R_SPARC_PLT64", - "R_SPARC_REGISTER", - "R_SPARC_RELATIVE", - "R_SPARC_UA16", - "R_SPARC_UA32", - "R_SPARC_UA64", - "R_SPARC_WDISP16", - "R_SPARC_WDISP19", - "R_SPARC_WDISP22", - "R_SPARC_WDISP30", - "R_SPARC_WPLT30", - "R_SYM32", - "R_SYM64", - "R_TYPE32", - "R_TYPE64", - "R_X86_64", - "R_X86_64_16", - "R_X86_64_32", - "R_X86_64_32S", - "R_X86_64_64", - "R_X86_64_8", - "R_X86_64_COPY", - "R_X86_64_DTPMOD64", - "R_X86_64_DTPOFF32", - "R_X86_64_DTPOFF64", - "R_X86_64_GLOB_DAT", - "R_X86_64_GOT32", - "R_X86_64_GOT64", - "R_X86_64_GOTOFF64", - "R_X86_64_GOTPC32", - "R_X86_64_GOTPC32_TLSDESC", - "R_X86_64_GOTPC64", - "R_X86_64_GOTPCREL", - "R_X86_64_GOTPCREL64", - "R_X86_64_GOTPCRELX", - "R_X86_64_GOTPLT64", - "R_X86_64_GOTTPOFF", - "R_X86_64_IRELATIVE", - "R_X86_64_JMP_SLOT", - "R_X86_64_NONE", - "R_X86_64_PC16", - "R_X86_64_PC32", - "R_X86_64_PC32_BND", - "R_X86_64_PC64", - "R_X86_64_PC8", - "R_X86_64_PLT32", - "R_X86_64_PLT32_BND", - "R_X86_64_PLTOFF64", - "R_X86_64_RELATIVE", - "R_X86_64_RELATIVE64", - "R_X86_64_REX_GOTPCRELX", - "R_X86_64_SIZE32", - "R_X86_64_SIZE64", - "R_X86_64_TLSDESC", - "R_X86_64_TLSDESC_CALL", - "R_X86_64_TLSGD", - "R_X86_64_TLSLD", - "R_X86_64_TPOFF32", - "R_X86_64_TPOFF64", - "Rel32", - "Rel64", - "Rela32", - "Rela64", - "SHF_ALLOC", - "SHF_COMPRESSED", - "SHF_EXECINSTR", - "SHF_GROUP", - "SHF_INFO_LINK", - "SHF_LINK_ORDER", - "SHF_MASKOS", - "SHF_MASKPROC", - "SHF_MERGE", - "SHF_OS_NONCONFORMING", - "SHF_STRINGS", - "SHF_TLS", - "SHF_WRITE", - "SHN_ABS", - "SHN_COMMON", - "SHN_HIOS", - "SHN_HIPROC", - "SHN_HIRESERVE", - "SHN_LOOS", - "SHN_LOPROC", - "SHN_LORESERVE", - "SHN_UNDEF", - "SHN_XINDEX", - "SHT_DYNAMIC", - "SHT_DYNSYM", - "SHT_FINI_ARRAY", - "SHT_GNU_ATTRIBUTES", - "SHT_GNU_HASH", - "SHT_GNU_LIBLIST", - "SHT_GNU_VERDEF", - "SHT_GNU_VERNEED", - "SHT_GNU_VERSYM", - "SHT_GROUP", - "SHT_HASH", - "SHT_HIOS", - "SHT_HIPROC", - "SHT_HIUSER", - "SHT_INIT_ARRAY", - "SHT_LOOS", - "SHT_LOPROC", - "SHT_LOUSER", - "SHT_MIPS_ABIFLAGS", - "SHT_NOBITS", - "SHT_NOTE", - "SHT_NULL", - "SHT_PREINIT_ARRAY", - "SHT_PROGBITS", - "SHT_REL", - "SHT_RELA", - "SHT_SHLIB", - "SHT_STRTAB", - "SHT_SYMTAB", - "SHT_SYMTAB_SHNDX", - "STB_GLOBAL", - "STB_HIOS", - "STB_HIPROC", - "STB_LOCAL", - "STB_LOOS", - "STB_LOPROC", - "STB_WEAK", - "STT_COMMON", - "STT_FILE", - "STT_FUNC", - "STT_HIOS", - "STT_HIPROC", - "STT_LOOS", - "STT_LOPROC", - "STT_NOTYPE", - "STT_OBJECT", - "STT_SECTION", - "STT_TLS", - "STV_DEFAULT", - "STV_HIDDEN", - "STV_INTERNAL", - "STV_PROTECTED", - "ST_BIND", - "ST_INFO", - "ST_TYPE", - "ST_VISIBILITY", - "Section", - "Section32", - "Section64", - "SectionFlag", - "SectionHeader", - "SectionIndex", - "SectionType", - "Sym32", - "Sym32Size", - "Sym64", - "Sym64Size", - "SymBind", - "SymType", - "SymVis", - "Symbol", - "Type", - "Version", - }, - "debug/gosym": { - "DecodingError", - "Func", - "LineTable", - "NewLineTable", - "NewTable", - "Obj", - "Sym", - "Table", - "UnknownFileError", - "UnknownLineError", - }, - "debug/macho": { - "ARM64_RELOC_ADDEND", - "ARM64_RELOC_BRANCH26", - "ARM64_RELOC_GOT_LOAD_PAGE21", - "ARM64_RELOC_GOT_LOAD_PAGEOFF12", - "ARM64_RELOC_PAGE21", - "ARM64_RELOC_PAGEOFF12", - "ARM64_RELOC_POINTER_TO_GOT", - "ARM64_RELOC_SUBTRACTOR", - "ARM64_RELOC_TLVP_LOAD_PAGE21", - "ARM64_RELOC_TLVP_LOAD_PAGEOFF12", - "ARM64_RELOC_UNSIGNED", - "ARM_RELOC_BR24", - "ARM_RELOC_HALF", - "ARM_RELOC_HALF_SECTDIFF", - "ARM_RELOC_LOCAL_SECTDIFF", - "ARM_RELOC_PAIR", - "ARM_RELOC_PB_LA_PTR", - "ARM_RELOC_SECTDIFF", - "ARM_RELOC_VANILLA", - "ARM_THUMB_32BIT_BRANCH", - "ARM_THUMB_RELOC_BR22", - "Cpu", - "Cpu386", - "CpuAmd64", - "CpuArm", - "CpuArm64", - "CpuPpc", - "CpuPpc64", - "Dylib", - "DylibCmd", - "Dysymtab", - "DysymtabCmd", - "ErrNotFat", - "FatArch", - "FatArchHeader", - "FatFile", - "File", - "FileHeader", - "FlagAllModsBound", - "FlagAllowStackExecution", - "FlagAppExtensionSafe", - "FlagBindAtLoad", - "FlagBindsToWeak", - "FlagCanonical", - "FlagDeadStrippableDylib", - "FlagDyldLink", - "FlagForceFlat", - "FlagHasTLVDescriptors", - "FlagIncrLink", - "FlagLazyInit", - "FlagNoFixPrebinding", - "FlagNoHeapExecution", - "FlagNoMultiDefs", - "FlagNoReexportedDylibs", - "FlagNoUndefs", - "FlagPIE", - "FlagPrebindable", - "FlagPrebound", - "FlagRootSafe", - "FlagSetuidSafe", - "FlagSplitSegs", - "FlagSubsectionsViaSymbols", - "FlagTwoLevel", - "FlagWeakDefines", - "FormatError", - "GENERIC_RELOC_LOCAL_SECTDIFF", - "GENERIC_RELOC_PAIR", - "GENERIC_RELOC_PB_LA_PTR", - "GENERIC_RELOC_SECTDIFF", - "GENERIC_RELOC_TLV", - "GENERIC_RELOC_VANILLA", - "Load", - "LoadBytes", - "LoadCmd", - "LoadCmdDylib", - "LoadCmdDylinker", - "LoadCmdDysymtab", - "LoadCmdRpath", - "LoadCmdSegment", - "LoadCmdSegment64", - "LoadCmdSymtab", - "LoadCmdThread", - "LoadCmdUnixThread", - "Magic32", - "Magic64", - "MagicFat", - "NewFatFile", - "NewFile", - "Nlist32", - "Nlist64", - "Open", - "OpenFat", - "Regs386", - "RegsAMD64", - "Reloc", - "RelocTypeARM", - "RelocTypeARM64", - "RelocTypeGeneric", - "RelocTypeX86_64", - "Rpath", - "RpathCmd", - "Section", - "Section32", - "Section64", - "SectionHeader", - "Segment", - "Segment32", - "Segment64", - "SegmentHeader", - "Symbol", - "Symtab", - "SymtabCmd", - "Thread", - "Type", - "TypeBundle", - "TypeDylib", - "TypeExec", - "TypeObj", - "X86_64_RELOC_BRANCH", - "X86_64_RELOC_GOT", - "X86_64_RELOC_GOT_LOAD", - "X86_64_RELOC_SIGNED", - "X86_64_RELOC_SIGNED_1", - "X86_64_RELOC_SIGNED_2", - "X86_64_RELOC_SIGNED_4", - "X86_64_RELOC_SUBTRACTOR", - "X86_64_RELOC_TLV", - "X86_64_RELOC_UNSIGNED", - }, - "debug/pe": { - "COFFSymbol", - "COFFSymbolAuxFormat5", - "COFFSymbolSize", - "DataDirectory", - "File", - "FileHeader", - "FormatError", - "IMAGE_COMDAT_SELECT_ANY", - "IMAGE_COMDAT_SELECT_ASSOCIATIVE", - "IMAGE_COMDAT_SELECT_EXACT_MATCH", - "IMAGE_COMDAT_SELECT_LARGEST", - "IMAGE_COMDAT_SELECT_NODUPLICATES", - "IMAGE_COMDAT_SELECT_SAME_SIZE", - "IMAGE_DIRECTORY_ENTRY_ARCHITECTURE", - "IMAGE_DIRECTORY_ENTRY_BASERELOC", - "IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT", - "IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR", - "IMAGE_DIRECTORY_ENTRY_DEBUG", - "IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT", - "IMAGE_DIRECTORY_ENTRY_EXCEPTION", - "IMAGE_DIRECTORY_ENTRY_EXPORT", - "IMAGE_DIRECTORY_ENTRY_GLOBALPTR", - "IMAGE_DIRECTORY_ENTRY_IAT", - "IMAGE_DIRECTORY_ENTRY_IMPORT", - "IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG", - "IMAGE_DIRECTORY_ENTRY_RESOURCE", - "IMAGE_DIRECTORY_ENTRY_SECURITY", - "IMAGE_DIRECTORY_ENTRY_TLS", - "IMAGE_DLLCHARACTERISTICS_APPCONTAINER", - "IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE", - "IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY", - "IMAGE_DLLCHARACTERISTICS_GUARD_CF", - "IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA", - "IMAGE_DLLCHARACTERISTICS_NO_BIND", - "IMAGE_DLLCHARACTERISTICS_NO_ISOLATION", - "IMAGE_DLLCHARACTERISTICS_NO_SEH", - "IMAGE_DLLCHARACTERISTICS_NX_COMPAT", - "IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE", - "IMAGE_DLLCHARACTERISTICS_WDM_DRIVER", - "IMAGE_FILE_32BIT_MACHINE", - "IMAGE_FILE_AGGRESIVE_WS_TRIM", - "IMAGE_FILE_BYTES_REVERSED_HI", - "IMAGE_FILE_BYTES_REVERSED_LO", - "IMAGE_FILE_DEBUG_STRIPPED", - "IMAGE_FILE_DLL", - "IMAGE_FILE_EXECUTABLE_IMAGE", - "IMAGE_FILE_LARGE_ADDRESS_AWARE", - "IMAGE_FILE_LINE_NUMS_STRIPPED", - "IMAGE_FILE_LOCAL_SYMS_STRIPPED", - "IMAGE_FILE_MACHINE_AM33", - "IMAGE_FILE_MACHINE_AMD64", - "IMAGE_FILE_MACHINE_ARM", - "IMAGE_FILE_MACHINE_ARM64", - "IMAGE_FILE_MACHINE_ARMNT", - "IMAGE_FILE_MACHINE_EBC", - "IMAGE_FILE_MACHINE_I386", - "IMAGE_FILE_MACHINE_IA64", - "IMAGE_FILE_MACHINE_LOONGARCH32", - "IMAGE_FILE_MACHINE_LOONGARCH64", - "IMAGE_FILE_MACHINE_M32R", - "IMAGE_FILE_MACHINE_MIPS16", - "IMAGE_FILE_MACHINE_MIPSFPU", - "IMAGE_FILE_MACHINE_MIPSFPU16", - "IMAGE_FILE_MACHINE_POWERPC", - "IMAGE_FILE_MACHINE_POWERPCFP", - "IMAGE_FILE_MACHINE_R4000", - "IMAGE_FILE_MACHINE_RISCV128", - "IMAGE_FILE_MACHINE_RISCV32", - "IMAGE_FILE_MACHINE_RISCV64", - "IMAGE_FILE_MACHINE_SH3", - "IMAGE_FILE_MACHINE_SH3DSP", - "IMAGE_FILE_MACHINE_SH4", - "IMAGE_FILE_MACHINE_SH5", - "IMAGE_FILE_MACHINE_THUMB", - "IMAGE_FILE_MACHINE_UNKNOWN", - "IMAGE_FILE_MACHINE_WCEMIPSV2", - "IMAGE_FILE_NET_RUN_FROM_SWAP", - "IMAGE_FILE_RELOCS_STRIPPED", - "IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP", - "IMAGE_FILE_SYSTEM", - "IMAGE_FILE_UP_SYSTEM_ONLY", - "IMAGE_SCN_CNT_CODE", - "IMAGE_SCN_CNT_INITIALIZED_DATA", - "IMAGE_SCN_CNT_UNINITIALIZED_DATA", - "IMAGE_SCN_LNK_COMDAT", - "IMAGE_SCN_MEM_DISCARDABLE", - "IMAGE_SCN_MEM_EXECUTE", - "IMAGE_SCN_MEM_READ", - "IMAGE_SCN_MEM_WRITE", - "IMAGE_SUBSYSTEM_EFI_APPLICATION", - "IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER", - "IMAGE_SUBSYSTEM_EFI_ROM", - "IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER", - "IMAGE_SUBSYSTEM_NATIVE", - "IMAGE_SUBSYSTEM_NATIVE_WINDOWS", - "IMAGE_SUBSYSTEM_OS2_CUI", - "IMAGE_SUBSYSTEM_POSIX_CUI", - "IMAGE_SUBSYSTEM_UNKNOWN", - "IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION", - "IMAGE_SUBSYSTEM_WINDOWS_CE_GUI", - "IMAGE_SUBSYSTEM_WINDOWS_CUI", - "IMAGE_SUBSYSTEM_WINDOWS_GUI", - "IMAGE_SUBSYSTEM_XBOX", - "ImportDirectory", - "NewFile", - "Open", - "OptionalHeader32", - "OptionalHeader64", - "Reloc", - "Section", - "SectionHeader", - "SectionHeader32", - "StringTable", - "Symbol", - }, - "debug/plan9obj": { - "ErrNoSymbols", - "File", - "FileHeader", - "Magic386", - "Magic64", - "MagicAMD64", - "MagicARM", - "NewFile", - "Open", - "Section", - "SectionHeader", - "Sym", - }, - "embed": { - "FS", - }, - "encoding": { - "BinaryMarshaler", - "BinaryUnmarshaler", - "TextMarshaler", - "TextUnmarshaler", - }, - "encoding/ascii85": { - "CorruptInputError", - "Decode", - "Encode", - "MaxEncodedLen", - "NewDecoder", - "NewEncoder", - }, - "encoding/asn1": { - "BitString", - "ClassApplication", - "ClassContextSpecific", - "ClassPrivate", - "ClassUniversal", - "Enumerated", - "Flag", - "Marshal", - "MarshalWithParams", - "NullBytes", - "NullRawValue", - "ObjectIdentifier", - "RawContent", - "RawValue", - "StructuralError", - "SyntaxError", - "TagBMPString", - "TagBitString", - "TagBoolean", - "TagEnum", - "TagGeneralString", - "TagGeneralizedTime", - "TagIA5String", - "TagInteger", - "TagNull", - "TagNumericString", - "TagOID", - "TagOctetString", - "TagPrintableString", - "TagSequence", - "TagSet", - "TagT61String", - "TagUTCTime", - "TagUTF8String", - "Unmarshal", - "UnmarshalWithParams", - }, - "encoding/base32": { - "CorruptInputError", - "Encoding", - "HexEncoding", - "NewDecoder", - "NewEncoder", - "NewEncoding", - "NoPadding", - "StdEncoding", - "StdPadding", - }, - "encoding/base64": { - "CorruptInputError", - "Encoding", - "NewDecoder", - "NewEncoder", - "NewEncoding", - "NoPadding", - "RawStdEncoding", - "RawURLEncoding", - "StdEncoding", - "StdPadding", - "URLEncoding", - }, - "encoding/binary": { - "AppendByteOrder", - "AppendUvarint", - "AppendVarint", - "BigEndian", - "ByteOrder", - "LittleEndian", - "MaxVarintLen16", - "MaxVarintLen32", - "MaxVarintLen64", - "PutUvarint", - "PutVarint", - "Read", - "ReadUvarint", - "ReadVarint", - "Size", - "Uvarint", - "Varint", - "Write", - }, - "encoding/csv": { - "ErrBareQuote", - "ErrFieldCount", - "ErrQuote", - "ErrTrailingComma", - "NewReader", - "NewWriter", - "ParseError", - "Reader", - "Writer", - }, - "encoding/gob": { - "CommonType", - "Decoder", - "Encoder", - "GobDecoder", - "GobEncoder", - "NewDecoder", - "NewEncoder", - "Register", - "RegisterName", - }, - "encoding/hex": { - "Decode", - "DecodeString", - "DecodedLen", - "Dump", - "Dumper", - "Encode", - "EncodeToString", - "EncodedLen", - "ErrLength", - "InvalidByteError", - "NewDecoder", - "NewEncoder", - }, - "encoding/json": { - "Compact", - "Decoder", - "Delim", - "Encoder", - "HTMLEscape", - "Indent", - "InvalidUTF8Error", - "InvalidUnmarshalError", - "Marshal", - "MarshalIndent", - "Marshaler", - "MarshalerError", - "NewDecoder", - "NewEncoder", - "Number", - "RawMessage", - "SyntaxError", - "Token", - "Unmarshal", - "UnmarshalFieldError", - "UnmarshalTypeError", - "Unmarshaler", - "UnsupportedTypeError", - "UnsupportedValueError", - "Valid", - }, - "encoding/pem": { - "Block", - "Decode", - "Encode", - "EncodeToMemory", - }, - "encoding/xml": { - "Attr", - "CharData", - "Comment", - "CopyToken", - "Decoder", - "Directive", - "Encoder", - "EndElement", - "Escape", - "EscapeText", - "HTMLAutoClose", - "HTMLEntity", - "Header", - "Marshal", - "MarshalIndent", - "Marshaler", - "MarshalerAttr", - "Name", - "NewDecoder", - "NewEncoder", - "NewTokenDecoder", - "ProcInst", - "StartElement", - "SyntaxError", - "TagPathError", - "Token", - "TokenReader", - "Unmarshal", - "UnmarshalError", - "Unmarshaler", - "UnmarshalerAttr", - "UnsupportedTypeError", - }, - "errors": { - "As", - "Is", - "Join", - "New", - "Unwrap", - }, - "expvar": { - "Do", - "Float", - "Func", - "Get", - "Handler", - "Int", - "KeyValue", - "Map", - "NewFloat", - "NewInt", - "NewMap", - "NewString", - "Publish", - "String", - "Var", - }, - "flag": { - "Arg", - "Args", - "Bool", - "BoolVar", - "CommandLine", - "ContinueOnError", - "Duration", - "DurationVar", - "ErrHelp", - "ErrorHandling", - "ExitOnError", - "Flag", - "FlagSet", - "Float64", - "Float64Var", - "Func", - "Getter", - "Int", - "Int64", - "Int64Var", - "IntVar", - "Lookup", - "NArg", - "NFlag", - "NewFlagSet", - "PanicOnError", - "Parse", - "Parsed", - "PrintDefaults", - "Set", - "String", - "StringVar", - "TextVar", - "Uint", - "Uint64", - "Uint64Var", - "UintVar", - "UnquoteUsage", - "Usage", - "Value", - "Var", - "Visit", - "VisitAll", - }, - "fmt": { - "Append", - "Appendf", - "Appendln", - "Errorf", - "FormatString", - "Formatter", - "Fprint", - "Fprintf", - "Fprintln", - "Fscan", - "Fscanf", - "Fscanln", - "GoStringer", - "Print", - "Printf", - "Println", - "Scan", - "ScanState", - "Scanf", - "Scanln", - "Scanner", - "Sprint", - "Sprintf", - "Sprintln", - "Sscan", - "Sscanf", - "Sscanln", - "State", - "Stringer", - }, - "go/ast": { - "ArrayType", - "AssignStmt", - "Bad", - "BadDecl", - "BadExpr", - "BadStmt", - "BasicLit", - "BinaryExpr", - "BlockStmt", - "BranchStmt", - "CallExpr", - "CaseClause", - "ChanDir", - "ChanType", - "CommClause", - "Comment", - "CommentGroup", - "CommentMap", - "CompositeLit", - "Con", - "Decl", - "DeclStmt", - "DeferStmt", - "Ellipsis", - "EmptyStmt", - "Expr", - "ExprStmt", - "Field", - "FieldFilter", - "FieldList", - "File", - "FileExports", - "Filter", - "FilterDecl", - "FilterFile", - "FilterFuncDuplicates", - "FilterImportDuplicates", - "FilterPackage", - "FilterUnassociatedComments", - "ForStmt", - "Fprint", - "Fun", - "FuncDecl", - "FuncLit", - "FuncType", - "GenDecl", - "GoStmt", - "Ident", - "IfStmt", - "ImportSpec", - "Importer", - "IncDecStmt", - "IndexExpr", - "IndexListExpr", - "Inspect", - "InterfaceType", - "IsExported", - "KeyValueExpr", - "LabeledStmt", - "Lbl", - "MapType", - "MergeMode", - "MergePackageFiles", - "NewCommentMap", - "NewIdent", - "NewObj", - "NewPackage", - "NewScope", - "Node", - "NotNilFilter", - "ObjKind", - "Object", - "Package", - "PackageExports", - "ParenExpr", - "Pkg", - "Print", - "RECV", - "RangeStmt", - "ReturnStmt", - "SEND", - "Scope", - "SelectStmt", - "SelectorExpr", - "SendStmt", - "SliceExpr", - "SortImports", - "Spec", - "StarExpr", - "Stmt", - "StructType", - "SwitchStmt", - "Typ", - "TypeAssertExpr", - "TypeSpec", - "TypeSwitchStmt", - "UnaryExpr", - "ValueSpec", - "Var", - "Visitor", - "Walk", - }, - "go/build": { - "AllowBinary", - "ArchChar", - "Context", - "Default", - "FindOnly", - "IgnoreVendor", - "Import", - "ImportComment", - "ImportDir", - "ImportMode", - "IsLocalImport", - "MultiplePackageError", - "NoGoError", - "Package", - "ToolDir", - }, - "go/build/constraint": { - "AndExpr", - "Expr", - "IsGoBuild", - "IsPlusBuild", - "NotExpr", - "OrExpr", - "Parse", - "PlusBuildLines", - "SyntaxError", - "TagExpr", - }, - "go/constant": { - "BinaryOp", - "BitLen", - "Bool", - "BoolVal", - "Bytes", - "Compare", - "Complex", - "Denom", - "Float", - "Float32Val", - "Float64Val", - "Imag", - "Int", - "Int64Val", - "Kind", - "Make", - "MakeBool", - "MakeFloat64", - "MakeFromBytes", - "MakeFromLiteral", - "MakeImag", - "MakeInt64", - "MakeString", - "MakeUint64", - "MakeUnknown", - "Num", - "Real", - "Shift", - "Sign", - "String", - "StringVal", - "ToComplex", - "ToFloat", - "ToInt", - "Uint64Val", - "UnaryOp", - "Unknown", - "Val", - "Value", - }, - "go/doc": { - "AllDecls", - "AllMethods", - "Example", - "Examples", - "Filter", - "Func", - "IllegalPrefixes", - "IsPredeclared", - "Mode", - "New", - "NewFromFiles", - "Note", - "Package", - "PreserveAST", - "Synopsis", - "ToHTML", - "ToText", - "Type", - "Value", - }, - "go/doc/comment": { - "Block", - "Code", - "DefaultLookupPackage", - "Doc", - "DocLink", - "Heading", - "Italic", - "Link", - "LinkDef", - "List", - "ListItem", - "Paragraph", - "Parser", - "Plain", - "Printer", - "Text", - }, - "go/format": { - "Node", - "Source", - }, - "go/importer": { - "Default", - "For", - "ForCompiler", - "Lookup", - }, - "go/parser": { - "AllErrors", - "DeclarationErrors", - "ImportsOnly", - "Mode", - "PackageClauseOnly", - "ParseComments", - "ParseDir", - "ParseExpr", - "ParseExprFrom", - "ParseFile", - "SkipObjectResolution", - "SpuriousErrors", - "Trace", - }, - "go/printer": { - "CommentedNode", - "Config", - "Fprint", - "Mode", - "RawFormat", - "SourcePos", - "TabIndent", - "UseSpaces", - }, - "go/scanner": { - "Error", - "ErrorHandler", - "ErrorList", - "Mode", - "PrintError", - "ScanComments", - "Scanner", - }, - "go/token": { - "ADD", - "ADD_ASSIGN", - "AND", - "AND_ASSIGN", - "AND_NOT", - "AND_NOT_ASSIGN", - "ARROW", - "ASSIGN", - "BREAK", - "CASE", - "CHAN", - "CHAR", - "COLON", - "COMMA", - "COMMENT", - "CONST", - "CONTINUE", - "DEC", - "DEFAULT", - "DEFER", - "DEFINE", - "ELLIPSIS", - "ELSE", - "EOF", - "EQL", - "FALLTHROUGH", - "FLOAT", - "FOR", - "FUNC", - "File", - "FileSet", - "GEQ", - "GO", - "GOTO", - "GTR", - "HighestPrec", - "IDENT", - "IF", - "ILLEGAL", - "IMAG", - "IMPORT", - "INC", - "INT", - "INTERFACE", - "IsExported", - "IsIdentifier", - "IsKeyword", - "LAND", - "LBRACE", - "LBRACK", - "LEQ", - "LOR", - "LPAREN", - "LSS", - "Lookup", - "LowestPrec", - "MAP", - "MUL", - "MUL_ASSIGN", - "NEQ", - "NOT", - "NewFileSet", - "NoPos", - "OR", - "OR_ASSIGN", - "PACKAGE", - "PERIOD", - "Pos", - "Position", - "QUO", - "QUO_ASSIGN", - "RANGE", - "RBRACE", - "RBRACK", - "REM", - "REM_ASSIGN", - "RETURN", - "RPAREN", - "SELECT", - "SEMICOLON", - "SHL", - "SHL_ASSIGN", - "SHR", - "SHR_ASSIGN", - "STRING", - "STRUCT", - "SUB", - "SUB_ASSIGN", - "SWITCH", - "TILDE", - "TYPE", - "Token", - "UnaryPrec", - "VAR", - "XOR", - "XOR_ASSIGN", - }, - "go/types": { - "ArgumentError", - "Array", - "AssertableTo", - "AssignableTo", - "Basic", - "BasicInfo", - "BasicKind", - "Bool", - "Builtin", - "Byte", - "Chan", - "ChanDir", - "CheckExpr", - "Checker", - "Comparable", - "Complex128", - "Complex64", - "Config", - "Const", - "Context", - "ConvertibleTo", - "DefPredeclaredTestFuncs", - "Default", - "Error", - "Eval", - "ExprString", - "FieldVal", - "Float32", - "Float64", - "Func", - "Id", - "Identical", - "IdenticalIgnoreTags", - "Implements", - "ImportMode", - "Importer", - "ImporterFrom", - "Info", - "Initializer", - "Instance", - "Instantiate", - "Int", - "Int16", - "Int32", - "Int64", - "Int8", - "Interface", - "Invalid", - "IsBoolean", - "IsComplex", - "IsConstType", - "IsFloat", - "IsInteger", - "IsInterface", - "IsNumeric", - "IsOrdered", - "IsString", - "IsUnsigned", - "IsUntyped", - "Label", - "LookupFieldOrMethod", - "Map", - "MethodExpr", - "MethodSet", - "MethodVal", - "MissingMethod", - "Named", - "NewArray", - "NewChan", - "NewChecker", - "NewConst", - "NewContext", - "NewField", - "NewFunc", - "NewInterface", - "NewInterfaceType", - "NewLabel", - "NewMap", - "NewMethodSet", - "NewNamed", - "NewPackage", - "NewParam", - "NewPkgName", - "NewPointer", - "NewScope", - "NewSignature", - "NewSignatureType", - "NewSlice", - "NewStruct", - "NewTerm", - "NewTuple", - "NewTypeName", - "NewTypeParam", - "NewUnion", - "NewVar", - "Nil", - "Object", - "ObjectString", - "Package", - "PkgName", - "Pointer", - "Qualifier", - "RecvOnly", - "RelativeTo", - "Rune", - "Satisfies", - "Scope", - "Selection", - "SelectionKind", - "SelectionString", - "SendOnly", - "SendRecv", - "Signature", - "Sizes", - "SizesFor", - "Slice", - "StdSizes", - "String", - "Struct", - "Term", - "Tuple", - "Typ", - "Type", - "TypeAndValue", - "TypeList", - "TypeName", - "TypeParam", - "TypeParamList", - "TypeString", - "Uint", - "Uint16", - "Uint32", - "Uint64", - "Uint8", - "Uintptr", - "Union", - "Universe", - "Unsafe", - "UnsafePointer", - "UntypedBool", - "UntypedComplex", - "UntypedFloat", - "UntypedInt", - "UntypedNil", - "UntypedRune", - "UntypedString", - "Var", - "WriteExpr", - "WriteSignature", - "WriteType", - }, - "hash": { - "Hash", - "Hash32", - "Hash64", - }, - "hash/adler32": { - "Checksum", - "New", - "Size", - }, - "hash/crc32": { - "Castagnoli", - "Checksum", - "ChecksumIEEE", - "IEEE", - "IEEETable", - "Koopman", - "MakeTable", - "New", - "NewIEEE", - "Size", - "Table", - "Update", - }, - "hash/crc64": { - "Checksum", - "ECMA", - "ISO", - "MakeTable", - "New", - "Size", - "Table", - "Update", - }, - "hash/fnv": { - "New128", - "New128a", - "New32", - "New32a", - "New64", - "New64a", - }, - "hash/maphash": { - "Bytes", - "Hash", - "MakeSeed", - "Seed", - "String", - }, - "html": { - "EscapeString", - "UnescapeString", - }, - "html/template": { - "CSS", - "ErrAmbigContext", - "ErrBadHTML", - "ErrBranchEnd", - "ErrEndContext", - "ErrNoSuchTemplate", - "ErrOutputContext", - "ErrPartialCharset", - "ErrPartialEscape", - "ErrPredefinedEscaper", - "ErrRangeLoopReentry", - "ErrSlashAmbig", - "Error", - "ErrorCode", - "FuncMap", - "HTML", - "HTMLAttr", - "HTMLEscape", - "HTMLEscapeString", - "HTMLEscaper", - "IsTrue", - "JS", - "JSEscape", - "JSEscapeString", - "JSEscaper", - "JSStr", - "Must", - "New", - "OK", - "ParseFS", - "ParseFiles", - "ParseGlob", - "Srcset", - "Template", - "URL", - "URLQueryEscaper", - }, - "image": { - "Alpha", - "Alpha16", - "Black", - "CMYK", - "Config", - "Decode", - "DecodeConfig", - "ErrFormat", - "Gray", - "Gray16", - "Image", - "NRGBA", - "NRGBA64", - "NYCbCrA", - "NewAlpha", - "NewAlpha16", - "NewCMYK", - "NewGray", - "NewGray16", - "NewNRGBA", - "NewNRGBA64", - "NewNYCbCrA", - "NewPaletted", - "NewRGBA", - "NewRGBA64", - "NewUniform", - "NewYCbCr", - "Opaque", - "Paletted", - "PalettedImage", - "Point", - "Pt", - "RGBA", - "RGBA64", - "RGBA64Image", - "Rect", - "Rectangle", - "RegisterFormat", - "Transparent", - "Uniform", - "White", - "YCbCr", - "YCbCrSubsampleRatio", - "YCbCrSubsampleRatio410", - "YCbCrSubsampleRatio411", - "YCbCrSubsampleRatio420", - "YCbCrSubsampleRatio422", - "YCbCrSubsampleRatio440", - "YCbCrSubsampleRatio444", - "ZP", - "ZR", - }, - "image/color": { - "Alpha", - "Alpha16", - "Alpha16Model", - "AlphaModel", - "Black", - "CMYK", - "CMYKModel", - "CMYKToRGB", - "Color", - "Gray", - "Gray16", - "Gray16Model", - "GrayModel", - "Model", - "ModelFunc", - "NRGBA", - "NRGBA64", - "NRGBA64Model", - "NRGBAModel", - "NYCbCrA", - "NYCbCrAModel", - "Opaque", - "Palette", - "RGBA", - "RGBA64", - "RGBA64Model", - "RGBAModel", - "RGBToCMYK", - "RGBToYCbCr", - "Transparent", - "White", - "YCbCr", - "YCbCrModel", - "YCbCrToRGB", - }, - "image/color/palette": { - "Plan9", - "WebSafe", - }, - "image/draw": { - "Draw", - "DrawMask", - "Drawer", - "FloydSteinberg", - "Image", - "Op", - "Over", - "Quantizer", - "RGBA64Image", - "Src", - }, - "image/gif": { - "Decode", - "DecodeAll", - "DecodeConfig", - "DisposalBackground", - "DisposalNone", - "DisposalPrevious", - "Encode", - "EncodeAll", - "GIF", - "Options", - }, - "image/jpeg": { - "Decode", - "DecodeConfig", - "DefaultQuality", - "Encode", - "FormatError", - "Options", - "Reader", - "UnsupportedError", - }, - "image/png": { - "BestCompression", - "BestSpeed", - "CompressionLevel", - "Decode", - "DecodeConfig", - "DefaultCompression", - "Encode", - "Encoder", - "EncoderBuffer", - "EncoderBufferPool", - "FormatError", - "NoCompression", - "UnsupportedError", - }, - "index/suffixarray": { - "Index", - "New", - }, - "io": { - "ByteReader", - "ByteScanner", - "ByteWriter", - "Closer", - "Copy", - "CopyBuffer", - "CopyN", - "Discard", - "EOF", - "ErrClosedPipe", - "ErrNoProgress", - "ErrShortBuffer", - "ErrShortWrite", - "ErrUnexpectedEOF", - "LimitReader", - "LimitedReader", - "MultiReader", - "MultiWriter", - "NewOffsetWriter", - "NewSectionReader", - "NopCloser", - "OffsetWriter", - "Pipe", - "PipeReader", - "PipeWriter", - "ReadAll", - "ReadAtLeast", - "ReadCloser", - "ReadFull", - "ReadSeekCloser", - "ReadSeeker", - "ReadWriteCloser", - "ReadWriteSeeker", - "ReadWriter", - "Reader", - "ReaderAt", - "ReaderFrom", - "RuneReader", - "RuneScanner", - "SectionReader", - "SeekCurrent", - "SeekEnd", - "SeekStart", - "Seeker", - "StringWriter", - "TeeReader", - "WriteCloser", - "WriteSeeker", - "WriteString", - "Writer", - "WriterAt", - "WriterTo", - }, - "io/fs": { - "DirEntry", - "ErrClosed", - "ErrExist", - "ErrInvalid", - "ErrNotExist", - "ErrPermission", - "FS", - "File", - "FileInfo", - "FileInfoToDirEntry", - "FileMode", - "Glob", - "GlobFS", - "ModeAppend", - "ModeCharDevice", - "ModeDevice", - "ModeDir", - "ModeExclusive", - "ModeIrregular", - "ModeNamedPipe", - "ModePerm", - "ModeSetgid", - "ModeSetuid", - "ModeSocket", - "ModeSticky", - "ModeSymlink", - "ModeTemporary", - "ModeType", - "PathError", - "ReadDir", - "ReadDirFS", - "ReadDirFile", - "ReadFile", - "ReadFileFS", - "SkipAll", - "SkipDir", - "Stat", - "StatFS", - "Sub", - "SubFS", - "ValidPath", - "WalkDir", - "WalkDirFunc", - }, - "io/ioutil": { - "Discard", - "NopCloser", - "ReadAll", - "ReadDir", - "ReadFile", - "TempDir", - "TempFile", - "WriteFile", - }, - "log": { - "Default", - "Fatal", - "Fatalf", - "Fatalln", - "Flags", - "LUTC", - "Ldate", - "Llongfile", - "Lmicroseconds", - "Lmsgprefix", - "Logger", - "Lshortfile", - "LstdFlags", - "Ltime", - "New", - "Output", - "Panic", - "Panicf", - "Panicln", - "Prefix", - "Print", - "Printf", - "Println", - "SetFlags", - "SetOutput", - "SetPrefix", - "Writer", - }, - "log/syslog": { - "Dial", - "LOG_ALERT", - "LOG_AUTH", - "LOG_AUTHPRIV", - "LOG_CRIT", - "LOG_CRON", - "LOG_DAEMON", - "LOG_DEBUG", - "LOG_EMERG", - "LOG_ERR", - "LOG_FTP", - "LOG_INFO", - "LOG_KERN", - "LOG_LOCAL0", - "LOG_LOCAL1", - "LOG_LOCAL2", - "LOG_LOCAL3", - "LOG_LOCAL4", - "LOG_LOCAL5", - "LOG_LOCAL6", - "LOG_LOCAL7", - "LOG_LPR", - "LOG_MAIL", - "LOG_NEWS", - "LOG_NOTICE", - "LOG_SYSLOG", - "LOG_USER", - "LOG_UUCP", - "LOG_WARNING", - "New", - "NewLogger", - "Priority", - "Writer", - }, - "math": { - "Abs", - "Acos", - "Acosh", - "Asin", - "Asinh", - "Atan", - "Atan2", - "Atanh", - "Cbrt", - "Ceil", - "Copysign", - "Cos", - "Cosh", - "Dim", - "E", - "Erf", - "Erfc", - "Erfcinv", - "Erfinv", - "Exp", - "Exp2", - "Expm1", - "FMA", - "Float32bits", - "Float32frombits", - "Float64bits", - "Float64frombits", - "Floor", - "Frexp", - "Gamma", - "Hypot", - "Ilogb", - "Inf", - "IsInf", - "IsNaN", - "J0", - "J1", - "Jn", - "Ldexp", - "Lgamma", - "Ln10", - "Ln2", - "Log", - "Log10", - "Log10E", - "Log1p", - "Log2", - "Log2E", - "Logb", - "Max", - "MaxFloat32", - "MaxFloat64", - "MaxInt", - "MaxInt16", - "MaxInt32", - "MaxInt64", - "MaxInt8", - "MaxUint", - "MaxUint16", - "MaxUint32", - "MaxUint64", - "MaxUint8", - "Min", - "MinInt", - "MinInt16", - "MinInt32", - "MinInt64", - "MinInt8", - "Mod", - "Modf", - "NaN", - "Nextafter", - "Nextafter32", - "Phi", - "Pi", - "Pow", - "Pow10", - "Remainder", - "Round", - "RoundToEven", - "Signbit", - "Sin", - "Sincos", - "Sinh", - "SmallestNonzeroFloat32", - "SmallestNonzeroFloat64", - "Sqrt", - "Sqrt2", - "SqrtE", - "SqrtPhi", - "SqrtPi", - "Tan", - "Tanh", - "Trunc", - "Y0", - "Y1", - "Yn", - }, - "math/big": { - "Above", - "Accuracy", - "AwayFromZero", - "Below", - "ErrNaN", - "Exact", - "Float", - "Int", - "Jacobi", - "MaxBase", - "MaxExp", - "MaxPrec", - "MinExp", - "NewFloat", - "NewInt", - "NewRat", - "ParseFloat", - "Rat", - "RoundingMode", - "ToNearestAway", - "ToNearestEven", - "ToNegativeInf", - "ToPositiveInf", - "ToZero", - "Word", - }, - "math/bits": { - "Add", - "Add32", - "Add64", - "Div", - "Div32", - "Div64", - "LeadingZeros", - "LeadingZeros16", - "LeadingZeros32", - "LeadingZeros64", - "LeadingZeros8", - "Len", - "Len16", - "Len32", - "Len64", - "Len8", - "Mul", - "Mul32", - "Mul64", - "OnesCount", - "OnesCount16", - "OnesCount32", - "OnesCount64", - "OnesCount8", - "Rem", - "Rem32", - "Rem64", - "Reverse", - "Reverse16", - "Reverse32", - "Reverse64", - "Reverse8", - "ReverseBytes", - "ReverseBytes16", - "ReverseBytes32", - "ReverseBytes64", - "RotateLeft", - "RotateLeft16", - "RotateLeft32", - "RotateLeft64", - "RotateLeft8", - "Sub", - "Sub32", - "Sub64", - "TrailingZeros", - "TrailingZeros16", - "TrailingZeros32", - "TrailingZeros64", - "TrailingZeros8", - "UintSize", - }, - "math/cmplx": { - "Abs", - "Acos", - "Acosh", - "Asin", - "Asinh", - "Atan", - "Atanh", - "Conj", - "Cos", - "Cosh", - "Cot", - "Exp", - "Inf", - "IsInf", - "IsNaN", - "Log", - "Log10", - "NaN", - "Phase", - "Polar", - "Pow", - "Rect", - "Sin", - "Sinh", - "Sqrt", - "Tan", - "Tanh", - }, - "math/rand": { - "ExpFloat64", - "Float32", - "Float64", - "Int", - "Int31", - "Int31n", - "Int63", - "Int63n", - "Intn", - "New", - "NewSource", - "NewZipf", - "NormFloat64", - "Perm", - "Rand", - "Read", - "Seed", - "Shuffle", - "Source", - "Source64", - "Uint32", - "Uint64", - "Zipf", - }, - "mime": { - "AddExtensionType", - "BEncoding", - "ErrInvalidMediaParameter", - "ExtensionsByType", - "FormatMediaType", - "ParseMediaType", - "QEncoding", - "TypeByExtension", - "WordDecoder", - "WordEncoder", - }, - "mime/multipart": { - "ErrMessageTooLarge", - "File", - "FileHeader", - "Form", - "NewReader", - "NewWriter", - "Part", - "Reader", - "Writer", - }, - "mime/quotedprintable": { - "NewReader", - "NewWriter", - "Reader", - "Writer", - }, - "net": { - "Addr", - "AddrError", - "Buffers", - "CIDRMask", - "Conn", - "DNSConfigError", - "DNSError", - "DefaultResolver", - "Dial", - "DialIP", - "DialTCP", - "DialTimeout", - "DialUDP", - "DialUnix", - "Dialer", - "ErrClosed", - "ErrWriteToConnected", - "Error", - "FileConn", - "FileListener", - "FilePacketConn", - "FlagBroadcast", - "FlagLoopback", - "FlagMulticast", - "FlagPointToPoint", - "FlagRunning", - "FlagUp", - "Flags", - "HardwareAddr", - "IP", - "IPAddr", - "IPConn", - "IPMask", - "IPNet", - "IPv4", - "IPv4Mask", - "IPv4allrouter", - "IPv4allsys", - "IPv4bcast", - "IPv4len", - "IPv4zero", - "IPv6interfacelocalallnodes", - "IPv6len", - "IPv6linklocalallnodes", - "IPv6linklocalallrouters", - "IPv6loopback", - "IPv6unspecified", - "IPv6zero", - "Interface", - "InterfaceAddrs", - "InterfaceByIndex", - "InterfaceByName", - "Interfaces", - "InvalidAddrError", - "JoinHostPort", - "Listen", - "ListenConfig", - "ListenIP", - "ListenMulticastUDP", - "ListenPacket", - "ListenTCP", - "ListenUDP", - "ListenUnix", - "ListenUnixgram", - "Listener", - "LookupAddr", - "LookupCNAME", - "LookupHost", - "LookupIP", - "LookupMX", - "LookupNS", - "LookupPort", - "LookupSRV", - "LookupTXT", - "MX", - "NS", - "OpError", - "PacketConn", - "ParseCIDR", - "ParseError", - "ParseIP", - "ParseMAC", - "Pipe", - "ResolveIPAddr", - "ResolveTCPAddr", - "ResolveUDPAddr", - "ResolveUnixAddr", - "Resolver", - "SRV", - "SplitHostPort", - "TCPAddr", - "TCPAddrFromAddrPort", - "TCPConn", - "TCPListener", - "UDPAddr", - "UDPAddrFromAddrPort", - "UDPConn", - "UnixAddr", - "UnixConn", - "UnixListener", - "UnknownNetworkError", - }, - "net/http": { - "AllowQuerySemicolons", - "CanonicalHeaderKey", - "Client", - "CloseNotifier", - "ConnState", - "Cookie", - "CookieJar", - "DefaultClient", - "DefaultMaxHeaderBytes", - "DefaultMaxIdleConnsPerHost", - "DefaultServeMux", - "DefaultTransport", - "DetectContentType", - "Dir", - "ErrAbortHandler", - "ErrBodyNotAllowed", - "ErrBodyReadAfterClose", - "ErrContentLength", - "ErrHandlerTimeout", - "ErrHeaderTooLong", - "ErrHijacked", - "ErrLineTooLong", - "ErrMissingBoundary", - "ErrMissingContentLength", - "ErrMissingFile", - "ErrNoCookie", - "ErrNoLocation", - "ErrNotMultipart", - "ErrNotSupported", - "ErrServerClosed", - "ErrShortBody", - "ErrSkipAltProtocol", - "ErrUnexpectedTrailer", - "ErrUseLastResponse", - "ErrWriteAfterFlush", - "Error", - "FS", - "File", - "FileServer", - "FileSystem", - "Flusher", - "Get", - "Handle", - "HandleFunc", - "Handler", - "HandlerFunc", - "Head", - "Header", - "Hijacker", - "ListenAndServe", - "ListenAndServeTLS", - "LocalAddrContextKey", - "MaxBytesError", - "MaxBytesHandler", - "MaxBytesReader", - "MethodConnect", - "MethodDelete", - "MethodGet", - "MethodHead", - "MethodOptions", - "MethodPatch", - "MethodPost", - "MethodPut", - "MethodTrace", - "NewFileTransport", - "NewRequest", - "NewRequestWithContext", - "NewResponseController", - "NewServeMux", - "NoBody", - "NotFound", - "NotFoundHandler", - "ParseHTTPVersion", - "ParseTime", - "Post", - "PostForm", - "ProtocolError", - "ProxyFromEnvironment", - "ProxyURL", - "PushOptions", - "Pusher", - "ReadRequest", - "ReadResponse", - "Redirect", - "RedirectHandler", - "Request", - "Response", - "ResponseController", - "ResponseWriter", - "RoundTripper", - "SameSite", - "SameSiteDefaultMode", - "SameSiteLaxMode", - "SameSiteNoneMode", - "SameSiteStrictMode", - "Serve", - "ServeContent", - "ServeFile", - "ServeMux", - "ServeTLS", - "Server", - "ServerContextKey", - "SetCookie", - "StateActive", - "StateClosed", - "StateHijacked", - "StateIdle", - "StateNew", - "StatusAccepted", - "StatusAlreadyReported", - "StatusBadGateway", - "StatusBadRequest", - "StatusConflict", - "StatusContinue", - "StatusCreated", - "StatusEarlyHints", - "StatusExpectationFailed", - "StatusFailedDependency", - "StatusForbidden", - "StatusFound", - "StatusGatewayTimeout", - "StatusGone", - "StatusHTTPVersionNotSupported", - "StatusIMUsed", - "StatusInsufficientStorage", - "StatusInternalServerError", - "StatusLengthRequired", - "StatusLocked", - "StatusLoopDetected", - "StatusMethodNotAllowed", - "StatusMisdirectedRequest", - "StatusMovedPermanently", - "StatusMultiStatus", - "StatusMultipleChoices", - "StatusNetworkAuthenticationRequired", - "StatusNoContent", - "StatusNonAuthoritativeInfo", - "StatusNotAcceptable", - "StatusNotExtended", - "StatusNotFound", - "StatusNotImplemented", - "StatusNotModified", - "StatusOK", - "StatusPartialContent", - "StatusPaymentRequired", - "StatusPermanentRedirect", - "StatusPreconditionFailed", - "StatusPreconditionRequired", - "StatusProcessing", - "StatusProxyAuthRequired", - "StatusRequestEntityTooLarge", - "StatusRequestHeaderFieldsTooLarge", - "StatusRequestTimeout", - "StatusRequestURITooLong", - "StatusRequestedRangeNotSatisfiable", - "StatusResetContent", - "StatusSeeOther", - "StatusServiceUnavailable", - "StatusSwitchingProtocols", - "StatusTeapot", - "StatusTemporaryRedirect", - "StatusText", - "StatusTooEarly", - "StatusTooManyRequests", - "StatusUnauthorized", - "StatusUnavailableForLegalReasons", - "StatusUnprocessableEntity", - "StatusUnsupportedMediaType", - "StatusUpgradeRequired", - "StatusUseProxy", - "StatusVariantAlsoNegotiates", - "StripPrefix", - "TimeFormat", - "TimeoutHandler", - "TrailerPrefix", - "Transport", - }, - "net/http/cgi": { - "Handler", - "Request", - "RequestFromMap", - "Serve", - }, - "net/http/cookiejar": { - "Jar", - "New", - "Options", - "PublicSuffixList", - }, - "net/http/fcgi": { - "ErrConnClosed", - "ErrRequestAborted", - "ProcessEnv", - "Serve", - }, - "net/http/httptest": { - "DefaultRemoteAddr", - "NewRecorder", - "NewRequest", - "NewServer", - "NewTLSServer", - "NewUnstartedServer", - "ResponseRecorder", - "Server", - }, - "net/http/httptrace": { - "ClientTrace", - "ContextClientTrace", - "DNSDoneInfo", - "DNSStartInfo", - "GotConnInfo", - "WithClientTrace", - "WroteRequestInfo", - }, - "net/http/httputil": { - "BufferPool", - "ClientConn", - "DumpRequest", - "DumpRequestOut", - "DumpResponse", - "ErrClosed", - "ErrLineTooLong", - "ErrPersistEOF", - "ErrPipeline", - "NewChunkedReader", - "NewChunkedWriter", - "NewClientConn", - "NewProxyClientConn", - "NewServerConn", - "NewSingleHostReverseProxy", - "ProxyRequest", - "ReverseProxy", - "ServerConn", - }, - "net/http/pprof": { - "Cmdline", - "Handler", - "Index", - "Profile", - "Symbol", - "Trace", - }, - "net/mail": { - "Address", - "AddressParser", - "ErrHeaderNotPresent", - "Header", - "Message", - "ParseAddress", - "ParseAddressList", - "ParseDate", - "ReadMessage", - }, - "net/netip": { - "Addr", - "AddrFrom16", - "AddrFrom4", - "AddrFromSlice", - "AddrPort", - "AddrPortFrom", - "IPv4Unspecified", - "IPv6LinkLocalAllNodes", - "IPv6LinkLocalAllRouters", - "IPv6Loopback", - "IPv6Unspecified", - "MustParseAddr", - "MustParseAddrPort", - "MustParsePrefix", - "ParseAddr", - "ParseAddrPort", - "ParsePrefix", - "Prefix", - "PrefixFrom", - }, - "net/rpc": { - "Accept", - "Call", - "Client", - "ClientCodec", - "DefaultDebugPath", - "DefaultRPCPath", - "DefaultServer", - "Dial", - "DialHTTP", - "DialHTTPPath", - "ErrShutdown", - "HandleHTTP", - "NewClient", - "NewClientWithCodec", - "NewServer", - "Register", - "RegisterName", - "Request", - "Response", - "ServeCodec", - "ServeConn", - "ServeRequest", - "Server", - "ServerCodec", - "ServerError", - }, - "net/rpc/jsonrpc": { - "Dial", - "NewClient", - "NewClientCodec", - "NewServerCodec", - "ServeConn", - }, - "net/smtp": { - "Auth", - "CRAMMD5Auth", - "Client", - "Dial", - "NewClient", - "PlainAuth", - "SendMail", - "ServerInfo", - }, - "net/textproto": { - "CanonicalMIMEHeaderKey", - "Conn", - "Dial", - "Error", - "MIMEHeader", - "NewConn", - "NewReader", - "NewWriter", - "Pipeline", - "ProtocolError", - "Reader", - "TrimBytes", - "TrimString", - "Writer", - }, - "net/url": { - "Error", - "EscapeError", - "InvalidHostError", - "JoinPath", - "Parse", - "ParseQuery", - "ParseRequestURI", - "PathEscape", - "PathUnescape", - "QueryEscape", - "QueryUnescape", - "URL", - "User", - "UserPassword", - "Userinfo", - "Values", - }, - "os": { - "Args", - "Chdir", - "Chmod", - "Chown", - "Chtimes", - "Clearenv", - "Create", - "CreateTemp", - "DevNull", - "DirEntry", - "DirFS", - "Environ", - "ErrClosed", - "ErrDeadlineExceeded", - "ErrExist", - "ErrInvalid", - "ErrNoDeadline", - "ErrNotExist", - "ErrPermission", - "ErrProcessDone", - "Executable", - "Exit", - "Expand", - "ExpandEnv", - "File", - "FileInfo", - "FileMode", - "FindProcess", - "Getegid", - "Getenv", - "Geteuid", - "Getgid", - "Getgroups", - "Getpagesize", - "Getpid", - "Getppid", - "Getuid", - "Getwd", - "Hostname", - "Interrupt", - "IsExist", - "IsNotExist", - "IsPathSeparator", - "IsPermission", - "IsTimeout", - "Kill", - "Lchown", - "Link", - "LinkError", - "LookupEnv", - "Lstat", - "Mkdir", - "MkdirAll", - "MkdirTemp", - "ModeAppend", - "ModeCharDevice", - "ModeDevice", - "ModeDir", - "ModeExclusive", - "ModeIrregular", - "ModeNamedPipe", - "ModePerm", - "ModeSetgid", - "ModeSetuid", - "ModeSocket", - "ModeSticky", - "ModeSymlink", - "ModeTemporary", - "ModeType", - "NewFile", - "NewSyscallError", - "O_APPEND", - "O_CREATE", - "O_EXCL", - "O_RDONLY", - "O_RDWR", - "O_SYNC", - "O_TRUNC", - "O_WRONLY", - "Open", - "OpenFile", - "PathError", - "PathListSeparator", - "PathSeparator", - "Pipe", - "ProcAttr", - "Process", - "ProcessState", - "ReadDir", - "ReadFile", - "Readlink", - "Remove", - "RemoveAll", - "Rename", - "SEEK_CUR", - "SEEK_END", - "SEEK_SET", - "SameFile", - "Setenv", - "Signal", - "StartProcess", - "Stat", - "Stderr", - "Stdin", - "Stdout", - "Symlink", - "SyscallError", - "TempDir", - "Truncate", - "Unsetenv", - "UserCacheDir", - "UserConfigDir", - "UserHomeDir", - "WriteFile", - }, - "os/exec": { - "Cmd", - "Command", - "CommandContext", - "ErrDot", - "ErrNotFound", - "ErrWaitDelay", - "Error", - "ExitError", - "LookPath", - }, - "os/signal": { - "Ignore", - "Ignored", - "Notify", - "NotifyContext", - "Reset", - "Stop", - }, - "os/user": { - "Current", - "Group", - "Lookup", - "LookupGroup", - "LookupGroupId", - "LookupId", - "UnknownGroupError", - "UnknownGroupIdError", - "UnknownUserError", - "UnknownUserIdError", - "User", - }, - "path": { - "Base", - "Clean", - "Dir", - "ErrBadPattern", - "Ext", - "IsAbs", - "Join", - "Match", - "Split", - }, - "path/filepath": { - "Abs", - "Base", - "Clean", - "Dir", - "ErrBadPattern", - "EvalSymlinks", - "Ext", - "FromSlash", - "Glob", - "HasPrefix", - "IsAbs", - "IsLocal", - "Join", - "ListSeparator", - "Match", - "Rel", - "Separator", - "SkipAll", - "SkipDir", - "Split", - "SplitList", - "ToSlash", - "VolumeName", - "Walk", - "WalkDir", - "WalkFunc", - }, - "plugin": { - "Open", - "Plugin", - "Symbol", - }, - "reflect": { - "Append", - "AppendSlice", - "Array", - "ArrayOf", - "Bool", - "BothDir", - "Chan", - "ChanDir", - "ChanOf", - "Complex128", - "Complex64", - "Copy", - "DeepEqual", - "Float32", - "Float64", - "Func", - "FuncOf", - "Indirect", - "Int", - "Int16", - "Int32", - "Int64", - "Int8", - "Interface", - "Invalid", - "Kind", - "MakeChan", - "MakeFunc", - "MakeMap", - "MakeMapWithSize", - "MakeSlice", - "Map", - "MapIter", - "MapOf", - "Method", - "New", - "NewAt", - "Pointer", - "PointerTo", - "Ptr", - "PtrTo", - "RecvDir", - "Select", - "SelectCase", - "SelectDefault", - "SelectDir", - "SelectRecv", - "SelectSend", - "SendDir", - "Slice", - "SliceHeader", - "SliceOf", - "String", - "StringHeader", - "Struct", - "StructField", - "StructOf", - "StructTag", - "Swapper", - "Type", - "TypeOf", - "Uint", - "Uint16", - "Uint32", - "Uint64", - "Uint8", - "Uintptr", - "UnsafePointer", - "Value", - "ValueError", - "ValueOf", - "VisibleFields", - "Zero", - }, - "regexp": { - "Compile", - "CompilePOSIX", - "Match", - "MatchReader", - "MatchString", - "MustCompile", - "MustCompilePOSIX", - "QuoteMeta", - "Regexp", - }, - "regexp/syntax": { - "ClassNL", - "Compile", - "DotNL", - "EmptyBeginLine", - "EmptyBeginText", - "EmptyEndLine", - "EmptyEndText", - "EmptyNoWordBoundary", - "EmptyOp", - "EmptyOpContext", - "EmptyWordBoundary", - "ErrInternalError", - "ErrInvalidCharClass", - "ErrInvalidCharRange", - "ErrInvalidEscape", - "ErrInvalidNamedCapture", - "ErrInvalidPerlOp", - "ErrInvalidRepeatOp", - "ErrInvalidRepeatSize", - "ErrInvalidUTF8", - "ErrLarge", - "ErrMissingBracket", - "ErrMissingParen", - "ErrMissingRepeatArgument", - "ErrNestingDepth", - "ErrTrailingBackslash", - "ErrUnexpectedParen", - "Error", - "ErrorCode", - "Flags", - "FoldCase", - "Inst", - "InstAlt", - "InstAltMatch", - "InstCapture", - "InstEmptyWidth", - "InstFail", - "InstMatch", - "InstNop", - "InstOp", - "InstRune", - "InstRune1", - "InstRuneAny", - "InstRuneAnyNotNL", - "IsWordChar", - "Literal", - "MatchNL", - "NonGreedy", - "OneLine", - "Op", - "OpAlternate", - "OpAnyChar", - "OpAnyCharNotNL", - "OpBeginLine", - "OpBeginText", - "OpCapture", - "OpCharClass", - "OpConcat", - "OpEmptyMatch", - "OpEndLine", - "OpEndText", - "OpLiteral", - "OpNoMatch", - "OpNoWordBoundary", - "OpPlus", - "OpQuest", - "OpRepeat", - "OpStar", - "OpWordBoundary", - "POSIX", - "Parse", - "Perl", - "PerlX", - "Prog", - "Regexp", - "Simple", - "UnicodeGroups", - "WasDollar", - }, - "runtime": { - "BlockProfile", - "BlockProfileRecord", - "Breakpoint", - "CPUProfile", - "Caller", - "Callers", - "CallersFrames", - "Compiler", - "Error", - "Frame", - "Frames", - "Func", - "FuncForPC", - "GC", - "GOARCH", - "GOMAXPROCS", - "GOOS", - "GOROOT", - "Goexit", - "GoroutineProfile", - "Gosched", - "KeepAlive", - "LockOSThread", - "MemProfile", - "MemProfileRate", - "MemProfileRecord", - "MemStats", - "MutexProfile", - "NumCPU", - "NumCgoCall", - "NumGoroutine", - "ReadMemStats", - "ReadTrace", - "SetBlockProfileRate", - "SetCPUProfileRate", - "SetCgoTraceback", - "SetFinalizer", - "SetMutexProfileFraction", - "Stack", - "StackRecord", - "StartTrace", - "StopTrace", - "ThreadCreateProfile", - "TypeAssertionError", - "UnlockOSThread", - "Version", - }, - "runtime/cgo": { - "Handle", - "Incomplete", - "NewHandle", - }, - "runtime/coverage": { - "ClearCounters", - "WriteCounters", - "WriteCountersDir", - "WriteMeta", - "WriteMetaDir", - }, - "runtime/debug": { - "BuildInfo", - "BuildSetting", - "FreeOSMemory", - "GCStats", - "Module", - "ParseBuildInfo", - "PrintStack", - "ReadBuildInfo", - "ReadGCStats", - "SetGCPercent", - "SetMaxStack", - "SetMaxThreads", - "SetMemoryLimit", - "SetPanicOnFault", - "SetTraceback", - "Stack", - "WriteHeapDump", - }, - "runtime/metrics": { - "All", - "Description", - "Float64Histogram", - "KindBad", - "KindFloat64", - "KindFloat64Histogram", - "KindUint64", - "Read", - "Sample", - "Value", - "ValueKind", - }, - "runtime/pprof": { - "Do", - "ForLabels", - "Label", - "LabelSet", - "Labels", - "Lookup", - "NewProfile", - "Profile", - "Profiles", - "SetGoroutineLabels", - "StartCPUProfile", - "StopCPUProfile", - "WithLabels", - "WriteHeapProfile", - }, - "runtime/trace": { - "IsEnabled", - "Log", - "Logf", - "NewTask", - "Region", - "Start", - "StartRegion", - "Stop", - "Task", - "WithRegion", - }, - "sort": { - "Find", - "Float64Slice", - "Float64s", - "Float64sAreSorted", - "IntSlice", - "Interface", - "Ints", - "IntsAreSorted", - "IsSorted", - "Reverse", - "Search", - "SearchFloat64s", - "SearchInts", - "SearchStrings", - "Slice", - "SliceIsSorted", - "SliceStable", - "Sort", - "Stable", - "StringSlice", - "Strings", - "StringsAreSorted", - }, - "strconv": { - "AppendBool", - "AppendFloat", - "AppendInt", - "AppendQuote", - "AppendQuoteRune", - "AppendQuoteRuneToASCII", - "AppendQuoteRuneToGraphic", - "AppendQuoteToASCII", - "AppendQuoteToGraphic", - "AppendUint", - "Atoi", - "CanBackquote", - "ErrRange", - "ErrSyntax", - "FormatBool", - "FormatComplex", - "FormatFloat", - "FormatInt", - "FormatUint", - "IntSize", - "IsGraphic", - "IsPrint", - "Itoa", - "NumError", - "ParseBool", - "ParseComplex", - "ParseFloat", - "ParseInt", - "ParseUint", - "Quote", - "QuoteRune", - "QuoteRuneToASCII", - "QuoteRuneToGraphic", - "QuoteToASCII", - "QuoteToGraphic", - "QuotedPrefix", - "Unquote", - "UnquoteChar", - }, - "strings": { - "Builder", - "Clone", - "Compare", - "Contains", - "ContainsAny", - "ContainsRune", - "Count", - "Cut", - "CutPrefix", - "CutSuffix", - "EqualFold", - "Fields", - "FieldsFunc", - "HasPrefix", - "HasSuffix", - "Index", - "IndexAny", - "IndexByte", - "IndexFunc", - "IndexRune", - "Join", - "LastIndex", - "LastIndexAny", - "LastIndexByte", - "LastIndexFunc", - "Map", - "NewReader", - "NewReplacer", - "Reader", - "Repeat", - "Replace", - "ReplaceAll", - "Replacer", - "Split", - "SplitAfter", - "SplitAfterN", - "SplitN", - "Title", - "ToLower", - "ToLowerSpecial", - "ToTitle", - "ToTitleSpecial", - "ToUpper", - "ToUpperSpecial", - "ToValidUTF8", - "Trim", - "TrimFunc", - "TrimLeft", - "TrimLeftFunc", - "TrimPrefix", - "TrimRight", - "TrimRightFunc", - "TrimSpace", - "TrimSuffix", - }, - "sync": { - "Cond", - "Locker", - "Map", - "Mutex", - "NewCond", - "Once", - "Pool", - "RWMutex", - "WaitGroup", - }, - "sync/atomic": { - "AddInt32", - "AddInt64", - "AddUint32", - "AddUint64", - "AddUintptr", - "Bool", - "CompareAndSwapInt32", - "CompareAndSwapInt64", - "CompareAndSwapPointer", - "CompareAndSwapUint32", - "CompareAndSwapUint64", - "CompareAndSwapUintptr", - "Int32", - "Int64", - "LoadInt32", - "LoadInt64", - "LoadPointer", - "LoadUint32", - "LoadUint64", - "LoadUintptr", - "Pointer", - "StoreInt32", - "StoreInt64", - "StorePointer", - "StoreUint32", - "StoreUint64", - "StoreUintptr", - "SwapInt32", - "SwapInt64", - "SwapPointer", - "SwapUint32", - "SwapUint64", - "SwapUintptr", - "Uint32", - "Uint64", - "Uintptr", - "Value", - }, - "syscall": { - "AF_ALG", - "AF_APPLETALK", - "AF_ARP", - "AF_ASH", - "AF_ATM", - "AF_ATMPVC", - "AF_ATMSVC", - "AF_AX25", - "AF_BLUETOOTH", - "AF_BRIDGE", - "AF_CAIF", - "AF_CAN", - "AF_CCITT", - "AF_CHAOS", - "AF_CNT", - "AF_COIP", - "AF_DATAKIT", - "AF_DECnet", - "AF_DLI", - "AF_E164", - "AF_ECMA", - "AF_ECONET", - "AF_ENCAP", - "AF_FILE", - "AF_HYLINK", - "AF_IEEE80211", - "AF_IEEE802154", - "AF_IMPLINK", - "AF_INET", - "AF_INET6", - "AF_INET6_SDP", - "AF_INET_SDP", - "AF_IPX", - "AF_IRDA", - "AF_ISDN", - "AF_ISO", - "AF_IUCV", - "AF_KEY", - "AF_LAT", - "AF_LINK", - "AF_LLC", - "AF_LOCAL", - "AF_MAX", - "AF_MPLS", - "AF_NATM", - "AF_NDRV", - "AF_NETBEUI", - "AF_NETBIOS", - "AF_NETGRAPH", - "AF_NETLINK", - "AF_NETROM", - "AF_NS", - "AF_OROUTE", - "AF_OSI", - "AF_PACKET", - "AF_PHONET", - "AF_PPP", - "AF_PPPOX", - "AF_PUP", - "AF_RDS", - "AF_RESERVED_36", - "AF_ROSE", - "AF_ROUTE", - "AF_RXRPC", - "AF_SCLUSTER", - "AF_SECURITY", - "AF_SIP", - "AF_SLOW", - "AF_SNA", - "AF_SYSTEM", - "AF_TIPC", - "AF_UNIX", - "AF_UNSPEC", - "AF_UTUN", - "AF_VENDOR00", - "AF_VENDOR01", - "AF_VENDOR02", - "AF_VENDOR03", - "AF_VENDOR04", - "AF_VENDOR05", - "AF_VENDOR06", - "AF_VENDOR07", - "AF_VENDOR08", - "AF_VENDOR09", - "AF_VENDOR10", - "AF_VENDOR11", - "AF_VENDOR12", - "AF_VENDOR13", - "AF_VENDOR14", - "AF_VENDOR15", - "AF_VENDOR16", - "AF_VENDOR17", - "AF_VENDOR18", - "AF_VENDOR19", - "AF_VENDOR20", - "AF_VENDOR21", - "AF_VENDOR22", - "AF_VENDOR23", - "AF_VENDOR24", - "AF_VENDOR25", - "AF_VENDOR26", - "AF_VENDOR27", - "AF_VENDOR28", - "AF_VENDOR29", - "AF_VENDOR30", - "AF_VENDOR31", - "AF_VENDOR32", - "AF_VENDOR33", - "AF_VENDOR34", - "AF_VENDOR35", - "AF_VENDOR36", - "AF_VENDOR37", - "AF_VENDOR38", - "AF_VENDOR39", - "AF_VENDOR40", - "AF_VENDOR41", - "AF_VENDOR42", - "AF_VENDOR43", - "AF_VENDOR44", - "AF_VENDOR45", - "AF_VENDOR46", - "AF_VENDOR47", - "AF_WANPIPE", - "AF_X25", - "AI_CANONNAME", - "AI_NUMERICHOST", - "AI_PASSIVE", - "APPLICATION_ERROR", - "ARPHRD_ADAPT", - "ARPHRD_APPLETLK", - "ARPHRD_ARCNET", - "ARPHRD_ASH", - "ARPHRD_ATM", - "ARPHRD_AX25", - "ARPHRD_BIF", - "ARPHRD_CHAOS", - "ARPHRD_CISCO", - "ARPHRD_CSLIP", - "ARPHRD_CSLIP6", - "ARPHRD_DDCMP", - "ARPHRD_DLCI", - "ARPHRD_ECONET", - "ARPHRD_EETHER", - "ARPHRD_ETHER", - "ARPHRD_EUI64", - "ARPHRD_FCAL", - "ARPHRD_FCFABRIC", - "ARPHRD_FCPL", - "ARPHRD_FCPP", - "ARPHRD_FDDI", - "ARPHRD_FRAD", - "ARPHRD_FRELAY", - "ARPHRD_HDLC", - "ARPHRD_HIPPI", - "ARPHRD_HWX25", - "ARPHRD_IEEE1394", - "ARPHRD_IEEE802", - "ARPHRD_IEEE80211", - "ARPHRD_IEEE80211_PRISM", - "ARPHRD_IEEE80211_RADIOTAP", - "ARPHRD_IEEE802154", - "ARPHRD_IEEE802154_PHY", - "ARPHRD_IEEE802_TR", - "ARPHRD_INFINIBAND", - "ARPHRD_IPDDP", - "ARPHRD_IPGRE", - "ARPHRD_IRDA", - "ARPHRD_LAPB", - "ARPHRD_LOCALTLK", - "ARPHRD_LOOPBACK", - "ARPHRD_METRICOM", - "ARPHRD_NETROM", - "ARPHRD_NONE", - "ARPHRD_PIMREG", - "ARPHRD_PPP", - "ARPHRD_PRONET", - "ARPHRD_RAWHDLC", - "ARPHRD_ROSE", - "ARPHRD_RSRVD", - "ARPHRD_SIT", - "ARPHRD_SKIP", - "ARPHRD_SLIP", - "ARPHRD_SLIP6", - "ARPHRD_STRIP", - "ARPHRD_TUNNEL", - "ARPHRD_TUNNEL6", - "ARPHRD_VOID", - "ARPHRD_X25", - "AUTHTYPE_CLIENT", - "AUTHTYPE_SERVER", - "Accept", - "Accept4", - "AcceptEx", - "Access", - "Acct", - "AddrinfoW", - "Adjtime", - "Adjtimex", - "AllThreadsSyscall", - "AllThreadsSyscall6", - "AttachLsf", - "B0", - "B1000000", - "B110", - "B115200", - "B1152000", - "B1200", - "B134", - "B14400", - "B150", - "B1500000", - "B1800", - "B19200", - "B200", - "B2000000", - "B230400", - "B2400", - "B2500000", - "B28800", - "B300", - "B3000000", - "B3500000", - "B38400", - "B4000000", - "B460800", - "B4800", - "B50", - "B500000", - "B57600", - "B576000", - "B600", - "B7200", - "B75", - "B76800", - "B921600", - "B9600", - "BASE_PROTOCOL", - "BIOCFEEDBACK", - "BIOCFLUSH", - "BIOCGBLEN", - "BIOCGDIRECTION", - "BIOCGDIRFILT", - "BIOCGDLT", - "BIOCGDLTLIST", - "BIOCGETBUFMODE", - "BIOCGETIF", - "BIOCGETZMAX", - "BIOCGFEEDBACK", - "BIOCGFILDROP", - "BIOCGHDRCMPLT", - "BIOCGRSIG", - "BIOCGRTIMEOUT", - "BIOCGSEESENT", - "BIOCGSTATS", - "BIOCGSTATSOLD", - "BIOCGTSTAMP", - "BIOCIMMEDIATE", - "BIOCLOCK", - "BIOCPROMISC", - "BIOCROTZBUF", - "BIOCSBLEN", - "BIOCSDIRECTION", - "BIOCSDIRFILT", - "BIOCSDLT", - "BIOCSETBUFMODE", - "BIOCSETF", - "BIOCSETFNR", - "BIOCSETIF", - "BIOCSETWF", - "BIOCSETZBUF", - "BIOCSFEEDBACK", - "BIOCSFILDROP", - "BIOCSHDRCMPLT", - "BIOCSRSIG", - "BIOCSRTIMEOUT", - "BIOCSSEESENT", - "BIOCSTCPF", - "BIOCSTSTAMP", - "BIOCSUDPF", - "BIOCVERSION", - "BPF_A", - "BPF_ABS", - "BPF_ADD", - "BPF_ALIGNMENT", - "BPF_ALIGNMENT32", - "BPF_ALU", - "BPF_AND", - "BPF_B", - "BPF_BUFMODE_BUFFER", - "BPF_BUFMODE_ZBUF", - "BPF_DFLTBUFSIZE", - "BPF_DIRECTION_IN", - "BPF_DIRECTION_OUT", - "BPF_DIV", - "BPF_H", - "BPF_IMM", - "BPF_IND", - "BPF_JA", - "BPF_JEQ", - "BPF_JGE", - "BPF_JGT", - "BPF_JMP", - "BPF_JSET", - "BPF_K", - "BPF_LD", - "BPF_LDX", - "BPF_LEN", - "BPF_LSH", - "BPF_MAJOR_VERSION", - "BPF_MAXBUFSIZE", - "BPF_MAXINSNS", - "BPF_MEM", - "BPF_MEMWORDS", - "BPF_MINBUFSIZE", - "BPF_MINOR_VERSION", - "BPF_MISC", - "BPF_MSH", - "BPF_MUL", - "BPF_NEG", - "BPF_OR", - "BPF_RELEASE", - "BPF_RET", - "BPF_RSH", - "BPF_ST", - "BPF_STX", - "BPF_SUB", - "BPF_TAX", - "BPF_TXA", - "BPF_T_BINTIME", - "BPF_T_BINTIME_FAST", - "BPF_T_BINTIME_MONOTONIC", - "BPF_T_BINTIME_MONOTONIC_FAST", - "BPF_T_FAST", - "BPF_T_FLAG_MASK", - "BPF_T_FORMAT_MASK", - "BPF_T_MICROTIME", - "BPF_T_MICROTIME_FAST", - "BPF_T_MICROTIME_MONOTONIC", - "BPF_T_MICROTIME_MONOTONIC_FAST", - "BPF_T_MONOTONIC", - "BPF_T_MONOTONIC_FAST", - "BPF_T_NANOTIME", - "BPF_T_NANOTIME_FAST", - "BPF_T_NANOTIME_MONOTONIC", - "BPF_T_NANOTIME_MONOTONIC_FAST", - "BPF_T_NONE", - "BPF_T_NORMAL", - "BPF_W", - "BPF_X", - "BRKINT", - "Bind", - "BindToDevice", - "BpfBuflen", - "BpfDatalink", - "BpfHdr", - "BpfHeadercmpl", - "BpfInsn", - "BpfInterface", - "BpfJump", - "BpfProgram", - "BpfStat", - "BpfStats", - "BpfStmt", - "BpfTimeout", - "BpfTimeval", - "BpfVersion", - "BpfZbuf", - "BpfZbufHeader", - "ByHandleFileInformation", - "BytePtrFromString", - "ByteSliceFromString", - "CCR0_FLUSH", - "CERT_CHAIN_POLICY_AUTHENTICODE", - "CERT_CHAIN_POLICY_AUTHENTICODE_TS", - "CERT_CHAIN_POLICY_BASE", - "CERT_CHAIN_POLICY_BASIC_CONSTRAINTS", - "CERT_CHAIN_POLICY_EV", - "CERT_CHAIN_POLICY_MICROSOFT_ROOT", - "CERT_CHAIN_POLICY_NT_AUTH", - "CERT_CHAIN_POLICY_SSL", - "CERT_E_CN_NO_MATCH", - "CERT_E_EXPIRED", - "CERT_E_PURPOSE", - "CERT_E_ROLE", - "CERT_E_UNTRUSTEDROOT", - "CERT_STORE_ADD_ALWAYS", - "CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG", - "CERT_STORE_PROV_MEMORY", - "CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT", - "CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT", - "CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT", - "CERT_TRUST_INVALID_BASIC_CONSTRAINTS", - "CERT_TRUST_INVALID_EXTENSION", - "CERT_TRUST_INVALID_NAME_CONSTRAINTS", - "CERT_TRUST_INVALID_POLICY_CONSTRAINTS", - "CERT_TRUST_IS_CYCLIC", - "CERT_TRUST_IS_EXPLICIT_DISTRUST", - "CERT_TRUST_IS_NOT_SIGNATURE_VALID", - "CERT_TRUST_IS_NOT_TIME_VALID", - "CERT_TRUST_IS_NOT_VALID_FOR_USAGE", - "CERT_TRUST_IS_OFFLINE_REVOCATION", - "CERT_TRUST_IS_REVOKED", - "CERT_TRUST_IS_UNTRUSTED_ROOT", - "CERT_TRUST_NO_ERROR", - "CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY", - "CERT_TRUST_REVOCATION_STATUS_UNKNOWN", - "CFLUSH", - "CLOCAL", - "CLONE_CHILD_CLEARTID", - "CLONE_CHILD_SETTID", - "CLONE_CLEAR_SIGHAND", - "CLONE_CSIGNAL", - "CLONE_DETACHED", - "CLONE_FILES", - "CLONE_FS", - "CLONE_INTO_CGROUP", - "CLONE_IO", - "CLONE_NEWCGROUP", - "CLONE_NEWIPC", - "CLONE_NEWNET", - "CLONE_NEWNS", - "CLONE_NEWPID", - "CLONE_NEWTIME", - "CLONE_NEWUSER", - "CLONE_NEWUTS", - "CLONE_PARENT", - "CLONE_PARENT_SETTID", - "CLONE_PID", - "CLONE_PIDFD", - "CLONE_PTRACE", - "CLONE_SETTLS", - "CLONE_SIGHAND", - "CLONE_SYSVSEM", - "CLONE_THREAD", - "CLONE_UNTRACED", - "CLONE_VFORK", - "CLONE_VM", - "CPUID_CFLUSH", - "CREAD", - "CREATE_ALWAYS", - "CREATE_NEW", - "CREATE_NEW_PROCESS_GROUP", - "CREATE_UNICODE_ENVIRONMENT", - "CRYPT_DEFAULT_CONTAINER_OPTIONAL", - "CRYPT_DELETEKEYSET", - "CRYPT_MACHINE_KEYSET", - "CRYPT_NEWKEYSET", - "CRYPT_SILENT", - "CRYPT_VERIFYCONTEXT", - "CS5", - "CS6", - "CS7", - "CS8", - "CSIZE", - "CSTART", - "CSTATUS", - "CSTOP", - "CSTOPB", - "CSUSP", - "CTL_MAXNAME", - "CTL_NET", - "CTL_QUERY", - "CTRL_BREAK_EVENT", - "CTRL_CLOSE_EVENT", - "CTRL_C_EVENT", - "CTRL_LOGOFF_EVENT", - "CTRL_SHUTDOWN_EVENT", - "CancelIo", - "CancelIoEx", - "CertAddCertificateContextToStore", - "CertChainContext", - "CertChainElement", - "CertChainPara", - "CertChainPolicyPara", - "CertChainPolicyStatus", - "CertCloseStore", - "CertContext", - "CertCreateCertificateContext", - "CertEnhKeyUsage", - "CertEnumCertificatesInStore", - "CertFreeCertificateChain", - "CertFreeCertificateContext", - "CertGetCertificateChain", - "CertInfo", - "CertOpenStore", - "CertOpenSystemStore", - "CertRevocationCrlInfo", - "CertRevocationInfo", - "CertSimpleChain", - "CertTrustListInfo", - "CertTrustStatus", - "CertUsageMatch", - "CertVerifyCertificateChainPolicy", - "Chdir", - "CheckBpfVersion", - "Chflags", - "Chmod", - "Chown", - "Chroot", - "Clearenv", - "Close", - "CloseHandle", - "CloseOnExec", - "Closesocket", - "CmsgLen", - "CmsgSpace", - "Cmsghdr", - "CommandLineToArgv", - "ComputerName", - "Conn", - "Connect", - "ConnectEx", - "ConvertSidToStringSid", - "ConvertStringSidToSid", - "CopySid", - "Creat", - "CreateDirectory", - "CreateFile", - "CreateFileMapping", - "CreateHardLink", - "CreateIoCompletionPort", - "CreatePipe", - "CreateProcess", - "CreateProcessAsUser", - "CreateSymbolicLink", - "CreateToolhelp32Snapshot", - "Credential", - "CryptAcquireContext", - "CryptGenRandom", - "CryptReleaseContext", - "DIOCBSFLUSH", - "DIOCOSFPFLUSH", - "DLL", - "DLLError", - "DLT_A429", - "DLT_A653_ICM", - "DLT_AIRONET_HEADER", - "DLT_AOS", - "DLT_APPLE_IP_OVER_IEEE1394", - "DLT_ARCNET", - "DLT_ARCNET_LINUX", - "DLT_ATM_CLIP", - "DLT_ATM_RFC1483", - "DLT_AURORA", - "DLT_AX25", - "DLT_AX25_KISS", - "DLT_BACNET_MS_TP", - "DLT_BLUETOOTH_HCI_H4", - "DLT_BLUETOOTH_HCI_H4_WITH_PHDR", - "DLT_CAN20B", - "DLT_CAN_SOCKETCAN", - "DLT_CHAOS", - "DLT_CHDLC", - "DLT_CISCO_IOS", - "DLT_C_HDLC", - "DLT_C_HDLC_WITH_DIR", - "DLT_DBUS", - "DLT_DECT", - "DLT_DOCSIS", - "DLT_DVB_CI", - "DLT_ECONET", - "DLT_EN10MB", - "DLT_EN3MB", - "DLT_ENC", - "DLT_ERF", - "DLT_ERF_ETH", - "DLT_ERF_POS", - "DLT_FC_2", - "DLT_FC_2_WITH_FRAME_DELIMS", - "DLT_FDDI", - "DLT_FLEXRAY", - "DLT_FRELAY", - "DLT_FRELAY_WITH_DIR", - "DLT_GCOM_SERIAL", - "DLT_GCOM_T1E1", - "DLT_GPF_F", - "DLT_GPF_T", - "DLT_GPRS_LLC", - "DLT_GSMTAP_ABIS", - "DLT_GSMTAP_UM", - "DLT_HDLC", - "DLT_HHDLC", - "DLT_HIPPI", - "DLT_IBM_SN", - "DLT_IBM_SP", - "DLT_IEEE802", - "DLT_IEEE802_11", - "DLT_IEEE802_11_RADIO", - "DLT_IEEE802_11_RADIO_AVS", - "DLT_IEEE802_15_4", - "DLT_IEEE802_15_4_LINUX", - "DLT_IEEE802_15_4_NOFCS", - "DLT_IEEE802_15_4_NONASK_PHY", - "DLT_IEEE802_16_MAC_CPS", - "DLT_IEEE802_16_MAC_CPS_RADIO", - "DLT_IPFILTER", - "DLT_IPMB", - "DLT_IPMB_LINUX", - "DLT_IPNET", - "DLT_IPOIB", - "DLT_IPV4", - "DLT_IPV6", - "DLT_IP_OVER_FC", - "DLT_JUNIPER_ATM1", - "DLT_JUNIPER_ATM2", - "DLT_JUNIPER_ATM_CEMIC", - "DLT_JUNIPER_CHDLC", - "DLT_JUNIPER_ES", - "DLT_JUNIPER_ETHER", - "DLT_JUNIPER_FIBRECHANNEL", - "DLT_JUNIPER_FRELAY", - "DLT_JUNIPER_GGSN", - "DLT_JUNIPER_ISM", - "DLT_JUNIPER_MFR", - "DLT_JUNIPER_MLFR", - "DLT_JUNIPER_MLPPP", - "DLT_JUNIPER_MONITOR", - "DLT_JUNIPER_PIC_PEER", - "DLT_JUNIPER_PPP", - "DLT_JUNIPER_PPPOE", - "DLT_JUNIPER_PPPOE_ATM", - "DLT_JUNIPER_SERVICES", - "DLT_JUNIPER_SRX_E2E", - "DLT_JUNIPER_ST", - "DLT_JUNIPER_VP", - "DLT_JUNIPER_VS", - "DLT_LAPB_WITH_DIR", - "DLT_LAPD", - "DLT_LIN", - "DLT_LINUX_EVDEV", - "DLT_LINUX_IRDA", - "DLT_LINUX_LAPD", - "DLT_LINUX_PPP_WITHDIRECTION", - "DLT_LINUX_SLL", - "DLT_LOOP", - "DLT_LTALK", - "DLT_MATCHING_MAX", - "DLT_MATCHING_MIN", - "DLT_MFR", - "DLT_MOST", - "DLT_MPEG_2_TS", - "DLT_MPLS", - "DLT_MTP2", - "DLT_MTP2_WITH_PHDR", - "DLT_MTP3", - "DLT_MUX27010", - "DLT_NETANALYZER", - "DLT_NETANALYZER_TRANSPARENT", - "DLT_NFC_LLCP", - "DLT_NFLOG", - "DLT_NG40", - "DLT_NULL", - "DLT_PCI_EXP", - "DLT_PFLOG", - "DLT_PFSYNC", - "DLT_PPI", - "DLT_PPP", - "DLT_PPP_BSDOS", - "DLT_PPP_ETHER", - "DLT_PPP_PPPD", - "DLT_PPP_SERIAL", - "DLT_PPP_WITH_DIR", - "DLT_PPP_WITH_DIRECTION", - "DLT_PRISM_HEADER", - "DLT_PRONET", - "DLT_RAIF1", - "DLT_RAW", - "DLT_RAWAF_MASK", - "DLT_RIO", - "DLT_SCCP", - "DLT_SITA", - "DLT_SLIP", - "DLT_SLIP_BSDOS", - "DLT_STANAG_5066_D_PDU", - "DLT_SUNATM", - "DLT_SYMANTEC_FIREWALL", - "DLT_TZSP", - "DLT_USB", - "DLT_USB_LINUX", - "DLT_USB_LINUX_MMAPPED", - "DLT_USER0", - "DLT_USER1", - "DLT_USER10", - "DLT_USER11", - "DLT_USER12", - "DLT_USER13", - "DLT_USER14", - "DLT_USER15", - "DLT_USER2", - "DLT_USER3", - "DLT_USER4", - "DLT_USER5", - "DLT_USER6", - "DLT_USER7", - "DLT_USER8", - "DLT_USER9", - "DLT_WIHART", - "DLT_X2E_SERIAL", - "DLT_X2E_XORAYA", - "DNSMXData", - "DNSPTRData", - "DNSRecord", - "DNSSRVData", - "DNSTXTData", - "DNS_INFO_NO_RECORDS", - "DNS_TYPE_A", - "DNS_TYPE_A6", - "DNS_TYPE_AAAA", - "DNS_TYPE_ADDRS", - "DNS_TYPE_AFSDB", - "DNS_TYPE_ALL", - "DNS_TYPE_ANY", - "DNS_TYPE_ATMA", - "DNS_TYPE_AXFR", - "DNS_TYPE_CERT", - "DNS_TYPE_CNAME", - "DNS_TYPE_DHCID", - "DNS_TYPE_DNAME", - "DNS_TYPE_DNSKEY", - "DNS_TYPE_DS", - "DNS_TYPE_EID", - "DNS_TYPE_GID", - "DNS_TYPE_GPOS", - "DNS_TYPE_HINFO", - "DNS_TYPE_ISDN", - "DNS_TYPE_IXFR", - "DNS_TYPE_KEY", - "DNS_TYPE_KX", - "DNS_TYPE_LOC", - "DNS_TYPE_MAILA", - "DNS_TYPE_MAILB", - "DNS_TYPE_MB", - "DNS_TYPE_MD", - "DNS_TYPE_MF", - "DNS_TYPE_MG", - "DNS_TYPE_MINFO", - "DNS_TYPE_MR", - "DNS_TYPE_MX", - "DNS_TYPE_NAPTR", - "DNS_TYPE_NBSTAT", - "DNS_TYPE_NIMLOC", - "DNS_TYPE_NS", - "DNS_TYPE_NSAP", - "DNS_TYPE_NSAPPTR", - "DNS_TYPE_NSEC", - "DNS_TYPE_NULL", - "DNS_TYPE_NXT", - "DNS_TYPE_OPT", - "DNS_TYPE_PTR", - "DNS_TYPE_PX", - "DNS_TYPE_RP", - "DNS_TYPE_RRSIG", - "DNS_TYPE_RT", - "DNS_TYPE_SIG", - "DNS_TYPE_SINK", - "DNS_TYPE_SOA", - "DNS_TYPE_SRV", - "DNS_TYPE_TEXT", - "DNS_TYPE_TKEY", - "DNS_TYPE_TSIG", - "DNS_TYPE_UID", - "DNS_TYPE_UINFO", - "DNS_TYPE_UNSPEC", - "DNS_TYPE_WINS", - "DNS_TYPE_WINSR", - "DNS_TYPE_WKS", - "DNS_TYPE_X25", - "DT_BLK", - "DT_CHR", - "DT_DIR", - "DT_FIFO", - "DT_LNK", - "DT_REG", - "DT_SOCK", - "DT_UNKNOWN", - "DT_WHT", - "DUPLICATE_CLOSE_SOURCE", - "DUPLICATE_SAME_ACCESS", - "DeleteFile", - "DetachLsf", - "DeviceIoControl", - "Dirent", - "DnsNameCompare", - "DnsQuery", - "DnsRecordListFree", - "DnsSectionAdditional", - "DnsSectionAnswer", - "DnsSectionAuthority", - "DnsSectionQuestion", - "Dup", - "Dup2", - "Dup3", - "DuplicateHandle", - "E2BIG", - "EACCES", - "EADDRINUSE", - "EADDRNOTAVAIL", - "EADV", - "EAFNOSUPPORT", - "EAGAIN", - "EALREADY", - "EAUTH", - "EBADARCH", - "EBADE", - "EBADEXEC", - "EBADF", - "EBADFD", - "EBADMACHO", - "EBADMSG", - "EBADR", - "EBADRPC", - "EBADRQC", - "EBADSLT", - "EBFONT", - "EBUSY", - "ECANCELED", - "ECAPMODE", - "ECHILD", - "ECHO", - "ECHOCTL", - "ECHOE", - "ECHOK", - "ECHOKE", - "ECHONL", - "ECHOPRT", - "ECHRNG", - "ECOMM", - "ECONNABORTED", - "ECONNREFUSED", - "ECONNRESET", - "EDEADLK", - "EDEADLOCK", - "EDESTADDRREQ", - "EDEVERR", - "EDOM", - "EDOOFUS", - "EDOTDOT", - "EDQUOT", - "EEXIST", - "EFAULT", - "EFBIG", - "EFER_LMA", - "EFER_LME", - "EFER_NXE", - "EFER_SCE", - "EFTYPE", - "EHOSTDOWN", - "EHOSTUNREACH", - "EHWPOISON", - "EIDRM", - "EILSEQ", - "EINPROGRESS", - "EINTR", - "EINVAL", - "EIO", - "EIPSEC", - "EISCONN", - "EISDIR", - "EISNAM", - "EKEYEXPIRED", - "EKEYREJECTED", - "EKEYREVOKED", - "EL2HLT", - "EL2NSYNC", - "EL3HLT", - "EL3RST", - "ELAST", - "ELF_NGREG", - "ELF_PRARGSZ", - "ELIBACC", - "ELIBBAD", - "ELIBEXEC", - "ELIBMAX", - "ELIBSCN", - "ELNRNG", - "ELOOP", - "EMEDIUMTYPE", - "EMFILE", - "EMLINK", - "EMSGSIZE", - "EMT_TAGOVF", - "EMULTIHOP", - "EMUL_ENABLED", - "EMUL_LINUX", - "EMUL_LINUX32", - "EMUL_MAXID", - "EMUL_NATIVE", - "ENAMETOOLONG", - "ENAVAIL", - "ENDRUNDISC", - "ENEEDAUTH", - "ENETDOWN", - "ENETRESET", - "ENETUNREACH", - "ENFILE", - "ENOANO", - "ENOATTR", - "ENOBUFS", - "ENOCSI", - "ENODATA", - "ENODEV", - "ENOENT", - "ENOEXEC", - "ENOKEY", - "ENOLCK", - "ENOLINK", - "ENOMEDIUM", - "ENOMEM", - "ENOMSG", - "ENONET", - "ENOPKG", - "ENOPOLICY", - "ENOPROTOOPT", - "ENOSPC", - "ENOSR", - "ENOSTR", - "ENOSYS", - "ENOTBLK", - "ENOTCAPABLE", - "ENOTCONN", - "ENOTDIR", - "ENOTEMPTY", - "ENOTNAM", - "ENOTRECOVERABLE", - "ENOTSOCK", - "ENOTSUP", - "ENOTTY", - "ENOTUNIQ", - "ENXIO", - "EN_SW_CTL_INF", - "EN_SW_CTL_PREC", - "EN_SW_CTL_ROUND", - "EN_SW_DATACHAIN", - "EN_SW_DENORM", - "EN_SW_INVOP", - "EN_SW_OVERFLOW", - "EN_SW_PRECLOSS", - "EN_SW_UNDERFLOW", - "EN_SW_ZERODIV", - "EOPNOTSUPP", - "EOVERFLOW", - "EOWNERDEAD", - "EPERM", - "EPFNOSUPPORT", - "EPIPE", - "EPOLLERR", - "EPOLLET", - "EPOLLHUP", - "EPOLLIN", - "EPOLLMSG", - "EPOLLONESHOT", - "EPOLLOUT", - "EPOLLPRI", - "EPOLLRDBAND", - "EPOLLRDHUP", - "EPOLLRDNORM", - "EPOLLWRBAND", - "EPOLLWRNORM", - "EPOLL_CLOEXEC", - "EPOLL_CTL_ADD", - "EPOLL_CTL_DEL", - "EPOLL_CTL_MOD", - "EPOLL_NONBLOCK", - "EPROCLIM", - "EPROCUNAVAIL", - "EPROGMISMATCH", - "EPROGUNAVAIL", - "EPROTO", - "EPROTONOSUPPORT", - "EPROTOTYPE", - "EPWROFF", - "EQFULL", - "ERANGE", - "EREMCHG", - "EREMOTE", - "EREMOTEIO", - "ERESTART", - "ERFKILL", - "EROFS", - "ERPCMISMATCH", - "ERROR_ACCESS_DENIED", - "ERROR_ALREADY_EXISTS", - "ERROR_BROKEN_PIPE", - "ERROR_BUFFER_OVERFLOW", - "ERROR_DIR_NOT_EMPTY", - "ERROR_ENVVAR_NOT_FOUND", - "ERROR_FILE_EXISTS", - "ERROR_FILE_NOT_FOUND", - "ERROR_HANDLE_EOF", - "ERROR_INSUFFICIENT_BUFFER", - "ERROR_IO_PENDING", - "ERROR_MOD_NOT_FOUND", - "ERROR_MORE_DATA", - "ERROR_NETNAME_DELETED", - "ERROR_NOT_FOUND", - "ERROR_NO_MORE_FILES", - "ERROR_OPERATION_ABORTED", - "ERROR_PATH_NOT_FOUND", - "ERROR_PRIVILEGE_NOT_HELD", - "ERROR_PROC_NOT_FOUND", - "ESHLIBVERS", - "ESHUTDOWN", - "ESOCKTNOSUPPORT", - "ESPIPE", - "ESRCH", - "ESRMNT", - "ESTALE", - "ESTRPIPE", - "ETHERCAP_JUMBO_MTU", - "ETHERCAP_VLAN_HWTAGGING", - "ETHERCAP_VLAN_MTU", - "ETHERMIN", - "ETHERMTU", - "ETHERMTU_JUMBO", - "ETHERTYPE_8023", - "ETHERTYPE_AARP", - "ETHERTYPE_ACCTON", - "ETHERTYPE_AEONIC", - "ETHERTYPE_ALPHA", - "ETHERTYPE_AMBER", - "ETHERTYPE_AMOEBA", - "ETHERTYPE_AOE", - "ETHERTYPE_APOLLO", - "ETHERTYPE_APOLLODOMAIN", - "ETHERTYPE_APPLETALK", - "ETHERTYPE_APPLITEK", - "ETHERTYPE_ARGONAUT", - "ETHERTYPE_ARP", - "ETHERTYPE_AT", - "ETHERTYPE_ATALK", - "ETHERTYPE_ATOMIC", - "ETHERTYPE_ATT", - "ETHERTYPE_ATTSTANFORD", - "ETHERTYPE_AUTOPHON", - "ETHERTYPE_AXIS", - "ETHERTYPE_BCLOOP", - "ETHERTYPE_BOFL", - "ETHERTYPE_CABLETRON", - "ETHERTYPE_CHAOS", - "ETHERTYPE_COMDESIGN", - "ETHERTYPE_COMPUGRAPHIC", - "ETHERTYPE_COUNTERPOINT", - "ETHERTYPE_CRONUS", - "ETHERTYPE_CRONUSVLN", - "ETHERTYPE_DCA", - "ETHERTYPE_DDE", - "ETHERTYPE_DEBNI", - "ETHERTYPE_DECAM", - "ETHERTYPE_DECCUST", - "ETHERTYPE_DECDIAG", - "ETHERTYPE_DECDNS", - "ETHERTYPE_DECDTS", - "ETHERTYPE_DECEXPER", - "ETHERTYPE_DECLAST", - "ETHERTYPE_DECLTM", - "ETHERTYPE_DECMUMPS", - "ETHERTYPE_DECNETBIOS", - "ETHERTYPE_DELTACON", - "ETHERTYPE_DIDDLE", - "ETHERTYPE_DLOG1", - "ETHERTYPE_DLOG2", - "ETHERTYPE_DN", - "ETHERTYPE_DOGFIGHT", - "ETHERTYPE_DSMD", - "ETHERTYPE_ECMA", - "ETHERTYPE_ENCRYPT", - "ETHERTYPE_ES", - "ETHERTYPE_EXCELAN", - "ETHERTYPE_EXPERDATA", - "ETHERTYPE_FLIP", - "ETHERTYPE_FLOWCONTROL", - "ETHERTYPE_FRARP", - "ETHERTYPE_GENDYN", - "ETHERTYPE_HAYES", - "ETHERTYPE_HIPPI_FP", - "ETHERTYPE_HITACHI", - "ETHERTYPE_HP", - "ETHERTYPE_IEEEPUP", - "ETHERTYPE_IEEEPUPAT", - "ETHERTYPE_IMLBL", - "ETHERTYPE_IMLBLDIAG", - "ETHERTYPE_IP", - "ETHERTYPE_IPAS", - "ETHERTYPE_IPV6", - "ETHERTYPE_IPX", - "ETHERTYPE_IPXNEW", - "ETHERTYPE_KALPANA", - "ETHERTYPE_LANBRIDGE", - "ETHERTYPE_LANPROBE", - "ETHERTYPE_LAT", - "ETHERTYPE_LBACK", - "ETHERTYPE_LITTLE", - "ETHERTYPE_LLDP", - "ETHERTYPE_LOGICRAFT", - "ETHERTYPE_LOOPBACK", - "ETHERTYPE_MATRA", - "ETHERTYPE_MAX", - "ETHERTYPE_MERIT", - "ETHERTYPE_MICP", - "ETHERTYPE_MOPDL", - "ETHERTYPE_MOPRC", - "ETHERTYPE_MOTOROLA", - "ETHERTYPE_MPLS", - "ETHERTYPE_MPLS_MCAST", - "ETHERTYPE_MUMPS", - "ETHERTYPE_NBPCC", - "ETHERTYPE_NBPCLAIM", - "ETHERTYPE_NBPCLREQ", - "ETHERTYPE_NBPCLRSP", - "ETHERTYPE_NBPCREQ", - "ETHERTYPE_NBPCRSP", - "ETHERTYPE_NBPDG", - "ETHERTYPE_NBPDGB", - "ETHERTYPE_NBPDLTE", - "ETHERTYPE_NBPRAR", - "ETHERTYPE_NBPRAS", - "ETHERTYPE_NBPRST", - "ETHERTYPE_NBPSCD", - "ETHERTYPE_NBPVCD", - "ETHERTYPE_NBS", - "ETHERTYPE_NCD", - "ETHERTYPE_NESTAR", - "ETHERTYPE_NETBEUI", - "ETHERTYPE_NOVELL", - "ETHERTYPE_NS", - "ETHERTYPE_NSAT", - "ETHERTYPE_NSCOMPAT", - "ETHERTYPE_NTRAILER", - "ETHERTYPE_OS9", - "ETHERTYPE_OS9NET", - "ETHERTYPE_PACER", - "ETHERTYPE_PAE", - "ETHERTYPE_PCS", - "ETHERTYPE_PLANNING", - "ETHERTYPE_PPP", - "ETHERTYPE_PPPOE", - "ETHERTYPE_PPPOEDISC", - "ETHERTYPE_PRIMENTS", - "ETHERTYPE_PUP", - "ETHERTYPE_PUPAT", - "ETHERTYPE_QINQ", - "ETHERTYPE_RACAL", - "ETHERTYPE_RATIONAL", - "ETHERTYPE_RAWFR", - "ETHERTYPE_RCL", - "ETHERTYPE_RDP", - "ETHERTYPE_RETIX", - "ETHERTYPE_REVARP", - "ETHERTYPE_SCA", - "ETHERTYPE_SECTRA", - "ETHERTYPE_SECUREDATA", - "ETHERTYPE_SGITW", - "ETHERTYPE_SG_BOUNCE", - "ETHERTYPE_SG_DIAG", - "ETHERTYPE_SG_NETGAMES", - "ETHERTYPE_SG_RESV", - "ETHERTYPE_SIMNET", - "ETHERTYPE_SLOW", - "ETHERTYPE_SLOWPROTOCOLS", - "ETHERTYPE_SNA", - "ETHERTYPE_SNMP", - "ETHERTYPE_SONIX", - "ETHERTYPE_SPIDER", - "ETHERTYPE_SPRITE", - "ETHERTYPE_STP", - "ETHERTYPE_TALARIS", - "ETHERTYPE_TALARISMC", - "ETHERTYPE_TCPCOMP", - "ETHERTYPE_TCPSM", - "ETHERTYPE_TEC", - "ETHERTYPE_TIGAN", - "ETHERTYPE_TRAIL", - "ETHERTYPE_TRANSETHER", - "ETHERTYPE_TYMSHARE", - "ETHERTYPE_UBBST", - "ETHERTYPE_UBDEBUG", - "ETHERTYPE_UBDIAGLOOP", - "ETHERTYPE_UBDL", - "ETHERTYPE_UBNIU", - "ETHERTYPE_UBNMC", - "ETHERTYPE_VALID", - "ETHERTYPE_VARIAN", - "ETHERTYPE_VAXELN", - "ETHERTYPE_VEECO", - "ETHERTYPE_VEXP", - "ETHERTYPE_VGLAB", - "ETHERTYPE_VINES", - "ETHERTYPE_VINESECHO", - "ETHERTYPE_VINESLOOP", - "ETHERTYPE_VITAL", - "ETHERTYPE_VLAN", - "ETHERTYPE_VLTLMAN", - "ETHERTYPE_VPROD", - "ETHERTYPE_VURESERVED", - "ETHERTYPE_WATERLOO", - "ETHERTYPE_WELLFLEET", - "ETHERTYPE_X25", - "ETHERTYPE_X75", - "ETHERTYPE_XNSSM", - "ETHERTYPE_XTP", - "ETHER_ADDR_LEN", - "ETHER_ALIGN", - "ETHER_CRC_LEN", - "ETHER_CRC_POLY_BE", - "ETHER_CRC_POLY_LE", - "ETHER_HDR_LEN", - "ETHER_MAX_DIX_LEN", - "ETHER_MAX_LEN", - "ETHER_MAX_LEN_JUMBO", - "ETHER_MIN_LEN", - "ETHER_PPPOE_ENCAP_LEN", - "ETHER_TYPE_LEN", - "ETHER_VLAN_ENCAP_LEN", - "ETH_P_1588", - "ETH_P_8021Q", - "ETH_P_802_2", - "ETH_P_802_3", - "ETH_P_AARP", - "ETH_P_ALL", - "ETH_P_AOE", - "ETH_P_ARCNET", - "ETH_P_ARP", - "ETH_P_ATALK", - "ETH_P_ATMFATE", - "ETH_P_ATMMPOA", - "ETH_P_AX25", - "ETH_P_BPQ", - "ETH_P_CAIF", - "ETH_P_CAN", - "ETH_P_CONTROL", - "ETH_P_CUST", - "ETH_P_DDCMP", - "ETH_P_DEC", - "ETH_P_DIAG", - "ETH_P_DNA_DL", - "ETH_P_DNA_RC", - "ETH_P_DNA_RT", - "ETH_P_DSA", - "ETH_P_ECONET", - "ETH_P_EDSA", - "ETH_P_FCOE", - "ETH_P_FIP", - "ETH_P_HDLC", - "ETH_P_IEEE802154", - "ETH_P_IEEEPUP", - "ETH_P_IEEEPUPAT", - "ETH_P_IP", - "ETH_P_IPV6", - "ETH_P_IPX", - "ETH_P_IRDA", - "ETH_P_LAT", - "ETH_P_LINK_CTL", - "ETH_P_LOCALTALK", - "ETH_P_LOOP", - "ETH_P_MOBITEX", - "ETH_P_MPLS_MC", - "ETH_P_MPLS_UC", - "ETH_P_PAE", - "ETH_P_PAUSE", - "ETH_P_PHONET", - "ETH_P_PPPTALK", - "ETH_P_PPP_DISC", - "ETH_P_PPP_MP", - "ETH_P_PPP_SES", - "ETH_P_PUP", - "ETH_P_PUPAT", - "ETH_P_RARP", - "ETH_P_SCA", - "ETH_P_SLOW", - "ETH_P_SNAP", - "ETH_P_TEB", - "ETH_P_TIPC", - "ETH_P_TRAILER", - "ETH_P_TR_802_2", - "ETH_P_WAN_PPP", - "ETH_P_WCCP", - "ETH_P_X25", - "ETIME", - "ETIMEDOUT", - "ETOOMANYREFS", - "ETXTBSY", - "EUCLEAN", - "EUNATCH", - "EUSERS", - "EVFILT_AIO", - "EVFILT_FS", - "EVFILT_LIO", - "EVFILT_MACHPORT", - "EVFILT_PROC", - "EVFILT_READ", - "EVFILT_SIGNAL", - "EVFILT_SYSCOUNT", - "EVFILT_THREADMARKER", - "EVFILT_TIMER", - "EVFILT_USER", - "EVFILT_VM", - "EVFILT_VNODE", - "EVFILT_WRITE", - "EV_ADD", - "EV_CLEAR", - "EV_DELETE", - "EV_DISABLE", - "EV_DISPATCH", - "EV_DROP", - "EV_ENABLE", - "EV_EOF", - "EV_ERROR", - "EV_FLAG0", - "EV_FLAG1", - "EV_ONESHOT", - "EV_OOBAND", - "EV_POLL", - "EV_RECEIPT", - "EV_SYSFLAGS", - "EWINDOWS", - "EWOULDBLOCK", - "EXDEV", - "EXFULL", - "EXTA", - "EXTB", - "EXTPROC", - "Environ", - "EpollCreate", - "EpollCreate1", - "EpollCtl", - "EpollEvent", - "EpollWait", - "Errno", - "EscapeArg", - "Exchangedata", - "Exec", - "Exit", - "ExitProcess", - "FD_CLOEXEC", - "FD_SETSIZE", - "FILE_ACTION_ADDED", - "FILE_ACTION_MODIFIED", - "FILE_ACTION_REMOVED", - "FILE_ACTION_RENAMED_NEW_NAME", - "FILE_ACTION_RENAMED_OLD_NAME", - "FILE_APPEND_DATA", - "FILE_ATTRIBUTE_ARCHIVE", - "FILE_ATTRIBUTE_DIRECTORY", - "FILE_ATTRIBUTE_HIDDEN", - "FILE_ATTRIBUTE_NORMAL", - "FILE_ATTRIBUTE_READONLY", - "FILE_ATTRIBUTE_REPARSE_POINT", - "FILE_ATTRIBUTE_SYSTEM", - "FILE_BEGIN", - "FILE_CURRENT", - "FILE_END", - "FILE_FLAG_BACKUP_SEMANTICS", - "FILE_FLAG_OPEN_REPARSE_POINT", - "FILE_FLAG_OVERLAPPED", - "FILE_LIST_DIRECTORY", - "FILE_MAP_COPY", - "FILE_MAP_EXECUTE", - "FILE_MAP_READ", - "FILE_MAP_WRITE", - "FILE_NOTIFY_CHANGE_ATTRIBUTES", - "FILE_NOTIFY_CHANGE_CREATION", - "FILE_NOTIFY_CHANGE_DIR_NAME", - "FILE_NOTIFY_CHANGE_FILE_NAME", - "FILE_NOTIFY_CHANGE_LAST_ACCESS", - "FILE_NOTIFY_CHANGE_LAST_WRITE", - "FILE_NOTIFY_CHANGE_SIZE", - "FILE_SHARE_DELETE", - "FILE_SHARE_READ", - "FILE_SHARE_WRITE", - "FILE_SKIP_COMPLETION_PORT_ON_SUCCESS", - "FILE_SKIP_SET_EVENT_ON_HANDLE", - "FILE_TYPE_CHAR", - "FILE_TYPE_DISK", - "FILE_TYPE_PIPE", - "FILE_TYPE_REMOTE", - "FILE_TYPE_UNKNOWN", - "FILE_WRITE_ATTRIBUTES", - "FLUSHO", - "FORMAT_MESSAGE_ALLOCATE_BUFFER", - "FORMAT_MESSAGE_ARGUMENT_ARRAY", - "FORMAT_MESSAGE_FROM_HMODULE", - "FORMAT_MESSAGE_FROM_STRING", - "FORMAT_MESSAGE_FROM_SYSTEM", - "FORMAT_MESSAGE_IGNORE_INSERTS", - "FORMAT_MESSAGE_MAX_WIDTH_MASK", - "FSCTL_GET_REPARSE_POINT", - "F_ADDFILESIGS", - "F_ADDSIGS", - "F_ALLOCATEALL", - "F_ALLOCATECONTIG", - "F_CANCEL", - "F_CHKCLEAN", - "F_CLOSEM", - "F_DUP2FD", - "F_DUP2FD_CLOEXEC", - "F_DUPFD", - "F_DUPFD_CLOEXEC", - "F_EXLCK", - "F_FINDSIGS", - "F_FLUSH_DATA", - "F_FREEZE_FS", - "F_FSCTL", - "F_FSDIRMASK", - "F_FSIN", - "F_FSINOUT", - "F_FSOUT", - "F_FSPRIV", - "F_FSVOID", - "F_FULLFSYNC", - "F_GETCODEDIR", - "F_GETFD", - "F_GETFL", - "F_GETLEASE", - "F_GETLK", - "F_GETLK64", - "F_GETLKPID", - "F_GETNOSIGPIPE", - "F_GETOWN", - "F_GETOWN_EX", - "F_GETPATH", - "F_GETPATH_MTMINFO", - "F_GETPIPE_SZ", - "F_GETPROTECTIONCLASS", - "F_GETPROTECTIONLEVEL", - "F_GETSIG", - "F_GLOBAL_NOCACHE", - "F_LOCK", - "F_LOG2PHYS", - "F_LOG2PHYS_EXT", - "F_MARKDEPENDENCY", - "F_MAXFD", - "F_NOCACHE", - "F_NODIRECT", - "F_NOTIFY", - "F_OGETLK", - "F_OK", - "F_OSETLK", - "F_OSETLKW", - "F_PARAM_MASK", - "F_PARAM_MAX", - "F_PATHPKG_CHECK", - "F_PEOFPOSMODE", - "F_PREALLOCATE", - "F_RDADVISE", - "F_RDAHEAD", - "F_RDLCK", - "F_READAHEAD", - "F_READBOOTSTRAP", - "F_SETBACKINGSTORE", - "F_SETFD", - "F_SETFL", - "F_SETLEASE", - "F_SETLK", - "F_SETLK64", - "F_SETLKW", - "F_SETLKW64", - "F_SETLKWTIMEOUT", - "F_SETLK_REMOTE", - "F_SETNOSIGPIPE", - "F_SETOWN", - "F_SETOWN_EX", - "F_SETPIPE_SZ", - "F_SETPROTECTIONCLASS", - "F_SETSIG", - "F_SETSIZE", - "F_SHLCK", - "F_SINGLE_WRITER", - "F_TEST", - "F_THAW_FS", - "F_TLOCK", - "F_TRANSCODEKEY", - "F_ULOCK", - "F_UNLCK", - "F_UNLCKSYS", - "F_VOLPOSMODE", - "F_WRITEBOOTSTRAP", - "F_WRLCK", - "Faccessat", - "Fallocate", - "Fbootstraptransfer_t", - "Fchdir", - "Fchflags", - "Fchmod", - "Fchmodat", - "Fchown", - "Fchownat", - "FcntlFlock", - "FdSet", - "Fdatasync", - "FileNotifyInformation", - "Filetime", - "FindClose", - "FindFirstFile", - "FindNextFile", - "Flock", - "Flock_t", - "FlushBpf", - "FlushFileBuffers", - "FlushViewOfFile", - "ForkExec", - "ForkLock", - "FormatMessage", - "Fpathconf", - "FreeAddrInfoW", - "FreeEnvironmentStrings", - "FreeLibrary", - "Fsid", - "Fstat", - "Fstatat", - "Fstatfs", - "Fstore_t", - "Fsync", - "Ftruncate", - "FullPath", - "Futimes", - "Futimesat", - "GENERIC_ALL", - "GENERIC_EXECUTE", - "GENERIC_READ", - "GENERIC_WRITE", - "GUID", - "GetAcceptExSockaddrs", - "GetAdaptersInfo", - "GetAddrInfoW", - "GetCommandLine", - "GetComputerName", - "GetConsoleMode", - "GetCurrentDirectory", - "GetCurrentProcess", - "GetEnvironmentStrings", - "GetEnvironmentVariable", - "GetExitCodeProcess", - "GetFileAttributes", - "GetFileAttributesEx", - "GetFileExInfoStandard", - "GetFileExMaxInfoLevel", - "GetFileInformationByHandle", - "GetFileType", - "GetFullPathName", - "GetHostByName", - "GetIfEntry", - "GetLastError", - "GetLengthSid", - "GetLongPathName", - "GetProcAddress", - "GetProcessTimes", - "GetProtoByName", - "GetQueuedCompletionStatus", - "GetServByName", - "GetShortPathName", - "GetStartupInfo", - "GetStdHandle", - "GetSystemTimeAsFileTime", - "GetTempPath", - "GetTimeZoneInformation", - "GetTokenInformation", - "GetUserNameEx", - "GetUserProfileDirectory", - "GetVersion", - "Getcwd", - "Getdents", - "Getdirentries", - "Getdtablesize", - "Getegid", - "Getenv", - "Geteuid", - "Getfsstat", - "Getgid", - "Getgroups", - "Getpagesize", - "Getpeername", - "Getpgid", - "Getpgrp", - "Getpid", - "Getppid", - "Getpriority", - "Getrlimit", - "Getrusage", - "Getsid", - "Getsockname", - "Getsockopt", - "GetsockoptByte", - "GetsockoptICMPv6Filter", - "GetsockoptIPMreq", - "GetsockoptIPMreqn", - "GetsockoptIPv6MTUInfo", - "GetsockoptIPv6Mreq", - "GetsockoptInet4Addr", - "GetsockoptInt", - "GetsockoptUcred", - "Gettid", - "Gettimeofday", - "Getuid", - "Getwd", - "Getxattr", - "HANDLE_FLAG_INHERIT", - "HKEY_CLASSES_ROOT", - "HKEY_CURRENT_CONFIG", - "HKEY_CURRENT_USER", - "HKEY_DYN_DATA", - "HKEY_LOCAL_MACHINE", - "HKEY_PERFORMANCE_DATA", - "HKEY_USERS", - "HUPCL", - "Handle", - "Hostent", - "ICANON", - "ICMP6_FILTER", - "ICMPV6_FILTER", - "ICMPv6Filter", - "ICRNL", - "IEXTEN", - "IFAN_ARRIVAL", - "IFAN_DEPARTURE", - "IFA_ADDRESS", - "IFA_ANYCAST", - "IFA_BROADCAST", - "IFA_CACHEINFO", - "IFA_F_DADFAILED", - "IFA_F_DEPRECATED", - "IFA_F_HOMEADDRESS", - "IFA_F_NODAD", - "IFA_F_OPTIMISTIC", - "IFA_F_PERMANENT", - "IFA_F_SECONDARY", - "IFA_F_TEMPORARY", - "IFA_F_TENTATIVE", - "IFA_LABEL", - "IFA_LOCAL", - "IFA_MAX", - "IFA_MULTICAST", - "IFA_ROUTE", - "IFA_UNSPEC", - "IFF_ALLMULTI", - "IFF_ALTPHYS", - "IFF_AUTOMEDIA", - "IFF_BROADCAST", - "IFF_CANTCHANGE", - "IFF_CANTCONFIG", - "IFF_DEBUG", - "IFF_DRV_OACTIVE", - "IFF_DRV_RUNNING", - "IFF_DYING", - "IFF_DYNAMIC", - "IFF_LINK0", - "IFF_LINK1", - "IFF_LINK2", - "IFF_LOOPBACK", - "IFF_MASTER", - "IFF_MONITOR", - "IFF_MULTICAST", - "IFF_NOARP", - "IFF_NOTRAILERS", - "IFF_NO_PI", - "IFF_OACTIVE", - "IFF_ONE_QUEUE", - "IFF_POINTOPOINT", - "IFF_POINTTOPOINT", - "IFF_PORTSEL", - "IFF_PPROMISC", - "IFF_PROMISC", - "IFF_RENAMING", - "IFF_RUNNING", - "IFF_SIMPLEX", - "IFF_SLAVE", - "IFF_SMART", - "IFF_STATICARP", - "IFF_TAP", - "IFF_TUN", - "IFF_TUN_EXCL", - "IFF_UP", - "IFF_VNET_HDR", - "IFLA_ADDRESS", - "IFLA_BROADCAST", - "IFLA_COST", - "IFLA_IFALIAS", - "IFLA_IFNAME", - "IFLA_LINK", - "IFLA_LINKINFO", - "IFLA_LINKMODE", - "IFLA_MAP", - "IFLA_MASTER", - "IFLA_MAX", - "IFLA_MTU", - "IFLA_NET_NS_PID", - "IFLA_OPERSTATE", - "IFLA_PRIORITY", - "IFLA_PROTINFO", - "IFLA_QDISC", - "IFLA_STATS", - "IFLA_TXQLEN", - "IFLA_UNSPEC", - "IFLA_WEIGHT", - "IFLA_WIRELESS", - "IFNAMSIZ", - "IFT_1822", - "IFT_A12MPPSWITCH", - "IFT_AAL2", - "IFT_AAL5", - "IFT_ADSL", - "IFT_AFLANE8023", - "IFT_AFLANE8025", - "IFT_ARAP", - "IFT_ARCNET", - "IFT_ARCNETPLUS", - "IFT_ASYNC", - "IFT_ATM", - "IFT_ATMDXI", - "IFT_ATMFUNI", - "IFT_ATMIMA", - "IFT_ATMLOGICAL", - "IFT_ATMRADIO", - "IFT_ATMSUBINTERFACE", - "IFT_ATMVCIENDPT", - "IFT_ATMVIRTUAL", - "IFT_BGPPOLICYACCOUNTING", - "IFT_BLUETOOTH", - "IFT_BRIDGE", - "IFT_BSC", - "IFT_CARP", - "IFT_CCTEMUL", - "IFT_CELLULAR", - "IFT_CEPT", - "IFT_CES", - "IFT_CHANNEL", - "IFT_CNR", - "IFT_COFFEE", - "IFT_COMPOSITELINK", - "IFT_DCN", - "IFT_DIGITALPOWERLINE", - "IFT_DIGITALWRAPPEROVERHEADCHANNEL", - "IFT_DLSW", - "IFT_DOCSCABLEDOWNSTREAM", - "IFT_DOCSCABLEMACLAYER", - "IFT_DOCSCABLEUPSTREAM", - "IFT_DOCSCABLEUPSTREAMCHANNEL", - "IFT_DS0", - "IFT_DS0BUNDLE", - "IFT_DS1FDL", - "IFT_DS3", - "IFT_DTM", - "IFT_DUMMY", - "IFT_DVBASILN", - "IFT_DVBASIOUT", - "IFT_DVBRCCDOWNSTREAM", - "IFT_DVBRCCMACLAYER", - "IFT_DVBRCCUPSTREAM", - "IFT_ECONET", - "IFT_ENC", - "IFT_EON", - "IFT_EPLRS", - "IFT_ESCON", - "IFT_ETHER", - "IFT_FAITH", - "IFT_FAST", - "IFT_FASTETHER", - "IFT_FASTETHERFX", - "IFT_FDDI", - "IFT_FIBRECHANNEL", - "IFT_FRAMERELAYINTERCONNECT", - "IFT_FRAMERELAYMPI", - "IFT_FRDLCIENDPT", - "IFT_FRELAY", - "IFT_FRELAYDCE", - "IFT_FRF16MFRBUNDLE", - "IFT_FRFORWARD", - "IFT_G703AT2MB", - "IFT_G703AT64K", - "IFT_GIF", - "IFT_GIGABITETHERNET", - "IFT_GR303IDT", - "IFT_GR303RDT", - "IFT_H323GATEKEEPER", - "IFT_H323PROXY", - "IFT_HDH1822", - "IFT_HDLC", - "IFT_HDSL2", - "IFT_HIPERLAN2", - "IFT_HIPPI", - "IFT_HIPPIINTERFACE", - "IFT_HOSTPAD", - "IFT_HSSI", - "IFT_HY", - "IFT_IBM370PARCHAN", - "IFT_IDSL", - "IFT_IEEE1394", - "IFT_IEEE80211", - "IFT_IEEE80212", - "IFT_IEEE8023ADLAG", - "IFT_IFGSN", - "IFT_IMT", - "IFT_INFINIBAND", - "IFT_INTERLEAVE", - "IFT_IP", - "IFT_IPFORWARD", - "IFT_IPOVERATM", - "IFT_IPOVERCDLC", - "IFT_IPOVERCLAW", - "IFT_IPSWITCH", - "IFT_IPXIP", - "IFT_ISDN", - "IFT_ISDNBASIC", - "IFT_ISDNPRIMARY", - "IFT_ISDNS", - "IFT_ISDNU", - "IFT_ISO88022LLC", - "IFT_ISO88023", - "IFT_ISO88024", - "IFT_ISO88025", - "IFT_ISO88025CRFPINT", - "IFT_ISO88025DTR", - "IFT_ISO88025FIBER", - "IFT_ISO88026", - "IFT_ISUP", - "IFT_L2VLAN", - "IFT_L3IPVLAN", - "IFT_L3IPXVLAN", - "IFT_LAPB", - "IFT_LAPD", - "IFT_LAPF", - "IFT_LINEGROUP", - "IFT_LOCALTALK", - "IFT_LOOP", - "IFT_MEDIAMAILOVERIP", - "IFT_MFSIGLINK", - "IFT_MIOX25", - "IFT_MODEM", - "IFT_MPC", - "IFT_MPLS", - "IFT_MPLSTUNNEL", - "IFT_MSDSL", - "IFT_MVL", - "IFT_MYRINET", - "IFT_NFAS", - "IFT_NSIP", - "IFT_OPTICALCHANNEL", - "IFT_OPTICALTRANSPORT", - "IFT_OTHER", - "IFT_P10", - "IFT_P80", - "IFT_PARA", - "IFT_PDP", - "IFT_PFLOG", - "IFT_PFLOW", - "IFT_PFSYNC", - "IFT_PLC", - "IFT_PON155", - "IFT_PON622", - "IFT_POS", - "IFT_PPP", - "IFT_PPPMULTILINKBUNDLE", - "IFT_PROPATM", - "IFT_PROPBWAP2MP", - "IFT_PROPCNLS", - "IFT_PROPDOCSWIRELESSDOWNSTREAM", - "IFT_PROPDOCSWIRELESSMACLAYER", - "IFT_PROPDOCSWIRELESSUPSTREAM", - "IFT_PROPMUX", - "IFT_PROPVIRTUAL", - "IFT_PROPWIRELESSP2P", - "IFT_PTPSERIAL", - "IFT_PVC", - "IFT_Q2931", - "IFT_QLLC", - "IFT_RADIOMAC", - "IFT_RADSL", - "IFT_REACHDSL", - "IFT_RFC1483", - "IFT_RS232", - "IFT_RSRB", - "IFT_SDLC", - "IFT_SDSL", - "IFT_SHDSL", - "IFT_SIP", - "IFT_SIPSIG", - "IFT_SIPTG", - "IFT_SLIP", - "IFT_SMDSDXI", - "IFT_SMDSICIP", - "IFT_SONET", - "IFT_SONETOVERHEADCHANNEL", - "IFT_SONETPATH", - "IFT_SONETVT", - "IFT_SRP", - "IFT_SS7SIGLINK", - "IFT_STACKTOSTACK", - "IFT_STARLAN", - "IFT_STF", - "IFT_T1", - "IFT_TDLC", - "IFT_TELINK", - "IFT_TERMPAD", - "IFT_TR008", - "IFT_TRANSPHDLC", - "IFT_TUNNEL", - "IFT_ULTRA", - "IFT_USB", - "IFT_V11", - "IFT_V35", - "IFT_V36", - "IFT_V37", - "IFT_VDSL", - "IFT_VIRTUALIPADDRESS", - "IFT_VIRTUALTG", - "IFT_VOICEDID", - "IFT_VOICEEM", - "IFT_VOICEEMFGD", - "IFT_VOICEENCAP", - "IFT_VOICEFGDEANA", - "IFT_VOICEFXO", - "IFT_VOICEFXS", - "IFT_VOICEOVERATM", - "IFT_VOICEOVERCABLE", - "IFT_VOICEOVERFRAMERELAY", - "IFT_VOICEOVERIP", - "IFT_X213", - "IFT_X25", - "IFT_X25DDN", - "IFT_X25HUNTGROUP", - "IFT_X25MLP", - "IFT_X25PLE", - "IFT_XETHER", - "IGNBRK", - "IGNCR", - "IGNORE", - "IGNPAR", - "IMAXBEL", - "INFINITE", - "INLCR", - "INPCK", - "INVALID_FILE_ATTRIBUTES", - "IN_ACCESS", - "IN_ALL_EVENTS", - "IN_ATTRIB", - "IN_CLASSA_HOST", - "IN_CLASSA_MAX", - "IN_CLASSA_NET", - "IN_CLASSA_NSHIFT", - "IN_CLASSB_HOST", - "IN_CLASSB_MAX", - "IN_CLASSB_NET", - "IN_CLASSB_NSHIFT", - "IN_CLASSC_HOST", - "IN_CLASSC_NET", - "IN_CLASSC_NSHIFT", - "IN_CLASSD_HOST", - "IN_CLASSD_NET", - "IN_CLASSD_NSHIFT", - "IN_CLOEXEC", - "IN_CLOSE", - "IN_CLOSE_NOWRITE", - "IN_CLOSE_WRITE", - "IN_CREATE", - "IN_DELETE", - "IN_DELETE_SELF", - "IN_DONT_FOLLOW", - "IN_EXCL_UNLINK", - "IN_IGNORED", - "IN_ISDIR", - "IN_LINKLOCALNETNUM", - "IN_LOOPBACKNET", - "IN_MASK_ADD", - "IN_MODIFY", - "IN_MOVE", - "IN_MOVED_FROM", - "IN_MOVED_TO", - "IN_MOVE_SELF", - "IN_NONBLOCK", - "IN_ONESHOT", - "IN_ONLYDIR", - "IN_OPEN", - "IN_Q_OVERFLOW", - "IN_RFC3021_HOST", - "IN_RFC3021_MASK", - "IN_RFC3021_NET", - "IN_RFC3021_NSHIFT", - "IN_UNMOUNT", - "IOC_IN", - "IOC_INOUT", - "IOC_OUT", - "IOC_VENDOR", - "IOC_WS2", - "IO_REPARSE_TAG_SYMLINK", - "IPMreq", - "IPMreqn", - "IPPROTO_3PC", - "IPPROTO_ADFS", - "IPPROTO_AH", - "IPPROTO_AHIP", - "IPPROTO_APES", - "IPPROTO_ARGUS", - "IPPROTO_AX25", - "IPPROTO_BHA", - "IPPROTO_BLT", - "IPPROTO_BRSATMON", - "IPPROTO_CARP", - "IPPROTO_CFTP", - "IPPROTO_CHAOS", - "IPPROTO_CMTP", - "IPPROTO_COMP", - "IPPROTO_CPHB", - "IPPROTO_CPNX", - "IPPROTO_DCCP", - "IPPROTO_DDP", - "IPPROTO_DGP", - "IPPROTO_DIVERT", - "IPPROTO_DIVERT_INIT", - "IPPROTO_DIVERT_RESP", - "IPPROTO_DONE", - "IPPROTO_DSTOPTS", - "IPPROTO_EGP", - "IPPROTO_EMCON", - "IPPROTO_ENCAP", - "IPPROTO_EON", - "IPPROTO_ESP", - "IPPROTO_ETHERIP", - "IPPROTO_FRAGMENT", - "IPPROTO_GGP", - "IPPROTO_GMTP", - "IPPROTO_GRE", - "IPPROTO_HELLO", - "IPPROTO_HMP", - "IPPROTO_HOPOPTS", - "IPPROTO_ICMP", - "IPPROTO_ICMPV6", - "IPPROTO_IDP", - "IPPROTO_IDPR", - "IPPROTO_IDRP", - "IPPROTO_IGMP", - "IPPROTO_IGP", - "IPPROTO_IGRP", - "IPPROTO_IL", - "IPPROTO_INLSP", - "IPPROTO_INP", - "IPPROTO_IP", - "IPPROTO_IPCOMP", - "IPPROTO_IPCV", - "IPPROTO_IPEIP", - "IPPROTO_IPIP", - "IPPROTO_IPPC", - "IPPROTO_IPV4", - "IPPROTO_IPV6", - "IPPROTO_IPV6_ICMP", - "IPPROTO_IRTP", - "IPPROTO_KRYPTOLAN", - "IPPROTO_LARP", - "IPPROTO_LEAF1", - "IPPROTO_LEAF2", - "IPPROTO_MAX", - "IPPROTO_MAXID", - "IPPROTO_MEAS", - "IPPROTO_MH", - "IPPROTO_MHRP", - "IPPROTO_MICP", - "IPPROTO_MOBILE", - "IPPROTO_MPLS", - "IPPROTO_MTP", - "IPPROTO_MUX", - "IPPROTO_ND", - "IPPROTO_NHRP", - "IPPROTO_NONE", - "IPPROTO_NSP", - "IPPROTO_NVPII", - "IPPROTO_OLD_DIVERT", - "IPPROTO_OSPFIGP", - "IPPROTO_PFSYNC", - "IPPROTO_PGM", - "IPPROTO_PIGP", - "IPPROTO_PIM", - "IPPROTO_PRM", - "IPPROTO_PUP", - "IPPROTO_PVP", - "IPPROTO_RAW", - "IPPROTO_RCCMON", - "IPPROTO_RDP", - "IPPROTO_ROUTING", - "IPPROTO_RSVP", - "IPPROTO_RVD", - "IPPROTO_SATEXPAK", - "IPPROTO_SATMON", - "IPPROTO_SCCSP", - "IPPROTO_SCTP", - "IPPROTO_SDRP", - "IPPROTO_SEND", - "IPPROTO_SEP", - "IPPROTO_SKIP", - "IPPROTO_SPACER", - "IPPROTO_SRPC", - "IPPROTO_ST", - "IPPROTO_SVMTP", - "IPPROTO_SWIPE", - "IPPROTO_TCF", - "IPPROTO_TCP", - "IPPROTO_TLSP", - "IPPROTO_TP", - "IPPROTO_TPXX", - "IPPROTO_TRUNK1", - "IPPROTO_TRUNK2", - "IPPROTO_TTP", - "IPPROTO_UDP", - "IPPROTO_UDPLITE", - "IPPROTO_VINES", - "IPPROTO_VISA", - "IPPROTO_VMTP", - "IPPROTO_VRRP", - "IPPROTO_WBEXPAK", - "IPPROTO_WBMON", - "IPPROTO_WSN", - "IPPROTO_XNET", - "IPPROTO_XTP", - "IPV6_2292DSTOPTS", - "IPV6_2292HOPLIMIT", - "IPV6_2292HOPOPTS", - "IPV6_2292NEXTHOP", - "IPV6_2292PKTINFO", - "IPV6_2292PKTOPTIONS", - "IPV6_2292RTHDR", - "IPV6_ADDRFORM", - "IPV6_ADD_MEMBERSHIP", - "IPV6_AUTHHDR", - "IPV6_AUTH_LEVEL", - "IPV6_AUTOFLOWLABEL", - "IPV6_BINDANY", - "IPV6_BINDV6ONLY", - "IPV6_BOUND_IF", - "IPV6_CHECKSUM", - "IPV6_DEFAULT_MULTICAST_HOPS", - "IPV6_DEFAULT_MULTICAST_LOOP", - "IPV6_DEFHLIM", - "IPV6_DONTFRAG", - "IPV6_DROP_MEMBERSHIP", - "IPV6_DSTOPTS", - "IPV6_ESP_NETWORK_LEVEL", - "IPV6_ESP_TRANS_LEVEL", - "IPV6_FAITH", - "IPV6_FLOWINFO_MASK", - "IPV6_FLOWLABEL_MASK", - "IPV6_FRAGTTL", - "IPV6_FW_ADD", - "IPV6_FW_DEL", - "IPV6_FW_FLUSH", - "IPV6_FW_GET", - "IPV6_FW_ZERO", - "IPV6_HLIMDEC", - "IPV6_HOPLIMIT", - "IPV6_HOPOPTS", - "IPV6_IPCOMP_LEVEL", - "IPV6_IPSEC_POLICY", - "IPV6_JOIN_ANYCAST", - "IPV6_JOIN_GROUP", - "IPV6_LEAVE_ANYCAST", - "IPV6_LEAVE_GROUP", - "IPV6_MAXHLIM", - "IPV6_MAXOPTHDR", - "IPV6_MAXPACKET", - "IPV6_MAX_GROUP_SRC_FILTER", - "IPV6_MAX_MEMBERSHIPS", - "IPV6_MAX_SOCK_SRC_FILTER", - "IPV6_MIN_MEMBERSHIPS", - "IPV6_MMTU", - "IPV6_MSFILTER", - "IPV6_MTU", - "IPV6_MTU_DISCOVER", - "IPV6_MULTICAST_HOPS", - "IPV6_MULTICAST_IF", - "IPV6_MULTICAST_LOOP", - "IPV6_NEXTHOP", - "IPV6_OPTIONS", - "IPV6_PATHMTU", - "IPV6_PIPEX", - "IPV6_PKTINFO", - "IPV6_PMTUDISC_DO", - "IPV6_PMTUDISC_DONT", - "IPV6_PMTUDISC_PROBE", - "IPV6_PMTUDISC_WANT", - "IPV6_PORTRANGE", - "IPV6_PORTRANGE_DEFAULT", - "IPV6_PORTRANGE_HIGH", - "IPV6_PORTRANGE_LOW", - "IPV6_PREFER_TEMPADDR", - "IPV6_RECVDSTOPTS", - "IPV6_RECVDSTPORT", - "IPV6_RECVERR", - "IPV6_RECVHOPLIMIT", - "IPV6_RECVHOPOPTS", - "IPV6_RECVPATHMTU", - "IPV6_RECVPKTINFO", - "IPV6_RECVRTHDR", - "IPV6_RECVTCLASS", - "IPV6_ROUTER_ALERT", - "IPV6_RTABLE", - "IPV6_RTHDR", - "IPV6_RTHDRDSTOPTS", - "IPV6_RTHDR_LOOSE", - "IPV6_RTHDR_STRICT", - "IPV6_RTHDR_TYPE_0", - "IPV6_RXDSTOPTS", - "IPV6_RXHOPOPTS", - "IPV6_SOCKOPT_RESERVED1", - "IPV6_TCLASS", - "IPV6_UNICAST_HOPS", - "IPV6_USE_MIN_MTU", - "IPV6_V6ONLY", - "IPV6_VERSION", - "IPV6_VERSION_MASK", - "IPV6_XFRM_POLICY", - "IP_ADD_MEMBERSHIP", - "IP_ADD_SOURCE_MEMBERSHIP", - "IP_AUTH_LEVEL", - "IP_BINDANY", - "IP_BLOCK_SOURCE", - "IP_BOUND_IF", - "IP_DEFAULT_MULTICAST_LOOP", - "IP_DEFAULT_MULTICAST_TTL", - "IP_DF", - "IP_DIVERTFL", - "IP_DONTFRAG", - "IP_DROP_MEMBERSHIP", - "IP_DROP_SOURCE_MEMBERSHIP", - "IP_DUMMYNET3", - "IP_DUMMYNET_CONFIGURE", - "IP_DUMMYNET_DEL", - "IP_DUMMYNET_FLUSH", - "IP_DUMMYNET_GET", - "IP_EF", - "IP_ERRORMTU", - "IP_ESP_NETWORK_LEVEL", - "IP_ESP_TRANS_LEVEL", - "IP_FAITH", - "IP_FREEBIND", - "IP_FW3", - "IP_FW_ADD", - "IP_FW_DEL", - "IP_FW_FLUSH", - "IP_FW_GET", - "IP_FW_NAT_CFG", - "IP_FW_NAT_DEL", - "IP_FW_NAT_GET_CONFIG", - "IP_FW_NAT_GET_LOG", - "IP_FW_RESETLOG", - "IP_FW_TABLE_ADD", - "IP_FW_TABLE_DEL", - "IP_FW_TABLE_FLUSH", - "IP_FW_TABLE_GETSIZE", - "IP_FW_TABLE_LIST", - "IP_FW_ZERO", - "IP_HDRINCL", - "IP_IPCOMP_LEVEL", - "IP_IPSECFLOWINFO", - "IP_IPSEC_LOCAL_AUTH", - "IP_IPSEC_LOCAL_CRED", - "IP_IPSEC_LOCAL_ID", - "IP_IPSEC_POLICY", - "IP_IPSEC_REMOTE_AUTH", - "IP_IPSEC_REMOTE_CRED", - "IP_IPSEC_REMOTE_ID", - "IP_MAXPACKET", - "IP_MAX_GROUP_SRC_FILTER", - "IP_MAX_MEMBERSHIPS", - "IP_MAX_SOCK_MUTE_FILTER", - "IP_MAX_SOCK_SRC_FILTER", - "IP_MAX_SOURCE_FILTER", - "IP_MF", - "IP_MINFRAGSIZE", - "IP_MINTTL", - "IP_MIN_MEMBERSHIPS", - "IP_MSFILTER", - "IP_MSS", - "IP_MTU", - "IP_MTU_DISCOVER", - "IP_MULTICAST_IF", - "IP_MULTICAST_IFINDEX", - "IP_MULTICAST_LOOP", - "IP_MULTICAST_TTL", - "IP_MULTICAST_VIF", - "IP_NAT__XXX", - "IP_OFFMASK", - "IP_OLD_FW_ADD", - "IP_OLD_FW_DEL", - "IP_OLD_FW_FLUSH", - "IP_OLD_FW_GET", - "IP_OLD_FW_RESETLOG", - "IP_OLD_FW_ZERO", - "IP_ONESBCAST", - "IP_OPTIONS", - "IP_ORIGDSTADDR", - "IP_PASSSEC", - "IP_PIPEX", - "IP_PKTINFO", - "IP_PKTOPTIONS", - "IP_PMTUDISC", - "IP_PMTUDISC_DO", - "IP_PMTUDISC_DONT", - "IP_PMTUDISC_PROBE", - "IP_PMTUDISC_WANT", - "IP_PORTRANGE", - "IP_PORTRANGE_DEFAULT", - "IP_PORTRANGE_HIGH", - "IP_PORTRANGE_LOW", - "IP_RECVDSTADDR", - "IP_RECVDSTPORT", - "IP_RECVERR", - "IP_RECVIF", - "IP_RECVOPTS", - "IP_RECVORIGDSTADDR", - "IP_RECVPKTINFO", - "IP_RECVRETOPTS", - "IP_RECVRTABLE", - "IP_RECVTOS", - "IP_RECVTTL", - "IP_RETOPTS", - "IP_RF", - "IP_ROUTER_ALERT", - "IP_RSVP_OFF", - "IP_RSVP_ON", - "IP_RSVP_VIF_OFF", - "IP_RSVP_VIF_ON", - "IP_RTABLE", - "IP_SENDSRCADDR", - "IP_STRIPHDR", - "IP_TOS", - "IP_TRAFFIC_MGT_BACKGROUND", - "IP_TRANSPARENT", - "IP_TTL", - "IP_UNBLOCK_SOURCE", - "IP_XFRM_POLICY", - "IPv6MTUInfo", - "IPv6Mreq", - "ISIG", - "ISTRIP", - "IUCLC", - "IUTF8", - "IXANY", - "IXOFF", - "IXON", - "IfAddrmsg", - "IfAnnounceMsghdr", - "IfData", - "IfInfomsg", - "IfMsghdr", - "IfaMsghdr", - "IfmaMsghdr", - "IfmaMsghdr2", - "ImplementsGetwd", - "Inet4Pktinfo", - "Inet6Pktinfo", - "InotifyAddWatch", - "InotifyEvent", - "InotifyInit", - "InotifyInit1", - "InotifyRmWatch", - "InterfaceAddrMessage", - "InterfaceAnnounceMessage", - "InterfaceInfo", - "InterfaceMessage", - "InterfaceMulticastAddrMessage", - "InvalidHandle", - "Ioperm", - "Iopl", - "Iovec", - "IpAdapterInfo", - "IpAddrString", - "IpAddressString", - "IpMaskString", - "Issetugid", - "KEY_ALL_ACCESS", - "KEY_CREATE_LINK", - "KEY_CREATE_SUB_KEY", - "KEY_ENUMERATE_SUB_KEYS", - "KEY_EXECUTE", - "KEY_NOTIFY", - "KEY_QUERY_VALUE", - "KEY_READ", - "KEY_SET_VALUE", - "KEY_WOW64_32KEY", - "KEY_WOW64_64KEY", - "KEY_WRITE", - "Kevent", - "Kevent_t", - "Kill", - "Klogctl", - "Kqueue", - "LANG_ENGLISH", - "LAYERED_PROTOCOL", - "LCNT_OVERLOAD_FLUSH", - "LINUX_REBOOT_CMD_CAD_OFF", - "LINUX_REBOOT_CMD_CAD_ON", - "LINUX_REBOOT_CMD_HALT", - "LINUX_REBOOT_CMD_KEXEC", - "LINUX_REBOOT_CMD_POWER_OFF", - "LINUX_REBOOT_CMD_RESTART", - "LINUX_REBOOT_CMD_RESTART2", - "LINUX_REBOOT_CMD_SW_SUSPEND", - "LINUX_REBOOT_MAGIC1", - "LINUX_REBOOT_MAGIC2", - "LOCK_EX", - "LOCK_NB", - "LOCK_SH", - "LOCK_UN", - "LazyDLL", - "LazyProc", - "Lchown", - "Linger", - "Link", - "Listen", - "Listxattr", - "LoadCancelIoEx", - "LoadConnectEx", - "LoadCreateSymbolicLink", - "LoadDLL", - "LoadGetAddrInfo", - "LoadLibrary", - "LoadSetFileCompletionNotificationModes", - "LocalFree", - "Log2phys_t", - "LookupAccountName", - "LookupAccountSid", - "LookupSID", - "LsfJump", - "LsfSocket", - "LsfStmt", - "Lstat", - "MADV_AUTOSYNC", - "MADV_CAN_REUSE", - "MADV_CORE", - "MADV_DOFORK", - "MADV_DONTFORK", - "MADV_DONTNEED", - "MADV_FREE", - "MADV_FREE_REUSABLE", - "MADV_FREE_REUSE", - "MADV_HUGEPAGE", - "MADV_HWPOISON", - "MADV_MERGEABLE", - "MADV_NOCORE", - "MADV_NOHUGEPAGE", - "MADV_NORMAL", - "MADV_NOSYNC", - "MADV_PROTECT", - "MADV_RANDOM", - "MADV_REMOVE", - "MADV_SEQUENTIAL", - "MADV_SPACEAVAIL", - "MADV_UNMERGEABLE", - "MADV_WILLNEED", - "MADV_ZERO_WIRED_PAGES", - "MAP_32BIT", - "MAP_ALIGNED_SUPER", - "MAP_ALIGNMENT_16MB", - "MAP_ALIGNMENT_1TB", - "MAP_ALIGNMENT_256TB", - "MAP_ALIGNMENT_4GB", - "MAP_ALIGNMENT_64KB", - "MAP_ALIGNMENT_64PB", - "MAP_ALIGNMENT_MASK", - "MAP_ALIGNMENT_SHIFT", - "MAP_ANON", - "MAP_ANONYMOUS", - "MAP_COPY", - "MAP_DENYWRITE", - "MAP_EXECUTABLE", - "MAP_FILE", - "MAP_FIXED", - "MAP_FLAGMASK", - "MAP_GROWSDOWN", - "MAP_HASSEMAPHORE", - "MAP_HUGETLB", - "MAP_INHERIT", - "MAP_INHERIT_COPY", - "MAP_INHERIT_DEFAULT", - "MAP_INHERIT_DONATE_COPY", - "MAP_INHERIT_NONE", - "MAP_INHERIT_SHARE", - "MAP_JIT", - "MAP_LOCKED", - "MAP_NOCACHE", - "MAP_NOCORE", - "MAP_NOEXTEND", - "MAP_NONBLOCK", - "MAP_NORESERVE", - "MAP_NOSYNC", - "MAP_POPULATE", - "MAP_PREFAULT_READ", - "MAP_PRIVATE", - "MAP_RENAME", - "MAP_RESERVED0080", - "MAP_RESERVED0100", - "MAP_SHARED", - "MAP_STACK", - "MAP_TRYFIXED", - "MAP_TYPE", - "MAP_WIRED", - "MAXIMUM_REPARSE_DATA_BUFFER_SIZE", - "MAXLEN_IFDESCR", - "MAXLEN_PHYSADDR", - "MAX_ADAPTER_ADDRESS_LENGTH", - "MAX_ADAPTER_DESCRIPTION_LENGTH", - "MAX_ADAPTER_NAME_LENGTH", - "MAX_COMPUTERNAME_LENGTH", - "MAX_INTERFACE_NAME_LEN", - "MAX_LONG_PATH", - "MAX_PATH", - "MAX_PROTOCOL_CHAIN", - "MCL_CURRENT", - "MCL_FUTURE", - "MNT_DETACH", - "MNT_EXPIRE", - "MNT_FORCE", - "MSG_BCAST", - "MSG_CMSG_CLOEXEC", - "MSG_COMPAT", - "MSG_CONFIRM", - "MSG_CONTROLMBUF", - "MSG_CTRUNC", - "MSG_DONTROUTE", - "MSG_DONTWAIT", - "MSG_EOF", - "MSG_EOR", - "MSG_ERRQUEUE", - "MSG_FASTOPEN", - "MSG_FIN", - "MSG_FLUSH", - "MSG_HAVEMORE", - "MSG_HOLD", - "MSG_IOVUSRSPACE", - "MSG_LENUSRSPACE", - "MSG_MCAST", - "MSG_MORE", - "MSG_NAMEMBUF", - "MSG_NBIO", - "MSG_NEEDSA", - "MSG_NOSIGNAL", - "MSG_NOTIFICATION", - "MSG_OOB", - "MSG_PEEK", - "MSG_PROXY", - "MSG_RCVMORE", - "MSG_RST", - "MSG_SEND", - "MSG_SYN", - "MSG_TRUNC", - "MSG_TRYHARD", - "MSG_USERFLAGS", - "MSG_WAITALL", - "MSG_WAITFORONE", - "MSG_WAITSTREAM", - "MS_ACTIVE", - "MS_ASYNC", - "MS_BIND", - "MS_DEACTIVATE", - "MS_DIRSYNC", - "MS_INVALIDATE", - "MS_I_VERSION", - "MS_KERNMOUNT", - "MS_KILLPAGES", - "MS_MANDLOCK", - "MS_MGC_MSK", - "MS_MGC_VAL", - "MS_MOVE", - "MS_NOATIME", - "MS_NODEV", - "MS_NODIRATIME", - "MS_NOEXEC", - "MS_NOSUID", - "MS_NOUSER", - "MS_POSIXACL", - "MS_PRIVATE", - "MS_RDONLY", - "MS_REC", - "MS_RELATIME", - "MS_REMOUNT", - "MS_RMT_MASK", - "MS_SHARED", - "MS_SILENT", - "MS_SLAVE", - "MS_STRICTATIME", - "MS_SYNC", - "MS_SYNCHRONOUS", - "MS_UNBINDABLE", - "Madvise", - "MapViewOfFile", - "MaxTokenInfoClass", - "Mclpool", - "MibIfRow", - "Mkdir", - "Mkdirat", - "Mkfifo", - "Mknod", - "Mknodat", - "Mlock", - "Mlockall", - "Mmap", - "Mount", - "MoveFile", - "Mprotect", - "Msghdr", - "Munlock", - "Munlockall", - "Munmap", - "MustLoadDLL", - "NAME_MAX", - "NETLINK_ADD_MEMBERSHIP", - "NETLINK_AUDIT", - "NETLINK_BROADCAST_ERROR", - "NETLINK_CONNECTOR", - "NETLINK_DNRTMSG", - "NETLINK_DROP_MEMBERSHIP", - "NETLINK_ECRYPTFS", - "NETLINK_FIB_LOOKUP", - "NETLINK_FIREWALL", - "NETLINK_GENERIC", - "NETLINK_INET_DIAG", - "NETLINK_IP6_FW", - "NETLINK_ISCSI", - "NETLINK_KOBJECT_UEVENT", - "NETLINK_NETFILTER", - "NETLINK_NFLOG", - "NETLINK_NO_ENOBUFS", - "NETLINK_PKTINFO", - "NETLINK_RDMA", - "NETLINK_ROUTE", - "NETLINK_SCSITRANSPORT", - "NETLINK_SELINUX", - "NETLINK_UNUSED", - "NETLINK_USERSOCK", - "NETLINK_XFRM", - "NET_RT_DUMP", - "NET_RT_DUMP2", - "NET_RT_FLAGS", - "NET_RT_IFLIST", - "NET_RT_IFLIST2", - "NET_RT_IFLISTL", - "NET_RT_IFMALIST", - "NET_RT_MAXID", - "NET_RT_OIFLIST", - "NET_RT_OOIFLIST", - "NET_RT_STAT", - "NET_RT_STATS", - "NET_RT_TABLE", - "NET_RT_TRASH", - "NLA_ALIGNTO", - "NLA_F_NESTED", - "NLA_F_NET_BYTEORDER", - "NLA_HDRLEN", - "NLMSG_ALIGNTO", - "NLMSG_DONE", - "NLMSG_ERROR", - "NLMSG_HDRLEN", - "NLMSG_MIN_TYPE", - "NLMSG_NOOP", - "NLMSG_OVERRUN", - "NLM_F_ACK", - "NLM_F_APPEND", - "NLM_F_ATOMIC", - "NLM_F_CREATE", - "NLM_F_DUMP", - "NLM_F_ECHO", - "NLM_F_EXCL", - "NLM_F_MATCH", - "NLM_F_MULTI", - "NLM_F_REPLACE", - "NLM_F_REQUEST", - "NLM_F_ROOT", - "NOFLSH", - "NOTE_ABSOLUTE", - "NOTE_ATTRIB", - "NOTE_BACKGROUND", - "NOTE_CHILD", - "NOTE_CRITICAL", - "NOTE_DELETE", - "NOTE_EOF", - "NOTE_EXEC", - "NOTE_EXIT", - "NOTE_EXITSTATUS", - "NOTE_EXIT_CSERROR", - "NOTE_EXIT_DECRYPTFAIL", - "NOTE_EXIT_DETAIL", - "NOTE_EXIT_DETAIL_MASK", - "NOTE_EXIT_MEMORY", - "NOTE_EXIT_REPARENTED", - "NOTE_EXTEND", - "NOTE_FFAND", - "NOTE_FFCOPY", - "NOTE_FFCTRLMASK", - "NOTE_FFLAGSMASK", - "NOTE_FFNOP", - "NOTE_FFOR", - "NOTE_FORK", - "NOTE_LEEWAY", - "NOTE_LINK", - "NOTE_LOWAT", - "NOTE_NONE", - "NOTE_NSECONDS", - "NOTE_PCTRLMASK", - "NOTE_PDATAMASK", - "NOTE_REAP", - "NOTE_RENAME", - "NOTE_RESOURCEEND", - "NOTE_REVOKE", - "NOTE_SECONDS", - "NOTE_SIGNAL", - "NOTE_TRACK", - "NOTE_TRACKERR", - "NOTE_TRIGGER", - "NOTE_TRUNCATE", - "NOTE_USECONDS", - "NOTE_VM_ERROR", - "NOTE_VM_PRESSURE", - "NOTE_VM_PRESSURE_SUDDEN_TERMINATE", - "NOTE_VM_PRESSURE_TERMINATE", - "NOTE_WRITE", - "NameCanonical", - "NameCanonicalEx", - "NameDisplay", - "NameDnsDomain", - "NameFullyQualifiedDN", - "NameSamCompatible", - "NameServicePrincipal", - "NameUniqueId", - "NameUnknown", - "NameUserPrincipal", - "Nanosleep", - "NetApiBufferFree", - "NetGetJoinInformation", - "NetSetupDomainName", - "NetSetupUnjoined", - "NetSetupUnknownStatus", - "NetSetupWorkgroupName", - "NetUserGetInfo", - "NetlinkMessage", - "NetlinkRIB", - "NetlinkRouteAttr", - "NetlinkRouteRequest", - "NewCallback", - "NewCallbackCDecl", - "NewLazyDLL", - "NlAttr", - "NlMsgerr", - "NlMsghdr", - "NsecToFiletime", - "NsecToTimespec", - "NsecToTimeval", - "Ntohs", - "OCRNL", - "OFDEL", - "OFILL", - "OFIOGETBMAP", - "OID_PKIX_KP_SERVER_AUTH", - "OID_SERVER_GATED_CRYPTO", - "OID_SGC_NETSCAPE", - "OLCUC", - "ONLCR", - "ONLRET", - "ONOCR", - "ONOEOT", - "OPEN_ALWAYS", - "OPEN_EXISTING", - "OPOST", - "O_ACCMODE", - "O_ALERT", - "O_ALT_IO", - "O_APPEND", - "O_ASYNC", - "O_CLOEXEC", - "O_CREAT", - "O_DIRECT", - "O_DIRECTORY", - "O_DP_GETRAWENCRYPTED", - "O_DSYNC", - "O_EVTONLY", - "O_EXCL", - "O_EXEC", - "O_EXLOCK", - "O_FSYNC", - "O_LARGEFILE", - "O_NDELAY", - "O_NOATIME", - "O_NOCTTY", - "O_NOFOLLOW", - "O_NONBLOCK", - "O_NOSIGPIPE", - "O_POPUP", - "O_RDONLY", - "O_RDWR", - "O_RSYNC", - "O_SHLOCK", - "O_SYMLINK", - "O_SYNC", - "O_TRUNC", - "O_TTY_INIT", - "O_WRONLY", - "Open", - "OpenCurrentProcessToken", - "OpenProcess", - "OpenProcessToken", - "Openat", - "Overlapped", - "PACKET_ADD_MEMBERSHIP", - "PACKET_BROADCAST", - "PACKET_DROP_MEMBERSHIP", - "PACKET_FASTROUTE", - "PACKET_HOST", - "PACKET_LOOPBACK", - "PACKET_MR_ALLMULTI", - "PACKET_MR_MULTICAST", - "PACKET_MR_PROMISC", - "PACKET_MULTICAST", - "PACKET_OTHERHOST", - "PACKET_OUTGOING", - "PACKET_RECV_OUTPUT", - "PACKET_RX_RING", - "PACKET_STATISTICS", - "PAGE_EXECUTE_READ", - "PAGE_EXECUTE_READWRITE", - "PAGE_EXECUTE_WRITECOPY", - "PAGE_READONLY", - "PAGE_READWRITE", - "PAGE_WRITECOPY", - "PARENB", - "PARMRK", - "PARODD", - "PENDIN", - "PFL_HIDDEN", - "PFL_MATCHES_PROTOCOL_ZERO", - "PFL_MULTIPLE_PROTO_ENTRIES", - "PFL_NETWORKDIRECT_PROVIDER", - "PFL_RECOMMENDED_PROTO_ENTRY", - "PF_FLUSH", - "PKCS_7_ASN_ENCODING", - "PMC5_PIPELINE_FLUSH", - "PRIO_PGRP", - "PRIO_PROCESS", - "PRIO_USER", - "PRI_IOFLUSH", - "PROCESS_QUERY_INFORMATION", - "PROCESS_TERMINATE", - "PROT_EXEC", - "PROT_GROWSDOWN", - "PROT_GROWSUP", - "PROT_NONE", - "PROT_READ", - "PROT_WRITE", - "PROV_DH_SCHANNEL", - "PROV_DSS", - "PROV_DSS_DH", - "PROV_EC_ECDSA_FULL", - "PROV_EC_ECDSA_SIG", - "PROV_EC_ECNRA_FULL", - "PROV_EC_ECNRA_SIG", - "PROV_FORTEZZA", - "PROV_INTEL_SEC", - "PROV_MS_EXCHANGE", - "PROV_REPLACE_OWF", - "PROV_RNG", - "PROV_RSA_AES", - "PROV_RSA_FULL", - "PROV_RSA_SCHANNEL", - "PROV_RSA_SIG", - "PROV_SPYRUS_LYNKS", - "PROV_SSL", - "PR_CAPBSET_DROP", - "PR_CAPBSET_READ", - "PR_CLEAR_SECCOMP_FILTER", - "PR_ENDIAN_BIG", - "PR_ENDIAN_LITTLE", - "PR_ENDIAN_PPC_LITTLE", - "PR_FPEMU_NOPRINT", - "PR_FPEMU_SIGFPE", - "PR_FP_EXC_ASYNC", - "PR_FP_EXC_DISABLED", - "PR_FP_EXC_DIV", - "PR_FP_EXC_INV", - "PR_FP_EXC_NONRECOV", - "PR_FP_EXC_OVF", - "PR_FP_EXC_PRECISE", - "PR_FP_EXC_RES", - "PR_FP_EXC_SW_ENABLE", - "PR_FP_EXC_UND", - "PR_GET_DUMPABLE", - "PR_GET_ENDIAN", - "PR_GET_FPEMU", - "PR_GET_FPEXC", - "PR_GET_KEEPCAPS", - "PR_GET_NAME", - "PR_GET_PDEATHSIG", - "PR_GET_SECCOMP", - "PR_GET_SECCOMP_FILTER", - "PR_GET_SECUREBITS", - "PR_GET_TIMERSLACK", - "PR_GET_TIMING", - "PR_GET_TSC", - "PR_GET_UNALIGN", - "PR_MCE_KILL", - "PR_MCE_KILL_CLEAR", - "PR_MCE_KILL_DEFAULT", - "PR_MCE_KILL_EARLY", - "PR_MCE_KILL_GET", - "PR_MCE_KILL_LATE", - "PR_MCE_KILL_SET", - "PR_SECCOMP_FILTER_EVENT", - "PR_SECCOMP_FILTER_SYSCALL", - "PR_SET_DUMPABLE", - "PR_SET_ENDIAN", - "PR_SET_FPEMU", - "PR_SET_FPEXC", - "PR_SET_KEEPCAPS", - "PR_SET_NAME", - "PR_SET_PDEATHSIG", - "PR_SET_PTRACER", - "PR_SET_SECCOMP", - "PR_SET_SECCOMP_FILTER", - "PR_SET_SECUREBITS", - "PR_SET_TIMERSLACK", - "PR_SET_TIMING", - "PR_SET_TSC", - "PR_SET_UNALIGN", - "PR_TASK_PERF_EVENTS_DISABLE", - "PR_TASK_PERF_EVENTS_ENABLE", - "PR_TIMING_STATISTICAL", - "PR_TIMING_TIMESTAMP", - "PR_TSC_ENABLE", - "PR_TSC_SIGSEGV", - "PR_UNALIGN_NOPRINT", - "PR_UNALIGN_SIGBUS", - "PTRACE_ARCH_PRCTL", - "PTRACE_ATTACH", - "PTRACE_CONT", - "PTRACE_DETACH", - "PTRACE_EVENT_CLONE", - "PTRACE_EVENT_EXEC", - "PTRACE_EVENT_EXIT", - "PTRACE_EVENT_FORK", - "PTRACE_EVENT_VFORK", - "PTRACE_EVENT_VFORK_DONE", - "PTRACE_GETCRUNCHREGS", - "PTRACE_GETEVENTMSG", - "PTRACE_GETFPREGS", - "PTRACE_GETFPXREGS", - "PTRACE_GETHBPREGS", - "PTRACE_GETREGS", - "PTRACE_GETREGSET", - "PTRACE_GETSIGINFO", - "PTRACE_GETVFPREGS", - "PTRACE_GETWMMXREGS", - "PTRACE_GET_THREAD_AREA", - "PTRACE_KILL", - "PTRACE_OLDSETOPTIONS", - "PTRACE_O_MASK", - "PTRACE_O_TRACECLONE", - "PTRACE_O_TRACEEXEC", - "PTRACE_O_TRACEEXIT", - "PTRACE_O_TRACEFORK", - "PTRACE_O_TRACESYSGOOD", - "PTRACE_O_TRACEVFORK", - "PTRACE_O_TRACEVFORKDONE", - "PTRACE_PEEKDATA", - "PTRACE_PEEKTEXT", - "PTRACE_PEEKUSR", - "PTRACE_POKEDATA", - "PTRACE_POKETEXT", - "PTRACE_POKEUSR", - "PTRACE_SETCRUNCHREGS", - "PTRACE_SETFPREGS", - "PTRACE_SETFPXREGS", - "PTRACE_SETHBPREGS", - "PTRACE_SETOPTIONS", - "PTRACE_SETREGS", - "PTRACE_SETREGSET", - "PTRACE_SETSIGINFO", - "PTRACE_SETVFPREGS", - "PTRACE_SETWMMXREGS", - "PTRACE_SET_SYSCALL", - "PTRACE_SET_THREAD_AREA", - "PTRACE_SINGLEBLOCK", - "PTRACE_SINGLESTEP", - "PTRACE_SYSCALL", - "PTRACE_SYSEMU", - "PTRACE_SYSEMU_SINGLESTEP", - "PTRACE_TRACEME", - "PT_ATTACH", - "PT_ATTACHEXC", - "PT_CONTINUE", - "PT_DATA_ADDR", - "PT_DENY_ATTACH", - "PT_DETACH", - "PT_FIRSTMACH", - "PT_FORCEQUOTA", - "PT_KILL", - "PT_MASK", - "PT_READ_D", - "PT_READ_I", - "PT_READ_U", - "PT_SIGEXC", - "PT_STEP", - "PT_TEXT_ADDR", - "PT_TEXT_END_ADDR", - "PT_THUPDATE", - "PT_TRACE_ME", - "PT_WRITE_D", - "PT_WRITE_I", - "PT_WRITE_U", - "ParseDirent", - "ParseNetlinkMessage", - "ParseNetlinkRouteAttr", - "ParseRoutingMessage", - "ParseRoutingSockaddr", - "ParseSocketControlMessage", - "ParseUnixCredentials", - "ParseUnixRights", - "PathMax", - "Pathconf", - "Pause", - "Pipe", - "Pipe2", - "PivotRoot", - "Pointer", - "PostQueuedCompletionStatus", - "Pread", - "Proc", - "ProcAttr", - "Process32First", - "Process32Next", - "ProcessEntry32", - "ProcessInformation", - "Protoent", - "PtraceAttach", - "PtraceCont", - "PtraceDetach", - "PtraceGetEventMsg", - "PtraceGetRegs", - "PtracePeekData", - "PtracePeekText", - "PtracePokeData", - "PtracePokeText", - "PtraceRegs", - "PtraceSetOptions", - "PtraceSetRegs", - "PtraceSingleStep", - "PtraceSyscall", - "Pwrite", - "REG_BINARY", - "REG_DWORD", - "REG_DWORD_BIG_ENDIAN", - "REG_DWORD_LITTLE_ENDIAN", - "REG_EXPAND_SZ", - "REG_FULL_RESOURCE_DESCRIPTOR", - "REG_LINK", - "REG_MULTI_SZ", - "REG_NONE", - "REG_QWORD", - "REG_QWORD_LITTLE_ENDIAN", - "REG_RESOURCE_LIST", - "REG_RESOURCE_REQUIREMENTS_LIST", - "REG_SZ", - "RLIMIT_AS", - "RLIMIT_CORE", - "RLIMIT_CPU", - "RLIMIT_CPU_USAGE_MONITOR", - "RLIMIT_DATA", - "RLIMIT_FSIZE", - "RLIMIT_NOFILE", - "RLIMIT_STACK", - "RLIM_INFINITY", - "RTAX_ADVMSS", - "RTAX_AUTHOR", - "RTAX_BRD", - "RTAX_CWND", - "RTAX_DST", - "RTAX_FEATURES", - "RTAX_FEATURE_ALLFRAG", - "RTAX_FEATURE_ECN", - "RTAX_FEATURE_SACK", - "RTAX_FEATURE_TIMESTAMP", - "RTAX_GATEWAY", - "RTAX_GENMASK", - "RTAX_HOPLIMIT", - "RTAX_IFA", - "RTAX_IFP", - "RTAX_INITCWND", - "RTAX_INITRWND", - "RTAX_LABEL", - "RTAX_LOCK", - "RTAX_MAX", - "RTAX_MTU", - "RTAX_NETMASK", - "RTAX_REORDERING", - "RTAX_RTO_MIN", - "RTAX_RTT", - "RTAX_RTTVAR", - "RTAX_SRC", - "RTAX_SRCMASK", - "RTAX_SSTHRESH", - "RTAX_TAG", - "RTAX_UNSPEC", - "RTAX_WINDOW", - "RTA_ALIGNTO", - "RTA_AUTHOR", - "RTA_BRD", - "RTA_CACHEINFO", - "RTA_DST", - "RTA_FLOW", - "RTA_GATEWAY", - "RTA_GENMASK", - "RTA_IFA", - "RTA_IFP", - "RTA_IIF", - "RTA_LABEL", - "RTA_MAX", - "RTA_METRICS", - "RTA_MULTIPATH", - "RTA_NETMASK", - "RTA_OIF", - "RTA_PREFSRC", - "RTA_PRIORITY", - "RTA_SRC", - "RTA_SRCMASK", - "RTA_TABLE", - "RTA_TAG", - "RTA_UNSPEC", - "RTCF_DIRECTSRC", - "RTCF_DOREDIRECT", - "RTCF_LOG", - "RTCF_MASQ", - "RTCF_NAT", - "RTCF_VALVE", - "RTF_ADDRCLASSMASK", - "RTF_ADDRCONF", - "RTF_ALLONLINK", - "RTF_ANNOUNCE", - "RTF_BLACKHOLE", - "RTF_BROADCAST", - "RTF_CACHE", - "RTF_CLONED", - "RTF_CLONING", - "RTF_CONDEMNED", - "RTF_DEFAULT", - "RTF_DELCLONE", - "RTF_DONE", - "RTF_DYNAMIC", - "RTF_FLOW", - "RTF_FMASK", - "RTF_GATEWAY", - "RTF_GWFLAG_COMPAT", - "RTF_HOST", - "RTF_IFREF", - "RTF_IFSCOPE", - "RTF_INTERFACE", - "RTF_IRTT", - "RTF_LINKRT", - "RTF_LLDATA", - "RTF_LLINFO", - "RTF_LOCAL", - "RTF_MASK", - "RTF_MODIFIED", - "RTF_MPATH", - "RTF_MPLS", - "RTF_MSS", - "RTF_MTU", - "RTF_MULTICAST", - "RTF_NAT", - "RTF_NOFORWARD", - "RTF_NONEXTHOP", - "RTF_NOPMTUDISC", - "RTF_PERMANENT_ARP", - "RTF_PINNED", - "RTF_POLICY", - "RTF_PRCLONING", - "RTF_PROTO1", - "RTF_PROTO2", - "RTF_PROTO3", - "RTF_PROXY", - "RTF_REINSTATE", - "RTF_REJECT", - "RTF_RNH_LOCKED", - "RTF_ROUTER", - "RTF_SOURCE", - "RTF_SRC", - "RTF_STATIC", - "RTF_STICKY", - "RTF_THROW", - "RTF_TUNNEL", - "RTF_UP", - "RTF_USETRAILERS", - "RTF_WASCLONED", - "RTF_WINDOW", - "RTF_XRESOLVE", - "RTM_ADD", - "RTM_BASE", - "RTM_CHANGE", - "RTM_CHGADDR", - "RTM_DELACTION", - "RTM_DELADDR", - "RTM_DELADDRLABEL", - "RTM_DELETE", - "RTM_DELLINK", - "RTM_DELMADDR", - "RTM_DELNEIGH", - "RTM_DELQDISC", - "RTM_DELROUTE", - "RTM_DELRULE", - "RTM_DELTCLASS", - "RTM_DELTFILTER", - "RTM_DESYNC", - "RTM_F_CLONED", - "RTM_F_EQUALIZE", - "RTM_F_NOTIFY", - "RTM_F_PREFIX", - "RTM_GET", - "RTM_GET2", - "RTM_GETACTION", - "RTM_GETADDR", - "RTM_GETADDRLABEL", - "RTM_GETANYCAST", - "RTM_GETDCB", - "RTM_GETLINK", - "RTM_GETMULTICAST", - "RTM_GETNEIGH", - "RTM_GETNEIGHTBL", - "RTM_GETQDISC", - "RTM_GETROUTE", - "RTM_GETRULE", - "RTM_GETTCLASS", - "RTM_GETTFILTER", - "RTM_IEEE80211", - "RTM_IFANNOUNCE", - "RTM_IFINFO", - "RTM_IFINFO2", - "RTM_LLINFO_UPD", - "RTM_LOCK", - "RTM_LOSING", - "RTM_MAX", - "RTM_MAXSIZE", - "RTM_MISS", - "RTM_NEWACTION", - "RTM_NEWADDR", - "RTM_NEWADDRLABEL", - "RTM_NEWLINK", - "RTM_NEWMADDR", - "RTM_NEWMADDR2", - "RTM_NEWNDUSEROPT", - "RTM_NEWNEIGH", - "RTM_NEWNEIGHTBL", - "RTM_NEWPREFIX", - "RTM_NEWQDISC", - "RTM_NEWROUTE", - "RTM_NEWRULE", - "RTM_NEWTCLASS", - "RTM_NEWTFILTER", - "RTM_NR_FAMILIES", - "RTM_NR_MSGTYPES", - "RTM_OIFINFO", - "RTM_OLDADD", - "RTM_OLDDEL", - "RTM_OOIFINFO", - "RTM_REDIRECT", - "RTM_RESOLVE", - "RTM_RTTUNIT", - "RTM_SETDCB", - "RTM_SETGATE", - "RTM_SETLINK", - "RTM_SETNEIGHTBL", - "RTM_VERSION", - "RTNH_ALIGNTO", - "RTNH_F_DEAD", - "RTNH_F_ONLINK", - "RTNH_F_PERVASIVE", - "RTNLGRP_IPV4_IFADDR", - "RTNLGRP_IPV4_MROUTE", - "RTNLGRP_IPV4_ROUTE", - "RTNLGRP_IPV4_RULE", - "RTNLGRP_IPV6_IFADDR", - "RTNLGRP_IPV6_IFINFO", - "RTNLGRP_IPV6_MROUTE", - "RTNLGRP_IPV6_PREFIX", - "RTNLGRP_IPV6_ROUTE", - "RTNLGRP_IPV6_RULE", - "RTNLGRP_LINK", - "RTNLGRP_ND_USEROPT", - "RTNLGRP_NEIGH", - "RTNLGRP_NONE", - "RTNLGRP_NOTIFY", - "RTNLGRP_TC", - "RTN_ANYCAST", - "RTN_BLACKHOLE", - "RTN_BROADCAST", - "RTN_LOCAL", - "RTN_MAX", - "RTN_MULTICAST", - "RTN_NAT", - "RTN_PROHIBIT", - "RTN_THROW", - "RTN_UNICAST", - "RTN_UNREACHABLE", - "RTN_UNSPEC", - "RTN_XRESOLVE", - "RTPROT_BIRD", - "RTPROT_BOOT", - "RTPROT_DHCP", - "RTPROT_DNROUTED", - "RTPROT_GATED", - "RTPROT_KERNEL", - "RTPROT_MRT", - "RTPROT_NTK", - "RTPROT_RA", - "RTPROT_REDIRECT", - "RTPROT_STATIC", - "RTPROT_UNSPEC", - "RTPROT_XORP", - "RTPROT_ZEBRA", - "RTV_EXPIRE", - "RTV_HOPCOUNT", - "RTV_MTU", - "RTV_RPIPE", - "RTV_RTT", - "RTV_RTTVAR", - "RTV_SPIPE", - "RTV_SSTHRESH", - "RTV_WEIGHT", - "RT_CACHING_CONTEXT", - "RT_CLASS_DEFAULT", - "RT_CLASS_LOCAL", - "RT_CLASS_MAIN", - "RT_CLASS_MAX", - "RT_CLASS_UNSPEC", - "RT_DEFAULT_FIB", - "RT_NORTREF", - "RT_SCOPE_HOST", - "RT_SCOPE_LINK", - "RT_SCOPE_NOWHERE", - "RT_SCOPE_SITE", - "RT_SCOPE_UNIVERSE", - "RT_TABLEID_MAX", - "RT_TABLE_COMPAT", - "RT_TABLE_DEFAULT", - "RT_TABLE_LOCAL", - "RT_TABLE_MAIN", - "RT_TABLE_MAX", - "RT_TABLE_UNSPEC", - "RUSAGE_CHILDREN", - "RUSAGE_SELF", - "RUSAGE_THREAD", - "Radvisory_t", - "RawConn", - "RawSockaddr", - "RawSockaddrAny", - "RawSockaddrDatalink", - "RawSockaddrInet4", - "RawSockaddrInet6", - "RawSockaddrLinklayer", - "RawSockaddrNetlink", - "RawSockaddrUnix", - "RawSyscall", - "RawSyscall6", - "Read", - "ReadConsole", - "ReadDirectoryChanges", - "ReadDirent", - "ReadFile", - "Readlink", - "Reboot", - "Recvfrom", - "Recvmsg", - "RegCloseKey", - "RegEnumKeyEx", - "RegOpenKeyEx", - "RegQueryInfoKey", - "RegQueryValueEx", - "RemoveDirectory", - "Removexattr", - "Rename", - "Renameat", - "Revoke", - "Rlimit", - "Rmdir", - "RouteMessage", - "RouteRIB", - "RoutingMessage", - "RtAttr", - "RtGenmsg", - "RtMetrics", - "RtMsg", - "RtMsghdr", - "RtNexthop", - "Rusage", - "SCM_BINTIME", - "SCM_CREDENTIALS", - "SCM_CREDS", - "SCM_RIGHTS", - "SCM_TIMESTAMP", - "SCM_TIMESTAMPING", - "SCM_TIMESTAMPNS", - "SCM_TIMESTAMP_MONOTONIC", - "SHUT_RD", - "SHUT_RDWR", - "SHUT_WR", - "SID", - "SIDAndAttributes", - "SIGABRT", - "SIGALRM", - "SIGBUS", - "SIGCHLD", - "SIGCLD", - "SIGCONT", - "SIGEMT", - "SIGFPE", - "SIGHUP", - "SIGILL", - "SIGINFO", - "SIGINT", - "SIGIO", - "SIGIOT", - "SIGKILL", - "SIGLIBRT", - "SIGLWP", - "SIGPIPE", - "SIGPOLL", - "SIGPROF", - "SIGPWR", - "SIGQUIT", - "SIGSEGV", - "SIGSTKFLT", - "SIGSTOP", - "SIGSYS", - "SIGTERM", - "SIGTHR", - "SIGTRAP", - "SIGTSTP", - "SIGTTIN", - "SIGTTOU", - "SIGUNUSED", - "SIGURG", - "SIGUSR1", - "SIGUSR2", - "SIGVTALRM", - "SIGWINCH", - "SIGXCPU", - "SIGXFSZ", - "SIOCADDDLCI", - "SIOCADDMULTI", - "SIOCADDRT", - "SIOCAIFADDR", - "SIOCAIFGROUP", - "SIOCALIFADDR", - "SIOCARPIPLL", - "SIOCATMARK", - "SIOCAUTOADDR", - "SIOCAUTONETMASK", - "SIOCBRDGADD", - "SIOCBRDGADDS", - "SIOCBRDGARL", - "SIOCBRDGDADDR", - "SIOCBRDGDEL", - "SIOCBRDGDELS", - "SIOCBRDGFLUSH", - "SIOCBRDGFRL", - "SIOCBRDGGCACHE", - "SIOCBRDGGFD", - "SIOCBRDGGHT", - "SIOCBRDGGIFFLGS", - "SIOCBRDGGMA", - "SIOCBRDGGPARAM", - "SIOCBRDGGPRI", - "SIOCBRDGGRL", - "SIOCBRDGGSIFS", - "SIOCBRDGGTO", - "SIOCBRDGIFS", - "SIOCBRDGRTS", - "SIOCBRDGSADDR", - "SIOCBRDGSCACHE", - "SIOCBRDGSFD", - "SIOCBRDGSHT", - "SIOCBRDGSIFCOST", - "SIOCBRDGSIFFLGS", - "SIOCBRDGSIFPRIO", - "SIOCBRDGSMA", - "SIOCBRDGSPRI", - "SIOCBRDGSPROTO", - "SIOCBRDGSTO", - "SIOCBRDGSTXHC", - "SIOCDARP", - "SIOCDELDLCI", - "SIOCDELMULTI", - "SIOCDELRT", - "SIOCDEVPRIVATE", - "SIOCDIFADDR", - "SIOCDIFGROUP", - "SIOCDIFPHYADDR", - "SIOCDLIFADDR", - "SIOCDRARP", - "SIOCGARP", - "SIOCGDRVSPEC", - "SIOCGETKALIVE", - "SIOCGETLABEL", - "SIOCGETPFLOW", - "SIOCGETPFSYNC", - "SIOCGETSGCNT", - "SIOCGETVIFCNT", - "SIOCGETVLAN", - "SIOCGHIWAT", - "SIOCGIFADDR", - "SIOCGIFADDRPREF", - "SIOCGIFALIAS", - "SIOCGIFALTMTU", - "SIOCGIFASYNCMAP", - "SIOCGIFBOND", - "SIOCGIFBR", - "SIOCGIFBRDADDR", - "SIOCGIFCAP", - "SIOCGIFCONF", - "SIOCGIFCOUNT", - "SIOCGIFDATA", - "SIOCGIFDESCR", - "SIOCGIFDEVMTU", - "SIOCGIFDLT", - "SIOCGIFDSTADDR", - "SIOCGIFENCAP", - "SIOCGIFFIB", - "SIOCGIFFLAGS", - "SIOCGIFGATTR", - "SIOCGIFGENERIC", - "SIOCGIFGMEMB", - "SIOCGIFGROUP", - "SIOCGIFHARDMTU", - "SIOCGIFHWADDR", - "SIOCGIFINDEX", - "SIOCGIFKPI", - "SIOCGIFMAC", - "SIOCGIFMAP", - "SIOCGIFMEDIA", - "SIOCGIFMEM", - "SIOCGIFMETRIC", - "SIOCGIFMTU", - "SIOCGIFNAME", - "SIOCGIFNETMASK", - "SIOCGIFPDSTADDR", - "SIOCGIFPFLAGS", - "SIOCGIFPHYS", - "SIOCGIFPRIORITY", - "SIOCGIFPSRCADDR", - "SIOCGIFRDOMAIN", - "SIOCGIFRTLABEL", - "SIOCGIFSLAVE", - "SIOCGIFSTATUS", - "SIOCGIFTIMESLOT", - "SIOCGIFTXQLEN", - "SIOCGIFVLAN", - "SIOCGIFWAKEFLAGS", - "SIOCGIFXFLAGS", - "SIOCGLIFADDR", - "SIOCGLIFPHYADDR", - "SIOCGLIFPHYRTABLE", - "SIOCGLIFPHYTTL", - "SIOCGLINKSTR", - "SIOCGLOWAT", - "SIOCGPGRP", - "SIOCGPRIVATE_0", - "SIOCGPRIVATE_1", - "SIOCGRARP", - "SIOCGSPPPPARAMS", - "SIOCGSTAMP", - "SIOCGSTAMPNS", - "SIOCGVH", - "SIOCGVNETID", - "SIOCIFCREATE", - "SIOCIFCREATE2", - "SIOCIFDESTROY", - "SIOCIFGCLONERS", - "SIOCINITIFADDR", - "SIOCPROTOPRIVATE", - "SIOCRSLVMULTI", - "SIOCRTMSG", - "SIOCSARP", - "SIOCSDRVSPEC", - "SIOCSETKALIVE", - "SIOCSETLABEL", - "SIOCSETPFLOW", - "SIOCSETPFSYNC", - "SIOCSETVLAN", - "SIOCSHIWAT", - "SIOCSIFADDR", - "SIOCSIFADDRPREF", - "SIOCSIFALTMTU", - "SIOCSIFASYNCMAP", - "SIOCSIFBOND", - "SIOCSIFBR", - "SIOCSIFBRDADDR", - "SIOCSIFCAP", - "SIOCSIFDESCR", - "SIOCSIFDSTADDR", - "SIOCSIFENCAP", - "SIOCSIFFIB", - "SIOCSIFFLAGS", - "SIOCSIFGATTR", - "SIOCSIFGENERIC", - "SIOCSIFHWADDR", - "SIOCSIFHWBROADCAST", - "SIOCSIFKPI", - "SIOCSIFLINK", - "SIOCSIFLLADDR", - "SIOCSIFMAC", - "SIOCSIFMAP", - "SIOCSIFMEDIA", - "SIOCSIFMEM", - "SIOCSIFMETRIC", - "SIOCSIFMTU", - "SIOCSIFNAME", - "SIOCSIFNETMASK", - "SIOCSIFPFLAGS", - "SIOCSIFPHYADDR", - "SIOCSIFPHYS", - "SIOCSIFPRIORITY", - "SIOCSIFRDOMAIN", - "SIOCSIFRTLABEL", - "SIOCSIFRVNET", - "SIOCSIFSLAVE", - "SIOCSIFTIMESLOT", - "SIOCSIFTXQLEN", - "SIOCSIFVLAN", - "SIOCSIFVNET", - "SIOCSIFXFLAGS", - "SIOCSLIFPHYADDR", - "SIOCSLIFPHYRTABLE", - "SIOCSLIFPHYTTL", - "SIOCSLINKSTR", - "SIOCSLOWAT", - "SIOCSPGRP", - "SIOCSRARP", - "SIOCSSPPPPARAMS", - "SIOCSVH", - "SIOCSVNETID", - "SIOCZIFDATA", - "SIO_GET_EXTENSION_FUNCTION_POINTER", - "SIO_GET_INTERFACE_LIST", - "SIO_KEEPALIVE_VALS", - "SIO_UDP_CONNRESET", - "SOCK_CLOEXEC", - "SOCK_DCCP", - "SOCK_DGRAM", - "SOCK_FLAGS_MASK", - "SOCK_MAXADDRLEN", - "SOCK_NONBLOCK", - "SOCK_NOSIGPIPE", - "SOCK_PACKET", - "SOCK_RAW", - "SOCK_RDM", - "SOCK_SEQPACKET", - "SOCK_STREAM", - "SOL_AAL", - "SOL_ATM", - "SOL_DECNET", - "SOL_ICMPV6", - "SOL_IP", - "SOL_IPV6", - "SOL_IRDA", - "SOL_PACKET", - "SOL_RAW", - "SOL_SOCKET", - "SOL_TCP", - "SOL_X25", - "SOMAXCONN", - "SO_ACCEPTCONN", - "SO_ACCEPTFILTER", - "SO_ATTACH_FILTER", - "SO_BINDANY", - "SO_BINDTODEVICE", - "SO_BINTIME", - "SO_BROADCAST", - "SO_BSDCOMPAT", - "SO_DEBUG", - "SO_DETACH_FILTER", - "SO_DOMAIN", - "SO_DONTROUTE", - "SO_DONTTRUNC", - "SO_ERROR", - "SO_KEEPALIVE", - "SO_LABEL", - "SO_LINGER", - "SO_LINGER_SEC", - "SO_LISTENINCQLEN", - "SO_LISTENQLEN", - "SO_LISTENQLIMIT", - "SO_MARK", - "SO_NETPROC", - "SO_NKE", - "SO_NOADDRERR", - "SO_NOHEADER", - "SO_NOSIGPIPE", - "SO_NOTIFYCONFLICT", - "SO_NO_CHECK", - "SO_NO_DDP", - "SO_NO_OFFLOAD", - "SO_NP_EXTENSIONS", - "SO_NREAD", - "SO_NUMRCVPKT", - "SO_NWRITE", - "SO_OOBINLINE", - "SO_OVERFLOWED", - "SO_PASSCRED", - "SO_PASSSEC", - "SO_PEERCRED", - "SO_PEERLABEL", - "SO_PEERNAME", - "SO_PEERSEC", - "SO_PRIORITY", - "SO_PROTOCOL", - "SO_PROTOTYPE", - "SO_RANDOMPORT", - "SO_RCVBUF", - "SO_RCVBUFFORCE", - "SO_RCVLOWAT", - "SO_RCVTIMEO", - "SO_RESTRICTIONS", - "SO_RESTRICT_DENYIN", - "SO_RESTRICT_DENYOUT", - "SO_RESTRICT_DENYSET", - "SO_REUSEADDR", - "SO_REUSEPORT", - "SO_REUSESHAREUID", - "SO_RTABLE", - "SO_RXQ_OVFL", - "SO_SECURITY_AUTHENTICATION", - "SO_SECURITY_ENCRYPTION_NETWORK", - "SO_SECURITY_ENCRYPTION_TRANSPORT", - "SO_SETFIB", - "SO_SNDBUF", - "SO_SNDBUFFORCE", - "SO_SNDLOWAT", - "SO_SNDTIMEO", - "SO_SPLICE", - "SO_TIMESTAMP", - "SO_TIMESTAMPING", - "SO_TIMESTAMPNS", - "SO_TIMESTAMP_MONOTONIC", - "SO_TYPE", - "SO_UPCALLCLOSEWAIT", - "SO_UPDATE_ACCEPT_CONTEXT", - "SO_UPDATE_CONNECT_CONTEXT", - "SO_USELOOPBACK", - "SO_USER_COOKIE", - "SO_VENDOR", - "SO_WANTMORE", - "SO_WANTOOBFLAG", - "SSLExtraCertChainPolicyPara", - "STANDARD_RIGHTS_ALL", - "STANDARD_RIGHTS_EXECUTE", - "STANDARD_RIGHTS_READ", - "STANDARD_RIGHTS_REQUIRED", - "STANDARD_RIGHTS_WRITE", - "STARTF_USESHOWWINDOW", - "STARTF_USESTDHANDLES", - "STD_ERROR_HANDLE", - "STD_INPUT_HANDLE", - "STD_OUTPUT_HANDLE", - "SUBLANG_ENGLISH_US", - "SW_FORCEMINIMIZE", - "SW_HIDE", - "SW_MAXIMIZE", - "SW_MINIMIZE", - "SW_NORMAL", - "SW_RESTORE", - "SW_SHOW", - "SW_SHOWDEFAULT", - "SW_SHOWMAXIMIZED", - "SW_SHOWMINIMIZED", - "SW_SHOWMINNOACTIVE", - "SW_SHOWNA", - "SW_SHOWNOACTIVATE", - "SW_SHOWNORMAL", - "SYMBOLIC_LINK_FLAG_DIRECTORY", - "SYNCHRONIZE", - "SYSCTL_VERSION", - "SYSCTL_VERS_0", - "SYSCTL_VERS_1", - "SYSCTL_VERS_MASK", - "SYS_ABORT2", - "SYS_ACCEPT", - "SYS_ACCEPT4", - "SYS_ACCEPT_NOCANCEL", - "SYS_ACCESS", - "SYS_ACCESS_EXTENDED", - "SYS_ACCT", - "SYS_ADD_KEY", - "SYS_ADD_PROFIL", - "SYS_ADJFREQ", - "SYS_ADJTIME", - "SYS_ADJTIMEX", - "SYS_AFS_SYSCALL", - "SYS_AIO_CANCEL", - "SYS_AIO_ERROR", - "SYS_AIO_FSYNC", - "SYS_AIO_READ", - "SYS_AIO_RETURN", - "SYS_AIO_SUSPEND", - "SYS_AIO_SUSPEND_NOCANCEL", - "SYS_AIO_WRITE", - "SYS_ALARM", - "SYS_ARCH_PRCTL", - "SYS_ARM_FADVISE64_64", - "SYS_ARM_SYNC_FILE_RANGE", - "SYS_ATGETMSG", - "SYS_ATPGETREQ", - "SYS_ATPGETRSP", - "SYS_ATPSNDREQ", - "SYS_ATPSNDRSP", - "SYS_ATPUTMSG", - "SYS_ATSOCKET", - "SYS_AUDIT", - "SYS_AUDITCTL", - "SYS_AUDITON", - "SYS_AUDIT_SESSION_JOIN", - "SYS_AUDIT_SESSION_PORT", - "SYS_AUDIT_SESSION_SELF", - "SYS_BDFLUSH", - "SYS_BIND", - "SYS_BINDAT", - "SYS_BREAK", - "SYS_BRK", - "SYS_BSDTHREAD_CREATE", - "SYS_BSDTHREAD_REGISTER", - "SYS_BSDTHREAD_TERMINATE", - "SYS_CAPGET", - "SYS_CAPSET", - "SYS_CAP_ENTER", - "SYS_CAP_FCNTLS_GET", - "SYS_CAP_FCNTLS_LIMIT", - "SYS_CAP_GETMODE", - "SYS_CAP_GETRIGHTS", - "SYS_CAP_IOCTLS_GET", - "SYS_CAP_IOCTLS_LIMIT", - "SYS_CAP_NEW", - "SYS_CAP_RIGHTS_GET", - "SYS_CAP_RIGHTS_LIMIT", - "SYS_CHDIR", - "SYS_CHFLAGS", - "SYS_CHFLAGSAT", - "SYS_CHMOD", - "SYS_CHMOD_EXTENDED", - "SYS_CHOWN", - "SYS_CHOWN32", - "SYS_CHROOT", - "SYS_CHUD", - "SYS_CLOCK_ADJTIME", - "SYS_CLOCK_GETCPUCLOCKID2", - "SYS_CLOCK_GETRES", - "SYS_CLOCK_GETTIME", - "SYS_CLOCK_NANOSLEEP", - "SYS_CLOCK_SETTIME", - "SYS_CLONE", - "SYS_CLOSE", - "SYS_CLOSEFROM", - "SYS_CLOSE_NOCANCEL", - "SYS_CONNECT", - "SYS_CONNECTAT", - "SYS_CONNECT_NOCANCEL", - "SYS_COPYFILE", - "SYS_CPUSET", - "SYS_CPUSET_GETAFFINITY", - "SYS_CPUSET_GETID", - "SYS_CPUSET_SETAFFINITY", - "SYS_CPUSET_SETID", - "SYS_CREAT", - "SYS_CREATE_MODULE", - "SYS_CSOPS", - "SYS_CSOPS_AUDITTOKEN", - "SYS_DELETE", - "SYS_DELETE_MODULE", - "SYS_DUP", - "SYS_DUP2", - "SYS_DUP3", - "SYS_EACCESS", - "SYS_EPOLL_CREATE", - "SYS_EPOLL_CREATE1", - "SYS_EPOLL_CTL", - "SYS_EPOLL_CTL_OLD", - "SYS_EPOLL_PWAIT", - "SYS_EPOLL_WAIT", - "SYS_EPOLL_WAIT_OLD", - "SYS_EVENTFD", - "SYS_EVENTFD2", - "SYS_EXCHANGEDATA", - "SYS_EXECVE", - "SYS_EXIT", - "SYS_EXIT_GROUP", - "SYS_EXTATTRCTL", - "SYS_EXTATTR_DELETE_FD", - "SYS_EXTATTR_DELETE_FILE", - "SYS_EXTATTR_DELETE_LINK", - "SYS_EXTATTR_GET_FD", - "SYS_EXTATTR_GET_FILE", - "SYS_EXTATTR_GET_LINK", - "SYS_EXTATTR_LIST_FD", - "SYS_EXTATTR_LIST_FILE", - "SYS_EXTATTR_LIST_LINK", - "SYS_EXTATTR_SET_FD", - "SYS_EXTATTR_SET_FILE", - "SYS_EXTATTR_SET_LINK", - "SYS_FACCESSAT", - "SYS_FADVISE64", - "SYS_FADVISE64_64", - "SYS_FALLOCATE", - "SYS_FANOTIFY_INIT", - "SYS_FANOTIFY_MARK", - "SYS_FCHDIR", - "SYS_FCHFLAGS", - "SYS_FCHMOD", - "SYS_FCHMODAT", - "SYS_FCHMOD_EXTENDED", - "SYS_FCHOWN", - "SYS_FCHOWN32", - "SYS_FCHOWNAT", - "SYS_FCHROOT", - "SYS_FCNTL", - "SYS_FCNTL64", - "SYS_FCNTL_NOCANCEL", - "SYS_FDATASYNC", - "SYS_FEXECVE", - "SYS_FFCLOCK_GETCOUNTER", - "SYS_FFCLOCK_GETESTIMATE", - "SYS_FFCLOCK_SETESTIMATE", - "SYS_FFSCTL", - "SYS_FGETATTRLIST", - "SYS_FGETXATTR", - "SYS_FHOPEN", - "SYS_FHSTAT", - "SYS_FHSTATFS", - "SYS_FILEPORT_MAKEFD", - "SYS_FILEPORT_MAKEPORT", - "SYS_FKTRACE", - "SYS_FLISTXATTR", - "SYS_FLOCK", - "SYS_FORK", - "SYS_FPATHCONF", - "SYS_FREEBSD6_FTRUNCATE", - "SYS_FREEBSD6_LSEEK", - "SYS_FREEBSD6_MMAP", - "SYS_FREEBSD6_PREAD", - "SYS_FREEBSD6_PWRITE", - "SYS_FREEBSD6_TRUNCATE", - "SYS_FREMOVEXATTR", - "SYS_FSCTL", - "SYS_FSETATTRLIST", - "SYS_FSETXATTR", - "SYS_FSGETPATH", - "SYS_FSTAT", - "SYS_FSTAT64", - "SYS_FSTAT64_EXTENDED", - "SYS_FSTATAT", - "SYS_FSTATAT64", - "SYS_FSTATFS", - "SYS_FSTATFS64", - "SYS_FSTATV", - "SYS_FSTATVFS1", - "SYS_FSTAT_EXTENDED", - "SYS_FSYNC", - "SYS_FSYNC_NOCANCEL", - "SYS_FSYNC_RANGE", - "SYS_FTIME", - "SYS_FTRUNCATE", - "SYS_FTRUNCATE64", - "SYS_FUTEX", - "SYS_FUTIMENS", - "SYS_FUTIMES", - "SYS_FUTIMESAT", - "SYS_GETATTRLIST", - "SYS_GETAUDIT", - "SYS_GETAUDIT_ADDR", - "SYS_GETAUID", - "SYS_GETCONTEXT", - "SYS_GETCPU", - "SYS_GETCWD", - "SYS_GETDENTS", - "SYS_GETDENTS64", - "SYS_GETDIRENTRIES", - "SYS_GETDIRENTRIES64", - "SYS_GETDIRENTRIESATTR", - "SYS_GETDTABLECOUNT", - "SYS_GETDTABLESIZE", - "SYS_GETEGID", - "SYS_GETEGID32", - "SYS_GETEUID", - "SYS_GETEUID32", - "SYS_GETFH", - "SYS_GETFSSTAT", - "SYS_GETFSSTAT64", - "SYS_GETGID", - "SYS_GETGID32", - "SYS_GETGROUPS", - "SYS_GETGROUPS32", - "SYS_GETHOSTUUID", - "SYS_GETITIMER", - "SYS_GETLCID", - "SYS_GETLOGIN", - "SYS_GETLOGINCLASS", - "SYS_GETPEERNAME", - "SYS_GETPGID", - "SYS_GETPGRP", - "SYS_GETPID", - "SYS_GETPMSG", - "SYS_GETPPID", - "SYS_GETPRIORITY", - "SYS_GETRESGID", - "SYS_GETRESGID32", - "SYS_GETRESUID", - "SYS_GETRESUID32", - "SYS_GETRLIMIT", - "SYS_GETRTABLE", - "SYS_GETRUSAGE", - "SYS_GETSGROUPS", - "SYS_GETSID", - "SYS_GETSOCKNAME", - "SYS_GETSOCKOPT", - "SYS_GETTHRID", - "SYS_GETTID", - "SYS_GETTIMEOFDAY", - "SYS_GETUID", - "SYS_GETUID32", - "SYS_GETVFSSTAT", - "SYS_GETWGROUPS", - "SYS_GETXATTR", - "SYS_GET_KERNEL_SYMS", - "SYS_GET_MEMPOLICY", - "SYS_GET_ROBUST_LIST", - "SYS_GET_THREAD_AREA", - "SYS_GTTY", - "SYS_IDENTITYSVC", - "SYS_IDLE", - "SYS_INITGROUPS", - "SYS_INIT_MODULE", - "SYS_INOTIFY_ADD_WATCH", - "SYS_INOTIFY_INIT", - "SYS_INOTIFY_INIT1", - "SYS_INOTIFY_RM_WATCH", - "SYS_IOCTL", - "SYS_IOPERM", - "SYS_IOPL", - "SYS_IOPOLICYSYS", - "SYS_IOPRIO_GET", - "SYS_IOPRIO_SET", - "SYS_IO_CANCEL", - "SYS_IO_DESTROY", - "SYS_IO_GETEVENTS", - "SYS_IO_SETUP", - "SYS_IO_SUBMIT", - "SYS_IPC", - "SYS_ISSETUGID", - "SYS_JAIL", - "SYS_JAIL_ATTACH", - "SYS_JAIL_GET", - "SYS_JAIL_REMOVE", - "SYS_JAIL_SET", - "SYS_KAS_INFO", - "SYS_KDEBUG_TRACE", - "SYS_KENV", - "SYS_KEVENT", - "SYS_KEVENT64", - "SYS_KEXEC_LOAD", - "SYS_KEYCTL", - "SYS_KILL", - "SYS_KLDFIND", - "SYS_KLDFIRSTMOD", - "SYS_KLDLOAD", - "SYS_KLDNEXT", - "SYS_KLDSTAT", - "SYS_KLDSYM", - "SYS_KLDUNLOAD", - "SYS_KLDUNLOADF", - "SYS_KQUEUE", - "SYS_KQUEUE1", - "SYS_KTIMER_CREATE", - "SYS_KTIMER_DELETE", - "SYS_KTIMER_GETOVERRUN", - "SYS_KTIMER_GETTIME", - "SYS_KTIMER_SETTIME", - "SYS_KTRACE", - "SYS_LCHFLAGS", - "SYS_LCHMOD", - "SYS_LCHOWN", - "SYS_LCHOWN32", - "SYS_LEDGER", - "SYS_LGETFH", - "SYS_LGETXATTR", - "SYS_LINK", - "SYS_LINKAT", - "SYS_LIO_LISTIO", - "SYS_LISTEN", - "SYS_LISTXATTR", - "SYS_LLISTXATTR", - "SYS_LOCK", - "SYS_LOOKUP_DCOOKIE", - "SYS_LPATHCONF", - "SYS_LREMOVEXATTR", - "SYS_LSEEK", - "SYS_LSETXATTR", - "SYS_LSTAT", - "SYS_LSTAT64", - "SYS_LSTAT64_EXTENDED", - "SYS_LSTATV", - "SYS_LSTAT_EXTENDED", - "SYS_LUTIMES", - "SYS_MAC_SYSCALL", - "SYS_MADVISE", - "SYS_MADVISE1", - "SYS_MAXSYSCALL", - "SYS_MBIND", - "SYS_MIGRATE_PAGES", - "SYS_MINCORE", - "SYS_MINHERIT", - "SYS_MKCOMPLEX", - "SYS_MKDIR", - "SYS_MKDIRAT", - "SYS_MKDIR_EXTENDED", - "SYS_MKFIFO", - "SYS_MKFIFOAT", - "SYS_MKFIFO_EXTENDED", - "SYS_MKNOD", - "SYS_MKNODAT", - "SYS_MLOCK", - "SYS_MLOCKALL", - "SYS_MMAP", - "SYS_MMAP2", - "SYS_MODCTL", - "SYS_MODFIND", - "SYS_MODFNEXT", - "SYS_MODIFY_LDT", - "SYS_MODNEXT", - "SYS_MODSTAT", - "SYS_MODWATCH", - "SYS_MOUNT", - "SYS_MOVE_PAGES", - "SYS_MPROTECT", - "SYS_MPX", - "SYS_MQUERY", - "SYS_MQ_GETSETATTR", - "SYS_MQ_NOTIFY", - "SYS_MQ_OPEN", - "SYS_MQ_TIMEDRECEIVE", - "SYS_MQ_TIMEDSEND", - "SYS_MQ_UNLINK", - "SYS_MREMAP", - "SYS_MSGCTL", - "SYS_MSGGET", - "SYS_MSGRCV", - "SYS_MSGRCV_NOCANCEL", - "SYS_MSGSND", - "SYS_MSGSND_NOCANCEL", - "SYS_MSGSYS", - "SYS_MSYNC", - "SYS_MSYNC_NOCANCEL", - "SYS_MUNLOCK", - "SYS_MUNLOCKALL", - "SYS_MUNMAP", - "SYS_NAME_TO_HANDLE_AT", - "SYS_NANOSLEEP", - "SYS_NEWFSTATAT", - "SYS_NFSCLNT", - "SYS_NFSSERVCTL", - "SYS_NFSSVC", - "SYS_NFSTAT", - "SYS_NICE", - "SYS_NLSTAT", - "SYS_NMOUNT", - "SYS_NSTAT", - "SYS_NTP_ADJTIME", - "SYS_NTP_GETTIME", - "SYS_OABI_SYSCALL_BASE", - "SYS_OBREAK", - "SYS_OLDFSTAT", - "SYS_OLDLSTAT", - "SYS_OLDOLDUNAME", - "SYS_OLDSTAT", - "SYS_OLDUNAME", - "SYS_OPEN", - "SYS_OPENAT", - "SYS_OPENBSD_POLL", - "SYS_OPEN_BY_HANDLE_AT", - "SYS_OPEN_DPROTECTED_NP", - "SYS_OPEN_EXTENDED", - "SYS_OPEN_NOCANCEL", - "SYS_OVADVISE", - "SYS_PACCEPT", - "SYS_PATHCONF", - "SYS_PAUSE", - "SYS_PCICONFIG_IOBASE", - "SYS_PCICONFIG_READ", - "SYS_PCICONFIG_WRITE", - "SYS_PDFORK", - "SYS_PDGETPID", - "SYS_PDKILL", - "SYS_PERF_EVENT_OPEN", - "SYS_PERSONALITY", - "SYS_PID_HIBERNATE", - "SYS_PID_RESUME", - "SYS_PID_SHUTDOWN_SOCKETS", - "SYS_PID_SUSPEND", - "SYS_PIPE", - "SYS_PIPE2", - "SYS_PIVOT_ROOT", - "SYS_PMC_CONTROL", - "SYS_PMC_GET_INFO", - "SYS_POLL", - "SYS_POLLTS", - "SYS_POLL_NOCANCEL", - "SYS_POSIX_FADVISE", - "SYS_POSIX_FALLOCATE", - "SYS_POSIX_OPENPT", - "SYS_POSIX_SPAWN", - "SYS_PPOLL", - "SYS_PRCTL", - "SYS_PREAD", - "SYS_PREAD64", - "SYS_PREADV", - "SYS_PREAD_NOCANCEL", - "SYS_PRLIMIT64", - "SYS_PROCCTL", - "SYS_PROCESS_POLICY", - "SYS_PROCESS_VM_READV", - "SYS_PROCESS_VM_WRITEV", - "SYS_PROC_INFO", - "SYS_PROF", - "SYS_PROFIL", - "SYS_PSELECT", - "SYS_PSELECT6", - "SYS_PSET_ASSIGN", - "SYS_PSET_CREATE", - "SYS_PSET_DESTROY", - "SYS_PSYNCH_CVBROAD", - "SYS_PSYNCH_CVCLRPREPOST", - "SYS_PSYNCH_CVSIGNAL", - "SYS_PSYNCH_CVWAIT", - "SYS_PSYNCH_MUTEXDROP", - "SYS_PSYNCH_MUTEXWAIT", - "SYS_PSYNCH_RW_DOWNGRADE", - "SYS_PSYNCH_RW_LONGRDLOCK", - "SYS_PSYNCH_RW_RDLOCK", - "SYS_PSYNCH_RW_UNLOCK", - "SYS_PSYNCH_RW_UNLOCK2", - "SYS_PSYNCH_RW_UPGRADE", - "SYS_PSYNCH_RW_WRLOCK", - "SYS_PSYNCH_RW_YIELDWRLOCK", - "SYS_PTRACE", - "SYS_PUTPMSG", - "SYS_PWRITE", - "SYS_PWRITE64", - "SYS_PWRITEV", - "SYS_PWRITE_NOCANCEL", - "SYS_QUERY_MODULE", - "SYS_QUOTACTL", - "SYS_RASCTL", - "SYS_RCTL_ADD_RULE", - "SYS_RCTL_GET_LIMITS", - "SYS_RCTL_GET_RACCT", - "SYS_RCTL_GET_RULES", - "SYS_RCTL_REMOVE_RULE", - "SYS_READ", - "SYS_READAHEAD", - "SYS_READDIR", - "SYS_READLINK", - "SYS_READLINKAT", - "SYS_READV", - "SYS_READV_NOCANCEL", - "SYS_READ_NOCANCEL", - "SYS_REBOOT", - "SYS_RECV", - "SYS_RECVFROM", - "SYS_RECVFROM_NOCANCEL", - "SYS_RECVMMSG", - "SYS_RECVMSG", - "SYS_RECVMSG_NOCANCEL", - "SYS_REMAP_FILE_PAGES", - "SYS_REMOVEXATTR", - "SYS_RENAME", - "SYS_RENAMEAT", - "SYS_REQUEST_KEY", - "SYS_RESTART_SYSCALL", - "SYS_REVOKE", - "SYS_RFORK", - "SYS_RMDIR", - "SYS_RTPRIO", - "SYS_RTPRIO_THREAD", - "SYS_RT_SIGACTION", - "SYS_RT_SIGPENDING", - "SYS_RT_SIGPROCMASK", - "SYS_RT_SIGQUEUEINFO", - "SYS_RT_SIGRETURN", - "SYS_RT_SIGSUSPEND", - "SYS_RT_SIGTIMEDWAIT", - "SYS_RT_TGSIGQUEUEINFO", - "SYS_SBRK", - "SYS_SCHED_GETAFFINITY", - "SYS_SCHED_GETPARAM", - "SYS_SCHED_GETSCHEDULER", - "SYS_SCHED_GET_PRIORITY_MAX", - "SYS_SCHED_GET_PRIORITY_MIN", - "SYS_SCHED_RR_GET_INTERVAL", - "SYS_SCHED_SETAFFINITY", - "SYS_SCHED_SETPARAM", - "SYS_SCHED_SETSCHEDULER", - "SYS_SCHED_YIELD", - "SYS_SCTP_GENERIC_RECVMSG", - "SYS_SCTP_GENERIC_SENDMSG", - "SYS_SCTP_GENERIC_SENDMSG_IOV", - "SYS_SCTP_PEELOFF", - "SYS_SEARCHFS", - "SYS_SECURITY", - "SYS_SELECT", - "SYS_SELECT_NOCANCEL", - "SYS_SEMCONFIG", - "SYS_SEMCTL", - "SYS_SEMGET", - "SYS_SEMOP", - "SYS_SEMSYS", - "SYS_SEMTIMEDOP", - "SYS_SEM_CLOSE", - "SYS_SEM_DESTROY", - "SYS_SEM_GETVALUE", - "SYS_SEM_INIT", - "SYS_SEM_OPEN", - "SYS_SEM_POST", - "SYS_SEM_TRYWAIT", - "SYS_SEM_UNLINK", - "SYS_SEM_WAIT", - "SYS_SEM_WAIT_NOCANCEL", - "SYS_SEND", - "SYS_SENDFILE", - "SYS_SENDFILE64", - "SYS_SENDMMSG", - "SYS_SENDMSG", - "SYS_SENDMSG_NOCANCEL", - "SYS_SENDTO", - "SYS_SENDTO_NOCANCEL", - "SYS_SETATTRLIST", - "SYS_SETAUDIT", - "SYS_SETAUDIT_ADDR", - "SYS_SETAUID", - "SYS_SETCONTEXT", - "SYS_SETDOMAINNAME", - "SYS_SETEGID", - "SYS_SETEUID", - "SYS_SETFIB", - "SYS_SETFSGID", - "SYS_SETFSGID32", - "SYS_SETFSUID", - "SYS_SETFSUID32", - "SYS_SETGID", - "SYS_SETGID32", - "SYS_SETGROUPS", - "SYS_SETGROUPS32", - "SYS_SETHOSTNAME", - "SYS_SETITIMER", - "SYS_SETLCID", - "SYS_SETLOGIN", - "SYS_SETLOGINCLASS", - "SYS_SETNS", - "SYS_SETPGID", - "SYS_SETPRIORITY", - "SYS_SETPRIVEXEC", - "SYS_SETREGID", - "SYS_SETREGID32", - "SYS_SETRESGID", - "SYS_SETRESGID32", - "SYS_SETRESUID", - "SYS_SETRESUID32", - "SYS_SETREUID", - "SYS_SETREUID32", - "SYS_SETRLIMIT", - "SYS_SETRTABLE", - "SYS_SETSGROUPS", - "SYS_SETSID", - "SYS_SETSOCKOPT", - "SYS_SETTID", - "SYS_SETTID_WITH_PID", - "SYS_SETTIMEOFDAY", - "SYS_SETUID", - "SYS_SETUID32", - "SYS_SETWGROUPS", - "SYS_SETXATTR", - "SYS_SET_MEMPOLICY", - "SYS_SET_ROBUST_LIST", - "SYS_SET_THREAD_AREA", - "SYS_SET_TID_ADDRESS", - "SYS_SGETMASK", - "SYS_SHARED_REGION_CHECK_NP", - "SYS_SHARED_REGION_MAP_AND_SLIDE_NP", - "SYS_SHMAT", - "SYS_SHMCTL", - "SYS_SHMDT", - "SYS_SHMGET", - "SYS_SHMSYS", - "SYS_SHM_OPEN", - "SYS_SHM_UNLINK", - "SYS_SHUTDOWN", - "SYS_SIGACTION", - "SYS_SIGALTSTACK", - "SYS_SIGNAL", - "SYS_SIGNALFD", - "SYS_SIGNALFD4", - "SYS_SIGPENDING", - "SYS_SIGPROCMASK", - "SYS_SIGQUEUE", - "SYS_SIGQUEUEINFO", - "SYS_SIGRETURN", - "SYS_SIGSUSPEND", - "SYS_SIGSUSPEND_NOCANCEL", - "SYS_SIGTIMEDWAIT", - "SYS_SIGWAIT", - "SYS_SIGWAITINFO", - "SYS_SOCKET", - "SYS_SOCKETCALL", - "SYS_SOCKETPAIR", - "SYS_SPLICE", - "SYS_SSETMASK", - "SYS_SSTK", - "SYS_STACK_SNAPSHOT", - "SYS_STAT", - "SYS_STAT64", - "SYS_STAT64_EXTENDED", - "SYS_STATFS", - "SYS_STATFS64", - "SYS_STATV", - "SYS_STATVFS1", - "SYS_STAT_EXTENDED", - "SYS_STIME", - "SYS_STTY", - "SYS_SWAPCONTEXT", - "SYS_SWAPCTL", - "SYS_SWAPOFF", - "SYS_SWAPON", - "SYS_SYMLINK", - "SYS_SYMLINKAT", - "SYS_SYNC", - "SYS_SYNCFS", - "SYS_SYNC_FILE_RANGE", - "SYS_SYSARCH", - "SYS_SYSCALL", - "SYS_SYSCALL_BASE", - "SYS_SYSFS", - "SYS_SYSINFO", - "SYS_SYSLOG", - "SYS_TEE", - "SYS_TGKILL", - "SYS_THREAD_SELFID", - "SYS_THR_CREATE", - "SYS_THR_EXIT", - "SYS_THR_KILL", - "SYS_THR_KILL2", - "SYS_THR_NEW", - "SYS_THR_SELF", - "SYS_THR_SET_NAME", - "SYS_THR_SUSPEND", - "SYS_THR_WAKE", - "SYS_TIME", - "SYS_TIMERFD_CREATE", - "SYS_TIMERFD_GETTIME", - "SYS_TIMERFD_SETTIME", - "SYS_TIMER_CREATE", - "SYS_TIMER_DELETE", - "SYS_TIMER_GETOVERRUN", - "SYS_TIMER_GETTIME", - "SYS_TIMER_SETTIME", - "SYS_TIMES", - "SYS_TKILL", - "SYS_TRUNCATE", - "SYS_TRUNCATE64", - "SYS_TUXCALL", - "SYS_UGETRLIMIT", - "SYS_ULIMIT", - "SYS_UMASK", - "SYS_UMASK_EXTENDED", - "SYS_UMOUNT", - "SYS_UMOUNT2", - "SYS_UNAME", - "SYS_UNDELETE", - "SYS_UNLINK", - "SYS_UNLINKAT", - "SYS_UNMOUNT", - "SYS_UNSHARE", - "SYS_USELIB", - "SYS_USTAT", - "SYS_UTIME", - "SYS_UTIMENSAT", - "SYS_UTIMES", - "SYS_UTRACE", - "SYS_UUIDGEN", - "SYS_VADVISE", - "SYS_VFORK", - "SYS_VHANGUP", - "SYS_VM86", - "SYS_VM86OLD", - "SYS_VMSPLICE", - "SYS_VM_PRESSURE_MONITOR", - "SYS_VSERVER", - "SYS_WAIT4", - "SYS_WAIT4_NOCANCEL", - "SYS_WAIT6", - "SYS_WAITEVENT", - "SYS_WAITID", - "SYS_WAITID_NOCANCEL", - "SYS_WAITPID", - "SYS_WATCHEVENT", - "SYS_WORKQ_KERNRETURN", - "SYS_WORKQ_OPEN", - "SYS_WRITE", - "SYS_WRITEV", - "SYS_WRITEV_NOCANCEL", - "SYS_WRITE_NOCANCEL", - "SYS_YIELD", - "SYS__LLSEEK", - "SYS__LWP_CONTINUE", - "SYS__LWP_CREATE", - "SYS__LWP_CTL", - "SYS__LWP_DETACH", - "SYS__LWP_EXIT", - "SYS__LWP_GETNAME", - "SYS__LWP_GETPRIVATE", - "SYS__LWP_KILL", - "SYS__LWP_PARK", - "SYS__LWP_SELF", - "SYS__LWP_SETNAME", - "SYS__LWP_SETPRIVATE", - "SYS__LWP_SUSPEND", - "SYS__LWP_UNPARK", - "SYS__LWP_UNPARK_ALL", - "SYS__LWP_WAIT", - "SYS__LWP_WAKEUP", - "SYS__NEWSELECT", - "SYS__PSET_BIND", - "SYS__SCHED_GETAFFINITY", - "SYS__SCHED_GETPARAM", - "SYS__SCHED_SETAFFINITY", - "SYS__SCHED_SETPARAM", - "SYS__SYSCTL", - "SYS__UMTX_LOCK", - "SYS__UMTX_OP", - "SYS__UMTX_UNLOCK", - "SYS___ACL_ACLCHECK_FD", - "SYS___ACL_ACLCHECK_FILE", - "SYS___ACL_ACLCHECK_LINK", - "SYS___ACL_DELETE_FD", - "SYS___ACL_DELETE_FILE", - "SYS___ACL_DELETE_LINK", - "SYS___ACL_GET_FD", - "SYS___ACL_GET_FILE", - "SYS___ACL_GET_LINK", - "SYS___ACL_SET_FD", - "SYS___ACL_SET_FILE", - "SYS___ACL_SET_LINK", - "SYS___CLONE", - "SYS___DISABLE_THREADSIGNAL", - "SYS___GETCWD", - "SYS___GETLOGIN", - "SYS___GET_TCB", - "SYS___MAC_EXECVE", - "SYS___MAC_GETFSSTAT", - "SYS___MAC_GET_FD", - "SYS___MAC_GET_FILE", - "SYS___MAC_GET_LCID", - "SYS___MAC_GET_LCTX", - "SYS___MAC_GET_LINK", - "SYS___MAC_GET_MOUNT", - "SYS___MAC_GET_PID", - "SYS___MAC_GET_PROC", - "SYS___MAC_MOUNT", - "SYS___MAC_SET_FD", - "SYS___MAC_SET_FILE", - "SYS___MAC_SET_LCTX", - "SYS___MAC_SET_LINK", - "SYS___MAC_SET_PROC", - "SYS___MAC_SYSCALL", - "SYS___OLD_SEMWAIT_SIGNAL", - "SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL", - "SYS___POSIX_CHOWN", - "SYS___POSIX_FCHOWN", - "SYS___POSIX_LCHOWN", - "SYS___POSIX_RENAME", - "SYS___PTHREAD_CANCELED", - "SYS___PTHREAD_CHDIR", - "SYS___PTHREAD_FCHDIR", - "SYS___PTHREAD_KILL", - "SYS___PTHREAD_MARKCANCEL", - "SYS___PTHREAD_SIGMASK", - "SYS___QUOTACTL", - "SYS___SEMCTL", - "SYS___SEMWAIT_SIGNAL", - "SYS___SEMWAIT_SIGNAL_NOCANCEL", - "SYS___SETLOGIN", - "SYS___SETUGID", - "SYS___SET_TCB", - "SYS___SIGACTION_SIGTRAMP", - "SYS___SIGTIMEDWAIT", - "SYS___SIGWAIT", - "SYS___SIGWAIT_NOCANCEL", - "SYS___SYSCTL", - "SYS___TFORK", - "SYS___THREXIT", - "SYS___THRSIGDIVERT", - "SYS___THRSLEEP", - "SYS___THRWAKEUP", - "S_ARCH1", - "S_ARCH2", - "S_BLKSIZE", - "S_IEXEC", - "S_IFBLK", - "S_IFCHR", - "S_IFDIR", - "S_IFIFO", - "S_IFLNK", - "S_IFMT", - "S_IFREG", - "S_IFSOCK", - "S_IFWHT", - "S_IREAD", - "S_IRGRP", - "S_IROTH", - "S_IRUSR", - "S_IRWXG", - "S_IRWXO", - "S_IRWXU", - "S_ISGID", - "S_ISTXT", - "S_ISUID", - "S_ISVTX", - "S_IWGRP", - "S_IWOTH", - "S_IWRITE", - "S_IWUSR", - "S_IXGRP", - "S_IXOTH", - "S_IXUSR", - "S_LOGIN_SET", - "SecurityAttributes", - "Seek", - "Select", - "Sendfile", - "Sendmsg", - "SendmsgN", - "Sendto", - "Servent", - "SetBpf", - "SetBpfBuflen", - "SetBpfDatalink", - "SetBpfHeadercmpl", - "SetBpfImmediate", - "SetBpfInterface", - "SetBpfPromisc", - "SetBpfTimeout", - "SetCurrentDirectory", - "SetEndOfFile", - "SetEnvironmentVariable", - "SetFileAttributes", - "SetFileCompletionNotificationModes", - "SetFilePointer", - "SetFileTime", - "SetHandleInformation", - "SetKevent", - "SetLsfPromisc", - "SetNonblock", - "Setdomainname", - "Setegid", - "Setenv", - "Seteuid", - "Setfsgid", - "Setfsuid", - "Setgid", - "Setgroups", - "Sethostname", - "Setlogin", - "Setpgid", - "Setpriority", - "Setprivexec", - "Setregid", - "Setresgid", - "Setresuid", - "Setreuid", - "Setrlimit", - "Setsid", - "Setsockopt", - "SetsockoptByte", - "SetsockoptICMPv6Filter", - "SetsockoptIPMreq", - "SetsockoptIPMreqn", - "SetsockoptIPv6Mreq", - "SetsockoptInet4Addr", - "SetsockoptInt", - "SetsockoptLinger", - "SetsockoptString", - "SetsockoptTimeval", - "Settimeofday", - "Setuid", - "Setxattr", - "Shutdown", - "SidTypeAlias", - "SidTypeComputer", - "SidTypeDeletedAccount", - "SidTypeDomain", - "SidTypeGroup", - "SidTypeInvalid", - "SidTypeLabel", - "SidTypeUnknown", - "SidTypeUser", - "SidTypeWellKnownGroup", - "Signal", - "SizeofBpfHdr", - "SizeofBpfInsn", - "SizeofBpfProgram", - "SizeofBpfStat", - "SizeofBpfVersion", - "SizeofBpfZbuf", - "SizeofBpfZbufHeader", - "SizeofCmsghdr", - "SizeofICMPv6Filter", - "SizeofIPMreq", - "SizeofIPMreqn", - "SizeofIPv6MTUInfo", - "SizeofIPv6Mreq", - "SizeofIfAddrmsg", - "SizeofIfAnnounceMsghdr", - "SizeofIfData", - "SizeofIfInfomsg", - "SizeofIfMsghdr", - "SizeofIfaMsghdr", - "SizeofIfmaMsghdr", - "SizeofIfmaMsghdr2", - "SizeofInet4Pktinfo", - "SizeofInet6Pktinfo", - "SizeofInotifyEvent", - "SizeofLinger", - "SizeofMsghdr", - "SizeofNlAttr", - "SizeofNlMsgerr", - "SizeofNlMsghdr", - "SizeofRtAttr", - "SizeofRtGenmsg", - "SizeofRtMetrics", - "SizeofRtMsg", - "SizeofRtMsghdr", - "SizeofRtNexthop", - "SizeofSockFilter", - "SizeofSockFprog", - "SizeofSockaddrAny", - "SizeofSockaddrDatalink", - "SizeofSockaddrInet4", - "SizeofSockaddrInet6", - "SizeofSockaddrLinklayer", - "SizeofSockaddrNetlink", - "SizeofSockaddrUnix", - "SizeofTCPInfo", - "SizeofUcred", - "SlicePtrFromStrings", - "SockFilter", - "SockFprog", - "Sockaddr", - "SockaddrDatalink", - "SockaddrGen", - "SockaddrInet4", - "SockaddrInet6", - "SockaddrLinklayer", - "SockaddrNetlink", - "SockaddrUnix", - "Socket", - "SocketControlMessage", - "SocketDisableIPv6", - "Socketpair", - "Splice", - "StartProcess", - "StartupInfo", - "Stat", - "Stat_t", - "Statfs", - "Statfs_t", - "Stderr", - "Stdin", - "Stdout", - "StringBytePtr", - "StringByteSlice", - "StringSlicePtr", - "StringToSid", - "StringToUTF16", - "StringToUTF16Ptr", - "Symlink", - "Sync", - "SyncFileRange", - "SysProcAttr", - "SysProcIDMap", - "Syscall", - "Syscall12", - "Syscall15", - "Syscall18", - "Syscall6", - "Syscall9", - "SyscallN", - "Sysctl", - "SysctlUint32", - "Sysctlnode", - "Sysinfo", - "Sysinfo_t", - "Systemtime", - "TCGETS", - "TCIFLUSH", - "TCIOFLUSH", - "TCOFLUSH", - "TCPInfo", - "TCPKeepalive", - "TCP_CA_NAME_MAX", - "TCP_CONGCTL", - "TCP_CONGESTION", - "TCP_CONNECTIONTIMEOUT", - "TCP_CORK", - "TCP_DEFER_ACCEPT", - "TCP_ENABLE_ECN", - "TCP_INFO", - "TCP_KEEPALIVE", - "TCP_KEEPCNT", - "TCP_KEEPIDLE", - "TCP_KEEPINIT", - "TCP_KEEPINTVL", - "TCP_LINGER2", - "TCP_MAXBURST", - "TCP_MAXHLEN", - "TCP_MAXOLEN", - "TCP_MAXSEG", - "TCP_MAXWIN", - "TCP_MAX_SACK", - "TCP_MAX_WINSHIFT", - "TCP_MD5SIG", - "TCP_MD5SIG_MAXKEYLEN", - "TCP_MINMSS", - "TCP_MINMSSOVERLOAD", - "TCP_MSS", - "TCP_NODELAY", - "TCP_NOOPT", - "TCP_NOPUSH", - "TCP_NOTSENT_LOWAT", - "TCP_NSTATES", - "TCP_QUICKACK", - "TCP_RXT_CONNDROPTIME", - "TCP_RXT_FINDROP", - "TCP_SACK_ENABLE", - "TCP_SENDMOREACKS", - "TCP_SYNCNT", - "TCP_VENDOR", - "TCP_WINDOW_CLAMP", - "TCSAFLUSH", - "TCSETS", - "TF_DISCONNECT", - "TF_REUSE_SOCKET", - "TF_USE_DEFAULT_WORKER", - "TF_USE_KERNEL_APC", - "TF_USE_SYSTEM_THREAD", - "TF_WRITE_BEHIND", - "TH32CS_INHERIT", - "TH32CS_SNAPALL", - "TH32CS_SNAPHEAPLIST", - "TH32CS_SNAPMODULE", - "TH32CS_SNAPMODULE32", - "TH32CS_SNAPPROCESS", - "TH32CS_SNAPTHREAD", - "TIME_ZONE_ID_DAYLIGHT", - "TIME_ZONE_ID_STANDARD", - "TIME_ZONE_ID_UNKNOWN", - "TIOCCBRK", - "TIOCCDTR", - "TIOCCONS", - "TIOCDCDTIMESTAMP", - "TIOCDRAIN", - "TIOCDSIMICROCODE", - "TIOCEXCL", - "TIOCEXT", - "TIOCFLAG_CDTRCTS", - "TIOCFLAG_CLOCAL", - "TIOCFLAG_CRTSCTS", - "TIOCFLAG_MDMBUF", - "TIOCFLAG_PPS", - "TIOCFLAG_SOFTCAR", - "TIOCFLUSH", - "TIOCGDEV", - "TIOCGDRAINWAIT", - "TIOCGETA", - "TIOCGETD", - "TIOCGFLAGS", - "TIOCGICOUNT", - "TIOCGLCKTRMIOS", - "TIOCGLINED", - "TIOCGPGRP", - "TIOCGPTN", - "TIOCGQSIZE", - "TIOCGRANTPT", - "TIOCGRS485", - "TIOCGSERIAL", - "TIOCGSID", - "TIOCGSIZE", - "TIOCGSOFTCAR", - "TIOCGTSTAMP", - "TIOCGWINSZ", - "TIOCINQ", - "TIOCIXOFF", - "TIOCIXON", - "TIOCLINUX", - "TIOCMBIC", - "TIOCMBIS", - "TIOCMGDTRWAIT", - "TIOCMGET", - "TIOCMIWAIT", - "TIOCMODG", - "TIOCMODS", - "TIOCMSDTRWAIT", - "TIOCMSET", - "TIOCM_CAR", - "TIOCM_CD", - "TIOCM_CTS", - "TIOCM_DCD", - "TIOCM_DSR", - "TIOCM_DTR", - "TIOCM_LE", - "TIOCM_RI", - "TIOCM_RNG", - "TIOCM_RTS", - "TIOCM_SR", - "TIOCM_ST", - "TIOCNOTTY", - "TIOCNXCL", - "TIOCOUTQ", - "TIOCPKT", - "TIOCPKT_DATA", - "TIOCPKT_DOSTOP", - "TIOCPKT_FLUSHREAD", - "TIOCPKT_FLUSHWRITE", - "TIOCPKT_IOCTL", - "TIOCPKT_NOSTOP", - "TIOCPKT_START", - "TIOCPKT_STOP", - "TIOCPTMASTER", - "TIOCPTMGET", - "TIOCPTSNAME", - "TIOCPTYGNAME", - "TIOCPTYGRANT", - "TIOCPTYUNLK", - "TIOCRCVFRAME", - "TIOCREMOTE", - "TIOCSBRK", - "TIOCSCONS", - "TIOCSCTTY", - "TIOCSDRAINWAIT", - "TIOCSDTR", - "TIOCSERCONFIG", - "TIOCSERGETLSR", - "TIOCSERGETMULTI", - "TIOCSERGSTRUCT", - "TIOCSERGWILD", - "TIOCSERSETMULTI", - "TIOCSERSWILD", - "TIOCSER_TEMT", - "TIOCSETA", - "TIOCSETAF", - "TIOCSETAW", - "TIOCSETD", - "TIOCSFLAGS", - "TIOCSIG", - "TIOCSLCKTRMIOS", - "TIOCSLINED", - "TIOCSPGRP", - "TIOCSPTLCK", - "TIOCSQSIZE", - "TIOCSRS485", - "TIOCSSERIAL", - "TIOCSSIZE", - "TIOCSSOFTCAR", - "TIOCSTART", - "TIOCSTAT", - "TIOCSTI", - "TIOCSTOP", - "TIOCSTSTAMP", - "TIOCSWINSZ", - "TIOCTIMESTAMP", - "TIOCUCNTL", - "TIOCVHANGUP", - "TIOCXMTFRAME", - "TOKEN_ADJUST_DEFAULT", - "TOKEN_ADJUST_GROUPS", - "TOKEN_ADJUST_PRIVILEGES", - "TOKEN_ADJUST_SESSIONID", - "TOKEN_ALL_ACCESS", - "TOKEN_ASSIGN_PRIMARY", - "TOKEN_DUPLICATE", - "TOKEN_EXECUTE", - "TOKEN_IMPERSONATE", - "TOKEN_QUERY", - "TOKEN_QUERY_SOURCE", - "TOKEN_READ", - "TOKEN_WRITE", - "TOSTOP", - "TRUNCATE_EXISTING", - "TUNATTACHFILTER", - "TUNDETACHFILTER", - "TUNGETFEATURES", - "TUNGETIFF", - "TUNGETSNDBUF", - "TUNGETVNETHDRSZ", - "TUNSETDEBUG", - "TUNSETGROUP", - "TUNSETIFF", - "TUNSETLINK", - "TUNSETNOCSUM", - "TUNSETOFFLOAD", - "TUNSETOWNER", - "TUNSETPERSIST", - "TUNSETSNDBUF", - "TUNSETTXFILTER", - "TUNSETVNETHDRSZ", - "Tee", - "TerminateProcess", - "Termios", - "Tgkill", - "Time", - "Time_t", - "Times", - "Timespec", - "TimespecToNsec", - "Timeval", - "Timeval32", - "TimevalToNsec", - "Timex", - "Timezoneinformation", - "Tms", - "Token", - "TokenAccessInformation", - "TokenAuditPolicy", - "TokenDefaultDacl", - "TokenElevation", - "TokenElevationType", - "TokenGroups", - "TokenGroupsAndPrivileges", - "TokenHasRestrictions", - "TokenImpersonationLevel", - "TokenIntegrityLevel", - "TokenLinkedToken", - "TokenLogonSid", - "TokenMandatoryPolicy", - "TokenOrigin", - "TokenOwner", - "TokenPrimaryGroup", - "TokenPrivileges", - "TokenRestrictedSids", - "TokenSandBoxInert", - "TokenSessionId", - "TokenSessionReference", - "TokenSource", - "TokenStatistics", - "TokenType", - "TokenUIAccess", - "TokenUser", - "TokenVirtualizationAllowed", - "TokenVirtualizationEnabled", - "Tokenprimarygroup", - "Tokenuser", - "TranslateAccountName", - "TranslateName", - "TransmitFile", - "TransmitFileBuffers", - "Truncate", - "UNIX_PATH_MAX", - "USAGE_MATCH_TYPE_AND", - "USAGE_MATCH_TYPE_OR", - "UTF16FromString", - "UTF16PtrFromString", - "UTF16ToString", - "Ucred", - "Umask", - "Uname", - "Undelete", - "UnixCredentials", - "UnixRights", - "Unlink", - "Unlinkat", - "UnmapViewOfFile", - "Unmount", - "Unsetenv", - "Unshare", - "UserInfo10", - "Ustat", - "Ustat_t", - "Utimbuf", - "Utime", - "Utimes", - "UtimesNano", - "Utsname", - "VDISCARD", - "VDSUSP", - "VEOF", - "VEOL", - "VEOL2", - "VERASE", - "VERASE2", - "VINTR", - "VKILL", - "VLNEXT", - "VMIN", - "VQUIT", - "VREPRINT", - "VSTART", - "VSTATUS", - "VSTOP", - "VSUSP", - "VSWTC", - "VT0", - "VT1", - "VTDLY", - "VTIME", - "VWERASE", - "VirtualLock", - "VirtualUnlock", - "WAIT_ABANDONED", - "WAIT_FAILED", - "WAIT_OBJECT_0", - "WAIT_TIMEOUT", - "WALL", - "WALLSIG", - "WALTSIG", - "WCLONE", - "WCONTINUED", - "WCOREFLAG", - "WEXITED", - "WLINUXCLONE", - "WNOHANG", - "WNOTHREAD", - "WNOWAIT", - "WNOZOMBIE", - "WOPTSCHECKED", - "WORDSIZE", - "WSABuf", - "WSACleanup", - "WSADESCRIPTION_LEN", - "WSAData", - "WSAEACCES", - "WSAECONNABORTED", - "WSAECONNRESET", - "WSAEnumProtocols", - "WSAID_CONNECTEX", - "WSAIoctl", - "WSAPROTOCOL_LEN", - "WSAProtocolChain", - "WSAProtocolInfo", - "WSARecv", - "WSARecvFrom", - "WSASYS_STATUS_LEN", - "WSASend", - "WSASendTo", - "WSASendto", - "WSAStartup", - "WSTOPPED", - "WTRAPPED", - "WUNTRACED", - "Wait4", - "WaitForSingleObject", - "WaitStatus", - "Win32FileAttributeData", - "Win32finddata", - "Write", - "WriteConsole", - "WriteFile", - "X509_ASN_ENCODING", - "XCASE", - "XP1_CONNECTIONLESS", - "XP1_CONNECT_DATA", - "XP1_DISCONNECT_DATA", - "XP1_EXPEDITED_DATA", - "XP1_GRACEFUL_CLOSE", - "XP1_GUARANTEED_DELIVERY", - "XP1_GUARANTEED_ORDER", - "XP1_IFS_HANDLES", - "XP1_MESSAGE_ORIENTED", - "XP1_MULTIPOINT_CONTROL_PLANE", - "XP1_MULTIPOINT_DATA_PLANE", - "XP1_PARTIAL_MESSAGE", - "XP1_PSEUDO_STREAM", - "XP1_QOS_SUPPORTED", - "XP1_SAN_SUPPORT_SDP", - "XP1_SUPPORT_BROADCAST", - "XP1_SUPPORT_MULTIPOINT", - "XP1_UNI_RECV", - "XP1_UNI_SEND", - }, - "syscall/js": { - "CopyBytesToGo", - "CopyBytesToJS", - "Error", - "Func", - "FuncOf", - "Global", - "Null", - "Type", - "TypeBoolean", - "TypeFunction", - "TypeNull", - "TypeNumber", - "TypeObject", - "TypeString", - "TypeSymbol", - "TypeUndefined", - "Undefined", - "Value", - "ValueError", - "ValueOf", - }, - "testing": { - "AllocsPerRun", - "B", - "Benchmark", - "BenchmarkResult", - "Cover", - "CoverBlock", - "CoverMode", - "Coverage", - "F", - "Init", - "InternalBenchmark", - "InternalExample", - "InternalFuzzTarget", - "InternalTest", - "M", - "Main", - "MainStart", - "PB", - "RegisterCover", - "RunBenchmarks", - "RunExamples", - "RunTests", - "Short", - "T", - "TB", - "Verbose", - }, - "testing/fstest": { - "MapFS", - "MapFile", - "TestFS", - }, - "testing/iotest": { - "DataErrReader", - "ErrReader", - "ErrTimeout", - "HalfReader", - "NewReadLogger", - "NewWriteLogger", - "OneByteReader", - "TestReader", - "TimeoutReader", - "TruncateWriter", - }, - "testing/quick": { - "Check", - "CheckEqual", - "CheckEqualError", - "CheckError", - "Config", - "Generator", - "SetupError", - "Value", - }, - "text/scanner": { - "Char", - "Comment", - "EOF", - "Float", - "GoTokens", - "GoWhitespace", - "Ident", - "Int", - "Position", - "RawString", - "ScanChars", - "ScanComments", - "ScanFloats", - "ScanIdents", - "ScanInts", - "ScanRawStrings", - "ScanStrings", - "Scanner", - "SkipComments", - "String", - "TokenString", - }, - "text/tabwriter": { - "AlignRight", - "Debug", - "DiscardEmptyColumns", - "Escape", - "FilterHTML", - "NewWriter", - "StripEscape", - "TabIndent", - "Writer", - }, - "text/template": { - "ExecError", - "FuncMap", - "HTMLEscape", - "HTMLEscapeString", - "HTMLEscaper", - "IsTrue", - "JSEscape", - "JSEscapeString", - "JSEscaper", - "Must", - "New", - "ParseFS", - "ParseFiles", - "ParseGlob", - "Template", - "URLQueryEscaper", - }, - "text/template/parse": { - "ActionNode", - "BoolNode", - "BranchNode", - "BreakNode", - "ChainNode", - "CommandNode", - "CommentNode", - "ContinueNode", - "DotNode", - "FieldNode", - "IdentifierNode", - "IfNode", - "IsEmptyTree", - "ListNode", - "Mode", - "New", - "NewIdentifier", - "NilNode", - "Node", - "NodeAction", - "NodeBool", - "NodeBreak", - "NodeChain", - "NodeCommand", - "NodeComment", - "NodeContinue", - "NodeDot", - "NodeField", - "NodeIdentifier", - "NodeIf", - "NodeList", - "NodeNil", - "NodeNumber", - "NodePipe", - "NodeRange", - "NodeString", - "NodeTemplate", - "NodeText", - "NodeType", - "NodeVariable", - "NodeWith", - "NumberNode", - "Parse", - "ParseComments", - "PipeNode", - "Pos", - "RangeNode", - "SkipFuncCheck", - "StringNode", - "TemplateNode", - "TextNode", - "Tree", - "VariableNode", - "WithNode", - }, - "time": { - "ANSIC", - "After", - "AfterFunc", - "April", - "August", - "Date", - "DateOnly", - "DateTime", - "December", - "Duration", - "February", - "FixedZone", - "Friday", - "Hour", - "January", - "July", - "June", - "Kitchen", - "Layout", - "LoadLocation", - "LoadLocationFromTZData", - "Local", - "Location", - "March", - "May", - "Microsecond", - "Millisecond", - "Minute", - "Monday", - "Month", - "Nanosecond", - "NewTicker", - "NewTimer", - "November", - "Now", - "October", - "Parse", - "ParseDuration", - "ParseError", - "ParseInLocation", - "RFC1123", - "RFC1123Z", - "RFC3339", - "RFC3339Nano", - "RFC822", - "RFC822Z", - "RFC850", - "RubyDate", - "Saturday", - "Second", - "September", - "Since", - "Sleep", - "Stamp", - "StampMicro", - "StampMilli", - "StampNano", - "Sunday", - "Thursday", - "Tick", - "Ticker", - "Time", - "TimeOnly", - "Timer", - "Tuesday", - "UTC", - "Unix", - "UnixDate", - "UnixMicro", - "UnixMilli", - "Until", - "Wednesday", - "Weekday", - }, - "unicode": { - "ASCII_Hex_Digit", - "Adlam", - "Ahom", - "Anatolian_Hieroglyphs", - "Arabic", - "Armenian", - "Avestan", - "AzeriCase", - "Balinese", - "Bamum", - "Bassa_Vah", - "Batak", - "Bengali", - "Bhaiksuki", - "Bidi_Control", - "Bopomofo", - "Brahmi", - "Braille", - "Buginese", - "Buhid", - "C", - "Canadian_Aboriginal", - "Carian", - "CaseRange", - "CaseRanges", - "Categories", - "Caucasian_Albanian", - "Cc", - "Cf", - "Chakma", - "Cham", - "Cherokee", - "Chorasmian", - "Co", - "Common", - "Coptic", - "Cs", - "Cuneiform", - "Cypriot", - "Cyrillic", - "Dash", - "Deprecated", - "Deseret", - "Devanagari", - "Diacritic", - "Digit", - "Dives_Akuru", - "Dogra", - "Duployan", - "Egyptian_Hieroglyphs", - "Elbasan", - "Elymaic", - "Ethiopic", - "Extender", - "FoldCategory", - "FoldScript", - "Georgian", - "Glagolitic", - "Gothic", - "Grantha", - "GraphicRanges", - "Greek", - "Gujarati", - "Gunjala_Gondi", - "Gurmukhi", - "Han", - "Hangul", - "Hanifi_Rohingya", - "Hanunoo", - "Hatran", - "Hebrew", - "Hex_Digit", - "Hiragana", - "Hyphen", - "IDS_Binary_Operator", - "IDS_Trinary_Operator", - "Ideographic", - "Imperial_Aramaic", - "In", - "Inherited", - "Inscriptional_Pahlavi", - "Inscriptional_Parthian", - "Is", - "IsControl", - "IsDigit", - "IsGraphic", - "IsLetter", - "IsLower", - "IsMark", - "IsNumber", - "IsOneOf", - "IsPrint", - "IsPunct", - "IsSpace", - "IsSymbol", - "IsTitle", - "IsUpper", - "Javanese", - "Join_Control", - "Kaithi", - "Kannada", - "Katakana", - "Kayah_Li", - "Kharoshthi", - "Khitan_Small_Script", - "Khmer", - "Khojki", - "Khudawadi", - "L", - "Lao", - "Latin", - "Lepcha", - "Letter", - "Limbu", - "Linear_A", - "Linear_B", - "Lisu", - "Ll", - "Lm", - "Lo", - "Logical_Order_Exception", - "Lower", - "LowerCase", - "Lt", - "Lu", - "Lycian", - "Lydian", - "M", - "Mahajani", - "Makasar", - "Malayalam", - "Mandaic", - "Manichaean", - "Marchen", - "Mark", - "Masaram_Gondi", - "MaxASCII", - "MaxCase", - "MaxLatin1", - "MaxRune", - "Mc", - "Me", - "Medefaidrin", - "Meetei_Mayek", - "Mende_Kikakui", - "Meroitic_Cursive", - "Meroitic_Hieroglyphs", - "Miao", - "Mn", - "Modi", - "Mongolian", - "Mro", - "Multani", - "Myanmar", - "N", - "Nabataean", - "Nandinagari", - "Nd", - "New_Tai_Lue", - "Newa", - "Nko", - "Nl", - "No", - "Noncharacter_Code_Point", - "Number", - "Nushu", - "Nyiakeng_Puachue_Hmong", - "Ogham", - "Ol_Chiki", - "Old_Hungarian", - "Old_Italic", - "Old_North_Arabian", - "Old_Permic", - "Old_Persian", - "Old_Sogdian", - "Old_South_Arabian", - "Old_Turkic", - "Oriya", - "Osage", - "Osmanya", - "Other", - "Other_Alphabetic", - "Other_Default_Ignorable_Code_Point", - "Other_Grapheme_Extend", - "Other_ID_Continue", - "Other_ID_Start", - "Other_Lowercase", - "Other_Math", - "Other_Uppercase", - "P", - "Pahawh_Hmong", - "Palmyrene", - "Pattern_Syntax", - "Pattern_White_Space", - "Pau_Cin_Hau", - "Pc", - "Pd", - "Pe", - "Pf", - "Phags_Pa", - "Phoenician", - "Pi", - "Po", - "Prepended_Concatenation_Mark", - "PrintRanges", - "Properties", - "Ps", - "Psalter_Pahlavi", - "Punct", - "Quotation_Mark", - "Radical", - "Range16", - "Range32", - "RangeTable", - "Regional_Indicator", - "Rejang", - "ReplacementChar", - "Runic", - "S", - "STerm", - "Samaritan", - "Saurashtra", - "Sc", - "Scripts", - "Sentence_Terminal", - "Sharada", - "Shavian", - "Siddham", - "SignWriting", - "SimpleFold", - "Sinhala", - "Sk", - "Sm", - "So", - "Soft_Dotted", - "Sogdian", - "Sora_Sompeng", - "Soyombo", - "Space", - "SpecialCase", - "Sundanese", - "Syloti_Nagri", - "Symbol", - "Syriac", - "Tagalog", - "Tagbanwa", - "Tai_Le", - "Tai_Tham", - "Tai_Viet", - "Takri", - "Tamil", - "Tangut", - "Telugu", - "Terminal_Punctuation", - "Thaana", - "Thai", - "Tibetan", - "Tifinagh", - "Tirhuta", - "Title", - "TitleCase", - "To", - "ToLower", - "ToTitle", - "ToUpper", - "TurkishCase", - "Ugaritic", - "Unified_Ideograph", - "Upper", - "UpperCase", - "UpperLower", - "Vai", - "Variation_Selector", - "Version", - "Wancho", - "Warang_Citi", - "White_Space", - "Yezidi", - "Yi", - "Z", - "Zanabazar_Square", - "Zl", - "Zp", - "Zs", - }, - "unicode/utf16": { - "AppendRune", - "Decode", - "DecodeRune", - "Encode", - "EncodeRune", - "IsSurrogate", - }, - "unicode/utf8": { - "AppendRune", - "DecodeLastRune", - "DecodeLastRuneInString", - "DecodeRune", - "DecodeRuneInString", - "EncodeRune", - "FullRune", - "FullRuneInString", - "MaxRune", - "RuneCount", - "RuneCountInString", - "RuneError", - "RuneLen", - "RuneSelf", - "RuneStart", - "UTFMax", - "Valid", - "ValidRune", - "ValidString", - }, - "unsafe": { - "Add", - "Alignof", - "Offsetof", - "Pointer", - "Sizeof", - "Slice", - "SliceData", - "String", - "StringData", - }, -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/packagesinternal/packages.go deleted file mode 100644 index d9950b1f0bef..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/packagesinternal/packages.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package packagesinternal exposes internal-only fields from go/packages. -package packagesinternal - -import ( - "golang.org/x/tools/internal/gocommand" -) - -var GetForTest = func(p interface{}) string { return "" } -var GetDepsErrors = func(p interface{}) []*PackageError { return nil } - -type PackageError struct { - ImportStack []string // shortest path from package named on command line to this one - Pos string // position of error (if present, file:line:col) - Err string // the error itself -} - -var GetGoCmdRunner = func(config interface{}) *gocommand.Runner { return nil } - -var SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) {} - -var TypecheckCgo int -var DepsErrors int // must be set as a LoadMode to call GetDepsErrors -var ForTest int // must be set as a LoadMode to call GetForTest - -var SetModFlag = func(config interface{}, value string) {} -var SetModFile = func(config interface{}, value string) {} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/codes.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/codes.go deleted file mode 100644 index f0cabde96eba..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/codes.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -// A Code is an enum value that can be encoded into bitstreams. -// -// Code types are preferable for enum types, because they allow -// Decoder to detect desyncs. -type Code interface { - // Marker returns the SyncMarker for the Code's dynamic type. - Marker() SyncMarker - - // Value returns the Code's ordinal value. - Value() int -} - -// A CodeVal distinguishes among go/constant.Value encodings. -type CodeVal int - -func (c CodeVal) Marker() SyncMarker { return SyncVal } -func (c CodeVal) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - ValBool CodeVal = iota - ValString - ValInt64 - ValBigInt - ValBigRat - ValBigFloat -) - -// A CodeType distinguishes among go/types.Type encodings. -type CodeType int - -func (c CodeType) Marker() SyncMarker { return SyncType } -func (c CodeType) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - TypeBasic CodeType = iota - TypeNamed - TypePointer - TypeSlice - TypeArray - TypeChan - TypeMap - TypeSignature - TypeStruct - TypeInterface - TypeUnion - TypeTypeParam -) - -// A CodeObj distinguishes among go/types.Object encodings. -type CodeObj int - -func (c CodeObj) Marker() SyncMarker { return SyncCodeObj } -func (c CodeObj) Value() int { return int(c) } - -// Note: These values are public and cannot be changed without -// updating the go/types importers. - -const ( - ObjAlias CodeObj = iota - ObjConst - ObjType - ObjFunc - ObjVar - ObjStub -) diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/decoder.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/decoder.go deleted file mode 100644 index b92e8e6eb329..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/decoder.go +++ /dev/null @@ -1,517 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "encoding/binary" - "errors" - "fmt" - "go/constant" - "go/token" - "io" - "math/big" - "os" - "runtime" - "strings" -) - -// A PkgDecoder provides methods for decoding a package's Unified IR -// export data. -type PkgDecoder struct { - // version is the file format version. - version uint32 - - // sync indicates whether the file uses sync markers. - sync bool - - // pkgPath is the package path for the package to be decoded. - // - // TODO(mdempsky): Remove; unneeded since CL 391014. - pkgPath string - - // elemData is the full data payload of the encoded package. - // Elements are densely and contiguously packed together. - // - // The last 8 bytes of elemData are the package fingerprint. - elemData string - - // elemEnds stores the byte-offset end positions of element - // bitstreams within elemData. - // - // For example, element I's bitstream data starts at elemEnds[I-1] - // (or 0, if I==0) and ends at elemEnds[I]. - // - // Note: elemEnds is indexed by absolute indices, not - // section-relative indices. - elemEnds []uint32 - - // elemEndsEnds stores the index-offset end positions of relocation - // sections within elemEnds. - // - // For example, section K's end positions start at elemEndsEnds[K-1] - // (or 0, if K==0) and end at elemEndsEnds[K]. - elemEndsEnds [numRelocs]uint32 - - scratchRelocEnt []RelocEnt -} - -// PkgPath returns the package path for the package -// -// TODO(mdempsky): Remove; unneeded since CL 391014. -func (pr *PkgDecoder) PkgPath() string { return pr.pkgPath } - -// SyncMarkers reports whether pr uses sync markers. -func (pr *PkgDecoder) SyncMarkers() bool { return pr.sync } - -// NewPkgDecoder returns a PkgDecoder initialized to read the Unified -// IR export data from input. pkgPath is the package path for the -// compilation unit that produced the export data. -// -// TODO(mdempsky): Remove pkgPath parameter; unneeded since CL 391014. -func NewPkgDecoder(pkgPath, input string) PkgDecoder { - pr := PkgDecoder{ - pkgPath: pkgPath, - } - - // TODO(mdempsky): Implement direct indexing of input string to - // avoid copying the position information. - - r := strings.NewReader(input) - - assert(binary.Read(r, binary.LittleEndian, &pr.version) == nil) - - switch pr.version { - default: - panic(fmt.Errorf("unsupported version: %v", pr.version)) - case 0: - // no flags - case 1: - var flags uint32 - assert(binary.Read(r, binary.LittleEndian, &flags) == nil) - pr.sync = flags&flagSyncMarkers != 0 - } - - assert(binary.Read(r, binary.LittleEndian, pr.elemEndsEnds[:]) == nil) - - pr.elemEnds = make([]uint32, pr.elemEndsEnds[len(pr.elemEndsEnds)-1]) - assert(binary.Read(r, binary.LittleEndian, pr.elemEnds[:]) == nil) - - pos, err := r.Seek(0, io.SeekCurrent) - assert(err == nil) - - pr.elemData = input[pos:] - assert(len(pr.elemData)-8 == int(pr.elemEnds[len(pr.elemEnds)-1])) - - return pr -} - -// NumElems returns the number of elements in section k. -func (pr *PkgDecoder) NumElems(k RelocKind) int { - count := int(pr.elemEndsEnds[k]) - if k > 0 { - count -= int(pr.elemEndsEnds[k-1]) - } - return count -} - -// TotalElems returns the total number of elements across all sections. -func (pr *PkgDecoder) TotalElems() int { - return len(pr.elemEnds) -} - -// Fingerprint returns the package fingerprint. -func (pr *PkgDecoder) Fingerprint() [8]byte { - var fp [8]byte - copy(fp[:], pr.elemData[len(pr.elemData)-8:]) - return fp -} - -// AbsIdx returns the absolute index for the given (section, index) -// pair. -func (pr *PkgDecoder) AbsIdx(k RelocKind, idx Index) int { - absIdx := int(idx) - if k > 0 { - absIdx += int(pr.elemEndsEnds[k-1]) - } - if absIdx >= int(pr.elemEndsEnds[k]) { - errorf("%v:%v is out of bounds; %v", k, idx, pr.elemEndsEnds) - } - return absIdx -} - -// DataIdx returns the raw element bitstream for the given (section, -// index) pair. -func (pr *PkgDecoder) DataIdx(k RelocKind, idx Index) string { - absIdx := pr.AbsIdx(k, idx) - - var start uint32 - if absIdx > 0 { - start = pr.elemEnds[absIdx-1] - } - end := pr.elemEnds[absIdx] - - return pr.elemData[start:end] -} - -// StringIdx returns the string value for the given string index. -func (pr *PkgDecoder) StringIdx(idx Index) string { - return pr.DataIdx(RelocString, idx) -} - -// NewDecoder returns a Decoder for the given (section, index) pair, -// and decodes the given SyncMarker from the element bitstream. -func (pr *PkgDecoder) NewDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder { - r := pr.NewDecoderRaw(k, idx) - r.Sync(marker) - return r -} - -// TempDecoder returns a Decoder for the given (section, index) pair, -// and decodes the given SyncMarker from the element bitstream. -// If possible the Decoder should be RetireDecoder'd when it is no longer -// needed, this will avoid heap allocations. -func (pr *PkgDecoder) TempDecoder(k RelocKind, idx Index, marker SyncMarker) Decoder { - r := pr.TempDecoderRaw(k, idx) - r.Sync(marker) - return r -} - -func (pr *PkgDecoder) RetireDecoder(d *Decoder) { - pr.scratchRelocEnt = d.Relocs - d.Relocs = nil -} - -// NewDecoderRaw returns a Decoder for the given (section, index) pair. -// -// Most callers should use NewDecoder instead. -func (pr *PkgDecoder) NewDecoderRaw(k RelocKind, idx Index) Decoder { - r := Decoder{ - common: pr, - k: k, - Idx: idx, - } - - // TODO(mdempsky) r.data.Reset(...) after #44505 is resolved. - r.Data = *strings.NewReader(pr.DataIdx(k, idx)) - - r.Sync(SyncRelocs) - r.Relocs = make([]RelocEnt, r.Len()) - for i := range r.Relocs { - r.Sync(SyncReloc) - r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())} - } - - return r -} - -func (pr *PkgDecoder) TempDecoderRaw(k RelocKind, idx Index) Decoder { - r := Decoder{ - common: pr, - k: k, - Idx: idx, - } - - r.Data.Reset(pr.DataIdx(k, idx)) - r.Sync(SyncRelocs) - l := r.Len() - if cap(pr.scratchRelocEnt) >= l { - r.Relocs = pr.scratchRelocEnt[:l] - pr.scratchRelocEnt = nil - } else { - r.Relocs = make([]RelocEnt, l) - } - for i := range r.Relocs { - r.Sync(SyncReloc) - r.Relocs[i] = RelocEnt{RelocKind(r.Len()), Index(r.Len())} - } - - return r -} - -// A Decoder provides methods for decoding an individual element's -// bitstream data. -type Decoder struct { - common *PkgDecoder - - Relocs []RelocEnt - Data strings.Reader - - k RelocKind - Idx Index -} - -func (r *Decoder) checkErr(err error) { - if err != nil { - errorf("unexpected decoding error: %w", err) - } -} - -func (r *Decoder) rawUvarint() uint64 { - x, err := readUvarint(&r.Data) - r.checkErr(err) - return x -} - -// readUvarint is a type-specialized copy of encoding/binary.ReadUvarint. -// This avoids the interface conversion and thus has better escape properties, -// which flows up the stack. -func readUvarint(r *strings.Reader) (uint64, error) { - var x uint64 - var s uint - for i := 0; i < binary.MaxVarintLen64; i++ { - b, err := r.ReadByte() - if err != nil { - if i > 0 && err == io.EOF { - err = io.ErrUnexpectedEOF - } - return x, err - } - if b < 0x80 { - if i == binary.MaxVarintLen64-1 && b > 1 { - return x, overflow - } - return x | uint64(b)<> 1) - if ux&1 != 0 { - x = ^x - } - return x -} - -func (r *Decoder) rawReloc(k RelocKind, idx int) Index { - e := r.Relocs[idx] - assert(e.Kind == k) - return e.Idx -} - -// Sync decodes a sync marker from the element bitstream and asserts -// that it matches the expected marker. -// -// If r.common.sync is false, then Sync is a no-op. -func (r *Decoder) Sync(mWant SyncMarker) { - if !r.common.sync { - return - } - - pos, _ := r.Data.Seek(0, io.SeekCurrent) - mHave := SyncMarker(r.rawUvarint()) - writerPCs := make([]int, r.rawUvarint()) - for i := range writerPCs { - writerPCs[i] = int(r.rawUvarint()) - } - - if mHave == mWant { - return - } - - // There's some tension here between printing: - // - // (1) full file paths that tools can recognize (e.g., so emacs - // hyperlinks the "file:line" text for easy navigation), or - // - // (2) short file paths that are easier for humans to read (e.g., by - // omitting redundant or irrelevant details, so it's easier to - // focus on the useful bits that remain). - // - // The current formatting favors the former, as it seems more - // helpful in practice. But perhaps the formatting could be improved - // to better address both concerns. For example, use relative file - // paths if they would be shorter, or rewrite file paths to contain - // "$GOROOT" (like objabi.AbsFile does) if tools can be taught how - // to reliably expand that again. - - fmt.Printf("export data desync: package %q, section %v, index %v, offset %v\n", r.common.pkgPath, r.k, r.Idx, pos) - - fmt.Printf("\nfound %v, written at:\n", mHave) - if len(writerPCs) == 0 { - fmt.Printf("\t[stack trace unavailable; recompile package %q with -d=syncframes]\n", r.common.pkgPath) - } - for _, pc := range writerPCs { - fmt.Printf("\t%s\n", r.common.StringIdx(r.rawReloc(RelocString, pc))) - } - - fmt.Printf("\nexpected %v, reading at:\n", mWant) - var readerPCs [32]uintptr // TODO(mdempsky): Dynamically size? - n := runtime.Callers(2, readerPCs[:]) - for _, pc := range fmtFrames(readerPCs[:n]...) { - fmt.Printf("\t%s\n", pc) - } - - // We already printed a stack trace for the reader, so now we can - // simply exit. Printing a second one with panic or base.Fatalf - // would just be noise. - os.Exit(1) -} - -// Bool decodes and returns a bool value from the element bitstream. -func (r *Decoder) Bool() bool { - r.Sync(SyncBool) - x, err := r.Data.ReadByte() - r.checkErr(err) - assert(x < 2) - return x != 0 -} - -// Int64 decodes and returns an int64 value from the element bitstream. -func (r *Decoder) Int64() int64 { - r.Sync(SyncInt64) - return r.rawVarint() -} - -// Uint64 decodes and returns a uint64 value from the element bitstream. -func (r *Decoder) Uint64() uint64 { - r.Sync(SyncUint64) - return r.rawUvarint() -} - -// Len decodes and returns a non-negative int value from the element bitstream. -func (r *Decoder) Len() int { x := r.Uint64(); v := int(x); assert(uint64(v) == x); return v } - -// Int decodes and returns an int value from the element bitstream. -func (r *Decoder) Int() int { x := r.Int64(); v := int(x); assert(int64(v) == x); return v } - -// Uint decodes and returns a uint value from the element bitstream. -func (r *Decoder) Uint() uint { x := r.Uint64(); v := uint(x); assert(uint64(v) == x); return v } - -// Code decodes a Code value from the element bitstream and returns -// its ordinal value. It's the caller's responsibility to convert the -// result to an appropriate Code type. -// -// TODO(mdempsky): Ideally this method would have signature "Code[T -// Code] T" instead, but we don't allow generic methods and the -// compiler can't depend on generics yet anyway. -func (r *Decoder) Code(mark SyncMarker) int { - r.Sync(mark) - return r.Len() -} - -// Reloc decodes a relocation of expected section k from the element -// bitstream and returns an index to the referenced element. -func (r *Decoder) Reloc(k RelocKind) Index { - r.Sync(SyncUseReloc) - return r.rawReloc(k, r.Len()) -} - -// String decodes and returns a string value from the element -// bitstream. -func (r *Decoder) String() string { - r.Sync(SyncString) - return r.common.StringIdx(r.Reloc(RelocString)) -} - -// Strings decodes and returns a variable-length slice of strings from -// the element bitstream. -func (r *Decoder) Strings() []string { - res := make([]string, r.Len()) - for i := range res { - res[i] = r.String() - } - return res -} - -// Value decodes and returns a constant.Value from the element -// bitstream. -func (r *Decoder) Value() constant.Value { - r.Sync(SyncValue) - isComplex := r.Bool() - val := r.scalar() - if isComplex { - val = constant.BinaryOp(val, token.ADD, constant.MakeImag(r.scalar())) - } - return val -} - -func (r *Decoder) scalar() constant.Value { - switch tag := CodeVal(r.Code(SyncVal)); tag { - default: - panic(fmt.Errorf("unexpected scalar tag: %v", tag)) - - case ValBool: - return constant.MakeBool(r.Bool()) - case ValString: - return constant.MakeString(r.String()) - case ValInt64: - return constant.MakeInt64(r.Int64()) - case ValBigInt: - return constant.Make(r.bigInt()) - case ValBigRat: - num := r.bigInt() - denom := r.bigInt() - return constant.Make(new(big.Rat).SetFrac(num, denom)) - case ValBigFloat: - return constant.Make(r.bigFloat()) - } -} - -func (r *Decoder) bigInt() *big.Int { - v := new(big.Int).SetBytes([]byte(r.String())) - if r.Bool() { - v.Neg(v) - } - return v -} - -func (r *Decoder) bigFloat() *big.Float { - v := new(big.Float).SetPrec(512) - assert(v.UnmarshalText([]byte(r.String())) == nil) - return v -} - -// @@@ Helpers - -// TODO(mdempsky): These should probably be removed. I think they're a -// smell that the export data format is not yet quite right. - -// PeekPkgPath returns the package path for the specified package -// index. -func (pr *PkgDecoder) PeekPkgPath(idx Index) string { - var path string - { - r := pr.TempDecoder(RelocPkg, idx, SyncPkgDef) - path = r.String() - pr.RetireDecoder(&r) - } - if path == "" { - path = pr.pkgPath - } - return path -} - -// PeekObj returns the package path, object name, and CodeObj for the -// specified object index. -func (pr *PkgDecoder) PeekObj(idx Index) (string, string, CodeObj) { - var ridx Index - var name string - var rcode int - { - r := pr.TempDecoder(RelocName, idx, SyncObject1) - r.Sync(SyncSym) - r.Sync(SyncPkg) - ridx = r.Reloc(RelocPkg) - name = r.String() - rcode = r.Code(SyncCodeObj) - pr.RetireDecoder(&r) - } - - path := pr.PeekPkgPath(ridx) - assert(name != "") - - tag := CodeObj(rcode) - - return path, name, tag -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/doc.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/doc.go deleted file mode 100644 index c8a2796b5e4c..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/doc.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package pkgbits implements low-level coding abstractions for -// Unified IR's export data format. -// -// At a low-level, a package is a collection of bitstream elements. -// Each element has a "kind" and a dense, non-negative index. -// Elements can be randomly accessed given their kind and index. -// -// Individual elements are sequences of variable-length values (e.g., -// integers, booleans, strings, go/constant values, cross-references -// to other elements). Package pkgbits provides APIs for encoding and -// decoding these low-level values, but the details of mapping -// higher-level Go constructs into elements is left to higher-level -// abstractions. -// -// Elements may cross-reference each other with "relocations." For -// example, an element representing a pointer type has a relocation -// referring to the element type. -// -// Go constructs may be composed as a constellation of multiple -// elements. For example, a declared function may have one element to -// describe the object (e.g., its name, type, position), and a -// separate element to describe its function body. This allows readers -// some flexibility in efficiently seeking or re-reading data (e.g., -// inlining requires re-reading the function body for each inlined -// call, without needing to re-read the object-level details). -// -// This is a copy of internal/pkgbits in the Go implementation. -package pkgbits diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/encoder.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/encoder.go deleted file mode 100644 index 6482617a4fcc..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/encoder.go +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "bytes" - "crypto/md5" - "encoding/binary" - "go/constant" - "io" - "math/big" - "runtime" -) - -// currentVersion is the current version number. -// -// - v0: initial prototype -// -// - v1: adds the flags uint32 word -const currentVersion uint32 = 1 - -// A PkgEncoder provides methods for encoding a package's Unified IR -// export data. -type PkgEncoder struct { - // elems holds the bitstream for previously encoded elements. - elems [numRelocs][]string - - // stringsIdx maps previously encoded strings to their index within - // the RelocString section, to allow deduplication. That is, - // elems[RelocString][stringsIdx[s]] == s (if present). - stringsIdx map[string]Index - - // syncFrames is the number of frames to write at each sync - // marker. A negative value means sync markers are omitted. - syncFrames int -} - -// SyncMarkers reports whether pw uses sync markers. -func (pw *PkgEncoder) SyncMarkers() bool { return pw.syncFrames >= 0 } - -// NewPkgEncoder returns an initialized PkgEncoder. -// -// syncFrames is the number of caller frames that should be serialized -// at Sync points. Serializing additional frames results in larger -// export data files, but can help diagnosing desync errors in -// higher-level Unified IR reader/writer code. If syncFrames is -// negative, then sync markers are omitted entirely. -func NewPkgEncoder(syncFrames int) PkgEncoder { - return PkgEncoder{ - stringsIdx: make(map[string]Index), - syncFrames: syncFrames, - } -} - -// DumpTo writes the package's encoded data to out0 and returns the -// package fingerprint. -func (pw *PkgEncoder) DumpTo(out0 io.Writer) (fingerprint [8]byte) { - h := md5.New() - out := io.MultiWriter(out0, h) - - writeUint32 := func(x uint32) { - assert(binary.Write(out, binary.LittleEndian, x) == nil) - } - - writeUint32(currentVersion) - - var flags uint32 - if pw.SyncMarkers() { - flags |= flagSyncMarkers - } - writeUint32(flags) - - // Write elemEndsEnds. - var sum uint32 - for _, elems := range &pw.elems { - sum += uint32(len(elems)) - writeUint32(sum) - } - - // Write elemEnds. - sum = 0 - for _, elems := range &pw.elems { - for _, elem := range elems { - sum += uint32(len(elem)) - writeUint32(sum) - } - } - - // Write elemData. - for _, elems := range &pw.elems { - for _, elem := range elems { - _, err := io.WriteString(out, elem) - assert(err == nil) - } - } - - // Write fingerprint. - copy(fingerprint[:], h.Sum(nil)) - _, err := out0.Write(fingerprint[:]) - assert(err == nil) - - return -} - -// StringIdx adds a string value to the strings section, if not -// already present, and returns its index. -func (pw *PkgEncoder) StringIdx(s string) Index { - if idx, ok := pw.stringsIdx[s]; ok { - assert(pw.elems[RelocString][idx] == s) - return idx - } - - idx := Index(len(pw.elems[RelocString])) - pw.elems[RelocString] = append(pw.elems[RelocString], s) - pw.stringsIdx[s] = idx - return idx -} - -// NewEncoder returns an Encoder for a new element within the given -// section, and encodes the given SyncMarker as the start of the -// element bitstream. -func (pw *PkgEncoder) NewEncoder(k RelocKind, marker SyncMarker) Encoder { - e := pw.NewEncoderRaw(k) - e.Sync(marker) - return e -} - -// NewEncoderRaw returns an Encoder for a new element within the given -// section. -// -// Most callers should use NewEncoder instead. -func (pw *PkgEncoder) NewEncoderRaw(k RelocKind) Encoder { - idx := Index(len(pw.elems[k])) - pw.elems[k] = append(pw.elems[k], "") // placeholder - - return Encoder{ - p: pw, - k: k, - Idx: idx, - } -} - -// An Encoder provides methods for encoding an individual element's -// bitstream data. -type Encoder struct { - p *PkgEncoder - - Relocs []RelocEnt - RelocMap map[RelocEnt]uint32 - Data bytes.Buffer // accumulated element bitstream data - - encodingRelocHeader bool - - k RelocKind - Idx Index // index within relocation section -} - -// Flush finalizes the element's bitstream and returns its Index. -func (w *Encoder) Flush() Index { - var sb bytes.Buffer // TODO(mdempsky): strings.Builder after #44505 is resolved - - // Backup the data so we write the relocations at the front. - var tmp bytes.Buffer - io.Copy(&tmp, &w.Data) - - // TODO(mdempsky): Consider writing these out separately so they're - // easier to strip, along with function bodies, so that we can prune - // down to just the data that's relevant to go/types. - if w.encodingRelocHeader { - panic("encodingRelocHeader already true; recursive flush?") - } - w.encodingRelocHeader = true - w.Sync(SyncRelocs) - w.Len(len(w.Relocs)) - for _, rEnt := range w.Relocs { - w.Sync(SyncReloc) - w.Len(int(rEnt.Kind)) - w.Len(int(rEnt.Idx)) - } - - io.Copy(&sb, &w.Data) - io.Copy(&sb, &tmp) - w.p.elems[w.k][w.Idx] = sb.String() - - return w.Idx -} - -func (w *Encoder) checkErr(err error) { - if err != nil { - errorf("unexpected encoding error: %v", err) - } -} - -func (w *Encoder) rawUvarint(x uint64) { - var buf [binary.MaxVarintLen64]byte - n := binary.PutUvarint(buf[:], x) - _, err := w.Data.Write(buf[:n]) - w.checkErr(err) -} - -func (w *Encoder) rawVarint(x int64) { - // Zig-zag encode. - ux := uint64(x) << 1 - if x < 0 { - ux = ^ux - } - - w.rawUvarint(ux) -} - -func (w *Encoder) rawReloc(r RelocKind, idx Index) int { - e := RelocEnt{r, idx} - if w.RelocMap != nil { - if i, ok := w.RelocMap[e]; ok { - return int(i) - } - } else { - w.RelocMap = make(map[RelocEnt]uint32) - } - - i := len(w.Relocs) - w.RelocMap[e] = uint32(i) - w.Relocs = append(w.Relocs, e) - return i -} - -func (w *Encoder) Sync(m SyncMarker) { - if !w.p.SyncMarkers() { - return - } - - // Writing out stack frame string references requires working - // relocations, but writing out the relocations themselves involves - // sync markers. To prevent infinite recursion, we simply trim the - // stack frame for sync markers within the relocation header. - var frames []string - if !w.encodingRelocHeader && w.p.syncFrames > 0 { - pcs := make([]uintptr, w.p.syncFrames) - n := runtime.Callers(2, pcs) - frames = fmtFrames(pcs[:n]...) - } - - // TODO(mdempsky): Save space by writing out stack frames as a - // linked list so we can share common stack frames. - w.rawUvarint(uint64(m)) - w.rawUvarint(uint64(len(frames))) - for _, frame := range frames { - w.rawUvarint(uint64(w.rawReloc(RelocString, w.p.StringIdx(frame)))) - } -} - -// Bool encodes and writes a bool value into the element bitstream, -// and then returns the bool value. -// -// For simple, 2-alternative encodings, the idiomatic way to call Bool -// is something like: -// -// if w.Bool(x != 0) { -// // alternative #1 -// } else { -// // alternative #2 -// } -// -// For multi-alternative encodings, use Code instead. -func (w *Encoder) Bool(b bool) bool { - w.Sync(SyncBool) - var x byte - if b { - x = 1 - } - err := w.Data.WriteByte(x) - w.checkErr(err) - return b -} - -// Int64 encodes and writes an int64 value into the element bitstream. -func (w *Encoder) Int64(x int64) { - w.Sync(SyncInt64) - w.rawVarint(x) -} - -// Uint64 encodes and writes a uint64 value into the element bitstream. -func (w *Encoder) Uint64(x uint64) { - w.Sync(SyncUint64) - w.rawUvarint(x) -} - -// Len encodes and writes a non-negative int value into the element bitstream. -func (w *Encoder) Len(x int) { assert(x >= 0); w.Uint64(uint64(x)) } - -// Int encodes and writes an int value into the element bitstream. -func (w *Encoder) Int(x int) { w.Int64(int64(x)) } - -// Uint encodes and writes a uint value into the element bitstream. -func (w *Encoder) Uint(x uint) { w.Uint64(uint64(x)) } - -// Reloc encodes and writes a relocation for the given (section, -// index) pair into the element bitstream. -// -// Note: Only the index is formally written into the element -// bitstream, so bitstream decoders must know from context which -// section an encoded relocation refers to. -func (w *Encoder) Reloc(r RelocKind, idx Index) { - w.Sync(SyncUseReloc) - w.Len(w.rawReloc(r, idx)) -} - -// Code encodes and writes a Code value into the element bitstream. -func (w *Encoder) Code(c Code) { - w.Sync(c.Marker()) - w.Len(c.Value()) -} - -// String encodes and writes a string value into the element -// bitstream. -// -// Internally, strings are deduplicated by adding them to the strings -// section (if not already present), and then writing a relocation -// into the element bitstream. -func (w *Encoder) String(s string) { - w.Sync(SyncString) - w.Reloc(RelocString, w.p.StringIdx(s)) -} - -// Strings encodes and writes a variable-length slice of strings into -// the element bitstream. -func (w *Encoder) Strings(ss []string) { - w.Len(len(ss)) - for _, s := range ss { - w.String(s) - } -} - -// Value encodes and writes a constant.Value into the element -// bitstream. -func (w *Encoder) Value(val constant.Value) { - w.Sync(SyncValue) - if w.Bool(val.Kind() == constant.Complex) { - w.scalar(constant.Real(val)) - w.scalar(constant.Imag(val)) - } else { - w.scalar(val) - } -} - -func (w *Encoder) scalar(val constant.Value) { - switch v := constant.Val(val).(type) { - default: - errorf("unhandled %v (%v)", val, val.Kind()) - case bool: - w.Code(ValBool) - w.Bool(v) - case string: - w.Code(ValString) - w.String(v) - case int64: - w.Code(ValInt64) - w.Int64(v) - case *big.Int: - w.Code(ValBigInt) - w.bigInt(v) - case *big.Rat: - w.Code(ValBigRat) - w.bigInt(v.Num()) - w.bigInt(v.Denom()) - case *big.Float: - w.Code(ValBigFloat) - w.bigFloat(v) - } -} - -func (w *Encoder) bigInt(v *big.Int) { - b := v.Bytes() - w.String(string(b)) // TODO: More efficient encoding. - w.Bool(v.Sign() < 0) -} - -func (w *Encoder) bigFloat(v *big.Float) { - b := v.Append(nil, 'p', -1) - w.String(string(b)) // TODO: More efficient encoding. -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/flags.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/flags.go deleted file mode 100644 index 654222745fac..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/flags.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -const ( - flagSyncMarkers = 1 << iota // file format contains sync markers -) diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/frames_go1.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/frames_go1.go deleted file mode 100644 index 5294f6a63edd..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/frames_go1.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.7 -// +build !go1.7 - -// TODO(mdempsky): Remove after #44505 is resolved - -package pkgbits - -import "runtime" - -func walkFrames(pcs []uintptr, visit frameVisitor) { - for _, pc := range pcs { - fn := runtime.FuncForPC(pc) - file, line := fn.FileLine(pc) - - visit(file, line, fn.Name(), pc-fn.Entry()) - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/frames_go17.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/frames_go17.go deleted file mode 100644 index 2324ae7adfe2..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/frames_go17.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.7 -// +build go1.7 - -package pkgbits - -import "runtime" - -// walkFrames calls visit for each call frame represented by pcs. -// -// pcs should be a slice of PCs, as returned by runtime.Callers. -func walkFrames(pcs []uintptr, visit frameVisitor) { - if len(pcs) == 0 { - return - } - - frames := runtime.CallersFrames(pcs) - for { - frame, more := frames.Next() - visit(frame.File, frame.Line, frame.Function, frame.PC-frame.Entry) - if !more { - return - } - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/reloc.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/reloc.go deleted file mode 100644 index fcdfb97ca992..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/reloc.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -// A RelocKind indicates a particular section within a unified IR export. -type RelocKind int32 - -// An Index represents a bitstream element index within a particular -// section. -type Index int32 - -// A relocEnt (relocation entry) is an entry in an element's local -// reference table. -// -// TODO(mdempsky): Rename this too. -type RelocEnt struct { - Kind RelocKind - Idx Index -} - -// Reserved indices within the meta relocation section. -const ( - PublicRootIdx Index = 0 - PrivateRootIdx Index = 1 -) - -const ( - RelocString RelocKind = iota - RelocMeta - RelocPosBase - RelocPkg - RelocName - RelocType - RelocObj - RelocObjExt - RelocObjDict - RelocBody - - numRelocs = iota -) diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/support.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/support.go deleted file mode 100644 index ad26d3b28cae..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/support.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import "fmt" - -func assert(b bool) { - if !b { - panic("assertion failed") - } -} - -func errorf(format string, args ...interface{}) { - panic(fmt.Errorf(format, args...)) -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/sync.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/sync.go deleted file mode 100644 index 5bd51ef71700..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/sync.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package pkgbits - -import ( - "fmt" - "strings" -) - -// fmtFrames formats a backtrace for reporting reader/writer desyncs. -func fmtFrames(pcs ...uintptr) []string { - res := make([]string, 0, len(pcs)) - walkFrames(pcs, func(file string, line int, name string, offset uintptr) { - // Trim package from function name. It's just redundant noise. - name = strings.TrimPrefix(name, "cmd/compile/internal/noder.") - - res = append(res, fmt.Sprintf("%s:%v: %s +0x%v", file, line, name, offset)) - }) - return res -} - -type frameVisitor func(file string, line int, name string, offset uintptr) - -// SyncMarker is an enum type that represents markers that may be -// written to export data to ensure the reader and writer stay -// synchronized. -type SyncMarker int - -//go:generate stringer -type=SyncMarker -trimprefix=Sync - -const ( - _ SyncMarker = iota - - // Public markers (known to go/types importers). - - // Low-level coding markers. - SyncEOF - SyncBool - SyncInt64 - SyncUint64 - SyncString - SyncValue - SyncVal - SyncRelocs - SyncReloc - SyncUseReloc - - // Higher-level object and type markers. - SyncPublic - SyncPos - SyncPosBase - SyncObject - SyncObject1 - SyncPkg - SyncPkgDef - SyncMethod - SyncType - SyncTypeIdx - SyncTypeParamNames - SyncSignature - SyncParams - SyncParam - SyncCodeObj - SyncSym - SyncLocalIdent - SyncSelector - - // Private markers (only known to cmd/compile). - SyncPrivate - - SyncFuncExt - SyncVarExt - SyncTypeExt - SyncPragma - - SyncExprList - SyncExprs - SyncExpr - SyncExprType - SyncAssign - SyncOp - SyncFuncLit - SyncCompLit - - SyncDecl - SyncFuncBody - SyncOpenScope - SyncCloseScope - SyncCloseAnotherScope - SyncDeclNames - SyncDeclName - - SyncStmts - SyncBlockStmt - SyncIfStmt - SyncForStmt - SyncSwitchStmt - SyncRangeStmt - SyncCaseClause - SyncCommClause - SyncSelectStmt - SyncDecls - SyncLabeledStmt - SyncUseObjLocal - SyncAddLocal - SyncLinkname - SyncStmt1 - SyncStmtsEnd - SyncLabel - SyncOptLabel -) diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go deleted file mode 100644 index 4a5b0ca5f2ff..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/pkgbits/syncmarker_string.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by "stringer -type=SyncMarker -trimprefix=Sync"; DO NOT EDIT. - -package pkgbits - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[SyncEOF-1] - _ = x[SyncBool-2] - _ = x[SyncInt64-3] - _ = x[SyncUint64-4] - _ = x[SyncString-5] - _ = x[SyncValue-6] - _ = x[SyncVal-7] - _ = x[SyncRelocs-8] - _ = x[SyncReloc-9] - _ = x[SyncUseReloc-10] - _ = x[SyncPublic-11] - _ = x[SyncPos-12] - _ = x[SyncPosBase-13] - _ = x[SyncObject-14] - _ = x[SyncObject1-15] - _ = x[SyncPkg-16] - _ = x[SyncPkgDef-17] - _ = x[SyncMethod-18] - _ = x[SyncType-19] - _ = x[SyncTypeIdx-20] - _ = x[SyncTypeParamNames-21] - _ = x[SyncSignature-22] - _ = x[SyncParams-23] - _ = x[SyncParam-24] - _ = x[SyncCodeObj-25] - _ = x[SyncSym-26] - _ = x[SyncLocalIdent-27] - _ = x[SyncSelector-28] - _ = x[SyncPrivate-29] - _ = x[SyncFuncExt-30] - _ = x[SyncVarExt-31] - _ = x[SyncTypeExt-32] - _ = x[SyncPragma-33] - _ = x[SyncExprList-34] - _ = x[SyncExprs-35] - _ = x[SyncExpr-36] - _ = x[SyncExprType-37] - _ = x[SyncAssign-38] - _ = x[SyncOp-39] - _ = x[SyncFuncLit-40] - _ = x[SyncCompLit-41] - _ = x[SyncDecl-42] - _ = x[SyncFuncBody-43] - _ = x[SyncOpenScope-44] - _ = x[SyncCloseScope-45] - _ = x[SyncCloseAnotherScope-46] - _ = x[SyncDeclNames-47] - _ = x[SyncDeclName-48] - _ = x[SyncStmts-49] - _ = x[SyncBlockStmt-50] - _ = x[SyncIfStmt-51] - _ = x[SyncForStmt-52] - _ = x[SyncSwitchStmt-53] - _ = x[SyncRangeStmt-54] - _ = x[SyncCaseClause-55] - _ = x[SyncCommClause-56] - _ = x[SyncSelectStmt-57] - _ = x[SyncDecls-58] - _ = x[SyncLabeledStmt-59] - _ = x[SyncUseObjLocal-60] - _ = x[SyncAddLocal-61] - _ = x[SyncLinkname-62] - _ = x[SyncStmt1-63] - _ = x[SyncStmtsEnd-64] - _ = x[SyncLabel-65] - _ = x[SyncOptLabel-66] -} - -const _SyncMarker_name = "EOFBoolInt64Uint64StringValueValRelocsRelocUseRelocPublicPosPosBaseObjectObject1PkgPkgDefMethodTypeTypeIdxTypeParamNamesSignatureParamsParamCodeObjSymLocalIdentSelectorPrivateFuncExtVarExtTypeExtPragmaExprListExprsExprExprTypeAssignOpFuncLitCompLitDeclFuncBodyOpenScopeCloseScopeCloseAnotherScopeDeclNamesDeclNameStmtsBlockStmtIfStmtForStmtSwitchStmtRangeStmtCaseClauseCommClauseSelectStmtDeclsLabeledStmtUseObjLocalAddLocalLinknameStmt1StmtsEndLabelOptLabel" - -var _SyncMarker_index = [...]uint16{0, 3, 7, 12, 18, 24, 29, 32, 38, 43, 51, 57, 60, 67, 73, 80, 83, 89, 95, 99, 106, 120, 129, 135, 140, 147, 150, 160, 168, 175, 182, 188, 195, 201, 209, 214, 218, 226, 232, 234, 241, 248, 252, 260, 269, 279, 296, 305, 313, 318, 327, 333, 340, 350, 359, 369, 379, 389, 394, 405, 416, 424, 432, 437, 445, 450, 458} - -func (i SyncMarker) String() string { - i -= 1 - if i < 0 || i >= SyncMarker(len(_SyncMarker_index)-1) { - return "SyncMarker(" + strconv.FormatInt(int64(i+1), 10) + ")" - } - return _SyncMarker_name[_SyncMarker_index[i]:_SyncMarker_index[i+1]] -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go deleted file mode 100644 index 7e638ec24fcb..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// package tokeninternal provides access to some internal features of the token -// package. -package tokeninternal - -import ( - "fmt" - "go/token" - "sort" - "sync" - "unsafe" -) - -// GetLines returns the table of line-start offsets from a token.File. -func GetLines(file *token.File) []int { - // token.File has a Lines method on Go 1.21 and later. - if file, ok := (interface{})(file).(interface{ Lines() []int }); ok { - return file.Lines() - } - - // This declaration must match that of token.File. - // This creates a risk of dependency skew. - // For now we check that the size of the two - // declarations is the same, on the (fragile) assumption - // that future changes would add fields. - type tokenFile119 struct { - _ string - _ int - _ int - mu sync.Mutex // we're not complete monsters - lines []int - _ []struct{} - } - type tokenFile118 struct { - _ *token.FileSet // deleted in go1.19 - tokenFile119 - } - - type uP = unsafe.Pointer - switch unsafe.Sizeof(*file) { - case unsafe.Sizeof(tokenFile118{}): - var ptr *tokenFile118 - *(*uP)(uP(&ptr)) = uP(file) - ptr.mu.Lock() - defer ptr.mu.Unlock() - return ptr.lines - - case unsafe.Sizeof(tokenFile119{}): - var ptr *tokenFile119 - *(*uP)(uP(&ptr)) = uP(file) - ptr.mu.Lock() - defer ptr.mu.Unlock() - return ptr.lines - - default: - panic("unexpected token.File size") - } -} - -// AddExistingFiles adds the specified files to the FileSet if they -// are not already present. It panics if any pair of files in the -// resulting FileSet would overlap. -func AddExistingFiles(fset *token.FileSet, files []*token.File) { - // Punch through the FileSet encapsulation. - type tokenFileSet struct { - // This type remained essentially consistent from go1.16 to go1.21. - mutex sync.RWMutex - base int - files []*token.File - _ *token.File // changed to atomic.Pointer[token.File] in go1.19 - } - - // If the size of token.FileSet changes, this will fail to compile. - const delta = int64(unsafe.Sizeof(tokenFileSet{})) - int64(unsafe.Sizeof(token.FileSet{})) - var _ [-delta * delta]int - - type uP = unsafe.Pointer - var ptr *tokenFileSet - *(*uP)(uP(&ptr)) = uP(fset) - ptr.mutex.Lock() - defer ptr.mutex.Unlock() - - // Merge and sort. - newFiles := append(ptr.files, files...) - sort.Slice(newFiles, func(i, j int) bool { - return newFiles[i].Base() < newFiles[j].Base() - }) - - // Reject overlapping files. - // Discard adjacent identical files. - out := newFiles[:0] - for i, file := range newFiles { - if i > 0 { - prev := newFiles[i-1] - if file == prev { - continue - } - if prev.Base()+prev.Size()+1 > file.Base() { - panic(fmt.Sprintf("file %s (%d-%d) overlaps with file %s (%d-%d)", - prev.Name(), prev.Base(), prev.Base()+prev.Size(), - file.Name(), file.Base(), file.Base()+file.Size())) - } - } - out = append(out, file) - } - newFiles = out - - ptr.files = newFiles - - // Advance FileSet.Base(). - if len(newFiles) > 0 { - last := newFiles[len(newFiles)-1] - newBase := last.Base() + last.Size() + 1 - if ptr.base < newBase { - ptr.base = newBase - } - } -} - -// FileSetFor returns a new FileSet containing a sequence of new Files with -// the same base, size, and line as the input files, for use in APIs that -// require a FileSet. -// -// Precondition: the input files must be non-overlapping, and sorted in order -// of their Base. -func FileSetFor(files ...*token.File) *token.FileSet { - fset := token.NewFileSet() - for _, f := range files { - f2 := fset.AddFile(f.Name(), f.Base(), f.Size()) - lines := GetLines(f) - f2.SetLines(lines) - } - return fset -} - -// CloneFileSet creates a new FileSet holding all files in fset. It does not -// create copies of the token.Files in fset: they are added to the resulting -// FileSet unmodified. -func CloneFileSet(fset *token.FileSet) *token.FileSet { - var files []*token.File - fset.Iterate(func(f *token.File) bool { - files = append(files, f) - return true - }) - newFileSet := token.NewFileSet() - AddExistingFiles(newFileSet, files) - return newFileSet -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go deleted file mode 100644 index 07484073a57d..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/errorcode.go +++ /dev/null @@ -1,1560 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package typesinternal - -//go:generate stringer -type=ErrorCode - -type ErrorCode int - -// This file defines the error codes that can be produced during type-checking. -// Collectively, these codes provide an identifier that may be used to -// implement special handling for certain types of errors. -// -// Error codes should be fine-grained enough that the exact nature of the error -// can be easily determined, but coarse enough that they are not an -// implementation detail of the type checking algorithm. As a rule-of-thumb, -// errors should be considered equivalent if there is a theoretical refactoring -// of the type checker in which they are emitted in exactly one place. For -// example, the type checker emits different error messages for "too many -// arguments" and "too few arguments", but one can imagine an alternative type -// checker where this check instead just emits a single "wrong number of -// arguments", so these errors should have the same code. -// -// Error code names should be as brief as possible while retaining accuracy and -// distinctiveness. In most cases names should start with an adjective -// describing the nature of the error (e.g. "invalid", "unused", "misplaced"), -// and end with a noun identifying the relevant language object. For example, -// "DuplicateDecl" or "InvalidSliceExpr". For brevity, naming follows the -// convention that "bad" implies a problem with syntax, and "invalid" implies a -// problem with types. - -const ( - // InvalidSyntaxTree occurs if an invalid syntax tree is provided - // to the type checker. It should never happen. - InvalidSyntaxTree ErrorCode = -1 -) - -const ( - _ ErrorCode = iota - - // Test is reserved for errors that only apply while in self-test mode. - Test - - /* package names */ - - // BlankPkgName occurs when a package name is the blank identifier "_". - // - // Per the spec: - // "The PackageName must not be the blank identifier." - BlankPkgName - - // MismatchedPkgName occurs when a file's package name doesn't match the - // package name already established by other files. - MismatchedPkgName - - // InvalidPkgUse occurs when a package identifier is used outside of a - // selector expression. - // - // Example: - // import "fmt" - // - // var _ = fmt - InvalidPkgUse - - /* imports */ - - // BadImportPath occurs when an import path is not valid. - BadImportPath - - // BrokenImport occurs when importing a package fails. - // - // Example: - // import "amissingpackage" - BrokenImport - - // ImportCRenamed occurs when the special import "C" is renamed. "C" is a - // pseudo-package, and must not be renamed. - // - // Example: - // import _ "C" - ImportCRenamed - - // UnusedImport occurs when an import is unused. - // - // Example: - // import "fmt" - // - // func main() {} - UnusedImport - - /* initialization */ - - // InvalidInitCycle occurs when an invalid cycle is detected within the - // initialization graph. - // - // Example: - // var x int = f() - // - // func f() int { return x } - InvalidInitCycle - - /* decls */ - - // DuplicateDecl occurs when an identifier is declared multiple times. - // - // Example: - // var x = 1 - // var x = 2 - DuplicateDecl - - // InvalidDeclCycle occurs when a declaration cycle is not valid. - // - // Example: - // import "unsafe" - // - // type T struct { - // a [n]int - // } - // - // var n = unsafe.Sizeof(T{}) - InvalidDeclCycle - - // InvalidTypeCycle occurs when a cycle in type definitions results in a - // type that is not well-defined. - // - // Example: - // import "unsafe" - // - // type T [unsafe.Sizeof(T{})]int - InvalidTypeCycle - - /* decls > const */ - - // InvalidConstInit occurs when a const declaration has a non-constant - // initializer. - // - // Example: - // var x int - // const _ = x - InvalidConstInit - - // InvalidConstVal occurs when a const value cannot be converted to its - // target type. - // - // TODO(findleyr): this error code and example are not very clear. Consider - // removing it. - // - // Example: - // const _ = 1 << "hello" - InvalidConstVal - - // InvalidConstType occurs when the underlying type in a const declaration - // is not a valid constant type. - // - // Example: - // const c *int = 4 - InvalidConstType - - /* decls > var (+ other variable assignment codes) */ - - // UntypedNilUse occurs when the predeclared (untyped) value nil is used to - // initialize a variable declared without an explicit type. - // - // Example: - // var x = nil - UntypedNilUse - - // WrongAssignCount occurs when the number of values on the right-hand side - // of an assignment or or initialization expression does not match the number - // of variables on the left-hand side. - // - // Example: - // var x = 1, 2 - WrongAssignCount - - // UnassignableOperand occurs when the left-hand side of an assignment is - // not assignable. - // - // Example: - // func f() { - // const c = 1 - // c = 2 - // } - UnassignableOperand - - // NoNewVar occurs when a short variable declaration (':=') does not declare - // new variables. - // - // Example: - // func f() { - // x := 1 - // x := 2 - // } - NoNewVar - - // MultiValAssignOp occurs when an assignment operation (+=, *=, etc) does - // not have single-valued left-hand or right-hand side. - // - // Per the spec: - // "In assignment operations, both the left- and right-hand expression lists - // must contain exactly one single-valued expression" - // - // Example: - // func f() int { - // x, y := 1, 2 - // x, y += 1 - // return x + y - // } - MultiValAssignOp - - // InvalidIfaceAssign occurs when a value of type T is used as an - // interface, but T does not implement a method of the expected interface. - // - // Example: - // type I interface { - // f() - // } - // - // type T int - // - // var x I = T(1) - InvalidIfaceAssign - - // InvalidChanAssign occurs when a chan assignment is invalid. - // - // Per the spec, a value x is assignable to a channel type T if: - // "x is a bidirectional channel value, T is a channel type, x's type V and - // T have identical element types, and at least one of V or T is not a - // defined type." - // - // Example: - // type T1 chan int - // type T2 chan int - // - // var x T1 - // // Invalid assignment because both types are named - // var _ T2 = x - InvalidChanAssign - - // IncompatibleAssign occurs when the type of the right-hand side expression - // in an assignment cannot be assigned to the type of the variable being - // assigned. - // - // Example: - // var x []int - // var _ int = x - IncompatibleAssign - - // UnaddressableFieldAssign occurs when trying to assign to a struct field - // in a map value. - // - // Example: - // func f() { - // m := make(map[string]struct{i int}) - // m["foo"].i = 42 - // } - UnaddressableFieldAssign - - /* decls > type (+ other type expression codes) */ - - // NotAType occurs when the identifier used as the underlying type in a type - // declaration or the right-hand side of a type alias does not denote a type. - // - // Example: - // var S = 2 - // - // type T S - NotAType - - // InvalidArrayLen occurs when an array length is not a constant value. - // - // Example: - // var n = 3 - // var _ = [n]int{} - InvalidArrayLen - - // BlankIfaceMethod occurs when a method name is '_'. - // - // Per the spec: - // "The name of each explicitly specified method must be unique and not - // blank." - // - // Example: - // type T interface { - // _(int) - // } - BlankIfaceMethod - - // IncomparableMapKey occurs when a map key type does not support the == and - // != operators. - // - // Per the spec: - // "The comparison operators == and != must be fully defined for operands of - // the key type; thus the key type must not be a function, map, or slice." - // - // Example: - // var x map[T]int - // - // type T []int - IncomparableMapKey - - // InvalidIfaceEmbed occurs when a non-interface type is embedded in an - // interface. - // - // Example: - // type T struct {} - // - // func (T) m() - // - // type I interface { - // T - // } - InvalidIfaceEmbed - - // InvalidPtrEmbed occurs when an embedded field is of the pointer form *T, - // and T itself is itself a pointer, an unsafe.Pointer, or an interface. - // - // Per the spec: - // "An embedded field must be specified as a type name T or as a pointer to - // a non-interface type name *T, and T itself may not be a pointer type." - // - // Example: - // type T *int - // - // type S struct { - // *T - // } - InvalidPtrEmbed - - /* decls > func and method */ - - // BadRecv occurs when a method declaration does not have exactly one - // receiver parameter. - // - // Example: - // func () _() {} - BadRecv - - // InvalidRecv occurs when a receiver type expression is not of the form T - // or *T, or T is a pointer type. - // - // Example: - // type T struct {} - // - // func (**T) m() {} - InvalidRecv - - // DuplicateFieldAndMethod occurs when an identifier appears as both a field - // and method name. - // - // Example: - // type T struct { - // m int - // } - // - // func (T) m() {} - DuplicateFieldAndMethod - - // DuplicateMethod occurs when two methods on the same receiver type have - // the same name. - // - // Example: - // type T struct {} - // func (T) m() {} - // func (T) m(i int) int { return i } - DuplicateMethod - - /* decls > special */ - - // InvalidBlank occurs when a blank identifier is used as a value or type. - // - // Per the spec: - // "The blank identifier may appear as an operand only on the left-hand side - // of an assignment." - // - // Example: - // var x = _ - InvalidBlank - - // InvalidIota occurs when the predeclared identifier iota is used outside - // of a constant declaration. - // - // Example: - // var x = iota - InvalidIota - - // MissingInitBody occurs when an init function is missing its body. - // - // Example: - // func init() - MissingInitBody - - // InvalidInitSig occurs when an init function declares parameters or - // results. - // - // Example: - // func init() int { return 1 } - InvalidInitSig - - // InvalidInitDecl occurs when init is declared as anything other than a - // function. - // - // Example: - // var init = 1 - InvalidInitDecl - - // InvalidMainDecl occurs when main is declared as anything other than a - // function, in a main package. - InvalidMainDecl - - /* exprs */ - - // TooManyValues occurs when a function returns too many values for the - // expression context in which it is used. - // - // Example: - // func ReturnTwo() (int, int) { - // return 1, 2 - // } - // - // var x = ReturnTwo() - TooManyValues - - // NotAnExpr occurs when a type expression is used where a value expression - // is expected. - // - // Example: - // type T struct {} - // - // func f() { - // T - // } - NotAnExpr - - /* exprs > const */ - - // TruncatedFloat occurs when a float constant is truncated to an integer - // value. - // - // Example: - // var _ int = 98.6 - TruncatedFloat - - // NumericOverflow occurs when a numeric constant overflows its target type. - // - // Example: - // var x int8 = 1000 - NumericOverflow - - /* exprs > operation */ - - // UndefinedOp occurs when an operator is not defined for the type(s) used - // in an operation. - // - // Example: - // var c = "a" - "b" - UndefinedOp - - // MismatchedTypes occurs when operand types are incompatible in a binary - // operation. - // - // Example: - // var a = "hello" - // var b = 1 - // var c = a - b - MismatchedTypes - - // DivByZero occurs when a division operation is provable at compile - // time to be a division by zero. - // - // Example: - // const divisor = 0 - // var x int = 1/divisor - DivByZero - - // NonNumericIncDec occurs when an increment or decrement operator is - // applied to a non-numeric value. - // - // Example: - // func f() { - // var c = "c" - // c++ - // } - NonNumericIncDec - - /* exprs > ptr */ - - // UnaddressableOperand occurs when the & operator is applied to an - // unaddressable expression. - // - // Example: - // var x = &1 - UnaddressableOperand - - // InvalidIndirection occurs when a non-pointer value is indirected via the - // '*' operator. - // - // Example: - // var x int - // var y = *x - InvalidIndirection - - /* exprs > [] */ - - // NonIndexableOperand occurs when an index operation is applied to a value - // that cannot be indexed. - // - // Example: - // var x = 1 - // var y = x[1] - NonIndexableOperand - - // InvalidIndex occurs when an index argument is not of integer type, - // negative, or out-of-bounds. - // - // Example: - // var s = [...]int{1,2,3} - // var x = s[5] - // - // Example: - // var s = []int{1,2,3} - // var _ = s[-1] - // - // Example: - // var s = []int{1,2,3} - // var i string - // var _ = s[i] - InvalidIndex - - // SwappedSliceIndices occurs when constant indices in a slice expression - // are decreasing in value. - // - // Example: - // var _ = []int{1,2,3}[2:1] - SwappedSliceIndices - - /* operators > slice */ - - // NonSliceableOperand occurs when a slice operation is applied to a value - // whose type is not sliceable, or is unaddressable. - // - // Example: - // var x = [...]int{1, 2, 3}[:1] - // - // Example: - // var x = 1 - // var y = 1[:1] - NonSliceableOperand - - // InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is - // applied to a string. - // - // Example: - // var s = "hello" - // var x = s[1:2:3] - InvalidSliceExpr - - /* exprs > shift */ - - // InvalidShiftCount occurs when the right-hand side of a shift operation is - // either non-integer, negative, or too large. - // - // Example: - // var ( - // x string - // y int = 1 << x - // ) - InvalidShiftCount - - // InvalidShiftOperand occurs when the shifted operand is not an integer. - // - // Example: - // var s = "hello" - // var x = s << 2 - InvalidShiftOperand - - /* exprs > chan */ - - // InvalidReceive occurs when there is a channel receive from a value that - // is either not a channel, or is a send-only channel. - // - // Example: - // func f() { - // var x = 1 - // <-x - // } - InvalidReceive - - // InvalidSend occurs when there is a channel send to a value that is not a - // channel, or is a receive-only channel. - // - // Example: - // func f() { - // var x = 1 - // x <- "hello!" - // } - InvalidSend - - /* exprs > literal */ - - // DuplicateLitKey occurs when an index is duplicated in a slice, array, or - // map literal. - // - // Example: - // var _ = []int{0:1, 0:2} - // - // Example: - // var _ = map[string]int{"a": 1, "a": 2} - DuplicateLitKey - - // MissingLitKey occurs when a map literal is missing a key expression. - // - // Example: - // var _ = map[string]int{1} - MissingLitKey - - // InvalidLitIndex occurs when the key in a key-value element of a slice or - // array literal is not an integer constant. - // - // Example: - // var i = 0 - // var x = []string{i: "world"} - InvalidLitIndex - - // OversizeArrayLit occurs when an array literal exceeds its length. - // - // Example: - // var _ = [2]int{1,2,3} - OversizeArrayLit - - // MixedStructLit occurs when a struct literal contains a mix of positional - // and named elements. - // - // Example: - // var _ = struct{i, j int}{i: 1, 2} - MixedStructLit - - // InvalidStructLit occurs when a positional struct literal has an incorrect - // number of values. - // - // Example: - // var _ = struct{i, j int}{1,2,3} - InvalidStructLit - - // MissingLitField occurs when a struct literal refers to a field that does - // not exist on the struct type. - // - // Example: - // var _ = struct{i int}{j: 2} - MissingLitField - - // DuplicateLitField occurs when a struct literal contains duplicated - // fields. - // - // Example: - // var _ = struct{i int}{i: 1, i: 2} - DuplicateLitField - - // UnexportedLitField occurs when a positional struct literal implicitly - // assigns an unexported field of an imported type. - UnexportedLitField - - // InvalidLitField occurs when a field name is not a valid identifier. - // - // Example: - // var _ = struct{i int}{1: 1} - InvalidLitField - - // UntypedLit occurs when a composite literal omits a required type - // identifier. - // - // Example: - // type outer struct{ - // inner struct { i int } - // } - // - // var _ = outer{inner: {1}} - UntypedLit - - // InvalidLit occurs when a composite literal expression does not match its - // type. - // - // Example: - // type P *struct{ - // x int - // } - // var _ = P {} - InvalidLit - - /* exprs > selector */ - - // AmbiguousSelector occurs when a selector is ambiguous. - // - // Example: - // type E1 struct { i int } - // type E2 struct { i int } - // type T struct { E1; E2 } - // - // var x T - // var _ = x.i - AmbiguousSelector - - // UndeclaredImportedName occurs when a package-qualified identifier is - // undeclared by the imported package. - // - // Example: - // import "go/types" - // - // var _ = types.NotAnActualIdentifier - UndeclaredImportedName - - // UnexportedName occurs when a selector refers to an unexported identifier - // of an imported package. - // - // Example: - // import "reflect" - // - // type _ reflect.flag - UnexportedName - - // UndeclaredName occurs when an identifier is not declared in the current - // scope. - // - // Example: - // var x T - UndeclaredName - - // MissingFieldOrMethod occurs when a selector references a field or method - // that does not exist. - // - // Example: - // type T struct {} - // - // var x = T{}.f - MissingFieldOrMethod - - /* exprs > ... */ - - // BadDotDotDotSyntax occurs when a "..." occurs in a context where it is - // not valid. - // - // Example: - // var _ = map[int][...]int{0: {}} - BadDotDotDotSyntax - - // NonVariadicDotDotDot occurs when a "..." is used on the final argument to - // a non-variadic function. - // - // Example: - // func printArgs(s []string) { - // for _, a := range s { - // println(a) - // } - // } - // - // func f() { - // s := []string{"a", "b", "c"} - // printArgs(s...) - // } - NonVariadicDotDotDot - - // MisplacedDotDotDot occurs when a "..." is used somewhere other than the - // final argument to a function call. - // - // Example: - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func f() { - // a := []int{1,2,3} - // printArgs(0, a...) - // } - MisplacedDotDotDot - - // InvalidDotDotDotOperand occurs when a "..." operator is applied to a - // single-valued operand. - // - // Example: - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func f() { - // a := 1 - // printArgs(a...) - // } - // - // Example: - // func args() (int, int) { - // return 1, 2 - // } - // - // func printArgs(args ...int) { - // for _, a := range args { - // println(a) - // } - // } - // - // func g() { - // printArgs(args()...) - // } - InvalidDotDotDotOperand - - // InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in - // function. - // - // Example: - // var s = []int{1, 2, 3} - // var l = len(s...) - InvalidDotDotDot - - /* exprs > built-in */ - - // UncalledBuiltin occurs when a built-in function is used as a - // function-valued expression, instead of being called. - // - // Per the spec: - // "The built-in functions do not have standard Go types, so they can only - // appear in call expressions; they cannot be used as function values." - // - // Example: - // var _ = copy - UncalledBuiltin - - // InvalidAppend occurs when append is called with a first argument that is - // not a slice. - // - // Example: - // var _ = append(1, 2) - InvalidAppend - - // InvalidCap occurs when an argument to the cap built-in function is not of - // supported type. - // - // See https://golang.org/ref/spec#Lengthand_capacity for information on - // which underlying types are supported as arguments to cap and len. - // - // Example: - // var s = 2 - // var x = cap(s) - InvalidCap - - // InvalidClose occurs when close(...) is called with an argument that is - // not of channel type, or that is a receive-only channel. - // - // Example: - // func f() { - // var x int - // close(x) - // } - InvalidClose - - // InvalidCopy occurs when the arguments are not of slice type or do not - // have compatible type. - // - // See https://golang.org/ref/spec#Appendingand_copying_slices for more - // information on the type requirements for the copy built-in. - // - // Example: - // func f() { - // var x []int - // y := []int64{1,2,3} - // copy(x, y) - // } - InvalidCopy - - // InvalidComplex occurs when the complex built-in function is called with - // arguments with incompatible types. - // - // Example: - // var _ = complex(float32(1), float64(2)) - InvalidComplex - - // InvalidDelete occurs when the delete built-in function is called with a - // first argument that is not a map. - // - // Example: - // func f() { - // m := "hello" - // delete(m, "e") - // } - InvalidDelete - - // InvalidImag occurs when the imag built-in function is called with an - // argument that does not have complex type. - // - // Example: - // var _ = imag(int(1)) - InvalidImag - - // InvalidLen occurs when an argument to the len built-in function is not of - // supported type. - // - // See https://golang.org/ref/spec#Lengthand_capacity for information on - // which underlying types are supported as arguments to cap and len. - // - // Example: - // var s = 2 - // var x = len(s) - InvalidLen - - // SwappedMakeArgs occurs when make is called with three arguments, and its - // length argument is larger than its capacity argument. - // - // Example: - // var x = make([]int, 3, 2) - SwappedMakeArgs - - // InvalidMake occurs when make is called with an unsupported type argument. - // - // See https://golang.org/ref/spec#Makingslices_maps_and_channels for - // information on the types that may be created using make. - // - // Example: - // var x = make(int) - InvalidMake - - // InvalidReal occurs when the real built-in function is called with an - // argument that does not have complex type. - // - // Example: - // var _ = real(int(1)) - InvalidReal - - /* exprs > assertion */ - - // InvalidAssert occurs when a type assertion is applied to a - // value that is not of interface type. - // - // Example: - // var x = 1 - // var _ = x.(float64) - InvalidAssert - - // ImpossibleAssert occurs for a type assertion x.(T) when the value x of - // interface cannot have dynamic type T, due to a missing or mismatching - // method on T. - // - // Example: - // type T int - // - // func (t *T) m() int { return int(*t) } - // - // type I interface { m() int } - // - // var x I - // var _ = x.(T) - ImpossibleAssert - - /* exprs > conversion */ - - // InvalidConversion occurs when the argument type cannot be converted to the - // target. - // - // See https://golang.org/ref/spec#Conversions for the rules of - // convertibility. - // - // Example: - // var x float64 - // var _ = string(x) - InvalidConversion - - // InvalidUntypedConversion occurs when an there is no valid implicit - // conversion from an untyped value satisfying the type constraints of the - // context in which it is used. - // - // Example: - // var _ = 1 + "" - InvalidUntypedConversion - - /* offsetof */ - - // BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument - // that is not a selector expression. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Offsetof(x) - BadOffsetofSyntax - - // InvalidOffsetof occurs when unsafe.Offsetof is called with a method - // selector, rather than a field selector, or when the field is embedded via - // a pointer. - // - // Per the spec: - // - // "If f is an embedded field, it must be reachable without pointer - // indirections through fields of the struct. " - // - // Example: - // import "unsafe" - // - // type T struct { f int } - // type S struct { *T } - // var s S - // var _ = unsafe.Offsetof(s.f) - // - // Example: - // import "unsafe" - // - // type S struct{} - // - // func (S) m() {} - // - // var s S - // var _ = unsafe.Offsetof(s.m) - InvalidOffsetof - - /* control flow > scope */ - - // UnusedExpr occurs when a side-effect free expression is used as a - // statement. Such a statement has no effect. - // - // Example: - // func f(i int) { - // i*i - // } - UnusedExpr - - // UnusedVar occurs when a variable is declared but unused. - // - // Example: - // func f() { - // x := 1 - // } - UnusedVar - - // MissingReturn occurs when a function with results is missing a return - // statement. - // - // Example: - // func f() int {} - MissingReturn - - // WrongResultCount occurs when a return statement returns an incorrect - // number of values. - // - // Example: - // func ReturnOne() int { - // return 1, 2 - // } - WrongResultCount - - // OutOfScopeResult occurs when the name of a value implicitly returned by - // an empty return statement is shadowed in a nested scope. - // - // Example: - // func factor(n int) (i int) { - // for i := 2; i < n; i++ { - // if n%i == 0 { - // return - // } - // } - // return 0 - // } - OutOfScopeResult - - /* control flow > if */ - - // InvalidCond occurs when an if condition is not a boolean expression. - // - // Example: - // func checkReturn(i int) { - // if i { - // panic("non-zero return") - // } - // } - InvalidCond - - /* control flow > for */ - - // InvalidPostDecl occurs when there is a declaration in a for-loop post - // statement. - // - // Example: - // func f() { - // for i := 0; i < 10; j := 0 {} - // } - InvalidPostDecl - - // InvalidChanRange occurs when a send-only channel used in a range - // expression. - // - // Example: - // func sum(c chan<- int) { - // s := 0 - // for i := range c { - // s += i - // } - // } - InvalidChanRange - - // InvalidIterVar occurs when two iteration variables are used while ranging - // over a channel. - // - // Example: - // func f(c chan int) { - // for k, v := range c { - // println(k, v) - // } - // } - InvalidIterVar - - // InvalidRangeExpr occurs when the type of a range expression is not array, - // slice, string, map, or channel. - // - // Example: - // func f(i int) { - // for j := range i { - // println(j) - // } - // } - InvalidRangeExpr - - /* control flow > switch */ - - // MisplacedBreak occurs when a break statement is not within a for, switch, - // or select statement of the innermost function definition. - // - // Example: - // func f() { - // break - // } - MisplacedBreak - - // MisplacedContinue occurs when a continue statement is not within a for - // loop of the innermost function definition. - // - // Example: - // func sumeven(n int) int { - // proceed := func() { - // continue - // } - // sum := 0 - // for i := 1; i <= n; i++ { - // if i % 2 != 0 { - // proceed() - // } - // sum += i - // } - // return sum - // } - MisplacedContinue - - // MisplacedFallthrough occurs when a fallthrough statement is not within an - // expression switch. - // - // Example: - // func typename(i interface{}) string { - // switch i.(type) { - // case int64: - // fallthrough - // case int: - // return "int" - // } - // return "unsupported" - // } - MisplacedFallthrough - - // DuplicateCase occurs when a type or expression switch has duplicate - // cases. - // - // Example: - // func printInt(i int) { - // switch i { - // case 1: - // println("one") - // case 1: - // println("One") - // } - // } - DuplicateCase - - // DuplicateDefault occurs when a type or expression switch has multiple - // default clauses. - // - // Example: - // func printInt(i int) { - // switch i { - // case 1: - // println("one") - // default: - // println("One") - // default: - // println("1") - // } - // } - DuplicateDefault - - // BadTypeKeyword occurs when a .(type) expression is used anywhere other - // than a type switch. - // - // Example: - // type I interface { - // m() - // } - // var t I - // var _ = t.(type) - BadTypeKeyword - - // InvalidTypeSwitch occurs when .(type) is used on an expression that is - // not of interface type. - // - // Example: - // func f(i int) { - // switch x := i.(type) {} - // } - InvalidTypeSwitch - - // InvalidExprSwitch occurs when a switch expression is not comparable. - // - // Example: - // func _() { - // var a struct{ _ func() } - // switch a /* ERROR cannot switch on a */ { - // } - // } - InvalidExprSwitch - - /* control flow > select */ - - // InvalidSelectCase occurs when a select case is not a channel send or - // receive. - // - // Example: - // func checkChan(c <-chan int) bool { - // select { - // case c: - // return true - // default: - // return false - // } - // } - InvalidSelectCase - - /* control flow > labels and jumps */ - - // UndeclaredLabel occurs when an undeclared label is jumped to. - // - // Example: - // func f() { - // goto L - // } - UndeclaredLabel - - // DuplicateLabel occurs when a label is declared more than once. - // - // Example: - // func f() int { - // L: - // L: - // return 1 - // } - DuplicateLabel - - // MisplacedLabel occurs when a break or continue label is not on a for, - // switch, or select statement. - // - // Example: - // func f() { - // L: - // a := []int{1,2,3} - // for _, e := range a { - // if e > 10 { - // break L - // } - // println(a) - // } - // } - MisplacedLabel - - // UnusedLabel occurs when a label is declared but not used. - // - // Example: - // func f() { - // L: - // } - UnusedLabel - - // JumpOverDecl occurs when a label jumps over a variable declaration. - // - // Example: - // func f() int { - // goto L - // x := 2 - // L: - // x++ - // return x - // } - JumpOverDecl - - // JumpIntoBlock occurs when a forward jump goes to a label inside a nested - // block. - // - // Example: - // func f(x int) { - // goto L - // if x > 0 { - // L: - // print("inside block") - // } - // } - JumpIntoBlock - - /* control flow > calls */ - - // InvalidMethodExpr occurs when a pointer method is called but the argument - // is not addressable. - // - // Example: - // type T struct {} - // - // func (*T) m() int { return 1 } - // - // var _ = T.m(T{}) - InvalidMethodExpr - - // WrongArgCount occurs when too few or too many arguments are passed by a - // function call. - // - // Example: - // func f(i int) {} - // var x = f() - WrongArgCount - - // InvalidCall occurs when an expression is called that is not of function - // type. - // - // Example: - // var x = "x" - // var y = x() - InvalidCall - - /* control flow > suspended */ - - // UnusedResults occurs when a restricted expression-only built-in function - // is suspended via go or defer. Such a suspension discards the results of - // these side-effect free built-in functions, and therefore is ineffectual. - // - // Example: - // func f(a []int) int { - // defer len(a) - // return i - // } - UnusedResults - - // InvalidDefer occurs when a deferred expression is not a function call, - // for example if the expression is a type conversion. - // - // Example: - // func f(i int) int { - // defer int32(i) - // return i - // } - InvalidDefer - - // InvalidGo occurs when a go expression is not a function call, for example - // if the expression is a type conversion. - // - // Example: - // func f(i int) int { - // go int32(i) - // return i - // } - InvalidGo - - // All codes below were added in Go 1.17. - - /* decl */ - - // BadDecl occurs when a declaration has invalid syntax. - BadDecl - - // RepeatedDecl occurs when an identifier occurs more than once on the left - // hand side of a short variable declaration. - // - // Example: - // func _() { - // x, y, y := 1, 2, 3 - // } - RepeatedDecl - - /* unsafe */ - - // InvalidUnsafeAdd occurs when unsafe.Add is called with a - // length argument that is not of integer type. - // - // Example: - // import "unsafe" - // - // var p unsafe.Pointer - // var _ = unsafe.Add(p, float64(1)) - InvalidUnsafeAdd - - // InvalidUnsafeSlice occurs when unsafe.Slice is called with a - // pointer argument that is not of pointer type or a length argument - // that is not of integer type, negative, or out of bounds. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(x, 1) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, float64(1)) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, -1) - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.Slice(&x, uint64(1) << 63) - InvalidUnsafeSlice - - // All codes below were added in Go 1.18. - - /* features */ - - // UnsupportedFeature occurs when a language feature is used that is not - // supported at this Go version. - UnsupportedFeature - - /* type params */ - - // NotAGenericType occurs when a non-generic type is used where a generic - // type is expected: in type or function instantiation. - // - // Example: - // type T int - // - // var _ T[int] - NotAGenericType - - // WrongTypeArgCount occurs when a type or function is instantiated with an - // incorrent number of type arguments, including when a generic type or - // function is used without instantiation. - // - // Errors inolving failed type inference are assigned other error codes. - // - // Example: - // type T[p any] int - // - // var _ T[int, string] - // - // Example: - // func f[T any]() {} - // - // var x = f - WrongTypeArgCount - - // CannotInferTypeArgs occurs when type or function type argument inference - // fails to infer all type arguments. - // - // Example: - // func f[T any]() {} - // - // func _() { - // f() - // } - // - // Example: - // type N[P, Q any] struct{} - // - // var _ N[int] - CannotInferTypeArgs - - // InvalidTypeArg occurs when a type argument does not satisfy its - // corresponding type parameter constraints. - // - // Example: - // type T[P ~int] struct{} - // - // var _ T[string] - InvalidTypeArg // arguments? InferenceFailed - - // InvalidInstanceCycle occurs when an invalid cycle is detected - // within the instantiation graph. - // - // Example: - // func f[T any]() { f[*T]() } - InvalidInstanceCycle - - // InvalidUnion occurs when an embedded union or approximation element is - // not valid. - // - // Example: - // type _ interface { - // ~int | interface{ m() } - // } - InvalidUnion - - // MisplacedConstraintIface occurs when a constraint-type interface is used - // outside of constraint position. - // - // Example: - // type I interface { ~int } - // - // var _ I - MisplacedConstraintIface - - // InvalidMethodTypeParams occurs when methods have type parameters. - // - // It cannot be encountered with an AST parsed using go/parser. - InvalidMethodTypeParams - - // MisplacedTypeParam occurs when a type parameter is used in a place where - // it is not permitted. - // - // Example: - // type T[P any] P - // - // Example: - // type T[P any] struct{ *P } - MisplacedTypeParam - - // InvalidUnsafeSliceData occurs when unsafe.SliceData is called with - // an argument that is not of slice type. It also occurs if it is used - // in a package compiled for a language version before go1.20. - // - // Example: - // import "unsafe" - // - // var x int - // var _ = unsafe.SliceData(x) - InvalidUnsafeSliceData - - // InvalidUnsafeString occurs when unsafe.String is called with - // a length argument that is not of integer type, negative, or - // out of bounds. It also occurs if it is used in a package - // compiled for a language version before go1.20. - // - // Example: - // import "unsafe" - // - // var b [10]byte - // var _ = unsafe.String(&b[0], -1) - InvalidUnsafeString - - // InvalidUnsafeStringData occurs if it is used in a package - // compiled for a language version before go1.20. - _ // not used anymore - -) diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go deleted file mode 100644 index 15ecf7c5ded9..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT. - -package typesinternal - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[InvalidSyntaxTree - -1] - _ = x[Test-1] - _ = x[BlankPkgName-2] - _ = x[MismatchedPkgName-3] - _ = x[InvalidPkgUse-4] - _ = x[BadImportPath-5] - _ = x[BrokenImport-6] - _ = x[ImportCRenamed-7] - _ = x[UnusedImport-8] - _ = x[InvalidInitCycle-9] - _ = x[DuplicateDecl-10] - _ = x[InvalidDeclCycle-11] - _ = x[InvalidTypeCycle-12] - _ = x[InvalidConstInit-13] - _ = x[InvalidConstVal-14] - _ = x[InvalidConstType-15] - _ = x[UntypedNilUse-16] - _ = x[WrongAssignCount-17] - _ = x[UnassignableOperand-18] - _ = x[NoNewVar-19] - _ = x[MultiValAssignOp-20] - _ = x[InvalidIfaceAssign-21] - _ = x[InvalidChanAssign-22] - _ = x[IncompatibleAssign-23] - _ = x[UnaddressableFieldAssign-24] - _ = x[NotAType-25] - _ = x[InvalidArrayLen-26] - _ = x[BlankIfaceMethod-27] - _ = x[IncomparableMapKey-28] - _ = x[InvalidIfaceEmbed-29] - _ = x[InvalidPtrEmbed-30] - _ = x[BadRecv-31] - _ = x[InvalidRecv-32] - _ = x[DuplicateFieldAndMethod-33] - _ = x[DuplicateMethod-34] - _ = x[InvalidBlank-35] - _ = x[InvalidIota-36] - _ = x[MissingInitBody-37] - _ = x[InvalidInitSig-38] - _ = x[InvalidInitDecl-39] - _ = x[InvalidMainDecl-40] - _ = x[TooManyValues-41] - _ = x[NotAnExpr-42] - _ = x[TruncatedFloat-43] - _ = x[NumericOverflow-44] - _ = x[UndefinedOp-45] - _ = x[MismatchedTypes-46] - _ = x[DivByZero-47] - _ = x[NonNumericIncDec-48] - _ = x[UnaddressableOperand-49] - _ = x[InvalidIndirection-50] - _ = x[NonIndexableOperand-51] - _ = x[InvalidIndex-52] - _ = x[SwappedSliceIndices-53] - _ = x[NonSliceableOperand-54] - _ = x[InvalidSliceExpr-55] - _ = x[InvalidShiftCount-56] - _ = x[InvalidShiftOperand-57] - _ = x[InvalidReceive-58] - _ = x[InvalidSend-59] - _ = x[DuplicateLitKey-60] - _ = x[MissingLitKey-61] - _ = x[InvalidLitIndex-62] - _ = x[OversizeArrayLit-63] - _ = x[MixedStructLit-64] - _ = x[InvalidStructLit-65] - _ = x[MissingLitField-66] - _ = x[DuplicateLitField-67] - _ = x[UnexportedLitField-68] - _ = x[InvalidLitField-69] - _ = x[UntypedLit-70] - _ = x[InvalidLit-71] - _ = x[AmbiguousSelector-72] - _ = x[UndeclaredImportedName-73] - _ = x[UnexportedName-74] - _ = x[UndeclaredName-75] - _ = x[MissingFieldOrMethod-76] - _ = x[BadDotDotDotSyntax-77] - _ = x[NonVariadicDotDotDot-78] - _ = x[MisplacedDotDotDot-79] - _ = x[InvalidDotDotDotOperand-80] - _ = x[InvalidDotDotDot-81] - _ = x[UncalledBuiltin-82] - _ = x[InvalidAppend-83] - _ = x[InvalidCap-84] - _ = x[InvalidClose-85] - _ = x[InvalidCopy-86] - _ = x[InvalidComplex-87] - _ = x[InvalidDelete-88] - _ = x[InvalidImag-89] - _ = x[InvalidLen-90] - _ = x[SwappedMakeArgs-91] - _ = x[InvalidMake-92] - _ = x[InvalidReal-93] - _ = x[InvalidAssert-94] - _ = x[ImpossibleAssert-95] - _ = x[InvalidConversion-96] - _ = x[InvalidUntypedConversion-97] - _ = x[BadOffsetofSyntax-98] - _ = x[InvalidOffsetof-99] - _ = x[UnusedExpr-100] - _ = x[UnusedVar-101] - _ = x[MissingReturn-102] - _ = x[WrongResultCount-103] - _ = x[OutOfScopeResult-104] - _ = x[InvalidCond-105] - _ = x[InvalidPostDecl-106] - _ = x[InvalidChanRange-107] - _ = x[InvalidIterVar-108] - _ = x[InvalidRangeExpr-109] - _ = x[MisplacedBreak-110] - _ = x[MisplacedContinue-111] - _ = x[MisplacedFallthrough-112] - _ = x[DuplicateCase-113] - _ = x[DuplicateDefault-114] - _ = x[BadTypeKeyword-115] - _ = x[InvalidTypeSwitch-116] - _ = x[InvalidExprSwitch-117] - _ = x[InvalidSelectCase-118] - _ = x[UndeclaredLabel-119] - _ = x[DuplicateLabel-120] - _ = x[MisplacedLabel-121] - _ = x[UnusedLabel-122] - _ = x[JumpOverDecl-123] - _ = x[JumpIntoBlock-124] - _ = x[InvalidMethodExpr-125] - _ = x[WrongArgCount-126] - _ = x[InvalidCall-127] - _ = x[UnusedResults-128] - _ = x[InvalidDefer-129] - _ = x[InvalidGo-130] - _ = x[BadDecl-131] - _ = x[RepeatedDecl-132] - _ = x[InvalidUnsafeAdd-133] - _ = x[InvalidUnsafeSlice-134] - _ = x[UnsupportedFeature-135] - _ = x[NotAGenericType-136] - _ = x[WrongTypeArgCount-137] - _ = x[CannotInferTypeArgs-138] - _ = x[InvalidTypeArg-139] - _ = x[InvalidInstanceCycle-140] - _ = x[InvalidUnion-141] - _ = x[MisplacedConstraintIface-142] - _ = x[InvalidMethodTypeParams-143] - _ = x[MisplacedTypeParam-144] - _ = x[InvalidUnsafeSliceData-145] - _ = x[InvalidUnsafeString-146] -} - -const ( - _ErrorCode_name_0 = "InvalidSyntaxTree" - _ErrorCode_name_1 = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilUseWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKeyInvalidIfaceEmbedInvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDotInvalidDotDotDotOperandInvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDeclInvalidChanRangeInvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidExprSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGoBadDeclRepeatedDeclInvalidUnsafeAddInvalidUnsafeSliceUnsupportedFeatureNotAGenericTypeWrongTypeArgCountCannotInferTypeArgsInvalidTypeArgInvalidInstanceCycleInvalidUnionMisplacedConstraintIfaceInvalidMethodTypeParamsMisplacedTypeParamInvalidUnsafeSliceDataInvalidUnsafeString" -) - -var ( - _ErrorCode_index_1 = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 218, 234, 253, 261, 277, 295, 312, 330, 354, 362, 377, 393, 411, 428, 443, 450, 461, 484, 499, 511, 522, 537, 551, 566, 581, 594, 603, 617, 632, 643, 658, 667, 683, 703, 721, 740, 752, 771, 790, 806, 823, 842, 856, 867, 882, 895, 910, 926, 940, 956, 971, 988, 1006, 1021, 1031, 1041, 1058, 1080, 1094, 1108, 1128, 1146, 1166, 1184, 1207, 1223, 1238, 1251, 1261, 1273, 1284, 1298, 1311, 1322, 1332, 1347, 1358, 1369, 1382, 1398, 1415, 1439, 1456, 1471, 1481, 1490, 1503, 1519, 1535, 1546, 1561, 1577, 1591, 1607, 1621, 1638, 1658, 1671, 1687, 1701, 1718, 1735, 1752, 1767, 1781, 1795, 1806, 1818, 1831, 1848, 1861, 1872, 1885, 1897, 1906, 1913, 1925, 1941, 1959, 1977, 1992, 2009, 2028, 2042, 2062, 2074, 2098, 2121, 2139, 2161, 2180} -) - -func (i ErrorCode) String() string { - switch { - case i == -1: - return _ErrorCode_name_0 - case 1 <= i && i <= 146: - i -= 1 - return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]] - default: - return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" - } -} diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/types.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/types.go deleted file mode 100644 index 66e8b099bd6d..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/types.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2020 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package typesinternal provides access to internal go/types APIs that are not -// yet exported. -package typesinternal - -import ( - "go/token" - "go/types" - "reflect" - "unsafe" - - "golang.org/x/tools/go/types/objectpath" -) - -func SetUsesCgo(conf *types.Config) bool { - v := reflect.ValueOf(conf).Elem() - - f := v.FieldByName("go115UsesCgo") - if !f.IsValid() { - f = v.FieldByName("UsesCgo") - if !f.IsValid() { - return false - } - } - - addr := unsafe.Pointer(f.UnsafeAddr()) - *(*bool)(addr) = true - - return true -} - -// ReadGo116ErrorData extracts additional information from types.Error values -// generated by Go version 1.16 and later: the error code, start position, and -// end position. If all positions are valid, start <= err.Pos <= end. -// -// If the data could not be read, the final result parameter will be false. -func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) { - var data [3]int - // By coincidence all of these fields are ints, which simplifies things. - v := reflect.ValueOf(err) - for i, name := range []string{"go116code", "go116start", "go116end"} { - f := v.FieldByName(name) - if !f.IsValid() { - return 0, 0, 0, false - } - data[i] = int(f.Int()) - } - return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true -} - -var SetGoVersion = func(conf *types.Config, version string) bool { return false } - -// SkipEncoderMethodSorting marks the encoder as not requiring sorted methods, -// as an optimization for gopls (which guarantees the order of parsed source files). -// -// TODO(golang/go#61443): eliminate this parameter one way or the other. -// -//go:linkname SkipEncoderMethodSorting golang.org/x/tools/go/types/objectpath.skipMethodSorting -func SkipEncoderMethodSorting(enc *objectpath.Encoder) - -// ObjectpathObject is like objectpath.Object, but allows suppressing method -// sorting (which is not necessary for gopls). -// -//go:linkname ObjectpathObject golang.org/x/tools/go/types/objectpath.object -func ObjectpathObject(pkg *types.Package, p objectpath.Path, skipMethodSorting bool) (types.Object, error) diff --git a/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/types_118.go b/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/types_118.go deleted file mode 100644 index a42b072a67d3..000000000000 --- a/cluster-autoscaler/vendor/golang.org/x/tools/internal/typesinternal/types_118.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2021 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.18 -// +build go1.18 - -package typesinternal - -import ( - "go/types" -) - -func init() { - SetGoVersion = func(conf *types.Config, version string) bool { - conf.GoVersion = version - return true - } -} diff --git a/cluster-autoscaler/vendor/google.golang.org/api/internal/cba.go b/cluster-autoscaler/vendor/google.golang.org/api/internal/cba.go deleted file mode 100644 index cecbb9ba115b..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/api/internal/cba.go +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// cba.go (certificate-based access) contains utils for implementing Device Certificate -// Authentication according to https://google.aip.dev/auth/4114 and Default Credentials -// for Google Cloud Virtual Environments according to https://google.aip.dev/auth/4115. -// -// The overall logic for DCA is as follows: -// 1. If both endpoint override and client certificate are specified, use them as is. -// 2. If user does not specify client certificate, we will attempt to use default -// client certificate. -// 3. If user does not specify endpoint override, we will use defaultMtlsEndpoint if -// client certificate is available and defaultEndpoint otherwise. -// -// Implications of the above logic: -// 1. If the user specifies a non-mTLS endpoint override but client certificate is -// available, we will pass along the cert anyway and let the server decide what to do. -// 2. If the user specifies an mTLS endpoint override but client certificate is not -// available, we will not fail-fast, but let backend throw error when connecting. -// -// If running within Google's cloud environment, and client certificate is not specified -// and not available through DCA, we will try mTLS with credentials held by -// the Secure Session Agent, which is part of Google's cloud infrastructure. -// -// We would like to avoid introducing client-side logic that parses whether the -// endpoint override is an mTLS url, since the url pattern may change at anytime. -// -// This package is not intended for use by end developers. Use the -// google.golang.org/api/option package to configure API clients. - -// Package internal supports the options and transport packages. -package internal - -import ( - "context" - "crypto/tls" - "net" - "net/url" - "os" - "strings" - - "github.com/google/s2a-go" - "github.com/google/s2a-go/fallback" - "google.golang.org/api/internal/cert" - "google.golang.org/grpc/credentials" -) - -const ( - mTLSModeAlways = "always" - mTLSModeNever = "never" - mTLSModeAuto = "auto" - - // Experimental: if true, the code will try MTLS with S2A as the default for transport security. Default value is false. - googleAPIUseS2AEnv = "EXPERIMENTAL_GOOGLE_API_USE_S2A" -) - -// getClientCertificateSourceAndEndpoint is a convenience function that invokes -// getClientCertificateSource and getEndpoint sequentially and returns the client -// cert source and endpoint as a tuple. -func getClientCertificateSourceAndEndpoint(settings *DialSettings) (cert.Source, string, error) { - clientCertSource, err := getClientCertificateSource(settings) - if err != nil { - return nil, "", err - } - endpoint, err := getEndpoint(settings, clientCertSource) - if err != nil { - return nil, "", err - } - return clientCertSource, endpoint, nil -} - -type transportConfig struct { - clientCertSource cert.Source // The client certificate source. - endpoint string // The corresponding endpoint to use based on client certificate source. - s2aAddress string // The S2A address if it can be used, otherwise an empty string. - s2aMTLSEndpoint string // The MTLS endpoint to use with S2A. -} - -func getTransportConfig(settings *DialSettings) (*transportConfig, error) { - clientCertSource, endpoint, err := getClientCertificateSourceAndEndpoint(settings) - if err != nil { - return &transportConfig{ - clientCertSource: nil, endpoint: "", s2aAddress: "", s2aMTLSEndpoint: "", - }, err - } - defaultTransportConfig := transportConfig{ - clientCertSource: clientCertSource, - endpoint: endpoint, - s2aAddress: "", - s2aMTLSEndpoint: "", - } - - // Check the env to determine whether to use S2A. - if !isGoogleS2AEnabled() { - return &defaultTransportConfig, nil - } - - // If client cert is found, use that over S2A. - // If MTLS is not enabled for the endpoint, skip S2A. - if clientCertSource != nil || !mtlsEndpointEnabledForS2A() { - return &defaultTransportConfig, nil - } - s2aMTLSEndpoint := settings.DefaultMTLSEndpoint - // If there is endpoint override, honor it. - if settings.Endpoint != "" { - s2aMTLSEndpoint = endpoint - } - s2aAddress := GetS2AAddress() - if s2aAddress == "" { - return &defaultTransportConfig, nil - } - return &transportConfig{ - clientCertSource: clientCertSource, - endpoint: endpoint, - s2aAddress: s2aAddress, - s2aMTLSEndpoint: s2aMTLSEndpoint, - }, nil -} - -func isGoogleS2AEnabled() bool { - return strings.ToLower(os.Getenv(googleAPIUseS2AEnv)) == "true" -} - -// getClientCertificateSource returns a default client certificate source, if -// not provided by the user. -// -// A nil default source can be returned if the source does not exist. Any exceptions -// encountered while initializing the default source will be reported as client -// error (ex. corrupt metadata file). -// -// Important Note: For now, the environment variable GOOGLE_API_USE_CLIENT_CERTIFICATE -// must be set to "true" to allow certificate to be used (including user provided -// certificates). For details, see AIP-4114. -func getClientCertificateSource(settings *DialSettings) (cert.Source, error) { - if !isClientCertificateEnabled() { - return nil, nil - } else if settings.ClientCertSource != nil { - return settings.ClientCertSource, nil - } else { - return cert.DefaultSource() - } -} - -func isClientCertificateEnabled() bool { - useClientCert := os.Getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE") - // TODO(andyrzhao): Update default to return "true" after DCA feature is fully released. - return strings.ToLower(useClientCert) == "true" -} - -// getEndpoint returns the endpoint for the service, taking into account the -// user-provided endpoint override "settings.Endpoint". -// -// If no endpoint override is specified, we will either return the default endpoint or -// the default mTLS endpoint if a client certificate is available. -// -// You can override the default endpoint choice (mtls vs. regular) by setting the -// GOOGLE_API_USE_MTLS_ENDPOINT environment variable. -// -// If the endpoint override is an address (host:port) rather than full base -// URL (ex. https://...), then the user-provided address will be merged into -// the default endpoint. For example, WithEndpoint("myhost:8000") and -// WithDefaultEndpoint("https://foo.com/bar/baz") will return "https://myhost:8080/bar/baz" -func getEndpoint(settings *DialSettings, clientCertSource cert.Source) (string, error) { - if settings.Endpoint == "" { - mtlsMode := getMTLSMode() - if mtlsMode == mTLSModeAlways || (clientCertSource != nil && mtlsMode == mTLSModeAuto) { - return settings.DefaultMTLSEndpoint, nil - } - return settings.DefaultEndpoint, nil - } - if strings.Contains(settings.Endpoint, "://") { - // User passed in a full URL path, use it verbatim. - return settings.Endpoint, nil - } - if settings.DefaultEndpoint == "" { - // If DefaultEndpoint is not configured, use the user provided endpoint verbatim. - // This allows a naked "host[:port]" URL to be used with GRPC Direct Path. - return settings.Endpoint, nil - } - - // Assume user-provided endpoint is host[:port], merge it with the default endpoint. - return mergeEndpoints(settings.DefaultEndpoint, settings.Endpoint) -} - -func getMTLSMode() string { - mode := os.Getenv("GOOGLE_API_USE_MTLS_ENDPOINT") - if mode == "" { - mode = os.Getenv("GOOGLE_API_USE_MTLS") // Deprecated. - } - if mode == "" { - return mTLSModeAuto - } - return strings.ToLower(mode) -} - -func mergeEndpoints(baseURL, newHost string) (string, error) { - u, err := url.Parse(fixScheme(baseURL)) - if err != nil { - return "", err - } - return strings.Replace(baseURL, u.Host, newHost, 1), nil -} - -func fixScheme(baseURL string) string { - if !strings.Contains(baseURL, "://") { - return "https://" + baseURL - } - return baseURL -} - -// GetGRPCTransportConfigAndEndpoint returns an instance of credentials.TransportCredentials, and the -// corresponding endpoint to use for GRPC client. -func GetGRPCTransportConfigAndEndpoint(settings *DialSettings) (credentials.TransportCredentials, string, error) { - config, err := getTransportConfig(settings) - if err != nil { - return nil, "", err - } - - defaultTransportCreds := credentials.NewTLS(&tls.Config{ - GetClientCertificate: config.clientCertSource, - }) - if config.s2aAddress == "" { - return defaultTransportCreds, config.endpoint, nil - } - - var fallbackOpts *s2a.FallbackOptions - // In case of S2A failure, fall back to the endpoint that would've been used without S2A. - if fallbackHandshake, err := fallback.DefaultFallbackClientHandshakeFunc(config.endpoint); err == nil { - fallbackOpts = &s2a.FallbackOptions{ - FallbackClientHandshakeFunc: fallbackHandshake, - } - } - - s2aTransportCreds, err := s2a.NewClientCreds(&s2a.ClientOptions{ - S2AAddress: config.s2aAddress, - FallbackOpts: fallbackOpts, - }) - if err != nil { - // Use default if we cannot initialize S2A client transport credentials. - return defaultTransportCreds, config.endpoint, nil - } - return s2aTransportCreds, config.s2aMTLSEndpoint, nil -} - -// GetHTTPTransportConfigAndEndpoint returns a client certificate source, a function for dialing MTLS with S2A, -// and the endpoint to use for HTTP client. -func GetHTTPTransportConfigAndEndpoint(settings *DialSettings) (cert.Source, func(context.Context, string, string) (net.Conn, error), string, error) { - config, err := getTransportConfig(settings) - if err != nil { - return nil, nil, "", err - } - - if config.s2aAddress == "" { - return config.clientCertSource, nil, config.endpoint, nil - } - - var fallbackOpts *s2a.FallbackOptions - // In case of S2A failure, fall back to the endpoint that would've been used without S2A. - if fallbackURL, err := url.Parse(config.endpoint); err == nil { - if fallbackDialer, fallbackServerAddr, err := fallback.DefaultFallbackDialerAndAddress(fallbackURL.Hostname()); err == nil { - fallbackOpts = &s2a.FallbackOptions{ - FallbackDialer: &s2a.FallbackDialer{ - Dialer: fallbackDialer, - ServerAddr: fallbackServerAddr, - }, - } - } - } - - dialTLSContextFunc := s2a.NewS2ADialTLSContextFunc(&s2a.ClientOptions{ - S2AAddress: config.s2aAddress, - FallbackOpts: fallbackOpts, - }) - return nil, dialTLSContextFunc, config.s2aMTLSEndpoint, nil -} - -// mtlsEndpointEnabledForS2A checks if the endpoint is indeed MTLS-enabled, so that we can use S2A for MTLS connection. -var mtlsEndpointEnabledForS2A = func() bool { - // TODO(xmenxk): determine this via discovery config. - return true -} diff --git a/cluster-autoscaler/vendor/google.golang.org/api/internal/s2a.go b/cluster-autoscaler/vendor/google.golang.org/api/internal/s2a.go deleted file mode 100644 index c5b421f5544e..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/api/internal/s2a.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2023 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package internal - -import ( - "encoding/json" - "log" - "sync" - "time" - - "cloud.google.com/go/compute/metadata" -) - -const configEndpointSuffix = "googleAutoMtlsConfiguration" - -// The period an MTLS config can be reused before needing refresh. -var configExpiry = time.Hour - -// GetS2AAddress returns the S2A address to be reached via plaintext connection. -func GetS2AAddress() string { - c, err := getMetadataMTLSAutoConfig().Config() - if err != nil { - return "" - } - if !c.Valid() { - return "" - } - return c.S2A.PlaintextAddress -} - -type mtlsConfigSource interface { - Config() (*mtlsConfig, error) -} - -// mdsMTLSAutoConfigSource is an instance of reuseMTLSConfigSource, with metadataMTLSAutoConfig as its config source. -var ( - mdsMTLSAutoConfigSource mtlsConfigSource - once sync.Once -) - -// getMetadataMTLSAutoConfig returns mdsMTLSAutoConfigSource, which is backed by config from MDS with auto-refresh. -func getMetadataMTLSAutoConfig() mtlsConfigSource { - once.Do(func() { - mdsMTLSAutoConfigSource = &reuseMTLSConfigSource{ - src: &metadataMTLSAutoConfig{}, - } - }) - return mdsMTLSAutoConfigSource -} - -// reuseMTLSConfigSource caches a valid version of mtlsConfig, and uses `src` to refresh upon config expiry. -// It implements the mtlsConfigSource interface, so calling Config() on it returns an mtlsConfig. -type reuseMTLSConfigSource struct { - src mtlsConfigSource // src.Config() is called when config is expired - mu sync.Mutex // mutex guards config - config *mtlsConfig // cached config -} - -func (cs *reuseMTLSConfigSource) Config() (*mtlsConfig, error) { - cs.mu.Lock() - defer cs.mu.Unlock() - - if cs.config.Valid() { - return cs.config, nil - } - c, err := cs.src.Config() - if err != nil { - return nil, err - } - cs.config = c - return c, nil -} - -// metadataMTLSAutoConfig is an implementation of the interface mtlsConfigSource -// It has the logic to query MDS and return an mtlsConfig -type metadataMTLSAutoConfig struct{} - -var httpGetMetadataMTLSConfig = func() (string, error) { - return metadata.Get(configEndpointSuffix) -} - -func (cs *metadataMTLSAutoConfig) Config() (*mtlsConfig, error) { - resp, err := httpGetMetadataMTLSConfig() - if err != nil { - log.Printf("querying MTLS config from MDS endpoint failed: %v", err) - return defaultMTLSConfig(), nil - } - var config mtlsConfig - err = json.Unmarshal([]byte(resp), &config) - if err != nil { - log.Printf("unmarshalling MTLS config from MDS endpoint failed: %v", err) - return defaultMTLSConfig(), nil - } - - if config.S2A == nil { - log.Printf("returned MTLS config from MDS endpoint is invalid: %v", config) - return defaultMTLSConfig(), nil - } - - // set new expiry - config.Expiry = time.Now().Add(configExpiry) - return &config, nil -} - -func defaultMTLSConfig() *mtlsConfig { - return &mtlsConfig{ - S2A: &s2aAddresses{ - PlaintextAddress: "", - MTLSAddress: "", - }, - Expiry: time.Now().Add(configExpiry), - } -} - -// s2aAddresses contains the plaintext and/or MTLS S2A addresses. -type s2aAddresses struct { - // PlaintextAddress is the plaintext address to reach S2A - PlaintextAddress string `json:"plaintext_address"` - // MTLSAddress is the MTLS address to reach S2A - MTLSAddress string `json:"mtls_address"` -} - -// mtlsConfig contains the configuration for establishing MTLS connections with Google APIs. -type mtlsConfig struct { - S2A *s2aAddresses `json:"s2a"` - Expiry time.Time -} - -func (c *mtlsConfig) Valid() bool { - return c != nil && c.S2A != nil && !c.expired() -} -func (c *mtlsConfig) expired() bool { - return c.Expiry.Before(time.Now()) -} diff --git a/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/LICENSE b/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/LICENSE deleted file mode 100644 index d64569567334..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/tidyfix.go b/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/tidyfix.go deleted file mode 100644 index 1d3f1b5b7efe..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/api/tidyfix.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2023 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. - -// This file, and the {{.RootMod}} import, won't actually become part of -// the resultant binary. -//go:build modhack -// +build modhack - -package api - -// Necessary for safely adding multi-module repo. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "google.golang.org/genproto/internal" diff --git a/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/rpc/LICENSE b/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/rpc/LICENSE deleted file mode 100644 index d64569567334..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/genproto/googleapis/rpc/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cluster-autoscaler/vendor/google.golang.org/genproto/internal/doc.go b/cluster-autoscaler/vendor/google.golang.org/genproto/internal/doc.go deleted file mode 100644 index 90e89b4aa3ff..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/genproto/internal/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2023 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. - -// This file makes internal an importable go package -// for use with backreferences from submodules. -package internal diff --git a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go b/cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go deleted file mode 100644 index 900917dbe6c1..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go +++ /dev/null @@ -1,125 +0,0 @@ -/* - * - * Copyright 2022 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 grpcsync - -import ( - "context" - "sync" - - "google.golang.org/grpc/internal/buffer" -) - -// CallbackSerializer provides a mechanism to schedule callbacks in a -// synchronized manner. It provides a FIFO guarantee on the order of execution -// of scheduled callbacks. New callbacks can be scheduled by invoking the -// Schedule() method. -// -// This type is safe for concurrent access. -type CallbackSerializer struct { - // done is closed once the serializer is shut down completely, i.e all - // scheduled callbacks are executed and the serializer has deallocated all - // its resources. - done chan struct{} - - callbacks *buffer.Unbounded - closedMu sync.Mutex - closed bool -} - -// NewCallbackSerializer returns a new CallbackSerializer instance. The provided -// context will be passed to the scheduled callbacks. Users should cancel the -// provided context to shutdown the CallbackSerializer. It is guaranteed that no -// callbacks will be added once this context is canceled, and any pending un-run -// callbacks will be executed before the serializer is shut down. -func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { - cs := &CallbackSerializer{ - done: make(chan struct{}), - callbacks: buffer.NewUnbounded(), - } - go cs.run(ctx) - return cs -} - -// Schedule adds a callback to be scheduled after existing callbacks are run. -// -// Callbacks are expected to honor the context when performing any blocking -// operations, and should return early when the context is canceled. -// -// Return value indicates if the callback was successfully added to the list of -// callbacks to be executed by the serializer. It is not possible to add -// callbacks once the context passed to NewCallbackSerializer is cancelled. -func (cs *CallbackSerializer) Schedule(f func(ctx context.Context)) bool { - cs.closedMu.Lock() - defer cs.closedMu.Unlock() - - if cs.closed { - return false - } - cs.callbacks.Put(f) - return true -} - -func (cs *CallbackSerializer) run(ctx context.Context) { - var backlog []func(context.Context) - - defer close(cs.done) - for ctx.Err() == nil { - select { - case <-ctx.Done(): - // Do nothing here. Next iteration of the for loop will not happen, - // since ctx.Err() would be non-nil. - case callback, ok := <-cs.callbacks.Get(): - if !ok { - return - } - cs.callbacks.Load() - callback.(func(ctx context.Context))(ctx) - } - } - - // Fetch pending callbacks if any, and execute them before returning from - // this method and closing cs.done. - cs.closedMu.Lock() - cs.closed = true - backlog = cs.fetchPendingCallbacks() - cs.callbacks.Close() - cs.closedMu.Unlock() - for _, b := range backlog { - b(ctx) - } -} - -func (cs *CallbackSerializer) fetchPendingCallbacks() []func(context.Context) { - var backlog []func(context.Context) - for { - select { - case b := <-cs.callbacks.Get(): - backlog = append(backlog, b.(func(context.Context))) - cs.callbacks.Load() - default: - return backlog - } - } -} - -// Done returns a channel that is closed after the context passed to -// NewCallbackSerializer is canceled and all callbacks have been executed. -func (cs *CallbackSerializer) Done() <-chan struct{} { - return cs.done -} diff --git a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go b/cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go deleted file mode 100644 index aef8cec1ab0c..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go +++ /dev/null @@ -1,121 +0,0 @@ -/* - * - * Copyright 2023 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 grpcsync - -import ( - "context" - "sync" -) - -// Subscriber represents an entity that is subscribed to messages published on -// a PubSub. It wraps the callback to be invoked by the PubSub when a new -// message is published. -type Subscriber interface { - // OnMessage is invoked when a new message is published. Implementations - // must not block in this method. - OnMessage(msg any) -} - -// PubSub is a simple one-to-many publish-subscribe system that supports -// messages of arbitrary type. It guarantees that messages are delivered in -// the same order in which they were published. -// -// Publisher invokes the Publish() method to publish new messages, while -// subscribers interested in receiving these messages register a callback -// via the Subscribe() method. -// -// Once a PubSub is stopped, no more messages can be published, but any pending -// published messages will be delivered to the subscribers. Done may be used -// to determine when all published messages have been delivered. -type PubSub struct { - cs *CallbackSerializer - - // Access to the below fields are guarded by this mutex. - mu sync.Mutex - msg any - subscribers map[Subscriber]bool -} - -// NewPubSub returns a new PubSub instance. Users should cancel the -// provided context to shutdown the PubSub. -func NewPubSub(ctx context.Context) *PubSub { - return &PubSub{ - cs: NewCallbackSerializer(ctx), - subscribers: map[Subscriber]bool{}, - } -} - -// Subscribe registers the provided Subscriber to the PubSub. -// -// If the PubSub contains a previously published message, the Subscriber's -// OnMessage() callback will be invoked asynchronously with the existing -// message to begin with, and subsequently for every newly published message. -// -// The caller is responsible for invoking the returned cancel function to -// unsubscribe itself from the PubSub. -func (ps *PubSub) Subscribe(sub Subscriber) (cancel func()) { - ps.mu.Lock() - defer ps.mu.Unlock() - - ps.subscribers[sub] = true - - if ps.msg != nil { - msg := ps.msg - ps.cs.Schedule(func(context.Context) { - ps.mu.Lock() - defer ps.mu.Unlock() - if !ps.subscribers[sub] { - return - } - sub.OnMessage(msg) - }) - } - - return func() { - ps.mu.Lock() - defer ps.mu.Unlock() - delete(ps.subscribers, sub) - } -} - -// Publish publishes the provided message to the PubSub, and invokes -// callbacks registered by subscribers asynchronously. -func (ps *PubSub) Publish(msg any) { - ps.mu.Lock() - defer ps.mu.Unlock() - - ps.msg = msg - for sub := range ps.subscribers { - s := sub - ps.cs.Schedule(func(context.Context) { - ps.mu.Lock() - defer ps.mu.Unlock() - if !ps.subscribers[s] { - return - } - s.OnMessage(msg) - }) - } -} - -// Done returns a channel that is closed after the context passed to NewPubSub -// is canceled and all updates have been sent to subscribers. -func (ps *PubSub) Done() <-chan struct{} { - return ps.cs.Done() -} diff --git a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/idle/idle.go b/cluster-autoscaler/vendor/google.golang.org/grpc/internal/idle/idle.go deleted file mode 100644 index 6c272476e5ef..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/idle/idle.go +++ /dev/null @@ -1,301 +0,0 @@ -/* - * - * Copyright 2023 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 idle contains a component for managing idleness (entering and exiting) -// based on RPC activity. -package idle - -import ( - "fmt" - "math" - "sync" - "sync/atomic" - "time" - - "google.golang.org/grpc/grpclog" -) - -// For overriding in unit tests. -var timeAfterFunc = func(d time.Duration, f func()) *time.Timer { - return time.AfterFunc(d, f) -} - -// Enforcer is the functionality provided by grpc.ClientConn to enter -// and exit from idle mode. -type Enforcer interface { - ExitIdleMode() error - EnterIdleMode() error -} - -// Manager defines the functionality required to track RPC activity on a -// channel. -type Manager interface { - OnCallBegin() error - OnCallEnd() - Close() -} - -type noopManager struct{} - -func (noopManager) OnCallBegin() error { return nil } -func (noopManager) OnCallEnd() {} -func (noopManager) Close() {} - -// manager implements the Manager interface. It uses atomic operations to -// synchronize access to shared state and a mutex to guarantee mutual exclusion -// in a critical section. -type manager struct { - // State accessed atomically. - lastCallEndTime int64 // Unix timestamp in nanos; time when the most recent RPC completed. - activeCallsCount int32 // Count of active RPCs; -math.MaxInt32 means channel is idle or is trying to get there. - activeSinceLastTimerCheck int32 // Boolean; True if there was an RPC since the last timer callback. - closed int32 // Boolean; True when the manager is closed. - - // Can be accessed without atomics or mutex since these are set at creation - // time and read-only after that. - enforcer Enforcer // Functionality provided by grpc.ClientConn. - timeout int64 // Idle timeout duration nanos stored as an int64. - logger grpclog.LoggerV2 - - // idleMu is used to guarantee mutual exclusion in two scenarios: - // - Opposing intentions: - // - a: Idle timeout has fired and handleIdleTimeout() is trying to put - // the channel in idle mode because the channel has been inactive. - // - b: At the same time an RPC is made on the channel, and OnCallBegin() - // is trying to prevent the channel from going idle. - // - Competing intentions: - // - The channel is in idle mode and there are multiple RPCs starting at - // the same time, all trying to move the channel out of idle. Only one - // of them should succeed in doing so, while the other RPCs should - // piggyback on the first one and be successfully handled. - idleMu sync.RWMutex - actuallyIdle bool - timer *time.Timer -} - -// ManagerOptions is a collection of options used by -// NewManager. -type ManagerOptions struct { - Enforcer Enforcer - Timeout time.Duration - Logger grpclog.LoggerV2 -} - -// NewManager creates a new idleness manager implementation for the -// given idle timeout. -func NewManager(opts ManagerOptions) Manager { - if opts.Timeout == 0 { - return noopManager{} - } - - m := &manager{ - enforcer: opts.Enforcer, - timeout: int64(opts.Timeout), - logger: opts.Logger, - } - m.timer = timeAfterFunc(opts.Timeout, m.handleIdleTimeout) - return m -} - -// resetIdleTimer resets the idle timer to the given duration. This method -// should only be called from the timer callback. -func (m *manager) resetIdleTimer(d time.Duration) { - m.idleMu.Lock() - defer m.idleMu.Unlock() - - if m.timer == nil { - // Only close sets timer to nil. We are done. - return - } - - // It is safe to ignore the return value from Reset() because this method is - // only ever called from the timer callback, which means the timer has - // already fired. - m.timer.Reset(d) -} - -// handleIdleTimeout is the timer callback that is invoked upon expiry of the -// configured idle timeout. The channel is considered inactive if there are no -// ongoing calls and no RPC activity since the last time the timer fired. -func (m *manager) handleIdleTimeout() { - if m.isClosed() { - return - } - - if atomic.LoadInt32(&m.activeCallsCount) > 0 { - m.resetIdleTimer(time.Duration(m.timeout)) - return - } - - // There has been activity on the channel since we last got here. Reset the - // timer and return. - if atomic.LoadInt32(&m.activeSinceLastTimerCheck) == 1 { - // Set the timer to fire after a duration of idle timeout, calculated - // from the time the most recent RPC completed. - atomic.StoreInt32(&m.activeSinceLastTimerCheck, 0) - m.resetIdleTimer(time.Duration(atomic.LoadInt64(&m.lastCallEndTime) + m.timeout - time.Now().UnixNano())) - return - } - - // This CAS operation is extremely likely to succeed given that there has - // been no activity since the last time we were here. Setting the - // activeCallsCount to -math.MaxInt32 indicates to OnCallBegin() that the - // channel is either in idle mode or is trying to get there. - if !atomic.CompareAndSwapInt32(&m.activeCallsCount, 0, -math.MaxInt32) { - // This CAS operation can fail if an RPC started after we checked for - // activity at the top of this method, or one was ongoing from before - // the last time we were here. In both case, reset the timer and return. - m.resetIdleTimer(time.Duration(m.timeout)) - return - } - - // Now that we've set the active calls count to -math.MaxInt32, it's time to - // actually move to idle mode. - if m.tryEnterIdleMode() { - // Successfully entered idle mode. No timer needed until we exit idle. - return - } - - // Failed to enter idle mode due to a concurrent RPC that kept the channel - // active, or because of an error from the channel. Undo the attempt to - // enter idle, and reset the timer to try again later. - atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) - m.resetIdleTimer(time.Duration(m.timeout)) -} - -// tryEnterIdleMode instructs the channel to enter idle mode. But before -// that, it performs a last minute check to ensure that no new RPC has come in, -// making the channel active. -// -// Return value indicates whether or not the channel moved to idle mode. -// -// Holds idleMu which ensures mutual exclusion with exitIdleMode. -func (m *manager) tryEnterIdleMode() bool { - m.idleMu.Lock() - defer m.idleMu.Unlock() - - if atomic.LoadInt32(&m.activeCallsCount) != -math.MaxInt32 { - // We raced and lost to a new RPC. Very rare, but stop entering idle. - return false - } - if atomic.LoadInt32(&m.activeSinceLastTimerCheck) == 1 { - // An very short RPC could have come in (and also finished) after we - // checked for calls count and activity in handleIdleTimeout(), but - // before the CAS operation. So, we need to check for activity again. - return false - } - - // No new RPCs have come in since we last set the active calls count value - // -math.MaxInt32 in the timer callback. And since we have the lock, it is - // safe to enter idle mode now. - if err := m.enforcer.EnterIdleMode(); err != nil { - m.logger.Errorf("Failed to enter idle mode: %v", err) - return false - } - - // Successfully entered idle mode. - m.actuallyIdle = true - return true -} - -// OnCallBegin is invoked at the start of every RPC. -func (m *manager) OnCallBegin() error { - if m.isClosed() { - return nil - } - - if atomic.AddInt32(&m.activeCallsCount, 1) > 0 { - // Channel is not idle now. Set the activity bit and allow the call. - atomic.StoreInt32(&m.activeSinceLastTimerCheck, 1) - return nil - } - - // Channel is either in idle mode or is in the process of moving to idle - // mode. Attempt to exit idle mode to allow this RPC. - if err := m.exitIdleMode(); err != nil { - // Undo the increment to calls count, and return an error causing the - // RPC to fail. - atomic.AddInt32(&m.activeCallsCount, -1) - return err - } - - atomic.StoreInt32(&m.activeSinceLastTimerCheck, 1) - return nil -} - -// exitIdleMode instructs the channel to exit idle mode. -// -// Holds idleMu which ensures mutual exclusion with tryEnterIdleMode. -func (m *manager) exitIdleMode() error { - m.idleMu.Lock() - defer m.idleMu.Unlock() - - if !m.actuallyIdle { - // This can happen in two scenarios: - // - handleIdleTimeout() set the calls count to -math.MaxInt32 and called - // tryEnterIdleMode(). But before the latter could grab the lock, an RPC - // came in and OnCallBegin() noticed that the calls count is negative. - // - Channel is in idle mode, and multiple new RPCs come in at the same - // time, all of them notice a negative calls count in OnCallBegin and get - // here. The first one to get the lock would got the channel to exit idle. - // - // Either way, nothing to do here. - return nil - } - - if err := m.enforcer.ExitIdleMode(); err != nil { - return fmt.Errorf("channel failed to exit idle mode: %v", err) - } - - // Undo the idle entry process. This also respects any new RPC attempts. - atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) - m.actuallyIdle = false - - // Start a new timer to fire after the configured idle timeout. - m.timer = timeAfterFunc(time.Duration(m.timeout), m.handleIdleTimeout) - return nil -} - -// OnCallEnd is invoked at the end of every RPC. -func (m *manager) OnCallEnd() { - if m.isClosed() { - return - } - - // Record the time at which the most recent call finished. - atomic.StoreInt64(&m.lastCallEndTime, time.Now().UnixNano()) - - // Decrement the active calls count. This count can temporarily go negative - // when the timer callback is in the process of moving the channel to idle - // mode, but one or more RPCs come in and complete before the timer callback - // can get done with the process of moving to idle mode. - atomic.AddInt32(&m.activeCallsCount, -1) -} - -func (m *manager) isClosed() bool { - return atomic.LoadInt32(&m.closed) == 1 -} - -func (m *manager) Close() { - atomic.StoreInt32(&m.closed, 1) - - m.idleMu.Lock() - m.timer.Stop() - m.timer = nil - m.idleMu.Unlock() -} diff --git a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/serviceconfig/duration.go b/cluster-autoscaler/vendor/google.golang.org/grpc/internal/serviceconfig/duration.go deleted file mode 100644 index 11d82afcc7ec..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/serviceconfig/duration.go +++ /dev/null @@ -1,130 +0,0 @@ -/* - * - * Copyright 2023 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 serviceconfig - -import ( - "encoding/json" - "fmt" - "math" - "strconv" - "strings" - "time" -) - -// Duration defines JSON marshal and unmarshal methods to conform to the -// protobuf JSON spec defined [here]. -// -// [here]: https://protobuf.dev/reference/protobuf/google.protobuf/#duration -type Duration time.Duration - -func (d Duration) String() string { - return fmt.Sprint(time.Duration(d)) -} - -// MarshalJSON converts from d to a JSON string output. -func (d Duration) MarshalJSON() ([]byte, error) { - ns := time.Duration(d).Nanoseconds() - sec := ns / int64(time.Second) - ns = ns % int64(time.Second) - - var sign string - if sec < 0 || ns < 0 { - sign, sec, ns = "-", -1*sec, -1*ns - } - - // Generated output always contains 0, 3, 6, or 9 fractional digits, - // depending on required precision. - str := fmt.Sprintf("%s%d.%09d", sign, sec, ns) - str = strings.TrimSuffix(str, "000") - str = strings.TrimSuffix(str, "000") - str = strings.TrimSuffix(str, ".000") - return []byte(fmt.Sprintf("\"%ss\"", str)), nil -} - -// UnmarshalJSON unmarshals b as a duration JSON string into d. -func (d *Duration) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - if !strings.HasSuffix(s, "s") { - return fmt.Errorf("malformed duration %q: missing seconds unit", s) - } - neg := false - if s[0] == '-' { - neg = true - s = s[1:] - } - ss := strings.SplitN(s[:len(s)-1], ".", 3) - if len(ss) > 2 { - return fmt.Errorf("malformed duration %q: too many decimals", s) - } - // hasDigits is set if either the whole or fractional part of the number is - // present, since both are optional but one is required. - hasDigits := false - var sec, ns int64 - if len(ss[0]) > 0 { - var err error - if sec, err = strconv.ParseInt(ss[0], 10, 64); err != nil { - return fmt.Errorf("malformed duration %q: %v", s, err) - } - // Maximum seconds value per the durationpb spec. - const maxProtoSeconds = 315_576_000_000 - if sec > maxProtoSeconds { - return fmt.Errorf("out of range: %q", s) - } - hasDigits = true - } - if len(ss) == 2 && len(ss[1]) > 0 { - if len(ss[1]) > 9 { - return fmt.Errorf("malformed duration %q: too many digits after decimal", s) - } - var err error - if ns, err = strconv.ParseInt(ss[1], 10, 64); err != nil { - return fmt.Errorf("malformed duration %q: %v", s, err) - } - for i := 9; i > len(ss[1]); i-- { - ns *= 10 - } - hasDigits = true - } - if !hasDigits { - return fmt.Errorf("malformed duration %q: contains no numbers", s) - } - - if neg { - sec *= -1 - ns *= -1 - } - - // Maximum/minimum seconds/nanoseconds representable by Go's time.Duration. - const maxSeconds = math.MaxInt64 / int64(time.Second) - const maxNanosAtMaxSeconds = math.MaxInt64 % int64(time.Second) - const minSeconds = math.MinInt64 / int64(time.Second) - const minNanosAtMinSeconds = math.MinInt64 % int64(time.Second) - - if sec > maxSeconds || (sec == maxSeconds && ns >= maxNanosAtMaxSeconds) { - *d = Duration(math.MaxInt64) - } else if sec < minSeconds || (sec == minSeconds && ns <= minNanosAtMinSeconds) { - *d = Duration(math.MinInt64) - } else { - *d = Duration(sec*int64(time.Second) + ns) - } - return nil -} diff --git a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/transport/logging.go b/cluster-autoscaler/vendor/google.golang.org/grpc/internal/transport/logging.go deleted file mode 100644 index 42ed2b07af66..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/grpc/internal/transport/logging.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright 2023 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 transport - -import ( - "fmt" - - "google.golang.org/grpc/grpclog" - internalgrpclog "google.golang.org/grpc/internal/grpclog" -) - -var logger = grpclog.Component("transport") - -func prefixLoggerForServerTransport(p *http2Server) *internalgrpclog.PrefixLogger { - return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[server-transport %p] ", p)) -} - -func prefixLoggerForServerHandlerTransport(p *serverHandlerTransport) *internalgrpclog.PrefixLogger { - return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[server-handler-transport %p] ", p)) -} - -func prefixLoggerForClientTransport(p *http2Client) *internalgrpclog.PrefixLogger { - return internalgrpclog.NewPrefixLogger(logger, fmt.Sprintf("[client-transport %p] ", p)) -} diff --git a/cluster-autoscaler/vendor/google.golang.org/grpc/shared_buffer_pool.go b/cluster-autoscaler/vendor/google.golang.org/grpc/shared_buffer_pool.go deleted file mode 100644 index 48a64cfe8e25..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/grpc/shared_buffer_pool.go +++ /dev/null @@ -1,154 +0,0 @@ -/* - * - * Copyright 2023 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 grpc - -import "sync" - -// SharedBufferPool is a pool of buffers that can be shared, resulting in -// decreased memory allocation. Currently, in gRPC-go, it is only utilized -// for parsing incoming messages. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -type SharedBufferPool interface { - // Get returns a buffer with specified length from the pool. - // - // The returned byte slice may be not zero initialized. - Get(length int) []byte - - // Put returns a buffer to the pool. - Put(*[]byte) -} - -// NewSharedBufferPool creates a simple SharedBufferPool with buckets -// of different sizes to optimize memory usage. This prevents the pool from -// wasting large amounts of memory, even when handling messages of varying sizes. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -func NewSharedBufferPool() SharedBufferPool { - return &simpleSharedBufferPool{ - pools: [poolArraySize]simpleSharedBufferChildPool{ - newBytesPool(level0PoolMaxSize), - newBytesPool(level1PoolMaxSize), - newBytesPool(level2PoolMaxSize), - newBytesPool(level3PoolMaxSize), - newBytesPool(level4PoolMaxSize), - newBytesPool(0), - }, - } -} - -// simpleSharedBufferPool is a simple implementation of SharedBufferPool. -type simpleSharedBufferPool struct { - pools [poolArraySize]simpleSharedBufferChildPool -} - -func (p *simpleSharedBufferPool) Get(size int) []byte { - return p.pools[p.poolIdx(size)].Get(size) -} - -func (p *simpleSharedBufferPool) Put(bs *[]byte) { - p.pools[p.poolIdx(cap(*bs))].Put(bs) -} - -func (p *simpleSharedBufferPool) poolIdx(size int) int { - switch { - case size <= level0PoolMaxSize: - return level0PoolIdx - case size <= level1PoolMaxSize: - return level1PoolIdx - case size <= level2PoolMaxSize: - return level2PoolIdx - case size <= level3PoolMaxSize: - return level3PoolIdx - case size <= level4PoolMaxSize: - return level4PoolIdx - default: - return levelMaxPoolIdx - } -} - -const ( - level0PoolMaxSize = 16 // 16 B - level1PoolMaxSize = level0PoolMaxSize * 16 // 256 B - level2PoolMaxSize = level1PoolMaxSize * 16 // 4 KB - level3PoolMaxSize = level2PoolMaxSize * 16 // 64 KB - level4PoolMaxSize = level3PoolMaxSize * 16 // 1 MB -) - -const ( - level0PoolIdx = iota - level1PoolIdx - level2PoolIdx - level3PoolIdx - level4PoolIdx - levelMaxPoolIdx - poolArraySize -) - -type simpleSharedBufferChildPool interface { - Get(size int) []byte - Put(any) -} - -type bufferPool struct { - sync.Pool - - defaultSize int -} - -func (p *bufferPool) Get(size int) []byte { - bs := p.Pool.Get().(*[]byte) - - if cap(*bs) < size { - p.Pool.Put(bs) - - return make([]byte, size) - } - - return (*bs)[:size] -} - -func newBytesPool(size int) simpleSharedBufferChildPool { - return &bufferPool{ - Pool: sync.Pool{ - New: func() any { - bs := make([]byte, size) - return &bs - }, - }, - defaultSize: size, - } -} - -// nopBufferPool is a buffer pool just makes new buffer without pooling. -type nopBufferPool struct { -} - -func (nopBufferPool) Get(length int) []byte { - return make([]byte, length) -} - -func (nopBufferPool) Put(*[]byte) { -} diff --git a/cluster-autoscaler/vendor/google.golang.org/protobuf/types/dynamicpb/types.go b/cluster-autoscaler/vendor/google.golang.org/protobuf/types/dynamicpb/types.go deleted file mode 100644 index 5a8010f18faf..000000000000 --- a/cluster-autoscaler/vendor/google.golang.org/protobuf/types/dynamicpb/types.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package dynamicpb - -import ( - "fmt" - "strings" - "sync" - "sync/atomic" - - "google.golang.org/protobuf/internal/errors" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -type extField struct { - name protoreflect.FullName - number protoreflect.FieldNumber -} - -// A Types is a collection of dynamically constructed descriptors. -// Its methods are safe for concurrent use. -// -// Types implements protoregistry.MessageTypeResolver and protoregistry.ExtensionTypeResolver. -// A Types may be used as a proto.UnmarshalOptions.Resolver. -type Types struct { - files *protoregistry.Files - - extMu sync.Mutex - atomicExtFiles uint64 - extensionsByMessage map[extField]protoreflect.ExtensionDescriptor -} - -// NewTypes creates a new Types registry with the provided files. -// The Files registry is retained, and changes to Files will be reflected in Types. -// It is not safe to concurrently change the Files while calling Types methods. -func NewTypes(f *protoregistry.Files) *Types { - return &Types{ - files: f, - } -} - -// FindEnumByName looks up an enum by its full name; -// e.g., "google.protobuf.Field.Kind". -// -// This returns (nil, protoregistry.NotFound) if not found. -func (t *Types) FindEnumByName(name protoreflect.FullName) (protoreflect.EnumType, error) { - d, err := t.files.FindDescriptorByName(name) - if err != nil { - return nil, err - } - ed, ok := d.(protoreflect.EnumDescriptor) - if !ok { - return nil, errors.New("found wrong type: got %v, want enum", descName(d)) - } - return NewEnumType(ed), nil -} - -// FindExtensionByName looks up an extension field by the field's full name. -// Note that this is the full name of the field as determined by -// where the extension is declared and is unrelated to the full name of the -// message being extended. -// -// This returns (nil, protoregistry.NotFound) if not found. -func (t *Types) FindExtensionByName(name protoreflect.FullName) (protoreflect.ExtensionType, error) { - d, err := t.files.FindDescriptorByName(name) - if err != nil { - return nil, err - } - xd, ok := d.(protoreflect.ExtensionDescriptor) - if !ok { - return nil, errors.New("found wrong type: got %v, want extension", descName(d)) - } - return NewExtensionType(xd), nil -} - -// FindExtensionByNumber looks up an extension field by the field number -// within some parent message, identified by full name. -// -// This returns (nil, protoregistry.NotFound) if not found. -func (t *Types) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - // Construct the extension number map lazily, since not every user will need it. - // Update the map if new files are added to the registry. - if atomic.LoadUint64(&t.atomicExtFiles) != uint64(t.files.NumFiles()) { - t.updateExtensions() - } - xd := t.extensionsByMessage[extField{message, field}] - if xd == nil { - return nil, protoregistry.NotFound - } - return NewExtensionType(xd), nil -} - -// FindMessageByName looks up a message by its full name; -// e.g. "google.protobuf.Any". -// -// This returns (nil, protoregistry.NotFound) if not found. -func (t *Types) FindMessageByName(name protoreflect.FullName) (protoreflect.MessageType, error) { - d, err := t.files.FindDescriptorByName(name) - if err != nil { - return nil, err - } - md, ok := d.(protoreflect.MessageDescriptor) - if !ok { - return nil, errors.New("found wrong type: got %v, want message", descName(d)) - } - return NewMessageType(md), nil -} - -// FindMessageByURL looks up a message by a URL identifier. -// See documentation on google.protobuf.Any.type_url for the URL format. -// -// This returns (nil, protoregistry.NotFound) if not found. -func (t *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { - // This function is similar to FindMessageByName but - // truncates anything before and including '/' in the URL. - message := protoreflect.FullName(url) - if i := strings.LastIndexByte(url, '/'); i >= 0 { - message = message[i+len("/"):] - } - return t.FindMessageByName(message) -} - -func (t *Types) updateExtensions() { - t.extMu.Lock() - defer t.extMu.Unlock() - if atomic.LoadUint64(&t.atomicExtFiles) == uint64(t.files.NumFiles()) { - return - } - defer atomic.StoreUint64(&t.atomicExtFiles, uint64(t.files.NumFiles())) - t.files.RangeFiles(func(fd protoreflect.FileDescriptor) bool { - t.registerExtensions(fd.Extensions()) - t.registerExtensionsInMessages(fd.Messages()) - return true - }) -} - -func (t *Types) registerExtensionsInMessages(mds protoreflect.MessageDescriptors) { - count := mds.Len() - for i := 0; i < count; i++ { - md := mds.Get(i) - t.registerExtensions(md.Extensions()) - t.registerExtensionsInMessages(md.Messages()) - } -} - -func (t *Types) registerExtensions(xds protoreflect.ExtensionDescriptors) { - count := xds.Len() - for i := 0; i < count; i++ { - xd := xds.Get(i) - field := xd.Number() - message := xd.ContainingMessage().FullName() - if t.extensionsByMessage == nil { - t.extensionsByMessage = make(map[extField]protoreflect.ExtensionDescriptor) - } - t.extensionsByMessage[extField{message, field}] = xd - } -} - -func descName(d protoreflect.Descriptor) string { - switch d.(type) { - case protoreflect.EnumDescriptor: - return "enum" - case protoreflect.EnumValueDescriptor: - return "enum value" - case protoreflect.MessageDescriptor: - return "message" - case protoreflect.ExtensionDescriptor: - return "extension" - case protoreflect.ServiceDescriptor: - return "service" - default: - return fmt.Sprintf("%T", d) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/doc.go b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/doc.go deleted file mode 100644 index 1bc51d406658..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -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. -*/ - -// +k8s:deepcopy-gen=package -// +k8s:protobuf-gen=package -// +k8s:openapi-gen=true - -// +groupName=flowcontrol.apiserver.k8s.io - -// Package v1 holds api types of version v1 for group "flowcontrol.apiserver.k8s.io". -package v1 // import "k8s.io/api/flowcontrol/v1" diff --git a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/generated.pb.go b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/generated.pb.go deleted file mode 100644 index c235ba10dee8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/generated.pb.go +++ /dev/null @@ -1,5667 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: k8s.io/kubernetes/vendor/k8s.io/api/flowcontrol/v1/generated.proto - -package v1 - -import ( - fmt "fmt" - - io "io" - - proto "github.com/gogo/protobuf/proto" - - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -func (m *ExemptPriorityLevelConfiguration) Reset() { *m = ExemptPriorityLevelConfiguration{} } -func (*ExemptPriorityLevelConfiguration) ProtoMessage() {} -func (*ExemptPriorityLevelConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{0} -} -func (m *ExemptPriorityLevelConfiguration) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ExemptPriorityLevelConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ExemptPriorityLevelConfiguration) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExemptPriorityLevelConfiguration.Merge(m, src) -} -func (m *ExemptPriorityLevelConfiguration) XXX_Size() int { - return m.Size() -} -func (m *ExemptPriorityLevelConfiguration) XXX_DiscardUnknown() { - xxx_messageInfo_ExemptPriorityLevelConfiguration.DiscardUnknown(m) -} - -var xxx_messageInfo_ExemptPriorityLevelConfiguration proto.InternalMessageInfo - -func (m *FlowDistinguisherMethod) Reset() { *m = FlowDistinguisherMethod{} } -func (*FlowDistinguisherMethod) ProtoMessage() {} -func (*FlowDistinguisherMethod) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{1} -} -func (m *FlowDistinguisherMethod) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlowDistinguisherMethod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *FlowDistinguisherMethod) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlowDistinguisherMethod.Merge(m, src) -} -func (m *FlowDistinguisherMethod) XXX_Size() int { - return m.Size() -} -func (m *FlowDistinguisherMethod) XXX_DiscardUnknown() { - xxx_messageInfo_FlowDistinguisherMethod.DiscardUnknown(m) -} - -var xxx_messageInfo_FlowDistinguisherMethod proto.InternalMessageInfo - -func (m *FlowSchema) Reset() { *m = FlowSchema{} } -func (*FlowSchema) ProtoMessage() {} -func (*FlowSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{2} -} -func (m *FlowSchema) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlowSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *FlowSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlowSchema.Merge(m, src) -} -func (m *FlowSchema) XXX_Size() int { - return m.Size() -} -func (m *FlowSchema) XXX_DiscardUnknown() { - xxx_messageInfo_FlowSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_FlowSchema proto.InternalMessageInfo - -func (m *FlowSchemaCondition) Reset() { *m = FlowSchemaCondition{} } -func (*FlowSchemaCondition) ProtoMessage() {} -func (*FlowSchemaCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{3} -} -func (m *FlowSchemaCondition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlowSchemaCondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *FlowSchemaCondition) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlowSchemaCondition.Merge(m, src) -} -func (m *FlowSchemaCondition) XXX_Size() int { - return m.Size() -} -func (m *FlowSchemaCondition) XXX_DiscardUnknown() { - xxx_messageInfo_FlowSchemaCondition.DiscardUnknown(m) -} - -var xxx_messageInfo_FlowSchemaCondition proto.InternalMessageInfo - -func (m *FlowSchemaList) Reset() { *m = FlowSchemaList{} } -func (*FlowSchemaList) ProtoMessage() {} -func (*FlowSchemaList) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{4} -} -func (m *FlowSchemaList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlowSchemaList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *FlowSchemaList) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlowSchemaList.Merge(m, src) -} -func (m *FlowSchemaList) XXX_Size() int { - return m.Size() -} -func (m *FlowSchemaList) XXX_DiscardUnknown() { - xxx_messageInfo_FlowSchemaList.DiscardUnknown(m) -} - -var xxx_messageInfo_FlowSchemaList proto.InternalMessageInfo - -func (m *FlowSchemaSpec) Reset() { *m = FlowSchemaSpec{} } -func (*FlowSchemaSpec) ProtoMessage() {} -func (*FlowSchemaSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{5} -} -func (m *FlowSchemaSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlowSchemaSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *FlowSchemaSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlowSchemaSpec.Merge(m, src) -} -func (m *FlowSchemaSpec) XXX_Size() int { - return m.Size() -} -func (m *FlowSchemaSpec) XXX_DiscardUnknown() { - xxx_messageInfo_FlowSchemaSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_FlowSchemaSpec proto.InternalMessageInfo - -func (m *FlowSchemaStatus) Reset() { *m = FlowSchemaStatus{} } -func (*FlowSchemaStatus) ProtoMessage() {} -func (*FlowSchemaStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{6} -} -func (m *FlowSchemaStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlowSchemaStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *FlowSchemaStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlowSchemaStatus.Merge(m, src) -} -func (m *FlowSchemaStatus) XXX_Size() int { - return m.Size() -} -func (m *FlowSchemaStatus) XXX_DiscardUnknown() { - xxx_messageInfo_FlowSchemaStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_FlowSchemaStatus proto.InternalMessageInfo - -func (m *GroupSubject) Reset() { *m = GroupSubject{} } -func (*GroupSubject) ProtoMessage() {} -func (*GroupSubject) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{7} -} -func (m *GroupSubject) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GroupSubject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *GroupSubject) XXX_Merge(src proto.Message) { - xxx_messageInfo_GroupSubject.Merge(m, src) -} -func (m *GroupSubject) XXX_Size() int { - return m.Size() -} -func (m *GroupSubject) XXX_DiscardUnknown() { - xxx_messageInfo_GroupSubject.DiscardUnknown(m) -} - -var xxx_messageInfo_GroupSubject proto.InternalMessageInfo - -func (m *LimitResponse) Reset() { *m = LimitResponse{} } -func (*LimitResponse) ProtoMessage() {} -func (*LimitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{8} -} -func (m *LimitResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LimitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *LimitResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_LimitResponse.Merge(m, src) -} -func (m *LimitResponse) XXX_Size() int { - return m.Size() -} -func (m *LimitResponse) XXX_DiscardUnknown() { - xxx_messageInfo_LimitResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_LimitResponse proto.InternalMessageInfo - -func (m *LimitedPriorityLevelConfiguration) Reset() { *m = LimitedPriorityLevelConfiguration{} } -func (*LimitedPriorityLevelConfiguration) ProtoMessage() {} -func (*LimitedPriorityLevelConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{9} -} -func (m *LimitedPriorityLevelConfiguration) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LimitedPriorityLevelConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *LimitedPriorityLevelConfiguration) XXX_Merge(src proto.Message) { - xxx_messageInfo_LimitedPriorityLevelConfiguration.Merge(m, src) -} -func (m *LimitedPriorityLevelConfiguration) XXX_Size() int { - return m.Size() -} -func (m *LimitedPriorityLevelConfiguration) XXX_DiscardUnknown() { - xxx_messageInfo_LimitedPriorityLevelConfiguration.DiscardUnknown(m) -} - -var xxx_messageInfo_LimitedPriorityLevelConfiguration proto.InternalMessageInfo - -func (m *NonResourcePolicyRule) Reset() { *m = NonResourcePolicyRule{} } -func (*NonResourcePolicyRule) ProtoMessage() {} -func (*NonResourcePolicyRule) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{10} -} -func (m *NonResourcePolicyRule) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NonResourcePolicyRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *NonResourcePolicyRule) XXX_Merge(src proto.Message) { - xxx_messageInfo_NonResourcePolicyRule.Merge(m, src) -} -func (m *NonResourcePolicyRule) XXX_Size() int { - return m.Size() -} -func (m *NonResourcePolicyRule) XXX_DiscardUnknown() { - xxx_messageInfo_NonResourcePolicyRule.DiscardUnknown(m) -} - -var xxx_messageInfo_NonResourcePolicyRule proto.InternalMessageInfo - -func (m *PolicyRulesWithSubjects) Reset() { *m = PolicyRulesWithSubjects{} } -func (*PolicyRulesWithSubjects) ProtoMessage() {} -func (*PolicyRulesWithSubjects) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{11} -} -func (m *PolicyRulesWithSubjects) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PolicyRulesWithSubjects) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PolicyRulesWithSubjects) XXX_Merge(src proto.Message) { - xxx_messageInfo_PolicyRulesWithSubjects.Merge(m, src) -} -func (m *PolicyRulesWithSubjects) XXX_Size() int { - return m.Size() -} -func (m *PolicyRulesWithSubjects) XXX_DiscardUnknown() { - xxx_messageInfo_PolicyRulesWithSubjects.DiscardUnknown(m) -} - -var xxx_messageInfo_PolicyRulesWithSubjects proto.InternalMessageInfo - -func (m *PriorityLevelConfiguration) Reset() { *m = PriorityLevelConfiguration{} } -func (*PriorityLevelConfiguration) ProtoMessage() {} -func (*PriorityLevelConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{12} -} -func (m *PriorityLevelConfiguration) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PriorityLevelConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PriorityLevelConfiguration) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriorityLevelConfiguration.Merge(m, src) -} -func (m *PriorityLevelConfiguration) XXX_Size() int { - return m.Size() -} -func (m *PriorityLevelConfiguration) XXX_DiscardUnknown() { - xxx_messageInfo_PriorityLevelConfiguration.DiscardUnknown(m) -} - -var xxx_messageInfo_PriorityLevelConfiguration proto.InternalMessageInfo - -func (m *PriorityLevelConfigurationCondition) Reset() { *m = PriorityLevelConfigurationCondition{} } -func (*PriorityLevelConfigurationCondition) ProtoMessage() {} -func (*PriorityLevelConfigurationCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{13} -} -func (m *PriorityLevelConfigurationCondition) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PriorityLevelConfigurationCondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PriorityLevelConfigurationCondition) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriorityLevelConfigurationCondition.Merge(m, src) -} -func (m *PriorityLevelConfigurationCondition) XXX_Size() int { - return m.Size() -} -func (m *PriorityLevelConfigurationCondition) XXX_DiscardUnknown() { - xxx_messageInfo_PriorityLevelConfigurationCondition.DiscardUnknown(m) -} - -var xxx_messageInfo_PriorityLevelConfigurationCondition proto.InternalMessageInfo - -func (m *PriorityLevelConfigurationList) Reset() { *m = PriorityLevelConfigurationList{} } -func (*PriorityLevelConfigurationList) ProtoMessage() {} -func (*PriorityLevelConfigurationList) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{14} -} -func (m *PriorityLevelConfigurationList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PriorityLevelConfigurationList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PriorityLevelConfigurationList) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriorityLevelConfigurationList.Merge(m, src) -} -func (m *PriorityLevelConfigurationList) XXX_Size() int { - return m.Size() -} -func (m *PriorityLevelConfigurationList) XXX_DiscardUnknown() { - xxx_messageInfo_PriorityLevelConfigurationList.DiscardUnknown(m) -} - -var xxx_messageInfo_PriorityLevelConfigurationList proto.InternalMessageInfo - -func (m *PriorityLevelConfigurationReference) Reset() { *m = PriorityLevelConfigurationReference{} } -func (*PriorityLevelConfigurationReference) ProtoMessage() {} -func (*PriorityLevelConfigurationReference) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{15} -} -func (m *PriorityLevelConfigurationReference) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PriorityLevelConfigurationReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PriorityLevelConfigurationReference) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriorityLevelConfigurationReference.Merge(m, src) -} -func (m *PriorityLevelConfigurationReference) XXX_Size() int { - return m.Size() -} -func (m *PriorityLevelConfigurationReference) XXX_DiscardUnknown() { - xxx_messageInfo_PriorityLevelConfigurationReference.DiscardUnknown(m) -} - -var xxx_messageInfo_PriorityLevelConfigurationReference proto.InternalMessageInfo - -func (m *PriorityLevelConfigurationSpec) Reset() { *m = PriorityLevelConfigurationSpec{} } -func (*PriorityLevelConfigurationSpec) ProtoMessage() {} -func (*PriorityLevelConfigurationSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{16} -} -func (m *PriorityLevelConfigurationSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PriorityLevelConfigurationSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PriorityLevelConfigurationSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriorityLevelConfigurationSpec.Merge(m, src) -} -func (m *PriorityLevelConfigurationSpec) XXX_Size() int { - return m.Size() -} -func (m *PriorityLevelConfigurationSpec) XXX_DiscardUnknown() { - xxx_messageInfo_PriorityLevelConfigurationSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_PriorityLevelConfigurationSpec proto.InternalMessageInfo - -func (m *PriorityLevelConfigurationStatus) Reset() { *m = PriorityLevelConfigurationStatus{} } -func (*PriorityLevelConfigurationStatus) ProtoMessage() {} -func (*PriorityLevelConfigurationStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{17} -} -func (m *PriorityLevelConfigurationStatus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PriorityLevelConfigurationStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *PriorityLevelConfigurationStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_PriorityLevelConfigurationStatus.Merge(m, src) -} -func (m *PriorityLevelConfigurationStatus) XXX_Size() int { - return m.Size() -} -func (m *PriorityLevelConfigurationStatus) XXX_DiscardUnknown() { - xxx_messageInfo_PriorityLevelConfigurationStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_PriorityLevelConfigurationStatus proto.InternalMessageInfo - -func (m *QueuingConfiguration) Reset() { *m = QueuingConfiguration{} } -func (*QueuingConfiguration) ProtoMessage() {} -func (*QueuingConfiguration) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{18} -} -func (m *QueuingConfiguration) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueuingConfiguration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *QueuingConfiguration) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueuingConfiguration.Merge(m, src) -} -func (m *QueuingConfiguration) XXX_Size() int { - return m.Size() -} -func (m *QueuingConfiguration) XXX_DiscardUnknown() { - xxx_messageInfo_QueuingConfiguration.DiscardUnknown(m) -} - -var xxx_messageInfo_QueuingConfiguration proto.InternalMessageInfo - -func (m *ResourcePolicyRule) Reset() { *m = ResourcePolicyRule{} } -func (*ResourcePolicyRule) ProtoMessage() {} -func (*ResourcePolicyRule) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{19} -} -func (m *ResourcePolicyRule) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ResourcePolicyRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ResourcePolicyRule) XXX_Merge(src proto.Message) { - xxx_messageInfo_ResourcePolicyRule.Merge(m, src) -} -func (m *ResourcePolicyRule) XXX_Size() int { - return m.Size() -} -func (m *ResourcePolicyRule) XXX_DiscardUnknown() { - xxx_messageInfo_ResourcePolicyRule.DiscardUnknown(m) -} - -var xxx_messageInfo_ResourcePolicyRule proto.InternalMessageInfo - -func (m *ServiceAccountSubject) Reset() { *m = ServiceAccountSubject{} } -func (*ServiceAccountSubject) ProtoMessage() {} -func (*ServiceAccountSubject) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{20} -} -func (m *ServiceAccountSubject) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceAccountSubject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *ServiceAccountSubject) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceAccountSubject.Merge(m, src) -} -func (m *ServiceAccountSubject) XXX_Size() int { - return m.Size() -} -func (m *ServiceAccountSubject) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceAccountSubject.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceAccountSubject proto.InternalMessageInfo - -func (m *Subject) Reset() { *m = Subject{} } -func (*Subject) ProtoMessage() {} -func (*Subject) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{21} -} -func (m *Subject) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Subject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *Subject) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subject.Merge(m, src) -} -func (m *Subject) XXX_Size() int { - return m.Size() -} -func (m *Subject) XXX_DiscardUnknown() { - xxx_messageInfo_Subject.DiscardUnknown(m) -} - -var xxx_messageInfo_Subject proto.InternalMessageInfo - -func (m *UserSubject) Reset() { *m = UserSubject{} } -func (*UserSubject) ProtoMessage() {} -func (*UserSubject) Descriptor() ([]byte, []int) { - return fileDescriptor_f8a25df358697d27, []int{22} -} -func (m *UserSubject) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UserSubject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *UserSubject) XXX_Merge(src proto.Message) { - xxx_messageInfo_UserSubject.Merge(m, src) -} -func (m *UserSubject) XXX_Size() int { - return m.Size() -} -func (m *UserSubject) XXX_DiscardUnknown() { - xxx_messageInfo_UserSubject.DiscardUnknown(m) -} - -var xxx_messageInfo_UserSubject proto.InternalMessageInfo - -func init() { - proto.RegisterType((*ExemptPriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1.ExemptPriorityLevelConfiguration") - proto.RegisterType((*FlowDistinguisherMethod)(nil), "k8s.io.api.flowcontrol.v1.FlowDistinguisherMethod") - proto.RegisterType((*FlowSchema)(nil), "k8s.io.api.flowcontrol.v1.FlowSchema") - proto.RegisterType((*FlowSchemaCondition)(nil), "k8s.io.api.flowcontrol.v1.FlowSchemaCondition") - proto.RegisterType((*FlowSchemaList)(nil), "k8s.io.api.flowcontrol.v1.FlowSchemaList") - proto.RegisterType((*FlowSchemaSpec)(nil), "k8s.io.api.flowcontrol.v1.FlowSchemaSpec") - proto.RegisterType((*FlowSchemaStatus)(nil), "k8s.io.api.flowcontrol.v1.FlowSchemaStatus") - proto.RegisterType((*GroupSubject)(nil), "k8s.io.api.flowcontrol.v1.GroupSubject") - proto.RegisterType((*LimitResponse)(nil), "k8s.io.api.flowcontrol.v1.LimitResponse") - proto.RegisterType((*LimitedPriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1.LimitedPriorityLevelConfiguration") - proto.RegisterType((*NonResourcePolicyRule)(nil), "k8s.io.api.flowcontrol.v1.NonResourcePolicyRule") - proto.RegisterType((*PolicyRulesWithSubjects)(nil), "k8s.io.api.flowcontrol.v1.PolicyRulesWithSubjects") - proto.RegisterType((*PriorityLevelConfiguration)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfiguration") - proto.RegisterType((*PriorityLevelConfigurationCondition)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationCondition") - proto.RegisterType((*PriorityLevelConfigurationList)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationList") - proto.RegisterType((*PriorityLevelConfigurationReference)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationReference") - proto.RegisterType((*PriorityLevelConfigurationSpec)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationSpec") - proto.RegisterType((*PriorityLevelConfigurationStatus)(nil), "k8s.io.api.flowcontrol.v1.PriorityLevelConfigurationStatus") - proto.RegisterType((*QueuingConfiguration)(nil), "k8s.io.api.flowcontrol.v1.QueuingConfiguration") - proto.RegisterType((*ResourcePolicyRule)(nil), "k8s.io.api.flowcontrol.v1.ResourcePolicyRule") - proto.RegisterType((*ServiceAccountSubject)(nil), "k8s.io.api.flowcontrol.v1.ServiceAccountSubject") - proto.RegisterType((*Subject)(nil), "k8s.io.api.flowcontrol.v1.Subject") - proto.RegisterType((*UserSubject)(nil), "k8s.io.api.flowcontrol.v1.UserSubject") -} - -func init() { - proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/flowcontrol/v1/generated.proto", fileDescriptor_f8a25df358697d27) -} - -var fileDescriptor_f8a25df358697d27 = []byte{ - // 1588 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4b, 0x73, 0x1b, 0xc5, - 0x16, 0xb6, 0x64, 0xc9, 0xb6, 0x8e, 0x9f, 0x69, 0xc7, 0x65, 0xc5, 0xb9, 0x25, 0x39, 0x73, 0xeb, - 0xe6, 0x71, 0x43, 0xa4, 0xc4, 0x45, 0x20, 0xa9, 0x00, 0xa9, 0x4c, 0x12, 0xf2, 0xb2, 0x1d, 0xa7, - 0x95, 0x07, 0x15, 0xa8, 0x82, 0xd1, 0xa8, 0x2d, 0x4d, 0x2c, 0xcd, 0x0c, 0xdd, 0x33, 0x32, 0xa6, - 0x8a, 0x2a, 0x7e, 0x42, 0x56, 0x2c, 0x59, 0xc0, 0x3f, 0x60, 0x45, 0xc1, 0x86, 0x65, 0x76, 0x64, - 0x19, 0x58, 0xa8, 0x88, 0xf8, 0x0b, 0x2c, 0x20, 0x2b, 0xaa, 0x7b, 0x7a, 0x66, 0x34, 0x92, 0x66, - 0xac, 0xf2, 0x22, 0x6c, 0xd8, 0x79, 0xce, 0xf9, 0xce, 0x77, 0xba, 0x4f, 0x9f, 0x97, 0x0c, 0xea, - 0xce, 0x05, 0x56, 0x32, 0xac, 0xf2, 0x8e, 0x5b, 0x25, 0xd4, 0x24, 0x0e, 0x61, 0xe5, 0x36, 0x31, - 0x6b, 0x16, 0x2d, 0x4b, 0x85, 0x66, 0x1b, 0xe5, 0xed, 0xa6, 0xb5, 0xab, 0x5b, 0xa6, 0x43, 0xad, - 0x66, 0xb9, 0x7d, 0xae, 0x5c, 0x27, 0x26, 0xa1, 0x9a, 0x43, 0x6a, 0x25, 0x9b, 0x5a, 0x8e, 0x85, - 0x8e, 0x78, 0xd0, 0x92, 0x66, 0x1b, 0xa5, 0x1e, 0x68, 0xa9, 0x7d, 0x6e, 0xe5, 0x4c, 0xdd, 0x70, - 0x1a, 0x6e, 0xb5, 0xa4, 0x5b, 0xad, 0x72, 0xdd, 0xaa, 0x5b, 0x65, 0x61, 0x51, 0x75, 0xb7, 0xc5, - 0x97, 0xf8, 0x10, 0x7f, 0x79, 0x4c, 0x2b, 0x6f, 0x86, 0x4e, 0x5b, 0x9a, 0xde, 0x30, 0x4c, 0x42, - 0xf7, 0xca, 0xf6, 0x4e, 0x9d, 0x0b, 0x58, 0xb9, 0x45, 0x1c, 0x6d, 0x88, 0xff, 0x95, 0x72, 0x9c, - 0x15, 0x75, 0x4d, 0xc7, 0x68, 0x91, 0x01, 0x83, 0xb7, 0xf6, 0x33, 0x60, 0x7a, 0x83, 0xb4, 0xb4, - 0x7e, 0x3b, 0xe5, 0xc7, 0x14, 0xac, 0x5e, 0xff, 0x8c, 0xb4, 0x6c, 0x67, 0x8b, 0x1a, 0x16, 0x35, - 0x9c, 0xbd, 0x75, 0xd2, 0x26, 0xcd, 0xab, 0x96, 0xb9, 0x6d, 0xd4, 0x5d, 0xaa, 0x39, 0x86, 0x65, - 0xa2, 0x0f, 0x20, 0x6f, 0x5a, 0x2d, 0xc3, 0xd4, 0xb8, 0x5c, 0x77, 0x29, 0x25, 0xa6, 0xbe, 0x57, - 0x69, 0x68, 0x94, 0xb0, 0x7c, 0x6a, 0x35, 0x75, 0x32, 0xab, 0xfe, 0xa7, 0xdb, 0x29, 0xe6, 0x37, - 0x63, 0x30, 0x38, 0xd6, 0x1a, 0xbd, 0x0b, 0xf3, 0x4d, 0x62, 0xd6, 0xb4, 0x6a, 0x93, 0x6c, 0x11, - 0xaa, 0x13, 0xd3, 0xc9, 0xa7, 0x05, 0xe1, 0x62, 0xb7, 0x53, 0x9c, 0x5f, 0x8f, 0xaa, 0x70, 0x3f, - 0x56, 0x79, 0x0c, 0xcb, 0xef, 0x37, 0xad, 0xdd, 0x6b, 0x06, 0x73, 0x0c, 0xb3, 0xee, 0x1a, 0xac, - 0x41, 0xe8, 0x06, 0x71, 0x1a, 0x56, 0x0d, 0x5d, 0x86, 0x8c, 0xb3, 0x67, 0x13, 0x71, 0xbe, 0x9c, - 0x7a, 0xfa, 0x59, 0xa7, 0x38, 0xd6, 0xed, 0x14, 0x33, 0xf7, 0xf7, 0x6c, 0xf2, 0xaa, 0x53, 0x3c, - 0x1a, 0x63, 0xc6, 0xd5, 0x58, 0x18, 0x2a, 0x4f, 0xd3, 0x00, 0x1c, 0x55, 0x11, 0x81, 0x43, 0x9f, - 0xc0, 0x14, 0x7f, 0xac, 0x9a, 0xe6, 0x68, 0x82, 0x73, 0x7a, 0xed, 0x6c, 0x29, 0x4c, 0x92, 0x20, - 0xe6, 0x25, 0x7b, 0xa7, 0xce, 0x05, 0xac, 0xc4, 0xd1, 0xa5, 0xf6, 0xb9, 0xd2, 0xdd, 0xea, 0x13, - 0xa2, 0x3b, 0x1b, 0xc4, 0xd1, 0x54, 0x24, 0x4f, 0x01, 0xa1, 0x0c, 0x07, 0xac, 0xe8, 0x0e, 0x64, - 0x98, 0x4d, 0x74, 0x11, 0x80, 0xe9, 0xb5, 0x53, 0xa5, 0xd8, 0x14, 0x2c, 0x85, 0xc7, 0xaa, 0xd8, - 0x44, 0x57, 0x67, 0xfc, 0xcb, 0xf1, 0x2f, 0x2c, 0x48, 0x50, 0x05, 0x26, 0x98, 0xa3, 0x39, 0x2e, - 0xcb, 0x8f, 0x0b, 0xba, 0xd3, 0xa3, 0xd1, 0x09, 0x13, 0x75, 0x4e, 0x12, 0x4e, 0x78, 0xdf, 0x58, - 0x52, 0x29, 0x2f, 0xd2, 0xb0, 0x18, 0x82, 0xaf, 0x5a, 0x66, 0xcd, 0x10, 0xf9, 0x71, 0x29, 0x12, - 0xeb, 0x13, 0x7d, 0xb1, 0x5e, 0x1e, 0x62, 0x12, 0xc6, 0x19, 0x5d, 0x0c, 0x4e, 0x9a, 0x16, 0xe6, - 0xc7, 0xa2, 0xce, 0x5f, 0x75, 0x8a, 0xf3, 0x81, 0x59, 0xf4, 0x3c, 0xa8, 0x0d, 0xa8, 0xa9, 0x31, - 0xe7, 0x3e, 0xd5, 0x4c, 0xe6, 0xd1, 0x1a, 0x2d, 0x22, 0x2f, 0xfc, 0xff, 0xd1, 0x5e, 0x87, 0x5b, - 0xa8, 0x2b, 0xd2, 0x25, 0x5a, 0x1f, 0x60, 0xc3, 0x43, 0x3c, 0xa0, 0xe3, 0x30, 0x41, 0x89, 0xc6, - 0x2c, 0x33, 0x9f, 0x11, 0x47, 0x0e, 0xe2, 0x85, 0x85, 0x14, 0x4b, 0x2d, 0x3a, 0x05, 0x93, 0x2d, - 0xc2, 0x98, 0x56, 0x27, 0xf9, 0xac, 0x00, 0xce, 0x4b, 0xe0, 0xe4, 0x86, 0x27, 0xc6, 0xbe, 0x5e, - 0xf9, 0x21, 0x05, 0x73, 0x61, 0x9c, 0xd6, 0x0d, 0xe6, 0xa0, 0x8f, 0x06, 0x32, 0xae, 0x34, 0xda, - 0x9d, 0xb8, 0xb5, 0xc8, 0xb7, 0x05, 0xe9, 0x6e, 0xca, 0x97, 0xf4, 0x64, 0xdb, 0x6d, 0xc8, 0x1a, - 0x0e, 0x69, 0xf1, 0xa8, 0x8f, 0x9f, 0x9c, 0x5e, 0xfb, 0xdf, 0x48, 0xf9, 0xa1, 0xce, 0x4a, 0xc6, - 0xec, 0x2d, 0x6e, 0x8b, 0x3d, 0x0a, 0xe5, 0x97, 0xf1, 0xde, 0xc3, 0xf3, 0x2c, 0x44, 0xdf, 0xa4, - 0x60, 0xc5, 0x8e, 0xed, 0x28, 0xf2, 0x3e, 0xef, 0x25, 0x38, 0x8d, 0x6f, 0x47, 0x98, 0x6c, 0x13, - 0xde, 0x43, 0x88, 0xaa, 0xc8, 0xd3, 0xac, 0x24, 0x80, 0x13, 0x4e, 0x81, 0x6e, 0x03, 0x6a, 0x69, - 0x0e, 0x8f, 0x63, 0x7d, 0x8b, 0x12, 0x9d, 0xd4, 0x38, 0xab, 0x6c, 0x40, 0x41, 0x4e, 0x6c, 0x0c, - 0x20, 0xf0, 0x10, 0x2b, 0xf4, 0x05, 0x2c, 0xd6, 0x06, 0xfb, 0x89, 0x4c, 0xc6, 0xb5, 0x7d, 0xa2, - 0x3b, 0xa4, 0x13, 0xa9, 0xcb, 0xdd, 0x4e, 0x71, 0x71, 0x88, 0x02, 0x0f, 0xf3, 0x83, 0x1e, 0x41, - 0x96, 0xba, 0x4d, 0xc2, 0xf2, 0x19, 0xf1, 0x9c, 0x49, 0x0e, 0xb7, 0xac, 0xa6, 0xa1, 0xef, 0x61, - 0x8e, 0x7e, 0x64, 0x38, 0x8d, 0x8a, 0x2b, 0x9a, 0x11, 0x0b, 0xdf, 0x56, 0xa8, 0xb0, 0xc7, 0xa7, - 0xb4, 0x61, 0xa1, 0xbf, 0x3f, 0xa0, 0x2a, 0x80, 0xee, 0x97, 0x24, 0x9f, 0x00, 0xe3, 0x7d, 0xb9, - 0x19, 0x9f, 0x40, 0x41, 0x25, 0x87, 0xbd, 0x30, 0x10, 0x31, 0xdc, 0xc3, 0xaa, 0x9c, 0x85, 0x99, - 0x1b, 0xd4, 0x72, 0x6d, 0x79, 0x3c, 0xb4, 0x0a, 0x19, 0x53, 0x6b, 0xf9, 0x3d, 0x26, 0x68, 0x79, - 0x9b, 0x5a, 0x8b, 0x60, 0xa1, 0x51, 0xbe, 0x4e, 0xc1, 0xec, 0xba, 0xd1, 0x32, 0x1c, 0x4c, 0x98, - 0x6d, 0x99, 0x8c, 0xa0, 0xf3, 0x91, 0xbe, 0x74, 0xac, 0xaf, 0x2f, 0x1d, 0x8a, 0x80, 0x7b, 0x3a, - 0xd2, 0x43, 0x98, 0xfc, 0xd4, 0x25, 0xae, 0x61, 0xd6, 0x65, 0x2f, 0x2e, 0x27, 0xdc, 0xed, 0x9e, - 0x87, 0x8c, 0x24, 0x96, 0x3a, 0xcd, 0x6b, 0x5c, 0x6a, 0xb0, 0x4f, 0xa6, 0xfc, 0x91, 0x86, 0x63, - 0xc2, 0x27, 0xa9, 0xfd, 0x23, 0xc3, 0x96, 0xc0, 0x6c, 0xb3, 0xf7, 0xca, 0xf2, 0x76, 0x27, 0x13, - 0x6e, 0x17, 0x09, 0x91, 0xba, 0x24, 0x23, 0x18, 0x0d, 0x33, 0x8e, 0xb2, 0x0e, 0x9b, 0xe9, 0xe3, - 0xa3, 0xcf, 0x74, 0x74, 0x17, 0x96, 0xaa, 0x16, 0xa5, 0xd6, 0xae, 0x61, 0xd6, 0x85, 0x1f, 0x9f, - 0x24, 0x23, 0x48, 0x8e, 0x74, 0x3b, 0xc5, 0x25, 0x75, 0x18, 0x00, 0x0f, 0xb7, 0x53, 0x76, 0x61, - 0x69, 0x93, 0x77, 0x0d, 0x66, 0xb9, 0x54, 0x27, 0x61, 0xf6, 0xa3, 0x22, 0x64, 0xdb, 0x84, 0x56, - 0xbd, 0x0c, 0xce, 0xa9, 0x39, 0x9e, 0xfb, 0x0f, 0xb9, 0x00, 0x7b, 0x72, 0x7e, 0x13, 0x33, 0xb4, - 0x7c, 0x80, 0xd7, 0x59, 0x7e, 0x42, 0x40, 0xc5, 0x4d, 0x36, 0xa3, 0x2a, 0xdc, 0x8f, 0x55, 0x7e, - 0x4e, 0xc3, 0x72, 0x4c, 0xb1, 0xa1, 0x2d, 0x98, 0x62, 0xf2, 0x6f, 0x59, 0x40, 0x4a, 0xc2, 0x33, - 0x48, 0xb3, 0xb0, 0xa1, 0xfb, 0x3c, 0x38, 0x60, 0x41, 0x4f, 0x60, 0x96, 0x4a, 0xef, 0xc2, 0x9d, - 0x6c, 0xec, 0x67, 0x12, 0x68, 0x07, 0x63, 0x12, 0x3e, 0x31, 0xee, 0xe5, 0xc2, 0x51, 0x6a, 0xd4, - 0x86, 0x85, 0x9e, 0xcb, 0x7a, 0xee, 0xc6, 0x85, 0xbb, 0xb3, 0x09, 0xee, 0x86, 0xbe, 0x82, 0x9a, - 0x97, 0x1e, 0x17, 0x36, 0xfb, 0x18, 0xf1, 0x80, 0x0f, 0xe5, 0xa7, 0x34, 0x24, 0xf4, 0xfa, 0xd7, - 0xb0, 0xa3, 0x7d, 0x18, 0xd9, 0xd1, 0x2e, 0x1e, 0x68, 0x7e, 0xc5, 0xee, 0x6c, 0x7a, 0xdf, 0xce, - 0x76, 0xe9, 0x60, 0xf4, 0xc9, 0x3b, 0xdc, 0x9f, 0x69, 0xf8, 0x6f, 0xbc, 0x71, 0xb8, 0xd3, 0xdd, - 0x89, 0xf4, 0xce, 0xb7, 0xfb, 0x7a, 0xe7, 0x89, 0x11, 0x28, 0xfe, 0xdd, 0xf1, 0xfa, 0x76, 0xbc, - 0x5f, 0x53, 0x50, 0x88, 0x8f, 0xdb, 0x6b, 0xd8, 0xf9, 0x1e, 0x47, 0x77, 0xbe, 0xf3, 0x07, 0xca, - 0xaf, 0x98, 0x1d, 0xf0, 0x46, 0x52, 0x5a, 0x05, 0x2b, 0xdb, 0x08, 0x63, 0xfc, 0xdb, 0x74, 0x52, - 0x94, 0xc4, 0x72, 0xb9, 0xcf, 0xef, 0x8d, 0x88, 0xf5, 0x75, 0x93, 0x0f, 0x97, 0x16, 0x9f, 0x0f, - 0x5e, 0x2e, 0xea, 0x30, 0xd9, 0xf4, 0x86, 0xb0, 0xac, 0xe2, 0x77, 0xf6, 0x9b, 0x7f, 0x49, 0xe3, - 0xda, 0x1b, 0xf5, 0x12, 0x86, 0x7d, 0x66, 0xf4, 0x31, 0x4c, 0x10, 0xf1, 0xab, 0x7a, 0x84, 0x52, - 0xde, 0xef, 0xe7, 0xb7, 0x0a, 0x3c, 0xed, 0x3c, 0x14, 0x96, 0xb4, 0xca, 0x57, 0x29, 0x58, 0xdd, - 0xaf, 0x07, 0x20, 0x3a, 0x64, 0x4f, 0x3b, 0xd8, 0xce, 0x3d, 0xfa, 0xde, 0xf6, 0x5d, 0x0a, 0x0e, - 0x0f, 0xdb, 0x89, 0x78, 0x41, 0xf1, 0x45, 0x28, 0xd8, 0x62, 0x82, 0x82, 0xba, 0x27, 0xa4, 0x58, - 0x6a, 0xd1, 0x1b, 0x30, 0xd5, 0xd0, 0xcc, 0x5a, 0xc5, 0xf8, 0xdc, 0x5f, 0xc5, 0x83, 0x94, 0xbe, - 0x29, 0xe5, 0x38, 0x40, 0xa0, 0x6b, 0xb0, 0x20, 0xec, 0xd6, 0x89, 0x59, 0x77, 0x1a, 0xe2, 0x1d, - 0xe4, 0xb6, 0x11, 0xcc, 0x95, 0x7b, 0x7d, 0x7a, 0x3c, 0x60, 0xa1, 0xfc, 0x95, 0x02, 0x74, 0x90, - 0x05, 0xe1, 0x34, 0xe4, 0x34, 0xdb, 0x10, 0x7b, 0xaa, 0x57, 0x54, 0x39, 0x75, 0xb6, 0xdb, 0x29, - 0xe6, 0xae, 0x6c, 0xdd, 0xf2, 0x84, 0x38, 0xd4, 0x73, 0xb0, 0x3f, 0x45, 0xbd, 0x69, 0x29, 0xc1, - 0xbe, 0x63, 0x86, 0x43, 0x3d, 0xba, 0x00, 0x33, 0x7a, 0xd3, 0x65, 0x0e, 0xa1, 0x15, 0xdd, 0xb2, - 0x89, 0x68, 0x42, 0x53, 0xea, 0x61, 0x79, 0xa7, 0x99, 0xab, 0x3d, 0x3a, 0x1c, 0x41, 0xa2, 0x12, - 0x00, 0xaf, 0x23, 0x66, 0x6b, 0xdc, 0x4f, 0x56, 0xf8, 0x99, 0xe3, 0x0f, 0xb6, 0x19, 0x48, 0x71, - 0x0f, 0x42, 0x79, 0x02, 0x4b, 0x15, 0x42, 0xdb, 0x86, 0x4e, 0xae, 0xe8, 0xba, 0xe5, 0x9a, 0x8e, - 0xbf, 0x71, 0x97, 0x21, 0x17, 0xc0, 0x64, 0xa9, 0x1d, 0x92, 0xfe, 0x73, 0x01, 0x17, 0x0e, 0x31, - 0x41, 0x6d, 0xa7, 0x63, 0x6b, 0xfb, 0xfb, 0x34, 0x4c, 0x86, 0xf4, 0x99, 0x1d, 0xc3, 0xac, 0x49, - 0xe6, 0xa3, 0x3e, 0xfa, 0x8e, 0x61, 0xd6, 0x5e, 0x75, 0x8a, 0xd3, 0x12, 0xc6, 0x3f, 0xb1, 0x00, - 0xa2, 0x6b, 0x90, 0x71, 0x19, 0xa1, 0xb2, 0x6a, 0x8f, 0x27, 0xe4, 0xf1, 0x03, 0x46, 0xa8, 0xbf, - 0x32, 0x4d, 0x71, 0x52, 0x2e, 0xc0, 0xc2, 0x1a, 0xdd, 0x84, 0x6c, 0x9d, 0xbf, 0x87, 0x2c, 0xcc, - 0x13, 0x09, 0x34, 0xbd, 0xbf, 0x3f, 0xbc, 0xc7, 0x17, 0x12, 0xec, 0x11, 0xa0, 0x26, 0xcc, 0xb1, - 0x48, 0xe0, 0xc4, 0x23, 0x25, 0xaf, 0x40, 0x43, 0x23, 0xad, 0xa2, 0x6e, 0xa7, 0x38, 0x17, 0x55, - 0xe1, 0x3e, 0x6e, 0xa5, 0x0c, 0xd3, 0x3d, 0xd7, 0xda, 0xbf, 0x8f, 0xaa, 0x97, 0x9f, 0xbd, 0x2c, - 0x8c, 0x3d, 0x7f, 0x59, 0x18, 0x7b, 0xf1, 0xb2, 0x30, 0xf6, 0x65, 0xb7, 0x90, 0x7a, 0xd6, 0x2d, - 0xa4, 0x9e, 0x77, 0x0b, 0xa9, 0x17, 0xdd, 0x42, 0xea, 0xb7, 0x6e, 0x21, 0xf5, 0xf4, 0xf7, 0xc2, - 0xd8, 0xe3, 0x23, 0xb1, 0xff, 0x13, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x0a, 0x3e, 0x83, - 0x48, 0x15, 0x00, 0x00, -} - -func (m *ExemptPriorityLevelConfiguration) 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 *ExemptPriorityLevelConfiguration) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ExemptPriorityLevelConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LendablePercent != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.LendablePercent)) - i-- - dAtA[i] = 0x10 - } - if m.NominalConcurrencyShares != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.NominalConcurrencyShares)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *FlowDistinguisherMethod) 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 *FlowDistinguisherMethod) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlowDistinguisherMethod) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *FlowSchema) 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 *FlowSchema) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlowSchema) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.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 *FlowSchemaCondition) 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 *FlowSchemaCondition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlowSchemaCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x2a - i -= len(m.Reason) - copy(dAtA[i:], m.Reason) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) - i-- - dAtA[i] = 0x22 - { - size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0x12 - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *FlowSchemaList) 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 *FlowSchemaList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlowSchemaList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.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 *FlowSchemaSpec) 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 *FlowSchemaSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlowSchemaSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Rules) > 0 { - for iNdEx := len(m.Rules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.DistinguisherMethod != nil { - { - size, err := m.DistinguisherMethod.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - i = encodeVarintGenerated(dAtA, i, uint64(m.MatchingPrecedence)) - i-- - dAtA[i] = 0x10 - { - size, err := m.PriorityLevelConfiguration.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 *FlowSchemaStatus) 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 *FlowSchemaStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlowSchemaStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Conditions) > 0 { - for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Conditions[iNdEx].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 *GroupSubject) 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 *GroupSubject) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GroupSubject) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 (m *LimitResponse) 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 *LimitResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LimitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Queuing != nil { - { - size, err := m.Queuing.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *LimitedPriorityLevelConfiguration) 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 *LimitedPriorityLevelConfiguration) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LimitedPriorityLevelConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BorrowingLimitPercent != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.BorrowingLimitPercent)) - i-- - dAtA[i] = 0x20 - } - if m.LendablePercent != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.LendablePercent)) - i-- - dAtA[i] = 0x18 - } - { - size, err := m.LimitResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.NominalConcurrencyShares != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.NominalConcurrencyShares)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *NonResourcePolicyRule) 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 *NonResourcePolicyRule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NonResourcePolicyRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NonResourceURLs) > 0 { - for iNdEx := len(m.NonResourceURLs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NonResourceURLs[iNdEx]) - copy(dAtA[i:], m.NonResourceURLs[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.NonResourceURLs[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Verbs) > 0 { - for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Verbs[iNdEx]) - copy(dAtA[i:], m.Verbs[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *PolicyRulesWithSubjects) 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 *PolicyRulesWithSubjects) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PolicyRulesWithSubjects) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NonResourceRules) > 0 { - for iNdEx := len(m.NonResourceRules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.NonResourceRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.ResourceRules) > 0 { - for iNdEx := len(m.ResourceRules) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ResourceRules[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Subjects) > 0 { - for iNdEx := len(m.Subjects) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Subjects[iNdEx].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 *PriorityLevelConfiguration) 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 *PriorityLevelConfiguration) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PriorityLevelConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.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 *PriorityLevelConfigurationCondition) 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 *PriorityLevelConfigurationCondition) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PriorityLevelConfigurationCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x2a - i -= len(m.Reason) - copy(dAtA[i:], m.Reason) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) - i-- - dAtA[i] = 0x22 - { - size, err := m.LastTransitionTime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - i -= len(m.Status) - copy(dAtA[i:], m.Status) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Status))) - i-- - dAtA[i] = 0x12 - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PriorityLevelConfigurationList) 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 *PriorityLevelConfigurationList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PriorityLevelConfigurationList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.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 *PriorityLevelConfigurationReference) 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 *PriorityLevelConfigurationReference) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PriorityLevelConfigurationReference) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 (m *PriorityLevelConfigurationSpec) 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 *PriorityLevelConfigurationSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PriorityLevelConfigurationSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Exempt != nil { - { - size, err := m.Exempt.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Limited != nil { - { - size, err := m.Limited.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PriorityLevelConfigurationStatus) 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 *PriorityLevelConfigurationStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PriorityLevelConfigurationStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Conditions) > 0 { - for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Conditions[iNdEx].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 *QueuingConfiguration) 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 *QueuingConfiguration) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueuingConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i = encodeVarintGenerated(dAtA, i, uint64(m.QueueLengthLimit)) - i-- - dAtA[i] = 0x18 - i = encodeVarintGenerated(dAtA, i, uint64(m.HandSize)) - i-- - dAtA[i] = 0x10 - i = encodeVarintGenerated(dAtA, i, uint64(m.Queues)) - i-- - dAtA[i] = 0x8 - return len(dAtA) - i, nil -} - -func (m *ResourcePolicyRule) 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 *ResourcePolicyRule) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ResourcePolicyRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Namespaces) > 0 { - for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Namespaces[iNdEx]) - copy(dAtA[i:], m.Namespaces[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespaces[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - i-- - if m.ClusterScope { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - if len(m.Resources) > 0 { - for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Resources[iNdEx]) - copy(dAtA[i:], m.Resources[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Resources[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.APIGroups) > 0 { - for iNdEx := len(m.APIGroups) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.APIGroups[iNdEx]) - copy(dAtA[i:], m.APIGroups[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.APIGroups[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Verbs) > 0 { - for iNdEx := len(m.Verbs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Verbs[iNdEx]) - copy(dAtA[i:], m.Verbs[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Verbs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ServiceAccountSubject) 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 *ServiceAccountSubject) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceAccountSubject) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Subject) 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 *Subject) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Subject) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ServiceAccount != nil { - { - size, err := m.ServiceAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Group != nil { - { - size, err := m.Group.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.User != nil { - { - size, err := m.User.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *UserSubject) 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 *UserSubject) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UserSubject) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ExemptPriorityLevelConfiguration) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NominalConcurrencyShares != nil { - n += 1 + sovGenerated(uint64(*m.NominalConcurrencyShares)) - } - if m.LendablePercent != nil { - n += 1 + sovGenerated(uint64(*m.LendablePercent)) - } - return n -} - -func (m *FlowDistinguisherMethod) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *FlowSchema) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *FlowSchemaCondition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Status) - n += 1 + l + sovGenerated(uint64(l)) - l = m.LastTransitionTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Reason) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Message) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *FlowSchemaList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *FlowSchemaSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PriorityLevelConfiguration.Size() - n += 1 + l + sovGenerated(uint64(l)) - n += 1 + sovGenerated(uint64(m.MatchingPrecedence)) - if m.DistinguisherMethod != nil { - l = m.DistinguisherMethod.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if len(m.Rules) > 0 { - for _, e := range m.Rules { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *FlowSchemaStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *GroupSubject) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *LimitResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - if m.Queuing != nil { - l = m.Queuing.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *LimitedPriorityLevelConfiguration) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NominalConcurrencyShares != nil { - n += 1 + sovGenerated(uint64(*m.NominalConcurrencyShares)) - } - l = m.LimitResponse.Size() - n += 1 + l + sovGenerated(uint64(l)) - if m.LendablePercent != nil { - n += 1 + sovGenerated(uint64(*m.LendablePercent)) - } - if m.BorrowingLimitPercent != nil { - n += 1 + sovGenerated(uint64(*m.BorrowingLimitPercent)) - } - return n -} - -func (m *NonResourcePolicyRule) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Verbs) > 0 { - for _, s := range m.Verbs { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.NonResourceURLs) > 0 { - for _, s := range m.NonResourceURLs { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *PolicyRulesWithSubjects) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Subjects) > 0 { - for _, e := range m.Subjects { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.ResourceRules) > 0 { - for _, e := range m.ResourceRules { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.NonResourceRules) > 0 { - for _, e := range m.NonResourceRules { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *PriorityLevelConfiguration) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Status.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *PriorityLevelConfigurationCondition) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Status) - n += 1 + l + sovGenerated(uint64(l)) - l = m.LastTransitionTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Reason) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Message) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *PriorityLevelConfigurationList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *PriorityLevelConfigurationReference) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *PriorityLevelConfigurationSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - n += 1 + l + sovGenerated(uint64(l)) - if m.Limited != nil { - l = m.Limited.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Exempt != nil { - l = m.Exempt.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *PriorityLevelConfigurationStatus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *QueuingConfiguration) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - n += 1 + sovGenerated(uint64(m.Queues)) - n += 1 + sovGenerated(uint64(m.HandSize)) - n += 1 + sovGenerated(uint64(m.QueueLengthLimit)) - return n -} - -func (m *ResourcePolicyRule) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Verbs) > 0 { - for _, s := range m.Verbs { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.APIGroups) > 0 { - for _, s := range m.APIGroups { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Resources) > 0 { - for _, s := range m.Resources { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - n += 2 - if len(m.Namespaces) > 0 { - for _, s := range m.Namespaces { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *ServiceAccountSubject) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *Subject) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - n += 1 + l + sovGenerated(uint64(l)) - if m.User != nil { - l = m.User.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.Group != nil { - l = m.Group.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.ServiceAccount != nil { - l = m.ServiceAccount.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - return n -} - -func (m *UserSubject) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ExemptPriorityLevelConfiguration) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ExemptPriorityLevelConfiguration{`, - `NominalConcurrencyShares:` + valueToStringGenerated(this.NominalConcurrencyShares) + `,`, - `LendablePercent:` + valueToStringGenerated(this.LendablePercent) + `,`, - `}`, - }, "") - return s -} -func (this *FlowDistinguisherMethod) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FlowDistinguisherMethod{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `}`, - }, "") - return s -} -func (this *FlowSchema) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FlowSchema{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "FlowSchemaSpec", "FlowSchemaSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "FlowSchemaStatus", "FlowSchemaStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *FlowSchemaCondition) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&FlowSchemaCondition{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s -} -func (this *FlowSchemaList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]FlowSchema{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "FlowSchema", "FlowSchema", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&FlowSchemaList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *FlowSchemaSpec) String() string { - if this == nil { - return "nil" - } - repeatedStringForRules := "[]PolicyRulesWithSubjects{" - for _, f := range this.Rules { - repeatedStringForRules += strings.Replace(strings.Replace(f.String(), "PolicyRulesWithSubjects", "PolicyRulesWithSubjects", 1), `&`, ``, 1) + "," - } - repeatedStringForRules += "}" - s := strings.Join([]string{`&FlowSchemaSpec{`, - `PriorityLevelConfiguration:` + strings.Replace(strings.Replace(this.PriorityLevelConfiguration.String(), "PriorityLevelConfigurationReference", "PriorityLevelConfigurationReference", 1), `&`, ``, 1) + `,`, - `MatchingPrecedence:` + fmt.Sprintf("%v", this.MatchingPrecedence) + `,`, - `DistinguisherMethod:` + strings.Replace(this.DistinguisherMethod.String(), "FlowDistinguisherMethod", "FlowDistinguisherMethod", 1) + `,`, - `Rules:` + repeatedStringForRules + `,`, - `}`, - }, "") - return s -} -func (this *FlowSchemaStatus) String() string { - if this == nil { - return "nil" - } - repeatedStringForConditions := "[]FlowSchemaCondition{" - for _, f := range this.Conditions { - repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "FlowSchemaCondition", "FlowSchemaCondition", 1), `&`, ``, 1) + "," - } - repeatedStringForConditions += "}" - s := strings.Join([]string{`&FlowSchemaStatus{`, - `Conditions:` + repeatedStringForConditions + `,`, - `}`, - }, "") - return s -} -func (this *GroupSubject) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&GroupSubject{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *LimitResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LimitResponse{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Queuing:` + strings.Replace(this.Queuing.String(), "QueuingConfiguration", "QueuingConfiguration", 1) + `,`, - `}`, - }, "") - return s -} -func (this *LimitedPriorityLevelConfiguration) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&LimitedPriorityLevelConfiguration{`, - `NominalConcurrencyShares:` + valueToStringGenerated(this.NominalConcurrencyShares) + `,`, - `LimitResponse:` + strings.Replace(strings.Replace(this.LimitResponse.String(), "LimitResponse", "LimitResponse", 1), `&`, ``, 1) + `,`, - `LendablePercent:` + valueToStringGenerated(this.LendablePercent) + `,`, - `BorrowingLimitPercent:` + valueToStringGenerated(this.BorrowingLimitPercent) + `,`, - `}`, - }, "") - return s -} -func (this *NonResourcePolicyRule) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NonResourcePolicyRule{`, - `Verbs:` + fmt.Sprintf("%v", this.Verbs) + `,`, - `NonResourceURLs:` + fmt.Sprintf("%v", this.NonResourceURLs) + `,`, - `}`, - }, "") - return s -} -func (this *PolicyRulesWithSubjects) String() string { - if this == nil { - return "nil" - } - repeatedStringForSubjects := "[]Subject{" - for _, f := range this.Subjects { - repeatedStringForSubjects += strings.Replace(strings.Replace(f.String(), "Subject", "Subject", 1), `&`, ``, 1) + "," - } - repeatedStringForSubjects += "}" - repeatedStringForResourceRules := "[]ResourcePolicyRule{" - for _, f := range this.ResourceRules { - repeatedStringForResourceRules += strings.Replace(strings.Replace(f.String(), "ResourcePolicyRule", "ResourcePolicyRule", 1), `&`, ``, 1) + "," - } - repeatedStringForResourceRules += "}" - repeatedStringForNonResourceRules := "[]NonResourcePolicyRule{" - for _, f := range this.NonResourceRules { - repeatedStringForNonResourceRules += strings.Replace(strings.Replace(f.String(), "NonResourcePolicyRule", "NonResourcePolicyRule", 1), `&`, ``, 1) + "," - } - repeatedStringForNonResourceRules += "}" - s := strings.Join([]string{`&PolicyRulesWithSubjects{`, - `Subjects:` + repeatedStringForSubjects + `,`, - `ResourceRules:` + repeatedStringForResourceRules + `,`, - `NonResourceRules:` + repeatedStringForNonResourceRules + `,`, - `}`, - }, "") - return s -} -func (this *PriorityLevelConfiguration) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PriorityLevelConfiguration{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "PriorityLevelConfigurationSpec", "PriorityLevelConfigurationSpec", 1), `&`, ``, 1) + `,`, - `Status:` + strings.Replace(strings.Replace(this.Status.String(), "PriorityLevelConfigurationStatus", "PriorityLevelConfigurationStatus", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *PriorityLevelConfigurationCondition) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PriorityLevelConfigurationCondition{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `LastTransitionTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastTransitionTime), "Time", "v1.Time", 1), `&`, ``, 1) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, - `}`, - }, "") - return s -} -func (this *PriorityLevelConfigurationList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]PriorityLevelConfiguration{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PriorityLevelConfiguration", "PriorityLevelConfiguration", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{`&PriorityLevelConfigurationList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} -func (this *PriorityLevelConfigurationReference) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PriorityLevelConfigurationReference{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *PriorityLevelConfigurationSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&PriorityLevelConfigurationSpec{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Limited:` + strings.Replace(this.Limited.String(), "LimitedPriorityLevelConfiguration", "LimitedPriorityLevelConfiguration", 1) + `,`, - `Exempt:` + strings.Replace(this.Exempt.String(), "ExemptPriorityLevelConfiguration", "ExemptPriorityLevelConfiguration", 1) + `,`, - `}`, - }, "") - return s -} -func (this *PriorityLevelConfigurationStatus) String() string { - if this == nil { - return "nil" - } - repeatedStringForConditions := "[]PriorityLevelConfigurationCondition{" - for _, f := range this.Conditions { - repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "PriorityLevelConfigurationCondition", "PriorityLevelConfigurationCondition", 1), `&`, ``, 1) + "," - } - repeatedStringForConditions += "}" - s := strings.Join([]string{`&PriorityLevelConfigurationStatus{`, - `Conditions:` + repeatedStringForConditions + `,`, - `}`, - }, "") - return s -} -func (this *QueuingConfiguration) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&QueuingConfiguration{`, - `Queues:` + fmt.Sprintf("%v", this.Queues) + `,`, - `HandSize:` + fmt.Sprintf("%v", this.HandSize) + `,`, - `QueueLengthLimit:` + fmt.Sprintf("%v", this.QueueLengthLimit) + `,`, - `}`, - }, "") - return s -} -func (this *ResourcePolicyRule) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ResourcePolicyRule{`, - `Verbs:` + fmt.Sprintf("%v", this.Verbs) + `,`, - `APIGroups:` + fmt.Sprintf("%v", this.APIGroups) + `,`, - `Resources:` + fmt.Sprintf("%v", this.Resources) + `,`, - `ClusterScope:` + fmt.Sprintf("%v", this.ClusterScope) + `,`, - `Namespaces:` + fmt.Sprintf("%v", this.Namespaces) + `,`, - `}`, - }, "") - return s -} -func (this *ServiceAccountSubject) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&ServiceAccountSubject{`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func (this *Subject) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Subject{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `User:` + strings.Replace(this.User.String(), "UserSubject", "UserSubject", 1) + `,`, - `Group:` + strings.Replace(this.Group.String(), "GroupSubject", "GroupSubject", 1) + `,`, - `ServiceAccount:` + strings.Replace(this.ServiceAccount.String(), "ServiceAccountSubject", "ServiceAccountSubject", 1) + `,`, - `}`, - }, "") - return s -} -func (this *UserSubject) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&UserSubject{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `}`, - }, "") - return s -} -func valueToStringGenerated(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *ExemptPriorityLevelConfiguration) 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: ExemptPriorityLevelConfiguration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ExemptPriorityLevelConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NominalConcurrencyShares", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NominalConcurrencyShares = &v - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LendablePercent", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LendablePercent = &v - 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 *FlowDistinguisherMethod) 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: FlowDistinguisherMethod: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlowDistinguisherMethod: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = FlowDistinguisherMethodType(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 *FlowSchema) 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: FlowSchema: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlowSchema: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", 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.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", 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.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status.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 *FlowSchemaCondition) 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: FlowSchemaCondition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlowSchemaCondition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = FlowSchemaConditionType(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status = ConditionStatus(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", 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.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", 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.Reason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", 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.Message = 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 *FlowSchemaList) 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: FlowSchemaList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlowSchemaList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", 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.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", 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.Items = append(m.Items, FlowSchema{}) - if err := m.Items[len(m.Items)-1].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 *FlowSchemaSpec) 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: FlowSchemaSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlowSchemaSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PriorityLevelConfiguration", 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.PriorityLevelConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MatchingPrecedence", wireType) - } - m.MatchingPrecedence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MatchingPrecedence |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DistinguisherMethod", 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.DistinguisherMethod == nil { - m.DistinguisherMethod = &FlowDistinguisherMethod{} - } - if err := m.DistinguisherMethod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rules", 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.Rules = append(m.Rules, PolicyRulesWithSubjects{}) - if err := m.Rules[len(m.Rules)-1].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 *FlowSchemaStatus) 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: FlowSchemaStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlowSchemaStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", 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.Conditions = append(m.Conditions, FlowSchemaCondition{}) - if err := m.Conditions[len(m.Conditions)-1].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 *GroupSubject) 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: GroupSubject: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GroupSubject: 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 - 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 *LimitResponse) 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: LimitResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LimitResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = LimitResponseType(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Queuing", 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.Queuing == nil { - m.Queuing = &QueuingConfiguration{} - } - if err := m.Queuing.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 *LimitedPriorityLevelConfiguration) 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: LimitedPriorityLevelConfiguration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LimitedPriorityLevelConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NominalConcurrencyShares", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.NominalConcurrencyShares = &v - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LimitResponse", 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.LimitResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LendablePercent", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LendablePercent = &v - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BorrowingLimitPercent", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BorrowingLimitPercent = &v - 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 *NonResourcePolicyRule) 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: NonResourcePolicyRule: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NonResourcePolicyRule: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Verbs", 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.Verbs = append(m.Verbs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NonResourceURLs", 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.NonResourceURLs = append(m.NonResourceURLs, 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 *PolicyRulesWithSubjects) 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: PolicyRulesWithSubjects: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PolicyRulesWithSubjects: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subjects", 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.Subjects = append(m.Subjects, Subject{}) - if err := m.Subjects[len(m.Subjects)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceRules", 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.ResourceRules = append(m.ResourceRules, ResourcePolicyRule{}) - if err := m.ResourceRules[len(m.ResourceRules)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NonResourceRules", 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.NonResourceRules = append(m.NonResourceRules, NonResourcePolicyRule{}) - if err := m.NonResourceRules[len(m.NonResourceRules)-1].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 *PriorityLevelConfiguration) 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: PriorityLevelConfiguration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PriorityLevelConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", 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.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", 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.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status.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 *PriorityLevelConfigurationCondition) 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: PriorityLevelConfigurationCondition: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PriorityLevelConfigurationCondition: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = PriorityLevelConfigurationConditionType(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status = ConditionStatus(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastTransitionTime", 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.LastTransitionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reason", 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.Reason = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", 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.Message = 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 *PriorityLevelConfigurationList) 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: PriorityLevelConfigurationList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PriorityLevelConfigurationList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", 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.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", 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.Items = append(m.Items, PriorityLevelConfiguration{}) - if err := m.Items[len(m.Items)-1].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 *PriorityLevelConfigurationReference) 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: PriorityLevelConfigurationReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PriorityLevelConfigurationReference: 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 - 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 *PriorityLevelConfigurationSpec) 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: PriorityLevelConfigurationSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PriorityLevelConfigurationSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = PriorityLevelEnablement(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Limited", 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.Limited == nil { - m.Limited = &LimitedPriorityLevelConfiguration{} - } - if err := m.Limited.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exempt", 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.Exempt == nil { - m.Exempt = &ExemptPriorityLevelConfiguration{} - } - if err := m.Exempt.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 *PriorityLevelConfigurationStatus) 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: PriorityLevelConfigurationStatus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PriorityLevelConfigurationStatus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Conditions", 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.Conditions = append(m.Conditions, PriorityLevelConfigurationCondition{}) - if err := m.Conditions[len(m.Conditions)-1].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 *QueuingConfiguration) 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: QueuingConfiguration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueuingConfiguration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Queues", wireType) - } - m.Queues = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Queues |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HandSize", wireType) - } - m.HandSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HandSize |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field QueueLengthLimit", wireType) - } - m.QueueLengthLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.QueueLengthLimit |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 *ResourcePolicyRule) 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: ResourcePolicyRule: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ResourcePolicyRule: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Verbs", 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.Verbs = append(m.Verbs, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APIGroups", 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.APIGroups = append(m.APIGroups, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Resources", 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.Resources = append(m.Resources, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterScope", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ClusterScope = bool(v != 0) - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", 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.Namespaces = append(m.Namespaces, 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 *ServiceAccountSubject) 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: ServiceAccountSubject: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceAccountSubject: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", 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.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 - 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 *Subject) 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: Subject: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Subject: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", 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.Kind = SubjectKind(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", 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.User == nil { - m.User = &UserSubject{} - } - if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", 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.Group == nil { - m.Group = &GroupSubject{} - } - if err := m.Group.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccount", 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.ServiceAccount == nil { - m.ServiceAccount = &ServiceAccountSubject{} - } - if err := m.ServiceAccount.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 *UserSubject) 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: UserSubject: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UserSubject: 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 - 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 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenerated - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") -) diff --git a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/generated.proto b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/generated.proto deleted file mode 100644 index a5c6f4fc4f39..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/generated.proto +++ /dev/null @@ -1,520 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package k8s.io.api.flowcontrol.v1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "k8s.io/api/flowcontrol/v1"; - -// ExemptPriorityLevelConfiguration describes the configurable aspects -// of the handling of exempt requests. -// In the mandatory exempt configuration object the values in the fields -// here can be modified by authorized users, unlike the rest of the `spec`. -message ExemptPriorityLevelConfiguration { - // `nominalConcurrencyShares` (NCS) contributes to the computation of the - // NominalConcurrencyLimit (NominalCL) of this level. - // This is the number of execution seats nominally reserved for this priority level. - // This DOES NOT limit the dispatching from this priority level - // but affects the other priority levels through the borrowing mechanism. - // The server's concurrency limit (ServerCL) is divided among all the - // priority levels in proportion to their NCS values: - // - // NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) - // sum_ncs = sum[priority level k] NCS(k) - // - // Bigger numbers mean a larger nominal concurrency limit, - // at the expense of every other priority level. - // This field has a default value of zero. - // +optional - optional int32 nominalConcurrencyShares = 1; - - // `lendablePercent` prescribes the fraction of the level's NominalCL that - // can be borrowed by other priority levels. This value of this - // field must be between 0 and 100, inclusive, and it defaults to 0. - // The number of seats that other levels can borrow from this level, known - // as this level's LendableConcurrencyLimit (LendableCL), is defined as follows. - // - // LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 ) - // - // +optional - optional int32 lendablePercent = 2; -} - -// FlowDistinguisherMethod specifies the method of a flow distinguisher. -message FlowDistinguisherMethod { - // `type` is the type of flow distinguisher method - // The supported types are "ByUser" and "ByNamespace". - // Required. - optional string type = 1; -} - -// FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with -// similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". -message FlowSchema { - // `metadata` is the standard object's 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` is the specification of the desired behavior of a FlowSchema. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional FlowSchemaSpec spec = 2; - - // `status` is the current status of a FlowSchema. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional FlowSchemaStatus status = 3; -} - -// FlowSchemaCondition describes conditions for a FlowSchema. -message FlowSchemaCondition { - // `type` is the type of the condition. - // Required. - optional string type = 1; - - // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. - optional string status = 2; - - // `lastTransitionTime` is the last time the condition transitioned from one status to another. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. - optional string reason = 4; - - // `message` is a human-readable message indicating details about last transition. - optional string message = 5; -} - -// FlowSchemaList is a list of FlowSchema objects. -message FlowSchemaList { - // `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.ListMeta metadata = 1; - - // `items` is a list of FlowSchemas. - repeated FlowSchema items = 2; -} - -// FlowSchemaSpec describes how the FlowSchema's specification looks like. -message FlowSchemaSpec { - // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot - // be resolved, the FlowSchema will be ignored and marked as invalid in its status. - // Required. - optional PriorityLevelConfigurationReference priorityLevelConfiguration = 1; - - // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen - // FlowSchema is among those with the numerically lowest (which we take to be logically highest) - // MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000]. - // Note that if the precedence is not specified, it will be set to 1000 as default. - // +optional - optional int32 matchingPrecedence = 2; - - // `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. - // `nil` specifies that the distinguisher is disabled and thus will always be the empty string. - // +optional - optional FlowDistinguisherMethod distinguisherMethod = 3; - - // `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if - // at least one member of rules matches the request. - // if it is an empty slice, there will be no requests matching the FlowSchema. - // +listType=atomic - // +optional - repeated PolicyRulesWithSubjects rules = 4; -} - -// FlowSchemaStatus represents the current state of a FlowSchema. -message FlowSchemaStatus { - // `conditions` is a list of the current states of FlowSchema. - // +listType=map - // +listMapKey=type - // +patchMergeKey=type - // +patchStrategy=merge - // +optional - repeated FlowSchemaCondition conditions = 1; -} - -// GroupSubject holds detailed information for group-kind subject. -message GroupSubject { - // name is the user group that matches, or "*" to match all user groups. - // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some - // well-known group names. - // Required. - optional string name = 1; -} - -// LimitResponse defines how to handle requests that can not be executed right now. -// +union -message LimitResponse { - // `type` is "Queue" or "Reject". - // "Queue" means that requests that can not be executed upon arrival - // are held in a queue until they can be executed or a queuing limit - // is reached. - // "Reject" means that requests that can not be executed upon arrival - // are rejected. - // Required. - // +unionDiscriminator - optional string type = 1; - - // `queuing` holds the configuration parameters for queuing. - // This field may be non-empty only if `type` is `"Queue"`. - // +optional - optional QueuingConfiguration queuing = 2; -} - -// LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. -// It addresses two issues: -// - How are requests for this priority level limited? -// - What should be done with requests that exceed the limit? -message LimitedPriorityLevelConfiguration { - // `nominalConcurrencyShares` (NCS) contributes to the computation of the - // NominalConcurrencyLimit (NominalCL) of this level. - // This is the number of execution seats available at this priority level. - // This is used both for requests dispatched from this priority level - // as well as requests dispatched from other priority levels - // borrowing seats from this level. - // The server's concurrency limit (ServerCL) is divided among the - // Limited priority levels in proportion to their NCS values: - // - // NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) - // sum_ncs = sum[priority level k] NCS(k) - // - // Bigger numbers mean a larger nominal concurrency limit, - // at the expense of every other priority level. - // - // If not specified, this field defaults to a value of 30. - // - // Setting this field to zero supports the construction of a - // "jail" for this priority level that is used to hold some request(s) - // - // +optional - optional int32 nominalConcurrencyShares = 1; - - // `limitResponse` indicates what to do with requests that can not be executed right now - optional LimitResponse limitResponse = 2; - - // `lendablePercent` prescribes the fraction of the level's NominalCL that - // can be borrowed by other priority levels. The value of this - // field must be between 0 and 100, inclusive, and it defaults to 0. - // The number of seats that other levels can borrow from this level, known - // as this level's LendableConcurrencyLimit (LendableCL), is defined as follows. - // - // LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 ) - // - // +optional - optional int32 lendablePercent = 3; - - // `borrowingLimitPercent`, if present, configures a limit on how many - // seats this priority level can borrow from other priority levels. - // The limit is known as this level's BorrowingConcurrencyLimit - // (BorrowingCL) and is a limit on the total number of seats that this - // level may borrow at any one time. - // This field holds the ratio of that limit to the level's nominal - // concurrency limit. When this field is non-nil, it must hold a - // non-negative integer and the limit is calculated as follows. - // - // BorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 ) - // - // The value of this field can be more than 100, implying that this - // priority level can borrow a number of seats that is greater than - // its own nominal concurrency limit (NominalCL). - // When this field is left `nil`, the limit is effectively infinite. - // +optional - optional int32 borrowingLimitPercent = 4; -} - -// NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the -// target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member -// of verbs matches the request and (b) at least one member of nonResourceURLs matches the request. -message NonResourcePolicyRule { - // `verbs` is a list of matching verbs and may not be empty. - // "*" matches all verbs. If it is present, it must be the only entry. - // +listType=set - // Required. - repeated string verbs = 1; - - // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. - // For example: - // - "/healthz" is legal - // - "/hea*" is illegal - // - "/hea" is legal but matches nothing - // - "/hea/*" also matches nothing - // - "/healthz/*" matches all per-component health checks. - // "*" matches all non-resource urls. if it is present, it must be the only entry. - // +listType=set - // Required. - repeated string nonResourceURLs = 6; -} - -// PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject -// making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches -// a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member -// of resourceRules or nonResourceRules matches the request. -message PolicyRulesWithSubjects { - // subjects is the list of normal user, serviceaccount, or group that this rule cares about. - // There must be at least one member in this slice. - // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. - // +listType=atomic - // Required. - repeated Subject subjects = 1; - - // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the - // target resource. - // At least one of `resourceRules` and `nonResourceRules` has to be non-empty. - // +listType=atomic - // +optional - repeated ResourcePolicyRule resourceRules = 2; - - // `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb - // and the target non-resource URL. - // +listType=atomic - // +optional - repeated NonResourcePolicyRule nonResourceRules = 3; -} - -// PriorityLevelConfiguration represents the configuration of a priority level. -message PriorityLevelConfiguration { - // `metadata` is the standard object's 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` is the specification of the desired behavior of a "request-priority". - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional PriorityLevelConfigurationSpec spec = 2; - - // `status` is the current status of a "request-priority". - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional PriorityLevelConfigurationStatus status = 3; -} - -// PriorityLevelConfigurationCondition defines the condition of priority level. -message PriorityLevelConfigurationCondition { - // `type` is the type of the condition. - // Required. - optional string type = 1; - - // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. - optional string status = 2; - - // `lastTransitionTime` is the last time the condition transitioned from one status to another. - optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3; - - // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. - optional string reason = 4; - - // `message` is a human-readable message indicating details about last transition. - optional string message = 5; -} - -// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. -message PriorityLevelConfigurationList { - // `metadata` is the standard object's 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.ListMeta metadata = 1; - - // `items` is a list of request-priorities. - repeated PriorityLevelConfiguration items = 2; -} - -// PriorityLevelConfigurationReference contains information that points to the "request-priority" being used. -message PriorityLevelConfigurationReference { - // `name` is the name of the priority level configuration being referenced - // Required. - optional string name = 1; -} - -// PriorityLevelConfigurationSpec specifies the configuration of a priority level. -// +union -message PriorityLevelConfigurationSpec { - // `type` indicates whether this priority level is subject to - // limitation on request execution. A value of `"Exempt"` means - // that requests of this priority level are not subject to a limit - // (and thus are never queued) and do not detract from the - // capacity made available to other priority levels. A value of - // `"Limited"` means that (a) requests of this priority level - // _are_ subject to limits and (b) some of the server's limited - // capacity is made available exclusively to this priority level. - // Required. - // +unionDiscriminator - optional string type = 1; - - // `limited` specifies how requests are handled for a Limited priority level. - // This field must be non-empty if and only if `type` is `"Limited"`. - // +optional - optional LimitedPriorityLevelConfiguration limited = 2; - - // `exempt` specifies how requests are handled for an exempt priority level. - // This field MUST be empty if `type` is `"Limited"`. - // This field MAY be non-empty if `type` is `"Exempt"`. - // If empty and `type` is `"Exempt"` then the default values - // for `ExemptPriorityLevelConfiguration` apply. - // +optional - optional ExemptPriorityLevelConfiguration exempt = 3; -} - -// PriorityLevelConfigurationStatus represents the current state of a "request-priority". -message PriorityLevelConfigurationStatus { - // `conditions` is the current state of "request-priority". - // +listType=map - // +listMapKey=type - // +patchMergeKey=type - // +patchStrategy=merge - // +optional - repeated PriorityLevelConfigurationCondition conditions = 1; -} - -// QueuingConfiguration holds the configuration parameters for queuing -message QueuingConfiguration { - // `queues` is the number of queues for this priority level. The - // queues exist independently at each apiserver. The value must be - // positive. Setting it to 1 effectively precludes - // shufflesharding and thus makes the distinguisher method of - // associated flow schemas irrelevant. This field has a default - // value of 64. - // +optional - optional int32 queues = 1; - - // `handSize` is a small positive number that configures the - // shuffle sharding of requests into queues. When enqueuing a request - // at this priority level the request's flow identifier (a string - // pair) is hashed and the hash value is used to shuffle the list - // of queues and deal a hand of the size specified here. The - // request is put into one of the shortest queues in that hand. - // `handSize` must be no larger than `queues`, and should be - // significantly smaller (so that a few heavy flows do not - // saturate most of the queues). See the user-facing - // documentation for more extensive guidance on setting this - // field. This field has a default value of 8. - // +optional - optional int32 handSize = 2; - - // `queueLengthLimit` is the maximum number of requests allowed to - // be waiting in a given queue of this priority level at a time; - // excess requests are rejected. This value must be positive. If - // not specified, it will be defaulted to 50. - // +optional - optional int32 queueLengthLimit = 3; -} - -// ResourcePolicyRule is a predicate that matches some resource -// requests, testing the request's verb and the target resource. A -// ResourcePolicyRule matches a resource request if and only if: (a) -// at least one member of verbs matches the request, (b) at least one -// member of apiGroups matches the request, (c) at least one member of -// resources matches the request, and (d) either (d1) the request does -// not specify a namespace (i.e., `Namespace==""`) and clusterScope is -// true or (d2) the request specifies a namespace and least one member -// of namespaces matches the request's namespace. -message ResourcePolicyRule { - // `verbs` is a list of matching verbs and may not be empty. - // "*" matches all verbs and, if present, must be the only entry. - // +listType=set - // Required. - repeated string verbs = 1; - - // `apiGroups` is a list of matching API groups and may not be empty. - // "*" matches all API groups and, if present, must be the only entry. - // +listType=set - // Required. - repeated string apiGroups = 2; - - // `resources` is a list of matching resources (i.e., lowercase - // and plural) with, if desired, subresource. For example, [ - // "services", "nodes/status" ]. This list may not be empty. - // "*" matches all resources and, if present, must be the only entry. - // Required. - // +listType=set - repeated string resources = 3; - - // `clusterScope` indicates whether to match requests that do not - // specify a namespace (which happens either because the resource - // is not namespaced or the request targets all namespaces). - // If this field is omitted or false then the `namespaces` field - // must contain a non-empty list. - // +optional - optional bool clusterScope = 4; - - // `namespaces` is a list of target namespaces that restricts - // matches. A request that specifies a target namespace matches - // only if either (a) this list contains that target namespace or - // (b) this list contains "*". Note that "*" matches any - // specified namespace but does not match a request that _does - // not specify_ a namespace (see the `clusterScope` field for - // that). - // This list may be empty, but only if `clusterScope` is true. - // +optional - // +listType=set - repeated string namespaces = 5; -} - -// ServiceAccountSubject holds detailed information for service-account-kind subject. -message ServiceAccountSubject { - // `namespace` is the namespace of matching ServiceAccount objects. - // Required. - optional string namespace = 1; - - // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. - // Required. - optional string name = 2; -} - -// Subject matches the originator of a request, as identified by the request authentication system. There are three -// ways of matching an originator; by user, group, or service account. -// +union -message Subject { - // `kind` indicates which one of the other fields is non-empty. - // Required - // +unionDiscriminator - optional string kind = 1; - - // `user` matches based on username. - // +optional - optional UserSubject user = 2; - - // `group` matches based on user group name. - // +optional - optional GroupSubject group = 3; - - // `serviceAccount` matches ServiceAccounts. - // +optional - optional ServiceAccountSubject serviceAccount = 4; -} - -// UserSubject holds detailed information for user-kind subject. -message UserSubject { - // `name` is the username that matches, or "*" to match all usernames. - // Required. - optional string name = 1; -} - diff --git a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/register.go b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/register.go deleted file mode 100644 index 02725b514e08..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/register.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -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 v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the name of api group -const GroupName = "flowcontrol.apiserver.k8s.io" - -// SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder installs the api group to a scheme - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme adds api to a scheme - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &FlowSchema{}, - &FlowSchemaList{}, - &PriorityLevelConfiguration{}, - &PriorityLevelConfigurationList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/types.go b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/types.go deleted file mode 100644 index e62d23280e58..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/types.go +++ /dev/null @@ -1,660 +0,0 @@ -/* -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 v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// These are valid wildcards. -const ( - APIGroupAll = "*" - ResourceAll = "*" - VerbAll = "*" - NonResourceAll = "*" - NameAll = "*" - - NamespaceEvery = "*" // matches every particular namespace -) - -// System preset priority level names -const ( - PriorityLevelConfigurationNameExempt = "exempt" - PriorityLevelConfigurationNameCatchAll = "catch-all" - FlowSchemaNameExempt = "exempt" - FlowSchemaNameCatchAll = "catch-all" -) - -// Conditions -const ( - FlowSchemaConditionDangling = "Dangling" - - PriorityLevelConfigurationConditionConcurrencyShared = "ConcurrencyShared" -) - -// Constants used by api validation. -const ( - FlowSchemaMaxMatchingPrecedence int32 = 10000 -) - -// Constants for apiserver response headers. -const ( - ResponseHeaderMatchedPriorityLevelConfigurationUID = "X-Kubernetes-PF-PriorityLevel-UID" - ResponseHeaderMatchedFlowSchemaUID = "X-Kubernetes-PF-FlowSchema-UID" -) - -const ( - // AutoUpdateAnnotationKey is the name of an annotation that enables - // automatic update of the spec of the bootstrap configuration - // object(s), if set to 'true'. - // - // On a fresh install, all bootstrap configuration objects will have auto - // update enabled with the following annotation key: - // apf.kubernetes.io/autoupdate-spec: 'true' - // - // The kube-apiserver periodically checks the bootstrap configuration - // objects on the cluster and applies updates if necessary. - // - // kube-apiserver enforces an 'always auto-update' policy for the - // mandatory configuration object(s). This implies: - // - the auto-update annotation key is added with a value of 'true' - // if it is missing. - // - the auto-update annotation key is set to 'true' if its current value - // is a boolean false or has an invalid boolean representation - // (if the cluster operator sets it to 'false' it will be stomped) - // - any changes to the spec made by the cluster operator will be - // stomped, except for changes to the `nominalConcurrencyShares` - // and `lendablePercent` fields of the PriorityLevelConfiguration - // named "exempt". - // - // The kube-apiserver will apply updates on the suggested configuration if: - // - the cluster operator has enabled auto-update by setting the annotation - // (apf.kubernetes.io/autoupdate-spec: 'true') or - // - the annotation key is missing but the generation is 1 - // - // If the suggested configuration object is missing the annotation key, - // kube-apiserver will update the annotation appropriately: - // - it is set to 'true' if generation of the object is '1' which usually - // indicates that the spec of the object has not been changed. - // - it is set to 'false' if generation of the object is greater than 1. - // - // The goal is to enable the kube-apiserver to apply update on suggested - // configuration objects installed by previous releases but not overwrite - // changes made by the cluster operators. - // Note that this distinction is imperfectly detected: in the case where an - // operator deletes a suggested configuration object and later creates it - // but with a variant spec and then does no updates of the object - // (generation is 1), the technique outlined above will incorrectly - // determine that the object should be auto-updated. - AutoUpdateAnnotationKey = "apf.kubernetes.io/autoupdate-spec" -) - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with -// similar attributes and is identified by a pair of strings: the name of the FlowSchema and a "flow distinguisher". -type FlowSchema 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,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // `spec` is the specification of the desired behavior of a FlowSchema. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Spec FlowSchemaSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - // `status` is the current status of a FlowSchema. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Status FlowSchemaStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// FlowSchemaList is a list of FlowSchema objects. -type FlowSchemaList struct { - metav1.TypeMeta `json:",inline"` - // `metadata` is the standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // `items` is a list of FlowSchemas. - Items []FlowSchema `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// FlowSchemaSpec describes how the FlowSchema's specification looks like. -type FlowSchemaSpec struct { - // `priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot - // be resolved, the FlowSchema will be ignored and marked as invalid in its status. - // Required. - PriorityLevelConfiguration PriorityLevelConfigurationReference `json:"priorityLevelConfiguration" protobuf:"bytes,1,opt,name=priorityLevelConfiguration"` - // `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen - // FlowSchema is among those with the numerically lowest (which we take to be logically highest) - // MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000]. - // Note that if the precedence is not specified, it will be set to 1000 as default. - // +optional - MatchingPrecedence int32 `json:"matchingPrecedence" protobuf:"varint,2,opt,name=matchingPrecedence"` - // `distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. - // `nil` specifies that the distinguisher is disabled and thus will always be the empty string. - // +optional - DistinguisherMethod *FlowDistinguisherMethod `json:"distinguisherMethod,omitempty" protobuf:"bytes,3,opt,name=distinguisherMethod"` - // `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if - // at least one member of rules matches the request. - // if it is an empty slice, there will be no requests matching the FlowSchema. - // +listType=atomic - // +optional - Rules []PolicyRulesWithSubjects `json:"rules,omitempty" protobuf:"bytes,4,rep,name=rules"` -} - -// FlowDistinguisherMethodType is the type of flow distinguisher method -type FlowDistinguisherMethodType string - -// These are valid flow-distinguisher methods. -const ( - // FlowDistinguisherMethodByUserType specifies that the flow distinguisher is the username in the request. - // This type is used to provide some insulation between users. - FlowDistinguisherMethodByUserType FlowDistinguisherMethodType = "ByUser" - - // FlowDistinguisherMethodByNamespaceType specifies that the flow distinguisher is the namespace of the - // object that the request acts upon. If the object is not namespaced, or if the request is a non-resource - // request, then the distinguisher will be the empty string. An example usage of this type is to provide - // some insulation between tenants in a situation where there are multiple tenants and each namespace - // is dedicated to a tenant. - FlowDistinguisherMethodByNamespaceType FlowDistinguisherMethodType = "ByNamespace" -) - -// FlowDistinguisherMethod specifies the method of a flow distinguisher. -type FlowDistinguisherMethod struct { - // `type` is the type of flow distinguisher method - // The supported types are "ByUser" and "ByNamespace". - // Required. - Type FlowDistinguisherMethodType `json:"type" protobuf:"bytes,1,opt,name=type"` -} - -// PriorityLevelConfigurationReference contains information that points to the "request-priority" being used. -type PriorityLevelConfigurationReference struct { - // `name` is the name of the priority level configuration being referenced - // Required. - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` -} - -// PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject -// making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches -// a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member -// of resourceRules or nonResourceRules matches the request. -type PolicyRulesWithSubjects struct { - // subjects is the list of normal user, serviceaccount, or group that this rule cares about. - // There must be at least one member in this slice. - // A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. - // +listType=atomic - // Required. - Subjects []Subject `json:"subjects" protobuf:"bytes,1,rep,name=subjects"` - // `resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the - // target resource. - // At least one of `resourceRules` and `nonResourceRules` has to be non-empty. - // +listType=atomic - // +optional - ResourceRules []ResourcePolicyRule `json:"resourceRules,omitempty" protobuf:"bytes,2,opt,name=resourceRules"` - // `nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb - // and the target non-resource URL. - // +listType=atomic - // +optional - NonResourceRules []NonResourcePolicyRule `json:"nonResourceRules,omitempty" protobuf:"bytes,3,opt,name=nonResourceRules"` -} - -// Subject matches the originator of a request, as identified by the request authentication system. There are three -// ways of matching an originator; by user, group, or service account. -// +union -type Subject struct { - // `kind` indicates which one of the other fields is non-empty. - // Required - // +unionDiscriminator - Kind SubjectKind `json:"kind" protobuf:"bytes,1,opt,name=kind"` - // `user` matches based on username. - // +optional - User *UserSubject `json:"user,omitempty" protobuf:"bytes,2,opt,name=user"` - // `group` matches based on user group name. - // +optional - Group *GroupSubject `json:"group,omitempty" protobuf:"bytes,3,opt,name=group"` - // `serviceAccount` matches ServiceAccounts. - // +optional - ServiceAccount *ServiceAccountSubject `json:"serviceAccount,omitempty" protobuf:"bytes,4,opt,name=serviceAccount"` -} - -// SubjectKind is the kind of subject. -type SubjectKind string - -// Supported subject's kinds. -const ( - SubjectKindUser SubjectKind = "User" - SubjectKindGroup SubjectKind = "Group" - SubjectKindServiceAccount SubjectKind = "ServiceAccount" -) - -// UserSubject holds detailed information for user-kind subject. -type UserSubject struct { - // `name` is the username that matches, or "*" to match all usernames. - // Required. - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` -} - -// GroupSubject holds detailed information for group-kind subject. -type GroupSubject struct { - // name is the user group that matches, or "*" to match all user groups. - // See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some - // well-known group names. - // Required. - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` -} - -// ServiceAccountSubject holds detailed information for service-account-kind subject. -type ServiceAccountSubject struct { - // `namespace` is the namespace of matching ServiceAccount objects. - // Required. - Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"` - // `name` is the name of matching ServiceAccount objects, or "*" to match regardless of name. - // Required. - Name string `json:"name" protobuf:"bytes,2,opt,name=name"` -} - -// ResourcePolicyRule is a predicate that matches some resource -// requests, testing the request's verb and the target resource. A -// ResourcePolicyRule matches a resource request if and only if: (a) -// at least one member of verbs matches the request, (b) at least one -// member of apiGroups matches the request, (c) at least one member of -// resources matches the request, and (d) either (d1) the request does -// not specify a namespace (i.e., `Namespace==""`) and clusterScope is -// true or (d2) the request specifies a namespace and least one member -// of namespaces matches the request's namespace. -type ResourcePolicyRule struct { - // `verbs` is a list of matching verbs and may not be empty. - // "*" matches all verbs and, if present, must be the only entry. - // +listType=set - // Required. - Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` - - // `apiGroups` is a list of matching API groups and may not be empty. - // "*" matches all API groups and, if present, must be the only entry. - // +listType=set - // Required. - APIGroups []string `json:"apiGroups" protobuf:"bytes,2,rep,name=apiGroups"` - - // `resources` is a list of matching resources (i.e., lowercase - // and plural) with, if desired, subresource. For example, [ - // "services", "nodes/status" ]. This list may not be empty. - // "*" matches all resources and, if present, must be the only entry. - // Required. - // +listType=set - Resources []string `json:"resources" protobuf:"bytes,3,rep,name=resources"` - - // `clusterScope` indicates whether to match requests that do not - // specify a namespace (which happens either because the resource - // is not namespaced or the request targets all namespaces). - // If this field is omitted or false then the `namespaces` field - // must contain a non-empty list. - // +optional - ClusterScope bool `json:"clusterScope,omitempty" protobuf:"varint,4,opt,name=clusterScope"` - - // `namespaces` is a list of target namespaces that restricts - // matches. A request that specifies a target namespace matches - // only if either (a) this list contains that target namespace or - // (b) this list contains "*". Note that "*" matches any - // specified namespace but does not match a request that _does - // not specify_ a namespace (see the `clusterScope` field for - // that). - // This list may be empty, but only if `clusterScope` is true. - // +optional - // +listType=set - Namespaces []string `json:"namespaces" protobuf:"bytes,5,rep,name=namespaces"` -} - -// NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the -// target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member -// of verbs matches the request and (b) at least one member of nonResourceURLs matches the request. -type NonResourcePolicyRule struct { - // `verbs` is a list of matching verbs and may not be empty. - // "*" matches all verbs. If it is present, it must be the only entry. - // +listType=set - // Required. - Verbs []string `json:"verbs" protobuf:"bytes,1,rep,name=verbs"` - // `nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. - // For example: - // - "/healthz" is legal - // - "/hea*" is illegal - // - "/hea" is legal but matches nothing - // - "/hea/*" also matches nothing - // - "/healthz/*" matches all per-component health checks. - // "*" matches all non-resource urls. if it is present, it must be the only entry. - // +listType=set - // Required. - NonResourceURLs []string `json:"nonResourceURLs" protobuf:"bytes,6,rep,name=nonResourceURLs"` -} - -// FlowSchemaStatus represents the current state of a FlowSchema. -type FlowSchemaStatus struct { - // `conditions` is a list of the current states of FlowSchema. - // +listType=map - // +listMapKey=type - // +patchMergeKey=type - // +patchStrategy=merge - // +optional - Conditions []FlowSchemaCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` -} - -// FlowSchemaCondition describes conditions for a FlowSchema. -type FlowSchemaCondition struct { - // `type` is the type of the condition. - // Required. - Type FlowSchemaConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` - // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. - Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` - // `lastTransitionTime` is the last time the condition transitioned from one status to another. - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` - // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. - Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` - // `message` is a human-readable message indicating details about last transition. - Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` -} - -// FlowSchemaConditionType is a valid value for FlowSchemaStatusCondition.Type -type FlowSchemaConditionType string - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PriorityLevelConfiguration represents the configuration of a priority level. -type PriorityLevelConfiguration 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,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // `spec` is the specification of the desired behavior of a "request-priority". - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Spec PriorityLevelConfigurationSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - // `status` is the current status of a "request-priority". - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Status PriorityLevelConfigurationStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects. -type PriorityLevelConfigurationList 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.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // `items` is a list of request-priorities. - Items []PriorityLevelConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"` -} - -// PriorityLevelConfigurationSpec specifies the configuration of a priority level. -// +union -type PriorityLevelConfigurationSpec struct { - // `type` indicates whether this priority level is subject to - // limitation on request execution. A value of `"Exempt"` means - // that requests of this priority level are not subject to a limit - // (and thus are never queued) and do not detract from the - // capacity made available to other priority levels. A value of - // `"Limited"` means that (a) requests of this priority level - // _are_ subject to limits and (b) some of the server's limited - // capacity is made available exclusively to this priority level. - // Required. - // +unionDiscriminator - Type PriorityLevelEnablement `json:"type" protobuf:"bytes,1,opt,name=type"` - - // `limited` specifies how requests are handled for a Limited priority level. - // This field must be non-empty if and only if `type` is `"Limited"`. - // +optional - Limited *LimitedPriorityLevelConfiguration `json:"limited,omitempty" protobuf:"bytes,2,opt,name=limited"` - - // `exempt` specifies how requests are handled for an exempt priority level. - // This field MUST be empty if `type` is `"Limited"`. - // This field MAY be non-empty if `type` is `"Exempt"`. - // If empty and `type` is `"Exempt"` then the default values - // for `ExemptPriorityLevelConfiguration` apply. - // +optional - Exempt *ExemptPriorityLevelConfiguration `json:"exempt,omitempty" protobuf:"bytes,3,opt,name=exempt"` -} - -// PriorityLevelEnablement indicates whether limits on execution are enabled for the priority level -type PriorityLevelEnablement string - -// Supported priority level enablement values. -const ( - // PriorityLevelEnablementExempt means that requests are not subject to limits - PriorityLevelEnablementExempt PriorityLevelEnablement = "Exempt" - - // PriorityLevelEnablementLimited means that requests are subject to limits - PriorityLevelEnablementLimited PriorityLevelEnablement = "Limited" -) - -// LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. -// It addresses two issues: -// - How are requests for this priority level limited? -// - What should be done with requests that exceed the limit? -type LimitedPriorityLevelConfiguration struct { - // `nominalConcurrencyShares` (NCS) contributes to the computation of the - // NominalConcurrencyLimit (NominalCL) of this level. - // This is the number of execution seats available at this priority level. - // This is used both for requests dispatched from this priority level - // as well as requests dispatched from other priority levels - // borrowing seats from this level. - // The server's concurrency limit (ServerCL) is divided among the - // Limited priority levels in proportion to their NCS values: - // - // NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) - // sum_ncs = sum[priority level k] NCS(k) - // - // Bigger numbers mean a larger nominal concurrency limit, - // at the expense of every other priority level. - // - // If not specified, this field defaults to a value of 30. - // - // Setting this field to zero supports the construction of a - // "jail" for this priority level that is used to hold some request(s) - // - // +optional - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares" protobuf:"varint,1,opt,name=nominalConcurrencyShares"` - - // `limitResponse` indicates what to do with requests that can not be executed right now - LimitResponse LimitResponse `json:"limitResponse,omitempty" protobuf:"bytes,2,opt,name=limitResponse"` - - // `lendablePercent` prescribes the fraction of the level's NominalCL that - // can be borrowed by other priority levels. The value of this - // field must be between 0 and 100, inclusive, and it defaults to 0. - // The number of seats that other levels can borrow from this level, known - // as this level's LendableConcurrencyLimit (LendableCL), is defined as follows. - // - // LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 ) - // - // +optional - LendablePercent *int32 `json:"lendablePercent,omitempty" protobuf:"varint,3,opt,name=lendablePercent"` - - // `borrowingLimitPercent`, if present, configures a limit on how many - // seats this priority level can borrow from other priority levels. - // The limit is known as this level's BorrowingConcurrencyLimit - // (BorrowingCL) and is a limit on the total number of seats that this - // level may borrow at any one time. - // This field holds the ratio of that limit to the level's nominal - // concurrency limit. When this field is non-nil, it must hold a - // non-negative integer and the limit is calculated as follows. - // - // BorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 ) - // - // The value of this field can be more than 100, implying that this - // priority level can borrow a number of seats that is greater than - // its own nominal concurrency limit (NominalCL). - // When this field is left `nil`, the limit is effectively infinite. - // +optional - BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty" protobuf:"varint,4,opt,name=borrowingLimitPercent"` -} - -// ExemptPriorityLevelConfiguration describes the configurable aspects -// of the handling of exempt requests. -// In the mandatory exempt configuration object the values in the fields -// here can be modified by authorized users, unlike the rest of the `spec`. -type ExemptPriorityLevelConfiguration struct { - // `nominalConcurrencyShares` (NCS) contributes to the computation of the - // NominalConcurrencyLimit (NominalCL) of this level. - // This is the number of execution seats nominally reserved for this priority level. - // This DOES NOT limit the dispatching from this priority level - // but affects the other priority levels through the borrowing mechanism. - // The server's concurrency limit (ServerCL) is divided among all the - // priority levels in proportion to their NCS values: - // - // NominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) - // sum_ncs = sum[priority level k] NCS(k) - // - // Bigger numbers mean a larger nominal concurrency limit, - // at the expense of every other priority level. - // This field has a default value of zero. - // +optional - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty" protobuf:"varint,1,opt,name=nominalConcurrencyShares"` - // `lendablePercent` prescribes the fraction of the level's NominalCL that - // can be borrowed by other priority levels. This value of this - // field must be between 0 and 100, inclusive, and it defaults to 0. - // The number of seats that other levels can borrow from this level, known - // as this level's LendableConcurrencyLimit (LendableCL), is defined as follows. - // - // LendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 ) - // - // +optional - LendablePercent *int32 `json:"lendablePercent,omitempty" protobuf:"varint,2,opt,name=lendablePercent"` - // The `BorrowingCL` of an Exempt priority level is implicitly `ServerCL`. - // In other words, an exempt priority level - // has no meaningful limit on how much it borrows. - // There is no explicit representation of that here. -} - -// LimitResponse defines how to handle requests that can not be executed right now. -// +union -type LimitResponse struct { - // `type` is "Queue" or "Reject". - // "Queue" means that requests that can not be executed upon arrival - // are held in a queue until they can be executed or a queuing limit - // is reached. - // "Reject" means that requests that can not be executed upon arrival - // are rejected. - // Required. - // +unionDiscriminator - Type LimitResponseType `json:"type" protobuf:"bytes,1,opt,name=type"` - - // `queuing` holds the configuration parameters for queuing. - // This field may be non-empty only if `type` is `"Queue"`. - // +optional - Queuing *QueuingConfiguration `json:"queuing,omitempty" protobuf:"bytes,2,opt,name=queuing"` -} - -// LimitResponseType identifies how a Limited priority level handles a request that can not be executed right now -type LimitResponseType string - -// Supported limit responses. -const ( - // LimitResponseTypeQueue means that requests that can not be executed right now are queued until they can be executed or a queuing limit is hit - LimitResponseTypeQueue LimitResponseType = "Queue" - - // LimitResponseTypeReject means that requests that can not be executed right now are rejected - LimitResponseTypeReject LimitResponseType = "Reject" -) - -// QueuingConfiguration holds the configuration parameters for queuing -type QueuingConfiguration struct { - // `queues` is the number of queues for this priority level. The - // queues exist independently at each apiserver. The value must be - // positive. Setting it to 1 effectively precludes - // shufflesharding and thus makes the distinguisher method of - // associated flow schemas irrelevant. This field has a default - // value of 64. - // +optional - Queues int32 `json:"queues" protobuf:"varint,1,opt,name=queues"` - - // `handSize` is a small positive number that configures the - // shuffle sharding of requests into queues. When enqueuing a request - // at this priority level the request's flow identifier (a string - // pair) is hashed and the hash value is used to shuffle the list - // of queues and deal a hand of the size specified here. The - // request is put into one of the shortest queues in that hand. - // `handSize` must be no larger than `queues`, and should be - // significantly smaller (so that a few heavy flows do not - // saturate most of the queues). See the user-facing - // documentation for more extensive guidance on setting this - // field. This field has a default value of 8. - // +optional - HandSize int32 `json:"handSize" protobuf:"varint,2,opt,name=handSize"` - - // `queueLengthLimit` is the maximum number of requests allowed to - // be waiting in a given queue of this priority level at a time; - // excess requests are rejected. This value must be positive. If - // not specified, it will be defaulted to 50. - // +optional - QueueLengthLimit int32 `json:"queueLengthLimit" protobuf:"varint,3,opt,name=queueLengthLimit"` -} - -// PriorityLevelConfigurationConditionType is a valid value for PriorityLevelConfigurationStatusCondition.Type -type PriorityLevelConfigurationConditionType string - -// PriorityLevelConfigurationStatus represents the current state of a "request-priority". -type PriorityLevelConfigurationStatus struct { - // `conditions` is the current state of "request-priority". - // +listType=map - // +listMapKey=type - // +patchMergeKey=type - // +patchStrategy=merge - // +optional - Conditions []PriorityLevelConfigurationCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` -} - -// PriorityLevelConfigurationCondition defines the condition of priority level. -type PriorityLevelConfigurationCondition struct { - // `type` is the type of the condition. - // Required. - Type PriorityLevelConfigurationConditionType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` - // `status` is the status of the condition. - // Can be True, False, Unknown. - // Required. - Status ConditionStatus `json:"status,omitempty" protobuf:"bytes,2,opt,name=status"` - // `lastTransitionTime` is the last time the condition transitioned from one status to another. - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` - // `reason` is a unique, one-word, CamelCase reason for the condition's last transition. - Reason string `json:"reason,omitempty" protobuf:"bytes,4,opt,name=reason"` - // `message` is a human-readable message indicating details about last transition. - Message string `json:"message,omitempty" protobuf:"bytes,5,opt,name=message"` -} - -// ConditionStatus is the status of the condition. -type ConditionStatus string - -// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. -// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes -// can't decide if a resource is in the condition or not. In the future, we could add other -// intermediate conditions, e.g. ConditionDegraded. -const ( - ConditionTrue ConditionStatus = "True" - ConditionFalse ConditionStatus = "False" - ConditionUnknown ConditionStatus = "Unknown" -) diff --git a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go deleted file mode 100644 index b8cb436367a5..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/types_swagger_doc_generated.go +++ /dev/null @@ -1,274 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-codegen.sh - -// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. -var map_ExemptPriorityLevelConfiguration = map[string]string{ - "": "ExemptPriorityLevelConfiguration describes the configurable aspects of the handling of exempt requests. In the mandatory exempt configuration object the values in the fields here can be modified by authorized users, unlike the rest of the `spec`.", - "nominalConcurrencyShares": "`nominalConcurrencyShares` (NCS) contributes to the computation of the NominalConcurrencyLimit (NominalCL) of this level. This is the number of execution seats nominally reserved for this priority level. This DOES NOT limit the dispatching from this priority level but affects the other priority levels through the borrowing mechanism. The server's concurrency limit (ServerCL) is divided among all the priority levels in proportion to their NCS values:\n\nNominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)\n\nBigger numbers mean a larger nominal concurrency limit, at the expense of every other priority level. This field has a default value of zero.", - "lendablePercent": "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. This value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", -} - -func (ExemptPriorityLevelConfiguration) SwaggerDoc() map[string]string { - return map_ExemptPriorityLevelConfiguration -} - -var map_FlowDistinguisherMethod = map[string]string{ - "": "FlowDistinguisherMethod specifies the method of a flow distinguisher.", - "type": "`type` is the type of flow distinguisher method The supported types are \"ByUser\" and \"ByNamespace\". Required.", -} - -func (FlowDistinguisherMethod) SwaggerDoc() map[string]string { - return map_FlowDistinguisherMethod -} - -var map_FlowSchema = map[string]string{ - "": "FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a \"flow distinguisher\".", - "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` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - "status": "`status` is the current status of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", -} - -func (FlowSchema) SwaggerDoc() map[string]string { - return map_FlowSchema -} - -var map_FlowSchemaCondition = map[string]string{ - "": "FlowSchemaCondition describes conditions for a FlowSchema.", - "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", - "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", - "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", - "message": "`message` is a human-readable message indicating details about last transition.", -} - -func (FlowSchemaCondition) SwaggerDoc() map[string]string { - return map_FlowSchemaCondition -} - -var map_FlowSchemaList = map[string]string{ - "": "FlowSchemaList is a list of FlowSchema objects.", - "metadata": "`metadata` is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "items": "`items` is a list of FlowSchemas.", -} - -func (FlowSchemaList) SwaggerDoc() map[string]string { - return map_FlowSchemaList -} - -var map_FlowSchemaSpec = map[string]string{ - "": "FlowSchemaSpec describes how the FlowSchema's specification looks like.", - "priorityLevelConfiguration": "`priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.", - "matchingPrecedence": "`matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000]. Note that if the precedence is not specified, it will be set to 1000 as default.", - "distinguisherMethod": "`distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.", - "rules": "`rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.", -} - -func (FlowSchemaSpec) SwaggerDoc() map[string]string { - return map_FlowSchemaSpec -} - -var map_FlowSchemaStatus = map[string]string{ - "": "FlowSchemaStatus represents the current state of a FlowSchema.", - "conditions": "`conditions` is a list of the current states of FlowSchema.", -} - -func (FlowSchemaStatus) SwaggerDoc() map[string]string { - return map_FlowSchemaStatus -} - -var map_GroupSubject = map[string]string{ - "": "GroupSubject holds detailed information for group-kind subject.", - "name": "name is the user group that matches, or \"*\" to match all user groups. See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some well-known group names. Required.", -} - -func (GroupSubject) SwaggerDoc() map[string]string { - return map_GroupSubject -} - -var map_LimitResponse = map[string]string{ - "": "LimitResponse defines how to handle requests that can not be executed right now.", - "type": "`type` is \"Queue\" or \"Reject\". \"Queue\" means that requests that can not be executed upon arrival are held in a queue until they can be executed or a queuing limit is reached. \"Reject\" means that requests that can not be executed upon arrival are rejected. Required.", - "queuing": "`queuing` holds the configuration parameters for queuing. This field may be non-empty only if `type` is `\"Queue\"`.", -} - -func (LimitResponse) SwaggerDoc() map[string]string { - return map_LimitResponse -} - -var map_LimitedPriorityLevelConfiguration = map[string]string{ - "": "LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues:\n - How are requests for this priority level limited?\n - What should be done with requests that exceed the limit?", - "nominalConcurrencyShares": "`nominalConcurrencyShares` (NCS) contributes to the computation of the NominalConcurrencyLimit (NominalCL) of this level. This is the number of execution seats available at this priority level. This is used both for requests dispatched from this priority level as well as requests dispatched from other priority levels borrowing seats from this level. The server's concurrency limit (ServerCL) is divided among the Limited priority levels in proportion to their NCS values:\n\nNominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)\n\nBigger numbers mean a larger nominal concurrency limit, at the expense of every other priority level.\n\nIf not specified, this field defaults to a value of 30.\n\nSetting this field to zero supports the construction of a \"jail\" for this priority level that is used to hold some request(s)", - "limitResponse": "`limitResponse` indicates what to do with requests that can not be executed right now", - "lendablePercent": "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. The value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", - "borrowingLimitPercent": "`borrowingLimitPercent`, if present, configures a limit on how many seats this priority level can borrow from other priority levels. The limit is known as this level's BorrowingConcurrencyLimit (BorrowingCL) and is a limit on the total number of seats that this level may borrow at any one time. This field holds the ratio of that limit to the level's nominal concurrency limit. When this field is non-nil, it must hold a non-negative integer and the limit is calculated as follows.\n\nBorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 )\n\nThe value of this field can be more than 100, implying that this priority level can borrow a number of seats that is greater than its own nominal concurrency limit (NominalCL). When this field is left `nil`, the limit is effectively infinite.", -} - -func (LimitedPriorityLevelConfiguration) SwaggerDoc() map[string]string { - return map_LimitedPriorityLevelConfiguration -} - -var map_NonResourcePolicyRule = map[string]string{ - "": "NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.", - "verbs": "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs. If it is present, it must be the only entry. Required.", - "nonResourceURLs": "`nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. For example:\n - \"/healthz\" is legal\n - \"/hea*\" is illegal\n - \"/hea\" is legal but matches nothing\n - \"/hea/*\" also matches nothing\n - \"/healthz/*\" matches all per-component health checks.\n\"*\" matches all non-resource urls. if it is present, it must be the only entry. Required.", -} - -func (NonResourcePolicyRule) SwaggerDoc() map[string]string { - return map_NonResourcePolicyRule -} - -var map_PolicyRulesWithSubjects = map[string]string{ - "": "PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request.", - "subjects": "subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.", - "resourceRules": "`resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.", - "nonResourceRules": "`nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.", -} - -func (PolicyRulesWithSubjects) SwaggerDoc() map[string]string { - return map_PolicyRulesWithSubjects -} - -var map_PriorityLevelConfiguration = map[string]string{ - "": "PriorityLevelConfiguration represents the configuration of a priority level.", - "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` is the specification of the desired behavior of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - "status": "`status` is the current status of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", -} - -func (PriorityLevelConfiguration) SwaggerDoc() map[string]string { - return map_PriorityLevelConfiguration -} - -var map_PriorityLevelConfigurationCondition = map[string]string{ - "": "PriorityLevelConfigurationCondition defines the condition of priority level.", - "type": "`type` is the type of the condition. Required.", - "status": "`status` is the status of the condition. Can be True, False, Unknown. Required.", - "lastTransitionTime": "`lastTransitionTime` is the last time the condition transitioned from one status to another.", - "reason": "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", - "message": "`message` is a human-readable message indicating details about last transition.", -} - -func (PriorityLevelConfigurationCondition) SwaggerDoc() map[string]string { - return map_PriorityLevelConfigurationCondition -} - -var map_PriorityLevelConfigurationList = map[string]string{ - "": "PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.", - "metadata": "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "items": "`items` is a list of request-priorities.", -} - -func (PriorityLevelConfigurationList) SwaggerDoc() map[string]string { - return map_PriorityLevelConfigurationList -} - -var map_PriorityLevelConfigurationReference = map[string]string{ - "": "PriorityLevelConfigurationReference contains information that points to the \"request-priority\" being used.", - "name": "`name` is the name of the priority level configuration being referenced Required.", -} - -func (PriorityLevelConfigurationReference) SwaggerDoc() map[string]string { - return map_PriorityLevelConfigurationReference -} - -var map_PriorityLevelConfigurationSpec = map[string]string{ - "": "PriorityLevelConfigurationSpec specifies the configuration of a priority level.", - "type": "`type` indicates whether this priority level is subject to limitation on request execution. A value of `\"Exempt\"` means that requests of this priority level are not subject to a limit (and thus are never queued) and do not detract from the capacity made available to other priority levels. A value of `\"Limited\"` means that (a) requests of this priority level _are_ subject to limits and (b) some of the server's limited capacity is made available exclusively to this priority level. Required.", - "limited": "`limited` specifies how requests are handled for a Limited priority level. This field must be non-empty if and only if `type` is `\"Limited\"`.", - "exempt": "`exempt` specifies how requests are handled for an exempt priority level. This field MUST be empty if `type` is `\"Limited\"`. This field MAY be non-empty if `type` is `\"Exempt\"`. If empty and `type` is `\"Exempt\"` then the default values for `ExemptPriorityLevelConfiguration` apply.", -} - -func (PriorityLevelConfigurationSpec) SwaggerDoc() map[string]string { - return map_PriorityLevelConfigurationSpec -} - -var map_PriorityLevelConfigurationStatus = map[string]string{ - "": "PriorityLevelConfigurationStatus represents the current state of a \"request-priority\".", - "conditions": "`conditions` is the current state of \"request-priority\".", -} - -func (PriorityLevelConfigurationStatus) SwaggerDoc() map[string]string { - return map_PriorityLevelConfigurationStatus -} - -var map_QueuingConfiguration = map[string]string{ - "": "QueuingConfiguration holds the configuration parameters for queuing", - "queues": "`queues` is the number of queues for this priority level. The queues exist independently at each apiserver. The value must be positive. Setting it to 1 effectively precludes shufflesharding and thus makes the distinguisher method of associated flow schemas irrelevant. This field has a default value of 64.", - "handSize": "`handSize` is a small positive number that configures the shuffle sharding of requests into queues. When enqueuing a request at this priority level the request's flow identifier (a string pair) is hashed and the hash value is used to shuffle the list of queues and deal a hand of the size specified here. The request is put into one of the shortest queues in that hand. `handSize` must be no larger than `queues`, and should be significantly smaller (so that a few heavy flows do not saturate most of the queues). See the user-facing documentation for more extensive guidance on setting this field. This field has a default value of 8.", - "queueLengthLimit": "`queueLengthLimit` is the maximum number of requests allowed to be waiting in a given queue of this priority level at a time; excess requests are rejected. This value must be positive. If not specified, it will be defaulted to 50.", -} - -func (QueuingConfiguration) SwaggerDoc() map[string]string { - return map_QueuingConfiguration -} - -var map_ResourcePolicyRule = map[string]string{ - "": "ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) either (d1) the request does not specify a namespace (i.e., `Namespace==\"\"`) and clusterScope is true or (d2) the request specifies a namespace and least one member of namespaces matches the request's namespace.", - "verbs": "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs and, if present, must be the only entry. Required.", - "apiGroups": "`apiGroups` is a list of matching API groups and may not be empty. \"*\" matches all API groups and, if present, must be the only entry. Required.", - "resources": "`resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ \"services\", \"nodes/status\" ]. This list may not be empty. \"*\" matches all resources and, if present, must be the only entry. Required.", - "clusterScope": "`clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.", - "namespaces": "`namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains \"*\". Note that \"*\" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.", -} - -func (ResourcePolicyRule) SwaggerDoc() map[string]string { - return map_ResourcePolicyRule -} - -var map_ServiceAccountSubject = map[string]string{ - "": "ServiceAccountSubject holds detailed information for service-account-kind subject.", - "namespace": "`namespace` is the namespace of matching ServiceAccount objects. Required.", - "name": "`name` is the name of matching ServiceAccount objects, or \"*\" to match regardless of name. Required.", -} - -func (ServiceAccountSubject) SwaggerDoc() map[string]string { - return map_ServiceAccountSubject -} - -var map_Subject = map[string]string{ - "": "Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account.", - "kind": "`kind` indicates which one of the other fields is non-empty. Required", - "user": "`user` matches based on username.", - "group": "`group` matches based on user group name.", - "serviceAccount": "`serviceAccount` matches ServiceAccounts.", -} - -func (Subject) SwaggerDoc() map[string]string { - return map_Subject -} - -var map_UserSubject = map[string]string{ - "": "UserSubject holds detailed information for user-kind subject.", - "name": "`name` is the username that matches, or \"*\" to match all usernames. Required.", -} - -func (UserSubject) SwaggerDoc() map[string]string { - return map_UserSubject -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/zz_generated.deepcopy.go b/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/zz_generated.deepcopy.go deleted file mode 100644 index f37090b75b46..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/api/flowcontrol/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,588 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExemptPriorityLevelConfiguration) DeepCopyInto(out *ExemptPriorityLevelConfiguration) { - *out = *in - if in.NominalConcurrencyShares != nil { - in, out := &in.NominalConcurrencyShares, &out.NominalConcurrencyShares - *out = new(int32) - **out = **in - } - if in.LendablePercent != nil { - in, out := &in.LendablePercent, &out.LendablePercent - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExemptPriorityLevelConfiguration. -func (in *ExemptPriorityLevelConfiguration) DeepCopy() *ExemptPriorityLevelConfiguration { - if in == nil { - return nil - } - out := new(ExemptPriorityLevelConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FlowDistinguisherMethod) DeepCopyInto(out *FlowDistinguisherMethod) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowDistinguisherMethod. -func (in *FlowDistinguisherMethod) DeepCopy() *FlowDistinguisherMethod { - if in == nil { - return nil - } - out := new(FlowDistinguisherMethod) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FlowSchema) DeepCopyInto(out *FlowSchema) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchema. -func (in *FlowSchema) DeepCopy() *FlowSchema { - if in == nil { - return nil - } - out := new(FlowSchema) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FlowSchema) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FlowSchemaCondition) DeepCopyInto(out *FlowSchemaCondition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaCondition. -func (in *FlowSchemaCondition) DeepCopy() *FlowSchemaCondition { - if in == nil { - return nil - } - out := new(FlowSchemaCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FlowSchemaList) DeepCopyInto(out *FlowSchemaList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]FlowSchema, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaList. -func (in *FlowSchemaList) DeepCopy() *FlowSchemaList { - if in == nil { - return nil - } - out := new(FlowSchemaList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FlowSchemaList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FlowSchemaSpec) DeepCopyInto(out *FlowSchemaSpec) { - *out = *in - out.PriorityLevelConfiguration = in.PriorityLevelConfiguration - if in.DistinguisherMethod != nil { - in, out := &in.DistinguisherMethod, &out.DistinguisherMethod - *out = new(FlowDistinguisherMethod) - **out = **in - } - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]PolicyRulesWithSubjects, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaSpec. -func (in *FlowSchemaSpec) DeepCopy() *FlowSchemaSpec { - if in == nil { - return nil - } - out := new(FlowSchemaSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FlowSchemaStatus) DeepCopyInto(out *FlowSchemaStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]FlowSchemaCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FlowSchemaStatus. -func (in *FlowSchemaStatus) DeepCopy() *FlowSchemaStatus { - if in == nil { - return nil - } - out := new(FlowSchemaStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GroupSubject) DeepCopyInto(out *GroupSubject) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupSubject. -func (in *GroupSubject) DeepCopy() *GroupSubject { - if in == nil { - return nil - } - out := new(GroupSubject) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LimitResponse) DeepCopyInto(out *LimitResponse) { - *out = *in - if in.Queuing != nil { - in, out := &in.Queuing, &out.Queuing - *out = new(QueuingConfiguration) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitResponse. -func (in *LimitResponse) DeepCopy() *LimitResponse { - if in == nil { - return nil - } - out := new(LimitResponse) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LimitedPriorityLevelConfiguration) DeepCopyInto(out *LimitedPriorityLevelConfiguration) { - *out = *in - if in.NominalConcurrencyShares != nil { - in, out := &in.NominalConcurrencyShares, &out.NominalConcurrencyShares - *out = new(int32) - **out = **in - } - in.LimitResponse.DeepCopyInto(&out.LimitResponse) - if in.LendablePercent != nil { - in, out := &in.LendablePercent, &out.LendablePercent - *out = new(int32) - **out = **in - } - if in.BorrowingLimitPercent != nil { - in, out := &in.BorrowingLimitPercent, &out.BorrowingLimitPercent - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitedPriorityLevelConfiguration. -func (in *LimitedPriorityLevelConfiguration) DeepCopy() *LimitedPriorityLevelConfiguration { - if in == nil { - return nil - } - out := new(LimitedPriorityLevelConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NonResourcePolicyRule) DeepCopyInto(out *NonResourcePolicyRule) { - *out = *in - if in.Verbs != nil { - in, out := &in.Verbs, &out.Verbs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NonResourceURLs != nil { - in, out := &in.NonResourceURLs, &out.NonResourceURLs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NonResourcePolicyRule. -func (in *NonResourcePolicyRule) DeepCopy() *NonResourcePolicyRule { - if in == nil { - return nil - } - out := new(NonResourcePolicyRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicyRulesWithSubjects) DeepCopyInto(out *PolicyRulesWithSubjects) { - *out = *in - if in.Subjects != nil { - in, out := &in.Subjects, &out.Subjects - *out = make([]Subject, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ResourceRules != nil { - in, out := &in.ResourceRules, &out.ResourceRules - *out = make([]ResourcePolicyRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.NonResourceRules != nil { - in, out := &in.NonResourceRules, &out.NonResourceRules - *out = make([]NonResourcePolicyRule, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyRulesWithSubjects. -func (in *PolicyRulesWithSubjects) DeepCopy() *PolicyRulesWithSubjects { - if in == nil { - return nil - } - out := new(PolicyRulesWithSubjects) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PriorityLevelConfiguration) DeepCopyInto(out *PriorityLevelConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfiguration. -func (in *PriorityLevelConfiguration) DeepCopy() *PriorityLevelConfiguration { - if in == nil { - return nil - } - out := new(PriorityLevelConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PriorityLevelConfiguration) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PriorityLevelConfigurationCondition) DeepCopyInto(out *PriorityLevelConfigurationCondition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationCondition. -func (in *PriorityLevelConfigurationCondition) DeepCopy() *PriorityLevelConfigurationCondition { - if in == nil { - return nil - } - out := new(PriorityLevelConfigurationCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PriorityLevelConfigurationList) DeepCopyInto(out *PriorityLevelConfigurationList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PriorityLevelConfiguration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationList. -func (in *PriorityLevelConfigurationList) DeepCopy() *PriorityLevelConfigurationList { - if in == nil { - return nil - } - out := new(PriorityLevelConfigurationList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PriorityLevelConfigurationList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PriorityLevelConfigurationReference) DeepCopyInto(out *PriorityLevelConfigurationReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationReference. -func (in *PriorityLevelConfigurationReference) DeepCopy() *PriorityLevelConfigurationReference { - if in == nil { - return nil - } - out := new(PriorityLevelConfigurationReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PriorityLevelConfigurationSpec) DeepCopyInto(out *PriorityLevelConfigurationSpec) { - *out = *in - if in.Limited != nil { - in, out := &in.Limited, &out.Limited - *out = new(LimitedPriorityLevelConfiguration) - (*in).DeepCopyInto(*out) - } - if in.Exempt != nil { - in, out := &in.Exempt, &out.Exempt - *out = new(ExemptPriorityLevelConfiguration) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationSpec. -func (in *PriorityLevelConfigurationSpec) DeepCopy() *PriorityLevelConfigurationSpec { - if in == nil { - return nil - } - out := new(PriorityLevelConfigurationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PriorityLevelConfigurationStatus) DeepCopyInto(out *PriorityLevelConfigurationStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]PriorityLevelConfigurationCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PriorityLevelConfigurationStatus. -func (in *PriorityLevelConfigurationStatus) DeepCopy() *PriorityLevelConfigurationStatus { - if in == nil { - return nil - } - out := new(PriorityLevelConfigurationStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *QueuingConfiguration) DeepCopyInto(out *QueuingConfiguration) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QueuingConfiguration. -func (in *QueuingConfiguration) DeepCopy() *QueuingConfiguration { - if in == nil { - return nil - } - out := new(QueuingConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourcePolicyRule) DeepCopyInto(out *ResourcePolicyRule) { - *out = *in - if in.Verbs != nil { - in, out := &in.Verbs, &out.Verbs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.APIGroups != nil { - in, out := &in.APIGroups, &out.APIGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Namespaces != nil { - in, out := &in.Namespaces, &out.Namespaces - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourcePolicyRule. -func (in *ResourcePolicyRule) DeepCopy() *ResourcePolicyRule { - if in == nil { - return nil - } - out := new(ResourcePolicyRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceAccountSubject) DeepCopyInto(out *ServiceAccountSubject) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountSubject. -func (in *ServiceAccountSubject) DeepCopy() *ServiceAccountSubject { - if in == nil { - return nil - } - out := new(ServiceAccountSubject) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Subject) DeepCopyInto(out *Subject) { - *out = *in - if in.User != nil { - in, out := &in.User, &out.User - *out = new(UserSubject) - **out = **in - } - if in.Group != nil { - in, out := &in.Group, &out.Group - *out = new(GroupSubject) - **out = **in - } - if in.ServiceAccount != nil { - in, out := &in.ServiceAccount, &out.ServiceAccount - *out = new(ServiceAccountSubject) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subject. -func (in *Subject) DeepCopy() *Subject { - if in == nil { - return nil - } - out := new(Subject) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UserSubject) DeepCopyInto(out *UserSubject) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSubject. -func (in *UserSubject) DeepCopy() *UserSubject { - if in == nil { - return nil - } - out := new(UserSubject) - in.DeepCopyInto(out) - return out -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/LICENSE b/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/LICENSE deleted file mode 100644 index d64569567334..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/pkg/features/OWNERS b/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/pkg/features/OWNERS deleted file mode 100644 index 3e1dd9f081d6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/pkg/features/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - feature-approvers diff --git a/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go b/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go deleted file mode 100644 index 1844ed8d1eb4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiextensions-apiserver/pkg/features/kube_features.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 features - -import ( - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/component-base/featuregate" -) - -const ( - // Every feature gate should add method here following this template: - // - // // owner: @username - // // alpha: v1.4 - // MyFeature() bool - - // owner: @alexzielenski - // alpha: v1.28 - // - // Ignores errors raised on unchanged fields of Custom Resources - // across UPDATE/PATCH requests. - CRDValidationRatcheting featuregate.Feature = "CRDValidationRatcheting" -) - -func init() { - utilfeature.DefaultMutableFeatureGate.Add(defaultKubernetesFeatureGates) -} - -// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys. -// To add a new feature, define a key for it above and add it here. The features will be -// available throughout Kubernetes binaries. -var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{ - CRDValidationRatcheting: {Default: false, PreRelease: featuregate.Alpha}, -} diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/runtime/splice.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/runtime/splice.go deleted file mode 100644 index 2badb7b97f3a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/runtime/splice.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -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 runtime - -import ( - "bytes" - "io" -) - -// Splice is the interface that wraps the Splice method. -// -// Splice moves data from given slice without copying the underlying data for -// efficiency purpose. Therefore, the caller should make sure the underlying -// data is not changed later. -type Splice interface { - Splice([]byte) - io.Writer - Reset() - Bytes() []byte -} - -// A spliceBuffer implements Splice and io.Writer interfaces. -type spliceBuffer struct { - raw []byte - buf *bytes.Buffer -} - -func NewSpliceBuffer() Splice { - return &spliceBuffer{} -} - -// Splice implements the Splice interface. -func (sb *spliceBuffer) Splice(raw []byte) { - sb.raw = raw -} - -// Write implements the io.Writer interface. -func (sb *spliceBuffer) Write(p []byte) (n int, err error) { - if sb.buf == nil { - sb.buf = &bytes.Buffer{} - } - return sb.buf.Write(p) -} - -// Reset resets the buffer to be empty. -func (sb *spliceBuffer) Reset() { - if sb.buf != nil { - sb.buf.Reset() - } - sb.raw = nil -} - -// Bytes returns the data held by the buffer. -func (sb *spliceBuffer) Bytes() []byte { - if sb.buf != nil && len(sb.buf.Bytes()) > 0 { - return sb.buf.Bytes() - } - if sb.raw != nil { - return sb.raw - } - return []byte{} -} diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/dump/dump.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/dump/dump.go deleted file mode 100644 index cf61ef76aed3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/dump/dump.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -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 dump - -import ( - "github.com/davecgh/go-spew/spew" -) - -var prettyPrintConfig = &spew.ConfigState{ - Indent: " ", - DisableMethods: true, - DisablePointerAddresses: true, - DisableCapacities: true, -} - -// The config MUST NOT be changed because that could change the result of a hash operation -var prettyPrintConfigForHash = &spew.ConfigState{ - Indent: " ", - SortKeys: true, - DisableMethods: true, - SpewKeys: true, - DisablePointerAddresses: true, - DisableCapacities: true, -} - -// Pretty wrap the spew.Sdump with Indent, and disabled methods like error() and String() -// The output may change over time, so for guaranteed output please take more direct control -func Pretty(a interface{}) string { - return prettyPrintConfig.Sdump(a) -} - -// ForHash keeps the original Spew.Sprintf format to ensure the same checksum -func ForHash(a interface{}) string { - return prettyPrintConfigForHash.Sprintf("%#v", a) -} - -// OneLine outputs the object in one line -func OneLine(a interface{}) string { - return prettyPrintConfig.Sprintf("%#v", a) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/conn.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/conn.go deleted file mode 100644 index 7cfdd0632170..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/conn.go +++ /dev/null @@ -1,428 +0,0 @@ -/* -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 wsstream - -import ( - "encoding/base64" - "fmt" - "io" - "net/http" - "strings" - "time" - - "golang.org/x/net/websocket" - - "k8s.io/apimachinery/pkg/util/httpstream" - "k8s.io/apimachinery/pkg/util/remotecommand" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/klog/v2" -) - -const WebSocketProtocolHeader = "Sec-Websocket-Protocol" - -// The Websocket subprotocol "channel.k8s.io" prepends each binary message with a byte indicating -// the channel number (zero indexed) the message was sent on. Messages in both directions should -// prefix their messages with this channel byte. When used for remote execution, the channel numbers -// are by convention defined to match the POSIX file-descriptors assigned to STDIN, STDOUT, and STDERR -// (0, 1, and 2). No other conversion is performed on the raw subprotocol - writes are sent as they -// are received by the server. -// -// Example client session: -// -// CONNECT http://server.com with subprotocol "channel.k8s.io" -// WRITE []byte{0, 102, 111, 111, 10} # send "foo\n" on channel 0 (STDIN) -// READ []byte{1, 10} # receive "\n" on channel 1 (STDOUT) -// CLOSE -const ChannelWebSocketProtocol = "channel.k8s.io" - -// The Websocket subprotocol "base64.channel.k8s.io" base64 encodes each message with a character -// indicating the channel number (zero indexed) the message was sent on. Messages in both directions -// should prefix their messages with this channel char. When used for remote execution, the channel -// numbers are by convention defined to match the POSIX file-descriptors assigned to STDIN, STDOUT, -// and STDERR ('0', '1', and '2'). The data received on the server is base64 decoded (and must be -// be valid) and data written by the server to the client is base64 encoded. -// -// Example client session: -// -// CONNECT http://server.com with subprotocol "base64.channel.k8s.io" -// WRITE []byte{48, 90, 109, 57, 118, 67, 103, 111, 61} # send "foo\n" (base64: "Zm9vCgo=") on channel '0' (STDIN) -// READ []byte{49, 67, 103, 61, 61} # receive "\n" (base64: "Cg==") on channel '1' (STDOUT) -// CLOSE -const Base64ChannelWebSocketProtocol = "base64.channel.k8s.io" - -type codecType int - -const ( - rawCodec codecType = iota - base64Codec -) - -type ChannelType int - -const ( - IgnoreChannel ChannelType = iota - ReadChannel - WriteChannel - ReadWriteChannel -) - -// IsWebSocketRequest returns true if the incoming request contains connection upgrade headers -// for WebSockets. -func IsWebSocketRequest(req *http.Request) bool { - if !strings.EqualFold(req.Header.Get("Upgrade"), "websocket") { - return false - } - return httpstream.IsUpgradeRequest(req) -} - -// IsWebSocketRequestWithStreamCloseProtocol returns true if the request contains headers -// identifying that it is requesting a websocket upgrade with a remotecommand protocol -// version that supports the "CLOSE" signal; false otherwise. -func IsWebSocketRequestWithStreamCloseProtocol(req *http.Request) bool { - if !IsWebSocketRequest(req) { - return false - } - requestedProtocols := strings.TrimSpace(req.Header.Get(WebSocketProtocolHeader)) - for _, requestedProtocol := range strings.Split(requestedProtocols, ",") { - if protocolSupportsStreamClose(strings.TrimSpace(requestedProtocol)) { - return true - } - } - - return false -} - -// IgnoreReceives reads from a WebSocket until it is closed, then returns. If timeout is set, the -// read and write deadlines are pushed every time a new message is received. -func IgnoreReceives(ws *websocket.Conn, timeout time.Duration) { - defer runtime.HandleCrash() - var data []byte - for { - resetTimeout(ws, timeout) - if err := websocket.Message.Receive(ws, &data); err != nil { - return - } - } -} - -// handshake ensures the provided user protocol matches one of the allowed protocols. It returns -// no error if no protocol is specified. -func handshake(config *websocket.Config, req *http.Request, allowed []string) error { - protocols := config.Protocol - if len(protocols) == 0 { - protocols = []string{""} - } - - for _, protocol := range protocols { - for _, allow := range allowed { - if allow == protocol { - config.Protocol = []string{protocol} - return nil - } - } - } - - return fmt.Errorf("requested protocol(s) are not supported: %v; supports %v", config.Protocol, allowed) -} - -// ChannelProtocolConfig describes a websocket subprotocol with channels. -type ChannelProtocolConfig struct { - Binary bool - Channels []ChannelType -} - -// NewDefaultChannelProtocols returns a channel protocol map with the -// subprotocols "", "channel.k8s.io", "base64.channel.k8s.io" and the given -// channels. -func NewDefaultChannelProtocols(channels []ChannelType) map[string]ChannelProtocolConfig { - return map[string]ChannelProtocolConfig{ - "": {Binary: true, Channels: channels}, - ChannelWebSocketProtocol: {Binary: true, Channels: channels}, - Base64ChannelWebSocketProtocol: {Binary: false, Channels: channels}, - } -} - -// Conn supports sending multiple binary channels over a websocket connection. -type Conn struct { - protocols map[string]ChannelProtocolConfig - selectedProtocol string - channels []*websocketChannel - codec codecType - ready chan struct{} - ws *websocket.Conn - timeout time.Duration -} - -// NewConn creates a WebSocket connection that supports a set of channels. Channels begin each -// web socket message with a single byte indicating the channel number (0-N). 255 is reserved for -// future use. The channel types for each channel are passed as an array, supporting the different -// duplex modes. Read and Write refer to whether the channel can be used as a Reader or Writer. -// -// The protocols parameter maps subprotocol names to ChannelProtocols. The empty string subprotocol -// name is used if websocket.Config.Protocol is empty. -func NewConn(protocols map[string]ChannelProtocolConfig) *Conn { - return &Conn{ - ready: make(chan struct{}), - protocols: protocols, - } -} - -// SetIdleTimeout sets the interval for both reads and writes before timeout. If not specified, -// there is no timeout on the connection. -func (conn *Conn) SetIdleTimeout(duration time.Duration) { - conn.timeout = duration -} - -// SetWriteDeadline sets a timeout on writing to the websocket connection. The -// passed "duration" identifies how far into the future the write must complete -// by before the timeout fires. -func (conn *Conn) SetWriteDeadline(duration time.Duration) { - conn.ws.SetWriteDeadline(time.Now().Add(duration)) //nolint:errcheck -} - -// Open the connection and create channels for reading and writing. It returns -// the selected subprotocol, a slice of channels and an error. -func (conn *Conn) Open(w http.ResponseWriter, req *http.Request) (string, []io.ReadWriteCloser, error) { - // serveHTTPComplete is channel that is closed/selected when "websocket#ServeHTTP" finishes. - serveHTTPComplete := make(chan struct{}) - // Ensure panic in spawned goroutine is propagated into the parent goroutine. - panicChan := make(chan any, 1) - go func() { - // If websocket server returns, propagate panic if necessary. Otherwise, - // signal HTTPServe finished by closing "serveHTTPComplete". - defer func() { - if p := recover(); p != nil { - panicChan <- p - } else { - close(serveHTTPComplete) - } - }() - websocket.Server{Handshake: conn.handshake, Handler: conn.handle}.ServeHTTP(w, req) - }() - - // In normal circumstances, "websocket.Server#ServeHTTP" calls "initialize" which closes - // "conn.ready" and then blocks until serving is complete. - select { - case <-conn.ready: - klog.V(8).Infof("websocket server initialized--serving") - case <-serveHTTPComplete: - // websocket server returned before completing initialization; cleanup and return error. - conn.closeNonThreadSafe() //nolint:errcheck - return "", nil, fmt.Errorf("websocket server finished before becoming ready") - case p := <-panicChan: - panic(p) - } - - rwc := make([]io.ReadWriteCloser, len(conn.channels)) - for i := range conn.channels { - rwc[i] = conn.channels[i] - } - return conn.selectedProtocol, rwc, nil -} - -func (conn *Conn) initialize(ws *websocket.Conn) { - negotiated := ws.Config().Protocol - conn.selectedProtocol = negotiated[0] - p := conn.protocols[conn.selectedProtocol] - if p.Binary { - conn.codec = rawCodec - } else { - conn.codec = base64Codec - } - conn.ws = ws - conn.channels = make([]*websocketChannel, len(p.Channels)) - for i, t := range p.Channels { - switch t { - case ReadChannel: - conn.channels[i] = newWebsocketChannel(conn, byte(i), true, false) - case WriteChannel: - conn.channels[i] = newWebsocketChannel(conn, byte(i), false, true) - case ReadWriteChannel: - conn.channels[i] = newWebsocketChannel(conn, byte(i), true, true) - case IgnoreChannel: - conn.channels[i] = newWebsocketChannel(conn, byte(i), false, false) - } - } - - close(conn.ready) -} - -func (conn *Conn) handshake(config *websocket.Config, req *http.Request) error { - supportedProtocols := make([]string, 0, len(conn.protocols)) - for p := range conn.protocols { - supportedProtocols = append(supportedProtocols, p) - } - return handshake(config, req, supportedProtocols) -} - -func (conn *Conn) resetTimeout() { - if conn.timeout > 0 { - conn.ws.SetDeadline(time.Now().Add(conn.timeout)) - } -} - -// closeNonThreadSafe cleans up by closing streams and the websocket -// connection *without* waiting for the "ready" channel. -func (conn *Conn) closeNonThreadSafe() error { - for _, s := range conn.channels { - s.Close() - } - var err error - if conn.ws != nil { - err = conn.ws.Close() - } - return err -} - -// Close is only valid after Open has been called -func (conn *Conn) Close() error { - <-conn.ready - return conn.closeNonThreadSafe() -} - -// protocolSupportsStreamClose returns true if the passed protocol -// supports the stream close signal (currently only V5 remotecommand); -// false otherwise. -func protocolSupportsStreamClose(protocol string) bool { - return protocol == remotecommand.StreamProtocolV5Name -} - -// handle implements a websocket handler. -func (conn *Conn) handle(ws *websocket.Conn) { - conn.initialize(ws) - defer conn.Close() - supportsStreamClose := protocolSupportsStreamClose(conn.selectedProtocol) - - for { - conn.resetTimeout() - var data []byte - if err := websocket.Message.Receive(ws, &data); err != nil { - if err != io.EOF { - klog.Errorf("Error on socket receive: %v", err) - } - break - } - if len(data) == 0 { - continue - } - if supportsStreamClose && data[0] == remotecommand.StreamClose { - if len(data) != 2 { - klog.Errorf("Single channel byte should follow stream close signal. Got %d bytes", len(data)-1) - break - } else { - channel := data[1] - if int(channel) >= len(conn.channels) { - klog.Errorf("Close is targeted for a channel %d that is not valid, possible protocol error", channel) - break - } - klog.V(4).Infof("Received half-close signal from client; close %d stream", channel) - conn.channels[channel].Close() // After first Close, other closes are noop. - } - continue - } - channel := data[0] - if conn.codec == base64Codec { - channel = channel - '0' - } - data = data[1:] - if int(channel) >= len(conn.channels) { - klog.V(6).Infof("Frame is targeted for a reader %d that is not valid, possible protocol error", channel) - continue - } - if _, err := conn.channels[channel].DataFromSocket(data); err != nil { - klog.Errorf("Unable to write frame to %d: %v\n%s", channel, err, string(data)) - continue - } - } -} - -// write multiplexes the specified channel onto the websocket -func (conn *Conn) write(num byte, data []byte) (int, error) { - conn.resetTimeout() - switch conn.codec { - case rawCodec: - frame := make([]byte, len(data)+1) - frame[0] = num - copy(frame[1:], data) - if err := websocket.Message.Send(conn.ws, frame); err != nil { - return 0, err - } - case base64Codec: - frame := string('0'+num) + base64.StdEncoding.EncodeToString(data) - if err := websocket.Message.Send(conn.ws, frame); err != nil { - return 0, err - } - } - return len(data), nil -} - -// websocketChannel represents a channel in a connection -type websocketChannel struct { - conn *Conn - num byte - r io.Reader - w io.WriteCloser - - read, write bool -} - -// newWebsocketChannel creates a pipe for writing to a websocket. Do not write to this pipe -// prior to the connection being opened. It may be no, half, or full duplex depending on -// read and write. -func newWebsocketChannel(conn *Conn, num byte, read, write bool) *websocketChannel { - r, w := io.Pipe() - return &websocketChannel{conn, num, r, w, read, write} -} - -func (p *websocketChannel) Write(data []byte) (int, error) { - if !p.write { - return len(data), nil - } - return p.conn.write(p.num, data) -} - -// DataFromSocket is invoked by the connection receiver to move data from the connection -// into a specific channel. -func (p *websocketChannel) DataFromSocket(data []byte) (int, error) { - if !p.read { - return len(data), nil - } - - switch p.conn.codec { - case rawCodec: - return p.w.Write(data) - case base64Codec: - dst := make([]byte, len(data)) - n, err := base64.StdEncoding.Decode(dst, data) - if err != nil { - return 0, err - } - return p.w.Write(dst[:n]) - } - return 0, nil -} - -func (p *websocketChannel) Read(data []byte) (int, error) { - if !p.read { - return 0, io.EOF - } - return p.r.Read(data) -} - -func (p *websocketChannel) Close() error { - return p.w.Close() -} diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/doc.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/doc.go deleted file mode 100644 index 3dd6f828b706..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/doc.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 wsstream contains utilities for streaming content over WebSockets. -// The Conn type allows callers to multiplex multiple read/write channels over -// a single websocket. -// -// "channel.k8s.io" -// -// The Websocket RemoteCommand subprotocol "channel.k8s.io" prepends each binary message with a -// byte indicating the channel number (zero indexed) the message was sent on. Messages in both -// directions should prefix their messages with this channel byte. Used for remote execution, -// the channel numbers are by convention defined to match the POSIX file-descriptors assigned -// to STDIN, STDOUT, and STDERR (0, 1, and 2). No other conversion is performed on the raw -// subprotocol - writes are sent as they are received by the server. -// -// Example client session: -// -// CONNECT http://server.com with subprotocol "channel.k8s.io" -// WRITE []byte{0, 102, 111, 111, 10} # send "foo\n" on channel 0 (STDIN) -// READ []byte{1, 10} # receive "\n" on channel 1 (STDOUT) -// CLOSE -// -// "v2.channel.k8s.io" -// -// The second Websocket subprotocol version "v2.channel.k8s.io" is the same as version 1, -// but it is the first "versioned" subprotocol. -// -// "v3.channel.k8s.io" -// -// The third version of the Websocket RemoteCommand subprotocol adds another channel -// for terminal resizing events. This channel is prepended with the byte '3', and it -// transmits two window sizes (encoding TerminalSize struct) with integers in the range -// (0,65536]. -// -// "v4.channel.k8s.io" -// -// The fourth version of the Websocket RemoteCommand subprotocol adds a channel for -// errors. This channel returns structured errors containing process exit codes. The -// error is "apierrors.StatusError{}". -// -// "v5.channel.k8s.io" -// -// The fifth version of the Websocket RemoteCommand subprotocol adds a CLOSE signal, -// which is sent as the first byte of the message. The second byte is the channel -// id. This CLOSE signal is handled by the websocket server by closing the stream, -// allowing the other streams to complete transmission if necessary, and gracefully -// shutdown the connection. -// -// Example client session: -// -// CONNECT http://server.com with subprotocol "v5.channel.k8s.io" -// WRITE []byte{0, 102, 111, 111, 10} # send "foo\n" on channel 0 (STDIN) -// WRITE []byte{255, 0} # send CLOSE signal (STDIN) -// CLOSE -package wsstream // import "k8s.io/apimachinery/pkg/util/httpstream/wsstream" diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/stream.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/stream.go deleted file mode 100644 index ba7e6a519af0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/stream.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -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 wsstream - -import ( - "encoding/base64" - "io" - "net/http" - "sync" - "time" - - "golang.org/x/net/websocket" - - "k8s.io/apimachinery/pkg/util/runtime" -) - -// The WebSocket subprotocol "binary.k8s.io" will only send messages to the -// client and ignore messages sent to the server. The received messages are -// the exact bytes written to the stream. Zero byte messages are possible. -const binaryWebSocketProtocol = "binary.k8s.io" - -// The WebSocket subprotocol "base64.binary.k8s.io" will only send messages to the -// client and ignore messages sent to the server. The received messages are -// a base64 version of the bytes written to the stream. Zero byte messages are -// possible. -const base64BinaryWebSocketProtocol = "base64.binary.k8s.io" - -// ReaderProtocolConfig describes a websocket subprotocol with one stream. -type ReaderProtocolConfig struct { - Binary bool -} - -// NewDefaultReaderProtocols returns a stream protocol map with the -// subprotocols "", "channel.k8s.io", "base64.channel.k8s.io". -func NewDefaultReaderProtocols() map[string]ReaderProtocolConfig { - return map[string]ReaderProtocolConfig{ - "": {Binary: true}, - binaryWebSocketProtocol: {Binary: true}, - base64BinaryWebSocketProtocol: {Binary: false}, - } -} - -// Reader supports returning an arbitrary byte stream over a websocket channel. -type Reader struct { - err chan error - r io.Reader - ping bool - timeout time.Duration - protocols map[string]ReaderProtocolConfig - selectedProtocol string - - handleCrash func(additionalHandlers ...func(interface{})) // overridable for testing -} - -// NewReader creates a WebSocket pipe that will copy the contents of r to a provided -// WebSocket connection. If ping is true, a zero length message will be sent to the client -// before the stream begins reading. -// -// The protocols parameter maps subprotocol names to StreamProtocols. The empty string -// subprotocol name is used if websocket.Config.Protocol is empty. -func NewReader(r io.Reader, ping bool, protocols map[string]ReaderProtocolConfig) *Reader { - return &Reader{ - r: r, - err: make(chan error), - ping: ping, - protocols: protocols, - handleCrash: runtime.HandleCrash, - } -} - -// SetIdleTimeout sets the interval for both reads and writes before timeout. If not specified, -// there is no timeout on the reader. -func (r *Reader) SetIdleTimeout(duration time.Duration) { - r.timeout = duration -} - -func (r *Reader) handshake(config *websocket.Config, req *http.Request) error { - supportedProtocols := make([]string, 0, len(r.protocols)) - for p := range r.protocols { - supportedProtocols = append(supportedProtocols, p) - } - return handshake(config, req, supportedProtocols) -} - -// Copy the reader to the response. The created WebSocket is closed after this -// method completes. -func (r *Reader) Copy(w http.ResponseWriter, req *http.Request) error { - go func() { - defer r.handleCrash() - websocket.Server{Handshake: r.handshake, Handler: r.handle}.ServeHTTP(w, req) - }() - return <-r.err -} - -// handle implements a WebSocket handler. -func (r *Reader) handle(ws *websocket.Conn) { - // Close the connection when the client requests it, or when we finish streaming, whichever happens first - closeConnOnce := &sync.Once{} - closeConn := func() { - closeConnOnce.Do(func() { - ws.Close() - }) - } - - negotiated := ws.Config().Protocol - r.selectedProtocol = negotiated[0] - defer close(r.err) - defer closeConn() - - go func() { - defer runtime.HandleCrash() - // This blocks until the connection is closed. - // Client should not send anything. - IgnoreReceives(ws, r.timeout) - // Once the client closes, we should also close - closeConn() - }() - - r.err <- messageCopy(ws, r.r, !r.protocols[r.selectedProtocol].Binary, r.ping, r.timeout) -} - -func resetTimeout(ws *websocket.Conn, timeout time.Duration) { - if timeout > 0 { - ws.SetDeadline(time.Now().Add(timeout)) - } -} - -func messageCopy(ws *websocket.Conn, r io.Reader, base64Encode, ping bool, timeout time.Duration) error { - buf := make([]byte, 2048) - if ping { - resetTimeout(ws, timeout) - if base64Encode { - if err := websocket.Message.Send(ws, ""); err != nil { - return err - } - } else { - if err := websocket.Message.Send(ws, []byte{}); err != nil { - return err - } - } - } - for { - resetTimeout(ws, timeout) - n, err := r.Read(buf) - if err != nil { - if err == io.EOF { - return nil - } - return err - } - if n > 0 { - if base64Encode { - if err := websocket.Message.Send(ws, base64.StdEncoding.EncodeToString(buf[:n])); err != nil { - return err - } - } else { - if err := websocket.Message.Send(ws, buf[:n]); err != nil { - return err - } - } - } - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versioncheck.go b/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versioncheck.go deleted file mode 100644 index ee1e2bca7017..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apimachinery/pkg/util/managedfields/internal/versioncheck.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -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 internal - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -type versionCheckManager struct { - fieldManager Manager - gvk schema.GroupVersionKind -} - -var _ Manager = &versionCheckManager{} - -// NewVersionCheckManager creates a manager that makes sure that the -// applied object is in the proper version. -func NewVersionCheckManager(fieldManager Manager, gvk schema.GroupVersionKind) Manager { - return &versionCheckManager{fieldManager: fieldManager, gvk: gvk} -} - -// Update implements Manager. -func (f *versionCheckManager) Update(liveObj, newObj runtime.Object, managed Managed, manager string) (runtime.Object, Managed, error) { - // Nothing to do for updates, this is checked in many other places. - return f.fieldManager.Update(liveObj, newObj, managed, manager) -} - -// Apply implements Manager. -func (f *versionCheckManager) Apply(liveObj, appliedObj runtime.Object, managed Managed, fieldManager string, force bool) (runtime.Object, Managed, error) { - if gvk := appliedObj.GetObjectKind().GroupVersionKind(); gvk != f.gvk { - return nil, nil, errors.NewBadRequest(fmt.Sprintf("invalid object type: %v", gvk)) - } - return f.fieldManager.Apply(liveObj, appliedObj, managed, fieldManager, force) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go deleted file mode 100644 index 646c640fcaea..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/cel/composition.go +++ /dev/null @@ -1,244 +0,0 @@ -/* -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 cel - -import ( - "context" - "math" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - v1 "k8s.io/api/admission/v1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/version" - "k8s.io/apiserver/pkg/admission" - apiservercel "k8s.io/apiserver/pkg/cel" - "k8s.io/apiserver/pkg/cel/environment" - "k8s.io/apiserver/pkg/cel/lazy" -) - -const VariablesTypeName = "kubernetes.variables" - -type CompositedCompiler struct { - Compiler - FilterCompiler - - CompositionEnv *CompositionEnv -} - -type CompositedFilter struct { - Filter - - compositionEnv *CompositionEnv -} - -func NewCompositedCompiler(envSet *environment.EnvSet) (*CompositedCompiler, error) { - compositionContext, err := NewCompositionEnv(VariablesTypeName, envSet) - if err != nil { - return nil, err - } - compiler := NewCompiler(compositionContext.EnvSet) - filterCompiler := NewFilterCompiler(compositionContext.EnvSet) - return &CompositedCompiler{ - Compiler: compiler, - FilterCompiler: filterCompiler, - CompositionEnv: compositionContext, - }, nil -} - -func (c *CompositedCompiler) CompileAndStoreVariables(variables []NamedExpressionAccessor, options OptionalVariableDeclarations, mode environment.Type) { - for _, v := range variables { - _ = c.CompileAndStoreVariable(v, options, mode) - } -} - -func (c *CompositedCompiler) CompileAndStoreVariable(variable NamedExpressionAccessor, options OptionalVariableDeclarations, mode environment.Type) CompilationResult { - result := c.Compiler.CompileCELExpression(variable, options, mode) - c.CompositionEnv.AddField(variable.GetName(), result.OutputType) - c.CompositionEnv.CompiledVariables[variable.GetName()] = result - return result -} - -func (c *CompositedCompiler) Compile(expressions []ExpressionAccessor, optionalDecls OptionalVariableDeclarations, envType environment.Type) Filter { - filter := c.FilterCompiler.Compile(expressions, optionalDecls, envType) - return &CompositedFilter{ - Filter: filter, - compositionEnv: c.CompositionEnv, - } -} - -type CompositionEnv struct { - *environment.EnvSet - - MapType *apiservercel.DeclType - CompiledVariables map[string]CompilationResult -} - -func (c *CompositionEnv) AddField(name string, celType *cel.Type) { - c.MapType.Fields[name] = apiservercel.NewDeclField(name, convertCelTypeToDeclType(celType), true, nil, nil) -} - -func NewCompositionEnv(typeName string, baseEnvSet *environment.EnvSet) (*CompositionEnv, error) { - declType := apiservercel.NewObjectType(typeName, map[string]*apiservercel.DeclField{}) - envSet, err := baseEnvSet.Extend(environment.VersionedOptions{ - // set to 1.0 because composition is one of the fundamental components - IntroducedVersion: version.MajorMinor(1, 0), - EnvOptions: []cel.EnvOption{ - cel.Variable("variables", declType.CelType()), - }, - DeclTypes: []*apiservercel.DeclType{ - declType, - }, - }) - if err != nil { - return nil, err - } - return &CompositionEnv{ - MapType: declType, - EnvSet: envSet, - CompiledVariables: map[string]CompilationResult{}, - }, nil -} - -func (c *CompositionEnv) CreateContext(parent context.Context) CompositionContext { - return &compositionContext{ - Context: parent, - compositionEnv: c, - } -} - -type CompositionContext interface { - context.Context - Variables(activation any) ref.Val - GetAndResetCost() int64 -} - -type compositionContext struct { - context.Context - - compositionEnv *CompositionEnv - accumulatedCost int64 -} - -func (c *compositionContext) Variables(activation any) ref.Val { - lazyMap := lazy.NewMapValue(c.compositionEnv.MapType) - for name, result := range c.compositionEnv.CompiledVariables { - accessor := &variableAccessor{ - name: name, - result: result, - activation: activation, - context: c, - } - lazyMap.Append(name, accessor.Callback) - } - return lazyMap -} - -func (f *CompositedFilter) ForInput(ctx context.Context, versionedAttr *admission.VersionedAttributes, request *v1.AdmissionRequest, optionalVars OptionalVariableBindings, namespace *corev1.Namespace, runtimeCELCostBudget int64) ([]EvaluationResult, int64, error) { - ctx = f.compositionEnv.CreateContext(ctx) - return f.Filter.ForInput(ctx, versionedAttr, request, optionalVars, namespace, runtimeCELCostBudget) -} - -func (c *compositionContext) reportCost(cost int64) { - c.accumulatedCost += cost -} - -func (c *compositionContext) GetAndResetCost() int64 { - cost := c.accumulatedCost - c.accumulatedCost = 0 - return cost -} - -type variableAccessor struct { - name string - result CompilationResult - activation any - context *compositionContext -} - -func (a *variableAccessor) Callback(_ *lazy.MapValue) ref.Val { - if a.result.Error != nil { - return types.NewErr("composited variable %q fails to compile: %v", a.name, a.result.Error) - } - - v, details, err := a.result.Program.Eval(a.activation) - if details == nil { - return types.NewErr("unable to get evaluation details of variable %q", a.name) - } - costPtr := details.ActualCost() - if costPtr == nil { - return types.NewErr("unable to calculate cost of variable %q", a.name) - } - cost := int64(*costPtr) - if *costPtr > math.MaxInt64 { - cost = math.MaxInt64 - } - a.context.reportCost(cost) - - if err != nil { - return types.NewErr("composited variable %q fails to evaluate: %v", a.name, err) - } - return v -} - -// convertCelTypeToDeclType converts a cel.Type to DeclType, for the use of -// the TypeProvider and the cost estimator. -// List and map types are created on-demand with their parameters converted recursively. -func convertCelTypeToDeclType(celType *cel.Type) *apiservercel.DeclType { - if celType == nil { - return apiservercel.DynType - } - switch celType { - case cel.AnyType: - return apiservercel.AnyType - case cel.BoolType: - return apiservercel.BoolType - case cel.BytesType: - return apiservercel.BytesType - case cel.DoubleType: - return apiservercel.DoubleType - case cel.DurationType: - return apiservercel.DurationType - case cel.IntType: - return apiservercel.IntType - case cel.NullType: - return apiservercel.NullType - case cel.StringType: - return apiservercel.StringType - case cel.TimestampType: - return apiservercel.TimestampType - case cel.UintType: - return apiservercel.UintType - default: - if celType.HasTrait(traits.ContainerType) && celType.HasTrait(traits.IndexerType) { - parameters := celType.Parameters() - switch len(parameters) { - case 1: - elemType := convertCelTypeToDeclType(parameters[0]) - return apiservercel.NewListType(elemType, -1) - case 2: - keyType := convertCelTypeToDeclType(parameters[0]) - valueType := convertCelTypeToDeclType(parameters[1]) - return apiservercel.NewMapType(keyType, valueType, -1) - } - } - return apiservercel.DynType - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/caching_authorizer.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/caching_authorizer.go deleted file mode 100644 index a295cb30dc02..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/caching_authorizer.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -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 validatingadmissionpolicy - -import ( - "context" - "encoding/json" - "sort" - "strings" - - "k8s.io/apiserver/pkg/authentication/user" - "k8s.io/apiserver/pkg/authorization/authorizer" -) - -type authzResult struct { - authorized authorizer.Decision - reason string - err error -} - -type cachingAuthorizer struct { - authorizer authorizer.Authorizer - decisions map[string]authzResult -} - -func newCachingAuthorizer(in authorizer.Authorizer) authorizer.Authorizer { - return &cachingAuthorizer{ - authorizer: in, - decisions: make(map[string]authzResult), - } -} - -// The attribute accessors known to cache key construction. If this fails to compile, the cache -// implementation may need to be updated. -var _ authorizer.Attributes = (interface { - GetUser() user.Info - GetVerb() string - IsReadOnly() bool - GetNamespace() string - GetResource() string - GetSubresource() string - GetName() string - GetAPIGroup() string - GetAPIVersion() string - IsResourceRequest() bool - GetPath() string -})(nil) - -// The user info accessors known to cache key construction. If this fails to compile, the cache -// implementation may need to be updated. -var _ user.Info = (interface { - GetName() string - GetUID() string - GetGroups() []string - GetExtra() map[string][]string -})(nil) - -// Authorize returns an authorization decision by delegating to another Authorizer. If an equivalent -// check has already been performed, a cached result is returned. Not safe for concurrent use. -func (ca *cachingAuthorizer) Authorize(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) { - serializableAttributes := authorizer.AttributesRecord{ - Verb: a.GetVerb(), - Namespace: a.GetNamespace(), - APIGroup: a.GetAPIGroup(), - APIVersion: a.GetAPIVersion(), - Resource: a.GetResource(), - Subresource: a.GetSubresource(), - Name: a.GetName(), - ResourceRequest: a.IsResourceRequest(), - Path: a.GetPath(), - } - - if u := a.GetUser(); u != nil { - di := &user.DefaultInfo{ - Name: u.GetName(), - UID: u.GetUID(), - } - - // Differently-ordered groups or extras could cause otherwise-equivalent checks to - // have distinct cache keys. - if groups := u.GetGroups(); len(groups) > 0 { - di.Groups = make([]string, len(groups)) - copy(di.Groups, groups) - sort.Strings(di.Groups) - } - - if extra := u.GetExtra(); len(extra) > 0 { - di.Extra = make(map[string][]string, len(extra)) - for k, vs := range extra { - vdupe := make([]string, len(vs)) - copy(vdupe, vs) - sort.Strings(vdupe) - di.Extra[k] = vdupe - } - } - - serializableAttributes.User = di - } - - var b strings.Builder - if err := json.NewEncoder(&b).Encode(serializableAttributes); err != nil { - return authorizer.DecisionNoOpinion, "", err - } - key := b.String() - - if cached, ok := ca.decisions[key]; ok { - return cached.authorized, cached.reason, cached.err - } - - authorized, reason, err := ca.authorizer.Authorize(ctx, a) - - ca.decisions[key] = authzResult{ - authorized: authorized, - reason: reason, - err: err, - } - - return authorized, reason, err -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/defaults.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/defaults.go deleted file mode 100644 index a9af01fe76cd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/apiserver/v1alpha1/defaults.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -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 v1alpha1 - -import ( - "time" - - "k8s.io/apimachinery/pkg/runtime" -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} - -func SetDefaults_WebhookConfiguration(obj *WebhookConfiguration) { - if obj.AuthorizedTTL.Duration == 0 { - obj.AuthorizedTTL.Duration = 5 * time.Minute - } - if obj.UnauthorizedTTL.Duration == 0 { - obj.UnauthorizedTTL.Duration = 30 * time.Second - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go deleted file mode 100644 index 7b22a200f96f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go +++ /dev/null @@ -1,628 +0,0 @@ -/* -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 validation - -import ( - "errors" - "fmt" - "net/url" - "os" - "path/filepath" - "strings" - "time" - - v1 "k8s.io/api/authorization/v1" - "k8s.io/api/authorization/v1beta1" - "k8s.io/apimachinery/pkg/util/sets" - utilvalidation "k8s.io/apimachinery/pkg/util/validation" - "k8s.io/apimachinery/pkg/util/validation/field" - api "k8s.io/apiserver/pkg/apis/apiserver" - authenticationcel "k8s.io/apiserver/pkg/authentication/cel" - authorizationcel "k8s.io/apiserver/pkg/authorization/cel" - "k8s.io/apiserver/pkg/cel" - "k8s.io/apiserver/pkg/cel/environment" - "k8s.io/apiserver/pkg/features" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/client-go/util/cert" -) - -const ( - atLeastOneRequiredErrFmt = "at least one %s is required" -) - -var ( - root = field.NewPath("jwt") -) - -// ValidateAuthenticationConfiguration validates a given AuthenticationConfiguration. -func ValidateAuthenticationConfiguration(c *api.AuthenticationConfiguration) field.ErrorList { - var allErrs field.ErrorList - - // This stricter validation is solely based on what the current implementation supports. - // TODO(aramase): when StructuredAuthenticationConfiguration feature gate is added and wired up, - // relax this check to allow 0 authenticators. This will allow us to support the case where - // API server is initially configured with no authenticators and then authenticators are added - // later via dynamic config. - if len(c.JWT) == 0 { - allErrs = append(allErrs, field.Required(root, fmt.Sprintf(atLeastOneRequiredErrFmt, root))) - return allErrs - } - - // This stricter validation is because the --oidc-* flag option is singular. - // TODO(aramase): when StructuredAuthenticationConfiguration feature gate is added and wired up, - // remove the 1 authenticator limit check and add set the limit to 64. - if len(c.JWT) > 1 { - allErrs = append(allErrs, field.TooMany(root, len(c.JWT), 1)) - return allErrs - } - - // TODO(aramase): right now we only support a single JWT authenticator as - // this is wired to the --oidc-* flags. When StructuredAuthenticationConfiguration - // feature gate is added and wired up, we will remove the 1 authenticator limit - // check and add validation for duplicate issuers. - for i, a := range c.JWT { - fldPath := root.Index(i) - _, errs := validateJWTAuthenticator(a, fldPath, utilfeature.DefaultFeatureGate.Enabled(features.StructuredAuthenticationConfiguration)) - allErrs = append(allErrs, errs...) - } - - return allErrs -} - -// CompileAndValidateJWTAuthenticator validates a given JWTAuthenticator and returns a CELMapper with the compiled -// CEL expressions for claim mappings and validation rules. -// This is exported for use in oidc package. -func CompileAndValidateJWTAuthenticator(authenticator api.JWTAuthenticator) (authenticationcel.CELMapper, field.ErrorList) { - return validateJWTAuthenticator(authenticator, nil, utilfeature.DefaultFeatureGate.Enabled(features.StructuredAuthenticationConfiguration)) -} - -func validateJWTAuthenticator(authenticator api.JWTAuthenticator, fldPath *field.Path, structuredAuthnFeatureEnabled bool) (authenticationcel.CELMapper, field.ErrorList) { - var allErrs field.ErrorList - - compiler := authenticationcel.NewCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion())) - mapper := &authenticationcel.CELMapper{} - - allErrs = append(allErrs, validateIssuer(authenticator.Issuer, fldPath.Child("issuer"))...) - allErrs = append(allErrs, validateClaimValidationRules(compiler, mapper, authenticator.ClaimValidationRules, fldPath.Child("claimValidationRules"), structuredAuthnFeatureEnabled)...) - allErrs = append(allErrs, validateClaimMappings(compiler, mapper, authenticator.ClaimMappings, fldPath.Child("claimMappings"), structuredAuthnFeatureEnabled)...) - allErrs = append(allErrs, validateUserValidationRules(compiler, mapper, authenticator.UserValidationRules, fldPath.Child("userValidationRules"), structuredAuthnFeatureEnabled)...) - - return *mapper, allErrs -} - -func validateIssuer(issuer api.Issuer, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - allErrs = append(allErrs, validateURL(issuer.URL, fldPath.Child("url"))...) - allErrs = append(allErrs, validateAudiences(issuer.Audiences, fldPath.Child("audiences"))...) - allErrs = append(allErrs, validateCertificateAuthority(issuer.CertificateAuthority, fldPath.Child("certificateAuthority"))...) - - return allErrs -} - -func validateURL(issuerURL string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if len(issuerURL) == 0 { - allErrs = append(allErrs, field.Required(fldPath, "URL is required")) - return allErrs - } - - u, err := url.Parse(issuerURL) - if err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, issuerURL, err.Error())) - return allErrs - } - if u.Scheme != "https" { - allErrs = append(allErrs, field.Invalid(fldPath, issuerURL, "URL scheme must be https")) - } - if u.User != nil { - allErrs = append(allErrs, field.Invalid(fldPath, issuerURL, "URL must not contain a username or password")) - } - if len(u.RawQuery) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath, issuerURL, "URL must not contain a query")) - } - if len(u.Fragment) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath, issuerURL, "URL must not contain a fragment")) - } - - return allErrs -} - -func validateAudiences(audiences []string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if len(audiences) == 0 { - allErrs = append(allErrs, field.Required(fldPath, fmt.Sprintf(atLeastOneRequiredErrFmt, fldPath))) - return allErrs - } - // This stricter validation is because the --oidc-client-id flag option is singular. - // This will be removed when we support multiple audiences with the StructuredAuthenticationConfiguration feature gate. - if len(audiences) > 1 { - allErrs = append(allErrs, field.TooMany(fldPath, len(audiences), 1)) - return allErrs - } - - for i, audience := range audiences { - fldPath := fldPath.Index(i) - if len(audience) == 0 { - allErrs = append(allErrs, field.Required(fldPath, "audience can't be empty")) - } - } - - return allErrs -} - -func validateCertificateAuthority(certificateAuthority string, fldPath *field.Path) field.ErrorList { - var allErrs field.ErrorList - - if len(certificateAuthority) == 0 { - return allErrs - } - _, err := cert.NewPoolFromBytes([]byte(certificateAuthority)) - if err != nil { - allErrs = append(allErrs, field.Invalid(fldPath, "", err.Error())) - } - - return allErrs -} - -func validateClaimValidationRules(compiler authenticationcel.Compiler, celMapper *authenticationcel.CELMapper, rules []api.ClaimValidationRule, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList { - var allErrs field.ErrorList - - seenClaims := sets.NewString() - seenExpressions := sets.NewString() - var compilationResults []authenticationcel.CompilationResult - - for i, rule := range rules { - fldPath := fldPath.Index(i) - - if len(rule.Expression) > 0 && !structuredAuthnFeatureEnabled { - allErrs = append(allErrs, field.Invalid(fldPath.Child("expression"), rule.Expression, "expression is not supported when StructuredAuthenticationConfiguration feature gate is disabled")) - } - - switch { - case len(rule.Claim) > 0 && len(rule.Expression) > 0: - allErrs = append(allErrs, field.Invalid(fldPath, rule.Claim, "claim and expression can't both be set")) - case len(rule.Claim) == 0 && len(rule.Expression) == 0: - allErrs = append(allErrs, field.Required(fldPath, "claim or expression is required")) - case len(rule.Claim) > 0: - if len(rule.Message) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("message"), rule.Message, "message can't be set when claim is set")) - } - if seenClaims.Has(rule.Claim) { - allErrs = append(allErrs, field.Duplicate(fldPath.Child("claim"), rule.Claim)) - } - seenClaims.Insert(rule.Claim) - case len(rule.Expression) > 0: - if len(rule.RequiredValue) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("requiredValue"), rule.RequiredValue, "requiredValue can't be set when expression is set")) - } - if seenExpressions.Has(rule.Expression) { - allErrs = append(allErrs, field.Duplicate(fldPath.Child("expression"), rule.Expression)) - continue - } - seenExpressions.Insert(rule.Expression) - - compilationResult, err := compileClaimsCELExpression(compiler, &authenticationcel.ClaimValidationCondition{ - Expression: rule.Expression, - }, fldPath.Child("expression")) - - if err != nil { - allErrs = append(allErrs, err) - continue - } - if compilationResult != nil { - compilationResults = append(compilationResults, *compilationResult) - } - } - } - - if structuredAuthnFeatureEnabled && len(compilationResults) > 0 { - celMapper.ClaimValidationRules = authenticationcel.NewClaimsMapper(compilationResults) - } - - return allErrs -} - -func validateClaimMappings(compiler authenticationcel.Compiler, celMapper *authenticationcel.CELMapper, m api.ClaimMappings, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList { - var allErrs field.ErrorList - - if !structuredAuthnFeatureEnabled { - if len(m.Username.Expression) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("username").Child("expression"), m.Username.Expression, "expression is not supported when StructuredAuthenticationConfiguration feature gate is disabled")) - } - if len(m.Groups.Expression) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("groups").Child("expression"), m.Groups.Expression, "expression is not supported when StructuredAuthenticationConfiguration feature gate is disabled")) - } - if len(m.UID.Claim) > 0 || len(m.UID.Expression) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("uid"), "", "uid claim mapping is not supported when StructuredAuthenticationConfiguration feature gate is disabled")) - } - if len(m.Extra) > 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("extra"), "", "extra claim mapping is not supported when StructuredAuthenticationConfiguration feature gate is disabled")) - } - } - - compilationResult, err := validatePrefixClaimOrExpression(compiler, m.Username, fldPath.Child("username"), true, structuredAuthnFeatureEnabled) - if err != nil { - allErrs = append(allErrs, err...) - } else if compilationResult != nil && structuredAuthnFeatureEnabled { - celMapper.Username = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult}) - } - - compilationResult, err = validatePrefixClaimOrExpression(compiler, m.Groups, fldPath.Child("groups"), false, structuredAuthnFeatureEnabled) - if err != nil { - allErrs = append(allErrs, err...) - } else if compilationResult != nil && structuredAuthnFeatureEnabled { - celMapper.Groups = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult}) - } - - switch { - case len(m.UID.Claim) > 0 && len(m.UID.Expression) > 0: - allErrs = append(allErrs, field.Invalid(fldPath.Child("uid"), "", "claim and expression can't both be set")) - case len(m.UID.Expression) > 0: - compilationResult, err := compileClaimsCELExpression(compiler, &authenticationcel.ClaimMappingExpression{ - Expression: m.UID.Expression, - }, fldPath.Child("uid").Child("expression")) - - if err != nil { - allErrs = append(allErrs, err) - } else if structuredAuthnFeatureEnabled && compilationResult != nil { - celMapper.UID = authenticationcel.NewClaimsMapper([]authenticationcel.CompilationResult{*compilationResult}) - } - } - - var extraCompilationResults []authenticationcel.CompilationResult - seenExtraKeys := sets.NewString() - - for i, mapping := range m.Extra { - fldPath := fldPath.Child("extra").Index(i) - // Key should be namespaced to the authenticator or authenticator/authorizer pair making use of them. - // For instance: "example.org/foo" instead of "foo". - // xref: https://github.com/kubernetes/kubernetes/blob/3825e206cb162a7ad7431a5bdf6a065ae8422cf7/staging/src/k8s.io/apiserver/pkg/authentication/user/user.go#L31-L41 - // IsDomainPrefixedPath checks for non-empty key and that the key is prefixed with a domain name. - allErrs = append(allErrs, utilvalidation.IsDomainPrefixedPath(fldPath.Child("key"), mapping.Key)...) - if mapping.Key != strings.ToLower(mapping.Key) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("key"), mapping.Key, "key must be lowercase")) - } - if seenExtraKeys.Has(mapping.Key) { - allErrs = append(allErrs, field.Duplicate(fldPath.Child("key"), mapping.Key)) - continue - } - seenExtraKeys.Insert(mapping.Key) - - if len(mapping.ValueExpression) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("valueExpression"), "valueExpression is required")) - continue - } - - compilationResult, err := compileClaimsCELExpression(compiler, &authenticationcel.ExtraMappingExpression{ - Key: mapping.Key, - Expression: mapping.ValueExpression, - }, fldPath.Child("valueExpression")) - - if err != nil { - allErrs = append(allErrs, err) - continue - } - - if compilationResult != nil { - extraCompilationResults = append(extraCompilationResults, *compilationResult) - } - } - - if structuredAuthnFeatureEnabled && len(extraCompilationResults) > 0 { - celMapper.Extra = authenticationcel.NewClaimsMapper(extraCompilationResults) - } - - return allErrs -} - -func validatePrefixClaimOrExpression(compiler authenticationcel.Compiler, mapping api.PrefixedClaimOrExpression, fldPath *field.Path, claimOrExpressionRequired, structuredAuthnFeatureEnabled bool) (*authenticationcel.CompilationResult, field.ErrorList) { - var allErrs field.ErrorList - - var compilationResult *authenticationcel.CompilationResult - switch { - case len(mapping.Expression) > 0 && len(mapping.Claim) > 0: - allErrs = append(allErrs, field.Invalid(fldPath, "", "claim and expression can't both be set")) - case len(mapping.Expression) == 0 && len(mapping.Claim) == 0 && claimOrExpressionRequired: - allErrs = append(allErrs, field.Required(fldPath, "claim or expression is required")) - case len(mapping.Expression) > 0: - var err *field.Error - - if mapping.Prefix != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("prefix"), *mapping.Prefix, "prefix can't be set when expression is set")) - } - compilationResult, err = compileClaimsCELExpression(compiler, &authenticationcel.ClaimMappingExpression{ - Expression: mapping.Expression, - }, fldPath.Child("expression")) - - if err != nil { - allErrs = append(allErrs, err) - } - - case len(mapping.Claim) > 0: - if mapping.Prefix == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("prefix"), "prefix is required when claim is set. It can be set to an empty string to disable prefixing")) - } - } - - return compilationResult, allErrs -} - -func validateUserValidationRules(compiler authenticationcel.Compiler, celMapper *authenticationcel.CELMapper, rules []api.UserValidationRule, fldPath *field.Path, structuredAuthnFeatureEnabled bool) field.ErrorList { - var allErrs field.ErrorList - var compilationResults []authenticationcel.CompilationResult - - if len(rules) > 0 && !structuredAuthnFeatureEnabled { - allErrs = append(allErrs, field.Invalid(fldPath, "", "user validation rules are not supported when StructuredAuthenticationConfiguration feature gate is disabled")) - } - - seenExpressions := sets.NewString() - for i, rule := range rules { - fldPath := fldPath.Index(i) - - if len(rule.Expression) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("expression"), "expression is required")) - continue - } - - if seenExpressions.Has(rule.Expression) { - allErrs = append(allErrs, field.Duplicate(fldPath.Child("expression"), rule.Expression)) - continue - } - seenExpressions.Insert(rule.Expression) - - compilationResult, err := compileUserCELExpression(compiler, &authenticationcel.UserValidationCondition{ - Expression: rule.Expression, - Message: rule.Message, - }, fldPath.Child("expression")) - - if err != nil { - allErrs = append(allErrs, err) - continue - } - - if compilationResult != nil { - compilationResults = append(compilationResults, *compilationResult) - } - } - - if structuredAuthnFeatureEnabled && len(compilationResults) > 0 { - celMapper.UserValidationRules = authenticationcel.NewUserMapper(compilationResults) - } - - return allErrs -} - -func compileClaimsCELExpression(compiler authenticationcel.Compiler, expression authenticationcel.ExpressionAccessor, fldPath *field.Path) (*authenticationcel.CompilationResult, *field.Error) { - compilationResult, err := compiler.CompileClaimsExpression(expression) - if err != nil { - return nil, convertCELErrorToValidationError(fldPath, expression, err) - } - return &compilationResult, nil -} - -func compileUserCELExpression(compiler authenticationcel.Compiler, expression authenticationcel.ExpressionAccessor, fldPath *field.Path) (*authenticationcel.CompilationResult, *field.Error) { - compilationResult, err := compiler.CompileUserExpression(expression) - if err != nil { - return nil, convertCELErrorToValidationError(fldPath, expression, err) - } - return &compilationResult, nil -} - -// ValidateAuthorizationConfiguration validates a given AuthorizationConfiguration. -func ValidateAuthorizationConfiguration(fldPath *field.Path, c *api.AuthorizationConfiguration, knownTypes sets.String, repeatableTypes sets.String) field.ErrorList { - allErrs := field.ErrorList{} - - if len(c.Authorizers) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("authorizers"), "at least one authorization mode must be defined")) - } - - seenAuthorizerTypes := sets.NewString() - seenAuthorizerNames := sets.NewString() - for i, a := range c.Authorizers { - fldPath := fldPath.Child("authorizers").Index(i) - aType := string(a.Type) - if aType == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("type"), "")) - continue - } - if !knownTypes.Has(aType) { - allErrs = append(allErrs, field.NotSupported(fldPath.Child("type"), aType, knownTypes.List())) - continue - } - if seenAuthorizerTypes.Has(aType) && !repeatableTypes.Has(aType) { - allErrs = append(allErrs, field.Duplicate(fldPath.Child("type"), aType)) - continue - } - seenAuthorizerTypes.Insert(aType) - - if len(a.Name) == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("name"), "")) - } else if seenAuthorizerNames.Has(a.Name) { - allErrs = append(allErrs, field.Duplicate(fldPath.Child("name"), a.Name)) - } else if errs := utilvalidation.IsDNS1123Subdomain(a.Name); len(errs) != 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), a.Name, fmt.Sprintf("authorizer name is invalid: %s", strings.Join(errs, ", ")))) - } - seenAuthorizerNames.Insert(a.Name) - - switch a.Type { - case api.TypeWebhook: - if a.Webhook == nil { - allErrs = append(allErrs, field.Required(fldPath.Child("webhook"), "required when type=Webhook")) - continue - } - allErrs = append(allErrs, ValidateWebhookConfiguration(fldPath, a.Webhook)...) - default: - if a.Webhook != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("webhook"), "non-null", "may only be specified when type=Webhook")) - } - } - } - - return allErrs -} - -func ValidateWebhookConfiguration(fldPath *field.Path, c *api.WebhookConfiguration) field.ErrorList { - allErrs := field.ErrorList{} - - if c.Timeout.Duration == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("timeout"), "")) - } else if c.Timeout.Duration > 30*time.Second || c.Timeout.Duration < 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("timeout"), c.Timeout.Duration.String(), "must be > 0s and <= 30s")) - } - - if c.AuthorizedTTL.Duration == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("authorizedTTL"), "")) - } else if c.AuthorizedTTL.Duration < 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("authorizedTTL"), c.AuthorizedTTL.Duration.String(), "must be > 0s")) - } - - if c.UnauthorizedTTL.Duration == 0 { - allErrs = append(allErrs, field.Required(fldPath.Child("unauthorizedTTL"), "")) - } else if c.UnauthorizedTTL.Duration < 0 { - allErrs = append(allErrs, field.Invalid(fldPath.Child("unauthorizedTTL"), c.UnauthorizedTTL.Duration.String(), "must be > 0s")) - } - - switch c.SubjectAccessReviewVersion { - case "": - allErrs = append(allErrs, field.Required(fldPath.Child("subjectAccessReviewVersion"), "")) - case "v1": - _ = &v1.SubjectAccessReview{} - case "v1beta1": - _ = &v1beta1.SubjectAccessReview{} - default: - allErrs = append(allErrs, field.NotSupported(fldPath.Child("subjectAccessReviewVersion"), c.SubjectAccessReviewVersion, []string{"v1", "v1beta1"})) - } - - switch c.MatchConditionSubjectAccessReviewVersion { - case "": - allErrs = append(allErrs, field.Required(fldPath.Child("matchConditionSubjectAccessReviewVersion"), "")) - case "v1": - _ = &v1.SubjectAccessReview{} - default: - allErrs = append(allErrs, field.NotSupported(fldPath.Child("matchConditionSubjectAccessReviewVersion"), c.MatchConditionSubjectAccessReviewVersion, []string{"v1"})) - } - - switch c.FailurePolicy { - case "": - allErrs = append(allErrs, field.Required(fldPath.Child("failurePolicy"), "")) - case api.FailurePolicyNoOpinion, api.FailurePolicyDeny: - default: - allErrs = append(allErrs, field.NotSupported(fldPath.Child("failurePolicy"), c.FailurePolicy, []string{"NoOpinion", "Deny"})) - } - - switch c.ConnectionInfo.Type { - case "": - allErrs = append(allErrs, field.Required(fldPath.Child("connectionInfo", "type"), "")) - case api.AuthorizationWebhookConnectionInfoTypeInCluster: - if c.ConnectionInfo.KubeConfigFile != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("connectionInfo", "kubeConfigFile"), *c.ConnectionInfo.KubeConfigFile, "can only be set when type=KubeConfigFile")) - } - case api.AuthorizationWebhookConnectionInfoTypeKubeConfigFile: - if c.ConnectionInfo.KubeConfigFile == nil || *c.ConnectionInfo.KubeConfigFile == "" { - allErrs = append(allErrs, field.Required(fldPath.Child("connectionInfo", "kubeConfigFile"), "")) - } else if !filepath.IsAbs(*c.ConnectionInfo.KubeConfigFile) { - allErrs = append(allErrs, field.Invalid(fldPath.Child("connectionInfo", "kubeConfigFile"), *c.ConnectionInfo.KubeConfigFile, "must be an absolute path")) - } else if info, err := os.Stat(*c.ConnectionInfo.KubeConfigFile); err != nil { - allErrs = append(allErrs, field.Invalid(fldPath.Child("connectionInfo", "kubeConfigFile"), *c.ConnectionInfo.KubeConfigFile, fmt.Sprintf("error loading file: %v", err))) - } else if !info.Mode().IsRegular() { - allErrs = append(allErrs, field.Invalid(fldPath.Child("connectionInfo", "kubeConfigFile"), *c.ConnectionInfo.KubeConfigFile, "must be a regular file")) - } - default: - allErrs = append(allErrs, field.NotSupported(fldPath.Child("connectionInfo", "type"), c.ConnectionInfo, []string{api.AuthorizationWebhookConnectionInfoTypeInCluster, api.AuthorizationWebhookConnectionInfoTypeKubeConfigFile})) - } - - _, errs := compileMatchConditions(c.MatchConditions, fldPath, utilfeature.DefaultFeatureGate.Enabled(features.StructuredAuthorizationConfiguration)) - allErrs = append(allErrs, errs...) - - return allErrs -} - -// ValidateAndCompileMatchConditions validates a given webhook's matchConditions. -// This is exported for use in authz package. -func ValidateAndCompileMatchConditions(matchConditions []api.WebhookMatchCondition) (*authorizationcel.CELMatcher, field.ErrorList) { - return compileMatchConditions(matchConditions, nil, utilfeature.DefaultFeatureGate.Enabled(features.StructuredAuthorizationConfiguration)) -} - -func compileMatchConditions(matchConditions []api.WebhookMatchCondition, fldPath *field.Path, structuredAuthzFeatureEnabled bool) (*authorizationcel.CELMatcher, field.ErrorList) { - var allErrs field.ErrorList - // should fail when match conditions are used without feature enabled - if len(matchConditions) > 0 && !structuredAuthzFeatureEnabled { - allErrs = append(allErrs, field.Invalid(fldPath.Child("matchConditions"), "", "matchConditions are not supported when StructuredAuthorizationConfiguration feature gate is disabled")) - } - if len(matchConditions) > 64 { - allErrs = append(allErrs, field.TooMany(fldPath.Child("matchConditions"), len(matchConditions), 64)) - return nil, allErrs - } - - compiler := authorizationcel.NewCompiler(environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion())) - seenExpressions := sets.NewString() - var compilationResults []authorizationcel.CompilationResult - - for i, condition := range matchConditions { - fldPath := fldPath.Child("matchConditions").Index(i).Child("expression") - if len(strings.TrimSpace(condition.Expression)) == 0 { - allErrs = append(allErrs, field.Required(fldPath, "")) - continue - } - if seenExpressions.Has(condition.Expression) { - allErrs = append(allErrs, field.Duplicate(fldPath, condition.Expression)) - continue - } - seenExpressions.Insert(condition.Expression) - compilationResult, err := compileMatchConditionsExpression(fldPath, compiler, condition.Expression) - if err != nil { - allErrs = append(allErrs, err) - continue - } - compilationResults = append(compilationResults, compilationResult) - } - if len(compilationResults) == 0 { - return nil, allErrs - } - return &authorizationcel.CELMatcher{ - CompilationResults: compilationResults, - }, allErrs -} - -func compileMatchConditionsExpression(fldPath *field.Path, compiler authorizationcel.Compiler, expression string) (authorizationcel.CompilationResult, *field.Error) { - authzExpression := &authorizationcel.SubjectAccessReviewMatchCondition{ - Expression: expression, - } - compilationResult, err := compiler.CompileCELExpression(authzExpression) - if err != nil { - return compilationResult, convertCELErrorToValidationError(fldPath, authzExpression, err) - } - return compilationResult, nil -} - -func convertCELErrorToValidationError(fldPath *field.Path, expression authorizationcel.ExpressionAccessor, err error) *field.Error { - var celErr *cel.Error - if errors.As(err, &celErr) { - switch celErr.Type { - case cel.ErrorTypeRequired: - return field.Required(fldPath, celErr.Detail) - case cel.ErrorTypeInvalid: - return field.Invalid(fldPath, expression.GetExpression(), celErr.Detail) - default: - return field.InternalError(fldPath, celErr) - } - } - return field.InternalError(fldPath, fmt.Errorf("error is not cel error: %w", err)) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/compile.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/compile.go deleted file mode 100644 index 3bcff5e9051c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/compile.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -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 cel - -import ( - "fmt" - - "github.com/google/cel-go/cel" - - "k8s.io/apimachinery/pkg/util/version" - apiservercel "k8s.io/apiserver/pkg/cel" - "k8s.io/apiserver/pkg/cel/environment" -) - -const ( - claimsVarName = "claims" - userVarName = "user" -) - -// compiler implements the Compiler interface. -type compiler struct { - // varEnvs is a map of CEL environments, keyed by the name of the CEL variable. - // The CEL variable is available to the expression. - // We have 2 environments, one for claims and one for user. - varEnvs map[string]*environment.EnvSet -} - -// NewCompiler returns a new Compiler. -func NewCompiler(env *environment.EnvSet) Compiler { - return &compiler{ - varEnvs: mustBuildEnvs(env), - } -} - -// CompileClaimsExpression compiles the given expressionAccessor into a CEL program that can be evaluated. -// The claims CEL variable is available to the expression. -func (c compiler) CompileClaimsExpression(expressionAccessor ExpressionAccessor) (CompilationResult, error) { - return c.compile(expressionAccessor, claimsVarName) -} - -// CompileUserExpression compiles the given expressionAccessor into a CEL program that can be evaluated. -// The user CEL variable is available to the expression. -func (c compiler) CompileUserExpression(expressionAccessor ExpressionAccessor) (CompilationResult, error) { - return c.compile(expressionAccessor, userVarName) -} - -func (c compiler) compile(expressionAccessor ExpressionAccessor, envVarName string) (CompilationResult, error) { - resultError := func(errorString string, errType apiservercel.ErrorType) (CompilationResult, error) { - return CompilationResult{}, &apiservercel.Error{ - Type: errType, - Detail: errorString, - } - } - - env, err := c.varEnvs[envVarName].Env(environment.StoredExpressions) - if err != nil { - return resultError(fmt.Sprintf("unexpected error loading CEL environment: %v", err), apiservercel.ErrorTypeInternal) - } - - ast, issues := env.Compile(expressionAccessor.GetExpression()) - if issues != nil { - return resultError("compilation failed: "+issues.String(), apiservercel.ErrorTypeInvalid) - } - - found := false - returnTypes := expressionAccessor.ReturnTypes() - for _, returnType := range returnTypes { - if ast.OutputType() == returnType || cel.AnyType == returnType { - found = true - break - } - } - if !found { - var reason string - if len(returnTypes) == 1 { - reason = fmt.Sprintf("must evaluate to %v", returnTypes[0].String()) - } else { - reason = fmt.Sprintf("must evaluate to one of %v", returnTypes) - } - - return resultError(reason, apiservercel.ErrorTypeInvalid) - } - - if _, err = cel.AstToCheckedExpr(ast); err != nil { - // should be impossible since env.Compile returned no issues - return resultError("unexpected compilation error: "+err.Error(), apiservercel.ErrorTypeInternal) - } - prog, err := env.Program(ast) - if err != nil { - return resultError("program instantiation failed: "+err.Error(), apiservercel.ErrorTypeInternal) - } - - return CompilationResult{ - Program: prog, - ExpressionAccessor: expressionAccessor, - }, nil -} - -func buildUserType() *apiservercel.DeclType { - field := func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField { - return apiservercel.NewDeclField(name, declType, required, nil, nil) - } - fields := func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField { - result := make(map[string]*apiservercel.DeclField, len(fields)) - for _, f := range fields { - result[f.Name] = f - } - return result - } - - return apiservercel.NewObjectType("kubernetes.UserInfo", fields( - field("username", apiservercel.StringType, false), - field("uid", apiservercel.StringType, false), - field("groups", apiservercel.NewListType(apiservercel.StringType, -1), false), - field("extra", apiservercel.NewMapType(apiservercel.StringType, apiservercel.NewListType(apiservercel.StringType, -1), -1), false), - )) -} - -func mustBuildEnvs(baseEnv *environment.EnvSet) map[string]*environment.EnvSet { - buildEnvSet := func(envOpts []cel.EnvOption, declTypes []*apiservercel.DeclType) *environment.EnvSet { - env, err := baseEnv.Extend(environment.VersionedOptions{ - IntroducedVersion: version.MajorMinor(1, 0), - EnvOptions: envOpts, - DeclTypes: declTypes, - }) - if err != nil { - panic(fmt.Sprintf("environment misconfigured: %v", err)) - } - return env - } - - userType := buildUserType() - claimsType := apiservercel.NewMapType(apiservercel.StringType, apiservercel.AnyType, -1) - - envs := make(map[string]*environment.EnvSet, 2) // build two environments, one for claims and one for user - envs[claimsVarName] = buildEnvSet([]cel.EnvOption{cel.Variable(claimsVarName, claimsType.CelType())}, []*apiservercel.DeclType{claimsType}) - envs[userVarName] = buildEnvSet([]cel.EnvOption{cel.Variable(userVarName, userType.CelType())}, []*apiservercel.DeclType{userType}) - - return envs -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/interface.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/interface.go deleted file mode 100644 index 7ec0c9af6af6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/interface.go +++ /dev/null @@ -1,147 +0,0 @@ -/* -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 cel contains the CEL related interfaces and structs for authentication. -package cel - -import ( - "context" - - celgo "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types/ref" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -// ExpressionAccessor is an interface that provides access to a CEL expression. -type ExpressionAccessor interface { - GetExpression() string - ReturnTypes() []*celgo.Type -} - -// CompilationResult represents a compiled validations expression. -type CompilationResult struct { - Program celgo.Program - ExpressionAccessor ExpressionAccessor -} - -// EvaluationResult contains the minimal required fields and metadata of a cel evaluation -type EvaluationResult struct { - EvalResult ref.Val - ExpressionAccessor ExpressionAccessor -} - -// Compiler provides a CEL expression compiler configured with the desired authentication related CEL variables. -type Compiler interface { - CompileClaimsExpression(expressionAccessor ExpressionAccessor) (CompilationResult, error) - CompileUserExpression(expressionAccessor ExpressionAccessor) (CompilationResult, error) -} - -// ClaimsMapper provides a CEL expression mapper configured with the claims CEL variable. -type ClaimsMapper interface { - // EvalClaimMapping evaluates the given claim mapping expression and returns a EvaluationResult. - // This is used for username, groups and uid claim mapping that contains a single expression. - EvalClaimMapping(ctx context.Context, claims *unstructured.Unstructured) (EvaluationResult, error) - // EvalClaimMappings evaluates the given expressions and returns a list of EvaluationResult. - // This is used for extra claim mapping and claim validation that contains a list of expressions. - EvalClaimMappings(ctx context.Context, claims *unstructured.Unstructured) ([]EvaluationResult, error) -} - -// UserMapper provides a CEL expression mapper configured with the user CEL variable. -type UserMapper interface { - // EvalUser evaluates the given user expressions and returns a list of EvaluationResult. - // This is used for user validation that contains a list of expressions. - EvalUser(ctx context.Context, userInfo *unstructured.Unstructured) ([]EvaluationResult, error) -} - -var _ ExpressionAccessor = &ClaimMappingExpression{} - -// ClaimMappingExpression is a CEL expression that maps a claim. -type ClaimMappingExpression struct { - Expression string -} - -// GetExpression returns the CEL expression. -func (v *ClaimMappingExpression) GetExpression() string { - return v.Expression -} - -// ReturnTypes returns the CEL expression return types. -func (v *ClaimMappingExpression) ReturnTypes() []*celgo.Type { - // return types is only used for validation. The claims variable that's available - // to the claim mapping expressions is a map[string]interface{}, so we can't - // really know what the return type is during compilation. Strict type checking - // is done during evaluation. - return []*celgo.Type{celgo.AnyType} -} - -var _ ExpressionAccessor = &ClaimValidationCondition{} - -// ClaimValidationCondition is a CEL expression that validates a claim. -type ClaimValidationCondition struct { - Expression string - Message string -} - -// GetExpression returns the CEL expression. -func (v *ClaimValidationCondition) GetExpression() string { - return v.Expression -} - -// ReturnTypes returns the CEL expression return types. -func (v *ClaimValidationCondition) ReturnTypes() []*celgo.Type { - return []*celgo.Type{celgo.BoolType} -} - -var _ ExpressionAccessor = &ExtraMappingExpression{} - -// ExtraMappingExpression is a CEL expression that maps an extra to a list of values. -type ExtraMappingExpression struct { - Key string - Expression string -} - -// GetExpression returns the CEL expression. -func (v *ExtraMappingExpression) GetExpression() string { - return v.Expression -} - -// ReturnTypes returns the CEL expression return types. -func (v *ExtraMappingExpression) ReturnTypes() []*celgo.Type { - // return types is only used for validation. The claims variable that's available - // to the claim mapping expressions is a map[string]interface{}, so we can't - // really know what the return type is during compilation. Strict type checking - // is done during evaluation. - return []*celgo.Type{celgo.AnyType} -} - -var _ ExpressionAccessor = &UserValidationCondition{} - -// UserValidationCondition is a CEL expression that validates a User. -type UserValidationCondition struct { - Expression string - Message string -} - -// GetExpression returns the CEL expression. -func (v *UserValidationCondition) GetExpression() string { - return v.Expression -} - -// ReturnTypes returns the CEL expression return types. -func (v *UserValidationCondition) ReturnTypes() []*celgo.Type { - return []*celgo.Type{celgo.BoolType} -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/mapper.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/mapper.go deleted file mode 100644 index ab308bb7f0f2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authentication/cel/mapper.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -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 cel - -import ( - "context" - "fmt" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -var _ ClaimsMapper = &mapper{} -var _ UserMapper = &mapper{} - -// mapper implements the ClaimsMapper and UserMapper interface. -type mapper struct { - compilationResults []CompilationResult -} - -// CELMapper is a struct that holds the compiled expressions for -// username, groups, uid, extra, claimValidation and userValidation -type CELMapper struct { - Username ClaimsMapper - Groups ClaimsMapper - UID ClaimsMapper - Extra ClaimsMapper - ClaimValidationRules ClaimsMapper - UserValidationRules UserMapper -} - -// NewClaimsMapper returns a new ClaimsMapper. -func NewClaimsMapper(compilationResults []CompilationResult) ClaimsMapper { - return &mapper{ - compilationResults: compilationResults, - } -} - -// NewUserMapper returns a new UserMapper. -func NewUserMapper(compilationResults []CompilationResult) UserMapper { - return &mapper{ - compilationResults: compilationResults, - } -} - -// EvalClaimMapping evaluates the given claim mapping expression and returns a EvaluationResult. -func (m *mapper) EvalClaimMapping(ctx context.Context, claims *unstructured.Unstructured) (EvaluationResult, error) { - results, err := m.eval(ctx, map[string]interface{}{claimsVarName: claims.Object}) - if err != nil { - return EvaluationResult{}, err - } - if len(results) != 1 { - return EvaluationResult{}, fmt.Errorf("expected 1 evaluation result, got %d", len(results)) - } - return results[0], nil -} - -// EvalClaimMappings evaluates the given expressions and returns a list of EvaluationResult. -func (m *mapper) EvalClaimMappings(ctx context.Context, claims *unstructured.Unstructured) ([]EvaluationResult, error) { - return m.eval(ctx, map[string]interface{}{claimsVarName: claims.Object}) -} - -// EvalUser evaluates the given user expressions and returns a list of EvaluationResult. -func (m *mapper) EvalUser(ctx context.Context, userInfo *unstructured.Unstructured) ([]EvaluationResult, error) { - return m.eval(ctx, map[string]interface{}{userVarName: userInfo.Object}) -} - -func (m *mapper) eval(ctx context.Context, input map[string]interface{}) ([]EvaluationResult, error) { - evaluations := make([]EvaluationResult, len(m.compilationResults)) - - for i, compilationResult := range m.compilationResults { - var evaluation = &evaluations[i] - evaluation.ExpressionAccessor = compilationResult.ExpressionAccessor - - evalResult, _, err := compilationResult.Program.ContextEval(ctx, input) - if err != nil { - return nil, fmt.Errorf("expression '%s' resulted in error: %w", compilationResult.ExpressionAccessor.GetExpression(), err) - } - - evaluation.EvalResult = evalResult - } - - return evaluations, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/compile.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/compile.go deleted file mode 100644 index e441c347d07a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/compile.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -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 cel - -import ( - "fmt" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types/ref" - - "k8s.io/apimachinery/pkg/util/version" - apiservercel "k8s.io/apiserver/pkg/cel" - "k8s.io/apiserver/pkg/cel/environment" -) - -const ( - subjectAccessReviewRequestVarName = "request" -) - -// CompilationResult represents a compiled authorization cel expression. -type CompilationResult struct { - Program cel.Program - ExpressionAccessor ExpressionAccessor -} - -// EvaluationResult contains the minimal required fields and metadata of a cel evaluation -type EvaluationResult struct { - EvalResult ref.Val - ExpressionAccessor ExpressionAccessor -} - -// Compiler is an interface for compiling CEL expressions with the desired environment mode. -type Compiler interface { - CompileCELExpression(expressionAccessor ExpressionAccessor) (CompilationResult, error) -} - -type compiler struct { - envSet *environment.EnvSet -} - -// NewCompiler returns a new Compiler. -func NewCompiler(env *environment.EnvSet) Compiler { - return &compiler{ - envSet: mustBuildEnv(env), - } -} - -func (c compiler) CompileCELExpression(expressionAccessor ExpressionAccessor) (CompilationResult, error) { - resultError := func(errorString string, errType apiservercel.ErrorType) (CompilationResult, error) { - err := &apiservercel.Error{ - Type: errType, - Detail: errorString, - } - return CompilationResult{ - ExpressionAccessor: expressionAccessor, - }, err - } - env, err := c.envSet.Env(environment.StoredExpressions) - if err != nil { - return resultError(fmt.Sprintf("unexpected error loading CEL environment: %v", err), apiservercel.ErrorTypeInternal) - } - ast, issues := env.Compile(expressionAccessor.GetExpression()) - if issues != nil { - return resultError("compilation failed: "+issues.String(), apiservercel.ErrorTypeInvalid) - } - found := false - returnTypes := expressionAccessor.ReturnTypes() - for _, returnType := range returnTypes { - if ast.OutputType() == returnType { - found = true - break - } - } - if !found { - var reason string - if len(returnTypes) == 1 { - reason = fmt.Sprintf("must evaluate to %v but got %v", returnTypes[0].String(), ast.OutputType()) - } else { - reason = fmt.Sprintf("must evaluate to one of %v", returnTypes) - } - - return resultError(reason, apiservercel.ErrorTypeInvalid) - } - _, err = cel.AstToCheckedExpr(ast) - if err != nil { - // should be impossible since env.Compile returned no issues - return resultError("unexpected compilation error: "+err.Error(), apiservercel.ErrorTypeInternal) - } - prog, err := env.Program(ast) - if err != nil { - return resultError("program instantiation failed: "+err.Error(), apiservercel.ErrorTypeInternal) - } - return CompilationResult{ - Program: prog, - ExpressionAccessor: expressionAccessor, - }, nil -} - -func mustBuildEnv(baseEnv *environment.EnvSet) *environment.EnvSet { - field := func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField { - return apiservercel.NewDeclField(name, declType, required, nil, nil) - } - fields := func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField { - result := make(map[string]*apiservercel.DeclField, len(fields)) - for _, f := range fields { - result[f.Name] = f - } - return result - } - subjectAccessReviewSpecRequestType := buildRequestType(field, fields) - extended, err := baseEnv.Extend( - environment.VersionedOptions{ - // we record this as 1.0 since it was available in the - // first version that supported this feature - IntroducedVersion: version.MajorMinor(1, 0), - EnvOptions: []cel.EnvOption{ - cel.Variable(subjectAccessReviewRequestVarName, subjectAccessReviewSpecRequestType.CelType()), - }, - DeclTypes: []*apiservercel.DeclType{ - subjectAccessReviewSpecRequestType, - }, - }, - ) - if err != nil { - panic(fmt.Sprintf("environment misconfigured: %v", err)) - } - - return extended -} - -// buildRequestType generates a DeclType for SubjectAccessReviewSpec. -func buildRequestType(field func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField, fields func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField) *apiservercel.DeclType { - resourceAttributesType := buildResourceAttributesType(field, fields) - nonResourceAttributesType := buildNonResourceAttributesType(field, fields) - return apiservercel.NewObjectType("kubernetes.SubjectAccessReviewSpec", fields( - field("resourceAttributes", resourceAttributesType, false), - field("nonResourceAttributes", nonResourceAttributesType, false), - field("user", apiservercel.StringType, false), - field("groups", apiservercel.NewListType(apiservercel.StringType, -1), false), - field("extra", apiservercel.NewMapType(apiservercel.StringType, apiservercel.NewListType(apiservercel.StringType, -1), -1), false), - field("uid", apiservercel.StringType, false), - )) -} - -// buildResourceAttributesType generates a DeclType for ResourceAttributes. -func buildResourceAttributesType(field func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField, fields func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField) *apiservercel.DeclType { - return apiservercel.NewObjectType("kubernetes.ResourceAttributes", fields( - field("namespace", apiservercel.StringType, false), - field("verb", apiservercel.StringType, false), - field("group", apiservercel.StringType, false), - field("version", apiservercel.StringType, false), - field("resource", apiservercel.StringType, false), - field("subresource", apiservercel.StringType, false), - field("name", apiservercel.StringType, false), - )) -} - -// buildNonResourceAttributesType generates a DeclType for NonResourceAttributes. -func buildNonResourceAttributesType(field func(name string, declType *apiservercel.DeclType, required bool) *apiservercel.DeclField, fields func(fields ...*apiservercel.DeclField) map[string]*apiservercel.DeclField) *apiservercel.DeclType { - return apiservercel.NewObjectType("kubernetes.NonResourceAttributes", fields( - field("path", apiservercel.StringType, false), - field("verb", apiservercel.StringType, false), - )) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/interface.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/interface.go deleted file mode 100644 index 82166830c873..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/interface.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -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 cel - -import ( - celgo "github.com/google/cel-go/cel" -) - -type ExpressionAccessor interface { - GetExpression() string - ReturnTypes() []*celgo.Type -} - -var _ ExpressionAccessor = &SubjectAccessReviewMatchCondition{} - -// SubjectAccessReviewMatchCondition is a CEL expression that maps a SubjectAccessReview request to a list of values. -type SubjectAccessReviewMatchCondition struct { - Expression string -} - -func (v *SubjectAccessReviewMatchCondition) GetExpression() string { - return v.Expression -} - -func (v *SubjectAccessReviewMatchCondition) ReturnTypes() []*celgo.Type { - return []*celgo.Type{celgo.BoolType} -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/matcher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/matcher.go deleted file mode 100644 index 09a462f68d74..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/authorization/cel/matcher.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -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 cel - -import ( - "context" - "fmt" - - celgo "github.com/google/cel-go/cel" - authorizationv1 "k8s.io/api/authorization/v1" - "k8s.io/apimachinery/pkg/runtime" - utilerrors "k8s.io/apimachinery/pkg/util/errors" -) - -type CELMatcher struct { - CompilationResults []CompilationResult -} - -// eval evaluates the given SubjectAccessReview against all cel matchCondition expression -func (c *CELMatcher) Eval(ctx context.Context, r *authorizationv1.SubjectAccessReview) (bool, error) { - var evalErrors []error - specValObject, err := convertObjectToUnstructured(&r.Spec) - if err != nil { - return false, fmt.Errorf("authz celMatcher eval error: convert SubjectAccessReviewSpec object to unstructured failed: %w", err) - } - va := map[string]interface{}{ - "request": specValObject, - } - for _, compilationResult := range c.CompilationResults { - evalResult, _, err := compilationResult.Program.ContextEval(ctx, va) - if err != nil { - evalErrors = append(evalErrors, fmt.Errorf("cel evaluation error: expression '%v' resulted in error: %w", compilationResult.ExpressionAccessor.GetExpression(), err)) - continue - } - if evalResult.Type() != celgo.BoolType { - evalErrors = append(evalErrors, fmt.Errorf("cel evaluation error: expression '%v' eval result type should be bool but got %W", compilationResult.ExpressionAccessor.GetExpression(), evalResult.Type())) - continue - } - match, ok := evalResult.Value().(bool) - if !ok { - evalErrors = append(evalErrors, fmt.Errorf("cel evaluation error: expression '%v' eval result value should be bool but got %W", compilationResult.ExpressionAccessor.GetExpression(), evalResult.Value())) - continue - } - // If at least one matchCondition successfully evaluates to FALSE, - // return early - if !match { - return false, nil - } - } - // if there is any error, return - if len(evalErrors) > 0 { - return false, utilerrors.NewAggregate(evalErrors) - } - // return ALL matchConditions evaluate to TRUE successfully without error - return true, nil -} - -func convertObjectToUnstructured(obj *authorizationv1.SubjectAccessReviewSpec) (map[string]interface{}, error) { - if obj == nil { - return nil, nil - } - ret, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) - if err != nil { - return nil, err - } - return ret, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/common/equality.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/common/equality.go deleted file mode 100644 index 9289637a395b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/common/equality.go +++ /dev/null @@ -1,334 +0,0 @@ -/* -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 common - -import ( - "reflect" - "time" -) - -// CorrelatedObject represents a node in a tree of objects that are being -// validated. It is used to keep track of the old value of an object during -// traversal of the new value. It is also used to cache the results of -// DeepEqual comparisons between the old and new values of objects. -// -// All receiver functions support being called on `nil` to support ergonomic -// recursive descent. The nil `CorrelatedObject` represents an uncorrelatable -// node in the tree. -// -// CorrelatedObject is not thread-safe. It is the responsibility of the caller -// to handle concurrency, if any. -type CorrelatedObject struct { - // Currently correlated old value during traversal of the schema/object - OldValue interface{} - - // Value being validated - Value interface{} - - // Schema used for validation of this value. The schema is also used - // to determine how to correlate the old object. - Schema Schema - - // Duration spent on ratcheting validation for this object and all of its - // children. - Duration *time.Duration - - // Scratch space below, may change during validation - - // Cached comparison result of DeepEqual of `value` and `thunk.oldValue` - comparisonResult *bool - - // Cached map representation of a map-type list, or nil if not map-type list - mapList MapList - - // Children spawned by a call to `Validate` on this object - // key is either a string or an index, depending upon whether `value` is - // a map or a list, respectively. - // - // The list of children may be incomplete depending upon if the internal - // logic of kube-openapi's SchemaValidator short-circuited before - // reaching all of the children. - // - // It should be expected to have an entry for either all of the children, or - // none of them. - children map[interface{}]*CorrelatedObject -} - -func NewCorrelatedObject(new, old interface{}, schema Schema) *CorrelatedObject { - d := time.Duration(0) - return &CorrelatedObject{ - OldValue: old, - Value: new, - Schema: schema, - Duration: &d, - } -} - -// If OldValue or Value is not a list, or the index is out of bounds of the -// Value list, returns nil -// If oldValue is a list, this considers the x-list-type to decide how to -// correlate old values: -// -// If listType is map, creates a map representation of the list using the designated -// map-keys, caches it for future calls, and returns the map value, or nil if -// the correlated key is not in the old map -// -// Otherwise, if the list type is not correlatable this funcion returns nil. -func (r *CorrelatedObject) correlateOldValueForChildAtNewIndex(index int) interface{} { - oldAsList, ok := r.OldValue.([]interface{}) - if !ok { - return nil - } - - asList, ok := r.Value.([]interface{}) - if !ok { - return nil - } else if len(asList) <= index { - // Cannot correlate out of bounds index - return nil - } - - listType := r.Schema.XListType() - switch listType { - case "map": - // Look up keys for this index in current object - currentElement := asList[index] - - oldList := r.mapList - if oldList == nil { - oldList = MakeMapList(r.Schema, oldAsList) - r.mapList = oldList - } - return oldList.Get(currentElement) - - case "set": - // Are sets correlatable? Only if the old value equals the current value. - // We might be able to support this, but do not currently see a lot - // of value - // (would allow you to add/remove items from sets with ratcheting but not change them) - return nil - case "": - fallthrough - case "atomic": - // Atomic lists are the default are not correlatable by item - // Ratcheting is not available on a per-index basis - return nil - default: - // Unrecognized list type. Assume non-correlatable. - return nil - } -} - -// CachedDeepEqual is equivalent to reflect.DeepEqual, but caches the -// results in the tree of ratchetInvocationScratch objects on the way: -// -// For objects and arrays, this function will make a best effort to make -// use of past DeepEqual checks performed by this Node's children, if available. -// -// If a lazy computation could not be found for all children possibly due -// to validation logic short circuiting and skipping the children, then -// this function simply defers to reflect.DeepEqual. -func (r *CorrelatedObject) CachedDeepEqual() (res bool) { - start := time.Now() - defer func() { - if r != nil && r.Duration != nil { - *r.Duration += time.Since(start) - } - }() - - if r == nil { - // Uncorrelatable node is not considered equal to its old value - return false - } else if r.comparisonResult != nil { - return *r.comparisonResult - } - - defer func() { - r.comparisonResult = &res - }() - - if r.Value == nil && r.OldValue == nil { - return true - } else if r.Value == nil || r.OldValue == nil { - return false - } - - oldAsArray, oldIsArray := r.OldValue.([]interface{}) - newAsArray, newIsArray := r.Value.([]interface{}) - - oldAsMap, oldIsMap := r.OldValue.(map[string]interface{}) - newAsMap, newIsMap := r.Value.(map[string]interface{}) - - // If old and new are not the same type, they are not equal - if (oldIsArray != newIsArray) || oldIsMap != newIsMap { - return false - } - - // Objects are known to be same type of (map, slice, or primitive) - switch { - case oldIsArray: - // Both arrays case. oldIsArray == newIsArray - if len(oldAsArray) != len(newAsArray) { - return false - } - - for i := range newAsArray { - child := r.Index(i) - if child == nil { - if r.mapList == nil { - // Treat non-correlatable array as a unit with reflect.DeepEqual - return reflect.DeepEqual(oldAsArray, newAsArray) - } - - // If array is correlatable, but old not found. Just short circuit - // comparison - return false - - } else if !child.CachedDeepEqual() { - // If one child is not equal the entire object is not equal - return false - } - } - - return true - case oldIsMap: - // Both maps case. oldIsMap == newIsMap - if len(oldAsMap) != len(newAsMap) { - return false - } - - for k := range newAsMap { - child := r.Key(k) - if child == nil { - // Un-correlatable child due to key change. - // Objects are not equal. - return false - } else if !child.CachedDeepEqual() { - // If one child is not equal the entire object is not equal - return false - } - } - - return true - - default: - // Primitive: use reflect.DeepEqual - return reflect.DeepEqual(r.OldValue, r.Value) - } -} - -// Key returns the child of the receiver with the given name. -// Returns nil if the given name is does not exist in the new object, or its -// value is not correlatable to an old value. -// If receiver is nil or if the new value is not an object/map, returns nil. -func (r *CorrelatedObject) Key(field string) *CorrelatedObject { - start := time.Now() - defer func() { - if r != nil && r.Duration != nil { - *r.Duration += time.Since(start) - } - }() - - if r == nil || r.Schema == nil { - return nil - } else if existing, exists := r.children[field]; exists { - return existing - } - - // Find correlated old value - oldAsMap, okOld := r.OldValue.(map[string]interface{}) - newAsMap, okNew := r.Value.(map[string]interface{}) - if !okOld || !okNew { - return nil - } - - oldValueForField, okOld := oldAsMap[field] - newValueForField, okNew := newAsMap[field] - if !okOld || !okNew { - return nil - } - - var propertySchema Schema - if prop, exists := r.Schema.Properties()[field]; exists { - propertySchema = prop - } else if addP := r.Schema.AdditionalProperties(); addP != nil && addP.Schema() != nil { - propertySchema = addP.Schema() - } else { - return nil - } - - if r.children == nil { - r.children = make(map[interface{}]*CorrelatedObject, len(newAsMap)) - } - - res := &CorrelatedObject{ - OldValue: oldValueForField, - Value: newValueForField, - Schema: propertySchema, - Duration: r.Duration, - } - r.children[field] = res - return res -} - -// Index returns the child of the receiver at the given index. -// Returns nil if the given index is out of bounds, or its value is not -// correlatable to an old value. -// If receiver is nil or if the new value is not an array, returns nil. -func (r *CorrelatedObject) Index(i int) *CorrelatedObject { - start := time.Now() - defer func() { - if r != nil && r.Duration != nil { - *r.Duration += time.Since(start) - } - }() - - if r == nil || r.Schema == nil { - return nil - } else if existing, exists := r.children[i]; exists { - return existing - } - - asList, ok := r.Value.([]interface{}) - if !ok || len(asList) <= i { - return nil - } - - oldValueForIndex := r.correlateOldValueForChildAtNewIndex(i) - if oldValueForIndex == nil { - return nil - } - var itemSchema Schema - if i := r.Schema.Items(); i != nil { - itemSchema = i - } else { - return nil - } - - if r.children == nil { - r.children = make(map[interface{}]*CorrelatedObject, len(asList)) - } - - res := &CorrelatedObject{ - OldValue: oldValueForIndex, - Value: asList[i], - Schema: itemSchema, - Duration: r.Duration, - } - r.children[i] = res - return res -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/environment/base.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/environment/base.go deleted file mode 100644 index 76a0bccee8a8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/environment/base.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -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 environment - -import ( - "fmt" - "strconv" - "sync" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/checker" - "github.com/google/cel-go/ext" - "github.com/google/cel-go/interpreter" - "golang.org/x/sync/singleflight" - - "k8s.io/apimachinery/pkg/util/version" - celconfig "k8s.io/apiserver/pkg/apis/cel" - "k8s.io/apiserver/pkg/cel/library" -) - -// DefaultCompatibilityVersion returns a default compatibility version for use with EnvSet -// that guarantees compatibility with CEL features/libraries/parameters understood by -// an n-1 version -// -// This default will be set to no more than n-1 the current Kubernetes major.minor version. -// -// Note that a default version number less than n-1 indicates a wider range of version -// compatibility than strictly required for rollback. A wide range of compatibility is -// desirable because it means that CEL expressions are portable across a wider range -// of Kubernetes versions. -func DefaultCompatibilityVersion() *version.Version { - return version.MajorMinor(1, 28) -} - -var baseOpts = []VersionedOptions{ - { - // CEL epoch was actually 1.23, but we artificially set it to 1.0 because these - // options should always be present. - IntroducedVersion: version.MajorMinor(1, 0), - EnvOptions: []cel.EnvOption{ - cel.HomogeneousAggregateLiterals(), - // Validate function declarations once during base env initialization, - // so they don't need to be evaluated each time a CEL rule is compiled. - // This is a relatively expensive operation. - cel.EagerlyValidateDeclarations(true), - cel.DefaultUTCTimeZone(true), - - library.URLs(), - library.Regex(), - library.Lists(), - }, - ProgramOptions: []cel.ProgramOption{ - cel.EvalOptions(cel.OptOptimize, cel.OptTrackCost), - cel.CostLimit(celconfig.PerCallLimit), - }, - }, - { - IntroducedVersion: version.MajorMinor(1, 27), - EnvOptions: []cel.EnvOption{ - library.Authz(), - }, - }, - { - IntroducedVersion: version.MajorMinor(1, 28), - EnvOptions: []cel.EnvOption{ - cel.CrossTypeNumericComparisons(true), - cel.OptionalTypes(), - library.Quantity(), - }, - }, - // add the new validator in 1.29 - { - IntroducedVersion: version.MajorMinor(1, 29), - EnvOptions: []cel.EnvOption{ - cel.ASTValidators( - cel.ValidateDurationLiterals(), - cel.ValidateTimestampLiterals(), - cel.ValidateRegexLiterals(), - cel.ValidateHomogeneousAggregateLiterals(), - ), - }, - }, - // String library - { - IntroducedVersion: version.MajorMinor(1, 0), - RemovedVersion: version.MajorMinor(1, 29), - EnvOptions: []cel.EnvOption{ - ext.Strings(ext.StringsVersion(0)), - }, - }, - { - IntroducedVersion: version.MajorMinor(1, 29), - EnvOptions: []cel.EnvOption{ - ext.Strings(ext.StringsVersion(2)), - }, - }, - // Set library - { - IntroducedVersion: version.MajorMinor(1, 29), - EnvOptions: []cel.EnvOption{ - ext.Sets(), - // cel-go v0.17.7 introduced CostEstimatorOptions. - // Previous the presence has a cost of 0 but cel fixed it to 1. We still set to 0 here to avoid breaking changes. - cel.CostEstimatorOptions(checker.PresenceTestHasCost(false)), - }, - ProgramOptions: []cel.ProgramOption{ - // cel-go v0.17.7 introduced CostTrackerOptions. - // Previous the presence has a cost of 0 but cel fixed it to 1. We still set to 0 here to avoid breaking changes. - cel.CostTrackerOptions(interpreter.PresenceTestHasCost(false)), - }, - }, -} - -// MustBaseEnvSet returns the common CEL base environments for Kubernetes for Version, or panics -// if the version is nil, or does not have major and minor components. -// -// The returned environment contains function libraries, language settings, optimizations and -// runtime cost limits appropriate CEL as it is used in Kubernetes. -// -// The returned environment contains no CEL variable definitions or custom type declarations and -// should be extended to construct environments with the appropriate variable definitions, -// type declarations and any other needed configuration. -func MustBaseEnvSet(ver *version.Version) *EnvSet { - if ver == nil { - panic("version must be non-nil") - } - if len(ver.Components()) < 2 { - panic(fmt.Sprintf("version must contain an major and minor component, but got: %s", ver.String())) - } - key := strconv.FormatUint(uint64(ver.Major()), 10) + "." + strconv.FormatUint(uint64(ver.Minor()), 10) - if entry, ok := baseEnvs.Load(key); ok { - return entry.(*EnvSet) - } - - entry, _, _ := baseEnvsSingleflight.Do(key, func() (interface{}, error) { - entry := mustNewEnvSet(ver, baseOpts) - baseEnvs.Store(key, entry) - return entry, nil - }) - return entry.(*EnvSet) -} - -var ( - baseEnvs = sync.Map{} - baseEnvsSingleflight = &singleflight.Group{} -) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/environment/environment.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/environment/environment.go deleted file mode 100644 index b47bc8e984be..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/environment/environment.go +++ /dev/null @@ -1,274 +0,0 @@ -/* -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 environment - -import ( - "fmt" - "math" - - "github.com/google/cel-go/cel" - - "k8s.io/apimachinery/pkg/util/version" - apiservercel "k8s.io/apiserver/pkg/cel" -) - -// Type defines the different types of CEL environments used in Kubernetes. -// CEL environments are used to compile and evaluate CEL expressions. -// Environments include: -// - Function libraries -// - Variables -// - Types (both core CEL types and Kubernetes types) -// - Other CEL environment and program options -type Type string - -const ( - // NewExpressions is used to validate new or modified expressions in - // requests that write expressions to API resources. - // - // This environment type is compatible with a specific Kubernetes - // major/minor version. To ensure safe rollback, this environment type - // may not include all the function libraries, variables, type declarations, and CEL - // language settings available in the StoredExpressions environment type. - // - // NewExpressions must be used to validate (parse, compile, type check) - // all new or modified CEL expressions before they are written to storage. - NewExpressions Type = "NewExpressions" - - // StoredExpressions is used to compile and run CEL expressions that have been - // persisted to storage. - // - // This environment type is compatible with CEL expressions that have been - // persisted to storage by all known versions of Kubernetes. This is the most - // permissive environment available. - // - // StoredExpressions is appropriate for use with CEL expressions in - // configuration files. - StoredExpressions Type = "StoredExpressions" -) - -// EnvSet manages the creation and extension of CEL environments. Each EnvSet contains -// both an NewExpressions and StoredExpressions environment. EnvSets are created -// and extended using VersionedOptions so that the EnvSet can prepare environments according -// to what options were introduced at which versions. -// -// Each EnvSet is given a compatibility version when it is created, and prepares the -// NewExpressions environment to be compatible with that version. The EnvSet also -// prepares StoredExpressions to be compatible with all known versions of Kubernetes. -type EnvSet struct { - // compatibilityVersion is the version that all configuration in - // the NewExpressions environment is compatible with. - compatibilityVersion *version.Version - - // newExpressions is an environment containing only configuration - // in this EnvSet that is enabled at this compatibilityVersion. - newExpressions *cel.Env - - // storedExpressions is an environment containing the latest configuration - // in this EnvSet. - storedExpressions *cel.Env -} - -func newEnvSet(compatibilityVersion *version.Version, opts []VersionedOptions) (*EnvSet, error) { - base, err := cel.NewEnv() - if err != nil { - return nil, err - } - baseSet := EnvSet{compatibilityVersion: compatibilityVersion, newExpressions: base, storedExpressions: base} - return baseSet.Extend(opts...) -} - -func mustNewEnvSet(ver *version.Version, opts []VersionedOptions) *EnvSet { - envSet, err := newEnvSet(ver, opts) - if err != nil { - panic(fmt.Sprintf("Default environment misconfigured: %v", err)) - } - return envSet -} - -// NewExpressionsEnv returns the NewExpressions environment Type for this EnvSet. -// See NewExpressions for details. -func (e *EnvSet) NewExpressionsEnv() *cel.Env { - return e.newExpressions -} - -// StoredExpressionsEnv returns the StoredExpressions environment Type for this EnvSet. -// See StoredExpressions for details. -func (e *EnvSet) StoredExpressionsEnv() *cel.Env { - return e.storedExpressions -} - -// Env returns the CEL environment for the given Type. -func (e *EnvSet) Env(envType Type) (*cel.Env, error) { - switch envType { - case NewExpressions: - return e.newExpressions, nil - case StoredExpressions: - return e.storedExpressions, nil - default: - return nil, fmt.Errorf("unsupported environment type: %v", envType) - } -} - -// VersionedOptions provides a set of CEL configuration options as well as the version the -// options were introduced and, optionally, the version the options were removed. -type VersionedOptions struct { - // IntroducedVersion is the version at which these options were introduced. - // The NewExpressions environment will only include options introduced at or before the - // compatibility version of the EnvSet. - // - // For example, to configure a CEL environment with an "object" variable bound to a - // resource kind, first create a DeclType from the groupVersionKind of the resource and then - // populate a VersionedOptions with the variable and the type: - // - // schema := schemaResolver.ResolveSchema(groupVersionKind) - // objectType := apiservercel.SchemaDeclType(schema, true) - // ... - // VersionOptions{ - // IntroducedVersion: version.MajorMinor(1, 26), - // DeclTypes: []*apiservercel.DeclType{ objectType }, - // EnvOptions: []cel.EnvOption{ cel.Variable("object", objectType.CelType()) }, - // }, - // - // To create an DeclType from a CRD, use a structural schema. For example: - // - // schema := structuralschema.NewStructural(crdJSONProps) - // objectType := apiservercel.SchemaDeclType(schema, true) - // - // Required. - IntroducedVersion *version.Version - // RemovedVersion is the version at which these options were removed. - // The NewExpressions environment will not include options removed at or before the - // compatibility version of the EnvSet. - // - // All option removals must be backward compatible; the removal must either be paired - // with a compatible replacement introduced at the same version, or the removal must be non-breaking. - // The StoredExpressions environment will not include removed options. - // - // A function library may be upgraded by setting the RemovedVersion of the old library - // to the same value as the IntroducedVersion of the new library. The new library must - // be backward compatible with the old library. - // - // For example: - // - // VersionOptions{ - // IntroducedVersion: version.MajorMinor(1, 26), RemovedVersion: version.MajorMinor(1, 27), - // EnvOptions: []cel.EnvOption{ libraries.Example(libraries.ExampleVersion(1)) }, - // }, - // VersionOptions{ - // IntroducedVersion: version.MajorMinor(1, 27), - // EnvOptions: []EnvOptions{ libraries.Example(libraries.ExampleVersion(2)) }, - // }, - // - // Optional. - RemovedVersion *version.Version - - // EnvOptions provides CEL EnvOptions. This may be used to add a cel.Variable, a - // cel.Library, or to enable other CEL EnvOptions such as language settings. - // - // If an added cel.Variable has an OpenAPI type, the type must be included in DeclTypes. - EnvOptions []cel.EnvOption - // ProgramOptions provides CEL ProgramOptions. This may be used to set a cel.CostLimit, - // enable optimizations, and set other program level options that should be enabled - // for all programs using this environment. - ProgramOptions []cel.ProgramOption - // DeclTypes provides OpenAPI type declarations to register with the environment. - // - // If cel.Variables added to EnvOptions refer to a OpenAPI type, the type must be included in - // DeclTypes. - DeclTypes []*apiservercel.DeclType -} - -// Extend returns an EnvSet based on this EnvSet but extended with given VersionedOptions. -// This EnvSet is not mutated. -// The returned EnvSet has the same compatibility version as the EnvSet that was extended. -// -// Extend is an expensive operation and each call to Extend that adds DeclTypes increases -// the depth of a chain of resolvers. For these reasons, calls to Extend should be kept -// to a minimum. -// -// Some best practices: -// -// - Minimize calls Extend when handling API requests. Where possible, call Extend -// when initializing components. -// - If an EnvSets returned by Extend can be used to compile multiple CEL programs, -// call Extend once and reuse the returned EnvSets. -// - Prefer a single call to Extend with a full list of VersionedOptions over -// making multiple calls to Extend. -func (e *EnvSet) Extend(options ...VersionedOptions) (*EnvSet, error) { - if len(options) > 0 { - newExprOpts, err := e.filterAndBuildOpts(e.newExpressions, e.compatibilityVersion, options) - if err != nil { - return nil, err - } - p, err := e.newExpressions.Extend(newExprOpts) - if err != nil { - return nil, err - } - storedExprOpt, err := e.filterAndBuildOpts(e.storedExpressions, version.MajorMinor(math.MaxUint, math.MaxUint), options) - if err != nil { - return nil, err - } - s, err := e.storedExpressions.Extend(storedExprOpt) - if err != nil { - return nil, err - } - return &EnvSet{compatibilityVersion: e.compatibilityVersion, newExpressions: p, storedExpressions: s}, nil - } - return e, nil -} - -func (e *EnvSet) filterAndBuildOpts(base *cel.Env, compatVer *version.Version, opts []VersionedOptions) (cel.EnvOption, error) { - var envOpts []cel.EnvOption - var progOpts []cel.ProgramOption - var declTypes []*apiservercel.DeclType - - for _, opt := range opts { - if compatVer.AtLeast(opt.IntroducedVersion) && (opt.RemovedVersion == nil || compatVer.LessThan(opt.RemovedVersion)) { - envOpts = append(envOpts, opt.EnvOptions...) - progOpts = append(progOpts, opt.ProgramOptions...) - declTypes = append(declTypes, opt.DeclTypes...) - } - } - - if len(declTypes) > 0 { - provider := apiservercel.NewDeclTypeProvider(declTypes...) - providerOpts, err := provider.EnvOptions(base.TypeProvider()) - if err != nil { - return nil, err - } - envOpts = append(envOpts, providerOpts...) - } - - combined := cel.Lib(&envLoader{ - envOpts: envOpts, - progOpts: progOpts, - }) - return combined, nil -} - -type envLoader struct { - envOpts []cel.EnvOption - progOpts []cel.ProgramOption -} - -func (e *envLoader) CompileOptions() []cel.EnvOption { - return e.envOpts -} - -func (e *envLoader) ProgramOptions() []cel.ProgramOption { - return e.progOpts -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/lazy/lazy.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/lazy/lazy.go deleted file mode 100644 index 16183050d9b7..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/lazy/lazy.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -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 lazy - -import ( - "fmt" - "reflect" - - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "github.com/google/cel-go/common/types/traits" - - "k8s.io/apiserver/pkg/cel" -) - -type GetFieldFunc func(*MapValue) ref.Val - -var _ ref.Val = (*MapValue)(nil) -var _ traits.Mapper = (*MapValue)(nil) - -// MapValue is a map that lazily evaluate its value when a field is first accessed. -// The map value is not designed to be thread-safe. -type MapValue struct { - typeValue *types.Type - - // values are previously evaluated values obtained from callbacks - values map[string]ref.Val - // callbacks are a map of field name to the function that returns the field Val - callbacks map[string]GetFieldFunc - // knownValues are registered names, used for iteration - knownValues []string -} - -func NewMapValue(objectType ref.Type) *MapValue { - return &MapValue{ - typeValue: types.NewTypeValue(objectType.TypeName(), traits.IndexerType|traits.FieldTesterType|traits.IterableType), - values: map[string]ref.Val{}, - callbacks: map[string]GetFieldFunc{}, - } -} - -// Append adds the given field with its name and callback. -func (m *MapValue) Append(name string, callback GetFieldFunc) { - m.knownValues = append(m.knownValues, name) - m.callbacks[name] = callback -} - -// Contains checks if the key is known to the map -func (m *MapValue) Contains(key ref.Val) ref.Val { - v, found := m.Find(key) - if v != nil && types.IsUnknownOrError(v) { - return v - } - return types.Bool(found) -} - -// Iterator returns an iterator to traverse the map. -func (m *MapValue) Iterator() traits.Iterator { - return &iterator{parent: m, index: 0} -} - -// Size returns the number of currently known fields -func (m *MapValue) Size() ref.Val { - return types.Int(len(m.callbacks)) -} - -// ConvertToNative returns an error because it is disallowed -func (m *MapValue) ConvertToNative(typeDesc reflect.Type) (any, error) { - return nil, fmt.Errorf("disallowed conversion from %q to %q", m.typeValue.TypeName(), typeDesc.Name()) -} - -// ConvertToType converts the map to the given type. -// Only its own type and "Type" type are allowed. -func (m *MapValue) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case m.typeValue: - return m - case types.TypeType: - return m.typeValue - } - return types.NewErr("disallowed conversion from %q to %q", m.typeValue.TypeName(), typeVal.TypeName()) -} - -// Equal returns true if the other object is the same pointer-wise. -func (m *MapValue) Equal(other ref.Val) ref.Val { - otherMap, ok := other.(*MapValue) - if !ok { - return types.MaybeNoSuchOverloadErr(other) - } - return types.Bool(m == otherMap) -} - -// Type returns its registered type. -func (m *MapValue) Type() ref.Type { - return m.typeValue -} - -// Value is not allowed. -func (m *MapValue) Value() any { - return types.NoSuchOverloadErr() -} - -// resolveField resolves the field. Calls the callback if the value is not yet stored. -func (m *MapValue) resolveField(name string) ref.Val { - v, seen := m.values[name] - if seen { - return v - } - f := m.callbacks[name] - v = f(m) - m.values[name] = v - return v -} - -func (m *MapValue) Find(key ref.Val) (ref.Val, bool) { - n, ok := key.(types.String) - if !ok { - return types.MaybeNoSuchOverloadErr(n), true - } - name, ok := cel.Unescape(n.Value().(string)) - if !ok { - return nil, false - } - if _, exists := m.callbacks[name]; !exists { - return nil, false - } - return m.resolveField(name), true -} - -func (m *MapValue) Get(key ref.Val) ref.Val { - v, found := m.Find(key) - if found { - return v - } - return types.ValOrErr(key, "no such key: %v", key) -} - -type iterator struct { - parent *MapValue - index int -} - -func (i *iterator) ConvertToNative(typeDesc reflect.Type) (any, error) { - return nil, fmt.Errorf("disallowed conversion to %q", typeDesc.Name()) -} - -func (i *iterator) ConvertToType(typeValue ref.Type) ref.Val { - return types.NewErr("disallowed conversion o %q", typeValue.TypeName()) -} - -func (i *iterator) Equal(other ref.Val) ref.Val { - otherIterator, ok := other.(*iterator) - if !ok { - return types.MaybeNoSuchOverloadErr(other) - } - return types.Bool(otherIterator == i) -} - -func (i *iterator) Type() ref.Type { - return types.IteratorType -} - -func (i *iterator) Value() any { - return nil -} - -func (i *iterator) HasNext() ref.Val { - return types.Bool(i.index < len(i.parent.knownValues)) -} - -func (i *iterator) Next() ref.Val { - ret := i.parent.Get(types.String(i.parent.knownValues[i.index])) - i.index++ - return ret -} - -var _ traits.Iterator = (*iterator)(nil) diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/library/quantity.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/library/quantity.go deleted file mode 100644 index b4ac91c8a725..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/library/quantity.go +++ /dev/null @@ -1,380 +0,0 @@ -/* -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 library - -import ( - "errors" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - - "k8s.io/apimachinery/pkg/api/resource" - apiservercel "k8s.io/apiserver/pkg/cel" -) - -// Quantity provides a CEL function library extension of Kubernetes -// resource.Quantity parsing functions. See `resource.Quantity` -// documentation for more detailed information about the format itself: -// https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity -// -// quantity -// -// Converts a string to a Quantity or results in an error if the string is not a valid Quantity. Refer -// to resource.Quantity documentation for information on accepted patterns. -// -// quantity() -// -// Examples: -// -// quantity('1.5G') // returns a Quantity -// quantity('200k') // returns a Quantity -// quantity('200K') // error -// quantity('Three') // error -// quantity('Mi') // error -// -// isQuantity -// -// Returns true if a string is a valid Quantity. isQuantity returns true if and -// only if quantity does not result in error. -// -// isQuantity( ) -// -// Examples: -// -// isQuantity('1.3G') // returns true -// isQuantity('1.3Gi') // returns true -// isQuantity('1,3G') // returns false -// isQuantity('10000k') // returns true -// isQuantity('200K') // returns false -// isQuantity('Three') // returns false -// isQuantity('Mi') // returns false -// -// Conversion to Scalars: -// -// - isInteger: returns true if and only if asInteger is safe to call without an error -// -// - asInteger: returns a representation of the current value as an int64 if -// possible or results in an error if conversion would result in overflow -// or loss of precision. -// -// - asApproximateFloat: returns a float64 representation of the quantity which may -// lose precision. If the value of the quantity is outside the range of a float64 -// +Inf/-Inf will be returned. -// -// .isInteger() -// .asInteger() -// .asApproximateFloat() -// -// Examples: -// -// quantity("50000000G").isInteger() // returns true -// quantity("50k").isInteger() // returns true -// quantity("9999999999999999999999999999999999999G").asInteger() // error: cannot convert value to integer -// quantity("9999999999999999999999999999999999999G").isInteger() // returns false -// quantity("50k").asInteger() == 50000 // returns true -// quantity("50k").sub(20000).asApproximateFloat() == 30000 // returns true -// -// Arithmetic -// -// - sign: Returns `1` if the quantity is positive, `-1` if it is negative. `0` if it is zero -// -// - add: Returns sum of two quantities or a quantity and an integer -// -// - sub: Returns difference between two quantities or a quantity and an integer -// -// .sign() -// .add() -// .add() -// .sub() -// .sub() -// -// Examples: -// -// quantity("50k").add("20k") == quantity("70k") // returns true -// quantity("50k").add(20) == quantity("50020") // returns true -// quantity("50k").sub("20k") == quantity("30k") // returns true -// quantity("50k").sub(20000) == quantity("30k") // returns true -// quantity("50k").add(20).sub(quantity("100k")).sub(-50000) == quantity("20") // returns true -// -// Comparisons -// -// - isGreaterThan: Returns true if and only if the receiver is greater than the operand -// -// - isLessThan: Returns true if and only if the receiver is less than the operand -// -// - compareTo: Compares receiver to operand and returns 0 if they are equal, 1 if the receiver is greater, or -1 if the receiver is less than the operand -// -// -// .isLessThan() -// .isGreaterThan() -// .compareTo() -// -// Examples: -// -// quantity("200M").compareTo(quantity("0.2G")) // returns 0 -// quantity("50M").compareTo(quantity("50Mi")) // returns -1 -// quantity("50Mi").compareTo(quantity("50M")) // returns 1 -// quantity("150Mi").isGreaterThan(quantity("100Mi")) // returns true -// quantity("50Mi").isGreaterThan(quantity("100Mi")) // returns false -// quantity("50M").isLessThan(quantity("100M")) // returns true -// quantity("100M").isLessThan(quantity("50M")) // returns false - -func Quantity() cel.EnvOption { - return cel.Lib(quantityLib) -} - -var quantityLib = &quantity{} - -type quantity struct{} - -func (*quantity) LibraryName() string { - return "k8s.quantity" -} - -var quantityLibraryDecls = map[string][]cel.FunctionOpt{ - "quantity": { - cel.Overload("string_to_quantity", []*cel.Type{cel.StringType}, apiservercel.QuantityType, cel.UnaryBinding((stringToQuantity))), - }, - "isQuantity": { - cel.Overload("is_quantity_string", []*cel.Type{cel.StringType}, cel.BoolType, cel.UnaryBinding(isQuantity)), - }, - "sign": { - cel.Overload("quantity_sign", []*cel.Type{apiservercel.QuantityType}, cel.IntType, cel.UnaryBinding(quantityGetSign)), - }, - "isGreaterThan": { - cel.MemberOverload("quantity_is_greater_than", []*cel.Type{apiservercel.QuantityType, apiservercel.QuantityType}, cel.BoolType, cel.BinaryBinding(quantityIsGreaterThan)), - }, - "isLessThan": { - cel.MemberOverload("quantity_is_less_than", []*cel.Type{apiservercel.QuantityType, apiservercel.QuantityType}, cel.BoolType, cel.BinaryBinding(quantityIsLessThan)), - }, - "compareTo": { - cel.MemberOverload("quantity_compare_to", []*cel.Type{apiservercel.QuantityType, apiservercel.QuantityType}, cel.IntType, cel.BinaryBinding(quantityCompareTo)), - }, - "asApproximateFloat": { - cel.MemberOverload("quantity_get_float", []*cel.Type{apiservercel.QuantityType}, cel.DoubleType, cel.UnaryBinding(quantityGetApproximateFloat)), - }, - "asInteger": { - cel.MemberOverload("quantity_get_int", []*cel.Type{apiservercel.QuantityType}, cel.IntType, cel.UnaryBinding(quantityGetValue)), - }, - "isInteger": { - cel.MemberOverload("quantity_is_integer", []*cel.Type{apiservercel.QuantityType}, cel.BoolType, cel.UnaryBinding(quantityCanValue)), - }, - "add": { - cel.MemberOverload("quantity_add", []*cel.Type{apiservercel.QuantityType, apiservercel.QuantityType}, apiservercel.QuantityType, cel.BinaryBinding(quantityAdd)), - cel.MemberOverload("quantity_add_int", []*cel.Type{apiservercel.QuantityType, cel.IntType}, apiservercel.QuantityType, cel.BinaryBinding(quantityAddInt)), - }, - "sub": { - cel.MemberOverload("quantity_sub", []*cel.Type{apiservercel.QuantityType, apiservercel.QuantityType}, apiservercel.QuantityType, cel.BinaryBinding(quantitySub)), - cel.MemberOverload("quantity_sub_int", []*cel.Type{apiservercel.QuantityType, cel.IntType}, apiservercel.QuantityType, cel.BinaryBinding(quantitySubInt)), - }, -} - -func (*quantity) CompileOptions() []cel.EnvOption { - options := make([]cel.EnvOption, 0, len(quantityLibraryDecls)) - for name, overloads := range quantityLibraryDecls { - options = append(options, cel.Function(name, overloads...)) - } - return options -} - -func (*quantity) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} - -func isQuantity(arg ref.Val) ref.Val { - str, ok := arg.Value().(string) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - _, err := resource.ParseQuantity(str) - if err != nil { - return types.Bool(false) - } - - return types.Bool(true) -} - -func stringToQuantity(arg ref.Val) ref.Val { - str, ok := arg.Value().(string) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q, err := resource.ParseQuantity(str) - if err != nil { - return types.WrapErr(err) - } - - return apiservercel.Quantity{Quantity: &q} -} - -func quantityGetApproximateFloat(arg ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - return types.Double(q.AsApproximateFloat64()) -} - -func quantityCanValue(arg ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - _, success := q.AsInt64() - return types.Bool(success) -} - -func quantityGetValue(arg ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - v, success := q.AsInt64() - if !success { - return types.WrapErr(errors.New("cannot convert value to integer")) - } - return types.Int(v) -} - -func quantityGetSign(arg ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - return types.Int(q.Sign()) -} - -func quantityIsGreaterThan(arg ref.Val, other ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2, ok := other.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - return types.Bool(q.Cmp(*q2) == 1) -} - -func quantityIsLessThan(arg ref.Val, other ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2, ok := other.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - return types.Bool(q.Cmp(*q2) == -1) -} - -func quantityCompareTo(arg ref.Val, other ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2, ok := other.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - return types.Int(q.Cmp(*q2)) -} - -func quantityAdd(arg ref.Val, other ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2, ok := other.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - copy := *q - copy.Add(*q2) - return &apiservercel.Quantity{ - Quantity: ©, - } -} - -func quantityAddInt(arg ref.Val, other ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2, ok := other.Value().(int64) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2Converted := *resource.NewQuantity(q2, resource.DecimalExponent) - - copy := *q - copy.Add(q2Converted) - return &apiservercel.Quantity{ - Quantity: ©, - } -} - -func quantitySub(arg ref.Val, other ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2, ok := other.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - copy := *q - copy.Sub(*q2) - return &apiservercel.Quantity{ - Quantity: ©, - } -} - -func quantitySubInt(arg ref.Val, other ref.Val) ref.Val { - q, ok := arg.Value().(*resource.Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2, ok := other.Value().(int64) - if !ok { - return types.MaybeNoSuchOverloadErr(arg) - } - - q2Converted := *resource.NewQuantity(q2, resource.DecimalExponent) - - copy := *q - copy.Sub(q2Converted) - return &apiservercel.Quantity{ - Quantity: ©, - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/library/test.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/library/test.go deleted file mode 100644 index dcbc058a1105..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/library/test.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -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 library - -import ( - "math" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" -) - -// Test provides a test() function that returns true. -func Test(options ...TestOption) cel.EnvOption { - t := &testLib{version: math.MaxUint32} - for _, o := range options { - t = o(t) - } - return cel.Lib(t) -} - -type testLib struct { - version uint32 -} - -func (*testLib) LibraryName() string { - return "k8s.test" -} - -type TestOption func(*testLib) *testLib - -func TestVersion(version uint32) func(lib *testLib) *testLib { - return func(sl *testLib) *testLib { - sl.version = version - return sl - } -} - -func (t *testLib) CompileOptions() []cel.EnvOption { - var options []cel.EnvOption - - if t.version == 0 { - options = append(options, cel.Function("test", - cel.Overload("test", []*cel.Type{}, cel.BoolType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - return types.True - })))) - } - - if t.version >= 1 { - options = append(options, cel.Function("test", - cel.Overload("test", []*cel.Type{}, cel.BoolType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - // Return false here so tests can observe which version of the function is registered - // Actual function libraries must not break backward compatibility - return types.False - })))) - options = append(options, cel.Function("testV1", - cel.Overload("testV1", []*cel.Type{}, cel.BoolType, - cel.FunctionBinding(func(args ...ref.Val) ref.Val { - return types.True - })))) - } - return options -} - -func (*testLib) ProgramOptions() []cel.ProgramOption { - return []cel.ProgramOption{} -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/openapi/resolver/combined.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/openapi/resolver/combined.go deleted file mode 100644 index eb3c3763556a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/openapi/resolver/combined.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 resolver - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -// Combine combines the DefinitionsSchemaResolver with a secondary schema resolver. -// The resulting schema resolver uses the DefinitionsSchemaResolver for a GVK that DefinitionsSchemaResolver knows, -// and the secondary otherwise. -func (d *DefinitionsSchemaResolver) Combine(secondary SchemaResolver) SchemaResolver { - return &combinedSchemaResolver{definitions: d, secondary: secondary} -} - -type combinedSchemaResolver struct { - definitions *DefinitionsSchemaResolver - secondary SchemaResolver -} - -// ResolveSchema takes a GroupVersionKind (GVK) and returns the OpenAPI schema -// identified by the GVK. -// If the DefinitionsSchemaResolver knows the gvk, the DefinitionsSchemaResolver handles the resolution, -// otherwise, the secondary does. -func (r *combinedSchemaResolver) ResolveSchema(gvk schema.GroupVersionKind) (*spec.Schema, error) { - if _, ok := r.definitions.gvkToRef[gvk]; ok { - return r.definitions.ResolveSchema(gvk) - } - return r.secondary.ResolveSchema(gvk) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/quantity.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/quantity.go deleted file mode 100644 index 1057e33fe8e7..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/cel/quantity.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -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 cel - -import ( - "fmt" - "reflect" - - "github.com/google/cel-go/cel" - "github.com/google/cel-go/checker/decls" - "github.com/google/cel-go/common/types" - "github.com/google/cel-go/common/types/ref" - "k8s.io/apimachinery/pkg/api/resource" -) - -var ( - QuantityObject = decls.NewObjectType("kubernetes.Quantity") - quantityTypeValue = types.NewTypeValue("kubernetes.Quantity") - QuantityType = cel.ObjectType("kubernetes.Quantity") -) - -// Quantity provdes a CEL representation of a resource.Quantity -type Quantity struct { - *resource.Quantity -} - -func (d Quantity) ConvertToNative(typeDesc reflect.Type) (interface{}, error) { - if reflect.TypeOf(d.Quantity).AssignableTo(typeDesc) { - return d.Quantity, nil - } - if reflect.TypeOf("").AssignableTo(typeDesc) { - return d.Quantity.String(), nil - } - return nil, fmt.Errorf("type conversion error from 'Quantity' to '%v'", typeDesc) -} - -func (d Quantity) ConvertToType(typeVal ref.Type) ref.Val { - switch typeVal { - case typeValue: - return d - case types.TypeType: - return quantityTypeValue - default: - return types.NewErr("type conversion error from '%s' to '%s'", quantityTypeValue, typeVal) - } -} - -func (d Quantity) Equal(other ref.Val) ref.Val { - otherDur, ok := other.(Quantity) - if !ok { - return types.MaybeNoSuchOverloadErr(other) - } - return types.Bool(d.Quantity.Equal(*otherDur.Quantity)) -} - -func (d Quantity) Type() ref.Type { - return quantityTypeValue -} - -func (d Quantity) Value() interface{} { - return d.Quantity -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics/metrics.go deleted file mode 100644 index 70414035fed3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/metrics/metrics.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -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 metrics - -import ( - "crypto/sha256" - "fmt" - "hash" - "sync" - - "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -const ( - namespace = "apiserver" - subsystem = "encryption_config_controller" -) - -var ( - encryptionConfigAutomaticReloadFailureTotal = metrics.NewCounterVec( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "automatic_reload_failures_total", - Help: "Total number of failed automatic reloads of encryption configuration split by apiserver identity.", - StabilityLevel: metrics.ALPHA, - }, - []string{"apiserver_id_hash"}, - ) - - encryptionConfigAutomaticReloadSuccessTotal = metrics.NewCounterVec( - &metrics.CounterOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "automatic_reload_success_total", - Help: "Total number of successful automatic reloads of encryption configuration split by apiserver identity.", - StabilityLevel: metrics.ALPHA, - }, - []string{"apiserver_id_hash"}, - ) - - encryptionConfigAutomaticReloadLastTimestampSeconds = metrics.NewGaugeVec( - &metrics.GaugeOpts{ - Namespace: namespace, - Subsystem: subsystem, - Name: "automatic_reload_last_timestamp_seconds", - Help: "Timestamp of the last successful or failed automatic reload of encryption configuration split by apiserver identity.", - StabilityLevel: metrics.ALPHA, - }, - []string{"status", "apiserver_id_hash"}, - ) -) - -var registerMetrics sync.Once -var hashPool *sync.Pool - -func RegisterMetrics() { - registerMetrics.Do(func() { - hashPool = &sync.Pool{ - New: func() interface{} { - return sha256.New() - }, - } - legacyregistry.MustRegister(encryptionConfigAutomaticReloadFailureTotal) - legacyregistry.MustRegister(encryptionConfigAutomaticReloadSuccessTotal) - legacyregistry.MustRegister(encryptionConfigAutomaticReloadLastTimestampSeconds) - }) -} - -func RecordEncryptionConfigAutomaticReloadFailure(apiServerID string) { - apiServerIDHash := getHash(apiServerID) - encryptionConfigAutomaticReloadFailureTotal.WithLabelValues(apiServerIDHash).Inc() - recordEncryptionConfigAutomaticReloadTimestamp("failure", apiServerIDHash) -} - -func RecordEncryptionConfigAutomaticReloadSuccess(apiServerID string) { - apiServerIDHash := getHash(apiServerID) - encryptionConfigAutomaticReloadSuccessTotal.WithLabelValues(apiServerIDHash).Inc() - recordEncryptionConfigAutomaticReloadTimestamp("success", apiServerIDHash) -} - -func recordEncryptionConfigAutomaticReloadTimestamp(result, apiServerIDHash string) { - encryptionConfigAutomaticReloadLastTimestampSeconds.WithLabelValues(result, apiServerIDHash).SetToCurrentTime() -} - -func getHash(data string) string { - if len(data) == 0 { - return "" - } - h := hashPool.Get().(hash.Hash) - h.Reset() - h.Write([]byte(data)) - dataHash := fmt.Sprintf("sha256:%x", h.Sum(nil)) - hashPool.Put(h) - return dataHash -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/lister_watcher.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/lister_watcher.go deleted file mode 100644 index 1252e5e34959..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/lister_watcher.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -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 cacher - -import ( - "context" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/apiserver/pkg/storage" - "k8s.io/client-go/tools/cache" -) - -// listerWatcher opaques storage.Interface to expose cache.ListerWatcher. -type listerWatcher struct { - storage storage.Interface - resourcePrefix string - newListFunc func() runtime.Object -} - -// NewListerWatcher returns a storage.Interface backed ListerWatcher. -func NewListerWatcher(storage storage.Interface, resourcePrefix string, newListFunc func() runtime.Object) cache.ListerWatcher { - return &listerWatcher{ - storage: storage, - resourcePrefix: resourcePrefix, - newListFunc: newListFunc, - } -} - -// Implements cache.ListerWatcher interface. -func (lw *listerWatcher) List(options metav1.ListOptions) (runtime.Object, error) { - list := lw.newListFunc() - pred := storage.SelectionPredicate{ - Label: labels.Everything(), - Field: fields.Everything(), - Limit: options.Limit, - Continue: options.Continue, - } - - storageOpts := storage.ListOptions{ - ResourceVersionMatch: options.ResourceVersionMatch, - Predicate: pred, - Recursive: true, - } - if err := lw.storage.GetList(context.TODO(), lw.resourcePrefix, storageOpts, list); err != nil { - return nil, err - } - return list, nil -} - -// Implements cache.ListerWatcher interface. -func (lw *listerWatcher) Watch(options metav1.ListOptions) (watch.Interface, error) { - opts := storage.ListOptions{ - ResourceVersion: options.ResourceVersion, - Predicate: storage.Everything, - Recursive: true, - ProgressNotify: true, - } - return lw.storage.Watch(context.TODO(), lw.resourcePrefix, opts) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go deleted file mode 100644 index f44ca9325b88..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -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 cacher - -import ( - "context" - "sync" - "time" - - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - - "k8s.io/klog/v2" - "k8s.io/utils/clock" -) - -const ( - // progressRequestPeriod determines period of requesting progress - // from etcd when there is a request waiting for watch cache to be fresh. - progressRequestPeriod = 100 * time.Millisecond -) - -func newConditionalProgressRequester(requestWatchProgress WatchProgressRequester, clock TickerFactory) *conditionalProgressRequester { - pr := &conditionalProgressRequester{ - clock: clock, - requestWatchProgress: requestWatchProgress, - } - pr.cond = sync.NewCond(pr.mux.RLocker()) - return pr -} - -type WatchProgressRequester func(ctx context.Context) error - -type TickerFactory interface { - NewTicker(time.Duration) clock.Ticker -} - -// conditionalProgressRequester will request progress notification if there -// is a request waiting for watch cache to be fresh. -type conditionalProgressRequester struct { - clock TickerFactory - requestWatchProgress WatchProgressRequester - - mux sync.RWMutex - cond *sync.Cond - waiting int - stopped bool -} - -func (pr *conditionalProgressRequester) Run(stopCh <-chan struct{}) { - ctx := wait.ContextForChannel(stopCh) - go func() { - defer utilruntime.HandleCrash() - <-stopCh - pr.mux.Lock() - defer pr.mux.Unlock() - pr.stopped = true - pr.cond.Signal() - }() - ticker := pr.clock.NewTicker(progressRequestPeriod) - defer ticker.Stop() - for { - stopped := func() bool { - pr.mux.RLock() - defer pr.mux.RUnlock() - for pr.waiting == 0 && !pr.stopped { - pr.cond.Wait() - } - return pr.stopped - }() - if stopped { - return - } - - select { - case <-ticker.C(): - shouldRequest := func() bool { - pr.mux.RLock() - defer pr.mux.RUnlock() - return pr.waiting > 0 && !pr.stopped - }() - if !shouldRequest { - continue - } - err := pr.requestWatchProgress(ctx) - if err != nil { - klog.V(4).InfoS("Error requesting bookmark", "err", err) - } - case <-stopCh: - return - } - } -} - -func (pr *conditionalProgressRequester) Add() { - pr.mux.Lock() - defer pr.mux.Unlock() - pr.waiting += 1 - pr.cond.Signal() -} - -func (pr *conditionalProgressRequester) Remove() { - pr.mux.Lock() - defer pr.mux.Unlock() - pr.waiting -= 1 - pr.cond.Signal() -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes_extended_nonce.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes_extended_nonce.go deleted file mode 100644 index cf8f39305dc4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/aes_extended_nonce.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -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 aes - -import ( - "bytes" - "context" - "crypto/aes" - "crypto/sha256" - "errors" - "fmt" - "io" - "time" - - "golang.org/x/crypto/hkdf" - - "k8s.io/apiserver/pkg/storage/value" - "k8s.io/utils/clock" -) - -const ( - // cacheTTL is the TTL of KDF cache entries. We assume that the value.Context.AuthenticatedData - // for every call is the etcd storage path of the associated resource, and use that as the primary - // cache key (with a secondary check that confirms that the info matches). Thus if a client - // is constantly creating resources with new names (and thus new paths), they will keep adding new - // entries to the cache for up to this TTL before the GC logic starts deleting old entries. Each - // entry is ~300 bytes in size, so even a malicious client will be bounded in the overall memory - // it can consume. - cacheTTL = 10 * time.Minute - - derivedKeySizeExtendedNonceGCM = commonSize - infoSizeExtendedNonceGCM - MinSeedSizeExtendedNonceGCM -) - -// NewHKDFExtendedNonceGCMTransformer is the same as NewGCMTransformer but trades storage, -// memory and CPU to work around the limitations of AES-GCM's 12 byte nonce size. The input seed -// is assumed to be a cryptographically strong slice of MinSeedSizeExtendedNonceGCM+ random bytes. -// Unlike NewGCMTransformer, this function is immune to the birthday attack because a new key is generated -// per encryption via a key derivation function: KDF(seed, random_bytes) -> key. The derived key is -// only used once as an AES-GCM key with a random 12 byte nonce. This avoids any concerns around -// cryptographic wear out (by either number of encryptions or the amount of data being encrypted). -// Speaking on the cryptographic safety, the limit on the number of operations that can be preformed -// with a single seed with derived keys and randomly generated nonces is not practically reachable. -// Thus, the scheme does not impose any specific requirements on the seed rotation schedule. -// Reusing the same seed is safe to do over time and across process restarts. Whenever a new -// seed is needed, the caller should generate it via GenerateKey(MinSeedSizeExtendedNonceGCM). -// In regard to KMSv2, organization standards or compliance policies around rotation may require -// that the seed be rotated at some interval. This can be implemented externally by rotating -// the key encryption key via a key ID change. -func NewHKDFExtendedNonceGCMTransformer(seed []byte) (value.Transformer, error) { - if seedLen := len(seed); seedLen < MinSeedSizeExtendedNonceGCM { - return nil, fmt.Errorf("invalid seed length %d used for key generation", seedLen) - } - return &extendedNonceGCM{ - seed: seed, - cache: newSimpleCache(clock.RealClock{}, cacheTTL), - }, nil -} - -type extendedNonceGCM struct { - seed []byte - cache *simpleCache -} - -func (e *extendedNonceGCM) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - if len(data) < infoSizeExtendedNonceGCM { - return nil, false, errors.New("the stored data was shorter than the required size") - } - - info := data[:infoSizeExtendedNonceGCM] - - transformer, err := e.derivedKeyTransformer(info, dataCtx, false) - if err != nil { - return nil, false, fmt.Errorf("failed to derive read key from KDF: %w", err) - } - - return transformer.TransformFromStorage(ctx, data, dataCtx) -} - -func (e *extendedNonceGCM) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - info := make([]byte, infoSizeExtendedNonceGCM) - if err := randomNonce(info); err != nil { - return nil, fmt.Errorf("failed to generate info for KDF: %w", err) - } - - transformer, err := e.derivedKeyTransformer(info, dataCtx, true) - if err != nil { - return nil, fmt.Errorf("failed to derive write key from KDF: %w", err) - } - - return transformer.TransformToStorage(ctx, data, dataCtx) -} - -func (e *extendedNonceGCM) derivedKeyTransformer(info []byte, dataCtx value.Context, write bool) (value.Transformer, error) { - if !write { // no need to check cache on write since we always generate a new transformer - if transformer := e.cache.get(info, dataCtx); transformer != nil { - return transformer, nil - } - - // on read, this is a subslice of a much larger slice and we do not want to hold onto that larger slice - info = bytes.Clone(info) - } - - key, err := e.sha256KDFExpandOnly(info) - if err != nil { - return nil, fmt.Errorf("failed to KDF expand seed with info: %w", err) - } - - transformer, err := newGCMTransformerWithInfo(key, info) - if err != nil { - return nil, fmt.Errorf("failed to build transformer with KDF derived key: %w", err) - } - - e.cache.set(dataCtx, transformer) - - return transformer, nil -} - -func (e *extendedNonceGCM) sha256KDFExpandOnly(info []byte) ([]byte, error) { - kdf := hkdf.Expand(sha256.New, e.seed, info) - - derivedKey := make([]byte, derivedKeySizeExtendedNonceGCM) - if _, err := io.ReadFull(kdf, derivedKey); err != nil { - return nil, fmt.Errorf("failed to read a derived key from KDF: %w", err) - } - - return derivedKey, nil -} - -func newGCMTransformerWithInfo(key, info []byte) (*transformerWithInfo, error) { - block, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - - transformer, err := NewGCMTransformer(block) - if err != nil { - return nil, err - } - - return &transformerWithInfo{transformer: transformer, info: info}, nil -} - -type transformerWithInfo struct { - transformer value.Transformer - // info are extra opaque bytes prepended to the writes from transformer and stripped from reads. - // currently info is used to generate a key via KDF(seed, info) -> key - // and transformer is the output of NewGCMTransformer(aes.NewCipher(key)) - info []byte -} - -func (t *transformerWithInfo) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error) { - if !bytes.HasPrefix(data, t.info) { - return nil, false, errors.New("the stored data is missing the required info prefix") - } - - return t.transformer.TransformFromStorage(ctx, data[len(t.info):], dataCtx) -} - -func (t *transformerWithInfo) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error) { - out, err := t.transformer.TransformToStorage(ctx, data, dataCtx) - if err != nil { - return nil, err - } - - outWithInfo := make([]byte, 0, len(out)+len(t.info)) - outWithInfo = append(outWithInfo, t.info...) - outWithInfo = append(outWithInfo, out...) - - return outWithInfo, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/cache.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/cache.go deleted file mode 100644 index c2551a2fbf5e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/storage/value/encrypt/aes/cache.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -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 aes - -import ( - "bytes" - "time" - "unsafe" - - utilcache "k8s.io/apimachinery/pkg/util/cache" - "k8s.io/apiserver/pkg/storage/value" - "k8s.io/utils/clock" -) - -type simpleCache struct { - cache *utilcache.Expiring - ttl time.Duration -} - -func newSimpleCache(clock clock.Clock, ttl time.Duration) *simpleCache { - cache := utilcache.NewExpiringWithClock(clock) - // "Stale" entries are always valid for us because the TTL is just used to prevent - // unbounded growth on the cache - for a given info the transformer is always the same. - // The key always corresponds to the exact same value, with the caveat that - // since we use the value.Context.AuthenticatedData to overwrite old keys, - // we always have to check that the info matches (to validate the transformer is correct). - cache.AllowExpiredGet = true - return &simpleCache{ - cache: cache, - ttl: ttl, - } -} - -// given a key, return the transformer, or nil if it does not exist in the cache -func (c *simpleCache) get(info []byte, dataCtx value.Context) *transformerWithInfo { - val, ok := c.cache.Get(keyFunc(dataCtx)) - if !ok { - return nil - } - - transformer := val.(*transformerWithInfo) - - if !bytes.Equal(transformer.info, info) { - return nil - } - - return transformer -} - -// set caches the record for the key -func (c *simpleCache) set(dataCtx value.Context, transformer *transformerWithInfo) { - if dataCtx == nil || len(dataCtx.AuthenticatedData()) == 0 { - panic("authenticated data must not be empty") - } - if transformer == nil { - panic("transformer must not be nil") - } - if len(transformer.info) == 0 { - panic("info must not be empty") - } - c.cache.Set(keyFunc(dataCtx), transformer, c.ttl) -} - -func keyFunc(dataCtx value.Context) string { - return toString(dataCtx.AuthenticatedData()) -} - -// toString performs unholy acts to avoid allocations -func toString(b []byte) string { - // unsafe.SliceData relies on cap whereas we want to rely on len - if len(b) == 0 { - return "" - } - // Copied from go 1.20.1 strings.Builder.String - // https://github.com/golang/go/blob/202a1a57064127c3f19d96df57b9f9586145e21c/src/strings/builder.go#L48 - return unsafe.String(unsafe.SliceData(b), len(b)) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/dropped_requests_tracker.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/dropped_requests_tracker.go deleted file mode 100644 index 74bf9eece630..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/dropped_requests_tracker.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -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 flowcontrol - -import ( - "sync" - "sync/atomic" - "time" - - "k8s.io/utils/clock" -) - -const ( - // maxRetryAfter represents the maximum possible retryAfter. - maxRetryAfter = int64(32) -) - -// DroppedRequestsTracker is an interface that allows tracking -// a history od dropped requests in the system for the purpose -// of adjusting RetryAfter header to avoid system overload. -type DroppedRequestsTracker interface { - // RecordDroppedRequest records a request that was just - // dropped from processing. - RecordDroppedRequest(plName string) - - // GetRetryAfter returns the current suggested value of - // RetryAfter value. - GetRetryAfter(plName string) int64 -} - -// unixStat keeps a statistic how many requests were dropped within -// a single second. -type unixStat struct { - unixTime int64 - requests int64 -} - -type droppedRequestsStats struct { - lock sync.RWMutex - - // history stores the history of dropped requests. - history []unixStat - - // To reduce lock-contention, we store the information about - // the current second here, which we can then access under - // reader lock. - currentUnix int64 - currentCount atomic.Int64 - - retryAfter atomic.Int64 - retryAfterUpdateUnix int64 -} - -func newDroppedRequestsStats(nowUnix int64) *droppedRequestsStats { - result := &droppedRequestsStats{ - // We assume that we can bump at any time after first dropped request. - retryAfterUpdateUnix: 0, - } - result.retryAfter.Store(1) - return result -} - -func (s *droppedRequestsStats) recordDroppedRequest(unixTime int64) { - // Short path - if the current second matches passed time, - // just update the stats. - if done := func() bool { - s.lock.RLock() - defer s.lock.RUnlock() - if s.currentUnix == unixTime { - s.currentCount.Add(1) - return true - } - return false - }(); done { - return - } - - // We trigger the change of . - s.lock.Lock() - defer s.lock.Unlock() - if s.currentUnix == unixTime { - s.currentCount.Add(1) - return - } - - s.updateHistory(s.currentUnix, s.currentCount.Load()) - s.currentUnix = unixTime - s.currentCount.Store(1) - - // We only consider updating retryAfter when bumping the current second. - // However, given that we didn't report anything for the current second, - // we recompute it based on statistics from the previous one. - s.updateRetryAfterIfNeededLocked(unixTime) -} - -func (s *droppedRequestsStats) updateHistory(unixTime int64, count int64) { - s.history = append(s.history, unixStat{unixTime: unixTime, requests: count}) - - startIndex := 0 - // Entries that exceed 2*retryAfter or maxRetryAfter are never going to be needed. - maxHistory := 2 * s.retryAfter.Load() - if maxHistory > maxRetryAfter { - maxHistory = maxRetryAfter - } - for ; startIndex < len(s.history) && unixTime-s.history[startIndex].unixTime > maxHistory; startIndex++ { - } - if startIndex > 0 { - s.history = s.history[startIndex:] - } -} - -// updateRetryAfterIfNeededLocked updates the retryAfter based on the number of -// dropped requests in the last `retryAfter` seconds: -// - if there were less than `retryAfter` dropped requests, it decreases -// retryAfter -// - if there were at least 3*`retryAfter` dropped requests, it increases -// retryAfter -// -// The rationale behind these numbers being fairly low is that APF is queuing -// requests and rejecting (dropping) them is a last resort, which is not expected -// unless a given priority level is actually overloaded. -// -// Additionally, we rate-limit the increases of retryAfter to wait at least -// `retryAfter' seconds after the previous increase to avoid multiple bumps -// on a single spike. -// -// We're working with the interval [unixTime-retryAfter, unixTime). -func (s *droppedRequestsStats) updateRetryAfterIfNeededLocked(unixTime int64) { - retryAfter := s.retryAfter.Load() - - droppedRequests := int64(0) - for i := len(s.history) - 1; i >= 0; i-- { - if unixTime-s.history[i].unixTime > retryAfter { - break - } - if s.history[i].unixTime < unixTime { - droppedRequests += s.history[i].requests - } - } - - if unixTime-s.retryAfterUpdateUnix >= retryAfter && droppedRequests >= 3*retryAfter { - // We try to mimic the TCP algorithm and thus are doubling - // the retryAfter here. - retryAfter *= 2 - if retryAfter >= maxRetryAfter { - retryAfter = maxRetryAfter - } - s.retryAfter.Store(retryAfter) - s.retryAfterUpdateUnix = unixTime - return - } - - if droppedRequests < retryAfter && retryAfter > 1 { - // We try to mimc the TCP algorithm and thus are linearly - // scaling down the retryAfter here. - retryAfter-- - s.retryAfter.Store(retryAfter) - return - } -} - -// droppedRequestsTracker implement DroppedRequestsTracker interface -// for the purpose of adjusting RetryAfter header for newly dropped -// requests to avoid system overload. -type droppedRequestsTracker struct { - now func() time.Time - - lock sync.RWMutex - plStats map[string]*droppedRequestsStats -} - -// NewDroppedRequestsTracker is creating a new instance of -// DroppedRequestsTracker. -func NewDroppedRequestsTracker() DroppedRequestsTracker { - return newDroppedRequestsTracker(clock.RealClock{}.Now) -} - -func newDroppedRequestsTracker(now func() time.Time) *droppedRequestsTracker { - return &droppedRequestsTracker{ - now: now, - plStats: make(map[string]*droppedRequestsStats), - } -} - -func (t *droppedRequestsTracker) RecordDroppedRequest(plName string) { - unixTime := t.now().Unix() - - stats := func() *droppedRequestsStats { - // The list of priority levels should change very infrequently, - // so in almost all cases, the fast path should be enough. - t.lock.RLock() - if plStats, ok := t.plStats[plName]; ok { - t.lock.RUnlock() - return plStats - } - t.lock.RUnlock() - - // Slow path taking writer lock to update the map. - t.lock.Lock() - defer t.lock.Unlock() - if plStats, ok := t.plStats[plName]; ok { - return plStats - } - stats := newDroppedRequestsStats(unixTime) - t.plStats[plName] = stats - return stats - }() - - stats.recordDroppedRequest(unixTime) -} - -func (t *droppedRequestsTracker) GetRetryAfter(plName string) int64 { - t.lock.RLock() - defer t.lock.RUnlock() - - if plStats, ok := t.plStats[plName]; ok { - return plStats.retryAfter.Load() - } - return 1 -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/max_seats.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/max_seats.go deleted file mode 100644 index 18f88ab3b203..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/flowcontrol/max_seats.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -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 flowcontrol - -import ( - "sync" -) - -// MaxSeatsTracker is used to track max seats allocatable per priority level from the work estimator -type MaxSeatsTracker interface { - // GetMaxSeats returns the maximum seats a request should occupy for a given priority level. - GetMaxSeats(priorityLevelName string) uint64 - - // SetMaxSeats configures max seats for a priority level. - SetMaxSeats(priorityLevelName string, maxSeats uint64) - - // ForgetPriorityLevel removes max seats tracking for a priority level. - ForgetPriorityLevel(priorityLevelName string) -} - -type maxSeatsTracker struct { - sync.RWMutex - - maxSeats map[string]uint64 -} - -func NewMaxSeatsTracker() MaxSeatsTracker { - return &maxSeatsTracker{ - maxSeats: make(map[string]uint64), - } -} - -func (m *maxSeatsTracker) GetMaxSeats(plName string) uint64 { - m.RLock() - defer m.RUnlock() - - return m.maxSeats[plName] -} - -func (m *maxSeatsTracker) SetMaxSeats(plName string, maxSeats uint64) { - m.Lock() - defer m.Unlock() - - m.maxSeats[plName] = maxSeats -} - -func (m *maxSeatsTracker) ForgetPriorityLevel(plName string) { - m.Lock() - defer m.Unlock() - - delete(m.maxSeats, plName) -} diff --git a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/peerproxy/metrics/metrics.go b/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/peerproxy/metrics/metrics.go deleted file mode 100644 index 48b89be75ffd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/apiserver/pkg/util/peerproxy/metrics/metrics.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -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 metrics - -import ( - "context" - "sync" - - "k8s.io/component-base/metrics" - "k8s.io/component-base/metrics/legacyregistry" -) - -const ( - subsystem = "apiserver" - statuscode = "code" -) - -var registerMetricsOnce sync.Once - -var ( - // peerProxiedRequestsTotal counts the number of requests that were proxied to a peer kube-apiserver. - peerProxiedRequestsTotal = metrics.NewCounterVec( - &metrics.CounterOpts{ - Subsystem: subsystem, - Name: "rerouted_request_total", - Help: "Total number of requests that were proxied to a peer kube apiserver because the local apiserver was not capable of serving it", - StabilityLevel: metrics.ALPHA, - }, - []string{statuscode}, - ) -) - -func Register() { - registerMetricsOnce.Do(func() { - legacyregistry.MustRegister(peerProxiedRequestsTotal) - }) -} - -// IncPeerProxiedRequest increments the # of proxied requests to peer kube-apiserver -func IncPeerProxiedRequest(ctx context.Context, status string) { - peerProxiedRequestsTotal.WithContext(ctx).WithLabelValues(status).Add(1) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/variable.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/variable.go deleted file mode 100644 index 2c70a8cfb5a0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/variable.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VariableApplyConfiguration represents an declarative configuration of the Variable type for use -// with apply. -type VariableApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Expression *string `json:"expression,omitempty"` -} - -// VariableApplyConfiguration constructs an declarative configuration of the Variable type for use with -// apply. -func Variable() *VariableApplyConfiguration { - return &VariableApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration { - b.Name = &value - return b -} - -// WithExpression sets the Expression field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Expression field is set to the value of the last call. -func (b *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration { - b.Expression = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/auditannotation.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/auditannotation.go deleted file mode 100644 index e92fba0ddbc0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/auditannotation.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// AuditAnnotationApplyConfiguration represents an declarative configuration of the AuditAnnotation type for use -// with apply. -type AuditAnnotationApplyConfiguration struct { - Key *string `json:"key,omitempty"` - ValueExpression *string `json:"valueExpression,omitempty"` -} - -// AuditAnnotationApplyConfiguration constructs an declarative configuration of the AuditAnnotation type for use with -// apply. -func AuditAnnotation() *AuditAnnotationApplyConfiguration { - return &AuditAnnotationApplyConfiguration{} -} - -// WithKey sets the Key field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Key field is set to the value of the last call. -func (b *AuditAnnotationApplyConfiguration) WithKey(value string) *AuditAnnotationApplyConfiguration { - b.Key = &value - return b -} - -// WithValueExpression sets the ValueExpression field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ValueExpression field is set to the value of the last call. -func (b *AuditAnnotationApplyConfiguration) WithValueExpression(value string) *AuditAnnotationApplyConfiguration { - b.ValueExpression = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go deleted file mode 100644 index 059c1b94ba2e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// ExpressionWarningApplyConfiguration represents an declarative configuration of the ExpressionWarning type for use -// with apply. -type ExpressionWarningApplyConfiguration struct { - FieldRef *string `json:"fieldRef,omitempty"` - Warning *string `json:"warning,omitempty"` -} - -// ExpressionWarningApplyConfiguration constructs an declarative configuration of the ExpressionWarning type for use with -// apply. -func ExpressionWarning() *ExpressionWarningApplyConfiguration { - return &ExpressionWarningApplyConfiguration{} -} - -// WithFieldRef sets the FieldRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the FieldRef field is set to the value of the last call. -func (b *ExpressionWarningApplyConfiguration) WithFieldRef(value string) *ExpressionWarningApplyConfiguration { - b.FieldRef = &value - return b -} - -// WithWarning sets the Warning field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Warning field is set to the value of the last call. -func (b *ExpressionWarningApplyConfiguration) WithWarning(value string) *ExpressionWarningApplyConfiguration { - b.Warning = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/matchresources.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/matchresources.go deleted file mode 100644 index 25d4139db6a2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/matchresources.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// MatchResourcesApplyConfiguration represents an declarative configuration of the MatchResources type for use -// with apply. -type MatchResourcesApplyConfiguration struct { - NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` - ObjectSelector *v1.LabelSelectorApplyConfiguration `json:"objectSelector,omitempty"` - ResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"resourceRules,omitempty"` - ExcludeResourceRules []NamedRuleWithOperationsApplyConfiguration `json:"excludeResourceRules,omitempty"` - MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"` -} - -// MatchResourcesApplyConfiguration constructs an declarative configuration of the MatchResources type for use with -// apply. -func MatchResources() *MatchResourcesApplyConfiguration { - return &MatchResourcesApplyConfiguration{} -} - -// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamespaceSelector field is set to the value of the last call. -func (b *MatchResourcesApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { - b.NamespaceSelector = value - return b -} - -// WithObjectSelector sets the ObjectSelector field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ObjectSelector field is set to the value of the last call. -func (b *MatchResourcesApplyConfiguration) WithObjectSelector(value *v1.LabelSelectorApplyConfiguration) *MatchResourcesApplyConfiguration { - b.ObjectSelector = value - return b -} - -// WithResourceRules adds the given value to the ResourceRules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ResourceRules field. -func (b *MatchResourcesApplyConfiguration) WithResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithResourceRules") - } - b.ResourceRules = append(b.ResourceRules, *values[i]) - } - return b -} - -// WithExcludeResourceRules adds the given value to the ExcludeResourceRules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ExcludeResourceRules field. -func (b *MatchResourcesApplyConfiguration) WithExcludeResourceRules(values ...*NamedRuleWithOperationsApplyConfiguration) *MatchResourcesApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithExcludeResourceRules") - } - b.ExcludeResourceRules = append(b.ExcludeResourceRules, *values[i]) - } - return b -} - -// WithMatchPolicy sets the MatchPolicy field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MatchPolicy field is set to the value of the last call. -func (b *MatchResourcesApplyConfiguration) WithMatchPolicy(value admissionregistrationv1beta1.MatchPolicyType) *MatchResourcesApplyConfiguration { - b.MatchPolicy = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go deleted file mode 100644 index fa346c4a57b0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - admissionregistrationv1 "k8s.io/api/admissionregistration/v1" - v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" -) - -// NamedRuleWithOperationsApplyConfiguration represents an declarative configuration of the NamedRuleWithOperations type for use -// with apply. -type NamedRuleWithOperationsApplyConfiguration struct { - ResourceNames []string `json:"resourceNames,omitempty"` - v1.RuleWithOperationsApplyConfiguration `json:",inline"` -} - -// NamedRuleWithOperationsApplyConfiguration constructs an declarative configuration of the NamedRuleWithOperations type for use with -// apply. -func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration { - return &NamedRuleWithOperationsApplyConfiguration{} -} - -// WithResourceNames adds the given value to the ResourceNames field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ResourceNames field. -func (b *NamedRuleWithOperationsApplyConfiguration) WithResourceNames(values ...string) *NamedRuleWithOperationsApplyConfiguration { - for i := range values { - b.ResourceNames = append(b.ResourceNames, values[i]) - } - return b -} - -// WithOperations adds the given value to the Operations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Operations field. -func (b *NamedRuleWithOperationsApplyConfiguration) WithOperations(values ...admissionregistrationv1.OperationType) *NamedRuleWithOperationsApplyConfiguration { - for i := range values { - b.Operations = append(b.Operations, values[i]) - } - return b -} - -// WithAPIGroups adds the given value to the APIGroups field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the APIGroups field. -func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIGroups(values ...string) *NamedRuleWithOperationsApplyConfiguration { - for i := range values { - b.APIGroups = append(b.APIGroups, values[i]) - } - return b -} - -// WithAPIVersions adds the given value to the APIVersions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the APIVersions field. -func (b *NamedRuleWithOperationsApplyConfiguration) WithAPIVersions(values ...string) *NamedRuleWithOperationsApplyConfiguration { - for i := range values { - b.APIVersions = append(b.APIVersions, values[i]) - } - return b -} - -// WithResources adds the given value to the Resources field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Resources field. -func (b *NamedRuleWithOperationsApplyConfiguration) WithResources(values ...string) *NamedRuleWithOperationsApplyConfiguration { - for i := range values { - b.Resources = append(b.Resources, values[i]) - } - return b -} - -// WithScope sets the Scope field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Scope field is set to the value of the last call. -func (b *NamedRuleWithOperationsApplyConfiguration) WithScope(value admissionregistrationv1.ScopeType) *NamedRuleWithOperationsApplyConfiguration { - b.Scope = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/paramkind.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/paramkind.go deleted file mode 100644 index 6050e6025126..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/paramkind.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// ParamKindApplyConfiguration represents an declarative configuration of the ParamKind type for use -// with apply. -type ParamKindApplyConfiguration struct { - APIVersion *string `json:"apiVersion,omitempty"` - Kind *string `json:"kind,omitempty"` -} - -// ParamKindApplyConfiguration constructs an declarative configuration of the ParamKind type for use with -// apply. -func ParamKind() *ParamKindApplyConfiguration { - return &ParamKindApplyConfiguration{} -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ParamKindApplyConfiguration) WithAPIVersion(value string) *ParamKindApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ParamKindApplyConfiguration) WithKind(value string) *ParamKindApplyConfiguration { - b.Kind = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/paramref.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/paramref.go deleted file mode 100644 index 2be98dbc5251..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/paramref.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ParamRefApplyConfiguration represents an declarative configuration of the ParamRef type for use -// with apply. -type ParamRefApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` - ParameterNotFoundAction *v1beta1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"` -} - -// ParamRefApplyConfiguration constructs an declarative configuration of the ParamRef type for use with -// apply. -func ParamRef() *ParamRefApplyConfiguration { - return &ParamRefApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ParamRefApplyConfiguration) WithName(value string) *ParamRefApplyConfiguration { - b.Name = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ParamRefApplyConfiguration) WithNamespace(value string) *ParamRefApplyConfiguration { - b.Namespace = &value - return b -} - -// WithSelector sets the Selector field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Selector field is set to the value of the last call. -func (b *ParamRefApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *ParamRefApplyConfiguration { - b.Selector = value - return b -} - -// WithParameterNotFoundAction sets the ParameterNotFoundAction field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ParameterNotFoundAction field is set to the value of the last call. -func (b *ParamRefApplyConfiguration) WithParameterNotFoundAction(value v1beta1.ParameterNotFoundActionType) *ParamRefApplyConfiguration { - b.ParameterNotFoundAction = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/typechecking.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/typechecking.go deleted file mode 100644 index 07baf334cd39..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/typechecking.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// TypeCheckingApplyConfiguration represents an declarative configuration of the TypeChecking type for use -// with apply. -type TypeCheckingApplyConfiguration struct { - ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"` -} - -// TypeCheckingApplyConfiguration constructs an declarative configuration of the TypeChecking type for use with -// apply. -func TypeChecking() *TypeCheckingApplyConfiguration { - return &TypeCheckingApplyConfiguration{} -} - -// WithExpressionWarnings adds the given value to the ExpressionWarnings field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ExpressionWarnings field. -func (b *TypeCheckingApplyConfiguration) WithExpressionWarnings(values ...*ExpressionWarningApplyConfiguration) *TypeCheckingApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithExpressionWarnings") - } - b.ExpressionWarnings = append(b.ExpressionWarnings, *values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go deleted file mode 100644 index e144bc9f701c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ValidatingAdmissionPolicyApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicy type for use -// with apply. -type ValidatingAdmissionPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *ValidatingAdmissionPolicySpecApplyConfiguration `json:"spec,omitempty"` - Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"` -} - -// ValidatingAdmissionPolicy constructs an declarative configuration of the ValidatingAdmissionPolicy type for use with -// apply. -func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration { - b := &ValidatingAdmissionPolicyApplyConfiguration{} - b.WithName(name) - b.WithKind("ValidatingAdmissionPolicy") - b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") - return b -} - -// ExtractValidatingAdmissionPolicy extracts the applied configuration owned by fieldManager from -// validatingAdmissionPolicy. If no managedFields are found in validatingAdmissionPolicy for fieldManager, a -// ValidatingAdmissionPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// validatingAdmissionPolicy must be a unmodified ValidatingAdmissionPolicy API object that was retrieved from the Kubernetes API. -// ExtractValidatingAdmissionPolicy provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { - return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "") -} - -// ExtractValidatingAdmissionPolicyStatus is the same as ExtractValidatingAdmissionPolicy except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractValidatingAdmissionPolicyStatus(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { - return extractValidatingAdmissionPolicy(validatingAdmissionPolicy, fieldManager, "status") -} - -func extractValidatingAdmissionPolicy(validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicy, fieldManager string, subresource string) (*ValidatingAdmissionPolicyApplyConfiguration, error) { - b := &ValidatingAdmissionPolicyApplyConfiguration{} - err := managedfields.ExtractInto(validatingAdmissionPolicy, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicy"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(validatingAdmissionPolicy.Name) - - b.WithKind("ValidatingAdmissionPolicy") - b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ValidatingAdmissionPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicySpecApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *ValidatingAdmissionPolicyStatusApplyConfiguration) *ValidatingAdmissionPolicyApplyConfiguration { - b.Status = value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go deleted file mode 100644 index 0dc06aedecdd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ValidatingAdmissionPolicyBindingApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBinding type for use -// with apply. -type ValidatingAdmissionPolicyBindingApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"` -} - -// ValidatingAdmissionPolicyBinding constructs an declarative configuration of the ValidatingAdmissionPolicyBinding type for use with -// apply. -func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} - b.WithName(name) - b.WithKind("ValidatingAdmissionPolicyBinding") - b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") - return b -} - -// ExtractValidatingAdmissionPolicyBinding extracts the applied configuration owned by fieldManager from -// validatingAdmissionPolicyBinding. If no managedFields are found in validatingAdmissionPolicyBinding for fieldManager, a -// ValidatingAdmissionPolicyBindingApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// validatingAdmissionPolicyBinding must be a unmodified ValidatingAdmissionPolicyBinding API object that was retrieved from the Kubernetes API. -// ExtractValidatingAdmissionPolicyBinding provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { - return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "") -} - -// ExtractValidatingAdmissionPolicyBindingStatus is the same as ExtractValidatingAdmissionPolicyBinding except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractValidatingAdmissionPolicyBindingStatus(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { - return extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding, fieldManager, "status") -} - -func extractValidatingAdmissionPolicyBinding(validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, fieldManager string, subresource string) (*ValidatingAdmissionPolicyBindingApplyConfiguration, error) { - b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} - err := managedfields.ExtractInto(validatingAdmissionPolicyBinding, internal.Parser().Type("io.k8s.api.admissionregistration.v1beta1.ValidatingAdmissionPolicyBinding"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(validatingAdmissionPolicyBinding.Name) - - b.WithKind("ValidatingAdmissionPolicyBinding") - b.WithAPIVersion("admissionregistration.k8s.io/v1beta1") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithKind(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAPIVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGenerateName(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithNamespace(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithUID(value types.UID) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithResourceVersion(value string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithGeneration(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithLabels(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithAnnotations(entries map[string]string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithFinalizers(values ...string) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) *ValidatingAdmissionPolicyBindingApplyConfiguration { - b.Spec = value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybindingspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybindingspec.go deleted file mode 100644 index d20a78efffb0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybindingspec.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" -) - -// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use -// with apply. -type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { - PolicyName *string `json:"policyName,omitempty"` - ParamRef *ParamRefApplyConfiguration `json:"paramRef,omitempty"` - MatchResources *MatchResourcesApplyConfiguration `json:"matchResources,omitempty"` - ValidationActions []admissionregistrationv1beta1.ValidationAction `json:"validationActions,omitempty"` -} - -// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with -// apply. -func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { - return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} -} - -// WithPolicyName sets the PolicyName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PolicyName field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithPolicyName(value string) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { - b.PolicyName = &value - return b -} - -// WithParamRef sets the ParamRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ParamRef field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithParamRef(value *ParamRefApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { - b.ParamRef = value - return b -} - -// WithMatchResources sets the MatchResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MatchResources field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithMatchResources(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { - b.MatchResources = value - return b -} - -// WithValidationActions adds the given value to the ValidationActions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ValidationActions field. -func (b *ValidatingAdmissionPolicyBindingSpecApplyConfiguration) WithValidationActions(values ...admissionregistrationv1beta1.ValidationAction) *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { - for i := range values { - b.ValidationActions = append(b.ValidationActions, values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicyspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicyspec.go deleted file mode 100644 index c6e938910337..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicyspec.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" -) - -// ValidatingAdmissionPolicySpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicySpec type for use -// with apply. -type ValidatingAdmissionPolicySpecApplyConfiguration struct { - ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` - MatchConstraints *MatchResourcesApplyConfiguration `json:"matchConstraints,omitempty"` - Validations []ValidationApplyConfiguration `json:"validations,omitempty"` - FailurePolicy *admissionregistrationv1beta1.FailurePolicyType `json:"failurePolicy,omitempty"` - AuditAnnotations []AuditAnnotationApplyConfiguration `json:"auditAnnotations,omitempty"` - MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` - Variables []VariableApplyConfiguration `json:"variables,omitempty"` -} - -// ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with -// apply. -func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { - return &ValidatingAdmissionPolicySpecApplyConfiguration{} -} - -// WithParamKind sets the ParamKind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ParamKind field is set to the value of the last call. -func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithParamKind(value *ParamKindApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { - b.ParamKind = value - return b -} - -// WithMatchConstraints sets the MatchConstraints field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MatchConstraints field is set to the value of the last call. -func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConstraints(value *MatchResourcesApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { - b.MatchConstraints = value - return b -} - -// WithValidations adds the given value to the Validations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Validations field. -func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithValidations(values ...*ValidationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithValidations") - } - b.Validations = append(b.Validations, *values[i]) - } - return b -} - -// WithFailurePolicy sets the FailurePolicy field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the FailurePolicy field is set to the value of the last call. -func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithFailurePolicy(value admissionregistrationv1beta1.FailurePolicyType) *ValidatingAdmissionPolicySpecApplyConfiguration { - b.FailurePolicy = &value - return b -} - -// WithAuditAnnotations adds the given value to the AuditAnnotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the AuditAnnotations field. -func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithAuditAnnotations(values ...*AuditAnnotationApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithAuditAnnotations") - } - b.AuditAnnotations = append(b.AuditAnnotations, *values[i]) - } - return b -} - -// WithMatchConditions adds the given value to the MatchConditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the MatchConditions field. -func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithMatchConditions(values ...*MatchConditionApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithMatchConditions") - } - b.MatchConditions = append(b.MatchConditions, *values[i]) - } - return b -} - -// WithVariables adds the given value to the Variables field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Variables field. -func (b *ValidatingAdmissionPolicySpecApplyConfiguration) WithVariables(values ...*VariableApplyConfiguration) *ValidatingAdmissionPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithVariables") - } - b.Variables = append(b.Variables, *values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicystatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicystatus.go deleted file mode 100644 index e3e6d417edd5..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicystatus.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ValidatingAdmissionPolicyStatusApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyStatus type for use -// with apply. -type ValidatingAdmissionPolicyStatusApplyConfiguration struct { - ObservedGeneration *int64 `json:"observedGeneration,omitempty"` - TypeChecking *TypeCheckingApplyConfiguration `json:"typeChecking,omitempty"` - Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` -} - -// ValidatingAdmissionPolicyStatusApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyStatus type for use with -// apply. -func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration { - return &ValidatingAdmissionPolicyStatusApplyConfiguration{} -} - -// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ObservedGeneration field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithObservedGeneration(value int64) *ValidatingAdmissionPolicyStatusApplyConfiguration { - b.ObservedGeneration = &value - return b -} - -// WithTypeChecking sets the TypeChecking field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TypeChecking field is set to the value of the last call. -func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithTypeChecking(value *TypeCheckingApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { - b.TypeChecking = value - return b -} - -// WithConditions adds the given value to the Conditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *ValidatingAdmissionPolicyStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ValidatingAdmissionPolicyStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithConditions") - } - b.Conditions = append(b.Conditions, *values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validation.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validation.go deleted file mode 100644 index ed9ff1ac0c27..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/validation.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ValidationApplyConfiguration represents an declarative configuration of the Validation type for use -// with apply. -type ValidationApplyConfiguration struct { - Expression *string `json:"expression,omitempty"` - Message *string `json:"message,omitempty"` - Reason *v1.StatusReason `json:"reason,omitempty"` - MessageExpression *string `json:"messageExpression,omitempty"` -} - -// ValidationApplyConfiguration constructs an declarative configuration of the Validation type for use with -// apply. -func Validation() *ValidationApplyConfiguration { - return &ValidationApplyConfiguration{} -} - -// WithExpression sets the Expression field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Expression field is set to the value of the last call. -func (b *ValidationApplyConfiguration) WithExpression(value string) *ValidationApplyConfiguration { - b.Expression = &value - return b -} - -// WithMessage sets the Message field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Message field is set to the value of the last call. -func (b *ValidationApplyConfiguration) WithMessage(value string) *ValidationApplyConfiguration { - b.Message = &value - return b -} - -// WithReason sets the Reason field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Reason field is set to the value of the last call. -func (b *ValidationApplyConfiguration) WithReason(value v1.StatusReason) *ValidationApplyConfiguration { - b.Reason = &value - return b -} - -// WithMessageExpression sets the MessageExpression field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MessageExpression field is set to the value of the last call. -func (b *ValidationApplyConfiguration) WithMessageExpression(value string) *ValidationApplyConfiguration { - b.MessageExpression = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/variable.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/variable.go deleted file mode 100644 index 0fc294c65d51..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1/variable.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// VariableApplyConfiguration represents an declarative configuration of the Variable type for use -// with apply. -type VariableApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Expression *string `json:"expression,omitempty"` -} - -// VariableApplyConfiguration constructs an declarative configuration of the Variable type for use with -// apply. -func Variable() *VariableApplyConfiguration { - return &VariableApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VariableApplyConfiguration) WithName(value string) *VariableApplyConfiguration { - b.Name = &value - return b -} - -// WithExpression sets the Expression field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Expression field is set to the value of the last call. -func (b *VariableApplyConfiguration) WithExpression(value string) *VariableApplyConfiguration { - b.Expression = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/hostip.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/hostip.go deleted file mode 100644 index c2a42cf74714..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/hostip.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// HostIPApplyConfiguration represents an declarative configuration of the HostIP type for use -// with apply. -type HostIPApplyConfiguration struct { - IP *string `json:"ip,omitempty"` -} - -// HostIPApplyConfiguration constructs an declarative configuration of the HostIP type for use with -// apply. -func HostIP() *HostIPApplyConfiguration { - return &HostIPApplyConfiguration{} -} - -// WithIP sets the IP field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IP field is set to the value of the last call. -func (b *HostIPApplyConfiguration) WithIP(value string) *HostIPApplyConfiguration { - b.IP = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/modifyvolumestatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/modifyvolumestatus.go deleted file mode 100644 index 4ff1d040cf36..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/modifyvolumestatus.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/core/v1" -) - -// ModifyVolumeStatusApplyConfiguration represents an declarative configuration of the ModifyVolumeStatus type for use -// with apply. -type ModifyVolumeStatusApplyConfiguration struct { - TargetVolumeAttributesClassName *string `json:"targetVolumeAttributesClassName,omitempty"` - Status *v1.PersistentVolumeClaimModifyVolumeStatus `json:"status,omitempty"` -} - -// ModifyVolumeStatusApplyConfiguration constructs an declarative configuration of the ModifyVolumeStatus type for use with -// apply. -func ModifyVolumeStatus() *ModifyVolumeStatusApplyConfiguration { - return &ModifyVolumeStatusApplyConfiguration{} -} - -// WithTargetVolumeAttributesClassName sets the TargetVolumeAttributesClassName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TargetVolumeAttributesClassName field is set to the value of the last call. -func (b *ModifyVolumeStatusApplyConfiguration) WithTargetVolumeAttributesClassName(value string) *ModifyVolumeStatusApplyConfiguration { - b.TargetVolumeAttributesClassName = &value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *ModifyVolumeStatusApplyConfiguration) WithStatus(value v1.PersistentVolumeClaimModifyVolumeStatus) *ModifyVolumeStatusApplyConfiguration { - b.Status = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/podresourceclaimstatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/podresourceclaimstatus.go deleted file mode 100644 index ae79ca01b76a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/podresourceclaimstatus.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// PodResourceClaimStatusApplyConfiguration represents an declarative configuration of the PodResourceClaimStatus type for use -// with apply. -type PodResourceClaimStatusApplyConfiguration struct { - Name *string `json:"name,omitempty"` - ResourceClaimName *string `json:"resourceClaimName,omitempty"` -} - -// PodResourceClaimStatusApplyConfiguration constructs an declarative configuration of the PodResourceClaimStatus type for use with -// apply. -func PodResourceClaimStatus() *PodResourceClaimStatusApplyConfiguration { - return &PodResourceClaimStatusApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *PodResourceClaimStatusApplyConfiguration) WithName(value string) *PodResourceClaimStatusApplyConfiguration { - b.Name = &value - return b -} - -// WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceClaimName field is set to the value of the last call. -func (b *PodResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *PodResourceClaimStatusApplyConfiguration { - b.ResourceClaimName = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/sleepaction.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/sleepaction.go deleted file mode 100644 index 8b3284536ad4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/sleepaction.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// SleepActionApplyConfiguration represents an declarative configuration of the SleepAction type for use -// with apply. -type SleepActionApplyConfiguration struct { - Seconds *int64 `json:"seconds,omitempty"` -} - -// SleepActionApplyConfiguration constructs an declarative configuration of the SleepAction type for use with -// apply. -func SleepAction() *SleepActionApplyConfiguration { - return &SleepActionApplyConfiguration{} -} - -// WithSeconds sets the Seconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Seconds field is set to the value of the last call. -func (b *SleepActionApplyConfiguration) WithSeconds(value int64) *SleepActionApplyConfiguration { - b.Seconds = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeresourcerequirements.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeresourcerequirements.go deleted file mode 100644 index 89ad1da8b33a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/core/v1/volumeresourcerequirements.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/core/v1" -) - -// VolumeResourceRequirementsApplyConfiguration represents an declarative configuration of the VolumeResourceRequirements type for use -// with apply. -type VolumeResourceRequirementsApplyConfiguration struct { - Limits *v1.ResourceList `json:"limits,omitempty"` - Requests *v1.ResourceList `json:"requests,omitempty"` -} - -// VolumeResourceRequirementsApplyConfiguration constructs an declarative configuration of the VolumeResourceRequirements type for use with -// apply. -func VolumeResourceRequirements() *VolumeResourceRequirementsApplyConfiguration { - return &VolumeResourceRequirementsApplyConfiguration{} -} - -// WithLimits sets the Limits field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Limits field is set to the value of the last call. -func (b *VolumeResourceRequirementsApplyConfiguration) WithLimits(value v1.ResourceList) *VolumeResourceRequirementsApplyConfiguration { - b.Limits = &value - return b -} - -// WithRequests sets the Requests field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Requests field is set to the value of the last call. -func (b *VolumeResourceRequirementsApplyConfiguration) WithRequests(value v1.ResourceList) *VolumeResourceRequirementsApplyConfiguration { - b.Requests = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go deleted file mode 100644 index cd21214f5ada..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use -// with apply. -type ExemptPriorityLevelConfigurationApplyConfiguration struct { - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` - LendablePercent *int32 `json:"lendablePercent,omitempty"` -} - -// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with -// apply. -func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { - return &ExemptPriorityLevelConfigurationApplyConfiguration{} -} - -// WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. -func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { - b.NominalConcurrencyShares = &value - return b -} - -// WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LendablePercent field is set to the value of the last call. -func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { - b.LendablePercent = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go deleted file mode 100644 index d9c8a79cc885..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/flowcontrol/v1" -) - -// FlowDistinguisherMethodApplyConfiguration represents an declarative configuration of the FlowDistinguisherMethod type for use -// with apply. -type FlowDistinguisherMethodApplyConfiguration struct { - Type *v1.FlowDistinguisherMethodType `json:"type,omitempty"` -} - -// FlowDistinguisherMethodApplyConfiguration constructs an declarative configuration of the FlowDistinguisherMethod type for use with -// apply. -func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { - return &FlowDistinguisherMethodApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *FlowDistinguisherMethodApplyConfiguration) WithType(value v1.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration { - b.Type = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go deleted file mode 100644 index 8809fafbaeba..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschema.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - apiflowcontrolv1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// FlowSchemaApplyConfiguration represents an declarative configuration of the FlowSchema type for use -// with apply. -type FlowSchemaApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *FlowSchemaSpecApplyConfiguration `json:"spec,omitempty"` - Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` -} - -// FlowSchema constructs an declarative configuration of the FlowSchema type for use with -// apply. -func FlowSchema(name string) *FlowSchemaApplyConfiguration { - b := &FlowSchemaApplyConfiguration{} - b.WithName(name) - b.WithKind("FlowSchema") - b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") - return b -} - -// ExtractFlowSchema extracts the applied configuration owned by fieldManager from -// flowSchema. If no managedFields are found in flowSchema for fieldManager, a -// FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API. -// ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractFlowSchema(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { - return extractFlowSchema(flowSchema, fieldManager, "") -} - -// ExtractFlowSchemaStatus is the same as ExtractFlowSchema except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractFlowSchemaStatus(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { - return extractFlowSchema(flowSchema, fieldManager, "status") -} - -func extractFlowSchema(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { - b := &FlowSchemaApplyConfiguration{} - err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1.FlowSchema"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(flowSchema.Name) - - b.WithKind("FlowSchema") - b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithKind(value string) *FlowSchemaApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithAPIVersion(value string) *FlowSchemaApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithName(value string) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithGenerateName(value string) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithNamespace(value string) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithUID(value types.UID) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithResourceVersion(value string) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithGeneration(value int64) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *FlowSchemaApplyConfiguration) WithLabels(entries map[string]string) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *FlowSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *FlowSchemaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *FlowSchemaApplyConfiguration) WithFinalizers(values ...string) *FlowSchemaApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *FlowSchemaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithSpec(value *FlowSchemaSpecApplyConfiguration) *FlowSchemaApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyConfiguration) *FlowSchemaApplyConfiguration { - b.Status = value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go deleted file mode 100644 index 808ab09a551e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemacondition.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// FlowSchemaConditionApplyConfiguration represents an declarative configuration of the FlowSchemaCondition type for use -// with apply. -type FlowSchemaConditionApplyConfiguration struct { - Type *v1.FlowSchemaConditionType `json:"type,omitempty"` - Status *v1.ConditionStatus `json:"status,omitempty"` - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` - Reason *string `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` -} - -// FlowSchemaConditionApplyConfiguration constructs an declarative configuration of the FlowSchemaCondition type for use with -// apply. -func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { - return &FlowSchemaConditionApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration { - b.Type = &value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *FlowSchemaConditionApplyConfiguration { - b.Status = &value - return b -} - -// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LastTransitionTime field is set to the value of the last call. -func (b *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *FlowSchemaConditionApplyConfiguration { - b.LastTransitionTime = &value - return b -} - -// WithReason sets the Reason field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Reason field is set to the value of the last call. -func (b *FlowSchemaConditionApplyConfiguration) WithReason(value string) *FlowSchemaConditionApplyConfiguration { - b.Reason = &value - return b -} - -// WithMessage sets the Message field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Message field is set to the value of the last call. -func (b *FlowSchemaConditionApplyConfiguration) WithMessage(value string) *FlowSchemaConditionApplyConfiguration { - b.Message = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemaspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemaspec.go deleted file mode 100644 index 2785f5baf3b8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemaspec.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use -// with apply. -type FlowSchemaSpecApplyConfiguration struct { - PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` - MatchingPrecedence *int32 `json:"matchingPrecedence,omitempty"` - DistinguisherMethod *FlowDistinguisherMethodApplyConfiguration `json:"distinguisherMethod,omitempty"` - Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` -} - -// FlowSchemaSpecApplyConfiguration constructs an declarative configuration of the FlowSchemaSpec type for use with -// apply. -func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { - return &FlowSchemaSpecApplyConfiguration{} -} - -// WithPriorityLevelConfiguration sets the PriorityLevelConfiguration field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PriorityLevelConfiguration field is set to the value of the last call. -func (b *FlowSchemaSpecApplyConfiguration) WithPriorityLevelConfiguration(value *PriorityLevelConfigurationReferenceApplyConfiguration) *FlowSchemaSpecApplyConfiguration { - b.PriorityLevelConfiguration = value - return b -} - -// WithMatchingPrecedence sets the MatchingPrecedence field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MatchingPrecedence field is set to the value of the last call. -func (b *FlowSchemaSpecApplyConfiguration) WithMatchingPrecedence(value int32) *FlowSchemaSpecApplyConfiguration { - b.MatchingPrecedence = &value - return b -} - -// WithDistinguisherMethod sets the DistinguisherMethod field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DistinguisherMethod field is set to the value of the last call. -func (b *FlowSchemaSpecApplyConfiguration) WithDistinguisherMethod(value *FlowDistinguisherMethodApplyConfiguration) *FlowSchemaSpecApplyConfiguration { - b.DistinguisherMethod = value - return b -} - -// WithRules adds the given value to the Rules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Rules field. -func (b *FlowSchemaSpecApplyConfiguration) WithRules(values ...*PolicyRulesWithSubjectsApplyConfiguration) *FlowSchemaSpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithRules") - } - b.Rules = append(b.Rules, *values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemastatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemastatus.go deleted file mode 100644 index 7c61360a535c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/flowschemastatus.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// FlowSchemaStatusApplyConfiguration represents an declarative configuration of the FlowSchemaStatus type for use -// with apply. -type FlowSchemaStatusApplyConfiguration struct { - Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` -} - -// FlowSchemaStatusApplyConfiguration constructs an declarative configuration of the FlowSchemaStatus type for use with -// apply. -func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { - return &FlowSchemaStatusApplyConfiguration{} -} - -// WithConditions adds the given value to the Conditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *FlowSchemaStatusApplyConfiguration) WithConditions(values ...*FlowSchemaConditionApplyConfiguration) *FlowSchemaStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithConditions") - } - b.Conditions = append(b.Conditions, *values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/groupsubject.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/groupsubject.go deleted file mode 100644 index 92a03d86282e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/groupsubject.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// GroupSubjectApplyConfiguration represents an declarative configuration of the GroupSubject type for use -// with apply. -type GroupSubjectApplyConfiguration struct { - Name *string `json:"name,omitempty"` -} - -// GroupSubjectApplyConfiguration constructs an declarative configuration of the GroupSubject type for use with -// apply. -func GroupSubject() *GroupSubjectApplyConfiguration { - return &GroupSubjectApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *GroupSubjectApplyConfiguration) WithName(value string) *GroupSubjectApplyConfiguration { - b.Name = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go deleted file mode 100644 index c19f0970357a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// LimitedPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the LimitedPriorityLevelConfiguration type for use -// with apply. -type LimitedPriorityLevelConfigurationApplyConfiguration struct { - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` - LimitResponse *LimitResponseApplyConfiguration `json:"limitResponse,omitempty"` - LendablePercent *int32 `json:"lendablePercent,omitempty"` - BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` -} - -// LimitedPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the LimitedPriorityLevelConfiguration type for use with -// apply. -func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { - return &LimitedPriorityLevelConfigurationApplyConfiguration{} -} - -// WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. -func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { - b.NominalConcurrencyShares = &value - return b -} - -// WithLimitResponse sets the LimitResponse field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LimitResponse field is set to the value of the last call. -func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLimitResponse(value *LimitResponseApplyConfiguration) *LimitedPriorityLevelConfigurationApplyConfiguration { - b.LimitResponse = value - return b -} - -// WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LendablePercent field is set to the value of the last call. -func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { - b.LendablePercent = &value - return b -} - -// WithBorrowingLimitPercent sets the BorrowingLimitPercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BorrowingLimitPercent field is set to the value of the last call. -func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithBorrowingLimitPercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { - b.BorrowingLimitPercent = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitresponse.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitresponse.go deleted file mode 100644 index 03ff6d910353..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/limitresponse.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/flowcontrol/v1" -) - -// LimitResponseApplyConfiguration represents an declarative configuration of the LimitResponse type for use -// with apply. -type LimitResponseApplyConfiguration struct { - Type *v1.LimitResponseType `json:"type,omitempty"` - Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` -} - -// LimitResponseApplyConfiguration constructs an declarative configuration of the LimitResponse type for use with -// apply. -func LimitResponse() *LimitResponseApplyConfiguration { - return &LimitResponseApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *LimitResponseApplyConfiguration) WithType(value v1.LimitResponseType) *LimitResponseApplyConfiguration { - b.Type = &value - return b -} - -// WithQueuing sets the Queuing field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Queuing field is set to the value of the last call. -func (b *LimitResponseApplyConfiguration) WithQueuing(value *QueuingConfigurationApplyConfiguration) *LimitResponseApplyConfiguration { - b.Queuing = value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go deleted file mode 100644 index d9f8c2eccf68..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// NonResourcePolicyRuleApplyConfiguration represents an declarative configuration of the NonResourcePolicyRule type for use -// with apply. -type NonResourcePolicyRuleApplyConfiguration struct { - Verbs []string `json:"verbs,omitempty"` - NonResourceURLs []string `json:"nonResourceURLs,omitempty"` -} - -// NonResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the NonResourcePolicyRule type for use with -// apply. -func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { - return &NonResourcePolicyRuleApplyConfiguration{} -} - -// WithVerbs adds the given value to the Verbs field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Verbs field. -func (b *NonResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *NonResourcePolicyRuleApplyConfiguration { - for i := range values { - b.Verbs = append(b.Verbs, values[i]) - } - return b -} - -// WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NonResourceURLs field. -func (b *NonResourcePolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *NonResourcePolicyRuleApplyConfiguration { - for i := range values { - b.NonResourceURLs = append(b.NonResourceURLs, values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go deleted file mode 100644 index b193efa8bf06..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use -// with apply. -type PolicyRulesWithSubjectsApplyConfiguration struct { - Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` - ResourceRules []ResourcePolicyRuleApplyConfiguration `json:"resourceRules,omitempty"` - NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` -} - -// PolicyRulesWithSubjectsApplyConfiguration constructs an declarative configuration of the PolicyRulesWithSubjects type for use with -// apply. -func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { - return &PolicyRulesWithSubjectsApplyConfiguration{} -} - -// WithSubjects adds the given value to the Subjects field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Subjects field. -func (b *PolicyRulesWithSubjectsApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithSubjects") - } - b.Subjects = append(b.Subjects, *values[i]) - } - return b -} - -// WithResourceRules adds the given value to the ResourceRules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ResourceRules field. -func (b *PolicyRulesWithSubjectsApplyConfiguration) WithResourceRules(values ...*ResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithResourceRules") - } - b.ResourceRules = append(b.ResourceRules, *values[i]) - } - return b -} - -// WithNonResourceRules adds the given value to the NonResourceRules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NonResourceRules field. -func (b *PolicyRulesWithSubjectsApplyConfiguration) WithNonResourceRules(values ...*NonResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithNonResourceRules") - } - b.NonResourceRules = append(b.NonResourceRules, *values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go deleted file mode 100644 index e8a1b97c9f82..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - apiflowcontrolv1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// PriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the PriorityLevelConfiguration type for use -// with apply. -type PriorityLevelConfigurationApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *PriorityLevelConfigurationSpecApplyConfiguration `json:"spec,omitempty"` - Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` -} - -// PriorityLevelConfiguration constructs an declarative configuration of the PriorityLevelConfiguration type for use with -// apply. -func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { - b := &PriorityLevelConfigurationApplyConfiguration{} - b.WithName(name) - b.WithKind("PriorityLevelConfiguration") - b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") - return b -} - -// ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from -// priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a -// PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API. -// ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { - return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") -} - -// ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { - return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") -} - -func extractPriorityLevelConfiguration(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { - b := &PriorityLevelConfigurationApplyConfiguration{} - err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1.PriorityLevelConfiguration"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(priorityLevelConfiguration.Name) - - b.WithKind("PriorityLevelConfiguration") - b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithKind(value string) *PriorityLevelConfigurationApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithAPIVersion(value string) *PriorityLevelConfigurationApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithName(value string) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithGenerateName(value string) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithNamespace(value string) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithUID(value types.UID) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithResourceVersion(value string) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithGeneration(value int64) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *PriorityLevelConfigurationApplyConfiguration) WithLabels(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *PriorityLevelConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *PriorityLevelConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *PriorityLevelConfigurationApplyConfiguration) WithFinalizers(values ...string) *PriorityLevelConfigurationApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *PriorityLevelConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithSpec(value *PriorityLevelConfigurationSpecApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *PriorityLevelConfigurationStatusApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { - b.Status = value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go deleted file mode 100644 index 6ce588c8d94f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// PriorityLevelConfigurationConditionApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationCondition type for use -// with apply. -type PriorityLevelConfigurationConditionApplyConfiguration struct { - Type *v1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` - Status *v1.ConditionStatus `json:"status,omitempty"` - LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` - Reason *string `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` -} - -// PriorityLevelConfigurationConditionApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationCondition type for use with -// apply. -func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { - return &PriorityLevelConfigurationConditionApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration { - b.Type = &value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration { - b.Status = &value - return b -} - -// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LastTransitionTime field is set to the value of the last call. -func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PriorityLevelConfigurationConditionApplyConfiguration { - b.LastTransitionTime = &value - return b -} - -// WithReason sets the Reason field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Reason field is set to the value of the last call. -func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithReason(value string) *PriorityLevelConfigurationConditionApplyConfiguration { - b.Reason = &value - return b -} - -// WithMessage sets the Message field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Message field is set to the value of the last call. -func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithMessage(value string) *PriorityLevelConfigurationConditionApplyConfiguration { - b.Message = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go deleted file mode 100644 index 0638aee8b802..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// PriorityLevelConfigurationReferenceApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationReference type for use -// with apply. -type PriorityLevelConfigurationReferenceApplyConfiguration struct { - Name *string `json:"name,omitempty"` -} - -// PriorityLevelConfigurationReferenceApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationReference type for use with -// apply. -func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { - return &PriorityLevelConfigurationReferenceApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *PriorityLevelConfigurationReferenceApplyConfiguration) WithName(value string) *PriorityLevelConfigurationReferenceApplyConfiguration { - b.Name = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go deleted file mode 100644 index 5d88749593c4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/flowcontrol/v1" -) - -// PriorityLevelConfigurationSpecApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationSpec type for use -// with apply. -type PriorityLevelConfigurationSpecApplyConfiguration struct { - Type *v1.PriorityLevelEnablement `json:"type,omitempty"` - Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"` - Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` -} - -// PriorityLevelConfigurationSpecApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationSpec type for use with -// apply. -func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { - return &PriorityLevelConfigurationSpecApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration { - b.Type = &value - return b -} - -// WithLimited sets the Limited field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Limited field is set to the value of the last call. -func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithLimited(value *LimitedPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { - b.Limited = value - return b -} - -// WithExempt sets the Exempt field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Exempt field is set to the value of the last call. -func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithExempt(value *ExemptPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { - b.Exempt = value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go deleted file mode 100644 index 322871edc690..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// PriorityLevelConfigurationStatusApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationStatus type for use -// with apply. -type PriorityLevelConfigurationStatusApplyConfiguration struct { - Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` -} - -// PriorityLevelConfigurationStatusApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationStatus type for use with -// apply. -func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { - return &PriorityLevelConfigurationStatusApplyConfiguration{} -} - -// WithConditions adds the given value to the Conditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *PriorityLevelConfigurationStatusApplyConfiguration) WithConditions(values ...*PriorityLevelConfigurationConditionApplyConfiguration) *PriorityLevelConfigurationStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithConditions") - } - b.Conditions = append(b.Conditions, *values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/queuingconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/queuingconfiguration.go deleted file mode 100644 index 69fd2c23ccb4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/queuingconfiguration.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// QueuingConfigurationApplyConfiguration represents an declarative configuration of the QueuingConfiguration type for use -// with apply. -type QueuingConfigurationApplyConfiguration struct { - Queues *int32 `json:"queues,omitempty"` - HandSize *int32 `json:"handSize,omitempty"` - QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` -} - -// QueuingConfigurationApplyConfiguration constructs an declarative configuration of the QueuingConfiguration type for use with -// apply. -func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { - return &QueuingConfigurationApplyConfiguration{} -} - -// WithQueues sets the Queues field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Queues field is set to the value of the last call. -func (b *QueuingConfigurationApplyConfiguration) WithQueues(value int32) *QueuingConfigurationApplyConfiguration { - b.Queues = &value - return b -} - -// WithHandSize sets the HandSize field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the HandSize field is set to the value of the last call. -func (b *QueuingConfigurationApplyConfiguration) WithHandSize(value int32) *QueuingConfigurationApplyConfiguration { - b.HandSize = &value - return b -} - -// WithQueueLengthLimit sets the QueueLengthLimit field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the QueueLengthLimit field is set to the value of the last call. -func (b *QueuingConfigurationApplyConfiguration) WithQueueLengthLimit(value int32) *QueuingConfigurationApplyConfiguration { - b.QueueLengthLimit = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go deleted file mode 100644 index 0991ce944545..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use -// with apply. -type ResourcePolicyRuleApplyConfiguration struct { - Verbs []string `json:"verbs,omitempty"` - APIGroups []string `json:"apiGroups,omitempty"` - Resources []string `json:"resources,omitempty"` - ClusterScope *bool `json:"clusterScope,omitempty"` - Namespaces []string `json:"namespaces,omitempty"` -} - -// ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with -// apply. -func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { - return &ResourcePolicyRuleApplyConfiguration{} -} - -// WithVerbs adds the given value to the Verbs field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Verbs field. -func (b *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration { - for i := range values { - b.Verbs = append(b.Verbs, values[i]) - } - return b -} - -// WithAPIGroups adds the given value to the APIGroups field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the APIGroups field. -func (b *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration { - for i := range values { - b.APIGroups = append(b.APIGroups, values[i]) - } - return b -} - -// WithResources adds the given value to the Resources field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Resources field. -func (b *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration { - for i := range values { - b.Resources = append(b.Resources, values[i]) - } - return b -} - -// WithClusterScope sets the ClusterScope field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ClusterScope field is set to the value of the last call. -func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration { - b.ClusterScope = &value - return b -} - -// WithNamespaces adds the given value to the Namespaces field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Namespaces field. -func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration { - for i := range values { - b.Namespaces = append(b.Namespaces, values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go deleted file mode 100644 index 55787ca76736..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// ServiceAccountSubjectApplyConfiguration represents an declarative configuration of the ServiceAccountSubject type for use -// with apply. -type ServiceAccountSubjectApplyConfiguration struct { - Namespace *string `json:"namespace,omitempty"` - Name *string `json:"name,omitempty"` -} - -// ServiceAccountSubjectApplyConfiguration constructs an declarative configuration of the ServiceAccountSubject type for use with -// apply. -func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { - return &ServiceAccountSubjectApplyConfiguration{} -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ServiceAccountSubjectApplyConfiguration) WithNamespace(value string) *ServiceAccountSubjectApplyConfiguration { - b.Namespace = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ServiceAccountSubjectApplyConfiguration) WithName(value string) *ServiceAccountSubjectApplyConfiguration { - b.Name = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/subject.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/subject.go deleted file mode 100644 index f02b03bdc7c3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/subject.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/flowcontrol/v1" -) - -// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use -// with apply. -type SubjectApplyConfiguration struct { - Kind *v1.SubjectKind `json:"kind,omitempty"` - User *UserSubjectApplyConfiguration `json:"user,omitempty"` - Group *GroupSubjectApplyConfiguration `json:"group,omitempty"` - ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` -} - -// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with -// apply. -func Subject() *SubjectApplyConfiguration { - return &SubjectApplyConfiguration{} -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *SubjectApplyConfiguration) WithKind(value v1.SubjectKind) *SubjectApplyConfiguration { - b.Kind = &value - return b -} - -// WithUser sets the User field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the User field is set to the value of the last call. -func (b *SubjectApplyConfiguration) WithUser(value *UserSubjectApplyConfiguration) *SubjectApplyConfiguration { - b.User = value - return b -} - -// WithGroup sets the Group field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Group field is set to the value of the last call. -func (b *SubjectApplyConfiguration) WithGroup(value *GroupSubjectApplyConfiguration) *SubjectApplyConfiguration { - b.Group = value - return b -} - -// WithServiceAccount sets the ServiceAccount field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ServiceAccount field is set to the value of the last call. -func (b *SubjectApplyConfiguration) WithServiceAccount(value *ServiceAccountSubjectApplyConfiguration) *SubjectApplyConfiguration { - b.ServiceAccount = value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/usersubject.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/usersubject.go deleted file mode 100644 index 2d17c111c6ab..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1/usersubject.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// UserSubjectApplyConfiguration represents an declarative configuration of the UserSubject type for use -// with apply. -type UserSubjectApplyConfiguration struct { - Name *string `json:"name,omitempty"` -} - -// UserSubjectApplyConfiguration constructs an declarative configuration of the UserSubject type for use with -// apply. -func UserSubject() *UserSubjectApplyConfiguration { - return &UserSubjectApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *UserSubjectApplyConfiguration) WithName(value string) *UserSubjectApplyConfiguration { - b.Name = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/exemptprioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/exemptprioritylevelconfiguration.go deleted file mode 100644 index 071048090081..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1/exemptprioritylevelconfiguration.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta1 - -// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use -// with apply. -type ExemptPriorityLevelConfigurationApplyConfiguration struct { - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` - LendablePercent *int32 `json:"lendablePercent,omitempty"` -} - -// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with -// apply. -func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { - return &ExemptPriorityLevelConfigurationApplyConfiguration{} -} - -// WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. -func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { - b.NominalConcurrencyShares = &value - return b -} - -// WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LendablePercent field is set to the value of the last call. -func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { - b.LendablePercent = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/exemptprioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/exemptprioritylevelconfiguration.go deleted file mode 100644 index d6bc330fe7a3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2/exemptprioritylevelconfiguration.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta2 - -// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use -// with apply. -type ExemptPriorityLevelConfigurationApplyConfiguration struct { - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` - LendablePercent *int32 `json:"lendablePercent,omitempty"` -} - -// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with -// apply. -func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { - return &ExemptPriorityLevelConfigurationApplyConfiguration{} -} - -// WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. -func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { - b.NominalConcurrencyShares = &value - return b -} - -// WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LendablePercent field is set to the value of the last call. -func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { - b.LendablePercent = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/exemptprioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/exemptprioritylevelconfiguration.go deleted file mode 100644 index b03c11d0d9e6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/exemptprioritylevelconfiguration.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1beta3 - -// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use -// with apply. -type ExemptPriorityLevelConfigurationApplyConfiguration struct { - NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` - LendablePercent *int32 `json:"lendablePercent,omitempty"` -} - -// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with -// apply. -func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { - return &ExemptPriorityLevelConfigurationApplyConfiguration{} -} - -// WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. -func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { - b.NominalConcurrencyShares = &value - return b -} - -// WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LendablePercent field is set to the value of the last call. -func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { - b.LendablePercent = &value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidr.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidr.go deleted file mode 100644 index f6d0a91e009a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidr.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - networkingv1alpha1 "k8s.io/api/networking/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ServiceCIDRApplyConfiguration represents an declarative configuration of the ServiceCIDR type for use -// with apply. -type ServiceCIDRApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *ServiceCIDRSpecApplyConfiguration `json:"spec,omitempty"` - Status *ServiceCIDRStatusApplyConfiguration `json:"status,omitempty"` -} - -// ServiceCIDR constructs an declarative configuration of the ServiceCIDR type for use with -// apply. -func ServiceCIDR(name string) *ServiceCIDRApplyConfiguration { - b := &ServiceCIDRApplyConfiguration{} - b.WithName(name) - b.WithKind("ServiceCIDR") - b.WithAPIVersion("networking.k8s.io/v1alpha1") - return b -} - -// ExtractServiceCIDR extracts the applied configuration owned by fieldManager from -// serviceCIDR. If no managedFields are found in serviceCIDR for fieldManager, a -// ServiceCIDRApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// serviceCIDR must be a unmodified ServiceCIDR API object that was retrieved from the Kubernetes API. -// ExtractServiceCIDR provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractServiceCIDR(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { - return extractServiceCIDR(serviceCIDR, fieldManager, "") -} - -// ExtractServiceCIDRStatus is the same as ExtractServiceCIDR except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractServiceCIDRStatus(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { - return extractServiceCIDR(serviceCIDR, fieldManager, "status") -} - -func extractServiceCIDR(serviceCIDR *networkingv1alpha1.ServiceCIDR, fieldManager string, subresource string) (*ServiceCIDRApplyConfiguration, error) { - b := &ServiceCIDRApplyConfiguration{} - err := managedfields.ExtractInto(serviceCIDR, internal.Parser().Type("io.k8s.api.networking.v1alpha1.ServiceCIDR"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(serviceCIDR.Name) - - b.WithKind("ServiceCIDR") - b.WithAPIVersion("networking.k8s.io/v1alpha1") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithKind(value string) *ServiceCIDRApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithAPIVersion(value string) *ServiceCIDRApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithName(value string) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithGenerateName(value string) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithNamespace(value string) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithUID(value types.UID) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithResourceVersion(value string) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithGeneration(value int64) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ServiceCIDRApplyConfiguration) WithLabels(entries map[string]string) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ServiceCIDRApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ServiceCIDRApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ServiceCIDRApplyConfiguration) WithFinalizers(values ...string) *ServiceCIDRApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ServiceCIDRApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithSpec(value *ServiceCIDRSpecApplyConfiguration) *ServiceCIDRApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *ServiceCIDRApplyConfiguration) WithStatus(value *ServiceCIDRStatusApplyConfiguration) *ServiceCIDRApplyConfiguration { - b.Status = value - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrspec.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrspec.go deleted file mode 100644 index 302d69194cee..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrspec.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ServiceCIDRSpecApplyConfiguration represents an declarative configuration of the ServiceCIDRSpec type for use -// with apply. -type ServiceCIDRSpecApplyConfiguration struct { - CIDRs []string `json:"cidrs,omitempty"` -} - -// ServiceCIDRSpecApplyConfiguration constructs an declarative configuration of the ServiceCIDRSpec type for use with -// apply. -func ServiceCIDRSpec() *ServiceCIDRSpecApplyConfiguration { - return &ServiceCIDRSpecApplyConfiguration{} -} - -// WithCIDRs adds the given value to the CIDRs field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the CIDRs field. -func (b *ServiceCIDRSpecApplyConfiguration) WithCIDRs(values ...string) *ServiceCIDRSpecApplyConfiguration { - for i := range values { - b.CIDRs = append(b.CIDRs, values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrstatus.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrstatus.go deleted file mode 100644 index 5afc549a6505..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/networking/v1alpha1/servicecidrstatus.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ServiceCIDRStatusApplyConfiguration represents an declarative configuration of the ServiceCIDRStatus type for use -// with apply. -type ServiceCIDRStatusApplyConfiguration struct { - Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` -} - -// ServiceCIDRStatusApplyConfiguration constructs an declarative configuration of the ServiceCIDRStatus type for use with -// apply. -func ServiceCIDRStatus() *ServiceCIDRStatusApplyConfiguration { - return &ServiceCIDRStatusApplyConfiguration{} -} - -// WithConditions adds the given value to the Conditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *ServiceCIDRStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ServiceCIDRStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithConditions") - } - b.Conditions = append(b.Conditions, *values[i]) - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go deleted file mode 100644 index 9d4c476259e0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/applyconfigurations/storage/v1alpha1/volumeattributesclass.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "k8s.io/api/storage/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// VolumeAttributesClassApplyConfiguration represents an declarative configuration of the VolumeAttributesClass type for use -// with apply. -type VolumeAttributesClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - DriverName *string `json:"driverName,omitempty"` - Parameters map[string]string `json:"parameters,omitempty"` -} - -// VolumeAttributesClass constructs an declarative configuration of the VolumeAttributesClass type for use with -// apply. -func VolumeAttributesClass(name string) *VolumeAttributesClassApplyConfiguration { - b := &VolumeAttributesClassApplyConfiguration{} - b.WithName(name) - b.WithKind("VolumeAttributesClass") - b.WithAPIVersion("storage.k8s.io/v1alpha1") - return b -} - -// ExtractVolumeAttributesClass extracts the applied configuration owned by fieldManager from -// volumeAttributesClass. If no managedFields are found in volumeAttributesClass for fieldManager, a -// VolumeAttributesClassApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// volumeAttributesClass must be a unmodified VolumeAttributesClass API object that was retrieved from the Kubernetes API. -// ExtractVolumeAttributesClass provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractVolumeAttributesClass(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { - return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "") -} - -// ExtractVolumeAttributesClassStatus is the same as ExtractVolumeAttributesClass except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractVolumeAttributesClassStatus(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { - return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "status") -} - -func extractVolumeAttributesClass(volumeAttributesClass *v1alpha1.VolumeAttributesClass, fieldManager string, subresource string) (*VolumeAttributesClassApplyConfiguration, error) { - b := &VolumeAttributesClassApplyConfiguration{} - err := managedfields.ExtractInto(volumeAttributesClass, internal.Parser().Type("io.k8s.api.storage.v1alpha1.VolumeAttributesClass"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(volumeAttributesClass.Name) - - b.WithKind("VolumeAttributesClass") - b.WithAPIVersion("storage.k8s.io/v1alpha1") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithKind(value string) *VolumeAttributesClassApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithAPIVersion(value string) *VolumeAttributesClassApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithName(value string) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithGenerateName(value string) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithNamespace(value string) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithUID(value types.UID) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithResourceVersion(value string) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithGeneration(value int64) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *VolumeAttributesClassApplyConfiguration) WithLabels(entries map[string]string) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *VolumeAttributesClassApplyConfiguration) WithAnnotations(entries map[string]string) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *VolumeAttributesClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *VolumeAttributesClassApplyConfiguration) WithFinalizers(values ...string) *VolumeAttributesClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *VolumeAttributesClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithDriverName sets the DriverName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *VolumeAttributesClassApplyConfiguration) WithDriverName(value string) *VolumeAttributesClassApplyConfiguration { - b.DriverName = &value - return b -} - -// WithParameters puts the entries into the Parameters field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Parameters field, -// overwriting an existing map entries in Parameters field with the same key. -func (b *VolumeAttributesClassApplyConfiguration) WithParameters(entries map[string]string) *VolumeAttributesClassApplyConfiguration { - if b.Parameters == nil && len(entries) > 0 { - b.Parameters = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Parameters[k] = v - } - return b -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go deleted file mode 100644 index d0e9cd64c82f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - time "time" - - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" - cache "k8s.io/client-go/tools/cache" -) - -// ValidatingAdmissionPolicyInformer provides access to a shared informer and lister for -// ValidatingAdmissionPolicies. -type ValidatingAdmissionPolicyInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1beta1.ValidatingAdmissionPolicyLister -} - -type validatingAdmissionPolicyInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredValidatingAdmissionPolicyInformer constructs a new informer for ValidatingAdmissionPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredValidatingAdmissionPolicyInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicies().Watch(context.TODO(), options) - }, - }, - &admissionregistrationv1beta1.ValidatingAdmissionPolicy{}, - resyncPeriod, - indexers, - ) -} - -func (f *validatingAdmissionPolicyInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredValidatingAdmissionPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *validatingAdmissionPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&admissionregistrationv1beta1.ValidatingAdmissionPolicy{}, f.defaultInformer) -} - -func (f *validatingAdmissionPolicyInformer) Lister() v1beta1.ValidatingAdmissionPolicyLister { - return v1beta1.NewValidatingAdmissionPolicyLister(f.Informer().GetIndexer()) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go deleted file mode 100644 index 7641e9940670..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - time "time" - - admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1beta1 "k8s.io/client-go/listers/admissionregistration/v1beta1" - cache "k8s.io/client-go/tools/cache" -) - -// ValidatingAdmissionPolicyBindingInformer provides access to a shared informer and lister for -// ValidatingAdmissionPolicyBindings. -type ValidatingAdmissionPolicyBindingInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1beta1.ValidatingAdmissionPolicyBindingLister -} - -type validatingAdmissionPolicyBindingInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredValidatingAdmissionPolicyBindingInformer constructs a new informer for ValidatingAdmissionPolicyBinding type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredValidatingAdmissionPolicyBindingInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AdmissionregistrationV1beta1().ValidatingAdmissionPolicyBindings().Watch(context.TODO(), options) - }, - }, - &admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding{}, - resyncPeriod, - indexers, - ) -} - -func (f *validatingAdmissionPolicyBindingInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredValidatingAdmissionPolicyBindingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *validatingAdmissionPolicyBindingInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding{}, f.defaultInformer) -} - -func (f *validatingAdmissionPolicyBindingInformer) Lister() v1beta1.ValidatingAdmissionPolicyBindingLister { - return v1beta1.NewValidatingAdmissionPolicyBindingLister(f.Informer().GetIndexer()) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go deleted file mode 100644 index 30c41b189b83..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/flowschema.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - flowcontrolv1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1 "k8s.io/client-go/listers/flowcontrol/v1" - cache "k8s.io/client-go/tools/cache" -) - -// FlowSchemaInformer provides access to a shared informer and lister for -// FlowSchemas. -type FlowSchemaInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.FlowSchemaLister -} - -type flowSchemaInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewFlowSchemaInformer constructs a new informer for FlowSchema type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredFlowSchemaInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.FlowcontrolV1().FlowSchemas().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.FlowcontrolV1().FlowSchemas().Watch(context.TODO(), options) - }, - }, - &flowcontrolv1.FlowSchema{}, - resyncPeriod, - indexers, - ) -} - -func (f *flowSchemaInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredFlowSchemaInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&flowcontrolv1.FlowSchema{}, f.defaultInformer) -} - -func (f *flowSchemaInformer) Lister() v1.FlowSchemaLister { - return v1.NewFlowSchemaLister(f.Informer().GetIndexer()) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go deleted file mode 100644 index 3de934900fe5..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/interface.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // FlowSchemas returns a FlowSchemaInformer. - FlowSchemas() FlowSchemaInformer - // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. - PriorityLevelConfigurations() PriorityLevelConfigurationInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// FlowSchemas returns a FlowSchemaInformer. -func (v *version) FlowSchemas() FlowSchemaInformer { - return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. -func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { - return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go deleted file mode 100644 index 7092c257259c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/flowcontrol/v1/prioritylevelconfiguration.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - flowcontrolv1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1 "k8s.io/client-go/listers/flowcontrol/v1" - cache "k8s.io/client-go/tools/cache" -) - -// PriorityLevelConfigurationInformer provides access to a shared informer and lister for -// PriorityLevelConfigurations. -type PriorityLevelConfigurationInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.PriorityLevelConfigurationLister -} - -type priorityLevelConfigurationInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.FlowcontrolV1().PriorityLevelConfigurations().List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(context.TODO(), options) - }, - }, - &flowcontrolv1.PriorityLevelConfiguration{}, - resyncPeriod, - indexers, - ) -} - -func (f *priorityLevelConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&flowcontrolv1.PriorityLevelConfiguration{}, f.defaultInformer) -} - -func (f *priorityLevelConfigurationInformer) Lister() v1.PriorityLevelConfigurationLister { - return v1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go deleted file mode 100644 index 57e6021431e4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/networking/v1alpha1/servicecidr.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - networkingv1alpha1 "k8s.io/api/networking/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1alpha1 "k8s.io/client-go/listers/networking/v1alpha1" - cache "k8s.io/client-go/tools/cache" -) - -// ServiceCIDRInformer provides access to a shared informer and lister for -// ServiceCIDRs. -type ServiceCIDRInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.ServiceCIDRLister -} - -type serviceCIDRInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewServiceCIDRInformer constructs a new informer for ServiceCIDR type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredServiceCIDRInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.NetworkingV1alpha1().ServiceCIDRs().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.NetworkingV1alpha1().ServiceCIDRs().Watch(context.TODO(), options) - }, - }, - &networkingv1alpha1.ServiceCIDR{}, - resyncPeriod, - indexers, - ) -} - -func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredServiceCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1alpha1.ServiceCIDR{}, f.defaultInformer) -} - -func (f *serviceCIDRInformer) Lister() v1alpha1.ServiceCIDRLister { - return v1alpha1.NewServiceCIDRLister(f.Informer().GetIndexer()) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go deleted file mode 100644 index 5e62e2f42301..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattributesclass.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - storagev1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1alpha1 "k8s.io/client-go/listers/storage/v1alpha1" - cache "k8s.io/client-go/tools/cache" -) - -// VolumeAttributesClassInformer provides access to a shared informer and lister for -// VolumeAttributesClasses. -type VolumeAttributesClassInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.VolumeAttributesClassLister -} - -type volumeAttributesClassInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.StorageV1alpha1().VolumeAttributesClasses().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.StorageV1alpha1().VolumeAttributesClasses().Watch(context.TODO(), options) - }, - }, - &storagev1alpha1.VolumeAttributesClass{}, - resyncPeriod, - indexers, - ) -} - -func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&storagev1alpha1.VolumeAttributesClass{}, f.defaultInformer) -} - -func (f *volumeAttributesClassInformer) Lister() v1alpha1.VolumeAttributesClassLister { - return v1alpha1.NewVolumeAttributesClassLister(f.Informer().GetIndexer()) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go deleted file mode 100644 index 90cb4ff6ca86..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface -type FakeValidatingAdmissionPolicies struct { - Fake *FakeAdmissionregistrationV1beta1 -} - -var validatingadmissionpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicies") - -var validatingadmissionpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy") - -// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. -func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), &v1beta1.ValidatingAdmissionPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), &v1beta1.ValidatingAdmissionPolicyList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1beta1.ValidatingAdmissionPolicyList).ListMeta} - for _, item := range obj.(*v1beta1.ValidatingAdmissionPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. -func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingadmissionpoliciesResource, opts)) -} - -// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. -func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1beta1.ValidatingAdmissionPolicy{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingadmissionpoliciesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicy. -func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), &v1beta1.ValidatingAdmissionPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. -func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingAdmissionPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.ValidatingAdmissionPolicy{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), err -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go deleted file mode 100644 index f771f81f301b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - testing "k8s.io/client-go/testing" -) - -// FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface -type FakeValidatingAdmissionPolicyBindings struct { - Fake *FakeAdmissionregistrationV1beta1 -} - -var validatingadmissionpolicybindingsResource = v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings") - -var validatingadmissionpolicybindingsKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding") - -// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), &v1beta1.ValidatingAdmissionPolicyBinding{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), &v1beta1.ValidatingAdmissionPolicyBindingList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1beta1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1beta1.ValidatingAdmissionPolicyBindingList).ListMeta} - for _, item := range obj.(*v1beta1.ValidatingAdmissionPolicyBindingList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. -func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingadmissionpolicybindingsResource, opts)) -} - -// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1beta1.ValidatingAdmissionPolicyBinding{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} - -// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1beta1.ValidatingAdmissionPolicyBinding{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} - -// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. -func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1beta1.ValidatingAdmissionPolicyBinding{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingadmissionpolicybindingsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyBindingList{}) - return err -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. -func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), &v1beta1.ValidatingAdmissionPolicyBinding{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. -func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - if validatingAdmissionPolicyBinding == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") - } - data, err := json.Marshal(validatingAdmissionPolicyBinding) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicyBinding.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingAdmissionPolicyBinding{}) - if obj == nil { - return nil, err - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go deleted file mode 100644 index bea51b587f62..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. -// A group's client should implement this interface. -type ValidatingAdmissionPoliciesGetter interface { - ValidatingAdmissionPolicies() ValidatingAdmissionPolicyInterface -} - -// ValidatingAdmissionPolicyInterface has methods to work with ValidatingAdmissionPolicy resources. -type ValidatingAdmissionPolicyInterface interface { - Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) - Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) - UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ValidatingAdmissionPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) - Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) - ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) - ValidatingAdmissionPolicyExpansion -} - -// validatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface -type validatingAdmissionPolicies struct { - client rest.Interface -} - -// newValidatingAdmissionPolicies returns a ValidatingAdmissionPolicies -func newValidatingAdmissionPolicies(c *AdmissionregistrationV1beta1Client) *validatingAdmissionPolicies { - return &validatingAdmissionPolicies{ - client: c.RESTClient(), - } -} - -// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. -func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ValidatingAdmissionPolicyList{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. -func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *validatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Post(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *validatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Put(). - Resource("validatingadmissionpolicies"). - Name(validatingAdmissionPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *validatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Put(). - Resource("validatingadmissionpolicies"). - Name(validatingAdmissionPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. -func (c *validatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingadmissionpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("validatingadmissionpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicy. -func (c *validatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Patch(pt). - Resource("validatingadmissionpolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy. -func (c *validatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicies"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *validatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicies"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go deleted file mode 100644 index bba37bb0477b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1beta1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. -// A group's client should implement this interface. -type ValidatingAdmissionPolicyBindingsGetter interface { - ValidatingAdmissionPolicyBindings() ValidatingAdmissionPolicyBindingInterface -} - -// ValidatingAdmissionPolicyBindingInterface has methods to work with ValidatingAdmissionPolicyBinding resources. -type ValidatingAdmissionPolicyBindingInterface interface { - Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (*v1beta1.ValidatingAdmissionPolicyBinding, error) - Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicyBinding, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ValidatingAdmissionPolicyBinding, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyBindingList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) - Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) - ValidatingAdmissionPolicyBindingExpansion -} - -// validatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface -type validatingAdmissionPolicyBindings struct { - client rest.Interface -} - -// newValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindings -func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1beta1Client) *validatingAdmissionPolicyBindings { - return &validatingAdmissionPolicyBindings{ - client: c.RESTClient(), - } -} - -// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. -func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ValidatingAdmissionPolicyBindingList{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. -func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *validatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Post(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicyBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *validatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Put(). - Resource("validatingadmissionpolicybindings"). - Name(validatingAdmissionPolicyBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicyBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. -func (c *validatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingadmissionpolicybindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. -func (c *validatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Patch(pt). - Resource("validatingadmissionpolicybindings"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding. -func (c *validatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - if validatingAdmissionPolicyBinding == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicyBinding) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicyBinding.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") - } - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicybindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go deleted file mode 100644 index e683b3eaaa01..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - v1 "k8s.io/api/authentication/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" -) - -// FakeSelfSubjectReviews implements SelfSubjectReviewInterface -type FakeSelfSubjectReviews struct { - Fake *FakeAuthenticationV1 -} - -var selfsubjectreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectreviews") - -var selfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectReview") - -// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. -func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), &v1.SelfSubjectReview{}) - if obj == nil { - return nil, err - } - return obj.(*v1.SelfSubjectReview), err -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/selfsubjectreview.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/selfsubjectreview.go deleted file mode 100644 index bfb9603d672d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/selfsubjectreview.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - - v1 "k8s.io/api/authentication/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// SelfSubjectReviewsGetter has a method to return a SelfSubjectReviewInterface. -// A group's client should implement this interface. -type SelfSubjectReviewsGetter interface { - SelfSubjectReviews() SelfSubjectReviewInterface -} - -// SelfSubjectReviewInterface has methods to work with SelfSubjectReview resources. -type SelfSubjectReviewInterface interface { - Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (*v1.SelfSubjectReview, error) - SelfSubjectReviewExpansion -} - -// selfSubjectReviews implements SelfSubjectReviewInterface -type selfSubjectReviews struct { - client rest.Interface -} - -// newSelfSubjectReviews returns a SelfSubjectReviews -func newSelfSubjectReviews(c *AuthenticationV1Client) *selfSubjectReviews { - return &selfSubjectReviews{ - client: c.RESTClient(), - } -} - -// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. -func (c *selfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) { - result = &v1.SelfSubjectReview{} - err = c.client.Post(). - Resource("selfsubjectreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectReview). - Do(ctx). - Into(result) - return -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/doc.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/doc.go deleted file mode 100644 index 3af5d054f102..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1 diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go deleted file mode 100644 index 16f44399065e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go deleted file mode 100644 index d15f4b242642..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeFlowcontrolV1 struct { - *testing.Fake -} - -func (c *FakeFlowcontrolV1) FlowSchemas() v1.FlowSchemaInterface { - return &FakeFlowSchemas{c} -} - -func (c *FakeFlowcontrolV1) PriorityLevelConfigurations() v1.PriorityLevelConfigurationInterface { - return &FakePriorityLevelConfigurations{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeFlowcontrolV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go deleted file mode 100644 index 922a60d89bee..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" - testing "k8s.io/client-go/testing" -) - -// FakeFlowSchemas implements FlowSchemaInterface -type FakeFlowSchemas struct { - Fake *FakeFlowcontrolV1 -} - -var flowschemasResource = v1.SchemeGroupVersion.WithResource("flowschemas") - -var flowschemasKind = v1.SchemeGroupVersion.WithKind("FlowSchema") - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1.FlowSchema{}) - if obj == nil { - return nil, err - } - return obj.(*v1.FlowSchema), err -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1.FlowSchemaList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.FlowSchemaList{ListMeta: obj.(*v1.FlowSchemaList).ListMeta} - for _, item := range obj.(*v1.FlowSchemaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *FakeFlowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(flowschemasResource, opts)) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1.FlowSchema{}) - if obj == nil { - return nil, err - } - return obj.(*v1.FlowSchema), err -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1.FlowSchema{}) - if obj == nil { - return nil, err - } - return obj.(*v1.FlowSchema), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1.FlowSchema{}) - if obj == nil { - return nil, err - } - return obj.(*v1.FlowSchema), err -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1.FlowSchema{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1.FlowSchemaList{}) - return err -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1.FlowSchema{}) - if obj == nil { - return nil, err - } - return obj.(*v1.FlowSchema), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. -func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1.FlowSchema{}) - if obj == nil { - return nil, err - } - return obj.(*v1.FlowSchema), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1.FlowSchema{}) - if obj == nil { - return nil, err - } - return obj.(*v1.FlowSchema), err -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go deleted file mode 100644 index 27d958674881..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" - testing "k8s.io/client-go/testing" -) - -// FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface -type FakePriorityLevelConfigurations struct { - Fake *FakeFlowcontrolV1 -} - -var prioritylevelconfigurationsResource = v1.SchemeGroupVersion.WithResource("prioritylevelconfigurations") - -var prioritylevelconfigurationsKind = v1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1.PriorityLevelConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1.PriorityLevelConfigurationList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.PriorityLevelConfigurationList{ListMeta: obj.(*v1.PriorityLevelConfigurationList).ListMeta} - for _, item := range obj.(*v1.PriorityLevelConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(prioritylevelconfigurationsResource, opts)) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1.PriorityLevelConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1.PriorityLevelConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1.PriorityLevelConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. -func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1.PriorityLevelConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1.PriorityLevelConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1.PriorityLevelConfiguration), err -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go deleted file mode 100644 index 3d7d93ef147b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowcontrol_client.go +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "net/http" - - v1 "k8s.io/api/flowcontrol/v1" - "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -type FlowcontrolV1Interface interface { - RESTClient() rest.Interface - FlowSchemasGetter - PriorityLevelConfigurationsGetter -} - -// FlowcontrolV1Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. -type FlowcontrolV1Client struct { - restClient rest.Interface -} - -func (c *FlowcontrolV1Client) FlowSchemas() FlowSchemaInterface { - return newFlowSchemas(c) -} - -func (c *FlowcontrolV1Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { - return newPriorityLevelConfigurations(c) -} - -// NewForConfig creates a new FlowcontrolV1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*FlowcontrolV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new FlowcontrolV1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &FlowcontrolV1Client{client}, nil -} - -// NewForConfigOrDie creates a new FlowcontrolV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new FlowcontrolV1Client for the given RESTClient. -func New(c rest.Interface) *FlowcontrolV1Client { - return &FlowcontrolV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FlowcontrolV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowschema.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowschema.go deleted file mode 100644 index bd36c5e6a4e1..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/flowschema.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// FlowSchemasGetter has a method to return a FlowSchemaInterface. -// A group's client should implement this interface. -type FlowSchemasGetter interface { - FlowSchemas() FlowSchemaInterface -} - -// FlowSchemaInterface has methods to work with FlowSchema resources. -type FlowSchemaInterface interface { - Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (*v1.FlowSchema, error) - Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) - UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FlowSchema, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.FlowSchemaList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) - Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) - ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) - FlowSchemaExpansion -} - -// flowSchemas implements FlowSchemaInterface -type flowSchemas struct { - client rest.Interface -} - -// newFlowSchemas returns a FlowSchemas -func newFlowSchemas(c *FlowcontrolV1Client) *flowSchemas { - return &flowSchemas{ - client: c.RESTClient(), - } -} - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *flowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Get(). - Resource("flowschemas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *flowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Post(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *flowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("flowschemas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *flowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("flowschemas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Patch(pt). - Resource("flowschemas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. -func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - result = &v1.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - - result = &v1.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/generated_expansion.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/generated_expansion.go deleted file mode 100644 index 99067738873d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/generated_expansion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -type FlowSchemaExpansion interface{} - -type PriorityLevelConfigurationExpansion interface{} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go deleted file mode 100644 index 797fe94035e4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1 "k8s.io/api/flowcontrol/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. -// A group's client should implement this interface. -type PriorityLevelConfigurationsGetter interface { - PriorityLevelConfigurations() PriorityLevelConfigurationInterface -} - -// PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. -type PriorityLevelConfigurationInterface interface { - Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*v1.PriorityLevelConfiguration, error) - Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) - UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PriorityLevelConfiguration, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityLevelConfigurationList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) - Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) - ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) - PriorityLevelConfigurationExpansion -} - -// priorityLevelConfigurations implements PriorityLevelConfigurationInterface -type priorityLevelConfigurations struct { - client rest.Interface -} - -// newPriorityLevelConfigurations returns a PriorityLevelConfigurations -func newPriorityLevelConfigurations(c *FlowcontrolV1Client) *priorityLevelConfigurations { - return &priorityLevelConfigurations{ - client: c.RESTClient(), - } -} - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Post(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("prioritylevelconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *priorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("prioritylevelconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Patch(pt). - Resource("prioritylevelconfigurations"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - result = &v1.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - - result = &v1.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go deleted file mode 100644 index 653ef631af1c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/networking/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeServiceCIDRs implements ServiceCIDRInterface -type FakeServiceCIDRs struct { - Fake *FakeNetworkingV1alpha1 -} - -var servicecidrsResource = v1alpha1.SchemeGroupVersion.WithResource("servicecidrs") - -var servicecidrsKind = v1alpha1.SchemeGroupVersion.WithKind("ServiceCIDR") - -// Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. -func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(servicecidrsResource, name), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(servicecidrsResource, servicecidrsKind, opts), &v1alpha1.ServiceCIDRList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ServiceCIDRList{ListMeta: obj.(*v1alpha1.ServiceCIDRList).ListMeta} - for _, item := range obj.(*v1alpha1.ServiceCIDRList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested serviceCIDRs. -func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(servicecidrsResource, opts)) -} - -// Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(servicecidrsResource, serviceCIDR), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(servicecidrsResource, serviceCIDR), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(servicecidrsResource, "status", serviceCIDR), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. -func (c *FakeServiceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(servicecidrsResource, name, opts), &v1alpha1.ServiceCIDR{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(servicecidrsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ServiceCIDRList{}) - return err -} - -// Patch applies the patch and returns the patched serviceCIDR. -func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, name, pt, data, subresources...), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied serviceCIDR. -func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ServiceCIDR{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ServiceCIDR), err -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/servicecidr.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/servicecidr.go deleted file mode 100644 index 100f290a19f1..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/networking/v1alpha1/servicecidr.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "k8s.io/api/networking/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. -// A group's client should implement this interface. -type ServiceCIDRsGetter interface { - ServiceCIDRs() ServiceCIDRInterface -} - -// ServiceCIDRInterface has methods to work with ServiceCIDR resources. -type ServiceCIDRInterface interface { - Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (*v1alpha1.ServiceCIDR, error) - Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) - UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ServiceCIDR, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ServiceCIDRList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) - Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) - ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) - ServiceCIDRExpansion -} - -// serviceCIDRs implements ServiceCIDRInterface -type serviceCIDRs struct { - client rest.Interface -} - -// newServiceCIDRs returns a ServiceCIDRs -func newServiceCIDRs(c *NetworkingV1alpha1Client) *serviceCIDRs { - return &serviceCIDRs{ - client: c.RESTClient(), - } -} - -// Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. -func (c *serviceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Get(). - Resource("servicecidrs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *serviceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ServiceCIDRList{} - err = c.client.Get(). - Resource("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested serviceCIDRs. -func (c *serviceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *serviceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Post(). - Resource("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *serviceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Put(). - Resource("servicecidrs"). - Name(serviceCIDR.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *serviceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Put(). - Resource("servicecidrs"). - Name(serviceCIDR.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. -func (c *serviceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("servicecidrs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *serviceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("servicecidrs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched serviceCIDR. -func (c *serviceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(pt). - Resource("servicecidrs"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied serviceCIDR. -func (c *serviceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(types.ApplyPatchType). - Resource("servicecidrs"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *serviceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(types.ApplyPatchType). - Resource("servicecidrs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go deleted file mode 100644 index d25263df48c9..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" - testing "k8s.io/client-go/testing" -) - -// FakeVolumeAttributesClasses implements VolumeAttributesClassInterface -type FakeVolumeAttributesClasses struct { - Fake *FakeStorageV1alpha1 -} - -var volumeattributesclassesResource = v1alpha1.SchemeGroupVersion.WithResource("volumeattributesclasses") - -var volumeattributesclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAttributesClass") - -// Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. -func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattributesclassesResource, name), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattributesclassesResource, volumeattributesclassesKind, opts), &v1alpha1.VolumeAttributesClassList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VolumeAttributesClassList{ListMeta: obj.(*v1alpha1.VolumeAttributesClassList).ListMeta} - for _, item := range obj.(*v1alpha1.VolumeAttributesClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested volumeAttributesClasses. -func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(volumeattributesclassesResource, opts)) -} - -// Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattributesclassesResource, volumeAttributesClass), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattributesclassesResource, volumeAttributesClass), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. -func (c *FakeVolumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(volumeattributesclassesResource, name, opts), &v1alpha1.VolumeAttributesClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattributesclassesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttributesClassList{}) - return err -} - -// Patch applies the patch and returns the patched volumeAttributesClass. -func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, name, pt, data, subresources...), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttributesClass. -func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - if volumeAttributesClass == nil { - return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") - } - data, err := json.Marshal(volumeAttributesClass) - if err != nil { - return nil, err - } - name := volumeAttributesClass.Name - if name == nil { - return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.VolumeAttributesClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VolumeAttributesClass), err -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go deleted file mode 100644 index 6633a4dc1502..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "k8s.io/api/storage/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// VolumeAttributesClassesGetter has a method to return a VolumeAttributesClassInterface. -// A group's client should implement this interface. -type VolumeAttributesClassesGetter interface { - VolumeAttributesClasses() VolumeAttributesClassInterface -} - -// VolumeAttributesClassInterface has methods to work with VolumeAttributesClass resources. -type VolumeAttributesClassInterface interface { - Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (*v1alpha1.VolumeAttributesClass, error) - Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (*v1alpha1.VolumeAttributesClass, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VolumeAttributesClass, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttributesClassList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) - Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) - VolumeAttributesClassExpansion -} - -// volumeAttributesClasses implements VolumeAttributesClassInterface -type volumeAttributesClasses struct { - client rest.Interface -} - -// newVolumeAttributesClasses returns a VolumeAttributesClasses -func newVolumeAttributesClasses(c *StorageV1alpha1Client) *volumeAttributesClasses { - return &volumeAttributesClasses{ - client: c.RESTClient(), - } -} - -// Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. -func (c *volumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Get(). - Resource("volumeattributesclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *volumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumeAttributesClassList{} - err = c.client.Get(). - Resource("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumeAttributesClasses. -func (c *volumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *volumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Post(). - Resource("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttributesClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *volumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Put(). - Resource("volumeattributesclasses"). - Name(volumeAttributesClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttributesClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. -func (c *volumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("volumeattributesclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("volumeattributesclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volumeAttributesClass. -func (c *volumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Patch(pt). - Resource("volumeattributesclasses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttributesClass. -func (c *volumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - if volumeAttributesClass == nil { - return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttributesClass) - if err != nil { - return nil, err - } - name := volumeAttributesClass.Name - if name == nil { - return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") - } - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattributesclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go deleted file mode 100644 index 7018b3ceec67..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ValidatingAdmissionPolicyLister helps list ValidatingAdmissionPolicies. -// All objects returned here must be treated as read-only. -type ValidatingAdmissionPolicyLister interface { - // List lists all ValidatingAdmissionPolicies in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.ValidatingAdmissionPolicy, err error) - // Get retrieves the ValidatingAdmissionPolicy from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.ValidatingAdmissionPolicy, error) - ValidatingAdmissionPolicyListerExpansion -} - -// validatingAdmissionPolicyLister implements the ValidatingAdmissionPolicyLister interface. -type validatingAdmissionPolicyLister struct { - indexer cache.Indexer -} - -// NewValidatingAdmissionPolicyLister returns a new ValidatingAdmissionPolicyLister. -func NewValidatingAdmissionPolicyLister(indexer cache.Indexer) ValidatingAdmissionPolicyLister { - return &validatingAdmissionPolicyLister{indexer: indexer} -} - -// List lists all ValidatingAdmissionPolicies in the indexer. -func (s *validatingAdmissionPolicyLister) List(selector labels.Selector) (ret []*v1beta1.ValidatingAdmissionPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ValidatingAdmissionPolicy)) - }) - return ret, err -} - -// Get retrieves the ValidatingAdmissionPolicy from the index for a given name. -func (s *validatingAdmissionPolicyLister) Get(name string) (*v1beta1.ValidatingAdmissionPolicy, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("validatingadmissionpolicy"), name) - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go deleted file mode 100644 index 5fcebfd22fbe..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/listers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1beta1 - -import ( - v1beta1 "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ValidatingAdmissionPolicyBindingLister helps list ValidatingAdmissionPolicyBindings. -// All objects returned here must be treated as read-only. -type ValidatingAdmissionPolicyBindingLister interface { - // List lists all ValidatingAdmissionPolicyBindings in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.ValidatingAdmissionPolicyBinding, err error) - // Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.ValidatingAdmissionPolicyBinding, error) - ValidatingAdmissionPolicyBindingListerExpansion -} - -// validatingAdmissionPolicyBindingLister implements the ValidatingAdmissionPolicyBindingLister interface. -type validatingAdmissionPolicyBindingLister struct { - indexer cache.Indexer -} - -// NewValidatingAdmissionPolicyBindingLister returns a new ValidatingAdmissionPolicyBindingLister. -func NewValidatingAdmissionPolicyBindingLister(indexer cache.Indexer) ValidatingAdmissionPolicyBindingLister { - return &validatingAdmissionPolicyBindingLister{indexer: indexer} -} - -// List lists all ValidatingAdmissionPolicyBindings in the indexer. -func (s *validatingAdmissionPolicyBindingLister) List(selector labels.Selector) (ret []*v1beta1.ValidatingAdmissionPolicyBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ValidatingAdmissionPolicyBinding)) - }) - return ret, err -} - -// Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. -func (s *validatingAdmissionPolicyBindingLister) Get(name string) (*v1beta1.ValidatingAdmissionPolicyBinding, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("validatingadmissionpolicybinding"), name) - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/expansion_generated.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/expansion_generated.go deleted file mode 100644 index 70b5eb5b1713..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -// FlowSchemaListerExpansion allows custom methods to be added to -// FlowSchemaLister. -type FlowSchemaListerExpansion interface{} - -// PriorityLevelConfigurationListerExpansion allows custom methods to be added to -// PriorityLevelConfigurationLister. -type PriorityLevelConfigurationListerExpansion interface{} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/flowschema.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/flowschema.go deleted file mode 100644 index 43ccd4e5ff98..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/flowschema.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/flowcontrol/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// FlowSchemaLister helps list FlowSchemas. -// All objects returned here must be treated as read-only. -type FlowSchemaLister interface { - // List lists all FlowSchemas in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.FlowSchema, err error) - // Get retrieves the FlowSchema from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.FlowSchema, error) - FlowSchemaListerExpansion -} - -// flowSchemaLister implements the FlowSchemaLister interface. -type flowSchemaLister struct { - indexer cache.Indexer -} - -// NewFlowSchemaLister returns a new FlowSchemaLister. -func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { - return &flowSchemaLister{indexer: indexer} -} - -// List lists all FlowSchemas in the indexer. -func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1.FlowSchema, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.FlowSchema)) - }) - return ret, err -} - -// Get retrieves the FlowSchema from the index for a given name. -func (s *flowSchemaLister) Get(name string) (*v1.FlowSchema, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("flowschema"), name) - } - return obj.(*v1.FlowSchema), nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/prioritylevelconfiguration.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/prioritylevelconfiguration.go deleted file mode 100644 index 61189b9cf98b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/listers/flowcontrol/v1/prioritylevelconfiguration.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/flowcontrol/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// PriorityLevelConfigurationLister helps list PriorityLevelConfigurations. -// All objects returned here must be treated as read-only. -type PriorityLevelConfigurationLister interface { - // List lists all PriorityLevelConfigurations in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.PriorityLevelConfiguration, err error) - // Get retrieves the PriorityLevelConfiguration from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.PriorityLevelConfiguration, error) - PriorityLevelConfigurationListerExpansion -} - -// priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. -type priorityLevelConfigurationLister struct { - indexer cache.Indexer -} - -// NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. -func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { - return &priorityLevelConfigurationLister{indexer: indexer} -} - -// List lists all PriorityLevelConfigurations in the indexer. -func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1.PriorityLevelConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PriorityLevelConfiguration)) - }) - return ret, err -} - -// Get retrieves the PriorityLevelConfiguration from the index for a given name. -func (s *priorityLevelConfigurationLister) Get(name string) (*v1.PriorityLevelConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("prioritylevelconfiguration"), name) - } - return obj.(*v1.PriorityLevelConfiguration), nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/networking/v1alpha1/servicecidr.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/networking/v1alpha1/servicecidr.go deleted file mode 100644 index 8bc2b10e6813..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/listers/networking/v1alpha1/servicecidr.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "k8s.io/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ServiceCIDRLister helps list ServiceCIDRs. -// All objects returned here must be treated as read-only. -type ServiceCIDRLister interface { - // List lists all ServiceCIDRs in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.ServiceCIDR, err error) - // Get retrieves the ServiceCIDR from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.ServiceCIDR, error) - ServiceCIDRListerExpansion -} - -// serviceCIDRLister implements the ServiceCIDRLister interface. -type serviceCIDRLister struct { - indexer cache.Indexer -} - -// NewServiceCIDRLister returns a new ServiceCIDRLister. -func NewServiceCIDRLister(indexer cache.Indexer) ServiceCIDRLister { - return &serviceCIDRLister{indexer: indexer} -} - -// List lists all ServiceCIDRs in the indexer. -func (s *serviceCIDRLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceCIDR, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ServiceCIDR)) - }) - return ret, err -} - -// Get retrieves the ServiceCIDR from the index for a given name. -func (s *serviceCIDRLister) Get(name string) (*v1alpha1.ServiceCIDR, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("servicecidr"), name) - } - return obj.(*v1alpha1.ServiceCIDR), nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattributesclass.go b/cluster-autoscaler/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattributesclass.go deleted file mode 100644 index f30b4a89ba10..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/listers/storage/v1alpha1/volumeattributesclass.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "k8s.io/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// VolumeAttributesClassLister helps list VolumeAttributesClasses. -// All objects returned here must be treated as read-only. -type VolumeAttributesClassLister interface { - // List lists all VolumeAttributesClasses in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VolumeAttributesClass, err error) - // Get retrieves the VolumeAttributesClass from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.VolumeAttributesClass, error) - VolumeAttributesClassListerExpansion -} - -// volumeAttributesClassLister implements the VolumeAttributesClassLister interface. -type volumeAttributesClassLister struct { - indexer cache.Indexer -} - -// NewVolumeAttributesClassLister returns a new VolumeAttributesClassLister. -func NewVolumeAttributesClassLister(indexer cache.Indexer) VolumeAttributesClassLister { - return &volumeAttributesClassLister{indexer: indexer} -} - -// List lists all VolumeAttributesClasses in the indexer. -func (s *volumeAttributesClassLister) List(selector labels.Selector) (ret []*v1alpha1.VolumeAttributesClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VolumeAttributesClass)) - }) - return ret, err -} - -// Get retrieves the VolumeAttributesClass from the index for a given name. -func (s *volumeAttributesClassLister) Get(name string) (*v1alpha1.VolumeAttributesClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("volumeattributesclass"), name) - } - return obj.(*v1alpha1.VolumeAttributesClass), nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/openapi/typeconverter.go b/cluster-autoscaler/vendor/k8s.io/client-go/openapi/typeconverter.go deleted file mode 100644 index 4b91e66d4516..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/openapi/typeconverter.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -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 openapi - -import ( - "encoding/json" - "fmt" - - "k8s.io/apimachinery/pkg/util/managedfields" - "k8s.io/kube-openapi/pkg/spec3" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -func NewTypeConverter(client Client, preserveUnknownFields bool) (managedfields.TypeConverter, error) { - spec := map[string]*spec.Schema{} - paths, err := client.Paths() - if err != nil { - return nil, fmt.Errorf("failed to list paths: %w", err) - } - for _, gv := range paths { - s, err := gv.Schema("application/json") - if err != nil { - return nil, fmt.Errorf("failed to download schema: %w", err) - } - var openapi spec3.OpenAPI - if err := json.Unmarshal(s, &openapi); err != nil { - return nil, fmt.Errorf("failed to parse schema: %w", err) - } - for k, v := range openapi.Components.Schemas { - spec[k] = v - } - } - return managedfields.NewTypeConverter(spec, preserveUnknownFields) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/object-names.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/object-names.go deleted file mode 100644 index aa8dbb199373..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/object-names.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -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 cache - -import ( - "k8s.io/apimachinery/pkg/types" -) - -// ObjectName is a reference to an object of some implicit kind -type ObjectName struct { - Namespace string - Name string -} - -// NewObjectName constructs a new one -func NewObjectName(namespace, name string) ObjectName { - return ObjectName{Namespace: namespace, Name: name} -} - -// Parts is the inverse of the constructor -func (objName ObjectName) Parts() (namespace, name string) { - return objName.Namespace, objName.Name -} - -// String returns the standard string encoding, -// which is designed to match the historical behavior of MetaNamespaceKeyFunc. -// Note this behavior is different from the String method of types.NamespacedName. -func (objName ObjectName) String() string { - if len(objName.Namespace) > 0 { - return objName.Namespace + "/" + objName.Name - } - return objName.Name -} - -// ParseObjectName tries to parse the standard encoding -func ParseObjectName(str string) (ObjectName, error) { - var objName ObjectName - var err error - objName.Namespace, objName.Name, err = SplitMetaNamespaceKey(str) - return objName, err -} - -// NamespacedNameAsObjectName rebrands the given NamespacedName as an ObjectName -func NamespacedNameAsObjectName(nn types.NamespacedName) ObjectName { - return NewObjectName(nn.Namespace, nn.Name) -} - -// AsNamespacedName rebrands as a NamespacedName -func (objName ObjectName) AsNamespacedName() types.NamespacedName { - return types.NamespacedName{Namespace: objName.Namespace, Name: objName.Name} -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go deleted file mode 100644 index aa3027d714e9..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/cache/reflector_data_consistency_detector.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -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 cache - -import ( - "context" - "os" - "sort" - "strconv" - "time" - - "github.com/google/go-cmp/cmp" - - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/klog/v2" -) - -var dataConsistencyDetectionEnabled = false - -func init() { - dataConsistencyDetectionEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) -} - -// checkWatchListConsistencyIfRequested performs a data consistency check only when -// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. -// -// The consistency check is meant to be enforced only in the CI, not in production. -// The check ensures that data retrieved by the watch-list api call -// is exactly the same as data received by the standard list api call. -// -// Note that this function will panic when data inconsistency is detected. -// This is intentional because we want to catch it in the CI. -func checkWatchListConsistencyIfRequested(stopCh <-chan struct{}, identity string, lastSyncedResourceVersion string, listerWatcher Lister, store Store) { - if !dataConsistencyDetectionEnabled { - return - } - checkWatchListConsistency(stopCh, identity, lastSyncedResourceVersion, listerWatcher, store) -} - -// checkWatchListConsistency exists solely for testing purposes. -// we cannot use checkWatchListConsistencyIfRequested because -// it is guarded by an environmental variable. -// we cannot manipulate the environmental variable because -// it will affect other tests in this package. -func checkWatchListConsistency(stopCh <-chan struct{}, identity string, lastSyncedResourceVersion string, listerWatcher Lister, store Store) { - klog.Warningf("%s: data consistency check for the watch-list feature is enabled, this will result in an additional call to the API server.", identity) - opts := metav1.ListOptions{ - ResourceVersion: lastSyncedResourceVersion, - ResourceVersionMatch: metav1.ResourceVersionMatchExact, - } - var list runtime.Object - err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), time.Second, true, func(_ context.Context) (done bool, err error) { - list, err = listerWatcher.List(opts) - if err != nil { - // the consistency check will only be enabled in the CI - // and LIST calls in general will be retired by the client-go library - // if we fail simply log and retry - klog.Errorf("failed to list data from the server, retrying until stopCh is closed, err: %v", err) - return false, nil - } - return true, nil - }) - if err != nil { - klog.Errorf("failed to list data from the server, the watch-list consistency check won't be performed, stopCh was closed, err: %v", err) - return - } - - rawListItems, err := meta.ExtractListWithAlloc(list) - if err != nil { - panic(err) // this should never happen - } - - listItems := toMetaObjectSliceOrDie(rawListItems) - storeItems := toMetaObjectSliceOrDie(store.List()) - - sort.Sort(byUID(listItems)) - sort.Sort(byUID(storeItems)) - - if !cmp.Equal(listItems, storeItems) { - klog.Infof("%s: data received by the new watch-list api call is different than received by the standard list api call, diff: %v", identity, cmp.Diff(listItems, storeItems)) - msg := "data inconsistency detected for the watch-list feature, panicking!" - panic(msg) - } -} - -type byUID []metav1.Object - -func (a byUID) Len() int { return len(a) } -func (a byUID) Less(i, j int) bool { return a[i].GetUID() < a[j].GetUID() } -func (a byUID) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -func toMetaObjectSliceOrDie[T any](s []T) []metav1.Object { - result := make([]metav1.Object, len(s)) - for i, v := range s { - m, err := meta.Accessor(v) - if err != nil { - panic(err) - } - result[i] = m - } - return result -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/internal/events/interfaces.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/internal/events/interfaces.go deleted file mode 100644 index be6261b531f2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/internal/events/interfaces.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 internal is needed to break an import cycle: record.EventRecorderAdapter -// needs this interface definition to implement it, but event.NewEventBroadcasterAdapter -// needs record.NewBroadcaster. Therefore this interface cannot be in event/interfaces.go. -package internal - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog/v2" -) - -// EventRecorder knows how to record events on behalf of an EventSource. -type EventRecorder interface { - // Eventf constructs an event from the given information and puts it in the queue for sending. - // 'regarding' is the object this event is about. Event will make a reference-- or you may also - // pass a reference to the object directly. - // 'related' is the secondary object for more complex actions. E.g. when regarding object triggers - // a creation or deletion of related object. - // 'type' of this event, and can be one of Normal, Warning. New types could be added in future - // 'reason' is the reason this event is generated. 'reason' should be short and unique; it - // should be in UpperCamelCase format (starting with a capital letter). "reason" will be used - // to automate handling of events, so imagine people writing switch statements to handle them. - // You want to make that easy. - // 'action' explains what happened with regarding/what action did the ReportingController - // (ReportingController is a type of a Controller reporting an Event, e.g. k8s.io/node-controller, k8s.io/kubelet.) - // take in regarding's name; it should be in UpperCamelCase format (starting with a capital letter). - // 'note' is intended to be human readable. - Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) -} - -// EventRecorderLogger extends EventRecorder such that a logger can -// be set for methods in EventRecorder. Normally, those methods -// uses the global default logger to record errors and debug messages. -// If that is not desired, use WithLogger to provide a logger instance. -type EventRecorderLogger interface { - EventRecorder - - // WithLogger replaces the context used for logging. This is a cheap call - // and meant to be used for contextual logging: - // recorder := ... - // logger := klog.FromContext(ctx) - // recorder.WithLogger(logger).Eventf(...) - WithLogger(logger klog.Logger) EventRecorderLogger -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/fallback.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/fallback.go deleted file mode 100644 index 4846cdb55097..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/fallback.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -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 remotecommand - -import ( - "context" -) - -var _ Executor = &fallbackExecutor{} - -type fallbackExecutor struct { - primary Executor - secondary Executor - shouldFallback func(error) bool -} - -// NewFallbackExecutor creates an Executor that first attempts to use the -// WebSocketExecutor, falling back to the legacy SPDYExecutor if the initial -// websocket "StreamWithContext" call fails. -// func NewFallbackExecutor(config *restclient.Config, method string, url *url.URL) (Executor, error) { -func NewFallbackExecutor(primary, secondary Executor, shouldFallback func(error) bool) (Executor, error) { - return &fallbackExecutor{ - primary: primary, - secondary: secondary, - shouldFallback: shouldFallback, - }, nil -} - -// Stream is deprecated. Please use "StreamWithContext". -func (f *fallbackExecutor) Stream(options StreamOptions) error { - return f.StreamWithContext(context.Background(), options) -} - -// StreamWithContext initially attempts to call "StreamWithContext" using the -// primary executor, falling back to calling the secondary executor if the -// initial primary call to upgrade to a websocket connection fails. -func (f *fallbackExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { - err := f.primary.StreamWithContext(ctx, options) - if f.shouldFallback(err) { - return f.secondary.StreamWithContext(ctx, options) - } - return err -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/spdy.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/spdy.go deleted file mode 100644 index c2bfcf8a6541..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/spdy.go +++ /dev/null @@ -1,171 +0,0 @@ -/* -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 remotecommand - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "k8s.io/apimachinery/pkg/util/httpstream" - "k8s.io/apimachinery/pkg/util/remotecommand" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/transport/spdy" - "k8s.io/klog/v2" -) - -// spdyStreamExecutor handles transporting standard shell streams over an httpstream connection. -type spdyStreamExecutor struct { - upgrader spdy.Upgrader - transport http.RoundTripper - - method string - url *url.URL - protocols []string - rejectRedirects bool // if true, receiving redirect from upstream is an error -} - -// NewSPDYExecutor connects to the provided server and upgrades the connection to -// multiplexed bidirectional streams. -func NewSPDYExecutor(config *restclient.Config, method string, url *url.URL) (Executor, error) { - wrapper, upgradeRoundTripper, err := spdy.RoundTripperFor(config) - if err != nil { - return nil, err - } - return NewSPDYExecutorForTransports(wrapper, upgradeRoundTripper, method, url) -} - -// NewSPDYExecutorRejectRedirects returns an Executor that will upgrade the future -// connection to a SPDY bi-directional streaming connection when calling "Stream" (deprecated) -// or "StreamWithContext" (preferred). Additionally, if the upstream server returns a redirect -// during the attempted upgrade in these "Stream" calls, an error is returned. -func NewSPDYExecutorRejectRedirects(transport http.RoundTripper, upgrader spdy.Upgrader, method string, url *url.URL) (Executor, error) { - executor, err := NewSPDYExecutorForTransports(transport, upgrader, method, url) - if err != nil { - return nil, err - } - spdyExecutor := executor.(*spdyStreamExecutor) - spdyExecutor.rejectRedirects = true - return spdyExecutor, nil -} - -// NewSPDYExecutorForTransports connects to the provided server using the given transport, -// upgrades the response using the given upgrader to multiplexed bidirectional streams. -func NewSPDYExecutorForTransports(transport http.RoundTripper, upgrader spdy.Upgrader, method string, url *url.URL) (Executor, error) { - return NewSPDYExecutorForProtocols( - transport, upgrader, method, url, - remotecommand.StreamProtocolV5Name, - remotecommand.StreamProtocolV4Name, - remotecommand.StreamProtocolV3Name, - remotecommand.StreamProtocolV2Name, - remotecommand.StreamProtocolV1Name, - ) -} - -// NewSPDYExecutorForProtocols connects to the provided server and upgrades the connection to -// multiplexed bidirectional streams using only the provided protocols. Exposed for testing, most -// callers should use NewSPDYExecutor or NewSPDYExecutorForTransports. -func NewSPDYExecutorForProtocols(transport http.RoundTripper, upgrader spdy.Upgrader, method string, url *url.URL, protocols ...string) (Executor, error) { - return &spdyStreamExecutor{ - upgrader: upgrader, - transport: transport, - method: method, - url: url, - protocols: protocols, - }, nil -} - -// Stream opens a protocol streamer to the server and streams until a client closes -// the connection or the server disconnects. -func (e *spdyStreamExecutor) Stream(options StreamOptions) error { - return e.StreamWithContext(context.Background(), options) -} - -// newConnectionAndStream creates a new SPDY connection and a stream protocol handler upon it. -func (e *spdyStreamExecutor) newConnectionAndStream(ctx context.Context, options StreamOptions) (httpstream.Connection, streamProtocolHandler, error) { - req, err := http.NewRequestWithContext(ctx, e.method, e.url.String(), nil) - if err != nil { - return nil, nil, fmt.Errorf("error creating request: %v", err) - } - - client := http.Client{Transport: e.transport} - if e.rejectRedirects { - client.CheckRedirect = func(req *http.Request, via []*http.Request) error { - return fmt.Errorf("redirect not allowed") - } - } - conn, protocol, err := spdy.Negotiate( - e.upgrader, - &client, - req, - e.protocols..., - ) - if err != nil { - return nil, nil, err - } - - var streamer streamProtocolHandler - - switch protocol { - case remotecommand.StreamProtocolV5Name: - streamer = newStreamProtocolV5(options) - case remotecommand.StreamProtocolV4Name: - streamer = newStreamProtocolV4(options) - case remotecommand.StreamProtocolV3Name: - streamer = newStreamProtocolV3(options) - case remotecommand.StreamProtocolV2Name: - streamer = newStreamProtocolV2(options) - case "": - klog.V(4).Infof("The server did not negotiate a streaming protocol version. Falling back to %s", remotecommand.StreamProtocolV1Name) - fallthrough - case remotecommand.StreamProtocolV1Name: - streamer = newStreamProtocolV1(options) - } - - return conn, streamer, nil -} - -// StreamWithContext opens a protocol streamer to the server and streams until a client closes -// the connection or the server disconnects or the context is done. -func (e *spdyStreamExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { - conn, streamer, err := e.newConnectionAndStream(ctx, options) - if err != nil { - return err - } - defer conn.Close() - - panicChan := make(chan any, 1) - errorChan := make(chan error, 1) - go func() { - defer func() { - if p := recover(); p != nil { - panicChan <- p - } - }() - errorChan <- streamer.stream(conn) - }() - - select { - case p := <-panicChan: - panic(p) - case err := <-errorChan: - return err - case <-ctx.Done(): - return ctx.Err() - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/v5.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/v5.go deleted file mode 100644 index 4da7bfb13990..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/v5.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -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 remotecommand - -// streamProtocolV5 add support for V5 of the remote command subprotocol. -// For the streamProtocolHandler, this version is the same as V4. -type streamProtocolV5 struct { - *streamProtocolV4 -} - -var _ streamProtocolHandler = &streamProtocolV5{} - -func newStreamProtocolV5(options StreamOptions) streamProtocolHandler { - return &streamProtocolV5{ - streamProtocolV4: newStreamProtocolV4(options).(*streamProtocolV4), - } -} - -func (p *streamProtocolV5) stream(conn streamCreator) error { - return p.streamProtocolV4.stream(conn) -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/websocket.go b/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/websocket.go deleted file mode 100644 index a60986decca8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/tools/remotecommand/websocket.go +++ /dev/null @@ -1,502 +0,0 @@ -/* -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 remotecommand - -import ( - "context" - "errors" - "fmt" - "io" - "net" - "net/http" - "sync" - "time" - - gwebsocket "github.com/gorilla/websocket" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/httpstream" - "k8s.io/apimachinery/pkg/util/remotecommand" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/transport/websocket" - "k8s.io/klog/v2" -) - -// writeDeadline defines the time that a write to the websocket connection -// must complete by, otherwise an i/o timeout occurs. The writeDeadline -// has nothing to do with a response from the other websocket connection -// endpoint; only that the message was successfully processed by the -// local websocket connection. The typical write deadline within the websocket -// library is one second. -const writeDeadline = 2 * time.Second - -var ( - _ Executor = &wsStreamExecutor{} - _ streamCreator = &wsStreamCreator{} - _ httpstream.Stream = &stream{} - - streamType2streamID = map[string]byte{ - v1.StreamTypeStdin: remotecommand.StreamStdIn, - v1.StreamTypeStdout: remotecommand.StreamStdOut, - v1.StreamTypeStderr: remotecommand.StreamStdErr, - v1.StreamTypeError: remotecommand.StreamErr, - v1.StreamTypeResize: remotecommand.StreamResize, - } -) - -const ( - // pingPeriod defines how often a heartbeat "ping" message is sent. - pingPeriod = 5 * time.Second - // pingReadDeadline defines the time waiting for a response heartbeat - // "pong" message before a timeout error occurs for websocket reading. - // This duration must always be greater than the "pingPeriod". By defining - // this deadline in terms of the ping period, we are essentially saying - // we can drop "X-1" (e.g. 3-1=2) pings before firing the timeout. - pingReadDeadline = (pingPeriod * 3) + (1 * time.Second) -) - -// wsStreamExecutor handles transporting standard shell streams over an httpstream connection. -type wsStreamExecutor struct { - transport http.RoundTripper - upgrader websocket.ConnectionHolder - method string - url string - // requested protocols in priority order (e.g. v5.channel.k8s.io before v4.channel.k8s.io). - protocols []string - // selected protocol from the handshake process; could be empty string if handshake fails. - negotiated string - // period defines how often a "ping" heartbeat message is sent to the other endpoint. - heartbeatPeriod time.Duration - // deadline defines the amount of time before "pong" response must be received. - heartbeatDeadline time.Duration -} - -func NewWebSocketExecutor(config *restclient.Config, method, url string) (Executor, error) { - // Only supports V5 protocol for correct version skew functionality. - // Previous api servers will proxy upgrade requests to legacy websocket - // servers on container runtimes which support V1-V4. These legacy - // websocket servers will not handle the new CLOSE signal. - return NewWebSocketExecutorForProtocols(config, method, url, remotecommand.StreamProtocolV5Name) -} - -// NewWebSocketExecutorForProtocols allows to execute commands via a WebSocket connection. -func NewWebSocketExecutorForProtocols(config *restclient.Config, method, url string, protocols ...string) (Executor, error) { - transport, upgrader, err := websocket.RoundTripperFor(config) - if err != nil { - return nil, fmt.Errorf("error creating websocket transports: %v", err) - } - return &wsStreamExecutor{ - transport: transport, - upgrader: upgrader, - method: method, - url: url, - protocols: protocols, - heartbeatPeriod: pingPeriod, - heartbeatDeadline: pingReadDeadline, - }, nil -} - -// Deprecated: use StreamWithContext instead to avoid possible resource leaks. -// See https://github.com/kubernetes/kubernetes/pull/103177 for details. -func (e *wsStreamExecutor) Stream(options StreamOptions) error { - return e.StreamWithContext(context.Background(), options) -} - -// StreamWithContext upgrades an HTTPRequest to a WebSocket connection, and starts the various -// goroutines to implement the necessary streams over the connection. The "options" parameter -// defines which streams are requested. Returns an error if one occurred. This method is NOT -// safe to run concurrently with the same executor (because of the state stored in the upgrader). -func (e *wsStreamExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { - req, err := http.NewRequestWithContext(ctx, e.method, e.url, nil) - if err != nil { - return err - } - conn, err := websocket.Negotiate(e.transport, e.upgrader, req, e.protocols...) - if err != nil { - return err - } - if conn == nil { - panic(fmt.Errorf("websocket connection is nil")) - } - defer conn.Close() - e.negotiated = conn.Subprotocol() - klog.V(4).Infof("The subprotocol is %s", e.negotiated) - - var streamer streamProtocolHandler - switch e.negotiated { - case remotecommand.StreamProtocolV5Name: - streamer = newStreamProtocolV5(options) - case remotecommand.StreamProtocolV4Name: - streamer = newStreamProtocolV4(options) - case remotecommand.StreamProtocolV3Name: - streamer = newStreamProtocolV3(options) - case remotecommand.StreamProtocolV2Name: - streamer = newStreamProtocolV2(options) - case "": - klog.V(4).Infof("The server did not negotiate a streaming protocol version. Falling back to %s", remotecommand.StreamProtocolV1Name) - fallthrough - case remotecommand.StreamProtocolV1Name: - streamer = newStreamProtocolV1(options) - } - - panicChan := make(chan any, 1) - errorChan := make(chan error, 1) - go func() { - defer func() { - if p := recover(); p != nil { - panicChan <- p - } - }() - creator := newWSStreamCreator(conn) - go creator.readDemuxLoop( - e.upgrader.DataBufferSize(), - e.heartbeatPeriod, - e.heartbeatDeadline, - ) - errorChan <- streamer.stream(creator) - }() - - select { - case p := <-panicChan: - panic(p) - case err := <-errorChan: - return err - case <-ctx.Done(): - return ctx.Err() - } -} - -type wsStreamCreator struct { - conn *gwebsocket.Conn - // Protects writing to websocket connection; reading is lock-free - connWriteLock sync.Mutex - // map of stream id to stream; multiple streams read/write the connection - streams map[byte]*stream - streamsMu sync.Mutex -} - -func newWSStreamCreator(conn *gwebsocket.Conn) *wsStreamCreator { - return &wsStreamCreator{ - conn: conn, - streams: map[byte]*stream{}, - } -} - -func (c *wsStreamCreator) getStream(id byte) *stream { - c.streamsMu.Lock() - defer c.streamsMu.Unlock() - return c.streams[id] -} - -func (c *wsStreamCreator) setStream(id byte, s *stream) { - c.streamsMu.Lock() - defer c.streamsMu.Unlock() - c.streams[id] = s -} - -// CreateStream uses id from passed headers to create a stream over "c.conn" connection. -// Returns a Stream structure or nil and an error if one occurred. -func (c *wsStreamCreator) CreateStream(headers http.Header) (httpstream.Stream, error) { - streamType := headers.Get(v1.StreamType) - id, ok := streamType2streamID[streamType] - if !ok { - return nil, fmt.Errorf("unknown stream type: %s", streamType) - } - if s := c.getStream(id); s != nil { - return nil, fmt.Errorf("duplicate stream for type %s", streamType) - } - reader, writer := io.Pipe() - s := &stream{ - headers: headers, - readPipe: reader, - writePipe: writer, - conn: c.conn, - connWriteLock: &c.connWriteLock, - id: id, - } - c.setStream(id, s) - return s, nil -} - -// readDemuxLoop is the lock-free reading processor for this endpoint of the websocket -// connection. This loop reads the connection, and demultiplexes the data -// into one of the individual stream pipes (by checking the stream id). This -// loop can *not* be run concurrently, because there can only be one websocket -// connection reader at a time (a read mutex would provide no benefit). -func (c *wsStreamCreator) readDemuxLoop(bufferSize int, period time.Duration, deadline time.Duration) { - // Initialize and start the ping/pong heartbeat. - h := newHeartbeat(c.conn, period, deadline) - // Set initial timeout for websocket connection reading. - if err := c.conn.SetReadDeadline(time.Now().Add(deadline)); err != nil { - klog.Errorf("Websocket initial setting read deadline failed %v", err) - return - } - go h.start() - // Buffer size must correspond to the same size allocated - // for the read buffer during websocket client creation. A - // difference can cause incomplete connection reads. - readBuffer := make([]byte, bufferSize) - for { - // NextReader() only returns data messages (BinaryMessage or Text - // Message). Even though this call will never return control frames - // such as ping, pong, or close, this call is necessary for these - // message types to be processed. There can only be one reader - // at a time, so this reader loop must *not* be run concurrently; - // there is no lock for reading. Calling "NextReader()" before the - // current reader has been processed will close the current reader. - // If the heartbeat read deadline times out, this "NextReader()" will - // return an i/o error, and error handling will clean up. - messageType, r, err := c.conn.NextReader() - if err != nil { - websocketErr, ok := err.(*gwebsocket.CloseError) - if ok && websocketErr.Code == gwebsocket.CloseNormalClosure { - err = nil // readers will get io.EOF as it's a normal closure - } else { - err = fmt.Errorf("next reader: %w", err) - } - c.closeAllStreamReaders(err) - return - } - // All remote command protocols send/receive only binary data messages. - if messageType != gwebsocket.BinaryMessage { - c.closeAllStreamReaders(fmt.Errorf("unexpected message type: %d", messageType)) - return - } - // It's ok to read just a single byte because the underlying library wraps the actual - // connection with a buffered reader anyway. - _, err = io.ReadFull(r, readBuffer[:1]) - if err != nil { - c.closeAllStreamReaders(fmt.Errorf("read stream id: %w", err)) - return - } - streamID := readBuffer[0] - s := c.getStream(streamID) - if s == nil { - klog.Errorf("Unknown stream id %d, discarding message", streamID) - continue - } - for { - nr, errRead := r.Read(readBuffer) - if nr > 0 { - // Write the data to the stream's pipe. This can block. - _, errWrite := s.writePipe.Write(readBuffer[:nr]) - if errWrite != nil { - // Pipe must have been closed by the stream user. - // Nothing to do, discard the message. - break - } - } - if errRead != nil { - if errRead == io.EOF { - break - } - c.closeAllStreamReaders(fmt.Errorf("read message: %w", err)) - return - } - } - } -} - -// closeAllStreamReaders closes readers in all streams. -// This unblocks all stream.Read() calls. -func (c *wsStreamCreator) closeAllStreamReaders(err error) { - c.streamsMu.Lock() - defer c.streamsMu.Unlock() - for _, s := range c.streams { - // Closing writePipe unblocks all readPipe.Read() callers and prevents any future writes. - _ = s.writePipe.CloseWithError(err) - } -} - -type stream struct { - headers http.Header - readPipe *io.PipeReader - writePipe *io.PipeWriter - // conn is used for writing directly into the connection. - // Is nil after Close() / Reset() to prevent future writes. - conn *gwebsocket.Conn - // connWriteLock protects conn against concurrent write operations. There must be a single writer and a single reader only. - // The mutex is shared across all streams because the underlying connection is shared. - connWriteLock *sync.Mutex - id byte -} - -func (s *stream) Read(p []byte) (n int, err error) { - return s.readPipe.Read(p) -} - -// Write writes directly to the underlying WebSocket connection. -func (s *stream) Write(p []byte) (n int, err error) { - klog.V(4).Infof("Write() on stream %d", s.id) - defer klog.V(4).Infof("Write() done on stream %d", s.id) - s.connWriteLock.Lock() - defer s.connWriteLock.Unlock() - if s.conn == nil { - return 0, fmt.Errorf("write on closed stream %d", s.id) - } - err = s.conn.SetWriteDeadline(time.Now().Add(writeDeadline)) - if err != nil { - klog.V(7).Infof("Websocket setting write deadline failed %v", err) - return 0, err - } - // Message writer buffers the message data, so we don't need to do that ourselves. - // Just write id and the data as two separate writes to avoid allocating an intermediate buffer. - w, err := s.conn.NextWriter(gwebsocket.BinaryMessage) - if err != nil { - return 0, err - } - defer func() { - if w != nil { - w.Close() - } - }() - _, err = w.Write([]byte{s.id}) - if err != nil { - return 0, err - } - n, err = w.Write(p) - if err != nil { - return n, err - } - err = w.Close() - w = nil - return n, err -} - -// Close half-closes the stream, indicating this side is finished with the stream. -func (s *stream) Close() error { - klog.V(4).Infof("Close() on stream %d", s.id) - defer klog.V(4).Infof("Close() done on stream %d", s.id) - s.connWriteLock.Lock() - defer s.connWriteLock.Unlock() - if s.conn == nil { - return fmt.Errorf("Close() on already closed stream %d", s.id) - } - // Communicate the CLOSE stream signal to the other websocket endpoint. - err := s.conn.WriteMessage(gwebsocket.BinaryMessage, []byte{remotecommand.StreamClose, s.id}) - s.conn = nil - return err -} - -func (s *stream) Reset() error { - klog.V(4).Infof("Reset() on stream %d", s.id) - defer klog.V(4).Infof("Reset() done on stream %d", s.id) - s.Close() - return s.writePipe.Close() -} - -func (s *stream) Headers() http.Header { - return s.headers -} - -func (s *stream) Identifier() uint32 { - return uint32(s.id) -} - -// heartbeat encasulates data necessary for the websocket ping/pong heartbeat. This -// heartbeat works by setting a read deadline on the websocket connection, then -// pushing this deadline into the future for every successful heartbeat. If the -// heartbeat "pong" fails to respond within the deadline, then the "NextReader()" call -// inside the "readDemuxLoop" will return an i/o error prompting a connection close -// and cleanup. -type heartbeat struct { - conn *gwebsocket.Conn - // period defines how often a "ping" heartbeat message is sent to the other endpoint - period time.Duration - // closing the "closer" channel will clean up the heartbeat timers - closer chan struct{} - // optional data to send with "ping" message - message []byte - // optionally received data message with "pong" message, same as sent with ping - pongMessage []byte -} - -// newHeartbeat creates heartbeat structure encapsulating fields necessary to -// run the websocket connection ping/pong mechanism and sets up handlers on -// the websocket connection. -func newHeartbeat(conn *gwebsocket.Conn, period time.Duration, deadline time.Duration) *heartbeat { - h := &heartbeat{ - conn: conn, - period: period, - closer: make(chan struct{}), - } - // Set up handler for receiving returned "pong" message from other endpoint - // by pushing the read deadline into the future. The "msg" received could - // be empty. - h.conn.SetPongHandler(func(msg string) error { - // Push the read deadline into the future. - klog.V(8).Infof("Pong message received (%s)--resetting read deadline", msg) - err := h.conn.SetReadDeadline(time.Now().Add(deadline)) - if err != nil { - klog.Errorf("Websocket setting read deadline failed %v", err) - return err - } - if len(msg) > 0 { - h.pongMessage = []byte(msg) - } - return nil - }) - // Set up handler to cleanup timers when this endpoint receives "Close" message. - closeHandler := h.conn.CloseHandler() - h.conn.SetCloseHandler(func(code int, text string) error { - close(h.closer) - return closeHandler(code, text) - }) - return h -} - -// setMessage is optional data sent with "ping" heartbeat. According to the websocket RFC -// this data sent with "ping" message should be returned in "pong" message. -func (h *heartbeat) setMessage(msg string) { - h.message = []byte(msg) -} - -// start the heartbeat by setting up necesssary handlers and looping by sending "ping" -// message every "period" until the "closer" channel is closed. -func (h *heartbeat) start() { - // Loop to continually send "ping" message through websocket connection every "period". - t := time.NewTicker(h.period) - defer t.Stop() - for { - select { - case <-h.closer: - klog.V(8).Infof("closed channel--returning") - return - case <-t.C: - // "WriteControl" does not need to be protected by a mutex. According to - // gorilla/websockets library docs: "The Close and WriteControl methods can - // be called concurrently with all other methods." - if err := h.conn.WriteControl(gwebsocket.PingMessage, h.message, time.Now().Add(writeDeadline)); err == nil { - klog.V(8).Infof("Websocket Ping succeeeded") - } else { - klog.Errorf("Websocket Ping failed: %v", err) - if errors.Is(err, gwebsocket.ErrCloseSent) { - // we continue because c.conn.CloseChan will manage closing the connection already - continue - } else if e, ok := err.(net.Error); ok && e.Timeout() { - // Continue, in case this is a transient failure. - // c.conn.CloseChan above will tell us when the connection is - // actually closed. - // If Temporary function hadn't been deprecated, we would have used it. - // But most of temporary errors are timeout errors anyway. - continue - } - return - } - } - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/client-go/transport/websocket/roundtripper.go b/cluster-autoscaler/vendor/k8s.io/client-go/transport/websocket/roundtripper.go deleted file mode 100644 index 010f916bc7b2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/client-go/transport/websocket/roundtripper.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -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 websocket - -import ( - "crypto/tls" - "fmt" - "net/http" - "net/url" - - gwebsocket "github.com/gorilla/websocket" - - "k8s.io/apimachinery/pkg/util/httpstream" - utilnet "k8s.io/apimachinery/pkg/util/net" - restclient "k8s.io/client-go/rest" - "k8s.io/client-go/transport" -) - -var ( - _ utilnet.TLSClientConfigHolder = &RoundTripper{} - _ http.RoundTripper = &RoundTripper{} -) - -// ConnectionHolder defines functions for structure providing -// access to the websocket connection. -type ConnectionHolder interface { - DataBufferSize() int - Connection() *gwebsocket.Conn -} - -// RoundTripper knows how to establish a connection to a remote WebSocket endpoint and make it available for use. -// RoundTripper must not be reused. -type RoundTripper struct { - // TLSConfig holds the TLS configuration settings to use when connecting - // to the remote server. - TLSConfig *tls.Config - - // Proxier specifies a function to return a proxy for a given - // Request. If the function returns a non-nil error, the - // request is aborted with the provided error. - // If Proxy is nil or returns a nil *URL, no proxy is used. - Proxier func(req *http.Request) (*url.URL, error) - - // Conn holds the WebSocket connection after a round trip. - Conn *gwebsocket.Conn -} - -// Connection returns the stored websocket connection. -func (rt *RoundTripper) Connection() *gwebsocket.Conn { - return rt.Conn -} - -// DataBufferSize returns the size of buffers for the -// websocket connection. -func (rt *RoundTripper) DataBufferSize() int { - return 32 * 1024 -} - -// TLSClientConfig implements pkg/util/net.TLSClientConfigHolder. -func (rt *RoundTripper) TLSClientConfig() *tls.Config { - return rt.TLSConfig -} - -// RoundTrip connects to the remote websocket using the headers in the request and the TLS -// configuration from the config -func (rt *RoundTripper) RoundTrip(request *http.Request) (retResp *http.Response, retErr error) { - defer func() { - if request.Body != nil { - err := request.Body.Close() - if retErr == nil { - retErr = err - } - } - }() - - // set the protocol version directly on the dialer from the header - protocolVersions := request.Header[httpstream.HeaderProtocolVersion] - delete(request.Header, httpstream.HeaderProtocolVersion) - - dialer := gwebsocket.Dialer{ - Proxy: rt.Proxier, - TLSClientConfig: rt.TLSConfig, - Subprotocols: protocolVersions, - ReadBufferSize: rt.DataBufferSize() + 1024, // add space for the protocol byte indicating which channel the data is for - WriteBufferSize: rt.DataBufferSize() + 1024, // add space for the protocol byte indicating which channel the data is for - } - switch request.URL.Scheme { - case "https": - request.URL.Scheme = "wss" - case "http": - request.URL.Scheme = "ws" - default: - return nil, fmt.Errorf("unknown url scheme: %s", request.URL.Scheme) - } - wsConn, resp, err := dialer.DialContext(request.Context(), request.URL.String(), request.Header) - if err != nil { - return nil, &httpstream.UpgradeFailureError{Cause: err} - } - - rt.Conn = wsConn - - return resp, nil -} - -// RoundTripperFor transforms the passed rest config into a wrapped roundtripper, as well -// as a pointer to the websocket RoundTripper. The websocket RoundTripper contains the -// websocket connection after RoundTrip() on the wrapper. Returns an error if there is -// a problem creating the round trippers. -func RoundTripperFor(config *restclient.Config) (http.RoundTripper, ConnectionHolder, error) { - transportCfg, err := config.TransportConfig() - if err != nil { - return nil, nil, err - } - tlsConfig, err := transport.TLSConfigFor(transportCfg) - if err != nil { - return nil, nil, err - } - proxy := config.Proxy - if proxy == nil { - proxy = utilnet.NewProxierWithNoProxyCIDR(http.ProxyFromEnvironment) - } - - upgradeRoundTripper := &RoundTripper{ - TLSConfig: tlsConfig, - Proxier: proxy, - } - wrapper, err := transport.HTTPWrappersForConfig(transportCfg, upgradeRoundTripper) - if err != nil { - return nil, nil, err - } - return wrapper, upgradeRoundTripper, nil -} - -// Negotiate opens a connection to a remote server and attempts to negotiate -// a WebSocket connection. Upon success, it returns the negotiated connection. -// The round tripper rt must use the WebSocket round tripper wsRt - see RoundTripperFor. -func Negotiate(rt http.RoundTripper, connectionInfo ConnectionHolder, req *http.Request, protocols ...string) (*gwebsocket.Conn, error) { - req.Header[httpstream.HeaderProtocolVersion] = protocols - resp, err := rt.RoundTrip(req) - if err != nil { - return nil, err - } - err = resp.Body.Close() - if err != nil { - connectionInfo.Connection().Close() - return nil, fmt.Errorf("error closing response body: %v", err) - } - return connectionInfo.Connection(), nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/cloud-provider/api/retry_error.go b/cluster-autoscaler/vendor/k8s.io/cloud-provider/api/retry_error.go deleted file mode 100644 index ac0e5e6e728f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/cloud-provider/api/retry_error.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 api - -import ( - "time" -) - -// RetryError indicates that a service reconciliation should be retried after a -// fixed duration (as opposed to backing off exponentially). -type RetryError struct { - msg string - retryAfter time.Duration -} - -// NewRetryError returns a RetryError. -func NewRetryError(msg string, retryAfter time.Duration) *RetryError { - return &RetryError{ - msg: msg, - retryAfter: retryAfter, - } -} - -// Error shows the details of the retry reason. -func (re *RetryError) Error() string { - return re.msg -} - -// RetryAfter returns the defined retry-after duration. -func (re *RetryError) RetryAfter() time.Duration { - return re.retryAfter -} diff --git a/cluster-autoscaler/vendor/k8s.io/cloud-provider/names/controller_names.go b/cluster-autoscaler/vendor/k8s.io/cloud-provider/names/controller_names.go deleted file mode 100644 index 87e938d01e69..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/cloud-provider/names/controller_names.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -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 names - -// Canonical controller names -// -// NAMING CONVENTIONS -// 1. naming should be consistent across the controllers -// 2. use of shortcuts should be avoided, unless they are well-known non-Kubernetes shortcuts -// 3. Kubernetes' resources should be written together without a hyphen ("-") -// -// CHANGE POLICY -// The controller names should be treated as IDs. -// They can only be changed if absolutely necessary. For example if an inappropriate name was chosen in the past, or if the scope of the controller changes. -// When a name is changed, the old name should be aliased in CCMControllerAliases, while preserving all old aliases. -// This is done to achieve backwards compatibility -// -// USE CASES -// The following places should use the controller name constants, when: -// 1. registering a controller in app.DefaultInitFuncConstructors or sample main.controllerInitializers: -// 1.1. disabling a controller by default in app.ControllersDisabledByDefault -// 1.2. checking if IsControllerEnabled -// 1.3. defining an alias in CCMControllerAliases (for backwards compatibility only) -// 2. used anywhere inside the controller itself: -// 2.1. [TODO] logger component should be configured with the controller name by calling LoggerWithName -// 2.2. [TODO] logging should use a canonical controller name when referencing a controller (Eg. Starting X, Shutting down X) -// 2.3. [TODO] emitted events should have an EventSource.Component set to the controller name (usually when initializing an EventRecorder) -// 2.4. [TODO] registering ControllerManagerMetrics with ControllerStarted and ControllerStopped -// 2.5. [TODO] calling WaitForNamedCacheSync -// 3. defining controller options for "--help" command or generated documentation -// 3.1. controller name should be used to create a pflag.FlagSet when registering controller options (the name is rendered in a controller flag group header) -// 3.2. when defined flag's help mentions a controller name -// 4. defining a new service account for a new controller (old controllers may have inconsistent service accounts to stay backwards compatible) -// 5. anywhere these controllers are used outside of this module (kube-controller-manager, cloud-provider sample) -const ( - CloudNodeController = "cloud-node-controller" - ServiceLBController = "service-lb-controller" - NodeRouteController = "node-route-controller" - CloudNodeLifecycleController = "cloud-node-lifecycle-controller" -) - -// CCMControllerAliases returns a mapping of aliases to canonical controller names -// -// These aliases ensure backwards compatibility and should never be removed! -// Only addition of new aliases is allowed, and only when a canonical name is changed (please see CHANGE POLICY of controller names) -func CCMControllerAliases() map[string]string { - // return a new reference to achieve immutability of the mapping - return map[string]string{ - "cloud-node": CloudNodeController, - "service": ServiceLBController, - "route": NodeRouteController, - "cloud-node-lifecycle": CloudNodeLifecycleController, - } - -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/CONTRIBUTING.md b/cluster-autoscaler/vendor/k8s.io/code-generator/CONTRIBUTING.md deleted file mode 100644 index 76625b7bc9e1..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/CONTRIBUTING.md +++ /dev/null @@ -1,7 +0,0 @@ -# Contributing guidelines - -Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. - -This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/code-generator](https://git.k8s.io/kubernetes/staging/src/k8s.io/code-generator) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). - -Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/LICENSE b/cluster-autoscaler/vendor/k8s.io/code-generator/LICENSE deleted file mode 100644 index d64569567334..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/OWNERS b/cluster-autoscaler/vendor/k8s.io/code-generator/OWNERS deleted file mode 100644 index 3b87391c29e5..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/OWNERS +++ /dev/null @@ -1,15 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - deads2k - - wojtek-t - - sttts -reviewers: - - deads2k - - wojtek-t - - sttts -labels: - - sig/api-machinery - - area/code-generation -emeritus_approvers: - - lavalamp diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/README.md b/cluster-autoscaler/vendor/k8s.io/code-generator/README.md deleted file mode 100644 index 122868a5c63e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# code-generator - -Golang code-generators used to implement [Kubernetes-style API types](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md). - -## Purpose - -These code-generators can be used -- in the context of [CustomResourceDefinition](https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/) to build native, versioned clients, - informers and other helpers -- in the context of [User-provider API Servers](https://github.com/kubernetes/apiserver) to build conversions between internal and versioned types, defaulters, protobuf codecs, - internal and versioned clients and informers. - -## Resources -- The example [sample controller](https://github.com/kubernetes/sample-controller) shows a code example of a controller that uses the clients, listers and informers generated by this library. -- The article [Kubernetes Deep Dive: Code Generation for CustomResources](https://cloud.redhat.com/blog/kubernetes-deep-dive-code-generation-customresources/) gives a step by step instruction on how to use this library. - -## Compatibility - -HEAD of this repo will match HEAD of k8s.io/apiserver, k8s.io/apimachinery, and k8s.io/client-go. - -## Where does it come from? - -`code-generator` is synced from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/code-generator. -Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here. - diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/SECURITY_CONTACTS b/cluster-autoscaler/vendor/k8s.io/code-generator/SECURITY_CONTACTS deleted file mode 100644 index f6003980fccc..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/SECURITY_CONTACTS +++ /dev/null @@ -1,16 +0,0 @@ -# Defined below are the security contacts for this repo. -# -# They are the contact point for the Product Security Committee to reach out -# to for triaging and handling of incoming issues. -# -# The below names agree to abide by the -# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) -# and will be removed and replaced if they violate that agreement. -# -# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE -# INSTRUCTIONS AT https://kubernetes.io/security/ - -cheftako -deads2k -lavalamp -sttts diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/args/args.go deleted file mode 100644 index 78f364841f22..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/args/args.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -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 args - -import ( - "fmt" - "path" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/gengo/types" - - codegenutil "k8s.io/code-generator/pkg/util" -) - -// CustomArgs is a wrapper for arguments to applyconfiguration-gen. -type CustomArgs struct { - // ExternalApplyConfigurations provides the locations of externally generated - // apply configuration types for types referenced by the go structs provided as input. - // Locations are provided as a comma separated list of .: - // entries. - // - // E.g. if a type references appsv1.Deployment, the location of its apply configuration should - // be provided: - // k8s.io/api/apps/v1.Deployment:k8s.io/client-go/applyconfigurations/apps/v1 - // - // meta/v1 types (TypeMeta and ObjectMeta) are always included and do not need to be passed in. - ExternalApplyConfigurations map[types.Name]string - - OpenAPISchemaFilePath string -} - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{ - ExternalApplyConfigurations: map[types.Name]string{ - // Always include TypeMeta and ObjectMeta. They are sufficient for the vast majority of use cases. - {Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "TypeMeta"}: "k8s.io/client-go/applyconfigurations/meta/v1", - {Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ObjectMeta"}: "k8s.io/client-go/applyconfigurations/meta/v1", - {Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "OwnerReference"}: "k8s.io/client-go/applyconfigurations/meta/v1", - }, - } - genericArgs.CustomArgs = customArgs - - if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { - genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/applyconfigurations") - } - - return genericArgs, customArgs -} - -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet, inputBase string) { - pflag.Var(NewExternalApplyConfigurationValue(&ca.ExternalApplyConfigurations, nil), "external-applyconfigurations", - "list of comma separated external apply configurations locations in .: form."+ - "For example: k8s.io/api/apps/v1.Deployment:k8s.io/client-go/applyconfigurations/apps/v1") - pflag.StringVar(&ca.OpenAPISchemaFilePath, "openapi-schema", "", - "path to the openapi schema containing all the types that apply configurations will be generated for") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/args/externaltypes.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/args/externaltypes.go deleted file mode 100644 index 0785fbea0e37..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/args/externaltypes.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -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 args - -import ( - "bytes" - "encoding/csv" - "flag" - "fmt" - "strings" - - "k8s.io/gengo/types" -) - -type externalApplyConfigurationValue struct { - externals *map[types.Name]string -} - -func NewExternalApplyConfigurationValue(externals *map[types.Name]string, def []string) *externalApplyConfigurationValue { - val := new(externalApplyConfigurationValue) - val.externals = externals - if def != nil { - if err := val.set(def); err != nil { - panic(err) - } - } - return val -} - -var _ flag.Value = &externalApplyConfigurationValue{} - -func (s *externalApplyConfigurationValue) set(vs []string) error { - for _, input := range vs { - typ, pkg, err := parseExternalMapping(input) - if err != nil { - return err - } - if _, ok := (*s.externals)[typ]; ok { - return fmt.Errorf("duplicate type found in --external-applyconfigurations: %v", typ) - } - (*s.externals)[typ] = pkg - } - - return nil -} - -func (s *externalApplyConfigurationValue) Set(val string) error { - vs, err := readAsCSV(val) - if err != nil { - return err - } - if err := s.set(vs); err != nil { - return err - } - - return nil -} - -func (s *externalApplyConfigurationValue) Type() string { - return "string" -} - -func (s *externalApplyConfigurationValue) String() string { - var strs []string - for k, v := range *s.externals { - strs = append(strs, fmt.Sprintf("%s.%s:%s", k.Package, k.Name, v)) - } - str, _ := writeAsCSV(strs) - return "[" + str + "]" -} - -func readAsCSV(val string) ([]string, error) { - if val == "" { - return []string{}, nil - } - stringReader := strings.NewReader(val) - csvReader := csv.NewReader(stringReader) - return csvReader.Read() -} - -func writeAsCSV(vals []string) (string, error) { - b := &bytes.Buffer{} - w := csv.NewWriter(b) - err := w.Write(vals) - if err != nil { - return "", err - } - w.Flush() - return strings.TrimSuffix(b.String(), "\n"), nil -} - -func parseExternalMapping(mapping string) (typ types.Name, pkg string, err error) { - parts := strings.Split(mapping, ":") - if len(parts) != 2 { - return types.Name{}, "", fmt.Errorf("expected string of the form .: but got %s", mapping) - } - packageTypeStr := parts[0] - pkg = parts[1] - // need to split on the *last* dot, since k8s.io (and other valid packages) have a dot in it - lastDot := strings.LastIndex(packageTypeStr, ".") - if lastDot == -1 || lastDot == len(packageTypeStr)-1 { - return types.Name{}, "", fmt.Errorf("expected package and type of the form . but got %s", packageTypeStr) - } - structPkg := packageTypeStr[:lastDot] - structType := packageTypeStr[lastDot+1:] - - return types.Name{Package: structPkg, Name: structType}, pkg, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/applyconfiguration.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/applyconfiguration.go deleted file mode 100644 index 8e02bb233bc4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/applyconfiguration.go +++ /dev/null @@ -1,423 +0,0 @@ -/* -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 generators - -import ( - "io" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - "k8s.io/klog/v2" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" -) - -// applyConfigurationGenerator produces apply configurations for a given GroupVersion and type. -type applyConfigurationGenerator struct { - generator.DefaultGen - outputPackage string - localPackage types.Name - groupVersion clientgentypes.GroupVersion - applyConfig applyConfig - imports namer.ImportTracker - refGraph refGraph - openAPIType *string // if absent, extraction function cannot be generated -} - -var _ generator.Generator = &applyConfigurationGenerator{} - -func (g *applyConfigurationGenerator) Filter(_ *generator.Context, t *types.Type) bool { - return t == g.applyConfig.Type -} - -func (g *applyConfigurationGenerator) Namers(*generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.localPackage.Package, g.imports), - "singularKind": namer.NewPublicNamer(0), - } -} - -func (g *applyConfigurationGenerator) Imports(*generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -// TypeParams provides a struct that an apply configuration -// is generated for as well as the apply configuration details -// and types referenced by the struct. -type TypeParams struct { - Struct *types.Type - ApplyConfig applyConfig - Tags util.Tags - APIVersion string - ExtractInto *types.Type - ParserFunc *types.Type - OpenAPIType *string -} - -type memberParams struct { - TypeParams - Member types.Member - MemberType *types.Type - JSONTags JSONTags - ArgType *types.Type // only set for maps and slices - EmbeddedIn *memberParams // parent embedded member, if any -} - -func (g *applyConfigurationGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - klog.V(5).Infof("processing type %v", t) - typeParams := TypeParams{ - Struct: t, - ApplyConfig: g.applyConfig, - Tags: genclientTags(t), - APIVersion: g.groupVersion.ToAPIVersion(), - ExtractInto: extractInto, - ParserFunc: types.Ref(g.outputPackage+"/internal", "Parser"), - OpenAPIType: g.openAPIType, - } - - g.generateStruct(sw, typeParams) - - if typeParams.Tags.GenerateClient { - if typeParams.Tags.NonNamespaced { - sw.Do(clientgenTypeConstructorNonNamespaced, typeParams) - } else { - sw.Do(clientgenTypeConstructorNamespaced, typeParams) - } - if typeParams.OpenAPIType != nil { - g.generateClientgenExtract(sw, typeParams, !typeParams.Tags.NoStatus) - } - } else { - if hasTypeMetaField(t) { - sw.Do(constructorWithTypeMeta, typeParams) - } else { - sw.Do(constructor, typeParams) - } - } - g.generateWithFuncs(t, typeParams, sw, nil) - return sw.Error() -} - -func hasTypeMetaField(t *types.Type) bool { - for _, member := range t.Members { - if typeMeta.Name == member.Type.Name && member.Embedded { - return true - } - } - return false -} - -func blocklisted(t *types.Type, member types.Member) bool { - if objectMeta.Name == t.Name && member.Name == "ManagedFields" { - return true - } - if objectMeta.Name == t.Name && member.Name == "SelfLink" { - return true - } - // Hide any fields which are en route to deletion. - if strings.HasPrefix(member.Name, "ZZZ_") { - return true - } - return false -} - -func (g *applyConfigurationGenerator) generateWithFuncs(t *types.Type, typeParams TypeParams, sw *generator.SnippetWriter, embed *memberParams) { - for _, member := range t.Members { - if blocklisted(t, member) { - continue - } - memberType := g.refGraph.applyConfigForType(member.Type) - if g.refGraph.isApplyConfig(member.Type) { - memberType = &types.Type{Kind: types.Pointer, Elem: memberType} - } - if jsonTags, ok := lookupJSONTags(member); ok { - memberParams := memberParams{ - TypeParams: typeParams, - Member: member, - MemberType: memberType, - JSONTags: jsonTags, - EmbeddedIn: embed, - } - if memberParams.Member.Embedded { - g.generateWithFuncs(member.Type, typeParams, sw, &memberParams) - if !jsonTags.inline { - // non-inlined embeds are nillable and need a "ensure exists" utility function - sw.Do(ensureEmbedExists, memberParams) - } - continue - } - - // For slices where the items are generated apply configuration types, accept varargs of - // pointers of the type as "with" function arguments so the "with" function can be used like so: - // WithFoos(Foo().WithName("x"), Foo().WithName("y")) - if t := deref(member.Type); t.Kind == types.Slice && g.refGraph.isApplyConfig(t.Elem) { - memberParams.ArgType = &types.Type{Kind: types.Pointer, Elem: memberType.Elem} - g.generateMemberWithForSlice(sw, member, memberParams) - continue - } - // Note: There are no maps where the values are generated apply configurations (because - // associative lists are used instead). So if a type like this is ever introduced, the - // default "with" function generator will produce a working (but not entirely convenient "with" function) - // that would be used like so: - // WithMap(map[string]FooApplyConfiguration{*Foo().WithName("x")}) - - switch memberParams.Member.Type.Kind { - case types.Slice: - memberParams.ArgType = memberType.Elem - g.generateMemberWithForSlice(sw, member, memberParams) - case types.Map: - g.generateMemberWithForMap(sw, memberParams) - default: - g.generateMemberWith(sw, memberParams) - } - } - } -} - -func (g *applyConfigurationGenerator) generateStruct(sw *generator.SnippetWriter, typeParams TypeParams) { - sw.Do("// $.ApplyConfig.ApplyConfiguration|public$ represents an declarative configuration of the $.ApplyConfig.Type|public$ type for use\n", typeParams) - sw.Do("// with apply.\n", typeParams) - sw.Do("type $.ApplyConfig.ApplyConfiguration|public$ struct {\n", typeParams) - for _, structMember := range typeParams.Struct.Members { - if blocklisted(typeParams.Struct, structMember) { - continue - } - if structMemberTags, ok := lookupJSONTags(structMember); ok { - if !structMemberTags.inline { - structMemberTags.omitempty = true - } - params := memberParams{ - TypeParams: typeParams, - Member: structMember, - MemberType: g.refGraph.applyConfigForType(structMember.Type), - JSONTags: structMemberTags, - } - if structMember.Embedded { - if structMemberTags.inline { - sw.Do("$.MemberType|raw$ `json:\"$.JSONTags$\"`\n", params) - } else { - sw.Do("*$.MemberType|raw$ `json:\"$.JSONTags$\"`\n", params) - } - } else if isNillable(structMember.Type) { - sw.Do("$.Member.Name$ $.MemberType|raw$ `json:\"$.JSONTags$\"`\n", params) - } else { - sw.Do("$.Member.Name$ *$.MemberType|raw$ `json:\"$.JSONTags$\"`\n", params) - } - } - } - sw.Do("}\n", typeParams) -} - -func deref(t *types.Type) *types.Type { - for t.Kind == types.Pointer { - t = t.Elem - } - return t -} - -func isNillable(t *types.Type) bool { - return t.Kind == types.Slice || t.Kind == types.Map -} - -func (g *applyConfigurationGenerator) generateMemberWith(sw *generator.SnippetWriter, memberParams memberParams) { - sw.Do("// With$.Member.Name$ sets the $.Member.Name$ field in the declarative configuration to the given value\n", memberParams) - sw.Do("// and returns the receiver, so that objects can be built by chaining \"With\" function invocations.\n", memberParams) - sw.Do("// If called multiple times, the $.Member.Name$ field is set to the value of the last call.\n", memberParams) - sw.Do("func (b *$.ApplyConfig.ApplyConfiguration|public$) With$.Member.Name$(value $.MemberType|raw$) *$.ApplyConfig.ApplyConfiguration|public$ {\n", memberParams) - g.ensureEnbedExistsIfApplicable(sw, memberParams) - if g.refGraph.isApplyConfig(memberParams.Member.Type) || isNillable(memberParams.Member.Type) { - sw.Do("b.$.Member.Name$ = value\n", memberParams) - } else { - sw.Do("b.$.Member.Name$ = &value\n", memberParams) - } - sw.Do(" return b\n", memberParams) - sw.Do("}\n", memberParams) -} - -func (g *applyConfigurationGenerator) generateMemberWithForSlice(sw *generator.SnippetWriter, member types.Member, memberParams memberParams) { - memberIsPointerToSlice := member.Type.Kind == types.Pointer - if memberIsPointerToSlice { - sw.Do(ensureNonEmbedSliceExists, memberParams) - } - - sw.Do("// With$.Member.Name$ adds the given value to the $.Member.Name$ field in the declarative configuration\n", memberParams) - sw.Do("// and returns the receiver, so that objects can be build by chaining \"With\" function invocations.\n", memberParams) - sw.Do("// If called multiple times, values provided by each call will be appended to the $.Member.Name$ field.\n", memberParams) - sw.Do("func (b *$.ApplyConfig.ApplyConfiguration|public$) With$.Member.Name$(values ...$.ArgType|raw$) *$.ApplyConfig.ApplyConfiguration|public$ {\n", memberParams) - g.ensureEnbedExistsIfApplicable(sw, memberParams) - - if memberIsPointerToSlice { - sw.Do("b.ensure$.MemberType.Elem|public$Exists()\n", memberParams) - } - - sw.Do(" for i := range values {\n", memberParams) - if memberParams.ArgType.Kind == types.Pointer { - sw.Do("if values[i] == nil {\n", memberParams) - sw.Do(" panic(\"nil value passed to With$.Member.Name$\")\n", memberParams) - sw.Do("}\n", memberParams) - - if memberIsPointerToSlice { - sw.Do("*b.$.Member.Name$ = append(*b.$.Member.Name$, *values[i])\n", memberParams) - } else { - sw.Do("b.$.Member.Name$ = append(b.$.Member.Name$, *values[i])\n", memberParams) - } - } else { - if memberIsPointerToSlice { - sw.Do("*b.$.Member.Name$ = append(*b.$.Member.Name$, values[i])\n", memberParams) - } else { - sw.Do("b.$.Member.Name$ = append(b.$.Member.Name$, values[i])\n", memberParams) - } - } - sw.Do(" }\n", memberParams) - sw.Do(" return b\n", memberParams) - sw.Do("}\n", memberParams) -} - -func (g *applyConfigurationGenerator) generateMemberWithForMap(sw *generator.SnippetWriter, memberParams memberParams) { - sw.Do("// With$.Member.Name$ puts the entries into the $.Member.Name$ field in the declarative configuration\n", memberParams) - sw.Do("// and returns the receiver, so that objects can be build by chaining \"With\" function invocations.\n", memberParams) - sw.Do("// If called multiple times, the entries provided by each call will be put on the $.Member.Name$ field,\n", memberParams) - sw.Do("// overwriting an existing map entries in $.Member.Name$ field with the same key.\n", memberParams) - sw.Do("func (b *$.ApplyConfig.ApplyConfiguration|public$) With$.Member.Name$(entries $.MemberType|raw$) *$.ApplyConfig.ApplyConfiguration|public$ {\n", memberParams) - g.ensureEnbedExistsIfApplicable(sw, memberParams) - sw.Do(" if b.$.Member.Name$ == nil && len(entries) > 0 {\n", memberParams) - sw.Do(" b.$.Member.Name$ = make($.MemberType|raw$, len(entries))\n", memberParams) - sw.Do(" }\n", memberParams) - sw.Do(" for k, v := range entries {\n", memberParams) - sw.Do(" b.$.Member.Name$[k] = v\n", memberParams) - sw.Do(" }\n", memberParams) - sw.Do(" return b\n", memberParams) - sw.Do("}\n", memberParams) -} - -func (g *applyConfigurationGenerator) ensureEnbedExistsIfApplicable(sw *generator.SnippetWriter, memberParams memberParams) { - // Embedded types that are not inlined must be nillable so they are not included in the apply configuration - // when all their fields are omitted. - if memberParams.EmbeddedIn != nil && !memberParams.EmbeddedIn.JSONTags.inline { - sw.Do("b.ensure$.MemberType.Elem|public$Exists()\n", memberParams.EmbeddedIn) - } -} - -var ensureEmbedExists = ` -func (b *$.ApplyConfig.ApplyConfiguration|public$) ensure$.MemberType.Elem|public$Exists() { - if b.$.MemberType.Elem|public$ == nil { - b.$.MemberType.Elem|public$ = &$.MemberType.Elem|raw${} - } -} -` - -var ensureNonEmbedSliceExists = ` -func (b *$.ApplyConfig.ApplyConfiguration|public$) ensure$.MemberType.Elem|public$Exists() { - if b.$.Member.Name$ == nil { - b.$.Member.Name$ = &[]$.MemberType.Elem|raw${} - } -} -` - -var clientgenTypeConstructorNamespaced = ` -// $.ApplyConfig.Type|public$ constructs an declarative configuration of the $.ApplyConfig.Type|public$ type for use with -// apply. -func $.ApplyConfig.Type|public$(name, namespace string) *$.ApplyConfig.ApplyConfiguration|public$ { - b := &$.ApplyConfig.ApplyConfiguration|public${} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("$.ApplyConfig.Type|singularKind$") - b.WithAPIVersion("$.APIVersion$") - return b -} -` - -var clientgenTypeConstructorNonNamespaced = ` -// $.ApplyConfig.Type|public$ constructs an declarative configuration of the $.ApplyConfig.Type|public$ type for use with -// apply. -func $.ApplyConfig.Type|public$(name string) *$.ApplyConfig.ApplyConfiguration|public$ { - b := &$.ApplyConfig.ApplyConfiguration|public${} - b.WithName(name) - b.WithKind("$.ApplyConfig.Type|singularKind$") - b.WithAPIVersion("$.APIVersion$") - return b -} -` - -var constructorWithTypeMeta = ` -// $.ApplyConfig.ApplyConfiguration|public$ constructs an declarative configuration of the $.ApplyConfig.Type|public$ type for use with -// apply. -func $.ApplyConfig.Type|public$() *$.ApplyConfig.ApplyConfiguration|public$ { - b := &$.ApplyConfig.ApplyConfiguration|public${} - b.WithKind("$.ApplyConfig.Type|singularKind$") - b.WithAPIVersion("$.APIVersion$") - return b -} -` - -var constructor = ` -// $.ApplyConfig.ApplyConfiguration|public$ constructs an declarative configuration of the $.ApplyConfig.Type|public$ type for use with -// apply. -func $.ApplyConfig.Type|public$() *$.ApplyConfig.ApplyConfiguration|public$ { - return &$.ApplyConfig.ApplyConfiguration|public${} -} -` - -func (g *applyConfigurationGenerator) generateClientgenExtract(sw *generator.SnippetWriter, typeParams TypeParams, includeStatus bool) { - sw.Do(` -// Extract$.ApplyConfig.Type|public$ extracts the applied configuration owned by fieldManager from -// $.Struct|private$. If no managedFields are found in $.Struct|private$ for fieldManager, a -// $.ApplyConfig.ApplyConfiguration|public$ is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// $.Struct|private$ must be a unmodified $.Struct|public$ API object that was retrieved from the Kubernetes API. -// Extract$.ApplyConfig.Type|public$ provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func Extract$.ApplyConfig.Type|public$($.Struct|private$ *$.Struct|raw$, fieldManager string) (*$.ApplyConfig.ApplyConfiguration|public$, error) { - return extract$.ApplyConfig.Type|public$($.Struct|private$, fieldManager, "") -}`, typeParams) - if includeStatus { - sw.Do(` -// Extract$.ApplyConfig.Type|public$Status is the same as Extract$.ApplyConfig.Type|public$ except -// that it extracts the status subresource applied configuration. -// Experimental! -func Extract$.ApplyConfig.Type|public$Status($.Struct|private$ *$.Struct|raw$, fieldManager string) (*$.ApplyConfig.ApplyConfiguration|public$, error) { - return extract$.ApplyConfig.Type|public$($.Struct|private$, fieldManager, "status") -} -`, typeParams) - } - sw.Do(` -func extract$.ApplyConfig.Type|public$($.Struct|private$ *$.Struct|raw$, fieldManager string, subresource string) (*$.ApplyConfig.ApplyConfiguration|public$, error) { - b := &$.ApplyConfig.ApplyConfiguration|public${} - err := $.ExtractInto|raw$($.Struct|private$, $.ParserFunc|raw$().Type("$.OpenAPIType$"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName($.Struct|private$.Name) -`, typeParams) - if !typeParams.Tags.NonNamespaced { - sw.Do("b.WithNamespace($.Struct|private$.Namespace)\n", typeParams) - } - sw.Do(` - b.WithKind("$.ApplyConfig.Type|singularKind$") - b.WithAPIVersion("$.APIVersion$") - return b, nil -} -`, typeParams) -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/internal.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/internal.go deleted file mode 100644 index 2871b9d7f5ef..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/internal.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -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 generators - -import ( - "io" - - "gopkg.in/yaml.v2" - - "k8s.io/kube-openapi/pkg/schemaconv" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// utilGenerator generates the ForKind() utility function. -type internalGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - typeModels *typeModels - filtered bool -} - -var _ generator.Generator = &internalGenerator{} - -func (g *internalGenerator) Filter(*generator.Context, *types.Type) bool { - // generate file exactly once - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *internalGenerator) Namers(*generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - "singularKind": namer.NewPublicNamer(0), - } -} - -func (g *internalGenerator) Imports(*generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -func (g *internalGenerator) GenerateType(c *generator.Context, _ *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "{{", "}}") - - schema, err := schemaconv.ToSchema(g.typeModels.models) - if err != nil { - return err - } - schemaYAML, err := yaml.Marshal(schema) - if err != nil { - return err - } - sw.Do(schemaBlock, map[string]interface{}{ - "schemaYAML": string(schemaYAML), - "smdParser": smdParser, - "smdNewParser": smdNewParser, - "yamlObject": yamlObject, - "yamlUnmarshal": yamlUnmarshal, - }) - - return sw.Error() -} - -var schemaBlock = ` -func Parser() *{{.smdParser|raw}} { - parserOnce.Do(func() { - var err error - parser, err = {{.smdNewParser|raw}}(schemaYAML) - if err != nil { - panic(fmt.Sprintf("Failed to parse schema: %v", err)) - } - }) - return parser -} - -var parserOnce sync.Once -var parser *{{.smdParser|raw}} -var schemaYAML = {{.yamlObject|raw}}(` + "`{{.schemaYAML}}`" + `) -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/jsontagutil.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/jsontagutil.go deleted file mode 100644 index 2a643290bb9a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/jsontagutil.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -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 generators - -import ( - "reflect" - "strings" - - "k8s.io/gengo/types" -) - -// TODO: This implements the same functionality as https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/runtime/converter.go#L236 -// but is based on the highly efficient approach from https://golang.org/src/encoding/json/encode.go - -// JSONTags represents a go json field tag. -type JSONTags struct { - name string - omit bool - inline bool - omitempty bool -} - -func (t JSONTags) String() string { - var tag string - if !t.inline { - tag += t.name - } - if t.omitempty { - tag += ",omitempty" - } - if t.inline { - tag += ",inline" - } - return tag -} - -func lookupJSONTags(m types.Member) (JSONTags, bool) { - tag := reflect.StructTag(m.Tags).Get("json") - if tag == "" || tag == "-" { - return JSONTags{}, false - } - name, opts := parseTag(tag) - if name == "" { - name = m.Name - } - return JSONTags{ - name: name, - omit: false, - inline: opts.Contains("inline"), - omitempty: opts.Contains("omitempty"), - }, true -} - -type tagOptions string - -// parseTag splits a struct field's json tag into its name and -// comma-separated options. -func parseTag(tag string) (string, tagOptions) { - if idx := strings.Index(tag, ","); idx != -1 { - return tag[:idx], tagOptions(tag[idx+1:]) - } - return tag, "" -} - -// Contains reports whether a comma-separated listAlias of options -// contains a particular substr flag. substr must be surrounded by a -// string boundary or commas. -func (o tagOptions) Contains(optionName string) bool { - if len(o) == 0 { - return false - } - s := string(o) - for s != "" { - var next string - i := strings.Index(s, ",") - if i >= 0 { - s, next = s[:i], s[i+1:] - } - if s == optionName { - return true - } - s = next - } - return false -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/openapi.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/openapi.go deleted file mode 100644 index 00d119dd65c1..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/openapi.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -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 generators - -import ( - "encoding/json" - "fmt" - "os" - "strings" - - openapiv2 "github.com/google/gnostic-models/openapiv2" - "k8s.io/gengo/types" - utilproto "k8s.io/kube-openapi/pkg/util/proto" - "k8s.io/kube-openapi/pkg/validation/spec" -) - -type typeModels struct { - models utilproto.Models - gvkToOpenAPIType map[gvk]string -} - -type gvk struct { - group, version, kind string -} - -func newTypeModels(openAPISchemaFilePath string, pkgTypes map[string]*types.Package) (*typeModels, error) { - if len(openAPISchemaFilePath) == 0 { - return emptyModels, nil // No Extract() functions will be generated. - } - - rawOpenAPISchema, err := os.ReadFile(openAPISchemaFilePath) - if err != nil { - return nil, fmt.Errorf("failed to read openapi-schema file: %w", err) - } - - // Read in the provided openAPI schema. - openAPISchema := &spec.Swagger{} - err = json.Unmarshal(rawOpenAPISchema, openAPISchema) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal typeModels JSON: %w", err) - } - - // Build a mapping from openAPI type name to GVK. - // Find the root types needed by by client-go for apply. - gvkToOpenAPIType := map[gvk]string{} - rootDefs := map[string]spec.Schema{} - for _, p := range pkgTypes { - gv := groupVersion(p) - for _, t := range p.Types { - tags := genclientTags(t) - hasApply := tags.HasVerb("apply") || tags.HasVerb("applyStatus") - if tags.GenerateClient && hasApply { - openAPIType := friendlyName(typeName(t)) - gvk := gvk{ - group: gv.Group.String(), - version: gv.Version.String(), - kind: t.Name.Name, - } - rootDefs[openAPIType] = openAPISchema.Definitions[openAPIType] - gvkToOpenAPIType[gvk] = openAPIType - } - } - } - - // Trim the schema down to just the types needed by client-go for apply. - requiredDefs := make(map[string]spec.Schema) - for name, def := range rootDefs { - requiredDefs[name] = def - findReferenced(&def, openAPISchema.Definitions, requiredDefs) - } - openAPISchema.Definitions = requiredDefs - - // Convert the openAPI schema to the models format and validate it. - models, err := toValidatedModels(openAPISchema) - if err != nil { - return nil, err - } - return &typeModels{models: models, gvkToOpenAPIType: gvkToOpenAPIType}, nil -} - -var emptyModels = &typeModels{ - models: &utilproto.Definitions{}, - gvkToOpenAPIType: map[gvk]string{}, -} - -func toValidatedModels(openAPISchema *spec.Swagger) (utilproto.Models, error) { - // openapi_v2.ParseDocument only accepts a []byte of the JSON or YAML file to be parsed. - // so we do an inefficient marshal back to json and then read it back in as yaml - // but get the benefit of running the models through utilproto.NewOpenAPIData to - // validate all the references between types - rawMinimalOpenAPISchema, err := json.Marshal(openAPISchema) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal openAPI as JSON: %w", err) - } - - document, err := openapiv2.ParseDocument(rawMinimalOpenAPISchema) - if err != nil { - return nil, fmt.Errorf("failed to parse OpenAPI document for file: %w", err) - } - // Construct the models and validate all references are valid. - models, err := utilproto.NewOpenAPIData(document) - if err != nil { - return nil, fmt.Errorf("failed to create OpenAPI models for file: %w", err) - } - return models, nil -} - -// findReferenced recursively finds all schemas referenced from the given def. -// toValidatedModels makes sure no references get missed. -func findReferenced(def *spec.Schema, allSchemas, referencedOut map[string]spec.Schema) { - // follow $ref, if any - refPtr := def.Ref.GetPointer() - if refPtr != nil && !refPtr.IsEmpty() { - name := refPtr.String() - if !strings.HasPrefix(name, "/definitions/") { - return - } - name = strings.TrimPrefix(name, "/definitions/") - schema, ok := allSchemas[name] - if !ok { - panic(fmt.Sprintf("allSchemas schema is missing referenced type: %s", name)) - } - if _, ok := referencedOut[name]; !ok { - referencedOut[name] = schema - findReferenced(&schema, allSchemas, referencedOut) - } - } - - // follow any nested schemas - if def.Items != nil { - if def.Items.Schema != nil { - findReferenced(def.Items.Schema, allSchemas, referencedOut) - } - for _, item := range def.Items.Schemas { - findReferenced(&item, allSchemas, referencedOut) - } - } - if def.AllOf != nil { - for _, s := range def.AllOf { - findReferenced(&s, allSchemas, referencedOut) - } - } - if def.AnyOf != nil { - for _, s := range def.AnyOf { - findReferenced(&s, allSchemas, referencedOut) - } - } - if def.OneOf != nil { - for _, s := range def.OneOf { - findReferenced(&s, allSchemas, referencedOut) - } - } - if def.Not != nil { - findReferenced(def.Not, allSchemas, referencedOut) - } - if def.Properties != nil { - for _, prop := range def.Properties { - findReferenced(&prop, allSchemas, referencedOut) - } - } - if def.AdditionalProperties != nil && def.AdditionalProperties.Schema != nil { - findReferenced(def.AdditionalProperties.Schema, allSchemas, referencedOut) - } - if def.PatternProperties != nil { - for _, s := range def.PatternProperties { - findReferenced(&s, allSchemas, referencedOut) - } - } - if def.Dependencies != nil { - for _, d := range def.Dependencies { - if d.Schema != nil { - findReferenced(d.Schema, allSchemas, referencedOut) - } - } - } - if def.AdditionalItems != nil && def.AdditionalItems.Schema != nil { - findReferenced(def.AdditionalItems.Schema, allSchemas, referencedOut) - } - if def.Definitions != nil { - for _, s := range def.Definitions { - findReferenced(&s, allSchemas, referencedOut) - } - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/packages.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/packages.go deleted file mode 100644 index bfeffda593d8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/packages.go +++ /dev/null @@ -1,297 +0,0 @@ -/* -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 generators - -import ( - "fmt" - "path" - "path/filepath" - "sort" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - "k8s.io/klog/v2" - - applygenargs "k8s.io/code-generator/cmd/applyconfiguration-gen/args" - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" -) - -const ( - // ApplyConfigurationTypeSuffix is the suffix of generated apply configuration types. - ApplyConfigurationTypeSuffix = "ApplyConfiguration" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": namer.NewPublicNamer(0), - "private": namer.NewPrivateNamer(0), - "raw": namer.NewRawNamer("", nil), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// Packages makes the client package definition. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - pkgTypes := packageTypesForInputDirs(context, arguments.InputDirs, arguments.OutputPackagePath) - customArgs := arguments.CustomArgs.(*applygenargs.CustomArgs) - initialTypes := customArgs.ExternalApplyConfigurations - refs := refGraphForReachableTypes(context.Universe, pkgTypes, initialTypes) - typeModels, err := newTypeModels(customArgs.OpenAPISchemaFilePath, pkgTypes) - if err != nil { - klog.Fatalf("Failed build type models from typeModels %s: %v", customArgs.OpenAPISchemaFilePath, err) - } - - groupVersions := make(map[string]clientgentypes.GroupVersions) - groupGoNames := make(map[string]string) - applyConfigsForGroupVersion := make(map[clientgentypes.GroupVersion][]applyConfig) - - var packageList generator.Packages - for pkg, p := range pkgTypes { - gv := groupVersion(p) - - pkgType := types.Name{Name: gv.Group.PackageName(), Package: pkg} - - var toGenerate []applyConfig - for _, t := range p.Types { - // If we don't have an ObjectMeta field, we lack the information required to make the Apply or ApplyStatus call - // to the kube-apiserver, so we don't need to generate the type at all - clientTags := genclientTags(t) - if clientTags.GenerateClient && !hasObjectMetaField(t) { - klog.V(5).Infof("skipping type %v because does not have ObjectMeta", t) - continue - } - if typePkg, ok := refs[t.Name]; ok { - toGenerate = append(toGenerate, applyConfig{ - Type: t, - ApplyConfiguration: types.Ref(typePkg, t.Name.Name+ApplyConfigurationTypeSuffix), - }) - } - } - if len(toGenerate) == 0 { - continue // Don't generate empty packages - } - sort.Sort(applyConfigSort(toGenerate)) - - // generate the apply configurations - packageList = append(packageList, generatorForApplyConfigurationsPackage(arguments.OutputPackagePath, boilerplate, pkgType, gv, toGenerate, refs, typeModels)) - - // group all the generated apply configurations by gv so ForKind() can be generated - groupPackageName := gv.Group.NonEmpty() - groupVersionsEntry, ok := groupVersions[groupPackageName] - if !ok { - groupVersionsEntry = clientgentypes.GroupVersions{ - PackageName: groupPackageName, - Group: gv.Group, - } - } - groupVersionsEntry.Versions = append(groupVersionsEntry.Versions, clientgentypes.PackageVersion{ - Version: gv.Version, - Package: path.Clean(p.Path), - }) - - groupGoNames[groupPackageName] = goName(gv, p) - applyConfigsForGroupVersion[gv] = toGenerate - groupVersions[groupPackageName] = groupVersionsEntry - } - - // generate ForKind() utility function - packageList = append(packageList, generatorForUtils(arguments.OutputPackagePath, boilerplate, groupVersions, applyConfigsForGroupVersion, groupGoNames)) - // generate internal embedded schema, required for generated Extract functions - packageList = append(packageList, generatorForInternal(filepath.Join(arguments.OutputPackagePath, "internal"), boilerplate, typeModels)) - - return packageList -} - -func friendlyName(name string) string { - nameParts := strings.Split(name, "/") - // Reverse first part. e.g., io.k8s... instead of k8s.io... - if len(nameParts) > 0 && strings.Contains(nameParts[0], ".") { - parts := strings.Split(nameParts[0], ".") - for i, j := 0, len(parts)-1; i < j; i, j = i+1, j-1 { - parts[i], parts[j] = parts[j], parts[i] - } - nameParts[0] = strings.Join(parts, ".") - } - return strings.Join(nameParts, ".") -} - -func typeName(t *types.Type) string { - typePackage := t.Name.Package - if strings.Contains(typePackage, "/vendor/") { - typePackage = typePackage[strings.Index(typePackage, "/vendor/")+len("/vendor/"):] - } - return fmt.Sprintf("%s.%s", typePackage, t.Name.Name) -} - -func generatorForApplyConfigurationsPackage(outputPackagePath string, boilerplate []byte, packageName types.Name, gv clientgentypes.GroupVersion, typesToGenerate []applyConfig, refs refGraph, models *typeModels) *generator.DefaultPackage { - return &generator.DefaultPackage{ - PackageName: gv.Version.PackageName(), - PackagePath: packageName.Package, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - for _, toGenerate := range typesToGenerate { - var openAPIType *string - gvk := gvk{ - group: gv.Group.String(), - version: gv.Version.String(), - kind: toGenerate.Type.Name.Name, - } - if v, ok := models.gvkToOpenAPIType[gvk]; ok { - openAPIType = &v - } - - generators = append(generators, &applyConfigurationGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: strings.ToLower(toGenerate.Type.Name.Name), - }, - outputPackage: outputPackagePath, - localPackage: packageName, - groupVersion: gv, - applyConfig: toGenerate, - imports: generator.NewImportTracker(), - refGraph: refs, - openAPIType: openAPIType, - }) - } - return generators - }, - } -} - -func generatorForUtils(outPackagePath string, boilerplate []byte, groupVersions map[string]clientgentypes.GroupVersions, applyConfigsForGroupVersion map[clientgentypes.GroupVersion][]applyConfig, groupGoNames map[string]string) *generator.DefaultPackage { - return &generator.DefaultPackage{ - PackageName: filepath.Base(outPackagePath), - PackagePath: outPackagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &utilGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "utils", - }, - outputPackage: outPackagePath, - imports: generator.NewImportTracker(), - groupVersions: groupVersions, - typesForGroupVersion: applyConfigsForGroupVersion, - groupGoNames: groupGoNames, - }) - return generators - }, - } -} - -func generatorForInternal(outPackagePath string, boilerplate []byte, models *typeModels) *generator.DefaultPackage { - return &generator.DefaultPackage{ - PackageName: filepath.Base(outPackagePath), - PackagePath: outPackagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &internalGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "internal", - }, - outputPackage: outPackagePath, - imports: generator.NewImportTracker(), - typeModels: models, - }) - return generators - }, - } -} - -func goName(gv clientgentypes.GroupVersion, p *types.Package) string { - goName := namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) - if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil { - goName = namer.IC(override[0]) - } - return goName -} - -func packageTypesForInputDirs(context *generator.Context, inputDirs []string, outputPath string) map[string]*types.Package { - pkgTypes := map[string]*types.Package{} - for _, inputDir := range inputDirs { - p := context.Universe.Package(inputDir) - internal := isInternalPackage(p) - if internal { - klog.Warningf("Skipping internal package: %s", p.Path) - continue - } - // This is how the client generator finds the package we are creating. It uses the API package name, not the group name. - // This matches the approach of the client-gen, so the two generator can work together. - // For example, if openshift/api/cloudnetwork/v1 contains an apigroup cloud.network.openshift.io, the client-gen - // builds a package called cloudnetwork/v1 to contain it. This change makes the applyconfiguration-gen use the same. - _, gvPackageString := util.ParsePathGroupVersion(p.Path) - pkg := filepath.Join(outputPath, strings.ToLower(gvPackageString)) - pkgTypes[pkg] = p - } - return pkgTypes -} - -func groupVersion(p *types.Package) (gv clientgentypes.GroupVersion) { - parts := strings.Split(p.Path, "/") - gv.Group = clientgentypes.Group(parts[len(parts)-2]) - gv.Version = clientgentypes.Version(parts[len(parts)-1]) - - // If there's a comment of the form "// +groupName=somegroup" or - // "// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as the name of the - // group when generating. - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - gv.Group = clientgentypes.Group(override[0]) - } - return gv -} - -// isInternalPackage returns true if the package is an internal package -func isInternalPackage(p *types.Package) bool { - for _, t := range p.Types { - for _, member := range t.Members { - if member.Name == "ObjectMeta" { - return isInternal(member) - } - } - } - return false -} - -// isInternal returns true if the tags for a member do not contain a json tag -func isInternal(m types.Member) bool { - _, ok := lookupJSONTags(m) - return !ok -} - -func hasObjectMetaField(t *types.Type) bool { - for _, member := range t.Members { - if objectMeta.Name == member.Type.Name && member.Embedded { - return true - } - } - return false -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/refgraph.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/refgraph.go deleted file mode 100644 index d1f95112796f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/refgraph.go +++ /dev/null @@ -1,179 +0,0 @@ -/* -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 generators - -import ( - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// refGraph maps existing types to the package the corresponding applyConfig types will be generated in -// so that references between apply configurations can be correctly generated. -type refGraph map[types.Name]string - -// refGraphForReachableTypes returns a refGraph that contains all reachable types from -// the root clientgen types of the provided packages. -func refGraphForReachableTypes(universe types.Universe, pkgTypes map[string]*types.Package, initialTypes map[types.Name]string) refGraph { - var refs refGraph = initialTypes - - // Include only types that are reachable from the root clientgen types. - // We don't want to generate apply configurations for types that are not reachable from a root - // clientgen type. - reachableTypes := map[types.Name]*types.Type{} - for _, p := range pkgTypes { - for _, t := range p.Types { - tags := genclientTags(t) - hasApply := tags.HasVerb("apply") || tags.HasVerb("applyStatus") - if tags.GenerateClient && hasApply { - findReachableTypes(t, reachableTypes) - } - // If any apply extensions have custom inputs, add them. - for _, extension := range tags.Extensions { - if extension.HasVerb("apply") { - if len(extension.InputTypeOverride) > 0 { - inputType := *t - if name, pkg := extension.Input(); len(pkg) > 0 { - inputType = *(universe.Type(types.Name{Package: pkg, Name: name})) - } else { - inputType.Name.Name = extension.InputTypeOverride - } - findReachableTypes(&inputType, reachableTypes) - } - } - } - } - } - for pkg, p := range pkgTypes { - for _, t := range p.Types { - if _, ok := reachableTypes[t.Name]; !ok { - continue - } - if requiresApplyConfiguration(t) { - refs[t.Name] = pkg - } - } - } - - return refs -} - -// applyConfigForType find the type used in the generate apply configurations for a field. -// This may either be an existing type or one of the other generated applyConfig types. -func (t refGraph) applyConfigForType(field *types.Type) *types.Type { - switch field.Kind { - case types.Struct: - if pkg, ok := t[field.Name]; ok { // TODO(jpbetz): Refs to types defined in a separate system (e.g. TypeMeta if generating a 3rd party controller) end up referencing the go struct, not the apply configuration type - return types.Ref(pkg, field.Name.Name+ApplyConfigurationTypeSuffix) - } - return field - case types.Map: - if _, ok := t[field.Elem.Name]; ok { - return &types.Type{ - Kind: types.Map, - Elem: t.applyConfigForType(field.Elem), - Key: t.applyConfigForType(field.Key), - } - } - return field - case types.Slice: - if _, ok := t[field.Elem.Name]; ok { - return &types.Type{ - Kind: types.Slice, - Elem: t.applyConfigForType(field.Elem), - } - } - return field - case types.Pointer: - return t.applyConfigForType(field.Elem) - default: - return field - } -} - -func (t refGraph) isApplyConfig(field *types.Type) bool { - switch field.Kind { - case types.Struct: - _, ok := t[field.Name] - return ok - case types.Pointer: - return t.isApplyConfig(field.Elem) - } - return false -} - -// genclientTags returns the genclient Tags for the given type. -func genclientTags(t *types.Type) util.Tags { - return util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) -} - -// findReachableTypes finds all types transitively reachable from a given root type, including -// the root type itself. -func findReachableTypes(t *types.Type, referencedTypes map[types.Name]*types.Type) { - if _, ok := referencedTypes[t.Name]; ok { - return - } - referencedTypes[t.Name] = t - - if t.Elem != nil { - findReachableTypes(t.Elem, referencedTypes) - } - if t.Underlying != nil { - findReachableTypes(t.Underlying, referencedTypes) - } - if t.Key != nil { - findReachableTypes(t.Key, referencedTypes) - } - for _, m := range t.Members { - findReachableTypes(m.Type, referencedTypes) - } -} - -// excludeTypes contains well known types that we do not generate apply configurations for. -// Hard coding because we only have two, very specific types that serve a special purpose -// in the type system here. -var excludeTypes = map[types.Name]struct{}{ - rawExtension.Name: {}, - unknown.Name: {}, - // DO NOT ADD TO THIS LIST. If we need to exclude other types, we should consider allowing the - // go type declarations to be annotated as excluded from this generator. -} - -// requiresApplyConfiguration returns true if a type applyConfig should be generated for the given type. -// types applyConfig are only generated for struct types that contain fields with json tags. -func requiresApplyConfiguration(t *types.Type) bool { - for t.Kind == types.Alias { - t = t.Underlying - } - if t.Kind != types.Struct { - return false - } - if _, ok := excludeTypes[t.Name]; ok { - return false - } - var hasJSONTaggedMembers bool - for _, member := range t.Members { - if _, ok := lookupJSONTags(member); ok { - hasJSONTaggedMembers = true - } - } - if !hasJSONTaggedMembers { - return false - } - - return true -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/types.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/types.go deleted file mode 100644 index 66578ae0489b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/types.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -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 generators - -import "k8s.io/gengo/types" - -var ( - applyConfiguration = types.Ref("k8s.io/apimachinery/pkg/runtime", "ApplyConfiguration") - groupVersionKind = types.Ref("k8s.io/apimachinery/pkg/runtime/schema", "GroupVersionKind") - typeMeta = types.Ref("k8s.io/apimachinery/pkg/apis/meta/v1", "TypeMeta") - objectMeta = types.Ref("k8s.io/apimachinery/pkg/apis/meta/v1", "ObjectMeta") - rawExtension = types.Ref("k8s.io/apimachinery/pkg/runtime", "RawExtension") - unknown = types.Ref("k8s.io/apimachinery/pkg/runtime", "Unknown") - extractInto = types.Ref("k8s.io/apimachinery/pkg/util/managedfields", "ExtractInto") - smdNewParser = types.Ref("sigs.k8s.io/structured-merge-diff/v4/typed", "NewParser") - smdParser = types.Ref("sigs.k8s.io/structured-merge-diff/v4/typed", "Parser") - yamlObject = types.Ref("sigs.k8s.io/structured-merge-diff/v4/typed", "YAMLObject") - yamlUnmarshal = types.Ref("gopkg.in/yaml.v2", "Unmarshal") -) diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/util.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/util.go deleted file mode 100644 index 258293afea54..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/util.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -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 generators - -import ( - "io" - "sort" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// utilGenerator generates the ForKind() utility function. -type utilGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - groupVersions map[string]clientgentypes.GroupVersions - groupGoNames map[string]string - typesForGroupVersion map[clientgentypes.GroupVersion][]applyConfig - filtered bool -} - -var _ generator.Generator = &utilGenerator{} - -func (g *utilGenerator) Filter(*generator.Context, *types.Type) bool { - // generate file exactly once - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *utilGenerator) Namers(*generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - "singularKind": namer.NewPublicNamer(0), - } -} - -func (g *utilGenerator) Imports(*generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -type group struct { - GroupGoName string - Name string - Versions []*version -} - -type groupSort []group - -func (g groupSort) Len() int { return len(g) } -func (g groupSort) Less(i, j int) bool { - return strings.ToLower(g[i].Name) < strings.ToLower(g[j].Name) -} -func (g groupSort) Swap(i, j int) { g[i], g[j] = g[j], g[i] } - -type version struct { - Name string - GoName string - Resources []applyConfig -} - -type versionSort []*version - -func (v versionSort) Len() int { return len(v) } -func (v versionSort) Less(i, j int) bool { - return strings.ToLower(v[i].Name) < strings.ToLower(v[j].Name) -} -func (v versionSort) Swap(i, j int) { v[i], v[j] = v[j], v[i] } - -type applyConfig struct { - Type *types.Type - ApplyConfiguration *types.Type -} - -type applyConfigSort []applyConfig - -func (v applyConfigSort) Len() int { return len(v) } -func (v applyConfigSort) Less(i, j int) bool { - return strings.ToLower(v[i].Type.Name.Name) < strings.ToLower(v[j].Type.Name.Name) -} -func (v applyConfigSort) Swap(i, j int) { v[i], v[j] = v[j], v[i] } - -func (g *utilGenerator) GenerateType(c *generator.Context, _ *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "{{", "}}") - - var groups []group - schemeGVs := make(map[*version]*types.Type) - - for groupPackageName, groupVersions := range g.groupVersions { - group := group{ - GroupGoName: g.groupGoNames[groupPackageName], - Name: groupVersions.Group.NonEmpty(), - Versions: []*version{}, - } - for _, v := range groupVersions.Versions { - gv := clientgentypes.GroupVersion{Group: groupVersions.Group, Version: v.Version} - version := &version{ - Name: v.Version.NonEmpty(), - GoName: namer.IC(v.Version.NonEmpty()), - Resources: g.typesForGroupVersion[gv], - } - schemeGVs[version] = c.Universe.Variable(types.Name{ - Package: g.typesForGroupVersion[gv][0].Type.Name.Package, - Name: "SchemeGroupVersion", - }) - group.Versions = append(group.Versions, version) - } - sort.Sort(versionSort(group.Versions)) - groups = append(groups, group) - } - sort.Sort(groupSort(groups)) - - m := map[string]interface{}{ - "groups": groups, - "schemeGVs": schemeGVs, - "schemaGroupVersionKind": groupVersionKind, - "applyConfiguration": applyConfiguration, - } - sw.Do(forKindFunc, m) - - return sw.Error() -} - -var forKindFunc = ` -// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no -// apply configuration type exists for the given GroupVersionKind. -func ForKind(kind {{.schemaGroupVersionKind|raw}}) interface{} { - switch kind { - {{range $group := .groups -}}{{$GroupGoName := .GroupGoName -}} - {{range $version := .Versions -}} - // Group={{$group.Name}}, Version={{.Name}} - {{range .Resources -}} - case {{index $.schemeGVs $version|raw}}.WithKind("{{.Type|singularKind}}"): - return &{{.ApplyConfiguration|raw}}{} - {{end}} - {{end}} - {{end -}} - } - return nil -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/main.go deleted file mode 100644 index b4e264042aa7..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/main.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -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. -*/ - -// typebuilder-gen is a tool for auto-generating apply builder functions. -package main - -import ( - "flag" - - "github.com/spf13/pflag" - "k8s.io/klog/v2" - - generatorargs "k8s.io/code-generator/cmd/applyconfiguration-gen/args" - "k8s.io/code-generator/cmd/applyconfiguration-gen/generators" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine, "k8s.io/kubernetes/pkg/apis") // TODO: move this input path out of applyconfiguration-gen - if err := flag.Set("logtostderr", "true"); err != nil { - klog.Fatalf("Error: %v", err) - } - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS deleted file mode 100644 index 967eb2a7bbc3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS +++ /dev/null @@ -1,11 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - wojtek-t - - caesarxuchao -reviewers: - - wojtek-t - - caesarxuchao - - jpbetz -emeritus_approvers: - - lavalamp diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/README.md b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/README.md deleted file mode 100644 index b8206127ff56..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/README.md +++ /dev/null @@ -1,2 +0,0 @@ -See [generating-clientset.md](https://git.k8s.io/community/contributors/devel/sig-api-machinery/generating-clientset.md) - diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go deleted file mode 100644 index 4460ad26a254..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go +++ /dev/null @@ -1,133 +0,0 @@ -/* -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 args - -import ( - "fmt" - "path" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - - "k8s.io/code-generator/cmd/client-gen/types" - codegenutil "k8s.io/code-generator/pkg/util" -) - -var DefaultInputDirs = []string{} - -// CustomArgs is a wrapper for arguments to client-gen. -type CustomArgs struct { - // A sorted list of group versions to generate. For each of them the package path is found - // in GroupVersionToInputPath. - Groups []types.GroupVersions - - // Overrides for which types should be included in the client. - IncludedTypesOverrides map[types.GroupVersion][]string - - // ClientsetName is the name of the clientset to be generated. It's - // populated from command-line arguments. - ClientsetName string - // ClientsetAPIPath is the default API HTTP path for generated clients. - ClientsetAPIPath string - // ClientsetOnly determines if we should generate the clients for groups and - // types along with the clientset. It's populated from command-line - // arguments. - ClientsetOnly bool - // FakeClient determines if client-gen generates the fake clients. - FakeClient bool - // PluralExceptions specify list of exceptions used when pluralizing certain types. - // For example 'Endpoints:Endpoints', otherwise the pluralizer will generate 'Endpointes'. - PluralExceptions []string - - // ApplyConfigurationPackage is the package of apply builders generated by typebuilder-gen. - // If non-empty, Apply functions are generated for each type and reference the apply builders. - // If empty (""), Apply functions are not generated. - ApplyConfigurationPackage string -} - -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{ - ClientsetName: "internalclientset", - ClientsetAPIPath: "/apis", - ClientsetOnly: false, - FakeClient: true, - PluralExceptions: []string{"Endpoints:Endpoints"}, - ApplyConfigurationPackage: "", - } - genericArgs.CustomArgs = customArgs - genericArgs.InputDirs = DefaultInputDirs - - if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { - genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/clientset") - } - - return genericArgs, customArgs -} - -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet, inputBase string) { - gvsBuilder := NewGroupVersionsBuilder(&ca.Groups) - pflag.Var(NewGVPackagesValue(gvsBuilder, nil), "input", "group/versions that client-gen will generate clients for. At most one version per group is allowed. Specified in the format \"group1/version1,group2/version2...\".") - pflag.Var(NewGVTypesValue(&ca.IncludedTypesOverrides, []string{}), "included-types-overrides", "list of group/version/type for which client should be generated. By default, client is generated for all types which have genclient in types.go. This overrides that. For each groupVersion in this list, only the types mentioned here will be included. The default check of genclient will be used for other group versions.") - pflag.Var(NewInputBasePathValue(gvsBuilder, inputBase), "input-base", "base path to look for the api group.") - pflag.StringVarP(&ca.ClientsetName, "clientset-name", "n", ca.ClientsetName, "the name of the generated clientset package.") - pflag.StringVarP(&ca.ClientsetAPIPath, "clientset-api-path", "", ca.ClientsetAPIPath, "the value of default API HTTP path, starting with / and without trailing /.") - pflag.BoolVar(&ca.ClientsetOnly, "clientset-only", ca.ClientsetOnly, "when set, client-gen only generates the clientset shell, without generating the individual typed clients") - pflag.BoolVar(&ca.FakeClient, "fake-clientset", ca.FakeClient, "when set, client-gen will generate the fake clientset that can be used in tests") - - fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType form") - fs.StringVar(&ca.ApplyConfigurationPackage, "apply-configuration-package", ca.ApplyConfigurationPackage, "optional package of apply configurations, generated by applyconfiguration-gen, that are required to generate Apply functions for each type in the clientset. By default Apply functions are not generated.") - - // support old flags - fs.SetNormalizeFunc(mapFlagName("clientset-path", "output-package", fs.GetNormalizeFunc())) -} - -func Validate(genericArgs *args.GeneratorArgs) error { - customArgs := genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - if len(customArgs.ClientsetName) == 0 { - return fmt.Errorf("clientset name cannot be empty") - } - if len(customArgs.ClientsetAPIPath) == 0 { - return fmt.Errorf("clientset API path cannot be empty") - } - - return nil -} - -// GroupVersionPackages returns a map from GroupVersion to the package with the types.go. -func (ca *CustomArgs) GroupVersionPackages() map[types.GroupVersion]string { - res := map[types.GroupVersion]string{} - for _, pkg := range ca.Groups { - for _, v := range pkg.Versions { - res[types.GroupVersion{Group: pkg.Group, Version: v.Version}] = v.Package - } - } - return res -} - -func mapFlagName(from, to string, old func(fs *pflag.FlagSet, name string) pflag.NormalizedName) func(fs *pflag.FlagSet, name string) pflag.NormalizedName { - return func(fs *pflag.FlagSet, name string) pflag.NormalizedName { - if name == from { - name = to - } - return old(fs, name) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go deleted file mode 100644 index 50d29a95be1e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/gvpackages.go +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "bytes" - "encoding/csv" - "flag" - "path" - "sort" - "strings" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - "k8s.io/code-generator/cmd/client-gen/types" -) - -type inputBasePathValue struct { - builder *groupVersionsBuilder -} - -var _ flag.Value = &inputBasePathValue{} - -func NewInputBasePathValue(builder *groupVersionsBuilder, def string) *inputBasePathValue { - v := &inputBasePathValue{ - builder: builder, - } - v.Set(def) - return v -} - -func (s *inputBasePathValue) Set(val string) error { - s.builder.importBasePath = val - return s.builder.update() -} - -func (s *inputBasePathValue) Type() string { - return "string" -} - -func (s *inputBasePathValue) String() string { - return s.builder.importBasePath -} - -type gvPackagesValue struct { - builder *groupVersionsBuilder - groups []string - changed bool -} - -func NewGVPackagesValue(builder *groupVersionsBuilder, def []string) *gvPackagesValue { - gvp := new(gvPackagesValue) - gvp.builder = builder - if def != nil { - if err := gvp.set(def); err != nil { - panic(err) - } - } - return gvp -} - -var _ flag.Value = &gvPackagesValue{} - -func (s *gvPackagesValue) set(vs []string) error { - if s.changed { - s.groups = append(s.groups, vs...) - } else { - s.groups = append([]string(nil), vs...) - } - - s.builder.groups = s.groups - return s.builder.update() -} - -func (s *gvPackagesValue) Set(val string) error { - vs, err := readAsCSV(val) - if err != nil { - return err - } - if err := s.set(vs); err != nil { - return err - } - s.changed = true - return nil -} - -func (s *gvPackagesValue) Type() string { - return "stringSlice" -} - -func (s *gvPackagesValue) String() string { - str, _ := writeAsCSV(s.groups) - return "[" + str + "]" -} - -type groupVersionsBuilder struct { - value *[]types.GroupVersions - groups []string - importBasePath string -} - -func NewGroupVersionsBuilder(groups *[]types.GroupVersions) *groupVersionsBuilder { - return &groupVersionsBuilder{ - value: groups, - } -} - -func (p *groupVersionsBuilder) update() error { - var seenGroups = make(map[types.Group]*types.GroupVersions) - for _, v := range p.groups { - pth, gvString := util.ParsePathGroupVersion(v) - gv, err := types.ToGroupVersion(gvString) - if err != nil { - return err - } - - versionPkg := types.PackageVersion{Package: path.Join(p.importBasePath, pth, gv.Group.NonEmpty(), gv.Version.String()), Version: gv.Version} - if group, ok := seenGroups[gv.Group]; ok { - seenGroups[gv.Group].Versions = append(group.Versions, versionPkg) - } else { - seenGroups[gv.Group] = &types.GroupVersions{ - PackageName: gv.Group.NonEmpty(), - Group: gv.Group, - Versions: []types.PackageVersion{versionPkg}, - } - } - } - - var groupNames []string - for groupName := range seenGroups { - groupNames = append(groupNames, groupName.String()) - } - sort.Strings(groupNames) - *p.value = []types.GroupVersions{} - for _, groupName := range groupNames { - *p.value = append(*p.value, *seenGroups[types.Group(groupName)]) - } - - return nil -} - -func readAsCSV(val string) ([]string, error) { - if val == "" { - return []string{}, nil - } - stringReader := strings.NewReader(val) - csvReader := csv.NewReader(stringReader) - return csvReader.Read() -} - -func writeAsCSV(vals []string) (string, error) { - b := &bytes.Buffer{} - w := csv.NewWriter(b) - err := w.Write(vals) - if err != nil { - return "", err - } - w.Flush() - return strings.TrimSuffix(b.String(), "\n"), nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/gvtype.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/gvtype.go deleted file mode 100644 index e4e3ccb5366c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/args/gvtype.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "flag" - "fmt" - "strings" - - "k8s.io/code-generator/cmd/client-gen/types" -) - -type gvTypeValue struct { - gvToTypes *map[types.GroupVersion][]string - changed bool -} - -func NewGVTypesValue(gvToTypes *map[types.GroupVersion][]string, def []string) *gvTypeValue { - gvt := new(gvTypeValue) - gvt.gvToTypes = gvToTypes - if def != nil { - if err := gvt.set(def); err != nil { - panic(err) - } - } - return gvt -} - -var _ flag.Value = &gvTypeValue{} - -func (s *gvTypeValue) set(vs []string) error { - if !s.changed { - *s.gvToTypes = map[types.GroupVersion][]string{} - } - - for _, input := range vs { - gvString, typeStr, err := parseGroupVersionType(input) - if err != nil { - return err - } - gv, err := types.ToGroupVersion(gvString) - if err != nil { - return err - } - types, ok := (*s.gvToTypes)[gv] - if !ok { - types = []string{} - } - types = append(types, typeStr) - (*s.gvToTypes)[gv] = types - } - - return nil -} - -func (s *gvTypeValue) Set(val string) error { - vs, err := readAsCSV(val) - if err != nil { - return err - } - if err := s.set(vs); err != nil { - return err - } - s.changed = true - return nil -} - -func (s *gvTypeValue) Type() string { - return "stringSlice" -} - -func (s *gvTypeValue) String() string { - strs := make([]string, 0, len(*s.gvToTypes)) - for gv, ts := range *s.gvToTypes { - for _, t := range ts { - strs = append(strs, gv.Group.String()+"/"+gv.Version.String()+"/"+t) - } - } - str, _ := writeAsCSV(strs) - return "[" + str + "]" -} - -func parseGroupVersionType(gvtString string) (gvString string, typeStr string, err error) { - invalidFormatErr := fmt.Errorf("invalid value: %s, should be of the form group/version/type", gvtString) - subs := strings.Split(gvtString, "/") - length := len(subs) - switch length { - case 2: - // gvtString of the form group/type, e.g. api/Service,extensions/ReplicaSet - return subs[0] + "/", subs[1], nil - case 3: - return strings.Join(subs[:length-1], "/"), subs[length-1], nil - default: - return "", "", invalidFormatErr - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go deleted file mode 100644 index ef4466d80059..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go +++ /dev/null @@ -1,393 +0,0 @@ -/* -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 generators has the generators for the client-gen utility. -package generators - -import ( - "path/filepath" - "strings" - - clientgenargs "k8s.io/code-generator/cmd/client-gen/args" - "k8s.io/code-generator/cmd/client-gen/generators/fake" - "k8s.io/code-generator/cmd/client-gen/generators/scheme" - "k8s.io/code-generator/cmd/client-gen/generators/util" - "k8s.io/code-generator/cmd/client-gen/path" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - codegennamer "k8s.io/code-generator/pkg/namer" - genutil "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems(pluralExceptions map[string]string) namer.NameSystems { - lowercaseNamer := namer.NewAllLowercasePluralNamer(pluralExceptions) - - publicNamer := &ExceptionNamer{ - Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "EventResource" - }, - KeyFunc: func(t *types.Type) string { - return t.Name.Package + "." + t.Name.Name - }, - Delegate: namer.NewPublicNamer(0), - } - privateNamer := &ExceptionNamer{ - Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "eventResource" - }, - KeyFunc: func(t *types.Type) string { - return t.Name.Package + "." + t.Name.Name - }, - Delegate: namer.NewPrivateNamer(0), - } - publicPluralNamer := &ExceptionNamer{ - Exceptions: map[string]string{ - // these exceptions are used to deconflict the generated code - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "EventResource" - }, - KeyFunc: func(t *types.Type) string { - return t.Name.Package + "." + t.Name.Name - }, - Delegate: namer.NewPublicPluralNamer(pluralExceptions), - } - privatePluralNamer := &ExceptionNamer{ - Exceptions: map[string]string{ - // you can put your fully qualified package like - // to generate a name that doesn't conflict with your group. - // "k8s.io/apis/events/v1beta1.Event": "eventResource" - // these exceptions are used to deconflict the generated code - "k8s.io/apis/events/v1beta1.Event": "eventResources", - "k8s.io/kubernetes/pkg/apis/events.Event": "eventResources", - }, - KeyFunc: func(t *types.Type) string { - return t.Name.Package + "." + t.Name.Name - }, - Delegate: namer.NewPrivatePluralNamer(pluralExceptions), - } - - return namer.NameSystems{ - "singularKind": namer.NewPublicNamer(0), - "public": publicNamer, - "private": privateNamer, - "raw": namer.NewRawNamer("", nil), - "publicPlural": publicPluralNamer, - "privatePlural": privatePluralNamer, - "allLowercasePlural": lowercaseNamer, - "resource": codegennamer.NewTagOverrideNamer("resourceName", lowercaseNamer), - } -} - -// ExceptionNamer allows you specify exceptional cases with exact names. This allows you to have control -// for handling various conflicts, like group and resource names for instance. -type ExceptionNamer struct { - Exceptions map[string]string - KeyFunc func(*types.Type) string - - Delegate namer.Namer -} - -// Name provides the requested name for a type. -func (n *ExceptionNamer) Name(t *types.Type) string { - key := n.KeyFunc(t) - if exception, ok := n.Exceptions[key]; ok { - return exception - } - return n.Delegate.Name(t) -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -func packageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clientsetPackage string, groupPackageName string, groupGoName string, apiPath string, srcTreePath string, inputPackage string, applyBuilderPackage string, boilerplate []byte) generator.Package { - groupVersionClientPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty())) - return &generator.DefaultPackage{ - PackageName: strings.ToLower(gv.Version.NonEmpty()), - PackagePath: groupVersionClientPackage, - HeaderText: boilerplate, - PackageDocumentation: []byte("// This package has the automatically generated typed clients.\n"), - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - } - // Since we want a file per type that we generate a client for, we - // have to provide a function for this. - for _, t := range typeList { - generators = append(generators, &genClientForType{ - DefaultGen: generator.DefaultGen{ - OptionalName: strings.ToLower(c.Namers["private"].Name(t)), - }, - outputPackage: groupVersionClientPackage, - inputPackage: inputPackage, - clientsetPackage: clientsetPackage, - applyConfigurationPackage: applyBuilderPackage, - group: gv.Group.NonEmpty(), - version: gv.Version.String(), - groupGoName: groupGoName, - typeToMatch: t, - imports: generator.NewImportTracker(), - }) - } - - generators = append(generators, &genGroup{ - DefaultGen: generator.DefaultGen{ - OptionalName: groupPackageName + "_client", - }, - outputPackage: groupVersionClientPackage, - inputPackage: inputPackage, - clientsetPackage: clientsetPackage, - group: gv.Group.NonEmpty(), - version: gv.Version.String(), - groupGoName: groupGoName, - apiPath: apiPath, - types: typeList, - imports: generator.NewImportTracker(), - }) - - expansionFileName := "generated_expansion" - generators = append(generators, &genExpansion{ - groupPackagePath: filepath.Join(srcTreePath, groupVersionClientPackage), - DefaultGen: generator.DefaultGen{ - OptionalName: expansionFileName, - }, - types: typeList, - }) - - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient - }, - } -} - -func packageForClientset(customArgs *clientgenargs.CustomArgs, clientsetPackage string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { - return &generator.DefaultPackage{ - PackageName: customArgs.ClientsetName, - PackagePath: clientsetPackage, - HeaderText: boilerplate, - // GeneratorFunc returns a list of generators. Each generator generates a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - &genClientset{ - DefaultGen: generator.DefaultGen{ - OptionalName: "clientset", - }, - groups: customArgs.Groups, - groupGoNames: groupGoNames, - clientsetPackage: clientsetPackage, - outputPackage: customArgs.ClientsetName, - imports: generator.NewImportTracker(), - }, - } - return generators - }, - } -} - -func packageForScheme(customArgs *clientgenargs.CustomArgs, clientsetPackage string, srcTreePath string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { - schemePackage := filepath.Join(clientsetPackage, "scheme") - - // create runtime.Registry for internal client because it has to know about group versions - internalClient := false -NextGroup: - for _, group := range customArgs.Groups { - for _, v := range group.Versions { - if v.String() == "" { - internalClient = true - break NextGroup - } - } - } - - return &generator.DefaultPackage{ - PackageName: "scheme", - PackagePath: schemePackage, - HeaderText: boilerplate, - PackageDocumentation: []byte("// This package contains the scheme of the automatically generated clientset.\n"), - // GeneratorFunc returns a list of generators. Each generator generates a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - - &scheme.GenScheme{ - DefaultGen: generator.DefaultGen{ - OptionalName: "register", - }, - InputPackages: customArgs.GroupVersionPackages(), - OutputPackage: schemePackage, - OutputPath: filepath.Join(srcTreePath, schemePackage), - Groups: customArgs.Groups, - GroupGoNames: groupGoNames, - ImportTracker: generator.NewImportTracker(), - CreateRegistry: internalClient, - }, - } - return generators - }, - } -} - -// applyGroupOverrides applies group name overrides to each package, if applicable. If there is a -// comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", use the -// first field (somegroup) as the name of the group in Go code, e.g. as the func name in a clientset. -// -// If the first field of the groupName is not unique within the clientset, use "// +groupName=unique -func applyGroupOverrides(universe types.Universe, customArgs *clientgenargs.CustomArgs) { - // Create a map from "old GV" to "new GV" so we know what changes we need to make. - changes := make(map[clientgentypes.GroupVersion]clientgentypes.GroupVersion) - for gv, inputDir := range customArgs.GroupVersionPackages() { - p := universe.Package(genutil.Vendorless(inputDir)) - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - newGV := clientgentypes.GroupVersion{ - Group: clientgentypes.Group(override[0]), - Version: gv.Version, - } - changes[gv] = newGV - } - } - - // Modify customArgs.Groups based on the groupName overrides. - newGroups := make([]clientgentypes.GroupVersions, 0, len(customArgs.Groups)) - for _, gvs := range customArgs.Groups { - gv := clientgentypes.GroupVersion{ - Group: gvs.Group, - Version: gvs.Versions[0].Version, // we only need a version, and the first will do - } - if newGV, ok := changes[gv]; ok { - // There's an override, so use it. - newGVS := clientgentypes.GroupVersions{ - PackageName: gvs.PackageName, - Group: newGV.Group, - Versions: gvs.Versions, - } - newGroups = append(newGroups, newGVS) - } else { - // No override. - newGroups = append(newGroups, gvs) - } - } - customArgs.Groups = newGroups -} - -// Packages makes the client package definition. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - customArgs, ok := arguments.CustomArgs.(*clientgenargs.CustomArgs) - if !ok { - klog.Fatalf("cannot convert arguments.CustomArgs to clientgenargs.CustomArgs") - } - includedTypesOverrides := customArgs.IncludedTypesOverrides - - applyGroupOverrides(context.Universe, customArgs) - - gvToTypes := map[clientgentypes.GroupVersion][]*types.Type{} - groupGoNames := make(map[clientgentypes.GroupVersion]string) - for gv, inputDir := range customArgs.GroupVersionPackages() { - p := context.Universe.Package(path.Vendorless(inputDir)) - - // If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as - // the Go group identifier in CamelCase. It defaults - groupGoNames[gv] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) - if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil { - groupGoNames[gv] = namer.IC(override[0]) - } - - // Package are indexed with the vendor prefix stripped - for n, t := range p.Types { - // filter out types which are not included in user specified overrides. - typesOverride, ok := includedTypesOverrides[gv] - if ok { - found := false - for _, typeStr := range typesOverride { - if typeStr == n { - found = true - break - } - } - if !found { - continue - } - } else { - // User has not specified any override for this group version. - // filter out types which don't have genclient. - if tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)); !tags.GenerateClient { - continue - } - } - if _, found := gvToTypes[gv]; !found { - gvToTypes[gv] = []*types.Type{} - } - gvToTypes[gv] = append(gvToTypes[gv], t) - } - } - - var packageList []generator.Package - clientsetPackage := filepath.Join(arguments.OutputPackagePath, customArgs.ClientsetName) - - packageList = append(packageList, packageForClientset(customArgs, clientsetPackage, groupGoNames, boilerplate)) - packageList = append(packageList, packageForScheme(customArgs, clientsetPackage, arguments.OutputBase, groupGoNames, boilerplate)) - if customArgs.FakeClient { - packageList = append(packageList, fake.PackageForClientset(customArgs, clientsetPackage, groupGoNames, boilerplate)) - } - - // If --clientset-only=true, we don't regenerate the individual typed clients. - if customArgs.ClientsetOnly { - return generator.Packages(packageList) - } - - orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} - gvPackages := customArgs.GroupVersionPackages() - for _, group := range customArgs.Groups { - for _, version := range group.Versions { - gv := clientgentypes.GroupVersion{Group: group.Group, Version: version.Version} - types := gvToTypes[gv] - inputPath := gvPackages[gv] - packageList = append(packageList, packageForGroup(gv, orderer.OrderTypes(types), clientsetPackage, group.PackageName, groupGoNames[gv], customArgs.ClientsetAPIPath, arguments.OutputBase, inputPath, customArgs.ApplyConfigurationPackage, boilerplate)) - if customArgs.FakeClient { - packageList = append(packageList, fake.PackageForGroup(gv, orderer.OrderTypes(types), clientsetPackage, group.PackageName, groupGoNames[gv], inputPath, customArgs.ApplyConfigurationPackage, boilerplate)) - } - } - } - - return generator.Packages(packageList) -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go deleted file mode 100644 index 1794909148f1..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -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 fake - -import ( - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" - - clientgenargs "k8s.io/code-generator/cmd/client-gen/args" - scheme "k8s.io/code-generator/cmd/client-gen/generators/scheme" - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" -) - -func PackageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clientsetPackage string, groupPackageName string, groupGoName string, inputPackage string, applyBuilderPackage string, boilerplate []byte) generator.Package { - outputPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty()), "fake") - // TODO: should make this a function, called by here and in client-generator.go - realClientPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty())) - return &generator.DefaultPackage{ - PackageName: "fake", - PackagePath: outputPackage, - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// Package fake has the automatically generated clients. -`), - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - } - // Since we want a file per type that we generate a client for, we - // have to provide a function for this. - for _, t := range typeList { - generators = append(generators, &genFakeForType{ - DefaultGen: generator.DefaultGen{ - OptionalName: "fake_" + strings.ToLower(c.Namers["private"].Name(t)), - }, - outputPackage: outputPackage, - inputPackage: inputPackage, - group: gv.Group.NonEmpty(), - version: gv.Version.String(), - groupGoName: groupGoName, - typeToMatch: t, - imports: generator.NewImportTracker(), - applyConfigurationPackage: applyBuilderPackage, - }) - } - - generators = append(generators, &genFakeForGroup{ - DefaultGen: generator.DefaultGen{ - OptionalName: "fake_" + groupPackageName + "_client", - }, - outputPackage: outputPackage, - realClientPackage: realClientPackage, - group: gv.Group.NonEmpty(), - version: gv.Version.String(), - groupGoName: groupGoName, - types: typeList, - imports: generator.NewImportTracker(), - }) - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient - }, - } -} - -func PackageForClientset(customArgs *clientgenargs.CustomArgs, clientsetPackage string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { - return &generator.DefaultPackage{ - // TODO: we'll generate fake clientset for different release in the future. - // Package name and path are hard coded for now. - PackageName: "fake", - PackagePath: filepath.Join(clientsetPackage, "fake"), - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// This package has the automatically generated fake clientset. -`), - // GeneratorFunc returns a list of generators. Each generator generates a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - - &genClientset{ - DefaultGen: generator.DefaultGen{ - OptionalName: "clientset_generated", - }, - groups: customArgs.Groups, - groupGoNames: groupGoNames, - fakeClientsetPackage: clientsetPackage, - outputPackage: "fake", - imports: generator.NewImportTracker(), - realClientsetPackage: clientsetPackage, - }, - &scheme.GenScheme{ - DefaultGen: generator.DefaultGen{ - OptionalName: "register", - }, - InputPackages: customArgs.GroupVersionPackages(), - OutputPackage: clientsetPackage, - Groups: customArgs.Groups, - GroupGoNames: groupGoNames, - ImportTracker: generator.NewImportTracker(), - PrivateScheme: true, - }, - } - return generators - }, - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go deleted file mode 100644 index cd731cb9d666..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 fake - -import ( - "fmt" - "io" - "path/filepath" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// genClientset generates a package for a clientset. -type genClientset struct { - generator.DefaultGen - groups []clientgentypes.GroupVersions - groupGoNames map[clientgentypes.GroupVersion]string - fakeClientsetPackage string - outputPackage string - imports namer.ImportTracker - clientsetGenerated bool - // the import path of the generated real clientset. - realClientsetPackage string -} - -var _ generator.Generator = &genClientset{} - -func (g *genClientset) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -// We only want to call GenerateType() once. -func (g *genClientset) Filter(c *generator.Context, t *types.Type) bool { - ret := !g.clientsetGenerated - g.clientsetGenerated = true - return ret -} - -func (g *genClientset) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - for _, group := range g.groups { - for _, version := range group.Versions { - groupClientPackage := filepath.Join(g.fakeClientsetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) - fakeGroupClientPackage := filepath.Join(groupClientPackage, "fake") - - groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), groupClientPackage)) - imports = append(imports, fmt.Sprintf("fake%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), fakeGroupClientPackage)) - } - } - // the package that has the clientset Interface - imports = append(imports, fmt.Sprintf("clientset \"%s\"", g.realClientsetPackage)) - // imports for the code in commonTemplate - imports = append(imports, - "k8s.io/client-go/testing", - "k8s.io/client-go/discovery", - "fakediscovery \"k8s.io/client-go/discovery/fake\"", - "k8s.io/apimachinery/pkg/runtime", - "k8s.io/apimachinery/pkg/watch", - ) - - return -} - -func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - // TODO: We actually don't need any type information to generate the clientset, - // perhaps we can adapt the go2ild framework to this kind of usage. - sw := generator.NewSnippetWriter(w, c, "$", "$") - - allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) - - sw.Do(common, nil) - sw.Do(checkImpl, nil) - - for _, group := range allGroups { - m := map[string]interface{}{ - "group": group.Group, - "version": group.Version, - "PackageAlias": group.PackageAlias, - "GroupGoName": group.GroupGoName, - "Version": namer.IC(group.Version.String()), - } - - sw.Do(clientsetInterfaceImplTemplate, m) - } - - return sw.Error() -} - -// This part of code is version-independent, unchanging. -var common = ` -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} -` - -var checkImpl = ` -var ( - _ clientset.Interface = &Clientset{} - _ testing.FakeClient = &Clientset{} -) -` - -var clientsetInterfaceImplTemplate = ` -// $.GroupGoName$$.Version$ retrieves the $.GroupGoName$$.Version$Client -func (c *Clientset) $.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface { - return &fake$.PackageAlias$.Fake$.GroupGoName$$.Version${Fake: &c.Fake} -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go deleted file mode 100644 index 8f4d5785ef94..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -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 fake - -import ( - "fmt" - "io" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// genFakeForGroup produces a file for a group client, e.g. ExtensionsClient for the extension group. -type genFakeForGroup struct { - generator.DefaultGen - outputPackage string - realClientPackage string - group string - version string - groupGoName string - // types in this group - types []*types.Type - imports namer.ImportTracker - // If the genGroup has been called. This generator should only execute once. - called bool -} - -var _ generator.Generator = &genFakeForGroup{} - -// We only want to call GenerateType() once per group. -func (g *genFakeForGroup) Filter(c *generator.Context, t *types.Type) bool { - if !g.called { - g.called = true - return true - } - return false -} - -func (g *genFakeForGroup) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genFakeForGroup) Imports(c *generator.Context) (imports []string) { - imports = g.imports.ImportLines() - if len(g.types) != 0 { - imports = append(imports, fmt.Sprintf("%s \"%s\"", strings.ToLower(filepath.Base(g.realClientPackage)), g.realClientPackage)) - } - return imports -} - -func (g *genFakeForGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - m := map[string]interface{}{ - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "Fake": c.Universe.Type(types.Name{Package: "k8s.io/client-go/testing", Name: "Fake"}), - "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "RESTClient": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClient"}), - } - - sw.Do(groupClientTemplate, m) - for _, t := range g.types { - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - wrapper := map[string]interface{}{ - "type": t, - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "realClientPackage": strings.ToLower(filepath.Base(g.realClientPackage)), - } - if tags.NonNamespaced { - sw.Do(getterImplNonNamespaced, wrapper) - continue - } - sw.Do(getterImplNamespaced, wrapper) - } - sw.Do(getRESTClient, m) - return sw.Error() -} - -var groupClientTemplate = ` -type Fake$.GroupGoName$$.Version$ struct { - *$.Fake|raw$ -} -` - -var getterImplNamespaced = ` -func (c *Fake$.GroupGoName$$.Version$) $.type|publicPlural$(namespace string) $.realClientPackage$.$.type|public$Interface { - return &Fake$.type|publicPlural${c, namespace} -} -` - -var getterImplNonNamespaced = ` -func (c *Fake$.GroupGoName$$.Version$) $.type|publicPlural$() $.realClientPackage$.$.type|public$Interface { - return &Fake$.type|publicPlural${c} -} -` - -var getRESTClient = ` -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *Fake$.GroupGoName$$.Version$) RESTClient() $.RESTClientInterface|raw$ { - var ret *$.RESTClient|raw$ - return ret -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go deleted file mode 100644 index 28b829cc1390..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go +++ /dev/null @@ -1,570 +0,0 @@ -/* -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 fake - -import ( - "io" - gopath "path" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// genFakeForType produces a file for each top-level type. -type genFakeForType struct { - generator.DefaultGen - outputPackage string - group string - version string - groupGoName string - inputPackage string - typeToMatch *types.Type - imports namer.ImportTracker - applyConfigurationPackage string -} - -var _ generator.Generator = &genFakeForType{} - -// Filter ignores all but one type because we're making a single file per type. -func (g *genFakeForType) Filter(c *generator.Context, t *types.Type) bool { return t == g.typeToMatch } - -func (g *genFakeForType) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genFakeForType) Imports(c *generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -// Ideally, we'd like genStatus to return true if there is a subresource path -// registered for "status" in the API server, but we do not have that -// information, so genStatus returns true if the type has a status field. -func genStatus(t *types.Type) bool { - // Default to true if we have a Status member - hasStatus := false - for _, m := range t.Members { - if m.Name == "Status" { - hasStatus = true - break - } - } - - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - return hasStatus && !tags.NoStatus -} - -// hasObjectMeta returns true if the type has a ObjectMeta field. -func hasObjectMeta(t *types.Type) bool { - for _, m := range t.Members { - if m.Embedded && m.Name == "ObjectMeta" { - return true - } - } - return false -} - -// GenerateType makes the body of a file implementing the individual typed client for type t. -func (g *genFakeForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - pkg := filepath.Base(t.Name.Package) - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - - const pkgClientGoTesting = "k8s.io/client-go/testing" - m := map[string]interface{}{ - "type": t, - "inputType": t, - "resultType": t, - "subresourcePath": "", - "package": pkg, - "Package": namer.IC(pkg), - "namespaced": !tags.NonNamespaced, - "Group": namer.IC(g.group), - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "version": g.version, - "SchemeGroupVersion": c.Universe.Type(types.Name{Package: t.Name.Package, Name: "SchemeGroupVersion"}), - "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), - "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), - "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), - "PatchOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "PatchOptions"}), - "ApplyOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ApplyOptions"}), - "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), - "Everything": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/labels", Name: "Everything"}), - "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), - "ApplyPatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "ApplyPatchType"}), - "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"}), - "jsonMarshal": c.Universe.Type(types.Name{Package: "encoding/json", Name: "Marshal"}), - - "NewRootListAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootListAction"}), - "NewListAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewListAction"}), - "NewRootGetAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootGetAction"}), - "NewGetAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewGetAction"}), - "NewRootDeleteAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootDeleteAction"}), - "NewRootDeleteActionWithOptions": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootDeleteActionWithOptions"}), - "NewDeleteAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewDeleteAction"}), - "NewDeleteActionWithOptions": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewDeleteActionWithOptions"}), - "NewRootDeleteCollectionAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootDeleteCollectionAction"}), - "NewDeleteCollectionAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewDeleteCollectionAction"}), - "NewRootUpdateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootUpdateAction"}), - "NewUpdateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewUpdateAction"}), - "NewRootCreateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootCreateAction"}), - "NewCreateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewCreateAction"}), - "NewRootWatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootWatchAction"}), - "NewWatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewWatchAction"}), - "NewCreateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewCreateSubresourceAction"}), - "NewRootCreateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootCreateSubresourceAction"}), - "NewUpdateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewUpdateSubresourceAction"}), - "NewGetSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewGetSubresourceAction"}), - "NewRootGetSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootGetSubresourceAction"}), - "NewRootUpdateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootUpdateSubresourceAction"}), - "NewRootPatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootPatchAction"}), - "NewPatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewPatchAction"}), - "NewRootPatchSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootPatchSubresourceAction"}), - "NewPatchSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewPatchSubresourceAction"}), - "ExtractFromListOptions": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "ExtractFromListOptions"}), - } - - generateApply := len(g.applyConfigurationPackage) > 0 - if generateApply { - // Generated apply builder type references required for generated Apply function - _, gvString := util.ParsePathGroupVersion(g.inputPackage) - m["inputApplyConfig"] = types.Ref(gopath.Join(g.applyConfigurationPackage, gvString), t.Name.Name+"ApplyConfiguration") - } - - if tags.NonNamespaced { - sw.Do(structNonNamespaced, m) - } else { - sw.Do(structNamespaced, m) - } - - if tags.NoVerbs { - return sw.Error() - } - sw.Do(resource, m) - sw.Do(kind, m) - - if tags.HasVerb("get") { - sw.Do(getTemplate, m) - } - if tags.HasVerb("list") { - if hasObjectMeta(t) { - sw.Do(listUsingOptionsTemplate, m) - } else { - sw.Do(listTemplate, m) - } - } - if tags.HasVerb("watch") { - sw.Do(watchTemplate, m) - } - - if tags.HasVerb("create") { - sw.Do(createTemplate, m) - } - if tags.HasVerb("update") { - sw.Do(updateTemplate, m) - } - if tags.HasVerb("updateStatus") && genStatus(t) { - sw.Do(updateStatusTemplate, m) - } - if tags.HasVerb("delete") { - sw.Do(deleteTemplate, m) - } - if tags.HasVerb("deleteCollection") { - sw.Do(deleteCollectionTemplate, m) - } - if tags.HasVerb("patch") { - sw.Do(patchTemplate, m) - } - if tags.HasVerb("apply") && generateApply { - sw.Do(applyTemplate, m) - } - if tags.HasVerb("applyStatus") && generateApply && genStatus(t) { - sw.Do(applyStatusTemplate, m) - } - _, typeGVString := util.ParsePathGroupVersion(g.inputPackage) - - // generate extended client methods - for _, e := range tags.Extensions { - if e.HasVerb("apply") && !generateApply { - continue - } - inputType := *t - resultType := *t - inputGVString := typeGVString - if len(e.InputTypeOverride) > 0 { - if name, pkg := e.Input(); len(pkg) > 0 { - _, inputGVString = util.ParsePathGroupVersion(pkg) - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - inputType = *newType - } else { - inputType.Name.Name = e.InputTypeOverride - } - } - if len(e.ResultTypeOverride) > 0 { - if name, pkg := e.Result(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - resultType = *newType - } else { - resultType.Name.Name = e.ResultTypeOverride - } - } - m["inputType"] = &inputType - m["resultType"] = &resultType - m["subresourcePath"] = e.SubResourcePath - if e.HasVerb("apply") { - m["inputApplyConfig"] = types.Ref(gopath.Join(g.applyConfigurationPackage, inputGVString), inputType.Name.Name+"ApplyConfiguration") - } - - if e.HasVerb("get") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getTemplate), m) - } - } - - if e.HasVerb("list") { - - sw.Do(adjustTemplate(e.VerbName, e.VerbType, listTemplate), m) - } - - // TODO: Figure out schemantic for watching a sub-resource. - if e.HasVerb("watch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, watchTemplate), m) - } - - if e.HasVerb("create") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createTemplate), m) - } - } - - if e.HasVerb("update") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateTemplate), m) - } - } - - // TODO: Figure out schemantic for deleting a sub-resource (what arguments - // are passed, does it need two names? etc. - if e.HasVerb("delete") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, deleteTemplate), m) - } - - if e.HasVerb("patch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, patchTemplate), m) - } - - if e.HasVerb("apply") && generateApply { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, applySubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, applyTemplate), m) - } - } - } - - return sw.Error() -} - -// adjustTemplate adjust the origin verb template using the expansion name. -// TODO: Make the verbs in templates parametrized so the strings.Replace() is -// not needed. -func adjustTemplate(name, verbType, template string) string { - return strings.Replace(template, " "+strings.Title(verbType), " "+name, -1) -} - -// template for the struct that implements the type's interface -var structNamespaced = ` -// Fake$.type|publicPlural$ implements $.type|public$Interface -type Fake$.type|publicPlural$ struct { - Fake *Fake$.GroupGoName$$.Version$ - ns string -} -` - -// template for the struct that implements the type's interface -var structNonNamespaced = ` -// Fake$.type|publicPlural$ implements $.type|public$Interface -type Fake$.type|publicPlural$ struct { - Fake *Fake$.GroupGoName$$.Version$ -} -` - -var resource = ` -var $.type|allLowercasePlural$Resource = $.SchemeGroupVersion|raw$.WithResource("$.type|resource$") -` - -var kind = ` -var $.type|allLowercasePlural$Kind = $.SchemeGroupVersion|raw$.WithKind("$.type|singularKind$") -` - -var listTemplate = ` -// List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. -func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), &$.type|raw$List{}) - $else$Invokes($.NewRootListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, opts), &$.type|raw$List{})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.type|raw$List), err -} -` - -var listUsingOptionsTemplate = ` -// List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. -func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), &$.type|raw$List{}) - $else$Invokes($.NewRootListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, opts), &$.type|raw$List{})$end$ - if obj == nil { - return nil, err - } - - label, _, _ := $.ExtractFromListOptions|raw$(opts) - if label == nil { - label = $.Everything|raw$() - } - list := &$.type|raw$List{ListMeta: obj.(*$.type|raw$List).ListMeta} - for _, item := range obj.(*$.type|raw$List).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} -` - -var getTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *Fake$.type|publicPlural$) Get(ctx context.Context, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewGetAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.resultType|raw${}) - $else$Invokes($.NewRootGetAction|raw$($.type|allLowercasePlural$Resource, name), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var getSubresourceTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *Fake$.type|publicPlural$) Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${}) - $else$Invokes($.NewRootGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var deleteTemplate = ` -// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { - _, err := c.Fake. - $if .namespaced$Invokes($.NewDeleteActionWithOptions|raw$($.type|allLowercasePlural$Resource, c.ns, name, opts), &$.type|raw${}) - $else$Invokes($.NewRootDeleteActionWithOptions|raw$($.type|allLowercasePlural$Resource, name, opts), &$.type|raw${})$end$ - return err -} -` - -var deleteCollectionTemplate = ` -// DeleteCollection deletes a collection of objects. -func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { - $if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOpts) - $else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOpts) - $end$ - _, err := c.Fake.Invokes(action, &$.type|raw$List{}) - return err -} -` -var createTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewCreateAction|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$), &$.resultType|raw${}) - $else$Invokes($.NewRootCreateAction|raw$($.inputType|allLowercasePlural$Resource, $.inputType|private$), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var createSubresourceTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewCreateSubresourceAction|raw$($.type|allLowercasePlural$Resource, $.type|private$Name, "$.subresourcePath$", c.ns, $.inputType|private$), &$.resultType|raw${}) - $else$Invokes($.NewRootCreateSubresourceAction|raw$($.type|allLowercasePlural$Resource, $.type|private$Name, "$.subresourcePath$", $.inputType|private$), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var updateTemplate = ` -// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewUpdateAction|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$), &$.resultType|raw${}) - $else$Invokes($.NewRootUpdateAction|raw$($.inputType|allLowercasePlural$Resource, $.inputType|private$), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var updateSubresourceTemplate = ` -// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", c.ns, $.inputType|private$), &$.inputType|raw${}) - $else$Invokes($.NewRootUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.inputType|private$), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var updateStatusTemplate = ` -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *Fake$.type|publicPlural$) UpdateStatus(ctx context.Context, $.type|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "status", c.ns, $.type|private$), &$.type|raw${}) - $else$Invokes($.NewRootUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "status", $.type|private$), &$.type|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.type|raw$), err -} -` - -var watchTemplate = ` -// Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. -func (c *Fake$.type|publicPlural$) Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { - return c.Fake. - $if .namespaced$InvokesWatch($.NewWatchAction|raw$($.type|allLowercasePlural$Resource, c.ns, opts)) - $else$InvokesWatch($.NewRootWatchAction|raw$($.type|allLowercasePlural$Resource, opts))$end$ -} -` - -var patchTemplate = ` -// Patch applies the patch and returns the patched $.resultType|private$. -func (c *Fake$.type|publicPlural$) Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { - obj, err := c.Fake. - $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, name, pt, data, subresources... ), &$.resultType|raw${}) - $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, name, pt, data, subresources...), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var applyTemplate = ` -// Apply takes the given apply declarative configuration, applies it and returns the applied $.resultType|private$. -func (c *Fake$.type|publicPlural$) Apply(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { - if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") - } - data, err := $.jsonMarshal|raw$($.inputType|private$) - if err != nil { - return nil, err - } - name := $.inputType|private$.Name - if name == nil { - return nil, fmt.Errorf("$.inputType|private$.Name must be provided to Apply") - } - obj, err := c.Fake. - $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, *name, $.ApplyPatchType|raw$, data), &$.resultType|raw${}) - $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, *name, $.ApplyPatchType|raw$, data), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var applyStatusTemplate = ` -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *Fake$.type|publicPlural$) ApplyStatus(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { - if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") - } - data, err := $.jsonMarshal|raw$($.inputType|private$) - if err != nil { - return nil, err - } - name := $.inputType|private$.Name - if name == nil { - return nil, fmt.Errorf("$.inputType|private$.Name must be provided to Apply") - } - obj, err := c.Fake. - $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, *name, $.ApplyPatchType|raw$, data, "status"), &$.resultType|raw${}) - $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, *name, $.ApplyPatchType|raw$, data, "status"), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` - -var applySubresourceTemplate = ` -// Apply takes top resource name and the apply declarative configuration for $.subresourcePath$, -// applies it and returns the applied $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Apply(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { - if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") - } - data, err := $.jsonMarshal|raw$($.inputType|private$) - if err != nil { - return nil, err - } - obj, err := c.Fake. - $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, $.type|private$Name, $.ApplyPatchType|raw$, data, "status"), &$.resultType|raw${}) - $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, $.type|private$Name, $.ApplyPatchType|raw$, data, "status"), &$.resultType|raw${})$end$ - if obj == nil { - return nil, err - } - return obj.(*$.resultType|raw$), err -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go deleted file mode 100644 index 6bf1ca37f887..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go +++ /dev/null @@ -1,209 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "fmt" - "io" - "path/filepath" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// genClientset generates a package for a clientset. -type genClientset struct { - generator.DefaultGen - groups []clientgentypes.GroupVersions - groupGoNames map[clientgentypes.GroupVersion]string - clientsetPackage string - outputPackage string - imports namer.ImportTracker - clientsetGenerated bool -} - -var _ generator.Generator = &genClientset{} - -func (g *genClientset) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -// We only want to call GenerateType() once. -func (g *genClientset) Filter(c *generator.Context, t *types.Type) bool { - ret := !g.clientsetGenerated - g.clientsetGenerated = true - return ret -} - -func (g *genClientset) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - for _, group := range g.groups { - for _, version := range group.Versions { - typedClientPath := filepath.Join(g.clientsetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) - groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), typedClientPath)) - } - } - return -} - -func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - // TODO: We actually don't need any type information to generate the clientset, - // perhaps we can adapt the go2ild framework to this kind of usage. - sw := generator.NewSnippetWriter(w, c, "$", "$") - - allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) - m := map[string]interface{}{ - "allGroups": allGroups, - "Config": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), - "DefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), - "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "RESTHTTPClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "HTTPClientFor"}), - "DiscoveryInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/discovery", Name: "DiscoveryInterface"}), - "DiscoveryClient": c.Universe.Type(types.Name{Package: "k8s.io/client-go/discovery", Name: "DiscoveryClient"}), - "NewDiscoveryClientForConfigAndClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClientForConfigAndClient"}), - "NewDiscoveryClientForConfigOrDie": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClientForConfigOrDie"}), - "NewDiscoveryClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClient"}), - "flowcontrolNewTokenBucketRateLimiter": c.Universe.Function(types.Name{Package: "k8s.io/client-go/util/flowcontrol", Name: "NewTokenBucketRateLimiter"}), - } - sw.Do(clientsetInterface, m) - sw.Do(clientsetTemplate, m) - for _, g := range allGroups { - sw.Do(clientsetInterfaceImplTemplate, g) - } - sw.Do(getDiscoveryTemplate, m) - sw.Do(newClientsetForConfigTemplate, m) - sw.Do(newClientsetForConfigAndClientTemplate, m) - sw.Do(newClientsetForConfigOrDieTemplate, m) - sw.Do(newClientsetForRESTClientTemplate, m) - - return sw.Error() -} - -var clientsetInterface = ` -type Interface interface { - Discovery() $.DiscoveryInterface|raw$ - $range .allGroups$$.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface - $end$ -} -` - -var clientsetTemplate = ` -// Clientset contains the clients for groups. -type Clientset struct { - *$.DiscoveryClient|raw$ - $range .allGroups$$.LowerCaseGroupGoName$$.Version$ *$.PackageAlias$.$.GroupGoName$$.Version$Client - $end$ -} -` - -var clientsetInterfaceImplTemplate = ` -// $.GroupGoName$$.Version$ retrieves the $.GroupGoName$$.Version$Client -func (c *Clientset) $.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface { - return c.$.LowerCaseGroupGoName$$.Version$ -} -` - -var getDiscoveryTemplate = ` -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() $.DiscoveryInterface|raw$ { - if c == nil { - return nil - } - return c.DiscoveryClient -} -` - -var newClientsetForConfigTemplate = ` -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *$.Config|raw$) (*Clientset, error) { - configShallowCopy := *c - - if configShallowCopy.UserAgent == "" { - configShallowCopy.UserAgent = $.DefaultKubernetesUserAgent|raw$() - } - - // share the transport between all clients - httpClient, err := $.RESTHTTPClientFor|raw$(&configShallowCopy) - if err != nil { - return nil, err - } - - return NewForConfigAndClient(&configShallowCopy, httpClient) -} -` - -var newClientsetForConfigAndClientTemplate = ` -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *$.Config|raw$, httpClient *http.Client) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = $.flowcontrolNewTokenBucketRateLimiter|raw$(configShallowCopy.QPS, configShallowCopy.Burst) - } - - var cs Clientset - var err error -$range .allGroups$ cs.$.LowerCaseGroupGoName$$.Version$, err =$.PackageAlias$.NewForConfigAndClient(&configShallowCopy, httpClient) - if err!=nil { - return nil, err - } -$end$ - cs.DiscoveryClient, err = $.NewDiscoveryClientForConfigAndClient|raw$(&configShallowCopy, httpClient) - if err!=nil { - return nil, err - } - return &cs, nil -} -` - -var newClientsetForConfigOrDieTemplate = ` -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *$.Config|raw$) *Clientset { - cs, err := NewForConfig(c) - if err!=nil { - panic(err) - } - return cs -} -` - -var newClientsetForRESTClientTemplate = ` -// New creates a new Clientset for the given RESTClient. -func New(c $.RESTClientInterface|raw$) *Clientset { - var cs Clientset -$range .allGroups$ cs.$.LowerCaseGroupGoName$$.Version$ =$.PackageAlias$.New(c) -$end$ - cs.DiscoveryClient = $.NewDiscoveryClient|raw$(c) - return &cs -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_expansion.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_expansion.go deleted file mode 100644 index f47c079e02fa..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_expansion.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "io" - "os" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" -) - -// genExpansion produces a file for a group client, e.g. ExtensionsClient for the extension group. -type genExpansion struct { - generator.DefaultGen - groupPackagePath string - // types in a group - types []*types.Type -} - -// We only want to call GenerateType() once per group. -func (g *genExpansion) Filter(c *generator.Context, t *types.Type) bool { - return len(g.types) == 0 || t == g.types[0] -} - -func (g *genExpansion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - for _, t := range g.types { - if _, err := os.Stat(filepath.Join(g.groupPackagePath, strings.ToLower(t.Name.Name+"_expansion.go"))); os.IsNotExist(err) { - sw.Do(expansionInterfaceTemplate, t) - } - } - return sw.Error() -} - -var expansionInterfaceTemplate = ` -type $.|public$Expansion interface {} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go deleted file mode 100644 index 30284990037a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go +++ /dev/null @@ -1,267 +0,0 @@ -/* -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 generators - -import ( - "io" - "path/filepath" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - "k8s.io/code-generator/cmd/client-gen/path" -) - -// genGroup produces a file for a group client, e.g. ExtensionsClient for the extension group. -type genGroup struct { - generator.DefaultGen - outputPackage string - group string - version string - groupGoName string - apiPath string - // types in this group - types []*types.Type - imports namer.ImportTracker - inputPackage string - clientsetPackage string - // If the genGroup has been called. This generator should only execute once. - called bool -} - -var _ generator.Generator = &genGroup{} - -// We only want to call GenerateType() once per group. -func (g *genGroup) Filter(c *generator.Context, t *types.Type) bool { - if !g.called { - g.called = true - return true - } - return false -} - -func (g *genGroup) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genGroup) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, filepath.Join(g.clientsetPackage, "scheme")) - return -} - -func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - apiPath := func(group string) string { - if group == "core" { - return `"/api"` - } - return `"` + g.apiPath + `"` - } - - groupName := g.group - if g.group == "core" { - groupName = "" - } - // allow user to define a group name that's different from the one parsed from the directory. - p := c.Universe.Package(path.Vendorless(g.inputPackage)) - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - groupName = override[0] - } - - m := map[string]interface{}{ - "group": g.group, - "version": g.version, - "groupName": groupName, - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "types": g.types, - "apiPath": apiPath(g.group), - "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), - "runtimeAPIVersionInternal": c.Universe.Variable(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "APIVersionInternal"}), - "restConfig": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), - "restDefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), - "restRESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "RESTHTTPClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "HTTPClientFor"}), - "restRESTClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClientFor"}), - "restRESTClientForConfigAndClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClientForConfigAndClient"}), - "SchemeGroupVersion": c.Universe.Variable(types.Name{Package: path.Vendorless(g.inputPackage), Name: "SchemeGroupVersion"}), - } - sw.Do(groupInterfaceTemplate, m) - sw.Do(groupClientTemplate, m) - for _, t := range g.types { - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - wrapper := map[string]interface{}{ - "type": t, - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - } - if tags.NonNamespaced { - sw.Do(getterImplNonNamespaced, wrapper) - } else { - sw.Do(getterImplNamespaced, wrapper) - } - } - sw.Do(newClientForConfigTemplate, m) - sw.Do(newClientForConfigAndClientTemplate, m) - sw.Do(newClientForConfigOrDieTemplate, m) - sw.Do(newClientForRESTClientTemplate, m) - if g.version == "" { - sw.Do(setInternalVersionClientDefaultsTemplate, m) - } else { - sw.Do(setClientDefaultsTemplate, m) - } - sw.Do(getRESTClient, m) - - return sw.Error() -} - -var groupInterfaceTemplate = ` -type $.GroupGoName$$.Version$Interface interface { - RESTClient() $.restRESTClientInterface|raw$ - $range .types$ $.|publicPlural$Getter - $end$ -} -` - -var groupClientTemplate = ` -// $.GroupGoName$$.Version$Client is used to interact with features provided by the $.groupName$ group. -type $.GroupGoName$$.Version$Client struct { - restClient $.restRESTClientInterface|raw$ -} -` - -var getterImplNamespaced = ` -func (c *$.GroupGoName$$.Version$Client) $.type|publicPlural$(namespace string) $.type|public$Interface { - return new$.type|publicPlural$(c, namespace) -} -` - -var getterImplNonNamespaced = ` -func (c *$.GroupGoName$$.Version$Client) $.type|publicPlural$() $.type|public$Interface { - return new$.type|publicPlural$(c) -} -` - -var newClientForConfigTemplate = ` -// NewForConfig creates a new $.GroupGoName$$.Version$Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *$.restConfig|raw$) (*$.GroupGoName$$.Version$Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := $.RESTHTTPClientFor|raw$(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} -` - -var newClientForConfigAndClientTemplate = ` -// NewForConfigAndClient creates a new $.GroupGoName$$.Version$Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *$.restConfig|raw$, h *http.Client) (*$.GroupGoName$$.Version$Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := $.restRESTClientForConfigAndClient|raw$(&config, h) - if err != nil { - return nil, err - } - return &$.GroupGoName$$.Version$Client{client}, nil -} -` - -var newClientForConfigOrDieTemplate = ` -// NewForConfigOrDie creates a new $.GroupGoName$$.Version$Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *$.restConfig|raw$) *$.GroupGoName$$.Version$Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} -` - -var getRESTClient = ` -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *$.GroupGoName$$.Version$Client) RESTClient() $.restRESTClientInterface|raw$ { - if c == nil { - return nil - } - return c.restClient -} -` - -var newClientForRESTClientTemplate = ` -// New creates a new $.GroupGoName$$.Version$Client for the given RESTClient. -func New(c $.restRESTClientInterface|raw$) *$.GroupGoName$$.Version$Client { - return &$.GroupGoName$$.Version$Client{c} -} -` - -var setInternalVersionClientDefaultsTemplate = ` -func setConfigDefaults(config *$.restConfig|raw$) error { - config.APIPath = $.apiPath$ - if config.UserAgent == "" { - config.UserAgent = $.restDefaultKubernetesUserAgent|raw$() - } - if config.GroupVersion == nil || config.GroupVersion.Group != scheme.Scheme.PrioritizedVersionsForGroup("$.groupName$")[0].Group { - gv := scheme.Scheme.PrioritizedVersionsForGroup("$.groupName$")[0] - config.GroupVersion = &gv - } - config.NegotiatedSerializer = scheme.Codecs - - if config.QPS == 0 { - config.QPS = 5 - } - if config.Burst == 0 { - config.Burst = 10 - } - - return nil -} -` - -var setClientDefaultsTemplate = ` -func setConfigDefaults(config *$.restConfig|raw$) error { - gv := $.SchemeGroupVersion|raw$ - config.GroupVersion = &gv - config.APIPath = $.apiPath$ - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = $.restDefaultKubernetesUserAgent|raw$() - } - - return nil -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go deleted file mode 100644 index fe63dd198956..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go +++ /dev/null @@ -1,760 +0,0 @@ -/* -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 generators - -import ( - "io" - "path" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// genClientForType produces a file for each top-level type. -type genClientForType struct { - generator.DefaultGen - outputPackage string - inputPackage string - clientsetPackage string - applyConfigurationPackage string - group string - version string - groupGoName string - typeToMatch *types.Type - imports namer.ImportTracker -} - -var _ generator.Generator = &genClientForType{} - -// Filter ignores all but one type because we're making a single file per type. -func (g *genClientForType) Filter(c *generator.Context, t *types.Type) bool { - return t == g.typeToMatch -} - -func (g *genClientForType) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genClientForType) Imports(c *generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -// Ideally, we'd like genStatus to return true if there is a subresource path -// registered for "status" in the API server, but we do not have that -// information, so genStatus returns true if the type has a status field. -func genStatus(t *types.Type) bool { - // Default to true if we have a Status member - hasStatus := false - for _, m := range t.Members { - if m.Name == "Status" { - hasStatus = true - break - } - } - return hasStatus && !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).NoStatus -} - -// GenerateType makes the body of a file implementing the individual typed client for type t. -func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - generateApply := len(g.applyConfigurationPackage) > 0 - defaultVerbTemplates := buildDefaultVerbTemplates(generateApply) - subresourceDefaultVerbTemplates := buildSubresourceDefaultVerbTemplates(generateApply) - sw := generator.NewSnippetWriter(w, c, "$", "$") - pkg := filepath.Base(t.Name.Package) - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - type extendedInterfaceMethod struct { - template string - args map[string]interface{} - } - _, typeGVString := util.ParsePathGroupVersion(g.inputPackage) - extendedMethods := []extendedInterfaceMethod{} - for _, e := range tags.Extensions { - if e.HasVerb("apply") && !generateApply { - continue - } - inputType := *t - resultType := *t - inputGVString := typeGVString - // TODO: Extract this to some helper method as this code is copied into - // 2 other places. - if len(e.InputTypeOverride) > 0 { - if name, pkg := e.Input(); len(pkg) > 0 { - _, inputGVString = util.ParsePathGroupVersion(pkg) - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - inputType = *newType - } else { - inputType.Name.Name = e.InputTypeOverride - } - } - if len(e.ResultTypeOverride) > 0 { - if name, pkg := e.Result(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - resultType = *newType - } else { - resultType.Name.Name = e.ResultTypeOverride - } - } - var updatedVerbtemplate string - if _, exists := subresourceDefaultVerbTemplates[e.VerbType]; e.IsSubresource() && exists { - updatedVerbtemplate = e.VerbName + "(" + strings.TrimPrefix(subresourceDefaultVerbTemplates[e.VerbType], strings.Title(e.VerbType)+"(") - } else { - updatedVerbtemplate = e.VerbName + "(" + strings.TrimPrefix(defaultVerbTemplates[e.VerbType], strings.Title(e.VerbType)+"(") - } - extendedMethod := extendedInterfaceMethod{ - template: updatedVerbtemplate, - args: map[string]interface{}{ - "type": t, - "inputType": &inputType, - "resultType": &resultType, - "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), - "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), - "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), - "ApplyOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ApplyOptions"}), - "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), - "jsonMarshal": c.Universe.Type(types.Name{Package: "encoding/json", Name: "Marshal"}), - }, - } - if e.HasVerb("apply") { - extendedMethod.args["inputApplyConfig"] = types.Ref(path.Join(g.applyConfigurationPackage, inputGVString), inputType.Name.Name+"ApplyConfiguration") - } - extendedMethods = append(extendedMethods, extendedMethod) - } - m := map[string]interface{}{ - "type": t, - "inputType": t, - "resultType": t, - "package": pkg, - "Package": namer.IC(pkg), - "namespaced": !tags.NonNamespaced, - "Group": namer.IC(g.group), - "subresource": false, - "subresourcePath": "", - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), - "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), - "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), - "PatchOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "PatchOptions"}), - "ApplyOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ApplyOptions"}), - "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), - "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), - "ApplyPatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "ApplyPatchType"}), - "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"}), - "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "schemeParameterCodec": c.Universe.Variable(types.Name{Package: filepath.Join(g.clientsetPackage, "scheme"), Name: "ParameterCodec"}), - "jsonMarshal": c.Universe.Type(types.Name{Package: "encoding/json", Name: "Marshal"}), - } - - if generateApply { - // Generated apply configuration type references required for generated Apply function - _, gvString := util.ParsePathGroupVersion(g.inputPackage) - m["inputApplyConfig"] = types.Ref(path.Join(g.applyConfigurationPackage, gvString), t.Name.Name+"ApplyConfiguration") - } - - sw.Do(getterComment, m) - if tags.NonNamespaced { - sw.Do(getterNonNamespaced, m) - } else { - sw.Do(getterNamespaced, m) - } - - sw.Do(interfaceTemplate1, m) - if !tags.NoVerbs { - if !genStatus(t) { - tags.SkipVerbs = append(tags.SkipVerbs, "updateStatus") - tags.SkipVerbs = append(tags.SkipVerbs, "applyStatus") - } - interfaceSuffix := "" - if len(extendedMethods) > 0 { - interfaceSuffix = "\n" - } - sw.Do("\n"+generateInterface(defaultVerbTemplates, tags)+interfaceSuffix, m) - // add extended verbs into interface - for _, v := range extendedMethods { - sw.Do(v.template+interfaceSuffix, v.args) - } - - } - sw.Do(interfaceTemplate4, m) - - if tags.NonNamespaced { - sw.Do(structNonNamespaced, m) - sw.Do(newStructNonNamespaced, m) - } else { - sw.Do(structNamespaced, m) - sw.Do(newStructNamespaced, m) - } - - if tags.NoVerbs { - return sw.Error() - } - - if tags.HasVerb("get") { - sw.Do(getTemplate, m) - } - if tags.HasVerb("list") { - sw.Do(listTemplate, m) - } - if tags.HasVerb("watch") { - sw.Do(watchTemplate, m) - } - - if tags.HasVerb("create") { - sw.Do(createTemplate, m) - } - if tags.HasVerb("update") { - sw.Do(updateTemplate, m) - } - if tags.HasVerb("updateStatus") { - sw.Do(updateStatusTemplate, m) - } - if tags.HasVerb("delete") { - sw.Do(deleteTemplate, m) - } - if tags.HasVerb("deleteCollection") { - sw.Do(deleteCollectionTemplate, m) - } - if tags.HasVerb("patch") { - sw.Do(patchTemplate, m) - } - if tags.HasVerb("apply") && generateApply { - sw.Do(applyTemplate, m) - } - if tags.HasVerb("applyStatus") && generateApply { - sw.Do(applyStatusTemplate, m) - } - - // generate expansion methods - for _, e := range tags.Extensions { - if e.HasVerb("apply") && !generateApply { - continue - } - inputType := *t - resultType := *t - inputGVString := typeGVString - if len(e.InputTypeOverride) > 0 { - if name, pkg := e.Input(); len(pkg) > 0 { - _, inputGVString = util.ParsePathGroupVersion(pkg) - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - inputType = *newType - } else { - inputType.Name.Name = e.InputTypeOverride - } - } - if len(e.ResultTypeOverride) > 0 { - if name, pkg := e.Result(); len(pkg) > 0 { - newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) - resultType = *newType - } else { - resultType.Name.Name = e.ResultTypeOverride - } - } - m["inputType"] = &inputType - m["resultType"] = &resultType - m["subresourcePath"] = e.SubResourcePath - if e.HasVerb("apply") { - m["inputApplyConfig"] = types.Ref(path.Join(g.applyConfigurationPackage, inputGVString), inputType.Name.Name+"ApplyConfiguration") - } - - if e.HasVerb("get") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getTemplate), m) - } - } - - if e.HasVerb("list") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, listSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, listTemplate), m) - } - } - - // TODO: Figure out schemantic for watching a sub-resource. - if e.HasVerb("watch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, watchTemplate), m) - } - - if e.HasVerb("create") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createTemplate), m) - } - } - - if e.HasVerb("update") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateSubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateTemplate), m) - } - } - - // TODO: Figure out schemantic for deleting a sub-resource (what arguments - // are passed, does it need two names? etc. - if e.HasVerb("delete") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, deleteTemplate), m) - } - - if e.HasVerb("patch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, patchTemplate), m) - } - - if e.HasVerb("apply") { - if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, applySubresourceTemplate), m) - } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, applyTemplate), m) - } - } - } - - return sw.Error() -} - -// adjustTemplate adjust the origin verb template using the expansion name. -// TODO: Make the verbs in templates parametrized so the strings.Replace() is -// not needed. -func adjustTemplate(name, verbType, template string) string { - return strings.Replace(template, " "+strings.Title(verbType), " "+name, -1) -} - -func generateInterface(defaultVerbTemplates map[string]string, tags util.Tags) string { - // need an ordered list here to guarantee order of generated methods. - out := []string{} - for _, m := range util.SupportedVerbs { - if tags.HasVerb(m) && len(defaultVerbTemplates[m]) > 0 { - out = append(out, defaultVerbTemplates[m]) - } - } - return strings.Join(out, "\n") -} - -func buildSubresourceDefaultVerbTemplates(generateApply bool) map[string]string { - m := map[string]string{ - "create": `Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, - "list": `List(ctx context.Context, $.type|private$Name string, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, - "update": `Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, - "get": `Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, - } - if generateApply { - m["apply"] = `Apply(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (*$.resultType|raw$, error)` - } - return m -} - -func buildDefaultVerbTemplates(generateApply bool) map[string]string { - m := map[string]string{ - "create": `Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, - "update": `Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, - "updateStatus": `UpdateStatus(ctx context.Context, $.inputType|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error)`, - "delete": `Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error`, - "deleteCollection": `DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`, - "get": `Get(ctx context.Context, name string, opts $.GetOptions|raw$) (*$.resultType|raw$, error)`, - "list": `List(ctx context.Context, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, - "watch": `Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`, - "patch": `Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error)`, - } - if generateApply { - m["apply"] = `Apply(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error)` - m["applyStatus"] = `ApplyStatus(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error)` - } - return m -} - -// group client will implement this interface. -var getterComment = ` -// $.type|publicPlural$Getter has a method to return a $.type|public$Interface. -// A group's client should implement this interface.` - -var getterNamespaced = ` -type $.type|publicPlural$Getter interface { - $.type|publicPlural$(namespace string) $.type|public$Interface -} -` - -var getterNonNamespaced = ` -type $.type|publicPlural$Getter interface { - $.type|publicPlural$() $.type|public$Interface -} -` - -// this type's interface, typed client will implement this interface. -var interfaceTemplate1 = ` -// $.type|public$Interface has methods to work with $.type|public$ resources. -type $.type|public$Interface interface {` - -var interfaceTemplate4 = ` - $.type|public$Expansion -} -` - -// template for the struct that implements the type's interface -var structNamespaced = ` -// $.type|privatePlural$ implements $.type|public$Interface -type $.type|privatePlural$ struct { - client $.RESTClientInterface|raw$ - ns string -} -` - -// template for the struct that implements the type's interface -var structNonNamespaced = ` -// $.type|privatePlural$ implements $.type|public$Interface -type $.type|privatePlural$ struct { - client $.RESTClientInterface|raw$ -} -` - -var newStructNamespaced = ` -// new$.type|publicPlural$ returns a $.type|publicPlural$ -func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ { - return &$.type|privatePlural${ - client: c.RESTClient(), - ns: namespace, - } -} -` - -var newStructNonNamespaced = ` -// new$.type|publicPlural$ returns a $.type|publicPlural$ -func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ { - return &$.type|privatePlural${ - client: c.RESTClient(), - } -} -` -var listTemplate = ` -// List takes label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil{ - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &$.resultType|raw$List{} - err = c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Timeout(timeout). - Do(ctx). - Into(result) - return -} -` - -var listSubresourceTemplate = ` -// List takes $.type|raw$ name, label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) List(ctx context.Context, $.type|private$Name string, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil{ - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &$.resultType|raw$List{} - err = c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Timeout(timeout). - Do(ctx). - Into(result) - return -} -` - -var getTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *$.type|privatePlural$) Get(ctx context.Context, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name(name). - VersionedParams(&options, $.schemeParameterCodec|raw$). - Do(ctx). - Into(result) - return -} -` - -var getSubresourceTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|raw$ object, and an error if there is any. -func (c *$.type|privatePlural$) Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - VersionedParams(&options, $.schemeParameterCodec|raw$). - Do(ctx). - Into(result) - return -} -` - -var deleteTemplate = ` -// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { - return c.client.Delete(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} -` - -var deleteCollectionTemplate = ` -// DeleteCollection deletes a collection of objects. -func (c *$.type|privatePlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil{ - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - VersionedParams(&listOpts, $.schemeParameterCodec|raw$). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} -` - -var createSubresourceTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Post(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Body($.inputType|private$). - Do(ctx). - Into(result) - return -} -` - -var createTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Post(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Body($.inputType|private$). - Do(ctx). - Into(result) - return -} -` - -var updateSubresourceTemplate = ` -// Update takes the top resource name and the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Put(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Body($.inputType|private$). - Do(ctx). - Into(result) - return -} -` - -var updateTemplate = ` -// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Put(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.inputType|private$.Name). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Body($.inputType|private$). - Do(ctx). - Into(result) - return -} -` - -var updateStatusTemplate = ` -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *$.type|privatePlural$) UpdateStatus(ctx context.Context, $.type|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (result *$.type|raw$, err error) { - result = &$.type|raw${} - err = c.client.Put(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$.Name). - SubResource("status"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Body($.type|private$). - Do(ctx). - Into(result) - return -} -` - -var watchTemplate = ` -// Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. -func (c *$.type|privatePlural$) Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil{ - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Timeout(timeout). - Watch(ctx) -} -` - -var patchTemplate = ` -// Patch applies the patch and returns the patched $.resultType|private$. -func (c *$.type|privatePlural$) Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { - result = &$.resultType|raw${} - err = c.client.Patch(pt). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, $.schemeParameterCodec|raw$). - Body(data). - Do(ctx). - Into(result) - return -} -` - -var applyTemplate = ` -// Apply takes the given apply declarative configuration, applies it and returns the applied $.resultType|private$. -func (c *$.type|privatePlural$) Apply(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { - if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := $.jsonMarshal|raw$($.inputType|private$) - if err != nil { - return nil, err - } - name := $.inputType|private$.Name - if name == nil { - return nil, fmt.Errorf("$.inputType|private$.Name must be provided to Apply") - } - result = &$.resultType|raw${} - err = c.client.Patch($.ApplyPatchType|raw$). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name(*name). - VersionedParams(&patchOpts, $.schemeParameterCodec|raw$). - Body(data). - Do(ctx). - Into(result) - return -} -` - -var applyStatusTemplate = ` -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *$.type|privatePlural$) ApplyStatus(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { - if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := $.jsonMarshal|raw$($.inputType|private$) - if err != nil { - return nil, err - } - - name := $.inputType|private$.Name - if name == nil { - return nil, fmt.Errorf("$.inputType|private$.Name must be provided to Apply") - } - - result = &$.resultType|raw${} - err = c.client.Patch($.ApplyPatchType|raw$). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, $.schemeParameterCodec|raw$). - Body(data). - Do(ctx). - Into(result) - return -} -` - -var applySubresourceTemplate = ` -// Apply takes top resource name and the apply declarative configuration for $.subresourcePath$, -// applies it and returns the applied $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Apply(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { - if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := $.jsonMarshal|raw$($.inputType|private$) - if err != nil { - return nil, err - } - - result = &$.resultType|raw${} - err = c.client.Patch($.ApplyPatchType|raw$). - $if .namespaced$Namespace(c.ns).$end$ - Resource("$.type|resource$"). - Name($.type|private$Name). - SubResource("$.subresourcePath$"). - VersionedParams(&patchOpts, $.schemeParameterCodec|raw$). - Body(data). - Do(ctx). - Into(result) - return -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go deleted file mode 100644 index a87d7571eb65..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go +++ /dev/null @@ -1,187 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 scheme - -import ( - "fmt" - "io" - "os" - "path/filepath" - "strings" - - "k8s.io/code-generator/cmd/client-gen/path" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// GenScheme produces a package for a clientset with the scheme, codecs and parameter codecs. -type GenScheme struct { - generator.DefaultGen - OutputPackage string - Groups []clientgentypes.GroupVersions - GroupGoNames map[clientgentypes.GroupVersion]string - InputPackages map[clientgentypes.GroupVersion]string - OutputPath string - ImportTracker namer.ImportTracker - PrivateScheme bool - CreateRegistry bool - schemeGenerated bool -} - -func (g *GenScheme) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.OutputPackage, g.ImportTracker), - } -} - -// We only want to call GenerateType() once. -func (g *GenScheme) Filter(c *generator.Context, t *types.Type) bool { - ret := !g.schemeGenerated - g.schemeGenerated = true - return ret -} - -func (g *GenScheme) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.ImportTracker.ImportLines()...) - for _, group := range g.Groups { - for _, version := range group.Versions { - packagePath := g.InputPackages[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}] - groupAlias := strings.ToLower(g.GroupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) - if g.CreateRegistry { - // import the install package for internal clientsets instead of the type package with register.go - if version.Version != "" { - packagePath = filepath.Dir(packagePath) - } - packagePath = filepath.Join(packagePath, "install") - - imports = append(imports, fmt.Sprintf("%s \"%s\"", groupAlias, path.Vendorless(packagePath))) - break - } else { - imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.Version.NonEmpty()), path.Vendorless(packagePath))) - } - } - } - return -} - -func (g *GenScheme) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - allGroupVersions := clientgentypes.ToGroupVersionInfo(g.Groups, g.GroupGoNames) - allInstallGroups := clientgentypes.ToGroupInstallPackages(g.Groups, g.GroupGoNames) - - m := map[string]interface{}{ - "publicScheme": !g.PrivateScheme, - "allGroupVersions": allGroupVersions, - "allInstallGroups": allInstallGroups, - "customRegister": false, - "runtimeNewParameterCodec": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "NewParameterCodec"}), - "runtimeNewScheme": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "NewScheme"}), - "serializerNewCodecFactory": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/serializer", Name: "NewCodecFactory"}), - "runtimeScheme": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Scheme"}), - "runtimeSchemeBuilder": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "SchemeBuilder"}), - "runtimeUtilMust": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/util/runtime", Name: "Must"}), - "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), - "metav1AddToGroupVersion": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), - } - globals := map[string]string{ - "Scheme": "Scheme", - "Codecs": "Codecs", - "ParameterCodec": "ParameterCodec", - "Registry": "Registry", - } - for k, v := range globals { - if g.PrivateScheme { - m[k] = strings.ToLower(v[0:1]) + v[1:] - } else { - m[k] = v - } - } - - sw.Do(globalsTemplate, m) - - if g.OutputPath != "" { - if _, err := os.Stat(filepath.Join(g.OutputPath, strings.ToLower("register_custom.go"))); err == nil { - m["customRegister"] = true - } - } - - if g.CreateRegistry { - sw.Do(registryRegistration, m) - } else { - sw.Do(simpleRegistration, m) - } - - return sw.Error() -} - -var globalsTemplate = ` -var $.Scheme$ = $.runtimeNewScheme|raw$() -var $.Codecs$ = $.serializerNewCodecFactory|raw$($.Scheme$) -$if .publicScheme$var $.ParameterCodec$ = $.runtimeNewParameterCodec|raw$($.Scheme$)$end -$` - -var registryRegistration = ` - -func init() { - $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) - Install($.Scheme$) -} - -// Install registers the API group and adds types to a scheme -func Install(scheme *$.runtimeScheme|raw$) { - $- range .allInstallGroups$ - $.InstallPackageAlias$.Install(scheme) - $- end$ - $if .customRegister$ - ExtraInstall(scheme) - $end -$ -} -` - -var simpleRegistration = ` -var localSchemeBuilder = $.runtimeSchemeBuilder|raw${ - $- range .allGroupVersions$ - $.PackageAlias$.AddToScheme, - $- end$ - $if .customRegister$ - ExtraAddToScheme, - $end -$ -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) - $.runtimeUtilMust|raw$(AddToScheme($.Scheme$)) -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/gvpackages.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/gvpackages.go deleted file mode 100644 index fcc1950909b4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/gvpackages.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -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 util - -import "strings" - -func ParsePathGroupVersion(pgvString string) (gvPath string, gvString string) { - subs := strings.Split(pgvString, "/") - length := len(subs) - switch length { - case 0, 1, 2: - return "", pgvString - default: - return strings.Join(subs[:length-2], "/"), strings.Join(subs[length-2:], "/") - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/tags.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/tags.go deleted file mode 100644 index e74de0776297..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/generators/util/tags.go +++ /dev/null @@ -1,344 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 util - -import ( - "errors" - "fmt" - "strings" - - "k8s.io/gengo/types" -) - -var supportedTags = []string{ - "genclient", - "genclient:nonNamespaced", - "genclient:noVerbs", - "genclient:onlyVerbs", - "genclient:skipVerbs", - "genclient:noStatus", - "genclient:readonly", - "genclient:method", -} - -// SupportedVerbs is a list of supported verbs for +onlyVerbs and +skipVerbs. -var SupportedVerbs = []string{ - "create", - "update", - "updateStatus", - "delete", - "deleteCollection", - "get", - "list", - "watch", - "patch", - "apply", - "applyStatus", -} - -// ReadonlyVerbs represents a list of read-only verbs. -var ReadonlyVerbs = []string{ - "get", - "list", - "watch", -} - -// genClientPrefix is the default prefix for all genclient tags. -const genClientPrefix = "genclient:" - -// unsupportedExtensionVerbs is a list of verbs we don't support generating -// extension client functions for. -var unsupportedExtensionVerbs = []string{ - "updateStatus", - "deleteCollection", - "watch", - "delete", -} - -// inputTypeSupportedVerbs is a list of verb types that supports overriding the -// input argument type. -var inputTypeSupportedVerbs = []string{ - "create", - "update", - "apply", -} - -// resultTypeSupportedVerbs is a list of verb types that supports overriding the -// resulting type. -var resultTypeSupportedVerbs = []string{ - "create", - "update", - "get", - "list", - "patch", - "apply", -} - -// Extensions allows to extend the default set of client verbs -// (CRUD+watch+patch+list+deleteCollection) for a given type with custom defined -// verbs. Custom verbs can have custom input and result types and also allow to -// use a sub-resource in a request instead of top-level resource type. -// -// Example: -// -// +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale -// -// type ReplicaSet struct { ... } -// -// The 'method=UpdateScale' is the name of the client function. -// The 'verb=update' here means the client function will use 'PUT' action. -// The 'subresource=scale' means we will use SubResource template to generate this client function. -// The 'input' is the input type used for creation (function argument). -// The 'result' (not needed in this case) is the result type returned from the -// client function. -type extension struct { - // VerbName is the name of the custom verb (Scale, Instantiate, etc..) - VerbName string - // VerbType is the type of the verb (only verbs from SupportedVerbs are - // supported) - VerbType string - // SubResourcePath defines a path to a sub-resource to use in the request. - // (optional) - SubResourcePath string - // InputTypeOverride overrides the input parameter type for the verb. By - // default the original type is used. Overriding the input type only works for - // "create" and "update" verb types. The given type must exists in the same - // package as the original type. - // (optional) - InputTypeOverride string - // ResultTypeOverride overrides the resulting object type for the verb. By - // default the original type is used. Overriding the result type works. - // (optional) - ResultTypeOverride string -} - -// IsSubresource indicates if this extension should generate the sub-resource. -func (e *extension) IsSubresource() bool { - return len(e.SubResourcePath) > 0 -} - -// HasVerb checks if the extension matches the given verb. -func (e *extension) HasVerb(verb string) bool { - return e.VerbType == verb -} - -// Input returns the input override package path and the type. -func (e *extension) Input() (string, string) { - parts := strings.Split(e.InputTypeOverride, ".") - return parts[len(parts)-1], strings.Join(parts[0:len(parts)-1], ".") -} - -// Result returns the result override package path and the type. -func (e *extension) Result() (string, string) { - parts := strings.Split(e.ResultTypeOverride, ".") - return parts[len(parts)-1], strings.Join(parts[0:len(parts)-1], ".") -} - -// Tags represents a genclient configuration for a single type. -type Tags struct { - // +genclient - GenerateClient bool - // +genclient:nonNamespaced - NonNamespaced bool - // +genclient:noStatus - NoStatus bool - // +genclient:noVerbs - NoVerbs bool - // +genclient:skipVerbs=get,update - // +genclient:onlyVerbs=create,delete - SkipVerbs []string - // +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale - Extensions []extension -} - -// HasVerb returns true if we should include the given verb in final client interface and -// generate the function for it. -func (t Tags) HasVerb(verb string) bool { - if len(t.SkipVerbs) == 0 { - return true - } - for _, s := range t.SkipVerbs { - if verb == s { - return false - } - } - return true -} - -// MustParseClientGenTags calls ParseClientGenTags but instead of returning error it panics. -func MustParseClientGenTags(lines []string) Tags { - tags, err := ParseClientGenTags(lines) - if err != nil { - panic(err.Error()) - } - return tags -} - -// ParseClientGenTags parse the provided genclient tags and validates that no unknown -// tags are provided. -func ParseClientGenTags(lines []string) (Tags, error) { - ret := Tags{} - values := types.ExtractCommentTags("+", lines) - var value []string - value, ret.GenerateClient = values["genclient"] - // Check the old format and error when used to avoid generating client when //+genclient=false - if len(value) > 0 && len(value[0]) > 0 { - return ret, fmt.Errorf("+genclient=%s is invalid, use //+genclient if you want to generate client or omit it when you want to disable generation", value) - } - _, ret.NonNamespaced = values[genClientPrefix+"nonNamespaced"] - // Check the old format and error when used - if value := values["nonNamespaced"]; len(value) > 0 && len(value[0]) > 0 { - return ret, fmt.Errorf("+nonNamespaced=%s is invalid, use //+genclient:nonNamespaced instead", value[0]) - } - _, ret.NoVerbs = values[genClientPrefix+"noVerbs"] - _, ret.NoStatus = values[genClientPrefix+"noStatus"] - onlyVerbs := []string{} - if _, isReadonly := values[genClientPrefix+"readonly"]; isReadonly { - onlyVerbs = ReadonlyVerbs - } - // Check the old format and error when used - if value := values["readonly"]; len(value) > 0 && len(value[0]) > 0 { - return ret, fmt.Errorf("+readonly=%s is invalid, use //+genclient:readonly instead", value[0]) - } - if v, exists := values[genClientPrefix+"skipVerbs"]; exists { - ret.SkipVerbs = strings.Split(v[0], ",") - } - if v, exists := values[genClientPrefix+"onlyVerbs"]; exists || len(onlyVerbs) > 0 { - if len(v) > 0 { - onlyVerbs = append(onlyVerbs, strings.Split(v[0], ",")...) - } - skipVerbs := []string{} - for _, m := range SupportedVerbs { - skip := true - for _, o := range onlyVerbs { - if o == m { - skip = false - break - } - } - // Check for conflicts - for _, v := range skipVerbs { - if v == m { - return ret, fmt.Errorf("verb %q used both in genclient:skipVerbs and genclient:onlyVerbs", v) - } - } - if skip { - skipVerbs = append(skipVerbs, m) - } - } - ret.SkipVerbs = skipVerbs - } - var err error - if ret.Extensions, err = parseClientExtensions(values); err != nil { - return ret, err - } - return ret, validateClientGenTags(values) -} - -func parseClientExtensions(tags map[string][]string) ([]extension, error) { - var ret []extension - for name, values := range tags { - if !strings.HasPrefix(name, genClientPrefix+"method") { - continue - } - for _, value := range values { - // the value comes in this form: "Foo,verb=create" - ext := extension{} - parts := strings.Split(value, ",") - if len(parts) == 0 { - return nil, fmt.Errorf("invalid of empty extension verb name: %q", value) - } - // The first part represents the name of the extension - ext.VerbName = parts[0] - if len(ext.VerbName) == 0 { - return nil, fmt.Errorf("must specify a verb name (// +genclient:method=Foo,verb=create)") - } - // Parse rest of the arguments - params := parts[1:] - for _, p := range params { - parts := strings.Split(p, "=") - if len(parts) != 2 { - return nil, fmt.Errorf("invalid extension tag specification %q", p) - } - key, val := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1]) - if len(val) == 0 { - return nil, fmt.Errorf("empty value of %q for %q extension", key, ext.VerbName) - } - switch key { - case "verb": - ext.VerbType = val - case "subresource": - ext.SubResourcePath = val - case "input": - ext.InputTypeOverride = val - case "result": - ext.ResultTypeOverride = val - default: - return nil, fmt.Errorf("unknown extension configuration key %q", key) - } - } - // Validate resulting extension configuration - if len(ext.VerbType) == 0 { - return nil, fmt.Errorf("verb type must be specified (use '// +genclient:method=%s,verb=create')", ext.VerbName) - } - if len(ext.ResultTypeOverride) > 0 { - supported := false - for _, v := range resultTypeSupportedVerbs { - if ext.VerbType == v { - supported = true - break - } - } - if !supported { - return nil, fmt.Errorf("%s: result type is not supported for %q verbs (supported verbs: %#v)", ext.VerbName, ext.VerbType, resultTypeSupportedVerbs) - } - } - if len(ext.InputTypeOverride) > 0 { - supported := false - for _, v := range inputTypeSupportedVerbs { - if ext.VerbType == v { - supported = true - break - } - } - if !supported { - return nil, fmt.Errorf("%s: input type is not supported for %q verbs (supported verbs: %#v)", ext.VerbName, ext.VerbType, inputTypeSupportedVerbs) - } - } - for _, t := range unsupportedExtensionVerbs { - if ext.VerbType == t { - return nil, fmt.Errorf("verb %q is not supported by extension generator", ext.VerbType) - } - } - ret = append(ret, ext) - } - } - return ret, nil -} - -// validateTags validates that only supported genclient tags were provided. -func validateClientGenTags(values map[string][]string) error { - for _, k := range supportedTags { - delete(values, k) - } - for key := range values { - if strings.HasPrefix(key, strings.TrimSuffix(genClientPrefix, ":")) { - return errors.New("unknown tag detected: " + key) - } - } - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/main.go deleted file mode 100644 index 64a1274dfc0c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/main.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -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. -*/ - -// client-gen makes the individual typed clients using gengo. -package main - -import ( - "flag" - - "github.com/spf13/pflag" - "k8s.io/klog/v2" - - generatorargs "k8s.io/code-generator/cmd/client-gen/args" - "k8s.io/code-generator/cmd/client-gen/generators" - "k8s.io/code-generator/pkg/util" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move this out of client-gen - genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/clientset_generated/" - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine, "k8s.io/kubernetes/pkg/apis") // TODO: move this input path out of client-gen - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - // add group version package as input dirs for gengo - for _, pkg := range customArgs.Groups { - for _, v := range pkg.Versions { - genericArgs.InputDirs = append(genericArgs.InputDirs, v.Package) - } - } - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - if err := genericArgs.Execute( - generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/path/path.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/path/path.go deleted file mode 100644 index 19b269bdf28a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/path/path.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 path - -import "strings" - -// Vendorless removes the longest match of "*/vendor/" from the front of p. -// It is useful if a package locates in vendor/, e.g., -// k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1, because gengo -// indexes the package with its import path, e.g., -// k8s.io/apimachinery/pkg/apis/meta/v1, -func Vendorless(p string) string { - if pos := strings.LastIndex(p, "/vendor/"); pos != -1 { - return p[pos+len("/vendor/"):] - } - return p -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go deleted file mode 100644 index 59f2fd4449bd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/types/helpers.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 types - -import ( - "fmt" - "regexp" - "sort" - "strings" - - "k8s.io/gengo/namer" -) - -// ToGroupVersion turns "group/version" string into a GroupVersion struct. It reports error -// if it cannot parse the string. -func ToGroupVersion(gv string) (GroupVersion, error) { - // this can be the internal version for the legacy kube types - // TODO once we've cleared the last uses as strings, this special case should be removed. - if (len(gv) == 0) || (gv == "/") { - return GroupVersion{}, nil - } - - switch strings.Count(gv, "/") { - case 0: - return GroupVersion{Group(gv), ""}, nil - case 1: - i := strings.Index(gv, "/") - return GroupVersion{Group(gv[:i]), Version(gv[i+1:])}, nil - default: - return GroupVersion{}, fmt.Errorf("unexpected GroupVersion string: %v", gv) - } -} - -type sortableSliceOfVersions []string - -func (a sortableSliceOfVersions) Len() int { return len(a) } -func (a sortableSliceOfVersions) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a sortableSliceOfVersions) Less(i, j int) bool { - vi, vj := strings.TrimLeft(a[i], "v"), strings.TrimLeft(a[j], "v") - major := regexp.MustCompile("^[0-9]+") - viMajor, vjMajor := major.FindString(vi), major.FindString(vj) - viRemaining, vjRemaining := strings.TrimLeft(vi, viMajor), strings.TrimLeft(vj, vjMajor) - switch { - case len(viRemaining) == 0 && len(vjRemaining) == 0: - return viMajor < vjMajor - case len(viRemaining) == 0 && len(vjRemaining) != 0: - // stable version is greater than unstable version - return false - case len(viRemaining) != 0 && len(vjRemaining) == 0: - // stable version is greater than unstable version - return true - } - // neither are stable versions - if viMajor != vjMajor { - return viMajor < vjMajor - } - // assuming at most we have one alpha or one beta version, so if vi contains "alpha", it's the lesser one. - return strings.Contains(viRemaining, "alpha") -} - -// Determine the default version among versions. If a user calls a group client -// without specifying the version (e.g., c.CoreV1(), instead of c.CoreV1()), the -// default version will be returned. -func defaultVersion(versions []PackageVersion) Version { - var versionStrings []string - for _, version := range versions { - versionStrings = append(versionStrings, version.Version.String()) - } - sort.Sort(sortableSliceOfVersions(versionStrings)) - return Version(versionStrings[len(versionStrings)-1]) -} - -// ToGroupVersionInfo is a helper function used by generators for groups. -func ToGroupVersionInfo(groups []GroupVersions, groupGoNames map[GroupVersion]string) []GroupVersionInfo { - var groupVersionPackages []GroupVersionInfo - for _, group := range groups { - for _, version := range group.Versions { - groupGoName := groupGoNames[GroupVersion{Group: group.Group, Version: version.Version}] - groupVersionPackages = append(groupVersionPackages, GroupVersionInfo{ - Group: Group(namer.IC(group.Group.NonEmpty())), - Version: Version(namer.IC(version.Version.String())), - PackageAlias: strings.ToLower(groupGoName + version.Version.NonEmpty()), - GroupGoName: groupGoName, - LowerCaseGroupGoName: namer.IL(groupGoName), - }) - } - } - return groupVersionPackages -} - -func ToGroupInstallPackages(groups []GroupVersions, groupGoNames map[GroupVersion]string) []GroupInstallPackage { - var groupInstallPackages []GroupInstallPackage - for _, group := range groups { - defaultVersion := defaultVersion(group.Versions) - groupGoName := groupGoNames[GroupVersion{Group: group.Group, Version: defaultVersion}] - groupInstallPackages = append(groupInstallPackages, GroupInstallPackage{ - Group: Group(namer.IC(group.Group.NonEmpty())), - InstallPackageAlias: strings.ToLower(groupGoName), - }) - } - return groupInstallPackages -} - -// NormalizeGroupVersion calls normalizes the GroupVersion. -//func NormalizeGroupVersion(gv GroupVersion) GroupVersion { -// return GroupVersion{Group: gv.Group.NonEmpty(), Version: gv.Version, NonEmptyVersion: normalization.Version(gv.Version)} -//} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go deleted file mode 100644 index a5cc37cf7fc8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/client-gen/types/types.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 types - -import "strings" - -type Version string - -func (v Version) String() string { - return string(v) -} - -func (v Version) NonEmpty() string { - if v == "" { - return "internalVersion" - } - return v.String() -} - -func (v Version) PackageName() string { - return strings.ToLower(v.NonEmpty()) -} - -type Group string - -func (g Group) String() string { - return string(g) -} - -func (g Group) NonEmpty() string { - if g == "api" { - return "core" - } - return string(g) -} - -func (g Group) PackageName() string { - parts := strings.Split(g.NonEmpty(), ".") - if parts[0] == "internal" && len(parts) > 1 { - return strings.ToLower(parts[1] + parts[0]) - } - return strings.ToLower(parts[0]) -} - -type PackageVersion struct { - Version - // The fully qualified package, e.g. k8s.io/kubernetes/pkg/apis/apps, where the types.go is found. - Package string -} - -type GroupVersion struct { - Group Group - Version Version -} - -func (gv GroupVersion) ToAPIVersion() string { - if len(gv.Group) > 0 && gv.Group.NonEmpty() != "core" { - return gv.Group.String() + "/" + gv.Version.String() - } else { - return gv.Version.String() - } -} - -type GroupVersions struct { - // The name of the package for this group, e.g. apps. - PackageName string - Group Group - Versions []PackageVersion -} - -// GroupVersionInfo contains all the info around a group version. -type GroupVersionInfo struct { - Group Group - Version Version - PackageAlias string - GroupGoName string - LowerCaseGroupGoName string -} - -type GroupInstallPackage struct { - Group Group - InstallPackageAlias string -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go deleted file mode 100644 index c69280b10632..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/args/args.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "fmt" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" -) - -// DefaultBasePeerDirs are the peer-dirs nearly everybody will use, i.e. those coming from -// apimachinery. -var DefaultBasePeerDirs = []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1", - "k8s.io/apimachinery/pkg/conversion", - "k8s.io/apimachinery/pkg/runtime", -} - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct { - // Base peer dirs which nearly everybody will use, i.e. outside of Kubernetes core. Peer dirs - // are declared to make the generator pick up manually written conversion funcs from external - // packages. - BasePeerDirs []string - - // Custom peer dirs which are application specific. Peer dirs are declared to make the - // generator pick up manually written conversion funcs from external packages. - ExtraPeerDirs []string - - // Additional dirs to parse and load, but not consider for peers. This is - // useful when packages depend on other packages and want to call - // conversions across them. - ExtraDirs []string - - // SkipUnsafe indicates whether to generate unsafe conversions to improve the efficiency - // of these operations. The unsafe operation is a direct pointer assignment via unsafe - // (within the allowed uses of unsafe) and is equivalent to a proposed Golang change to - // allow structs that are identical to be assigned to each other. - SkipUnsafe bool -} - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{ - BasePeerDirs: DefaultBasePeerDirs, - SkipUnsafe: false, - } - genericArgs.CustomArgs = customArgs - genericArgs.OutputFileBaseName = "conversion_generated" - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - pflag.CommandLine.StringSliceVar(&ca.BasePeerDirs, "base-peer-dirs", ca.BasePeerDirs, - "Comma-separated list of apimachinery import paths which are considered, after tag-specified peers, for conversions. Only change these if you have very good reasons.") - pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs, - "Application specific comma-separated list of import paths which are considered, after tag-specified peers and base-peer-dirs, for conversions.") - pflag.CommandLine.StringSliceVar(&ca.ExtraDirs, "extra-dirs", ca.ExtraDirs, - "Application specific comma-separated list of import paths which are loaded and considered for callable conversions, but are not considered peers for conversion.") - pflag.CommandLine.BoolVar(&ca.SkipUnsafe, "skip-unsafe", ca.SkipUnsafe, - "If true, will not generate code using unsafe pointer conversions; resulting code may be slower.") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go deleted file mode 100644 index 5b7347971f16..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go +++ /dev/null @@ -1,1222 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "bytes" - "fmt" - "io" - "path/filepath" - "reflect" - "sort" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" - - conversionargs "k8s.io/code-generator/cmd/conversion-gen/args" - genutil "k8s.io/code-generator/pkg/util" -) - -// These are the comment tags that carry parameters for conversion generation. -const ( - // e.g., "+k8s:conversion-gen=" in doc.go, where is the - // import path of the package the peer types are defined in. - // e.g., "+k8s:conversion-gen=false" in a type's comment will let - // conversion-gen skip that type. - tagName = "k8s:conversion-gen" - // e.g. "+k8s:conversion-gen:explicit-from=net/url.Values" in the type comment - // will result in generating conversion from net/url.Values. - explicitFromTagName = "k8s:conversion-gen:explicit-from" - // e.g., "+k8s:conversion-gen-external-types=" in doc.go, where - // is the relative path to the package the types are defined in. - externalTypesTagName = "k8s:conversion-gen-external-types" -) - -func extractTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[tagName] -} - -func extractExplicitFromTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[explicitFromTagName] -} - -func extractExternalTypesTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[externalTypesTagName] -} - -func isCopyOnly(comments []string) bool { - values := types.ExtractCommentTags("+", comments)["k8s:conversion-fn"] - return len(values) == 1 && values[0] == "copy-only" -} - -func isDrop(comments []string) bool { - values := types.ExtractCommentTags("+", comments)["k8s:conversion-fn"] - return len(values) == 1 && values[0] == "drop" -} - -// TODO: This is created only to reduce number of changes in a single PR. -// Remove it and use PublicNamer instead. -func conversionNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Join: func(pre string, in []string, post string) string { - return strings.Join(in, "_") - }, - PrependPackageNames: 1, - } -} - -func defaultFnNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Prefix: "SetDefaults_", - Join: func(pre string, in []string, post string) string { - return pre + strings.Join(in, "_") + post - }, - } -} - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": conversionNamer(), - "raw": namer.NewRawNamer("", nil), - "defaultfn": defaultFnNamer(), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -func getPeerTypeFor(context *generator.Context, t *types.Type, potenialPeerPkgs []string) *types.Type { - for _, ppp := range potenialPeerPkgs { - p := context.Universe.Package(ppp) - if p == nil { - continue - } - if p.Has(t.Name.Name) { - return p.Type(t.Name.Name) - } - } - return nil -} - -type conversionPair struct { - inType *types.Type - outType *types.Type -} - -// All of the types in conversions map are of type "DeclarationOf" with -// the underlying type being "Func". -type conversionFuncMap map[conversionPair]*types.Type - -// Returns all manually-defined conversion functions in the package. -func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) { - if pkg == nil { - klog.Warning("Skipping nil package passed to getManualConversionFunctions") - return - } - klog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name) - - scopeName := types.Ref(conversionPackagePath, "Scope").Name - errorName := types.Ref("", "error").Name - buffer := &bytes.Buffer{} - sw := generator.NewSnippetWriter(buffer, context, "$", "$") - - for _, f := range pkg.Functions { - if f.Underlying == nil || f.Underlying.Kind != types.Func { - klog.Errorf("Malformed function: %#v", f) - continue - } - if f.Underlying.Signature == nil { - klog.Errorf("Function without signature: %#v", f) - continue - } - klog.V(8).Infof("Considering function %s", f.Name) - signature := f.Underlying.Signature - // Check whether the function is conversion function. - // Note that all of them have signature: - // func Convert_inType_To_outType(inType, outType, conversion.Scope) error - if signature.Receiver != nil { - klog.V(8).Infof("%s has a receiver", f.Name) - continue - } - if len(signature.Parameters) != 3 || signature.Parameters[2].Name != scopeName { - klog.V(8).Infof("%s has wrong parameters", f.Name) - continue - } - if len(signature.Results) != 1 || signature.Results[0].Name != errorName { - klog.V(8).Infof("%s has wrong results", f.Name) - continue - } - inType := signature.Parameters[0] - outType := signature.Parameters[1] - if inType.Kind != types.Pointer || outType.Kind != types.Pointer { - klog.V(8).Infof("%s has wrong parameter types", f.Name) - continue - } - // Now check if the name satisfies the convention. - // TODO: This should call the Namer directly. - args := argsFromType(inType.Elem, outType.Elem) - sw.Do("Convert_$.inType|public$_To_$.outType|public$", args) - if f.Name.Name == buffer.String() { - klog.V(4).Infof("Found conversion function %s", f.Name) - key := conversionPair{inType.Elem, outType.Elem} - // We might scan the same package twice, and that's OK. - if v, ok := manualMap[key]; ok && v != nil && v.Name.Package != pkg.Path { - panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s from:\n%s.%s\n%s.%s", key.inType, key.outType, v.Name.Package, v.Name.Name, f.Name.Package, f.Name.Name)) - } - manualMap[key] = f - } else { - // prevent user error when they don't get the correct conversion signature - if strings.HasPrefix(f.Name.Name, "Convert_") { - klog.Errorf("Rename function %s %s -> %s to match expected conversion signature", f.Name.Package, f.Name.Name, buffer.String()) - } - klog.V(8).Infof("%s has wrong name", f.Name) - } - buffer.Reset() - } -} - -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - packages := generator.Packages{} - header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - - // Accumulate pre-existing conversion functions. - // TODO: This is too ad-hoc. We need a better way. - manualConversions := conversionFuncMap{} - - // Record types that are memory equivalent. A type is memory equivalent - // if it has the same memory layout and no nested manual conversion is - // defined. - // TODO: in the future, relax the nested manual conversion requirement - // if we can show that a large enough types are memory identical but - // have non-trivial conversion - memoryEquivalentTypes := equalMemoryTypes{} - - // We are generating conversions only for packages that are explicitly - // passed as InputDir. - processed := map[string]bool{} - for _, i := range context.Inputs { - // skip duplicates - if processed[i] { - continue - } - processed[i] = true - - klog.V(5).Infof("considering pkg %q", i) - pkg := context.Universe[i] - // typesPkg is where the versioned types are defined. Sometimes it is - // different from pkg. For example, kubernetes core/v1 types are defined - // in vendor/k8s.io/api/core/v1, while pkg is at pkg/api/v1. - typesPkg := pkg - if pkg == nil { - // If the input had no Go files, for example. - continue - } - - // Add conversion and defaulting functions. - getManualConversionFunctions(context, pkg, manualConversions) - - // Only generate conversions for packages which explicitly request it - // by specifying one or more "+k8s:conversion-gen=" - // in their doc.go file. - peerPkgs := extractTag(pkg.Comments) - if peerPkgs != nil { - klog.V(5).Infof(" tags: %q", peerPkgs) - if len(peerPkgs) == 1 && peerPkgs[0] == "false" { - // If a single +k8s:conversion-gen=false tag is defined, we still want - // the generator to fire for this package for explicit conversions, but - // we are clearing the peerPkgs to not generate any standard conversions. - peerPkgs = nil - } - } else { - klog.V(5).Infof(" no tag") - continue - } - skipUnsafe := false - extraDirs := []string{} - if customArgs, ok := arguments.CustomArgs.(*conversionargs.CustomArgs); ok { - if len(peerPkgs) > 0 { - peerPkgs = append(peerPkgs, customArgs.BasePeerDirs...) - peerPkgs = append(peerPkgs, customArgs.ExtraPeerDirs...) - } - extraDirs = customArgs.ExtraDirs - skipUnsafe = customArgs.SkipUnsafe - } - - // if the external types are not in the same package where the conversion functions to be generated - externalTypesValues := extractExternalTypesTag(pkg.Comments) - if externalTypesValues != nil { - if len(externalTypesValues) != 1 { - klog.Fatalf(" expect only one value for %q tag, got: %q", externalTypesTagName, externalTypesValues) - } - externalTypes := externalTypesValues[0] - klog.V(5).Infof(" external types tags: %q", externalTypes) - var err error - typesPkg, err = context.AddDirectory(externalTypes) - if err != nil { - klog.Fatalf("cannot import package %s", externalTypes) - } - // update context.Order to the latest context.Universe - orderer := namer.Orderer{Namer: namer.NewPublicNamer(1)} - context.Order = orderer.OrderUniverse(context.Universe) - } - - // if the source path is within a /vendor/ directory (for example, - // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow - // generation to output to the proper relative path (under vendor). - // Otherwise, the generator will create the file in the wrong location - // in the output directory. - // TODO: build a more fundamental concept in gengo for dealing with modifications - // to vendored packages. - for i := range peerPkgs { - peerPkgs[i] = genutil.Vendorless(peerPkgs[i]) - } - for i := range extraDirs { - extraDirs[i] = genutil.Vendorless(extraDirs[i]) - } - - // Make sure our peer-packages are added and fully parsed. - for _, pp := range append(peerPkgs, extraDirs...) { - context.AddDir(pp) - p := context.Universe[pp] - if nil == p { - klog.Fatalf("failed to find pkg: %s", pp) - } - getManualConversionFunctions(context, p, manualConversions) - } - - unsafeEquality := TypesEqual(memoryEquivalentTypes) - if skipUnsafe { - unsafeEquality = noEquality{} - } - - path := pkg.Path - // if the source path is within a /vendor/ directory (for example, - // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow - // generation to output to the proper relative path (under vendor). - // Otherwise, the generator will create the file in the wrong location - // in the output directory. - // TODO: build a more fundamental concept in gengo for dealing with modifications - // to vendored packages. - if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { - expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) - if strings.Contains(expandedPath, "/vendor/") { - path = expandedPath - } - } - packages = append(packages, - &generator.DefaultPackage{ - PackageName: filepath.Base(pkg.Path), - PackagePath: path, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - NewGenConversion(arguments.OutputFileBaseName, typesPkg.Path, pkg.Path, manualConversions, peerPkgs, unsafeEquality), - } - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return t.Name.Package == typesPkg.Path - }, - }) - } - - // If there is a manual conversion defined between two types, exclude it - // from being a candidate for unsafe conversion - for k, v := range manualConversions { - if isCopyOnly(v.CommentLines) { - klog.V(5).Infof("Conversion function %s will not block memory copy because it is copy-only", v.Name) - continue - } - // this type should be excluded from all equivalence, because the converter must be called. - memoryEquivalentTypes.Skip(k.inType, k.outType) - } - - return packages -} - -type equalMemoryTypes map[conversionPair]bool - -func (e equalMemoryTypes) Skip(a, b *types.Type) { - e[conversionPair{a, b}] = false - e[conversionPair{b, a}] = false -} - -func (e equalMemoryTypes) Equal(a, b *types.Type) bool { - // alreadyVisitedTypes holds all the types that have already been checked in the structural type recursion. - alreadyVisitedTypes := make(map[*types.Type]bool) - return e.cachingEqual(a, b, alreadyVisitedTypes) -} - -func (e equalMemoryTypes) cachingEqual(a, b *types.Type, alreadyVisitedTypes map[*types.Type]bool) bool { - if a == b { - return true - } - if equal, ok := e[conversionPair{a, b}]; ok { - return equal - } - if equal, ok := e[conversionPair{b, a}]; ok { - return equal - } - result := e.equal(a, b, alreadyVisitedTypes) - e[conversionPair{a, b}] = result - e[conversionPair{b, a}] = result - return result -} - -func (e equalMemoryTypes) equal(a, b *types.Type, alreadyVisitedTypes map[*types.Type]bool) bool { - in, out := unwrapAlias(a), unwrapAlias(b) - switch { - case in == out: - return true - case in.Kind == out.Kind: - // if the type exists already, return early to avoid recursion - if alreadyVisitedTypes[in] { - return true - } - alreadyVisitedTypes[in] = true - - switch in.Kind { - case types.Struct: - if len(in.Members) != len(out.Members) { - return false - } - for i, inMember := range in.Members { - outMember := out.Members[i] - if !e.cachingEqual(inMember.Type, outMember.Type, alreadyVisitedTypes) { - return false - } - } - return true - case types.Pointer: - return e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) - case types.Map: - return e.cachingEqual(in.Key, out.Key, alreadyVisitedTypes) && e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) - case types.Slice: - return e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) - case types.Interface: - // TODO: determine whether the interfaces are actually equivalent - for now, they must have the - // same type. - return false - case types.Builtin: - return in.Name.Name == out.Name.Name - } - } - return false -} - -func findMember(t *types.Type, name string) (types.Member, bool) { - if t.Kind != types.Struct { - return types.Member{}, false - } - for _, member := range t.Members { - if member.Name == name { - return member, true - } - } - return types.Member{}, false -} - -// unwrapAlias recurses down aliased types to find the bedrock type. -func unwrapAlias(in *types.Type) *types.Type { - for in.Kind == types.Alias { - in = in.Underlying - } - return in -} - -const ( - runtimePackagePath = "k8s.io/apimachinery/pkg/runtime" - conversionPackagePath = "k8s.io/apimachinery/pkg/conversion" -) - -type noEquality struct{} - -func (noEquality) Equal(_, _ *types.Type) bool { return false } - -type TypesEqual interface { - Equal(a, b *types.Type) bool -} - -// genConversion produces a file with a autogenerated conversions. -type genConversion struct { - generator.DefaultGen - // the package that contains the types that conversion func are going to be - // generated for - typesPackage string - // the package that the conversion funcs are going to be output to - outputPackage string - // packages that contain the peer of types in typesPacakge - peerPackages []string - manualConversions conversionFuncMap - imports namer.ImportTracker - types []*types.Type - explicitConversions []conversionPair - skippedFields map[*types.Type][]string - useUnsafe TypesEqual -} - -func NewGenConversion(sanitizedName, typesPackage, outputPackage string, manualConversions conversionFuncMap, peerPkgs []string, useUnsafe TypesEqual) generator.Generator { - return &genConversion{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, - }, - typesPackage: typesPackage, - outputPackage: outputPackage, - peerPackages: peerPkgs, - manualConversions: manualConversions, - imports: generator.NewImportTracker(), - types: []*types.Type{}, - explicitConversions: []conversionPair{}, - skippedFields: map[*types.Type][]string{}, - useUnsafe: useUnsafe, - } -} - -func (g *genConversion) Namers(c *generator.Context) namer.NameSystems { - // Have the raw namer for this file track what it imports. - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - "publicIT": &namerPlusImportTracking{ - delegate: conversionNamer(), - tracker: g.imports, - }, - } -} - -type namerPlusImportTracking struct { - delegate namer.Namer - tracker namer.ImportTracker -} - -func (n *namerPlusImportTracking) Name(t *types.Type) string { - n.tracker.AddType(t) - return n.delegate.Name(t) -} - -func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type) bool { - var t *types.Type - var other *types.Type - if inType.Name.Package == g.typesPackage { - t, other = inType, outType - } else { - t, other = outType, inType - } - - if t.Name.Package != g.typesPackage { - return false - } - // If the type has opted out, skip it. - tagvals := extractTag(t.CommentLines) - if tagvals != nil { - if tagvals[0] != "false" { - klog.Fatalf("Type %v: unsupported %s value: %q", t, tagName, tagvals[0]) - } - klog.V(5).Infof("type %v requests no conversion generation, skipping", t) - return false - } - // TODO: Consider generating functions for other kinds too. - if t.Kind != types.Struct { - return false - } - // Also, filter out private types. - if namer.IsPrivateGoName(other.Name.Name) { - return false - } - return true -} - -func getExplicitFromTypes(t *types.Type) []types.Name { - comments := append(t.SecondClosestCommentLines, t.CommentLines...) - paths := extractExplicitFromTag(comments) - result := []types.Name{} - for _, path := range paths { - items := strings.Split(path, ".") - if len(items) != 2 { - klog.Errorf("Unexpected k8s:conversion-gen:explicit-from tag: %s", path) - continue - } - switch { - case items[0] == "net/url" && items[1] == "Values": - default: - klog.Fatalf("Not supported k8s:conversion-gen:explicit-from tag: %s", path) - } - result = append(result, types.Name{Package: items[0], Name: items[1]}) - } - return result -} - -func (g *genConversion) Filter(c *generator.Context, t *types.Type) bool { - convertibleWithPeer := func() bool { - peerType := getPeerTypeFor(c, t, g.peerPackages) - if peerType == nil { - return false - } - if !g.convertibleOnlyWithinPackage(t, peerType) { - return false - } - g.types = append(g.types, t) - return true - }() - - explicitlyConvertible := func() bool { - inTypes := getExplicitFromTypes(t) - if len(inTypes) == 0 { - return false - } - for i := range inTypes { - pair := conversionPair{ - inType: &types.Type{Name: inTypes[i]}, - outType: t, - } - g.explicitConversions = append(g.explicitConversions, pair) - } - return true - }() - - return convertibleWithPeer || explicitlyConvertible -} - -func (g *genConversion) isOtherPackage(pkg string) bool { - if pkg == g.outputPackage { - return false - } - if strings.HasSuffix(pkg, `"`+g.outputPackage+`"`) { - return false - } - return true -} - -func (g *genConversion) Imports(c *generator.Context) (imports []string) { - var importLines []string - for _, singleImport := range g.imports.ImportLines() { - if g.isOtherPackage(singleImport) { - importLines = append(importLines, singleImport) - } - } - return importLines -} - -func argsFromType(inType, outType *types.Type) generator.Args { - return generator.Args{ - "inType": inType, - "outType": outType, - } -} - -const nameTmpl = "Convert_$.inType|publicIT$_To_$.outType|publicIT$" - -func (g *genConversion) preexists(inType, outType *types.Type) (*types.Type, bool) { - function, ok := g.manualConversions[conversionPair{inType, outType}] - return function, ok -} - -func (g *genConversion) Init(c *generator.Context, w io.Writer) error { - klogV := klog.V(5) - if klogV.Enabled() { - if m, ok := g.useUnsafe.(equalMemoryTypes); ok { - var result []string - klogV.Info("All objects without identical memory layout:") - for k, v := range m { - if v { - continue - } - result = append(result, fmt.Sprintf(" %s -> %s = %t", k.inType, k.outType, v)) - } - sort.Strings(result) - for _, s := range result { - klogV.Info(s) - } - } - } - sw := generator.NewSnippetWriter(w, c, "$", "$") - sw.Do("func init() {\n", nil) - sw.Do("localSchemeBuilder.Register(RegisterConversions)\n", nil) - sw.Do("}\n", nil) - - scheme := c.Universe.Type(types.Name{Package: runtimePackagePath, Name: "Scheme"}) - schemePtr := &types.Type{ - Kind: types.Pointer, - Elem: scheme, - } - sw.Do("// RegisterConversions adds conversion functions to the given scheme.\n", nil) - sw.Do("// Public to allow building arbitrary schemes.\n", nil) - sw.Do("func RegisterConversions(s $.|raw$) error {\n", schemePtr) - for _, t := range g.types { - peerType := getPeerTypeFor(c, t, g.peerPackages) - if _, found := g.preexists(t, peerType); !found { - args := argsFromType(t, peerType).With("Scope", types.Ref(conversionPackagePath, "Scope")) - sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - if _, found := g.preexists(peerType, t); !found { - args := argsFromType(peerType, t).With("Scope", types.Ref(conversionPackagePath, "Scope")) - sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - } - - for i := range g.explicitConversions { - args := argsFromType(g.explicitConversions[i].inType, g.explicitConversions[i].outType).With("Scope", types.Ref(conversionPackagePath, "Scope")) - sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - - var pairs []conversionPair - for pair, t := range g.manualConversions { - if t.Name.Package != g.outputPackage { - continue - } - pairs = append(pairs, pair) - } - // sort by name of the conversion function - sort.Slice(pairs, func(i, j int) bool { - if g.manualConversions[pairs[i]].Name.Name < g.manualConversions[pairs[j]].Name.Name { - return true - } - return false - }) - for _, pair := range pairs { - args := argsFromType(pair.inType, pair.outType).With("Scope", types.Ref(conversionPackagePath, "Scope")).With("fn", g.manualConversions[pair]) - sw.Do("if err := s.AddConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return $.fn|raw$(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) - } - - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - return sw.Error() -} - -func (g *genConversion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - klog.V(5).Infof("generating for type %v", t) - sw := generator.NewSnippetWriter(w, c, "$", "$") - - if peerType := getPeerTypeFor(c, t, g.peerPackages); peerType != nil { - g.generateConversion(t, peerType, sw) - g.generateConversion(peerType, t, sw) - } - - for _, inTypeName := range getExplicitFromTypes(t) { - inPkg, ok := c.Universe[inTypeName.Package] - if !ok { - klog.Errorf("Unrecognized package: %s", inTypeName.Package) - continue - } - inType, ok := inPkg.Types[inTypeName.Name] - if !ok { - klog.Errorf("Unrecognized type in package %s: %s", inTypeName.Package, inTypeName.Name) - continue - } - switch { - case inType.Name.Package == "net/url" && inType.Name.Name == "Values": - g.generateFromUrlValues(inType, t, sw) - default: - klog.Errorf("Not supported input type: %#v", inType.Name) - } - } - - return sw.Error() -} - -func (g *genConversion) generateConversion(inType, outType *types.Type, sw *generator.SnippetWriter) { - args := argsFromType(inType, outType). - With("Scope", types.Ref(conversionPackagePath, "Scope")) - - sw.Do("func auto"+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) - g.generateFor(inType, outType, sw) - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - - if _, found := g.preexists(inType, outType); found { - // There is a public manual Conversion method: use it. - } else if skipped := g.skippedFields[inType]; len(skipped) != 0 { - // The inType had some fields we could not generate. - klog.Errorf("Warning: could not find nor generate a final Conversion function for %v -> %v", inType, outType) - klog.Errorf(" the following fields need manual conversion:") - for _, f := range skipped { - klog.Errorf(" - %v", f) - } - } else { - // Emit a public conversion function. - sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args) - sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) - sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args) - sw.Do("}\n\n", nil) - } -} - -// we use the system of shadowing 'in' and 'out' so that the same code is valid -// at any nesting level. This makes the autogenerator easy to understand, and -// the compiler shouldn't care. -func (g *genConversion) generateFor(inType, outType *types.Type, sw *generator.SnippetWriter) { - klog.V(5).Infof("generating %v -> %v", inType, outType) - var f func(*types.Type, *types.Type, *generator.SnippetWriter) - - switch inType.Kind { - case types.Builtin: - f = g.doBuiltin - case types.Map: - f = g.doMap - case types.Slice: - f = g.doSlice - case types.Struct: - f = g.doStruct - case types.Pointer: - f = g.doPointer - case types.Alias: - f = g.doAlias - default: - f = g.doUnknown - } - - f(inType, outType, sw) -} - -func (g *genConversion) doBuiltin(inType, outType *types.Type, sw *generator.SnippetWriter) { - if inType == outType { - sw.Do("*out = *in\n", nil) - } else { - sw.Do("*out = $.|raw$(*in)\n", outType) - } -} - -func (g *genConversion) doMap(inType, outType *types.Type, sw *generator.SnippetWriter) { - sw.Do("*out = make($.|raw$, len(*in))\n", outType) - if isDirectlyAssignable(inType.Key, outType.Key) { - sw.Do("for key, val := range *in {\n", nil) - if isDirectlyAssignable(inType.Elem, outType.Elem) { - if inType.Key == outType.Key { - sw.Do("(*out)[key] = ", nil) - } else { - sw.Do("(*out)[$.|raw$(key)] = ", outType.Key) - } - if inType.Elem == outType.Elem { - sw.Do("val\n", nil) - } else { - sw.Do("$.|raw$(val)\n", outType.Elem) - } - } else { - conversionExists := true - if function, ok := g.preexists(inType.Elem, outType.Elem); ok { - sw.Do("newVal := new($.|raw$)\n", outType.Elem) - sw.Do("if err := $.|raw$(&val, newVal, s); err != nil {\n", function) - } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { - sw.Do("newVal := new($.|raw$)\n", outType.Elem) - sw.Do("if err := "+nameTmpl+"(&val, newVal, s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) - } else { - args := argsFromType(inType.Elem, outType.Elem) - sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) - sw.Do("compileErrorOnMissingConversion()\n", nil) - conversionExists = false - } - if conversionExists { - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - if inType.Key == outType.Key { - sw.Do("(*out)[key] = *newVal\n", nil) - } else { - sw.Do("(*out)[$.|raw$(key)] = *newVal\n", outType.Key) - } - } - } - } else { - // TODO: Implement it when necessary. - sw.Do("for range *in {\n", nil) - sw.Do("// FIXME: Converting unassignable keys unsupported $.|raw$\n", inType.Key) - } - sw.Do("}\n", nil) -} - -func (g *genConversion) doSlice(inType, outType *types.Type, sw *generator.SnippetWriter) { - sw.Do("*out = make($.|raw$, len(*in))\n", outType) - if inType.Elem == outType.Elem && inType.Elem.Kind == types.Builtin { - sw.Do("copy(*out, *in)\n", nil) - } else { - sw.Do("for i := range *in {\n", nil) - if isDirectlyAssignable(inType.Elem, outType.Elem) { - if inType.Elem == outType.Elem { - sw.Do("(*out)[i] = (*in)[i]\n", nil) - } else { - sw.Do("(*out)[i] = $.|raw$((*in)[i])\n", outType.Elem) - } - } else { - conversionExists := true - if function, ok := g.preexists(inType.Elem, outType.Elem); ok { - sw.Do("if err := $.|raw$(&(*in)[i], &(*out)[i], s); err != nil {\n", function) - } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { - sw.Do("if err := "+nameTmpl+"(&(*in)[i], &(*out)[i], s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) - } else { - args := argsFromType(inType.Elem, outType.Elem) - sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) - sw.Do("compileErrorOnMissingConversion()\n", nil) - conversionExists = false - } - if conversionExists { - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } - } - sw.Do("}\n", nil) - } -} - -func (g *genConversion) doStruct(inType, outType *types.Type, sw *generator.SnippetWriter) { - for _, inMember := range inType.Members { - if tagvals := extractTag(inMember.CommentLines); tagvals != nil && tagvals[0] == "false" { - // This field is excluded from conversion. - sw.Do("// INFO: in."+inMember.Name+" opted out of conversion generation\n", nil) - continue - } - outMember, found := findMember(outType, inMember.Name) - if !found { - // This field doesn't exist in the peer. - sw.Do("// WARNING: in."+inMember.Name+" requires manual conversion: does not exist in peer-type\n", nil) - g.skippedFields[inType] = append(g.skippedFields[inType], inMember.Name) - continue - } - - inMemberType, outMemberType := inMember.Type, outMember.Type - // create a copy of both underlying types but give them the top level alias name (since aliases - // are assignable) - if underlying := unwrapAlias(inMemberType); underlying != inMemberType { - copied := *underlying - copied.Name = inMemberType.Name - inMemberType = &copied - } - if underlying := unwrapAlias(outMemberType); underlying != outMemberType { - copied := *underlying - copied.Name = outMemberType.Name - outMemberType = &copied - } - - args := argsFromType(inMemberType, outMemberType).With("name", inMember.Name) - - // try a direct memory copy for any type that has exactly equivalent values - if g.useUnsafe.Equal(inMemberType, outMemberType) { - args = args. - With("Pointer", types.Ref("unsafe", "Pointer")). - With("SliceHeader", types.Ref("reflect", "SliceHeader")) - switch inMemberType.Kind { - case types.Pointer: - sw.Do("out.$.name$ = ($.outType|raw$)($.Pointer|raw$(in.$.name$))\n", args) - continue - case types.Map: - sw.Do("out.$.name$ = *(*$.outType|raw$)($.Pointer|raw$(&in.$.name$))\n", args) - continue - case types.Slice: - sw.Do("out.$.name$ = *(*$.outType|raw$)($.Pointer|raw$(&in.$.name$))\n", args) - continue - } - } - - // check based on the top level name, not the underlying names - if function, ok := g.preexists(inMember.Type, outMember.Type); ok { - if isDrop(function.CommentLines) { - continue - } - // copy-only functions that are directly assignable can be inlined instead of invoked. - // As an example, conversion functions exist that allow types with private fields to be - // correctly copied between types. These functions are equivalent to a memory assignment, - // and are necessary for the reflection path, but should not block memory conversion. - // Convert_unversioned_Time_to_unversioned_Time is an example of this logic. - if !isCopyOnly(function.CommentLines) || !g.isFastConversion(inMemberType, outMemberType) { - args["function"] = function - sw.Do("if err := $.function|raw$(&in.$.name$, &out.$.name$, s); err != nil {\n", args) - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - continue - } - klog.V(5).Infof("Skipped function %s because it is copy-only and we can use direct assignment", function.Name) - } - - // If we can't auto-convert, punt before we emit any code. - if inMemberType.Kind != outMemberType.Kind { - sw.Do("// WARNING: in."+inMember.Name+" requires manual conversion: inconvertible types ("+ - inMemberType.String()+" vs "+outMemberType.String()+")\n", nil) - g.skippedFields[inType] = append(g.skippedFields[inType], inMember.Name) - continue - } - - switch inMemberType.Kind { - case types.Builtin: - if inMemberType == outMemberType { - sw.Do("out.$.name$ = in.$.name$\n", args) - } else { - sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args) - } - case types.Map, types.Slice, types.Pointer: - if g.isDirectlyAssignable(inMemberType, outMemberType) { - sw.Do("out.$.name$ = in.$.name$\n", args) - continue - } - - sw.Do("if in.$.name$ != nil {\n", args) - sw.Do("in, out := &in.$.name$, &out.$.name$\n", args) - g.generateFor(inMemberType, outMemberType, sw) - sw.Do("} else {\n", nil) - sw.Do("out.$.name$ = nil\n", args) - sw.Do("}\n", nil) - case types.Struct: - if g.isDirectlyAssignable(inMemberType, outMemberType) { - sw.Do("out.$.name$ = in.$.name$\n", args) - continue - } - conversionExists := true - if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { - sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) - } else { - args := argsFromType(inMemberType, outMemberType) - sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) - sw.Do("compileErrorOnMissingConversion()\n", nil) - conversionExists = false - } - if conversionExists { - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } - case types.Alias: - if isDirectlyAssignable(inMemberType, outMemberType) { - if inMemberType == outMemberType { - sw.Do("out.$.name$ = in.$.name$\n", args) - } else { - sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args) - } - } else { - conversionExists := true - if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { - sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) - } else { - args := argsFromType(inMemberType, outMemberType) - sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) - sw.Do("compileErrorOnMissingConversion()\n", nil) - conversionExists = false - } - if conversionExists { - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } - } - default: - conversionExists := true - if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { - sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) - } else { - args := argsFromType(inMemberType, outMemberType) - sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) - sw.Do("compileErrorOnMissingConversion()\n", nil) - conversionExists = false - } - if conversionExists { - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } - } - } -} - -func (g *genConversion) isFastConversion(inType, outType *types.Type) bool { - switch inType.Kind { - case types.Builtin: - return true - case types.Map, types.Slice, types.Pointer, types.Struct, types.Alias: - return g.isDirectlyAssignable(inType, outType) - default: - return false - } -} - -func (g *genConversion) isDirectlyAssignable(inType, outType *types.Type) bool { - return unwrapAlias(inType) == unwrapAlias(outType) -} - -func (g *genConversion) doPointer(inType, outType *types.Type, sw *generator.SnippetWriter) { - sw.Do("*out = new($.Elem|raw$)\n", outType) - if isDirectlyAssignable(inType.Elem, outType.Elem) { - if inType.Elem == outType.Elem { - sw.Do("**out = **in\n", nil) - } else { - sw.Do("**out = $.|raw$(**in)\n", outType.Elem) - } - } else { - conversionExists := true - if function, ok := g.preexists(inType.Elem, outType.Elem); ok { - sw.Do("if err := $.|raw$(*in, *out, s); err != nil {\n", function) - } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { - sw.Do("if err := "+nameTmpl+"(*in, *out, s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) - } else { - args := argsFromType(inType.Elem, outType.Elem) - sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) - sw.Do("compileErrorOnMissingConversion()\n", nil) - conversionExists = false - } - if conversionExists { - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - } - } -} - -func (g *genConversion) doAlias(inType, outType *types.Type, sw *generator.SnippetWriter) { - // TODO: Add support for aliases. - g.doUnknown(inType, outType, sw) -} - -func (g *genConversion) doUnknown(inType, outType *types.Type, sw *generator.SnippetWriter) { - sw.Do("// FIXME: Type $.|raw$ is unsupported.\n", inType) -} - -func (g *genConversion) generateFromUrlValues(inType, outType *types.Type, sw *generator.SnippetWriter) { - args := generator.Args{ - "inType": inType, - "outType": outType, - "Scope": types.Ref(conversionPackagePath, "Scope"), - } - sw.Do("func auto"+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) - for _, outMember := range outType.Members { - if tagvals := extractTag(outMember.CommentLines); tagvals != nil && tagvals[0] == "false" { - // This field is excluded from conversion. - sw.Do("// INFO: in."+outMember.Name+" opted out of conversion generation\n", nil) - continue - } - jsonTag := reflect.StructTag(outMember.Tags).Get("json") - index := strings.Index(jsonTag, ",") - if index == -1 { - index = len(jsonTag) - } - if index == 0 { - memberArgs := generator.Args{ - "name": outMember.Name, - } - sw.Do("// WARNING: Field $.name$ does not have json tag, skipping.\n\n", memberArgs) - continue - } - memberArgs := generator.Args{ - "name": outMember.Name, - "tag": jsonTag[:index], - } - sw.Do("if values, ok := map[string][]string(*in)[\"$.tag$\"]; ok && len(values) > 0 {\n", memberArgs) - g.fromValuesEntry(inType.Underlying.Elem, outMember, sw) - sw.Do("} else {\n", nil) - g.setZeroValue(outMember, sw) - sw.Do("}\n", nil) - } - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - - if _, found := g.preexists(inType, outType); found { - // There is a public manual Conversion method: use it. - } else { - // Emit a public conversion function. - sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args) - sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) - sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args) - sw.Do("}\n\n", nil) - } -} - -func (g *genConversion) fromValuesEntry(inType *types.Type, outMember types.Member, sw *generator.SnippetWriter) { - memberArgs := generator.Args{ - "name": outMember.Name, - "type": outMember.Type, - } - if function, ok := g.preexists(inType, outMember.Type); ok { - args := memberArgs.With("function", function) - sw.Do("if err := $.function|raw$(&values, &out.$.name$, s); err != nil {\n", args) - sw.Do("return err\n", nil) - sw.Do("}\n", nil) - return - } - switch { - case outMember.Type == types.String: - sw.Do("out.$.name$ = values[0]\n", memberArgs) - case g.useUnsafe.Equal(inType, outMember.Type): - args := memberArgs.With("Pointer", types.Ref("unsafe", "Pointer")) - switch inType.Kind { - case types.Pointer: - sw.Do("out.$.name$ = ($.type|raw$)($.Pointer|raw$(&values))\n", args) - case types.Map, types.Slice: - sw.Do("out.$.name$ = *(*$.type|raw$)($.Pointer|raw$(&values))\n", args) - default: - // TODO: Support other types to allow more auto-conversions. - sw.Do("// FIXME: out.$.name$ is of not yet supported type and requires manual conversion\n", memberArgs) - } - default: - // TODO: Support other types to allow more auto-conversions. - sw.Do("// FIXME: out.$.name$ is of not yet supported type and requires manual conversion\n", memberArgs) - } -} - -func (g *genConversion) setZeroValue(outMember types.Member, sw *generator.SnippetWriter) { - outMemberType := unwrapAlias(outMember.Type) - memberArgs := generator.Args{ - "name": outMember.Name, - "alias": outMember.Type, - "type": outMemberType, - } - - switch outMemberType.Kind { - case types.Builtin: - switch outMemberType { - case types.String: - sw.Do("out.$.name$ = \"\"\n", memberArgs) - case types.Int64, types.Int32, types.Int16, types.Int, types.Uint64, types.Uint32, types.Uint16, types.Uint: - sw.Do("out.$.name$ = 0\n", memberArgs) - case types.Uintptr, types.Byte: - sw.Do("out.$.name$ = 0\n", memberArgs) - case types.Float64, types.Float32, types.Float: - sw.Do("out.$.name$ = 0\n", memberArgs) - case types.Bool: - sw.Do("out.$.name$ = false\n", memberArgs) - default: - sw.Do("// FIXME: out.$.name$ is of unsupported type and requires manual conversion\n", memberArgs) - } - case types.Struct: - if outMemberType == outMember.Type { - sw.Do("out.$.name$ = $.type|raw${}\n", memberArgs) - } else { - sw.Do("out.$.name$ = $.alias|raw$($.type|raw${})\n", memberArgs) - } - case types.Map, types.Slice, types.Pointer: - sw.Do("out.$.name$ = nil\n", memberArgs) - case types.Alias: - // outMemberType was already unwrapped from aliases - so that should never happen. - sw.Do("// FIXME: unexpected error for out.$.name$\n", memberArgs) - case types.Interface, types.Array: - sw.Do("out.$.name$ = nil\n", memberArgs) - default: - sw.Do("// FIXME: out.$.name$ is of unsupported type and requires manual conversion\n", memberArgs) - } -} - -func isDirectlyAssignable(inType, outType *types.Type) bool { - // TODO: This should maybe check for actual assignability between the two - // types, rather than superficial traits that happen to indicate it is - // assignable in the ways we currently use this code. - return inType.IsAssignable() && (inType.IsPrimitive() || isSamePackage(inType, outType)) -} - -func isSamePackage(inType, outType *types.Type) bool { - return inType.Name.Package == outType.Name.Package -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go deleted file mode 100644 index 5a461d270903..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/conversion-gen/main.go +++ /dev/null @@ -1,139 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// conversion-gen is a tool for auto-generating functions that convert -// between internal and external types. A general conversion code -// generation task involves three sets of packages: (1) a set of -// packages containing internal types, (2) a single package containing -// the external types, and (3) a single destination package (i.e., -// where the generated conversion functions go, and where the -// developer-authored conversion functions are). The packages -// containing the internal types play the role known as "peer -// packages" in the general code-generation framework of Kubernetes. -// -// For each conversion task, `conversion-gen` will generate functions -// that efficiently convert between same-name types in the two -// (internal, external) packages. The generated functions include -// ones named -// -// autoConvert___To__ -// -// for each such pair of types --- both with (pkg1,pkg2) = -// (internal,external) and (pkg1,pkg2) = (external,internal). The -// generated conversion functions recurse on the structure of the data -// types. For structs, source and destination fields are matched up -// according to name; if a source field has no corresponding -// destination or there is a fundamental mismatch in the type of the -// field then the generated autoConvert_... function has just a -// warning comment about that field. The generated conversion -// functions use standard value assignment wherever possible. For -// compound types, the generated conversion functions call the -// `Convert...` functions for the subsidiary types. -// -// For each pair of types `conversion-gen` will also generate a -// function named -// -// Convert___To__ -// -// if both of two conditions are met: (1) the destination package does -// not contain a function of that name in a non-generated file and (2) -// the generation of the corresponding autoConvert_... function did -// not run into trouble with a missing or fundamentally differently -// typed field. A generated Convert_... function simply calls the -// corresponding `autoConvert...` function. `conversion_gen` also -// generates a function that updates a given `runtime.Scheme` by -// registering all the Convert_... functions found and generated. -// Thus developers can override the generated behavior for selected -// type pairs by putting the desired Convert_... functions in -// non-generated files. Further, developers are practically required -// to override the generated behavior when there are missing or -// fundamentally differently typed fields. -// -// `conversion-gen` will scan its `--input-dirs`, looking at the -// package defined in each of those directories for comment tags that -// define a conversion code generation task. A package requests -// conversion code generation by including one or more comment in the -// package's `doc.go` file (currently anywhere in that file is -// acceptable, but the recommended location is above the `package` -// statement), of the form: -// -// // +k8s:conversion-gen= -// -// This introduces a conversion task, for which the destination -// package is the one containing the file with the tag and the tag -// identifies a package containing internal types. If there is also a -// tag of the form -// -// // +k8s:conversion-gen-external-types= -// -// then it identifies the package containing the external types; -// otherwise they are in the destination package. -// -// For each conversion code generation task, the full set of internal -// packages (AKA peer packages) consists of the ones specified in the -// `k8s:conversion-gen` tags PLUS any specified in the -// `--base-peer-dirs` and `--extra-peer-dirs` flags on the command -// line. -// -// When generating for a package, individual types or fields of structs may opt -// out of Conversion generation by specifying a comment on the of the form: -// -// // +k8s:conversion-gen=false -package main - -import ( - "flag" - - "github.com/spf13/pflag" - "k8s.io/klog/v2" - - generatorargs "k8s.io/code-generator/cmd/conversion-gen/args" - "k8s.io/code-generator/cmd/conversion-gen/generators" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - // k8s.io/apimachinery/pkg/runtime contains a number of manual conversions, - // that we need to generate conversions. - // Packages being dependencies of explicitly requested packages are only - // partially scanned - only types explicitly used are being traversed. - // Not used functions or types are omitted. - // Adding this explicitly to InputDirs ensures that the package is fully - // scanned and all functions are parsed and processed. - genericArgs.InputDirs = append(genericArgs.InputDirs, "k8s.io/apimachinery/pkg/runtime") - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go deleted file mode 100644 index 789713012adc..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/deepcopy-gen/args/args.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "fmt" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/deepcopy-gen/generators" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs generators.CustomArgs - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{} - genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there - genericArgs.OutputFileBaseName = "deepcopy_generated" - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - pflag.CommandLine.StringSliceVar(&ca.BoundingDirs, "bounding-dirs", ca.BoundingDirs, - "Comma-separated list of import paths which bound the types for which deep-copies will be generated.") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*generators.CustomArgs) - - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go deleted file mode 100644 index 5622c1a1bebd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/deepcopy-gen/main.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -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. -*/ - -// deepcopy-gen is a tool for auto-generating DeepCopy functions. -// -// Given a list of input directories, it will generate functions that -// efficiently perform a full deep-copy of each type. For any type that -// offers a `.DeepCopy()` method, it will simply call that. Otherwise it will -// use standard value assignment whenever possible. If that is not possible it -// will try to call its own generated copy function for the type, if the type is -// within the allowed root packages. Failing that, it will fall back on -// `conversion.Cloner.DeepCopy(val)` to make the copy. The resulting file will -// be stored in the same directory as the processed source package. -// -// Generation is governed by comment tags in the source. Any package may -// request DeepCopy generation by including a comment in the file-comments of -// one file, of the form: -// -// // +k8s:deepcopy-gen=package -// -// DeepCopy functions can be generated for individual types, rather than the -// entire package by specifying a comment on the type definion of the form: -// -// // +k8s:deepcopy-gen=true -// -// When generating for a whole package, individual types may opt out of -// DeepCopy generation by specifying a comment on the of the form: -// -// // +k8s:deepcopy-gen=false -// -// Note that registration is a whole-package option, and is not available for -// individual types. -package main - -import ( - "flag" - - "github.com/spf13/pflag" - "k8s.io/gengo/examples/deepcopy-gen/generators" - "k8s.io/klog/v2" - - generatorargs "k8s.io/code-generator/cmd/deepcopy-gen/args" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go deleted file mode 100644 index 3c5a042c7ca3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/defaulter-gen/args/args.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "fmt" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/defaulter-gen/generators" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs generators.CustomArgs - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{} - genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there - genericArgs.OutputFileBaseName = "zz_generated.defaults" - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs, - "Comma-separated list of import paths which are considered, after tag-specified peers, for conversions.") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*generators.CustomArgs) - - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go deleted file mode 100644 index 23d5d3271bb0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/defaulter-gen/main.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// defaulter-gen is a tool for auto-generating Defaulter functions. -// -// Given a list of input directories, it will scan for top level types -// and generate efficient defaulters for an entire object from the sum -// of the SetDefault_* methods contained in the object tree. -// -// Generation is governed by comment tags in the source. Any package may -// request defaulter generation by including one or more comment tags at -// the package comment level: -// -// // +k8s:defaulter-gen= -// -// which will create defaulters for any type that contains the provided -// field name (if the type has defaulters). Any type may request explicit -// defaulting by providing the comment tag: -// -// // +k8s:defaulter-gen=true|false -// -// An existing defaulter method (`SetDefaults_TYPE`) can provide the -// comment tag: -// -// // +k8s:defaulter-gen=covers -// -// to indicate that the defaulter does not or should not call any nested -// defaulters. -package main - -import ( - "flag" - - "github.com/spf13/pflag" - "k8s.io/gengo/examples/defaulter-gen/generators" - "k8s.io/klog/v2" - - generatorargs "k8s.io/code-generator/cmd/defaulter-gen/args" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/.gitignore b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/.gitignore deleted file mode 100644 index 0e9aa466bba2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/.gitignore +++ /dev/null @@ -1 +0,0 @@ -go-to-protobuf diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS deleted file mode 100644 index af7e2ec4c7d3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - smarterclayton -reviewers: - - smarterclayton diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go deleted file mode 100644 index 009973389b44..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/main.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -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. -*/ - -// go-to-protobuf generates a Protobuf IDL from a Go struct, respecting any -// existing IDL tags on the Go struct. -package main - -import ( - goflag "flag" - - flag "github.com/spf13/pflag" - "k8s.io/code-generator/cmd/go-to-protobuf/protobuf" - "k8s.io/klog/v2" -) - -var g = protobuf.New() - -func init() { - klog.InitFlags(nil) - g.BindFlags(flag.CommandLine) - goflag.Set("logtostderr", "true") - flag.CommandLine.AddGoFlagSet(goflag.CommandLine) -} - -func main() { - flag.Parse() - protobuf.Run(g) -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go deleted file mode 100644 index ff267e2610ea..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go +++ /dev/null @@ -1,480 +0,0 @@ -/* -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. -*/ - -// go-to-protobuf generates a Protobuf IDL from a Go struct, respecting any -// existing IDL tags on the Go struct. -package protobuf - -import ( - "bytes" - "fmt" - "log" - "os" - "os/exec" - "path/filepath" - "sort" - "strings" - - flag "github.com/spf13/pflag" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/parser" - "k8s.io/gengo/types" -) - -type Generator struct { - Common args.GeneratorArgs - APIMachineryPackages string - Packages string - OutputBase string - VendorOutputBase string - ProtoImport []string - Conditional string - Clean bool - OnlyIDL bool - KeepGogoproto bool - SkipGeneratedRewrite bool - DropEmbeddedFields string - TrimPathPrefix string -} - -func New() *Generator { - sourceTree := args.DefaultSourceTree() - common := args.GeneratorArgs{ - OutputBase: sourceTree, - } - defaultProtoImport := filepath.Join(sourceTree, "k8s.io", "kubernetes", "vendor", "github.com", "gogo", "protobuf", "protobuf") - cwd, err := os.Getwd() - if err != nil { - log.Fatalf("Cannot get current directory.") - } - return &Generator{ - Common: common, - OutputBase: sourceTree, - VendorOutputBase: filepath.Join(cwd, "vendor"), - ProtoImport: []string{defaultProtoImport}, - APIMachineryPackages: strings.Join([]string{ - `+k8s.io/apimachinery/pkg/util/intstr`, - `+k8s.io/apimachinery/pkg/api/resource`, - `+k8s.io/apimachinery/pkg/runtime/schema`, - `+k8s.io/apimachinery/pkg/runtime`, - `k8s.io/apimachinery/pkg/apis/meta/v1`, - `k8s.io/apimachinery/pkg/apis/meta/v1beta1`, - `k8s.io/apimachinery/pkg/apis/testapigroup/v1`, - }, ","), - Packages: "", - DropEmbeddedFields: "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta", - } -} - -func (g *Generator) BindFlags(flag *flag.FlagSet) { - flag.StringVarP(&g.Common.GoHeaderFilePath, "go-header-file", "h", g.Common.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") - flag.BoolVar(&g.Common.VerifyOnly, "verify-only", g.Common.VerifyOnly, "If true, only verify existing output, do not write anything.") - flag.StringVarP(&g.Packages, "packages", "p", g.Packages, "comma-separated list of directories to get input types from. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.") - flag.StringVar(&g.APIMachineryPackages, "apimachinery-packages", g.APIMachineryPackages, "comma-separated list of directories to get apimachinery input types from which are needed by any API. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.") - flag.StringVarP(&g.OutputBase, "output-base", "o", g.OutputBase, "Output base; defaults to $GOPATH/src/") - flag.StringVar(&g.VendorOutputBase, "vendor-output-base", g.VendorOutputBase, "The vendor/ directory to look for packages in; defaults to $PWD/vendor/.") - flag.StringSliceVar(&g.ProtoImport, "proto-import", g.ProtoImport, "The search path for the core protobuf .protos, required; defaults $GOPATH/src/k8s.io/kubernetes/vendor/github.com/gogo/protobuf/protobuf.") - flag.StringVar(&g.Conditional, "conditional", g.Conditional, "An optional Golang build tag condition to add to the generated Go code") - flag.BoolVar(&g.Clean, "clean", g.Clean, "If true, remove all generated files for the specified Packages.") - flag.BoolVar(&g.OnlyIDL, "only-idl", g.OnlyIDL, "If true, only generate the IDL for each package.") - flag.BoolVar(&g.KeepGogoproto, "keep-gogoproto", g.KeepGogoproto, "If true, the generated IDL will contain gogoprotobuf extensions which are normally removed") - flag.BoolVar(&g.SkipGeneratedRewrite, "skip-generated-rewrite", g.SkipGeneratedRewrite, "If true, skip fixing up the generated.pb.go file (debugging only).") - flag.StringVar(&g.DropEmbeddedFields, "drop-embedded-fields", g.DropEmbeddedFields, "Comma-delimited list of embedded Go types to omit from generated protobufs") - flag.StringVar(&g.TrimPathPrefix, "trim-path-prefix", g.TrimPathPrefix, "If set, trim the specified prefix from --output-package when generating files.") -} - -func Run(g *Generator) { - if g.Common.VerifyOnly { - g.OnlyIDL = true - g.Clean = false - } - - b := parser.New() - b.AddBuildTags("proto") - - omitTypes := map[types.Name]struct{}{} - for _, t := range strings.Split(g.DropEmbeddedFields, ",") { - name := types.Name{} - if i := strings.LastIndex(t, "."); i != -1 { - name.Package, name.Name = t[:i], t[i+1:] - } else { - name.Name = t - } - if len(name.Name) == 0 { - log.Fatalf("--drop-embedded-types requires names in the form of [GOPACKAGE.]TYPENAME: %v", t) - } - omitTypes[name] = struct{}{} - } - - boilerplate, err := g.Common.LoadGoBoilerplate() - if err != nil { - log.Fatalf("Failed loading boilerplate (consider using the go-header-file flag): %v", err) - } - - protobufNames := NewProtobufNamer() - outputPackages := generator.Packages{} - nonOutputPackages := map[string]struct{}{} - - var packages []string - if len(g.APIMachineryPackages) != 0 { - packages = append(packages, strings.Split(g.APIMachineryPackages, ",")...) - } - if len(g.Packages) != 0 { - packages = append(packages, strings.Split(g.Packages, ",")...) - } - if len(packages) == 0 { - log.Fatalf("Both apimachinery-packages and packages are empty. At least one package must be specified.") - } - - for _, d := range packages { - generateAllTypes, outputPackage := true, true - switch { - case strings.HasPrefix(d, "+"): - d = d[1:] - generateAllTypes = false - case strings.HasPrefix(d, "-"): - d = d[1:] - outputPackage = false - } - name := protoSafePackage(d) - parts := strings.SplitN(d, "=", 2) - if len(parts) > 1 { - d = parts[0] - name = parts[1] - } - p := newProtobufPackage(d, name, generateAllTypes, omitTypes) - header := append([]byte{}, boilerplate...) - header = append(header, p.HeaderText...) - p.HeaderText = header - protobufNames.Add(p) - if outputPackage { - outputPackages = append(outputPackages, p) - } else { - nonOutputPackages[name] = struct{}{} - } - } - - if !g.Common.VerifyOnly { - for _, p := range outputPackages { - if err := p.(*protobufPackage).Clean(g.OutputBase); err != nil { - log.Fatalf("Unable to clean package %s: %v", p.Name(), err) - } - } - } - - if g.Clean { - return - } - - for _, p := range protobufNames.List() { - if err := b.AddDir(p.Path()); err != nil { - log.Fatalf("Unable to add directory %q: %v", p.Path(), err) - } - } - - c, err := generator.NewContext( - b, - namer.NameSystems{ - "public": namer.NewPublicNamer(3), - "proto": protobufNames, - }, - "public", - ) - if err != nil { - log.Fatalf("Failed making a context: %v", err) - } - - c.Verify = g.Common.VerifyOnly - c.FileTypes["protoidl"] = NewProtoFile() - c.TrimPathPrefix = g.TrimPathPrefix - - // order package by imports, importees first - deps := deps(c, protobufNames.packages) - order, err := importOrder(deps) - if err != nil { - log.Fatalf("Failed to order packages by imports: %v", err) - } - topologicalPos := map[string]int{} - for i, p := range order { - topologicalPos[p] = i - } - sort.Sort(positionOrder{topologicalPos, protobufNames.packages}) - - var vendoredOutputPackages, localOutputPackages generator.Packages - for _, p := range protobufNames.packages { - if _, ok := nonOutputPackages[p.Name()]; ok { - // if we're not outputting the package, don't include it in either package list - continue - } - p.Vendored = strings.Contains(c.Universe[p.PackagePath].SourcePath, "/vendor/") - if p.Vendored { - vendoredOutputPackages = append(vendoredOutputPackages, p) - } else { - localOutputPackages = append(localOutputPackages, p) - } - } - - if err := protobufNames.AssignTypesToPackages(c); err != nil { - log.Fatalf("Failed to identify Common types: %v", err) - } - - if err := c.ExecutePackages(g.VendorOutputBase, vendoredOutputPackages); err != nil { - log.Fatalf("Failed executing vendor generator: %v", err) - } - if err := c.ExecutePackages(g.OutputBase, localOutputPackages); err != nil { - log.Fatalf("Failed executing local generator: %v", err) - } - - if g.OnlyIDL { - return - } - - if _, err := exec.LookPath("protoc"); err != nil { - log.Fatalf("Unable to find 'protoc': %v", err) - } - - searchArgs := []string{"-I", ".", "-I", g.OutputBase} - if len(g.ProtoImport) != 0 { - for _, s := range g.ProtoImport { - searchArgs = append(searchArgs, "-I", s) - } - } - args := append(searchArgs, fmt.Sprintf("--gogo_out=%s", g.OutputBase)) - - buf := &bytes.Buffer{} - if len(g.Conditional) > 0 { - fmt.Fprintf(buf, "// +build %s\n\n", g.Conditional) - } - buf.Write(boilerplate) - - for _, outputPackage := range outputPackages { - p := outputPackage.(*protobufPackage) - - path := filepath.Join(g.OutputBase, p.ImportPath()) - outputPath := filepath.Join(g.OutputBase, p.OutputPath()) - if p.Vendored { - path = filepath.Join(g.VendorOutputBase, p.ImportPath()) - outputPath = filepath.Join(g.VendorOutputBase, p.OutputPath()) - } - - // When working outside of GOPATH, we typically won't want to generate the - // full path for a package. For example, if our current project's root/base - // package is github.com/foo/bar, outDir=., p.Path()=github.com/foo/bar/generated, - // then we really want to be writing files to ./generated, not ./github.com/foo/bar/generated. - // The following will trim a path prefix (github.com/foo/bar) from p.Path() to arrive at - // a relative path that works with projects not in GOPATH. - if g.TrimPathPrefix != "" { - separator := string(filepath.Separator) - if !strings.HasSuffix(g.TrimPathPrefix, separator) { - g.TrimPathPrefix += separator - } - - path = strings.TrimPrefix(path, g.TrimPathPrefix) - outputPath = strings.TrimPrefix(outputPath, g.TrimPathPrefix) - } - - // generate the gogoprotobuf protoc - cmd := exec.Command("protoc", append(args, path)...) - out, err := cmd.CombinedOutput() - if err != nil { - log.Println(strings.Join(cmd.Args, " ")) - log.Println(string(out)) - log.Fatalf("Unable to generate protoc on %s: %v", p.PackageName, err) - } - - if g.SkipGeneratedRewrite { - continue - } - - // alter the generated protobuf file to remove the generated types (but leave the serializers) and rewrite the - // package statement to match the desired package name - if err := RewriteGeneratedGogoProtobufFile(outputPath, p.ExtractGeneratedType, p.OptionalTypeName, buf.Bytes()); err != nil { - log.Fatalf("Unable to rewrite generated %s: %v", outputPath, err) - } - - // sort imports - cmd = exec.Command("goimports", "-w", outputPath) - out, err = cmd.CombinedOutput() - if len(out) > 0 { - log.Print(string(out)) - } - if err != nil { - log.Println(strings.Join(cmd.Args, " ")) - log.Fatalf("Unable to rewrite imports for %s: %v", p.PackageName, err) - } - - // format and simplify the generated file - cmd = exec.Command("gofmt", "-s", "-w", outputPath) - out, err = cmd.CombinedOutput() - if len(out) > 0 { - log.Print(string(out)) - } - if err != nil { - log.Println(strings.Join(cmd.Args, " ")) - log.Fatalf("Unable to apply gofmt for %s: %v", p.PackageName, err) - } - } - - if g.SkipGeneratedRewrite { - return - } - - if !g.KeepGogoproto { - // generate, but do so without gogoprotobuf extensions - for _, outputPackage := range outputPackages { - p := outputPackage.(*protobufPackage) - p.OmitGogo = true - } - if err := c.ExecutePackages(g.VendorOutputBase, vendoredOutputPackages); err != nil { - log.Fatalf("Failed executing vendor generator: %v", err) - } - if err := c.ExecutePackages(g.OutputBase, localOutputPackages); err != nil { - log.Fatalf("Failed executing local generator: %v", err) - } - } - - for _, outputPackage := range outputPackages { - p := outputPackage.(*protobufPackage) - - if len(p.StructTags) == 0 { - continue - } - - pattern := filepath.Join(g.OutputBase, p.PackagePath, "*.go") - if p.Vendored { - pattern = filepath.Join(g.VendorOutputBase, p.PackagePath, "*.go") - } - files, err := filepath.Glob(pattern) - if err != nil { - log.Fatalf("Can't glob pattern %q: %v", pattern, err) - } - - for _, s := range files { - if strings.HasSuffix(s, "_test.go") { - continue - } - if err := RewriteTypesWithProtobufStructTags(s, p.StructTags); err != nil { - log.Fatalf("Unable to rewrite with struct tags %s: %v", s, err) - } - } - } -} - -func deps(c *generator.Context, pkgs []*protobufPackage) map[string][]string { - ret := map[string][]string{} - for _, p := range pkgs { - pkg, ok := c.Universe[p.PackagePath] - if !ok { - log.Fatalf("Unrecognized package: %s", p.PackagePath) - } - - for _, d := range pkg.Imports { - ret[p.PackagePath] = append(ret[p.PackagePath], d.Path) - } - } - return ret -} - -// given a set of pkg->[]deps, return the order that ensures all deps are processed before the things that depend on them -func importOrder(deps map[string][]string) ([]string, error) { - // add all nodes and edges - var remainingNodes = map[string]struct{}{} - var graph = map[edge]struct{}{} - for to, froms := range deps { - remainingNodes[to] = struct{}{} - for _, from := range froms { - remainingNodes[from] = struct{}{} - graph[edge{from: from, to: to}] = struct{}{} - } - } - - // find initial nodes without any dependencies - sorted := findAndRemoveNodesWithoutDependencies(remainingNodes, graph) - for i := 0; i < len(sorted); i++ { - node := sorted[i] - removeEdgesFrom(node, graph) - sorted = append(sorted, findAndRemoveNodesWithoutDependencies(remainingNodes, graph)...) - } - if len(remainingNodes) > 0 { - return nil, fmt.Errorf("cycle: remaining nodes: %#v, remaining edges: %#v", remainingNodes, graph) - } - //for _, n := range sorted { - // fmt.Println("topological order", n) - //} - return sorted, nil -} - -// edge describes a from->to relationship in a graph -type edge struct { - from string - to string -} - -// findAndRemoveNodesWithoutDependencies finds nodes in the given set which are not pointed to by any edges in the graph, -// removes them from the set of nodes, and returns them in sorted order -func findAndRemoveNodesWithoutDependencies(nodes map[string]struct{}, graph map[edge]struct{}) []string { - roots := []string{} - // iterate over all nodes as potential "to" nodes - for node := range nodes { - incoming := false - // iterate over all remaining edges - for edge := range graph { - // if there's any edge to the node we care about, it's not a root - if edge.to == node { - incoming = true - break - } - } - // if there are no incoming edges, remove from the set of remaining nodes and add to our results - if !incoming { - delete(nodes, node) - roots = append(roots, node) - } - } - sort.Strings(roots) - return roots -} - -// removeEdgesFrom removes any edges from the graph where edge.from == node -func removeEdgesFrom(node string, graph map[edge]struct{}) { - for edge := range graph { - if edge.from == node { - delete(graph, edge) - } - } -} - -type positionOrder struct { - pos map[string]int - elements []*protobufPackage -} - -func (o positionOrder) Len() int { - return len(o.elements) -} - -func (o positionOrder) Less(i, j int) bool { - return o.pos[o.elements[i].PackagePath] < o.pos[o.elements[j].PackagePath] -} - -func (o positionOrder) Swap(i, j int) { - x := o.elements[i] - o.elements[i] = o.elements[j] - o.elements[j] = x -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go deleted file mode 100644 index c480a8a62eab..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/generator.go +++ /dev/null @@ -1,773 +0,0 @@ -/* -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 protobuf - -import ( - "fmt" - "io" - "log" - "reflect" - "sort" - "strconv" - "strings" - - "k8s.io/klog/v2" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// genProtoIDL produces a .proto IDL. -type genProtoIDL struct { - generator.DefaultGen - localPackage types.Name - localGoPackage types.Name - imports namer.ImportTracker - - generateAll bool - omitGogo bool - omitFieldTypes map[types.Name]struct{} -} - -func (g *genProtoIDL) PackageVars(c *generator.Context) []string { - if g.omitGogo { - return []string{ - fmt.Sprintf("option go_package = %q;", g.localGoPackage.Package), - } - } - return []string{ - "option (gogoproto.marshaler_all) = true;", - "option (gogoproto.stable_marshaler_all) = true;", - "option (gogoproto.sizer_all) = true;", - "option (gogoproto.goproto_stringer_all) = false;", - "option (gogoproto.stringer_all) = true;", - "option (gogoproto.unmarshaler_all) = true;", - "option (gogoproto.goproto_unrecognized_all) = false;", - "option (gogoproto.goproto_enum_prefix_all) = false;", - "option (gogoproto.goproto_getters_all) = false;", - fmt.Sprintf("option go_package = %q;", g.localGoPackage.Package), - } -} -func (g *genProtoIDL) Filename() string { return g.OptionalName + ".proto" } -func (g *genProtoIDL) FileType() string { return "protoidl" } -func (g *genProtoIDL) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - // The local namer returns the correct protobuf name for a proto type - // in the context of a package - "local": localNamer{g.localPackage}, - } -} - -// Filter ignores types that are identified as not exportable. -func (g *genProtoIDL) Filter(c *generator.Context, t *types.Type) bool { - tagVals := types.ExtractCommentTags("+", t.CommentLines)["protobuf"] - if tagVals != nil { - if tagVals[0] == "false" { - // Type specified "false". - return false - } - if tagVals[0] == "true" { - // Type specified "true". - return true - } - klog.Fatalf(`Comment tag "protobuf" must be true or false, found: %q`, tagVals[0]) - } - if !g.generateAll { - // We're not generating everything. - return false - } - seen := map[*types.Type]bool{} - ok := isProtoable(seen, t) - return ok -} - -func isProtoable(seen map[*types.Type]bool, t *types.Type) bool { - if seen[t] { - // be optimistic in the case of type cycles. - return true - } - seen[t] = true - switch t.Kind { - case types.Builtin: - return true - case types.Alias: - return isProtoable(seen, t.Underlying) - case types.Slice, types.Pointer: - return isProtoable(seen, t.Elem) - case types.Map: - return isProtoable(seen, t.Key) && isProtoable(seen, t.Elem) - case types.Struct: - if len(t.Members) == 0 { - return true - } - for _, m := range t.Members { - if isProtoable(seen, m.Type) { - return true - } - } - return false - case types.Func, types.Chan: - return false - case types.DeclarationOf, types.Unknown, types.Unsupported: - return false - case types.Interface: - return false - default: - log.Printf("WARNING: type %q is not portable: %s", t.Kind, t.Name) - return false - } -} - -// isOptionalAlias should return true if the specified type has an underlying type -// (is an alias) of a map or slice and has the comment tag protobuf.nullable=true, -// indicating that the type should be nullable in protobuf. -func isOptionalAlias(t *types.Type) bool { - if t.Underlying == nil || (t.Underlying.Kind != types.Map && t.Underlying.Kind != types.Slice) { - return false - } - if extractBoolTagOrDie("protobuf.nullable", t.CommentLines) == false { - return false - } - return true -} - -func (g *genProtoIDL) Imports(c *generator.Context) (imports []string) { - lines := []string{} - // TODO: this could be expressed more cleanly - for _, line := range g.imports.ImportLines() { - if g.omitGogo && line == "github.com/gogo/protobuf/gogoproto/gogo.proto" { - continue - } - lines = append(lines, line) - } - return lines -} - -// GenerateType makes the body of a file implementing a set for type t. -func (g *genProtoIDL) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - b := bodyGen{ - locator: &protobufLocator{ - namer: c.Namers["proto"].(ProtobufFromGoNamer), - tracker: g.imports, - universe: c.Universe, - - localGoPackage: g.localGoPackage.Package, - }, - localPackage: g.localPackage, - - omitGogo: g.omitGogo, - omitFieldTypes: g.omitFieldTypes, - - t: t, - } - switch t.Kind { - case types.Alias: - return b.doAlias(sw) - case types.Struct: - return b.doStruct(sw) - default: - return b.unknown(sw) - } -} - -// ProtobufFromGoNamer finds the protobuf name of a type (and its package, and -// the package path) from its Go name. -type ProtobufFromGoNamer interface { - GoNameToProtoName(name types.Name) types.Name -} - -type ProtobufLocator interface { - ProtoTypeFor(t *types.Type) (*types.Type, error) - GoTypeForName(name types.Name) *types.Type - CastTypeName(name types.Name) string -} - -type protobufLocator struct { - namer ProtobufFromGoNamer - tracker namer.ImportTracker - universe types.Universe - - localGoPackage string -} - -// CastTypeName returns the cast type name of a Go type -// TODO: delegate to a new localgo namer? -func (p protobufLocator) CastTypeName(name types.Name) string { - if name.Package == p.localGoPackage { - return name.Name - } - return name.String() -} - -func (p protobufLocator) GoTypeForName(name types.Name) *types.Type { - if len(name.Package) == 0 { - name.Package = p.localGoPackage - } - return p.universe.Type(name) -} - -// ProtoTypeFor locates a Protobuf type for the provided Go type (if possible). -func (p protobufLocator) ProtoTypeFor(t *types.Type) (*types.Type, error) { - switch { - // we've already converted the type, or it's a map - case t.Kind == types.Protobuf || t.Kind == types.Map: - p.tracker.AddType(t) - return t, nil - } - // it's a fundamental type - if t, ok := isFundamentalProtoType(t); ok { - p.tracker.AddType(t) - return t, nil - } - // it's a message - if t.Kind == types.Struct || isOptionalAlias(t) { - t := &types.Type{ - Name: p.namer.GoNameToProtoName(t.Name), - Kind: types.Protobuf, - - CommentLines: t.CommentLines, - } - p.tracker.AddType(t) - return t, nil - } - return nil, errUnrecognizedType -} - -type bodyGen struct { - locator ProtobufLocator - localPackage types.Name - omitGogo bool - omitFieldTypes map[types.Name]struct{} - - t *types.Type -} - -func (b bodyGen) unknown(sw *generator.SnippetWriter) error { - return fmt.Errorf("not sure how to generate: %#v", b.t) -} - -func (b bodyGen) doAlias(sw *generator.SnippetWriter) error { - if !isOptionalAlias(b.t) { - return nil - } - - var kind string - switch b.t.Underlying.Kind { - case types.Map: - kind = "map" - default: - kind = "slice" - } - optional := &types.Type{ - Name: b.t.Name, - Kind: types.Struct, - - CommentLines: b.t.CommentLines, - SecondClosestCommentLines: b.t.SecondClosestCommentLines, - Members: []types.Member{ - { - Name: "Items", - CommentLines: []string{fmt.Sprintf("items, if empty, will result in an empty %s\n", kind)}, - Type: b.t.Underlying, - }, - }, - } - nested := b - nested.t = optional - return nested.doStruct(sw) -} - -func (b bodyGen) doStruct(sw *generator.SnippetWriter) error { - if len(b.t.Name.Name) == 0 { - return nil - } - if namer.IsPrivateGoName(b.t.Name.Name) { - return nil - } - - var alias *types.Type - var fields []protoField - options := []string{} - allOptions := types.ExtractCommentTags("+", b.t.CommentLines) - for k, v := range allOptions { - switch { - case strings.HasPrefix(k, "protobuf.options."): - key := strings.TrimPrefix(k, "protobuf.options.") - switch key { - case "marshal": - if v[0] == "false" { - if !b.omitGogo { - options = append(options, - "(gogoproto.marshaler) = false", - "(gogoproto.unmarshaler) = false", - "(gogoproto.sizer) = false", - ) - } - } - default: - if !b.omitGogo || !strings.HasPrefix(key, "(gogoproto.") { - if key == "(gogoproto.goproto_stringer)" && v[0] == "false" { - options = append(options, "(gogoproto.stringer) = false") - } - options = append(options, fmt.Sprintf("%s = %s", key, v[0])) - } - } - // protobuf.as allows a type to have the same message contents as another Go type - case k == "protobuf.as": - fields = nil - if alias = b.locator.GoTypeForName(types.Name{Name: v[0]}); alias == nil { - return fmt.Errorf("type %v references alias %q which does not exist", b.t, v[0]) - } - // protobuf.embed instructs the generator to use the named type in this package - // as an embedded message. - case k == "protobuf.embed": - fields = []protoField{ - { - Tag: 1, - Name: v[0], - Type: &types.Type{ - Name: types.Name{ - Name: v[0], - Package: b.localPackage.Package, - Path: b.localPackage.Path, - }, - }, - }, - } - } - } - if alias == nil { - alias = b.t - } - - // If we don't explicitly embed anything, generate fields by traversing fields. - if fields == nil { - memberFields, err := membersToFields(b.locator, alias, b.localPackage, b.omitFieldTypes) - if err != nil { - return fmt.Errorf("type %v cannot be converted to protobuf: %v", b.t, err) - } - fields = memberFields - } - - out := sw.Out() - genComment(out, b.t.CommentLines, "") - sw.Do(`message $.Name.Name$ { -`, b.t) - - if len(options) > 0 { - sort.Strings(options) - for _, s := range options { - fmt.Fprintf(out, " option %s;\n", s) - } - fmt.Fprintln(out) - } - - for i, field := range fields { - genComment(out, field.CommentLines, " ") - fmt.Fprintf(out, " ") - switch { - case field.Map: - case field.Repeated: - fmt.Fprintf(out, "repeated ") - case field.Required: - fmt.Fprintf(out, "required ") - default: - fmt.Fprintf(out, "optional ") - } - sw.Do(`$.Type|local$ $.Name$ = $.Tag$`, field) - if len(field.Extras) > 0 { - extras := []string{} - for k, v := range field.Extras { - if b.omitGogo && strings.HasPrefix(k, "(gogoproto.") { - continue - } - extras = append(extras, fmt.Sprintf("%s = %s", k, v)) - } - sort.Strings(extras) - if len(extras) > 0 { - fmt.Fprintf(out, " [") - fmt.Fprint(out, strings.Join(extras, ", ")) - fmt.Fprintf(out, "]") - } - } - fmt.Fprintf(out, ";\n") - if i != len(fields)-1 { - fmt.Fprintf(out, "\n") - } - } - fmt.Fprintf(out, "}\n\n") - return nil -} - -type protoField struct { - LocalPackage types.Name - - Tag int - Name string - Type *types.Type - Map bool - Repeated bool - Optional bool - Required bool - Nullable bool - Extras map[string]string - - CommentLines []string -} - -var ( - errUnrecognizedType = fmt.Errorf("did not recognize the provided type") -) - -func isFundamentalProtoType(t *types.Type) (*types.Type, bool) { - // TODO: when we enable proto3, also include other fundamental types in the google.protobuf package - // switch { - // case t.Kind == types.Struct && t.Name == types.Name{Package: "time", Name: "Time"}: - // return &types.Type{ - // Kind: types.Protobuf, - // Name: types.Name{Path: "google/protobuf/timestamp.proto", Package: "google.protobuf", Name: "Timestamp"}, - // }, true - // } - switch t.Kind { - case types.Slice: - if t.Elem.Name.Name == "byte" && len(t.Elem.Name.Package) == 0 { - return &types.Type{Name: types.Name{Name: "bytes"}, Kind: types.Protobuf}, true - } - case types.Builtin: - switch t.Name.Name { - case "string", "uint32", "int32", "uint64", "int64", "bool": - return &types.Type{Name: types.Name{Name: t.Name.Name}, Kind: types.Protobuf}, true - case "int": - return &types.Type{Name: types.Name{Name: "int64"}, Kind: types.Protobuf}, true - case "uint": - return &types.Type{Name: types.Name{Name: "uint64"}, Kind: types.Protobuf}, true - case "float64", "float": - return &types.Type{Name: types.Name{Name: "double"}, Kind: types.Protobuf}, true - case "float32": - return &types.Type{Name: types.Name{Name: "float"}, Kind: types.Protobuf}, true - case "uintptr": - return &types.Type{Name: types.Name{Name: "uint64"}, Kind: types.Protobuf}, true - } - // TODO: complex? - } - return t, false -} - -func memberTypeToProtobufField(locator ProtobufLocator, field *protoField, t *types.Type) error { - var err error - switch t.Kind { - case types.Protobuf: - field.Type, err = locator.ProtoTypeFor(t) - case types.Builtin: - field.Type, err = locator.ProtoTypeFor(t) - case types.Map: - valueField := &protoField{} - if err := memberTypeToProtobufField(locator, valueField, t.Elem); err != nil { - return err - } - keyField := &protoField{} - if err := memberTypeToProtobufField(locator, keyField, t.Key); err != nil { - return err - } - // All other protobuf types have kind types.Protobuf, so setting types.Map - // here would be very misleading. - field.Type = &types.Type{ - Kind: types.Protobuf, - Key: keyField.Type, - Elem: valueField.Type, - } - if !strings.HasPrefix(t.Name.Name, "map[") { - field.Extras["(gogoproto.casttype)"] = strconv.Quote(locator.CastTypeName(t.Name)) - } - if k, ok := keyField.Extras["(gogoproto.casttype)"]; ok { - field.Extras["(gogoproto.castkey)"] = k - } - if v, ok := valueField.Extras["(gogoproto.casttype)"]; ok { - field.Extras["(gogoproto.castvalue)"] = v - } - field.Map = true - case types.Pointer: - if err := memberTypeToProtobufField(locator, field, t.Elem); err != nil { - return err - } - field.Nullable = true - case types.Alias: - if isOptionalAlias(t) { - field.Type, err = locator.ProtoTypeFor(t) - field.Nullable = true - } else { - if err := memberTypeToProtobufField(locator, field, t.Underlying); err != nil { - log.Printf("failed to alias: %s %s: err %v", t.Name, t.Underlying.Name, err) - return err - } - // If this is not an alias to a slice, cast to the alias - if !field.Repeated { - if field.Extras == nil { - field.Extras = make(map[string]string) - } - field.Extras["(gogoproto.casttype)"] = strconv.Quote(locator.CastTypeName(t.Name)) - } - } - case types.Slice: - if t.Elem.Name.Name == "byte" && len(t.Elem.Name.Package) == 0 { - field.Type = &types.Type{Name: types.Name{Name: "bytes"}, Kind: types.Protobuf} - return nil - } - if err := memberTypeToProtobufField(locator, field, t.Elem); err != nil { - return err - } - field.Repeated = true - case types.Struct: - if len(t.Name.Name) == 0 { - return errUnrecognizedType - } - field.Type, err = locator.ProtoTypeFor(t) - field.Nullable = false - default: - return errUnrecognizedType - } - return err -} - -// protobufTagToField extracts information from an existing protobuf tag -func protobufTagToField(tag string, field *protoField, m types.Member, t *types.Type, localPackage types.Name) error { - if len(tag) == 0 || tag == "-" { - return nil - } - - // protobuf:"bytes,3,opt,name=Id,customtype=github.com/gogo/protobuf/test.Uuid" - parts := strings.Split(tag, ",") - if len(parts) < 3 { - return fmt.Errorf("member %q of %q malformed 'protobuf' tag, not enough segments\n", m.Name, t.Name) - } - protoTag, err := strconv.Atoi(parts[1]) - if err != nil { - return fmt.Errorf("member %q of %q malformed 'protobuf' tag, field ID is %q which is not an integer: %v\n", m.Name, t.Name, parts[1], err) - } - field.Tag = protoTag - - // In general there is doesn't make sense to parse the protobuf tags to get the type, - // as all auto-generated once will have wire type "bytes", "varint" or "fixed64". - // However, sometimes we explicitly set them to have a custom serialization, e.g.: - // type Time struct { - // time.Time `protobuf:"Timestamp,1,req,name=time"` - // } - // to force the generator to use a given type (that we manually wrote serialization & - // deserialization methods for). - switch parts[0] { - case "varint", "fixed32", "fixed64", "bytes", "group": - default: - var name types.Name - if last := strings.LastIndex(parts[0], "."); last != -1 { - prefix := parts[0][:last] - name = types.Name{ - Name: parts[0][last+1:], - Package: prefix, - Path: strings.Replace(prefix, ".", "/", -1), - } - } else { - name = types.Name{ - Name: parts[0], - Package: localPackage.Package, - Path: localPackage.Path, - } - } - field.Type = &types.Type{ - Name: name, - Kind: types.Protobuf, - } - } - - protoExtra := make(map[string]string) - for i, extra := range parts[3:] { - parts := strings.SplitN(extra, "=", 2) - if len(parts) != 2 { - return fmt.Errorf("member %q of %q malformed 'protobuf' tag, tag %d should be key=value, got %q\n", m.Name, t.Name, i+4, extra) - } - switch parts[0] { - case "name": - protoExtra[parts[0]] = parts[1] - case "casttype", "castkey", "castvalue": - parts[0] = fmt.Sprintf("(gogoproto.%s)", parts[0]) - protoExtra[parts[0]] = strconv.Quote(parts[1]) - } - } - - field.Extras = protoExtra - if name, ok := protoExtra["name"]; ok { - field.Name = name - delete(protoExtra, "name") - } - - return nil -} - -func membersToFields(locator ProtobufLocator, t *types.Type, localPackage types.Name, omitFieldTypes map[types.Name]struct{}) ([]protoField, error) { - fields := []protoField{} - - for _, m := range t.Members { - if namer.IsPrivateGoName(m.Name) { - // skip private fields - continue - } - if _, ok := omitFieldTypes[types.Name{Name: m.Type.Name.Name, Package: m.Type.Name.Package}]; ok { - continue - } - tags := reflect.StructTag(m.Tags) - field := protoField{ - LocalPackage: localPackage, - - Tag: -1, - Extras: make(map[string]string), - } - - protobufTag := tags.Get("protobuf") - if protobufTag == "-" { - continue - } - - if err := protobufTagToField(protobufTag, &field, m, t, localPackage); err != nil { - return nil, err - } - - // extract information from JSON field tag - if tag := tags.Get("json"); len(tag) > 0 { - parts := strings.Split(tag, ",") - if len(field.Name) == 0 && len(parts[0]) != 0 { - field.Name = parts[0] - } - if field.Tag == -1 && field.Name == "-" { - continue - } - } - - if field.Type == nil { - if err := memberTypeToProtobufField(locator, &field, m.Type); err != nil { - return nil, fmt.Errorf("unable to embed type %q as field %q in %q: %v", m.Type, field.Name, t.Name, err) - } - } - if len(field.Name) == 0 { - field.Name = namer.IL(m.Name) - } - - if field.Map && field.Repeated { - // maps cannot be repeated - field.Repeated = false - field.Nullable = true - } - - if !field.Nullable { - field.Extras["(gogoproto.nullable)"] = "false" - } - if (field.Type.Name.Name == "bytes" && field.Type.Name.Package == "") || (field.Repeated && field.Type.Name.Package == "" && namer.IsPrivateGoName(field.Type.Name.Name)) { - delete(field.Extras, "(gogoproto.nullable)") - } - if field.Name != m.Name { - field.Extras["(gogoproto.customname)"] = strconv.Quote(m.Name) - } - field.CommentLines = m.CommentLines - fields = append(fields, field) - } - - // assign tags - highest := 0 - byTag := make(map[int]*protoField) - // fields are in Go struct order, which we preserve - for i := range fields { - field := &fields[i] - tag := field.Tag - if tag != -1 { - if existing, ok := byTag[tag]; ok { - return nil, fmt.Errorf("field %q and %q both have tag %d", field.Name, existing.Name, tag) - } - byTag[tag] = field - } - if tag > highest { - highest = tag - } - } - // starting from the highest observed tag, assign new field tags - for i := range fields { - field := &fields[i] - if field.Tag != -1 { - continue - } - highest++ - field.Tag = highest - byTag[field.Tag] = field - } - return fields, nil -} - -func genComment(out io.Writer, lines []string, indent string) { - for { - l := len(lines) - if l == 0 || len(lines[l-1]) != 0 { - break - } - lines = lines[:l-1] - } - for _, c := range lines { - if len(c) == 0 { - fmt.Fprintf(out, "%s//\n", indent) // avoid trailing whitespace - continue - } - fmt.Fprintf(out, "%s// %s\n", indent, c) - } -} - -func formatProtoFile(source []byte) ([]byte, error) { - // TODO; Is there any protobuf formatter? - return source, nil -} - -func assembleProtoFile(w io.Writer, f *generator.File) { - w.Write(f.Header) - - fmt.Fprint(w, "syntax = \"proto2\";\n\n") - - if len(f.PackageName) > 0 { - fmt.Fprintf(w, "package %s;\n\n", f.PackageName) - } - - if len(f.Imports) > 0 { - imports := []string{} - for i := range f.Imports { - imports = append(imports, i) - } - sort.Strings(imports) - for _, s := range imports { - fmt.Fprintf(w, "import %q;\n", s) - } - fmt.Fprint(w, "\n") - } - - if f.Vars.Len() > 0 { - fmt.Fprintf(w, "%s\n", f.Vars.String()) - } - - w.Write(f.Body.Bytes()) -} - -func NewProtoFile() *generator.DefaultFileType { - return &generator.DefaultFileType{ - Format: formatProtoFile, - Assemble: assembleProtoFile, - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go deleted file mode 100644 index 08a991b15544..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -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 protobuf - -import ( - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -type ImportTracker struct { - namer.DefaultImportTracker -} - -func NewImportTracker(local types.Name, typesToAdd ...*types.Type) *ImportTracker { - tracker := namer.NewDefaultImportTracker(local) - tracker.IsInvalidType = func(t *types.Type) bool { return t.Kind != types.Protobuf } - tracker.LocalName = func(name types.Name) string { return name.Package } - tracker.PrintImport = func(path, name string) string { return path } - - tracker.AddTypes(typesToAdd...) - return &ImportTracker{ - DefaultImportTracker: tracker, - } -} - -// AddNullable ensures that support for the nullable Gogo-protobuf extension is added. -func (tracker *ImportTracker) AddNullable() { - tracker.AddType(&types.Type{ - Kind: types.Protobuf, - Name: types.Name{ - Name: "nullable", - Package: "gogoproto", - Path: "github.com/gogo/protobuf/gogoproto/gogo.proto", - }, - }) -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go deleted file mode 100644 index e3b21c6703f6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/namer.go +++ /dev/null @@ -1,208 +0,0 @@ -/* -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 protobuf - -import ( - "fmt" - "reflect" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -type localNamer struct { - localPackage types.Name -} - -func (n localNamer) Name(t *types.Type) string { - if t.Key != nil && t.Elem != nil { - return fmt.Sprintf("map<%s, %s>", n.Name(t.Key), n.Name(t.Elem)) - } - if len(n.localPackage.Package) != 0 && n.localPackage.Package == t.Name.Package { - return t.Name.Name - } - return t.Name.String() -} - -type protobufNamer struct { - packages []*protobufPackage - packagesByPath map[string]*protobufPackage -} - -func NewProtobufNamer() *protobufNamer { - return &protobufNamer{ - packagesByPath: make(map[string]*protobufPackage), - } -} - -func (n *protobufNamer) Name(t *types.Type) string { - if t.Kind == types.Map { - return fmt.Sprintf("map<%s, %s>", n.Name(t.Key), n.Name(t.Elem)) - } - return t.Name.String() -} - -func (n *protobufNamer) List() []generator.Package { - packages := make([]generator.Package, 0, len(n.packages)) - for i := range n.packages { - packages = append(packages, n.packages[i]) - } - return packages -} - -func (n *protobufNamer) Add(p *protobufPackage) { - if _, ok := n.packagesByPath[p.PackagePath]; !ok { - n.packagesByPath[p.PackagePath] = p - n.packages = append(n.packages, p) - } -} - -func (n *protobufNamer) GoNameToProtoName(name types.Name) types.Name { - if p, ok := n.packagesByPath[name.Package]; ok { - return types.Name{ - Name: name.Name, - Package: p.PackageName, - Path: p.ImportPath(), - } - } - for _, p := range n.packages { - if _, ok := p.FilterTypes[name]; ok { - return types.Name{ - Name: name.Name, - Package: p.PackageName, - Path: p.ImportPath(), - } - } - } - return types.Name{Name: name.Name} -} - -func protoSafePackage(name string) string { - pkg := strings.Replace(name, "/", ".", -1) - return strings.Replace(pkg, "-", "_", -1) -} - -type typeNameSet map[types.Name]*protobufPackage - -// assignGoTypeToProtoPackage looks for Go and Protobuf types that are referenced by a type in -// a package. It will not recurse into protobuf types. -func assignGoTypeToProtoPackage(p *protobufPackage, t *types.Type, local, global typeNameSet, optional map[types.Name]struct{}) { - newT, isProto := isFundamentalProtoType(t) - if isProto { - t = newT - } - if otherP, ok := global[t.Name]; ok { - if _, ok := local[t.Name]; !ok { - p.Imports.AddType(&types.Type{ - Kind: types.Protobuf, - Name: otherP.ProtoTypeName(), - }) - } - return - } - if t.Name.Package == p.PackagePath { - // Associate types only to their own package - global[t.Name] = p - } - if _, ok := local[t.Name]; ok { - return - } - // don't recurse into existing proto types - if isProto { - p.Imports.AddType(t) - return - } - - local[t.Name] = p - for _, m := range t.Members { - if namer.IsPrivateGoName(m.Name) { - continue - } - field := &protoField{} - tag := reflect.StructTag(m.Tags).Get("protobuf") - if tag == "-" { - continue - } - if err := protobufTagToField(tag, field, m, t, p.ProtoTypeName()); err == nil && field.Type != nil { - assignGoTypeToProtoPackage(p, field.Type, local, global, optional) - continue - } - assignGoTypeToProtoPackage(p, m.Type, local, global, optional) - } - // TODO: should methods be walked? - if t.Elem != nil { - assignGoTypeToProtoPackage(p, t.Elem, local, global, optional) - } - if t.Key != nil { - assignGoTypeToProtoPackage(p, t.Key, local, global, optional) - } - if t.Underlying != nil { - if t.Kind == types.Alias && isOptionalAlias(t) { - optional[t.Name] = struct{}{} - } - assignGoTypeToProtoPackage(p, t.Underlying, local, global, optional) - } -} - -// isTypeApplicableToProtobuf checks to see if a type is relevant for protobuf processing. -// Currently, it filters out functions and private types. -func isTypeApplicableToProtobuf(t *types.Type) bool { - // skip functions -- we don't care about them for protobuf - if t.Kind == types.Func || (t.Kind == types.DeclarationOf && t.Underlying.Kind == types.Func) { - return false - } - // skip private types - if namer.IsPrivateGoName(t.Name.Name) { - return false - } - - return true -} - -func (n *protobufNamer) AssignTypesToPackages(c *generator.Context) error { - global := make(typeNameSet) - for _, p := range n.packages { - local := make(typeNameSet) - optional := make(map[types.Name]struct{}) - p.Imports = NewImportTracker(p.ProtoTypeName()) - for _, t := range c.Order { - if t.Name.Package != p.PackagePath { - continue - } - if !isTypeApplicableToProtobuf(t) { - // skip types that we don't care about, like functions - continue - } - assignGoTypeToProtoPackage(p, t, local, global, optional) - } - p.FilterTypes = make(map[types.Name]struct{}) - p.LocalNames = make(map[string]struct{}) - p.OptionalTypeNames = make(map[string]struct{}) - for k, v := range local { - if v == p { - p.FilterTypes[k] = struct{}{} - p.LocalNames[k.Name] = struct{}{} - if _, ok := optional[k]; ok { - p.OptionalTypeNames[k.Name] = struct{}{} - } - } - } - } - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/package.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/package.go deleted file mode 100644 index bed4c3e30617..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/package.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -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 protobuf - -import ( - "fmt" - "go/ast" - "log" - "os" - "path/filepath" - "reflect" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" -) - -func newProtobufPackage(packagePath, packageName string, generateAll bool, omitFieldTypes map[types.Name]struct{}) *protobufPackage { - pkg := &protobufPackage{ - DefaultPackage: generator.DefaultPackage{ - // The protobuf package name (foo.bar.baz) - PackageName: packageName, - // A path segment relative to the GOPATH root (foo/bar/baz) - PackagePath: packagePath, - HeaderText: []byte( - ` -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -`), - PackageDocumentation: []byte(fmt.Sprintf( - `// Package %s is an autogenerated protobuf IDL. -`, packageName)), - }, - GenerateAll: generateAll, - OmitFieldTypes: omitFieldTypes, - } - pkg.FilterFunc = pkg.filterFunc - pkg.GeneratorFunc = pkg.generatorFunc - return pkg -} - -// protobufPackage contains the protobuf implementation of Package. -type protobufPackage struct { - generator.DefaultPackage - - // If true, this package has been vendored into our source tree and thus can - // only be generated by changing the vendor tree. - Vendored bool - - // If true, generate protobuf serializations for all public types. - // If false, only generate protobuf serializations for structs that - // request serialization. - GenerateAll bool - - // A list of types to filter to; if not specified all types will be included. - FilterTypes map[types.Name]struct{} - - // If true, omit any gogoprotobuf extensions not defined as types. - OmitGogo bool - - // A list of field types that will be excluded from the output struct - OmitFieldTypes map[types.Name]struct{} - - // A list of names that this package exports - LocalNames map[string]struct{} - - // A list of type names in this package that will need marshaller rewriting - // to remove synthetic protobuf fields. - OptionalTypeNames map[string]struct{} - - // A list of struct tags to generate onto named struct fields - StructTags map[string]map[string]string - - // An import tracker for this package - Imports *ImportTracker -} - -func (p *protobufPackage) Clean(outputBase string) error { - for _, s := range []string{p.ImportPath(), p.OutputPath()} { - if err := os.Remove(filepath.Join(outputBase, s)); err != nil && !os.IsNotExist(err) { - return err - } - } - return nil -} - -func (p *protobufPackage) ProtoTypeName() types.Name { - return types.Name{ - Name: p.Path(), // the go path "foo/bar/baz" - Package: p.Name(), // the protobuf package "foo.bar.baz" - Path: p.ImportPath(), // the path of the import to get the proto - } -} - -func (p *protobufPackage) filterFunc(c *generator.Context, t *types.Type) bool { - switch t.Kind { - case types.Func, types.Chan: - return false - case types.Struct: - if t.Name.Name == "struct{}" { - return false - } - case types.Builtin: - return false - case types.Alias: - if !isOptionalAlias(t) { - return false - } - case types.Slice, types.Array, types.Map: - return false - case types.Pointer: - return false - } - if _, ok := isFundamentalProtoType(t); ok { - return false - } - _, ok := p.FilterTypes[t.Name] - return ok -} - -func (p *protobufPackage) HasGoType(name string) bool { - _, ok := p.LocalNames[name] - return ok -} - -func (p *protobufPackage) OptionalTypeName(name string) bool { - _, ok := p.OptionalTypeNames[name] - return ok -} - -func (p *protobufPackage) ExtractGeneratedType(t *ast.TypeSpec) bool { - if !p.HasGoType(t.Name.Name) { - return false - } - - switch s := t.Type.(type) { - case *ast.StructType: - for i, f := range s.Fields.List { - if len(f.Tag.Value) == 0 { - continue - } - tag := strings.Trim(f.Tag.Value, "`") - protobufTag := reflect.StructTag(tag).Get("protobuf") - if len(protobufTag) == 0 { - continue - } - if len(f.Names) > 1 { - log.Printf("WARNING: struct %s field %d %s: defined multiple names but single protobuf tag", t.Name.Name, i, f.Names[0].Name) - // TODO hard error? - } - if p.StructTags == nil { - p.StructTags = make(map[string]map[string]string) - } - m := p.StructTags[t.Name.Name] - if m == nil { - m = make(map[string]string) - p.StructTags[t.Name.Name] = m - } - m[f.Names[0].Name] = tag - } - default: - log.Printf("WARNING: unexpected Go AST type definition: %#v", t) - } - - return true -} - -func (p *protobufPackage) generatorFunc(c *generator.Context) []generator.Generator { - generators := []generator.Generator{} - - p.Imports.AddNullable() - - generators = append(generators, &genProtoIDL{ - DefaultGen: generator.DefaultGen{ - OptionalName: "generated", - }, - localPackage: types.Name{Package: p.PackageName, Path: p.PackagePath}, - localGoPackage: types.Name{Package: p.PackagePath, Name: p.GoPackageName()}, - imports: p.Imports, - generateAll: p.GenerateAll, - omitGogo: p.OmitGogo, - omitFieldTypes: p.OmitFieldTypes, - }) - return generators -} - -func (p *protobufPackage) GoPackageName() string { - return filepath.Base(p.PackagePath) -} - -func (p *protobufPackage) ImportPath() string { - return filepath.Join(p.PackagePath, "generated.proto") -} - -func (p *protobufPackage) OutputPath() string { - return filepath.Join(p.PackagePath, "generated.pb.go") -} - -var ( - _ = generator.Package(&protobufPackage{}) -) diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go deleted file mode 100644 index c4cf66e74475..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go +++ /dev/null @@ -1,463 +0,0 @@ -/* -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 protobuf - -import ( - "bytes" - "errors" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/printer" - "go/token" - "os" - "reflect" - "strings" - - customreflect "k8s.io/code-generator/third_party/forked/golang/reflect" -) - -func rewriteFile(name string, header []byte, rewriteFn func(*token.FileSet, *ast.File) error) error { - fset := token.NewFileSet() - src, err := os.ReadFile(name) - if err != nil { - return err - } - file, err := parser.ParseFile(fset, name, src, parser.DeclarationErrors|parser.ParseComments) - if err != nil { - return err - } - - if err := rewriteFn(fset, file); err != nil { - return err - } - - b := &bytes.Buffer{} - b.Write(header) - if err := printer.Fprint(b, fset, file); err != nil { - return err - } - - body, err := format.Source(b.Bytes()) - if err != nil { - return err - } - - f, err := os.OpenFile(name, os.O_WRONLY|os.O_TRUNC, 0644) - if err != nil { - return err - } - defer f.Close() - if _, err := f.Write(body); err != nil { - return err - } - return f.Close() -} - -// ExtractFunc extracts information from the provided TypeSpec and returns true if the type should be -// removed from the destination file. -type ExtractFunc func(*ast.TypeSpec) bool - -// OptionalFunc returns true if the provided local name is a type that has protobuf.nullable=true -// and should have its marshal functions adjusted to remove the 'Items' accessor. -type OptionalFunc func(name string) bool - -func RewriteGeneratedGogoProtobufFile(name string, extractFn ExtractFunc, optionalFn OptionalFunc, header []byte) error { - return rewriteFile(name, header, func(fset *token.FileSet, file *ast.File) error { - cmap := ast.NewCommentMap(fset, file, file.Comments) - - // transform methods that point to optional maps or slices - for _, d := range file.Decls { - rewriteOptionalMethods(d, optionalFn) - } - - // remove types that are already declared - decls := []ast.Decl{} - for _, d := range file.Decls { - if dropExistingTypeDeclarations(d, extractFn) { - continue - } - if dropEmptyImportDeclarations(d) { - continue - } - decls = append(decls, d) - } - file.Decls = decls - - // remove unmapped comments - file.Comments = cmap.Filter(file).Comments() - return nil - }) -} - -// rewriteOptionalMethods makes specific mutations to marshaller methods that belong to types identified -// as being "optional" (they may be nil on the wire). This allows protobuf to serialize a map or slice and -// properly discriminate between empty and nil (which is not possible in protobuf). -// TODO: move into upstream gogo-protobuf once https://github.com/gogo/protobuf/issues/181 -// has agreement -func rewriteOptionalMethods(decl ast.Decl, isOptional OptionalFunc) { - switch t := decl.(type) { - case *ast.FuncDecl: - ident, ptr, ok := receiver(t) - if !ok { - return - } - - // correct initialization of the form `m.Field = &OptionalType{}` to - // `m.Field = OptionalType{}` - if t.Name.Name == "Unmarshal" { - ast.Walk(optionalAssignmentVisitor{fn: isOptional}, t.Body) - } - - if !isOptional(ident.Name) { - return - } - - switch t.Name.Name { - case "Unmarshal": - ast.Walk(&optionalItemsVisitor{}, t.Body) - case "MarshalTo", "Size", "String", "MarshalToSizedBuffer": - ast.Walk(&optionalItemsVisitor{}, t.Body) - fallthrough - case "Marshal": - // if the method has a pointer receiver, set it back to a normal receiver - if ptr { - t.Recv.List[0].Type = ident - } - } - } -} - -type optionalAssignmentVisitor struct { - fn OptionalFunc -} - -// Visit walks the provided node, transforming field initializations of the form -// m.Field = &OptionalType{} -> m.Field = OptionalType{} -func (v optionalAssignmentVisitor) Visit(n ast.Node) ast.Visitor { - switch t := n.(type) { - case *ast.AssignStmt: - if len(t.Lhs) == 1 && len(t.Rhs) == 1 { - if !isFieldSelector(t.Lhs[0], "m", "") { - return nil - } - unary, ok := t.Rhs[0].(*ast.UnaryExpr) - if !ok || unary.Op != token.AND { - return nil - } - composite, ok := unary.X.(*ast.CompositeLit) - if !ok || composite.Type == nil || len(composite.Elts) != 0 { - return nil - } - if ident, ok := composite.Type.(*ast.Ident); ok && v.fn(ident.Name) { - t.Rhs[0] = composite - } - } - return nil - } - return v -} - -type optionalItemsVisitor struct{} - -// Visit walks the provided node, looking for specific patterns to transform that match -// the effective outcome of turning struct{ map[x]y || []x } into map[x]y or []x. -func (v *optionalItemsVisitor) Visit(n ast.Node) ast.Visitor { - switch t := n.(type) { - case *ast.RangeStmt: - if isFieldSelector(t.X, "m", "Items") { - t.X = &ast.Ident{Name: "m"} - } - case *ast.AssignStmt: - if len(t.Lhs) == 1 && len(t.Rhs) == 1 { - switch lhs := t.Lhs[0].(type) { - case *ast.IndexExpr: - if isFieldSelector(lhs.X, "m", "Items") { - lhs.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - default: - if isFieldSelector(t.Lhs[0], "m", "Items") { - t.Lhs[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - switch rhs := t.Rhs[0].(type) { - case *ast.CallExpr: - if ident, ok := rhs.Fun.(*ast.Ident); ok && ident.Name == "append" { - ast.Walk(v, rhs) - if len(rhs.Args) > 0 { - switch arg := rhs.Args[0].(type) { - case *ast.Ident: - if arg.Name == "m" { - rhs.Args[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - } - return nil - } - } - } - case *ast.IfStmt: - switch cond := t.Cond.(type) { - case *ast.BinaryExpr: - if cond.Op == token.EQL { - if isFieldSelector(cond.X, "m", "Items") && isIdent(cond.Y, "nil") { - cond.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - } - if t.Init != nil { - // Find form: - // if err := m[len(m.Items)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { - // return err - // } - switch s := t.Init.(type) { - case *ast.AssignStmt: - if call, ok := s.Rhs[0].(*ast.CallExpr); ok { - if sel, ok := call.Fun.(*ast.SelectorExpr); ok { - if x, ok := sel.X.(*ast.IndexExpr); ok { - // m[] -> (*m)[] - if sel2, ok := x.X.(*ast.SelectorExpr); ok { - if ident, ok := sel2.X.(*ast.Ident); ok && ident.Name == "m" { - x.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - // len(m.Items) -> len(*m) - if bin, ok := x.Index.(*ast.BinaryExpr); ok { - if call2, ok := bin.X.(*ast.CallExpr); ok && len(call2.Args) == 1 { - if isFieldSelector(call2.Args[0], "m", "Items") { - call2.Args[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} - } - } - } - } - } - } - } - } - case *ast.IndexExpr: - if isFieldSelector(t.X, "m", "Items") { - t.X = &ast.Ident{Name: "m"} - return nil - } - case *ast.CallExpr: - changed := false - for i := range t.Args { - if isFieldSelector(t.Args[i], "m", "Items") { - t.Args[i] = &ast.Ident{Name: "m"} - changed = true - } - } - if changed { - return nil - } - } - return v -} - -func isFieldSelector(n ast.Expr, name, field string) bool { - s, ok := n.(*ast.SelectorExpr) - if !ok || s.Sel == nil || (field != "" && s.Sel.Name != field) { - return false - } - return isIdent(s.X, name) -} - -func isIdent(n ast.Expr, value string) bool { - ident, ok := n.(*ast.Ident) - return ok && ident.Name == value -} - -func receiver(f *ast.FuncDecl) (ident *ast.Ident, pointer bool, ok bool) { - if f.Recv == nil || len(f.Recv.List) != 1 { - return nil, false, false - } - switch t := f.Recv.List[0].Type.(type) { - case *ast.StarExpr: - identity, ok := t.X.(*ast.Ident) - if !ok { - return nil, false, false - } - return identity, true, true - case *ast.Ident: - return t, false, true - } - return nil, false, false -} - -// dropExistingTypeDeclarations removes any type declaration for which extractFn returns true. The function -// returns true if the entire declaration should be dropped. -func dropExistingTypeDeclarations(decl ast.Decl, extractFn ExtractFunc) bool { - switch t := decl.(type) { - case *ast.GenDecl: - if t.Tok != token.TYPE { - return false - } - specs := []ast.Spec{} - for _, s := range t.Specs { - switch spec := s.(type) { - case *ast.TypeSpec: - if extractFn(spec) { - continue - } - specs = append(specs, spec) - } - } - if len(specs) == 0 { - return true - } - t.Specs = specs - } - return false -} - -// dropEmptyImportDeclarations strips any generated but no-op imports from the generated code -// to prevent generation from being able to define side-effects. The function returns true -// if the entire declaration should be dropped. -func dropEmptyImportDeclarations(decl ast.Decl) bool { - switch t := decl.(type) { - case *ast.GenDecl: - if t.Tok != token.IMPORT { - return false - } - specs := []ast.Spec{} - for _, s := range t.Specs { - switch spec := s.(type) { - case *ast.ImportSpec: - if spec.Name != nil && spec.Name.Name == "_" { - continue - } - specs = append(specs, spec) - } - } - if len(specs) == 0 { - return true - } - t.Specs = specs - } - return false -} - -func RewriteTypesWithProtobufStructTags(name string, structTags map[string]map[string]string) error { - return rewriteFile(name, []byte{}, func(fset *token.FileSet, file *ast.File) error { - allErrs := []error{} - - // set any new struct tags - for _, d := range file.Decls { - if errs := updateStructTags(d, structTags, []string{"protobuf"}); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - } - - if len(allErrs) > 0 { - var s string - for _, err := range allErrs { - s += err.Error() + "\n" - } - return errors.New(s) - } - return nil - }) -} - -func getFieldName(expr ast.Expr, structname string) (name string, err error) { - for { - switch t := expr.(type) { - case *ast.Ident: - return t.Name, nil - case *ast.SelectorExpr: - return t.Sel.Name, nil - case *ast.StarExpr: - expr = t.X - default: - return "", fmt.Errorf("unable to get name for tag from struct %q, field %#v", structname, t) - } - } -} - -func updateStructTags(decl ast.Decl, structTags map[string]map[string]string, toCopy []string) []error { - var errs []error - t, ok := decl.(*ast.GenDecl) - if !ok { - return nil - } - if t.Tok != token.TYPE { - return nil - } - - for _, s := range t.Specs { - spec, ok := s.(*ast.TypeSpec) - if !ok { - continue - } - typeName := spec.Name.Name - fieldTags, ok := structTags[typeName] - if !ok { - continue - } - st, ok := spec.Type.(*ast.StructType) - if !ok { - continue - } - - for i := range st.Fields.List { - f := st.Fields.List[i] - var name string - var err error - if len(f.Names) == 0 { - name, err = getFieldName(f.Type, spec.Name.Name) - if err != nil { - errs = append(errs, err) - continue - } - } else { - name = f.Names[0].Name - } - value, ok := fieldTags[name] - if !ok { - continue - } - var tags customreflect.StructTags - if f.Tag != nil { - oldTags, err := customreflect.ParseStructTags(strings.Trim(f.Tag.Value, "`")) - if err != nil { - errs = append(errs, fmt.Errorf("unable to read struct tag from struct %q, field %q: %v", spec.Name.Name, name, err)) - continue - } - tags = oldTags - } - for _, name := range toCopy { - // don't overwrite existing tags - if tags.Has(name) { - continue - } - // append new tags - if v := reflect.StructTag(value).Get(name); len(v) > 0 { - tags = append(tags, customreflect.StructTag{Name: name, Value: v}) - } - } - if len(tags) == 0 { - continue - } - if f.Tag == nil { - f.Tag = &ast.BasicLit{} - } - f.Tag.Value = tags.String() - } - } - return errs -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go deleted file mode 100644 index 6cfa37886b44..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/tags.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 protobuf - -import ( - "k8s.io/gengo/types" - "k8s.io/klog/v2" -) - -// extractBoolTagOrDie gets the comment-tags for the key and asserts that, if -// it exists, the value is boolean. If the tag did not exist, it returns -// false. -func extractBoolTagOrDie(key string, lines []string) bool { - val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines) - if err != nil { - klog.Fatal(err) - } - return val -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/.gitignore b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/.gitignore deleted file mode 100644 index a5c47b66f833..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/.gitignore +++ /dev/null @@ -1 +0,0 @@ -import-boss diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/README.md b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/README.md deleted file mode 100644 index 88dc010ef687..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/README.md +++ /dev/null @@ -1,97 +0,0 @@ -## Purpose - -- `import-boss` enforces import restrictions against all pull requests submitted to the [k/k](https://github.com/kubernetes/kubernetes) repository. There are a number of `.import-restrictions` files that in the [k/k](https://github.com/kubernetes/kubernetes) repository, all of which are defined in `YAML` (or `JSON`) format. - -## How does it work? - -- When a directory is verified, `import-boss` looks for a file called `.import-restrictions`. If this file is not found, `import-boss` will go up to the parent directory until it finds this `.import-restrictions` file. - -- Adding `.import-restrictions` files does not add them to CI runs. They need to be explicitly added to `hack/verify-import-boss.sh`. Once an `.import-restrictions` file is added, all of the sub-packages of this file's directory are added as well. - -### What are Rules? - -- If an `.import-restrictions` file is found, then all imports of the package are checked against each `rule` in the file. A `rule` consists of three parts: - - A `SelectorRegexp`, to select the import paths that the rule applies to. - - A list of `AllowedPrefixes` - - A list of `ForbiddenPrefixes` - -- An import is allowed if it matches at least one allowed prefix and does not match any forbidden prefixes. An example `.import-restrictions` file looks like this: - -```json -{ - "Rules": [ - { - "SelectorRegexp": "k8s[.]io", - "AllowedPrefixes": [ - "k8s.io/gengo/examples", - "k8s.io/kubernetes/third_party" - ], - "ForbiddenPrefixes": [ - "k8s.io/kubernetes/pkg/third_party/deprecated" - ] - }, - { - "SelectorRegexp": "^unsafe$", - "AllowedPrefixes": [ - ], - "ForbiddenPrefixes": [ - "" - ] - } - ] -} -``` -- Take note of `"SelectorRegexp": "k8s[.]io"` in the first block. This specifies that we are applying these rules to the `"k8s.io"` import path. -- The second block explicitly matches the "unsafe" package, and forbids it ("" is a prefix of everything). - -### What are Inverse Rules? - -- In contrast to non-inverse rules, which are defined in importing packages, inverse rules are defined in imported packages. - -- Inverse rules allow for fine-grained import restrictions for "private packages" where we don't want to spread use inside of [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes). - -- If an `.import-restrictions` file is found, then all imports of the package are checked against each `inverse rule` in the file. This check will continue, climbing up the directory tree, until a match is found and accepted. - -- Inverse rules also have a boolean `transitive` option. When this option is true, the import rule is also applied to `transitive` imports. - - `transitive` imports are dependencies not directly depended on by the code, but are needed to run the application. Use this option if you want to apply restrictions to those indirect dependencies. - -```yaml -rules: - - selectorRegexp: k8s[.]io - allowedPrefixes: - - k8s.io/gengo/examples - - k8s.io/kubernetes/third_party - forbiddenPrefixes: - - k8s.io/kubernetes/pkg/third_party/deprecated - - selectorRegexp: ^unsafe$ - forbiddenPrefixes: - - "" -inverseRules: - - selectorRegexp: k8s[.]io - allowedPrefixes: - - k8s.io/same-repo - - k8s.io/kubernetes/pkg/legacy - forbiddenPrefixes: - - k8s.io/kubernetes/pkg/legacy/subpkg - - selectorRegexp: k8s[.]io - transitive: true - forbiddenPrefixes: - - k8s.io/kubernetes/cmd/kubelet - - k8s.io/kubernetes/cmd/kubectl -``` - -## How do I run import-boss within the k/k repo? - -- In order to include _test.go files, make sure to pass in the `include-test-files` flag: - ```sh - hack/verify-import-boss.sh --include-test-files=true - ``` - -- To include other directories, pass in a directory or directories using the `input-dirs` flag: - ```sh - hack/verify-import-boss.sh --input-dirs="k8s.io/kubernetes/test/e2e/framework/..." - ``` - -## Reference - -- [import-boss](https://github.com/kubernetes/gengo/tree/master/examples/import-boss) \ No newline at end of file diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/main.go deleted file mode 100644 index 34373c541174..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/import-boss/main.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// import-boss enforces import restrictions in a given repository. -package main - -import ( - "os" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/import-boss/generators" - - "k8s.io/klog/v2" -) - -func main() { - klog.InitFlags(nil) - arguments := args.Default() - - pflag.CommandLine.BoolVar(&arguments.IncludeTestFiles, "include-test-files", false, "If true, include *_test.go files.") - - if err := arguments.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Errorf("Error: %v", err) - os.Exit(1) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go deleted file mode 100644 index ffd073a86b41..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "fmt" - "path" - - "github.com/spf13/pflag" - codegenutil "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct { - VersionedClientSetPackage string - InternalClientSetPackage string - ListersPackage string - SingleDirectory bool - - // PluralExceptions define a list of pluralizer exceptions in Type:PluralType format. - // The default list is "Endpoints:Endpoints" - PluralExceptions []string -} - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{ - SingleDirectory: false, - PluralExceptions: []string{"Endpoints:Endpoints"}, - } - genericArgs.CustomArgs = customArgs - - if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { - genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/informers") - customArgs.VersionedClientSetPackage = path.Join(pkg, "pkg/client/clientset/versioned") - customArgs.InternalClientSetPackage = path.Join(pkg, "pkg/client/clientset/internalversion") - customArgs.ListersPackage = path.Join(pkg, "pkg/client/listers") - } - - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&ca.InternalClientSetPackage, "internal-clientset-package", ca.InternalClientSetPackage, "the full package name for the internal clientset to use") - fs.StringVar(&ca.VersionedClientSetPackage, "versioned-clientset-package", ca.VersionedClientSetPackage, "the full package name for the versioned clientset to use") - fs.StringVar(&ca.ListersPackage, "listers-package", ca.ListersPackage, "the full package name for the listers to use") - fs.BoolVar(&ca.SingleDirectory, "single-directory", ca.SingleDirectory, "if true, omit the intermediate \"internalversion\" and \"externalversions\" subdirectories") - fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType format") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - customArgs := genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - if len(customArgs.VersionedClientSetPackage) == 0 { - return fmt.Errorf("versioned clientset package cannot be empty") - } - if len(customArgs.ListersPackage) == 0 { - return fmt.Errorf("listers package cannot be empty") - } - - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go deleted file mode 100644 index 4875393913b9..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factory.go +++ /dev/null @@ -1,340 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "io" - "path" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" -) - -// factoryGenerator produces a file of listers for a given GroupVersion and -// type. -type factoryGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - groupVersions map[string]clientgentypes.GroupVersions - gvGoNames map[string]string - clientSetPackage string - internalInterfacesPackage string - filtered bool -} - -var _ generator.Generator = &factoryGenerator{} - -func (g *factoryGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *factoryGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *factoryGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -func (g *factoryGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "{{", "}}") - - klog.V(5).Infof("processing type %v", t) - - gvInterfaces := make(map[string]*types.Type) - gvNewFuncs := make(map[string]*types.Type) - for groupPkgName := range g.groupVersions { - gvInterfaces[groupPkgName] = c.Universe.Type(types.Name{Package: path.Join(g.outputPackage, groupPkgName), Name: "Interface"}) - gvNewFuncs[groupPkgName] = c.Universe.Function(types.Name{Package: path.Join(g.outputPackage, groupPkgName), Name: "New"}) - } - m := map[string]interface{}{ - "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "cacheTransformFunc": c.Universe.Type(cacheTransformFunc), - "groupVersions": g.groupVersions, - "gvInterfaces": gvInterfaces, - "gvNewFuncs": gvNewFuncs, - "gvGoNames": g.gvGoNames, - "interfacesNewInformerFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "NewInformerFunc"}), - "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), - "informerFactoryInterface": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), - "reflectType": c.Universe.Type(reflectType), - "runtimeObject": c.Universe.Type(runtimeObject), - "schemaGroupVersionResource": c.Universe.Type(schemaGroupVersionResource), - "syncMutex": c.Universe.Type(syncMutex), - "timeDuration": c.Universe.Type(timeDuration), - "namespaceAll": c.Universe.Type(metav1NamespaceAll), - "object": c.Universe.Type(metav1Object), - } - - sw.Do(sharedInformerFactoryStruct, m) - sw.Do(sharedInformerFactoryInterface, m) - - return sw.Error() -} - -var sharedInformerFactoryStruct = ` -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client {{.clientSetInterface|raw}} - namespace string - tweakListOptions {{.interfacesTweakListOptionsFunc|raw}} - lock {{.syncMutex|raw}} - defaultResync {{.timeDuration|raw}} - customResync map[{{.reflectType|raw}}]{{.timeDuration|raw}} - transform {{.cacheTransformFunc|raw}} - - informers map[{{.reflectType|raw}}]{{.cacheSharedIndexInformer|raw}} - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[{{.reflectType|raw}}]bool - // wg tracks how many goroutines were started. - wg sync.WaitGroup - // shuttingDown is true when Shutdown has been called. It may still be running - // because it needs to wait for goroutines. - shuttingDown bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[{{.object|raw}}]{{.timeDuration|raw}}) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// WithTransform sets a transform on all informers. -func WithTransform(transform {{.cacheTransformFunc|raw}}) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}, namespace string, tweakListOptions {{.interfacesTweakListOptionsFunc|raw}}) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[{{.reflectType|raw}}]{{.cacheSharedIndexInformer|raw}}), - startedInformers: make(map[{{.reflectType|raw}}]bool), - customResync: make(map[{{.reflectType|raw}}]{{.timeDuration|raw}}), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - if f.shuttingDown { - return - } - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - f.wg.Add(1) - // We need a new variable in each loop iteration, - // otherwise the goroutine would use the loop variable - // and that keeps changing. - informer := informer - go func() { - defer f.wg.Done() - informer.Run(stopCh) - }() - f.startedInformers[informerType] = true - } - } -} - -func (f *sharedInformerFactory) Shutdown() { - f.lock.Lock() - f.shuttingDown = true - f.lock.Unlock() - - - // Will return immediately if there is nothing to wait for. - f.wg.Wait() -} - -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func()map[reflect.Type]cache.SharedIndexInformer{ - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj {{.runtimeObject|raw}}, newFunc {{.interfacesNewInformerFunc|raw}}) {{.cacheSharedIndexInformer|raw}} { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) - f.informers[informerType] = informer - - return informer -} -` - -var sharedInformerFactoryInterface = ` -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -// -// It is typically used like this: -// -// ctx, cancel := context.Background() -// defer cancel() -// factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. -// genericInformer := factory.ForResource(resource) -// typedInformer := factory.SomeAPIGroup().V1().SomeType() -// factory.Start(ctx.Done()) // Start processing these informers. -// synced := factory.WaitForCacheSync(ctx.Done()) -// for v, ok := range synced { -// if !ok { -// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) -// return -// } -// } -// -// // Creating informers can also be created after Start, but then -// // Start must be called again: -// anotherGenericInformer := factory.ForResource(resource) -// factory.Start(ctx.Done()) -type SharedInformerFactory interface { - {{.informerFactoryInterface|raw}} - - // Start initializes all requested informers. They are handled in goroutines - // which run until the stop channel gets closed. - Start(stopCh <-chan struct{}) - - // Shutdown marks a factory as shutting down. At that point no new - // informers can be started anymore and Start will return without - // doing anything. - // - // In addition, Shutdown blocks until all goroutines have terminated. For that - // to happen, the close channel(s) that they were started with must be closed, - // either before Shutdown gets called or while it is waiting. - // - // Shutdown may be called multiple times, even concurrently. All such calls will - // block until all goroutines have terminated. - Shutdown() - - // WaitForCacheSync blocks until all started informers' caches were synced - // or the stop channel gets closed. - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - // ForResource gives generic access to a shared informer of the matching type. - ForResource(resource {{.schemaGroupVersionResource|raw}}) (GenericInformer, error) - - // InformerFor returns the SharedIndexInformer for obj using an internal - // client. - InformerFor(obj {{.runtimeObject|raw}}, newFunc {{.interfacesNewInformerFunc|raw}}) {{.cacheSharedIndexInformer|raw}} - - {{$gvInterfaces := .gvInterfaces}} - {{$gvGoNames := .gvGoNames}} - {{range $groupName, $group := .groupVersions}}{{index $gvGoNames $groupName}}() {{index $gvInterfaces $groupName|raw}} - {{end}} -} - -{{$gvNewFuncs := .gvNewFuncs}} -{{$gvGoNames := .gvGoNames}} -{{range $groupPkgName, $group := .groupVersions}} -func (f *sharedInformerFactory) {{index $gvGoNames $groupPkgName}}() {{index $gvInterfaces $groupPkgName|raw}} { - return {{index $gvNewFuncs $groupPkgName|raw}}(f, f.namespace, f.tweakListOptions) -} -{{end}} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go deleted file mode 100644 index 70826ebaad50..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/factoryinterface.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "io" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" -) - -// factoryInterfaceGenerator produces a file of interfaces used to break a dependency cycle for -// informer registration -type factoryInterfaceGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - clientSetPackage string - filtered bool -} - -var _ generator.Generator = &factoryInterfaceGenerator{} - -func (g *factoryInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *factoryInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *factoryInterfaceGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -func (g *factoryInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "{{", "}}") - - klog.V(5).Infof("processing type %v", t) - - m := map[string]interface{}{ - "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "clientSetPackage": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), - "runtimeObject": c.Universe.Type(runtimeObject), - "timeDuration": c.Universe.Type(timeDuration), - "v1ListOptions": c.Universe.Type(v1ListOptions), - } - - sw.Do(externalSharedInformerFactoryInterface, m) - - return sw.Error() -} - -var externalSharedInformerFactoryInterface = ` -// NewInformerFunc takes {{.clientSetPackage|raw}} and {{.timeDuration|raw}} to return a SharedIndexInformer. -type NewInformerFunc func({{.clientSetPackage|raw}}, {{.timeDuration|raw}}) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj {{.runtimeObject|raw}}, newFunc NewInformerFunc) {{.cacheSharedIndexInformer|raw}} -} - -// TweakListOptionsFunc is a function that transforms a {{.v1ListOptions|raw}}. -type TweakListOptionsFunc func(*{{.v1ListOptions|raw}}) -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go deleted file mode 100644 index a5a42953d225..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "io" - "sort" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - codegennamer "k8s.io/code-generator/pkg/namer" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// genericGenerator generates the generic informer. -type genericGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - groupVersions map[string]clientgentypes.GroupVersions - groupGoNames map[string]string - pluralExceptions map[string]string - typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type - filtered bool -} - -var _ generator.Generator = &genericGenerator{} - -func (g *genericGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *genericGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - "allLowercasePlural": namer.NewAllLowercasePluralNamer(g.pluralExceptions), - "publicPlural": namer.NewPublicPluralNamer(g.pluralExceptions), - "resource": codegennamer.NewTagOverrideNamer("resourceName", namer.NewAllLowercasePluralNamer(g.pluralExceptions)), - } -} - -func (g *genericGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, "fmt") - return -} - -type group struct { - GroupGoName string - Name string - Versions []*version -} - -type groupSort []group - -func (g groupSort) Len() int { return len(g) } -func (g groupSort) Less(i, j int) bool { - return strings.ToLower(g[i].Name) < strings.ToLower(g[j].Name) -} -func (g groupSort) Swap(i, j int) { g[i], g[j] = g[j], g[i] } - -type version struct { - Name string - GoName string - Resources []*types.Type -} - -type versionSort []*version - -func (v versionSort) Len() int { return len(v) } -func (v versionSort) Less(i, j int) bool { - return strings.ToLower(v[i].Name) < strings.ToLower(v[j].Name) -} -func (v versionSort) Swap(i, j int) { v[i], v[j] = v[j], v[i] } - -func (g *genericGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "{{", "}}") - - groups := []group{} - schemeGVs := make(map[*version]*types.Type) - - orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} - for groupPackageName, groupVersions := range g.groupVersions { - group := group{ - GroupGoName: g.groupGoNames[groupPackageName], - Name: groupVersions.Group.NonEmpty(), - Versions: []*version{}, - } - for _, v := range groupVersions.Versions { - gv := clientgentypes.GroupVersion{Group: groupVersions.Group, Version: v.Version} - version := &version{ - Name: v.Version.NonEmpty(), - GoName: namer.IC(v.Version.NonEmpty()), - Resources: orderer.OrderTypes(g.typesForGroupVersion[gv]), - } - func() { - schemeGVs[version] = c.Universe.Variable(types.Name{Package: g.typesForGroupVersion[gv][0].Name.Package, Name: "SchemeGroupVersion"}) - }() - group.Versions = append(group.Versions, version) - } - sort.Sort(versionSort(group.Versions)) - groups = append(groups, group) - } - sort.Sort(groupSort(groups)) - - m := map[string]interface{}{ - "cacheGenericLister": c.Universe.Type(cacheGenericLister), - "cacheNewGenericLister": c.Universe.Function(cacheNewGenericLister), - "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "groups": groups, - "schemeGVs": schemeGVs, - "schemaGroupResource": c.Universe.Type(schemaGroupResource), - "schemaGroupVersionResource": c.Universe.Type(schemaGroupVersionResource), - } - - sw.Do(genericInformer, m) - sw.Do(forResource, m) - - return sw.Error() -} - -var genericInformer = ` -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() {{.cacheSharedIndexInformer|raw}} - Lister() {{.cacheGenericLister|raw}} -} - -type genericInformer struct { - informer {{.cacheSharedIndexInformer|raw}} - resource {{.schemaGroupResource|raw}} -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() {{.cacheSharedIndexInformer|raw}} { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() {{.cacheGenericLister|raw}} { - return {{.cacheNewGenericLister|raw}}(f.Informer().GetIndexer(), f.resource) -} -` - -var forResource = ` -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource {{.schemaGroupVersionResource|raw}}) (GenericInformer, error) { - switch resource { - {{range $group := .groups -}}{{$GroupGoName := .GroupGoName -}} - {{range $version := .Versions -}} - // Group={{$group.Name}}, Version={{.Name}} - {{range .Resources -}} - case {{index $.schemeGVs $version|raw}}.WithResource("{{.|resource}}"): - return &genericInformer{resource: resource.GroupResource(), informer: f.{{$GroupGoName}}().{{$version.GoName}}().{{.|publicPlural}}().Informer()}, nil - {{end}} - {{end}} - {{end -}} - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go deleted file mode 100644 index 0bba93c4b2ec..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/groupinterface.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "io" - "path/filepath" - "strings" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// groupInterfaceGenerator generates the per-group interface file. -type groupInterfaceGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - groupVersions clientgentypes.GroupVersions - filtered bool - internalInterfacesPackage string -} - -var _ generator.Generator = &groupInterfaceGenerator{} - -func (g *groupInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *groupInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *groupInterfaceGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -type versionData struct { - Name string - Interface *types.Type - New *types.Type -} - -func (g *groupInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - versions := make([]versionData, 0, len(g.groupVersions.Versions)) - for _, version := range g.groupVersions.Versions { - gv := clientgentypes.GroupVersion{Group: g.groupVersions.Group, Version: version.Version} - versionPackage := filepath.Join(g.outputPackage, strings.ToLower(gv.Version.NonEmpty())) - iface := c.Universe.Type(types.Name{Package: versionPackage, Name: "Interface"}) - versions = append(versions, versionData{ - Name: namer.IC(version.Version.NonEmpty()), - Interface: iface, - New: c.Universe.Function(types.Name{Package: versionPackage, Name: "New"}), - }) - } - m := map[string]interface{}{ - "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), - "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "versions": versions, - } - - sw.Do(groupTemplate, m) - - return sw.Error() -} - -var groupTemplate = ` -// Interface provides access to each of this group's versions. -type Interface interface { - $range .versions -$ - // $.Name$ provides access to shared informers for resources in $.Name$. - $.Name$() $.Interface|raw$ - $end$ -} - -type group struct { - factory $.interfacesSharedInformerFactory|raw$ - namespace string - tweakListOptions $.interfacesTweakListOptionsFunc|raw$ -} - -// New returns a new Interface. -func New(f $.interfacesSharedInformerFactory|raw$, namespace string, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -$range .versions$ -// $.Name$ returns a new $.Interface|raw$. -func (g *group) $.Name$() $.Interface|raw$ { - return $.New|raw$(g.factory, g.namespace, g.tweakListOptions) -} -$end$ -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go deleted file mode 100644 index da00e6e61fe5..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "fmt" - "io" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - - "k8s.io/klog/v2" -) - -// informerGenerator produces a file of listers for a given GroupVersion and -// type. -type informerGenerator struct { - generator.DefaultGen - outputPackage string - groupPkgName string - groupVersion clientgentypes.GroupVersion - groupGoName string - typeToGenerate *types.Type - imports namer.ImportTracker - clientSetPackage string - listersPackage string - internalInterfacesPackage string -} - -var _ generator.Generator = &informerGenerator{} - -func (g *informerGenerator) Filter(c *generator.Context, t *types.Type) bool { - return t == g.typeToGenerate -} - -func (g *informerGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *informerGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -func (g *informerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - klog.V(5).Infof("processing type %v", t) - - listerPackage := fmt.Sprintf("%s/%s/%s", g.listersPackage, g.groupPkgName, strings.ToLower(g.groupVersion.Version.NonEmpty())) - clientSetInterface := c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}) - informerFor := "InformerFor" - - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - - m := map[string]interface{}{ - "apiScheme": c.Universe.Type(apiScheme), - "cacheIndexers": c.Universe.Type(cacheIndexers), - "cacheListWatch": c.Universe.Type(cacheListWatch), - "cacheMetaNamespaceIndexFunc": c.Universe.Function(cacheMetaNamespaceIndexFunc), - "cacheNamespaceIndex": c.Universe.Variable(cacheNamespaceIndex), - "cacheNewSharedIndexInformer": c.Universe.Function(cacheNewSharedIndexInformer), - "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), - "clientSetInterface": clientSetInterface, - "group": namer.IC(g.groupGoName), - "informerFor": informerFor, - "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), - "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "listOptions": c.Universe.Type(listOptions), - "lister": c.Universe.Type(types.Name{Package: listerPackage, Name: t.Name.Name + "Lister"}), - "namespaceAll": c.Universe.Type(metav1NamespaceAll), - "namespaced": !tags.NonNamespaced, - "newLister": c.Universe.Function(types.Name{Package: listerPackage, Name: "New" + t.Name.Name + "Lister"}), - "runtimeObject": c.Universe.Type(runtimeObject), - "timeDuration": c.Universe.Type(timeDuration), - "type": t, - "v1ListOptions": c.Universe.Type(v1ListOptions), - "version": namer.IC(g.groupVersion.Version.String()), - "watchInterface": c.Universe.Type(watchInterface), - } - - sw.Do(typeInformerInterface, m) - sw.Do(typeInformerStruct, m) - sw.Do(typeInformerPublicConstructor, m) - sw.Do(typeFilteredInformerPublicConstructor, m) - sw.Do(typeInformerConstructor, m) - sw.Do(typeInformerInformer, m) - sw.Do(typeInformerLister, m) - - return sw.Error() -} - -var typeInformerInterface = ` -// $.type|public$Informer provides access to a shared informer and lister for -// $.type|publicPlural$. -type $.type|public$Informer interface { - Informer() $.cacheSharedIndexInformer|raw$ - Lister() $.lister|raw$ -} -` - -var typeInformerStruct = ` -type $.type|private$Informer struct { - factory $.interfacesSharedInformerFactory|raw$ - tweakListOptions $.interfacesTweakListOptionsFunc|raw$ - $if .namespaced$namespace string$end$ -} -` - -var typeInformerPublicConstructor = ` -// New$.type|public$Informer constructs a new informer for $.type|public$ type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func New$.type|public$Informer(client $.clientSetInterface|raw$$if .namespaced$, namespace string$end$, resyncPeriod $.timeDuration|raw$, indexers $.cacheIndexers|raw$) $.cacheSharedIndexInformer|raw$ { - return NewFiltered$.type|public$Informer(client$if .namespaced$, namespace$end$, resyncPeriod, indexers, nil) -} -` - -var typeFilteredInformerPublicConstructor = ` -// NewFiltered$.type|public$Informer constructs a new informer for $.type|public$ type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFiltered$.type|public$Informer(client $.clientSetInterface|raw$$if .namespaced$, namespace string$end$, resyncPeriod $.timeDuration|raw$, indexers $.cacheIndexers|raw$, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) $.cacheSharedIndexInformer|raw$ { - return $.cacheNewSharedIndexInformer|raw$( - &$.cacheListWatch|raw${ - ListFunc: func(options $.v1ListOptions|raw$) ($.runtimeObject|raw$, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).List(context.TODO(), options) - }, - WatchFunc: func(options $.v1ListOptions|raw$) ($.watchInterface|raw$, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).Watch(context.TODO(), options) - }, - }, - &$.type|raw${}, - resyncPeriod, - indexers, - ) -} -` - -var typeInformerConstructor = ` -func (f *$.type|private$Informer) defaultInformer(client $.clientSetInterface|raw$, resyncPeriod $.timeDuration|raw$) $.cacheSharedIndexInformer|raw$ { - return NewFiltered$.type|public$Informer(client$if .namespaced$, f.namespace$end$, resyncPeriod, $.cacheIndexers|raw${$.cacheNamespaceIndex|raw$: $.cacheMetaNamespaceIndexFunc|raw$}, f.tweakListOptions) -} -` - -var typeInformerInformer = ` -func (f *$.type|private$Informer) Informer() $.cacheSharedIndexInformer|raw$ { - return f.factory.$.informerFor$(&$.type|raw${}, f.defaultInformer) -} -` - -var typeInformerLister = ` -func (f *$.type|private$Informer) Lister() $.lister|raw$ { - return $.newLister|raw$(f.Informer().GetIndexer()) -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go deleted file mode 100644 index dd2c9cceb93d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go +++ /dev/null @@ -1,347 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "fmt" - "path" - "path/filepath" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - "k8s.io/klog/v2" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - informergenargs "k8s.io/code-generator/cmd/informer-gen/args" - genutil "k8s.io/code-generator/pkg/util" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems(pluralExceptions map[string]string) namer.NameSystems { - return namer.NameSystems{ - "public": namer.NewPublicNamer(0), - "private": namer.NewPrivateNamer(0), - "raw": namer.NewRawNamer("", nil), - "publicPlural": namer.NewPublicPluralNamer(pluralExceptions), - "allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions), - "lowercaseSingular": &lowercaseSingularNamer{}, - } -} - -// lowercaseSingularNamer implements Namer -type lowercaseSingularNamer struct{} - -// Name returns t's name in all lowercase. -func (n *lowercaseSingularNamer) Name(t *types.Type) string { - return strings.ToLower(t.Name.Name) -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// objectMetaForPackage returns the type of ObjectMeta used by package p. -func objectMetaForPackage(p *types.Package) (*types.Type, bool, error) { - generatingForPackage := false - for _, t := range p.Types { - if !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient { - continue - } - generatingForPackage = true - for _, member := range t.Members { - if member.Name == "ObjectMeta" { - return member.Type, isInternal(member), nil - } - } - } - if generatingForPackage { - return nil, false, fmt.Errorf("unable to find ObjectMeta for any types in package %s", p.Path) - } - return nil, false, nil -} - -// isInternal returns true if the tags for a member do not contain a json tag -func isInternal(m types.Member) bool { - return !strings.Contains(m.Tags, "json") -} - -func packageForInternalInterfaces(base string) string { - return filepath.Join(base, "internalinterfaces") -} - -// Packages makes the client package definition. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - customArgs, ok := arguments.CustomArgs.(*informergenargs.CustomArgs) - if !ok { - klog.Fatalf("Wrong CustomArgs type: %T", arguments.CustomArgs) - } - - internalVersionPackagePath := filepath.Join(arguments.OutputPackagePath) - externalVersionPackagePath := filepath.Join(arguments.OutputPackagePath) - if !customArgs.SingleDirectory { - internalVersionPackagePath = filepath.Join(arguments.OutputPackagePath, "internalversion") - externalVersionPackagePath = filepath.Join(arguments.OutputPackagePath, "externalversions") - } - - var packageList generator.Packages - typesForGroupVersion := make(map[clientgentypes.GroupVersion][]*types.Type) - - externalGroupVersions := make(map[string]clientgentypes.GroupVersions) - internalGroupVersions := make(map[string]clientgentypes.GroupVersions) - groupGoNames := make(map[string]string) - for _, inputDir := range arguments.InputDirs { - p := context.Universe.Package(genutil.Vendorless(inputDir)) - - objectMeta, internal, err := objectMetaForPackage(p) - if err != nil { - klog.Fatal(err) - } - if objectMeta == nil { - // no types in this package had genclient - continue - } - - var gv clientgentypes.GroupVersion - var targetGroupVersions map[string]clientgentypes.GroupVersions - - if internal { - lastSlash := strings.LastIndex(p.Path, "/") - if lastSlash == -1 { - klog.Fatalf("error constructing internal group version for package %q", p.Path) - } - gv.Group = clientgentypes.Group(p.Path[lastSlash+1:]) - targetGroupVersions = internalGroupVersions - } else { - parts := strings.Split(p.Path, "/") - gv.Group = clientgentypes.Group(parts[len(parts)-2]) - gv.Version = clientgentypes.Version(parts[len(parts)-1]) - targetGroupVersions = externalGroupVersions - } - groupPackageName := gv.Group.NonEmpty() - gvPackage := path.Clean(p.Path) - - // If there's a comment of the form "// +groupName=somegroup" or - // "// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as the name of the - // group when generating. - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - gv.Group = clientgentypes.Group(override[0]) - } - - // If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as - // the Go group identifier in CamelCase. It defaults - groupGoNames[groupPackageName] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) - if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil { - groupGoNames[groupPackageName] = namer.IC(override[0]) - } - - var typesToGenerate []*types.Type - for _, t := range p.Types { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if !tags.GenerateClient || tags.NoVerbs || !tags.HasVerb("list") || !tags.HasVerb("watch") { - continue - } - - typesToGenerate = append(typesToGenerate, t) - - if _, ok := typesForGroupVersion[gv]; !ok { - typesForGroupVersion[gv] = []*types.Type{} - } - typesForGroupVersion[gv] = append(typesForGroupVersion[gv], t) - } - if len(typesToGenerate) == 0 { - continue - } - - groupVersionsEntry, ok := targetGroupVersions[groupPackageName] - if !ok { - groupVersionsEntry = clientgentypes.GroupVersions{ - PackageName: groupPackageName, - Group: gv.Group, - } - } - groupVersionsEntry.Versions = append(groupVersionsEntry.Versions, clientgentypes.PackageVersion{Version: gv.Version, Package: gvPackage}) - targetGroupVersions[groupPackageName] = groupVersionsEntry - - orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} - typesToGenerate = orderer.OrderTypes(typesToGenerate) - - if internal { - packageList = append(packageList, versionPackage(internalVersionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs.InternalClientSetPackage, customArgs.ListersPackage)) - } else { - packageList = append(packageList, versionPackage(externalVersionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs.VersionedClientSetPackage, customArgs.ListersPackage)) - } - } - - if len(externalGroupVersions) != 0 { - packageList = append(packageList, factoryInterfacePackage(externalVersionPackagePath, boilerplate, customArgs.VersionedClientSetPackage)) - packageList = append(packageList, factoryPackage(externalVersionPackagePath, boilerplate, groupGoNames, genutil.PluralExceptionListToMapOrDie(customArgs.PluralExceptions), externalGroupVersions, - customArgs.VersionedClientSetPackage, - typesForGroupVersion)) - for _, gvs := range externalGroupVersions { - packageList = append(packageList, groupPackage(externalVersionPackagePath, gvs, boilerplate)) - } - } - - if len(internalGroupVersions) != 0 { - packageList = append(packageList, factoryInterfacePackage(internalVersionPackagePath, boilerplate, customArgs.InternalClientSetPackage)) - packageList = append(packageList, factoryPackage(internalVersionPackagePath, boilerplate, groupGoNames, genutil.PluralExceptionListToMapOrDie(customArgs.PluralExceptions), internalGroupVersions, customArgs.InternalClientSetPackage, typesForGroupVersion)) - for _, gvs := range internalGroupVersions { - packageList = append(packageList, groupPackage(internalVersionPackagePath, gvs, boilerplate)) - } - } - - return packageList -} - -func factoryPackage(basePackage string, boilerplate []byte, groupGoNames, pluralExceptions map[string]string, groupVersions map[string]clientgentypes.GroupVersions, clientSetPackage string, - typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type) generator.Package { - return &generator.DefaultPackage{ - PackageName: filepath.Base(basePackage), - PackagePath: basePackage, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &factoryGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "factory", - }, - outputPackage: basePackage, - imports: generator.NewImportTracker(), - groupVersions: groupVersions, - clientSetPackage: clientSetPackage, - internalInterfacesPackage: packageForInternalInterfaces(basePackage), - gvGoNames: groupGoNames, - }) - - generators = append(generators, &genericGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "generic", - }, - outputPackage: basePackage, - imports: generator.NewImportTracker(), - groupVersions: groupVersions, - pluralExceptions: pluralExceptions, - typesForGroupVersion: typesForGroupVersion, - groupGoNames: groupGoNames, - }) - - return generators - }, - } -} - -func factoryInterfacePackage(basePackage string, boilerplate []byte, clientSetPackage string) generator.Package { - packagePath := packageForInternalInterfaces(basePackage) - - return &generator.DefaultPackage{ - PackageName: filepath.Base(packagePath), - PackagePath: packagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &factoryInterfaceGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "factory_interfaces", - }, - outputPackage: packagePath, - imports: generator.NewImportTracker(), - clientSetPackage: clientSetPackage, - }) - - return generators - }, - } -} - -func groupPackage(basePackage string, groupVersions clientgentypes.GroupVersions, boilerplate []byte) generator.Package { - packagePath := filepath.Join(basePackage, groupVersions.PackageName) - groupPkgName := strings.Split(string(groupVersions.PackageName), ".")[0] - - return &generator.DefaultPackage{ - PackageName: groupPkgName, - PackagePath: packagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &groupInterfaceGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "interface", - }, - outputPackage: packagePath, - groupVersions: groupVersions, - imports: generator.NewImportTracker(), - internalInterfacesPackage: packageForInternalInterfaces(basePackage), - }) - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("watch") - }, - } -} - -func versionPackage(basePackage string, groupPkgName string, gv clientgentypes.GroupVersion, groupGoName string, boilerplate []byte, typesToGenerate []*types.Type, clientSetPackage, listersPackage string) generator.Package { - packagePath := filepath.Join(basePackage, groupPkgName, strings.ToLower(gv.Version.NonEmpty())) - - return &generator.DefaultPackage{ - PackageName: strings.ToLower(gv.Version.NonEmpty()), - PackagePath: packagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &versionInterfaceGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "interface", - }, - outputPackage: packagePath, - imports: generator.NewImportTracker(), - types: typesToGenerate, - internalInterfacesPackage: packageForInternalInterfaces(basePackage), - }) - - for _, t := range typesToGenerate { - generators = append(generators, &informerGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: strings.ToLower(t.Name.Name), - }, - outputPackage: packagePath, - groupPkgName: groupPkgName, - groupVersion: gv, - groupGoName: groupGoName, - typeToGenerate: t, - imports: generator.NewImportTracker(), - clientSetPackage: clientSetPackage, - listersPackage: listersPackage, - internalInterfacesPackage: packageForInternalInterfaces(basePackage), - }) - } - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("watch") - }, - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go deleted file mode 100644 index fc1f7786f663..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import "k8s.io/gengo/types" - -var ( - apiScheme = types.Name{Package: "k8s.io/kubernetes/pkg/api/legacyscheme", Name: "Scheme"} - cacheGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "GenericLister"} - cacheIndexers = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "Indexers"} - cacheListWatch = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "ListWatch"} - cacheMetaNamespaceIndexFunc = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "MetaNamespaceIndexFunc"} - cacheNamespaceIndex = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NamespaceIndex"} - cacheNewGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewGenericLister"} - cacheNewSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewSharedIndexInformer"} - cacheSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "SharedIndexInformer"} - cacheTransformFunc = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "TransformFunc"} - listOptions = types.Name{Package: "k8s.io/kubernetes/pkg/apis/core", Name: "ListOptions"} - reflectType = types.Name{Package: "reflect", Name: "Type"} - runtimeObject = types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Object"} - schemaGroupResource = types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupResource"} - schemaGroupVersionResource = types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionResource"} - syncMutex = types.Name{Package: "sync", Name: "Mutex"} - timeDuration = types.Name{Package: "time", Name: "Duration"} - v1ListOptions = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"} - metav1NamespaceAll = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "NamespaceAll"} - metav1Object = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "Object"} - watchInterface = types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"} -) diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go deleted file mode 100644 index 3b51f8dc826d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/generators/versioninterface.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "io" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// versionInterfaceGenerator generates the per-version interface file. -type versionInterfaceGenerator struct { - generator.DefaultGen - outputPackage string - imports namer.ImportTracker - types []*types.Type - filtered bool - internalInterfacesPackage string -} - -var _ generator.Generator = &versionInterfaceGenerator{} - -func (g *versionInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { - if !g.filtered { - g.filtered = true - return true - } - return false -} - -func (g *versionInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *versionInterfaceGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - return -} - -func (g *versionInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - m := map[string]interface{}{ - "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), - "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), - "types": g.types, - } - - sw.Do(versionTemplate, m) - for _, typeDef := range g.types { - tags, err := util.ParseClientGenTags(append(typeDef.SecondClosestCommentLines, typeDef.CommentLines...)) - if err != nil { - return err - } - m["namespaced"] = !tags.NonNamespaced - m["type"] = typeDef - sw.Do(versionFuncTemplate, m) - } - - return sw.Error() -} - -var versionTemplate = ` -// Interface provides access to all the informers in this group version. -type Interface interface { - $range .types -$ - // $.|publicPlural$ returns a $.|public$Informer. - $.|publicPlural$() $.|public$Informer - $end$ -} - -type version struct { - factory $.interfacesSharedInformerFactory|raw$ - namespace string - tweakListOptions $.interfacesTweakListOptionsFunc|raw$ -} - -// New returns a new Interface. -func New(f $.interfacesSharedInformerFactory|raw$, namespace string, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} -` - -var versionFuncTemplate = ` -// $.type|publicPlural$ returns a $.type|public$Informer. -func (v *version) $.type|publicPlural$() $.type|public$Informer { - return &$.type|private$Informer{factory: v.factory$if .namespaced$, namespace: v.namespace$end$, tweakListOptions: v.tweakListOptions} -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/main.go deleted file mode 100644 index 1247c35b37aa..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/informer-gen/main.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 main - -import ( - "flag" - - "github.com/spf13/pflag" - "k8s.io/code-generator/cmd/informer-gen/generators" - "k8s.io/code-generator/pkg/util" - "k8s.io/klog/v2" - - generatorargs "k8s.io/code-generator/cmd/informer-gen/args" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move out of informer-gen - genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/informers/informers_generated" - customArgs.VersionedClientSetPackage = "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" - customArgs.InternalClientSetPackage = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" - customArgs.ListersPackage = "k8s.io/kubernetes/pkg/client/listers" - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go deleted file mode 100644 index 170334505abc..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "fmt" - "path" - - "github.com/spf13/pflag" - codegenutil "k8s.io/code-generator/pkg/util" - "k8s.io/gengo/args" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct { - // PluralExceptions specify list of exceptions used when pluralizing certain types. - // For example 'Endpoints:Endpoints', otherwise the pluralizer will generate 'Endpointes'. - PluralExceptions []string -} - -// NewDefaults returns default arguments for the generator. -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{ - PluralExceptions: []string{"Endpoints:Endpoints"}, - } - genericArgs.CustomArgs = customArgs - - if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { - genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/listers") - } - - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType format") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - _ = genericArgs.CustomArgs.(*CustomArgs) - - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/generators/expansion.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/generators/expansion.go deleted file mode 100644 index dd45d7749c7d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/generators/expansion.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "io" - "os" - "path/filepath" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" -) - -// expansionGenerator produces a file for a expansion interfaces. -type expansionGenerator struct { - generator.DefaultGen - packagePath string - types []*types.Type -} - -// We only want to call GenerateType() once per group. -func (g *expansionGenerator) Filter(c *generator.Context, t *types.Type) bool { - return t == g.types[0] -} - -func (g *expansionGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - for _, t := range g.types { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if _, err := os.Stat(filepath.Join(g.packagePath, strings.ToLower(t.Name.Name+"_expansion.go"))); os.IsNotExist(err) { - sw.Do(expansionInterfaceTemplate, t) - if !tags.NonNamespaced { - sw.Do(namespacedExpansionInterfaceTemplate, t) - } - } - } - return sw.Error() -} - -var expansionInterfaceTemplate = ` -// $.|public$ListerExpansion allows custom methods to be added to -// $.|public$Lister. -type $.|public$ListerExpansion interface {} -` - -var namespacedExpansionInterfaceTemplate = ` -// $.|public$NamespaceListerExpansion allows custom methods to be added to -// $.|public$NamespaceLister. -type $.|public$NamespaceListerExpansion interface {} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go deleted file mode 100644 index 8ada49469031..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go +++ /dev/null @@ -1,376 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "fmt" - "io" - "path/filepath" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/code-generator/cmd/client-gen/generators/util" - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - - "k8s.io/klog/v2" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems(pluralExceptions map[string]string) namer.NameSystems { - return namer.NameSystems{ - "public": namer.NewPublicNamer(0), - "private": namer.NewPrivateNamer(0), - "raw": namer.NewRawNamer("", nil), - "publicPlural": namer.NewPublicPluralNamer(pluralExceptions), - "allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions), - "lowercaseSingular": &lowercaseSingularNamer{}, - } -} - -// lowercaseSingularNamer implements Namer -type lowercaseSingularNamer struct{} - -// Name returns t's name in all lowercase. -func (n *lowercaseSingularNamer) Name(t *types.Type) string { - return strings.ToLower(t.Name.Name) -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// Packages makes the client package definition. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - var packageList generator.Packages - for _, inputDir := range arguments.InputDirs { - p := context.Universe.Package(inputDir) - - objectMeta, internal, err := objectMetaForPackage(p) - if err != nil { - klog.Fatal(err) - } - if objectMeta == nil { - // no types in this package had genclient - continue - } - - var gv clientgentypes.GroupVersion - var internalGVPkg string - - if internal { - lastSlash := strings.LastIndex(p.Path, "/") - if lastSlash == -1 { - klog.Fatalf("error constructing internal group version for package %q", p.Path) - } - gv.Group = clientgentypes.Group(p.Path[lastSlash+1:]) - internalGVPkg = p.Path - } else { - parts := strings.Split(p.Path, "/") - gv.Group = clientgentypes.Group(parts[len(parts)-2]) - gv.Version = clientgentypes.Version(parts[len(parts)-1]) - - internalGVPkg = strings.Join(parts[0:len(parts)-1], "/") - } - groupPackageName := strings.ToLower(gv.Group.NonEmpty()) - - // If there's a comment of the form "// +groupName=somegroup" or - // "// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as the name of the - // group when generating. - if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { - gv.Group = clientgentypes.Group(strings.SplitN(override[0], ".", 2)[0]) - } - - var typesToGenerate []*types.Type - for _, t := range p.Types { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if !tags.GenerateClient || !tags.HasVerb("list") || !tags.HasVerb("get") { - continue - } - typesToGenerate = append(typesToGenerate, t) - } - if len(typesToGenerate) == 0 { - continue - } - orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} - typesToGenerate = orderer.OrderTypes(typesToGenerate) - - packagePath := filepath.Join(arguments.OutputPackagePath, groupPackageName, strings.ToLower(gv.Version.NonEmpty())) - packageList = append(packageList, &generator.DefaultPackage{ - PackageName: strings.ToLower(gv.Version.NonEmpty()), - PackagePath: packagePath, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = append(generators, &expansionGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: "expansion_generated", - }, - packagePath: filepath.Join(arguments.OutputBase, packagePath), - types: typesToGenerate, - }) - - for _, t := range typesToGenerate { - generators = append(generators, &listerGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: strings.ToLower(t.Name.Name), - }, - outputPackage: arguments.OutputPackagePath, - groupVersion: gv, - internalGVPkg: internalGVPkg, - typeToGenerate: t, - imports: generator.NewImportTracker(), - objectMeta: objectMeta, - }) - } - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("get") - }, - }) - } - - return packageList -} - -// objectMetaForPackage returns the type of ObjectMeta used by package p. -func objectMetaForPackage(p *types.Package) (*types.Type, bool, error) { - generatingForPackage := false - for _, t := range p.Types { - // filter out types which don't have genclient. - if !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient { - continue - } - generatingForPackage = true - for _, member := range t.Members { - if member.Name == "ObjectMeta" { - return member.Type, isInternal(member), nil - } - } - } - if generatingForPackage { - return nil, false, fmt.Errorf("unable to find ObjectMeta for any types in package %s", p.Path) - } - return nil, false, nil -} - -// isInternal returns true if the tags for a member do not contain a json tag -func isInternal(m types.Member) bool { - return !strings.Contains(m.Tags, "json") -} - -// listerGenerator produces a file of listers for a given GroupVersion and -// type. -type listerGenerator struct { - generator.DefaultGen - outputPackage string - groupVersion clientgentypes.GroupVersion - internalGVPkg string - typeToGenerate *types.Type - imports namer.ImportTracker - objectMeta *types.Type -} - -var _ generator.Generator = &listerGenerator{} - -func (g *listerGenerator) Filter(c *generator.Context, t *types.Type) bool { - return t == g.typeToGenerate -} - -func (g *listerGenerator) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *listerGenerator) Imports(c *generator.Context) (imports []string) { - imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, "k8s.io/apimachinery/pkg/api/errors") - imports = append(imports, "k8s.io/apimachinery/pkg/labels") - // for Indexer - imports = append(imports, "k8s.io/client-go/tools/cache") - return -} - -func (g *listerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - klog.V(5).Infof("processing type %v", t) - m := map[string]interface{}{ - "Resource": c.Universe.Function(types.Name{Package: t.Name.Package, Name: "Resource"}), - "type": t, - "objectMeta": g.objectMeta, - } - - tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) - if err != nil { - return err - } - - if tags.NonNamespaced { - sw.Do(typeListerInterface_NonNamespaced, m) - } else { - sw.Do(typeListerInterface, m) - } - - sw.Do(typeListerStruct, m) - sw.Do(typeListerConstructor, m) - sw.Do(typeLister_List, m) - - if tags.NonNamespaced { - sw.Do(typeLister_NonNamespacedGet, m) - return sw.Error() - } - - sw.Do(typeLister_NamespaceLister, m) - sw.Do(namespaceListerInterface, m) - sw.Do(namespaceListerStruct, m) - sw.Do(namespaceLister_List, m) - sw.Do(namespaceLister_Get, m) - - return sw.Error() -} - -var typeListerInterface = ` -// $.type|public$Lister helps list $.type|publicPlural$. -// All objects returned here must be treated as read-only. -type $.type|public$Lister interface { - // List lists all $.type|publicPlural$ in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*$.type|raw$, err error) - // $.type|publicPlural$ returns an object that can list and get $.type|publicPlural$. - $.type|publicPlural$(namespace string) $.type|public$NamespaceLister - $.type|public$ListerExpansion -} -` - -var typeListerInterface_NonNamespaced = ` -// $.type|public$Lister helps list $.type|publicPlural$. -// All objects returned here must be treated as read-only. -type $.type|public$Lister interface { - // List lists all $.type|publicPlural$ in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*$.type|raw$, err error) - // Get retrieves the $.type|public$ from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*$.type|raw$, error) - $.type|public$ListerExpansion -} -` - -var typeListerStruct = ` -// $.type|private$Lister implements the $.type|public$Lister interface. -type $.type|private$Lister struct { - indexer cache.Indexer -} -` - -var typeListerConstructor = ` -// New$.type|public$Lister returns a new $.type|public$Lister. -func New$.type|public$Lister(indexer cache.Indexer) $.type|public$Lister { - return &$.type|private$Lister{indexer: indexer} -} -` - -var typeLister_List = ` -// List lists all $.type|publicPlural$ in the indexer. -func (s *$.type|private$Lister) List(selector labels.Selector) (ret []*$.type|raw$, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*$.type|raw$)) - }) - return ret, err -} -` - -var typeLister_NamespaceLister = ` -// $.type|publicPlural$ returns an object that can list and get $.type|publicPlural$. -func (s *$.type|private$Lister) $.type|publicPlural$(namespace string) $.type|public$NamespaceLister { - return $.type|private$NamespaceLister{indexer: s.indexer, namespace: namespace} -} -` - -var typeLister_NonNamespacedGet = ` -// Get retrieves the $.type|public$ from the index for a given name. -func (s *$.type|private$Lister) Get(name string) (*$.type|raw$, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound($.Resource|raw$("$.type|lowercaseSingular$"), name) - } - return obj.(*$.type|raw$), nil -} -` - -var namespaceListerInterface = ` -// $.type|public$NamespaceLister helps list and get $.type|publicPlural$. -// All objects returned here must be treated as read-only. -type $.type|public$NamespaceLister interface { - // List lists all $.type|publicPlural$ in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*$.type|raw$, err error) - // Get retrieves the $.type|public$ from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*$.type|raw$, error) - $.type|public$NamespaceListerExpansion -} -` - -var namespaceListerStruct = ` -// $.type|private$NamespaceLister implements the $.type|public$NamespaceLister -// interface. -type $.type|private$NamespaceLister struct { - indexer cache.Indexer - namespace string -} -` - -var namespaceLister_List = ` -// List lists all $.type|publicPlural$ in the indexer for a given namespace. -func (s $.type|private$NamespaceLister) List(selector labels.Selector) (ret []*$.type|raw$, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*$.type|raw$)) - }) - return ret, err -} -` - -var namespaceLister_Get = ` -// Get retrieves the $.type|public$ from the indexer for a given namespace and name. -func (s $.type|private$NamespaceLister) Get(name string) (*$.type|raw$, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound($.Resource|raw$("$.type|lowercaseSingular$"), name) - } - return obj.(*$.type|raw$), nil -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/main.go deleted file mode 100644 index a7d7b610878f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/lister-gen/main.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 main - -import ( - "flag" - - "github.com/spf13/pflag" - "k8s.io/code-generator/cmd/lister-gen/generators" - "k8s.io/code-generator/pkg/util" - "k8s.io/klog/v2" - - generatorargs "k8s.io/code-generator/cmd/lister-gen/args" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - // Override defaults. - // TODO: move this out of lister-gen - genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/listers" - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - // Run it. - if err := genericArgs.Execute( - generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go deleted file mode 100644 index c446e80b8a02..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/openapi-gen/main.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package generates openAPI definition file to be used in open API spec generation on API servers. To generate -// definition for a specific type or package add "+k8s:openapi-gen=true" tag to the type/package comment lines. To -// exclude a type from a tagged package, add "+k8s:openapi-gen=false" tag to the type comment lines. - -package main - -import ( - "flag" - "log" - - generatorargs "k8s.io/kube-openapi/cmd/openapi-gen/args" - "k8s.io/kube-openapi/pkg/generators" - - "github.com/spf13/pflag" - - "k8s.io/klog/v2" -) - -func main() { - klog.InitFlags(nil) - genericArgs, customArgs := generatorargs.NewDefaults() - - genericArgs.AddFlags(pflag.CommandLine) - customArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - pflag.Parse() - - if err := generatorargs.Validate(genericArgs); err != nil { - log.Fatalf("Arguments validation error: %v", err) - } - - // Generates the code for the OpenAPIDefinitions. - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - log.Fatalf("OpenAPI code generation error: %v", err) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/args/args.go deleted file mode 100644 index 2e3ab084e201..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/args/args.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "fmt" - - "k8s.io/gengo/args" -) - -// NewDefaults returns default arguments for the generator. -func NewDefaults() *args.GeneratorArgs { - genericArgs := args.Default().WithoutDefaultFlagParsing() - genericArgs.OutputFileBaseName = "zz_generated.register" - return genericArgs -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go deleted file mode 100644 index fa8e3f1c356c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/generators/packages.go +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "fmt" - "os" - "path" - "strings" - - "k8s.io/klog/v2" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{} -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// Packages makes packages to generate. -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - packages := generator.Packages{} - for _, inputDir := range arguments.InputDirs { - pkg := context.Universe.Package(inputDir) - internal, err := isInternal(pkg) - if err != nil { - klog.V(5).Infof("skipping the generation of %s file, due to err %v", arguments.OutputFileBaseName, err) - continue - } - if internal { - klog.V(5).Infof("skipping the generation of %s file because %s package contains internal types, note that internal types don't have \"json\" tags", arguments.OutputFileBaseName, pkg.Name) - continue - } - registerFileName := "register.go" - searchPath := path.Join(args.DefaultSourceTree(), inputDir, registerFileName) - if _, err := os.Stat(path.Join(searchPath)); err == nil { - klog.V(5).Infof("skipping the generation of %s file because %s already exists in the path %s", arguments.OutputFileBaseName, registerFileName, searchPath) - continue - } else if err != nil && !os.IsNotExist(err) { - klog.Fatalf("an error %v has occurred while checking if %s exists", err, registerFileName) - } - - gv := clientgentypes.GroupVersion{} - { - pathParts := strings.Split(pkg.Path, "/") - if len(pathParts) < 2 { - klog.Errorf("the path of the package must contain the group name and the version, path = %s", pkg.Path) - continue - } - gv.Group = clientgentypes.Group(pathParts[len(pathParts)-2]) - gv.Version = clientgentypes.Version(pathParts[len(pathParts)-1]) - - // if there is a comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", - // extract the fully qualified API group name from it and overwrite the group inferred from the package path - if override := types.ExtractCommentTags("+", pkg.Comments)["groupName"]; override != nil { - groupName := override[0] - klog.V(5).Infof("overriding the group name with = %s", groupName) - gv.Group = clientgentypes.Group(groupName) - } - } - - typesToRegister := []*types.Type{} - for _, t := range pkg.Types { - klog.V(5).Infof("considering type = %s", t.Name.String()) - for _, typeMember := range t.Members { - if typeMember.Name == "TypeMeta" && typeMember.Embedded { - typesToRegister = append(typesToRegister, t) - } - } - } - - packages = append(packages, - &generator.DefaultPackage{ - PackageName: pkg.Name, - PackagePath: pkg.Path, - HeaderText: boilerplate, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - ®isterExternalGenerator{ - DefaultGen: generator.DefaultGen{ - OptionalName: arguments.OutputFileBaseName, - }, - gv: gv, - typesToGenerate: typesToRegister, - outputPackage: pkg.Path, - imports: generator.NewImportTracker(), - }, - } - }, - }) - } - - return packages -} - -// isInternal determines whether the given package -// contains the internal types or not -func isInternal(p *types.Package) (bool, error) { - for _, t := range p.Types { - for _, member := range t.Members { - if member.Name == "TypeMeta" { - return !strings.Contains(member.Tags, "json"), nil - } - } - } - return false, fmt.Errorf("unable to find TypeMeta for any types in package %s", p.Path) -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go deleted file mode 100644 index c831c575d6d6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "io" - "sort" - - clientgentypes "k8s.io/code-generator/cmd/client-gen/types" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -type registerExternalGenerator struct { - generator.DefaultGen - outputPackage string - gv clientgentypes.GroupVersion - typesToGenerate []*types.Type - imports namer.ImportTracker -} - -var _ generator.Generator = ®isterExternalGenerator{} - -func (g *registerExternalGenerator) Filter(_ *generator.Context, _ *types.Type) bool { - return false -} - -func (g *registerExternalGenerator) Imports(c *generator.Context) (imports []string) { - return g.imports.ImportLines() -} - -func (g *registerExternalGenerator) Namers(_ *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *registerExternalGenerator) Finalize(context *generator.Context, w io.Writer) error { - typesToGenerateOnlyNames := make([]string, len(g.typesToGenerate)) - for index, typeToGenerate := range g.typesToGenerate { - typesToGenerateOnlyNames[index] = typeToGenerate.Name.Name - } - - // sort the list of types to register, so that the generator produces stable output - sort.Strings(typesToGenerateOnlyNames) - - sw := generator.NewSnippetWriter(w, context, "$", "$") - m := map[string]interface{}{ - "groupName": g.gv.Group, - "version": g.gv.Version, - "types": typesToGenerateOnlyNames, - "addToGroupVersion": context.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), - "groupVersion": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GroupVersion"}), - } - sw.Do(registerExternalTypesTemplate, m) - return sw.Error() -} - -var registerExternalTypesTemplate = ` -// GroupName specifies the group name used to register the objects. -const GroupName = "$.groupName$" - -// GroupVersion specifies the group and the version used to register the objects. -var GroupVersion = $.groupVersion|raw${Group: GroupName, Version: "$.version$"} - -// SchemeGroupVersion is group version used to register these objects -// Deprecated: use GroupVersion instead. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "$.version$"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - SchemeBuilder runtime.SchemeBuilder - localSchemeBuilder = &SchemeBuilder - // Depreciated: use Install instead - AddToScheme = localSchemeBuilder.AddToScheme - Install = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Adds the list of known types to Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - $range .types -$ - &$.${}, - $end$ - ) - // AddToGroupVersion allows the serialization of client types like ListOptions. - $.addToGroupVersion|raw$(scheme, SchemeGroupVersion) - return nil -} -` diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/main.go deleted file mode 100644 index dc29144481bd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/register-gen/main.go +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 main - -import ( - "flag" - - "github.com/spf13/pflag" - "k8s.io/klog/v2" - - generatorargs "k8s.io/code-generator/cmd/register-gen/args" - "k8s.io/code-generator/cmd/register-gen/generators" -) - -func main() { - klog.InitFlags(nil) - genericArgs := generatorargs.NewDefaults() - genericArgs.AddFlags(pflag.CommandLine) - flag.Set("logtostderr", "true") - pflag.CommandLine.AddGoFlagSet(flag.CommandLine) - - pflag.Parse() - if err := generatorargs.Validate(genericArgs); err != nil { - klog.Fatalf("Error: %v", err) - } - - if err := genericArgs.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Fatalf("Error: %v", err) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/set-gen/.gitignore b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/set-gen/.gitignore deleted file mode 100644 index ffe6458c963c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/set-gen/.gitignore +++ /dev/null @@ -1 +0,0 @@ -set-gen diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/set-gen/main.go b/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/set-gen/main.go deleted file mode 100644 index 0968ce762b91..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/cmd/set-gen/main.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -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. -*/ - -// set-gen is an example usage of gengo. -// -// Structs in the input directories with the below line in their comments will -// have sets generated for them. -// // +genset -// -// Any builtin type referenced anywhere in the input directories will have a -// set generated for it. -package main - -import ( - "os" - - "k8s.io/gengo/args" - "k8s.io/gengo/examples/set-gen/generators" - - "k8s.io/klog/v2" -) - -func main() { - klog.InitFlags(nil) - arguments := args.Default() - - // Override defaults. - arguments.InputDirs = []string{"k8s.io/kubernetes/pkg/util/sets/types"} - arguments.OutputPackagePath = "k8s.io/apimachinery/pkg/util/sets" - - if err := arguments.Execute( - generators.NameSystems(), - generators.DefaultNameSystem(), - generators.Packages, - ); err != nil { - klog.Errorf("Error: %v", err) - os.Exit(1) - } - klog.V(2).Info("Completed successfully.") -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/code-of-conduct.md b/cluster-autoscaler/vendor/k8s.io/code-generator/code-of-conduct.md deleted file mode 100644 index 0d15c00cf325..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/code-of-conduct.md +++ /dev/null @@ -1,3 +0,0 @@ -# Kubernetes Community Code of Conduct - -Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/doc.go b/cluster-autoscaler/vendor/k8s.io/code-generator/doc.go deleted file mode 100644 index fd867306974e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -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 codegenerator // import "k8s.io/code-generator" diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/generate-groups.sh b/cluster-autoscaler/vendor/k8s.io/code-generator/generate-groups.sh deleted file mode 100644 index a21d2184f0b6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/generate-groups.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -# generate-groups generates everything for a project with external types only, e.g. a project based -# on CustomResourceDefinitions. - -if [ "$#" -lt 4 ] || [ "${1}" == "--help" ]; then - cat < ... - - the generators comma separated to run (deepcopy,defaulter,applyconfiguration,client,lister,informer). - the output package name (e.g. github.com/example/project/pkg/generated). - the external types dir (e.g. github.com/example/api or github.com/example/project/pkg/apis). - the groups and their versions in the format "groupA:v1,v2 groupB:v1 groupC:v2", relative - to . - ... arbitrary flags passed to all generator binaries. - - -Example: - $(basename "$0") \ - deepcopy,client \ - github.com/example/project/pkg/client \ - github.com/example/project/pkg/apis \ - "foo:v1 bar:v1alpha1,v1beta1" -EOF - exit 0 -fi - -GENS="$1" -OUTPUT_PKG="$2" -APIS_PKG="$3" -GROUPS_WITH_VERSIONS="$4" -shift 4 - -echo "WARNING: $(basename "$0") is deprecated." -echo "WARNING: Please use k8s.io/code-generator/kube_codegen.sh instead." -echo - -if [ "${GENS}" = "all" ] || grep -qw "all" <<<"${GENS}"; then - ALL="applyconfiguration,client,deepcopy,informer,lister" - echo "WARNING: Specifying \"all\" as a generator is deprecated." - echo "WARNING: Please list the specific generators needed." - echo "WARNING: \"all\" is now an alias for \"${ALL}\"; new code generators WILL NOT be added to this set" - echo - GENS="${ALL}" -fi - -INT_APIS_PKG="" -exec "$(dirname "${BASH_SOURCE[0]}")/generate-internal-groups.sh" "${GENS}" "${OUTPUT_PKG}" "${INT_APIS_PKG}" "${APIS_PKG}" "${GROUPS_WITH_VERSIONS}" "$@" diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/generate-internal-groups.sh b/cluster-autoscaler/vendor/k8s.io/code-generator/generate-internal-groups.sh deleted file mode 100644 index 9676fac313b6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/generate-internal-groups.sh +++ /dev/null @@ -1,272 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -# generate-internal-groups generates everything for a project with internal types, e.g. an -# user-provided API server based on k8s.io/apiserver. - -if [ "$#" -lt 5 ] || [ "${1}" == "--help" ]; then - cat < ... - - the generators comma separated to run (applyconfiguration,client,conversion,deepcopy,defaulter,informer,lister,openapi). - the output package name (e.g. github.com/example/project/pkg/generated). - the internal types dir (e.g. github.com/example/project/pkg/apis) or "" if none. - the external types dir (e.g. github.com/example/project/pkg/apis or githubcom/example/apis). - the groups and their versions in the format "groupA:v1,v2 groupB:v1 groupC:v2", relative - to . - ... arbitrary flags passed to all generator binaries. - -Example: - $(basename "$0") \ - deepcopy,defaulter,conversion \ - github.com/example/project/pkg/client \ - github.com/example/project/pkg/apis \ - github.com/example/project/apis \ - "foo:v1 bar:v1alpha1,v1beta1" -EOF - exit 0 -fi - -GENS="$1" -OUTPUT_PKG="$2" -INT_APIS_PKG="$3" -EXT_APIS_PKG="$4" -GROUPS_WITH_VERSIONS="$5" -shift 5 - -echo "WARNING: $(basename "$0") is deprecated." -echo "WARNING: Please use k8s.io/code-generator/kube_codegen.sh instead." -echo - -if [ "${GENS}" = "all" ] || grep -qw "all" <<<"${GENS}"; then - ALL="client,conversion,deepcopy,defaulter,informer,lister,openapi" - echo "WARNING: Specifying \"all\" as a generator is deprecated." - echo "WARNING: Please list the specific generators needed." - echo "WARNING: \"all\" is now an alias for \"${ALL}\"; new code generators WILL NOT be added to this set" - echo - GENS="${ALL}" -fi - -( - # To support running this script from anywhere, first cd into this directory, - # and then install with forced module mode on and fully qualified name. - cd "$(dirname "${0}")" - BINS=( - applyconfiguration-gen - client-gen - conversion-gen - deepcopy-gen - defaulter-gen - informer-gen - lister-gen - openapi-gen - ) - # Compile all the tools at once - it's slightly faster but also just simpler. - # shellcheck disable=2046 # printf word-splitting is intentional - GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}") -) - -# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise: -GOBIN="$(go env GOBIN)" -gobin="${GOBIN:-$(go env GOPATH)/bin}" - -function git_find() { - # Similar to find but faster and easier to understand. We want to include - # modified and untracked files because this might be running against code - # which is not tracked by git yet. - git ls-files -cmo --exclude-standard "$@" -} - -function git_grep() { - # We want to include modified and untracked files because this might be - # running against code which is not tracked by git yet. - git grep --untracked "$@" -} -function codegen::join() { local IFS="$1"; shift; echo "$*"; } - -# enumerate group versions -ALL_FQ_APIS=() # e.g. k8s.io/kubernetes/pkg/apis/apps k8s.io/api/apps/v1 -EXT_FQ_APIS=() # e.g. k8s.io/api/apps/v1 -GROUP_VERSIONS=() # e.g. apps/v1 -for GVs in ${GROUPS_WITH_VERSIONS}; do - IFS=: read -r G Vs <<<"${GVs}" - - if [ -n "${INT_APIS_PKG}" ]; then - ALL_FQ_APIS+=("${INT_APIS_PKG}/${G}") - fi - - # enumerate versions - for V in ${Vs//,/ }; do - ALL_FQ_APIS+=("${EXT_APIS_PKG}/${G}/${V}") - EXT_FQ_APIS+=("${EXT_APIS_PKG}/${G}/${V}") - GROUP_VERSIONS+=("${G}/${V}") - done -done - -CLIENTSET_PKG="${CLIENTSET_PKG_NAME:-clientset}" -CLIENTSET_NAME="${CLIENTSET_NAME_VERSIONED:-versioned}" - -if grep -qw "deepcopy" <<<"${GENS}"; then - # Nuke existing files - for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do - pushd "${dir}" >/dev/null - git_find -z ':(glob)**'/zz_generated.deepcopy.go | xargs -0 rm -f - popd >/dev/null - done - - echo "Generating deepcopy funcs" - "${gobin}/deepcopy-gen" \ - --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" \ - -O zz_generated.deepcopy \ - "$@" -fi - -if grep -qw "defaulter" <<<"${GENS}"; then - # Nuke existing files - for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do - pushd "${dir}" >/dev/null - git_find -z ':(glob)**'/zz_generated.defaults.go | xargs -0 rm -f - popd >/dev/null - done - - echo "Generating defaulters" - "${gobin}/defaulter-gen" \ - --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" \ - -O zz_generated.defaults \ - "$@" -fi - -if grep -qw "conversion" <<<"${GENS}"; then - # Nuke existing files - for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${ALL_FQ_APIS[@]}"); do - pushd "${dir}" >/dev/null - git_find -z ':(glob)**'/zz_generated.conversion.go | xargs -0 rm -f - popd >/dev/null - done - - echo "Generating conversions" - "${gobin}/conversion-gen" \ - --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" \ - -O zz_generated.conversion \ - "$@" -fi - -if grep -qw "applyconfiguration" <<<"${GENS}"; then - APPLY_CONFIGURATION_PACKAGE="${OUTPUT_PKG}/${APPLYCONFIGURATION_PKG_NAME:-applyconfiguration}" - - # Nuke existing files - root="$(GO111MODULE=on go list -f '{{.Dir}}' "${APPLY_CONFIGURATION_PACKAGE}" 2>/dev/null || true)" - if [ -n "${root}" ]; then - pushd "${root}" >/dev/null - git_grep -l --null \ - -e '^// Code generated by applyconfiguration-gen. DO NOT EDIT.$' \ - ':(glob)**/*.go' \ - | xargs -0 rm -f - popd >/dev/null - fi - - echo "Generating apply configuration for ${GROUPS_WITH_VERSIONS} at ${APPLY_CONFIGURATION_PACKAGE}" - "${gobin}/applyconfiguration-gen" \ - --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" \ - --output-package "${APPLY_CONFIGURATION_PACKAGE}" \ - "$@" -fi - -if grep -qw "client" <<<"${GENS}"; then - # Nuke existing files - root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/${CLIENTSET_PKG}/${CLIENTSET_NAME}" 2>/dev/null || true)" - if [ -n "${root}" ]; then - pushd "${root}" >/dev/null - git_grep -l --null \ - -e '^// Code generated by client-gen. DO NOT EDIT.$' \ - ':(glob)**/*.go' \ - | xargs -0 rm -f - popd >/dev/null - fi - - echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG}" - "${gobin}/client-gen" \ - --clientset-name "${CLIENTSET_NAME}" \ - --input-base "" \ - --input "$(codegen::join , "${EXT_FQ_APIS[@]}")" \ - --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG}" \ - --apply-configuration-package "${APPLY_CONFIGURATION_PACKAGE:-}" \ - "$@" -fi - -if grep -qw "lister" <<<"${GENS}"; then - # Nuke existing files - for gv in "${GROUP_VERSIONS[@]}"; do - root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/listers/${gv}" 2>/dev/null || true)" - if [ -n "${root}" ]; then - pushd "${root}" >/dev/null - git_grep -l --null \ - -e '^// Code generated by lister-gen. DO NOT EDIT.$' \ - ':(glob)**/*.go' \ - | xargs -0 rm -f - popd >/dev/null - fi - done - - echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" - "${gobin}/lister-gen" \ - --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" \ - --output-package "${OUTPUT_PKG}/listers" \ - "$@" -fi - -if grep -qw "informer" <<<"${GENS}"; then - # Nuke existing files - root="$(GO111MODULE=on go list -f '{{.Dir}}' "${OUTPUT_PKG}/informers/externalversions" 2>/dev/null || true)" - if [ -n "${root}" ]; then - pushd "${root}" >/dev/null - git_grep -l --null \ - -e '^// Code generated by informer-gen. DO NOT EDIT.$' \ - ':(glob)**/*.go' \ - | xargs -0 rm -f - popd >/dev/null - fi - - echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" - "${gobin}/informer-gen" \ - --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" \ - --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG}/${CLIENTSET_NAME}" \ - --listers-package "${OUTPUT_PKG}/listers" \ - --output-package "${OUTPUT_PKG}/informers" \ - "$@" -fi - -if grep -qw "openapi" <<<"${GENS}"; then - # Nuke existing files - for dir in $(GO111MODULE=on go list -f '{{.Dir}}' "${FQ_APIS[@]}"); do - pushd "${dir}" >/dev/null - git_find -z ':(glob)**'/zz_generated.openapi.go | xargs -0 rm -f - popd >/dev/null - done - - echo "Generating OpenAPI definitions for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/openapi" - declare -a OPENAPI_EXTRA_PACKAGES - "${gobin}/openapi-gen" \ - --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}" "${OPENAPI_EXTRA_PACKAGES[@]+"${OPENAPI_EXTRA_PACKAGES[@]}"}")" \ - --input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version" \ - --output-package "${OUTPUT_PKG}/openapi" \ - -O zz_generated.openapi \ - "$@" -fi diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/kube_codegen.sh b/cluster-autoscaler/vendor/k8s.io/code-generator/kube_codegen.sh deleted file mode 100644 index 6ded2048368f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/kube_codegen.sh +++ /dev/null @@ -1,651 +0,0 @@ -#!/usr/bin/env bash - -# 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. - -# This presents several functions for packages which want to use kubernetes -# code-generation tools. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_CODEGEN_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)" - -function kube::codegen::internal::git_find() { - # Similar to find but faster and easier to understand. We want to include - # modified and untracked files because this might be running against code - # which is not tracked by git yet. - git ls-files -cmo --exclude-standard "$@" -} - -function kube::codegen::internal::git_grep() { - # We want to include modified and untracked files because this might be - # running against code which is not tracked by git yet. - git grep --untracked "$@" -} - -# Generate tagged helper code: conversions, deepcopy, and defaults -# -# Args: -# --input-pkg-root -# The root package under which to search for files which request code to be -# generated. This must be Go package syntax, e.g. "k8s.io/foo/bar". -# -# --output-base -# The root directory under which to emit code. The concatenation of -# + must be valid. -# -# --boilerplate -# An optional override for the header file to insert into generated files. -# -# --extra-peer-dir -# An optional list (this flag may be specified multiple times) of "extra" -# directories to consider during conversion generation. -# -function kube::codegen::gen_helpers() { - local in_pkg_root="" - local out_base="" # gengo needs the output dir must be $out_base/$out_pkg_root - local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt" - local v="${KUBE_VERBOSE:-0}" - local extra_peers=() - - while [ "$#" -gt 0 ]; do - case "$1" in - "--input-pkg-root") - in_pkg_root="$2" - shift 2 - ;; - "--output-base") - out_base="$2" - shift 2 - ;; - "--boilerplate") - boilerplate="$2" - shift 2 - ;; - "--extra-peer-dir") - extra_peers+=("$2") - shift 2 - ;; - *) - echo "unknown argument: $1" >&2 - return 1 - ;; - esac - done - - if [ -z "${in_pkg_root}" ]; then - echo "--input-pkg-root is required" >&2 - return 1 - fi - if [ -z "${out_base}" ]; then - echo "--output-base is required" >&2 - return 1 - fi - - ( - # To support running this from anywhere, first cd into this directory, - # and then install with forced module mode on and fully qualified name. - cd "${KUBE_CODEGEN_ROOT}" - BINS=( - conversion-gen - deepcopy-gen - defaulter-gen - ) - # shellcheck disable=2046 # printf word-splitting is intentional - GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}") - ) - # Go installs in $GOBIN if defined, and $GOPATH/bin otherwise - gobin="${GOBIN:-$(go env GOPATH)/bin}" - - # These tools all assume out-dir == in-dir. - root="${out_base}/${in_pkg_root}" - mkdir -p "${root}" - root="$(cd "${root}" && pwd -P)" - - # Deepcopy - # - local input_pkgs=() - while read -r file; do - dir="$(dirname "${file}")" - pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)" - input_pkgs+=("${pkg}") - done < <( - ( kube::codegen::internal::git_grep -l \ - -e '+k8s:deepcopy-gen=' \ - ":(glob)${root}"/'**/*.go' \ - || true \ - ) | LC_ALL=C sort -u - ) - - if [ "${#input_pkgs[@]}" != 0 ]; then - echo "Generating deepcopy code for ${#input_pkgs[@]} targets" - - kube::codegen::internal::git_find -z \ - ":(glob)${root}"/'**/zz_generated.deepcopy.go' \ - | xargs -0 rm -f - - local input_args=() - for arg in "${input_pkgs[@]}"; do - input_args+=("--input-dirs" "$arg") - done - "${gobin}/deepcopy-gen" \ - -v "${v}" \ - -O zz_generated.deepcopy \ - --go-header-file "${boilerplate}" \ - --output-base "${out_base}" \ - "${input_args[@]}" - fi - - # Defaults - # - local input_pkgs=() - while read -r file; do - dir="$(dirname "${file}")" - pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)" - input_pkgs+=("${pkg}") - done < <( - ( kube::codegen::internal::git_grep -l \ - -e '+k8s:defaulter-gen=' \ - ":(glob)${root}"/'**/*.go' \ - || true \ - ) | LC_ALL=C sort -u - ) - - if [ "${#input_pkgs[@]}" != 0 ]; then - echo "Generating defaulter code for ${#input_pkgs[@]} targets" - - kube::codegen::internal::git_find -z \ - ":(glob)${root}"/'**/zz_generated.defaults.go' \ - | xargs -0 rm -f - - local input_args=() - for arg in "${input_pkgs[@]}"; do - input_args+=("--input-dirs" "$arg") - done - "${gobin}/defaulter-gen" \ - -v "${v}" \ - -O zz_generated.defaults \ - --go-header-file "${boilerplate}" \ - --output-base "${out_base}" \ - "${input_args[@]}" - fi - - # Conversions - # - local input_pkgs=() - while read -r file; do - dir="$(dirname "${file}")" - pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)" - input_pkgs+=("${pkg}") - done < <( - ( kube::codegen::internal::git_grep -l \ - -e '+k8s:conversion-gen=' \ - ":(glob)${root}"/'**/*.go' \ - || true \ - ) | LC_ALL=C sort -u - ) - - if [ "${#input_pkgs[@]}" != 0 ]; then - echo "Generating conversion code for ${#input_pkgs[@]} targets" - - kube::codegen::internal::git_find -z \ - ":(glob)${root}"/'**/zz_generated.conversion.go' \ - | xargs -0 rm -f - - local input_args=() - for arg in "${input_pkgs[@]}"; do - input_args+=("--input-dirs" "$arg") - done - local extra_peer_args=() - for arg in "${extra_peers[@]:+"${extra_peers[@]}"}"; do - extra_peer_args+=("--extra-peer-dirs" "$arg") - done - "${gobin}/conversion-gen" \ - -v "${v}" \ - -O zz_generated.conversion \ - --go-header-file "${boilerplate}" \ - --output-base "${out_base}" \ - "${extra_peer_args[@]:+"${extra_peer_args[@]}"}" \ - "${input_args[@]}" - fi -} - -# Generate openapi code -# -# Args: -# --input-pkg-root -# The root package under which to search for files which request openapi to -# be generated. This must be Go package syntax, e.g. "k8s.io/foo/bar". -# -# --output-pkg-root -# The root package under which generated directories and files -# will be placed. This must be go package syntax, e.g. "k8s.io/foo/bar". -# -# --output-base -# The root directory under which to emit code. The concatenation of -# + must be valid. -# -# --openapi-name -# An optional override for the leaf name of the generated directory. -# -# --extra-pkgs -# An optional list of additional packages to be imported during openapi -# generation. The argument must be Go package syntax, e.g. -# "k8s.io/foo/bar". It may be a single value or a comma-delimited list. -# This flag may be repeated. -# -# --report-filename -# An optional path at which to write an API violations report. "-" means -# stdout. -# -# --update-report -# If specified, update the report file in place, rather than diffing it. -# -# --boilerplate -# An optional override for the header file to insert into generated files. -# -function kube::codegen::gen_openapi() { - local in_pkg_root="" - local out_pkg_root="" - local out_base="" # gengo needs the output dir must be $out_base/$out_pkg_root - local openapi_subdir="openapi" - local extra_pkgs=() - local report="/dev/null" - local update_report="" - local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt" - local v="${KUBE_VERBOSE:-0}" - - while [ "$#" -gt 0 ]; do - case "$1" in - "--input-pkg-root") - in_pkg_root="$2" - shift 2 - ;; - "--output-pkg-root") - out_pkg_root="$2" - shift 2 - ;; - "--output-base") - out_base="$2" - shift 2 - ;; - "--openapi-name") - openapi_subdir="$2" - shift 2 - ;; - "--extra-pkgs") - extra_pkgs+=("$2") - shift 2 - ;; - "--report-filename") - report="$2" - shift 2 - ;; - "--update-report") - update_report="true" - shift - ;; - "--boilerplate") - boilerplate="$2" - shift 2 - ;; - *) - echo "unknown argument: $1" >&2 - return 1 - ;; - esac - done - - if [ -z "${in_pkg_root}" ]; then - echo "--input-pkg-root is required" >&2 - return 1 - fi - if [ -z "${out_pkg_root}" ]; then - echo "--output-pkg-root is required" >&2 - return 1 - fi - if [ -z "${out_base}" ]; then - echo "--output-base is required" >&2 - return 1 - fi - - local new_report - new_report="$(mktemp -t "$(basename "$0").api_violations.XXXXXX")" - if [ -n "${update_report}" ]; then - new_report="${report}" - fi - - ( - # To support running this from anywhere, first cd into this directory, - # and then install with forced module mode on and fully qualified name. - cd "${KUBE_CODEGEN_ROOT}" - BINS=( - openapi-gen - ) - # shellcheck disable=2046 # printf word-splitting is intentional - GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}") - ) - # Go installs in $GOBIN if defined, and $GOPATH/bin otherwise - gobin="${GOBIN:-$(go env GOPATH)/bin}" - - # These tools all assume out-dir == in-dir. - root="${out_base}/${in_pkg_root}" - mkdir -p "${root}" - root="$(cd "${root}" && pwd -P)" - - local input_pkgs=( "${extra_pkgs[@]:+"${extra_pkgs[@]}"}") - while read -r file; do - dir="$(dirname "${file}")" - pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)" - input_pkgs+=("${pkg}") - done < <( - ( kube::codegen::internal::git_grep -l \ - -e '+k8s:openapi-gen=' \ - ":(glob)${root}"/'**/*.go' \ - || true \ - ) | LC_ALL=C sort -u - ) - - if [ "${#input_pkgs[@]}" != 0 ]; then - echo "Generating openapi code for ${#input_pkgs[@]} targets" - - kube::codegen::internal::git_find -z \ - ":(glob)${root}"/'**/zz_generated.openapi.go' \ - | xargs -0 rm -f - - local inputs=() - for arg in "${input_pkgs[@]}"; do - inputs+=("--input-dirs" "$arg") - done - "${gobin}/openapi-gen" \ - -v "${v}" \ - -O zz_generated.openapi \ - --go-header-file "${boilerplate}" \ - --output-base "${out_base}" \ - --output-package "${out_pkg_root}/${openapi_subdir}" \ - --report-filename "${new_report}" \ - --input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1" \ - --input-dirs "k8s.io/apimachinery/pkg/runtime" \ - --input-dirs "k8s.io/apimachinery/pkg/version" \ - "${inputs[@]}" - fi - - touch "${report}" # in case it doesn't exist yet - if ! diff -u "${report}" "${new_report}"; then - echo -e "ERROR:" - echo -e "\tAPI rule check failed for ${report}: new reported violations" - echo -e "\tPlease read api/api-rules/README.md" - return 1 - fi -} - -# Generate client code -# -# Args: -# --input-pkg-root -# The root package under which to search for types.go files which request -# clients to be generated. This must be Go package syntax, e.g. -# "k8s.io/foo/bar". -# -# --output-pkg-root -# The root package into which generated directories and files will be -# placed. This must be Go package syntax, e.g. "k8s.io/foo/bar". -# -# --output-base -# The root directory under which to emit code. The concatenation of -# + must be valid. -# -# --boilerplate -# An optional override for the header file to insert into generated files. -# -# --clientset-name -# An optional override for the leaf name of the generated "clientset" directory. -# -# --versioned-name -# An optional override for the leaf name of the generated -# "/versioned" directory. -# -# --with-applyconfig -# Enables generation of applyconfiguration files. -# -# --applyconfig-name -# An optional override for the leaf name of the generated "applyconfiguration" directory. -# -# --with-watch -# Enables generation of listers and informers for APIs which support WATCH. -# -# --listers-name -# An optional override for the leaf name of the generated "listers" directory. -# -# --informers-name -# An optional override for the leaf name of the generated "informers" directory. -# -function kube::codegen::gen_client() { - local in_pkg_root="" - local out_pkg_root="" - local out_base="" # gengo needs the output dir must be $out_base/$out_pkg_root - local clientset_subdir="clientset" - local clientset_versioned_name="versioned" - local applyconfig="false" - local applyconfig_subdir="applyconfiguration" - local watchable="false" - local listers_subdir="listers" - local informers_subdir="informers" - local boilerplate="${KUBE_CODEGEN_ROOT}/hack/boilerplate.go.txt" - local v="${KUBE_VERBOSE:-0}" - - while [ "$#" -gt 0 ]; do - case "$1" in - "--input-pkg-root") - in_pkg_root="$2" - shift 2 - ;; - "--output-pkg-root") - out_pkg_root="$2" - shift 2 - ;; - "--output-base") - out_base="$2" - shift 2 - ;; - "--boilerplate") - boilerplate="$2" - shift 2 - ;; - "--clientset-name") - clientset_subdir="$2" - shift 2 - ;; - "--versioned-name") - clientset_versioned_name="$2" - shift 2 - ;; - "--with-applyconfig") - applyconfig="true" - shift - ;; - "--applyconfig-name") - applyconfig_subdir="$2" - shift 2 - ;; - "--with-watch") - watchable="true" - shift - ;; - "--listers-name") - listers_subdir="$2" - shift 2 - ;; - "--informers-name") - informers_subdir="$2" - shift 2 - ;; - *) - echo "unknown argument: $1" >&2 - return 1 - ;; - esac - done - - if [ -z "${in_pkg_root}" ]; then - echo "--input-pkg-root is required" >&2 - return 1 - fi - if [ -z "${out_pkg_root}" ]; then - echo "--output-pkg-root is required" >&2 - return 1 - fi - if [ -z "${out_base}" ]; then - echo "--output-base is required" >&2 - return 1 - fi - - ( - # To support running this from anywhere, first cd into this directory, - # and then install with forced module mode on and fully qualified name. - cd "${KUBE_CODEGEN_ROOT}" - BINS=( - applyconfiguration-gen - client-gen - informer-gen - lister-gen - ) - # shellcheck disable=2046 # printf word-splitting is intentional - GO111MODULE=on go install $(printf "k8s.io/code-generator/cmd/%s " "${BINS[@]}") - ) - # Go installs in $GOBIN if defined, and $GOPATH/bin otherwise - gobin="${GOBIN:-$(go env GOPATH)/bin}" - - in_root="${out_base}/${in_pkg_root}" - mkdir -p "${in_root}" - in_root="$(cd "${in_root}" && pwd -P)" - out_root="${out_base}/${out_pkg_root}" - mkdir -p "${out_root}" - out_root="$(cd "${out_root}" && pwd -P)" - - local group_versions=() - local input_pkgs=() - while read -r file; do - dir="$(dirname "${file}")" - pkg="$(cd "${dir}" && GO111MODULE=on go list -find .)" - leaf="$(basename "${dir}")" - if grep -E -q '^v[0-9]+((alpha|beta)[0-9]+)?$' <<< "${leaf}"; then - input_pkgs+=("${pkg}") - - dir2="$(dirname "${dir}")" - leaf2="$(basename "${dir2}")" - group_versions+=("${leaf2}/${leaf}") - fi - done < <( - ( kube::codegen::internal::git_grep -l \ - -e '+genclient' \ - ":(glob)${in_root}"/'**/types.go' \ - || true \ - ) | LC_ALL=C sort -u - ) - - if [ "${#group_versions[@]}" == 0 ]; then - return 0 - fi - - applyconfig_pkg="" # set this for later use, iff enabled - if [ "${applyconfig}" == "true" ]; then - applyconfig_pkg="${out_pkg_root}/${applyconfig_subdir}" - - echo "Generating applyconfig code for ${#input_pkgs[@]} targets" - - ( kube::codegen::internal::git_grep -l --null \ - -e '^// Code generated by applyconfiguration-gen. DO NOT EDIT.$' \ - ":(glob)${out_root}/${applyconfig_subdir}"/'**/*.go' \ - || true \ - ) | xargs -0 rm -f - - local inputs=() - for arg in "${input_pkgs[@]}"; do - inputs+=("--input-dirs" "$arg") - done - "${gobin}/applyconfiguration-gen" \ - -v "${v}" \ - --go-header-file "${boilerplate}" \ - --output-base "${out_base}" \ - --output-package "${out_pkg_root}/${applyconfig_subdir}" \ - "${inputs[@]}" - fi - - echo "Generating client code for ${#group_versions[@]} targets" - - ( kube::codegen::internal::git_grep -l --null \ - -e '^// Code generated by client-gen. DO NOT EDIT.$' \ - ":(glob)${out_root}/${clientset_subdir}"/'**/*.go' \ - || true \ - ) | xargs -0 rm -f - - local inputs=() - for arg in "${group_versions[@]}"; do - inputs+=("--input" "$arg") - done - "${gobin}/client-gen" \ - -v "${v}" \ - --go-header-file "${boilerplate}" \ - --clientset-name "${clientset_versioned_name}" \ - --input-base "${in_pkg_root}" \ - --output-base "${out_base}" \ - --output-package "${out_pkg_root}/${clientset_subdir}" \ - --apply-configuration-package "${applyconfig_pkg}" \ - "${inputs[@]}" - - if [ "${watchable}" == "true" ]; then - echo "Generating lister code for ${#input_pkgs[@]} targets" - - ( kube::codegen::internal::git_grep -l --null \ - -e '^// Code generated by lister-gen. DO NOT EDIT.$' \ - ":(glob)${out_root}/${listers_subdir}"/'**/*.go' \ - || true \ - ) | xargs -0 rm -f - - local inputs=() - for arg in "${input_pkgs[@]}"; do - inputs+=("--input-dirs" "$arg") - done - "${gobin}/lister-gen" \ - -v "${v}" \ - --go-header-file "${boilerplate}" \ - --output-base "${out_base}" \ - --output-package "${out_pkg_root}/${listers_subdir}" \ - "${inputs[@]}" - - echo "Generating informer code for ${#input_pkgs[@]} targets" - - ( kube::codegen::internal::git_grep -l --null \ - -e '^// Code generated by informer-gen. DO NOT EDIT.$' \ - ":(glob)${out_root}/${informers_subdir}"/'**/*.go' \ - || true \ - ) | xargs -0 rm -f - - local inputs=() - for arg in "${input_pkgs[@]}"; do - inputs+=("--input-dirs" "$arg") - done - "${gobin}/informer-gen" \ - -v "${v}" \ - --go-header-file "${boilerplate}" \ - --output-base "${out_base}" \ - --output-package "${out_pkg_root}/${informers_subdir}" \ - --versioned-clientset-package "${out_pkg_root}/${clientset_subdir}/${clientset_versioned_name}" \ - --listers-package "${out_pkg_root}/${listers_subdir}" \ - "${inputs[@]}" - fi -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/namer/tag-override.go b/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/namer/tag-override.go deleted file mode 100644 index fd8c3a8553ce..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/namer/tag-override.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 namer - -import ( - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// TagOverrideNamer is a namer which pulls names from a given tag, if specified, -// and otherwise falls back to a different namer. -type TagOverrideNamer struct { - tagName string - fallback namer.Namer -} - -// Name returns the tag value if it exists. It no tag was found the fallback namer will be used -func (n *TagOverrideNamer) Name(t *types.Type) string { - if nameOverride := extractTag(n.tagName, append(t.SecondClosestCommentLines, t.CommentLines...)); nameOverride != "" { - return nameOverride - } - - return n.fallback.Name(t) -} - -// NewTagOverrideNamer creates a namer.Namer which uses the contents of the given tag as -// the name, or falls back to another Namer if the tag is not present. -func NewTagOverrideNamer(tagName string, fallback namer.Namer) namer.Namer { - return &TagOverrideNamer{ - tagName: tagName, - fallback: fallback, - } -} - -// extractTag gets the comment-tags for the key. If the tag did not exist, it -// returns the empty string. -func extractTag(key string, lines []string) string { - val, present := types.ExtractCommentTags("+", lines)[key] - if !present || len(val) < 1 { - return "" - } - - return val[0] -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/util/build.go b/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/util/build.go deleted file mode 100644 index 53f93afe3493..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/util/build.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 util - -import ( - gobuild "go/build" - "path/filepath" - "strings" -) - -// CurrentPackage returns the go package of the current directory, or "" if it cannot -// be derived from the GOPATH. -func CurrentPackage() string { - for _, root := range gobuild.Default.SrcDirs() { - if pkg, ok := hasSubdir(root, "."); ok { - return pkg - } - } - return "" -} - -func hasSubdir(root, dir string) (rel string, ok bool) { - // ensure a tailing separator to properly compare on word-boundaries - const sep = string(filepath.Separator) - root = filepath.Clean(root) - if !strings.HasSuffix(root, sep) { - root += sep - } - - // check whether root dir starts with root - dir = filepath.Clean(dir) - if !strings.HasPrefix(dir, root) { - return "", false - } - - // cut off root - return filepath.ToSlash(dir[len(root):]), true -} - -// Vendorless trims vendor prefix from a package path to make it canonical -func Vendorless(p string) string { - if pos := strings.LastIndex(p, "/vendor/"); pos != -1 { - return p[pos+len("/vendor/"):] - } - return p -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/util/plural_exceptions.go b/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/util/plural_exceptions.go deleted file mode 100644 index 73c648d5b595..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/pkg/util/plural_exceptions.go +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 util - -import ( - "fmt" - "strings" -) - -// PluralExceptionListToMapOrDie converts the list in "Type:PluralType" to map[string]string. -// This is used for pluralizer. -// If the format is wrong, this function will panic. -func PluralExceptionListToMapOrDie(pluralExceptions []string) map[string]string { - pluralExceptionMap := make(map[string]string, len(pluralExceptions)) - for i := range pluralExceptions { - parts := strings.Split(pluralExceptions[i], ":") - if len(parts) != 2 { - panic(fmt.Sprintf("invalid plural exception definition: %s", pluralExceptions[i])) - } - pluralExceptionMap[parts[0]] = parts[1] - } - return pluralExceptionMap -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/LICENSE b/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/LICENSE deleted file mode 100644 index 6a66aea5eafe..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/PATENTS b/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/PATENTS deleted file mode 100644 index 733099041f84..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/reflect/type.go b/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/reflect/type.go deleted file mode 100644 index 67957ee33e9c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/third_party/forked/golang/reflect/type.go +++ /dev/null @@ -1,91 +0,0 @@ -//This package is copied from Go library reflect/type.go. -//The struct tag library provides no way to extract the list of struct tags, only -//a specific tag -package reflect - -import ( - "fmt" - - "strconv" - "strings" -) - -type StructTag struct { - Name string - Value string -} - -func (t StructTag) String() string { - return fmt.Sprintf("%s:%q", t.Name, t.Value) -} - -type StructTags []StructTag - -func (tags StructTags) String() string { - s := make([]string, 0, len(tags)) - for _, tag := range tags { - s = append(s, tag.String()) - } - return "`" + strings.Join(s, " ") + "`" -} - -func (tags StructTags) Has(name string) bool { - for i := range tags { - if tags[i].Name == name { - return true - } - } - return false -} - -// ParseStructTags returns the full set of fields in a struct tag in the order they appear in -// the struct tag. -func ParseStructTags(tag string) (StructTags, error) { - tags := StructTags{} - for tag != "" { - // Skip leading space. - i := 0 - for i < len(tag) && tag[i] == ' ' { - i++ - } - tag = tag[i:] - if tag == "" { - break - } - - // Scan to colon. A space, a quote or a control character is a syntax error. - // Strictly speaking, control chars include the range [0x7f, 0x9f], not just - // [0x00, 0x1f], but in practice, we ignore the multi-byte control characters - // as it is simpler to inspect the tag's bytes than the tag's runes. - i = 0 - for i < len(tag) && tag[i] > ' ' && tag[i] != ':' && tag[i] != '"' && tag[i] != 0x7f { - i++ - } - if i == 0 || i+1 >= len(tag) || tag[i] != ':' || tag[i+1] != '"' { - break - } - name := string(tag[:i]) - tag = tag[i+1:] - - // Scan quoted string to find value. - i = 1 - for i < len(tag) && tag[i] != '"' { - if tag[i] == '\\' { - i++ - } - i++ - } - if i >= len(tag) { - break - } - qvalue := string(tag[:i+1]) - tag = tag[i+1:] - - value, err := strconv.Unquote(qvalue) - if err != nil { - return nil, err - } - tags = append(tags, StructTag{Name: name, Value: value}) - } - return tags, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/code-generator/tools.go b/cluster-autoscaler/vendor/k8s.io/code-generator/tools.go deleted file mode 100644 index 90b942b07036..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/code-generator/tools.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build tools -// +build tools - -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This package contains code generation utilities -// This package imports things required by build scripts, to force `go mod` to see them as dependencies -package codegenerator - -import ( - _ "k8s.io/code-generator/cmd/applyconfiguration-gen" - _ "k8s.io/code-generator/cmd/client-gen" - _ "k8s.io/code-generator/cmd/conversion-gen" - _ "k8s.io/code-generator/cmd/deepcopy-gen" - _ "k8s.io/code-generator/cmd/defaulter-gen" - _ "k8s.io/code-generator/cmd/go-to-protobuf" - _ "k8s.io/code-generator/cmd/import-boss" - _ "k8s.io/code-generator/cmd/informer-gen" - _ "k8s.io/code-generator/cmd/lister-gen" - _ "k8s.io/code-generator/cmd/openapi-gen" - _ "k8s.io/code-generator/cmd/register-gen" - _ "k8s.io/code-generator/cmd/set-gen" -) diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go deleted file mode 100644 index 20723687e985..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/json.go +++ /dev/null @@ -1,159 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 json - -import ( - "io" - "sync/atomic" - "time" - - "github.com/go-logr/logr" - "github.com/go-logr/zapr" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - - "k8s.io/component-base/featuregate" - logsapi "k8s.io/component-base/logs/api/v1" -) - -var ( - // timeNow stubbed out for testing - timeNow = time.Now -) - -type runtime struct { - v uint32 -} - -func (r *runtime) ZapV() zapcore.Level { - // zap levels are inverted: everything with a verbosity >= threshold gets logged. - return -zapcore.Level(atomic.LoadUint32(&r.v)) -} - -// Enabled implements the zapcore.LevelEnabler interface. -func (r *runtime) Enabled(level zapcore.Level) bool { - return level >= r.ZapV() -} - -func (r *runtime) SetVerbosityLevel(v uint32) error { - atomic.StoreUint32(&r.v, v) - return nil -} - -var _ zapcore.LevelEnabler = &runtime{} - -// NewJSONLogger creates a new json logr.Logger and its associated -// control interface. The separate error stream is optional and may be nil. -// The encoder config is also optional. -func NewJSONLogger(v logsapi.VerbosityLevel, infoStream, errorStream zapcore.WriteSyncer, encoderConfig *zapcore.EncoderConfig) (logr.Logger, logsapi.RuntimeControl) { - r := &runtime{v: uint32(v)} - - if encoderConfig == nil { - encoderConfig = &zapcore.EncoderConfig{ - MessageKey: "msg", - CallerKey: "caller", - NameKey: "logger", - TimeKey: "ts", - EncodeTime: epochMillisTimeEncoder, - EncodeDuration: zapcore.StringDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - } - } - - encoder := zapcore.NewJSONEncoder(*encoderConfig) - var core zapcore.Core - if errorStream == nil { - core = zapcore.NewCore(encoder, infoStream, r) - } else { - highPriority := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool { - return lvl >= zapcore.ErrorLevel && r.Enabled(lvl) - }) - lowPriority := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool { - return lvl < zapcore.ErrorLevel && r.Enabled(lvl) - }) - core = zapcore.NewTee( - zapcore.NewCore(encoder, errorStream, highPriority), - zapcore.NewCore(encoder, infoStream, lowPriority), - ) - } - l := zap.New(core, zap.WithCaller(true)) - return zapr.NewLoggerWithOptions(l, zapr.LogInfoLevel("v"), zapr.ErrorKey("err")), - logsapi.RuntimeControl{ - SetVerbosityLevel: r.SetVerbosityLevel, - Flush: func() { - _ = l.Sync() - }, - } -} - -func epochMillisTimeEncoder(_ time.Time, enc zapcore.PrimitiveArrayEncoder) { - nanos := timeNow().UnixNano() - millis := float64(nanos) / float64(time.Millisecond) - enc.AppendFloat64(millis) -} - -// Factory produces JSON logger instances. -type Factory struct{} - -var _ logsapi.LogFormatFactory = Factory{} - -func (f Factory) Feature() featuregate.Feature { - return logsapi.LoggingBetaOptions -} - -func (f Factory) Create(c logsapi.LoggingConfiguration, o logsapi.LoggingOptions) (logr.Logger, logsapi.RuntimeControl) { - // We intentionally avoid all os.File.Sync calls. Output is unbuffered, - // therefore we don't need to flush, and calling the underlying fsync - // would just slow down writing. - // - // The assumption is that logging only needs to ensure that data gets - // written to the output stream before the process terminates, but - // doesn't need to worry about data not being written because of a - // system crash or powerloss. - stderr := zapcore.Lock(AddNopSync(o.ErrorStream)) - if c.Options.JSON.SplitStream { - stdout := zapcore.Lock(AddNopSync(o.InfoStream)) - size := c.Options.JSON.InfoBufferSize.Value() - if size > 0 { - // Prevent integer overflow. - if size > 2*1024*1024*1024 { - size = 2 * 1024 * 1024 * 1024 - } - stdout = &zapcore.BufferedWriteSyncer{ - WS: stdout, - Size: int(size), - } - } - // stdout for info messages, stderr for errors. - return NewJSONLogger(c.Verbosity, stdout, stderr, nil) - } - // Write info messages and errors to stderr to prevent mixing with normal program output. - return NewJSONLogger(c.Verbosity, stderr, nil, nil) -} - -// AddNoSync adds a NOP Sync implementation. -func AddNopSync(writer io.Writer) zapcore.WriteSyncer { - return nopSync{Writer: writer} -} - -type nopSync struct { - io.Writer -} - -func (f nopSync) Sync() error { - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/register/register.go b/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/register/register.go deleted file mode 100644 index bf76425a2afe..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/component-base/logs/json/register/register.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -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 register - -import ( - logsapi "k8s.io/component-base/logs/api/v1" - json "k8s.io/component-base/logs/json" -) - -func init() { - // JSON format is optional klog format - if err := logsapi.RegisterLogFormat(logsapi.JSONLogFormat, json.Factory{}, logsapi.LoggingBetaOptions); err != nil { - panic(err) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/component-base/version/dynamic.go b/cluster-autoscaler/vendor/k8s.io/component-base/version/dynamic.go deleted file mode 100644 index 46ade9f5ec13..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/component-base/version/dynamic.go +++ /dev/null @@ -1,77 +0,0 @@ -/* -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 version - -import ( - "fmt" - "sync/atomic" - - utilversion "k8s.io/apimachinery/pkg/util/version" -) - -var dynamicGitVersion atomic.Value - -func init() { - // initialize to static gitVersion - dynamicGitVersion.Store(gitVersion) -} - -// SetDynamicVersion overrides the version returned as the GitVersion from Get(). -// The specified version must be non-empty, a valid semantic version, and must -// match the major/minor/patch version of the default gitVersion. -func SetDynamicVersion(dynamicVersion string) error { - if err := ValidateDynamicVersion(dynamicVersion); err != nil { - return err - } - dynamicGitVersion.Store(dynamicVersion) - return nil -} - -// ValidateDynamicVersion ensures the given version is non-empty, a valid semantic version, -// and matched the major/minor/patch version of the default gitVersion. -func ValidateDynamicVersion(dynamicVersion string) error { - return validateDynamicVersion(dynamicVersion, gitVersion) -} - -func validateDynamicVersion(dynamicVersion, defaultVersion string) error { - if len(dynamicVersion) == 0 { - return fmt.Errorf("version must not be empty") - } - if dynamicVersion == defaultVersion { - // allow no-op - return nil - } - vRuntime, err := utilversion.ParseSemantic(dynamicVersion) - if err != nil { - return err - } - // must match major/minor/patch of default version - var vDefault *utilversion.Version - if defaultVersion == "v0.0.0-master+$Format:%H$" { - // special-case the placeholder value which doesn't parse as a semantic version - vDefault, err = utilversion.ParseSemantic("v0.0.0-master") - } else { - vDefault, err = utilversion.ParseSemantic(defaultVersion) - } - if err != nil { - return err - } - if vRuntime.Major() != vDefault.Major() || vRuntime.Minor() != vDefault.Minor() || vRuntime.Patch() != vDefault.Patch() { - return fmt.Errorf("version %q must match major/minor/patch of default version %q", dynamicVersion, defaultVersion) - } - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/component-helpers/node/util/sysctl/namespace.go b/cluster-autoscaler/vendor/k8s.io/component-helpers/node/util/sysctl/namespace.go deleted file mode 100644 index 7042766adec8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/component-helpers/node/util/sysctl/namespace.go +++ /dev/null @@ -1,104 +0,0 @@ -/* -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 sysctl - -import ( - "strings" -) - -// Namespace represents a kernel namespace name. -type Namespace string - -const ( - // refer to https://man7.org/linux/man-pages/man7/ipc_namespaces.7.html - // the Linux IPC namespace - IPCNamespace = Namespace("IPC") - - // refer to https://man7.org/linux/man-pages/man7/network_namespaces.7.html - // the network namespace - NetNamespace = Namespace("Net") - - // the zero value if no namespace is known - UnknownNamespace = Namespace("") -) - -var nameToNamespace = map[string]Namespace{ - // kernel semaphore parameters: SEMMSL, SEMMNS, SEMOPM, and SEMMNI. - "kernel.sem": IPCNamespace, - // kernel shared memory limits include shmall, shmmax, shmmni, and shm_rmid_forced. - "kernel.shmall": IPCNamespace, - "kernel.shmmax": IPCNamespace, - "kernel.shmmni": IPCNamespace, - "kernel.shm_rmid_forced": IPCNamespace, - // make backward compatibility to know the namespace of kernel.shm* - "kernel.shm": IPCNamespace, - // kernel messages include msgmni, msgmax and msgmnb. - "kernel.msgmax": IPCNamespace, - "kernel.msgmnb": IPCNamespace, - "kernel.msgmni": IPCNamespace, - // make backward compatibility to know the namespace of kernel.msg* - "kernel.msg": IPCNamespace, -} - -var prefixToNamespace = map[string]Namespace{ - "net": NetNamespace, - // mqueue filesystem provides the necessary kernel features to enable the creation - // of a user space library that implements the POSIX message queues API. - "fs.mqueue": IPCNamespace, -} - -// namespaceOf returns the namespace of the Linux kernel for a sysctl, or -// unknownNamespace if the sysctl is not known to be namespaced. -// The second return is prefixed bool. -// It returns true if the key is prefixed with a key in the prefix map -func namespaceOf(val string) Namespace { - if ns, found := nameToNamespace[val]; found { - return ns - } - for p, ns := range prefixToNamespace { - if strings.HasPrefix(val, p+".") { - return ns - } - } - return UnknownNamespace -} - -// GetNamespace extracts information from a sysctl string. It returns: -// 1. The sysctl namespace, which can be one of the following: IPC, Net, or unknown. -// 2. sysctlOrPrefix: the prefix of the sysctl parameter until the first '*'. -// If there is no '*', it will be the original string. -// 3. 'prefixed' is set to true if the sysctl parameter contains '*' or it is in the prefixToNamespace key list, in most cases, it is a suffix *. -// -// For example, if the input sysctl is 'net.ipv6.neigh.*', GetNamespace will return: -// - The Net namespace -// - The sysctlOrPrefix as 'net.ipv6.neigh' -// - 'prefixed' set to true -// -// For the input sysctl 'net.ipv6.conf.all.disable_ipv6', GetNamespace will return: -// - The Net namespace -// - The sysctlOrPrefix as 'net.ipv6.conf.all.disable_ipv6' -// - 'prefixed' set to false. -func GetNamespace(sysctl string) (ns Namespace, sysctlOrPrefix string, prefixed bool) { - sysctlOrPrefix = NormalizeName(sysctl) - firstIndex := strings.IndexAny(sysctlOrPrefix, "*") - if firstIndex != -1 { - sysctlOrPrefix = sysctlOrPrefix[:firstIndex] - prefixed = true - } - ns = namespaceOf(sysctlOrPrefix) - return -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/LICENSE b/cluster-autoscaler/vendor/k8s.io/gengo/LICENSE deleted file mode 100644 index 00b2401109fd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014 The Kubernetes Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/args/args.go b/cluster-autoscaler/vendor/k8s.io/gengo/args/args.go deleted file mode 100644 index b81ceb93afb7..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/args/args.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -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 args has common command-line flags for generation programs. -package args - -import ( - "bytes" - goflag "flag" - "fmt" - "io/ioutil" - "os" - "path" - "path/filepath" - "strconv" - "strings" - "time" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/parser" - - "github.com/spf13/pflag" -) - -// Default returns a defaulted GeneratorArgs. You may change the defaults -// before calling AddFlags. -func Default() *GeneratorArgs { - return &GeneratorArgs{ - OutputBase: DefaultSourceTree(), - GoHeaderFilePath: filepath.Join(DefaultSourceTree(), "k8s.io/gengo/boilerplate/boilerplate.go.txt"), - GeneratedBuildTag: "ignore_autogenerated", - GeneratedByCommentTemplate: "// Code generated by GENERATOR_NAME. DO NOT EDIT.", - defaultCommandLineFlags: true, - } -} - -// GeneratorArgs has arguments that are passed to generators. -type GeneratorArgs struct { - // Which directories to parse. - InputDirs []string - - // Source tree to write results to. - OutputBase string - - // Package path within the source tree. - OutputPackagePath string - - // Output file name. - OutputFileBaseName string - - // Where to get copyright header text. - GoHeaderFilePath string - - // If GeneratedByCommentTemplate is set, generate a "Code generated by" comment - // below the bloilerplate, of the format defined by this string. - // Any instances of "GENERATOR_NAME" will be replaced with the name of the code generator. - GeneratedByCommentTemplate string - - // If true, only verify, don't write anything. - VerifyOnly bool - - // If true, include *_test.go files - IncludeTestFiles bool - - // GeneratedBuildTag is the tag used to identify code generated by execution - // of this type. Each generator should use a different tag, and different - // groups of generators (external API that depends on Kube generations) should - // keep tags distinct as well. - GeneratedBuildTag string - - // Any custom arguments go here - CustomArgs interface{} - - // If specified, trim the prefix from OutputPackagePath before writing files. - TrimPathPrefix string - - // Whether to use default command line flags - defaultCommandLineFlags bool -} - -// WithoutDefaultFlagParsing disables implicit addition of command line flags and parsing. -func (g *GeneratorArgs) WithoutDefaultFlagParsing() *GeneratorArgs { - g.defaultCommandLineFlags = false - return g -} - -func (g *GeneratorArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringSliceVarP(&g.InputDirs, "input-dirs", "i", g.InputDirs, "Comma-separated list of import paths to get input types from.") - fs.StringVarP(&g.OutputBase, "output-base", "o", g.OutputBase, "Output base; defaults to $GOPATH/src/ or ./ if $GOPATH is not set.") - fs.StringVarP(&g.OutputPackagePath, "output-package", "p", g.OutputPackagePath, "Base package path.") - fs.StringVarP(&g.OutputFileBaseName, "output-file-base", "O", g.OutputFileBaseName, "Base name (without .go suffix) for output files.") - fs.StringVarP(&g.GoHeaderFilePath, "go-header-file", "h", g.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") - fs.BoolVar(&g.VerifyOnly, "verify-only", g.VerifyOnly, "If true, only verify existing output, do not write anything.") - fs.StringVar(&g.GeneratedBuildTag, "build-tag", g.GeneratedBuildTag, "A Go build tag to use to identify files generated by this command. Should be unique.") - fs.StringVar(&g.TrimPathPrefix, "trim-path-prefix", g.TrimPathPrefix, "If set, trim the specified prefix from --output-package when generating files.") -} - -// LoadGoBoilerplate loads the boilerplate file passed to --go-header-file. -func (g *GeneratorArgs) LoadGoBoilerplate() ([]byte, error) { - b, err := ioutil.ReadFile(g.GoHeaderFilePath) - if err != nil { - return nil, err - } - b = bytes.Replace(b, []byte("YEAR"), []byte(strconv.Itoa(time.Now().UTC().Year())), -1) - - if g.GeneratedByCommentTemplate != "" { - if len(b) != 0 { - b = append(b, byte('\n')) - } - generatorName := path.Base(os.Args[0]) - generatedByComment := strings.Replace(g.GeneratedByCommentTemplate, "GENERATOR_NAME", generatorName, -1) - s := fmt.Sprintf("%s\n\n", generatedByComment) - b = append(b, []byte(s)...) - } - return b, nil -} - -// NewBuilder makes a new parser.Builder and populates it with the input -// directories. -func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error) { - b := parser.New() - - // flag for including *_test.go - b.IncludeTestFiles = g.IncludeTestFiles - - // Ignore all auto-generated files. - b.AddBuildTags(g.GeneratedBuildTag) - - for _, d := range g.InputDirs { - var err error - if strings.HasSuffix(d, "/...") { - err = b.AddDirRecursive(strings.TrimSuffix(d, "/...")) - } else { - err = b.AddDir(d) - } - if err != nil { - return nil, fmt.Errorf("unable to add directory %q: %v", d, err) - } - } - return b, nil -} - -// DefaultSourceTree returns the /src directory of the first entry in $GOPATH. -// If $GOPATH is empty, it returns "./". Useful as a default output location. -func DefaultSourceTree() string { - paths := strings.Split(os.Getenv("GOPATH"), string(filepath.ListSeparator)) - if len(paths) > 0 && len(paths[0]) > 0 { - return filepath.Join(paths[0], "src") - } - return "./" -} - -// Execute implements main(). -// If you don't need any non-default behavior, use as: -// args.Default().Execute(...) -func (g *GeneratorArgs) Execute(nameSystems namer.NameSystems, defaultSystem string, pkgs func(*generator.Context, *GeneratorArgs) generator.Packages) error { - if g.defaultCommandLineFlags { - g.AddFlags(pflag.CommandLine) - pflag.CommandLine.AddGoFlagSet(goflag.CommandLine) - pflag.Parse() - } - - b, err := g.NewBuilder() - if err != nil { - return fmt.Errorf("Failed making a parser: %v", err) - } - - // pass through the flag on whether to include *_test.go files - b.IncludeTestFiles = g.IncludeTestFiles - - c, err := generator.NewContext(b, nameSystems, defaultSystem) - if err != nil { - return fmt.Errorf("Failed making a context: %v", err) - } - - c.TrimPathPrefix = g.TrimPathPrefix - - c.Verify = g.VerifyOnly - packages := pkgs(c, g) - if err := c.ExecutePackages(g.OutputBase, packages); err != nil { - return fmt.Errorf("Failed executing generator: %v", err) - } - - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go deleted file mode 100644 index 170f6d7f1627..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/deepcopy-gen/generators/deepcopy.go +++ /dev/null @@ -1,935 +0,0 @@ -/* -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 generators - -import ( - "fmt" - "io" - "path/filepath" - "sort" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/examples/set-gen/sets" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" -) - -// CustomArgs is used tby the go2idl framework to pass args specific to this -// generator. -type CustomArgs struct { - BoundingDirs []string // Only deal with types rooted under these dirs. -} - -// This is the comment tag that carries parameters for deep-copy generation. -const ( - tagEnabledName = "k8s:deepcopy-gen" - interfacesTagName = tagEnabledName + ":interfaces" - interfacesNonPointerTagName = tagEnabledName + ":nonpointer-interfaces" // attach the DeepCopy methods to the -) - -// Known values for the comment tag. -const tagValuePackage = "package" - -// enabledTagValue holds parameters from a tagName tag. -type enabledTagValue struct { - value string - register bool -} - -func extractEnabledTypeTag(t *types.Type) *enabledTagValue { - comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) - return extractEnabledTag(comments) -} - -func extractEnabledTag(comments []string) *enabledTagValue { - tagVals := types.ExtractCommentTags("+", comments)[tagEnabledName] - if tagVals == nil { - // No match for the tag. - return nil - } - // If there are multiple values, abort. - if len(tagVals) > 1 { - klog.Fatalf("Found %d %s tags: %q", len(tagVals), tagEnabledName, tagVals) - } - - // If we got here we are returning something. - tag := &enabledTagValue{} - - // Get the primary value. - parts := strings.Split(tagVals[0], ",") - if len(parts) >= 1 { - tag.value = parts[0] - } - - // Parse extra arguments. - parts = parts[1:] - for i := range parts { - kv := strings.SplitN(parts[i], "=", 2) - k := kv[0] - v := "" - if len(kv) == 2 { - v = kv[1] - } - switch k { - case "register": - if v != "false" { - tag.register = true - } - default: - klog.Fatalf("Unsupported %s param: %q", tagEnabledName, parts[i]) - } - } - return tag -} - -// TODO: This is created only to reduce number of changes in a single PR. -// Remove it and use PublicNamer instead. -func deepCopyNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Join: func(pre string, in []string, post string) string { - return strings.Join(in, "_") - }, - PrependPackageNames: 1, - } -} - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": deepCopyNamer(), - "raw": namer.NewRawNamer("", nil), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - inputs := sets.NewString(context.Inputs...) - packages := generator.Packages{} - header := append([]byte(fmt.Sprintf("//go:build !%s\n// +build !%s\n\n", arguments.GeneratedBuildTag, arguments.GeneratedBuildTag)), boilerplate...) - - boundingDirs := []string{} - if customArgs, ok := arguments.CustomArgs.(*CustomArgs); ok { - if customArgs.BoundingDirs == nil { - customArgs.BoundingDirs = context.Inputs - } - for i := range customArgs.BoundingDirs { - // Strip any trailing slashes - they are not exactly "correct" but - // this is friendlier. - boundingDirs = append(boundingDirs, strings.TrimRight(customArgs.BoundingDirs[i], "/")) - } - } - - for i := range inputs { - klog.V(5).Infof("Considering pkg %q", i) - pkg := context.Universe[i] - if pkg == nil { - // If the input had no Go files, for example. - continue - } - - ptag := extractEnabledTag(pkg.Comments) - ptagValue := "" - ptagRegister := false - if ptag != nil { - ptagValue = ptag.value - if ptagValue != tagValuePackage { - klog.Fatalf("Package %v: unsupported %s value: %q", i, tagEnabledName, ptagValue) - } - ptagRegister = ptag.register - klog.V(5).Infof(" tag.value: %q, tag.register: %t", ptagValue, ptagRegister) - } else { - klog.V(5).Infof(" no tag") - } - - // If the pkg-scoped tag says to generate, we can skip scanning types. - pkgNeedsGeneration := (ptagValue == tagValuePackage) - if !pkgNeedsGeneration { - // If the pkg-scoped tag did not exist, scan all types for one that - // explicitly wants generation. Ensure all types that want generation - // can be copied. - var uncopyable []string - for _, t := range pkg.Types { - klog.V(5).Infof(" considering type %q", t.Name.String()) - ttag := extractEnabledTypeTag(t) - if ttag != nil && ttag.value == "true" { - klog.V(5).Infof(" tag=true") - if !copyableType(t) { - uncopyable = append(uncopyable, fmt.Sprintf("%v", t)) - } else { - pkgNeedsGeneration = true - } - } - } - if len(uncopyable) > 0 { - klog.Fatalf("Types requested deepcopy generation but are not copyable: %s", - strings.Join(uncopyable, ", ")) - } - } - - if pkgNeedsGeneration { - klog.V(3).Infof("Package %q needs generation", i) - path := pkg.Path - // if the source path is within a /vendor/ directory (for example, - // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow - // generation to output to the proper relative path (under vendor). - // Otherwise, the generator will create the file in the wrong location - // in the output directory. - // TODO: build a more fundamental concept in gengo for dealing with modifications - // to vendored packages. - if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { - expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) - if strings.Contains(expandedPath, "/vendor/") { - path = expandedPath - } - } - packages = append(packages, - &generator.DefaultPackage{ - PackageName: strings.Split(filepath.Base(pkg.Path), ".")[0], - PackagePath: path, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - NewGenDeepCopy(arguments.OutputFileBaseName, pkg.Path, boundingDirs, (ptagValue == tagValuePackage), ptagRegister), - } - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return t.Name.Package == pkg.Path - }, - }) - } - } - return packages -} - -// genDeepCopy produces a file with autogenerated deep-copy functions. -type genDeepCopy struct { - generator.DefaultGen - targetPackage string - boundingDirs []string - allTypes bool - registerTypes bool - imports namer.ImportTracker - typesForInit []*types.Type -} - -func NewGenDeepCopy(sanitizedName, targetPackage string, boundingDirs []string, allTypes, registerTypes bool) generator.Generator { - return &genDeepCopy{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, - }, - targetPackage: targetPackage, - boundingDirs: boundingDirs, - allTypes: allTypes, - registerTypes: registerTypes, - imports: generator.NewImportTracker(), - typesForInit: make([]*types.Type, 0), - } -} - -func (g *genDeepCopy) Namers(c *generator.Context) namer.NameSystems { - // Have the raw namer for this file track what it imports. - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.targetPackage, g.imports), - } -} - -func (g *genDeepCopy) Filter(c *generator.Context, t *types.Type) bool { - // Filter out types not being processed or not copyable within the package. - enabled := g.allTypes - if !enabled { - ttag := extractEnabledTypeTag(t) - if ttag != nil && ttag.value == "true" { - enabled = true - } - } - if !enabled { - return false - } - if !copyableType(t) { - klog.V(2).Infof("Type %v is not copyable", t) - return false - } - klog.V(4).Infof("Type %v is copyable", t) - g.typesForInit = append(g.typesForInit, t) - return true -} - -func (g *genDeepCopy) copyableAndInBounds(t *types.Type) bool { - if !copyableType(t) { - return false - } - // Only packages within the restricted range can be processed. - if !isRootedUnder(t.Name.Package, g.boundingDirs) { - return false - } - return true -} - -// deepCopyMethod returns the signature of a DeepCopy() method, nil or an error -// if the type does not match. This allows more efficient deep copy -// implementations to be defined by the type's author. The correct signature -// for a type T is: -// func (t T) DeepCopy() T -// or: -// func (t *T) DeepCopy() *T -func deepCopyMethod(t *types.Type) (*types.Signature, error) { - f, found := t.Methods["DeepCopy"] - if !found { - return nil, nil - } - if len(f.Signature.Parameters) != 0 { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected no parameters", t) - } - if len(f.Signature.Results) != 1 { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected exactly one result", t) - } - - ptrResult := f.Signature.Results[0].Kind == types.Pointer && f.Signature.Results[0].Elem.Name == t.Name - nonPtrResult := f.Signature.Results[0].Name == t.Name - - if !ptrResult && !nonPtrResult { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected to return %s or *%s", t, t.Name.Name, t.Name.Name) - } - - ptrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Kind == types.Pointer && f.Signature.Receiver.Elem.Name == t.Name - nonPtrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Name == t.Name - - if ptrRcvr && !ptrResult { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a *%s result for a *%s receiver", t, t.Name.Name, t.Name.Name) - } - if nonPtrRcvr && !nonPtrResult { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a %s result for a %s receiver", t, t.Name.Name, t.Name.Name) - } - - return f.Signature, nil -} - -// deepCopyMethodOrDie returns the signatrue of a DeepCopy method, nil or calls klog.Fatalf -// if the type does not match. -func deepCopyMethodOrDie(t *types.Type) *types.Signature { - ret, err := deepCopyMethod(t) - if err != nil { - klog.Fatal(err) - } - return ret -} - -// deepCopyIntoMethod returns the signature of a DeepCopyInto() method, nil or an error -// if the type is wrong. DeepCopyInto allows more efficient deep copy -// implementations to be defined by the type's author. The correct signature -// for a type T is: -// func (t T) DeepCopyInto(t *T) -// or: -// func (t *T) DeepCopyInto(t *T) -func deepCopyIntoMethod(t *types.Type) (*types.Signature, error) { - f, found := t.Methods["DeepCopyInto"] - if !found { - return nil, nil - } - if len(f.Signature.Parameters) != 1 { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected exactly one parameter", t) - } - if len(f.Signature.Results) != 0 { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected no result type", t) - } - - ptrParam := f.Signature.Parameters[0].Kind == types.Pointer && f.Signature.Parameters[0].Elem.Name == t.Name - - if !ptrParam { - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected parameter of type *%s", t, t.Name.Name) - } - - ptrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Kind == types.Pointer && f.Signature.Receiver.Elem.Name == t.Name - nonPtrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Name == t.Name - - if !ptrRcvr && !nonPtrRcvr { - // this should never happen - return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected a receiver of type %s or *%s", t, t.Name.Name, t.Name.Name) - } - - return f.Signature, nil -} - -// deepCopyIntoMethodOrDie returns the signature of a DeepCopyInto() method, nil or calls klog.Fatalf -// if the type is wrong. -func deepCopyIntoMethodOrDie(t *types.Type) *types.Signature { - ret, err := deepCopyIntoMethod(t) - if err != nil { - klog.Fatal(err) - } - return ret -} - -func isRootedUnder(pkg string, roots []string) bool { - // Add trailing / to avoid false matches, e.g. foo/bar vs foo/barn. This - // assumes that bounding dirs do not have trailing slashes. - pkg = pkg + "/" - for _, root := range roots { - if strings.HasPrefix(pkg, root+"/") { - return true - } - } - return false -} - -func copyableType(t *types.Type) bool { - // If the type opts out of copy-generation, stop. - ttag := extractEnabledTypeTag(t) - if ttag != nil && ttag.value == "false" { - return false - } - - // Filter out private types. - if namer.IsPrivateGoName(t.Name.Name) { - return false - } - - if t.Kind == types.Alias { - // if the underlying built-in is not deepcopy-able, deepcopy is opt-in through definition of custom methods. - // Note that aliases of builtins, maps, slices can have deepcopy methods. - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - return true - } else { - return t.Underlying.Kind != types.Builtin || copyableType(t.Underlying) - } - } - - if t.Kind != types.Struct { - return false - } - - return true -} - -func underlyingType(t *types.Type) *types.Type { - for t.Kind == types.Alias { - t = t.Underlying - } - return t -} - -func (g *genDeepCopy) isOtherPackage(pkg string) bool { - if pkg == g.targetPackage { - return false - } - if strings.HasSuffix(pkg, "\""+g.targetPackage+"\"") { - return false - } - return true -} - -func (g *genDeepCopy) Imports(c *generator.Context) (imports []string) { - importLines := []string{} - for _, singleImport := range g.imports.ImportLines() { - if g.isOtherPackage(singleImport) { - importLines = append(importLines, singleImport) - } - } - return importLines -} - -func argsFromType(ts ...*types.Type) generator.Args { - a := generator.Args{ - "type": ts[0], - } - for i, t := range ts { - a[fmt.Sprintf("type%d", i+1)] = t - } - return a -} - -func (g *genDeepCopy) Init(c *generator.Context, w io.Writer) error { - return nil -} - -func (g *genDeepCopy) needsGeneration(t *types.Type) bool { - tag := extractEnabledTypeTag(t) - tv := "" - if tag != nil { - tv = tag.value - if tv != "true" && tv != "false" { - klog.Fatalf("Type %v: unsupported %s value: %q", t, tagEnabledName, tag.value) - } - } - if g.allTypes && tv == "false" { - // The whole package is being generated, but this type has opted out. - klog.V(5).Infof("Not generating for type %v because type opted out", t) - return false - } - if !g.allTypes && tv != "true" { - // The whole package is NOT being generated, and this type has NOT opted in. - klog.V(5).Infof("Not generating for type %v because type did not opt in", t) - return false - } - return true -} - -func extractInterfacesTag(t *types.Type) []string { - var result []string - comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) - values := types.ExtractCommentTags("+", comments)[interfacesTagName] - for _, v := range values { - if len(v) == 0 { - continue - } - intfs := strings.Split(v, ",") - for _, intf := range intfs { - if intf == "" { - continue - } - result = append(result, intf) - } - } - return result -} - -func extractNonPointerInterfaces(t *types.Type) (bool, error) { - comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) - values := types.ExtractCommentTags("+", comments)[interfacesNonPointerTagName] - if len(values) == 0 { - return false, nil - } - result := values[0] == "true" - for _, v := range values { - if v == "true" != result { - return false, fmt.Errorf("contradicting %v value %q found to previous value %v", interfacesNonPointerTagName, v, result) - } - } - return result, nil -} - -func (g *genDeepCopy) deepCopyableInterfacesInner(c *generator.Context, t *types.Type) ([]*types.Type, error) { - if t.Kind != types.Struct { - return nil, nil - } - - intfs := extractInterfacesTag(t) - - var ts []*types.Type - for _, intf := range intfs { - t := types.ParseFullyQualifiedName(intf) - err := c.AddDir(t.Package) - if err != nil { - return nil, err - } - intfT := c.Universe.Type(t) - if intfT == nil { - return nil, fmt.Errorf("unknown type %q in %s tag of type %s", intf, interfacesTagName, intfT) - } - if intfT.Kind != types.Interface { - return nil, fmt.Errorf("type %q in %s tag of type %s is not an interface, but: %q", intf, interfacesTagName, t, intfT.Kind) - } - g.imports.AddType(intfT) - ts = append(ts, intfT) - } - - return ts, nil -} - -// deepCopyableInterfaces returns the interface types to implement and whether they apply to a non-pointer receiver. -func (g *genDeepCopy) deepCopyableInterfaces(c *generator.Context, t *types.Type) ([]*types.Type, bool, error) { - ts, err := g.deepCopyableInterfacesInner(c, t) - if err != nil { - return nil, false, err - } - - set := map[string]*types.Type{} - for _, t := range ts { - set[t.String()] = t - } - - result := []*types.Type{} - for _, t := range set { - result = append(result, t) - } - - TypeSlice(result).Sort() // we need a stable sorting because it determines the order in generation - - nonPointerReceiver, err := extractNonPointerInterfaces(t) - if err != nil { - return nil, false, err - } - - return result, nonPointerReceiver, nil -} - -type TypeSlice []*types.Type - -func (s TypeSlice) Len() int { return len(s) } -func (s TypeSlice) Less(i, j int) bool { return s[i].String() < s[j].String() } -func (s TypeSlice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s TypeSlice) Sort() { sort.Sort(s) } - -func (g *genDeepCopy) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - if !g.needsGeneration(t) { - return nil - } - klog.V(5).Infof("Generating deepcopy function for type %v", t) - - sw := generator.NewSnippetWriter(w, c, "$", "$") - args := argsFromType(t) - - if deepCopyIntoMethodOrDie(t) == nil { - sw.Do("// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.\n", args) - if isReference(t) { - sw.Do("func (in $.type|raw$) DeepCopyInto(out *$.type|raw$) {\n", args) - sw.Do("{in:=&in\n", nil) - } else { - sw.Do("func (in *$.type|raw$) DeepCopyInto(out *$.type|raw$) {\n", args) - } - if deepCopyMethodOrDie(t) != nil { - if t.Methods["DeepCopy"].Signature.Receiver.Kind == types.Pointer { - sw.Do("clone := in.DeepCopy()\n", nil) - sw.Do("*out = *clone\n", nil) - } else { - sw.Do("*out = in.DeepCopy()\n", nil) - } - sw.Do("return\n", nil) - } else { - g.generateFor(t, sw) - sw.Do("return\n", nil) - } - if isReference(t) { - sw.Do("}\n", nil) - } - sw.Do("}\n\n", nil) - } - - if deepCopyMethodOrDie(t) == nil { - sw.Do("// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new $.type|raw$.\n", args) - if isReference(t) { - sw.Do("func (in $.type|raw$) DeepCopy() $.type|raw$ {\n", args) - } else { - sw.Do("func (in *$.type|raw$) DeepCopy() *$.type|raw$ {\n", args) - } - sw.Do("if in == nil { return nil }\n", nil) - sw.Do("out := new($.type|raw$)\n", args) - sw.Do("in.DeepCopyInto(out)\n", nil) - if isReference(t) { - sw.Do("return *out\n", nil) - } else { - sw.Do("return out\n", nil) - } - sw.Do("}\n\n", nil) - } - - intfs, nonPointerReceiver, err := g.deepCopyableInterfaces(c, t) - if err != nil { - return err - } - for _, intf := range intfs { - sw.Do(fmt.Sprintf("// DeepCopy%s is an autogenerated deepcopy function, copying the receiver, creating a new $.type2|raw$.\n", intf.Name.Name), argsFromType(t, intf)) - if nonPointerReceiver { - sw.Do(fmt.Sprintf("func (in $.type|raw$) DeepCopy%s() $.type2|raw$ {\n", intf.Name.Name), argsFromType(t, intf)) - sw.Do("return *in.DeepCopy()", nil) - sw.Do("}\n\n", nil) - } else { - sw.Do(fmt.Sprintf("func (in *$.type|raw$) DeepCopy%s() $.type2|raw$ {\n", intf.Name.Name), argsFromType(t, intf)) - sw.Do("if c := in.DeepCopy(); c != nil {\n", nil) - sw.Do("return c\n", nil) - sw.Do("}\n", nil) - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - } - } - - return sw.Error() -} - -// isReference return true for pointer, maps, slices and aliases of those. -func isReference(t *types.Type) bool { - if t.Kind == types.Pointer || t.Kind == types.Map || t.Kind == types.Slice { - return true - } - return t.Kind == types.Alias && isReference(underlyingType(t)) -} - -// we use the system of shadowing 'in' and 'out' so that the same code is valid -// at any nesting level. This makes the autogenerator easy to understand, and -// the compiler shouldn't care. -func (g *genDeepCopy) generateFor(t *types.Type, sw *generator.SnippetWriter) { - // derive inner types if t is an alias. We call the do* methods below with the alias type. - // basic rule: generate according to inner type, but construct objects with the alias type. - ut := underlyingType(t) - - var f func(*types.Type, *generator.SnippetWriter) - switch ut.Kind { - case types.Builtin: - f = g.doBuiltin - case types.Map: - f = g.doMap - case types.Slice: - f = g.doSlice - case types.Struct: - f = g.doStruct - case types.Pointer: - f = g.doPointer - case types.Interface: - // interfaces are handled in-line in the other cases - klog.Fatalf("Hit an interface type %v. This should never happen.", t) - case types.Alias: - // can never happen because we branch on the underlying type which is never an alias - klog.Fatalf("Hit an alias type %v. This should never happen.", t) - default: - klog.Fatalf("Hit an unsupported type %v.", t) - } - f(t, sw) -} - -// doBuiltin generates code for a builtin or an alias to a builtin. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doBuiltin(t *types.Type, sw *generator.SnippetWriter) { - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - sw.Do("*out = in.DeepCopy()\n", nil) - return - } - - sw.Do("*out = *in\n", nil) -} - -// doMap generates code for a map or an alias to a map. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doMap(t *types.Type, sw *generator.SnippetWriter) { - ut := underlyingType(t) - uet := underlyingType(ut.Elem) - - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - sw.Do("*out = in.DeepCopy()\n", nil) - return - } - - if !ut.Key.IsAssignable() { - klog.Fatalf("Hit an unsupported type %v for: %v", uet, t) - } - - sw.Do("*out = make($.|raw$, len(*in))\n", t) - sw.Do("for key, val := range *in {\n", nil) - dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem) - switch { - case dc != nil || dci != nil: - // Note: a DeepCopy exists because it is added if DeepCopyInto is manually defined - leftPointer := ut.Elem.Kind == types.Pointer - rightPointer := !isReference(ut.Elem) - if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer - } - if leftPointer == rightPointer { - sw.Do("(*out)[key] = val.DeepCopy()\n", nil) - } else if leftPointer { - sw.Do("x := val.DeepCopy()\n", nil) - sw.Do("(*out)[key] = &x\n", nil) - } else { - sw.Do("(*out)[key] = *val.DeepCopy()\n", nil) - } - case ut.Elem.IsAnonymousStruct(): // not uet here because it needs type cast - sw.Do("(*out)[key] = val\n", nil) - case uet.IsAssignable(): - sw.Do("(*out)[key] = val\n", nil) - case uet.Kind == types.Interface: - // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function - if uet.Name.Name == "interface{}" { - klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uet.Name.Name) - } - sw.Do("if val == nil {(*out)[key]=nil} else {\n", nil) - // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it - // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang - // parser does not give us the underlying interface name. So we cannot do any better. - sw.Do(fmt.Sprintf("(*out)[key] = val.DeepCopy%s()\n", uet.Name.Name), nil) - sw.Do("}\n", nil) - case uet.Kind == types.Slice || uet.Kind == types.Map || uet.Kind == types.Pointer: - sw.Do("var outVal $.|raw$\n", uet) - sw.Do("if val == nil { (*out)[key] = nil } else {\n", nil) - sw.Do("in, out := &val, &outVal\n", uet) - g.generateFor(ut.Elem, sw) - sw.Do("}\n", nil) - sw.Do("(*out)[key] = outVal\n", nil) - case uet.Kind == types.Struct: - sw.Do("(*out)[key] = *val.DeepCopy()\n", uet) - default: - klog.Fatalf("Hit an unsupported type %v for %v", uet, t) - } - sw.Do("}\n", nil) -} - -// doSlice generates code for a slice or an alias to a slice. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doSlice(t *types.Type, sw *generator.SnippetWriter) { - ut := underlyingType(t) - uet := underlyingType(ut.Elem) - - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - sw.Do("*out = in.DeepCopy()\n", nil) - return - } - - sw.Do("*out = make($.|raw$, len(*in))\n", t) - if deepCopyMethodOrDie(ut.Elem) != nil || deepCopyIntoMethodOrDie(ut.Elem) != nil { - sw.Do("for i := range *in {\n", nil) - // Note: a DeepCopyInto exists because it is added if DeepCopy is manually defined - sw.Do("(*in)[i].DeepCopyInto(&(*out)[i])\n", nil) - sw.Do("}\n", nil) - } else if uet.Kind == types.Builtin || uet.IsAssignable() { - sw.Do("copy(*out, *in)\n", nil) - } else { - sw.Do("for i := range *in {\n", nil) - if uet.Kind == types.Slice || uet.Kind == types.Map || uet.Kind == types.Pointer || deepCopyMethodOrDie(ut.Elem) != nil || deepCopyIntoMethodOrDie(ut.Elem) != nil { - sw.Do("if (*in)[i] != nil {\n", nil) - sw.Do("in, out := &(*in)[i], &(*out)[i]\n", nil) - g.generateFor(ut.Elem, sw) - sw.Do("}\n", nil) - } else if uet.Kind == types.Interface { - // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function - if uet.Name.Name == "interface{}" { - klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uet.Name.Name) - } - sw.Do("if (*in)[i] != nil {\n", nil) - // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it - // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang - // parser does not give us the underlying interface name. So we cannot do any better. - sw.Do(fmt.Sprintf("(*out)[i] = (*in)[i].DeepCopy%s()\n", uet.Name.Name), nil) - sw.Do("}\n", nil) - } else if uet.Kind == types.Struct { - sw.Do("(*in)[i].DeepCopyInto(&(*out)[i])\n", nil) - } else { - klog.Fatalf("Hit an unsupported type %v for %v", uet, t) - } - sw.Do("}\n", nil) - } -} - -// doStruct generates code for a struct or an alias to a struct. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doStruct(t *types.Type, sw *generator.SnippetWriter) { - ut := underlyingType(t) - - if deepCopyMethodOrDie(t) != nil || deepCopyIntoMethodOrDie(t) != nil { - sw.Do("*out = in.DeepCopy()\n", nil) - return - } - - // Simple copy covers a lot of cases. - sw.Do("*out = *in\n", nil) - - // Now fix-up fields as needed. - for _, m := range ut.Members { - ft := m.Type - uft := underlyingType(ft) - - args := generator.Args{ - "type": ft, - "kind": ft.Kind, - "name": m.Name, - } - dc, dci := deepCopyMethodOrDie(ft), deepCopyIntoMethodOrDie(ft) - switch { - case dc != nil || dci != nil: - // Note: a DeepCopyInto exists because it is added if DeepCopy is manually defined - leftPointer := ft.Kind == types.Pointer - rightPointer := !isReference(ft) - if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer - } - if leftPointer == rightPointer { - sw.Do("out.$.name$ = in.$.name$.DeepCopy()\n", args) - } else if leftPointer { - sw.Do("x := in.$.name$.DeepCopy()\n", args) - sw.Do("out.$.name$ = = &x\n", args) - } else { - sw.Do("in.$.name$.DeepCopyInto(&out.$.name$)\n", args) - } - case uft.Kind == types.Builtin: - // the initial *out = *in was enough - case uft.Kind == types.Map, uft.Kind == types.Slice, uft.Kind == types.Pointer: - // Fixup non-nil reference-semantic types. - sw.Do("if in.$.name$ != nil {\n", args) - sw.Do("in, out := &in.$.name$, &out.$.name$\n", args) - g.generateFor(ft, sw) - sw.Do("}\n", nil) - case uft.Kind == types.Array: - sw.Do("out.$.name$ = in.$.name$\n", args) - case uft.Kind == types.Struct: - if ft.IsAssignable() { - sw.Do("out.$.name$ = in.$.name$\n", args) - } else { - sw.Do("in.$.name$.DeepCopyInto(&out.$.name$)\n", args) - } - case uft.Kind == types.Interface: - // Note: do not generate code that won't compile as `DeepCopyinterface{}()` is not a valid function - if uft.Name.Name == "interface{}" { - klog.Fatalf("DeepCopy of %q is unsupported. Instead, use named interfaces with DeepCopy as one of the methods.", uft.Name.Name) - } - sw.Do("if in.$.name$ != nil {\n", args) - // Note: if t.Elem has been an alias "J" of an interface "I" in Go, we will see it - // as kind Interface of name "J" here, i.e. generate val.DeepCopyJ(). The golang - // parser does not give us the underlying interface name. So we cannot do any better. - sw.Do(fmt.Sprintf("out.$.name$ = in.$.name$.DeepCopy%s()\n", uft.Name.Name), args) - sw.Do("}\n", nil) - default: - klog.Fatalf("Hit an unsupported type %v for %v, from %v", uft, ft, t) - } - } -} - -// doPointer generates code for a pointer or an alias to a pointer. The generated code is -// is the same for both cases, i.e. it's the code for the underlying type. -func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) { - ut := underlyingType(t) - uet := underlyingType(ut.Elem) - - dc, dci := deepCopyMethodOrDie(ut.Elem), deepCopyIntoMethodOrDie(ut.Elem) - switch { - case dc != nil || dci != nil: - rightPointer := !isReference(ut.Elem) - if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer - } - if rightPointer { - sw.Do("*out = (*in).DeepCopy()\n", nil) - } else { - sw.Do("x := (*in).DeepCopy()\n", nil) - sw.Do("*out = &x\n", nil) - } - case uet.IsAssignable(): - sw.Do("*out = new($.Elem|raw$)\n", ut) - sw.Do("**out = **in", nil) - case uet.Kind == types.Map, uet.Kind == types.Slice, uet.Kind == types.Pointer: - sw.Do("*out = new($.Elem|raw$)\n", ut) - sw.Do("if **in != nil {\n", nil) - sw.Do("in, out := *in, *out\n", nil) - g.generateFor(uet, sw) - sw.Do("}\n", nil) - case uet.Kind == types.Struct: - sw.Do("*out = new($.Elem|raw$)\n", ut) - sw.Do("(*in).DeepCopyInto(*out)\n", nil) - default: - klog.Fatalf("Hit an unsupported type %v for %v", uet, t) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go deleted file mode 100644 index e9ed41de36d3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/defaulter-gen/generators/defaulter.go +++ /dev/null @@ -1,1260 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" -) - -// CustomArgs is used tby the go2idl framework to pass args specific to this -// generator. -type CustomArgs struct { - ExtraPeerDirs []string // Always consider these as last-ditch possibilities for conversions. -} - -var typeZeroValue = map[string]interface{}{ - "uint": 0., - "uint8": 0., - "uint16": 0., - "uint32": 0., - "uint64": 0., - "int": 0., - "int8": 0., - "int16": 0., - "int32": 0., - "int64": 0., - "byte": 0., - "float64": 0., - "float32": 0., - "bool": false, - "time.Time": "", - "string": "", - "integer": 0., - "number": 0., - "boolean": false, - "[]byte": "", // base64 encoded characters - "interface{}": interface{}(nil), -} - -// These are the comment tags that carry parameters for defaulter generation. -const tagName = "k8s:defaulter-gen" -const inputTagName = "k8s:defaulter-gen-input" -const defaultTagName = "default" - -func extractDefaultTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[defaultTagName] -} - -func extractTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[tagName] -} - -func extractInputTag(comments []string) []string { - return types.ExtractCommentTags("+", comments)[inputTagName] -} - -func checkTag(comments []string, require ...string) bool { - values := types.ExtractCommentTags("+", comments)[tagName] - if len(require) == 0 { - return len(values) == 1 && values[0] == "" - } - return reflect.DeepEqual(values, require) -} - -func defaultFnNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Prefix: "SetDefaults_", - Join: func(pre string, in []string, post string) string { - return pre + strings.Join(in, "_") + post - }, - } -} - -func objectDefaultFnNamer() *namer.NameStrategy { - return &namer.NameStrategy{ - Prefix: "SetObjectDefaults_", - Join: func(pre string, in []string, post string) string { - return pre + strings.Join(in, "_") + post - }, - } -} - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": namer.NewPublicNamer(1), - "raw": namer.NewRawNamer("", nil), - "defaultfn": defaultFnNamer(), - "objectdefaultfn": objectDefaultFnNamer(), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// defaults holds the declared defaulting functions for a given type (all defaulting functions -// are expected to be func(1)) -type defaults struct { - // object is the defaulter function for a top level type (typically one with TypeMeta) that - // invokes all child defaulters. May be nil if the object defaulter has not yet been generated. - object *types.Type - // base is a defaulter function defined for a type SetDefaults_Pod which does not invoke all - // child defaults - the base defaulter alone is insufficient to default a type - base *types.Type - // additional is zero or more defaulter functions of the form SetDefaults_Pod_XXXX that can be - // included in the Object defaulter. - additional []*types.Type -} - -// All of the types in conversions map are of type "DeclarationOf" with -// the underlying type being "Func". -type defaulterFuncMap map[*types.Type]defaults - -// Returns all manually-defined defaulting functions in the package. -func getManualDefaultingFunctions(context *generator.Context, pkg *types.Package, manualMap defaulterFuncMap) { - buffer := &bytes.Buffer{} - sw := generator.NewSnippetWriter(buffer, context, "$", "$") - - for _, f := range pkg.Functions { - if f.Underlying == nil || f.Underlying.Kind != types.Func { - klog.Errorf("Malformed function: %#v", f) - continue - } - if f.Underlying.Signature == nil { - klog.Errorf("Function without signature: %#v", f) - continue - } - signature := f.Underlying.Signature - // Check whether the function is defaulting function. - // Note that all of them have signature: - // object: func SetObjectDefaults_inType(*inType) - // base: func SetDefaults_inType(*inType) - // additional: func SetDefaults_inType_Qualifier(*inType) - if signature.Receiver != nil { - continue - } - if len(signature.Parameters) != 1 { - continue - } - if len(signature.Results) != 0 { - continue - } - inType := signature.Parameters[0] - if inType.Kind != types.Pointer { - continue - } - // Check if this is the primary defaulter. - args := defaultingArgsFromType(inType.Elem) - sw.Do("$.inType|defaultfn$", args) - switch { - case f.Name.Name == buffer.String(): - key := inType.Elem - // We might scan the same package twice, and that's OK. - v, ok := manualMap[key] - if ok && v.base != nil && v.base.Name.Package != pkg.Path { - panic(fmt.Sprintf("duplicate static defaulter defined: %#v", key)) - } - v.base = f - manualMap[key] = v - klog.V(6).Infof("found base defaulter function for %s from %s", key.Name, f.Name) - // Is one of the additional defaulters - a top level defaulter on a type that is - // also invoked. - case strings.HasPrefix(f.Name.Name, buffer.String()+"_"): - key := inType.Elem - v, ok := manualMap[key] - if ok { - exists := false - for _, existing := range v.additional { - if existing.Name == f.Name { - exists = true - break - } - } - if exists { - continue - } - } - v.additional = append(v.additional, f) - manualMap[key] = v - klog.V(6).Infof("found additional defaulter function for %s from %s", key.Name, f.Name) - } - buffer.Reset() - sw.Do("$.inType|objectdefaultfn$", args) - if f.Name.Name == buffer.String() { - key := inType.Elem - // We might scan the same package twice, and that's OK. - v, ok := manualMap[key] - if ok && v.base != nil && v.base.Name.Package != pkg.Path { - panic(fmt.Sprintf("duplicate static defaulter defined: %#v", key)) - } - v.object = f - manualMap[key] = v - klog.V(6).Infof("found object defaulter function for %s from %s", key.Name, f.Name) - } - buffer.Reset() - } -} - -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - packages := generator.Packages{} - header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - - // Accumulate pre-existing default functions. - // TODO: This is too ad-hoc. We need a better way. - existingDefaulters := defaulterFuncMap{} - - buffer := &bytes.Buffer{} - sw := generator.NewSnippetWriter(buffer, context, "$", "$") - - // We are generating defaults only for packages that are explicitly - // passed as InputDir. - for _, i := range context.Inputs { - klog.V(5).Infof("considering pkg %q", i) - pkg := context.Universe[i] - if pkg == nil { - // If the input had no Go files, for example. - continue - } - // typesPkg is where the types that needs defaulter are defined. - // Sometimes it is different from pkg. For example, kubernetes core/v1 - // types are defined in vendor/k8s.io/api/core/v1, while pkg is at - // pkg/api/v1. - typesPkg := pkg - - // Add defaulting functions. - getManualDefaultingFunctions(context, pkg, existingDefaulters) - - var peerPkgs []string - if customArgs, ok := arguments.CustomArgs.(*CustomArgs); ok { - for _, pkg := range customArgs.ExtraPeerDirs { - if i := strings.Index(pkg, "/vendor/"); i != -1 { - pkg = pkg[i+len("/vendor/"):] - } - peerPkgs = append(peerPkgs, pkg) - } - } - // Make sure our peer-packages are added and fully parsed. - for _, pp := range peerPkgs { - context.AddDir(pp) - getManualDefaultingFunctions(context, context.Universe[pp], existingDefaulters) - } - - typesWith := extractTag(pkg.Comments) - shouldCreateObjectDefaulterFn := func(t *types.Type) bool { - if defaults, ok := existingDefaulters[t]; ok && defaults.object != nil { - // A default generator is defined - baseTypeName := "" - if defaults.base != nil { - baseTypeName = defaults.base.Name.String() - } - klog.V(5).Infof(" an object defaulter already exists as %s", baseTypeName) - return false - } - // opt-out - if checkTag(t.SecondClosestCommentLines, "false") { - return false - } - // opt-in - if checkTag(t.SecondClosestCommentLines, "true") { - return true - } - // For every k8s:defaulter-gen tag at the package level, interpret the value as a - // field name (like TypeMeta, ListMeta, ObjectMeta) and trigger defaulter generation - // for any type with any of the matching field names. Provides a more useful package - // level defaulting than global (because we only need defaulters on a subset of objects - - // usually those with TypeMeta). - if t.Kind == types.Struct && len(typesWith) > 0 { - for _, field := range t.Members { - for _, s := range typesWith { - if field.Name == s { - return true - } - } - } - } - return false - } - - // if the types are not in the same package where the defaulter functions to be generated - inputTags := extractInputTag(pkg.Comments) - if len(inputTags) > 1 { - panic(fmt.Sprintf("there could only be one input tag, got %#v", inputTags)) - } - if len(inputTags) == 1 { - var err error - - inputPath := inputTags[0] - if strings.HasPrefix(inputPath, "./") || strings.HasPrefix(inputPath, "../") { - // this is a relative dir, which will not work under gomodules. - // join with the local package path, but warn - klog.Warningf("relative path %s=%s will not work under gomodule mode; use full package path (as used by 'import') instead", inputTagName, inputPath) - inputPath = filepath.Join(pkg.Path, inputTags[0]) - } - - typesPkg, err = context.AddDirectory(inputPath) - if err != nil { - klog.Fatalf("cannot import package %s", inputPath) - } - // update context.Order to the latest context.Universe - orderer := namer.Orderer{Namer: namer.NewPublicNamer(1)} - context.Order = orderer.OrderUniverse(context.Universe) - } - - newDefaulters := defaulterFuncMap{} - for _, t := range typesPkg.Types { - if !shouldCreateObjectDefaulterFn(t) { - continue - } - if namer.IsPrivateGoName(t.Name.Name) { - // We won't be able to convert to a private type. - klog.V(5).Infof(" found a type %v, but it is a private name", t) - continue - } - - // create a synthetic type we can use during generation - newDefaulters[t] = defaults{} - } - - // only generate defaulters for objects that actually have defined defaulters - // prevents empty defaulters from being registered - for { - promoted := 0 - for t, d := range newDefaulters { - if d.object != nil { - continue - } - if newCallTreeForType(existingDefaulters, newDefaulters).build(t, true) != nil { - args := defaultingArgsFromType(t) - sw.Do("$.inType|objectdefaultfn$", args) - newDefaulters[t] = defaults{ - object: &types.Type{ - Name: types.Name{ - Package: pkg.Path, - Name: buffer.String(), - }, - Kind: types.Func, - }, - } - buffer.Reset() - promoted++ - } - } - if promoted != 0 { - continue - } - - // prune any types that were not used - for t, d := range newDefaulters { - if d.object == nil { - klog.V(6).Infof("did not generate defaulter for %s because no child defaulters were registered", t.Name) - delete(newDefaulters, t) - } - } - break - } - - if len(newDefaulters) == 0 { - klog.V(5).Infof("no defaulters in package %s", pkg.Name) - } - - path := pkg.Path - // if the source path is within a /vendor/ directory (for example, - // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow - // generation to output to the proper relative path (under vendor). - // Otherwise, the generator will create the file in the wrong location - // in the output directory. - // TODO: build a more fundamental concept in gengo for dealing with modifications - // to vendored packages. - if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { - expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) - if strings.Contains(expandedPath, "/vendor/") { - path = expandedPath - } - } - - packages = append(packages, - &generator.DefaultPackage{ - PackageName: filepath.Base(pkg.Path), - PackagePath: path, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - NewGenDefaulter(arguments.OutputFileBaseName, typesPkg.Path, pkg.Path, existingDefaulters, newDefaulters, peerPkgs), - } - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return t.Name.Package == typesPkg.Path - }, - }) - } - return packages -} - -// callTreeForType contains fields necessary to build a tree for types. -type callTreeForType struct { - existingDefaulters defaulterFuncMap - newDefaulters defaulterFuncMap - currentlyBuildingTypes map[*types.Type]bool -} - -func newCallTreeForType(existingDefaulters, newDefaulters defaulterFuncMap) *callTreeForType { - return &callTreeForType{ - existingDefaulters: existingDefaulters, - newDefaulters: newDefaulters, - currentlyBuildingTypes: make(map[*types.Type]bool), - } -} - -// resolveType follows pointers and aliases of `t` until reaching the first -// non-pointer type in `t's` herarchy -func resolveTypeAndDepth(t *types.Type) (*types.Type, int) { - var prev *types.Type - depth := 0 - for prev != t { - prev = t - if t.Kind == types.Alias { - t = t.Underlying - } else if t.Kind == types.Pointer { - t = t.Elem - depth += 1 - } - } - return t, depth -} - -// getPointerElementPath follows pointers and aliases to returns all -// pointer elements in the path from the given type, to its base value type. -// -// Example: -// -// type MyString string -// type MyStringPointer *MyString -// type MyStringPointerPointer *MyStringPointer -// type MyStringAlias MyStringPointer -// type MyStringAliasPointer *MyStringAlias -// type MyStringAliasDoublePointer **MyStringAlias -// -// t | defaultPointerElementPath(t) -// ---------------------------|---------------------------------------- -// MyString | [] -// MyStringPointer | [MyString] -// MyStringPointerPointer | [MyStringPointer, MyString] -// MyStringAlias | [MyStringPointer, MyString] -// MyStringAliasPointer | [MyStringAlias, MyStringPointer, MyString] -// MyStringAliasDoublePointer | [*MyStringAlias, MyStringAlias, MyStringPointer, MyString] -func getPointerElementPath(t *types.Type) []*types.Type { - var path []*types.Type - for t != nil { - switch t.Kind { - case types.Alias: - t = t.Underlying - case types.Pointer: - t = t.Elem - path = append(path, t) - default: - t = nil - } - } - return path -} - -// getNestedDefault returns the first default value when resolving alias types -func getNestedDefault(t *types.Type) string { - var prev *types.Type - for prev != t { - prev = t - defaultMap := extractDefaultTag(t.CommentLines) - if len(defaultMap) == 1 && defaultMap[0] != "" { - return defaultMap[0] - } - if t.Kind == types.Alias { - t = t.Underlying - } else if t.Kind == types.Pointer { - t = t.Elem - } - } - return "" -} - -func mustEnforceDefault(t *types.Type, depth int, omitEmpty bool) (interface{}, error) { - if depth > 0 { - return nil, nil - } - switch t.Kind { - case types.Pointer, types.Map, types.Slice, types.Array, types.Interface: - return nil, nil - case types.Struct: - return map[string]interface{}{}, nil - case types.Builtin: - if !omitEmpty { - if zero, ok := typeZeroValue[t.String()]; ok { - return zero, nil - } else { - return nil, fmt.Errorf("please add type %v to typeZeroValue struct", t) - } - } - return nil, nil - default: - return nil, fmt.Errorf("not sure how to enforce default for %v", t.Kind) - } -} - -var refRE = regexp.MustCompile(`^ref\((?P[^"]+)\)$`) -var refREIdentIndex = refRE.SubexpIndex("reference") - -// ParseSymbolReference looks for strings that match one of the following: -// - ref(Ident) -// - ref(pkgpath.Ident) -// If the input string matches either of these, it will return the (optional) -// pkgpath, the Ident, and true. Otherwise it will return empty strings and -// false. -func ParseSymbolReference(s, sourcePackage string) (types.Name, bool) { - matches := refRE.FindStringSubmatch(s) - if len(matches) < refREIdentIndex || matches[refREIdentIndex] == "" { - return types.Name{}, false - } - - contents := matches[refREIdentIndex] - name := types.ParseFullyQualifiedName(contents) - if len(name.Package) == 0 { - name.Package = sourcePackage - } - return name, true -} - -func populateDefaultValue(node *callNode, t *types.Type, tags string, commentLines []string, commentPackage string) *callNode { - defaultMap := extractDefaultTag(commentLines) - var defaultString string - if len(defaultMap) == 1 { - defaultString = defaultMap[0] - } else if len(defaultMap) > 1 { - klog.Fatalf("Found more than one default tag for %v", t.Kind) - } - - baseT, depth := resolveTypeAndDepth(t) - if depth > 0 && defaultString == "" { - defaultString = getNestedDefault(t) - } - - if len(defaultString) == 0 { - return node - } - var symbolReference types.Name - var defaultValue interface{} - if id, ok := ParseSymbolReference(defaultString, commentPackage); ok { - symbolReference = id - defaultString = "" - } else if err := json.Unmarshal([]byte(defaultString), &defaultValue); err != nil { - klog.Fatalf("Failed to unmarshal default: %v", err) - } - - omitEmpty := strings.Contains(reflect.StructTag(tags).Get("json"), "omitempty") - if enforced, err := mustEnforceDefault(baseT, depth, omitEmpty); err != nil { - klog.Fatal(err) - } else if enforced != nil { - if defaultValue != nil { - if reflect.DeepEqual(defaultValue, enforced) { - // If the default value annotation matches the default value for the type, - // do not generate any defaulting function - return node - } else { - enforcedJSON, _ := json.Marshal(enforced) - klog.Fatalf("Invalid default value (%#v) for non-pointer/non-omitempty. If specified, must be: %v", defaultValue, string(enforcedJSON)) - } - } - } - - // callNodes are not automatically generated for primitive types. Generate one if the callNode does not exist - if node == nil { - node = &callNode{} - node.markerOnly = true - } - - node.defaultIsPrimitive = baseT.IsPrimitive() - node.defaultType = baseT - node.defaultTopLevelType = t - node.defaultValue.InlineConstant = defaultString - node.defaultValue.SymbolReference = symbolReference - return node -} - -// build creates a tree of paths to fields (based on how they would be accessed in Go - pointer, elem, -// slice, or key) and the functions that should be invoked on each field. An in-order traversal of the resulting tree -// can be used to generate a Go function that invokes each nested function on the appropriate type. The return -// value may be nil if there are no functions to call on type or the type is a primitive (Defaulters can only be -// invoked on structs today). When root is true this function will not use a newDefaulter. existingDefaulters should -// contain all defaulting functions by type defined in code - newDefaulters should contain all object defaulters -// that could be or will be generated. If newDefaulters has an entry for a type, but the 'object' field is nil, -// this function skips adding that defaulter - this allows us to avoid generating object defaulter functions for -// list types that call empty defaulters. -func (c *callTreeForType) build(t *types.Type, root bool) *callNode { - parent := &callNode{} - - if root { - // the root node is always a pointer - parent.elem = true - } - - defaults, _ := c.existingDefaulters[t] - newDefaults, generated := c.newDefaulters[t] - switch { - case !root && generated && newDefaults.object != nil: - parent.call = append(parent.call, newDefaults.object) - // if we will be generating the defaulter, it by definition is a covering - // defaulter, so we halt recursion - klog.V(6).Infof("the defaulter %s will be generated as an object defaulter", t.Name) - return parent - - case defaults.object != nil: - // object defaulters are always covering - parent.call = append(parent.call, defaults.object) - return parent - - case defaults.base != nil: - parent.call = append(parent.call, defaults.base) - // if the base function indicates it "covers" (it already includes defaulters) - // we can halt recursion - if checkTag(defaults.base.CommentLines, "covers") { - klog.V(6).Infof("the defaulter %s indicates it covers all sub generators", t.Name) - return parent - } - } - - // base has been added already, now add any additional defaulters defined for this object - parent.call = append(parent.call, defaults.additional...) - - // if the type already exists, don't build the tree for it and don't generate anything. - // This is used to avoid recursion for nested recursive types. - if c.currentlyBuildingTypes[t] { - return nil - } - // if type doesn't exist, mark it as existing - c.currentlyBuildingTypes[t] = true - - defer func() { - // The type will now acts as a parent, not a nested recursive type. - // We can now build the tree for it safely. - c.currentlyBuildingTypes[t] = false - }() - - switch t.Kind { - case types.Pointer: - if child := c.build(t.Elem, false); child != nil { - child.elem = true - parent.children = append(parent.children, *child) - } - case types.Slice, types.Array: - if child := c.build(t.Elem, false); child != nil { - child.index = true - if t.Elem.Kind == types.Pointer { - child.elem = true - } - parent.children = append(parent.children, *child) - } else if member := populateDefaultValue(nil, t.Elem, "", t.Elem.CommentLines, t.Elem.Name.Package); member != nil { - member.index = true - parent.children = append(parent.children, *member) - } - case types.Map: - if child := c.build(t.Elem, false); child != nil { - child.key = true - parent.children = append(parent.children, *child) - } else if member := populateDefaultValue(nil, t.Elem, "", t.Elem.CommentLines, t.Elem.Name.Package); member != nil { - member.key = true - parent.children = append(parent.children, *member) - } - - case types.Struct: - for _, field := range t.Members { - name := field.Name - if len(name) == 0 { - if field.Type.Kind == types.Pointer { - name = field.Type.Elem.Name.Name - } else { - name = field.Type.Name.Name - } - } - if child := c.build(field.Type, false); child != nil { - child.field = name - populateDefaultValue(child, field.Type, field.Tags, field.CommentLines, field.Type.Name.Package) - parent.children = append(parent.children, *child) - } else if member := populateDefaultValue(nil, field.Type, field.Tags, field.CommentLines, t.Name.Package); member != nil { - member.field = name - parent.children = append(parent.children, *member) - } - } - case types.Alias: - if child := c.build(t.Underlying, false); child != nil { - parent.children = append(parent.children, *child) - } - } - if len(parent.children) == 0 && len(parent.call) == 0 { - //klog.V(6).Infof("decided type %s needs no generation", t.Name) - return nil - } - return parent -} - -const ( - runtimePackagePath = "k8s.io/apimachinery/pkg/runtime" - conversionPackagePath = "k8s.io/apimachinery/pkg/conversion" -) - -// genDefaulter produces a file with a autogenerated conversions. -type genDefaulter struct { - generator.DefaultGen - typesPackage string - outputPackage string - peerPackages []string - newDefaulters defaulterFuncMap - existingDefaulters defaulterFuncMap - imports namer.ImportTracker - typesForInit []*types.Type -} - -func NewGenDefaulter(sanitizedName, typesPackage, outputPackage string, existingDefaulters, newDefaulters defaulterFuncMap, peerPkgs []string) generator.Generator { - return &genDefaulter{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, - }, - typesPackage: typesPackage, - outputPackage: outputPackage, - peerPackages: peerPkgs, - newDefaulters: newDefaulters, - existingDefaulters: existingDefaulters, - imports: generator.NewImportTrackerForPackage(outputPackage), - typesForInit: make([]*types.Type, 0), - } -} - -func (g *genDefaulter) Namers(c *generator.Context) namer.NameSystems { - // Have the raw namer for this file track what it imports. - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genDefaulter) isOtherPackage(pkg string) bool { - if pkg == g.outputPackage { - return false - } - if strings.HasSuffix(pkg, `"`+g.outputPackage+`"`) { - return false - } - return true -} - -func (g *genDefaulter) Filter(c *generator.Context, t *types.Type) bool { - defaults, ok := g.newDefaulters[t] - if !ok || defaults.object == nil { - return false - } - g.typesForInit = append(g.typesForInit, t) - return true -} - -func (g *genDefaulter) Imports(c *generator.Context) (imports []string) { - var importLines []string - for _, singleImport := range g.imports.ImportLines() { - if g.isOtherPackage(singleImport) { - importLines = append(importLines, singleImport) - } - } - return importLines -} - -func (g *genDefaulter) Init(c *generator.Context, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - - scheme := c.Universe.Type(types.Name{Package: runtimePackagePath, Name: "Scheme"}) - schemePtr := &types.Type{ - Kind: types.Pointer, - Elem: scheme, - } - sw.Do("// RegisterDefaults adds defaulters functions to the given scheme.\n", nil) - sw.Do("// Public to allow building arbitrary schemes.\n", nil) - sw.Do("// All generated defaulters are covering - they call all nested defaulters.\n", nil) - sw.Do("func RegisterDefaults(scheme $.|raw$) error {\n", schemePtr) - for _, t := range g.typesForInit { - args := defaultingArgsFromType(t) - sw.Do("scheme.AddTypeDefaultingFunc(&$.inType|raw${}, func(obj interface{}) { $.inType|objectdefaultfn$(obj.(*$.inType|raw$)) })\n", args) - } - sw.Do("return nil\n", nil) - sw.Do("}\n\n", nil) - return sw.Error() -} - -func (g *genDefaulter) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - if _, ok := g.newDefaulters[t]; !ok { - return nil - } - - klog.V(5).Infof("generating for type %v", t) - - callTree := newCallTreeForType(g.existingDefaulters, g.newDefaulters).build(t, true) - if callTree == nil { - klog.V(5).Infof(" no defaulters defined") - return nil - } - i := 0 - callTree.VisitInOrder(func(ancestors []*callNode, current *callNode) { - if ref := ¤t.defaultValue.SymbolReference; len(ref.Name) > 0 { - // Ensure package for symbol is imported in output generation - g.imports.AddSymbol(*ref) - - // Rewrite the fully qualified name using the local package name - // from the imports - ref.Package = g.imports.LocalNameOf(ref.Package) - } - - if len(current.call) == 0 { - return - } - path := callPath(append(ancestors, current)) - klog.V(5).Infof(" %d: %s", i, path) - i++ - }) - - sw := generator.NewSnippetWriter(w, c, "$", "$") - g.generateDefaulter(t, callTree, sw) - return sw.Error() -} - -func defaultingArgsFromType(inType *types.Type) generator.Args { - return generator.Args{ - "inType": inType, - } -} - -func (g *genDefaulter) generateDefaulter(inType *types.Type, callTree *callNode, sw *generator.SnippetWriter) { - sw.Do("func $.inType|objectdefaultfn$(in *$.inType|raw$) {\n", defaultingArgsFromType(inType)) - callTree.WriteMethod("in", 0, nil, sw) - sw.Do("}\n\n", nil) -} - -// callNode represents an entry in a tree of Go type accessors - the path from the root to a leaf represents -// how in Go code an access would be performed. For example, if a defaulting function exists on a container -// lifecycle hook, to invoke that defaulter correctly would require this Go code: -// -// for i := range pod.Spec.Containers { -// o := &pod.Spec.Containers[i] -// if o.LifecycleHook != nil { -// SetDefaults_LifecycleHook(o.LifecycleHook) -// } -// } -// -// That would be represented by a call tree like: -// -// callNode -// field: "Spec" -// children: -// - field: "Containers" -// children: -// - index: true -// children: -// - field: "LifecycleHook" -// elem: true -// call: -// - SetDefaults_LifecycleHook -// -// which we can traverse to build that Go struct (you must call the field Spec, then Containers, then range over -// that field, then check whether the LifecycleHook field is nil, before calling SetDefaults_LifecycleHook on -// the pointer to that field). -type callNode struct { - // field is the name of the Go member to access - field string - // key is true if this is a map and we must range over the key and values - key bool - // index is true if this is a slice and we must range over the slice values - index bool - // elem is true if the previous elements refer to a pointer (typically just field) - elem bool - - // call is all of the functions that must be invoked on this particular node, in order - call []*types.Type - // children is the child call nodes that must also be traversed - children []callNode - - // defaultValue is the defaultValue of a callNode struct - // Only primitive types and pointer types are eligible to have a default value - defaultValue defaultValue - - // defaultIsPrimitive is used to determine how to assign the default value. - // Primitive types will be directly assigned while complex types will use JSON unmarshalling - defaultIsPrimitive bool - - // markerOnly is true if the callNode exists solely to fill in a default value - markerOnly bool - - // defaultType is the transitive underlying/element type of the node. - // The provided default value literal or reference is expected to be - // convertible to this type. - // - // e.g: - // node type = *string -> defaultType = string - // node type = StringPointerAlias -> defaultType = string - // Only populated if defaultIsPrimitive is true - defaultType *types.Type - - // defaultTopLevelType is the final type the value should resolve to - // This is in constrast with default type, which resolves aliases and pointers. - defaultTopLevelType *types.Type -} - -type defaultValue struct { - // The value was written directly in the marker comment and - // has been parsed as JSON - InlineConstant string - // The name of the symbol relative to the parsed package path - // i.e. k8s.io/pkg.apis.v1.Foo if from another package or simply `Foo` - // if within the same package. - SymbolReference types.Name -} - -func (d defaultValue) IsEmpty() bool { - resolved := d.Resolved() - return resolved == "" -} - -func (d defaultValue) Resolved() string { - if len(d.InlineConstant) > 0 { - return d.InlineConstant - } - return d.SymbolReference.String() -} - -// CallNodeVisitorFunc is a function for visiting a call tree. ancestors is the list of all parents -// of this node to the root of the tree - will be empty at the root. -type CallNodeVisitorFunc func(ancestors []*callNode, node *callNode) - -func (n *callNode) VisitInOrder(fn CallNodeVisitorFunc) { - n.visitInOrder(nil, fn) -} - -func (n *callNode) visitInOrder(ancestors []*callNode, fn CallNodeVisitorFunc) { - fn(ancestors, n) - ancestors = append(ancestors, n) - for i := range n.children { - n.children[i].visitInOrder(ancestors, fn) - } -} - -var ( - indexVariables = "ijklmnop" - localVariables = "abcdefgh" -) - -// varsForDepth creates temporary variables guaranteed to be unique within lexical Go scopes -// of this depth in a function. It uses canonical Go loop variables for the first 7 levels -// and then resorts to uglier prefixes. -func varsForDepth(depth int) (index, local string) { - if depth > len(indexVariables) { - index = fmt.Sprintf("i%d", depth) - } else { - index = indexVariables[depth : depth+1] - } - if depth > len(localVariables) { - local = fmt.Sprintf("local%d", depth) - } else { - local = localVariables[depth : depth+1] - } - return -} - -// writeCalls generates a list of function calls based on the calls field for the provided variable -// name and pointer. -func (n *callNode) writeCalls(varName string, isVarPointer bool, sw *generator.SnippetWriter) { - accessor := varName - if !isVarPointer { - accessor = "&" + accessor - } - for _, fn := range n.call { - sw.Do("$.fn|raw$($.var$)\n", generator.Args{ - "fn": fn, - "var": accessor, - }) - } -} - -func getTypeZeroValue(t string) (interface{}, error) { - defaultZero, ok := typeZeroValue[t] - if !ok { - return nil, fmt.Errorf("Cannot find zero value for type %v in typeZeroValue", t) - } - - // To generate the code for empty string, they must be quoted - if defaultZero == "" { - defaultZero = strconv.Quote(defaultZero.(string)) - } - return defaultZero, nil -} - -func (n *callNode) writeDefaulter(varName string, index string, isVarPointer bool, sw *generator.SnippetWriter) { - if n.defaultValue.IsEmpty() { - return - } - args := generator.Args{ - "defaultValue": n.defaultValue.Resolved(), - "varName": varName, - "index": index, - "varTopType": n.defaultTopLevelType, - } - - variablePlaceholder := "" - - if n.index { - // Defaulting for array - variablePlaceholder = "$.varName$[$.index$]" - } else if n.key { - // Defaulting for map - variablePlaceholder = "$.varName$[$.index$]" - mapDefaultVar := args["index"].(string) + "_default" - args["mapDefaultVar"] = mapDefaultVar - } else { - // Defaulting for primitive type - variablePlaceholder = "$.varName$" - } - - // defaultIsPrimitive is true if the type or underlying type (in an array/map) is primitive - // or is a pointer to a primitive type - // (Eg: int, map[string]*string, []int) - if n.defaultIsPrimitive { - // If the default value is a primitive when the assigned type is a pointer - // keep using the address-of operator on the primitive value until the types match - if pointerPath := getPointerElementPath(n.defaultTopLevelType); len(pointerPath) > 0 { - // If the destination is a pointer, the last element in - // defaultDepth is the element type of the bottommost pointer: - // the base type of our default value. - destElemType := pointerPath[len(pointerPath)-1] - pointerArgs := args.WithArgs(generator.Args{ - "varDepth": len(pointerPath), - "baseElemType": destElemType, - }) - - sw.Do(fmt.Sprintf("if %s == nil {\n", variablePlaceholder), pointerArgs) - if len(n.defaultValue.InlineConstant) > 0 { - // If default value is a literal then it can be assigned via var stmt - sw.Do("var ptrVar$.varDepth$ $.baseElemType|raw$ = $.defaultValue$\n", pointerArgs) - } else { - // If default value is not a literal then it may need to be casted - // to the base type of the destination pointer - sw.Do("ptrVar$.varDepth$ := $.baseElemType|raw$($.defaultValue$)\n", pointerArgs) - } - - for i := len(pointerPath); i >= 1; i-- { - dest := fmt.Sprintf("ptrVar%d", i-1) - assignment := ":=" - if i == 1 { - // Last assignment is into the storage destination - dest = variablePlaceholder - assignment = "=" - } - - sourceType := "*" + destElemType.String() - if i == len(pointerPath) { - // Initial value is not a pointer - sourceType = destElemType.String() - } - destElemType = pointerPath[i-1] - - // Cannot include `dest` into args since its value may be - // `variablePlaceholder` which is a template, not a value - elementArgs := pointerArgs.WithArgs(generator.Args{ - "assignment": assignment, - "source": fmt.Sprintf("ptrVar%d", i), - "destElemType": destElemType, - }) - - // Skip cast if type is exact match - if destElemType.String() == sourceType { - sw.Do(fmt.Sprintf("%v $.assignment$ &$.source$\n", dest), elementArgs) - } else { - sw.Do(fmt.Sprintf("%v $.assignment$ (*$.destElemType|raw$)(&$.source$)\n", dest), elementArgs) - } - } - } else { - // For primitive types, nil checks cannot be used and the zero value must be determined - defaultZero, err := getTypeZeroValue(n.defaultType.String()) - if err != nil { - klog.Error(err) - } - args["defaultZero"] = defaultZero - - sw.Do(fmt.Sprintf("if %s == $.defaultZero$ {\n", variablePlaceholder), args) - - if len(n.defaultValue.InlineConstant) > 0 { - sw.Do(fmt.Sprintf("%s = $.defaultValue$", variablePlaceholder), args) - } else { - sw.Do(fmt.Sprintf("%s = $.varTopType|raw$($.defaultValue$)", variablePlaceholder), args) - } - } - } else { - sw.Do(fmt.Sprintf("if %s == nil {\n", variablePlaceholder), args) - // Map values are not directly addressable and we need a temporary variable to do json unmarshalling - // This applies to maps with non-primitive values (eg: map[string]SubStruct) - if n.key { - sw.Do("$.mapDefaultVar$ := $.varName$[$.index$]\n", args) - sw.Do("if err := json.Unmarshal([]byte(`$.defaultValue$`), &$.mapDefaultVar$); err != nil {\n", args) - } else { - variablePointer := variablePlaceholder - if !isVarPointer { - variablePointer = "&" + variablePointer - } - sw.Do(fmt.Sprintf("if err := json.Unmarshal([]byte(`$.defaultValue$`), %s); err != nil {\n", variablePointer), args) - } - sw.Do("panic(err)\n", nil) - sw.Do("}\n", nil) - if n.key { - sw.Do("$.varName$[$.index$] = $.mapDefaultVar$\n", args) - } - } - sw.Do("}\n", nil) -} - -// WriteMethod performs an in-order traversal of the calltree, generating loops and if blocks as necessary -// to correctly turn the call tree into a method body that invokes all calls on all child nodes of the call tree. -// Depth is used to generate local variables at the proper depth. -func (n *callNode) WriteMethod(varName string, depth int, ancestors []*callNode, sw *generator.SnippetWriter) { - // if len(n.call) > 0 { - // sw.Do(fmt.Sprintf("// %s\n", callPath(append(ancestors, n)).String()), nil) - // } - - if len(n.field) > 0 { - varName = varName + "." + n.field - } - - index, local := varsForDepth(depth) - vars := generator.Args{ - "index": index, - "local": local, - "var": varName, - } - - isPointer := n.elem && !n.index - if isPointer && len(ancestors) > 0 { - sw.Do("if $.var$ != nil {\n", vars) - } - - switch { - case n.index: - sw.Do("for $.index$ := range $.var$ {\n", vars) - if !n.markerOnly { - if n.elem { - sw.Do("$.local$ := $.var$[$.index$]\n", vars) - } else { - sw.Do("$.local$ := &$.var$[$.index$]\n", vars) - } - } - - n.writeDefaulter(varName, index, isPointer, sw) - n.writeCalls(local, true, sw) - for i := range n.children { - n.children[i].WriteMethod(local, depth+1, append(ancestors, n), sw) - } - sw.Do("}\n", nil) - case n.key: - if !n.defaultValue.IsEmpty() { - // Map keys are typed and cannot share the same index variable as arrays and other maps - index = index + "_" + ancestors[len(ancestors)-1].field - vars["index"] = index - sw.Do("for $.index$ := range $.var$ {\n", vars) - n.writeDefaulter(varName, index, isPointer, sw) - sw.Do("}\n", nil) - } - default: - n.writeDefaulter(varName, index, isPointer, sw) - n.writeCalls(varName, isPointer, sw) - for i := range n.children { - n.children[i].WriteMethod(varName, depth, append(ancestors, n), sw) - } - } - - if isPointer && len(ancestors) > 0 { - sw.Do("}\n", nil) - } -} - -type callPath []*callNode - -// String prints a representation of a callPath that roughly approximates what a Go accessor -// would look like. Used for debugging only. -func (path callPath) String() string { - if len(path) == 0 { - return "" - } - var parts []string - for _, p := range path { - last := len(parts) - 1 - switch { - case p.elem: - if len(parts) > 0 { - parts[last] = "*" + parts[last] - } else { - parts = append(parts, "*") - } - case p.index: - if len(parts) > 0 { - parts[last] = parts[last] + "[i]" - } else { - parts = append(parts, "[i]") - } - case p.key: - if len(parts) > 0 { - parts[last] = parts[last] + "[key]" - } else { - parts = append(parts, "[key]") - } - default: - if len(p.field) > 0 { - parts = append(parts, p.field) - } else { - parts = append(parts, "") - } - } - } - var calls []string - for _, fn := range path[len(path)-1].call { - calls = append(calls, fn.Name.String()) - } - if len(calls) == 0 { - calls = append(calls, "") - } - - return strings.Join(parts, ".") + " calls " + strings.Join(calls, ", ") -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/import-boss/generators/import_restrict.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/import-boss/generators/import_restrict.go deleted file mode 100644 index d7eb20b85965..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/import-boss/generators/import_restrict.go +++ /dev/null @@ -1,443 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators has the generators for the import-boss utility. -package generators - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "regexp" - "sort" - "strings" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - "sigs.k8s.io/yaml" - - "k8s.io/klog/v2" -) - -const ( - goModFile = "go.mod" - importBossFileType = "import-boss" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer("", nil), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "raw" -} - -// Packages makes the import-boss package definition. -func Packages(c *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - pkgs := generator.Packages{} - c.FileTypes = map[string]generator.FileType{ - importBossFileType: importRuleFile{c}, - } - - for _, p := range c.Universe { - if !inputIncludes(arguments.InputDirs, p) { - // Don't run on e.g. third party dependencies. - continue - } - savedPackage := p - pkgs = append(pkgs, &generator.DefaultPackage{ - PackageName: p.Name, - PackagePath: p.Path, - Source: p.SourcePath, - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{&importRules{ - myPackage: savedPackage, - }} - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - return false - }, - }) - } - - return pkgs -} - -// inputIncludes returns true if the given package is a (sub) package of one of -// the InputDirs. -func inputIncludes(inputs []string, p *types.Package) bool { - // TODO: This does not handle conversion of local paths (./foo) into - // canonical packages (github.com/example/project/foo). - for _, input := range inputs { - // Normalize paths - input := strings.TrimSuffix(input, "/") - input = strings.TrimPrefix(input, "./vendor/") - seek := strings.TrimSuffix(p.Path, "/") - - if input == seek { - return true - } - if strings.HasSuffix(input, "...") { - input = strings.TrimSuffix(input, "...") - if strings.HasPrefix(seek+"/", input) { - return true - } - } - } - return false -} - -// A single import restriction rule. -type Rule struct { - // All import paths that match this regexp... - SelectorRegexp string - // ... must have one of these prefixes ... - AllowedPrefixes []string - // ... and must not have one of these prefixes. - ForbiddenPrefixes []string -} - -type InverseRule struct { - Rule - // True if the rule is to be applied to transitive imports. - Transitive bool -} - -type fileFormat struct { - CurrentImports []string - - Rules []Rule - InverseRules []InverseRule - - path string -} - -func readFile(path string) (*fileFormat, error) { - currentBytes, err := ioutil.ReadFile(path) - if err != nil { - return nil, fmt.Errorf("couldn't read %v: %v", path, err) - } - - var current fileFormat - err = yaml.Unmarshal(currentBytes, ¤t) - if err != nil { - return nil, fmt.Errorf("couldn't unmarshal %v: %v", path, err) - } - current.path = path - return ¤t, nil -} - -func writeFile(path string, ff *fileFormat) error { - raw, err := json.MarshalIndent(ff, "", "\t") - if err != nil { - return fmt.Errorf("couldn't format data for file %v.\n%#v", path, ff) - } - f, err := os.Create(path) - if err != nil { - return fmt.Errorf("couldn't open %v for writing: %v", path, err) - } - defer f.Close() - _, err = f.Write(raw) - return err -} - -// This does the actual checking, since it knows the literal destination file. -type importRuleFile struct { - context *generator.Context -} - -func (irf importRuleFile) AssembleFile(f *generator.File, path string) error { - return irf.VerifyFile(f, path) -} - -// TODO: make a flag to enable this, or expose this information in some other way. -func (importRuleFile) listEntireImportTree(f *generator.File, path string) error { - // If the file exists, populate its current imports. This is mostly to help - // humans figure out what they need to fix. - if _, err := os.Stat(path); err != nil { - // Ignore packages which haven't opted in by adding an .import-restrictions file. - return nil - } - - current, err := readFile(path) - if err != nil { - return err - } - - current.CurrentImports = []string{} - for v := range f.Imports { - current.CurrentImports = append(current.CurrentImports, v) - } - sort.Strings(current.CurrentImports) - - return writeFile(path, current) -} - -// removeLastDir removes the last directory, but leaves the file name -// unchanged. It returns the new path and the removed directory. So: -// "a/b/c/file" -> ("a/b/file", "c") -func removeLastDir(path string) (newPath, removedDir string) { - dir, file := filepath.Split(path) - dir = strings.TrimSuffix(dir, string(filepath.Separator)) - return filepath.Join(filepath.Dir(dir), file), filepath.Base(dir) -} - -// isGoModRoot checks if a directory is the root directory for a package -// by checking for the existence of a 'go.mod' file in that directory. -func isGoModRoot(path string) bool { - _, err := os.Stat(filepath.Join(filepath.Dir(path), goModFile)) - return err == nil -} - -// recursiveRead collects all '.import-restriction' files, between the current directory, -// and the package root when Go modules are enabled, or $GOPATH/src when they are not. -func recursiveRead(path string) ([]*fileFormat, error) { - restrictionFiles := make([]*fileFormat, 0) - - for { - if _, err := os.Stat(path); err == nil { - rules, err := readFile(path) - if err != nil { - return nil, err - } - - restrictionFiles = append(restrictionFiles, rules) - } - - nextPath, removedDir := removeLastDir(path) - if nextPath == path || isGoModRoot(path) || removedDir == "src" { - break - } - - path = nextPath - } - - return restrictionFiles, nil -} - -func (irf importRuleFile) VerifyFile(f *generator.File, path string) error { - restrictionFiles, err := recursiveRead(filepath.Join(f.PackageSourcePath, f.Name)) - if err != nil { - return fmt.Errorf("error finding rules file: %v", err) - } - - if err := irf.verifyRules(restrictionFiles, f); err != nil { - return err - } - - return irf.verifyInverseRules(restrictionFiles, f) -} - -func (irf importRuleFile) verifyRules(restrictionFiles []*fileFormat, f *generator.File) error { - selectors := make([][]*regexp.Regexp, len(restrictionFiles)) - for i, restrictionFile := range restrictionFiles { - for _, r := range restrictionFile.Rules { - re, err := regexp.Compile(r.SelectorRegexp) - if err != nil { - return fmt.Errorf("regexp `%s` in file %q doesn't compile: %v", r.SelectorRegexp, restrictionFile.path, err) - } - - selectors[i] = append(selectors[i], re) - } - } - - forbiddenImports := map[string]string{} - allowedMismatchedImports := []string{} - - for v := range f.Imports { - explicitlyAllowed := false - - NextRestrictionFiles: - for i, rules := range restrictionFiles { - for j, r := range rules.Rules { - matching := selectors[i][j].MatchString(v) - klog.V(5).Infof("Checking %v matches %v: %v\n", r.SelectorRegexp, v, matching) - if !matching { - continue - } - for _, forbidden := range r.ForbiddenPrefixes { - klog.V(4).Infof("Checking %v against %v\n", v, forbidden) - if strings.HasPrefix(v, forbidden) { - forbiddenImports[v] = forbidden - } - } - for _, allowed := range r.AllowedPrefixes { - klog.V(4).Infof("Checking %v against %v\n", v, allowed) - if strings.HasPrefix(v, allowed) { - explicitlyAllowed = true - break - } - } - - if !explicitlyAllowed { - allowedMismatchedImports = append(allowedMismatchedImports, v) - } else { - klog.V(2).Infof("%v importing %v allowed by %v\n", f.PackagePath, v, restrictionFiles[i].path) - break NextRestrictionFiles - } - } - } - } - - if len(forbiddenImports) > 0 || len(allowedMismatchedImports) > 0 { - var errorBuilder strings.Builder - for i, f := range forbiddenImports { - fmt.Fprintf(&errorBuilder, "import %v has forbidden prefix %v\n", i, f) - } - if len(allowedMismatchedImports) > 0 { - sort.Sort(sort.StringSlice(allowedMismatchedImports)) - fmt.Fprintf(&errorBuilder, "the following imports did not match any allowed prefix:\n") - for _, i := range allowedMismatchedImports { - fmt.Fprintf(&errorBuilder, " %v\n", i) - } - } - return errors.New(errorBuilder.String()) - } - - return nil -} - -// verifyInverseRules checks that all packages that import a package are allowed to import it. -func (irf importRuleFile) verifyInverseRules(restrictionFiles []*fileFormat, f *generator.File) error { - // compile all Selector regex in all restriction files - selectors := make([][]*regexp.Regexp, len(restrictionFiles)) - for i, restrictionFile := range restrictionFiles { - for _, r := range restrictionFile.InverseRules { - re, err := regexp.Compile(r.SelectorRegexp) - if err != nil { - return fmt.Errorf("regexp `%s` in file %q doesn't compile: %v", r.SelectorRegexp, restrictionFile.path, err) - } - - selectors[i] = append(selectors[i], re) - } - } - - directImport := map[string]bool{} - for _, imp := range irf.context.IncomingImports()[f.PackagePath] { - directImport[imp] = true - } - - forbiddenImports := map[string]string{} - allowedMismatchedImports := []string{} - - for _, v := range irf.context.TransitiveIncomingImports()[f.PackagePath] { - explicitlyAllowed := false - - NextRestrictionFiles: - for i, rules := range restrictionFiles { - for j, r := range rules.InverseRules { - if !r.Transitive && !directImport[v] { - continue - } - - re := selectors[i][j] - matching := re.MatchString(v) - klog.V(4).Infof("Checking %v matches %v (importing %v: %v\n", r.SelectorRegexp, v, f.PackagePath, matching) - if !matching { - continue - } - for _, forbidden := range r.ForbiddenPrefixes { - klog.V(4).Infof("Checking %v against %v\n", v, forbidden) - if strings.HasPrefix(v, forbidden) { - forbiddenImports[v] = forbidden - } - } - for _, allowed := range r.AllowedPrefixes { - klog.V(4).Infof("Checking %v against %v\n", v, allowed) - if strings.HasPrefix(v, allowed) { - explicitlyAllowed = true - break - } - } - if !explicitlyAllowed { - allowedMismatchedImports = append(allowedMismatchedImports, v) - } else { - klog.V(2).Infof("%v importing %v allowed by %v\n", v, f.PackagePath, restrictionFiles[i].path) - break NextRestrictionFiles - } - } - } - } - - if len(forbiddenImports) > 0 || len(allowedMismatchedImports) > 0 { - var errorBuilder strings.Builder - for i, f := range forbiddenImports { - fmt.Fprintf(&errorBuilder, "(inverse): import %v has forbidden prefix %v\n", i, f) - } - if len(allowedMismatchedImports) > 0 { - sort.Sort(sort.StringSlice(allowedMismatchedImports)) - fmt.Fprintf(&errorBuilder, "(inverse): the following imports did not match any allowed prefix:\n") - for _, i := range allowedMismatchedImports { - fmt.Fprintf(&errorBuilder, " %v\n", i) - } - } - return errors.New(errorBuilder.String()) - } - - return nil -} - -// importRules produces a file with a set for a single type. -type importRules struct { - myPackage *types.Package - imports namer.ImportTracker -} - -var ( - _ = generator.Generator(&importRules{}) - _ = generator.FileType(importRuleFile{}) -) - -func (r *importRules) Name() string { return "import rules" } -func (r *importRules) Filter(*generator.Context, *types.Type) bool { return false } -func (r *importRules) Namers(*generator.Context) namer.NameSystems { return nil } -func (r *importRules) PackageVars(*generator.Context) []string { return []string{} } -func (r *importRules) PackageConsts(*generator.Context) []string { return []string{} } -func (r *importRules) GenerateType(*generator.Context, *types.Type, io.Writer) error { return nil } -func (r *importRules) Filename() string { return ".import-restrictions" } -func (r *importRules) FileType() string { return importBossFileType } -func (r *importRules) Init(c *generator.Context, w io.Writer) error { return nil } -func (r *importRules) Finalize(*generator.Context, io.Writer) error { return nil } - -func dfsImports(dest *[]string, seen map[string]bool, p *types.Package) { - for _, p2 := range p.Imports { - if seen[p2.Path] { - continue - } - seen[p2.Path] = true - dfsImports(dest, seen, p2) - *dest = append(*dest, p2.Path) - } -} - -func (r *importRules) Imports(*generator.Context) []string { - all := []string{} - dfsImports(&all, map[string]bool{}, r.myPackage) - return all -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/generators/sets.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/generators/sets.go deleted file mode 100644 index e89f5ad76162..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/generators/sets.go +++ /dev/null @@ -1,378 +0,0 @@ -/* -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 generators has the generators for the set-gen utility. -package generators - -import ( - "io" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" -) - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "public": namer.NewPublicNamer(0), - "private": namer.NewPrivateNamer(0), - "raw": namer.NewRawNamer("", nil), - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "public" -} - -// Packages makes the sets package definition. -func Packages(_ *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - - return generator.Packages{&generator.DefaultPackage{ - PackageName: "sets", - PackagePath: arguments.OutputPackagePath, - HeaderText: boilerplate, - PackageDocumentation: []byte( - `// Package sets has auto-generated set types. -`), - // GeneratorFunc returns a list of generators. Each generator makes a - // single file. - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - generators = []generator.Generator{ - // Always generate a "doc.go" file. - generator.DefaultGen{OptionalName: "doc"}, - // Make a separate file for the Empty type, since it's shared by every type. - generator.DefaultGen{ - OptionalName: "empty", - OptionalBody: []byte(emptyTypeDecl), - }, - } - // Since we want a file per type that we generate a set for, we - // have to provide a function for this. - for _, t := range c.Order { - generators = append(generators, &genSet{ - DefaultGen: generator.DefaultGen{ - // Use the privatized version of the - // type name as the file name. - // - // TODO: make a namer that converts - // camelCase to '-' separation for file - // names? - OptionalName: c.Namers["private"].Name(t), - }, - outputPackage: arguments.OutputPackagePath, - typeToMatch: t, - imports: generator.NewImportTracker(), - }) - } - return generators - }, - FilterFunc: func(c *generator.Context, t *types.Type) bool { - // It would be reasonable to filter by the type's package here. - // It might be necessary if your input directory has a big - // import graph. - switch t.Kind { - case types.Map, types.Slice, types.Pointer: - // These types can't be keys in a map. - return false - case types.Builtin: - return true - case types.Struct: - // Only some structs can be keys in a map. This is triggered by the line - // // +genset - // or - // // +genset=true - return extractBoolTagOrDie("genset", t.CommentLines) == true - } - return false - }, - }} -} - -// genSet produces a file with a set for a single type. -type genSet struct { - generator.DefaultGen - outputPackage string - typeToMatch *types.Type - imports namer.ImportTracker -} - -// Filter ignores all but one type because we're making a single file per type. -func (g *genSet) Filter(c *generator.Context, t *types.Type) bool { return t == g.typeToMatch } - -func (g *genSet) Namers(c *generator.Context) namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.outputPackage, g.imports), - } -} - -func (g *genSet) Imports(c *generator.Context) (imports []string) { - return append(g.imports.ImportLines(), "reflect", "sort") -} - -// args constructs arguments for templates. Usage: -// g.args(t, "key1", value1, "key2", value2, ...) -// -// 't' is loaded with the key 'type'. -// -// We could use t directly as the argument, but doing it this way makes it easy -// to mix in additional parameters. This feature is not used in this set -// generator, but is present as an example. -func (g *genSet) args(t *types.Type, kv ...interface{}) interface{} { - m := map[interface{}]interface{}{"type": t} - for i := 0; i < len(kv)/2; i++ { - m[kv[i*2]] = kv[i*2+1] - } - return m -} - -// GenerateType makes the body of a file implementing a set for type t. -func (g *genSet) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - sw.Do(setCode, g.args(t)) - sw.Do("func less$.type|public$(lhs, rhs $.type|raw$) bool {\n", g.args(t)) - g.lessBody(sw, t) - sw.Do("}\n", g.args(t)) - return sw.Error() -} - -func (g *genSet) lessBody(sw *generator.SnippetWriter, t *types.Type) { - // TODO: make this recursive, handle pointers and multiple nested structs... - switch t.Kind { - case types.Struct: - for _, m := range types.FlattenMembers(t.Members) { - sw.Do("if lhs.$.Name$ < rhs.$.Name$ { return true }\n", m) - sw.Do("if lhs.$.Name$ > rhs.$.Name$ { return false }\n", m) - } - sw.Do("return false\n", nil) - default: - sw.Do("return lhs < rhs\n", nil) - } -} - -// written to the "empty.go" file. -var emptyTypeDecl = ` -// Empty is public since it is used by some internal API objects for conversions between external -// string arrays and internal sets, and conversion logic requires public types today. -type Empty struct{} -` - -// Written for every type. If you've never used text/template before: -// $.type$ refers to the source type; |public means to -// call the function giving the public name, |raw the raw type name. -var setCode = `// sets.$.type|public$ is a set of $.type|raw$s, implemented via map[$.type|raw$]struct{} for minimal memory consumption. -type $.type|public$ map[$.type|raw$]Empty - -// New$.type|public$ creates a $.type|public$ from a list of values. -func New$.type|public$(items ...$.type|raw$) $.type|public$ { - ss := make($.type|public$, len(items)) - ss.Insert(items...) - return ss -} - -// $.type|public$KeySet creates a $.type|public$ from a keys of a map[$.type|raw$](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func $.type|public$KeySet(theMap interface{}) $.type|public$ { - v := reflect.ValueOf(theMap) - ret := $.type|public${} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().($.type|raw$)) - } - return ret -} - -// Insert adds items to the set. -func (s $.type|public$) Insert(items ...$.type|raw$) $.type|public$ { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s $.type|public$) Delete(items ...$.type|raw$) $.type|public$ { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s $.type|public$) Has(item $.type|raw$) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s $.type|public$) HasAll(items ...$.type|raw$) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s $.type|public$) HasAny(items ...$.type|raw$) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s $.type|public$) Clone() $.type|public$ { - result := make($.type|public$, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 $.type|public$) Difference(s2 $.type|public$) $.type|public$ { - result := New$.type|public$() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 $.type|public$) SymmetricDifference(s2 $.type|public$) $.type|public$ { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 $.type|public$) Union(s2 $.type|public$) $.type|public$ { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 $.type|public$) Intersection(s2 $.type|public$) $.type|public$ { - var walk, other $.type|public$ - result := New$.type|public$() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 $.type|public$) IsSuperset(s2 $.type|public$) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 $.type|public$) Equal(s2 $.type|public$) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOf$.type|public$ []$.type|raw$ - -func (s sortableSliceOf$.type|public$) Len() int { return len(s) } -func (s sortableSliceOf$.type|public$) Less(i, j int) bool { return less$.type|public$(s[i], s[j]) } -func (s sortableSliceOf$.type|public$) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted $.type|raw$ slice. -func (s $.type|public$) List() []$.type|raw$ { - res := make(sortableSliceOf$.type|public$, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []$.type|raw$(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s $.type|public$) UnsortedList() []$.type|raw$ { - res :=make([]$.type|raw$, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s $.type|public$) PopAny() ($.type|raw$, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue $.type|raw$ - return zeroValue, false -} - -// Len returns the size of the set. -func (s $.type|public$) Len() int { - return len(s) -} - -` diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/generators/tags.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/generators/tags.go deleted file mode 100644 index 52e87677183f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/generators/tags.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "k8s.io/gengo/types" - "k8s.io/klog/v2" -) - -// extractBoolTagOrDie gets the comment-tags for the key and asserts that, if -// it exists, the value is boolean. If the tag did not exist, it returns -// false. -func extractBoolTagOrDie(key string, lines []string) bool { - val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines) - if err != nil { - klog.Fatalf(err.Error()) - } - return val -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go deleted file mode 100644 index e9660c2f3a94..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Byte is a set of bytes, implemented via map[byte]struct{} for minimal memory consumption. -type Byte map[byte]Empty - -// NewByte creates a Byte from a list of values. -func NewByte(items ...byte) Byte { - ss := make(Byte, len(items)) - ss.Insert(items...) - return ss -} - -// ByteKeySet creates a Byte from a keys of a map[byte](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func ByteKeySet(theMap interface{}) Byte { - v := reflect.ValueOf(theMap) - ret := Byte{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(byte)) - } - return ret -} - -// Insert adds items to the set. -func (s Byte) Insert(items ...byte) Byte { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Byte) Delete(items ...byte) Byte { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Byte) Has(item byte) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Byte) HasAll(items ...byte) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Byte) HasAny(items ...byte) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s Byte) Clone() Byte { - result := make(Byte, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Byte) Difference(s2 Byte) Byte { - result := NewByte() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Byte) SymmetricDifference(s2 Byte) Byte { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Byte) Union(s2 Byte) Byte { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Byte) Intersection(s2 Byte) Byte { - var walk, other Byte - result := NewByte() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Byte) IsSuperset(s2 Byte) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Byte) Equal(s2 Byte) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfByte []byte - -func (s sortableSliceOfByte) Len() int { return len(s) } -func (s sortableSliceOfByte) Less(i, j int) bool { return lessByte(s[i], s[j]) } -func (s sortableSliceOfByte) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted byte slice. -func (s Byte) List() []byte { - res := make(sortableSliceOfByte, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []byte(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Byte) UnsortedList() []byte { - res := make([]byte, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Byte) PopAny() (byte, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue byte - return zeroValue, false -} - -// Len returns the size of the set. -func (s Byte) Len() int { - return len(s) -} - -func lessByte(lhs, rhs byte) bool { - return lhs < rhs -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go deleted file mode 100644 index b152a0bf00f2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -// Package sets has auto-generated set types. -package sets diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go deleted file mode 100644 index e11e622c5ba0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -// Empty is public since it is used by some internal API objects for conversions between external -// string arrays and internal sets, and conversion logic requires public types today. -type Empty struct{} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/int.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/int.go deleted file mode 100644 index f614f06e1f97..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/int.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Int is a set of ints, implemented via map[int]struct{} for minimal memory consumption. -type Int map[int]Empty - -// NewInt creates a Int from a list of values. -func NewInt(items ...int) Int { - ss := make(Int, len(items)) - ss.Insert(items...) - return ss -} - -// IntKeySet creates a Int from a keys of a map[int](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func IntKeySet(theMap interface{}) Int { - v := reflect.ValueOf(theMap) - ret := Int{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(int)) - } - return ret -} - -// Insert adds items to the set. -func (s Int) Insert(items ...int) Int { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Int) Delete(items ...int) Int { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Int) Has(item int) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int) HasAll(items ...int) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Int) HasAny(items ...int) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s Int) Clone() Int { - result := make(Int, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Int) Difference(s2 Int) Int { - result := NewInt() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Int) SymmetricDifference(s2 Int) Int { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int) Union(s2 Int) Int { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int) Intersection(s2 Int) Int { - var walk, other Int - result := NewInt() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int) IsSuperset(s2 Int) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int) Equal(s2 Int) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfInt []int - -func (s sortableSliceOfInt) Len() int { return len(s) } -func (s sortableSliceOfInt) Less(i, j int) bool { return lessInt(s[i], s[j]) } -func (s sortableSliceOfInt) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted int slice. -func (s Int) List() []int { - res := make(sortableSliceOfInt, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []int(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int) UnsortedList() []int { - res := make([]int, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Int) PopAny() (int, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue int - return zeroValue, false -} - -// Len returns the size of the set. -func (s Int) Len() int { - return len(s) -} - -func lessInt(lhs, rhs int) bool { - return lhs < rhs -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go deleted file mode 100644 index 995d99bd90db..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Int64 is a set of int64s, implemented via map[int64]struct{} for minimal memory consumption. -type Int64 map[int64]Empty - -// NewInt64 creates a Int64 from a list of values. -func NewInt64(items ...int64) Int64 { - ss := make(Int64, len(items)) - ss.Insert(items...) - return ss -} - -// Int64KeySet creates a Int64 from a keys of a map[int64](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func Int64KeySet(theMap interface{}) Int64 { - v := reflect.ValueOf(theMap) - ret := Int64{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(int64)) - } - return ret -} - -// Insert adds items to the set. -func (s Int64) Insert(items ...int64) Int64 { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Int64) Delete(items ...int64) Int64 { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Int64) Has(item int64) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int64) HasAll(items ...int64) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Int64) HasAny(items ...int64) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s Int64) Clone() Int64 { - result := make(Int64, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Int64) Difference(s2 Int64) Int64 { - result := NewInt64() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Int64) SymmetricDifference(s2 Int64) Int64 { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int64) Union(s2 Int64) Int64 { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int64) Intersection(s2 Int64) Int64 { - var walk, other Int64 - result := NewInt64() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int64) IsSuperset(s2 Int64) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int64) Equal(s2 Int64) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfInt64 []int64 - -func (s sortableSliceOfInt64) Len() int { return len(s) } -func (s sortableSliceOfInt64) Less(i, j int) bool { return lessInt64(s[i], s[j]) } -func (s sortableSliceOfInt64) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted int64 slice. -func (s Int64) List() []int64 { - res := make(sortableSliceOfInt64, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []int64(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int64) UnsortedList() []int64 { - res := make([]int64, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Int64) PopAny() (int64, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue int64 - return zeroValue, false -} - -// Len returns the size of the set. -func (s Int64) Len() int { - return len(s) -} - -func lessInt64(lhs, rhs int64) bool { - return lhs < rhs -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/string.go b/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/string.go deleted file mode 100644 index 4a4a92fd21fd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/examples/set-gen/sets/string.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption. -type String map[string]Empty - -// NewString creates a String from a list of values. -func NewString(items ...string) String { - ss := make(String, len(items)) - ss.Insert(items...) - return ss -} - -// StringKeySet creates a String from a keys of a map[string](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func StringKeySet(theMap interface{}) String { - v := reflect.ValueOf(theMap) - ret := String{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(string)) - } - return ret -} - -// Insert adds items to the set. -func (s String) Insert(items ...string) String { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s String) Delete(items ...string) String { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s String) Has(item string) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s String) HasAll(items ...string) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s String) HasAny(items ...string) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s String) Clone() String { - result := make(String, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 String) Difference(s2 String) String { - result := NewString() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 String) SymmetricDifference(s2 String) String { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 String) Union(s2 String) String { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 String) Intersection(s2 String) String { - var walk, other String - result := NewString() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 String) IsSuperset(s2 String) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 String) Equal(s2 String) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfString []string - -func (s sortableSliceOfString) Len() int { return len(s) } -func (s sortableSliceOfString) Less(i, j int) bool { return lessString(s[i], s[j]) } -func (s sortableSliceOfString) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted string slice. -func (s String) List() []string { - res := make(sortableSliceOfString, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []string(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s String) UnsortedList() []string { - res := make([]string, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s String) PopAny() (string, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue string - return zeroValue, false -} - -// Len returns the size of the set. -func (s String) Len() int { - return len(s) -} - -func lessString(lhs, rhs string) bool { - return lhs < rhs -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/default_generator.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/default_generator.go deleted file mode 100644 index f9476682148d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/default_generator.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -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 generator - -import ( - "io" - - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -const ( - GolangFileType = "golang" -) - -// DefaultGen implements a do-nothing Generator. -// -// It can be used to implement static content files. -type DefaultGen struct { - // OptionalName, if present, will be used for the generator's name, and - // the filename (with ".go" appended). - OptionalName string - - // OptionalBody, if present, will be used as the return from the "Init" - // method. This causes it to be static content for the entire file if - // no other generator touches the file. - OptionalBody []byte -} - -func (d DefaultGen) Name() string { return d.OptionalName } -func (d DefaultGen) Filter(*Context, *types.Type) bool { return true } -func (d DefaultGen) Namers(*Context) namer.NameSystems { return nil } -func (d DefaultGen) Imports(*Context) []string { return []string{} } -func (d DefaultGen) PackageVars(*Context) []string { return []string{} } -func (d DefaultGen) PackageConsts(*Context) []string { return []string{} } -func (d DefaultGen) GenerateType(*Context, *types.Type, io.Writer) error { return nil } -func (d DefaultGen) Filename() string { return d.OptionalName + ".go" } -func (d DefaultGen) FileType() string { return GolangFileType } -func (d DefaultGen) Finalize(*Context, io.Writer) error { return nil } - -func (d DefaultGen) Init(c *Context, w io.Writer) error { - _, err := w.Write(d.OptionalBody) - return err -} - -var ( - _ = Generator(DefaultGen{}) -) diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/default_package.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/default_package.go deleted file mode 100644 index dcf0883235dd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/default_package.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -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 generator - -import ( - "k8s.io/gengo/types" -) - -// DefaultPackage contains a default implementation of Package. -type DefaultPackage struct { - // Short name of package, used in the "package xxxx" line. - PackageName string - // Import path of the package, and the location on disk of the package. - PackagePath string - // The location of the package on disk. - Source string - - // Emitted at the top of every file. - HeaderText []byte - - // Emitted only for a "doc.go" file; appended to the HeaderText for - // that file. - PackageDocumentation []byte - - // If non-nil, will be called on "Generators"; otherwise, the static - // list will be used. So you should set only one of these two fields. - GeneratorFunc func(*Context) []Generator - GeneratorList []Generator - - // Optional; filters the types exposed to the generators. - FilterFunc func(*Context, *types.Type) bool -} - -func (d *DefaultPackage) Name() string { return d.PackageName } -func (d *DefaultPackage) Path() string { return d.PackagePath } -func (d *DefaultPackage) SourcePath() string { return d.Source } - -func (d *DefaultPackage) Filter(c *Context, t *types.Type) bool { - if d.FilterFunc != nil { - return d.FilterFunc(c, t) - } - return true -} - -func (d *DefaultPackage) Generators(c *Context) []Generator { - if d.GeneratorFunc != nil { - return d.GeneratorFunc(c) - } - return d.GeneratorList -} - -func (d *DefaultPackage) Header(filename string) []byte { - if filename == "doc.go" { - return append(d.HeaderText, d.PackageDocumentation...) - } - return d.HeaderText -} - -var ( - _ = Package(&DefaultPackage{}) -) diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/doc.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/doc.go deleted file mode 100644 index d8e12534a44e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -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 generator defines an interface for code generators to implement. -// -// To use this package, you'll implement the "Package" and "Generator" -// interfaces; you'll call NewContext to load up the types you want to work -// with, and then you'll call one or more of the Execute methods. See the -// interface definitions for explanations. All output will have gofmt called on -// it automatically, so you do not need to worry about generating correct -// indentation. -// -// This package also exposes SnippetWriter. SnippetWriter reduces to a minimum -// the boilerplate involved in setting up a template from go's text/template -// package. Additionally, all naming systems in the Context will be added as -// functions to the parsed template, so that they can be called directly from -// your templates! -package generator // import "k8s.io/gengo/generator" diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/error_tracker.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/error_tracker.go deleted file mode 100644 index 964dae37ba55..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/error_tracker.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -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 generator - -import ( - "io" -) - -// ErrorTracker tracks errors to the underlying writer, so that you can ignore -// them until you're ready to return. -type ErrorTracker struct { - io.Writer - err error -} - -// NewErrorTracker makes a new error tracker; note that it implements io.Writer. -func NewErrorTracker(w io.Writer) *ErrorTracker { - return &ErrorTracker{Writer: w} -} - -// Write intercepts calls to Write. -func (et *ErrorTracker) Write(p []byte) (n int, err error) { - if et.err != nil { - return 0, et.err - } - n, err = et.Writer.Write(p) - if err != nil { - et.err = err - } - return n, err -} - -// Error returns nil if no error has occurred, otherwise it returns the error. -func (et *ErrorTracker) Error() error { - return et.err -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/execute.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/execute.go deleted file mode 100644 index f096741bc868..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/execute.go +++ /dev/null @@ -1,329 +0,0 @@ -/* -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 generator - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "golang.org/x/tools/imports" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" -) - -func errs2strings(errors []error) []string { - strs := make([]string, len(errors)) - for i := range errors { - strs[i] = errors[i].Error() - } - return strs -} - -// ExecutePackages runs the generators for every package in 'packages'. 'outDir' -// is the base directory in which to place all the generated packages; it -// should be a physical path on disk, not an import path. e.g.: -// /path/to/home/path/to/gopath/src/ -// Each package has its import path already, this will be appended to 'outDir'. -func (c *Context) ExecutePackages(outDir string, packages Packages) error { - var errors []error - for _, p := range packages { - if err := c.ExecutePackage(outDir, p); err != nil { - errors = append(errors, err) - } - } - if len(errors) > 0 { - return fmt.Errorf("some packages had errors:\n%v\n", strings.Join(errs2strings(errors), "\n")) - } - return nil -} - -type DefaultFileType struct { - Format func([]byte) ([]byte, error) - Assemble func(io.Writer, *File) -} - -func (ft DefaultFileType) AssembleFile(f *File, pathname string) error { - klog.V(5).Infof("Assembling file %q", pathname) - destFile, err := os.Create(pathname) - if err != nil { - return err - } - defer destFile.Close() - - b := &bytes.Buffer{} - et := NewErrorTracker(b) - ft.Assemble(et, f) - if et.Error() != nil { - return et.Error() - } - if formatted, err := ft.Format(b.Bytes()); err != nil { - err = fmt.Errorf("unable to format file %q (%v).", pathname, err) - // Write the file anyway, so they can see what's going wrong and fix the generator. - if _, err2 := destFile.Write(b.Bytes()); err2 != nil { - return err2 - } - return err - } else { - _, err = destFile.Write(formatted) - return err - } -} - -func (ft DefaultFileType) VerifyFile(f *File, pathname string) error { - klog.V(5).Infof("Verifying file %q", pathname) - friendlyName := filepath.Join(f.PackageName, f.Name) - b := &bytes.Buffer{} - et := NewErrorTracker(b) - ft.Assemble(et, f) - if et.Error() != nil { - return et.Error() - } - formatted, err := ft.Format(b.Bytes()) - if err != nil { - return fmt.Errorf("unable to format the output for %q: %v", friendlyName, err) - } - existing, err := ioutil.ReadFile(pathname) - if err != nil { - return fmt.Errorf("unable to read file %q for comparison: %v", friendlyName, err) - } - if bytes.Compare(formatted, existing) == 0 { - return nil - } - // Be nice and find the first place where they differ - i := 0 - for i < len(formatted) && i < len(existing) && formatted[i] == existing[i] { - i++ - } - eDiff, fDiff := existing[i:], formatted[i:] - if len(eDiff) > 100 { - eDiff = eDiff[:100] - } - if len(fDiff) > 100 { - fDiff = fDiff[:100] - } - return fmt.Errorf("output for %q differs; first existing/expected diff: \n %q\n %q", friendlyName, string(eDiff), string(fDiff)) -} - -func assembleGolangFile(w io.Writer, f *File) { - w.Write(f.Header) - fmt.Fprintf(w, "package %v\n\n", f.PackageName) - - if len(f.Imports) > 0 { - fmt.Fprint(w, "import (\n") - for i := range f.Imports { - if strings.Contains(i, "\"") { - // they included quotes, or are using the - // `name "path/to/pkg"` format. - fmt.Fprintf(w, "\t%s\n", i) - } else { - fmt.Fprintf(w, "\t%q\n", i) - } - } - fmt.Fprint(w, ")\n\n") - } - - if f.Vars.Len() > 0 { - fmt.Fprint(w, "var (\n") - w.Write(f.Vars.Bytes()) - fmt.Fprint(w, ")\n\n") - } - - if f.Consts.Len() > 0 { - fmt.Fprint(w, "const (\n") - w.Write(f.Consts.Bytes()) - fmt.Fprint(w, ")\n\n") - } - - w.Write(f.Body.Bytes()) -} - -func importsWrapper(src []byte) ([]byte, error) { - return imports.Process("", src, nil) -} - -func NewGolangFile() *DefaultFileType { - return &DefaultFileType{ - Format: importsWrapper, - Assemble: assembleGolangFile, - } -} - -// format should be one line only, and not end with \n. -func addIndentHeaderComment(b *bytes.Buffer, format string, args ...interface{}) { - if b.Len() > 0 { - fmt.Fprintf(b, "\n// "+format+"\n", args...) - } else { - fmt.Fprintf(b, "// "+format+"\n", args...) - } -} - -func (c *Context) filteredBy(f func(*Context, *types.Type) bool) *Context { - c2 := *c - c2.Order = []*types.Type{} - for _, t := range c.Order { - if f(c, t) { - c2.Order = append(c2.Order, t) - } - } - return &c2 -} - -// make a new context; inheret c.Namers, but add on 'namers'. In case of a name -// collision, the namer in 'namers' wins. -func (c *Context) addNameSystems(namers namer.NameSystems) *Context { - if namers == nil { - return c - } - c2 := *c - // Copy the existing name systems so we don't corrupt a parent context - c2.Namers = namer.NameSystems{} - for k, v := range c.Namers { - c2.Namers[k] = v - } - - for name, namer := range namers { - c2.Namers[name] = namer - } - return &c2 -} - -// ExecutePackage executes a single package. 'outDir' is the base directory in -// which to place the package; it should be a physical path on disk, not an -// import path. e.g.: '/path/to/home/path/to/gopath/src/' The package knows its -// import path already, this will be appended to 'outDir'. -func (c *Context) ExecutePackage(outDir string, p Package) error { - path := filepath.Join(outDir, p.Path()) - - // When working outside of GOPATH, we typically won't want to generate the - // full path for a package. For example, if our current project's root/base - // package is github.com/foo/bar, outDir=., p.Path()=github.com/foo/bar/generated, - // then we really want to be writing files to ./generated, not ./github.com/foo/bar/generated. - // The following will trim a path prefix (github.com/foo/bar) from p.Path() to arrive at - // a relative path that works with projects not in GOPATH. - if c.TrimPathPrefix != "" { - separator := string(filepath.Separator) - if !strings.HasSuffix(c.TrimPathPrefix, separator) { - c.TrimPathPrefix += separator - } - - path = strings.TrimPrefix(path, c.TrimPathPrefix) - } - klog.V(5).Infof("Processing package %q, disk location %q", p.Name(), path) - // Filter out any types the *package* doesn't care about. - packageContext := c.filteredBy(p.Filter) - os.MkdirAll(path, 0755) - files := map[string]*File{} - for _, g := range p.Generators(packageContext) { - // Filter out types the *generator* doesn't care about. - genContext := packageContext.filteredBy(g.Filter) - // Now add any extra name systems defined by this generator - genContext = genContext.addNameSystems(g.Namers(genContext)) - - fileType := g.FileType() - if len(fileType) == 0 { - return fmt.Errorf("generator %q must specify a file type", g.Name()) - } - f := files[g.Filename()] - if f == nil { - // This is the first generator to reference this file, so start it. - f = &File{ - Name: g.Filename(), - FileType: fileType, - PackageName: p.Name(), - PackagePath: p.Path(), - PackageSourcePath: p.SourcePath(), - Header: p.Header(g.Filename()), - Imports: map[string]struct{}{}, - } - files[f.Name] = f - } else { - if f.FileType != g.FileType() { - return fmt.Errorf("file %q already has type %q, but generator %q wants to use type %q", f.Name, f.FileType, g.Name(), g.FileType()) - } - } - - if vars := g.PackageVars(genContext); len(vars) > 0 { - addIndentHeaderComment(&f.Vars, "Package-wide variables from generator %q.", g.Name()) - for _, v := range vars { - if _, err := fmt.Fprintf(&f.Vars, "%s\n", v); err != nil { - return err - } - } - } - if consts := g.PackageConsts(genContext); len(consts) > 0 { - addIndentHeaderComment(&f.Consts, "Package-wide consts from generator %q.", g.Name()) - for _, v := range consts { - if _, err := fmt.Fprintf(&f.Consts, "%s\n", v); err != nil { - return err - } - } - } - if err := genContext.executeBody(&f.Body, g); err != nil { - return err - } - if imports := g.Imports(genContext); len(imports) > 0 { - for _, i := range imports { - f.Imports[i] = struct{}{} - } - } - } - - var errors []error - for _, f := range files { - finalPath := filepath.Join(path, f.Name) - assembler, ok := c.FileTypes[f.FileType] - if !ok { - return fmt.Errorf("the file type %q registered for file %q does not exist in the context", f.FileType, f.Name) - } - var err error - if c.Verify { - err = assembler.VerifyFile(f, finalPath) - } else { - err = assembler.AssembleFile(f, finalPath) - } - if err != nil { - errors = append(errors, err) - } - } - if len(errors) > 0 { - return fmt.Errorf("errors in package %q:\n%v\n", p.Path(), strings.Join(errs2strings(errors), "\n")) - } - return nil -} - -func (c *Context) executeBody(w io.Writer, generator Generator) error { - et := NewErrorTracker(w) - if err := generator.Init(c, et); err != nil { - return err - } - for _, t := range c.Order { - if err := generator.GenerateType(c, t, et); err != nil { - return err - } - } - if err := generator.Finalize(c, et); err != nil { - return err - } - return et.Error() -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/generator.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/generator.go deleted file mode 100644 index 5614ae3b322c..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/generator.go +++ /dev/null @@ -1,259 +0,0 @@ -/* -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 generator - -import ( - "bytes" - "io" - - "k8s.io/gengo/namer" - "k8s.io/gengo/parser" - "k8s.io/gengo/types" -) - -// Package contains the contract for generating a package. -type Package interface { - // Name returns the package short name. - Name() string - // Path returns the package import path. - Path() string - // SourcePath returns the location of the package on disk. - SourcePath() string - - // Filter should return true if this package cares about this type. - // Otherwise, this type will be omitted from the type ordering for - // this package. - Filter(*Context, *types.Type) bool - - // Header should return a header for the file, including comment markers. - // Useful for copyright notices and doc strings. Include an - // autogeneration notice! Do not include the "package x" line. - Header(filename string) []byte - - // Generators returns the list of generators for this package. It is - // allowed for more than one generator to write to the same file. - // A Context is passed in case the list of generators depends on the - // input types. - Generators(*Context) []Generator -} - -type File struct { - Name string - FileType string - PackageName string - Header []byte - PackagePath string - PackageSourcePath string - Imports map[string]struct{} - Vars bytes.Buffer - Consts bytes.Buffer - Body bytes.Buffer -} - -type FileType interface { - AssembleFile(f *File, path string) error - VerifyFile(f *File, path string) error -} - -// Packages is a list of packages to generate. -type Packages []Package - -// Generator is the contract for anything that wants to do auto-generation. -// It's expected that the io.Writers passed to the below functions will be -// ErrorTrackers; this allows implementations to not check for io errors, -// making more readable code. -// -// The call order for the functions that take a Context is: -// 1. Filter() // Subsequent calls see only types that pass this. -// 2. Namers() // Subsequent calls see the namers provided by this. -// 3. PackageVars() -// 4. PackageConsts() -// 5. Init() -// 6. GenerateType() // Called N times, once per type in the context's Order. -// 7. Imports() -// -// You may have multiple generators for the same file. -type Generator interface { - // The name of this generator. Will be included in generated comments. - Name() string - - // Filter should return true if this generator cares about this type. - // (otherwise, GenerateType will not be called.) - // - // Filter is called before any of the generator's other functions; - // subsequent calls will get a context with only the types that passed - // this filter. - Filter(*Context, *types.Type) bool - - // If this generator needs special namers, return them here. These will - // override the original namers in the context if there is a collision. - // You may return nil if you don't need special names. These names will - // be available in the context passed to the rest of the generator's - // functions. - // - // A use case for this is to return a namer that tracks imports. - Namers(*Context) namer.NameSystems - - // Init should write an init function, and any other content that's not - // generated per-type. (It's not intended for generator specific - // initialization! Do that when your Package constructs the - // Generators.) - Init(*Context, io.Writer) error - - // Finalize should write finish up functions, and any other content that's not - // generated per-type. - Finalize(*Context, io.Writer) error - - // PackageVars should emit an array of variable lines. They will be - // placed in a var ( ... ) block. There's no need to include a leading - // \t or trailing \n. - PackageVars(*Context) []string - - // PackageConsts should emit an array of constant lines. They will be - // placed in a const ( ... ) block. There's no need to include a leading - // \t or trailing \n. - PackageConsts(*Context) []string - - // GenerateType should emit the code for a particular type. - GenerateType(*Context, *types.Type, io.Writer) error - - // Imports should return a list of necessary imports. They will be - // formatted correctly. You do not need to include quotation marks, - // return only the package name; alternatively, you can also return - // imports in the format `name "path/to/pkg"`. Imports will be called - // after Init, PackageVars, PackageConsts, and GenerateType, to allow - // you to keep track of what imports you actually need. - Imports(*Context) []string - - // Preferred file name of this generator, not including a path. It is - // allowed for multiple generators to use the same filename, but it's - // up to you to make sure they don't have colliding import names. - // TODO: provide per-file import tracking, removing the requirement - // that generators coordinate.. - Filename() string - - // A registered file type in the context to generate this file with. If - // the FileType is not found in the context, execution will stop. - FileType() string -} - -// Context is global context for individual generators to consume. -type Context struct { - // A map from the naming system to the names for that system. E.g., you - // might have public names and several private naming systems. - Namers namer.NameSystems - - // All the types, in case you want to look up something. - Universe types.Universe - - // Incoming imports, i.e. packages importing the given package. - incomingImports map[string][]string - - // Incoming transitive imports, i.e. the transitive closure of IncomingImports - incomingTransitiveImports map[string][]string - - // All the user-specified packages. This is after recursive expansion. - Inputs []string - - // The canonical ordering of the types (will be filtered by both the - // Package's and Generator's Filter methods). - Order []*types.Type - - // A set of types this context can process. If this is empty or nil, - // the default "golang" filetype will be provided. - FileTypes map[string]FileType - - // If true, Execute* calls will just verify that the existing output is - // correct. (You may set this after calling NewContext.) - Verify bool - - // Allows generators to add packages at runtime. - builder *parser.Builder - - // If specified, trim the prefix from a package's path before writing files. - TrimPathPrefix string -} - -// NewContext generates a context from the given builder, naming systems, and -// the naming system you wish to construct the canonical ordering from. -func NewContext(b *parser.Builder, nameSystems namer.NameSystems, canonicalOrderName string) (*Context, error) { - universe, err := b.FindTypes() - if err != nil { - return nil, err - } - - c := &Context{ - Namers: namer.NameSystems{}, - Universe: universe, - Inputs: b.FindPackages(), - FileTypes: map[string]FileType{ - GolangFileType: NewGolangFile(), - }, - builder: b, - } - - for name, systemNamer := range nameSystems { - c.Namers[name] = systemNamer - if name == canonicalOrderName { - orderer := namer.Orderer{Namer: systemNamer} - c.Order = orderer.OrderUniverse(universe) - } - } - return c, nil -} - -// IncomingImports returns the incoming imports for each package. The map is lazily computed. -func (ctxt *Context) IncomingImports() map[string][]string { - if ctxt.incomingImports == nil { - incoming := map[string][]string{} - for _, pkg := range ctxt.Universe { - for imp := range pkg.Imports { - incoming[imp] = append(incoming[imp], pkg.Path) - } - } - ctxt.incomingImports = incoming - } - return ctxt.incomingImports -} - -// TransitiveIncomingImports returns the transitive closure of the incoming imports for each package. -// The map is lazily computed. -func (ctxt *Context) TransitiveIncomingImports() map[string][]string { - if ctxt.incomingTransitiveImports == nil { - ctxt.incomingTransitiveImports = transitiveClosure(ctxt.IncomingImports()) - } - return ctxt.incomingTransitiveImports -} - -// AddDir adds a Go package to the context. The specified path must be a single -// go package import path. GOPATH, GOROOT, and the location of your go binary -// (`which go`) will all be searched, in the normal Go fashion. -// Deprecated. Please use AddDirectory. -func (ctxt *Context) AddDir(path string) error { - ctxt.incomingImports = nil - ctxt.incomingTransitiveImports = nil - return ctxt.builder.AddDirTo(path, &ctxt.Universe) -} - -// AddDirectory adds a Go package to the context. The specified path must be a -// single go package import path. GOPATH, GOROOT, and the location of your go -// binary (`which go`) will all be searched, in the normal Go fashion. -func (ctxt *Context) AddDirectory(path string) (*types.Package, error) { - ctxt.incomingImports = nil - ctxt.incomingTransitiveImports = nil - return ctxt.builder.AddDirectoryTo(path, &ctxt.Universe) -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/import_tracker.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/import_tracker.go deleted file mode 100644 index 99525c40ba02..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/import_tracker.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -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 generator - -import ( - "go/token" - "strings" - - "k8s.io/klog/v2" - - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// NewImportTrackerForPackage creates a new import tracker which is aware -// of a generator's output package. The tracker will not add import lines -// when symbols or types are added from the same package, and LocalNameOf -// will return empty string for the output package. -// -// e.g.: -// -// tracker := NewImportTrackerForPackage("bar.com/pkg/foo") -// tracker.AddSymbol(types.Name{"bar.com/pkg/foo.MyType"}) -// tracker.AddSymbol(types.Name{"bar.com/pkg/baz.MyType"}) -// tracker.AddSymbol(types.Name{"bar.com/pkg/baz/baz.MyType"}) -// -// tracker.LocalNameOf("bar.com/pkg/foo") -> "" -// tracker.LocalNameOf("bar.com/pkg/baz") -> "baz" -// tracker.LocalNameOf("bar.com/pkg/baz/baz") -> "bazbaz" -// tracker.ImportLines() -> {`baz "bar.com/pkg/baz"`, `bazbaz "bar.com/pkg/baz/baz"`} -func NewImportTrackerForPackage(local string, typesToAdd ...*types.Type) *namer.DefaultImportTracker { - tracker := namer.NewDefaultImportTracker(types.Name{Package: local}) - tracker.IsInvalidType = func(*types.Type) bool { return false } - tracker.LocalName = func(name types.Name) string { return golangTrackerLocalName(&tracker, name) } - tracker.PrintImport = func(path, name string) string { return name + " \"" + path + "\"" } - - tracker.AddTypes(typesToAdd...) - return &tracker -} - -func NewImportTracker(typesToAdd ...*types.Type) *namer.DefaultImportTracker { - return NewImportTrackerForPackage("", typesToAdd...) -} - -func golangTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { - path := t.Package - - // Using backslashes in package names causes gengo to produce Go code which - // will not compile with the gc compiler. See the comment on GoSeperator. - if strings.ContainsRune(path, '\\') { - klog.Warningf("Warning: backslash used in import path '%v', this is unsupported.\n", path) - } - - dirs := strings.Split(path, namer.GoSeperator) - for n := len(dirs) - 1; n >= 0; n-- { - // follow kube convention of not having anything between directory names - name := strings.Join(dirs[n:], "") - name = strings.Replace(name, "_", "", -1) - // These characters commonly appear in import paths for go - // packages, but aren't legal go names. So we'll sanitize. - name = strings.Replace(name, ".", "", -1) - name = strings.Replace(name, "-", "", -1) - if _, found := tracker.PathOf(name); found { - // This name collides with some other package - continue - } - - // If the import name is a Go keyword, prefix with an underscore. - if token.Lookup(name).IsKeyword() { - name = "_" + name - } - return name - } - panic("can't find import for " + path) -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/snippet_writer.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/snippet_writer.go deleted file mode 100644 index 590775ff228b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/snippet_writer.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -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 generator - -import ( - "fmt" - "io" - "runtime" - "text/template" -) - -// SnippetWriter is an attempt to make the template library usable. -// Methods are chainable, and you don't have to check Error() until you're all -// done. -type SnippetWriter struct { - w io.Writer - context *Context - // Left & right delimiters. text/template defaults to "{{" and "}}" - // which is totally unusable for go code based templates. - left, right string - funcMap template.FuncMap - err error -} - -// w is the destination; left and right are the delimiters; @ and $ are both -// reasonable choices. -// -// c is used to make a function for every naming system, to which you can pass -// a type and get the corresponding name. -func NewSnippetWriter(w io.Writer, c *Context, left, right string) *SnippetWriter { - sw := &SnippetWriter{ - w: w, - context: c, - left: left, - right: right, - funcMap: template.FuncMap{}, - } - for name, namer := range c.Namers { - sw.funcMap[name] = namer.Name - } - return sw -} - -// Do parses format and runs args through it. You can have arbitrary logic in -// the format (see the text/template documentation), but consider running many -// short templates with ordinary go logic in between--this may be more -// readable. Do is chainable. Any error causes every other call to do to be -// ignored, and the error will be returned by Error(). So you can check it just -// once, at the end of your function. -// -// 'args' can be quite literally anything; read the text/template documentation -// for details. Maps and structs work particularly nicely. Conveniently, the -// types package is designed to have structs that are easily referencable from -// the template language. -// -// Example: -// -// sw := generator.NewSnippetWriter(outBuffer, context, "$", "$") -// sw.Do(`The public type name is: $.type|public$`, map[string]interface{}{"type": t}) -// return sw.Error() -// -// Where: -// * "$" starts a template directive -// * "." references the entire thing passed as args -// * "type" therefore sees a map and looks up the key "type" -// * "|" means "pass the thing on the left to the thing on the right" -// * "public" is the name of a naming system, so the SnippetWriter has given -// the template a function called "public" that takes a *types.Type and -// returns the naming system's name. E.g., if the type is "string" this might -// return "String". -// * the second "$" ends the template directive. -// -// The map is actually not necessary. The below does the same thing: -// -// sw.Do(`The public type name is: $.|public$`, t) -// -// You may or may not find it more readable to use the map with a descriptive -// key, but if you want to pass more than one arg, the map or a custom struct -// becomes a requirement. You can do arbitrary logic inside these templates, -// but you should consider doing the logic in go and stitching them together -// for the sake of your readers. -// -// TODO: Change Do() to optionally take a list of pairs of parameters (key, value) -// and have it construct a combined map with that and args. -func (s *SnippetWriter) Do(format string, args interface{}) *SnippetWriter { - if s.err != nil { - return s - } - // Name the template by source file:line so it can be found when - // there's an error. - _, file, line, _ := runtime.Caller(1) - tmpl, err := template. - New(fmt.Sprintf("%s:%d", file, line)). - Delims(s.left, s.right). - Funcs(s.funcMap). - Parse(format) - if err != nil { - s.err = err - return s - } - err = tmpl.Execute(s.w, args) - if err != nil { - s.err = err - } - return s -} - -// Args exists to make it convenient to construct arguments for -// SnippetWriter.Do. -type Args map[interface{}]interface{} - -// With makes a copy of a and adds the given key, value pair. -func (a Args) With(key, value interface{}) Args { - a2 := Args{key: value} - for k, v := range a { - a2[k] = v - } - return a2 -} - -// WithArgs makes a copy of a and adds the given arguments. -func (a Args) WithArgs(rhs Args) Args { - a2 := Args{} - for k, v := range rhs { - a2[k] = v - } - for k, v := range a { - a2[k] = v - } - return a2 -} - -func (s *SnippetWriter) Out() io.Writer { - return s.w -} - -// Error returns any encountered error. -func (s *SnippetWriter) Error() error { - return s.err -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/generator/transitive_closure.go b/cluster-autoscaler/vendor/k8s.io/gengo/generator/transitive_closure.go deleted file mode 100644 index 385a49fce312..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/generator/transitive_closure.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generator - -import "sort" - -type edge struct { - from string - to string -} - -func transitiveClosure(in map[string][]string) map[string][]string { - adj := make(map[edge]bool) - imports := make(map[string]struct{}) - for from, tos := range in { - for _, to := range tos { - adj[edge{from, to}] = true - imports[to] = struct{}{} - } - } - - // Warshal's algorithm - for k := range in { - for i := range in { - if !adj[edge{i, k}] { - continue - } - for j := range imports { - if adj[edge{i, j}] { - continue - } - if adj[edge{k, j}] { - adj[edge{i, j}] = true - } - } - } - } - - out := make(map[string][]string, len(in)) - for i := range in { - for j := range imports { - if adj[edge{i, j}] { - out[i] = append(out[i], j) - } - } - - sort.Strings(out[i]) - } - - return out -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/namer/doc.go b/cluster-autoscaler/vendor/k8s.io/gengo/namer/doc.go deleted file mode 100644 index 8a44ea995973..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/namer/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -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 namer has support for making different type naming systems. -// -// This is because sometimes you want to refer to the literal type, sometimes -// you want to make a name for the thing you're generating, and you want to -// make the name based on the type. For example, if you have `type foo string`, -// you want to be able to generate something like `func FooPrinter(f *foo) { -// Print(string(*f)) }`; that is, you want to refer to a public name, a literal -// name, and the underlying literal name. -// -// This package supports the idea of a "Namer" and a set of "NameSystems" to -// support these use cases. -// -// Additionally, a "RawNamer" can optionally keep track of what needs to be -// imported. -package namer // import "k8s.io/gengo/namer" diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/namer/import_tracker.go b/cluster-autoscaler/vendor/k8s.io/gengo/namer/import_tracker.go deleted file mode 100644 index 2bf1d503f946..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/namer/import_tracker.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -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 namer - -import ( - "sort" - - "k8s.io/gengo/types" -) - -// ImportTracker may be passed to a namer.RawNamer, to track the imports needed -// for the types it names. -// -// TODO: pay attention to the package name (instead of renaming every package). -type DefaultImportTracker struct { - pathToName map[string]string - // forbidden names are in here. (e.g. "go" is a directory in which - // there is code, but "go" is not a legal name for a package, so we put - // it here to prevent us from naming any package "go") - nameToPath map[string]string - local types.Name - - // Returns true if a given types is an invalid type and should be ignored. - IsInvalidType func(*types.Type) bool - // Returns the final local name for the given name - LocalName func(types.Name) string - // Returns the "import" line for a given (path, name). - PrintImport func(string, string) string -} - -func NewDefaultImportTracker(local types.Name) DefaultImportTracker { - return DefaultImportTracker{ - pathToName: map[string]string{}, - nameToPath: map[string]string{}, - local: local, - } -} - -func (tracker *DefaultImportTracker) AddTypes(types ...*types.Type) { - for _, t := range types { - tracker.AddType(t) - } -} -func (tracker *DefaultImportTracker) AddSymbol(symbol types.Name) { - if tracker.local.Package == symbol.Package { - return - } - - if len(symbol.Package) == 0 { - return - } - path := symbol.Path - if len(path) == 0 { - path = symbol.Package - } - if _, ok := tracker.pathToName[path]; ok { - return - } - - name := tracker.LocalName(symbol) - tracker.nameToPath[name] = path - tracker.pathToName[path] = name -} - -func (tracker *DefaultImportTracker) AddType(t *types.Type) { - if tracker.local.Package == t.Name.Package { - return - } - - if tracker.IsInvalidType(t) { - if t.Kind == types.Builtin { - return - } - if _, ok := tracker.nameToPath[t.Name.Package]; !ok { - tracker.nameToPath[t.Name.Package] = "" - } - return - } - - tracker.AddSymbol(t.Name) -} - -func (tracker *DefaultImportTracker) ImportLines() []string { - importPaths := []string{} - for path := range tracker.pathToName { - importPaths = append(importPaths, path) - } - sort.Sort(sort.StringSlice(importPaths)) - out := []string{} - for _, path := range importPaths { - out = append(out, tracker.PrintImport(path, tracker.pathToName[path])) - } - return out -} - -// LocalNameOf returns the name you would use to refer to the package at the -// specified path within the body of a file. -func (tracker *DefaultImportTracker) LocalNameOf(path string) string { - return tracker.pathToName[path] -} - -// PathOf returns the path that a given localName is referring to within the -// body of a file. -func (tracker *DefaultImportTracker) PathOf(localName string) (string, bool) { - name, ok := tracker.nameToPath[localName] - return name, ok -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/namer/namer.go b/cluster-autoscaler/vendor/k8s.io/gengo/namer/namer.go deleted file mode 100644 index a0f1a24abe94..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/namer/namer.go +++ /dev/null @@ -1,395 +0,0 @@ -/* -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 namer - -import ( - "fmt" - "path/filepath" - "strconv" - "strings" - - "k8s.io/gengo/types" -) - -const ( - // GoSeperator is used to split go import paths. - // Forward slash is used instead of filepath.Seperator because it is the - // only universally-accepted path delimiter and the only delimiter not - // potentially forbidden by Go compilers. (In particular gc does not allow - // the use of backslashes in import paths.) - // See https://golang.org/ref/spec#Import_declarations. - // See also https://github.com/kubernetes/gengo/issues/83#issuecomment-367040772. - GoSeperator = "/" -) - -// Returns whether a name is a private Go name. -func IsPrivateGoName(name string) bool { - return len(name) == 0 || strings.ToLower(name[:1]) == name[:1] -} - -// NewPublicNamer is a helper function that returns a namer that makes -// CamelCase names. See the NameStrategy struct for an explanation of the -// arguments to this constructor. -func NewPublicNamer(prependPackageNames int, ignoreWords ...string) *NameStrategy { - n := &NameStrategy{ - Join: Joiner(IC, IC), - IgnoreWords: map[string]bool{}, - PrependPackageNames: prependPackageNames, - } - for _, w := range ignoreWords { - n.IgnoreWords[w] = true - } - return n -} - -// NewPrivateNamer is a helper function that returns a namer that makes -// camelCase names. See the NameStrategy struct for an explanation of the -// arguments to this constructor. -func NewPrivateNamer(prependPackageNames int, ignoreWords ...string) *NameStrategy { - n := &NameStrategy{ - Join: Joiner(IL, IC), - IgnoreWords: map[string]bool{}, - PrependPackageNames: prependPackageNames, - } - for _, w := range ignoreWords { - n.IgnoreWords[w] = true - } - return n -} - -// NewRawNamer will return a Namer that makes a name by which you would -// directly refer to a type, optionally keeping track of the import paths -// necessary to reference the names it provides. Tracker may be nil. -// The 'pkg' is the full package name, in which the Namer is used - all -// types from that package will be referenced by just type name without -// referencing the package. -// -// For example, if the type is map[string]int, a raw namer will literally -// return "map[string]int". -// -// Or if the type, in package foo, is "type Bar struct { ... }", then the raw -// namer will return "foo.Bar" as the name of the type, and if 'tracker' was -// not nil, will record that package foo needs to be imported. -func NewRawNamer(pkg string, tracker ImportTracker) *rawNamer { - return &rawNamer{pkg: pkg, tracker: tracker} -} - -// Names is a map from Type to name, as defined by some Namer. -type Names map[*types.Type]string - -// Namer takes a type, and assigns a name. -// -// The purpose of this complexity is so that you can assign coherent -// side-by-side systems of names for the types. For example, you might want a -// public interface, a private implementation struct, and also to reference -// literally the type name. -// -// Note that it is safe to call your own Name() function recursively to find -// the names of keys, elements, etc. This is because anonymous types can't have -// cycles in their names, and named types don't require the sort of recursion -// that would be problematic. -type Namer interface { - Name(*types.Type) string -} - -// NameSystems is a map of a system name to a namer for that system. -type NameSystems map[string]Namer - -// NameStrategy is a general Namer. The easiest way to use it is to copy the -// Public/PrivateNamer variables, and modify the members you wish to change. -// -// The Name method produces a name for the given type, of the forms: -// Anonymous types: -// Named types: -// -// In all cases, every part of the name is run through the capitalization -// functions. -// -// The IgnoreWords map can be set if you have directory names that are -// semantically meaningless for naming purposes, e.g. "proto". -// -// Prefix and Suffix can be used to disambiguate parallel systems of type -// names. For example, if you want to generate an interface and an -// implementation, you might want to suffix one with "Interface" and the other -// with "Implementation". Another common use-- if you want to generate private -// types, and one of your source types could be "string", you can't use the -// default lowercase private namer. You'll have to add a suffix or prefix. -type NameStrategy struct { - Prefix, Suffix string - Join func(pre string, parts []string, post string) string - - // Add non-meaningful package directory names here (e.g. "proto") and - // they will be ignored. - IgnoreWords map[string]bool - - // If > 0, prepend exactly that many package directory names (or as - // many as there are). Package names listed in "IgnoreWords" will be - // ignored. - // - // For example, if Ignore words lists "proto" and type Foo is in - // pkg/server/frobbing/proto, then a value of 1 will give a type name - // of FrobbingFoo, 2 gives ServerFrobbingFoo, etc. - PrependPackageNames int - - // A cache of names thus far assigned by this namer. - Names -} - -// IC ensures the first character is uppercase. -func IC(in string) string { - if in == "" { - return in - } - return strings.ToUpper(in[:1]) + in[1:] -} - -// IL ensures the first character is lowercase. -func IL(in string) string { - if in == "" { - return in - } - return strings.ToLower(in[:1]) + in[1:] -} - -// Joiner lets you specify functions that preprocess the various components of -// a name before joining them. You can construct e.g. camelCase or CamelCase or -// any other way of joining words. (See the IC and IL convenience functions.) -func Joiner(first, others func(string) string) func(pre string, in []string, post string) string { - return func(pre string, in []string, post string) string { - tmp := []string{others(pre)} - for i := range in { - tmp = append(tmp, others(in[i])) - } - tmp = append(tmp, others(post)) - return first(strings.Join(tmp, "")) - } -} - -func (ns *NameStrategy) removePrefixAndSuffix(s string) string { - // The join function may have changed capitalization. - lowerIn := strings.ToLower(s) - lowerP := strings.ToLower(ns.Prefix) - lowerS := strings.ToLower(ns.Suffix) - b, e := 0, len(s) - if strings.HasPrefix(lowerIn, lowerP) { - b = len(ns.Prefix) - } - if strings.HasSuffix(lowerIn, lowerS) { - e -= len(ns.Suffix) - } - return s[b:e] -} - -var ( - importPathNameSanitizer = strings.NewReplacer("-", "_", ".", "") -) - -// filters out unwanted directory names and sanitizes remaining names. -func (ns *NameStrategy) filterDirs(path string) []string { - allDirs := strings.Split(path, GoSeperator) - dirs := make([]string, 0, len(allDirs)) - for _, p := range allDirs { - if ns.IgnoreWords == nil || !ns.IgnoreWords[p] { - dirs = append(dirs, importPathNameSanitizer.Replace(p)) - } - } - return dirs -} - -// See the comment on NameStrategy. -func (ns *NameStrategy) Name(t *types.Type) string { - if ns.Names == nil { - ns.Names = Names{} - } - if s, ok := ns.Names[t]; ok { - return s - } - - if t.Name.Package != "" { - dirs := append(ns.filterDirs(t.Name.Package), t.Name.Name) - i := ns.PrependPackageNames + 1 - dn := len(dirs) - if i > dn { - i = dn - } - name := ns.Join(ns.Prefix, dirs[dn-i:], ns.Suffix) - ns.Names[t] = name - return name - } - - // Only anonymous types remain. - var name string - switch t.Kind { - case types.Builtin: - name = ns.Join(ns.Prefix, []string{t.Name.Name}, ns.Suffix) - case types.Map: - name = ns.Join(ns.Prefix, []string{ - "Map", - ns.removePrefixAndSuffix(ns.Name(t.Key)), - "To", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Slice: - name = ns.Join(ns.Prefix, []string{ - "Slice", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Array: - name = ns.Join(ns.Prefix, []string{ - "Array", - ns.removePrefixAndSuffix(fmt.Sprintf("%d", t.Len)), - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Pointer: - name = ns.Join(ns.Prefix, []string{ - "Pointer", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Struct: - names := []string{"Struct"} - for _, m := range t.Members { - names = append(names, ns.removePrefixAndSuffix(ns.Name(m.Type))) - } - name = ns.Join(ns.Prefix, names, ns.Suffix) - case types.Chan: - name = ns.Join(ns.Prefix, []string{ - "Chan", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Interface: - // TODO: add to name test - names := []string{"Interface"} - for _, m := range t.Methods { - // TODO: include function signature - names = append(names, m.Name.Name) - } - name = ns.Join(ns.Prefix, names, ns.Suffix) - case types.Func: - // TODO: add to name test - parts := []string{"Func"} - for _, pt := range t.Signature.Parameters { - parts = append(parts, ns.removePrefixAndSuffix(ns.Name(pt))) - } - parts = append(parts, "Returns") - for _, rt := range t.Signature.Results { - parts = append(parts, ns.removePrefixAndSuffix(ns.Name(rt))) - } - name = ns.Join(ns.Prefix, parts, ns.Suffix) - default: - name = "unnameable_" + string(t.Kind) - } - ns.Names[t] = name - return name -} - -// ImportTracker allows a raw namer to keep track of the packages needed for -// import. You can implement yourself or use the one in the generation package. -type ImportTracker interface { - AddType(*types.Type) - AddSymbol(types.Name) - LocalNameOf(packagePath string) string - PathOf(localName string) (string, bool) - ImportLines() []string -} - -type rawNamer struct { - pkg string - tracker ImportTracker - Names -} - -// Name makes a name the way you'd write it to literally refer to type t, -// making ordinary assumptions about how you've imported t's package (or using -// r.tracker to specifically track the package imports). -func (r *rawNamer) Name(t *types.Type) string { - if r.Names == nil { - r.Names = Names{} - } - if name, ok := r.Names[t]; ok { - return name - } - if t.Name.Package != "" { - var name string - if r.tracker != nil { - r.tracker.AddType(t) - if t.Name.Package == r.pkg { - name = t.Name.Name - } else { - name = r.tracker.LocalNameOf(t.Name.Package) + "." + t.Name.Name - } - } else { - if t.Name.Package == r.pkg { - name = t.Name.Name - } else { - name = filepath.Base(t.Name.Package) + "." + t.Name.Name - } - } - r.Names[t] = name - return name - } - var name string - switch t.Kind { - case types.Builtin: - name = t.Name.Name - case types.Map: - name = "map[" + r.Name(t.Key) + "]" + r.Name(t.Elem) - case types.Slice: - name = "[]" + r.Name(t.Elem) - case types.Array: - l := strconv.Itoa(int(t.Len)) - name = "[" + l + "]" + r.Name(t.Elem) - case types.Pointer: - name = "*" + r.Name(t.Elem) - case types.Struct: - elems := []string{} - for _, m := range t.Members { - elems = append(elems, m.Name+" "+r.Name(m.Type)) - } - name = "struct{" + strings.Join(elems, "; ") + "}" - case types.Chan: - // TODO: include directionality - name = "chan " + r.Name(t.Elem) - case types.Interface: - // TODO: add to name test - elems := []string{} - for _, m := range t.Methods { - // TODO: include function signature - elems = append(elems, m.Name.Name) - } - name = "interface{" + strings.Join(elems, "; ") + "}" - case types.Func: - // TODO: add to name test - params := []string{} - for _, pt := range t.Signature.Parameters { - params = append(params, r.Name(pt)) - } - results := []string{} - for _, rt := range t.Signature.Results { - results = append(results, r.Name(rt)) - } - name = "func(" + strings.Join(params, ",") + ")" - if len(results) == 1 { - name += " " + results[0] - } else if len(results) > 1 { - name += " (" + strings.Join(results, ",") + ")" - } - default: - name = "unnameable_" + string(t.Kind) - } - r.Names[t] = name - return name -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/namer/order.go b/cluster-autoscaler/vendor/k8s.io/gengo/namer/order.go deleted file mode 100644 index fd89be9b0837..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/namer/order.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -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 namer - -import ( - "sort" - - "k8s.io/gengo/types" -) - -// Orderer produces an ordering of types given a Namer. -type Orderer struct { - Namer -} - -// OrderUniverse assigns a name to every type in the Universe, including Types, -// Functions and Variables, and returns a list sorted by those names. -func (o *Orderer) OrderUniverse(u types.Universe) []*types.Type { - list := tList{ - namer: o.Namer, - } - for _, p := range u { - for _, t := range p.Types { - list.types = append(list.types, t) - } - for _, f := range p.Functions { - list.types = append(list.types, f) - } - for _, v := range p.Variables { - list.types = append(list.types, v) - } - for _, v := range p.Constants { - list.types = append(list.types, v) - } - } - sort.Sort(list) - return list.types -} - -// OrderTypes assigns a name to every type, and returns a list sorted by those -// names. -func (o *Orderer) OrderTypes(typeList []*types.Type) []*types.Type { - list := tList{ - namer: o.Namer, - types: typeList, - } - sort.Sort(list) - return list.types -} - -type tList struct { - namer Namer - types []*types.Type -} - -func (t tList) Len() int { return len(t.types) } -func (t tList) Less(i, j int) bool { return t.namer.Name(t.types[i]) < t.namer.Name(t.types[j]) } -func (t tList) Swap(i, j int) { t.types[i], t.types[j] = t.types[j], t.types[i] } diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/namer/plural_namer.go b/cluster-autoscaler/vendor/k8s.io/gengo/namer/plural_namer.go deleted file mode 100644 index 0e3ebbf262a7..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/namer/plural_namer.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -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 namer - -import ( - "strings" - - "k8s.io/gengo/types" -) - -var consonants = "bcdfghjklmnpqrstvwxyz" - -type pluralNamer struct { - // key is the case-sensitive type name, value is the case-insensitive - // intended output. - exceptions map[string]string - finalize func(string) string -} - -// NewPublicPluralNamer returns a namer that returns the plural form of the input -// type's name, starting with a uppercase letter. -func NewPublicPluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, IC} -} - -// NewPrivatePluralNamer returns a namer that returns the plural form of the input -// type's name, starting with a lowercase letter. -func NewPrivatePluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, IL} -} - -// NewAllLowercasePluralNamer returns a namer that returns the plural form of the input -// type's name, with all letters in lowercase. -func NewAllLowercasePluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, strings.ToLower} -} - -// Name returns the plural form of the type's name. If the type's name is found -// in the exceptions map, the map value is returned. -func (r *pluralNamer) Name(t *types.Type) string { - singular := t.Name.Name - var plural string - var ok bool - if plural, ok = r.exceptions[singular]; ok { - return r.finalize(plural) - } - if len(singular) < 2 { - return r.finalize(singular) - } - - switch rune(singular[len(singular)-1]) { - case 's', 'x', 'z': - plural = esPlural(singular) - case 'y': - sl := rune(singular[len(singular)-2]) - if isConsonant(sl) { - plural = iesPlural(singular) - } else { - plural = sPlural(singular) - } - case 'h': - sl := rune(singular[len(singular)-2]) - if sl == 'c' || sl == 's' { - plural = esPlural(singular) - } else { - plural = sPlural(singular) - } - case 'e': - sl := rune(singular[len(singular)-2]) - if sl == 'f' { - plural = vesPlural(singular[:len(singular)-1]) - } else { - plural = sPlural(singular) - } - case 'f': - plural = vesPlural(singular) - default: - plural = sPlural(singular) - } - return r.finalize(plural) -} - -func iesPlural(singular string) string { - return singular[:len(singular)-1] + "ies" -} - -func vesPlural(singular string) string { - return singular[:len(singular)-1] + "ves" -} - -func esPlural(singular string) string { - return singular + "es" -} - -func sPlural(singular string) string { - return singular + "s" -} - -func isConsonant(char rune) bool { - for _, c := range consonants { - if char == c { - return true - } - } - return false -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/parser/doc.go b/cluster-autoscaler/vendor/k8s.io/gengo/parser/doc.go deleted file mode 100644 index 8231b6d43203..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/parser/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -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 parser provides code to parse go files, type-check them, extract the -// types. -package parser // import "k8s.io/gengo/parser" diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/parser/parse.go b/cluster-autoscaler/vendor/k8s.io/gengo/parser/parse.go deleted file mode 100644 index bbd719295e6e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/parser/parse.go +++ /dev/null @@ -1,925 +0,0 @@ -/* -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 parser - -import ( - "fmt" - "go/ast" - "go/build" - "go/constant" - "go/parser" - "go/token" - tc "go/types" - "io/ioutil" - "os" - "os/exec" - "path" - "path/filepath" - "regexp" - "sort" - "strings" - - "k8s.io/gengo/types" - "k8s.io/klog/v2" -) - -// This clarifies when a pkg path has been canonicalized. -type importPathString string - -// Builder lets you add all the go files in all the packages that you care -// about, then constructs the type source data. -type Builder struct { - context *build.Context - - // If true, include *_test.go - IncludeTestFiles bool - - // Map of package names to more canonical information about the package. - // This might hold the same value for multiple names, e.g. if someone - // referenced ./pkg/name or in the case of vendoring, which canonicalizes - // differently that what humans would type. - // - // This must only be accessed via getLoadedBuildPackage and setLoadedBuildPackage - buildPackages map[importPathString]*build.Package - - fset *token.FileSet - // map of package path to list of parsed files - parsed map[importPathString][]parsedFile - // map of package path to absolute path (to prevent overlap) - absPaths map[importPathString]string - - // Set by typeCheckPackage(), used by importPackage() and friends. - typeCheckedPackages map[importPathString]*tc.Package - - // Map of package path to whether the user requested it or it was from - // an import. - userRequested map[importPathString]bool - - // All comments from everywhere in every parsed file. - endLineToCommentGroup map[fileLine]*ast.CommentGroup - - // map of package to list of packages it imports. - importGraph map[importPathString]map[string]struct{} -} - -// parsedFile is for tracking files with name -type parsedFile struct { - name string - file *ast.File -} - -// key type for finding comments. -type fileLine struct { - file string - line int -} - -// New constructs a new builder. -func New() *Builder { - c := build.Default - if c.GOROOT == "" { - if p, err := exec.Command("which", "go").CombinedOutput(); err == nil { - // The returned string will have some/path/bin/go, so remove the last two elements. - c.GOROOT = filepath.Dir(filepath.Dir(strings.Trim(string(p), "\n"))) - } else { - klog.Warningf("Warning: $GOROOT not set, and unable to run `which go` to find it: %v\n", err) - } - } - // Force this to off, since we don't properly parse CGo. All symbols must - // have non-CGo equivalents. - c.CgoEnabled = false - return &Builder{ - context: &c, - buildPackages: map[importPathString]*build.Package{}, - typeCheckedPackages: map[importPathString]*tc.Package{}, - fset: token.NewFileSet(), - parsed: map[importPathString][]parsedFile{}, - absPaths: map[importPathString]string{}, - userRequested: map[importPathString]bool{}, - endLineToCommentGroup: map[fileLine]*ast.CommentGroup{}, - importGraph: map[importPathString]map[string]struct{}{}, - } -} - -// AddBuildTags adds the specified build tags to the parse context. -func (b *Builder) AddBuildTags(tags ...string) { - b.context.BuildTags = append(b.context.BuildTags, tags...) -} - -func (b *Builder) getLoadedBuildPackage(importPath string) (*build.Package, bool) { - canonicalized := canonicalizeImportPath(importPath) - if string(canonicalized) != importPath { - klog.V(5).Infof("getLoadedBuildPackage: %s normalized to %s", importPath, canonicalized) - } - buildPkg, ok := b.buildPackages[canonicalized] - return buildPkg, ok -} -func (b *Builder) setLoadedBuildPackage(importPath string, buildPkg *build.Package) { - canonicalizedImportPath := canonicalizeImportPath(importPath) - if string(canonicalizedImportPath) != importPath { - klog.V(5).Infof("setLoadedBuildPackage: importPath %s normalized to %s", importPath, canonicalizedImportPath) - } - - canonicalizedBuildPkgImportPath := canonicalizeImportPath(buildPkg.ImportPath) - if string(canonicalizedBuildPkgImportPath) != buildPkg.ImportPath { - klog.V(5).Infof("setLoadedBuildPackage: buildPkg.ImportPath %s normalized to %s", buildPkg.ImportPath, canonicalizedBuildPkgImportPath) - } - - if canonicalizedImportPath != canonicalizedBuildPkgImportPath { - klog.V(5).Infof("setLoadedBuildPackage: normalized importPath (%s) differs from buildPkg.ImportPath (%s)", canonicalizedImportPath, canonicalizedBuildPkgImportPath) - } - b.buildPackages[canonicalizedImportPath] = buildPkg - b.buildPackages[canonicalizedBuildPkgImportPath] = buildPkg -} - -// Get package information from the go/build package. Automatically excludes -// e.g. test files and files for other platforms-- there is quite a bit of -// logic of that nature in the build package. -func (b *Builder) importBuildPackage(dir string) (*build.Package, error) { - if buildPkg, ok := b.getLoadedBuildPackage(dir); ok { - return buildPkg, nil - } - // This validates the `package foo // github.com/bar/foo` comments. - buildPkg, err := b.importWithMode(dir, build.ImportComment) - if err != nil { - if _, ok := err.(*build.NoGoError); !ok { - return nil, fmt.Errorf("unable to import %q: %v", dir, err) - } - } - if buildPkg == nil { - // Might be an empty directory. Try to just find the dir. - buildPkg, err = b.importWithMode(dir, build.FindOnly) - if err != nil { - return nil, err - } - } - - // Remember it under the user-provided name. - klog.V(5).Infof("saving buildPackage %s", dir) - b.setLoadedBuildPackage(dir, buildPkg) - - return buildPkg, nil -} - -// AddFileForTest adds a file to the set, without verifying that the provided -// pkg actually exists on disk. The pkg must be of the form "canonical/pkg/path" -// and the path must be the absolute path to the file. Because this bypasses -// the normal recursive finding of package dependencies (on disk), test should -// sort their test files topologically first, so all deps are resolved by the -// time we need them. -func (b *Builder) AddFileForTest(pkg string, path string, src []byte) error { - if err := b.addFile(importPathString(pkg), path, src, true); err != nil { - return err - } - if _, err := b.typeCheckPackage(importPathString(pkg), true); err != nil { - return err - } - return nil -} - -// addFile adds a file to the set. The pkgPath must be of the form -// "canonical/pkg/path" and the path must be the absolute path to the file. A -// flag indicates whether this file was user-requested or just from following -// the import graph. -func (b *Builder) addFile(pkgPath importPathString, path string, src []byte, userRequested bool) error { - for _, p := range b.parsed[pkgPath] { - if path == p.name { - klog.V(5).Infof("addFile %s %s already parsed, skipping", pkgPath, path) - return nil - } - } - klog.V(6).Infof("addFile %s %s", pkgPath, path) - p, err := parser.ParseFile(b.fset, path, src, parser.DeclarationErrors|parser.ParseComments) - if err != nil { - return err - } - - // This is redundant with addDir, but some tests call AddFileForTest, which - // call into here without calling addDir. - b.userRequested[pkgPath] = userRequested || b.userRequested[pkgPath] - - b.parsed[pkgPath] = append(b.parsed[pkgPath], parsedFile{path, p}) - for _, c := range p.Comments { - position := b.fset.Position(c.End()) - b.endLineToCommentGroup[fileLine{position.Filename, position.Line}] = c - } - - // We have to get the packages from this specific file, in case the - // user added individual files instead of entire directories. - if b.importGraph[pkgPath] == nil { - b.importGraph[pkgPath] = map[string]struct{}{} - } - for _, im := range p.Imports { - importedPath := strings.Trim(im.Path.Value, `"`) - b.importGraph[pkgPath][importedPath] = struct{}{} - } - return nil -} - -// AddDir adds an entire directory, scanning it for go files. 'dir' should have -// a single go package in it. GOPATH, GOROOT, and the location of your go -// binary (`which go`) will all be searched if dir doesn't literally resolve. -func (b *Builder) AddDir(dir string) error { - _, err := b.importPackage(dir, true) - return err -} - -// AddDirRecursive is just like AddDir, but it also recursively adds -// subdirectories; it returns an error only if the path couldn't be resolved; -// any directories recursed into without go source are ignored. -func (b *Builder) AddDirRecursive(dir string) error { - // Add the root. - if _, err := b.importPackage(dir, true); err != nil { - klog.Warningf("Ignoring directory %v: %v", dir, err) - } - - // filepath.Walk does not follow symlinks. We therefore evaluate symlinks and use that with - // filepath.Walk. - buildPkg, ok := b.getLoadedBuildPackage(dir) - if !ok { - return fmt.Errorf("no loaded build package for %s", dir) - } - realPath, err := filepath.EvalSymlinks(buildPkg.Dir) - if err != nil { - return err - } - - fn := func(filePath string, info os.FileInfo, err error) error { - if info != nil && info.IsDir() { - rel := filepath.ToSlash(strings.TrimPrefix(filePath, realPath)) - if rel != "" { - // Make a pkg path. - buildPkg, ok := b.getLoadedBuildPackage(dir) - if !ok { - return fmt.Errorf("no loaded build package for %s", dir) - } - pkg := path.Join(string(canonicalizeImportPath(buildPkg.ImportPath)), rel) - - // Add it. - if _, err := b.importPackage(pkg, true); err != nil { - klog.Warningf("Ignoring child directory %v: %v", pkg, err) - } - } - } - return nil - } - if err := filepath.Walk(realPath, fn); err != nil { - return err - } - return nil -} - -// AddDirTo adds an entire directory to a given Universe. Unlike AddDir, this -// processes the package immediately, which makes it safe to use from within a -// generator (rather than just at init time. 'dir' must be a single go package. -// GOPATH, GOROOT, and the location of your go binary (`which go`) will all be -// searched if dir doesn't literally resolve. -// Deprecated. Please use AddDirectoryTo. -func (b *Builder) AddDirTo(dir string, u *types.Universe) error { - // We want all types from this package, as if they were directly added - // by the user. They WERE added by the user, in effect. - if _, err := b.importPackage(dir, true); err != nil { - return err - } - pkg, ok := b.getLoadedBuildPackage(dir) - if !ok { - return fmt.Errorf("no such package: %q", dir) - } - return b.findTypesIn(canonicalizeImportPath(pkg.ImportPath), u) -} - -// AddDirectoryTo adds an entire directory to a given Universe. Unlike AddDir, -// this processes the package immediately, which makes it safe to use from -// within a generator (rather than just at init time. 'dir' must be a single go -// package. GOPATH, GOROOT, and the location of your go binary (`which go`) -// will all be searched if dir doesn't literally resolve. -func (b *Builder) AddDirectoryTo(dir string, u *types.Universe) (*types.Package, error) { - // We want all types from this package, as if they were directly added - // by the user. They WERE added by the user, in effect. - if _, err := b.importPackage(dir, true); err != nil { - return nil, err - } - pkg, ok := b.getLoadedBuildPackage(dir) - if !ok || pkg == nil { - return nil, fmt.Errorf("no such package: %q", dir) - } - path := canonicalizeImportPath(pkg.ImportPath) - if err := b.findTypesIn(path, u); err != nil { - return nil, err - } - return u.Package(string(path)), nil -} - -// The implementation of AddDir. A flag indicates whether this directory was -// user-requested or just from following the import graph. -func (b *Builder) addDir(dir string, userRequested bool) error { - klog.V(5).Infof("addDir %s", dir) - buildPkg, err := b.importBuildPackage(dir) - if err != nil { - return err - } - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - pkgPath := canonicalPackage - if dir != string(canonicalPackage) { - klog.V(5).Infof("addDir %s, canonical path is %s", dir, pkgPath) - } - - // Sanity check the pkg dir has not changed. - if prev, found := b.absPaths[pkgPath]; found { - if buildPkg.Dir != prev { - return fmt.Errorf("package %q (%s) previously resolved to %s", pkgPath, buildPkg.Dir, prev) - } - } else { - b.absPaths[pkgPath] = buildPkg.Dir - } - - files := []string{} - files = append(files, buildPkg.GoFiles...) - if b.IncludeTestFiles { - files = append(files, buildPkg.TestGoFiles...) - } - - for _, file := range files { - if !strings.HasSuffix(file, ".go") { - continue - } - absPath := filepath.Join(buildPkg.Dir, file) - data, err := ioutil.ReadFile(absPath) - if err != nil { - return fmt.Errorf("while loading %q: %v", absPath, err) - } - err = b.addFile(pkgPath, absPath, data, userRequested) - if err != nil { - return fmt.Errorf("while parsing %q: %v", absPath, err) - } - } - return nil -} - -// regexErrPackageNotFound helps test the expected error for not finding a package. -var regexErrPackageNotFound = regexp.MustCompile(`^unable to import ".*?":.*`) - -func isErrPackageNotFound(err error) bool { - return regexErrPackageNotFound.MatchString(err.Error()) -} - -// importPackage is a function that will be called by the type check package when it -// needs to import a go package. 'path' is the import path. -func (b *Builder) importPackage(dir string, userRequested bool) (*tc.Package, error) { - klog.V(5).Infof("importPackage %s", dir) - - var pkgPath = importPathString(dir) - - // Get the canonical path if we can. - if buildPkg, _ := b.getLoadedBuildPackage(dir); buildPkg != nil { - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - klog.V(5).Infof("importPackage %s, canonical path is %s", dir, canonicalPackage) - pkgPath = canonicalPackage - } - - // If we have not seen this before, process it now. - ignoreError := false - if _, found := b.parsed[pkgPath]; !found { - // Ignore errors in paths that we're importing solely because - // they're referenced by other packages. - ignoreError = true - - // Add it. - if err := b.addDir(dir, userRequested); err != nil { - if isErrPackageNotFound(err) { - klog.V(6).Info(err) - return nil, nil - } - - return nil, err - } - - // Get the canonical path now that it has been added. - if buildPkg, _ := b.getLoadedBuildPackage(dir); buildPkg != nil { - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - klog.V(5).Infof("importPackage %s, canonical path is %s", dir, canonicalPackage) - pkgPath = canonicalPackage - } - } - - // If it was previously known, just check that the user-requestedness hasn't - // changed. - b.userRequested[pkgPath] = userRequested || b.userRequested[pkgPath] - - // Run the type checker. We may end up doing this to pkgs that are already - // done, or are in the queue to be done later, but it will short-circuit, - // and we can't miss pkgs that are only depended on. - pkg, err := b.typeCheckPackage(pkgPath, !ignoreError) - if err != nil { - switch { - case ignoreError && pkg != nil: - klog.V(4).Infof("type checking encountered some issues in %q, but ignoring.\n", pkgPath) - case !ignoreError && pkg != nil: - klog.V(3).Infof("type checking encountered some errors in %q\n", pkgPath) - return nil, err - default: - return nil, err - } - } - - return pkg, nil -} - -type importAdapter struct { - b *Builder -} - -func (a importAdapter) Import(path string) (*tc.Package, error) { - return a.b.importPackage(path, false) -} - -// typeCheckPackage will attempt to return the package even if there are some -// errors, so you may check whether the package is nil or not even if you get -// an error. -func (b *Builder) typeCheckPackage(pkgPath importPathString, logErr bool) (*tc.Package, error) { - klog.V(5).Infof("typeCheckPackage %s", pkgPath) - if pkg, ok := b.typeCheckedPackages[pkgPath]; ok { - if pkg != nil { - klog.V(6).Infof("typeCheckPackage %s already done", pkgPath) - return pkg, nil - } - // We store a nil right before starting work on a package. So - // if we get here and it's present and nil, that means there's - // another invocation of this function on the call stack - // already processing this package. - return nil, fmt.Errorf("circular dependency for %q", pkgPath) - } - parsedFiles, ok := b.parsed[pkgPath] - if !ok { - return nil, fmt.Errorf("No files for pkg %q", pkgPath) - } - files := make([]*ast.File, len(parsedFiles)) - for i := range parsedFiles { - files[i] = parsedFiles[i].file - } - b.typeCheckedPackages[pkgPath] = nil - c := tc.Config{ - IgnoreFuncBodies: true, - // Note that importAdapter can call b.importPackage which calls this - // method. So there can't be cycles in the import graph. - Importer: importAdapter{b}, - Error: func(err error) { - if logErr { - klog.V(2).Infof("type checker: %v\n", err) - } else { - klog.V(3).Infof("type checker: %v\n", err) - } - }, - } - pkg, err := c.Check(string(pkgPath), b.fset, files, nil) - b.typeCheckedPackages[pkgPath] = pkg // record the result whether or not there was an error - return pkg, err -} - -// FindPackages fetches a list of the user-imported packages. -// Note that you need to call b.FindTypes() first. -func (b *Builder) FindPackages() []string { - // Iterate packages in a predictable order. - pkgPaths := []string{} - for k := range b.typeCheckedPackages { - pkgPaths = append(pkgPaths, string(k)) - } - sort.Strings(pkgPaths) - - result := []string{} - for _, pkgPath := range pkgPaths { - if b.userRequested[importPathString(pkgPath)] { - // Since walkType is recursive, all types that are in packages that - // were directly mentioned will be included. We don't need to - // include all types in all transitive packages, though. - result = append(result, pkgPath) - } - } - return result -} - -// FindTypes finalizes the package imports, and searches through all the -// packages for types. -func (b *Builder) FindTypes() (types.Universe, error) { - // Take a snapshot of pkgs to iterate, since this will recursively mutate - // b.parsed. Iterate in a predictable order. - pkgPaths := []string{} - for pkgPath := range b.parsed { - pkgPaths = append(pkgPaths, string(pkgPath)) - } - sort.Strings(pkgPaths) - - u := types.Universe{} - for _, pkgPath := range pkgPaths { - if err := b.findTypesIn(importPathString(pkgPath), &u); err != nil { - return nil, err - } - } - return u, nil -} - -// addCommentsToType takes any accumulated comment lines prior to obj and -// attaches them to the type t. -func (b *Builder) addCommentsToType(obj tc.Object, t *types.Type) { - c1 := b.priorCommentLines(obj.Pos(), 1) - // c1.Text() is safe if c1 is nil - t.CommentLines = splitLines(c1.Text()) - if c1 == nil { - t.SecondClosestCommentLines = splitLines(b.priorCommentLines(obj.Pos(), 2).Text()) - } else { - t.SecondClosestCommentLines = splitLines(b.priorCommentLines(c1.List[0].Slash, 2).Text()) - } -} - -// findTypesIn finalizes the package import and searches through the package -// for types. -func (b *Builder) findTypesIn(pkgPath importPathString, u *types.Universe) error { - klog.V(5).Infof("findTypesIn %s", pkgPath) - pkg := b.typeCheckedPackages[pkgPath] - if pkg == nil { - return fmt.Errorf("findTypesIn(%s): package is not known", pkgPath) - } - if !b.userRequested[pkgPath] { - // Since walkType is recursive, all types that the - // packages they asked for depend on will be included. - // But we don't need to include all types in all - // *packages* they depend on. - klog.V(5).Infof("findTypesIn %s: package is not user requested", pkgPath) - return nil - } - - // We're keeping this package. This call will create the record. - u.Package(string(pkgPath)).Name = pkg.Name() - u.Package(string(pkgPath)).Path = pkg.Path() - u.Package(string(pkgPath)).SourcePath = b.absPaths[pkgPath] - - for _, f := range b.parsed[pkgPath] { - if _, fileName := filepath.Split(f.name); fileName == "doc.go" { - tp := u.Package(string(pkgPath)) - // findTypesIn might be called multiple times. Clean up tp.Comments - // to avoid repeatedly fill same comments to it. - tp.Comments = []string{} - for i := range f.file.Comments { - tp.Comments = append(tp.Comments, splitLines(f.file.Comments[i].Text())...) - } - if f.file.Doc != nil { - tp.DocComments = splitLines(f.file.Doc.Text()) - } - } - } - - s := pkg.Scope() - for _, n := range s.Names() { - obj := s.Lookup(n) - tn, ok := obj.(*tc.TypeName) - if ok { - t := b.walkType(*u, nil, tn.Type()) - b.addCommentsToType(obj, t) - } - tf, ok := obj.(*tc.Func) - // We only care about functions, not concrete/abstract methods. - if ok && tf.Type() != nil && tf.Type().(*tc.Signature).Recv() == nil { - t := b.addFunction(*u, nil, tf) - b.addCommentsToType(obj, t) - } - tv, ok := obj.(*tc.Var) - if ok && !tv.IsField() { - t := b.addVariable(*u, nil, tv) - b.addCommentsToType(obj, t) - } - tconst, ok := obj.(*tc.Const) - if ok { - t := b.addConstant(*u, nil, tconst) - b.addCommentsToType(obj, t) - } - } - - importedPkgs := []string{} - for k := range b.importGraph[pkgPath] { - importedPkgs = append(importedPkgs, string(k)) - } - sort.Strings(importedPkgs) - for _, p := range importedPkgs { - u.AddImports(string(pkgPath), p) - } - return nil -} - -func (b *Builder) importWithMode(dir string, mode build.ImportMode) (*build.Package, error) { - // This is a bit of a hack. The srcDir argument to Import() should - // properly be the dir of the file which depends on the package to be - // imported, so that vendoring can work properly and local paths can - // resolve. We assume that there is only one level of vendoring, and that - // the CWD is inside the GOPATH, so this should be safe. Nobody should be - // using local (relative) paths except on the CLI, so CWD is also - // sufficient. - cwd, err := os.Getwd() - if err != nil { - return nil, fmt.Errorf("unable to get current directory: %v", err) - } - - // normalize to drop /vendor/ if present - dir = string(canonicalizeImportPath(dir)) - - buildPkg, err := b.context.Import(filepath.ToSlash(dir), cwd, mode) - if err != nil { - return nil, err - } - return buildPkg, nil -} - -// if there's a comment on the line `lines` before pos, return its text, otherwise "". -func (b *Builder) priorCommentLines(pos token.Pos, lines int) *ast.CommentGroup { - position := b.fset.Position(pos) - key := fileLine{position.Filename, position.Line - lines} - return b.endLineToCommentGroup[key] -} - -func splitLines(str string) []string { - return strings.Split(strings.TrimRight(str, "\n"), "\n") -} - -func tcFuncNameToName(in string) types.Name { - name := strings.TrimPrefix(in, "func ") - nameParts := strings.Split(name, "(") - return tcNameToName(nameParts[0]) -} - -func tcVarNameToName(in string) types.Name { - nameParts := strings.Split(in, " ") - // nameParts[0] is "var". - // nameParts[2:] is the type of the variable, we ignore it for now. - return tcNameToName(nameParts[1]) -} - -func tcNameToName(in string) types.Name { - // Detect anonymous type names. (These may have '.' characters because - // embedded types may have packages, so we detect them specially.) - if strings.HasPrefix(in, "struct{") || - strings.HasPrefix(in, "<-chan") || - strings.HasPrefix(in, "chan<-") || - strings.HasPrefix(in, "chan ") || - strings.HasPrefix(in, "func(") || - strings.HasPrefix(in, "func (") || - strings.HasPrefix(in, "*") || - strings.HasPrefix(in, "map[") || - strings.HasPrefix(in, "[") { - return types.Name{Name: in} - } - - // Otherwise, if there are '.' characters present, the name has a - // package path in front. - nameParts := strings.Split(in, ".") - name := types.Name{Name: in} - if n := len(nameParts); n >= 2 { - // The final "." is the name of the type--previous ones must - // have been in the package path. - name.Package, name.Name = strings.Join(nameParts[:n-1], "."), nameParts[n-1] - } - return name -} - -func (b *Builder) convertSignature(u types.Universe, t *tc.Signature) *types.Signature { - signature := &types.Signature{} - for i := 0; i < t.Params().Len(); i++ { - signature.Parameters = append(signature.Parameters, b.walkType(u, nil, t.Params().At(i).Type())) - signature.ParameterNames = append(signature.ParameterNames, t.Params().At(i).Name()) - } - for i := 0; i < t.Results().Len(); i++ { - signature.Results = append(signature.Results, b.walkType(u, nil, t.Results().At(i).Type())) - signature.ResultNames = append(signature.ResultNames, t.Results().At(i).Name()) - } - if r := t.Recv(); r != nil { - signature.Receiver = b.walkType(u, nil, r.Type()) - } - signature.Variadic = t.Variadic() - return signature -} - -// walkType adds the type, and any necessary child types. -func (b *Builder) walkType(u types.Universe, useName *types.Name, in tc.Type) *types.Type { - // Most of the cases are underlying types of the named type. - name := tcNameToName(in.String()) - if useName != nil { - name = *useName - } - - switch t := in.(type) { - case *tc.Struct: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Struct - for i := 0; i < t.NumFields(); i++ { - f := t.Field(i) - m := types.Member{ - Name: f.Name(), - Embedded: f.Anonymous(), - Tags: t.Tag(i), - Type: b.walkType(u, nil, f.Type()), - CommentLines: splitLines(b.priorCommentLines(f.Pos(), 1).Text()), - } - out.Members = append(out.Members, m) - } - return out - case *tc.Map: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Map - out.Elem = b.walkType(u, nil, t.Elem()) - out.Key = b.walkType(u, nil, t.Key()) - return out - case *tc.Pointer: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Pointer - out.Elem = b.walkType(u, nil, t.Elem()) - return out - case *tc.Slice: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Slice - out.Elem = b.walkType(u, nil, t.Elem()) - return out - case *tc.Array: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Array - out.Elem = b.walkType(u, nil, t.Elem()) - out.Len = in.(*tc.Array).Len() - return out - case *tc.Chan: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Chan - out.Elem = b.walkType(u, nil, t.Elem()) - // TODO: need to store direction, otherwise raw type name - // cannot be properly written. - return out - case *tc.Basic: - out := u.Type(types.Name{ - Package: "", - Name: t.Name(), - }) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Unsupported - return out - case *tc.Signature: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Func - out.Signature = b.convertSignature(u, t) - return out - case *tc.Interface: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Interface - t.Complete() - for i := 0; i < t.NumMethods(); i++ { - if out.Methods == nil { - out.Methods = map[string]*types.Type{} - } - method := t.Method(i) - name := tcNameToName(method.String()) - mt := b.walkType(u, &name, method.Type()) - mt.CommentLines = splitLines(b.priorCommentLines(method.Pos(), 1).Text()) - out.Methods[method.Name()] = mt - } - return out - case *tc.Named: - var out *types.Type - switch t.Underlying().(type) { - case *tc.Named, *tc.Basic, *tc.Map, *tc.Slice: - name := tcNameToName(t.String()) - out = u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Alias - out.Underlying = b.walkType(u, nil, t.Underlying()) - default: - // tc package makes everything "named" with an - // underlying anonymous type--we remove that annoying - // "feature" for users. This flattens those types - // together. - name := tcNameToName(t.String()) - if out := u.Type(name); out.Kind != types.Unknown { - return out // short circuit if we've already made this. - } - out = b.walkType(u, &name, t.Underlying()) - } - // If the underlying type didn't already add methods, add them. - // (Interface types will have already added methods.) - if len(out.Methods) == 0 { - for i := 0; i < t.NumMethods(); i++ { - if out.Methods == nil { - out.Methods = map[string]*types.Type{} - } - method := t.Method(i) - name := tcNameToName(method.String()) - mt := b.walkType(u, &name, method.Type()) - mt.CommentLines = splitLines(b.priorCommentLines(method.Pos(), 1).Text()) - out.Methods[method.Name()] = mt - } - } - return out - default: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Unsupported - klog.Warningf("Making unsupported type entry %q for: %#v\n", out, t) - return out - } -} - -func (b *Builder) addFunction(u types.Universe, useName *types.Name, in *tc.Func) *types.Type { - name := tcFuncNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Function(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - return out -} - -func (b *Builder) addVariable(u types.Universe, useName *types.Name, in *tc.Var) *types.Type { - name := tcVarNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Variable(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - return out -} - -func (b *Builder) addConstant(u types.Universe, useName *types.Name, in *tc.Const) *types.Type { - name := tcVarNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Constant(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - - var constval string - - // For strings, we use `StringVal()` to get the un-truncated, - // un-quoted string. For other values, `.String()` is preferable to - // get something relatively human readable (especially since for - // floating point types, `ExactString()` will generate numeric - // expressions using `big.(*Float).Text()`. - switch in.Val().Kind() { - case constant.String: - constval = constant.StringVal(in.Val()) - default: - constval = in.Val().String() - } - - out.ConstValue = &constval - return out -} - -// canonicalizeImportPath takes an import path and returns the actual package. -// It doesn't support nested vendoring. -func canonicalizeImportPath(importPath string) importPathString { - if !strings.Contains(importPath, "/vendor/") { - return importPathString(importPath) - } - - return importPathString(importPath[strings.Index(importPath, "/vendor/")+len("/vendor/"):]) -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/types/comments.go b/cluster-autoscaler/vendor/k8s.io/gengo/types/comments.go deleted file mode 100644 index 8150c383875d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/types/comments.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -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 types contains go type information, packaged in a way that makes -// auto-generation convenient, whether by template or straight go functions. -package types - -import ( - "fmt" - "strings" -) - -// ExtractCommentTags parses comments for lines of the form: -// -// 'marker' + "key=value". -// -// Values are optional; "" is the default. A tag can be specified more than -// one time and all values are returned. If the resulting map has an entry for -// a key, the value (a slice) is guaranteed to have at least 1 element. -// -// Example: if you pass "+" for 'marker', and the following lines are in -// the comments: -// +foo=value1 -// +bar -// +foo=value2 -// +baz="qux" -// Then this function will return: -// map[string][]string{"foo":{"value1, "value2"}, "bar": {""}, "baz": {"qux"}} -func ExtractCommentTags(marker string, lines []string) map[string][]string { - out := map[string][]string{} - for _, line := range lines { - line = strings.Trim(line, " ") - if len(line) == 0 { - continue - } - if !strings.HasPrefix(line, marker) { - continue - } - // TODO: we could support multiple values per key if we split on spaces - kv := strings.SplitN(line[len(marker):], "=", 2) - if len(kv) == 2 { - out[kv[0]] = append(out[kv[0]], kv[1]) - } else if len(kv) == 1 { - out[kv[0]] = append(out[kv[0]], "") - } - } - return out -} - -// ExtractSingleBoolCommentTag parses comments for lines of the form: -// -// 'marker' + "key=value1" -// -// If the tag is not found, the default value is returned. Values are asserted -// to be boolean ("true" or "false"), and any other value will cause an error -// to be returned. If the key has multiple values, the first one will be used. -func ExtractSingleBoolCommentTag(marker string, key string, defaultVal bool, lines []string) (bool, error) { - values := ExtractCommentTags(marker, lines)[key] - if values == nil { - return defaultVal, nil - } - if values[0] == "true" { - return true, nil - } - if values[0] == "false" { - return false, nil - } - return false, fmt.Errorf("tag value for %q is not boolean: %q", key, values[0]) -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/types/doc.go b/cluster-autoscaler/vendor/k8s.io/gengo/types/doc.go deleted file mode 100644 index 74a969a763a1..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/types/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -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 types contains go type information, packaged in a way that makes -// auto-generation convenient, whether by template or straight go functions. -package types // import "k8s.io/gengo/types" diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/types/flatten.go b/cluster-autoscaler/vendor/k8s.io/gengo/types/flatten.go deleted file mode 100644 index 585014e8ba00..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/types/flatten.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -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 types - -// FlattenMembers recursively takes any embedded members and puts them in the -// top level, correctly hiding them if the top level hides them. There must not -// be a cycle-- that implies infinite members. -// -// This is useful for e.g. computing all the valid keys in a json struct, -// properly considering any configuration of embedded structs. -func FlattenMembers(m []Member) []Member { - embedded := []Member{} - normal := []Member{} - type nameInfo struct { - top bool - i int - } - names := map[string]nameInfo{} - for i := range m { - if m[i].Embedded && m[i].Type.Kind == Struct { - embedded = append(embedded, m[i]) - } else { - normal = append(normal, m[i]) - names[m[i].Name] = nameInfo{true, len(normal) - 1} - } - } - for i := range embedded { - for _, e := range FlattenMembers(embedded[i].Type.Members) { - if info, found := names[e.Name]; found { - if info.top { - continue - } - if n := normal[info.i]; n.Name == e.Name && n.Type == e.Type { - continue - } - panic("conflicting members") - } - normal = append(normal, e) - names[e.Name] = nameInfo{false, len(normal) - 1} - } - } - return normal -} diff --git a/cluster-autoscaler/vendor/k8s.io/gengo/types/types.go b/cluster-autoscaler/vendor/k8s.io/gengo/types/types.go deleted file mode 100644 index 77650255acdd..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/gengo/types/types.go +++ /dev/null @@ -1,537 +0,0 @@ -/* -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 types - -import "strings" - -// Ref makes a reference to the given type. It can only be used for e.g. -// passing to namers. -func Ref(packageName, typeName string) *Type { - return &Type{Name: Name{ - Name: typeName, - Package: packageName, - }} -} - -// A type name may have a package qualifier. -type Name struct { - // Empty if embedded or builtin. This is the package path unless Path is specified. - Package string - // The type name. - Name string - // An optional location of the type definition for languages that can have disjoint - // packages and paths. - Path string -} - -// String returns the name formatted as a string. -func (n Name) String() string { - if n.Package == "" { - return n.Name - } - return n.Package + "." + n.Name -} - -// ParseFullyQualifiedName parses a name like k8s.io/kubernetes/pkg/api.Pod into a Name. -func ParseFullyQualifiedName(fqn string) Name { - cs := strings.Split(fqn, ".") - pkg := "" - if len(cs) > 1 { - pkg = strings.Join(cs[0:len(cs)-1], ".") - } - return Name{ - Name: cs[len(cs)-1], - Package: pkg, - } -} - -// The possible classes of types. -type Kind string - -const ( - // Builtin is a primitive, like bool, string, int. - Builtin Kind = "Builtin" - Struct Kind = "Struct" - Map Kind = "Map" - Slice Kind = "Slice" - Pointer Kind = "Pointer" - - // Alias is an alias of another type, e.g. in: - // type Foo string - // type Bar Foo - // Bar is an alias of Foo. - // - // In the real go type system, Foo is a "Named" string; but to simplify - // generation, this type system will just say that Foo *is* a builtin. - // We then need "Alias" as a way for us to say that Bar *is* a Foo. - Alias Kind = "Alias" - - // Interface is any type that could have differing types at run time. - Interface Kind = "Interface" - - // Array is just like slice, but has a fixed length. - Array Kind = "Array" - - // The remaining types are included for completeness, but are not well - // supported. - Chan Kind = "Chan" - Func Kind = "Func" - - // DeclarationOf is different from other Kinds; it indicates that instead of - // representing an actual Type, the type is a declaration of an instance of - // a type. E.g., a top-level function, variable, or constant. See the - // comment for Type.Name for more detail. - DeclarationOf Kind = "DeclarationOf" - Unknown Kind = "" - Unsupported Kind = "Unsupported" - - // Protobuf is protobuf type. - Protobuf Kind = "Protobuf" -) - -// Package holds package-level information. -// Fields are public, as everything in this package, to enable consumption by -// templates (for example). But it is strongly encouraged for code to build by -// using the provided functions. -type Package struct { - // Canonical name of this package-- its path. - Path string - - // The location this package was loaded from - SourcePath string - - // Short name of this package; the name that appears in the - // 'package x' line. - Name string - - // The comment right above the package declaration in doc.go, if any. - DocComments []string - - // All comments from doc.go, if any. - // TODO: remove Comments and use DocComments everywhere. - Comments []string - - // Types within this package, indexed by their name (*not* including - // package name). - Types map[string]*Type - - // Functions within this package, indexed by their name (*not* including - // package name). - Functions map[string]*Type - - // Global variables within this package, indexed by their name (*not* including - // package name). - Variables map[string]*Type - - // Global constants within this package, indexed by their name (*not* including - // package name). - Constants map[string]*Type - - // Packages imported by this package, indexed by (canonicalized) - // package path. - Imports map[string]*Package -} - -// Has returns true if the given name references a type known to this package. -func (p *Package) Has(name string) bool { - _, has := p.Types[name] - return has -} - -// Type gets the given Type in this Package. If the Type is not already -// defined, this will add it and return the new Type value. The caller is -// expected to finish initialization. -func (p *Package) Type(typeName string) *Type { - if t, ok := p.Types[typeName]; ok { - return t - } - if p.Path == "" { - // Import the standard builtin types! - if t, ok := builtins.Types[typeName]; ok { - p.Types[typeName] = t - return t - } - } - t := &Type{Name: Name{Package: p.Path, Name: typeName}} - p.Types[typeName] = t - return t -} - -// Function gets the given function Type in this Package. If the function is -// not already defined, this will add it. If a function is added, it's the -// caller's responsibility to finish construction of the function by setting -// Underlying to the correct type. -func (p *Package) Function(funcName string) *Type { - if t, ok := p.Functions[funcName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: funcName}} - t.Kind = DeclarationOf - p.Functions[funcName] = t - return t -} - -// Variable gets the given variable Type in this Package. If the variable is -// not already defined, this will add it. If a variable is added, it's the caller's -// responsibility to finish construction of the variable by setting Underlying -// to the correct type. -func (p *Package) Variable(varName string) *Type { - if t, ok := p.Variables[varName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: varName}} - t.Kind = DeclarationOf - p.Variables[varName] = t - return t -} - -// Constant gets the given constant Type in this Package. If the constant is -// not already defined, this will add it. If a constant is added, it's the caller's -// responsibility to finish construction of the constant by setting Underlying -// to the correct type. -func (p *Package) Constant(constName string) *Type { - if t, ok := p.Constants[constName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: constName}} - t.Kind = DeclarationOf - p.Constants[constName] = t - return t -} - -// HasImport returns true if p imports packageName. Package names include the -// package directory. -func (p *Package) HasImport(packageName string) bool { - _, has := p.Imports[packageName] - return has -} - -// Universe is a map of all packages. The key is the package name, but you -// should use Package(), Type(), Function(), or Variable() instead of direct -// access. -type Universe map[string]*Package - -// Type returns the canonical type for the given fully-qualified name. Builtin -// types will always be found, even if they haven't been explicitly added to -// the map. If a non-existing type is requested, this will create (a marker for) -// it. -func (u Universe) Type(n Name) *Type { - return u.Package(n.Package).Type(n.Name) -} - -// Function returns the canonical function for the given fully-qualified name. -// If a non-existing function is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the function by setting Underlying to the correct type. -func (u Universe) Function(n Name) *Type { - return u.Package(n.Package).Function(n.Name) -} - -// Variable returns the canonical variable for the given fully-qualified name. -// If a non-existing variable is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the variable by setting Underlying to the correct type. -func (u Universe) Variable(n Name) *Type { - return u.Package(n.Package).Variable(n.Name) -} - -// Constant returns the canonical constant for the given fully-qualified name. -// If a non-existing constant is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the constant by setting Underlying to the correct type. -func (u Universe) Constant(n Name) *Type { - return u.Package(n.Package).Constant(n.Name) -} - -// AddImports registers import lines for packageName. May be called multiple times. -// You are responsible for canonicalizing all package paths. -func (u Universe) AddImports(packagePath string, importPaths ...string) { - p := u.Package(packagePath) - for _, i := range importPaths { - p.Imports[i] = u.Package(i) - } -} - -// Package returns the Package for the given path. -// If a non-existing package is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the package. -func (u Universe) Package(packagePath string) *Package { - if p, ok := u[packagePath]; ok { - return p - } - p := &Package{ - Path: packagePath, - Types: map[string]*Type{}, - Functions: map[string]*Type{}, - Variables: map[string]*Type{}, - Constants: map[string]*Type{}, - Imports: map[string]*Package{}, - } - u[packagePath] = p - return p -} - -// Type represents a subset of possible go types. -type Type struct { - // There are two general categories of types, those explicitly named - // and those anonymous. Named ones will have a non-empty package in the - // name field. - // - // An exception: If Kind == DeclarationOf, then this name is the name of a - // top-level function, variable, or const, and the type can be found in Underlying. - // We do this to allow the naming system to work against these objects, even - // though they aren't strictly speaking types. - Name Name - - // The general kind of this type. - Kind Kind - - // If there are comment lines immediately before the type definition, - // they will be recorded here. - CommentLines []string - - // If there are comment lines preceding the `CommentLines`, they will be - // recorded here. There are two cases: - // --- - // SecondClosestCommentLines - // a blank line - // CommentLines - // type definition - // --- - // - // or - // --- - // SecondClosestCommentLines - // a blank line - // type definition - // --- - SecondClosestCommentLines []string - - // If Kind == Struct - Members []Member - - // If Kind == Map, Slice, Pointer, or Chan - Elem *Type - - // If Kind == Map, this is the map's key type. - Key *Type - - // If Kind == Alias, this is the underlying type. - // If Kind == DeclarationOf, this is the type of the declaration. - Underlying *Type - - // If Kind == Interface, this is the set of all required functions. - // Otherwise, if this is a named type, this is the list of methods that - // type has. (All elements will have Kind=="Func") - Methods map[string]*Type - - // If Kind == func, this is the signature of the function. - Signature *Signature - - // ConstValue contains a stringified constant value if - // Kind == DeclarationOf and this is a constant value - // declaration. For string constants, this field contains - // the entire, un-quoted value. For other types, it contains - // a human-readable literal. - ConstValue *string - - // TODO: Add: - // * channel direction - - // If Kind == Array - Len int64 -} - -// String returns the name of the type. -func (t *Type) String() string { - return t.Name.String() -} - -// IsPrimitive returns whether the type is a built-in type or is an alias to a -// built-in type. For example: strings and aliases of strings are primitives, -// structs are not. -func (t *Type) IsPrimitive() bool { - if t.Kind == Builtin || (t.Kind == Alias && t.Underlying.Kind == Builtin) { - return true - } - return false -} - -// IsAssignable returns whether the type is deep-assignable. For example, -// slices and maps and pointers are shallow copies, but ints and strings are -// complete. -func (t *Type) IsAssignable() bool { - if t.IsPrimitive() { - return true - } - if t.Kind == Struct { - for _, m := range t.Members { - if !m.Type.IsAssignable() { - return false - } - } - return true - } - return false -} - -// IsAnonymousStruct returns true if the type is an anonymous struct or an alias -// to an anonymous struct. -func (t *Type) IsAnonymousStruct() bool { - return (t.Kind == Struct && t.Name.Name == "struct{}") || (t.Kind == Alias && t.Underlying.IsAnonymousStruct()) -} - -// A single struct member -type Member struct { - // The name of the member. - Name string - - // If the member is embedded (anonymous) this will be true, and the - // Name will be the type name. - Embedded bool - - // If there are comment lines immediately before the member in the type - // definition, they will be recorded here. - CommentLines []string - - // If there are tags along with this member, they will be saved here. - Tags string - - // The type of this member. - Type *Type -} - -// String returns the name and type of the member. -func (m Member) String() string { - return m.Name + " " + m.Type.String() -} - -// Signature is a function's signature. -type Signature struct { - // If a method of some type, this is the type it's a member of. - Receiver *Type - Parameters []*Type - ParameterNames []string - Results []*Type - ResultNames []string - - // True if the last in parameter is of the form ...T. - Variadic bool - - // If there are comment lines immediately before this - // signature/method/function declaration, they will be recorded here. - CommentLines []string -} - -// Built in types. -var ( - String = &Type{ - Name: Name{Name: "string"}, - Kind: Builtin, - } - Int64 = &Type{ - Name: Name{Name: "int64"}, - Kind: Builtin, - } - Int32 = &Type{ - Name: Name{Name: "int32"}, - Kind: Builtin, - } - Int16 = &Type{ - Name: Name{Name: "int16"}, - Kind: Builtin, - } - Int = &Type{ - Name: Name{Name: "int"}, - Kind: Builtin, - } - Uint64 = &Type{ - Name: Name{Name: "uint64"}, - Kind: Builtin, - } - Uint32 = &Type{ - Name: Name{Name: "uint32"}, - Kind: Builtin, - } - Uint16 = &Type{ - Name: Name{Name: "uint16"}, - Kind: Builtin, - } - Uint = &Type{ - Name: Name{Name: "uint"}, - Kind: Builtin, - } - Uintptr = &Type{ - Name: Name{Name: "uintptr"}, - Kind: Builtin, - } - Float64 = &Type{ - Name: Name{Name: "float64"}, - Kind: Builtin, - } - Float32 = &Type{ - Name: Name{Name: "float32"}, - Kind: Builtin, - } - Float = &Type{ - Name: Name{Name: "float"}, - Kind: Builtin, - } - Bool = &Type{ - Name: Name{Name: "bool"}, - Kind: Builtin, - } - Byte = &Type{ - Name: Name{Name: "byte"}, - Kind: Builtin, - } - - builtins = &Package{ - Types: map[string]*Type{ - "bool": Bool, - "string": String, - "int": Int, - "int64": Int64, - "int32": Int32, - "int16": Int16, - "int8": Byte, - "uint": Uint, - "uint64": Uint64, - "uint32": Uint32, - "uint16": Uint16, - "uint8": Byte, - "uintptr": Uintptr, - "byte": Byte, - "float": Float, - "float64": Float64, - "float32": Float32, - }, - Imports: map[string]*Package{}, - Path: "", - Name: "", - } -) - -func IsInteger(t *Type) bool { - switch t { - case Int, Int64, Int32, Int16, Uint, Uint64, Uint32, Uint16, Byte: - return true - default: - return false - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/.golangci.yaml b/cluster-autoscaler/vendor/k8s.io/klog/v2/.golangci.yaml deleted file mode 100644 index 0d77d65f063d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/.golangci.yaml +++ /dev/null @@ -1,6 +0,0 @@ -linters: - disable-all: true - enable: # sorted alphabetical - - gofmt - - misspell - - revive diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/format.go b/cluster-autoscaler/vendor/k8s.io/klog/v2/format.go deleted file mode 100644 index 63995ca6dbf4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/format.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -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 klog - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/go-logr/logr" -) - -// Format wraps a value of an arbitrary type and implement fmt.Stringer and -// logr.Marshaler for them. Stringer returns pretty-printed JSON. MarshalLog -// returns the original value with a type that has no special methods, in -// particular no MarshalLog or MarshalJSON. -// -// Wrapping values like that is useful when the value has a broken -// implementation of these special functions (for example, a type which -// inherits String from TypeMeta, but then doesn't re-implement String) or the -// implementation produces output that is less readable or unstructured (for -// example, the generated String functions for Kubernetes API types). -func Format(obj interface{}) interface{} { - return formatAny{Object: obj} -} - -type formatAny struct { - Object interface{} -} - -func (f formatAny) String() string { - var buffer strings.Builder - encoder := json.NewEncoder(&buffer) - encoder.SetIndent("", " ") - if err := encoder.Encode(&f.Object); err != nil { - return fmt.Sprintf("error marshaling %T to JSON: %v", f, err) - } - return buffer.String() -} - -func (f formatAny) MarshalLog() interface{} { - // Returning a pointer to a pointer ensures that zapr doesn't find a - // fmt.Stringer or logr.Marshaler when it checks the type of the - // value. It then falls back to reflection, which dumps the value being - // pointed to (JSON doesn't have pointers). - ptr := &f.Object - return &ptr -} - -var _ fmt.Stringer = formatAny{} -var _ logr.Marshaler = formatAny{} diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go b/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go deleted file mode 100644 index d9c7d15467c4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_no_slog.go +++ /dev/null @@ -1,97 +0,0 @@ -//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 serialize - -import ( - "bytes" - "fmt" - - "github.com/go-logr/logr" -) - -// 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{}) { - // This is the version without slog support. Must be kept in sync with - // the version in keyvalues_slog.go. - - b.WriteByte(' ') - // Keys are assumed to be well-formed according to - // 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. - if sK, ok := k.(string); ok { - // Avoid one allocation when the key is a string, which - // normally it should be. - b.WriteString(sK) - } else { - b.WriteString(fmt.Sprintf("%s", k)) - } - - // The type checks are sorted so that more frequently used ones - // come first because that is then faster in the common - // cases. In Kubernetes, ObjectRef (a Stringer) is more common - // than plain strings - // (https://github.com/kubernetes/kubernetes/pull/106594#issuecomment-975526235). - switch v := v.(type) { - case textWriter: - writeTextWriterValue(b, v) - case fmt.Stringer: - writeStringValue(b, StringerToString(v)) - case string: - writeStringValue(b, v) - case error: - writeStringValue(b, ErrorToString(v)) - case logr.Marshaler: - value := MarshalerToValue(v) - // A marshaler that returns a string is useful for - // delayed formatting of complex values. We treat this - // case like a normal string. This is useful for - // multi-line support. - // - // We could do this by recursively formatting a value, - // but that comes with the risk of infinite recursion - // if a marshaler returns itself. Instead we call it - // only once and rely on it returning the intended - // value directly. - switch value := value.(type) { - case string: - writeStringValue(b, value) - default: - f.formatAny(b, value) - } - case []byte: - // In https://github.com/kubernetes/klog/pull/237 it was decided - // to format byte slices with "%+q". The advantages of that are: - // - readable output if the bytes happen to be printable - // - non-printable bytes get represented as unicode escape - // sequences (\uxxxx) - // - // The downsides are that we cannot use the faster - // strconv.Quote here and that multi-line output is not - // supported. If developers know that a byte array is - // printable and they want multi-line output, they can - // convert the value to string before logging it. - b.WriteByte('=') - b.WriteString(fmt.Sprintf("%+q", v)) - default: - f.formatAny(b, v) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go b/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go deleted file mode 100644 index 89acf9772309..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/serialize/keyvalues_slog.go +++ /dev/null @@ -1,155 +0,0 @@ -//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 serialize - -import ( - "bytes" - "fmt" - "log/slog" - "strconv" - - "github.com/go-logr/logr" -) - -// 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{}) { - // This is the version without slog support. Must be kept in sync with - // the version in keyvalues_slog.go. - - b.WriteByte(' ') - // Keys are assumed to be well-formed according to - // 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. - if sK, ok := k.(string); ok { - // Avoid one allocation when the key is a string, which - // normally it should be. - b.WriteString(sK) - } else { - b.WriteString(fmt.Sprintf("%s", k)) - } - - // The type checks are sorted so that more frequently used ones - // come first because that is then faster in the common - // cases. In Kubernetes, ObjectRef (a Stringer) is more common - // than plain strings - // (https://github.com/kubernetes/kubernetes/pull/106594#issuecomment-975526235). - // - // slog.LogValuer does not need to be handled here because the handler will - // already have resolved such special values to the final value for logging. - switch v := v.(type) { - case textWriter: - writeTextWriterValue(b, v) - case slog.Value: - // This must come before fmt.Stringer because slog.Value implements - // fmt.Stringer, but does not produce the output that we want. - b.WriteByte('=') - generateJSON(b, v) - case fmt.Stringer: - writeStringValue(b, StringerToString(v)) - case string: - writeStringValue(b, v) - case error: - writeStringValue(b, ErrorToString(v)) - case logr.Marshaler: - value := MarshalerToValue(v) - // A marshaler that returns a string is useful for - // delayed formatting of complex values. We treat this - // case like a normal string. This is useful for - // multi-line support. - // - // We could do this by recursively formatting a value, - // but that comes with the risk of infinite recursion - // if a marshaler returns itself. Instead we call it - // only once and rely on it returning the intended - // value directly. - switch value := value.(type) { - case string: - writeStringValue(b, value) - default: - f.formatAny(b, value) - } - case slog.LogValuer: - value := slog.AnyValue(v).Resolve() - if value.Kind() == slog.KindString { - writeStringValue(b, value.String()) - } else { - b.WriteByte('=') - generateJSON(b, value) - } - case []byte: - // In https://github.com/kubernetes/klog/pull/237 it was decided - // to format byte slices with "%+q". The advantages of that are: - // - readable output if the bytes happen to be printable - // - non-printable bytes get represented as unicode escape - // sequences (\uxxxx) - // - // The downsides are that we cannot use the faster - // strconv.Quote here and that multi-line output is not - // supported. If developers know that a byte array is - // printable and they want multi-line output, they can - // convert the value to string before logging it. - b.WriteByte('=') - b.WriteString(fmt.Sprintf("%+q", v)) - default: - f.formatAny(b, v) - } -} - -// generateJSON has the same preference for plain strings as KVFormat. -// In contrast to KVFormat it always produces valid JSON with no line breaks. -func generateJSON(b *bytes.Buffer, v interface{}) { - switch v := v.(type) { - case slog.Value: - switch v.Kind() { - case slog.KindGroup: - // Format as a JSON group. We must not involve f.AnyToStringHook (if there is any), - // because there is no guarantee that it produces valid JSON. - b.WriteByte('{') - for i, attr := range v.Group() { - if i > 0 { - b.WriteByte(',') - } - b.WriteString(strconv.Quote(attr.Key)) - b.WriteByte(':') - generateJSON(b, attr.Value) - } - b.WriteByte('}') - case slog.KindLogValuer: - generateJSON(b, v.Resolve()) - default: - // Peel off the slog.Value wrapper and format the actual value. - generateJSON(b, v.Any()) - } - case fmt.Stringer: - b.WriteString(strconv.Quote(StringerToString(v))) - case logr.Marshaler: - generateJSON(b, MarshalerToValue(v)) - case slog.LogValuer: - generateJSON(b, slog.AnyValue(v).Resolve().Any()) - case string: - b.WriteString(strconv.Quote(v)) - case error: - b.WriteString(strconv.Quote(v.Error())) - default: - formatAsJSON(b, v) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/sloghandler/sloghandler_slog.go b/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/sloghandler/sloghandler_slog.go deleted file mode 100644 index 21f1697d0959..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/internal/sloghandler/sloghandler_slog.go +++ /dev/null @@ -1,96 +0,0 @@ -//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 sloghandler - -import ( - "context" - "log/slog" - "runtime" - "strings" - "time" - - "k8s.io/klog/v2/internal/severity" -) - -func Handle(_ context.Context, record slog.Record, groups string, printWithInfos func(file string, line int, now time.Time, err error, s severity.Severity, msg string, kvList []interface{})) error { - now := record.Time - if now.IsZero() { - // This format doesn't support printing entries without a time. - now = time.Now() - } - - // slog has numeric severity levels, with 0 as default "info", negative for debugging, and - // positive with some pre-defined levels for more important. Those ranges get mapped to - // the corresponding klog levels where possible, with "info" the default that is used - // also for negative debug levels. - level := record.Level - s := severity.InfoLog - switch { - case level >= slog.LevelError: - s = severity.ErrorLog - case level >= slog.LevelWarn: - s = severity.WarningLog - } - - var file string - var line int - if record.PC != 0 { - // Same as https://cs.opensource.google/go/x/exp/+/642cacee:slog/record.go;drc=642cacee5cc05231f45555a333d07f1005ffc287;l=70 - fs := runtime.CallersFrames([]uintptr{record.PC}) - f, _ := fs.Next() - if f.File != "" { - file = f.File - if slash := strings.LastIndex(file, "/"); slash >= 0 { - file = file[slash+1:] - } - line = f.Line - } - } else { - file = "???" - line = 1 - } - - kvList := make([]interface{}, 0, 2*record.NumAttrs()) - record.Attrs(func(attr slog.Attr) bool { - kvList = appendAttr(groups, kvList, attr) - return true - }) - - printWithInfos(file, line, now, nil, s, record.Message, kvList) - return nil -} - -func Attrs2KVList(groups string, attrs []slog.Attr) []interface{} { - kvList := make([]interface{}, 0, 2*len(attrs)) - for _, attr := range attrs { - kvList = appendAttr(groups, kvList, attr) - } - return kvList -} - -func appendAttr(groups string, kvList []interface{}, attr slog.Attr) []interface{} { - var key string - if groups != "" { - key = groups + "." + attr.Key - } else { - key = attr.Key - } - return append(kvList, key, attr.Value) -} diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/k8s_references_slog.go b/cluster-autoscaler/vendor/k8s.io/klog/v2/k8s_references_slog.go deleted file mode 100644 index 5522c84c774f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/k8s_references_slog.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -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 klog - -import ( - "log/slog" -) - -func (ref ObjectRef) LogValue() slog.Value { - if ref.Namespace != "" { - return slog.GroupValue(slog.String("name", ref.Name), slog.String("namespace", ref.Namespace)) - } - return slog.GroupValue(slog.String("name", ref.Name)) -} - -var _ slog.LogValuer = ObjectRef{} - -func (ks kobjSlice) LogValue() slog.Value { - return slog.AnyValue(ks.MarshalLog()) -} - -var _ slog.LogValuer = kobjSlice{} diff --git a/cluster-autoscaler/vendor/k8s.io/klog/v2/klogr_slog.go b/cluster-autoscaler/vendor/k8s.io/klog/v2/klogr_slog.go deleted file mode 100644 index f7bf740306b2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/klog/v2/klogr_slog.go +++ /dev/null @@ -1,96 +0,0 @@ -//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 klog - -import ( - "context" - "log/slog" - "strconv" - "time" - - "github.com/go-logr/logr/slogr" - - "k8s.io/klog/v2/internal/buffer" - "k8s.io/klog/v2/internal/serialize" - "k8s.io/klog/v2/internal/severity" - "k8s.io/klog/v2/internal/sloghandler" -) - -func (l *klogger) Handle(ctx context.Context, record slog.Record) error { - if logging.logger != nil { - if slogSink, ok := logging.logger.GetSink().(slogr.SlogSink); ok { - // Let that logger do the work. - return slogSink.Handle(ctx, record) - } - } - - return sloghandler.Handle(ctx, record, l.groups, slogOutput) -} - -// slogOutput corresponds to several different functions in klog.go. -// It goes through some of the same checks and formatting steps before -// it ultimately converges by calling logging.printWithInfos. -func slogOutput(file string, line int, now time.Time, err error, s severity.Severity, msg string, kvList []interface{}) { - // See infoS. - if logging.logger != nil { - // Taking this path happens when klog has a logger installed - // as backend which doesn't support slog. Not good, we have to - // guess about the call depth and drop the actual location. - logger := logging.logger.WithCallDepth(2) - if s > severity.ErrorLog { - logger.Error(err, msg, kvList...) - } else { - logger.Info(msg, kvList...) - } - return - } - - // See printS. - b := buffer.GetBuffer() - b.WriteString(strconv.Quote(msg)) - if err != nil { - serialize.KVListFormat(&b.Buffer, "err", err) - } - serialize.KVListFormat(&b.Buffer, kvList...) - - // See print + header. - buf := logging.formatHeader(s, file, line, now) - logging.printWithInfos(buf, file, line, s, nil, nil, 0, &b.Buffer) - - buffer.PutBuffer(b) -} - -func (l *klogger) WithAttrs(attrs []slog.Attr) slogr.SlogSink { - clone := *l - clone.values = serialize.WithValues(l.values, sloghandler.Attrs2KVList(l.groups, attrs)) - return &clone -} - -func (l *klogger) WithGroup(name string) slogr.SlogSink { - clone := *l - if clone.groups != "" { - clone.groups += "." + name - } else { - clone.groups = name - } - return &clone -} - -var _ slogr.SlogSink = &klogger{} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/cmd/openapi-gen/args/args.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/cmd/openapi-gen/args/args.go deleted file mode 100644 index 19783370e993..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/cmd/openapi-gen/args/args.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 args - -import ( - "fmt" - "path/filepath" - - "github.com/spf13/pflag" - "k8s.io/gengo/args" -) - -// CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct { - // ReportFilename is added to CustomArgs for specifying name of report file used - // by API linter. If specified, API rule violations will be printed to report file. - // Otherwise default value "-" will be used which indicates stdout. - ReportFilename string -} - -// NewDefaults returns default arguments for the generator. Returning the arguments instead -// of using default flag parsing allows registering custom arguments afterwards -func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { - // Default() sets a couple of flag default values for example the boilerplate. - // WithoutDefaultFlagParsing() disables implicit addition of command line flags and parsing, - // which allows registering custom arguments afterwards - genericArgs := args.Default().WithoutDefaultFlagParsing() - genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), "k8s.io/kube-openapi/boilerplate/boilerplate.go.txt") - - customArgs := &CustomArgs{} - genericArgs.CustomArgs = customArgs - - // Default value for report filename is "-", which stands for stdout - customArgs.ReportFilename = "-" - // Default value for output file base name - genericArgs.OutputFileBaseName = "openapi_generated" - - return genericArgs, customArgs -} - -// AddFlags add the generator flags to the flag set. -func (c *CustomArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringVarP(&c.ReportFilename, "report-filename", "r", c.ReportFilename, "Name of report file used by API linter to print API violations. Default \"-\" stands for standard output. NOTE that if valid filename other than \"-\" is specified, API linter won't return error on detected API violations. This allows further check of existing API violations without stopping the OpenAPI generation toolchain.") -} - -// Validate checks the given arguments. -func Validate(genericArgs *args.GeneratorArgs) error { - c, ok := genericArgs.CustomArgs.(*CustomArgs) - if !ok { - return fmt.Errorf("input arguments don't contain valid custom arguments") - } - if len(c.ReportFilename) == 0 { - return fmt.Errorf("report filename cannot be empty. specify a valid filename or use \"-\" for stdout") - } - if len(genericArgs.OutputFileBaseName) == 0 { - return fmt.Errorf("output file base name cannot be empty") - } - if len(genericArgs.OutputPackagePath) == 0 { - return fmt.Errorf("output package cannot be empty") - } - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/parameters.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/parameters.go deleted file mode 100644 index 2bb8bd885df8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/builder/parameters.go +++ /dev/null @@ -1,259 +0,0 @@ -/* -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 builder - -import ( - "encoding/base64" - "encoding/json" - "fmt" - "hash/fnv" - "sort" - "strconv" - "strings" - - "k8s.io/kube-openapi/pkg/validation/spec" -) - -// deduplicateParameters finds parameters that are shared across multiple endpoints and replace them with -// references to the shared parameters in order to avoid repetition. -// -// deduplicateParameters does not mutate the source. -func deduplicateParameters(sp *spec.Swagger) (*spec.Swagger, error) { - names, parameters, err := collectSharedParameters(sp) - if err != nil { - return nil, err - } - - if sp.Parameters != nil { - return nil, fmt.Errorf("shared parameters already exist") // should not happen with the builder, but to be sure - } - - clone := *sp - clone.Parameters = parameters - return replaceSharedParameters(names, &clone) -} - -// collectSharedParameters finds parameters that show up for many endpoints. These -// are basically all parameters with the exceptions of those where we know they are -// endpoint specific, e.g. because they reference the schema of the kind, or have -// the kind or resource name in the description. -func collectSharedParameters(sp *spec.Swagger) (namesByJSON map[string]string, ret map[string]spec.Parameter, err error) { - if sp == nil || sp.Paths == nil { - return nil, nil, nil - } - - countsByJSON := map[string]int{} - shared := map[string]spec.Parameter{} - var keys []string - - collect := func(p *spec.Parameter) error { - if (p.In == "query" || p.In == "path") && p.Name == "name" { - return nil // ignore name parameter as they are never shared with the Kind in the description - } - if p.In == "query" && p.Name == "fieldValidation" { - return nil // keep fieldValidation parameter unshared because kubectl uses it (until 1.27) to detect server-side field validation support - } - if p.In == "query" && p.Name == "dryRun" { - return nil // keep fieldValidation parameter unshared because kubectl uses it (until 1.26) to detect dry-run support - } - if p.Schema != nil && p.In == "body" && p.Name == "body" && !strings.HasPrefix(p.Schema.Ref.String(), "#/definitions/io.k8s.apimachinery") { - return nil // ignore non-generic body parameters as they reference the custom schema of the kind - } - - bs, err := json.Marshal(p) - if err != nil { - return err - } - - k := string(bs) - countsByJSON[k]++ - if count := countsByJSON[k]; count == 1 { - shared[k] = *p - keys = append(keys, k) - } - - return nil - } - - for _, path := range sp.Paths.Paths { - // per operation parameters - for _, op := range operations(&path) { - if op == nil { - continue // shouldn't happen, but ignore if it does; tested through unit test - } - for _, p := range op.Parameters { - if p.Ref.String() != "" { - // shouldn't happen, but ignore if it does - continue - } - if err := collect(&p); err != nil { - return nil, nil, err - } - } - } - - // per path parameters - for _, p := range path.Parameters { - if p.Ref.String() != "" { - continue // shouldn't happen, but ignore if it does - } - if err := collect(&p); err != nil { - return nil, nil, err - } - } - } - - // name deterministically - sort.Strings(keys) - ret = map[string]spec.Parameter{} - namesByJSON = map[string]string{} - for _, k := range keys { - name := shared[k].Name - if name == "" { - // this should never happen as the name is a required field. But if it does, let's be safe. - name = "param" - } - name += "-" + base64Hash(k) - i := 0 - for { - if _, ok := ret[name]; !ok { - ret[name] = shared[k] - namesByJSON[k] = name - break - } - i++ // only on hash conflict, unlikely with our few variants - name = shared[k].Name + "-" + strconv.Itoa(i) - } - } - - return namesByJSON, ret, nil -} - -func operations(path *spec.PathItem) []*spec.Operation { - return []*spec.Operation{path.Get, path.Put, path.Post, path.Delete, path.Options, path.Head, path.Patch} -} - -func base64Hash(s string) string { - hash := fnv.New64() - hash.Write([]byte(s)) //nolint:errcheck - return base64.URLEncoding.EncodeToString(hash.Sum(make([]byte, 0, 8))[:6]) // 8 characters -} - -func replaceSharedParameters(sharedParameterNamesByJSON map[string]string, sp *spec.Swagger) (*spec.Swagger, error) { - if sp == nil || sp.Paths == nil { - return sp, nil - } - - ret := sp - - firstPathChange := true - for k, path := range sp.Paths.Paths { - pathChanged := false - - // per operation parameters - for _, op := range []**spec.Operation{&path.Get, &path.Put, &path.Post, &path.Delete, &path.Options, &path.Head, &path.Patch} { - if *op == nil { - continue - } - - firstParamChange := true - for i := range (*op).Parameters { - p := (*op).Parameters[i] - - if p.Ref.String() != "" { - // shouldn't happen, but be idem-potent if it does - continue - } - - bs, err := json.Marshal(p) - if err != nil { - return nil, err - } - - if name, ok := sharedParameterNamesByJSON[string(bs)]; ok { - if firstParamChange { - orig := *op - *op = &spec.Operation{} - **op = *orig - (*op).Parameters = make([]spec.Parameter, len(orig.Parameters)) - copy((*op).Parameters, orig.Parameters) - firstParamChange = false - } - - (*op).Parameters[i] = spec.Parameter{ - Refable: spec.Refable{ - Ref: spec.MustCreateRef("#/parameters/" + name), - }, - } - pathChanged = true - } - } - } - - // per path parameters - firstParamChange := true - for i := range path.Parameters { - p := path.Parameters[i] - - if p.Ref.String() != "" { - // shouldn't happen, but be idem-potent if it does - continue - } - - bs, err := json.Marshal(p) - if err != nil { - return nil, err - } - - if name, ok := sharedParameterNamesByJSON[string(bs)]; ok { - if firstParamChange { - orig := path.Parameters - path.Parameters = make([]spec.Parameter, len(orig)) - copy(path.Parameters, orig) - firstParamChange = false - } - - path.Parameters[i] = spec.Parameter{ - Refable: spec.Refable{ - Ref: spec.MustCreateRef("#/parameters/" + name), - }, - } - pathChanged = true - } - } - - if pathChanged { - if firstPathChange { - clone := *sp - ret = &clone - - pathsClone := *ret.Paths - ret.Paths = &pathsClone - - ret.Paths.Paths = make(map[string]spec.PathItem, len(sp.Paths.Paths)) - for k, v := range sp.Paths.Paths { - ret.Paths.Paths[k] = v - } - - firstPathChange = false - } - ret.Paths.Paths[k] = path - } - } - - return ret, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/README.md b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/README.md deleted file mode 100644 index 72b4e5fb4396..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Generate OpenAPI definitions - -- To generate definition for a specific type or package add "+k8s:openapi-gen=true" tag to the type/package comment lines. -- To exclude a type or a member from a tagged package/type, add "+k8s:openapi-gen=false" tag to the comment lines. - -# OpenAPI Extensions - -OpenAPI spec can have extensions on types. To define one or more extensions on a type or its member -add `+k8s:openapi-gen=x-kubernetes-$NAME:$VALUE` to the comment lines before type/member. A type/member can -have multiple extensions. The rest of the line in the comment will be used as $VALUE so there is no need to -escape or quote the value string. Extensions can be used to pass more information to client generators or -documentation generators. For example a type might have a friendly name to be displayed in documentation or -being used in a client's fluent interface. - -# Custom OpenAPI type definitions - -Custom types which otherwise don't map directly to OpenAPI can override their -OpenAPI definition by implementing a function named "OpenAPIDefinition" with -the following signature: - -```go - import openapi "k8s.io/kube-openapi/pkg/common" - - // ... - - type Time struct { - time.Time - } - - func (_ Time) OpenAPIDefinition() openapi.OpenAPIDefinition { - return openapi.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "date-time", - }, - }, - } - } -``` - -Alternatively, the type can avoid the "openapi" import by defining the following -methods. The following example produces the same OpenAPI definition as the -example above: - -```go - func (_ Time) OpenAPISchemaType() []string { return []string{"string"} } - func (_ Time) OpenAPISchemaFormat() string { return "date-time" } -``` diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/api_linter.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/api_linter.go deleted file mode 100644 index 2763cf8847b8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/api_linter.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "bytes" - "fmt" - "io" - "os" - "sort" - - "k8s.io/kube-openapi/pkg/generators/rules" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" - "k8s.io/klog/v2" -) - -const apiViolationFileType = "api-violation" - -type apiViolationFile struct { - // Since our file actually is unrelated to the package structure, use a - // path that hasn't been mangled by the framework. - unmangledPath string -} - -func (a apiViolationFile) AssembleFile(f *generator.File, path string) error { - path = a.unmangledPath - klog.V(2).Infof("Assembling file %q", path) - if path == "-" { - _, err := io.Copy(os.Stdout, &f.Body) - return err - } - - output, err := os.Create(path) - if err != nil { - return err - } - defer output.Close() - _, err = io.Copy(output, &f.Body) - return err -} - -func (a apiViolationFile) VerifyFile(f *generator.File, path string) error { - if path == "-" { - // Nothing to verify against. - return nil - } - path = a.unmangledPath - - formatted := f.Body.Bytes() - existing, err := os.ReadFile(path) - if err != nil { - return fmt.Errorf("unable to read file %q for comparison: %v", path, err) - } - if bytes.Compare(formatted, existing) == 0 { - return nil - } - - // Be nice and find the first place where they differ - // (Copied from gengo's default file type) - i := 0 - for i < len(formatted) && i < len(existing) && formatted[i] == existing[i] { - i++ - } - eDiff, fDiff := existing[i:], formatted[i:] - if len(eDiff) > 100 { - eDiff = eDiff[:100] - } - if len(fDiff) > 100 { - fDiff = fDiff[:100] - } - return fmt.Errorf("output for %q differs; first existing/expected diff: \n %q\n %q", path, string(eDiff), string(fDiff)) -} - -func newAPIViolationGen() *apiViolationGen { - return &apiViolationGen{ - linter: newAPILinter(), - } -} - -type apiViolationGen struct { - generator.DefaultGen - - linter *apiLinter -} - -func (v *apiViolationGen) FileType() string { return apiViolationFileType } -func (v *apiViolationGen) Filename() string { - return "this file is ignored by the file assembler" -} - -func (v *apiViolationGen) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - klog.V(5).Infof("validating API rules for type %v", t) - if err := v.linter.validate(t); err != nil { - return err - } - return nil -} - -// Finalize prints the API rule violations to report file (if specified from -// arguments) or stdout (default) -func (v *apiViolationGen) Finalize(c *generator.Context, w io.Writer) error { - // NOTE: we don't return error here because we assume that the report file will - // get evaluated afterwards to determine if error should be raised. For example, - // you can have make rules that compare the report file with existing known - // violations (whitelist) and determine no error if no change is detected. - v.linter.report(w) - return nil -} - -// apiLinter is the framework hosting multiple API rules and recording API rule -// violations -type apiLinter struct { - // API rules that implement APIRule interface and output API rule violations - rules []APIRule - violations []apiViolation -} - -// newAPILinter creates an apiLinter object with API rules in package rules. Please -// add APIRule here when new API rule is implemented. -func newAPILinter() *apiLinter { - return &apiLinter{ - rules: []APIRule{ - &rules.NamesMatch{}, - &rules.OmitEmptyMatchCase{}, - &rules.ListTypeMissing{}, - }, - } -} - -// apiViolation uniquely identifies single API rule violation -type apiViolation struct { - // Name of rule from APIRule.Name() - rule string - - packageName string - typeName string - - // Optional: name of field that violates API rule. Empty fieldName implies that - // the entire type violates the rule. - field string -} - -// apiViolations implements sort.Interface for []apiViolation based on the fields: rule, -// packageName, typeName and field. -type apiViolations []apiViolation - -func (a apiViolations) Len() int { return len(a) } -func (a apiViolations) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a apiViolations) Less(i, j int) bool { - if a[i].rule != a[j].rule { - return a[i].rule < a[j].rule - } - if a[i].packageName != a[j].packageName { - return a[i].packageName < a[j].packageName - } - if a[i].typeName != a[j].typeName { - return a[i].typeName < a[j].typeName - } - return a[i].field < a[j].field -} - -// APIRule is the interface for validating API rule on Go types -type APIRule interface { - // Validate evaluates API rule on type t and returns a list of field names in - // the type that violate the rule. Empty field name [""] implies the entire - // type violates the rule. - Validate(t *types.Type) ([]string, error) - - // Name returns the name of APIRule - Name() string -} - -// validate runs all API rules on type t and records any API rule violation -func (l *apiLinter) validate(t *types.Type) error { - for _, r := range l.rules { - klog.V(5).Infof("validating API rule %v for type %v", r.Name(), t) - fields, err := r.Validate(t) - if err != nil { - return err - } - for _, field := range fields { - l.violations = append(l.violations, apiViolation{ - rule: r.Name(), - packageName: t.Name.Package, - typeName: t.Name.Name, - field: field, - }) - } - } - return nil -} - -// report prints any API rule violation to writer w and returns error if violation exists -func (l *apiLinter) report(w io.Writer) error { - sort.Sort(apiViolations(l.violations)) - for _, v := range l.violations { - fmt.Fprintf(w, "API rule violation: %s,%s,%s,%s\n", v.rule, v.packageName, v.typeName, v.field) - } - if len(l.violations) > 0 { - return fmt.Errorf("API rule violations exist") - } - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/config.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/config.go deleted file mode 100644 index d728f2a32ac3..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/config.go +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "fmt" - "path/filepath" - - "k8s.io/gengo/args" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - "k8s.io/klog/v2" - - generatorargs "k8s.io/kube-openapi/cmd/openapi-gen/args" -) - -type identityNamer struct{} - -func (_ identityNamer) Name(t *types.Type) string { - return t.Name.String() -} - -var _ namer.Namer = identityNamer{} - -// NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - return namer.NameSystems{ - "raw": namer.NewRawNamer("", nil), - "sorting_namer": identityNamer{}, - } -} - -// DefaultNameSystem returns the default name system for ordering the types to be -// processed by the generators in this package. -func DefaultNameSystem() string { - return "sorting_namer" -} - -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() - if err != nil { - klog.Fatalf("Failed loading boilerplate: %v", err) - } - header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - header = append(header, []byte( - ` -// This file was autogenerated by openapi-gen. Do not edit it manually! - -`)...) - - reportPath := "-" - if customArgs, ok := arguments.CustomArgs.(*generatorargs.CustomArgs); ok { - reportPath = customArgs.ReportFilename - } - context.FileTypes[apiViolationFileType] = apiViolationFile{ - unmangledPath: reportPath, - } - - return generator.Packages{ - &generator.DefaultPackage{ - PackageName: filepath.Base(arguments.OutputPackagePath), - PackagePath: arguments.OutputPackagePath, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { - return []generator.Generator{ - newOpenAPIGen( - arguments.OutputFileBaseName, - arguments.OutputPackagePath, - ), - newAPIViolationGen(), - } - }, - FilterFunc: apiTypeFilterFunc, - }, - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/enum.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/enum.go deleted file mode 100644 index 292a3c762ae2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/enum.go +++ /dev/null @@ -1,162 +0,0 @@ -/* -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 generators - -import ( - "fmt" - "regexp" - "sort" - "strings" - - "k8s.io/gengo/generator" - "k8s.io/gengo/types" -) - -const tagEnumType = "enum" -const enumTypeDescriptionHeader = "Possible enum values:" - -type enumValue struct { - Name string - Value string - Comment string -} - -type enumType struct { - Name types.Name - Values []*enumValue -} - -// enumMap is a map from the name to the matching enum type. -type enumMap map[types.Name]*enumType - -type enumContext struct { - enumTypes enumMap -} - -func newEnumContext(c *generator.Context) *enumContext { - return &enumContext{enumTypes: parseEnums(c)} -} - -// EnumType checks and finds the enumType for a given type. -// If the given type is a known enum type, returns the enumType, true -// Otherwise, returns nil, false -func (ec *enumContext) EnumType(t *types.Type) (enum *enumType, isEnum bool) { - // if t is a pointer, use its underlying type instead - if t.Kind == types.Pointer { - t = t.Elem - } - enum, ok := ec.enumTypes[t.Name] - return enum, ok -} - -// ValueStrings returns all possible values of the enum type as strings -// the results are sorted and quoted as Go literals. -func (et *enumType) ValueStrings() []string { - var values []string - for _, value := range et.Values { - // use "%q" format to generate a Go literal of the string const value - values = append(values, fmt.Sprintf("%q", value.Value)) - } - sort.Strings(values) - return values -} - -// DescriptionLines returns a description of the enum in this format: -// -// Possible enum values: -// - `"value1"` description 1 -// - `"value2"` description 2 -func (et *enumType) DescriptionLines() []string { - if len(et.Values) == 0 { - return nil - } - var lines []string - for _, value := range et.Values { - lines = append(lines, value.Description()) - } - sort.Strings(lines) - // Prepend an empty string to initiate a new paragraph. - return append([]string{"", enumTypeDescriptionHeader}, lines...) -} - -func parseEnums(c *generator.Context) enumMap { - // First, find the builtin "string" type - stringType := c.Universe.Type(types.Name{Name: "string"}) - - // find all enum types. - enumTypes := make(enumMap) - for _, p := range c.Universe { - for _, t := range p.Types { - if isEnumType(stringType, t) { - if _, ok := enumTypes[t.Name]; !ok { - enumTypes[t.Name] = &enumType{ - Name: t.Name, - } - } - } - } - } - - // find all enum values from constants, and try to match each with its type. - for _, p := range c.Universe { - for _, c := range p.Constants { - enumType := c.Underlying - if _, ok := enumTypes[enumType.Name]; ok { - value := &enumValue{ - Name: c.Name.Name, - Value: *c.ConstValue, - Comment: strings.Join(c.CommentLines, " "), - } - enumTypes[enumType.Name].appendValue(value) - } - } - } - - return enumTypes -} - -func (et *enumType) appendValue(value *enumValue) { - et.Values = append(et.Values, value) -} - -// Description returns the description line for the enumValue -// with the format: -// - `"FooValue"` is the Foo value -func (ev *enumValue) Description() string { - comment := strings.TrimSpace(ev.Comment) - // The comment should starts with the type name, trim it first. - comment = strings.TrimPrefix(comment, ev.Name) - // Trim the possible space after previous step. - comment = strings.TrimSpace(comment) - // The comment may be multiline, cascade all consecutive whitespaces. - comment = whitespaceRegex.ReplaceAllString(comment, " ") - return fmt.Sprintf(" - `%q` %s", ev.Value, comment) -} - -// isEnumType checks if a given type is an enum by the definition -// An enum type should be an alias of string and has tag '+enum' in its comment. -// Additionally, pass the type of builtin 'string' to check against. -func isEnumType(stringType *types.Type, t *types.Type) bool { - return t.Kind == types.Alias && t.Underlying == stringType && hasEnumTag(t) -} - -func hasEnumTag(t *types.Type) bool { - return types.ExtractCommentTags("+", t.CommentLines)[tagEnumType] != nil -} - -// whitespaceRegex is the regex for consecutive whitespaces. -var whitespaceRegex = regexp.MustCompile(`\s+`) diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/extension.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/extension.go deleted file mode 100644 index e37d93ef733b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/extension.go +++ /dev/null @@ -1,202 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "fmt" - "sort" - "strings" - - "k8s.io/gengo/examples/set-gen/sets" - "k8s.io/gengo/types" -) - -const extensionPrefix = "x-kubernetes-" - -// extensionAttributes encapsulates common traits for particular extensions. -type extensionAttributes struct { - xName string - kind types.Kind - allowedValues sets.String - enforceArray bool -} - -// Extension tag to openapi extension attributes -var tagToExtension = map[string]extensionAttributes{ - "patchMergeKey": { - xName: "x-kubernetes-patch-merge-key", - kind: types.Slice, - }, - "patchStrategy": { - xName: "x-kubernetes-patch-strategy", - kind: types.Slice, - allowedValues: sets.NewString("merge", "retainKeys"), - }, - "listMapKey": { - xName: "x-kubernetes-list-map-keys", - kind: types.Slice, - enforceArray: true, - }, - "listType": { - xName: "x-kubernetes-list-type", - kind: types.Slice, - allowedValues: sets.NewString("atomic", "set", "map"), - }, - "mapType": { - xName: "x-kubernetes-map-type", - kind: types.Map, - allowedValues: sets.NewString("atomic", "granular"), - }, - "structType": { - xName: "x-kubernetes-map-type", - kind: types.Struct, - allowedValues: sets.NewString("atomic", "granular"), - }, - "validations": { - xName: "x-kubernetes-validations", - kind: types.Slice, - }, -} - -// Extension encapsulates information necessary to generate an OpenAPI extension. -type extension struct { - idlTag string // Example: listType - xName string // Example: x-kubernetes-list-type - values []string // Example: [atomic] -} - -func (e extension) hasAllowedValues() bool { - return tagToExtension[e.idlTag].allowedValues.Len() > 0 -} - -func (e extension) allowedValues() sets.String { - return tagToExtension[e.idlTag].allowedValues -} - -func (e extension) hasKind() bool { - return len(tagToExtension[e.idlTag].kind) > 0 -} - -func (e extension) kind() types.Kind { - return tagToExtension[e.idlTag].kind -} - -func (e extension) validateAllowedValues() error { - // allowedValues not set means no restrictions on values. - if !e.hasAllowedValues() { - return nil - } - // Check for missing value. - if len(e.values) == 0 { - return fmt.Errorf("%s needs a value, none given.", e.idlTag) - } - // For each extension value, validate that it is allowed. - allowedValues := e.allowedValues() - if !allowedValues.HasAll(e.values...) { - return fmt.Errorf("%v not allowed for %s. Allowed values: %v", - e.values, e.idlTag, allowedValues.List()) - } - return nil -} - -func (e extension) validateType(kind types.Kind) error { - // If this extension class has no kind, then don't validate the type. - if !e.hasKind() { - return nil - } - if kind != e.kind() { - return fmt.Errorf("tag %s on type %v; only allowed on type %v", - e.idlTag, kind, e.kind()) - } - return nil -} - -func (e extension) hasMultipleValues() bool { - return len(e.values) > 1 -} - -func (e extension) isAlwaysArrayFormat() bool { - return tagToExtension[e.idlTag].enforceArray -} - -// Returns sorted list of map keys. Needed for deterministic testing. -func sortedMapKeys(m map[string][]string) []string { - keys := make([]string, len(m)) - i := 0 - for k := range m { - keys[i] = k - i++ - } - sort.Strings(keys) - return keys -} - -// Parses comments to return openapi extensions. Returns a list of -// extensions which parsed correctly, as well as a list of the -// parse errors. Validating extensions is performed separately. -// NOTE: Non-empty errors does not mean extensions is empty. -func parseExtensions(comments []string) ([]extension, []error) { - extensions := []extension{} - errors := []error{} - // First, generate extensions from "+k8s:openapi-gen=x-kubernetes-*" annotations. - values := getOpenAPITagValue(comments) - for _, val := range values { - // Example: x-kubernetes-member-tag:member_test - if strings.HasPrefix(val, extensionPrefix) { - parts := strings.SplitN(val, ":", 2) - if len(parts) != 2 { - errors = append(errors, fmt.Errorf("invalid extension value: %v", val)) - continue - } - e := extension{ - idlTag: tagName, // Example: k8s:openapi-gen - xName: parts[0], // Example: x-kubernetes-member-tag - values: []string{parts[1]}, // Example: member_test - } - extensions = append(extensions, e) - } - } - // Next, generate extensions from "idlTags" (e.g. +listType) - tagValues := types.ExtractCommentTags("+", comments) - for _, idlTag := range sortedMapKeys(tagValues) { - xAttrs, exists := tagToExtension[idlTag] - if !exists { - continue - } - values := tagValues[idlTag] - e := extension{ - idlTag: idlTag, // listType - xName: xAttrs.xName, // x-kubernetes-list-type - values: values, // [atomic] - } - extensions = append(extensions, e) - } - return extensions, errors -} - -func validateMemberExtensions(extensions []extension, m *types.Member) []error { - errors := []error{} - for _, e := range extensions { - if err := e.validateAllowedValues(); err != nil { - errors = append(errors, err) - } - if err := e.validateType(m.Type.Kind); err != nil { - errors = append(errors, err) - } - } - return errors -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go deleted file mode 100644 index a4bbe8b5e115..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go +++ /dev/null @@ -1,871 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "path/filepath" - "reflect" - "sort" - "strings" - - defaultergen "k8s.io/gengo/examples/defaulter-gen/generators" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - openapi "k8s.io/kube-openapi/pkg/common" - - "k8s.io/klog/v2" -) - -// This is the comment tag that carries parameters for open API generation. -const tagName = "k8s:openapi-gen" -const tagOptional = "optional" -const tagDefault = "default" - -// Known values for the tag. -const ( - tagValueTrue = "true" - tagValueFalse = "false" -) - -// Used for temporary validation of patch struct tags. -// TODO: Remove patch struct tag validation because they we are now consuming OpenAPI on server. -var tempPatchTags = [...]string{ - "patchMergeKey", - "patchStrategy", -} - -func getOpenAPITagValue(comments []string) []string { - return types.ExtractCommentTags("+", comments)[tagName] -} - -func getSingleTagsValue(comments []string, tag string) (string, error) { - tags, ok := types.ExtractCommentTags("+", comments)[tag] - if !ok || len(tags) == 0 { - return "", nil - } - if len(tags) > 1 { - return "", fmt.Errorf("multiple values are not allowed for tag %s", tag) - } - return tags[0], nil -} - -func hasOpenAPITagValue(comments []string, value string) bool { - tagValues := getOpenAPITagValue(comments) - for _, val := range tagValues { - if val == value { - return true - } - } - return false -} - -// hasOptionalTag returns true if the member has +optional in its comments or -// omitempty in its json tags. -func hasOptionalTag(m *types.Member) bool { - hasOptionalCommentTag := types.ExtractCommentTags( - "+", m.CommentLines)[tagOptional] != nil - hasOptionalJsonTag := strings.Contains( - reflect.StructTag(m.Tags).Get("json"), "omitempty") - return hasOptionalCommentTag || hasOptionalJsonTag -} - -func apiTypeFilterFunc(c *generator.Context, t *types.Type) bool { - // There is a conflict between this codegen and codecgen, we should avoid types generated for codecgen - if strings.HasPrefix(t.Name.Name, "codecSelfer") { - return false - } - pkg := c.Universe.Package(t.Name.Package) - if hasOpenAPITagValue(pkg.Comments, tagValueTrue) { - return !hasOpenAPITagValue(t.CommentLines, tagValueFalse) - } - if hasOpenAPITagValue(t.CommentLines, tagValueTrue) { - return true - } - return false -} - -const ( - specPackagePath = "k8s.io/kube-openapi/pkg/validation/spec" - openAPICommonPackagePath = "k8s.io/kube-openapi/pkg/common" -) - -// openApiGen produces a file with auto-generated OpenAPI functions. -type openAPIGen struct { - generator.DefaultGen - // TargetPackage is the package that will get GetOpenAPIDefinitions function returns all open API definitions. - targetPackage string - imports namer.ImportTracker -} - -func newOpenAPIGen(sanitizedName string, targetPackage string) generator.Generator { - return &openAPIGen{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, - }, - imports: generator.NewImportTrackerForPackage(targetPackage), - targetPackage: targetPackage, - } -} - -const nameTmpl = "schema_$.type|private$" - -func (g *openAPIGen) Namers(c *generator.Context) namer.NameSystems { - // Have the raw namer for this file track what it imports. - return namer.NameSystems{ - "raw": namer.NewRawNamer(g.targetPackage, g.imports), - "private": &namer.NameStrategy{ - Join: func(pre string, in []string, post string) string { - return strings.Join(in, "_") - }, - PrependPackageNames: 4, // enough to fully qualify from k8s.io/api/... - }, - } -} - -func (g *openAPIGen) isOtherPackage(pkg string) bool { - if pkg == g.targetPackage { - return false - } - if strings.HasSuffix(pkg, "\""+g.targetPackage+"\"") { - return false - } - return true -} - -func (g *openAPIGen) Imports(c *generator.Context) []string { - importLines := []string{} - for _, singleImport := range g.imports.ImportLines() { - importLines = append(importLines, singleImport) - } - return importLines -} - -func argsFromType(t *types.Type) generator.Args { - return generator.Args{ - "type": t, - "ReferenceCallback": types.Ref(openAPICommonPackagePath, "ReferenceCallback"), - "OpenAPIDefinition": types.Ref(openAPICommonPackagePath, "OpenAPIDefinition"), - "SpecSchemaType": types.Ref(specPackagePath, "Schema"), - } -} - -func (g *openAPIGen) Init(c *generator.Context, w io.Writer) error { - sw := generator.NewSnippetWriter(w, c, "$", "$") - sw.Do("func GetOpenAPIDefinitions(ref $.ReferenceCallback|raw$) map[string]$.OpenAPIDefinition|raw$ {\n", argsFromType(nil)) - sw.Do("return map[string]$.OpenAPIDefinition|raw${\n", argsFromType(nil)) - - for _, t := range c.Order { - err := newOpenAPITypeWriter(sw, c).generateCall(t) - if err != nil { - return err - } - } - - sw.Do("}\n", nil) - sw.Do("}\n\n", nil) - - return sw.Error() -} - -func (g *openAPIGen) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { - klog.V(5).Infof("generating for type %v", t) - sw := generator.NewSnippetWriter(w, c, "$", "$") - err := newOpenAPITypeWriter(sw, c).generate(t) - if err != nil { - return err - } - return sw.Error() -} - -func getJsonTags(m *types.Member) []string { - jsonTag := reflect.StructTag(m.Tags).Get("json") - if jsonTag == "" { - return []string{} - } - return strings.Split(jsonTag, ",") -} - -func getReferableName(m *types.Member) string { - jsonTags := getJsonTags(m) - if len(jsonTags) > 0 { - if jsonTags[0] == "-" { - return "" - } else { - return jsonTags[0] - } - } else { - return m.Name - } -} - -func shouldInlineMembers(m *types.Member) bool { - jsonTags := getJsonTags(m) - return len(jsonTags) > 1 && jsonTags[1] == "inline" -} - -type openAPITypeWriter struct { - *generator.SnippetWriter - context *generator.Context - refTypes map[string]*types.Type - enumContext *enumContext - GetDefinitionInterface *types.Type -} - -func newOpenAPITypeWriter(sw *generator.SnippetWriter, c *generator.Context) openAPITypeWriter { - return openAPITypeWriter{ - SnippetWriter: sw, - context: c, - refTypes: map[string]*types.Type{}, - enumContext: newEnumContext(c), - } -} - -func methodReturnsValue(mt *types.Type, pkg, name string) bool { - if len(mt.Signature.Parameters) != 0 || len(mt.Signature.Results) != 1 { - return false - } - r := mt.Signature.Results[0] - return r.Name.Name == name && r.Name.Package == pkg -} - -func hasOpenAPIV3DefinitionMethod(t *types.Type) bool { - for mn, mt := range t.Methods { - if mn != "OpenAPIV3Definition" { - continue - } - return methodReturnsValue(mt, openAPICommonPackagePath, "OpenAPIDefinition") - } - return false -} - -func hasOpenAPIDefinitionMethod(t *types.Type) bool { - for mn, mt := range t.Methods { - if mn != "OpenAPIDefinition" { - continue - } - return methodReturnsValue(mt, openAPICommonPackagePath, "OpenAPIDefinition") - } - return false -} - -func hasOpenAPIDefinitionMethods(t *types.Type) bool { - var hasSchemaTypeMethod, hasOpenAPISchemaFormat bool - for mn, mt := range t.Methods { - switch mn { - case "OpenAPISchemaType": - hasSchemaTypeMethod = methodReturnsValue(mt, "", "[]string") - case "OpenAPISchemaFormat": - hasOpenAPISchemaFormat = methodReturnsValue(mt, "", "string") - } - } - return hasSchemaTypeMethod && hasOpenAPISchemaFormat -} - -func hasOpenAPIV3OneOfMethod(t *types.Type) bool { - for mn, mt := range t.Methods { - if mn != "OpenAPIV3OneOfTypes" { - continue - } - return methodReturnsValue(mt, "", "[]string") - } - return false -} - -// typeShortName returns short package name (e.g. the name x appears in package x definition) dot type name. -func typeShortName(t *types.Type) string { - return filepath.Base(t.Name.Package) + "." + t.Name.Name -} - -func (g openAPITypeWriter) generateMembers(t *types.Type, required []string) ([]string, error) { - var err error - for t.Kind == types.Pointer { // fast-forward to effective type containing members - t = t.Elem - } - for _, m := range t.Members { - if hasOpenAPITagValue(m.CommentLines, tagValueFalse) { - continue - } - if shouldInlineMembers(&m) { - required, err = g.generateMembers(m.Type, required) - if err != nil { - return required, err - } - continue - } - name := getReferableName(&m) - if name == "" { - continue - } - if !hasOptionalTag(&m) { - required = append(required, name) - } - if err = g.generateProperty(&m, t); err != nil { - klog.Errorf("Error when generating: %v, %v\n", name, m) - return required, err - } - } - return required, nil -} - -func (g openAPITypeWriter) generateCall(t *types.Type) error { - // Only generate for struct type and ignore the rest - switch t.Kind { - case types.Struct: - args := argsFromType(t) - g.Do("\"$.$\": ", t.Name) - - hasV2Definition := hasOpenAPIDefinitionMethod(t) - hasV2DefinitionTypeAndFormat := hasOpenAPIDefinitionMethods(t) - hasV3Definition := hasOpenAPIV3DefinitionMethod(t) - - switch { - case hasV2DefinitionTypeAndFormat: - g.Do(nameTmpl+"(ref),\n", args) - case hasV2Definition && hasV3Definition: - g.Do("common.EmbedOpenAPIDefinitionIntoV2Extension($.type|raw${}.OpenAPIV3Definition(), $.type|raw${}.OpenAPIDefinition()),\n", args) - case hasV2Definition: - g.Do("$.type|raw${}.OpenAPIDefinition(),\n", args) - case hasV3Definition: - g.Do("$.type|raw${}.OpenAPIV3Definition(),\n", args) - default: - g.Do(nameTmpl+"(ref),\n", args) - } - } - return g.Error() -} - -func (g openAPITypeWriter) generate(t *types.Type) error { - // Only generate for struct type and ignore the rest - switch t.Kind { - case types.Struct: - hasV2Definition := hasOpenAPIDefinitionMethod(t) - hasV2DefinitionTypeAndFormat := hasOpenAPIDefinitionMethods(t) - hasV3OneOfTypes := hasOpenAPIV3OneOfMethod(t) - hasV3Definition := hasOpenAPIV3DefinitionMethod(t) - - if hasV2Definition || (hasV3Definition && !hasV2DefinitionTypeAndFormat) { - // already invoked directly - return nil - } - - args := argsFromType(t) - g.Do("func "+nameTmpl+"(ref $.ReferenceCallback|raw$) $.OpenAPIDefinition|raw$ {\n", args) - switch { - case hasV2DefinitionTypeAndFormat && hasV3Definition: - g.Do("return common.EmbedOpenAPIDefinitionIntoV2Extension($.type|raw${}.OpenAPIV3Definition(), $.OpenAPIDefinition|raw${\n"+ - "Schema: spec.Schema{\n"+ - "SchemaProps: spec.SchemaProps{\n", args) - g.generateDescription(t.CommentLines) - g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ - "},\n"+ - "})\n}\n\n", args) - return nil - case hasV2DefinitionTypeAndFormat && hasV3OneOfTypes: - // generate v3 def. - g.Do("return common.EmbedOpenAPIDefinitionIntoV2Extension($.OpenAPIDefinition|raw${\n"+ - "Schema: spec.Schema{\n"+ - "SchemaProps: spec.SchemaProps{\n", args) - g.generateDescription(t.CommentLines) - g.Do("OneOf:common.GenerateOpenAPIV3OneOfSchema($.type|raw${}.OpenAPIV3OneOfTypes()),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ - "},\n"+ - "},", args) - // generate v2 def. - g.Do("$.OpenAPIDefinition|raw${\n"+ - "Schema: spec.Schema{\n"+ - "SchemaProps: spec.SchemaProps{\n", args) - g.generateDescription(t.CommentLines) - g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ - "},\n"+ - "})\n}\n\n", args) - return nil - case hasV2DefinitionTypeAndFormat: - g.Do("return $.OpenAPIDefinition|raw${\n"+ - "Schema: spec.Schema{\n"+ - "SchemaProps: spec.SchemaProps{\n", args) - g.generateDescription(t.CommentLines) - g.Do("Type:$.type|raw${}.OpenAPISchemaType(),\n"+ - "Format:$.type|raw${}.OpenAPISchemaFormat(),\n"+ - "},\n"+ - "},\n"+ - "}\n}\n\n", args) - return nil - case hasV3OneOfTypes: - // having v3 oneOf types without custom v2 type or format does not make sense. - return fmt.Errorf("type %q has v3 one of types but not v2 type or format", t.Name) - } - g.Do("return $.OpenAPIDefinition|raw${\nSchema: spec.Schema{\nSchemaProps: spec.SchemaProps{\n", args) - g.generateDescription(t.CommentLines) - g.Do("Type: []string{\"object\"},\n", nil) - - // write members into a temporary buffer, in order to postpone writing out the Properties field. We only do - // that if it is not empty. - propertiesBuf := bytes.Buffer{} - bsw := g - bsw.SnippetWriter = generator.NewSnippetWriter(&propertiesBuf, g.context, "$", "$") - required, err := bsw.generateMembers(t, []string{}) - if err != nil { - return err - } - if propertiesBuf.Len() > 0 { - g.Do("Properties: map[string]$.SpecSchemaType|raw${\n", args) - g.Do(strings.Replace(propertiesBuf.String(), "$", "$\"$\"$", -1), nil) // escape $ (used as delimiter of the templates) - g.Do("},\n", nil) - } - - if len(required) > 0 { - g.Do("Required: []string{\"$.$\"},\n", strings.Join(required, "\",\"")) - } - g.Do("},\n", nil) - if err := g.generateStructExtensions(t); err != nil { - return err - } - g.Do("},\n", nil) - - // Map order is undefined, sort them or we may get a different file generated each time. - keys := []string{} - for k := range g.refTypes { - keys = append(keys, k) - } - sort.Strings(keys) - deps := []string{} - for _, k := range keys { - v := g.refTypes[k] - if t, _ := openapi.OpenAPITypeFormat(v.String()); t != "" { - // This is a known type, we do not need a reference to it - // Will eliminate special case of time.Time - continue - } - deps = append(deps, k) - } - if len(deps) > 0 { - g.Do("Dependencies: []string{\n", args) - for _, k := range deps { - g.Do("\"$.$\",", k) - } - g.Do("},\n", nil) - } - g.Do("}\n}\n\n", nil) - } - return nil -} - -func (g openAPITypeWriter) generateStructExtensions(t *types.Type) error { - extensions, errors := parseExtensions(t.CommentLines) - // Initially, we will only log struct extension errors. - if len(errors) > 0 { - for _, e := range errors { - klog.Errorf("[%s]: %s\n", t.String(), e) - } - } - unions, errors := parseUnions(t) - if len(errors) > 0 { - for _, e := range errors { - klog.Errorf("[%s]: %s\n", t.String(), e) - } - } - - // TODO(seans3): Validate struct extensions here. - g.emitExtensions(extensions, unions) - return nil -} - -func (g openAPITypeWriter) generateMemberExtensions(m *types.Member, parent *types.Type) error { - extensions, parseErrors := parseExtensions(m.CommentLines) - validationErrors := validateMemberExtensions(extensions, m) - errors := append(parseErrors, validationErrors...) - // Initially, we will only log member extension errors. - if len(errors) > 0 { - errorPrefix := fmt.Sprintf("[%s] %s:", parent.String(), m.String()) - for _, e := range errors { - klog.V(2).Infof("%s %s\n", errorPrefix, e) - } - } - g.emitExtensions(extensions, nil) - return nil -} - -func (g openAPITypeWriter) emitExtensions(extensions []extension, unions []union) { - // If any extensions exist, then emit code to create them. - if len(extensions) == 0 && len(unions) == 0 { - return - } - g.Do("VendorExtensible: spec.VendorExtensible{\nExtensions: spec.Extensions{\n", nil) - for _, extension := range extensions { - g.Do("\"$.$\": ", extension.xName) - if extension.hasMultipleValues() || extension.isAlwaysArrayFormat() { - g.Do("[]interface{}{\n", nil) - } - for _, value := range extension.values { - g.Do("\"$.$\",\n", value) - } - if extension.hasMultipleValues() || extension.isAlwaysArrayFormat() { - g.Do("},\n", nil) - } - } - if len(unions) > 0 { - g.Do("\"x-kubernetes-unions\": []interface{}{\n", nil) - for _, u := range unions { - u.emit(g) - } - g.Do("},\n", nil) - } - g.Do("},\n},\n", nil) -} - -// TODO(#44005): Move this validation outside of this generator (probably to policy verifier) -func (g openAPITypeWriter) validatePatchTags(m *types.Member, parent *types.Type) error { - // TODO: Remove patch struct tag validation because they we are now consuming OpenAPI on server. - for _, tagKey := range tempPatchTags { - structTagValue := reflect.StructTag(m.Tags).Get(tagKey) - commentTagValue, err := getSingleTagsValue(m.CommentLines, tagKey) - if err != nil { - return err - } - if structTagValue != commentTagValue { - return fmt.Errorf("Tags in comment and struct should match for member (%s) of (%s)", - m.Name, parent.Name.String()) - } - } - return nil -} - -func defaultFromComments(comments []string, commentPath string, t *types.Type) (interface{}, *types.Name, error) { - var tag string - - for { - var err error - tag, err = getSingleTagsValue(comments, tagDefault) - if err != nil { - return nil, nil, err - } - - if t == nil || len(tag) > 0 { - break - } - - comments = t.CommentLines - commentPath = t.Name.Package - switch t.Kind { - case types.Pointer: - t = t.Elem - case types.Alias: - t = t.Underlying - default: - t = nil - } - } - - if tag == "" { - return nil, nil, nil - } - - var i interface{} - if id, ok := defaultergen.ParseSymbolReference(tag, commentPath); ok { - klog.Errorf("%v, %v", id, commentPath) - return nil, &id, nil - } else if err := json.Unmarshal([]byte(tag), &i); err != nil { - return nil, nil, fmt.Errorf("failed to unmarshal default: %v", err) - } - return i, nil, nil -} - -func implementsCustomUnmarshalling(t *types.Type) bool { - switch t.Kind { - case types.Pointer: - unmarshaller, isUnmarshaller := t.Elem.Methods["UnmarshalJSON"] - return isUnmarshaller && unmarshaller.Signature.Receiver.Kind == types.Pointer - case types.Struct: - _, isUnmarshaller := t.Methods["UnmarshalJSON"] - return isUnmarshaller - default: - return false - } -} - -func mustEnforceDefault(t *types.Type, omitEmpty bool) (interface{}, error) { - // Treat types with custom unmarshalling as a value - // (Can be alias, struct, or pointer) - if implementsCustomUnmarshalling(t) { - // Since Go JSON deserializer always feeds `null` when present - // to structs with custom UnmarshalJSON, the zero value for - // these structs is also null. - // - // In general, Kubernetes API types with custom marshalling should - // marshal their empty values to `null`. - return nil, nil - } - - switch t.Kind { - case types.Alias: - return mustEnforceDefault(t.Underlying, omitEmpty) - case types.Pointer, types.Map, types.Slice, types.Array, types.Interface: - return nil, nil - case types.Struct: - if len(t.Members) == 1 && t.Members[0].Embedded { - // Treat a struct with a single embedded member the same as an alias - return mustEnforceDefault(t.Members[0].Type, omitEmpty) - } - - return map[string]interface{}{}, nil - case types.Builtin: - if !omitEmpty { - if zero, ok := openapi.OpenAPIZeroValue(t.String()); ok { - return zero, nil - } else { - return nil, fmt.Errorf("please add type %v to getOpenAPITypeFormat function", t) - } - } - return nil, nil - default: - return nil, fmt.Errorf("not sure how to enforce default for %v", t.Kind) - } -} - -func (g openAPITypeWriter) generateDefault(comments []string, t *types.Type, omitEmpty bool, commentOwningType *types.Type) error { - def, ref, err := defaultFromComments(comments, commentOwningType.Name.Package, t) - if err != nil { - return err - } - if enforced, err := mustEnforceDefault(t, omitEmpty); err != nil { - return err - } else if enforced != nil { - if def == nil { - def = enforced - } else if !reflect.DeepEqual(def, enforced) { - enforcedJson, _ := json.Marshal(enforced) - return fmt.Errorf("invalid default value (%#v) for non-pointer/non-omitempty. If specified, must be: %v", def, string(enforcedJson)) - } - } - if def != nil { - g.Do("Default: $.$,\n", fmt.Sprintf("%#v", def)) - } else if ref != nil { - g.Do("Default: $.|raw$,\n", &types.Type{Name: *ref}) - } - return nil -} - -func (g openAPITypeWriter) generateDescription(CommentLines []string) { - var buffer bytes.Buffer - delPrevChar := func() { - if buffer.Len() > 0 { - buffer.Truncate(buffer.Len() - 1) // Delete the last " " or "\n" - } - } - - for _, line := range CommentLines { - // Ignore all lines after --- - if line == "---" { - break - } - line = strings.TrimRight(line, " ") - leading := strings.TrimLeft(line, " ") - switch { - case len(line) == 0: // Keep paragraphs - delPrevChar() - buffer.WriteString("\n\n") - case strings.HasPrefix(leading, "TODO"): // Ignore one line TODOs - case strings.HasPrefix(leading, "+"): // Ignore instructions to go2idl - default: - if strings.HasPrefix(line, " ") || strings.HasPrefix(line, "\t") { - delPrevChar() - line = "\n" + line + "\n" // Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-something..." - } else { - line += " " - } - buffer.WriteString(line) - } - } - - postDoc := strings.TrimLeft(buffer.String(), "\n") - postDoc = strings.TrimRight(postDoc, "\n") - postDoc = strings.Replace(postDoc, "\\\"", "\"", -1) // replace user's \" to " - postDoc = strings.Replace(postDoc, "\"", "\\\"", -1) // Escape " - postDoc = strings.Replace(postDoc, "\n", "\\n", -1) - postDoc = strings.Replace(postDoc, "\t", "\\t", -1) - postDoc = strings.Trim(postDoc, " ") - if postDoc != "" { - g.Do("Description: \"$.$\",\n", postDoc) - } -} - -func (g openAPITypeWriter) generateProperty(m *types.Member, parent *types.Type) error { - name := getReferableName(m) - if name == "" { - return nil - } - if err := g.validatePatchTags(m, parent); err != nil { - return err - } - g.Do("\"$.$\": {\n", name) - if err := g.generateMemberExtensions(m, parent); err != nil { - return err - } - g.Do("SchemaProps: spec.SchemaProps{\n", nil) - var extraComments []string - if enumType, isEnum := g.enumContext.EnumType(m.Type); isEnum { - extraComments = enumType.DescriptionLines() - } - g.generateDescription(append(m.CommentLines, extraComments...)) - jsonTags := getJsonTags(m) - if len(jsonTags) > 1 && jsonTags[1] == "string" { - g.generateSimpleProperty("string", "") - g.Do("},\n},\n", nil) - return nil - } - omitEmpty := strings.Contains(reflect.StructTag(m.Tags).Get("json"), "omitempty") - if err := g.generateDefault(m.CommentLines, m.Type, omitEmpty, parent); err != nil { - return fmt.Errorf("failed to generate default in %v: %v: %v", parent, m.Name, err) - } - t := resolveAliasAndPtrType(m.Type) - // If we can get a openAPI type and format for this type, we consider it to be simple property - typeString, format := openapi.OpenAPITypeFormat(t.String()) - if typeString != "" { - g.generateSimpleProperty(typeString, format) - if enumType, isEnum := g.enumContext.EnumType(m.Type); isEnum { - // original type is an enum, add "Enum: " and the values - g.Do("Enum: []interface{}{$.$},\n", strings.Join(enumType.ValueStrings(), ", ")) - } - g.Do("},\n},\n", nil) - return nil - } - switch t.Kind { - case types.Builtin: - return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", t) - case types.Map: - if err := g.generateMapProperty(t); err != nil { - return fmt.Errorf("failed to generate map property in %v: %v: %v", parent, m.Name, err) - } - case types.Slice, types.Array: - if err := g.generateSliceProperty(t); err != nil { - return fmt.Errorf("failed to generate slice property in %v: %v: %v", parent, m.Name, err) - } - case types.Struct, types.Interface: - g.generateReferenceProperty(t) - default: - return fmt.Errorf("cannot generate spec for type %v", t) - } - g.Do("},\n},\n", nil) - return g.Error() -} - -func (g openAPITypeWriter) generateSimpleProperty(typeString, format string) { - g.Do("Type: []string{\"$.$\"},\n", typeString) - g.Do("Format: \"$.$\",\n", format) -} - -func (g openAPITypeWriter) generateReferenceProperty(t *types.Type) { - g.refTypes[t.Name.String()] = t - g.Do("Ref: ref(\"$.$\"),\n", t.Name.String()) -} - -func resolveAliasAndPtrType(t *types.Type) *types.Type { - var prev *types.Type - for prev != t { - prev = t - if t.Kind == types.Alias { - t = t.Underlying - } - if t.Kind == types.Pointer { - t = t.Elem - } - } - return t -} - -func (g openAPITypeWriter) generateMapProperty(t *types.Type) error { - keyType := resolveAliasAndPtrType(t.Key) - elemType := resolveAliasAndPtrType(t.Elem) - - // According to OpenAPI examples, only map from string is supported - if keyType.Name.Name != "string" { - return fmt.Errorf("map with non-string keys are not supported by OpenAPI in %v", t) - } - - g.Do("Type: []string{\"object\"},\n", nil) - g.Do("AdditionalProperties: &spec.SchemaOrBool{\nAllows: true,\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil) - if err := g.generateDefault(t.Elem.CommentLines, t.Elem, false, t.Elem); err != nil { - return err - } - typeString, format := openapi.OpenAPITypeFormat(elemType.String()) - if typeString != "" { - g.generateSimpleProperty(typeString, format) - g.Do("},\n},\n},\n", nil) - return nil - } - switch elemType.Kind { - case types.Builtin: - return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", elemType) - case types.Struct: - g.generateReferenceProperty(elemType) - case types.Slice, types.Array: - if err := g.generateSliceProperty(elemType); err != nil { - return err - } - case types.Map: - if err := g.generateMapProperty(elemType); err != nil { - return err - } - default: - return fmt.Errorf("map Element kind %v is not supported in %v", elemType.Kind, t.Name) - } - g.Do("},\n},\n},\n", nil) - return nil -} - -func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error { - elemType := resolveAliasAndPtrType(t.Elem) - g.Do("Type: []string{\"array\"},\n", nil) - g.Do("Items: &spec.SchemaOrArray{\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil) - if err := g.generateDefault(t.Elem.CommentLines, t.Elem, false, t.Elem); err != nil { - return err - } - typeString, format := openapi.OpenAPITypeFormat(elemType.String()) - if typeString != "" { - g.generateSimpleProperty(typeString, format) - g.Do("},\n},\n},\n", nil) - return nil - } - switch elemType.Kind { - case types.Builtin: - return fmt.Errorf("please add type %v to getOpenAPITypeFormat function", elemType) - case types.Struct: - g.generateReferenceProperty(elemType) - case types.Slice, types.Array: - if err := g.generateSliceProperty(elemType); err != nil { - return err - } - case types.Map: - if err := g.generateMapProperty(elemType); err != nil { - return err - } - default: - return fmt.Errorf("slice Element kind %v is not supported in %v", elemType.Kind, t) - } - g.Do("},\n},\n},\n", nil) - return nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS deleted file mode 100644 index 235bc545b88b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -reviewers: -- roycaihw -approvers: -- roycaihw diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/doc.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/doc.go deleted file mode 100644 index 384a44dca07e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 rules contains API rules that are enforced in OpenAPI spec generation -// as part of the machinery. Files under this package implement APIRule interface -// which evaluates Go type and produces list of API rule violations. -// -// Implementations of APIRule should be added to API linter under openAPIGen code- -// generator to get integrated in the generation process. -package rules diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go deleted file mode 100644 index 474d79e89dce..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/idl_tag.go +++ /dev/null @@ -1,53 +0,0 @@ -package rules - -import ( - "k8s.io/gengo/types" -) - -const ListTypeIDLTag = "listType" - -// ListTypeMissing implements APIRule interface. -// A list type is required for inlined list. -type ListTypeMissing struct{} - -// Name returns the name of APIRule -func (l *ListTypeMissing) Name() string { - return "list_type_missing" -} - -// Validate evaluates API rule on type t and returns a list of field names in -// the type that violate the rule. Empty field name [""] implies the entire -// type violates the rule. -func (l *ListTypeMissing) Validate(t *types.Type) ([]string, error) { - fields := make([]string, 0) - - switch t.Kind { - case types.Struct: - for _, m := range t.Members { - hasListType := types.ExtractCommentTags("+", m.CommentLines)[ListTypeIDLTag] != nil - - if m.Name == "Items" && m.Type.Kind == types.Slice && hasNamedMember(t, "ListMeta") { - if hasListType { - fields = append(fields, m.Name) - } - continue - } - - if m.Type.Kind == types.Slice && !hasListType { - fields = append(fields, m.Name) - continue - } - } - } - - return fields, nil -} - -func hasNamedMember(t *types.Type, name string) bool { - for _, m := range t.Members { - if m.Name == name { - return true - } - } - return false -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go deleted file mode 100644 index 581722257f06..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/names_match.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 rules - -import ( - "reflect" - "strings" - - "k8s.io/kube-openapi/pkg/util/sets" - - "k8s.io/gengo/types" -) - -var ( - // Blacklist of JSON tags that should skip match evaluation - jsonTagBlacklist = sets.NewString( - // Omitted field is ignored by the package - "-", - ) - - // Blacklist of JSON names that should skip match evaluation - jsonNameBlacklist = sets.NewString( - // Empty name is used for inline struct field (e.g. metav1.TypeMeta) - "", - // Special case for object and list meta - "metadata", - ) - - // List of substrings that aren't allowed in Go name and JSON name - disallowedNameSubstrings = sets.NewString( - // Underscore is not allowed in either name - "_", - // Dash is not allowed in either name. Note that since dash is a valid JSON tag, this should be checked - // after JSON tag blacklist check. - "-", - ) -) - -/* -NamesMatch implements APIRule interface. -Go field names must be CamelCase. JSON field names must be camelCase. Other than capitalization of the -initial letter, the two should almost always match. No underscores nor dashes in either. -This rule verifies the convention "Other than capitalization of the initial letter, the two should almost always match." -Examples (also in unit test): - - Go name | JSON name | match - podSpec false - PodSpec podSpec true - PodSpec PodSpec false - podSpec podSpec false - PodSpec spec false - Spec podSpec false - JSONSpec jsonSpec true - JSONSpec jsonspec false - HTTPJSONSpec httpJSONSpec true - -NOTE: this validator cannot tell two sequential all-capital words from one word, therefore the case below -is also considered matched. - - HTTPJSONSpec httpjsonSpec true - -NOTE: JSON names in jsonNameBlacklist should skip evaluation - - true - podSpec true - podSpec - true - podSpec metadata true -*/ -type NamesMatch struct{} - -// Name returns the name of APIRule -func (n *NamesMatch) Name() string { - return "names_match" -} - -// Validate evaluates API rule on type t and returns a list of field names in -// the type that violate the rule. Empty field name [""] implies the entire -// type violates the rule. -func (n *NamesMatch) Validate(t *types.Type) ([]string, error) { - fields := make([]string, 0) - - // Only validate struct type and ignore the rest - switch t.Kind { - case types.Struct: - for _, m := range t.Members { - goName := m.Name - jsonTag, ok := reflect.StructTag(m.Tags).Lookup("json") - // Distinguish empty JSON tag and missing JSON tag. Empty JSON tag / name is - // allowed (in JSON name blacklist) but missing JSON tag is invalid. - if !ok { - fields = append(fields, goName) - continue - } - if jsonTagBlacklist.Has(jsonTag) { - continue - } - jsonName := strings.Split(jsonTag, ",")[0] - if !namesMatch(goName, jsonName) { - fields = append(fields, goName) - } - } - } - return fields, nil -} - -// namesMatch evaluates if goName and jsonName match the API rule -// TODO: Use an off-the-shelf CamelCase solution instead of implementing this logic. The following existing -// -// packages have been tried out: -// github.com/markbates/inflect -// github.com/segmentio/go-camelcase -// github.com/iancoleman/strcase -// github.com/fatih/camelcase -// Please see https://github.com/kubernetes/kube-openapi/pull/83#issuecomment-400842314 for more details -// about why they don't satisfy our need. What we need can be a function that detects an acronym at the -// beginning of a string. -func namesMatch(goName, jsonName string) bool { - if jsonNameBlacklist.Has(jsonName) { - return true - } - if !isAllowedName(goName) || !isAllowedName(jsonName) { - return false - } - if strings.ToLower(goName) != strings.ToLower(jsonName) { - return false - } - // Go field names must be CamelCase. JSON field names must be camelCase. - if !isCapital(goName[0]) || isCapital(jsonName[0]) { - return false - } - for i := 0; i < len(goName); i++ { - if goName[i] == jsonName[i] { - // goName[0:i-1] is uppercase and jsonName[0:i-1] is lowercase, goName[i:] - // and jsonName[i:] should match; - // goName[i] should be lowercase if i is equal to 1, e.g.: - // goName | jsonName - // PodSpec podSpec - // or uppercase if i is greater than 1, e.g.: - // goname | jsonName - // JSONSpec jsonSpec - // This is to rule out cases like: - // goname | jsonName - // JSONSpec jsonspec - return goName[i:] == jsonName[i:] && (i == 1 || isCapital(goName[i])) - } - } - return true -} - -// isCapital returns true if one character is capital -func isCapital(b byte) bool { - return b >= 'A' && b <= 'Z' -} - -// isAllowedName checks the list of disallowedNameSubstrings and returns true if name doesn't contain -// any disallowed substring. -func isAllowedName(name string) bool { - for _, substr := range disallowedNameSubstrings.UnsortedList() { - if strings.Contains(name, substr) { - return false - } - } - return true -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/omitempty_match_case.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/omitempty_match_case.go deleted file mode 100644 index dd37ad8a578a..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/rules/omitempty_match_case.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 rules - -import ( - "reflect" - "strings" - - "k8s.io/gengo/types" -) - -// OmitEmptyMatchCase implements APIRule interface. -// "omitempty" must appear verbatim (no case variants). -type OmitEmptyMatchCase struct{} - -func (n *OmitEmptyMatchCase) Name() string { - return "omitempty_match_case" -} - -func (n *OmitEmptyMatchCase) Validate(t *types.Type) ([]string, error) { - fields := make([]string, 0) - - // Only validate struct type and ignore the rest - switch t.Kind { - case types.Struct: - for _, m := range t.Members { - goName := m.Name - jsonTag, ok := reflect.StructTag(m.Tags).Lookup("json") - if !ok { - continue - } - - parts := strings.Split(jsonTag, ",") - if len(parts) < 2 { - // no tags other than name - continue - } - if parts[0] == "-" { - // not serialized - continue - } - for _, part := range parts[1:] { - if strings.EqualFold(part, "omitempty") && part != "omitempty" { - fields = append(fields, goName) - } - } - } - } - return fields, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/union.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/union.go deleted file mode 100644 index a0281fe4706f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/generators/union.go +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 generators - -import ( - "fmt" - "sort" - - "k8s.io/gengo/types" -) - -const tagUnionMember = "union" -const tagUnionDeprecated = "unionDeprecated" -const tagUnionDiscriminator = "unionDiscriminator" - -type union struct { - discriminator string - fieldsToDiscriminated map[string]string -} - -// emit prints the union, can be called on a nil union (emits nothing) -func (u *union) emit(g openAPITypeWriter) { - if u == nil { - return - } - g.Do("map[string]interface{}{\n", nil) - if u.discriminator != "" { - g.Do("\"discriminator\": \"$.$\",\n", u.discriminator) - } - g.Do("\"fields-to-discriminateBy\": map[string]interface{}{\n", nil) - keys := []string{} - for field := range u.fieldsToDiscriminated { - keys = append(keys, field) - } - sort.Strings(keys) - for _, field := range keys { - g.Do("\"$.$\": ", field) - g.Do("\"$.$\",\n", u.fieldsToDiscriminated[field]) - } - g.Do("},\n", nil) - g.Do("},\n", nil) -} - -// Sets the discriminator if it's not set yet, otherwise return an error -func (u *union) setDiscriminator(value string) []error { - errors := []error{} - if u.discriminator != "" { - errors = append(errors, fmt.Errorf("at least two discriminators found: %v and %v", value, u.discriminator)) - } - u.discriminator = value - return errors -} - -// Add a new member to the union -func (u *union) addMember(jsonName, variableName string) { - if _, ok := u.fieldsToDiscriminated[jsonName]; ok { - panic(fmt.Errorf("same field (%v) found multiple times", jsonName)) - } - u.fieldsToDiscriminated[jsonName] = variableName -} - -// Makes sure that the union is valid, specifically looking for re-used discriminated -func (u *union) isValid() []error { - errors := []error{} - // Case 1: discriminator but no fields - if u.discriminator != "" && len(u.fieldsToDiscriminated) == 0 { - errors = append(errors, fmt.Errorf("discriminator set with no fields in union")) - } - // Case 2: two fields have the same discriminated value - discriminated := map[string]struct{}{} - for _, d := range u.fieldsToDiscriminated { - if _, ok := discriminated[d]; ok { - errors = append(errors, fmt.Errorf("discriminated value is used twice: %v", d)) - } - discriminated[d] = struct{}{} - } - // Case 3: a field is both discriminator AND part of the union - if u.discriminator != "" { - if _, ok := u.fieldsToDiscriminated[u.discriminator]; ok { - errors = append(errors, fmt.Errorf("%v can't be both discriminator and part of the union", u.discriminator)) - } - } - return errors -} - -// Find unions either directly on the members (or inlined members, not -// going across types) or on the type itself, or on embedded types. -func parseUnions(t *types.Type) ([]union, []error) { - errors := []error{} - unions := []union{} - su, err := parseUnionStruct(t) - if su != nil { - unions = append(unions, *su) - } - errors = append(errors, err...) - eu, err := parseEmbeddedUnion(t) - unions = append(unions, eu...) - errors = append(errors, err...) - mu, err := parseUnionMembers(t) - if mu != nil { - unions = append(unions, *mu) - } - errors = append(errors, err...) - return unions, errors -} - -// Find unions in embedded types, unions shouldn't go across types. -func parseEmbeddedUnion(t *types.Type) ([]union, []error) { - errors := []error{} - unions := []union{} - for _, m := range t.Members { - if hasOpenAPITagValue(m.CommentLines, tagValueFalse) { - continue - } - if !shouldInlineMembers(&m) { - continue - } - u, err := parseUnions(m.Type) - unions = append(unions, u...) - errors = append(errors, err...) - } - return unions, errors -} - -// Look for union tag on a struct, and then include all the fields -// (except the discriminator if there is one). The struct shouldn't have -// embedded types. -func parseUnionStruct(t *types.Type) (*union, []error) { - errors := []error{} - if types.ExtractCommentTags("+", t.CommentLines)[tagUnionMember] == nil { - return nil, nil - } - - u := &union{fieldsToDiscriminated: map[string]string{}} - - for _, m := range t.Members { - jsonName := getReferableName(&m) - if jsonName == "" { - continue - } - if shouldInlineMembers(&m) { - errors = append(errors, fmt.Errorf("union structures can't have embedded fields: %v.%v", t.Name, m.Name)) - continue - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionDeprecated] != nil { - errors = append(errors, fmt.Errorf("union struct can't have unionDeprecated members: %v.%v", t.Name, m.Name)) - continue - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionDiscriminator] != nil { - errors = append(errors, u.setDiscriminator(jsonName)...) - } else { - if !hasOptionalTag(&m) { - errors = append(errors, fmt.Errorf("union members must be optional: %v.%v", t.Name, m.Name)) - } - u.addMember(jsonName, m.Name) - } - } - - return u, errors -} - -// Find unions specifically on members. -func parseUnionMembers(t *types.Type) (*union, []error) { - errors := []error{} - u := &union{fieldsToDiscriminated: map[string]string{}} - - for _, m := range t.Members { - jsonName := getReferableName(&m) - if jsonName == "" { - continue - } - if shouldInlineMembers(&m) { - continue - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionDiscriminator] != nil { - errors = append(errors, u.setDiscriminator(jsonName)...) - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionMember] != nil { - errors = append(errors, fmt.Errorf("union tag is not accepted on struct members: %v.%v", t.Name, m.Name)) - continue - } - if types.ExtractCommentTags("+", m.CommentLines)[tagUnionDeprecated] != nil { - if !hasOptionalTag(&m) { - errors = append(errors, fmt.Errorf("union members must be optional: %v.%v", t.Name, m.Name)) - } - u.addMember(jsonName, m.Name) - } - } - if len(u.fieldsToDiscriminated) == 0 { - return nil, nil - } - return u, append(errors, u.isValid()...) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/util/sets/empty.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/util/sets/empty.go deleted file mode 100644 index 13303ea8900e..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/util/sets/empty.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -// NOTE: This file is copied from k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/sets/empty.go -// because in Kubernetes we don't allowed vendor code to import staging code. See -// https://github.com/kubernetes/kube-openapi/pull/90 for more details. - -package sets - -// Empty is public since it is used by some internal API objects for conversions between external -// string arrays and internal sets, and conversion logic requires public types today. -type Empty struct{} diff --git a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/util/sets/string.go b/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/util/sets/string.go deleted file mode 100644 index 53f2bc12aae6..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kube-openapi/pkg/util/sets/string.go +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -// NOTE: This file is copied from k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/sets/string.go -// because in Kubernetes we don't allowed vendor code to import staging code. See -// https://github.com/kubernetes/kube-openapi/pull/90 for more details. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption. -type String map[string]Empty - -// NewString creates a String from a list of values. -func NewString(items ...string) String { - ss := String{} - ss.Insert(items...) - return ss -} - -// StringKeySet creates a String from a keys of a map[string](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func StringKeySet(theMap interface{}) String { - v := reflect.ValueOf(theMap) - ret := String{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(string)) - } - return ret -} - -// Insert adds items to the set. -func (s String) Insert(items ...string) { - for _, item := range items { - s[item] = Empty{} - } -} - -// Delete removes all items from the set. -func (s String) Delete(items ...string) { - for _, item := range items { - delete(s, item) - } -} - -// Has returns true if and only if item is contained in the set. -func (s String) Has(item string) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s String) HasAll(items ...string) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s String) HasAny(items ...string) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Difference returns a set of objects that are not in s2 -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s String) Difference(s2 String) String { - result := NewString() - for key := range s { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 String) Union(s2 String) String { - result := NewString() - for key := range s1 { - result.Insert(key) - } - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 String) Intersection(s2 String) String { - var walk, other String - result := NewString() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 String) IsSuperset(s2 String) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 String) Equal(s2 String) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfString []string - -func (s sortableSliceOfString) Len() int { return len(s) } -func (s sortableSliceOfString) Less(i, j int) bool { return lessString(s[i], s[j]) } -func (s sortableSliceOfString) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted string slice. -func (s String) List() []string { - res := make(sortableSliceOfString, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []string(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s String) UnsortedList() []string { - res := make([]string, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s String) PopAny() (string, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue string - return zeroValue, false -} - -// Len returns the size of the set. -func (s String) Len() int { - return len(s) -} - -func lessString(lhs, rhs string) bool { - return lhs < rhs -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.pb.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.pb.go deleted file mode 100644 index 92233f98ee93..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.pb.go +++ /dev/null @@ -1,2134 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: api.proto - -package v1alpha3 - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type NodePrepareResourcesRequest struct { - // The list of ResourceClaims that are to be prepared. - Claims []*Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodePrepareResourcesRequest) Reset() { *m = NodePrepareResourcesRequest{} } -func (*NodePrepareResourcesRequest) ProtoMessage() {} -func (*NodePrepareResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{0} -} -func (m *NodePrepareResourcesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodePrepareResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodePrepareResourcesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodePrepareResourcesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodePrepareResourcesRequest.Merge(m, src) -} -func (m *NodePrepareResourcesRequest) XXX_Size() int { - return m.Size() -} -func (m *NodePrepareResourcesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NodePrepareResourcesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NodePrepareResourcesRequest proto.InternalMessageInfo - -func (m *NodePrepareResourcesRequest) GetClaims() []*Claim { - if m != nil { - return m.Claims - } - return nil -} - -type NodePrepareResourcesResponse struct { - // The ResourceClaims for which preparation was done - // or attempted, with claim_uid as key. - // - // It is an error if some claim listed in NodePrepareResourcesRequest - // does not get prepared. NodePrepareResources - // will be called again for those that are missing. - Claims map[string]*NodePrepareResourceResponse `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodePrepareResourcesResponse) Reset() { *m = NodePrepareResourcesResponse{} } -func (*NodePrepareResourcesResponse) ProtoMessage() {} -func (*NodePrepareResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{1} -} -func (m *NodePrepareResourcesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodePrepareResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodePrepareResourcesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodePrepareResourcesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodePrepareResourcesResponse.Merge(m, src) -} -func (m *NodePrepareResourcesResponse) XXX_Size() int { - return m.Size() -} -func (m *NodePrepareResourcesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NodePrepareResourcesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NodePrepareResourcesResponse proto.InternalMessageInfo - -func (m *NodePrepareResourcesResponse) GetClaims() map[string]*NodePrepareResourceResponse { - if m != nil { - return m.Claims - } - return nil -} - -type NodePrepareResourceResponse struct { - // These are the additional devices that kubelet must - // make available via the container runtime. A resource - // may have zero or more devices. - CDIDevices []string `protobuf:"bytes,1,rep,name=cdi_devices,json=cdiDevices,proto3" json:"cdi_devices,omitempty"` - // If non-empty, preparing the ResourceClaim failed. - // cdi_devices is ignored in that case. - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodePrepareResourceResponse) Reset() { *m = NodePrepareResourceResponse{} } -func (*NodePrepareResourceResponse) ProtoMessage() {} -func (*NodePrepareResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{2} -} -func (m *NodePrepareResourceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodePrepareResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodePrepareResourceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodePrepareResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodePrepareResourceResponse.Merge(m, src) -} -func (m *NodePrepareResourceResponse) XXX_Size() int { - return m.Size() -} -func (m *NodePrepareResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NodePrepareResourceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NodePrepareResourceResponse proto.InternalMessageInfo - -func (m *NodePrepareResourceResponse) GetCDIDevices() []string { - if m != nil { - return m.CDIDevices - } - return nil -} - -func (m *NodePrepareResourceResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type NodeUnprepareResourcesRequest struct { - // The list of ResourceClaims that are to be unprepared. - Claims []*Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeUnprepareResourcesRequest) Reset() { *m = NodeUnprepareResourcesRequest{} } -func (*NodeUnprepareResourcesRequest) ProtoMessage() {} -func (*NodeUnprepareResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{3} -} -func (m *NodeUnprepareResourcesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeUnprepareResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeUnprepareResourcesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeUnprepareResourcesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeUnprepareResourcesRequest.Merge(m, src) -} -func (m *NodeUnprepareResourcesRequest) XXX_Size() int { - return m.Size() -} -func (m *NodeUnprepareResourcesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NodeUnprepareResourcesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeUnprepareResourcesRequest proto.InternalMessageInfo - -func (m *NodeUnprepareResourcesRequest) GetClaims() []*Claim { - if m != nil { - return m.Claims - } - return nil -} - -type NodeUnprepareResourcesResponse struct { - // The ResourceClaims for which preparation was reverted. - // The same rules as for NodePrepareResourcesResponse.claims - // apply. - Claims map[string]*NodeUnprepareResourceResponse `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeUnprepareResourcesResponse) Reset() { *m = NodeUnprepareResourcesResponse{} } -func (*NodeUnprepareResourcesResponse) ProtoMessage() {} -func (*NodeUnprepareResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{4} -} -func (m *NodeUnprepareResourcesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeUnprepareResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeUnprepareResourcesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeUnprepareResourcesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeUnprepareResourcesResponse.Merge(m, src) -} -func (m *NodeUnprepareResourcesResponse) XXX_Size() int { - return m.Size() -} -func (m *NodeUnprepareResourcesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NodeUnprepareResourcesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeUnprepareResourcesResponse proto.InternalMessageInfo - -func (m *NodeUnprepareResourcesResponse) GetClaims() map[string]*NodeUnprepareResourceResponse { - if m != nil { - return m.Claims - } - return nil -} - -type NodeUnprepareResourceResponse struct { - // If non-empty, unpreparing the ResourceClaim failed. - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeUnprepareResourceResponse) Reset() { *m = NodeUnprepareResourceResponse{} } -func (*NodeUnprepareResourceResponse) ProtoMessage() {} -func (*NodeUnprepareResourceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{5} -} -func (m *NodeUnprepareResourceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *NodeUnprepareResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NodeUnprepareResourceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *NodeUnprepareResourceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeUnprepareResourceResponse.Merge(m, src) -} -func (m *NodeUnprepareResourceResponse) XXX_Size() int { - return m.Size() -} -func (m *NodeUnprepareResourceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NodeUnprepareResourceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeUnprepareResourceResponse proto.InternalMessageInfo - -func (m *NodeUnprepareResourceResponse) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -type Claim struct { - // The ResourceClaim namespace (ResourceClaim.meta.Namespace). - // This field is REQUIRED. - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - // The UID of the Resource claim (ResourceClaim.meta.UUID). - // This field is REQUIRED. - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` - // The name of the Resource claim (ResourceClaim.meta.Name) - // This field is REQUIRED. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // Resource handle (AllocationResult.ResourceHandles[*].Data) - // This field is REQUIRED. - ResourceHandle string `protobuf:"bytes,4,opt,name=resource_handle,json=resourceHandle,proto3" json:"resource_handle,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Claim) Reset() { *m = Claim{} } -func (*Claim) ProtoMessage() {} -func (*Claim) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{6} -} -func (m *Claim) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Claim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Claim.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Claim) XXX_Merge(src proto.Message) { - xxx_messageInfo_Claim.Merge(m, src) -} -func (m *Claim) XXX_Size() int { - return m.Size() -} -func (m *Claim) XXX_DiscardUnknown() { - xxx_messageInfo_Claim.DiscardUnknown(m) -} - -var xxx_messageInfo_Claim proto.InternalMessageInfo - -func (m *Claim) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *Claim) GetUid() string { - if m != nil { - return m.Uid - } - return "" -} - -func (m *Claim) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Claim) GetResourceHandle() string { - if m != nil { - return m.ResourceHandle - } - return "" -} - -func init() { - proto.RegisterType((*NodePrepareResourcesRequest)(nil), "v1alpha3.NodePrepareResourcesRequest") - proto.RegisterType((*NodePrepareResourcesResponse)(nil), "v1alpha3.NodePrepareResourcesResponse") - proto.RegisterMapType((map[string]*NodePrepareResourceResponse)(nil), "v1alpha3.NodePrepareResourcesResponse.ClaimsEntry") - proto.RegisterType((*NodePrepareResourceResponse)(nil), "v1alpha3.NodePrepareResourceResponse") - proto.RegisterType((*NodeUnprepareResourcesRequest)(nil), "v1alpha3.NodeUnprepareResourcesRequest") - proto.RegisterType((*NodeUnprepareResourcesResponse)(nil), "v1alpha3.NodeUnprepareResourcesResponse") - proto.RegisterMapType((map[string]*NodeUnprepareResourceResponse)(nil), "v1alpha3.NodeUnprepareResourcesResponse.ClaimsEntry") - proto.RegisterType((*NodeUnprepareResourceResponse)(nil), "v1alpha3.NodeUnprepareResourceResponse") - proto.RegisterType((*Claim)(nil), "v1alpha3.Claim") -} - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 500 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xcd, 0x36, 0x49, 0x45, 0x26, 0x52, 0x8b, 0x56, 0x15, 0xb2, 0x42, 0x31, 0x91, 0x45, 0x49, - 0x2e, 0xd8, 0x22, 0x05, 0xa9, 0x02, 0x71, 0x49, 0x0b, 0x2a, 0x08, 0x21, 0x64, 0x89, 0x0b, 0x97, - 0xb2, 0xb6, 0x07, 0xc7, 0x8a, 0xe3, 0x35, 0xbb, 0x76, 0xa4, 0xde, 0xf8, 0x09, 0xfc, 0xac, 0x1e, - 0x38, 0x20, 0x4e, 0x9c, 0x2a, 0x6a, 0xfe, 0x08, 0xf2, 0xda, 0x4e, 0x3f, 0xe4, 0x34, 0x95, 0x7a, - 0x9b, 0x7d, 0xbb, 0x33, 0x6f, 0xe6, 0xbd, 0xb1, 0xa1, 0xc3, 0xe2, 0xc0, 0x8c, 0x05, 0x4f, 0x38, - 0xbd, 0x33, 0x7f, 0xca, 0xc2, 0x78, 0xc2, 0x76, 0x7b, 0x4f, 0xfc, 0x20, 0x99, 0xa4, 0x8e, 0xe9, - 0xf2, 0x99, 0xe5, 0x73, 0x9f, 0x5b, 0xea, 0x81, 0x93, 0x7e, 0x55, 0x27, 0x75, 0x50, 0x51, 0x91, - 0x68, 0xbc, 0x81, 0xfb, 0x1f, 0xb8, 0x87, 0x1f, 0x05, 0xc6, 0x4c, 0xa0, 0x8d, 0x92, 0xa7, 0xc2, - 0x45, 0x69, 0xe3, 0xb7, 0x14, 0x65, 0x42, 0x07, 0xb0, 0xee, 0x86, 0x2c, 0x98, 0x49, 0x8d, 0xf4, - 0x9b, 0xc3, 0xee, 0x68, 0xd3, 0xac, 0x88, 0xcc, 0xfd, 0x1c, 0xb7, 0xcb, 0x6b, 0xe3, 0x27, 0x81, - 0xed, 0xfa, 0x42, 0x32, 0xe6, 0x91, 0x44, 0xfa, 0xee, 0x4a, 0xa5, 0xd1, 0x79, 0xa5, 0xeb, 0xf2, - 0x0a, 0x1a, 0xf9, 0x3a, 0x4a, 0xc4, 0x71, 0x45, 0xd6, 0xfb, 0x02, 0xdd, 0x0b, 0x30, 0xbd, 0x0b, - 0xcd, 0x29, 0x1e, 0x6b, 0xa4, 0x4f, 0x86, 0x1d, 0x3b, 0x0f, 0xe9, 0x4b, 0x68, 0xcf, 0x59, 0x98, - 0xa2, 0xb6, 0xd6, 0x27, 0xc3, 0xee, 0x68, 0xe7, 0x5a, 0xae, 0x8a, 0xca, 0x2e, 0x72, 0x5e, 0xac, - 0xed, 0x11, 0xc3, 0xab, 0x95, 0x65, 0x31, 0x8c, 0x05, 0x5d, 0xd7, 0x0b, 0x8e, 0x3c, 0x9c, 0x07, - 0x2e, 0x16, 0x13, 0x75, 0xc6, 0x1b, 0xd9, 0xe9, 0x43, 0xd8, 0x3f, 0x78, 0x7b, 0x50, 0xa0, 0x36, - 0xb8, 0x5e, 0x50, 0xc6, 0x74, 0x0b, 0xda, 0x28, 0x04, 0x17, 0xaa, 0xa1, 0x8e, 0x5d, 0x1c, 0x8c, - 0x43, 0x78, 0x90, 0xb3, 0x7c, 0x8a, 0xe2, 0xdb, 0xca, 0xff, 0x9b, 0x80, 0xbe, 0xac, 0x54, 0xd9, - 0xf3, 0xfb, 0x2b, 0xb5, 0x9e, 0x5d, 0x16, 0x65, 0x79, 0x66, 0xad, 0x05, 0xce, 0x2a, 0x0b, 0x5e, - 0x5d, 0xb6, 0x60, 0xb0, 0x82, 0xad, 0xce, 0x84, 0xe7, 0x4b, 0xe4, 0x59, 0x8c, 0xb4, 0x50, 0x95, - 0x5c, 0x54, 0x35, 0x81, 0xb6, 0x6a, 0x8d, 0x6e, 0x43, 0x27, 0x62, 0x33, 0x94, 0x31, 0x73, 0xb1, - 0x7c, 0x72, 0x0e, 0xe4, 0x2d, 0xa7, 0x81, 0x57, 0x1a, 0x92, 0x87, 0x94, 0x42, 0x2b, 0xbf, 0xd6, - 0x9a, 0x0a, 0x52, 0x31, 0x1d, 0xc0, 0xa6, 0x28, 0x69, 0x8f, 0x26, 0x2c, 0xf2, 0x42, 0xd4, 0x5a, - 0xea, 0x7a, 0xa3, 0x82, 0x0f, 0x15, 0x3a, 0x3a, 0x25, 0xd0, 0xca, 0xbb, 0xa5, 0x3e, 0x6c, 0xd5, - 0x2d, 0x34, 0xdd, 0x59, 0xb5, 0xf0, 0xca, 0xf2, 0xde, 0xe3, 0x9b, 0x7d, 0x17, 0x46, 0x83, 0xce, - 0xe0, 0x5e, 0xbd, 0x71, 0x74, 0xb0, 0xda, 0xda, 0x82, 0x6c, 0x78, 0xd3, 0x1d, 0x30, 0x1a, 0xe3, - 0xf1, 0xc9, 0x99, 0x4e, 0xfe, 0x9c, 0xe9, 0x8d, 0xef, 0x99, 0x4e, 0x4e, 0x32, 0x9d, 0xfc, 0xca, - 0x74, 0xf2, 0x37, 0xd3, 0xc9, 0x8f, 0x7f, 0x7a, 0xe3, 0xf3, 0xa3, 0xe9, 0x9e, 0x34, 0x03, 0x6e, - 0x4d, 0x53, 0x07, 0x43, 0x4c, 0xac, 0x78, 0xea, 0x5b, 0x2c, 0x0e, 0xa4, 0xe5, 0x09, 0x66, 0x55, - 0x24, 0xce, 0xba, 0xfa, 0xe9, 0xec, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x42, 0xff, 0x15, 0x6b, - 0xba, 0x04, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// 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.SupportPackageIsVersion4 - -// NodeClient is the client API for Node service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type NodeClient interface { - // NodePrepareResources prepares several ResourceClaims - // for use on the node. If an error is returned, the - // response is ignored. Failures for individual claims - // can be reported inside NodePrepareResourcesResponse. - NodePrepareResources(ctx context.Context, in *NodePrepareResourcesRequest, opts ...grpc.CallOption) (*NodePrepareResourcesResponse, error) - // NodeUnprepareResources is the opposite of NodePrepareResources. - // The same error handling rules apply, - NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) -} - -type nodeClient struct { - cc *grpc.ClientConn -} - -func NewNodeClient(cc *grpc.ClientConn) NodeClient { - return &nodeClient{cc} -} - -func (c *nodeClient) NodePrepareResources(ctx context.Context, in *NodePrepareResourcesRequest, opts ...grpc.CallOption) (*NodePrepareResourcesResponse, error) { - out := new(NodePrepareResourcesResponse) - err := c.cc.Invoke(ctx, "/v1alpha3.Node/NodePrepareResources", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *nodeClient) NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) { - out := new(NodeUnprepareResourcesResponse) - err := c.cc.Invoke(ctx, "/v1alpha3.Node/NodeUnprepareResources", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// NodeServer is the server API for Node service. -type NodeServer interface { - // NodePrepareResources prepares several ResourceClaims - // for use on the node. If an error is returned, the - // response is ignored. Failures for individual claims - // can be reported inside NodePrepareResourcesResponse. - NodePrepareResources(context.Context, *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) - // NodeUnprepareResources is the opposite of NodePrepareResources. - // The same error handling rules apply, - NodeUnprepareResources(context.Context, *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) -} - -// UnimplementedNodeServer can be embedded to have forward compatible implementations. -type UnimplementedNodeServer struct { -} - -func (*UnimplementedNodeServer) NodePrepareResources(ctx context.Context, req *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NodePrepareResources not implemented") -} -func (*UnimplementedNodeServer) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NodeUnprepareResources not implemented") -} - -func RegisterNodeServer(s *grpc.Server, srv NodeServer) { - s.RegisterService(&_Node_serviceDesc, srv) -} - -func _Node_NodePrepareResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NodePrepareResourcesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServer).NodePrepareResources(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1alpha3.Node/NodePrepareResources", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServer).NodePrepareResources(ctx, req.(*NodePrepareResourcesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Node_NodeUnprepareResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NodeUnprepareResourcesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(NodeServer).NodeUnprepareResources(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/v1alpha3.Node/NodeUnprepareResources", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(NodeServer).NodeUnprepareResources(ctx, req.(*NodeUnprepareResourcesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Node_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v1alpha3.Node", - HandlerType: (*NodeServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "NodePrepareResources", - Handler: _Node_NodePrepareResources_Handler, - }, - { - MethodName: "NodeUnprepareResources", - Handler: _Node_NodeUnprepareResources_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api.proto", -} - -func (m *NodePrepareResourcesRequest) 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 *NodePrepareResourcesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodePrepareResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Claims) > 0 { - for iNdEx := len(m.Claims) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Claims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *NodePrepareResourcesResponse) 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 *NodePrepareResourcesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodePrepareResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Claims) > 0 { - for k := range m.Claims { - v := m.Claims[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *NodePrepareResourceResponse) 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 *NodePrepareResourceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodePrepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0x12 - } - if len(m.CDIDevices) > 0 { - for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.CDIDevices[iNdEx]) - copy(dAtA[i:], m.CDIDevices[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.CDIDevices[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *NodeUnprepareResourcesRequest) 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 *NodeUnprepareResourcesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeUnprepareResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Claims) > 0 { - for iNdEx := len(m.Claims) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Claims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *NodeUnprepareResourcesResponse) 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 *NodeUnprepareResourcesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeUnprepareResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Claims) > 0 { - for k := range m.Claims { - v := m.Claims[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *NodeUnprepareResourceResponse) 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 *NodeUnprepareResourceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NodeUnprepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Error) > 0 { - i -= len(m.Error) - copy(dAtA[i:], m.Error) - i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Claim) 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 *Claim) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ResourceHandle) > 0 { - i -= len(m.ResourceHandle) - copy(dAtA[i:], m.ResourceHandle) - i = encodeVarintApi(dAtA, i, uint64(len(m.ResourceHandle))) - i-- - dAtA[i] = 0x22 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x1a - } - if len(m.Uid) > 0 { - i -= len(m.Uid) - copy(dAtA[i:], m.Uid) - i = encodeVarintApi(dAtA, i, uint64(len(m.Uid))) - i-- - dAtA[i] = 0x12 - } - if len(m.Namespace) > 0 { - i -= len(m.Namespace) - copy(dAtA[i:], m.Namespace) - i = encodeVarintApi(dAtA, i, uint64(len(m.Namespace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintApi(dAtA []byte, offset int, v uint64) int { - offset -= sovApi(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *NodePrepareResourcesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Claims) > 0 { - for _, e := range m.Claims { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - return n -} - -func (m *NodePrepareResourcesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Claims) > 0 { - for k, v := range m.Claims { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovApi(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + l - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } - } - return n -} - -func (m *NodePrepareResourceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.CDIDevices) > 0 { - for _, s := range m.CDIDevices { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } - } - l = len(m.Error) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - return n -} - -func (m *NodeUnprepareResourcesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Claims) > 0 { - for _, e := range m.Claims { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - return n -} - -func (m *NodeUnprepareResourcesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Claims) > 0 { - for k, v := range m.Claims { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovApi(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + l - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } - } - return n -} - -func (m *NodeUnprepareResourceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Error) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - return n -} - -func (m *Claim) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Uid) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.ResourceHandle) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - return n -} - -func sovApi(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozApi(x uint64) (n int) { - return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *NodePrepareResourcesRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForClaims := "[]*Claim{" - for _, f := range this.Claims { - repeatedStringForClaims += strings.Replace(f.String(), "Claim", "Claim", 1) + "," - } - repeatedStringForClaims += "}" - s := strings.Join([]string{`&NodePrepareResourcesRequest{`, - `Claims:` + repeatedStringForClaims + `,`, - `}`, - }, "") - return s -} -func (this *NodePrepareResourcesResponse) String() string { - if this == nil { - return "nil" - } - keysForClaims := make([]string, 0, len(this.Claims)) - for k := range this.Claims { - keysForClaims = append(keysForClaims, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForClaims) - mapStringForClaims := "map[string]*NodePrepareResourceResponse{" - for _, k := range keysForClaims { - mapStringForClaims += fmt.Sprintf("%v: %v,", k, this.Claims[k]) - } - mapStringForClaims += "}" - s := strings.Join([]string{`&NodePrepareResourcesResponse{`, - `Claims:` + mapStringForClaims + `,`, - `}`, - }, "") - return s -} -func (this *NodePrepareResourceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodePrepareResourceResponse{`, - `CDIDevices:` + fmt.Sprintf("%v", this.CDIDevices) + `,`, - `Error:` + fmt.Sprintf("%v", this.Error) + `,`, - `}`, - }, "") - return s -} -func (this *NodeUnprepareResourcesRequest) String() string { - if this == nil { - return "nil" - } - repeatedStringForClaims := "[]*Claim{" - for _, f := range this.Claims { - repeatedStringForClaims += strings.Replace(f.String(), "Claim", "Claim", 1) + "," - } - repeatedStringForClaims += "}" - s := strings.Join([]string{`&NodeUnprepareResourcesRequest{`, - `Claims:` + repeatedStringForClaims + `,`, - `}`, - }, "") - return s -} -func (this *NodeUnprepareResourcesResponse) String() string { - if this == nil { - return "nil" - } - keysForClaims := make([]string, 0, len(this.Claims)) - for k := range this.Claims { - keysForClaims = append(keysForClaims, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForClaims) - mapStringForClaims := "map[string]*NodeUnprepareResourceResponse{" - for _, k := range keysForClaims { - mapStringForClaims += fmt.Sprintf("%v: %v,", k, this.Claims[k]) - } - mapStringForClaims += "}" - s := strings.Join([]string{`&NodeUnprepareResourcesResponse{`, - `Claims:` + mapStringForClaims + `,`, - `}`, - }, "") - return s -} -func (this *NodeUnprepareResourceResponse) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&NodeUnprepareResourceResponse{`, - `Error:` + fmt.Sprintf("%v", this.Error) + `,`, - `}`, - }, "") - return s -} -func (this *Claim) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Claim{`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `ResourceHandle:` + fmt.Sprintf("%v", this.ResourceHandle) + `,`, - `}`, - }, "") - return s -} -func valueToStringApi(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *NodePrepareResourcesRequest) 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 ErrIntOverflowApi - } - 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: NodePrepareResourcesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodePrepareResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Claims = append(m.Claims, &Claim{}) - if err := m.Claims[len(m.Claims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodePrepareResourcesResponse) 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 ErrIntOverflowApi - } - 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: NodePrepareResourcesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodePrepareResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claims == nil { - m.Claims = make(map[string]*NodePrepareResourceResponse) - } - var mapkey string - var mapvalue *NodePrepareResourceResponse - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthApi - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthApi - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthApi - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &NodePrepareResourceResponse{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Claims[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodePrepareResourceResponse) 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 ErrIntOverflowApi - } - 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: NodePrepareResourceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodePrepareResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CDIDevices", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CDIDevices = append(m.CDIDevices, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeUnprepareResourcesRequest) 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 ErrIntOverflowApi - } - 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: NodeUnprepareResourcesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeUnprepareResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Claims = append(m.Claims, &Claim{}) - if err := m.Claims[len(m.Claims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeUnprepareResourcesResponse) 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 ErrIntOverflowApi - } - 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: NodeUnprepareResourcesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeUnprepareResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Claims == nil { - m.Claims = make(map[string]*NodeUnprepareResourceResponse) - } - var mapkey string - var mapvalue *NodeUnprepareResourceResponse - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthApi - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthApi - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthApi - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &NodeUnprepareResourceResponse{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Claims[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *NodeUnprepareResourceResponse) 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 ErrIntOverflowApi - } - 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: NodeUnprepareResourceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NodeUnprepareResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Error = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Claim) 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 ErrIntOverflowApi - } - 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: Claim: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Claim: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Uid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResourceHandle", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ResourceHandle = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipApi(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApi - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApi - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowApi - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthApi - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupApi - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthApi - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") -) diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.proto b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.proto deleted file mode 100644 index c729aaf2714f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha3/api.proto +++ /dev/null @@ -1,103 +0,0 @@ -/* -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. -*/ - -// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` - -syntax = "proto3"; - -package v1alpha3; -option go_package = "k8s.io/kubelet/pkg/apis/dra/v1alpha3"; - -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = true; -option (gogoproto.goproto_getters_all) = true; -option (gogoproto.marshaler_all) = true; -option (gogoproto.sizer_all) = true; -option (gogoproto.unmarshaler_all) = true; -option (gogoproto.goproto_unrecognized_all) = false; - -service Node { - // NodePrepareResources prepares several ResourceClaims - // for use on the node. If an error is returned, the - // response is ignored. Failures for individual claims - // can be reported inside NodePrepareResourcesResponse. - rpc NodePrepareResources (NodePrepareResourcesRequest) - returns (NodePrepareResourcesResponse) {} - - // NodeUnprepareResources is the opposite of NodePrepareResources. - // The same error handling rules apply, - rpc NodeUnprepareResources (NodeUnprepareResourcesRequest) - returns (NodeUnprepareResourcesResponse) {} -} - -message NodePrepareResourcesRequest { - // The list of ResourceClaims that are to be prepared. - repeated Claim claims = 1; -} - -message NodePrepareResourcesResponse { - // The ResourceClaims for which preparation was done - // or attempted, with claim_uid as key. - // - // It is an error if some claim listed in NodePrepareResourcesRequest - // does not get prepared. NodePrepareResources - // will be called again for those that are missing. - map claims = 1; -} - -message NodePrepareResourceResponse { - // These are the additional devices that kubelet must - // make available via the container runtime. A resource - // may have zero or more devices. - repeated string cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"]; - // If non-empty, preparing the ResourceClaim failed. - // cdi_devices is ignored in that case. - string error = 2; -} - -message NodeUnprepareResourcesRequest { - // The list of ResourceClaims that are to be unprepared. - repeated Claim claims = 1; -} - -message NodeUnprepareResourcesResponse { - // The ResourceClaims for which preparation was reverted. - // The same rules as for NodePrepareResourcesResponse.claims - // apply. - map claims = 1; -} - -message NodeUnprepareResourceResponse { - // If non-empty, unpreparing the ResourceClaim failed. - string error = 1; -} - -message Claim { - // The ResourceClaim namespace (ResourceClaim.meta.Namespace). - // This field is REQUIRED. - string namespace = 1; - // The UID of the Resource claim (ResourceClaim.meta.UUID). - // This field is REQUIRED. - string uid = 2; - // The name of the Resource claim (ResourceClaim.meta.Name) - // This field is REQUIRED. - string name = 3; - // Resource handle (AllocationResult.ResourceHandles[*].Data) - // This field is REQUIRED. - string resource_handle = 4; -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/.import-restrictions b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/.import-restrictions deleted file mode 100644 index 10215ff92511..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/.import-restrictions +++ /dev/null @@ -1,5 +0,0 @@ -rules: - # prevent exposing internal api in streaming packages - - selectorRegexp: k8s[.]io/kubernetes - allowedPrefixes: - - k8s.io/kubernetes/pkg/kubelet/cri diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/errors.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/errors.go deleted file mode 100644 index 83e218ddb4f4..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/errors.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 streaming - -import ( - "net/http" - "strconv" - - "google.golang.org/grpc/codes" - grpcstatus "google.golang.org/grpc/status" -) - -// NewErrorTooManyInFlight creates an error for exceeding the maximum number of in-flight requests. -func NewErrorTooManyInFlight() error { - return grpcstatus.Error(codes.ResourceExhausted, "maximum number of in-flight requests exceeded") -} - -// WriteError translates a CRI streaming error into an appropriate HTTP response. -func WriteError(err error, w http.ResponseWriter) error { - s, _ := grpcstatus.FromError(err) - var status int - switch s.Code() { - case codes.NotFound: - status = http.StatusNotFound - case codes.ResourceExhausted: - // We only expect to hit this if there is a DoS, so we just wait the full TTL. - // If this is ever hit in steady-state operations, consider increasing the maxInFlight requests, - // or plumbing through the time to next expiration. - w.Header().Set("Retry-After", strconv.Itoa(int(cacheTTL.Seconds()))) - status = http.StatusTooManyRequests - default: - status = http.StatusInternalServerError - } - w.WriteHeader(status) - _, writeErr := w.Write([]byte(err.Error())) - return writeErr -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/constants.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/constants.go deleted file mode 100644 index 62b14f2051a1..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/constants.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -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 portforward contains server-side logic for handling port forwarding requests. -package portforward - -// ProtocolV1Name is the name of the subprotocol used for port forwarding. -const ProtocolV1Name = "portforward.k8s.io" - -// SupportedProtocols are the supported port forwarding protocols. -var SupportedProtocols = []string{ProtocolV1Name} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/httpstream.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/httpstream.go deleted file mode 100644 index a45131081a8f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/httpstream.go +++ /dev/null @@ -1,315 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 portforward - -import ( - "context" - "errors" - "fmt" - "net/http" - "strconv" - "sync" - "time" - - api "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/httpstream" - "k8s.io/apimachinery/pkg/util/httpstream/spdy" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - - "k8s.io/klog/v2" -) - -func handleHTTPStreams(req *http.Request, w http.ResponseWriter, portForwarder PortForwarder, podName string, uid types.UID, supportedPortForwardProtocols []string, idleTimeout, streamCreationTimeout time.Duration) error { - _, err := httpstream.Handshake(req, w, supportedPortForwardProtocols) - // negotiated protocol isn't currently used server side, but could be in the future - if err != nil { - // Handshake writes the error to the client - return err - } - streamChan := make(chan httpstream.Stream, 1) - - klog.V(5).InfoS("Upgrading port forward response") - upgrader := spdy.NewResponseUpgrader() - conn := upgrader.UpgradeResponse(w, req, httpStreamReceived(streamChan)) - if conn == nil { - return errors.New("unable to upgrade httpstream connection") - } - defer conn.Close() - - klog.V(5).InfoS("Connection setting port forwarding streaming connection idle timeout", "connection", conn, "idleTimeout", idleTimeout) - conn.SetIdleTimeout(idleTimeout) - - h := &httpStreamHandler{ - conn: conn, - streamChan: streamChan, - streamPairs: make(map[string]*httpStreamPair), - streamCreationTimeout: streamCreationTimeout, - pod: podName, - uid: uid, - forwarder: portForwarder, - } - h.run() - - return nil -} - -// httpStreamReceived is the httpstream.NewStreamHandler for port -// forward streams. It checks each stream's port and stream type headers, -// rejecting any streams that with missing or invalid values. Each valid -// stream is sent to the streams channel. -func httpStreamReceived(streams chan httpstream.Stream) func(httpstream.Stream, <-chan struct{}) error { - return func(stream httpstream.Stream, replySent <-chan struct{}) error { - // make sure it has a valid port header - portString := stream.Headers().Get(api.PortHeader) - if len(portString) == 0 { - return fmt.Errorf("%q header is required", api.PortHeader) - } - port, err := strconv.ParseUint(portString, 10, 16) - if err != nil { - return fmt.Errorf("unable to parse %q as a port: %v", portString, err) - } - if port < 1 { - return fmt.Errorf("port %q must be > 0", portString) - } - - // make sure it has a valid stream type header - streamType := stream.Headers().Get(api.StreamType) - if len(streamType) == 0 { - return fmt.Errorf("%q header is required", api.StreamType) - } - if streamType != api.StreamTypeError && streamType != api.StreamTypeData { - return fmt.Errorf("invalid stream type %q", streamType) - } - - streams <- stream - return nil - } -} - -// httpStreamHandler is capable of processing multiple port forward -// requests over a single httpstream.Connection. -type httpStreamHandler struct { - conn httpstream.Connection - streamChan chan httpstream.Stream - streamPairsLock sync.RWMutex - streamPairs map[string]*httpStreamPair - streamCreationTimeout time.Duration - pod string - uid types.UID - forwarder PortForwarder -} - -// getStreamPair returns a httpStreamPair for requestID. This creates a -// new pair if one does not yet exist for the requestID. The returned bool is -// true if the pair was created. -func (h *httpStreamHandler) getStreamPair(requestID string) (*httpStreamPair, bool) { - h.streamPairsLock.Lock() - defer h.streamPairsLock.Unlock() - - if p, ok := h.streamPairs[requestID]; ok { - klog.V(5).InfoS("Connection request found existing stream pair", "connection", h.conn, "request", requestID) - return p, false - } - - klog.V(5).InfoS("Connection request creating new stream pair", "connection", h.conn, "request", requestID) - - p := newPortForwardPair(requestID) - h.streamPairs[requestID] = p - - return p, true -} - -// monitorStreamPair waits for the pair to receive both its error and data -// streams, or for the timeout to expire (whichever happens first), and then -// removes the pair. -func (h *httpStreamHandler) monitorStreamPair(p *httpStreamPair, timeout <-chan time.Time) { - select { - case <-timeout: - err := fmt.Errorf("(conn=%v, request=%s) timed out waiting for streams", h.conn, p.requestID) - utilruntime.HandleError(err) - p.printError(err.Error()) - case <-p.complete: - klog.V(5).InfoS("Connection request successfully received error and data streams", "connection", h.conn, "request", p.requestID) - } - h.removeStreamPair(p.requestID) -} - -// hasStreamPair returns a bool indicating if a stream pair for requestID -// exists. -func (h *httpStreamHandler) hasStreamPair(requestID string) bool { - h.streamPairsLock.RLock() - defer h.streamPairsLock.RUnlock() - - _, ok := h.streamPairs[requestID] - return ok -} - -// removeStreamPair removes the stream pair identified by requestID from streamPairs. -func (h *httpStreamHandler) removeStreamPair(requestID string) { - h.streamPairsLock.Lock() - defer h.streamPairsLock.Unlock() - - if h.conn != nil { - pair := h.streamPairs[requestID] - h.conn.RemoveStreams(pair.dataStream, pair.errorStream) - } - delete(h.streamPairs, requestID) -} - -// requestID returns the request id for stream. -func (h *httpStreamHandler) requestID(stream httpstream.Stream) string { - requestID := stream.Headers().Get(api.PortForwardRequestIDHeader) - if len(requestID) == 0 { - klog.V(5).InfoS("Connection stream received without requestID header", "connection", h.conn) - // If we get here, it's because the connection came from an older client - // that isn't generating the request id header - // (https://github.com/kubernetes/kubernetes/blob/843134885e7e0b360eb5441e85b1410a8b1a7a0c/pkg/client/unversioned/portforward/portforward.go#L258-L287) - // - // This is a best-effort attempt at supporting older clients. - // - // When there aren't concurrent new forwarded connections, each connection - // will have a pair of streams (data, error), and the stream IDs will be - // consecutive odd numbers, e.g. 1 and 3 for the first connection. Convert - // the stream ID into a pseudo-request id by taking the stream type and - // using id = stream.Identifier() when the stream type is error, - // and id = stream.Identifier() - 2 when it's data. - // - // NOTE: this only works when there are not concurrent new streams from - // multiple forwarded connections; it's a best-effort attempt at supporting - // old clients that don't generate request ids. If there are concurrent - // new connections, it's possible that 1 connection gets streams whose IDs - // are not consecutive (e.g. 5 and 9 instead of 5 and 7). - streamType := stream.Headers().Get(api.StreamType) - switch streamType { - case api.StreamTypeError: - requestID = strconv.Itoa(int(stream.Identifier())) - case api.StreamTypeData: - requestID = strconv.Itoa(int(stream.Identifier()) - 2) - } - - klog.V(5).InfoS("Connection automatically assigning request ID from stream type and stream ID", "connection", h.conn, "request", requestID, "streamType", streamType, "stream", stream.Identifier()) - } - return requestID -} - -// run is the main loop for the httpStreamHandler. It processes new -// streams, invoking portForward for each complete stream pair. The loop exits -// when the httpstream.Connection is closed. -func (h *httpStreamHandler) run() { - klog.V(5).InfoS("Connection waiting for port forward streams", "connection", h.conn) -Loop: - for { - select { - case <-h.conn.CloseChan(): - klog.V(5).InfoS("Connection upgraded connection closed", "connection", h.conn) - break Loop - case stream := <-h.streamChan: - requestID := h.requestID(stream) - streamType := stream.Headers().Get(api.StreamType) - klog.V(5).InfoS("Connection request received new type of stream", "connection", h.conn, "request", requestID, "streamType", streamType) - - p, created := h.getStreamPair(requestID) - if created { - go h.monitorStreamPair(p, time.After(h.streamCreationTimeout)) - } - if complete, err := p.add(stream); err != nil { - msg := fmt.Sprintf("error processing stream for request %s: %v", requestID, err) - utilruntime.HandleError(errors.New(msg)) - p.printError(msg) - } else if complete { - go h.portForward(p) - } - } - } -} - -// portForward invokes the httpStreamHandler's forwarder.PortForward -// function for the given stream pair. -func (h *httpStreamHandler) portForward(p *httpStreamPair) { - ctx := context.Background() - defer p.dataStream.Close() - defer p.errorStream.Close() - - portString := p.dataStream.Headers().Get(api.PortHeader) - port, _ := strconv.ParseInt(portString, 10, 32) - - klog.V(5).InfoS("Connection request invoking forwarder.PortForward for port", "connection", h.conn, "request", p.requestID, "port", portString) - err := h.forwarder.PortForward(ctx, h.pod, h.uid, int32(port), p.dataStream) - klog.V(5).InfoS("Connection request done invoking forwarder.PortForward for port", "connection", h.conn, "request", p.requestID, "port", portString) - - if err != nil { - msg := fmt.Errorf("error forwarding port %d to pod %s, uid %v: %v", port, h.pod, h.uid, err) - utilruntime.HandleError(msg) - fmt.Fprint(p.errorStream, msg.Error()) - } -} - -// httpStreamPair represents the error and data streams for a port -// forwarding request. -type httpStreamPair struct { - lock sync.RWMutex - requestID string - dataStream httpstream.Stream - errorStream httpstream.Stream - complete chan struct{} -} - -// newPortForwardPair creates a new httpStreamPair. -func newPortForwardPair(requestID string) *httpStreamPair { - return &httpStreamPair{ - requestID: requestID, - complete: make(chan struct{}), - } -} - -// add adds the stream to the httpStreamPair. If the pair already -// contains a stream for the new stream's type, an error is returned. add -// returns true if both the data and error streams for this pair have been -// received. -func (p *httpStreamPair) add(stream httpstream.Stream) (bool, error) { - p.lock.Lock() - defer p.lock.Unlock() - - switch stream.Headers().Get(api.StreamType) { - case api.StreamTypeError: - if p.errorStream != nil { - return false, errors.New("error stream already assigned") - } - p.errorStream = stream - case api.StreamTypeData: - if p.dataStream != nil { - return false, errors.New("data stream already assigned") - } - p.dataStream = stream - } - - complete := p.errorStream != nil && p.dataStream != nil - if complete { - close(p.complete) - } - return complete, nil -} - -// printError writes s to p.errorStream if p.errorStream has been set. -func (p *httpStreamPair) printError(s string) { - p.lock.RLock() - defer p.lock.RUnlock() - if p.errorStream != nil { - fmt.Fprint(p.errorStream, s) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/portforward.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/portforward.go deleted file mode 100644 index 7aa668ca4dc8..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/portforward.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 portforward - -import ( - "context" - "io" - "net/http" - "time" - - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/httpstream/wsstream" - "k8s.io/apimachinery/pkg/util/runtime" -) - -// PortForwarder knows how to forward content from a data stream to/from a port -// in a pod. -type PortForwarder interface { - // PortForwarder copies data between a data stream and a port in a pod. - PortForward(ctx context.Context, name string, uid types.UID, port int32, stream io.ReadWriteCloser) error -} - -// ServePortForward handles a port forwarding request. A single request is -// kept alive as long as the client is still alive and the connection has not -// been timed out due to idleness. This function handles multiple forwarded -// connections; i.e., multiple `curl http://localhost:8888/` requests will be -// handled by a single invocation of ServePortForward. -func ServePortForward(w http.ResponseWriter, req *http.Request, portForwarder PortForwarder, podName string, uid types.UID, portForwardOptions *V4Options, idleTimeout time.Duration, streamCreationTimeout time.Duration, supportedProtocols []string) { - var err error - if wsstream.IsWebSocketRequest(req) { - err = handleWebSocketStreams(req, w, portForwarder, podName, uid, portForwardOptions, supportedProtocols, idleTimeout, streamCreationTimeout) - } else { - err = handleHTTPStreams(req, w, portForwarder, podName, uid, supportedProtocols, idleTimeout, streamCreationTimeout) - } - - if err != nil { - runtime.HandleError(err) - return - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/websocket.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/websocket.go deleted file mode 100644 index 3700a7e22ada..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/portforward/websocket.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 portforward - -import ( - "context" - "encoding/binary" - "fmt" - "io" - "net/http" - "strconv" - "strings" - "sync" - "time" - - "k8s.io/klog/v2" - - api "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/httpstream/wsstream" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apiserver/pkg/endpoints/responsewriter" -) - -const ( - dataChannel = iota - errorChannel - - v4BinaryWebsocketProtocol = "v4." + wsstream.ChannelWebSocketProtocol - v4Base64WebsocketProtocol = "v4." + wsstream.Base64ChannelWebSocketProtocol -) - -// V4Options contains details about which streams are required for port -// forwarding. -// All fields included in V4Options need to be expressed explicitly in the -// CRI (k8s.io/cri-api/pkg/apis/{version}/api.proto) PortForwardRequest. -type V4Options struct { - Ports []int32 -} - -// NewV4Options creates a new options from the Request. -func NewV4Options(req *http.Request) (*V4Options, error) { - if !wsstream.IsWebSocketRequest(req) { - return &V4Options{}, nil - } - - portStrings := req.URL.Query()[api.PortHeader] - if len(portStrings) == 0 { - return nil, fmt.Errorf("query parameter %q is required", api.PortHeader) - } - - ports := make([]int32, 0, len(portStrings)) - for _, portString := range portStrings { - if len(portString) == 0 { - return nil, fmt.Errorf("query parameter %q cannot be empty", api.PortHeader) - } - for _, p := range strings.Split(portString, ",") { - port, err := strconv.ParseUint(p, 10, 16) - if err != nil { - return nil, fmt.Errorf("unable to parse %q as a port: %v", portString, err) - } - if port < 1 { - return nil, fmt.Errorf("port %q must be > 0", portString) - } - ports = append(ports, int32(port)) - } - } - - return &V4Options{ - Ports: ports, - }, nil -} - -// BuildV4Options returns a V4Options based on the given information. -func BuildV4Options(ports []int32) (*V4Options, error) { - return &V4Options{Ports: ports}, nil -} - -// handleWebSocketStreams handles requests to forward ports to a pod via -// a PortForwarder. A pair of streams are created per port (DATA n, -// ERROR n+1). The associated port is written to each stream as a unsigned 16 -// bit integer in little endian format. -func handleWebSocketStreams(req *http.Request, w http.ResponseWriter, portForwarder PortForwarder, podName string, uid types.UID, opts *V4Options, supportedPortForwardProtocols []string, idleTimeout, streamCreationTimeout time.Duration) error { - channels := make([]wsstream.ChannelType, 0, len(opts.Ports)*2) - for i := 0; i < len(opts.Ports); i++ { - channels = append(channels, wsstream.ReadWriteChannel, wsstream.WriteChannel) - } - conn := wsstream.NewConn(map[string]wsstream.ChannelProtocolConfig{ - "": { - Binary: true, - Channels: channels, - }, - v4BinaryWebsocketProtocol: { - Binary: true, - Channels: channels, - }, - v4Base64WebsocketProtocol: { - Binary: false, - Channels: channels, - }, - }) - conn.SetIdleTimeout(idleTimeout) - _, streams, err := conn.Open(responsewriter.GetOriginal(w), req) - if err != nil { - err = fmt.Errorf("unable to upgrade websocket connection: %v", err) - return err - } - defer conn.Close() - streamPairs := make([]*websocketStreamPair, len(opts.Ports)) - for i := range streamPairs { - streamPair := websocketStreamPair{ - port: opts.Ports[i], - dataStream: streams[i*2+dataChannel], - errorStream: streams[i*2+errorChannel], - } - streamPairs[i] = &streamPair - - portBytes := make([]byte, 2) - // port is always positive so conversion is allowable - binary.LittleEndian.PutUint16(portBytes, uint16(streamPair.port)) - streamPair.dataStream.Write(portBytes) - streamPair.errorStream.Write(portBytes) - } - h := &websocketStreamHandler{ - conn: conn, - streamPairs: streamPairs, - pod: podName, - uid: uid, - forwarder: portForwarder, - } - h.run() - - return nil -} - -// websocketStreamPair represents the error and data streams for a port -// forwarding request. -type websocketStreamPair struct { - port int32 - dataStream io.ReadWriteCloser - errorStream io.WriteCloser -} - -// websocketStreamHandler is capable of processing a single port forward -// request over a websocket connection -type websocketStreamHandler struct { - conn *wsstream.Conn - streamPairs []*websocketStreamPair - pod string - uid types.UID - forwarder PortForwarder -} - -// run invokes the websocketStreamHandler's forwarder.PortForward -// function for the given stream pair. -func (h *websocketStreamHandler) run() { - wg := sync.WaitGroup{} - wg.Add(len(h.streamPairs)) - - for _, pair := range h.streamPairs { - p := pair - go func() { - defer wg.Done() - h.portForward(p) - }() - } - - wg.Wait() -} - -func (h *websocketStreamHandler) portForward(p *websocketStreamPair) { - ctx := context.Background() - defer p.dataStream.Close() - defer p.errorStream.Close() - - klog.V(5).InfoS("Connection invoking forwarder.PortForward for port", "connection", h.conn, "port", p.port) - err := h.forwarder.PortForward(ctx, h.pod, h.uid, p.port, p.dataStream) - klog.V(5).InfoS("Connection done invoking forwarder.PortForward for port", "connection", h.conn, "port", p.port) - - if err != nil { - msg := fmt.Errorf("error forwarding port %d to pod %s, uid %v: %v", p.port, h.pod, h.uid, err) - runtime.HandleError(msg) - fmt.Fprint(p.errorStream, msg.Error()) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/attach.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/attach.go deleted file mode 100644 index aa638499a957..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/attach.go +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 remotecommand - -import ( - "context" - "fmt" - "io" - "net/http" - "time" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/client-go/tools/remotecommand" -) - -// Attacher knows how to attach to a running container in a pod. -type Attacher interface { - // AttachContainer attaches to the running container in the pod, copying data between in/out/err - // and the container's stdin/stdout/stderr. - AttachContainer(ctx context.Context, name string, uid types.UID, container string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error -} - -// ServeAttach handles requests to attach to a container. After creating/receiving the required -// streams, it delegates the actual attaching to attacher. -func ServeAttach(w http.ResponseWriter, req *http.Request, attacher Attacher, podName string, uid types.UID, container string, streamOpts *Options, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string) { - ctx, ok := createStreams(req, w, streamOpts, supportedProtocols, idleTimeout, streamCreationTimeout) - if !ok { - // error is handled by createStreams - return - } - defer ctx.conn.Close() - - err := attacher.AttachContainer(req.Context(), podName, uid, container, ctx.stdinStream, ctx.stdoutStream, ctx.stderrStream, ctx.tty, ctx.resizeChan) - if err != nil { - err = fmt.Errorf("error attaching to container: %v", err) - runtime.HandleError(err) - ctx.writeStatus(apierrors.NewInternalError(err)) - } else { - ctx.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{ - Status: metav1.StatusSuccess, - }}) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/doc.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/doc.go deleted file mode 100644 index bf0d010b91ea..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 remotecommand contains functions related to executing commands in and attaching to pods. -package remotecommand diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/exec.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/exec.go deleted file mode 100644 index 5ec6b86a8d04..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/exec.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 remotecommand - -import ( - "context" - "fmt" - "io" - "net/http" - "time" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/client-go/tools/remotecommand" - utilexec "k8s.io/utils/exec" -) - -// Executor knows how to execute a command in a container in a pod. -type Executor interface { - // ExecInContainer executes a command in a container in the pod, copying data - // between in/out/err and the container's stdin/stdout/stderr. - ExecInContainer(ctx context.Context, name string, uid types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error -} - -// ServeExec handles requests to execute a command in a container. After -// creating/receiving the required streams, it delegates the actual execution -// to the executor. -func ServeExec(w http.ResponseWriter, req *http.Request, executor Executor, podName string, uid types.UID, container string, cmd []string, streamOpts *Options, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string) { - ctx, ok := createStreams(req, w, streamOpts, supportedProtocols, idleTimeout, streamCreationTimeout) - if !ok { - // error is handled by createStreams - return - } - defer ctx.conn.Close() - - err := executor.ExecInContainer(req.Context(), podName, uid, container, cmd, ctx.stdinStream, ctx.stdoutStream, ctx.stderrStream, ctx.tty, ctx.resizeChan, 0) - if err != nil { - if exitErr, ok := err.(utilexec.ExitError); ok && exitErr.Exited() { - rc := exitErr.ExitStatus() - ctx.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{ - Status: metav1.StatusFailure, - Reason: remotecommandconsts.NonZeroExitCodeReason, - Details: &metav1.StatusDetails{ - Causes: []metav1.StatusCause{ - { - Type: remotecommandconsts.ExitCodeCauseType, - Message: fmt.Sprintf("%d", rc), - }, - }, - }, - Message: fmt.Sprintf("command terminated with non-zero exit code: %v", exitErr), - }}) - } else { - err = fmt.Errorf("error executing command in container: %v", err) - runtime.HandleError(err) - ctx.writeStatus(apierrors.NewInternalError(err)) - } - } else { - ctx.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{ - Status: metav1.StatusSuccess, - }}) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/httpstream.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/httpstream.go deleted file mode 100644 index 92ab045d24b5..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/httpstream.go +++ /dev/null @@ -1,447 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 remotecommand - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "time" - - api "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/httpstream" - "k8s.io/apimachinery/pkg/util/httpstream/spdy" - "k8s.io/apimachinery/pkg/util/httpstream/wsstream" - remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/client-go/tools/remotecommand" - - "k8s.io/klog/v2" -) - -// Options contains details about which streams are required for -// remote command execution. -type Options struct { - Stdin bool - Stdout bool - Stderr bool - TTY bool -} - -// NewOptions creates a new Options from the Request. -func NewOptions(req *http.Request) (*Options, error) { - tty := req.FormValue(api.ExecTTYParam) == "1" - stdin := req.FormValue(api.ExecStdinParam) == "1" - stdout := req.FormValue(api.ExecStdoutParam) == "1" - stderr := req.FormValue(api.ExecStderrParam) == "1" - if tty && stderr { - // TODO: make this an error before we reach this method - klog.V(4).InfoS("Access to exec with tty and stderr is not supported, bypassing stderr") - stderr = false - } - - if !stdin && !stdout && !stderr { - return nil, fmt.Errorf("you must specify at least 1 of stdin, stdout, stderr") - } - - return &Options{ - Stdin: stdin, - Stdout: stdout, - Stderr: stderr, - TTY: tty, - }, nil -} - -// connectionContext contains the connection and streams used when -// forwarding an attach or execute session into a container. -type connectionContext struct { - conn io.Closer - stdinStream io.ReadCloser - stdoutStream io.WriteCloser - stderrStream io.WriteCloser - writeStatus func(status *apierrors.StatusError) error - resizeStream io.ReadCloser - resizeChan chan remotecommand.TerminalSize - tty bool -} - -// streamAndReply holds both a Stream and a channel that is closed when the stream's reply frame is -// enqueued. Consumers can wait for replySent to be closed prior to proceeding, to ensure that the -// replyFrame is enqueued before the connection's goaway frame is sent (e.g. if a stream was -// received and right after, the connection gets closed). -type streamAndReply struct { - httpstream.Stream - replySent <-chan struct{} -} - -// waitStreamReply waits until either replySent or stop is closed. If replySent is closed, it sends -// an empty struct to the notify channel. -func waitStreamReply(replySent <-chan struct{}, notify chan<- struct{}, stop <-chan struct{}) { - select { - case <-replySent: - notify <- struct{}{} - case <-stop: - } -} - -func createStreams(req *http.Request, w http.ResponseWriter, opts *Options, supportedStreamProtocols []string, idleTimeout, streamCreationTimeout time.Duration) (*connectionContext, bool) { - var ctx *connectionContext - var ok bool - if wsstream.IsWebSocketRequest(req) { - ctx, ok = createWebSocketStreams(req, w, opts, idleTimeout) - } else { - ctx, ok = createHTTPStreamStreams(req, w, opts, supportedStreamProtocols, idleTimeout, streamCreationTimeout) - } - if !ok { - return nil, false - } - - if ctx.resizeStream != nil { - ctx.resizeChan = make(chan remotecommand.TerminalSize) - go handleResizeEvents(ctx.resizeStream, ctx.resizeChan) - } - - return ctx, true -} - -func createHTTPStreamStreams(req *http.Request, w http.ResponseWriter, opts *Options, supportedStreamProtocols []string, idleTimeout, streamCreationTimeout time.Duration) (*connectionContext, bool) { - protocol, err := httpstream.Handshake(req, w, supportedStreamProtocols) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return nil, false - } - - streamCh := make(chan streamAndReply) - - upgrader := spdy.NewResponseUpgrader() - conn := upgrader.UpgradeResponse(w, req, func(stream httpstream.Stream, replySent <-chan struct{}) error { - streamCh <- streamAndReply{Stream: stream, replySent: replySent} - return nil - }) - // from this point on, we can no longer call methods on response - if conn == nil { - // The upgrader is responsible for notifying the client of any errors that - // occurred during upgrading. All we can do is return here at this point - // if we weren't successful in upgrading. - return nil, false - } - - conn.SetIdleTimeout(idleTimeout) - - var handler protocolHandler - switch protocol { - case remotecommandconsts.StreamProtocolV4Name: - handler = &v4ProtocolHandler{} - case remotecommandconsts.StreamProtocolV3Name: - handler = &v3ProtocolHandler{} - case remotecommandconsts.StreamProtocolV2Name: - handler = &v2ProtocolHandler{} - case "": - klog.V(4).InfoS("Client did not request protocol negotiation. Falling back", "protocol", remotecommandconsts.StreamProtocolV1Name) - fallthrough - case remotecommandconsts.StreamProtocolV1Name: - handler = &v1ProtocolHandler{} - } - - // count the streams client asked for, starting with 1 - expectedStreams := 1 - if opts.Stdin { - expectedStreams++ - } - if opts.Stdout { - expectedStreams++ - } - if opts.Stderr { - expectedStreams++ - } - if opts.TTY && handler.supportsTerminalResizing() { - expectedStreams++ - } - - expired := time.NewTimer(streamCreationTimeout) - defer expired.Stop() - - ctx, err := handler.waitForStreams(streamCh, expectedStreams, expired.C) - if err != nil { - runtime.HandleError(err) - return nil, false - } - - ctx.conn = conn - ctx.tty = opts.TTY - - return ctx, true -} - -type protocolHandler interface { - // waitForStreams waits for the expected streams or a timeout, returning a - // remoteCommandContext if all the streams were received, or an error if not. - waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) - // supportsTerminalResizing returns true if the protocol handler supports terminal resizing - supportsTerminalResizing() bool -} - -// v4ProtocolHandler implements the V4 protocol version for streaming command execution. It only differs -// in from v3 in the error stream format using an json-marshaled metav1.Status which carries -// the process' exit code. -type v4ProtocolHandler struct{} - -func (*v4ProtocolHandler) waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) { - ctx := &connectionContext{} - receivedStreams := 0 - replyChan := make(chan struct{}) - stop := make(chan struct{}) - defer close(stop) -WaitForStreams: - for { - select { - case stream := <-streams: - streamType := stream.Headers().Get(api.StreamType) - switch streamType { - case api.StreamTypeError: - ctx.writeStatus = v4WriteStatusFunc(stream) // write json errors - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStdin: - ctx.stdinStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStdout: - ctx.stdoutStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStderr: - ctx.stderrStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeResize: - ctx.resizeStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - default: - runtime.HandleError(fmt.Errorf("unexpected stream type: %q", streamType)) - } - case <-replyChan: - receivedStreams++ - if receivedStreams == expectedStreams { - break WaitForStreams - } - case <-expired: - // TODO find a way to return the error to the user. Maybe use a separate - // stream to report errors? - return nil, errors.New("timed out waiting for client to create streams") - } - } - - return ctx, nil -} - -// supportsTerminalResizing returns true because v4ProtocolHandler supports it -func (*v4ProtocolHandler) supportsTerminalResizing() bool { return true } - -// v3ProtocolHandler implements the V3 protocol version for streaming command execution. -type v3ProtocolHandler struct{} - -func (*v3ProtocolHandler) waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) { - ctx := &connectionContext{} - receivedStreams := 0 - replyChan := make(chan struct{}) - stop := make(chan struct{}) - defer close(stop) -WaitForStreams: - for { - select { - case stream := <-streams: - streamType := stream.Headers().Get(api.StreamType) - switch streamType { - case api.StreamTypeError: - ctx.writeStatus = v1WriteStatusFunc(stream) - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStdin: - ctx.stdinStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStdout: - ctx.stdoutStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStderr: - ctx.stderrStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeResize: - ctx.resizeStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - default: - runtime.HandleError(fmt.Errorf("unexpected stream type: %q", streamType)) - } - case <-replyChan: - receivedStreams++ - if receivedStreams == expectedStreams { - break WaitForStreams - } - case <-expired: - // TODO find a way to return the error to the user. Maybe use a separate - // stream to report errors? - return nil, errors.New("timed out waiting for client to create streams") - } - } - - return ctx, nil -} - -// supportsTerminalResizing returns true because v3ProtocolHandler supports it -func (*v3ProtocolHandler) supportsTerminalResizing() bool { return true } - -// v2ProtocolHandler implements the V2 protocol version for streaming command execution. -type v2ProtocolHandler struct{} - -func (*v2ProtocolHandler) waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) { - ctx := &connectionContext{} - receivedStreams := 0 - replyChan := make(chan struct{}) - stop := make(chan struct{}) - defer close(stop) -WaitForStreams: - for { - select { - case stream := <-streams: - streamType := stream.Headers().Get(api.StreamType) - switch streamType { - case api.StreamTypeError: - ctx.writeStatus = v1WriteStatusFunc(stream) - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStdin: - ctx.stdinStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStdout: - ctx.stdoutStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStderr: - ctx.stderrStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - default: - runtime.HandleError(fmt.Errorf("unexpected stream type: %q", streamType)) - } - case <-replyChan: - receivedStreams++ - if receivedStreams == expectedStreams { - break WaitForStreams - } - case <-expired: - // TODO find a way to return the error to the user. Maybe use a separate - // stream to report errors? - return nil, errors.New("timed out waiting for client to create streams") - } - } - - return ctx, nil -} - -// supportsTerminalResizing returns false because v2ProtocolHandler doesn't support it. -func (*v2ProtocolHandler) supportsTerminalResizing() bool { return false } - -// v1ProtocolHandler implements the V1 protocol version for streaming command execution. -type v1ProtocolHandler struct{} - -func (*v1ProtocolHandler) waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) { - ctx := &connectionContext{} - receivedStreams := 0 - replyChan := make(chan struct{}) - stop := make(chan struct{}) - defer close(stop) -WaitForStreams: - for { - select { - case stream := <-streams: - streamType := stream.Headers().Get(api.StreamType) - switch streamType { - case api.StreamTypeError: - ctx.writeStatus = v1WriteStatusFunc(stream) - - // This defer statement shouldn't be here, but due to previous refactoring, it ended up in - // here. This is what 1.0.x kubelets do, so we're retaining that behavior. This is fixed in - // the v2ProtocolHandler. - defer stream.Reset() - - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStdin: - ctx.stdinStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStdout: - ctx.stdoutStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - case api.StreamTypeStderr: - ctx.stderrStream = stream - go waitStreamReply(stream.replySent, replyChan, stop) - default: - runtime.HandleError(fmt.Errorf("unexpected stream type: %q", streamType)) - } - case <-replyChan: - receivedStreams++ - if receivedStreams == expectedStreams { - break WaitForStreams - } - case <-expired: - // TODO find a way to return the error to the user. Maybe use a separate - // stream to report errors? - return nil, errors.New("timed out waiting for client to create streams") - } - } - - if ctx.stdinStream != nil { - ctx.stdinStream.Close() - } - - return ctx, nil -} - -// supportsTerminalResizing returns false because v1ProtocolHandler doesn't support it. -func (*v1ProtocolHandler) supportsTerminalResizing() bool { return false } - -func handleResizeEvents(stream io.Reader, channel chan<- remotecommand.TerminalSize) { - defer runtime.HandleCrash() - defer close(channel) - - decoder := json.NewDecoder(stream) - for { - size := remotecommand.TerminalSize{} - if err := decoder.Decode(&size); err != nil { - break - } - channel <- size - } -} - -func v1WriteStatusFunc(stream io.Writer) func(status *apierrors.StatusError) error { - return func(status *apierrors.StatusError) error { - if status.Status().Status == metav1.StatusSuccess { - return nil // send error messages - } - _, err := stream.Write([]byte(status.Error())) - return err - } -} - -// v4WriteStatusFunc returns a WriteStatusFunc that marshals a given api Status -// as json in the error channel. -func v4WriteStatusFunc(stream io.Writer) func(status *apierrors.StatusError) error { - return func(status *apierrors.StatusError) error { - bs, err := json.Marshal(status.Status()) - if err != nil { - return err - } - _, err = stream.Write(bs) - return err - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/websocket.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/websocket.go deleted file mode 100644 index 25900888522d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/remotecommand/websocket.go +++ /dev/null @@ -1,132 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 remotecommand - -import ( - "fmt" - "net/http" - "time" - - "k8s.io/apimachinery/pkg/util/httpstream/wsstream" - "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apiserver/pkg/endpoints/responsewriter" -) - -const ( - stdinChannel = iota - stdoutChannel - stderrChannel - errorChannel - resizeChannel - - preV4BinaryWebsocketProtocol = wsstream.ChannelWebSocketProtocol - preV4Base64WebsocketProtocol = wsstream.Base64ChannelWebSocketProtocol - v4BinaryWebsocketProtocol = "v4." + wsstream.ChannelWebSocketProtocol - v4Base64WebsocketProtocol = "v4." + wsstream.Base64ChannelWebSocketProtocol -) - -// createChannels returns the standard channel types for a shell connection (STDIN 0, STDOUT 1, STDERR 2) -// along with the approximate duplex value. It also creates the error (3) and resize (4) channels. -func createChannels(opts *Options) []wsstream.ChannelType { - // open the requested channels, and always open the error channel - channels := make([]wsstream.ChannelType, 5) - channels[stdinChannel] = readChannel(opts.Stdin) - channels[stdoutChannel] = writeChannel(opts.Stdout) - channels[stderrChannel] = writeChannel(opts.Stderr) - channels[errorChannel] = wsstream.WriteChannel - channels[resizeChannel] = wsstream.ReadChannel - return channels -} - -// readChannel returns wsstream.ReadChannel if real is true, or wsstream.IgnoreChannel. -func readChannel(real bool) wsstream.ChannelType { - if real { - return wsstream.ReadChannel - } - return wsstream.IgnoreChannel -} - -// writeChannel returns wsstream.WriteChannel if real is true, or wsstream.IgnoreChannel. -func writeChannel(real bool) wsstream.ChannelType { - if real { - return wsstream.WriteChannel - } - return wsstream.IgnoreChannel -} - -// createWebSocketStreams returns a connectionContext containing the websocket connection and -// streams needed to perform an exec or an attach. -func createWebSocketStreams(req *http.Request, w http.ResponseWriter, opts *Options, idleTimeout time.Duration) (*connectionContext, bool) { - channels := createChannels(opts) - conn := wsstream.NewConn(map[string]wsstream.ChannelProtocolConfig{ - "": { - Binary: true, - Channels: channels, - }, - preV4BinaryWebsocketProtocol: { - Binary: true, - Channels: channels, - }, - preV4Base64WebsocketProtocol: { - Binary: false, - Channels: channels, - }, - v4BinaryWebsocketProtocol: { - Binary: true, - Channels: channels, - }, - v4Base64WebsocketProtocol: { - Binary: false, - Channels: channels, - }, - }) - conn.SetIdleTimeout(idleTimeout) - negotiatedProtocol, streams, err := conn.Open(responsewriter.GetOriginal(w), req) - if err != nil { - runtime.HandleError(fmt.Errorf("unable to upgrade websocket connection: %v", err)) - return nil, false - } - - // Send an empty message to the lowest writable channel to notify the client the connection is established - // TODO: make generic to SPDY and WebSockets and do it outside of this method? - switch { - case opts.Stdout: - streams[stdoutChannel].Write([]byte{}) - case opts.Stderr: - streams[stderrChannel].Write([]byte{}) - default: - streams[errorChannel].Write([]byte{}) - } - - ctx := &connectionContext{ - conn: conn, - stdinStream: streams[stdinChannel], - stdoutStream: streams[stdoutChannel], - stderrStream: streams[stderrChannel], - tty: opts.TTY, - resizeStream: streams[resizeChannel], - } - - switch negotiatedProtocol { - case v4BinaryWebsocketProtocol, v4Base64WebsocketProtocol: - ctx.writeStatus = v4WriteStatusFunc(streams[errorChannel]) - default: - ctx.writeStatus = v1WriteStatusFunc(streams[errorChannel]) - } - - return ctx, true -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/request_cache.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/request_cache.go deleted file mode 100644 index 136f549311c0..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/request_cache.go +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 streaming - -import ( - "container/list" - "crypto/rand" - "encoding/base64" - "fmt" - "math" - "sync" - "time" - - "k8s.io/utils/clock" -) - -var ( - // cacheTTL is the timeout after which tokens become invalid. - cacheTTL = 1 * time.Minute - // maxInFlight is the maximum number of in-flight requests to allow. - maxInFlight = 1000 - // tokenLen is the length of the random base64 encoded token identifying the request. - tokenLen = 8 -) - -// requestCache caches streaming (exec/attach/port-forward) requests and generates a single-use -// random token for their retrieval. The requestCache is used for building streaming URLs without -// the need to encode every request parameter in the URL. -type requestCache struct { - // clock is used to obtain the current time - clock clock.Clock - - // tokens maps the generate token to the request for fast retrieval. - tokens map[string]*list.Element - // ll maintains an age-ordered request list for faster garbage collection of expired requests. - ll *list.List - - lock sync.Mutex -} - -// Type representing an *ExecRequest, *AttachRequest, or *PortForwardRequest. -type request interface{} - -type cacheEntry struct { - token string `datapolicy:"token"` - req request - expireTime time.Time -} - -func newRequestCache() *requestCache { - return &requestCache{ - clock: clock.RealClock{}, - ll: list.New(), - tokens: make(map[string]*list.Element), - } -} - -// Insert the given request into the cache and returns the token used for fetching it out. -func (c *requestCache) Insert(req request) (token string, err error) { - c.lock.Lock() - defer c.lock.Unlock() - - // Remove expired entries. - c.gc() - // If the cache is full, reject the request. - if c.ll.Len() == maxInFlight { - return "", NewErrorTooManyInFlight() - } - token, err = c.uniqueToken() - if err != nil { - return "", err - } - ele := c.ll.PushFront(&cacheEntry{token, req, c.clock.Now().Add(cacheTTL)}) - - c.tokens[token] = ele - return token, nil -} - -// Consume the token (remove it from the cache) and return the cached request, if found. -func (c *requestCache) Consume(token string) (req request, found bool) { - c.lock.Lock() - defer c.lock.Unlock() - ele, ok := c.tokens[token] - if !ok { - return nil, false - } - c.ll.Remove(ele) - delete(c.tokens, token) - - entry := ele.Value.(*cacheEntry) - if c.clock.Now().After(entry.expireTime) { - // Entry already expired. - return nil, false - } - return entry.req, true -} - -// uniqueToken generates a random URL-safe token and ensures uniqueness. -func (c *requestCache) uniqueToken() (string, error) { - const maxTries = 10 - // Number of bytes to be tokenLen when base64 encoded. - tokenSize := math.Ceil(float64(tokenLen) * 6 / 8) - rawToken := make([]byte, int(tokenSize)) - for i := 0; i < maxTries; i++ { - if _, err := rand.Read(rawToken); err != nil { - return "", err - } - encoded := base64.RawURLEncoding.EncodeToString(rawToken) - token := encoded[:tokenLen] - // If it's unique, return it. Otherwise retry. - if _, exists := c.tokens[encoded]; !exists { - return token, nil - } - } - return "", fmt.Errorf("failed to generate unique token") -} - -// Must be write-locked prior to calling. -func (c *requestCache) gc() { - now := c.clock.Now() - for c.ll.Len() > 0 { - oldest := c.ll.Back() - entry := oldest.Value.(*cacheEntry) - if !now.After(entry.expireTime) { - return - } - - // Oldest value is expired; remove it. - c.ll.Remove(oldest) - delete(c.tokens, entry.token) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/server.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/server.go deleted file mode 100644 index fe5c22b04979..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/cri/streaming/server.go +++ /dev/null @@ -1,383 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 streaming - -import ( - "context" - "crypto/tls" - "errors" - "io" - "net" - "net/http" - "net/url" - "path" - "time" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - restful "github.com/emicklei/go-restful/v3" - - "k8s.io/apimachinery/pkg/types" - remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand" - "k8s.io/client-go/tools/remotecommand" - runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" - "k8s.io/kubelet/pkg/cri/streaming/portforward" - remotecommandserver "k8s.io/kubelet/pkg/cri/streaming/remotecommand" -) - -// Server is the library interface to serve the stream requests. -type Server interface { - http.Handler - - // Get the serving URL for the requests. - // Requests must not be nil. Responses may be nil iff an error is returned. - GetExec(*runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error) - GetAttach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error) - GetPortForward(*runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) - - // Start the server. - // addr is the address to serve on (address:port) stayUp indicates whether the server should - // listen until Stop() is called, or automatically stop after all expected connections are - // closed. Calling Get{Exec,Attach,PortForward} increments the expected connection count. - // Function does not return until the server is stopped. - Start(stayUp bool) error - // Stop the server, and terminate any open connections. - Stop() error -} - -// Runtime is the interface to execute the commands and provide the streams. -type Runtime interface { - Exec(ctx context.Context, containerID string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error - Attach(ctx context.Context, containerID string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error - PortForward(ctx context.Context, podSandboxID string, port int32, stream io.ReadWriteCloser) error -} - -// Config defines the options used for running the stream server. -type Config struct { - // The host:port address the server will listen on. - Addr string - // The optional base URL for constructing streaming URLs. If empty, the baseURL will be - // constructed from the serve address. - // Note that for port "0", the URL port will be set to actual port in use. - BaseURL *url.URL - - // How long to leave idle connections open for. - StreamIdleTimeout time.Duration - // How long to wait for clients to create streams. Only used for SPDY streaming. - StreamCreationTimeout time.Duration - - // The streaming protocols the server supports (understands and permits). See - // k8s.io/kubernetes/pkg/kubelet/server/remotecommand/constants.go for available protocols. - // Only used for SPDY streaming. - SupportedRemoteCommandProtocols []string - - // The streaming protocols the server supports (understands and permits). See - // k8s.io/kubernetes/pkg/kubelet/server/portforward/constants.go for available protocols. - // Only used for SPDY streaming. - SupportedPortForwardProtocols []string - - // The config for serving over TLS. If nil, TLS will not be used. - TLSConfig *tls.Config -} - -// DefaultConfig provides default values for server Config. The DefaultConfig is partial, so -// some fields like Addr must still be provided. -var DefaultConfig = Config{ - StreamIdleTimeout: 4 * time.Hour, - StreamCreationTimeout: remotecommandconsts.DefaultStreamCreationTimeout, - SupportedRemoteCommandProtocols: remotecommandconsts.SupportedStreamingProtocols, - SupportedPortForwardProtocols: portforward.SupportedProtocols, -} - -// NewServer creates a new Server for stream requests. -// TODO(tallclair): Add auth(n/z) interface & handling. -func NewServer(config Config, runtime Runtime) (Server, error) { - s := &server{ - config: config, - runtime: &criAdapter{runtime}, - cache: newRequestCache(), - } - - if s.config.BaseURL == nil { - s.config.BaseURL = &url.URL{ - Scheme: "http", - Host: s.config.Addr, - } - if s.config.TLSConfig != nil { - s.config.BaseURL.Scheme = "https" - } - } - - ws := &restful.WebService{} - endpoints := []struct { - path string - handler restful.RouteFunction - }{ - {"/exec/{token}", s.serveExec}, - {"/attach/{token}", s.serveAttach}, - {"/portforward/{token}", s.servePortForward}, - } - // If serving relative to a base path, set that here. - pathPrefix := path.Dir(s.config.BaseURL.Path) - for _, e := range endpoints { - for _, method := range []string{"GET", "POST"} { - ws.Route(ws. - Method(method). - Path(path.Join(pathPrefix, e.path)). - To(e.handler)) - } - } - handler := restful.NewContainer() - handler.Add(ws) - s.handler = handler - s.server = &http.Server{ - Addr: s.config.Addr, - Handler: s.handler, - TLSConfig: s.config.TLSConfig, - } - - return s, nil -} - -type server struct { - config Config - runtime *criAdapter - handler http.Handler - cache *requestCache - server *http.Server -} - -func validateExecRequest(req *runtimeapi.ExecRequest) error { - if req.ContainerId == "" { - return status.Errorf(codes.InvalidArgument, "missing required container_id") - } - if req.Tty && req.Stderr { - // If TTY is set, stderr cannot be true because multiplexing is not - // supported. - return status.Errorf(codes.InvalidArgument, "tty and stderr cannot both be true") - } - if !req.Stdin && !req.Stdout && !req.Stderr { - return status.Errorf(codes.InvalidArgument, "one of stdin, stdout, or stderr must be set") - } - return nil -} - -func (s *server) GetExec(req *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error) { - if err := validateExecRequest(req); err != nil { - return nil, err - } - token, err := s.cache.Insert(req) - if err != nil { - return nil, err - } - return &runtimeapi.ExecResponse{ - Url: s.buildURL("exec", token), - }, nil -} - -func validateAttachRequest(req *runtimeapi.AttachRequest) error { - if req.ContainerId == "" { - return status.Errorf(codes.InvalidArgument, "missing required container_id") - } - if req.Tty && req.Stderr { - // If TTY is set, stderr cannot be true because multiplexing is not - // supported. - return status.Errorf(codes.InvalidArgument, "tty and stderr cannot both be true") - } - if !req.Stdin && !req.Stdout && !req.Stderr { - return status.Errorf(codes.InvalidArgument, "one of stdin, stdout, and stderr must be set") - } - return nil -} - -func (s *server) GetAttach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error) { - if err := validateAttachRequest(req); err != nil { - return nil, err - } - token, err := s.cache.Insert(req) - if err != nil { - return nil, err - } - return &runtimeapi.AttachResponse{ - Url: s.buildURL("attach", token), - }, nil -} - -func (s *server) GetPortForward(req *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) { - if req.PodSandboxId == "" { - return nil, status.Errorf(codes.InvalidArgument, "missing required pod_sandbox_id") - } - token, err := s.cache.Insert(req) - if err != nil { - return nil, err - } - return &runtimeapi.PortForwardResponse{ - Url: s.buildURL("portforward", token), - }, nil -} - -func (s *server) Start(stayUp bool) error { - if !stayUp { - // TODO(tallclair): Implement this. - return errors.New("stayUp=false is not yet implemented") - } - - listener, err := net.Listen("tcp", s.config.Addr) - if err != nil { - return err - } - // Use the actual address as baseURL host. This handles the "0" port case. - s.config.BaseURL.Host = listener.Addr().String() - if s.config.TLSConfig != nil { - return s.server.ServeTLS(listener, "", "") // Use certs from TLSConfig. - } - return s.server.Serve(listener) -} - -func (s *server) Stop() error { - return s.server.Close() -} - -func (s *server) ServeHTTP(w http.ResponseWriter, r *http.Request) { - s.handler.ServeHTTP(w, r) -} - -func (s *server) buildURL(method, token string) string { - return s.config.BaseURL.ResolveReference(&url.URL{ - Path: path.Join(method, token), - }).String() -} - -func (s *server) serveExec(req *restful.Request, resp *restful.Response) { - token := req.PathParameter("token") - cachedRequest, ok := s.cache.Consume(token) - if !ok { - http.NotFound(resp.ResponseWriter, req.Request) - return - } - exec, ok := cachedRequest.(*runtimeapi.ExecRequest) - if !ok { - http.NotFound(resp.ResponseWriter, req.Request) - return - } - - streamOpts := &remotecommandserver.Options{ - Stdin: exec.Stdin, - Stdout: exec.Stdout, - Stderr: exec.Stderr, - TTY: exec.Tty, - } - - remotecommandserver.ServeExec( - resp.ResponseWriter, - req.Request, - s.runtime, - "", // unused: podName - "", // unusued: podUID - exec.ContainerId, - exec.Cmd, - streamOpts, - s.config.StreamIdleTimeout, - s.config.StreamCreationTimeout, - s.config.SupportedRemoteCommandProtocols) -} - -func (s *server) serveAttach(req *restful.Request, resp *restful.Response) { - token := req.PathParameter("token") - cachedRequest, ok := s.cache.Consume(token) - if !ok { - http.NotFound(resp.ResponseWriter, req.Request) - return - } - attach, ok := cachedRequest.(*runtimeapi.AttachRequest) - if !ok { - http.NotFound(resp.ResponseWriter, req.Request) - return - } - - streamOpts := &remotecommandserver.Options{ - Stdin: attach.Stdin, - Stdout: attach.Stdout, - Stderr: attach.Stderr, - TTY: attach.Tty, - } - remotecommandserver.ServeAttach( - resp.ResponseWriter, - req.Request, - s.runtime, - "", // unused: podName - "", // unusued: podUID - attach.ContainerId, - streamOpts, - s.config.StreamIdleTimeout, - s.config.StreamCreationTimeout, - s.config.SupportedRemoteCommandProtocols) -} - -func (s *server) servePortForward(req *restful.Request, resp *restful.Response) { - token := req.PathParameter("token") - cachedRequest, ok := s.cache.Consume(token) - if !ok { - http.NotFound(resp.ResponseWriter, req.Request) - return - } - pf, ok := cachedRequest.(*runtimeapi.PortForwardRequest) - if !ok { - http.NotFound(resp.ResponseWriter, req.Request) - return - } - - portForwardOptions, err := portforward.BuildV4Options(pf.Port) - if err != nil { - resp.WriteError(http.StatusBadRequest, err) - return - } - - portforward.ServePortForward( - resp.ResponseWriter, - req.Request, - s.runtime, - pf.PodSandboxId, - "", // unused: podUID - portForwardOptions, - s.config.StreamIdleTimeout, - s.config.StreamCreationTimeout, - s.config.SupportedPortForwardProtocols) -} - -// criAdapter wraps the Runtime functions to conform to the remotecommand interfaces. -// The adapter binds the container ID to the container name argument, and the pod sandbox ID to the pod name. -type criAdapter struct { - Runtime -} - -var _ remotecommandserver.Executor = &criAdapter{} -var _ remotecommandserver.Attacher = &criAdapter{} -var _ portforward.PortForwarder = &criAdapter{} - -func (a *criAdapter) ExecInContainer(ctx context.Context, podName string, podUID types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error { - return a.Runtime.Exec(ctx, container, cmd, in, out, err, tty, resize) -} - -func (a *criAdapter) AttachContainer(ctx context.Context, podName string, podUID types.UID, container string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error { - return a.Runtime.Attach(ctx, container, in, out, err, tty, resize) -} - -func (a *criAdapter) PortForward(ctx context.Context, podName string, podUID types.UID, port int32, stream io.ReadWriteCloser) error { - return a.Runtime.PortForward(ctx, podName, port, stream) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/types/labels.go b/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/types/labels.go deleted file mode 100644 index aeeee2c624ac..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubelet/pkg/types/labels.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 types - -// Label keys for labels used in this package. -const ( - KubernetesPodNameLabel = "io.kubernetes.pod.name" - KubernetesPodNamespaceLabel = "io.kubernetes.pod.namespace" - KubernetesPodUIDLabel = "io.kubernetes.pod.uid" - KubernetesContainerNameLabel = "io.kubernetes.container.name" -) - -// GetContainerName returns the value of the KubernetesContainerNameLabel. -func GetContainerName(labels map[string]string) string { - return labels[KubernetesContainerNameLabel] -} - -// GetPodName returns the value of the KubernetesPodNameLabel. -func GetPodName(labels map[string]string) string { - return labels[KubernetesPodNameLabel] -} - -// GetPodUID returns the value of the KubernetesPodUIDLabel. -func GetPodUID(labels map[string]string) string { - return labels[KubernetesPodUIDLabel] -} - -// GetPodNamespace returns the value of the KubernetesPodNamespaceLabel. -func GetPodNamespace(labels map[string]string) string { - return labels[KubernetesPodNamespaceLabel] -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/grpc/ratelimit.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/grpc/ratelimit.go deleted file mode 100644 index 149bcf279b20..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/apis/grpc/ratelimit.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -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 grpc - -import ( - "context" - - gotimerate "golang.org/x/time/rate" - "k8s.io/klog/v2" - - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -var ( - ErrorLimitExceeded = status.Error(codes.ResourceExhausted, "rejected by rate limit") -) - -// Limiter defines the interface to perform request rate limiting, -// based on the interface exposed by https://pkg.go.dev/golang.org/x/time/rate#Limiter -type Limiter interface { - // Allow reports whether an event may happen now. - Allow() bool -} - -// LimiterUnaryServerInterceptor returns a new unary server interceptors that performs request rate limiting. -func LimiterUnaryServerInterceptor(limiter Limiter) grpc.UnaryServerInterceptor { - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - if !limiter.Allow() { - return nil, ErrorLimitExceeded - } - return handler(ctx, req) - } -} - -// WithRateLimiter creates new rate limiter with unary interceptor. -func WithRateLimiter(serviceName string, qps, burstTokens int32) grpc.ServerOption { - qpsVal := gotimerate.Limit(qps) - burstVal := int(burstTokens) - klog.InfoS("Setting rate limiting for endpoint", "service", serviceName, "qps", qpsVal, "burstTokens", burstVal) - return grpc.UnaryInterceptor(LimiterUnaryServerInterceptor(gotimerate.NewLimiter(qpsVal, burstVal))) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/doc.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/doc.go deleted file mode 100644 index 422aca0750bb..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -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 cm (abbreviation of "container manager") and its subpackages contain all the kubelet code -// to manage containers. For example, they contain functions to configure containers' cgroups, -// ensure containers run with the desired QoS, and allocate compute resources like cpus, memory, -// devices... -package cm // import "k8s.io/kubernetes/pkg/kubelet/cm" diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_none.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_none.go deleted file mode 100644 index c82b19e1f9cb..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/topologymanager/scope_none.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -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 topologymanager - -import ( - "k8s.io/api/core/v1" - "k8s.io/kubernetes/pkg/kubelet/cm/containermap" - "k8s.io/kubernetes/pkg/kubelet/lifecycle" -) - -type noneScope struct { - scope -} - -// Ensure noneScope implements Scope interface -var _ Scope = &noneScope{} - -// NewNoneScope returns a none scope. -func NewNoneScope() Scope { - return &noneScope{ - scope{ - name: noneTopologyScope, - podTopologyHints: podTopologyHints{}, - policy: NewNonePolicy(), - podMap: containermap.NewContainerMap(), - }, - } -} - -func (s *noneScope) Admit(pod *v1.Pod) lifecycle.PodAdmitResult { - return s.admitPolicyNone(pod) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/util/cdi/cdi.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/util/cdi/cdi.go deleted file mode 100644 index b228b5a66d8d..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/cm/util/cdi/cdi.go +++ /dev/null @@ -1,308 +0,0 @@ -/* -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. -*/ - -// The code below was copied from -// https://github.com/container-orchestrated-devices/container-device-interface/blob/v0.5.3/pkg/cdi/annotations.go -// https://github.com/container-orchestrated-devices/container-device-interface/blob/v0.5.3/pkg/cdi/qualified-device.go -// to avoid a dependency on that package and the indirect dependencies that -// this would have implied. -// -// Long term it would be good to avoid this duplication: -// https://github.com/container-orchestrated-devices/container-device-interface/issues/97 - -package cdi - -import ( - "errors" - "fmt" - "strings" - - "k8s.io/apimachinery/pkg/types" - kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" -) - -const ( - // annotationPrefix is the prefix for CDI container annotation keys. - annotationPrefix = "cdi.k8s.io/" -) - -// GenerateAnnotations generate container annotations using CDI UpdateAnnotations API. -func GenerateAnnotations( - claimUID types.UID, - driverName string, - cdiDevices []string, -) ([]kubecontainer.Annotation, error) { - if len(cdiDevices) == 0 { - return nil, nil - } - annotations, err := updateAnnotations(map[string]string{}, driverName, string(claimUID), cdiDevices) - if err != nil { - return nil, fmt.Errorf("can't generate CDI annotations: %+v", err) - } - - kubeAnnotations := []kubecontainer.Annotation{} - for key, value := range annotations { - kubeAnnotations = append(kubeAnnotations, kubecontainer.Annotation{Name: key, Value: value}) - } - - return kubeAnnotations, nil -} - -// updateAnnotations updates annotations with a plugin-specific CDI device -// injection request for the given devices. Upon any error a non-nil error -// is returned and annotations are left intact. By convention plugin should -// be in the format of "vendor.device-type". -func updateAnnotations(annotations map[string]string, plugin string, deviceID string, devices []string) (map[string]string, error) { - key, err := annotationKey(plugin, deviceID) - if err != nil { - return annotations, fmt.Errorf("CDI annotation failed: %v", err) - } - if _, ok := annotations[key]; ok { - return annotations, fmt.Errorf("CDI annotation failed, key %q used", key) - } - value, err := annotationValue(devices) - if err != nil { - return annotations, fmt.Errorf("CDI annotation failed: %v", err) - } - - if annotations == nil { - annotations = make(map[string]string) - } - annotations[key] = value - - return annotations, nil -} - -// annotationKey returns a unique annotation key for an device allocation -// by a K8s device plugin. pluginName should be in the format of -// "vendor.device-type". deviceID is the ID of the device the plugin is -// allocating. It is used to make sure that the generated key is unique -// even if multiple allocations by a single plugin needs to be annotated. -func annotationKey(pluginName, deviceID string) (string, error) { - const maxNameLen = 63 - - if pluginName == "" { - return "", errors.New("invalid plugin name, empty") - } - if deviceID == "" { - return "", errors.New("invalid deviceID, empty") - } - - name := pluginName + "_" + strings.ReplaceAll(deviceID, "/", "_") - - if len(name) > maxNameLen { - return "", fmt.Errorf("invalid plugin+deviceID %q, too long", name) - } - - if c := rune(name[0]); !isAlphaNumeric(c) { - return "", fmt.Errorf("invalid name %q, first '%c' should be alphanumeric", name, c) - } - if len(name) > 2 { - for _, c := range name[1 : len(name)-1] { - switch { - case isAlphaNumeric(c): - case c == '_' || c == '-' || c == '.': - default: - return "", fmt.Errorf("invalid name %q, invalid charcter '%c'", name, c) - } - } - } - if c := rune(name[len(name)-1]); !isAlphaNumeric(c) { - return "", fmt.Errorf("invalid name %q, last '%c' should be alphanumeric", name, c) - } - - return annotationPrefix + name, nil -} - -// annotationValue returns an annotation value for the given devices. -func annotationValue(devices []string) (string, error) { - value, sep := "", "" - for _, d := range devices { - if _, _, _, err := parseQualifiedName(d); err != nil { - return "", err - } - value += sep + d - sep = "," - } - - return value, nil -} - -// parseQualifiedName splits a qualified name into device vendor, class, -// and name. If the device fails to parse as a qualified name, or if any -// of the split components fail to pass syntax validation, vendor and -// class are returned as empty, together with the verbatim input as the -// name and an error describing the reason for failure. -func parseQualifiedName(device string) (string, string, string, error) { - vendor, class, name := parseDevice(device) - - if vendor == "" { - return "", "", device, fmt.Errorf("unqualified device %q, missing vendor", device) - } - if class == "" { - return "", "", device, fmt.Errorf("unqualified device %q, missing class", device) - } - if name == "" { - return "", "", device, fmt.Errorf("unqualified device %q, missing device name", device) - } - - if err := validateVendorName(vendor); err != nil { - return "", "", device, fmt.Errorf("invalid device %q: %v", device, err) - } - if err := validateClassName(class); err != nil { - return "", "", device, fmt.Errorf("invalid device %q: %v", device, err) - } - if err := validateDeviceName(name); err != nil { - return "", "", device, fmt.Errorf("invalid device %q: %v", device, err) - } - - return vendor, class, name, nil -} - -// parseDevice tries to split a device name into vendor, class, and name. -// If this fails, for instance in the case of unqualified device names, -// parseDevice returns an empty vendor and class together with name set -// to the verbatim input. -func parseDevice(device string) (string, string, string) { - if device == "" || device[0] == '/' { - return "", "", device - } - - parts := strings.SplitN(device, "=", 2) - if len(parts) != 2 || parts[0] == "" || parts[1] == "" { - return "", "", device - } - - name := parts[1] - vendor, class := parseQualifier(parts[0]) - if vendor == "" { - return "", "", device - } - - return vendor, class, name -} - -// parseQualifier splits a device qualifier into vendor and class. -// The syntax for a device qualifier is -// -// "/" -// -// If parsing fails, an empty vendor and the class set to the -// verbatim input is returned. -func parseQualifier(kind string) (string, string) { - parts := strings.SplitN(kind, "/", 2) - if len(parts) != 2 || parts[0] == "" || parts[1] == "" { - return "", kind - } - return parts[0], parts[1] -} - -// validateVendorName checks the validity of a vendor name. -// A vendor name may contain the following ASCII characters: -// - upper- and lowercase letters ('A'-'Z', 'a'-'z') -// - digits ('0'-'9') -// - underscore, dash, and dot ('_', '-', and '.') -func validateVendorName(vendor string) error { - if vendor == "" { - return fmt.Errorf("invalid (empty) vendor name") - } - if !isLetter(rune(vendor[0])) { - return fmt.Errorf("invalid vendor %q, should start with letter", vendor) - } - for _, c := range string(vendor[1 : len(vendor)-1]) { - switch { - case isAlphaNumeric(c): - case c == '_' || c == '-' || c == '.': - default: - return fmt.Errorf("invalid character '%c' in vendor name %q", - c, vendor) - } - } - if !isAlphaNumeric(rune(vendor[len(vendor)-1])) { - return fmt.Errorf("invalid vendor %q, should end with a letter or digit", vendor) - } - - return nil -} - -// validateClassName checks the validity of class name. -// A class name may contain the following ASCII characters: -// - upper- and lowercase letters ('A'-'Z', 'a'-'z') -// - digits ('0'-'9') -// - underscore and dash ('_', '-') -func validateClassName(class string) error { - if class == "" { - return fmt.Errorf("invalid (empty) device class") - } - if !isLetter(rune(class[0])) { - return fmt.Errorf("invalid class %q, should start with letter", class) - } - for _, c := range string(class[1 : len(class)-1]) { - switch { - case isAlphaNumeric(c): - case c == '_' || c == '-': - default: - return fmt.Errorf("invalid character '%c' in device class %q", - c, class) - } - } - if !isAlphaNumeric(rune(class[len(class)-1])) { - return fmt.Errorf("invalid class %q, should end with a letter or digit", class) - } - return nil -} - -// validateDeviceName checks the validity of a device name. -// A device name may contain the following ASCII characters: -// - upper- and lowercase letters ('A'-'Z', 'a'-'z') -// - digits ('0'-'9') -// - underscore, dash, dot, colon ('_', '-', '.', ':') -func validateDeviceName(name string) error { - if name == "" { - return fmt.Errorf("invalid (empty) device name") - } - if !isAlphaNumeric(rune(name[0])) { - return fmt.Errorf("invalid class %q, should start with a letter or digit", name) - } - if len(name) == 1 { - return nil - } - for _, c := range string(name[1 : len(name)-1]) { - switch { - case isAlphaNumeric(c): - case c == '_' || c == '-' || c == '.' || c == ':': - default: - return fmt.Errorf("invalid character '%c' in device name %q", - c, name) - } - } - if !isAlphaNumeric(rune(name[len(name)-1])) { - return fmt.Errorf("invalid name %q, should end with a letter or digit", name) - } - return nil -} - -func isLetter(c rune) bool { - return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') -} - -func isDigit(c rune) bool { - return '0' <= c && c <= '9' -} - -func isAlphaNumeric(c rune) bool { - return isLetter(c) || isDigit(c) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_termination_order.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_termination_order.go deleted file mode 100644 index ec417ecd7652..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/kuberuntime/kuberuntime_termination_order.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -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 kuberuntime - -import ( - "time" - - v1 "k8s.io/api/core/v1" - - "k8s.io/kubernetes/pkg/kubelet/types" -) - -// terminationOrdering is used to enforce a termination ordering for sidecar containers. It sets up -// dependencies between sidecars and allows the pod termination process to wait until the grace period -// expires, or all dependent containers have finished terminating. -type terminationOrdering struct { - // terminated is a map from container name to a channel, that if closed - // indicates that the container with that name was terminated - terminated map[string]chan struct{} - // prereqs is a map from container name to a list of channel that the container - // must wait on to ensure termination ordering - prereqs map[string][]chan struct{} -} - -// newTerminationOrdering constructs a terminationOrdering based on the pod spec and the currently running containers. -func newTerminationOrdering(pod *v1.Pod, runningContainerNames []string) *terminationOrdering { - to := &terminationOrdering{ - prereqs: map[string][]chan struct{}{}, - terminated: map[string]chan struct{}{}, - } - - runningContainers := map[string]struct{}{} - for _, name := range runningContainerNames { - runningContainers[name] = struct{}{} - } - - var mainContainerChannels []chan struct{} - // sidecar containers need to wait on main containers, so we create a channel per main container - // for them to wait on - for _, c := range pod.Spec.Containers { - channel := make(chan struct{}) - to.terminated[c.Name] = channel - mainContainerChannels = append(mainContainerChannels, channel) - - // if its not a running container, pre-close the channel so nothing waits on it - if _, isRunning := runningContainers[c.Name]; !isRunning { - close(channel) - } - } - - var previousSidecarName string - for i := range pod.Spec.InitContainers { - // get the init containers in reverse order - ic := pod.Spec.InitContainers[len(pod.Spec.InitContainers)-i-1] - - to.terminated[ic.Name] = make(chan struct{}) - - if types.IsRestartableInitContainer(&ic) { - // sidecars need to wait for all main containers to exit - to.prereqs[ic.Name] = append(to.prereqs[ic.Name], mainContainerChannels...) - - // if there is a later sidecar, this container needs to wait for it to finish - if previousSidecarName != "" { - to.prereqs[ic.Name] = append(to.prereqs[ic.Name], to.terminated[previousSidecarName]) - } - previousSidecarName = ic.Name - } - } - return to -} - -// waitForTurn waits until it is time for the container with the specified name to begin terminating, up until -// the specified grace period. If gracePeriod = 0, there is no wait. -func (o *terminationOrdering) waitForTurn(name string, gracePeriod int64) float64 { - // if there is no grace period, we don't wait - if gracePeriod <= 0 { - return 0 - } - - start := time.Now() - remainingGrace := time.NewTimer(time.Duration(gracePeriod) * time.Second) - - for _, c := range o.prereqs[name] { - select { - case <-c: - case <-remainingGrace.C: - // grace period expired, so immediately exit - return time.Since(start).Seconds() - } - } - - return time.Since(start).Seconds() -} - -// containerTerminated should be called once the container with the speecified name has exited. -func (o *terminationOrdering) containerTerminated(name string) { - if ch, ok := o.terminated[name]; ok { - close(ch) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/cri_stats_provider_linux.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/cri_stats_provider_linux.go deleted file mode 100644 index 9d8a0e479faf..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/stats/cri_stats_provider_linux.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build linux -// +build linux - -/* -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 stats - -import ( - "fmt" - "time" - - cadvisorapiv2 "github.com/google/cadvisor/info/v2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" - statsapi "k8s.io/kubelet/pkg/apis/stats/v1alpha1" -) - -func (p *criStatsProvider) addCRIPodContainerStats(criSandboxStat *runtimeapi.PodSandboxStats, - ps *statsapi.PodStats, fsIDtoInfo map[runtimeapi.FilesystemIdentifier]*cadvisorapiv2.FsInfo, - containerMap map[string]*runtimeapi.Container, - podSandbox *runtimeapi.PodSandbox, - rootFsInfo *cadvisorapiv2.FsInfo, updateCPUNanoCoreUsage bool) error { - for _, criContainerStat := range criSandboxStat.Linux.Containers { - container, found := containerMap[criContainerStat.Attributes.Id] - if !found { - continue - } - // Fill available stats for full set of required pod stats - cs, err := p.makeContainerStats(criContainerStat, container, rootFsInfo, fsIDtoInfo, podSandbox.GetMetadata(), - updateCPUNanoCoreUsage) - if err != nil { - return fmt.Errorf("make container stats: %w", err) - } - ps.Containers = append(ps.Containers, *cs) - } - return nil -} - -func addCRIPodNetworkStats(ps *statsapi.PodStats, criPodStat *runtimeapi.PodSandboxStats) { - if criPodStat == nil || criPodStat.Linux == nil || criPodStat.Linux.Network == nil { - return - } - criNetwork := criPodStat.Linux.Network - iStats := statsapi.NetworkStats{ - Time: metav1.NewTime(time.Unix(0, criNetwork.Timestamp)), - InterfaceStats: criInterfaceToSummary(criNetwork.DefaultInterface), - Interfaces: make([]statsapi.InterfaceStats, 0, len(criNetwork.Interfaces)), - } - for _, iface := range criNetwork.Interfaces { - iStats.Interfaces = append(iStats.Interfaces, criInterfaceToSummary(iface)) - } - ps.Network = &iStats -} - -func addCRIPodMemoryStats(ps *statsapi.PodStats, criPodStat *runtimeapi.PodSandboxStats) { - if criPodStat == nil || criPodStat.Linux == nil || criPodStat.Linux.Memory == nil { - return - } - criMemory := criPodStat.Linux.Memory - ps.Memory = &statsapi.MemoryStats{ - Time: metav1.NewTime(time.Unix(0, criMemory.Timestamp)), - AvailableBytes: valueOfUInt64Value(criMemory.AvailableBytes), - UsageBytes: valueOfUInt64Value(criMemory.UsageBytes), - WorkingSetBytes: valueOfUInt64Value(criMemory.WorkingSetBytes), - RSSBytes: valueOfUInt64Value(criMemory.RssBytes), - PageFaults: valueOfUInt64Value(criMemory.PageFaults), - MajorPageFaults: valueOfUInt64Value(criMemory.MajorPageFaults), - } -} - -func addCRIPodCPUStats(ps *statsapi.PodStats, criPodStat *runtimeapi.PodSandboxStats) { - if criPodStat == nil || criPodStat.Linux == nil || criPodStat.Linux.Cpu == nil { - return - } - criCPU := criPodStat.Linux.Cpu - ps.CPU = &statsapi.CPUStats{ - Time: metav1.NewTime(time.Unix(0, criCPU.Timestamp)), - UsageNanoCores: valueOfUInt64Value(criCPU.UsageNanoCores), - UsageCoreNanoSeconds: valueOfUInt64Value(criCPU.UsageCoreNanoSeconds), - } -} - -func addCRIPodProcessStats(ps *statsapi.PodStats, criPodStat *runtimeapi.PodSandboxStats) { - if criPodStat == nil || criPodStat.Linux == nil || criPodStat.Linux.Process == nil { - return - } - ps.ProcessStats = &statsapi.ProcessStats{ - ProcessCount: valueOfUInt64Value(criPodStat.Linux.Process.ProcessCount), - } -} - -// listContainerNetworkStats returns the network stats of all the running containers. -// It should return (nil, nil) for platforms other than Windows. -func (p *criStatsProvider) listContainerNetworkStats() (map[string]*statsapi.NetworkStats, error) { - return nil, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/util/node_startup_latency_tracker.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/util/node_startup_latency_tracker.go deleted file mode 100644 index 815e4e81eaf9..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubelet/util/node_startup_latency_tracker.go +++ /dev/null @@ -1,103 +0,0 @@ -/* -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 util - -import ( - "sync" - "time" - - "k8s.io/kubernetes/pkg/kubelet/metrics" - "k8s.io/utils/clock" -) - -type NodeStartupLatencyTracker interface { - // This function may be called across Kubelet restart. - RecordAttemptRegisterNode() - // This function should not be called across Kubelet restart. - RecordRegisteredNewNode() - // This function may be called across Kubelet restart. - RecordNodeReady() -} - -type basicNodeStartupLatencyTracker struct { - lock sync.Mutex - - bootTime time.Time - kubeletStartTime time.Time - firstRegistrationAttemptTime time.Time - firstRegisteredNewNodeTime time.Time - firstNodeReadyTime time.Time - - // For testability - clock clock.Clock -} - -func NewNodeStartupLatencyTracker() NodeStartupLatencyTracker { - bootTime, err := GetBootTime() - if err != nil { - bootTime = time.Time{} - } - return &basicNodeStartupLatencyTracker{ - bootTime: bootTime, - kubeletStartTime: time.Now(), - clock: clock.RealClock{}, - } -} - -func (n *basicNodeStartupLatencyTracker) RecordAttemptRegisterNode() { - n.lock.Lock() - defer n.lock.Unlock() - - if !n.firstRegistrationAttemptTime.IsZero() { - return - } - - n.firstRegistrationAttemptTime = n.clock.Now() -} - -func (n *basicNodeStartupLatencyTracker) RecordRegisteredNewNode() { - n.lock.Lock() - defer n.lock.Unlock() - - if n.firstRegistrationAttemptTime.IsZero() || !n.firstRegisteredNewNodeTime.IsZero() { - return - } - - n.firstRegisteredNewNodeTime = n.clock.Now() - - if !n.bootTime.IsZero() { - metrics.NodeStartupPreKubeletDuration.Set(n.kubeletStartTime.Sub(n.bootTime).Seconds()) - } - metrics.NodeStartupPreRegistrationDuration.Set(n.firstRegistrationAttemptTime.Sub(n.kubeletStartTime).Seconds()) - metrics.NodeStartupRegistrationDuration.Set(n.firstRegisteredNewNodeTime.Sub(n.firstRegistrationAttemptTime).Seconds()) -} - -func (n *basicNodeStartupLatencyTracker) RecordNodeReady() { - n.lock.Lock() - defer n.lock.Unlock() - - if n.firstRegisteredNewNodeTime.IsZero() || !n.firstNodeReadyTime.IsZero() { - return - } - - n.firstNodeReadyTime = n.clock.Now() - - metrics.NodeStartupPostRegistrationDuration.Set(n.firstNodeReadyTime.Sub(n.firstRegisteredNewNodeTime).Seconds()) - if !n.bootTime.IsZero() { - metrics.NodeStartupDuration.Set(n.firstNodeReadyTime.Sub(n.bootTime).Seconds()) - } -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/instrumented_plugins.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/instrumented_plugins.go deleted file mode 100644 index ee117c5e625f..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/scheduler/framework/runtime/instrumented_plugins.go +++ /dev/null @@ -1,83 +0,0 @@ -/* -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 runtime - -import ( - "context" - - v1 "k8s.io/api/core/v1" - compbasemetrics "k8s.io/component-base/metrics" - "k8s.io/kubernetes/pkg/scheduler/framework" -) - -type instrumentedFilterPlugin struct { - framework.FilterPlugin - - metric compbasemetrics.CounterMetric -} - -var _ framework.FilterPlugin = &instrumentedFilterPlugin{} - -func (p *instrumentedFilterPlugin) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { - p.metric.Inc() - return p.FilterPlugin.Filter(ctx, state, pod, nodeInfo) -} - -type instrumentedPreFilterPlugin struct { - framework.PreFilterPlugin - - metric compbasemetrics.CounterMetric -} - -var _ framework.PreFilterPlugin = &instrumentedPreFilterPlugin{} - -func (p *instrumentedPreFilterPlugin) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status) { - result, status := p.PreFilterPlugin.PreFilter(ctx, state, pod) - if !status.IsSkip() { - p.metric.Inc() - } - return result, status -} - -type instrumentedPreScorePlugin struct { - framework.PreScorePlugin - - metric compbasemetrics.CounterMetric -} - -var _ framework.PreScorePlugin = &instrumentedPreScorePlugin{} - -func (p *instrumentedPreScorePlugin) PreScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) *framework.Status { - status := p.PreScorePlugin.PreScore(ctx, state, pod, nodes) - if !status.IsSkip() { - p.metric.Inc() - } - return status -} - -type instrumentedScorePlugin struct { - framework.ScorePlugin - - metric compbasemetrics.CounterMetric -} - -var _ framework.ScorePlugin = &instrumentedScorePlugin{} - -func (p *instrumentedScorePlugin) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { - p.metric.Inc() - return p.ScorePlugin.Score(ctx, state, pod, nodeName) -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_unix.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_unix.go deleted file mode 100644 index df887f94508b..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_unix.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build freebsd || linux || darwin -// +build freebsd linux darwin - -/* -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 filesystem - -import ( - "fmt" - "os" -) - -// IsUnixDomainSocket returns whether a given file is a AF_UNIX socket file -func IsUnixDomainSocket(filePath string) (bool, error) { - fi, err := os.Stat(filePath) - if err != nil { - return false, fmt.Errorf("stat file %s failed: %v", filePath, err) - } - if fi.Mode()&os.ModeSocket == 0 { - return false, nil - } - return true, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_windows.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_windows.go deleted file mode 100644 index cd6a11ed3089..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/filesystem/util_windows.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build windows -// +build windows - -/* -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 filesystem - -import ( - "fmt" - "net" - "os" - "time" - - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/klog/v2" -) - -const ( - // Amount of time to wait between attempting to use a Unix domain socket. - // As detailed in https://github.com/kubernetes/kubernetes/issues/104584 - // the first attempt will most likely fail, hence the need to retry - socketDialRetryPeriod = 1 * time.Second - // Overall timeout value to dial a Unix domain socket, including retries - socketDialTimeout = 4 * time.Second -) - -// IsUnixDomainSocket returns whether a given file is a AF_UNIX socket file -// Note that due to the retry logic inside, it could take up to 4 seconds -// to determine whether or not the file path supplied is a Unix domain socket -func IsUnixDomainSocket(filePath string) (bool, error) { - // Due to the absence of golang support for os.ModeSocket in Windows (https://github.com/golang/go/issues/33357) - // we need to dial the file and check if we receive an error to determine if a file is Unix Domain Socket file. - - // Note that querrying for the Reparse Points (https://docs.microsoft.com/en-us/windows/win32/fileio/reparse-points) - // for the file (using FSCTL_GET_REPARSE_POINT) and checking for reparse tag: reparseTagSocket - // does NOT work in 1809 if the socket file is created within a bind mounted directory by a container - // and the FSCTL is issued in the host by the kubelet. - - // If the file does not exist, it cannot be a Unix domain socket. - if _, err := os.Stat(filePath); os.IsNotExist(err) { - return false, fmt.Errorf("File %s not found. Err: %v", filePath, err) - } - - klog.V(6).InfoS("Function IsUnixDomainSocket starts", "filePath", filePath) - // As detailed in https://github.com/kubernetes/kubernetes/issues/104584 we cannot rely - // on the Unix Domain socket working on the very first try, hence the potential need to - // dial multiple times - var lastSocketErr error - err := wait.PollImmediate(socketDialRetryPeriod, socketDialTimeout, - func() (bool, error) { - klog.V(6).InfoS("Dialing the socket", "filePath", filePath) - var c net.Conn - c, lastSocketErr = net.Dial("unix", filePath) - if lastSocketErr == nil { - c.Close() - klog.V(6).InfoS("Socket dialed successfully", "filePath", filePath) - return true, nil - } - klog.V(6).InfoS("Failed the current attempt to dial the socket, so pausing before retry", - "filePath", filePath, "err", lastSocketErr, "socketDialRetryPeriod", - socketDialRetryPeriod) - return false, nil - }) - - // PollImmediate will return "timed out waiting for the condition" if the function it - // invokes never returns true - if err != nil { - klog.V(2).InfoS("Failed all attempts to dial the socket so marking it as a non-Unix Domain socket. Last socket error along with the error from PollImmediate follow", - "filePath", filePath, "lastSocketErr", lastSocketErr, "err", err) - return false, nil - } - return true, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/OWNERS b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/OWNERS deleted file mode 100644 index 9437a5858139..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - sig-network-reviewers - - sig-node-reviewers -approvers: - - sig-network-approvers - - sig-node-approvers diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/constants.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/constants.go deleted file mode 100644 index da512ce3c712..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/constants.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 kernel - -// IPLocalReservedPortsNamespacedKernelVersion is the kernel version in which net.ipv4.ip_local_reserved_ports was namespaced(netns). -// (ref: https://github.com/torvalds/linux/commit/122ff243f5f104194750ecbc76d5946dd1eec934) -const IPLocalReservedPortsNamespacedKernelVersion = "3.16" - -// IPVSConnReuseModeMinSupportedKernelVersion is the minium kernel version supporting net.ipv4.vs.conn_reuse_mode. -// (ref: https://github.com/torvalds/linux/commit/d752c364571743d696c2a54a449ce77550c35ac5) -const IPVSConnReuseModeMinSupportedKernelVersion = "4.1" - -// TCPKeepAliveTimeNamespacedKernelVersion is the kernel version in which net.ipv4.tcp_keepalive_time was namespaced(netns). -// (ref: https://github.com/torvalds/linux/commit/13b287e8d1cad951634389f85b8c9b816bd3bb1e) -const TCPKeepAliveTimeNamespacedKernelVersion = "4.5" - -// TCPKeepAliveIntervalNamespacedKernelVersion is the kernel version in which net.ipv4.tcp_keepalive_intvl was namespaced(netns). -// (ref: https://github.com/torvalds/linux/commit/b840d15d39128d08ed4486085e5507d2617b9ae1) -const TCPKeepAliveIntervalNamespacedKernelVersion = "4.5" - -// TCPKeepAliveProbesNamespacedKernelVersion is the kernel version in which net.ipv4.tcp_keepalive_probes was namespaced(netns). -// (ref: https://github.com/torvalds/linux/commit/9bd6861bd4326e3afd3f14a9ec8a723771fb20bb) -const TCPKeepAliveProbesNamespacedKernelVersion = "4.5" - -// TCPFinTimeoutNamespacedKernelVersion is the kernel version in which net.ipv4.tcp_fin_timeout was namespaced(netns). -// (ref: https://github.com/torvalds/linux/commit/1e579caa18b96f9eb18f4f5416658cd15f37c062) -const TCPFinTimeoutNamespacedKernelVersion = "4.6" - -// IPVSConnReuseModeFixedKernelVersion is the kernel version in which net.ipv4.vs.conn_reuse_mode was fixed. -// (ref: https://github.com/torvalds/linux/commit/35dfb013149f74c2be1ff9c78f14e6a3cd1539d1) -const IPVSConnReuseModeFixedKernelVersion = "5.9" diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/version.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/version.go deleted file mode 100644 index 79f0bf9a5e91..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/util/kernel/version.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -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 kernel - -import ( - "fmt" - "os" - "strings" - - "k8s.io/apimachinery/pkg/util/version" -) - -type readFileFunc func(string) ([]byte, error) - -// GetVersion returns currently running kernel version. -func GetVersion() (*version.Version, error) { - return getVersion(os.ReadFile) -} - -// getVersion reads os release file from the give readFile function. -func getVersion(readFile readFileFunc) (*version.Version, error) { - kernelVersionFile := "/proc/sys/kernel/osrelease" - fileContent, err := readFile(kernelVersionFile) - if err != nil { - return nil, fmt.Errorf("failed to read os-release file: %s", err.Error()) - } - - kernelVersion, err := version.ParseGeneric(strings.TrimSpace(string(fileContent))) - if err != nil { - return nil, fmt.Errorf("failed to parse kernel version: %s", err.Error()) - } - - return kernelVersion, nil -} diff --git a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumeattributesclass.go b/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumeattributesclass.go deleted file mode 100644 index 06d551691f18..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/volume/util/volumeattributesclass.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -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 util - -import ( - "sort" - - storagev1alpha1 "k8s.io/api/storage/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" - storagev1alpha1listers "k8s.io/client-go/listers/storage/v1alpha1" - "k8s.io/klog/v2" -) - -const ( - // AlphaIsDefaultVolumeAttributesClassAnnotation is the alpha version of IsDefaultVolumeAttributesClassAnnotation. - AlphaIsDefaultVolumeAttributesClassAnnotation = "volumeattributesclass.alpha.kubernetes.io/is-default-class" -) - -// GetDefaultVolumeAttributesClass returns the default VolumeAttributesClass from the store, or nil. -func GetDefaultVolumeAttributesClass(lister storagev1alpha1listers.VolumeAttributesClassLister, driverName string) (*storagev1alpha1.VolumeAttributesClass, error) { - list, err := lister.List(labels.Everything()) - if err != nil { - return nil, err - } - - defaultClasses := []*storagev1alpha1.VolumeAttributesClass{} - for _, class := range list { - if IsDefaultVolumeAttributesClassAnnotation(class.ObjectMeta) && class.DriverName == driverName { - defaultClasses = append(defaultClasses, class) - klog.V(4).Infof("GetDefaultVolumeAttributesClass added: %s", class.Name) - } - } - - if len(defaultClasses) == 0 { - return nil, nil - } - - // Primary sort by creation timestamp, newest first - // Secondary sort by class name, ascending order - sort.Slice(defaultClasses, func(i, j int) bool { - if defaultClasses[i].CreationTimestamp.UnixNano() == defaultClasses[j].CreationTimestamp.UnixNano() { - return defaultClasses[i].Name < defaultClasses[j].Name - } - return defaultClasses[i].CreationTimestamp.UnixNano() > defaultClasses[j].CreationTimestamp.UnixNano() - }) - if len(defaultClasses) > 1 { - klog.V(4).Infof("%d default VolumeAttributesClass were found, choosing: %s", len(defaultClasses), defaultClasses[0].Name) - } - - return defaultClasses[0], nil -} - -// IsDefaultVolumeAttributesClassAnnotation returns a boolean if the default -// volume attributes class annotation is set -func IsDefaultVolumeAttributesClassAnnotation(obj metav1.ObjectMeta) bool { - return obj.Annotations[AlphaIsDefaultVolumeAttributesClassAnnotation] == "true" -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/cpuset/OWNERS b/cluster-autoscaler/vendor/k8s.io/utils/cpuset/OWNERS deleted file mode 100644 index 0ec2b0852722..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/cpuset/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - dchen1107 - - derekwaynecarr - - ffromani - - klueska - - SergeyKanzhelev diff --git a/cluster-autoscaler/vendor/k8s.io/utils/cpuset/cpuset.go b/cluster-autoscaler/vendor/k8s.io/utils/cpuset/cpuset.go deleted file mode 100644 index 52912d95bcdc..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/cpuset/cpuset.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 cpuset represents a collection of CPUs in a 'set' data structure. -// -// It can be used to represent core IDs, hyper thread siblings, CPU nodes, or processor IDs. -// -// The only special thing about this package is that -// methods are provided to convert back and forth from Linux 'list' syntax. -// See http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS for details. -// -// Future work can migrate this to use a 'set' library, and relax the dubious 'immutable' property. -// -// This package was originally developed in the 'kubernetes' repository. -package cpuset - -import ( - "bytes" - "fmt" - "reflect" - "sort" - "strconv" - "strings" -) - -// CPUSet is a thread-safe, immutable set-like data structure for CPU IDs. -type CPUSet struct { - elems map[int]struct{} -} - -// New returns a new CPUSet containing the supplied elements. -func New(cpus ...int) CPUSet { - s := CPUSet{ - elems: map[int]struct{}{}, - } - for _, c := range cpus { - s.add(c) - } - return s -} - -// add adds the supplied elements to the CPUSet. -// It is intended for internal use only, since it mutates the CPUSet. -func (s CPUSet) add(elems ...int) { - for _, elem := range elems { - s.elems[elem] = struct{}{} - } -} - -// Size returns the number of elements in this set. -func (s CPUSet) Size() int { - return len(s.elems) -} - -// IsEmpty returns true if there are zero elements in this set. -func (s CPUSet) IsEmpty() bool { - return s.Size() == 0 -} - -// Contains returns true if the supplied element is present in this set. -func (s CPUSet) Contains(cpu int) bool { - _, found := s.elems[cpu] - return found -} - -// Equals returns true if the supplied set contains exactly the same elements -// as this set (s IsSubsetOf s2 and s2 IsSubsetOf s). -func (s CPUSet) Equals(s2 CPUSet) bool { - return reflect.DeepEqual(s.elems, s2.elems) -} - -// filter returns a new CPU set that contains all of the elements from this -// set that match the supplied predicate, without mutating the source set. -func (s CPUSet) filter(predicate func(int) bool) CPUSet { - r := New() - for cpu := range s.elems { - if predicate(cpu) { - r.add(cpu) - } - } - return r -} - -// IsSubsetOf returns true if the supplied set contains all the elements -func (s CPUSet) IsSubsetOf(s2 CPUSet) bool { - result := true - for cpu := range s.elems { - if !s2.Contains(cpu) { - result = false - break - } - } - return result -} - -// Union returns a new CPU set that contains all of the elements from this -// set and all of the elements from the supplied sets, without mutating -// either source set. -func (s CPUSet) Union(s2 ...CPUSet) CPUSet { - r := New() - for cpu := range s.elems { - r.add(cpu) - } - for _, cs := range s2 { - for cpu := range cs.elems { - r.add(cpu) - } - } - return r -} - -// Intersection returns a new CPU set that contains all of the elements -// that are present in both this set and the supplied set, without mutating -// either source set. -func (s CPUSet) Intersection(s2 CPUSet) CPUSet { - return s.filter(func(cpu int) bool { return s2.Contains(cpu) }) -} - -// Difference returns a new CPU set that contains all of the elements that -// are present in this set and not the supplied set, without mutating either -// source set. -func (s CPUSet) Difference(s2 CPUSet) CPUSet { - return s.filter(func(cpu int) bool { return !s2.Contains(cpu) }) -} - -// List returns a slice of integers that contains all elements from -// this set. The list is sorted. -func (s CPUSet) List() []int { - result := s.UnsortedList() - sort.Ints(result) - return result -} - -// UnsortedList returns a slice of integers that contains all elements from -// this set. -func (s CPUSet) UnsortedList() []int { - result := make([]int, 0, len(s.elems)) - for cpu := range s.elems { - result = append(result, cpu) - } - return result -} - -// String returns a new string representation of the elements in this CPU set -// in canonical linux CPU list format. -// -// See: http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS -func (s CPUSet) String() string { - if s.IsEmpty() { - return "" - } - - elems := s.List() - - type rng struct { - start int - end int - } - - ranges := []rng{{elems[0], elems[0]}} - - for i := 1; i < len(elems); i++ { - lastRange := &ranges[len(ranges)-1] - // if this element is adjacent to the high end of the last range - if elems[i] == lastRange.end+1 { - // then extend the last range to include this element - lastRange.end = elems[i] - continue - } - // otherwise, start a new range beginning with this element - ranges = append(ranges, rng{elems[i], elems[i]}) - } - - // construct string from ranges - var result bytes.Buffer - for _, r := range ranges { - if r.start == r.end { - result.WriteString(strconv.Itoa(r.start)) - } else { - result.WriteString(fmt.Sprintf("%d-%d", r.start, r.end)) - } - result.WriteString(",") - } - return strings.TrimRight(result.String(), ",") -} - -// Parse CPUSet constructs a new CPU set from a Linux CPU list formatted string. -// -// See: http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS -func Parse(s string) (CPUSet, error) { - // Handle empty string. - if s == "" { - return New(), nil - } - - result := New() - - // Split CPU list string: - // "0-5,34,46-48" => ["0-5", "34", "46-48"] - ranges := strings.Split(s, ",") - - for _, r := range ranges { - boundaries := strings.SplitN(r, "-", 2) - if len(boundaries) == 1 { - // Handle ranges that consist of only one element like "34". - elem, err := strconv.Atoi(boundaries[0]) - if err != nil { - return New(), err - } - result.add(elem) - } else if len(boundaries) == 2 { - // Handle multi-element ranges like "0-5". - start, err := strconv.Atoi(boundaries[0]) - if err != nil { - return New(), err - } - end, err := strconv.Atoi(boundaries[1]) - if err != nil { - return New(), err - } - if start > end { - return New(), fmt.Errorf("invalid range %q (%d > %d)", r, start, end) - } - // start == end is acceptable (1-1 -> 1) - - // Add all elements to the result. - // e.g. "0-5", "46-48" => [0, 1, 2, 3, 4, 5, 46, 47, 48]. - for e := start; e <= end; e++ { - result.add(e) - } - } - } - return result, nil -} - -// Clone returns a copy of this CPU set. -func (s CPUSet) Clone() CPUSet { - r := New() - for elem := range s.elems { - r.add(elem) - } - return r -} diff --git a/cluster-autoscaler/vendor/k8s.io/utils/ptr/OWNERS b/cluster-autoscaler/vendor/k8s.io/utils/ptr/OWNERS deleted file mode 100644 index 0d6392752af2..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/ptr/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- apelisse -- stewart-yu -- thockin -reviewers: -- apelisse -- stewart-yu -- thockin diff --git a/cluster-autoscaler/vendor/k8s.io/utils/ptr/README.md b/cluster-autoscaler/vendor/k8s.io/utils/ptr/README.md deleted file mode 100644 index 2ca8073dc737..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/ptr/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Pointer - -This package provides some functions for pointer-based operations. diff --git a/cluster-autoscaler/vendor/k8s.io/utils/ptr/ptr.go b/cluster-autoscaler/vendor/k8s.io/utils/ptr/ptr.go deleted file mode 100644 index 659ed3b9e2df..000000000000 --- a/cluster-autoscaler/vendor/k8s.io/utils/ptr/ptr.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -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 ptr - -import ( - "fmt" - "reflect" -) - -// AllPtrFieldsNil tests whether all pointer fields in a struct are nil. This is useful when, -// for example, an API struct is handled by plugins which need to distinguish -// "no plugin accepted this spec" from "this spec is empty". -// -// 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 { - 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.IsNil() { - return true - } - v = v.Elem() - } - for i := 0; i < v.NumField(); i++ { - if v.Field(i).Kind() == reflect.Ptr && !v.Field(i).IsNil() { - return false - } - } - return true -} - -// To returns a pointer to the given value. -func To[T any](v T) *T { - return &v -} - -// Deref dereferences ptr and returns the value it points to if no nil, or else -// returns def. -func Deref[T any](ptr *T, def T) T { - if ptr != nil { - return *ptr - } - return def -} - -// Equal returns true if both arguments are nil or both arguments -// dereference to the same value. -func Equal[T comparable](a, b *T) bool { - if (a == nil) != (b == nil) { - return false - } - if a == nil { - return true - } - return *a == *b -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_interface_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_interface_repo.go deleted file mode 100644 index 0cfee7e96b67..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_interface_repo.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -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 provider - -import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - v1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" -) - -// CreateOrUpdateInterface invokes az.InterfacesClient.CreateOrUpdate with exponential backoff retry -func (az *Cloud) CreateOrUpdateInterface(service *v1.Service, nic network.Interface) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rerr := az.InterfacesClient.CreateOrUpdate(ctx, az.ResourceGroup, *nic.Name, nic) - klog.V(10).Infof("InterfacesClient.CreateOrUpdate(%s): end", *nic.Name) - if rerr != nil { - klog.Errorf("InterfacesClient.CreateOrUpdate(%s) failed: %s", *nic.Name, rerr.Error().Error()) - az.Event(service, v1.EventTypeWarning, "CreateOrUpdateInterface", rerr.Error().Error()) - return rerr.Error() - } - - return nil -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_healthprobe.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_healthprobe.go deleted file mode 100644 index 8664f907a7aa..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_healthprobe.go +++ /dev/null @@ -1,271 +0,0 @@ -/* -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 provider - -import ( - "fmt" - "strconv" - "strings" - - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - v1 "k8s.io/api/core/v1" - "k8s.io/utils/pointer" - - "sigs.k8s.io/cloud-provider-azure/pkg/consts" -) - -// buildHealthProbeRulesForPort -// for following sku: basic loadbalancer vs standard load balancer -// for following protocols: TCP HTTP HTTPS(SLB only) -func (az *Cloud) buildHealthProbeRulesForPort(serviceManifest *v1.Service, port v1.ServicePort, lbrule string) (*network.Probe, error) { - if port.Protocol == v1.ProtocolUDP || port.Protocol == v1.ProtocolSCTP { - return nil, nil - } - // protocol should be tcp, because sctp is handled in outer loop - - properties := &network.ProbePropertiesFormat{} - var err error - - // order - Specific Override - // port_ annotation - // global annotation - - // Select Protocol - // - var protocol *string - - // 1. Look up port-specific override - protocol, err = consts.GetHealthProbeConfigOfPortFromK8sSvcAnnotation(serviceManifest.Annotations, port.Port, consts.HealthProbeParamsProtocol) - if err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.BuildHealthProbeAnnotationKeyForPort(port.Port, consts.HealthProbeParamsProtocol), err) - } - - // 2. If not specified, look up from AppProtocol - // Note - this order is to remain compatible with previous versions - if protocol == nil { - protocol = port.AppProtocol - } - - // 3. If protocol is still nil, check the global annotation - if protocol == nil { - protocol, err = consts.GetAttributeValueInSvcAnnotation(serviceManifest.Annotations, consts.ServiceAnnotationLoadBalancerHealthProbeProtocol) - if err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.ServiceAnnotationLoadBalancerHealthProbeProtocol, err) - } - } - - // 4. Finally, if protocol is still nil, default to TCP - if protocol == nil { - protocol = pointer.String(string(network.ProtocolTCP)) - } - - *protocol = strings.TrimSpace(*protocol) - switch { - case strings.EqualFold(*protocol, string(network.ProtocolTCP)): - properties.Protocol = network.ProbeProtocolTCP - case strings.EqualFold(*protocol, string(network.ProtocolHTTPS)): - //HTTPS probe is only supported in standard loadbalancer - //For backward compatibility,when unsupported protocol is used, fall back to tcp protocol in basic lb mode instead - if !az.useStandardLoadBalancer() { - properties.Protocol = network.ProbeProtocolTCP - } else { - properties.Protocol = network.ProbeProtocolHTTPS - } - case strings.EqualFold(*protocol, string(network.ProtocolHTTP)): - properties.Protocol = network.ProbeProtocolHTTP - default: - //For backward compatibility,when unsupported protocol is used, fall back to tcp protocol in basic lb mode instead - properties.Protocol = network.ProbeProtocolTCP - } - - // Lookup or Override Health Probe Port - properties.Port = &port.NodePort - - probePort, err := consts.GetHealthProbeConfigOfPortFromK8sSvcAnnotation(serviceManifest.Annotations, port.Port, consts.HealthProbeParamsPort, func(s *string) error { - if s == nil { - return nil - } - //not a integer - for _, item := range serviceManifest.Spec.Ports { - if strings.EqualFold(item.Name, *s) { - //found the port - return nil - } - } - //nolint:gosec - port, err := strconv.Atoi(*s) - if err != nil { - return fmt.Errorf("port %s not found in service", *s) - } - if port < 0 || port > 65535 { - return fmt.Errorf("port %d is out of range", port) - } - return nil - }) - if err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.BuildHealthProbeAnnotationKeyForPort(port.Port, consts.HealthProbeParamsPort), err) - } - - if probePort != nil { - //nolint:gosec - port, err := strconv.ParseInt(*probePort, 10, 32) - if err != nil { - //not a integer - for _, item := range serviceManifest.Spec.Ports { - if strings.EqualFold(item.Name, *probePort) { - //found the port - properties.Port = pointer.Int32(item.NodePort) - } - } - } else { - // Not need to verify probePort is in correct range again. - var found bool - for _, item := range serviceManifest.Spec.Ports { - //nolint:gosec - if item.Port == int32(port) { - //found the port - properties.Port = pointer.Int32(item.NodePort) - found = true - break - } - } - if !found { - //nolint:gosec - properties.Port = pointer.Int32(int32(port)) - } - } - } - - // Select request path - if strings.EqualFold(string(properties.Protocol), string(network.ProtocolHTTPS)) || strings.EqualFold(string(properties.Protocol), string(network.ProtocolHTTP)) { - // get request path ,only used with http/https probe - path, err := consts.GetHealthProbeConfigOfPortFromK8sSvcAnnotation(serviceManifest.Annotations, port.Port, consts.HealthProbeParamsRequestPath) - if err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.BuildHealthProbeAnnotationKeyForPort(port.Port, consts.HealthProbeParamsRequestPath), err) - } - if path == nil { - if path, err = consts.GetAttributeValueInSvcAnnotation(serviceManifest.Annotations, consts.ServiceAnnotationLoadBalancerHealthProbeRequestPath); err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.ServiceAnnotationLoadBalancerHealthProbeRequestPath, err) - } - } - if path == nil { - path = pointer.String(consts.HealthProbeDefaultRequestPath) - } - properties.RequestPath = path - } - - properties.IntervalInSeconds, properties.ProbeThreshold, err = az.getHealthProbeConfigProbeIntervalAndNumOfProbe(serviceManifest, port.Port) - if err != nil { - return nil, fmt.Errorf("failed to parse health probe config for port %d: %w", port.Port, err) - } - probe := &network.Probe{ - Name: &lbrule, - ProbePropertiesFormat: properties, - } - return probe, nil -} - -// getHealthProbeConfigProbeIntervalAndNumOfProbe -func (az *Cloud) getHealthProbeConfigProbeIntervalAndNumOfProbe(serviceManifest *v1.Service, port int32) (*int32, *int32, error) { - - numberOfProbes, err := az.getHealthProbeConfigNumOfProbe(serviceManifest, port) - if err != nil { - return nil, nil, err - } - - probeInterval, err := az.getHealthProbeConfigProbeInterval(serviceManifest, port) - if err != nil { - return nil, nil, err - } - // total probe should be less than 120 seconds ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe - if (*probeInterval)*(*numberOfProbes) >= 120 { - return nil, nil, fmt.Errorf("total probe should be less than 120, please adjust interval and number of probe accordingly") - } - return probeInterval, numberOfProbes, nil -} - -// getHealthProbeConfigProbeInterval get probe interval in seconds -// minimum probe interval in seconds is 5. ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe -// if probeInterval is not set, set it to default instead ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe -func (*Cloud) getHealthProbeConfigProbeInterval(serviceManifest *v1.Service, port int32) (*int32, error) { - var probeIntervalValidator = func(val *int32) error { - const ( - MinimumProbeIntervalInSecond = 5 - ) - if *val < 5 { - return fmt.Errorf("the minimum value of %s is %d", consts.HealthProbeParamsProbeInterval, MinimumProbeIntervalInSecond) - } - return nil - } - probeInterval, err := consts.GetInt32HealthProbeConfigOfPortFromK8sSvcAnnotation(serviceManifest.Annotations, port, consts.HealthProbeParamsProbeInterval, probeIntervalValidator) - if err != nil { - return nil, fmt.Errorf("failed to parse annotation %s:%w", consts.BuildHealthProbeAnnotationKeyForPort(port, consts.HealthProbeParamsProbeInterval), err) - } - if probeInterval == nil { - if probeInterval, err = consts.Getint32ValueFromK8sSvcAnnotation(serviceManifest.Annotations, consts.ServiceAnnotationLoadBalancerHealthProbeInterval, probeIntervalValidator); err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.ServiceAnnotationLoadBalancerHealthProbeInterval, err) - } - } - - if probeInterval == nil { - probeInterval = pointer.Int32(consts.HealthProbeDefaultProbeInterval) - } - return probeInterval, nil -} - -// getHealthProbeConfigNumOfProbe get number of probes -// minimum number of unhealthy responses is 2. ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe -// if numberOfProbes is not set, set it to default instead ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe -func (*Cloud) getHealthProbeConfigNumOfProbe(serviceManifest *v1.Service, port int32) (*int32, error) { - var numOfProbeValidator = func(val *int32) error { - const ( - MinimumNumOfProbe = 2 - ) - if *val < MinimumNumOfProbe { - return fmt.Errorf("the minimum value of %s is %d", consts.HealthProbeParamsNumOfProbe, MinimumNumOfProbe) - } - return nil - } - numberOfProbes, err := consts.GetInt32HealthProbeConfigOfPortFromK8sSvcAnnotation(serviceManifest.Annotations, port, consts.HealthProbeParamsNumOfProbe, numOfProbeValidator) - if err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.BuildHealthProbeAnnotationKeyForPort(port, consts.HealthProbeParamsNumOfProbe), err) - } - if numberOfProbes == nil { - if numberOfProbes, err = consts.Getint32ValueFromK8sSvcAnnotation(serviceManifest.Annotations, consts.ServiceAnnotationLoadBalancerHealthProbeNumOfProbe, numOfProbeValidator); err != nil { - return nil, fmt.Errorf("failed to parse annotation %s: %w", consts.ServiceAnnotationLoadBalancerHealthProbeNumOfProbe, err) - } - } - - if numberOfProbes == nil { - numberOfProbes = pointer.Int32(consts.HealthProbeDefaultNumOfProbe) - } - return numberOfProbes, nil -} - -func findProbe(probes []network.Probe, probe network.Probe) bool { - for _, existingProbe := range probes { - if strings.EqualFold(pointer.StringDeref(existingProbe.Name, ""), pointer.StringDeref(probe.Name, "")) && - pointer.Int32Deref(existingProbe.Port, 0) == pointer.Int32Deref(probe.Port, 0) && - strings.EqualFold(string(existingProbe.Protocol), string(probe.Protocol)) && - strings.EqualFold(pointer.StringDeref(existingProbe.RequestPath, ""), pointer.StringDeref(probe.RequestPath, "")) && - pointer.Int32Deref(existingProbe.IntervalInSeconds, 0) == pointer.Int32Deref(probe.IntervalInSeconds, 0) && - pointer.Int32Deref(existingProbe.ProbeThreshold, 0) == pointer.Int32Deref(probe.ProbeThreshold, 0) { - return true - } - } - return false -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_repo.go deleted file mode 100644 index d18d6521a7be..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_repo.go +++ /dev/null @@ -1,389 +0,0 @@ -/* -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 provider - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "strings" - "time" - - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/klog/v2" - "k8s.io/utils/pointer" - - azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" - "sigs.k8s.io/cloud-provider-azure/pkg/consts" - "sigs.k8s.io/cloud-provider-azure/pkg/retry" -) - -// DeleteLB invokes az.LoadBalancerClient.Delete with exponential backoff retry -func (az *Cloud) DeleteLB(service *v1.Service, lbName string) *retry.Error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rgName := az.getLoadBalancerResourceGroup() - rerr := az.LoadBalancerClient.Delete(ctx, rgName, lbName) - if rerr == nil { - // Invalidate the cache right after updating - _ = az.lbCache.Delete(lbName) - return nil - } - - klog.Errorf("LoadBalancerClient.Delete(%s) failed: %s", lbName, rerr.Error().Error()) - az.Event(service, v1.EventTypeWarning, "DeleteLoadBalancer", rerr.Error().Error()) - return rerr -} - -// ListLB invokes az.LoadBalancerClient.List with exponential backoff retry -func (az *Cloud) ListLB(service *v1.Service) ([]network.LoadBalancer, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - - rgName := az.getLoadBalancerResourceGroup() - allLBs, rerr := az.LoadBalancerClient.List(ctx, rgName) - if rerr != nil { - if rerr.IsNotFound() { - return nil, nil - } - az.Event(service, v1.EventTypeWarning, "ListLoadBalancers", rerr.Error().Error()) - klog.Errorf("LoadBalancerClient.List(%v) failure with err=%v", rgName, rerr) - return nil, rerr.Error() - } - klog.V(2).Infof("LoadBalancerClient.List(%v) success", rgName) - return allLBs, nil -} - -// ListManagedLBs invokes az.LoadBalancerClient.List and filter out -// those that are not managed by cloud provider azure or not associated to a managed VMSet. -func (az *Cloud) ListManagedLBs(service *v1.Service, nodes []*v1.Node, clusterName string) (*[]network.LoadBalancer, error) { - allLBs, err := az.ListLB(service) - if err != nil { - return nil, err - } - - if allLBs == nil { - klog.Warningf("ListManagedLBs: no LBs found") - return nil, nil - } - - managedLBNames := sets.New[string](strings.ToLower(clusterName)) - managedLBs := make([]network.LoadBalancer, 0) - if strings.EqualFold(az.LoadBalancerSku, consts.LoadBalancerSkuBasic) { - // return early if wantLb=false - if nodes == nil { - klog.V(4).Infof("ListManagedLBs: return all LBs in the resource group %s, including unmanaged LBs", az.getLoadBalancerResourceGroup()) - return &allLBs, nil - } - - agentPoolVMSetNamesMap := make(map[string]bool) - agentPoolVMSetNames, err := az.VMSet.GetAgentPoolVMSetNames(nodes) - if err != nil { - return nil, fmt.Errorf("ListManagedLBs: failed to get agent pool vmSet names: %w", err) - } - - if agentPoolVMSetNames != nil && len(*agentPoolVMSetNames) > 0 { - for _, vmSetName := range *agentPoolVMSetNames { - klog.V(6).Infof("ListManagedLBs: found agent pool vmSet name %s", vmSetName) - agentPoolVMSetNamesMap[strings.ToLower(vmSetName)] = true - } - } - - for agentPoolVMSetName := range agentPoolVMSetNamesMap { - managedLBNames.Insert(az.mapVMSetNameToLoadBalancerName(agentPoolVMSetName, clusterName)) - } - } - - if az.useMultipleStandardLoadBalancers() { - for _, multiSLBConfig := range az.MultipleStandardLoadBalancerConfigurations { - managedLBNames.Insert(multiSLBConfig.Name, fmt.Sprintf("%s%s", multiSLBConfig.Name, consts.InternalLoadBalancerNameSuffix)) - } - } - - for _, lb := range allLBs { - if managedLBNames.Has(strings.ToLower(strings.TrimSuffix(pointer.StringDeref(lb.Name, ""), consts.InternalLoadBalancerNameSuffix))) { - managedLBs = append(managedLBs, lb) - klog.V(4).Infof("ListManagedLBs: found managed LB %s", pointer.StringDeref(lb.Name, "")) - } - } - - return &managedLBs, nil -} - -// CreateOrUpdateLB invokes az.LoadBalancerClient.CreateOrUpdate with exponential backoff retry -func (az *Cloud) CreateOrUpdateLB(service *v1.Service, lb network.LoadBalancer) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - lb = cleanupSubnetInFrontendIPConfigurations(&lb) - - rgName := az.getLoadBalancerResourceGroup() - rerr := az.LoadBalancerClient.CreateOrUpdate(ctx, rgName, pointer.StringDeref(lb.Name, ""), lb, pointer.StringDeref(lb.Etag, "")) - klog.V(10).Infof("LoadBalancerClient.CreateOrUpdate(%s): end", *lb.Name) - if rerr == nil { - // Invalidate the cache right after updating - _ = az.lbCache.Delete(*lb.Name) - return nil - } - - lbJSON, _ := json.Marshal(lb) - klog.Warningf("LoadBalancerClient.CreateOrUpdate(%s) failed: %v, LoadBalancer request: %s", pointer.StringDeref(lb.Name, ""), rerr.Error(), string(lbJSON)) - - // Invalidate the cache because ETAG precondition mismatch. - if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("LoadBalancer cache for %s is cleanup because of http.StatusPreconditionFailed", pointer.StringDeref(lb.Name, "")) - _ = az.lbCache.Delete(*lb.Name) - } - - retryErrorMessage := rerr.Error().Error() - // Invalidate the cache because another new operation has canceled the current request. - if strings.Contains(strings.ToLower(retryErrorMessage), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("LoadBalancer cache for %s is cleanup because CreateOrUpdate is canceled by another operation", pointer.StringDeref(lb.Name, "")) - _ = az.lbCache.Delete(*lb.Name) - } - - // The LB update may fail because the referenced PIP is not in the Succeeded provisioning state - if strings.Contains(strings.ToLower(retryErrorMessage), strings.ToLower(consts.ReferencedResourceNotProvisionedMessageCode)) { - matches := pipErrorMessageRE.FindStringSubmatch(retryErrorMessage) - if len(matches) != 3 { - klog.Errorf("Failed to parse the retry error message %s", retryErrorMessage) - return rerr.Error() - } - pipRG, pipName := matches[1], matches[2] - klog.V(3).Infof("The public IP %s referenced by load balancer %s is not in Succeeded provisioning state, will try to update it", pipName, pointer.StringDeref(lb.Name, "")) - pip, _, err := az.getPublicIPAddress(pipRG, pipName, azcache.CacheReadTypeDefault) - if err != nil { - klog.Errorf("Failed to get the public IP %s in resource group %s: %v", pipName, pipRG, err) - return rerr.Error() - } - // Perform a dummy update to fix the provisioning state - err = az.CreateOrUpdatePIP(service, pipRG, pip) - if err != nil { - klog.Errorf("Failed to update the public IP %s in resource group %s: %v", pipName, pipRG, err) - return rerr.Error() - } - // Invalidate the LB cache, return the error, and the controller manager - // would retry the LB update in the next reconcile loop - _ = az.lbCache.Delete(*lb.Name) - } - - return rerr.Error() -} - -func (az *Cloud) CreateOrUpdateLBBackendPool(lbName string, backendPool network.BackendAddressPool) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - klog.V(4).Infof("CreateOrUpdateLBBackendPool: updating backend pool %s in LB %s", pointer.StringDeref(backendPool.Name, ""), lbName) - rerr := az.LoadBalancerClient.CreateOrUpdateBackendPools(ctx, az.getLoadBalancerResourceGroup(), lbName, pointer.StringDeref(backendPool.Name, ""), backendPool, pointer.StringDeref(backendPool.Etag, "")) - if rerr == nil { - // Invalidate the cache right after updating - _ = az.lbCache.Delete(lbName) - return nil - } - - // Invalidate the cache because ETAG precondition mismatch. - if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("LoadBalancer cache for %s is cleanup because of http.StatusPreconditionFailed", lbName) - _ = az.lbCache.Delete(lbName) - } - - retryErrorMessage := rerr.Error().Error() - // Invalidate the cache because another new operation has canceled the current request. - if strings.Contains(strings.ToLower(retryErrorMessage), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("LoadBalancer cache for %s is cleanup because CreateOrUpdate is canceled by another operation", lbName) - _ = az.lbCache.Delete(lbName) - } - - return rerr.Error() -} - -func (az *Cloud) DeleteLBBackendPool(lbName, backendPoolName string) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - klog.V(4).Infof("DeleteLBBackendPool: deleting backend pool %s in LB %s", backendPoolName, lbName) - rerr := az.LoadBalancerClient.DeleteLBBackendPool(ctx, az.getLoadBalancerResourceGroup(), lbName, backendPoolName) - if rerr == nil { - // Invalidate the cache right after updating - _ = az.lbCache.Delete(lbName) - return nil - } - - // Invalidate the cache because ETAG precondition mismatch. - if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("LoadBalancer cache for %s is cleanup because of http.StatusPreconditionFailed", lbName) - _ = az.lbCache.Delete(lbName) - } - - retryErrorMessage := rerr.Error().Error() - // Invalidate the cache because another new operation has canceled the current request. - if strings.Contains(strings.ToLower(retryErrorMessage), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("LoadBalancer cache for %s is cleanup because CreateOrUpdate is canceled by another operation", lbName) - _ = az.lbCache.Delete(lbName) - } - - return rerr.Error() -} - -func cleanupSubnetInFrontendIPConfigurations(lb *network.LoadBalancer) network.LoadBalancer { - if lb.LoadBalancerPropertiesFormat == nil || lb.FrontendIPConfigurations == nil { - return *lb - } - - frontendIPConfigurations := *lb.FrontendIPConfigurations - for i := range frontendIPConfigurations { - config := frontendIPConfigurations[i] - if config.FrontendIPConfigurationPropertiesFormat != nil && - config.Subnet != nil && - config.Subnet.ID != nil { - subnet := network.Subnet{ - ID: config.Subnet.ID, - } - if config.Subnet.Name != nil { - subnet.Name = config.FrontendIPConfigurationPropertiesFormat.Subnet.Name - } - config.FrontendIPConfigurationPropertiesFormat.Subnet = &subnet - frontendIPConfigurations[i] = config - continue - } - } - - lb.FrontendIPConfigurations = &frontendIPConfigurations - return *lb -} - -// MigrateToIPBasedBackendPoolAndWaitForCompletion use the migration API to migrate from -// NIC-based to IP-based LB backend pools. It also makes sure the number of IP addresses -// in the backend pools is expected. -func (az *Cloud) MigrateToIPBasedBackendPoolAndWaitForCompletion( - lbName string, backendPoolNames []string, nicsCountMap map[string]int, -) error { - if rerr := az.LoadBalancerClient.MigrateToIPBasedBackendPool(context.Background(), az.ResourceGroup, lbName, backendPoolNames); rerr != nil { - backendPoolNamesStr := strings.Join(backendPoolNames, ",") - klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to migrate to IP based backend pool for lb %s, backend pool %s: %s", lbName, backendPoolNamesStr, rerr.Error().Error()) - return rerr.Error() - } - - succeeded := make(map[string]bool) - for bpName := range nicsCountMap { - succeeded[bpName] = false - } - - err := wait.PollImmediate(5*time.Second, 10*time.Minute, func() (done bool, err error) { - for bpName, nicsCount := range nicsCountMap { - if succeeded[bpName] { - continue - } - - bp, rerr := az.LoadBalancerClient.GetLBBackendPool(context.Background(), az.ResourceGroup, lbName, bpName, "") - if rerr != nil { - klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to get backend pool %s for lb %s: %s", bpName, lbName, rerr.Error().Error()) - return false, rerr.Error() - } - - if countIPsOnBackendPool(bp) != nicsCount { - klog.V(4).Infof("MigrateToIPBasedBackendPoolAndWaitForCompletion: Expected IPs %s, current IPs %d, will retry in 5s", nicsCount, countIPsOnBackendPool(bp)) - return false, nil - } - succeeded[bpName] = true - } - return true, nil - }) - - if err != nil { - if errors.Is(err, wait.ErrWaitTimeout) { - klog.Warningf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Timeout waiting for migration to IP based backend pool for lb %s, backend pool %s", lbName, strings.Join(backendPoolNames, ",")) - return nil - } - - klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to wait for migration to IP based backend pool for lb %s, backend pool %s: %s", lbName, strings.Join(backendPoolNames, ","), err.Error()) - return err - } - - return nil -} - -func (az *Cloud) newLBCache() (azcache.Resource, error) { - getter := func(key string) (interface{}, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - - lb, err := az.LoadBalancerClient.Get(ctx, az.getLoadBalancerResourceGroup(), key, "") - exists, rerr := checkResourceExistsFromError(err) - if rerr != nil { - return nil, rerr.Error() - } - - if !exists { - klog.V(2).Infof("Load balancer %q not found", key) - return nil, nil - } - - return &lb, nil - } - - if az.LoadBalancerCacheTTLInSeconds == 0 { - az.LoadBalancerCacheTTLInSeconds = loadBalancerCacheTTLDefaultInSeconds - } - return azcache.NewTimedCache(time.Duration(az.LoadBalancerCacheTTLInSeconds)*time.Second, getter, az.Config.DisableAPICallCache) -} - -func (az *Cloud) getAzureLoadBalancer(name string, crt azcache.AzureCacheReadType) (lb *network.LoadBalancer, exists bool, err error) { - cachedLB, err := az.lbCache.GetWithDeepCopy(name, crt) - if err != nil { - return lb, false, err - } - - if cachedLB == nil { - return lb, false, nil - } - - return cachedLB.(*network.LoadBalancer), true, nil -} - -// isBackendPoolOnSameLB checks whether newBackendPoolID is on the same load balancer as existingBackendPools. -// Since both public and internal LBs are supported, lbName and lbName-internal are treated as same. -// If not same, the lbName for existingBackendPools would also be returned. -func isBackendPoolOnSameLB(newBackendPoolID string, existingBackendPools []string) (bool, string, error) { - matches := backendPoolIDRE.FindStringSubmatch(newBackendPoolID) - if len(matches) != 2 { - return false, "", fmt.Errorf("new backendPoolID %q is in wrong format", newBackendPoolID) - } - - newLBName := matches[1] - newLBNameTrimmed := strings.TrimSuffix(newLBName, consts.InternalLoadBalancerNameSuffix) - for _, backendPool := range existingBackendPools { - matches := backendPoolIDRE.FindStringSubmatch(backendPool) - if len(matches) != 2 { - return false, "", fmt.Errorf("existing backendPoolID %q is in wrong format", backendPool) - } - - lbName := matches[1] - if !strings.EqualFold(strings.TrimSuffix(lbName, consts.InternalLoadBalancerNameSuffix), newLBNameTrimmed) { - return false, lbName, nil - } - } - - return true, "", nil -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_local_services.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_local_services.go deleted file mode 100644 index 66ff100ed684..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_local_services.go +++ /dev/null @@ -1,546 +0,0 @@ -/* -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 provider - -import ( - "context" - "fmt" - "strings" - "sync" - "time" - - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - - v1 "k8s.io/api/core/v1" - discovery_v1 "k8s.io/api/discovery/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/informers" - "k8s.io/client-go/tools/cache" - "k8s.io/klog/v2" - "k8s.io/utils/pointer" - - "sigs.k8s.io/cloud-provider-azure/pkg/consts" - "sigs.k8s.io/cloud-provider-azure/pkg/retry" -) - -// batchProcessor collects operations in a certain interval and then processes them in batches. -type batchProcessor interface { - // run starts the batchProcessor, and stops if the context exits. - run(ctx context.Context) - - // addOperation adds an operation to the batchProcessor. - addOperation(operation batchOperation) batchOperation - - // removeOperation removes all operations targeting to the specified service. - removeOperation(name string) -} - -// batchOperation is an operation that can be added to a batchProcessor. -type batchOperation interface { - wait() batchOperationResult -} - -// loadBalancerBackendPoolUpdateOperation is an operation that updates the backend pool of a load balancer. -type loadBalancerBackendPoolUpdateOperation struct { - serviceName string - loadBalancerName string - backendPoolName string - kind consts.LoadBalancerBackendPoolUpdateOperation - nodeIPs []string -} - -func (op *loadBalancerBackendPoolUpdateOperation) wait() batchOperationResult { - return batchOperationResult{} -} - -// loadBalancerBackendPoolUpdater is a batchProcessor that updates the backend pool of a load balancer. -type loadBalancerBackendPoolUpdater struct { - az *Cloud - interval time.Duration - lock sync.Mutex - operations []batchOperation -} - -// newLoadBalancerBackendPoolUpdater creates a new loadBalancerBackendPoolUpdater. -func newLoadBalancerBackendPoolUpdater(az *Cloud, interval time.Duration) *loadBalancerBackendPoolUpdater { - return &loadBalancerBackendPoolUpdater{ - az: az, - interval: interval, - operations: make([]batchOperation, 0), - } -} - -// run starts the loadBalancerBackendPoolUpdater, and stops if the context exits. -func (updater *loadBalancerBackendPoolUpdater) run(ctx context.Context) { - klog.V(2).Info("loadBalancerBackendPoolUpdater.run: started") - err := wait.PollUntilContextCancel(ctx, updater.interval, false, func(ctx context.Context) (bool, error) { - updater.process() - return false, nil - }) - klog.Infof("loadBalancerBackendPoolUpdater.run: stopped due to %s", err.Error()) -} - -// getAddIPsToBackendPoolOperation creates a new loadBalancerBackendPoolUpdateOperation -// that adds nodeIPs to the backend pool. -func getAddIPsToBackendPoolOperation(serviceName, loadBalancerName, backendPoolName string, nodeIPs []string) *loadBalancerBackendPoolUpdateOperation { - return &loadBalancerBackendPoolUpdateOperation{ - serviceName: serviceName, - loadBalancerName: loadBalancerName, - backendPoolName: backendPoolName, - kind: consts.LoadBalancerBackendPoolUpdateOperationAdd, - nodeIPs: nodeIPs, - } -} - -// getRemoveIPsFromBackendPoolOperation creates a new loadBalancerBackendPoolUpdateOperation -// that removes nodeIPs from the backend pool. -func getRemoveIPsFromBackendPoolOperation(serviceName, loadBalancerName, backendPoolName string, nodeIPs []string) *loadBalancerBackendPoolUpdateOperation { - return &loadBalancerBackendPoolUpdateOperation{ - serviceName: serviceName, - loadBalancerName: loadBalancerName, - backendPoolName: backendPoolName, - kind: consts.LoadBalancerBackendPoolUpdateOperationRemove, - nodeIPs: nodeIPs, - } -} - -// addOperation adds an operation to the loadBalancerBackendPoolUpdater. -func (updater *loadBalancerBackendPoolUpdater) addOperation(operation batchOperation) batchOperation { - updater.lock.Lock() - defer updater.lock.Unlock() - - op := operation.(*loadBalancerBackendPoolUpdateOperation) - klog.V(4).InfoS("loadBalancerBackendPoolUpdater.addOperation", - "kind", op.kind, - "service name", op.serviceName, - "load balancer name", op.loadBalancerName, - "backend pool name", op.backendPoolName, - "node IPs", strings.Join(op.nodeIPs, ",")) - updater.operations = append(updater.operations, operation) - return operation -} - -// removeOperation removes all operations targeting to the specified service. -func (updater *loadBalancerBackendPoolUpdater) removeOperation(serviceName string) { - updater.lock.Lock() - defer updater.lock.Unlock() - - for i := len(updater.operations) - 1; i >= 0; i-- { - op := updater.operations[i].(*loadBalancerBackendPoolUpdateOperation) - if strings.EqualFold(op.serviceName, serviceName) { - klog.V(4).InfoS("loadBalancerBackendPoolUpdater.removeOperation", - "kind", op.kind, - "service name", op.serviceName, - "load balancer name", op.loadBalancerName, - "backend pool name", op.backendPoolName, - "node IPs", strings.Join(op.nodeIPs, ",")) - updater.operations = append(updater.operations[:i], updater.operations[i+1:]...) - } - } -} - -// process processes all operations in the loadBalancerBackendPoolUpdater. -// It merges operations that have the same loadBalancerName and backendPoolName, -// and then processes them in batches. If an operation fails, it will be retried -// if it is retriable, otherwise all operations in the batch targeting to -// this backend pool will fail. -func (updater *loadBalancerBackendPoolUpdater) process() { - updater.lock.Lock() - defer updater.lock.Unlock() - - if len(updater.operations) == 0 { - klog.V(4).Infof("loadBalancerBackendPoolUpdater.process: no operations to process") - return - } - - // Group operations by loadBalancerName:backendPoolName - groups := make(map[string][]batchOperation) - for _, op := range updater.operations { - lbOp := op.(*loadBalancerBackendPoolUpdateOperation) - si, found := updater.az.getLocalServiceInfo(strings.ToLower(lbOp.serviceName)) - if !found { - klog.V(4).Infof("loadBalancerBackendPoolUpdater.process: service %s is not a local service, skip the operation", lbOp.serviceName) - continue - } - if !strings.EqualFold(si.lbName, lbOp.loadBalancerName) { - klog.V(4).InfoS("loadBalancerBackendPoolUpdater.process: service is not associated with the load balancer, skip the operation", - "service", lbOp.serviceName, - "previous load balancer", lbOp.loadBalancerName, - "current load balancer", si.lbName) - continue - } - - key := fmt.Sprintf("%s:%s", lbOp.loadBalancerName, lbOp.backendPoolName) - groups[key] = append(groups[key], op) - } - - // Clear all jobs. - updater.operations = make([]batchOperation, 0) - - for key, ops := range groups { - parts := strings.Split(key, ":") - lbName, poolName := parts[0], parts[1] - operationName := fmt.Sprintf("%s/%s", lbName, poolName) - bp, rerr := updater.az.LoadBalancerClient.GetLBBackendPool(context.Background(), updater.az.ResourceGroup, lbName, poolName, "") - if rerr != nil { - updater.processError(rerr, operationName, ops...) - continue - } - - var changed bool - for _, op := range ops { - lbOp := op.(*loadBalancerBackendPoolUpdateOperation) - switch lbOp.kind { - case consts.LoadBalancerBackendPoolUpdateOperationRemove: - removed := removeNodeIPAddressesFromBackendPool(bp, lbOp.nodeIPs, false, true) - changed = changed || removed - case consts.LoadBalancerBackendPoolUpdateOperationAdd: - added := updater.az.addNodeIPAddressesToBackendPool(&bp, lbOp.nodeIPs) - changed = changed || added - default: - panic("loadBalancerBackendPoolUpdater.process: unknown operation type") - } - } - // To keep the code clean, ignore the case when `changed` is true - // but the backend pool object is not changed after multiple times of removal and re-adding. - if changed { - klog.V(2).Infof("loadBalancerBackendPoolUpdater.process: updating backend pool %s/%s", lbName, poolName) - rerr = updater.az.LoadBalancerClient.CreateOrUpdateBackendPools(context.Background(), updater.az.ResourceGroup, lbName, poolName, bp, pointer.StringDeref(bp.Etag, "")) - if rerr != nil { - updater.processError(rerr, operationName, ops...) - continue - } - } - updater.notify(newBatchOperationResult(operationName, true, nil), ops...) - } -} - -// processError mark the operations as retriable if the error is retriable, -// and fail all operations if the error is not retriable. -func (updater *loadBalancerBackendPoolUpdater) processError( - rerr *retry.Error, - operationName string, - operations ...batchOperation, -) { - if rerr.IsNotFound() { - klog.V(4).Infof("backend pool not found for operation %s, skip updating", operationName) - return - } - - if rerr.Retriable { - // Retry if retriable. - updater.operations = append(updater.operations, operations...) - } else { - // Fail all operations if not retriable. - updater.notify(newBatchOperationResult(operationName, false, rerr.Error()), operations...) - } -} - -// notify notifies the operations with the result. -func (updater *loadBalancerBackendPoolUpdater) notify(res batchOperationResult, operations ...batchOperation) { - for _, op := range operations { - updater.az.processBatchOperationResult(op, res) - break - } -} - -// batchOperationResult is the result of a batch operation. -type batchOperationResult struct { - name string - success bool - err error -} - -// newBatchOperationResult creates a new batchOperationResult. -func newBatchOperationResult(name string, success bool, err error) batchOperationResult { - return batchOperationResult{ - name: name, - success: success, - err: err, - } -} - -func (az *Cloud) getLocalServiceInfo(serviceName string) (*serviceInfo, bool) { - data, ok := az.localServiceNameToServiceInfoMap.Load(serviceName) - if !ok { - return &serviceInfo{}, false - } - return data.(*serviceInfo), true -} - -// setUpEndpointSlicesInformer creates an informer for EndpointSlices of local services. -// It watches the update events and send backend pool update operations to the batch updater. -// TODO (niqi): the update of endpointslice may be slower than tue update of endpoint pods. Need to fix this. -func (az *Cloud) setUpEndpointSlicesInformer(informerFactory informers.SharedInformerFactory) { - endpointSlicesInformer := informerFactory.Discovery().V1().EndpointSlices().Informer() - _, _ = endpointSlicesInformer.AddEventHandler( - cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj interface{}) { - es := obj.(*discovery_v1.EndpointSlice) - az.endpointSlicesCache.Store(strings.ToLower(fmt.Sprintf("%s/%s", es.Namespace, es.Name)), es) - }, - UpdateFunc: func(oldObj, newObj interface{}) { - previousES := oldObj.(*discovery_v1.EndpointSlice) - newES := newObj.(*discovery_v1.EndpointSlice) - - svcName := getServiceNameOfEndpointSlice(newES) - if svcName == "" { - klog.V(4).Infof("EndpointSlice %s/%s does not have service name label, skip updating load balancer backend pool", newES.Namespace, newES.Name) - return - } - - klog.V(4).Infof("Detecting EndpointSlice %s/%s update", newES.Namespace, newES.Name) - az.endpointSlicesCache.Store(strings.ToLower(fmt.Sprintf("%s/%s", newES.Namespace, newES.Name)), newES) - - key := strings.ToLower(fmt.Sprintf("%s/%s", newES.Namespace, svcName)) - si, found := az.getLocalServiceInfo(key) - if !found { - klog.V(4).Infof("EndpointSlice %s/%s belongs to service %s, but the service is not a local service, skip updating load balancer backend pool", key, newES.Namespace, newES.Name) - return - } - lbName, ipFamily := si.lbName, si.ipFamily - - var previousIPs, currentIPs, previousNodeNames, currentNodeNames []string - if previousES != nil { - for _, ep := range previousES.Endpoints { - previousNodeNames = append(previousNodeNames, pointer.StringDeref(ep.NodeName, "")) - } - } - if newES != nil { - for _, ep := range newES.Endpoints { - currentNodeNames = append(currentNodeNames, pointer.StringDeref(ep.NodeName, "")) - } - } - for _, previousNodeName := range previousNodeNames { - nodeIPsSet := az.nodePrivateIPs[previousNodeName] - previousIPs = append(previousIPs, setToStrings(nodeIPsSet)...) - } - for _, currentNodeName := range currentNodeNames { - nodeIPsSet := az.nodePrivateIPs[currentNodeName] - currentIPs = append(currentIPs, setToStrings(nodeIPsSet)...) - } - ipsToBeDeleted := compareNodeIPs(previousIPs, currentIPs) - if len(ipsToBeDeleted) == 0 && len(previousIPs) == len(currentIPs) { - klog.V(4).Infof("No IP change detected for EndpointSlice %s/%s, skip updating load balancer backend pool", newES.Namespace, newES.Name) - return - } - - if az.backendPoolUpdater != nil { - var bpNames []string - bpNameIPv4 := getLocalServiceBackendPoolName(key, false) - bpNameIPv6 := getLocalServiceBackendPoolName(key, true) - switch strings.ToLower(ipFamily) { - case strings.ToLower(consts.IPVersionIPv4String): - bpNames = append(bpNames, bpNameIPv4) - case strings.ToLower(consts.IPVersionIPv6String): - bpNames = append(bpNames, bpNameIPv6) - default: - bpNames = append(bpNames, bpNameIPv4, bpNameIPv6) - } - for _, bpName := range bpNames { - if len(ipsToBeDeleted) > 0 { - az.backendPoolUpdater.addOperation(getRemoveIPsFromBackendPoolOperation(key, lbName, bpName, ipsToBeDeleted)) - } - if len(currentIPs) > 0 { - az.backendPoolUpdater.addOperation(getAddIPsToBackendPoolOperation(key, lbName, bpName, currentIPs)) - } - } - } - }, - DeleteFunc: func(obj interface{}) { - es := obj.(*discovery_v1.EndpointSlice) - az.endpointSlicesCache.Delete(strings.ToLower(fmt.Sprintf("%s/%s", es.Namespace, es.Name))) - }, - }) -} - -func (az *Cloud) processBatchOperationResult(op batchOperation, res batchOperationResult) { - lbOp := op.(*loadBalancerBackendPoolUpdateOperation) - var svc *v1.Service - svc, _, _ = az.getLatestService(lbOp.serviceName, false) - if svc == nil { - klog.Warningf("Service %s not found, skip sending event", lbOp.serviceName) - return - } - if !res.success { - var errStr string - if res.err != nil { - errStr = res.err.Error() - } - az.Event(svc, v1.EventTypeWarning, "LoadBalancerBackendPoolUpdateFailed", errStr) - } else { - az.Event(svc, v1.EventTypeNormal, "LoadBalancerBackendPoolUpdated", "Load balancer backend pool updated successfully") - } -} - -// getServiceNameOfEndpointSlice gets the service name of an EndpointSlice. -func getServiceNameOfEndpointSlice(es *discovery_v1.EndpointSlice) string { - if es.Labels != nil { - return es.Labels[consts.ServiceNameLabel] - } - return "" -} - -// compareNodeIPs compares the previous and current node IPs and returns the IPs to be deleted. -func compareNodeIPs(previousIPs, currentIPs []string) []string { - previousIPSet := sets.NewString(previousIPs...) - currentIPSet := sets.NewString(currentIPs...) - return previousIPSet.Difference(currentIPSet).List() -} - -// getLocalServiceBackendPoolName gets the name of the backend pool of a local service. -func getLocalServiceBackendPoolName(serviceName string, ipv6 bool) string { - serviceName = strings.ToLower(strings.Replace(serviceName, "/", "-", -1)) - if ipv6 { - return fmt.Sprintf("%s-ipv6", serviceName) - } - return serviceName -} - -// getBackendPoolNameForService determine the expected backend pool name -// by checking the external traffic policy of the service. -func (az *Cloud) getBackendPoolNameForService(service *v1.Service, clusterName string, ipv6 bool) string { - if !isLocalService(service) || !az.useMultipleStandardLoadBalancers() { - return getBackendPoolName(clusterName, ipv6) - } - return getLocalServiceBackendPoolName(getServiceName(service), ipv6) -} - -// getBackendPoolNamesForService determine the expected backend pool names -// by checking the external traffic policy of the service. -func (az *Cloud) getBackendPoolNamesForService(service *v1.Service, clusterName string) map[bool]string { - if !isLocalService(service) || !az.useMultipleStandardLoadBalancers() { - return getBackendPoolNames(clusterName) - } - return map[bool]string{ - consts.IPVersionIPv4: getLocalServiceBackendPoolName(getServiceName(service), false), - consts.IPVersionIPv6: getLocalServiceBackendPoolName(getServiceName(service), true), - } -} - -// getBackendPoolIDsForService determine the expected backend pool IDs -// by checking the external traffic policy of the service. -func (az *Cloud) getBackendPoolIDsForService(service *v1.Service, clusterName, lbName string) map[bool]string { - if !isLocalService(service) || !az.useMultipleStandardLoadBalancers() { - return az.getBackendPoolIDs(clusterName, lbName) - } - return map[bool]string{ - consts.IPVersionIPv4: az.getLocalServiceBackendPoolID(getServiceName(service), lbName, false), - consts.IPVersionIPv6: az.getLocalServiceBackendPoolID(getServiceName(service), lbName, true), - } -} - -// getLocalServiceBackendPoolID gets the ID of the backend pool of a local service. -func (az *Cloud) getLocalServiceBackendPoolID(serviceName string, lbName string, ipv6 bool) string { - return az.getBackendPoolID(lbName, getLocalServiceBackendPoolName(serviceName, ipv6)) -} - -// localServiceOwnsBackendPool checks if a backend pool is owned by a local service. -func localServiceOwnsBackendPool(serviceName, bpName string) bool { - prefix := strings.Replace(serviceName, "/", "-", -1) - return strings.HasPrefix(strings.ToLower(bpName), strings.ToLower(prefix)) -} - -type serviceInfo struct { - ipFamily string - lbName string -} - -func newServiceInfo(ipFamily, lbName string) *serviceInfo { - return &serviceInfo{ - ipFamily: ipFamily, - lbName: lbName, - } -} - -// getLocalServiceEndpointsNodeNames gets the node names that host all endpoints of the local service. -func (az *Cloud) getLocalServiceEndpointsNodeNames(service *v1.Service) (sets.Set[string], error) { - var ep *discovery_v1.EndpointSlice - az.endpointSlicesCache.Range(func(key, value interface{}) bool { - endpointSlice := value.(*discovery_v1.EndpointSlice) - if strings.EqualFold(getServiceNameOfEndpointSlice(endpointSlice), service.Name) && - strings.EqualFold(endpointSlice.Namespace, service.Namespace) { - ep = endpointSlice - return false - } - return true - }) - if ep == nil { - klog.Infof("EndpointSlice for service %s/%s not found, try to list EndpointSlices", service.Namespace, service.Name) - eps, err := az.KubeClient.DiscoveryV1().EndpointSlices(service.Namespace).List(context.Background(), metav1.ListOptions{}) - if err != nil { - klog.Errorf("Failed to list EndpointSlices for service %s/%s: %s", service.Namespace, service.Name, err.Error()) - return nil, err - } - for _, endpointSlice := range eps.Items { - endpointSlice := endpointSlice - if strings.EqualFold(getServiceNameOfEndpointSlice(&endpointSlice), service.Name) { - ep = &endpointSlice - break - } - } - } - if ep == nil { - return nil, fmt.Errorf("failed to find EndpointSlice for service %s/%s", service.Namespace, service.Name) - } - - var nodeNames []string - for _, endpoint := range ep.Endpoints { - klog.V(4).Infof("EndpointSlice %s/%s has endpoint %s on node %s", ep.Namespace, ep.Name, endpoint.Addresses, pointer.StringDeref(endpoint.NodeName, "")) - nodeNames = append(nodeNames, pointer.StringDeref(endpoint.NodeName, "")) - } - - return sets.New[string](nodeNames...), nil -} - -// cleanupLocalServiceBackendPool cleans up the backend pool of -// a local service among given load balancers. -func (az *Cloud) cleanupLocalServiceBackendPool( - svc *v1.Service, - nodes []*v1.Node, - lbs *[]network.LoadBalancer, - clusterName string, -) (newLBs *[]network.LoadBalancer, err error) { - var changed bool - if lbs != nil { - for _, lb := range *lbs { - lbName := pointer.StringDeref(lb.Name, "") - if lb.BackendAddressPools != nil { - for _, bp := range *lb.BackendAddressPools { - bpName := pointer.StringDeref(bp.Name, "") - if localServiceOwnsBackendPool(getServiceName(svc), bpName) { - if err := az.DeleteLBBackendPool(lbName, bpName); err != nil { - return nil, err - } - changed = true - } - } - } - } - } - if changed { - // Refresh the list of existing LBs after cleanup to update etags for the LBs. - klog.V(4).Info("Refreshing the list of existing LBs") - lbs, err = az.ListManagedLBs(svc, nodes, clusterName) - if err != nil { - return nil, fmt.Errorf("reconcileLoadBalancer: failed to list managed LB: %w", err) - } - } - return lbs, nil -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice_repo.go deleted file mode 100644 index ae43681f0ead..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice_repo.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -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 provider - -import ( - "encoding/json" - "net/http" - "strings" - "time" - - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - v1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" - "k8s.io/utils/pointer" - - azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" - "sigs.k8s.io/cloud-provider-azure/pkg/consts" - "sigs.k8s.io/cloud-provider-azure/pkg/retry" -) - -func (az *Cloud) CreateOrUpdatePLS(service *v1.Service, pls network.PrivateLinkService) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rerr := az.PrivateLinkServiceClient.CreateOrUpdate(ctx, az.PrivateLinkServiceResourceGroup, pointer.StringDeref(pls.Name, ""), pls, pointer.StringDeref(pls.Etag, "")) - if rerr == nil { - // Invalidate the cache right after updating - _ = az.plsCache.Delete(pointer.StringDeref((*pls.LoadBalancerFrontendIPConfigurations)[0].ID, "")) - return nil - } - - rtJSON, _ := json.Marshal(pls) - klog.Warningf("PrivateLinkServiceClient.CreateOrUpdate(%s) failed: %v, PrivateLinkService request: %s", pointer.StringDeref(pls.Name, ""), rerr.Error(), string(rtJSON)) - - // Invalidate the cache because etag mismatch. - if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("Private link service cache for %s is cleanup because of http.StatusPreconditionFailed", pointer.StringDeref(pls.Name, "")) - _ = az.plsCache.Delete(pointer.StringDeref((*pls.LoadBalancerFrontendIPConfigurations)[0].ID, "")) - } - // Invalidate the cache because another new operation has canceled the current request. - if strings.Contains(strings.ToLower(rerr.Error().Error()), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("Private link service for %s is cleanup because CreateOrUpdatePrivateLinkService is canceled by another operation", pointer.StringDeref(pls.Name, "")) - _ = az.plsCache.Delete(pointer.StringDeref((*pls.LoadBalancerFrontendIPConfigurations)[0].ID, "")) - } - klog.Errorf("PrivateLinkServiceClient.CreateOrUpdate(%s) failed: %v", pointer.StringDeref(pls.Name, ""), rerr.Error()) - return rerr.Error() -} - -// DeletePLS invokes az.PrivateLinkServiceClient.Delete with exponential backoff retry -func (az *Cloud) DeletePLS(service *v1.Service, plsName string, plsLBFrontendID string) *retry.Error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rerr := az.PrivateLinkServiceClient.Delete(ctx, az.PrivateLinkServiceResourceGroup, plsName) - if rerr == nil { - // Invalidate the cache right after deleting - _ = az.plsCache.Delete(plsLBFrontendID) - return nil - } - - klog.Errorf("PrivateLinkServiceClient.DeletePLS(%s) failed: %s", plsName, rerr.Error().Error()) - az.Event(service, v1.EventTypeWarning, "DeletePrivateLinkService", rerr.Error().Error()) - return rerr -} - -// DeletePEConn invokes az.PrivateLinkServiceClient.DeletePEConnection with exponential backoff retry -func (az *Cloud) DeletePEConn(service *v1.Service, plsName string, peConnName string) *retry.Error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rerr := az.PrivateLinkServiceClient.DeletePEConnection(ctx, az.PrivateLinkServiceResourceGroup, plsName, peConnName) - if rerr == nil { - return nil - } - - klog.Errorf("PrivateLinkServiceClient.DeletePEConnection(%s-%s) failed: %s", plsName, peConnName, rerr.Error().Error()) - az.Event(service, v1.EventTypeWarning, "DeletePrivateEndpointConnection", rerr.Error().Error()) - return rerr -} - -func (az *Cloud) newPLSCache() (azcache.Resource, error) { - // for PLS cache, key is LBFrontendIPConfiguration ID - getter := func(key string) (interface{}, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - plsList, err := az.PrivateLinkServiceClient.List(ctx, az.PrivateLinkServiceResourceGroup) - exists, rerr := checkResourceExistsFromError(err) - if rerr != nil { - return nil, rerr.Error() - } - - if exists { - for i := range plsList { - pls := plsList[i] - if pls.PrivateLinkServiceProperties == nil { - continue - } - fipConfigs := pls.PrivateLinkServiceProperties.LoadBalancerFrontendIPConfigurations - if fipConfigs == nil { - continue - } - for _, fipConfig := range *fipConfigs { - if strings.EqualFold(*fipConfig.ID, key) { - return &pls, nil - } - } - - } - } - - klog.V(2).Infof("No privateLinkService found for frontendIPConfig %q", key) - plsNotExistID := consts.PrivateLinkServiceNotExistID - return &network.PrivateLinkService{ID: &plsNotExistID}, nil - } - - if az.PlsCacheTTLInSeconds == 0 { - az.PlsCacheTTLInSeconds = plsCacheTTLDefaultInSeconds - } - return azcache.NewTimedCache(time.Duration(az.PlsCacheTTLInSeconds)*time.Second, getter, az.Config.DisableAPICallCache) -} - -func (az *Cloud) getPrivateLinkService(frontendIPConfigID *string, crt azcache.AzureCacheReadType) (pls network.PrivateLinkService, err error) { - cachedPLS, err := az.plsCache.GetWithDeepCopy(*frontendIPConfigID, crt) - if err != nil { - return pls, err - } - return *(cachedPLS.(*network.PrivateLinkService)), nil -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_publicip_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_publicip_repo.go deleted file mode 100644 index 2ace3b9925a0..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_publicip_repo.go +++ /dev/null @@ -1,227 +0,0 @@ -/* -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 provider - -import ( - "encoding/json" - "fmt" - "net/http" - "strings" - "sync" - "time" - - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - - v1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" - "k8s.io/utils/pointer" - - azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" - "sigs.k8s.io/cloud-provider-azure/pkg/consts" - "sigs.k8s.io/cloud-provider-azure/pkg/util/deepcopy" -) - -// CreateOrUpdatePIP invokes az.PublicIPAddressesClient.CreateOrUpdate with exponential backoff retry -func (az *Cloud) CreateOrUpdatePIP(service *v1.Service, pipResourceGroup string, pip network.PublicIPAddress) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rerr := az.PublicIPAddressesClient.CreateOrUpdate(ctx, pipResourceGroup, pointer.StringDeref(pip.Name, ""), pip) - klog.V(10).Infof("PublicIPAddressesClient.CreateOrUpdate(%s, %s): end", pipResourceGroup, pointer.StringDeref(pip.Name, "")) - if rerr == nil { - // Invalidate the cache right after updating - _ = az.pipCache.Delete(pipResourceGroup) - return nil - } - - pipJSON, _ := json.Marshal(pip) - klog.Warningf("PublicIPAddressesClient.CreateOrUpdate(%s, %s) failed: %s, PublicIP request: %s", pipResourceGroup, pointer.StringDeref(pip.Name, ""), rerr.Error().Error(), string(pipJSON)) - az.Event(service, v1.EventTypeWarning, "CreateOrUpdatePublicIPAddress", rerr.Error().Error()) - - // Invalidate the cache because ETAG precondition mismatch. - if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("PublicIP cache for (%s, %s) is cleanup because of http.StatusPreconditionFailed", pipResourceGroup, pointer.StringDeref(pip.Name, "")) - _ = az.pipCache.Delete(pipResourceGroup) - } - - retryErrorMessage := rerr.Error().Error() - // Invalidate the cache because another new operation has canceled the current request. - if strings.Contains(strings.ToLower(retryErrorMessage), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("PublicIP cache for (%s, %s) is cleanup because CreateOrUpdate is canceled by another operation", pipResourceGroup, pointer.StringDeref(pip.Name, "")) - _ = az.pipCache.Delete(pipResourceGroup) - } - - return rerr.Error() -} - -// DeletePublicIP invokes az.PublicIPAddressesClient.Delete with exponential backoff retry -func (az *Cloud) DeletePublicIP(service *v1.Service, pipResourceGroup string, pipName string) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rerr := az.PublicIPAddressesClient.Delete(ctx, pipResourceGroup, pipName) - if rerr != nil { - klog.Errorf("PublicIPAddressesClient.Delete(%s) failed: %s", pipName, rerr.Error().Error()) - az.Event(service, v1.EventTypeWarning, "DeletePublicIPAddress", rerr.Error().Error()) - - if strings.Contains(rerr.Error().Error(), consts.CannotDeletePublicIPErrorMessageCode) { - klog.Warningf("DeletePublicIP for public IP %s failed with error %v, this is because other resources are referencing the public IP. The deletion of the service will continue.", pipName, rerr.Error()) - return nil - } - return rerr.Error() - } - - // Invalidate the cache right after deleting - _ = az.pipCache.Delete(pipResourceGroup) - return nil -} - -func (az *Cloud) newPIPCache() (azcache.Resource, error) { - getter := func(key string) (interface{}, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - - pipResourceGroup := key - pipList, rerr := az.PublicIPAddressesClient.List(ctx, pipResourceGroup) - if rerr != nil { - return nil, rerr.Error() - } - - pipMap := &sync.Map{} - for _, pip := range pipList { - pip := pip - pipMap.Store(pointer.StringDeref(pip.Name, ""), &pip) - } - return pipMap, nil - } - - if az.PublicIPCacheTTLInSeconds == 0 { - az.PublicIPCacheTTLInSeconds = publicIPCacheTTLDefaultInSeconds - } - return azcache.NewTimedCache(time.Duration(az.PublicIPCacheTTLInSeconds)*time.Second, getter, az.Config.DisableAPICallCache) -} - -func (az *Cloud) getPublicIPAddress(pipResourceGroup string, pipName string, crt azcache.AzureCacheReadType) (network.PublicIPAddress, bool, error) { - cached, err := az.pipCache.Get(pipResourceGroup, crt) - if err != nil { - return network.PublicIPAddress{}, false, err - } - - pips := cached.(*sync.Map) - pip, ok := pips.Load(pipName) - if !ok { - // pip not found, refresh cache and retry - cached, err = az.pipCache.Get(pipResourceGroup, azcache.CacheReadTypeForceRefresh) - if err != nil { - return network.PublicIPAddress{}, false, err - } - pips = cached.(*sync.Map) - pip, ok = pips.Load(pipName) - if !ok { - return network.PublicIPAddress{}, false, nil - } - } - - pip = pip.(*network.PublicIPAddress) - return *(deepcopy.Copy(pip).(*network.PublicIPAddress)), true, nil -} - -func (az *Cloud) listPIP(pipResourceGroup string, crt azcache.AzureCacheReadType) ([]network.PublicIPAddress, error) { - cached, err := az.pipCache.Get(pipResourceGroup, crt) - if err != nil { - return nil, err - } - pips := cached.(*sync.Map) - var ret []network.PublicIPAddress - pips.Range(func(key, value interface{}) bool { - pip := value.(*network.PublicIPAddress) - ret = append(ret, *pip) - return true - }) - return ret, nil -} - -func (az *Cloud) findMatchedPIP(loadBalancerIP, pipName, pipResourceGroup string) (pip *network.PublicIPAddress, err error) { - pips, err := az.listPIP(pipResourceGroup, azcache.CacheReadTypeDefault) - if err != nil { - return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: failed to listPIP: %w", err) - } - - if loadBalancerIP != "" { - pip, err = az.findMatchedPIPByLoadBalancerIP(&pips, loadBalancerIP, pipResourceGroup) - if err != nil { - return nil, err - } - return pip, nil - } - - if pipResourceGroup != "" { - pip, err = az.findMatchedPIPByName(&pips, pipName, pipResourceGroup) - if err != nil { - return nil, err - } - } - return pip, nil -} - -func (az *Cloud) findMatchedPIPByName(pips *[]network.PublicIPAddress, pipName, pipResourceGroup string) (*network.PublicIPAddress, error) { - for _, pip := range *pips { - if strings.EqualFold(pointer.StringDeref(pip.Name, ""), pipName) { - return &pip, nil - } - } - - pipList, err := az.listPIP(pipResourceGroup, azcache.CacheReadTypeForceRefresh) - if err != nil { - return nil, fmt.Errorf("findMatchedPIPByName: failed to listPIP force refresh: %w", err) - } - for _, pip := range pipList { - if strings.EqualFold(pointer.StringDeref(pip.Name, ""), pipName) { - return &pip, nil - } - } - - return nil, fmt.Errorf("findMatchedPIPByName: failed to find PIP %s in resource group %s", pipName, pipResourceGroup) -} - -func (az *Cloud) findMatchedPIPByLoadBalancerIP(pips *[]network.PublicIPAddress, loadBalancerIP, pipResourceGroup string) (*network.PublicIPAddress, error) { - pip, err := getExpectedPIPFromListByIPAddress(*pips, loadBalancerIP) - if err != nil { - pipList, err := az.listPIP(pipResourceGroup, azcache.CacheReadTypeForceRefresh) - if err != nil { - return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: failed to listPIP force refresh: %w", err) - } - - pip, err = getExpectedPIPFromListByIPAddress(pipList, loadBalancerIP) - if err != nil { - return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: cannot find public IP with IP address %s in resource group %s", loadBalancerIP, pipResourceGroup) - } - } - - return pip, nil -} - -func getExpectedPIPFromListByIPAddress(pips []network.PublicIPAddress, ip string) (*network.PublicIPAddress, error) { - for _, pip := range pips { - if pip.PublicIPAddressPropertiesFormat.IPAddress != nil && - *pip.PublicIPAddressPropertiesFormat.IPAddress == ip { - return &pip, nil - } - } - - return nil, fmt.Errorf("getExpectedPIPFromListByIPAddress: cannot find public IP with IP address %s", ip) -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routetable_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routetable_repo.go deleted file mode 100644 index 9f11101329d6..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routetable_repo.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -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 provider - -import ( - "encoding/json" - "net/http" - "strings" - "time" - - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - "k8s.io/klog/v2" - "k8s.io/utils/pointer" - - azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" - "sigs.k8s.io/cloud-provider-azure/pkg/consts" -) - -// CreateOrUpdateRouteTable invokes az.RouteTablesClient.CreateOrUpdate with exponential backoff retry -func (az *Cloud) CreateOrUpdateRouteTable(routeTable network.RouteTable) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rerr := az.RouteTablesClient.CreateOrUpdate(ctx, az.RouteTableResourceGroup, az.RouteTableName, routeTable, pointer.StringDeref(routeTable.Etag, "")) - if rerr == nil { - // Invalidate the cache right after updating - _ = az.rtCache.Delete(*routeTable.Name) - return nil - } - - rtJSON, _ := json.Marshal(routeTable) - klog.Warningf("RouteTablesClient.CreateOrUpdate(%s) failed: %v, RouteTable request: %s", pointer.StringDeref(routeTable.Name, ""), rerr.Error(), string(rtJSON)) - - // Invalidate the cache because etag mismatch. - if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("Route table cache for %s is cleanup because of http.StatusPreconditionFailed", *routeTable.Name) - _ = az.rtCache.Delete(*routeTable.Name) - } - // Invalidate the cache because another new operation has canceled the current request. - if strings.Contains(strings.ToLower(rerr.Error().Error()), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("Route table cache for %s is cleanup because CreateOrUpdateRouteTable is canceled by another operation", *routeTable.Name) - _ = az.rtCache.Delete(*routeTable.Name) - } - klog.Errorf("RouteTablesClient.CreateOrUpdate(%s) failed: %v", az.RouteTableName, rerr.Error()) - return rerr.Error() -} - -func (az *Cloud) newRouteTableCache() (azcache.Resource, error) { - getter := func(key string) (interface{}, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - rt, err := az.RouteTablesClient.Get(ctx, az.RouteTableResourceGroup, key, "") - exists, rerr := checkResourceExistsFromError(err) - if rerr != nil { - return nil, rerr.Error() - } - - if !exists { - klog.V(2).Infof("Route table %q not found", key) - return nil, nil - } - - return &rt, nil - } - - if az.RouteTableCacheTTLInSeconds == 0 { - az.RouteTableCacheTTLInSeconds = routeTableCacheTTLDefaultInSeconds - } - return azcache.NewTimedCache(time.Duration(az.RouteTableCacheTTLInSeconds)*time.Second, getter, az.Config.DisableAPICallCache) -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_securitygroup_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_securitygroup_repo.go deleted file mode 100644 index 7ecc6b666bb8..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_securitygroup_repo.go +++ /dev/null @@ -1,105 +0,0 @@ -/* -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 provider - -import ( - "encoding/json" - "fmt" - "net/http" - "strings" - "time" - - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - "k8s.io/klog/v2" - "k8s.io/utils/pointer" - - azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" - "sigs.k8s.io/cloud-provider-azure/pkg/consts" -) - -// CreateOrUpdateSecurityGroup invokes az.SecurityGroupsClient.CreateOrUpdate with exponential backoff retry -func (az *Cloud) CreateOrUpdateSecurityGroup(sg network.SecurityGroup) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - rerr := az.SecurityGroupsClient.CreateOrUpdate(ctx, az.SecurityGroupResourceGroup, *sg.Name, sg, pointer.StringDeref(sg.Etag, "")) - klog.V(10).Infof("SecurityGroupsClient.CreateOrUpdate(%s): end", *sg.Name) - if rerr == nil { - // Invalidate the cache right after updating - _ = az.nsgCache.Delete(*sg.Name) - return nil - } - - nsgJSON, _ := json.Marshal(sg) - klog.Warningf("CreateOrUpdateSecurityGroup(%s) failed: %v, NSG request: %s", pointer.StringDeref(sg.Name, ""), rerr.Error(), string(nsgJSON)) - - // Invalidate the cache because ETAG precondition mismatch. - if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("SecurityGroup cache for %s is cleanup because of http.StatusPreconditionFailed", *sg.Name) - _ = az.nsgCache.Delete(*sg.Name) - } - - // Invalidate the cache because another new operation has canceled the current request. - if strings.Contains(strings.ToLower(rerr.Error().Error()), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("SecurityGroup cache for %s is cleanup because CreateOrUpdateSecurityGroup is canceled by another operation", *sg.Name) - _ = az.nsgCache.Delete(*sg.Name) - } - - return rerr.Error() -} - -func (az *Cloud) newNSGCache() (azcache.Resource, error) { - getter := func(key string) (interface{}, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - nsg, err := az.SecurityGroupsClient.Get(ctx, az.SecurityGroupResourceGroup, key, "") - exists, rerr := checkResourceExistsFromError(err) - if rerr != nil { - return nil, rerr.Error() - } - - if !exists { - klog.V(2).Infof("Security group %q not found", key) - return nil, nil - } - - return &nsg, nil - } - - if az.NsgCacheTTLInSeconds == 0 { - az.NsgCacheTTLInSeconds = nsgCacheTTLDefaultInSeconds - } - return azcache.NewTimedCache(time.Duration(az.NsgCacheTTLInSeconds)*time.Second, getter, az.Config.DisableAPICallCache) -} - -func (az *Cloud) getSecurityGroup(crt azcache.AzureCacheReadType) (network.SecurityGroup, error) { - nsg := network.SecurityGroup{} - if az.SecurityGroupName == "" { - return nsg, fmt.Errorf("securityGroupName is not configured") - } - - securityGroup, err := az.nsgCache.GetWithDeepCopy(az.SecurityGroupName, crt) - if err != nil { - return nsg, err - } - - if securityGroup == nil { - return nsg, fmt.Errorf("nsg %q not found", az.SecurityGroupName) - } - - return *(securityGroup.(*network.SecurityGroup)), nil -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_subnet_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_subnet_repo.go deleted file mode 100644 index 9d5cec09e3bc..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_subnet_repo.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -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 provider - -import ( - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - v1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" -) - -// CreateOrUpdateSubnet invokes az.SubnetClient.CreateOrUpdate with exponential backoff retry -func (az *Cloud) CreateOrUpdateSubnet(service *v1.Service, subnet network.Subnet) error { - ctx, cancel := getContextWithCancel() - defer cancel() - - var rg string - if len(az.VnetResourceGroup) > 0 { - rg = az.VnetResourceGroup - } else { - rg = az.ResourceGroup - } - - rerr := az.SubnetsClient.CreateOrUpdate(ctx, rg, az.VnetName, *subnet.Name, subnet) - klog.V(10).Infof("SubnetClient.CreateOrUpdate(%s): end", *subnet.Name) - if rerr != nil { - klog.Errorf("SubnetClient.CreateOrUpdate(%s) failed: %s", *subnet.Name, rerr.Error().Error()) - az.Event(service, v1.EventTypeWarning, "CreateOrUpdateSubnet", rerr.Error().Error()) - return rerr.Error() - } - - return nil -} - -func (az *Cloud) getSubnet(virtualNetworkName string, subnetName string) (network.Subnet, bool, error) { - var rg string - if len(az.VnetResourceGroup) > 0 { - rg = az.VnetResourceGroup - } else { - rg = az.ResourceGroup - } - - ctx, cancel := getContextWithCancel() - defer cancel() - subnet, err := az.SubnetsClient.Get(ctx, rg, virtualNetworkName, subnetName, "") - exists, rerr := checkResourceExistsFromError(err) - if rerr != nil { - return subnet, false, rerr.Error() - } - - if !exists { - klog.V(2).Infof("Subnet %q not found", subnetName) - } - return subnet, exists, nil -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets_repo.go deleted file mode 100644 index a672286bd0ba..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets_repo.go +++ /dev/null @@ -1,193 +0,0 @@ -/* -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 provider - -import ( - "errors" - "fmt" - "strings" - "time" - - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" - "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/wait" - cloudprovider "k8s.io/cloud-provider" - "k8s.io/klog/v2" - "k8s.io/utils/pointer" - - azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" - "sigs.k8s.io/cloud-provider-azure/pkg/consts" -) - -// GetVirtualMachineWithRetry invokes az.getVirtualMachine with exponential backoff retry -func (az *Cloud) GetVirtualMachineWithRetry(name types.NodeName, crt azcache.AzureCacheReadType) (compute.VirtualMachine, error) { - var machine compute.VirtualMachine - var retryErr error - err := wait.ExponentialBackoff(az.RequestBackoff(), func() (bool, error) { - machine, retryErr = az.getVirtualMachine(name, crt) - if errors.Is(retryErr, cloudprovider.InstanceNotFound) { - return true, cloudprovider.InstanceNotFound - } - if retryErr != nil { - klog.Errorf("GetVirtualMachineWithRetry(%s): backoff failure, will retry, err=%v", name, retryErr) - return false, nil - } - klog.V(2).Infof("GetVirtualMachineWithRetry(%s): backoff success", name) - return true, nil - }) - if errors.Is(err, wait.ErrWaitTimeout) { - err = retryErr - } - return machine, err -} - -// ListVirtualMachines invokes az.VirtualMachinesClient.List with exponential backoff retry -func (az *Cloud) ListVirtualMachines(resourceGroup string) ([]compute.VirtualMachine, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - - allNodes, rerr := az.VirtualMachinesClient.List(ctx, resourceGroup) - if rerr != nil { - klog.Errorf("VirtualMachinesClient.List(%v) failure with err=%v", resourceGroup, rerr) - return nil, rerr.Error() - } - klog.V(6).Infof("VirtualMachinesClient.List(%v) success", resourceGroup) - return allNodes, nil -} - -// getPrivateIPsForMachine is wrapper for optional backoff getting private ips -// list of a node by name -func (az *Cloud) getPrivateIPsForMachine(nodeName types.NodeName) ([]string, error) { - return az.getPrivateIPsForMachineWithRetry(nodeName) -} - -func (az *Cloud) getPrivateIPsForMachineWithRetry(nodeName types.NodeName) ([]string, error) { - var privateIPs []string - err := wait.ExponentialBackoff(az.RequestBackoff(), func() (bool, error) { - var retryErr error - privateIPs, retryErr = az.VMSet.GetPrivateIPsByNodeName(string(nodeName)) - if retryErr != nil { - // won't retry since the instance doesn't exist on Azure. - if errors.Is(retryErr, cloudprovider.InstanceNotFound) { - return true, retryErr - } - klog.Errorf("GetPrivateIPsByNodeName(%s): backoff failure, will retry,err=%v", nodeName, retryErr) - return false, nil - } - klog.V(3).Infof("GetPrivateIPsByNodeName(%s): backoff success", nodeName) - return true, nil - }) - return privateIPs, err -} - -func (az *Cloud) getIPForMachine(nodeName types.NodeName) (string, string, error) { - return az.GetIPForMachineWithRetry(nodeName) -} - -// GetIPForMachineWithRetry invokes az.getIPForMachine with exponential backoff retry -func (az *Cloud) GetIPForMachineWithRetry(name types.NodeName) (string, string, error) { - var ip, publicIP string - err := wait.ExponentialBackoff(az.RequestBackoff(), func() (bool, error) { - var retryErr error - ip, publicIP, retryErr = az.VMSet.GetIPByNodeName(string(name)) - if retryErr != nil { - klog.Errorf("GetIPForMachineWithRetry(%s): backoff failure, will retry,err=%v", name, retryErr) - return false, nil - } - klog.V(3).Infof("GetIPForMachineWithRetry(%s): backoff success", name) - return true, nil - }) - return ip, publicIP, err -} - -func (az *Cloud) newVMCache() (azcache.Resource, error) { - getter := func(key string) (interface{}, error) { - // Currently InstanceView request are used by azure_zones, while the calls come after non-InstanceView - // request. If we first send an InstanceView request and then a non InstanceView request, the second - // request will still hit throttling. This is what happens now for cloud controller manager: In this - // case we do get instance view every time to fulfill the azure_zones requirement without hitting - // throttling. - // Consider adding separate parameter for controlling 'InstanceView' once node update issue #56276 is fixed - ctx, cancel := getContextWithCancel() - defer cancel() - - resourceGroup, err := az.GetNodeResourceGroup(key) - if err != nil { - return nil, err - } - - vm, verr := az.VirtualMachinesClient.Get(ctx, resourceGroup, key, compute.InstanceViewTypesInstanceView) - exists, rerr := checkResourceExistsFromError(verr) - if rerr != nil { - return nil, rerr.Error() - } - - if !exists { - klog.V(2).Infof("Virtual machine %q not found", key) - return nil, nil - } - - if vm.VirtualMachineProperties != nil && - strings.EqualFold(pointer.StringDeref(vm.VirtualMachineProperties.ProvisioningState, ""), string(consts.ProvisioningStateDeleting)) { - klog.V(2).Infof("Virtual machine %q is under deleting", key) - return nil, nil - } - - return &vm, nil - } - - if az.VMCacheTTLInSeconds == 0 { - az.VMCacheTTLInSeconds = vmCacheTTLDefaultInSeconds - } - return azcache.NewTimedCache(time.Duration(az.VMCacheTTLInSeconds)*time.Second, getter, az.Config.DisableAPICallCache) -} - -// getVirtualMachine calls 'VirtualMachinesClient.Get' with a timed cache -// The service side has throttling control that delays responses if there are multiple requests onto certain vm -// resource request in short period. -func (az *Cloud) getVirtualMachine(nodeName types.NodeName, crt azcache.AzureCacheReadType) (vm compute.VirtualMachine, err error) { - vmName := string(nodeName) - cachedVM, err := az.vmCache.Get(vmName, crt) - if err != nil { - return vm, err - } - - if cachedVM == nil { - klog.Warningf("Unable to find node %s: %v", nodeName, cloudprovider.InstanceNotFound) - return vm, cloudprovider.InstanceNotFound - } - - return *(cachedVM.(*compute.VirtualMachine)), nil -} - -func (az *Cloud) getRouteTable(crt azcache.AzureCacheReadType) (routeTable network.RouteTable, exists bool, err error) { - if len(az.RouteTableName) == 0 { - return routeTable, false, fmt.Errorf("route table name is not configured") - } - - cachedRt, err := az.rtCache.GetWithDeepCopy(az.RouteTableName, crt) - if err != nil { - return routeTable, false, err - } - - if cachedRt == nil { - return routeTable, false, nil - } - - return *(cachedRt.(*network.RouteTable)), true, nil -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_repo.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_repo.go deleted file mode 100644 index 6721dceaba8c..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_repo.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -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 provider - -import ( - "strings" - - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute" - "k8s.io/klog/v2" - - "sigs.k8s.io/cloud-provider-azure/pkg/consts" - "sigs.k8s.io/cloud-provider-azure/pkg/retry" -) - -// CreateOrUpdateVMSS invokes az.VirtualMachineScaleSetsClient.Update(). -func (az *Cloud) CreateOrUpdateVMSS(resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) *retry.Error { - ctx, cancel := getContextWithCancel() - defer cancel() - - // When vmss is being deleted, CreateOrUpdate API would report "the vmss is being deleted" error. - // Since it is being deleted, we shouldn't send more CreateOrUpdate requests for it. - klog.V(3).Infof("CreateOrUpdateVMSS: verify the status of the vmss being created or updated") - vmss, rerr := az.VirtualMachineScaleSetsClient.Get(ctx, resourceGroupName, VMScaleSetName) - if rerr != nil { - klog.Errorf("CreateOrUpdateVMSS: error getting vmss(%s): %v", VMScaleSetName, rerr) - return rerr - } - if vmss.ProvisioningState != nil && strings.EqualFold(*vmss.ProvisioningState, consts.VirtualMachineScaleSetsDeallocating) { - klog.V(3).Infof("CreateOrUpdateVMSS: found vmss %s being deleted, skipping", VMScaleSetName) - return nil - } - - rerr = az.VirtualMachineScaleSetsClient.CreateOrUpdate(ctx, resourceGroupName, VMScaleSetName, parameters) - klog.V(10).Infof("UpdateVmssVMWithRetry: VirtualMachineScaleSetsClient.CreateOrUpdate(%s): end", VMScaleSetName) - if rerr != nil { - klog.Errorf("CreateOrUpdateVMSS: error CreateOrUpdate vmss(%s): %v", VMScaleSetName, rerr) - return rerr - } - - return nil -} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go b/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go deleted file mode 100644 index ed483cbbc4d8..000000000000 --- a/cluster-autoscaler/vendor/sigs.k8s.io/structured-merge-diff/v4/typed/compare.go +++ /dev/null @@ -1,460 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT 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 typed - -import ( - "fmt" - "strings" - - "sigs.k8s.io/structured-merge-diff/v4/fieldpath" - "sigs.k8s.io/structured-merge-diff/v4/schema" - "sigs.k8s.io/structured-merge-diff/v4/value" -) - -// Comparison is the return value of a TypedValue.Compare() operation. -// -// No field will appear in more than one of the three fieldsets. If all of the -// fieldsets are empty, then the objects must have been equal. -type Comparison struct { - // Removed contains any fields removed by rhs (the right-hand-side - // object in the comparison). - Removed *fieldpath.Set - // Modified contains fields present in both objects but different. - Modified *fieldpath.Set - // Added contains any fields added by rhs. - Added *fieldpath.Set -} - -// IsSame returns true if the comparison returned no changes (the two -// compared objects are similar). -func (c *Comparison) IsSame() bool { - return c.Removed.Empty() && c.Modified.Empty() && c.Added.Empty() -} - -// String returns a human readable version of the comparison. -func (c *Comparison) String() string { - bld := strings.Builder{} - if !c.Modified.Empty() { - bld.WriteString(fmt.Sprintf("- Modified Fields:\n%v\n", c.Modified)) - } - if !c.Added.Empty() { - bld.WriteString(fmt.Sprintf("- Added Fields:\n%v\n", c.Added)) - } - if !c.Removed.Empty() { - bld.WriteString(fmt.Sprintf("- Removed Fields:\n%v\n", c.Removed)) - } - return bld.String() -} - -// ExcludeFields fields from the compare recursively removes the fields -// from the entire comparison -func (c *Comparison) ExcludeFields(fields *fieldpath.Set) *Comparison { - if fields == nil || fields.Empty() { - return c - } - c.Removed = c.Removed.RecursiveDifference(fields) - c.Modified = c.Modified.RecursiveDifference(fields) - c.Added = c.Added.RecursiveDifference(fields) - return c -} - -type compareWalker struct { - lhs value.Value - rhs value.Value - schema *schema.Schema - typeRef schema.TypeRef - - // Current path that we are comparing - path fieldpath.Path - - // Resulting comparison. - comparison *Comparison - - // internal housekeeping--don't set when constructing. - inLeaf bool // Set to true if we're in a "big leaf"--atomic map/list - - // Allocate only as many walkers as needed for the depth by storing them here. - spareWalkers *[]*compareWalker - - allocator value.Allocator -} - -// compare compares stuff. -func (w *compareWalker) compare(prefixFn func() string) (errs ValidationErrors) { - if w.lhs == nil && w.rhs == nil { - // check this condidition here instead of everywhere below. - return errorf("at least one of lhs and rhs must be provided") - } - a, ok := w.schema.Resolve(w.typeRef) - if !ok { - return errorf("schema error: no type found matching: %v", *w.typeRef.NamedType) - } - - alhs := deduceAtom(a, w.lhs) - arhs := deduceAtom(a, w.rhs) - - // deduceAtom does not fix the type for nil values - // nil is a wildcard and will accept whatever form the other operand takes - if w.rhs == nil { - errs = append(errs, handleAtom(alhs, w.typeRef, w)...) - } else if w.lhs == nil || alhs.Equals(&arhs) { - errs = append(errs, handleAtom(arhs, w.typeRef, w)...) - } else { - w2 := *w - errs = append(errs, handleAtom(alhs, w.typeRef, &w2)...) - errs = append(errs, handleAtom(arhs, w.typeRef, w)...) - } - - if !w.inLeaf { - if w.lhs == nil { - w.comparison.Added.Insert(w.path) - } else if w.rhs == nil { - w.comparison.Removed.Insert(w.path) - } - } - return errs.WithLazyPrefix(prefixFn) -} - -// doLeaf should be called on leaves before descending into children, if there -// will be a descent. It modifies w.inLeaf. -func (w *compareWalker) doLeaf() { - if w.inLeaf { - // We're in a "big leaf", an atomic map or list. Ignore - // subsequent leaves. - return - } - w.inLeaf = true - - // We don't recurse into leaf fields for merging. - if w.lhs == nil { - w.comparison.Added.Insert(w.path) - } else if w.rhs == nil { - w.comparison.Removed.Insert(w.path) - } else if !value.EqualsUsing(w.allocator, w.rhs, w.lhs) { - // TODO: Equality is not sufficient for this. - // Need to implement equality check on the value type. - w.comparison.Modified.Insert(w.path) - } -} - -func (w *compareWalker) doScalar(t *schema.Scalar) ValidationErrors { - // Make sure at least one side is a valid scalar. - lerrs := validateScalar(t, w.lhs, "lhs: ") - rerrs := validateScalar(t, w.rhs, "rhs: ") - if len(lerrs) > 0 && len(rerrs) > 0 { - return append(lerrs, rerrs...) - } - - // All scalars are leaf fields. - w.doLeaf() - - return nil -} - -func (w *compareWalker) prepareDescent(pe fieldpath.PathElement, tr schema.TypeRef, cmp *Comparison) *compareWalker { - if w.spareWalkers == nil { - // first descent. - w.spareWalkers = &[]*compareWalker{} - } - var w2 *compareWalker - if n := len(*w.spareWalkers); n > 0 { - w2, *w.spareWalkers = (*w.spareWalkers)[n-1], (*w.spareWalkers)[:n-1] - } else { - w2 = &compareWalker{} - } - *w2 = *w - w2.typeRef = tr - w2.path = append(w2.path, pe) - w2.lhs = nil - w2.rhs = nil - w2.comparison = cmp - return w2 -} - -func (w *compareWalker) finishDescent(w2 *compareWalker) { - // if the descent caused a realloc, ensure that we reuse the buffer - // for the next sibling. - w.path = w2.path[:len(w2.path)-1] - *w.spareWalkers = append(*w.spareWalkers, w2) -} - -func (w *compareWalker) derefMap(prefix string, v value.Value) (value.Map, ValidationErrors) { - if v == nil { - return nil, nil - } - m, err := mapValue(w.allocator, v) - if err != nil { - return nil, errorf("%v: %v", prefix, err) - } - return m, nil -} - -func (w *compareWalker) visitListItems(t *schema.List, lhs, rhs value.List) (errs ValidationErrors) { - rLen := 0 - if rhs != nil { - rLen = rhs.Length() - } - lLen := 0 - if lhs != nil { - lLen = lhs.Length() - } - - maxLength := rLen - if lLen > maxLength { - maxLength = lLen - } - // Contains all the unique PEs between lhs and rhs, exactly once. - // Order doesn't matter since we're just tracking ownership in a set. - allPEs := make([]fieldpath.PathElement, 0, maxLength) - - // Gather all the elements from lhs, indexed by PE, in a list for duplicates. - lValues := fieldpath.MakePathElementMap(lLen) - for i := 0; i < lLen; i++ { - child := lhs.At(i) - pe, err := listItemToPathElement(w.allocator, w.schema, t, child) - if err != nil { - errs = append(errs, errorf("element %v: %v", i, err.Error())...) - // If we can't construct the path element, we can't - // even report errors deeper in the schema, so bail on - // this element. - continue - } - - if v, found := lValues.Get(pe); found { - list := v.([]value.Value) - lValues.Insert(pe, append(list, child)) - } else { - lValues.Insert(pe, []value.Value{child}) - allPEs = append(allPEs, pe) - } - } - - // Gather all the elements from rhs, indexed by PE, in a list for duplicates. - rValues := fieldpath.MakePathElementMap(rLen) - for i := 0; i < rLen; i++ { - rValue := rhs.At(i) - pe, err := listItemToPathElement(w.allocator, w.schema, t, rValue) - if err != nil { - errs = append(errs, errorf("element %v: %v", i, err.Error())...) - // If we can't construct the path element, we can't - // even report errors deeper in the schema, so bail on - // this element. - continue - } - if v, found := rValues.Get(pe); found { - list := v.([]value.Value) - rValues.Insert(pe, append(list, rValue)) - } else { - rValues.Insert(pe, []value.Value{rValue}) - if _, found := lValues.Get(pe); !found { - allPEs = append(allPEs, pe) - } - } - } - - for _, pe := range allPEs { - lList := []value.Value(nil) - if l, ok := lValues.Get(pe); ok { - lList = l.([]value.Value) - } - rList := []value.Value(nil) - if l, ok := rValues.Get(pe); ok { - rList = l.([]value.Value) - } - - switch { - case len(lList) == 0 && len(rList) == 0: - // We shouldn't be here anyway. - return - // Normal use-case: - // We have no duplicates for this PE, compare items one-to-one. - case len(lList) <= 1 && len(rList) <= 1: - lValue := value.Value(nil) - if len(lList) != 0 { - lValue = lList[0] - } - rValue := value.Value(nil) - if len(rList) != 0 { - rValue = rList[0] - } - errs = append(errs, w.compareListItem(t, pe, lValue, rValue)...) - // Duplicates before & after use-case: - // Compare the duplicates lists as if they were atomic, mark modified if they changed. - case len(lList) >= 2 && len(rList) >= 2: - listEqual := func(lList, rList []value.Value) bool { - if len(lList) != len(rList) { - return false - } - for i := range lList { - if !value.Equals(lList[i], rList[i]) { - return false - } - } - return true - } - if !listEqual(lList, rList) { - w.comparison.Modified.Insert(append(w.path, pe)) - } - // Duplicates before & not anymore use-case: - // Rcursively add new non-duplicate items, Remove duplicate marker, - case len(lList) >= 2: - if len(rList) != 0 { - errs = append(errs, w.compareListItem(t, pe, nil, rList[0])...) - } - w.comparison.Removed.Insert(append(w.path, pe)) - // New duplicates use-case: - // Recursively remove old non-duplicate items, add duplicate marker. - case len(rList) >= 2: - if len(lList) != 0 { - errs = append(errs, w.compareListItem(t, pe, lList[0], nil)...) - } - w.comparison.Added.Insert(append(w.path, pe)) - } - } - - return -} - -func (w *compareWalker) indexListPathElements(t *schema.List, list value.List) ([]fieldpath.PathElement, fieldpath.PathElementValueMap, ValidationErrors) { - var errs ValidationErrors - length := 0 - if list != nil { - length = list.Length() - } - observed := fieldpath.MakePathElementValueMap(length) - pes := make([]fieldpath.PathElement, 0, length) - for i := 0; i < length; i++ { - child := list.At(i) - pe, err := listItemToPathElement(w.allocator, w.schema, t, child) - if err != nil { - errs = append(errs, errorf("element %v: %v", i, err.Error())...) - // If we can't construct the path element, we can't - // even report errors deeper in the schema, so bail on - // this element. - continue - } - // Ignore repeated occurences of `pe`. - if _, found := observed.Get(pe); found { - continue - } - observed.Insert(pe, child) - pes = append(pes, pe) - } - return pes, observed, errs -} - -func (w *compareWalker) compareListItem(t *schema.List, pe fieldpath.PathElement, lChild, rChild value.Value) ValidationErrors { - w2 := w.prepareDescent(pe, t.ElementType, w.comparison) - w2.lhs = lChild - w2.rhs = rChild - errs := w2.compare(pe.String) - w.finishDescent(w2) - return errs -} - -func (w *compareWalker) derefList(prefix string, v value.Value) (value.List, ValidationErrors) { - if v == nil { - return nil, nil - } - l, err := listValue(w.allocator, v) - if err != nil { - return nil, errorf("%v: %v", prefix, err) - } - return l, nil -} - -func (w *compareWalker) doList(t *schema.List) (errs ValidationErrors) { - lhs, _ := w.derefList("lhs: ", w.lhs) - if lhs != nil { - defer w.allocator.Free(lhs) - } - rhs, _ := w.derefList("rhs: ", w.rhs) - if rhs != nil { - defer w.allocator.Free(rhs) - } - - // If both lhs and rhs are empty/null, treat it as a - // leaf: this helps preserve the empty/null - // distinction. - emptyPromoteToLeaf := (lhs == nil || lhs.Length() == 0) && (rhs == nil || rhs.Length() == 0) - - if t.ElementRelationship == schema.Atomic || emptyPromoteToLeaf { - w.doLeaf() - return nil - } - - if lhs == nil && rhs == nil { - return nil - } - - errs = w.visitListItems(t, lhs, rhs) - - return errs -} - -func (w *compareWalker) visitMapItem(t *schema.Map, out map[string]interface{}, key string, lhs, rhs value.Value) (errs ValidationErrors) { - fieldType := t.ElementType - if sf, ok := t.FindField(key); ok { - fieldType = sf.Type - } - pe := fieldpath.PathElement{FieldName: &key} - w2 := w.prepareDescent(pe, fieldType, w.comparison) - w2.lhs = lhs - w2.rhs = rhs - errs = append(errs, w2.compare(pe.String)...) - w.finishDescent(w2) - return errs -} - -func (w *compareWalker) visitMapItems(t *schema.Map, lhs, rhs value.Map) (errs ValidationErrors) { - out := map[string]interface{}{} - - value.MapZipUsing(w.allocator, lhs, rhs, value.Unordered, func(key string, lhsValue, rhsValue value.Value) bool { - errs = append(errs, w.visitMapItem(t, out, key, lhsValue, rhsValue)...) - return true - }) - - return errs -} - -func (w *compareWalker) doMap(t *schema.Map) (errs ValidationErrors) { - lhs, _ := w.derefMap("lhs: ", w.lhs) - if lhs != nil { - defer w.allocator.Free(lhs) - } - rhs, _ := w.derefMap("rhs: ", w.rhs) - if rhs != nil { - defer w.allocator.Free(rhs) - } - // If both lhs and rhs are empty/null, treat it as a - // leaf: this helps preserve the empty/null - // distinction. - emptyPromoteToLeaf := (lhs == nil || lhs.Empty()) && (rhs == nil || rhs.Empty()) - - if t.ElementRelationship == schema.Atomic || emptyPromoteToLeaf { - w.doLeaf() - return nil - } - - if lhs == nil && rhs == nil { - return nil - } - - errs = append(errs, w.visitMapItems(t, lhs, rhs)...) - - return errs -} diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index 3736a8328b64..7f84ae120bcf 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -156,12 +156,17 @@ def file_extension(filename): "cluster-autoscaler/cloudprovider/brightbox/linkheader", "cluster-autoscaler/cloudprovider/brightbox/go-cache", "cluster-autoscaler/cloudprovider/digitalocean/godo", - "cluster-autoscaler/cloudprovider/externalgrpc/protos", "cluster-autoscaler/cloudprovider/magnum/gophercloud", "cluster-autoscaler/cloudprovider/ionoscloud/ionos-cloud-sdk-go", "cluster-autoscaler/cloudprovider/hetzner/hcloud-go", "cluster-autoscaler/cloudprovider/oci", - "cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk"] + "cluster-autoscaler/cloudprovider/mcm", + "cluster-autoscaler/integration", + "cluster-autoscaler/hack", + "cluster-autoscaler/cloudprovider/builder/builder_all.go", + ".ci/read-vpa-version.sh", + ".ci/write-vpa-version.sh" + ] # list all the files contain 'DO NOT EDIT', but are not generated skipped_ungenerated_files = ['hack/build-ui.sh', 'hack/lib/swagger.sh', diff --git a/hack/verify-golint.sh b/hack/verify-golint.sh index a32965a99d43..803b370b09e6 100755 --- a/hack/verify-golint.sh +++ b/hack/verify-golint.sh @@ -40,8 +40,6 @@ excluded_packages=( 'cluster-autoscaler/cloudprovider/hetzner/hcloud-go' 'cluster-autoscaler/expander/grpcplugin/protos' 'cluster-autoscaler/cloudprovider/tencentcloud/tencentcloud-sdk-go' - 'cluster-autoscaler/cloudprovider/volcengine/volc-sdk-golang' - 'cluster-autoscaler/cloudprovider/volcengine/volcengine-go-sdk' ) FIND_PACKAGES='go list ./... ' diff --git a/multidimensional-pod-autoscaler/AEP.md b/multidimensional-pod-autoscaler/AEP.md deleted file mode 100644 index b06b2110c5ac..000000000000 --- a/multidimensional-pod-autoscaler/AEP.md +++ /dev/null @@ -1,542 +0,0 @@ -# AEP-5342: Multi-dimensional Pod Autoscaler - -AEP - Autoscaler Enhancement Proposal - - -- [Release Signoff Checklist](#release-signoff-checklist) -- [Summary](#summary) -- [Motivation](#motivation) - - [Goals](#goals) - - [Non-Goals](#non-goals) -- [Proposal](#proposal) - - [User Stories](#user-stories-optional) - - [A New MPA Framework with Reinforcement Learning](#a-new-mpa-framework-with-reinforcement-learning) - - [Different Scaling Actions for Different Types of Resources](#different-scaling-actions-for-different-types-of-resources) -- [Design Details](#design-details) - - [Test Plan](#test-plan) - - [Unit Tests](#unit-tests) - - [Integration Tests](#integration-tests) - - [End-to-end Tests](#end-to-end-tests) - - [Graduation Criteria](#graduation-criteria) -- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire) - - [Feature Enablement and Rollback](#feature-enablement-and-rollback) - - [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning) - - [Monitoring Requirements](#monitoring-requirements) - - [Dependencies](#dependencies) - - [Scalability](#scalability) - - [Troubleshooting](#troubleshooting) -- [Implementation History](#implementation-history) -- [Drawbacks](#drawbacks) -- [Alternatives](#alternatives) - - -## Release Signoff Checklist - -Items marked with (R) are required *prior to targeting to a milestone / release*. - -- [ ] (R) AEP approvers have approved the AEP status as `implementable` -- [ ] (R) Design details are appropriately documented -- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) - - [ ] e2e Tests for all Beta API Operations (endpoints) - - [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) - - [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free -- [ ] (R) Graduation criteria is in place - - [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md) -- [ ] (R) Production readiness review completed -- [ ] (R) Production readiness review approved -- [ ] "Implementation History" section is up-to-date for milestone -- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io] -- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes - - - -[kubernetes.io]: https://kubernetes.io/ -[kubernetes/enhancements]: https://git.k8s.io/enhancements -[kubernetes/kubernetes]: https://git.k8s.io/kubernetes -[kubernetes/website]: https://git.k8s.io/website - -## Summary - -Currently, Horizontal Pod Autoscaler (HPA) and Vertical Pod Autoscaler (VPA) control the scaling actions separately as independent controllers to determine the resource allocation for a containerized application. -Due to the independence of these two controllers, when they are configured to optimize the same target, e.g., CPU usage, they can lead to an awkward situation where HPA tries to spin more pods based on the higher-than-threshold CPU usage while VPA tries to squeeze the size of each pod based on the lower CPU usage (after scaling out by HPA). -The final outcome would be a large number of small pods created for the workloads. -Manual fine-tuning the timing to do vertical/horizontal scaling and prioritization are usually needed for synchronization of the HPA and VPA. - -We propose a Multi-dimensional Pod Autoscaling (MPA) framework that combines the actions of vertical and horizontal autoscaling in a single action but separates the actuation completely from the controlling algorithms. -It consists of three controllers (i.e., a recommender, an updater, and an admission controller) and an MPA API (i.e., a CRD object or CR) that connects the autoscaling recommendations to actuation. -The multidimensional scaling algorithm is implemented in the recommender. -The scaling decisions derived from the recommender are stored in the MPA object. -The updater and the admission controller retrieve those decisions from the MPA object and actuate those vertical and horizontal actions. -Our proposed MPA (with the separation of recommendations from actuation) allows developers to replace the default recommender with their alternative customized recommender, so developers can provide their own recommender implementing advanced algorithms that control both scaling actions across different resource dimensions. - -## Motivation - -To scale application Deployments, Kubernetes supports both horizontal and vertical scaling with a Horizontal Pod Autoscaler (HPA) and a Vertical Pod Autoscaler (VPA), respectively. -Currently, [HPA] and [VPA] work separately as independent controllers to determine the resource allocation of a containerized application. -- HPA determines the number of replicas for each Deployment of an application with the aim of automatically scaling the workload to match demand. The HPA controller, running within the Kubernetes control plane, periodically adjusts the desired scale of its target (e.g., a Deployment) to match observed metrics such as average CPU utilization, average memory utilization, or any other custom metric the users specify (e.g., the rate of client requests per second or I/O writes per second). The autoscaling algorithm that the HPA controller uses is based on the equation `desired_replicas = current_replicas * (current_metric_value / desired_metric_value)`. -- VPA determines the size of containers, namely CPU and Memory Request and Limit. The primary goal of VPA is to reduce maintenance costs and improve the utilization of cluster resources. When configured, it will set the Request and Limit automatically based on historical usage and thus allow proper scheduling onto nodes so that the appropriate resource amount is available for each replica. It will also maintain ratios between limits and requests that were specified in the initial container configuration. - -When using HPA and VPA together to both reduce resource usage and guarantee application performance, VPA resizes pods based on their measured resource usage, and HPA scales in/out based on the customer application performance metric, and their logic is entirely ignorant of each other. -Due to the independence of these two controllers, they can lead to an awkward situation where VPA tries to squeeze the pods into smaller sizes based on their measured utilization. -Still, HPA tries to scale out the applications to improve the customized performance metrics. -It is also [not recommended] to use HPA together with VPA for CPU or memory metrics. -Therefore, there is a need to combine the two controllers so that horizontal and vertical scaling decisions are made in combination for an application to achieve both objectives, including resource efficiency and the application service-level objectives (SLOs)/performance goals. -However, existing VPA/HPA designs cannot accommodate such requirements. -Manual fine-tuning the timing or frequency to do vertical/horizontal scaling and prioritization are usually needed for synchronization of the HPA and VPA. - -[HPA]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ -[VPA]: https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler -[not recommended]: https://cloud.google.com/kubernetes-engine/docs/concepts/horizontalpodautoscaler - -### Goals - -- Design and implement a holistic framework with a set of controllers to achieve multi-dimensional pod autoscaling (MPA). -- Separate the decision actuation from recommendations for both horizontal and vertical autoscaling, which enables users to replace the default recommender with their customized recommender. -- Re-use existing HPA and VPA libraries as much as possible in MPA. - -### Non-Goals - -- Design of new multi-dimensional pod autoscaling algorithms. Although this proposal will enable alternate recommenders, no alternate recommenders will be created as part of this proposal. -- Rewrite functionalities that have been implemented with existing HPA and VPA. -- This proposal will not support running multiple recommenders for the same MPA object. Each MPA object is supposed to use only one recommender. - -## Proposal -### User Stories -#### A New MPA Framework with Reinforcement Learning - -Many studies in research show that combined horizontal and vertical scaling can guarantee application performance with better resource efficiency using advanced algorithms such as reinforcement learning [1, 2]. These algorithms cannot be used with existing HPA and VPA frameworks. A new framework (MPA) is needed to combine horizontal and vertical scaling actions and separate the actuation of scaling actions from the autoscaling algorithms. The new MPA framework will work for all workloads on Kubernetes. - -[1] Haoran Qiu, Subho S. Banerjee, Saurabh Jha, Zbigniew T. Kalbarczyk, Ravishankar K. Iyer (2020). FIRM: An Intelligent Fine-Grained Resource Management Framework for SLO-Oriented Microservices. In Proceedings of the 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 2020). - -[2] Haoran Qiu, Weichao Mao, Archit Patke, Chen Wang, Hubertus Franke, Zbigniew T. Kalbarczyk, Tamer Başar, Ravishankar K. Iyer (2022). SIMPPO: A Scalable and Incremental Online Learning Framework for Serverless Resource Management. In Proceedings of the 13th ACM Symposium on Cloud Computing (SoCC 2022). - -#### Different Scaling Actions for Different Types of Resources - -For certain workloads, to ensure a custom metric (e.g., throughput or request-serving latency), horizontal scaling typically controls the CPU resources effectively, and vertical scaling is typically effective in increasing or decreasing the allocated memory capacity per pod. Thus, there is a need to control different types of resources at the same time using different scaling actions. Existing VPA and HPA can control these separately. However, they cannot achieve the same objective, e.g., guarantee a custom metric within an SLO target, by controlling both dimensions with different resource types independently. For example, they can lead to an awkward situation where HPA tries to spin more pods based on the higher-than-threshold CPU usage while VPA tries to squeeze the size of each pod based on the lower memory usage (after scaling out by HPA). In the end, there will be a large number of small pods created for the workloads. - -## Design Details - -Our proposed MPA framework consists of three controllers (i.e., a recommender, an updater, and an admission controller) and an MPA API (i.e., a CRD object or CR) that connects the autoscaling recommendations to actuation. The figure below describes the architectural overview of the proposed MPA framework. - -[](./kep-imgs/mpa-design.png "MPA Design Overview") - -**MPA API.** Application owners specify the autoscaling configurations which include: - -1. whether they only want to know the recommendations from MPA or they want MPA to directly actuate the autoscaling decisions; -2. application SLOs (e.g., in terms of latency or throughput) if there are; -3. any custom metrics if there are; and -4. other autoscaling configurations that exist in HPA and VPA (e.g., desired resource utilizations, container update policies, min and max number of replicas). - -MPA API is also responsible for connecting the autoscaling actions generated from the MPA Recommender to MPA Admission Controller and Updater which actually execute the scaling actions. MPA API is created based on the [multidimensional Pod scaling service] (not open-sourced) provided by Google. MPA API is a Custom Resource Definition (CRD) in Kubernetes and each MPA instance is a CR. MPA CR keeps track of recommendations on target requests and target replica numbers. - -[multidimensional Pod scaling service]: https://cloud.google.com/kubernetes-engine/docs/how-to/multidimensional-pod-autoscaling - -**Metrics APIs.** The Metrics APIs serve both default metrics or custom metrics associated with any Kubernetes objects. Custom metrics could be the application latency, throughput, or any other application-specific metrics. HPA already consumes metrics from such [a variety of metric APIs] (e.g., `metrics.k8s.io` API for resource metrics provided by metrics-server, `custom.metrics.k8s.io` API for custom metrics provided by "adapter" API servers provided by metrics solution vendors, and the `external.metrics.k8s.io` API for external metrics provided by the custom metrics adapters as well. A popular choice for the metrics collector is Prometheus. The metrics are then used by the MPA Recommender for making autoscaling decisions. - -[a variety of metric APIs]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis - -**MPA Recommender.** MPA Recommender retrieves the time-indexed measurement data from the Metrics APIs and generates the vertical and horizontal scaling actions. The actions from the MPA Recommender are then updated in the MPA API object. The autoscaling behavior is based on user-defined configurations. Users can implement their own recommenders as well. - -**MPA Updater.** MPA Updater will update the number of replicas in the deployment and evict the eligible pods for vertical scaling. - -**MPA Admission-Controller.** If users intend to directly execute the autoscaling recommendations generated from the MPA Recommender, the MPA Admission-Controller will update the deployment configuration (i.e., the size of each replica) and configure the rolling update to the Application Deployment. - -### Action Actuation Implementation - -To actuate the decisions without losing availability, we plan to: - -1. evict pods with min-replicas configured and update Pod sizes with the web-hooked admission controller (for vertical scaling), and -2. add or remove replicas (for horizontal scaling). - -We use a web-hooked admission controller to manage vertical scaling because if the actuator directly updates the vertical scaling configurations through deployment, it will potentially overload etcd (as vertical scaling might be quite frequent). -MPA Admission Controller intercepts Pod creation requests and rewrites the request by applying recommended resources to the Pod spec. -We do not use the web-hooked admission controller to manage the horizontal scaling as it could slow down the pod creation process. -In the future when the [in-place vertical resizing](https://github.com/kubernetes/enhancements/issues/1287) is enabled, we can enable the option of in-place vertical resizing while keeping the web-hooked admission controller for eviction-based vertical resizing as an option as well. - -[](./kep-imgs/mpa-action-actuation.png "MPA Action Actuation") - -Pros: -- Vertical scaling is handled by webhooks to avoid overloading etcd -- Horizontal scaling is handled through deployment to avoid extra overhead by webhooks -- Authentication and authorization for vertical scaling are handled by admission webhooks -- Recommendation and the actuation are completely separated - -Cons: -- Webhooks introduce extra overhead for vertical scaling operations (can be avoided after in-place resizing of pod is enabled without eviction) -- Vertical and horizontal scaling executions are separated (can be avoided after in-place resizing of pod is enabled without eviction) -- State changes in pod sizes are not persisted (too much to keep in etcd, could use Prometheus to store pod state changes) - -### Action Recommendation Implementation - -To generate the vertical scaling action recommendation, we reuse VPA libraries as much as possible to implement scaling algorithm integrated with the newly generated MPA API code. -To do that, we need to update accordingly the code which read and update the VPA objects to be interacting with the MPA objects. -To generate the horizontal scaling action recommendation, we reuse HPA libraries, integrating with the MPA API code, to reads and updates the MPA objects. -We integrate vertical and horizontal scaling in a single feedback cycle. -As an intitial solution, vertical scaling and horizontal scaling is performed alternatively (vertical scaling first). -Vertical scaling will scale the CPU and memory allocations based on the historical usage; and horizontal scaling will scale the number of replicas based on either CPU utilization or a custom metric. -In the future, we can consider more complex way of prioritization and conflict resolution. -The separation of recommendation and actuation allows customized recommender to be used to replace the default recommender. -For example, users can plug-in their RL-based controller to replace the MPA recommender, receiving measurements from the Metrics Server and modifying the MPA objects directly to give recommendations. - -The implementation of the MPA framework (the backend) is based on the existing HPA and VPA codebase so that it only requires minimum code maintenance. -Reused Codebase References: -- HPA: https://github.com/kubernetes/kubernetes/tree/master/pkg/controller/podautoscaler -- VPA: https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler - -### MPA API Object - -We reuse the CR definitions from the [MultidimPodAutoscaler](https://cloud.google.com/kubernetes-engine/docs/how-to/multidimensional-pod-autoscaling) object developed by Google. -`MultidimPodAutoscaler` is the configuration for multi-dimensional Pod autoscaling, which automatically manages Pod resources and their count based on historical and real-time resource utilization. -MultidimPodAutoscaler has two main fields: `spec` and `status`. - -#### MPA Object - -``` -apiVersion: autoscaling.gke.io/v1beta1 -kind: MultidimPodAutoscaler -metadata: - name: my-autoscaler -# MultidimPodAutoscalerSpec -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: my-target - policy: - updateMode: Auto - goals: - metrics: - - type: Resource - resource: - # Define the target CPU utilization request here - name: cpu - target: - type: Utilization - averageUtilization: target-cpu-util - constraints: - global: - minReplicas: min-num-replicas - maxReplicas: max-num-replicas - containerControlledResources: [ memory, cpu ] # Added cpu here as well - container: - - name: '*' # either a literal name, or "*" to match all containers - # this is not a general wildcard match - # Define boundaries for the memory request here - requests: - minAllowed: - memory: min-allowed-memory - maxAllowed: - memory: max-allowed-memory - # Define the recommender to use here - recommenders: - - name: my-recommender - -# MultidimPodAutoscalerStatus -status: - lastScaleTime: timestamp - currentReplicas: number-of-replicas - desiredReplicas: number-of-recommended-replicas - recommendation: - containerRecommendations: - - containerName: name - lowerBound: lower-bound - target: target-value - upperBound: upper-bound - conditions: - - lastTransitionTime: timestamp - message: message - reason: reason - status: status - type: condition-type - currentMetrics: - - type: metric-type - value: metric-value -``` - -### Test Plan - - - -[ ] I/we understand the owners of the involved components may require updates to -existing tests to make this code solid enough prior to committing the changes necessary -to implement this enhancement. - -#### Unit Tests - - - - - - - -Unit tests are located at each controller package. - -#### Integration Tests - - - - - -Integration tests are to be added in the beta version. - -#### End-to-End Tests - - - - - -End-to-end tests are to be added in the beta version. - -## Production Readiness Review Questionnaire - - - -### Feature Enablement and Rollback - - - -#### How can this feature be enabled / disabled in a live cluster? - -MPA can be enabled by checking the prerequisite and executing `./deploy/mpa-up.sh`. - -#### Does enabling the feature change any default behavior? - -No. - -#### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)? - -MPA can be disabled by executing `./deploy/mpa-down.sh`. - -#### What happens if we reenable the feature if it was previously rolled back? - -No impact will happen because everytime MPA is enabled it is a full new reset and restart of MPA. - -#### Are there any tests for feature enablement/disablement? - -End-to-end test of MPA will be included in the beta version. - -### Dependencies - - - -#### Does this feature depend on any specific services running in the cluster? - -MPA relies on cluster-level `metrics.k8s.io` API (for example, from [metrics-server](https://github.com/kubernetes-sigs/metrics-server)) -For the evict-and-replace mechanism, the API server needs to support the MutatingAdmissionWebhook API. - -### Scalability - - - -#### Will enabling / using this feature result in any new API calls? -No, replacing HPA/VPA with MPA only translates the way how recommendations are generated (separation of recommendation from actuation). -The original API calls used by HPA/VPA are reused by MPA and no new API calls are used by MPA. - -#### Will enabling / using this feature result in introducing new API types? -Yes, MPA introduces a new Custom Resource `MultidimPodAutoscaler`, similar to `VerticalPodAutoscaler`. - -#### Will enabling / using this feature result in any new calls to the cloud provider? -No. - -#### Will enabling / using this feature result in increasing size or count of the existing API objects? -No. It will not affect any existing API objects. - -#### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? -No. To the best of our knowledge, it will not cause any increasing time of [existing SLIs/SLOs](https://github.com/kubernetes/community/blob/master/sig-scalability/slos/slos.md). - -#### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? -No. - -#### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)? -No. - - - -#### Will enabling / using this feature result in introducing new API types? - - - -#### Will enabling / using this feature result in any new calls to the cloud provider? - - - -#### Will enabling / using this feature result in increasing size or count of the existing API objects? - - - -#### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs? - - - -#### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components? - - - -### Troubleshooting - - - -#### How does this feature react if the API server and/or etcd is unavailable? - -#### What are other known failure modes? - - - -#### What steps should be taken if SLOs are not being met to determine the problem? - -## Alternatives - - - -### MPA as a Recommender Only - -An alternative option is to have MPA just as a recommender. -For VPA, based on the support of the customized recommender, MPA can be implemented as a recommender to write to a VPA object. Then VPA updater and admission controller will actuate the recommendation. -For HPA, additional support for alternative recommenders is needed so MPA can write scaling recommendations to the HPA object as well. - -- Pros: - - Less work and easier maintenance in the future - - Simple especially when vertical and horizontal are two completely independent control loops -- Cons: - - Additional support from HPA (enabling customized recommenders) is needed which requires update in the upstream Kubernetes - - Hard to coordinate/synchronize when horizontal and vertical scaling states and decisions are kept in different places (i.e., HPA and VPA object) - -### Google GKE's Approach of MPA - -In this [alternative approach](https://cloud.google.com/kubernetes-engine/docs/how-to/multidimensional-pod-autoscaling) (non-open-sourced), a `MultidimPodAutoscaler` object modifies memory or/and CPU requests and adds replicas so that the average utilization of each replica matches your target utilization. -The MPA object will be translated to VPA and HPA objects so at the end there are two *independent* controllers managing the vertical and horizontal scaling application deployment. diff --git a/multidimensional-pod-autoscaler/kep-imgs/mpa-action-actuation.png b/multidimensional-pod-autoscaler/kep-imgs/mpa-action-actuation.png deleted file mode 100644 index 95e2d687b6aa..000000000000 Binary files a/multidimensional-pod-autoscaler/kep-imgs/mpa-action-actuation.png and /dev/null differ diff --git a/multidimensional-pod-autoscaler/kep-imgs/mpa-design.png b/multidimensional-pod-autoscaler/kep-imgs/mpa-design.png deleted file mode 100644 index 2090f97b5dd3..000000000000 Binary files a/multidimensional-pod-autoscaler/kep-imgs/mpa-design.png and /dev/null differ